From 170c0a005a55676fad515740ec6ab107b5d5c06f Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Mon, 17 May 2004 00:38:37 +0000 Subject: [PATCH] Import OpenAFS version 1.3.64 from http://www.openafs.org/dl/openafs/1.3.64 --- .cvsignore | 3 + .splintrc | 12 + Makefile-libafs.in | 9 + Makefile.in | 443 +- NEWS | 40 +- README | 88 +- README-NT | 327 + src/README-WIN9X => README-WIN9X | 5 + README.DEVEL | 78 + acconfig.h | 12 +- acinclude.m4 | 314 +- aclocal.m4 | 2802 ++++ configure | 7663 ++++++++++ configure-libafs | 7433 ++++++++++ configure-libafs.in | 23 +- configure.in | 22 +- libafsdep | 17 + mkinstalldirs | 2 +- src/..wow.3 | 0 src/.cvsignore | 1 + src/DOLASTCMP.BAT | 4 + src/JAVA/classes/ErrorMessages.properties | 930 ++ src/JAVA/classes/org/openafs/jafs/ACL.java | 1263 ++ .../org/openafs/jafs/AFSException.java | 189 + .../org/openafs/jafs/AFSFileException.java | 195 + .../openafs/jafs/AFSSecurityException.java | 187 + src/JAVA/classes/org/openafs/jafs/Cell.java | 1879 +++ .../classes/org/openafs/jafs/ErrorTable.java | 203 + src/JAVA/classes/org/openafs/jafs/File.java | 942 ++ .../org/openafs/jafs/FileInputStream.java | 167 + .../org/openafs/jafs/FileOutputStream.java | 217 + src/JAVA/classes/org/openafs/jafs/Group.java | 1278 ++ src/JAVA/classes/org/openafs/jafs/Key.java | 459 + .../classes/org/openafs/jafs/PTSEntry.java | 99 + .../classes/org/openafs/jafs/Partition.java | 1043 ++ .../classes/org/openafs/jafs/Process.java | 953 ++ src/JAVA/classes/org/openafs/jafs/Server.java | 2351 ++++ src/JAVA/classes/org/openafs/jafs/Token.java | 492 + src/JAVA/classes/org/openafs/jafs/User.java | 1939 +++ src/JAVA/classes/org/openafs/jafs/Volume.java | 1381 ++ src/JAVA/libjafs/.cvsignore | 1 + src/JAVA/libjafs/ACL.c | 219 + src/JAVA/libjafs/AdminToken.c | 383 + src/JAVA/libjafs/Cell.c | 1413 ++ src/JAVA/libjafs/Exceptions.h | 9 + src/JAVA/libjafs/File.c | 692 + src/JAVA/libjafs/FileInputStream.c | 155 + src/JAVA/libjafs/FileOutputStream.c | 185 + src/JAVA/libjafs/Group.c | 751 + src/JAVA/libjafs/Internal.c | 1042 ++ src/JAVA/libjafs/Internal.h | 80 + src/JAVA/libjafs/JAFS_README | 123 + src/JAVA/libjafs/Key.c | 244 + src/JAVA/libjafs/Makefile.in | 279 + src/JAVA/libjafs/Partition.c | 469 + src/JAVA/libjafs/Process.c | 499 + src/JAVA/libjafs/Server.c | 1569 +++ src/JAVA/libjafs/User.c | 1367 ++ src/JAVA/libjafs/UserToken.c | 325 + src/JAVA/libjafs/Volume.c | 829 ++ src/JAVA/libjafs/etc/CacheConfig | 16 + src/JAVA/libjafs/etc/CacheConfig.100MB | 16 + src/JAVA/libjafs/etc/CacheConfig.40MB | 16 + src/Makefile.am.common | 2 +- src/NTMakefile | 372 +- src/README-NT | 201 - src/SOURCE-MAP | 109 + src/TechNotes-JavaAPI | 94 + .../afs_setup_utils/GetWebDll/ntmakefile | 25 +- src/WINNT/afs_setup_utils/NTMakefile | 66 +- src/WINNT/afs_setup_utils/_isuser/ntmakefile | 36 +- src/WINNT/afs_setup_utils/lang/NTMakefile | 7 +- .../lang/de_DE/afs_setup_utils.rc | 8 + .../lang/en_US/afs_setup_utils.rc | 8 + .../lang/es_ES/afs_setup_utils.rc | 8 + .../lang/ja_JP/afs_setup_utils.rc | 8 + .../lang/ko_KR/afs_setup_utils.rc | 354 +- .../lang/pt_BR/afs_setup_utils.rc | 8 + ...{afs_setup_utmls.rc => afs_setup_utils.rc} | 8 + .../lang/zh_TW/afs_setup_utils.rc | 8 + src/WINNT/afs_setup_utils/resource.h | 72 +- src/WINNT/afsadmsvr/NTMakefile | 75 +- src/WINNT/afsadmsvr/TaAfsAdmSvr.cpp | 42 +- src/WINNT/afsadmsvr/TaAfsAdmSvrCallback.cpp | 2 +- src/WINNT/afsadmsvr/TaAfsAdmSvrCell.cpp | 4 +- src/WINNT/afsadmsvr/TaAfsAdmSvrClient.cpp | 6 +- src/WINNT/afsadmsvr/TaAfsAdmSvrGroup.cpp | 18 +- src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp | 14 +- src/WINNT/afsadmsvr/TaAfsAdmSvrUser.cpp | 10 +- src/WINNT/afsapplib/NTMakefile | 65 +- src/WINNT/afsapplib/al_cover.cpp | 8 +- src/WINNT/afsapplib/al_creds.cpp | 4 +- src/WINNT/afsapplib/al_resource.h | 30 +- src/WINNT/afsapplib/al_wizard.cpp | 2 +- src/WINNT/afsapplib/fastlist.cpp | 2 +- src/WINNT/afsapplib/lang/NTMakefile | 8 +- src/WINNT/afsapplib/lang/de_DE/afsapplib.rc | 758 +- src/WINNT/afsapplib/lang/en_US/afsapplib.rc | 4 - src/WINNT/afsapplib/lang/es_ES/afsapplib.rc | 758 +- src/WINNT/afsapplib/lang/ja_JP/afsapplib.rc | 750 +- src/WINNT/afsapplib/lang/ko_KR/afsapplib.rc | 744 +- src/WINNT/afsapplib/lang/pt_BR/afsapplib.rc | 754 +- src/WINNT/afsapplib/lang/zh_CN/afsapplib.rc | 738 +- src/WINNT/afsapplib/lang/zh_TW/afsapplib.rc | 744 +- src/WINNT/afsapplib/test/NTMakefile | 8 +- src/WINNT/afsclass/NTMakefile | 32 +- src/WINNT/afsclass/c_grp.cpp | 1 + src/WINNT/afsclass/c_set.cpp | 30 +- src/WINNT/afsclass/c_svr.cpp | 1 + src/WINNT/afsclass/c_usr.cpp | 3 +- src/WINNT/afsclass/worker.cpp | 4 - src/WINNT/afsd/NTMakefile | 293 +- src/WINNT/afsd/afsd.c | 28 +- src/WINNT/afsd/afsd_eventlog.c | 222 + src/WINNT/afsd/afsd_eventlog.h | 13 + src/WINNT/afsd/afsd_eventmessages.mc | 109 + src/WINNT/afsd/afsd_eventmessages.rc | 2 + src/WINNT/afsd/afsd_flushvol.c | 497 + src/WINNT/afsd/afsd_flushvol.h | 45 + src/WINNT/afsd/afsd_init.c | 607 +- src/WINNT/afsd/afsd_init.h | 4 +- src/WINNT/afsd/afsd_service.c | 533 +- src/WINNT/afsd/afskfw-int.h | 252 + src/WINNT/afsd/afskfw.c | 3204 +++++ src/WINNT/afsd/afskfw.h | 88 + src/WINNT/afsd/afslogon.c | 297 +- src/WINNT/afsd/cklog.c | 10 +- src/WINNT/afsd/cm.h | 23 +- src/WINNT/afsd/cm_access.c | 40 +- src/WINNT/afsd/cm_aclent.c | 12 +- src/WINNT/afsd/cm_buf.c | 77 +- src/WINNT/afsd/cm_callback.c | 78 +- src/WINNT/afsd/cm_cell.c | 70 +- src/WINNT/afsd/cm_config.c | 480 +- src/WINNT/afsd/cm_conn.c | 251 +- src/WINNT/afsd/cm_daemon.c | 42 +- src/WINNT/afsd/cm_dcache.c | 6 +- src/WINNT/afsd/cm_dnlc.c | 96 +- src/WINNT/afsd/cm_dns.c | 15 +- src/WINNT/afsd/cm_freelance.c | 24 +- src/WINNT/afsd/cm_ioctl.c | 263 +- src/WINNT/afsd/cm_ioctl.h | 3 + src/WINNT/afsd/cm_rpc.c | 2 +- src/WINNT/afsd/cm_scache.c | 63 +- src/WINNT/afsd/cm_server.c | 60 +- src/WINNT/afsd/cm_user.c | 20 +- src/WINNT/afsd/cm_vnodeops.c | 596 +- src/WINNT/afsd/cm_vnodeops.h | 2 +- src/WINNT/afsd/cm_volume.c | 86 +- src/WINNT/afsd/fs.c | 295 +- src/WINNT/afsd/fs.h | 2 +- src/WINNT/afsd/fs_utils.c | 38 +- src/WINNT/afsd/fs_utils.h | 12 +- src/WINNT/afsd/lanahelper.cpp | 627 + src/WINNT/afsd/lanahelper.h | 54 + src/WINNT/afsd/sample/token.c | 582 +- src/WINNT/afsd/smb.c | 5790 ++++---- src/WINNT/afsd/smb.h | 52 +- src/WINNT/afsd/smb3.c | 3070 ++-- src/WINNT/afsd/smb_iocons.h | 6 +- src/WINNT/afsd/smb_ioctl.c | 17 +- src/WINNT/afslegal/NTMakefile | 14 +- src/WINNT/afslegal/lang/NTMakefile | 7 +- src/WINNT/afslegal/resource.h | 10 +- src/WINNT/afsreg/NTMakefile | 13 +- src/WINNT/afsreg/test/NTMakefile | 12 +- src/WINNT/afssvrcfg/NTMakefile | 78 +- src/WINNT/afssvrcfg/afscfg.cpp | 35 +- src/WINNT/afssvrcfg/afscfg.h | 2 +- src/WINNT/afssvrcfg/cfg_utils.cpp | 4 +- src/WINNT/afssvrcfg/config_server_page.cpp | 15 +- src/WINNT/afssvrcfg/create_partition_dlg.cpp | 20 +- src/WINNT/afssvrcfg/get_cur_config.cpp | 3 +- src/WINNT/afssvrcfg/hourglass.h | 41 +- src/WINNT/afssvrcfg/lang/NTMakefile | 10 +- src/WINNT/afssvrcfg/partitions_page.cpp | 3 +- src/WINNT/afssvrcfg/resource.h | 609 +- src/WINNT/afssvrcfg/salvage_dlg.cpp | 1 - src/WINNT/afssvrcfg/salvage_results_dlg.cpp | 8 +- src/WINNT/afssvrcfg/services_page.cpp | 2 +- src/WINNT/afssvrcfg/validation.cpp | 264 +- src/WINNT/afssvrcfg/validation.h | 37 +- src/WINNT/afssvrcfg/volume_utils.cpp | 2 +- src/WINNT/afssvrcpa/NTMakefile | 21 +- src/WINNT/afssvrcpa/lang/NTMakefile | 10 +- src/WINNT/afssvrcpa/resource.h | 9 +- src/WINNT/afssvrmgr/NTMakefile | 132 +- src/WINNT/afssvrmgr/action.cpp | 6 +- src/WINNT/afssvrmgr/agg_tab.cpp | 8 +- src/WINNT/afssvrmgr/alert.cpp | 3 +- src/WINNT/afssvrmgr/cmdline.cpp | 20 +- src/WINNT/afssvrmgr/columns.cpp | 16 +- src/WINNT/afssvrmgr/creds.cpp | 2 +- src/WINNT/afssvrmgr/dispguts.cpp | 4 +- src/WINNT/afssvrmgr/lang/NTMakefile | 10 +- src/WINNT/afssvrmgr/lang/de_DE/svrmgr.rc | 6040 ++++---- src/WINNT/afssvrmgr/lang/en_US/svrmgr.rc | 42 +- src/WINNT/afssvrmgr/lang/es_ES/svrmgr.rc | 6094 ++++---- src/WINNT/afssvrmgr/lang/ja_JP/svrmgr.rc | 5994 ++++---- src/WINNT/afssvrmgr/lang/ko_KR/svrmgr.rc | 5948 ++++---- src/WINNT/afssvrmgr/lang/pt_BR/svrmgr.rc | 6034 ++++---- src/WINNT/afssvrmgr/lang/zh_CN/svrmgr.rc | 5838 ++++---- src/WINNT/afssvrmgr/lang/zh_TW/svrmgr.rc | 5904 ++++---- src/WINNT/afssvrmgr/problems.cpp | 2 + src/WINNT/afssvrmgr/resource.h | 1027 +- src/WINNT/afssvrmgr/set_clone.cpp | 2 +- src/WINNT/afssvrmgr/set_tab.cpp | 14 +- src/WINNT/afssvrmgr/svc_tab.cpp | 12 +- src/WINNT/afssvrmgr/svc_viewlog.cpp | 14 +- src/WINNT/afssvrmgr/svr_col.cpp | 2 +- src/WINNT/afssvrmgr/svr_salvage.cpp | 8 +- src/WINNT/afssvrmgr/svr_window.cpp | 8 +- src/WINNT/afssvrmgr/svrmgr.cpp | 2 +- src/WINNT/afssvrmgr/task.cpp | 4 - src/WINNT/afssvrmgr/window.cpp | 68 +- src/WINNT/afsusrmgr/NTMakefile | 78 +- src/WINNT/afsusrmgr/action.cpp | 6 +- src/WINNT/afsusrmgr/cmdline.cpp | 8 +- src/WINNT/afsusrmgr/columns.cpp | 6 +- src/WINNT/afsusrmgr/grp_tab.cpp | 20 +- src/WINNT/afsusrmgr/lang/NTMakefile | 10 +- src/WINNT/afsusrmgr/main.cpp | 2 +- src/WINNT/afsusrmgr/mch_delete.cpp | 1 - src/WINNT/afsusrmgr/mch_tab.cpp | 20 +- src/WINNT/afsusrmgr/resource.h | 355 +- src/WINNT/afsusrmgr/task.cpp | 4 - src/WINNT/afsusrmgr/usr_tab.cpp | 20 +- src/WINNT/afsusrmgr/window.cpp | 18 +- src/WINNT/aklog/NTMakefile | 59 + src/WINNT/aklog/aklog.c | 1168 ++ src/WINNT/aklog/aklog.h | 63 + src/WINNT/aklog/aklog.rc | 17 + src/WINNT/aklog/linked_list.c | 173 + src/WINNT/aklog/linked_list.h | 49 + src/WINNT/bosctlsvc/NTMakefile | 10 +- src/WINNT/bosctlsvc/bosctlsvc.c | 6 +- src/WINNT/client_config/NTMakefile | 159 +- src/WINNT/client_config/RegistrySupport.cpp | 201 + src/WINNT/client_config/afs_config.h | 4 +- src/WINNT/client_config/config.cpp | 209 +- src/WINNT/client_config/config.h | 13 +- src/WINNT/client_config/dlg_automap.cpp | 19 +- src/WINNT/client_config/dlg_binding.cpp | 263 + src/WINNT/client_config/dlg_misc.cpp | 17 +- src/WINNT/client_config/drivemap.cpp | 357 +- src/WINNT/client_config/drivemap.h | 4 + src/WINNT/client_config/lang/NTMakefile | 8 +- .../client_config/lang/en_US/afs_config.rc | 94 +- .../client_config/lang/zh_CN/afs_config.rc | 1510 +- src/WINNT/client_config/main.cpp | 14 +- src/WINNT/client_config/resource.h | 148 +- src/WINNT/client_config/tab_advanced.cpp | 10 + src/WINNT/client_config/tab_drives.cpp | 39 +- src/WINNT/client_cpa/NTMakefile | 16 +- src/WINNT/client_cpa/lang/NTMakefile | 9 +- src/WINNT/client_cpa/resource.h | 13 +- src/WINNT/client_creds/Makefile | 2 +- src/WINNT/client_creds/NTMakefile | 112 +- src/WINNT/client_creds/advtab.cpp | 103 +- src/WINNT/client_creds/afscreds.h | 22 +- src/WINNT/client_creds/afswiz.cpp | 25 +- src/WINNT/client_creds/creds.cpp | 56 +- src/WINNT/client_creds/creds.h | 9 +- src/WINNT/client_creds/credstab.cpp | 68 +- src/WINNT/client_creds/ipaddrchg.c | 515 + src/WINNT/client_creds/ipaddrchg.h | 44 + src/WINNT/client_creds/lang/NTMakefile | 10 +- src/WINNT/client_creds/lang/de_DE/afscreds.rc | 1118 +- src/WINNT/client_creds/lang/en_US/afscreds.rc | 13 +- src/WINNT/client_creds/lang/es_ES/afscreds.rc | 1166 +- src/WINNT/client_creds/lang/ja_JP/afscreds.rc | 1138 +- src/WINNT/client_creds/lang/ko_KR/afscreds.rc | 1102 +- src/WINNT/client_creds/lang/pt_BR/afscreds.rc | 1116 +- src/WINNT/client_creds/lang/zh_CN/afscreds.rc | 1096 +- src/WINNT/client_creds/lang/zh_TW/afscreds.rc | 1124 +- src/WINNT/client_creds/main.cpp | 159 +- src/WINNT/client_creds/misc.cpp | 4 +- src/WINNT/client_creds/mounttab.cpp | 26 +- src/WINNT/client_creds/resource.h | 105 +- src/WINNT/client_creds/shortcut.cpp | 47 +- src/WINNT/client_creds/shortcut.h | 2 +- src/WINNT/client_creds/trayicon.cpp | 2 + src/WINNT/client_creds/window.cpp | 168 +- src/WINNT/client_exp/NTMakefile | 75 +- src/WINNT/client_exp/afs_shl_ext.cpp | 175 +- src/WINNT/client_exp/afs_shl_ext.def | 9 +- src/WINNT/client_exp/gui2fs.cpp | 108 +- src/WINNT/client_exp/gui2fs.h | 3 +- src/WINNT/client_exp/hourglass.h | 42 +- src/WINNT/client_exp/lang/NTMakefile | 10 +- .../client_exp/lang/de_DE/afs_shl_ext.rc | 1270 +- .../client_exp/lang/en_US/afs_shl_ext.rc | 22 +- .../client_exp/lang/es_ES/afs_shl_ext.rc | 10 +- .../client_exp/lang/ja_JP/afs_shl_ext.rc | 10 +- .../client_exp/lang/ko_KR/afs_shl_ext.rc | 10 +- .../client_exp/lang/pt_BR/afs_shl_ext.rc | 10 +- .../client_exp/lang/zh_CN/afs_shl_ext.rc | 10 +- .../client_exp/lang/zh_TW/afs_shl_ext.rc | 10 +- .../client_exp/make_symbolic_link_dlg.cpp | 144 + src/WINNT/client_exp/make_symbolic_link_dlg.h | 47 + src/WINNT/client_exp/partition_info_dlg.cpp | 7 +- src/WINNT/client_exp/resource.h | 309 +- src/WINNT/client_exp/shell_ext.cpp | 107 +- src/WINNT/client_exp/shell_ext.h | 4 +- src/WINNT/client_exp/stdafx.h | 3 + src/WINNT/client_osi/NTMakefile | 90 +- src/WINNT/client_osi/NTMakefile-TestOSI | 39 + src/WINNT/client_osi/basic.c | 11 +- src/WINNT/client_osi/largeint.h | 257 + src/WINNT/client_osi/libosi.def | 1 + src/WINNT/client_osi/libosi.hpj | 12 +- src/WINNT/client_osi/libosi.rc | 8 +- src/WINNT/client_osi/main.c | 12 +- src/WINNT/client_osi/osi.h | 13 +- src/WINNT/client_osi/osibasel.c | 12 +- src/WINNT/client_osi/osibasel.h | 11 +- src/WINNT/client_osi/osidb.c | 11 +- src/WINNT/client_osi/osidb.h | 11 +- src/WINNT/client_osi/osidebug.c | 11 +- src/WINNT/client_osi/osidebug.h | 11 +- src/WINNT/client_osi/osidebug.hpj | 12 +- src/WINNT/client_osi/osievent.mc | 393 + src/WINNT/client_osi/osifd.c | 11 +- src/WINNT/client_osi/osifd.h | 11 +- src/WINNT/client_osi/osilog.c | 58 +- src/WINNT/client_osi/osilog.h | 1 + src/WINNT/client_osi/osiltype.c | 11 +- src/WINNT/client_osi/osiqueue.c | 11 +- src/WINNT/client_osi/osiqueue.h | 11 +- src/WINNT/client_osi/osisleep.c | 11 +- src/WINNT/client_osi/osisleep.h | 11 +- src/WINNT/client_osi/osistatl.c | 11 +- src/WINNT/client_osi/osistatl.h | 13 +- src/WINNT/client_osi/osithrd95.c | 11 +- src/WINNT/client_osi/osiutils.c | 11 +- src/WINNT/client_osi/osiutils.h | 11 +- src/WINNT/client_osi/perf.c | 11 +- src/WINNT/client_osi/perf.h | 11 +- src/WINNT/client_osi/trylock.c | 11 +- src/WINNT/client_osi/trylock.h | 11 +- src/WINNT/doc/help/en_US/afs-cc.CNT | 20 +- src/WINNT/doc/help/en_US/afs-light.CNT | 126 +- src/WINNT/doc/help/en_US/afs-nt.CNT | 154 +- src/WINNT/doc/help/en_US/taafscfg.cnt | 64 +- src/WINNT/doc/help/en_US/taafssvrmgr.cnt | 178 +- src/WINNT/doc/help/en_US/taafsusrmgr.cnt | 132 +- src/WINNT/eventlog/NTMakefile | 12 +- src/WINNT/eventlog/lang/NTMakefile | 5 +- src/WINNT/eventlog/lang/de_DE/event.mc | 6 +- src/WINNT/eventlog/lang/en_US/event.mc | 6 +- src/WINNT/eventlog/lang/es_ES/event.mc | 6 +- src/WINNT/eventlog/lang/ja_JP/event.mc | 6 +- src/WINNT/eventlog/lang/ko_KR/event.mc | 6 +- src/WINNT/eventlog/lang/pt_BR/event.mc | 6 +- src/WINNT/eventlog/lang/zh_CN/event.mc | 6 +- src/WINNT/eventlog/lang/zh_TW/event.mc | 6 +- src/WINNT/eventlog/logevent.h | 6 +- src/WINNT/eventlog/test/NTMakefile | 6 +- .../install/InstallShield5/BuildSetup.bat | 2 +- .../InstallShield5/CreateISDirTree.bat | 72 +- src/WINNT/install/InstallShield5/NTMakefile | 55 +- src/WINNT/install/InstallShield5/afsdcell.ini | 487 +- src/WINNT/install/NSIS/AFSCell.ini | 107 + src/WINNT/install/NSIS/CellServPage.ini | 59 + src/WINNT/install/NSIS/MakeCommon.bat | 12 + src/WINNT/install/NSIS/NTMakefile | 91 + src/WINNT/install/NSIS/OpenAFS.nsi | 3592 +++++ src/WINNT/install/NSIS/Service.cpp | 63 + src/WINNT/install/NSIS/ServiceLib.nsh | 342 + src/WINNT/install/NSIS/afsdcell.ini | 483 + src/WINNT/install/NSIS/killer.cpp | 380 + src/WINNT/install/Win9x/CellServDB | 523 +- src/WINNT/install/Win9x/NTMakeFile | 20 +- src/WINNT/kfw/inc/kclient/kclient.h | 48 + src/WINNT/kfw/inc/kclient/kcmacerr.h | 68 + src/WINNT/kfw/inc/krb4/com_err.h | 56 + src/WINNT/kfw/inc/krb4/conf-pc.h | 108 + src/WINNT/kfw/inc/krb4/conf.h | 74 + src/WINNT/kfw/inc/krb4/des.h | 115 + src/WINNT/kfw/inc/krb4/kadm_err.h | 56 + src/WINNT/kfw/inc/krb4/krb.h | 455 + src/WINNT/kfw/inc/krb4/krberr.h | 22 + src/WINNT/kfw/inc/krb4/mit_copy.h | 20 + src/WINNT/kfw/inc/krb4/osconf.h | 59 + src/WINNT/kfw/inc/krb5/KerberosIV/des.h | 209 + src/WINNT/kfw/inc/krb5/KerberosIV/kadm_err.h | 58 + src/WINNT/kfw/inc/krb5/KerberosIV/krb.h | 794 ++ src/WINNT/kfw/inc/krb5/KerberosIV/krb_err.h | 278 + .../kfw/inc/krb5/KerberosIV/mit-copyright.h | 23 + src/WINNT/kfw/inc/krb5/com_err.h | 72 + src/WINNT/kfw/inc/krb5/gssapi/gssapi.h | 805 ++ .../kfw/inc/krb5/gssapi/gssapi_generic.h | 55 + src/WINNT/kfw/inc/krb5/gssapi/gssapi_krb5.h | 114 + src/WINNT/kfw/inc/krb5/krb5.h | 3063 ++++ src/WINNT/kfw/inc/krb5/profile.h | 179 + src/WINNT/kfw/inc/krb5/win-mac.h | 176 + src/WINNT/kfw/inc/krbcc/cacheapi.h | 458 + src/WINNT/kfw/inc/leash/leasherr.h | 32 + src/WINNT/kfw/inc/leash/leashinfo.h | 2 + src/WINNT/kfw/inc/leash/leashwin.h | 133 + src/WINNT/kfw/inc/loadfuncs/loadfuncs-afs.h | 51 + src/WINNT/kfw/inc/loadfuncs/loadfuncs-afs36.h | 51 + .../kfw/inc/loadfuncs/loadfuncs-com_err.h | 40 + src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb.h | 306 + src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb5.h | 1737 +++ .../kfw/inc/loadfuncs/loadfuncs-krb524.h | 23 + src/WINNT/kfw/inc/loadfuncs/loadfuncs-leash.h | 373 + src/WINNT/kfw/inc/loadfuncs/loadfuncs-lsa.h | 45 + .../kfw/inc/loadfuncs/loadfuncs-profile.h | 147 + .../kfw/inc/loadfuncs/loadfuncs-wshelper.h | 232 + src/WINNT/kfw/inc/loadfuncs/loadfuncs.c | 88 + src/WINNT/kfw/inc/loadfuncs/loadfuncs.h | 41 + src/WINNT/kfw/inc/wshelper/arpa/nameser.h | 263 + src/WINNT/kfw/inc/wshelper/hesiod.h | 125 + src/WINNT/kfw/inc/wshelper/mitwhich.h | 156 + src/WINNT/kfw/inc/wshelper/resolv.h | 201 + src/WINNT/kfw/inc/wshelper/wshelper.h | 58 + src/WINNT/kfw/lib/i386/comerr32.lib | Bin 0 -> 2560 bytes src/WINNT/kfw/lib/i386/delaydlls.lib | Bin 0 -> 13306 bytes src/WINNT/kfw/lib/i386/getopt.lib | Bin 0 -> 5932 bytes src/WINNT/kfw/lib/i386/gssapi32.lib | Bin 0 -> 13558 bytes src/WINNT/kfw/lib/i386/kclnt32.lib | Bin 0 -> 4570 bytes src/WINNT/kfw/lib/i386/krb524.lib | Bin 0 -> 1976 bytes src/WINNT/kfw/lib/i386/krb5_32.lib | Bin 0 -> 62630 bytes src/WINNT/kfw/lib/i386/krbcc32.lib | Bin 0 -> 6844 bytes src/WINNT/kfw/lib/i386/krbv4w32.lib | Bin 0 -> 19668 bytes src/WINNT/kfw/lib/i386/leashw32.lib | Bin 0 -> 20078 bytes src/WINNT/kfw/lib/i386/loadfuncs.lib | Bin 0 -> 1646 bytes src/WINNT/kfw/lib/i386/wshelp32.lib | Bin 0 -> 6982 bytes src/WINNT/kfw/lib/i386/xpprof32.lib | Bin 0 -> 6114 bytes src/WINNT/license/NTMakefile | 10 +- src/WINNT/license/lang/NTMakefile | 3 + src/WINNT/pthread/NTMakefile | 24 +- src/WINNT/pthread/pthread.c | 20 +- src/WINNT/pthread/test/NTMakefile | 12 +- src/WINNT/pthread/test/native.cpp | 800 +- src/WINNT/talocale/NTMakefile | 13 +- src/WINNT/talocale/tal_alloc.cpp | 6 +- src/WINNT/talocale/tal_dialog.cpp | 8 +- src/WINNT/talocale/tal_main.cpp | 174 +- src/WINNT/talocale/tal_string.cpp | 75 +- src/WINNT/win9xpanel/NTMakefile | 22 +- src/WINNT/win9xpanel/resource.h | 14 +- src/afs/.cvsignore | 2 + src/afs/AIX/osi_assem32.s | 43 + src/afs/AIX/osi_assem64.s | 43 + src/afs/AIX/osi_config.c | 397 +- src/afs/AIX/osi_file.c | 186 +- src/afs/AIX/osi_groups.c | 83 +- src/afs/AIX/osi_inode.c | 448 +- src/afs/AIX/osi_machdep.h | 2 +- src/afs/AIX/osi_misc.c | 125 +- src/afs/AIX/osi_prototypes.h | 3 + src/afs/AIX/osi_sleep.c | 77 +- src/afs/AIX/osi_timeout.c | 547 +- src/afs/AIX/osi_vfs.h | 5 +- src/afs/AIX/osi_vfsops.c | 123 +- src/afs/AIX/osi_vm.c | 90 +- src/afs/AIX/osi_vnodeops.c | 2651 ++-- src/afs/DARWIN/osi_file.c | 256 +- src/afs/DARWIN/osi_groups.c | 82 +- src/afs/DARWIN/osi_inode.c | 206 +- src/afs/DARWIN/osi_inode.h | 4 +- src/afs/DARWIN/osi_machdep.h | 8 +- src/afs/DARWIN/osi_misc.c | 53 +- src/afs/DARWIN/osi_module.c | 87 +- src/afs/DARWIN/osi_prototypes.h | 5 +- src/afs/DARWIN/osi_sleep.c | 120 +- src/afs/DARWIN/osi_vfsops.c | 346 +- src/afs/DARWIN/osi_vm.c | 329 +- src/afs/DARWIN/osi_vnodeops.c | 1188 +- src/afs/DOC/afs_rwlocks | 63 +- src/afs/DUX/osi_file.c | 273 +- src/afs/DUX/osi_groups.c | 68 +- src/afs/DUX/osi_inode.c | 190 +- src/afs/DUX/osi_inode.h | 2 +- src/afs/DUX/osi_misc.c | 16 +- src/afs/DUX/osi_prototypes.h | 12 + src/afs/DUX/osi_sleep.c | 74 +- src/afs/DUX/osi_vfsops.c | 192 +- src/afs/DUX/osi_vm.c | 57 +- src/afs/DUX/osi_vnodeops.c | 721 +- src/afs/FBSD/osi_file.c | 219 +- src/afs/FBSD/osi_groups.c | 135 +- src/afs/FBSD/osi_inode.c | 210 +- src/afs/FBSD/osi_inode.h | 2 +- src/afs/FBSD/osi_machdep.h | 58 +- src/afs/FBSD/osi_misc.c | 182 +- src/afs/FBSD/osi_module.c | 143 +- src/afs/FBSD/osi_prototypes.h | 17 +- src/afs/FBSD/osi_sleep.c | 154 +- src/afs/FBSD/osi_vfsops.c | 230 +- src/afs/FBSD/osi_vm.c | 211 +- src/afs/FBSD/osi_vnodeops.c | 1350 +- src/afs/FBSD/vnode_if.h | 1423 -- src/afs/HPUX/hpux_mod.modmeta | 8 + src/afs/HPUX/osi_debug.c | 3 +- src/afs/HPUX/osi_file.c | 164 +- src/afs/HPUX/osi_groups.c | 128 +- src/afs/HPUX/osi_inode.c | 333 +- src/afs/HPUX/osi_inode.h | 3 +- src/afs/HPUX/osi_machdep.h | 20 +- src/afs/HPUX/osi_misc.c | 12 +- src/afs/HPUX/osi_prototypes.h | 12 + src/afs/HPUX/osi_sleep.c | 133 +- src/afs/HPUX/osi_vfs.h | 8 +- src/afs/HPUX/osi_vfsops.c | 172 +- src/afs/HPUX/osi_vm.c | 40 +- src/afs/HPUX/osi_vnodeops.c | 2794 ++-- src/afs/IRIX/osi_file.c | 176 +- src/afs/IRIX/osi_groups.c | 197 +- src/afs/IRIX/osi_idbg.c | 173 +- src/afs/IRIX/osi_inode.c | 785 +- src/afs/IRIX/osi_inode.h | 10 +- src/afs/IRIX/osi_machdep.h | 7 +- src/afs/IRIX/osi_misc.c | 39 +- src/afs/IRIX/osi_prototypes.h | 16 + src/afs/IRIX/osi_sleep.c | 75 +- src/afs/IRIX/osi_vfs.h | 110 +- src/afs/IRIX/osi_vfsops.c | 535 +- src/afs/IRIX/osi_vm.c | 79 +- src/afs/IRIX/osi_vnodeops.c | 1346 +- src/afs/LINUX/.cvsignore | 1 + src/afs/LINUX/osi_alloc.c | 238 +- src/afs/LINUX/osi_cred.c | 87 +- src/afs/LINUX/osi_file.c | 165 +- src/afs/LINUX/osi_groups.c | 285 +- src/afs/LINUX/osi_inode.c | 35 +- src/afs/LINUX/osi_machdep.h | 73 +- src/afs/LINUX/osi_misc.c | 275 +- src/afs/LINUX/osi_module.c | 645 +- src/afs/LINUX/osi_prototypes.h | 20 +- src/afs/LINUX/osi_sleep.c | 152 +- src/afs/LINUX/osi_sysctl.c | 74 +- src/afs/LINUX/osi_vfs.hin | 15 +- src/afs/LINUX/osi_vfsops.c | 329 +- src/afs/LINUX/osi_vm.c | 41 +- src/afs/LINUX/osi_vnodeops.c | 1203 +- src/afs/Makefile.am | 2 +- src/afs/Makefile.in | 86 +- src/afs/NBSD/opt_posix.h | 2 + src/afs/NBSD/osi_file.c | 234 + src/afs/NBSD/osi_groups.c | 152 + src/afs/NBSD/osi_inode.c | 285 + src/afs/NBSD/osi_inode.h | 70 + src/afs/NBSD/osi_machdep.h | 91 + src/afs/NBSD/osi_misc.c | 40 + src/afs/NBSD/osi_sleep.c | 205 + src/afs/NBSD/osi_vfsops.c | 500 + src/afs/NBSD/osi_vm.c | 204 + src/afs/NBSD/osi_vnodeops.c | 1108 ++ src/afs/NTMakefile | 21 + src/afs/OBSD/osi_file.c | 229 + src/afs/OBSD/osi_groups.c | 139 + src/afs/OBSD/osi_inode.h | 10 + src/afs/OBSD/osi_machdep.h | 155 + src/afs/OBSD/osi_misc.c | 113 + src/afs/OBSD/osi_prototypes.h | 12 + src/afs/OBSD/osi_sleep.c | 144 + src/afs/OBSD/osi_vfsops.c | 510 + src/afs/OBSD/osi_vm.c | 98 + src/afs/OBSD/osi_vnodeops.c | 1085 ++ src/afs/SOLARIS/osi_file.c | 224 +- src/afs/SOLARIS/osi_groups.c | 70 +- src/afs/SOLARIS/osi_inode.c | 131 +- src/afs/SOLARIS/osi_inode.h | 4 +- src/afs/SOLARIS/osi_machdep.h | 19 +- src/afs/SOLARIS/osi_prototypes.h | 13 +- src/afs/SOLARIS/osi_sleep.c | 84 +- src/afs/SOLARIS/osi_vfsops.c | 196 +- src/afs/SOLARIS/osi_vm.c | 75 +- src/afs/SOLARIS/osi_vnodeops.c | 1471 +- src/afs/SUNOS/osi_inode.h | 2 +- src/afs/UKERNEL/afs_usrops.c | 1576 +-- src/afs/UKERNEL/afs_usrops.h | 20 +- src/afs/UKERNEL/afsincludes.h | 35 +- src/afs/UKERNEL/osi_groups.c | 47 +- src/afs/UKERNEL/osi_machdep.h | 5 +- src/afs/UKERNEL/osi_vfsops.c | 79 +- src/afs/UKERNEL/osi_vm.c | 37 +- src/afs/UKERNEL/osi_vnodeops.c | 78 +- src/afs/UKERNEL/sysincludes.h | 461 +- src/afs/VNOPS/afs_vnop_access.c | 255 +- src/afs/VNOPS/afs_vnop_attrs.c | 406 +- src/afs/VNOPS/afs_vnop_create.c | 385 +- src/afs/VNOPS/afs_vnop_dirops.c | 251 +- src/afs/VNOPS/afs_vnop_fid.c | 61 +- src/afs/VNOPS/afs_vnop_flock.c | 790 +- src/afs/VNOPS/afs_vnop_link.c | 120 +- src/afs/VNOPS/afs_vnop_lookup.c | 1314 +- src/afs/VNOPS/afs_vnop_open.c | 100 +- src/afs/VNOPS/afs_vnop_read.c | 959 +- src/afs/VNOPS/afs_vnop_readdir.c | 753 +- src/afs/VNOPS/afs_vnop_remove.c | 358 +- src/afs/VNOPS/afs_vnop_rename.c | 328 +- src/afs/VNOPS/afs_vnop_strategy.c | 110 +- src/afs/VNOPS/afs_vnop_symlink.c | 339 +- src/afs/VNOPS/afs_vnop_write.c | 632 +- src/afs/afs.h | 795 +- src/afs/afs_analyze.c | 669 +- src/afs/afs_axscache.c | 128 +- src/afs/afs_axscache.h | 21 +- src/afs/afs_buffer.c | 434 +- src/afs/afs_call.c | 2254 +-- src/afs/afs_callback.c | 885 +- src/afs/afs_cbqueue.c | 402 +- src/afs/afs_cbqueue.h | 23 +- src/afs/afs_cell.c | 249 +- src/afs/afs_chunk.c | 63 +- src/afs/afs_chunkops.h | 74 +- src/afs/afs_conn.c | 393 +- src/afs/afs_daemons.c | 1107 +- src/afs/afs_dcache.c | 2543 ++-- src/afs/afs_dynroot.c | 294 +- src/afs/afs_exporter.c | 36 +- src/afs/afs_init.c | 767 +- src/afs/afs_lock.c | 289 +- src/afs/afs_mariner.c | 92 +- src/afs/afs_memcache.c | 891 +- src/afs/afs_nfsclnt.c | 208 +- src/afs/afs_nfsdisp.c | 1870 +-- src/afs/afs_osi.c | 658 +- src/afs/afs_osi.h | 145 +- src/afs/afs_osi_alloc.c | 195 +- src/afs/afs_osi_pag.c | 232 +- src/afs/afs_osi_uio.c | 54 +- src/afs/afs_osi_vget.c | 24 +- src/afs/afs_osidnlc.c | 726 +- src/afs/afs_osidnlc.h | 33 +- src/afs/afs_pioctl.c | 4231 +++--- src/afs/afs_prototypes.h | 1024 +- src/afs/afs_segments.c | 1305 +- src/afs/afs_server.c | 1705 +-- src/afs/afs_stat.c | 62 +- src/afs/afs_stats.h | 1336 +- src/afs/afs_trace.et | 106 +- src/afs/afs_user.c | 325 +- src/afs/afs_util.c | 289 +- src/afs/afs_util.h | 2 +- src/afs/afs_vcache.c | 2392 ++-- src/afs/afs_volume.c | 650 +- src/afs/afsincludes.h | 55 +- src/afs/exporter.h | 46 +- src/afs/libafsdep | 4 + src/afs/lock.h | 125 +- src/afs/longc_procs.h | 54 +- src/afs/nfsclient.h | 16 +- src/afs/sysincludes.h | 213 +- src/afs/unified_afs.et | 125 + src/afs/unified_afs.p.h | 369 + src/afs/voldefs.h | 2 +- src/afs/volerrors.h | 24 +- src/afsd/Makefile.in | 105 +- src/afsd/afs.conf.linux | 6 + src/afsd/afs.hpux102.driver | 2 +- src/afsd/afs.rc.linux | 16 +- src/afsd/afs.rc.obsd | 9 + src/afsd/afs.rc.sgi | 7 +- src/afsd/afs.rc.solaris | 6 +- src/afsd/afs.rc.solaris.2.7 | 6 +- src/afsd/afs.rc.solaris.2.8 | 6 +- src/afsd/afs.rc.solaris.2.9 | 12 +- src/afsd/afs.rc.solaris.2_5 | 6 +- src/afsd/afsd.c | 1820 +-- src/afsd/rc.afs.rs_aix | 20 +- src/afsd/rc.dkload.client.rs_aix | 18 +- src/afsd/vsys.c | 30 +- src/afsmonitor/Makefile.in | 32 +- src/afsmonitor/afsmon-labels.h | 3420 +++-- src/afsmonitor/afsmon-output.c | 963 +- src/afsmonitor/afsmon-parselog.c | 781 +- src/afsmonitor/afsmon-win.c | 3662 ++--- src/afsmonitor/afsmonitor.c | 5411 +++---- src/afsmonitor/afsmonitor.h | 52 +- src/afsweb/Makefile.in | 40 +- src/afsweb/README | 2 +- src/afsweb/README.BETA2 | 2 +- src/afsweb/afswsNetscape_config.sh | 803 +- src/afsweb/apache_afs_cache.c | 429 +- src/afsweb/apache_afs_cache.h | 16 +- src/afsweb/apache_afs_client.c | 1390 +- src/afsweb/apache_afs_module.c | 513 +- src/afsweb/apache_afs_plugin.c | 923 +- src/afsweb/apache_afs_utils.c | 337 +- src/afsweb/apache_afs_utils.h | 12 +- src/afsweb/apache_afs_weblog.c | 331 +- src/afsweb/apache_api.h | 2 +- src/afsweb/apache_includes/1.2/alloc.h | 90 +- src/afsweb/apache_includes/1.2/buff.h | 65 +- src/afsweb/apache_includes/1.2/conf.h | 140 +- .../apache_includes/1.2/http_conf_globals.h | 1 - src/afsweb/apache_includes/1.2/httpd.h | 375 +- src/afsweb/apache_includes/1.3.1/alloc.h | 227 +- src/afsweb/apache_includes/1.3.1/ap.h | 39 +- src/afsweb/apache_includes/1.3.1/ap_compat.h | 4 +- src/afsweb/apache_includes/1.3.1/ap_config.h | 247 +- src/afsweb/apache_includes/1.3.1/ap_ctype.h | 3 +- src/afsweb/apache_includes/1.3.1/buff.h | 161 +- .../apache_includes/1.3.1/http_conf_globals.h | 59 +- src/afsweb/apache_includes/1.3.1/httpd.h | 635 +- src/afsweb/apache_includes/1.3.1/os.h | 8 +- src/afsweb/apache_includes/1.3.1/util_uri.h | 71 +- src/afsweb/apache_includes/1.3.6/alloc.h | 236 +- src/afsweb/apache_includes/1.3.6/ap.h | 35 +- src/afsweb/apache_includes/1.3.6/ap_compat.h | 3 +- src/afsweb/apache_includes/1.3.6/ap_config.h | 255 +- src/afsweb/apache_includes/1.3.6/ap_ctype.h | 3 +- src/afsweb/apache_includes/1.3.6/ap_mmn.h | 4 +- src/afsweb/apache_includes/1.3.6/buff.h | 161 +- .../apache_includes/1.3.6/http_conf_globals.h | 61 +- src/afsweb/apache_includes/1.3.6/httpd.h | 671 +- src/afsweb/apache_includes/1.3.6/os-inline.c | 5 +- src/afsweb/apache_includes/1.3.6/os.h | 10 +- src/afsweb/apache_includes/1.3.6/util_uri.h | 71 +- src/afsweb/apache_includes/alloc.h | 90 +- src/afsweb/apache_includes/buff.h | 65 +- src/afsweb/apache_includes/conf.h | 140 +- .../apache_includes/http_conf_globals.h | 1 - src/afsweb/apache_includes/httpd.h | 375 +- src/afsweb/nsafs.c | 546 +- src/afsweb/nsafs.h | 23 +- src/afsweb/securehash.c | 77 +- src/afsweb/weblog.c | 1233 +- src/afsweb/weblog_errors.h | 5 +- src/audit/Makefile.in | 54 +- src/audit/NTMakefile | 5 +- src/audit/audit.c | 640 +- src/audit/audit.h | 43 +- src/auth/Makefile.in | 84 +- src/auth/NTMakefile | 76 +- src/auth/auth.p.h | 37 +- src/auth/authcon.c | 140 +- src/auth/cellconfig.c | 758 +- src/auth/cellconfig.p.h | 75 +- src/auth/copyauth.c | 42 +- src/auth/ktc.c | 1010 +- src/auth/ktc_nt.c | 1246 +- src/auth/setkey.c | 110 +- src/auth/test/Makefile.in | 12 +- src/auth/test/NTMakefile | 12 +- src/auth/test/ktctest.c | 61 +- src/auth/test/testcellconf.c | 52 +- src/auth/userok.c | 326 +- src/auth/writeconfig.c | 115 +- src/bozo/Makefile.in | 47 +- src/bozo/NTMakefile | 39 +- src/bozo/bnode.c | 681 +- src/bozo/bnode.p.h | 130 +- src/bozo/bos.c | 1430 +- src/bozo/bos_util.c | 95 +- src/bozo/bosint.xg | 1 + src/bozo/bosoprocs.c | 1212 +- src/bozo/bosserver.c | 505 +- src/bozo/cronbnodeops.c | 220 +- src/bozo/ezbnodeops.c | 143 +- src/bozo/fsbnodeops.c | 489 +- src/bozo/smail-notifier.c | 132 +- src/bozo/test/Makefile.in | 22 +- src/bozo/test/testproc.c | 27 +- src/bu_utils/Makefile.in | 28 +- src/bu_utils/NTMakefile | 11 +- src/bu_utils/fms.c | 156 +- src/bubasics/Makefile.in | 67 +- src/bubasics/NTMakefile | 25 +- src/bubasics/bubasics.h | 134 +- src/bubasics/butm.p.h | 108 +- src/bubasics/tcdata.p.h | 120 +- src/bucoord/Makefile.in | 30 +- src/bucoord/NTMakefile | 66 +- src/bucoord/bc.p.h | 114 +- src/bucoord/bc_status.c | 309 +- src/bucoord/btest.c | 11 +- src/bucoord/commands.c | 3272 +++-- src/bucoord/config.c | 108 +- src/bucoord/dlq.c | 114 +- src/bucoord/dsstub.c | 184 +- src/bucoord/dsvs.c | 382 +- src/bucoord/dump.c | 421 +- src/bucoord/dump_sched.c | 384 +- src/bucoord/error_macros.h | 1 - src/bucoord/expire.c | 367 +- src/bucoord/main.c | 743 +- src/bucoord/regex.c | 530 +- src/bucoord/restore.c | 746 +- src/bucoord/server.c | 12 +- src/bucoord/status.c | 79 +- src/bucoord/tape_hosts.c | 235 +- src/bucoord/ttest.c | 117 +- src/bucoord/ubik_db_if.c | 1059 +- src/bucoord/vol_sets.c | 463 +- src/bucoord/volstub.c | 76 +- src/budb/Makefile.in | 50 +- src/budb/NTMakefile | 48 +- src/budb/budb.rg | 7 +- src/budb/budb_client.p.h | 86 +- src/budb/database.c | 183 +- src/budb/database.h | 243 +- src/budb/db_alloc.c | 204 +- src/budb/db_dump.c | 456 +- src/budb/db_hash.c | 1094 +- src/budb/db_lock.c | 174 +- src/budb/db_lock.h | 19 +- src/budb/db_text.c | 329 +- src/budb/dbs_dump.c | 193 +- src/budb/globals.h | 72 +- src/budb/ol_verify.c | 1215 +- src/budb/procs.c | 4004 +++--- src/budb/server.c | 370 +- src/budb/struct_ops.c | 271 +- src/butc/Makefile.in | 45 +- src/butc/NTMakefile | 30 +- src/butc/butc_xbsa.c | 748 +- src/butc/butc_xbsa.h | 88 +- src/butc/common.h | 28 +- src/butc/dbentries.c | 560 +- src/butc/dump.c | 2289 +-- src/butc/error_macros.h | 16 + src/butc/list.c | 114 +- src/butc/lwps.c | 2728 ++-- src/butc/read_tape.c | 937 +- src/butc/recoverDb.c | 696 +- src/butc/tcmain.c | 1026 +- src/butc/tcprocs.c | 467 +- src/butc/tcstatus.c | 108 +- src/butc/tcudbprocs.c | 1277 +- src/butc/tdump.c | 36 +- src/butc/test.c | 214 +- src/butc/test_budb.c | 463 +- src/butm/Makefile.in | 28 +- src/butm/NTMakefile | 13 +- src/butm/butm_test.c | 206 +- src/butm/error_macros.h | 1 - src/butm/file_tm.c | 1785 +-- src/butm/test_ftm.c | 527 +- src/cf/Makefile.am.common | 6 +- src/cf/aix-cc.m4 | 44 + src/cf/bigendian.m4 | 2 +- src/cf/function-macro.m4 | 15 + src/cf/irix-test.m4 | 20 + src/cf/linux-test1.m4 | 2 +- src/cf/linux-test2.m4 | 21 +- src/cf/linux-test3.m4 | 5 +- src/cf/linux-test4.m4 | 46 +- src/cf/linux-test5.m4 | 16 + src/cf/osconf.m4 | 854 ++ src/cf/ressearch.m4 | 3 + src/cf/solaris-cc.m4 | 38 + src/cmd/Makefile.am | 2 +- src/cmd/Makefile.in | 37 +- src/cmd/NTMakefile | 25 +- src/cmd/cmd.c | 785 +- src/cmd/cmd.p.h | 99 +- src/cmd/test/Makefile.in | 12 +- src/cmd/test/NTMakefile | 19 +- src/cmd/test/ctest.c | 37 +- src/cmd/test/dtest.c | 27 +- src/cmd/test/itest.c | 50 +- src/comerr/Makefile.am | 2 +- src/comerr/Makefile.in | 68 +- src/comerr/NTMakefile | 26 +- src/comerr/com_err.c | 49 +- src/comerr/com_err.h | 17 +- src/comerr/compile_et.c | 281 +- src/comerr/error_msg.c | 103 +- src/comerr/error_table.h | 4 +- src/comerr/error_table.y | 13 +- src/comerr/error_table_nt.c | 1267 +- src/comerr/error_table_nt.h | 26 +- src/comerr/et_lex.lex.l | 9 +- src/comerr/et_lex.lex_nt.c | 3149 +++-- src/comerr/et_name.c | 16 +- src/comerr/internal.h | 3 +- src/comerr/mit-sipb-cr.h | 1 - src/comerr/test/Makefile.in | 24 +- src/comerr/test/NTMakefile | 14 +- src/comerr/test/test.c | 76 +- src/config/.cvsignore | 3 + src/config/Makefile.alpha_dux40.in | 32 - src/config/Makefile.alpha_dux50.in | 32 - src/config/Makefile.alpha_dux51.in | 32 - src/config/Makefile.alpha_linux_22.in | 45 - src/config/Makefile.alpha_linux_24.in | 46 - src/config/Makefile.am | 2 +- src/config/Makefile.amd64_linux24.in | 44 - src/config/Makefile.config.in | 132 + src/config/Makefile.hp_ux102.in | 36 - src/config/Makefile.hp_ux110.in | 37 - src/config/Makefile.hp_ux11i.in | 37 - src/config/Makefile.i386_djgpp | 6 +- src/config/Makefile.i386_fbsd_42.in | 41 - src/config/Makefile.i386_fbsd_43.in | 41 - src/config/Makefile.i386_fbsd_44.in | 41 - src/config/Makefile.i386_fbsd_45.in | 41 - src/config/Makefile.i386_fbsd_46.in | 41 - src/config/Makefile.i386_linux22.in | 52 - src/config/Makefile.i386_linux24.in | 44 - src/config/Makefile.i386_obsd29.in | 39 - src/config/Makefile.i386_umlinux22.in | 52 - src/config/Makefile.i386_umlinux24.in | 44 - src/config/Makefile.ia64_hpux1122.in | 37 - src/config/Makefile.ia64_linux24.in | 44 - src/config/Makefile.in | 118 +- src/config/Makefile.parisc_linux24.in | 43 - src/config/Makefile.ppc_darwin_12.in | 42 - src/config/Makefile.ppc_darwin_13.in | 42 - src/config/Makefile.ppc_darwin_14.in | 42 - src/config/Makefile.ppc_darwin_60.in | 42 - src/config/Makefile.ppc_darwin_70.in | 47 - src/config/Makefile.ppc_linux22.in | 45 - src/config/Makefile.ppc_linux24.in | 45 - src/config/Makefile.rs_aix42.in | 38 - src/config/Makefile.s390_linux22.in | 49 - src/config/Makefile.s390_linux24.in | 49 - src/config/Makefile.sgi_62.in | 47 - src/config/Makefile.sgi_63.in | 42 - src/config/Makefile.sgi_64.in | 48 - src/config/Makefile.sgi_65.in | 48 - src/config/Makefile.sparc64_linux22.in | 48 - src/config/Makefile.sparc64_linux24.in | 48 - src/config/Makefile.sparc_linux22.in | 48 - src/config/Makefile.sparc_linux24.in | 48 - src/config/Makefile.sun4_413.in | 40 - src/config/Makefile.sun4x_55.in | 51 - src/config/Makefile.sun4x_56.in | 54 - src/config/Makefile.sun4x_57.in | 58 - src/config/Makefile.sun4x_58.in | 50 - src/config/Makefile.sun4x_59.in | 49 - src/config/Makefile.sunx86_54.in | 26 - src/config/Makefile.sunx86_57.in | 50 - src/config/Makefile.sunx86_58.in | 50 - src/config/Makefile.sunx86_59.in | 49 - src/config/Makefile.version-NOCML.in | 1 + src/config/NTMakefile | 390 +- src/config/NTMakefile.i386_nt40 | 435 +- src/config/NTMakefile.i386_win95 | 5 +- src/config/afs_args.h | 40 +- src/config/afs_sysnames.h | 62 +- src/config/afsconfig-windows.h | 2 +- src/config/afsconfig.h.in | 409 + src/config/config.c | 14 +- src/config/debug.h | 21 +- src/config/icl.h | 35 +- src/config/libafsdep | 4 + src/config/make_libafs_tree.pl | 224 + src/config/make_vnode.pl | 8 +- src/config/mc.c | 110 +- src/config/mkvers.c | 106 +- src/config/param.alpha_dux40.h | 95 +- src/config/param.alpha_dux40_usr.h | 68 +- src/config/param.alpha_dux50.h | 97 +- src/config/param.alpha_dux50_usr.h | 68 +- src/config/param.alpha_dux51.h | 99 +- src/config/param.alpha_dux51_usr.h | 68 +- src/config/param.alpha_linux_22.h | 84 +- src/config/param.alpha_linux_22_usr.h | 55 +- src/config/param.alpha_linux_24.h | 85 +- src/config/param.alpha_linux_24_usr.h | 56 +- src/config/param.alpha_nbsd15.h | 82 + src/config/param.alpha_nbsd15_usr.h | 1 + src/config/param.alpha_nbsd16.h | 82 + src/config/param.alpha_nbsd16_usr.h | 1 + src/config/param.amd64_linux24.h | 18 +- src/config/param.hp_ux102.h | 88 +- src/config/param.hp_ux102_usr.h | 65 +- src/config/param.hp_ux110.h | 90 +- src/config/param.hp_ux110_usr.h | 65 +- src/config/param.hp_ux11i.h | 90 +- src/config/param.hp_ux11i_usr.h | 64 - src/config/param.i386_djgpp.h | 78 +- src/config/param.i386_djgpp_usr.h | 63 +- src/config/param.i386_fbsd_42.h | 104 +- src/config/param.i386_fbsd_42_usr.h | 60 +- src/config/param.i386_fbsd_43.h | 101 +- src/config/param.i386_fbsd_43_usr.h | 61 +- src/config/param.i386_fbsd_44.h | 102 +- src/config/param.i386_fbsd_44_usr.h | 62 +- src/config/param.i386_fbsd_45.h | 103 +- src/config/param.i386_fbsd_45_usr.h | 63 +- src/config/param.i386_fbsd_46.h | 104 +- src/config/param.i386_fbsd_46_usr.h | 64 +- src/config/param.i386_fbsd_47.h | 200 + src/config/param.i386_fbsd_47_usr.h | 1 + src/config/param.i386_fbsd_50.h | 200 + src/config/param.i386_fbsd_51.h | 202 + src/config/param.i386_fbsd_52.h | 204 + src/config/param.i386_linux22.h | 80 +- src/config/param.i386_linux22_usr.h | 63 +- src/config/param.i386_linux24.h | 80 +- src/config/param.i386_linux24_usr.h | 55 +- src/config/param.i386_linux26.h | 153 + src/config/param.i386_nbsd15.h | 82 + src/config/param.i386_nbsd15_usr.h | 1 + src/config/param.i386_nbsd16.h | 84 + src/config/param.i386_nbsd16_usr.h | 1 + src/config/param.i386_nbsd20.h | 86 + src/config/param.i386_nt40.h | 16 +- src/config/param.i386_obsd31.h | 60 + src/config/param.i386_obsd31_usr.h | 1 + src/config/param.i386_obsd32.h | 60 + src/config/param.i386_obsd33.h | 60 + src/config/param.i386_obsd34.h | 61 + src/config/param.i386_obsd35.h | 62 + src/config/param.i386_umlinux22.h | 88 +- src/config/param.i386_umlinux22_usr.h | 65 +- src/config/param.i386_umlinux24.h | 106 +- src/config/param.i386_umlinux24_usr.h | 58 +- src/config/param.i386_win95.h | 16 +- src/config/param.ia64_hpux1122.h | 20 +- src/config/param.ia64_hpux1123.h | 103 + ...ux1122_usr.h => param.ia64_hpux1123_usr.h} | 4 +- src/config/param.ia64_linux24.h | 97 +- src/config/param.ia64_linux24_usr.h | 60 +- .../{param.i386_obsd29.h => param.nbsd15.h} | 65 +- src/config/param.nbsd16.h | 119 + src/config/param.nbsd20.h | 120 + src/config/param.parisc_linux24.h | 78 +- src/config/param.parisc_linux24_usr.h | 55 +- ...64_linux24_usr.h => param.ppc64_linux24.h} | 102 +- src/config/param.ppc_darwin_12.h | 64 +- src/config/param.ppc_darwin_12_usr.h | 47 +- src/config/param.ppc_darwin_13.h | 66 +- src/config/param.ppc_darwin_13_usr.h | 49 +- src/config/param.ppc_darwin_14.h | 68 +- src/config/param.ppc_darwin_14_usr.h | 51 +- src/config/param.ppc_darwin_60.h | 70 +- src/config/param.ppc_darwin_60_usr.h | 53 +- src/config/param.ppc_darwin_70.h | 76 +- src/config/param.ppc_darwin_70_usr.h | 59 - src/config/param.ppc_linux22.h | 77 +- src/config/param.ppc_linux22_usr.h | 54 +- src/config/param.ppc_linux24.h | 78 +- src/config/param.ppc_linux24_usr.h | 55 +- ...m.i386_obsd29_usr.h => param.ppc_nbsd16.h} | 43 +- src/config/param.ppc_nbsd20.h | 81 + src/config/param.rs_aix42.h | 115 +- src/config/param.rs_aix42_usr.h | 77 +- src/config/param.rs_aix51.h | 180 + src/config/param.rs_aix51_usr.h | 1 + src/config/param.rs_aix52.h | 181 + src/config/param.s390_linux22.h | 89 +- src/config/param.s390_linux22_usr.h | 57 +- src/config/param.s390_linux24.h | 90 +- src/config/param.s390_linux24_usr.h | 58 +- src/config/param.sgi_62.h | 93 +- src/config/param.sgi_62_usr.h | 68 +- src/config/param.sgi_63.h | 91 +- src/config/param.sgi_63_usr.h | 69 +- src/config/param.sgi_64.h | 95 +- src/config/param.sgi_64_usr.h | 70 +- src/config/param.sgi_65.h | 101 +- src/config/param.sgi_65_usr.h | 72 +- src/config/param.sparc64_linux22.h | 89 +- src/config/param.sparc64_linux22_usr.h | 57 +- src/config/param.sparc64_linux24.h | 90 +- src/config/param.sparc64_linux24_usr.h | 58 +- src/config/param.sparc_linux22.h | 89 +- src/config/param.sparc_linux22_usr.h | 57 +- src/config/param.sparc_linux24.h | 89 +- src/config/param.sparc_linux24_usr.h | 58 +- src/config/param.sun4_413.h | 100 +- src/config/param.sun4_413_usr.h | 59 +- src/config/param.sun4x_55.h | 89 +- src/config/param.sun4x_55_usr.h | 66 +- src/config/param.sun4x_56.h | 88 +- src/config/param.sun4x_56_usr.h | 67 +- src/config/param.sun4x_57.h | 92 +- src/config/param.sun4x_57_usr.h | 67 +- src/config/param.sun4x_58.h | 91 +- src/config/param.sun4x_58_usr.h | 62 +- src/config/param.sun4x_59.h | 92 +- src/config/param.sun4x_59_usr.h | 63 +- src/config/param.sunx86_54.h | 14 +- src/config/param.sunx86_57.h | 93 +- src/config/param.sunx86_57_usr.h | 68 +- src/config/param.sunx86_58.h | 92 +- src/config/param.sunx86_58_usr.h | 69 +- src/config/param.sunx86_59.h | 123 - src/config/param.sunx86_59_usr.h | 69 - src/config/permit_xprt.h | 2 +- src/config/stds.h | 91 +- src/config/touch.c | 48 +- src/config/util_cr.c | 1150 +- src/config/uvenus.h | 19 +- src/config/venus.h | 92 +- src/dauth/Makefile.in | 42 +- src/dauth/dlog.c | 431 +- src/dauth/dpass.c | 60 +- src/des/Makefile.in | 81 +- src/des/NTMakefile | 86 +- src/des/andrew-conf.h | 27 +- src/des/cbc_encrypt.c | 98 +- src/des/cksum.c | 52 +- src/des/conf-aix-ibm.h | 2 +- src/des/conf-alpha-bsd.h | 20 + src/des/conf-bsd-alpha.h | 1 - src/des/conf-ppc-darwin.h | 1 - src/des/conf-ppc64-linux.h | 4 + src/des/conf.h | 7 +- src/des/crypt.c | 1021 +- src/des/debug_decl.c | 5 +- src/des/des.c | 224 +- src/des/des.h | 6 +- src/des/des_conf.h | 16 +- src/des/des_internal.h | 14 +- src/des/des_prototypes.h | 82 + src/des/enc.c | 93 +- src/des/key_parity.c | 25 +- src/des/key_sched.c | 229 +- src/des/main.c | 70 +- src/des/make_e.c | 20 +- src/des/make_fp.c | 44 +- src/des/make_ip.c | 41 +- src/des/make_keyperm.c | 268 +- src/des/make_odd.c | 43 +- src/des/make_p.c | 45 +- src/des/make_p_table.c | 41 +- src/des/make_s.c | 19 +- src/des/make_s_table.c | 89 +- src/des/misc.c | 212 +- src/des/new_rnd_key.c | 84 +- src/des/pcbc_encrypt.c | 106 +- src/des/quad_cksum.c | 57 +- src/des/read_pssword.c | 164 +- src/des/stats.h | 36 +- src/des/strng_to_key.c | 52 +- src/des/tables.h | 138 +- src/des/test/Makefile.in | 27 +- src/des/test/NTMakefile | 19 +- src/des/test/key_test.c | 140 +- src/des/test/testit.c | 170 +- src/des/test/verify.c | 155 +- src/des/util.c | 32 +- src/des/weak_key.c | 50 +- src/des_stub/Makefile.in | 9 +- src/des_stub/NTMakefile | 2 +- src/dir/Makefile.in | 90 +- src/dir/NTMakefile | 16 +- src/dir/buffer.c | 328 +- src/dir/dir.c | 574 +- src/dir/dir.h | 128 +- src/dir/salvage.c | 450 +- src/dir/test/.cvsignore | 1 + src/dir/test/Makefile.in | 29 +- src/dir/test/NTMakefile | 8 +- src/dir/test/dtest.c | 160 +- src/dir/test/physio.c | 122 +- src/dir/test/test-salvage.c | 66 +- src/export/Makefile.in | 171 +- src/export/cfgafs.c | 67 +- src/export/cfgexport.c | 875 +- src/export/export.c | 341 +- src/export/export.h | 24 +- src/export/{export.exp => export4-64.exp} | 0 src/export/export4.exp | 16 + src/export/export5-64.exp | 15 + src/export/export5.exp | 15 + src/export/sym.h | 38 +- src/export/symtab.c | 167 +- src/finale/Makefile.in | 25 +- src/finale/NTMakefile | 12 +- src/finale/translate_et.c | 26 +- src/finale/translate_et_nt.c | 17 +- src/fsint/Makefile.in | 169 +- src/fsint/NTMakefile | 72 +- src/fsint/afsaux.c | 159 +- src/fsint/afscbint.xg | 11 +- src/fsint/afsint.xg | 313 +- src/fsint/common.xg | 23 +- src/fsprobe/Makefile.in | 34 +- src/fsprobe/fsprobe.c | 843 +- src/fsprobe/fsprobe.h | 130 +- src/fsprobe/fsprobe_callback.c | 418 +- src/fsprobe/fsprobe_test.c | 289 +- src/ftpd43+/Makefile.in | 26 +- src/ftpd43+/ftp.h | 8 +- src/ftpd43+/ftpd.c | 2872 ++-- src/ftpd43+/getusershell.c | 125 +- src/ftpd43+/glob.c | 1480 +- src/ftpd43+/logwtmp.c | 48 +- src/ftpd43+/popen.c | 178 +- src/ftpd43+/telnet.h | 18 +- src/gtx/Makefile.in | 229 +- src/gtx/X11windows.c | 238 +- src/gtx/cb_test.c | 169 +- src/gtx/curses_test.c | 16 +- src/gtx/curseswindows.c | 395 +- src/gtx/dumbwindows.c | 272 +- src/gtx/frame.c | 430 +- src/gtx/gtxX11win.h | 114 +- src/gtx/gtxcurseswin.h | 122 +- src/gtx/gtxdumbwin.h | 114 +- src/gtx/gtxframe.h | 12 +- src/gtx/gtxkeymap.h | 24 +- src/gtx/gtxlightobj.h | 68 +- src/gtx/gtxobjdict.h | 26 +- src/gtx/gtxobjects.h | 76 +- src/gtx/gtxtest.c | 209 +- src/gtx/gtxtextcb.h | 68 +- src/gtx/gtxtextobj.h | 82 +- src/gtx/gtxwindows.h | 90 +- src/gtx/input.c | 45 +- src/gtx/keymap.c | 144 +- src/gtx/lightobject.c | 184 +- src/gtx/objdict.c | 75 +- src/gtx/object_test.c | 428 +- src/gtx/objects.c | 259 +- src/gtx/screen_test.c | 237 +- src/gtx/textcb.c | 642 +- src/gtx/textobject.c | 568 +- src/gtx/windows.c | 130 +- src/helper-splint.sh.in | 27 + src/include/Makefile.am | 2 +- src/include/afs/Makefile.am | 2 +- src/include/rx/Makefile.am | 2 +- src/inetd/Makefile.in | 35 +- src/inetd/getenv.c | 29 +- src/inetd/inetd.c | 1855 ++- src/inetd/setenv.c | 105 +- src/inetd/ta-rauth.c | 100 +- src/kauth/Makefile.in | 242 +- src/kauth/NTMakefile | 146 +- src/kauth/admin_tools.c | 2120 +-- src/kauth/authclient.c | 778 +- src/kauth/client.c | 300 +- src/kauth/decode_ticket.c | 63 +- src/kauth/ka_util.c | 279 + src/kauth/kaaux.c | 47 +- src/kauth/kaauxdb.c | 106 +- src/kauth/kadatabase.c | 996 +- src/kauth/kalocalcell.c | 119 +- src/kauth/kalog.c | 83 +- src/kauth/kaopcodes.h | 22 +- src/kauth/kaprocs.c | 2610 ++-- src/kauth/kas.c | 53 +- src/kauth/kaserver.c | 258 +- src/kauth/kaserver.h | 137 +- src/kauth/kautils.c | 157 +- src/kauth/kautils.p.h | 462 +- src/kauth/kdb.c | 32 +- src/kauth/kkids.c | 539 +- src/kauth/klog.c | 264 +- src/kauth/klogin.c | 949 +- src/kauth/knfs.c | 212 +- src/kauth/kpasswd.c | 378 +- src/kauth/kpwvalid.c | 41 +- src/kauth/krb_tf.c | 65 +- src/kauth/krb_udp.c | 1099 +- src/kauth/manyklog.c | 268 +- src/kauth/prot.h | 8 +- src/kauth/read_passwd.c | 153 +- src/kauth/rebuild.c | 899 +- src/kauth/test/Makefile.in | 8 +- src/kauth/test/NTMakefile | 25 +- src/kauth/test/background.c | 25 +- src/kauth/test/multiklog.c | 263 +- src/kauth/test/test_badtix.c | 731 +- src/kauth/test/test_date.c | 45 +- src/kauth/test/test_getticket.c | 488 +- src/kauth/test/test_interim_ktc.c | 792 +- src/kauth/test/test_rxkad_free.c | 354 +- src/kauth/token.c | 372 +- src/kauth/user.c | 305 +- src/kauth/user_nt.c | 744 +- src/libacl/Makefile.in | 102 +- src/libacl/NTMakefile | 10 +- src/libacl/acl.h | 16 +- src/libacl/aclprocs.c | 365 +- src/libacl/netprocs.c | 24 +- src/libacl/prs_fs.h | 14 +- src/libacl/test/Makefile.in | 22 +- src/libacl/test/acltest.c | 207 +- src/libadmin/Makefile.in | 22 +- src/libadmin/NTMakefile | 4 + src/libadmin/adminutil/Makefile.in | 61 +- src/libadmin/adminutil/NTMakefile | 195 +- src/libadmin/adminutil/afs_AdminErrors.h | 6 +- src/libadmin/adminutil/afs_AdminInternal.h | 94 +- src/libadmin/adminutil/afs_utilAdmin.c | 1517 +- src/libadmin/adminutil/afs_utilAdmin.h | 318 +- src/libadmin/afs_Admin.h | 42 +- src/libadmin/bos/Makefile.in | 25 +- src/libadmin/bos/NTMakefile | 26 +- src/libadmin/bos/afs_bosAdmin.c | 1246 +- src/libadmin/bos/afs_bosAdmin.h | 606 +- src/libadmin/cfg/Makefile.in | 27 +- src/libadmin/cfg/NTMakefile | 51 +- src/libadmin/cfg/afs_cfgAdmin.h | 400 +- src/libadmin/cfg/cfgclient.c | 186 +- src/libadmin/cfg/cfgdb.c | 340 +- src/libadmin/cfg/cfghost.c | 295 +- src/libadmin/cfg/cfginternal.c | 208 +- src/libadmin/cfg/cfginternal.h | 102 +- src/libadmin/cfg/cfgservers.c | 720 +- src/libadmin/cfg/test/Makefile.in | 10 +- src/libadmin/cfg/test/NTMakefile | 9 +- src/libadmin/cfg/test/cfgtest.c | 231 +- src/libadmin/client/Makefile.in | 25 +- src/libadmin/client/NTMakefile | 12 +- src/libadmin/client/afs_clientAdmin.c | 870 +- src/libadmin/client/afs_clientAdmin.h | 337 +- src/libadmin/kas/Makefile.in | 31 +- src/libadmin/kas/NTMakefile | 33 +- src/libadmin/kas/afs_kasAdmin.c | 542 +- src/libadmin/kas/afs_kasAdmin.h | 235 +- src/libadmin/pts/Makefile.in | 25 +- src/libadmin/pts/NTMakefile | 28 +- src/libadmin/pts/afs_ptsAdmin.c | 944 +- src/libadmin/pts/afs_ptsAdmin.h | 341 +- src/libadmin/samples/Makefile.in | 71 +- src/libadmin/samples/cm_client_config.c | 25 +- src/libadmin/samples/cm_list_cells.c | 24 +- src/libadmin/samples/cm_local_cell.c | 22 +- src/libadmin/samples/cm_server_prefs.c | 25 +- src/libadmin/samples/rxdebug_basic_stats.c | 19 +- src/libadmin/samples/rxdebug_conns.c | 36 +- src/libadmin/samples/rxdebug_peers.c | 37 +- src/libadmin/samples/rxdebug_rx_stats.c | 101 +- .../samples/rxdebug_supported_stats.c | 19 +- src/libadmin/samples/rxdebug_version.c | 19 +- src/libadmin/samples/rxstat_clear_peer.c | 24 +- src/libadmin/samples/rxstat_clear_process.c | 24 +- src/libadmin/samples/rxstat_disable_peer.c | 24 +- src/libadmin/samples/rxstat_disable_process.c | 24 +- src/libadmin/samples/rxstat_enable_peer.c | 24 +- src/libadmin/samples/rxstat_enable_process.c | 24 +- src/libadmin/samples/rxstat_get_peer.c | 131 +- src/libadmin/samples/rxstat_get_process.c | 120 +- src/libadmin/samples/rxstat_get_version.c | 24 +- src/libadmin/samples/rxstat_query_peer.c | 30 +- src/libadmin/samples/rxstat_query_process.c | 33 +- src/libadmin/test/Makefile.in | 28 +- src/libadmin/test/NTMakefile | 21 +- src/libadmin/test/afscp.c | 48 +- src/libadmin/test/bos.c | 1607 +-- src/libadmin/test/bos.h | 2 +- src/libadmin/test/client.c | 785 +- src/libadmin/test/client.h | 2 +- src/libadmin/test/common.h | 18 +- src/libadmin/test/kas.c | 564 +- src/libadmin/test/kas.h | 2 +- src/libadmin/test/pts.c | 357 +- src/libadmin/test/pts.h | 2 +- src/libadmin/test/util.c | 26 +- src/libadmin/test/util.h | 8 +- src/libadmin/test/vos.c | 1403 +- src/libadmin/test/vos.h | 2 +- src/libadmin/vos/Makefile.in | 25 +- src/libadmin/vos/NTMakefile | 62 +- src/libadmin/vos/afs_vosAdmin.c | 1476 +- src/libadmin/vos/afs_vosAdmin.h | 757 +- src/libadmin/vos/lockprocs.c | 157 +- src/libadmin/vos/lockprocs.h | 75 +- src/libadmin/vos/vosutils.c | 323 +- src/libadmin/vos/vosutils.h | 102 +- src/libadmin/vos/vsprocs.c | 4074 +++--- src/libadmin/vos/vsprocs.h | 287 +- src/libafs/.cvsignore | 2 + src/libafs/Makefile.common | 345 - src/libafs/Makefile.common.in | 409 + src/libafs/MakefileProto.AIX.in | 188 +- src/libafs/MakefileProto.DARWIN.in | 86 +- src/libafs/MakefileProto.DUX.in | 69 +- src/libafs/MakefileProto.FBSD.in | 143 +- src/libafs/MakefileProto.HPUX.in | 165 +- src/libafs/MakefileProto.IRIX.in | 194 +- src/libafs/MakefileProto.LINUX.in | 189 +- src/libafs/MakefileProto.NBSD.in | 111 + src/libafs/MakefileProto.OBSD.in | 156 +- src/libafs/MakefileProto.SOLARIS.in | 79 +- src/libafs/afs.ppc_darwin_12.plist.in | 4 +- src/libafs/afs.ppc_darwin_13.plist.in | 4 +- src/libafs/afs.ppc_darwin_14.plist.in | 4 +- src/libafs/afs.ppc_darwin_60.plist.in | 4 +- src/libafs/libafsdep | 8 + src/libafsauthent/Makefile.in | 26 +- src/libafsauthent/NTMakefile | 221 +- src/libafsdep | 13 + src/libafsrpc/Makefile.in | 215 +- src/libafsrpc/NTMakefile | 258 +- src/libafsrpc/afsrpc.def | 2 +- src/libuafs/.cvsignore | 9 + src/libuafs/Makefile.common | 953 -- src/libuafs/Makefile.common.in | 1438 ++ src/libuafs/MakefileProto.AIX.in | 73 +- src/libuafs/MakefileProto.DARWIN.in | 74 +- src/libuafs/MakefileProto.DUX.in | 79 +- src/libuafs/MakefileProto.FBSD.in | 85 +- src/libuafs/MakefileProto.HPUX.in | 78 +- src/libuafs/MakefileProto.IRIX.in | 74 +- src/libuafs/MakefileProto.LINUX.in | 87 +- src/libuafs/MakefileProto.NBSD.in | 44 + src/libuafs/MakefileProto.OBSD.in | 44 + src/libuafs/MakefileProto.SOLARIS.in | 75 +- src/libuafs/README | 81 + src/libuafs/linktest.c | 18 +- src/log/Makefile.in | 26 +- src/log/kseal.c | 37 +- src/log/test/Makefile.in | 24 +- src/log/test/gettoktest.c | 61 +- src/log/test/testlog.c | 291 +- src/log/tokens.c | 90 +- src/log/unlog.c | 292 +- src/login/.cvsignore | 2 + src/login/Makefile.in | 83 +- src/login/getenv.c | 37 +- src/login/login.c | 2443 ++-- src/login/setenv.c | 107 +- src/login/util_login.c | 31 +- src/login/util_logout.c | 44 +- src/login/util_logwtmp.c | 35 +- src/lwp/.cvsignore | 1 + src/lwp/Makefile.in | 95 +- src/lwp/NTMakefile | 27 +- src/lwp/fasttime.c | 48 +- src/lwp/iomgr.c | 35 +- src/lwp/lock.c | 161 +- src/lwp/lock.h | 29 +- src/lwp/lwp.c | 1105 +- src/lwp/lwp.h | 226 +- src/lwp/lwp_elf.h | 62 + src/lwp/lwp_nt.c | 4 +- src/lwp/preempt.c | 113 +- src/lwp/preempt.h | 6 +- src/lwp/process.c | 224 +- src/lwp/process.i386.s | 88 + src/lwp/process.s | 112 +- src/lwp/rw.c | 105 +- src/lwp/test/Makefile.in | 12 +- src/lwp/test/NTMakefile | 12 +- src/lwp/test/selclient.c | 141 +- src/lwp/test/selserver.c | 164 +- src/lwp/test/selsubs.c | 74 +- src/lwp/test/seltest.h | 6 +- src/lwp/test/test.c | 40 +- src/lwp/test/test_key.c | 145 +- src/lwp/test/testlwp.c | 2 +- src/lwp/test/testtime.c | 43 +- src/lwp/threadname.c | 78 +- src/lwp/timer.c | 181 +- src/lwp/timer.h | 21 +- src/lwp/waitkey.c | 224 +- src/mpp/Makefile.in | 49 +- src/mpp/mpp.c | 592 +- src/ntbuild.bat | 110 +- src/ntp/Makefile.in | 29 +- src/ntp/README | 2 +- src/ntp/mkntpconf.c | 237 +- src/ntp/ntp.c | 482 +- src/ntp/ntp.h | 238 +- src/ntp/ntp_adjust.c | 339 +- src/ntp/ntp_proto.c | 1743 ++- src/ntp/ntp_sock.c | 411 +- src/ntp/ntpd.c | 2192 ++- src/ntp/ntpdc.c | 557 +- src/ntp/ntpsubs.c | 276 +- src/ntp/read_local.c | 23 +- src/ntp/read_psti.c | 489 +- src/ntp/runntp.c | 252 +- src/ntp/test.c | 290 +- src/null/Makefile.in | 31 +- src/null/null.c | 11 +- src/package/Makefile.in | 63 +- src/package/check.c | 305 +- src/package/conftree.c | 545 +- src/package/fileops.c | 150 +- src/package/globals.h | 11 +- src/package/globfuncs.c | 77 +- src/package/gram.y | 9 +- src/package/lex.l | 11 +- src/package/messages.c | 383 +- src/package/misc.c | 9 +- src/package/package.c | 157 +- src/package/package.h | 83 +- src/package/systype.h | 9 +- src/package/tags | 61 + src/package/test.c | 320 +- src/package/test_gram.y | 9 +- src/package/update.c | 441 +- src/package/validupdates.h | 85 +- src/packaging/Debian/ConfigUtils.pm | 26 + src/packaging/Debian/README.Debian | 25 + src/packaging/Debian/README.modules | 35 + src/packaging/Debian/README.servers | 47 + src/packaging/Debian/TODO | 1 + src/packaging/Debian/afs-newcell | 191 + src/packaging/Debian/afs-rootvol | 157 + src/packaging/Debian/changelog | 440 + .../Debian/configuration-transcript.txt | 418 + src/packaging/Debian/control | 84 + src/packaging/Debian/control.module | 16 + src/packaging/Debian/control.module-image | 17 + src/packaging/Debian/copyright | 242 + src/packaging/Debian/filelist | 15 + src/packaging/Debian/genchanges.sh | 22 + src/packaging/Debian/kern-sysname | 61 + src/packaging/Debian/make-links | 9 + src/packaging/Debian/movefiles | 14 + src/packaging/Debian/openafs-client.conffiles | 2 + src/packaging/Debian/openafs-client.config | 42 + src/packaging/Debian/openafs-client.dirs | 4 + src/packaging/Debian/openafs-client.docs | 6 + src/packaging/Debian/openafs-client.lintian | 3 + src/packaging/Debian/openafs-client.postinst | 90 + src/packaging/Debian/openafs-client.postrm | 43 + src/packaging/Debian/openafs-client.prerm | 29 + src/packaging/Debian/openafs-client.templates | 85 + .../Debian/openafs-client.undocumented | 13 + src/packaging/Debian/openafs-dbserver.dirs | 4 + .../Debian/openafs-fileserver.conffiles | 1 + .../Debian/openafs-fileserver.config | 38 + src/packaging/Debian/openafs-fileserver.dirs | 6 + src/packaging/Debian/openafs-fileserver.init | 71 + .../Debian/openafs-fileserver.lintian | 2 + .../Debian/openafs-fileserver.postinst | 46 + .../Debian/openafs-fileserver.postrm | 41 + .../Debian/openafs-fileserver.preinst | 9 + .../Debian/openafs-fileserver.templates | 31 + .../Debian/openafs-fileserver.undocumented | 1 + src/packaging/Debian/openafs-kpasswd.dirs | 1 + .../Debian/openafs-kpasswd.undocumented | 2 + .../Debian/openafs-modules-source.docs | 5 + .../Debian/patch.001_libafs_destination_name | 18 + .../Debian/patch.002_sketchy_hpux_process_c | 18 + .../Debian/patch.004_bozo_permissions | 16 + .../Debian/patch.006_more_bozo_permissions | 16 + src/packaging/Debian/postinst.mod | 5 + src/packaging/Debian/prep-modules | 55 + src/packaging/Debian/prerm.mod | 2 + src/packaging/Debian/pt_util.sgml | 185 + src/packaging/Debian/rules | 276 + src/packaging/Debian/sysname | 28 + src/packaging/FreeBSD/buildpkg.sh | 33 + src/packaging/FreeBSD/desc | 1 + src/packaging/FreeBSD/packinglist | 6 + src/packaging/FreeBSD/postinstall | 29 + src/packaging/HP-UX/README | 84 - .../HP-UX/psf-1.2.10-transarc-paths-11.00 | 2 +- .../HP-UX/psf-1.2.10-transarc-paths-11.11 | 2 +- .../HP-UX/psf-1.2.10-transarc-paths-11.22 | 2 +- .../HP-UX/psf-1.2.8-transarc-paths-11.00 | 2 +- .../HP-UX/psf-1.2.9-transarc-paths-11.00 | 2 +- .../HP-UX/scripts/openafs-clnt.configure | 4 +- .../HP-UX/scripts/openafs-srv.postremove | 2 +- src/packaging/MacOS/OpenAFS.post_install | 6 + src/packaging/MacOS/ReadMe.rtf | 14 +- src/packaging/MacOS/buildpkg.sh | 3 +- src/packaging/OpenBSD/buildpkg.sh | 33 + src/packaging/OpenBSD/desc | 1 + src/packaging/OpenBSD/packinglist | 6 + src/packaging/OpenBSD/postinstall | 23 + src/packaging/README | 7 +- src/packaging/RedHat/afsmodname | 455 + src/packaging/RedHat/openafs-1.2.6-rc.patch | 27 + src/packaging/RedHat/openafs-1.2.6.spec | 762 + src/packaging/RedHat/openafs-README | 29 + src/packaging/RedHat/openafs-SuidCells | 5 + src/packaging/RedHat/openafs-ThisCell | 1 + src/packaging/RedHat/openafs-cacheinfo | 1 + src/pam/Makefile.in | 79 +- src/pam/afs_account.c | 9 +- src/pam/afs_auth.c | 381 +- src/pam/afs_message.c | 123 +- src/pam/afs_message.h | 94 +- src/pam/afs_pam_msg.c | 33 +- src/pam/afs_pam_msg.h | 4 +- src/pam/afs_password.c | 201 +- src/pam/afs_session.c | 117 +- src/pam/afs_setcred.c | 259 +- src/pam/afs_util.c | 259 +- src/pam/afs_util.h | 21 +- src/pam/test_pam.c | 48 +- src/pinstall/Makefile.in | 39 +- src/pinstall/install.c | 899 +- src/pinstall/test/Makefile.in | 21 +- src/procmgmt/Makefile.am | 2 +- src/procmgmt/Makefile.in | 33 +- src/procmgmt/NTMakefile | 29 +- src/procmgmt/afs/Makefile.am | 2 +- src/procmgmt/afskill.c | 65 +- src/procmgmt/pmgtprivate.h | 6 +- src/procmgmt/procmgmt.h | 76 +- src/procmgmt/procmgmt_nt.c | 568 +- src/procmgmt/procmgmt_unix.c | 7 +- src/procmgmt/redirect_nt.c | 35 +- src/procmgmt/test/Makefile.in | 7 +- src/procmgmt/test/NTMakefile | 8 +- src/procmgmt/test/pmgttest.c | 305 +- src/ptserver/Makefile.in | 125 +- src/ptserver/NTMakefile | 72 +- src/ptserver/db_verify.c | 1605 ++- src/ptserver/display.c | 160 +- src/ptserver/error_macros.h | 4 +- src/ptserver/map.c | 820 ++ src/ptserver/map.h | 50 + src/ptserver/pt_util.c | 387 +- src/ptserver/ptclient.c | 630 +- src/ptserver/ptclient.h | 11 +- src/ptserver/ptint.xg | 65 +- src/ptserver/ptopcodes.h | 4 +- src/ptserver/ptprocs.c | 2426 ++-- src/ptserver/pts.c | 1102 +- src/ptserver/ptserver.c | 348 +- src/ptserver/ptserver.h | 138 +- src/ptserver/ptuser.c | 640 +- src/ptserver/ptutils.c | 2274 ++- src/ptserver/readgroup.c | 164 +- src/ptserver/readpwd.c | 50 +- src/ptserver/testpt.c | 1054 +- src/ptserver/ubik.c | 131 +- src/ptserver/utils.c | 909 +- src/rcp/Makefile.in | 28 +- src/rcp/rcp.c | 1228 +- src/rlogind/Makefile.in | 27 +- src/rlogind/rexecd.c | 536 +- src/rlogind/rlogind.c | 2847 ++-- src/rsh/Makefile.in | 25 +- src/rsh/herror.c | 53 +- src/rsh/rcmd.c | 886 +- src/rsh/rlogin.c | 771 +- src/rsh/rsh.c | 624 +- src/rx/.cvsignore | 1 + src/rx/AIX/rx_kmutex.c | 24 + src/rx/AIX/rx_kmutex.h | 11 +- src/rx/AIX/rx_knet.c | 321 +- src/rx/DARWIN/rx_kmutex.c | 24 + src/rx/DARWIN/rx_kmutex.h | 4 +- src/rx/DARWIN/rx_knet.c | 161 +- src/rx/DUX/rx_kmutex.c | 24 + src/rx/DUX/rx_kmutex.h | 6 +- src/rx/DUX/rx_knet.c | 260 +- src/rx/FBSD/rx_kmutex.c | 24 + src/rx/FBSD/rx_kmutex.h | 63 +- src/rx/FBSD/rx_knet.c | 509 +- src/rx/HPUX/rx_kmutex.c | 24 + src/rx/HPUX/rx_kmutex.h | 54 +- src/rx/HPUX/rx_knet.c | 199 +- src/rx/IRIX/rx_kmutex.c | 24 + src/rx/IRIX/rx_kmutex.h | 3 +- src/rx/IRIX/rx_knet.c | 357 +- src/rx/LINUX/rx_kmutex.c | 143 + src/rx/LINUX/rx_kmutex.h | 152 +- src/rx/LINUX/rx_knet.c | 72 +- src/rx/Makefile.in | 274 +- src/rx/NBSD/rx_kmutex.c | 18 + src/rx/NBSD/rx_kmutex.h | 107 + src/rx/NBSD/rx_knet.c | 163 + src/rx/NTMakefile | 40 +- src/rx/OBSD/rx_kmutex.c | 18 + src/rx/OBSD/rx_kmutex.h | 73 + src/rx/OBSD/rx_knet.c | 122 + src/rx/SOLARIS/rx_kmutex.c | 110 + src/rx/SOLARIS/rx_kmutex.h | 70 +- src/rx/SOLARIS/rx_knet.c | 260 +- src/rx/SUNOS/rx_kmutex.h | 2 +- src/rx/SUNOS/rx_knet.c | 2 +- src/rx/UKERNEL/rx_kcommon.h | 30 +- src/rx/UKERNEL/rx_kmutex.c | 24 + src/rx/UKERNEL/rx_kmutex.h | 7 +- src/rx/UKERNEL/rx_knet.c | 101 +- src/rx/bulk.example/Makefile.in | 25 +- src/rx/bulk.example/bulk.xg | 23 +- src/rx/bulk.example/bulk_client.c | 92 +- src/rx/bulk.example/bulk_io.c | 50 +- src/rx/bulk.example/bulk_server.c | 68 +- src/rx/bulktest/Makefile.in | 7 +- src/rx/bulktest/bulk_client.c | 152 +- src/rx/bulktest/bulk_io.c | 50 +- src/rx/bulktest/bulk_server.c | 78 +- src/rx/libafsdep | 4 + src/rx/multi.example/Makefile.in | 7 +- src/rx/multi.example/sample_client.c | 73 +- src/rx/multi.example/sample_server.c | 52 +- src/rx/rx.c | 4109 +++--- src/rx/rx.h | 952 +- src/rx/rx_clock.c | 41 +- src/rx/rx_clock.h | 48 +- src/rx/rx_clock_nt.c | 31 +- src/rx/rx_conncache.c | 190 +- src/rx/rx_event.c | 180 +- src/rx/rx_event.h | 45 +- src/rx/rx_getaddr.c | 643 +- src/rx/rx_globals.c | 9 +- src/rx/rx_globals.h | 140 +- src/rx/rx_internal.h | 44 +- src/rx/rx_kcommon.c | 1023 +- src/rx/rx_kcommon.h | 162 +- src/rx/rx_kernel.h | 20 +- src/rx/rx_lwp.c | 292 +- src/rx/rx_lwp.h | 4 +- src/rx/rx_misc.c | 105 +- src/rx/rx_misc.h | 2 +- src/rx/rx_multi.c | 76 +- src/rx/rx_multi.h | 16 +- src/rx/rx_null.c | 15 +- src/rx/rx_null.h | 16 +- src/rx/rx_packet.c | 1865 +-- src/rx/rx_packet.h | 166 +- src/rx/rx_prototypes.h | 582 + src/rx/rx_pthread.c | 205 +- src/rx/rx_pthread.h | 4 +- src/rx/rx_queue.h | 4 +- src/rx/rx_rdwr.c | 1136 +- src/rx/rx_stream.c | 163 +- src/rx/rx_stream.h | 21 +- src/rx/rx_trace.c | 232 +- src/rx/rx_trace.h | 2 +- src/rx/rx_user.c | 479 +- src/rx/rx_user.h | 23 +- src/rx/rx_xmit_nt.c | 47 +- src/rx/rx_xmit_nt.h | 6 +- src/rx/rxdebug.c | 430 +- src/rx/rxdebug.rc | 2 +- src/rx/rxperf.c | 436 +- src/rx/simple.example/Makefile.in | 7 +- src/rx/simple.example/sample_client.c | 29 +- src/rx/simple.example/sample_server.c | 46 +- src/rx/test/Makefile.in | 22 +- src/rx/test/NTMakefile | 13 +- src/rx/test/generator.c | 1070 +- src/rx/test/generator.h | 16 +- src/rx/test/kctest.c | 92 +- src/rx/test/kstest.c | 51 +- src/rx/test/tableGen.c | 298 +- src/rx/test/testclient.c | 268 +- src/rx/test/testqueue.c | 42 +- src/rx/test/testserver.c | 196 +- src/rx/xdr.c | 652 +- src/rx/xdr.h | 123 +- src/rx/xdr_afsuuid.c | 47 +- src/rx/xdr_array.c | 126 +- src/rx/xdr_arrayn.c | 125 +- src/rx/xdr_float.c | 91 +- src/rx/xdr_int32.c | 86 + src/rx/xdr_int64.c | 179 +- src/rx/xdr_mem.c | 139 +- src/rx/xdr_prototypes.h | 105 + src/rx/xdr_rec.c | 753 +- src/rx/xdr_refernce.c | 53 +- src/rx/xdr_rx.c | 359 +- src/rx/xdr_stdio.c | 153 +- src/rx/xdr_update.c | 66 +- src/rxdebug/Makefile.in | 34 +- src/rxdebug/rxdebug.c | 439 +- src/rxgen/Makefile.am | 2 +- src/rxgen/Makefile.in | 44 +- src/rxgen/NTMakefile | 23 +- src/rxgen/rpc_clntout.c | 128 +- src/rxgen/rpc_cout.c | 713 +- src/rxgen/rpc_errors.h | 1 - src/rxgen/rpc_hout.c | 635 +- src/rxgen/rpc_main.c | 1170 +- src/rxgen/rpc_parse.c | 1755 +-- src/rxgen/rpc_parse.h | 152 +- src/rxgen/rpc_scan.c | 750 +- src/rxgen/rpc_scan.h | 120 +- src/rxgen/rpc_svcout.c | 344 +- src/rxgen/rpc_util.c | 537 +- src/rxgen/rpc_util.h | 175 +- src/rxgen/rxgen_consts.h | 14 - src/rxkad/.cvsignore | 2 +- src/rxkad/Makefile.in | 186 +- src/rxkad/NTMakefile | 61 +- src/rxkad/asn1-common.h | 2 +- src/rxkad/asn1_err.h | 30 +- src/rxkad/bg-fcrypt.c | 1126 +- src/rxkad/crc.c | 12 +- src/rxkad/der.h | 195 +- src/rxkad/domestic/crypt_conn.c | 113 +- src/rxkad/domestic/fcrypt.c | 139 +- src/rxkad/domestic/fcrypt.h | 12 +- src/rxkad/domestic/sboxes.h | 196 +- src/rxkad/domestic/tcrypt.c | 176 +- src/rxkad/fc_test.c | 246 +- src/rxkad/hash.h | 71 + src/rxkad/libafsdep | 6 + src/rxkad/lifetimes.h | 129 +- src/rxkad/md4.c | 289 + src/rxkad/md4.h | 54 + src/rxkad/md5.c | 313 + src/rxkad/md5.h | 54 + src/rxkad/private_data.h | 93 +- src/rxkad/rxkad.p.h | 35 +- src/rxkad/rxkad_client.c | 229 +- src/rxkad/rxkad_common.c | 440 +- src/rxkad/rxkad_prototypes.h | 145 + src/rxkad/rxkad_server.c | 346 +- src/rxkad/test/Makefile.in | 36 +- src/rxkad/test/NTMakefile | 21 +- src/rxkad/test/stress.c | 267 +- src/rxkad/test/stress_c.c | 1011 +- src/rxkad/test/stress_internal.h | 28 +- src/rxkad/test/stress_s.c | 217 +- src/rxkad/ticket.c | 437 +- src/rxkad/ticket5.c | 202 +- src/rxkad/v5der.c | 609 +- src/rxkad/v5gen-rewrite.h | 96 +- src/rxkad/v5gen.c | 4356 +++--- src/rxkad/v5gen.h | 1078 +- src/rxstat/.cvsignore | 1 + src/rxstat/Makefile.in | 100 +- src/rxstat/NTMakefile | 20 +- src/rxstat/rxstat.c | 148 +- src/scout/Makefile.in | 32 +- src/scout/scout.c | 2313 ++- src/sgistuff/Makefile.in | 28 +- src/sgistuff/sgi_auth.c | 73 +- src/shlibafsauthent/.cvsignore | 2 + src/shlibafsauthent/Makefile.in | 24 +- src/shlibafsauthent/NTMakefile | 78 +- src/shlibafsrpc/.cvsignore | 2 + src/shlibafsrpc/Makefile.in | 45 +- src/shlibafsrpc/NTMakefile | 100 +- src/sia/Makefile.in | 34 +- src/sia/siad.c | 234 +- src/sia/test-reauth.c | 23 +- src/splint.cfg | 17 + src/sys/Makefile.in | 330 +- src/sys/NTMakefile | 7 +- src/sys/{afs.exp => afs4.exp} | 4 - src/sys/afs5.exp | 140 + src/sys/{afsl.exp => afsl4.exp} | 0 src/sys/afsl5.exp | 27 + src/sys/afssyscalls.c | 267 +- src/sys/afssyscalls.h | 42 +- src/sys/fixit.c | 74 +- src/sys/icreate.c | 7 +- src/sys/idec.c | 15 +- src/sys/iinc.c | 15 +- src/sys/iopen.c | 24 +- src/sys/iread.c | 14 +- src/sys/istat.c | 12 +- src/sys/iwrite.c | 13 +- src/sys/pagsh.c | 76 +- src/sys/pioctl_nt.c | 529 +- src/sys/pioctl_nt.h | 17 +- src/sys/rmtsysc.c | 143 +- src/sys/rmtsysd.c | 24 +- src/sys/rmtsysnet.c | 620 +- src/sys/rmtsyss.c | 74 +- src/sys/xfsattrs.h | 20 +- src/tbutc/Makefile.in | 51 +- src/tbutc/NTMakefile | 95 +- src/tests/.cvsignore | 71 + src/tests/KeyFile | Bin 100 -> 0 bytes src/tests/KeyFile.uu | 6 + src/tests/Makefile.in | 16 +- src/tests/OpenAFS/.cvsignore | 1 + src/tests/README.dumptool | 2 +- src/tests/afscp.c | 962 +- src/tests/afscp_callback.c | 228 +- src/tests/afsdump_dirlist.c | 160 +- src/tests/afsdump_extract.c | 823 +- src/tests/afsdump_scan.c | 443 +- src/tests/afsdump_xsed.c | 525 +- src/tests/append-over-page.c | 1009 +- src/tests/apwd.c | 231 +- src/tests/asu.c | 11 +- src/tests/backuphdr.c | 93 +- src/tests/blocks-new-file.c | 34 +- src/tests/boot-strap-arla | 2 +- src/tests/build-and-run-rcs | 2 +- src/tests/build-emacs | 2 +- src/tests/build-emacs-j | 2 +- src/tests/build-gdb | 2 +- src/tests/build-openafs | 2 +- src/tests/checkpwd | 2 +- src/tests/compare-inum-mp | 2 +- src/tests/compare-inums | 2 +- src/tests/compare-with-local | 2 +- src/tests/copy-and-diff-gnu-mirror | 2 +- src/tests/copy-file | 2 +- src/tests/create-dirs.c | 28 +- src/tests/create-files.c | 42 +- src/tests/create-remove-dirs | 2 +- src/tests/create-remove-files | 2 +- src/tests/create-remove.c | 60 +- src/tests/create-stat.c | 61 +- src/tests/create-symlinks.c | 65 +- src/tests/dd | 2 +- src/tests/deep-tree | 2 +- src/tests/deep-tree2 | 2 +- src/tests/dir-size-mismatch | 2 +- src/tests/dir-tree | 2 +- src/tests/directory.c | 237 +- src/tests/dump.c | 400 +- src/tests/dumpfmt.h | 28 +- src/tests/dumpscan.h | 332 +- src/tests/dumptool.c | 3512 +++-- src/tests/dup2-and-unlog.c | 18 +- src/tests/echo-n.c | 10 +- src/tests/err.c | 10 +- src/tests/err.h | 20 +- src/tests/errx.c | 10 +- src/tests/exit-wo-close.c | 60 +- src/tests/fcachesize-dir | 2 +- src/tests/fcachesize-file-small | 2 +- src/tests/fcachesize-read-file | 2 +- src/tests/fcachesize-write-file | 2 +- src/tests/fchmod.c | 20 +- src/tests/fhbench.c | 186 +- src/tests/find-and-cat-netbsd | 2 +- src/tests/find-linux | 2 +- src/tests/fs-flush | 2 +- src/tests/fs-sa-la | 2 +- src/tests/fs_lib.c | 379 +- src/tests/fsx.c | 1610 ++- src/tests/ga-test.c | 184 +- src/tests/generic-build | 2 +- src/tests/getdents-and-unlink1 | 2 +- src/tests/getdents-and-unlink2 | 2 +- src/tests/getdents-and-unlink3 | 2 +- src/tests/hardlink1.c | 89 +- src/tests/hardlink2.c | 14 +- src/tests/hardlink3 | 2 +- src/tests/hardlink4.c | 42 +- src/tests/hardlink5 | 2 +- src/tests/hello-world.in | 2 +- src/tests/int64.c | 499 +- src/tests/intNN.h | 4 +- src/tests/internal.h | 20 +- src/tests/intr-read.c | 11 +- src/tests/intr-read1 | 2 +- src/tests/invalidate-file.c | 132 +- src/tests/kaserver.DB0 | Bin 34880 -> 0 bytes src/tests/kaserver.DB0.uu | 779 ++ src/tests/kaserver.DBSYS1 | Bin 64 -> 0 bytes src/tests/kaserver.DBSYS1.uu | 5 + src/tests/kill-softer.c | 102 +- src/tests/kill-softly.c | 71 +- src/tests/kotest | 2 +- src/tests/large-dir-16384 | 2 +- src/tests/large-dir-extra | 2 +- src/tests/large-dir.c | 112 +- src/tests/large-dir2.c | 73 +- src/tests/large-dir3.c | 73 +- src/tests/large-filename | 2 +- src/tests/ls-afs | 2 +- src/tests/make-page.c | 31 +- src/tests/many-dirs | 2 +- src/tests/many-fetchs | 2 +- src/tests/many-files | 2 +- src/tests/many-files-with-content | 2 +- src/tests/many-stores | 2 +- src/tests/many-symlinks | 2 +- src/tests/mkdir | 2 +- src/tests/mkdir1 | 2 +- src/tests/mkdir2.c | 32 +- src/tests/mkdir3.c | 54 +- src/tests/mkm-rmm | 2 +- src/tests/mmap-and-read.c | 84 +- src/tests/mmap-cat.c | 44 +- src/tests/mmap-shared-write.c | 34 +- src/tests/mmap-vs-read.c | 84 +- src/tests/mmap-vs-read2.c | 84 +- src/tests/mountpoint.in | 2 +- src/tests/null-search.c | 239 +- src/tests/parallel1 | 2 +- src/tests/parsedump.c | 376 +- src/tests/parsetag.c | 253 +- src/tests/parsevnode.c | 760 +- src/tests/parsevol.c | 513 +- src/tests/pathname.c | 600 +- src/tests/pine.c | 36 +- src/tests/primitive.c | 182 +- src/tests/read-vs-mmap.c | 86 +- src/tests/read-vs-mmap2.c | 64 +- src/tests/read-write.c | 66 +- src/tests/readdir-vs-lstat.c | 36 +- src/tests/rename-under-feet.c | 94 +- src/tests/rename1 | 2 +- src/tests/rename2 | 2 +- src/tests/rename3 | 2 +- src/tests/rename4 | 2 +- src/tests/rename5.c | 38 +- src/tests/rename6.c | 10 +- src/tests/repair.c | 622 +- src/tests/rewrite-emacs | 2 +- src/tests/rm-rf.c | 53 +- src/tests/run-fsx | 2 +- src/tests/run-suite.pl | 39 + src/tests/run-tests.in | 4 +- src/tests/setgroups | 2 +- src/tests/setpag | 2 +- src/tests/shallow-tree | 2 +- src/tests/snprintf.c | 888 +- src/tests/stagehdr.c | 190 +- src/tests/stagehdr.h | 40 +- src/tests/still-there-p.c | 10 +- src/tests/strange-characters | 2 +- src/tests/strange-characters-c.c | 34 +- src/tests/strange-other-characters | 2 +- src/tests/symlink.c | 16 +- src/tests/test-gunzip-gnu-mirror | 2 +- src/tests/test-parallel1.c | 28 +- src/tests/test-parallel2.c | 94 +- src/tests/test-setgroups.c | 59 +- src/tests/test-setpag.c | 49 +- src/tests/too-many-files | 2 +- src/tests/truncate-files.c | 76 +- src/tests/truncate.c | 40 +- src/tests/untar-emacs | 2 +- src/tests/untar-openafs | 2 +- src/tests/util.c | 222 +- src/tests/utime-dir.c | 14 +- src/tests/utime-file.c | 41 +- src/tests/verr.c | 2 +- src/tests/verrx.c | 2 +- src/tests/visit-volumes | 2 +- src/tests/vwarn.c | 2 +- src/tests/vwarnx.c | 3 +- src/tests/warn.c | 10 +- src/tests/warnerr.c | 22 +- src/tests/warnx.c | 10 +- src/tests/write-closed.c | 32 +- src/tests/write-closed2.c | 50 +- src/tests/write-large.c | 22 +- src/tests/write-rand.c | 44 +- src/tests/write-ro-file.c | 36 +- src/tests/write-ucc.c | 48 +- src/tests/write3.c | 14 +- src/tests/xf_files.c | 206 +- src/tests/xf_printf.c | 690 +- src/tests/xf_profile.c | 200 +- src/tests/xf_rxcall.c | 353 +- src/tests/xfiles.c | 267 +- src/tests/xfiles.h | 58 +- src/tsm41/Makefile.in | 32 +- src/tsm41/aix41_auth.c | 190 +- src/tviced/Makefile.in | 125 +- src/tviced/NTMakefile | 169 +- src/tvolser/Makefile.in | 206 + src/ubik/Makefile.in | 110 +- src/ubik/NTMakefile | 66 +- src/ubik/beacon.c | 566 +- src/ubik/disk.c | 688 +- src/ubik/lock.c | 150 +- src/ubik/phys.c | 162 +- src/ubik/recovery.c | 670 +- src/ubik/remote.c | 418 +- src/ubik/ubik.c | 655 +- src/ubik/ubik.p.h | 259 +- src/ubik/ubikclient.c | 552 +- src/ubik/ubikcmd.c | 38 +- src/ubik/udebug.c | 276 +- src/ubik/utst_client.c | 144 +- src/ubik/utst_server.c | 102 +- src/ubik/vote.c | 370 +- src/update/Makefile.in | 44 +- src/update/NTMakefile | 33 +- src/update/client.c | 544 +- src/update/server.c | 315 +- src/update/utils.c | 35 +- src/usd/Makefile.in | 29 +- src/usd/NTMakefile | 9 +- src/usd/test/Makefile.in | 19 +- src/usd/test/NTMakefile | 7 +- src/usd/test/usd_test.c | 429 +- src/usd/usd.h | 51 +- src/usd/usd_file.c | 232 +- src/usd/usd_nt.c | 461 +- src/uss/Makefile.in | 52 +- src/uss/grammar.y | 11 + src/uss/{lex.c => lex.l} | 8 +- src/uss/sample.template | 4 - src/uss/uss.c | 983 +- src/uss/uss_acl.c | 418 +- src/uss/uss_acl.h | 22 +- src/uss/uss_common.c | 190 +- src/uss/uss_common.h | 121 +- src/uss/uss_fs.c | 364 +- src/uss/uss_fs.h | 84 +- src/uss/uss_kauth.c | 516 +- src/uss/uss_kauth.h | 24 +- src/uss/uss_procs.c | 575 +- src/uss/uss_procs.h | 94 +- src/uss/uss_ptserver.c | 166 +- src/uss/uss_ptserver.h | 28 +- src/uss/uss_vol.c | 780 +- src/uss/uss_vol.h | 68 +- src/util/Makefile.am | 2 +- src/util/Makefile.in | 342 +- src/util/NTMakefile | 49 +- src/util/afs/Makefile.am | 2 +- src/util/afs_atomlist.c | 244 +- src/util/afs_atomlist.h | 27 +- src/util/afs_lhash.c | 738 +- src/util/afs_lhash.h | 79 +- src/util/afsutil.h | 83 +- src/util/afsutil_prototypes.h | 189 + src/util/assert.c | 23 +- src/util/base32.c | 29 +- src/util/base64.c | 37 +- src/util/casestrcpy.c | 89 +- src/util/dirent_nt.h | 4 +- src/util/dirpath.c | 402 +- src/util/dirpath_nt.h | 177 +- src/util/errmap_nt.c | 51 +- src/util/errmap_nt.h | 6 +- src/util/errors.h | 34 +- src/util/fileutil.c | 24 +- src/util/fileutil.h | 19 +- src/util/flipbase64.c | 33 +- src/util/get_krbrlm.c | 26 +- src/util/hostparse.c | 286 +- src/util/hputil.c | 49 +- src/util/isathing.c | 18 +- src/util/itc.h | 2 +- src/util/kreltime.c | 203 +- src/util/ktime.c | 514 +- src/util/ktime.h | 13 +- src/util/netutils.c | 697 +- src/util/netutils.h | 34 +- src/util/packages.h | 26 +- src/util/potpourri.h | 8 +- src/util/pthread_glock.c | 27 +- src/util/pthread_glock.h | 2 +- src/util/pthread_nosigs.h | 44 +- src/util/readdir_nt.c | 75 +- src/util/regex.c | 542 +- src/util/remote.h | 126 +- src/util/secutil_nt.c | 86 +- src/util/secutil_nt.h | 16 +- src/util/serverLog.c | 196 +- src/util/snprintf.c | 716 +- src/util/softsig.c | 163 +- src/util/softsig.h | 4 +- src/util/strlcat.c | 61 + src/util/strlcpy.c | 56 + src/util/sys.c | 10 +- src/util/test/Makefile.in | 7 +- src/util/test/NTMakefile | 12 +- src/util/test/b32.c | 55 +- src/util/test/b64.c | 55 +- src/util/test/dirpath_test.c | 262 +- src/util/test/dtest.c | 14 +- src/util/test/fb64.c | 63 +- src/util/test/ktest.c | 8 +- src/util/test/test_ktime.c | 90 +- src/util/test/treaddir.c | 15 +- src/util/uuid.c | 231 +- src/util/vice.h | 15 +- src/util/volparse.c | 177 +- src/util/winsock_nt.c | 11 +- src/venus/.cvsignore | 2 +- src/venus/Makefile.in | 162 +- src/venus/cacheout.c | 370 +- src/venus/cmdebug.c | 321 +- src/venus/fs.c | 2228 +-- src/venus/fstrace.c | 2524 ++-- src/venus/gcpags.c | 14 +- src/venus/kdump.c | 4007 +++--- src/venus/livesys.c | 18 +- src/venus/lock.h | 187 - src/venus/test/Makefile.in | 31 +- src/venus/test/fulltest.c | 179 +- src/venus/test/getinitparams.c | 27 +- src/venus/test/idtest.c | 7 +- src/venus/test/owntest.c | 44 +- src/venus/twiddle.c | 163 +- src/venus/up.c | 1056 +- src/venus/whatfid.c | 77 +- src/vfsck/Makefile.in | 106 +- src/vfsck/bcheckrc | 2 +- src/vfsck/bcheckrc-hp_ux110 | 2 +- src/vfsck/dir.c | 1024 +- src/vfsck/dirutils.c | 32 +- src/vfsck/fsck.h | 184 +- src/vfsck/inode.c | 838 +- src/vfsck/main.c | 1698 +-- src/vfsck/mount | 2 +- src/vfsck/pass1.c | 642 +- src/vfsck/pass1b.c | 97 +- src/vfsck/pass2.c | 554 +- src/vfsck/pass3.c | 126 +- src/vfsck/pass4.c | 203 +- src/vfsck/pass5.c | 488 +- src/vfsck/proplist.c | 722 +- src/vfsck/setup.c | 1221 +- src/vfsck/ufs_subr.c | 225 +- src/vfsck/ufs_tables.c | 137 +- src/vfsck/utilities.c | 1409 +- src/vfsck/vprintf.c | 13 +- src/viced/Makefile.in | 54 +- src/viced/NTMakefile | 33 +- src/viced/afsfileprocs.c | 11646 ++++++++-------- src/viced/callback.c | 2051 +-- src/viced/check_sysid.c | 150 +- src/viced/fs_stats.h | 174 +- src/viced/fsprobe.c | 542 +- src/viced/host.c | 2227 +-- src/viced/host.h | 239 +- src/viced/physio.c | 134 +- src/viced/profile.c | 37 +- src/viced/viced.c | 2495 ++-- src/viced/viced.h | 232 +- src/viced/viced_prototypes.h | 8 + src/vlserver/Makefile.in | 199 +- src/vlserver/NTMakefile | 69 +- src/vlserver/cnvldb.c | 1170 +- src/vlserver/cnvldb.h | 167 +- src/vlserver/sascnvldb.c | 528 +- src/vlserver/vlclient.c | 1453 +- src/vlserver/vlclient.h | 1 - src/vlserver/vldb_check.c | 1651 ++- src/vlserver/vlprocs.c | 3070 ++-- src/vlserver/vlserver.c | 172 +- src/vlserver/vlserver.p.h | 92 +- src/vlserver/vlutils.c | 814 +- src/vol/Makefile.in | 66 +- src/vol/NTMakefile | 42 +- src/vol/clone.c | 523 +- src/vol/common.c | 34 +- src/vol/devname.c | 127 +- src/vol/fs_conv_411.c | 1367 +- src/vol/fssync.c | 523 +- src/vol/fssync.h | 34 +- src/vol/fstab.c | 2 + src/vol/gi.c | 115 +- src/vol/ihandle.c | 329 +- src/vol/ihandle.h | 155 +- src/vol/listinodes.c | 1566 ++- src/vol/namei_ops.c | 960 +- src/vol/namei_ops.h | 41 +- src/vol/nfs.h | 2 +- src/vol/ntops.c | 540 +- src/vol/ntops.h | 43 +- src/vol/nuke.c | 115 +- src/vol/partition.c | 726 +- src/vol/partition.h | 70 +- src/vol/physio.c | 99 +- src/vol/purge.c | 97 +- src/vol/salvage.h | 5 +- src/vol/test/Makefile.in | 28 +- src/vol/test/NTMakefile | 13 +- src/vol/test/ilist_nt.c | 34 +- src/vol/test/listVicepx.c | 885 +- src/vol/test/listVicepx.h | 25 +- src/vol/test/ltlist.c | 29 +- src/vol/test/nicreate.c | 15 +- src/vol/test/nilist.c | 45 +- src/vol/test/nincdec.c | 35 +- src/vol/test/nino.c | 50 +- src/vol/test/nsubr.c | 11 +- src/vol/test/testpart.c | 23 +- src/vol/test/updateDirInode.c | 459 +- src/vol/test/utilities.c | 151 +- src/vol/viceinode.h | 36 +- src/vol/vnode.c | 531 +- src/vol/vnode.h | 183 +- src/vol/vol-info.c | 441 +- src/vol/vol-salvage.c | 2943 ++-- src/vol/voldefs.h | 2 +- src/vol/volinodes.h | 41 +- src/vol/volume.c | 1233 +- src/vol/volume.h | 505 +- src/vol/vutil.c | 224 +- src/vol/xfs_size_check.c | 71 +- src/volser/Makefile.in | 91 +- src/volser/NTMakefile | 69 +- src/volser/common.c | 38 +- src/volser/dump.h | 2 +- src/volser/dumpstuff.c | 1485 +- src/volser/lockdata.h | 4 +- src/volser/lockprocs.c | 147 +- src/volser/physio.c | 92 +- src/volser/restorevol.c | 1623 +-- src/volser/vol-dump.c | 871 ++ src/volser/vol.h | 10 +- src/volser/volint.xg | 18 + src/volser/volmain.c | 306 +- src/volser/volprocs.c | 2461 ++-- src/volser/volser.p.h | 92 +- src/volser/volser_prototypes.h | 102 + src/volser/voltrans.c | 146 +- src/volser/vos.c | 6128 ++++---- src/volser/vsprocs.c | 8536 ++++++----- src/volser/vsutils.c | 517 +- src/wsadmin.lib/aix_22.generic | 9 +- src/wsadmin.lib/aix_22.generic.dev | 9 +- src/wsadmin.lib/aix_22.readonly | 9 +- src/wsadmin.lib/aix_22.readwrite | 9 +- src/wsadmin.lib/base.generic | 9 +- src/wsadmin.lib/devel | 9 +- src/wsadmin.lib/pmax_31.generic | 9 +- src/wsadmin.lib/pmax_31.generic.dev | 9 +- src/wsadmin.lib/pmax_31.readonly | 9 +- src/wsadmin.lib/pmax_31.readwrite | 9 +- src/wsadmin.lib/rt_r4.generic | 9 +- src/wsadmin.lib/rt_r4.generic.dev | 9 +- src/wsadmin.lib/rt_r4.generic.dkload | 9 +- src/wsadmin.lib/rt_r4.generic.printer | 7 +- src/wsadmin.lib/rt_r4.readonly | 9 +- src/wsadmin.lib/rt_r4.readwrite | 9 +- src/wsadmin.lib/sun3_35.generic | 9 +- src/wsadmin.lib/sun3_35.generic.dev | 9 +- src/wsadmin.lib/sun3_35.readonly | 9 +- src/wsadmin.lib/sun3_35.readwrite | 9 +- src/wsadmin.lib/sun3_40.generic | 9 +- src/wsadmin.lib/sun3_40.generic.dev | 9 +- src/wsadmin.lib/sun3_40.readonly | 9 +- src/wsadmin.lib/sun3_40.readwrite | 9 +- src/wsadmin.lib/sun3_40x.generic | 9 +- src/wsadmin.lib/sun3_40x.generic.dev | 9 +- src/wsadmin.lib/sun3_40x.readonly | 13 +- src/wsadmin.lib/sun3_40x.readwrite | 9 +- src/wsadmin.lib/sun4_40.generic | 9 +- src/wsadmin.lib/sun4_40.generic.dev | 9 +- src/wsadmin.lib/sun4_40.readonly | 9 +- src/wsadmin.lib/sun4_40.readwrite | 9 +- src/wsadmin.lib/sun4_40c.generic | 9 +- src/wsadmin.lib/sun4_40c.generic.dev | 9 +- src/wsadmin.lib/sun4_40c.readonly | 9 +- src/wsadmin.lib/sun4_40c.readwrite | 9 +- src/wsadmin.lib/vax_30.generic | 9 +- src/wsadmin.lib/vax_30.generic.dev | 9 +- src/wsadmin.lib/vax_30.readonly | 9 +- src/wsadmin.lib/vax_30.readwrite | 9 +- src/wsadmin.src/Makefile.in | 18 +- src/wsadmin.src/admin | 9 +- src/wsadmin.src/staff.dkload.proto | 9 +- src/wsadmin.src/staff.printer.proto | 9 +- src/wsadmin.src/staff.proto | 10 +- src/xstat/Makefile.in | 30 +- src/xstat/xstat_cm.c | 413 +- src/xstat/xstat_cm.h | 84 +- src/xstat/xstat_cm_test.c | 1538 +- src/xstat/xstat_fs.c | 486 +- src/xstat/xstat_fs.h | 84 +- src/xstat/xstat_fs_callback.c | 426 +- src/xstat/xstat_fs_test.c | 617 +- 2330 files changed, 369299 insertions(+), 256144 deletions(-) create mode 100644 .splintrc create mode 100644 Makefile-libafs.in create mode 100644 README-NT rename src/README-WIN9X => README-WIN9X (97%) create mode 100644 README.DEVEL create mode 100644 aclocal.m4 create mode 100644 configure create mode 100644 configure-libafs create mode 100644 libafsdep delete mode 100644 src/..wow.3 create mode 100644 src/.cvsignore create mode 100644 src/DOLASTCMP.BAT create mode 100644 src/JAVA/classes/ErrorMessages.properties create mode 100644 src/JAVA/classes/org/openafs/jafs/ACL.java create mode 100644 src/JAVA/classes/org/openafs/jafs/AFSException.java create mode 100644 src/JAVA/classes/org/openafs/jafs/AFSFileException.java create mode 100644 src/JAVA/classes/org/openafs/jafs/AFSSecurityException.java create mode 100644 src/JAVA/classes/org/openafs/jafs/Cell.java create mode 100644 src/JAVA/classes/org/openafs/jafs/ErrorTable.java create mode 100644 src/JAVA/classes/org/openafs/jafs/File.java create mode 100644 src/JAVA/classes/org/openafs/jafs/FileInputStream.java create mode 100644 src/JAVA/classes/org/openafs/jafs/FileOutputStream.java create mode 100644 src/JAVA/classes/org/openafs/jafs/Group.java create mode 100644 src/JAVA/classes/org/openafs/jafs/Key.java create mode 100644 src/JAVA/classes/org/openafs/jafs/PTSEntry.java create mode 100644 src/JAVA/classes/org/openafs/jafs/Partition.java create mode 100644 src/JAVA/classes/org/openafs/jafs/Process.java create mode 100644 src/JAVA/classes/org/openafs/jafs/Server.java create mode 100644 src/JAVA/classes/org/openafs/jafs/Token.java create mode 100644 src/JAVA/classes/org/openafs/jafs/User.java create mode 100644 src/JAVA/classes/org/openafs/jafs/Volume.java create mode 100644 src/JAVA/libjafs/.cvsignore create mode 100644 src/JAVA/libjafs/ACL.c create mode 100644 src/JAVA/libjafs/AdminToken.c create mode 100644 src/JAVA/libjafs/Cell.c create mode 100644 src/JAVA/libjafs/Exceptions.h create mode 100644 src/JAVA/libjafs/File.c create mode 100644 src/JAVA/libjafs/FileInputStream.c create mode 100644 src/JAVA/libjafs/FileOutputStream.c create mode 100644 src/JAVA/libjafs/Group.c create mode 100644 src/JAVA/libjafs/Internal.c create mode 100644 src/JAVA/libjafs/Internal.h create mode 100644 src/JAVA/libjafs/JAFS_README create mode 100644 src/JAVA/libjafs/Key.c create mode 100644 src/JAVA/libjafs/Makefile.in create mode 100644 src/JAVA/libjafs/Partition.c create mode 100644 src/JAVA/libjafs/Process.c create mode 100644 src/JAVA/libjafs/Server.c create mode 100644 src/JAVA/libjafs/User.c create mode 100644 src/JAVA/libjafs/UserToken.c create mode 100644 src/JAVA/libjafs/Volume.c create mode 100644 src/JAVA/libjafs/etc/CacheConfig create mode 100644 src/JAVA/libjafs/etc/CacheConfig.100MB create mode 100644 src/JAVA/libjafs/etc/CacheConfig.40MB delete mode 100644 src/README-NT create mode 100644 src/SOURCE-MAP create mode 100644 src/TechNotes-JavaAPI rename src/WINNT/afs_setup_utils/lang/zh_CN/{afs_setup_utmls.rc => afs_setup_utils.rc} (98%) create mode 100644 src/WINNT/afsd/afsd_eventlog.c create mode 100644 src/WINNT/afsd/afsd_eventlog.h create mode 100644 src/WINNT/afsd/afsd_eventmessages.mc create mode 100644 src/WINNT/afsd/afsd_eventmessages.rc create mode 100644 src/WINNT/afsd/afsd_flushvol.c create mode 100644 src/WINNT/afsd/afsd_flushvol.h create mode 100644 src/WINNT/afsd/afskfw-int.h create mode 100644 src/WINNT/afsd/afskfw.c create mode 100644 src/WINNT/afsd/afskfw.h create mode 100644 src/WINNT/afsd/lanahelper.cpp create mode 100644 src/WINNT/afsd/lanahelper.h create mode 100644 src/WINNT/aklog/NTMakefile create mode 100644 src/WINNT/aklog/aklog.c create mode 100644 src/WINNT/aklog/aklog.h create mode 100644 src/WINNT/aklog/aklog.rc create mode 100644 src/WINNT/aklog/linked_list.c create mode 100644 src/WINNT/aklog/linked_list.h create mode 100644 src/WINNT/client_config/RegistrySupport.cpp create mode 100644 src/WINNT/client_config/dlg_binding.cpp create mode 100644 src/WINNT/client_creds/ipaddrchg.c create mode 100644 src/WINNT/client_creds/ipaddrchg.h create mode 100644 src/WINNT/client_exp/make_symbolic_link_dlg.cpp create mode 100644 src/WINNT/client_exp/make_symbolic_link_dlg.h create mode 100644 src/WINNT/client_osi/NTMakefile-TestOSI create mode 100644 src/WINNT/client_osi/largeint.h create mode 100644 src/WINNT/client_osi/osievent.mc create mode 100644 src/WINNT/install/NSIS/AFSCell.ini create mode 100644 src/WINNT/install/NSIS/CellServPage.ini create mode 100644 src/WINNT/install/NSIS/MakeCommon.bat create mode 100644 src/WINNT/install/NSIS/NTMakefile create mode 100644 src/WINNT/install/NSIS/OpenAFS.nsi create mode 100644 src/WINNT/install/NSIS/Service.cpp create mode 100644 src/WINNT/install/NSIS/ServiceLib.nsh create mode 100644 src/WINNT/install/NSIS/afsdcell.ini create mode 100644 src/WINNT/install/NSIS/killer.cpp create mode 100644 src/WINNT/kfw/inc/kclient/kclient.h create mode 100644 src/WINNT/kfw/inc/kclient/kcmacerr.h create mode 100644 src/WINNT/kfw/inc/krb4/com_err.h create mode 100644 src/WINNT/kfw/inc/krb4/conf-pc.h create mode 100644 src/WINNT/kfw/inc/krb4/conf.h create mode 100644 src/WINNT/kfw/inc/krb4/des.h create mode 100644 src/WINNT/kfw/inc/krb4/kadm_err.h create mode 100644 src/WINNT/kfw/inc/krb4/krb.h create mode 100644 src/WINNT/kfw/inc/krb4/krberr.h create mode 100644 src/WINNT/kfw/inc/krb4/mit_copy.h create mode 100644 src/WINNT/kfw/inc/krb4/osconf.h create mode 100644 src/WINNT/kfw/inc/krb5/KerberosIV/des.h create mode 100644 src/WINNT/kfw/inc/krb5/KerberosIV/kadm_err.h create mode 100644 src/WINNT/kfw/inc/krb5/KerberosIV/krb.h create mode 100644 src/WINNT/kfw/inc/krb5/KerberosIV/krb_err.h create mode 100644 src/WINNT/kfw/inc/krb5/KerberosIV/mit-copyright.h create mode 100644 src/WINNT/kfw/inc/krb5/com_err.h create mode 100644 src/WINNT/kfw/inc/krb5/gssapi/gssapi.h create mode 100644 src/WINNT/kfw/inc/krb5/gssapi/gssapi_generic.h create mode 100644 src/WINNT/kfw/inc/krb5/gssapi/gssapi_krb5.h create mode 100644 src/WINNT/kfw/inc/krb5/krb5.h create mode 100644 src/WINNT/kfw/inc/krb5/profile.h create mode 100644 src/WINNT/kfw/inc/krb5/win-mac.h create mode 100644 src/WINNT/kfw/inc/krbcc/cacheapi.h create mode 100644 src/WINNT/kfw/inc/leash/leasherr.h create mode 100644 src/WINNT/kfw/inc/leash/leashinfo.h create mode 100644 src/WINNT/kfw/inc/leash/leashwin.h create mode 100644 src/WINNT/kfw/inc/loadfuncs/loadfuncs-afs.h create mode 100644 src/WINNT/kfw/inc/loadfuncs/loadfuncs-afs36.h create mode 100644 src/WINNT/kfw/inc/loadfuncs/loadfuncs-com_err.h create mode 100644 src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb.h create mode 100644 src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb5.h create mode 100644 src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb524.h create mode 100644 src/WINNT/kfw/inc/loadfuncs/loadfuncs-leash.h create mode 100644 src/WINNT/kfw/inc/loadfuncs/loadfuncs-lsa.h create mode 100644 src/WINNT/kfw/inc/loadfuncs/loadfuncs-profile.h create mode 100644 src/WINNT/kfw/inc/loadfuncs/loadfuncs-wshelper.h create mode 100644 src/WINNT/kfw/inc/loadfuncs/loadfuncs.c create mode 100644 src/WINNT/kfw/inc/loadfuncs/loadfuncs.h create mode 100644 src/WINNT/kfw/inc/wshelper/arpa/nameser.h create mode 100644 src/WINNT/kfw/inc/wshelper/hesiod.h create mode 100644 src/WINNT/kfw/inc/wshelper/mitwhich.h create mode 100644 src/WINNT/kfw/inc/wshelper/resolv.h create mode 100644 src/WINNT/kfw/inc/wshelper/wshelper.h create mode 100644 src/WINNT/kfw/lib/i386/comerr32.lib create mode 100644 src/WINNT/kfw/lib/i386/delaydlls.lib create mode 100644 src/WINNT/kfw/lib/i386/getopt.lib create mode 100644 src/WINNT/kfw/lib/i386/gssapi32.lib create mode 100644 src/WINNT/kfw/lib/i386/kclnt32.lib create mode 100644 src/WINNT/kfw/lib/i386/krb524.lib create mode 100644 src/WINNT/kfw/lib/i386/krb5_32.lib create mode 100644 src/WINNT/kfw/lib/i386/krbcc32.lib create mode 100644 src/WINNT/kfw/lib/i386/krbv4w32.lib create mode 100644 src/WINNT/kfw/lib/i386/leashw32.lib create mode 100644 src/WINNT/kfw/lib/i386/loadfuncs.lib create mode 100644 src/WINNT/kfw/lib/i386/wshelp32.lib create mode 100644 src/WINNT/kfw/lib/i386/xpprof32.lib create mode 100644 src/afs/AIX/osi_assem32.s create mode 100644 src/afs/AIX/osi_assem64.s create mode 100644 src/afs/DUX/osi_prototypes.h delete mode 100644 src/afs/FBSD/vnode_if.h create mode 100644 src/afs/HPUX/hpux_mod.modmeta create mode 100644 src/afs/HPUX/osi_prototypes.h create mode 100644 src/afs/IRIX/osi_prototypes.h create mode 100644 src/afs/LINUX/.cvsignore create mode 100644 src/afs/NBSD/opt_posix.h create mode 100644 src/afs/NBSD/osi_file.c create mode 100644 src/afs/NBSD/osi_groups.c create mode 100644 src/afs/NBSD/osi_inode.c create mode 100644 src/afs/NBSD/osi_inode.h create mode 100644 src/afs/NBSD/osi_machdep.h create mode 100644 src/afs/NBSD/osi_misc.c create mode 100644 src/afs/NBSD/osi_sleep.c create mode 100644 src/afs/NBSD/osi_vfsops.c create mode 100644 src/afs/NBSD/osi_vm.c create mode 100644 src/afs/NBSD/osi_vnodeops.c create mode 100644 src/afs/NTMakefile create mode 100644 src/afs/OBSD/osi_file.c create mode 100644 src/afs/OBSD/osi_groups.c create mode 100644 src/afs/OBSD/osi_inode.h create mode 100644 src/afs/OBSD/osi_machdep.h create mode 100644 src/afs/OBSD/osi_misc.c create mode 100644 src/afs/OBSD/osi_prototypes.h create mode 100644 src/afs/OBSD/osi_sleep.c create mode 100644 src/afs/OBSD/osi_vfsops.c create mode 100644 src/afs/OBSD/osi_vm.c create mode 100644 src/afs/OBSD/osi_vnodeops.c create mode 100644 src/afs/libafsdep create mode 100644 src/afs/unified_afs.et create mode 100644 src/afs/unified_afs.p.h create mode 100644 src/afsd/afs.rc.obsd create mode 100644 src/cf/aix-cc.m4 create mode 100644 src/cf/function-macro.m4 create mode 100644 src/cf/irix-test.m4 create mode 100644 src/cf/osconf.m4 create mode 100644 src/cf/solaris-cc.m4 delete mode 100644 src/config/Makefile.alpha_dux40.in delete mode 100644 src/config/Makefile.alpha_dux50.in delete mode 100644 src/config/Makefile.alpha_dux51.in delete mode 100644 src/config/Makefile.alpha_linux_22.in delete mode 100644 src/config/Makefile.alpha_linux_24.in delete mode 100644 src/config/Makefile.amd64_linux24.in create mode 100644 src/config/Makefile.config.in delete mode 100644 src/config/Makefile.hp_ux102.in delete mode 100644 src/config/Makefile.hp_ux110.in delete mode 100644 src/config/Makefile.hp_ux11i.in delete mode 100644 src/config/Makefile.i386_fbsd_42.in delete mode 100644 src/config/Makefile.i386_fbsd_43.in delete mode 100644 src/config/Makefile.i386_fbsd_44.in delete mode 100644 src/config/Makefile.i386_fbsd_45.in delete mode 100644 src/config/Makefile.i386_fbsd_46.in delete mode 100644 src/config/Makefile.i386_linux22.in delete mode 100644 src/config/Makefile.i386_linux24.in delete mode 100644 src/config/Makefile.i386_obsd29.in delete mode 100644 src/config/Makefile.i386_umlinux22.in delete mode 100644 src/config/Makefile.i386_umlinux24.in delete mode 100644 src/config/Makefile.ia64_hpux1122.in delete mode 100644 src/config/Makefile.ia64_linux24.in delete mode 100644 src/config/Makefile.parisc_linux24.in delete mode 100644 src/config/Makefile.ppc_darwin_12.in delete mode 100644 src/config/Makefile.ppc_darwin_13.in delete mode 100644 src/config/Makefile.ppc_darwin_14.in delete mode 100644 src/config/Makefile.ppc_darwin_60.in delete mode 100644 src/config/Makefile.ppc_darwin_70.in delete mode 100644 src/config/Makefile.ppc_linux22.in delete mode 100644 src/config/Makefile.ppc_linux24.in delete mode 100644 src/config/Makefile.rs_aix42.in delete mode 100644 src/config/Makefile.s390_linux22.in delete mode 100644 src/config/Makefile.s390_linux24.in delete mode 100644 src/config/Makefile.sgi_62.in delete mode 100644 src/config/Makefile.sgi_63.in delete mode 100644 src/config/Makefile.sgi_64.in delete mode 100644 src/config/Makefile.sgi_65.in delete mode 100644 src/config/Makefile.sparc64_linux22.in delete mode 100644 src/config/Makefile.sparc64_linux24.in delete mode 100644 src/config/Makefile.sparc_linux22.in delete mode 100644 src/config/Makefile.sparc_linux24.in delete mode 100644 src/config/Makefile.sun4_413.in delete mode 100644 src/config/Makefile.sun4x_55.in delete mode 100644 src/config/Makefile.sun4x_56.in delete mode 100644 src/config/Makefile.sun4x_57.in delete mode 100644 src/config/Makefile.sun4x_58.in delete mode 100644 src/config/Makefile.sun4x_59.in delete mode 100644 src/config/Makefile.sunx86_54.in delete mode 100644 src/config/Makefile.sunx86_57.in delete mode 100644 src/config/Makefile.sunx86_58.in delete mode 100644 src/config/Makefile.sunx86_59.in create mode 100644 src/config/afsconfig.h.in create mode 100644 src/config/libafsdep create mode 100644 src/config/make_libafs_tree.pl create mode 100644 src/config/param.alpha_nbsd15.h create mode 100644 src/config/param.alpha_nbsd15_usr.h create mode 100644 src/config/param.alpha_nbsd16.h create mode 100644 src/config/param.alpha_nbsd16_usr.h delete mode 100644 src/config/param.hp_ux11i_usr.h create mode 100644 src/config/param.i386_fbsd_47.h create mode 100644 src/config/param.i386_fbsd_47_usr.h create mode 100644 src/config/param.i386_fbsd_50.h create mode 100644 src/config/param.i386_fbsd_51.h create mode 100644 src/config/param.i386_fbsd_52.h create mode 100644 src/config/param.i386_linux26.h create mode 100644 src/config/param.i386_nbsd15.h create mode 100644 src/config/param.i386_nbsd15_usr.h create mode 100644 src/config/param.i386_nbsd16.h create mode 100644 src/config/param.i386_nbsd16_usr.h create mode 100644 src/config/param.i386_nbsd20.h create mode 100644 src/config/param.i386_obsd31.h create mode 100644 src/config/param.i386_obsd31_usr.h create mode 100644 src/config/param.i386_obsd32.h create mode 100644 src/config/param.i386_obsd33.h create mode 100644 src/config/param.i386_obsd34.h create mode 100644 src/config/param.i386_obsd35.h create mode 100644 src/config/param.ia64_hpux1123.h rename src/config/{param.ia64_hpux1122_usr.h => param.ia64_hpux1123_usr.h} (96%) rename src/config/{param.i386_obsd29.h => param.nbsd15.h} (63%) create mode 100644 src/config/param.nbsd16.h create mode 100644 src/config/param.nbsd20.h rename src/config/{param.amd64_linux24_usr.h => param.ppc64_linux24.h} (55%) delete mode 100644 src/config/param.ppc_darwin_70_usr.h rename src/config/{param.i386_obsd29_usr.h => param.ppc_nbsd16.h} (54%) create mode 100644 src/config/param.ppc_nbsd20.h create mode 100644 src/config/param.rs_aix51.h create mode 100644 src/config/param.rs_aix51_usr.h create mode 100644 src/config/param.rs_aix52.h delete mode 100644 src/config/param.sunx86_59.h delete mode 100644 src/config/param.sunx86_59_usr.h create mode 100644 src/des/conf-alpha-bsd.h create mode 100644 src/des/conf-ppc64-linux.h create mode 100644 src/des/des_prototypes.h rename src/export/{export.exp => export4-64.exp} (100%) create mode 100644 src/export/export4.exp create mode 100644 src/export/export5-64.exp create mode 100644 src/export/export5.exp create mode 100644 src/helper-splint.sh.in create mode 100644 src/kauth/ka_util.c delete mode 100644 src/libafs/Makefile.common create mode 100644 src/libafs/Makefile.common.in create mode 100644 src/libafs/MakefileProto.NBSD.in create mode 100644 src/libafs/libafsdep create mode 100644 src/libafsdep delete mode 100644 src/libuafs/Makefile.common create mode 100644 src/libuafs/Makefile.common.in create mode 100644 src/libuafs/MakefileProto.NBSD.in create mode 100644 src/libuafs/MakefileProto.OBSD.in create mode 100644 src/libuafs/README create mode 100644 src/lwp/lwp_elf.h create mode 100644 src/lwp/process.i386.s create mode 100644 src/package/tags create mode 100644 src/packaging/Debian/ConfigUtils.pm create mode 100644 src/packaging/Debian/README.Debian create mode 100644 src/packaging/Debian/README.modules create mode 100644 src/packaging/Debian/README.servers create mode 100644 src/packaging/Debian/TODO create mode 100644 src/packaging/Debian/afs-newcell create mode 100644 src/packaging/Debian/afs-rootvol create mode 100644 src/packaging/Debian/changelog create mode 100644 src/packaging/Debian/configuration-transcript.txt create mode 100644 src/packaging/Debian/control create mode 100644 src/packaging/Debian/control.module create mode 100644 src/packaging/Debian/control.module-image create mode 100644 src/packaging/Debian/copyright create mode 100644 src/packaging/Debian/filelist create mode 100644 src/packaging/Debian/genchanges.sh create mode 100644 src/packaging/Debian/kern-sysname create mode 100644 src/packaging/Debian/make-links create mode 100644 src/packaging/Debian/movefiles create mode 100644 src/packaging/Debian/openafs-client.conffiles create mode 100644 src/packaging/Debian/openafs-client.config create mode 100644 src/packaging/Debian/openafs-client.dirs create mode 100644 src/packaging/Debian/openafs-client.docs create mode 100644 src/packaging/Debian/openafs-client.lintian create mode 100644 src/packaging/Debian/openafs-client.postinst create mode 100644 src/packaging/Debian/openafs-client.postrm create mode 100644 src/packaging/Debian/openafs-client.prerm create mode 100644 src/packaging/Debian/openafs-client.templates create mode 100644 src/packaging/Debian/openafs-client.undocumented create mode 100644 src/packaging/Debian/openafs-dbserver.dirs create mode 100644 src/packaging/Debian/openafs-fileserver.conffiles create mode 100644 src/packaging/Debian/openafs-fileserver.config create mode 100644 src/packaging/Debian/openafs-fileserver.dirs create mode 100644 src/packaging/Debian/openafs-fileserver.init create mode 100644 src/packaging/Debian/openafs-fileserver.lintian create mode 100644 src/packaging/Debian/openafs-fileserver.postinst create mode 100644 src/packaging/Debian/openafs-fileserver.postrm create mode 100644 src/packaging/Debian/openafs-fileserver.preinst create mode 100644 src/packaging/Debian/openafs-fileserver.templates create mode 100644 src/packaging/Debian/openafs-fileserver.undocumented create mode 100644 src/packaging/Debian/openafs-kpasswd.dirs create mode 100644 src/packaging/Debian/openafs-kpasswd.undocumented create mode 100644 src/packaging/Debian/openafs-modules-source.docs create mode 100644 src/packaging/Debian/patch.001_libafs_destination_name create mode 100644 src/packaging/Debian/patch.002_sketchy_hpux_process_c create mode 100644 src/packaging/Debian/patch.004_bozo_permissions create mode 100644 src/packaging/Debian/patch.006_more_bozo_permissions create mode 100644 src/packaging/Debian/postinst.mod create mode 100644 src/packaging/Debian/prep-modules create mode 100644 src/packaging/Debian/prerm.mod create mode 100644 src/packaging/Debian/pt_util.sgml create mode 100644 src/packaging/Debian/rules create mode 100644 src/packaging/Debian/sysname create mode 100644 src/packaging/FreeBSD/buildpkg.sh create mode 100644 src/packaging/FreeBSD/desc create mode 100644 src/packaging/FreeBSD/packinglist create mode 100644 src/packaging/FreeBSD/postinstall delete mode 100644 src/packaging/HP-UX/README create mode 100644 src/packaging/OpenBSD/buildpkg.sh create mode 100644 src/packaging/OpenBSD/desc create mode 100644 src/packaging/OpenBSD/packinglist create mode 100644 src/packaging/OpenBSD/postinstall create mode 100644 src/packaging/RedHat/afsmodname create mode 100644 src/packaging/RedHat/openafs-1.2.6-rc.patch create mode 100644 src/packaging/RedHat/openafs-1.2.6.spec create mode 100644 src/packaging/RedHat/openafs-README create mode 100644 src/packaging/RedHat/openafs-SuidCells create mode 100644 src/packaging/RedHat/openafs-ThisCell create mode 100644 src/packaging/RedHat/openafs-cacheinfo create mode 100644 src/ptserver/map.c create mode 100644 src/ptserver/map.h create mode 100644 src/rx/AIX/rx_kmutex.c create mode 100644 src/rx/DARWIN/rx_kmutex.c create mode 100644 src/rx/DUX/rx_kmutex.c create mode 100644 src/rx/FBSD/rx_kmutex.c create mode 100644 src/rx/HPUX/rx_kmutex.c create mode 100644 src/rx/IRIX/rx_kmutex.c create mode 100644 src/rx/LINUX/rx_kmutex.c create mode 100644 src/rx/NBSD/rx_kmutex.c create mode 100644 src/rx/NBSD/rx_kmutex.h create mode 100644 src/rx/NBSD/rx_knet.c create mode 100644 src/rx/OBSD/rx_kmutex.c create mode 100644 src/rx/OBSD/rx_kmutex.h create mode 100644 src/rx/OBSD/rx_knet.c create mode 100644 src/rx/SOLARIS/rx_kmutex.c create mode 100644 src/rx/UKERNEL/rx_kmutex.c create mode 100644 src/rx/libafsdep create mode 100644 src/rx/rx_prototypes.h create mode 100644 src/rx/xdr_int32.c create mode 100644 src/rx/xdr_prototypes.h create mode 100644 src/rxkad/hash.h create mode 100644 src/rxkad/libafsdep create mode 100644 src/rxkad/md4.c create mode 100644 src/rxkad/md4.h create mode 100644 src/rxkad/md5.c create mode 100644 src/rxkad/md5.h create mode 100644 src/rxkad/rxkad_prototypes.h create mode 100644 src/shlibafsauthent/.cvsignore create mode 100644 src/shlibafsrpc/.cvsignore create mode 100644 src/splint.cfg rename src/sys/{afs.exp => afs4.exp} (97%) create mode 100644 src/sys/afs5.exp rename src/sys/{afsl.exp => afsl4.exp} (100%) create mode 100644 src/sys/afsl5.exp create mode 100644 src/tests/.cvsignore delete mode 100644 src/tests/KeyFile create mode 100644 src/tests/KeyFile.uu create mode 100644 src/tests/OpenAFS/.cvsignore delete mode 100644 src/tests/kaserver.DB0 create mode 100644 src/tests/kaserver.DB0.uu delete mode 100644 src/tests/kaserver.DBSYS1 create mode 100644 src/tests/kaserver.DBSYS1.uu create mode 100644 src/tvolser/Makefile.in rename src/uss/{lex.c => lex.l} (97%) create mode 100644 src/util/afsutil_prototypes.h create mode 100644 src/util/strlcat.c create mode 100644 src/util/strlcpy.c delete mode 100644 src/venus/lock.h create mode 100644 src/viced/viced_prototypes.h create mode 100644 src/volser/vol-dump.c create mode 100644 src/volser/volser_prototypes.h diff --git a/.cvsignore b/.cvsignore index 4f075370c..36ed4a61e 100644 --- a/.cvsignore +++ b/.cvsignore @@ -13,7 +13,10 @@ i386_umlinux22 i386_umlinux24 include lib +parisc_linux24 sgi_65 sun4x_56 sun4x_57 autom4te.cache +ID +TAGS diff --git a/.splintrc b/.splintrc new file mode 100644 index 000000000..1c9195ef2 --- /dev/null +++ b/.splintrc @@ -0,0 +1,12 @@ +-badflag +-weak ++unix-lib ++char-index ++relax-quals +-pred-bool-int +-pred-bool-ptr ++ptr-negate +-fixed-formal-array ++match-any-integral ++ignore-equals +-name-checks diff --git a/Makefile-libafs.in b/Makefile-libafs.in new file mode 100644 index 000000000..64f78845b --- /dev/null +++ b/Makefile-libafs.in @@ -0,0 +1,9 @@ +# Copyright 2000, International Business Machines Corporation and others. +# All Rights Reserved. +# +# This software has been released under the terms of the IBM Public +# License. For details, see the LICENSE file in the top-level source +# directory or online at http://www.openafs.org/dl/license10.html + +all: + cd src && cd libafs && $(MAKE) diff --git a/Makefile.in b/Makefile.in index bea42a37c..46b5a5f91 100644 --- a/Makefile.in +++ b/Makefile.in @@ -7,35 +7,8 @@ # # Portions Copyright (c) 2003 Apple Computer, Inc. -SHELL=/bin/sh -DEST=@DEST@ -TOP_SRCDIR=@TOP_SRCDIR@ -TOP_INCDIR=@TOP_INCDIR@ -TOP_LIBDIR=@TOP_LIBDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -libdir=@libdir@ -includedir=@includedir@ -mandir=@mandir@ -afskerneldir=@afskerneldir@ -afssrvbindir=@afssrvbindir@ -afssrvsbindir=@afssrvsbindir@ -afssrvlibexecdir=@afssrvlibexecdir@ - -# Systype-generic items -SYS_NAME=@AFS_SYSNAME@ -MKAFS_OSTYPE=@MKAFS_OSTYPE@ - -# Systype-specific items -LINUX_KERNEL_PATH=@LINUX_KERNEL_PATH@ -LINUX_VERSION=@LINUX_VERSION@ -DARWIN_INFOFILE=@DARWIN_INFOFILE@ - -# Other items -LIB_AFSDB=@LIB_AFSDB@ +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config # Enable build+install of obsolete and insecure packages # Set to anything other than YES, or comment out to disable the build @@ -44,8 +17,6 @@ WITH_INSECURE=@WITH_INSECURE@ ENABLE_KERNEL_MODULE=@ENABLE_KERNEL_MODULE@ -include src/config/Makefile.${SYS_NAME} - # To compile AFS from scratch in the src tree run "make". # This recursively calls "make install ..." and does not depend on the # existence of any non-standard programs. @@ -53,11 +24,12 @@ include src/config/Makefile.${SYS_NAME} # rxgen, compile_et and others already exist and runs it with # "-argument kinstall". -COMPILE_PART1 = cd src; cd -COMPILE_PART2A = ; $(MAKE) +COMPILE_PART1 = cd src && cd +COMPILE_PART2A = && $(MAKE) COMPILE_PART2B = all COMPILE_PART2 = ${COMPILE_PART2A} ${COMPILE_PART2B} COMPILE_CLEAN = ${COMPILE_PART2A} clean +COMPILE_DEPINSTALL = ${COMPILE_PART2A} depinstall all: force ${TOP_INCDIR} ${TOP_INCDIR}/afs ${TOP_LIBDIR} $(MAKE) build @@ -99,11 +71,13 @@ packages: dest ${COMPILE_PART1} packaging/HP-UX && swpackage -s psf-1.2.10-transarc-paths-11.11 ;; \ ia64_hpux1122 ) \ ${COMPILE_PART1} packaging/HP-UX && swpackage -s psf-1.2.10-transarc-paths-11.22 ;; \ + ia64_hpux1123 ) \ + ${COMPILE_PART1} packaging/HP-UX && swpackage -s psf-1.2.10-transarc-paths-11.23 ;; \ *) \ echo Not building packages for ${SYS_NAME} ;; \ esac -${TOP_INCDIR} ${TOP_INCDIR}/afs ${TOP_LIBDIR}: +${TOP_INCDIR} ${TOP_INCDIR}/afs ${TOP_LIBDIR} ${TOP_JLIBDIR}: mkdir -p $@ install_dirs: force @@ -139,103 +113,89 @@ config: pinstall: config ${COMPILE_PART1} pinstall ${COMPILE_PART2} -procmgmt: config pinstall +procmgmt: pinstall ${COMPILE_PART1} procmgmt ${COMPILE_PART2} -util: pinstall procmgmt +util: procmgmt ${COMPILE_PART1} util ${COMPILE_PART2} -audit: pinstall rx rxkad fsint - ${COMPILE_PART1} audit ${COMPILE_PART2} +audit: util rx rxkad + ${COMPILE_PART1} audit ${COMPILE_PART2} #TODO comerr: util ${COMPILE_PART1} comerr ${COMPILE_PART2} cmd: comerr @case ${SYS_NAME} in \ - sgi_6* | sun4x_5[789] | hp_ux11* | ia64_hpux* | sparc64_linux* | alpha_linux* ) \ + sgi_6* | sun*_5[789] | hp_ux11* | ia64_hpux* | sparc64_linux* | alpha_linux* ) \ ${COMPILE_PART1} cmd ${COMPILE_PART2}64 ;; \ *) \ ${COMPILE_PART1} cmd ${COMPILE_PART2} ;; \ esac -lwp: project util +lwp: util lwp_depinstall ${COMPILE_PART1} lwp ${COMPILE_PART2} -rxgen: pinstall +rxgen: pinstall ${COMPILE_PART1} rxgen ${COMPILE_PART2} -rxobj: - -kernrx: - ${COMPILE_PART1} rx ${COMPILE_PART2} - -rx: project lwp rxgen +rx: pinstall lwp rxgen rx_depinstall ${COMPILE_PART1} rx ${COMPILE_PART2} -rxstat: rx +rxstat: rx rxstat_depinstall ${COMPILE_PART1} rxstat ${COMPILE_PART2} -rxincls: rxobj - ${COMPILE_PART1} rx ${COMPILE_PART2} - rxtests: rxdebug -rxdebug: rx +rxdebug: rx sys ${COMPILE_PART1} rxdebug ${COMPILE_PART2} -fsint: project kfsint - -kfsint: lwp rxgen rxincls +fsint: cmd comerr rxgen rx lwp fsint_depinstall ${COMPILE_PART1} fsint ${COMPILE_PART2} -export2: project fsint +export2: project -export: fsint +export: @case ${SYS_NAME} in \ - rs_aix*) \ - ${COMPILE_PART1} export ${COMPILE_PART2} ;; \ - * ) echo skipping export for ${SYS_NAME} ;; \ + rs_aix*) \ + ${MAKE} export_build ; \ esac -afs: export +export_build: fsint + ${COMPILE_PART1} export ${COMPILE_PART2} + +afs: export pinstall comerr afs_depinstall ${COMPILE_PART1} afs ${COMPILE_PART2} -des: config +des: config pinstall ${COMPILE_PART1} des ${COMPILE_PART2} -sys: project des rx rxstat fsint +sys: cmd comerr afs des rx rxstat fsint ${COMPILE_PART1} sys ${COMPILE_PART2} -rxkad: project des +rxkad: cmd comerr sys des rx rxkad_depinstall ${COMPILE_PART1} rxkad ${COMPILE_PART2} -kernauth: +auth: cmd comerr comerr des lwp rx sys rxkad audit auth_depinstall ${COMPILE_PART1} auth ${COMPILE_PART2} -auth: project comerr des lwp rx sys rxkad audit - ${COMPILE_PART1} auth ${COMPILE_PART2} - -ubik: project auth +ubik: cmd comerr auth ubik_depinstall ${COMPILE_PART1} ubik ${COMPILE_PART2} ubiktests: ubik -ptserver: project ubik cmd comerr auth audit +ptserver: cmd comerr ubik cmd comerr auth audit ptserver_depinstall ${COMPILE_PART1} ptserver ${COMPILE_PART2} -kauth: project ubik cmd auth comerr ptserver audit libacl +kauth: cmd comerr ubik cmd auth comerr ptserver audit libacl kauth_depinstall ${COMPILE_PART1} kauth ${COMPILE_PART2} -dauth: project ubik cmd auth comerr +dauth: cmd comerr ubik cmd auth kauth comerr ${COMPILE_PART1} dauth ${COMPILE_PART2} -libacl: project ptserver +libacl: cmd comerr ptserver libacl_depinstall ${COMPILE_PART1} libacl ${COMPILE_PART2} -kerndir: - ${COMPILE_PART1} dir ${COMPILE_PART2} - -dir: project libacl +dir: cmd comerr libacl dir_depinstall ${COMPILE_PART1} dir ${COMPILE_PART2} # Removed from sgi_* case below: @@ -248,19 +208,19 @@ sgiefs: echo No efs stuff for ${SYS_NAME};; \ esac -vol: project dir afs sgiefs +vol: cmd comerr dir afs sgiefs ${COMPILE_PART1} vol ${COMPILE_PART2} -vlserver: project vol audit +vlserver: cmd comerr vol audit vlserver_depinstall ${COMPILE_PART1} vlserver ${COMPILE_PART2} -viced: project vlserver audit - ${COMPILE_PART1} viced ${COMPILE_PART2} +viced: cmd comerr vlserver audit + ${COMPILE_PART1} viced ${COMPILE_PART2} -tviced: project viced vlserver libafsrpc libafsauthent +tviced: cmd comerr viced vlserver libafsrpc libafsauthent case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ - ${COMPILE_PART1} tviced ${COMPILE_PART2} ;; \ + alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*fbsd*|*nbsd2*) \ + ${COMPILE_PART1} tviced ${COMPILE_PART2} ;; \ *_darwin_[1-6][0-9]) \ echo Not building MT viced for ${SYS_NAME} ;; \ *_darwin_*) \ @@ -269,146 +229,189 @@ tviced: project viced vlserver libafsrpc libafsauthent echo Not building MT viced for ${SYS_NAME} ;; \ esac -volser: project tviced usd kauth audit +volser: cmd comerr tviced usd kauth audit ${COMPILE_PART1} volser ${COMPILE_PART2} -venus: project volser ptserver +tvolser: project tviced usd libafsrpc libafsauthent + case ${SYS_NAME} in \ + alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ + ${COMPILE_PART1} tvolser ${COMPILE_PART2} ;; \ + *_darwin_[1-6][0-9]) \ + echo Not building MT volser for ${SYS_NAME} ;; \ + *_darwin_*) \ + ${COMPILE_PART1} tvolser ${COMPILE_PART2} ;; \ + *) \ + echo Not building MT volser for ${SYS_NAME} ;; \ + esac + +venus: cmd comerr volser ptserver ${COMPILE_PART1} venus ${COMPILE_PART2} ${COMPILE_PART1} venus/test ${COMPILE_PART2} -afsd: project sys kauth +afsd: cmd comerr sys kauth ${COMPILE_PART1} afsd ${COMPILE_PART2} -null: project +null: cmd comerr ${COMPILE_PART1} null ${COMPILE_PART2} -gtx: project null auth # kauth rxkad ? +${TOP_LIBDIR}/libtermlib.a: + $(RM) -f ${TOP_LIBDIR}/libtermlib.a case ${SYS_NAME} in \ - rs_aix* | sun*_5? | sgi_6? | *linux* | *_darwin_* | *fbsd* | ia64_hpux*) \ - $(RM) -f ${TOP_LIBDIR}/libtermlib.a; \ - ln -s libnull.a ${TOP_LIBDIR}/libtermlib.a; \ - ${COMPILE_PART1} gtx ${COMPILE_PART2};; \ - *) \ - $(RM) -f ${TOP_LIBDIR}/libtermlib.a; \ - ln -s /usr/lib/libtermlib.a ${TOP_LIBDIR}/libtermlib.a; \ - ${COMPILE_PART1} gtx ${COMPILE_PART2};; \ + rs_aix* | sun4x_* | sunx86_* | sgi_6? | *linux* | *_darwin* | *fbsd* | ia64_hpux*) \ + ln -s libnull.a ${TOP_LIBDIR}/libtermlib.a ;; \ + *) \ + ln -s /usr/lib/libtermlib.a ${TOP_LIBDIR}/libtermlib.a ;; \ esac -fsprobe: project util fsint +gtx: cmd comerr null auth kauth ${TOP_LIBDIR}/libtermlib.a + ${COMPILE_PART1} gtx ${COMPILE_PART2} + +fsprobe: cmd comerr util fsint volser ${COMPILE_PART1} fsprobe ${COMPILE_PART2} -scout: project gtx fsprobe +scout: cmd comerr gtx fsprobe ${COMPILE_PART1} scout ${COMPILE_PART2} -uss: des kauth project rx vlserver vol +uss: des kauth cmd comerr rx vlserver vol volser ${COMPILE_PART1} uss ${COMPILE_PART2} -bozo: project ntp audit +bozo: cmd comerr ntp audit ${COMPILE_PART1} bozo ${COMPILE_PART2} - -# Removed from respective case statements below: -# ${COMPILE_PART1} vfsckaix42 ${COMPILE_PART2} ;; -# ${COMPILE_PART1} vfscksol25 ${COMPILE_PART2} ;; -# ${COMPILE_PART1} vfscksol26 ${COMPILE_PART2} ;; -# ${COMPILE_PART1} vfscksol27 ${COMPILE_PART2} ;; vfsck: vol set -x; \ case ${SYS_NAME} in \ - sgi_* | *linux* | rs_aix42 | *_darwin_* | hp_ux* | ia64_hpux* | *fbsd* | *_obsd* | sun*_4* ) \ + sgi_* | *linux* | rs_aix42 | *_darwin* | hp_ux* | ia64_hpux* | *fbsd* | *_obsd* | *_nbsd* | sun*_4* | rs_aix5* ) \ echo skip vfsck for ${SYS_NAME} ;; \ * ) \ ${COMPILE_PART1} vfsck ${COMPILE_PART2} ;; \ esac -login: project kauth rxkad +pam: cmd comerr kauth rxkad + set -x; \ + if test "@HAVE_PAM@" = "yes"; then \ + ${COMPILE_PART1} pam ${COMPILE_PART2} ; \ + else \ + echo Skipping pam for ${SYS_NAME} ; \ + fi + +tsm41: cmd comerr kauth rxkad set -x; \ case ${SYS_NAME} in \ - sgi_* ) \ - ${COMPILE_PART1} sgistuff ${COMPILE_PART2} ;; \ - rs_aix42 ) \ + rs_aix* ) \ ${COMPILE_PART1} tsm41 ${COMPILE_PART2} ;; \ + * ) \ + echo Skipping tsm41 for ${SYS_NAME} ;; \ + esac + +sia: cmd comerr kauth rxkad + set -x; \ + case ${SYS_NAME} in \ alpha_dux* ) \ ${COMPILE_PART1} sia ${COMPILE_PART2} ;; \ - sun4x_55 ) \ - ${COMPILE_PART1} login ${COMPILE_PART2} ;; \ - parisc_linux24) \ - echo Skipping pam/login for parisc_linux24 ;; \ - amd64_linux24) \ - echo Skipping pam/login for amd64_linux24 ;; \ - sun*_* | hp_ux11* | ia64_hpux* | *linux* | *fbsd* ) \ - if test "@HAVE_PAM@" = "yes"; then \ - ${COMPILE_PART1} pam ${COMPILE_PART2} ; \ - else \ - echo Skipping pam for ${SYS_NAME} ; \ - fi ;; \ - *_darwin_* | *_obsd* ) \ - echo Skipping login for ${SYS_NAME} ;; \ * ) \ - ${COMPILE_PART1} login ${COMPILE_PART2} ;; \ + echo Skipping sia for ${SYS_NAME} ;; \ esac -KERNELDIR= \ - afs \ - dir \ - rx \ - fsint \ - auth \ - rxkad \ - util \ - libacl \ - vlserver \ - sgiefs \ - rxstat +sgistuff: cmd comerr kauth rxkad + set -x; \ + case ${SYS_NAME} in \ + sgi_* ) \ + ${COMPILE_PART1} sgistuff ${COMPILE_PART2} ;; \ + * ) \ + echo Skipping sgistuff for ${SYS_NAME} ;; \ + esac +login: cmd comerr kauth rxkad pam sia tsm41 sgistuff + set -x; \ + if test "@BUILD_LOGIN@" = "yes"; then \ + ${COMPILE_PART1} login ${COMPILE_PART2} ; \ + else \ + echo Skipping login for ${SYS_NAME} ; \ + fi -UKERNELDIR= \ - afs \ - dir \ - rx \ - fsint \ - util \ - auth \ - rxkad \ - vlserver \ - kauth \ - des \ - afsweb \ - rxstat +# +# _depinstall targets - only build and install headers/sources that are needed by libafs/libuafs +# +# encode dependencies within the _depinstall targets as required +# +lwp_depinstall: pinstall + ${COMPILE_PART1} lwp ${COMPILE_DEPINSTALL} + +rx_depinstall: pinstall + ${COMPILE_PART1} rx ${COMPILE_DEPINSTALL} + +rxkad_depinstall: pinstall comerr + ${COMPILE_PART1} rxkad ${COMPILE_DEPINSTALL} + +ubik_depinstall: pinstall comerr rxgen + ${COMPILE_PART1} ubik ${COMPILE_DEPINSTALL} +vlserver_depinstall: pinstall rxgen ubik_depinstall auth_depinstall + ${COMPILE_PART1} vlserver ${COMPILE_DEPINSTALL} -libafs: libafs_setup ${KERNELDIR} +auth_depinstall: pinstall comerr + ${COMPILE_PART1} auth ${COMPILE_DEPINSTALL} + +fsint_depinstall: pinstall rxgen + ${COMPILE_PART1} fsint ${COMPILE_DEPINSTALL} + +rxstat_depinstall: pinstall rxgen + ${COMPILE_PART1} rxstat ${COMPILE_DEPINSTALL} + +libacl_depinstall: pinstall + ${COMPILE_PART1} libacl ${COMPILE_DEPINSTALL} + +afs_depinstall: pinstall comerr + ${COMPILE_PART1} afs ${COMPILE_DEPINSTALL} + +dir_depinstall: pinstall + ${COMPILE_PART1} dir ${COMPILE_DEPINSTALL} + +kauth_depinstall: pinstall rxgen comerr + ${COMPILE_PART1} kauth ${COMPILE_DEPINSTALL} + +ptserver_depinstall: pinstall rxgen comerr + ${COMPILE_PART1} ptserver ${COMPILE_DEPINSTALL} + + +# +# libafs build targets +# +libafs_setup: config export + src/config/config src/libafs/MakefileProto.${MKAFS_OSTYPE} src/libafs/Makefile ${SYS_NAME} + +libafs: libafs_setup lwp_depinstall rx_depinstall vlserver_depinstall rxkad_depinstall fsint_depinstall \ + libacl_depinstall afs_depinstall dir_depinstall rxstat_depinstall ${COMPILE_PART1} libafs ${COMPILE_PART2} -libafs_tree: libafs_setup ${KERNELDIR} - -/bin/rm -rf libafs_tree - for d in afs afsint rx config; do \ - [ -d libafs_tree/$$d ] || mkdir -p libafs_tree/$$d; \ - done - for f in `cd src/libafs; find . -name '*.[ch]'` \ - Makefile.common Makefile.extradefs ${DARWIN_INFOFILE} \ - afs.shutdown afs.startup redhat.sh sgi_master sgi_system \ - ; do \ - ${INSTALL} -c -f src/libafs/$$f libafs_tree/$$f; \ - done - for f in config.guess config.sub install-sh missing mkinstalldirs \ - ; do \ - ${INSTALL} -c -f $$f libafs_tree/$$f; \ - done - src/config/config src/libafs/MakefileProto.${MKAFS_OSTYPE}.in libafs_tree/Makefile.in ${SYS_NAME} - ${INSTALL} -c src/config/Makefile.${SYS_NAME}.in libafs_tree/config - ${INSTALL} -c src/config/afsconfig.h.in libafs_tree/config - ${INSTALL} -c -f -ns configure-libafs libafs_tree/configure - case ${SYS_NAME} in \ - *linux*) \ - ${INSTALL} -c src/config/make_vnode.pl libafs_tree/config ; \ - ${INSTALL} -c src/afs/LINUX/osi_vfs.hin libafs_tree/afs ;; \ - esac +libafs_tree: libafs_setup lwp_depinstall rx_depinstall vlserver_depinstall rxkad_depinstall fsint_depinstall \ + libacl_depinstall afs_depinstall dir_depinstall rxstat_depinstall + ${TOP_SRCDIR}/config/make_libafs_tree.pl \ + -sn $(SYS_NAME) \ + -os $(MKAFS_OSTYPE) \ + -t @TOP_OBJDIR@/libafs_tree \ + -o @TOP_OBJDIR@ \ + -p @srcdir@ + +# +# libuafs build targets +# + +UKERNELDIR= \ + des \ + afsweb + +libuafs_setup: config export + src/config/config src/libuafs/MakefileProto.${MKAFS_OSTYPE} src/libuafs/Makefile ${SYS_NAME} -libuafs: libuafs_setup ${UKERNELDIR} +libuafs: libuafs_setup vlserver_depinstall rx_depinstall fsint_depinstall \ + auth_depinstall dir_depinstall libacl_depinstall rxkad_depinstall \ + ubik_depinstall afs_depinstall kauth_depinstall ptserver_depinstall \ + rxstat_depinstall lwp_depinstall des set -x; \ case ${SYS_NAME} in \ - hp_ux102* | *_obsd* | sun*_4* ) \ + hp_ux102* | *_obsd* | sun*_4* | *_nbsd*| hp_ux11i | ia64_hpux112*) \ echo Skipping libuafs for ${SYS_NAME} ;; \ * ) \ ${COMPILE_PART1} libuafs ${COMPILE_PART2} ;; \ @@ -417,45 +420,45 @@ libuafs: libuafs_setup ${UKERNELDIR} afsweb: kauth dauth ${COMPILE_PART1} afsweb ${COMPILE_PART2} -update: project auth +update: cmd comerr auth ${COMPILE_PART1} update ${COMPILE_PART2} -log: project auth +log: cmd comerr auth ${COMPILE_PART1} log ${COMPILE_PART2} -bu_utils: project +bu_utils: cmd comerr usd ${COMPILE_PART1} bu_utils ${COMPILE_PART2} -usd: project +usd: cmd comerr ${COMPILE_PART1} usd ${COMPILE_PART2} -bubasics: project comerr +bubasics: cmd comerr comerr rx ${COMPILE_PART1} bubasics ${COMPILE_PART2} -butm: project bubasics usd +butm: cmd comerr bubasics usd uss ${COMPILE_PART1} butm ${COMPILE_PART2} -butc: project bubasics butm budb bucoord cmd +butc: cmd comerr bubasics butm budb bucoord cmd rxgen rx ${COMPILE_PART1} butc ${COMPILE_PART2} -tbutc: project bubasics butm budb bucoord cmd butc +tbutc: cmd comerr bubasics butm budb bucoord cmd butc case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*_*|rs_aix4*|*linux*|hp_ux11*|ia64_hpux*) \ + alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix4*|*linux*|hp_ux11*|ia64_hpux*) \ ${COMPILE_PART1} tbutc ${COMPILE_PART2} ;; \ *) \ echo Not building MT butc for ${SYS_NAME} ;; \ esac -budb: project bubasics +budb: cmd comerr bubasics uss ${COMPILE_PART1} budb ${COMPILE_PART2} -bucoord: project bubasics budb volser +bucoord: cmd comerr bubasics budb volser ${COMPILE_PART1} bucoord ${COMPILE_PART2} -xstat: project +xstat: cmd comerr fsint viced ${COMPILE_PART1} xstat ${COMPILE_PART2} -afsmonitor: project gtx xstat +afsmonitor: cmd comerr gtx xstat ${COMPILE_PART1} afsmonitor ${COMPILE_PART2} tests: rxtests ubiktests @@ -463,33 +466,34 @@ tests: rxtests ubiktests # pthread based user space RX library libafsrpc: rx rxkad des case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*fbsd*) \ - ${COMPILE_PART1} libafsrpc ${COMPILE_PART2} ;; \ + alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*fbsd*|*nbsd2*) \ + ${COMPILE_PART1} libafsrpc ${COMPILE_PART2} ;; \ *_darwin_[1-6][0-9]) \ echo Not building MT libafsrpc for ${SYS_NAME} ;; \ *_darwin_*) \ - ${COMPILE_PART1} libafsrpc ${COMPILE_PART2} ;; \ + ${COMPILE_PART1} libafsrpc ${COMPILE_PART2} ;; \ *) \ echo Not building MT libafsrpc for ${SYS_NAME} ;; \ esac libafsauthent: ubik auth kauth libafsrpc case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*fbsd*) \ - ${COMPILE_PART1} libafsauthent ${COMPILE_PART2} ;; \ + alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*fbsd*|*nbsd2*) \ + ${COMPILE_PART1} libafsauthent ${COMPILE_PART2} ;; \ *_darwin_[1-6][0-9]) \ echo Not building MT libafsauthent for ${SYS_NAME} ;; \ *_darwin_*) \ - ${COMPILE_PART1} libafsauthent ${COMPILE_PART2} ;; \ + ${COMPILE_PART1} libafsauthent ${COMPILE_PART2} ;; \ *) \ echo Not building MT libafsauthent for ${SYS_NAME} ;; \ esac +# pthread based user space RX library shlibafsrpc: rx rxkad des case ${SYS_NAME} in \ amd64_linux24) \ - echo Skipping shlibafsprc for amd64_linux24 ;; \ - alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ + echo Skipping shlibafsrpc for amd64_linux24 ;; \ + alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ ${COMPILE_PART1} shlibafsrpc ${COMPILE_PART2} ;; \ *) \ echo Not building shared libafsrpc for ${SYS_NAME} ;; \ @@ -499,7 +503,7 @@ shlibafsauthent: ubik auth kauth shlibafsrpc case ${SYS_NAME} in \ amd64_linux24) \ echo Skipping shlibafsauthent for amd64_linux24 ;; \ - alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ + alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ ${COMPILE_PART1} shlibafsauthent ${COMPILE_PART2} ;; \ *) \ echo Not building shared libafsauthent for ${SYS_NAME} ;; \ @@ -519,7 +523,7 @@ libadmin_real: libadmin: libafsauthent bozo case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ + alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*) \ $(MAKE) libadmin_real ;; \ *_darwin_[1-6][0-9]) \ echo Not building MT libadmin for ${SYS_NAME} ;; \ @@ -529,6 +533,20 @@ libadmin: libafsauthent bozo echo Not building MT libadmin for ${SYS_NAME} ;; \ esac +libjafs: libadmin + case ${SYS_NAME} in \ + alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \ + ${COMPILE_PART1} JAVA/libjafs ${COMPILE_PART2} ;; \ + *) \ + echo Not building MT libjafs for ${SYS_NAME} ;; \ + esac + +libjafsadm: libjafs + +jafs: libjafs + +jafsadm: libjafsadm + finale: project cmd comerr afsd allrcmds butc tbutc @ENABLE_KERNEL_MODULE@ libuafs audit kauth log package \ ptserver scout bu_utils ubik uss bozo vfsck volser \ venus update xstat afsmonitor dauth rxdebug libafsrpc \ @@ -543,12 +561,6 @@ finale_nolibafs: project cmd comerr afsd allrcmds butc tbutc libuafs audit kauth # Use washtool to ensure MakefileProto is current and obj/libafs exists. -libafs_setup: config export - src/config/config src/libafs/MakefileProto.${MKAFS_OSTYPE} src/libafs/Makefile ${SYS_NAME} - -libuafs_setup: config export - src/config/config src/libuafs/MakefileProto.${MKAFS_OSTYPE} src/libuafs/Makefile ${SYS_NAME} - force: TARGET=finale @@ -644,6 +656,7 @@ clean2: -${COMPILE_PART1} libadmin/cfg ${COMPILE_CLEAN} -${COMPILE_PART1} libadmin/test ${COMPILE_CLEAN} -${COMPILE_PART1} libadmin/samples ${COMPILE_CLEAN} + -${COMPILE_PART1} JAVA/libjafs ${COMPILE_CLEAN} -${COMPILE_PART1} finale ${COMPILE_CLEAN} -${COMPILE_PART1} mpp ${COMPILE_CLEAN} -${COMPILE_PART1} package ${COMPILE_CLEAN} @@ -657,11 +670,12 @@ clean2: -${COMPILE_PART1} libuafs ${COMPILE_CLEAN} -(cd src/libafs; /bin/rm -rf afs afsint config rx) -(cd src/libuafs; /bin/rm -rf afs afsint config rx des) - -/bin/rm -rf ${TOP_INCDIR} ${TOP_LIBDIR} + -/bin/rm -rf ${TOP_INCDIR} ${TOP_LIBDIR} ${TOP_JLIBDIR} -/bin/rm -rf libafs_tree ${SYS_NAME} distclean: clean + /bin/rm -rf lib include /bin/rm -f config.log config.cache config.status \ src/config/afsconfig.h \ Makefile \ @@ -688,7 +702,7 @@ distclean: clean src/config/Makefile \ src/config/Makefile.version \ src/config/Makefile.version-NOCML \ - src/config/Makefile.${SYS_NAME} \ + src/config/Makefile.config \ src/dauth/Makefile \ src/des/test/Makefile \ src/des/Makefile \ @@ -717,11 +731,14 @@ distclean: clean src/libadmin/samples/Makefile \ src/libadmin/test/Makefile \ src/libadmin/vos/Makefile \ + src/JAVA/libjafs/Makefile \ src/libafs/Makefile \ + src/libafs/Makefile.common \ src/libafs/MakefileProto.${MKAFS_OSTYPE} \ src/libafsauthent/Makefile \ src/libafsrpc/Makefile \ src/libuafs/Makefile \ + src/libuafs/Makefile.common \ src/libuafs/MakefileProto.${MKAFS_OSTYPE} \ src/log/test/Makefile \ src/log/Makefile \ @@ -785,6 +802,8 @@ distclean: clean pristine: distclean /bin/rm -f src/config/afsconfig.h.in configure configure-libafs aclocal.m4 +maintainer-clean: pristine + # # Below targets are all deprecated, insecure, or obsolte, # see README.OBSOLETE and README.INSECURE for more info @@ -811,7 +830,7 @@ package.files: package ntp: project volser @case ${WITH_OBSOLETE} in \ YES) case ${SYS_NAME} in \ - sun*_5[89] | *linux* | *fbsd* | *_darwin_* ) echo skipping ntp for ${SYS_NAME} ;; \ + sun4x_58 | sunx86_* | *linux* | *fbsd* | *_darwin* | *nbsd*) echo skipping ntp for ${SYS_NAME} ;; \ * ) ${COMPILE_PART1} ntp ${COMPILE_PART2} ;; \ esac ;; \ *) echo skipping deprecated target: ntp ;; \ @@ -860,3 +879,5 @@ rcp: project rsh inetd allrcmds: project rcp rlogind + + diff --git a/NEWS b/NEWS index cbcbc2670..6e741d603 100644 --- a/NEWS +++ b/NEWS @@ -1,32 +1,22 @@ -OpenAFS News -- history of user-visible changes. July 29, 2003. +OpenAFS News -- history of user-visible changes. April 10, 2003. -* Changes incorporated in OpenAFS 1.2.10 +* Changes incorporated in OpenAFS 1.3 -** dumps to and restores from large files now supported by butc. - -** Linux on AMD Opteron (sysname amd64_linux24), HP-UX 11i on PA-RISC - (sysname hp_ux11i), HP-UX 11.22 on Intel Itanium (sysname ia64_hpux1122), - and User Mode Linux i386 (sysnames i386_umlinux22, i386_umlinux24) now - supported. - -** Windows Largeint support (for VC7) - -** afsd will not shut itself down while /afs is mounted, to preclude panics. - -** On Linux 2.4, the AFS cache cannot be unmounted if afsd is not shut down. - This is consistent with the behavior of other platforms and of Linux 2.2, - but until now Linux 2.4 had not behaved this way. - -** Restore behavior pre-1.2.9 of adding cell aliases we find using AFSDB - for cells that have been statically configured via CellServDB. +** Mountpoint directory information is now only faked for cross-cell + mountpoits when using the -fakestat flag (e.g. for the directories + under /afs, but not for most other volumes mounted inside the cell). + The -fakestat-all switch can be used to fake information for all + mountpoints. -** MacOS X client fakes mode bits so host does not preclude user access to - data incorrectly. +** When fakestat is enabled on MacOSX, the Finder can be used to browse + a fully-populated /afs directory. However, this precludes reliable + use of entire volumes as MacOS bundles (i.e. containing a Contents + directory in the root of the volume). -** MacOS X client enables disk arbitration such that AFS shows up immediately - in Finder, and precludes afs unmount unless force is used, to prevent - Finder from "ejecting" it. AFS can also be mounted multiple times - on the MacOS X client. +** Mountpoint directory information can be faked by the cache manager, + making operations such as stat'ing all cells under /afs much faster. + This is enabled by passing -fakestat to afsd, but might not be stable + on all platforms. * Changes incorporated in OpenAFS 1.2.9 diff --git a/README b/README index 7ef295b2a..e9c6c370f 100644 --- a/README +++ b/README @@ -32,18 +32,21 @@ A. Creating the proper directory structure. alpha_dux40 alpha_dux50 (only tested on 5.0A, does not work with 5.1) - i386_fbsd42, i386_fbsd43, i386_fbsd44, i386_fbsd45, - i386_fbsd46 (gmake is required to build for FreeBSD) + i386_fbsd_42, i386_fbsd_43, i386_fbsd_44, i386_fbsd_45, + i386_fbsd_46, i386_fbsd_47, i386_fbsd_50, i386_fbsd_51, + i386_fbsd_52 i386_linux22 - i386_linux24 + i386_linux24 + i386_linux26 i386_umlinux22 - i386_umlinux24 + i386_umlinux24 + i386_obsd31, i386_obsd32, i386_obsd33, i386_obsd34 rs_aix42 sgi_65 (file server not tested) sun4_413 (No client support, no fileserver support, db servers only) sun4x_56, sun4x_57, sun4x_58, sun4x_59 (logging UFS not supported for mixed-use partitions containing client cache) - ppc_darwin_13, ppc_darwin_14, ppc_darwin_60 (file server not tested) + ppc_darwin_70 ppc_linux22 ppc_linux24 alpha_linux22 @@ -115,22 +118,12 @@ B Building e.g. sun4x_57/dest or i386_linux22/dest 2. As appropriate you can clean up or, if you're using Linux, build for - another kernel version: - a. To clean up: + another kernel version. + To clean up: % make clean - b. To build for another Linux kernel version: - the system type defined in step A1. - % ./configure --with-afs-sysname=i386_linux22 --with-linux-kernel-headers=/usr/src/linux-2.2.19-i686 - % make - - Your dest tree will now include an additional kernel module for your - additional kernel headers. Be aware that if the kernel version string - which UTS_RELEASE is defined to in include/linux/version.h matches - the last kernel you built for, the previous kernel module will be - overwritten. - C Problems + If you have a problem building this source, you may want to visit http://www.openafs.org/ to see if any problems have been reported or to find out how to get more help. @@ -138,7 +131,21 @@ C Problems Mailing lists have been set up to help; More details can be found on the openafs.org site. -D Notes +D Linux Notes + + To build for another Linux kernel version: + the system type defined in step A1. + % ./configure --with-afs-sysname=i386_linux22 --with-linux-kernel-headers=/usr/src/linux-2.2.19-i686 + % make + + Your dest tree will now include an additional kernel module for your + additional kernel headers. Be aware that if the kernel version string + which UTS_RELEASE is defined to in include/linux/version.h matches the + last kernel you built for, the previous kernel module will be + overwritten. + +E HP-UX 11.0 Notes + HP-UX 11.0 requires a header called vfs_vm.h which HP has provided on their web site: http://h21007.www2.hp.com/dspp/tech/tech_TechSoftwareDetailPage_IDX/1,1703,687,00.html To navigate down from the top level of the portal, one would do @@ -146,3 +153,46 @@ D Notes www.hp.com/dspp -> i want to... -> download software -> operating systems to get to the same page. + +F OpenBSD Notes + + You need kernel source installed to build OpenAFS. Use the + --with-bsd-kernel-headers= configure option if your kernel source is not + in /usr/src/sys. + + There is a package builder in src/packaging/OpenBSD. "sh buildpkg.sh" + should make a package for the client. Use pkg_add to install. The + package will install using transarc-paths, regardless of how you + configured. + + There is no server package, but I am told that "make install" will put + server binaries in /usr/afs. + + Your kernel may panic when you try to shutdown after running the OpenAFS + client. To prevent this, change the "dangling vnode" panic in + sys/kern/vfs_syscalls.c to a printf and build a new kernel. + + You can't run arla and OpenAFS at the same time. + +G FreeBSD Notes + + The FreeBSD client is very new and untested. Do not trust it for + production work. + + You need kernel source installed to build OpenAFS. Use the + --with-bsd-kernel-headers= configure option if your kernel source is not + in /usr/src/sys. + + You also need access to your kernel build directory for the opt_global.h + include file. Use the --with-bsd-kernel-build= configure option if your + kernel build is not GENERIC in the standard place. + + There is a package builder in src/packaging/OpenBSD. "sh buildpkg.sh" + should make a package for the client. Use pkg_add to install. The + package will install using transarc-paths, regardless of how you + configured. The builder uses an old version of the /usr/vice/etc/rc file + that probably won't work. You might be able to replace it with something + like "kldload libafs.ko; /usr/vice/etc/afsd". + + There is no server package, but I am told that "make install" will put + server binaries in /usr/afs. diff --git a/README-NT b/README-NT new file mode 100644 index 000000000..8acfe4c5d --- /dev/null +++ b/README-NT @@ -0,0 +1,327 @@ +This software has been released under the terms of the IBM Public +License. For details, see the LICENSE file in the top-level source +directory or on-line at http://www.openafs.org/dl/license10.html + +The document now provides a step by step procedure that takes the user +from a basic Windows 2000/XP workstation to an OpenAFS development +environment. Details are provided so that a 'beginning' windows +developer can build an OpenAFS installable package for Windows 2000/XP/2003. + +NOTE: +As of the OpenAFS 1.3 release series, Windows platforms released +prior to Windows 2000 are not being supported. The InstallShield +installer is still in the source tree but is no longer supported. +A new open source installer based on NSIS 2.0 replaces it. + +*********** Windows 2000/XP/2003 Build Process **************** + +Building OpenAFS for Windows requires configuring a Windows +development system by installing compilation tools and header files. +Open AFS Software development can be done on Windows 2000 or XP. The +target system, where OpenAFS will be installed, should be either +Windows 2000, Windows XP, or Windows 2003. The building process is +controlled by a nmake file that generates the necessary binaries and +binds them into an install package. + +The following steps describe how to configure Windows 2000/XP: + + A. Obtain a copy of the OpenAFS Source Tree + B. Install Compiler and Development tools. + C. Install SDK header files + D. Configure NTBUILD.BAT + E. Set program version Level + F. Build Win2000 binaries + G. Install NSIS 2.0 + H. Build NSIS Install Package + I. Final Results + J. Optional Items + +The Microsoft development tools require anywhere from 660 MB to 1.8GB +of storage depending on which compilers are selected. The following +versions are supported: + + Microsoft Visual C++ 6.0 + Microsoft Visual .NET + Microsoft Visual .NET 2003 (recommended) + + Any version of the Microsoft SDK and Tools released August 2001 or later. + +The NSIS installer requires about 14 MB of storage. The following +version is supported. + + Nullsoft Scriptable Installation System 2.0 + +The InstallShield scripts (although not supported) require version 5.5 +of InstallShiled. Version 6.0 or higher of InstallShield are not +compatible. + +The OpenAFS Source directory requires about 360 MB storage. The Source +directory size includes additional space for files that will be +generated during the build process. + + +STEP A. Obtain a copy of the Open AFS Source Tree. + +Transfer OpenAFS source tree onto your hardrive. The source can be +downloaded from the OpenAFS web site: + http://www.OpenAFS.org/release/snapindex.html. + +For this example, download source for version 1.3.60 using the +following URL: +http://www.openafs.org/dl/openafs/1.3.60/openafs-1.3.60-src.tar + +HINT: DailySnapShots are pre-release source trees and much more +likely to have compilation errors. If this is your first attempt, do +your build based on a release version of the source, e.g. 1.3.60. Once +you have completed a build process successfully, you can experiment with +other source trees. + +You will need an unzip utility that can expand compressed tar files. +For example "Pkzip for Windows" from Pkware will uncompress tar files. +(http://www.pkware.com/) + +Expand the downloaded tar file (openafs-1.3.60-src.tar) into target +directory (c:\OpenAFS), the unzip routine will expand the source into a +subdirectory tree: + c:\OpenAFS\OpenAFS-1.3.60\src + +Copy the files 'NTMakefile' and 'ntbuild.bat' from 'src' to the OpenAFS +base directory: + + From a DOS command prompt window, enter the following copy commands: + + copy c:\OpenAFS\OpenAFS-1.3.60\src\NTMakefile c:\OpenAFS\OpenAFS-1.3.60\. + copy c:\OpenAFS\OpenAFS-1.3.60\src\ntbuild.bat c:\OpenAFS\OpenAFS-1.3.60\. + + +The AFS base directory should look something like the following: + + c:\OpenAFS\OpenAFS-1.3.60\ + NTMakefile + ntbuild.bat + src + + +STEP B. Install compiler and development tools. + +Install a copy of Microsoft Visual C++ 6.0, Visual .NET, or Visual .NET 2003. +The "Typical" install setting is sufficient. + +(1) You can reduce the installation size by selecting "Custom" install +and remove all but the following Options: + + Microsoft Visual C++ + Data Access + +(2) When asked, Select to Register Environment Variables. + + +STEP C. Install SDK header files. + +Files from Microsoft's Platform SDK (August 2001 or later) are required to +complete a build on Windows 2000 or XP. You can install the "Core SDK" +from + + http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ + +by using Internet Explorer 5.x or higher. (Active X controls are required) + +The header files that are required are found from a Microsoft SDK are: + + netspi.h + npapi.h + +These files come from Microsoft DDKs/SDKs as follows: + + January 1997 Windows NT Workstation DDK - /ddk/frc/network/inc/npapi.h + November 2001 Microsoft Platform SDK - install "samples" from "Core SDK" + samples/winbase/security/winnt/logonnp/npapi.h + July 1998 Windows 95 DDK - net/inc/netmpr.h and net/inc/netspi.h + July 1999 Windows 98 DDK - src/net/inc/netmpr.h and src/net/inc/netspi.h + - you need to install "Legacy and Related + driver samples" + +STEP D. Configure NTBUILD.BAT. + +The NTBUILD.BAT file copied to the OpenAFS base directory must be +customized for use on your development system. The following variables +must be defined to match your configuration: + + AFSVER_CL: Set to 1200 if using MS Visual C++ 6.0 + Set to 1300 if using MS Visual .NET + Set to 1310 if using MS Visual .NET 2003 + + MSVCDIR: Set to the short name version of the directory into which + the visual C++ compiler was installed regardless of version + + MSSDKDIR: Set to the short name of the directory into which + the Platform SDK was installed + + NTDDKDIR: Set the short name of the directory containing the npapi.h file + + AFSROOT: Set to the short name of the OpenAFS Base directory + + +STEP E. Set version and installation options (optional) + +Add a CellServDB file to install area. CellServDB contains the entries +for the various cell names. You can download a general purpose one +from: + http://grand.central.org/dl/cellservdb/CellServDB +then copy it to %AFSROOT%\src\WINNT\install\NSIS and name it afsdcell.ini + +Edit file %AFSROOT%\src\config\NTMakefile.i386_nt40 + AFSPRODUCT_VER_MAJOR - Version Major Number + AFSPRODUCT_VER_MINOR - Version Minor Number + AFSPRODUCT_VER_PATCH - Version Patch Number + AFSPRODUCT_VER_BUILD - Version Build Number + CELLSERVDB_INSTALL - The default file name for the CellServDB + included in the install Package. + CELLNAME_DEFAULT - The default home cell name. + CELLSERVDB_WEB - The default web address to obtain CellServDB + +For example: in the file %AFSROOT%\src\config\NTMakefile.i386_nt40 you would +see the following: + + AFSPRODUCT_VER_MAJOR=1 + AFSPRODUCT_VER_MINOR=3 + AFSPRODUCT_VER_PATCH=6000 + AFSPRODUCT_VER_BUILD=0 + CELLNAME_DEFAULT=openafs.org + CELLSERVDB_INSTALL=CellServDB.GrandCentral + CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB + +During the Open AFS installation process the user will be presented +with two choices for the CellServDB: Local copy (CELLSERVDB_INSTALL) and +one that can be downloaded from the web (CELLSERVDB_WEB). + +STEP F. Begin the build + +(1) From Windows 2000/XP open up a DOS prompt window. + +(2) Change to the %AFSROOT% directory + +(3) Configure the environment variables: + + For a release build: + + (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the + Visual Studio environment you installed. + + (b) Execute the SETENV.BAT file with the parameters "/2000 /RETAIL" + + (c) Execute the NTBUILD.BAT file with the parameter "free" + + For a debug build: + + (a) Execute the VCVARS32.BAT or VSVARS32.BAT file which part of the + Visual Studio environment you installed. + + (b) Execute the SETENV.BAT file with the parameters "/2000 /DEBUG" + + (c) Execute the NTBUILD.BAT file with the parameter "checked" + +(4) Clean the work area: + + nmake /f NTMakefile clean + +(5) Build the complete Windows NT/2000 development environment. + + nmake /f NTMakefile install + +While the build is running you will see many compile warnings. This +behavior is normal; the build process is successful as long as the build +process doesn't terminate with an error ("nmake.exe return code 0x2") +and it displays 'Build Finished Successfully'. + + +STEP G. Install NSIS 2.0 (optional). + +Download the Nullsoft Scriptable Installation System (NSIS) 2.0 from + + http://nsis.sourceforge.net/home/ + +Run the nsis20.exe installer. + +NOTE: The NSIS installer may be rebuilt from source files + + C:\Program Files\NSIS\Source + +to enable options not built into the default configuration. The +OpenAFS installers are built using a modified version of the NSIS +sources. The following changes were made to exehead\config.h. + + NSIS_MAX_STRLEN set to 4096 + NSIS_CONFIG_LOG defined + NSIS_CONFIG_LOG_ODS defined + + +STEP H. Build OpenAFS NSIS install package + +From the DOS command prompt window run: + + nmake /f NTMakefile NSIS + + +STEP I. Final Results + +The build process generates its binaries in %AFSROOT%\DEST. The subdirectory +would look like the following: + +%AFSROOT%:\DEST\{checked,free}\ + bin + etc + include + lib + root.client + root.server + WinInstall + + Bin - contains build utilities. + root.client - contains Open AFS binaries + root.server - contain Open AFS Server binaries + WinInstall\OpenAFSforWindows.exe - is the install package for Open AFS + + +STEP J. Optional Items + +The build process has an error table that is compiled for many OpenAFS +applications. This table is generated by Unix based tools. It is not +normally necessary to modify this table so pre-generated source files +are included in the OpenAFS source. If you need to make modifications +in these areas the Unix base tools that run on Windows can be found on +the web. For example: + + http://cygwin.com/ + +Below is a short explanation how to update the error table. + +(1) Install flex and bison from a Unix based tool provider. + +(2) Make changes to the source files. + +There are two files in the source tree that are processed with lex +and yacc on UNIX systems, src/comerr/et_lex.lex.l and +src/comerr/error_table.y, that when processed produce the files +et_lex.lex_nt.c, error_table_nt.c, and error_table_nt.h. + +Since NT does not include lex and yacc or any equivalent tools, we +have provided the output files that lex and yacc produce (using Win32 +ports of flex and bison). This will allow builds to work for anyone +who does not need to change the .l and .y files. + +If you do need to change et_lex.lex.l, then you will need to install +Win32 port of flex on your system. Put flex.exe in a directory on the +path and rebuild. + +If you do need to change error_table.y, then you will need to install +a Win32 port of bison on your system. Put bison.exe in a directory on +the path, configure bison as explained in step 5, and rebuild. + +You can also attempt to use other replacements for lex and yacc. This +will require modifying the LEX and YACC settings in +/config/NTMakefile.i386_nt40. If the replacements require different +command line options than flex and bison, then you may also need to +change src/comerr/NTMakefile. + +(3) Generate new OpenAFS binaries diff --git a/src/README-WIN9X b/README-WIN9X similarity index 97% rename from src/README-WIN9X rename to README-WIN9X index dae84fb67..a1a28debb 100644 --- a/src/README-WIN9X +++ b/README-WIN9X @@ -5,6 +5,11 @@ This software has been released under the terms of the IBM Public License. For details, see the LICENSE file in the top-level source directory or online at http://www.openafs.org/dl/license10.html +NOTE: As of the OpenAFS 1.3 release series, Windows 9x platforms are no +longer officially supported. It is not clear whether or not the source +tree will build successfully or not. As far as we know, no one has tried +in a very long time. + Building Open AFS on Win 95 --------------------------- diff --git a/README.DEVEL b/README.DEVEL new file mode 100644 index 000000000..ea5dfcbbc --- /dev/null +++ b/README.DEVEL @@ -0,0 +1,78 @@ +Notes on Coding Standards/Requirements for OpenAFS Source +--------------------------------------------------------- + +Do not use $< in any cross-platform dir as it requires a reasonable +make that is not available on all systems. + +Be careful with prototypes/ANSI-C in code that will be compiled for +kernel source. In general, avoid them until we have figured out +exactly when/where they can be used safely. + +Do not have build rules that build multiple targets. Make doesn't seem able +to handle this, and it interferes with -j builds. (In particular, build the +rxgen targets individually and not using the flags for building all the files +in one shot.) + +Try to test builds using gmake -j # MAKE="gmake -j #", it seems like a good +way to find missing or order-dependent dependency rules. (Is there a better +way to do this?) + +-- Prototyping and Style -- +Prototypes for all source files in a given dir DDD should be placed +int the file DDD/DDD_prototypes.h. All externally used (either API +or used by other source files) routines and variables should be +prototyped in this file. + +The prototypes should be a full prototype, with argument and return +types. (Should not generate a warning with gcc -Wstrict-prototypes.) + +Format of the prototype files should look like: + + Standard Copyright Notice + + #ifndef AFS_SRC_DDD_PROTO_H + #define AFS_SRC_DDD_PROTO_H + + /* filename.c */ + prototypes + + /* filename.c */ + prototypes + + #endif /* AFS_SRC_DDD_PROTO_H */ + +In most of the existing prototypes, the define is DDD_PROTOTYPES_H, which is +probably ok as well. + +The declaration of the routines should be done in ANSI style. If at some +later date, it is determined that prototypes don't work on some platform +properly, we can use ansi2knr during the compile. + + rettype routine(argtype arg) + { + + } + +All routines should have a return type specified, void if nothing returned, +and should have (void) if no arguments are taken. + +Header files should not contain macros or other definitions unless they +are used across multiple source files. + +All routines should be declared static if they are not used outside that +source file. + +Compiles on gcc-using machines should strive to handle using +-Wstrict-prototypes -Werror. (this may take a while) + +Routines shall be defined in source prior to use if possible, and +prototyped in block at top of file if static. + +If you make a routine or variable static, be sure and remove it from +the AIX .exp files. + +Suggested compiler flags: + gcc: -Wall -Wstrict-prototypes + Solaris Workshop CC: -fd -v + (You might not want the -fd, it isn't really useful, just complains about the + K&R style functions, but -v gives useful info.) diff --git a/acconfig.h b/acconfig.h index 075dca23b..8a1f21efe 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,16 +1,13 @@ @BOTTOM@ #undef PACKAGE #undef VERSION - #define RCSID(msg) \ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } - #undef HAVE_CONNECT #undef HAVE_GETHOSTBYNAME #undef HAVE_RES_SEARCH #undef HAVE_SOCKET #undef STRUCT_SOCKADDR_HAS_SA_LEN - #if ENDIANESS_IN_SYS_PARAM_H # ifndef KERNEL # include @@ -20,16 +17,14 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } # endif # endif #endif - #undef AFS_AFSDB_ENV +#undef AFS_LARGEFILE_ENV #undef AFS_NAMEI_ENV - #undef BITMAP_LATER #undef BOS_RESTRICTED_MODE #undef BOS_NEW_CONFIG #undef FAST_RESTART #undef FULL_LISTVOL_SWITCH - #undef COMPLETION_H_EXISTS #undef DEFINED_FOR_EACH_PROCESS #undef DEFINED_PREV_TASK @@ -39,6 +34,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #undef EXPORTED_IA32_SYS_CALL_TABLE #undef EXPORTED_TASKLIST_LOCK #undef INODE_SETATTR_NOT_VOID +#undef IRIX_HAS_MEM_FUNCS #undef RECALC_SIGPENDING_TAKES_VOID #undef STRUCT_ADDRESS_SPACE_HAS_GFP_MASK #undef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK @@ -53,10 +49,10 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #undef STRUCT_TASK_STRUCT_HAS_SIGHAND #undef STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK #undef ssize_t - +#undef HAVE_STRUCT_BUF +#undef HAVE_ARPA_NAMESER_COMPAT_H /* glue for RedHat kernel bug */ #undef ENABLE_REDHAT_BUILDSYS - #if defined(ENABLE_REDHAT_BUILDSYS) && defined(KERNEL) && defined(REDHAT_FIX) #include "redhat-fix.h" #endif diff --git a/acinclude.m4 b/acinclude.m4 index b6e2bf20b..99e62606b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -19,24 +19,36 @@ AC_ARG_ENABLE( insecure, [ --enable-insecure enable insecure portions of AFS (ftpd, inetd, rcp, rlogind and rsh)],, enable_insecure="no") AC_ARG_ENABLE( afsdb, [ --disable-afsdb disable AFSDB RR support],, enable_afsdb="yes") +AC_ARG_ENABLE( pam, +[ --disable-pam disable PAM support],, enable_pam="yes") AC_ARG_ENABLE( bos-restricted-mode, [ --enable-bos-restricted-mode enable bosserver restricted mode which disables certain bosserver functionality],, enable_bos_restricted_mode="no") AC_ARG_ENABLE( bos-new-config, [ --enable-bos-new-config enable bosserver pickup of BosConfig.new on restarts],, enable_bos_new_config="no") +AC_ARG_ENABLE( largefile-fileserver, +[ --enable-largefile-fileserver enable large file support in fileserver],, enable_largefile_fileserver="no") AC_ARG_ENABLE( namei-fileserver, [ --enable-namei-fileserver force compilation of namei fileserver in preference to inode fileserver],, enable_namei_fileserver="no") +AC_ARG_ENABLE( supergroups, +[ --enable-supergroups enable support for nested pts groups],, enable_supergroups="no") AC_ARG_ENABLE( fast-restart, [ --enable-fast-restart enable fast startup of file server without salvaging],, enable_fast_restart="no") AC_ARG_ENABLE( bitmap-later, [ --enable-bitmap-later enable fast startup of file server by not reading bitmap till needed],, enable_bitmap_later="no") AC_ARG_ENABLE( full-vos-listvol-switch, -[ --enable-full-vos-listvol-switch enable vos full listvol switch for formatted output],, enable_full_vos_listvol_switch="no") +[ --disable-full-vos-listvol-switch disable vos full listvol switch for formatted output],, enable_full_vos_listvol_switch="yes") AC_ARG_WITH(dux-kernel-headers, [ --with-dux-kernel-headers=path use the kernel headers found at path(optional, defaults to first match in /usr/sys)] ) AC_ARG_WITH(linux-kernel-headers, [ --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux)] ) +AC_ARG_WITH(bsd-kernel-headers, +[ --with-bsd-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/sys)] +) +AC_ARG_WITH(bsd-kernel-build, +[ --with-bsd-kernel-build=path use the kernel build found at path(optional, defaults to KSRC/i386/compile/GENERIC)] +) AC_ARG_ENABLE(kernel-module, [ --disable-kernel-module disable compilation of the kernel module (defaults to enabled)],, enable_kernel_module="yes" ) @@ -52,6 +64,23 @@ AC_ARG_ENABLE(tivoli-tsm, AC_ARG_ENABLE(debug-kernel, [ --enable-debug-kernel enable compilation of the kernel module with debugging information (defaults to disabled)],, enable_debug_kernel="no" ) +AC_ARG_ENABLE(optimize-kernel, +[ --disable-optimize-kernel disable compilation of the kernel module with optimization (defaults based on platform)],, enable_optimize_kernel="yes" +) +AC_ARG_ENABLE(debug, +[ --enable-debug enable compilation of the user space code with debugging information (defaults to disabled)],, enable_debug="no" +) +AC_ARG_ENABLE(optimize, +[ --disable-optimize disable optimization for compilation of the user space code (defaults to enabled)],, enable_optimize="yes" +) +AC_ARG_ENABLE(debug-lwp, +[ --enable-debug-lwp enable compilation of the LWP code with debugging information (defaults to disabled)],, enable_debug_lwp="no" +) +AC_ARG_ENABLE(optimize-lwp, +[ --disable-optimize-lwp disable optimization for compilation of the LWP code (defaults to enabled)],, enable_optimize_lwp="yes" +) + +enable_login="no" dnl weird ass systems AC_AIX @@ -62,6 +91,7 @@ dnl Various compiler setup. AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SIGNAL +COMPILER_HAS_FUNCTION_MACRO dnl Checks for programs. AC_PROG_INSTALL @@ -72,11 +102,6 @@ AM_PROG_LEX OPENAFS_CHECK_BIGENDIAN -KERN_DEBUG_OPT= -if test "x$enable_debug_kernel" = "xyes"; then - KERN_DEBUG_OPT=-g -fi - AC_MSG_CHECKING(your OS) system=$host case $system in @@ -95,10 +120,10 @@ case $system in fi fi if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then - linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -1` + linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1` if test "x$linux_kvers" = "x"; then if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then - linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -1` + linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1` if test "x$linux_kvers" = "x"; then AC_MSG_ERROR(Linux headers lack version definition [2]) @@ -127,23 +152,24 @@ case $system in AC_MSG_WARN(No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module) fi fi + dnl do we need to determine SUBARCH from autoconf.h + SUBARCH=default fi AC_MSG_RESULT(linux) if test "x$enable_kernel_module" = "xyes"; then - OMIT_FRAME_POINTER= if test "x$enable_debug_kernel" = "xno"; then - OMIT_FRAME_POINTER=-fomit-frame-pointer + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer" fi - AC_SUBST(OMIT_FRAME_POINTER) OPENAFS_GCC_SUPPORTS_MARCH AC_SUBST(P5PLUS_KOPTS) OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING OPENAFS_GCC_SUPPORTS_NO_COMMON + OPENAFS_GCC_SUPPORTS_PIPE AC_SUBST(LINUX_GCC_KOPTS) ifdef([OPENAFS_CONFIGURE_LIBAFS], - [LINUX_BUILD_VNODE_FROM_INODE(config,afs)], - [LINUX_BUILD_VNODE_FROM_INODE(src/config,src/afs/LINUX)] + [LINUX_BUILD_VNODE_FROM_INODE(src/config,afs)], + [LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)] ) LINUX_COMPLETION_H_EXISTS LINUX_DEFINES_FOR_EACH_PROCESS @@ -166,8 +192,8 @@ case $system in LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK LINUX_WHICH_MODULES if test "x$ac_cv_linux_config_modversions" = "xno"; then - AC_MSG_WARN([Cannot determine sys_call_table status. assuming it's exported]) - ac_cv_linux_exports_sys_call_table=yes + AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported]) + ac_cv_linux_exports_sys_call_table=no if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then ac_cv_linux_exports_ia32_sys_call_table=yes fi @@ -324,6 +350,10 @@ case $system in MKAFS_OSTYPE=FBSD AC_MSG_RESULT(i386_fbsd) ;; + *-netbsd*) + MKAFS_OSTYPE=NBSD + AC_MSG_RESULT(nbsd) + ;; *-openbsd*) MKAFS_OSTYPE=OBSD AC_MSG_RESULT(i386_obsd) @@ -332,13 +362,27 @@ case $system in AC_MSG_RESULT($system) ;; esac -AC_SUBST(KERN_DEBUG_OPT) if test "x$with_afs_sysname" != "x"; then AFS_SYSNAME="$with_afs_sysname" else AC_MSG_CHECKING(your AFS sysname) case $host in + i?86-*-openbsd3.1) + AFS_SYSNAME="i386_obsd31" + ;; + i?86-*-openbsd3.2) + AFS_SYSNAME="i386_obsd32" + ;; + i?86-*-openbsd3.3) + AFS_SYSNAME="i386_obsd33" + ;; + i?86-*-openbsd3.4) + AFS_SYSNAME="i386_obsd34" + ;; + i?86-*-openbsd3.5) + AFS_SYSNAME="i386_obsd35" + ;; i?86-*-freebsd4.2*) AFS_SYSNAME="i386_fbsd_42" ;; @@ -354,15 +398,66 @@ else i?86-*-freebsd4.6*) AFS_SYSNAME="i386_fbsd_46" ;; + i?86-*-freebsd4.7*) + AFS_SYSNAME="i386_fbsd_47" + ;; + i?86-*-freebsd5.0*) + AFS_SYSNAME="i386_fbsd_50" + ;; + i?86-*-freebsd5.1*) + AFS_SYSNAME="i386_fbsd_51" + ;; + i?86-*-freebsd5.2*) + AFS_SYSNAME="i386_fbsd_52" + ;; + i?86-*-netbsd*1.5*) + AFS_PARAM_COMMON=param.nbsd15.h + AFS_SYSNAME="i386_nbsd15" + ;; + alpha-*-netbsd*1.5*) + AFS_PARAM_COMMON=param.nbsd15.h + AFS_SYSNAME="alpha_nbsd15" + ;; + i?86-*-netbsd*1.6[[M-Z]]*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="i386_nbsd20" + ;; + powerpc-*-netbsd*1.6[[M-Z]]*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="ppc_nbsd20" + ;; + i?86-*-netbsd*2.0*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="i386_nbsd20" + ;; + powerpc-*-netbsd*2.0*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="ppc_nbsd20" + ;; + i?86-*-netbsd*1.6*) + AFS_PARAM_COMMON=param.nbsd16.h + AFS_SYSNAME="i386_nbsd16" + ;; + alpha-*-netbsd*1.6*) + AFS_PARAM_COMMON=param.nbsd16.h + AFS_SYSNAME="alpha_nbsd16" + ;; + powerpc-*-netbsd*1.6*) + AFS_PARAM_COMMON=param.nbsd16.h + AFS_SYSNAME="ppc_nbsd16" + ;; hppa*-hp-hpux11.0*) AFS_SYSNAME="hp_ux110" ;; hppa*-hp-hpux11.11) - AFS_SYSNAME="hp_ux11i" + AFS_SYSNAME="hp_ux11i" ;; - ia64-hp-hpux*) + ia64-hp-hpux11.22) AFS_SYSNAME="ia64_hpux1122" ;; + ia64-hp-hpux*) + AFS_SYSNAME="ia64_hpux1123" + ;; hppa*-hp-hpux10*) AFS_SYSNAME="hp_ux102" ;; @@ -408,8 +503,21 @@ else powerpc-apple-darwin6.5*) AFS_SYSNAME="ppc_darwin_60" ;; + powerpc-apple-darwin7.0*) + AFS_SYSNAME="ppc_darwin_70" + ;; + powerpc-apple-darwin7.1*) + AFS_SYSNAME="ppc_darwin_70" + ;; + powerpc-apple-darwin7.2*) + AFS_SYSNAME="ppc_darwin_70" + ;; + powerpc-apple-darwin7.3*) + AFS_SYSNAME="ppc_darwin_70" + ;; sparc-sun-solaris2.5*) AFS_SYSNAME="sun4x_55" + enable_login="yes" ;; sparc-sun-solaris2.6) AFS_SYSNAME="sun4x_56" @@ -425,6 +533,7 @@ else ;; sparc-sun-sunos4*) AFS_SYSNAME="sun4_413" + enable_login="yes" ;; i386-pc-solaris2.7) AFS_SYSNAME="sunx86_57" @@ -453,6 +562,9 @@ else powerpc-*-linux*) AFS_SYSNAME="ppc_linuxXX" ;; + powerpc64-*-linux*) + AFS_SYSNAME="ppc64_linuxXX" + ;; alpha*-linux*) AFS_SYSNAME="alpha_linux_XX" ;; @@ -470,6 +582,7 @@ else ;; parisc-*-linux-gnu) AFS_SYSNAME="parisc_linuxXX" + enable_pam="no" ;; power*-ibm-aix4.2*) AFS_SYSNAME="rs_aix42" @@ -477,8 +590,15 @@ else power*-ibm-aix4.3*) AFS_SYSNAME="rs_aix42" ;; + power*-ibm-aix5.1*) + AFS_SYSNAME="rs_aix51" + ;; + power*-ibm-aix5.2*) + AFS_SYSNAME="rs_aix52" + ;; x86_64-*-linux-gnu) AFS_SYSNAME="amd64_linuxXX" + enable_pam="no" ;; *) AC_MSG_ERROR(An AFS sysname is required) @@ -493,13 +613,19 @@ else fi _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/` AFS_SYSNAME="$_AFS_SYSNAME" - if test -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then - AFS_ISUML=`awk '$[]2 == "CONFIG_USERMODE"{print $[]3}' $LINUX_KERNEL_PATH/include/linux/autoconf.h` - if test "x${AFS_ISUML}" = "x1"; then - _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/` - fi - AFS_SYSNAME="$_AFS_SYSNAME" + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-I${LINUX_KERNEL_PATH}/include $CPPFLAGS" + AC_TRY_COMPILE( + [#include ], + [#ifndef CONFIG_USERMODE + #error not UML + #endif], + ac_cv_linux_is_uml=yes,) + if test "${ac_cv_linux_is_uml}" = yes; then + _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/` fi + CPPFLAGS="$save_CPPFLAGS" + AFS_SYSNAME="$_AFS_SYSNAME" ;; esac AC_MSG_RESULT($AFS_SYSNAME) @@ -511,7 +637,7 @@ KDUMP=kdump case $AFS_SYSNAME in sgi_6?) KDUMP=kdump.IP20;; - sun4x_5[789] | hp_ux11*) + sun4x_5[[789]] | hp_ux11*) KDUMP=kdump32 KDUMP64=kdump64;; *linux*) @@ -524,8 +650,37 @@ case $AFS_SYSNAME in *_darwin*) DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist + dnl the test below fails on darwin, even if the CPPFLAGS below + dnl are added. the headers from Kernel.Framework must be used + dnl when KERNEL is defined. + + dnl really, such a thing isn't guaranteed to work on any + dnl platform until the kernel cflags from MakefileProto are + dnl known to configure + AC_DEFINE(HAVE_STRUCT_BUF, 1, [define if you have a struct buf]) ;; + *) +AC_MSG_CHECKING(for definition of struct buf) +dnl save_CPPFLAGS="$CPPFLAGS" +dnl CPPFLAGS="$CPPFLAGS -DKERNEL -D_KERNEL -D__KERNEL -D__KERNEL__" +AC_CACHE_VAL(ac_cv_have_struct_buf, [ + ac_cv_have_struct_buf=no + AC_TRY_COMPILE( + [#include ], + [struct buf x; + printf("%d\n", sizeof(x));], + ac_cv_have_struct_buf=yes,) + ] +) +dnl CPPFLAGS="$save_CPPFLAGS" +AC_MSG_RESULT($ac_cv_have_struct_buf) +if test "$ac_cv_have_struct_buf" = yes; then + AC_DEFINE(HAVE_STRUCT_BUF, 1, [define if you have a struct buf]) +fi +;; esac + + AC_CACHE_VAL(ac_cv_sockaddr_len, [ AC_MSG_CHECKING([if struct sockaddr has sa_len field]) @@ -569,6 +724,24 @@ else done fi + dnl darwin wants it, aix hates it + AC_MSG_CHECKING(for the useability of arpa/nameser_compat.h) + AC_TRY_COMPILE([ + #include + #include + #include + #include + #include + #include + #include + #include + #include + ], [static int i; i = 0;], + [AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_ARPA_NAMESER_COMPAT_H)], + [AC_MSG_RESULT(no) + ]) + openafs_save_libs="$LIBS" AC_MSG_CHECKING([for res_search]) AC_FUNC_RES_SEARCH @@ -624,7 +797,30 @@ if test "$enable_insecure" = "yes"; then WITH_INSECURE=YES fi +if test "x$with_bsd_kernel_headers" != "x"; then + BSD_KERNEL_PATH="$with_bsd_kernel_headers" +else + BSD_KERNEL_PATH="/usr/src/sys" +fi + +if test "x$with_bsd_kernel_build" != "x"; then + BSD_KERNEL_BUILD="$with_bsd_kernel_build" +else + case $AFS_SYSNAME in + i386_fbsd_4?) + BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/compile/GENERIC" + ;; + i386_fbsd_5?) + BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/i386/compile/GENERIC" + ;; + esac +fi + # Fast restart +if test "$enable_supergroups" = "yes"; then + AC_DEFINE(SUPERGROUPS, 1, [define if you want to have support for nested pts groups]) +fi + if test "$enable_fast_restart" = "yes"; then AC_DEFINE(FAST_RESTART, 1, [define if you want to have fast restart]) fi @@ -645,6 +841,10 @@ if test "$enable_bos_new_config" = "yes"; then AC_DEFINE(BOS_NEW_CONFIG, 1, [define if you want to enable automatic renaming of BosConfig.new to BosConfig at startup]) fi +if test "$enable_largefile_fileserver" = "yes"; then + AC_DEFINE(AFS_LARGEFILE_ENV, 1, [define if you want large file fileserver]) +fi + if test "$enable_namei_fileserver" = "yes"; then AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver]) fi @@ -681,21 +881,42 @@ AC_HEADER_SYS_WAIT AC_HEADER_DIRENT AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h) AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h) -AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h) +AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h sys/fstyp.h) AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h) -AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h) -AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h) +AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h sys/user.h) +AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h regex.h) -if test "$ac_cv_header_security_pam_modules_h" = "yes"; then +if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_pam" = yes; then HAVE_PAM="yes" else HAVE_PAM="no" fi AC_SUBST(HAVE_PAM) -AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf re_comp re_exec) -AC_CHECK_FUNCS(setprogname getprogname sigaction mkstemp strerror) +if test "$enable_login" = yes; then + BUILD_LOGIN="yes" +else + BUILD_LOGIN="no" +fi +AC_SUBST(BUILD_LOGIN) + +AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf strlcat strlcpy re_comp re_exec) +AC_CHECK_FUNCS(setprogname getprogname sigaction mkstemp vsnprintf strerror) + +AC_CHECK_FUNCS(regcomp regexec regerror) +AC_MSG_CHECKING([for POSIX regex library]) +if test "$ac_cv_header_regex_h" = "yes" && \ + test "$ac_cv_func_regcomp" = "yes" && \ + test "$ac_cv_func_regexec" = "yes" && \ + test "$ac_cv_func_regerror" = "yes"; then + AC_DEFINE(HAVE_POSIX_REGEX, 1, [define if you have POSIX regex library]) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + AC_CHECK_TYPE(ssize_t, int) +AC_SIZEOF_TYPE(long) AC_CHECK_FUNCS(timegm) @@ -742,11 +963,15 @@ ENABLE_KERNEL_MODULE=libafs fi AC_SUBST(AFS_SYSNAME) +AC_SUBST(AFS_PARAM_COMMON) AC_SUBST(ENABLE_KERNEL_MODULE) AC_SUBST(LIB_AFSDB) AC_SUBST(LINUX_KERNEL_PATH) +AC_SUBST(BSD_KERNEL_PATH) +AC_SUBST(BSD_KERNEL_BUILD) AC_SUBST(LINUX_VERSION) AC_SUBST(MKAFS_OSTYPE) +AC_SUBST(TOP_OBJDIR) AC_SUBST(TOP_SRCDIR) AC_SUBST(TOP_INCDIR) AC_SUBST(TOP_LIBDIR) @@ -756,4 +981,31 @@ AC_SUBST(WITH_INSECURE) AC_SUBST(DARWIN_INFOFILE) AC_SUBST(IRIX_BUILD_IP35) +OPENAFS_OSCONF + +TOP_SRCDIR="${srcdir}/src" +dnl +dnl If we're using ./configure, need a more reasonable TOP_SRCDIR, since relative links don't work everywhere +dnl +case $TOP_SRCDIR in + /*) + ;; + *) + TOP_SRCDIR=`cd $TOP_SRCDIR; pwd` + ;; +esac + +TOP_OBJDIR="${SRCDIR_PARENT}" +TOP_INCDIR="${SRCDIR_PARENT}/include" +TOP_LIBDIR="${SRCDIR_PARENT}/lib" +if test "${DEST}x" = "x"; then + DEST="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest" +fi + +HELPER_SPLINT="${TOP_SRCDIR}/helper-splint.sh" +HELPER_SPLINTCFG="${TOP_SRCDIR}/splint.cfg" +AC_SUBST(HELPER_SPLINT) +AC_SUBST(HELPER_SPLINTCFG) + + ]) diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 000000000..0777fa1ef --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,2802 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl This file contains the common configuration code which would +dnl otherwise be duplicated between configure and configure-libafs. +dnl +dnl NB: Because this code is a macro, references to positional shell +dnl parameters must be done like $[]1 instead of $1 + +AC_DEFUN(OPENAFS_CONFIGURE_COMMON,[ + +AC_CANONICAL_HOST +SRCDIR_PARENT=`pwd` + +#BOZO_SAVE_CORES pam sia +AC_ARG_WITH(afs-sysname, +[ --with-afs-sysname=sys use sys for the afs sysname] +) +AC_ARG_ENABLE( obsolete, +[ --enable-obsolete enable obsolete portions of AFS (mpp, ntp and package)],, enable_obsolete="no") +AC_ARG_ENABLE( insecure, +[ --enable-insecure enable insecure portions of AFS (ftpd, inetd, rcp, rlogind and rsh)],, enable_insecure="no") +AC_ARG_ENABLE( afsdb, +[ --disable-afsdb disable AFSDB RR support],, enable_afsdb="yes") +AC_ARG_ENABLE( pam, +[ --disable-pam disable PAM support],, enable_pam="yes") +AC_ARG_ENABLE( bos-restricted-mode, +[ --enable-bos-restricted-mode enable bosserver restricted mode which disables certain bosserver functionality],, enable_bos_restricted_mode="no") +AC_ARG_ENABLE( bos-new-config, +[ --enable-bos-new-config enable bosserver pickup of BosConfig.new on restarts],, enable_bos_new_config="no") +AC_ARG_ENABLE( largefile-fileserver, +[ --enable-largefile-fileserver enable large file support in fileserver],, enable_largefile_fileserver="no") +AC_ARG_ENABLE( namei-fileserver, +[ --enable-namei-fileserver force compilation of namei fileserver in preference to inode fileserver],, enable_namei_fileserver="no") +AC_ARG_ENABLE( supergroups, +[ --enable-supergroups enable support for nested pts groups],, enable_supergroups="no") +AC_ARG_ENABLE( fast-restart, +[ --enable-fast-restart enable fast startup of file server without salvaging],, enable_fast_restart="no") +AC_ARG_ENABLE( bitmap-later, +[ --enable-bitmap-later enable fast startup of file server by not reading bitmap till needed],, enable_bitmap_later="no") +AC_ARG_ENABLE( full-vos-listvol-switch, +[ --disable-full-vos-listvol-switch disable vos full listvol switch for formatted output],, enable_full_vos_listvol_switch="yes") +AC_ARG_WITH(dux-kernel-headers, +[ --with-dux-kernel-headers=path use the kernel headers found at path(optional, defaults to first match in /usr/sys)] +) +AC_ARG_WITH(linux-kernel-headers, +[ --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux)] +) +AC_ARG_WITH(bsd-kernel-headers, +[ --with-bsd-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/sys)] +) +AC_ARG_WITH(bsd-kernel-build, +[ --with-bsd-kernel-build=path use the kernel build found at path(optional, defaults to KSRC/i386/compile/GENERIC)] +) +AC_ARG_ENABLE(kernel-module, +[ --disable-kernel-module disable compilation of the kernel module (defaults to enabled)],, enable_kernel_module="yes" +) +AC_ARG_ENABLE(redhat-buildsys, +[ --enable-redhat-buildsys enable compilation of the redhat build system kernel (defaults to disabled)],, enable_redhat_buildsys="no" +) +AC_ARG_ENABLE(transarc-paths, +[ --enable-transarc-paths Use Transarc style paths like /usr/afs and /usr/vice],, enable_transarc_paths="no" +) +AC_ARG_ENABLE(tivoli-tsm, +[ --enable-tivoli-tsm Enable use of the Tivoli TSM API libraries for butc support],, enable_tivoli_tsm="no" +) +AC_ARG_ENABLE(debug-kernel, +[ --enable-debug-kernel enable compilation of the kernel module with debugging information (defaults to disabled)],, enable_debug_kernel="no" +) +AC_ARG_ENABLE(optimize-kernel, +[ --disable-optimize-kernel disable compilation of the kernel module with optimization (defaults based on platform)],, enable_optimize_kernel="yes" +) +AC_ARG_ENABLE(debug, +[ --enable-debug enable compilation of the user space code with debugging information (defaults to disabled)],, enable_debug="no" +) +AC_ARG_ENABLE(optimize, +[ --disable-optimize disable optimization for compilation of the user space code (defaults to enabled)],, enable_optimize="yes" +) +AC_ARG_ENABLE(debug-lwp, +[ --enable-debug-lwp enable compilation of the LWP code with debugging information (defaults to disabled)],, enable_debug_lwp="no" +) +AC_ARG_ENABLE(optimize-lwp, +[ --disable-optimize-lwp disable optimization for compilation of the LWP code (defaults to enabled)],, enable_optimize_lwp="yes" +) + +enable_login="no" + +dnl weird ass systems +AC_AIX +AC_ISC_POSIX +AC_MINIX + +dnl Various compiler setup. +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_SIGNAL +COMPILER_HAS_FUNCTION_MACRO + +dnl Checks for programs. +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_RANLIB +AC_PROG_YACC +AM_PROG_LEX + +OPENAFS_CHECK_BIGENDIAN + +AC_MSG_CHECKING(your OS) +system=$host +case $system in + *-linux*) + MKAFS_OSTYPE=LINUX + if test "x$enable_redhat_buildsys" = "xyes"; then + AC_DEFINE(ENABLE_REDHAT_BUILDSYS, 1, [define if you have redhat buildsystem]) + fi + if test "x$enable_kernel_module" = "xyes"; then + if test "x$with_linux_kernel_headers" != "x"; then + LINUX_KERNEL_PATH="$with_linux_kernel_headers" + else + LINUX_KERNEL_PATH="/usr/src/linux-2.4" + if test ! -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then + LINUX_KERNEL_PATH="/usr/src/linux" + fi + fi + if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then + linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1` + if test "x$linux_kvers" = "x"; then + if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then + linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1` + if test "x$linux_kvers" = "x"; then + + AC_MSG_ERROR(Linux headers lack version definition [2]) + exit 1 + else + LINUX_VERSION="$linux_kvers" + fi + else + AC_MSG_ERROR(Linux headers lack version definition) + exit 1 + fi + else + LINUX_VERSION="$linux_kvers" + fi + else + enable_kernel_module="no" + fi + if test ! -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then + enable_kernel_module="no" + fi + if test "x$enable_kernel_module" = "xno"; then + if test "x$with_linux_kernel_headers" != "x"; then + AC_MSG_ERROR(No usable linux headers found at $LINUX_KERNEL_PATH) + exit 1 + else + AC_MSG_WARN(No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module) + fi + fi + dnl do we need to determine SUBARCH from autoconf.h + SUBARCH=default + fi + AC_MSG_RESULT(linux) + if test "x$enable_kernel_module" = "xyes"; then + if test "x$enable_debug_kernel" = "xno"; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer" + fi + OPENAFS_GCC_SUPPORTS_MARCH + AC_SUBST(P5PLUS_KOPTS) + OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE + OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING + OPENAFS_GCC_SUPPORTS_NO_COMMON + OPENAFS_GCC_SUPPORTS_PIPE + AC_SUBST(LINUX_GCC_KOPTS) + ifdef([OPENAFS_CONFIGURE_LIBAFS], + [LINUX_BUILD_VNODE_FROM_INODE(src/config,afs)], + [LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)] + ) + LINUX_COMPLETION_H_EXISTS + LINUX_DEFINES_FOR_EACH_PROCESS + LINUX_DEFINES_PREV_TASK + LINUX_EXPORTS_TASKLIST_LOCK + LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK + LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK + LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM + LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM + LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS + LINUX_FS_STRUCT_INODE_HAS_I_DEVICES + LINUX_INODE_SETATTR_RETURN_TYPE + LINUX_KERNEL_LINUX_SYSCALL_H + LINUX_NEED_RHCONFIG + LINUX_RECALC_SIGPENDING_ARG_TYPE + LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT + LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT + LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG + LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND + LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK + LINUX_WHICH_MODULES + if test "x$ac_cv_linux_config_modversions" = "xno"; then + AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported]) + ac_cv_linux_exports_sys_call_table=no + if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then + ac_cv_linux_exports_ia32_sys_call_table=yes + fi + else + LINUX_EXPORTS_INIT_MM + LINUX_EXPORTS_KALLSYMS_ADDRESS + LINUX_EXPORTS_KALLSYMS_SYMBOL + LINUX_EXPORTS_SYS_CALL_TABLE + LINUX_EXPORTS_IA32_SYS_CALL_TABLE + LINUX_EXPORTS_SYS_CHDIR + LINUX_EXPORTS_SYS_CLOSE + LINUX_EXPORTS_SYS_WAIT4 + if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then + linux_syscall_method=none + if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then + linux_syscall_method=scan + if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then + linux_syscall_method=scan_with_kallsyms_address + fi + fi + if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then + linux_syscall_method=kallsyms_symbol + fi + if test "x$linux_syscall_method" = "xnone"; then + AC_MSG_ERROR([no available sys_call_table access method]) + fi + fi + fi + if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then + AC_DEFINE(EXPORTED_SYS_CHDIR, 1, [define if your linux kernel exports sys_chdir]) + fi + if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then + AC_DEFINE(EXPORTED_SYS_CLOSE, 1, [define if your linux kernel exports sys_close]) + fi + if test "x$ac_cv_linux_exports_sys_wait4" = "xyes" ; then + AC_DEFINE(EXPORTED_SYS_WAIT4, 1, [define if your linux kernel exports sys_wait4]) + fi + if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then + AC_DEFINE(EXPORTED_TASKLIST_LOCK, 1, [define if your linux kernel exports tasklist_lock]) + fi + if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then + AC_DEFINE(EXPORTED_SYS_CALL_TABLE) + fi + if test "x$ac_cv_linux_exports_ia32_sys_call_table" = "xyes"; then + AC_DEFINE(EXPORTED_IA32_SYS_CALL_TABLE) + fi + if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then + AC_DEFINE(EXPORTED_KALLSYMS_SYMBOL) + fi + if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then + AC_DEFINE(EXPORTED_KALLSYMS_ADDRESS) + fi + if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then + AC_DEFINE(COMPLETION_H_EXISTS, 1, [define if completion_h exists]) + fi + if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then + AC_DEFINE(DEFINED_FOR_EACH_PROCESS, 1, [define if for_each_process defined]) + fi + if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then + AC_DEFINE(DEFINED_PREV_TASK, 1, [define if prev_task defined]) + fi + if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then + AC_DEFINE(INODE_SETATTR_NOT_VOID, 1, [define if your setattr return return non-void]) + fi + if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then + AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, 1, [define if your struct address_space has page_lock]) + fi + if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then + AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, 1, [define if your struct address_space has gfp_mask]) + fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then + AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM, 1, [define if your struct inode has truncate_sem]) + fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" = "xyes"; then + AC_DEFINE(STRUCT_INODE_HAS_I_ALLOC_SEM, 1, [define if your struct inode has alloc_sem]) + fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then + AC_DEFINE(STRUCT_INODE_HAS_I_DEVICES, 1, [define if you struct inode has i_devices]) + fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then + AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, 1, [define if your struct inode has data_buffers]) + fi + if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then + AC_DEFINE(RECALC_SIGPENDING_TAKES_VOID, 1, [define if your recalc_sigpending takes void]) + fi + if test "x$ac_linux_syscall" = "xyes" ; then + AC_DEFINE(HAVE_KERNEL_LINUX_SYSCALL_H, 1, [define if your linux kernel has linux/syscall.h]) + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then + AC_DEFINE(STRUCT_TASK_STRUCT_HAS_PARENT, 1, [define if your struct task_struct has parent]) + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_real_parent" = "xyes"; then + AC_DEFINE(STRUCT_TASK_STRUCT_HAS_REAL_PARENT, 1, [define if your struct task_struct has real_parent]) + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then + AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK, 1, [define if your struct task_struct has sigmask_lock]) + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_sighand" = "xyes"; then + AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGHAND, 1, [define if your struct task_struct has sighand]) + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_sig" = "xyes"; then + AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIG, 1, [define if your struct task_struct has sig]) + fi + : + fi + ;; + *-solaris*) + MKAFS_OSTYPE=SOLARIS + AC_MSG_RESULT(sun4) + SOLARIS_UFSVFS_HAS_DQRWLOCK + SOLARIS_PROC_HAS_P_COREFILE + SOLARIS_FS_HAS_FS_ROLLED + ;; + *-sunos*) + MKAFS_OSTYPE=SUNOS + enable_kernel_module=no + AC_MSG_RESULT(sun4) + ;; + *-hpux*) + MKAFS_OSTYPE=HPUX + AC_MSG_RESULT(hp_ux) + ;; + *-irix*) + if test -d /usr/include/sys/SN/SN1; then + IRIX_BUILD_IP35="IP35" + fi + MKAFS_OSTYPE=IRIX + AC_MSG_RESULT(sgi) + ;; + *-aix*) + MKAFS_OSTYPE=AIX + AC_MSG_RESULT(rs_aix) + ;; + *-osf*) + MKAFS_OSTYPE=DUX + AC_MSG_RESULT(alpha_dux) + if test "x$enable_kernel_module" = "xyes"; then + if test "x$with_dux_kernel_headers" != "x"; then + HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'` + else + HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'` + fi + fi + if test "$HEADER_RT" = "*" ; then + AC_MSG_ERROR([Need a configured kernel directory]) + fi + AC_SUBST([HEADER_RT]) + ;; + *-darwin*) + MKAFS_OSTYPE=DARWIN + AC_MSG_RESULT(ppc_darwin) + ;; + *-freebsd*) + MKAFS_OSTYPE=FBSD + AC_MSG_RESULT(i386_fbsd) + ;; + *-netbsd*) + MKAFS_OSTYPE=NBSD + AC_MSG_RESULT(nbsd) + ;; + *-openbsd*) + MKAFS_OSTYPE=OBSD + AC_MSG_RESULT(i386_obsd) + ;; + *) + AC_MSG_RESULT($system) + ;; +esac + +if test "x$with_afs_sysname" != "x"; then + AFS_SYSNAME="$with_afs_sysname" +else + AC_MSG_CHECKING(your AFS sysname) + case $host in + i?86-*-openbsd3.1) + AFS_SYSNAME="i386_obsd31" + ;; + i?86-*-openbsd3.2) + AFS_SYSNAME="i386_obsd32" + ;; + i?86-*-openbsd3.3) + AFS_SYSNAME="i386_obsd33" + ;; + i?86-*-openbsd3.4) + AFS_SYSNAME="i386_obsd34" + ;; + i?86-*-openbsd3.5) + AFS_SYSNAME="i386_obsd35" + ;; + i?86-*-freebsd4.2*) + AFS_SYSNAME="i386_fbsd_42" + ;; + i?86-*-freebsd4.3*) + AFS_SYSNAME="i386_fbsd_43" + ;; + i?86-*-freebsd4.4*) + AFS_SYSNAME="i386_fbsd_44" + ;; + i?86-*-freebsd4.5*) + AFS_SYSNAME="i386_fbsd_45" + ;; + i?86-*-freebsd4.6*) + AFS_SYSNAME="i386_fbsd_46" + ;; + i?86-*-freebsd4.7*) + AFS_SYSNAME="i386_fbsd_47" + ;; + i?86-*-freebsd5.0*) + AFS_SYSNAME="i386_fbsd_50" + ;; + i?86-*-freebsd5.1*) + AFS_SYSNAME="i386_fbsd_51" + ;; + i?86-*-freebsd5.2*) + AFS_SYSNAME="i386_fbsd_52" + ;; + i?86-*-netbsd*1.5*) + AFS_PARAM_COMMON=param.nbsd15.h + AFS_SYSNAME="i386_nbsd15" + ;; + alpha-*-netbsd*1.5*) + AFS_PARAM_COMMON=param.nbsd15.h + AFS_SYSNAME="alpha_nbsd15" + ;; + i?86-*-netbsd*1.6[[M-Z]]*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="i386_nbsd20" + ;; + powerpc-*-netbsd*1.6[[M-Z]]*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="ppc_nbsd20" + ;; + i?86-*-netbsd*2.0*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="i386_nbsd20" + ;; + powerpc-*-netbsd*2.0*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="ppc_nbsd20" + ;; + i?86-*-netbsd*1.6*) + AFS_PARAM_COMMON=param.nbsd16.h + AFS_SYSNAME="i386_nbsd16" + ;; + alpha-*-netbsd*1.6*) + AFS_PARAM_COMMON=param.nbsd16.h + AFS_SYSNAME="alpha_nbsd16" + ;; + powerpc-*-netbsd*1.6*) + AFS_PARAM_COMMON=param.nbsd16.h + AFS_SYSNAME="ppc_nbsd16" + ;; + hppa*-hp-hpux11.0*) + AFS_SYSNAME="hp_ux110" + ;; + hppa*-hp-hpux11.11) + AFS_SYSNAME="hp_ux11i" + ;; + ia64-hp-hpux11.22) + AFS_SYSNAME="ia64_hpux1122" + ;; + ia64-hp-hpux*) + AFS_SYSNAME="ia64_hpux1123" + ;; + hppa*-hp-hpux10*) + AFS_SYSNAME="hp_ux102" + ;; + powerpc-apple-darwin1.2*) + AFS_SYSNAME="ppc_darwin_12" + ;; + powerpc-apple-darwin1.3*) + AFS_SYSNAME="ppc_darwin_13" + ;; + powerpc-apple-darwin1.4*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.1*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.2*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.3*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.4*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.5*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin6.0*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.1*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.2*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.3*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.4*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.5*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin7.0*) + AFS_SYSNAME="ppc_darwin_70" + ;; + powerpc-apple-darwin7.1*) + AFS_SYSNAME="ppc_darwin_70" + ;; + powerpc-apple-darwin7.2*) + AFS_SYSNAME="ppc_darwin_70" + ;; + powerpc-apple-darwin7.3*) + AFS_SYSNAME="ppc_darwin_70" + ;; + sparc-sun-solaris2.5*) + AFS_SYSNAME="sun4x_55" + enable_login="yes" + ;; + sparc-sun-solaris2.6) + AFS_SYSNAME="sun4x_56" + ;; + sparc-sun-solaris2.7) + AFS_SYSNAME="sun4x_57" + ;; + sparc-sun-solaris2.8) + AFS_SYSNAME="sun4x_58" + ;; + sparc-sun-solaris2.9) + AFS_SYSNAME="sun4x_59" + ;; + sparc-sun-sunos4*) + AFS_SYSNAME="sun4_413" + enable_login="yes" + ;; + i386-pc-solaris2.7) + AFS_SYSNAME="sunx86_57" + ;; + i386-pc-solaris2.8) + AFS_SYSNAME="sunx86_58" + ;; + i386-pc-solaris2.9) + AFS_SYSNAME="sunx86_59" + ;; + alpha*-dec-osf4.0*) + AFS_SYSNAME="alpha_dux40" + ;; + alpha*-dec-osf5.0*) + AFS_SYSNAME="alpha_dux50" + ;; + alpha*-dec-osf5.1*) + AFS_SYSNAME="alpha_dux51" + ;; + mips-sgi-irix6.5) + AFS_SYSNAME="sgi_65" + ;; + ia64-*-linux*) + AFS_SYSNAME="ia64_linuxXX" + ;; + powerpc-*-linux*) + AFS_SYSNAME="ppc_linuxXX" + ;; + powerpc64-*-linux*) + AFS_SYSNAME="ppc64_linuxXX" + ;; + alpha*-linux*) + AFS_SYSNAME="alpha_linux_XX" + ;; + s390-*-linux*) + AFS_SYSNAME="s390_linuxXX" + ;; + sparc-*-linux*) + AFS_SYSNAME="sparc_linuxXX" + ;; + sparc64-*-linux*) + AFS_SYSNAME="sparc64_linuxXX" + ;; + i?86-*-linux*) + AFS_SYSNAME="i386_linuxXX" + ;; + parisc-*-linux-gnu) + AFS_SYSNAME="parisc_linuxXX" + enable_pam="no" + ;; + power*-ibm-aix4.2*) + AFS_SYSNAME="rs_aix42" + ;; + power*-ibm-aix4.3*) + AFS_SYSNAME="rs_aix42" + ;; + power*-ibm-aix5.1*) + AFS_SYSNAME="rs_aix51" + ;; + power*-ibm-aix5.2*) + AFS_SYSNAME="rs_aix52" + ;; + x86_64-*-linux-gnu) + AFS_SYSNAME="amd64_linuxXX" + enable_pam="no" + ;; + *) + AC_MSG_ERROR(An AFS sysname is required) + exit 1 + ;; + esac + case $AFS_SYSNAME in + *_linux*) + AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $[]1 $[]2}'` + if test "x${AFS_SYSKVERS}" = "x"; then + AC_MSG_ERROR(Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname.) + fi + _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/` + AFS_SYSNAME="$_AFS_SYSNAME" + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-I${LINUX_KERNEL_PATH}/include $CPPFLAGS" + AC_TRY_COMPILE( + [#include ], + [#ifndef CONFIG_USERMODE + #error not UML + #endif], + ac_cv_linux_is_uml=yes,) + if test "${ac_cv_linux_is_uml}" = yes; then + _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/` + fi + CPPFLAGS="$save_CPPFLAGS" + AFS_SYSNAME="$_AFS_SYSNAME" + ;; + esac + AC_MSG_RESULT($AFS_SYSNAME) +fi + +# KDUMP64 defaults to KDUMP for systems without a separate kdump64 +KDUMP64='${KDUMP}' +KDUMP=kdump +case $AFS_SYSNAME in + sgi_6?) + KDUMP=kdump.IP20;; + sun4x_5[[789]] | hp_ux11*) + KDUMP=kdump32 + KDUMP64=kdump64;; + *linux*) + KDUMP='kdump-${LINUX_VERSION}';; +esac +AC_SUBST(KDUMP) +AC_SUBST(KDUMP64) + +case $AFS_SYSNAME in + *_darwin*) + DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist + DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist + dnl the test below fails on darwin, even if the CPPFLAGS below + dnl are added. the headers from Kernel.Framework must be used + dnl when KERNEL is defined. + + dnl really, such a thing isn't guaranteed to work on any + dnl platform until the kernel cflags from MakefileProto are + dnl known to configure + AC_DEFINE(HAVE_STRUCT_BUF, 1, [define if you have a struct buf]) + ;; + *) +AC_MSG_CHECKING(for definition of struct buf) +dnl save_CPPFLAGS="$CPPFLAGS" +dnl CPPFLAGS="$CPPFLAGS -DKERNEL -D_KERNEL -D__KERNEL -D__KERNEL__" +AC_CACHE_VAL(ac_cv_have_struct_buf, [ + ac_cv_have_struct_buf=no + AC_TRY_COMPILE( + [#include ], + [struct buf x; + printf("%d\n", sizeof(x));], + ac_cv_have_struct_buf=yes,) + ] +) +dnl CPPFLAGS="$save_CPPFLAGS" +AC_MSG_RESULT($ac_cv_have_struct_buf) +if test "$ac_cv_have_struct_buf" = yes; then + AC_DEFINE(HAVE_STRUCT_BUF, 1, [define if you have a struct buf]) +fi +;; +esac + + +AC_CACHE_VAL(ac_cv_sockaddr_len, +[ +AC_MSG_CHECKING([if struct sockaddr has sa_len field]) +AC_TRY_COMPILE( [#include +#include ], +[struct sockaddr *a; +a->sa_len=0;], ac_cv_sockaddr_len=yes, ac_cv_sockaddr_len=no) +AC_MSG_RESULT($ac_cv_sockaddr_len)]) +if test "$ac_cv_sockaddr_len" = "yes"; then + AC_DEFINE(STRUCT_SOCKADDR_HAS_SA_LEN, 1, [define if you struct sockaddr sa_len]) +fi +if test "x${MKAFS_OSTYPE}" = "xIRIX"; then + echo Skipping library tests because they confuse Irix. +else + AC_CHECK_FUNCS(socket) + + if test "$ac_cv_func_socket" = no; then + for lib in socket inet; do + if test "$HAVE_SOCKET" != 1; then + AC_CHECK_LIB(${lib}, socket,LIBS="$LIBS -l$lib";HAVE_SOCKET=1;AC_DEFINE(HAVE_SOCKET, 1, [define if you have socket])) + fi + done + fi + + AC_CHECK_FUNCS(connect) + + if test "$ac_cv_func_connect" = no; then + for lib in nsl; do + if test "$HAVE_CONNECT" != 1; then + AC_CHECK_LIB(${lib}, connect,LIBS="$LIBS -l$lib";HAVE_CONNECT=1;AC_DEFINE(HAVE_CONNECT, 1, [define if you have connect])) + fi + done + fi + + AC_CHECK_FUNCS(gethostbyname) + if test "$ac_cv_func_gethostbyname" = no; then + for lib in dns nsl resolv; do + if test "$HAVE_GETHOSTBYNAME" != 1; then + AC_CHECK_LIB(${lib}, gethostbyname, LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [define if you have gethostbyname])) + fi + done + fi + + dnl darwin wants it, aix hates it + AC_MSG_CHECKING(for the useability of arpa/nameser_compat.h) + AC_TRY_COMPILE([ + #include + #include + #include + #include + #include + #include + #include + #include + #include + ], [static int i; i = 0;], + [AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_ARPA_NAMESER_COMPAT_H)], + [AC_MSG_RESULT(no) + ]) + + openafs_save_libs="$LIBS" + AC_MSG_CHECKING([for res_search]) + AC_FUNC_RES_SEARCH + + if test "$ac_cv_func_res_search" = no; then + for lib in dns nsl resolv; do + if test "$ac_cv_func_res_search" != yes; then + LIBS="-l$lib $LIBS" + AC_FUNC_RES_SEARCH + LIBS="$openafs_save_libs" + fi + done + if test "$ac_cv_func_res_search" = yes; then + LIB_res_search="-l$lib" + AC_DEFINE(HAVE_RES_SEARCH, 1, []) + AC_MSG_RESULT([yes, in lib$lib]) + else + AC_MSG_RESULT(no) + fi + else + AC_DEFINE(HAVE_RES_SEARCH, 1, []) + AC_MSG_RESULT(yes) + fi + +fi + +PTHREAD_LIBS=error +AC_CHECK_LIB(pthread, pthread_attr_init, + PTHREAD_LIBS="-lpthread") +if test "x$PTHREAD_LIBS" = xerror; then + AC_CHECK_LIB(pthreads, pthread_attr_init, + PTHREAD_LIBS="-lpthreads") +fi +if test "x$PTHREAD_LIBS" = xerror; then + AC_CHECK_LIB(c_r, pthread_attr_init, + PTHREAD_LIBS="-lc_r") +fi +if test "x$PTHREAD_LIBS" = xerror; then + AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="") +fi +if test "x$PTHREAD_LIBS" = xerror; then + AC_MSG_WARN(*** Unable to locate working posix thread library ***) +fi +AC_SUBST(PTHREAD_LIBS) + +WITH_OBSOLETE=NO +if test "$enable_obsolete" = "yes"; then + WITH_OBSOLETE=YES +fi + +WITH_INSECURE=NO +if test "$enable_insecure" = "yes"; then + WITH_INSECURE=YES +fi + +if test "x$with_bsd_kernel_headers" != "x"; then + BSD_KERNEL_PATH="$with_bsd_kernel_headers" +else + BSD_KERNEL_PATH="/usr/src/sys" +fi + +if test "x$with_bsd_kernel_build" != "x"; then + BSD_KERNEL_BUILD="$with_bsd_kernel_build" +else + case $AFS_SYSNAME in + i386_fbsd_4?) + BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/compile/GENERIC" + ;; + i386_fbsd_5?) + BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/i386/compile/GENERIC" + ;; + esac +fi + +# Fast restart +if test "$enable_supergroups" = "yes"; then + AC_DEFINE(SUPERGROUPS, 1, [define if you want to have support for nested pts groups]) +fi + +if test "$enable_fast_restart" = "yes"; then + AC_DEFINE(FAST_RESTART, 1, [define if you want to have fast restart]) +fi + +if test "$enable_bitmap_later" = "yes"; then + AC_DEFINE(BITMAP_LATER, 1, [define if you want to salvager to check bitmasks later]) +fi + +if test "$enable_full_vos_listvol_switch" = "yes"; then + AC_DEFINE(FULL_LISTVOL_SWITCH, 1, [define if you want to want listvol switch]) +fi + +if test "$enable_bos_restricted_mode" = "yes"; then + AC_DEFINE(BOS_RESTRICTED_MODE, 1, [define if you want to want bos restricted mode]) +fi + +if test "$enable_bos_new_config" = "yes"; then + AC_DEFINE(BOS_NEW_CONFIG, 1, [define if you want to enable automatic renaming of BosConfig.new to BosConfig at startup]) +fi + +if test "$enable_largefile_fileserver" = "yes"; then + AC_DEFINE(AFS_LARGEFILE_ENV, 1, [define if you want large file fileserver]) +fi + +if test "$enable_namei_fileserver" = "yes"; then + AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver]) +fi + +if test "$enable_afsdb" = "yes"; then + LIB_AFSDB="$LIB_res_search" + AC_DEFINE(AFS_AFSDB_ENV, 1, [define if you want to want search afsdb rr]) +fi + +dnl check for tivoli +AC_MSG_CHECKING(for tivoli tsm butc support) +XBSA_CFLAGS="" +if test "$enable_tivoli_tsm" = "yes"; then + XBSADIR1=/usr/tivoli/tsm/client/api/bin/xopen + XBSADIR2=/opt/tivoli/tsm/client/api/bin/xopen + + if test -e "$XBSADIR1/xbsa.h"; then + XBSA_CFLAGS="-Dxbsa -I$XBSADIR1" + AC_MSG_RESULT([yes, $XBSA_CFLAGS]) + elif test -e "$XBSADIR2/xbsa.h"; then + XBSA_CFLAGS="-Dxbsa -I$XBSADIR2" + AC_MSG_RESULT([yes, $XBSA_CFLAGS]) + else + AC_MSG_RESULT([no, missing xbsa.h header file]) + fi +else + AC_MSG_RESULT([no]) +fi +AC_SUBST(XBSA_CFLAGS) + +dnl checks for header files. +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_HEADER_DIRENT +AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h) +AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h) +AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h sys/fstyp.h) +AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h) +AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h sys/user.h) +AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h regex.h) + +if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_pam" = yes; then + HAVE_PAM="yes" +else + HAVE_PAM="no" +fi +AC_SUBST(HAVE_PAM) + +if test "$enable_login" = yes; then + BUILD_LOGIN="yes" +else + BUILD_LOGIN="no" +fi +AC_SUBST(BUILD_LOGIN) + +AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf strlcat strlcpy re_comp re_exec) +AC_CHECK_FUNCS(setprogname getprogname sigaction mkstemp vsnprintf strerror) + +AC_CHECK_FUNCS(regcomp regexec regerror) +AC_MSG_CHECKING([for POSIX regex library]) +if test "$ac_cv_header_regex_h" = "yes" && \ + test "$ac_cv_func_regcomp" = "yes" && \ + test "$ac_cv_func_regexec" = "yes" && \ + test "$ac_cv_func_regerror" = "yes"; then + AC_DEFINE(HAVE_POSIX_REGEX, 1, [define if you have POSIX regex library]) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +AC_CHECK_TYPE(ssize_t, int) +AC_SIZEOF_TYPE(long) + +AC_CHECK_FUNCS(timegm) + +dnl Directory PATH handling +if test "x$enable_transarc_paths" = "xyes" ; then + afsconfdir=${afsconfdir=/usr/afs/etc} + viceetcdir=${viceetcdir=/usr/vice/etc} + afskerneldir=${afskerneldir=${viceetcdir}} + afssrvbindir=${afssrvbindir=/usr/afs/bin} + afssrvsbindir=${afssrvsbindir=/usr/afs/bin} + afssrvlibexecdir=${afssrvlibexecdir=/usr/afs/bin} + afsdbdir=${afsdbdir=/usr/afs/db} + afslogsdir=${afslogsdir=/usr/afs/logs} + afslocaldir=${afslocaldir=/usr/afs/local} + afsbackupdir=${afsbackupdir=/usr/afs/backup} + afsbosconfigdir=${afsbosconfigdir=/usr/afs/local} +else + afsconfdir=${afsconfdir='${sysconfdir}/openafs/server'} + viceetcdir=${viceetcdir='${sysconfdir}/openafs'} + afskerneldir=${afskerneldir='${libdir}/openafs'} + afssrvbindir=${afssrvbindir='${bindir}'} + afssrvsbindir=${afssrvsbindir='${sbindir}'} + afssrvlibexecdir=${afssrvlibexecdir='${libexecdir}/openafs'} + afsdbdir=${afsdbdir='${localstatedir}/openafs/db'} + afslogsdir=${afslogsdir='${localstatedir}/openafs/logs'} + afslocaldir=${afslocaldir='${localstatedir}/openafs'} + afsbackupdir=${afsbackupdir='${localstatedir}/openafs/backup'} + afsbosconfigdir=${afsbosconfigdir='${sysconfdir}/openafs'} +fi +AC_SUBST(afsconfdir) +AC_SUBST(viceetcdir) +AC_SUBST(afskerneldir) +AC_SUBST(afssrvbindir) +AC_SUBST(afssrvsbindir) +AC_SUBST(afssrvlibexecdir) +AC_SUBST(afsdbdir) +AC_SUBST(afslogsdir) +AC_SUBST(afslocaldir) +AC_SUBST(afsbackupdir) +AC_SUBST(afsbosconfigdir) + +if test "x$enable_kernel_module" = "xyes"; then +ENABLE_KERNEL_MODULE=libafs +fi + +AC_SUBST(AFS_SYSNAME) +AC_SUBST(AFS_PARAM_COMMON) +AC_SUBST(ENABLE_KERNEL_MODULE) +AC_SUBST(LIB_AFSDB) +AC_SUBST(LINUX_KERNEL_PATH) +AC_SUBST(BSD_KERNEL_PATH) +AC_SUBST(BSD_KERNEL_BUILD) +AC_SUBST(LINUX_VERSION) +AC_SUBST(MKAFS_OSTYPE) +AC_SUBST(TOP_OBJDIR) +AC_SUBST(TOP_SRCDIR) +AC_SUBST(TOP_INCDIR) +AC_SUBST(TOP_LIBDIR) +AC_SUBST(DEST) +AC_SUBST(WITH_OBSOLETE) +AC_SUBST(WITH_INSECURE) +AC_SUBST(DARWIN_INFOFILE) +AC_SUBST(IRIX_BUILD_IP35) + +OPENAFS_OSCONF + +TOP_SRCDIR="${srcdir}/src" +dnl +dnl If we're using ./configure, need a more reasonable TOP_SRCDIR, since relative links don't work everywhere +dnl +case $TOP_SRCDIR in + /*) + ;; + *) + TOP_SRCDIR=`cd $TOP_SRCDIR; pwd` + ;; +esac + +TOP_OBJDIR="${SRCDIR_PARENT}" +TOP_INCDIR="${SRCDIR_PARENT}/include" +TOP_LIBDIR="${SRCDIR_PARENT}/lib" +if test "${DEST}x" = "x"; then + DEST="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest" +fi + +HELPER_SPLINT="${TOP_SRCDIR}/helper-splint.sh" +HELPER_SPLINTCFG="${TOP_SRCDIR}/splint.cfg" +AC_SUBST(HELPER_SPLINT) +AC_SUBST(HELPER_SPLINTCFG) + + +]) + +AC_DEFUN(COMPILER_HAS_FUNCTION_MACRO, [ +AC_MSG_CHECKING(for __FUNCTION__ and __LINE__ macros) +AC_CACHE_VAL(ac_cv_compiler_has_function_macro, +[ +AC_TRY_COMPILE( +[#include ], +[printf("%s:%d", __FUNCTION__, __LINE__);], +ac_cv_compiler_has_function_macro=yes, +ac_cv_compiler_has_function_macro=no)]) +AC_MSG_RESULT($ac_cv_compiler_has_function_macro) +if test "$ac_cv_compiler_has_function_macro" = "yes"; then + AC_DEFINE(HAVE_FUNCTION_MACRO, 1, [define if compiler has __FUNCTION__]) +fi +]) + + + +dnl AM_PROG_LEX +dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT +AC_DEFUN(AM_PROG_LEX, +[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) +AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex") +AC_PROG_LEX +AC_DECL_YYTEXT]) + +dnl +dnl $Id: bigendian.m4,v 1.2 2001/06/28 05:03:55 shadow Exp $ +dnl + +dnl check if this computer is little or big-endian +dnl if we can figure it out at compile-time then don't define the cpp symbol +dnl otherwise test for it and define it. also allow options for overriding +dnl it when cross-compiling + +AC_DEFUN(OPENAFS_CHECK_BIGENDIAN, [ +AC_ARG_ENABLE(bigendian, +[ --enable-bigendian the target is big endian], +openafs_cv_c_bigendian=yes) +AC_ARG_ENABLE(littleendian, +[ --enable-littleendian the target is little endian], +openafs_cv_c_bigendian=no) +AC_CACHE_CHECK(whether byte order is known at compile time, +openafs_cv_c_bigendian_compile, +[AC_TRY_COMPILE([ +#include +#include ],[ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif], openafs_cv_c_bigendian_compile=yes, openafs_cv_c_bigendian_compile=no)]) +AC_CACHE_CHECK(whether byte ordering is bigendian, openafs_cv_c_bigendian,[ + if test "$openafs_cv_c_bigendian_compile" = "yes"; then + AC_TRY_COMPILE([ +#include +#include ],[ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif], openafs_cv_c_bigendian=yes, openafs_cv_c_bigendian=no) + else + AC_TRY_RUN([main () { + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); + }], openafs_cv_c_bigendian=no, openafs_cv_c_bigendian=yes, + AC_MSG_ERROR([specify either --enable-bigendian or --enable-littleendian])) + fi +]) +if test "$openafs_cv_c_bigendian" = "yes"; then + AC_DEFINE(WORDS_BIGENDIAN, 1, [define if target is big endian])dnl +fi +if test "$openafs_cv_c_bigendian_compile" = "yes"; then + AC_DEFINE(ENDIANESS_IN_SYS_PARAM_H, 1, [define if sys/param.h defines the endiness])dnl +fi +]) + + +AC_DEFUN(OPENAFS_GCC_SUPPORTS_MARCH, [ +AC_MSG_CHECKING(if $CC accepts -march=pentium) +save_CFLAGS="$CFLAGS" +CFLAGS="-MARCH=pentium" +AC_CACHE_VAL(openafs_gcc_supports_march,[ +AC_TRY_COMPILE( +[], +[int x;], +openafs_gcc_supports_march=yes, +openafs_gcc_supports_march=no)]) +AC_MSG_RESULT($openafs_gcc_supports_march) +if test x$openafs_gcc_supports_march = xyes; then + P5PLUS_KOPTS="-march=pentium" +else + P5PLUS_KOPTS="-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2" +fi +CFLAGS="$save_CFLAGS" +]) + +AC_DEFUN(OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING, [ +AC_MSG_CHECKING(if $CC needs -fno-strict-aliasing) +save_CFLAGS="$CFLAGS" +CFLAGS="-fno-strict-aliasing" +AC_CACHE_VAL(openafs_gcc_needs_no_strict_aliasing,[ +AC_TRY_COMPILE( +[], +[int x;], +openafs_gcc_needs_no_strict_aliasing=yes, +openafs_gcc_needs_no_strict_aliasing=no)]) +AC_MSG_RESULT($openafs_gcc_needs_no_strict_aliasing) +if test x$openafs_gcc_needs_no_strict_aliasing = xyes; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strict-aliasing" +fi +CFLAGS="$save_CFLAGS" +]) + +AC_DEFUN(OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE, [ +AC_MSG_CHECKING(if $CC needs -fno-strength-reduce) +save_CFLAGS="$CFLAGS" +CFLAGS="-fno-strength-reduce" +AC_CACHE_VAL(openafs_gcc_needs_no_strength_reduce,[ +AC_TRY_COMPILE( +[], +[int x;], +openafs_gcc_needs_no_strength_reduce=yes, +openafs_gcc_needs_no_strength_reduce=no)]) +AC_MSG_RESULT($openafs_gcc_needs_no_strength_reduce) +if test x$openafs_gcc_needs_no_strength_reduce = xyes; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strength-reduce" +fi +CFLAGS="$save_CFLAGS" +]) + +AC_DEFUN(OPENAFS_GCC_SUPPORTS_NO_COMMON, [ +AC_MSG_CHECKING(if $CC supports -fno-common) +save_CFLAGS="$CFLAGS" +CFLAGS="-fno-common" +AC_CACHE_VAL(openafs_gcc_supports_no_common,[ +AC_TRY_COMPILE( +[], +[int x;], +openafs_gcc_supports_no_common=yes, +openafs_gcc_supports_no_common=no)]) +AC_MSG_RESULT($openafs_gcc_supports_no_common) +if test x$openafs_gcc_supports_no_common = xyes; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-common" +fi +CFLAGS="$save_CFLAGS" +]) + +AC_DEFUN(OPENAFS_GCC_SUPPORTS_PIPE, [ +AC_MSG_CHECKING(if $CC supports -pipe) +save_CFLAGS="$CFLAGS" +CFLAGS="-pipe" +AC_CACHE_VAL(openafs_gcc_supports_pipe,[ +AC_TRY_COMPILE( +[], +[int x;], +openafs_gcc_supports_pipe=yes, +openafs_gcc_supports_pipe=no)]) +AC_MSG_RESULT($openafs_gcc_supports_pipe) +if test x$openafs_gcc_supports_pipe = xyes; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -pipe" +fi +CFLAGS="$save_CFLAGS" +]) + +AC_DEFUN(LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, [ +AC_MSG_CHECKING(for gfp_mask in struct address_space) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_gfp_mask, +[ +AC_TRY_COMPILE( +[#include ], +[struct address_space _a; +printf("%d\n", _a.gfp_mask);], +ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes, +ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask) +CPPFLAGS="$save_CPPFLAGS"]) + +AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_BYTES, [ +AC_MSG_CHECKING(for i_bytes in struct inode) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_bytes, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _inode; +printf("%d\n", _inode.i_bytes);], +ac_cv_linux_fs_struct_inode_has_i_bytes=yes, +ac_cv_linux_fs_struct_inode_has_i_bytes=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes) +CPPFLAGS="$save_CPPFLAGS"]) + +AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM, [ +AC_MSG_CHECKING(for i_alloc_sem in struct inode) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_alloc_sem, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _i; +printf("%x\n", _i.i_alloc_sem);], +ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes, +ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_alloc_sem) +CPPFLAGS="$save_CPPFLAGS"]) + +AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM, [ +AC_MSG_CHECKING(for i_truncate_sem in struct inode) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_truncate_sem, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _i; +printf("%x\n", _i.i_truncate_sem);], +ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes, +ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem) +CPPFLAGS="$save_CPPFLAGS"]) + +AC_DEFUN(LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, [ +AC_MSG_CHECKING(for page_lock in struct address_space) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_page_lock, +[ +AC_TRY_COMPILE( +[#include ], +[struct address_space _a_s; +printf("%x\n", _a_s.page_lock);], +ac_cv_linux_fs_struct_address_space_has_page_lock=yes, +ac_cv_linux_fs_struct_address_space_has_page_lock=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock) +CPPFLAGS="$save_CPPFLAGS"]) + + +dnl LINUX_BUILD_VNODE_FROM_INODE (configdir, outputdir, tmpldir) +dnl defaults: (src/config, src/afs/LINUX, src/afs/linux) + +AC_DEFUN(LINUX_BUILD_VNODE_FROM_INODE, [ +AC_MSG_CHECKING(whether to build osi_vfs.h) +configdir=ifelse([$1], ,[src/config],$1) +outputdir=ifelse([$2], ,[src/afs/LINUX],$2) +tmpldir=ifelse([$3], ,[src/afs/LINUX],$3) +chmod +x $configdir/make_vnode.pl +$configdir/make_vnode.pl -i $LINUX_KERNEL_PATH -t ${tmpldir} -o $outputdir +]) + +AC_DEFUN(LINUX_COMPLETION_H_EXISTS, [ +AC_MSG_CHECKING(for linux/completion.h existance) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_completion_h_exists, +[ +AC_TRY_COMPILE( +[#include +#include ], +[struct completion _c; +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8) +lose +#endif +], +ac_cv_linux_completion_h_exists=yes, +ac_cv_linux_completion_h_exists=no)]) +AC_MSG_RESULT($ac_cv_linux_completion_h_exists) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_DEFINES_FOR_EACH_PROCESS, [ +AC_MSG_CHECKING(for defined for_each_process) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_defines_for_each_process, +[ +AC_TRY_COMPILE( +[#include ], +[#ifndef for_each_process(p) +#error for_each_process not defined +#endif], +ac_cv_linux_defines_for_each_process=yes, +ac_cv_linux_defines_for_each_process=no)]) +AC_MSG_RESULT($ac_cv_linux_defines_for_each_process) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_DEFINES_PREV_TASK, [ +AC_MSG_CHECKING(for defined prev_task) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_defines_prev_task, +[ +AC_TRY_COMPILE( +[#include ], +[#ifndef prev_task(p) +#error prev_task not defined +#endif], +ac_cv_linux_defines_prev_task=yes, +ac_cv_linux_defines_prev_task=no)]) +AC_MSG_RESULT($ac_cv_linux_defines_prev_task) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_EXPORTS_INIT_MM, [ +AC_MSG_CHECKING(for exported init_mm) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_exports_init_mm, +[ +AC_TRY_COMPILE( +[#include ], +[#ifndef __ver_init_mm +#error init_mm not exported +#endif], +ac_cv_linux_exports_init_mm=yes, +ac_cv_linux_exports_init_mm=no)]) +AC_MSG_RESULT($ac_cv_linux_exports_init_mm) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_EXPORTS_KALLSYMS_ADDRESS, [ +AC_MSG_CHECKING(for exported kallsyms_address_to_symbol) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_address, +[ +AC_TRY_COMPILE( +[#include ], +[#ifndef __ver_kallsyms_address_to_symbol +#error kallsyms_address_to_symbol not exported +#endif], +ac_cv_linux_exports_kallsyms_address=yes, +ac_cv_linux_exports_kallsyms_address=no)]) +AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_EXPORTS_KALLSYMS_SYMBOL, [ +AC_MSG_CHECKING(for exported kallsyms_symbol_to_address) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_symbol, +[ +AC_TRY_COMPILE( +[#include ], +[#ifndef __ver_kallsyms_symbol_to_address +#error kallsyms_symbol_to_address not exported +#endif], +ac_cv_linux_exports_kallsyms_symbol=yes, +ac_cv_linux_exports_kallsyms_symbol=no)]) +AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_EXPORTS_SYS_CALL_TABLE, [ +AC_MSG_CHECKING(for exported sys_call_table) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_exports_sys_call_table, +[ +AC_TRY_COMPILE( +[#include ], +[#ifndef __ver_sys_call_table +#error sys_call_table not exported +#endif], +ac_cv_linux_exports_sys_call_table=yes, +ac_cv_linux_exports_sys_call_table=no)]) +AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_EXPORTS_IA32_SYS_CALL_TABLE, [ +AC_MSG_CHECKING(for exported ia32_sys_call_table) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_exports_ia32_sys_call_table, +[ +AC_TRY_COMPILE( +[#include ], +[#ifndef __ver_ia32_sys_call_table +#error ia32_sys_call_table not exported +#endif], +ac_cv_linux_exports_ia32_sys_call_table=yes, +ac_cv_linux_exports_ia32_sys_call_table=no)]) +AC_MSG_RESULT($ac_cv_linux_exports_ia32_sys_call_table) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_EXPORTS_SYS_CHDIR, [ +AC_MSG_CHECKING(for exported sys_chdir) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_exports_sys_chdir, +[ +AC_TRY_COMPILE( +[#include ], +[#ifndef __ver_sys_chdir +#error sys_chdir not exported +#endif], +ac_cv_linux_exports_sys_chdir=yes, +ac_cv_linux_exports_sys_chdir=no)]) +AC_MSG_RESULT($ac_cv_linux_exports_sys_chdir) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_EXPORTS_SYS_CLOSE, [ +AC_MSG_CHECKING(for exported sys_close) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_exports_sys_close, +[ +AC_TRY_COMPILE( +[#include ], +[#ifndef __ver_sys_close +#error sys_close not exported +#endif], +ac_cv_linux_exports_sys_close=yes, +ac_cv_linux_exports_sys_close=no)]) +AC_MSG_RESULT($ac_cv_linux_exports_sys_close) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_EXPORTS_SYS_WAIT4, [ +AC_MSG_CHECKING(for exported sys_wait4) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_exports_sys_wait4, +[ +AC_TRY_COMPILE( +[#include ], +[#ifndef __ver_sys_wait4 +#error sys_wait4 not exported +#endif], +ac_cv_linux_exports_sys_wait4=yes, +ac_cv_linux_exports_sys_wait4=no)]) +AC_MSG_RESULT($ac_cv_linux_exports_sys_wait4) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_EXPORTS_TASKLIST_LOCK, [ +AC_MSG_CHECKING(for exported tasklist_lock) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_exports_tasklist_lock, +[ +AC_TRY_COMPILE( +[#include ], +[#ifndef __ver_tasklist_lock +#error tasklist_lock not exported +#endif], +ac_cv_linux_exports_tasklist_lock=yes, +ac_cv_linux_exports_tasklist_lock=no)]) +AC_MSG_RESULT($ac_cv_linux_exports_tasklist_lock) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_CDEV, [ +AC_MSG_CHECKING(for i_cdev in struct inode) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _inode; +printf("%d\n", _inode.i_cdev);], +ac_cv_linux_fs_struct_inode_has_i_cdev=yes, +ac_cv_linux_fs_struct_inode_has_i_cdev=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DEVICES, [ +AC_MSG_CHECKING(for i_devices in struct inode) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _inode; +printf("%d\n", _inode.i_devices);], +ac_cv_linux_fs_struct_inode_has_i_devices=yes, +ac_cv_linux_fs_struct_inode_has_i_devices=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, [ +AC_MSG_CHECKING(for i_dirty_data_buffers in struct inode) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _inode; +printf("%d\n", _inode.i_dirty_data_buffers);], +ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes, +ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD, [ +AC_MSG_CHECKING(for i_mapping_overload in struct inode) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mapping_overload, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _inode; +printf("%d\n", _inode.i_mapping_overload);], +ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes, +ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED, [ +AC_MSG_CHECKING(for i_mmap_shared in struct inode) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mmap_shared, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _inode; +printf("%d\n", _inode.i_mmap_shared);], +ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes, +ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_RECALC_SIGPENDING_ARG_TYPE,[ +AC_MSG_CHECKING(for recalc_sigpending arg type) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_func_recalc_sigpending_takes_void, +[ +AC_TRY_COMPILE( +[#include ], +[recalc_sigpending();], +ac_cv_linux_func_recalc_sigpending_takes_void=yes, +ac_cv_linux_func_recalc_sigpending_takes_void=no)]) +AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT, [ +AC_MSG_CHECKING(for parent in struct task_struct) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_parent, +[ +AC_TRY_COMPILE( +[#include ], +[struct task_struct _tsk; +printf("%d\n", _tsk.parent);], +ac_cv_linux_sched_struct_task_struct_has_parent=yes, +ac_cv_linux_sched_struct_task_struct_has_parent=no)]) +AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT, [ +AC_MSG_CHECKING(for real_parent in struct task_struct) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_real_parent, +[ +AC_TRY_COMPILE( +[#include ], +[struct task_struct _tsk; +printf("%d\n", _tsk.real_parent);], +ac_cv_linux_sched_struct_task_struct_has_real_parent=yes, +ac_cv_linux_sched_struct_task_struct_has_real_parent=no)]) +AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_real_parent) +CPPFLAGS="$save_CPPFLAGS"]) + + +AC_DEFUN(LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG, [ +AC_MSG_CHECKING(for sig in struct task_struct) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_sig, +[ +AC_TRY_COMPILE( +[#include ], +[struct task_struct _tsk; +printf("%d\n", _tsk.sig);], +ac_cv_linux_sched_struct_task_struct_has_sig=yes, +ac_cv_linux_sched_struct_task_struct_has_sig=no)]) +AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sig) +CPPFLAGS="$save_CPPFLAGS"]) + +AC_DEFUN(LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK, [ +AC_MSG_CHECKING(for sigmask_lock in struct task_struct) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_sigmask_lock, +[ +AC_TRY_COMPILE( +[#include ], +[struct task_struct _tsk; +printf("%d\n", _tsk.sigmask_lock);], +ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes, +ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)]) +AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock) +CPPFLAGS="$save_CPPFLAGS"]) + +AC_DEFUN(LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND, [ +AC_MSG_CHECKING(for sighand in struct task_struct) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_sighand, +[ +AC_TRY_COMPILE( +[#include ], +[struct task_struct _tsk; +printf("%d\n", _tsk.sighand);], +ac_cv_linux_sched_struct_task_struct_has_sighand=yes, +ac_cv_linux_sched_struct_task_struct_has_sighand=no)]) +AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand) +CPPFLAGS="$save_CPPFLAGS"]) + +AC_DEFUN(LINUX_INODE_SETATTR_RETURN_TYPE,[ +AC_MSG_CHECKING(for inode_setattr return type) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_func_inode_setattr_returns_int, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _inode; +struct iattr _iattr; +int i; +i = inode_setattr(&_inode, &_iattr);], +ac_cv_linux_func_inode_setattr_returns_int=yes, +ac_cv_linux_func_inode_setattr_returns_int=no)]) +AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int) +CPPFLAGS="$save_CPPFLAGS"]) + +AC_DEFUN(LINUX_KERNEL_LINUX_SYSCALL_H,[ + AC_MSG_CHECKING(for linux/syscall.h in kernel) + if test -f "${LINUX_KERNEL_PATH}/include/linux/syscall.h"; then + ac_linux_syscall=yes + AC_MSG_RESULT($ac_linux_syscall) + else + ac_linux_syscall=no + AC_MSG_RESULT($ac_linux_syscall) + fi +]) + +AC_DEFUN(LINUX_NEED_RHCONFIG,[ +RHCONFIG_SP="" +RHCONFIG_MP="" +if test "x$enable_redhat_buildsys" = "xyes"; then + AC_MSG_WARN(Configured to build from a Red Hat SPEC file) +else + AC_MSG_CHECKING(for redhat kernel configuration) + if test -f "${LINUX_KERNEL_PATH}/include/linux/rhconfig.h"; then + ac_linux_rhconfig=yes + RHCONFIG_SP="-D__BOOT_KERNEL_UP=1 -D__BOOT_KERNEL_SMP=0" + RHCONFIG_MP="-D__BOOT_KERNEL_UP=0 -D__BOOT_KERNEL_SMP=1" + AC_MSG_RESULT($ac_linux_rhconfig) + if test ! -f "/boot/kernel.h"; then + AC_MSG_WARN([/boot/kernel.h does not exist. build may fail]) + fi + else + ac_linux_rhconfig=no + AC_MSG_RESULT($ac_linux_rhconfig) + fi +fi +AC_SUBST(RHCONFIG_SP) +AC_SUBST(RHCONFIG_MP) +]) + +AC_DEFUN(LINUX_WHICH_MODULES,[ +if test "x$enable_redhat_buildsys" = "xyes"; then + MPS=Default +else + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS" + AC_MSG_CHECKING(if kernel uses MODVERSIONS) + AC_CACHE_VAL(ac_cv_linux_config_modversions,[ + AC_TRY_COMPILE( +[#include +#include +], +[#if !defined(CONFIG_MODVERSIONS) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) +lose; +#endif +], + ac_cv_linux_config_modversions=yes, + ac_cv_linux_config_modversions=no)]) + AC_MSG_RESULT($ac_cv_linux_config_modversions) + AC_MSG_CHECKING(which kernel modules to build) + if test "x$ac_linux_rhconfig" = "xyes" -o "x$ac_cv_linux_config_modversions" = "xno"; then + MPS="MP SP" + else + AC_CACHE_VAL(ac_cv_linux_config_smp, [ + AC_TRY_COMPILE( +[#include +], +[#ifndef CONFIG_SMP +lose; +#endif +], + ac_cv_linux_config_smp=yes, + ac_cv_linux_config_smp=no)]) + dnl AC_MSG_RESULT($ac_cv_linux_config_smp) + if test "x$ac_cv_linux_config_smp" = "xyes"; then + MPS=MP + else + MPS=SP + fi + fi + CPPFLAGS=$save_CPPFLAGS + AC_MSG_RESULT($MPS) +fi +AC_SUBST(MPS) +]) + + +AC_DEFUN(SOLARIS_UFSVFS_HAS_DQRWLOCK, [ +AC_MSG_CHECKING(for vfs_dqrwlock in struct ufsvfs) +AC_CACHE_VAL(ac_cv_solaris_ufsvfs_has_dqrwlock, +[ +AC_TRY_COMPILE( +[#define _KERNEL +#include ], +[struct ufsvfs _ufsvfs; +(void) _ufsvfs.vfs_dqrwlock;], +ac_cv_solaris_ufsvfs_has_dqrwlock=yes, +ac_cv_solaris_ufsvfs_has_dqrwlock=no)]) +AC_MSG_RESULT($ac_cv_solaris_ufsvfs_has_dqrwlock) +if test "$ac_cv_solaris_ufsvfs_has_dqrwlock" = "yes"; then + AC_DEFINE(HAVE_VFS_DQRWLOCK, 1, [define if struct ufsvfs has vfs_dqrwlock]) +fi +]) + + +AC_DEFUN(SOLARIS_PROC_HAS_P_COREFILE, [ +AC_MSG_CHECKING(for p_corefile in struct proc) +AC_CACHE_VAL(ac_cv_solaris_proc_has_p_corefile, +[ +AC_TRY_COMPILE( +[#define _KERNEL +#include ], +[struct proc _proc; +(void) _proc.p_corefile;], +ac_cv_solaris_proc_has_p_corefile=yes, +ac_cv_solaris_proc_has_p_corefile=no)]) +AC_MSG_RESULT($ac_cv_solaris_proc_has_p_corefile) +if test "$ac_cv_solaris_proc_has_p_corefile" = "yes"; then + AC_DEFINE(HAVE_P_COREFILE, 1, [define if struct proc has p_corefile]) +fi +]) + + +AC_DEFUN(SOLARIS_FS_HAS_FS_ROLLED, [ +AC_MSG_CHECKING(for fs_rolled in struct proc) +AC_CACHE_VAL(ac_cv_solaris_fs_has_fs_rolled, +[ +AC_TRY_COMPILE( +[#include ], +[struct fs _fs; +(void) _fs.fs_rolled;], +ac_cv_solaris_fs_has_fs_rolled=yes, +ac_cv_solaris_fs_has_fs_rolled=no)]) +AC_MSG_RESULT($ac_cv_solaris_fs_has_fs_rolled) +if test "$ac_cv_solaris_fs_has_fs_rolled" = "yes"; then + AC_DEFINE(STRUCT_FS_HAS_FS_ROLLED, 1, [define if struct fs has fs_rolled]) +fi +]) + + +AC_DEFUN(AC_FUNC_RES_SEARCH, [ + ac_cv_func_res_search=no + AC_TRY_LINK([ +#include +#include +#include +#ifdef HAVE_ARPA_NAMESER_COMPAT_H +#include +#endif +#include ], + [ +const char host[11]="openafs.org"; +u_char ans[1024]; +int r; +res_init(); +/* Capture result in r but return 0, since a working nameserver is + * not a requirement for compilation. + */ +r = res_search( host, C_IN, T_MX, (u_char *)&ans, sizeof(ans)); +return 0; + ], + ac_cv_func_res_search=yes) +]) + + +AC_DEFUN(OPENAFS_OSCONF, [ + +dnl defaults, override in case below as needed +XCFLAGS='${DBG} ${OPTMZ}' +SHLIB_SUFFIX="so" +CC="cc" +CCOBJ="cc" +MT_CC="cc" +XLIBS="${LIB_AFSDB}" + +dnl debugging and optimization flag defaults +dnl Note, these are all the defaults for if debug/optimize turned on, and +dnl the arch cases below do not override +KERN_DBG=-g +KERN_OPTMZ=-O +DBG=-g +OPTMZ=-O +LWP_DBG=-g +LWP_OPTMZ=-O + +dnl standard programs +AC_PROG_RANLIB +AC_CHECK_PROGS(AS, as, [${am_missing_run}as]) +AC_CHECK_PROGS(AR, ar, [${am_missing_run}ar]) +AC_CHECK_PROGS(MV, mv, [${am_missing_run}mv]) +AC_CHECK_PROGS(RM, rm, [${am_missing_run}rm]) +AC_CHECK_PROGS(LD, ld, [${am_missing_run}ld]) +AC_CHECK_PROGS(CP, cp, [${am_missing_run}cp]) +AC_CHECK_PROGS(STRIP, strip, [${am_missing_run}strip]) +AC_CHECK_PROGS(LORDER, lorder, [${am_missing_run}lorder]) + +dnl TODO - need to disable STRIP if we are doing debugging in any user space code + +case $AFS_SYSNAME in + alpha_dux40) + LEX="lex" + CSTATIC="-non_shared" + DBG="-g3" + MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-pthread -lpthread -lmach -lexc -lc" + TXLIBS="-lcurses" + XCFLAGS="-D_NO_PROTO -DOSF" + SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\"" + ;; + + alpha_dux50) + LEX="flex -l" + DBG="-g3" + CSTATIC="-non_shared" + MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-pthread -lpthread -lmach -lexc -lc" + TXLIBS="-lcurses" + XCFLAGS="-D_NO_PROTO -DOSF" + SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\"" + ;; + + alpha_dux51) + LEX="flex -l" + DBG="-g3" + CSTATIC="-non_shared" + LWP_OPTMZ="-O2" + MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-pthread -lpthread -lmach -lexc -lc" + TXLIBS="-lcurses" + XCFLAGS="-D_NO_PROTO -DOSF" + SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\"" + ;; + + alpha_linux_22) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + alpha_linux_24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + hp_ux102) + AS="/usr/ccs/bin/as" + CC="/opt/ansic/bin/cc -Ae" + DBM="/lib/libndbm.a" + LD="/bin/ld" + LEX="/opt/langtools/bin/lex" + LWP_OPTMZ="-O" + MT_CC="/opt/ansic/bin/cc -Ae" + MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-L/opt/dce/lib -ldce" + MV="/bin/mv" + OPTMZ="-O" + PAM_CFLAGS="+DA1.0 +z -Wl,+k" + PAM_LIBS="/usr/lib/libpam.1" + RANLIB="/usr/bin/ranlib" + RM="/bin/rm" + SHLIB_LDFLAGS="-b -Bsymbolic" + SHLIB_SUFFIX="sl" + TXLIBS="/usr/lib/libHcurses.a" + VFSCK_CFLAGS="-D_FILE64" + XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE" + XCFLAGS64="${XCFLAGS0} +DA2.0W" + XCFLAGS="${XCFLAGS0} +DA1.0" + YACC="/opt/langtools/bin/yacc" + SHLIB_LINKER="ld -b" + ;; + + hp_ux11*) + AR="/usr/bin/ar" + AS="/usr/ccs/bin/as" + CC="/opt/ansic/bin/cc" + CCOBJ="/opt/ansic/bin/cc" + DBM="/lib/libndbm.a" + LD="/bin/ld " + LEX="/opt/langtools/bin/lex" + LWP_OPTMZ="-O" + MT_CC="$CC" + MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + MV="/bin/mv" + OPTMZ="-O" + PAM_CFLAGS="+DA1.0 +z -Wl,+k" + PAM_LIBS="/usr/lib/libpam.1" + RANLIB="/usr/bin/ranlib" + RM="/bin/rm" + SHLIB_LDFLAGS="-b -Bsymbolic" + SHLIB_SUFFIX="sl" + TXLIBS="/usr/lib/libHcurses.a" + VFSCK_CFLAGS="-I/usr/old/usr/include -D_FILE64" + XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE" + XCFLAGS64="${XCFLAGS0} +DA2.0W" + XCFLAGS="${XCFLAGS0} +DA1.0" + XLIBELFA="-lelf" + #XLIBS="${LIB_AFSDB} -lnsl" + XLIBS="${LIB_AFSDB}" + YACC="/opt/langtools/bin/yacc" + SHLIB_LINKER="ld -b" + ;; + + ia64_hpux*) + AR="/usr/bin/ar" + AS="/usr/ccs/bin/as" + CC="/opt/ansic/bin/cc" + CCOBJ="/opt/ansic/bin/cc" + DBM="/lib/hpux32/libndbm.so" + LD="/bin/ld " + LEX="/opt/langtools/bin/lex" + LWP_OPTMZ="" + MT_CC="$CC" + MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + MV="/bin/mv" + OPTMZ="-O" + PAM_CFLAGS="-b +z -Wl,+k" + PAM_LIBS="/usr/lib/hpux32/libpam.so" + RANLIB="/usr/bin/ranlib" + RM="/bin/rm" + SHLIB_LDFLAGS="-b -Bsymbolic" + SHLIB_SUFFIX="sl" + TXLIBS="/usr/lib/hpux32/libcurses.so" + VFSCK_CFLAGS="-I/usr/old/usr/include -D_FILE64" + XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive_shared -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE" + XCFLAGS64="${XCFLAGS0} +DD64" + XCFLAGS="${XCFLAGS0}" + XLIBELFA="-lelf" + #XLIBS="${LIB_AFSDB} -lnsl" + XLIBS="${LIB_AFSDB}" + YACC="/opt/langtools/bin/yacc" + SHLIB_LINKER="ld -b" + ;; + + *fbsd_*) + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-pthread" + PAM_CFLAGS="-O2 -pipe -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -pipe" + YACC="byacc" + ;; + + *nbsd20) + LEX="flex -l" + MT_CFLAGS='${XCFLAGS} -DAFS_PTHREAD_ENV -D_REENTRANT ' + MT_LIBS="-lpthread" # XXX -pthread soon + PAM_CFLAGS="-O2 -pipe -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="/usr/lib/libcurses.so" + XCFLAGS="-O2 -pipe" + YACC="yacc" + ;; + + *nbsd15|*nbsd16) + LEX="flex -l" + MT_CFLAGS='${XCFLAGS}' + MT_LIBS="" + PAM_CFLAGS="-O2 -pipe -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="/usr/lib/libcurses.so" + XCFLAGS="-O2 -pipe" + YACC="bison -y" + ;; + + ia64_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE -G0" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + amd64_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + ppc64_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="/usr/lib64/libncurses.so" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + i386_linux22) + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + i386_umlinux22) + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + i386_linux24) + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + DBG=-g + KERN_DBG=-g + LWP_DBG=-g + LWP_OPTMZ=-O2 + OPTMZ=-O2 + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + i386_umlinux24) + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + DBG=-g + KERN_DBG=-g + LWP_DBG=-g + LWP_OPTMZ=-O2 + OPTMZ=-O2 + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + *_obsd*) + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-pthread" + PAM_CFLAGS="-O2 -pipe -fpic" + SHLIB_CFLAGS="-fpic" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="/usr/lib/libcurses.a" + XCFLAGS="-O2" + YACC="yacc" + ;; + + parisc_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + ppc_darwin_12) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + REGEX_OBJ="regex.o" + XCFLAGS="-traditional-cpp" + ;; + + ppc_darwin_13) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + LWP_OPTMZ="-O2" + REGEX_OBJ="regex.o" + XCFLAGS="-no-cpp-precomp" + ;; + + ppc_darwin_14) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + LWP_OPTMZ="-O2" + REGEX_OBJ="regex.o" + XCFLAGS="-no-cpp-precomp" + ;; + + ppc_darwin_60) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + LWP_OPTMZ="-O2" + REGEX_OBJ="regex.o" + XCFLAGS="-no-cpp-precomp" + TXLIBS="-lncurses" + ;; + + ppc_darwin_70) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -D_REENTRANT ${XCFLAGS}' + KROOT= + KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers' + LWP_OPTMZ="-O2" + REGEX_OBJ="regex.o" + XCFLAGS="-no-cpp-precomp" + TXLIBS="-lncurses" + EXTRA_VLIBOBJS="fstab.o" + ;; + + ppc_linux22) + INSTALL="install" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + ppc_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + rs_aix42) + DBG="" + LEX="lex" + LIBSYS_AIX_EXP="afsl.exp" + MT_CC="xlc_r" + MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthreads" + SHLIB_SUFFIX="o" + TXLIBS="-lcurses" + XCFLAGS="-K -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void" + XLIBS="${LIB_AFSDB} -ldl" + SHLIB_LINKER="${MT_CC} -bM:SRE -berok" + AIX64="#" + ;; + + rs_aix51) + DBG="" + LEX="lex" + LIBSYS_AIX_EXP="afsl.exp" + MT_CC="xlc_r" + MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthreads" + SHLIB_SUFFIX="o" + TXLIBS="-lcurses" + XCFLAGS="-K -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void" + XLIBS="${LIB_AFSDB} -ldl" + SHLIB_LINKER="${MT_CC} -bM:SRE -berok" + AIX64="" + ;; + + s390_linux22) + CC="gcc" + CCOBJ="gcc" + LD="gcc" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CC="$CC" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O -g -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + s390_linux24) + CC="gcc" + CCOBJ="gcc" + LD="gcc" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CC="$CC" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O -g -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + sgi_62) + PINSTALL_LIBS=-lmld + AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a" + FSINCLUDES="-I/usr/include/sys/fs" + LEX="lex" + MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + TXLIBS="-lcurses" + XCFLAGS64="-64 -mips3" + XCFLAGS="-o32" + XLDFLAGS64="-64" + XLDFLAGS="-o32" + SHLIB_LINKER="${CC} -shared" + ;; + + sgi_63) + PINSTALL_LIBS=-lmld + AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a" + FSINCLUDES="-I/usr/include/sys/fs" + LEX="lex" + MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + TXLIBS="-lcurses" + XCFLAGS64="-D_BSD_COMPAT -64 -mips3" + XCFLAGS="-D_OLD_TERMIOS -D_BSD_COMPAT -o32" + XLDFLAGS64="-64" + XLDFLAGS="-o32" + SHLIB_LINKER="${CC} -shared" + ;; + + sgi_64) + AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a" + FSINCLUDES="-I/usr/include/sys/fs" + LEX="lex" + MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + TXLIBS="-lcurses" + XCFLAGS64="-D_BSD_COMPAT -64 -mips3" + XCFLAGS="-D_OLD_TERMIOS -D_BSD_COMPAT -n32 -woff 1009,1110,1116,1164,1171,1177,1183,1185,1204,1233,1515,1516,1548,1169,1174,1177,1196,1498,1506,1552" + XLDFLAGS64="-64" + XLDFLAGS="-n32" + SHLIB_LINKER="${CC} -shared" + ;; + + sgi_65) + AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a" + CC="/usr/bin/cc" + CCOBJ="/usr/bin/cc" + FSINCLUDES="-I/usr/include/sys/fs" + LD="/usr/bin/ld" + LEX="lex" + MT_CC="/usr/bin/cc" + MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + TXLIBS="-lcurses" + XCFLAGS64="-64 -mips3" + XCFLAGS="-n32 -mips3 -woff 1009,1110,1116,1164,1171,1177,1183,1185,1204,1233,1515,1516,1548,1169,1174,1177,1196,1498,1506,1552" + XLDFLAGS64="-64 -mips3" + XLDFLAGS="-n32 -mips3" + SHLIB_LINKER="${CC} -shared" + ;; + + sparc64_linux22) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + sparc64_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + sparc_linux22) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + sun4_413) + CCXPG2="/usr/xpg2bin/cc" + CC="gcc" + CCOBJ="gcc" + LEX="lex" + SHLIB_CFLAGS="-PIC" + TXLIBS="-lcurses -ltermcap" + XCFLAGS="" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB}" + LD="ld" + ;; + + sun4x_55) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + SHLIB_CFLAGS="-KPIC" + TXLIBS="-lcurses" + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + LD="/usr/ccs/bin/ld" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sun4x_56) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-L/usr/ccs/lib -lcurses" + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + LD="/usr/ccs/bin/ld" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sun4x_57) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sun4x_58) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sun4x_59) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sunx86_57) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + + sunx86_58) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + +esac + +# +# Special build targets +# +case $AFS_SYSNAME in + sgi_6*) + IRIX_SYS_SYSTM_H_HAS_MEM_FUNCS + XFS_SIZE_CHECK="xfs_size_check" + install_XFS_SIZE_CHECK='$(DESTDIR)${afssrvsbindir}/xfs_size_check' + dest_XFS_SIZE_CHECK='$(DEST)/root.server/usr/afs/bin/xfs_size_check' + + AC_SUBST(XFS_SIZE_CHECK) + AC_SUBST(install_XFS_SIZE_CHECK) + AC_SUBST(dest_XFS_SIZE_CHECK) + ;; + + sun4x_*|sunx86_*) + FS_CONV_SOL26="fs_conv_sol26" + install_FS_CONV_SOL26='$(DESTDIR)${afssrvsbindir}/fs_conv_sol26' + dest_FS_CONV_SOL26='$(DEST)/root.server/usr/afs/bin/fs_conv_sol26' + + AC_SUBST(FS_CONV_SOL26) + AC_SUBST(install_FS_CONV_SOL26) + AC_SUBST(dest_FS_CONV_SOL26) + ;; + + alpha_dux*) + FS_CONV_OSF40D="fs_conv_dux40D" + install_FS_CONV_OSF40D='$(DESTDIR)${afssrvsbindir}/fs_conv_dux40D' + dest_FS_CONV_OSF40D='$(DEST)/root.server/usr/afs/bin/fs_conv_dux40D' + + AC_SUBST(FS_CONV_OSF40D) + AC_SUBST(install_FS_CONV_OSF40D) + AC_SUBST(dest_FS_CONV_OSF40D) + ;; +esac + +dnl Disable the default for debugging/optimization if not enabled +if test "x$enable_debug_kernel" = "xno"; then + KERN_DBG= +fi + +if test "x$enable_optimize_kernel" = "xno"; then + KERN_OPTMZ= +fi + +if test "x$enable_debug" = "xno"; then + DBG= +fi + +if test "x$enable_optimize" = "xno"; then + OPTMZ= +fi + +if test "x$enable_debug_lwp" = "xno"; then + LWP_DBG= +fi + +if test "x$enable_optimize_lwp" = "xno"; then + LWP_OPTMZ= +fi + +AC_SUBST(CCXPG2) +AC_SUBST(CCOBJ) +AC_SUBST(AFSD_LIBS) +AC_SUBST(AFSD_LDFLAGS) +AC_SUBST(AIX64) +AC_SUBST(AR) +AC_SUBST(AS) +AC_SUBST(CP) +AC_SUBST(DBG) +AC_SUBST(FSINCLUDES) +AC_SUBST(KERN_DBG) +AC_SUBST(KERN_OPTMZ) +AC_SUBST(LD) +AC_SUBST(LEX) +AC_SUBST(LWP_DBG) +AC_SUBST(LWP_OPTMZ) +AC_SUBST(MT_CC) +AC_SUBST(MT_CFLAGS) +AC_SUBST(MT_LIBS) +AC_SUBST(MV) +AC_SUBST(OPTMZ) +AC_SUBST(PAM_CFLAGS) +AC_SUBST(PAM_LIBS) +AC_SUBST(PINSTALL_LIBS) +AC_SUBST(RANLIB) +AC_SUBST(REGEX_OBJ) +AC_SUBST(RM) +AC_SUBST(SHLIB_CFLAGS) +AC_SUBST(SHLIB_LDFLAGS) +AC_SUBST(SHLIB_LINKER) +AC_SUBST(SHLIB_SUFFIX) +AC_SUBST(TXLIBS) +AC_SUBST(VFSCK_CFLAGS) +AC_SUBST(XCFLAGS) +AC_SUBST(XCFLAGS64) +AC_SUBST(XLDFLAGS) +AC_SUBST(XLDFLAGS64) +AC_SUBST(XLIBELFA) +AC_SUBST(XLIBKVM) +AC_SUBST(XLIBS) +AC_SUBST(YACC) + + +]) + +AC_DEFUN(IRIX_SYS_SYSTM_H_HAS_MEM_FUNCS, [ +AC_MSG_CHECKING(for mem* in sys/systm.h) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -D_KERNEL -D__STRING_H__" +AC_CACHE_VAL(ac_cv_irix_sys_systm_h_has_mem_funcs, +[ +AC_TRY_COMPILE( +[#include +#include ], +[ +extern void *memcpy(char *, const void *, size_t); +], +ac_cv_irix_sys_systm_h_has_mem_funcs=no, +ac_cv_irix_sys_systm_h_has_mem_funcs=yes)]) +CPPFLAGS="$save_CPPFLAGS" +if test "$ac_cv_irix_sys_systm_h_has_mem_funcs" = "yes"; then + AC_DEFINE(IRIX_HAS_MEM_FUNCS, 1, [define if irix has memcpy and friends]) +fi +AC_MSG_RESULT($ac_cv_irix_sys_systm_h_has_mem_funcs) +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + diff --git a/configure b/configure new file mode 100644 index 000000000..4ff7c87ca --- /dev/null +++ b/configure @@ -0,0 +1,7663 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --with-afs-sysname=sys use sys for the afs sysname +" +ac_help="$ac_help + --enable-obsolete enable obsolete portions of AFS (mpp, ntp and package)" +ac_help="$ac_help + --enable-insecure enable insecure portions of AFS (ftpd, inetd, rcp, rlogind and rsh)" +ac_help="$ac_help + --disable-afsdb disable AFSDB RR support" +ac_help="$ac_help + --disable-pam disable PAM support" +ac_help="$ac_help + --enable-bos-restricted-mode enable bosserver restricted mode which disables certain bosserver functionality" +ac_help="$ac_help + --enable-bos-new-config enable bosserver pickup of BosConfig.new on restarts" +ac_help="$ac_help + --enable-largefile-fileserver enable large file support in fileserver" +ac_help="$ac_help + --enable-namei-fileserver force compilation of namei fileserver in preference to inode fileserver" +ac_help="$ac_help + --enable-supergroups enable support for nested pts groups" +ac_help="$ac_help + --enable-fast-restart enable fast startup of file server without salvaging" +ac_help="$ac_help + --enable-bitmap-later enable fast startup of file server by not reading bitmap till needed" +ac_help="$ac_help + --disable-full-vos-listvol-switch disable vos full listvol switch for formatted output" +ac_help="$ac_help + --with-dux-kernel-headers=path use the kernel headers found at path(optional, defaults to first match in /usr/sys) +" +ac_help="$ac_help + --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux) +" +ac_help="$ac_help + --with-bsd-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/sys) +" +ac_help="$ac_help + --with-bsd-kernel-build=path use the kernel build found at path(optional, defaults to KSRC/i386/compile/GENERIC) +" +ac_help="$ac_help + --disable-kernel-module disable compilation of the kernel module (defaults to enabled)" +ac_help="$ac_help + --enable-redhat-buildsys enable compilation of the redhat build system kernel (defaults to disabled)" +ac_help="$ac_help + --enable-transarc-paths Use Transarc style paths like /usr/afs and /usr/vice" +ac_help="$ac_help + --enable-tivoli-tsm Enable use of the Tivoli TSM API libraries for butc support" +ac_help="$ac_help + --enable-debug-kernel enable compilation of the kernel module with debugging information (defaults to disabled)" +ac_help="$ac_help + --disable-optimize-kernel disable compilation of the kernel module with optimization (defaults based on platform)" +ac_help="$ac_help + --enable-debug enable compilation of the user space code with debugging information (defaults to disabled)" +ac_help="$ac_help + --disable-optimize disable optimization for compilation of the user space code (defaults to enabled)" +ac_help="$ac_help + --enable-debug-lwp enable compilation of the LWP code with debugging information (defaults to disabled)" +ac_help="$ac_help + --disable-optimize-lwp disable optimization for compilation of the LWP code (defaults to enabled)" +ac_help="$ac_help + --enable-bigendian the target is big endian" +ac_help="$ac_help + --enable-littleendian the target is little endian" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=src/config/stds.h + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:619: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:672: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:729: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=openafs + +VERSION=devel + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:775: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:788: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:801: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:814: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:827: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:845: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:875: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:926: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:958: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 969 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1000: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1005: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1033: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1065: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1103: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:1145: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:1225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:1257: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +SRCDIR_PARENT=`pwd` + +#BOZO_SAVE_CORES pam sia +# Check whether --with-afs-sysname or --without-afs-sysname was given. +if test "${with_afs_sysname+set}" = set; then + withval="$with_afs_sysname" + : +fi + +# Check whether --enable-obsolete or --disable-obsolete was given. +if test "${enable_obsolete+set}" = set; then + enableval="$enable_obsolete" + : +else + enable_obsolete="no" +fi + +# Check whether --enable-insecure or --disable-insecure was given. +if test "${enable_insecure+set}" = set; then + enableval="$enable_insecure" + : +else + enable_insecure="no" +fi + +# Check whether --enable-afsdb or --disable-afsdb was given. +if test "${enable_afsdb+set}" = set; then + enableval="$enable_afsdb" + : +else + enable_afsdb="yes" +fi + +# Check whether --enable-pam or --disable-pam was given. +if test "${enable_pam+set}" = set; then + enableval="$enable_pam" + : +else + enable_pam="yes" +fi + +# Check whether --enable-bos-restricted-mode or --disable-bos-restricted-mode was given. +if test "${enable_bos_restricted_mode+set}" = set; then + enableval="$enable_bos_restricted_mode" + : +else + enable_bos_restricted_mode="no" +fi + +# Check whether --enable-bos-new-config or --disable-bos-new-config was given. +if test "${enable_bos_new_config+set}" = set; then + enableval="$enable_bos_new_config" + : +else + enable_bos_new_config="no" +fi + +# Check whether --enable-largefile-fileserver or --disable-largefile-fileserver was given. +if test "${enable_largefile_fileserver+set}" = set; then + enableval="$enable_largefile_fileserver" + : +else + enable_largefile_fileserver="no" +fi + +# Check whether --enable-namei-fileserver or --disable-namei-fileserver was given. +if test "${enable_namei_fileserver+set}" = set; then + enableval="$enable_namei_fileserver" + : +else + enable_namei_fileserver="no" +fi + +# Check whether --enable-supergroups or --disable-supergroups was given. +if test "${enable_supergroups+set}" = set; then + enableval="$enable_supergroups" + : +else + enable_supergroups="no" +fi + +# Check whether --enable-fast-restart or --disable-fast-restart was given. +if test "${enable_fast_restart+set}" = set; then + enableval="$enable_fast_restart" + : +else + enable_fast_restart="no" +fi + +# Check whether --enable-bitmap-later or --disable-bitmap-later was given. +if test "${enable_bitmap_later+set}" = set; then + enableval="$enable_bitmap_later" + : +else + enable_bitmap_later="no" +fi + +# Check whether --enable-full-vos-listvol-switch or --disable-full-vos-listvol-switch was given. +if test "${enable_full_vos_listvol_switch+set}" = set; then + enableval="$enable_full_vos_listvol_switch" + : +else + enable_full_vos_listvol_switch="yes" +fi + +# Check whether --with-dux-kernel-headers or --without-dux-kernel-headers was given. +if test "${with_dux_kernel_headers+set}" = set; then + withval="$with_dux_kernel_headers" + : +fi + +# Check whether --with-linux-kernel-headers or --without-linux-kernel-headers was given. +if test "${with_linux_kernel_headers+set}" = set; then + withval="$with_linux_kernel_headers" + : +fi + +# Check whether --with-bsd-kernel-headers or --without-bsd-kernel-headers was given. +if test "${with_bsd_kernel_headers+set}" = set; then + withval="$with_bsd_kernel_headers" + : +fi + +# Check whether --with-bsd-kernel-build or --without-bsd-kernel-build was given. +if test "${with_bsd_kernel_build+set}" = set; then + withval="$with_bsd_kernel_build" + : +fi + +# Check whether --enable-kernel-module or --disable-kernel-module was given. +if test "${enable_kernel_module+set}" = set; then + enableval="$enable_kernel_module" + : +else + enable_kernel_module="yes" + +fi + +# Check whether --enable-redhat-buildsys or --disable-redhat-buildsys was given. +if test "${enable_redhat_buildsys+set}" = set; then + enableval="$enable_redhat_buildsys" + : +else + enable_redhat_buildsys="no" + +fi + +# Check whether --enable-transarc-paths or --disable-transarc-paths was given. +if test "${enable_transarc_paths+set}" = set; then + enableval="$enable_transarc_paths" + : +else + enable_transarc_paths="no" + +fi + +# Check whether --enable-tivoli-tsm or --disable-tivoli-tsm was given. +if test "${enable_tivoli_tsm+set}" = set; then + enableval="$enable_tivoli_tsm" + : +else + enable_tivoli_tsm="no" + +fi + +# Check whether --enable-debug-kernel or --disable-debug-kernel was given. +if test "${enable_debug_kernel+set}" = set; then + enableval="$enable_debug_kernel" + : +else + enable_debug_kernel="no" + +fi + +# Check whether --enable-optimize-kernel or --disable-optimize-kernel was given. +if test "${enable_optimize_kernel+set}" = set; then + enableval="$enable_optimize_kernel" + : +else + enable_optimize_kernel="yes" + +fi + +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + : +else + enable_debug="no" + +fi + +# Check whether --enable-optimize or --disable-optimize was given. +if test "${enable_optimize+set}" = set; then + enableval="$enable_optimize" + : +else + enable_optimize="yes" + +fi + +# Check whether --enable-debug-lwp or --disable-debug-lwp was given. +if test "${enable_debug_lwp+set}" = set; then + enableval="$enable_debug_lwp" + : +else + enable_debug_lwp="no" + +fi + +# Check whether --enable-optimize-lwp or --disable-optimize-lwp was given. +if test "${enable_optimize_lwp+set}" = set; then + enableval="$enable_optimize_lwp" + : +else + enable_optimize_lwp="yes" + +fi + + +enable_login="no" + +echo $ac_n "checking for AIX""... $ac_c" 1>&6 +echo "configure:1500: checking for AIX" >&5 +cat > conftest.$ac_ext <&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF +#define _ALL_SOURCE 1 +EOF + +else + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + + +echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +echo "configure:1524: checking for POSIXized ISC" >&5 +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 +then + echo "$ac_t""yes" 1>&6 + ISC=yes # If later tests want to check for ISC. + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +else + echo "$ac_t""no" 1>&6 + ISC= +fi + +ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 +echo "configure:1546: checking for minix/config.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1556: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + MINIX=yes +else + echo "$ac_t""no" 1>&6 +MINIX= +fi + +if test "$MINIX" = yes; then + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + cat >> confdefs.h <<\EOF +#define _POSIX_1_SOURCE 2 +EOF + + cat >> confdefs.h <<\EOF +#define _MINIX 1 +EOF + +fi + + +echo $ac_n "checking for pid_t""... $ac_c" 1>&6 +echo "configure:1595: checking for pid_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_pid_t=yes +else + rm -rf conftest* + ac_cv_type_pid_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_pid_t" 1>&6 +if test $ac_cv_type_pid_t = no; then + cat >> confdefs.h <<\EOF +#define pid_t int +EOF + +fi + +echo $ac_n "checking for size_t""... $ac_c" 1>&6 +echo "configure:1628: checking for size_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_size_t=yes +else + rm -rf conftest* + ac_cv_type_size_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_size_t" 1>&6 +if test $ac_cv_type_size_t = no; then + cat >> confdefs.h <<\EOF +#define size_t unsigned +EOF + +fi + +echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:1661: checking return type of signal handlers" >&5 +if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int main() { +int i; +; return 0; } +EOF +if { (eval echo configure:1683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_signal=void +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_signal=int +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_type_signal" 1>&6 +cat >> confdefs.h <&6 +echo "configure:1703: checking for __FUNCTION__ and __LINE__ macros" >&5 +if eval "test \"`echo '$''{'ac_cv_compiler_has_function_macro'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +printf("%s:%d", __FUNCTION__, __LINE__); +; return 0; } +EOF +if { (eval echo configure:1716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_compiler_has_function_macro=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_compiler_has_function_macro=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_compiler_has_function_macro" 1>&6 +if test "$ac_cv_compiler_has_function_macro" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_FUNCTION_MACRO 1 +EOF + +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1749: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:1802: checking whether ln -s works" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftestdata +if ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" +else + ac_cv_prog_LN_S=ln +fi +fi +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1825: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +for ac_prog in 'bison -y' byacc +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1857: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_YACC="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +YACC="$ac_cv_prog_YACC" +if test -n "$YACC"; then + echo "$ac_t""$YACC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + +missing_dir=`cd $ac_aux_dir && pwd` +for ac_prog in flex lex +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1893: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_LEX="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +LEX="$ac_cv_prog_LEX" +if test -n "$LEX"; then + echo "$ac_t""$LEX" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$LEX" && break +done +test -n "$LEX" || LEX=""$missing_dir/missing flex"" + +# Extract the first word of "flex", so it can be a program name with args. +set dummy flex; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1926: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_LEX="flex" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex" +fi +fi +LEX="$ac_cv_prog_LEX" +if test -n "$LEX"; then + echo "$ac_t""$LEX" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$LEXLIB" +then + case "$LEX" in + flex*) ac_lib=fl ;; + *) ac_lib=l ;; + esac + echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 +echo "configure:1960: checking for yywrap in -l$ac_lib" >&5 +ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l$ac_lib $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LEXLIB="-l$ac_lib" +else + echo "$ac_t""no" 1>&6 +fi + +fi + +echo $ac_n "checking lex output file root""... $ac_c" 1>&6 +echo "configure:2002: checking lex output file root" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # The minimal lex program is just a single line: %%. But some broken lexes +# (Solaris, I think it was) want two %% lines, so accommodate them. +echo '%% +%%' | $LEX +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; } +fi +fi + +echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 +echo "configure:2023: checking whether yytext is a pointer" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c +ac_save_LIBS="$LIBS" +LIBS="$LIBS $LEXLIB" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_prog_lex_yytext_pointer=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +LIBS="$ac_save_LIBS" +rm -f "${LEX_OUTPUT_ROOT}.c" + +fi + +echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6 +if test $ac_cv_prog_lex_yytext_pointer = yes; then + cat >> confdefs.h <<\EOF +#define YYTEXT_POINTER 1 +EOF + +fi + + + +# Check whether --enable-bigendian or --disable-bigendian was given. +if test "${enable_bigendian+set}" = set; then + enableval="$enable_bigendian" + openafs_cv_c_bigendian=yes +fi + +# Check whether --enable-littleendian or --disable-littleendian was given. +if test "${enable_littleendian+set}" = set; then + enableval="$enable_littleendian" + openafs_cv_c_bigendian=no +fi + +echo $ac_n "checking whether byte order is known at compile time""... $ac_c" 1>&6 +echo "configure:2078: checking whether byte order is known at compile time" >&5 +if eval "test \"`echo '$''{'openafs_cv_c_bigendian_compile'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +int main() { + +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif +; return 0; } +EOF +if { (eval echo configure:2095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_cv_c_bigendian_compile=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_cv_c_bigendian_compile=no +fi +rm -f conftest* +fi + +echo "$ac_t""$openafs_cv_c_bigendian_compile" 1>&6 +echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 +echo "configure:2109: checking whether byte ordering is bigendian" >&5 +if eval "test \"`echo '$''{'openafs_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test "$openafs_cv_c_bigendian_compile" = "yes"; then + cat > conftest.$ac_ext < +#include +int main() { + +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +; return 0; } +EOF +if { (eval echo configure:2128: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_cv_c_bigendian=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_cv_c_bigendian=no +fi +rm -f conftest* + else + if test "$cross_compiling" = yes; then + { echo "configure: error: specify either --enable-bigendian or --enable-littleendian" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + openafs_cv_c_bigendian=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + openafs_cv_c_bigendian=yes +fi +rm -fr conftest* +fi + + fi + +fi + +echo "$ac_t""$openafs_cv_c_bigendian" 1>&6 +if test "$openafs_cv_c_bigendian" = "yes"; then + cat >> confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 +EOF +fi +if test "$openafs_cv_c_bigendian_compile" = "yes"; then + cat >> confdefs.h <<\EOF +#define ENDIANESS_IN_SYS_PARAM_H 1 +EOF +fi + + +echo $ac_n "checking your OS""... $ac_c" 1>&6 +echo "configure:2186: checking your OS" >&5 +system=$host +case $system in + *-linux*) + MKAFS_OSTYPE=LINUX + if test "x$enable_redhat_buildsys" = "xyes"; then + cat >> confdefs.h <<\EOF +#define ENABLE_REDHAT_BUILDSYS 1 +EOF + + fi + if test "x$enable_kernel_module" = "xyes"; then + if test "x$with_linux_kernel_headers" != "x"; then + LINUX_KERNEL_PATH="$with_linux_kernel_headers" + else + LINUX_KERNEL_PATH="/usr/src/linux-2.4" + if test ! -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then + LINUX_KERNEL_PATH="/usr/src/linux" + fi + fi + if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then + linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $2 }'|tail -n 1` + if test "x$linux_kvers" = "x"; then + if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then + linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $2 }'|tail -n 1` + if test "x$linux_kvers" = "x"; then + + { echo "configure: error: Linux headers lack version definition 2" 1>&2; exit 1; } + exit 1 + else + LINUX_VERSION="$linux_kvers" + fi + else + { echo "configure: error: Linux headers lack version definition" 1>&2; exit 1; } + exit 1 + fi + else + LINUX_VERSION="$linux_kvers" + fi + else + enable_kernel_module="no" + fi + if test ! -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then + enable_kernel_module="no" + fi + if test "x$enable_kernel_module" = "xno"; then + if test "x$with_linux_kernel_headers" != "x"; then + { echo "configure: error: No usable linux headers found at $LINUX_KERNEL_PATH" 1>&2; exit 1; } + exit 1 + else + echo "configure: warning: No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module" 1>&2 + fi + fi + SUBARCH=default + fi + echo "$ac_t""linux" 1>&6 + if test "x$enable_kernel_module" = "xyes"; then + if test "x$enable_debug_kernel" = "xno"; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer" + fi + +echo $ac_n "checking if $CC accepts -march=pentium""... $ac_c" 1>&6 +echo "configure:2248: checking if $CC accepts -march=pentium" >&5 +save_CFLAGS="$CFLAGS" +CFLAGS="-MARCH=pentium" +if eval "test \"`echo '$''{'openafs_gcc_supports_march'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_gcc_supports_march=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_gcc_supports_march=no +fi +rm -f conftest* +fi + +echo "$ac_t""$openafs_gcc_supports_march" 1>&6 +if test x$openafs_gcc_supports_march = xyes; then + P5PLUS_KOPTS="-march=pentium" +else + P5PLUS_KOPTS="-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2" +fi +CFLAGS="$save_CFLAGS" + + + +echo $ac_n "checking if $CC needs -fno-strength-reduce""... $ac_c" 1>&6 +echo "configure:2286: checking if $CC needs -fno-strength-reduce" >&5 +save_CFLAGS="$CFLAGS" +CFLAGS="-fno-strength-reduce" +if eval "test \"`echo '$''{'openafs_gcc_needs_no_strength_reduce'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_gcc_needs_no_strength_reduce=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_gcc_needs_no_strength_reduce=no +fi +rm -f conftest* +fi + +echo "$ac_t""$openafs_gcc_needs_no_strength_reduce" 1>&6 +if test x$openafs_gcc_needs_no_strength_reduce = xyes; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strength-reduce" +fi +CFLAGS="$save_CFLAGS" + + +echo $ac_n "checking if $CC needs -fno-strict-aliasing""... $ac_c" 1>&6 +echo "configure:2321: checking if $CC needs -fno-strict-aliasing" >&5 +save_CFLAGS="$CFLAGS" +CFLAGS="-fno-strict-aliasing" +if eval "test \"`echo '$''{'openafs_gcc_needs_no_strict_aliasing'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_gcc_needs_no_strict_aliasing=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_gcc_needs_no_strict_aliasing=no +fi +rm -f conftest* +fi + +echo "$ac_t""$openafs_gcc_needs_no_strict_aliasing" 1>&6 +if test x$openafs_gcc_needs_no_strict_aliasing = xyes; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strict-aliasing" +fi +CFLAGS="$save_CFLAGS" + + +echo $ac_n "checking if $CC supports -fno-common""... $ac_c" 1>&6 +echo "configure:2356: checking if $CC supports -fno-common" >&5 +save_CFLAGS="$CFLAGS" +CFLAGS="-fno-common" +if eval "test \"`echo '$''{'openafs_gcc_supports_no_common'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_gcc_supports_no_common=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_gcc_supports_no_common=no +fi +rm -f conftest* +fi + +echo "$ac_t""$openafs_gcc_supports_no_common" 1>&6 +if test x$openafs_gcc_supports_no_common = xyes; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-common" +fi +CFLAGS="$save_CFLAGS" + + +echo $ac_n "checking if $CC supports -pipe""... $ac_c" 1>&6 +echo "configure:2391: checking if $CC supports -pipe" >&5 +save_CFLAGS="$CFLAGS" +CFLAGS="-pipe" +if eval "test \"`echo '$''{'openafs_gcc_supports_pipe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_gcc_supports_pipe=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_gcc_supports_pipe=no +fi +rm -f conftest* +fi + +echo "$ac_t""$openafs_gcc_supports_pipe" 1>&6 +if test x$openafs_gcc_supports_pipe = xyes; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -pipe" +fi +CFLAGS="$save_CFLAGS" + + + +echo $ac_n "checking whether to build osi_vfs.h""... $ac_c" 1>&6 +echo "configure:2427: checking whether to build osi_vfs.h" >&5 +configdir=${srcdir}/src/config +outputdir=src/afs/LINUX +tmpldir=${srcdir}/src/afs/LINUX +chmod +x $configdir/make_vnode.pl +$configdir/make_vnode.pl -i $LINUX_KERNEL_PATH -t ${tmpldir} -o $outputdir + + + +echo $ac_n "checking for linux/completion.h existance""... $ac_c" 1>&6 +echo "configure:2437: checking for linux/completion.h existance" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_completion_h_exists'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +#include +int main() { +struct completion _c; +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8) +lose +#endif + +; return 0; } +EOF +if { (eval echo configure:2457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_completion_h_exists=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_completion_h_exists=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_completion_h_exists" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for defined for_each_process""... $ac_c" 1>&6 +echo "configure:2473: checking for defined for_each_process" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_defines_for_each_process'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef for_each_process(p) +#error for_each_process not defined +#endif +; return 0; } +EOF +if { (eval echo configure:2490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_defines_for_each_process=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_defines_for_each_process=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_defines_for_each_process" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for defined prev_task""... $ac_c" 1>&6 +echo "configure:2506: checking for defined prev_task" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_defines_prev_task'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef prev_task(p) +#error prev_task not defined +#endif +; return 0; } +EOF +if { (eval echo configure:2523: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_defines_prev_task=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_defines_prev_task=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_defines_prev_task" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported tasklist_lock""... $ac_c" 1>&6 +echo "configure:2539: checking for exported tasklist_lock" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_tasklist_lock'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_tasklist_lock +#error tasklist_lock not exported +#endif +; return 0; } +EOF +if { (eval echo configure:2556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_tasklist_lock=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_tasklist_lock=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_tasklist_lock" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for page_lock in struct address_space""... $ac_c" 1>&6 +echo "configure:2572: checking for page_lock in struct address_space" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_fs_struct_address_space_has_page_lock'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct address_space _a_s; +printf("%x\n", _a_s.page_lock); +; return 0; } +EOF +if { (eval echo configure:2588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_fs_struct_address_space_has_page_lock=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_fs_struct_address_space_has_page_lock=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_fs_struct_address_space_has_page_lock" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for gfp_mask in struct address_space""... $ac_c" 1>&6 +echo "configure:2604: checking for gfp_mask in struct address_space" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_fs_struct_address_space_has_gfp_mask'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct address_space _a; +printf("%d\n", _a.gfp_mask); +; return 0; } +EOF +if { (eval echo configure:2620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_fs_struct_address_space_has_gfp_mask=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_fs_struct_address_space_has_gfp_mask" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for i_alloc_sem in struct inode""... $ac_c" 1>&6 +echo "configure:2636: checking for i_alloc_sem in struct inode" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_fs_struct_inode_has_i_alloc_sem'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct inode _i; +printf("%x\n", _i.i_alloc_sem); +; return 0; } +EOF +if { (eval echo configure:2652: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for i_truncate_sem in struct inode""... $ac_c" 1>&6 +echo "configure:2668: checking for i_truncate_sem in struct inode" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_fs_struct_inode_has_i_truncate_sem'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct inode _i; +printf("%x\n", _i.i_truncate_sem); +; return 0; } +EOF +if { (eval echo configure:2684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for i_dirty_data_buffers in struct inode""... $ac_c" 1>&6 +echo "configure:2700: checking for i_dirty_data_buffers in struct inode" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct inode _inode; +printf("%d\n", _inode.i_dirty_data_buffers); +; return 0; } +EOF +if { (eval echo configure:2716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for i_devices in struct inode""... $ac_c" 1>&6 +echo "configure:2732: checking for i_devices in struct inode" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_fs_struct_inode_has_i_cdev'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct inode _inode; +printf("%d\n", _inode.i_devices); +; return 0; } +EOF +if { (eval echo configure:2748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_devices=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_devices=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_fs_struct_inode_has_i_devices" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for inode_setattr return type""... $ac_c" 1>&6 +echo "configure:2764: checking for inode_setattr return type" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_func_inode_setattr_returns_int'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct inode _inode; +struct iattr _iattr; +int i; +i = inode_setattr(&_inode, &_iattr); +; return 0; } +EOF +if { (eval echo configure:2782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_func_inode_setattr_returns_int=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_func_inode_setattr_returns_int=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_func_inode_setattr_returns_int" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + + echo $ac_n "checking for linux/syscall.h in kernel""... $ac_c" 1>&6 +echo "configure:2798: checking for linux/syscall.h in kernel" >&5 + if test -f "${LINUX_KERNEL_PATH}/include/linux/syscall.h"; then + ac_linux_syscall=yes + echo "$ac_t""$ac_linux_syscall" 1>&6 + else + ac_linux_syscall=no + echo "$ac_t""$ac_linux_syscall" 1>&6 + fi + + +RHCONFIG_SP="" +RHCONFIG_MP="" +if test "x$enable_redhat_buildsys" = "xyes"; then + echo "configure: warning: Configured to build from a Red Hat SPEC file" 1>&2 +else + echo $ac_n "checking for redhat kernel configuration""... $ac_c" 1>&6 +echo "configure:2814: checking for redhat kernel configuration" >&5 + if test -f "${LINUX_KERNEL_PATH}/include/linux/rhconfig.h"; then + ac_linux_rhconfig=yes + RHCONFIG_SP="-D__BOOT_KERNEL_UP=1 -D__BOOT_KERNEL_SMP=0" + RHCONFIG_MP="-D__BOOT_KERNEL_UP=0 -D__BOOT_KERNEL_SMP=1" + echo "$ac_t""$ac_linux_rhconfig" 1>&6 + if test ! -f "/boot/kernel.h"; then + echo "configure: warning: /boot/kernel.h does not exist. build may fail" 1>&2 + fi + else + ac_linux_rhconfig=no + echo "$ac_t""$ac_linux_rhconfig" 1>&6 + fi +fi + + + + +echo $ac_n "checking for recalc_sigpending arg type""... $ac_c" 1>&6 +echo "configure:2833: checking for recalc_sigpending arg type" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_func_recalc_sigpending_takes_void'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +recalc_sigpending(); +; return 0; } +EOF +if { (eval echo configure:2848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_func_recalc_sigpending_takes_void=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_func_recalc_sigpending_takes_void=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_func_recalc_sigpending_takes_void" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for parent in struct task_struct""... $ac_c" 1>&6 +echo "configure:2864: checking for parent in struct task_struct" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_sched_struct_task_struct_has_parent'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct task_struct _tsk; +printf("%d\n", _tsk.parent); +; return 0; } +EOF +if { (eval echo configure:2880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_parent=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_parent=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_sched_struct_task_struct_has_parent" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for real_parent in struct task_struct""... $ac_c" 1>&6 +echo "configure:2896: checking for real_parent in struct task_struct" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_sched_struct_task_struct_has_real_parent'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct task_struct _tsk; +printf("%d\n", _tsk.real_parent); +; return 0; } +EOF +if { (eval echo configure:2912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_real_parent=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_real_parent=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_sched_struct_task_struct_has_real_parent" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for sig in struct task_struct""... $ac_c" 1>&6 +echo "configure:2928: checking for sig in struct task_struct" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_sched_struct_task_struct_has_sig'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct task_struct _tsk; +printf("%d\n", _tsk.sig); +; return 0; } +EOF +if { (eval echo configure:2944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_sig=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_sig=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_sched_struct_task_struct_has_sig" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for sighand in struct task_struct""... $ac_c" 1>&6 +echo "configure:2960: checking for sighand in struct task_struct" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_sched_struct_task_struct_has_sighand'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct task_struct _tsk; +printf("%d\n", _tsk.sighand); +; return 0; } +EOF +if { (eval echo configure:2976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_sighand=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_sighand=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_sched_struct_task_struct_has_sighand" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for sigmask_lock in struct task_struct""... $ac_c" 1>&6 +echo "configure:2992: checking for sigmask_lock in struct task_struct" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_sched_struct_task_struct_has_sigmask_lock'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct task_struct _tsk; +printf("%d\n", _tsk.sigmask_lock); +; return 0; } +EOF +if { (eval echo configure:3008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +if test "x$enable_redhat_buildsys" = "xyes"; then + MPS=Default +else + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS" + echo $ac_n "checking if kernel uses MODVERSIONS""... $ac_c" 1>&6 +echo "configure:3029: checking if kernel uses MODVERSIONS" >&5 + if eval "test \"`echo '$''{'ac_cv_linux_config_modversions'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +#include + +int main() { +#if !defined(CONFIG_MODVERSIONS) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) +lose; +#endif + +; return 0; } +EOF +if { (eval echo configure:3047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_config_modversions=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_config_modversions=no +fi +rm -f conftest* +fi + + echo "$ac_t""$ac_cv_linux_config_modversions" 1>&6 + echo $ac_n "checking which kernel modules to build""... $ac_c" 1>&6 +echo "configure:3061: checking which kernel modules to build" >&5 + if test "x$ac_linux_rhconfig" = "xyes" -o "x$ac_cv_linux_config_modversions" = "xno"; then + MPS="MP SP" + else + if eval "test \"`echo '$''{'ac_cv_linux_config_smp'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < + +int main() { +#ifndef CONFIG_SMP +lose; +#endif + +; return 0; } +EOF +if { (eval echo configure:3081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_config_smp=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_config_smp=no +fi +rm -f conftest* +fi + + if test "x$ac_cv_linux_config_smp" = "xyes"; then + MPS=MP + else + MPS=SP + fi + fi + CPPFLAGS=$save_CPPFLAGS + echo "$ac_t""$MPS" 1>&6 +fi + + + if test "x$ac_cv_linux_config_modversions" = "xno"; then + echo "configure: warning: Cannot determine sys_call_table status. assuming it isn't exported" 1>&2 + ac_cv_linux_exports_sys_call_table=no + if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then + ac_cv_linux_exports_ia32_sys_call_table=yes + fi + else + +echo $ac_n "checking for exported init_mm""... $ac_c" 1>&6 +echo "configure:3113: checking for exported init_mm" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_init_mm'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_init_mm +#error init_mm not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_init_mm=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_init_mm=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_init_mm" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported kallsyms_address_to_symbol""... $ac_c" 1>&6 +echo "configure:3146: checking for exported kallsyms_address_to_symbol" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_kallsyms_address'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_kallsyms_address_to_symbol +#error kallsyms_address_to_symbol not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_kallsyms_address=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_kallsyms_address=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_kallsyms_address" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported kallsyms_symbol_to_address""... $ac_c" 1>&6 +echo "configure:3179: checking for exported kallsyms_symbol_to_address" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_kallsyms_symbol'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_kallsyms_symbol_to_address +#error kallsyms_symbol_to_address not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_kallsyms_symbol=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_kallsyms_symbol=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_kallsyms_symbol" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported sys_call_table""... $ac_c" 1>&6 +echo "configure:3212: checking for exported sys_call_table" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_sys_call_table'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_sys_call_table +#error sys_call_table not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_sys_call_table=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_sys_call_table=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_sys_call_table" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported ia32_sys_call_table""... $ac_c" 1>&6 +echo "configure:3245: checking for exported ia32_sys_call_table" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_ia32_sys_call_table'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_ia32_sys_call_table +#error ia32_sys_call_table not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_ia32_sys_call_table=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_ia32_sys_call_table=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_ia32_sys_call_table" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported sys_chdir""... $ac_c" 1>&6 +echo "configure:3278: checking for exported sys_chdir" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_sys_chdir'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_sys_chdir +#error sys_chdir not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_sys_chdir=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_sys_chdir=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_sys_chdir" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported sys_close""... $ac_c" 1>&6 +echo "configure:3311: checking for exported sys_close" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_sys_close'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_sys_close +#error sys_close not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_sys_close=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_sys_close=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_sys_close" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported sys_wait4""... $ac_c" 1>&6 +echo "configure:3344: checking for exported sys_wait4" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_sys_wait4'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_sys_wait4 +#error sys_wait4 not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_sys_wait4=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_sys_wait4=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_sys_wait4" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then + linux_syscall_method=none + if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then + linux_syscall_method=scan + if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then + linux_syscall_method=scan_with_kallsyms_address + fi + fi + if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then + linux_syscall_method=kallsyms_symbol + fi + if test "x$linux_syscall_method" = "xnone"; then + { echo "configure: error: no available sys_call_table access method" 1>&2; exit 1; } + fi + fi + fi + if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define EXPORTED_SYS_CHDIR 1 +EOF + + fi + if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define EXPORTED_SYS_CLOSE 1 +EOF + + fi + if test "x$ac_cv_linux_exports_sys_wait4" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define EXPORTED_SYS_WAIT4 1 +EOF + + fi + if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define EXPORTED_TASKLIST_LOCK 1 +EOF + + fi + if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then + cat >> confdefs.h <<\EOF +#define EXPORTED_SYS_CALL_TABLE 1 +EOF + + fi + if test "x$ac_cv_linux_exports_ia32_sys_call_table" = "xyes"; then + cat >> confdefs.h <<\EOF +#define EXPORTED_IA32_SYS_CALL_TABLE 1 +EOF + + fi + if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then + cat >> confdefs.h <<\EOF +#define EXPORTED_KALLSYMS_SYMBOL 1 +EOF + + fi + if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then + cat >> confdefs.h <<\EOF +#define EXPORTED_KALLSYMS_ADDRESS 1 +EOF + + fi + if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define COMPLETION_H_EXISTS 1 +EOF + + fi + if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define DEFINED_FOR_EACH_PROCESS 1 +EOF + + fi + if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define DEFINED_PREV_TASK 1 +EOF + + fi + if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define INODE_SETATTR_NOT_VOID 1 +EOF + + fi + if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK 1 +EOF + + fi + if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_ADDRESS_SPACE_HAS_GFP_MASK 1 +EOF + + fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_INODE_HAS_I_TRUNCATE_SEM 1 +EOF + + fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_INODE_HAS_I_ALLOC_SEM 1 +EOF + + fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_INODE_HAS_I_DEVICES 1 +EOF + + fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS 1 +EOF + + fi + if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then + cat >> confdefs.h <<\EOF +#define RECALC_SIGPENDING_TAKES_VOID 1 +EOF + + fi + if test "x$ac_linux_syscall" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define HAVE_KERNEL_LINUX_SYSCALL_H 1 +EOF + + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_TASK_STRUCT_HAS_PARENT 1 +EOF + + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_real_parent" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_TASK_STRUCT_HAS_REAL_PARENT 1 +EOF + + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK 1 +EOF + + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_sighand" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_TASK_STRUCT_HAS_SIGHAND 1 +EOF + + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_sig" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_TASK_STRUCT_HAS_SIG 1 +EOF + + fi + : + fi + ;; + *-solaris*) + MKAFS_OSTYPE=SOLARIS + echo "$ac_t""sun4" 1>&6 + +echo $ac_n "checking for vfs_dqrwlock in struct ufsvfs""... $ac_c" 1>&6 +echo "configure:3549: checking for vfs_dqrwlock in struct ufsvfs" >&5 +if eval "test \"`echo '$''{'ac_cv_solaris_ufsvfs_has_dqrwlock'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct ufsvfs _ufsvfs; +(void) _ufsvfs.vfs_dqrwlock; +; return 0; } +EOF +if { (eval echo configure:3564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_solaris_ufsvfs_has_dqrwlock=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_solaris_ufsvfs_has_dqrwlock=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_solaris_ufsvfs_has_dqrwlock" 1>&6 +if test "$ac_cv_solaris_ufsvfs_has_dqrwlock" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_VFS_DQRWLOCK 1 +EOF + +fi + + +echo $ac_n "checking for p_corefile in struct proc""... $ac_c" 1>&6 +echo "configure:3586: checking for p_corefile in struct proc" >&5 +if eval "test \"`echo '$''{'ac_cv_solaris_proc_has_p_corefile'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct proc _proc; +(void) _proc.p_corefile; +; return 0; } +EOF +if { (eval echo configure:3601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_solaris_proc_has_p_corefile=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_solaris_proc_has_p_corefile=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_solaris_proc_has_p_corefile" 1>&6 +if test "$ac_cv_solaris_proc_has_p_corefile" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_P_COREFILE 1 +EOF + +fi + + +echo $ac_n "checking for fs_rolled in struct proc""... $ac_c" 1>&6 +echo "configure:3623: checking for fs_rolled in struct proc" >&5 +if eval "test \"`echo '$''{'ac_cv_solaris_fs_has_fs_rolled'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct fs _fs; +(void) _fs.fs_rolled; +; return 0; } +EOF +if { (eval echo configure:3637: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_solaris_fs_has_fs_rolled=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_solaris_fs_has_fs_rolled=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_solaris_fs_has_fs_rolled" 1>&6 +if test "$ac_cv_solaris_fs_has_fs_rolled" = "yes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_FS_HAS_FS_ROLLED 1 +EOF + +fi + + ;; + *-sunos*) + MKAFS_OSTYPE=SUNOS + enable_kernel_module=no + echo "$ac_t""sun4" 1>&6 + ;; + *-hpux*) + MKAFS_OSTYPE=HPUX + echo "$ac_t""hp_ux" 1>&6 + ;; + *-irix*) + if test -d /usr/include/sys/SN/SN1; then + IRIX_BUILD_IP35="IP35" + fi + MKAFS_OSTYPE=IRIX + echo "$ac_t""sgi" 1>&6 + ;; + *-aix*) + MKAFS_OSTYPE=AIX + echo "$ac_t""rs_aix" 1>&6 + ;; + *-osf*) + MKAFS_OSTYPE=DUX + echo "$ac_t""alpha_dux" 1>&6 + if test "x$enable_kernel_module" = "xyes"; then + if test "x$with_dux_kernel_headers" != "x"; then + HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'` + else + HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'` + fi + fi + if test "$HEADER_RT" = "*" ; then + { echo "configure: error: Need a configured kernel directory" 1>&2; exit 1; } + fi + + ;; + *-darwin*) + MKAFS_OSTYPE=DARWIN + echo "$ac_t""ppc_darwin" 1>&6 + ;; + *-freebsd*) + MKAFS_OSTYPE=FBSD + echo "$ac_t""i386_fbsd" 1>&6 + ;; + *-netbsd*) + MKAFS_OSTYPE=NBSD + echo "$ac_t""nbsd" 1>&6 + ;; + *-openbsd*) + MKAFS_OSTYPE=OBSD + echo "$ac_t""i386_obsd" 1>&6 + ;; + *) + echo "$ac_t""$system" 1>&6 + ;; +esac + +if test "x$with_afs_sysname" != "x"; then + AFS_SYSNAME="$with_afs_sysname" +else + echo $ac_n "checking your AFS sysname""... $ac_c" 1>&6 +echo "configure:3718: checking your AFS sysname" >&5 + case $host in + i?86-*-openbsd3.1) + AFS_SYSNAME="i386_obsd31" + ;; + i?86-*-openbsd3.2) + AFS_SYSNAME="i386_obsd32" + ;; + i?86-*-openbsd3.3) + AFS_SYSNAME="i386_obsd33" + ;; + i?86-*-openbsd3.4) + AFS_SYSNAME="i386_obsd34" + ;; + i?86-*-openbsd3.5) + AFS_SYSNAME="i386_obsd35" + ;; + i?86-*-freebsd4.2*) + AFS_SYSNAME="i386_fbsd_42" + ;; + i?86-*-freebsd4.3*) + AFS_SYSNAME="i386_fbsd_43" + ;; + i?86-*-freebsd4.4*) + AFS_SYSNAME="i386_fbsd_44" + ;; + i?86-*-freebsd4.5*) + AFS_SYSNAME="i386_fbsd_45" + ;; + i?86-*-freebsd4.6*) + AFS_SYSNAME="i386_fbsd_46" + ;; + i?86-*-freebsd4.7*) + AFS_SYSNAME="i386_fbsd_47" + ;; + i?86-*-freebsd5.0*) + AFS_SYSNAME="i386_fbsd_50" + ;; + i?86-*-freebsd5.1*) + AFS_SYSNAME="i386_fbsd_51" + ;; + i?86-*-freebsd5.2*) + AFS_SYSNAME="i386_fbsd_52" + ;; + i?86-*-netbsd*1.5*) + AFS_PARAM_COMMON=param.nbsd15.h + AFS_SYSNAME="i386_nbsd15" + ;; + alpha-*-netbsd*1.5*) + AFS_PARAM_COMMON=param.nbsd15.h + AFS_SYSNAME="alpha_nbsd15" + ;; + i?86-*-netbsd*1.6[M-Z]*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="i386_nbsd20" + ;; + powerpc-*-netbsd*1.6[M-Z]*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="ppc_nbsd20" + ;; + i?86-*-netbsd*2.0*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="i386_nbsd20" + ;; + powerpc-*-netbsd*2.0*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="ppc_nbsd20" + ;; + i?86-*-netbsd*1.6*) + AFS_PARAM_COMMON=param.nbsd16.h + AFS_SYSNAME="i386_nbsd16" + ;; + alpha-*-netbsd*1.6*) + AFS_PARAM_COMMON=param.nbsd16.h + AFS_SYSNAME="alpha_nbsd16" + ;; + powerpc-*-netbsd*1.6*) + AFS_PARAM_COMMON=param.nbsd16.h + AFS_SYSNAME="ppc_nbsd16" + ;; + hppa*-hp-hpux11.0*) + AFS_SYSNAME="hp_ux110" + ;; + hppa*-hp-hpux11.11) + AFS_SYSNAME="hp_ux11i" + ;; + ia64-hp-hpux11.22) + AFS_SYSNAME="ia64_hpux1122" + ;; + ia64-hp-hpux*) + AFS_SYSNAME="ia64_hpux1123" + ;; + hppa*-hp-hpux10*) + AFS_SYSNAME="hp_ux102" + ;; + powerpc-apple-darwin1.2*) + AFS_SYSNAME="ppc_darwin_12" + ;; + powerpc-apple-darwin1.3*) + AFS_SYSNAME="ppc_darwin_13" + ;; + powerpc-apple-darwin1.4*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.1*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.2*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.3*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.4*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.5*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin6.0*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.1*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.2*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.3*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.4*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.5*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin7.0*) + AFS_SYSNAME="ppc_darwin_70" + ;; + powerpc-apple-darwin7.1*) + AFS_SYSNAME="ppc_darwin_70" + ;; + powerpc-apple-darwin7.2*) + AFS_SYSNAME="ppc_darwin_70" + ;; + powerpc-apple-darwin7.3*) + AFS_SYSNAME="ppc_darwin_70" + ;; + sparc-sun-solaris2.5*) + AFS_SYSNAME="sun4x_55" + enable_login="yes" + ;; + sparc-sun-solaris2.6) + AFS_SYSNAME="sun4x_56" + ;; + sparc-sun-solaris2.7) + AFS_SYSNAME="sun4x_57" + ;; + sparc-sun-solaris2.8) + AFS_SYSNAME="sun4x_58" + ;; + sparc-sun-solaris2.9) + AFS_SYSNAME="sun4x_59" + ;; + sparc-sun-sunos4*) + AFS_SYSNAME="sun4_413" + enable_login="yes" + ;; + i386-pc-solaris2.7) + AFS_SYSNAME="sunx86_57" + ;; + i386-pc-solaris2.8) + AFS_SYSNAME="sunx86_58" + ;; + i386-pc-solaris2.9) + AFS_SYSNAME="sunx86_59" + ;; + alpha*-dec-osf4.0*) + AFS_SYSNAME="alpha_dux40" + ;; + alpha*-dec-osf5.0*) + AFS_SYSNAME="alpha_dux50" + ;; + alpha*-dec-osf5.1*) + AFS_SYSNAME="alpha_dux51" + ;; + mips-sgi-irix6.5) + AFS_SYSNAME="sgi_65" + ;; + ia64-*-linux*) + AFS_SYSNAME="ia64_linuxXX" + ;; + powerpc-*-linux*) + AFS_SYSNAME="ppc_linuxXX" + ;; + powerpc64-*-linux*) + AFS_SYSNAME="ppc64_linuxXX" + ;; + alpha*-linux*) + AFS_SYSNAME="alpha_linux_XX" + ;; + s390-*-linux*) + AFS_SYSNAME="s390_linuxXX" + ;; + sparc-*-linux*) + AFS_SYSNAME="sparc_linuxXX" + ;; + sparc64-*-linux*) + AFS_SYSNAME="sparc64_linuxXX" + ;; + i?86-*-linux*) + AFS_SYSNAME="i386_linuxXX" + ;; + parisc-*-linux-gnu) + AFS_SYSNAME="parisc_linuxXX" + enable_pam="no" + ;; + power*-ibm-aix4.2*) + AFS_SYSNAME="rs_aix42" + ;; + power*-ibm-aix4.3*) + AFS_SYSNAME="rs_aix42" + ;; + power*-ibm-aix5.1*) + AFS_SYSNAME="rs_aix51" + ;; + power*-ibm-aix5.2*) + AFS_SYSNAME="rs_aix52" + ;; + x86_64-*-linux-gnu) + AFS_SYSNAME="amd64_linuxXX" + enable_pam="no" + ;; + *) + { echo "configure: error: An AFS sysname is required" 1>&2; exit 1; } + exit 1 + ;; + esac + case $AFS_SYSNAME in + *_linux*) + AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $1 $2}'` + if test "x${AFS_SYSKVERS}" = "x"; then + { echo "configure: error: Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname." 1>&2; exit 1; } + fi + _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/` + AFS_SYSNAME="$_AFS_SYSNAME" + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-I${LINUX_KERNEL_PATH}/include $CPPFLAGS" + cat > conftest.$ac_ext < +int main() { +#ifndef CONFIG_USERMODE + #error not UML + #endif +; return 0; } +EOF +if { (eval echo configure:3977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_is_uml=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + if test "${ac_cv_linux_is_uml}" = yes; then + _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/` + fi + CPPFLAGS="$save_CPPFLAGS" + AFS_SYSNAME="$_AFS_SYSNAME" + ;; + esac + echo "$ac_t""$AFS_SYSNAME" 1>&6 +fi + +# KDUMP64 defaults to KDUMP for systems without a separate kdump64 +KDUMP64='${KDUMP}' +KDUMP=kdump +case $AFS_SYSNAME in + sgi_6?) + KDUMP=kdump.IP20;; + sun4x_5[789] | hp_ux11*) + KDUMP=kdump32 + KDUMP64=kdump64;; + *linux*) + KDUMP='kdump-${LINUX_VERSION}';; +esac + + + +case $AFS_SYSNAME in + *_darwin*) + DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist + DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist + + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_BUF 1 +EOF + + ;; + *) +echo $ac_n "checking for definition of struct buf""... $ac_c" 1>&6 +echo "configure:4022: checking for definition of struct buf" >&5 +if eval "test \"`echo '$''{'ac_cv_have_struct_buf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + ac_cv_have_struct_buf=no + cat > conftest.$ac_ext < +int main() { +struct buf x; + printf("%d\n", sizeof(x)); +; return 0; } +EOF +if { (eval echo configure:4037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_have_struct_buf=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + + +fi + +echo "$ac_t""$ac_cv_have_struct_buf" 1>&6 +if test "$ac_cv_have_struct_buf" = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_BUF 1 +EOF + +fi +;; +esac + + +if eval "test \"`echo '$''{'ac_cv_sockaddr_len'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +echo $ac_n "checking if struct sockaddr has sa_len field""... $ac_c" 1>&6 +echo "configure:4065: checking if struct sockaddr has sa_len field" >&5 +cat > conftest.$ac_ext < +#include +int main() { +struct sockaddr *a; +a->sa_len=0; +; return 0; } +EOF +if { (eval echo configure:4076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sockaddr_len=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_sockaddr_len=no +fi +rm -f conftest* +echo "$ac_t""$ac_cv_sockaddr_len" 1>&6 +fi + +if test "$ac_cv_sockaddr_len" = "yes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_SOCKADDR_HAS_SA_LEN 1 +EOF + +fi +if test "x${MKAFS_OSTYPE}" = "xIRIX"; then + echo Skipping library tests because they confuse Irix. +else + for ac_func in socket +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4101: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + if test "$ac_cv_func_socket" = no; then + for lib in socket inet; do + if test "$HAVE_SOCKET" != 1; then + echo $ac_n "checking for socket in -l${lib}""... $ac_c" 1>&6 +echo "configure:4158: checking for socket in -l${lib}" >&5 +ac_lib_var=`echo ${lib}'_'socket | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l${lib} $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -l$lib";HAVE_SOCKET=1;cat >> confdefs.h <<\EOF +#define HAVE_SOCKET 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + fi + done + fi + + for ac_func in connect +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4207: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + if test "$ac_cv_func_connect" = no; then + for lib in nsl; do + if test "$HAVE_CONNECT" != 1; then + echo $ac_n "checking for connect in -l${lib}""... $ac_c" 1>&6 +echo "configure:4264: checking for connect in -l${lib}" >&5 +ac_lib_var=`echo ${lib}'_'connect | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l${lib} $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -l$lib";HAVE_CONNECT=1;cat >> confdefs.h <<\EOF +#define HAVE_CONNECT 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + fi + done + fi + + for ac_func in gethostbyname +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4313: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + if test "$ac_cv_func_gethostbyname" = no; then + for lib in dns nsl resolv; do + if test "$HAVE_GETHOSTBYNAME" != 1; then + echo $ac_n "checking for gethostbyname in -l${lib}""... $ac_c" 1>&6 +echo "configure:4369: checking for gethostbyname in -l${lib}" >&5 +ac_lib_var=`echo ${lib}'_'gethostbyname | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l${lib} $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;cat >> confdefs.h <<\EOF +#define HAVE_GETHOSTBYNAME 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + fi + done + fi + + echo $ac_n "checking for the useability of arpa/nameser_compat.h""... $ac_c" 1>&6 +echo "configure:4416: checking for the useability of arpa/nameser_compat.h" >&5 + cat > conftest.$ac_ext < + #include + #include + #include + #include + #include + #include + #include + #include + +int main() { +static int i; i = 0; +; return 0; } +EOF +if { (eval echo configure:4435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_ARPA_NAMESER_COMPAT_H 1 +EOF + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + + openafs_save_libs="$LIBS" + echo $ac_n "checking for res_search""... $ac_c" 1>&6 +echo "configure:4453: checking for res_search" >&5 + + ac_cv_func_res_search=no + cat > conftest.$ac_ext < +#include +#include +#ifdef HAVE_ARPA_NAMESER_COMPAT_H +#include +#endif +#include +int main() { + +const char host[11]="openafs.org"; +u_char ans[1024]; +int r; +res_init(); +/* Capture result in r but return 0, since a working nameserver is + * not a requirement for compilation. + */ +r = res_search( host, C_IN, T_MX, (u_char *)&ans, sizeof(ans)); +return 0; + +; return 0; } +EOF +if { (eval echo configure:4481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_res_search=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + + + if test "$ac_cv_func_res_search" = no; then + for lib in dns nsl resolv; do + if test "$ac_cv_func_res_search" != yes; then + LIBS="-l$lib $LIBS" + + ac_cv_func_res_search=no + cat > conftest.$ac_ext < +#include +#include +#ifdef HAVE_ARPA_NAMESER_COMPAT_H +#include +#endif +#include +int main() { + +const char host[11]="openafs.org"; +u_char ans[1024]; +int r; +res_init(); +/* Capture result in r but return 0, since a working nameserver is + * not a requirement for compilation. + */ +r = res_search( host, C_IN, T_MX, (u_char *)&ans, sizeof(ans)); +return 0; + +; return 0; } +EOF +if { (eval echo configure:4522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_res_search=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + + LIBS="$openafs_save_libs" + fi + done + if test "$ac_cv_func_res_search" = yes; then + LIB_res_search="-l$lib" + cat >> confdefs.h <<\EOF +#define HAVE_RES_SEARCH 1 +EOF + + echo "$ac_t""yes, in lib$lib" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + else + cat >> confdefs.h <<\EOF +#define HAVE_RES_SEARCH 1 +EOF + + echo "$ac_t""yes" 1>&6 + fi + +fi + +PTHREAD_LIBS=error +echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6 +echo "configure:4556: checking for pthread_attr_init in -lpthread" >&5 +ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthread $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIBS="-lpthread" +else + echo "$ac_t""no" 1>&6 +fi + +if test "x$PTHREAD_LIBS" = xerror; then + echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6 +echo "configure:4597: checking for pthread_attr_init in -lpthreads" >&5 +ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthreads $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIBS="-lpthreads" +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test "x$PTHREAD_LIBS" = xerror; then + echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6 +echo "configure:4639: checking for pthread_attr_init in -lc_r" >&5 +ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lc_r $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIBS="-lc_r" +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test "x$PTHREAD_LIBS" = xerror; then + echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6 +echo "configure:4681: checking for pthread_attr_init" >&5 +if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_attr_init(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_pthread_attr_init) || defined (__stub___pthread_attr_init) +choke me +#else +pthread_attr_init(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_pthread_attr_init=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_pthread_attr_init=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'pthread_attr_init`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIBS="" +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test "x$PTHREAD_LIBS" = xerror; then + echo "configure: warning: *** Unable to locate working posix thread library ***" 1>&2 +fi + + +WITH_OBSOLETE=NO +if test "$enable_obsolete" = "yes"; then + WITH_OBSOLETE=YES +fi + +WITH_INSECURE=NO +if test "$enable_insecure" = "yes"; then + WITH_INSECURE=YES +fi + +if test "x$with_bsd_kernel_headers" != "x"; then + BSD_KERNEL_PATH="$with_bsd_kernel_headers" +else + BSD_KERNEL_PATH="/usr/src/sys" +fi + +if test "x$with_bsd_kernel_build" != "x"; then + BSD_KERNEL_BUILD="$with_bsd_kernel_build" +else + case $AFS_SYSNAME in + i386_fbsd_4?) + BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/compile/GENERIC" + ;; + i386_fbsd_5?) + BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/i386/compile/GENERIC" + ;; + esac +fi + +# Fast restart +if test "$enable_supergroups" = "yes"; then + cat >> confdefs.h <<\EOF +#define SUPERGROUPS 1 +EOF + +fi + +if test "$enable_fast_restart" = "yes"; then + cat >> confdefs.h <<\EOF +#define FAST_RESTART 1 +EOF + +fi + +if test "$enable_bitmap_later" = "yes"; then + cat >> confdefs.h <<\EOF +#define BITMAP_LATER 1 +EOF + +fi + +if test "$enable_full_vos_listvol_switch" = "yes"; then + cat >> confdefs.h <<\EOF +#define FULL_LISTVOL_SWITCH 1 +EOF + +fi + +if test "$enable_bos_restricted_mode" = "yes"; then + cat >> confdefs.h <<\EOF +#define BOS_RESTRICTED_MODE 1 +EOF + +fi + +if test "$enable_bos_new_config" = "yes"; then + cat >> confdefs.h <<\EOF +#define BOS_NEW_CONFIG 1 +EOF + +fi + +if test "$enable_largefile_fileserver" = "yes"; then + cat >> confdefs.h <<\EOF +#define AFS_LARGEFILE_ENV 1 +EOF + +fi + +if test "$enable_namei_fileserver" = "yes"; then + cat >> confdefs.h <<\EOF +#define AFS_NAMEI_ENV 1 +EOF + +fi + +if test "$enable_afsdb" = "yes"; then + LIB_AFSDB="$LIB_res_search" + cat >> confdefs.h <<\EOF +#define AFS_AFSDB_ENV 1 +EOF + +fi + +echo $ac_n "checking for tivoli tsm butc support""... $ac_c" 1>&6 +echo "configure:4829: checking for tivoli tsm butc support" >&5 +XBSA_CFLAGS="" +if test "$enable_tivoli_tsm" = "yes"; then + XBSADIR1=/usr/tivoli/tsm/client/api/bin/xopen + XBSADIR2=/opt/tivoli/tsm/client/api/bin/xopen + + if test -e "$XBSADIR1/xbsa.h"; then + XBSA_CFLAGS="-Dxbsa -I$XBSADIR1" + echo "$ac_t""yes, $XBSA_CFLAGS" 1>&6 + elif test -e "$XBSADIR2/xbsa.h"; then + XBSA_CFLAGS="-Dxbsa -I$XBSADIR2" + echo "$ac_t""yes, $XBSA_CFLAGS" 1>&6 + else + echo "$ac_t""no, missing xbsa.h header file" 1>&6 + fi +else + echo "$ac_t""no" 1>&6 +fi + + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:4850: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:4863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:4930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 +echo "configure:4954: checking for sys/wait.h that is POSIX.1 compatible" >&5 +if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifndef WEXITSTATUS +#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif +int main() { +int s; +wait (&s); +s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; +; return 0; } +EOF +if { (eval echo configure:4975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_sys_wait_h=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_sys_wait_h=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 +if test $ac_cv_header_sys_wait_h = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_WAIT_H 1 +EOF + +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +echo "configure:5000: checking for $ac_hdr that defines DIR" >&5 +if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include <$ac_hdr> +int main() { +DIR *dirp = 0; +; return 0; } +EOF +if { (eval echo configure:5013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then +echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 +echo "configure:5038: checking for opendir in -ldir" >&5 +ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldir $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -ldir" +else + echo "$ac_t""no" 1>&6 +fi + +else +echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 +echo "configure:5079: checking for opendir in -lx" >&5 +ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lx $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lx" +else + echo "$ac_t""no" 1>&6 +fi + +fi + +for ac_hdr in stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5124: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5164: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in mntent.h sys/vfs.h sys/param.h sys/fs_types.h sys/fstyp.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5204: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in sys/mount.h strings.h termios.h signal.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5244: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in windows.h malloc.h winsock2.h direct.h io.h sys/user.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5284: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in security/pam_modules.h siad.h usersec.h ucontext.h regex.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5324: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + +if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_pam" = yes; then + HAVE_PAM="yes" +else + HAVE_PAM="no" +fi + + +if test "$enable_login" = yes; then + BUILD_LOGIN="yes" +else + BUILD_LOGIN="no" +fi + + +for ac_func in utimes random srandom getdtablesize snprintf strlcat strlcpy re_comp re_exec +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:5378: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in setprogname getprogname sigaction mkstemp vsnprintf strerror +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:5433: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + +for ac_func in regcomp regexec regerror +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:5489: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +echo $ac_n "checking for POSIX regex library""... $ac_c" 1>&6 +echo "configure:5542: checking for POSIX regex library" >&5 +if test "$ac_cv_header_regex_h" = "yes" && \ + test "$ac_cv_func_regcomp" = "yes" && \ + test "$ac_cv_func_regexec" = "yes" && \ + test "$ac_cv_func_regerror" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_POSIX_REGEX 1 +EOF + + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 +echo "configure:5557: checking for ssize_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_ssize_t=yes +else + rm -rf conftest* + ac_cv_type_ssize_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_ssize_t" 1>&6 +if test $ac_cv_type_ssize_t = no; then + cat >> confdefs.h <<\EOF +#define ssize_t int +EOF + +fi + +echo $ac_n "checking size of long""... $ac_c" 1>&6 +echo "configure:5590: checking size of long" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(long)); + exit(0); +} +EOF +if { (eval echo configure:5609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_long=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_long=0 +fi +rm -fr conftest* +fi + +fi +echo "$ac_t""$ac_cv_sizeof_long" 1>&6 +cat >> confdefs.h <&6 +echo "configure:5632: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + +if test "x$enable_transarc_paths" = "xyes" ; then + afsconfdir=${afsconfdir=/usr/afs/etc} + viceetcdir=${viceetcdir=/usr/vice/etc} + afskerneldir=${afskerneldir=${viceetcdir}} + afssrvbindir=${afssrvbindir=/usr/afs/bin} + afssrvsbindir=${afssrvsbindir=/usr/afs/bin} + afssrvlibexecdir=${afssrvlibexecdir=/usr/afs/bin} + afsdbdir=${afsdbdir=/usr/afs/db} + afslogsdir=${afslogsdir=/usr/afs/logs} + afslocaldir=${afslocaldir=/usr/afs/local} + afsbackupdir=${afsbackupdir=/usr/afs/backup} + afsbosconfigdir=${afsbosconfigdir=/usr/afs/local} +else + afsconfdir=${afsconfdir='${sysconfdir}/openafs/server'} + viceetcdir=${viceetcdir='${sysconfdir}/openafs'} + afskerneldir=${afskerneldir='${libdir}/openafs'} + afssrvbindir=${afssrvbindir='${bindir}'} + afssrvsbindir=${afssrvsbindir='${sbindir}'} + afssrvlibexecdir=${afssrvlibexecdir='${libexecdir}/openafs'} + afsdbdir=${afsdbdir='${localstatedir}/openafs/db'} + afslogsdir=${afslogsdir='${localstatedir}/openafs/logs'} + afslocaldir=${afslocaldir='${localstatedir}/openafs'} + afsbackupdir=${afsbackupdir='${localstatedir}/openafs/backup'} + afsbosconfigdir=${afsbosconfigdir='${sysconfdir}/openafs'} +fi + + + + + + + + + + + + +if test "x$enable_kernel_module" = "xyes"; then +ENABLE_KERNEL_MODULE=libafs +fi + + + + + + + + + + + + + + + + + + + + + + +XCFLAGS='${DBG} ${OPTMZ}' +SHLIB_SUFFIX="so" +CC="cc" +CCOBJ="cc" +MT_CC="cc" +XLIBS="${LIB_AFSDB}" + +KERN_DBG=-g +KERN_OPTMZ=-O +DBG=-g +OPTMZ=-O +LWP_DBG=-g +LWP_OPTMZ=-O + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5764: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +for ac_prog in as +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5796: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$AS" && break +done +test -n "$AS" || AS="${am_missing_run}as" + +for ac_prog in ar +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5831: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$AR" && break +done +test -n "$AR" || AR="${am_missing_run}ar" + +for ac_prog in mv +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5866: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_MV'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$MV"; then + ac_cv_prog_MV="$MV" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_MV="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +MV="$ac_cv_prog_MV" +if test -n "$MV"; then + echo "$ac_t""$MV" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$MV" && break +done +test -n "$MV" || MV="${am_missing_run}mv" + +for ac_prog in rm +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5901: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RM'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RM"; then + ac_cv_prog_RM="$RM" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RM="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RM="$ac_cv_prog_RM" +if test -n "$RM"; then + echo "$ac_t""$RM" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$RM" && break +done +test -n "$RM" || RM="${am_missing_run}rm" + +for ac_prog in ld +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5936: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LD"; then + ac_cv_prog_LD="$LD" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_LD="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +LD="$ac_cv_prog_LD" +if test -n "$LD"; then + echo "$ac_t""$LD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$LD" && break +done +test -n "$LD" || LD="${am_missing_run}ld" + +for ac_prog in cp +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5971: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CP"; then + ac_cv_prog_CP="$CP" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CP="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CP="$ac_cv_prog_CP" +if test -n "$CP"; then + echo "$ac_t""$CP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CP" && break +done +test -n "$CP" || CP="${am_missing_run}cp" + +for ac_prog in strip +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:6006: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_STRIP="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +STRIP="$ac_cv_prog_STRIP" +if test -n "$STRIP"; then + echo "$ac_t""$STRIP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$STRIP" && break +done +test -n "$STRIP" || STRIP="${am_missing_run}strip" + +for ac_prog in lorder +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:6041: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LORDER'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LORDER"; then + ac_cv_prog_LORDER="$LORDER" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_LORDER="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +LORDER="$ac_cv_prog_LORDER" +if test -n "$LORDER"; then + echo "$ac_t""$LORDER" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$LORDER" && break +done +test -n "$LORDER" || LORDER="${am_missing_run}lorder" + + + +case $AFS_SYSNAME in + alpha_dux40) + LEX="lex" + CSTATIC="-non_shared" + DBG="-g3" + MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-pthread -lpthread -lmach -lexc -lc" + TXLIBS="-lcurses" + XCFLAGS="-D_NO_PROTO -DOSF" + SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\"" + ;; + + alpha_dux50) + LEX="flex -l" + DBG="-g3" + CSTATIC="-non_shared" + MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-pthread -lpthread -lmach -lexc -lc" + TXLIBS="-lcurses" + XCFLAGS="-D_NO_PROTO -DOSF" + SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\"" + ;; + + alpha_dux51) + LEX="flex -l" + DBG="-g3" + CSTATIC="-non_shared" + LWP_OPTMZ="-O2" + MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-pthread -lpthread -lmach -lexc -lc" + TXLIBS="-lcurses" + XCFLAGS="-D_NO_PROTO -DOSF" + SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\"" + ;; + + alpha_linux_22) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + alpha_linux_24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + hp_ux102) + AS="/usr/ccs/bin/as" + CC="/opt/ansic/bin/cc -Ae" + DBM="/lib/libndbm.a" + LD="/bin/ld" + LEX="/opt/langtools/bin/lex" + LWP_OPTMZ="-O" + MT_CC="/opt/ansic/bin/cc -Ae" + MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-L/opt/dce/lib -ldce" + MV="/bin/mv" + OPTMZ="-O" + PAM_CFLAGS="+DA1.0 +z -Wl,+k" + PAM_LIBS="/usr/lib/libpam.1" + RANLIB="/usr/bin/ranlib" + RM="/bin/rm" + SHLIB_LDFLAGS="-b -Bsymbolic" + SHLIB_SUFFIX="sl" + TXLIBS="/usr/lib/libHcurses.a" + VFSCK_CFLAGS="-D_FILE64" + XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE" + XCFLAGS64="${XCFLAGS0} +DA2.0W" + XCFLAGS="${XCFLAGS0} +DA1.0" + YACC="/opt/langtools/bin/yacc" + SHLIB_LINKER="ld -b" + ;; + + hp_ux11*) + AR="/usr/bin/ar" + AS="/usr/ccs/bin/as" + CC="/opt/ansic/bin/cc" + CCOBJ="/opt/ansic/bin/cc" + DBM="/lib/libndbm.a" + LD="/bin/ld " + LEX="/opt/langtools/bin/lex" + LWP_OPTMZ="-O" + MT_CC="$CC" + MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + MV="/bin/mv" + OPTMZ="-O" + PAM_CFLAGS="+DA1.0 +z -Wl,+k" + PAM_LIBS="/usr/lib/libpam.1" + RANLIB="/usr/bin/ranlib" + RM="/bin/rm" + SHLIB_LDFLAGS="-b -Bsymbolic" + SHLIB_SUFFIX="sl" + TXLIBS="/usr/lib/libHcurses.a" + VFSCK_CFLAGS="-I/usr/old/usr/include -D_FILE64" + XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE" + XCFLAGS64="${XCFLAGS0} +DA2.0W" + XCFLAGS="${XCFLAGS0} +DA1.0" + XLIBELFA="-lelf" + #XLIBS="${LIB_AFSDB} -lnsl" + XLIBS="${LIB_AFSDB}" + YACC="/opt/langtools/bin/yacc" + SHLIB_LINKER="ld -b" + ;; + + ia64_hpux*) + AR="/usr/bin/ar" + AS="/usr/ccs/bin/as" + CC="/opt/ansic/bin/cc" + CCOBJ="/opt/ansic/bin/cc" + DBM="/lib/hpux32/libndbm.so" + LD="/bin/ld " + LEX="/opt/langtools/bin/lex" + LWP_OPTMZ="" + MT_CC="$CC" + MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + MV="/bin/mv" + OPTMZ="-O" + PAM_CFLAGS="-b +z -Wl,+k" + PAM_LIBS="/usr/lib/hpux32/libpam.so" + RANLIB="/usr/bin/ranlib" + RM="/bin/rm" + SHLIB_LDFLAGS="-b -Bsymbolic" + SHLIB_SUFFIX="sl" + TXLIBS="/usr/lib/hpux32/libcurses.so" + VFSCK_CFLAGS="-I/usr/old/usr/include -D_FILE64" + XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive_shared -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE" + XCFLAGS64="${XCFLAGS0} +DD64" + XCFLAGS="${XCFLAGS0}" + XLIBELFA="-lelf" + #XLIBS="${LIB_AFSDB} -lnsl" + XLIBS="${LIB_AFSDB}" + YACC="/opt/langtools/bin/yacc" + SHLIB_LINKER="ld -b" + ;; + + *fbsd_*) + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-pthread" + PAM_CFLAGS="-O2 -pipe -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -pipe" + YACC="byacc" + ;; + + *nbsd20) + LEX="flex -l" + MT_CFLAGS='${XCFLAGS} -DAFS_PTHREAD_ENV -D_REENTRANT ' + MT_LIBS="-lpthread" # XXX -pthread soon + PAM_CFLAGS="-O2 -pipe -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="/usr/lib/libcurses.so" + XCFLAGS="-O2 -pipe" + YACC="yacc" + ;; + + *nbsd15|*nbsd16) + LEX="flex -l" + MT_CFLAGS='${XCFLAGS}' + MT_LIBS="" + PAM_CFLAGS="-O2 -pipe -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="/usr/lib/libcurses.so" + XCFLAGS="-O2 -pipe" + YACC="bison -y" + ;; + + ia64_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE -G0" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + amd64_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + ppc64_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="/usr/lib64/libncurses.so" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + i386_linux22) + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + i386_umlinux22) + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + i386_linux24) + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + DBG=-g + KERN_DBG=-g + LWP_DBG=-g + LWP_OPTMZ=-O2 + OPTMZ=-O2 + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + i386_umlinux24) + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + DBG=-g + KERN_DBG=-g + LWP_DBG=-g + LWP_OPTMZ=-O2 + OPTMZ=-O2 + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + *_obsd*) + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-pthread" + PAM_CFLAGS="-O2 -pipe -fpic" + SHLIB_CFLAGS="-fpic" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="/usr/lib/libcurses.a" + XCFLAGS="-O2" + YACC="yacc" + ;; + + parisc_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + ppc_darwin_12) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + REGEX_OBJ="regex.o" + XCFLAGS="-traditional-cpp" + ;; + + ppc_darwin_13) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + LWP_OPTMZ="-O2" + REGEX_OBJ="regex.o" + XCFLAGS="-no-cpp-precomp" + ;; + + ppc_darwin_14) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + LWP_OPTMZ="-O2" + REGEX_OBJ="regex.o" + XCFLAGS="-no-cpp-precomp" + ;; + + ppc_darwin_60) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + LWP_OPTMZ="-O2" + REGEX_OBJ="regex.o" + XCFLAGS="-no-cpp-precomp" + TXLIBS="-lncurses" + ;; + + ppc_darwin_70) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -D_REENTRANT ${XCFLAGS}' + KROOT= + KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers' + LWP_OPTMZ="-O2" + REGEX_OBJ="regex.o" + XCFLAGS="-no-cpp-precomp" + TXLIBS="-lncurses" + EXTRA_VLIBOBJS="fstab.o" + ;; + + ppc_linux22) + INSTALL="install" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + ppc_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + rs_aix42) + DBG="" + LEX="lex" + LIBSYS_AIX_EXP="afsl.exp" + MT_CC="xlc_r" + MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthreads" + SHLIB_SUFFIX="o" + TXLIBS="-lcurses" + XCFLAGS="-K -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void" + XLIBS="${LIB_AFSDB} -ldl" + SHLIB_LINKER="${MT_CC} -bM:SRE -berok" + AIX64="#" + ;; + + rs_aix51) + DBG="" + LEX="lex" + LIBSYS_AIX_EXP="afsl.exp" + MT_CC="xlc_r" + MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthreads" + SHLIB_SUFFIX="o" + TXLIBS="-lcurses" + XCFLAGS="-K -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void" + XLIBS="${LIB_AFSDB} -ldl" + SHLIB_LINKER="${MT_CC} -bM:SRE -berok" + AIX64="" + ;; + + s390_linux22) + CC="gcc" + CCOBJ="gcc" + LD="gcc" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CC="$CC" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O -g -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + s390_linux24) + CC="gcc" + CCOBJ="gcc" + LD="gcc" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CC="$CC" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O -g -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + sgi_62) + PINSTALL_LIBS=-lmld + AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a" + FSINCLUDES="-I/usr/include/sys/fs" + LEX="lex" + MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + TXLIBS="-lcurses" + XCFLAGS64="-64 -mips3" + XCFLAGS="-o32" + XLDFLAGS64="-64" + XLDFLAGS="-o32" + SHLIB_LINKER="${CC} -shared" + ;; + + sgi_63) + PINSTALL_LIBS=-lmld + AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a" + FSINCLUDES="-I/usr/include/sys/fs" + LEX="lex" + MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + TXLIBS="-lcurses" + XCFLAGS64="-D_BSD_COMPAT -64 -mips3" + XCFLAGS="-D_OLD_TERMIOS -D_BSD_COMPAT -o32" + XLDFLAGS64="-64" + XLDFLAGS="-o32" + SHLIB_LINKER="${CC} -shared" + ;; + + sgi_64) + AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a" + FSINCLUDES="-I/usr/include/sys/fs" + LEX="lex" + MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + TXLIBS="-lcurses" + XCFLAGS64="-D_BSD_COMPAT -64 -mips3" + XCFLAGS="-D_OLD_TERMIOS -D_BSD_COMPAT -n32 -woff 1009,1110,1116,1164,1171,1177,1183,1185,1204,1233,1515,1516,1548,1169,1174,1177,1196,1498,1506,1552" + XLDFLAGS64="-64" + XLDFLAGS="-n32" + SHLIB_LINKER="${CC} -shared" + ;; + + sgi_65) + AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a" + CC="/usr/bin/cc" + CCOBJ="/usr/bin/cc" + FSINCLUDES="-I/usr/include/sys/fs" + LD="/usr/bin/ld" + LEX="lex" + MT_CC="/usr/bin/cc" + MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + TXLIBS="-lcurses" + XCFLAGS64="-64 -mips3" + XCFLAGS="-n32 -mips3 -woff 1009,1110,1116,1164,1171,1177,1183,1185,1204,1233,1515,1516,1548,1169,1174,1177,1196,1498,1506,1552" + XLDFLAGS64="-64 -mips3" + XLDFLAGS="-n32 -mips3" + SHLIB_LINKER="${CC} -shared" + ;; + + sparc64_linux22) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + sparc64_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + sparc_linux22) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + sun4_413) + CCXPG2="/usr/xpg2bin/cc" + CC="gcc" + CCOBJ="gcc" + LEX="lex" + SHLIB_CFLAGS="-PIC" + TXLIBS="-lcurses -ltermcap" + XCFLAGS="" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB}" + LD="ld" + ;; + + sun4x_55) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + SHLIB_CFLAGS="-KPIC" + TXLIBS="-lcurses" + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + LD="/usr/ccs/bin/ld" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sun4x_56) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-L/usr/ccs/lib -lcurses" + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + LD="/usr/ccs/bin/ld" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sun4x_57) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sun4x_58) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sun4x_59) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sunx86_57) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + + sunx86_58) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + +esac + +# +# Special build targets +# +case $AFS_SYSNAME in + sgi_6*) + +echo $ac_n "checking for mem* in sys/systm.h""... $ac_c" 1>&6 +echo "configure:6795: checking for mem* in sys/systm.h" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -D_KERNEL -D__STRING_H__" +if eval "test \"`echo '$''{'ac_cv_irix_sys_systm_h_has_mem_funcs'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +#include +int main() { + +extern void *memcpy(char *, const void *, size_t); + +; return 0; } +EOF +if { (eval echo configure:6813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_irix_sys_systm_h_has_mem_funcs=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_irix_sys_systm_h_has_mem_funcs=yes +fi +rm -f conftest* +fi + +CPPFLAGS="$save_CPPFLAGS" +if test "$ac_cv_irix_sys_systm_h_has_mem_funcs" = "yes"; then + cat >> confdefs.h <<\EOF +#define IRIX_HAS_MEM_FUNCS 1 +EOF + +fi +echo "$ac_t""$ac_cv_irix_sys_systm_h_has_mem_funcs" 1>&6 + + XFS_SIZE_CHECK="xfs_size_check" + install_XFS_SIZE_CHECK='$(DESTDIR)${afssrvsbindir}/xfs_size_check' + dest_XFS_SIZE_CHECK='$(DEST)/root.server/usr/afs/bin/xfs_size_check' + + + + + ;; + + sun4x_*|sunx86_*) + FS_CONV_SOL26="fs_conv_sol26" + install_FS_CONV_SOL26='$(DESTDIR)${afssrvsbindir}/fs_conv_sol26' + dest_FS_CONV_SOL26='$(DEST)/root.server/usr/afs/bin/fs_conv_sol26' + + + + + ;; + + alpha_dux*) + FS_CONV_OSF40D="fs_conv_dux40D" + install_FS_CONV_OSF40D='$(DESTDIR)${afssrvsbindir}/fs_conv_dux40D' + dest_FS_CONV_OSF40D='$(DEST)/root.server/usr/afs/bin/fs_conv_dux40D' + + + + + ;; +esac + +if test "x$enable_debug_kernel" = "xno"; then + KERN_DBG= +fi + +if test "x$enable_optimize_kernel" = "xno"; then + KERN_OPTMZ= +fi + +if test "x$enable_debug" = "xno"; then + DBG= +fi + +if test "x$enable_optimize" = "xno"; then + OPTMZ= +fi + +if test "x$enable_debug_lwp" = "xno"; then + LWP_DBG= +fi + +if test "x$enable_optimize_lwp" = "xno"; then + LWP_OPTMZ= +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +TOP_SRCDIR="${srcdir}/src" +case $TOP_SRCDIR in + /*) + ;; + *) + TOP_SRCDIR=`cd $TOP_SRCDIR; pwd` + ;; +esac + +TOP_OBJDIR="${SRCDIR_PARENT}" +TOP_INCDIR="${SRCDIR_PARENT}/include" +TOP_LIBDIR="${SRCDIR_PARENT}/lib" +if test "${DEST}x" = "x"; then + DEST="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest" +fi + +HELPER_SPLINT="${TOP_SRCDIR}/helper-splint.sh" +HELPER_SPLINTCFG="${TOP_SRCDIR}/splint.cfg" + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "\ +Makefile \ +src/afs/Makefile \ +src/afsd/Makefile \ +src/afsmonitor/Makefile \ +src/afsweb/Makefile \ +src/audit/Makefile \ +src/auth/test/Makefile \ +src/auth/Makefile \ +src/bozo/test/Makefile \ +src/bozo/Makefile \ +src/bu_utils/Makefile \ +src/bubasics/Makefile \ +src/bucoord/Makefile \ +src/budb/Makefile \ +src/butc/Makefile \ +src/butm/Makefile \ +src/cmd/test/Makefile \ +src/cmd/Makefile \ +src/comerr/test/Makefile \ +src/comerr/Makefile \ +src/config/Makefile \ +src/config/Makefile.config \ +src/config/Makefile.version-NOCML \ +src/dauth/Makefile \ +src/des/test/Makefile \ +src/des/Makefile \ +src/des_stub/Makefile \ +src/dir/test/Makefile \ +src/dir/Makefile \ +src/export/Makefile \ +src/finale/Makefile \ +src/fsint/Makefile \ +src/fsprobe/Makefile \ +src/ftpd43+/Makefile \ +src/gtx/Makefile \ +src/inetd/Makefile \ +src/JAVA/libjafs/Makefile \ +src/kauth/test/Makefile \ +src/kauth/Makefile \ +src/libacl/test/Makefile \ +src/libacl/Makefile \ +src/libadmin/adminutil/Makefile \ +src/libadmin/Makefile \ +src/libadmin/bos/Makefile \ +src/libadmin/cfg/test/Makefile \ +src/libadmin/cfg/Makefile \ +src/libadmin/client/Makefile \ +src/libadmin/kas/Makefile \ +src/libadmin/pts/Makefile \ +src/libadmin/samples/Makefile \ +src/libadmin/test/Makefile \ +src/libadmin/vos/Makefile \ +src/libafs/Makefile.common \ +src/libafs/MakefileProto.${MKAFS_OSTYPE} \ +${DARWIN_PLIST} \ +src/libafsauthent/Makefile \ +src/libafsrpc/Makefile \ +src/libuafs/Makefile.common \ +src/libuafs/MakefileProto.${MKAFS_OSTYPE} \ +src/log/test/Makefile \ +src/log/Makefile \ +src/login/Makefile \ +src/lwp/test/Makefile \ +src/lwp/Makefile \ +src/mpp/Makefile \ +src/ntp/Makefile \ +src/null/Makefile \ +src/package/Makefile \ +src/pam/Makefile \ +src/pinstall/test/Makefile \ +src/pinstall/Makefile \ +src/procmgmt/Makefile \ +src/procmgmt/test/Makefile \ +src/ptserver/Makefile \ +src/rcp/Makefile \ +src/rlogind/Makefile \ +src/rsh/Makefile \ +src/rx/Makefile \ +src/rx/bulk.example/Makefile \ +src/rx/bulktest/Makefile \ +src/rx/multi.example/Makefile \ +src/rx/simple.example/Makefile \ +src/rx/test/Makefile \ +src/rxdebug/Makefile \ +src/rxgen/Makefile \ +src/rxkad/Makefile \ +src/rxkad/test/Makefile \ +src/rxstat/Makefile \ +src/scout/Makefile \ +src/sgistuff/Makefile \ +src/shlibafsauthent/Makefile \ +src/shlibafsrpc/Makefile \ +src/sia/Makefile \ +src/sys/Makefile \ +src/tbutc/Makefile \ +src/tests/Makefile \ +src/tests/run-tests \ +src/tests/OpenAFS/Dirpath.pm \ +src/tsm41/Makefile \ +src/tviced/Makefile \ +src/tvolser/Makefile \ +src/ubik/Makefile \ +src/update/Makefile \ +src/usd/test/Makefile \ +src/usd/Makefile \ +src/uss/Makefile \ +src/util/Makefile \ +src/util/test/Makefile \ +src/venus/test/Makefile \ +src/venus/Makefile \ +src/vfsck/Makefile \ +src/viced/Makefile \ +src/vlserver/Makefile \ +src/vol/Makefile \ +src/vol/test/Makefile \ +src/volser/Makefile \ +src/wsadmin.src/Makefile \ +src/xstat/Makefile \ +src/helper-splint.sh \ + src/config/afsconfig.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@CPP@%$CPP%g +s%@LN_S@%$LN_S%g +s%@RANLIB@%$RANLIB%g +s%@YACC@%$YACC%g +s%@LEX@%$LEX%g +s%@LEXLIB@%$LEXLIB%g +s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g +s%@P5PLUS_KOPTS@%$P5PLUS_KOPTS%g +s%@LINUX_GCC_KOPTS@%$LINUX_GCC_KOPTS%g +s%@RHCONFIG_SP@%$RHCONFIG_SP%g +s%@RHCONFIG_MP@%$RHCONFIG_MP%g +s%@MPS@%$MPS%g +s%@HEADER_RT@%$HEADER_RT%g +s%@KDUMP@%$KDUMP%g +s%@KDUMP64@%$KDUMP64%g +s%@PTHREAD_LIBS@%$PTHREAD_LIBS%g +s%@XBSA_CFLAGS@%$XBSA_CFLAGS%g +s%@HAVE_PAM@%$HAVE_PAM%g +s%@BUILD_LOGIN@%$BUILD_LOGIN%g +s%@afsconfdir@%$afsconfdir%g +s%@viceetcdir@%$viceetcdir%g +s%@afskerneldir@%$afskerneldir%g +s%@afssrvbindir@%$afssrvbindir%g +s%@afssrvsbindir@%$afssrvsbindir%g +s%@afssrvlibexecdir@%$afssrvlibexecdir%g +s%@afsdbdir@%$afsdbdir%g +s%@afslogsdir@%$afslogsdir%g +s%@afslocaldir@%$afslocaldir%g +s%@afsbackupdir@%$afsbackupdir%g +s%@afsbosconfigdir@%$afsbosconfigdir%g +s%@AFS_SYSNAME@%$AFS_SYSNAME%g +s%@AFS_PARAM_COMMON@%$AFS_PARAM_COMMON%g +s%@ENABLE_KERNEL_MODULE@%$ENABLE_KERNEL_MODULE%g +s%@LIB_AFSDB@%$LIB_AFSDB%g +s%@LINUX_KERNEL_PATH@%$LINUX_KERNEL_PATH%g +s%@BSD_KERNEL_PATH@%$BSD_KERNEL_PATH%g +s%@BSD_KERNEL_BUILD@%$BSD_KERNEL_BUILD%g +s%@LINUX_VERSION@%$LINUX_VERSION%g +s%@MKAFS_OSTYPE@%$MKAFS_OSTYPE%g +s%@TOP_OBJDIR@%$TOP_OBJDIR%g +s%@TOP_SRCDIR@%$TOP_SRCDIR%g +s%@TOP_INCDIR@%$TOP_INCDIR%g +s%@TOP_LIBDIR@%$TOP_LIBDIR%g +s%@DEST@%$DEST%g +s%@WITH_OBSOLETE@%$WITH_OBSOLETE%g +s%@WITH_INSECURE@%$WITH_INSECURE%g +s%@DARWIN_INFOFILE@%$DARWIN_INFOFILE%g +s%@IRIX_BUILD_IP35@%$IRIX_BUILD_IP35%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@MV@%$MV%g +s%@RM@%$RM%g +s%@LD@%$LD%g +s%@CP@%$CP%g +s%@STRIP@%$STRIP%g +s%@LORDER@%$LORDER%g +s%@XFS_SIZE_CHECK@%$XFS_SIZE_CHECK%g +s%@install_XFS_SIZE_CHECK@%$install_XFS_SIZE_CHECK%g +s%@dest_XFS_SIZE_CHECK@%$dest_XFS_SIZE_CHECK%g +s%@FS_CONV_SOL26@%$FS_CONV_SOL26%g +s%@install_FS_CONV_SOL26@%$install_FS_CONV_SOL26%g +s%@dest_FS_CONV_SOL26@%$dest_FS_CONV_SOL26%g +s%@FS_CONV_OSF40D@%$FS_CONV_OSF40D%g +s%@install_FS_CONV_OSF40D@%$install_FS_CONV_OSF40D%g +s%@dest_FS_CONV_OSF40D@%$dest_FS_CONV_OSF40D%g +s%@CCXPG2@%$CCXPG2%g +s%@CCOBJ@%$CCOBJ%g +s%@AFSD_LIBS@%$AFSD_LIBS%g +s%@AFSD_LDFLAGS@%$AFSD_LDFLAGS%g +s%@AIX64@%$AIX64%g +s%@DBG@%$DBG%g +s%@FSINCLUDES@%$FSINCLUDES%g +s%@KERN_DBG@%$KERN_DBG%g +s%@KERN_OPTMZ@%$KERN_OPTMZ%g +s%@LWP_DBG@%$LWP_DBG%g +s%@LWP_OPTMZ@%$LWP_OPTMZ%g +s%@MT_CC@%$MT_CC%g +s%@MT_CFLAGS@%$MT_CFLAGS%g +s%@MT_LIBS@%$MT_LIBS%g +s%@OPTMZ@%$OPTMZ%g +s%@PAM_CFLAGS@%$PAM_CFLAGS%g +s%@PAM_LIBS@%$PAM_LIBS%g +s%@PINSTALL_LIBS@%$PINSTALL_LIBS%g +s%@REGEX_OBJ@%$REGEX_OBJ%g +s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g +s%@SHLIB_LDFLAGS@%$SHLIB_LDFLAGS%g +s%@SHLIB_LINKER@%$SHLIB_LINKER%g +s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g +s%@TXLIBS@%$TXLIBS%g +s%@VFSCK_CFLAGS@%$VFSCK_CFLAGS%g +s%@XCFLAGS@%$XCFLAGS%g +s%@XCFLAGS64@%$XCFLAGS64%g +s%@XLDFLAGS@%$XLDFLAGS%g +s%@XLDFLAGS64@%$XLDFLAGS64%g +s%@XLIBELFA@%$XLIBELFA%g +s%@XLIBKVM@%$XLIBKVM%g +s%@XLIBS@%$XLIBS%g +s%@HELPER_SPLINT@%$HELPER_SPLINT%g +s%@HELPER_SPLINTCFG@%$HELPER_SPLINTCFG%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/configure-libafs b/configure-libafs new file mode 100644 index 000000000..40f984f26 --- /dev/null +++ b/configure-libafs @@ -0,0 +1,7433 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --with-afs-sysname=sys use sys for the afs sysname +" +ac_help="$ac_help + --enable-obsolete enable obsolete portions of AFS (mpp, ntp and package)" +ac_help="$ac_help + --enable-insecure enable insecure portions of AFS (ftpd, inetd, rcp, rlogind and rsh)" +ac_help="$ac_help + --disable-afsdb disable AFSDB RR support" +ac_help="$ac_help + --disable-pam disable PAM support" +ac_help="$ac_help + --enable-bos-restricted-mode enable bosserver restricted mode which disables certain bosserver functionality" +ac_help="$ac_help + --enable-bos-new-config enable bosserver pickup of BosConfig.new on restarts" +ac_help="$ac_help + --enable-largefile-fileserver enable large file support in fileserver" +ac_help="$ac_help + --enable-namei-fileserver force compilation of namei fileserver in preference to inode fileserver" +ac_help="$ac_help + --enable-supergroups enable support for nested pts groups" +ac_help="$ac_help + --enable-fast-restart enable fast startup of file server without salvaging" +ac_help="$ac_help + --enable-bitmap-later enable fast startup of file server by not reading bitmap till needed" +ac_help="$ac_help + --disable-full-vos-listvol-switch disable vos full listvol switch for formatted output" +ac_help="$ac_help + --with-dux-kernel-headers=path use the kernel headers found at path(optional, defaults to first match in /usr/sys) +" +ac_help="$ac_help + --with-linux-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/linux) +" +ac_help="$ac_help + --with-bsd-kernel-headers=path use the kernel headers found at path(optional, defaults to /usr/src/sys) +" +ac_help="$ac_help + --with-bsd-kernel-build=path use the kernel build found at path(optional, defaults to KSRC/i386/compile/GENERIC) +" +ac_help="$ac_help + --disable-kernel-module disable compilation of the kernel module (defaults to enabled)" +ac_help="$ac_help + --enable-redhat-buildsys enable compilation of the redhat build system kernel (defaults to disabled)" +ac_help="$ac_help + --enable-transarc-paths Use Transarc style paths like /usr/afs and /usr/vice" +ac_help="$ac_help + --enable-tivoli-tsm Enable use of the Tivoli TSM API libraries for butc support" +ac_help="$ac_help + --enable-debug-kernel enable compilation of the kernel module with debugging information (defaults to disabled)" +ac_help="$ac_help + --disable-optimize-kernel disable compilation of the kernel module with optimization (defaults based on platform)" +ac_help="$ac_help + --enable-debug enable compilation of the user space code with debugging information (defaults to disabled)" +ac_help="$ac_help + --disable-optimize disable optimization for compilation of the user space code (defaults to enabled)" +ac_help="$ac_help + --enable-debug-lwp enable compilation of the LWP code with debugging information (defaults to disabled)" +ac_help="$ac_help + --disable-optimize-lwp disable optimization for compilation of the LWP code (defaults to enabled)" +ac_help="$ac_help + --enable-bigendian the target is big endian" +ac_help="$ac_help + --enable-littleendian the target is little endian" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=src/libafs/Makefile.common.in + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:619: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:672: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:729: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=openafs-libafs + +VERSION=devel + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:775: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:788: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:801: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:814: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:827: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:846: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:876: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:927: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:959: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 970 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1001: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1006: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1034: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1066: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1087: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1121: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:1146: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:1226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:1258: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +SRCDIR_PARENT=`pwd` + +#BOZO_SAVE_CORES pam sia +# Check whether --with-afs-sysname or --without-afs-sysname was given. +if test "${with_afs_sysname+set}" = set; then + withval="$with_afs_sysname" + : +fi + +# Check whether --enable-obsolete or --disable-obsolete was given. +if test "${enable_obsolete+set}" = set; then + enableval="$enable_obsolete" + : +else + enable_obsolete="no" +fi + +# Check whether --enable-insecure or --disable-insecure was given. +if test "${enable_insecure+set}" = set; then + enableval="$enable_insecure" + : +else + enable_insecure="no" +fi + +# Check whether --enable-afsdb or --disable-afsdb was given. +if test "${enable_afsdb+set}" = set; then + enableval="$enable_afsdb" + : +else + enable_afsdb="yes" +fi + +# Check whether --enable-pam or --disable-pam was given. +if test "${enable_pam+set}" = set; then + enableval="$enable_pam" + : +else + enable_pam="yes" +fi + +# Check whether --enable-bos-restricted-mode or --disable-bos-restricted-mode was given. +if test "${enable_bos_restricted_mode+set}" = set; then + enableval="$enable_bos_restricted_mode" + : +else + enable_bos_restricted_mode="no" +fi + +# Check whether --enable-bos-new-config or --disable-bos-new-config was given. +if test "${enable_bos_new_config+set}" = set; then + enableval="$enable_bos_new_config" + : +else + enable_bos_new_config="no" +fi + +# Check whether --enable-largefile-fileserver or --disable-largefile-fileserver was given. +if test "${enable_largefile_fileserver+set}" = set; then + enableval="$enable_largefile_fileserver" + : +else + enable_largefile_fileserver="no" +fi + +# Check whether --enable-namei-fileserver or --disable-namei-fileserver was given. +if test "${enable_namei_fileserver+set}" = set; then + enableval="$enable_namei_fileserver" + : +else + enable_namei_fileserver="no" +fi + +# Check whether --enable-supergroups or --disable-supergroups was given. +if test "${enable_supergroups+set}" = set; then + enableval="$enable_supergroups" + : +else + enable_supergroups="no" +fi + +# Check whether --enable-fast-restart or --disable-fast-restart was given. +if test "${enable_fast_restart+set}" = set; then + enableval="$enable_fast_restart" + : +else + enable_fast_restart="no" +fi + +# Check whether --enable-bitmap-later or --disable-bitmap-later was given. +if test "${enable_bitmap_later+set}" = set; then + enableval="$enable_bitmap_later" + : +else + enable_bitmap_later="no" +fi + +# Check whether --enable-full-vos-listvol-switch or --disable-full-vos-listvol-switch was given. +if test "${enable_full_vos_listvol_switch+set}" = set; then + enableval="$enable_full_vos_listvol_switch" + : +else + enable_full_vos_listvol_switch="yes" +fi + +# Check whether --with-dux-kernel-headers or --without-dux-kernel-headers was given. +if test "${with_dux_kernel_headers+set}" = set; then + withval="$with_dux_kernel_headers" + : +fi + +# Check whether --with-linux-kernel-headers or --without-linux-kernel-headers was given. +if test "${with_linux_kernel_headers+set}" = set; then + withval="$with_linux_kernel_headers" + : +fi + +# Check whether --with-bsd-kernel-headers or --without-bsd-kernel-headers was given. +if test "${with_bsd_kernel_headers+set}" = set; then + withval="$with_bsd_kernel_headers" + : +fi + +# Check whether --with-bsd-kernel-build or --without-bsd-kernel-build was given. +if test "${with_bsd_kernel_build+set}" = set; then + withval="$with_bsd_kernel_build" + : +fi + +# Check whether --enable-kernel-module or --disable-kernel-module was given. +if test "${enable_kernel_module+set}" = set; then + enableval="$enable_kernel_module" + : +else + enable_kernel_module="yes" + +fi + +# Check whether --enable-redhat-buildsys or --disable-redhat-buildsys was given. +if test "${enable_redhat_buildsys+set}" = set; then + enableval="$enable_redhat_buildsys" + : +else + enable_redhat_buildsys="no" + +fi + +# Check whether --enable-transarc-paths or --disable-transarc-paths was given. +if test "${enable_transarc_paths+set}" = set; then + enableval="$enable_transarc_paths" + : +else + enable_transarc_paths="no" + +fi + +# Check whether --enable-tivoli-tsm or --disable-tivoli-tsm was given. +if test "${enable_tivoli_tsm+set}" = set; then + enableval="$enable_tivoli_tsm" + : +else + enable_tivoli_tsm="no" + +fi + +# Check whether --enable-debug-kernel or --disable-debug-kernel was given. +if test "${enable_debug_kernel+set}" = set; then + enableval="$enable_debug_kernel" + : +else + enable_debug_kernel="no" + +fi + +# Check whether --enable-optimize-kernel or --disable-optimize-kernel was given. +if test "${enable_optimize_kernel+set}" = set; then + enableval="$enable_optimize_kernel" + : +else + enable_optimize_kernel="yes" + +fi + +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + : +else + enable_debug="no" + +fi + +# Check whether --enable-optimize or --disable-optimize was given. +if test "${enable_optimize+set}" = set; then + enableval="$enable_optimize" + : +else + enable_optimize="yes" + +fi + +# Check whether --enable-debug-lwp or --disable-debug-lwp was given. +if test "${enable_debug_lwp+set}" = set; then + enableval="$enable_debug_lwp" + : +else + enable_debug_lwp="no" + +fi + +# Check whether --enable-optimize-lwp or --disable-optimize-lwp was given. +if test "${enable_optimize_lwp+set}" = set; then + enableval="$enable_optimize_lwp" + : +else + enable_optimize_lwp="yes" + +fi + + +enable_login="no" + +echo $ac_n "checking for AIX""... $ac_c" 1>&6 +echo "configure:1501: checking for AIX" >&5 +cat > conftest.$ac_ext <&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF +#define _ALL_SOURCE 1 +EOF + +else + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + + +echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +echo "configure:1525: checking for POSIXized ISC" >&5 +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 +then + echo "$ac_t""yes" 1>&6 + ISC=yes # If later tests want to check for ISC. + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +else + echo "$ac_t""no" 1>&6 + ISC= +fi + +ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 +echo "configure:1547: checking for minix/config.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + MINIX=yes +else + echo "$ac_t""no" 1>&6 +MINIX= +fi + +if test "$MINIX" = yes; then + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + cat >> confdefs.h <<\EOF +#define _POSIX_1_SOURCE 2 +EOF + + cat >> confdefs.h <<\EOF +#define _MINIX 1 +EOF + +fi + + +echo $ac_n "checking for pid_t""... $ac_c" 1>&6 +echo "configure:1596: checking for pid_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_pid_t=yes +else + rm -rf conftest* + ac_cv_type_pid_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_pid_t" 1>&6 +if test $ac_cv_type_pid_t = no; then + cat >> confdefs.h <<\EOF +#define pid_t int +EOF + +fi + +echo $ac_n "checking for size_t""... $ac_c" 1>&6 +echo "configure:1629: checking for size_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_size_t=yes +else + rm -rf conftest* + ac_cv_type_size_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_size_t" 1>&6 +if test $ac_cv_type_size_t = no; then + cat >> confdefs.h <<\EOF +#define size_t unsigned +EOF + +fi + +echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:1662: checking return type of signal handlers" >&5 +if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int main() { +int i; +; return 0; } +EOF +if { (eval echo configure:1684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_signal=void +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_signal=int +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_type_signal" 1>&6 +cat >> confdefs.h <&6 +echo "configure:1704: checking for __FUNCTION__ and __LINE__ macros" >&5 +if eval "test \"`echo '$''{'ac_cv_compiler_has_function_macro'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +printf("%s:%d", __FUNCTION__, __LINE__); +; return 0; } +EOF +if { (eval echo configure:1717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_compiler_has_function_macro=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_compiler_has_function_macro=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_compiler_has_function_macro" 1>&6 +if test "$ac_cv_compiler_has_function_macro" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_FUNCTION_MACRO 1 +EOF + +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1750: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:1803: checking whether ln -s works" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftestdata +if ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" +else + ac_cv_prog_LN_S=ln +fi +fi +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1826: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +for ac_prog in 'bison -y' byacc +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1858: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_YACC="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +YACC="$ac_cv_prog_YACC" +if test -n "$YACC"; then + echo "$ac_t""$YACC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + +missing_dir=`cd $ac_aux_dir && pwd` +for ac_prog in flex lex +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1894: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_LEX="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +LEX="$ac_cv_prog_LEX" +if test -n "$LEX"; then + echo "$ac_t""$LEX" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$LEX" && break +done +test -n "$LEX" || LEX=""$missing_dir/missing flex"" + +# Extract the first word of "flex", so it can be a program name with args. +set dummy flex; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1927: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_LEX="flex" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex" +fi +fi +LEX="$ac_cv_prog_LEX" +if test -n "$LEX"; then + echo "$ac_t""$LEX" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$LEXLIB" +then + case "$LEX" in + flex*) ac_lib=fl ;; + *) ac_lib=l ;; + esac + echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 +echo "configure:1961: checking for yywrap in -l$ac_lib" >&5 +ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l$ac_lib $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LEXLIB="-l$ac_lib" +else + echo "$ac_t""no" 1>&6 +fi + +fi + +echo $ac_n "checking lex output file root""... $ac_c" 1>&6 +echo "configure:2003: checking lex output file root" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # The minimal lex program is just a single line: %%. But some broken lexes +# (Solaris, I think it was) want two %% lines, so accommodate them. +echo '%% +%%' | $LEX +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; } +fi +fi + +echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 +echo "configure:2024: checking whether yytext is a pointer" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c +ac_save_LIBS="$LIBS" +LIBS="$LIBS $LEXLIB" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_prog_lex_yytext_pointer=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +LIBS="$ac_save_LIBS" +rm -f "${LEX_OUTPUT_ROOT}.c" + +fi + +echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6 +if test $ac_cv_prog_lex_yytext_pointer = yes; then + cat >> confdefs.h <<\EOF +#define YYTEXT_POINTER 1 +EOF + +fi + + + +# Check whether --enable-bigendian or --disable-bigendian was given. +if test "${enable_bigendian+set}" = set; then + enableval="$enable_bigendian" + openafs_cv_c_bigendian=yes +fi + +# Check whether --enable-littleendian or --disable-littleendian was given. +if test "${enable_littleendian+set}" = set; then + enableval="$enable_littleendian" + openafs_cv_c_bigendian=no +fi + +echo $ac_n "checking whether byte order is known at compile time""... $ac_c" 1>&6 +echo "configure:2079: checking whether byte order is known at compile time" >&5 +if eval "test \"`echo '$''{'openafs_cv_c_bigendian_compile'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +int main() { + +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif +; return 0; } +EOF +if { (eval echo configure:2096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_cv_c_bigendian_compile=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_cv_c_bigendian_compile=no +fi +rm -f conftest* +fi + +echo "$ac_t""$openafs_cv_c_bigendian_compile" 1>&6 +echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 +echo "configure:2110: checking whether byte ordering is bigendian" >&5 +if eval "test \"`echo '$''{'openafs_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test "$openafs_cv_c_bigendian_compile" = "yes"; then + cat > conftest.$ac_ext < +#include +int main() { + +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +; return 0; } +EOF +if { (eval echo configure:2129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_cv_c_bigendian=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_cv_c_bigendian=no +fi +rm -f conftest* + else + if test "$cross_compiling" = yes; then + { echo "configure: error: specify either --enable-bigendian or --enable-littleendian" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + openafs_cv_c_bigendian=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + openafs_cv_c_bigendian=yes +fi +rm -fr conftest* +fi + + fi + +fi + +echo "$ac_t""$openafs_cv_c_bigendian" 1>&6 +if test "$openafs_cv_c_bigendian" = "yes"; then + cat >> confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 +EOF +fi +if test "$openafs_cv_c_bigendian_compile" = "yes"; then + cat >> confdefs.h <<\EOF +#define ENDIANESS_IN_SYS_PARAM_H 1 +EOF +fi + + +echo $ac_n "checking your OS""... $ac_c" 1>&6 +echo "configure:2187: checking your OS" >&5 +system=$host +case $system in + *-linux*) + MKAFS_OSTYPE=LINUX + if test "x$enable_redhat_buildsys" = "xyes"; then + cat >> confdefs.h <<\EOF +#define ENABLE_REDHAT_BUILDSYS 1 +EOF + + fi + if test "x$enable_kernel_module" = "xyes"; then + if test "x$with_linux_kernel_headers" != "x"; then + LINUX_KERNEL_PATH="$with_linux_kernel_headers" + else + LINUX_KERNEL_PATH="/usr/src/linux-2.4" + if test ! -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then + LINUX_KERNEL_PATH="/usr/src/linux" + fi + fi + if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then + linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $2 }'|tail -n 1` + if test "x$linux_kvers" = "x"; then + if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then + linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $2 }'|tail -n 1` + if test "x$linux_kvers" = "x"; then + + { echo "configure: error: Linux headers lack version definition 2" 1>&2; exit 1; } + exit 1 + else + LINUX_VERSION="$linux_kvers" + fi + else + { echo "configure: error: Linux headers lack version definition" 1>&2; exit 1; } + exit 1 + fi + else + LINUX_VERSION="$linux_kvers" + fi + else + enable_kernel_module="no" + fi + if test ! -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then + enable_kernel_module="no" + fi + if test "x$enable_kernel_module" = "xno"; then + if test "x$with_linux_kernel_headers" != "x"; then + { echo "configure: error: No usable linux headers found at $LINUX_KERNEL_PATH" 1>&2; exit 1; } + exit 1 + else + echo "configure: warning: No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module" 1>&2 + fi + fi + SUBARCH=default + fi + echo "$ac_t""linux" 1>&6 + if test "x$enable_kernel_module" = "xyes"; then + if test "x$enable_debug_kernel" = "xno"; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer" + fi + +echo $ac_n "checking if $CC accepts -march=pentium""... $ac_c" 1>&6 +echo "configure:2249: checking if $CC accepts -march=pentium" >&5 +save_CFLAGS="$CFLAGS" +CFLAGS="-MARCH=pentium" +if eval "test \"`echo '$''{'openafs_gcc_supports_march'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_gcc_supports_march=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_gcc_supports_march=no +fi +rm -f conftest* +fi + +echo "$ac_t""$openafs_gcc_supports_march" 1>&6 +if test x$openafs_gcc_supports_march = xyes; then + P5PLUS_KOPTS="-march=pentium" +else + P5PLUS_KOPTS="-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2" +fi +CFLAGS="$save_CFLAGS" + + + +echo $ac_n "checking if $CC needs -fno-strength-reduce""... $ac_c" 1>&6 +echo "configure:2287: checking if $CC needs -fno-strength-reduce" >&5 +save_CFLAGS="$CFLAGS" +CFLAGS="-fno-strength-reduce" +if eval "test \"`echo '$''{'openafs_gcc_needs_no_strength_reduce'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_gcc_needs_no_strength_reduce=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_gcc_needs_no_strength_reduce=no +fi +rm -f conftest* +fi + +echo "$ac_t""$openafs_gcc_needs_no_strength_reduce" 1>&6 +if test x$openafs_gcc_needs_no_strength_reduce = xyes; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strength-reduce" +fi +CFLAGS="$save_CFLAGS" + + +echo $ac_n "checking if $CC needs -fno-strict-aliasing""... $ac_c" 1>&6 +echo "configure:2322: checking if $CC needs -fno-strict-aliasing" >&5 +save_CFLAGS="$CFLAGS" +CFLAGS="-fno-strict-aliasing" +if eval "test \"`echo '$''{'openafs_gcc_needs_no_strict_aliasing'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_gcc_needs_no_strict_aliasing=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_gcc_needs_no_strict_aliasing=no +fi +rm -f conftest* +fi + +echo "$ac_t""$openafs_gcc_needs_no_strict_aliasing" 1>&6 +if test x$openafs_gcc_needs_no_strict_aliasing = xyes; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strict-aliasing" +fi +CFLAGS="$save_CFLAGS" + + +echo $ac_n "checking if $CC supports -fno-common""... $ac_c" 1>&6 +echo "configure:2357: checking if $CC supports -fno-common" >&5 +save_CFLAGS="$CFLAGS" +CFLAGS="-fno-common" +if eval "test \"`echo '$''{'openafs_gcc_supports_no_common'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_gcc_supports_no_common=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_gcc_supports_no_common=no +fi +rm -f conftest* +fi + +echo "$ac_t""$openafs_gcc_supports_no_common" 1>&6 +if test x$openafs_gcc_supports_no_common = xyes; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-common" +fi +CFLAGS="$save_CFLAGS" + + +echo $ac_n "checking if $CC supports -pipe""... $ac_c" 1>&6 +echo "configure:2392: checking if $CC supports -pipe" >&5 +save_CFLAGS="$CFLAGS" +CFLAGS="-pipe" +if eval "test \"`echo '$''{'openafs_gcc_supports_pipe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + openafs_gcc_supports_pipe=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + openafs_gcc_supports_pipe=no +fi +rm -f conftest* +fi + +echo "$ac_t""$openafs_gcc_supports_pipe" 1>&6 +if test x$openafs_gcc_supports_pipe = xyes; then + LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -pipe" +fi +CFLAGS="$save_CFLAGS" + + + +echo $ac_n "checking whether to build osi_vfs.h""... $ac_c" 1>&6 +echo "configure:2428: checking whether to build osi_vfs.h" >&5 +configdir=src/config +outputdir=afs +tmpldir=src/afs/LINUX +chmod +x $configdir/make_vnode.pl +$configdir/make_vnode.pl -i $LINUX_KERNEL_PATH -t ${tmpldir} -o $outputdir + + +echo $ac_n "checking for linux/completion.h existance""... $ac_c" 1>&6 +echo "configure:2437: checking for linux/completion.h existance" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_completion_h_exists'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +#include +int main() { +struct completion _c; +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8) +lose +#endif + +; return 0; } +EOF +if { (eval echo configure:2457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_completion_h_exists=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_completion_h_exists=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_completion_h_exists" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for defined for_each_process""... $ac_c" 1>&6 +echo "configure:2473: checking for defined for_each_process" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_defines_for_each_process'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef for_each_process(p) +#error for_each_process not defined +#endif +; return 0; } +EOF +if { (eval echo configure:2490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_defines_for_each_process=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_defines_for_each_process=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_defines_for_each_process" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for defined prev_task""... $ac_c" 1>&6 +echo "configure:2506: checking for defined prev_task" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_defines_prev_task'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef prev_task(p) +#error prev_task not defined +#endif +; return 0; } +EOF +if { (eval echo configure:2523: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_defines_prev_task=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_defines_prev_task=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_defines_prev_task" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported tasklist_lock""... $ac_c" 1>&6 +echo "configure:2539: checking for exported tasklist_lock" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_tasklist_lock'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_tasklist_lock +#error tasklist_lock not exported +#endif +; return 0; } +EOF +if { (eval echo configure:2556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_tasklist_lock=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_tasklist_lock=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_tasklist_lock" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for page_lock in struct address_space""... $ac_c" 1>&6 +echo "configure:2572: checking for page_lock in struct address_space" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_fs_struct_address_space_has_page_lock'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct address_space _a_s; +printf("%x\n", _a_s.page_lock); +; return 0; } +EOF +if { (eval echo configure:2588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_fs_struct_address_space_has_page_lock=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_fs_struct_address_space_has_page_lock=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_fs_struct_address_space_has_page_lock" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for gfp_mask in struct address_space""... $ac_c" 1>&6 +echo "configure:2604: checking for gfp_mask in struct address_space" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_fs_struct_address_space_has_gfp_mask'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct address_space _a; +printf("%d\n", _a.gfp_mask); +; return 0; } +EOF +if { (eval echo configure:2620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_fs_struct_address_space_has_gfp_mask=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_fs_struct_address_space_has_gfp_mask" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for i_alloc_sem in struct inode""... $ac_c" 1>&6 +echo "configure:2636: checking for i_alloc_sem in struct inode" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_fs_struct_inode_has_i_alloc_sem'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct inode _i; +printf("%x\n", _i.i_alloc_sem); +; return 0; } +EOF +if { (eval echo configure:2652: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for i_truncate_sem in struct inode""... $ac_c" 1>&6 +echo "configure:2668: checking for i_truncate_sem in struct inode" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_fs_struct_inode_has_i_truncate_sem'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct inode _i; +printf("%x\n", _i.i_truncate_sem); +; return 0; } +EOF +if { (eval echo configure:2684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for i_dirty_data_buffers in struct inode""... $ac_c" 1>&6 +echo "configure:2700: checking for i_dirty_data_buffers in struct inode" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct inode _inode; +printf("%d\n", _inode.i_dirty_data_buffers); +; return 0; } +EOF +if { (eval echo configure:2716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for i_devices in struct inode""... $ac_c" 1>&6 +echo "configure:2732: checking for i_devices in struct inode" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_fs_struct_inode_has_i_cdev'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct inode _inode; +printf("%d\n", _inode.i_devices); +; return 0; } +EOF +if { (eval echo configure:2748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_devices=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_fs_struct_inode_has_i_devices=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_fs_struct_inode_has_i_devices" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for inode_setattr return type""... $ac_c" 1>&6 +echo "configure:2764: checking for inode_setattr return type" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_func_inode_setattr_returns_int'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct inode _inode; +struct iattr _iattr; +int i; +i = inode_setattr(&_inode, &_iattr); +; return 0; } +EOF +if { (eval echo configure:2782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_func_inode_setattr_returns_int=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_func_inode_setattr_returns_int=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_func_inode_setattr_returns_int" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + + echo $ac_n "checking for linux/syscall.h in kernel""... $ac_c" 1>&6 +echo "configure:2798: checking for linux/syscall.h in kernel" >&5 + if test -f "${LINUX_KERNEL_PATH}/include/linux/syscall.h"; then + ac_linux_syscall=yes + echo "$ac_t""$ac_linux_syscall" 1>&6 + else + ac_linux_syscall=no + echo "$ac_t""$ac_linux_syscall" 1>&6 + fi + + +RHCONFIG_SP="" +RHCONFIG_MP="" +if test "x$enable_redhat_buildsys" = "xyes"; then + echo "configure: warning: Configured to build from a Red Hat SPEC file" 1>&2 +else + echo $ac_n "checking for redhat kernel configuration""... $ac_c" 1>&6 +echo "configure:2814: checking for redhat kernel configuration" >&5 + if test -f "${LINUX_KERNEL_PATH}/include/linux/rhconfig.h"; then + ac_linux_rhconfig=yes + RHCONFIG_SP="-D__BOOT_KERNEL_UP=1 -D__BOOT_KERNEL_SMP=0" + RHCONFIG_MP="-D__BOOT_KERNEL_UP=0 -D__BOOT_KERNEL_SMP=1" + echo "$ac_t""$ac_linux_rhconfig" 1>&6 + if test ! -f "/boot/kernel.h"; then + echo "configure: warning: /boot/kernel.h does not exist. build may fail" 1>&2 + fi + else + ac_linux_rhconfig=no + echo "$ac_t""$ac_linux_rhconfig" 1>&6 + fi +fi + + + + +echo $ac_n "checking for recalc_sigpending arg type""... $ac_c" 1>&6 +echo "configure:2833: checking for recalc_sigpending arg type" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_func_recalc_sigpending_takes_void'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +recalc_sigpending(); +; return 0; } +EOF +if { (eval echo configure:2848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_func_recalc_sigpending_takes_void=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_func_recalc_sigpending_takes_void=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_func_recalc_sigpending_takes_void" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for parent in struct task_struct""... $ac_c" 1>&6 +echo "configure:2864: checking for parent in struct task_struct" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_sched_struct_task_struct_has_parent'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct task_struct _tsk; +printf("%d\n", _tsk.parent); +; return 0; } +EOF +if { (eval echo configure:2880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_parent=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_parent=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_sched_struct_task_struct_has_parent" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for real_parent in struct task_struct""... $ac_c" 1>&6 +echo "configure:2896: checking for real_parent in struct task_struct" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_sched_struct_task_struct_has_real_parent'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct task_struct _tsk; +printf("%d\n", _tsk.real_parent); +; return 0; } +EOF +if { (eval echo configure:2912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_real_parent=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_real_parent=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_sched_struct_task_struct_has_real_parent" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for sig in struct task_struct""... $ac_c" 1>&6 +echo "configure:2928: checking for sig in struct task_struct" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_sched_struct_task_struct_has_sig'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct task_struct _tsk; +printf("%d\n", _tsk.sig); +; return 0; } +EOF +if { (eval echo configure:2944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_sig=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_sig=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_sched_struct_task_struct_has_sig" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for sighand in struct task_struct""... $ac_c" 1>&6 +echo "configure:2960: checking for sighand in struct task_struct" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_sched_struct_task_struct_has_sighand'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct task_struct _tsk; +printf("%d\n", _tsk.sighand); +; return 0; } +EOF +if { (eval echo configure:2976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_sighand=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_sighand=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_sched_struct_task_struct_has_sighand" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for sigmask_lock in struct task_struct""... $ac_c" 1>&6 +echo "configure:2992: checking for sigmask_lock in struct task_struct" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_sched_struct_task_struct_has_sigmask_lock'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct task_struct _tsk; +printf("%d\n", _tsk.sigmask_lock); +; return 0; } +EOF +if { (eval echo configure:3008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +if test "x$enable_redhat_buildsys" = "xyes"; then + MPS=Default +else + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS" + echo $ac_n "checking if kernel uses MODVERSIONS""... $ac_c" 1>&6 +echo "configure:3029: checking if kernel uses MODVERSIONS" >&5 + if eval "test \"`echo '$''{'ac_cv_linux_config_modversions'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +#include + +int main() { +#if !defined(CONFIG_MODVERSIONS) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) +lose; +#endif + +; return 0; } +EOF +if { (eval echo configure:3047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_config_modversions=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_config_modversions=no +fi +rm -f conftest* +fi + + echo "$ac_t""$ac_cv_linux_config_modversions" 1>&6 + echo $ac_n "checking which kernel modules to build""... $ac_c" 1>&6 +echo "configure:3061: checking which kernel modules to build" >&5 + if test "x$ac_linux_rhconfig" = "xyes" -o "x$ac_cv_linux_config_modversions" = "xno"; then + MPS="MP SP" + else + if eval "test \"`echo '$''{'ac_cv_linux_config_smp'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < + +int main() { +#ifndef CONFIG_SMP +lose; +#endif + +; return 0; } +EOF +if { (eval echo configure:3081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_config_smp=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_config_smp=no +fi +rm -f conftest* +fi + + if test "x$ac_cv_linux_config_smp" = "xyes"; then + MPS=MP + else + MPS=SP + fi + fi + CPPFLAGS=$save_CPPFLAGS + echo "$ac_t""$MPS" 1>&6 +fi + + + if test "x$ac_cv_linux_config_modversions" = "xno"; then + echo "configure: warning: Cannot determine sys_call_table status. assuming it isn't exported" 1>&2 + ac_cv_linux_exports_sys_call_table=no + if test -f "$LINUX_KERNEL_PATH/include/asm/ia32_unistd.h"; then + ac_cv_linux_exports_ia32_sys_call_table=yes + fi + else + +echo $ac_n "checking for exported init_mm""... $ac_c" 1>&6 +echo "configure:3113: checking for exported init_mm" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_init_mm'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_init_mm +#error init_mm not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_init_mm=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_init_mm=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_init_mm" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported kallsyms_address_to_symbol""... $ac_c" 1>&6 +echo "configure:3146: checking for exported kallsyms_address_to_symbol" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_kallsyms_address'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_kallsyms_address_to_symbol +#error kallsyms_address_to_symbol not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_kallsyms_address=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_kallsyms_address=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_kallsyms_address" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported kallsyms_symbol_to_address""... $ac_c" 1>&6 +echo "configure:3179: checking for exported kallsyms_symbol_to_address" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_kallsyms_symbol'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_kallsyms_symbol_to_address +#error kallsyms_symbol_to_address not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_kallsyms_symbol=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_kallsyms_symbol=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_kallsyms_symbol" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported sys_call_table""... $ac_c" 1>&6 +echo "configure:3212: checking for exported sys_call_table" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_sys_call_table'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_sys_call_table +#error sys_call_table not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_sys_call_table=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_sys_call_table=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_sys_call_table" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported ia32_sys_call_table""... $ac_c" 1>&6 +echo "configure:3245: checking for exported ia32_sys_call_table" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_ia32_sys_call_table'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_ia32_sys_call_table +#error ia32_sys_call_table not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_ia32_sys_call_table=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_ia32_sys_call_table=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_ia32_sys_call_table" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported sys_chdir""... $ac_c" 1>&6 +echo "configure:3278: checking for exported sys_chdir" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_sys_chdir'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_sys_chdir +#error sys_chdir not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_sys_chdir=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_sys_chdir=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_sys_chdir" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported sys_close""... $ac_c" 1>&6 +echo "configure:3311: checking for exported sys_close" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_sys_close'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_sys_close +#error sys_close not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_sys_close=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_sys_close=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_sys_close" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + +echo $ac_n "checking for exported sys_wait4""... $ac_c" 1>&6 +echo "configure:3344: checking for exported sys_wait4" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +if eval "test \"`echo '$''{'ac_cv_linux_exports_sys_wait4'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +#ifndef __ver_sys_wait4 +#error sys_wait4 not exported +#endif +; return 0; } +EOF +if { (eval echo configure:3361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_exports_sys_wait4=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_linux_exports_sys_wait4=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_linux_exports_sys_wait4" 1>&6 +CPPFLAGS="$save_CPPFLAGS" + if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then + linux_syscall_method=none + if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then + linux_syscall_method=scan + if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then + linux_syscall_method=scan_with_kallsyms_address + fi + fi + if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then + linux_syscall_method=kallsyms_symbol + fi + if test "x$linux_syscall_method" = "xnone"; then + { echo "configure: error: no available sys_call_table access method" 1>&2; exit 1; } + fi + fi + fi + if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define EXPORTED_SYS_CHDIR 1 +EOF + + fi + if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define EXPORTED_SYS_CLOSE 1 +EOF + + fi + if test "x$ac_cv_linux_exports_sys_wait4" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define EXPORTED_SYS_WAIT4 1 +EOF + + fi + if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define EXPORTED_TASKLIST_LOCK 1 +EOF + + fi + if test "x$ac_cv_linux_exports_sys_call_table" = "xyes"; then + cat >> confdefs.h <<\EOF +#define EXPORTED_SYS_CALL_TABLE 1 +EOF + + fi + if test "x$ac_cv_linux_exports_ia32_sys_call_table" = "xyes"; then + cat >> confdefs.h <<\EOF +#define EXPORTED_IA32_SYS_CALL_TABLE 1 +EOF + + fi + if test "x$ac_cv_linux_exports_kallsyms_symbol" = "xyes"; then + cat >> confdefs.h <<\EOF +#define EXPORTED_KALLSYMS_SYMBOL 1 +EOF + + fi + if test "x$ac_cv_linux_exports_kallsyms_address" = "xyes"; then + cat >> confdefs.h <<\EOF +#define EXPORTED_KALLSYMS_ADDRESS 1 +EOF + + fi + if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define COMPLETION_H_EXISTS 1 +EOF + + fi + if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define DEFINED_FOR_EACH_PROCESS 1 +EOF + + fi + if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define DEFINED_PREV_TASK 1 +EOF + + fi + if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define INODE_SETATTR_NOT_VOID 1 +EOF + + fi + if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK 1 +EOF + + fi + if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_ADDRESS_SPACE_HAS_GFP_MASK 1 +EOF + + fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_INODE_HAS_I_TRUNCATE_SEM 1 +EOF + + fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_INODE_HAS_I_ALLOC_SEM 1 +EOF + + fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_INODE_HAS_I_DEVICES 1 +EOF + + fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS 1 +EOF + + fi + if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then + cat >> confdefs.h <<\EOF +#define RECALC_SIGPENDING_TAKES_VOID 1 +EOF + + fi + if test "x$ac_linux_syscall" = "xyes" ; then + cat >> confdefs.h <<\EOF +#define HAVE_KERNEL_LINUX_SYSCALL_H 1 +EOF + + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_TASK_STRUCT_HAS_PARENT 1 +EOF + + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_real_parent" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_TASK_STRUCT_HAS_REAL_PARENT 1 +EOF + + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK 1 +EOF + + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_sighand" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_TASK_STRUCT_HAS_SIGHAND 1 +EOF + + fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_sig" = "xyes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_TASK_STRUCT_HAS_SIG 1 +EOF + + fi + : + fi + ;; + *-solaris*) + MKAFS_OSTYPE=SOLARIS + echo "$ac_t""sun4" 1>&6 + +echo $ac_n "checking for vfs_dqrwlock in struct ufsvfs""... $ac_c" 1>&6 +echo "configure:3549: checking for vfs_dqrwlock in struct ufsvfs" >&5 +if eval "test \"`echo '$''{'ac_cv_solaris_ufsvfs_has_dqrwlock'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct ufsvfs _ufsvfs; +(void) _ufsvfs.vfs_dqrwlock; +; return 0; } +EOF +if { (eval echo configure:3564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_solaris_ufsvfs_has_dqrwlock=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_solaris_ufsvfs_has_dqrwlock=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_solaris_ufsvfs_has_dqrwlock" 1>&6 +if test "$ac_cv_solaris_ufsvfs_has_dqrwlock" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_VFS_DQRWLOCK 1 +EOF + +fi + + +echo $ac_n "checking for p_corefile in struct proc""... $ac_c" 1>&6 +echo "configure:3586: checking for p_corefile in struct proc" >&5 +if eval "test \"`echo '$''{'ac_cv_solaris_proc_has_p_corefile'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct proc _proc; +(void) _proc.p_corefile; +; return 0; } +EOF +if { (eval echo configure:3601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_solaris_proc_has_p_corefile=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_solaris_proc_has_p_corefile=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_solaris_proc_has_p_corefile" 1>&6 +if test "$ac_cv_solaris_proc_has_p_corefile" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_P_COREFILE 1 +EOF + +fi + + +echo $ac_n "checking for fs_rolled in struct proc""... $ac_c" 1>&6 +echo "configure:3623: checking for fs_rolled in struct proc" >&5 +if eval "test \"`echo '$''{'ac_cv_solaris_fs_has_fs_rolled'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +int main() { +struct fs _fs; +(void) _fs.fs_rolled; +; return 0; } +EOF +if { (eval echo configure:3637: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_solaris_fs_has_fs_rolled=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_solaris_fs_has_fs_rolled=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_solaris_fs_has_fs_rolled" 1>&6 +if test "$ac_cv_solaris_fs_has_fs_rolled" = "yes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_FS_HAS_FS_ROLLED 1 +EOF + +fi + + ;; + *-sunos*) + MKAFS_OSTYPE=SUNOS + enable_kernel_module=no + echo "$ac_t""sun4" 1>&6 + ;; + *-hpux*) + MKAFS_OSTYPE=HPUX + echo "$ac_t""hp_ux" 1>&6 + ;; + *-irix*) + if test -d /usr/include/sys/SN/SN1; then + IRIX_BUILD_IP35="IP35" + fi + MKAFS_OSTYPE=IRIX + echo "$ac_t""sgi" 1>&6 + ;; + *-aix*) + MKAFS_OSTYPE=AIX + echo "$ac_t""rs_aix" 1>&6 + ;; + *-osf*) + MKAFS_OSTYPE=DUX + echo "$ac_t""alpha_dux" 1>&6 + if test "x$enable_kernel_module" = "xyes"; then + if test "x$with_dux_kernel_headers" != "x"; then + HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'` + else + HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'` + fi + fi + if test "$HEADER_RT" = "*" ; then + { echo "configure: error: Need a configured kernel directory" 1>&2; exit 1; } + fi + + ;; + *-darwin*) + MKAFS_OSTYPE=DARWIN + echo "$ac_t""ppc_darwin" 1>&6 + ;; + *-freebsd*) + MKAFS_OSTYPE=FBSD + echo "$ac_t""i386_fbsd" 1>&6 + ;; + *-netbsd*) + MKAFS_OSTYPE=NBSD + echo "$ac_t""nbsd" 1>&6 + ;; + *-openbsd*) + MKAFS_OSTYPE=OBSD + echo "$ac_t""i386_obsd" 1>&6 + ;; + *) + echo "$ac_t""$system" 1>&6 + ;; +esac + +if test "x$with_afs_sysname" != "x"; then + AFS_SYSNAME="$with_afs_sysname" +else + echo $ac_n "checking your AFS sysname""... $ac_c" 1>&6 +echo "configure:3718: checking your AFS sysname" >&5 + case $host in + i?86-*-openbsd3.1) + AFS_SYSNAME="i386_obsd31" + ;; + i?86-*-openbsd3.2) + AFS_SYSNAME="i386_obsd32" + ;; + i?86-*-openbsd3.3) + AFS_SYSNAME="i386_obsd33" + ;; + i?86-*-openbsd3.4) + AFS_SYSNAME="i386_obsd34" + ;; + i?86-*-openbsd3.5) + AFS_SYSNAME="i386_obsd35" + ;; + i?86-*-freebsd4.2*) + AFS_SYSNAME="i386_fbsd_42" + ;; + i?86-*-freebsd4.3*) + AFS_SYSNAME="i386_fbsd_43" + ;; + i?86-*-freebsd4.4*) + AFS_SYSNAME="i386_fbsd_44" + ;; + i?86-*-freebsd4.5*) + AFS_SYSNAME="i386_fbsd_45" + ;; + i?86-*-freebsd4.6*) + AFS_SYSNAME="i386_fbsd_46" + ;; + i?86-*-freebsd4.7*) + AFS_SYSNAME="i386_fbsd_47" + ;; + i?86-*-freebsd5.0*) + AFS_SYSNAME="i386_fbsd_50" + ;; + i?86-*-freebsd5.1*) + AFS_SYSNAME="i386_fbsd_51" + ;; + i?86-*-freebsd5.2*) + AFS_SYSNAME="i386_fbsd_52" + ;; + i?86-*-netbsd*1.5*) + AFS_PARAM_COMMON=param.nbsd15.h + AFS_SYSNAME="i386_nbsd15" + ;; + alpha-*-netbsd*1.5*) + AFS_PARAM_COMMON=param.nbsd15.h + AFS_SYSNAME="alpha_nbsd15" + ;; + i?86-*-netbsd*1.6[M-Z]*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="i386_nbsd20" + ;; + powerpc-*-netbsd*1.6[M-Z]*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="ppc_nbsd20" + ;; + i?86-*-netbsd*2.0*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="i386_nbsd20" + ;; + powerpc-*-netbsd*2.0*) + AFS_PARAM_COMMON=param.nbsd20.h + AFS_SYSNAME="ppc_nbsd20" + ;; + i?86-*-netbsd*1.6*) + AFS_PARAM_COMMON=param.nbsd16.h + AFS_SYSNAME="i386_nbsd16" + ;; + alpha-*-netbsd*1.6*) + AFS_PARAM_COMMON=param.nbsd16.h + AFS_SYSNAME="alpha_nbsd16" + ;; + powerpc-*-netbsd*1.6*) + AFS_PARAM_COMMON=param.nbsd16.h + AFS_SYSNAME="ppc_nbsd16" + ;; + hppa*-hp-hpux11.0*) + AFS_SYSNAME="hp_ux110" + ;; + hppa*-hp-hpux11.11) + AFS_SYSNAME="hp_ux11i" + ;; + ia64-hp-hpux11.22) + AFS_SYSNAME="ia64_hpux1122" + ;; + ia64-hp-hpux*) + AFS_SYSNAME="ia64_hpux1123" + ;; + hppa*-hp-hpux10*) + AFS_SYSNAME="hp_ux102" + ;; + powerpc-apple-darwin1.2*) + AFS_SYSNAME="ppc_darwin_12" + ;; + powerpc-apple-darwin1.3*) + AFS_SYSNAME="ppc_darwin_13" + ;; + powerpc-apple-darwin1.4*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.1*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.2*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.3*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.4*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin5.5*) + AFS_SYSNAME="ppc_darwin_14" + ;; + powerpc-apple-darwin6.0*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.1*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.2*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.3*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.4*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin6.5*) + AFS_SYSNAME="ppc_darwin_60" + ;; + powerpc-apple-darwin7.0*) + AFS_SYSNAME="ppc_darwin_70" + ;; + powerpc-apple-darwin7.1*) + AFS_SYSNAME="ppc_darwin_70" + ;; + powerpc-apple-darwin7.2*) + AFS_SYSNAME="ppc_darwin_70" + ;; + powerpc-apple-darwin7.3*) + AFS_SYSNAME="ppc_darwin_70" + ;; + sparc-sun-solaris2.5*) + AFS_SYSNAME="sun4x_55" + enable_login="yes" + ;; + sparc-sun-solaris2.6) + AFS_SYSNAME="sun4x_56" + ;; + sparc-sun-solaris2.7) + AFS_SYSNAME="sun4x_57" + ;; + sparc-sun-solaris2.8) + AFS_SYSNAME="sun4x_58" + ;; + sparc-sun-solaris2.9) + AFS_SYSNAME="sun4x_59" + ;; + sparc-sun-sunos4*) + AFS_SYSNAME="sun4_413" + enable_login="yes" + ;; + i386-pc-solaris2.7) + AFS_SYSNAME="sunx86_57" + ;; + i386-pc-solaris2.8) + AFS_SYSNAME="sunx86_58" + ;; + i386-pc-solaris2.9) + AFS_SYSNAME="sunx86_59" + ;; + alpha*-dec-osf4.0*) + AFS_SYSNAME="alpha_dux40" + ;; + alpha*-dec-osf5.0*) + AFS_SYSNAME="alpha_dux50" + ;; + alpha*-dec-osf5.1*) + AFS_SYSNAME="alpha_dux51" + ;; + mips-sgi-irix6.5) + AFS_SYSNAME="sgi_65" + ;; + ia64-*-linux*) + AFS_SYSNAME="ia64_linuxXX" + ;; + powerpc-*-linux*) + AFS_SYSNAME="ppc_linuxXX" + ;; + powerpc64-*-linux*) + AFS_SYSNAME="ppc64_linuxXX" + ;; + alpha*-linux*) + AFS_SYSNAME="alpha_linux_XX" + ;; + s390-*-linux*) + AFS_SYSNAME="s390_linuxXX" + ;; + sparc-*-linux*) + AFS_SYSNAME="sparc_linuxXX" + ;; + sparc64-*-linux*) + AFS_SYSNAME="sparc64_linuxXX" + ;; + i?86-*-linux*) + AFS_SYSNAME="i386_linuxXX" + ;; + parisc-*-linux-gnu) + AFS_SYSNAME="parisc_linuxXX" + enable_pam="no" + ;; + power*-ibm-aix4.2*) + AFS_SYSNAME="rs_aix42" + ;; + power*-ibm-aix4.3*) + AFS_SYSNAME="rs_aix42" + ;; + power*-ibm-aix5.1*) + AFS_SYSNAME="rs_aix51" + ;; + power*-ibm-aix5.2*) + AFS_SYSNAME="rs_aix52" + ;; + x86_64-*-linux-gnu) + AFS_SYSNAME="amd64_linuxXX" + enable_pam="no" + ;; + *) + { echo "configure: error: An AFS sysname is required" 1>&2; exit 1; } + exit 1 + ;; + esac + case $AFS_SYSNAME in + *_linux*) + AFS_SYSKVERS=`echo $LINUX_VERSION | awk -F\. '{print $1 $2}'` + if test "x${AFS_SYSKVERS}" = "x"; then + { echo "configure: error: Couldn't guess your Linux version. Please use the --with-afs-sysname option to configure an AFS sysname." 1>&2; exit 1; } + fi + _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/` + AFS_SYSNAME="$_AFS_SYSNAME" + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-I${LINUX_KERNEL_PATH}/include $CPPFLAGS" + cat > conftest.$ac_ext < +int main() { +#ifndef CONFIG_USERMODE + #error not UML + #endif +; return 0; } +EOF +if { (eval echo configure:3977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_linux_is_uml=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + if test "${ac_cv_linux_is_uml}" = yes; then + _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/` + fi + CPPFLAGS="$save_CPPFLAGS" + AFS_SYSNAME="$_AFS_SYSNAME" + ;; + esac + echo "$ac_t""$AFS_SYSNAME" 1>&6 +fi + +# KDUMP64 defaults to KDUMP for systems without a separate kdump64 +KDUMP64='${KDUMP}' +KDUMP=kdump +case $AFS_SYSNAME in + sgi_6?) + KDUMP=kdump.IP20;; + sun4x_5[789] | hp_ux11*) + KDUMP=kdump32 + KDUMP64=kdump64;; + *linux*) + KDUMP='kdump-${LINUX_VERSION}';; +esac + + + +case $AFS_SYSNAME in + *_darwin*) + DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist + DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist + + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_BUF 1 +EOF + + ;; + *) +echo $ac_n "checking for definition of struct buf""... $ac_c" 1>&6 +echo "configure:4022: checking for definition of struct buf" >&5 +if eval "test \"`echo '$''{'ac_cv_have_struct_buf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + ac_cv_have_struct_buf=no + cat > conftest.$ac_ext < +int main() { +struct buf x; + printf("%d\n", sizeof(x)); +; return 0; } +EOF +if { (eval echo configure:4037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_have_struct_buf=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + + +fi + +echo "$ac_t""$ac_cv_have_struct_buf" 1>&6 +if test "$ac_cv_have_struct_buf" = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_BUF 1 +EOF + +fi +;; +esac + + +if eval "test \"`echo '$''{'ac_cv_sockaddr_len'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +echo $ac_n "checking if struct sockaddr has sa_len field""... $ac_c" 1>&6 +echo "configure:4065: checking if struct sockaddr has sa_len field" >&5 +cat > conftest.$ac_ext < +#include +int main() { +struct sockaddr *a; +a->sa_len=0; +; return 0; } +EOF +if { (eval echo configure:4076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sockaddr_len=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_sockaddr_len=no +fi +rm -f conftest* +echo "$ac_t""$ac_cv_sockaddr_len" 1>&6 +fi + +if test "$ac_cv_sockaddr_len" = "yes"; then + cat >> confdefs.h <<\EOF +#define STRUCT_SOCKADDR_HAS_SA_LEN 1 +EOF + +fi +if test "x${MKAFS_OSTYPE}" = "xIRIX"; then + echo Skipping library tests because they confuse Irix. +else + for ac_func in socket +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4101: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + if test "$ac_cv_func_socket" = no; then + for lib in socket inet; do + if test "$HAVE_SOCKET" != 1; then + echo $ac_n "checking for socket in -l${lib}""... $ac_c" 1>&6 +echo "configure:4158: checking for socket in -l${lib}" >&5 +ac_lib_var=`echo ${lib}'_'socket | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l${lib} $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -l$lib";HAVE_SOCKET=1;cat >> confdefs.h <<\EOF +#define HAVE_SOCKET 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + fi + done + fi + + for ac_func in connect +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4207: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + if test "$ac_cv_func_connect" = no; then + for lib in nsl; do + if test "$HAVE_CONNECT" != 1; then + echo $ac_n "checking for connect in -l${lib}""... $ac_c" 1>&6 +echo "configure:4264: checking for connect in -l${lib}" >&5 +ac_lib_var=`echo ${lib}'_'connect | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l${lib} $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -l$lib";HAVE_CONNECT=1;cat >> confdefs.h <<\EOF +#define HAVE_CONNECT 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + fi + done + fi + + for ac_func in gethostbyname +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4313: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + if test "$ac_cv_func_gethostbyname" = no; then + for lib in dns nsl resolv; do + if test "$HAVE_GETHOSTBYNAME" != 1; then + echo $ac_n "checking for gethostbyname in -l${lib}""... $ac_c" 1>&6 +echo "configure:4369: checking for gethostbyname in -l${lib}" >&5 +ac_lib_var=`echo ${lib}'_'gethostbyname | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-l${lib} $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -l$lib";HAVE_GETHOSTBYNAME=1;cat >> confdefs.h <<\EOF +#define HAVE_GETHOSTBYNAME 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + fi + done + fi + + echo $ac_n "checking for the useability of arpa/nameser_compat.h""... $ac_c" 1>&6 +echo "configure:4416: checking for the useability of arpa/nameser_compat.h" >&5 + cat > conftest.$ac_ext < + #include + #include + #include + #include + #include + #include + #include + #include + +int main() { +static int i; i = 0; +; return 0; } +EOF +if { (eval echo configure:4435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_ARPA_NAMESER_COMPAT_H 1 +EOF + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + + openafs_save_libs="$LIBS" + echo $ac_n "checking for res_search""... $ac_c" 1>&6 +echo "configure:4453: checking for res_search" >&5 + + ac_cv_func_res_search=no + cat > conftest.$ac_ext < +#include +#include +#ifdef HAVE_ARPA_NAMESER_COMPAT_H +#include +#endif +#include +int main() { + +const char host[11]="openafs.org"; +u_char ans[1024]; +int r; +res_init(); +/* Capture result in r but return 0, since a working nameserver is + * not a requirement for compilation. + */ +r = res_search( host, C_IN, T_MX, (u_char *)&ans, sizeof(ans)); +return 0; + +; return 0; } +EOF +if { (eval echo configure:4481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_res_search=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + + + if test "$ac_cv_func_res_search" = no; then + for lib in dns nsl resolv; do + if test "$ac_cv_func_res_search" != yes; then + LIBS="-l$lib $LIBS" + + ac_cv_func_res_search=no + cat > conftest.$ac_ext < +#include +#include +#ifdef HAVE_ARPA_NAMESER_COMPAT_H +#include +#endif +#include +int main() { + +const char host[11]="openafs.org"; +u_char ans[1024]; +int r; +res_init(); +/* Capture result in r but return 0, since a working nameserver is + * not a requirement for compilation. + */ +r = res_search( host, C_IN, T_MX, (u_char *)&ans, sizeof(ans)); +return 0; + +; return 0; } +EOF +if { (eval echo configure:4522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_res_search=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + + LIBS="$openafs_save_libs" + fi + done + if test "$ac_cv_func_res_search" = yes; then + LIB_res_search="-l$lib" + cat >> confdefs.h <<\EOF +#define HAVE_RES_SEARCH 1 +EOF + + echo "$ac_t""yes, in lib$lib" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + else + cat >> confdefs.h <<\EOF +#define HAVE_RES_SEARCH 1 +EOF + + echo "$ac_t""yes" 1>&6 + fi + +fi + +PTHREAD_LIBS=error +echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6 +echo "configure:4556: checking for pthread_attr_init in -lpthread" >&5 +ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthread $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIBS="-lpthread" +else + echo "$ac_t""no" 1>&6 +fi + +if test "x$PTHREAD_LIBS" = xerror; then + echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6 +echo "configure:4597: checking for pthread_attr_init in -lpthreads" >&5 +ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthreads $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIBS="-lpthreads" +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test "x$PTHREAD_LIBS" = xerror; then + echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6 +echo "configure:4639: checking for pthread_attr_init in -lc_r" >&5 +ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lc_r $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIBS="-lc_r" +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test "x$PTHREAD_LIBS" = xerror; then + echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6 +echo "configure:4681: checking for pthread_attr_init" >&5 +if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_attr_init(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_pthread_attr_init) || defined (__stub___pthread_attr_init) +choke me +#else +pthread_attr_init(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_pthread_attr_init=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_pthread_attr_init=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'pthread_attr_init`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIBS="" +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test "x$PTHREAD_LIBS" = xerror; then + echo "configure: warning: *** Unable to locate working posix thread library ***" 1>&2 +fi + + +WITH_OBSOLETE=NO +if test "$enable_obsolete" = "yes"; then + WITH_OBSOLETE=YES +fi + +WITH_INSECURE=NO +if test "$enable_insecure" = "yes"; then + WITH_INSECURE=YES +fi + +if test "x$with_bsd_kernel_headers" != "x"; then + BSD_KERNEL_PATH="$with_bsd_kernel_headers" +else + BSD_KERNEL_PATH="/usr/src/sys" +fi + +if test "x$with_bsd_kernel_build" != "x"; then + BSD_KERNEL_BUILD="$with_bsd_kernel_build" +else + case $AFS_SYSNAME in + i386_fbsd_4?) + BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/compile/GENERIC" + ;; + i386_fbsd_5?) + BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/i386/compile/GENERIC" + ;; + esac +fi + +# Fast restart +if test "$enable_supergroups" = "yes"; then + cat >> confdefs.h <<\EOF +#define SUPERGROUPS 1 +EOF + +fi + +if test "$enable_fast_restart" = "yes"; then + cat >> confdefs.h <<\EOF +#define FAST_RESTART 1 +EOF + +fi + +if test "$enable_bitmap_later" = "yes"; then + cat >> confdefs.h <<\EOF +#define BITMAP_LATER 1 +EOF + +fi + +if test "$enable_full_vos_listvol_switch" = "yes"; then + cat >> confdefs.h <<\EOF +#define FULL_LISTVOL_SWITCH 1 +EOF + +fi + +if test "$enable_bos_restricted_mode" = "yes"; then + cat >> confdefs.h <<\EOF +#define BOS_RESTRICTED_MODE 1 +EOF + +fi + +if test "$enable_bos_new_config" = "yes"; then + cat >> confdefs.h <<\EOF +#define BOS_NEW_CONFIG 1 +EOF + +fi + +if test "$enable_largefile_fileserver" = "yes"; then + cat >> confdefs.h <<\EOF +#define AFS_LARGEFILE_ENV 1 +EOF + +fi + +if test "$enable_namei_fileserver" = "yes"; then + cat >> confdefs.h <<\EOF +#define AFS_NAMEI_ENV 1 +EOF + +fi + +if test "$enable_afsdb" = "yes"; then + LIB_AFSDB="$LIB_res_search" + cat >> confdefs.h <<\EOF +#define AFS_AFSDB_ENV 1 +EOF + +fi + +echo $ac_n "checking for tivoli tsm butc support""... $ac_c" 1>&6 +echo "configure:4829: checking for tivoli tsm butc support" >&5 +XBSA_CFLAGS="" +if test "$enable_tivoli_tsm" = "yes"; then + XBSADIR1=/usr/tivoli/tsm/client/api/bin/xopen + XBSADIR2=/opt/tivoli/tsm/client/api/bin/xopen + + if test -e "$XBSADIR1/xbsa.h"; then + XBSA_CFLAGS="-Dxbsa -I$XBSADIR1" + echo "$ac_t""yes, $XBSA_CFLAGS" 1>&6 + elif test -e "$XBSADIR2/xbsa.h"; then + XBSA_CFLAGS="-Dxbsa -I$XBSADIR2" + echo "$ac_t""yes, $XBSA_CFLAGS" 1>&6 + else + echo "$ac_t""no, missing xbsa.h header file" 1>&6 + fi +else + echo "$ac_t""no" 1>&6 +fi + + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:4850: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:4863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:4930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 +echo "configure:4954: checking for sys/wait.h that is POSIX.1 compatible" >&5 +if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifndef WEXITSTATUS +#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif +int main() { +int s; +wait (&s); +s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; +; return 0; } +EOF +if { (eval echo configure:4975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_sys_wait_h=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_sys_wait_h=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 +if test $ac_cv_header_sys_wait_h = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_WAIT_H 1 +EOF + +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +echo "configure:5000: checking for $ac_hdr that defines DIR" >&5 +if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include <$ac_hdr> +int main() { +DIR *dirp = 0; +; return 0; } +EOF +if { (eval echo configure:5013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then +echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 +echo "configure:5038: checking for opendir in -ldir" >&5 +ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldir $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -ldir" +else + echo "$ac_t""no" 1>&6 +fi + +else +echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 +echo "configure:5079: checking for opendir in -lx" >&5 +ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lx $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lx" +else + echo "$ac_t""no" 1>&6 +fi + +fi + +for ac_hdr in stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5124: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5164: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in mntent.h sys/vfs.h sys/param.h sys/fs_types.h sys/fstyp.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5204: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in sys/mount.h strings.h termios.h signal.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5244: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in windows.h malloc.h winsock2.h direct.h io.h sys/user.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5284: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in security/pam_modules.h siad.h usersec.h ucontext.h regex.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5324: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + +if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_pam" = yes; then + HAVE_PAM="yes" +else + HAVE_PAM="no" +fi + + +if test "$enable_login" = yes; then + BUILD_LOGIN="yes" +else + BUILD_LOGIN="no" +fi + + +for ac_func in utimes random srandom getdtablesize snprintf strlcat strlcpy re_comp re_exec +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:5378: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in setprogname getprogname sigaction mkstemp vsnprintf strerror +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:5433: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + +for ac_func in regcomp regexec regerror +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:5489: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +echo $ac_n "checking for POSIX regex library""... $ac_c" 1>&6 +echo "configure:5542: checking for POSIX regex library" >&5 +if test "$ac_cv_header_regex_h" = "yes" && \ + test "$ac_cv_func_regcomp" = "yes" && \ + test "$ac_cv_func_regexec" = "yes" && \ + test "$ac_cv_func_regerror" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_POSIX_REGEX 1 +EOF + + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 +echo "configure:5557: checking for ssize_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_ssize_t=yes +else + rm -rf conftest* + ac_cv_type_ssize_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_ssize_t" 1>&6 +if test $ac_cv_type_ssize_t = no; then + cat >> confdefs.h <<\EOF +#define ssize_t int +EOF + +fi + +echo $ac_n "checking size of long""... $ac_c" 1>&6 +echo "configure:5590: checking size of long" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(long)); + exit(0); +} +EOF +if { (eval echo configure:5609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_long=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_long=0 +fi +rm -fr conftest* +fi + +fi +echo "$ac_t""$ac_cv_sizeof_long" 1>&6 +cat >> confdefs.h <&6 +echo "configure:5632: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + +if test "x$enable_transarc_paths" = "xyes" ; then + afsconfdir=${afsconfdir=/usr/afs/etc} + viceetcdir=${viceetcdir=/usr/vice/etc} + afskerneldir=${afskerneldir=${viceetcdir}} + afssrvbindir=${afssrvbindir=/usr/afs/bin} + afssrvsbindir=${afssrvsbindir=/usr/afs/bin} + afssrvlibexecdir=${afssrvlibexecdir=/usr/afs/bin} + afsdbdir=${afsdbdir=/usr/afs/db} + afslogsdir=${afslogsdir=/usr/afs/logs} + afslocaldir=${afslocaldir=/usr/afs/local} + afsbackupdir=${afsbackupdir=/usr/afs/backup} + afsbosconfigdir=${afsbosconfigdir=/usr/afs/local} +else + afsconfdir=${afsconfdir='${sysconfdir}/openafs/server'} + viceetcdir=${viceetcdir='${sysconfdir}/openafs'} + afskerneldir=${afskerneldir='${libdir}/openafs'} + afssrvbindir=${afssrvbindir='${bindir}'} + afssrvsbindir=${afssrvsbindir='${sbindir}'} + afssrvlibexecdir=${afssrvlibexecdir='${libexecdir}/openafs'} + afsdbdir=${afsdbdir='${localstatedir}/openafs/db'} + afslogsdir=${afslogsdir='${localstatedir}/openafs/logs'} + afslocaldir=${afslocaldir='${localstatedir}/openafs'} + afsbackupdir=${afsbackupdir='${localstatedir}/openafs/backup'} + afsbosconfigdir=${afsbosconfigdir='${sysconfdir}/openafs'} +fi + + + + + + + + + + + + +if test "x$enable_kernel_module" = "xyes"; then +ENABLE_KERNEL_MODULE=libafs +fi + + + + + + + + + + + + + + + + + + + + + + +XCFLAGS='${DBG} ${OPTMZ}' +SHLIB_SUFFIX="so" +CC="cc" +CCOBJ="cc" +MT_CC="cc" +XLIBS="${LIB_AFSDB}" + +KERN_DBG=-g +KERN_OPTMZ=-O +DBG=-g +OPTMZ=-O +LWP_DBG=-g +LWP_OPTMZ=-O + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5764: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +for ac_prog in as +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5796: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$AS" && break +done +test -n "$AS" || AS="${am_missing_run}as" + +for ac_prog in ar +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5831: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$AR" && break +done +test -n "$AR" || AR="${am_missing_run}ar" + +for ac_prog in mv +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5866: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_MV'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$MV"; then + ac_cv_prog_MV="$MV" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_MV="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +MV="$ac_cv_prog_MV" +if test -n "$MV"; then + echo "$ac_t""$MV" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$MV" && break +done +test -n "$MV" || MV="${am_missing_run}mv" + +for ac_prog in rm +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5901: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RM'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RM"; then + ac_cv_prog_RM="$RM" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RM="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RM="$ac_cv_prog_RM" +if test -n "$RM"; then + echo "$ac_t""$RM" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$RM" && break +done +test -n "$RM" || RM="${am_missing_run}rm" + +for ac_prog in ld +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5936: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LD"; then + ac_cv_prog_LD="$LD" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_LD="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +LD="$ac_cv_prog_LD" +if test -n "$LD"; then + echo "$ac_t""$LD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$LD" && break +done +test -n "$LD" || LD="${am_missing_run}ld" + +for ac_prog in cp +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:5971: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CP"; then + ac_cv_prog_CP="$CP" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CP="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CP="$ac_cv_prog_CP" +if test -n "$CP"; then + echo "$ac_t""$CP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CP" && break +done +test -n "$CP" || CP="${am_missing_run}cp" + +for ac_prog in strip +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:6006: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_STRIP="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +STRIP="$ac_cv_prog_STRIP" +if test -n "$STRIP"; then + echo "$ac_t""$STRIP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$STRIP" && break +done +test -n "$STRIP" || STRIP="${am_missing_run}strip" + +for ac_prog in lorder +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:6041: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LORDER'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LORDER"; then + ac_cv_prog_LORDER="$LORDER" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_LORDER="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +LORDER="$ac_cv_prog_LORDER" +if test -n "$LORDER"; then + echo "$ac_t""$LORDER" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$LORDER" && break +done +test -n "$LORDER" || LORDER="${am_missing_run}lorder" + + + +case $AFS_SYSNAME in + alpha_dux40) + LEX="lex" + CSTATIC="-non_shared" + DBG="-g3" + MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-pthread -lpthread -lmach -lexc -lc" + TXLIBS="-lcurses" + XCFLAGS="-D_NO_PROTO -DOSF" + SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\"" + ;; + + alpha_dux50) + LEX="flex -l" + DBG="-g3" + CSTATIC="-non_shared" + MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-pthread -lpthread -lmach -lexc -lc" + TXLIBS="-lcurses" + XCFLAGS="-D_NO_PROTO -DOSF" + SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\"" + ;; + + alpha_dux51) + LEX="flex -l" + DBG="-g3" + CSTATIC="-non_shared" + LWP_OPTMZ="-O2" + MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-pthread -lpthread -lmach -lexc -lc" + TXLIBS="-lcurses" + XCFLAGS="-D_NO_PROTO -DOSF" + SHLIB_LINKER="${CC} -all -shared -expect_unresolved \"*\"" + ;; + + alpha_linux_22) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + alpha_linux_24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + hp_ux102) + AS="/usr/ccs/bin/as" + CC="/opt/ansic/bin/cc -Ae" + DBM="/lib/libndbm.a" + LD="/bin/ld" + LEX="/opt/langtools/bin/lex" + LWP_OPTMZ="-O" + MT_CC="/opt/ansic/bin/cc -Ae" + MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-L/opt/dce/lib -ldce" + MV="/bin/mv" + OPTMZ="-O" + PAM_CFLAGS="+DA1.0 +z -Wl,+k" + PAM_LIBS="/usr/lib/libpam.1" + RANLIB="/usr/bin/ranlib" + RM="/bin/rm" + SHLIB_LDFLAGS="-b -Bsymbolic" + SHLIB_SUFFIX="sl" + TXLIBS="/usr/lib/libHcurses.a" + VFSCK_CFLAGS="-D_FILE64" + XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE" + XCFLAGS64="${XCFLAGS0} +DA2.0W" + XCFLAGS="${XCFLAGS0} +DA1.0" + YACC="/opt/langtools/bin/yacc" + SHLIB_LINKER="ld -b" + ;; + + hp_ux11*) + AR="/usr/bin/ar" + AS="/usr/ccs/bin/as" + CC="/opt/ansic/bin/cc" + CCOBJ="/opt/ansic/bin/cc" + DBM="/lib/libndbm.a" + LD="/bin/ld " + LEX="/opt/langtools/bin/lex" + LWP_OPTMZ="-O" + MT_CC="$CC" + MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + MV="/bin/mv" + OPTMZ="-O" + PAM_CFLAGS="+DA1.0 +z -Wl,+k" + PAM_LIBS="/usr/lib/libpam.1" + RANLIB="/usr/bin/ranlib" + RM="/bin/rm" + SHLIB_LDFLAGS="-b -Bsymbolic" + SHLIB_SUFFIX="sl" + TXLIBS="/usr/lib/libHcurses.a" + VFSCK_CFLAGS="-I/usr/old/usr/include -D_FILE64" + XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE" + XCFLAGS64="${XCFLAGS0} +DA2.0W" + XCFLAGS="${XCFLAGS0} +DA1.0" + XLIBELFA="-lelf" + #XLIBS="${LIB_AFSDB} -lnsl" + XLIBS="${LIB_AFSDB}" + YACC="/opt/langtools/bin/yacc" + SHLIB_LINKER="ld -b" + ;; + + ia64_hpux*) + AR="/usr/bin/ar" + AS="/usr/ccs/bin/as" + CC="/opt/ansic/bin/cc" + CCOBJ="/opt/ansic/bin/cc" + DBM="/lib/hpux32/libndbm.so" + LD="/bin/ld " + LEX="/opt/langtools/bin/lex" + LWP_OPTMZ="" + MT_CC="$CC" + MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + MV="/bin/mv" + OPTMZ="-O" + PAM_CFLAGS="-b +z -Wl,+k" + PAM_LIBS="/usr/lib/hpux32/libpam.so" + RANLIB="/usr/bin/ranlib" + RM="/bin/rm" + SHLIB_LDFLAGS="-b -Bsymbolic" + SHLIB_SUFFIX="sl" + TXLIBS="/usr/lib/hpux32/libcurses.so" + VFSCK_CFLAGS="-I/usr/old/usr/include -D_FILE64" + XCFLAGS0="-ldld -lc -Wp,-H200000 -Wl,-a,archive_shared -DAUTH_DBM_LOG +z -Wl,+k -D_LARGEFILE64_SOURCE" + XCFLAGS64="${XCFLAGS0} +DD64" + XCFLAGS="${XCFLAGS0}" + XLIBELFA="-lelf" + #XLIBS="${LIB_AFSDB} -lnsl" + XLIBS="${LIB_AFSDB}" + YACC="/opt/langtools/bin/yacc" + SHLIB_LINKER="ld -b" + ;; + + *fbsd_*) + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-pthread" + PAM_CFLAGS="-O2 -pipe -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -pipe" + YACC="byacc" + ;; + + *nbsd20) + LEX="flex -l" + MT_CFLAGS='${XCFLAGS} -DAFS_PTHREAD_ENV -D_REENTRANT ' + MT_LIBS="-lpthread" # XXX -pthread soon + PAM_CFLAGS="-O2 -pipe -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="/usr/lib/libcurses.so" + XCFLAGS="-O2 -pipe" + YACC="yacc" + ;; + + *nbsd15|*nbsd16) + LEX="flex -l" + MT_CFLAGS='${XCFLAGS}' + MT_LIBS="" + PAM_CFLAGS="-O2 -pipe -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="/usr/lib/libcurses.so" + XCFLAGS="-O2 -pipe" + YACC="bison -y" + ;; + + ia64_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE -G0" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + amd64_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + ppc64_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="/usr/lib64/libncurses.so" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + i386_linux22) + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + i386_umlinux22) + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + i386_linux24) + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + DBG=-g + KERN_DBG=-g + LWP_DBG=-g + LWP_OPTMZ=-O2 + OPTMZ=-O2 + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + i386_umlinux24) + CC="gcc -pipe" + CCOBJ="gcc -pipe" + MT_CC="gcc -pipe" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + DBG=-g + KERN_DBG=-g + LWP_DBG=-g + LWP_OPTMZ=-O2 + OPTMZ=-O2 + PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + *_obsd*) + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-pthread" + PAM_CFLAGS="-O2 -pipe -fpic" + SHLIB_CFLAGS="-fpic" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="/usr/lib/libcurses.a" + XCFLAGS="-O2" + YACC="yacc" + ;; + + parisc_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + ppc_darwin_12) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + REGEX_OBJ="regex.o" + XCFLAGS="-traditional-cpp" + ;; + + ppc_darwin_13) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + LWP_OPTMZ="-O2" + REGEX_OBJ="regex.o" + XCFLAGS="-no-cpp-precomp" + ;; + + ppc_darwin_14) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + LWP_OPTMZ="-O2" + REGEX_OBJ="regex.o" + XCFLAGS="-no-cpp-precomp" + ;; + + ppc_darwin_60) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + LWP_OPTMZ="-O2" + REGEX_OBJ="regex.o" + XCFLAGS="-no-cpp-precomp" + TXLIBS="-lncurses" + ;; + + ppc_darwin_70) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration" + LEX="lex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -D_REENTRANT ${XCFLAGS}' + KROOT= + KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers' + LWP_OPTMZ="-O2" + REGEX_OBJ="regex.o" + XCFLAGS="-no-cpp-precomp" + TXLIBS="-lncurses" + EXTRA_VLIBOBJS="fstab.o" + ;; + + ppc_linux22) + INSTALL="install" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + ppc_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + rs_aix42) + DBG="" + LEX="lex" + LIBSYS_AIX_EXP="afsl.exp" + MT_CC="xlc_r" + MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthreads" + SHLIB_SUFFIX="o" + TXLIBS="-lcurses" + XCFLAGS="-K -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void" + XLIBS="${LIB_AFSDB} -ldl" + SHLIB_LINKER="${MT_CC} -bM:SRE -berok" + AIX64="#" + ;; + + rs_aix51) + DBG="" + LEX="lex" + LIBSYS_AIX_EXP="afsl.exp" + MT_CC="xlc_r" + MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthreads" + SHLIB_SUFFIX="o" + TXLIBS="-lcurses" + XCFLAGS="-K -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void" + XLIBS="${LIB_AFSDB} -ldl" + SHLIB_LINKER="${MT_CC} -bM:SRE -berok" + AIX64="" + ;; + + s390_linux22) + CC="gcc" + CCOBJ="gcc" + LD="gcc" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CC="$CC" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O -g -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + s390_linux24) + CC="gcc" + CCOBJ="gcc" + LD="gcc" + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CC="$CC" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O -g -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + sgi_62) + PINSTALL_LIBS=-lmld + AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a" + FSINCLUDES="-I/usr/include/sys/fs" + LEX="lex" + MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + TXLIBS="-lcurses" + XCFLAGS64="-64 -mips3" + XCFLAGS="-o32" + XLDFLAGS64="-64" + XLDFLAGS="-o32" + SHLIB_LINKER="${CC} -shared" + ;; + + sgi_63) + PINSTALL_LIBS=-lmld + AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a" + FSINCLUDES="-I/usr/include/sys/fs" + LEX="lex" + MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + TXLIBS="-lcurses" + XCFLAGS64="-D_BSD_COMPAT -64 -mips3" + XCFLAGS="-D_OLD_TERMIOS -D_BSD_COMPAT -o32" + XLDFLAGS64="-64" + XLDFLAGS="-o32" + SHLIB_LINKER="${CC} -shared" + ;; + + sgi_64) + AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a" + FSINCLUDES="-I/usr/include/sys/fs" + LEX="lex" + MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + TXLIBS="-lcurses" + XCFLAGS64="-D_BSD_COMPAT -64 -mips3" + XCFLAGS="-D_OLD_TERMIOS -D_BSD_COMPAT -n32 -woff 1009,1110,1116,1164,1171,1177,1183,1185,1204,1233,1515,1516,1548,1169,1174,1177,1196,1498,1506,1552" + XLDFLAGS64="-64" + XLDFLAGS="-n32" + SHLIB_LINKER="${CC} -shared" + ;; + + sgi_65) + AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a" + CC="/usr/bin/cc" + CCOBJ="/usr/bin/cc" + FSINCLUDES="-I/usr/include/sys/fs" + LD="/usr/bin/ld" + LEX="lex" + MT_CC="/usr/bin/cc" + MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread" + TXLIBS="-lcurses" + XCFLAGS64="-64 -mips3" + XCFLAGS="-n32 -mips3 -woff 1009,1110,1116,1164,1171,1177,1183,1185,1204,1233,1515,1516,1548,1169,1174,1177,1196,1498,1506,1552" + XLDFLAGS64="-64 -mips3" + XLDFLAGS="-n32 -mips3" + SHLIB_LINKER="${CC} -shared" + ;; + + sparc64_linux22) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + sparc64_linux24) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + sparc_linux22) + KERN_OPTMZ=-O2 + LEX="flex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}' + MT_LIBS="-lpthread" + PAM_CFLAGS="-O2 -Dlinux -DLINUX_PAM -fPIC" + SHLIB_LDFLAGS="-shared -Xlinker -x" + TXLIBS="-lncurses" + XCFLAGS="-O2 -D_LARGEFILE64_SOURCE" + YACC="bison -y" + SHLIB_LINKER="${MT_CC} -shared" + ;; + + sun4_413) + CCXPG2="/usr/xpg2bin/cc" + CC="gcc" + CCOBJ="gcc" + LEX="lex" + SHLIB_CFLAGS="-PIC" + TXLIBS="-lcurses -ltermcap" + XCFLAGS="" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB}" + LD="ld" + ;; + + sun4x_55) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + SHLIB_CFLAGS="-KPIC" + TXLIBS="-lcurses" + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + LD="/usr/ccs/bin/ld" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sun4x_56) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-L/usr/ccs/lib -lcurses" + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + LD="/usr/ccs/bin/ld" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sun4x_57) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sun4x_58) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sun4x_59) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + sunx86_57) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + + sunx86_58) + CC="/opt/SUNWspro/bin/cc" + CCOBJ="/opt/SUNWspro/bin/cc" + LEX="lex" + LD="/usr/ccs/bin/ld" + MT_CC="/opt/SUNWspro/bin/cc" + MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}' + MT_LIBS="-lpthread -lsocket" + PAM_CFLAGS="-KPIC" + PAM_LIBS="-lc -lpam -lsocket -lnsl -lm" + SHLIB_CFLAGS="-KPIC" + SHLIB_LDFLAGS="-G -Bsymbolic" + TXLIBS="-lcurses" + XCFLAGS64='${XCFLAGS} -xarch=v9' + XCFLAGS="-dy -Bdynamic" + XLIBELFA="-lelf" + XLIBKVM="-lkvm" + XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl" + SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text" + ;; + + +esac + +# +# Special build targets +# +case $AFS_SYSNAME in + sgi_6*) + +echo $ac_n "checking for mem* in sys/systm.h""... $ac_c" 1>&6 +echo "configure:6795: checking for mem* in sys/systm.h" >&5 +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -D_KERNEL -D__STRING_H__" +if eval "test \"`echo '$''{'ac_cv_irix_sys_systm_h_has_mem_funcs'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +#include +int main() { + +extern void *memcpy(char *, const void *, size_t); + +; return 0; } +EOF +if { (eval echo configure:6813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_irix_sys_systm_h_has_mem_funcs=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_irix_sys_systm_h_has_mem_funcs=yes +fi +rm -f conftest* +fi + +CPPFLAGS="$save_CPPFLAGS" +if test "$ac_cv_irix_sys_systm_h_has_mem_funcs" = "yes"; then + cat >> confdefs.h <<\EOF +#define IRIX_HAS_MEM_FUNCS 1 +EOF + +fi +echo "$ac_t""$ac_cv_irix_sys_systm_h_has_mem_funcs" 1>&6 + + XFS_SIZE_CHECK="xfs_size_check" + install_XFS_SIZE_CHECK='$(DESTDIR)${afssrvsbindir}/xfs_size_check' + dest_XFS_SIZE_CHECK='$(DEST)/root.server/usr/afs/bin/xfs_size_check' + + + + + ;; + + sun4x_*|sunx86_*) + FS_CONV_SOL26="fs_conv_sol26" + install_FS_CONV_SOL26='$(DESTDIR)${afssrvsbindir}/fs_conv_sol26' + dest_FS_CONV_SOL26='$(DEST)/root.server/usr/afs/bin/fs_conv_sol26' + + + + + ;; + + alpha_dux*) + FS_CONV_OSF40D="fs_conv_dux40D" + install_FS_CONV_OSF40D='$(DESTDIR)${afssrvsbindir}/fs_conv_dux40D' + dest_FS_CONV_OSF40D='$(DEST)/root.server/usr/afs/bin/fs_conv_dux40D' + + + + + ;; +esac + +if test "x$enable_debug_kernel" = "xno"; then + KERN_DBG= +fi + +if test "x$enable_optimize_kernel" = "xno"; then + KERN_OPTMZ= +fi + +if test "x$enable_debug" = "xno"; then + DBG= +fi + +if test "x$enable_optimize" = "xno"; then + OPTMZ= +fi + +if test "x$enable_debug_lwp" = "xno"; then + LWP_DBG= +fi + +if test "x$enable_optimize_lwp" = "xno"; then + LWP_OPTMZ= +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +TOP_SRCDIR="${srcdir}/src" +case $TOP_SRCDIR in + /*) + ;; + *) + TOP_SRCDIR=`cd $TOP_SRCDIR; pwd` + ;; +esac + +TOP_OBJDIR="${SRCDIR_PARENT}" +TOP_INCDIR="${SRCDIR_PARENT}/include" +TOP_LIBDIR="${SRCDIR_PARENT}/lib" +if test "${DEST}x" = "x"; then + DEST="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest" +fi + +HELPER_SPLINT="${TOP_SRCDIR}/helper-splint.sh" +HELPER_SPLINTCFG="${TOP_SRCDIR}/splint.cfg" + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "\ +Makefile \ +src/config/Makefile.config \ +src/libafs/Makefile.common \ +src/libafs/Makefile \ + src/config/afsconfig.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@CPP@%$CPP%g +s%@LN_S@%$LN_S%g +s%@RANLIB@%$RANLIB%g +s%@YACC@%$YACC%g +s%@LEX@%$LEX%g +s%@LEXLIB@%$LEXLIB%g +s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g +s%@P5PLUS_KOPTS@%$P5PLUS_KOPTS%g +s%@LINUX_GCC_KOPTS@%$LINUX_GCC_KOPTS%g +s%@RHCONFIG_SP@%$RHCONFIG_SP%g +s%@RHCONFIG_MP@%$RHCONFIG_MP%g +s%@MPS@%$MPS%g +s%@HEADER_RT@%$HEADER_RT%g +s%@KDUMP@%$KDUMP%g +s%@KDUMP64@%$KDUMP64%g +s%@PTHREAD_LIBS@%$PTHREAD_LIBS%g +s%@XBSA_CFLAGS@%$XBSA_CFLAGS%g +s%@HAVE_PAM@%$HAVE_PAM%g +s%@BUILD_LOGIN@%$BUILD_LOGIN%g +s%@afsconfdir@%$afsconfdir%g +s%@viceetcdir@%$viceetcdir%g +s%@afskerneldir@%$afskerneldir%g +s%@afssrvbindir@%$afssrvbindir%g +s%@afssrvsbindir@%$afssrvsbindir%g +s%@afssrvlibexecdir@%$afssrvlibexecdir%g +s%@afsdbdir@%$afsdbdir%g +s%@afslogsdir@%$afslogsdir%g +s%@afslocaldir@%$afslocaldir%g +s%@afsbackupdir@%$afsbackupdir%g +s%@afsbosconfigdir@%$afsbosconfigdir%g +s%@AFS_SYSNAME@%$AFS_SYSNAME%g +s%@AFS_PARAM_COMMON@%$AFS_PARAM_COMMON%g +s%@ENABLE_KERNEL_MODULE@%$ENABLE_KERNEL_MODULE%g +s%@LIB_AFSDB@%$LIB_AFSDB%g +s%@LINUX_KERNEL_PATH@%$LINUX_KERNEL_PATH%g +s%@BSD_KERNEL_PATH@%$BSD_KERNEL_PATH%g +s%@BSD_KERNEL_BUILD@%$BSD_KERNEL_BUILD%g +s%@LINUX_VERSION@%$LINUX_VERSION%g +s%@MKAFS_OSTYPE@%$MKAFS_OSTYPE%g +s%@TOP_OBJDIR@%$TOP_OBJDIR%g +s%@TOP_SRCDIR@%$TOP_SRCDIR%g +s%@TOP_INCDIR@%$TOP_INCDIR%g +s%@TOP_LIBDIR@%$TOP_LIBDIR%g +s%@DEST@%$DEST%g +s%@WITH_OBSOLETE@%$WITH_OBSOLETE%g +s%@WITH_INSECURE@%$WITH_INSECURE%g +s%@DARWIN_INFOFILE@%$DARWIN_INFOFILE%g +s%@IRIX_BUILD_IP35@%$IRIX_BUILD_IP35%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@MV@%$MV%g +s%@RM@%$RM%g +s%@LD@%$LD%g +s%@CP@%$CP%g +s%@STRIP@%$STRIP%g +s%@LORDER@%$LORDER%g +s%@XFS_SIZE_CHECK@%$XFS_SIZE_CHECK%g +s%@install_XFS_SIZE_CHECK@%$install_XFS_SIZE_CHECK%g +s%@dest_XFS_SIZE_CHECK@%$dest_XFS_SIZE_CHECK%g +s%@FS_CONV_SOL26@%$FS_CONV_SOL26%g +s%@install_FS_CONV_SOL26@%$install_FS_CONV_SOL26%g +s%@dest_FS_CONV_SOL26@%$dest_FS_CONV_SOL26%g +s%@FS_CONV_OSF40D@%$FS_CONV_OSF40D%g +s%@install_FS_CONV_OSF40D@%$install_FS_CONV_OSF40D%g +s%@dest_FS_CONV_OSF40D@%$dest_FS_CONV_OSF40D%g +s%@CCXPG2@%$CCXPG2%g +s%@CCOBJ@%$CCOBJ%g +s%@AFSD_LIBS@%$AFSD_LIBS%g +s%@AFSD_LDFLAGS@%$AFSD_LDFLAGS%g +s%@AIX64@%$AIX64%g +s%@DBG@%$DBG%g +s%@FSINCLUDES@%$FSINCLUDES%g +s%@KERN_DBG@%$KERN_DBG%g +s%@KERN_OPTMZ@%$KERN_OPTMZ%g +s%@LWP_DBG@%$LWP_DBG%g +s%@LWP_OPTMZ@%$LWP_OPTMZ%g +s%@MT_CC@%$MT_CC%g +s%@MT_CFLAGS@%$MT_CFLAGS%g +s%@MT_LIBS@%$MT_LIBS%g +s%@OPTMZ@%$OPTMZ%g +s%@PAM_CFLAGS@%$PAM_CFLAGS%g +s%@PAM_LIBS@%$PAM_LIBS%g +s%@PINSTALL_LIBS@%$PINSTALL_LIBS%g +s%@REGEX_OBJ@%$REGEX_OBJ%g +s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g +s%@SHLIB_LDFLAGS@%$SHLIB_LDFLAGS%g +s%@SHLIB_LINKER@%$SHLIB_LINKER%g +s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g +s%@TXLIBS@%$TXLIBS%g +s%@VFSCK_CFLAGS@%$VFSCK_CFLAGS%g +s%@XCFLAGS@%$XCFLAGS%g +s%@XCFLAGS64@%$XCFLAGS64%g +s%@XLDFLAGS@%$XLDFLAGS%g +s%@XLDFLAGS64@%$XLDFLAGS64%g +s%@XLIBELFA@%$XLIBELFA%g +s%@XLIBKVM@%$XLIBKVM%g +s%@XLIBS@%$XLIBS%g +s%@HELPER_SPLINT@%$HELPER_SPLINT%g +s%@HELPER_SPLINTCFG@%$HELPER_SPLINTCFG%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/configure-libafs.in b/configure-libafs.in index 813cfd5f2..f9fa0faca 100644 --- a/configure-libafs.in +++ b/configure-libafs.in @@ -1,25 +1,14 @@ -AC_INIT(Makefile.common) -AM_INIT_AUTOMAKE(openafs-libafs,1.2.11) -AC_CONFIG_HEADER(config/afsconfig.h) +AC_INIT(src/libafs/Makefile.common.in) +AM_INIT_AUTOMAKE(openafs-libafs,devel) +AC_CONFIG_HEADER(src/config/afsconfig.h) define(OPENAFS_CONFIGURE_LIBAFS) AC_PROG_CC OPENAFS_CONFIGURE_COMMON -TOP_SRCDIR="${SRCDIR_PARENT}" -TOP_INCDIR="${SRCDIR_PARENT}/include" -TOP_LIBDIR="${SRCDIR_PARENT}/lib" -if test "${DEST}x" = "x"; then - DEST="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest" -fi - -# Check for files involved in porting. Report errors, don't make the -# user hunt through the configure log after the build fails! -if test ! -r config/Makefile.${AFS_SYSNAME}.in ; then - AC_MSG_ERROR(no source file config/Makefile.${AFS_SYSNAME}.in) -fi - AC_OUTPUT( \ Makefile \ -config/Makefile.${AFS_SYSNAME} \ +src/config/Makefile.config \ +src/libafs/Makefile.common \ +src/libafs/Makefile \ ) diff --git a/configure.in b/configure.in index b46a8b823..76956d14d 100644 --- a/configure.in +++ b/configure.in @@ -1,23 +1,10 @@ AC_INIT(src/config/stds.h) -AM_INIT_AUTOMAKE(openafs,1.2.11) +AM_INIT_AUTOMAKE(openafs,devel) AC_CONFIG_HEADER(src/config/afsconfig.h) AC_PROG_CC OPENAFS_CONFIGURE_COMMON -TOP_SRCDIR="${SRCDIR_PARENT}/src" -TOP_INCDIR="${SRCDIR_PARENT}/include" -TOP_LIBDIR="${SRCDIR_PARENT}/lib" -if test "${DEST}x" = "x"; then - DEST="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest" -fi - -# Check for files involved in porting. Report errors, don't make the -# user hunt through the configure log after the build fails! -if test ! -r src/config/Makefile.${AFS_SYSNAME}.in ; then - AC_MSG_ERROR(no source file src/config/Makefile.${AFS_SYSNAME}.in) -fi - AC_OUTPUT( \ Makefile \ src/afs/Makefile \ @@ -40,8 +27,8 @@ src/cmd/Makefile \ src/comerr/test/Makefile \ src/comerr/Makefile \ src/config/Makefile \ +src/config/Makefile.config \ src/config/Makefile.version-NOCML \ -src/config/Makefile.${AFS_SYSNAME} \ src/dauth/Makefile \ src/des/test/Makefile \ src/des/Makefile \ @@ -55,6 +42,7 @@ src/fsprobe/Makefile \ src/ftpd43+/Makefile \ src/gtx/Makefile \ src/inetd/Makefile \ +src/JAVA/libjafs/Makefile \ src/kauth/test/Makefile \ src/kauth/Makefile \ src/libacl/test/Makefile \ @@ -70,10 +58,12 @@ src/libadmin/pts/Makefile \ src/libadmin/samples/Makefile \ src/libadmin/test/Makefile \ src/libadmin/vos/Makefile \ +src/libafs/Makefile.common \ src/libafs/MakefileProto.${MKAFS_OSTYPE} \ ${DARWIN_PLIST} \ src/libafsauthent/Makefile \ src/libafsrpc/Makefile \ +src/libuafs/Makefile.common \ src/libuafs/MakefileProto.${MKAFS_OSTYPE} \ src/log/test/Makefile \ src/log/Makefile \ @@ -116,6 +106,7 @@ src/tests/run-tests \ src/tests/OpenAFS/Dirpath.pm \ src/tsm41/Makefile \ src/tviced/Makefile \ +src/tvolser/Makefile \ src/ubik/Makefile \ src/update/Makefile \ src/usd/test/Makefile \ @@ -133,4 +124,5 @@ src/vol/test/Makefile \ src/volser/Makefile \ src/wsadmin.src/Makefile \ src/xstat/Makefile \ +src/helper-splint.sh \ ) diff --git a/libafsdep b/libafsdep new file mode 100644 index 000000000..d035d7ebe --- /dev/null +++ b/libafsdep @@ -0,0 +1,17 @@ +# +# Note, do not copy configure-libafs, or Makefile-libafs, as they are +# copied and renamed in the make_libafs_tree.pl script. +# +config.guess +config.sub +install-sh +missing +mkinstalldirs +# +# Following are listed in here cause the include/ dir doesn't exist in +# source tree. For now, just copying everything, though this could easily +# be shrunk to only copying minimal list of files if you're willing to accept +# the maintenance that implies. +# +include/*.h +include/*/*.h diff --git a/mkinstalldirs b/mkinstalldirs index 0d3cf411f..6838068c1 100755 --- a/mkinstalldirs +++ b/mkinstalldirs @@ -4,7 +4,7 @@ # Created: 1993-05-16 # Public domain -# $Id: mkinstalldirs,v 1.1 2001/07/05 00:54:56 hartmans Exp $ +# $Id: mkinstalldirs,v 1.3 2001/06/28 04:55:21 shadow Exp $ errstatus=0 diff --git a/src/..wow.3 b/src/..wow.3 deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/.cvsignore b/src/.cvsignore new file mode 100644 index 000000000..a08d0a3e8 --- /dev/null +++ b/src/.cvsignore @@ -0,0 +1 @@ +helper-splint.sh diff --git a/src/DOLASTCMP.BAT b/src/DOLASTCMP.BAT new file mode 100644 index 000000000..0e69970ca --- /dev/null +++ b/src/DOLASTCMP.BAT @@ -0,0 +1,4 @@ +IF EXIST %AFSROOT%\golast.bat DEL %AFSROOT%\golast.bat +ECHO @CD %1 >%AFSROOT%\golast.bat +echo echo Directory - %1 >>%AFSROOT%\golast.bat + diff --git a/src/JAVA/classes/ErrorMessages.properties b/src/JAVA/classes/ErrorMessages.properties new file mode 100644 index 000000000..4821ffd68 --- /dev/null +++ b/src/JAVA/classes/ErrorMessages.properties @@ -0,0 +1,930 @@ +#----------------------------------------------------------- +# Custom UFiler Error Codes +#----------------------------------------------------------- +UNKNOWN = Unknown error. +SPECIAL_CASE = Special case error. +GENERAL_FAILURE = Operation returned unsuccessful. + +E1000 = Data requested does not exist or is null. +E1001 = User session is invalid +E1002 = Session has expired, please login again +E1003 = Operation aborted +E1004 = Operation was forced to abort + +#----------------------------------------------------------- +# Internal JAFS Error Codes +#----------------------------------------------------------- +E1050 = Could not allocate memory. +E1051 = Could not find specified Java class. +E1052 = Could not find specified Java method. +E1053 = Could not find specified Java field. +E1054 = Invalid argument value, argument is NULL. +E1055 = Username provided is NULL. +E1056 = Password provided is NULL. +E1057 = Group name provided is NULL. +E1058 = Group owner provided is NULL. +E1059 = Volume name provided is NULL. +E1060 = Partition name provided is NULL. +E1061 = Process name provided is NULL. +E1062 = Server name provided is NULL. +E1063 = Cell name provided is NULL. +E1064 = Invalid path name provided, path is NULL. +E1065 = Invalid ACL provided, string is NULL. + +#----------------------------------------------------------- +# Standard UNIX Error Codes +#----------------------------------------------------------- +E1 = Operation not permitted +E2 = No such file or directory +E3 = No such process +E4 = Interrupted system call +E5 = I/O error +E6 = No such device or address +E7 = Arg list too long +E8 = Exec format error +E9 = Bad file number +E10 = No child processes +E11 = Try again +E12 = Out of memory +E13 = Permission denied +E14 = Bad address +E15 = Block device required +E16 = Device or resource busy +E17 = File exists +E18 = Cross-device link +E19 = No such device +E20 = Not a directory +E21 = Is a directory +E22 = Invalid argument +E23 = File table overflow +E24 = Too many open files +E25 = Not a typewriter +E26 = Text file busy +E27 = File too large +E28 = No space left on device +E29 = Illegal seek +E30 = Read-only file system +E31 = Too many links +E32 = Broken pipe +E33 = Math argument out of domain of func +E34 = Math result not representable +E35 = Resource deadlock would occur +E36 = File name too long +E37 = No record locks available +E38 = Function not implemented +E39 = Directory not empty +E40 = Too many symbolic links encountered +E41 = Operation would block +E42 = No message of desired type +E43 = Identifier removed +E44 = Channel number out of range +E45 = Level 2 not synchronized +E46 = Level 3 halted +E47 = Level 3 reset +E48 = Link number out of range +E49 = Protocol driver not attached +E50 = No CSI structure available +E51 = Level 2 halted +E52 = Invalid exchange +E53 = Invalid request descriptor +E54 = Exchange full +E55 = No anode +E56 = Invalid request code +E57 = Invalid slot +E58 = Dead lock +E59 = Bad font file format +E60 = Device not a stream +E61 = No data available +E62 = Timer expired +E63 = Out of streams resources +E64 = Machine is not on the network +E65 = Package not installed +E66 = Object is remote +E67 = Link has been severed +E68 = Advertise error +E69 = Srmount error +E70 = Communication error on send +E71 = Protocol error +E72 = Multihop attempted +E73 = RFS specific error +E74 = Not a data message +E75 = Value too large for defined data type +E76 = Name not unique on network +E77 = File descriptor in bad state +E78 = Remote address changed +E79 = Can not access a needed shared library +E80 = Accessing a corrupted shared library +E81 = .lib section in a.out corrupted +E82 = Attempting to link in too many shared libraries +E83 = Cannot exec a shared library directly +E84 = Illegal byte sequence +E85 = Interrupted system call should be restarted +E86 = Streams pipe error +E87 = Too many users +E88 = Socket operation on non-socket +E89 = Destination address required +E90 = Message too long +E91 = Protocol wrong type for socket +E92 = Protocol not available +E93 = Protocol not supported +E94 = Socket type not supported +E95 = Operation not supported on transport endpoint +E96 = Protocol family not supported +E97 = Address family not supported by protocol +E98 = Address already in use +E99 = Cannot assign requested address +E100 = Network is down +E101 = Network is unreachable +E102 = Network dropped connection because of reset +E103 = Software caused connection abort +E104 = Connection reset by peer +E105 = No buffer space available +E106 = Transport endpoint is already connected +E107 = Transport endpoint is not connected +E108 = Cannot send after transport endpoint shutdown +E109 = Too many references: cannot splice +E110 = Connection timed out +E111 = Connection refused +E112 = Host is down +E113 = No route to host +E114 = Operation already in progress +E115 = Operation now in progress +E116 = Stale NFS file handle +E117 = Structure needs cleaning +E118 = Not a XENIX named type file +E119 = No XENIX semaphores available +E120 = Is a named type file +E121 = Remote I/O error +E122 = Quota exceeded +E123 = No medium found +E124 = Wrong medium type +#----------------------------------------------------------- +# Error Codes for acfg_errors +#----------------------------------------------------------- +E70354688 = mysterious failure +E70354689 = could not find entry +E70354690 = do not know that information +E70354691 = line appears before a cell has been defined +E70354692 = syntax error +E70354693 = a database file is missing +E70354694 = no more entries +#----------------------------------------------------------- +# Error Codes for ktc_errors +#----------------------------------------------------------- +E11862784 = an unexpected error was encountered +E11862785 = a buffer was too small for the response +E11862786 = an invalid argument was passed in +E11862787 = no such entry +E11862788 = a pioctl failed +E11862789 = AFS kernel pioctl doesn't exist +E11862790 = unknown cell was passed to SetToken +E11862791 = Cache Manager is not initialized / afsd is not running +E11862792 = failed to send or receive session key via remote procedure call +E11862793 = Cache Manager RPC server is not responding +#----------------------------------------------------------- +# Error Codes for boserr +#----------------------------------------------------------- +E39424 = process not active +E39425 = no such entity +E39426 = can't do operation now +E39427 = entity already exists +E39428 = failed to create entity +E39429 = index out of range +E39430 = you are not authorized for this operation +E39431 = syntax error in create parameter +E39432 = I/O error +E39433 = network problem +E39434 = unrecognized bnode type +E39435 = kvno already used - have to remove existing kvno's before reuse +E39436 = this function requires encrypted input, use a newer client program +#----------------------------------------------------------- +# Error Codes for butc_errs +#----------------------------------------------------------- +E156566272 = error in dump/restore process +E156566273 = ungraceful abort +E156566274 = the process has already been aborted +E156566275 = unable to end dump/restore since work in progress +E156566276 = some of the dump/restores were unsuccessful +E156566277 = could not abort the process +E156566278 = the process was aborted by request +E156566279 = scan tape resulted in failure +E156566280 = No dump task with specified ID +E156566281 = No tasks active +E156566282 = the volume was not found on tape +E156566283 = unexpected EOF encountered on tape +E156566284 = missing file trailer on tape +E156566285 = unexpected tape label +E156566286 = tape was unusable +E156566287 = corrupted volume header on tape +E156566288 = internal error +E156566289 = corruption in internal queue data structures +E156566290 = memory allocation failure +E156566291 = access denied +E156566292 = tape requested to be skipped +E156566293 = invalid task +#----------------------------------------------------------- +# Error Codes for butm_errs +#----------------------------------------------------------- +E156568832 = interface incompatible +E156568833 = there is not an opened tape +E156568834 = multiple simultaneous opens not permitted +E156568835 = can't open tape +E156568836 = error during tape close +E156568837 = tape I/O error +E156568838 = write operation on read-only tape +E156568839 = operation inappropriate in this context +E156568840 = read file ended before all data read +E156568841 = write a zero length file +E156568842 = end of tape +E156568843 = problem reading configuration +E156568844 = argument too long or out of range +E156568845 = unexpected end of volume data +E156568846 = appended tape label +E156568847 = end of dump +E156568848 = tape device error +E156568849 = end-of-file marker +E156568850 = unexpected tape datablock +E156568851 = no label on tape +E156568852 = cannot position within the file +#----------------------------------------------------------- +# Error Codes for butx_errs +#----------------------------------------------------------- +E156571648 = Version 1 +E156571649 = XBSA couldn't mount shared library +E156571650 = XBSA handle already initialized +E156571651 = XBSA invalid serverType specified +E156571652 = XBSA invalid serverName specified +E156571653 = XBSA invalid bsaObjectOwner specified +E156571654 = XBSA invalid appObjectOwner specified +E156571655 = XBSA invalid secToken specified +E156571656 = XBSA invalid objectSpaceName specified +E156571657 = XBSA invalid pathName specified +E156571658 = XBSA invalid bufferSize specified +E156571659 = XBSA invalid dataBuffer specified +E156571660 = XBSA invalid lGName specified +E156571661 = XBSA invalid objectDescription specified +E156571662 = XBSA invalid objectInfo specified +E156571663 = XBSA version mismatch +E156571664 = XBSA unable to mount the XBSA library +E156571665 = XBSA initialization of the XBSA interface failed +E156571666 = XBSA begin transaction failed +E156571667 = XBSA has not been initialized, no handle +E156571668 = XBSA end transaction failed +E156571669 = XBSA terminate session failed +E156571670 = XBSA query object failed +E156571671 = XBSA get object failed +E156571672 = XBSA end data failed +E156571673 = XBSA create object failed +E156571674 = XBSA delete object failed +E156571675 = XBSA send data failed +E156571676 = XBSA get data failed +E156571677 = XBSA get environment failed +E156571678 = XBSA volume to delete not found +#----------------------------------------------------------- +# Error Codes for bucoord_errs +#----------------------------------------------------------- +E156288000 = Unacceptable user supplied argument +E156288001 = Object has been updated +E156288002 = Search matched more than one item +E156288003 = Can't allocate working memory +E156288004 = Can't get cell configuration information +E156288005 = Specified item already exists +E156288006 = Error in configuration parameters +E156288007 = No such volume set +E156288008 = No such volume entry +E156288009 = Volume set already exists +E156288010 = No such server +E156288011 = No such partition +E156288012 = Version number mismatch +E156288013 = Lock has not been acquired +E156288014 = Internal error +E156288015 = No such host/port entry +#----------------------------------------------------------- +# Error Codes for budb_errs +#----------------------------------------------------------- +E156303872 = dump with specified id already exists +E156303873 = no dump matching the id was found +E156303874 = no dump matching the name was found +E156303875 = no tape matching the name was found +E156303876 = no volume matching the name was found +E156303877 = entry doesn't exist +E156303878 = reference to a tape not being used +E156303879 = dump of database failed +E156303880 = access to database denied +E156303881 = incompatible version numbers +E156303882 = argument too long or out of range +E156303883 = sequence of operations incorrect +E156303884 = inconsistent or unsupported flags bit combination +E156303885 = requested list too large +E156303886 = index to iterator function is out of range +E156303887 = bad database block type +E156303888 = lock is not set +E156303889 = lock is held by another user +E156303890 = attempt to lock a lock already held +E156303891 = interface incompatible +E156303892 = Ubik I/O error +E156303893 = bad database address +E156303894 = backup database is inconsistent +E156303895 = internal error encountered in backup database server +E156303896 = error reading cell database +E156303897 = cell name not found +E156303898 = database empty or corrupted +E156303899 = Ubik ClientInit failed +E156303900 = couldn't allocate entry +E156303901 = can't allocate memory +E156303902 = dump is not an initial dump +E156303903 = reference to a dump not being used +#----------------------------------------------------------- +# Error Codes for cmd_errors +#----------------------------------------------------------- +E3359744 = More than the maximum number of parameters defined +E3359745 = Internal parsing error +E3359746 = Too many values specified after a CMD_SINGLE switch +E3359747 = Too many parameters specified +E3359748 = Impossibly few aguments specified +E3359749 = unrecognized or ambiguous command name +E3359750 = unrecognized or ambiguous switch name +E3359751 = +E3359752 = Insufficient required parameters provided +E3359753 = Token too large +#----------------------------------------------------------- +# Error Codes for test1 +#----------------------------------------------------------- +E11829760 = Can't read ticket file +E11829761 = Can't find ticket or TGT +E11829762 = TGT expired +E11829763 = Can't decode authenticator +E11829764 = Ticket expired +E11829765 = Repeated request +E11829766 = The ticket isn't for us +E11829767 = Request is inconsistent +E11829768 = Delta-T too big +E11829769 = Incorrect net address +E11829770 = Protocol version mismatch +E11829771 = Invalid message type +E11829772 = Message stream modified +E11829773 = Message out of order +E11829774 = Unauthorized request +E11829775 = Current password is null +E11829776 = Incorrect current password +E11829777 = Protocol error +E11829778 = Error returned by KDC +E11829779 = Null ticket returned by KDC +E11829780 = Retry count exceeded +E11829781 = Can't send request +#----------------------------------------------------------- +# Error Codes for test2 +#----------------------------------------------------------- +E1163220992 = foo +E1163220993 = bar +E1163220994 = meow +#----------------------------------------------------------- +# Error Codes for kaerrors +#----------------------------------------------------------- +E180480 = AuthServer database is inconsistent +E180481 = user already exists +E180482 = Ubik I/O error +E180483 = couldn't allocate entry +E180484 = user doesn't exist +E180485 = database empty or corrupted +E180486 = name or instance is too long or contains illegal characters +E180487 = bad index used internally +E180488 = caller not authorized +E180489 = answer packet too short for result +E180490 = password is incorrect +E180491 = interface incompatible +E180492 = argument out of range +E180493 = administrative command called incorrectly +E180494 = can't create session key +E180495 = can't read password from terminal +E180496 = illegal key: bad parity or weak +E180497 = Ubik ClientInit failed +E180498 = Ubik Call failed +E180499 = AuthServer returned incorrect response +E180500 = error reading cell database +E180501 = cell name not found +E180502 = too many Ubik security objects outstanding +E180503 = too many keys were passed to the server's security object +E180504 = authentication server was passed a bad ticket +E180505 = unknown key version number +E180506 = key cache invalidated by some key change +E180507 = may not issue ticket for server +E180508 = may not authenticate as this user +E180509 = may not change your key +E180510 = not allowed to create associate +E180511 = can't find suitable ticket +E180512 = operation not allowed for associate user +E180513 = not a special AuthServer principal +E180514 = server and client clocks are badly skewed +E180515 = not allowed to recursively call set_password from get_time +E180516 = Rx failed for some reason +E180517 = zero length password is illegal +E180518 = internal error encountered in kaserver +E180519 = password has expired (KAPWEXPIRED) +E180520 = it seems like a reused password (KAREUSED) +E180521 = you changed it too recently; see your systems administrator (KATOOSOON) +E180522 = ID is locked - see your system admin (KALOCKED) +#----------------------------------------------------------- +# Error Codes for afs_AdminBosErrors +#----------------------------------------------------------- +E16896 = the bos server name cannot be NULL +E16897 = the bos server handle cannot be NULL +E16898 = the bos server handle cannot be NULL +E16899 = the bos server handle failed to pass the magic number test. Most likely the server handle is invalid, or has been overwritten by mistake. +E16900 = the bos server handle is invalid +E16901 = the bos server handle does not reference a valid server +E16902 = unable to establish a connection with the specified bos server machine +E16903 = the process name cannot be NULL +E16904 = the process cannot be NULL +E16905 = the cron time cannot be NULL when creating a process of type cron +E16906 = the cron time must be NULL when creating a process of type fs or simple +E16907 = the process status cannot be NULL +E16908 = the process type cannot be NULL +E16909 = the process information cannot be NULL +E16910 = the parameter cannot be NULL +E16911 = the notifier cannot be NULL +E16912 = the administrator name cannot be NULL +E16913 = the key cannot be NULL +E16914 = the key cannot be NULL +E16915 = the host name cannot be NULL +E16916 = the source file cannot be NULL +E16917 = the destination file cannot be NULL +E16918 = the new time cannot be NULL +E16919 = the old time cannot be NULL +E16920 = the backup time cannot be NULL +E16921 = the restart time cannot be NULL +E16922 = the log name cannot be NULL +E16923 = the log buffer size cannot be NULL +E16924 = the log data buffer cannot be NULL +E16925 = the command cannot be NULL +E16926 = the auxiliary process status cannot be NULL +E16927 = the process status is invalid. You can only set a process state to BOS_PROCESS_STOPPED or BOS_PROCESS_RUNNING +E16928 = the process type retrieved from the bos server was invalid. +E16929 = the executable source file could not be opened for reading. +E16930 = unable to determine the size of the executable source file +E16931 = the executable source file could not be read. +E16932 = an error occurred transmitting the contents of the executable source file to the bos server. +E16933 = the executable source file cannot be NULL. +E16934 = the hour member of the time parameter must be between 0 and 23. +E16935 = the minute member of the time parameter must be between 0 and 60. +E16936 = the second member of the time parameter must be between 0 and 60. +E16937 = the day member of the time parameter must be between 0 and 6. +E16938 = unable to successfully read log file. +E16939 = the cell handle does not contain a valid token. +E16940 = the cell handle is not valid for vos requests. +E16941 = a parition must be specified when salvaging a volume . +E16942 = the log file could not be opened for writing. +E16943 = the resulting salvage command is too long to pass to the bos server. +E16944 = bos_ProcessCreate can't create fs processes, use bos_FSProcessCreate instead. +E16945 = the file server executable path cannot be NULL. +E16946 = the volume server executable path cannot be NULL. +E16947 = the salvager executable path cannot be NULL. +#----------------------------------------------------------- +# Error Codes for afs_AdminCfgErrors +#----------------------------------------------------------- +E17920 = the specified configuration option is not yet supported +E17921 = the host name parameter cannot be NULL +E17922 = the host name parameter exceeds the maximum allowed length +E17923 = the host handle reference parameter cannot be NULL +E17924 = the host handle parameter cannot be NULL +E17925 = the host handle parameter failed the magic number test; the handle is invalid or corrupted +E17926 = the host handle parameter is marked as invalid +E17927 = the host handle parameter contains a NULL host name reference +E17928 = the host handle parameter contains a NULL cell handle +E17929 = the host handle parameter contains a NULL cell name reference +E17930 = the administrator principal parameter cannot be NULL +E17931 = the administrator principal parameter exceeds the maximum allowed length +E17932 = the password parameter cannot be an empty string +E17933 = the configuration status reference parameter cannot be NULL +E17934 = the cell name reference parameter cannot be NULL +E17935 = the minimally required server configuration information is missing, unreadable, or invalid +E17936 = the server is not configured in any cell +E17937 = the server does not have any keys +E17938 = the server's cell is not listed in the server's cell database +E17939 = the server's cell database contains no database server entries for the server's cell +E17940 = the cell name parameter cannot be NULL +E17941 = the cell name parameter exceeds the maximum allowed length +E17942 = the cell name parameter conflicts with the cell name contained in the host handle parameter +E17943 = the database hosts parameter cannot be NULL +E17944 = the database hosts parameter contains too many host names +E17945 = unable to set the server cell information; most likely cause is an unknown database host name +E17946 = the bosserver process is currently running on the server host +E17947 = the vice partition table reference parameter cannot be NULL +E17948 = the vice partition table entry count reference parameter cannot be NULL +E17949 = unable to read the vice partition table +E17950 = the partition name parameter cannot be NULL +E17951 = the partition name parameter syntax is invalid +E17952 = the device name parameter cannot be NULL +E17953 = the device name parameter syntax is invalid +E17954 = the vice partition table entry is invalid +E17955 = unable to write to the vice partition table +E17956 = the valid flag reference parameter cannot be NULL +E17957 = the installed flag reference parameter cannot be NULL +E17958 = the version number reference parameter cannot be NULL +E17959 = the started flag reference parameter cannot be NULL +E17960 = the minimally required client configuration information is missing, unreadable, or invalid +E17961 = the client is not configured in any cell +E17962 = the client's cell is not listed in the client's cell database +E17963 = the client's cell database contains no database server entries for the client's cell +E17964 = unable to determine which version of the AFS client is installed +E17965 = unable to read the client's cell database +E17966 = unable to update the client's cell database +E17967 = the client's cell database contains the maximum number of entries for the specified cell; a new database host can not be added +E17968 = failed to edit client's cell database +E17969 = unable to set the client's current cell +E17970 = the AFS bosserver control service is not configured or is improperly configured +E17971 = the AFS bosserver control service is not prepared to accept a control request or is not responding +E17972 = timed out waiting for the AFS bosserver control service to start or stop +E17973 = cannot determine the status of the AFS bosserver control service +E17974 = failed to set or clear the AFS server authentication flag +E17975 = the bosserver-processes flag reference parameter cannot be NULL +E17976 = the database-servers-configured flag reference parameter cannot be NULL +E17977 = the fileserver-configured flag reference parameter cannot be NULL +E17978 = the upserver-configured flag reference parameter cannot be NULL +E17979 = the update client instance suffix cannot be NULL +E17980 = the update client instance suffix exceeds the maximum allowed length +E17981 = the update client's target server name cannot be NULL +E17982 = the update client's import directory list cannot be NULL +E17983 = the upclient-configured flag reference parameter cannot be NULL +E17984 = unable to establish a connection with the specified Ubik voting service on the specified host +E17985 = timed out waiting for one or more database servers to achieve quorum; common causes are time skew between database server machines and network connectivity problems +E17986 = the server's cell database contains too many database server entries +E17987 = the callback parameter cannot be NULL +E17988 = the update count reference parameter cannot be NULL +E17989 = the AFS server principal (afs) key can not be obtained from pre 3.5 database servers +E17990 = the specified AFS server principal (afs) password is invalid; the password generates a key that fails a checksum comparison with the current AFS server principal (afs) key +E17991 = the resolver is unable to retrieve host information from the default host database +E17992 = the specfied host name resolves to a fully qualified name that exceeds the maximum allowed length +E17993 = the AFS client service is not configured or is improperly configured +E17994 = the AFS client service is not prepared to accept a control request or is not responding +E17995 = timed out waiting for the AFS client service to start or stop +E17996 = cannot determine the status of the AFS client service +#----------------------------------------------------------- +# Error Codes for afs_AdminClientErrors +#----------------------------------------------------------- +E19456 = the cell handle parameter cannot be NULL +E19457 = the cell handle reference parameter cannot be NULL +E19458 = the server handle parameter failed to pass the magic number test. Most likely the server handle is invalid, or has been overwritten by mistake. +E19459 = the cell handle is not valid. +E19460 = the cell handle is not valid for authentication server requests +E19461 = the cell handle authentication server pointer is NULL +E19462 = the cell handle is not valid for protection server requests +E19463 = the cell handle protection server pointer is NULL +E19464 = the cell handle is not valid for volume server requests +E19465 = the cell handle volume server pointer is NULL +E19466 = the cell name parameter cannot be NULL +E19467 = the token handle parameter cannot be NULL +E19468 = the token handle is invalid +E19469 = the token handle parameter failed to pass the magic number test. Most likely the token handle is invalid, or has been overwritten by mistake +E19470 = failed to create a new client security object for the token handle +E19471 = unable to locate the location of AFS install +E19472 = unable to initialize the AFS rpc component +E19473 = unable to initialize the windows socket component +E19474 = afsclient_Init must be called before calling any other afsclient function +E19475 = an error occurred while trying to access the local client configuration information +E19476 = the token handle was marked as containing valid tokens, but the actual tokens were invalid +E19477 = the token handle must contain valid afs tokens for the cell +E19478 = the directory parameter cannot be NULL +E19479 = the volume name parameter cannot be NULL +E19480 = unable to determine the parent of the given directory +E19481 = the directory is not in AFS +E19482 = the server did not match any known AFS servers +E19483 = the rpc stat handle cannot be NULL +E19484 = the cell handle does not contain kas tokens +E19485 = there is no connection to the server +E19486 = the client stat handle cannot be NULL +E19487 = there is no connection to the client +E19488 = the cell name pointer cannot be NULL +E19489 = the client configuration pointer cannot be NULL +E19490 = the rxdebug handle cannot be NULL +E19491 = the rxdebug request timed out +E19492 = the rxdebug request is not supported +#----------------------------------------------------------- +# Error Codes for afs_AdminCommonErrors +#----------------------------------------------------------- +E17152 = couldn't allocate memory necessary to fulfill request +E17153 = insufficient privilege to complete operation +E17154 = failed to initialize a mutex +E17155 = failed to lock a mutex +E17156 = failed to unlock a mutex +E17157 = failed to destroy a mutex +E17158 = failed to initialize a condition variable +E17159 = failed to wait on a condition variable +E17160 = failed to destroy a condition variable +E17161 = failed to signal a condition variable +E17162 = failed to initialize a thread attribute +E17163 = failed to set thread detach state +E17164 = failed to create a thread +E17165 = failed to join a thread +E17166 = the iterator has been marked terminated (most likely by calling done). Next cannot be called after calling done. +E17167 = the iterator has been marked completed. +E17168 = the iterator parameter cannot be NULL. +E17169 = the rpc specific data parameter cannot be NULL. +E17170 = the iterator parameter failed to pass the magic number test. Most likely the iterator is invalid, or has been overwritten by mistake. +E17171 = the iterator parameter is marked invalid +E17172 = the iterator parameter cannot be NULL nor can it point to NULL +E17173 = the server name parameter cannot be NULL +E17174 = the server address parameter cannot be NULL +E17175 = the server name parameter cannot translated to an address +E17176 = unable to determine the name of the local host +E17177 = more data is available +E17178 = failed to create a socket +E17179 = the server type is invalid +#----------------------------------------------------------- +# Error Codes for afs_AdminKasErrors +#----------------------------------------------------------- +E19200 = the server handle parameter cannot be NULL +E19201 = the server handle parameter failed to pass the magic number test. Most likely the server handle is invalid, or has been overwritten by mistake. +E19202 = the server handle parameter is marked invalid +E19203 = the server handle parameter contains no servers +E19204 = the cell handle and the server handle parameter cannot both be NULL +E19205 = the cell handle and the server handle parameter cannot both be non-NULL +E19206 = the authentication server handle parameter cannot be NULL +E19207 = the from parameter cannot be NULL +E19208 = the to parameter cannot be NULL +E19209 = the server list parameter cannot be NULL +E19210 = the server list parameter contains too many servers +E19211 = the server handle parameter cannot be NULL nor can it point to NULL +E19212 = the who parameter cannot be NULL +E19213 = the password parameter cannot be NULL +E19214 = the authentication server parameter cannot be NULL +E19215 = the locked until parameter cannot be NULL +E19216 = the principal parameter cannot be NULL +E19217 = the key parameter cannot be NULL +E19218 = the lock end time parameter cannot be NULL +E19219 = the password expires parameter cannot be greater than 255 +E19220 = the failed password attempts parameter cannot be greater than 255 +E19221 = the failed password lock time parameter cannot be greater than 129600 +E19222 = the stats parameter cannot be NULL +E19223 = the debug parameter cannot be NULL +E19224 = the server list parameter didn't contain any servers +E19225 = at least one principal field to set must be specified +#----------------------------------------------------------- +# Error Codes for afs_AdminMiscErrors +#----------------------------------------------------------- +E19712 = the directory parameter cannot be NULL. +E19713 = the user parameter cannot be NULL. +E19714 = the acl parameter cannot be NULL. +E19715 = this interface does not support changing DFS acls. +#----------------------------------------------------------- +# Error Codes for afs_AdminPtsErrors +#----------------------------------------------------------- +E20480 = the protection server parameter cannot be NULL +E20481 = the user name parameter cannot be NULL +E20482 = the user name parameter is too long +E20483 = the group name parameter cannot be NULL +E20484 = the group name parameter is too long +E20485 = failed to translate a name to an identifier +E20486 = the new owner parameter cannot be NULL +E20487 = the new owner parameter is too long +E20488 = the new group parameter cannot be NULL +E20489 = the new group id parameter cannot be positive +E20490 = the target group parameter cannot be NULL +E20491 = the target group parameter is too long +E20492 = the group parameter cannot be NULL +E20493 = the group membership list is longer than the maximum retrievable +E20494 = the member name parameter cannot be NULL +E20495 = the old name parameter cannot be NULL +E20496 = the old name is too long +E20497 = the new name parameter cannot be NULL +E20498 = the new name is too long +E20499 = PTS_GROUP_ANYUSER_ACCESS is an invalid value for the list delete parameter +E20500 = PTS_GROUP_OWNER_ACCESS is an invalid value for the list groups owned parameter +E20501 = PTS_USER_ANYUSER_ACCESS is an invalid value for the list groups owned parameter +E20502 = the new entry parameter cannot be NULL +E20503 = the user parameter cannot be NULL +E20504 = the new group id parameter cannot be NULL +E20505 = the maximum group id parameter cannot be NULL +E20506 = the new user id parameter cannot be NULL +E20507 = the maximum user id parameter cannot be NULL +#----------------------------------------------------------- +# Error Codes for afs_AdminUtilErrors +#----------------------------------------------------------- +E21760 = the server entry parameter cannot be NULL +E21761 = the server name parameter cannot be NULL +E21762 = the server address parameter cannot be NULL +E21763 = the server address parameter cannot be NULL +E21764 = the server name parameter cannot translated to an address +E21765 = failed to open the client CellServDB file +E21766 = the error text parameter cannot be NULL +E21767 = the cell name parameter cannot be NULL +E21768 = the rx connection parameter cannot be NULL +E21769 = the rpc function parameter cannot be NULL +E21770 = the rpc stats parameter cannot be NULL +E21771 = the state parameter cannot be NULL +E21772 = the rpc version parameter cannot be NULL +E21773 = the rxdebug handle parameter cannot be null +E21774 = the rxdebug version parameter cannot be null +E21775 = the rxdebug stats parameter cannot be null +#----------------------------------------------------------- +# Error Codes for afs_AdminVosErrors +#----------------------------------------------------------- +E22016 = the volume server parameter cannot be NULL +E22017 = the cell handle parameter cannot be NULL +E22018 = the cell handle parameter failed to pass the magic number test. Most likely the cell handle is invalid, or has been overwritten by mistake. +E22019 = the cell handle parameter is marked as invalid. +E22020 = the cell handle parameter is marked as invalid for volume server requests. +E22021 = the cell handle does not contain valid AFS tokens. +E22022 = the volume identifier parameter must be a read write volume in order to make a backup volume. +E22023 = a backup volume already exists for volume identifier, but it exists on a server different from the one that holds volumeidentifier. +E22024 = the server handle parameter cannot be NULL +E22025 = the server handle parameter is marked as invalid +E22026 = the server handle parameter failed the magic number test. Most likely the server handle is invalid, or has been overwritten by mistake. +E22027 = a connection with the server could not be established. +E22028 = the partition parameter cannot be NULL +E22029 = the partition parameter is too large +E22030 = the volume name parameter is too long +E22031 = the volume name parameter cannot be NULL +E22032 = the volume name parameter cannot end with .readonly or .backup +E22033 = the volume identifier parameter cannot be NULL +E22034 = the volume identifier parameter cannot exceed VOLMAXPARTS +E22035 = the volume identifier does not exist on the specified server and partition +E22036 = the volume name is already in use. +E22037 = the partition name parameter cannot be NULL +E22038 = the partition name parameter must start with /vicep +E22039 = the partition name parameter is too long. +E22040 = the partition name parameter is too short. +E22041 = the partition name parameter must be all lower case letters. +E22042 = the partition identifier parameter cannot be NULL +E22043 = the resulting partition identifier exceeds VOLMAXPARTS +E22044 = the volume prefix parameter cannot be NULL when the exclude prefix is VOS_EXCLUDE +E22045 = the server address parameter cannot be NULL +E22046 = the server entry parameter cannot be NULL +E22047 = the server transaction status parameter cannot be NULL +E22048 = the vldb entry parameter cannot be NULL +E22049 = at least one of the arguments must not be null - server handle, partition, volume identifier. +E22050 = the new volume name parameter cannot be NULL +E22051 = both the server handle and the paritiion parameters must be specified. +E22052 = the dump file parameter cannot be NULL +E22053 = an error occurred while trying to write more data to the dump file +E22054 = an error occurred while trying to open dump file +E22055 = the volume to be restored exists on a server different from the one specified and you specified an incremental restore. If you wish to restore this volume, specify a full restore. +E22056 = an error occurred while trying open restore file +E22057 = an error occurred while trying close restore file +E22058 = an error occurred while trying read the restore file +E22059 = an error occurred while trying send the contents of the restore file +E22060 = the volume name is too big +E22061 = either the volume name or the volume identifier parameter must not be NULL +E22062 = the volume parameter cannot be NULL +E22063 = only read write volumes can be moved +E22064 = only read write volumes can be released +E22065 = only replicated volumes can be released +E22066 = unable to create a backup volume because no read write volume exists +E22067 = unable to create a backup volume because the vldb entry is invalid +E22068 = unable to get server's address from vldb +E22069 = skipping volume since read write is in a different location +E22070 = there were no entries in the vldb retrieved. +#----------------------------------------------------------- +# Error Codes for pterror +#----------------------------------------------------------- +E267264 = Entry for name already exists +E267265 = Entry for id already exists +E267266 = Couldn't allocate an id for this entry +E267267 = Couldn't read/write the database +E267268 = User or group doesn't exist +E267269 = Permission denied +E267270 = No group specified +E267271 = No user specified +E267272 = Badly formed name (group prefix doesn't match owner?) +E267273 = argument illegal or out of range +E267274 = may not create more groups +E267275 = database needs rebuilding +E267276 = can't make owner an empty group +E267277 = database is inconsistent +E267278 = bad database address +E267279 = too many elements in group +E267280 = malloc failed to alloc enough memory +#----------------------------------------------------------- +# Error Codes for stress_errs +#----------------------------------------------------------- +E19059456 = process created, not yet started +E19059457 = process running, no error +E19059458 = arguments illegal or inconsistent +E19059459 = incorrect input checksum +E19059460 = incorrect output checksum +E19059461 = unexpected number of bytes returned by rx_Read +E19059462 = unexpected number of bytes sent by rx_Write +E19059463 = connection unauthenticated +E19059464 = unknown key version number +E19059465 = incorrect client name/instance/cell +E19059466 = increment operation produced wrong value +E19059467 = clock on client and server too far apart +E19059468 = couldn't make a new connection +E19059469 = connection has unexpected call numbers +E19059470 = failed to detect duplicate call +E19059471 = failed to detect bad cksum +E19059472 = whole connection is not in error +E19059473 = idle connection is acting as a challenge oracle +#----------------------------------------------------------- +# Error Codes for rxkad_errs +#----------------------------------------------------------- +E19270400 = Security module structure inconsistent +E19270401 = Packet too short for security challenge +E19270402 = Security level negotiation failed +E19270403 = Ticket length too long or too short +E19270404 = packet had bad sequence number +E19270405 = caller not authorized +E19270406 = illegal key: bad parity or weak +E19270407 = security object was passed a bad ticket +E19270408 = ticket contained unknown key version number +E19270409 = authentication expired +E19270410 = sealed data inconsistent +E19270411 = user data too long +E19270412 = caller not authorized to use encrypted connections +#----------------------------------------------------------- +# Error Codes for uerrors +#----------------------------------------------------------- +E5376 = no quorum elected +E5377 = not synchronization site (should work on sync site) +E5378 = too many hosts +E5379 = I/O error writing dbase or log +E5380 = mysterious internal error +E5381 = major synchronization error +E5382 = file not found when processing dbase +E5383 = bad lock range size (must be 1) +E5384 = read error reprocessing log +E5385 = problems with host name +E5386 = bad operation for this transaction type +E5387 = two commits or aborts done to transaction +E5388 = operation done after abort (or commmit) +E5389 = no servers appear to be up +E5390 = premature EOF +E5391 = error writing log file +E5392 = unsupported address family -- bogus error +E5393 = inconsistent cell name -- bogus error +E5394 = security group bad or missing -- bogus error +E5395 = server group name bad or missing -- bogus error +E5396 = server uuid bad or missing -- bogus error +E5397 = memory allocation failure -- bogus error +E5398 = host not a member of server group -- bogus error +E5399 = too many bindings per server -- bogus error +E5400 = inconsistent principal name from binding -- bogus error +E5401 = I/O error in ubik pipe -- bogus error +E5402 = operation aborted to prevent dead lock (two sync sites?) +E5403 = rpc runtime exception caught -- bogus error +E5404 = vote thread pool queue operation failed -- bogus error +E5405 = clock skew among servers too high -- bogus error +E5406 = repeatedly failed to obtain ubik lock -- bogus error +E5407 = permission denied for attempted operation -- bogus error +E5408 = no space left on database device -- bogus error +E5409 = invalid DB pathname -- bogus error +E5410 = bad file descriptor -- bogus error +E5411 = Reinitialize called before initialize +E5412 = failed to initialize per client mutex +E5413 = failed to destroy per client mutex +#----------------------------------------------------------- +# Error Codes for vl_errors +#----------------------------------------------------------- +E363520 = Volume Id entry exists in vl database +E363521 = I/O related error +E363522 = Volume name entry exists in vl database +E363523 = Internal creation failure +E363524 = No such entry +E363525 = Vl database is empty +E363526 = Entry is deleted (soft delete) +E363527 = Volume name is illegal +E363528 = Index is out of range +E363529 = Bad volume type +E363530 = Illegal server number (out of range) +E363531 = Bad partition number +E363532 = Run out of space for Replication sites +E363533 = No such Replication server site exists +E363534 = Replication site already exists +E363535 = Parent R/W entry not found +E363536 = Illegal Reference Count number +E363537 = Vl size for attributes exceeded +E363538 = Bad incoming vl entry +E363539 = Illegal max volid increment +E363540 = RO/BACK id already hashed +E363541 = Vl entry is already locked +E363542 = Bad volume operation code +E363543 = Bad release lock type +E363544 = Status report: last release was aborted +E363545 = Invalid replication site server flag +E363546 = No permission access +E363547 = malloc(realloc) failed to alloc enough memory +E363548 = Wrong vldb version +E363549 = Index out of range +E363550 = Servers have the same ip address +E363551 = Illegal attribute mask value +#----------------------------------------------------------- +# Error Codes for volerr +#----------------------------------------------------------- +E1492325120 = internal error releasing transaction +E1492325121 = unknown internal error +E1492325122 = badly formatted dump +E1492325123 = badly formatted dump(2) +E1492325124 = could not attach volume +E1492325125 = illegal partition +E1492325126 = could not detach volume +E1492325127 = insufficient privilege for volume operation +E1492325128 = error from volume location database +E1492325129 = bad volume name +E1492325130 = volume moved +E1492325131 = illegal volume operation +E1492325132 = volume release failed +E1492325133 = volume still in use by volserver +E1492325134 = out of virtual memory in volserver +E1492325135 = no such volume +E1492325136 = more than one read/write volume +E1492325137 = failed volume server operation diff --git a/src/JAVA/classes/org/openafs/jafs/ACL.java b/src/JAVA/classes/org/openafs/jafs/ACL.java new file mode 100644 index 000000000..61e5ca22f --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/ACL.java @@ -0,0 +1,1263 @@ +/* + * @(#)ACL.java 2.0 04/18/2001 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.StringTokenizer; + +/** + * An abstract representation of AFS file and directory pathnames. + * + * This class is an extension of the standard Java File class with file-based + * manipulation methods overridden by integrated AFS native methods. + * + * @version 2.2, 03/24/2003 - Added new Delta ACL functionality and changes + * from Stonehenge. + * @version 2.0, 04/18/2001 - Completely revised class for efficiency. + */ + +public class ACL implements Serializable, Comparable +{ + private ACL.Entry[] positiveEntries; + private ACL.Entry[] negativeEntries; + + private ACL.Entry[] positiveExpungeEntries; + private ACL.Entry[] negativeExpungeEntries; + + /** + * Path for this ACL, if null then this ACL instance is most likely a + * Delta ACL. + */ + private String path = null; + + private ACL() + { + } + public ACL( String path ) throws AFSException + { + this( path, true ); + } + public ACL( String path, boolean init ) throws AFSException + { + int numberPositiveEntries = 0; + int numberNegativeEntries = 0; + ACL.Entry aclEntry; + String buffer; + + this.path = path; + + if ( init ) { + StringTokenizer st = new StringTokenizer( getACLString(path), "\n\t" ); + + buffer = st.nextToken(); + numberPositiveEntries = new Integer(buffer).intValue(); + positiveEntries = new ACL.Entry[numberPositiveEntries]; + + buffer = st.nextToken(); + numberNegativeEntries = new Integer(buffer).intValue(); + negativeEntries = new ACL.Entry[numberNegativeEntries]; + + for(int i = 0; i < numberPositiveEntries; i++) + { + aclEntry = new ACL.Entry(); + aclEntry.setUser(st.nextToken()); + aclEntry.setPermissions(new Integer(st.nextToken()).intValue()); + positiveEntries[i] = aclEntry; + } + + for(int i = 0; i < numberNegativeEntries; i++) + { + aclEntry = new ACL.Entry(); + aclEntry.setUser(st.nextToken()); + aclEntry.setPermissions(new Integer(st.nextToken()).intValue()); + negativeEntries[i] = aclEntry; + } + } else { + positiveEntries = new ACL.Entry[0]; + negativeEntries = new ACL.Entry[0]; + } + } + /** + * Returns the total number of ACL entries, this is the sum of positive + * and negative entries. + * + * @return Total number of ACL entries + */ + public int getEntryCount() + { + return getPositiveEntryCount() + getNegativeEntryCount(); + } + /** + * Returns the path this ACL instance is bound to. + * + * @return Path for this ACL + */ + public String getPath() + { + return path; + } + /** + * Writes the ACL to AFS, making all changes immediately effective. + * This method requires an active connection to AFS. + */ + public void flush() throws AFSException + { + setACLString(path, getFormattedString()); + } + + + /*--------------------------------------------------------------------------*/ + /* Positive ACL Methods */ + /*--------------------------------------------------------------------------*/ + + /** + * Returns the number of positive ACL entries for this ACL instance. + * + * @return Positive ACL entry count + */ + public int getPositiveEntryCount() + { + return ( positiveEntries == null ) ? 0 : positiveEntries.length; + } + /** + * Returns all positive ACL entries for this ACL instance. + * + * @return All positive ACL entries + */ + public ACL.Entry[] getPositiveEntries() + { + return ( positiveEntries == null ) ? new ACL.Entry[0] : positiveEntries; + } + /** + * Returns the positive ACL entry associated with the specified + * user/group name. + * + * @param name Name of user/group for desired ACL entry. + * @return Positive ACL entry + * @see ACL.Entry#getUser() + */ + public Entry getPositiveEntry(String name) + { + int n = getPositiveEntryCount(); + for (int i = 0; i < n; i++) { + if (positiveEntries[i].getUser().equalsIgnoreCase(name)) { + return positiveEntries[i]; + } + } + return null; + } + /** + * Returns all positive ACL entries to be expunged; used in Delta ACLs. + * + * @return All positive ACL entries + */ + public ACL.Entry[] getPositiveExpungeEntries() + { + return ( positiveExpungeEntries == null ) ? new ACL.Entry[0] : positiveExpungeEntries; + } + /** + * Returns true if this ACL contains the specified ACL entry. + * + * @param entry Positive ACL entry + * @return true if the specified ACL entry is present; + * false otherwise. + */ + public boolean containsPositiveEntry(Entry entry) + { + int n = getPositiveEntryCount(); + for (int i = 0; i < n; i++) { + if (positiveEntries[i].equals(entry)) { + return true; + } + } + return false; + } + /** + * Adds a single positive ACL entry to this ACL instance. + * + * @param entry ACL.Entry object to add + */ + public void addPositiveEntry( ACL.Entry entry ) throws AFSException + { + int n = getPositiveEntryCount(); + ACL.Entry[] e = new ACL.Entry[n + 1]; + if ( n > 0 ) System.arraycopy(positiveEntries, 0, e, 0, n); + e[n] = entry; + positiveEntries = e; + update(); + } + /** + * Adds the provided list of positive ACL entries to this ACL instance. + * + * @param entries Array of ACL.Entry objects to add + */ + public void addPositiveEntries( ACL.Entry[] entries ) throws AFSException + { + int n = getPositiveEntryCount(); + ACL.Entry[] e = new ACL.Entry[n + entries.length]; + System.arraycopy(positiveEntries, 0, e, 0, n); + System.arraycopy(entries,0,e,n,entries.length); + positiveEntries = e; + update(); + } + /** + * Sets the complete array of positive ACL entries to the provided + * ACL entry list (entries) for this ACL instance. + * + * @param entries Array of ACL.Entry objects that represent this + * ACL's positive entry list. + */ + public void setPositiveEntries( ACL.Entry[] entries ) throws AFSException + { + this.positiveEntries = entries; + update(); + } + /** + * Add a positive ACL entry to the list of positive ACL entries to be + * expunged; used in Delta ACLs. + * + * @param entry Positive ACL entries to be expunged. + */ + public void addPositiveExpungeEntry( ACL.Entry entry ) throws AFSException + { + int n = ( positiveExpungeEntries == null ) ? 0 : positiveExpungeEntries.length; + ACL.Entry[] e = new ACL.Entry[n + 1]; + if ( n > 0 ) System.arraycopy(positiveExpungeEntries, 0, e, 0, n); + e[n] = entry; + positiveExpungeEntries = e; + update(); + } + + /** + * Removes a single positive ACL entry from this ACL instance. + * + * @param entry ACL.Entry object to removed + */ + public void removePositiveEntry(Entry entry) throws AFSException + { + int n = getPositiveEntryCount(); + ArrayList list = new ArrayList(); + + for (int i = 0; i < n; i++) { + if (!positiveEntries[i].equals(entry)) { + list.add(positiveEntries[i]); + } + } + + positiveEntries = (ACL.Entry[]) list.toArray(new ACL.Entry[list.size()]); + update(); + } + /** + * Removes all positive ACL entries from this ACL instance. + */ + public void removeAllPositiveEntries() throws AFSException + { + positiveEntries = new Entry[0]; + update(); + } + + + /*--------------------------------------------------------------------------*/ + /* Negative ACL Methods */ + /*--------------------------------------------------------------------------*/ + + /** + * Returns the number of negative ACL entries for this ACL instance. + * + * @return Negative ACL entry count + */ + public int getNegativeEntryCount() + { + return ( negativeEntries == null ) ? 0 : negativeEntries.length; + } + /** + * Returns all negative ACL entries for this ACL instance. + * + * @return All negative ACL entries + */ + public ACL.Entry[] getNegativeEntries() + { + return ( negativeEntries == null ) ? new ACL.Entry[0] : negativeEntries; + } + /** + * Returns the negative ACL entry associated with the specified + * user/group name. + * + * @param name Name of user/group for desired ACL entry. + * @return Negative ACL entry + * @see ACL.Entry#getUser() + */ + public Entry getNegativeEntry(String name) + { + int n = getNegativeEntryCount(); + for (int i = 0; i < n; i++) { + if (negativeEntries[i].getUser().equalsIgnoreCase(name)) { + return negativeEntries[i]; + } + } + return null; + } + /** + * Returns all negative ACL entries to be expunged; used in Delta ACLs. + * + * @return All negative ACL entries to be expunged. + */ + public ACL.Entry[] getNegativeExpungeEntries() + { + return ( negativeExpungeEntries == null ) ? new ACL.Entry[0] : negativeExpungeEntries; + } + /** + * Returns true if this ACL contains the specified ACL entry. + * + * @param entry Negative ACL entry + * @return true if the specified ACL entry is present; + * false otherwise. + */ + public boolean containsNegative(Entry entry) + { + int n = getNegativeEntryCount(); + for (int i = 0; i < n; i++) { + if (negativeEntries[i].equals(entry)) { + return true; + } + } + return false; + } + /** + * Adds a single negative ACL entry to this ACL instance. + * + * @param entry ACL.Entry object to add + */ + public void addNegativeEntry( ACL.Entry entry ) throws AFSException + { + int n = getNegativeEntryCount(); + ACL.Entry[] e = new ACL.Entry[n + 1]; + if ( n > 0 ) System.arraycopy(negativeEntries, 0, e, 0, n); + e[n] = entry; + negativeEntries = e; + update(); + } + /** + * Adds the provided list of negative ACL entries to this ACL instance. + * + * @param entries Array of ACL.Entry objects to add + */ + public void addNegativeEntries( ACL.Entry[] entries ) throws AFSException + { + int n = getNegativeEntryCount(); + ACL.Entry[] e = new ACL.Entry[n + entries.length]; + System.arraycopy(negativeEntries, 0, e, 0, n); + System.arraycopy(entries,0,e,n,entries.length); + negativeEntries = e; + update(); + } + /** + * Add a negative ACL entry to the list of negative ACL entries to be + * expunged; used in Delta ACLs. + * + * @param entry Negative ACL entries to be expunged. + */ + public void addNegativeExpungeEntry( ACL.Entry entry ) throws AFSException + { + int n = ( negativeExpungeEntries == null ) ? 0 : negativeExpungeEntries.length; + ACL.Entry[] e = new ACL.Entry[n + 1]; + if ( n > 0 ) System.arraycopy(negativeExpungeEntries, 0, e, 0, n); + e[n] = entry; + negativeExpungeEntries = e; + update(); + } + /** + * Sets the complete array of negative ACL entries to the provided + * ACL entry list (entries) for this ACL instance. + * + * @param entries Array of ACL.Entry objects that represent this + * ACL's negative entry list. + */ + public void setNegativeEntries( ACL.Entry[] entries ) throws AFSException + { + this.negativeEntries = entries; + update(); + } + + /** + * Removes a single negative ACL entry from this ACL instance. + * + * @param entry ACL.Entry object to removed + */ + public void removeNegativeEntry(Entry entry) throws AFSException + { + int n = getNegativeEntryCount(); + ArrayList list = new ArrayList(); + + for (int i = 0; i < n; i++) { + if (!negativeEntries[i].equals(entry)) { + list.add(negativeEntries[i]); + } + } + + negativeEntries = (ACL.Entry[]) list.toArray(new ACL.Entry[list.size()]); + update(); + } + + /** + * Removes all negative ACL entries from this ACL instance. + */ + public void removeAllNegativeEntries() throws AFSException + { + negativeEntries = new Entry[0]; + update(); + } + + + /*--------------------------------------------------------------------------*/ + /* Delta ACL Methods */ + /*--------------------------------------------------------------------------*/ + + /** + * Returns a "Delta ACL", which is an ACL that represents only the difference + * (delta) of two ACLs, relative to the current ACL instance by the provided + * ACL specified by acl. + * + *

This ACL instance represents the base or reference object while the + * provided ACL (acl) represents the object in question. + * Therefore, if the provided ACL has an entry that differs from the base ACL, + * then the resulting Delta ACL will contain that entry found in the provided + * ACL; base ACL entries are never entered into the Delta ACL, but rather are + * used solely for comparison. + * + * @param acl the ACL to compare this ACL instance to + * @return Delta ACL by comparing this ACL instance with acl + */ + public ACL getDeltaACL( ACL acl ) throws AFSException + { + ACL delta = new ACL(); + int n = getPositiveEntryCount(); + + ACL.Entry[] pEntries = acl.getPositiveEntries(); + for ( int i = 0; i < pEntries.length; i++ ) + { + boolean match = false; + for ( int j = 0; j < n; j++ ) + { + if ( pEntries[i].equals( positiveEntries[j] ) ) { + match = true; + break; + } + } + if ( !match ) delta.addPositiveEntry( pEntries[i] ); + } + + // Check for positive entries that need to be expunged. + n = getPositiveEntryCount(); + if ( n > pEntries.length ) { + for ( int i = 0; i < n; i++ ) + { + String eu = positiveEntries[i].getUser(); + boolean match = false; + for ( int j = 0; j < pEntries.length; j++ ) + { + if ( eu != null && eu.equals( pEntries[j].getUser() ) ) { + match = true; + break; + } + } + if ( !match ) delta.addPositiveExpungeEntry( positiveEntries[i] ); + } + } + + n = getNegativeEntryCount(); + ACL.Entry[] nEntries = acl.getNegativeEntries(); + for ( int i = 0; i < nEntries.length; i++ ) + { + boolean match = false; + for ( int j = 0; j < n; j++ ) + { + if ( nEntries[i].equals( negativeEntries[j] ) ) { + match = true; + break; + } + } + if ( !match ) delta.addNegativeEntry( nEntries[i] ); + } + + // Check for negative entries that need to be expunged. + n = getNegativeEntryCount(); + if ( n > nEntries.length ) { + for ( int i = 0; i < n; i++ ) + { + String eu = negativeEntries[i].getUser(); + boolean match = false; + for ( int j = 0; j < nEntries.length; j++ ) + { + if ( eu != null && eu.equals( nEntries[j].getUser() ) ) { + match = true; + break; + } + } + if ( !match ) delta.addNegativeExpungeEntry( negativeEntries[i] ); + } + } + + return delta; + } + + /** + * Updates the current ACL instance by replacing, adding, or deleting + * ACL entries designated by the specified Delta ACL (delta). + * + *

If the provided Delta ACL has an entry that differs from this ACL + * instance, then the ACL entry of the Delta ACL will be set. + * + * @param delta the Delta ACL to be applied to this ACL instance + */ + public void update( ACL delta ) throws AFSException + { + ArrayList pos = new ArrayList( this.getPositiveEntryCount() ); + ArrayList neg = new ArrayList( this.getNegativeEntryCount() ); + + ACL.Entry[] pExpungeEntries = delta.getPositiveExpungeEntries(); + ACL.Entry[] nExpungeEntries = delta.getNegativeExpungeEntries(); + + ACL.Entry[] pEntries = delta.getPositiveEntries(); + ACL.Entry[] nEntries = delta.getNegativeEntries(); + + // Delete positive expunge entries first + int n = getPositiveEntryCount(); + for ( int i = 0; i < n; i++ ) + { + boolean match = false; + for ( int j = 0; j < pExpungeEntries.length; j++ ) + { + if ( pExpungeEntries[j].equals( positiveEntries[i] ) ) { + match = true; + break; + } + } + if ( !match ) pos.add( positiveEntries[i] ); + } + + // Now check for entries that need replacing + for ( int i = 0; i < pEntries.length; i++ ) + { + boolean match = false; + String user = pEntries[i].getUser(); + for ( int j = 0; j < pos.size(); j++ ) + { + if ( user.equals( ((ACL.Entry)pos.get(j)).getUser() ) ) { + pos.set( j, pEntries[i] ); + match = true; + break; + } + } + if ( !match ) pos.add( pEntries[i] ); + } + setPositiveEntries( (ACL.Entry[])pos.toArray(new ACL.Entry[pos.size()]) ); + + // Delete negative expunge entries next + n = getNegativeEntryCount(); + for ( int i = 0; i < n; i++ ) + { + boolean match = false; + for ( int j = 0; j < nExpungeEntries.length; j++ ) + { + if ( nExpungeEntries[j].equals( negativeEntries[i] ) ) { + match = true; + break; + } + } + if ( !match ) neg.add( negativeEntries[i] ); + } + + // Now check for entries that need replacing (negative) + for ( int i = 0; i < nEntries.length; i++ ) + { + boolean match = false; + String user = nEntries[i].getUser(); + for ( int j = 0; j < neg.size(); j++ ) + { + if ( user.equals( ((ACL.Entry)neg.get(j)).getUser() ) ) { + neg.set( j, nEntries[i] ); + match = true; + break; + } + } + if ( !match ) neg.add( nEntries[i] ); + } + setNegativeEntries( (ACL.Entry[])neg.toArray(new ACL.Entry[neg.size()]) ); + } + + + /*--------------------------------------------------------------------------*/ + /* Private Methods */ + /*--------------------------------------------------------------------------*/ + + /** + * Returns a resized array containing only valid (non-empty) ACL entries. + * + * @param entries Original array of entries, possibly containing empty + * entries. + * @return All non-empty ACL entries + */ + private ACL.Entry[] getNonEmptyEntries( ACL.Entry[] entries ) + { + if ( entries == null ) return new ACL.Entry[0]; + ArrayList list = new ArrayList( entries.length ); + for (int i = 0; i < entries.length; i++) + { + boolean isNonEmpty = entries[i].canRead() || + entries[i].canLookup() || + entries[i].canWrite() || + entries[i].canInsert() || + entries[i].canDelete() || + entries[i].canLock() || + entries[i].canAdmin(); + if (isNonEmpty) list.add(entries[i]); + } + if (list.size() == entries.length) return entries; + return (ACL.Entry[])list.toArray(new ACL.Entry[list.size()]); + } + + private void entriesToString( ACL.Entry[] entries, StringBuffer buffer ) + { + for (int i = 0; i < entries.length; i++) + { + this.entryToString((ACL.Entry)entries[i], buffer); + } + } + + private void entryToString( ACL.Entry entry, StringBuffer buffer ) + { + buffer.append(entry.getUser() + '\t' + entry.getPermissionsMask() + '\n'); + } + + private void update() throws AFSException + { + if ( path != null ) setACLString(path, getFormattedString()); + } + + /** + * Returns a ViceIoctl formatted String representation of this + * ACL. + * + * @return a ViceIoctl formatted String representation of this + * ACL. + */ + private String getFormattedString() + { + StringBuffer out = null; + ACL.Entry[] nonEmptyPos = this.getNonEmptyEntries(this.getPositiveEntries()); + ACL.Entry[] nonEmptyNeg = this.getNonEmptyEntries(this.getNegativeEntries()); + + out = new StringBuffer(nonEmptyPos.length + "\n" + nonEmptyNeg.length + "\n"); + this.entriesToString(nonEmptyPos, out); + this.entriesToString(nonEmptyNeg, out); + + return out.toString(); + } + + + /*--------------------------------------------------------------------------*/ + /* Custom Override Methods */ + /*--------------------------------------------------------------------------*/ + + /** + * Compares two ACL objects respective to their paths and does not + * factor any other attribute. Alphabetic case is significant in + * comparing names. + * + * @param acl The ACL object to be compared to this ACL + * instance + * + * @return Zero if the argument is equal to this ACL's path, a + * value less than zero if this ACL's path is + * lexicographically less than the argument, or a value greater + * than zero if this ACL's path is lexicographically + * greater than the argument + */ + public int compareTo(ACL acl) + { + return this.getPath().compareTo(acl.getPath()); + } + + /** + * Comparable interface method. + * + * @see #compareTo(ACL) + */ + public int compareTo(Object obj) + { + return compareTo((ACL)obj); + } + + /** + * Tests whether two ACL objects are equal, based on their + * paths and permission bits. + * + * @param acl the ACL to test + * @return whether the specifed ACL is the same as this ACL + */ + public boolean equals( ACL acl ) + { + return ( (this.getPath().equals(acl.getPath())) && + (positiveEntries.equals(acl.getPositiveEntries())) && + (negativeEntries.equals(acl.getNegativeEntries())) ); + } + + /** + * Returns a String representation of this ACL + * + * @return a String representation of this ACL + */ + public String toString() + { + ACL.Entry[] nonEmptyPos = this.getNonEmptyEntries(this.getPositiveEntries()); + ACL.Entry[] nonEmptyNeg = this.getNonEmptyEntries(this.getNegativeEntries()); + + StringBuffer out = new StringBuffer(); + if ( path == null ) { + out.append("Delta ACL\n"); + } else { + out.append("ACL for "); + out.append(path); + out.append("\n"); + } + out.append("Positive Entries:\n"); + for (int i = 0; i < nonEmptyPos.length; i++) { + out.append(" "); + out.append(nonEmptyPos[i].toString()); + } + if (nonEmptyNeg.length > 0) { + out.append("Negative Entries:\n"); + for (int i = 0; i < nonEmptyNeg.length; i++) { + out.append(" "); + out.append(nonEmptyNeg[i].toString()); + } + } + + // Check to see if this is a Delta ACL + if ( path == null ) { + nonEmptyPos = this.getNonEmptyEntries(this.getPositiveExpungeEntries()); + nonEmptyNeg = this.getNonEmptyEntries(this.getNegativeExpungeEntries()); + + if (nonEmptyPos.length > 0) { + out.append("Positive Entries to Delete:\n"); + for (int i = 0; i < nonEmptyPos.length; i++) { + out.append(" "); + out.append(nonEmptyPos[i].toString()); + } + } + if (nonEmptyNeg.length > 0) { + out.append("Negative Entries to Delete:\n"); + for (int i = 0; i < nonEmptyNeg.length; i++) { + out.append(" "); + out.append(nonEmptyNeg[i].toString()); + } + } + } + + return out.toString(); + } + + /*--------------------------------------------------------------------------*/ + /* Native Methods */ + /*--------------------------------------------------------------------------*/ + + /** + * Returns a formatted String representing the ACL for the specified path. + * + * The string format is in the form of a ViceIoctl and is as follows: + * printf("%d\n%d\n", positiveEntriesCount, negativeEntriesCount); + * printf("%s\t%d\n", userOrGroupName, rightsMask); + * + * @param path the directory path + * @returns a formatted String representing the ACL for the specified path. + * @throws an AFSException if an AFS or JNI exception is encountered. + */ + private native String getACLString(String path) throws AFSException; + + /** + * Sets the ACL in the file system according to this abstract representation. + * + * @param path the directory path + * @param aclString string representation of ACL to be set + * @throws an AFSException if an AFS or JNI exception is encountered. + */ + private native void setACLString(String path, String aclString) throws AFSException; + + /*====================================================================*/ + /* INNER CLASSES */ + /*====================================================================*/ + + /** + * AFS ACL Entry Class. + * + *

Documentation reference: + * Managing Access Control Lists + * + * @version 2.0, 04/18/2001 - Completely revised class for efficiency. + * @version 3.0, 05/01/2002 - Converted class to an inner class. + */ + public static final class Entry implements Serializable + { + /** ACL Mask read constant */ + public static final int READ = 1; + /** ACL Mask write constant */ + public static final int WRITE = 2; + /** ACL Mask insert constant */ + public static final int INSERT = 4; + /** ACL Mask lookup constant */ + public static final int LOOKUP = 8; + /** ACL Mask delete constant */ + public static final int DELETE = 16; + /** ACL Mask lock constant */ + public static final int LOCK = 32; + /** ACL Mask administer constant */ + public static final int ADMIN = 64; + + private String username; + + private boolean r = false; + private boolean l = false; + private boolean i = false; + private boolean d = false; + private boolean w = false; + private boolean k = false; + private boolean a = false; + + /** + * Constructs a new ACL entry with all permission bits set to false. + */ + public Entry() + { + } + /** + * Constructs a new ACL entry with all permission bits set to false + * and sets the associated user or group name. + * + * @param user The user or group name associated with this entry + */ + public Entry(String user) + { + this.setUser(user); + } + /** + * Constructs a new ACL entry setting each permission bit to its appropriate + * value according to the permissionsMask specified. + * + * @see #canRead + * @see #canWrite + * @see #canInsert + * @see #canLookup + * @see #canDelete + * @see #canLock + * @see #canAdmin + * @param permissionsMask An integer representation of the permissoin + * rights of this entry + */ + public Entry(int permissionsMask) + { + this.setPermissions(permissionsMask); + } + /** + * Constructs a new ACL entry setting each permission bit to its appropriate + * value according to the permissionsMask specified + * and sets the associated user or group name. + * + * @see #canRead + * @see #canWrite + * @see #canInsert + * @see #canLookup + * @see #canDelete + * @see #canLock + * @see #canAdmin + * @see #setUser + * @param permissionsMask An integer representation of the permissoin + * rights of this entry + * @param user The username or group associated with this entry + */ + public Entry(String user, int permissionsMask) + { + this.setUser(user); + this.setPermissions(permissionsMask); + } + /*-------------------------------------------------------------------------*/ + /** + * Set this entry's permission bits according to the value of the + * permissionsMask specified. + * + * @see #getPermissionsMask + * @param permissionsMask An integer representation of the permissoin + * rights of this entry + */ + public void setPermissions(int permissionsMask) + { + if ((permissionsMask & READ) != 0) { + this.setRead(true); + } + if ((permissionsMask & LOOKUP) != 0) { + this.setLookup(true); + } + if ((permissionsMask & INSERT) != 0) { + this.setInsert(true); + } + if ((permissionsMask & DELETE) != 0) { + this.setDelete(true); + } + if ((permissionsMask & WRITE) != 0) { + this.setWrite(true); + } + if ((permissionsMask & LOCK) != 0) { + this.setLock(true); + } + if ((permissionsMask & ADMIN) != 0) { + this.setAdmin(true); + } + } + /** + * Returns this entry's permission mask. + * + *

Permission Mask
+ * 01 - READ
+ * 02 - WRITE
+ * 04 - INSERT
+ * 08 - LOOKUP
+ * 16 - DELETE
+ * 32 - LOCK
+ * 64 - ADMIN
+ * + *

Any combination of the above mask values would equate to a valid combination of + * permission settings. For example, if the permission mask was 11, the ACL permissions + * would be as follows: read (1), write (2), and lookup (8).
+ * [1 + 2 + 8 = 11] + * + * @return An integer representation (mask) of the permissoin rights of this entry + */ + public int getPermissionsMask() + { + int permissionsMask = 0; + if (canRead()) permissionsMask |= READ; + if (canWrite()) permissionsMask |= WRITE; + if (canInsert()) permissionsMask |= INSERT; + if (canLookup()) permissionsMask |= LOOKUP; + if (canDelete()) permissionsMask |= DELETE; + if (canLock()) permissionsMask |= LOCK; + if (canAdmin()) permissionsMask |= ADMIN; + return permissionsMask; + } + /** + * Returns the user or group name associated with this ACL entry. + * + * @return String representation of the user or group name associated with this entry. + */ + public String getUser() + { + return username; + } + /** + * Sets the user or group name associated with this ACL entry. + * + * @param user representation of the user or group name associated with this entry. + */ + public void setUser(String user) + { + username = user; + } + /** + * File Permission Tests whether the ACL permits read access. + * + *

This permission enables a user to read the contents of files in the directory + * and to obtain complete status information for the files (read/retrieve the file + * attributes). + * + *

File Permission File Permission
+ * This permission is meaningful with respect to files in + * a directory, rather than the directory itself or its subdirectories. + * + *

Documentation reference: + * The AFS ACL Permissions + * + * @return true if and only if the ACL permits read access of + * files; false otherwise + */ + public boolean canRead() + { + return r; + } + /** + * Sets the ACL permission to accomodate read access for files. + * + * @see #canRead + * @param flag boolean flag that denotes the permission bit for read access. + */ + public void setRead(boolean flag) + { + r = flag; + } + /** + * Directory Permission Tests whether the ACL permits lookup access. + * + *

This permission functions as something of a gate keeper for access to the directory + * and its files, because a user must have it in order to exercise any other permissions. + * In particular, a user must have this permission to access anything in the directory's + * subdirectories, even if the ACL on a subdirectory grants extensive permissions. + * + *

This permission enables a user to list the names of the files and subdirectories in + * the directory (this does not permit read access to its respective entries), obtain + * complete status information for the directory element itself, and examine the directory's + * ACL. + * + *

This permission does not enable a user to read the contents of a file in the + * directory. + * + *

Similarly, this permission does not enable a user to lookup the contents of, + * obtain complete status information for, or examine the ACL of the subdirectory of + * the directory. Those operations require the lookup permission on the ACL + * of the subdirectory itself. + * + *

Directory Permission Directory Permission
+ * This permission is meaningful with respect to the + * directory itself. For example, the insert permission (see: {@link #canInsert}) + * does not control addition of data to a file, but rather creation of a new file or + * subdirectory. + * + *

Documentation reference: + * The AFS ACL Permissions + * + * @return true if and only if the ACL permits lookup access for + * directories; false otherwise + */ + public boolean canLookup() + { + return l; + } + /** + * Sets the ACL permission to accomodate lookup access for directories. + * + * @see #canLookup + * @param flag boolean flag that denotes the permission bit for lookup access. + */ + public void setLookup(boolean flag) + { + l = flag; + } + /** + * Directory Permission Tests whether the ACL permits insert access. + * + *

This permission enables a user to add new files to the directory, either by creating + * or copying, and to create new subdirectories. It does not extend into any subdirectories, + * which are protected by their own ACLs. + * + *

Directory Permission Directory Permission
+ * This permission is meaningful with respect to the + * directory itself. For example, the insert permission (see: {@link #canInsert}) + * does not control addition of data to a file, but rather creation of a new file or + * subdirectory. + * + *

Documentation reference: + * The AFS ACL Permissions + * + * @return true if and only if the ACL permits insert access for + * directories; false otherwise + */ + public boolean canInsert() + { + return i; + } + /** + * Sets the ACL permission to accomodate insert access for directories. + * + * @see #canInsert + * @param flag boolean flag that denotes the permission bit for insert access. + */ + public void setInsert(boolean flag) + { + i = flag; + } + /** + * Directory Permission Tests whether the ACL permits delete access. + * + *

This permission enables a user to remove files and subdirectories from the directory + * or move them into other directories (assuming that the user has the insert + * (see: {@link #canInsert}) permission on the ACL of the other directories). + * + *

Directory Permission Directory Permission
+ * This permission is meaningful with respect to the + * directory itself. For example, the insert permission (see: {@link #canInsert}) + * does not control addition of data to a file, but rather creation of a new file or + * subdirectory. + * + *

Documentation reference: + * The AFS ACL Permissions + * + * @return true if and only if the ACL permits delete access for + * directories; false otherwise + */ + public boolean canDelete() + { + return d; + } + /** + * Sets the ACL permission to accomodate delete access for directories. + * + * @see #canDelete + * @param flag boolean flag that denotes the permission bit for delete rights. + */ + public void setDelete(boolean flag) + { + d = flag; + } + /** + * File Permission Tests whether the ACL permits write access. + * + *

This permission enables a user to modify the contents of files in the directory + * and to change their operating system specific mode bits. + * + *

File Permission File Permission
+ * This permission is meaningful with respect to files in + * a directory, rather than the directory itself or its subdirectories. + * + *

Documentation reference: + * The AFS ACL Permissions + * + * @return true if and only if the ACL permits write access for + * files; false otherwise + */ + public boolean canWrite() + { + return w; + } + /** + * Sets the ACL permission to accomodate write access for files. + * + * @see #canWrite + * @param flag boolean flag that denotes the permission bit for write access. + */ + public void setWrite(boolean flag) + { + w = flag; + } + /** + * File Permission Tests whether the ACL permits the lock authority. + * + *

This permission enables the user to run programs that issue system calls to + * lock files in the directory. + * + *

File Permission File Permission
+ * This permission is meaningful with respect to files in + * a directory, rather than the directory itself or its subdirectories. + * + *

Documentation reference: + * The AFS ACL Permissions + * + * @return true if and only if the ACL permits lock authority for + * files; false otherwise + */ + public boolean canLock() + { + return k; + } + /** + * Sets the ACL permission to accomodate lock access for files. + * + * @see #canLock + * @param flag boolean flag that denotes the permission bit for lock rights. + */ + public void setLock(boolean flag) + { + k = flag; + } + /** + * Directory Permission Tests whether the ACL permits administer access. + * + *

This permission enables a user to change the directory's ACL. Members of the + * system:administrators group implicitly have this permission on every + * directory (that is, even if that group does not appear on the ACL). Similarly, the + * owner of a directory implicitly has this permission on its ACL and those of all + * directories below it that he or she owns. + * + *

Directory Permission Directory Permission
+ * This permission is meaningful with respect to the + * directory itself. For example, the insert permission (see: {@link #canInsert}) + * does not control addition of data to a file, but rather creation of a new file or + * subdirectory. + * + *

Documentation reference: + * The AFS ACL Permissions + * + * @return true if and only if the ACL permits administer access for + * directories; false otherwise + */ + public boolean canAdmin() + { + return a; + } + /** + * Sets the ACL permission to accomodate administer rights for directories. + * + * @see #canAdmin + * @param flag boolean flag that denotes the permission bit for administer rights. + */ + public void setAdmin(boolean flag) + { + a = flag; + } + + /////////////// custom override methods //////////////////// + + /** + * Tests whether two ACL.Entry objects are equal, based on associated + * username and permission bits. + * + * @param entry the ACL.Entry to test + * @return whether the specifed ACL.Entry is the same as this ACL.Entry + */ + public boolean equals( ACL.Entry entry ) + { + return ( (this.getUser().equals( entry.getUser() )) && + (this.getPermissionsMask() == entry.getPermissionsMask()) ); + } + + /** + * Returns a String representation of this ACL.Entry + * + * @return a String representation of this ACL.Entry + */ + public String toString() + { + StringBuffer out = new StringBuffer(username); + out.append("\t"); + if (r) out.append("r"); + if (l) out.append("l"); + if (i) out.append("i"); + if (d) out.append("d"); + if (w) out.append("w"); + if (k) out.append("k"); + if (a) out.append("a"); + out.append("\n"); + return out.toString(); + } + + } +} diff --git a/src/JAVA/classes/org/openafs/jafs/AFSException.java b/src/JAVA/classes/org/openafs/jafs/AFSException.java new file mode 100644 index 000000000..ed6154e5b --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/AFSException.java @@ -0,0 +1,189 @@ +/* + * @(#)AFSException.java 2.0 01/04/16 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.util.Locale; + +/** + * An exception indicating that an error has occurred in the Java AFS + * API, in the Java AFS JNI, or in the AFS file system. + * + * @version 1.0, 04/16/2001 + * @see java.lang.Exception + */ +public class AFSException extends Exception +{ + /** + * The AFS specific error number (code). + * @see #getErrorCode() + */ + protected int errno; + + /** + * Constructs an AFSException with the specified detail + * message. + * + * @param reason the detail message. + */ + public AFSException(String reason) + { + super(reason); + } + /** + * Constructs an AFSException with the specified error code. + * This constructor will also generate the appropriate error message + * respective to the specified error code. + * + * @param errno the AFS error number (error code). + */ + public AFSException(int errno) + { + super(ErrorTable.getMessage( (errno == 0) ? ErrorTable.UNKNOWN : errno )); + this.errno = (errno == 0) ? ErrorTable.UNKNOWN : errno; + } + /** + * Constructs an AFSException with the specified detail message + * and specified error code. In this constructor the specified detail message + * overrides the default AFS error message defined by the + * ErrorTable class. Therefore, to retrieve the AFS specific + * error message, you must use the {@link #getAFSMessage} method. + * The {@link #getMessage} method will return the message specified + * in this constructor. + * + * @param reason the detail message. + * @param errno the AFS error number (error code). + */ + public AFSException(String reason, int errno) + { + super(reason); + this.errno = errno; + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the AFS specific error number (code). This code can be interpreted + * by use of the {@link ErrorTable} class method + * {@link ErrorTable#getMessage(int)}. + * + * @return the AFS error code of this AFSException + * object. + * @see ErrorTable#getMessage(int) + */ + public int getErrorCode() + { + return errno; + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the error message string of this exception. + * + * @return the error message string of this exception object. + * + * @see #getAFSMessage() + */ + public String getMessage() + { + String msg = super.getMessage(); + return (msg == null) ? ErrorTable.getMessage(errno) : msg; + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the locale specific error message string of this exception. + * + * @return the error message string of this exception object. + * @param locale the locale for which this message will be displayed + * + * @see #getAFSMessage() + */ + public String getMessage(Locale locale) + { + String msg = super.getMessage(); + return (msg == null) ? ErrorTable.getMessage(errno, locale) : msg; + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the AFS error message string defined by the ErrorTable + * class. The message will be formatted according to the default + * Locale. + * + *

This message is also available from this object's super class + * method getMessage. However, this method will always return + * the string message associated with the actual AFS error code/number + * specified, whereas the {@link #getMessage()} method will return the + * string message intended for this Exception object, which may be + * an overridden message defined in the constructor of this Exception. + * + * @return the AFS error message string of this exception object. + * + * @see #getAFSMessage(Locale) + * @see AFSException#AFSException(String, int) + * @see ErrorTable#getMessage(int) + * @see java.lang.Exception#getMessage() + */ + public String getAFSMessage() + { + return ErrorTable.getMessage(errno); + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the AFS error message defined by the ErrorTable + * class. The message will be formatted according to the specified Locale. + * + *

This message is also available from this object's super class + * method getMessage. However, this method will always return + * the string message associated with the actual AFS error code/number + * specified, whereas the {@link #getMessage()} method will return the + * string message intended for this Exception object, which may be + * an overridden message defined in the constructor of this Exception. + * + * @return the AFS error message string of this exception object. + * @param locale the locale for which this message will be displayed + * + * @see #getAFSMessage() + * @see AFSException#AFSException(String, int) + * @see ErrorTable#getMessage(int, Locale) + * @see java.lang.Exception#getMessage() + */ + public String getAFSMessage(Locale locale) + { + return ErrorTable.getMessage(errno, locale); + } + /*-----------------------------------------------------------------------*/ + /** + * Returns a string representation of this AFS Exception. + * + *

The message will be formatted according to the specified Locale. + * + * @return the AFS error message string of this exception object. + * + * @see #getAFSMessage() + * @see ErrorTable#getMessage(int) + * @see java.lang.Exception#getMessage() + */ + public String toString() + { + return "AFSException: Error Code: " + errno + "; Message: " + + getMessage(); + } + /*-----------------------------------------------------------------------*/ +} diff --git a/src/JAVA/classes/org/openafs/jafs/AFSFileException.java b/src/JAVA/classes/org/openafs/jafs/AFSFileException.java new file mode 100644 index 000000000..3d6c39865 --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/AFSFileException.java @@ -0,0 +1,195 @@ +/* + * @(#)AFSFileException.java 2.0 01/04/16 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.util.Locale; + +/** + * An exception indicating that a file related error has occured in the + * Java AFS API, in the Java AFS JNI, or in the AFS file system. + * + *

This exception extends Java's java.io.IOException + * and is therefore often used as a substitution for + * {@link java.io.IOException}. + * + * @version 2.0, 04/16/2001 + * @version 1.0, 05/25/2000 + * @see AFSException + * @see java.io.IOException + */ +public class AFSFileException extends java.io.IOException +{ + /** + * The AFS specific error number (code). + * @see #getErrorCode() + */ + protected int errno; + + /** + * Constructs an AFSFileException with the specified detail + * message. + * + * @param reason the detail message. + */ + public AFSFileException (String reason) + { + super(reason); + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the AFS specific error number (code). This code can be interpreted + * by use of the {@link ErrorTable} class method + * {@link ErrorTable#getMessage(int)}. + * + * @return the AFS error code of this AFSException + * object. + * @see ErrorTable#getMessage(int) + */ + public int getErrorCode() + { + return errno; + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the error message string of this exception. + * + * @return the error message string of this exception object. + * + * @see #getAFSMessage() + */ + public String getMessage() + { + String msg = super.getMessage(); + return (msg == null) ? ErrorTable.getMessage(errno) : msg; + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the locale specific error message string of this exception. + * + * @return the error message string of this exception object. + * @param locale the locale for which this message will be displayed + * + * @see #getAFSMessage() + */ + public String getMessage(Locale locale) + { + String msg = super.getMessage(); + return (msg == null) ? ErrorTable.getMessage(errno, locale) : msg; + } + /** + * Constructs an AFSFileException with the specified error + * code. This constructor will also generate the appropriate error message + * respective to the specified error code. + * + * @param errno the AFS error number (error code). + */ + public AFSFileException (int errno) + { + super(ErrorTable.getMessage( (errno == 0) ? ErrorTable.UNKNOWN : errno )); + this.errno = (errno == 0) ? ErrorTable.UNKNOWN : errno; + } + /** + * Constructs an AFSFileException with the specified detail + * message and specified error code. In this constructor the specified + * detail message overrides the default AFS error message defined by the + * ErrorTable class. Therefore, to retrieve the AFS specific + * error message, you must use the {@link #getAFSMessage} + * method. The {@link #getMessage} method will return + * the message specified in this constructor. + * + * @param reason the detail message. + * @param errno the AFS error number (error code). + * @see #getAFSMessage() + */ + public AFSFileException (String reason, int errno) + { + super( (reason == null) ? ErrorTable.getMessage( errno ) : reason ); + this.errno = errno; + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the AFS error message string defined by the ErrorTable + * class. The message will be formatted according to the default + * Locale. + * + *

This message is also available from this object's super class + * method getMessage. However, this method will always return + * the string message associated with the actual AFS error code/number + * specified, whereas the {@link #getMessage()} method will return the + * string message intended for this Exception object, which may be + * an overridden message defined in the constructor of this Exception. + * + * @return the AFS error message string of this exception object. + * + * @see #getAFSMessage(Locale) + * @see AFSFileException#AFSFileException(String, int) + * @see ErrorTable#getMessage(int) + * @see java.lang.Exception#getMessage() + */ + public String getAFSMessage() + { + return ErrorTable.getMessage(errno); + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the AFS error message defined by the ErrorTable + * class. The message will be formatted according to the specified Locale. + * + *

This message is also available from this object's super class + * method getMessage. However, this method will always return + * the string message associated with the actual AFS error code/number + * specified, whereas the {@link #getMessage()} method will return the + * string message intended for this Exception object, which may be + * an overridden message defined in the constructor of this Exception. + * + * @return the AFS error message string of this exception object. + * @param locale the locale for which this message will be displayed + * + * @see #getAFSMessage() + * @see AFSFileException#AFSFileException(String, int) + * @see ErrorTable#getMessage(int, Locale) + * @see java.lang.Exception#getMessage() + */ + public String getAFSMessage(Locale locale) + { + return ErrorTable.getMessage(errno, locale); + } + /*-----------------------------------------------------------------------*/ + /** + * Returns a string representation of this AFS Exception. + * + * @return the AFS error message string of this + * AFSFileException object. + * + * @see #getMessage() + */ + public String toString() + { + return "AFSFileException: Error Code: " + errno + "; Message: " + + getMessage(); + } + /*-----------------------------------------------------------------------*/ +} + + diff --git a/src/JAVA/classes/org/openafs/jafs/AFSSecurityException.java b/src/JAVA/classes/org/openafs/jafs/AFSSecurityException.java new file mode 100644 index 000000000..2a138ecf6 --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/AFSSecurityException.java @@ -0,0 +1,187 @@ +/* + * @(#)AFSSecurityException.java 2.0 01/04/16 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.util.Locale; + +/** + * An exception indicating that a security related error has occured in the + * Java AFS API, in the Java AFS JNI, or in the AFS file system. + * + * @version 1.0, 04/16/2001 + * @see AFSException + */ +public class AFSSecurityException extends SecurityException +{ + /** + * The AFS specific error number (code). + * @see #getErrorCode() + */ + protected int errno; + + /** + * Constructs an AFSSecurityException with the specified detail + * message. + * + * @param reason the detail message. + */ + public AFSSecurityException (String reason) + { + super(reason); + } + /** + * Constructs an AFSSecurityException with the specified error + * code. This constructor will also generate the appropriate error message + * respective to the specified error code. + * + * @param errno the AFS error number (error code). + */ + public AFSSecurityException (int errno) + { + super(ErrorTable.getMessage( (errno == 0) ? ErrorTable.UNKNOWN : errno )); + this.errno = (errno == 0) ? ErrorTable.UNKNOWN : errno; + } + /** + * Constructs an AFSFileException with the specified detail + * message and specified error code. In this constructor the specified + * detail message overrides the default AFS error message defined by the + * ErrorTable class. Therefore, to retrieve the AFS specific + * error message, you must use the {@link #getAFSMessage} + * method. The {@link #getMessage} method will return + * the message specified in this constructor. + * + * @param reason the detail message. + * @param errno the AFS error number (error code). + * @see #getAFSMessage() + */ + public AFSSecurityException (String reason, int errno) + { + super( (reason == null) ? ErrorTable.getMessage( errno ) : reason ); + this.errno = errno; + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the AFS specific error number (code). This code can be interpreted + * by use of the {@link ErrorTable} class method + * {@link ErrorTable#getMessage(int)}. + * + * @return the AFS error code of this AFSException + * object. + * @see ErrorTable#getMessage(int) + */ + public int getErrorCode() + { + return errno; + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the error message string of this exception. + * + * @return the error message string of this exception object. + * + * @see #getAFSMessage() + */ + public String getMessage() + { + String msg = super.getMessage(); + return (msg == null) ? ErrorTable.getMessage(errno) : msg; + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the locale specific error message string of this exception. + * + * @return the error message string of this exception object. + * @param locale the locale for which this message will be displayed + * + * @see #getAFSMessage() + */ + public String getMessage(Locale locale) + { + String msg = super.getMessage(); + return (msg == null) ? ErrorTable.getMessage(errno, locale) : msg; + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the AFS error message string defined by the ErrorTable + * class. The message will be formatted according to the default + * Locale. + * + *

This message is also available from this object's super class + * method getMessage. However, this method will always return + * the string message associated with the actual AFS error code/number + * specified, whereas the {@link #getMessage()} method will return the + * string message intended for this Exception object, which may be + * an overridden message defined in the constructor of this Exception. + * + * @return the AFS error message string of this exception object. + * + * @see #getAFSMessage(Locale) + * @see AFSSecurityException#AFSSecurityException(String, int) + * @see ErrorTable#getMessage(int) + * @see java.lang.Exception#getMessage() + */ + public String getAFSMessage() + { + return ErrorTable.getMessage(errno); + } + /*-----------------------------------------------------------------------*/ + /** + * Returns the AFS error message defined by the ErrorTable + * class. The message will be formatted according to the specified Locale. + * + *

This message is also available from this object's super class + * method getMessage. However, this method will always return + * the string message associated with the actual AFS error code/number + * specified, whereas the {@link #getMessage()} method will return the + * string message intended for this Exception object, which may be + * an overridden message defined in the constructor of this Exception. + * + * @return the AFS error message string of this exception object. + * @param locale the locale for which this message will be displayed + * + * @see #getAFSMessage() + * @see AFSSecurityException#AFSSecurityException(String, int) + * @see ErrorTable#getMessage(int, Locale) + * @see java.lang.Exception#getMessage() + */ + public String getAFSMessage(Locale locale) + { + return ErrorTable.getMessage(errno, locale); + } + /*-----------------------------------------------------------------------*/ + /** + * Returns a string representation of this AFS Exception. + * + * @return the AFS error message string of this + * AFSSecurityException object. + * + * @see #getMessage() + */ + public String toString() + { + return "AFSSecurityException: Error Code: " + errno + "; Message: " + + getMessage(); + } + /*-----------------------------------------------------------------------*/ +} diff --git a/src/JAVA/classes/org/openafs/jafs/Cell.java b/src/JAVA/classes/org/openafs/jafs/Cell.java new file mode 100644 index 000000000..61aa84a07 --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/Cell.java @@ -0,0 +1,1879 @@ +/* + * @(#)Cell.java 1.0 6/29/2001 + * + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.util.ArrayList; +import java.util.GregorianCalendar; +import java.util.Date; + +/** + * An abstract representation of an AFS cell. It holds information about + * the cell, such as what users, groups, and servers exist in the cell. + *

+ * + * Constructing a Cell object does not mean a new cell is + * created in the AFS file system -- on the contrary, a Cell + * object must be a representation of an already existing AFS cell. There + * is no way to create a new AFS cell through this API. See + * OpenAFS.org for information on how + * to create a new cell.

+ * + * The construction of a Cell object acts as an entry point + * for authentication into the AFS system. Thus, when you construct a + * Cell, you must pass in an authenticated Token + * of a user in the AFS cell that the Cell represents. You + * will be authenticated as the user represented by token and + * you will only be allowed to perform actions that the user is + * authorized to perform. You must construct a Cell before + * attempting to construct any other object in this package, since the + * other objects all require a Cell object on construction, + * either directly or indirectly.

+ * + * Note that to successfully construct a Cell object, the + * code must be running on a machine with a running AFS client, and the + * cell this object is to represent must have an entry in the client's + * CellServDB file.

+ * + * Each Cell object has its own individual set of + * Servers, Users, and Groups. + * This represents the properties and attributes of an actual AFS cell. + * + * If an error occurs during a method call, an + * AFSException will be thrown. This class is the Java + * equivalent of errors thrown by AFS; see {@link AFSException} + * for a complete description.

+ * + * + * The following is a simple example of how to construct and use a + * Cell object. It shows how a Cell can be used to + * get an abstract representation of an AFS server, and how it can obtain an + * array of User objects, each of which is an abstract + * representation of an AFS user.

+ * + *

+ * import org.openafs.jafs.AFSException;
+ * import org.openafs.jafs.Cell;
+ * import org.openafs.jafs.Partition;
+ * import org.openafs.jafs.Server;
+ * import org.openafs.jafs.Token;
+ * import org.openafs.jafs.User;
+ * ...
+ * public class ...
+ * {
+ *   ...
+ *   private Cell cell;
+ *   private Server server;
+ *   private Token token;
+ *   ...
+ *   public static void main(String[] args) throws Exception
+ *   {
+ *     String username   = arg[0];
+ *     String password   = arg[1];
+ *     String cellName   = arg[2];
+ *     String serverName = arg[3];
+ * 
+ *     token = new Token(username, password, cellName);
+ *     cell   = new Cell(token);
+ *     server = cell.getServer(serverName);
+ *
+ *     User[] users = cell.getUsers();
+ *     ...
+ *   }
+ *   ...
+ * }
+ * 
+ * + */ +public class Cell implements java.io.Serializable +{ + protected ArrayList users; + protected ArrayList userNames; + protected ArrayList groups; + protected ArrayList groupNames; + protected ArrayList servers; + protected ArrayList serverNames; + + protected String name; + protected int cellHandle; + protected Token token; + + protected int maxGroupID; + protected int maxUserID; + + protected GregorianCalendar tokenExpiration; + + protected boolean cachedInfo; + + /** + * Constructs a new Cell object instance given + * the Token that should represents an authenticated user + * with administrative access. In order to get full access to the cell, + * it is best that the Token provided have administrative + * privileges. + * + * @param token the user's authenticated token + * @exception AFSException If an error occurs in the native code + */ + public Cell( Token token ) + throws AFSException + { + this.token = token; + this.name = token.getCellName(); + + cellHandle = getCellHandle( name, token.getHandle() ); + + users = null; + userNames = null; + groups = null; + groupNames = null; + servers = null; + serverNames = null; + cachedInfo = false; + tokenExpiration = null; + } + + /** + * Constructs a new Cell object instance given + * the Token that should represents an authenticated user + * with administrative access. In order to get full access to the cell, + * it is best that the Token provided have administrative + * privileges. + * + *

This constructor is ideal for point-in-time representation and + * transient applications. It ensures all data member values are set + * and available without calling back to the filesystem at the first + * request for them. Use the {@link #refresh()} method to address any + * coherency concerns. + * + * @param token the user's authenticated token + * @param preloadAllMembers true will ensure all object members are + * set upon construction; otherwise members + * will be set upon access, which is the default + * behavior. + * @exception AFSException If an error occurs in the native code + * @see #refresh + */ + public Cell( Token token, boolean preloadAllMembers ) + throws AFSException + { + this(token); + if (preloadAllMembers) refresh(true); + } + + /** + * Refreshes the properties of this Cell object instance with values + * from the AFS cell it represents. All properties that have been + * initialized and/or accessed will be renewed according to the values + * of the AFS cell this Cell object instance represents. + * + *

Since in most environments administrative changes can be administered + * from an AFS command-line program or an alternate GUI application, this + * method provides a means to refresh the Java object representation and + * thereby ascertain any possible modifications that may have been made + * from such alternate administrative programs. Using this method before + * an associated instance accessor will ensure the highest level of + * representative accuracy, accommodating changes made external to the + * Java application space. If administrative changes to the underlying AFS + * system are only allowed via this API, then the use of this method is + * unnecessary. + * + * @exception AFSException If an error occurs in the native code + */ + public void refresh() throws AFSException + { + this.refresh(false); + } + + /** + * Refreshes the properties of this Cell object instance with values + * from the AFS cell it represents. If all is true + * then all of the properties of this Cell object instance will be + * set, or renewed, according to the values of the AFS cell it represents, + * disregarding any previously set properties. + * + *

Thus, if all is false then properties that + * are currently set will be refreshed and properties that are not set will + * remain uninitialized. See {@link #refresh()} for more information. + * + * @param all if true set or renew all object properties; otherwise + * renew all set properties + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + protected void refresh(boolean all) throws AFSException + { + if( all || (users != null) ) { + refreshUsers(); + } + if( all || (userNames != null) ) { + refreshUserNames(); + } + if( all || (groups != null) ) { + refreshGroups(); + } + if( all || (groupNames != null) ) { + refreshGroupNames(); + } + if( all || (servers != null) ) { + refreshServers(); + } + if( all || (serverNames != null) ) { + refreshServerNames(); + } + if( all || cachedInfo ) { + refreshInfo(); + } + } + + /** + * Obtains the expiration time of the token being used by this + * Cell object. Does not actually refresh the token; that is, + * once a token is obtained, its expiration time will not change. This + * method is mostly for consistency with the other methods. It is mainly + * used for getting the token information once; after that, it need not + * be called again. + * + * @exception AFSException If an error occurs in the native code + */ + private void refreshTokenExpiration() throws AFSException + { + long expTime; + + expTime = token.getExpiration(); + + tokenExpiration = new GregorianCalendar(); + long longTime = expTime*1000; + Date d = new Date( longTime ); + tokenExpiration.setTime( d ); + } + + /** + * Sets all the information fields of this Cell object, + * such as max group and user ids, to their most current values. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshInfo() throws AFSException + { + maxGroupID = getMaxGroupID( cellHandle ); + maxUserID = getMaxUserID( cellHandle ); + cachedInfo = true; + } + + /** + * Obtains the most current list of User objects of this cell. + * Finds all users that currently have a kas and/or pts entry for this cell. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshUsers() throws AFSException + { + User currUser; + users = new ArrayList(); + + // get kas entries + int iterationId = getKasUsersBegin( cellHandle ); + + currUser = new User( this ); + boolean authorized = false; + int r = 1; + while( r != 0 ) { + try { + if (authorized) { + users.add( currUser ); + currUser = new User( this ); + } + r = getKasUsersNext( cellHandle, iterationId, currUser ); + authorized = true; + } catch (AFSException e) { + System.err.println("ERROR Cell::refreshUsers():kas (User: " + + currUser.getName() + ") -> " + e.getMessage()); + authorized = false; + if (org.openafs.jafs.ErrorTable.isPermissionDenied(e.getErrorCode())) { + // Check to see if the user has failed more than 25 times, + // if so it is most likely because they are not appropriately + // authorized to list or examine users. May want to check for + // KAS admin attribute. + if ( r++ > 25 ) r = 0; + } + } + } + getKasUsersDone( iterationId ); + + //take the union with the pts entries + iterationId = getPtsUsersBegin( cellHandle ); + authorized = false; + r = 1; + while( r != 0 ) { + try { + if (authorized) { + if( !users.contains( currUser ) ) { + users.add( currUser ); + } + currUser = new User( this ); + } + r = getPtsOnlyUsersNext( cellHandle, iterationId, currUser ); + authorized = true; + } catch (AFSException e) { + System.err.println("ERROR Cell::refreshUsers():pts (User: " + + currUser.getName() + ") -> " + e.getMessage()); + authorized = false; + if (org.openafs.jafs.ErrorTable.isPermissionDenied(e.getErrorCode())) { + // Check to see if the user has failed more than 25 times, + // if so it is most likely because they are not appropriately + // authorized to list or examine users. May want to check for + // KAS admin attribute. + if ( r++ > 25 ) r = 0; + } + } + } + getPtsUsersDone( iterationId ); + + } + + /** + * Obtains the most current list of user names of this cell. Finds + * all users that currently have a kas and/or pts entry for this cell. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshUserNames() throws AFSException + { + String currName; + userNames = new ArrayList(); + + // get kas entries + int iterationId = getKasUsersBegin( cellHandle ); + while( ( currName = getKasUsersNextString( iterationId )) != null ) { + userNames.add( currName ); + } + getKasUsersDone( iterationId ); + + //take the union with the pts entries + iterationId = Cell.getPtsUsersBegin( cellHandle ); + while( ( currName = getPtsOnlyUsersNextString( iterationId, cellHandle ) ) + != null ) { + if( !userNames.contains( currName ) ) { + userNames.add( currName ); + } + } + getPtsUsersDone( iterationId ); + } + + + /** + * Obtains the most current list of Group objects of this cell. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshGroups() throws AFSException + { + Group currGroup; + + int iterationId = getGroupsBegin( cellHandle ); + + groups = new ArrayList(); + + currGroup = new Group( this ); + boolean authorized = false; + int r = 1; + while( r != 0 ) { + try { + if (authorized) { + groups.add( currGroup ); + currGroup = new Group( this ); + } + r = getGroupsNext( cellHandle, iterationId, currGroup ); + authorized = true; + } catch (AFSException e) { + System.err.println("ERROR Cell::refreshGroups() (Group: " + + currGroup.getName() + ") -> " + e.getMessage()); + authorized = false; + if (org.openafs.jafs.ErrorTable.isPermissionDenied(e.getErrorCode())) { + if ( r++ > 25 ) r = 0; + } + + } + } + Cell.getGroupsDone( iterationId ); + } + + /** + * Obtains the most current list of group names of this cell. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshGroupNames() throws AFSException + { + String currName; + + int iterationId = getGroupsBegin( cellHandle ); + + groupNames = new ArrayList(); + while( ( currName = getGroupsNextString( iterationId ) ) != null ) { + groupNames.add( currName ); + } + getGroupsDone( iterationId ); + } + + /** + * Obtains the most current list of Server objects of this cell. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshServers() throws AFSException + { + Server currServer; + + int iterationId = getServersBegin( cellHandle ); + + servers = new ArrayList(); + + currServer = new Server( this ); + boolean authorized = false; + int r = 1; + while( r != 0 ) { + try { + if (authorized) { + System.out.println("[Java] Cell::refreshServers() -> adding server: " + + currServer.getName()); + servers.add( currServer ); + currServer = new Server( this ); + } + r = getServersNext( cellHandle, iterationId, currServer ); +System.out.println("[Java] Cell::refreshServers() -> r: " + r); + authorized = true; + } catch (AFSException e) { + System.err.println("ERROR Cell::refreshServers() (Server: " + + currServer.getName() + ") -> " + e.getMessage()); + authorized = false; + if (org.openafs.jafs.ErrorTable.isPermissionDenied(e.getErrorCode())) { + if ( r++ > 25 ) r = 0; + } + } + } + getServersDone( iterationId ); + } + + /** + * Obtains the most current list of server names of this cell. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshServerNames() + throws AFSException + { + String currName; + + int iterationId = getServersBegin( cellHandle ); + + serverNames = new ArrayList(); + while( ( currName = getServersNextString( iterationId ) ) != null ) { + serverNames.add( currName ); + } + getServersDone( iterationId ); + } + + /** + * Unauthenticates this Token object associated with this + * Cell and deletes all of its stored information. This + * method should only be called when this Cell or any of the + * objects constructed using this Cell will not be used + * anymore. Note that this does not delete the actual AFS cell that this + * Cell object represents; it merely closes the + * representation. + * + * @exception AFSException If an error occurs in the native code + */ + public void close() throws AFSException + { + Cell.closeCell( cellHandle ); + token.close(); + users = null; + userNames = null; + groups = null; + groupNames = null; + servers = null; + serverNames = null; + cachedInfo = false; + tokenExpiration = null; + } + + //////////////// ACCESSORS //////////////////////// + + /** + * Retrieves the User object (which is an abstract + * representation of an actual AFS user) designated by name. + * If a user by that name does not actually exist in AFS in the cell + * represented by this object, an {@link AFSException} will be + * thrown. + * + * @exception AFSException If an error occurs in the native code + * @exception NullPointerException If name is + * null. + * @param name the name of the user to retrieve + * @return User designated by name. + */ + public User getUser(String name) throws AFSException + { + if (name == null) throw new NullPointerException(); + User user = new User(name, this); + return user; + } + + /** + * Returns the total number of users who are registered with KAS and PTS, + * without duplicates. If a user has a KAS entry and not a PTS entry, + * it will still be counted. Conversely, if a user has a PTS entry and + * not KAS, it too will be counted. Effectively it is a non-duplicate + * union of KAS and PTS user entries. + * + *

If the total list of users or user names have already been + * collected (see {@link #getUsers()}), then the returning value will be + * calculated based upon the current list. Otherwise, KAS and PTS will be + * explicitly queried for the information. + * + * @exception AFSException If an error occurs in the native code + * @return a User array of the users of the cell. + * @see #getUsers() + * @see #getUserNames() + */ + public int getUserCount() throws AFSException + { + if( users != null ) { + return users.size(); + } else if( userNames != null ) { + return userNames.size(); + } else { + int k = getKasUserCount(cellHandle); + int p = getPtsOnlyUserCount(cellHandle); + return k + p; + } + } + + /** + * Retrieves an array containing all of the User objects + * associated with this Cell, each of which are an abstract + * representation of an actual user of the AFS cell. After this method + * is called once, it saves the array of Users and returns + * that saved array on subsequent calls, until the {@link #refresh()} method + * is called and a more current list is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return a User array of the users of the cell. + */ + public User[] getUsers() throws AFSException + { + if( users == null ) refreshUsers(); + return (User[]) users.toArray( new User[users.size()] ); + } + + /** + * Returns an array containing a subset of the User objects + * associated with this Cell, each of which is an abstract + * representation of an actual AFS user of the AFS cell. The subset + * is a point-in-time list of users (User objects + * representing AFS users) starting at the complete array's index of + * startIndex and containing up to length + * elements. + * + * If length is larger than the number of remaining elements, + * respective to startIndex, then this method will + * ignore the remaining positions requested by length and + * return an array that contains the remaining number of elements found in + * this cell's complete array of users. + * + *

This method is especially useful when managing iterations of very + * large lists. {@link #getUserCount()} can be used to determine if + * iteration management is practical. + * + *

This method does not save the resulting data and therefore + * queries AFS for each call. + * + *

Note: PTS-only users are collected before KAS users + * and therefore will always, if PTS-only users exist, be within the + * lowest range of this cell's complete list of users. PTS and KAS + * users are joined in a non-duplicating union and are consequently + * treated as a single list of users, thus startIndex + * does not necessarily indicate the first KAS user. + * + *

Example: If there are more than 50,000 users within this cell + * then only render them in increments of 10,000. + *

+   * ...
+   *   User[] users;
+   *   if (cell.getUserCount() > 50000) {
+   *     int index = 0;
+   *     int length = 10000;
+   *     while (index < cell.getUserCount()) {
+   *       users = cell.getUsers(index, length);
+   *       for (int i = 0; i < users.length; i++) {
+   *         ...
+   *       }
+   *       index += length;
+   *       ...
+   *     }
+   *   } else {
+   *     users = cell.getUsers();
+   *     for (int i = 0; i < users.length; i++) {
+   *       ...
+   *     }
+   *   }
+   * ...
+   * 
+ * + * @param startIndex the base zero index position at which the subset array + * should start from, relative to the complete list of + * elements present in AFS. + * @param length the number of elements that the subset should contain + * @return a subset array of users in this cell + * @exception AFSException If an error occurs in the native code + * @see #getUserCount() + * @see #getUserNames(int, int) + * @see #getUsers() + */ + public User[] getUsers(int startIndex, int length) throws AFSException + { + User[] users = new User[length]; + User currUser = new User( this ); + int ptsOnlyCount = getPtsOnlyUserCount(cellHandle); + int iterationID = 0; + int indexPTS = 0; + int indexKAS = 0; + + if (startIndex < ptsOnlyCount) { + int i = 0; + iterationID = getPtsUsersBegin(cellHandle); + while( getPtsOnlyUsersNext( cellHandle, iterationID, currUser ) != 0 && + indexPTS < length ) + { + if (i >= startIndex) { + users[indexPTS] = currUser; + currUser = new User( this ); + indexPTS++; + } + } + getPtsUsersDone( iterationID ); + + if (indexPTS < length) { + startIndex = 0; + length -= indexPTS; + } else { + return users; + } + } else { + startIndex -= (ptsOnlyCount - 1); + } + + iterationID = getKasUsersBeginAt( cellHandle, startIndex ); + while( getKasUsersNext(cellHandle, iterationID, currUser ) != 0 && + indexKAS < length ) + { + users[indexKAS] = currUser; + currUser = new User( this ); + indexKAS++; + } + getKasUsersDone( iterationID ); + + if (indexKAS < length) { + User[] u = new User[indexKAS + indexPTS]; + System.arraycopy(users, 0, u, 0, u.length); + return u; + } else { + return users; + } + } + + /** + * Retrieves an array containing all of the names of users + * associated with this Cell. After this method + * is called once, it saves the array of Strings and returns + * that saved array on subsequent calls, until the {@link #refresh()} method + * is called and a more current list is obtained. + * + *

This method is especially useful when managing iterations of + * large lists. {@link #getUserCount()} can be used to determine if + * iteration management is practical. In comparison to {@link #getUsers()}, + * this method has yielded an average performance advantage of approximately + * 82% at 10K users; this statistic, however, strictly compares the response + * time of each method and understands that the {@link #getUsers()} method + * will return an array of populated User objects, whereas this + * method will return an array of String names. + *

+ * + * @return an String array of the user names of the cell. + * @exception AFSException If an error occurs in the native code + */ + public String[] getUserNames() throws AFSException + { + if( userNames == null ) refreshUserNames(); + return (String[]) userNames.toArray( new String[userNames.size()] ); + } + + /** + * Returns an array containing a subset of the names of users + * associated with this Cell. The subset + * is a point-in-time list of users (String names + * of AFS users) starting at the complete array's index of + * startIndex and containing up to length + * elements. + * + * If length is larger than the number of remaining elements, + * respective to startIndex, then this method will + * ignore the remaining positions requested by length and + * return an array that contains the remaining number of elements found in + * this cell's complete array of users. + * + *

This method is especially useful when managing iterations of very + * large lists. {@link #getUserCount()} can be used to determine if + * iteration management is practical. + * + *

This method does not save the resulting data and therefore + * queries AFS for each call. + * + *

Note: PTS-only users are collected before KAS users + * and therefore will always, if PTS-only users exist, be within the + * lowest range of this cell's complete list of users. PTS and KAS + * users are joined in a non-duplicating union and are consequently + * treated as a single list of users, thus startIndex + * does not necessarily indicate the first KAS user. + * + *

Example: If there are more than 50,000 users within this cell + * then only render them in increments of 10,000. + *

+   * ...
+   *   String[] users;
+   *   if (cell.getUserCount() > 50000) {
+   *     int index = 0;
+   *     int length = 10000;
+   *     while (index < cell.getUserCount()) {
+   *       users = cell.getUserNames(index, length);
+   *       for (int i = 0; i < users.length; i++) {
+   *         ...
+   *       }
+   *       index += length;
+   *       ...
+   *     }
+   *   } else {
+   *     users = cell.getUserNames();
+   *     for (int i = 0; i < users.length; i++) {
+   *       ...
+   *     }
+   *   }
+   * ...
+   * 
+ * + * @param startIndex the base zero index position at which the subset array + * should start from, relative to the complete list of + * elements present in AFS. + * @param length the number of elements that the subset should contain + * @return a subset array of user names in this cell + * @exception AFSException If an error occurs in the native code + * @see #getUserCount() + * @see #getUserNames() + * @see #getUsers(int, int) + */ + public String[] getUserNames(int startIndex, int length) + throws AFSException + { + String[] users = new String[length]; + String currUser; + int ptsOnlyCount = getPtsOnlyUserCount(cellHandle); + int iterationID = 0; + int indexPTS = 0; + int indexKAS = 0; + + if (startIndex < ptsOnlyCount) { + int i = 0; + iterationID = getPtsUsersBegin(cellHandle); + while( (currUser = getPtsOnlyUsersNextString( iterationID, cellHandle )) + != null && indexPTS < length ) { + if (i >= startIndex) { + users[indexPTS] = currUser; + indexPTS++; + } + } + getPtsUsersDone( iterationID ); + + if (indexPTS < length) { + startIndex = 0; + length -= indexPTS; + } else { + return users; + } + } else { + startIndex -= (ptsOnlyCount - 1); + } + + iterationID = getKasUsersBeginAt( cellHandle, startIndex ); + while( (currUser = getKasUsersNextString( iterationID )) != null && + indexKAS < length ) { + users[indexKAS] = currUser; + indexKAS++; + } + getKasUsersDone( iterationID ); + + if (indexKAS < length) { + String[] u = new String[indexKAS + indexPTS]; + System.arraycopy(users, 0, u, 0, u.length); + return u; + } else { + return users; + } + } + + /** + * Retrieves the Group object (which is an abstract + * representation of an actual AFS group) designated by name. + * If a group by that name does not actually exist in AFS in the cell + * represented by this object, an {@link AFSException} will be + * thrown. + * + * @exception AFSException If an error occurs in the native code + * @exception NullPointerException If name is + * null. + * @param name the name of the group to retrieve + * @return Group designated by name. + */ + public Group getGroup(String name) throws AFSException + { + if (name == null) throw new NullPointerException(); + Group group = new Group(name, this); + group.refresh(true); + return group; + } + + /** + * Returns the total number of groups associated with this Cell. + * + *

If the total list of groups or group names have already been + * collected (see {@link #getGroups()}), then the returning value will be + * calculated based upon the current list. Otherwise, PTS will be + * explicitly queried for the information. + * + * @exception AFSException If an error occurs in the native code + * @return a User array of the users of the cell. + * @see #getGroups() + * @see #getGroupNames() + */ + public int getGroupCount() throws AFSException + { + if( groups != null ) { + return groups.size(); + } else if( groupNames != null ) { + return groupNames.size(); + } else { + return getGroupCount(cellHandle); + } + } + + /** + * Retrieves an array containing all of the Group objects + * associated with this Cell, each of which are an abstract + * representation of an actual group of the AFS cell. After this method + * is called once, it saves the array of Groups and returns + * that saved array on subsequent calls, until the {@link #refresh()} method + * is called and a more current list is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return a Group array of the groups of the cell. + */ + public Group[] getGroups() throws AFSException + { + if( groups == null ) refreshGroups(); + return (Group[]) groups.toArray( new Group[groups.size()] ); + } + + /** + * Returns an array containing a subset of the Group objects + * associated with this Cell, each of which is an abstract + * representation of an actual AFS group of the AFS cell. The subset + * is a point-in-time list of groups (Group objects + * representing AFS groups) starting at the complete array's index of + * startIndex and containing up to length + * elements. + * + * If length is larger than the number of remaining elements, + * respective to startIndex, then this method will + * ignore the remaining positions requested by length and + * return an array that contains the remaining number of elements found in + * this cell's complete array of groups. + * + *

This method is especially useful when managing iterations of very + * large lists. {@link #getGroupCount()} can be used to determine if + * iteration management is practical. + * + *

This method does not save the resulting data and therefore + * queries AFS for each call. + * + *

Example: If there are more than 50,000 groups within this cell + * then only render them in increments of 10,000. + *

+   * ...
+   *   Group[] groups;
+   *   if (cell.getGroupCount() > 50000) {
+   *     int index = 0;
+   *     int length = 10000;
+   *     while (index < cell.getGroupCount()) {
+   *       groups = cell.getGroups(index, length);
+   *       for (int i = 0; i < groups.length; i++) {
+   *         ...
+   *       }
+   *       index += length;
+   *       ...
+   *     }
+   *   } else {
+   *     groups = cell.getGroups();
+   *     for (int i = 0; i < groups.length; i++) {
+   *       ...
+   *     }
+   *   }
+   * ...
+   * 
+ * + * @param startIndex the base zero index position at which the subset array + * should start from, relative to the complete list of + * elements present in AFS. + * @param length the number of elements that the subset should contain + * @return a subset array of groups in this cell + * @exception AFSException If an error occurs in the native code + * @see #getGroupCount() + * @see #getGroupNames(int, int) + * @see #getGroups() + */ + public Group[] getGroups(int startIndex, int length) throws AFSException + { + Group[] groups = new Group[length]; + Group currGroup = new Group( this ); + int i = 0; + + int iterationID = getGroupsBeginAt( cellHandle, startIndex ); + + while( getGroupsNext( cellHandle, iterationID, currGroup ) != 0 + && i < length ) { + groups[i] = currGroup; + currGroup = new Group( this ); + i++; + } + getGroupsDone( iterationID ); + if (i < length) { + Group[] v = new Group[i]; + System.arraycopy(groups, 0, v, 0, i); + return v; + } else { + return groups; + } + } + + /** + * Retrieves an array containing all of the names of groups + * associated with this Cell. After this method + * is called once, it saves the array of Strings and returns + * that saved array on subsequent calls, until the {@link #refresh()} method + * is called and a more current list is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return a String array of the group names of the cell. + */ + public String[] getGroupNames() throws AFSException + { + if( groupNames == null ) refreshGroupNames(); + return (String[]) groupNames.toArray( new String[groupNames.size()] ); + } + + /** + * Returns an array containing a subset of the names of groups + * associated with this Cell. The subset + * is a point-in-time list of groups (String names + * of AFS groups) starting at the complete array's index of + * startIndex and containing up to length + * elements. + * + * If length is larger than the number of remaining elements, + * respective to startIndex, then this method will + * ignore the remaining positions requested by length and + * return an array that contains the remaining number of elements found in + * this cell's complete array of groups. + * + *

This method is especially useful when managing iterations of very + * large lists. {@link #getGroupCount()} can be used to determine if + * iteration management is practical. + * + *

This method does not save the resulting data and therefore + * queries AFS for each call. + * + *

Example: If there are more than 50,000 groups within this cell + * then only render them in increments of 10,000. + *

+   * ...
+   *   String[] groups;
+   *   if (cell.getGroupCount() > 50000) {
+   *     int index = 0;
+   *     int length = 10000;
+   *     while (index < cell.getGroupCount()) {
+   *       groups = cell.getGroupNames(index, length);
+   *       for (int i = 0; i < groups.length; i++) {
+   *         ...
+   *       }
+   *       index += length;
+   *       ...
+   *     }
+   *   } else {
+   *     groups = cell.getGroupNames();
+   *     for (int i = 0; i < groups.length; i++) {
+   *       ...
+   *     }
+   *   }
+   * ...
+   * 
+ * + * @param startIndex the base zero index position at which the subset array + * should start from, relative to the complete list of + * elements present in AFS. + * @param length the number of elements that the subset should contain + * @return a subset array of group names in this cell + * @exception AFSException If an error occurs in the native code + * @see #getGroupCount() + * @see #getGroups(int, int) + * @see #getGroupNames() + */ + public String[] getGroupNames(int startIndex, int length) + throws AFSException + { + String[] groups = new String[length]; + String currGroup; + int i = 0; + + int iterationID = getGroupsBeginAt( cellHandle, startIndex ); + + while( (currGroup = getGroupsNextString( iterationID )) != null && + i < length ) + { + groups[i] = currGroup; + i++; + } + getGroupsDone( iterationID ); + if (i < length) { + String[] v = new String[i]; + System.arraycopy(groups, 0, v, 0, i); + return v; + } else { + return groups; + } + } + + /** + * Retrieves the Server object (which is an abstract + * representation of an actual AFS server) designated by name. + * If a group by that name does not actually exist in AFS in the cell + * represented by this object, an {@link AFSException} will be + * thrown. + * + * @exception AFSException If an error occurs in the native code + * @exception NullPointerException If name is + * null. + * @param name the name of the server to retrieve + * @return Server designated by name. + */ + public Server getServer(String name) + throws AFSException + { + if (name == null) throw new NullPointerException(); + Server server = new Server(name, this); + server.refresh(true); + return server; + } + + /** + * Returns the total number of servers associated with this Cell. + * + *

If the total list of servers or server names have already been + * collected (see {@link #getServers()}), then the returning value will be + * calculated based upon the current list. Otherwise, AFS will be + * explicitly queried for the information. + * + * @exception AFSException If an error occurs in the native code + * @return a User array of the users of the cell. + * @see #getServers() + * @see #getServerNames() + */ + public int getServerCount() throws AFSException + { + if( servers != null ) { + return servers.size(); + } else if( serverNames != null ) { + return serverNames.size(); + } else { + return getServerCount(cellHandle); + } + } + + /** + * Retrieves an array containing all of the Server objects + * associated with this Cell, each of which are an abstract + * representation of an actual server of the AFS cell. After this method + * is called once, it saves the array of Servers and returns + * that saved array on subsequent calls, until the {@link #refresh()} method + * is called and a more current list is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return an Server array of the servers of the cell. + */ + public Server[] getServers() throws AFSException + { + if ( servers == null ) refreshServers(); + return (Server[]) servers.toArray( new Server[servers.size()] ); + } + + /** + * Retrieves an array containing all of the names of servers + * associated with this Cell. After this method + * is called once, it saves the array of Strings and returns + * that saved array on subsequent calls, until the {@link #refresh()} method + * is called and a more current list is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return a String array of the servers of the cell. + */ + public String[] getServerNames() throws AFSException + { + if ( serverNames == null ) refreshServerNames(); + return (String[]) serverNames.toArray( new String[serverNames.size()] ); + } + + /** + * Returns the maximum group ID that's been used within the cell. + * The next auto-assigned group ID will be one less (more negative) + * than this amount. After this method is called once, it saves the + * max group id and returns that id on subsequent calls, until the + * {@link #refresh()} method is called and a more current id is obtained. + * + * @return an integer representing the maximum group ID + * @exception AFSException If an error occurs in the native code + */ + public int getMaxGroupID() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return maxGroupID; + + } + + /** + * Returns the maximum user ID that's been used within the cell. + * The next auto-assigned user ID will be one greater (more positive) + * than this amount. After this method is called once, it saves the + * max user id and returns that id on subsequent calls, until the + * {@link #refresh()} method is called and a more current id is obtained. + * + * @return an integer representing the maximum user ID + * @exception AFSException If an error occurs in the native code + */ + public int getMaxUserID() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return maxUserID; + } + + /** + * Returns the expiration time of the authentication token being used + * by this Cell object. After this time, this + * Cell object will no longer be authorized to perform + * actions requiring administrative authority. + * + * @return expiration time of the token + * @exception AFSException If an error occurs in the native code + */ + public GregorianCalendar getTokenExpiration() throws AFSException + { + if( tokenExpiration == null ) refreshTokenExpiration(); + return tokenExpiration; + } + + /** + * Returns the cell handle of this cell. + * + * @return the cell handle + * @exception AFSException If an error occurs in the native code + */ + public int getCellHandle() throws AFSException + { + return cellHandle; + } + + /** + * Returns the name of this cell. + * + * @return the cell name + */ + public String getName() + { + return name; + } + + /** + * Sets the maximum group ID that's been used within the cell. The next + * auto-assigned group ID will be one less (more negative) than this amount. + * + * @param maxID an integer representing the maximum group ID + * @exception AFSException If an error occurs in the native code + */ + public void setMaxGroupID( int maxID ) throws AFSException + { + setMaxGroupID( cellHandle, maxID ); + maxGroupID = maxID; + } + + /** + * Sets the maximum user ID that's been used within the cell. The next + * auto-assigned user ID will be one greater (more positive) than this + * amount. + * + * @param maxID an integer representing the maximum user ID + * @exception AFSException If an error occurs in the native code + */ + public void setMaxUserID( int maxID ) throws AFSException + { + setMaxUserID( cellHandle, maxID ); + maxUserID = maxID; + } + + /////////////// information methods //////////////////// + + /** + * Returns a String representation of this Cell. + * Contains the cell name followed by the names of its users and groups. + * + * @return a String representation of this Cell + */ + protected String getInfo() + { + String r = "Cell: " + name + "\n\n"; + try { + r += "\tMax group ID: " + getMaxGroupID() + "\n"; + r += "\tMax user ID: " + getMaxUserID() + "\n"; + r += "\tToken expiration: " + getTokenExpiration().getTime() + "\n"; + } catch( AFSException e ) { + return e.toString(); + } + + String[] servs; + String[] usrs; + String[] grps; + try { + usrs = getUserNames(); + grps = getGroupNames(); + servs = getServerNames(); + + } catch( Exception e ) { + return e.toString(); + } + + r += "--Users--\n"; + + for( int i = 0; i < usrs.length; i++ ) { + + r += usrs[i] + "\n"; + } + + r += "\n--Groups--\n"; + + for( int i = 0; i < grps.length; i++ ) { + + r += grps[i] + "\n"; + } + + r += "\n--Servers--\n"; + + for( int i = 0; i < servs.length; i++ ) { + + r += servs[i] + "\n"; + } + + return r; + } + + /** + * Returns a String containing the String + * representations of all the users of this Cell. + * + * @return a String representation of the users + * @see User#getInfo + */ + protected String getInfoUsers() throws AFSException + { + String r; + + r = "Cell: " + name + "\n\n"; + r += "--Users--\n"; + + User usrs[] = getUsers(); + for( int i = 0; i < usrs.length; i++ ) { + r += usrs[i].getInfo() + "\n"; + } + + return r; + } + + /** + * Returns a String containing the String + * representations of all the groups of this Cell. + * + * @return a String representation of the groups + * @see Group#getInfo + */ + protected String getInfoGroups() throws AFSException + { + String r; + + r = "Cell: " + name + "\n\n"; + r += "--Groups--\n"; + + Group grps[] = getGroups(); + for( int i = 0; i < grps.length; i++ ) { + r += grps[i].getInfo() + "\n"; + } + return r; + } + + /** + * Returns a String containing the String + * representations of all the servers of this Cell. + * + * @return a String representation of the servers + * @see Server#getInfo + */ + protected String getInfoServers() + throws AFSException + { + String r; + r = "Cell: " + name + "\n\n"; + r += "--Servers--\n"; + Server[] servs = getServers(); + for( int i = 0; i < servs.length; i++ ) { + r += servs[i].getInfo() + "\n"; + } + return r; + } + + /////////////// override methods //////////////////// + + /** + * Tests whether two Cell objects are equal, based on their + * names. Does not test whether the objects are actually the same + * representational instance of the AFS cell. + * + * @param otherCell the Cell to test + * @return whether the specifed user is the same as this user + */ + public boolean equals( Cell otherCell ) + { + return name.equals( otherCell.getName() ); + } + + /** + * Returns the name of this Cell + * + * @return the name of this Cell + */ + public String toString() + { + return name; + } + + /////////////// native methods Cell //////////////////// + + /** + * Returns the total number of KAS users belonging to the cell denoted + * by cellHandle. + * + * @param cellHandle the handle of the cell to which the users belong + * @return total count of KAS users + * @exception AFSException If an error occurs in the native code + * @see Cell#getCellHandle + */ + protected static native int getKasUserCount( int cellHandle ) + throws AFSException; + + /** + * Begin the process of getting the kas users that belong to the cell. + * Returns an iteration ID to be used by subsequent calls to + * getKasUsersNextString (or getKasUsersNext) + * and getKasUsersDone. + * + * @param cellHandle the handle of the cell to which the users belong + * @see Cell#getCellHandle + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + */ + protected static native int getKasUsersBegin( int cellHandle ) + throws AFSException; + + /** + * Begin the process of getting the KAS users, starting at + * startIndex, that belong to the cell. + * Returns an iteration ID to be used by subsequent calls to + * getKasUsersNextString (or getKasUsersNext) + * and getKasUsersDone. + * + * @param cellHandle the handle of the cell to which the users belong + * @param startIndex the starting base-zero index + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + * @see Cell#getCellHandle + */ + protected static native int getKasUsersBeginAt( int cellHandle, + int startIndex ) + throws AFSException; + + /** + * Returns the next kas user of the cell. Returns null if there + * are no more users. Appends instance names to principal names as follows: + * principal.instance + * + * @param iterationId the iteration ID of this iteration + * @see Cell#getKasUsersBegin + * @return the name of the next user of the cell + * @exception AFSException If an error occurs in the native code + */ + protected static native String getKasUsersNextString( int iterationId ) + throws AFSException; + + /** + * Fills the next kas user object of the cell. Returns 0 if there + * are no more users, != 0 otherwise. + * + * @param cellHandle the handle of the cell to which the users belong + * @see Cell#getCellHandle + * @param iterationId the iteration ID of this iteration + * @see Cell#getKasUsersBegin + * @param theUser a User object to be populated with the values of + * the next kas user + * @return 0 if there are no more users, != 0 otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getKasUsersNext( int cellHandle, + int iterationId, + User theUser ) + throws AFSException; + + /** + * Signals that the iteration is complete and will not be accessed anymore. + * + * @param iterationId the iteration ID of this iteration + * @see Cell#getKasUsersBegin + * @exception AFSException If an error occurs in the native code + */ + protected static native void getKasUsersDone( int iterationId ) + throws AFSException; + + /** + * Returns the total number of PTS users belonging to the cell denoted + * by cellHandle. + * + * @param cellHandle the handle of the cell to which the users belong + * @return total number of PTS users + * @exception AFSException If an error occurs in the native code + * @see Cell#getCellHandle + */ + protected static native int getPtsUserCount( int cellHandle ) + throws AFSException; + + /** + * Returns the total number of PTS users, belonging to the cell denoted + * by cellHandle, that are not in KAS. + * + * @param cellHandle the handle of the cell to which the users belong + * @return total number of users that are in PTS and not KAS + * @exception AFSException If an error occurs in the native code + * @see Cell#getCellHandle + */ + protected static native int getPtsOnlyUserCount( int cellHandle ) + throws AFSException; + + /** + * Begin the process of getting the pts users that belong to the cell. + * Returns an iteration ID to be used by subsequent calls to + * getPtsUsersNextString (or getPtsUsersNext) + * and getPtsUsersDone. + * + * @param cellHandle the handle of the cell to which the users belong + * @see Cell#getCellHandle + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + */ + protected static native int getPtsUsersBegin( int cellHandle ) + throws AFSException; + + /** + * Returns the next pts user of the cell. Returns null if + * there are no more users. + * + * @param iterationId the iteration ID of this iteration + * @see Cell#getPtsUsersBegin + * @return the name of the next user of the cell + * @exception AFSException If an error occurs in the native code + */ + protected static native String getPtsUsersNextString( int iterationId ) + throws AFSException; + + /** + * Returns the next pts user (who is not a kas user) of the cell. + * Returns null if there are no more users. + * + * @param iterationId the iteration ID of this iteration + * @param cellHandle the cell handle to which these users will belong + * @see Cell#getPtsUsersBegin + * @return the name of the next pts user (not kas user) of the cell + * @exception AFSException If an error occurs in the native code + */ + protected static native String getPtsOnlyUsersNextString( int iterationId, + int cellHandle ) + throws AFSException; + + /** + * Fills the next pts user object of the cell. Returns 0 if there + * are no more users, != 0 otherwise. + * + * @param cellHandle the handle of the cell to which the users belong + * @see Cell#getCellHandle + * @param iterationId the iteration ID of this iteration + * @see Cell#getPtsUsersBegin + * @param theUser a User object to be populated with the values of + * the next pts user + * @return 0 if there are no more users, != 0 otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getPtsUsersNext( int cellHandle, int iterationId, + User theUser ) + throws AFSException; + + /** + * Fills the next pts user (who does not have a kas entry) object of + * the cell. Returns 0 if there are no more users, != 0 otherwise. + * + * @param cellHandle the handle of the cell to which the users belong + * @see Cell#getCellHandle + * @param iterationId the iteration ID of this iteration + * @see Cell#getPtsUsersBegin + * @param theUser a User object to be populated with the values of + * the next pts (with no kas) user + * @return 0 if there are no more users, != 0 otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getPtsOnlyUsersNext( int cellHandle, + int iterationId, + User theUser ) + throws AFSException; + + /** + * Signals that the iteration is complete and will not be accessed anymore. + * + * @param iterationId the iteration ID of this iteration + * @see Cell#getPtsUsersBegin + * @exception AFSException If an error occurs in the native code + */ + protected static native void getPtsUsersDone( int iterationId ) + throws AFSException; + + /** + * Returns the total number of groups belonging to the cell denoted + * by cellHandle. + * + * @param cellHandle the handle of the cell to which the groups belong + * @return total number of groups + * @exception AFSException If an error occurs in the native code + * @see Cell#getCellHandle + */ + protected static native int getGroupCount( int cellHandle ) + throws AFSException; + + /** + * Begin the process of getting the groups that belong to the cell. Returns + * an iteration ID to be used by subsequent calls to + * getGroupsNextString (or getGroupsNext) and + * getGroupsDone. + * + * @param cellHandle the handle of the cell to which the groups belong + * @see Cell#getCellHandle + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + */ + protected static native int getGroupsBegin( int cellHandle ) + throws AFSException; + + /** + * Begin the process of getting the groups that belong to the cell, starting + * with element index startIndex. Returns an iteration ID to + * be used by subsequent calls to getGroupsNextString + * (or getGroupsNext) and getGroupsDone. + * + * @param cellHandle the handle of the cell to which the groups belong + * @param startIndex the starting base-zero index + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + * @see Cell#getCellHandle + */ + protected static native int getGroupsBeginAt( int cellHandle, + int startIndex ) + throws AFSException; + + /** + * Returns the next group of the cell. Returns null if there + * are no more groups. + * + * @param iterationId the iteration ID of this iteration + * @see Cell#getGroupsBegin + * @return the name of the next user of the cell + * @exception AFSException If an error occurs in the native code + */ + protected static native String getGroupsNextString( int iterationId ) + throws AFSException; + + /** + * Fills the next group object of the cell. Returns 0 if there + * are no more groups, != 0 otherwise. + * + * @param cellHandle the handle of the cell to which the users belong + * @see Cell#getCellHandle + * @param iterationId the iteration ID of this iteration + * @see Cell#getGroupsBegin + * @param theGroup a Group object to be populated with the values of + * the next group + * @return 0 if there are no more users, != 0 otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getGroupsNext( int cellHandle, int iterationId, + Group theGroup ) + throws AFSException; + + /** + * Signals that the iteration is complete and will not be accessed anymore. + * + * @param iterationId the iteration ID of this iteration + * @see Cell#getGroupsBegin + * @exception AFSException If an error occurs in the native code + */ + protected static native void getGroupsDone( int iterationId ) + throws AFSException; + + /** + * Returns the total number of servers belonging to the cell denoted + * by cellHandle. + * + * @param cellHandle the handle of the cell to which the servers belong + * @return total number of servers + * @exception AFSException If an error occurs in the native code + * @see Cell#getCellHandle + */ + protected static native int getServerCount( int cellHandle ) + throws AFSException; + + /** + * Begin the process of getting the servers in the cell. Returns + * an iteration ID to be used by subsequent calls to + * getServersNextString and getServersDone. + * + * @param cellHandle the handle of the cell to which the servers belong + * @see Cell#getCellHandle + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + */ + protected static native int getServersBegin( int cellHandle ) + throws AFSException; + + /** + * Returns the next server of the cell. Returns null if there + * are no more servers. + * + * @param iterationId the iteration ID of this iteration + * @see Cell#getServersBegin + * @return the name of the next server of the cell + * @exception AFSException If an error occurs in the native code + */ + protected static native String getServersNextString( int iterationId ) + throws AFSException; + + /** + * Fills the next server object of the cell. Returns 0 if there are no + * more servers, != 0 otherwise. + * + * @param cellHandle the handle of the cell to which the users belong + * @see Cell#getCellHandle + * @param iterationId the iteration ID of this iteration + * @param theServer a Server object to be populated with the values + * of the next server + * @see Cell#getServersBegin + * @return 0 if there are no more servers, != 0 otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getServersNext( int cellHandle, int iterationId, + Server theServer ) + throws AFSException; + + /** + * Signals that the iteration is complete and will not be accessed anymore. + * + * @param iterationId the iteration ID of this iteration + * @see Cell#getServersBegin + * @exception AFSException If an error occurs in the native code + */ + protected static native void getServersDone( int iterationId ) + throws AFSException; + + /** + * Returns the name of the cell. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @return the name of the cell + * @exception AFSException If an error occurs in the native code + */ + protected static native String getCellName( int cellHandle ) + throws AFSException; + + /** + * Creates a mount point for a volume within the file system. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @param directory the full path of the place in the AFS file system + * at which to mount the volume + * @param volumeName the name of the volume to mount + * @param readWrite whether or not this is to be a readwrite mount point + * @param forceCheck whether or not to check if this volume name exists + * @exception AFSException If an error occurs in the native code + */ + protected static native void createMountPoint( int cellHandle, + String directory, + String volumeName, + boolean readWrite, + boolean forceCheck ) + throws AFSException; + + /* + * Sets an ACL for a given place in the AFS file system. + * + * @param directory the full path of the place in the AFS file system + * for which to add an entry + * @param username the name of the user or group for which to add an entry + * @param read whether or not to allow read access to this user + * @param write whether or not to allow write access to this user + * @param lookup whether or not to allow lookup access to this user + * @param delete whether or not to allow deletion access to this user + * @param insert whether or not to allow insertion access to this user + * @param lock whether or not to allow lock access to this user + * @param admin whether or not to allow admin access to this user + * @exception AFSException If an error occurs in the native code + */ + public static native void setACL( String directory, String username, + boolean read, boolean write, + boolean lookup, boolean delete, + boolean insert, boolean lock, + boolean admin ) + throws AFSException; + + /** + * Gets the maximum group pts ID that's been used within a cell. + * The next auto-assigned group ID will be one less (more negative) + * than this value. + * + * @param cellHandle the handle of the cell to which the group belongs + * @see Cell#getCellHandle + * @return an integer reresenting the max group id in a cell + * @exception AFSException If an error occurs in the native code + */ + protected static native int getMaxGroupID( int cellHandle ) + throws AFSException; + + /** + * Sets the maximum group pts ID that's been used within a cell. The next + * auto-assigned group ID will be one less (more negative) than this value. + * + * @param cellHandle the handle of the cell to which the group belongs + * @see Cell#getCellHandle + * @param maxID an integer reresenting the new max group id in a cell + * @exception AFSException If an error occurs in the native code + */ + protected static native void setMaxGroupID( int cellHandle, int maxID ) + throws AFSException; + + /** + * Gets the maximum user pts ID that's been used within a cell. + * The next auto-assigned user ID will be one greater (more positive) + * than this value. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @return an integer reresenting the max user id in a cell + * @exception AFSException If an error occurs in the native code + */ + protected static native int getMaxUserID( int cellHandle ) + throws AFSException; + + /** + * Sets the maximum user pts ID that's been used within a cell. The next + * auto-assigned user ID will be one greater (more positive) than this value. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @param maxID an integer reresenting the new max user id in a cell + * @exception AFSException If an error occurs in the native code + */ + protected static native void setMaxUserID( int cellHandle, int maxID ) + throws AFSException; + + /** + * Reclaims all memory being saved by the cell portion of the native library. + * This method should be called when no more Cell objects + * are expected to be used. + */ + protected static native void reclaimCellMemory(); + + + /////////////// native methods jafs_Cell //////////////////// + + /** + * Opens a cell for administrative use, based on the token provided. + * Returns a cell handle to be used by other methods as a means of + * authentication. + * + * @param cellName the name of the cell for which to get the handle + * @param tokenHandle a token handle previously returned by a call to + * {@link Token#getHandle} + * @return a handle to the open cell + * @exception AFSException If an error occurs in the native code + * @see Token#getHandle + */ + protected static native int getCellHandle( String cellName, int tokenHandle ) + throws AFSException; + + /** + * Closes the given currently open cell handle. + * + * @param cellHandle the cell handle to close + * @exception AFSException If an error occurs in the native code + */ + protected static native void closeCell( int cellHandle ) + throws AFSException; +} diff --git a/src/JAVA/classes/org/openafs/jafs/ErrorTable.java b/src/JAVA/classes/org/openafs/jafs/ErrorTable.java new file mode 100644 index 000000000..431f51a98 --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/ErrorTable.java @@ -0,0 +1,203 @@ +/* + * @(#)ErrorTable.java 2.0 11/06/2000 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.util.ResourceBundle; +import java.util.Locale; + +/** + * Static class for error code message management. + * + *

Simply translates all error codes returned by the AFS native library + * to literal string messages according to the defined locale. + * + * @version 2.0, 11/06/2000 + */ +public final class ErrorTable +{ + /* Undefined Error Constants */ + public static final int UNKNOWN = -3; + public static final int SPECIAL_CASE = -2; + public static final int GENERAL_FAILURE = -1; + + /* Java Application Error Constants */ + public static final int NULL = 1000; + public static final int INVALID_SESSION = 1001; + public static final int EXPIRED_SESSION = 1002; + public static final int OPERATION_ABORTED = 1003; + public static final int FORCED_ABORT = 1004; + + /* General UNIX Error Constants */ + public static final int NOT_PERMITTED = 1; + public static final int NOT_FOUND = 2; + public static final int IO_ERROR = 5; + public static final int NO_DEVICE_ADDRESS = 6; + public static final int BAD_FILE = 9; + public static final int TRY_AGAIN = 11; + public static final int OUT_OF_MEMORY = 12; + public static final int PERMISSION_DENIED = 13; + public static final int BAD_ADDRESS = 14; + public static final int DEVICE_BUSY = 16; + public static final int FILE_EXISTS = 17; + public static final int NO_DEVICE = 19; + public static final int NOT_DIRECTORY = 20; + public static final int IS_DIRECTORY = 21; + public static final int INVALID_ARG = 22; + public static final int FILE_OVERFLOW = 23; + public static final int FILE_BUSY = 26; + public static final int NAME_TOO_LONG = 36; + public static final int DIRECTORY_NOT_EMPTY = 39; + public static final int CONNECTION_TIMED_OUT = 110; + public static final int QUOTA_EXCEEDED = 122; + + /* AFS Error Constants */ + public static final int BAD_USERNAME = 180486; + public static final int BAD_PASSWORD = 180490; + public static final int EXPIRED_PASSWORD = 180519; + public static final int SKEWED_CLOCK = 180514; + public static final int ID_LOCKED = 180522; + public static final int CELL_NOT_FOUND = 180501; + public static final int USERNAME_EXISTS = 180481; + public static final int USER_DOES_NOT_EXIST = 180484; + + /* AFS Authentication Error Constants */ + public static final int PRPERM = 267269; + public static final int UNOACCESS = 5407; + public static final int BZACCESS = 39430; + public static final int KANOAUTH = 180488; + public static final int RXKADNOAUTH = 19270405; + + private static java.util.Hashtable bundles; + + static + { + bundles = new java.util.Hashtable(2); + try { + bundles.put(Locale.US, + ResourceBundle.getBundle("ErrorMessages", Locale.US)); + bundles.put(Locale.SIMPLIFIED_CHINESE, + ResourceBundle.getBundle("ErrorMessages", Locale.SIMPLIFIED_CHINESE)); + } catch (Exception e) { + bundles.put(Locale.getDefault(), + ResourceBundle.getBundle("ErrorMessages")); + } + } + + /*-----------------------------------------------------------------------*/ + /** + * Tests to identify if the return code is a "Permission Denied" error. + * + *

This method will qualify errno against: + *

  • ErrorTable.PERMISSION_DENIED + *
  • ErrorTable.PRPERM + *
  • ErrorTable.UNOACCESS + *
  • ErrorTable.BZACCESS + *
  • ErrorTable.KANOAUTH + *
  • ErrorTable.RXKADNOAUTH + * + * @param errno Error Code/Number + * @return boolean If errno is a "Permission Denied" + * error. + */ + public static boolean isPermissionDenied(int errno) + { + return (errno == PERMISSION_DENIED || errno == PRPERM || + errno == UNOACCESS || errno == BZACCESS || errno == KANOAUTH + || errno == RXKADNOAUTH); + } + /*-----------------------------------------------------------------------*/ + /** + * Returns a String message representing the error code (number) provided. + * + *

    If the error code provided is out of range of the library of defined + * error codes, this method will return Error number [###] unknown + * . If an exception is thrown, this method will return either: + * Unknown error, Special case error, or + * Invalid error code: ###. + * + * @param errno Error Code/Number + * @return String Interpreted error message derived from + * errno. + */ + public static String getMessage(int errno) + { + return getMessage(errno, Locale.getDefault()); + } + /*-----------------------------------------------------------------------*/ + /** + * Returns a String message, respective to the provided locale, representing + * the error code (number) provided. + * + *

    If the error code provided is out of range of the library of defined + * error codes, this method will return Error number [###] unknown + * . If an exception is thrown, this method will return either: + * Unknown error, Special case error, or + * Invalid error code: ###. + * + * @param errno Error Code/Number + * @param locale Locale of to be used for translating the message. + * @return String Interpreted error message derived from + * errno. + */ + public static String getMessage(int errno, Locale locale) + { + String msg = "Error number [" + errno + "] unknown."; + try { + msg = getBundle(locale).getString("E" + errno); + } catch (Exception e) { + try { + if (errno == 0) { + msg = ""; + } else if (errno == GENERAL_FAILURE) { + msg = getBundle(locale).getString("GENERAL_FAILURE"); + } else if (errno == UNKNOWN) { + msg = getBundle(locale).getString("UNKNOWN"); + } else if (errno == SPECIAL_CASE) { + msg = getBundle(locale).getString("SPECIAL_CASE"); + } else { + System.err.println("ERROR in ErrorCode getMessage(): " + e); + msg = "Invaid error code: " + errno; + } + } catch (Exception e2) { + //INGORE + } + } finally { + return msg; + } + } + /*-----------------------------------------------------------------------*/ + private static ResourceBundle getBundle(Locale locale) throws Exception + { + if (locale == null) return getBundle(Locale.getDefault()); + ResourceBundle rb = (ResourceBundle)bundles.get(locale); + if (rb == null) { + rb = ResourceBundle.getBundle("ErrorMessages", locale); + bundles.put(locale, rb); + } + return rb; + } +} + + + diff --git a/src/JAVA/classes/org/openafs/jafs/File.java b/src/JAVA/classes/org/openafs/jafs/File.java new file mode 100644 index 000000000..fe58b2cf4 --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/File.java @@ -0,0 +1,942 @@ +/* + * @(#)File.java 1.3 10/12/2000 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.io.IOException; +import java.util.ArrayList; + +/*****************************************************************************/ +/** + * + * An abstract representation of AFS file and directory pathnames. + * + * This class is an extension of the standard Java File class with file-based + * manipulation methods overridden by integrated AFS native methods. + * + *

    Extension methods include: + * + *

      + *
    1. {@link #isMountPoint} + *
    2. {@link #isLink} + *
    3. {@link #isValidated} + *
    4. {@link #validate} + *
    5. {@link #refresh} + *
    6. {@link #getErrorCode} + *
    7. {@link #getErrorMessage} + *
    + * + *

    For performance optimization, all newly constructed File + * objects are only validated once. Furthermore, if an abstract pathname + * denotes a symbolic-link, then the {@link #isLink} attribute is set + * to true and the {@link #getTarget} field member is populated with + * this symbolic-link's target resource. (see {@link #getTarget}) + * + *

    If you are interested in validating the target resource, simply + * call {@link #validate} before calling any of the attribute accessors. + * This action will stat the target resource, identifying + * its associated attributes and populating them in this objects field + * members. + * + *

    Following is an example of how to construct a new AFS File Object: + *

    + *     try {
    + *         File file = new File("/afs/mycell.com/proj/");
    + *         if (file.isDirectory()) {
    + *           System.out.println("This is a directory.");
    + *         } else if (file.isLink()) {
    + *           System.out.println("This is a symbolic-link.");
    + *           System.out.println("  Its target is: " + file.getTarget());
    + *           file.validate();
    + *           if (file.isFile()) {
    + *             System.out.println("  This object is now a file!");
    + *           } else if (file.isDirectory()) {
    + *             System.out.println("  This object is now a directory!");
    + *           } else if (file.isMountPoint()) {
    + *             System.out.println("  This object is now a volume mount point!");
    + *           }
    + *         } else if (file.isMountPoint()) {
    + *           System.out.println("This is a volume mount point.");
    + *         } else if (file.isFile()) {
    + *           System.out.println("This is file.");
    + *           System.out.println("  its size is: " + file.length());
    + *         }
    + *     } catch (AFSFileException ae) {
    + *         System.out.println("AFS Exception: " + ae.getMessage());
    + *         System.out.println("AFS Error Code: " + ae.getErrorCode());
    + *     } catch (Exception e) {
    + *         System.out.println("Exception: " + e.getMessage());
    + *         e.printStackTrace();
    + *     }
    + * 
    + * + * @version 2.0, 04/16/2001 - Completely revised class for efficiency. + * @version 1.3, 10/12/2000 - Introduced error code capture from native methods. + * @version 1.2, 05/30/2000 + */ +public class File extends java.io.File implements Comparable +{ + private String path; + private String type; + private String target; + + /** Each member is mutually exclusive */ + private boolean isMountPoint = false; + private boolean isDirectory = false; + private boolean isFile = false; + private boolean isLink = false; + + private boolean exists; + private long lastModified; + private long length; + + private ACL.Entry acl; + private boolean validated = false; + private long dirHandle; + private int permissionsMask; + private int errno; + + /** + * Creates a new File instance by converting the given + * pathname string into an abstract pathname and validating it against + * the file system. If the given string is an empty string, then the + * result is the empty abstract pathname; otherwise the abstract pathname + * is validated to represent a qualified file object. + * + * @param pathname A pathname string + * @throws NullPointerException + * If the pathname argument is null + * @throws AFSFileException + * If the user constructing this AFS file object is denied + * access to stat the file or simply a stat cannot be performed + * on the file. The reason code and message will be available + * from {@link org.openafs.jafs.AFSFileException#getErrorCode} and + * {@link org.openafs.jafs.AFSFileException#getMessage} respectively. + *

    This exception will not be thrown if the file does not + * exist. Rather, the {@link #exists} attribute will be set to + * false. + * @see #validate() + */ + public File(String pathname) throws AFSFileException + { + super(pathname); + path = getAbsolutePath(); + validated = setAttributes(); + if (!validated) throw new AFSFileException(errno); + } + /** + * Creates a new File instance by converting the given + * pathname string into an abstract pathname. If the given string is + * an empty string, then the result is the empty abstract pathname. + * + *

    The abstract pathname will remain abstract unless the + * validate parameter is set to true. This + * means that the abstract pathname will not be validated + * and therefore the file object will not represent a qualified, attributed, + * AFS file resource. Rather, this constructor provides a method by which + * you can construct a non-validated File object (one that + * does not contain the file's complete status information). + * + *

    This constructor is useful for creating file objects of file/path names + * that you know exist, however are unauthorized to validate (or + * stat - to obtain complete status information). For example, + * if you are permitted to lookup (see: {@link #canLookup}) the + * contents of a given directory yet not permitted to read + * (see: {@link #canRead}), then this constructor would enable you to render the + * contents of the directory without validating each entry. + * + *

    Please note: this is the only constructor that does not throw an AFSFileException. + * + * @param pathname A pathname string + * @param validate A boolean flag to indicate if this abstract path + * should be validated. + * @throws NullPointerException + * If the pathname argument is null + * @see #File(String) + * @see #validate() + */ + public File(String pathname, boolean validate) + { + super(pathname); + path = getAbsolutePath(); + if (validate) validated = setAttributes(); + } + /** + * Creates a new File instance from a parent pathname string + * and a child pathname string and validates it against the file system. + * + *

    If parent is null then the new + * File instance is created as if by invoking the + * single-argument File constructor on the given + * filename string (child pathname). + * + *

    Otherwise the parent pathname string is taken to denote + * a directory, and the filename string is taken to + * denote either a directory or a file. The directory or file will then be + * validated to represent a qualified file object. + * + * @param parent The parent pathname string + * @param filename This file's pathname string (child of specified parent) + * @throws NullPointerException + * If child is null + * @throws AFSFileException + * If the user constructing this AFS file object is denied + * access to stat the file or simply a stat cannot be performed + * on the file. The reason code and message will be available + * from {@link org.openafs.jafs.AFSFileException#getErrorCode} and + * {@link org.openafs.jafs.AFSFileException#getMessage} respectively. + *

    This exception will not be thrown if the file does not + * exist. Rather, the {@link #exists} attribute will be set to + * false. + * @see #validate() + */ + public File(String parent, String filename) throws AFSFileException + { + super(parent, filename); + path = getAbsolutePath(); + validated = setAttributes(); + if (!validated) throw new AFSFileException(errno); + } + /** + * Creates a new File instance from a parent pathname string + * and a child pathname string. + * + *

    If parent is null then the new + * File instance is created as if by invoking the + * single-argument File constructor on the given + * filename string (child pathname). + * + *

    Otherwise the parent pathname string is taken to denote + * a directory, and the filename string is taken to + * denote either a directory or a file. + * + *

    The abstract pathname will remain abstract unless the + * validate parameter is set to true. This + * means that the abstract pathname will not be validated + * and therefore the file object will not represent a qualified, attributed, + * AFS file resource. Rather, this constructor provides a method by which + * you can construct a non-validated File object (one that + * does not contain the file's complete status information). + * + *

    This constructor is useful for creating file objects of file/path names + * that you know exist, however are unauthorized to validate (or + * stat - to obtain complete status information). For example, + * if you are permitted to lookup (see: {@link #canLookup}) the + * contents of a given directory yet not permitted to read + * (see: {@link #canRead}), then this constructor would enable you to render the + * contents of the directory without validating each entry. + * + * @param parent The parent pathname string + * @param filename This file's pathname string (child of specified parent) + * @param validate A boolean flag to indicate if this abstract path + * should be validated. + * @throws NullPointerException + * If child is null + * @throws AFSFileException + * If the user constructing this AFS file object is denied + * access to stat the file or simply a stat cannot be performed + * on the file. The reason code and message will be available + * from {@link org.openafs.jafs.AFSFileException#getErrorCode} and + * {@link org.openafs.jafs.AFSFileException#getMessage} respectively. + *

    This exception will not be thrown if the file does not + * exist. Rather, the {@link #exists} attribute will be set to + * false. + * @see #File(String, String) + * @see #validate() + */ + public File(String parent, String filename, boolean validate) throws AFSFileException + { + super(parent, filename); + path = getAbsolutePath(); + if (validate) { + validated = setAttributes(); + if (!validated) throw new AFSFileException(errno); + } + } + /** + * Creates a new File instance from a parent abstract + * pathname and a child pathname string and validates it against the file system. + * + *

    If parent is null then the new + * File instance is created as if by invoking the + * single-argument File constructor on the given + * filename string (child pathname). + * + *

    Otherwise the parent abstract pathname is taken to + * denote a directory, and the filename string is taken + * to denote either a directory or a file. The directory or file will then be + * validated to represent a qualified file object. + * + * @param parent The parent abstract pathname + * @param filename This file's pathname string (child of specified parent) + * @param validate A boolean flag to indicate if this abstract path + * should be validated. + * @throws NullPointerException + * If child is null + * @throws AFSFileException + * If the user constructing this AFS file object is denied + * access to stat the file or simply a stat cannot be performed + * on the file. The reason code and message will be available + * from {@link org.openafs.jafs.AFSFileException#getErrorCode} and + * {@link org.openafs.jafs.AFSFileException#getMessage} respectively. + *

    This exception will not be thrown if the file does not + * exist. Rather, the {@link #exists} attribute will be set to + * false. + * @see #validate() + */ + public File(File parent, String filename) throws AFSFileException + { + super(parent, filename); + path = getAbsolutePath(); + validated = setAttributes(); + if (!validated) throw new AFSFileException(errno); + } + /** + * Creates a new File instance from a parent abstract + * pathname and a child pathname string. + * + *

    If parent is null then the new + * File instance is created as if by invoking the + * single-argument File constructor on the given + * filename string (child pathname). + * + *

    Otherwise the parent abstract pathname is taken to + * denote a directory, and the filename string is taken + * to denote either a directory or a file. + * + *

    The abstract pathname will remain abstract unless the + * validate parameter is set to true. This + * means that the abstract pathname will not be validated + * and therefore the file object will not represent a qualified, attributed, + * AFS file resource. Rather, this constructor provides a method by which + * you can construct a non-validated File object (one that + * does not contain the file's complete status information). + * + *

    This constructor is useful for creating file objects of file/path names + * that you know exist, however are unauthorized to validate (or + * stat - to obtain complete status information). For example, + * if you are permitted to lookup (see: {@link #canLookup}) the + * contents of a given directory yet not permitted to read + * (see: {@link #canRead}), then this constructor would enable you to render the + * contents of the directory without validating each entry. + * + * @param parent The parent abstract pathname + * @param filename This file's pathname string (child of specified parent) + * @param validate A boolean flag to indicate if this abstract path + * should be validated. + * @throws NullPointerException + * If child is null + * @throws AFSFileException + * If the user constructing this AFS file object is denied + * access to stat the file or simply a stat cannot be performed + * on the file. The reason code and message will be available + * from {@link org.openafs.jafs.AFSFileException#getErrorCode} and + * {@link org.openafs.jafs.AFSFileException#getMessage} respectively. + *

    This exception will not be thrown if the file does not + * exist. Rather, the {@link #exists} attribute will be set to + * false. + * @see #validate() + * @see #File(File, String) + */ + public File(File parent, String filename, boolean validate) throws AFSFileException + { + super(parent, filename); + path = getAbsolutePath(); + if (validate) { + validated = setAttributes(); + if (!validated) throw new AFSFileException(errno); + } + } + + /*****************************************************************************/ + + /** + * Validates this abstract pathname as an attributed AFS file object. + * This method will, if authorized, perform a stat on the + * actual AFS file and update its respective field members; defining + * this file object's attributes. + * + * @throws AFSSecurityException + * If an AFS exception occurs while attempting to stat and set this + * AFS file object's attributes. + */ + public void validate() throws AFSSecurityException + { + validated = setAttributes(); + if (!validated) throw new AFSSecurityException(errno); + } + /** + * Tests whether the file denoted by this abstract pathname has + * been validated. + * + *

    Validation is always attempted upon construction of the file object, + * therefore if this method returns false, then you are not permitted to + * validate this file and consequently all attribute accessors + * will be invalid. + * + *

    This method should return true even if this abstract + * pathname does not exist. If this is abstract pathname does not exist then + * the {@link #exists} method should return false, however this + * implies that the attribute accessors are valid and accurate; thus implying + * successful validation. + * + *

    This method is useful before calling any of the attribute accessors + * to ensure a valid response. + * + * @return true if and only if the file denoted by this + * abstract pathname has been validated during or after object construction; + * false otherwise + */ + public boolean isValidated() + { + return validated; + } + /** + * Refreshes this AFS file object by updating its attributes. + * This method currently provides the same functionality as + * {@link #validate}. + * + * @throws AFSSecurityException + * If an AFS exception occurs while attempting to stat and update this + * AFS file object's attributes. + * @see #validate() + */ + public void refresh() throws AFSSecurityException + { + validate(); + } + /*-------------------------------------------------------------------------*/ + /** + * Tests whether the file denoted by this abstract pathname is a + * directory. + * + * @return true if and only if the file denoted by this + * abstract pathname exists and is a directory; + * false otherwise + */ + public boolean isDirectory() + { + return (isDirectory || isMountPoint) ? true : false; + } + /** + * Tests whether the file denoted by this abstract pathname is a normal + * file. A file is normal if it is not a directory and, in + * addition, satisfies other system-dependent criteria. Any non-directory + * file created by a Java application is guaranteed to be a normal file. + * + * @return true if and only if the file denoted by this + * abstract pathname exists and is a normal file; + * false otherwise + */ + public boolean isFile() + { + return isFile; + } + /** + * Tests whether the file denoted by this abstract pathname is an + * AFS Volume Mount Point. + * + * @return true if and only if the file denoted by this + * abstract pathname exists and is a mount point; + * false otherwise + */ + public boolean isMountPoint() + { + return isMountPoint; + } + /** + * Tests whether the file denoted by this abstract pathname is a + * symbolic-link. + * + * @return true if and only if the file denoted by this + * abstract pathname exists and is a symbolic-link; + * false otherwise + */ + public boolean isLink() + { + return isLink; + } + /*-------------------------------------------------------------------------*/ + /** + * Tests whether the file denoted by this abstract pathname exists. + * + * @return true if and only if the file denoted by this + * abstract pathname exists; false otherwise + */ + public boolean exists() + { + return exists; + } + /** + * Returns the time that the file denoted by this abstract pathname was + * last modified. + * + * @return A long value representing the time the file was + * last modified, measured in milliseconds since the epoch + * (00:00:00 GMT, January 1, 1970), or 0L if the + * file does not exist or if an I/O error occurs + */ + public long lastModified() + { + return lastModified; + } + /** + * Returns the length of the file denoted by this abstract pathname. + * + * @return The length, in bytes, of the file denoted by this abstract + * pathname, or 0L if the file does not exist + */ + public long length() + { + return length; + } + /** + * Returns an abstract pathname string that represents the target resource of + * of this file, if it is a symbolic-link. + * + *

    If this abstract pathname does not denote a symbolic-link, then this + * method returns null. Otherwise a string is + * returned that represents the target resource of this symbolic-link. + * + * @return A string representation of this symbolic-link's target resource. + * @see #isLink() + */ + public String getTarget() + { + return target; + } + /** + * Returns an array of strings naming the files and directories in the + * directory denoted by this abstract pathname. + * + *

    If this abstract pathname does not denote a directory, then this + * method returns null. Otherwise an array of strings is + * returned, one for each file or directory in the directory. Names + * denoting the directory itself and the directory's parent directory are + * not included in the result. Each string is a file name rather than a + * complete path. + * + *

    There is no guarantee that the name strings in the resulting array + * will appear in any specific order; they are not, in particular, + * guaranteed to appear in alphabetical order. + * + * @return An array of strings naming the files and directories in the + * directory denoted by this abstract pathname. The array will be + * empty if the directory is empty. Returns null if + * this abstract pathname does not denote a directory, or if an + * I/O error occurs. + */ + public String[] list() + { + try { + if (isFile()) { + errno = ErrorTable.NOT_DIRECTORY; + return null; + } + ArrayList buffer = new ArrayList(); + dirHandle = listNative(buffer); + if (dirHandle == 0) { + return null; + } else { + return (String[])buffer.toArray(new String[0]); + } + } catch (Exception e) { + System.out.println(e); + return null; + } + } + /** + * Returns an ArrayList object containing strings naming the files and + * directories in the directory denoted by this abstract pathname. + * + *

    If this abstract pathname does not denote a directory, then this + * method returns null. Otherwise an array of strings is + * returned, one for each file or directory in the directory. Names + * denoting the directory itself and the directory's parent directory are + * not included in the result. Each string is a file name rather than a + * complete path. + * + *

    There is no guarantee that the name strings in the resulting array + * will appear in any specific order; they are not, in particular, + * guaranteed to appear in alphabetical order. + * + * @return An array of strings naming the files and directories in the + * directory denoted by this abstract pathname. The array will be + * empty if the directory is empty. Returns null if + * this abstract pathname does not denote a directory, or if an + * I/O error occurs. + * @throws AFSSecurityException + * If you are not authorized to list the contents of this directory + * @throws AFSFileException + * If this file object is not a mount point, link + * , or directory or an unexpected AFS + * error occurs. + * @see #list() + */ + public ArrayList listArray() throws AFSFileException + { + try { + if (isFile()) throw new AFSFileException(ErrorTable.NOT_DIRECTORY); + ArrayList buffer = new ArrayList(); + dirHandle = listNative(buffer); + if (dirHandle == 0) { + if (errno == ErrorTable.PERMISSION_DENIED) { + throw new AFSSecurityException(errno); + } else { + throw new AFSFileException(errno); + } + } else { + return buffer; + } + } catch (Exception e) { + System.out.println(e); + throw new AFSFileException(errno); + } + } + /*-------------------------------------------------------------------------*/ + /** + * Deletes the file or directory denoted by this abstract pathname. If + * this pathname denotes a directory, then the directory must be empty in + * order to be deleted. + * + * @return true if and only if the file or directory is + * successfully deleted; false otherwise + */ + public boolean delete() + { + try { + if(this.isDirectory()) { + return this.rmdir(); + } else if(this.isFile() || this.isLink()) { + return this.rmfile(); + } + return false; + } catch (Exception e) { + System.out.println(e); + return false; + } + } + /** + * Copies the file denoted by this abstract pathname to the destination + * file provided. Then checks the newly copied file's size to + * test for file size consistency. + * + * @param dest The new abstract pathname for the named file + * + * @return true if and only if the file that was copied + * reports the same file size (length) as that of this file; + * false otherwise + * + * @throws AFSFileException + * If an I/O or AFS exception is encountered while copying the file. + */ + public boolean copyTo(File dest) throws AFSFileException + { + FileInputStream fis = new FileInputStream(this); + FileOutputStream fos = new FileOutputStream(dest); + byte[] buf = new byte[1024]; + int i = 0; + while((i=fis.read(buf))!=-1) { + fos.write(buf, 0, i); + } + fis.close(); + fos.close(); + dest.validate(); + return (dest.length() == this.length()); + } + /*-------------------------------------------------------------------------*/ + /** + * Returns the permissions mask of the ACL for this object relative to the user accessing it. + * + * @return the permissions mask of this object based upon the current user. + * @see org.openafs.jafs.ACL.Entry#getPermissionsMask() + */ + public int getPermissionsMask() + { + return getRights(); + } + /** + * Tests whether the user can administer the ACL (see: {@link org.openafs.jafs.ACL} + * of the directory denoted by this abstract pathname. + * + * @see org.openafs.jafs.ACL.Entry#canAdmin + * @return true if and only if the directory specified by this + * abstract pathname exists and can be administered by the + * current user; false otherwise + */ + public boolean canAdmin() + { + if (acl == null) acl = new ACL.Entry(getRights()); + return acl.canAdmin(); + } + /** + * Tests whether the current user can delete the files or subdirectories of + * the directory denoted by this abstract pathname. + * + * @see org.openafs.jafs.ACL.Entry#canDelete + * @return true if and only if the directory specified by this + * abstract pathname exists and permits deletion of its files + * and subdirectories by the current user; false otherwise + */ + public boolean canDelete() + { + if (acl == null) acl = new ACL.Entry(getRights()); + return acl.canDelete(); + } + /** + * Tests whether the current user can insert a file into the directory + * denoted by this abstract pathname. + * + * @see org.openafs.jafs.ACL.Entry#canInsert + * @return true if and only if the directory specified by this + * abstract pathname exists and a file can be inserted by the + * current user; false otherwise + */ + public boolean canInsert() + { + if (acl == null) acl = new ACL.Entry(getRights()); + return acl.canInsert(); + } + /** + * Tests whether the current user can lock the file denoted by this + * abstract pathname. + * + * @see org.openafs.jafs.ACL.Entry#canLock + * @return true if and only if the file specified by this + * abstract pathname exists and can be locked by the + * current user; false otherwise + */ + public boolean canLock() + { + if (acl == null) acl = new ACL.Entry(getRights()); + return acl.canLock(); + } + /** + * Tests whether the current user can lookup the contents of the directory + * denoted by this abstract pathname. + * + * @see org.openafs.jafs.ACL.Entry#canLookup + * @return true if and only if the directory specified by this + * abstract pathname exists and its contents can be listed by the + * current user; false otherwise + */ + public boolean canLookup() + { + if (acl == null) acl = new ACL.Entry(getRights()); + return acl.canLookup(); + } + /** + * Tests whether the current user can read the file denoted by this + * abstract pathname. + * + * @see org.openafs.jafs.ACL.Entry#canRead + * @return true if and only if the file specified by this + * abstract pathname exists and can be read by the + * current user; false otherwise + */ + public boolean canRead() + { + if (acl == null) acl = new ACL.Entry(getRights()); + return acl.canRead(); + } + /** + * Tests whether the current user can modify to the file denoted by this + * abstract pathname. + * + * @see org.openafs.jafs.ACL.Entry#canWrite + * @return true if and only if the file system actually + * contains a file denoted by this abstract pathname and + * the current user is allowed to write to the file; + * false otherwise. + */ + public boolean canWrite() + { + if (acl == null) acl = new ACL.Entry(getRights()); + return acl.canWrite(); + } + /*-------------------------------------------------------------------------*/ + /** + * Closes the directory denoted by this abstract pathname. + * + * @return true if and only if the directory is + * successfully closed; false otherwise + */ + public boolean close() + { + if (dirHandle == 0) { + return false; + } + return closeDir(dirHandle); + } + /*-------------------------------------------------------------------------*/ + /** + * Returns the AFS specific error number (code). This code can be interpreted + * by use of {@link org.openafs.jafs.ErrorTable} static class method + * {@link org.openafs.jafs.ErrorTable#getMessage} + * + * @return the AFS error code (number) associated with the last action performed + * on this object. + * @see org.openafs.jafs.ErrorTable#getMessage(int) + */ + public int getErrorCode() + { + return errno; + } + /** + * Returns the AFS error message string defined by the {@link org.openafs.jafs.ErrorTable} + * class. + * + * @return the AFS error message string associated with the last action performed + * on this object. + * @see org.openafs.jafs.ErrorTable#getMessage(int) + */ + public String getErrorMessage() + { + return ErrorTable.getMessage(errno); + } + + /////////////// custom override methods //////////////////// + + /** + * Compares two File objects relative to their filenames and does not + * compare their respective absolute paths. Alphabetic case is significant in + * comparing filenames. + * + * @param file The File object to be compared to this file's filename + * + * @return Zero if the argument is equal to this file's filename, a + * value less than zero if this file's filename is + * lexicographically less than the argument, or a value greater + * than zero if this file's filename is lexicographically + * greater than the argument + * + * @since JDK1.2 + */ + public int compareTo(File file) { + return this.getName().compareTo(file.getName()); + } + /** + * Compares this file to another File object. If the other object + * is an abstract pathname, then this function behaves like {@link + * #compareTo(File)}. Otherwise, it throws a + * ClassCastException, since File objects can only be + * compared to File objects. + * + * @param o The Object to be compared to this abstract pathname + * + * @return If the argument is an File object, returns zero + * if the argument is equal to this file's filename, a value + * less than zero if this file's filename is lexicographically + * less than the argument, or a value greater than zero if this + * file's filename is lexicographically greater than the + * argument + * + * @throws ClassCastException if the argument is not an + * File object + * + * @see java.lang.Comparable + * @since JDK1.2 + */ + public int compareTo(Object o) throws ClassCastException + { + File file = (File)o; + return compareTo(file); + } + + /////////////// public native methods //////////////////// + + /** + * Creates the directory named by this abstract pathname. + * + * @return true if and only if the directory was + * created; false otherwise + */ + public native boolean mkdir(); + /** + * Renames the file denoted by this abstract pathname. + * + * @param dest The new abstract pathname for the named file + * + * @return true if and only if the renaming succeeded; + * false otherwise + * + * @throws NullPointerException + * If parameter dest is null + */ + public native boolean renameTo(File dest); + /** + * Performs a file stat on the actual AFS file and populates + * this object's respective field members with the appropriate values. + * method will, if authorized, perform a stat on the + * actual AFS file and update its respective field members; defining + * this file object's attributes. + * + *

    This method should not be used directly for refreshing or validating + * this AFS file object. Please use {@link #validate} instead. + * + * @return true if and only if the current user is allowed to stat the file; + * false otherwise. + * @see #validate() + */ + public native boolean setAttributes() throws AFSSecurityException; + + /////////////// private native methods //////////////////// + + /** + * List the contents of this directory. + * + * @return the directory handle + */ + private native long listNative(ArrayList buffer) throws AFSSecurityException; + /** + * Close the currently open directory using a previously obtained handle. + * + * @return true if the directory closes without error + */ + private native boolean closeDir(long dp) throws AFSSecurityException; + /** + * Removes/deletes the current directory. + * + * @return true if the directory is removed without error + */ + private native boolean rmdir() throws AFSSecurityException; + /** + * Removes/deletes the current file. + * + * @return true if the file is removed without error + */ + private native boolean rmfile() throws AFSSecurityException; + /** + * Returns the permission/ACL mask for this directory + * + * @return permission/ACL mask + */ + private native int getRights() throws AFSSecurityException; + /*-------------------------------------------------------------------------*/ +} + + + + + + diff --git a/src/JAVA/classes/org/openafs/jafs/FileInputStream.java b/src/JAVA/classes/org/openafs/jafs/FileInputStream.java new file mode 100644 index 000000000..ea7f65ce1 --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/FileInputStream.java @@ -0,0 +1,167 @@ +/* + * @(#)FilterInputStream.java 1.0 00/10/10 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.io.InputStream; + +/** + * This class is a file input stream for files within AFS. + * It is an input stream for reading data from a + * {@link org.openafs.jafs.File}. + * + * @version 2.1, 08/03/2001 + * @see org.openafs.jafs.File + * @see org.openafs.jafs.FileOutputStream + * @see java.io.FileInputStream + */ +public class FileInputStream extends InputStream +{ + /** Status indicator for the current state of this file input stream */ + private int fileDescriptor; + + /** + * Creates a FileInputStream by + * opening a connection to an actual AFS file, + * the file named by the path name name + * in the AFS file system. + * + * @param name the name of the file to read from + * @exception AFSFileException If an AFS specific error occurs, + * if the file does not, or cannot be opened for any + * other reason, including authorization. + */ + public FileInputStream(String name) throws AFSFileException + { + this.fileDescriptor = this.openReadOnly(name); + } + /** + * Creates a FileInputStream by + * opening a connection to an actual AFS file, + * the file represented by file file + * in the AFS file system. + * + * @param file an AFS file object representing a file to read from + * @exception AFSFileException If an AFS specific error occurs, + * if the file does not, or cannot be opened for any + * other reason, including authorization. + */ + public FileInputStream(File file) throws AFSFileException + { + this(file.getPath()); + } + + /*-------------------------------------------------------------------------*/ + + /** + * Reads the next byte of data from this input stream. The value + * byte is returned as an int in the range + * 0 to 255. If no byte is available + * because the end of the stream has been reached, the value + * -1 is returned. This method blocks until input data + * is available, the end of the stream is detected, or an exception + * is thrown. + * + *

    This method simply performs in.read() and returns + * the result. + * + * @return the next byte of data, or -1 if the end of the + * stream is reached. + * @exception AFSFileException if an I/O or other file related error occurs. + * @see java.io.FileInputStream#read + */ + public int read() throws AFSFileException + { + byte[] bytes = new byte[1]; + this.read(bytes, 0, 1); + return bytes[0]; + } + /** + * Reads up to b.length bytes of data from this input + * stream into an array of bytes. This method blocks until some input + * is available. + * + * @param b the buffer into which the data is read. + * @return the total number of bytes read into the buffer, or + * -1 if there is no more data because the end of + * the file has been reached. + * @exception AFSFileException if an I/O or other file related error occurs. + */ + public int read(byte[] b) throws AFSFileException + { + return this.read(b, 0, b.length); + } + + /////////////// public native methods //////////////////// + + /** + * Reads up to len bytes of data from this input stream + * into an array of bytes. This method blocks until some input is + * available. + * + * @param b the buffer into which the data is read. + * @param off the start offset of the data. + * @param len the maximum number of bytes read. + * @return the total number of bytes read into the buffer, or + * -1 if there is no more data because the end of + * the file has been reached. + * @exception AFSFileException if an I/O or other file related error occurs. + */ + public native int read(byte[] b, int off, int len) throws AFSFileException; + /** + * Skips over and discards n bytes of data from the + * input stream. The skip method may, for a variety of + * reasons, end up skipping over some smaller number of bytes, + * possibly 0. The actual number of bytes skipped is returned. + * + * @param n the number of bytes to be skipped. + * @return the actual number of bytes skipped. + * @exception AFSFileException if an I/O or other file related error occurs. + */ + public native long skip(long n) throws AFSFileException; + /** + * Closes this file input stream and releases any system resources + * associated with the stream. + * + * @exception AFSFileException if an I/O or other file related error occurs. + */ + public native void close() throws AFSFileException; + + /////////////// private native methods //////////////////// + + /** + * Opens the specified AFS file for reading. + * + * @param name fileName of file to be opened + * @return file descriptor + * @exception AFSFileException if an I/O or other file related error occurs. + */ + private native int openReadOnly(String fileName) throws AFSFileException; + + /*-------------------------------------------------------------------------*/ +} + + + + + diff --git a/src/JAVA/classes/org/openafs/jafs/FileOutputStream.java b/src/JAVA/classes/org/openafs/jafs/FileOutputStream.java new file mode 100644 index 000000000..95c92ddfd --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/FileOutputStream.java @@ -0,0 +1,217 @@ +/* + * @(#)FilterOutputStream.java 1.0 00/10/10 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.io.OutputStream; + +/** + * This class is a file output stream for files within AFS. + * It is an output stream for writing data to a + * {@link org.openafs.jafs.File}. + * + * @version 2.1, 08/03/2001 + * @see org.openafs.jafs.File + * @see org.openafs.jafs.FileInputStream + * @see java.io.FileOutputStream + */ +public class FileOutputStream extends OutputStream +{ + /** Status indicator for the current state of this file output stream */ + private int fileDescriptor; + + /** + * Creates an output file stream to write to the AFS file with the + * specified name. + *

    + * If the file exists but is a directory rather than a regular file, does + * not exist but cannot be created, or cannot be opened for any other + * reason then a AFSFileException is thrown. + * + * @param name the name of the file to write to + * @exception AFSFileException If an AFS specific error occurs, + * if the file exists but is a directory + * rather than a regular file, does not exist but cannot + * be created, or cannot be opened for any other reason, including + * authorization. + */ + public FileOutputStream(String name) throws AFSFileException + { + this(name, false); + } + /** + * Creates an output file stream to write to the AFS file with the specified + * name. If the second argument is true, then + * bytes will be written to the end of the file rather than the beginning. + *

    + * If the file exists but is a directory rather than a regular file, does + * not exist but cannot be created, or cannot be opened for any other + * reason then a AFSFileException is thrown. + * + * @param name the name of the file to write to + * @param append if true, then bytes will be written + * to the end of the file rather than the beginning + * @exception AFSFileException If an AFS specific error occurs, + * if the file exists but is a directory + * rather than a regular file, does not exist but cannot + * be created, or cannot be opened for any other reason, including + * authorization. + */ + public FileOutputStream(String name, boolean append) throws AFSFileException + { + if (append) { + fileDescriptor = this.openAppend(name); + } else { + fileDescriptor = this.openWrite(name); + } + } + /** + * Creates a file output stream to write to the AFS file represented by + * the specified File object. + *

    + * If the file exists but is a directory rather than a regular file, does + * not exist but cannot be created, or cannot be opened for any other + * reason then a AFSFileException is thrown. + * + * @param file the AFS file to be opened for writing. + * @exception AFSFileException If an AFS specific error occurs, + * if the file exists but is a directory + * rather than a regular file, does not exist but cannot + * be created, or cannot be opened for any other reason, including + * authorization. + * @see org.openafs.jafs.File#getPath() + */ + public FileOutputStream(File file) throws AFSFileException + { + this(file.getPath(), false); + } + /** + * Creates a file output stream to write to the AFS file represented by + * the specified File object. + *

    + * If the file exists but is a directory rather than a regular file, does + * not exist but cannot be created, or cannot be opened for any other + * reason then a AFSFileException is thrown. + * + * @param file the AFS file to be opened for writing. + * @param append if true, then bytes will be written + * to the end of the file rather than the beginning + * @exception AFSFileException If an AFS specific error occurs, + * if the file exists but is a directory + * rather than a regular file, does not exist but cannot + * be created, or cannot be opened for any other reason, including + * authorization. + * @see org.openafs.jafs.File#getPath() + */ + public FileOutputStream(File file, boolean append) throws AFSFileException + { + this(file.getPath(), append); + } + + /*-------------------------------------------------------------------------*/ + + /** + * Writes the specified byte to this file output stream. + *

    + * Implements the abstract write method of OutputStream. + * + * @param b the byte to be written. + * @exception AFSFileException if an error occurs. + */ + public void write(int b) throws AFSFileException + { + byte[] bytes = new byte[1]; + bytes[0] = (byte) b; + this.write(bytes, 0, 1); + } + /** + * Writes b.length bytes from the specified byte array + * to this file output stream. + *

    + * Implements the write method of three arguments with the + * arguments b, 0, and + * b.length. + *

    + * Note that this method does not call the one-argument + * write method of its underlying stream with the single + * argument b. + * + * @param b the data to be written. + * @exception AFSFileException if an error occurs. + * @see #write(byte[], int, int) + * @see java.io.FilterOutputStream#write(byte[], int, int) + */ + public void write(byte[] b) throws AFSFileException + { + this.write(b, 0, b.length); + } + + /////////////// public native methods //////////////////// + + /** + * Writes len bytes from the specified + * byte array starting at offset off to + * this file output stream. + * + * @param b the data to be written + * @param off the start offset in the data + * @param len the number of bytes that are written + * @exception AFSFileException if an I/O or other file related error occurs. + * @see java.io.FilterOutputStream#write(int) + */ + public native void write(byte[] b, int off, int len) throws AFSFileException; + /** + * Closes this file output stream and releases any system resources + * associated with this stream. This file output stream may no longer + * be used for writing bytes. + * + * @exception AFSFileException if an I/O or other file related error occurs. + */ + public native void close() throws AFSFileException; + + /////////////// private native methods //////////////////// + + /** + * Opens an AFS file, with the specified name, for writing. + * + * @param filename name of file to be opened + * @return file descriptor + * @exception AFSFileException if an I/O or other file related error occurs. + */ + private native int openWrite(String filename) throws AFSFileException; + /** + * Opens an AFS file, with the specified name, for appending. + * + * @param filename name of file to be opened + * @return file descriptor + * @exception AFSFileException if an I/O or other file related error occurs. + */ + private native int openAppend(String filename) throws AFSFileException; + + /*-------------------------------------------------------------------------*/ +} + + + + + diff --git a/src/JAVA/classes/org/openafs/jafs/Group.java b/src/JAVA/classes/org/openafs/jafs/Group.java new file mode 100644 index 000000000..1572e452b --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/Group.java @@ -0,0 +1,1278 @@ +/* + * @(#)Group.java 1.0 6/29/2001 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.util.Vector; +import java.util.Enumeration; +import java.util.ArrayList; +import java.io.Serializable; + +/** + * An abstract representation of an AFS group. It holds information about + * the group, such as what groups it owns.

    + * + * Constructing an instance of a Group does not mean an actual + * AFS group is created in a cell -- usually a Group + * object is a representation of an already existing AFS group. If, + * however, the Group is constructed with the name of a + * group that does not exist in the cell represented by the provided + * Cell, a new group with that name can be + * created in that cell by calling the {@link #create(String, int)} or + * {@link #create(String)} method. If such a group does already exist when + * one of these methods is called, an exception will be thrown.

    + * + * Each Group object has its own individual set of + * Groups that it owns and Users that belong + * to it. These represents the properties and attributes + * of an actual AFS group. + *

    + * + * + * + * Associated with an AFS group are many attributes, such as whether or not + * who is allowed to list the members of this group. The Group + * class has many "set" methods to indicate values for these attributes (i.e. + * {@link #setListMembership(int)}. However, in order for these values to be + * written to the actual AFS group, the {@link #flushInfo()} method needs to + * be called. This writes all user attributes set through this API to AFS. + * This is done to minimize calls through JNI.

    + * + * + * The following is a simple example of how to construct and use a + * Group object. It lists the name and owner of a specified + * group. + * + *

    + * import org.openafs.jafs.Cell;
    + * import org.openafs.jafs.AFSException;
    + * import org.openafs.jafs.Partition;
    + * import org.openafs.jafs.Group;
    + * ...
    + * public class ...
    + * {
    + *   ...
    + *   private Cell cell;
    + *   private Group group;
    + *   ...
    + *   public static void main(String[] args) throws Exception
    + *   {
    + *     String username   = arg[0];
    + *     String password   = arg[1];
    + *     String cellName   = arg[2];
    + *     String groupName  = arg[3];
    + * 
    + *     token = new Token(username, password, cellName);
    + *     cell   = new Cell(token);
    + *     group = new Group(groupName, cell);
    + *     
    + *     System.out.println("Owner of group " + group.getName() + " is " 
    + *                        + group.getOwnerName());
    + *     ...
    + *   }
    + *   ...
    + * }
    + * 
    + * + */ +public class Group implements PTSEntry, Serializable, Comparable +{ + /** + * Only the owner of the group has access + */ + public static final int GROUP_OWNER_ACCESS = 0; + /** + * Members of the group have access + */ + public static final int GROUP_GROUP_ACCESS = 1; + /** + * Any user has access + */ + public static final int GROUP_ANYUSER_ACCESS = 2; + + protected Cell cell; + protected int cellHandle; + protected String name; + + protected int membershipCount; + protected int nameUID; + protected int ownerUID; + protected int creatorUID; + + protected String owner; + protected String creator; + + /** + * who is allowed to execute PTS examine for this group. Valid values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} -- any user has permission
    + */ + protected int listStatus; + /** + * who is allowed to execute PTS examine for this group. Valid values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} -- any user has permission
    + */ + protected int listGroupsOwned; + /** + * who is allowed to execute PTS listowned for this group. Valid values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} -- any user has permission
    + */ + protected int listMembership; + /** + * who is allowed to execute PTS adduser for this group. Valid values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} -- any user has permission
    + */ + protected int listAdd; + /** + * who is allowed to execute PTS removeuser for this group. Valid + * values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} -- any user has permission
    + */ + protected int listDelete; + + protected ArrayList members; + protected ArrayList memberNames; + protected ArrayList groupsOwned; + protected ArrayList groupsOwnedNames; + + /** + * Whether or not the information fields of this group have been filled. + */ + protected boolean cachedInfo; + + /** + * Constructs a new Group object instance given the name + * of the AFS group and the AFS cell, represented by + * cell, to which it belongs. This does not actually + * create a new AFS group, it just represents one. + * If name is not an actual AFS group, exceptions + * will be thrown during subsequent method invocations on this + * object, unless the {@link #create(String, int)} or {@link #create(String)} + * method is explicitly called to create it. + * + * @param name the name of the group to represent + * @param cell the cell to which the group belongs. + * @exception AFSException If an error occurs in the native code + */ + public Group( String name, Cell cell ) throws AFSException + { + this.name = name; + this.cell = cell; + cellHandle = cell.getCellHandle(); + + members = null; + memberNames = null; + groupsOwned = null; + groupsOwnedNames = null; + cachedInfo = false; + } + + /** + * Constructs a new Group object instance given the name + * of the AFS group and the AFS cell, represented by + * cell, to which it belongs. This does not actually + * create a new AFS group, it just represents one. + * If name is not an actual AFS group, exceptions + * will be thrown during subsequent method invocations on this + * object, unless the {@link #create(String, int)} or {@link #create(String)} + * method is explicitly called to create it. Note that if the process + * doesn't exist and preloadAllMembers is true, an exception + * will be thrown. + * + *

    This constructor is ideal for point-in-time representation and + * transient applications. It ensures all data member values are set and + * available without calling back to the filesystem at the first request + * for them. Use the {@link #refresh()} method to address any coherency + * concerns. + * + * @param name the name of the group to represent + * @param cell the cell to which the group belongs. + * @param preloadAllMembers true will ensure all object members are + * set upon construction; + * otherwise members will be set upon access, + * which is the default behavior. + * @exception AFSException If an error occurs in the native code + * @see #refresh + */ + public Group( String name, Cell cell, boolean preloadAllMembers ) + throws AFSException + { + this(name, cell); + if (preloadAllMembers) refresh(true); + } + + /** + * Creates a blank Group given the cell to which the group + * belongs. Other methods cvan then be used to fill the fields of this + * blank object. + * + * @exception AFSException If an error occurs in the native code + * @param cell the cell to which the group belongs. + */ + Group( Cell cell ) throws AFSException + { + this( null, cell ); + } + + /*-------------------------------------------------------------------------*/ + + /** + * Creates the PTS entry for a new group in this cell. Automatically assigns + * a group id. + * + * @param ownerName the owner of this group + */ + public void create( String ownerName ) throws AFSException + { + this.create( ownerName, 0 ); + } + + /** + * Creates the PTS entry for a new group in this cell. + * + * @param ownerName the owner of this group + * @param gid the group id to assign to the new group + * @exception AFSException If an error occurs in the native code + */ + public void create( String ownerName, int gid ) throws AFSException + { + Group.create( cell.getCellHandle(), name, ownerName, gid ); + } + + /** + * Deletes the PTS entry for a group in this cell. Deletes this group + * from the membership list of the user that belonged to it, but does not + * delete the groups owned by this group. Also nullifies the Java object. + * + * @exception AFSException If an error occurs in the native code + */ + public void delete() throws AFSException + { + Group.delete( cell.getCellHandle(), name ); + + cell = null; + name = null; + owner = null; + creator = null; + members = null; + memberNames = null; + groupsOwned = null; + groupsOwnedNames = null; + try { + finalize(); + } catch( Throwable t ) { + throw new AFSException( t.getMessage() ); + } + } + + /** + * Flushes the current information of this Group object to disk. + * This will update the information of the actual AFS group to match the + * settings that have been modified in this Group object. + * This function must be called before any changes made to the information + * fields of this group will be seen by the AFS system. + * + * @exception AFSException If an error occurs in the native code + */ + public void flushInfo() throws AFSException + { + Group.setGroupInfo( cell.getCellHandle(), name, this ); + } + + /** + * Add the specified member to this group. + * + * @param userName the User object to add + * @exception AFSException If an error occurs in the native code + */ + public void addMember( User theUser ) throws AFSException + { + String userName = theUser.getName(); + + Group.addMember( cell.getCellHandle(), name, userName ); + + // add to cache + if( memberNames != null ) { + memberNames.add( userName ); + } + if( members != null ) { + members.add( new User( userName, cell ) ); + } + } + + /** + * Remove the specified member from this group. + * @param userName the User object to remove + * @exception AFSException If an error occurs in the native code + */ + public void removeMember( User theUser ) throws AFSException + { + String userName = theUser.getName(); + Group.removeMember( cell.getCellHandle(), name, userName ); + + // remove from cache + if( memberNames != null ) { + memberNames.remove( memberNames.indexOf(userName) ); + memberNames.trimToSize(); + } + if( members != null && members.indexOf(theUser) > -1) { + members.remove( members.indexOf(theUser) ); + members.trimToSize(); + } + } + + /** + * Change the owner of this group. + * + * @param ownerName the new owner User object + * @exception AFSException If an error occurs in the native code + */ + public void changeOwner( User theOwner ) throws AFSException + { + String ownerName = theOwner.getName(); + + Group.changeOwner( cell.getCellHandle(), name, ownerName ); + + if( cachedInfo ) { + owner = ownerName; + } + } + + /** + * Change the owner of this group. + * + * @param ownerName the new owner Group object + * @exception AFSException If an error occurs in the native code + */ + public void changeOwner( Group theOwner ) throws AFSException + { + String ownerName = theOwner.getName(); + Group.changeOwner( cell.getCellHandle(), name, ownerName ); + if( cachedInfo ) { + owner = ownerName; + } + } + + /** + * Change the name of this group. + * + * @param newName the new name for this group + * @exception AFSException If an error occurs in the native code + */ + public void rename( String newName ) throws AFSException + { + Group.rename( cell.getCellHandle(), name, newName ); + name = newName; + } + + /** + * Refreshes the properties of this Group object instance with values from + * the AFS group it represents. All properties that have been initialized + * and/or accessed will be renewed according to the values of the AFS group + * this Group object instance represents. + * + *

    Since in most environments administrative changes can be administered + * from an AFS command-line program or an alternate GUI application, this + * method provides a means to refresh the Java object representation and + * thereby ascertain any possible modifications that may have been made + * from such alternate administrative programs. Using this method before + * an associated instance accessor will ensure the highest level of + * representative accuracy, accommodating changes made external to the + * Java application space. If administrative changes to the underlying AFS + * system are only allowed via this API, then the use of this method is + * unnecessary. + * + * @exception AFSException If an error occurs in the native code + */ + public void refresh() throws AFSException + { + refresh(false); + } + + /** + * Refreshes the properties of this Group object instance with values from + * the AFS group it represents. If all is true + * then all of the properties of this Group object instance will be + * set, or renewed, according to the values of the AFS group it represents, + * disregarding any previously set properties. + * + *

    Thus, if all is false then properties that + * are currently set will be refreshed and properties that are not set will + * remain uninitialized. See {@link #refresh()} for more information. + * + * @param all if true set or renew all object properties; otherwise renew + * all set properties + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + protected void refresh(boolean all) throws AFSException + { + if( all || cachedInfo ) { + refreshInfo(); + } + if( all || groupsOwned != null ) { + refreshGroupsOwned(); + } + if( all || groupsOwnedNames != null ) { + refreshGroupsOwnedNames(); + } + if( all || members != null ) { + refreshMembers(); + } + if( all || memberNames != null ) { + refreshMemberNames(); + } + } + + /** + * Refreshes the information fields of this Group to reflect + * the current state of the AFS group. Does not refresh the members that + * belong to the group, nor the groups the group owns. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshInfo() throws AFSException + { + cachedInfo = true; + Group.getGroupInfo( cell.getCellHandle(), name, this ); + } + + /** + * Refreshes the current information about the User objects + * belonging to this group. Does not refresh the information fields of + * the group or groups owned. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshMembers() throws AFSException + { + User currUser; + + int iterationID = Group.getGroupMembersBegin( cell.getCellHandle(), name ); + + members = new ArrayList(); + + currUser = new User( cell ); + while( Group.getGroupMembersNext( cellHandle, iterationID, currUser ) + != 0 ) { + members.add( currUser ); + currUser = new User( cell ); + } + + Group.getGroupMembersDone( iterationID ); + } + + /** + * Refreshes the current information about the names of members belonging + * to this group. Does not refresh the information fields of the group + * or groups owned. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshMemberNames() throws AFSException + { + String currName; + int iterationID = Group.getGroupMembersBegin( cell.getCellHandle(), name ); + + memberNames = new ArrayList(); + + while( ( currName = Group.getGroupMembersNextString( iterationID ) ) + != null ) { + memberNames.add( currName ); + } + Group.getGroupMembersDone( iterationID ); + } + + /** + * Refreshes the current information about the Group objects the + * group owns. Does not refresh the information fields of the group or + * members. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshGroupsOwned() throws AFSException + { + Group currGroup; + + int iterationID = User.getGroupsOwnedBegin( cell.getCellHandle(), name ); + + groupsOwned = new ArrayList(); + + currGroup = new Group( cell ); + while( User.getGroupsOwnedNext( cellHandle, iterationID, currGroup ) + != 0 ) { + groupsOwned.add( currGroup ); + currGroup = new Group( cell ); + } + + User.getGroupsOwnedDone( iterationID ); + } + + /** + * Refreshes the current information about the names of groups the group + * owns. Does not refresh the information fields of the group or members. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshGroupsOwnedNames() throws AFSException + { + String currName; + + int iterationID = User.getGroupsOwnedBegin( cell.getCellHandle(), name ); + + groupsOwnedNames = new ArrayList(); + while( ( currName = User.getGroupsOwnedNextString( iterationID ) ) + != null ) { + groupsOwnedNames.add( currName ); + } + User.getGroupsOwnedDone( iterationID ); + } + + /** + * Adds an access control list entry for some AFS directory for this group. + * + * @param directory the full path of the place in the AFS file system + * for which to add an entry + * @param read whether or not to allow read access to this user + * @param write whether or not to allow write access to this user + * @param lookup whether or not to allow lookup access to this user + * @param delete whether or not to allow deletion access to this user + * @param insert whether or not to allow insertion access to this user + * @param lock whether or not to allow lock access to this user + * @param admin whether or not to allow admin access to this user + * @exception AFSException If an error occurs in the native code + public void setACL( String directory, boolean read, boolean write, boolean lookup, boolean delete, boolean insert, boolean lock, boolean admin ) + throws AFSException + { + Cell.setACL( directory, name, read, write, lookup, delete, insert, lock, admin ); + } + */ + + ////////////////////// accessors: /////////////// + + /** + * Returns the name of this group. + * + * @return the name of this group + */ + public String getName() + { + return name; + } + + /** + * Returns the numeric AFS id of this group. + * + * @return the AFS id of this group + * @exception AFSException If an error occurs in the native code + */ + public int getUID() throws AFSException + { + if( !cachedInfo ) { + refreshInfo(); + } + return nameUID; + } + + /** + * Returns the Cell this group belongs to. + * + * @return the Cell this group belongs to + */ + public Cell getCell() + { + return cell; + } + + /** + * Returns an array of the User object members of this group. + * + * @return an array of the members of this group + * @exception AFSException If an error occurs in the native code + */ + public User[] getMembers() throws AFSException + { + if( members == null ) { + refreshMembers(); + } + return (User[]) members.toArray( new User[members.size()] ); + } + + /** + * Returns an array of the member names of this group. + * + * @return an array of the member names of this group + * @exception AFSException If an error occurs in the native code + */ + public String[] getMemberNames() throws AFSException + { + if( memberNames == null ) { + refreshMemberNames(); + } + return (String[]) memberNames.toArray( new String[memberNames.size()] ); + } + + /** + * Returns an array of the Group objects this group owns. + * + * @return an array of the Groups this group owns + * @exception AFSException If an error occurs in the native code + */ + public Group[] getGroupsOwned() throws AFSException + { + if( groupsOwned == null ) { + refreshGroupsOwned(); + } + return (Group[]) groupsOwned.toArray( new Group[groupsOwned.size()] ); + } + + /** + * Returns an array of the group names this group owns. + * Contains String objects. + * + * @return an array of the group names this group owns + * @exception AFSException If an error occurs in the native code + */ + public String[] getGroupsOwnedNames() throws AFSException + { + if( groupsOwnedNames == null ) { + refreshGroupsOwnedNames(); + } + return (String[]) + groupsOwnedNames.toArray(new String[groupsOwnedNames.size()] ); + } + + /** + * Returns the number of members of this group. + * + * @return the membership count + * @exception AFSException If an error occurs in the native code + */ + public int getMembershipCount() throws AFSException + { + if( !cachedInfo ) { + refreshInfo(); + } + return membershipCount; + } + + /** + * PTS: Returns the owner of this group in the form of a {@link PTSEntry}. + * + *

    The returning object could be either a {@link User} or {@link Group}; + * to determine what type of object the {@link PTSEntry} represents, + * call the {@link PTSEntry#getType()} method. + * + * @return the owner of this group + * @exception AFSException If an error occurs in the native code + * @see PTSEntry + * @see PTSEntry#getType() + * @see #refresh() + */ + public PTSEntry getOwner() throws AFSException + { + if (!cachedInfo) refreshInfo(); + if (owner == null) return null; + if (ownerUID > 0) { + return new User(owner, cell); + } else { + return new Group(owner, cell); + } + } + + /** + * PTS: Returns the creator of this group in the form of a {@link PTSEntry}. + * + *

    The returning object could be either a {@link User} or {@link Group}; + * to determine what type of object the {@link PTSEntry} represents, + * call the {@link PTSEntry#getType()} method. + * + * @return the creator of this group + * @exception AFSException If an error occurs in the native code + * @see PTSEntry + * @see PTSEntry#getType() + * @see #refresh() + */ + public PTSEntry getCreator() throws AFSException + { + if (!cachedInfo) refreshInfo(); + if (creator == null) return null; + if (creatorUID > 0) { + return new User(creator, cell); + } else { + return new Group(creator, cell); + } + } + + /** + * Returns the type of {@link PTSEntry} this object represents. + * + *

    This method will always return {@link PTSEntry#PTS_GROUP}. + * + * @return the type of PTSEntry this object represents + (will always return {@link PTSEntry#PTS_GROUP}) + * @see PTSEntry + * @see PTSEntry#getType() + */ + public short getType() + { + return PTSEntry.PTS_GROUP; + } + + /** + * Returns who can list the status (pts examine) of this group. + * Valid values are: + *

      + *
    • {@link #GROUP_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @return the status listing permission + * @exception AFSException If an error occurs in the native code + */ + public int getListStatus() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return listStatus; + } + + /** + * Returns who can list the groups owned (pts listowned) by this group. + * Valid values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @return the groups owned listing permission + * @exception AFSException If an error occurs in the native code + */ + public int getListGroupsOwned() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return listGroupsOwned; + } + + /** + * Returns who can list the users (pts membership) that belong to this group. + * Valid values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @return the membership listing permission + * @exception AFSException If an error occurs in the native code + */ + public int getListMembership() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return listMembership; + } + + /** + * Returns who can add members (pts adduser) to this group. + * Valid values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @return the member adding permission + * @exception AFSException If an error occurs in the native code + */ + public int getListAdd() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return listAdd; + } + + /** + * Returns who can delete members (pts removemember) from this group. + * Valid values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @return the member deleting permission + * @exception AFSException If an error occurs in the native code + */ + public int getListDelete() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return listDelete; + } + + /////////////////// mutators: ////////////////////// + + /** + * Sets who can list the status (pts examine) of this group. + * Valid values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @param value the value of the new list membership permission + * @exception AFSException if an error occurs in the native code + * @exception IllegalArgumentException if an invalud argument is provided + */ + public void setListStatus( int value ) throws AFSException + { + if( (value != Group.GROUP_OWNER_ACCESS) && + (value != Group.GROUP_GROUP_ACCESS) && + (value != Group.GROUP_ANYUSER_ACCESS) ) { + throw new IllegalArgumentException( "Cannot set listStatus to " + + value ); + } else { + listStatus = value; + } + } + + /** + * Sets who can list the groups owned (pts listowned) by this group. + * Valid values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @param value the value of the new list membership permission + * @exception AFSException if an error occurs in the native code + * @exception IllegalArgumentException if an invalud argument is provided + */ + public void setListGroupsOwned( int value ) throws AFSException + { + if( (value != Group.GROUP_OWNER_ACCESS) && + (value != Group.GROUP_GROUP_ACCESS) && + (value != Group.GROUP_ANYUSER_ACCESS) ) { + throw new IllegalArgumentException( "Cannot set listGroupsOwned to " + + value ); + } else { + listGroupsOwned = value; + } + } + + /** + * Sets who can list the users (pts membership) that belong to this group. + * Valid values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @param value the value of the new list membership permission + * @exception AFSException if an error occurs in the native code + * @exception IllegalArgumentException if an invalud argument is provided + */ + public void setListMembership( int value ) throws AFSException + { + if( (value != Group.GROUP_OWNER_ACCESS) && + (value != Group.GROUP_GROUP_ACCESS) && + (value != Group.GROUP_ANYUSER_ACCESS) ) { + throw new IllegalArgumentException( "Cannot set listMembership to " + + value ); + } else { + listMembership = value; + } + } + + /** + * Sets who can add members (pts adduser) to this group. + * Valid values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @param value the value of the new list membership permission + * @exception AFSException if an invalid value is provided + */ + public void setListAdd( int value ) throws AFSException + { + if( (value != Group.GROUP_OWNER_ACCESS) && + (value != Group.GROUP_GROUP_ACCESS) && + (value != Group.GROUP_ANYUSER_ACCESS) ) { + throw new IllegalArgumentException( "Cannot set listAdd to " + value ); + } else { + listAdd = value; + } + } + + /** + * Sets who can delete members (pts removemember) from this group. + * Valid values are: + *
      + *
    • {@link #GROUP_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #GROUP_GROUP_ACCESS} + * -- only members of the group have permission
    • + *
    • {@link #GROUP_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @param value the value of the new list membership permission + * @exception AFSException if an invalid value is provided + */ + public void setListDelete( int value ) throws AFSException + { + if( (value != Group.GROUP_OWNER_ACCESS) && + (value != Group.GROUP_GROUP_ACCESS) && + (value != Group.GROUP_ANYUSER_ACCESS) ) { + throw new IllegalArgumentException( "Cannot set listDelete to " + + value ); + } else { + listDelete = value; + } + } + + /////////////// information methods //////////////////// + + /** + * Returns a String representation of this Group. + * Contains the information fields and members. + * + * @return a String representation of the Group + */ + protected String getInfo() + { + String r; + try { + r = "Group: " + getName() + ", uid: " + getUID() + "\n"; + r += "\towner: " + getOwner().getName() + ", uid: " + getOwner().getUID() + "\n"; + r += "\tcreator: " + getCreator().getName() + ", uid: " + + getCreator().getUID() + "\n"; + r += "\tMembership count: " + getMembershipCount() + "\n"; + r += "\tList status: " + getListStatus() + "\n"; + r += "\tList groups owned: " + getListGroupsOwned() + "\n"; + r += "\tList membership: " + getListMembership() + "\n"; + r += "\tAdd members: " + getListAdd() + "\n"; + r += "\tDelete members: " + getListDelete() + "\n"; + + r += "\tGroup members: \n"; + String names[] = getMemberNames(); + for( int i = 0; i < names.length; i++ ) { + r += "\t\t" + names[i] + "\n"; + } + + r += "\tOwns groups: \n"; + names = getGroupsOwnedNames(); + for( int i = 0; i < names.length; i++ ) { + r += "\t\t" + names[i] + "\n"; + } + return r; + } catch ( AFSException e ) { + return e.toString(); + } + } + + /////////////// custom override methods //////////////////// + + /** + * Compares two Group objects respective to their names and does not + * factor any other attribute. Alphabetic case is significant in + * comparing names. + * + * @param group The Group object to be compared to this Group instance + * + * @return Zero if the argument is equal to this Group's name, a + * value less than zero if this Group's name is + * lexicographically less than the argument, or a value greater + * than zero if this Group's name is lexicographically + * greater than the argument + */ + public int compareTo(Group group) + { + return this.getName().compareTo(group.getName()); + } + + /** + * Comparable interface method. + * + * @see #compareTo(Group) + */ + public int compareTo(Object obj) + { + return compareTo((Group)obj); + } + + /** + * Tests whether two Group objects are equal, based on their + * names. + * + * @param otherGroup the Group to test + * @return whether the specifed Group is the same as this Group + */ + public boolean equals( Group otherGroup ) + { + return name.equals( otherGroup.getName() ); + } + + /** + * Returns the name of this Group + * + * @return the name of this Group + */ + public String toString() + { + return getName(); + } + + /////////////// native methods //////////////////// + + /** + * Creates the PTS entry for a new group. Pass in 0 for the uid if PTS is to + * automatically assign the group id. + * + * @param cellHandle the handle of the cell to which the group belongs + * @see Cell#getCellHandle + * @param groupName the name of the group to create + * @param ownerName the owner of this group + * @param gid the group id to assign to the group (0 to have one + * automatically assigned) + * @exception AFSException If an error occurs in the native code + */ + protected static native void create( int cellHandle, String groupName, + String ownerName, int gid ) + throws AFSException; + + /** + * Deletes the PTS entry for a group. Deletes this group from the + * membership list of the users that belonged to it, but does not delete + * the groups owned by this group. + * + * @param cellHandle the handle of the cell to which the group belongs + * @see Cell#getCellHandle + * @param groupName the name of the group to delete + * @exception AFSException If an error occurs in the native code + */ + protected static native void delete( int cellHandle, String groupName ) + throws AFSException; + + /** + * Fills in the information fields of the provided Group. + * Fills in values based on the current PTS information of the group. + * + * @param cellHandle the handle of the cell to which the group belongs + * @see Cell#getCellHandle + * @param name the name of the group for which to get the information + * @param group the Group object in which to fill in the + * information + * @see Group + * @exception AFSException If an error occurs in the native code + */ + protected static native void getGroupInfo( int cellHandle, String name, + Group group ) + throws AFSException; + + /** + * Sets the information values of this AFS group to be the parameter values. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @param name the name of the user for which to set the information + * @param theGroup the group object containing the desired information + * @exception AFSException If an error occurs in the native code + */ + protected static native void setGroupInfo( int cellHandle, String name, + Group theGroup ) + throws AFSException; + + /** + * Begin the process of getting the users that belong to the group. Returns + * an iteration ID to be used by subsequent calls to + * getGroupMembersNext and getGroupMembersDone. + * + * @param cellHandle the handle of the cell to which the group belongs + * @see Cell#getCellHandle + * @param name the name of the group for which to get the members + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + */ + protected static native int getGroupMembersBegin( int cellHandle, + String name ) + throws AFSException; + + /** + * Returns the next members that belongs to the group. Returns + * null if there are no more members. + * + * @param iterationId the iteration ID of this iteration + * @see #getGroupMembersBegin + * @return the name of the next member + * @exception AFSException If an error occurs in the native code + */ + protected static native String getGroupMembersNextString( int iterationId ) + throws AFSException; + + /** + * Fills the next user object belonging to that group. Returns 0 if there + * are no more users, != 0 otherwise. + * + * @param cellHandle the handle of the cell to which the users belong + * @see Cell#getCellHandle + * @param iterationId the iteration ID of this iteration + * @see #getGroupMembersBegin + * @param theUser a User object to be populated with the values of the + * next user + * @return 0 if there are no more users, != 0 otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getGroupMembersNext( int cellHandle, + int iterationId, + User theUser ) + throws AFSException; + + /** + * Signals that the iteration is complete and will not be accessed anymore. + * + * @param iterationId the iteration ID of this iteration + * @see #getGroupMembersBegin + * @exception AFSException If an error occurs in the native code + */ + protected static native void getGroupMembersDone( int iterationId ) + throws AFSException; + + /** + * Adds a user to the specified group. + * + * @param cellHandle the handle of the cell to which the group belongs + * @see Cell#getCellHandle + * @param groupName the name of the group to which to add a member + * @param userName the name of the user to add + * @exception AFSException If an error occurs in the native code + */ + protected static native void addMember( int cellHandle, String groupName, + String userName ) + throws AFSException; + + /** + * Removes a user from the specified group. + * + * @param cellHandle the handle of the cell to which the group belongs + * @see Cell#getCellHandle + * @param groupName the name of the group from which to remove a + * member + * @param userName the name of the user to remove + * @exception AFSException If an error occurs in the native code + */ + protected static native void removeMember( int cellHandle, String groupName, + String userName ) + throws AFSException; + + /** + * Change the owner of the specified group. + * + * @param cellHandle the handle of the cell to which the group belongs + * @see Cell#getCellHandle + * @param groupName the name of the group of which to change the + * owner + * @param ownerName the name of the new owner + * @exception AFSException If an error occurs in the native code + */ + protected static native void changeOwner( int cellHandle, String groupName, + String ownerName ) + throws AFSException; + + /** + * Change the name of the specified group. + * + * @param cellHandle the handle of the cell to which the group belongs + * @see Cell#getCellHandle + * @param oldGroupName the old name of the group + * @param newGroupName the new name for the group + * @exception AFSException If an error occurs in the native code + */ + protected static native void rename( int cellHandle, String oldGroupName, + String newGroupName ) + throws AFSException; + + /** + * Reclaims all memory being saved by the group portion of the native + * library. + * This method should be called when no more Groups are expected + * to be used. + */ + protected static native void reclaimGroupMemory(); +} + + + + + diff --git a/src/JAVA/classes/org/openafs/jafs/Key.java b/src/JAVA/classes/org/openafs/jafs/Key.java new file mode 100644 index 000000000..7f2273320 --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/Key.java @@ -0,0 +1,459 @@ +/* + * @(#)Key.java 1.0 6/29/2001 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.util.GregorianCalendar; +import java.util.Date; +import java.io.Serializable; + +/** + * An abstract representation of an AFS key. It holds information about + * the key, such as what its version is. + *

    + * + * Constructing an instance of a Key does not mean an actual + * AFS key is created on a server -- usually a Key + * object is a representation of an already existing AFS key. If, + * however, the Key is constructed with the version number of a + * key that does not exist on the server represented by the provided + * Server, a new key with that version number can be + * created on that server by calling the {@link #create(String)} methods If + * such a key does already exist when this method is called, + * an exception will be thrown.

    + * + * + * The following is a simple example of how to construct and use a + * Key object. It obtains the list of Keys from + * a specified server, and prints the string representation of each key. + *
    + * import org.openafs.jafs.Cell;
    + * import org.openafs.jafs.AFSException;
    + * import org.openafs.jafs.Key;
    + * import org.openafs.jafs.Server;
    + * ...
    + * public class ...
    + * {
    + *   ...
    + *   private Cell cell;
    + *   private Server server;
    + *   ...
    + *   public static void main(String[] args) throws Exception
    + *   {
    + *     String username   = arg[0];
    + *     String password   = arg[1];
    + *     String cellName   = arg[2];
    + *     String serverName = arg[3];
    + * 
    + *     token = new Token(username, password, cellName);
    + *     cell   = new Cell(token);
    + *     server  = new Server(serverName, cell);
    + * 
    + *     System.out.println("Keys in Server " + server.getName() + ":");
    + *     Key[] keys = server.getKeys();
    + *     for (int i = 0; i < keys.length; i++) {
    + *       System.out.println(" -> " + keys[i] );
    + *     }
    + *   }
    + *   ...
    + * }
    + * 
    + * + */ +public class Key implements Serializable, Comparable +{ + protected Server server; + + protected int version; + protected long checkSum; + protected String encryptionKey; + protected int lastModDate; + protected int lastModMs; + + protected GregorianCalendar lastModDateDate; + + protected boolean cachedInfo; + + /** + * Constructs a new Key object instance given the version of + * the AFS key and the AFS server, represented by server, + * to which it belongs. This does not actually + * create a new AFS key, it just represents one. + * If version is not an actual AFS key, exceptions + * will be thrown during subsequent method invocations on this + * object, unless the {@link #create(String)} + * method is explicitly called to create it. + * + * @exception AFSException If an error occurs in the native code + * @param version the version of the key to represent + * @param server the server to which the key belongs. + */ + public Key( int version, Server server ) throws AFSException + { + this.server = server; + this.version = version; + + lastModDateDate = null; + + cachedInfo = false; + } + + /** + * Constructs a new Key object instance given the version of + * the AFS key and the AFS server, represented by server, + * to which it belongs. This does not actually + * create a new AFS key, it just represents one. + * If version is not an actual AFS key, exceptions + * will be thrown during subsequent method invocations on this + * object, unless the {@link #create(String)} + * method is explicitly called to create it. Note that if the key does not + * exist and preloadAllMembers is true, an exception will + * be thrown. + * + *

    This constructor is ideal for point-in-time representation and + * transient applications. It ensures all data member values are set and + * available without calling back to the filesystem at the first request + * for them. Use the {@link #refresh()} method to address any coherency + * concerns. + * + * @param version the version of the key to represent + * @param server the server to which the key belongs. + * @param preloadAllMembers true will ensure all object members are set + * upon construction; otherwise members will be + * set upon access, which is the default behavior. + * @exception AFSException If an error occurs in the native code + * @see #refresh + */ + public Key( int version, Server server, boolean preloadAllMembers ) + throws AFSException + { + this(version, server); + if (preloadAllMembers) refresh(true); + } + + /** + * Creates a blank Key given the server to which the key + * belongs. This blank object can then be passed into other methods to + * fill out its properties. + * + * @exception AFSException If an error occurs in the native code + * @param server the server to which the key belongs. + */ + Key( Server server ) throws AFSException + { + this( -1, server ); + } + + /*-------------------------------------------------------------------------*/ + + /** + * Refreshes the properties of this Key object instance with values from + * the AFS key it represents. All properties that have been initialized + * and/or accessed will be renewed according to the values of the AFS key + * this Key object instance represents. + * + *

    Since in most environments administrative changes can be administered + * from an AFS command-line program or an alternate GUI application, this + * method provides a means to refresh the Java object representation and + * thereby ascertain any possible modifications that may have been made + * from such alternate administrative programs. Using this method before + * an associated instance accessor will ensure the highest level of + * representative accuracy, accommodating changes made external to the + * Java application space. If administrative changes to the underlying AFS + * system are only allowed via this API, then the use of this method is + * unnecessary. + * + * @exception AFSException If an error occurs in the native code + */ + public void refresh() throws AFSException + { + refresh(false); + } + + /** + * Refreshes the properties of this Key object instance with values from + * the AFS key it represents. If all is true + * then all of the properties of this Key object instance will be + * set, or renewed, according to the values of the AFS key it represents, + * disregarding any previously set properties. + * + *

    Thus, if all is false then properties that + * are currently set will be refreshed and properties that are not set will + * remain uninitialized. See {@link #refresh()} for more information. + * + * @param all if true set or renew all object properties; otherwise renew + * all set properties + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + protected void refresh(boolean all) throws AFSException + { + if( all || cachedInfo ) { + refreshInfo(); + } + } + + /** + * Refreshes the information fields of this Key to reflect the + * current state of the AFS server key. These inlclude the last + * modification time, etc. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshInfo() throws AFSException + { + getKeyInfo( server.getBosHandle(), version, this ); + cachedInfo = true; + lastModDateDate = null; + } + + /** + * Creates a key with this Key's version number at the server, + * using the specified String for the key. + * + * @param keyString the string to use for the encryption key + * @exception AFSException If an error occurs in the native code + */ + public void create( String keyString ) throws AFSException + { + create( server.getCell().getCellHandle(), server.getBosHandle(), version, + keyString ); + } + + /** + * Removes the key with this Key's version number from + * the server. + * + * @exception AFSException If an error occurs in the native code + */ + public void delete( ) throws AFSException + { + delete( server.getBosHandle(), version ); + + encryptionKey = null; + cachedInfo = false; + } + + //////////////// accessors: //////////////////////// + + /** + * Returns the version of this key in primitive form. + * + * @return the version number of this key + */ + public int getVersion() + { + return version; + } + + /** + * Returns the server this key is associated with. + * + * @return this key's server + */ + public Server getServer() + { + return server; + } + + /** + * Returns the encrypted key as a string in octal form. This is how AFS + * prints it out on the command line. An example would be: + * '\040\205\211\241\345\002\023\211'. + * + * @return the encrypted key + * @exception AFSException If an error occurs in the native code + */ + public String getEncryptionKey() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return encryptionKey; + } + + /** + * Returns the check sum of this key. + * + * @return the check sum of this key + * @exception AFSException If an error occurs in the native code + */ + public long getCheckSum() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return checkSum; + } + + /** + * Returns the last modification date of this key. + * + * @return the last modification date of this key + * @exception AFSException If an error occurs in the native code + */ + public GregorianCalendar getLastModDate() throws AFSException + { + if (!cachedInfo) refreshInfo(); + if ( lastModDateDate == null && cachedInfo ) { + // make it into a date . . . + lastModDateDate = new GregorianCalendar(); + long longTime = ((long) lastModDate)*1000; + Date d = new Date( longTime ); + lastModDateDate.setTime( d ); + } + return lastModDateDate; + } + + /////////////// information methods //////////////////// + + /** + * Returns a String representation of this Key. + * Contains the information fields. + * + * @return a String representation of the Key + */ + protected String getInfo() + { + String r; + try { + r = "Key version number: " + getVersion() + "\n"; + r += "\tencrypted key: " + getEncryptionKey() + "\n"; + r += "\tcheck sum: " + getCheckSum() + "\n"; + r += "\tlast mod time: " + getLastModDate().getTime() + "\n"; + } catch( Exception e ) { + return e.toString(); + } + return r; + } + + /////////////// override methods //////////////////// + + /** + * Compares two Key objects respective to their key version and does not + * factor any other attribute. + * + * @param key The Key object to be compared to this Key instance + * + * @return Zero if the argument is equal to this Key's version, a + * value less than zero if this Key's version is less than + * the argument, or a value greater than zero if this Key's + * version is greater than the argument + */ + public int compareTo(Key key) + { + return (this.getVersion() - key.getVersion()); + } + + /** + * Comparable interface method. + * + * @see #compareTo(Key) + */ + public int compareTo(Object obj) + { + return compareTo((Key)obj); + } + + /** + * Tests whether two Key objects are equal, based on their + * encryption key, version, and associated Server. + * + * @param otherKey the Key to test + * @return whether the specifed Key is the same as this Key + */ + public boolean equals( Key otherKey ) + { + try { + return ( this.getEncryptionKey().equals(otherKey.getEncryptionKey()) ) && + ( this.getVersion() == otherKey.getVersion() ) && + ( this.getServer().equals(otherKey.getServer()) ); + } catch (Exception e) { + return false; + } + } + + /** + * Returns the name of this Key + * + * @return the name of this Key + */ + public String toString() + { + try { + return getVersion() + " - " + getEncryptionKey() + " - " + getCheckSum(); + } catch (Exception e) { + return e.toString(); + } + } + + /////////////// native methods //////////////////// + + /** + * Fills in the information fields of the provided Key. + * + * @param serverHandle the bos handle of the server to which the key + * belongs + * @see Server#getBosServerHandle + * @param version the version of the key for which to get the information + * @param key the Key object in which to fill in the + * information + * @see Server + * @exception AFSException If an error occurs in the native code + */ + protected static native void getKeyInfo( int serverHandle, int version, + Key key ) + throws AFSException; + + /** + * Create a server key. + * + * @param cellHandle the handle of the cell to which the server belongs + * @see Cell#getCellHandle + * @param serverHandle the bos handle of the server to which the key will + * belong + * @see Server#getBosServerHandle + * @param versionNumber the version number of the key to create (0 to 255) + * @param keyString the String version of the key that will + * be encrypted + * @exception AFSException If an error occurs in the native code + */ + protected static native void create( int cellHandle, int serverHandle, int versionNumber, String keyString ) + throws AFSException; + + /** + * Delete a server key. + * + * @param serverHandle the bos handle of the server to which the key belongs + * @see Server#getBosServerHandle + * @param versionNumber the version number of the key to remove (0 to 255) + * @exception AFSException If an error occurs in the native code + */ + protected static native void delete( int serverHandle, int versionNumber ) + throws AFSException; + + /** + * Reclaims all memory being saved by the key portion of the native library. + * This method should be called when no more Key objects are + * expected to be + * used. + */ + protected static native void reclaimKeyMemory(); + +} diff --git a/src/JAVA/classes/org/openafs/jafs/PTSEntry.java b/src/JAVA/classes/org/openafs/jafs/PTSEntry.java new file mode 100644 index 000000000..db3a29173 --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/PTSEntry.java @@ -0,0 +1,99 @@ +/* + * @(#)PTSEntry.java 1.2 10/23/2001 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +/** + * An interface representation of a PTS entry as it applies to + * AFS users and groups. This interface is implemented in both + * {@link User} and {@link Group} object abstractions. + *

    + * + * + * @version 1.0, 3/31/02 + * @see User + * @see Group + */ +public interface PTSEntry +{ + /** + * Constant for {@link User} object implementers, + * used with {@link #getType()} + */ + public static final short PTS_USER = 0; + /** + * Constant for {@link Group} object implementers, + * used with {@link #getType()} + */ + public static final short PTS_GROUP = 1; + /** + * Returns the Cell this PTS user or group belongs to. + * + * @return the Cell this PTS user or group belongs to + */ + public Cell getCell(); + /** + * Returns the creator of this PTS user or group. + * + * @return the creator of this PTS user or group + * @exception AFSException If an error occurs in the native code + */ + public PTSEntry getCreator() throws AFSException; + /** + * Returns the name of this PTS user or group. + * + * @return the name of this PTS user or group + */ + public String getName(); + /** + * Returns the owner of this PTS user or group. + * + * @return the owner of this PTS user or group + * @exception AFSException If an error occurs in the native code + */ + public PTSEntry getOwner() throws AFSException; + /** + * Returns the type of PTS entry the implementing object represents. + * + *

    Possible values are:
    + *

      + *
    • {@link #PTS_USER} + * -- a {@link User} object
    • + *
    • {@link #PTS_GROUP} + * -- a {@link Group} object
    • + *
    + * + * @return the name of this PTS user or group + */ + public short getType(); + /** + * Returns the numeric AFS id of this user or group. + * + * @return the AFS id of this user/group + * @exception AFSException If an error occurs in the native code + */ + public int getUID() throws AFSException; +} + + + diff --git a/src/JAVA/classes/org/openafs/jafs/Partition.java b/src/JAVA/classes/org/openafs/jafs/Partition.java new file mode 100644 index 000000000..bf10c2095 --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/Partition.java @@ -0,0 +1,1043 @@ +/* + * @(#)Partition.java 1.0 6/29/2001 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.io.Serializable; +import java.util.ArrayList; + +/** + * An abstract representation of an AFS partition. It holds information about + * the partition, such as what its total space is. + *

    + * + * Constructing an instance of a Partition does not mean + * an actual AFS partition is created on a server -- on the contrary, + * a Partition object must be a representation of an already + * existing AFS partition. There is no way to create a new AFS partition + * through this API.

    + * + * Each Partition object has its own individual set of + * Volumes. This represents the properties and attributes + * of an actual AFS cell.

    + * + * + * The following is a simple example of how to obtain and use a + * Partition object. In this example, a list of the + * Partition objects of a server are obtained, and the name + * and number of volumes is printed out for each one.

    + * + *
    + * import org.openafs.jafs.Cell;
    + * import org.openafs.jafs.AFSException;
    + * import org.openafs.jafs.Partition;
    + * import org.openafs.jafs.Server;
    + * ...
    + * public class ...
    + * {
    + *   ...
    + *   private Cell cell;
    + *   private Server server;
    + *   ...
    + *   public static void main(String[] args) throws Exception
    + *   {
    + *     String username   = arg[0];
    + *     String password   = arg[1];
    + *     String cellName   = arg[2];
    + *     String serverName = arg[3];
    + * 
    + *     token = new Token(username, password, cellName);
    + *     cell   = new Cell(token);
    + *     server = new Server(serverName, cell);
    + * 
    + *     System.out.println("Partitions in Server " + server.getName() + ":");
    + *     Partition[] partitions = server.getPartitions();
    + *     for (int i = 0; i < partitions.length; i++) {
    + *       System.out.print("Partition " + partitions[i].getName());
    + *       System.out.print("hosts " + partitions[i].getVolumeCount());
    + *       System.out.print("volumes.\n");
    + *     }
    + *   }
    + *   ...
    + * }
    + * 
    + * + */ +public class Partition implements Serializable, Comparable +{ + protected Cell cell; + protected Server server; + + /* Populated by native method */ + protected String name; + + /* Populated by native method */ + protected int id; + + /* Populated by native method */ + protected String deviceName; + + /* Populated by native method */ + protected int lockFileDescriptor; + + /* Populated by native method */ + protected int totalSpace; + + /* Populated by native method */ + protected int totalFreeSpace; + + protected int totalQuota; + + protected ArrayList volumes; + protected ArrayList volumeNames; + + protected boolean cachedInfo; + + /** + * Constructs a new Partition object instance given the + * name of the AFS partition and the AFS server, represented by + * server, to which it belongs. This does not actually + * create a new AFS partition, it just represents an existing one. + * If name is not an actual AFS partition, exceptions + * will be thrown during subsequent method invocations on this + * object. + * + * @param name the name of the partition to represent + * @param server the server on which the partition resides + * @exception AFSException If an error occurs in the native code + */ + public Partition( String name, Server server ) throws AFSException + { + this.name = name; + this.server = server; + this.cell = server.getCell(); + + id = -1; + + volumes = null; + volumeNames = null; + + cachedInfo = false; + } + + /** + * Constructs a new Partition object instance given the name + * of the AFS partition and the AFS server, represented by + * server, to which it belongs. This does not actually + * create a new AFS partition, it just represents an existing one. + * If name is not an actual AFS partition, exceptions + * will be thrown during subsequent method invocations on this + * object. + * + *

    This constructor is ideal for point-in-time representation and + * transient applications. It ensures all data member values are set and + * available without calling back to the filesystem at the first request + * for them. Use the {@link #refresh()} method to address any coherency + * concerns. + * + * @param name the name of the partition to represent + * @param server the server to which the partition belongs. + * @param preloadAllMembers true will ensure all object members are + * set upon construction; + * otherwise members will be set upon access, + * which is the default behavior. + * @exception AFSException If an error occurs in the native code + * @see #refresh + */ + public Partition( String name, Server server, boolean preloadAllMembers ) + throws AFSException + { + this(name, server); + if (preloadAllMembers) refresh(true); + } + + /** + * Creates a blank Server given the cell to which the partition + * belongs and the server on which the partition resides. This blank + * object can then be passed into other methods to fill out its properties. + * + * @exception AFSException If an error occurs in the native code + * @param cell the cell to which the partition belongs. + * @param server the server on which the partition resides + */ + Partition( Server server ) throws AFSException + { + this( null, server ); + } + + /*-------------------------------------------------------------------------*/ + + /** + * Refreshes the properties of this Partition object instance with values + * from the AFS partition + * it represents. All properties that have been initialized and/or + * accessed will be renewed according to the values of the AFS partition + * this Partition object instance represents. + * + *

    Since in most environments administrative changes can be administered + * from an AFS command-line program or an alternate GUI application, this + * method provides a means to refresh the Java object representation and + * thereby ascertain any possible modifications that may have been made + * from such alternate administrative programs. Using this method before + * an associated instance accessor will ensure the highest level of + * representative accuracy, accommodating changes made external to the + * Java application space. If administrative changes to the underlying AFS + * system are only allowed via this API, then the use of this method is + * unnecessary. + * + * @exception AFSException If an error occurs in the native code + */ + public void refresh() throws AFSException + { + refresh(false); + } + + /** + * Refreshes the properties of this Partition object instance with values + * from the AFS partition it represents. If all is + * true then all of the properties of this Partition + * object instance will be set, or renewed, according to the values of the + * AFS partition it represents, disregarding any previously set properties. + * + *

    Thus, if all is false then properties + * that are currently set will be refreshed and properties that are not + * set will remain uninitialized. See {@link #refresh()} for more + * information. + * + * @param all if true set or renew all object properties; otherwise + * renew all set properties + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + protected void refresh(boolean all) throws AFSException + { + if (all || volumes != null) { + refreshVolumes(); + } + if (all || volumeNames != null) { + refreshVolumeNames(); + } + if (all || cachedInfo) { + refreshInfo(); + } + } + + /** + * Refreshes the information fields of this Partition to + * reflect the current state of the AFS partition. These include total + * free space, id, etc. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshInfo() throws AFSException + { + getPartitionInfo( cell.getCellHandle(), server.getVosHandle(), getID(), + this ); + cachedInfo = true; + } + + /** + * Obtains the most current list of Volume objects of this + * partition. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshVolumes() throws AFSException + { + Volume currVolume; + + int iterationID = getVolumesBegin( cell.getCellHandle(), + server.getVosHandle(), getID() ); + + volumes = new ArrayList(); + + currVolume = new Volume( this ); + while( getVolumesNext( iterationID, currVolume ) != 0 ) { + volumes.add( currVolume ); + currVolume = new Volume( this ); + } + getVolumesDone( iterationID ); + } + + /** + * Obtains the most current list of volume names of this partition. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshVolumeNames() throws AFSException + { + String currName; + + int iterationID = getVolumesBegin( cell.getCellHandle(), + server.getVosHandle(), getID() ); + + volumeNames = new ArrayList(); + + while( ( currName = getVolumesNextString( iterationID ) ) != null ) { + volumeNames.add( currName ); + } + getVolumesDone( iterationID ); + } + + /** + * Syncs this partition to the VLDB. + * + * @exception AFSException If an error occurs in the native code + */ + public void syncPartition() throws AFSException + { + server.syncServerWithVLDB( cell.getCellHandle(), server.getVosHandle(), + getID() ); + } + + /** + * Syncs the VLDB to this partition. + * + * @exception AFSException If an error occurs in the native code + */ + public void syncVLDB() throws AFSException + { + server.syncVLDBWithServer( cell.getCellHandle(), server.getVosHandle(), + getID(), false ); + } + + /** + * Salvages (restores consistency to) this partition. Uses default values for + * most salvager options in order to simplify the API. + * + * @exception AFSException If an error occurs in the native code + */ + public void salvage() throws AFSException + { + server.salvage( cell.getCellHandle(), server.getBosHandle(), name, null, + 4, null, null, false, false, false, false, false, false ); + } + + //////////////// accessors: //////////////////////// + + /** + * Returns the name of this partition. + * + * @return the name of this partition + */ + public String getName() + { + return name; + } + + /** + * Returns this partition's hosting server. + * + * @return this partition's server + */ + public Server getServer() + { + return server; + } + + /** + * Returns the number of volumes contained in this partition. + * + *

    If the total list of volumes or volume names have already been + * collected (see {@link #getVolumes()}), then the returning value will + * be calculated based upon the current list. Otherwise, AFS will be + * explicitly queried for the information. + * + *

    The product of this method is not saved, and is recalculated + * with every call. + * + * @return the number of volumes contained in this partition. + * @exception AFSException If an error occurs in any + * of the associated native methods + */ + public int getVolumeCount() throws AFSException + { + if (volumes != null) { + return volumes.size(); + } else if (volumeNames != null) { + return volumeNames.size(); + } else { + return getVolumeCount( cell.getCellHandle(), + server.getVosHandle(), getID() ); + } + } + + /** + * Retrieves the Volume object (which is an abstract + * representation of an actual AFS volume of this partition) designated + * by name (i.e. "root.afs", etc.). If a volume by + * that name does not actually exist in AFS on the partition + * represented by this object, an {@link AFSException} will be + * thrown. + * + * @exception AFSException If an error occurs in the native code + * @exception NullPointerException If name is + * null. + * @param name the name of the volume to retrieve + * @return Volume designated by name. + */ + public Volume getVolume(String name) throws AFSException + { + if (name == null) throw new NullPointerException(); + Volume volume = new Volume(name, this); + return volume; + } + + /** + * Retrieves an array containing all of the Volume objects + * associated with this Partition, each of which is an + * abstract representation of an actual AFS volume of the AFS partition. + * After this method is called once, it saves the array of + * Volumes and returns that saved array on subsequent calls, + * until the {@link #refresh()} method is called and a more current list + * is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return a Volume array of the Volume + * objects of the partition. + * @see #refresh() + */ + public Volume[] getVolumes() throws AFSException + { + if (volumes == null) refreshVolumes(); + return (Volume[]) volumes.toArray( new Volume[volumes.size()] ); + } + + /** + * Returns an array containing a subset of the Volume objects + * associated with this Partition, each of which is an abstract + * representation of an actual AFS volume of the AFS partition. The subset + * is a point-in-time list of volumes (Volume objects + * representing AFS volumes) starting at the complete array's index of + * startIndex and containing up to length + * elements. + * + * If length is larger than the number of remaining elements, + * respective to startIndex, then this method will + * ignore the remaining positions requested by length and + * return an array that contains the remaining number of elements found in + * this partition's complete array of volumes. + * + *

    This method is especially useful when managing iterations of very + * large lists. {@link #getVolumeCount()} can be used to determine if + * iteration management is practical. + * + *

    This method does not save the resulting data and therefore + * queries AFS for each call. + * + *

    Example: If there are more than 50,000 volumes within this partition + * then only render them in increments of 10,000. + *

    +   * ...
    +   *   Volume[] volumes;
    +   *   if (partition.getVolumeCount() > 50000) {
    +   *     int index = 0;
    +   *     int length = 10000;
    +   *     while (index < partition.getVolumeCount()) {
    +   *       volumes = partition.getVolumes(index, length);
    +   *       for (int i = 0; i < volumes.length; i++) {
    +   *         ...
    +   *       }
    +   *       index += length;
    +   *       ...
    +   *     }
    +   *   } else {
    +   *     volumes = partition.getVolumes();
    +   *     for (int i = 0; i < volumes.length; i++) {
    +   *       ...
    +   *     }
    +   *   }
    +   * ...
    +   * 
    + * + * @param startIndex the base zero index position at which the subset array + * should start from, relative to the complete list of + * elements present in AFS. + * @param length the number of elements that the subset should contain + * @return a subset array of volumes hosted by this partition + * @exception AFSException If an error occurs in the native code + * @see #getVolumeCount() + * @see #getVolumeNames(int, int) + * @see #getVolumes() + */ + public Volume[] getVolumes(int startIndex, int length) throws AFSException + { + Volume[] volumes = new Volume[length]; + Volume currVolume = new Volume( this ); + int i = 0; + + int iterationID = getVolumesBeginAt( cell.getCellHandle(), + server.getVosHandle(), getID(), startIndex ); + + while( getVolumesNext( iterationID, currVolume ) != 0 && i < length ) { + volumes[i] = currVolume; + currVolume = new Volume( this ); + i++; + } + getVolumesDone( iterationID ); + if (i < length) { + Volume[] v = new Volume[i]; + System.arraycopy(volumes, 0, v, 0, i); + return v; + } else { + return volumes; + } + } + + /** + * Retrieves an array containing all of the names of volumes + * associated with this Partition. + * After this method is called once, it saves the array of + * Strings and returns that saved array on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * list is obtained. + * + * @return a String array of the volumes of the partition. + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public String[] getVolumeNames() throws AFSException + { + if (volumeNames == null) refreshVolumeNames(); + return (String []) volumeNames.toArray( new String[volumeNames.size() ] ); + } + + /** + * Returns an array containing a subset of the names of volumes + * associated with this Partition. The subset is a + * point-in-time list of volume names starting at the complete array's + * index of startIndex and containing up to length + * elements. + * + * If length is larger than the number of remaining elements, + * respective to startIndex, then this method will + * ignore the remaining positions requested by length and + * return an array that contains the remaining number of elements found in + * this partition's complete array of volume names. + * + *

    This method is especially useful when managing iterations of very + * large lists. {@link #getVolumeCount()} can be used to determine if + * iteration management is practical. + * + *

    This method does not save the resulting data and therefore + * queries AFS for each call. + * + *

    Example: If there are more than 50,000 volumes within this partition + * then only render them in increments of 10,000. + *

    +   * ...
    +   *   String[] volumes;
    +   *   if (partition.getVolumeCount() > 50000) {
    +   *     int index = 0;
    +   *     int length = 10000;
    +   *     while (index < partition.getVolumeCount()) {
    +   *       volumes = partition.getVolumeNames(index, length);
    +   *       for (int i = 0; i < volumes.length; i++) {
    +   *         ...
    +   *       }
    +   *       index += length;
    +   *       ...
    +   *     }
    +   *   } else {
    +   *     volumes = partition.getVolumeNames();
    +   *     for (int i = 0; i < volumes.length; i++) {
    +   *       ...
    +   *     }
    +   *   }
    +   * ...
    +   * 
    + * + * @param startIndex the base zero index position at which the subset array + * should start from, relative to the complete list of + * elements present in AFS. + * @param length the number of elements that the subset should contain + * @return a subset array of volume names hosted by this partition + * @exception AFSException If an error occurs in the native code + * @see #getVolumeCount() + * @see #getVolumes(int, int) + * @see #getVolumes() + */ + public String[] getVolumeNames(int startIndex, int length) throws AFSException + { + String[] volumes = new String[length]; + String currName; + int i = 0; + + int iterationID = getVolumesBeginAt( cell.getCellHandle(), + server.getVosHandle(), getID(), startIndex ); + + while( ( currName = getVolumesNextString( iterationID ) ) != null && i < length ) { + volumes[i] = currName; + i++; + } + getVolumesDone( iterationID ); + if (i < length) { + String[] v = new String[i]; + System.arraycopy(volumes, 0, v, 0, i); + return v; + } else { + return volumes; + } + } + + /** + * Returns the id of this partition (i.e. "vicepa" = 0, etc.) + * + * @exception AFSException If an error occurs in the native code + * @return the id of this partition + */ + public int getID() throws AFSException + { + if (id == -1) id = translateNameToID( name ); + return id; + } + + /** + * Returns the device name of this partition (i.e. "hda5", etc.) + * + * @exception AFSException If an error occurs in the native code + * @return the device name of this partition + * @see #refresh() + */ + public String getDeviceName() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return deviceName; + } + + /** + * Returns the lock file descriptor of this partition + * + * @exception AFSException If an error occurs in the native code + * @return the lock file descriptor of this partition + * @see #refresh() + */ + public int getLockFileDescriptor() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return lockFileDescriptor; + } + + /** + * Returns the total space on this partition. + * + * @exception AFSException If an error occurs in the native code + * @return the total space on this partition + * @see #refresh() + */ + public int getTotalSpace() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return totalSpace; + } + + /** + * Returns the total free space on this partition. + * After this method is called once, it saves the total free space + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return the total free space on this partition + * @see #refresh() + */ + public int getTotalFreeSpace() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return totalFreeSpace; + } + + /** + * Returns the total used space on this partition. + * After this method is called once, it saves the total used space + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return the total used space on this partition + * @see #refresh() + */ + public int getUsedSpace() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return (totalSpace - totalFreeSpace); + } + + /** + * Returns the total combined quota of all volumes on this partition, + * unless a volume has configured an unlimited quota at which case an + * {@link AFSException} is thrown. + * + *

    After this method is called once, it saves the value and returns + * that value on subsequent calls, until the {@link #refresh()} + * method is called and a more current value is obtained. + * + * @exception AFSException If an error occurs while retrieving and + * calculating, or a volume has an + * unlimited quota. + * @return the total combined quota of all volumes on this partition + * @see #getTotalQuota(boolean) + * @see #hasVolumeWithUnlimitedQuota() + * @see Volume#getQuota() + */ + public int getTotalQuota() throws AFSException + { + return getTotalQuota(false); + } + + /** + * Returns the total combined quota of all volumes on this partition, + * ignoring volumes with unlimited quotas, if + * ignoreUnlimitedQuotas is true; otherwise an + * {@link AFSException} is thrown if a volume has an unlimited quota. + * + *

    After this method is called once, it saves the value and returns + * that value on subsequent calls, until the {@link #refresh()} + * method is called and a more current value is obtained. + * + * @exception AFSException If an error occurs while retrieving and + * calculating, or a volume has an + * unlimited quota. + * @return the total combined quota of all volumes on this partition + * @see #getTotalQuota() + * @see #hasVolumeWithUnlimitedQuota() + * @see Volume#getQuota() + * @see #refresh() + */ + public int getTotalQuota(boolean ignoreUnlimitedQuotas) + throws AFSException + { + if (volumes == null) refreshVolumes(); + if (totalQuota == 0 || !ignoreUnlimitedQuotas) { + Volume[] volumes = getVolumes(); + for (int i = 0; i < volumes.length; i++) { + try { + totalQuota += volumes[i].getQuota(); + } catch (AFSException e) { + if (!ignoreUnlimitedQuotas) { + totalQuota = 0; + throw e; + } + } + } + } + return totalQuota; + } + + /** + * Tests whether this partition contains a volume that has an unlimited + * quota configured. + * + * @exception AFSException If an error occurs in the native code + * @return true if a contained volume's quota is configured + * as unlimited; otherwise false. + * @see #getTotalQuota() + * @see #getTotalQuota(boolean) + * @see Volume#isQuotaUnlimited() + * @see Volume#getQuota() + * @see #refresh() + */ + public boolean hasVolumeWithUnlimitedQuota() throws AFSException + { + if (volumes == null) refreshVolumes(); + Volume[] volumes = getVolumes(); + for (int i = 0; i < volumes.length; i++) { + if (volumes[i].isQuotaUnlimited()) return true; + } + return false; + } + + /////////////// custom information methods //////////////////// + + /** + * Returns a String representation of this + * Partition. Contains the information fields and a list of + * volumes. + * + * @return a String representation of the Partition + */ + protected String getInfo() + { + String r; + + try { + + r = "Partition: " + name + "\tid: " + getID() + "\n"; + + r += "\tDevice name: " + getDeviceName() + "\n"; + r += "\tLock file descriptor: " + getLockFileDescriptor() + "\n"; + r += "\tTotal free space: " + getTotalFreeSpace() + " K\n"; + r += "\tTotal space: " + getTotalSpace() + " K\n"; + + r += "\tVolumes:\n"; + + String vols[] = getVolumeNames(); + + for( int i = 0; i < vols.length; i++ ) { + r += "\t\t" + vols[i] + "\n"; + } + + } catch( Exception e ) { + return e.toString(); + } + return r; + } + + /** + * Returns a String containing the String + * representations of all the volumes of this Partition. + * + * @return a String representation of the volumes + * @see Volume#getInfo + */ + protected String getInfoVolumes() throws AFSException + { + String r; + + r = "Partition: " + name + "\n\n"; + r += "--Volumes--\n"; + + Volume vols[] = getVolumes(); + for( int i = 0; i < vols.length; i++ ) { + r += vols[i].getInfo() + "\n"; + } + return r; + } + + /////////////// custom override methods //////////////////// + + /** + * Compares two Partition objects respective to their names and does not + * factor any other attribute. Alphabetic case is significant in + * comparing names. + * + * @param partition The Partition object to be compared to + * this Partition instance + * + * @return Zero if the argument is equal to this Partition's name, a + * value less than zero if this Partition's name is + * lexicographically less than the argument, or a value greater + * than zero if this Partition's name is lexicographically + * greater than the argument + */ + public int compareTo(Partition partition) + { + return this.getName().compareTo(partition.getName()); + } + + /** + * Comparable interface method. + * + * @see #compareTo(Partition) + */ + public int compareTo(Object obj) + { + return compareTo((Partition)obj); + } + + /** + * Tests whether two Partition objects are equal, + * based on their names and hosting server. + * + * @param otherPartition the Partition to test + * @return whether the specifed Partition is the same as this Partition + */ + public boolean equals( Partition otherPartition ) + { + return ( name.equals(otherPartition.getName()) ) && + ( getServer().equals(otherPartition.getServer()) ); + } + + /** + * Returns the name of this Partition + * + * @return the name of this Partition + */ + public String toString() + { + return getName(); + } + + /////////////// native methods //////////////////// + + /** + * Fills in the information fields of the provided Partition. + * + * @param cellHandle the handle of the cell to which the partition belongs + * @see Cell#getCellHandle + * @param serverHandle the vos handle of the server on which the + * partition resides + * @see Server#getVosServerHandle + * @param partition the numeric id of the partition for which to get the + * info + * @param thePartition the {@link Partition Partition} object in which to + * fill in the information + * @exception AFSException If an error occurs in the native code + */ + protected static native void getPartitionInfo( int cellHandle, + int serverHandle, + int partition, + Partition thePartition ) + throws AFSException; + + /** + * Returns the total number of volumes hosted by this partition. + * + * @param cellHandle the handle of the cell to which the partition belongs + * @param serverHandle the vos handle of the server to which the partition + * belongs + * @param partition the numeric id of the partition on which the volumes + * reside + * @return total number of volumes hosted by this partition + * @exception AFSException If an error occurs in the native code + * @see Cell#getCellHandle + * @see Server#getVosServerHandle + */ + protected static native int getVolumeCount( int cellHandle, + int serverHandle, + int partition ) + throws AFSException; + + /** + * Begin the process of getting the volumes on a partition. Returns + * an iteration ID to be used by subsequent calls to + * getVolumesNext and getVolumesDone. + * + * @param cellHandle the handle of the cell to which the partition belongs + * @see Cell#getCellHandle + * @param serverHandle the vos handle of the server to which the partition + * belongs + * @see Server#getVosServerHandle + * @param partition the numeric id of the partition on which the volumes + * reside + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + */ + protected static native int getVolumesBegin( int cellHandle, + int serverHandle, + int partition ) + throws AFSException; + + /** + * Begin the process of getting the volumes on a partition. Returns + * an iteration ID to be used by subsequent calls to + * getVolumesNext and getVolumesDone. + * + * @param cellHandle the handle of the cell to which the partition belongs + * @see Cell#getCellHandle + * @param serverHandle the vos handle of the server to which the partition + * belongs + * @see Server#getVosServerHandle + * @param partition the numeric id of the partition on which the volumes + * reside + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + */ + protected static native int getVolumesBeginAt( int cellHandle, + int serverHandle, + int partition, int index ) + throws AFSException; + + /** + * Returns the next volume of the partition. Returns null + * if there are no more volumes. + * + * @param iterationId the iteration ID of this iteration + * @see #getVolumesBegin + * @return the name of the next volume of the server + * @exception AFSException If an error occurs in the native code + */ + protected static native String getVolumesNextString( int iterationId ) + throws AFSException; + + /** + * Fills the next volume object of the partition. Returns 0 if there + * are no more volumes, != 0 otherwise. + * + * @param iterationId the iteration ID of this iteration + * @param theVolume the Volume object in which to fill the values + * of the next volume + * @see #getVolumesBegin + * @return 0 if there are no more volumes, != 0 otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getVolumesNext( int iterationId, + Volume theVolume ) + throws AFSException; + + /** + * Fills the next volume object of the partition. Returns 0 if there + * are no more volumes, != 0 otherwise. + * + * @param iterationId the iteration ID of this iteration + * @param theVolume the Volume object in which to fill the values of the + * next volume + * @see #getVolumesBegin + * @return 0 if there are no more volumes, != 0 otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getVolumesAdvanceTo( int iterationId, + Volume theVolume, + int advanceCount ) + throws AFSException; + + /** + * Signals that the iteration is complete and will not be accessed anymore. + * + * @param iterationId the iteration ID of this iteration + * @see #getVolumesBegin + * @exception AFSException If an error occurs in the native code + */ + protected static native void getVolumesDone( int iterationId ) + throws AFSException; + + /** + * Translates a partition name into a partition id + * + * @param name the name of the partition in question + * @return the id of the partition in question + * @exception AFSException If an error occurs in the native code + */ + protected static native int translateNameToID( String name ) + throws AFSException; + + /** + * Translates a partition id into a partition name + * + * @param id the id of the partition in question + * @return the name of the partition in question + * @exception AFSException If an error occurs in the native code + */ + protected static native String translateIDToName( int id ) + throws AFSException; + + /** + * Reclaims all memory being saved by the partition portion of the native + * library. This method should be called when no more Partition + * objects are expected to be + * used. + */ + protected static native void reclaimPartitionMemory(); +} diff --git a/src/JAVA/classes/org/openafs/jafs/Process.java b/src/JAVA/classes/org/openafs/jafs/Process.java new file mode 100644 index 000000000..b006db32a --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/Process.java @@ -0,0 +1,953 @@ +/* + * @(#)Process.java 1.0 6/29/2001 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.util.GregorianCalendar; +import java.util.Date; +import java.io.Serializable; + +/** + * An abstract representation of an AFS process. It holds information about + * the server, such as what its state is. + *

    + * + * Constructing an instance of a Process does not mean an actual + * AFS process is created on a server -- usually a Process + * object is a representation of an already existing AFS process. If, + * however, the Process is constructed with the name of a + * process that does not exist in the server represented by the provided + * Server, a new process with that name can be + * created on that server by calling one of the {@link #createSimple(String)}, + * {@link #createFS(String)}, or {@link #createCron(String,String)} methods. If + * such a process does already exist when one of these methods are called, + * an exception will be thrown.

    + * + * + * + * + * The following is a simple example of how to construct and use a + * Process object. This example obtains the list of all + * Process objects on a particular server and prints out the + * name of each one along with its start time.

    + * + *

    + * import org.openafs.jafs.Cell;
    + * import org.openafs.jafs.AFSException;
    + * import org.openafs.jafs.Process;
    + * import org.openafs.jafs.Server;
    + * ...
    + * public class ...
    + * {
    + *   ...
    + *   private Cell cell;
    + *   private Server server;
    + *   ...
    + *   public static void main(String[] args) throws Exception
    + *   {
    + *     String username   = arg[0];
    + *     String password   = arg[1];
    + *     String cellName   = arg[2];
    + *     String serverName = arg[3];
    + * 
    + *     token = new Token(username, password, cellName);
    + *     cell   = new Cell(token);
    + *     server = new Server(serverName, cell);
    + * 
    + *     System.out.println("Processes in Server " + server.getName() + ":");
    + *     Process[] processes = server.getProcesss();
    + *     for (int i = 0; i < processes.length; i++) {
    + *       System.out.print("Process " + processes[i].getName());
    + *       System.out.print("was started: " + 
    + *                        processes[i].getStartTimeDate().getTime() + "\n");
    + *     }
    + *   }
    + *   ...
    + * }
    + * 
    + * + */ +public class Process implements Serializable, Comparable +{ + /** + * Any standard type of process except for fs (such as kaserver, + * upclientbin, etc.) + */ + public static final int SIMPLE_PROCESS = 0; + + /** + * Combination of File Server, Volume Server, and Salvager processes + */ + public static final int FS_PROCESS = 1; + + /** + * A process that should be restarted at a specific time either daily + * or weekly. + */ + public static final int CRON_PROCESS = 2; + + /** + * Process execution state stopped + */ + public static final int STOPPED = 0; + + /** + * Process execution state running + */ + public static final int RUNNING = 1; + + /** + * Process execution state stopping + */ + public static final int STOPPING = 2; + + /** + * Process execution state starting + */ + public static final int STARTING = 3; + + protected String name; + protected Server server; + protected int serverHandle; + + protected int type; + protected int state; + protected int goal; + + protected long startTime; + protected long numberStarts; + protected long exitTime; + protected long exitErrorTime; + protected long errorCode; + protected long errorSignal; + + protected boolean stateOk; + protected boolean stateTooManyErrors; + protected boolean stateBadFileAccess; + + protected GregorianCalendar startTimeDate; + protected GregorianCalendar exitTimeDate; + protected GregorianCalendar exitErrorTimeDate; + + protected boolean cachedInfo; + + /** + * Constructs a new Process object instance given the name + * of the AFS process and the AFS server, represented by + * server, to which it belongs. This does not actually + * create a new AFS process, it just represents one. + * If name is not an actual AFS process, exceptions + * will be thrown during subsequent method invocations on this + * object, unless one of the {@link #createSimple(String)}, + * {@link #createFS(String)}, or {@link #createCron(String,String)} + * methods are explicitly called to create it. + * + * @param name the name of the server to represent + * @param server the server on which the process resides + * @exception AFSException If an error occurs in the native code + */ + public Process( String name, Server server ) throws AFSException + { + this.name = name; + this.server = server; + serverHandle = server.getBosHandle(); + + startTimeDate = null; + exitTimeDate = null; + exitErrorTimeDate = null; + + cachedInfo = false; + } + + /** + * Constructs a new Process object instance given the name + * of the AFS process and the AFS server, represented by + * server, to which it belongs. This does not actually + * create a new AFS process, it just represents one. + * If name is not an actual AFS process, exceptions + * will be thrown during subsequent method invocations on this + * object, unless one of the {@link #createSimple(String)}, + * {@link #createFS(String)}, or {@link #createCron(String,String)} + * methods are explicitly called to create it. Note that if he process + * doesn't exist and preloadAllMembers is true, an exception + * will be thrown. + * + *

    This constructor is ideal for point-in-time representation and + * transient applications. It ensures all data member values are set and + * available without calling back to the filesystem at the first request + * for them. Use the {@link #refresh()} method to address any coherency + * concerns. + * + * @param name the name of the process to represent + * @param server the server to which the process belongs. + * @param preloadAllMembers true will ensure all object members are + * set upon construction; otherwise members will + * be set upon access, which is the default + * behavior. + * @exception AFSException If an error occurs in the native code + * @see #refresh + */ + public Process( String name, Server server, boolean preloadAllMembers ) + throws AFSException + { + this(name, server); + if (preloadAllMembers) refresh(true); + } + + /** + * Creates a blank Process given the server to which the process + * belongs. This blank object can then be passed into other methods to fill + * out its properties. + * + * @param server the server to which the process belongs. + * @exception AFSException If an error occurs in the native code + */ + Process( Server server ) throws AFSException + { + this( null, server ); + } + + /*-------------------------------------------------------------------------*/ + + /** + * Refreshes the properties of this Process object instance with values + * from the AFS process it represents. All properties that have been + * initialized and/or accessed will be renewed according to the values of + * the AFS process this Process object instance represents. + * + *

    Since in most environments administrative changes can be administered + * from an AFS command-line program or an alternate GUI application, this + * method provides a means to refresh the Java object representation and + * thereby ascertain any possible modifications that may have been made + * from such alternate administrative programs. Using this method before + * an associated instance accessor will ensure the highest level of + * representative accuracy, accommodating changes made external to the + * Java application space. If administrative changes to the underlying AFS + * system are only allowed via this API, then the use of this method is + * unnecessary. + * + * @exception AFSException If an error occurs in the native code + */ + public void refresh() throws AFSException + { + refresh(false); + } + + /** + * Refreshes the properties of this Process object instance with values from + * the AFS process it represents. If all is true + * then all of the properties of this Process object instance will be + * set, or renewed, according to the values of the AFS process it represents, + * disregarding any previously set properties. + * + *

    Thus, if all is false then properties that + * are currently set will be refreshed and properties that are not set will + * remain uninitialized. See {@link #refresh()} for more information. + * + * @param all if true set or renew all object properties; otherwise renew + * all set properties + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + protected void refresh(boolean all) throws AFSException + { + if (all || cachedInfo) refreshInfo(); + } + + /** + * Refreshes the information fields of this Process to reflect + * the current state of the AFS process, such as the start time, the state, + * etc. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshInfo() throws AFSException + { + getProcessInfo( server.getBosHandle(), name, this ); + cachedInfo = true; + startTimeDate = null; + exitTimeDate = null; + exitErrorTimeDate = null; + } + + /** + * Creates this process as a simple process on the server. + * + * @param executionPath the path to the process's executable + * @exception AFSException If an error occurs in the native code + */ + public void createSimple( String executionPath ) throws AFSException + { + create( server.getBosHandle(), name, SIMPLE_PROCESS, executionPath, null, + null ); + } + + /** + * Creates this process as a file server process on the server. + * + * @param executionPath the path to the process's executable + * @exception AFSException If an error occurs in the native code + */ + public void createFS( String executionPath ) throws AFSException + { + create( server.getBosHandle(), name, FS_PROCESS, executionPath, null, + null ); + } + + /** + * Creates this process as a cron process on the server. + * + * @param executionPath the path to the process's executable + * @param cronTime a String representing the time a cron process is + * to be run. Acceptable formats are:

      + *
    • for daily restarts: "23:10" or "11:10 pm"
    • + *
    • for weekly restarts: "sunday 11:10pm" or + * "sun 11:10pm"
    • + *
    + * @exception AFSException If an error occurs in the native code + */ + public void createCron( String executionPath, String cronTime ) + throws AFSException + { + create( server.getBosHandle(), name, CRON_PROCESS, executionPath, + cronTime, null ); + } + + /** + * Removes this process from the bos server + * + * @exception AFSException If an error occurs in the native code + */ + public void delete() throws AFSException + { + delete( server.getBosHandle(), name ); + } + + /** + * Stops this process. + * + * @exception AFSException If an error occurs in the native code + */ + public void stop() throws AFSException + { + state = STOPPING; + goal = STOPPED; + stop( server.getBosHandle(), name ); + } + + /** + * Starts this process + * + * @exception AFSException If an error occurs in the native code + */ + public void start() throws AFSException + { + state = STARTING; + start( server.getBosHandle(), name ); + } + + /** + * Restarts this process + * + * @exception AFSException If an error occurs in the native code + */ + public void restart() throws AFSException + { + state = STARTING; + restart( server.getBosHandle(), name ); + } + + //////////////// accessors: //////////////////////// + + /** + * Returns the name of this process. + * + * @return the name of this process + */ + public String getName() + { + return name; + } + + /** + * Returns the server hosting this process. + * + * @return this process' server + */ + public Server getServer() + { + return server; + } + + /** + * Returns the process type. Possible values are:
      + *
    • {@link #SIMPLE_PROCESS}
    • + *
    • {@link #FS_PROCESS}
    • + *
    • {@link #CRON_PROCESS}
    + * + * @return the process type + * @exception AFSException If an error occurs in the native code + */ + public int getType() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return type; + } + + /** + * Returns the process goal. Possible values are:
      + *
    • {@link #STOPPED}
    • + *
    • {@link #RUNNING}
    • + *
    • {@link #STARTING}
    • + *
    • {@link #STOPPING}
    + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return the process goal + * @exception AFSException If an error occurs in the native code + */ + public int getGoal() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return goal; + } + + /** + * Returns the process execution state. Possible values are:
      + *
    • {@link #STOPPED}
    • + *
    • {@link #RUNNING}
    • + *
    • {@link #STARTING}
    • + *
    • {@link #STOPPING}
    + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return the process execution state + * @exception AFSException If an error occurs in the native code + */ + public int getState() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return state; + } + + /** + * Returns the most recent start time of this process. A + * null value + * indicates no start time. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return the start time + * @exception AFSException If an error occurs in the native code + */ + public long getStartTime() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return startTime; + } + + /** + * Returns the most recent start time of this process. A null + * value indicates no start time. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return the start time + * @exception AFSException If an error occurs in the native code + */ + public GregorianCalendar getStartTimeDate() throws AFSException + { + if (!cachedInfo) { + refreshInfo(); + } + if( startTimeDate == null && startTime != 0 ) { + // make it into a date . . . + startTimeDate = new GregorianCalendar(); + long longTime = startTime * 1000; + Date d = new Date( longTime ); + startTimeDate.setTime( d ); + } + return startTimeDate; + } + + /** + * Returns the number of starts of the process. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return the number of starts + * @exception AFSException If an error occurs in the native code + */ + public long getNumberOfStarts() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return numberStarts; + } + + /** + * Returns the most recent exit time of this process. A null + * value indicates no exit time. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return the exit time + * @exception AFSException If an error occurs in the native code + */ + public long getExitTime() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return exitTime; + } + + /** + * Returns the most recent exit time of this process. A null + * value indicates no exit time + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return the exit time + * @exception AFSException If an error occurs in the native code + */ + public GregorianCalendar getExitTimeDate() throws AFSException + { + if (!cachedInfo) refreshInfo(); + if( exitTimeDate == null && exitTime != 0 ) { + // make it into a date . . . + exitTimeDate = new GregorianCalendar(); + long longTime = exitTime*1000; + Date d = new Date( longTime ); + exitTimeDate.setTime( d ); + } + return exitTimeDate; + } + + /** + * Returns the most recent time this process exited with an error. A + * null value indicates no exit w/ error time. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return the exit w/ error time + * @exception AFSException If an error occurs in the native code + */ + public long getExitErrorTime() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return exitErrorTime; + } + + /** + * Returns the most recent time this process exited with an error. A < + * code>null value indicates no exit w/ error time. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return the exit w/ error time + * @exception AFSException If an error occurs in the native code + */ + public GregorianCalendar getExitErrorTimeDate() throws AFSException + { + if (!cachedInfo) refreshInfo(); + if (exitErrorTimeDate == null && exitErrorTime != 0) { + // make it into a date . . . + exitErrorTimeDate = new GregorianCalendar(); + long longTime = exitErrorTime*1000; + Date d = new Date( longTime ); + exitErrorTimeDate.setTime( d ); + } + return exitErrorTimeDate; + } + + /** + * Returns the error code of the process. A value of 0 indicates + * no error code. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return the error code + * @exception AFSException If an error occurs in the native code + */ + public long getErrorCode() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return errorCode; + } + + /** + * Returns the error signal of the process. A value of 0 indicates no + * error signal. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return the error signal + * @exception AFSException If an error occurs in the native code + */ + public long getErrorSignal() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return errorSignal; + } + + /** + * Returns whether or not the state of the process is ok. A value of + * false indicates there has been a core dump. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return whether or not the state is ok + * @exception AFSException If an error occurs in the native code + */ + public boolean getStateOk() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return stateOk; + } + + /** + * Returns whether or not the state of the process indicates too many errors. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return whether or not the state indicates too many errors + * @exception AFSException If an error occurs in the native code + */ + public boolean getStateTooManyErrors() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return stateTooManyErrors; + } + + /** + * Returns whether or not the state of the process indicates bad file access. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return whether or not the state indicates bad file access + * @exception AFSException If an error occurs in the native code + */ + public boolean getStateBadFileAccess() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return stateBadFileAccess; + } + + /////////////// custom information methods //////////////////// + + /** + * Returns a String representation of this Process. + * Contains the information fields. + * + * @return a String representation of the Process + */ + protected String getInfo() + { + String r; + try { + + r = "Process: " + name + "\n"; + + r += "\ttype: "; + switch( getType() ) { + case SIMPLE_PROCESS: + r += "simple"; + break; + case FS_PROCESS: + r += "fs"; + break; + case CRON_PROCESS: + r += "cron"; + break; + default: + r += "other - " + getType(); + } + r += "\n"; + + r += "\tstate: "; + switch( getState() ) { + case STOPPED: + r += "stopped"; + break; + case RUNNING: + r += "running"; + break; + case STOPPING: + r += "stopping"; + break; + case STARTING: + r += "starting"; + break; + default: + r += "other - " + getState(); + } + r += "\n"; + + r += "\tgoal: "; + switch( getGoal() ) { + case STOPPED: + r += "stopped"; + break; + case RUNNING: + r += "running"; + break; + case STOPPING: + r += "stopping"; + break; + case STARTING: + r += "starting"; + break; + default: + r += "other - " + getGoal(); + } + r += "\n"; + + r += "\tstartTime: "; + if( getStartTime() == 0) { + r += "0"; + } else { + r += getStartTimeDate().getTime(); + } + r += "\n"; + + r += "\tnumberStarts: " + getNumberOfStarts() + "\n"; + + r += "\texitTime: "; + if( getExitTime() == 0 ) { + r += "0"; + } else { + r += getExitTimeDate().getTime(); + } + r += "\n"; + + r += "\texitErrorTime: "; + if( getExitErrorTimeDate() == null ) { + r += "0"; + } else { + r += getExitErrorTimeDate().getTime(); + } + r += "\n"; + + r += "\terrorCode: " + getErrorCode() + "\n"; + r += "\terrorSignal: " + getErrorSignal() + "\n"; + r += "\tstateOk: " + getStateOk() + "\n"; + r += "\tstateTooManyErrors: " + getStateTooManyErrors() + "\n"; + r += "\tstateBadFileAccess: " + getStateBadFileAccess() + "\n"; + + } catch( Exception e ) { + return e.toString(); + } + return r; + } + + /////////////// custom override methods //////////////////// + + /** + * Compares two Process objects respective to their names and does not + * factor any other attribute. Alphabetic case is significant in + * comparing names. + * + * @param process The Process object to be compared to this Process + * instance + * + * @return Zero if the argument is equal to this Process' name, a + * value less than zero if this Process' name is + * lexicographically less than the argument, or a value greater + * than zero if this Process' name is lexicographically + * greater than the argument + */ + public int compareTo(Process process) + { + return this.getName().compareTo(process.getName()); + } + + /** + * Comparable interface method. + * + * @see #compareTo(Process) + */ + public int compareTo(Object obj) + { + return compareTo((Process)obj); + } + + /** + * Tests whether two Process objects are equal, based on their + * names and hosting server. + * + * @param otherProcess the Process to test + * @return whether the specifed Process is the same as this Process + */ + public boolean equals( Process otherProcess ) + { + return ( name.equals(otherProcess.getName()) ) && + ( this.getServer().equals(otherProcess.getServer()) ); + } + + /** + * Returns the name of this Process + * + * @return the name of this Process + */ + public String toString() + { + return getName(); + } + + /////////////// native methods //////////////////// + + /** + * Fills in the information fields of the provided Process. + * + * @param cellHandle the handle of the cell to which the process belongs + * @see Cell#getCellHandle + * @param processName the instance name of the process for which to get + * the information + * @param theProcess the {@link Process Process} object in which to fill + * in the information + * @exception AFSException If an error occurs in the native code + */ + protected static native void getProcessInfo( int cellHandle, + String processName, + Process theProcess ) + throws AFSException; + + /** + * Creates a processes on a server. + * + * @param serverHandle the bos handle of the server to which the key will + * belong + * @see Server#getBosServerHandle + * @param processName the instance name to give the process. See AFS + * documentation for a standard list of instance names + * @param processType the type of process this will be. + * Acceptable values are:
      + *
    • {@link #SIMPLE_PROCESS}
    • + *
    • {@link #FS_PROCESS}
    • + *
    • {@link #CRON_PROCESS}
    + * @param executionPath the execution path process to create + * @param cronTime a String representing the time a cron process is to + * be run. Acceptable formats are:
      + *
    • for daily restarts: "23:10" or "11:10 pm"
    • + *
    • for weekly restarts: "sunday 11:10pm" or + * "sun 11:10pm"
    • + *
    + * Can be null for non-cron processes. + * @param notifier the execution path to a notifier program that should + * be called when the process terminates. Can be + * null + * @exception AFSException If an error occurs in the native code + */ + protected static native void create( int serverHandle, String processName, + int processType, String executionPath, + String cronTime, String notifier ) + throws AFSException; + + /** + * Removes a process from a server. + * + * @param serverHandle the bos handle of the server to which the process + * belongs + * @see Server#getBosServerHandle + * @param processName the name of the process to remove + * @exception AFSException If an error occurs in the native code + */ + protected static native void delete( int serverHandle, String processName ) + throws AFSException; + + /** + * Start this process. + * + * @param serverHandle the bos handle of the server to which the process + * belongs + * @see Server#getBosServerHandle + * @param processName the name of the process to start + * @exception AFSException If an error occurs in the native code + */ + protected static native void start( int serverHandle, String processName ) + throws AFSException; + + /** + * Retart this process. + * + * @param serverHandle the bos handle of the server to which the process + * belongs + * @see Server#getBosServerHandle + * @param processName the name of the process to restart + * @exception AFSException If an error occurs in the native code + */ + protected static native void restart( int serverHandle, String processName ) + throws AFSException; + + /** + * Stop this process. + * + * @param serverHandle the bos handle of the server to which the process + * belongs + * @see Server#getBosServerHandle + * @param processName the name of the process to stop + * @exception AFSException If an error occurs in the native code + */ + protected static native void stop( int serverHandle, String processName ) + throws AFSException; + + /** + * Reclaims all memory being saved by the process portion of the native + * library. This method should be called when no more Process + * objects are expected to be used. + */ + protected static native void reclaimProcessMemory(); +} + + + + + + + diff --git a/src/JAVA/classes/org/openafs/jafs/Server.java b/src/JAVA/classes/org/openafs/jafs/Server.java new file mode 100644 index 000000000..144663412 --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/Server.java @@ -0,0 +1,2351 @@ +/* + * @(#)Server.java 1.0 6/29/2001 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.io.Serializable; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.GregorianCalendar; + +/** + * An abstract representation of an AFS server. It holds information about + * the server, such as what its processes are. + *

    + * + * Constructing an instance of a Server does not mean an actual + * AFS server is created and added to a cell -- on the contrary, a + * Server object must be a representation of an already existing + * AFS server. There is no way to create a new AFS server through this API. + * See OpenAFS.org for information on how + * to create a new AFS server.

    + * + * A Server object may represent either an AFS file server, + * an AFS database server, or both if the same machine serves both + * purposes.

    + * + * Each Server object has its own individual set of + * Partitions, Processes, and Keys. + * This represents the properties and attributes of an actual AFS server. + *

    + * + * + * The following is a simple example of how to construct and use a Server + * object. This example constructs a Server using the + * Cell representing teh AFS cell to which the server belongs, + * and prints out the names of all the partitions residing on the server. + *

    + * + *
    + * import org.openafs.jafs.Cell;
    + * import org.openafs.jafs.AFSException;
    + * import org.openafs.jafs.Partition;
    + * import org.openafs.jafs.Server;
    + * ...
    + * public class ...
    + * {
    + *   ...
    + *   private Cell cell;
    + *   private Server server;
    + *   ...
    + *   public static void main(String[] args) throws Exception
    + *   {
    + *     String username   = arg[0];
    + *     String password   = arg[1];
    + *     String cellName   = arg[2];
    + *     String serverName = arg[3];
    + * 
    + *     token = new Token(username, password, cellName);
    + *     cell   = new Cell(token);
    + *     server = new Server(serverName, cell);
    + * 
    + *     System.out.println("Partitions in Server " + server.getName() + ":");
    + *     if( server.isFileServer() ) {
    + *       Partition[] partitions = server.getPartitions();
    + *       for (int i = 0; i < partitions.length; i++) {
    + *         System.out.println(" -> " + partitions[i]);
    + *       }
    + *     }
    + *   }
    + *   ...
    + * }
    + * 
    + * + */ +public class Server implements Serializable, Comparable +{ + /** + * Used for binary restart time types. + */ + private static final int RESTART_BINARY = 0; + + /** + * Used for general restart time types. + */ + private static final int RESTART_GENERAL = 1; + + protected String name; + protected Cell cell; + + protected int vosHandle; + protected int bosHandle; + + protected boolean database; + protected boolean fileServer; + + // these will be true if the machine is supposedly listed as a server + // but that's wrong, or the machine is down + protected boolean badFileServer; + protected boolean badDatabase; + + // String IP Address of address[0] + protected String[] ipAddresses; + + protected ArrayList partitionNames; + protected ArrayList partitions; + protected ArrayList adminNames; + protected ArrayList admins; + protected ArrayList keys; + protected ArrayList processNames; + protected ArrayList processes; + + // Storage information + protected int totalSpace; + protected int totalQuota; + protected int totalFreeSpace; + protected int totalUsedSpace; + + protected ExecutableTime genRestartTime; + protected ExecutableTime binRestartTime; + + protected boolean cachedInfo; + + /** + * Constructs a new Server object instance given the + * name of the AFS server and the AFS cell, represented by + * cell, to which it belongs. This does not actually + * create a new AFS server, it just represents an existing one. + * If name is not an actual AFS server, exceptions + * will be thrown during subsequent method invocations on this + * object. + * + * @param name the name of the server to represent + * @param cell the cell to which the server belongs. + * @exception AFSException If an error occurs in the native code + */ + public Server( String name, Cell cell ) throws AFSException + { + this.name = name; + this.cell = cell; + + cachedInfo = false; + + vosHandle = 0; + bosHandle = 0; + + ipAddresses = new String[16]; + + partitionNames = null; + partitions = null; + adminNames = null; + admins = null; + keys = null; + processNames = null; + processes = null; + } + + /** + * Constructs a new Server object instance given the name + * of the AFS server and the AFS cell, represented by cell, + * to which it belongs. This does not actually + * create a new AFS server, it just represents an existing one. + * If name is not an actual AFS server, exceptions + * will be thrown during subsequent method invocations on this + * object. + * + *

    This constructor is ideal for point-in-time representation and + * transient applications. It ensures all data member values are set + * and available without calling back to the filesystem at the first + * request for them. Use the {@link #refresh()} method to address any + * coherency concerns. + * + * @param name the name of the server to represent + * @param cell the cell to which the server belongs. + * @param preloadAllMembers true will ensure all object members are + * set upon construction; + * otherwise members will be set upon access, + * which is the default behavior. + * @exception AFSException If an error occurs in the native code + * @see #refresh + */ + public Server( String name, Cell cell, boolean preloadAllMembers ) + throws AFSException + { + this(name, cell); + if (preloadAllMembers) refresh(true); + } + + /** + * Constructs a blank Server object instance given the cell to + * which the server belongs. This blank object can then be passed into + * other methods to fill out its properties. + * + * @param cell the cell to which the server belongs. + * @exception AFSException If an error occurs in the native code + */ + Server( Cell cell ) throws AFSException + { + this( null, cell ); + } + + /*-------------------------------------------------------------------------*/ + + /** + * Refreshes the properties of this Server object instance with values + * from the AFS server it represents. All properties that have been + * initialized and/or accessed will be renewed according to the values + * of the AFS server this Server object instance represents. + * + *

    Since in most environments administrative changes can be administered + * from an AFS command-line program or an alternate GUI application, this + * method provides a means to refresh the Java object representation and + * thereby ascertain any possible modifications that may have been made + * from such alternate administrative programs. Using this method before + * an associated instance accessor will ensure the highest level of + * representative accuracy, accommodating changes made external to the + * Java application space. If administrative changes to the underlying AFS + * system are only allowed via this API, then the use of this method is + * unnecessary. + * + * @exception AFSException If an error occurs in the native code + */ + public void refresh() throws AFSException + { + refresh(false); + } + + /** + * Refreshes the properties of this Server object instance with values + * from the AFS server it represents. If all is + * true then all of the properties of this Server + * object instance will be set, or renewed, according to the values of the + * AFS server it represents, disregarding any previously set properties. + * + *

    Thus, if all is false then properties that + * are currently set will be refreshed and properties that are not set + * will remain uninitialized. + * See {@link #refresh()} for more information. + * + * @param all if true set or renew all object properties; + * otherwise renew all set properties + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + protected void refresh(boolean all) throws AFSException + { + if ( all ) { + refreshProcesses(); + refreshProcessNames(); + refreshKeys(); + refreshAdminNames(); + refreshAdmins(); + refreshPartitionNames(); + refreshPartitions(all); + refreshInfo(); + refreshGeneralRestart(); + refreshBinaryRestart(); + } else { + if ( processes != null ) refreshProcesses(); + if ( processNames != null ) refreshProcessNames(); + if ( keys != null ) refreshKeys(); + if ( adminNames != null ) refreshAdminNames(); + if ( admins != null ) refreshAdmins(); + if ( partitionNames != null ) refreshPartitionNames(); + if ( partitions != null ) refreshPartitions(all); + if ( genRestartTime != null ) refreshGeneralRestart(); + if ( binRestartTime != null ) refreshBinaryRestart(); + if ( cachedInfo ) refreshInfo(); + } + } + + /** + * Refreshes the information fields of this Server to + * reflect the current state of the AFS server. These fields include + * the IP addresses and the fileserver types. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshInfo() throws AFSException + { + getServerInfo( cell.getCellHandle(), name, this ); + cachedInfo = true; + } + + /** + * Refreshes the general restart time fields of this Server + * to reflect the current state of the AFS server. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshGeneralRestart() throws AFSException + { + if (genRestartTime == null) genRestartTime = new ExecutableTime(); + getRestartTime( getBosHandle(), RESTART_GENERAL, genRestartTime ); + } + + /** + * Refreshes the binary restart time fields of this Server + * to reflect the current state of the AFS server. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshBinaryRestart() throws AFSException + { + if (binRestartTime == null) binRestartTime = new ExecutableTime(); + getRestartTime( getBosHandle(), RESTART_BINARY, binRestartTime ); + } + + /** + * Obtains the most current list of Partition objects + * of this server. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshPartitions() throws AFSException + { + this.refreshPartitions(false); + } + + /** + * Obtains the most current list of Partition objects of + * this server. + * + * @param refreshVolumes force all volumes contained in each + * partition to be refreshed. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshPartitions(boolean refreshVolumes) + throws AFSException + { + if (!isFileServer() || isBadFileServer()) return; + + Partition currPartition; + + int iterationID = getPartitionsBegin( cell.getCellHandle(), + getVosHandle() ); + + partitions = new ArrayList(); + + currPartition = new Partition( this ); + while( getPartitionsNext( iterationID, currPartition ) != 0 ) { + //Only volumes are necessary since volume information + //is populated at time of construction + if (refreshVolumes) currPartition.refreshVolumes(); + partitions.add( currPartition ); + currPartition = new Partition( this ); + } + getPartitionsDone( iterationID ); + totalSpace = 0; + totalQuota = 0; + totalUsedSpace = 0; + totalFreeSpace = 0; + } + + /** + * Obtains the most current list of partition names of this server. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshPartitionNames() throws AFSException + { + if (!isFileServer() || isBadFileServer()) return; + + String currName; + + int iterationID = getPartitionsBegin( cell.getCellHandle(), + getVosHandle() ); + + partitionNames = new ArrayList(); + + while( ( currName = getPartitionsNextString( iterationID ) ) != null ) { + partitionNames.add( currName ); + } + getPartitionsDone( iterationID ); + } + + /** + * Obtains the most current list of bos admin names of this server. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshAdminNames() throws AFSException + { + String currName; + + int iterationID = getBosAdminsBegin( getBosHandle() ); + + adminNames = new ArrayList(); + + while( ( currName = getBosAdminsNextString( iterationID ) ) != null ) { + adminNames.add( currName ); + } + getBosAdminsDone( iterationID ); + } + + /** + * Obtains the most current list of admin User objects of + * this server. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshAdmins() throws AFSException + { + User currUser; + + int iterationID = getBosAdminsBegin( getBosHandle() ); + + admins = new ArrayList(); + + currUser = new User( cell ); + while( getBosAdminsNext( cell.getCellHandle(), iterationID, currUser ) + != 0 ) { + admins.add( currUser ); + currUser = new User( cell ); + } + getBosAdminsDone( iterationID ); + } + + /** + * Obtains the most current list of Key objects of this server. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshKeys() throws AFSException + { + Key currKey; + + int iterationID = getKeysBegin( getBosHandle() ); + + keys = new ArrayList(); + + currKey = new Key( this ); + while( getKeysNext( iterationID, currKey ) != 0 ) { + keys.add( currKey ); + currKey = new Key( this ); + } + getKeysDone( iterationID ); + } + + /** + * Obtains the most current list of process names of this server. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshProcessNames() throws AFSException + { + String currName; + + int iterationID = getProcessesBegin( getBosHandle() ); + + processNames = new ArrayList(); + + while( ( currName = getProcessesNextString( iterationID ) ) != null ) { + processNames.add( currName ); + } + getProcessesDone( iterationID ); + } + + /** + * Obtains the most current list of Process objects of + * this server. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshProcesses() throws AFSException + { + Process currProcess; + + int iterationID = getProcessesBegin( getBosHandle() ); + + processes = new ArrayList(); + + currProcess = new Process( this ); + while( getProcessesNext( getBosHandle(), iterationID, currProcess ) + != 0 ) { + processes.add( currProcess ); + currProcess = new Process( this ); + } + getProcessesDone( iterationID ); + } + + /** + * Add a bos admin to the UserList file of this server, in order to + * given the AFS user represented by admin full bos + * administrative privileges on this server. + * + * @param admin the admin to add + * @exception AFSException If an error occurs in the native code + */ + public void addAdmin( User admin ) throws AFSException + { + String adminName = admin.getName(); + + addBosAdmin( getBosHandle(), adminName ); + if ( adminNames != null ) { + adminNames.add( adminName ); + } + } + + /** + * Remove a bos admin from the UserList file of this server, in order to + * take away from the AFS user represented by admin bos + * administrative privileges on this machine. + * + * @param admin the admin to remove + * @exception AFSException If an error occurs in the native code + */ + public void removeAdmin( User admin ) throws AFSException + { + String adminName = admin.getName(); + + removeBosAdmin( getBosHandle(), adminName ); + if ( adminNames != null ) { + adminNames.remove( adminNames.indexOf( adminName ) ); + adminNames.trimToSize(); + } + } + + /** + * Syncs this server to the VLDB. + * + * @exception AFSException If an error occurs in the native code + */ + public void syncServer() throws AFSException + { + syncServerWithVLDB( cell.getCellHandle(), getVosHandle(), -1 ); + } + + /** + * Syncs the VLDB to this server. + * + * @exception AFSException If an error occurs in the native code + */ + public void syncVLDB() throws AFSException + { + syncVLDBWithServer( cell.getCellHandle(), getVosHandle(), -1, false ); + } + + /** + * Salvages (restores consistency to) this server. Uses default values for + * most salvager options in order to simplify the API. + * + * @exception AFSException If an error occurs in the native code + */ + public void salvage() throws AFSException + { + salvage( cell.getCellHandle(), getBosHandle(), null, null, 4, null, null, + false, false, false, false, false, false ); + } + + /** + * Starts up all bos processes on this server. + * + * @exception AFSException If an error occurs in the native code + */ + public void startAllProcesses() throws AFSException + { + startAllProcesses( getBosHandle() ); + } + + /** + * Stops all bos processes on this server. + * + * @exception AFSException If an error occurs in the native code + */ + public void stopAllProcesses() throws AFSException + { + stopAllProcesses( getBosHandle() ); + } + + /** + * Restarts all bos processes on this server. + * + * @exception AFSException If an error occurs in the native code + */ + public void restartAllProcesses() throws AFSException + { + restartAllProcesses( getBosHandle(), false ); + } + + /** + * Restarts bos server and all bos processes on this server. + * + * @exception AFSException If an error occurs in the native code + */ + public void restartBosServer() throws AFSException + { + restartAllProcesses( getBosHandle(), true ); + } + + /** + * Gets the contents of a log file, in one large String. + * The log cannot be in AFS file space. + * + * @return a String containing the contents of the log file + * @exception AFSException If an error occurs in the native code + */ + public String getLog( String logLocation ) throws AFSException + { + return getLog( getBosHandle(), logLocation ); + } + + /** + * Unauthenticates all server-related tokens that have been obtained by + * this Server object, and shuts this server object down. + * This method should only be called when this Server or any + * of the objects constructed using this Server will not be + * used anymore. Note that this does not effect the actual AFS server; + * it merely closes the representation. + * + * @exception AFSException If an error occurs in the native code + */ + public void close() throws AFSException + { + if ( vosHandle != 0 ) { + closeVosServerHandle( vosHandle ); + } + if ( bosHandle != 0 ) { + closeBosServerHandle( bosHandle ); + } + + cachedInfo = false; + + vosHandle = 0; + bosHandle = 0; + + partitionNames = null; + partitions = null; + adminNames = null; + admins = null; + keys = null; + processNames = null; + processes = null; + } + + //////////////// accessors: //////////////////////// + + /** + * Returns the name of this server. + * + * @return the name of this server + */ + public String getName() + { + return name; + } + + /** + * Returns the Cell object with which this Server + * was constructed. It represents the actual AFS cell to which this + * server belongs. + * + * @return this server's cell + */ + public Cell getCell() + { + return cell; + } + + /** + * Returns the number of BOS administrators assigned to this server. + * + *

    If the total list of admins or admin names have already been + * collected (see {@link #getAdmins()}), then the returning value will + * be calculated based upon the current list. Otherwise, AFS will be + * explicitly queried for the information. + * + *

    The product of this method is not saved, and is recalculated + * with every call. + * + * @return the number of admins on this server. + * @exception AFSException If an error occurs + * in any of the associated native methods + * @see #getAdmins() + * @see #getAdminNames() + */ + public int getAdminCount() throws AFSException + { + if (adminNames != null) { + return adminNames.size(); + } else if (admins != null) { + return admins.size(); + } else { + return getBosAdminCount(getBosHandle()); + } + } + + /** + * Retrieves an array containing all of the admin User objects + * associated with this Server, each of which are an abstract + * representation of an actual bos administrator of the AFS server. + * After this method is called once, it saves the array of + * Users and returns that saved array on subsequent calls, + * until the {@link #refresh()} method is called and a more current list + * is obtained. + * + * @return a User array of the admins of the server. + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public User[] getAdmins() throws AFSException + { + if ( admins == null ) refreshAdmins(); + return (User[]) admins.toArray( new User[admins.size()] ); + } + + /** + * Retrieves an array containing all of the names of bos admins + * associated with this Server. After this method + * is called once, it saves the array of Strings and returns + * that saved array on subsequent calls, until the {@link #refresh()} method + * is called and a more current list is obtained. + * + * @return a String array of the bos admin of the server. + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public String[] getAdminNames() throws AFSException + { + if ( adminNames == null ) refreshAdminNames(); + return (String []) adminNames.toArray( new String[adminNames.size()] ); + } + + /** + * Returns the number of partitions on this server. + * + *

    If the total list of partitions or partition names have already been + * collected (see {@link #getPartitions()}), then the returning value will + * be calculated based upon the current list. Otherwise, AFS will be + * explicitly queried for the information. + * + *

    The product of this method is not saved, and is recalculated + * with every call. + * + * @return the number of partitions on this server. + * @exception AFSException If an error occurs + * in any of the associated native methods + * @see #getPartitions() + * @see #getPartitionNames() + */ + public int getPartitionCount() throws AFSException + { + if (partitionNames != null) { + return partitionNames.size(); + } else if (partitions != null) { + return partitions.size(); + } else { + return getPartitionCount(cell.getCellHandle(), getVosHandle()); + } + } + + /** + * Retrieves the Partition object (which is an abstract + * representation of an actual AFS partition of this server) designated + * by name (i.e. "/vicepa", etc.). If a partition by + * that name does not actually exist in AFS on the server + * represented by this object, an {@link AFSException} will be + * thrown. + * + * @param name the name of the partition to retrieve + * @return Partition designated by name. + * @exception AFSException If an error occurs in the native code + * @exception NullPointerException If name is + * null. + */ + public Partition getPartition(String name) throws AFSException + { + if (name == null) throw new NullPointerException(); + if (isFileServer() && !isBadFileServer()) { + Partition partition = new Partition(name, this); + partition.refresh(true); + return partition; + } else { + //Throw "No such entry" error + throw new AFSException("Server is not a file server.", 363524); + } + } + + /** + * Retrieves an array containing all of the Partition objects + * associated with this Server, each of which are an abstract + * representation of an actual AFS partition of the AFS server. + * After this method is called once, it saves the array of + * Partitions and returns that saved array on subsequent calls, + * until the {@link #refresh()} method is called and a more current list + * is obtained. + * + * @return a Partition array of the Partition + * objects of the server. + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public Partition[] getPartitions() throws AFSException + { + if ( partitions == null ) refreshPartitions(); + return (Partition []) + partitions.toArray( new Partition[partitions.size()] ); + } + + /** + * Retrieves an array containing all of the names of partitions + * associated with this Server (i.e. "vicepa", etc.). + * After this method is called once, it saves the array of + * Strings and returns that saved array on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * list is obtained. + * + * @return a String array of the partitions of the server. + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public String[] getPartitionNames() throws AFSException + { + if ( partitionNames == null ) refreshPartitionNames(); + return (String []) + partitionNames.toArray( new String[partitionNames.size()] ); + } + + /** + * Retrieves the Key object (which is an abstract + * representation of an actual AFS partition of this server) designated + * by nkeyVersion. If a key with + * that version does not actually exist in AFS on the server + * represented by this object, null is returned. + * + * @param keyVersion the version of the key to retrieve + * @return Key designated by keyVersion. + * @exception AFSException If an error occurs in the native code + */ + public Key getKey(int keyVersion) throws AFSException + { + try { + Key[] keys = this.getKeys(); + for (int i = 0; i < keys.length; i++) { + if (keys[i].getVersion() == keyVersion) { + return keys[i]; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * Returns the number of keys on this server. + * + *

    If the total list of keys has already been + * collected (see {@link #getKeys()}), then the returning value will + * be calculated based upon the current list. Otherwise, AFS will be + * explicitly queried for the information. + * + *

    The product of this method is not saved, and is recalculated + * with every call. + * + * @return the number of keys on this server. + * @exception AFSException If an error occurs + * in any of the associated native methods + * @see #getKeys() + */ + public int getKeyCount() throws AFSException + { + if (keys != null) { + return keys.size(); + } else { + return getKeyCount(getBosHandle()); + } + } + + /** + * Retrieves an array containing all of the Key objects + * associated with this Server, each of which are an abstract + * representation of an actual AFS key of the AFS server. + * After this method is called once, it saves the array of + * Keys and returns that saved array on subsequent calls, + * until the {@link #refresh()} method is called and a more current list + * is obtained. + * + * @return a Key array of the Key objects + * of the server. + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public Key[] getKeys() throws AFSException + { + if ( keys == null ) refreshKeys(); + return (Key[]) keys.toArray( new Key[keys.size()] ); + } + + /** + * Retrieves the Process object (which is an abstract + * representation of an actual AFS process of this server) designated + * by name (i.e. "kaserver", etc.). If a process by + * that name does not actually exist in AFS on the server + * represented by this object, an {@link AFSException} will be + * thrown. + * + * @param name the name of the process to retrieve + * @return Process designated by name. + * @exception AFSException If an error occurs in the native code + * @exception NullPointerException If name is + * null. + */ + public Process getProcess(String name) throws AFSException + { + if (name == null) throw new NullPointerException(); + //if (isFileServer() && !isBadFileServer()) { + Process process = new Process(name, this); + process.refresh(true); + return process; + //} + } + + /** + * Returns the number of processes hosted by this server. + * + *

    If the total list of processes or process names have already been + * collected (see {@link #getProcesses()}), then the returning value will + * be calculated based upon the current list. Otherwise, AFS will be + * explicitly queried for the information. + * + *

    The product of this method is not saved, and is recalculated + * with every call. + * + * @return the number of processes on this server. + * @exception AFSException If an error occurs + * in any of the associated native methods + * @see #getProcesses() + * @see #getProcessNames() + */ + public int getProcessCount() throws AFSException + { + if (processNames != null) { + return processNames.size(); + } else if (processes != null) { + return processes.size(); + } else { + return getProcessCount(getBosHandle()); + } + } + + /** + * Retrieves an array containing all of the Process objects + * associated with this Server, each of which are an abstract + * representation of an actual AFS process of the AFS server. + * After this method is called once, it saves the array of + * Processes and returns that saved array on subsequent calls, + * until the {@link #refresh()} method is called and a more current list + * is obtained. + * + * @return a Process array of the Process + * objects of the server. + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public Process[] getProcesses() throws AFSException + { + if ( processes == null ) refreshProcesses(); + return (Process[]) processes.toArray( new Process[processes.size()] ); + } + + /** + * Retrieves an array containing all of the names of processes + * associated with this Server (i.e. "kaserver", etc.). + * After this method is called once, it saves the array of + * Strings and returns that saved array on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * list is obtained. + * + * @return a String array of the processes of the server. + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public String[] getProcessNames() throws AFSException + { + if ( processNames == null ) refreshProcessNames(); + return (String[]) processNames.toArray( new String[processNames.size()] ); + } + + /** + * Returns whether or not this server is a database machine, meaning it runs + * processes such as the "kaserver" and "vlserver", and participates in + * elections. + * + * @return whether or not this user this server is a database machine. + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public boolean isDatabase() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return database; + } + + /** + * Returns whether or not this server is a file server machine, meaning it + * runs the "fs" process and stores AFS volumes. + * + * @return whether or not this user this server is a file server machine. + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public boolean isFileServer() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return fileServer; + } + + /** + * Returns whether or not this server is a database machine AND + * either it isn't in reality (e.g. it's incorrectly configured) + * or it's currently down. + * + * @return whether or not this server is a database machine + * AND either it isn't in reality or it's currently down + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public boolean isBadDatabase() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return badDatabase; + } + + /** + * Returns whether this machine thinks it's a file server AND + * either it isn't in reality (e.g. it's incorrectly configured) + * or it's currently down. + * + * @return whether or not this server is a file server machine AND + * either it isn't in reality or it's currently down + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public boolean isBadFileServer() throws AFSException + { + if (!cachedInfo) refreshInfo(); + return badFileServer; + } + + /** + * Returns this server's IP address as a String. It returns it in + * dotted quad notation (i.e. 123.123.123.123). + * + * @return this server's IP address as a String + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public String[] getIPAddresses() throws AFSException + { + if (!cachedInfo) refreshInfo(); + int n = 16; + for (int i = 0; i < n; i++) { + if (ipAddresses[i] == null) { + n = i; + break; + } + } + String[] addresses = new String[n]; + System.arraycopy(ipAddresses, 0, addresses, 0, n); + return addresses; + } + + /** + * Returns the BOS Server's general restart time in the form of an + * ExecutableTime object. This is the time at which the bos server + * restarts itself and all running processes. After this method + * is called once, it saves the time and returns + * that value on subsequent calls, until the {@link #refresh()} method + * is called and a more current value is obtained. + * + * @return the general restart time + * @exception AFSException If an error occurs in the native code + * @see Server.ExecutableTime + * @see #refresh() + */ + public ExecutableTime getGeneralRestartTime() throws AFSException + { + if (genRestartTime == null) refreshGeneralRestart(); + return genRestartTime; + } + + /** + * Returns the BOS Server's binary restart time in the form of an + * ExecutableTime object. This is the time at which all new or newly + * modified AFS binaries are restarted. After this method + * is called once, it saves the time and returns + * that value on subsequent calls, until the {@link #refresh()} method + * is called and a more current value is obtained. + * + * @return the binary restart time + * @exception AFSException If an error occurs in the native code + * @see Server.ExecutableTime + * @see #refresh() + */ + public ExecutableTime getBinaryRestartTime() throws AFSException + { + if (binRestartTime == null) refreshBinaryRestart(); + return binRestartTime; + } + + /** + * Returns the total space on this server (a sum of the space of all the + * partitions associated with this server). If this server is not a + * file server, zero will be returned. After this method + * is called once, it saves the total space and returns + * that value on subsequent calls, until the {@link #refresh()} method + * is called and a more current value is obtained. + * + * @return the total space on this server + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getTotalSpace() throws AFSException + { + if (partitions == null) refreshPartitions(true); + if (!isFileServer() || isBadFileServer()) return 0; + if (totalSpace == 0) { + Partition[] partitions = getPartitions(); + for (int i = 0; i < partitions.length; i++) { + totalSpace += partitions[i].getTotalSpace(); + } + } + return totalSpace; + } + + /** + * Returns the total free space on this server (a sum of the free space of + * all the partitions associated with this server). If this server is not a + * file server, zero will be returned. After this method + * is called once, it saves the total free space and returns + * that value on subsequent calls, until the {@link #refresh()} method + * is called and a more current value is obtained. + * + * @return the total free space on this server + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getTotalFreeSpace() throws AFSException + { + if (partitions == null) refreshPartitions(true); + if (!isFileServer() || isBadFileServer()) return 0; + if (totalFreeSpace == 0) { + Partition[] partitions = getPartitions(); + for (int i = 0; i < partitions.length; i++) { + totalFreeSpace += partitions[i].getTotalFreeSpace(); + } + } + return totalFreeSpace; + } + + /** + * Returns the total used space on this server (a sum of the used space of + * all the partitions associated with this server). If this server is not a + * file server, zero will be returned. After this method + * is called once, it saves the total used space and returns + * that value on subsequent calls, until the {@link #refresh()} method + * is called and a more current value is obtained. + * + * @return the total space on this partition + * @exception AFSException If an error occurs in the native code + * @see #getTotalSpace() + * @see #getTotalFreeSpace() + */ + public int getTotalUsedSpace() throws AFSException + { + if (totalUsedSpace == 0) { + totalUsedSpace = getTotalSpace() - getTotalFreeSpace(); + } + return totalUsedSpace; + } + + /** + * Returns this server's vos handle. + * + * @return this server's vos handle + * @exception AFSException If an error occurs in the native code + */ + protected int getVosHandle() throws AFSException + { + if ( vosHandle == 0 ) { + vosHandle = getVosServerHandle( cell.getCellHandle(), name ); + } + return vosHandle; + } + + /** + * Returns this server's bos handle. + * + * @return this server's bos handle + * @exception AFSException If an error occurs in the native code + */ + protected int getBosHandle() throws AFSException + { + if ( bosHandle == 0 ) { + bosHandle = getBosServerHandle( cell.getCellHandle(), name ); + } + return bosHandle; + } + + //////////////// mutators: //////////////////////// + + /** + * Sets the BOS general restart time. This is the time at which the bos + * server restarts itself and all running processes. + * + * @param executableTime Executable time object that represents what + * the BOS Server's general restart time should be. + * @exception AFSException If an error occurs in the native code + * @see Server.ExecutableTime + */ + public void setGeneralRestartTime( ExecutableTime executableTime ) + throws AFSException + { + this.setRestartTime( getBosHandle(), RESTART_GENERAL, executableTime ); + } + + /** + * Sets the BOS binary restart time. This is the time at which all new + * or newly modified AFS binaries are restarted. + * + * @param executableTime Executable time object that represents what + * the BOS Server's binary restart time should be. + * @exception AFSException If an error occurs in the native code + * @see Server.ExecutableTime + */ + public void setBinaryRestartTime( ExecutableTime executableTime ) + throws AFSException + { + this.setRestartTime( getBosHandle(), RESTART_BINARY, executableTime ); + } + + /////////////// custom information methods //////////////////// + + /** + * Returns a String representation of this Server. + * Contains the information fields and a list of partitions, admin, and + * processes. + * + * @return a String representation of the Server + */ + protected String getInfo() + { + String r; + try { + + r = "Server: " + name + "\n"; + + r += "\tdatabase: " + isDatabase() + "\t\tfileServer: " + + isFileServer() + "\n"; + r += "\tbad database: " + isBadDatabase() + "\tbad fileServer: " + + isBadFileServer() + "\n"; + //r += "\tAddress: " + getIPAddress()[0] + "\n"; + + // restart times: + r += "\tGeneral restart date: " + getGeneralRestartTime() + "\n"; + r += "\tBinary restart date: " + getBinaryRestartTime() + "\n"; + + if ( isFileServer() && !isBadFileServer() ) { + r += "\tPartitions:\n"; + + String parts[] = getPartitionNames(); + + for( int i = 0; i < parts.length; i++ ) { + r += "\t\t" + parts[i] + "\n"; + } + } + + if ( (isDatabase() && !isBadDatabase()) || + (isFileServer() && !isBadFileServer()) ) { + r += "\tAdmins:\n"; + + String ads[] = getAdminNames(); + + for( int i = 0; i < ads.length; i++ ) { + r += "\t\t" + ads[i] + "\n"; + } + } + + if ( (isDatabase() && !isBadDatabase()) || + (isFileServer() && !isBadFileServer()) ) { + r += "\tProcesses:\n"; + + String pros[] = getProcessNames(); + + for( int i = 0; i < pros.length; i++ ) { + r += "\t\t" + pros[i] + "\n"; + } + } + + } catch( Exception e ) { + return e.toString(); + } + return r; + } + + /** + * Returns a String containing the String + * representations of all the partitions of this Server. + * + * @return a String representation of the partitions + * @see Partition#getInfo + */ + protected String getInfoPartitions() throws AFSException + { + String r; + r = "Server: " + name + "\n\n"; + r += "--Partitions--\n"; + + Partition parts[] = getPartitions(); + + for( int i = 0; i < parts.length; i++ ) { + r += parts[i].getInfo() + "\n"; + } + return r; + } + + /** + * Returns a String containing the String + * representations of all the keys of this Server. + * + * @return a String representation of the keys + * @see Key#getInfo + */ + protected String getInfoKeys() throws AFSException + { + String r; + + r = "Server: " + name + "\n\n"; + r += "--Keys--\n"; + + Key kys[] = getKeys(); + + for( int i = 0; i < kys.length; i++ ) { + r += kys[i].getInfo() + "\n"; + } + + return r; + } + + /** + * Returns a String containing the String + * representations of all the processes of this Server. + * + * @return a String representation of the processes + * @see Process#getInfo + */ + protected String getInfoProcesses() throws AFSException + { + String r; + + r = "Server: " + name + "\n\n"; + r += "--Processes--\n"; + + Process pros[] = getProcesses(); + + for( int i = 0; i < pros.length; i++ ) { + r += pros[i].getInfo() + "\n"; + } + return r; + } + + /////////////// custom override methods //////////////////// + + /** + * Compares two Server objects respective to their names and does not + * factor any other attribute. Alphabetic case is significant in + * comparing names. + * + * @param server The Server object to be compared to this + * Server instance + * + * @return Zero if the argument is equal to this Server's name, a + * value less than zero if this Server's name is + * lexicographically less than the argument, or a value greater + * than zero if this Server's name is lexicographically + * greater than the argument + */ + public int compareTo(Server server) + { + return this.getName().compareTo(server.getName()); + } + + /** + * Comparable interface method. + * + * @see #compareTo(Server) + */ + public int compareTo(Object obj) + { + return compareTo((Server)obj); + } + + /** + * Tests whether two Server objects are equal, based on their + * names and hosting Cell. + * + * @param otherServer the Server to test + * @return whether the specifed Server is the same as this Server + */ + public boolean equals( Server otherServer ) + { + return ( name.equals(otherServer.getName()) ) && + ( this.getCell().equals(otherServer.getCell()) ); + } + + /** + * Returns the name of this Server + * + * @return the name of this Server + */ + public String toString() + { + return getName(); + } + + /////////////// native methods //////////////////// + + /** + * Opens a server for administrative vos use, based on the cell handle + * provided. Returns a vos server handle to be used by other + * methods as a means of identification. + * + * @param cellHandle a cell handle previously returned by + * a call to {@link Cell#getCellHandle} + * @param serverName the name of the server for which to retrieve + * a vos handle + * @return a vos handle to the server + * @exception AFSException If an error occurs in the native code + * @see Cell#getCellHandle + */ + protected static native int getVosServerHandle( int cellHandle, + String serverName ) + throws AFSException; + + /** + * Closes the given currently open vos server handle. + * + * @param vosHandle the vos server handle to close + * @exception AFSException If an error occurs in the native code + */ + protected static native void closeVosServerHandle( int vosHandle ) + throws AFSException; + + /** + * Opens a server for administrative bos use, based on the cell handle + * provided. Returns a bos server handle to be used by other methods + * as a means of identification. + * + * @param cellHandle a cell handle previously returned by a call + * to {@link Cell#getCellHandle} + * @param serverName the name of the server for which to retrieve + * a bos handle + * @return a bos handle to the server + * @exception AFSException If an error occurs in the native code + * @see Cell#getCellHandle + */ + protected static native int getBosServerHandle( int cellHandle, + String serverName ) + throws AFSException; + + /** + * Closes the given currently open bos server handle. + * + * @param bosHandle the bos server handle to close + * @exception AFSException If an error occurs in the native code + */ + protected static native void closeBosServerHandle( int bosHandle ) + throws AFSException; + + /** + * Fills in the information fields of the provided Server. + * + * @param cellHandle the handle of the cell to which the server belongs + * @see Cell#getCellHandle + * @param name the name of the server for which to get the information + * @param server the Server object in which to fill in + * the information + * @see Server + * @exception AFSException If an error occurs in the native code + */ + protected static native void getServerInfo( int cellHandle, String name, + Server server ) + throws AFSException; + + /** + * Returns the total number of partitions hosted by the server denoted by + * serverHandle, if the server is a fileserver. + * + * @param cellHandle the handle of the cell to which the server belongs + * @param serverHandle the vos handle of the server to which the + * partitions belong + * @return total number of partitions + * @exception AFSException If an error occurs in the native code + * @see Cell#getCellHandle + * @see #getVosServerHandle + */ + protected static native int getPartitionCount( int cellHandle, + int serverHandle ) + throws AFSException; + + /** + * Begin the process of getting the partitions on a server. Returns + * an iteration ID to be used by subsequent calls to + * getPartitionsNext and getPartitionsDone. + * + * @param cellHandle the handle of the cell to which the server belongs + * @see Cell#getCellHandle + * @param serverHandle the vos handle of the server to which the + * partitions belong + * @see #getVosServerHandle + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + */ + protected static native int getPartitionsBegin( int cellHandle, + int serverHandle ) + throws AFSException; + + /** + * Returns the next partition of the server. Returns null + * if there are no more partitions. + * + * @param iterationId the iteration ID of this iteration + * @see #getPartitionsBegin + * @return the name of the next partition of the server + * @exception AFSException If an error occurs in the native code + */ + protected static native String getPartitionsNextString( int iterationId ) + throws AFSException; + + /** + * Fills the next partition object of the server. Returns 0 if there + * are no more partitions, != 0 otherwise + * + * @param iterationId the iteration ID of this iteration + * @param thePartition the Partition object in which to fill the + * values of the next partition + * @see #getPartitionsBegin + * @return 0 if there are no more servers, != 0 otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getPartitionsNext( int iterationId, + Partition thePartition ) + throws AFSException; + + /** + * Signals that the iteration is complete and will not be accessed anymore. + * + * @param iterationId the iteration ID of this iteration + * @see #getPartitionsBegin + * @exception AFSException If an error occurs in the native code + */ + protected static native void getPartitionsDone( int iterationId ) + throws AFSException; + + /** + * Returns the total number of processes hosted by the server denoted by + * serverHandle. + * + * @param serverHandle the vos handle of the server to which the + * processes belong + * @return total number of processes + * @exception AFSException If an error occurs in the native code + * @see #getVosServerHandle + */ + protected static native int getProcessCount( int serverHandle ) + throws AFSException; + + /** + * Begin the process of getting the processes on a server. Returns + * an iteration ID to be used by subsequent calls to + * getProcessesNext and getProcessesDone. + * + * @param serverHandle the bos handle of the server to which the + * processes belong + * @see #getBosServerHandle + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + */ + protected static native int getProcessesBegin( int serverHandle ) + throws AFSException; + + /** + * Returns the next process of the server. Returns null + * if there are no more processes. + * + * @param iterationId the iteration ID of this iteration + * @see #getProcessesBegin + * @return the name of the next process of the cell + * @exception AFSException If an error occurs in the native code + */ + protected static native String getProcessesNextString( int iterationId ) + throws AFSException; + + /** + * Fills the next process object of the server. Returns 0 if there + * are no more processes, != 0 otherwise. + * + * @param serverHandle the handle of the BOS server that hosts the process + * @see #getBosHandle + * @param iterationId the iteration ID of this iteration + * @param theProcess the Process object in which to fill the + * values of the next process + * @see #getProcessesBegin + * @return 0 if there are no more processes, != otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getProcessesNext( int serverHandle, + int iterationId, + Process theProcess ) + throws AFSException; + + /** + * Signals that the iteration is complete and will not be accessed anymore. + * + * @param iterationId the iteration ID of this iteration + * @see #getProcessesBegin + * @exception AFSException If an error occurs in the native code + */ + protected static native void getProcessesDone( int iterationId ) + throws AFSException; + + /** + * Returns the total number of keys hosted by the server denoted by + * serverHandle. + * + * @param serverHandle the vos handle of the server to which the + * keys belong + * @return total number of keys + * @exception AFSException If an error occurs in the native code + * @see #getVosServerHandle + */ + protected static native int getKeyCount( int serverHandle ) + throws AFSException; + + /** + * Begin the process of getting the keys of a server. Returns + * an iteration ID to be used by subsequent calls to + * getKeysNext and getKeysDone. + * + * @param serverHandle the bos handle of the server to which the keys belong + * @see #getBosServerHandle + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + */ + protected static native int getKeysBegin( int serverHandle ) + throws AFSException; + + /** + * Returns the next key of the server. Returns 0 if there + * are no more keys, != 0 otherwise. + * + * @param iterationId the iteration ID of this iteration + * @param theKey a {@link Key Key} object, in which to fill in the + * properties of the next key. + * @see #getKeysBegin + * @return 0 if there are no more keys, != 0 otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getKeysNext( int iterationId, Key theKey ) + throws AFSException; + + /** + * Signals that the iteration is complete and will not be accessed anymore. + * + * @param iterationId the iteration ID of this iteration + * @see #getKeysBegin + * @exception AFSException If an error occurs in the native code + */ + protected static native void getKeysDone( int iterationId ) + throws AFSException; + + /** + * Returns the total number of BOS administrators associated with the server + * denoted by serverHandle. + * + * @param serverHandle the vos handle of the server to which the + * BOS admins belong + * @return total number of BOS administrators + * @exception AFSException If an error occurs in the native code + * @see #getVosServerHandle + */ + protected static native int getBosAdminCount( int serverHandle ) + throws AFSException; + + /** + * Begin the process of getting the bos amdinistrators on a server. Returns + * an iteration ID to be used by subsequent calls to + * getBosAdminsNext and getBosAdminsDone. + * + * @param serverHandle the bos handle of the server to which the + * partitions belong + * @see #getBosServerHandle + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + */ + protected static native int getBosAdminsBegin( int serverHandle ) + throws AFSException; + + /** + * Returns the next bos admin of the server. Returns null + * if there are no more admins. + * + * @param iterationId the iteration ID of this iteration + * @see #getBosAdminsBegin + * @return the name of the next admin of the server + * @exception AFSException If an error occurs in the native code + */ + protected static native String getBosAdminsNextString( int iterationId ) + throws AFSException; + + /** + * Returns the next bos admin of the server. Returns 0 if there + * are no more admins, != 0 otherwise. + * + * @param cellHandle the handle of the cell to which these admins belong + * @see Cell#getCellHandle + * @param iterationId the iteration ID of this iteration + * @see #getBosAdminsBegin + * @param theUser the user object in which to fill the values of this admin + * @return 0 if no more admins, != 0 otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getBosAdminsNext( int cellHandle, + int iterationId, User theUser ) + throws AFSException; + + /** + * Signals that the iteration is complete and will not be accessed anymore. + * + * @param iterationId the iteration ID of this iteration + * @see #getBosAdminsBegin + * @exception AFSException If an error occurs in the native code + */ + protected static native void getBosAdminsDone( int iterationId ) + throws AFSException; + + /** + * Adds the given to name to the list of bos administrators on that server. + * + * @param serverHandle the bos handle of the server to which the + * partitions belong + * @see #getBosServerHandle + * @param adminName the name of the admin to add to the list + * @exception AFSException If an error occurs in the native code + */ + protected static native void addBosAdmin( int serverHandle, + String adminName ) + throws AFSException; + + /** + * Removes the given to name from the list of bos administrators on + * that server. + * + * @param serverHandle the bos handle of the server to which the + * partitions belong + * @see #getBosServerHandle + * @param adminName the name of the admin to remove from the list + * @exception AFSException If an error occurs in the native code + */ + protected static native void removeBosAdmin( int serverHandle, + String adminName ) + throws AFSException; + + /** + * Salvages (restores consistency to) a volume, partition, or server + * + * @param cellHandle the handle of the cell to which the volume belongs + * @see Cell#getCellHandle + * @param serverHandle the bos handle of the server on which the + * volume resides + * @see #getBosServerHandle + * @param partitionName the name of the partition to salvage, + * can be null only if volName is + * null + * @param volName the name of the volume to salvage, + * can be null + * @param numSalvagers the number of salvager processes to run in parallel + * @param tempDir directory to place temporary files, can be + * null + * @param logFile where salvager log will be written, can be + * null + * @param inspectAllVolumes whether or not to inspect all volumes, + * not just those marked as active at crash + * @param removeBadlyDamaged whether or not to remove a volume if it's + * badly damaged + * @param writeInodes whether or not to record a list of inodes modified + * @param writeRootInodes whether or not to record a list of AFS + * inodes owned by root + * @param forceDirectory whether or not to salvage an entire directory + * structure + * @param forceBlockReads whether or not to force the salvager to read + * the partition + * one block at a time and skip badly damaged + * blocks. Use if partition has disk errors + */ + protected static native void salvage( int cellHandle, int serverHandle, + String partitionName, String volName, + int numSalvagers, String tempDir, + String logFile, + boolean inspectAllVolumes, + boolean removeBadlyDamaged, + boolean writeInodes, + boolean writeRootInodes, + boolean forceDirectory, + boolean forceBlockReads) + throws AFSException; + + /** + * Synchronizes a particular server with the volume location database. + * + * @param cellHandle the handle of the cell to which the server belongs + * @see Cell#getCellHandle + * @param serverHandle the vos handle of the server + * @see #getVosServerHandle + * @param partition the id of the partition to sync, can be -1 to ignore + * @exception AFSException If an error occurs in the native code + */ + protected static native void syncServerWithVLDB( int cellHandle, + int serverHandle, + int partition ) + throws AFSException; + + /** + * Synchronizes the volume location database with a particular server. + * + * @param cellHandle the handle of the cell to which the server belongs + * @see Cell#getCellHandle + * @param serverHandle the vos handle of the server + * @see #getVosServerHandle + * @param partition the id of the partition to sync, can be -1 to ignore + * @param forceDeletion whether or not to force the deletion of bad volumes + * @exception AFSException If an error occurs in the native code + */ + protected static native void syncVLDBWithServer( int cellHandle, + int serverHandle, + int partition, + boolean forceDeletion ) + throws AFSException; + + /** + * Retrieves a specified bos log from a server. Right now this + * method will simply return a huge String containing the log, but + * hopefully we can devise a better way to make this work more efficiently. + * + * @param serverHandle the bos handle of the server to which the key belongs + * @see #getBosServerHandle + * @param logLocation the full path and name of the desired bos log + * @exception AFSException If an error occurs in the native code + */ + protected static native String getLog( int serverHandle, String logLocation ) + throws AFSException; + + /** + * Fills in the restart time fields of the given {@link Server Server} + * object. + * + * @param serverHandle the bos handle of the server to which the key belongs + * @see #getBosServerHandle + * @param restartType whether to get the general or binary restart. + * Acceptable values are:

      + *
    • {@link RESTART_BINARY}
    • + *
    • {@link RESTART_GENERAL}
    + * @param theServer the Server object, in which to fill + * the restart time fields + * @exception AFSException If an error occurs in the native code + */ + private static native void getRestartTime( int serverHandle, + int restartType, + ExecutableTime executableTime ) + throws AFSException; + + /** + * Sets the restart time of the bos server. + * + * @param serverHandle the bos handle of the server to which the key belongs + * @see #getBosServerHandle + * @param restartType whether this is to be a general or binary restart. + * Acceptable values are:
      + *
    • {@link RESTART_BINARY}
    • + *
    • {@link RESTART_GENERAL}
    + * @param theServer the server object containing the desired information + * @exception AFSException If an error occurs in the native code + */ + private static native void setRestartTime( int serverHandle, + int restartType, + ExecutableTime executableTime ) + throws AFSException; + + /** + * Start all server processes. + * + * @param serverHandle the bos handle of the server to which the + * processes belong + * @see #getBosServerHandle + * @exception AFSException If an error occurs in the native code + */ + protected static native void startAllProcesses( int serverHandle ) + throws AFSException; + + /** + * Restart all server processes. + * + * @param serverHandle the bos handle of the server to which the + * processes belong + * @see #getBosServerHandle + * @param restartBosServer whether or not to restart the bos server as well + * @exception AFSException If an error occurs in the native code + */ + protected static native void restartAllProcesses( int serverHandle, + boolean restartBosServer ) + throws AFSException; + + /** + * Stop all server processes. + * + * @param serverHandle the bos handle of the server to which the + * processes belong + * @see #getBosServerHandle + * @exception AFSException If an error occurs in the native code + */ + protected static native void stopAllProcesses( int serverHandle ) + throws AFSException; + + /** + * Reclaims all memory being saved by the server portion of the native + * library. This method should be called when no more Server + * objects are expected to be used. + */ + protected static native void reclaimServerMemory(); + + /*====================================================================*/ + /* INNER CLASSES */ + /*====================================================================*/ + public static final class ExecutableTime implements Serializable + { + public static final short NEVER = 0; + public static final short NOW = 1; + + public static final short EVERYDAY = -1; + public static final short SUNDAY = 0; + public static final short MONDAY = 1; + public static final short TUESDAY = 2; + public static final short WEDNESDAY = 3; + public static final short THURSDAY = 4; + public static final short FRIDAY = 5; + public static final short SATURDAY = 6; + + static final DecimalFormat formatter = + (DecimalFormat)DecimalFormat.getInstance(); + + private short second; + private short minute; + private short hour; + private short day; + private boolean now; + private boolean never; + + static + { + formatter.applyPattern("00"); + } + + /** + * Internal constructor used to construct an empty object that will + * be passed to JNI for member synchronization of the BOS Server + * executable time this object represents. + */ + ExecutableTime() + { + this.second = (short) 0; + this.minute = (short) 0; + this.hour = (short) 0; + this.day = (short) -1; + this.now = false; + this.never = false; + } + + /** + * Constructs an ExecutableTime object that represents either + * a "now" or "never" BOS Executable + * Restart Time. + * + *

    Valid values for the type parameter are ExecutableTime.NOW + * or ExecutableTime.NEVER. If a value other than these two is used an + * IllegalArgumentException will be thrown. + * + * @param type either ExecutableTime.NOW or ExecutableTime.NEVER + * @exception IllegalArgumentException + * If a value other than ExecutableTime.NOW or + * ExecutableTime.NEVER is used for the type + * parameter. + * @see #isNow() + * @see #isNever() + * @see #Server.ExecutableTime(short, short, short) + */ + public ExecutableTime(short type) throws IllegalArgumentException + { + if (type == NOW) { + this.now = true; + this.never = false; + } else if (type == NEVER) { + this.now = false; + this.never = true; + } else { + throw new IllegalArgumentException("You must specify either " + + "ExecutableTime.NOW or " + + "ExecutableTime.NEVER when " + + "using this constructor."); + } + this.second = (short) 0; + this.minute = (short) 0; + this.hour = (short) 0; + this.day = (short) -1; + } + + /** + * Constructs an ExecutableTime object that may be used to + * represent a daily BOS Executable Restart Time of a process. + * + * @param second the second field for this representation of a + * BOS Server restart time value (range: 0-59) + * @param minute the minute field for this representation of a + * BOS Server restart time value (range: 0-59) + * @param hour the hour field for this representation of a BOS + * Server restart time value (range: 0-23) + * @exception IllegalArgumentException + * If any of the parameters values are out of range + * of their respective fields. + * @see #Server.ExecutableTime(short, short, short, short) + * @see #getSecond() + * @see #getMinute() + * @see #getHour() + */ + public ExecutableTime(short second, short minute, short hour) + throws IllegalArgumentException + { + this(second, minute, hour, ExecutableTime.EVERYDAY); + } + + /** + * Constructs an ExecutableTime object that may be used to + * represent the BOS Executable Restart Time of a process. + * + * @param second the second field for this representation of a + * BOS Server restart time value (range: 0-59) + * @param minute the minute field for this representation of a + * BOS Server restart time value (range: 0-59) + * @param hour the hour field for this representation of a BOS + * Server restart time value (range: 0-23) + * @param day the day field for this representation of a BOS + * Server restart time value.

      Valid values include: + * ExecutableTime.EVERYDAY (see also {@link + * #Server.ExecutableTime(short, short, short)})
      + * + * ExecutableTime.SUNDAY
      + * ExecutableTime.MONDAY
      + * ExecutableTime.TUESDAY
      + * ExecutableTime.WEDNESDAY
      + * ExecutableTime.THURSDAY
      + * ExecutableTime.FRIDAY
      + * ExecutableTime.SATURDAY
      + *
    + * @exception IllegalArgumentException + * If any of the parameters values are out of range + * of their respective fields. + * @see #Server.ExecutableTime(short, short, short) + * @see #getSecond() + * @see #getMinute() + * @see #getHour() + * @see #getDay() + */ + public ExecutableTime(short second, short minute, short hour, short day) + { + if ( (0 > second || second > 59) || + (0 > minute || minute > 59) || + (0 > hour || hour > 24) || + (-1 > day || day > 6) ) { + throw new IllegalArgumentException("One of the specified values " + + "are invalid."); + } + this.second = second; + this.minute = minute; + this.hour = hour; + this.day = day; + this.now = false; + this.never = false; + } + + /** + * Returns the second of this ExecutableTime object. + * + * @return the second of this ExecutableTime object. + * @exception IllegalStateException + * If the executable time this object represents has a value of + * "now" or "never". + */ + public short getSecond() throws IllegalStateException + { + if (now || never) { + throw new IllegalStateException("Executable time is set to 'now' or" + + " 'never'."); + } + return second; + } + + /** + * Returns the minute of this ExecutableTime object. + * + * @return the minute of this ExecutableTime object. + * @exception IllegalStateException + * If the executable time this object represents has a value of + * "now" or "never". + */ + public short getMinute() throws IllegalStateException + { + if (now || never) { + throw new IllegalStateException("Executable time is set to 'now' or" + + " 'never'."); + } + return minute; + } + + /** + * Returns the hour of this ExecutableTime object, in 24 hour time. + * + * @return the hour of this ExecutableTime object. + * @exception IllegalStateException + * If the executable time this object represents has a value of + * "now" or "never". + */ + public short getHour() throws IllegalStateException + { + if (now || never) { + throw new IllegalStateException("Executable time is set to 'now' or" + + " 'never'."); + } + return hour; + } + + /** + * Returns a numeric representation of the day of this ExecutableTime + * object. If it is daily, the value of ExecutableTime.EVERYDAY is returned. + * + *

    Possible return values are:
    + * + * ExecutableTime.EVERYDAY
    + *
    + * ExecutableTime.SUNDAY
    + * ExecutableTime.MONDAY
    + * ExecutableTime.TUESDAY
    + * ExecutableTime.WEDNESDAY
    + * ExecutableTime.THURSDAY
    + * ExecutableTime.FRIDAY
    + * ExecutableTime.SATURDAY
    + *
    + * + * @return a numeric representation of the day of this ExecutableTime + * object. + * @exception IllegalStateException + * If the executable time this object represents has a value of + * "now" or "never". + */ + public short getDay() throws IllegalStateException + { + if (now || never) { + throw new IllegalStateException("Executable time is set to 'now' or" + + " 'never'."); + } + return day; + } + + /** + * Returns a String representation, name for the day of the week or + * "Everyday", of this object's day property. + * + *

    Possible return values are: + *

    +     * Sunday
    +     * Monday
    +     * Tuesday
    +     * Wednesday
    +     * Thursday
    +     * Friday
    +     * Saturday
    +     * 
    +     * Everyday
    +     * 
    + * + * @return the day of this ExecutableTime object. + * @exception IllegalStateException + * If the executable time this object represents has a value of + * "now" or "never". + * @see #getDay() + */ + public String getDayString() throws IllegalStateException + { + switch (getDay()) + { + case 0: + return "Sunday"; + case 1: + return "Monday"; + case 2: + return "Tuesday"; + case 3: + return "Wednesday"; + case 4: + return "Thursday"; + case 5: + return "Friday"; + case 6: + return "Saturday"; + default: + return "Everyday"; + } + } + + /** + * Returns whether or not the BOS restart time, represented by this + * ExecutableTime object, is set to "now" or not. + * This means that at some point in the past, when someone set it to + * "now", the bosserver restarted all its processes, + * and never again. + * + * @return whether or not the restart time is "now" + */ + public boolean isNow() + { + return now; + } + + /** + * Returns the second of this ExecutableTime object. + * + * @return the second of this ExecutableTime object. + */ + /** + * Returns whether or not the BOS restart time, represented by this + * ExecutableTime object, is set to "never" or not. + * This means that the bosserver will never restart its processes. + * + * @return whether or not the restart time is "never" + */ + public boolean isNever() + { + return never; + } + + /** + * Tests whether two ExecutableTime objects are equal, + * based on a + * comparison of each of their respective properties. If + * "now" or "never" is set in either object, + * only those properties are analyzed. + * + * @param time the ExecutableTime to test against + * @return whether the specifed ExecutableTime is the same as this + * ExecutableTime as defined above + */ + public boolean equals( ExecutableTime time ) + { + boolean same = false; + try { + same = ( (second == time.getSecond()) && + (minute == time.getMinute()) && + (hour == time.getHour() ) && + (day == time.getDay() ) ); + } catch (Exception e) { + same = ( (now == time.isNow() ) && + (never == time.isNever() ) ); + + } + return same; + } + + /** + * Returns the String representation of time value of this + * ExecutableTime object. + * + *

    Possible return values:
    + *

  • "Now"
    + *
  • "Never"
    + *
  • Day and time string in the form:
         + * <day> at <hh>:<MM>[:<ss>] + *

    + * + * Example Return Values:
    +     * Sunday at 04:00
    +     * Sunday at 05:10:30
    +     * Everyday at 20:00
    + * + * @return the String representation of this ExecutableTime + * object + */ + public String toString() + { + if (now) { + return "Now"; + } else if (never) { + return "Never"; + } else { + try { + if (second != 0) { + return getDayString() + " at " + + ExecutableTime.formatter.format(hour) + ":" + + ExecutableTime.formatter.format(minute) + ":" + + ExecutableTime.formatter.format(second); + } else { + return getDayString() + " at " + + ExecutableTime.formatter.format(hour) + ":" + + ExecutableTime.formatter.format(minute); + } + } catch (Exception e) { + return "(unknown)"; + } + } + } + + } + /*====================================================================*/ + +} + + + + + + + diff --git a/src/JAVA/classes/org/openafs/jafs/Token.java b/src/JAVA/classes/org/openafs/jafs/Token.java new file mode 100644 index 000000000..5626a718b --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/Token.java @@ -0,0 +1,492 @@ +/* + * @(#)Token.java 1.2 05/06/2002 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.io.Serializable; + +/** + * An abstract representation of an AFS authentication token. It conveniently + * maintains the handle associated with token and the cell to which the token + * is authenticated. + *

    + * + * Constructing a Token object results in an immediate attempt to + * authenticate the user within the specified cell. If this attempt fails, an + * {@link AFSException} will be thrown. Therefore, if the + * construction of the object succeeds without an exception, then the + * Token is considered authenticated. + * + * The construction of a Token object acts as an entry point + * for authentication into the AFS system. Thus, when you construct a + * {@link Cell} object, you must pass in an instance of a + * Token that has been authenticated within the AFS cell that + * Cell is intended to represent. You will only be + * allowed to perform actions that the user, used to authenticate + * Token, is authorized to perform. You must construct a + * Token object before constructing a Cell object, + * which is required by all other objects within this package either directly + * or indirectly.

    + * + * If an error occurs during a method call, an + * AFSException will be thrown. This class is the Java + * equivalent of errors thrown by AFS; see {@link AFSException} + * for a complete description.

    + * + * + * The following is a simple example of how to construct and use a + * Token object. It shows how to construct a Cell + * using a Token. See {@link Cell} for a more detailed example + * of constructing and using a Cell object.

    + * + *
    + * import org.openafs.jafs.AFSException;
    + * import org.openafs.jafs.Cell;
    + * import org.openafs.jafs.Token;
    + * ...
    + * public class ...
    + * {
    + *   ...
    + *   private Cell cell;
    + *   private Token token;
    + *   ...
    + *   public static void main(String[] args) throws Exception
    + *   {
    + *     String username   = arg[0];
    + *     String password   = arg[1];
    + *     String cellName   = arg[2];
    + *     String serverName = arg[3];
    + * 
    + *     token = new Token(username, password, cellName);
    + *     cell   = new Cell(token);
    + *     ...
    + *   }
    + *   ...
    + * }
    + * 
    + * + */ + +public class Token implements Serializable, Comparable +{ + public static int ANYUSER_PAG_ID; + + protected int tokenHandle; + protected int pagID = -1; + protected int errno; + + protected String cellName; + protected String username; + private String password; + + private boolean hasInitialized = false; + + /** + * Load the native libraries libjafs and + * libjafs. + */ + static + { + try { + Class.forName("org.openafs.jafs.AFSLibraryLoader"); + try { + initializeAdminClient(); + } catch (Exception e) { + System.err.println(e); + } + } catch (ClassNotFoundException e) { + /* Most likely running on a client, do nothing */ + } + } + + /** + * Constructs a new Token object instance given + * the name of the AFS cell it represents and the username and password + * of the user to be Tokend for + * administrative access. + * + * @param username the name of the user to Token with + * @param password the password of that user + * @param cellName the name of the cell to Token into + * @param login if true, automatically login upon construction + * @exception AFSException If an error occurs in the native code + */ + protected Token( String username, String password, String cellName, + boolean automaticallyLogin ) + throws AFSException + { + this.username = username; + this.password = password; + this.cellName = cellName; + + /* By default lets authenticate the user using libafsauthent.a */ + if (automaticallyLogin) login(); + } + + /** + * Constructs a new Token object instance given + * the name of the AFS cell it represents and the username and password + * of the user to be Tokend for + * administrative access. + * + * @param username the name of the user to Token with + * @param password the password of that user + * @param cellName the name of the cell to Token into + * @exception AFSException If an error occurs in the native code + */ + public Token( String username, String password, String cellName ) + throws AFSException + { + this.username = username; + this.password = password; + this.cellName = cellName; + +System.out.println(username + ", " + cellName); + /* By default lets authenticate the user using libafsauthent.a */ + login(); + } + + /** + * Returns the name of the AFS cell that this Token was + * authenticated against. + * + * @exception AFSException If an error occurs in the native code + * @return the name of the AFS cell associated with this Token. + */ + public String getCellName() + { + return cellName; + } + + /** + * Returns the username of user to whom this token belongs. + * + * @exception AFSException If an error occurs in the native code + * @return the username of the user represented by this Token + */ + public String getUsername() + { + return username; + } + + /** + * Returns a token handle that can be used to prove this authentication + * later. + * + * @exception AFSException If an error occurs in the native code + * @return a token representing the authentication + */ + protected int getHandle() + { + return tokenHandle; + } + + /** + * Closes the given currently open token. + * + * @exception AFSException If an error occurs in the native code + */ + public void close() throws AFSException + { + close(tokenHandle); + } + + /** + * Gets the expiration time for a given token. + * + * @return a long representing the UTC time for the token expiration + * @exception AFSException If an error occurs in the native code + */ + public long getExpiration() throws AFSException + { + return getExpiration(tokenHandle); + } + + /** + * Authenticates a user in kas, and binds that authentication + * to the current process. + * + * @exception AFSException If an error occurs in the native code + */ + public void klog() throws AFSException + { + if (!hasInitialized) { + initializeUserSpace(); + hasInitialized = true; + } + if (pagID > -1) { + relog(pagID); + } else { + pagID = klog(username, password, cellName, pagID); + } + } + + /** + * Authenticates a user in KAS, and binds that authentication + * to the current process. + * + * @exception AFSException If an error occurs in the native code + */ + public void login() throws AFSException + { + this.tokenHandle = this.getToken(cellName, username, password); + } + + /** + * Initialize the user space AFS client (libjafs). + * + *

    The user space client must be initialized prior to any + * user space related methods, including: klog, unlog, relog, + * and shutdown. + * + * @exception AFSException If an error occurs in the native code + */ + protected static void initializeUserSpace() throws AFSException + { + try { + Token.initUserSpace(); + } catch (AFSException e) { + System.err.println(e.getMessage()); + } + try { + Runtime.getRuntime().addShutdownHook(new AFSShutdownHandler()); + } catch (Exception e) { + System.err.println("Could not register shutdown hook: " + e.toString()); + } + } + + /////////////// custom override methods //////////////////// + + /** + * Compares two ACL objects respective to their paths and does not + * factor any other attribute. Alphabetic case is significant in + * comparing names. + * + * @param acl The ACL object to be compared to this ACL + * instance + * + * @return Zero if the argument is equal to this ACL's path, a + * value less than zero if this ACL's path is + * lexicographically less than the argument, or a value greater + * than zero if this ACL's path is lexicographically + * greater than the argument + */ + public int compareTo(Token token) + { + return this.toString().compareTo(token.toString()); + } + + /** + * Comparable interface method. + * + * @see #compareTo(Token) + */ + public int compareTo(Object obj) + { + return compareTo((Token)obj); + } + + /** + * Tests whether two Cell objects are equal, based on their + * names. Does not test whether the objects are actually the same + * representational instance of the AFS cell. + * + * @param otherCell the Cell to test + * @return whether the specifed user is the same as this user + */ + public boolean equals( Token token ) + { + return this.toString().equals( token.toString() ); + } + + /** + * Returns the name of this Cell + * + * @return the name of this Cell + */ + public String toString() + { + return username + "@" + cellName + ":" + tokenHandle; + } + + /////////////// native methods found in *Token.c //////////////////// + + /** + * Initialize the user space library. + * + * @exception AFSException If an error occurs in the native code + */ + private static native void initUserSpace() throws AFSException; + + /** + * Initialize the administrative library. + * + * @exception AFSException If an error occurs in the native code + */ + protected static native void initializeAdminClient() throws AFSException; + + /** + * Returns a token handle that can be used to prove this authentication + * later. + * + * @param cellName the name of the cell in which to Token this user + * @param userName the name of the user to Token + * @param password the password of the user + * @exception AFSException If an error occurs in the native code + * @return a token representing the authentication + */ + protected native int getToken( String cellName, String username, + String password ) + throws AFSException; + + /** + * Closes the given currently open token. + * + * @param tokenHandle the token to close + * @exception AFSException If an error occurs in the native code + */ + protected native void close( int tokenHandle ) throws AFSException; + + /** + * Gets the expiration time for a given token. + * + * @param tokenHandle a token handle previously returned by a call + * to {@link #getToken} + * @see #getToken + * @return a long representing the UTC time for the token expiration + * @exception AFSException If an error occurs in the native code + */ + protected native long getExpiration( int tokenHandle ) + throws AFSException; + + /** + * Authenticates a user in KAS, and binds that authentication + * to the current thread or native process. + * + * @param username the login to authenticate + * (expected as username@cellname) + * @param password the password of the login + * @param cellName the name of the cell to authenticate into + * @param id the existing pag (or 0) + * + * @return the assigned pag + * @exception AFSException If an error occurs in the native code + */ + protected native int klog(String username, String password, + String cellName, int id) + throws AFSException; + + /** + * Authenticates a user in KAS by a previously acquired PAG ID, and binds + * that authentication to the current thread or native process. + * + *

    This method does not require the user's username and password to + * fully authenticate their request. Rather it utilizes the user's PAG ID + * to recapture the user's existing credentials. + * + *

    This method is called by the public klog method, which + * internally manages the PAG ID. Additionally, an application needs only + * call klog, this reduces the amount of complexity and ensures + * that relog is never called before a klog. + * + * @param int User's current PAG (process authentication group) ID + * @exception AFSException If an error occurs in the native code + */ + protected native void relog(int id) throws AFSException; + + /** + * Manually discards all AFS credentials associated with the bound user. + * + * @exception AFSException If an error occurs in the native code + */ + public native void unlog() throws AFSException; + + /** + * Inform the native library that the application is + * shutting down and will be unloading. + * + *

    The library will make a call informing the file server that it will + * no longer be available for callbacks. + */ + protected static native void shutdown(); + + /** + * Reclaims all memory being saved by the authentication portion of + * the native library. + * This method should be called when no more authentications are expected. + */ + protected static native void reclaimAuthMemory(); +} + +/*=======================================================================*/ +/** + * Class that loads the native libraries required for direct communication with + * AFS. Since the Token class is serializable the function of loading the + * native libraries must be performed in a non-serialized class, one that will + * not be included in any client side application packages. + * + * @version 1.0, 06/13/2001 + */ +class AFSLibraryLoader +{ + static + { + System.loadLibrary("jafs"); + System.loadLibrary("jafsadm"); + } +} +/*=======================================================================*/ +/** + * Class that handles graceful AFS application shutdown procedures by + * instructing the native library to inform the file system server that + * it is shutting down. + * + * @version 1.0, 06/13/2001 + */ +class AFSShutdownHandler extends Thread +{ + public AFSShutdownHandler() {} + + /** + * This is the execution method satisfying the interface requirement as a + * stand alone runnable thread. + * + *

    This method will automatically be invoked by the Thread instantiator. + * + * @see Token#shutdown() + */ + public void run() + { + System.out.println("Shutting down Java AFS library..."); + org.openafs.jafs.Token.shutdown(); + } +} +/*=======================================================================*/ + + + + + + + + diff --git a/src/JAVA/classes/org/openafs/jafs/User.java b/src/JAVA/classes/org/openafs/jafs/User.java new file mode 100644 index 000000000..5427157df --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/User.java @@ -0,0 +1,1939 @@ +/* + * @(#)User.java 1.0 6/29/2001 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.util.GregorianCalendar; +import java.util.Date; +import java.util.ArrayList; +import java.io.Serializable; + +/** + * An abstract representation of an AFS user. It holds information about + * the user, such as what groups it belongs to. + *

    + * + * Constructing an instance of a User does not mean an actual + * AFS user is created in a cell -- usually a User + * object is a representation of an already existing AFS user. If, + * however, the User is constructed with the name of a + * user that does not exist in the cell represented by the provided + * Cell, a new user with that name can be + * created in that server by calling the {@link #create(String, int)} or + * {@link #create(String)} method. If such a user does already exist when + * one of these methods is called, an exception will be thrown.

    + * + * Each User object has its own individual set of + * Groups that it owns and Groups for which + * it is a member. These represents the properties and attributes + * of an actual AFS user. + *

    + * + * Since this User object is a union of both the PTS and KAS + * properties of AFS users, some methods meant for users with a PTS entry + * will throw exceptions if used on a user with only a KAS entry, and vice + * versa.

    + * + * + * + * Associated with an AFS user are many attributes, such as whether or not + * it can change its own password, or who is allowed to find out the groups + * to which this user belongs. The User class has many + * "set" methods to indicate values for these attributes (i.e. + * {@link #setChangePassword(boolean)} and {@link #setListMembership(int)}). + * However, in order for these values to be written to the actual AFS user, + * the {@link #flushInfo()} method needs to be called. This writes all user + * attributes set through this API to AFS. This is done to minimize calls + * through JNI.

    + * + * + * The following is a simple example of how to construct and use a + * User object. It iterates through the list of users + * (a union of pts and kas users) for a cell, and prints out the name and + * id of each. + * + *

    + * import org.openafs.jafs.Cell;
    + * import org.openafs.jafs.AFSException;
    + * import org.openafs.jafs.User;
    + * ...
    + * public class ...
    + * {
    + *   ...
    + *   private Cell cell;
    + *   ...
    + *   public static void main(String[] args) throws Exception
    + *   {
    + *     String username   = arg[0];
    + *     String password   = arg[1];
    + *     String cellName   = arg[2];
    + * 
    + *     token  = new Token(username, password, cellName);
    + *     cell   = new Cell(token);
    + *     server = cell.getServer(serverName);
    + * 
    + *     System.out.println("Users in Cell " + cell.getName() + ":");
    + *     User[] users = cell.getUsers();
    + *     for (int i = 0; i < users.length; i++) {
    + *       System.out.println(" -> " + users[i] + ": " users[i].getID());
    + *     }
    + *   }
    + *   ...
    + * }
    + * 
    + * + */ +public class User implements PTSEntry, Serializable, Comparable +{ + /** + * Only the owner of the user has access + */ + public static final int USER_OWNER_ACCESS = 0; + /** + * Any user has access + */ + public static final int USER_ANYUSER_ACCESS = 1; + + /** + * User has administrative kas privileges + */ + public static final int ADMIN = 0; + /** + * User has no administrative kas privileges + */ + public static final int NO_ADMIN = 1; + + /** + * TGS will grant tickets for user + */ + public static final int GRANT_TICKETS = 0; + /** + * TGS will not grant tickets for user + */ + public static final int NO_GRANT_TICKETS = 1; + + /** + * TGS can use user's key for an encryption key + */ + public static final int ENCRYPT = 0; + /** + * TGS cannot use user's key for an encryption key + */ + public static final int NO_ENCRYPT = 1; + + /** + * User can change their password + */ + public static final int CHANGE_PASSWORD = 0; + /** + * User cannot change their password + */ + public static final int NO_CHANGE_PASSWORD = 1; + + /** + * User can reuse their password + */ + public static final int REUSE_PASSWORD = 0; + /** + * User cannot reuse their password + */ + public static final int NO_REUSE_PASSWORD = 1; + + protected Cell cell; + protected int cellHandle; + protected String name; + + /** + * Does this user have a kas entry? + */ + protected boolean kas; + /** + * Does this user have a pts entry? + */ + protected boolean pts; + + // pts fields + protected int groupCreationQuota; + protected int groupMembershipCount; + protected int nameUID; + protected int ownerUID; + protected int creatorUID; + + /** + * who is allowed to execute pts examine for this user. Valid values are: + *
      + *
    • {@link #USER_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #USER_ANYUSER_ACCESS} + * -- any user has permission
    + */ + protected int listStatus; + /** + * who is allowed to execute pts listowned for this user. Valid values are: + *
      + *
    • {@link #USER_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #USER_ANYUSER_ACCESS} + * -- any user has permission
    + */ + protected int listGroupsOwned; + /** + * who is allowed to execute pts membership for this user. Valid values are: + *
      + *
    • {@link #USER_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #USER_ANYUSER_ACCESS} + * -- any user has permission
    + */ + protected int listMembership; + protected String owner; + protected String creator; + + // lists + protected ArrayList groups; + protected ArrayList groupNames; + protected ArrayList groupsOwned; + protected ArrayList groupsOwnedNames; + + // kas fields + /** + * whether or not this user has kas administrative privileges. + * Valid values are: + *
      + *
    • {@link #ADMIN}
    • + *
    • {@link #NO_ADMIN}
    + */ + protected int adminSetting; + /** + * whether the TGS will grant tickets for this user. Valid values are: + *
      + *
    • {@link #GRANT_TICKETS}
    • + *
    • {@link #NO_GRANT_TICKETS}
    + */ + protected int tgsSetting; + /** + * whether the TGS can use this user's key as an encryption key. Valid values are: + *
      + *
    • {@link #ENCRYPT}
    • + *
    • {@link #NO_ENCRYPT}
    + */ + protected int encSetting; + /** + * whether this user is allowed to change its password. Valid values are: + *
      + *
    • {@link #CHANGE_PASSWORD}
    • + *
    • {@link #NO_CHANGE_PASSWORD}
    + */ + protected int cpwSetting; + /** + * whether this user is allowed to reuse its password. Valid values are: + *
      + *
    • {@link #REUSE_PASSWORD}
    • + *
    • {@link #NO_REUSE_PASSWORD}
    + */ + protected int rpwSetting; + protected int userExpiration; + protected int lastModTime; + protected String lastModName; + protected int lastChangePasswordTime; + protected int maxTicketLifetime; + protected int keyVersion; + protected String encryptionKey; + protected long keyCheckSum; + protected int daysToPasswordExpire; + protected int failLoginCount; + protected int lockTime; + protected int lockedUntil; + + // Dates and times + protected GregorianCalendar lockedUntilDate; + protected GregorianCalendar userExpirationDate; + protected GregorianCalendar lastModTimeDate; + protected GregorianCalendar lastChangePasswordTimeDate; + + /** + * Whether or not the information fields of this user have been filled. + */ + protected boolean cachedInfo; + + /** + * Constructs a new User object instance given the name + * of the AFS user and the AFS cell, represented by + * cell, to which it belongs. This does not actually + * create a new AFS user, it just represents one. + * If name is not an actual AFS user, exceptions + * will be thrown during subsequent method invocations on this + * object, unless the {@link #create(String, int)} or {@link #create(String)} + * method is explicitly called to create it. + * + * @param name the name of the user to represent + * @param cell the cell to which the user belongs. + * @exception AFSException If an error occurs in the native code + */ + public User( String name, Cell cell ) throws AFSException + { + this.name = name; + this.cell = cell; + cellHandle = cell.getCellHandle(); + + groups = null; + groupNames = null; + groupsOwned = null; + groupsOwnedNames = null; + cachedInfo = false; + kas = false; + pts = false; + } + + /** + * Constructs a new User object instance given the name + * of the AFS user and the AFS cell, represented by + * cell, to which it belongs. This does not actually + * create a new AFS user, it just represents one. + * If name is not an actual AFS user, exceptions + * will be thrown during subsequent method invocations on this + * object, unless the {@link #create(String, int)} or {@link #create(String)} + * method is explicitly called to create it. Note that if the process + * doesn't exist and preloadAllMembers is true, an exception + * will be thrown. + * + *

    This constructor is ideal for point-in-time representation and + * transient applications. It ensures all data member values are set and + * available without calling back to the filesystem at the first request + * for them. Use the {@link #refresh()} method to address any coherency + * concerns. + * + * @param name the name of the user to represent + * @param cell the cell to which the user belongs. + * @param preloadAllMembers true will ensure all object members are + * set upon construction; + * otherwise members will be set upon access, + * which is the default behavior. + * @exception AFSException If an error occurs in the native code + * @see #refresh + */ + public User( String name, Cell cell, boolean preloadAllMembers ) + throws AFSException + { + this(name, cell); + if (preloadAllMembers) refresh(true); + } + + /** + * Constructs a blank User object given the cell to which + * the user belongs. This blank object can then be passed into other + * methods to fill out its properties. + * + * @exception AFSException If an error occurs in the native code + * @param cell the cell to which the user belongs. + */ + User( Cell cell ) throws AFSException + { + this( null, cell ); + } + + /*-------------------------------------------------------------------------*/ + + /** + * Creates the kas and pts entries for a new user in this cell. + * Automatically assigns a user id. + * * + * @param password the password for the new user + * @exception AFSException If an error occurs in the native code + */ + public void create( String password ) throws AFSException + { + create( password, 0 ); + } + + /** + * Creates the kas and pts entries for a new user in this cell. + * + * @param password the password for the new user + * @param uid the user id to assign to the new user + * + * @exception AFSException If an error occurs in the native code + */ + public void create( String password, int uid ) throws AFSException + { + create( cell.getCellHandle(), name, password, uid ); + } + + /** + * Deletes the pts and kas entries for a user in this cell. Deletes this user + * from the membership list of the groups to which it belonged, but does not + * delete the groups owned by this user. Also nullifies this corresponding + * Java object. + * + * @exception AFSException If an error occurs in the native code + */ + public void delete() throws AFSException + { + delete( cell.getCellHandle(), name ); + + cell = null; + name = null; + kas = false; + pts = false; + owner = null; + creator = null; + groups = null; + groupsOwned = null; + groupNames = null; + groupsOwnedNames = null; + lastModName = null; + encryptionKey = null; + lockedUntilDate = null; + userExpirationDate = null; + lastModTimeDate = null; + lastChangePasswordTimeDate = null; + try { + finalize(); + } catch( java.lang.Throwable t ) { + throw new AFSException( t.getMessage() ); + } + } + + /** + * Unlocks the given user if they were locked out of the cell. + * + * @param userName the name of the user to unlock + * @exception AFSException If an error occurs in the native code + */ + public void unlock() throws AFSException + { + unlock( cell.getCellHandle(), name ); + lockedUntil = 0; + lockedUntilDate = null; + } + + /** + * Flushes the current information of this User object to disk. + * This will update the information of the actual AFS user to match the + * settings that have been modified within this User object. + * This function must be called before any changes made to the information + * fields of this user will be seen by AFS. + * + * @exception AFSException If an error occurs in the native code + */ + public void flushInfo() throws AFSException + { + setUserInfo( cell.getCellHandle(), name, this ); + } + + /** + * Change the name of this user. Automatically flushes the info of this + * user in order to update kas entry of the new name. NOTE: renaming a + * locked user will unlock that user. + * + * @param newName the new name for this user + * @exception AFSException If an error occurs in the native code + */ + public void rename( String newName ) throws AFSException + { + rename( cell.getCellHandle(), name, newName ); + name = newName; + flushInfo(); + } + + /** + * Refreshes the properties of this User object instance with values from + * the AFS user it represents. All properties that have been initialized + * and/or accessed will be renewed according to the values of the AFS user + * this User object instance represents. + * + *

    Since in most environments administrative changes can be administered + * from an AFS command-line program or an alternate GUI application, this + * method provides a means to refresh the Java object representation and + * thereby ascertain any possible modifications that may have been made + * from such alternate administrative programs. Using this method before + * an associated instance accessor will ensure the highest level of + * representative accuracy, accommodating changes made external to the + * Java application space. If administrative changes to the underlying AFS + * system are only allowed via this API, then the use of this method is + * unnecessary. + * + * @exception AFSException If an error occurs in the native code + */ + public void refresh() throws AFSException + { + refresh(false); + } + + /** + * Refreshes the properties of this User object instance with values from + * the AFS user it represents. If all is true + * then all of the properties of this User object instance will be + * set, or renewed, according to the values of the AFS user it represents, + * disregarding any previously set properties. + * + *

    Thus, if all is false then properties that + * are currently set will be refreshed and properties that are not set will + * remain uninitialized. See {@link #refresh()} for more information. + * + * @param all if true set or renew all object properties; otherwise renew + * all set properties + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + protected void refresh(boolean all) throws AFSException + { + if ( all || cachedInfo ) { + refreshInfo(); + } + if ( all || groupsOwned != null ) { + refreshGroupsOwned(); + } + if ( all || groupsOwnedNames != null ) { + refreshGroupsOwnedNames(); + } + if ( all || groups != null ) { + refreshGroups(); + } + if ( all || groupNames != null ) { + refreshGroupNames(); + } + } + + /** + * Refreshes the information fields of this User to reflect + * the current state of the AFS user. Does not refresh the groups to which + * the user belongs or groups owned by the user. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshInfo() throws AFSException + { + getUserInfo( cell.getCellHandle(), name, this ); + cachedInfo = true; + lastModTimeDate = null; + lastChangePasswordTimeDate = null; + lockedUntilDate = null; + userExpirationDate = null; + } + + /** + * Refreshes the current information about the group names to which the + * user belongs. Does not refresh the information fields of the user or + * the groups owned. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshGroupNames() throws AFSException + { + String currName; + int iterationID = getUserGroupsBegin( cell.getCellHandle(), name ); + groupNames = new ArrayList(); + while( ( currName = getUserGroupsNextString( iterationID ) ) != null ) { + groupNames.add( currName ); + } + getUserGroupsDone( iterationID ); + } + + /** + * Refreshes the current information about the group objects to which the + * user belongs. Does not refresh the information fields of the user or + * the groups owned. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshGroups() throws AFSException + { + Group currGroup; + int iterationID = getUserGroupsBegin( cell.getCellHandle(), name ); + + groups = new ArrayList(); + + currGroup = new Group( cell ); + while( getUserGroupsNext( cellHandle, iterationID, currGroup ) != 0 ) { + groups.add( currGroup ); + currGroup = new Group( cell ); + } + getUserGroupsDone( iterationID ); + } + + /** + * Refreshes the current information about the group names that the user + * owns. Does not refresh the information fields of the user or the groups + * belonged to. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshGroupsOwnedNames() throws AFSException + { + String currName; + int iterationID = this.getGroupsOwnedBegin( cell.getCellHandle(), name ); + groupsOwnedNames = new ArrayList(); + while( ( currName = this.getGroupsOwnedNextString( iterationID ) ) + != null ) { + groupsOwnedNames.add( currName ); + } + this.getGroupsOwnedDone( iterationID ); + } + + /** + * Refreshes the current information about the group objects that the user \ + * owns. Does not refresh the information fields of the user or the groups + * belonged to. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshGroupsOwned() throws AFSException + { + Group currGroup; + int iterationID = getGroupsOwnedBegin( cell.getCellHandle(), name ); + groupsOwned = new ArrayList(); + currGroup = new Group( cell ); + while( getGroupsOwnedNext( cellHandle, iterationID, currGroup ) != 0 ) { + groupsOwned.add( currGroup ); + currGroup = new Group( cell ); + } + getGroupsOwnedDone( iterationID ); + } + + /** + * Adds an access control list entry for some AFS directory for this user. + * + * @param directory the full path of the place in the AFS file system + * for which to add an entry + * @param read whether or not to allow read access to this user + * @param write whether or not to allow write access to this user + * @param lookup whether or not to allow lookup access to this user + * @param delete whether or not to allow deletion access to this user + * @param insert whether or not to allow insertion access to this user + * @param lock whether or not to allow lock access to this user + * @param admin whether or not to allow admin access to this user + * @exception AFSException If an error occurs in the native code + public void setACL( String directory, boolean read, boolean write, boolean lookup, boolean delete, boolean insert, boolean lock, boolean admin ) throws AFSException + { + cell.setACL( directory, name, read, write, lookup, delete, insert, lock, admin ); + } + */ + + //////////////// ACCESSORS //////////////////////// + + /** + * Returns the name of this user. + * + * @return the name of this user + */ + public String getName() + { + return name; + } + + /** + * Returns the Cell this user belongs to. + * + * @return the Cell this user belongs to + */ + public Cell getCell() + { + return cell; + } + + /** + * Returns whether or not this user has a kas entry. + * + * @return whether or not this user has a kas entry + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public boolean isKAS() throws AFSException + { + if ( !cachedInfo ) refreshInfo(); + return kas; + } + + /** + * Returns whether or not this user has a pts entry. + * + * @return whether or not this user has a pts entry + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public boolean isPTS() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return pts; + } + + /** + * PTS: Returns an array of the Group objects + * to which this user belongs. + * + * @return an array of the groups to which this user belongs + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public Group[] getGroups() throws AFSException + { + if( groups == null ) refreshGroups(); + return (Group[]) groups.toArray( new Group[groups.size()] ); + } + + /** + * PTS: Returns the total count of groups this user owns. + * + *

    If the total list of groups or group names have already been + * collected (see {@link #getGroupsOwned()}), then the returning value + * will be calculated based upon the current list. Otherwise, PTS will + * be explicitly queried for the information. + * + * @return total count of groups this user owns + * @exception AFSException If an error occurs in the native code + * @see #getGroupsOwned() + * @see #getGroupsOwnedNames() + */ + public int getGroupsOwnedCount() throws AFSException + { + if( groupsOwned != null ) { + return groupsOwned.size(); + } else if ( groupsOwnedNames != null ) { + return groupsOwnedNames.size(); + } else { + return getGroupsOwnedCount( cell.getCellHandle(), name ); + } + } + + /** + * PTS: Returns an array of the Group objects + * this user owns. + * + * @return an array of the Groups this user owns + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public Group[] getGroupsOwned() throws AFSException + { + if( groupsOwned == null ) refreshGroupsOwned(); + return (Group[]) groupsOwned.toArray( new Group[groupsOwned.size()] ); + } + + /** + * PTS: Returns a String array of the group names + * to which this user belongs. + * + * @return a String array of the groups to which this + * user belongs + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public String[] getGroupNames() throws AFSException + { + if( groupNames == null ) refreshGroupNames(); + return (String []) groupNames.toArray( new String[groupNames.size() ] ); + } + + /** + * PTS: Returns a String array of the group names + * this user owns. + * + * @return a String array of the groups this user owns + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public String[] getGroupsOwnedNames() throws AFSException + { + if( groupsOwnedNames == null ) refreshGroupsOwnedNames(); + return (String []) groupsOwnedNames.toArray( new String[groupsOwnedNames.size() ] ); + } + + /** + * PTS: Returns the numeric AFS id of this user. + * + * @return the AFS id of this user + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getUID() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return nameUID; + } + + /** + * PTS: Returns how many more groups this user is allowed to create. + * -1 indicates unlimited. + * + * @return the group creation quota + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getGroupCreationQuota() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return groupCreationQuota; + } + + /** + * PTS: Returns the number of groups to which this user belongs. + * + * @return the group membership count + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getGroupMembershipCount() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return groupMembershipCount; + } + + /** + * PTS: Returns the owner of this user in the form of a {@link PTSEntry}. + * + *

    The returning object could be either a {@link User} or {@link Group}; + * to determine what type of object the {@link PTSEntry} represents, + * call the {@link PTSEntry#getType()} method. + * + * @return the owner of this user + * @exception AFSException If an error occurs in the native code + * @see PTSEntry + * @see PTSEntry#getType() + * @see #refresh() + */ + public PTSEntry getOwner() throws AFSException + { + if (!cachedInfo) refreshInfo(); + if (owner == null) return null; + if (ownerUID > 0) { + return new User(owner, cell); + } else { + return new Group(owner, cell); + } + } + + /** + * PTS: Returns the creator of this user in the form of a {@link PTSEntry}. + * + *

    The returning object could be either a {@link User} or {@link Group}; + * to determine what type of object the {@link PTSEntry} represents, + * call the {@link PTSEntry#getType()} method. + * + * @return the creator of this user + * @exception AFSException If an error occurs in the native code + * @see PTSEntry + * @see PTSEntry#getType() + * @see #refresh() + */ + public PTSEntry getCreator() throws AFSException + { + if (!cachedInfo) refreshInfo(); + if (creator == null) return null; + if (creatorUID > 0) { + return new User(creator, cell); + } else { + return new Group(creator, cell); + } + } + + /** + * Returns the type of {@link PTSEntry} this object represents. + * + *

    This method will always return {@link PTSEntry#PTS_USER}. + * + * @return the type of PTSEntry this object represents + (will always return {@link PTSEntry#PTS_USER}) + * @see PTSEntry + * @see PTSEntry#getType() + */ + public short getType() + { + return PTSEntry.PTS_USER; + } + + /** + * PTS: Returns who can list the status (pts examine) of this user. + * Valid values are: + *

      + *
    • {@link #USER_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #USER_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @return the status listing permission + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getListStatus() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return listStatus; + } + + /** + * PTS: Returns who can list the groups owned (pts listowned) by this user. + * Valid values are: + *
      + *
    • {@link #USER_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #USER_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @return the groups owned listing permission + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getListGroupsOwned() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return listGroupsOwned; + } + + /** + * PTS: Returns who can list the groups (pts membership) to which this + * user belongs. + * Valid values are: + *
      + *
    • {@link #USER_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #USER_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @return the membership listing permission + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getListMembership() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return listMembership; + } + + /** + * KAS: Returns whether or not this user has kas administrative privileges + * + * @return whether or not this user has kas administrative priveleges + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public boolean isAdmin() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return (adminSetting == this.ADMIN); + } + + /** + * KAS: Returns whether or not TGS will issue tickets for this user + * + * @return whether or not TGS will issue tickets for this user + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public boolean willGrantTickets() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return (tgsSetting == this.GRANT_TICKETS); + } + + /** + * KAS: Returns whether or not TGS can use this users ticket for an encryption key + * + * @return whether or not TGS can use this users ticket for an encryption key + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public boolean canEncrypt() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return (encSetting == this.ENCRYPT); + } + + /** + * KAS: Returns whether or not the user can change their password + * + * @return whether or not the user can change their password + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public boolean canChangePassword() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return (cpwSetting == this.CHANGE_PASSWORD); + } + + /** + * KAS: Returns whether or not the user can reuse their password + * + * @return whether or not the user can reuse their password + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public boolean canReusePassword() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return (rpwSetting == this.REUSE_PASSWORD); + } + + /** + * KAS: Returns the date and time the user expires. + * A null value indicates the user never exipres (or that + * there is no kas entry for this user). + * + * @return the date and time the user expires + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getUserExpiration() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return userExpiration; + } + /** + * KAS: Returns the date and time the user expires. + * A null value indicates the user never expires (or that + * there is no kas entry for this user). + * + * @return the date and time the user expires + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public GregorianCalendar getUserExpirationDate() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + if( userExpirationDate == null && userExpiration != 0 ) { + // make it into a date . . . + if( userExpiration == 0 ) { + userExpirationDate = null; + } else { + userExpirationDate = new GregorianCalendar(); + long longTime = ((long) userExpiration)*1000; + Date d = new Date( longTime ); + userExpirationDate.setTime( d ); + } + } + return userExpirationDate; + } + + /** + * KAS: Returns the date and time (in UTC) the user's KAS entry was + * last modified. + * + * @return the date and time (in UTC) the user was last modified + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getLastModTime() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return lastModTime; + } + /** + * KAS: Returns the date and time the user was last modified. + * + * @return the date and time the user was last modified + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public GregorianCalendar getLastModTimeDate() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + if( lastModTimeDate == null ) { + // make it into a date . . . + lastModTimeDate = new GregorianCalendar(); + long longTime = ((long) lastModTime)*1000; + Date d = new Date( longTime ); + lastModTimeDate.setTime( d ); + } + return lastModTimeDate; + } + + /** + * KAS: Returns the name of the user that last modified this user. + * + * @return the name of this user that last modified this user. + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public String getLastModName() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return lastModName; + } + + /** + * KAS: Returns the last date and time the user changed its password. + * + * @return the last date and time the user changed its password. + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public GregorianCalendar getLastChangePasswordTimeDate() + throws AFSException + { + if( !cachedInfo ) refreshInfo(); + if( lastChangePasswordTimeDate == null ) { + // make it into a date . . . + lastChangePasswordTimeDate = new GregorianCalendar(); + long longTime = ((long) lastChangePasswordTime)*1000; + Date d = new Date( longTime ); + lastChangePasswordTimeDate.setTime( d ); + } + return lastChangePasswordTimeDate; + } + + /** + * KAS: Returns the last date and time (in UTC) the user changed + * its password. + * + * @return the last date and time (in UTC) the user changed its password. + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getLastChangePasswordTime() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return lastChangePasswordTime; + } + + /** + * KAS: Returns the maximum lifetime of a ticket issued to this user + * (in seconds). + * + * @return the maximum lifetime of a ticket issued to this user (in seconds). + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getMaxTicketLifetime() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return maxTicketLifetime; + } + + /** + * KAS: Returns the number of days a password is valid before it expires. + * A value of 0 indicates passwords never expire. + * + * @return the number of days for which a password is valid + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getDaysToPasswordExpire() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return daysToPasswordExpire; + } + + /** + * KAS: Returns the number of failed login attempts this user is allowed + * before being locked out. A value of 0 indicates there is no limit. + * + * @return the number of failed login attempts a user is allowed + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getFailLoginCount() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return failLoginCount; + } + + /** + * KAS: Returns the amount of time (in seconds) a user is locked out when + * it exceeds the maximum number of allowable failed login attempts. + * A value of 0 indicates an infinite lockout time. + * + * @return the number of failed login attempts a user is allowed + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getLockTime() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return lockTime; + } + + /** + * KAS: Returns the encryption key, in octal form, of this user. An + * example of a key in octal form is: + * '\040\205\211\241\345\002\023\211'. + * + * @return the encryption key + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public String getEncryptionKey() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return encryptionKey; + } + + /** + * KAS: Returns the check sum of this user's key. + * + * @return the check sum + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public long getKeyCheckSum() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return keyCheckSum; + } + + /** + * KAS: Returns the version number of the user's key. + * + * @return the key version + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getKeyVersion() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return keyVersion; + } + + /** + * KAS: Returns the date and time (in UTC) at which the user stops + * being locked out. A value of 0 indicates the user is not currently + * locked out. If the user is locked out forever, the value + * will be equal to -1. + * + * @return the date and time (in UTC) at which the user stops being + * locked out + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public int getLockedUntil() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return lockedUntil; + } + + /** + * KAS: Returns the date and time at which the user stops being locked out. + * A value of null indicates the user is not currently locked + * out. If the user is locked out forever, the value + * getLockedUntil().getTime().getTime() will be equal to -1. + * + * @return the date and time at which the user stops being locked out + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + public GregorianCalendar getLockedUntilDate() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + if( lockedUntilDate == null ) { + // make it into a date . . . + Date d; + if( lockedUntil == 0 ) { + lockedUntilDate = null; + } else if( lockedUntil == -1 ) { + d = new Date( lockedUntil ); + lockedUntilDate = new GregorianCalendar(); + lockedUntilDate.setTime( d ); + } else { + d = new Date( ((long) lockedUntil)*1000 ); + lockedUntilDate = new GregorianCalendar(); + lockedUntilDate.setTime( d ); + } + } + return lockedUntilDate; + } + + /////////////// mutators //////////////////// + + /** + * PTS: Sets how many more groups this user is allowed to create. + * -1 indicates unlimited. + * + * @param quota the new group creation quota + */ + public void setGroupCreationQuota( int quota ) + { + groupCreationQuota = quota; + } + + + /** + * PTS: Sets who can list the status (pts examine) of this user. + * Valid values are: + *
      + *
    • {@link #USER_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #USER_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @param value the value of the new list status permission + * @exception AFSException if an error occurs in the native code + * @exception IllegalArgumentException if an invalud argument is provided + */ + public void setListStatus( int value ) throws AFSException + { + if( (value != this.USER_OWNER_ACCESS) && + (value != this.USER_ANYUSER_ACCESS) ) { + throw new IllegalArgumentException( "Cannot set listStatus to " + + value ); + } else { + listStatus = value; + } + } + + /** + * PTS: Sets who can list the groups owned (pts listowned) by this user. + * Valid values are: + *
      + *
    • {@link #USER_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #USER_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @param value the value of the new list groups owned permission + * @exception AFSException if an error occurs in the native code + * @exception IllegalArgumentException if an invalud argument is provided + */ + public void setListGroupsOwned( int value ) throws AFSException + { + if( (value != this.USER_OWNER_ACCESS) && + (value != this.USER_ANYUSER_ACCESS) ) { + throw new IllegalArgumentException( "Cannot set listGroupsOwned to " + + value ); + } else { + listGroupsOwned = value; + } + } + + /** + * PTS: Sets who can list the groups (pts membership) to which this + * user belongs. + * Valid values are: + *
      + *
    • {@link #USER_OWNER_ACCESS} + * -- only the owner has permission
    • + *
    • {@link #USER_ANYUSER_ACCESS} + * -- any user has permission
    • + *
    + * + * @param value the value of the new list membership permission + * @exception AFSException if an error occurs in the native code + * @exception IllegalArgumentException if an invalud argument is provided + */ + public void setListMembership( int value ) throws AFSException + { + if( (value != this.USER_OWNER_ACCESS) && + (value != this.USER_ANYUSER_ACCESS) ) { + throw new IllegalArgumentException( "Cannot set listMembership to " + + value ); + } else { + listMembership = value; + } + } + + /** + * KAS: Sets whether or not this user has kas administrative privileges + * + * @param setting whether or not this user has kas + * administrative privileges + */ + public void setAdmin( boolean setting ) + { + if ( setting ) { + adminSetting = this.ADMIN; + } else { + adminSetting = this.NO_ADMIN; + } + } + + /** + * KAS: Sets whether or not TGS will issue tickets for this user + * + * @param setting whether or not TGS will issue tickets for this user + */ + public void setGrantTickets( boolean setting ) + { + if ( setting ) { + tgsSetting = this.GRANT_TICKETS; + } else { + tgsSetting = this.NO_GRANT_TICKETS; + } + } + + /** + * KAS: Sets whether or not TGS can use this users ticket for an + * encryption key + * + * @param setting whether or not TGS can use this users ticket for an + * encryption key + */ + public void setEncrypt( boolean setting ) + { + if ( setting ) { + encSetting = this.ENCRYPT; + } else { + encSetting = this.NO_ENCRYPT; + } + } + + /** + * KAS: Sets whether or not the user can change their password + * + * @param setting whether or not the user can change their password + */ + public void setChangePassword( boolean setting ) + { + if ( setting ) { + cpwSetting = this.CHANGE_PASSWORD; + } else { + cpwSetting = this.NO_CHANGE_PASSWORD; + } + } + + /** + * KAS: Sets whether or not the user can reuse their password + * + * @param setting whether or not the user can reuse their password + */ + public void setReusePassword( boolean setting ) + { + if ( setting ) { + rpwSetting = this.REUSE_PASSWORD; + } else { + rpwSetting = this.NO_REUSE_PASSWORD; + } + } + + /** + * KAS: Sets the date and time the user expires. + * A null value indicates the user never exipres. + * + * @param expirationDate the date and time the user expires + */ + public void setUserExpiration( GregorianCalendar expirationDate ) + { + userExpirationDate = expirationDate; + if( expirationDate == null ) { + userExpiration = -1; + } else { + Date d = expirationDate.getTime(); + long millis = d.getTime(); + userExpiration = (int) (millis/((long)1000)); + } + } + + /** + * KAS: Sets the maximum lifetime of a ticket issued to this user + * (in seconds). + * + * @param seconds the maximum lifetime of a ticket issued to this user (in seconds). + */ + public void setMaxTicketLifetime( int seconds ) + { + maxTicketLifetime = seconds; + } + + /** + * KAS: Sets the number of days a password is valid before it expires. + * A value of 0 indicates passwords never expire. + * + * @param days the number of days for which a password is valid + */ + public void setDaysToPasswordExpire( int days ) + { + daysToPasswordExpire = days; + } + + /** + * KAS: Sets the number of failed login attempts this user is allowed before + * being locked out. A value of 0 indicates there is no limit. + * + * @param logins the number of failed login attempts a user is allowed + */ + public void setFailLoginCount( int logins ) + { + failLoginCount = logins; + } + + /** + * KAS: Sets the amount of time (in seconds) a user is locked out when it + * exceeds the maximum number of allowable failed login attempts. + * A value of 0 indicates an infinite lockout time. Any nonzero value gets + * rounded up to the next highest multiple of 8.5 minutes, and any value over + * 36 hours gets rounded down to 36 hours. + * + * @param seconds the number of failed login attempts a user is allowed + */ + public void setLockTime( int seconds ) + { + lockTime = seconds; + } + + /** + * Sets the password of this user to something new. Sets the key version + * to 0 automatically. + * + * @param newPassword the new password for this user + * @exception AFSException If an error occurs in the native code + */ + public void setPassword( String newPassword ) throws AFSException + { + this.setPassword( cell.getCellHandle(), name, newPassword ); + } + + /////////////// custom information methods //////////////////// + + /** + * Returns a String representation of this User. + * Contains the information fields and groups. + * + * @return a String representation of the User + */ + protected String getInfo() + { + String r; + try { + + r = "User: " + name; + + if( pts ) { + r += ", uid: " + getUID(); + } + r += "\n"; + r += "\tKAS: " + isKAS() + "\tPTS: " + isPTS() + "\n"; + + if( pts ) { + r += "\towner: " + getOwner().getName() + ", uid: " + + getOwner().getUID() + "\n"; + r += "\tcreator: " + getCreator().getName() + ", uid: " + + getCreator().getUID() + "\n"; + r += "\tGroup creation quota: " + getGroupCreationQuota() + "\n"; + r += "\tGroup membership count: " + getGroupMembershipCount() + + "\n"; + r += "\tList status: " + getListStatus() + "\n"; + r += "\tList groups owned: " + getListGroupsOwned() + "\n"; + r += "\tList membership: " + getListMembership() + "\n"; + } + + if( kas ) { + r += "\tKAS admin status: "; + + if( isAdmin() ) { + r += "Yes\n"; + } else { + r += "No\n"; + } + + r += "\tTGS grant tickets: "; + if( willGrantTickets() ) { + r += "Yes\n"; + } else { + r += "No\n"; + } + + r += "\tUse key as encryption key: "; + if( canEncrypt() ) { + r += "Yes\n"; + } else { + r += "No\n"; + } + + + r += "\tCan change password: "; + + if( canChangePassword() ) { + r += "Yes\n"; + } else { + r += "No\n"; + } + + r += "\tCan reuse password: "; + if( canReusePassword() ) { + r += "Yes\n"; + } else { + r += "No\n"; + } + + if( userExpiration != 0 ) { + r += "\tExpiration date: " + + getUserExpirationDate().getTime() + "\n"; + } else { + r += "\tUser never expires\n"; + } + r += "\tLast modified " + getLastModTimeDate().getTime() + + " by " + getLastModName() + "\n"; + r += "\tLast changed password " + + getLastChangePasswordTimeDate().getTime() + "\n"; + r += "\tMax ticket lifetime: " + getMaxTicketLifetime() + "\n"; + r += "\tKey: " + getEncryptionKey() + ", version: " + + getKeyVersion() + ", checksum: " + getKeyCheckSum() + "\n"; + r += "\tDays till password expires: " + getDaysToPasswordExpire() + + "\n"; + r += "\tAllowed failed logins: " + getFailLoginCount() + "\n"; + r += "\tLock time after failed logins: " + getLockTime() + "\n"; + if( lockedUntil == 0 ) { + r += "\tNot locked\n"; + } else if( getLockedUntilDate().getTime().getTime() == -1 ) { + r += "\tLocked forever\n"; + } else { + r += "\tLocked until: " + getLockedUntilDate().getTime() + + "\n"; + } + + } + if( pts ) { + + r += "\tBelongs to groups: \n"; + + String grps[] = getGroupNames(); + for( int i = 0; i < grps.length; i++ ) { + r += "\t\t" + grps[i] + "\n"; + } + + r += "\tOwns groups: \n"; + grps = getGroupsOwnedNames(); + for( int i = 0; i < grps.length; i++ ) { + r += "\t\t" + grps[i] + "\n"; + } + + } + } catch( AFSException e ) { + return e.toString(); + } + return r; + } + + /** + * Returns a String containing the String + * representations of all the groups to which this user belongs. + * + * @return a String representation of the groups belonged to + * @see Group#toString + */ + protected String getInfoGroups() throws AFSException + { + String r; + r = "User: " + name + "\n\n"; + r += "--Member of Groups:--\n"; + + Group grps[] = getGroups(); + for( int i = 0; i < grps.length; i++ ) { + r += grps[i].getInfo() + "\n"; + } + return r; + } + + /** + * Returns a String containing the String + * representations of all the groups that this user owns. + * + * @return a String representation of the groups owned + * @see Group#toString + */ + protected String getInfoGroupsOwned() throws AFSException + { + String r; + r = "User: " + name + "\n\n"; + r += "--Owns Groups:--\n"; + Group grps[] = getGroupsOwned(); + for( int i = 0; i < grps.length; i++ ) { + r += grps[i].getInfo() + "\n"; + } + return r; + } + + /////////////// custom override methods //////////////////// + + /** + * Compares two User objects respective to their names and does not + * factor any other attribute. Alphabetic case is significant in + * comparing names. + * + * @param user The User object to be compared to this User instance + * + * @return Zero if the argument is equal to this User's name, a + * value less than zero if this User's name is + * lexicographically less than the argument, or a value greater + * than zero if this User's name is lexicographically + * greater than the argument + */ + public int compareTo(User user) + { + return this.getName().compareTo(user.getName()); + } + + /** + * Comparable interface method. + * + * @see #compareTo(User) + */ + public int compareTo(Object obj) + { + return compareTo((User)obj); + } + + /** + * Tests whether two User objects are equal, based on their + * names. + * + * @param otherUser the user to test + * @return whether the specifed user is the same as this user + */ + public boolean equals( User otherUser ) + { + return name.equals(otherUser.getName()); + } + + /** + * Returns the name of this User + * + * @return the name of this User + */ + public String toString() + { + return getName(); + } + + + /////////////// native methods //////////////////// + + /** + * Creates the kas and pts entries for a new user. Pass in 0 for the uid + * if pts is to automatically assign the user id. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @param userName the name of the user to create + * @param password the password for the new user + * @param uid the user id to assign to the user (0 to have one + * automatically assigned) + * @exception AFSException If an error occurs in the native code + */ + protected static native void create( int cellHandle, String userName, + String password, int uid ) + throws AFSException; + + /** + * Deletes the pts and kas entry for a user. Deletes this user from the + * membership list of the groups to which it belonged, but does not delete + * the groups owned by this user. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @param groupName the name of the user to delete + * @exception AFSException If an error occurs in the native code + */ + protected static native void delete( int cellHandle, String userName ) + throws AFSException; + + /** + * Unlocks a user. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @param groupName the name of the user to unlock + * @exception AFSException If an error occurs in the native code + */ + protected static native void unlock( int cellHandle, String userName ) + throws AFSException; + + /** + * Fills in the information fields of the provided User. + * Fills in values based on the current pts and kas information of the user. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @param name the name of the user for which to get the information + * @param user the User object in which to fill in the + * information + * @see User + * @exception AFSException If an error occurs in the native code + */ + protected static native void getUserInfo( int cellHandle, String name, + User user ) + throws AFSException; + + /** + * Sets the information values of this AFS user to be the parameter values. + * Sets both kas and pts fields. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @param name the name of the user for which to set the information + * @param theUser the User object containing the desired + * information + * @exception AFSException If an error occurs in the native code + */ + protected static native void setUserInfo( int cellHandle, String name, + User theUser ) + throws AFSException; + + /** + * Renames the given user. Does not update the info fields of the kas entry + * -- the calling code is responsible for that. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @param oldName the name of the user to rename + * @param newName the new name for the user + * @exception AFSException If an error occurs in the native code + */ + protected static native void rename( int cellHandle, String oldName, + String newName ) + throws AFSException; + + /** + * Sets the password of the given user. Sets the key version to 0. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @param userName the name of the user for which to set the password + * @param newPassword the new password for the user + * @exception AFSException If an error occurs in the native code + */ + protected static native void setPassword( int cellHandle, String userName, + String newPassword ) + throws AFSException; + + /** + * Begin the process of getting the groups to which the user belongs. + * Returns an iteration ID to be used by subsequent calls to + * getUserGroupsNext and getUserGroupsDone. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @param name the name of the user for which to get the groups + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + */ + protected static native int getUserGroupsBegin( int cellHandle, String name ) + throws AFSException; + + /** + * Returns the next group to which the user belongs. Returns + * null if there are no more groups. + * + * @param iterationId the iteration ID of this iteration + * @see #getUserGroupsBegin + * @return the name of the next group + * @exception AFSException If an error occurs in the native code + */ + protected static native String getUserGroupsNextString( int iterationId ) + throws AFSException; + + /** + * Fills the next group object of which the user belongs. Returns 0 if there + * are no more groups, != 0 otherwise. + * + * @param cellHandle the handle of the cell to which the users belong + * @see Cell#getCellHandle + * @param iterationId the iteration ID of this iteration + * @see #getUserGroupsBegin + * @param theGroup a Group object to be populated with the values of the + * next group + * @return 0 if there are no more users, != 0 otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getUserGroupsNext( int cellHandle, + int iterationId, + Group theGroup ) + throws AFSException; + + /** + * Signals that the iteration is complete and will not be accessed anymore. + * + * @param iterationId the iteration ID of this iteration + * @see #getUserGroupsBegin + * @exception AFSException If an error occurs in the native code + */ + protected static native void getUserGroupsDone( int iterationId ) + throws AFSException; + + /** + * Returns the total number of groups owned by the user. + * + * @param cellHandle the handle of the cell to which the user belongs + * @param name the name of the user for which to get the groups + * @return total number of groups owned by the user + * @exception AFSException If an error occurs in the native code + * @see Cell#getCellHandle + */ + protected static native int getGroupsOwnedCount( int cellHandle, String name ) + throws AFSException; + + /** + * Begin the process of getting the groups that a user or group owns. + * Returns an iteration ID to be used by subsequent calls to + * getGroupsOwnedNext and getGroupsOwnedDone. + * + * @param cellHandle the handle of the cell to which the user belongs + * @see Cell#getCellHandle + * @param name the name of the user or group for which to get the groups + * @return an iteration ID + * @exception AFSException If an error occurs in the native code + */ + protected static native int getGroupsOwnedBegin( int cellHandle, + String name ) + throws AFSException; + + /** + * Returns the next group the user or group owns. Returns null + * if there are no more groups. + * + * @param iterationId the iteration ID of this iteration + * @see #getGroupsOwnedBegin + * @return the name of the next group + * @exception AFSException If an error occurs in the native code + */ + protected static native String getGroupsOwnedNextString( int iterationId ) + throws AFSException; + + /** + * Fills the next group object that the user or group owns. Returns 0 if + * there are no more groups, != 0 otherwise. + * + * @param cellHandle the handle of the cell to which the users belong + * @see Cell#getCellHandle + * @param iterationId the iteration ID of this iteration + * @see #getGroupsOwnedBegin + * @param theGroup a Group object to be populated with the values of the + * next group + * @return 0 if there are no more users, != 0 otherwise + * @exception AFSException If an error occurs in the native code + */ + protected static native int getGroupsOwnedNext( int cellHandle, + int iterationId, + Group theGroup ) + throws AFSException; + + /** + * Signals that the iteration is complete and will not be accessed anymore. + * + * @param iterationId the iteration ID of this iteration + * @see #getGroupsOwnedBegin + * @exception AFSException If an error occurs in the native code + */ + protected static native void getGroupsOwnedDone( int iterationId ) + throws AFSException; + + /** + * Reclaims all memory being saved by the user portion of the native library. + * This method should be called when no more Users are expected + * to be used. + */ + protected static native void reclaimUserMemory(); +} diff --git a/src/JAVA/classes/org/openafs/jafs/Volume.java b/src/JAVA/classes/org/openafs/jafs/Volume.java new file mode 100644 index 000000000..85fe4ca2b --- /dev/null +++ b/src/JAVA/classes/org/openafs/jafs/Volume.java @@ -0,0 +1,1381 @@ +/* + * @(#)Volume.java 1.0 6/29/2001 + * + * Copyright (c) 2001 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +package org.openafs.jafs; + +import java.util.GregorianCalendar; +import java.util.Date; +import java.io.Serializable; + +/** + * An abstract representation of an AFS volume. It holds information about + * the server, such as what its quota is. + *

    + * + * Constructing an instance of a Volume does not mean an actual + * AFS partition is created on a partition -- usually a Volume + * object is a representation of an already existing AFS volume. If, + * however, the Volume is constructed with the name of a + * volume that does not exist in the cell to which the provided + * Partition belongs, a new AFS volume with that name can be + * created on that partition by calling the {@link #create(int)} method. If + * such a volume does already exist when this method is called, an exception + * will be thrown.

    + * + * + * The following is a simple example of how to construct and use a + * Volume object. This example obtains the list of + * Volume objects residing on a particular partition, and prints + * out the name and id of each one.

    + * + *
    + * import org.openafs.jafs.Cell;
    + * import org.openafs.jafs.AFSException;
    + * import org.openafs.jafs.Partition;
    + * import org.openafs.jafs.Server;
    + * import org.openafs.jafs.Volume;
    + * ...
    + * public class ...
    + * {
    + *   ...
    + *   private Cell cell;
    + *   private Server server;
    + *   private Partition partition;
    + *   ...
    + *   public static void main(String[] args) throws Exception
    + *   {
    + *     String username      = arg[0];
    + *     String password      = arg[1];
    + *     String cellName      = arg[2];
    + *     String serverName    = arg[3];
    + *     String partitionName = arg[4];
    + * 
    + *     token  = new Token(username, password, cellName);
    + *     cell   = new Cell(token);
    + *     server = cell.getServer(serverName);
    + *     partition = cell.getPartition(partitionName);
    + * 
    + *     System.out.println("Volumes in Partition " + partition.getName() + ":");
    + *     Volume[] volumes = partition.getVolumes();
    + *     for (int i = 0; i < volumes.length; i++) {
    + *       System.out.println(" -> " + volumes[i] + ": " + volumes[i].getID());
    + *     }
    + *   }
    + *   ...
    + * }
    + * 
    + * + */ +public class Volume implements Serializable, Comparable +{ + /** + * Read-write volume type + */ + public static final int VOLUME_TYPE_READ_WRITE = 0; + /** + * Read-only volume type + */ + public static final int VOLUME_TYPE_READ_ONLY = 1; + /** + * Backup volume type + */ + public static final int VOLUME_TYPE_BACKUP = 2; + + /** + * Status/disposition ok + */ + public static final int VOLUME_OK = 0; + /** + * Status/disposition salvage + */ + public static final int VOLUME_SALVAGE = 1; + /** + * Status/disposition no vnode + */ + public static final int VOLUME_NO_VNODE = 2; + /** + * Status/disposition no volume + */ + public static final int VOLUME_NO_VOL = 3; + /** + * Status/disposition volume exists + */ + public static final int VOLUME_VOL_EXISTS = 4; + /** + * Status/disposition no service + */ + public static final int VOLUME_NO_SERVICE = 5; + /** + * Status/disposition offline + */ + public static final int VOLUME_OFFLINE = 6; + /** + * Status/disposition online + */ + public static final int VOLUME_ONLINE = 7; + /** + * Status/disposition disk full + */ + public static final int VOLUME_DISK_FULL = 8; + /** + * Status/disposition over quota + */ + public static final int VOLUME_OVER_QUOTA = 9; + /** + * Status/disposition busy + */ + public static final int VOLUME_BUSY = 10; + /** + * Status/disposition moved + */ + public static final int VOLUME_MOVED = 11; + + protected Cell cell; + protected Server server; + protected Partition partition; + + protected String name; + + protected int id; + protected int readWriteID; + protected int readOnlyID; + protected int backupID; + + protected long creationDate; + protected long lastAccessDate; + protected long lastUpdateDate; + protected long lastBackupDate; + protected long copyCreationDate; + + protected int accessesSinceMidnight; + protected int fileCount; + protected int maxQuota; + protected int currentSize; + protected int status; + protected int disposition; + protected int type; + + protected GregorianCalendar creationDateCal; + protected GregorianCalendar lastUpdateDateCal; + protected GregorianCalendar copyCreationDateCal; + + protected boolean cachedInfo; + + /** + * Constructs a new Volume object instance given the name of + * the AFS volume and the AFS cell, represented by partition, + * to which it belongs. This does not actually + * create a new AFS volume, it just represents one. + * If name is not an actual AFS volume, exceptions + * will be thrown during subsequent method invocations on this + * object, unless the {@link #create(int)} method is explicitly called + * to create it. + * + * @param name the name of the volume to represent + * @param partition the partition on which the volume resides + * @exception AFSException If an error occurs in the native code + */ + public Volume( String name, Partition partition ) throws AFSException + { + this.partition = partition; + this.server = partition.getServer(); + this.cell = server.getCell(); + this.name = name; + + creationDateCal = null; + lastUpdateDateCal = null; + copyCreationDateCal = null; + + id = -1; + cachedInfo = false; + } + + /** + * Constructs a new Volume object instance given the name of + * the AFS volume and the AFS partition, represented by + * partition, to which it belongs. This does not actually + * create a new AFS volume, it just represents one. + * If name is not an actual AFS volume, exceptions + * will be thrown during subsequent method invocations on this + * object, unless the {@link #create(int)} method is explicitly called + * to create it. Note that if the volume doesn't exist and + * preloadAllMembers is true, an exception will be thrown. + * + *

    This constructor is ideal for point-in-time representation and + * transient applications. It ensures all data member values are set + * and available without calling back to the filesystem at the first request + * for them. Use the {@link #refresh()} method to address any coherency + * concerns. + * + * @param name the name of the volume to represent + * @param partition the partition on which the volume resides. + * @param preloadAllMembers true will ensure all object members are set + * upon construction; otherwise members will be + * set upon access, which is the default behavior. + * @exception AFSException If an error occurs in the native code + * @see #refresh + */ + public Volume( String name, Partition partition, boolean preloadAllMembers ) + throws AFSException + { + this(name, partition); + if (preloadAllMembers) refresh(true); + } + + /** + * Creates a blank Volume given the cell to which the volume + * belongs, the server on which the partition resides, and + * the partition on which the volume resides. This blank + * object can then be passed into other methods to fill out its properties. + * + * @exception AFSException If an error occurs in the native code + * @param cell the cell to which the server belongs. + * @param server the server on which the partition resides + * @param partition the partition on which the volume resides + */ + Volume( Partition partition ) throws AFSException + { + this( null, partition ); + } + + /*-------------------------------------------------------------------------*/ + + /** + * Refreshes the properties of this Volume object instance with values from + * the AFS volume it represents. All properties that have been initialized + * and/or accessed will be renewed according to the values of the AFS volume + * this Volume object instance represents. + * + *

    Since in most environments administrative changes can be administered + * from an AFS command-line program or an alternate GUI application, this + * method provides a means to refresh the Java object representation and + * thereby ascertain any possible modifications that may have been made + * from such alternate administrative programs. Using this method before + * an associated instance accessor will ensure the highest level of + * representative accuracy, accommodating changes made external to the + * Java application space. If administrative changes to the underlying AFS + * system are only allowed via this API, then the use of this method is + * unnecessary. + * + * @exception AFSException If an error occurs in the native code + */ + public void refresh() throws AFSException + { + refresh(false); + } + + /** + * Refreshes the properties of this Volume object instance with values from + * the AFS volume it represents. If all is true + * then all of the properties of this Volume object instance will be + * set, or renewed, according to the values of the AFS volume it represents, + * disregarding any previously set properties. + * + *

    Thus, if all is false then properties that + * are currently set will be refreshed and properties that are not set will + * remain uninitialized. See {@link #refresh()} for more information. + * + * @param all if true set or renew all object properties; otherwise renew + * all set properties + * @exception AFSException If an error occurs in the native code + * @see #refresh() + */ + protected void refresh(boolean all) throws AFSException + { + if (all || cachedInfo) refreshInfo(); + } + + /** + * Refreshes the information fields of this Volume to reflect + * the current state of the AFS volume. These include the last update time, + * file count, etc. + * + * @exception AFSException If an error occurs in the native code + */ + protected void refreshInfo() throws AFSException + { + getVolumeInfo( cell.getCellHandle(), server.getVosHandle(), + partition.getID(), getID(), this ); + cachedInfo = true; + creationDateCal = null; + lastUpdateDateCal = null; + copyCreationDateCal = null; + } + + /** + * Creates a new volume on the server and partition given upon construction. + * + * @param quota the quota for the volume in K, 0 indicates an unlimited + * quota + * + * @exception AFSException If an error occurs in the native code + */ + public void create( int quota ) throws AFSException + { + id = create( cell.getCellHandle(), server.getVosHandle(), + partition.getID(), name, quota ); + maxQuota = quota; + } + + /** + * Creates a backup volume for this volume. + * + * @return the Volume object representation for the + * backup volume that was created + * @exception AFSException If an error occurs in the native code + */ + public Volume createBackup( ) throws AFSException + { + createBackupVolume( cell.getCellHandle(), getID() ); + return new Volume( name + ".backup", partition ); + } + + /** + * Creates a readonly site for this volume on the specified server and + * partition. Automatically releases the volume. + * + * @param sitePartition the partition on which the readonly volume is + * to reside + * + * @return the Volume representation for the + * read-only volume that was created + * @exception AFSException If an error occurs in the native code + */ + public Volume createReadOnly( Partition sitePartition ) + throws AFSException + { + Server siteServer = sitePartition.getServer(); + createReadOnlyVolume( cell.getCellHandle(), siteServer.getVosHandle(), + sitePartition.getID(), getID() ); + release( false ); + return new Volume( name + ".readonly", sitePartition ); + } + + /** + * Deletes the volume from the cell. + * + * @exception AFSException If an error occurs in the native code + */ + public void delete() throws AFSException + { + delete( cell.getCellHandle(), server.getVosHandle(), partition.getID(), + getID() ); + name = null; + creationDateCal = null; + lastUpdateDateCal = null; + copyCreationDateCal = null; + cell = null; + server = null; + partition = null; + } + + /** + * Releases this volume, which updates the read-only copies of it. + * + *

    This method will force a complete release; a complete release updates + * all read-only sites even if the VLDB entry has a flag. + * + * @exception AFSException If an error occurs in the native code + */ + public void release() throws AFSException + { + this.release( true ); + } + + /** + * Releases this volume, which updates the read-only copies of it. + * + * @param forceComplete whether or not to force a complete release; + * a complete release updates all read-only sites + * even if the VLDB entry has a flag + * @exception AFSException If an error occurs in the native code + */ + public void release( boolean forceComplete ) throws AFSException + { + release( cell.getCellHandle(), getID(), forceComplete ); + } + + /** + * Dumps this volume to a file. If you use the dumpSince argument you will + * create an incremental dump, but you can leave it null + * for a full dump. + * + * @param fileName the path name of the file on the client machine to + * which to dump this volume + * @param dumpSince dump only files that have been modified more recently + * than this date + * @exception AFSException If an error occurs in the native code + */ + public void dump( String fileName, GregorianCalendar dumpSince ) + throws AFSException + { + int startTime = 0; + if ( dumpSince != null ) { + startTime = (int) ((dumpSince.getTime().getTime())/((long) 1000)); + } + dump( cell.getCellHandle(), server.getVosHandle(), partition.getID(), + getID(), startTime, fileName ); + } + + /** + * Dumps this volume to a file. Creates a full dump. + * + * @param fileName the path name of the file to which to dump this volume + * @exception AFSException If an error occurs in the native code + */ + public void dump( String fileName ) throws AFSException + { + this.dump( fileName, null ); + } + + /** + * Restores a file to this volume. Note that this does not have to be an + * existing volume in order to be restored - you may create a + * Volume as a volume that doesn't yet exist and then restore + * a file to it. Or you can restore over an existing volume. If a new + * volume is being created with this method, the id will be automatically + * assigned. + * + * @param fileName the path name of the file on the client machine from + * which to restore this volume + * @param incremental if true, restores an incremental dump over an + * existing volume + * @exception AFSException If an error occurs in the native code + */ + public void restore( String fileName, boolean incremental ) + throws AFSException + { + restore( fileName, incremental, 0 ); + } + + /** + * Restores a file to this volume. Note that this does not have to be an + * existing volume in order to be restored - you may create a + * Volume as a volume that doesn't yet exist and then restore + * a file to it. Or you can restore over an existing volume. + * + * @param fileName the path name of the file on the client machine from + * which to restore this volume + * @param incremental if true, restores an incremental dump over an + * existing volume + * @param id the id to assign this volume + * @exception AFSException If an error occurs in the native code + */ + public void restore( String fileName, boolean incremental, int id ) + throws AFSException + { + restore( cell.getCellHandle(), server.getVosHandle(), partition.getID(), + id, name, fileName, incremental ); + } + + /** + * Mounts this volume, bringing it online and making it accessible. + * + * @exception AFSException If an error occurs in the native code + */ + public void mount( ) throws AFSException + { + mount( server.getVosHandle(), partition.getID(), getID(), 0, true ); + } + + /** + * Unmounts this volume, bringing it offline and making it inaccessible. + * + * @exception AFSException If an error occurs in the native code + */ + public void unmount( ) throws AFSException + { + unmount( server.getVosHandle(), partition.getID(), getID() ); + } + + /** + * Locks the VLDB enrty for this volume + * + * @exception AFSException If an error occurs in the native code + */ + public void lock( ) throws AFSException + { + lock( cell.getCellHandle(), getID() ); + } + + /** + * Unlocks the VLDB entry for this volume + * + * @exception AFSException If an error occurs in the native code + */ + public void unlock( ) throws AFSException + { + unlock( cell.getCellHandle(), getID() ); + } + + /** + * Moves this volume to the specified partition (which indirectly + * specifies a new server, as well). Caution: This will remove any backup + * volumes at the original site. + * + * @param newPartition the partition to which to move the volume + * + * @exception AFSException If an error occurs in the native code + */ + public void moveTo( Partition newPartition ) throws AFSException + { + Server newServer = newPartition.getServer(); + move( cell.getCellHandle(), server.getVosHandle(), partition.getID(), + newServer.getVosHandle(), newPartition.getID(), getID() ); + + server = newServer; + partition = newPartition; + } + + /** + * Renames this volume. + * + * @param newName the new name for this volume + * @exception AFSException If an error occurs in the native code + */ + public void rename( String newName ) throws AFSException + { + rename( cell.getCellHandle(), getID(), newName ); + name = newName; + } + + /** + * Salvages (restores consistency to) this volume. Uses default values for + * most salvager options in order to simplify the API. + * + * @exception AFSException If an error occurs in the native code + */ + public void salvage() throws AFSException + { + Server.salvage( cell.getCellHandle(), server.getBosHandle(), + partition.getName(), name, 4, null, null, false, false, + false, false, false, false ); + } + + /** + * Creates a read-write mount point for this volume. Does not ensure the + * volume already exists. + * + * @param directory the name of the directory where this volume + * should be mounted + * @exception AFSException If an error occurs in the native code + */ + public void createMountPoint( String directory ) throws AFSException + { + createMountPoint(directory, true); + } + + /** + * Creates a mount point for this volume. Does not ensure the volume + * already exists. + * + * @param directory the name of the directory where this volume should be + * mounted + * @param readWrite whether or not this mount point should be read-write + * @exception AFSException If an error occurs in the native code + */ + public void createMountPoint( String directory, boolean readWrite ) + throws AFSException + { + Cell.createMountPoint( cell.getCellHandle(), directory, getName(), + readWrite, false ); + } + + //////////////// accessors: //////////////////////// + + /** + * Returns the name of this volume. + * + * @return the name of this volume + */ + public String getName() + { + return name; + } + + /** + * Returns this volume's hosting partition. + * + * @return this volume's partition + */ + public Partition getPartition() + { + return partition; + } + + /** + * Returns the id of this volume. + * + * @exception AFSException If an error occurs in the native code + * @return the id of this volume + */ + public int getID() throws AFSException + { + if( id == -1 && name != null ) { + String nameNoSuffix; + if( name.endsWith( "backup" ) ) { + type = VOLUME_TYPE_BACKUP; + nameNoSuffix = name.substring( 0, name.lastIndexOf( '.' ) ); + } else if( name.endsWith( "readonly" ) ) { + type = VOLUME_TYPE_READ_ONLY; + nameNoSuffix = name.substring( 0, name.lastIndexOf( '.' ) ); + } else { + type = VOLUME_TYPE_READ_WRITE; + nameNoSuffix = name; + } + id = translateNameToID( cell.getCellHandle(), + nameNoSuffix, type ); + } + return id; + } + + /** + * Returns the read-write ID of this volume + * + * @exception AFSException If an error occurs in the native code + * @return the read-write id + */ + public int getReadWriteID() throws AFSException + { + if( !cachedInfo ) { + refreshInfo(); + } + return readWriteID; + } + + /** + * Returns the read-only ID of this volume + * + * @exception AFSException If an error occurs in the native code + * @return the read-only id + */ + public int getReadOnlyID() throws AFSException + { + if( !cachedInfo ) { + refreshInfo(); + } + return readOnlyID; + } + + /** + * Returns the backup ID of this volume + * + * @exception AFSException If an error occurs in the native code + * @return the backup id + */ + public int getBackupID() throws AFSException + { + if( !cachedInfo ) { + refreshInfo(); + } + return backupID; + } + + /** + * Returns the date the volume was created + * + * @return the date the volume was created + * @exception AFSException If an error occurs in the native code + */ + public GregorianCalendar getCreationDate() throws AFSException + { + if( !cachedInfo ) { + refreshInfo(); + } + if( creationDateCal == null ) { + // make it into a date . . . + creationDateCal = new GregorianCalendar(); + Date d = new Date( creationDate*1000 ); + creationDateCal.setTime( d ); + } + return creationDateCal; + } + + /** + * Returns the date the volume was last updated. + * After this method is called once, it saves the date + * and returns that date on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return the date the volume was last updated + * @exception AFSException If an error occurs in the native code + */ + public GregorianCalendar getLastUpdateDate() throws AFSException + { + if( !cachedInfo ) { + refreshInfo(); + } + if( lastUpdateDateCal == null ) { + // make it into a date . . . + lastUpdateDateCal = new GregorianCalendar(); + Date d = new Date( lastUpdateDate*1000 ); + lastUpdateDateCal.setTime( d ); + } + return lastUpdateDateCal; + } + + /** + * Returns the date the volume was copied. + * After this method is called once, it saves the date + * and returns that date on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @return the date the volume was copied + * @exception AFSException If an error occurs in the native code + */ + public GregorianCalendar getCopyCreationDate() throws AFSException + { + if( !cachedInfo ) { + refreshInfo(); + } + if( copyCreationDateCal == null ) { + // make it into a date . . . + copyCreationDateCal = new GregorianCalendar(); + Date d = new Date( copyCreationDate*1000 ); + copyCreationDateCal.setTime( d ); + } + return copyCreationDateCal; + } + + /** + * Returns the number of accesses since midnight. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return the number of accesses since midnight + */ + public int getAccessesSinceMidnight() throws AFSException + { + if( !cachedInfo ) { + refreshInfo(); + } + return accessesSinceMidnight; + } + + /** + * Returns file count. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return the file count + */ + public int getFileCount() throws AFSException + { + if( !cachedInfo ) { + refreshInfo(); + } + return fileCount; + } + + /** + * Returns current volume size in K. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return the current volume size in K + */ + public int getCurrentSize() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return currentSize; + } + + /** + * Returns the difference between quota and current volume size (in K). + * + *

    Please note: the product of this method is not saved. + * + * @exception AFSException If an error occurs in the native code + * @return the current free space in K + */ + public int getTotalFreeSpace() throws AFSException + { + if ( !cachedInfo ) refreshInfo(); + return (maxQuota - currentSize); + } + + /** + * Returns this volume's quota, expressed in kilobyte blocks (1024 + * kilobyte blocks equal one megabyte). After this method is called once, + * it saves the value and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + *

    Note: A quota value of zero, "0", grants an unlimited quota + * in AFS. Consequently, to avoid delusion this method will throw an + * {@link AFSException} if the returning value is zero. + * + * @exception AFSException If an error occurs in the native code or + * this volume's quota is configured as + * unlimited. + * @return the volume quota in K + * @see #isQuotaUnlimited() + */ + public int getQuota() throws AFSException + { + if ( !cachedInfo ) refreshInfo(); + if (maxQuota == 0) { + throw new AFSException("Volume with id " + id + + " has an unlimited quota configured.", 0); + } + return maxQuota; + } + + /** + * Tests whether this volume's quota is configured as unlimited. + * + *

    After this method is called once, it saves the value and returns + * that value on subsequent calls, until the {@link #refresh()} + * method is called and a more current value is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return true if this volume's quota is configured as + * unlimited; otherwise false. + * @see #getQuota() + */ + public boolean isQuotaUnlimited() throws AFSException + { + if ( !cachedInfo ) refreshInfo(); + return (maxQuota == 0); + } + + /** + * Returns volume status. Possible values are:

      + *
    • {@link #VOLUME_OK}
    • + *
    • {@link #VOLUME_SALVAGE}
    • + *
    • {@link #VOLUME_NO_VNODE}
    • + *
    • {@link #VOLUME_NO_VOL}
    • + *
    • {@link #VOLUME_VOL_EXISTS}
    • + *
    • {@link #VOLUME_NO_SERVICE}
    • + *
    • {@link #VOLUME_OFFLINE}
    • + *
    • {@link #VOLUME_ONLINE}
    • + *
    • {@link #VOLUME_DISK_FULL}
    • + *
    • {@link #VOLUME_OVER_QUOTA}
    • + *
    • {@link #VOLUME_BUSY}
    • + *
    • {@link #VOLUME_MOVED}
    + * Typical value is VOLUME_OK. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return volume status + */ + public int getStatus() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return status; + } + + /** + * Returns volume disposition. Possible values are:
      + *
    • {@link #VOLUME_OK}
    • + *
    • {@link #VOLUME_SALVAGE}
    • + *
    • {@link #VOLUME_NO_VNODE}
    • + *
    • {@link #VOLUME_NO_VOL}
    • + *
    • {@link #VOLUME_VOL_EXISTS}
    • + *
    • {@link #VOLUME_NO_SERVICE}
    • + *
    • {@link #VOLUME_OFFLINE}
    • + *
    • {@link #VOLUME_ONLINE}
    • + *
    • {@link #VOLUME_DISK_FULL}
    • + *
    • {@link #VOLUME_OVER_QUOTA}
    • + *
    • {@link #VOLUME_BUSY}
    • + *
    • {@link #VOLUME_MOVED}
    + * Typical value is VOLUME_ONLINE. + * After this method is called once, it saves the value + * and returns that value on subsequent calls, + * until the {@link #refresh()} method is called and a more current + * value is obtained. + * + * @exception AFSException If an error occurs in the native code + * @return volume disposition + */ + public int getDisposition() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return disposition; + } + + /** + * Returns volume type. Possible values are:
      + *
    • {@link #VOLUME_TYPE_READ_WRITE}
    • + *
    • {@link #VOLUME_TYPE_READ_ONLY}
    • + *
    • {@link #VOLUME_TYPE_BACKUP}
    + * + * @exception AFSException If an error occurs in the native code + * @return volume type + */ + public int getType() throws AFSException + { + if( !cachedInfo ) refreshInfo(); + return type; + } + + //////////////// mutators: //////////////////////// + + /** + * Sets quota of volume, 0 denotes an unlimited quota. + * + * @exception AFSException If an error occurs in the native code + * @param quota the new volume quota in K (0 for unlimited) + */ + public void setQuota( int quota ) throws AFSException + { + this.changeQuota( cell.getCellHandle(), server.getVosHandle(), + partition.getID(), getID(), quota ); + maxQuota = quota; + } + + /////////////// custom information methods //////////////////// + + /** + * Returns a String representation of this Volume. + * Contains the information fields. + * + * @return a String representation of the Volume + */ + protected String getInfo() + { + String r; + try { + r = "Volume: " + name + "\tid: " + getID() + "\n"; + + r += "\tread-write id: " + getReadWriteID() + "\tread-only id: " + + getReadOnlyID() + "\n"; + r += "\tbackup id: " + getBackupID() + "\n"; + + r += "\tcreation date: " + getCreationDate().getTime() + "\n"; + r += "\tlast update date: " + getLastUpdateDate().getTime() + "\n"; + r += "\tcopy creation date: " + getCopyCreationDate().getTime() + "\n"; + r += "\taccesses since midnight: " + getAccessesSinceMidnight() + "\n"; + r += "\tfile count: " + getFileCount() + "\n"; + r += "\tcurrent size: " + getCurrentSize() + " K\tquota: " + + getQuota() + " K\n"; + r += "\tstatus: "; + switch( getStatus() ) { + case VOLUME_OK: + r += "OK"; + break; + default: + r += "OTHER"; + } + + r += "\tdisposition: "; + switch( getDisposition() ) { + case VOLUME_ONLINE: + r += "ONLINE"; + break; + default: + r += "OTHER - " + getDisposition(); + } + r += "\n"; + + r += "\ttype: "; + switch( getType() ) { + case VOLUME_TYPE_READ_WRITE: + r += "read-write"; + break; + case VOLUME_TYPE_READ_ONLY: + r += "read-only"; + break; + case VOLUME_TYPE_BACKUP: + r += "backup"; + break; + default: + r += "OTHER"; + } + r += "\n"; + + } catch( Exception e ) { + return e.toString(); + } + return r; + } + + /////////////// custom override methods //////////////////// + + /** + * Compares two Volume objects respective to their names and does not + * factor any other attribute. Alphabetic case is significant in + * comparing names. + * + * @param volume The Volume object to be compared to this Volume + * instance + * + * @return Zero if the argument is equal to this Volume's name, a + * value less than zero if this Volume's name is + * lexicographically less than the argument, or a value greater + * than zero if this Volume's name is lexicographically + * greater than the argument + */ + public int compareTo(Volume volume) + { + return this.getName().compareTo(volume.getName()); + } + + /** + * Comparable interface method. + * + * @see #compareTo(Volume) + */ + public int compareTo(Object obj) + { + return compareTo((Volume)obj); + } + + /** + * Tests whether two Volume objects are equal, based on their + * names and hosting partition. + * + * @param otherVolume the Volume to test + * @return whether the specifed Volume is the same as this Volume + */ + public boolean equals( Volume otherVolume ) + { + return ( name.equals(otherVolume.getName()) ) && + ( this.getPartition().equals(otherVolume.getPartition()) ); + } + + /** + * Returns the name of this Volume + * + * @return the name of this Volume + */ + public String toString() + { + return getName(); + } + + + /////////////// native methods //////////////////// + + /** + * Fills in the information fields of the provided Volume. + * + * @param cellHandle the handle of the cell to which the volume belongs + * @see Cell#getCellHandle + * @param serverHandle the vos handle of the server on which the volume + * resides + * @see Server#getVosServerHandle + * @param partition the numeric id of the partition on which the volume + * resides + * @param volId the numeric id of the volume for which to get the info + * @param theVolume the {@link Volume Volume} object in which to fill in + * the information + * @exception AFSException If an error occurs in the native code + */ + protected static native void getVolumeInfo( int cellHandle, int serverHandle, + int partition, int volId, + Volume theVolume ) + throws AFSException; + + /** + * Creates a volume on a particular partition. + * + * @param cellHandle the handle of the cell in which to create the volume + * @see Cell#getCellHandle + * @param serverHandle the vos handle of the server on which to create + * the volume + * @see Server#getVosServerHandle + * @param partition the numeric id of the partition on which to create + * the volume + * @param volumeName the name of the volume to create + * @param quota the amount of space (in KB) to set as this volume's quota + * @return the numeric ID assigned to the volume + * @exception AFSException If an error occurs in the native code + */ + protected static native int create( int cellHandle, int serverHandle, + int partition, String volumeName, + int quota ) + throws AFSException; + + /** + * Deletes a volume from a particular partition. + * + * @param cellHandle the handle of the cell in which to delete the volume + * @see Cell#getCellHandle + * @param serverHandle the vos handle of the server from which to delete + * the volume + * @see Server#getVosServerHandle + * @param partition the numeric id of the partition from which to delete + * the volume + * @param volId the numeric id of the volume to delete + * @exception AFSException If an error occurs in the native code + */ + protected static native void delete( int cellHandle, int serverHandle, + int partition, int volId ) + throws AFSException; + + /** + * Creates a backup volume for the specified regular volume. + * + * @param cellHandle the handle of the cell to which the volume belongs + * @param volId the numeric id of the volume for which to create a backup + * volume + * @see Cell#getCellHandle + */ + protected static native void createBackupVolume( int cellHandle, int volId ) + throws AFSException; + + /** + * Creates a read-only volume for the specified regular volume. + * + * @param cellHandle the handle of the cell to which the volume belongs + * @param serverHandle the vos handle of the server on which the read-only + * volume is to reside + * @see Server#getVosServerHandle + * @param partition the numeric id of the partition on which the read-only + volume is to reside + * @param volId the numeric id of the volume for which to create a read-only volume + * @see Cell#getCellHandle + */ + protected static native void createReadOnlyVolume( int cellHandle, + int serverHandle, + int partition, int volId ) + throws AFSException; + + /** + * Deletes a read-only volume for the specified regular volume. + * + * @param cellHandle the handle of the cell to which the volume belongs + * @param serverHandle the vos handle of the server on which the read-only + * volume residea + * @see Server#getVosServerHandle + * @param partition the numeric id of the partition on which the read-only + * volume resides + * @param volId the numeric read-write id of the volume for which to + * delete the read-only volume + * @see Cell#getCellHandle + */ + protected static native void deleteReadOnlyVolume( int cellHandle, + int serverHandle, + int partition, int volId ) + throws AFSException; + + /** + * Changes the quota of the specified volume. + * + * @param cellHandle the handle of the cell to which the volume belongs + * @see Cell#getCellHandle + * @param serverHandle the vos handle of the server on which the volume + * resides + * @see Server#getVosServerHandle + * @param partition the numeric id of the partition on which the volume + * resides + * @param volId the numeric id of the volume for which to change the quota + * @param newQuota the new quota (in KB) to assign the volume + * @exception AFSException If an error occurs in the native code + */ + protected static native void changeQuota( int cellHandle, int serverHandle, + int partition, int volId, + int newQuota ) + throws AFSException; + + /** + * Move the specified volume to a different site. + * + * @param cellHandle the handle of the cell to which the volume belongs + * @see Cell#getCellHandle + * @param fromServerHandle the vos handle of the server on which the volume + * currently resides + * @see Server#getVosServerHandle + * @param fromPartition the numeric id of the partition on which the volume + * currently resides + * @param toServerHandle the vos handle of the server to which the volume + * should be moved + * @param toPartition the numeric id of the partition to which the volume + * should be moved + * @param volId the numeric id of the volume to move + * @exception AFSException If an error occurs in the native code + */ + protected static native void move( int cellHandle, int fromServerHandle, + int fromPartition, int toServerHandle, + int toPartition, int volId ) + throws AFSException; + + /** + * Releases the specified volume that has readonly volume sites. + * + * @param cellHandle the handle of the cell to which the volume belongs + * @param volId the numeric id of the volume to release + * @param forceComplete whether or not to force a complete release + * @see Cell#getCellHandle + */ + protected static native void release( int cellHandle, int volId, + boolean forceComplete ) + throws AFSException; + + /** + * Dumps the specified volume to a file. + * + * @param cellHandle the handle of the cell to which the volume belongs + * @see Cell#getCellHandle + * @param serverHandle the vos handle of the server on which the volume + * resides + * @see Server#getVosServerHandle + * @param partition the numeric id of the partition on which the + * volume resides + * @param volId the numeric id of the volume to dump + * @param startTime files with a modification time >= to this time will + * be dumped + * @param dumpFile the full path of the file to which to dump + * @exception AFSException If an error occurs in the native code + */ + protected static native void dump( int cellHandle, int serverHandle, + int partition, int volId, int startTime, + String dumpFile ) + throws AFSException; + + /** + * Restores the specified volume from a dump file. + * + * @param cellHandle the handle of the cell to which the volume belongs + * @see Cell#getCellHandle + * @param serverHandle the vos handle of the server on which the volume is + * to reside + * @see Server#getVosServerHandle + * @param partition the numeric id of the partition on which the volume is + * to reside + * @param volId the numeric id to assign the restored volume (can be 0) + * @param volumeName the name of the volume to restore as + * @param dumpFile the full path of the dump file from which to restore + * @param incremental if true, restores an incremental dump over an existing + * volume (server and partition values must correctly + * indicate the current position of the existing volume), + * otherwise restores a full dump + * @exception AFSException If an error occurs in the native code + */ + protected static native void restore( int cellHandle, int serverHandle, + int partition, int volId, + String volumeName, String dumpFile, + boolean incremental ) + throws AFSException; + + /** + * Renames the specified read-write volume. + * + * @param cellHandle the handle of the cell to which the volume belongs + * @see Cell#getCellHandle + * @param volId the numeric id of the read-write volume to rename + * @param newVolumeName the new name for the volume + * @exception AFSException If an error occurs in the native code + */ + protected static native void rename( int cellHandle, int volId, + String newVolumeName ) + throws AFSException; + + /** + * "Mounts" the specified volume, bringing it online. + * + * @param serverHandle the vos handle of the server on which the volume + * resides + * @see Server#getVosServerHandle + * @param partition the numeric id of the partition on which the volume + * resides + * @param volId the numeric id of the volume to bring online + * @param sleepTime ? (not sure what this is yet, possibly a time to wait + * before brining it online) + * @param offline ? (not sure what this is either, probably the current + * status of the volume -- busy or offline) + * @exception AFSException If an error occurs in the native code + */ + protected static native void mount( int serverHandle, int partition, + int volId, int sleepTime, + boolean offline ) + throws AFSException; + + /** + * "Unmounts" the specified volume, bringing it offline. + * + * @param serverHandle the vos handle of the server on which the volume + * resides + * @see Server#getVosServerHandle + * @param partition the numeric id of the partition on which the volume + * resides + * @param volId the numeric id of the volume to bring offline + * @exception AFSException If an error occurs in the native code + */ + protected static native void unmount( int serverHandle, int partition, + int volId ) + throws AFSException; + + /** + * Locks the VLDB entry specified volume + * + * @param cellHandle the handle of the cell on which the volume resides + * @see Cell#getCellHandle + * @param volId the numeric id of the volume to lock + * @exception AFSException If an error occurs in the native code + */ + protected static native void lock( int cellHandle, int volId ) + throws AFSException; + + /** + * Unlocks the VLDB entry of the specified volume + * + * @param cellHandle the handle of the cell on which the volume resides + * @see Cell#getCellHandle + * @param volId the numeric id of the volume to unlock + * @exception AFSException If an error occurs in the native code + */ + protected static native void unlock( int cellHandle, int volId ) + throws AFSException; + + /** + * Translates a volume name into a volume id + * + * @param cellHandle the handle of the cell to which the volume belongs + * @see Cell#getCellHandle + * @param name the name of the volume in question, cannot end in backup or + * readonly + * @param type the type of volume: read-write, read-only, or backup. + * Acceptable values are:
      + *
    • {@link #VOLUME_TYPE_READ_WRITE}
    • + *
    • {@link #VOLUME_TYPE_READ_ONLY}
    • + *
    • {@link #VOLUME_TYPE_BACKUP}
    + * @return the id of the volume in question + * @exception AFSException If an error occurs in the native code + */ + protected static native int translateNameToID( int cellHandle, String name, + int volumeType ) + throws AFSException; + + /** + * Reclaims all memory being saved by the volume portion of the native + * library. This method should be called when no more Volume + * objects are expected to be used. + */ + protected static native void reclaimVolumeMemory(); +} diff --git a/src/JAVA/libjafs/.cvsignore b/src/JAVA/libjafs/.cvsignore new file mode 100644 index 000000000..f3c7a7c5d --- /dev/null +++ b/src/JAVA/libjafs/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/src/JAVA/libjafs/ACL.c b/src/JAVA/libjafs/ACL.c new file mode 100644 index 000000000..64b245f0a --- /dev/null +++ b/src/JAVA/libjafs/ACL.c @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 +#include + +#include "Internal.h" +#include "org_openafs_jafs_ACL.h" + +#include +#include +#include +#include +#include + +/* + #include +*/ + +/* just for debugging */ +#define MAXHOSTS 13 +#define OMAXHOSTS 8 +#define MAXNAME 100 +#define MAXSIZE 2048 +#define MAXINSIZE 1300 /* pioctl complains if data is larger than this */ +#define VMSGSIZE 128 /* size of msg buf in volume hdr */ + +static char space[MAXSIZE]; + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +#define ACL_LEN 1024 + +extern int errno; + +/** + * Returns a formatted string representing the ACL for the specified path. + * + * path the directory path + * returns NULL if an exception is encountered. + */ +char * +getACL(char *path) +{ + struct ViceIoctl params; + char *buffer; + + params.in = NULL; + params.out = NULL; + params.in_size = 0; + params.out_size = 0; + + buffer = (char *)malloc(ACL_LEN); + + if (!buffer) { + fprintf(stderr, "ERROR: ACL::getACL -> could not allocate buffer\n"); + return NULL; + } + + params.out = buffer; + params.out_size = ACL_LEN; + + if (call_syscall(AFSCALL_PIOCTL, path, VIOCGETAL, ¶ms, 1, 0)) { + fprintf(stderr, "ERROR: ACL::getACL -> VIOCGETAL failed: %d\n", + errno); + free(buffer); + return NULL; + } + + return params.out; +} + +/** + * Sets the ACL for the specified path using the provided string + * representation. + * + * path the directory path + * aclString string representation of ACL to be set + * returns TRUE if the operation succeeds; otherwise FALSE; + */ +jboolean +setACL(char *path, char *aclString) +{ + struct ViceIoctl params; + char *redirect, *parentURI, *cptr; + + params.in = aclString; + params.in_size = strlen(aclString) + 1; + params.out = NULL; + params.out_size = 0; + + if (call_syscall(AFSCALL_PIOCTL, path, VIOCGETAL, ¶ms, 1)) { + fprintf(stderr, "ERROR: ACL::setACL -> VIOCSETAL failed: %d\n", + errno); + return JNI_FALSE; + } + + return JNI_TRUE; +} + +/** + * Returns a formatted string representing the ACL for the specified path. + * + * The string format is in the form of a ViceIoctl and is as follows: + * printf("%d\n%d\n", positiveEntriesCount, negativeEntriesCount); + * printf("%s\t%d\n", userOrGroupName, rightsMask); + * + * path the directory path + * returns NULL if an exception is encountered. + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_ACL_getACLString(JNIEnv * env, jobject obj, + jstring pathUTF) +{ + char *path, *acl; + jstring answer = NULL; + + path = getNativeString(env, pathUTF); + if (path == NULL) { + fprintf(stderr, "ERROR: ACL::getACLString ->"); + fprintf(stderr, "path = NULL\n"); + throwAFSException(env, JAFSNULLPATH); + return NULL; + } + + acl = getACL(path); + free(path); + + if (acl) { + answer = (*env)->NewStringUTF(env, acl); + free(acl); + } else { + throwAFSException(env, errno); + } + + return answer; +} + +/** + * Sets the ACL for the specified path using the provided string + * representation. + * + * The string format is in the form of a ViceIoctl and is as follows: + * printf("%d\n%d\n", positiveEntriesCount, negativeEntriesCount); + * printf("%s\t%d\n", userOrGroupName, rightsMask); + * + * path the directory path + * aclString string representation of ACL to be set + * throws an afsAdminExceptionName if an internal exception is encountered. + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_ACL_setACLString(JNIEnv * env, jobject obj, + jstring pathUTF, jstring aclStringUTF) +{ + char *path, *aclString; + + if (pathUTF == NULL) { + fprintf(stderr, "ERROR: ACL::setACLString -> pathUTF == NULL\n"); + throwAFSException(env, JAFSNULLPATH); + return; + } + + if (aclStringUTF == NULL) { + fprintf(stderr, "ERROR: ACL::setACLString -> aclStringUTF == NULL\n"); + throwAFSException(env, JAFSNULLACL); + return; + } + + /* path = (char*) (*env)->GetStringUTFChars(env, pathUTF, 0); */ + path = getNativeString(env, pathUTF); + if (path == NULL) { + fprintf(stderr, "ERROR: ACL::setACLString -> failed to get path\n"); + throwMessageException(env, "Failed to get path."); + return; + } + + /* aclString = (char*) (*env)->GetStringUTFChars(env, aclStringUTF, 0); */ + aclString = getNativeString(env, aclStringUTF); + if (aclString == NULL) { + free(path); + fprintf(stderr, + "ERROR: ACL::setACLString -> failed to get aclString\n"); + throwMessageException(env, "Failed to get ACL string."); + return; + } + + if (!setACL(path, aclString)) { + throwAFSException(env, errno); + } + + /* Clean up */ + free(path); + free(aclString); + + /* + * (*env)->ReleaseStringUTFChars(env, pathUTF, path); + * (*env)->ReleaseStringUTFChars(env, aclStringUTF, aclString); + */ +} diff --git a/src/JAVA/libjafs/AdminToken.c b/src/JAVA/libjafs/AdminToken.c new file mode 100644 index 000000000..af543a33a --- /dev/null +++ b/src/JAVA/libjafs/AdminToken.c @@ -0,0 +1,383 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 "Internal.h" +#include "org_openafs_jafs_Cell.h" +#include "org_openafs_jafs_Token.h" + +#include +#include +#include +#include +#include +#include +#include + +/** + * Static function used to initialize the client library and the + * jafs library. + * + * env the Java environment + * obj the current Java object + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Token_initializeAdminClient(JNIEnv * env, jclass cls) +{ + afs_status_t ast; + if (!afsclient_Init(&ast)) { + throwAFSException(env, ast); + return; + } +} + + +/** + * Authenticates the given user and password in the cell. Returns + * a token that can be used to prove this authentication later. + * + * env the Java environment + * obj the current Java object + * jcellName the name of the cell in which to authenticate this user + * juserName the name of the user to authenticate + * jpassword the password of the user + * returns a token representing the authentication + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Token_getToken(JNIEnv * env, jobject obj, + jstring jcellName, jstring juserName, + jstring jpassword) +{ + afs_status_t ast; + char *cellName; + char *userName; + char *password; + void *tokenHandle; + int rc; + + // convert java strings + if (jcellName != NULL) { + cellName = getNativeString(env, jcellName); + if (!cellName) { + throwAFSException(env, JAFSADMNOMEM); + return 0; + } + } else { + cellName = NULL; + } + + if (juserName != NULL) { + userName = getNativeString(env, juserName); + if (!userName) { + if (cellName != NULL) + free(cellName); + throwAFSException(env, JAFSADMNOMEM); + return 0; + } + } else { + if (cellName != NULL) + free(cellName); + throwAFSException(env, JAFSNULLUSER); + return 0; + } + + if (jpassword != NULL) { + password = getNativeString(env, jpassword); + if (!password) { + if (cellName != NULL) + free(cellName); + free(userName); + throwAFSException(env, JAFSADMNOMEM); + return 0; + } + } else { + if (cellName != NULL) + free(cellName); + free(userName); + throwAFSException(env, JAFSNULLPASS); + return 0; + } + + if (! + (afsclient_TokenGetNew + (cellName, userName, password, &tokenHandle, &ast))) { + throwAFSException(env, ast); + } + + if (cellName != NULL) + free(cellName); + free(userName); + free(password); + + return (jint) tokenHandle; +} + +/** + * Closes the given currently open token. + * + * env the Java environment + * obj the current Java object + * tokenHandle the token to close + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Token_close(JNIEnv * env, jobject obj, jint tokenHandle) +{ + afs_status_t ast; + + if (!afsclient_TokenClose((void *)tokenHandle, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Opens a cell for administrative use, based on the token provided. + * Returns a cell handle to be used by other methods as a means of + * authentication. + * + * env the Java environment + * obj the current Java object + * jcellName the name of the cell for which to get the handle + * tokenHandle a token handle previously returned by a call to getToken + * returns a handle to the open cell + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getCellHandle(JNIEnv * env, jobject obj, + jstring jcellName, jint tokenHandle) +{ + afs_status_t ast; + char *cellName; + void *cellHandle; + + if (jcellName != NULL) { + cellName = getNativeString(env, jcellName); + if (!cellName) { + throwAFSException(env, JAFSADMNOMEM); + return -1; + } + } else { + throwAFSException(env, JAFSNULLCELL); + return -1; + } + + if (!afsclient_CellOpen(cellName, (void *)tokenHandle, &cellHandle, &ast)) { + throwAFSException(env, ast); + } + + free(cellName); + + return (jint) cellHandle; +} + +/** + * Closes the given currently open cell handle. + * + * env the Java environment + * obj the current Java object + * cellHandle the cell handle to close + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Cell_closeCell(JNIEnv * env, jobject obj, + jint cellHandle) +{ + afs_status_t ast; + + if (!afsclient_CellClose((void *)cellHandle, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Opens a server for administrative vos use, based on the cell handle + * provided. Returns a vos server handle to be used by other + * methods as a means of identification. + * + * env the Java environment + * obj the current Java object + * cellHandle a cell handle previously returned by + * a call to getCellHandle + * jserverName the name of the server for which to retrieve + * a vos handle + * returns a vos handle to the server + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getVosServerHandle(JNIEnv * env, jobject obj, + jint cellHandle, + jstring jserverName) +{ + afs_status_t ast; + void *serverHandle; + char *serverName; + + if (jserverName != NULL) { + serverName = getNativeString(env, jserverName); + if (!serverName) { + throwAFSException(env, JAFSADMNOMEM); + return -1; + } + } else { + throwAFSException(env, JAFSNULLSERVER); + return -1; + } + + if (!vos_ServerOpen + ((void *)cellHandle, serverName, (void **)&serverHandle, &ast)) { + throwAFSException(env, ast); + } + // release converted string + free(serverName); + + return (jint) serverHandle; +} + +/** + * Closes the given currently open vos server handle. + * + * env the Java environment + * obj the current Java object + * vosServerHandle the vos server handle to close + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_closeVosServerHandle(JNIEnv * env, jobject obj, + jint vosServerHandle) +{ + afs_status_t ast; + + if (!vos_ServerClose((void *)vosServerHandle, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Opens a server for administrative bos use, based on the cell handle + * provided. Returns a bos server handle to be used by other methods + * as a means of identification. + * + * env the Java environment + * obj the current Java object + * cellHandle a cell handle previously returned by a call + * to getCellHandle + * jserverName the name of the server for which to retrieve + * a bos handle + * returns a bos handle to the server + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getBosServerHandle(JNIEnv * env, jobject obj, + jint cellHandle, + jstring jserverName) +{ + afs_status_t ast; + void *serverHandle; + char *serverName; + + if (jserverName != NULL) { + serverName = getNativeString(env, jserverName); + if (!serverName) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLSERVER); + return; + } + + if (!bos_ServerOpen + ((void *)cellHandle, serverName, (void **)&serverHandle, &ast)) { + throwAFSException(env, ast); + } + // release converted string + free(serverName); + + return (jint) serverHandle; +} + +/** + * Closes the given currently open bos server handle. + * + * env the Java environment + * obj the current Java object + * bosServerHandle the bos server handle to close + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_closeBosServerHandle(JNIEnv * env, jobject obj, + jint bosServerHandle) +{ + afs_status_t ast; + + if (!bos_ServerClose((void *)bosServerHandle, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Gets the expiration time for a given token. + * + * env the Java environment + * obj the current Java object + * + * tokenHandle a token handle previously returned by a call + * to getToken + * returns a long representing the UTC time for the token expiration + */ +JNIEXPORT jlong JNICALL +Java_org_openafs_jafs_Token_getExpiration(JNIEnv * env, jobject obj, + jint tokenHandle) +{ + afs_status_t ast; + unsigned long expTime; + char *prince = malloc(sizeof(char) * KAS_MAX_NAME_LEN); + char *inst = malloc(sizeof(char) * KAS_MAX_NAME_LEN); + char *cell = malloc(sizeof(char) * AFS_MAX_SERVER_NAME_LEN); + int hkt; + + if (!prince || !inst || !cell) { + if (prince) { + free(prince); + } + if (inst) { + free(inst); + } + if (cell) { + free(cell); + } + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (!afsclient_TokenQuery + ((void *)tokenHandle, &expTime, prince, inst, cell, &hkt, &ast)) { + throwAFSException(env, ast); + } + + free(prince); + free(inst); + free(cell); + + return (jlong) expTime; +} + +// reclaim global memory used by this portion +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Token_reclaimAuthMemory(JNIEnv * env, jclass cls) +{ +} diff --git a/src/JAVA/libjafs/Cell.c b/src/JAVA/libjafs/Cell.c new file mode 100644 index 000000000..f4c8e563c --- /dev/null +++ b/src/JAVA/libjafs/Cell.c @@ -0,0 +1,1413 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 "Internal.h" +#include "org_openafs_jafs_Cell.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/*----------------------------------------------------------------------- + * Definitions in Internal.c + */ +extern jclass userCls; +//extern jfieldID user_cellHandleField; +extern jfieldID user_nameField; +extern jfieldID user_cachedInfoField; + +extern jclass groupCls; +//extern jfieldID group_cellHandleField; +extern jfieldID group_nameField; +extern jfieldID group_cachedInfoField; + +extern jclass serverCls; +//extern jfieldID server_cellHandleField; +extern jfieldID server_cachedInfoField; + +/*----------------------------------------------------------------------- + * Definition in User.c + */ +extern void getUserInfoChar(JNIEnv * env, int cellHandle, const char *name, + jobject user); + +/*----------------------------------------------------------------------- + * Definition in Group.c + */ +extern void getGroupInfoChar(JNIEnv * env, int cellHandle, const char *name, + jobject group); + +/*----------------------------------------------------------------------- + * Definition in Server.c + */ +extern void fillServerInfo(JNIEnv * env, jint cellHandle, jobject server, + afs_serverEntry_t servEntry); + + +/*-----------------------------------------------------------------------*/ + +/** + * Returns the total number of KAS users belonging to the cell denoted + * by cellHandle. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * returns total count of KAS users + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getKasUserCount(JNIEnv * env, jclass cls, + jint cellHandle) +{ + afs_status_t ast; + void *iterationId; + kas_identity_t who; + int i = 0; + + if (!kas_PrincipalGetBegin((void *)cellHandle, NULL, &iterationId, &ast)) { + throwAFSException(env, ast); + return -1; + } + + while (kas_PrincipalGetNext((void *)iterationId, &who, &ast)) + i++; + + if (ast != ADMITERATORDONE) { + throwAFSException(env, ast); + return -1; + } + + return i; +} + + +/** + * Begin the process of getting the kas users that belong to the cell. + * Returns an iteration ID to be used by subsequent calls to + * getKasUsersNextString (or getKasUsersNext) + * and getKasUsersDone. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getKasUsersBegin(JNIEnv * env, jclass cls, + jint cellHandle) +{ + afs_status_t ast; + void *iterationId; + + if (!kas_PrincipalGetBegin((void *)cellHandle, NULL, &iterationId, &ast)) { + throwAFSException(env, ast); + return; + } + + return (jint) iterationId; +} + +/** + * Begin the process of getting the KAS users, starting at + * startIndex, that belong to the cell. + * Returns an iteration ID to be used by subsequent calls to + * getKasUsersNextString (or getKasUsersNext) + * and getKasUsersDone. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * startIndex the starting base-zero index + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getKasUsersBeginAt(JNIEnv * env, jclass cls, + jint cellHandle, + jint startIndex) +{ + afs_status_t ast; + void *iterationId; + kas_identity_t who; + int i; + + if (!kas_PrincipalGetBegin((void *)cellHandle, NULL, &iterationId, &ast)) { + throwAFSException(env, ast); + return; + } + + for (i = 1; i < startIndex; i++) { + if (!kas_PrincipalGetNext((void *)iterationId, &who, &ast)) { + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + } + + return (jint) iterationId; +} + +/** + * Returns the next kas user of the cell. Returns null if there + * are no more users. Appends instance names to principal names as follows: + * principal.instance + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * returns the name of the next user of the cell + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_Cell_getKasUsersNextString(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + kas_identity_t who; + jstring juser; + + if (!kas_PrincipalGetNext((void *)iterationId, &who, &ast)) { + if (ast == ADMITERATORDONE) { + return NULL; + // other + } else { + throwAFSException(env, ast); + return; + } + } + + if (strcmp(who.instance, "")) { + char *fullName = (char *)malloc(sizeof(char) * (strlen(who.principal) + + strlen(who.instance) + + 2)); + if (!fullName) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + *fullName = '\0'; + strcat(fullName, who.principal); + strcat(fullName, "."); + strcat(fullName, who.instance); + juser = (*env)->NewStringUTF(env, fullName); + free(fullName); + } else { + juser = (*env)->NewStringUTF(env, who.principal); + } + + return juser; + +} + +/** + * Fills the next kas user object of the cell. Returns 0 if there + * are no more users, != 0 otherwise. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * iterationId the iteration ID of this iteration + * juserObject a User object to be populated with the values of + * the next kas user + * returns 0 if there are no more users, != 0 otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getKasUsersNext(JNIEnv * env, jclass cls, + jint cellHandle, jint iterationId, + jobject juserObject) +{ + + afs_status_t ast; + kas_identity_t who; + jstring juser; + char *fullName = NULL; + + + if (!kas_PrincipalGetNext((void *)iterationId, &who, &ast)) { + if (ast == ADMITERATORDONE) { + return 0; + // other + } else { + throwAFSException(env, ast); + return 0; + } + } + // take care of the instance stuff(by concatenating with a period in between) + if (strcmp(who.instance, "")) { + fullName = + (char *)malloc(sizeof(char) * + (strlen(who.principal) + strlen(who.instance) + + 2)); + if (!fullName) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + *fullName = '\0'; + strcat(fullName, who.principal); + strcat(fullName, "."); + strcat(fullName, who.instance); + juser = (*env)->NewStringUTF(env, fullName); + } else { + juser = (*env)->NewStringUTF(env, who.principal); + } + + if (userCls == 0) { + internal_getUserClass(env, juserObject); + } + + (*env)->SetObjectField(env, juserObject, user_nameField, juser); + + if (fullName != NULL) { + getUserInfoChar(env, (int)cellHandle, fullName, juserObject); + free(fullName); + } else { + getUserInfoChar(env, (int)cellHandle, who.principal, juserObject); + } + (*env)->SetBooleanField(env, juserObject, user_cachedInfoField, TRUE); + + return 1; + +} + +/** + * Signals that the iteration is complete and will not be accessed anymore. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Cell_getKasUsersDone(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + + if (!kas_PrincipalGetDone((void *)iterationId, &ast)) { + throwAFSException(env, ast); + return; + } + +} + +/** + * Returns the name of the cell. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * returns the name of the cell + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_Cell_getCellName(JNIEnv * env, jclass cls, + jint cellHandle) +{ + afs_status_t ast; + char *cellName; + jstring jcellName; + + if (!afsclient_CellNameGet + ((void *)cellHandle, (const char **)&cellName, &ast)) { + throwAFSException(env, ast); + return; + } + + jcellName = (*env)->NewStringUTF(env, cellName); + + return jcellName; + +} + +/** + * Returns the total number of PTS users belonging to the cell denoted + * by cellHandle. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * returns total number of PTS users + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getPtsUserCount(JNIEnv * env, jclass cls, + jint cellHandle) +{ + afs_status_t ast; + void *iterationId; + char *userName; + int i = 0; + + if (!pts_UserListBegin((void *)cellHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return -1; + } + + userName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + + if (!userName) { + throwAFSException(env, JAFSADMNOMEM); + return -1; + } + + while (pts_UserListNext((void *)iterationId, userName, &ast)) + i++; + + free(userName); + + if (ast != ADMITERATORDONE) { + throwAFSException(env, ast); + return -1; + } + + return i; +} + +/** + * Returns the total number of PTS users, belonging to the cell denoted + * by cellHandle, that are not in KAS. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * returns total number of users that are in PTS and not KAS + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getPtsOnlyUserCount(JNIEnv * env, jclass cls, + jint cellHandle) +{ + afs_status_t ast; + void *iterationId; + kas_identity_p who = (kas_identity_p) malloc(sizeof(kas_identity_t)); + kas_principalEntry_t kasEntry; + char *userName; + int i = 0; + + if (who == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return -1; + } + + if (!pts_UserListBegin((void *)cellHandle, &iterationId, &ast)) { + free(who); + throwAFSException(env, ast); + return -1; + } + + userName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + if (!userName) { + free(who); + throwAFSException(env, JAFSADMNOMEM); + return -1; + } + + while (pts_UserListNext((void *)iterationId, userName, &ast)) { + if (strcmp(userName, "anonymous") != 0) { + // make sure the name is within the allowed bounds + if (strlen(userName) > KAS_MAX_NAME_LEN) { + free(who); + free(userName); + throwAFSException(env, ADMPTSUSERNAMETOOLONG); + return -1; + } + // if there is a kas entry, recurse + internal_makeKasIdentity(userName, who); + if (!kas_PrincipalGet + ((void *)cellHandle, NULL, who, &kasEntry, &ast)) + i++; + } + } + + free(userName); + free(who); + + if (ast != ADMITERATORDONE) { + throwAFSException(env, ast); + return -1; + } + + return i; +} + +/** + * Begin the process of getting the pts users that belong to the cell. + * Returns an iteration ID to be used by subsequent calls to + * getPtsUsersNextString (or getPtsUsersNext) + * and getPtsUsersDone. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getPtsUsersBegin(JNIEnv * env, jclass cls, + jint cellHandle) +{ + afs_status_t ast; + void *iterationId; + + if (!pts_UserListBegin((void *)cellHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return -1; + } + + return (jint) iterationId; + +} + +/** + * Returns the next pts user of the cell. Returns null if + * there are no more users. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * returns the name of the next user of the cell + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_Cell_getPtsUsersNextString(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + char *userName; + jstring juser; + + userName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + + if (!userName) { + throwAFSException(env, JAFSADMNOMEM); + return NULL; + } + + if (!pts_UserListNext((void *)iterationId, userName, &ast)) { + free(userName); + if (ast == ADMITERATORDONE) { + return NULL; + } else { + throwAFSException(env, ast); + return NULL; + } + } + + if (strcmp(userName, "anonymous") == 0) { + free(userName); + return Java_org_openafs_jafs_Cell_getPtsUsersNextString(env, cls, + iterationId); + } + + juser = (*env)->NewStringUTF(env, userName); + free(userName); + return juser; + +} + +/** + * Returns the next pts user (who is not a kas user) of the cell. + * Returns null if there are no more users. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * cellHandle the cell handle to which these users will belong + * returns the name of the next pts user (not kas user) of the cell + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_Cell_getPtsOnlyUsersNextString(JNIEnv * env, jclass cls, + jint iterationId, + jint cellHandle) +{ + kas_identity_p who = (kas_identity_p) malloc(sizeof(kas_identity_t)); + kas_principalEntry_t kasEntry; + afs_status_t ast; + char *userName; + jstring juser; + + if (!who) { + throwAFSException(env, JAFSADMNOMEM); + return NULL; + } + + userName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + + if (!userName) { + free(who); + throwAFSException(env, JAFSADMNOMEM); + return NULL; + } + + while (1) { + + if (!pts_UserListNext((void *)iterationId, userName, &ast)) { + free(userName); + free(who); + if (ast == ADMITERATORDONE) { + return NULL; + } else { + throwAFSException(env, ast); + return NULL; + } + } + + if (strcmp(userName, "anonymous") == 0) { + continue; + } + // make sure the name is within the allowed bounds + if (strlen(userName) > KAS_MAX_NAME_LEN) { + free(who); + free(userName); + throwAFSException(env, ADMPTSUSERNAMETOOLONG); + return NULL; + } + // if there is a kas entry, recurse + internal_makeKasIdentity(userName, who); + if (kas_PrincipalGet((void *)cellHandle, NULL, who, &kasEntry, &ast)) { + continue; + } + + juser = (*env)->NewStringUTF(env, userName); + free(userName); + free(who); + return juser; + } + +} + +/** + * Fills the next pts user object of the cell. Returns 0 if there + * are no more users, != 0 otherwise. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * iterationId the iteration ID of this iteration + * juserObject a User object to be populated with the values of + * the next pts user + * returns 0 if there are no more users, != 0 otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getPtsUsersNext(JNIEnv * env, jclass cls, + jint cellHandle, jint iterationId, + jobject juserObject) +{ + + afs_status_t ast; + char *userName; + jstring juser; + + userName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + + if (!userName) { + throwAFSException(env, JAFSADMNOMEM); + return 0; + } + + if (!pts_UserListNext((void *)iterationId, userName, &ast)) { + free(userName); + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + + if (strcmp(userName, "anonymous") == 0) { + free(userName); + return Java_org_openafs_jafs_Cell_getPtsUsersNext(env, cls, + cellHandle, + iterationId, + juserObject); + } + + juser = (*env)->NewStringUTF(env, userName); + + if (userCls == 0) { + internal_getUserClass(env, juserObject); + } + + (*env)->SetObjectField(env, juserObject, user_nameField, juser); + + getUserInfoChar(env, (int)cellHandle, userName, juserObject); + (*env)->SetBooleanField(env, juserObject, user_cachedInfoField, TRUE); + + free(userName); + return 1; +} + +/** + * Fills the next pts user (who does not have a kas entry) object of + * the cell. Returns 0 if there are no more users, != 0 otherwise. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * iterationId the iteration ID of this iteration + * juserObject a User object to be populated with the values of + * the next pts (with no kas) user + * returns 0 if there are no more users, != 0 otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getPtsOnlyUsersNext(JNIEnv * env, jclass cls, + jint cellHandle, + jint iterationId, + jobject juserObject) +{ + kas_identity_p who = (kas_identity_p) malloc(sizeof(kas_identity_t)); + kas_principalEntry_t kasEntry; + afs_status_t ast; + char *userName; + jstring juser; + + if (!who) { + throwAFSException(env, JAFSADMNOMEM); + return 0; + } + + userName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + + if (!userName) { + free(who); + throwAFSException(env, JAFSADMNOMEM); + return 0; + } + + while (1) { + + if (!pts_UserListNext((void *)iterationId, userName, &ast)) { + free(userName); + free(who); + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + + if (strcmp(userName, "anonymous") == 0) { + continue; + } + // make sure the name is within the allowed bounds + if (strlen(userName) > KAS_MAX_NAME_LEN) { + free(userName); + free(who); + throwAFSException(env, ADMPTSUSERNAMETOOLONG); + return 0; + } + + if (userCls == 0) { + internal_getUserClass(env, juserObject); + } + // if there is a kas entry, recurse + internal_makeKasIdentity(userName, who); + if (kas_PrincipalGet((void *)cellHandle, NULL, who, &kasEntry, &ast)) { + continue; + } + + juser = (*env)->NewStringUTF(env, userName); + + (*env)->SetObjectField(env, juserObject, user_nameField, juser); + getUserInfoChar(env, (int)cellHandle, userName, juserObject); + (*env)->SetBooleanField(env, juserObject, user_cachedInfoField, TRUE); + + free(who); + free(userName); + return 1; + + } + +} + +/** + * Signals that the iteration is complete and will not be accessed anymore. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Cell_getPtsUsersDone(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + + if (!pts_UserListDone((void *)iterationId, &ast)) { + throwAFSException(env, ast); + return; + } + +} + +/** + * Returns the total number of groups belonging to the cell denoted + * by cellHandle. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the groups belong + * returns total number of groups + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getGroupCount(JNIEnv * env, jclass cls, + jint cellHandle) +{ + + afs_status_t ast; + void *iterationId; + char *groupName; + int i = 0; + + if (!pts_GroupListBegin((void *)cellHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return -1; + } + + groupName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + + if (!groupName) { + throwAFSException(env, JAFSADMNOMEM); + return -1; + } + + while (pts_GroupListNext((void *)iterationId, groupName, &ast)) + i++; + + free(groupName); + + if (ast != ADMITERATORDONE) { + throwAFSException(env, ast); + return -1; + } + + return i; +} + +/** + * Begin the process of getting the groups that belong to the cell. Returns + * an iteration ID to be used by subsequent calls to + * getGroupsNextString (or getGroupsNext) and + * getGroupsDone. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the groups belong + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getGroupsBegin(JNIEnv * env, jclass cls, + jint cellHandle) +{ + afs_status_t ast; + void *iterationId; + + if (!pts_GroupListBegin((void *)cellHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return; + } + + return (jint) iterationId; +} + +/** + * Begin the process of getting the groups that belong to the cell, starting + * with element index startIndex. Returns an iteration ID to + * be used by subsequent calls to getGroupsNextString + * (or getGroupsNext) and getGroupsDone. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the groups belong + * startIndex the starting base-zero index + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getGroupsBeginAt(JNIEnv * env, jclass cls, + jint cellHandle, jint startIndex) +{ + afs_status_t ast; + void *iterationId; + char *groupName; + int i; + + groupName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + + if (!pts_GroupListBegin((void *)cellHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return 0; + } + + for (i = 1; i < startIndex; i++) { + if (!pts_GroupListNext((void *)iterationId, groupName, &ast)) { + free(groupName); + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + } + + free(groupName); + return (jint) iterationId; +} + +/** + * Returns the next group of the cell. Returns null if there + * are no more groups. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * returns the name of the next user of the cell + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_Cell_getGroupsNextString(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + char *groupName; + jstring jgroup; + + groupName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + + if (!groupName) { + throwAFSException(env, JAFSADMNOMEM); + return NULL; + } + + if (!pts_GroupListNext((void *)iterationId, groupName, &ast)) { + free(groupName); + if (ast == ADMITERATORDONE) { + return NULL; + } else { + throwAFSException(env, ast); + return NULL; + } + } + + jgroup = (*env)->NewStringUTF(env, groupName); + free(groupName); + return jgroup; + +} + +/** + * Fills the next group object of the cell. Returns 0 if there + * are no more groups, != 0 otherwise. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * iterationId the iteration ID of this iteration + * jgroupObject a Group object to be populated with the values of + * the next group + * returns 0 if there are no more users, != 0 otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getGroupsNext(JNIEnv * env, jclass cls, + jint cellHandle, jint iterationId, + jobject jgroupObject) +{ + afs_status_t ast; + char *groupName; + jstring jgroup; + + groupName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + + if (!groupName) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (!pts_GroupListNext((void *)iterationId, groupName, &ast)) { + free(groupName); + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + + jgroup = (*env)->NewStringUTF(env, groupName); + + if (groupCls == 0) { + internal_getGroupClass(env, jgroupObject); + } + + (*env)->SetObjectField(env, jgroupObject, group_nameField, jgroup); + + getGroupInfoChar(env, (int)cellHandle, groupName, jgroupObject); + (*env)->SetBooleanField(env, jgroupObject, group_cachedInfoField, TRUE); + + free(groupName); + return 1; +} + +/** + * Signals that the iteration is complete and will not be accessed anymore. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Cell_getGroupsDone(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + + if (!pts_GroupListDone((void *)iterationId, &ast)) { + throwAFSException(env, ast); + return; + } + +} + +/** + * Gets the maximum group pts ID that's been used within a cell. + * The next auto-assigned group ID will be one less (more negative) + * than this value. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the group belongs + * returns an integer reresenting the max group id in a cell + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getMaxGroupID(JNIEnv * env, jclass cls, + jint cellHandle) +{ + afs_status_t ast; + jint maxID; + + if (!pts_GroupMaxGet((void *)cellHandle, (int *)&maxID, &ast)) { + throwAFSException(env, ast); + return 0; + } + + return maxID; +} + +/** + * Sets the maximum group pts ID that's been used within a cell. The next + * auto-assigned group ID will be one less (more negative) than this value. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the group belongs + * maxID an integer reresenting the new max group id in a cell + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Cell_setMaxGroupID(JNIEnv * env, jclass cls, + jint cellHandle, jint maxID) +{ + afs_status_t ast; + + if (!pts_GroupMaxSet((void *)cellHandle, (int)maxID, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Gets the maximum user pts ID that's been used within a cell. + * The next auto-assigned user ID will be one greater (more positive) + * than this value. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * returns an integer reresenting the max user id in a cell + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getMaxUserID(JNIEnv * env, jclass cls, + jint cellHandle) +{ + afs_status_t ast; + jint maxID; + + if (!pts_UserMaxGet((void *)cellHandle, (int *)&maxID, &ast)) { + throwAFSException(env, ast); + return 0; + } + + return maxID; +} + +/** + * Sets the maximum user pts ID that's been used within a cell. The next + * auto-assigned user ID will be one greater (more positive) than this value. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * maxID an integer reresenting the new max user id in a cell + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Cell_setMaxUserID(JNIEnv * env, jclass cls, + jint cellHandle, jint maxID) +{ + afs_status_t ast; + + if (!pts_UserMaxSet((void *)cellHandle, (int)maxID, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Returns the total number of servers belonging to the cell denoted + * by cellHandle. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the servers belong + * returns total number of servers + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getServerCount(JNIEnv * env, jclass cls, + jint cellHandle) +{ + afs_status_t ast; + void *iterationId; + afs_serverEntry_t servEntry; + int i = 0; + + if (!afsclient_AFSServerGetBegin((void *)cellHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return -1; + } + + while (afsclient_AFSServerGetNext((void *)iterationId, &servEntry, &ast)) + i++; + + if (ast != ADMITERATORDONE) { + throwAFSException(env, ast); + return -1; + } + + return i; +} + +/** + * Begin the process of getting the servers in the cell. Returns + * an iteration ID to be used by subsequent calls to + * getServersNextString and getServersDone. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the servers belong + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getServersBegin(JNIEnv * env, jclass cls, + jint cellHandle) +{ + afs_status_t ast; + void *iterationId; + + if (!afsclient_AFSServerGetBegin((void *)cellHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return -1; + } + + return (jint) iterationId; +} + +/** + * Returns the next server of the cell. Returns null if there + * are no more servers. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * returns the name of the next server of the cell + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_Cell_getServersNextString(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + jstring jserver; + afs_serverEntry_t servEntry; + + if (!afsclient_AFSServerGetNext((void *)iterationId, &servEntry, &ast)) { + if (ast == ADMITERATORDONE) { + return NULL; + } else { + throwAFSException(env, ast); + return NULL; + } + } + return jserver; +} + +/** + * Fills the next server object of the cell. Returns 0 if there are no + * more servers, != 0 otherwise. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * iterationId the iteration ID of this iteration + * jserverObject a Server object to be populated with the values + * of the next server + * returns 0 if there are no more servers, != 0 otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Cell_getServersNext(JNIEnv * env, jclass cls, + jint cellHandle, jint iterationId, + jobject jserverObject) +{ + afs_status_t ast; + jstring jserver; + afs_serverEntry_t servEntry; + jintArray jaddress; + + if (!afsclient_AFSServerGetNext((void *)iterationId, &servEntry, &ast)) { + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + // get the class fields if need be + if (serverCls == 0) { + internal_getServerClass(env, jserverObject); + } + + fillServerInfo(env, (int)cellHandle, jserverObject, servEntry); + + (*env)->SetBooleanField(env, jserverObject, server_cachedInfoField, TRUE); + + return 1; +} + +/** + * Signals that the iteration is complete and will not be accessed anymore. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Cell_getServersDone(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + + if (!afsclient_AFSServerGetDone((void *)iterationId, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Creates a mount point for a volume within the file system. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * jdirectory the full path of the place in the AFS file system + * at which to mount the volume + * jvolumeName the name of the volume to mount + * readWrite whether or not this is to be a readwrite mount point + * forceCheck whether or not to check if this volume name exists + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Cell_createMountPoint(JNIEnv * env, jclass cls, + jint cellHandle, + jstring jdirectory, + jstring jvolumeName, + jboolean readWrite, + jboolean forceCheck) +{ + afs_status_t ast; + char *directory; + char *volumeName; + vol_type_t type; + vol_check_t check; + + if (jdirectory != NULL) { + directory = getNativeString(env, jdirectory); + if (!directory) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLPATH); + return; + } + if (jvolumeName != NULL) { + volumeName = getNativeString(env, jvolumeName); + if (volumeName == NULL) { + free(directory); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(directory); + throwAFSException(env, JAFSNULLVOLUME); + return; + } + + if (readWrite) { + type = READ_WRITE; + } else { + type = READ_ONLY; + } + + if (forceCheck) { + check = CHECK_VOLUME; + } else { + check = DONT_CHECK_VOLUME; + } + + if (!afsclient_MountPointCreate + ((void *)cellHandle, directory, volumeName, type, check, &ast)) { + throwAFSException(env, ast); + } + + free(directory); + free(volumeName); +} + +/* + * Sets an ACL for a given place in the AFS file system. + * + * env the Java environment + * cls the current Java class + * jdirectory the full path of the place in the AFS file system + * for which to add an entry + * jusername the name of the user or group for which to add an entry + * read whether or not to allow read access to this user + * write whether or not to allow write access to this user + * lookup whether or not to allow lookup access to this user + * delete whether or not to allow deletion access to this user + * insert whether or not to allow insertion access to this user + * lock whether or not to allow lock access to this user + * admin whether or not to allow admin access to this user + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Cell_setACL(JNIEnv * env, jclass cls, + jstring jdirectory, jstring juserName, + jboolean read, jboolean write, + jboolean lookup, jboolean delete, + jboolean insert, jboolean lock, + jboolean admin) +{ + afs_status_t ast; + char *directory; + char *userName; + acl_t acl; + + if (!afsclient_Init(&ast)) { + throwAFSException(env, ast); + return; + } + + if (jdirectory != NULL) { + directory = getNativeString(env, jdirectory); + if (!directory) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLPATH); + return; + } + + if (juserName != NULL) { + userName = getNativeString(env, juserName); + if (!userName) { + free(directory); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(directory); + throwAFSException(env, JAFSNULLUSER); + return; + } + + if (read) { + acl.read = READ; + } else { + acl.read = NO_READ; + } + + if (write) { + acl.write = WRITE; + } else { + acl.write = NO_WRITE; + } + + if (lookup) { + acl.lookup = LOOKUP; + } else { + acl.lookup = NO_LOOKUP; + } + + if (delete) { + acl.del = DELETE; + } else { + acl.del = NO_DELETE; + } + + if (insert) { + acl.insert = INSERT; + } else { + acl.insert = NO_INSERT; + } + + if (lock) { + acl.lock = LOCK; + } else { + acl.lock = NO_LOCK; + } + + if (admin) { + acl.admin = ADMIN; + } else { + acl.admin = NO_ADMIN; + } + + if (!afsclient_ACLEntryAdd(directory, userName, &acl, &ast)) { + throwAFSException(env, ast); + } + + free(userName); + free(directory); +} + +// reclaim global memory used by this portion +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Cell_reclaimCellMemory(JNIEnv * env, jclass cls) +{ +} diff --git a/src/JAVA/libjafs/Exceptions.h b/src/JAVA/libjafs/Exceptions.h new file mode 100644 index 000000000..f657fa7d8 --- /dev/null +++ b/src/JAVA/libjafs/Exceptions.h @@ -0,0 +1,9 @@ +#ifndef _Jafsadm_Exceptions +#define _Jafsadm_Exceptions + +static char *afsExceptionName = "org/openafs/jafs/AFSException"; +static char *afsFileExceptionName = "org/openafs/jafs/AFSFileException"; +static char *afsSecurityExceptionName = + "org/openafs/jafs/AFSSecurityException"; + +#endif diff --git a/src/JAVA/libjafs/File.c b/src/JAVA/libjafs/File.c new file mode 100644 index 000000000..4f6e6df42 --- /dev/null +++ b/src/JAVA/libjafs/File.c @@ -0,0 +1,692 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. + */ + +#if 0 +#include +#include +#endif + +#include "Internal.h" +#include "org_openafs_jafs_File.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* Access Rights */ +#define UAFS_READ 1 +#define UAFS_WRITE 2 +#define UAFS_INSERT 4 +#define UAFS_LOOKUP 8 +#define UAFS_DELETE 16 +#define UAFS_LOCK 32 +#define UAFS_ADMIN 64 + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +void setFileNotExistsAttributes(JNIEnv * env, jobject * obj); + +typedef struct { + char *fileName; + void *next; +} FileNameNode; + +/*static char compile_date[] = COMPILE_DATE;*/ + +int +sub_time(struct timeval *tv1, struct timeval *tv2) +{ + if (tv2->tv_usec > tv1->tv_usec) { + tv1->tv_usec += 1000000; + tv1->tv_usec -= 1; + } + + tv1->tv_usec -= tv2->tv_usec; + tv1->tv_sec -= tv2->tv_sec; +} + +/** + * Sets dirName to the absolute path according to the path field + * within the Java File object (obj). + * + * env the Java environment + * obj the current Java object + */ +char * +getAbsolutePath(JNIEnv * env, jobject * obj, char *dirName) +{ + jclass thisClass; + jstring jDirName; + jmethodID getAbsolutePathID; + char *auxDirName; + jfieldID fid; + + thisClass = (*env)->GetObjectClass(env, *obj); + if (thisClass == NULL) { + fprintf(stderr, "File::getAbsolutePath(): GetObjectClass failed\n"); + return NULL; + } + + fid = (*env)->GetFieldID(env, thisClass, "path", "Ljava/lang/String;"); + if (fid == NULL) { + fprintf(stderr, + "File::getAbsolutePath(): GetFieldID (path) failed\n"); + return NULL; + } + + jDirName = (*env)->GetObjectField(env, *obj, fid); + if (jDirName == NULL) { + fprintf(stderr, "File::getAbsolutePath(): failed to get file name\n"); + return NULL; + } + + auxDirName = getNativeString(env, jDirName); + if (auxDirName == NULL) { + fprintf(stderr, + "File::getAbsolutePath(): failed to get translated file name\n"); + return NULL; + } + strcpy(dirName, auxDirName); + free(auxDirName); +} + +/** + * Performs a file stat on the actual AFS file and populates + * the Java object's respective field members with the appropriate values. + * method will, if authorized, perform a stat on the + * actual AFS file and update its respective field members; defining + * this file object's attributes. + * + * env the Java environment + * obj the current Java object + * + * return true if and only if the current user is allowed to stat the file; + * false otherwise. + * + * throws AFSException + */ +JNIEXPORT jboolean JNICALL +Java_org_openafs_jafs_File_setAttributes(JNIEnv * env, jobject obj) +{ + char target[FILENAME_MAX + 1]; + char dirName[FILENAME_MAX]; + jclass thisClass; + jfieldID fid; + struct stat st; + int rc, fd; + int mtpoint = 0; + jboolean islink = JNI_FALSE; + int i; + struct timeval tv0, tv1; + struct timezone tz; + + /*memset(target, 0, FILENAME_MAX); */ + + *dirName = '\0'; + getAbsolutePath(env, &obj, dirName); + + /*fprintf(stderr, "dirName=%s\n", dirName); */ + + if (*dirName == '\0') { + fprintf(stderr, "File::setAttributes(): failed to get dirName\n"); + return JNI_FALSE; + } + + thisClass = (*env)->GetObjectClass(env, obj); + if (thisClass == NULL) { + fprintf(stderr, "File::setAttributes(): GetObjectClass failed\n"); + return JNI_FALSE; + } + + gettimeofday(&tv0, &tz); + if ((strcmp(dirName, "/afs") == 0) || (strcmp(dirName, "/afs/") == 0)) { + rc = 1; /* special case for /afs since statmountpoint fails on it */ + } else { + rc = uafs_statmountpoint(dirName); + gettimeofday(&tv1, &tz); + sub_time(&tv1, &tv0); + /*printf("%s: statmountpoint %d.%06d\n", dirName, tv1.tv_sec, tv1.tv_usec); */ + } + + if (rc < 0) { + setError(env, &obj, errno); + if (errno == ENOENT) { + setFileNotExistsAttributes(env, &obj); + return JNI_TRUE; /* not really an error */ + } else { + fprintf(stderr, + "File::setAttributes(): uafs_statmountpoint failed " + "for %s (%s)\n", dirName, error_message(errno)); + return JNI_FALSE; + } + } + + if (rc == 1) { + /* this is an AFS mount point; we don't want to stat it */ + /* fake up a stat entry instead */ + mtpoint = 1; + st.st_mtime = 0; + st.st_size = 2048; + st.st_mode = 0; /* don't match anything */ + } else { + mtpoint = 0; + fid = (*env)->GetFieldID(env, thisClass, "isLink", "Z"); + if (fid == 0) { + fprintf(stderr, + "File::setAttributes(): GetFieldID (isLink) failed\n"); + setError(env, &obj, -1); + return JNI_FALSE; + } + islink = (*env)->GetBooleanField(env, obj, fid); + if (islink != JNI_TRUE) { + rc = uafs_lstat(dirName, &st); + } else { + /* Here we are being called on a link object for the second time, + * so we want info on the object pointed to by the link. */ + fprintf(stderr, "islink = TRUE on file %s\n", dirName); + rc = uafs_stat(dirName, &st); + } + + if (rc < 0) { + setError(env, &obj, errno); + fprintf(stderr, "uafs_lstat failed for dir %s: error %d\n", + dirName, errno); + if (errno == ENOENT) { + setFileNotExistsAttributes(env, &obj); + return JNI_TRUE; + } + fprintf(stderr, + "File::setAttributes(): uafs_stat failed for %s (%s)\n", + dirName, error_message(errno)); + return JNI_FALSE; + } + } + + fid = (*env)->GetFieldID(env, thisClass, "exists", "Z"); + if (fid == 0) { + fprintf(stderr, + "File::setAttributes(): GetFieldID (exists) failed\n"); + setError(env, &obj, -1); + return JNI_FALSE; + } + (*env)->SetBooleanField(env, obj, fid, JNI_TRUE); + + fid = (*env)->GetFieldID(env, thisClass, "isDirectory", "Z"); + if (fid == 0) { + fprintf(stderr, + "File::setAttributes(): GetFieldID (isDirectory) failed\n"); + setError(env, &obj, -1); + return JNI_FALSE; + } + if ((st.st_mode & S_IFMT) == S_IFDIR && !mtpoint) { + (*env)->SetBooleanField(env, obj, fid, JNI_TRUE); + } else { + (*env)->SetBooleanField(env, obj, fid, JNI_FALSE); + } + + fid = (*env)->GetFieldID(env, thisClass, "isFile", "Z"); + if (fid == 0) { + fprintf(stderr, + "File::setAttributes(): GetFieldID (isFile) failed\n"); + setError(env, &obj, -1); + return JNI_FALSE; + } + if ((st.st_mode & S_IFMT) == S_IFREG) { + (*env)->SetBooleanField(env, obj, fid, JNI_TRUE); + } else { + (*env)->SetBooleanField(env, obj, fid, JNI_FALSE); + } + + fid = (*env)->GetFieldID(env, thisClass, "isLink", "Z"); + if (fid == 0) { + fprintf(stderr, + "File::setAttributes(): GetFieldID (isLink) failed\n"); + setError(env, &obj, -1); + return JNI_FALSE; + } + + if (islink != JNI_TRUE) { /* don't re-process link */ + if ((st.st_mode & S_IFMT) == S_IFLNK) { + (*env)->SetBooleanField(env, obj, fid, JNI_TRUE); + + /* Find the target of the link */ + rc = uafs_readlink(dirName, target, FILENAME_MAX); + if (rc < 0) { + fprintf(stderr, + "File::setAttributes(): uafs_readlink failed\n"); + setError(env, &obj, errno); + return JNI_FALSE; + } else { + target[rc] = 0; /* weird that we have to do this */ + /*fprintf(stderr, "readlink %s succeeded, target=%s, rc=%d\n", dirName, + * target, rc); */ + } + + rc = setString(env, &obj, "target", target); + if (rc < 0) { + fprintf(stderr, "setString dirName=%s target=%s failed\n", + dirName, target); + } + } else { + (*env)->SetBooleanField(env, obj, fid, JNI_FALSE); + } + } + + fid = (*env)->GetFieldID(env, thisClass, "isMountPoint", "Z"); + if (fid == 0) { + fprintf(stderr, + "File::setAttributes(): GetFieldID (isMountPoint) failed\n"); + setError(env, &obj, -1); + return JNI_FALSE; + } + + if (mtpoint) { + (*env)->SetBooleanField(env, obj, fid, JNI_TRUE); + } else { + (*env)->SetBooleanField(env, obj, fid, JNI_FALSE); + } + + fid = (*env)->GetFieldID(env, thisClass, "lastModified", "J"); + if (fid == 0) { + fprintf(stderr, + "File::setAttributes(): GetFieldID (lastModified) failed\n"); + setError(env, &obj, -1); + return JNI_FALSE; + } + (*env)->SetLongField(env, obj, fid, ((jlong) st.st_mtime) * 1000); + + fid = (*env)->GetFieldID(env, thisClass, "length", "J"); + if (fid == 0) { + fprintf(stderr, + "File::setAttributes(): GetFieldID (length) failed\n"); + setError(env, &obj, -1); + return JNI_FALSE; + } + (*env)->SetLongField(env, obj, fid, st.st_size); + + setError(env, &obj, 0); + + return JNI_TRUE; +} + +/** + * Returns the permission/ACL mask for the represented directory + * + * env the Java environment + * obj the current Java object + * + * return permission/ACL mask + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_File_getRights(JNIEnv * env, jobject obj) +{ + char dirName[FILENAME_MAX]; + jclass thisClass; + jfieldID fid; + int rc; + int afs_rights; + int rights; + + *dirName = '\0'; + getAbsolutePath(env, &obj, dirName); + + if (*dirName == '\0') { + fprintf(stderr, "File::getRights(): failed to get dirName\n"); + setError(env, &obj, -1); + return JNI_FALSE; + } + + /*-Access Rights- + * UAFS_READ 1 + * UAFS_WRITE 2 + * UAFS_INSERT 4 + * UAFS_LOOKUP 8 + * UAFS_DELETE 16 + * UAFS_LOCK 32 + * UAFS_ADMIN 64 + */ + + rights = 0; + afs_rights = uafs_getRights(dirName); + if (afs_rights < 0) { + setError(env, &obj, errno); + return -1; + } + + if (afs_rights & PRSFS_READ) + rights |= UAFS_READ; + if (afs_rights & PRSFS_WRITE) + rights |= UAFS_WRITE; + if (afs_rights & PRSFS_INSERT) + rights |= UAFS_INSERT; + if (afs_rights & PRSFS_LOOKUP) + rights |= UAFS_LOOKUP; + if (afs_rights & PRSFS_DELETE) + rights |= UAFS_DELETE; + if (afs_rights & PRSFS_LOCK) + rights |= UAFS_LOCK; + if (afs_rights & PRSFS_ADMINISTER) + rights |= UAFS_ADMIN; + + return rights; +} + + +/** + * List the contents of the represented directory. + * + * env the Java environment + * obj the current Java object + * + * return the directory handle + */ +JNIEXPORT jlong JNICALL +Java_org_openafs_jafs_File_listNative(JNIEnv * env, jobject obj, + jobject buffer) +{ + char dirName[FILENAME_MAX]; + jclass arrayListClass; + jmethodID addID; + jstring entryJString; + usr_DIR *dirp; + struct usr_dirent *enp; + int i, dirSize; + + *dirName = '\0'; + getAbsolutePath(env, &obj, dirName); + if (*dirName == '\0') { + fprintf(stderr, "File::listNative(): failed to get dirName\n"); + setError(env, &obj, -1); + return 0; + } + arrayListClass = (*env)->GetObjectClass(env, buffer); + if (arrayListClass == NULL) { + fprintf(stderr, "File::listNative(): GetObjectClass failed\n"); + setError(env, &obj, -1); + return 0; + } + addID = + (*env)->GetMethodID(env, arrayListClass, "add", + "(Ljava/lang/Object;)Z"); + if (addID == 0) { + fprintf(stderr, "File::listNative(): failed to get addID\n"); + setError(env, &obj, -1); + return 0; + } + dirp = uafs_opendir(dirName); + if (dirp == NULL) { + fprintf(stderr, "File::listNative(): uafs_opendir(%s) failed(%s)\n", + dirName, error_message(errno)); + setError(env, &obj, errno); + //throwAFSSecurityException( env, errno ); + return 0; + } + while ((enp = uafs_readdir(dirp)) != NULL) { + if (strcmp(enp->d_name, ".") == 0 || strcmp(enp->d_name, "..") == 0) { + continue; + } + entryJString = (*env)->NewStringUTF(env, enp->d_name); + if (entryJString == NULL) { + fprintf(stderr, "File::listNative(): NewStringUTF failed\n"); + setError(env, &obj, -1); + return 0; + } + (*env)->CallBooleanMethod(env, buffer, addID, entryJString); + } + /*uafs_closedir(dirp); */ + + setError(env, &obj, 0); + + return (jlong) dirp; +} + +/** + * Close the currently open directory using a provided directory handle. + * + * env the Java environment + * obj the current Java object + * + * return true if the directory closes without error + */ +JNIEXPORT jboolean JNICALL +Java_org_openafs_jafs_File_closeDir(JNIEnv * env, jobject obj, jlong dp) +{ + usr_DIR *dirp = (usr_DIR *) dp; + int rc; + + rc = uafs_closedir(dirp); + if (rc < 0) { + setError(env, &obj, errno); + return JNI_FALSE; + } else { + return JNI_TRUE; + } +} + + +/** + * Removes/deletes the represented file. + * + * env the Java environment + * obj the current Java object + * + * return true if the file is removed without error + */ +JNIEXPORT jboolean JNICALL +Java_org_openafs_jafs_File_rmfile(JNIEnv * env, jobject obj) +{ + char dirName[FILENAME_MAX]; + int rc; + + *dirName = '\0'; + getAbsolutePath(env, &obj, dirName); + if (*dirName == '\0') { + setError(env, &obj, EINVAL); + fprintf(stderr, "File::rmfile(): failed to get dirName\n"); + return JNI_FALSE; + } + rc = uafs_unlink(dirName); + if (rc < 0) { + setError(env, &obj, errno); + fprintf(stderr, "File::rmfile(): uafs_unlink failed\n"); + return JNI_FALSE; + } + setError(env, &obj, 0); + return JNI_TRUE; +} + +/** + * Removes/deletes the represented directory. + * + * env the Java environment + * obj the current Java object + * + * return true if the directory is removed without error + */ +JNIEXPORT jboolean JNICALL +Java_org_openafs_jafs_File_rmdir(JNIEnv * env, jobject obj) +{ + char dirName[FILENAME_MAX]; + int rc; + + *dirName = '\0'; + getAbsolutePath(env, &obj, dirName); + if (*dirName == '\0') { + setError(env, &obj, -1); + fprintf(stderr, "File::rmdir(): failed to get dirName\n"); + return JNI_FALSE; + } + rc = uafs_rmdir(dirName); + if (rc < 0) { + setError(env, &obj, errno); + fprintf(stderr, "File::rmdir(): uafs_unlink failed\n"); + return JNI_FALSE; + } + setError(env, &obj, 0); + return JNI_TRUE; +} + +/** + * Creates the directory named by this abstract pathname. + * + * env the Java environment + * obj the current Java object + * + * return true if and only if the directory was + * created; false otherwise + */ +JNIEXPORT jboolean JNICALL +Java_org_openafs_jafs_File_mkdir(JNIEnv * env, jobject obj) +{ + char dirName[FILENAME_MAX]; + int rc; + + *dirName = '\0'; + getAbsolutePath(env, &obj, dirName); + if (*dirName == '\0') { + setError(env, &obj, EINVAL); + fprintf(stderr, "File::mkdir(): failed to get dirName\n"); + return JNI_FALSE; + } + rc = uafs_mkdir(dirName, 0755); + if (rc < 0) { + setError(env, &obj, errno); + fprintf(stderr, "File::mkdir(): uafs_mkdir failed\n"); + return JNI_FALSE; + } + setError(env, &obj, 0); + return JNI_TRUE; +} + +/** + * Renames the file denoted by this abstract pathname. + * + * env the Java environment + * obj the current Java object + * dest the new abstract pathname for the named file + * + * return true if and only if the renaming succeeded; + * false otherwise + * + * throws NullPointerException + * If parameter dest is null + */ +JNIEXPORT jboolean JNICALL +Java_org_openafs_jafs_File_renameTo(JNIEnv * env, jobject obj, + jobject newFile) +{ + char thisDirName[FILENAME_MAX], newDirName[FILENAME_MAX]; + int rc; + + *thisDirName = '\0'; + getAbsolutePath(env, &obj, thisDirName); + if (*thisDirName == '\0') { + setError(env, &obj, -1); + fprintf(stderr, + "File::renameTo(): failed to get dirName for this \n"); + return JNI_FALSE; + } + *newDirName = '\0'; + getAbsolutePath(env, &newFile, newDirName); + if (*newDirName == '\0') { + setError(env, &obj, -1); + fprintf(stderr, "File::renameTo(): failed to get dirName for new \n"); + return JNI_FALSE; + } + rc = uafs_rename(thisDirName, newDirName); + if (rc < 0) { + setError(env, &obj, errno); + fprintf(stderr, "File::renameTo(): uafs_rename failed\n"); + return JNI_FALSE; + } + return JNI_TRUE; +} + +/** + * Set all the necessary fields within the Java File class to indicate the + * does not exist. + * + * env the Java environment + * obj the current Java object + */ +void +setFileNotExistsAttributes(JNIEnv * env, jobject * obj) +{ + jclass thisClass; + jfieldID fid; + + thisClass = (*env)->GetObjectClass(env, *obj); + if (thisClass == NULL) { + fprintf(stderr, + "File::setFileNotExistsAttributes(): GetObjectClass failed\n"); + return; + } + + fid = (*env)->GetFieldID(env, thisClass, "exists", "Z"); + if (fid == 0) { + fprintf(stderr, + "File::setFileNotExistsAttributes(): GetFieldID (exists) failed\n"); + return; + } + (*env)->SetBooleanField(env, *obj, fid, JNI_FALSE); + + fid = (*env)->GetFieldID(env, thisClass, "isDirectory", "Z"); + if (fid == 0) { + fprintf(stderr, + "File::setFileNotExistsAttributes(): GetFieldID (isDirectory) failed\n"); + return; + } + (*env)->SetBooleanField(env, *obj, fid, JNI_FALSE); + + fid = (*env)->GetFieldID(env, thisClass, "isFile", "Z"); + if (fid == 0) { + fprintf(stderr, + "File::setFileNotExistsAttributes(): GetFieldID (isDirectory) failed\n"); + return; + } + (*env)->SetBooleanField(env, *obj, fid, JNI_FALSE); + + fid = (*env)->GetFieldID(env, thisClass, "lastModified", "J"); + if (fid == 0) { + fprintf(stderr, + "File::setFileNotExistsAttributes(): GetFieldID (lastModified) failed\n"); + return; + } + (*env)->SetLongField(env, *obj, fid, 0); + + + fid = (*env)->GetFieldID(env, thisClass, "length", "J"); + if (fid == 0) { + fprintf(stderr, + "File::setFileNotExistsAttributes(): GetFieldID (length) failed\n"); + return; + } + (*env)->SetLongField(env, *obj, fid, 0); + + return; +} diff --git a/src/JAVA/libjafs/FileInputStream.c b/src/JAVA/libjafs/FileInputStream.c new file mode 100644 index 000000000..de7dfd0b6 --- /dev/null +++ b/src/JAVA/libjafs/FileInputStream.c @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 "Internal.h" +#include "org_openafs_jafs_FileInputStream.h" + +#include + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +extern int errno; + +/** + * Be carefull with the memory management: + * + * - For every getNativeString call the corresponding free(). + * - For every GetArrayElements call the corresponding + * ReleaseArrayElements + * - For every malloc call the corresponding free. + */ + +/*-------------------------------------------------------------------------*/ + +/** + * Opens an AFS file, with the specified name, for appending. + * + * env the Java environment + * obj the current Java object + * fileNameUTF name of file to be opened + * + * @return file descriptor + * @exception AFSFileException if an I/O or other file related error occurs. + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_FileInputStream_openReadOnly(JNIEnv * env, jobject obj, + jstring fileNameUTF) +{ + int err; + int fd = -1; //file descriptor + + fd = openAFSFile(env, fileNameUTF, O_RDONLY, 0, &err); + if (fd < 0) { + fprintf(stderr, "FileInputStream::openReadOnly(): err=%d\n", err); + throwAFSFileException(env, err, NULL); + } + return fd; +} + +/** + * Reads up to 'length' bytes of data from this input stream + * into an array of bytes. This method blocks until some input is + * available. + * + * env the Java environment + * obj the current Java object + * jbytes the data to be written + * offset the start offset in the data + * length the number of bytes that are written + * + * @return the total number of bytes read into the buffer, or + * -1 if there is no more data because the end of + * the file has been reached. + * @exception AFSFileException if an I/O or other file related error occurs. + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_FileInputStream_read(JNIEnv * env, jobject obj, + jbyteArray jbytes, jint offset, + jint length) +{ + int fd, bytesLen, bytesRead; + jclass thisClass; + jmethodID getFileDescriptorID; + jbyte *bytes; + jfieldID fid; + + /* If we have to read 0 bytes just return */ + if (length == 0) + return 0; + + thisClass = (*env)->GetObjectClass(env, obj); + fid = (*env)->GetFieldID(env, thisClass, "fileDescriptor", "I"); + fd = (*env)->GetIntField(env, obj, fid); + + if (fd < 0) { + fprintf(stderr, "FileInputStream::read(): invalid file state\n"); + throwAFSFileException(env, 0, "Invalid file state"); + return -1; + } + + bytes = (*env)->GetByteArrayElements(env, jbytes, 0); + bytesLen = (*env)->GetArrayLength(env, jbytes); + bytesRead = uafs_read(fd, bytes, bytesLen); + + if (errno != 0) + throwAFSFileException(env, errno, NULL); + + (*env)->ReleaseByteArrayElements(env, jbytes, bytes, 0); + return (bytesRead > 0) ? bytesRead : -1; +} + +/** + * Closes this file input stream and releases any system resources + * associated with this stream. This file input stream may no longer + * be used for writing bytes. + * + * env the Java environment + * obj the current Java object + * + * @exception AFSFileException if an I/O or other file related error occurs. + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_FileInputStream_close(JNIEnv * env, jobject obj) +{ + int fd, rc; + jclass thisClass; + jmethodID getFileDescriptorID; + jfieldID fid; + char *bytes; + + thisClass = (*env)->GetObjectClass(env, obj); + fid = (*env)->GetFieldID(env, thisClass, "fileDescriptor", "I"); + fd = (*env)->GetIntField(env, obj, fid); + + if (fd < 0) { + fprintf(stderr, "FileInputStream::close(): invalid file state\n"); + throwAFSFileException(env, 0, "Invalid file state"); + return; + } + + rc = uafs_close(fd); + + if (rc != 0) { + throwAFSFileException(env, errno, NULL); + } +} diff --git a/src/JAVA/libjafs/FileOutputStream.c b/src/JAVA/libjafs/FileOutputStream.c new file mode 100644 index 000000000..185297c90 --- /dev/null +++ b/src/JAVA/libjafs/FileOutputStream.c @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 +#include + +#include "Internal.h" +#include "org_openafs_jafs_FileOutputStream.h" + +#include +#include +/*#include */ + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +/** + * Be carefull with the memory management: + * + * - For every getNativeString call the corresponding free(). + * - For every GetArrayElements call the corresponding + * ReleaseArrayElements + * - For every malloc call the corresponding free. + */ + +/*-------------------------------------------------------------------------*/ + +/** + * Opens an AFS file, with the specified name, for appending. + * + * env the Java environment + * obj the current Java object + * fileNameUTF name of file to be opened + * + * @returns file descriptor + * @exception AFSFileException if an I/O or other file related error occurs. + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_FileOutputStream_openWrite(JNIEnv * env, jobject obj, + jstring fileNameUTF) +{ + int err; + jint fd = -1; //file descriptor + + fd = openAFSFile(env, fileNameUTF, O_CREAT | O_TRUNC, 0644, &err); + if (fd < 0) { + fprintf(stderr, "FileOutputStream::openWrite(): err=%d\n", err); + throwAFSFileException(env, err, NULL); + } + return fd; +} + +/** + * Opens an AFS file, with the specified name, for writing. + * + * env the Java environment + * obj the current Java object + * fileNameUTF name of file to be opened + * + * @return file descriptor + * @exception AFSFileException if an I/O or other file related error occurs. + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_FileOutputStream_openAppend(JNIEnv * env, jobject obj, + jstring fileNameUTF) +{ + int err; + jint fd = -1; //file descriptor + + fd = openAFSFile(env, fileNameUTF, O_CREAT | O_APPEND, 0644, &err); + if (fd < 0) { + fprintf(stderr, "FileOutputStream::openAppend(): err=%d\n", err); + throwAFSFileException(env, err, NULL); + } + return fd; +} + +/** + * Writes 'lenght' bytes from the specified byte array starting at offset + * 'offset' to this file output stream. + * + * env the Java environment + * obj the current Java object + * jbytes the data to be written + * offset the start offset in the data + * length the number of bytes that are written + * + * @exception AFSFileException if an I/O or other file related error occurs. + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_FileOutputStream_write(JNIEnv * env, jobject obj, + jbyteArray jbytes, jint offset, + jint length) +{ + int fd, written, toWrite; + jint twritten; + jclass thisClass; + jmethodID getFileDescriptorID; + char *bytes; + jfieldID fid; + + thisClass = (*env)->GetObjectClass(env, obj); + fid = (*env)->GetFieldID(env, thisClass, "fileDescriptor", "I"); + fd = (*env)->GetIntField(env, obj, fid); + if (fd < 0) { + fprintf(stderr, "FileOutputStream::write(): failed to get file + descriptor\n"); + throwAFSFileException(env, 0, "Failed to get file descriptor!"); + } + + bytes = (char *)malloc(length); + if (bytes == NULL) { + fprintf(stderr, + "FileOutputStream::write(): malloc failed of %d bytes\n", + length); + throwAFSFileException(env, 0, "Failed to allocate memory!"); + } + + (*env)->GetByteArrayRegion(env, jbytes, offset, length, bytes); + toWrite = length; + twritten = 0; + + while (toWrite > 0) { + written = uafs_write(fd, bytes, length); + twritten += written; + if (written < 0) { + free(bytes); + throwAFSFileException(env, errno, NULL); + } + toWrite -= written; + } + free(bytes); +} + +/** + * Closes this file output stream and releases any system resources + * associated with this stream. This file output stream may no longer + * be used for writing bytes. + * + * env the Java environment + * obj the current Java object + * + * @exception AFSFileException if an I/O or other file related error occurs. + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_FileOutputStream_close(JNIEnv * env, jobject obj) +{ + int fd, rc; + jclass thisClass; + jmethodID getFileDescriptorID; + char *bytes; + jfieldID fid; + + thisClass = (*env)->GetObjectClass(env, obj); + fid = (*env)->GetFieldID(env, thisClass, "fileDescriptor", "I"); + fd = (*env)->GetIntField(env, obj, fid); + if (fd < 0) { + fprintf(stderr, + "FileOutputStream::close(): failed to get file descriptor\n"); + throwAFSFileException(env, 0, "Failed to get file descriptor!"); + } + rc = uafs_close(fd); + if (rc != 0) { + throwAFSFileException(env, rc, NULL); + } +} diff --git a/src/JAVA/libjafs/Group.c b/src/JAVA/libjafs/Group.c new file mode 100644 index 000000000..1dcb55749 --- /dev/null +++ b/src/JAVA/libjafs/Group.c @@ -0,0 +1,751 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 "Internal.h" +#include "org_openafs_jafs_Group.h" + +#include +#include +#include +#include +#include +#include + +///// definitions in Internal.c /////////////// + +extern jclass userCls; +//extern jfieldID user_cellHandleField; +extern jfieldID user_nameField; +extern jfieldID user_cachedInfoField; + +extern jclass groupCls; +extern jfieldID group_nameField; +extern jfieldID group_nameUidField; +extern jfieldID group_ownerUidField; +extern jfieldID group_creatorUidField; +extern jfieldID group_listStatusField; +extern jfieldID group_listGroupsOwnedField; +extern jfieldID group_listMembershipField; +extern jfieldID group_listAddField; +extern jfieldID group_listDeleteField; +extern jfieldID group_membershipCountField; +extern jfieldID group_ownerField; +extern jfieldID group_creatorField; + +////////////////////////////////////////////////////// + + +/** + * Creates the PTS entry for a new group. Pass in 0 for the uid if PTS is to + * automatically assign the group id. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the group belongs + * jgroupName the name of the group to create + * jownerName the owner of this group + * gid the group id to assign to the group (0 to have one + * automatically assigned) + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Group_create(JNIEnv * env, jclass cls, jint cellHandle, + jstring jgroupName, jstring jownerName, + jint gid) +{ + afs_status_t ast; + // convert java strings + char *groupName; + char *ownerName; + + if (jgroupName != NULL) { + groupName = getNativeString(env, jgroupName); + if (groupName == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLGROUP); + return; + } + + if (jownerName != NULL) { + ownerName = getNativeString(env, jownerName); + if (ownerName == NULL) { + free(groupName); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(groupName); + throwAFSException(env, JAFSNULLOWNER); + return; + } + + // make sure the name is within the allowed bounds + if (strlen(groupName) > PTS_MAX_NAME_LEN) { + // release converted java strings + free(groupName); + free(ownerName); + throwAFSException(env, ADMPTSGROUPNAMETOOLONG); + return; + } + + if (!pts_GroupCreate + ((void *)cellHandle, groupName, ownerName, (int *)&gid, &ast)) { + // release converted java strings + free(groupName); + free(ownerName); + throwAFSException(env, ast); + return; + } + // release converted java strings + free(groupName); + free(ownerName); +} + +/** + * Deletes the PTS entry for a group. Deletes this group from the + * membership list of the users that belonged to it, but does not delete + * the groups owned by this group. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the group belongs + * jgroupName the name of the group to delete + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Group_delete(JNIEnv * env, jclass cls, jint cellHandle, + jstring jgroupName) +{ + afs_status_t ast; + // convert java strings + char *groupName; + + if (jgroupName != NULL) { + groupName = getNativeString(env, jgroupName); + if (!groupName) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLGROUP); + return; + } + + if (!pts_GroupDelete((void *)cellHandle, groupName, &ast)) { + throwAFSException(env, ast); + } + // release converted java strings + free(groupName); +} + +/** + * Retrieve the information for the specified group and populate the + * given object + * + * env the Java environment + * cellHandle the handle of the cell to which the user belongs + * name the name of the group for which to get the info + * group the Group object to populate with the info + */ +void +getGroupInfoChar(JNIEnv * env, jint cellHandle, const char *name, + jobject group) +{ + + jstring jowner; + jstring jcreator; + pts_GroupEntry_t entry; + afs_status_t ast; + // get the field ids if you haven't already + if (groupCls == 0) { + internal_getGroupClass(env, group); + } + + if (!pts_GroupGet((void *)cellHandle, name, &entry, &ast)) { + throwAFSException(env, ast); + return; + } + // set the fields + (*env)->SetIntField(env, group, group_nameUidField, entry.nameUid); + (*env)->SetIntField(env, group, group_ownerUidField, entry.ownerUid); + (*env)->SetIntField(env, group, group_creatorUidField, entry.creatorUid); + (*env)->SetIntField(env, group, group_membershipCountField, + entry.membershipCount); + + if (entry.listStatus == PTS_GROUP_OWNER_ACCESS) { + (*env)->SetIntField(env, group, group_listStatusField, + org_openafs_jafs_Group_GROUP_OWNER_ACCESS); + } else if (entry.listStatus == PTS_GROUP_ACCESS) { + (*env)->SetIntField(env, group, group_listStatusField, + org_openafs_jafs_Group_GROUP_GROUP_ACCESS); + } else { + (*env)->SetIntField(env, group, group_listStatusField, + org_openafs_jafs_Group_GROUP_ANYUSER_ACCESS); + } + + if (entry.listGroupsOwned == PTS_GROUP_OWNER_ACCESS) { + (*env)->SetIntField(env, group, group_listGroupsOwnedField, + org_openafs_jafs_Group_GROUP_OWNER_ACCESS); + } else if (entry.listGroupsOwned == PTS_GROUP_ACCESS) { + (*env)->SetIntField(env, group, group_listGroupsOwnedField, + org_openafs_jafs_Group_GROUP_GROUP_ACCESS); + } else { + (*env)->SetIntField(env, group, group_listGroupsOwnedField, + org_openafs_jafs_Group_GROUP_ANYUSER_ACCESS); + } + + if (entry.listMembership == PTS_GROUP_OWNER_ACCESS) { + (*env)->SetIntField(env, group, group_listMembershipField, + org_openafs_jafs_Group_GROUP_OWNER_ACCESS); + } else if (entry.listMembership == PTS_GROUP_ACCESS) { + (*env)->SetIntField(env, group, group_listMembershipField, + org_openafs_jafs_Group_GROUP_GROUP_ACCESS); + } else { + (*env)->SetIntField(env, group, group_listMembershipField, + org_openafs_jafs_Group_GROUP_ANYUSER_ACCESS); + } + + if (entry.listAdd == PTS_GROUP_OWNER_ACCESS) { + (*env)->SetIntField(env, group, group_listAddField, + org_openafs_jafs_Group_GROUP_OWNER_ACCESS); + } else if (entry.listAdd == PTS_GROUP_ACCESS) { + (*env)->SetIntField(env, group, group_listAddField, + org_openafs_jafs_Group_GROUP_GROUP_ACCESS); + } else { + (*env)->SetIntField(env, group, group_listAddField, + org_openafs_jafs_Group_GROUP_ANYUSER_ACCESS); + } + + if (entry.listDelete == PTS_GROUP_OWNER_ACCESS) { + (*env)->SetIntField(env, group, group_listDeleteField, + org_openafs_jafs_Group_GROUP_OWNER_ACCESS); + } else if (entry.listDelete == PTS_GROUP_ACCESS) { + (*env)->SetIntField(env, group, group_listDeleteField, + org_openafs_jafs_Group_GROUP_GROUP_ACCESS); + } else { + (*env)->SetIntField(env, group, group_listDeleteField, + org_openafs_jafs_Group_GROUP_ANYUSER_ACCESS); + } + + jowner = (*env)->NewStringUTF(env, entry.owner); + jcreator = (*env)->NewStringUTF(env, entry.creator); + + (*env)->SetObjectField(env, group, group_ownerField, jowner); + (*env)->SetObjectField(env, group, group_creatorField, jcreator); +} + +/** + * Fills in the information fields of the provided Group. + * Fills in values based on the current PTS information of the group. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the group belongs + * name the name of the group for which to get the information + * group the Group object in which to fill in the + * information + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Group_getGroupInfo(JNIEnv * env, jclass cls, + jint cellHandle, jstring jname, + jobject group) +{ + char *name; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (!name) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLGROUP); + return; + } + getGroupInfoChar(env, cellHandle, name, group); + + // get class fields if need be + if (groupCls == 0) { + internal_getGroupClass(env, group); + } + // set name in case blank object + (*env)->SetObjectField(env, group, group_nameField, jname); + + free(name); +} + +/** + * Sets the information values of this AFS group to be the parameter values. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * name the name of the user for which to set the information + * theGroup the group object containing the desired information + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Group_setGroupInfo(JNIEnv * env, jclass cls, + jint cellHandle, jstring jname, + jobject group) +{ + char *name; + pts_GroupUpdateEntry_t ptsEntry; + afs_status_t ast; + + jint jlistStatus; + jint jlistGroupsOwned; + jint jlistMembership; + jint jlistAdd; + jint jlistDelete; + + // get the field ids if you haven't already + if (groupCls == 0) { + internal_getGroupClass(env, group); + } + + jlistStatus = (*env)->GetIntField(env, group, group_listStatusField); + jlistGroupsOwned = + (*env)->GetIntField(env, group, group_listGroupsOwnedField); + jlistMembership = + (*env)->GetIntField(env, group, group_listMembershipField); + jlistAdd = (*env)->GetIntField(env, group, group_listAddField); + jlistDelete = (*env)->GetIntField(env, group, group_listDeleteField); + + if (jname != NULL) { + name = getNativeString(env, jname); + if (name == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLGROUP); + return; + } + + if (jlistStatus == org_openafs_jafs_Group_GROUP_OWNER_ACCESS) { + ptsEntry.listStatus = PTS_GROUP_OWNER_ACCESS; + } else if (jlistStatus == org_openafs_jafs_Group_GROUP_GROUP_ACCESS) { + ptsEntry.listStatus = PTS_GROUP_ACCESS; + } else { + ptsEntry.listStatus = PTS_GROUP_ANYUSER_ACCESS; + } + if (jlistGroupsOwned == org_openafs_jafs_Group_GROUP_OWNER_ACCESS) { + ptsEntry.listGroupsOwned = PTS_GROUP_OWNER_ACCESS; + } else if (jlistGroupsOwned == org_openafs_jafs_Group_GROUP_GROUP_ACCESS) { + ptsEntry.listGroupsOwned = PTS_GROUP_ACCESS; + } else { + ptsEntry.listGroupsOwned = PTS_GROUP_ANYUSER_ACCESS; + } + if (jlistMembership == org_openafs_jafs_Group_GROUP_OWNER_ACCESS) { + ptsEntry.listMembership = PTS_GROUP_OWNER_ACCESS; + } else if (jlistMembership == org_openafs_jafs_Group_GROUP_GROUP_ACCESS) { + ptsEntry.listMembership = PTS_GROUP_ACCESS; + } else { + ptsEntry.listMembership = PTS_GROUP_ANYUSER_ACCESS; + } + if (jlistAdd == org_openafs_jafs_Group_GROUP_OWNER_ACCESS) { + ptsEntry.listAdd = PTS_GROUP_OWNER_ACCESS; + } else if (jlistAdd == org_openafs_jafs_Group_GROUP_GROUP_ACCESS) { + ptsEntry.listAdd = PTS_GROUP_ACCESS; + } else { + ptsEntry.listAdd = PTS_GROUP_ANYUSER_ACCESS; + } + if (jlistDelete == org_openafs_jafs_Group_GROUP_OWNER_ACCESS) { + ptsEntry.listDelete = PTS_GROUP_OWNER_ACCESS; + } else if (jlistDelete == org_openafs_jafs_Group_GROUP_GROUP_ACCESS) { + ptsEntry.listDelete = PTS_GROUP_ACCESS; + } else { + ptsEntry.listDelete = PTS_GROUP_ANYUSER_ACCESS; + } + + if (!pts_GroupModify((void *)cellHandle, name, &ptsEntry, &ast)) { + throwAFSException(env, ast); + } + + free(name); +} + +/** + * Begin the process of getting the users that belong to the group. Returns + * an iteration ID to be used by subsequent calls to + * getGroupMembersNext and getGroupMembersDone. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the group belongs + * jname the name of the group for which to get the members + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Group_getGroupMembersBegin(JNIEnv * env, jclass cls, + jint cellHandle, + jstring jname) +{ + char *name; + afs_status_t ast; + void *iterationId; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (name == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return 0; + } + } else { + throwAFSException(env, JAFSNULLGROUP); + return 0; + } + + if (!pts_GroupMemberListBegin + ((void *)cellHandle, name, &iterationId, &ast)) { + throwAFSException(env, ast); + } + + free(name); + + return (jint) iterationId; +} + +/** + * Returns the next members that belongs to the group. Returns + * null if there are no more members. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * returns the name of the next member + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_Group_getGroupMembersNextString(JNIEnv * env, + jclass cls, + jint iterationId) +{ + afs_status_t ast; + char *userName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + jstring juser; + + if (!userName) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (!pts_GroupMemberListNext((void *)iterationId, userName, &ast)) { + free(userName); + if (ast == ADMITERATORDONE) { + return NULL; + } else { + throwAFSException(env, ast); + return; + } + } + + juser = (*env)->NewStringUTF(env, userName); + free(userName); + return juser; +} + +/** + * Fills the next user object belonging to that group. Returns 0 if there + * are no more users, != 0 otherwise. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * iterationId the iteration ID of this iteration + * juserObject a User object to be populated with the values of the + * next user + * returns 0 if there are no more users, != 0 otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Group_getGroupMembersNext(JNIEnv * env, jclass cls, + jint cellHandle, + jint iterationId, + jobject juserObject) +{ + afs_status_t ast; + char *userName; + jstring juser; + + userName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + + if (!userName) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (!pts_GroupMemberListNext((void *)iterationId, userName, &ast)) { + free(userName); + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + + juser = (*env)->NewStringUTF(env, userName); + + if (userCls == 0) { + internal_getUserClass(env, juserObject); + } + + (*env)->SetObjectField(env, juserObject, user_nameField, juser); + + getUserInfoChar(env, (void *)cellHandle, userName, juserObject); + (*env)->SetBooleanField(env, juserObject, user_cachedInfoField, TRUE); + + free(userName); + return 1; + +} + +/** + * Signals that the iteration is complete and will not be accessed anymore. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Group_getGroupMembersDone(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + + if (!pts_GroupMemberListDone((void *)iterationId, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Adds a user to the specified group. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the group belongs + * jgroupName the name of the group to which to add a member + * juserName the name of the user to add + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Group_addMember(JNIEnv * env, jclass cls, + jint cellHandle, jstring jgroupName, + jstring juserName) +{ + afs_status_t ast; + char *groupName; + char *userName; + + if (jgroupName != NULL) { + groupName = getNativeString(env, jgroupName); + if (groupName == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLGROUP); + return; + } + + if (juserName != NULL) { + userName = getNativeString(env, juserName); + if (userName == NULL) { + free(groupName); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(groupName); + throwAFSException(env, JAFSNULLUSER); + return; + } + + if (!pts_GroupMemberAdd((void *)cellHandle, userName, groupName, &ast)) { + throwAFSException(env, ast); + } + + free(userName); + free(groupName); +} + +/** + * Removes a user from the specified group. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the group belongs + * jgroupName the name of the group from which to remove a + * member + * juserName the name of the user to remove + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Group_removeMember(JNIEnv * env, jclass cls, + jint cellHandle, jstring jgroupName, + jstring juserName) +{ + afs_status_t ast; + char *groupName; + char *userName; + + if (jgroupName != NULL) { + groupName = getNativeString(env, jgroupName); + if (groupName == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLGROUP); + return; + } + + if (juserName != NULL) { + userName = getNativeString(env, juserName); + if (userName == NULL) { + free(groupName); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(groupName); + throwAFSException(env, JAFSNULLUSER); + return; + } + + if (!pts_GroupMemberRemove((void *)cellHandle, userName, groupName, &ast)) { + throwAFSException(env, ast); + } + + free(groupName); + free(userName); +} + +/** + * Change the owner of the specified group. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the group belongs + * jgroupName the name of the group of which to change the + * owner + * jownerName the name of the new owner + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Group_changeOwner(JNIEnv * env, jclass cls, + jint cellHandle, jstring jgroupName, + jstring jownerName) +{ + afs_status_t ast; + char *groupName; + char *ownerName; + + if (jgroupName != NULL) { + groupName = getNativeString(env, jgroupName); + if (groupName == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLGROUP); + return; + } + + if (jownerName != NULL) { + ownerName = getNativeString(env, jownerName); + if (ownerName == NULL) { + free(groupName); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(groupName); + throwAFSException(env, JAFSNULLOWNER); + return; + } + + if (!pts_GroupOwnerChange((void *)cellHandle, groupName, ownerName, &ast)) { + throwAFSException(env, ast); + } + + free(groupName); + free(ownerName); +} + +/** + * Change the name of the specified group. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the group belongs + * joldGroupName the old name of the group + * jnewGroupName the new name for the group + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Group_rename(JNIEnv * env, jclass cls, jint cellHandle, + jstring jgroupOldName, + jstring jgroupNewName) +{ + afs_status_t ast; + char *groupOldName; + char *groupNewName; + + if (jgroupOldName != NULL) { + groupOldName = getNativeString(env, jgroupOldName); + if (groupOldName == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLGROUP); + return; + } + + if (jgroupNewName != NULL) { + groupNewName = getNativeString(env, jgroupNewName); + if (groupNewName == NULL) { + free(groupOldName); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(groupOldName); + throwAFSException(env, JAFSNULLGROUP); + return; + } + + if (!pts_GroupRename + ((void *)cellHandle, groupOldName, groupNewName, &ast)) { + throwAFSException(env, ast); + } + + free(groupOldName); + free(groupNewName); +} + +// reclaim global memory used by this portion +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Group_reclaimGroupMemory(JNIEnv * env, jclass cls) +{ + if (groupCls) { + (*env)->DeleteGlobalRef(env, groupCls); + groupCls = 0; + } +} diff --git a/src/JAVA/libjafs/Internal.c b/src/JAVA/libjafs/Internal.c new file mode 100644 index 000000000..9ca036568 --- /dev/null +++ b/src/JAVA/libjafs/Internal.c @@ -0,0 +1,1042 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 "Internal.h" + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +extern int errno; + +jmethodID MID_String_getBytes = 0; + +#ifndef LIBJUAFS +/* User Class and Fields */ +jclass userCls = 0; +jfieldID user_ptsField = 0; +jfieldID user_kasField = 0; +jfieldID user_nameField = 0; +jfieldID user_cachedInfoField = 0; +/* PTS Fields */ +jfieldID user_nameUidField = 0; +jfieldID user_ownerUidField = 0; +jfieldID user_creatorUidField = 0; +jfieldID user_listStatusField = 0; +jfieldID user_listGroupsOwnedField = 0; +jfieldID user_listMembershipField = 0; +jfieldID user_groupCreationQuotaField = 0; +jfieldID user_groupMembershipCountField = 0; +jfieldID user_ownerField = 0; +jfieldID user_creatorField = 0; +/* KAS Fields */ +jfieldID user_adminSettingField = 0; +jfieldID user_tgsSettingField = 0; +jfieldID user_encSettingField = 0; +jfieldID user_cpwSettingField = 0; +jfieldID user_rpwSettingField = 0; +jfieldID user_userExpirationField = 0; +jfieldID user_lastModTimeField = 0; +jfieldID user_lastModNameField = 0; +jfieldID user_lastChangePasswordTimeField = 0; +jfieldID user_maxTicketLifetimeField = 0; +jfieldID user_keyVersionField = 0; +jfieldID user_encryptionKeyField = 0; +jfieldID user_keyCheckSumField = 0; +jfieldID user_daysToPasswordExpireField = 0; +jfieldID user_failLoginCountField = 0; +jfieldID user_lockTimeField = 0; +jfieldID user_lockedUntilField = 0; + +/* Group Class and Fields */ +jclass groupCls = 0; +jfieldID group_nameField = 0; +jfieldID group_cachedInfoField = 0; +jfieldID group_nameUidField = 0; +jfieldID group_ownerUidField = 0; +jfieldID group_creatorUidField = 0; +jfieldID group_listStatusField = 0; +jfieldID group_listGroupsOwnedField = 0; +jfieldID group_listMembershipField = 0; +jfieldID group_listAddField = 0; +jfieldID group_listDeleteField = 0; +jfieldID group_membershipCountField = 0; +jfieldID group_ownerField = 0; +jfieldID group_creatorField = 0; + +/* Server Class and Fields */ +jclass serverCls = 0; +jfieldID server_nameField = 0; +jfieldID server_cachedInfoField = 0; +jfieldID server_databaseField = 0; +jfieldID server_fileServerField = 0; +jfieldID server_badDatabaseField = 0; +jfieldID server_badFileServerField = 0; +jfieldID server_IPAddressField = 0; + +/* Executable Time Class and Fields */ +jclass exectimeCls = 0; +jfieldID exectime_HourField = 0; +jfieldID exectime_MinField = 0; +jfieldID exectime_SecField = 0; +jfieldID exectime_DayField = 0; +jfieldID exectime_NowField = 0; +jfieldID exectime_NeverField = 0; + +/* Partition Class and Fields */ +jclass partitionCls = 0; +jfieldID partition_nameField = 0; +jfieldID partition_cachedInfoField = 0; +jfieldID partition_idField = 0; +jfieldID partition_deviceNameField = 0; +jfieldID partition_lockFileDescriptorField = 0; +jfieldID partition_totalSpaceField = 0; +jfieldID partition_totalFreeSpaceField = 0; + +/* Volume Class and Fields */ +jclass volumeCls = 0; +jfieldID volume_nameField = 0; +jfieldID volume_cachedInfoField = 0; +jfieldID volume_idField = 0; +jfieldID volume_readWriteIdField = 0; +jfieldID volume_readOnlyIdField = 0; +jfieldID volume_backupIdField = 0; +jfieldID volume_creationDateField = 0; +jfieldID volume_lastAccessDateField = 0; +jfieldID volume_lastUpdateDateField = 0; +jfieldID volume_lastBackupDateField = 0; +jfieldID volume_copyCreationDateField = 0; +jfieldID volume_accessesSinceMidnightField = 0; +jfieldID volume_fileCountField = 0; +jfieldID volume_maxQuotaField = 0; +jfieldID volume_currentSizeField = 0; +jfieldID volume_statusField = 0; +jfieldID volume_dispositionField = 0; +jfieldID volume_typeField = 0; + +/* Key Class and Fields */ +jclass keyCls = 0; +jfieldID key_cachedInfoField = 0; +jfieldID key_versionField = 0; +jfieldID key_encryptionKeyField = 0; +jfieldID key_lastModDateField = 0; +jfieldID key_lastModMsField = 0; +jfieldID key_checkSumField = 0; + +/* Process Class and Fields */ +jclass processCls = 0; +jfieldID process_cachedInfoField = 0; +jfieldID process_nameField = 0; +jfieldID process_typeField = 0; +jfieldID process_stateField = 0; +jfieldID process_goalField = 0; +jfieldID process_startTimeField = 0; +jfieldID process_numberStartsField = 0; +jfieldID process_exitTimeField = 0; +jfieldID process_exitErrorTimeField = 0; +jfieldID process_errorCodeField = 0; +jfieldID process_errorSignalField = 0; +jfieldID process_stateOkField = 0; +jfieldID process_stateTooManyErrorsField = 0; +jfieldID process_stateBadFileAccessField = 0; + +#endif /* !LIBJUAFS */ + +/** + * Throws an exception up to the Java layer, using ast as the error code + * for the exception. See Exceptions.h for the available + * exceptions. + */ +void +throwException(JNIEnv * env, jclass * excCls, char *excClsName, + jmethodID * initID, int code) +{ + jobject exc; + if (*excCls == 0) { + *excCls = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, excClsName)); + if (!*excCls) { + fprintf(stderr, + "ERROR: Internal::throwException()\n Cannot find class: %s\n", + excClsName); + return; + } + *initID = (*env)->GetMethodID(env, *excCls, "", "(I)V"); + if (!*initID) { + fprintf(stderr, + "ERROR: Internal::throwException()\n Cannot find construction method: %s\n", + excClsName); + return; + } + } + + exc = (*env)->NewObject(env, *excCls, *initID, code); + if (!exc) { + fprintf(stderr, + "ERROR: Internal::throwException()\n Cannot construct new exception object: %s\n", + excClsName); + return; + } + (*env)->Throw(env, exc); +} + +/** + * Throws an exception up to the Java layer, constructing it with msg. + * This function should only be used when a valid AFS error number/code + * is unavailable and it is necessary to interrupt the Java call with an + * exception. See Exceptions.h for the available exceptions. + */ +void +throwMessageException(JNIEnv * env, char *msg) +{ + jclass excCls = (*env)->FindClass(env, afsExceptionName); + if (excCls == 0) { + fprintf(stderr, + "ERROR: Internal::throwMessageException()\n Cannot find class: %s\n", + afsExceptionName); + return; + } + (*env)->ThrowNew(env, excCls, msg); +} + +/** + * Throws an exception up to the Java layer, using ast as the error code + * for the exception. See Exceptions.h for the available + * exceptions. + */ +void +throwAFSException(JNIEnv * env, int code) +{ + jclass afsExceptionCls; + jmethodID afsExceptionInit; + jthrowable exc; + + afsExceptionCls = (*env)->FindClass(env, afsExceptionName); + if (!afsExceptionCls) { + fprintf(stderr, + "ERROR: Internal::throwAFSException()\n Cannot find class: %s\n", + afsExceptionName); + return; + } + + afsExceptionInit = + (*env)->GetMethodID(env, afsExceptionCls, "", "(I)V"); + if (!afsExceptionInit) { + fprintf(stderr, + "ERROR: Internal::throwAFSException()\n Cannot find construction method: %s\n", + afsExceptionName); + return; + } + + exc = (*env)->NewObject(env, afsExceptionCls, afsExceptionInit, code); + + if (!exc) { + fprintf(stderr, + "ERROR: Internal::throwAFSException()\n Cannot construct new exception object: %s\n", + afsExceptionName); + return; + } + (*env)->Throw(env, exc); +} + +/** + * Throws an exception up to the Java layer, using ast as the error code + * for the exception. See Exceptions.h for the available + * exceptions. + */ +void +throwAFSFileException(JNIEnv * env, int code, char *msg) +{ + jclass afsFileExceptionCls; + jmethodID afsFileExceptionInit; + jthrowable exc; + + afsFileExceptionCls = (*env)->FindClass(env, afsFileExceptionName); + if (!afsFileExceptionCls) { + fprintf(stderr, + "ERROR: Internal::throwAFSFileException()\n Cannot find class: %s\n", + afsFileExceptionName); + return; + } + + afsFileExceptionInit = + (*env)->GetMethodID(env, afsFileExceptionCls, "", + "(Ljava/lang/String;I)V"); + + if (!afsFileExceptionInit) { + fprintf(stderr, + "ERROR: Internal::throwAFSFileException()\n Cannot find construction method: %s\n", + afsFileExceptionName); + return; + } + + exc = + (*env)->NewObject(env, afsFileExceptionCls, afsFileExceptionInit, msg, + code); + if (!exc) { + fprintf(stderr, + "ERROR: Internal::throwAFSFileException()\n Cannot construct new exception object: %s\n", + afsFileExceptionName); + return; + } + (*env)->Throw(env, exc); +} + +/** + * Throws an exception up to the Java layer, using ast as the error code + * for the exception. See Exceptions.h for the available + * exceptions. + */ +void +throwAFSSecurityException(JNIEnv * env, int code) +{ + jclass afsSecurityExceptionCls; + jmethodID afsSecurityExceptionInit; + jthrowable exc; + + afsSecurityExceptionCls = + (*env)->FindClass(env, afsSecurityExceptionName); + if (!afsSecurityExceptionCls) { + fprintf(stderr, + "ERROR: Internal::throwAFSSecurityException()\n Cannot find class: %s\n", + afsSecurityExceptionName); + return; + } + + afsSecurityExceptionInit = + (*env)->GetMethodID(env, afsSecurityExceptionCls, "", "(I)V"); + if (!afsSecurityExceptionInit) { + fprintf(stderr, + "ERROR: Internal::throwAFSSecurityException()\n Cannot find construction method: %s\n", + afsSecurityExceptionName); + return; + } + + exc = + (*env)->NewObject(env, afsSecurityExceptionCls, + afsSecurityExceptionInit, code); + + if (!exc) { + fprintf(stderr, + "ERROR: Internal::throwAFSSecurityException()\n Cannot construct new exception object: %s\n", + afsSecurityExceptionName); + return; + } + (*env)->Throw(env, exc); +} + +int +setError(JNIEnv * env, jobject * obj, int code) +{ + jfieldID fid; + jclass cls = (*env)->GetObjectClass(env, *obj); + if (cls != NULL) { + fid = (*env)->GetFieldID(env, cls, "errno", "I"); + if (fid) { + (*env)->SetIntField(env, *obj, fid, code); + return 0; + } + } + return -1; +} + +int +setString(JNIEnv * env, jobject * obj, char *field, char *string) +{ + jclass cls; + jstring jstr; + jfieldID fid; + + cls = (*env)->GetObjectClass(env, *obj); + /*fprintf(stderr, "setString: env=0x%x, obj=0x%x, cls=0x%x\n", env, obj, cls); */ + if (cls != NULL) { + fid = (*env)->GetFieldID(env, cls, field, "Ljava/lang/String;"); + /*fprintf(stderr, "setString: field=%s, fid=0x%x\n", field, fid); */ + if (fid) { + jstr = (*env)->NewStringUTF(env, (string)); + /*fprintf(stderr, "jstr = 0x%x\n", jstr); */ + (*env)->SetObjectField(env, *obj, fid, jstr); + return 0; + } + } + return -1; +} + +/** + * Translates a jstring to a locale-specific native C string. + * Use in place of "GetStringUTFChars()" for internationalization + * purposes. + * + * Make sure to "free()" any strings created by this function. + * + * A NULL (zero) return indicates a critical error has occurred and + * relies on the caller of this function to throw a Java exception. + * + * This function does not throw any Java exceptions. + * + * env the Java environment + * jstr the Java string (UTF) to translate + * + * @returns native C string with the appropriate locale-specific + * representation + */ +char * +getNativeString(JNIEnv * env, const jstring jstr) +{ + jbyteArray bytes = 0; + char *result = NULL; + jint len = 0; + + if ((*env)->EnsureLocalCapacity(env, 2) < 0) { + // Out of memory error + fprintf(stderr, "Internal::getNativeString(): "); + fprintf(stderr, + "EnsureLocalCapacity() failed: Most likely out of memory\n"); + return NULL; + } + + if (!MID_String_getBytes) { + jclass stringClass = (*env)->FindClass(env, "java/lang/String"); + if (!stringClass) { + fprintf(stderr, "Internal::getNativeString(): "); + fprintf(stderr, + "Could not locate Java class: java.lang.String.\n"); + return NULL; + } + + MID_String_getBytes = + (*env)->GetMethodID(env, stringClass, "getBytes", "()[B"); + if (!MID_String_getBytes) { + fprintf(stderr, "Internal::getNativeString(): "); + fprintf(stderr, + "Could not get Java method id for java.lang.String method \"getBytes()\".\n"); + return NULL; + } + } + + bytes = (*env)->CallObjectMethod(env, jstr, MID_String_getBytes); + if (!bytes) { + fprintf(stderr, "Internal::getNativeString(): "); + fprintf(stderr, + "CallObjectMethod() failed for java.lang.String.getBytes().\n"); + fprintf(stderr, "\tMID_String_getBytes = %d\n", MID_String_getBytes); + return NULL; + } + + len = (*env)->GetArrayLength(env, bytes); + result = (char *)malloc(len + 1); + + if (!result) { + fprintf(stderr, "Internal::getNativeString(): "); + fprintf(stderr, "Could not allocate memory for byte array.\n"); + (*env)->DeleteLocalRef(env, bytes); + return NULL; + } + (*env)->GetByteArrayRegion(env, bytes, 0, len, (jbyte *) result); + result[len] = '\0'; // NULL-terminate + + (*env)->DeleteLocalRef(env, bytes); + return result; +} + +#ifdef LIBJUAFS + +/** + * Opens an AFS file, with the specified name, using the specified flags + * with in the specified mode (permission mode). + * + * env the Java environment + * fileNameUTF name of file to be opened + * flags open mode: O_CREAT, O_APPEND + * mode UNIX permission mode mask + * err error variable + * + * @returns file descriptor + */ +int +openAFSFile(JNIEnv * env, jstring filenameUTF, int flags, int mode, int *err) +{ + char *filename; + int fd = -1; + + *err = 0; + errno = 0; + filename = getNativeString(env, filenameUTF); + if (filename == NULL) { + fprintf(stderr, "Internal::openAFSFile(): failed to get filename\n"); + *err = -1; + return fd; + } + fd = uafs_open(filename, flags, mode); + free(filename); + *err = errno; + if (errno != 0) { + fprintf(stderr, "Internal::openAFSFile(): errno=%d\n", errno); + fprintf(stderr, "Internal::openAFSFile(): fd=%d\n", fd); + } + if (fd < 0) { + fprintf(stderr, "Internal::openAFSFile(): failed to open filename\n"); + fprintf(stderr, "Internal::openAFSFile(): fd=%d\n", fd); + return -1; + } + return fd; +} + +/** + * Reads the "CacheConfig" file for user space configuration. + * By default, this file resides in "/usr/afswsp/etc/CacheConfig", + * however if the environment variable "LIBJAFS_CACHE_CONFIG" is + * set this function will use that value instead. + * + * The CacheConfig file contains several cache tuning parameters + * as well as a few parameters that define the runtime environment + * for the user space client, including: mount point location, + * configuration directory (where to find ThisCell and CellServDB), + * cache directory, debug and verbose options, and log file location. + */ +int +readCacheParms(char *afsMountPoint, char *afsConfDir, char *afsCacheDir, + int *cacheBlocks, int *cacheFiles, int *cacheStatEntries, + int *dCacheSize, int *vCacheSize, int *chunkSize, + int *closeSynch, int *debug, int *nDaemons, int *cacheFlags, + char *logFile) +{ + FILE *f; + char line[100]; + char *p; + int len1, len2, n; + char cacheConfigFile[100]; + + p = (char *)getenv("LIBJAFS_CACHE_CONFIG"); + if (p) { + strcpy(cacheConfigFile, p); + } else { + strcpy(cacheConfigFile, "/usr/afswsp/etc/CacheConfig"); + } + + f = fopen(cacheConfigFile, "r"); + if (!f) { + fprintf(stderr, "Could not open cache config file: %s\n", + cacheConfigFile); + return -1; + } + + while (1) { + fgets(line, 100, f); + if (feof(f)) + break; + p = (char *)strchr(line, '\n'); + if (p) + *p = '\0'; + if (strncmp(line, "#", 1) == 0) + continue; /* comment */ + + p = (char *)strchr(line, ' '); + if (!p) + continue; + len1 = p - line; + p++; + len2 = strlen(p); + + if (strncmp(line, "MountPoint", len1) == 0) + strcpy(afsMountPoint, p); + else if (strncmp(line, "ConfDir", len1) == 0) + strcpy(afsConfDir, p); + else if (strncmp(line, "CacheDir", len1) == 0) + strcpy(afsCacheDir, p); + else if (strncmp(line, "CacheBlocks", len1) == 0) + *cacheBlocks = atoi(p); + else if (strncmp(line, "CacheFiles", len1) == 0) + *cacheFiles = atoi(p); + else if (strncmp(line, "CacheStatEntries", len1) == 0) + *cacheStatEntries = atoi(p); + else if (strncmp(line, "DCacheSize", len1) == 0) + *dCacheSize = atoi(p); + else if (strncmp(line, "VCacheSize", len1) == 0) + *vCacheSize = atoi(p); + else if (strncmp(line, "ChunkSize", len1) == 0) + *chunkSize = atoi(p); + else if (strncmp(line, "CloseSynch", len1) == 0) + *closeSynch = atoi(p); + else if (strncmp(line, "Debug", len1) == 0) + *debug = atoi(p); + else if (strncmp(line, "NDaemons", len1) == 0) + *nDaemons = atoi(p); + else if (strncmp(line, "CacheFlags", len1) == 0) + *cacheFlags = atoi(p); + else if (strncmp(line, "LogFile", len1) == 0) + strcpy(logFile, p); + } + return 0; +} + +#else + +/** + * Makes a kas identity given the full name of a kas user. If the + * name contains a period, everything after the first period is + * considered to be the instance of that name, otherwise + * the instance is the empty string. The memory for who + * that's passed in should be fully allocated in advance. + */ +void +internal_makeKasIdentity(const char *fullName, kas_identity_p who) +{ + char *period; + + if ((period = (char *)strchr(fullName, '.')) != NULL) { + strncpy(who->principal, fullName, period - fullName); + who->principal[period - fullName] = '\0'; + strncpy(who->instance, period + 1, + strlen(fullName) - (period - fullName)); + } else { + strcpy(who->principal, fullName); + strcpy(who->instance, ""); + } +} + +/** + * Given a Java environment and an instance of a user, gets the object and + * field information for the user object from the Java environment. + */ +void +internal_getUserClass(JNIEnv * env, jobject user) +{ + if (userCls == 0) { + userCls = + (*env)->NewGlobalRef(env, (*env)->GetObjectClass(env, user)); + if (!userCls) { + throwAFSException(env, JAFSADMCLASSNOTFOUND); + return; + } + user_ptsField = (*env)->GetFieldID(env, userCls, "pts", "Z"); + user_kasField = (*env)->GetFieldID(env, userCls, "kas", "Z"); + user_nameField = + (*env)->GetFieldID(env, userCls, "name", "Ljava/lang/String;"); + user_cachedInfoField = + (*env)->GetFieldID(env, userCls, "cachedInfo", "Z"); + // pts fields + user_nameUidField = (*env)->GetFieldID(env, userCls, "nameUID", "I"); + user_ownerUidField = + (*env)->GetFieldID(env, userCls, "ownerUID", "I"); + user_creatorUidField = + (*env)->GetFieldID(env, userCls, "creatorUID", "I"); + user_listStatusField = + (*env)->GetFieldID(env, userCls, "listStatus", "I"); + user_listGroupsOwnedField = + (*env)->GetFieldID(env, userCls, "listGroupsOwned", "I"); + user_listMembershipField = + (*env)->GetFieldID(env, userCls, "listMembership", "I"); + user_groupCreationQuotaField = + (*env)->GetFieldID(env, userCls, "groupCreationQuota", "I"); + user_groupMembershipCountField = + (*env)->GetFieldID(env, userCls, "groupMembershipCount", "I"); + user_ownerField = + (*env)->GetFieldID(env, userCls, "owner", "Ljava/lang/String;"); + user_creatorField = + (*env)->GetFieldID(env, userCls, "creator", "Ljava/lang/String;"); + // kas fields + user_adminSettingField = + (*env)->GetFieldID(env, userCls, "adminSetting", "I"); + user_tgsSettingField = + (*env)->GetFieldID(env, userCls, "tgsSetting", "I"); + user_encSettingField = + (*env)->GetFieldID(env, userCls, "encSetting", "I"); + user_cpwSettingField = + (*env)->GetFieldID(env, userCls, "cpwSetting", "I"); + user_rpwSettingField = + (*env)->GetFieldID(env, userCls, "rpwSetting", "I"); + user_userExpirationField = + (*env)->GetFieldID(env, userCls, "userExpiration", "I"); + user_lastModTimeField = + (*env)->GetFieldID(env, userCls, "lastModTime", "I"); + user_lastModNameField = + (*env)->GetFieldID(env, userCls, "lastModName", + "Ljava/lang/String;"); + user_lastChangePasswordTimeField = + (*env)->GetFieldID(env, userCls, "lastChangePasswordTime", "I"); + user_maxTicketLifetimeField = + (*env)->GetFieldID(env, userCls, "maxTicketLifetime", "I"); + user_keyVersionField = + (*env)->GetFieldID(env, userCls, "keyVersion", "I"); + user_encryptionKeyField = + (*env)->GetFieldID(env, userCls, "encryptionKey", + "Ljava/lang/String;"); + user_keyCheckSumField = + (*env)->GetFieldID(env, userCls, "keyCheckSum", "J"); + user_daysToPasswordExpireField = + (*env)->GetFieldID(env, userCls, "daysToPasswordExpire", "I"); + user_failLoginCountField = + (*env)->GetFieldID(env, userCls, "failLoginCount", "I"); + user_lockTimeField = + (*env)->GetFieldID(env, userCls, "lockTime", "I"); + user_lockedUntilField = + (*env)->GetFieldID(env, userCls, "lockedUntil", "I"); + if (!user_ptsField || !user_kasField || !user_nameField + || !user_cachedInfoField || !user_nameUidField + || !user_ownerUidField || !user_creatorUidField + || !user_listStatusField || !user_listGroupsOwnedField + || !user_listMembershipField || !user_groupCreationQuotaField + || !user_groupMembershipCountField || !user_ownerField + || !user_creatorField || !user_adminSettingField + || !user_tgsSettingField || !user_encSettingField + || !user_cpwSettingField || !user_rpwSettingField + || !user_userExpirationField || !user_lastModTimeField + || !user_lastModNameField || !user_lastChangePasswordTimeField + || !user_maxTicketLifetimeField || !user_keyVersionField + || !user_encryptionKeyField || !user_keyCheckSumField + || !user_daysToPasswordExpireField || !user_failLoginCountField + || !user_lockTimeField || !user_lockedUntilField) { + + throwAFSException(env, JAFSADMFIELDNOTFOUND); + return; + } + } +} + +/** + * Given a Java environment and an instance of a group, gets the object and + * field information for the group object from the Java environment. + */ +void +internal_getGroupClass(JNIEnv * env, jobject group) +{ + if (groupCls == 0) { + groupCls = + (*env)->NewGlobalRef(env, (*env)->GetObjectClass(env, group)); + if (!groupCls) { + throwAFSException(env, JAFSADMCLASSNOTFOUND); + return; + } + group_nameField = + (*env)->GetFieldID(env, groupCls, "name", "Ljava/lang/String;"); + group_cachedInfoField = + (*env)->GetFieldID(env, groupCls, "cachedInfo", "Z"); + group_nameUidField = + (*env)->GetFieldID(env, groupCls, "nameUID", "I"); + group_ownerUidField = + (*env)->GetFieldID(env, groupCls, "ownerUID", "I"); + group_creatorUidField = + (*env)->GetFieldID(env, groupCls, "creatorUID", "I"); + group_listStatusField = + (*env)->GetFieldID(env, groupCls, "listStatus", "I"); + group_listGroupsOwnedField = + (*env)->GetFieldID(env, groupCls, "listGroupsOwned", "I"); + group_listMembershipField = + (*env)->GetFieldID(env, groupCls, "listMembership", "I"); + group_listAddField = + (*env)->GetFieldID(env, groupCls, "listAdd", "I"); + group_listDeleteField = + (*env)->GetFieldID(env, groupCls, "listDelete", "I"); + group_membershipCountField = + (*env)->GetFieldID(env, groupCls, "membershipCount", "I"); + group_ownerField = + (*env)->GetFieldID(env, groupCls, "owner", "Ljava/lang/String;"); + group_creatorField = + (*env)->GetFieldID(env, groupCls, "creator", + "Ljava/lang/String;"); + if (!group_nameField || !group_cachedInfoField || !group_nameUidField + || !group_ownerUidField || !group_creatorUidField + || !group_listStatusField || !group_listGroupsOwnedField + || !group_listMembershipField || !group_listAddField + || !group_listDeleteField || !group_membershipCountField + || !group_ownerField || !group_creatorField) { + + throwAFSException(env, JAFSADMFIELDNOTFOUND); + return; + } + } +} + +/** + * Given a Java environment and an instance of a server, gets the object and + * field information for the server object from the Java environment. + */ +void +internal_getServerClass(JNIEnv * env, jobject server) +{ + if (serverCls == 0) { + serverCls = + (*env)->NewGlobalRef(env, (*env)->GetObjectClass(env, server)); + if (!serverCls) { + throwAFSException(env, JAFSADMCLASSNOTFOUND); + return; + } + server_nameField = + (*env)->GetFieldID(env, serverCls, "name", "Ljava/lang/String;"); + server_cachedInfoField = + (*env)->GetFieldID(env, serverCls, "cachedInfo", "Z"); + server_databaseField = + (*env)->GetFieldID(env, serverCls, "database", "Z"); + server_fileServerField = + (*env)->GetFieldID(env, serverCls, "fileServer", "Z"); + server_badDatabaseField = + (*env)->GetFieldID(env, serverCls, "badDatabase", "Z"); + server_badFileServerField = + (*env)->GetFieldID(env, serverCls, "badFileServer", "Z"); + server_IPAddressField = + (*env)->GetFieldID(env, serverCls, "ipAddresses", + "[Ljava/lang/String;"); + if (!server_nameField || !server_cachedInfoField + || !server_databaseField || !server_fileServerField + || !server_badDatabaseField || !server_badFileServerField + || !server_IPAddressField) { + + throwAFSException(env, JAFSADMFIELDNOTFOUND); + return; + + } + } +} + +/** + * Given a Java environment and an instance of an executableTime, gets the + * object and field information for the executableTime object from the + * Java environment. + */ +void +internal_getExecTimeClass(JNIEnv * env, jobject exectime) +{ + if (exectimeCls == 0) { + exectimeCls = + (*env)->NewGlobalRef(env, (*env)->GetObjectClass(env, exectime)); + if (!exectimeCls) { + throwAFSException(env, JAFSADMCLASSNOTFOUND); + return; + } + exectime_HourField = + (*env)->GetFieldID(env, exectimeCls, "hour", "S"); + exectime_MinField = + (*env)->GetFieldID(env, exectimeCls, "minute", "S"); + exectime_SecField = + (*env)->GetFieldID(env, exectimeCls, "second", "S"); + exectime_DayField = (*env)->GetFieldID(env, exectimeCls, "day", "S"); + exectime_NowField = (*env)->GetFieldID(env, exectimeCls, "now", "Z"); + exectime_NeverField = + (*env)->GetFieldID(env, exectimeCls, "never", "Z"); + if (!exectime_HourField || !exectime_MinField || !exectime_SecField + || !exectime_DayField || !exectime_NowField + || !exectime_NeverField) { + + throwAFSException(env, JAFSADMFIELDNOTFOUND); + return; + + } + } +} + +/** + * Given a Java environment and an instance of a partition, gets the object and + * field information for the partition object from the Java environment. + */ +void +internal_getPartitionClass(JNIEnv * env, jobject partition) +{ + if (partitionCls == 0) { + partitionCls = + (*env)->NewGlobalRef(env, (*env)->GetObjectClass(env, partition)); + if (!partitionCls) { + throwAFSException(env, JAFSADMCLASSNOTFOUND); + return; + } + partition_nameField = + (*env)->GetFieldID(env, partitionCls, "name", + "Ljava/lang/String;"); + partition_deviceNameField = + (*env)->GetFieldID(env, partitionCls, "deviceName", + "Ljava/lang/String;"); + partition_idField = (*env)->GetFieldID(env, partitionCls, "id", "I"); + partition_cachedInfoField = + (*env)->GetFieldID(env, partitionCls, "cachedInfo", "Z"); + partition_lockFileDescriptorField = + (*env)->GetFieldID(env, partitionCls, "lockFileDescriptor", "I"); + partition_totalSpaceField = + (*env)->GetFieldID(env, partitionCls, "totalSpace", "I"); + partition_totalFreeSpaceField = + (*env)->GetFieldID(env, partitionCls, "totalFreeSpace", "I"); + if (!partition_nameField || !partition_cachedInfoField + || !partition_idField || !partition_deviceNameField + || !partition_lockFileDescriptorField + || !partition_totalSpaceField || !partition_totalFreeSpaceField) { + + throwAFSException(env, JAFSADMFIELDNOTFOUND); + return; + + } + } +} + +/** + * Given a Java environment and an instance of a volume, gets the object and + * field information for the volume object from the Java environment. + */ +void +internal_getVolumeClass(JNIEnv * env, jobject volume) +{ + if (volumeCls == 0) { + volumeCls = + (*env)->NewGlobalRef(env, (*env)->GetObjectClass(env, volume)); + if (!volumeCls) { + throwAFSException(env, JAFSADMCLASSNOTFOUND); + return; + } + volume_nameField = + (*env)->GetFieldID(env, volumeCls, "name", "Ljava/lang/String;"); + volume_cachedInfoField = + (*env)->GetFieldID(env, volumeCls, "cachedInfo", "Z"); + volume_idField = (*env)->GetFieldID(env, volumeCls, "id", "I"); + volume_readWriteIdField = + (*env)->GetFieldID(env, volumeCls, "readWriteID", "I"); + volume_readOnlyIdField = + (*env)->GetFieldID(env, volumeCls, "readOnlyID", "I"); + volume_backupIdField = + (*env)->GetFieldID(env, volumeCls, "backupID", "I"); + volume_creationDateField = + (*env)->GetFieldID(env, volumeCls, "creationDate", "J"); + volume_lastAccessDateField = + (*env)->GetFieldID(env, volumeCls, "lastAccessDate", "J"); + volume_lastUpdateDateField = + (*env)->GetFieldID(env, volumeCls, "lastUpdateDate", "J"); + volume_lastBackupDateField = + (*env)->GetFieldID(env, volumeCls, "lastBackupDate", "J"); + volume_copyCreationDateField = + (*env)->GetFieldID(env, volumeCls, "copyCreationDate", "J"); + volume_accessesSinceMidnightField = + (*env)->GetFieldID(env, volumeCls, "accessesSinceMidnight", "I"); + volume_fileCountField = + (*env)->GetFieldID(env, volumeCls, "fileCount", "I"); + volume_maxQuotaField = + (*env)->GetFieldID(env, volumeCls, "maxQuota", "I"); + volume_currentSizeField = + (*env)->GetFieldID(env, volumeCls, "currentSize", "I"); + volume_statusField = + (*env)->GetFieldID(env, volumeCls, "status", "I"); + volume_dispositionField = + (*env)->GetFieldID(env, volumeCls, "disposition", "I"); + volume_typeField = (*env)->GetFieldID(env, volumeCls, "type", "I"); + if (!volume_nameField || !volume_cachedInfoField || !volume_idField + || !volume_readWriteIdField || !volume_readOnlyIdField + || !volume_backupIdField || !volume_creationDateField + || !volume_lastAccessDateField || !volume_lastUpdateDateField + || !volume_lastBackupDateField || !volume_copyCreationDateField + || !volume_accessesSinceMidnightField || !volume_fileCountField + || !volume_maxQuotaField || !volume_currentSizeField + || !volume_statusField || !volume_dispositionField + || !volume_typeField) { + + throwAFSException(env, JAFSADMFIELDNOTFOUND); + return; + + } + } +} + +/** + * Given a Java environment and an instance of a key, gets the object and + * field information for the key object from the Java environment. + */ +void +internal_getKeyClass(JNIEnv * env, jobject key) +{ + if (keyCls == 0) { + keyCls = (*env)->NewGlobalRef(env, (*env)->GetObjectClass(env, key)); + if (!keyCls) { + throwAFSException(env, JAFSADMCLASSNOTFOUND); + return; + } + key_encryptionKeyField = + (*env)->GetFieldID(env, keyCls, "encryptionKey", + "Ljava/lang/String;"); + key_cachedInfoField = + (*env)->GetFieldID(env, keyCls, "cachedInfo", "Z"); + key_versionField = (*env)->GetFieldID(env, keyCls, "version", "I"); + key_lastModDateField = + (*env)->GetFieldID(env, keyCls, "lastModDate", "I"); + key_lastModMsField = + (*env)->GetFieldID(env, keyCls, "lastModMs", "I"); + key_checkSumField = (*env)->GetFieldID(env, keyCls, "checkSum", "J"); + if (!key_cachedInfoField || !key_versionField + || !key_encryptionKeyField || !key_lastModDateField + || !key_lastModMsField || !key_checkSumField) { + + throwAFSException(env, JAFSADMFIELDNOTFOUND); + return; + + } + } +} + +/** + * Given a Java environment and an instance of a process, gets the object and + * field information for the process object from the Java environment. + */ +void +internal_getProcessClass(JNIEnv * env, jobject process) +{ + if (processCls == 0) { + processCls = + (*env)->NewGlobalRef(env, (*env)->GetObjectClass(env, process)); + if (!processCls) { + throwAFSException(env, JAFSADMCLASSNOTFOUND); + return; + } + process_cachedInfoField = + (*env)->GetFieldID(env, processCls, "cachedInfo", "Z"); + process_nameField = + (*env)->GetFieldID(env, processCls, "name", "Ljava/lang/String;"); + process_typeField = (*env)->GetFieldID(env, processCls, "type", "I"); + process_stateField = + (*env)->GetFieldID(env, processCls, "state", "I"); + process_goalField = (*env)->GetFieldID(env, processCls, "goal", "I"); + process_startTimeField = + (*env)->GetFieldID(env, processCls, "startTime", "J"); + process_numberStartsField = + (*env)->GetFieldID(env, processCls, "numberStarts", "J"); + process_exitTimeField = + (*env)->GetFieldID(env, processCls, "exitTime", "J"); + process_exitErrorTimeField = + (*env)->GetFieldID(env, processCls, "exitErrorTime", "J"); + process_errorCodeField = + (*env)->GetFieldID(env, processCls, "errorCode", "J"); + process_errorSignalField = + (*env)->GetFieldID(env, processCls, "errorSignal", "J"); + process_stateOkField = + (*env)->GetFieldID(env, processCls, "stateOk", "Z"); + process_stateTooManyErrorsField = + (*env)->GetFieldID(env, processCls, "stateTooManyErrors", "Z"); + process_stateBadFileAccessField = + (*env)->GetFieldID(env, processCls, "stateBadFileAccess", "Z"); + if (!process_cachedInfoField || !process_nameField + || !process_typeField || !process_stateField || !process_goalField + || !process_startTimeField || !process_numberStartsField + || !process_exitTimeField || !process_exitErrorTimeField + || !process_errorCodeField || !process_errorSignalField + || !process_stateOkField || !process_stateTooManyErrorsField + || !process_stateBadFileAccessField) { + + throwAFSException(env, JAFSADMFIELDNOTFOUND); + return; + + } + } +} + +#endif /* LIBJUAFS */ diff --git a/src/JAVA/libjafs/Internal.h b/src/JAVA/libjafs/Internal.h new file mode 100644 index 000000000..b08eea6cf --- /dev/null +++ b/src/JAVA/libjafs/Internal.h @@ -0,0 +1,80 @@ +#ifndef _Jafsadm_Internal +#define _Jafsadm_Internal + +#include +#include "Exceptions.h" + +/** + * ERROR CODES + * + * Please add any internal error codes to the ErrorMessages.properties + * file located in src/JAVA/classes/ + */ +#define JAFSADMNOMEM 1050 // Memory problems +#define JAFSADMCLASSNOTFOUND 1051 // Trouble finding a Java class +#define JAFSADMMETHODNOTFOUND 1052 // Trouble finding a Java method +#define JAFSADMFIELDNOTFOUND 1053 // Trouble finding a Java field +#define JAFSNULLARG 1054 // Null argument (general) +#define JAFSNULLUSER 1055 // User argument null +#define JAFSNULLPASS 1056 // Password argument null +#define JAFSNULLGROUP 1057 // Group name argument null +#define JAFSNULLOWNER 1058 // Group owner name argument null +#define JAFSNULLVOLUME 1059 // Volume name argument null +#define JAFSNULLPART 1060 // Partition name argument null +#define JAFSNULLPROCESS 1061 // Process name argument null +#define JAFSNULLSERVER 1062 // Server name argument null +#define JAFSNULLCELL 1063 // Cell name argument null +#define JAFSNULLPATH 1064 // Path argument null +#define JAFSNULLACL 1065 // ACL string argument null + +#ifndef LIBJUAFS +#include +#include + +// make an identity out of a full name (possibly including an instance ) +void internal_makeKasIdentity(const char *fullName, kas_identity_p who); + +void internal_getUserClass(JNIEnv * env, jobject user); +void internal_getGroupClass(JNIEnv * env, jobject group); +void internal_getServerClass(JNIEnv * env, jobject server); +void internal_getPartitionClass(JNIEnv * env, jobject partition); +void internal_getVolumeClass(JNIEnv * env, jobject volume); +void internal_getKeyClass(JNIEnv * env, jobject key); +void internal_getProcessClass(JNIEnv * env, jobject process); +#else +int openAFSFile(JNIEnv * env, jstring fileNameUTF, int flags, int mode, + int *err); +int readCacheParms(char *afsMountPoint, char *afsConfDir, char *afsCacheDir, + int *cacheBlocks, int *cacheFiles, int *cacheStatEntries, + int *dCacheSize, int *vCacheSize, int *chunkSize, + int *closeSynch, int *debug, int *nDaemons, + int *cacheFlags, char *logFile); +#endif /* !LIBJUAFS */ + +// throw a non-AFS exception with a message +void throwMessageException(JNIEnv * env, char *msg); + +// throw an AFS exception with a message +void throwAFSException(JNIEnv * env, int code); + +// throw an AFS Admin exception with a message +void throwAFSException(JNIEnv * env, int code); + +// throw an AFS File or I/O related exception with a message +void throwFileAdminException(JNIEnv * env, int code, char *msg); + +// throw an AFS Security exception with a message +void throwAFSSecurityException(JNIEnv * env, int code); + +// throw an exception with an error code +void throwException(JNIEnv * env, jclass * excCls, char *excClsName, + jmethodID * initID, int code); + +// reclaim global memory used by exceptions +void reclaimExceptionMemory(JNIEnv * env, jclass cls); + +int setError(JNIEnv * env, jobject * obj, int code); +int setString(JNIEnv * env, jobject * obj, char *field, char *string); +char *getNativeString(JNIEnv * env, jstring jstr); + +#endif diff --git a/src/JAVA/libjafs/JAFS_README b/src/JAVA/libjafs/JAFS_README new file mode 100644 index 000000000..3939201bc --- /dev/null +++ b/src/JAVA/libjafs/JAFS_README @@ -0,0 +1,123 @@ +Java API for OpenAFS (Jafs) README +Current as of 6/5/02 + + ########################################################################## + # Copyright (c) 2001-2002 International Business Machines Corp. # + # All rights reserved. # + # # + # This software has been released under the terms of the IBM Public # + # License. For details, see the LICENSE file in the top-level source # + # directory or online at http://www.openafs.org/dl/license10.html # + # # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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. # + ########################################################################## + +*** INTRODUCTION *** + +Jafs is an open source API designed to allow Java programmers the ability +to create applications for the administration or use of OpenAFS file systems. +It works by accessing libadmin and libuafs (administrative and user-level +libraries that come with OpenAFS) through JNI. It consists of a Java package +called org.openafs.jafs, and a shared libraries libjafsadm.so and libjafs.so. + +*** USE *** + +There is a version of Jafs that has been compiled on Red Hat Linux 7.1, +and can be directly used without compilation. It was compiled using +OpenAFS 1.2.4 libraries (with a modified version of libjuafs.a). It +consists of a JAR file (jafs.jar) and two shared libraries +(libjafsadm.so and libjafs.so). It was compiled using the +--enable-transarc-paths on compilation (for use with the OpenAFS RPMs), +gcc 2.96, and Java Classic VM version 1.4.0. + +When you write Java code to use this API, import the +org.openafs.jafs package. During compilation of your Java code, +ensure one of the following conditions are met: + - Use the "-classpath" option to javac to specify the jafs.jar file. + - Change your $CLASSPATH environment variable to include the + jafs.jar file (e.g. export CLASSPATH=$CLASSPATH:jafs.jar + +When running an application that uses Jafs, the shared libraries +need to be found by Java's library loader. The easiest way to +accomplish this is to copy these files into the /usr/lib/ directory, +or create symbolic links from that directory to the files. Alternatively, +the directory containing the libraries can also be added to the +LD_LIBRARY_PATH environment variable, instead. + +You also need to have an OpenAFS client set up on your machine +(preferably version 1.2.4, but it should work for some past versions as well). +You can obtain the OpenAFS client and view installation documentation at +http://www.openafs.org (the RPMs are easiest to use for Linux). Also any +cells you plan to access through the API must have entries in your +client's CellServDB file (located in the /usr/vice/etc/ directory in most +setups). + +This API is most effective when used with a cell that uses the kaserver +for authentication. It does not currently support alternative methods of +authentication such as Kerberos V. + +If you have successfully set up your Linux 7.1 environment as described +above, you will be able to develop and execute applications that use +the Jafs API. + +*** BUILD *** + +The first step in compiling your own versions of the library and jar file +is to download the OpenAFS source code. If the code doesn't contain the +libjuafs version of the libuafs library -- noted by the README file located +in the src/libuafs directory (if a README file doesn't exist in this directory +then the libjuafs patch (libuafs.diff) has not been applied) -- you must +first apply the libjuafs patch. You can apply the libjuafs patch with the +following command, executed from the root directory of the download code +(i.e. openafs-1.2.4/): + + patch -p1 < libuafs.diff + +Next, if the code doesn't contain the src/JAVA/libjafs directory, you can +apply the jafs patch to it with the following command, executed from the +root directory of the download code (i.e. openafs-1.2.4/): + + patch -p1 < jafs.diff + +Note that the source code you download needs to be newer than 4/22/02, +in order for the full functionality of the API to be effective. Otherwise, +you may experience link errors. + +From that same directory, run the configure script as you normally would +to compile OpenAFS, but run it with a java_home argument so the script can +find your java distribution. For example: + + ./configure [other options] --java_home=/usr/local/jdk + +The configure script will ensure that this directory contains bin/ and lib/ +subdirectories, and that there are /bin/javac and/bin/javah executables and +an include/jni.h file. If you don't supply a command line argument for the +java home, the script will look for it in environment variables: first in +$JAVA_HOME and then in $JDK_HOME. Also, note that if you have installed +(or are planning to install) OpenAFS by using the RPMs for Linux, you +should provide the --enable-transarc-paths configuration option. If you +get a "** Can't determine local cell name" error message, the most likely +reason is that you didn't supply this option. + +Next, do a full build of OpenAFS by executing a make in the current +directory. After it finishes, you are ready to compile Jafs. Execute +'make jafs' from that same directory. Afterward, there will be +libjafsadm.so and libjafs.so in the lib/ directory, and a jafs.jar in the +jlib/ directory. These can be used according to the instructions in the +'USE' section of this document. + +If you'd like to edit the source code, you'll find the native C code in +the src/libjafs directory, and the Java code in the +src/JAVA/org/openafs/jafs/ directory. Please reference the +src/TechNotes-JavaAPI document for more information. + diff --git a/src/JAVA/libjafs/Key.c b/src/JAVA/libjafs/Key.c new file mode 100644 index 000000000..acde7bcc0 --- /dev/null +++ b/src/JAVA/libjafs/Key.c @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 "Internal.h" +#include "org_openafs_jafs_Key.h" + +#include +#include +#include + +//// definitions in Internal.c ////////////////// +extern jclass keyCls; +extern jfieldID key_versionField; +extern jfieldID key_encryptionKeyField; +extern jfieldID key_lastModDateField; +extern jfieldID key_lastModMsField; +extern jfieldID key_checkSumField; + +////////////////////////////////////////////////////////////////// + +/** + * Extract the information from the given key entry and populate the + * given object + * + * env the Java environment + * key the Key object to populate with the info + * keyEntry the container of the key's information + */ +void +fillKeyInfo(JNIEnv * env, jobject key, bos_KeyInfo_t keyEntry) +{ + jstring jencryptionKey; + char *convertedKey; + int i; + + // get the class fields if need be + if (keyCls == 0) { + internal_getKeyClass(env, key); + } + // set all the fields + (*env)->SetIntField(env, key, key_versionField, + keyEntry.keyVersionNumber); + + convertedKey = + (char *)malloc(sizeof(char *) * (sizeof(keyEntry.key.key) * 4 + 1)); + if (!convertedKey) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + for (i = 0; i < sizeof(keyEntry.key.key); i++) { + sprintf(&(convertedKey[i * 4]), "\\%0.3o", keyEntry.key.key[i]); + } + jencryptionKey = (*env)->NewStringUTF(env, convertedKey); + (*env)->SetObjectField(env, key, key_encryptionKeyField, jencryptionKey); + + (*env)->SetIntField(env, key, key_lastModDateField, + keyEntry.keyStatus.lastModificationDate); + (*env)->SetIntField(env, key, key_lastModMsField, + keyEntry.keyStatus.lastModificationMicroSeconds); + (*env)->SetLongField(env, key, key_checkSumField, + (unsigned int)keyEntry.keyStatus.checkSum); + + free(convertedKey); +} + +/** + * Fills in the information fields of the provided Key. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the key + * belongs + * version the version of the key for which to get the information + * key the Key object in which to fill in the + * information + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Key_getKeyInfo(JNIEnv * env, jclass cls, + jint serverHandle, jint version, + jobject key) +{ + afs_status_t ast; + bos_KeyInfo_t keyEntry; + void *iterationId; + int done; + + if (!bos_KeyGetBegin((void *)serverHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return; + } + + done = FALSE; + + // there's no KeyGet function, so we must iterate and find the + // one with the matching version + while (!done) { + + if (!bos_KeyGetNext(iterationId, &keyEntry, &ast)) { + // no matching key + if (ast == ADMITERATORDONE) { + afs_status_t astnew; + if (!bos_KeyGetDone(iterationId, &astnew)) { + throwAFSException(env, astnew); + return; + } + throwAFSException(env, KAUNKNOWNKEY); + return; + // other + } else { + throwAFSException(env, ast); + return; + } + } + + if (keyEntry.keyVersionNumber == version) { + done = TRUE; + } + + } + + fillKeyInfo(env, key, keyEntry); + + if (!bos_KeyGetDone(iterationId, &ast)) { + throwAFSException(env, ast); + return; + } + +} + +/** + * Create a server key. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the server belongs + * serverHandle the bos handle of the server to which the key will + * belong + * versionNumber the version number of the key to create (0 to 255) + * jkeyString the String version of the key that will + * be encrypted + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Key_create(JNIEnv * env, jclass cls, jint cellHandle, + jint serverHandle, jint version, + jstring jkeyString) +{ + afs_status_t ast; + char *keyString; + char *cellName; + kas_encryptionKey_p key = + (kas_encryptionKey_p) malloc(sizeof(kas_encryptionKey_t)); + + if (!key) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (jkeyString != NULL) { + keyString = getNativeString(env, jkeyString); + if (keyString == NULL) { + free(key); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + keyString = NULL; + } + + if (!afsclient_CellNameGet((void *)cellHandle, &cellName, &ast)) { + free(key); + if (keyString != NULL) + free(keyString); + throwAFSException(env, ast); + return; + } + + if (!kas_StringToKey(cellName, keyString, key, &ast)) { + free(key); + if (keyString != NULL) + free(keyString); + throwAFSException(env, ast); + return; + } + + if (!bos_KeyCreate((void *)serverHandle, version, key, &ast)) { + free(key); + if (keyString != NULL) + free(keyString); + throwAFSException(env, ast); + return; + } + + free(key); + if (keyString != NULL) + free(keyString); +} + +/** + * Delete a server key. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the key belongs + * versionNumber the version number of the key to remove (0 to 255) + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Key_delete(JNIEnv * env, jclass cls, jint serverHandle, + jint version) +{ + afs_status_t ast; + + if (!bos_KeyDelete((void *)serverHandle, version, &ast)) { + throwAFSException(env, ast); + return; + } +} + +// reclaim global memory being used by this portion +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Key_reclaimKeyMemory(JNIEnv * env, jclass cls) +{ + if (keyCls) { + (*env)->DeleteGlobalRef(env, keyCls); + keyCls = 0; + } +} diff --git a/src/JAVA/libjafs/Makefile.in b/src/JAVA/libjafs/Makefile.in new file mode 100644 index 000000000..0ae417ce1 --- /dev/null +++ b/src/JAVA/libjafs/Makefile.in @@ -0,0 +1,279 @@ +# Copyright 2000, International Business Machines Corporation and others. +# All Rights Reserved. +# +# This software has been released under the terms of the IBM Public +# License. For details, see the LICENSE file in the top-level source +# directory or online at http://www.openafs.org/dl/license10.html + +DEST=@DEST@ +TOP_SRCDIR=@TOP_SRCDIR@ +TOP_INCDIR=@TOP_INCDIR@ +TOP_LIBDIR=@TOP_LIBDIR@ +TOP_JLIBDIR=@TOP_JLIBDIR@ +JAVA_HOME=@JAVA_HOME@ +JNI_INC=@JNI_INC@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +sbindir=@sbindir@ +libexecdir=@libexecdir@ +libdir=@libdir@ +includedir=@includedir@ +mandir=@mandir@ +afssrvbindir=@afssrvbindir@ +afssrvsbindir=@afssrvsbindir@ +afssrvlibexecdir=@afssrvlibexecdir@ +COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et +RXGEN=${TOP_SRCDIR}/rxgen/rxgen +SYS_NAME=@AFS_SYSNAME@ + +include ../../config/Makefile.${SYS_NAME} + +CC = ${MT_CC} +SHARED_FLAGS = -shared +OBJECT_FLAGS = -fPIC -c + +ifeq "$(BUILD_TYPE)" "admin" + INC := -I${TOP_INCDIR} -I${TOP_INCDIR}/afs/ ${JNI_INC} + CFLAGS := ${INC} ${DBG} ${OPTMZ} -I${TOP_SRCDIR}/config ${MT_CFLAGS} +else + INC := -I${TOP_SRCDIR}/libuafs -I${TOP_INCDIR} -I${TOP_SRCDIR} ${JNI_INC} + CFLAGS := ${INC} ${DBG} ${OPTMZ} ${FSINCLUDES} -D_REENTRANT -DLIBJUAFS ${MT_CFLAGS} +endif + +ifeq "$(INCREMENT_BUILD)" "false" + INCREMENT_CMD := +else + INCREMENT_CMD := ${RM} -f ${LIBJAFSADMDIR}VersionInfo.o; perl buildinfo.pl ${LIBJAFSADMDIR}VersionInfo.h -i; +endif + +LIBJAFSADMDIR = ./ +ROOTPACKAGEDIR = ../classes +RELPACKAGEDIR = org/openafs/jafs/ +PACKAGEDIR = ${ROOTPACKAGEDIR}/${RELPACKAGEDIR} +JAVADOCSDIR = ../javadocs/ +BUILD_VERSION = `perl buildinfo.pl ${LIBJAFSADMDIR}VersionInfo.h -version` + +JAVAH = ${JAVA_HOME}/bin/javah -classpath ${ROOTPACKAGEDIR} -jni -d ${LIBJAFSADMDIR} +JAVAC = ${JAVA_HOME}/bin/javac -classpath ${ROOTPACKAGEDIR} +JAVADOC = ${JAVA_HOME}/bin/javadoc + +J_NATIVE_PREFIX = org.openafs.jafs. +C_NATIVE_PREFIX = org_openafs_jafs_ + +PACKAGE =\ + ${PACKAGEDIR}ACL.class \ + ${PACKAGEDIR}AFSException.class \ + ${PACKAGEDIR}AFSFileException.class \ + ${PACKAGEDIR}AFSSecurityException.class \ + ${PACKAGEDIR}Cell.class \ + ${PACKAGEDIR}File.class \ + ${PACKAGEDIR}FileInputStream.class \ + ${PACKAGEDIR}FileOutputStream.class \ + ${PACKAGEDIR}Group.class \ + ${PACKAGEDIR}Key.class \ + ${PACKAGEDIR}Partition.class \ + ${PACKAGEDIR}Process.class \ + ${PACKAGEDIR}Server.class \ + ${PACKAGEDIR}Token.class \ + ${PACKAGEDIR}User.class \ + ${PACKAGEDIR}VersionInfo.class \ + ${PACKAGEDIR}Volume.class + +LIBJAFS_OBJS =\ + ${LIBJAFSADMDIR}ACL.o \ + ${LIBJAFSADMDIR}File.o \ + ${LIBJAFSADMDIR}FileInputStream.o \ + ${LIBJAFSADMDIR}FileOutputStream.o \ + ${LIBJAFSADMDIR}Internal.o \ + ${LIBJAFSADMDIR}UserToken.o \ + ${LIBJAFSADMDIR}VersionInfo.o + +LIBJAFSADM_OBJS =\ + ${LIBJAFSADMDIR}AdminToken.o \ + ${LIBJAFSADMDIR}Cell.o \ + ${LIBJAFSADMDIR}Group.o \ + ${LIBJAFSADMDIR}Internal.o \ + ${LIBJAFSADMDIR}Key.o \ + ${LIBJAFSADMDIR}Partition.o \ + ${LIBJAFSADMDIR}Process.o \ + ${LIBJAFSADMDIR}Server.o \ + ${LIBJAFSADMDIR}User.o \ + ${LIBJAFSADMDIR}VersionInfo.o \ + ${LIBJAFSADMDIR}Volume.o + +CORRELATING_SOURCE_FILES =\ + ${LIBJAFSADMDIR}ACL.c \ + ${LIBJAFSADMDIR}Cell.c \ + ${LIBJAFSADMDIR}File.c \ + ${LIBJAFSADMDIR}FileInputStream.c \ + ${LIBJAFSADMDIR}FileOutputStream.c \ + ${LIBJAFSADMDIR}Group.c \ + ${LIBJAFSADMDIR}Key.c \ + ${LIBJAFSADMDIR}Partition.c \ + ${LIBJAFSADMDIR}Process.c \ + ${LIBJAFSADMDIR}Server.c \ + ${LIBJAFSADMDIR}User.c \ + ${LIBJAFSADMDIR}VersionInfo.c \ + ${LIBJAFSADMDIR}Volume.c + +JAVA_HEADERS = ${PACKAGE:${PACKAGEDIR}%.class=${C_NATIVE_PREFIX}%.h} + +BOSADMINLIB = ${TOP_LIBDIR}/libbosadmin.a +VOSADMINLIB = ${TOP_LIBDIR}/libvosadmin.a +PTSADMINLIB = ${TOP_LIBDIR}/libptsadmin.a +KASADMINLIB = ${TOP_LIBDIR}/libkasadmin.a +CFGADMINLIB = ${TOP_LIBDIR}/libcfgadmin.a +UTILADMINLIB = ${TOP_LIBDIR}/libafsadminutil.a +CLIENTADMINLIB = ${TOP_LIBDIR}/libclientadmin.a + +LIBJAFS_LIBS =\ + ${TOP_LIBDIR}/libjuafs.a \ + ${TOP_LIBDIR}/libdes.a \ + -lresolv \ + -lpthread + +LIBJAFSADM_LIBS =\ + ${CLIENTADMINLIB} \ + ${VOSADMINLIB} \ + ${BOSADMINLIB} \ + ${PTSADMINLIB} \ + ${KASADMINLIB} \ + ${CFGADMINLIB} \ + ${UTILADMINLIB} \ + ${TOP_LIBDIR}/libafsauthent.a \ + ${TOP_LIBDIR}/libafsrpc.a \ + ${TOP_LIBDIR}/libcmd.a \ + ${TOP_LIBDIR}/util.a \ + -lresolv \ + -lpthread + + +JARFILE = jafs.jar + +all: ${TOP_JLIBDIR} libjafs libjafsadm ${PACKAGE} jar + +install: all ${DESTDIR}${libdir}/libjafs.so ${DESTDIR}${libdir}/libjafsadm.so ${PACKAGE} install_jar + if [ ! -e /usr/afswsp ]; then \ + mkdir -p /usr/afswsp/; \ + fi; \ + if [ ! -e /usr/afswsp/etc ]; then \ + mkdir -p /usr/afswsp/etc/; \ + cp ./etc/CacheConfig /usr/afswsp/etc/; \ + fi; \ + if [ ! -e /usr/afswsp/log ]; then \ + mkdir -p /usr/afswsp/log/; \ + fi; \ + if [ ! -e /usr/afswsp/cache ]; then \ + mkdir -p /usr/afswsp/cache/; \ + fi; \ + if [ ! -L /usr/vice/etc/CellServDB ]; then \ + ln -s /usr/vice/etc/CellServDB /usr/afswsp/etc/; \ + fi; \ + if [ ! -L /usr/vice/etc/ThisCell ]; then \ + ln -s /usr/vice/etc/ThisCell /usr/afswsp/etc/; \ + fi + +### Clean "C" and Java objects +clean: + ${RM} -f ${PACKAGEDIR}*.class ${LIBJAFSADMDIR}*.o ${LIBJAFSADMDIR}${C_NATIVE_PREFIX}*.h ${LIBJAFSADMDIR}acltest + ${RM} -fR ${JAVADOCSDIR} + +### Clean just "C" objects +cleanc: + ${RM} -f ${LIBJAFSADMDIR}*.o ${LIBJAFSADMDIR}acltest + +increment-build: + ${INCREMENT_CMD} \ + export INCREMENT_BUILD=false; + +setup: FORCE + +${TOP_JLIBDIR}: + mkdir -p $@ + +FORCE: ; + +############# Test program ############################### + +acltest: ${LIBJAFSADMDIR}/acltest.c + ${CC} ${CFLAGS} -o $@ $^ ${LIBJAFS_LIBS} + +############# Shared library ############################### + +libjafs: setup increment-build + ${RM} -f ${LIBJAFSADMDIR}Internal.o; \ + export BUILD_TYPE=user; \ + ${MAKE} ${TOP_LIBDIR}/libjafs.so + +libjafsadm: increment-build + ${RM} -f ${LIBJAFSADMDIR}Internal.o; \ + export BUILD_TYPE=admin; \ + ${MAKE} ${TOP_LIBDIR}/libjafsadm.so + +${TOP_LIBDIR}/libjafs.so: ${LIBJAFS_OBJS} + ${CC} ${CFLAGS} ${SHARED_FLAGS} -o $@ $^ ${LIBJAFS_LIBS} + +${DESTDIR}${libdir}/libjafs.so: ${LIBJAFS_OBJS} + ${CC} ${CFLAGS} ${SHARED_FLAGS} -o $@ $^ ${LIBJAFS_LIBS} + +${TOP_LIBDIR}/libjafsadm.so: ${LIBJAFSADM_OBJS} + ${CC} ${CFLAGS} ${SHARED_FLAGS} -o $@ $^ ${LIBJAFSADM_LIBS} + +${DESTDIR}${libdir}/libjafsadm.so: ${LIBJAFSADM_OBJS} + ${CC} ${CFLAGS} ${SHARED_FLAGS} -o $@ $^ ${LIBJAFSADM_LIBS} + +############## Object files ################################ + +${LIBJAFSADM_OBJS}: %.o: %.c + ${CC} ${CFLAGS} ${OBJECT_FLAGS} -o $@ $< + +############## C files ##################################### + +${CORRELATING_SOURCE_FILES}: ${LIBJAFSADMDIR}%.c: ${LIBJAFSADMDIR}${C_NATIVE_PREFIX}%.h ${LIBJAFSADMDIR}Internal.h ${LIBJAFSADMDIR}VersionInfo.h + +${LIBJAFSADMDIR}AdminToken.c: ${LIBJAFSADMDIR}${C_NATIVE_PREFIX}Token.h ${LIBJAFSADMDIR}${C_NATIVE_PREFIX}Cell.h + +${LIBJAFSADMDIR}Internal.c: ${LIBJAFSADMDIR}Internal.h + +${LIBJAFSADMDIR}UserToken.c: ${LIBJAFSADMDIR}${C_NATIVE_PREFIX}Token.h + +${LIBJAFSADMDIR}VersionInfo.c: ${LIBJAFSADMDIR}VersionInfo.h ${LIBJAFSADMDIR}${C_NATIVE_PREFIX}VersionInfo.h + +############## Package javac section ######################### + +${PACKAGEDIR}%.class: ${PACKAGEDIR}%.java + ${JAVAC} $< + +############## Javah section ############################### + +${JAVA_HEADERS}: ${C_NATIVE_PREFIX}%.h: ${PACKAGEDIR}%.class + ${JAVAH} ${J_NATIVE_PREFIX}$* + +############## Javadoc section ############################### + +javadocs: + echo "Preparing Javadoc API documentation..." + ${JAVADOC} -version -breakiterator \ + -link http://java.sun.com/j2se/1.4/docs/api/ \ + -windowtitle "Java AFS API" -header "JAFS API v${BUILD_VERSION}" \ + -doctitle "JAFS API v${BUILD_VERSION}" \ + -use -d ${JAVADOCSDIR} \ + -sourcepath ${ROOTPACKAGEDIR} \ + -classpath ${ROOTPACKAGEDIR} \ + -package org.openafs.jafs + +############# JAR file ##################################### + +jar: clean_jar + cd ${ROOTPACKAGEDIR}; ${JAVA_HOME}/bin/jar -cMf ${TOP_JLIBDIR}/${JARFILE} *.properties ${RELPACKAGEDIR}*.class + +install_jar: clean_jar + cd ${ROOTPACKAGEDIR}; ${JAVA_HOME}/bin/jar -cMf ${JAVA_HOME}/lib/${JARFILE} *.properties ${RELPACKAGEDIR}*.class + +clean_jar: + ${RM} -f ${TOP_JLIBDIR}/${JARFILE} + +clean_libs: + ${RM} -f ${TOP_LIBDIR}/libjafs.so ${TOP_LIBDIR}/libjafsadm.so + diff --git a/src/JAVA/libjafs/Partition.c b/src/JAVA/libjafs/Partition.c new file mode 100644 index 000000000..20823fca8 --- /dev/null +++ b/src/JAVA/libjafs/Partition.c @@ -0,0 +1,469 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 "Internal.h" +#include "org_openafs_jafs_Partition.h" + +#include +#include + +//// definitions in Internal.c ////////////////// + +extern jclass partitionCls; +extern jfieldID partition_nameField; +extern jfieldID partition_idField; +extern jfieldID partition_deviceNameField; +extern jfieldID partition_lockFileDescriptorField; +extern jfieldID partition_totalSpaceField; +extern jfieldID partition_totalFreeSpaceField; + +extern jclass volumeCls; +extern jfieldID volume_cachedInfoField; + +////////////////////////////////////////////////////////// + +///// Definition in jafs_Volume.c ///////////////// + +extern void fillVolumeInfo(JNIEnv * env, jobject volume, + vos_volumeEntry_t volEntry); + +/////////////////////////////////////////////////// + + +/** + * Extract the information from the given partition entry and populate the + * given object + * + * env the Java environment + * partition the Partition object to populate with the info + * partEntry the container of the partition's information + */ +void +fillPartitionInfo(JNIEnv * env, jobject partition, + vos_partitionEntry_t partEntry) +{ + jstring jdeviceName; + jstring jpartition; + jint id; + afs_status_t ast; + + // get the class fields if need be + if (partitionCls == 0) { + internal_getPartitionClass(env, partition); + } + // fill name and id in case it's a blank object + jpartition = (*env)->NewStringUTF(env, partEntry.name); + // get the id + if (!vos_PartitionNameToId(partEntry.name, (int *)&id, &ast)) { + throwAFSException(env, ast); + return; + } + (*env)->SetObjectField(env, partition, partition_nameField, jpartition); + (*env)->SetIntField(env, partition, partition_idField, id); + + jdeviceName = (*env)->NewStringUTF(env, partEntry.deviceName); + (*env)->SetObjectField(env, partition, partition_deviceNameField, + jdeviceName); + + (*env)->SetIntField(env, partition, partition_lockFileDescriptorField, + partEntry.lockFileDescriptor); + (*env)->SetIntField(env, partition, partition_totalSpaceField, + partEntry.totalSpace); + (*env)->SetIntField(env, partition, partition_totalFreeSpaceField, + partEntry.totalFreeSpace); + +} + +/** + * Fills in the information fields of the provided Partition. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the partition belongs + * serverHandle the vos handle of the server on which the + * partition resides + * partition the numeric id of the partition for which to get the + * info + * jpartitionObject the Partition object in which to + * fill in the information + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Partition_getPartitionInfo(JNIEnv * env, jclass cls, + jint cellHandle, + jint serverHandle, + jint partition, + jobject jpartitionObject) +{ + afs_status_t ast; + vos_partitionEntry_t partEntry; + + // get the partition entry + if (!vos_PartitionGet + ((void *)cellHandle, (void *)serverHandle, NULL, + (unsigned int)partition, &partEntry, &ast)) { + throwAFSException(env, ast); + return; + } + + fillPartitionInfo(env, jpartitionObject, partEntry); + +} + +/** + * Translates a partition name into a partition id + * + * env the Java environment + * cls the current Java class + * jname the name of the partition in question + * returns the id of the partition in question + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Partition_translateNameToID(JNIEnv * env, jclass cls, + jstring jname) +{ + afs_status_t ast; + jint id; + char *name; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (name == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return -1; + } + } else { + throwAFSException(env, JAFSNULLPART); + return -1; + } + + // get the id + if (!vos_PartitionNameToId(name, (unsigned int *)&id, &ast)) { + id = -1; + throwAFSException(env, ast); + } + + free(name); + + return id; +} + +/** + * Translates a partition id into a partition name + * + * env the Java environment + * cls the current Java class + * id the id of the partition in question + * returns the name of the partition in question + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_Partition_translateIDToName(JNIEnv * env, jclass cls, + jint id) +{ + afs_status_t ast; + char *name = (char *)malloc(sizeof(char) * VOS_MAX_PARTITION_NAME_LEN); + jstring jname = NULL; + + if (name == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return NULL; + } + // get the name + if (vos_PartitionIdToName((unsigned int)id, name, &ast)) { + jname = (*env)->NewStringUTF(env, name); + } else { + throwAFSException(env, ast); + } + free(name); + + return jname; +} + +/** + * Returns the total number of volumes hosted by this partition. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the partition belongs + * serverHandle the vos handle of the server to which the partition + * belongs + * partition the numeric id of the partition on which the volumes + * reside + * returns total number of volumes hosted by this partition + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Partition_getVolumeCount(JNIEnv * env, jclass cls, + jint cellHandle, + jint serverHandle, + jint partition) +{ + afs_status_t ast; + void *iterationId; + vos_volumeEntry_t volEntry; + int i = 0; + + if (!vos_VolumeGetBegin + ((void *)cellHandle, (void *)serverHandle, NULL, + (unsigned int)partition, &iterationId, &ast)) { + throwAFSException(env, ast); + return -1; + } + + while (vos_VolumeGetNext((void *)iterationId, &volEntry, &ast)) + i++; + + if (ast != ADMITERATORDONE) { + throwAFSException(env, ast); + return -1; + } + + return i; +} + +/** + * Begin the process of getting the volumes on a partition. Returns + * an iteration ID to be used by subsequent calls to + * getVolumesNext and getVolumesDone. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the partition belongs + * serverHandle the vos handle of the server to which the partition + * belongs + * partition the numeric id of the partition on which the volumes + * reside + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Partition_getVolumesBegin(JNIEnv * env, jclass cls, + jint cellHandle, + jint serverHandle, + jint partition) +{ + + afs_status_t ast; + void *iterationId; + + if (!vos_VolumeGetBegin + ((void *)cellHandle, (void *)serverHandle, NULL, + (unsigned int)partition, &iterationId, &ast)) { + throwAFSException(env, ast); + return -1; + } + + return (jint) iterationId; +} + +/** + * Begin the process of getting the volumes on a partition. Returns + * an iteration ID to be used by subsequent calls to + * getVolumesNext and getVolumesDone. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the partition belongs + * serverHandle the vos handle of the server to which the partition + * belongs + * partition the numeric id of the partition on which the volumes + * reside + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Partition_getVolumesBeginAt(JNIEnv * env, jclass cls, + jint cellHandle, + jint serverHandle, + jint partition, jint index) +{ + + afs_status_t ast; + void *iterationId; + vos_volumeEntry_t volEntry; + int i; + + if (!vos_VolumeGetBegin + ((void *)cellHandle, (void *)serverHandle, NULL, + (unsigned int)partition, &iterationId, &ast)) { + throwAFSException(env, ast); + return -1; + } + + for (i = 1; i < index; i++) { + if (!vos_VolumeGetNext((void *)iterationId, &volEntry, &ast)) { + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + } + + return (jint) iterationId; + +} + +/** + * Returns the next volume of the partition. Returns null + * if there are no more volumes. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * returns the name of the next volume of the server + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_Partition_getVolumesNextString(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + jstring jvolume; + vos_volumeEntry_t volEntry; + + if (!vos_VolumeGetNext((void *)iterationId, &volEntry, &ast)) { + if (ast == ADMITERATORDONE) { + return NULL; + } else { + throwAFSException(env, ast); + return NULL; + } + } + + jvolume = (*env)->NewStringUTF(env, volEntry.name); + return jvolume; + +} + +/** + * Fills the next volume object of the partition. Returns 0 if there + * are no more volumes, != 0 otherwise. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * jvolumeObject the Volume object in which to fill the values + * of the next volume + * returns 0 if there are no more volumes, != 0 otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Partition_getVolumesNext(JNIEnv * env, jclass cls, + jint iterationId, + jobject jvolumeObject) +{ + afs_status_t ast; + jstring jvolume; + vos_volumeEntry_t volEntry; + + if (!vos_VolumeGetNext((void *)iterationId, &volEntry, &ast)) { + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + + + fillVolumeInfo(env, jvolumeObject, volEntry); + + // get the class fields if need be + if (volumeCls == 0) { + internal_getVolumeClass(env, jvolumeObject); + } + (*env)->SetBooleanField(env, jvolumeObject, volume_cachedInfoField, TRUE); + + return 1; + +} + +/** + * Fills the next volume object of the partition. Returns 0 if there + * are no more volumes, != 0 otherwise. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * jvolumeObject the Volume object in which to fill the values of the + * next volume + * advanceCount the number of volumes to advance past + * returns 0 if there are no more volumes, != 0 otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Partition_getVolumesAdvanceTo(JNIEnv * env, jclass cls, + jint iterationId, + jobject jvolumeObject, + jint advanceCount) +{ + afs_status_t ast; + jstring jvolume; + vos_volumeEntry_t volEntry; + int i; + + for (i = 0; i < advanceCount; i++) { + if (!vos_VolumeGetNext((void *)iterationId, &volEntry, &ast)) { + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + } + + + fillVolumeInfo(env, jvolumeObject, volEntry); + + // get the class fields if need be + if (volumeCls == 0) { + internal_getVolumeClass(env, jvolumeObject); + } + (*env)->SetBooleanField(env, jvolumeObject, volume_cachedInfoField, TRUE); + + return 1; +} + +/** + * Signals that the iteration is complete and will not be accessed anymore. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Partition_getVolumesDone(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + + if (!vos_VolumeGetDone((void *)iterationId, &ast)) { + throwAFSException(env, ast); + return; + } +} + +// reclaim global memory being used by this portion +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Partition_reclaimPartitionMemory(JNIEnv * env, + jclass cls) +{ + if (partitionCls) { + (*env)->DeleteGlobalRef(env, partitionCls); + partitionCls = 0; + } +} diff --git a/src/JAVA/libjafs/Process.c b/src/JAVA/libjafs/Process.c new file mode 100644 index 000000000..4d6b6a64d --- /dev/null +++ b/src/JAVA/libjafs/Process.c @@ -0,0 +1,499 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 "Internal.h" +#include "org_openafs_jafs_Process.h" + +#include + +///// definitions in Internal.c //////////////////// + +extern jclass processCls; +extern jfieldID process_nameField; +extern jfieldID process_typeField; +extern jfieldID process_stateField; +extern jfieldID process_goalField; +extern jfieldID process_startTimeField; +extern jfieldID process_numberStartsField; +extern jfieldID process_exitTimeField; +extern jfieldID process_exitErrorTimeField; +extern jfieldID process_errorCodeField; +extern jfieldID process_errorSignalField; +extern jfieldID process_stateOkField; +extern jfieldID process_stateTooManyErrorsField; +extern jfieldID process_stateBadFileAccessField; + +////////////////////////////////////////////////////////////////// + +/** + * Retrieve the information for the specified process and populate the + * given object + * + * env the Java environment + * serverHandle the bos handle of the server on which the process resides + * processName the name of the process for which to get the info + * process the Process object to populate with the info + */ +void +getProcessInfoChar(JNIEnv * env, void *serverHandle, const char *processName, + jobject process) +{ + afs_status_t ast; + bos_ProcessType_t type; + bos_ProcessInfo_t infoEntry; + bos_ProcessExecutionState_t state; + char *auxStatus; + + // get class fields if need be + if (processCls == 0) { + internal_getProcessClass(env, process); + } + + if (!bos_ProcessInfoGet + (serverHandle, processName, &type, &infoEntry, &ast)) { + throwAFSException(env, ast); + return; + } + // set type variable + switch (type) { + case BOS_PROCESS_SIMPLE: + (*env)->SetIntField(env, process, process_typeField, + org_openafs_jafs_Process_SIMPLE_PROCESS); + break; + case BOS_PROCESS_FS: + (*env)->SetIntField(env, process, process_typeField, + org_openafs_jafs_Process_FS_PROCESS); + break; + case BOS_PROCESS_CRON: + (*env)->SetIntField(env, process, process_typeField, + org_openafs_jafs_Process_CRON_PROCESS); + break; + default: + throwAFSException(env, type); + return; + } + + // set goal variable + switch (infoEntry.processGoal) { + case BOS_PROCESS_STOPPED: + (*env)->SetIntField(env, process, process_goalField, + org_openafs_jafs_Process_STOPPED); + break; + case BOS_PROCESS_RUNNING: + (*env)->SetIntField(env, process, process_goalField, + org_openafs_jafs_Process_RUNNING); + break; + case BOS_PROCESS_STOPPING: + (*env)->SetIntField(env, process, process_goalField, + org_openafs_jafs_Process_STOPPING); + break; + case BOS_PROCESS_STARTING: + (*env)->SetIntField(env, process, process_goalField, + org_openafs_jafs_Process_STARTING); + break; + default: + throwAFSException(env, infoEntry.processGoal); + return; + } + + // set state variable + auxStatus = (char *)malloc(sizeof(char) * BOS_MAX_NAME_LEN); + if (!auxStatus) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + if (!bos_ProcessExecutionStateGet + ((void *)serverHandle, processName, &state, auxStatus, &ast)) { + free(auxStatus); + throwAFSException(env, ast); + return; + } + free(auxStatus); + + switch (state) { + case BOS_PROCESS_STOPPED: + (*env)->SetIntField(env, process, process_stateField, + org_openafs_jafs_Process_STOPPED); + break; + case BOS_PROCESS_RUNNING: + (*env)->SetIntField(env, process, process_stateField, + org_openafs_jafs_Process_RUNNING); + break; + case BOS_PROCESS_STOPPING: + (*env)->SetIntField(env, process, process_stateField, + org_openafs_jafs_Process_STOPPING); + break; + case BOS_PROCESS_STARTING: + (*env)->SetIntField(env, process, process_stateField, + org_openafs_jafs_Process_STARTING); + break; + default: + throwAFSException(env, state); + return; + } + + // set longs + (*env)->SetLongField(env, process, process_startTimeField, + infoEntry.processStartTime); + (*env)->SetLongField(env, process, process_numberStartsField, + infoEntry.numberProcessStarts); + (*env)->SetLongField(env, process, process_exitTimeField, + infoEntry.processExitTime); + (*env)->SetLongField(env, process, process_exitErrorTimeField, + infoEntry.processExitErrorTime); + (*env)->SetLongField(env, process, process_errorCodeField, + infoEntry.processErrorCode); + (*env)->SetLongField(env, process, process_errorSignalField, + infoEntry.processErrorSignal); + + // set stateOk to true if no core dump + if (infoEntry.state & BOS_PROCESS_CORE_DUMPED) { + (*env)->SetBooleanField(env, process, process_stateOkField, FALSE); + } else { + (*env)->SetBooleanField(env, process, process_stateOkField, TRUE); + } + + // set stateTooManyErrors + if (infoEntry.state & BOS_PROCESS_TOO_MANY_ERRORS) { + (*env)->SetBooleanField(env, process, process_stateTooManyErrorsField, + TRUE); + } else { + (*env)->SetBooleanField(env, process, process_stateTooManyErrorsField, + FALSE); + } + + // set stateBadFileAccess + if (infoEntry.state & BOS_PROCESS_BAD_FILE_ACCESS) { + (*env)->SetBooleanField(env, process, process_stateBadFileAccessField, + TRUE); + } else { + (*env)->SetBooleanField(env, process, process_stateBadFileAccessField, + FALSE); + } + +} + +/** + * Fills in the information fields of the provided Process. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the process belongs + * jname the instance name of the process for which to get + * the information + * process the Process object in which to fill + * in the information + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Process_getProcessInfo(JNIEnv * env, jclass cls, + jint serverHandle, jstring jname, + jobject process) +{ + char *name; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (name == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLPROCESS); + return; + } + + getProcessInfoChar(env, (void *)serverHandle, name, process); + + // set name in case blank object + if (processCls == NULL) { + internal_getProcessClass(env, process); + } + (*env)->SetObjectField(env, process, process_nameField, jname); + free(name); +} + +/** + * Creates a process on a server. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the key will + * belong + * jname the instance name to give the process. See AFS + * documentation for a standard list of instance names + * jtype the type of process this will be. + * Acceptable values are: + * org_openafs_jafs_Process_SIMPLE_PROCESS + * org_openafs_jafs_Process_FS_PROCESS + * org_openafs_jafs_Process_CRON_PROCESS + * jpath the execution path process to create + * jcronTime a String representing the time a cron process is to + * be run. Acceptable formats are: + * for daily restarts: "23:10" or "11:10 pm" + * for weekly restarts: "sunday 11:10pm" or + * "sun 11:10pm" + * Can be null for non-cron processes. + * jnotifier the execution path to a notifier program that should + * be called when the process terminates. Can be + * null + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Process_create(JNIEnv * env, jclass cls, + jint serverHandle, jstring jname, + jint jtype, jstring jpath, + jstring jcronTime, jstring jnotifier) +{ + afs_status_t ast; + bos_ProcessType_t type; + char *name; + char *path; + char *cronTime; + char *notifier; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (name == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLPROCESS); + return; + } + + if (jpath != NULL) { + path = getNativeString(env, jpath); + if (path == NULL) { + free(name); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + path = NULL; + } + + switch (jtype) { + case org_openafs_jafs_Process_SIMPLE_PROCESS: + type = BOS_PROCESS_SIMPLE; + break; + case org_openafs_jafs_Process_FS_PROCESS: + type = BOS_PROCESS_FS; + break; + case org_openafs_jafs_Process_CRON_PROCESS: + type = BOS_PROCESS_CRON; + break; + default: + free(name); + if (path != NULL) + free(path); + throwAFSException(env, jtype); + return; + } + + if (jcronTime != NULL) { + cronTime = getNativeString(env, jcronTime); + if (!cronTime) { + free(name); + if (path != NULL) + free(path); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + cronTime = NULL; + } + + if (jnotifier != NULL) { + notifier = getNativeString(env, jnotifier); + if (!notifier) { + free(name); + if (path != NULL) + free(path); + if (cronTime != NULL) + free(cronTime); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + notifier = NULL; + } + + if (!bos_ProcessCreate + ((void *)serverHandle, name, type, path, cronTime, notifier, &ast)) { + throwAFSException(env, ast); + } + // release strings + free(name); + if (path != NULL) + free(path); + if (cronTime != NULL) + free(cronTime); + if (notifier != NULL) + free(notifier); +} + +/** + * Removes a process from a server. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the process + * belongs + * jname the name of the process to remove + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Process_delete(JNIEnv * env, jclass cls, + jint serverHandle, jstring jname) +{ + afs_status_t ast; + char *name; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (!name) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLPROCESS); + return; + } + + if (!bos_ProcessDelete((void *)serverHandle, name, &ast)) { + throwAFSException(env, ast); + } + + free(name); +} + +/** + * Stop this process. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the process + * belongs + * jname the name of the process to stop + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Process_stop(JNIEnv * env, jclass cls, + jint serverHandle, jstring jname) +{ + afs_status_t ast; + char *name; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (!name) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLPROCESS); + return; + } + + if (!bos_ProcessExecutionStateSet + ((void *)serverHandle, name, BOS_PROCESS_STOPPED, &ast)) { + throwAFSException(env, ast); + } + + free(name); +} + +/** + * Start this process. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the process + * belongs + * jname the name of the process to start + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Process_start(JNIEnv * env, jclass cls, + jint serverHandle, jstring jname) +{ + afs_status_t ast; + char *name; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (!name) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLPROCESS); + return; + } + + if (!bos_ProcessExecutionStateSet + ((void *)serverHandle, name, BOS_PROCESS_RUNNING, &ast)) { + throwAFSException(env, ast); + } + + free(name); +} + +/** + * Retart this process. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the process + * belongs + * jname the name of the process to restart + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Process_restart(JNIEnv * env, jclass cls, + jint serverHandle, jstring jname) +{ + afs_status_t ast; + char *name; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (!name) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLPROCESS); + return; + } + + if (!bos_ProcessRestart((void *)serverHandle, name, &ast)) { + throwAFSException(env, ast); + } + + free(name); +} + +// reclaim global memory being used by this portion +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Process_reclaimProcessMemory(JNIEnv * env, jclass cls) +{ + if (processCls) { + (*env)->DeleteGlobalRef(env, processCls); + processCls = 0; + } +} diff --git a/src/JAVA/libjafs/Server.c b/src/JAVA/libjafs/Server.c new file mode 100644 index 000000000..70adce6dc --- /dev/null +++ b/src/JAVA/libjafs/Server.c @@ -0,0 +1,1569 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 "Internal.h" +#include "org_openafs_jafs_Server.h" + +#include +#include +#include +#include +#include +#include + +//// definitions in Internal.c ////////////////// + +extern jclass serverCls; +extern jfieldID server_nameField; +extern jfieldID server_nameField; +extern jfieldID server_databaseField; +extern jfieldID server_fileServerField; +extern jfieldID server_badDatabaseField; +extern jfieldID server_badFileServerField; +extern jfieldID server_IPAddressField; + +extern jclass exectimeCls; +extern jfieldID exectime_HourField; +extern jfieldID exectime_MinField; +extern jfieldID exectime_SecField; +extern jfieldID exectime_DayField; +extern jfieldID exectime_NowField; +extern jfieldID exectime_NeverField; + +extern jclass partitionCls; +extern jfieldID partition_cachedInfoField; + +extern jclass keyCls; +extern jfieldID key_cachedInfoField; + +extern jclass processCls; +extern jfieldID process_cachedInfoField; +extern jfieldID process_nameField; +//extern jfieldID process_serverHandleField; + +extern jclass userCls; +extern jfieldID user_nameField; +extern jfieldID user_cachedInfoField; +////////////////////////////////////////////////////////// + +///// definition in jafs_Partition.c ///////////////// + +extern void fillPartitionInfo(JNIEnv * env, jobject partition, + vos_partitionEntry_t partEntry); + +/////////////////////////////////////////////////// + +///// definition in jafs_Key.c ///////////////// + +extern void fillKeyInfo(JNIEnv * env, jobject key, bos_KeyInfo_t keyEntry); + +/////////////////////////////////////////////////// + +///// definition in jafs_Process.c ///////////////// + +extern void getProcessInfoChar(JNIEnv * env, void *serverHandle, + const char *processName, jobject process); + +/////////////////////////////////////////////////// + +/** + * Extract the information from the given server entry and populate the + * given object + * + * env the Java environment + * cellHandle the handle of the cell to which the server belongs + * server the Server object to populate with the info + * servEntry the container of the server's information + */ +void +fillServerInfo(JNIEnv * env, jint cellHandle, jobject server, + afs_serverEntry_t servEntry) +{ + jstring jip; + jobjectArray jaddresses; + jstring jserver; + int i = 0; + + // get the class fields if need be + if (serverCls == 0) { + internal_getServerClass(env, server); + } + // in case it's blank + jserver = (*env)->NewStringUTF(env, servEntry.serverName); + (*env)->SetObjectField(env, server, server_nameField, jserver); + + // let's convert just the addresses in the address array into an IP + jaddresses = + (jobjectArray) (*env)->GetObjectField(env, server, + server_IPAddressField); + for (i = 0; i < 16; i++) { + if (servEntry.serverAddress[i] != 0) { + jip = (*env)->NewStringUTF(env, (char *) + inet_ntoa(htonl + (servEntry. + serverAddress[i]))); + (*env)->SetObjectArrayElement(env, jaddresses, i, jip); + } else { + break; + } + } + + // let's check if this is really a database server + (*env)->SetBooleanField(env, server, server_databaseField, + servEntry.serverType & DATABASE_SERVER); + if (servEntry.serverType & DATABASE_SERVER) { + // for now, if it thinks it's a database server than it is + // later, add checks for database configuration, and actual + // on-ness of the machine + (*env)->SetBooleanField(env, server, server_badDatabaseField, FALSE); + } else { + (*env)->SetBooleanField(env, server, server_badDatabaseField, FALSE); + } + + // we should check to see if this is truly a file server or not + // it could just be an old remnant, left over inside the vldb that + // should be removed. + // if it is a file server, mark it as such. If not, mark it as faulty. + (*env)->SetBooleanField(env, server, server_fileServerField, + servEntry.serverType & FILE_SERVER); + if (servEntry.serverType & FILE_SERVER) { + + // to see if it's really a file server, make sure the + // "fs" process is running + void *bosHandle; + afs_status_t ast; + bos_ProcessType_t processTypeT; + bos_ProcessInfo_t processInfoT; + char *fileServerProcessName = "fs"; + + // set the file server to true (it thinks it's a file server) + (*env)->SetBooleanField(env, server, server_fileServerField, TRUE); + + if (!bos_ServerOpen + ((void *)cellHandle, servEntry.serverName, &bosHandle, &ast)) { + throwAFSException(env, ast); + return; + } + if (!bos_ProcessInfoGet + (bosHandle, fileServerProcessName, &processTypeT, &processInfoT, + &ast)) { + // if the machine does not have a fs process or is not responding + // or is part of another cell + if (ast == BZNOENT || ast == -1 || ast == RXKADBADTICKET) { + (*env)->SetBooleanField(env, server, + server_badFileServerField, TRUE); + // otherwise + } else { + throwAFSException(env, ast); + return; + } + } else { + // it's good + (*env)->SetBooleanField(env, server, server_badFileServerField, + FALSE); + } + } else { + (*env)->SetBooleanField(env, server, server_badFileServerField, + FALSE); + } + +} + +/** + * Fills in the information fields of the provided Server. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the server belongs + * jname the name of the server for which to get the information + * server the Server object in which to fill in + * the information + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_getServerInfo(JNIEnv * env, jclass cls, + jint cellHandle, jstring jname, + jobject server) +{ + char *name; + afs_status_t ast; + afs_serverEntry_t servEntry; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (name == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLSERVER); + return; + } + + // get the server entry + if (!afsclient_AFSServerGet((void *)cellHandle, name, &servEntry, &ast)) { + throwAFSException(env, ast); + } + + fillServerInfo(env, cellHandle, server, servEntry); + + free(name); +} + +/** + * Returns the total number of partitions hosted by the server denoted by + * serverHandle, if the server is a fileserver. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the server belongs + * serverHandle the vos handle of the server to which the + * partitions belong + * returns total number of partitions + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getPartitionCount(JNIEnv * env, jclass cls, + jint cellHandle, + jint serverHandle) +{ + afs_status_t ast; + void *iterationId; + vos_partitionEntry_t partEntry; + int i = 0; + + if (!vos_PartitionGetBegin + ((void *)cellHandle, (void *)serverHandle, NULL, &iterationId, + &ast)) { + throwAFSException(env, ast); + return -1; + } + + while (vos_PartitionGetNext((void *)iterationId, &partEntry, &ast)) + i++; + + if (ast != ADMITERATORDONE) { + throwAFSException(env, ast); + return -1; + } + + return i; +} + +/** + * Begin the process of getting the partitions on a server. Returns + * an iteration ID to be used by subsequent calls to + * getPartitionsNext and getPartitionsDone. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the server belongs + * serverHandle the vos handle of the server to which the + * partitions belong + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getPartitionsBegin(JNIEnv * env, jclass cls, + jint cellHandle, + jint serverHandle) +{ + afs_status_t ast; + void *iterationId; + + if (!vos_PartitionGetBegin + ((void *)cellHandle, (void *)serverHandle, NULL, &iterationId, + &ast)) { + throwAFSException(env, ast); + return; + } + + return (jint) iterationId; + +} + +/** + * Returns the next partition of the server. Returns null + * if there are no more partitions. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * returns the name of the next partition of the server + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_Server_getPartitionsNextString(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + jstring jpartition; + vos_partitionEntry_t partEntry; + + if (!vos_PartitionGetNext((void *)iterationId, &partEntry, &ast)) { + if (ast == ADMITERATORDONE) { + return NULL; + } else { + throwAFSException(env, ast); + return; + } + } + + jpartition = (*env)->NewStringUTF(env, partEntry.name); + return jpartition; + +} + +/** + * Fills the next partition object of the server. Returns 0 if there + * are no more partitions, != 0 otherwise + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * thePartition the Partition object in which to fill the + * values of the next partition + * returns 0 if there are no more servers, != 0 otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getPartitionsNext(JNIEnv * env, jclass cls, + jint iterationId, + jobject jpartitionObject) +{ + afs_status_t ast; + vos_partitionEntry_t partEntry; + + if (!vos_PartitionGetNext((void *)iterationId, &partEntry, &ast)) { + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + + fillPartitionInfo(env, jpartitionObject, partEntry); + + // get the class fields if need be + if (partitionCls == 0) { + internal_getPartitionClass(env, jpartitionObject); + } + (*env)->SetBooleanField(env, jpartitionObject, partition_cachedInfoField, + TRUE); + + + return 1; + +} + +/** + * Signals that the iteration is complete and will not be accessed anymore. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_getPartitionsDone(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + + if (!vos_PartitionGetDone((void *)iterationId, &ast)) { + throwAFSException(env, ast); + return; + } + +} + +/** + * Adds the given to name to the list of bos administrators on that server. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the + * partitions belong + * jnewAdmin the name of the admin to add to the list + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_addBosAdmin(JNIEnv * env, jclass cls, + jint serverHandle, jstring jnewAdmin) +{ + afs_status_t ast; + char *newAdmin; + + if (jnewAdmin != NULL) { + newAdmin = getNativeString(env, jnewAdmin); + if (newAdmin == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLUSER); + return; + } + + if (!bos_AdminCreate((void *)serverHandle, newAdmin, &ast)) { + throwAFSException(env, ast); + } + + free(newAdmin); + +} + +/** + * Removes the given to name from the list of bos administrators on + * that server. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the + * partitions belong + * joldAdmin the name of the admin to remove from the list + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_removeBosAdmin(JNIEnv * env, jclass cls, + jint serverHandle, + jstring joldAdmin) +{ + afs_status_t ast; + char *oldAdmin; + + if (joldAdmin != NULL) { + oldAdmin = getNativeString(env, joldAdmin); + if (oldAdmin == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLUSER); + return; + } + + if (!bos_AdminDelete((void *)serverHandle, oldAdmin, &ast)) { + throwAFSException(env, ast); + } + + free(oldAdmin); +} + +/** + * Returns the total number of BOS administrators associated with the server + * denoted by serverHandle. + * + * env the Java environment + * cls the current Java class + * serverHandle the vos handle of the server to which the + * BOS admins belong + * returns total number of BOS administrators + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getBosAdminCount(JNIEnv * env, jclass cls, + jint serverHandle) +{ + afs_status_t ast; + void *iterationId; + char *admin; + jstring jadmin; + int i = 0; + + if (!bos_AdminGetBegin((void *)serverHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return -1; + } + + admin = (char *)malloc(sizeof(char) * BOS_MAX_NAME_LEN); + + if (!admin) { + throwAFSException(env, JAFSADMNOMEM); + return -1; + } + + while (bos_AdminGetNext((void *)iterationId, admin, &ast)) + i++; + + free(admin); + + if (ast != ADMITERATORDONE) { + throwAFSException(env, ast); + return -1; + } + + return i; +} + +/** + * Begin the process of getting the bos amdinistrators on a server. Returns + * an iteration ID to be used by subsequent calls to + * getBosAdminsNext and getBosAdminsDone. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the + * partitions belong + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getBosAdminsBegin(JNIEnv * env, jclass cls, + jint serverHandle) +{ + afs_status_t ast; + void *iterationId; + + if (!bos_AdminGetBegin((void *)serverHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return; + } + + return (jint) iterationId; +} + +/** + * Returns the next bos admin of the server. Returns null + * if there are no more admins. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * returns the name of the next admin of the server + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_Server_getBosAdminsNextString(JNIEnv * env, jclass cls, + jint iterationId) +{ + + afs_status_t ast; + jstring jadmin; + char *admin = (char *)malloc(sizeof(char) * BOS_MAX_NAME_LEN); + + if (!admin) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (!bos_AdminGetNext((void *)iterationId, admin, &ast)) { + free(admin); + if (ast == ADMITERATORDONE) { + return NULL; + } else { + throwAFSException(env, ast); + return; + } + } + + jadmin = (*env)->NewStringUTF(env, admin); + free(admin); + return jadmin; + +} + +/** + * Returns the next bos admin of the server. Returns 0 if there + * are no more admins, != 0 otherwise. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which these admins belong + * iterationId the iteration ID of this iteration + * juserObject the user object in which to fill the values of this admin + * returns 0 if no more admins, != 0 otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getBosAdminsNext(JNIEnv * env, jclass cls, + jint cellHandle, + jint iterationId, + jobject juserObject) +{ + afs_status_t ast; + char *admin; + jstring jadmin; + + admin = (char *)malloc(sizeof(char) * BOS_MAX_NAME_LEN); + + if (!admin) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (!bos_AdminGetNext((void *)iterationId, admin, &ast)) { + free(admin); + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + + jadmin = (*env)->NewStringUTF(env, admin); + + if (userCls == 0) { + internal_getUserClass(env, juserObject); + } + + (*env)->SetObjectField(env, juserObject, user_nameField, jadmin); + + getUserInfoChar(env, cellHandle, admin, juserObject); + (*env)->SetBooleanField(env, juserObject, user_cachedInfoField, TRUE); + + free(admin); + return 1; + +} + +/** + * Signals that the iteration is complete and will not be accessed anymore. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_getBosAdminsDone(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + + if (!bos_AdminGetDone((void *)iterationId, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Returns the total number of keys hosted by the server denoted by + * serverHandle. + * + * env the Java environment + * cls the current Java class + * serverHandle the vos handle of the server to which the + * keys belong + * returns total number of keys + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getKeyCount(JNIEnv * env, jclass cls, + jint serverHandle) +{ + afs_status_t ast; + void *iterationId; + bos_KeyInfo_t keyEntry; + int i = 0; + + if (!bos_KeyGetBegin((void *)serverHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return -1; + } + + while (bos_KeyGetNext((void *)iterationId, &keyEntry, &ast)) + i++; + + if (ast != ADMITERATORDONE) { + throwAFSException(env, ast); + return -1; + } + + return i; +} + +/** + * Begin the process of getting the keys of a server. Returns + * an iteration ID to be used by subsequent calls to + * getKeysNext and getKeysDone. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the keys belong + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getKeysBegin(JNIEnv * env, jclass cls, + jint serverHandle) +{ + afs_status_t ast; + void *iterationId; + + if (!bos_KeyGetBegin((void *)serverHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return; + } + + return (jint) iterationId; +} + +/** + * Returns the next key of the server. Returns 0 if there + * are no more keys, != 0 otherwise. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * jkeyObject a Key object, in which to fill in the + * properties of the next key. + * returns 0 if there are no more keys, != 0 otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getKeysNext(JNIEnv * env, jclass cls, + jint iterationId, jobject jkeyObject) +{ + + afs_status_t ast; + bos_KeyInfo_t keyEntry; + + if (!bos_KeyGetNext((void *)iterationId, &keyEntry, &ast)) { + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + + fillKeyInfo(env, jkeyObject, keyEntry); + + // get the class fields if need be + if (keyCls == 0) { + internal_getKeyClass(env, jkeyObject); + } + + (*env)->SetBooleanField(env, jkeyObject, key_cachedInfoField, TRUE); + + return 1; +} + +/** + * Signals that the iteration is complete and will not be accessed anymore. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_getKeysDone(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + + if (!bos_KeyGetDone((void *)iterationId, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Returns the total number of processes hosted by the server denoted by + * serverHandle. + * + * env the Java environment + * cls the current Java class + * serverHandle the vos handle of the server to which the + * processes belong + * returns total number of processes + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getProcessCount(JNIEnv * env, jclass cls, + jint serverHandle) +{ + afs_status_t ast; + void *iterationId; + char *process; + jstring jprocess; + int i = 0; + + if (!bos_ProcessNameGetBegin((void *)serverHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return -1; + } + + process = (char *)malloc(sizeof(char) * BOS_MAX_NAME_LEN); + + if (!process) { + throwAFSException(env, JAFSADMNOMEM); + return -1; + } + + while (bos_ProcessNameGetNext((void *)iterationId, process, &ast)) + i++; + + free(process); + + if (ast != ADMITERATORDONE) { + throwAFSException(env, ast); + return -1; + } + + return i; +} + +/** + * Begin the process of getting the processes on a server. Returns + * an iteration ID to be used by subsequent calls to + * getProcessesNext and getProcessesDone. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the + * processes belong + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getProcessesBegin(JNIEnv * env, jclass cls, + jint serverHandle) +{ + afs_status_t ast; + void *iterationId; + + if (!bos_ProcessNameGetBegin((void *)serverHandle, &iterationId, &ast)) { + throwAFSException(env, ast); + return; + } + + return (jint) iterationId; +} + +/** + * Returns the next process of the server. Returns null + * if there are no more processes. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * returns the name of the next process of the cell + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_Server_getProcessesNextString(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + jstring jprocess; + char *process = (char *)malloc(sizeof(char) * BOS_MAX_NAME_LEN); + + if (!process) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (!bos_ProcessNameGetNext((void *)iterationId, process, &ast)) { + free(process); + if (ast == ADMITERATORDONE) { + return NULL; + } else { + throwAFSException(env, ast); + return; + } + } + + jprocess = (*env)->NewStringUTF(env, process); + free(process); + return jprocess; +} + +/** + * Fills the next process object of the server. Returns 0 if there + * are no more processes, != 0 otherwise. + * + * env the Java environment + * cls the current Java class + * serverHandle the handle of the BOS server that hosts the process + * iterationId the iteration ID of this iteration + * jprocessObject the Process object in which to fill the + * values of the next process + * returns 0 if there are no more processes, != otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Server_getProcessesNext(JNIEnv * env, jclass cls, + jint serverHandle, + jint iterationId, + jobject jprocessObject) +{ + afs_status_t ast; + char *process = (char *)malloc(sizeof(char) * BOS_MAX_NAME_LEN); + jstring jprocess; + + if (!process) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (!bos_ProcessNameGetNext((void *)iterationId, process, &ast)) { + free(process); + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + // get the class fields if need be + if (processCls == 0) { + internal_getProcessClass(env, jprocessObject); + } + + jprocess = (*env)->NewStringUTF(env, process); + (*env)->SetObjectField(env, jprocessObject, process_nameField, jprocess); + + getProcessInfoChar(env, (void *)serverHandle, process, jprocessObject); + + (*env)->SetBooleanField(env, jprocessObject, process_cachedInfoField, + TRUE); + + free(process); + return 1; +} + +/** + * Signals that the iteration is complete and will not be accessed anymore. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_getProcessesDone(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + + if (!bos_ProcessNameGetDone((void *)iterationId, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Salvages (restores consistency to) a volume, partition, or server + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the volume belongs + * serverHandle the bos handle of the server on which the + * volume resides + * jpartName the name of the partition to salvage, + * can be null only if volName is + * null + * jvolName the name of the volume to salvage, + * can be null + * numSalvagers the number of salvager processes to run in parallel + * jtempDir directory to place temporary files, can be + * null + * jlogFile where salvager log will be written, can be + * null + * inspectAllVolumes whether or not to inspect all volumes, + * not just those marked as active at crash + * removeBadlyDamaged whether or not to remove a volume if it's + * badly damaged + * writeInodes whether or not to record a list of inodes modified + * writeRootInodes whether or not to record a list of AFS + * inodes owned by root + * forceDirectory whether or not to salvage an entire directory + * structure + * forceBlockReads whether or not to force the salvager to read + * the partition + * one block at a time and skip badly damaged + * blocks. Use if partition has disk errors + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_salvage(JNIEnv * env, jclass cls, + jint cellHandle, jint serverHandle, + jstring jpartName, jstring jvolName, + jint numSalvagers, jstring jtempDir, + jstring jlogFile, + jboolean inspectAllVolumes, + jboolean removeBadlyDamaged, + jboolean writeInodes, + jboolean writeRootInodes, + jboolean forceDirectory, + jboolean forceBlockReads) +{ + afs_status_t ast; + char *partName; + char *volName; + char *tempDir; + char *logFile; + vos_force_t force; + bos_SalvageDamagedVolumes_t sdv; + bos_WriteInodes_t wi; + bos_WriteRootInodes_t wri; + bos_ForceDirectory_t forceD; + bos_ForceBlockRead_t forceBR; + + // convert strings + if (jpartName != NULL) { + partName = getNativeString(env, jpartName); + if (!partName) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + partName = NULL; + } + + if (jvolName != NULL) { + volName = getNativeString(env, jvolName); + if (!volName) { + if (partName != NULL) + free(partName); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + volName = NULL; + } + + if (jtempDir != NULL) { + tempDir = getNativeString(env, jtempDir); + if (!tempDir) { + if (partName != NULL) + free(partName); + if (volName != NULL) + free(volName); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + tempDir = NULL; + } + + if (jlogFile != NULL) { + logFile = getNativeString(env, jlogFile); + if (!logFile) { + if (partName != NULL) + free(partName); + if (volName != NULL) + free(volName); + if (tempDir != NULL) + free(tempDir); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + logFile = NULL; + } + + // deal with booleans + if (inspectAllVolumes) { + force = VOS_FORCE; + } else { + force = VOS_NORMAL; + } + if (removeBadlyDamaged) { + sdv = BOS_DONT_SALVAGE_DAMAGED_VOLUMES; + } else { + sdv = BOS_SALVAGE_DAMAGED_VOLUMES; + } + if (writeInodes) { + wi = BOS_SALVAGE_WRITE_INODES; + } else { + wi = BOS_SALVAGE_DONT_WRITE_INODES; + } + if (writeRootInodes) { + wri = BOS_SALVAGE_WRITE_ROOT_INODES; + } else { + wri = BOS_SALVAGE_DONT_WRITE_ROOT_INODES; + } + if (forceDirectory) { + forceD = BOS_SALVAGE_FORCE_DIRECTORIES; + } else { + forceD = BOS_SALVAGE_DONT_FORCE_DIRECTORIES; + } + if (forceBlockReads) { + forceBR = BOS_SALVAGE_FORCE_BLOCK_READS; + } else { + forceBR = BOS_SALVAGE_DONT_FORCE_BLOCK_READS; + } + + //salvage! + if (!bos_Salvage + ((void *)cellHandle, (void *)serverHandle, partName, volName, + (int)numSalvagers, tempDir, logFile, force, sdv, wi, wri, forceD, + forceBR, &ast)) { + throwAFSException(env, ast); + } + // release strings + if (partName != NULL) + free(partName); + if (volName != NULL) + free(volName); + if (tempDir != NULL) + free(tempDir); + if (logFile != NULL) + free(logFile); + +} + +/** + * Fills in the restart time fields of the given Server + * object. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the key belongs + * jtype whether to get the general or binary restart. + * Acceptable values are: + * org_opemafs_jafs_Server_RESTART_BINARY + * org_opemafs_jafs_Server_RESTART_GENERAL + * execTime the ExecutableTime object, in which + * to fill the restart time fields + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_getRestartTime(JNIEnv * env, jclass cls, + jint serverHandle, jint jtype, + jobject exectime) +{ + afs_status_t ast; + bos_Restart_t type; + bos_RestartTime_t time; + jfieldID hourField; + jfieldID minField; + jfieldID secField; + jfieldID dayField; + jfieldID neverField; + jfieldID nowField; + + // get the class fields if need be + if (exectimeCls == 0) { + internal_getExecTimeClass(env, exectime); + } + + if (jtype == org_openafs_jafs_Server_RESTART_BINARY) { + type = BOS_RESTART_DAILY; + } else { + type = BOS_RESTART_WEEKLY; + } + + hourField = exectime_HourField; + minField = exectime_MinField; + secField = exectime_SecField; + dayField = exectime_DayField; + neverField = exectime_NeverField; + nowField = exectime_NowField; + + if (!bos_ExecutableRestartTimeGet + ((void *)serverHandle, type, &time, &ast)) { + throwAFSException(env, ast); + return; + } + // set now + (*env)->SetBooleanField(env, exectime, nowField, + (time.mask & BOS_RESTART_TIME_NOW)); + + // set never + (*env)->SetBooleanField(env, exectime, neverField, + (time.mask & BOS_RESTART_TIME_NEVER)); + + // set hour + (*env)->SetShortField(env, exectime, hourField, time.hour); + + // set minute + (*env)->SetShortField(env, exectime, minField, time.min); + + // set second + (*env)->SetShortField(env, exectime, secField, time.sec); + + // set day + if (time.mask & BOS_RESTART_TIME_DAY) { + (*env)->SetShortField(env, exectime, dayField, time.day); + } else { + (*env)->SetShortField(env, exectime, dayField, (jshort) - 1); + } + +} + +/** + * Sets the restart time of the bos server. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the key belongs + * jtype whether this is to be a general or binary restart. + * Acceptable values are: + * org_opemafs_jafs_Server_RESTART_BINARY + * org_opemafs_jafs_Server_RESTART_GENERAL + * executableTime the ExecutableTime object containing the + * desired information + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_setRestartTime(JNIEnv * env, jclass cls, + jint serverHandle, jint jtype, + jobject exectime) +{ + afs_status_t ast; + bos_Restart_t type; + bos_RestartTime_t time; + jboolean doHour; + jboolean doMinute; + jboolean doSecond; + jboolean doDay; + jboolean doNever; + jboolean doNow; + jshort hour; + jshort minute; + jshort second; + jshort day; + jfieldID hourField; + jfieldID minField; + jfieldID secField; + jfieldID dayField; + jfieldID neverField; + jfieldID nowField; + + // get the class fields if need be + if (exectimeCls == 0) { + internal_getExecTimeClass(env, exectime); + } + + if (jtype == org_openafs_jafs_Server_RESTART_BINARY) { + type = BOS_RESTART_DAILY; + } else { + type = BOS_RESTART_WEEKLY; + } + + hourField = exectime_HourField; + minField = exectime_MinField; + secField = exectime_SecField; + dayField = exectime_DayField; + neverField = exectime_NeverField; + nowField = exectime_NowField; + + hour = (*env)->GetShortField(env, exectime, hourField); + if (hour != 0) { + doHour = TRUE; + } else { + doHour = FALSE; + } + minute = (*env)->GetShortField(env, exectime, minField); + if (minute != 0) { + doMinute = TRUE; + } else { + doMinute = FALSE; + } + second = (*env)->GetShortField(env, exectime, secField); + if (second != 0) { + doSecond = TRUE; + } else { + doSecond = FALSE; + } + day = (*env)->GetShortField(env, exectime, dayField); + if (day != -1) { + doDay = TRUE; + } else { + doDay = FALSE; + } + doNever = (*env)->GetBooleanField(env, exectime, neverField); + doNow = (*env)->GetBooleanField(env, exectime, nowField); + + bzero(&time, sizeof(time)); + + if (jtype == org_openafs_jafs_Server_RESTART_BINARY) { + type = BOS_RESTART_DAILY; + } else { + type = BOS_RESTART_WEEKLY; + } + + if (doHour) { + time.mask |= BOS_RESTART_TIME_HOUR; + } + if (doMinute) { + time.mask |= BOS_RESTART_TIME_MINUTE; + } + if (doSecond) { + time.mask |= BOS_RESTART_TIME_SECOND; + } + if (doDay) { + time.mask |= BOS_RESTART_TIME_DAY; + } + if (doNever) { + time.mask |= BOS_RESTART_TIME_NEVER; + } + if (doNow) { + time.mask |= BOS_RESTART_TIME_NOW; + } + + time.hour = hour; + time.min = minute; + time.sec = second; + time.day = day; + + if (!bos_ExecutableRestartTimeSet((void *)serverHandle, type, time, &ast)) { + throwAFSException(env, ast); + } +} + +/** + * Synchronizes a particular server with the volume location database. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the server belongs + * serverHandle the vos handle of the server + * partition the id of the partition to sync, can be -1 to ignore + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_syncServerWithVLDB(JNIEnv * env, jclass cls, + jint cellHandle, + jint serverHandle, + jint partition) +{ + afs_status_t ast; + int *part; + + if (partition == -1) { + part = NULL; + } else { + part = (int *)&partition; + } + + if (!vos_ServerSync + ((void *)cellHandle, (void *)serverHandle, NULL, part, &ast)) { + throwAFSException(env, ast); + } +} + +/** + * Synchronizes the volume location database with a particular server. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the server belongs + * serverHandle the vos handle of the server + * partition the id of the partition to sync, can be -1 to ignore + * forceDeletion whether or not to force the deletion of bad volumes + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_syncVLDBWithServer(JNIEnv * env, jclass cls, + jint cellHandle, + jint serverHandle, + jint partition, + jboolean forceDeletion) +{ + afs_status_t ast; + int *part; + vos_force_t force; + + if (partition == -1) { + part = NULL; + } else { + part = (int *)&partition; + } + + if (forceDeletion) { + force = VOS_FORCE; + } else { + force = VOS_NORMAL; + } + + if (!vos_VLDBSync + ((void *)cellHandle, (void *)serverHandle, NULL, part, force, &ast)) { + throwAFSException(env, ast); + } +} + +/** + * Start all server processes. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the + * processes belong + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_startAllProcesses(JNIEnv * env, jclass cls, + jint serverHandle) +{ + afs_status_t ast; + + if (!bos_ProcessAllStart((void *)serverHandle, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Stop all server processes. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the + * processes belong + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_stopAllProcesses(JNIEnv * env, jclass cls, + jint serverHandle) +{ + afs_status_t ast; + + if (!bos_ProcessAllStop((void *)serverHandle, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Restart all server processes. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the + * processes belong + * restartBosServer whether or not to restart the bos server as well + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_restartAllProcesses(JNIEnv * env, jclass cls, + jint serverHandle, + jboolean restartBosServer) +{ + afs_status_t ast; + bos_RestartBosServer_t rbs; + + if (restartBosServer) { + rbs = BOS_RESTART_BOS_SERVER; + } else { + rbs = BOS_DONT_RESTART_BOS_SERVER; + } + + if (!bos_ProcessAllStopAndRestart((void *)serverHandle, rbs, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Retrieves a specified bos log from a server. Right now this + * method will simply return a huge String containing the log, but + * hopefully we can devise a better way to make this work more efficiently. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the key belongs + * jlogFile the full path and name of the desired bos log + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_Server_getLog(JNIEnv * env, jclass cls, + jint serverHandle, jstring jlogFile) +{ + afs_status_t ast; + char *logFile; + char *logData; + unsigned long currInLogSize = 1; + unsigned long currOutLogSize = 0; + jstring logOut; + + logData = (char *)malloc(sizeof(char) * currInLogSize); + if (logData == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return NULL; + } + + if (jlogFile != NULL) { + logFile = getNativeString(env, jlogFile); + if (logFile == NULL) { + free(logData); + throwAFSException(env, JAFSADMNOMEM); + return NULL; + } + } else { + free(logData); + throwAFSException(env, JAFSNULLARG); + return NULL; + } + + // check how big the log is . . . + if (!bos_LogGet + ((void *)serverHandle, logFile, &currOutLogSize, logData, &ast)) { + // anything but not enough room in buffer + if (ast != ADMMOREDATA) { + free(logData); + free(logFile); + throwAFSException(env, ast); + return NULL; + } + } + // free previous allocation + free(logData); + + // increase log size (plus one for terminator) + currInLogSize = currOutLogSize + 1; + + // allocate buffer + logData = (char *)malloc(sizeof(char) * currInLogSize); + if (logData == NULL) { + free(logFile); + throwAFSException(env, JAFSADMNOMEM); + return NULL; + } + // get the log for real + if (!bos_LogGet + ((void *)serverHandle, logFile, &currOutLogSize, logData, &ast)) { + free(logData); + free(logFile); + throwAFSException(env, ast); + return NULL; + } + // NULL-terminate + logData[currOutLogSize] == '\0'; + + logOut = (*env)->NewStringUTF(env, logData); + + free(logData); + free(logFile); + + return logOut; +} + + +/** + * Executes any command on the specified server. + * + * env the Java environment + * cls the current Java class + * serverHandle the bos handle of the server to which the key belongs + * jcommand the text of the commmand to execute + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_executeCommand(JNIEnv * env, jclass cls, + jint serverHandle, + jstring jcommand) +{ + afs_status_t ast; + char *command; + + if (jcommand != NULL) { + command = getNativeString(env, jcommand); + if (command == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLARG); + return; + } + + if (!bos_CommandExecute((void *)serverHandle, command, &ast)) { + throwAFSException(env, ast); + } + + free(command); +} + +// reclaim global memory being used by this portion +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Server_reclaimServerMemory(JNIEnv * env, jclass cls) +{ + if (serverCls) { + (*env)->DeleteGlobalRef(env, serverCls); + serverCls = 0; + } +} diff --git a/src/JAVA/libjafs/User.c b/src/JAVA/libjafs/User.c new file mode 100644 index 000000000..a58194830 --- /dev/null +++ b/src/JAVA/libjafs/User.c @@ -0,0 +1,1367 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 "Internal.h" +#include "org_openafs_jafs_User.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +///// definitions in Internal.c //////////////////// + +extern jclass userCls; +extern jfieldID user_nameField; +extern jfieldID user_ptsField; +extern jfieldID user_kasField; +//pts fields +extern jfieldID user_nameUidField; +extern jfieldID user_ownerUidField; +extern jfieldID user_creatorUidField; +extern jfieldID user_listStatusField; +extern jfieldID user_listGroupsOwnedField; +extern jfieldID user_listMembershipField; +extern jfieldID user_groupCreationQuotaField; +extern jfieldID user_groupMembershipCountField; +extern jfieldID user_ownerField; +extern jfieldID user_creatorField; +// kas fields +extern jfieldID user_adminSettingField; +extern jfieldID user_tgsSettingField; +extern jfieldID user_encSettingField; +extern jfieldID user_cpwSettingField; +extern jfieldID user_rpwSettingField; +extern jfieldID user_userExpirationField; +extern jfieldID user_lastModTimeField; +extern jfieldID user_lastModNameField; +extern jfieldID user_lastChangePasswordTimeField; +extern jfieldID user_maxTicketLifetimeField; +extern jfieldID user_keyVersionField; +extern jfieldID user_encryptionKeyField; +extern jfieldID user_keyCheckSumField; +extern jfieldID user_daysToPasswordExpireField; +extern jfieldID user_failLoginCountField; +extern jfieldID user_lockTimeField; +extern jfieldID user_lockedUntilField; + +extern jclass groupCls; +extern jfieldID group_nameField; +extern jfieldID group_cachedInfoField; + +////////////////////////////////////////////////////////////////// + +/** + * Creates the kas and pts entries for a new user. Pass in 0 for the uid + * if pts is to automatically assign the user id. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * jusername the name of the user to create + * jpassword the password for the new user + * uid the user id to assign to the user (0 to have one + * automatically assigned) + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_User_create(JNIEnv * env, jclass cls, jint cellHandle, + jstring jusername, jstring jpassword, + jint uid) +{ + afs_status_t ast; + char *username; + char *password; + kas_identity_p who = (kas_identity_p) malloc(sizeof(kas_identity_t)); + + if (!who) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + // convert java strings + if (jusername != NULL) { + username = getNativeString(env, jusername); + if (username == NULL) { + free(who); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(who); + throwAFSException(env, JAFSNULLUSER); + return; + } + + if (jpassword != NULL) { + password = getNativeString(env, jpassword); + if (password == NULL) { + free(who); + free(username); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(who); + free(username); + throwAFSException(env, JAFSNULLPASS); + return; + } + + // make sure the name is within the allowed bounds + if (strlen(username) > KAS_MAX_NAME_LEN) { + free(who); + free(username); + free(password); + throwAFSException(env, ADMPTSUSERNAMETOOLONG); + return; + } + // make sure name doesn't have ":" in it + if (strchr(username, ':') != (int)NULL) { + free(who); + free(username); + free(password); + throwAFSException(env, PRBADNAM); + return; + } + // make sure the id isn't negative + if (uid < 0) { + free(who); + free(username); + free(password); + // use the "bad arg" error code even though it's an ID exception. + // There isn't a bad user ID error code + throwAFSException(env, PRBADARG); + return; + } + + if (username != NULL) { + internal_makeKasIdentity(username, who); + } + // create the kas entry + if (!kas_PrincipalCreate((void *)cellHandle, NULL, who, password, &ast)) { + free(who); + free(username); + free(password); + throwAFSException(env, ast); + return; + } + // create the pts entry - if there's an error, make sure to delete + // the kas entry + if (!pts_UserCreate((void *)cellHandle, username, (int *)&uid, &ast)) { + afs_status_t ast_kd; + kas_PrincipalDelete((void *)cellHandle, NULL, who, &ast_kd); + free(who); + free(username); + free(password); + throwAFSException(env, ast); + return; + } + + free(who); + free(username); + free(password); +} + +/** + * Deletes the pts and kas entry for a user. Deletes this user from the + * membership list of the groups to which it belonged, but does not delete + * the groups owned by this user. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * jusername the name of the user to delete + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_User_delete(JNIEnv * env, jclass cls, jint cellHandle, + jstring jusername) +{ + afs_status_t ast; + char *username; + kas_identity_p who = (kas_identity_p) malloc(sizeof(kas_identity_t)); + int kas; + + if (!who) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (jusername != NULL) { + username = getNativeString(env, jusername); + if (username == NULL) { + free(who); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(who); + throwAFSException(env, JAFSNULLUSER); + return; + } + + // make sure the name is within the allowed bounds + if (strlen(username) > KAS_MAX_NAME_LEN) { + free(who); + free(username); + throwAFSException(env, ADMPTSUSERNAMETOOLONG); + return; + } + + internal_makeKasIdentity(username, who); + + // delete the kas entry + if (!kas_PrincipalDelete((void *)cellHandle, NULL, who, &ast)) { + if (ast != KANOENT) { + free(who); + free(username); + throwAFSException(env, ast); + return; + } else { + kas = FALSE; + } + } + //delete the pts entry + if (!pts_UserDelete((void *)cellHandle, username, &ast)) { + // throw exception if there was no such pts user only if there was + // also no such kas user + if ((ast == ADMPTSFAILEDNAMETRANSLATE && !kas) + || ast != ADMPTSFAILEDNAMETRANSLATE) { + free(who); + free(username); + throwAFSException(env, ast); + return; + } + } + + free(who); + free(username); +} + +/** + * Unlocks a user. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * jusername the name of the user to unlock + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_User_unlock(JNIEnv * env, jclass cls, jint cellHandle, + jstring jusername) +{ + afs_status_t ast; + char *username; + kas_identity_p who = (kas_identity_p) malloc(sizeof(kas_identity_t)); + + if (!who) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + // convert java strings + if (jusername != NULL) { + username = getNativeString(env, jusername); + if (username == NULL) { + free(who); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(who); + throwAFSException(env, JAFSNULLUSER); + return; + } + + // make sure the name is within the allowed bounds + if (strlen(username) > KAS_MAX_NAME_LEN) { + free(who); + free(username); + throwAFSException(env, ADMPTSUSERNAMETOOLONG); + return; + } + + internal_makeKasIdentity(username, who); + + if (!kas_PrincipalUnlock((void *)cellHandle, NULL, who, &ast)) { + free(who); + free(username); + throwAFSException(env, ast); + return; + } + + free(who); + free(username); +} + +/** + * Retrieve the information for the specified user and populate the + * given object + * + * env the Java environment + * cellHandle the handle of the cell to which the user belongs + * name the name of the user for which to get the info + * user the User object to populate with the info + */ +void +getUserInfoChar(JNIEnv * env, int cellHandle, const char *name, jobject user) +{ + jstring jowner; + jstring jcreator; + jstring jlastModName; + jstring jencryptionKey; + jboolean pts; + jboolean kas; + pts_UserEntry_t ptsEntry; + afs_status_t ast; + kas_identity_p who = (kas_identity_p) malloc(sizeof(kas_identity_t)); + kas_principalEntry_t kasEntry; + unsigned int lockedUntil; + + if (!who) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + // make sure the name is within the allowed bounds + if (name != NULL && strlen(name) > KAS_MAX_NAME_LEN) { + free(who); + throwAFSException(env, ADMPTSUSERNAMETOOLONG); + return; + } + + if (name != NULL) { + internal_makeKasIdentity(name, who); + } + // get all the field ids, if you haven't done so already + if (userCls == 0) { + internal_getUserClass(env, user); + } + // get the pts entry + if (!pts_UserGet((void *)cellHandle, name, &ptsEntry, &ast)) { + // if the user has no pts ptsEntry + if (ast == ADMPTSFAILEDNAMETRANSLATE) { + pts = FALSE; + } else { + free(who); + throwAFSException(env, ast); + return; + } + } else { + pts = TRUE; + } + + + // get the kas entry + if (!kas_PrincipalGet((void *)cellHandle, NULL, who, &kasEntry, &ast)) { + // no kas entry + if (ast == KANOENT) { + if (!pts) { + free(who); + throwAFSException(env, ast); + return; + } else { + kas = FALSE; + } + // other + } else { + free(who); + throwAFSException(env, ast); + return; + } + } else { + kas = TRUE; + } + + // get the lock status + if (kas + && !kas_PrincipalLockStatusGet((void *)cellHandle, NULL, who, + &lockedUntil, &ast)) { + free(who); + throwAFSException(env, ast); + return; + } + + (*env)->SetBooleanField(env, user, user_ptsField, pts); + (*env)->SetBooleanField(env, user, user_kasField, kas); + + // set the pts fields + if (pts) { + (*env)->SetIntField(env, user, user_nameUidField, ptsEntry.nameUid); + (*env)->SetIntField(env, user, user_ownerUidField, ptsEntry.ownerUid); + (*env)->SetIntField(env, user, user_creatorUidField, + ptsEntry.creatorUid); + (*env)->SetIntField(env, user, user_groupCreationQuotaField, + ptsEntry.groupCreationQuota); + (*env)->SetIntField(env, user, user_groupMembershipCountField, + ptsEntry.groupMembershipCount); + + if (ptsEntry.listStatus == PTS_USER_OWNER_ACCESS) { + (*env)->SetIntField(env, user, user_listStatusField, + org_openafs_jafs_User_USER_OWNER_ACCESS); + } else { + (*env)->SetIntField(env, user, user_listStatusField, + org_openafs_jafs_User_USER_ANYUSER_ACCESS); + } + if (ptsEntry.listGroupsOwned == PTS_USER_OWNER_ACCESS) { + (*env)->SetIntField(env, user, user_listGroupsOwnedField, + org_openafs_jafs_User_USER_OWNER_ACCESS); + } else { + (*env)->SetIntField(env, user, user_listGroupsOwnedField, + org_openafs_jafs_User_USER_ANYUSER_ACCESS); + } + if (ptsEntry.listMembership == PTS_USER_OWNER_ACCESS) { + (*env)->SetIntField(env, user, user_listMembershipField, + org_openafs_jafs_User_USER_OWNER_ACCESS); + } else { + (*env)->SetIntField(env, user, user_listMembershipField, + org_openafs_jafs_User_USER_ANYUSER_ACCESS); + } + + jowner = (*env)->NewStringUTF(env, ptsEntry.owner); + jcreator = (*env)->NewStringUTF(env, ptsEntry.creator); + + (*env)->SetObjectField(env, user, user_ownerField, jowner); + (*env)->SetObjectField(env, user, user_creatorField, jcreator); + + } + // set the kas fields + if (kas) { + char *convertedKey; + int i; + if (kasEntry.adminSetting == KAS_ADMIN) { + (*env)->SetIntField(env, user, user_adminSettingField, + org_openafs_jafs_User_ADMIN); + } else { + (*env)->SetIntField(env, user, user_adminSettingField, + org_openafs_jafs_User_NO_ADMIN); + } + if (kasEntry.tgsSetting == TGS) { + (*env)->SetIntField(env, user, user_tgsSettingField, + org_openafs_jafs_User_GRANT_TICKETS); + } else { + (*env)->SetIntField(env, user, user_tgsSettingField, + org_openafs_jafs_User_NO_GRANT_TICKETS); + } + if (kasEntry.encSetting != NO_ENCRYPT) { + (*env)->SetIntField(env, user, user_encSettingField, + org_openafs_jafs_User_ENCRYPT); + } else { + (*env)->SetIntField(env, user, user_encSettingField, + org_openafs_jafs_User_NO_ENCRYPT); + } + if (kasEntry.cpwSetting == CHANGE_PASSWORD) { + (*env)->SetIntField(env, user, user_cpwSettingField, + org_openafs_jafs_User_CHANGE_PASSWORD); + } else { + (*env)->SetIntField(env, user, user_cpwSettingField, + org_openafs_jafs_User_NO_CHANGE_PASSWORD); + } + if (kasEntry.rpwSetting == REUSE_PASSWORD) { + (*env)->SetIntField(env, user, user_rpwSettingField, + org_openafs_jafs_User_REUSE_PASSWORD); + } else { + (*env)->SetIntField(env, user, user_rpwSettingField, + org_openafs_jafs_User_NO_REUSE_PASSWORD); + } + (*env)->SetIntField(env, user, user_userExpirationField, + kasEntry.userExpiration); + (*env)->SetIntField(env, user, user_lastModTimeField, + kasEntry.lastModTime); + (*env)->SetIntField(env, user, user_lastChangePasswordTimeField, + kasEntry.lastChangePasswordTime); + (*env)->SetIntField(env, user, user_maxTicketLifetimeField, + kasEntry.maxTicketLifetime); + (*env)->SetIntField(env, user, user_keyVersionField, + kasEntry.keyVersion); + (*env)->SetLongField(env, user, user_keyCheckSumField, + (unsigned int)kasEntry.keyCheckSum); + (*env)->SetIntField(env, user, user_daysToPasswordExpireField, + kasEntry.daysToPasswordExpire); + (*env)->SetIntField(env, user, user_failLoginCountField, + kasEntry.failLoginCount); + (*env)->SetIntField(env, user, user_lockTimeField, kasEntry.lockTime); + (*env)->SetIntField(env, user, user_lockedUntilField, lockedUntil); + + jlastModName = + (*env)->NewStringUTF(env, kasEntry.lastModPrincipal.principal); + (*env)->SetObjectField(env, user, user_lastModNameField, + jlastModName); + + convertedKey = + (char *)malloc(sizeof(char *) * + (sizeof(kasEntry.key.key) * 4 + 1)); + if (!convertedKey) { + free(who); + throwAFSException(env, JAFSADMNOMEM); + return; + } + for (i = 0; i < sizeof(kasEntry.key.key); i++) { + sprintf(&(convertedKey[i * 4]), "\\%0.3o", kasEntry.key.key[i]); + } + jencryptionKey = (*env)->NewStringUTF(env, convertedKey); + (*env)->SetObjectField(env, user, user_encryptionKeyField, + jencryptionKey); + free(convertedKey); + } + free(who); +} + +/** + * Fills in the information fields of the provided User. + * Fills in values based on the current pts and kas information of the user. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * jname the name of the user for which to get the information + * user the User object in which to fill in the + * information + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_User_getUserInfo(JNIEnv * env, jclass cls, + jint cellHandle, jstring jname, + jobject user) +{ + char *name; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (!name) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLUSER); + return; + } + + getUserInfoChar(env, cellHandle, name, user); + + // get class fields if need be + if (userCls == 0) { + internal_getUserClass(env, user); + } + // set name in case blank object + (*env)->SetObjectField(env, user, user_nameField, jname); + + free(name); +} + +/** + * Sets the information values of this AFS user to be the parameter values. + * Sets both kas and pts fields. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * jname the name of the user for which to set the information + * user the User object containing the desired + * information + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_User_setUserInfo(JNIEnv * env, jclass cls, + jint cellHandle, jstring jname, + jobject user) +{ + char *name; + kas_identity_p who = (kas_identity_p) malloc(sizeof(kas_identity_t)); + pts_UserUpdateEntry_t ptsEntry; + afs_status_t ast; + kas_admin_t isAdmin; + kas_tgs_t grantTickets; + kas_enc_t canEncrypt; + kas_cpw_t canChangePassword; + kas_rpw_t passwordReuse; + unsigned int expirationDate; + unsigned int maxTicketLifetime; + unsigned int passwordExpires; + unsigned int failedPasswordAttempts; + unsigned int failedPasswordLockTime; + int kas; + int pts; + + if (!who) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (jname != NULL) { + name = getNativeString(env, jname); + if (name == NULL) { + free(who); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(who); + throwAFSException(env, JAFSNULLUSER); + return; + } + + // make sure the name is within the allowed bounds + if (strlen(name) > KAS_MAX_NAME_LEN) { + free(who); + free(name); + throwAFSException(env, ADMPTSUSERNAMETOOLONG); + return; + } + + internal_makeKasIdentity(name, who); + + // get class fields if need be + if (userCls == 0) { + internal_getUserClass(env, user); + } + + kas = (*env)->GetBooleanField(env, user, user_kasField); + pts = (*env)->GetBooleanField(env, user, user_ptsField); + + if (pts) { + // set the pts fields: + ptsEntry.flag = + PTS_USER_UPDATE_GROUP_CREATE_QUOTA | PTS_USER_UPDATE_PERMISSIONS; + ptsEntry.groupCreationQuota = + (*env)->GetIntField(env, user, user_groupCreationQuotaField); + if ((*env)->GetIntField(env, user, user_listStatusField) == + org_openafs_jafs_User_USER_OWNER_ACCESS) { + ptsEntry.listStatus = PTS_USER_OWNER_ACCESS; + } else { + ptsEntry.listStatus = PTS_USER_ANYUSER_ACCESS; + } + if ((*env)->GetIntField(env, user, user_listGroupsOwnedField) == + org_openafs_jafs_User_USER_OWNER_ACCESS) { + ptsEntry.listGroupsOwned = PTS_USER_OWNER_ACCESS; + } else { + ptsEntry.listGroupsOwned = PTS_USER_ANYUSER_ACCESS; + } + if ((*env)->GetIntField(env, user, user_listMembershipField) == + org_openafs_jafs_User_USER_OWNER_ACCESS) { + ptsEntry.listMembership = PTS_USER_OWNER_ACCESS; + } else { + ptsEntry.listMembership = PTS_USER_ANYUSER_ACCESS; + } + if (!pts_UserModify((void *)cellHandle, name, &ptsEntry, &ast)) { + free(who); + free(name); + throwAFSException(env, ast); + return; + } + } + + if (kas) { + // set the kas fields: + if ((*env)->GetIntField(env, user, user_adminSettingField) == + org_openafs_jafs_User_ADMIN) { + isAdmin = KAS_ADMIN; + } else { + isAdmin = NO_KAS_ADMIN; + } + if ((*env)->GetIntField(env, user, user_tgsSettingField) == + org_openafs_jafs_User_GRANT_TICKETS) { + grantTickets = TGS; + } else { + grantTickets = NO_TGS; + } + if ((*env)->GetIntField(env, user, user_encSettingField) == + org_openafs_jafs_User_ENCRYPT) { + canEncrypt = 0; + } else { + canEncrypt = NO_ENCRYPT; + } + if ((*env)->GetIntField(env, user, user_cpwSettingField) == + org_openafs_jafs_User_CHANGE_PASSWORD) { + canChangePassword = CHANGE_PASSWORD; + } else { + canChangePassword = NO_CHANGE_PASSWORD; + } + if ((*env)->GetIntField(env, user, user_rpwSettingField) == + org_openafs_jafs_User_REUSE_PASSWORD) { + passwordReuse = REUSE_PASSWORD; + } else { + passwordReuse = NO_REUSE_PASSWORD; + } + expirationDate = + (*env)->GetIntField(env, user, user_userExpirationField); + maxTicketLifetime = + (*env)->GetIntField(env, user, user_maxTicketLifetimeField); + passwordExpires = + (*env)->GetIntField(env, user, user_daysToPasswordExpireField); + failedPasswordAttempts = + (*env)->GetIntField(env, user, user_failLoginCountField); + failedPasswordLockTime = + (*env)->GetIntField(env, user, user_lockTimeField); + + + if (!kas_PrincipalFieldsSet + ((void *)cellHandle, NULL, who, &isAdmin, &grantTickets, + &canEncrypt, &canChangePassword, &expirationDate, + &maxTicketLifetime, &passwordExpires, &passwordReuse, + &failedPasswordAttempts, &failedPasswordLockTime, &ast)) { + throwAFSException(env, ast); + } + } + + free(who); + free(name); +} + +/** + * Renames the given user. Does not update the info fields of the kas entry + * -- the calling code is responsible for that. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * joldName the name of the user to rename + * jnewName the new name for the user + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_User_rename(JNIEnv * env, jclass cls, jint cellHandle, + jstring joldName, jstring jnewName) +{ + char *oldName; + char *newName; + kas_identity_p whoOld = (kas_identity_p) malloc(sizeof(kas_identity_t)); + kas_identity_p whoNew = (kas_identity_p) malloc(sizeof(kas_identity_t)); + kas_principalEntry_t kasEntry; + pts_UserEntry_t ptsEntry; + afs_status_t ast; + int kas; + + if (!whoOld || !whoNew) { + if (whoOld) { + free(whoOld); + } + if (whoNew) { + free(whoNew); + } + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (joldName != NULL) { + oldName = getNativeString(env, joldName); + if (oldName == NULL) { + free(whoOld); + free(whoNew); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + oldName = NULL; + } + if (jnewName != NULL) { + newName = getNativeString(env, jnewName); + if (newName == NULL) { + free(whoOld); + free(whoNew); + if (oldName != NULL) + free(oldName); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + newName = NULL; + } + + // make sure the names are within the allowed bounds + if ((oldName != NULL && strlen(oldName) > KAS_MAX_NAME_LEN) + || (newName != NULL && strlen(newName) > KAS_MAX_NAME_LEN)) { + free(whoOld); + free(whoNew); + if (oldName != NULL) + free(oldName); + if (newName != NULL) + free(newName); + throwAFSException(env, ADMPTSUSERNAMETOOLONG); + return; + } + + if (oldName != NULL) { + internal_makeKasIdentity(oldName, whoOld); + } + if (newName != NULL) { + internal_makeKasIdentity(newName, whoNew); + } + // retrieve the old kas info + if (!kas_PrincipalGet((void *)cellHandle, NULL, whoOld, &kasEntry, &ast)) { + if (ast != KANOENT) { + free(whoOld); + free(whoNew); + if (oldName != NULL) + free(oldName); + if (newName != NULL) + free(newName); + throwAFSException(env, ast); + return; + } else { + kas = FALSE; + } + } else { + kas = TRUE; + } + + if (kas) { + // create a new kas entry + // temporarily set the password equal to the new name + if (!kas_PrincipalCreate + ((void *)cellHandle, NULL, whoNew, newName, &ast)) { + free(whoOld); + free(whoNew); + if (oldName != NULL) + free(oldName); + if (newName != NULL) + free(newName); + throwAFSException(env, ast); + return; + } + // set the password + ast = 0; + // For some reason kas_PrincipalKeySet doesn't set the return code + // correctly. It always returns 0. + // So instead of checking the return code, we see if there's an + // error in the status variable. + kas_PrincipalKeySet((void *)cellHandle, NULL, whoNew, 0, + &(kasEntry.key), &ast); + if (ast) { + afs_status_t ast_kd; + kas_PrincipalDelete((void *)cellHandle, NULL, whoNew, &ast_kd); + free(whoOld); + free(whoNew); + if (oldName != NULL) + free(oldName); + if (newName != NULL) + free(newName); + throwAFSException(env, ast); + return; + } + } + // rename the pts entry + if (!pts_UserRename((void *)cellHandle, oldName, newName, &ast)) { + // throw exception if there was no such pts user only if + // there was also no such kas user + if ((ast == ADMPTSFAILEDNAMETRANSLATE && !kas) + || ast != ADMPTSFAILEDNAMETRANSLATE) { + afs_status_t ast_kd; + if (kas) { + kas_PrincipalDelete((void *)cellHandle, NULL, whoNew, + &ast_kd); + } + free(whoOld); + free(whoNew); + if (oldName != NULL) + free(oldName); + if (newName != NULL) + free(newName); + throwAFSException(env, ast); + return; + } + } + + if (kas) { + // delete the old kas entry + if (!kas_PrincipalDelete((void *)cellHandle, NULL, whoOld, &ast)) { + free(whoOld); + free(whoNew); + if (oldName != NULL) + free(oldName); + if (newName != NULL) + free(newName); + throwAFSException(env, ast); + return; + } + } + + free(whoOld); + free(whoNew); + if (oldName != NULL) + free(oldName); + if (newName != NULL) + free(newName); +} + +/** + * Sets the password of the given user. Sets the key version to 0. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * jusername the name of the user for which to set the password + * jnewPassword the new password for the user + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_User_setPassword(JNIEnv * env, jclass cls, + jint cellHandle, jstring jusername, + jstring jnewPassword) +{ + afs_status_t ast; + char *cellName; + char *username; + char *newPassword; + kas_encryptionKey_p newKey = + (kas_encryptionKey_p) malloc(sizeof(kas_encryptionKey_t)); + kas_identity_p who = (kas_identity_p) malloc(sizeof(kas_identity_t)); + + if (!who || !newKey) { + if (who) { + free(who); + } + if (newKey) { + free(newKey); + } + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (jusername != NULL) { + username = getNativeString(env, jusername); + if (username == NULL) { + free(who); + free(newKey); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(who); + free(newKey); + throwAFSException(env, JAFSNULLUSER); + return; + } + + if (jnewPassword != NULL) { + newPassword = getNativeString(env, jnewPassword); + if (newPassword == NULL) { + free(who); + free(newKey); + free(username); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + free(who); + free(newKey); + free(username); + throwAFSException(env, JAFSNULLPASS); + return; + } + + // make sure the name is within the allowed bounds + if (strlen(username) > KAS_MAX_NAME_LEN) { + free(who); + free(newKey); + free(username); + free(newPassword); + throwAFSException(env, ADMPTSUSERNAMETOOLONG); + return; + } + + if (!afsclient_CellNameGet((void *)cellHandle, &cellName, &ast)) { + free(who); + free(newKey); + free(username); + free(newPassword); + throwAFSException(env, ast); + return; + } + + if (!kas_StringToKey(cellName, newPassword, newKey, &ast)) { + free(who); + free(newKey); + free(username); + free(newPassword); + throwAFSException(env, ast); + return; + } + + internal_makeKasIdentity(username, who); + + ast = 0; + // For some reason kas_PrincipalKeySet doesn't set the return code correctly. + // It always returns 0. + // So instead of checking the return code, we see if there's an error + // in the status variable. + kas_PrincipalKeySet((void *)cellHandle, NULL, who, 0, newKey, &ast); + if (ast) { + throwAFSException(env, ast); + } + + free(who); + free(newKey); + free(username); + free(newPassword); +} + +/** + * Begin the process of getting the groups to which the user belongs. + * Returns an iteration ID to be used by subsequent calls to + * getUserGroupsNext and getUserGroupsDone. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * jname the name of the user for which to get the groups + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_User_getUserGroupsBegin(JNIEnv * env, jclass cls, + jint cellHandle, jstring jname) +{ + char *name; + afs_status_t ast; + void *iterationId; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (name == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLUSER); + return; + } + + if (!pts_UserMemberListBegin + ((void *)cellHandle, name, &iterationId, &ast)) { + throwAFSException(env, ast); + } + + free(name); + + return (jint) iterationId; +} + +/** + * Returns the next group to which the user belongs. Returns + * null if there are no more groups. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * returns the name of the next group + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_User_getUserGroupsNextString(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + char *groupName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + jstring jgroup; + + if (!groupName) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (!pts_UserMemberListNext((void *)iterationId, groupName, &ast)) { + free(groupName); + if (ast == ADMITERATORDONE) { + return NULL; + } else { + throwAFSException(env, ast); + return; + } + } + + jgroup = (*env)->NewStringUTF(env, groupName); + free(groupName); + return jgroup; +} + +/** + * Fills the next group object of which the user belongs. Returns 0 if there + * are no more groups, != 0 otherwise. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * iterationId the iteration ID of this iteration + * jgroupObject a Group object to be populated with the values of the + * next group + * returns 0 if there are no more users, != 0 otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_User_getUserGroupsNext(JNIEnv * env, jclass cls, + jint cellHandle, + jint iterationId, + jobject jgroupObject) +{ + afs_status_t ast; + char *groupName; + jstring jgroup; + + groupName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + + if (!groupName) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (!pts_UserMemberListNext((void *)iterationId, groupName, &ast)) { + free(groupName); + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + + jgroup = (*env)->NewStringUTF(env, groupName); + + if (groupCls == 0) { + internal_getGroupClass(env, jgroupObject); + } + + (*env)->SetObjectField(env, jgroupObject, group_nameField, jgroup); + + getGroupInfoChar(env, (void *)cellHandle, groupName, jgroupObject); + (*env)->SetBooleanField(env, jgroupObject, group_cachedInfoField, TRUE); + + free(groupName); + return 1; + +} + +/** + * Signals that the iteration is complete and will not be accessed anymore. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_User_getUserGroupsDone(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + + if (!pts_UserMemberListDone((void *)iterationId, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Returns the total number of groups owned by the user. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * jname the name of the user for which to get the groups + * returns total number of groups owned by the user + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_User_getGroupsOwnedCount(JNIEnv * env, jclass cls, + jint cellHandle, jstring jname) +{ + afs_status_t ast; + void *iterationId; + char *groupName; + int i = 0; + + iterationId = + (void *)Java_org_openafs_jafs_User_getGroupsOwnedBegin(env, cls, + cellHandle, + jname); + + groupName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + + if (!groupName) { + throwAFSException(env, JAFSADMNOMEM); + return -1; + } + + while (pts_OwnedGroupListNext((void *)iterationId, groupName, &ast)) + i++; + + free(groupName); + + if (ast != ADMITERATORDONE) { + throwAFSException(env, ast); + return -1; + } + + return i; +} + +/** + * Begin the process of getting the groups that a user or group owns. + * Returns an iteration ID to be used by subsequent calls to + * getGroupsOwnedNext and getGroupsOwnedDone. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the user belongs + * jname the name of the user or group for which to get the groups + * returns an iteration ID + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_User_getGroupsOwnedBegin(JNIEnv * env, jclass cls, + jint cellHandle, jstring jname) +{ + char *name; + afs_status_t ast; + void *iterationId; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (name == NULL) { + throwAFSException(env, JAFSADMNOMEM); + return -1; + } + } else { + throwAFSException(env, JAFSNULLUSER); + return -1; + } + + if (!pts_OwnedGroupListBegin + ((void *)cellHandle, name, &iterationId, &ast)) { + throwAFSException(env, ast); + } + + free(name); + + return (jint) iterationId; +} + +/** + * Returns the next group the user or group owns. Returns null + * if there are no more groups. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + * returns the name of the next group + */ +JNIEXPORT jstring JNICALL +Java_org_openafs_jafs_User_getGroupsOwnedNextString(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + char *groupName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + jstring jgroup; + + if (!groupName) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + + if (!pts_OwnedGroupListNext((void *)iterationId, groupName, &ast)) { + free(groupName); + if (ast == ADMITERATORDONE) { + return NULL; + } else { + throwAFSException(env, ast); + return NULL; + } + } + + jgroup = (*env)->NewStringUTF(env, groupName); + free(groupName); + return jgroup; + +} + +/** + * Fills the next group object that the user or group owns. Returns 0 if + * there are no more groups, != 0 otherwise. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the users belong + * iterationId the iteration ID of this iteration + * jgroupObject a Group object to be populated with the values of the + * next group + * returns 0 if there are no more users, != 0 otherwise + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_User_getGroupsOwnedNext(JNIEnv * env, jclass cls, + jint cellHandle, + jint iterationId, + jobject jgroupObject) +{ + afs_status_t ast; + char *groupName; + jstring jgroup; + + groupName = (char *)malloc(sizeof(char) * PTS_MAX_NAME_LEN); + + if (!groupName) { + throwAFSException(env, JAFSADMNOMEM); + return 0; + } + + if (!pts_OwnedGroupListNext((void *)iterationId, groupName, &ast)) { + free(groupName); + if (ast == ADMITERATORDONE) { + return 0; + } else { + throwAFSException(env, ast); + return 0; + } + } + + jgroup = (*env)->NewStringUTF(env, groupName); + + if (groupCls == 0) { + internal_getGroupClass(env, jgroupObject); + } + + (*env)->SetObjectField(env, jgroupObject, group_nameField, jgroup); + + getGroupInfoChar(env, (void *)cellHandle, groupName, jgroupObject); + (*env)->SetBooleanField(env, jgroupObject, group_cachedInfoField, TRUE); + + free(groupName); + return 1; + +} + +/** + * Signals that the iteration is complete and will not be accessed anymore. + * + * env the Java environment + * cls the current Java class + * iterationId the iteration ID of this iteration + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_User_getGroupsOwnedDone(JNIEnv * env, jclass cls, + jint iterationId) +{ + afs_status_t ast; + + if (!pts_OwnedGroupListDone((void *)iterationId, &ast)) { + throwAFSException(env, ast); + return; + } +} + +// reclaim global memory being used by this portion +JNIEXPORT void JNICALL +Java_org_openafs_jafs_User_reclaimUserMemory(JNIEnv * env, jclass cls) +{ + if (userCls) { + (*env)->DeleteGlobalRef(env, userCls); + userCls = 0; + } +} diff --git a/src/JAVA/libjafs/UserToken.c b/src/JAVA/libjafs/UserToken.c new file mode 100644 index 000000000..1bd597fd5 --- /dev/null +++ b/src/JAVA/libjafs/UserToken.c @@ -0,0 +1,325 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 + +#include "Internal.h" +#include "org_openafs_jafs_Token.h" + +#include +#include +#include +#include +#include +/*#include + #include */ +#include + +#ifdef DMALLOC +#include "dmalloc.h" +#endif + +pthread_mutex_t jafs_init_lock; + +extern pthread_mutex_t jafs_login_lock; + +extern int readCacheParms(char *afsMountPoint, char *afsConfDir, + char *afsCacheDir, int *cacheBlocks, + int *cacheFiles, int *cacheStatEntries, + int *dCacheSize, int *vCacheSize, int *chunkSize, + int *closeSynch, int *debug, int *nDaemons, + int *cacheFlags, char *logFile); + +/** + * Be carefull with the memory management: + * + * - For every getNativeString call the corresponding free(). + * - For every GetArrayElements call the corresponding + * ReleaseArrayElements + * - For every malloc call the corresponding free. + */ + +int +osi_audit(void) +{ + return 0; +} + +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Token_callDebugger(JNIEnv * env, jobject obj) +{ + fprintf(stderr, "callDebugger called\n"); + __asm__("int $0x3"); +} + +/** + * Initialize the user space library. + * + * The user space client must be initialized prior to any + * user space related methods, including: klog, unlog, relog, + * and shutdown. + * + * env the Java environment + * cls the current Java class + * + * throws AFSException + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Token_initUserSpace(JNIEnv * env, jclass cls) +{ + char afsMountPoint[100], afsConfDir[100], afsCacheDir[100], logFile[100]; + jfieldID fid; + int pagval; + + /* Initialize each init parameter with its associated default value */ + int cacheBlocks = 100000; + int cacheFiles = 12500; + int cacheStatEntries = 8192; + int dCacheSize = 11398; + int vCacheSize = 128; + int chunkSize = 0; + int closeSynch = 0; + int debug = 0; + int nDaemons = 3; + int cacheFlags = -1; + + /* Initialize each init parameter with its associated default value */ + strcpy(afsMountPoint, "/afs"); + strcpy(afsConfDir, "/usr/afswsp/etc"); + strcpy(afsCacheDir, "/usr/afswsp/cache"); + strcpy(logFile, "/usr/afswsp/log/libjafs.log"); + + pthread_mutex_init(&jafs_init_lock, NULL); + pthread_mutex_lock(&jafs_init_lock); + + readCacheParms(afsMountPoint, afsConfDir, afsCacheDir, &cacheBlocks, + &cacheFiles, &cacheStatEntries, &dCacheSize, &vCacheSize, + &chunkSize, &closeSynch, &debug, &nDaemons, &cacheFlags, + logFile); + + /* See cache.tune for configuration details */ + if (debug) { + fprintf(stderr, "uafs_Init(\"init_native\", \"%s\", \"%s\", \"%s\", + %d, %d, %d, + %d, %d, %d, + %d, %d, %d, %d, \"%s\");\n", afsMountPoint, afsConfDir, afsCacheDir, cacheBlocks, cacheFiles, cacheStatEntries, dCacheSize, vCacheSize, chunkSize, closeSynch, debug, nDaemons, cacheFlags, logFile); + } + uafs_Init("init_native", afsMountPoint, afsConfDir, afsCacheDir, + cacheBlocks, cacheFiles, cacheStatEntries, dCacheSize, + vCacheSize, chunkSize, closeSynch, debug, nDaemons, cacheFlags, + logFile); + + + /* make the initial pag the unauthenticated pag */ + afs_setpag(); + uafs_unlog(); + pagval = afs_getpag_val(); + + fid = (*env)->GetStaticFieldID(env, cls, "ANYUSER_PAG_ID", "I"); + if (fid == 0) { + fprintf(stderr, + "UserToken::init(): GetFieldID (ANYUSER_PAG_ID) failed\n"); + return; + } + + (*env)->SetStaticIntField(env, cls, fid, pagval); + + pthread_mutex_unlock(&jafs_init_lock); +} + +/** + * Authenticates a user in kas, and binds that authentication + * to the current process. + * + * env the Java environment + * obj the current Java class + * loginUTF the login to authenticate (expected as username@cellname) + * passwordUTF the password of the login + * id the existing pag (or 0) + * + * returns the assigned pag + * + * throws AFSException + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Token_klog(JNIEnv * env, jobject obj, jstring jusername, + jstring jpassword, jstring jcell, jint id) +{ + char *username; + char *password; + char *cell; + char *reason; + int code; + jint rc = -1; + + if (jcell != NULL) { + cell = getNativeString(env, jcell); + if (!cell) { + fprintf(stderr, "UserToken::klog(): failed to get cell name\n"); + throwMessageException(env, + "Internal error, failed to translate cell name."); + return -1; + } + } else { + cell = NULL; + } + + if (jusername != NULL) { + username = getNativeString(env, jusername); + if (!username) { + if (cell != NULL) + free(cell); + fprintf(stderr, "UserToken::klog(): failed to get username\n"); + throwMessageException(env, + "Internal error, failed to translate username."); + return -1; + } + } else { + if (cell != NULL) + free(cell); + throwAFSException(env, JAFSNULLUSER); + return -1; + } + + if (jpassword != NULL) { + password = getNativeString(env, jpassword); + if (!password) { + if (cell != NULL) + free(cell); + free(username); + fprintf(stderr, "UserToken::klog(): failed to get password\n"); + throwMessageException(env, + "Internal error, failed to translate password."); + return -1; + } + } else { + if (cell != NULL) + free(cell); + free(username); + throwAFSException(env, JAFSNULLPASS); + return -1; + } + + if (id == 0) { + code = uafs_klog(username, cell, password, &reason); + } else { + /* Use existing PAG for this thread */ + code = afs_setpag_val(id); + if (code != 0) + code = 180492L; /* KABADARGUMENT */ + if (!code) + code = uafs_klog_nopag(username, cell, password, &reason); + } + + if (code != 0) { + if (cell != NULL) + free(cell); + if (username != NULL) + free(username); + if (password != NULL) + free(password); + fprintf(stderr, + "UserToken::klog(): uafs_klog failed to cell %s: %s\n", cell, + reason); + fprintf(stderr, "code = %d\n", code); + throwAFSException(env, code); + return -1; + } + + /* Get the PAG we were assigned as the return value */ + rc = afs_getpag_val(); + + /* clean up */ + if (cell != NULL) + free(cell); + if (username != NULL) + free(username); + if (password != NULL) + free(password); + + /* return PAG ID */ + return rc; +} + +/** + * Authenticates a user in KAS by a previously acquired PAG ID, and binds + * that authentication to the current thread or native process. + * + *

    This method does not require the user's username and password to + * fully authenticate their request. Rather it utilizes the user's PAG ID + * to recapture the user's existing credentials. + * + * env the Java environment + * obj the current Java class + * id User's current PAG (process authentication group) ID + * + * throws AFSException + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Token_relog(JNIEnv * env, jobject obj, jint id) +{ + int rc; + + rc = afs_setpag_val(id); + + if (rc != 0) { + throwAFSException(env, rc); + } +} + +/** + * Authenticates a user in KAS, and binds that authentication + * to the current process. + * + * env the Java environment + * obj the current Java class + * + * throws AFSException + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Token_unlog(JNIEnv * env, jobject obj) +{ + int rc; + + rc = uafs_unlog(); + + if (rc != 0) { + throwAFSException(env, rc); + } +} + +/** + * Inform the native library that the application is + * shutting down and will be unloading. + * + *

    The library will make a call informing the file server that it will + * no longer be available for callbacks. + * + * env the Java environment + * obj the current Java class + * + * throws AFSException + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Token_shutdown(JNIEnv * env, jobject obj) +{ + uafs_Shutdown(); +} diff --git a/src/JAVA/libjafs/Volume.c b/src/JAVA/libjafs/Volume.c new file mode 100644 index 000000000..ef2f3c432 --- /dev/null +++ b/src/JAVA/libjafs/Volume.c @@ -0,0 +1,829 @@ +/* + * Copyright (c) 2001-2002 International Business Machines Corp. + * All rights reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 REGENTS 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 "Internal.h" +#include "org_openafs_jafs_Volume.h" + +#include +#include + +//// definitions in Internal.c ////////////////// + +extern jclass volumeCls; +extern jfieldID volume_nameField; +extern jfieldID volume_idField; +extern jfieldID volume_readWriteIdField; +extern jfieldID volume_readOnlyIdField; +extern jfieldID volume_backupIdField; +extern jfieldID volume_creationDateField; +extern jfieldID volume_lastAccessDateField; +extern jfieldID volume_lastUpdateDateField; +extern jfieldID volume_lastBackupDateField; +extern jfieldID volume_copyCreationDateField; +extern jfieldID volume_accessesSinceMidnightField; +extern jfieldID volume_fileCountField; +extern jfieldID volume_maxQuotaField; +extern jfieldID volume_currentSizeField; +extern jfieldID volume_statusField; +extern jfieldID volume_dispositionField; +extern jfieldID volume_typeField; + +////////////////////////////////////////////////////////// + +/** + * Extract the information from the given volume entry and populate the + * given object + * + * env the Java environment + * volume the Volume object to populate with the info + * volEntry the container of the volume's information + */ +extern void +fillVolumeInfo(JNIEnv * env, jobject volume, vos_volumeEntry_t volEntry) +{ + jstring jvolume; + + // get the class fields if need be + if (volumeCls == 0) { + internal_getVolumeClass(env, volume); + } + // set name, just in case it was a completely blank object + jvolume = (*env)->NewStringUTF(env, volEntry.name); + (*env)->SetObjectField(env, volume, volume_nameField, jvolume); + + (*env)->SetIntField(env, volume, volume_idField, volEntry.id); + (*env)->SetIntField(env, volume, volume_readWriteIdField, + volEntry.readWriteId); + (*env)->SetIntField(env, volume, volume_readOnlyIdField, + volEntry.readOnlyId); + (*env)->SetIntField(env, volume, volume_backupIdField, volEntry.backupId); + (*env)->SetLongField(env, volume, volume_creationDateField, + volEntry.creationDate); + (*env)->SetLongField(env, volume, volume_lastAccessDateField, + volEntry.lastAccessDate); + (*env)->SetLongField(env, volume, volume_lastUpdateDateField, + volEntry.lastUpdateDate); + (*env)->SetLongField(env, volume, volume_lastBackupDateField, + volEntry.lastBackupDate); + (*env)->SetLongField(env, volume, volume_copyCreationDateField, + volEntry.copyCreationDate); + (*env)->SetIntField(env, volume, volume_accessesSinceMidnightField, + volEntry.accessesSinceMidnight); + (*env)->SetIntField(env, volume, volume_fileCountField, + volEntry.fileCount); + (*env)->SetIntField(env, volume, volume_maxQuotaField, volEntry.maxQuota); + (*env)->SetIntField(env, volume, volume_currentSizeField, + volEntry.currentSize); + + // set status variable + switch (volEntry.status) { + case VOS_OK: + (*env)->SetIntField(env, volume, volume_statusField, + org_openafs_jafs_Volume_VOLUME_OK); + break; + case VOS_SALVAGE: + (*env)->SetIntField(env, volume, volume_statusField, + org_openafs_jafs_Volume_VOLUME_SALVAGE); + break; + case VOS_NO_VNODE: + (*env)->SetIntField(env, volume, volume_statusField, + org_openafs_jafs_Volume_VOLUME_NO_VNODE); + break; + case VOS_NO_VOL: + (*env)->SetIntField(env, volume, volume_statusField, + org_openafs_jafs_Volume_VOLUME_NO_VOL); + break; + case VOS_VOL_EXISTS: + (*env)->SetIntField(env, volume, volume_statusField, + org_openafs_jafs_Volume_VOLUME_VOL_EXISTS); + break; + case VOS_NO_SERVICE: + (*env)->SetIntField(env, volume, volume_statusField, + org_openafs_jafs_Volume_VOLUME_NO_SERVICE); + break; + case VOS_OFFLINE: + (*env)->SetIntField(env, volume, volume_statusField, + org_openafs_jafs_Volume_VOLUME_OFFLINE); + break; + case VOS_ONLINE: + (*env)->SetIntField(env, volume, volume_statusField, + org_openafs_jafs_Volume_VOLUME_ONLINE); + break; + case VOS_DISK_FULL: + (*env)->SetIntField(env, volume, volume_statusField, + org_openafs_jafs_Volume_VOLUME_DISK_FULL); + break; + case VOS_OVER_QUOTA: + (*env)->SetIntField(env, volume, volume_statusField, + org_openafs_jafs_Volume_VOLUME_OVER_QUOTA); + break; + case VOS_BUSY: + (*env)->SetIntField(env, volume, volume_statusField, + org_openafs_jafs_Volume_VOLUME_BUSY); + break; + case VOS_MOVED: + (*env)->SetIntField(env, volume, volume_statusField, + org_openafs_jafs_Volume_VOLUME_MOVED); + break; + default: + throwAFSException(env, volEntry.status); + } + + // set disposition variable + switch (volEntry.volumeDisposition) { + case VOS_OK: + (*env)->SetIntField(env, volume, volume_dispositionField, + org_openafs_jafs_Volume_VOLUME_OK); + break; + case VOS_SALVAGE: + (*env)->SetIntField(env, volume, volume_dispositionField, + org_openafs_jafs_Volume_VOLUME_SALVAGE); + break; + case VOS_NO_VNODE: + (*env)->SetIntField(env, volume, volume_dispositionField, + org_openafs_jafs_Volume_VOLUME_NO_VNODE); + break; + case VOS_NO_VOL: + (*env)->SetIntField(env, volume, volume_dispositionField, + org_openafs_jafs_Volume_VOLUME_NO_VOL); + break; + case VOS_VOL_EXISTS: + (*env)->SetIntField(env, volume, volume_dispositionField, + org_openafs_jafs_Volume_VOLUME_VOL_EXISTS); + break; + case VOS_NO_SERVICE: + (*env)->SetIntField(env, volume, volume_dispositionField, + org_openafs_jafs_Volume_VOLUME_NO_SERVICE); + break; + case VOS_OFFLINE: + (*env)->SetIntField(env, volume, volume_dispositionField, + org_openafs_jafs_Volume_VOLUME_OFFLINE); + break; + case VOS_ONLINE: + (*env)->SetIntField(env, volume, volume_dispositionField, + org_openafs_jafs_Volume_VOLUME_ONLINE); + break; + case VOS_DISK_FULL: + (*env)->SetIntField(env, volume, volume_dispositionField, + org_openafs_jafs_Volume_VOLUME_DISK_FULL); + break; + case VOS_OVER_QUOTA: + (*env)->SetIntField(env, volume, volume_dispositionField, + org_openafs_jafs_Volume_VOLUME_OVER_QUOTA); + break; + case VOS_BUSY: + (*env)->SetIntField(env, volume, volume_dispositionField, + org_openafs_jafs_Volume_VOLUME_BUSY); + break; + case VOS_MOVED: + (*env)->SetIntField(env, volume, volume_dispositionField, + org_openafs_jafs_Volume_VOLUME_MOVED); + break; + default: + throwAFSException(env, volEntry.volumeDisposition); + } + + // set type variable + switch (volEntry.type) { + case VOS_READ_WRITE_VOLUME: + (*env)->SetIntField(env, volume, volume_typeField, + org_openafs_jafs_Volume_VOLUME_TYPE_READ_WRITE); + break; + case VOS_READ_ONLY_VOLUME: + (*env)->SetIntField(env, volume, volume_typeField, + org_openafs_jafs_Volume_VOLUME_TYPE_READ_ONLY); + break; + case VOS_BACKUP_VOLUME: + (*env)->SetIntField(env, volume, volume_typeField, + org_openafs_jafs_Volume_VOLUME_TYPE_BACKUP); + break; + default: + throwAFSException(env, volEntry.type); + } + +} + +/** + * Fills in the information fields of the provided Volume. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the volume belongs + * serverHandle the vos handle of the server on which the volume + * resides + * partition the numeric id of the partition on which the volume + * resides + * volId the numeric id of the volume for which to get the info + * jvolumeObject the Volume object in which to fill in + * the information + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_getVolumeInfo(JNIEnv * env, jclass cls, + jint cellHandle, jint serverHandle, + jint partition, jint volID, + jobject jvolumeObject) +{ + afs_status_t ast; + vos_volumeEntry_t volEntry; + + // get the volume entry + if (!vos_VolumeGet + ((void *)cellHandle, (void *)serverHandle, NULL, + (unsigned int)partition, (unsigned int)volID, &volEntry, &ast)) { + throwAFSException(env, ast); + return; + } + + fillVolumeInfo(env, jvolumeObject, volEntry); +} + +/** + * Creates a volume on a particular partition. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell in which to create the volume + * serverHandle the vos handle of the server on which to create + * the volume + * partition the numeric id of the partition on which to create + * the volume + * jvolName the name of the volume to create + * quota the amount of space (in KB) to set as this volume's quota + * returns the numeric ID assigned to the volume + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Volume_create(JNIEnv * env, jclass cls, jint cellHandle, + jint serverHandle, jint partition, + jstring jvolName, jint quota) +{ + afs_status_t ast; + char *volName; + int id; + + if (jvolName != NULL) { + volName = getNativeString(env, jvolName); + if (!volName) { + throwAFSException(env, JAFSADMNOMEM); + return -1; + } + } else { + throwAFSException(env, JAFSNULLVOLUME); + return -1; + } + + if (!vos_VolumeCreate + ((void *)cellHandle, (void *)serverHandle, NULL, + (unsigned int)partition, volName, (unsigned int)quota, &id, &ast)) { + throwAFSException(env, ast); + } + + free(volName); + + return (jint) id; +} + +/** + * Deletes a volume from a particular partition. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell in which to delete the volume + * serverHandle the vos handle of the server from which to delete + * the volume + * partition the numeric id of the partition from which to delete + * the volume + * volId the numeric id of the volume to delete + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_delete(JNIEnv * env, jclass cls, jint cellHandle, + jint serverHandle, jint partition, + jint volID) +{ + afs_status_t ast; + + if (!vos_VolumeDelete + ((void *)cellHandle, (void *)serverHandle, NULL, + (unsigned int)partition, (unsigned int)volID, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Creates a backup volume for the specified regular volume. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the volume belongs + * volId the numeric id of the volume for which to create a backup + * volume + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_createBackupVolume(JNIEnv * env, jclass cls, + jint cellHandle, jint volID) +{ + afs_status_t ast; + + if (!vos_BackupVolumeCreate + ((void *)cellHandle, NULL, (unsigned int)volID, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Creates a read-only volume for the specified regular volume. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the volume belongs + * serverHandle the vos handle of the server on which the read-only + * volume is to reside + * partition the numeric id of the partition on which the read-only + * volume is to reside + * volId the numeric id of the volume for which to + * create a read-only volume + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_createReadOnlyVolume(JNIEnv * env, jclass cls, + jint cellHandle, + jint serverHandle, + jint partition, jint volID) +{ + afs_status_t ast; + + if (!vos_VLDBReadOnlySiteCreate + ((void *)cellHandle, (void *)serverHandle, NULL, + (unsigned int)partition, (unsigned int)volID, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Deletes a read-only volume for the specified regular volume. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the volume belongs + * serverHandle the vos handle of the server on which the read-only + * volume residea + * partition the numeric id of the partition on which the read-only + * volume resides + * volId the numeric read-write id of the volume for which to + * delete the read-only volume + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_deleteReadOnlyVolume(JNIEnv * env, jclass cls, + jint cellHandle, + jint serverHandle, + jint partition, jint volID) +{ + afs_status_t ast; + + if (!vos_VLDBReadOnlySiteDelete + ((void *)cellHandle, (void *)serverHandle, NULL, + (unsigned int)partition, (unsigned int)volID, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Changes the quota of the specified volume. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the volume belongs + * serverHandle the vos handle of the server on which the volume + * resides + * partition the numeric id of the partition on which the volume + * resides + * volId the numeric id of the volume for which to change the quota + * newQuota the new quota (in KB) to assign the volume + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_changeQuota(JNIEnv * env, jclass cls, + jint cellHandle, jint serverHandle, + jint partition, jint volID, + jint newQuota) +{ + afs_status_t ast; + + if (!vos_VolumeQuotaChange + ((void *)cellHandle, (void *)serverHandle, NULL, + (unsigned int)partition, (unsigned int)volID, (unsigned int)newQuota, + &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Move the specified volume to a different site. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the volume belongs + * fromServerHandle the vos handle of the server on which the volume + * currently resides + * fromPartition the numeric id of the partition on which the volume + * currently resides + * toServerHandle the vos handle of the server to which the volume + * should be moved + * toPartition the numeric id of the partition to which the volume + * should be moved + * volId the numeric id of the volume to move + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_move(JNIEnv * env, jclass cls, jint cellHandle, + jint fromServerHandle, jint fromPartition, + jint toServerHandle, jint toPartition, + jint volID) +{ + afs_status_t ast; + + if (!vos_VolumeMove + ((void *)cellHandle, NULL, (unsigned int)volID, + (void *)fromServerHandle, (unsigned int)fromPartition, + (void *)toServerHandle, (unsigned int)toPartition, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Releases the specified volume that has readonly volume sites. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the volume belongs + * volId the numeric id of the volume to release + * forceComplete whether or not to force a complete release + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_release(JNIEnv * env, jclass cls, + jint cellHandle, jint volID, + jboolean forceComplete) +{ + afs_status_t ast; + vos_force_t force; + + if (forceComplete) { + force = VOS_FORCE; + } else { + force = VOS_NORMAL; + } + + if (!vos_VolumeRelease + ((void *)cellHandle, NULL, (unsigned int)volID, force, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Dumps the specified volume to a file. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the volume belongs + * serverHandle the vos handle of the server on which the volume + * resides + * partition the numeric id of the partition on which the + * volume resides + * volId the numeric id of the volume to dump + * startTime files with a modification time >= to this time will + * be dumped + * jdumpFile the full path of the file to which to dump + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_dump(JNIEnv * env, jclass cls, jint cellHandle, + jint serverHandle, jint partition, + jint volID, jint startTime, + jstring jdumpFile) +{ + afs_status_t ast; + char *dumpFile; + + if (jdumpFile != NULL) { + dumpFile = getNativeString(env, jdumpFile); + if (!dumpFile) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLARG); + return; + } + + if (!vos_VolumeDump + ((void *)cellHandle, (void *)serverHandle, NULL, + (unsigned int *)&partition, (unsigned int)volID, + (unsigned int)startTime, dumpFile, &ast)) { + throwAFSException(env, ast); + } + + free(dumpFile); +} + +/** + * Restores the specified volume from a dump file. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the volume belongs + * serverHandle the vos handle of the server on which the volume is + * to reside + * partition the numeric id of the partition on which the volume is + * to reside + * volId the numeric id to assign the restored volume (can be 0) + * jvolName the name of the volume to restore as + * jdumpFile the full path of the dump file from which to restore + * incremental if true, restores an incremental dump over an existing + * volume (server and partition values must correctly + * indicate the current position of the existing volume), + * otherwise restores a full dump + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_restore(JNIEnv * env, jclass cls, + jint cellHandle, jint serverHandle, + jint partition, jint volID, + jstring jvolName, jstring jdumpFile, + jboolean incremental) +{ + afs_status_t ast; + char *volName; + char *dumpFile; + int *volumeIDp; + vos_volumeRestoreType_t vrt; + + if (jvolName != NULL) { + volName = getNativeString(env, jvolName); + if (!volName) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLVOLUME); + return; + } + + if (jdumpFile != NULL) { + dumpFile = getNativeString(env, jdumpFile); + if (!dumpFile) { + free(volName); + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + dumpFile = NULL; + } + + if (volID == 0) { + volumeIDp = NULL; + } else { + volumeIDp = (int *)&volID; + } + + if (incremental) { + vrt = VOS_RESTORE_INCREMENTAL; + } else { + vrt = VOS_RESTORE_FULL; + } + + if (!vos_VolumeRestore + ((void *)cellHandle, (void *)serverHandle, NULL, + (unsigned int)partition, (unsigned int *)volumeIDp, volName, + dumpFile, vrt, &ast)) { + throwAFSException(env, ast); + } + + if (dumpFile != NULL) + free(dumpFile); + free(volName); +} + +/** + * Renames the specified read-write volume. + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the volume belongs + * volId the numeric id of the read-write volume to rename + * jnewName the new name for the volume + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_rename(JNIEnv * env, jclass cls, jint cellHandle, + jint volID, jstring jnewName) +{ + afs_status_t ast; + char *newName; + + if (jnewName != NULL) { + newName = getNativeString(env, jnewName); + if (!newName) { + throwAFSException(env, JAFSADMNOMEM); + return; + } + } else { + throwAFSException(env, JAFSNULLVOLUME); + return; + } + + if (!vos_VolumeRename + ((void *)cellHandle, NULL, (unsigned int)volID, newName, &ast)) { + throwAFSException(env, ast); + } + + free(newName); +} + +/** + * "Mounts" the specified volume, bringing it online. + * + * env the Java environment + * cls the current Java class + * serverHandle the vos handle of the server on which the volume + * resides + * partition the numeric id of the partition on which the volume + * resides + * volId the numeric id of the volume to bring online + * sleepTime ? (not sure what this is yet, possibly a time to wait + * before brining it online) + * offline ? (not sure what this is either, probably the current + * status of the volume -- busy or offline) + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_mount(JNIEnv * env, jclass cls, + jint serverHandle, jint partition, + jint volID, jint sleepTime, + jboolean offline) +{ + afs_status_t ast; + vos_volumeOnlineType_t volumeStatus; + + if (offline) { + volumeStatus = VOS_ONLINE_OFFLINE; + } else { + volumeStatus = VOS_ONLINE_BUSY; + } + + if (!vos_VolumeOnline + ((void *)serverHandle, NULL, (unsigned int)partition, + (unsigned int)volID, (unsigned int)sleepTime, volumeStatus, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * "Unmounts" the specified volume, bringing it offline. + * + * env the Java environment + * cls the current Java class + * serverHandle the vos handle of the server on which the volume + * resides + * partition the numeric id of the partition on which the volume + * resides + * volId the numeric id of the volume to bring offline + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_unmount(JNIEnv * env, jclass cls, + jint serverHandle, jint partition, + jint volID) +{ + afs_status_t ast; + + if (!vos_VolumeOffline + ((void *)serverHandle, NULL, (unsigned int)partition, + (unsigned int)volID, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Locks the VLDB entry specified volume + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell on which the volume resides + * volId the numeric id of the volume to lock + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_lock(JNIEnv * env, jclass cls, jint cellHandle, + jint volID) +{ + afs_status_t ast; + + if (!vos_VLDBEntryLock + ((void *)cellHandle, NULL, (unsigned int)volID, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Unlocks the VLDB entry of the specified volume + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell on which the volume resides + * volId the numeric id of the volume to unlock + */ +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_unlock(JNIEnv * env, jclass cls, jint cellHandle, + jint volID) +{ + afs_status_t ast; + + if (!vos_VLDBEntryUnlock + ((void *)cellHandle, NULL, (unsigned int)volID, &ast)) { + throwAFSException(env, ast); + return; + } +} + +/** + * Translates a volume name into a volume id + * + * env the Java environment + * cls the current Java class + * cellHandle the handle of the cell to which the volume belongs + * jname the name of the volume in question, cannot end in backup or + * readonly + * type the type of volume: read-write, read-only, or backup. + * Acceptable values are: + * org_openafs_jafs_Volume_VOLUME_TYPE_READ_WRITE + * org_openafs_jafs_Volume_VOLUME_TYPE_READ_ONLY + * org_openafs_jafs_Volume_VOLUME_TYPE_BACKUP + * returns the id of the volume in question + */ +JNIEXPORT jint JNICALL +Java_org_openafs_jafs_Volume_translateNameToID(JNIEnv * env, jclass cls, + jint cellHandle, jstring jname, + jint type) +{ + afs_status_t ast; + char *name; + vos_vldbEntry_t vldbEntry; + + if (jname != NULL) { + name = getNativeString(env, jname); + if (!name) { + throwAFSException(env, JAFSADMNOMEM); + return -1; + } + } else { + throwAFSException(env, JAFSNULLVOLUME); + return -1; + } + + // get the id + if (!vos_VLDBGet((void *)cellHandle, NULL, NULL, name, &vldbEntry, &ast)) { + free(name); + throwAFSException(env, ast); + return -1; + } + + free(name); + + if (type == org_openafs_jafs_Volume_VOLUME_TYPE_READ_WRITE) { + return vldbEntry.volumeId[VOS_READ_WRITE_VOLUME]; + } else if (type == org_openafs_jafs_Volume_VOLUME_TYPE_READ_ONLY) { + return vldbEntry.volumeId[VOS_READ_ONLY_VOLUME]; + } else { + return vldbEntry.volumeId[VOS_BACKUP_VOLUME]; + } + +} + + +// reclaim global memory being used by this portion +JNIEXPORT void JNICALL +Java_org_openafs_jafs_Volume_reclaimVolumeMemory(JNIEnv * env, jclass cls) +{ + if (volumeCls) { + (*env)->DeleteGlobalRef(env, volumeCls); + volumeCls = 0; + } +} diff --git a/src/JAVA/libjafs/etc/CacheConfig b/src/JAVA/libjafs/etc/CacheConfig new file mode 100644 index 000000000..e184b2eee --- /dev/null +++ b/src/JAVA/libjafs/etc/CacheConfig @@ -0,0 +1,16 @@ +MountPoint /afs +ConfDir /usr/afswsp/etc +CacheDir /usr/afswsp/cache +LogFile /usr/afswsp/log/libjafs.log +CacheBlocks 40000 +CacheFiles 3000 +CacheStatEntries 3000 +DCacheSize 100 +VCacheSize 1000 +ChunkSize 0 +CloseSynch 0 +Debug 0 +NDaemons 3 +CacheFlags -1 + + diff --git a/src/JAVA/libjafs/etc/CacheConfig.100MB b/src/JAVA/libjafs/etc/CacheConfig.100MB new file mode 100644 index 000000000..e433ca17f --- /dev/null +++ b/src/JAVA/libjafs/etc/CacheConfig.100MB @@ -0,0 +1,16 @@ +MountPoint /afs +ConfDir /usr/afswsp/etc +CacheDir /usr/afswsp/cache +LogFile /usr/afswsp/log/libjafs.log +CacheBlocks 100000 +CacheFiles 6000 +CacheStatEntries 6000 +DCacheSize 250 +VCacheSize 2000 +ChunkSize 0 +CloseSynch 0 +Debug 0 +NDaemons 3 +CacheFlags -1 + + diff --git a/src/JAVA/libjafs/etc/CacheConfig.40MB b/src/JAVA/libjafs/etc/CacheConfig.40MB new file mode 100644 index 000000000..e184b2eee --- /dev/null +++ b/src/JAVA/libjafs/etc/CacheConfig.40MB @@ -0,0 +1,16 @@ +MountPoint /afs +ConfDir /usr/afswsp/etc +CacheDir /usr/afswsp/cache +LogFile /usr/afswsp/log/libjafs.log +CacheBlocks 40000 +CacheFiles 3000 +CacheStatEntries 3000 +DCacheSize 100 +VCacheSize 1000 +ChunkSize 0 +CloseSynch 0 +Debug 0 +NDaemons 3 +CacheFlags -1 + + diff --git a/src/Makefile.am.common b/src/Makefile.am.common index ba152f6c7..9ebfdafc7 100644 --- a/src/Makefile.am.common +++ b/src/Makefile.am.common @@ -1,4 +1,4 @@ -# $Id: Makefile.am.common,v 1.1 2001/07/05 00:54:58 hartmans Exp $ +# $Id: Makefile.am.common,v 1.1 2001/06/05 20:17:46 shadow Exp $ INCLUDES+=-I$(top_builddir)/include diff --git a/src/NTMakefile b/src/NTMakefile index e1d490224..361efd6b7 100644 --- a/src/NTMakefile +++ b/src/NTMakefile @@ -16,489 +16,613 @@ # appropriately; if the new directory is the last in the chain, then # update the 'finale' dependency to be the new directory. +# These three macros define the source, object, and destination folders +SRC=$(AFSROOT)\src +#If AFS_OBJDIR is not defined then use obj as relative obj folder +!IFNDEF AFS_OBJDIR +AFS_OBJDIR=$(AFSROOT)\obj +!ENDIF +DESTDIR=$(AFSROOT)\dest CD = cd NTMAKE = nmake /nologo /f ntmakefile install -NTMAKELANG = nmake /nologo /f ntmakefile en_US -NTMAKE_HEADERS = nmake /nologo /f ntmakefile install_headers +NTMAKELANG = nmake /nologo /f ntmakefile en_US +NTMAKE_HEADERS = nmake /nologo /f ntmakefile install_headers NTMAKE_OBJS = nmake /nologo /f ntmakefile install_objs MKDIR = mkdir -OBJ = src - -# Standard install directory. -!IFDEF AFSDEV_DESTDIR -DESTDIR = $(AFSDEV_DESTDIR) -!ELSE -DESTDIR = $(AFSROOT)\DEST -!ENDIF - -start: -! IF (!EXIST(src)) -! ERROR Execute nmake from directory above src, e.g., afs\3.5. -! ENDIF -! IF (!EXIST($(DESTDIR))) - $(MKDIR) $(DESTDIR) -! ENDIF +#debug statement support jumping to last know error +DOCD=$(SRC)\DOLASTCMP.BAT config: echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\config + $(CD) $(SRC)\config $(NTMAKE) $(CD) ..\.. -procmgmt_headers: config +procmgmt_headers:config echo ***** $@ - $(CD) $(OBJ)\procmgmt + $(DOCD) $(SRC)\procmgmt + $(CD) $(SRC)\procmgmt $(NTMAKE_HEADERS) $(CD) ..\.. -afsreg_headers: config +afsreg_headers: echo ***** $@ - $(CD) $(OBJ)\WINNT\afsreg + $(DOCD) $(SRC)\WINNT\afsreg + $(CD) $(SRC)\WINNT\afsreg $(NTMAKE_HEADERS) $(CD) ..\..\.. util: procmgmt_headers afsreg_headers echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. comerr: util echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. -cmd: comerr +afs: comerr + echo ***** $@ + $(DOCD) $(SRC)\afs + $(CD) $(SRC)\afs + $(NTMAKE) + $(CD) ..\.. + +cmd: afs echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. afsreg: cmd echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. eventlog: afsreg echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. lwp: eventlog echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. rxgen: lwp echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. des: rxgen echo ***** $@ -! IF (EXIST($(OBJ)\des\NTMakefile)) - $(CD) $(OBJ)\des +! IF (EXIST($(SRC)\des\NTMakefile)) + $(DOCD) $(SRC)\des + $(CD) $(SRC)\des $(NTMAKE) $(CD) ..\.. ! ELSE - $(CD) $(OBJ)\des_stub + $(DOCD) $(SRC)\des_stub + $(CD) $(SRC)\des_stub $(NTMAKE) $(CD) ..\.. ! ENDIF rx: des echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. rxstat: rx echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. rxkad: rxstat echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. pthread: rxkad echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. procmgmt: pthread echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. fsint: procmgmt echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. audit: fsint echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. osi_headers: audit echo ***** $@ - $(CD) $(OBJ)\WINNT\client_osi + $(DOCD) $(SRC)\WINNT\client_osi + $(CD) $(SRC)\WINNT\client_osi $(NTMAKE_HEADERS) $(CD) ..\..\.. libacl_headers: osi_headers echo ***** $@ - $(CD) $(OBJ)\libacl + $(DOCD) $(SRC)\libacl + $(CD) $(SRC)\libacl $(NTMAKE_HEADERS) $(CD) ..\.. cm_headers: libacl_headers echo ***** $@ - $(CD) $(OBJ)\WINNT\afsd + $(DOCD) $(SRC)\WINNT\afsd + $(CD) $(SRC)\WINNT\afsd $(NTMAKE_HEADERS) $(CD) ..\..\.. -sys: cm_headers +afsdobjs: cm_headers echo ***** $@ - $(CD) $(OBJ)\$@ - $(NTMAKE) - $(CD) ..\.. - -afsdobjs: sys - echo ***** $@ - $(CD) $(OBJ)\WINNT\afsd + $(DOCD) $(SRC)\WINNT\afsd + $(CD) $(SRC)\WINNT\afsd $(NTMAKE_OBJS) $(CD) ..\..\.. -auth: afsdobjs +sys: afsdobjs + echo ***** $@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ + $(NTMAKE) + $(CD) ..\.. + +auth: sys echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. ubik: auth echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. ptserver: ubik echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. libacl: ptserver echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. kauth: libacl echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. vlserver: kauth echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. usd: vlserver echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. bubasics: usd echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. budb: bubasics echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. butm: budb echo ***** $@ - $(CD) $(OBJ)\$@ - $(NTMAKE) - $(CD) ..\.. + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ + $(NTMAKE) + $(CD) ..\.. dir: butm echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. vol: dir echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. volser: vol echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. viced: volser echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. update: viced echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. bucoord: update echo ***** $@ - $(CD) $(OBJ)\$@ - $(NTMAKE) - $(CD) ..\.. + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ + $(NTMAKE) + $(CD) ..\.. butc: bucoord echo ***** $@ - $(CD) $(OBJ)\$@ - $(NTMAKE) - $(CD) ..\.. + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ + $(NTMAKE) + $(CD) ..\.. bozo: butc echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. bosctlsvc: bozo echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. bu_utils: bosctlsvc echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. libafsrpc: bu_utils echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. libafsauthent: libafsrpc echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. tviced: libafsauthent echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. tbutc: tviced echo ***** $@ - $(CD) $(OBJ)\$@ - $(NTMAKE) - $(CD) ..\.. + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ + $(NTMAKE) + $(CD) ..\.. libadmin: tbutc echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. adminutil: libadmin echo ***** $@ - $(CD) $(OBJ)\libadmin\$@ + $(DOCD) $(SRC)\libadmin\$@ + $(CD) $(SRC)\libadmin\$@ $(NTMAKE) $(CD) ..\..\.. vos: adminutil echo ***** $@ - $(CD) $(OBJ)\libadmin\$@ + $(DOCD) $(SRC)\libadmin\$@ + $(CD) $(SRC)\libadmin\$@ $(NTMAKE) $(CD) ..\..\.. client: vos echo ***** $@ - $(CD) $(OBJ)\libadmin\$@ + $(DOCD) $(SRC)\libadmin\$@ + $(CD) $(SRC)\libadmin\$@ $(NTMAKE) $(CD) ..\..\.. kas: client echo ***** $@ - $(CD) $(OBJ)\libadmin\$@ + $(DOCD) $(SRC)\libadmin\$@ + $(CD) $(SRC)\libadmin\$@ $(NTMAKE) $(CD) ..\..\.. pts: kas echo ***** $@ - $(CD) $(OBJ)\libadmin\$@ + $(DOCD) $(SRC)\libadmin\$@ + $(CD) $(SRC)\libadmin\$@ $(NTMAKE) $(CD) ..\..\.. bos: pts echo ***** $@ - $(CD) $(OBJ)\libadmin\$@ + $(DOCD) $(SRC)\libadmin\$@ + $(CD) $(SRC)\libadmin\$@ $(NTMAKE) $(CD) ..\..\.. cfg: bos echo ***** $@ - $(CD) $(OBJ)\libadmin\$@ + $(DOCD) $(SRC)\libadmin\$@ + $(CD) $(SRC)\libadmin\$@ $(NTMAKE) $(CD) ..\..\.. admintest: cfg echo ***** $@ - $(CD) $(OBJ)\libadmin\test + $(DOCD) $(SRC)\libadmin\test + $(CD) $(SRC)\libadmin\test $(NTMAKE) $(CD) ..\..\.. talocale: admintest echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. license: talocale echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. afsadmsvr: license echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. afsusrmgr: afsadmsvr echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. afssvrmgr: afsusrmgr echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. afssvrcfg: afssvrmgr echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. afssvrcpa: afssvrcfg echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. client_talocale: afssvrcpa echo ***** $@ - $(CD) $(OBJ)\WINNT\talocale + $(DOCD) $(SRC)\WINNT\talocale + $(CD) $(SRC)\WINNT\talocale $(NTMAKE) $(CD) ..\..\.. client_osi: client_talocale echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. afsd: client_osi echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. client_cpa: afsd echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. client_config: client_cpa echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. client_exp: client_config echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. client_creds: client_exp echo ***** $@ - $(CD) $(OBJ)\WINNT\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ + $(NTMAKE) + $(CD) ..\..\.. + +aklog: client_creds + echo ***** $@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ $(NTMAKE) $(CD) ..\..\.. -finale: client_creds +extra: aklog +! IF EXIST($(SRC)\WINNT\extra) && EXIST($(SRC)\WINNT\extra\NTMakefile) echo ***** $@ - $(CD) $(OBJ)\$@ + $(DOCD) $(SRC)\WINNT\$@ + $(CD) $(SRC)\WINNT\$@ + $(NTMAKE) + $(CD) ..\..\.. +! ELSE + echo ***** Skipping $@ ***** Not found. +! ENDIF + +finale: extra + echo ***** $@ + $(DOCD) $(SRC)\$@ + $(CD) $(SRC)\$@ $(NTMAKE) $(CD) ..\.. echo Build Finished Successfully -install: start finale +install: finale # InstallShield dependencies +# Clean target for obj tree +clean: + nmake /nologo /f ntmakefile "NTMAKE = nmake /nologo /f ntmakefile clean" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile clean" "NTMAKE_OBJS = nmake /nologo /f ntmakefile clean" install + nmake /nologo /f ntmakefile "NTMAKE = nmake /nologo /f ntmakefile clean" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile clean" "NTMAKE_OBJS = nmake /nologo /f ntmakefile clean" media + $(CD) $(SRC)\config + nmake /nologo /f ntmakefile clean_version + $(CD) ..\.. + +# Language-only build target +lang: + nmake /nologo /f ntmakefile "NTMAKE = nmake /nologo /f ntmakefile lang" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile lang" install + +mkdir: + -mkdir $(AFS_OBJDIR) + -mkdir $(DESTDIR) + -mkdir $(AFS_OBJDIR)\checked + -mkdir $(AFS_OBJDIR)\free + -xcopy /q /t /e $(SRC)\*.* $(AFS_OBJDIR)\checked\ + -xcopy /q /t /e $(SRC)\*.* $(AFS_OBJDIR)\free\ + -mkdir $(DESTDIR)\checked + -mkdir $(DESTDIR)\free + -mkdir $(DESTDIR)\checked\bin + -mkdir $(DESTDIR)\free\bin + -@copy $(SRC)\config\NTLANG.BAT . + +NSIS: + echo ***** Making NSIS Installer + $(DOCD) $(SRC)\WINNT\install\$@ + $(CD) $(SRC)\WINNT\install\$@ + $(NTMAKE) + $(CD) ..\..\..\.. + +#msi: +# echo ***** Making MSI Installer +# $(DOCD) $(SRC)\WINNT\install\$@ +# $(CD) $(SRC)\WINNT\install\$@ +# $(NTMAKE) +# $(CD) ..\..\..\.. + InstallShield5: echo ***** afs_setup_utils - $(CD) $(OBJ)\WINNT\afs_setup_utils + $(DOCD) $(SRC)\WINNT\afs_setup_utils + $(CD) $(SRC)\WINNT\afs_setup_utils $(NTMAKE) $(CD) ..\..\.. - $(CD) $(OBJ)\WINNT\install\$@ + $(DOCD) $(SRC)\WINNT\install\$@ + $(CD) $(SRC)\WINNT\install\$@ $(NTMAKE) $(CD) ..\..\..\.. -media: InstallShield5 - echo Install Script Finished Successfully +media: install InstallShield5 NSIS +install-nsis: install NSIS -# Clean target for obj tree -clean: start - nmake /nologo /f ntmakefile "NTMAKE = nmake /nologo /f ntmakefile clean" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile clean" "NTMAKE_OBJS = nmake /nologo /f ntmakefile clean" install - $(CD) $(OBJ)\config - nmake /nologo /f ntmakefile clean_version - $(CD) ..\.. +install-msi: install msi +install-is5: install InstallShield5 -# Language-only build target -lang: - nmake /nologo /f ntmakefile "NTMAKE = nmake /nologo /f ntmakefile lang" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile lang" install diff --git a/src/README-NT b/src/README-NT deleted file mode 100644 index 90b27ace8..000000000 --- a/src/README-NT +++ /dev/null @@ -1,201 +0,0 @@ -Copyright 2000, International Business Machines Corporation and others. -All Rights Reserved. - -This software has been released under the terms of the IBM Public -License. For details, see the LICENSE file in the top-level source -directory or on-line at http://www.openafs.org/dl/license10.html - -Building OpenAFS on Windows NT ------------------------------- - -There are several steps that must be performed before a successful -build of AFS on Windows NT can be completed. These steps are as follows: - - A. Install a compiler - B. Add missing header files - C. Optional: Install Installshield 5.x - D. Optional: Install flex and bison - E. Configure the OpenAFS build environment - F. Begin the build - -Each step is explained in detail below: - -A. Install a compiler - - You must install a copy of Microsoft Visual C++ 5.0 or 6.0. The - "Typical" install setting is sufficient. It may be possible to use - other compilers, but the source code as provided will work with MS - VC++ 5.0/6.0. - -B. Add missing header files - - Files from Microsoft's Device Driver Development kits for NT and - Windows 9x are required to complete a build on NT. They are - copyrighted by Microsoft and so cannot be included with the OpenAFS - source tree. These files are: - - netmpr.h - netspi.h - npapi.h - - These files come from Microsoft DDKs as follows: - - January 1997 Windows NT Workstation DDK - /ddk/frc/network/inc/npapi.h - July 1998 Windows 95 DDK - net/inc/netmpr.h and net/inc/netspi.h - - The may also be available on more recent releases of the DDKs. - These files must live on the include path. - -C. Optional: Install Installshield 5.x - - There are two ways to build OpenAFS on NT: - 1. Build of the product, or - 2. build of the product plus an installer package - - In order to do the build that includes the installer package, a - copy of Installshield 5.x must be installed. NOTE: Installshield - versions 6 and higher WILL NOT WORK. - - Optional DLL's missing for Install Script - Two Microsoft DLL's must be included at DEST\WinInstall\Config\. - SHLWAPI.DLL - WININET.DLL - - These files are only used for the Install, they will not be left - on the target machine. - -D. Optional: Install flex and bison - - There are two files in the source tree that are processed with lex - and yacc on UNIX systems, src/comerr/et_lex.lex.l and - src/comerr/error_table.y, that when processed produce the files - et_lex.lex_nt.c, error_table_nt.c, and error_table_nt.h. - - Since NT does not include lex and yacc or any equivalent tools, we - have provided the output files that lex and yacc produce (using - Win32 ports of flex and bison). This will allow builds to work for - anyone who does not need to change the .l and .y files. - - If you do need to change et_lex.lex.l, then you will need to - install Win32 port of flex on your system. Put flex.exe in a - directory on the path and rebuild. - - If you do need to change error_table.y, then you will need to - install a Win32 port of bison on your system. Put bison.exe in a - directory on the path, configure bison as explained in step 5, and - rebuild. - - You can also attempt to use other replacements for lex and yacc. - This will require modifying the LEX and YACC settings in - src/config/NTMakefile.i386_nt40. If the replacements require - different command line options than flex and bison, then you may - also need to change src/comerr/NTMakefile. - -E. Configure the OpenAFS build environment - - A set of environment variables used by the OpenAFS makefiles must - be properly set for a build to successfully complete. The file - src/ntbuild.bat is a DOS-style batch file that will configure these - settings for you. Within this file there are the following lines - that must be set to match your system settings: - - * set SYS_NAME= - - * set MSVCDIR= - Ex: set MSVCDIR=c:\progra~1\DevStudio\vc - - This is the path to the compiler directory of the Microsoft Visual - C++ installation. - - * set AFSDEV_INCLUDE= - Ex: set AFSDEV_INCLUDE=%MSVCDIR%\include;%MSVCDIR%\mfc\include - - This contains a semicolon separated list of directories that - contain compiler provided include files. You should not need to - edit this other than to point to the DDK includes not provided - with the distribution - - * set AFSROOT= - Ex: set AFSROOT=d:\OpenAFS - - This is the root directory of OpenAFS, which is the parent - directory of the src directory. - - * set IS5ROOT= - Ex: set IS5ROOT=d:\progra~1\instal~1\instal~1.1pr - - This is the path to the Installshield5 program directory. You - should only define this if you have Installshield installed on - your computer and want to create the install script as part of - the build. - - NOTES: There are other settings in ntbuild.bat, but the ones listed - above must be set correctly for the build to succeed. - - As can be seen in the examples above, all paths in - ntbuild.bat must be in the old MSDOS 8.3 format. - -F. Set version and installation options - - Modify .\src\config\NTMakefile.i386_nt40 - AFSPRODUCT_VERSION - Product version - CELLNAME_DEFAULT - The default AFS cell name - CELLSERVDB_INSTALL - The default name for the CellServDB included in the install script - CELLSERVDB_WEB - The default web address to obtain CellServDB - -For Example: - - .\src\config\NTMakefile.i386_nt40 - - AFSPRODUCT_VERSION=1.1.1a - CELLNAME_DEFAULT=openafs.org - CELLSERVDB_INSTALL=CellServDB.GrandCentral - CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB - -NOTE: If CELLNAME_DEFAULT has a '.' in cell name, then the name is assumed to be -a valid cell name and when the user installs AFS the AFS Control Center -will default to NOT installed! - -Version level may be specified in different formats, for example the following -forms all have the same version level; however will be displayed differently: - -AFSPRODUCT_VERSION=1.1.1a -AFSPRODUCT_VERSION=1.1.1 a -AFSPRODUCT_VERSION=1.1.1.1 -AFSPRODUCT_VERSION=1.1.101 - -Add CellServDB file to install area. - For the previous example you would add file: - DEST\Winistall\Config\CellServDB.GrandCentral - -G. Begin the build - - 1. Make sure you are running the default NT command shell, cmd.exe. - Other shells may work, but many do not. - - 2. Run the ntbuild.bat file that was configured in step 5. You can - include the word "checked" on the command line to create binaries - that include debug information, or the word "free" to create - binaries that do not include debug information. - - For a debug build, run: - ntbuild checked - - For a release build, run: - ntbuild free - - 3. Copy the file src/NTMakefile to the parent of the src directory. - You only need to do this once. - - 4. If you have not created a separate object build directory, edit NTMakefile and - OBJ=obj to OBJ=src. - - 5. Begin the build. You can choose to build just the product bits, - or, if Installshield is installed, the product bits and the - install package. - - To build just the product bits, run: - nmake /f NTMakefile install - - To build the product bits and the install package, run: - nmake /f NTMakefile media diff --git a/src/SOURCE-MAP b/src/SOURCE-MAP new file mode 100644 index 000000000..bbd5b3ff5 --- /dev/null +++ b/src/SOURCE-MAP @@ -0,0 +1,109 @@ +Guide to the AFS source tree + +WINNT - Windows-specific UI, glue and such. +afs - routines which make up the kernel- and userlevel- cachemanager +afsd - the afsd process which parses config files, sets up the cache, + and forks off subprocess to start each of the libafs + "kernel threads" +afsmonitor - afs monitoring tool +afsweb - authenticated AFS access via Apache. requires minor porting for + newer Apache versions. +audit - afs event auditing support library +auth - afsconf suite (CellServDB/UserList/ThisCell) and token interface, + outdated copyauth program, setkey utility for adding a key + to a server KeyFile (as a key) +bozo - bos suite +bubasics - backup related rpc interface definitions. +bucoord - backup coordinator and support library. +budb - backup database server (buserver). +butc - backup tape coordinator, and read_tape restoral client. +butm - backup tape manager library +bu_utils - fms(estimate tape capacity and file mark sizes) (not useful + for tape drives with compression) +cmd - cmd library, routines to parse cmd line arguments + used by all command line utilities +comerr - com_err library, error table routines +config - build system OS-specific configuration +dauth - dlog - get a krb ticket for use with the AFS/DFS translator + dpass - also part of the AFS/DFS migration kit +des - des library +des_stub - remnant of export restrictions on encryption code. +dir - afs directory handling library (client and server, internal format) +export - from the README: + EXPORT is an aix3.1 kernel extension whose sole purpose in + life is to provide access to kernel symbols that were mistakenly + (or purposefully) omitted from the kernel exports list. +finale - last part of the source to build: + translate_et - translates error codes to descriptive messages +fsint - fileserver rpc interface definitions +fsprobe - fileserver probe facility for information collection +ftpd43+ - insecure afs aware ftpd. +gtx - graphics library for monitoring clients +inetd - insecure afs aware inetd. +kauth - Kerberos suite including server, admin client, password + changing and validating clients, token-getting and + token-and-ticket-getting authentication clients, nfs + authentication exporter and server database reconstructor +libacl - acl library, routines for manipulation of ACLs +libadmin - AFS administration API +libafs - directory where build system actually builds kernel modules. +libafsauthent - afsauthent library. part of a simplified set of libraries + for AFS-aware utilties. This and libafsrpc provide complete + functionality. +libafsrpc - afsrpc library. Provides basic Rx functionality for AFS-aware + programs which don't need to do authentication +libuafs - userlevel cache manager build directory +log - programs to show and forget tokens (and optionally forget tokens + and tickets) and test program to create an AFS token +login - afs aware login replacement, and optional replacement which + gets kerberos tickets +lwp - lightweight process library +mpp - macro processor for use with package +ntp - out of date bundled NTP implementation +null - empty archive library +package - package system for local disk software maintenance +pam - pluggable authentication modules for afs authentication. +pinstall - "portable" install command +procmgmt - "portable" process management library. +ptserver - the protection database server and clients. +rcp - insecure afs aware rcp. +rlogind - insecure afs aware. +rsh - insecure afs aware rsh. +rx - rx rpc library. +rxdebug - debugging tool for rx. +rxgen - rxgen program. generates AFS RPC stubs from .xg files. +rxkad - kerberos security module for rx. +rxstat - rx statistics package +scout - monitoring tool for afs fileservers. +sgistuff - SGI authentication plugin for graphical login +sia - Digital UNIX authentication plugin +sys - local and remote system call interfaces. basic PAG-creation + and remote system call handling for NFS translator +tbutc - pthread version of butc. +tests - test suite +tsm41 - tivoli storage manager support for the backup system. +tviced - pthread version of the fileserver +ubik - ubik replicated database library. +update - upserver/upclient for maintaining server software from a system + control machine +usd - userspace device input/output library. +uss - uss tool for managing users. +util - swiss army knife library. +venus - various cachemanager related utilities +vfsck - fsck for vice partitions on non-namei fileservers. +viced - fileserver. +vlserver - volume location server +vol - volume library for managing volumes on-disk. +volser - volume server package. includes volserver and vos client. +wsadmin.src - sample package files +wsadmin.lib - sample package files +xstat - extended statistics clients for cachemanagers and fileservers +xinstall - unused more modern install program +tools - contributed configuration/maintenance tools +man - man pages +include - build-time include file install area; may be used in automake time +cf - autoconf config files +afsinstall - leftovers from IBM AFS including installation notes and helper + scripts + + diff --git a/src/TechNotes-JavaAPI b/src/TechNotes-JavaAPI new file mode 100644 index 000000000..52ddd24af --- /dev/null +++ b/src/TechNotes-JavaAPI @@ -0,0 +1,94 @@ +Java API (Jafs): Technical Notes +----------------------------------------- + +Overview +-------- + +The Java API (Jafs) is a Java package with a shared library +written in C. It is meant for use by programmers who wish to develop +tools in Java for OpenAFS administration and use. This document briefly +outlines the architecture of Jafs. + +Shared library +-------------- + +The source code for the shared library resides in the src/JAVA/libjafs +directory. See the JAFS_README file in that directory for information +on how to compile this package. The code is broken up logically into +files by the type of AFS object they relate to (i.e. cell, user, volume, +etc.), which closely mirrors the different classes of the Java package. +This library is built on top of the libadmin and libuafs libraries, and +mainly serves as a translation layer between the Java package and the +OpenAFS code. It is closely tied to the Java package, in that it often +accesses the actual Java objects by calls up through JNI, in order to +retrieve or populate member fields of those objects. Also, if an error +occurs in this code or in another C library, a Java exception is +constructed with the appropriate error code, and is thrown back to the +Java layer to be dealt with. + +In order to provide user-level functions such as ACL setting and mount +point iteration, the shared library needs to be linked with a specialized +version of libuafs called libjuafs.a. Please view the README file in the +src/libuafs directory for more information regarding libjuafs and how it +is built. + +Java package +------------ + +The code for the org.openafs.jafs package resides in the +src/JAVA/org/openafs/jafs/ directory. It is broken into classes +in the same way that the OpenAFS file system breaks down into logical +components: Cell, User, Group, Server, Partition, Volume, Process, Key, +Token, ACL, and File. There are also classes for file input and +output streams, and specialized exception classes. + +Publicly, the developer only has access to these objects and their +instance functions, which provide a solid, object-oriented view of +OpenAFS administration and use. The first thing a programmer would do to +use this package in his or her code would be to construct a Token object by +giving it a cell name, a user name, and a password for that user. From +there, the programmer could easily construct a Cell object and then list, +for example, all the servers in a cell, create a new user, move a volume to +a different partition, etc. + +When one of these objects is constructed, it does not actually create +the corresponding component in OpenAFS. The object is supposed to +represent the object. If the programmer wants to actually create a +new user in OpenAFS, for example, he or she would construct a new User +object with the name of the user to create, and then explicitly call +the object's create method. + +When an object first accesses information about itself from OpenAFS +by calling down through JNI to the shared library, it saves the +information and will return it to the application on subsequent +requests. This minimizes the overhead of expensive JNI calls. This +saved information can be updated to reflect the most current state of +OpenAFS by calling the objects refresh method. + +There are usually two ways to list something: getting an array of the +names of the elements in the list, or getting an array of the actual +objects themselves. For example, the Cell object can provide the +programmer with an array of the names of all users in the cell, or +an array of actual User objects, with relevant member fields already set +to the correct values. + +Almost every method in the package declares AFSException in its +throws clause. This is thrown from the shared library whenever an +error occurs, and contains an OpenAFS error code as a member. The +programmer is expected to deal with these exceptions however they see fit. + +The native methods that act as the interface between the Java layer and +the shared library are declared protected, so they can be used directly +by developers who wish to subclass these classes for their applications +and possibly implement their own versions of the Java API calls. + +Known Issues +------------ + +Some issues not yet dealt with in this API include: + - Alternative methods of authentication, other than Kaserver (i.e. + Kerberos V). There has been some discussion about how to abstract + the User object to be more general, but so far it has not been + implemented. + - Access to VLDB functionality such as listing VLDB entries and + zapping volumes. diff --git a/src/WINNT/afs_setup_utils/GetWebDll/ntmakefile b/src/WINNT/afs_setup_utils/GetWebDll/ntmakefile index 27c76ba44..abd0d7239 100644 --- a/src/WINNT/afs_setup_utils/GetWebDll/ntmakefile +++ b/src/WINNT/afs_setup_utils/GetWebDll/ntmakefile @@ -1,32 +1,31 @@ # Microsoft Developer Studio Generated NMAKE File, Based on GetWebDll.dsp +RELDIR=WINNT\afs_setup_utils\GetWebDll +!INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) +!INCLUDE ..\..\..\config\NTMakefile.version + !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF -OUTDIR=. -INTDIR=. +OUTDIR=$(OUT) +INTDIR=$(OUT) # Begin Custom Macros OutDir=. # End Custom Macros -INSTALL : "$(OUTDIR)\GetWebDll.dll" +INSTALL : "$(DESTDIR)\WinInstall\Config\GetWebDll.dll" -CLEAN : - -@erase "$(INTDIR)\GetWebDll.pch" +CLEAN :: -@erase "$(INTDIR)\*.obj" - -@erase "$(INTDIR)\vc60.idb" -@erase "$(OUTDIR)\GetWebDll.dll" -@erase "$(OUTDIR)\GetWebDll.exp" -@erase "$(OUTDIR)\GetWebDll.lib" -@erase "$(OUTDIR)\GetWebDll.sbl" -@erase "$(OUTDIR)\GetWebDll.pjt" -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - CPP=cl.exe CPP_PROJ=/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_MBCS" /D "_USRDLL" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c @@ -69,14 +68,14 @@ BSC32_FLAGS=/nologo /o"$(OUTDIR)\GetWebDll.bsc" BSC32_SBRS= \ LINK32=link.exe -LINK32_FLAGS=/nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\GetWebDll.pdb" /machine:I386 /def:".\GetWebDll.def" /out:"$(OUTDIR)\GetWebDll.dll" /implib:"$(OUTDIR)\GetWebDll.lib" +LINK32_FLAGS=/nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\GetWebDll.pdb" /machine:I386 /def:".\GetWebDll.def" /out:"$(DESTDIR)\WinInstall\Config\GetWebDll.dll" /implib:"$(DESTDIR)\WinInstall\Config\GetWebDll.lib" DEF_FILE= \ ".\GetWebDll.def" LINK32_OBJS= \ "$(INTDIR)\GetWebDll.obj" \ "$(INTDIR)\GetWebDll.res" -"$(OUTDIR)\GetWebDll.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) +"$(DESTDIR)\WinInstall\Config\GetWebDll.dll" : $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << @@ -93,11 +92,11 @@ LINK32_OBJS= \ SOURCE=.\GetWebDll.cpp -"$(INTDIR)\GetWebDll.obj" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\GetWebDll.obj" : $(SOURCE) SOURCE=.\GetWebDll.rc -"$(INTDIR)\GetWebDll.res" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\GetWebDll.res" : $(SOURCE) $(RSC) $(RSC_PROJ) $(SOURCE) diff --git a/src/WINNT/afs_setup_utils/NTMakefile b/src/WINNT/afs_setup_utils/NTMakefile index 07e09e969..c5320f673 100644 --- a/src/WINNT/afs_setup_utils/NTMakefile +++ b/src/WINNT/afs_setup_utils/NTMakefile @@ -10,11 +10,10 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -WX # include the primary makefile - +RELDIR=WINNT\afs_setup_utils !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version - ############################################################################ ILIBDIR = $(DESTDIR)\lib\afs @@ -35,15 +34,15 @@ DOCS_UNINST_DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\DocsUninst.dll # Source files and libraries that are shared by all of the targets. AFSAPPLIBOBJS = \ - subclass.obj + $(OUT)\subclass.obj DLLOBJS = \ $(AFSAPPLIBOBJS) \ - progress_dlg.obj \ - animate_icon.obj \ - sutil.obj \ - forceremove.obj \ - afs_setup_utils_stub.res + $(OUT)\progress_dlg.obj \ + $(OUT)\animate_icon.obj \ + $(OUT)\sutil.obj \ + $(OUT)\forceremove.obj \ + $(OUT)\afs_setup_utils_stub.res VCLIBS = \ comctl32.lib \ @@ -60,7 +59,7 @@ DLLLIBS = \ AFSAPPLIBDIR = ..\..\WINNT\afsapplib -subclass.obj: $(AFSAPPLIBDIR)\subclass.cpp +$(OUT)\subclass.obj: $(AFSAPPLIBDIR)\subclass.cpp $(C2OBJ) -I$(AFSAPPLIBDIR) $(AFSAPPLIBDIR)\subclass.cpp @@ -70,10 +69,10 @@ subclass.obj: $(AFSAPPLIBDIR)\subclass.cpp AFSRM_EXEFILE = $(DESTDIR)\bin\afsrm.exe AFSRM_EXEOBJS =\ - afsrm.obj \ - forceremove.obj \ - sutil.obj \ - AFS_component_version_number.obj + $(OUT)\afsrm.obj \ + $(OUT)\forceremove.obj \ + $(OUT)\sutil.obj \ + $(OUT)\AFS_component_version_number.obj AFSRM_EXELIBS =\ $(DESTDIR)\lib\afs\afsreg.lib \ @@ -108,55 +107,57 @@ $(DIRLANG) :: ############################################################################ # How to build the shared source file for each uninstall dll -s_afs_setup_utils.obj: afs_setup_utils.cpp - $(C2OBJ) afs_setup_utils.cpp -DSERVER_UNINST /Fos_afs_setup_utils.obj +C2OBJ = $(C2OBJ) -DSERVER_UNINST + +$(OUT)\s_afs_setup_utils.obj: afs_setup_utils.cpp + $(C2OBJ) $** -c_afs_setup_utils.obj: afs_setup_utils.cpp - $(C2OBJ) afs_setup_utils.cpp -DCLIENT_UNINST /Foc_afs_setup_utils.obj +$(OUT)\c_afs_setup_utils.obj: afs_setup_utils.cpp + $(C2OBJ) $** -cc_afs_setup_utils.obj: afs_setup_utils.cpp - $(C2OBJ) afs_setup_utils.cpp -DCC_UNINST /Focc_afs_setup_utils.obj +$(OUT)\cc_afs_setup_utils.obj: afs_setup_utils.cpp + $(C2OBJ) $** -lc_afs_setup_utils.obj: afs_setup_utils.cpp - $(C2OBJ) afs_setup_utils.cpp -DLIGHT_CLIENT_UNINST /Folc_afs_setup_utils.obj +$(OUT)\lc_afs_setup_utils.obj: afs_setup_utils.cpp + $(C2OBJ) $** -d_afs_setup_utils.obj: afs_setup_utils.cpp - $(C2OBJ) afs_setup_utils.cpp -DDOCS_UNINST /Fod_afs_setup_utils.obj +$(OUT)\d_afs_setup_utils.obj: afs_setup_utils.cpp + $(C2OBJ) $** ############################################################################ -$(INSTALL_UTILS_DLLFILE) : afs_setup_utils.obj $(DLLOBJS) $(DLLLIBS) +$(INSTALL_UTILS_DLLFILE) : $(OUT)\afs_setup_utils.obj $(DLLOBJS) $(DLLLIBS) $(DLLGUILINK) -entry:DllEntryPoint /DEF:install_utils.def $(VCLIBS) $(DLLPREP) $(COPY) $*.lib $(ILIBDIR) $(DEL) $*.lib $*.exp -$(SERVER_UNINST_DLLFILE) : s_afs_setup_utils.obj $(DLLOBJS) $(DLLLIBS) +$(SERVER_UNINST_DLLFILE) : $(OUT)\s_afs_setup_utils.obj $(DLLOBJS) $(DLLLIBS) $(DLLGUILINK) -entry:DllEntryPoint /DEF:server_uninst.def $(VCLIBS) $(DLLPREP) $(COPY) $*.lib $(ILIBDIR) $(DEL) $*.lib $*.exp -$(CLIENT_UNINST_DLLFILE) : c_afs_setup_utils.obj $(DLLOBJS) $(DLLLIBS) +$(CLIENT_UNINST_DLLFILE) : $(OUT)\c_afs_setup_utils.obj $(DLLOBJS) $(DLLLIBS) $(DLLGUILINK) -entry:DllEntryPoint /DEF:client_uninst.def $(VCLIBS) $(DLLPREP) $(COPY) $*.lib $(ILIBDIR) $(DEL) $*.lib $*.exp -$(CC_UNINST_DLLFILE) : cc_afs_setup_utils.obj $(DLLOBJS) $(DLLLIBS) +$(CC_UNINST_DLLFILE) : $(OUT)\cc_afs_setup_utils.obj $(DLLOBJS) $(DLLLIBS) $(DLLGUILINK) -entry:DllEntryPoint /DEF:cc_uninst.def $(VCLIBS) $(DLLPREP) $(COPY) $*.lib $(ILIBDIR) $(DEL) $*.lib $*.exp -$(LIGHT_CLIENT_UNINST_DLLFILE) : lc_afs_setup_utils.obj $(DLLOBJS) $(DLLLIBS) +$(LIGHT_CLIENT_UNINST_DLLFILE) : $(OUT)\lc_afs_setup_utils.obj $(DLLOBJS) $(DLLLIBS) $(DLLGUILINK) -entry:DllEntryPoint /DEF:light_client_uninst.def $(VCLIBS) $(DLLPREP) $(COPY) $*.lib $(ILIBDIR) $(DEL) $*.lib $*.exp -$(DOCS_UNINST_DLLFILE) : d_afs_setup_utils.obj $(DLLOBJS) $(DLLLIBS) +$(DOCS_UNINST_DLLFILE) : $(OUT)\d_afs_setup_utils.obj $(DLLOBJS) $(DLLLIBS) $(DLLGUILINK) -entry:DllEntryPoint /DEF:docs_uninst.def $(VCLIBS) $(DLLPREP) $(COPY) $*.lib $(ILIBDIR) @@ -186,5 +187,10 @@ clean:: # Dependencies # -afs_setup_utils_stub.res : afs_setup_utils_stub.rc AFS_component_version_number.h +$(OUT)\afs_setup_utils_stub.res : afs_setup_utils_stub.rc AFS_component_version_number.h +mkdir: + -mkdir $(OUT)\lang + cd lang + nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir + cd .. diff --git a/src/WINNT/afs_setup_utils/_isuser/ntmakefile b/src/WINNT/afs_setup_utils/_isuser/ntmakefile index 437b9b101..0e73bbedf 100644 --- a/src/WINNT/afs_setup_utils/_isuser/ntmakefile +++ b/src/WINNT/afs_setup_utils/_isuser/ntmakefile @@ -1,5 +1,6 @@ # include the primary makefile +RELDIR=WINNT\afs_setup_utils\_isuser !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) # Microsoft Developer Studio Generated NMAKE File, Based on _IsUser.dsp @@ -9,13 +10,10 @@ NULL= NULL=nul !ENDIF -OUTDIR=. -INTDIR=. -# Begin Custom Macros -OutDir=. -# End Custom Macros +OUTDIR=$(OUT) +INTDIR=$(OUT) -INSTALL : "$(OUTDIR)\_IsUser.dll" +INSTALL : "$(DESTDIR)\WinInstall\Config\_IsUser.dll" $(DEL) *.PCH $(DEL) *.IDB @@ -27,38 +25,35 @@ CLEAN :: -@erase "$(OUTDIR)\_IsUser.exp" -@erase "$(OUTDIR)\_IsUser.lib" -"$(OUTDIR)" :: - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - CPP=cl.exe CPP_PROJ=/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ISUSER_EXPORTS" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -.c{$(INTDIR)}.obj:: +.c.{$(OUT)\}obj:: $(CPP) @<< $(CPP_PROJ) $< << -.cpp{$(INTDIR)}.obj:: +.cpp.{$(OUT)\}obj:: $(CPP) @<< $(CPP_PROJ) $< << -.cxx{$(INTDIR)}.obj:: +.cxx.{$(OUT)\}obj:: $(CPP) @<< $(CPP_PROJ) $< << -.c{$(INTDIR)}.sbr:: +.c.$(OUT)\sbr:: $(CPP) @<< $(CPP_PROJ) $< << -.cpp{$(INTDIR)}.sbr:: +.cpp.$(OUT)\sbr:: $(CPP) @<< $(CPP_PROJ) $< << -.cxx{$(INTDIR)}.sbr:: +.cxx.$(OUT)\sbr:: $(CPP) @<< $(CPP_PROJ) $< << @@ -72,21 +67,24 @@ BSC32_FLAGS=/nologo /o"$(OUTDIR)\_IsUser.bsc" BSC32_SBRS= \ LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\_IsUser.pdb" /machine:I386 /out:"$(OUTDIR)\_IsUser.dll" /implib:"$(OUTDIR)\_IsUser.lib" +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\_IsUser.pdb" /machine:I386 /out:"$(DESTDIR)\WinInstall\Config\_IsUser.dll" /implib:"$(OUTDIR)\_IsUser.lib" LINK32_OBJS= \ "$(INTDIR)\_isuser.obj" \ "$(INTDIR)\_Isuser.res" -"$(OUTDIR)\_IsUser.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) +"$(DESTDIR)\WinInstall\Config\_IsUser.dll" : $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << SOURCE=.\_isuser.c -"$(INTDIR)\_isuser.obj" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\_isuser.obj" : $(SOURCE) SOURCE=.\_Isuser.RC -"$(INTDIR)\_Isuser.res" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\_Isuser.res" : $(SOURCE) $(RSC) $(RSC_PROJ) $(SOURCE) + + +mkdir: diff --git a/src/WINNT/afs_setup_utils/lang/NTMakefile b/src/WINNT/afs_setup_utils/lang/NTMakefile index 5d43c9fa7..89b5de4cc 100644 --- a/src/WINNT/afs_setup_utils/lang/NTMakefile +++ b/src/WINNT/afs_setup_utils/lang/NTMakefile @@ -10,7 +10,7 @@ AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include -I.. # include the primary makefile - +RELDIR=WINNT\afs_setup_utils\lang !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\..\config\NTMakefile.version @@ -35,7 +35,7 @@ DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\afs_setup_utils_$(LANGID).dll RCFILE = $(LANGNAME)\afs_setup_utils.rc -RESFILE = afs_setup_utils_$(LANGID).res +RESFILE = $(OUT)\afs_setup_utils_$(LANGID).res DLLOBJS = $(RESFILE) @@ -60,3 +60,6 @@ clean :: $(RESFILE) : $(RCFILE) AFS_component_version_number.h $(RC) /fo$(RESFILE) /c$(LANGCP) $(RCFILE) + +mkdir: + diff --git a/src/WINNT/afs_setup_utils/lang/de_DE/afs_setup_utils.rc b/src/WINNT/afs_setup_utils/lang/de_DE/afs_setup_utils.rc index fc8c340c9..de602dcf1 100644 --- a/src/WINNT/afs_setup_utils/lang/de_DE/afs_setup_utils.rc +++ b/src/WINNT/afs_setup_utils/lang/de_DE/afs_setup_utils.rc @@ -49,6 +49,10 @@ BEGIN IDS_TITLE "AFS® für Windows" IDS_CANT_DETERMINE_APP_PATH "Installationsverzeichnis der Anwendung konnte nicht ermittelt werden" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_CLIENT_APP_NAME "AFS Client" IDS_SERVER_APP_NAME "AFS Server" IDS_CC_APP_NAME "AFS Control Center" @@ -64,6 +68,10 @@ BEGIN IDS_PRESERVE_SERVER_CONFIG_INFO "Möchten Sie die Konfigurationsdaten des Servers erhalten? Dies kann bei einer Erweiterung oder erneuten Installation sinnvoll sein." IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED "Frühere Konfigurationsdaten konnten nicht wiederhergestellt werden" IDS_SAVE_OF_CONFIG_INFO_FAILED "Konfigurationsdaten konnten nicht gesichert werden. Deinstallation fortsetzen?" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO "Möchten Sie die Konfigurationsdaten des AFS Light Clients erhalten? Dies kann bei einer Erweiterung oder erneuten Installation sinnvoll sein." IDS_PRESERVE_CC_CONFIG_INFO "Möchten Sie die Konfigurationsdaten des Control Center erhalten? Dies kann bei einer Erweiterung oder erneuten Installation sinnvoll sein." END diff --git a/src/WINNT/afs_setup_utils/lang/en_US/afs_setup_utils.rc b/src/WINNT/afs_setup_utils/lang/en_US/afs_setup_utils.rc index 228e525fa..8febb20d3 100644 --- a/src/WINNT/afs_setup_utils/lang/en_US/afs_setup_utils.rc +++ b/src/WINNT/afs_setup_utils/lang/en_US/afs_setup_utils.rc @@ -50,6 +50,10 @@ BEGIN IDS_TITLE "AFS® for Windows" IDS_CANT_DETERMINE_APP_PATH "Failed to determine the application's installation directory" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_CLIENT_APP_NAME "AFS Client" IDS_SERVER_APP_NAME "AFS Server" IDS_CC_APP_NAME "AFS Control Center" @@ -65,6 +69,10 @@ BEGIN IDS_PRESERVE_SERVER_CONFIG_INFO "Do you wish to preserve the Server's configuration information? You may want to do this if you are upgrading or reinstalling." IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED "Failed to restore previous configuration information" IDS_SAVE_OF_CONFIG_INFO_FAILED "Failed to save the configuration information. Proceed with the uninstall?" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO "Do you wish to preserve AFS Light's configuration information? You may want to do this if you are upgrading or reinstalling." IDS_PRESERVE_CC_CONFIG_INFO "Do you wish to preserve the Control Center's configuration information? You may want to do this if you are upgrading or reinstalling." END diff --git a/src/WINNT/afs_setup_utils/lang/es_ES/afs_setup_utils.rc b/src/WINNT/afs_setup_utils/lang/es_ES/afs_setup_utils.rc index 39d9f0253..b9905a001 100644 --- a/src/WINNT/afs_setup_utils/lang/es_ES/afs_setup_utils.rc +++ b/src/WINNT/afs_setup_utils/lang/es_ES/afs_setup_utils.rc @@ -50,6 +50,10 @@ BEGIN IDS_TITLE "AFS« para Windows" IDS_CANT_DETERMINE_APP_PATH "No se ha podido determinar el directorio de instalación de la aplicación" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_CLIENT_APP_NAME "AFS Client" IDS_SERVER_APP_NAME "AFS Server" IDS_CC_APP_NAME "AFS Control Center" @@ -65,6 +69,10 @@ BEGIN IDS_PRESERVE_SERVER_CONFIG_INFO "¿Desea conservar la información de configuración de Server? Es recomendable si va a actualizarlo o instalarlo de nuevo." IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED "Anomalía al restaurar la información de configuración anterior" IDS_SAVE_OF_CONFIG_INFO_FAILED "Anomalía al guardar la información de configuración. ¿Continuar con la desinstalación?" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO "¿Desea conservar la información de configuración de AFS Light? Es recomendable si va a actualizarlo o instalarlo de nuevo." IDS_PRESERVE_CC_CONFIG_INFO "¿Desea conservar la información de configuración de Control Center? Es recomendable si va a actualizarlo o instalarlo de nuevo." END diff --git a/src/WINNT/afs_setup_utils/lang/ja_JP/afs_setup_utils.rc b/src/WINNT/afs_setup_utils/lang/ja_JP/afs_setup_utils.rc index 1f3ecb9fd..d617b12f3 100644 --- a/src/WINNT/afs_setup_utils/lang/ja_JP/afs_setup_utils.rc +++ b/src/WINNT/afs_setup_utils/lang/ja_JP/afs_setup_utils.rc @@ -50,6 +50,10 @@ BEGIN IDS_TITLE "AFS(R) for Windows" IDS_CANT_DETERMINE_APP_PATH "ƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚ªƒCƒ“ƒXƒg[ƒ‹‚³‚ê‚Ä‚¢‚éƒfƒBƒŒƒNƒgƒŠ[‚𔻕ʂł«‚Ü‚¹‚ñ" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_CLIENT_APP_NAME "AFS ƒNƒ‰ƒCƒAƒ“ƒg" IDS_SERVER_APP_NAME "AFS ƒT[ƒo[" IDS_CC_APP_NAME "AFS ƒRƒ“ƒgƒ[ƒ‹EƒZƒ“ƒ^[" @@ -65,6 +69,10 @@ BEGIN IDS_PRESERVE_SERVER_CONFIG_INFO "ƒT[ƒo[‚̍\¬î•ñ‚ð•ÛŽ‚µ‚Ü‚·‚©? ƒAƒbƒvƒOƒŒ[ƒh‚Ü‚½‚͍ăCƒ“ƒXƒg[ƒ‹‚̏ꍇ‚ɂ́A‚±‚ê‚ðs‚¤‚Æ—L—p‚Å‚·B" IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED "‘O‚̍\¬î•ñ‚Ì•œŒ³‚ÉŽ¸”s‚µ‚Ü‚µ‚½" IDS_SAVE_OF_CONFIG_INFO_FAILED "\¬î•ñ‚̕ۊǂɎ¸”s‚µ‚Ü‚µ‚½BƒAƒ“ƒCƒ“ƒXƒg[ƒ‹‚𑱍s‚µ‚Ü‚·‚©?" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO "AFS Light ‚̍\¬î•ñ‚ð•ÛŽ‚µ‚Ü‚·‚©? ƒAƒbƒvƒOƒŒ[ƒh‚Ü‚½‚͍ăCƒ“ƒXƒg[ƒ‹‚̏ꍇ‚ɂ́A‚±‚ê‚ðs‚¤‚Æ—L—p‚Å‚·B" IDS_PRESERVE_CC_CONFIG_INFO "ƒRƒ“ƒgƒ[ƒ‹EƒZƒ“ƒ^[‚̍\¬î•ñ‚ð•ÛŽ‚µ‚Ü‚·‚©? ƒAƒbƒvƒOƒŒ[ƒh‚Ü‚½‚͍ăCƒ“ƒXƒg[ƒ‹‚̏ꍇ‚ɂ́A‚±‚ê‚ðs‚¤‚Æ—L—p‚Å‚·B" END diff --git a/src/WINNT/afs_setup_utils/lang/ko_KR/afs_setup_utils.rc b/src/WINNT/afs_setup_utils/lang/ko_KR/afs_setup_utils.rc index 7ad3b0ddb..08cd70490 100644 --- a/src/WINNT/afs_setup_utils/lang/ko_KR/afs_setup_utils.rc +++ b/src/WINNT/afs_setup_utils/lang/ko_KR/afs_setup_utils.rc @@ -7,184 +7,184 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#define AFS_VERINFO_FILE_DESCRIPTION "AFS Setup Utilities DLL" +#include + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#define AFS_VERINFO_FILE_DESCRIPTION "AFS Setup Utilities DLL" #define AFS_VERINFO_NAME "afs_setup_utils" #define AFS_VERINFO_FILENAME "afs_setup_utils.exe" #define AFS_VERINFO_CHARSET 949 #define AFS_VERINFO_LANG_CODE 0x412 -#include "AFS_component_version_number.h" -#include "..\..\..\..\config\NTVersioninfo.rc" - -///////////////////////////////////////////////////////////////////////////// -// Korean resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR) -#ifdef _WIN32 -LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_PROGRESS DIALOGEX 0, 0, 251, 53 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "Windows¿ë AFS" -FONT 9, "±¼¸²" -BEGIN - ICON "",IDC_LOGO,17,16,20,21 - LTEXT "AFS ¼­¹ö¸¦ ÁßÁöÇϰí ÀÖ½À´Ï´Ù. Àá½Ã ±â´Ù¸®½Ê½Ã¿À...", - IDC_MSG,50,23,184,10 - GROUPBOX "",IDC_STATIC,7,4,237,40 -END - -IDD_LICENSE DIALOGEX 0, 0, 315, 204 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "»ç¿ë±Ç °è¾à " -FONT 9, "±¼¸²" -BEGIN - DEFPUSHBUTTON "µ¿ÀÇÇÔ(&A)",IDOK,197,185,50,14 - PUSHBUTTON "Ãë¼Ò",IDC_STATIC,255,185,50,14,WS_DISABLED - CONTROL "",IDC_TEXT,"RichEdit20A",WS_VSCROLL | 0x844,10,10,295, - 161,WS_EX_STATICEDGE - PUSHBUTTON "Àμâ(&P)",IDC_PRINT,10,185,50,14 - PUSHBUTTON "µ¿ÀÇÇÏÁö ¾ÊÀ½(&D)",IDCANCEL,135,185,62,14 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,178,296,1 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_SPIN1 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin1.ico" -IDI_SPIN2 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin2.ico" -IDI_SPIN3 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin3.ico" -IDI_SPIN4 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin4.ico" -IDI_SPIN5 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin5.ico" -IDI_SPIN6 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin6.ico" -IDI_SPIN7 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin7.ico" -IDI_SPIN8 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin8.ico" -IDI_SPINSTOP ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spinstop.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""resource.h""\r\n" - "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""windows.h""\r\n" - "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""afs_component_version_number.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_INSTALLATION_FAILURE "¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù. %s (%ld)." - IDS_SCM_OPEN_FAILED "¼­ºñ½º Á¦¾î °ü¸® ÇÁ·Î±×·¥À» ¿©´Âµ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_SERVICE_CREATE_FAILED "¼­ºñ½º ÀÛ¼º¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_SERVICE_OPEN_FAILED "¼­ºñ½º¸¦ ¿©´Âµ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù." - IDS_SERVICE_QUERY_FAILED "¼­ºñ½º »óÅ Á¶È¸¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_SERVICE_STOP_FAILED "¼­ºñ½º Á¤Áö¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_SERVICE_DELETE_FAILED "¼­ºñ½º »èÁ¦¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_REG_DELETE_VALUE_ERROR "·¹Áö½ºÆ®¸® ÀÔ·Â Ç׸ñ »èÁ¦¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_SERVICE_ENABLE_FAILED "¼­ºñ½º »ç¿ë °¡´ÉÈ­¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_OLE_DLL_INSTALL_FAILED "OLE DLL ¼³Ä¡¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_OLE_DLL_UNINSTALL_FAILED "OLE DLL ¼³Ä¡ ÇØÁ¦¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_EXTENSION_DLL_UNINSTALL_FAILED - "ÆÄÀϼ¼Æ® ¸¶¿îÆ®/¾ð¸¶¿îÆ® ½© È®Àå ¼³Ä¡ ÇØÁ¦¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_EXTENSION_DLL_INSTALL_FAILED - "ÆÄÀϼ¼Æ® ¸¶¿îÆ®/¾ð¸¶¿îÆ® ½© È®Àå ¼³Ä¡¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù." - IDS_CANT_DETERMINE_PRODUCT "AFS Á¦Ç° ¼³Ä¡ ÇØÁ¦¸¦ °áÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_TITLE "Windows¿ë AFS" - IDS_CANT_DETERMINE_APP_PATH - "ÀÀ¿ëÇÁ·Î±×·¥ÀÇ ¼³Ä¡ µð·ºÅ丮¸¦ °áÁ¤Çϴµ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_CLIENT_APP_NAME "AFS Ŭ¶óÀ̾ðÆ®" - IDS_SERVER_APP_NAME "AFS ¼­¹ö" - IDS_CC_APP_NAME "AFS Á¦¾î ¼¾ÅÍ" - IDS_CANT_LOAD_RESOURCES "ÀÌ Á¦Ç°À» ¼³Ä¡ ÇØÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù. ¼³Ä¡ ÇØÁ¦ÇÒ ÀÚ¿øÀ» ·ÎµåÇϴµ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_CANT_UNINSTALL_AFSCREDS - "AFS Ŭ¶óÀÌ¾ðÆ®¸¦ ±¸¼º ÇØÁ¦ÇÏ´Â µ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_MUST_STOP_SERVER "¼³Ä¡ ÇØÁ¦¸¦ °è¼ÓÇϱâ Àü¿¡ AFS ¼­¹ö¸¦ ÁßÁöÇØ¾ß ÇÕ´Ï´Ù. ÀÌ ÇÁ·Î¼¼½º´Â ¿À·¡ °É¸± ¼ö ÀÖ½À´Ï´Ù. Áö±Ý ¼­¹ö¸¦ ÁßÁöÇϽðڽÀ´Ï±î? " - IDS_MUST_STOP_CLIENT "¼³Ä¡ ÇØÁ¦¸¦ °è¼ÓÇϱâ Àü¿¡ AFS Ŭ¶óÀÌ¾ðÆ®¸¦ ÁßÁöÇØ¾ß ÇÕ´Ï´Ù. Áö±Ý Ŭ¶óÀÌ¾ðÆ®¸¦ ÁßÁöÇϽðڽÀ´Ï±î?" - IDS_LIGHT_CLIENT_APP_NAME "AFS ¶óÀÌÆ®" - IDS_WAITING_FOR_CLIENT_TO_STOP - "AFS Ŭ¶óÀÌ¾ðÆ®¸¦ ÁßÁöÇϰí ÀÖ½À´Ï´Ù. Àá½Ã ±â´Ù¸®½Ê½Ã¿À..." - IDS_WAITING_FOR_SERVER_TO_STOP - "AFS ¼­¹ö¸¦ ÁßÁöÇϰí ÀÖ½À´Ï´Ù. Àá½Ã ±â´Ù¸®½Ê½Ã¿À..." - IDS_CLIENT_NEEDED_BY_SERVER - "AFS Ŭ¶óÀÌ¾ðÆ®¸¦ ¼³Ä¡ ÇØÁ¦Çϸé AFS ¼­¹ö°¡ ¿Ã¹Ù¸£°Ô ±â´ÉÇÏÁö ¾ÊÀ» °ÍÀÔ´Ï´Ù. ¼³Ä¡ ÇØÁ¦¸¦ °è¼ÓÇϽðڽÀ´Ï±î?" - IDS_PRESERVE_CLIENT_CONFIG_INFO - "Ŭ¶óÀÌ¾ðÆ® ±¸¼º Á¤º¸¸¦ º¸Á¸ÇϽðڽÀ´Ï±î? ¾÷±×·¹ÀÌµå ¶Ç´Â À缳ġÇÏ´Â °æ¿ì À̸¦ ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù. " - IDS_PRESERVE_SERVER_CONFIG_INFO - "¼­¹ö ±¸¼º Á¤º¸¸¦ º¸Á¸ÇϽðڽÀ´Ï±î? ¾÷±×·¹ÀÌµå ¶Ç´Â À缳ġÇÏ´Â °æ¿ì À̸¦ ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED - "±âÁ¸ ±¸¼º Á¤º¸¸¦ º¹¿øÇϴµ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " - IDS_SAVE_OF_CONFIG_INFO_FAILED - "±¸¼º Á¤º¸¸¦ ÀúÀåÇϴµ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù. ¼³Ä¡ ÇØÁ¦¸¦ °è¼ÓÇϽðڽÀ´Ï±î? " - IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO - "AFS ¶óÀÌÆ® ±¸¼º Á¤º¸¸¦ º¸Á¸ÇϽðڽÀ´Ï±î? ¾÷±×·¹ÀÌµå ¶Ç´Â À缳ġÇÏ´Â °æ¿ì À̸¦ ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù." - IDS_PRESERVE_CC_CONFIG_INFO - "Á¦¾î ¼¾ÅÍ ±¸¼º Á¤º¸¸¦ º¸Á¸ÇϽðڽÀ´Ï±î? ¾÷±×·¹ÀÌµå ¶Ç´Â À缳ġÇÏ´Â °æ¿ì À̸¦ ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù." -END - -#endif // Korean resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\..\..\config\NTVersioninfo.rc" + +///////////////////////////////////////////////////////////////////////////// +// Korean resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR) +#ifdef _WIN32 +LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_PROGRESS DIALOGEX 0, 0, 251, 53 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION +EXSTYLE WS_EX_TOOLWINDOW +CAPTION "Windows¿ë AFS" +FONT 9, "±¼¸²" +BEGIN + ICON "",IDC_LOGO,17,16,20,21 + LTEXT "AFS ¼­¹ö¸¦ ÁßÁöÇϰí ÀÖ½À´Ï´Ù. Àá½Ã ±â´Ù¸®½Ê½Ã¿À...", + IDC_MSG,50,23,184,10 + GROUPBOX "",IDC_STATIC,7,4,237,40 +END + +IDD_LICENSE DIALOGEX 0, 0, 315, 204 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "»ç¿ë±Ç °è¾à " +FONT 9, "±¼¸²" +BEGIN + DEFPUSHBUTTON "µ¿ÀÇÇÔ(&A)",IDOK,197,185,50,14 + PUSHBUTTON "Ãë¼Ò",IDC_STATIC,255,185,50,14,WS_DISABLED + CONTROL "",IDC_TEXT,"RichEdit20A",WS_VSCROLL | 0x844,10,10,295, + 161,WS_EX_STATICEDGE + PUSHBUTTON "Àμâ(&P)",IDC_PRINT,10,185,50,14 + PUSHBUTTON "µ¿ÀÇÇÏÁö ¾ÊÀ½(&D)",IDCANCEL,135,185,62,14 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,10,178,296,1 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_SPIN1 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin1.ico" +IDI_SPIN2 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin2.ico" +IDI_SPIN3 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin3.ico" +IDI_SPIN4 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin4.ico" +IDI_SPIN5 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin5.ico" +IDI_SPIN6 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin6.ico" +IDI_SPIN7 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin7.ico" +IDI_SPIN8 ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spin8.ico" +IDI_SPINSTOP ICON DISCARDABLE "..\\..\\..\\afsapplib\\resource\\spinstop.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""resource.h""\r\n" + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""afs_component_version_number.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_INSTALLATION_FAILURE "¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù. %s (%ld)." + IDS_SCM_OPEN_FAILED "¼­ºñ½º Á¦¾î °ü¸® ÇÁ·Î±×·¥À» ¿©´Âµ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " + IDS_SERVICE_CREATE_FAILED "¼­ºñ½º ÀÛ¼º¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " + IDS_SERVICE_OPEN_FAILED "¼­ºñ½º¸¦ ¿©´Âµ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù." + IDS_SERVICE_QUERY_FAILED "¼­ºñ½º »óÅ Á¶È¸¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " + IDS_SERVICE_STOP_FAILED "¼­ºñ½º Á¤Áö¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " + IDS_SERVICE_DELETE_FAILED "¼­ºñ½º »èÁ¦¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " + IDS_REG_DELETE_VALUE_ERROR "·¹Áö½ºÆ®¸® ÀÔ·Â Ç׸ñ »èÁ¦¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " + IDS_SERVICE_ENABLE_FAILED "¼­ºñ½º »ç¿ë °¡´ÉÈ­¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " + IDS_OLE_DLL_INSTALL_FAILED "OLE DLL ¼³Ä¡¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " + IDS_OLE_DLL_UNINSTALL_FAILED "OLE DLL ¼³Ä¡ ÇØÁ¦¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " + IDS_EXTENSION_DLL_UNINSTALL_FAILED + "ÆÄÀϼ¼Æ® ¸¶¿îÆ®/¾ð¸¶¿îÆ® ½© È®Àå ¼³Ä¡ ÇØÁ¦¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " + IDS_EXTENSION_DLL_INSTALL_FAILED + "ÆÄÀϼ¼Æ® ¸¶¿îÆ®/¾ð¸¶¿îÆ® ½© È®Àå ¼³Ä¡¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù." + IDS_CANT_DETERMINE_PRODUCT "AFS Á¦Ç° ¼³Ä¡ ÇØÁ¦¸¦ °áÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_TITLE "Windows¿ë AFS" + IDS_CANT_DETERMINE_APP_PATH + "ÀÀ¿ëÇÁ·Î±×·¥ÀÇ ¼³Ä¡ µð·ºÅ丮¸¦ °áÁ¤Çϴµ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CLIENT_APP_NAME "AFS Ŭ¶óÀ̾ðÆ®" + IDS_SERVER_APP_NAME "AFS ¼­¹ö" + IDS_CC_APP_NAME "AFS Á¦¾î ¼¾ÅÍ" + IDS_CANT_LOAD_RESOURCES "ÀÌ Á¦Ç°À» ¼³Ä¡ ÇØÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù. ¼³Ä¡ ÇØÁ¦ÇÒ ÀÚ¿øÀ» ·ÎµåÇϴµ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " + IDS_CANT_UNINSTALL_AFSCREDS + "AFS Ŭ¶óÀÌ¾ðÆ®¸¦ ±¸¼º ÇØÁ¦ÇÏ´Â µ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " + IDS_MUST_STOP_SERVER "¼³Ä¡ ÇØÁ¦¸¦ °è¼ÓÇϱâ Àü¿¡ AFS ¼­¹ö¸¦ ÁßÁöÇØ¾ß ÇÕ´Ï´Ù. ÀÌ ÇÁ·Î¼¼½º´Â ¿À·¡ °É¸± ¼ö ÀÖ½À´Ï´Ù. Áö±Ý ¼­¹ö¸¦ ÁßÁöÇϽðڽÀ´Ï±î? " + IDS_MUST_STOP_CLIENT "¼³Ä¡ ÇØÁ¦¸¦ °è¼ÓÇϱâ Àü¿¡ AFS Ŭ¶óÀÌ¾ðÆ®¸¦ ÁßÁöÇØ¾ß ÇÕ´Ï´Ù. Áö±Ý Ŭ¶óÀÌ¾ðÆ®¸¦ ÁßÁöÇϽðڽÀ´Ï±î?" + IDS_LIGHT_CLIENT_APP_NAME "AFS ¶óÀÌÆ®" + IDS_WAITING_FOR_CLIENT_TO_STOP + "AFS Ŭ¶óÀÌ¾ðÆ®¸¦ ÁßÁöÇϰí ÀÖ½À´Ï´Ù. Àá½Ã ±â´Ù¸®½Ê½Ã¿À..." + IDS_WAITING_FOR_SERVER_TO_STOP + "AFS ¼­¹ö¸¦ ÁßÁöÇϰí ÀÖ½À´Ï´Ù. Àá½Ã ±â´Ù¸®½Ê½Ã¿À..." + IDS_CLIENT_NEEDED_BY_SERVER + "AFS Ŭ¶óÀÌ¾ðÆ®¸¦ ¼³Ä¡ ÇØÁ¦Çϸé AFS ¼­¹ö°¡ ¿Ã¹Ù¸£°Ô ±â´ÉÇÏÁö ¾ÊÀ» °ÍÀÔ´Ï´Ù. ¼³Ä¡ ÇØÁ¦¸¦ °è¼ÓÇϽðڽÀ´Ï±î?" + IDS_PRESERVE_CLIENT_CONFIG_INFO + "Ŭ¶óÀÌ¾ðÆ® ±¸¼º Á¤º¸¸¦ º¸Á¸ÇϽðڽÀ´Ï±î? ¾÷±×·¹ÀÌµå ¶Ç´Â À缳ġÇÏ´Â °æ¿ì À̸¦ ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù. " + IDS_PRESERVE_SERVER_CONFIG_INFO + "¼­¹ö ±¸¼º Á¤º¸¸¦ º¸Á¸ÇϽðڽÀ´Ï±î? ¾÷±×·¹ÀÌµå ¶Ç´Â À缳ġÇÏ´Â °æ¿ì À̸¦ ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù." + IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED + "±âÁ¸ ±¸¼º Á¤º¸¸¦ º¹¿øÇϴµ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù. " + IDS_SAVE_OF_CONFIG_INFO_FAILED + "±¸¼º Á¤º¸¸¦ ÀúÀåÇϴµ¥ ½ÇÆÐÇÏ¿´½À´Ï´Ù. ¼³Ä¡ ÇØÁ¦¸¦ °è¼ÓÇϽðڽÀ´Ï±î? " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO + "AFS ¶óÀÌÆ® ±¸¼º Á¤º¸¸¦ º¸Á¸ÇϽðڽÀ´Ï±î? ¾÷±×·¹ÀÌµå ¶Ç´Â À缳ġÇÏ´Â °æ¿ì À̸¦ ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù." + IDS_PRESERVE_CC_CONFIG_INFO + "Á¦¾î ¼¾ÅÍ ±¸¼º Á¤º¸¸¦ º¸Á¸ÇϽðڽÀ´Ï±î? ¾÷±×·¹ÀÌµå ¶Ç´Â À缳ġÇÏ´Â °æ¿ì À̸¦ ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù." +END + +#endif // Korean resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afs_setup_utils/lang/pt_BR/afs_setup_utils.rc b/src/WINNT/afs_setup_utils/lang/pt_BR/afs_setup_utils.rc index c90252c87..b8b95163a 100644 --- a/src/WINNT/afs_setup_utils/lang/pt_BR/afs_setup_utils.rc +++ b/src/WINNT/afs_setup_utils/lang/pt_BR/afs_setup_utils.rc @@ -50,6 +50,10 @@ BEGIN IDS_TITLE "AFS® para Windows" IDS_CANT_DETERMINE_APP_PATH "Falha ao determinar o diretório de instalação da aplicação" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_CLIENT_APP_NAME "AFS Client" IDS_SERVER_APP_NAME "AFS Server" IDS_CC_APP_NAME "Centro de Controle do AFS" @@ -65,6 +69,10 @@ BEGIN IDS_PRESERVE_SERVER_CONFIG_INFO "Deseja preservar as informações de configuração do Servidor? Isto pode ser desejável se estiver atualizando ou reinstalando." IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED "Não foi possível restaurar as informações da configuração anterior." IDS_SAVE_OF_CONFIG_INFO_FAILED "Não foi possível salvar as informações da configuração. Prosseguir a remoção da instalação?" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO "Deseja preservar as informações de configuração do AFS Básico? Isto pode ser desejável se estiver atualizando ou reinstalando." IDS_PRESERVE_CC_CONFIG_INFO "Deseja preservar as informações de configuração do Centro de Controle? Isto pode ser desejável se estiver atualizando ou reinstalando." END diff --git a/src/WINNT/afs_setup_utils/lang/zh_CN/afs_setup_utmls.rc b/src/WINNT/afs_setup_utils/lang/zh_CN/afs_setup_utils.rc similarity index 98% rename from src/WINNT/afs_setup_utils/lang/zh_CN/afs_setup_utmls.rc rename to src/WINNT/afs_setup_utils/lang/zh_CN/afs_setup_utils.rc index 769f0ba1d..a30ee3741 100644 --- a/src/WINNT/afs_setup_utils/lang/zh_CN/afs_setup_utmls.rc +++ b/src/WINNT/afs_setup_utils/lang/zh_CN/afs_setup_utils.rc @@ -50,6 +50,10 @@ BEGIN IDS_TITLE "AFS(R) Windows °æ" IDS_CANT_DETERMINE_APP_PATH "È·¶¨Ó¦ÓóÌÐò°²×°Ä¿Â¼Ê§°Ü" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_CLIENT_APP_NAME "AFS ¿Í»§»ú" IDS_SERVER_APP_NAME "AFS ·þÎñÆ÷" IDS_CC_APP_NAME "AFS ¿ØÖÆÖÐÐÄ" @@ -65,6 +69,10 @@ BEGIN IDS_PRESERVE_SERVER_CONFIG_INFO "ÄúÏ£Íû±£Áô·þÎñÆ÷µÄÅäÖÃÐÅÏ¢Âð? Äú¿ÉÄÜ»áÔÚÉý¼¶»òÖØÐ°²×°Ê±ÕâÑù×ö¡£" IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED "»Ö¸´ÒÔǰµÄÅäÖÃÐÅϢʧ°Ü" IDS_SAVE_OF_CONFIG_INFO_FAILED "±£´æÅäÖÃÐÅϢʧ°Ü¡£Òª¼ÌÐøÐ¶×°Âð?" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO "ÄúÏ£Íû±£Áô AFS Light µÄÅäÖÃÐÅÏ¢Âð? Äú¿ÉÄÜ»áÔÚÉý¼¶»òÖØÐ°²×°Ê±ÕâÑù×ö¡£" IDS_PRESERVE_CC_CONFIG_INFO "ÄúÏ£Íû±£Áô¿ØÖÆÖÐÐĵÄÅäÖÃÐÅÏ¢Âð? Äú¿ÉÄÜ»áÔÚÉý¼¶»òÖØÐ°²×°Ê±ÕâÑù×ö¡£" END diff --git a/src/WINNT/afs_setup_utils/lang/zh_TW/afs_setup_utils.rc b/src/WINNT/afs_setup_utils/lang/zh_TW/afs_setup_utils.rc index 2ec33b6d2..383f9c975 100644 --- a/src/WINNT/afs_setup_utils/lang/zh_TW/afs_setup_utils.rc +++ b/src/WINNT/afs_setup_utils/lang/zh_TW/afs_setup_utils.rc @@ -50,6 +50,10 @@ BEGIN IDS_TITLE "AFS for Windows" IDS_CANT_DETERMINE_APP_PATH "µLªk§PÂ_À³¥Îµ{¦¡ªº¦w¸Ë¥Ø¿ý" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_CLIENT_APP_NAME "AFS ¥Î¤áºÝ" IDS_SERVER_APP_NAME "AFS ¦øªA¾¹" IDS_CC_APP_NAME "AFS ±±¨î¤¤¤ß" @@ -65,6 +69,10 @@ BEGIN IDS_PRESERVE_SERVER_CONFIG_INFO "±z­n«O¯d¦øªA¾¹ªº¬[ºc¸ê°T¶Ü¡H­Y±z­n¤É¯Å©Î­«·s¦w¸Ë¡A´N¥i¯à»Ý­n«O¯d¸ê°T¡C" IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED "µLªk«ì´_¥ý«eªº¬[ºc¸ê°T" IDS_SAVE_OF_CONFIG_INFO_FAILED "µLªkÀx¦s¬[ºc¸ê°T¡CÄ~Äò¸Ñ°£¦w¸Ë¶Ü¡H" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO "±z­n«O¯d AFS Light ªº¬[ºc¸ê°T¶Ü¡H­Y±z­n¤É¯Å©Î­«·s¦w¸Ë¡A´N¥i¯à»Ý­n«O¯d¸ê°T¡C" IDS_PRESERVE_CC_CONFIG_INFO "±z­n«O¯d±±¨î¤¤¤ßªº¬[ºc¸ê°T¶Ü¡H­Y±z­n¤É¯Å©Î­«·s¦w¸Ë¡A´N¥i¯à»Ý­n«O¯d¸ê°T¡C" END diff --git a/src/WINNT/afs_setup_utils/resource.h b/src/WINNT/afs_setup_utils/resource.h index 51f9e1595..4c3090145 100644 --- a/src/WINNT/afs_setup_utils/resource.h +++ b/src/WINNT/afs_setup_utils/resource.h @@ -8,40 +8,44 @@ */ #define IDC_STATIC -1 -#define IDS_INSTALLATION_FAILURE 1 -#define IDS_SCM_OPEN_FAILED 2 -#define IDS_SERVICE_CREATE_FAILED 3 -#define IDS_SERVICE_OPEN_FAILED 4 -#define IDS_SERVICE_QUERY_FAILED 5 -#define IDS_SERVICE_STOP_FAILED 6 -#define IDS_SERVICE_DELETE_FAILED 7 -#define IDS_REG_DELETE_VALUE_ERROR 8 -#define IDS_SERVICE_ENABLE_FAILED 10 -#define IDS_OLE_DLL_INSTALL_FAILED 11 -#define IDS_OLE_DLL_UNINSTALL_FAILED 12 -#define IDS_EXTENSION_DLL_UNINSTALL_FAILED 13 -#define IDS_EXTENSION_DLL_INSTALL_FAILED 14 -#define IDS_CANT_DETERMINE_PRODUCT 15 -#define IDS_TITLE 16 -#define IDS_CANT_DETERMINE_APP_PATH 17 -#define IDS_CLIENT_APP_NAME 18 -#define IDS_SERVER_APP_NAME 19 -#define IDS_CC_APP_NAME 20 -#define IDS_CANT_LOAD_RESOURCES 21 -#define IDS_CANT_UNINSTALL_AFSCREDS 22 -#define IDS_MUST_STOP_SERVER 23 -#define IDS_MUST_STOP_CLIENT 24 -#define IDS_LIGHT_CLIENT_APP_NAME 25 -#define IDS_WAITING_FOR_CLIENT_TO_STOP 26 -#define IDS_WAITING_FOR_SERVER_TO_STOP 27 -#define IDD_PROGRESS 28 -#define IDS_CLIENT_NEEDED_BY_SERVER 29 -#define IDS_PRESERVE_CLIENT_CONFIG_INFO 30 -#define IDS_PRESERVE_SERVER_CONFIG_INFO 31 -#define IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED 32 -#define IDS_SAVE_OF_CONFIG_INFO_FAILED 33 -#define IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO 34 -#define IDS_PRESERVE_CC_CONFIG_INFO 35 + +#define IDS_INSTALLATION_FAILURE 0 +#define IDS_SCM_OPEN_FAILED 1 +#define IDS_SERVICE_CREATE_FAILED 2 +#define IDS_SERVICE_OPEN_FAILED 3 +#define IDS_SERVICE_QUERY_FAILED 4 +#define IDS_SERVICE_STOP_FAILED 5 +#define IDS_SERVICE_DELETE_FAILED 6 +#define IDS_REG_DELETE_VALUE_ERROR 7 +#define IDS_SERVICE_ENABLE_FAILED 8 +#define IDS_OLE_DLL_INSTALL_FAILED 9 +#define IDS_OLE_DLL_UNINSTALL_FAILED 10 +#define IDS_EXTENSION_DLL_UNINSTALL_FAILED 11 +#define IDS_EXTENSION_DLL_INSTALL_FAILED 12 +#define IDS_CANT_DETERMINE_PRODUCT 13 +#define IDS_TITLE 14 +#define IDS_CANT_DETERMINE_APP_PATH 15 + +#define IDS_CLIENT_APP_NAME 16 +#define IDS_SERVER_APP_NAME 17 +#define IDS_CC_APP_NAME 18 +#define IDS_CANT_LOAD_RESOURCES 19 +#define IDS_CANT_UNINSTALL_AFSCREDS 20 +#define IDS_MUST_STOP_SERVER 21 +#define IDS_MUST_STOP_CLIENT 22 +#define IDS_LIGHT_CLIENT_APP_NAME 23 +#define IDS_WAITING_FOR_CLIENT_TO_STOP 24 +#define IDS_WAITING_FOR_SERVER_TO_STOP 25 +#define IDD_PROGRESS 26 +#define IDS_CLIENT_NEEDED_BY_SERVER 27 +#define IDS_PRESERVE_CLIENT_CONFIG_INFO 28 +#define IDS_PRESERVE_SERVER_CONFIG_INFO 29 +#define IDS_RESTORE_OF_PREVIOUS_CONFIG_FAILED 30 +#define IDS_SAVE_OF_CONFIG_INFO_FAILED 31 + +#define IDS_PRESERVE_LIGHT_CLIENT_CONFIG_INFO 32 +#define IDS_PRESERVE_CC_CONFIG_INFO 33 + #define IDD_LICENSE 36 #define IDC_LOGO 1000 #define IDC_MSG 1001 diff --git a/src/WINNT/afsadmsvr/NTMakefile b/src/WINNT/afsadmsvr/NTMakefile index 0e5de4c1a..39481c70e 100644 --- a/src/WINNT/afsadmsvr/NTMakefile +++ b/src/WINNT/afsadmsvr/NTMakefile @@ -15,6 +15,7 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -DIGNORE_STDS_H # include the primary makefile +RELDIR=WINNT\afsadmsvr !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version @@ -41,35 +42,40 @@ IDLFILES = \ iTaAfsAdmSvrTypes.h LIBOBJS = \ - TaAfsAdmSvrClient.obj \ - TaAfsAdmSvrClientBind.obj \ - TaAfsAdmSvrClientCache.obj \ - TaAfsAdmSvrClientCell.obj \ - TaAfsAdmSvrClientGroup.obj \ - TaAfsAdmSvrClientInternal.obj \ - TaAfsAdmSvrClientNotify.obj \ - TaAfsAdmSvrClientPing.obj \ - TaAfsAdmSvrClientUser.obj \ - TaAfsAdmSvrCommon.obj \ - iTaAfsAdmSvr_c.obj + $(OUT)\TaAfsAdmSvrClient.obj \ + $(OUT)\TaAfsAdmSvrClientBind.obj \ + $(OUT)\TaAfsAdmSvrClientCache.obj \ + $(OUT)\TaAfsAdmSvrClientCell.obj \ + $(OUT)\TaAfsAdmSvrClientGroup.obj \ + $(OUT)\TaAfsAdmSvrClientInternal.obj \ + $(OUT)\TaAfsAdmSvrClientNotify.obj \ + $(OUT)\TaAfsAdmSvrClientPing.obj \ + $(OUT)\TaAfsAdmSvrClientUser.obj \ + $(OUT)\TaAfsAdmSvrCommon.obj \ + $(OUT)\iTaAfsAdmSvr_c.obj + +EXERES = $(OUT)\AfsAdmSvr.res + + +$(EXERES):$$(@B).rc + $(RC) $** EXEOBJS = \ - AfsAdmSvr.res \ - TaAfsAdmSvr.obj \ - TaAfsAdmSvrCallback.obj \ - TaAfsAdmSvrCell.obj \ - TaAfsAdmSvrCommon.obj \ - TaAfsAdmSvrDebug.obj \ - TaAfsAdmSvrGeneral.obj \ - TaAfsAdmSvrGroup.obj \ - TaAfsAdmSvrMain.obj \ - TaAfsAdmSvrProperties.obj \ - TaAfsAdmSvrSearch.obj \ - TaAfsAdmSvrUser.obj \ - iTaAfsAdmSvr_s.obj + $(OUT)\TaAfsAdmSvr.obj \ + $(OUT)\TaAfsAdmSvrCallback.obj \ + $(OUT)\TaAfsAdmSvrCell.obj \ + $(OUT)\TaAfsAdmSvrCommon.obj \ + $(OUT)\TaAfsAdmSvrDebug.obj \ + $(OUT)\TaAfsAdmSvrGeneral.obj \ + $(OUT)\TaAfsAdmSvrGroup.obj \ + $(OUT)\TaAfsAdmSvrMain.obj \ + $(OUT)\TaAfsAdmSvrProperties.obj \ + $(OUT)\TaAfsAdmSvrSearch.obj \ + $(OUT)\TaAfsAdmSvrUser.obj \ + $(OUT)\iTaAfsAdmSvr_s.obj VCLIBS =\ - gdi32.lib \ + gdi32.lib \ user32.lib \ rpcns4.lib \ rpcrt4.lib \ @@ -84,7 +90,7 @@ EXELIBS = \ $(DESTDIR)\lib\afs\AfsVosAdmin.lib \ $(DESTDIR)\lib\afs\AfsBosAdmin.lib \ $(DESTDIR)\lib\afs\AfsAdminUtil.lib \ - $(DESTDIR)\lib\afs\AfsClientAdmin.lib + $(DESTDIR)\lib\afs\AfsClientAdmin.lib \ ############################################################################ # @@ -101,12 +107,14 @@ MIDL_FLAGS=/ms_ext \ /pack 8 \ /W3 \ /WX \ + /no_robust \ /nologo .SUFFIXES: .h .idl .idl.h: - midl $(MIDL_FLAGS) $< + echo [$<] + midl $(MIDL_FLAGS) $(AFSDEV_AUXMIDLFLAGS) $< ############################################################################ @@ -161,5 +169,14 @@ clean:: afsclass_clean afsapplib_clean # Dependencies # -AfsAdmSvr.res : AfsAdmSvr.rc AFS_component_version_number.h - +$(OUT)\AfsAdmSvr.res : AFS_component_version_number.h + +mkdir: + -mkdir $(OUT)\..\afsapplib + cd ..\afsapplib + nmake /nologo /f ntmakefile mkdir + cd ..\afsadmsvr + -mkdir $(OUT)\..\afsclass + cd ..\afsclass + nmake /nologo /f ntmakefile mkdir + cd ..\afsadmsvr diff --git a/src/WINNT/afsadmsvr/TaAfsAdmSvr.cpp b/src/WINNT/afsadmsvr/TaAfsAdmSvr.cpp index fb5222f6f..d1ac9a554 100644 --- a/src/WINNT/afsadmsvr/TaAfsAdmSvr.cpp +++ b/src/WINNT/afsadmsvr/TaAfsAdmSvr.cpp @@ -22,7 +22,7 @@ // ...obtains a cookie to represent the calling process. The cookie should // be freed with AfsAdmSvr_Disconnect when the process disconnects. // -int AfsAdmSvr_Connect (STRING szClientAddress, DWORD *pidClient, ULONG *pStatus) +extern "C" int AfsAdmSvr_Connect (STRING szClientAddress, DWORD *pidClient, ULONG *pStatus) { // Make sure AfsClass initialized properly. If it's already init'd, // this won't hurt at all. @@ -51,7 +51,7 @@ int AfsAdmSvr_Connect (STRING szClientAddress, DWORD *pidClient, ULONG *pStatus) // seconds, lest the admin server think you've disconnected. (The // client library TaAfsAdmSvrClient.lib automatically handles this.) // -int AfsAdmSvr_Ping (DWORD idClient, ULONG *pStatus) +extern "C" int AfsAdmSvr_Ping (DWORD idClient, ULONG *pStatus) { AfsAdmSvr_Enter(); @@ -67,7 +67,7 @@ int AfsAdmSvr_Ping (DWORD idClient, ULONG *pStatus) // AfsAdmSvr_Disconnect // ...releases and invalidates the cookie representing the calling process. // -int AfsAdmSvr_Disconnect (DWORD idClient, ULONG *pStatus) +extern "C" int AfsAdmSvr_Disconnect (DWORD idClient, ULONG *pStatus) { AfsAdmSvr_Enter(); @@ -88,7 +88,7 @@ int AfsAdmSvr_Disconnect (DWORD idClient, ULONG *pStatus) // ...queries the specified AFS credentials token for its cell, user // and expiration date. // -int AfsAdmSvr_CrackCredentials (DWORD idClient, DWORD hCreds, STRING pszCell, STRING pszUser, SYSTEMTIME *pstExpiration, ULONG *pStatus) +extern "C" int AfsAdmSvr_CrackCredentials (DWORD idClient, DWORD hCreds, STRING pszCell, STRING pszUser, SYSTEMTIME *pstExpiration, ULONG *pStatus) { ULONG status; size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -121,7 +121,7 @@ int AfsAdmSvr_CrackCredentials (DWORD idClient, DWORD hCreds, STRING pszCell, ST // if the user already has credentials in the cell, returns a nonzero // token {hCreds}, suitable for use in AfsAdmSvr_OpenCell(). // -DWORD AfsAdmSvr_GetCredentials (DWORD idClient, STRING pszCell, ULONG *pStatus) +extern "C" DWORD AfsAdmSvr_GetCredentials (DWORD idClient, STRING pszCell, ULONG *pStatus) { ULONG status; size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -147,7 +147,7 @@ DWORD AfsAdmSvr_GetCredentials (DWORD idClient, STRING pszCell, ULONG *pStatus) // on behalf of the specified user. if successful, returns a nonzero // token {hCreds}, suitable for use in AfsAdmSvr_OpenCell(). // -DWORD AfsAdmSvr_SetCredentials (DWORD idClient, STRING pszCell, STRING pszUser, STRING pszPassword, ULONG *pStatus) +extern "C" DWORD AfsAdmSvr_SetCredentials (DWORD idClient, STRING pszCell, STRING pszUser, STRING pszPassword, ULONG *pStatus) { ULONG status; size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -173,7 +173,7 @@ DWORD AfsAdmSvr_SetCredentials (DWORD idClient, STRING pszCell, STRING pszUser, // when manipulating the specified cell. You should follow this // call with a Refresh request if necessary. // -int AfsAdmSvr_PushCredentials (DWORD idClient, DWORD hCreds, ASID idCell, ULONG *pStatus) +extern "C" int AfsAdmSvr_PushCredentials (DWORD idClient, DWORD hCreds, ASID idCell, ULONG *pStatus) { ULONG status; size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -201,7 +201,7 @@ int AfsAdmSvr_PushCredentials (DWORD idClient, DWORD hCreds, ASID idCell, ULONG // AfsAdmSvr_GetLocalCell // ...obtains the name of the primary cell used by the admin server // -int AfsAdmSvr_GetLocalCell (DWORD idClient, STRING pszCellName, ULONG *pStatus) +extern "C" int AfsAdmSvr_GetLocalCell (DWORD idClient, STRING pszCellName, ULONG *pStatus) { size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -224,7 +224,7 @@ int AfsAdmSvr_GetLocalCell (DWORD idClient, STRING pszCellName, ULONG *pStatus) // AfsAdmSvr_ErrorCodeTranslate // ...translates an error code into an English string // -int AfsAdmSvr_ErrorCodeTranslate (DWORD idClient, ULONG code, LANGID idLanguage, STRING pszErrorText, ULONG *pStatus) +extern "C" int AfsAdmSvr_ErrorCodeTranslate (DWORD idClient, ULONG code, LANGID idLanguage, STRING pszErrorText, ULONG *pStatus) { if (!AfsAppLib_TranslateError (pszErrorText, code, idLanguage)) return FALSE_(ERROR_INVALID_PARAMETER,pStatus); @@ -241,7 +241,7 @@ int AfsAdmSvr_ErrorCodeTranslate (DWORD idClient, ULONG code, LANGID idLanguage, // AfsAdmSvr_GetAction // ...returns information about a particular operation in progress. // -int AfsAdmSvr_GetAction (DWORD idClient, DWORD idAction, LPASACTION pAction, ULONG *pStatus) +extern "C" int AfsAdmSvr_GetAction (DWORD idClient, DWORD idAction, LPASACTION pAction, ULONG *pStatus) { Print (dlDETAIL, TEXT("Client 0x%08lX: GetAction (idAction=0x%08lX)"), idClient, idAction); @@ -261,7 +261,7 @@ int AfsAdmSvr_GetAction (DWORD idClient, DWORD idAction, LPASACTION pAction, ULO // be constrained to only including those operations initiated by // a particular client and/or performed in a particular cell. // -int AfsAdmSvr_GetActions (DWORD idClient, DWORD idClientSearch, ASID idCellSearch, LPASACTIONLIST *ppList, ULONG *pStatus) +extern "C" int AfsAdmSvr_GetActions (DWORD idClient, DWORD idClientSearch, ASID idCellSearch, LPASACTIONLIST *ppList, ULONG *pStatus) { Print (dlDETAIL, TEXT("Client 0x%08lX: GetActions (idClientSearch=0x%08lX, idCellSearch=0x%08lX)"), idClient, idClientSearch, idCellSearch); @@ -282,7 +282,7 @@ int AfsAdmSvr_GetActions (DWORD idClient, DWORD idClientSearch, ASID idCellSearc // AfsAdmSvr_OpenCell // ...opens a cell for administration. // -int AfsAdmSvr_OpenCell (DWORD idClient, DWORD hCreds, STRING pszCellName, DWORD dwScopeFlags, ASID *pidCell, ULONG *pStatus) +extern "C" int AfsAdmSvr_OpenCell (DWORD idClient, DWORD hCreds, STRING pszCellName, DWORD dwScopeFlags, ASID *pidCell, ULONG *pStatus) { size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -311,7 +311,7 @@ int AfsAdmSvr_OpenCell (DWORD idClient, DWORD hCreds, STRING pszCellName, DWORD // AfsAdmSvr_CloseCell // ...used by client to open a cell for administration. // -int AfsAdmSvr_CloseCell (DWORD idClient, ASID idCell, ULONG *pStatus) +extern "C" int AfsAdmSvr_CloseCell (DWORD idClient, ASID idCell, ULONG *pStatus) { size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -344,7 +344,7 @@ int AfsAdmSvr_CloseCell (DWORD idClient, ASID idCell, ULONG *pStatus) // which match the specified criteria--all volumes on a partition, // or all users named "b*" within a cell. // -int AfsAdmSvr_FindObject (DWORD idClient, ASID idSearchScope, ASOBJTYPE ObjectType, AFSADMSVR_SEARCH_REFRESH SearchRefresh, STRING szName, ASID *pidObject, ULONG *pStatus) +extern "C" int AfsAdmSvr_FindObject (DWORD idClient, ASID idSearchScope, ASOBJTYPE ObjectType, AFSADMSVR_SEARCH_REFRESH SearchRefresh, STRING szName, ASID *pidObject, ULONG *pStatus) { BOOL rc = TRUE; ULONG status = 0; @@ -445,7 +445,7 @@ int AfsAdmSvr_FindObject (DWORD idClient, ASID idSearchScope, ASOBJTYPE ObjectTy } -int AfsAdmSvr_FindObjects (DWORD idClient, ASID idSearchScope, ASOBJTYPE ObjectType, AFSADMSVR_SEARCH_REFRESH SearchRefresh, STRING szPattern, LPAFSADMSVR_SEARCH_PARAMS pSearchParams, LPASIDLIST *ppList, ULONG *pStatus) +extern "C" int AfsAdmSvr_FindObjects (DWORD idClient, ASID idSearchScope, ASOBJTYPE ObjectType, AFSADMSVR_SEARCH_REFRESH SearchRefresh, STRING szPattern, LPAFSADMSVR_SEARCH_PARAMS pSearchParams, LPASIDLIST *ppList, ULONG *pStatus) { BOOL rc = TRUE; ULONG status = 0; @@ -549,7 +549,7 @@ int AfsAdmSvr_FindObjects (DWORD idClient, ASID idSearchScope, ASOBJTYPE ObjectT // ...returns server-cached information about the specified object (or // objects). // -int AfsAdmSvr_GetObject (DWORD idClient, AFSADMSVR_GET_TYPE GetType, AFSADMSVR_GET_LEVEL GetLevel, ASID idObject, DWORD verProperties, LPASOBJPROP pProperties, ULONG *pStatus) +extern "C" int AfsAdmSvr_GetObject (DWORD idClient, AFSADMSVR_GET_TYPE GetType, AFSADMSVR_GET_LEVEL GetLevel, ASID idObject, DWORD verProperties, LPASOBJPROP pProperties, ULONG *pStatus) { size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -595,7 +595,7 @@ int AfsAdmSvr_GetObject (DWORD idClient, AFSADMSVR_GET_TYPE GetType, AFSADMSVR_G } -int AfsAdmSvr_GetObjects (DWORD idClient, AFSADMSVR_GET_TYPE GetType, AFSADMSVR_GET_LEVEL GetLevel, LPASIDLIST pListObjects, LPASOBJPROPLIST *ppListObjectProperties, ULONG *pStatus) +extern "C" int AfsAdmSvr_GetObjects (DWORD idClient, AFSADMSVR_GET_TYPE GetType, AFSADMSVR_GET_LEVEL GetLevel, LPASIDLIST pListObjects, LPASOBJPROPLIST *ppListObjectProperties, ULONG *pStatus) { size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -634,7 +634,7 @@ int AfsAdmSvr_GetObjects (DWORD idClient, AFSADMSVR_GET_TYPE GetType, AFSADMSVR_ // ...invalidates the server's cache of information about the specified // object or objects. // -int AfsAdmSvr_RefreshObject (DWORD idClient, ASID idObject, ULONG *pStatus) +extern "C" int AfsAdmSvr_RefreshObject (DWORD idClient, ASID idObject, ULONG *pStatus) { size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -654,7 +654,7 @@ int AfsAdmSvr_RefreshObject (DWORD idClient, ASID idObject, ULONG *pStatus) } -int AfsAdmSvr_RefreshObjects (DWORD idClient, LPASIDLIST pListObjects, ULONG *pStatus) +extern "C" int AfsAdmSvr_RefreshObjects (DWORD idClient, LPASIDLIST pListObjects, ULONG *pStatus) { size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -681,7 +681,7 @@ int AfsAdmSvr_RefreshObjects (DWORD idClient, LPASIDLIST pListObjects, ULONG *pS // be called on a dedicated thread by the client. (TaAfsAdmSvrClient.lib // automatically handles this.) // -void AfsAdmSvr_CallbackHost (void) +extern "C" void AfsAdmSvr_CallbackHost (void) { AfsAdmSvr_CallbackManager(); } @@ -691,7 +691,7 @@ void AfsAdmSvr_CallbackHost (void) // AfsAdmSvr_GetRandomKey // ...returns a randomly-generated 8-byte encryption key // -int AfsAdmSvr_GetRandomKey (DWORD idClient, ASID idCell, BYTE keyData[ ENCRYPTIONKEYLENGTH ], ULONG *pStatus) +extern "C" int AfsAdmSvr_GetRandomKey (DWORD idClient, ASID idCell, BYTE keyData[ ENCRYPTIONKEYLENGTH ], ULONG *pStatus) { if (!AfsAdmSvr_fIsValidClient (idClient)) return FALSE_(ERROR_INVALID_PARAMETER,pStatus); diff --git a/src/WINNT/afsadmsvr/TaAfsAdmSvrCallback.cpp b/src/WINNT/afsadmsvr/TaAfsAdmSvrCallback.cpp index 54431d10e..2c7df7dae 100644 --- a/src/WINNT/afsadmsvr/TaAfsAdmSvrCallback.cpp +++ b/src/WINNT/afsadmsvr/TaAfsAdmSvrCallback.cpp @@ -54,7 +54,7 @@ void AfsAdmSvr_CallbackManager (void) AfsAdmSvr_Enter(); if ((++l.cManagers) == 1) { - l.heCallback = CreateEvent (NULL, TRUE, FALSE, NULL); + l.heCallback = CreateEvent (NULL, TRUE, FALSE, TEXT("AfsAdmSvr_CallbackManager Event")); l.pListCallbacks = New (HASHLIST); } AfsAdmSvr_Leave(); diff --git a/src/WINNT/afsadmsvr/TaAfsAdmSvrCell.cpp b/src/WINNT/afsadmsvr/TaAfsAdmSvrCell.cpp index 18d4d2b30..a511b88ac 100644 --- a/src/WINNT/afsadmsvr/TaAfsAdmSvrCell.cpp +++ b/src/WINNT/afsadmsvr/TaAfsAdmSvrCell.cpp @@ -22,7 +22,7 @@ // AfsAdmSvr_ChangeCell // ...changes a cell's properties. // -int AfsAdmSvr_ChangeCell (DWORD idClient, ASID idCell, LPAFSADMSVR_CHANGECELL_PARAMS pChange, ULONG *pStatus) +extern "C" int AfsAdmSvr_ChangeCell (DWORD idClient, ASID idCell, LPAFSADMSVR_CHANGECELL_PARAMS pChange, ULONG *pStatus) { ASACTION Action; Action.Action = ACTION_CELL_CHANGE; @@ -60,7 +60,7 @@ int AfsAdmSvr_ChangeCell (DWORD idClient, ASID idCell, LPAFSADMSVR_CHANGECELL_PA // AfsAdmSvr_SetRefreshRate // ...changes the refresh rate for a specific cell // -int AfsAdmSvr_SetRefreshRate (DWORD idClient, ASID idCell, ULONG cminRefreshRate, ULONG *pStatus) +extern "C" int AfsAdmSvr_SetRefreshRate (DWORD idClient, ASID idCell, ULONG cminRefreshRate, ULONG *pStatus) { if (!AfsAdmSvr_fIsValidClient (idClient)) return FALSE_(ERROR_INVALID_PARAMETER,pStatus); diff --git a/src/WINNT/afsadmsvr/TaAfsAdmSvrClient.cpp b/src/WINNT/afsadmsvr/TaAfsAdmSvrClient.cpp index 9c2d760d7..b38028a70 100644 --- a/src/WINNT/afsadmsvr/TaAfsAdmSvrClient.cpp +++ b/src/WINNT/afsadmsvr/TaAfsAdmSvrClient.cpp @@ -32,12 +32,12 @@ static struct * */ -void __RPC_FAR * __RPC_USER MIDL_user_allocate (size_t cbAllocate) +extern "C" void __RPC_FAR * __RPC_USER MIDL_user_allocate (size_t cbAllocate) { return (void __RPC_FAR *)Allocate (cbAllocate); } -void __RPC_USER MIDL_user_free (void __RPC_FAR *pData) +extern "C" void __RPC_USER MIDL_user_free (void __RPC_FAR *pData) { Free (pData); } @@ -883,7 +883,7 @@ BOOL ADMINAPI asc_ActionListenClear (DWORD idClient, HWND hNotify, ULONG *pStatu // this routine is used to notify the client whenever an action is // initiated or completed. // -void AfsAdmSvrCallback_Action (LPASACTION pAction, BOOL fFinished) +extern "C" void AfsAdmSvrCallback_Action (LPASACTION pAction, BOOL fFinished) { NotifyActionListeners (pAction, fFinished); } diff --git a/src/WINNT/afsadmsvr/TaAfsAdmSvrGroup.cpp b/src/WINNT/afsadmsvr/TaAfsAdmSvrGroup.cpp index 66fa8a26a..4ad14b878 100644 --- a/src/WINNT/afsadmsvr/TaAfsAdmSvrGroup.cpp +++ b/src/WINNT/afsadmsvr/TaAfsAdmSvrGroup.cpp @@ -24,7 +24,7 @@ extern "C" { // AfsAdmSvr_ChangeGroup // ...changes a group account's properties. // -int AfsAdmSvr_ChangeGroup (DWORD idClient, ASID idCell, ASID idGroup, LPAFSADMSVR_CHANGEGROUP_PARAMS pChange, ULONG *pStatus) +extern "C" int AfsAdmSvr_ChangeGroup (DWORD idClient, ASID idCell, ASID idGroup, LPAFSADMSVR_CHANGEGROUP_PARAMS pChange, ULONG *pStatus) { ASACTION Action; Action.Action = ACTION_GROUP_CHANGE; @@ -101,7 +101,7 @@ int AfsAdmSvr_ChangeGroup (DWORD idClient, ASID idCell, ASID idGroup, LPAFSADMSV // AfsAdmSvr_GetGroupMembers // ...retrieves the list of users which belong to a group // -int AfsAdmSvr_GetGroupMembers (DWORD idClient, ASID idCell, ASID idGroup, LPASIDLIST *ppAsidList, ULONG *pStatus) +extern "C" int AfsAdmSvr_GetGroupMembers (DWORD idClient, ASID idCell, ASID idGroup, LPASIDLIST *ppAsidList, ULONG *pStatus) { size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -164,7 +164,7 @@ int AfsAdmSvr_GetGroupMembers (DWORD idClient, ASID idCell, ASID idGroup, LPASID // AfsAdmSvr_GetGroupMembership // ...retrieves the list of groups to which a user or group belongs // -int AfsAdmSvr_GetGroupMembership (DWORD idClient, ASID idCell, ASID idMember, LPASIDLIST *ppAsidList, ULONG *pStatus) +extern "C" int AfsAdmSvr_GetGroupMembership (DWORD idClient, ASID idCell, ASID idMember, LPASIDLIST *ppAsidList, ULONG *pStatus) { size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -229,7 +229,7 @@ int AfsAdmSvr_GetGroupMembership (DWORD idClient, ASID idCell, ASID idMember, LP // AfsAdmSvr_GetGroupOwnership // ...retrieves the list of groups which a user owns // -int AfsAdmSvr_GetGroupOwnership (DWORD idClient, ASID idCell, ASID idOwner, LPASIDLIST *ppAsidList, ULONG *pStatus) +extern "C" int AfsAdmSvr_GetGroupOwnership (DWORD idClient, ASID idCell, ASID idOwner, LPASIDLIST *ppAsidList, ULONG *pStatus) { size_t iOp = AfsAdmSvr_BeginOperation (idClient); @@ -294,7 +294,7 @@ int AfsAdmSvr_GetGroupOwnership (DWORD idClient, ASID idCell, ASID idOwner, LPAS // AfsAdmSvr_AddGroupMember // ...adds a member to the specified group // -int AfsAdmSvr_AddGroupMember (DWORD idClient, ASID idCell, ASID idGroup, ASID idMember, ULONG *pStatus) +extern "C" int AfsAdmSvr_AddGroupMember (DWORD idClient, ASID idCell, ASID idGroup, ASID idMember, ULONG *pStatus) { ASACTION Action; Action.Action = ACTION_GROUP_MEMBER_ADD; @@ -324,7 +324,7 @@ int AfsAdmSvr_AddGroupMember (DWORD idClient, ASID idCell, ASID idGroup, ASID id // AfsAdmSvr_RemoveGroupMember // ...removes a member from the specified group // -int AfsAdmSvr_RemoveGroupMember (DWORD idClient, ASID idCell, ASID idGroup, ASID idMember, ULONG *pStatus) +extern "C" int AfsAdmSvr_RemoveGroupMember (DWORD idClient, ASID idCell, ASID idGroup, ASID idMember, ULONG *pStatus) { ASACTION Action; Action.Action = ACTION_GROUP_MEMBER_REMOVE; @@ -354,7 +354,7 @@ int AfsAdmSvr_RemoveGroupMember (DWORD idClient, ASID idCell, ASID idGroup, ASID // AfsAdmSvr_RenameGroup // ...changes a group's name // -int AfsAdmSvr_RenameGroup (DWORD idClient, ASID idCell, ASID idGroup, STRING szNewGroupName, ULONG *pStatus) +extern "C" int AfsAdmSvr_RenameGroup (DWORD idClient, ASID idCell, ASID idGroup, STRING szNewGroupName, ULONG *pStatus) { ASACTION Action; Action.Action = ACTION_GROUP_RENAME; @@ -384,7 +384,7 @@ int AfsAdmSvr_RenameGroup (DWORD idClient, ASID idCell, ASID idGroup, STRING szN // AfsAdmSvr_CreateGroup // ...creates a new PTS group // -int AfsAdmSvr_CreateGroup (DWORD idClient, ASID idCell, LPAFSADMSVR_CREATEGROUP_PARAMS pCreate, ASID *pidGroup, ULONG *pStatus) +extern "C" int AfsAdmSvr_CreateGroup (DWORD idClient, ASID idCell, LPAFSADMSVR_CREATEGROUP_PARAMS pCreate, ASID *pidGroup, ULONG *pStatus) { ASACTION Action; Action.Action = ACTION_GROUP_CREATE; @@ -429,7 +429,7 @@ int AfsAdmSvr_CreateGroup (DWORD idClient, ASID idCell, LPAFSADMSVR_CREATEGROUP_ // AfsAdmSvr_DeleteGroup // ...deletes a PTS group // -int AfsAdmSvr_DeleteGroup (DWORD idClient, ASID idCell, ASID idGroup, ULONG *pStatus) +extern "C" int AfsAdmSvr_DeleteGroup (DWORD idClient, ASID idCell, ASID idGroup, ULONG *pStatus) { ASACTION Action; Action.Action = ACTION_GROUP_DELETE; diff --git a/src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp b/src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp index 8cc1a44b3..e9d67c3ba 100644 --- a/src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp +++ b/src/WINNT/afsadmsvr/TaAfsAdmSvrMain.cpp @@ -14,16 +14,6 @@ extern "C" { #include "TaAfsAdmSvrInternal.h" - -/* - * DEFINITIONS ________________________________________________________________ - * - */ - -extern void AfsAdmSvr_Startup (void); -extern void AfsAdmSvr_Shutdown (void); - - /* * ROUTINES ___________________________________________________________________ * @@ -194,13 +184,13 @@ int cdecl main (int argc, char **argv) } -void __RPC_FAR * __RPC_USER MIDL_user_allocate (size_t cbAllocate) +extern "C" void __RPC_FAR * __RPC_USER MIDL_user_allocate (size_t cbAllocate) { return (void __RPC_FAR *)Allocate (cbAllocate); } -void __RPC_USER MIDL_user_free (void __RPC_FAR *pData) +extern "C" void __RPC_USER MIDL_user_free (void __RPC_FAR *pData) { Free (pData); } diff --git a/src/WINNT/afsadmsvr/TaAfsAdmSvrUser.cpp b/src/WINNT/afsadmsvr/TaAfsAdmSvrUser.cpp index ee1f535bf..7e5e333b2 100644 --- a/src/WINNT/afsadmsvr/TaAfsAdmSvrUser.cpp +++ b/src/WINNT/afsadmsvr/TaAfsAdmSvrUser.cpp @@ -24,7 +24,7 @@ extern "C" { // AfsAdmSvr_ChangeUser // ...changes a user account's properties. // -int AfsAdmSvr_ChangeUser (DWORD idClient, ASID idCell, ASID idUser, LPAFSADMSVR_CHANGEUSER_PARAMS pChange, ULONG *pStatus) +extern "C" int AfsAdmSvr_ChangeUser (DWORD idClient, ASID idCell, ASID idUser, LPAFSADMSVR_CHANGEUSER_PARAMS pChange, ULONG *pStatus) { ASACTION Action; Action.Action = ACTION_USER_CHANGE; @@ -113,7 +113,7 @@ int AfsAdmSvr_ChangeUser (DWORD idClient, ASID idCell, ASID idUser, LPAFSADMSVR_ // string in {keyString} to encrypt the specified string; otherwise, // pass a valid encryption key in {keyData}. // -int AfsAdmSvr_SetUserPassword (DWORD idClient, ASID idCell, ASID idUser, int keyVersion, STRING keyString, BYTE keyData[ ENCRYPTIONKEYLENGTH ], ULONG *pStatus) +extern "C" int AfsAdmSvr_SetUserPassword (DWORD idClient, ASID idCell, ASID idUser, int keyVersion, STRING keyString, BYTE keyData[ ENCRYPTIONKEYLENGTH ], ULONG *pStatus) { BOOL rc = TRUE; ULONG status = 0; @@ -153,7 +153,7 @@ int AfsAdmSvr_SetUserPassword (DWORD idClient, ASID idCell, ASID idUser, int key // AfsAdmSvr_UnlockUser // ...unlocks a user's account // -int AfsAdmSvr_UnlockUser (DWORD idClient, ASID idCell, ASID idUser, ULONG *pStatus) +extern "C" int AfsAdmSvr_UnlockUser (DWORD idClient, ASID idCell, ASID idUser, ULONG *pStatus) { ASACTION Action; Action.Action = ACTION_USER_UNLOCK; @@ -182,7 +182,7 @@ int AfsAdmSvr_UnlockUser (DWORD idClient, ASID idCell, ASID idUser, ULONG *pStat // AfsAdmSvr_CreateUser // ...creates a new user account // -int AfsAdmSvr_CreateUser (DWORD idClient, ASID idCell, LPAFSADMSVR_CREATEUSER_PARAMS pCreate, ASID *pidUser, ULONG *pStatus) +extern "C" int AfsAdmSvr_CreateUser (DWORD idClient, ASID idCell, LPAFSADMSVR_CREATEUSER_PARAMS pCreate, ASID *pidUser, ULONG *pStatus) { ASACTION Action; Action.Action = ACTION_USER_CREATE; @@ -222,7 +222,7 @@ int AfsAdmSvr_CreateUser (DWORD idClient, ASID idCell, LPAFSADMSVR_CREATEUSER_PA // AfsAdmSvr_DeleteUser // ...deletes a user's account // -int AfsAdmSvr_DeleteUser (DWORD idClient, ASID idCell, ASID idUser, LPAFSADMSVR_DELETEUSER_PARAMS pDelete, ULONG *pStatus) +extern "C" int AfsAdmSvr_DeleteUser (DWORD idClient, ASID idCell, ASID idUser, LPAFSADMSVR_DELETEUSER_PARAMS pDelete, ULONG *pStatus) { ASACTION Action; Action.Action = ACTION_USER_DELETE; diff --git a/src/WINNT/afsapplib/NTMakefile b/src/WINNT/afsapplib/NTMakefile index 44ef0a61f..e4503835b 100644 --- a/src/WINNT/afsapplib/NTMakefile +++ b/src/WINNT/afsapplib/NTMakefile @@ -11,6 +11,7 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -DEXPORT_AFSAPPLIB -DEXPORTED=_declsp # include the primary makefile +RELDIR=WINNT\afsapplib !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version @@ -43,34 +44,34 @@ INCFILES = \ $(INCFILEDIR)\subclass.h DLLOBJS = \ - afsapplib_stub.res \ - afsapplib.obj \ - al_admsvr.obj \ - al_browse.obj \ - al_browseset.obj \ - al_cover.obj \ - al_creds.obj \ - al_dynlink.obj \ - al_error.obj \ - al_help.obj \ - al_misc.obj \ - al_progress.obj \ - al_pump.obj \ - al_task.obj \ - al_wizard.obj \ - checklist.obj \ - ctl_date.obj \ - ctl_elapsed.obj \ - ctl_sockaddr.obj \ - ctl_spinner.obj \ - ctl_time.obj \ - dialog.obj \ - fastlist.obj \ - hashlist.obj \ - regexp.obj \ - resize.obj \ - settings.obj \ - subclass.obj + $(OUT)\afsapplib_stub.res \ + $(OUT)\afsapplib.obj \ + $(OUT)\al_admsvr.obj \ + $(OUT)\al_browse.obj \ + $(OUT)\al_browseset.obj \ + $(OUT)\al_cover.obj \ + $(OUT)\al_creds.obj \ + $(OUT)\al_dynlink.obj \ + $(OUT)\al_error.obj \ + $(OUT)\al_help.obj \ + $(OUT)\al_misc.obj \ + $(OUT)\al_progress.obj \ + $(OUT)\al_pump.obj \ + $(OUT)\al_task.obj \ + $(OUT)\al_wizard.obj \ + $(OUT)\checklist.obj \ + $(OUT)\ctl_date.obj \ + $(OUT)\ctl_elapsed.obj \ + $(OUT)\ctl_sockaddr.obj \ + $(OUT)\ctl_spinner.obj \ + $(OUT)\ctl_time.obj \ + $(OUT)\dialog.obj \ + $(OUT)\fastlist.obj \ + $(OUT)\hashlist.obj \ + $(OUT)\regexp.obj \ + $(OUT)\resize.obj \ + $(OUT)\settings.obj \ + $(OUT)\subclass.obj VCLIBS =\ comctl32.lib \ @@ -132,5 +133,11 @@ clean:: # Dependencies # -AfsAppLib_stub.res : AfsAppLib_stub.rc AFS_component_version_number.h +$(OUT)\AfsAppLib_stub.res : AFS_component_version_number.h + +mkdir: + -mkdir $(OUT)\lang + cd lang + nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir + cd .. diff --git a/src/WINNT/afsapplib/al_cover.cpp b/src/WINNT/afsapplib/al_cover.cpp index b9639bdb7..5a02c71fe 100644 --- a/src/WINNT/afsapplib/al_cover.cpp +++ b/src/WINNT/afsapplib/al_cover.cpp @@ -21,10 +21,10 @@ extern "C" { */ rwWindowData awdCover[] = { - { IDC_COVER_BORDER, raSizeX | raSizeY }, - { IDC_COVER_DESC, raSizeX | raSizeY | raRepaint }, - { IDC_COVER_BUTTON, raMoveX | raMoveY | raRepaint }, - { idENDLIST, 0 } + { IDC_COVER_BORDER, raSizeX | raSizeY, 0, 0 }, + { IDC_COVER_DESC, raSizeX | raSizeY | raRepaint, 0, 0 }, + { IDC_COVER_BUTTON, raMoveX | raMoveY | raRepaint, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; #define WS_EX_HIDDENBYCOVER 0x10000000L diff --git a/src/WINNT/afsapplib/al_creds.cpp b/src/WINNT/afsapplib/al_creds.cpp index 34b305551..237a606f6 100644 --- a/src/WINNT/afsapplib/al_creds.cpp +++ b/src/WINNT/afsapplib/al_creds.cpp @@ -78,7 +78,7 @@ BOOL AfsAppLib_CrackCredentials (PVOID hCreds, LPTSTR pszCell, LPTSTR pszUser, L if (afsclient_TokenQuery (hCreds, &dateExpire, szUserA, szUser2A, szCellA, &fHasKasToken, (afs_status_p)&status)) { rc = TRUE; - CopyAnsiToString (pszUser, szUserA); + CopyAnsiToString (pszUser, szUserA); CopyAnsiToString (pszCell, szCellA); AfsAppLib_UnixTimeToSystemTime (pst, dateExpire); } @@ -954,7 +954,7 @@ BOOL AfsAppLib_IsUserAdmin (PVOID hCreds, LPTSTR pszUser) kas_principalEntry_t Entry; if (kas_PrincipalGet (hCell, NULL, &Identity, &Entry, &status)) { - if (Entry.adminSetting == ADMIN) + if (Entry.adminSetting == KAS_ADMIN) rc = TRUE; } diff --git a/src/WINNT/afsapplib/al_resource.h b/src/WINNT/afsapplib/al_resource.h index 6ee6958ae..a240a3993 100644 --- a/src/WINNT/afsapplib/al_resource.h +++ b/src/WINNT/afsapplib/al_resource.h @@ -7,24 +7,24 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#define IDC_COVERDLG 0 -#define IDS_BADCREDS_DESC_GENERAL 5001 -#define IDS_BADCREDS_DESC_EXPIRED 5002 -#define IDS_BADCREDS_DESC_BADCHOICE 5003 -#define IDS_BADCREDS_DESC2 5004 -#define IDS_BADCREDS_DESC3 5005 -#define IDS_BADCREDS_DESC3_ADM 5006 -#define IDS_BADCREDS_DESC_DESTROYED 5007 -#define IDS_ERROR_BAD_CREDENTIALS 5008 -#define IDS_BROWSE_WAITING 5009 -#define IDS_BROWSE_BADCELL_TITLE 5010 -#define IDS_BROWSE_BADCELL_DESC 5011 -#define IDS_CREDS_NONE 5012 -#define IDS_CREDS_VALID 5013 -#define IDS_CREDS_EXPIRED 5014 +#define IDS_BADCREDS_DESC_GENERAL 800 +#define IDS_BADCREDS_DESC_EXPIRED 801 +#define IDS_BADCREDS_DESC_BADCHOICE 802 +#define IDS_BADCREDS_DESC2 803 +#define IDS_BADCREDS_DESC3 804 +#define IDS_BADCREDS_DESC3_ADM 805 +#define IDS_BADCREDS_DESC_DESTROYED 806 +#define IDS_ERROR_BAD_CREDENTIALS 807 +#define IDS_BROWSE_WAITING 808 +#define IDS_BROWSE_BADCELL_TITLE 809 +#define IDS_BROWSE_BADCELL_DESC 810 +#define IDS_CREDS_NONE 811 +#define IDS_CREDS_VALID 812 +#define IDS_CREDS_EXPIRED 813 #define IDC_OPENCELL_CELL 11000 #define IDC_ERROR_STATUS 11001 #define IDC_ERROR_DESC 11002 +#define IDC_COVERDLG 11003 #define IDC_OPENCELL_ID 11004 #define IDC_OPENCELL_PASSWORD 11005 #define IDC_CREDS_CURRENTID 11006 diff --git a/src/WINNT/afsapplib/al_wizard.cpp b/src/WINNT/afsapplib/al_wizard.cpp index 63de35446..fe8b44f6b 100644 --- a/src/WINNT/afsapplib/al_wizard.cpp +++ b/src/WINNT/afsapplib/al_wizard.cpp @@ -168,6 +168,7 @@ void WIZARD::SetDialogTemplate (int iddTemplate, int idcLeftPane, int idcRightPa void WIZARD::SetGraphic (int idbGraphic16, int idbGraphic256) { LPRGBQUAD pargb = NULL; + RGBQUAD argb[256]; m_idbGraphic16 = idbGraphic16; m_idbGraphic256 = idbGraphic256; @@ -202,7 +203,6 @@ void WIZARD::SetGraphic (int idbGraphic16, int idbGraphic256) HDC hdc = CreateCompatibleDC (NULL); HBITMAP bmpOld = (HBITMAP)SelectObject (hdc, m_bmpGraphic256); - RGBQUAD argb[256]; GetDIBColorTable (hdc, 0, 256, argb); pargb = argb; diff --git a/src/WINNT/afsapplib/fastlist.cpp b/src/WINNT/afsapplib/fastlist.cpp index ec0fe7c4e..4065c8685 100644 --- a/src/WINNT/afsapplib/fastlist.cpp +++ b/src/WINNT/afsapplib/fastlist.cpp @@ -229,7 +229,7 @@ void FastList_OnStyleChange (HWND hList); void FastList_OnSize (HWND hList); void FastList_OnPaint (HWND hList); void FastList_OnPaintItem (LPFASTLIST pfl, LPFASTLISTDRAWITEM pdi); -void FastList_OnPaintItem_DrawImage (LPFASTLIST pfl, LPFASTLISTDRAWITEM pdi, int iImage, LONG xImage, LONG yImage, BOOL fHLines); +BOOL FastList_OnPaintItem_DrawImage (LPFASTLIST pfl, LPFASTLISTDRAWITEM pdi, HIMAGELIST hil, int iImage, LONG xImage, LONG yImage, BOOL fHLines); void FastList_OnPaintItem_GetItemColors (LPFASTLIST pfl, LPFASTLISTDRAWITEM pdi, COLORREF *pclrFore, COLORREF *pclrBack); void FastList_OnPaintItem_TreeLines (LPFASTLIST pfl, LPFASTLISTDRAWITEM pdi, DWORD dwLines, RECT *prLines); void FastList_OnPaintItem_Large (LPFASTLIST pfl, LPFASTLISTDRAWITEM pdi); diff --git a/src/WINNT/afsapplib/lang/NTMakefile b/src/WINNT/afsapplib/lang/NTMakefile index 47f462ad0..1cab6b5d8 100644 --- a/src/WINNT/afsapplib/lang/NTMakefile +++ b/src/WINNT/afsapplib/lang/NTMakefile @@ -11,6 +11,7 @@ AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include -I.. # include the primary makefile +RELDIR=WINNT\afsapplib\lang !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\..\config\NTMakefile.version @@ -35,7 +36,7 @@ DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\TaAfsAppLib_$(LANGID).dll RCFILE = $(LANGNAME)\afsapplib.rc -RESFILE = afsapplib_$(LANGID).res +RESFILE = $(OUT)\afsapplib_$(LANGID).res DLLOBJS = $(RESFILE) @@ -48,7 +49,8 @@ $(DLLFILE) : $(DLLOBJS) install : $(DLLFILE) clean :: - @if exist *.res del *.res + @if exist $(OUT)\*.res del $(OUT)\*.res + @if exist AFS_component_version_number.h del AFS_component_version_number.h @if exist RC*. del RC*. @if exist RD*. del RD*. @@ -60,3 +62,5 @@ clean :: $(RESFILE) : $(RCFILE) AFS_component_version_number.h $(RC) /fo$(RESFILE) /c$(LANGCP) $(RCFILE) +mkdir: + diff --git a/src/WINNT/afsapplib/lang/de_DE/afsapplib.rc b/src/WINNT/afsapplib/lang/de_DE/afsapplib.rc index ceb27817a..698816851 100644 --- a/src/WINNT/afsapplib/lang/de_DE/afsapplib.rc +++ b/src/WINNT/afsapplib/lang/de_DE/afsapplib.rc @@ -7,389 +7,385 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "al_resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "AFS Application Base DLL" +#include "al_resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "AFS Application Base DLL" #define AFS_VERINFO_DLL #define AFS_VERINFO_NAME "afsapplib" #define AFS_VERINFO_FILENAME "afsapplib.dll" #define AFS_VERINFO_LANG_CODE 0x407 #define AFS_VERINFO_CHARSET 1252 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "al_resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Application Base DLL""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -32513 ICON DISCARDABLE "Resource\\error.ico" -32515 ICON DISCARDABLE "Resource\\warning.ico" -IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" -IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" -IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" -IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" -IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" -IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" -IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" -IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" -IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" -IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" -IDI_SERVER ICON DISCARDABLE "resource\\server.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" -IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" -IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" -IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" -IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" -IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" -IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" -IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" -IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" -IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" -IDI_ACL ICON DISCARDABLE "resource\\acl.ico" -IDI_CELL ICON DISCARDABLE "resource\\cell.ico" -IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" -IDI_USER ICON DISCARDABLE "resource\\user.ico" -IDI_GROUP ICON DISCARDABLE "resource\\group.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Fehler" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Windows konnte den angeforderten Task nicht beenden, weil ein nicht erkannter Fehler auftrat.", - IDC_ERROR_DESC,31,7,242,33 - LTEXT "Fehler: %1",IDC_ERROR_STATUS,31,49,241,16 - DEFPUSHBUTTON "OK",IDOK,114,73,50,14 - ICON 32513,IDC_STATIC,4,7,20,20 -END - -IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 164 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "Zelle auswählen" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Zelle:",IDC_STATIC,4,24,16,8 - LTEXT "Wählen Sie die AFS-Zelle, mit der Sie arbeiten möchten.", - IDC_STATIC,4,7,200,8 - COMBOBOX IDC_OPENCELL_CELL,24,22,191,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS-&Identität:",IDC_STATIC,22,106,53,8 - EDITTEXT IDC_OPENCELL_ID,80,104,128,13,ES_AUTOHSCROLL - LTEXT "AFS-&Kennwort:",IDC_STATIC,22,122,55,8 - EDITTEXT IDC_OPENCELL_PASSWORD,80,120,128,13,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,57,146,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,111,146,50,14 - PUSHBUTTON "&Hilfe",9,165,146,50,14 - GROUPBOX "AFS-Authentifizierung",IDC_STATIC,4,45,211,96 - LTEXT "(Abfrage läuft...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "Um eine Zelle zu verwalten, müssen Sie Ihr AFS-Kennwort noch einmal eingeben:", - IDC_STATIC,10,82,199,16 - LTEXT "Ihre aktuellen AFS-Token innerhalb der ausgewählten Zelle:", - IDC_STATIC,10,57,196,8 -END - -IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 197, 140 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS-Authentifizierung" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "AFS-&Identität:",IDC_STATIC,8,75,51,8 - EDITTEXT IDC_CREDS_ID,64,73,124,14,ES_AUTOHSCROLL - LTEXT "AFS-&Kennwort:",IDC_STATIC,8,92,50,8 - EDITTEXT IDC_CREDS_PASSWORD,64,89,124,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "AFS-Zelle:",IDC_STATIC,4,7,52,8 - EDITTEXT IDC_CREDS_CELL,64,7,129,12,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE - LTEXT "Aktuelle Identität:",IDC_STATIC,4,23,56,8 - EDITTEXT IDC_CREDS_CURRENTID,64,22,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - LTEXT "Ablaufdatum:",IDC_STATIC,4,39,52,8 - EDITTEXT IDC_CREDS_EXPDATE,64,38,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - DEFPUSHBUTTON "OK",IDOK,35,122,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,89,122,50,14 - PUSHBUTTON "&Hilfe",9,143,122,50,14 - GROUPBOX " ",IDC_STATIC,4,57,189,56 - CONTROL "&Neue AFS-Token für diese Zelle besorgen", - IDC_CREDS_LOGIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8, - 57,148,10 -END - -IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "Warnung" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "&Ja",IDOK,173,78,50,14 - PUSHBUTTON "&Nein",IDCANCEL,227,78,50,14 - PUSHBUTTON "&Hilfe",9,281,78,50,14 - CONTROL "&Diese Warnung nicht mehr anzeigen",IDC_BADCREDS_SHUTUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,31,80,137,10 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "(während der Laufzeit gesetzter Text)", - IDC_BADCREDS_DESC,31,7,300,64 -END - -IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 -STYLE WS_CHILD | WS_BORDER -EXSTYLE WS_EX_CLIENTEDGE -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 - LTEXT "(Beschreibung erscheint hier)",IDC_COVER_DESC,14,14,162, - 107 - PUSHBUTTON "&Noch einmal versuchen...",IDC_COVER_BUTTON,126,107,50, - 14 -END - -IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | - WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU -CAPTION "Volume auswählen" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - RTEXT "Volume:",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "&Auswählen",IDOK,224,113,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,224,129,50,14 - RTEXT "In &Zelle schauen:",IDC_STATIC,7,9,41,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE - CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY - DEFPUSHBUTTON "(I get moved off the dialog so I'm invisible at runtime)", - IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP -END - -IDD_APPLIB_BROWSE DIALOG DISCARDABLE 0, 0, 281, 150 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | - WS_SYSMENU -CAPTION "(Dieser Fenstertitel wird zur Laufzeit ausgewählt)" -FONT 9, "MS Shell Dlg" -BEGIN - RTEXT "(Laufzeit)",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "&Auswählen",IDC_BROWSE_SELECT,224,112,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,224,129,50,14 - RTEXT "In &Zelle schauen:",IDC_STATIC,7,9,41,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "(I get moved off the dialog so I'm invisible at runtime)", - IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP - CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_APPLIB_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 87 - END - - IDD_APPLIB_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 7 - BOTTOMMARGIN, 160 - END - - IDD_APPLIB_CREDENTIALS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 193 - TOPMARGIN, 7 - BOTTOMMARGIN, 136 - END - - IDD_APPLIB_BADCREDS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 331 - TOPMARGIN, 7 - BOTTOMMARGIN, 92 - END - - IDD_APPLIB_COVER, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 182 - TOPMARGIN, 7 - BOTTOMMARGIN, 128 - END - - IDD_APPLIB_BROWSE_FILESET, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END - - IDD_APPLIB_BROWSE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" -IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" -IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" -IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" -IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" -IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" -IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" -IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" -IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_BADCREDS_DESC_GENERAL - "Sie besitzen keine AFS-Token als Administrator innerhalb der \n%1-Zelle.\n\n%2\n\n%3" - IDS_BADCREDS_DESC_EXPIRED - "Ihre Token innerhalb der %1-Zelle sind abgelaufen.\n\n%2\n\n%3" - IDS_BADCREDS_DESC_BADCHOICE - "Sie haben gewählt, sich nicht als Administrator innerhalb der \n%1-Zelle anzumelden.\n\n%2\n\n%3" - IDS_BADCREDS_DESC2 "Wenn Sie nicht als Administrator angemeldet sind, besitzen Sie vielleicht nur unzureichende Berechtigungen für die Arbeit mit der %1-Zelle." - IDS_BADCREDS_DESC3 "Möchten Sie sich jetzt neue AFS-Token besorgen?" - IDS_BADCREDS_DESC3_ADM "Möchten Sie sich statt dessen als Administrator anmelden?" - IDS_BADCREDS_DESC_DESTROYED - "Ihre Token innerhalb der %1-Zelle sind nicht mehr gültig.\n\n%2\n\n%3" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS - "Die von Ihnen eingegebene AFS-Identität ist unbekannt, oder das von Ihnen angegebene Kennwort ist nicht korrekt." - IDS_BROWSE_WAITING "Abfrage des Servers -- bitte warten..." - IDS_BROWSE_BADCELL_TITLE "Unbekannte Zelle" - IDS_BROWSE_BADCELL_DESC "Der von Ihnen eingegebene Zellenname konnte im Netzwerk nicht gefunden werden.\n\nBitte überprüfen Sie, ob Sie den Zellennamen korrekt eingegeben haben." - IDS_CREDS_NONE "(keine Token)" - IDS_CREDS_VALID "%2, verfällt %3" - IDS_CREDS_EXPIRED "(abgelaufene Token %3)" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "al_resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Application Base DLL""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +32513 ICON DISCARDABLE "Resource\\error.ico" +32515 ICON DISCARDABLE "Resource\\warning.ico" +IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" +IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" +IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" +IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" +IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" +IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" +IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" +IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" +IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" +IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" +IDI_SERVER ICON DISCARDABLE "resource\\server.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" +IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" +IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" +IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" +IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" +IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" +IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" +IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" +IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" +IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" +IDI_ACL ICON DISCARDABLE "resource\\acl.ico" +IDI_CELL ICON DISCARDABLE "resource\\cell.ico" +IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" +IDI_USER ICON DISCARDABLE "resource\\user.ico" +IDI_GROUP ICON DISCARDABLE "resource\\group.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Fehler" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Windows konnte den angeforderten Task nicht beenden, weil ein nicht erkannter Fehler auftrat.", + IDC_ERROR_DESC,31,7,242,33 + LTEXT "Fehler: %1",IDC_ERROR_STATUS,31,49,241,16 + DEFPUSHBUTTON "OK",IDOK,114,73,50,14 + ICON 32513,IDC_STATIC,4,7,20,20 +END + +IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 164 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Zelle auswählen" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Zelle:",IDC_STATIC,4,24,16,8 + LTEXT "Wählen Sie die AFS-Zelle, mit der Sie arbeiten möchten.", + IDC_STATIC,4,7,200,8 + COMBOBOX IDC_OPENCELL_CELL,24,22,191,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS-&Identität:",IDC_STATIC,22,106,53,8 + EDITTEXT IDC_OPENCELL_ID,80,104,128,13,ES_AUTOHSCROLL + LTEXT "AFS-&Kennwort:",IDC_STATIC,22,122,55,8 + EDITTEXT IDC_OPENCELL_PASSWORD,80,120,128,13,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,57,146,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,111,146,50,14 + PUSHBUTTON "&Hilfe",9,165,146,50,14 + GROUPBOX "AFS-Authentifizierung",IDC_STATIC,4,45,211,96 + LTEXT "(Abfrage läuft...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "Um eine Zelle zu verwalten, müssen Sie Ihr AFS-Kennwort noch einmal eingeben:", + IDC_STATIC,10,82,199,16 + LTEXT "Ihre aktuellen AFS-Token innerhalb der ausgewählten Zelle:", + IDC_STATIC,10,57,196,8 +END + +IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 197, 140 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS-Authentifizierung" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "AFS-&Identität:",IDC_STATIC,8,75,51,8 + EDITTEXT IDC_CREDS_ID,64,73,124,14,ES_AUTOHSCROLL + LTEXT "AFS-&Kennwort:",IDC_STATIC,8,92,50,8 + EDITTEXT IDC_CREDS_PASSWORD,64,89,124,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "AFS-Zelle:",IDC_STATIC,4,7,52,8 + EDITTEXT IDC_CREDS_CELL,64,7,129,12,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE + LTEXT "Aktuelle Identität:",IDC_STATIC,4,23,56,8 + EDITTEXT IDC_CREDS_CURRENTID,64,22,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + LTEXT "Ablaufdatum:",IDC_STATIC,4,39,52,8 + EDITTEXT IDC_CREDS_EXPDATE,64,38,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + DEFPUSHBUTTON "OK",IDOK,35,122,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,89,122,50,14 + PUSHBUTTON "&Hilfe",9,143,122,50,14 + GROUPBOX " ",IDC_STATIC,4,57,189,56 + CONTROL "&Neue AFS-Token für diese Zelle besorgen", + IDC_CREDS_LOGIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8, + 57,148,10 +END + +IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Warnung" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "&Ja",IDOK,173,78,50,14 + PUSHBUTTON "&Nein",IDCANCEL,227,78,50,14 + PUSHBUTTON "&Hilfe",9,281,78,50,14 + CONTROL "&Diese Warnung nicht mehr anzeigen",IDC_BADCREDS_SHUTUP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,31,80,137,10 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "(während der Laufzeit gesetzter Text)", + IDC_BADCREDS_DESC,31,7,300,64 +END + +IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 +STYLE WS_CHILD | WS_BORDER +EXSTYLE WS_EX_CLIENTEDGE +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 + LTEXT "(Beschreibung erscheint hier)",IDC_COVER_DESC,14,14,162, + 107 + PUSHBUTTON "&Noch einmal versuchen...",IDC_COVER_BUTTON,126,107,50, + 14 +END + +IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | + WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "Volume auswählen" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + RTEXT "Volume:",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "&Auswählen",IDOK,224,113,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,224,129,50,14 + RTEXT "In &Zelle schauen:",IDC_STATIC,7,9,41,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE + CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY + DEFPUSHBUTTON "(I get moved off the dialog so I'm invisible at runtime)", + IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP +END + +IDD_APPLIB_BROWSE DIALOG DISCARDABLE 0, 0, 281, 150 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | + WS_SYSMENU +CAPTION "(Dieser Fenstertitel wird zur Laufzeit ausgewählt)" +FONT 9, "MS Shell Dlg" +BEGIN + RTEXT "(Laufzeit)",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "&Auswählen",IDC_BROWSE_SELECT,224,112,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,224,129,50,14 + RTEXT "In &Zelle schauen:",IDC_STATIC,7,9,41,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "(I get moved off the dialog so I'm invisible at runtime)", + IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP + CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_APPLIB_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 87 + END + + IDD_APPLIB_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 7 + BOTTOMMARGIN, 160 + END + + IDD_APPLIB_CREDENTIALS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 193 + TOPMARGIN, 7 + BOTTOMMARGIN, 136 + END + + IDD_APPLIB_BADCREDS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 331 + TOPMARGIN, 7 + BOTTOMMARGIN, 92 + END + + IDD_APPLIB_COVER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 182 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END + + IDD_APPLIB_BROWSE_FILESET, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END + + IDD_APPLIB_BROWSE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" +IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" +IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" +IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" +IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" +IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" +IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" +IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" +IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADCREDS_DESC_GENERAL + "Sie besitzen keine AFS-Token als Administrator innerhalb der \n%1-Zelle.\n\n%2\n\n%3" + IDS_BADCREDS_DESC_EXPIRED + "Ihre Token innerhalb der %1-Zelle sind abgelaufen.\n\n%2\n\n%3" + IDS_BADCREDS_DESC_BADCHOICE + "Sie haben gewählt, sich nicht als Administrator innerhalb der \n%1-Zelle anzumelden.\n\n%2\n\n%3" + IDS_BADCREDS_DESC2 "Wenn Sie nicht als Administrator angemeldet sind, besitzen Sie vielleicht nur unzureichende Berechtigungen für die Arbeit mit der %1-Zelle." + IDS_BADCREDS_DESC3 "Möchten Sie sich jetzt neue AFS-Token besorgen?" + IDS_BADCREDS_DESC3_ADM "Möchten Sie sich statt dessen als Administrator anmelden?" + IDS_BADCREDS_DESC_DESTROYED + "Ihre Token innerhalb der %1-Zelle sind nicht mehr gültig.\n\n%2\n\n%3" + IDS_ERROR_BAD_CREDENTIALS + "Die von Ihnen eingegebene AFS-Identität ist unbekannt, oder das von Ihnen angegebene Kennwort ist nicht korrekt." + IDS_BROWSE_WAITING "Abfrage des Servers -- bitte warten..." + IDS_BROWSE_BADCELL_TITLE "Unbekannte Zelle" + IDS_BROWSE_BADCELL_DESC "Der von Ihnen eingegebene Zellenname konnte im Netzwerk nicht gefunden werden.\n\nBitte überprüfen Sie, ob Sie den Zellennamen korrekt eingegeben haben." + IDS_CREDS_NONE "(keine Token)" + IDS_CREDS_VALID "%2, verfällt %3" + IDS_CREDS_EXPIRED "(abgelaufene Token %3)" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afsapplib/lang/en_US/afsapplib.rc b/src/WINNT/afsapplib/lang/en_US/afsapplib.rc index bcd5b5adf..28414d573 100644 --- a/src/WINNT/afsapplib/lang/en_US/afsapplib.rc +++ b/src/WINNT/afsapplib/lang/en_US/afsapplib.rc @@ -361,10 +361,6 @@ BEGIN IDS_BADCREDS_DESC3_ADM "Would you like to log in as an administrator instead?" IDS_BADCREDS_DESC_DESTROYED "Your tokens within the %1 cell are no longer valid.\n\n%2\n\n%3" -END - -STRINGTABLE DISCARDABLE -BEGIN IDS_ERROR_BAD_CREDENTIALS "The AFS identity you have entered is unrecognized, or the password you have specified is incorrect." IDS_BROWSE_WAITING "querying server--please wait..." diff --git a/src/WINNT/afsapplib/lang/es_ES/afsapplib.rc b/src/WINNT/afsapplib/lang/es_ES/afsapplib.rc index 2db6918c8..eb7426799 100644 --- a/src/WINNT/afsapplib/lang/es_ES/afsapplib.rc +++ b/src/WINNT/afsapplib/lang/es_ES/afsapplib.rc @@ -7,389 +7,385 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "al_resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "AFS Application Base DLL" +#include "al_resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "AFS Application Base DLL" #define AFS_VERINFO_DLL #define AFS_VERINFO_NAME "afsapplib" #define AFS_VERINFO_FILENAME "afsapplib.dll" #define AFS_VERINFO_LANG_CODE 0x40a #define AFS_VERINFO_CHARSET 1252 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "al_resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Application Base DLL""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -32513 ICON DISCARDABLE "Resource\\error.ico" -32515 ICON DISCARDABLE "Resource\\warning.ico" -IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" -IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" -IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" -IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" -IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" -IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" -IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" -IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" -IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" -IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" -IDI_SERVER ICON DISCARDABLE "resource\\server.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" -IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" -IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" -IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" -IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" -IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" -IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" -IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" -IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" -IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" -IDI_ACL ICON DISCARDABLE "resource\\acl.ico" -IDI_CELL ICON DISCARDABLE "resource\\cell.ico" -IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" -IDI_USER ICON DISCARDABLE "resource\\user.ico" -IDI_GROUP ICON DISCARDABLE "resource\\group.ico" - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Error" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Windows no ha podido completar la tarea solicitada porque se ha producido un error no reconocido.", - IDC_ERROR_DESC,31,7,242,33 - LTEXT "Error: %1",IDC_ERROR_STATUS,31,49,241,16 - DEFPUSHBUTTON "Aceptar",IDOK,114,73,50,14 - ICON 32513,IDC_STATIC,4,7,20,20 -END - -IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 231, 165 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "Seleccionar célula" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Célula:",IDC_STATIC,4,24,21,8 - LTEXT "Seleccione la célula de AFS con la que le gustaría trabajar.", - IDC_STATIC,4,7,200,8 - COMBOBOX IDC_OPENCELL_CELL,33,22,191,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Identidad de AFS:",IDC_STATIC,22,105,67,8 - EDITTEXT IDC_OPENCELL_ID,94,103,128,13,ES_AUTOHSCROLL - LTEXT "C&ontraseña de AFS:",IDC_STATIC,22,121,65,8 - EDITTEXT IDC_OPENCELL_PASSWORD,94,119,128,13,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "Aceptar",IDOK,57,147,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,111,147,50,14 - PUSHBUTTON "&Ayuda",9,177,147,50,14 - GROUPBOX "Autentificación de AFS",IDC_STATIC,4,44,223,92 - LTEXT "(consultando...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "Para administrar una célula, debe volver a entrar la contraseña de AFS:", - IDC_STATIC,10,81,203,18 - LTEXT "Las señales de AFS actuales dentro de la célula seleccionada:", - IDC_STATIC,10,57,196,8 -END - -IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 210, 141 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Autentificación de AFS" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Identidad de AFS:",IDC_STATIC,8,75,60,8 - EDITTEXT IDC_CREDS_ID,75,73,124,14,ES_AUTOHSCROLL - LTEXT "&Contraseña de AFS:",IDC_STATIC,8,92,65,8 - EDITTEXT IDC_CREDS_PASSWORD,75,89,124,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "Célula de AFS:",IDC_STATIC,4,7,64,8 - EDITTEXT IDC_CREDS_CELL,76,7,129,12,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE - LTEXT "Identidad actual:",IDC_STATIC,4,23,70,8 - EDITTEXT IDC_CREDS_CURRENTID,76,22,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - LTEXT "Fecha de caducidad:",IDC_STATIC,4,39,68,8 - EDITTEXT IDC_CREDS_EXPDATE,76,38,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - DEFPUSHBUTTON "Aceptar",IDOK,35,123,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,89,123,50,14 - PUSHBUTTON "&Ayuda",9,155,123,50,14 - GROUPBOX " ",IDC_STATIC,4,63,201,50 - CONTROL "&Obtener nuevas señales de AFS para esta célula", - IDC_CREDS_LOGIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4, - 53,200,10 -END - -IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "Precaución" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "&Sí",IDOK,173,78,50,14 - PUSHBUTTON "&No",IDCANCEL,227,78,50,14 - PUSHBUTTON "&Ayuda",9,281,78,50,14 - CONTROL "N&o volver a mostrar este aviso",IDC_BADCREDS_SHUTUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,31,80,131,10 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "(texto definido en el momento de la ejecución)", - IDC_BADCREDS_DESC,31,7,300,64 -END - -IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 -STYLE WS_CHILD | WS_BORDER -EXSTYLE WS_EX_CLIENTEDGE -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 - LTEXT "(aquí se incluye la descripción)",IDC_COVER_DESC,14,14, - 162,107 - PUSHBUTTON "Volver &a intentar...",IDC_COVER_BUTTON,126,107,50,14 -END - -IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | - WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU -CAPTION "Seleccionar volumen" -FONT 9, "MS Shell Dlg" -BEGIN - RTEXT "Volumen:",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "&Seleccionar",IDOK,224,113,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,224,129,50,14 - RTEXT "Buscar en &célula:",IDC_STATIC,7,9,41,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE - CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY - DEFPUSHBUTTON "(Me han sacado del dialog por lo que resultaré invisible en el momento de la ejecución)", - IDC_BROWSE_RESTART,7,137,213,13,NOT WS_TABSTOP -END - -IDD_APPLIB_BROWSE DIALOGEX 0, 0, 281, 150 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | - WS_SYSMENU -CAPTION "(Título seleccionado en el momento de la ejecución)" -FONT 9, "MS Shell Dlg" -BEGIN - RTEXT "(en ejecución)",IDC_BROWSE_TYPE,7,115,64,18,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,73,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "&Seleccionar",IDC_BROWSE_SELECT,224,112,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,224,129,50,14 - RTEXT "Buscar en &célula:",IDC_STATIC,7,9,45,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "(Me han sacado del dialog por lo que resultaré invisible en el momento de la ejecución)", - IDC_BROWSE_RESTART,18,137,202,13,NOT WS_TABSTOP - CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_APPLIB_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 87 - END - - IDD_APPLIB_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 227 - TOPMARGIN, 7 - BOTTOMMARGIN, 161 - END - - IDD_APPLIB_CREDENTIALS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 205 - TOPMARGIN, 7 - BOTTOMMARGIN, 137 - END - - IDD_APPLIB_BADCREDS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 331 - TOPMARGIN, 7 - BOTTOMMARGIN, 92 - END - - IDD_APPLIB_COVER, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 182 - TOPMARGIN, 7 - BOTTOMMARGIN, 128 - END - - IDD_APPLIB_BROWSE_FILESET, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END - - IDD_APPLIB_BROWSE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" -IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" -IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" -IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" -IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" -IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" -IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" -IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" -IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_BADCREDS_DESC_GENERAL - "No tiene señales de AFS como administrador dentro de la célula %1.\n\n%2\n\n%3" - IDS_BADCREDS_DESC_EXPIRED - "Las señales de la célula %1 han caducado.\n\n%2\n\n%3" - IDS_BADCREDS_DESC_BADCHOICE - "Ha optado por no iniciar la sesión como administrador dentro de la célula %1.\n\n%2\n\n%3" - IDS_BADCREDS_DESC2 "A menos que inicie la sesión como administrador, no dispondrá de privilegios suficientes para trabajar con la célula %1." - IDS_BADCREDS_DESC3 "¿Desea obtener nuevas señales de AFS en este momento?" - IDS_BADCREDS_DESC3_ADM "¿En su lugar, desea iniciar la sesión como administrador?" - IDS_BADCREDS_DESC_DESTROYED - "Las señales de la célula %1 ya no son válidas.\n\n%2\n\n%3" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS - "La identidad de AFS que ha entrado no está reconocida, o bien la contraseña que ha especificado es incorrecta." - IDS_BROWSE_WAITING "consultando el servidor--espere por favor..." - IDS_BROWSE_BADCELL_TITLE "Célula no reconocida" - IDS_BROWSE_BADCELL_DESC "El nombre de célula que ha entrado no se ha podido encontrar en la red.\n\nPor favor compruebe el nombre de célula para asegurarse de que lo ha escrito correctamente." - IDS_CREDS_NONE "(no hay señales)" - IDS_CREDS_VALID "%2, caduca %3" - IDS_CREDS_EXPIRED "(señales caducadas %3)" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "al_resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Application Base DLL""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +32513 ICON DISCARDABLE "Resource\\error.ico" +32515 ICON DISCARDABLE "Resource\\warning.ico" +IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" +IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" +IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" +IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" +IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" +IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" +IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" +IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" +IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" +IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" +IDI_SERVER ICON DISCARDABLE "resource\\server.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" +IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" +IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" +IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" +IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" +IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" +IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" +IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" +IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" +IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" +IDI_ACL ICON DISCARDABLE "resource\\acl.ico" +IDI_CELL ICON DISCARDABLE "resource\\cell.ico" +IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" +IDI_USER ICON DISCARDABLE "resource\\user.ico" +IDI_GROUP ICON DISCARDABLE "resource\\group.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Error" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Windows no ha podido completar la tarea solicitada porque se ha producido un error no reconocido.", + IDC_ERROR_DESC,31,7,242,33 + LTEXT "Error: %1",IDC_ERROR_STATUS,31,49,241,16 + DEFPUSHBUTTON "Aceptar",IDOK,114,73,50,14 + ICON 32513,IDC_STATIC,4,7,20,20 +END + +IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 231, 165 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Seleccionar célula" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Célula:",IDC_STATIC,4,24,21,8 + LTEXT "Seleccione la célula de AFS con la que le gustaría trabajar.", + IDC_STATIC,4,7,200,8 + COMBOBOX IDC_OPENCELL_CELL,33,22,191,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Identidad de AFS:",IDC_STATIC,22,105,67,8 + EDITTEXT IDC_OPENCELL_ID,94,103,128,13,ES_AUTOHSCROLL + LTEXT "C&ontraseña de AFS:",IDC_STATIC,22,121,65,8 + EDITTEXT IDC_OPENCELL_PASSWORD,94,119,128,13,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "Aceptar",IDOK,57,147,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,111,147,50,14 + PUSHBUTTON "&Ayuda",9,177,147,50,14 + GROUPBOX "Autentificación de AFS",IDC_STATIC,4,44,223,92 + LTEXT "(consultando...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "Para administrar una célula, debe volver a entrar la contraseña de AFS:", + IDC_STATIC,10,81,203,18 + LTEXT "Las señales de AFS actuales dentro de la célula seleccionada:", + IDC_STATIC,10,57,196,8 +END + +IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 210, 141 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Autentificación de AFS" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Identidad de AFS:",IDC_STATIC,8,75,60,8 + EDITTEXT IDC_CREDS_ID,75,73,124,14,ES_AUTOHSCROLL + LTEXT "&Contraseña de AFS:",IDC_STATIC,8,92,65,8 + EDITTEXT IDC_CREDS_PASSWORD,75,89,124,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "Célula de AFS:",IDC_STATIC,4,7,64,8 + EDITTEXT IDC_CREDS_CELL,76,7,129,12,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE + LTEXT "Identidad actual:",IDC_STATIC,4,23,70,8 + EDITTEXT IDC_CREDS_CURRENTID,76,22,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + LTEXT "Fecha de caducidad:",IDC_STATIC,4,39,68,8 + EDITTEXT IDC_CREDS_EXPDATE,76,38,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + DEFPUSHBUTTON "Aceptar",IDOK,35,123,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,89,123,50,14 + PUSHBUTTON "&Ayuda",9,155,123,50,14 + GROUPBOX " ",IDC_STATIC,4,63,201,50 + CONTROL "&Obtener nuevas señales de AFS para esta célula", + IDC_CREDS_LOGIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4, + 53,200,10 +END + +IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Precaución" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "&Sí",IDOK,173,78,50,14 + PUSHBUTTON "&No",IDCANCEL,227,78,50,14 + PUSHBUTTON "&Ayuda",9,281,78,50,14 + CONTROL "N&o volver a mostrar este aviso",IDC_BADCREDS_SHUTUP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,31,80,131,10 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "(texto definido en el momento de la ejecución)", + IDC_BADCREDS_DESC,31,7,300,64 +END + +IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 +STYLE WS_CHILD | WS_BORDER +EXSTYLE WS_EX_CLIENTEDGE +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 + LTEXT "(aquí se incluye la descripción)",IDC_COVER_DESC,14,14, + 162,107 + PUSHBUTTON "Volver &a intentar...",IDC_COVER_BUTTON,126,107,50,14 +END + +IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | + WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "Seleccionar volumen" +FONT 9, "MS Shell Dlg" +BEGIN + RTEXT "Volumen:",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "&Seleccionar",IDOK,224,113,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,224,129,50,14 + RTEXT "Buscar en &célula:",IDC_STATIC,7,9,41,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE + CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY + DEFPUSHBUTTON "(Me han sacado del dialog por lo que resultaré invisible en el momento de la ejecución)", + IDC_BROWSE_RESTART,7,137,213,13,NOT WS_TABSTOP +END + +IDD_APPLIB_BROWSE DIALOGEX 0, 0, 281, 150 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | + WS_SYSMENU +CAPTION "(Título seleccionado en el momento de la ejecución)" +FONT 9, "MS Shell Dlg" +BEGIN + RTEXT "(en ejecución)",IDC_BROWSE_TYPE,7,115,64,18,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,73,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "&Seleccionar",IDC_BROWSE_SELECT,224,112,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,224,129,50,14 + RTEXT "Buscar en &célula:",IDC_STATIC,7,9,45,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "(Me han sacado del dialog por lo que resultaré invisible en el momento de la ejecución)", + IDC_BROWSE_RESTART,18,137,202,13,NOT WS_TABSTOP + CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_APPLIB_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 87 + END + + IDD_APPLIB_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 227 + TOPMARGIN, 7 + BOTTOMMARGIN, 161 + END + + IDD_APPLIB_CREDENTIALS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 205 + TOPMARGIN, 7 + BOTTOMMARGIN, 137 + END + + IDD_APPLIB_BADCREDS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 331 + TOPMARGIN, 7 + BOTTOMMARGIN, 92 + END + + IDD_APPLIB_COVER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 182 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END + + IDD_APPLIB_BROWSE_FILESET, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END + + IDD_APPLIB_BROWSE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" +IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" +IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" +IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" +IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" +IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" +IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" +IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" +IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADCREDS_DESC_GENERAL + "No tiene señales de AFS como administrador dentro de la célula %1.\n\n%2\n\n%3" + IDS_BADCREDS_DESC_EXPIRED + "Las señales de la célula %1 han caducado.\n\n%2\n\n%3" + IDS_BADCREDS_DESC_BADCHOICE + "Ha optado por no iniciar la sesión como administrador dentro de la célula %1.\n\n%2\n\n%3" + IDS_BADCREDS_DESC2 "A menos que inicie la sesión como administrador, no dispondrá de privilegios suficientes para trabajar con la célula %1." + IDS_BADCREDS_DESC3 "¿Desea obtener nuevas señales de AFS en este momento?" + IDS_BADCREDS_DESC3_ADM "¿En su lugar, desea iniciar la sesión como administrador?" + IDS_BADCREDS_DESC_DESTROYED + "Las señales de la célula %1 ya no son válidas.\n\n%2\n\n%3" + IDS_ERROR_BAD_CREDENTIALS + "La identidad de AFS que ha entrado no está reconocida, o bien la contraseña que ha especificado es incorrecta." + IDS_BROWSE_WAITING "consultando el servidor--espere por favor..." + IDS_BROWSE_BADCELL_TITLE "Célula no reconocida" + IDS_BROWSE_BADCELL_DESC "El nombre de célula que ha entrado no se ha podido encontrar en la red.\n\nPor favor compruebe el nombre de célula para asegurarse de que lo ha escrito correctamente." + IDS_CREDS_NONE "(no hay señales)" + IDS_CREDS_VALID "%2, caduca %3" + IDS_CREDS_EXPIRED "(señales caducadas %3)" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afsapplib/lang/ja_JP/afsapplib.rc b/src/WINNT/afsapplib/lang/ja_JP/afsapplib.rc index b2024c3b8..2c1c11637 100644 --- a/src/WINNT/afsapplib/lang/ja_JP/afsapplib.rc +++ b/src/WINNT/afsapplib/lang/ja_JP/afsapplib.rc @@ -7,385 +7,381 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "al_resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "AFS ƒAƒvƒŠƒP[ƒVƒ‡ƒ“Eƒx[ƒX DLL" +#include "al_resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "AFS ƒAƒvƒŠƒP[ƒVƒ‡ƒ“Eƒx[ƒX DLL" #define AFS_VERINFO_DLL #define AFS_VERINFO_NAME "afsapplib" #define AFS_VERINFO_FILENAME "afsapplib.dll" #define AFS_VERINFO_LANG_CODE 0x411 #define AFS_VERINFO_CHARSET 932 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Japanese resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) -#ifdef _WIN32 -LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "al_resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ƒAƒvƒŠƒP[ƒVƒ‡ƒ“Eƒx[ƒX DLL""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -32513 ICON DISCARDABLE "Resource\\error.ico" -32515 ICON DISCARDABLE "Resource\\warning.ico" -IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" -IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" -IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" -IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" -IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" -IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" -IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" -IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" -IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" -IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" -IDI_SERVER ICON DISCARDABLE "resource\\server.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" -IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" -IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" -IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" -IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" -IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" -IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" -IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" -IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" -IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" -IDI_ACL ICON DISCARDABLE "resource\\acl.ico" -IDI_CELL ICON DISCARDABLE "resource\\cell.ico" -IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" -IDI_USER ICON DISCARDABLE "resource\\user.ico" -IDI_GROUP ICON DISCARDABLE "resource\\group.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒGƒ‰[" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "”Fޝ‚³‚ê‚Ä‚¢‚È‚¢ƒGƒ‰[‚ª‹N‚«‚½‚½‚߁AWindows ‚ª—v‹‚³‚ꂽƒ^ƒXƒN‚ðŠ®—¹‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B", - IDC_ERROR_DESC,31,7,242,33 - LTEXT "ƒGƒ‰[: %1",IDC_ERROR_STATUS,31,49,241,16 - DEFPUSHBUTTON "—¹‰ð",IDOK,114,73,50,14 - ICON 32513,IDC_STATIC,4,7,20,20 -END - -IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 164 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "ƒZƒ‹‚Ì‘I‘ð" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒZƒ‹(&C):",IDC_STATIC,4,24,30,8 - LTEXT "‘€ì‚µ‚½‚¢ AFS ƒZƒ‹‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢B",IDC_STATIC,4,7, - 200,8 - COMBOBOX IDC_OPENCELL_CELL,43,22,171,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS ID(&I):",IDC_STATIC,6,100,53,8 - EDITTEXT IDC_OPENCELL_ID,80,98,128,13,ES_AUTOHSCROLL - LTEXT "AFS ƒpƒXƒ[ƒh(&P):",IDC_STATIC,6,116,66,8 - EDITTEXT IDC_OPENCELL_PASSWORD,80,114,128,13,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "—¹‰ð",IDOK,57,146,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,111,146,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,165,146,50,14 - GROUPBOX "AFS ”FØ",IDC_STATIC,4,44,211,92 - LTEXT "(Æ‰ï’†...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "ƒZƒ‹‚ÌŠÇ—‚ɂ́AAFS ƒpƒXƒ[ƒh‚ðÄ“ü—Í‚µ‚Ä‚­‚¾‚³‚¢:", - IDC_STATIC,10,85,203,8 - LTEXT "‘I‘ð‚µ‚½ƒZƒ‹“à‚ÌŒ»Ý‚Ì AFS ƒg[ƒNƒ“:",IDC_STATIC,10,57, - 196,8 -END - -IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 197, 140 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS ”FØ" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 -BEGIN - LTEXT "AFS ID(&I):",IDC_STATIC,8,75,51,8 - EDITTEXT IDC_CREDS_ID,84,73,104,14,ES_AUTOHSCROLL - LTEXT "AFS ƒpƒXƒ[ƒh(&P):",IDC_STATIC,8,92,67,8 - EDITTEXT IDC_CREDS_PASSWORD,84,89,104,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "AFS ƒZƒ‹:",IDC_STATIC,4,7,52,8 - EDITTEXT IDC_CREDS_CELL,64,7,129,12,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE - LTEXT "Œ»s ID:",IDC_STATIC,4,23,52,8 - EDITTEXT IDC_CREDS_CURRENTID,64,22,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - LTEXT "—LŒøŠúŒÀ:",IDC_STATIC,4,39,52,8 - EDITTEXT IDC_CREDS_EXPDATE,64,38,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - DEFPUSHBUTTON "—¹‰ð",IDOK,35,122,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,89,122,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,143,122,50,14 - GROUPBOX " ",IDC_STATIC,4,57,189,56 - CONTROL "‚±‚̃Zƒ‹‚̐V‹K AFS ƒg[ƒNƒ“‚ðŽæ“¾(&O)",IDC_CREDS_LOGIN, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,57,157,10 -END - -IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "’ˆÓ" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - DEFPUSHBUTTON "‚Í‚¢(&Y)",IDOK,173,78,50,14 - PUSHBUTTON "‚¢‚¢‚¦(&N)",IDCANCEL,227,78,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,281,78,50,14 - CONTROL "ŽŸ‰ñ‚±‚ÌŒx‚ð•\ަ‚µ‚È‚¢(&D)",IDC_BADCREDS_SHUTUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,31,80,122,10 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "(ƒeƒLƒXƒg‚ÍŽÀsŽž‚ɐݒè)",IDC_BADCREDS_DESC,31,7,300,64 -END - -IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 -STYLE WS_CHILD | WS_BORDER -EXSTYLE WS_EX_CLIENTEDGE -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 - LTEXT "(‹Lq‚ª‚±‚±‚É“ü‚è‚Ü‚·)",IDC_COVER_DESC,14,14,162,107 - PUSHBUTTON "ÄŽŽs(&A)...",IDC_COVER_BUTTON,126,107,50,14 -END - -IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | - WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚Ì‘I‘ð" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 -BEGIN - RTEXT "ƒ{ƒŠƒ…[ƒ€:",IDC_BROWSE_TYPE,7,115,42,8,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "‘I‘ð(&S)",IDOK,224,113,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,224,129,50,14 - RTEXT "ƒZƒ‹‚ðŒ©‚é(&C):",IDC_STATIC,7,9,57,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,76,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE - CTEXT "",IDC_BROWSE_STATUS,56,127,153,8,SS_NOTIFY - DEFPUSHBUTTON "(ƒ_ƒCƒAƒƒO‚ª•‚¶‚ç‚ê‚邽‚ߎÀsŽž‚ɂ͌©‚¦‚È‚­‚È‚è‚Ü‚·)", - IDC_BROWSE_RESTART,3,137,219,13,NOT WS_TABSTOP -END - -IDD_APPLIB_BROWSE DIALOGEX 0, 0, 281, 150 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | - WS_SYSMENU -CAPTION "(‚±‚̃^ƒCƒgƒ‹‚ÍŽÀsŽž‚É‘I‘ð‚³‚ê‚Ü‚·)" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - RTEXT "(ŽÀsŽž)",IDC_BROWSE_TYPE,8,115,53,8,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,70,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "‘I‘ð(&S)",IDC_BROWSE_SELECT,224,112,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,224,129,50,14 - RTEXT "ƒZƒ‹‚ðŒ©‚é(&C):",IDC_STATIC,7,9,50,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,66,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "(ƒ_ƒCƒAƒƒO‚ª•‚¶‚ç‚ê‚邽‚ߎÀsŽž‚ɂ͌©‚¦‚È‚­‚È‚è‚Ü‚·)", - IDC_BROWSE_RESTART,3,137,219,13,NOT WS_TABSTOP - CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_APPLIB_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 87 - END - - IDD_APPLIB_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 7 - BOTTOMMARGIN, 160 - END - - IDD_APPLIB_CREDENTIALS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 193 - TOPMARGIN, 7 - BOTTOMMARGIN, 136 - END - - IDD_APPLIB_BADCREDS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 331 - TOPMARGIN, 7 - BOTTOMMARGIN, 92 - END - - IDD_APPLIB_COVER, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 182 - TOPMARGIN, 7 - BOTTOMMARGIN, 128 - END - - IDD_APPLIB_BROWSE_FILESET, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END - - IDD_APPLIB_BROWSE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" -IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" -IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" -IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" -IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" -IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" -IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" -IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" -IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_BADCREDS_DESC_GENERAL - "%1 ƒZƒ‹“à‚ÌŠÇ—ŽÒ‚Æ‚µ‚Ä‚Ì AFS ƒg[ƒNƒ“‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñB\n\n%2\n\n%3" - IDS_BADCREDS_DESC_EXPIRED - "%1 ƒZƒ‹“à‚̃g[ƒNƒ“‚ÌŠúŒÀ‚ªØ‚ê‚Ü‚µ‚½B\n\n%2\n\n%3" - IDS_BADCREDS_DESC_BADCHOICE - "%1 ƒZƒ‹“à‚ÌŠÇ—ŽÒ‚Æ‚µ‚ăƒOƒCƒ“‚µ‚È‚¢‚±‚Æ‚ð‘I‘ð‚µ‚Ü‚µ‚½B\n\n%2\n\n%3" - IDS_BADCREDS_DESC2 "ŠÇ—ŽÒ‚Æ‚µ‚ăƒOƒCƒ“‚µ‚È‚¢‚ƁA%1 ƒZƒ‹‚Ì‘€ì‚ɏ\•ª‚ÈŒ ŒÀ‚ª—^‚¦‚ç‚ê‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·B" - IDS_BADCREDS_DESC3 "V‚µ‚¢ AFS ƒg[ƒNƒ“‚ð“üŽè‚µ‚Ü‚·‚©?" - IDS_BADCREDS_DESC3_ADM "‘ã‚í‚è‚ÉŠÇ—ŽÒ‚Æ‚µ‚ăƒOƒCƒ“‚µ‚Ü‚·‚©?" - IDS_BADCREDS_DESC_DESTROYED - "%1 ƒZƒ‹“à‚̃g[ƒNƒ“‚ª—LŒø‚łȂ­‚È‚è‚Ü‚µ‚½B\n\n%2\n\n%3" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS - "“ü—Í‚µ‚½ AFS ID ‚ª”Fޝ‚³‚ê‚È‚¢‚©A‚Ü‚½‚ÍŽw’肵‚½ƒpƒXƒ[ƒh‚ª³‚µ‚­‚ ‚è‚Ü‚¹‚ñB" - IDS_BROWSE_WAITING "ƒT[ƒo[‚ðÆ‰ï’†‚Å‚·--‚¨‘Ò‚¿‚­‚¾‚³‚¢..." - IDS_BROWSE_BADCELL_TITLE "”Fޝ‚³‚ê‚Ä‚¢‚È‚¢ƒZƒ‹" - IDS_BROWSE_BADCELL_DESC "“ü—Í‚µ‚½ƒZƒ‹–¼‚ªƒlƒbƒgƒ[ƒN‚ÅŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒZƒ‹–¼‚̂‚Â肪³‚µ‚¢‚©‚ðŠm‚©‚߂Ă­‚¾‚³‚¢B" - IDS_CREDS_NONE "(ƒg[ƒNƒ“‚È‚µ)" - IDS_CREDS_VALID "%2, ŠúŒÀØ‚ê %3" - IDS_CREDS_EXPIRED "(ƒg[ƒNƒ“‚ªŠúŒÀØ‚ê %3)" -END - -#endif // Japanese resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Japanese resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) +#ifdef _WIN32 +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "al_resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ƒAƒvƒŠƒP[ƒVƒ‡ƒ“Eƒx[ƒX DLL""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +32513 ICON DISCARDABLE "Resource\\error.ico" +32515 ICON DISCARDABLE "Resource\\warning.ico" +IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" +IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" +IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" +IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" +IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" +IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" +IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" +IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" +IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" +IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" +IDI_SERVER ICON DISCARDABLE "resource\\server.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" +IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" +IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" +IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" +IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" +IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" +IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" +IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" +IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" +IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" +IDI_ACL ICON DISCARDABLE "resource\\acl.ico" +IDI_CELL ICON DISCARDABLE "resource\\cell.ico" +IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" +IDI_USER ICON DISCARDABLE "resource\\user.ico" +IDI_GROUP ICON DISCARDABLE "resource\\group.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒGƒ‰[" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "”Fޝ‚³‚ê‚Ä‚¢‚È‚¢ƒGƒ‰[‚ª‹N‚«‚½‚½‚߁AWindows ‚ª—v‹‚³‚ꂽƒ^ƒXƒN‚ðŠ®—¹‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B", + IDC_ERROR_DESC,31,7,242,33 + LTEXT "ƒGƒ‰[: %1",IDC_ERROR_STATUS,31,49,241,16 + DEFPUSHBUTTON "—¹‰ð",IDOK,114,73,50,14 + ICON 32513,IDC_STATIC,4,7,20,20 +END + +IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 164 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "ƒZƒ‹‚Ì‘I‘ð" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒZƒ‹(&C):",IDC_STATIC,4,24,30,8 + LTEXT "‘€ì‚µ‚½‚¢ AFS ƒZƒ‹‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢B",IDC_STATIC,4,7, + 200,8 + COMBOBOX IDC_OPENCELL_CELL,43,22,171,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS ID(&I):",IDC_STATIC,6,100,53,8 + EDITTEXT IDC_OPENCELL_ID,80,98,128,13,ES_AUTOHSCROLL + LTEXT "AFS ƒpƒXƒ[ƒh(&P):",IDC_STATIC,6,116,66,8 + EDITTEXT IDC_OPENCELL_PASSWORD,80,114,128,13,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "—¹‰ð",IDOK,57,146,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,111,146,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,165,146,50,14 + GROUPBOX "AFS ”FØ",IDC_STATIC,4,44,211,92 + LTEXT "(Æ‰ï’†...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "ƒZƒ‹‚ÌŠÇ—‚ɂ́AAFS ƒpƒXƒ[ƒh‚ðÄ“ü—Í‚µ‚Ä‚­‚¾‚³‚¢:", + IDC_STATIC,10,85,203,8 + LTEXT "‘I‘ð‚µ‚½ƒZƒ‹“à‚ÌŒ»Ý‚Ì AFS ƒg[ƒNƒ“:",IDC_STATIC,10,57, + 196,8 +END + +IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 197, 140 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS ”FØ" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 +BEGIN + LTEXT "AFS ID(&I):",IDC_STATIC,8,75,51,8 + EDITTEXT IDC_CREDS_ID,84,73,104,14,ES_AUTOHSCROLL + LTEXT "AFS ƒpƒXƒ[ƒh(&P):",IDC_STATIC,8,92,67,8 + EDITTEXT IDC_CREDS_PASSWORD,84,89,104,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "AFS ƒZƒ‹:",IDC_STATIC,4,7,52,8 + EDITTEXT IDC_CREDS_CELL,64,7,129,12,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE + LTEXT "Œ»s ID:",IDC_STATIC,4,23,52,8 + EDITTEXT IDC_CREDS_CURRENTID,64,22,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + LTEXT "—LŒøŠúŒÀ:",IDC_STATIC,4,39,52,8 + EDITTEXT IDC_CREDS_EXPDATE,64,38,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + DEFPUSHBUTTON "—¹‰ð",IDOK,35,122,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,89,122,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,143,122,50,14 + GROUPBOX " ",IDC_STATIC,4,57,189,56 + CONTROL "‚±‚̃Zƒ‹‚̐V‹K AFS ƒg[ƒNƒ“‚ðŽæ“¾(&O)",IDC_CREDS_LOGIN, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,57,157,10 +END + +IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "’ˆÓ" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + DEFPUSHBUTTON "‚Í‚¢(&Y)",IDOK,173,78,50,14 + PUSHBUTTON "‚¢‚¢‚¦(&N)",IDCANCEL,227,78,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,281,78,50,14 + CONTROL "ŽŸ‰ñ‚±‚ÌŒx‚ð•\ަ‚µ‚È‚¢(&D)",IDC_BADCREDS_SHUTUP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,31,80,122,10 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "(ƒeƒLƒXƒg‚ÍŽÀsŽž‚ɐݒè)",IDC_BADCREDS_DESC,31,7,300,64 +END + +IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 +STYLE WS_CHILD | WS_BORDER +EXSTYLE WS_EX_CLIENTEDGE +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 + LTEXT "(‹Lq‚ª‚±‚±‚É“ü‚è‚Ü‚·)",IDC_COVER_DESC,14,14,162,107 + PUSHBUTTON "ÄŽŽs(&A)...",IDC_COVER_BUTTON,126,107,50,14 +END + +IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | + WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚Ì‘I‘ð" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 +BEGIN + RTEXT "ƒ{ƒŠƒ…[ƒ€:",IDC_BROWSE_TYPE,7,115,42,8,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "‘I‘ð(&S)",IDOK,224,113,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,224,129,50,14 + RTEXT "ƒZƒ‹‚ðŒ©‚é(&C):",IDC_STATIC,7,9,57,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,76,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE + CTEXT "",IDC_BROWSE_STATUS,56,127,153,8,SS_NOTIFY + DEFPUSHBUTTON "(ƒ_ƒCƒAƒƒO‚ª•‚¶‚ç‚ê‚邽‚ߎÀsŽž‚ɂ͌©‚¦‚È‚­‚È‚è‚Ü‚·)", + IDC_BROWSE_RESTART,3,137,219,13,NOT WS_TABSTOP +END + +IDD_APPLIB_BROWSE DIALOGEX 0, 0, 281, 150 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | + WS_SYSMENU +CAPTION "(‚±‚̃^ƒCƒgƒ‹‚ÍŽÀsŽž‚É‘I‘ð‚³‚ê‚Ü‚·)" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + RTEXT "(ŽÀsŽž)",IDC_BROWSE_TYPE,8,115,53,8,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,70,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "‘I‘ð(&S)",IDC_BROWSE_SELECT,224,112,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,224,129,50,14 + RTEXT "ƒZƒ‹‚ðŒ©‚é(&C):",IDC_STATIC,7,9,50,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,66,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "(ƒ_ƒCƒAƒƒO‚ª•‚¶‚ç‚ê‚邽‚ߎÀsŽž‚ɂ͌©‚¦‚È‚­‚È‚è‚Ü‚·)", + IDC_BROWSE_RESTART,3,137,219,13,NOT WS_TABSTOP + CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_APPLIB_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 87 + END + + IDD_APPLIB_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 7 + BOTTOMMARGIN, 160 + END + + IDD_APPLIB_CREDENTIALS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 193 + TOPMARGIN, 7 + BOTTOMMARGIN, 136 + END + + IDD_APPLIB_BADCREDS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 331 + TOPMARGIN, 7 + BOTTOMMARGIN, 92 + END + + IDD_APPLIB_COVER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 182 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END + + IDD_APPLIB_BROWSE_FILESET, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END + + IDD_APPLIB_BROWSE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" +IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" +IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" +IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" +IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" +IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" +IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" +IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" +IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADCREDS_DESC_GENERAL + "%1 ƒZƒ‹“à‚ÌŠÇ—ŽÒ‚Æ‚µ‚Ä‚Ì AFS ƒg[ƒNƒ“‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñB\n\n%2\n\n%3" + IDS_BADCREDS_DESC_EXPIRED + "%1 ƒZƒ‹“à‚̃g[ƒNƒ“‚ÌŠúŒÀ‚ªØ‚ê‚Ü‚µ‚½B\n\n%2\n\n%3" + IDS_BADCREDS_DESC_BADCHOICE + "%1 ƒZƒ‹“à‚ÌŠÇ—ŽÒ‚Æ‚µ‚ăƒOƒCƒ“‚µ‚È‚¢‚±‚Æ‚ð‘I‘ð‚µ‚Ü‚µ‚½B\n\n%2\n\n%3" + IDS_BADCREDS_DESC2 "ŠÇ—ŽÒ‚Æ‚µ‚ăƒOƒCƒ“‚µ‚È‚¢‚ƁA%1 ƒZƒ‹‚Ì‘€ì‚ɏ\•ª‚ÈŒ ŒÀ‚ª—^‚¦‚ç‚ê‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·B" + IDS_BADCREDS_DESC3 "V‚µ‚¢ AFS ƒg[ƒNƒ“‚ð“üŽè‚µ‚Ü‚·‚©?" + IDS_BADCREDS_DESC3_ADM "‘ã‚í‚è‚ÉŠÇ—ŽÒ‚Æ‚µ‚ăƒOƒCƒ“‚µ‚Ü‚·‚©?" + IDS_BADCREDS_DESC_DESTROYED + "%1 ƒZƒ‹“à‚̃g[ƒNƒ“‚ª—LŒø‚łȂ­‚È‚è‚Ü‚µ‚½B\n\n%2\n\n%3" + IDS_ERROR_BAD_CREDENTIALS + "“ü—Í‚µ‚½ AFS ID ‚ª”Fޝ‚³‚ê‚È‚¢‚©A‚Ü‚½‚ÍŽw’肵‚½ƒpƒXƒ[ƒh‚ª³‚µ‚­‚ ‚è‚Ü‚¹‚ñB" + IDS_BROWSE_WAITING "ƒT[ƒo[‚ðÆ‰ï’†‚Å‚·--‚¨‘Ò‚¿‚­‚¾‚³‚¢..." + IDS_BROWSE_BADCELL_TITLE "”Fޝ‚³‚ê‚Ä‚¢‚È‚¢ƒZƒ‹" + IDS_BROWSE_BADCELL_DESC "“ü—Í‚µ‚½ƒZƒ‹–¼‚ªƒlƒbƒgƒ[ƒN‚ÅŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒZƒ‹–¼‚̂‚Â肪³‚µ‚¢‚©‚ðŠm‚©‚߂Ă­‚¾‚³‚¢B" + IDS_CREDS_NONE "(ƒg[ƒNƒ“‚È‚µ)" + IDS_CREDS_VALID "%2, ŠúŒÀØ‚ê %3" + IDS_CREDS_EXPIRED "(ƒg[ƒNƒ“‚ªŠúŒÀØ‚ê %3)" +END + +#endif // Japanese resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afsapplib/lang/ko_KR/afsapplib.rc b/src/WINNT/afsapplib/lang/ko_KR/afsapplib.rc index e8d3eed66..700125d1e 100644 --- a/src/WINNT/afsapplib/lang/ko_KR/afsapplib.rc +++ b/src/WINNT/afsapplib/lang/ko_KR/afsapplib.rc @@ -7,382 +7,378 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "al_resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "AFS ÀÀ¿ëÇÁ·Î±×·¥ ±âº» DLL" +#include "al_resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "AFS ÀÀ¿ëÇÁ·Î±×·¥ ±âº» DLL" #define AFS_VERINFO_DLL #define AFS_VERINFO_NAME "afsapplib" #define AFS_VERINFO_FILENAME "afsapplib.dll" #define AFS_VERINFO_LANG_CODE 0x412 #define AFS_VERINFO_CHARSET 949 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Korean resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR) -#ifdef _WIN32 -LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "al_resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ÀÀ¿ëÇÁ·Î±×·¥ ±âº» DLL""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -32513 ICON DISCARDABLE "Resource\\error.ico" -32515 ICON DISCARDABLE "Resource\\warning.ico" -IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" -IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" -IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" -IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" -IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" -IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" -IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" -IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" -IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" -IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" -IDI_SERVER ICON DISCARDABLE "resource\\server.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" -IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" -IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" -IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" -IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" -IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" -IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" -IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" -IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" -IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" -IDI_ACL ICON DISCARDABLE "resource\\acl.ico" -IDI_CELL ICON DISCARDABLE "resource\\cell.ico" -IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" -IDI_USER ICON DISCARDABLE "resource\\user.ico" -IDI_GROUP ICON DISCARDABLE "resource\\group.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "¿À·ù" -FONT 9, "±¼¸²" -BEGIN - LTEXT "Windows´Â ÀνÄÇÒ ¼ö ¾ø´Â ¿À·ù·Î ÀÎÇÏ¿© ¿äûµÈ ÀÛ¾÷À» Á¾·áÇÒ ¼ö ¾ø½À´Ï´Ù.", - IDC_ERROR_DESC,31,7,242,33 - LTEXT "¿À·ù: %1",IDC_ERROR_STATUS,31,49,241,16 - DEFPUSHBUTTON "È®ÀÎ",IDOK,114,73,50,14 - ICON 32513,IDC_STATIC,4,7,20,20 -END - -IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 164 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "¼¿ ¼±ÅÃ" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¼¿ (&C):",IDC_STATIC,4,24,16,8 - LTEXT "ÀÛ¾÷ÇÒ AFS ¼¿À» ¼±ÅÃÇϽʽÿÀ.",IDC_STATIC,4,7,200,8 - COMBOBOX IDC_OPENCELL_CELL,24,22,191,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS ID (&I):",IDC_STATIC,22,100,53,8 - EDITTEXT IDC_OPENCELL_ID,80,98,123,13,ES_AUTOHSCROLL - LTEXT "AFS ¾ÏÈ£ (&P):",IDC_STATIC,22,116,55,8 - EDITTEXT IDC_OPENCELL_PASSWORD,80,114,124,13,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "È®ÀÎ",IDOK,57,146,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,111,146,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,165,146,50,14 - GROUPBOX "AFS ÀÎÁõ",IDC_STATIC,4,44,211,92 - LTEXT "(Á¶È¸ Áß...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "¼¿À» °ü¸®ÇÏ·Á¸é, AFS ¾ÏÈ£¸¦ ´Ù½Ã ÀÔ·ÂÇØ¾ß ÇÕ´Ï´Ù.", - IDC_STATIC,10,85,196,8 - LTEXT "¼±ÅÃµÈ ¼¿¿¡ ÀÖ´Â ÇöÀç AFS ÅäÅ«:",IDC_STATIC,10,57,196,8 -END - -IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 215, 159 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS ÀÎÁõ" -FONT 9, "±¼¸²" -BEGIN - LTEXT "AFS ID (&I):",IDC_STATIC,11,97,51,8 - EDITTEXT IDC_CREDS_ID,67,96,124,14,ES_AUTOHSCROLL - LTEXT "AFS ¾ÏÈ£ (&P):",IDC_STATIC,11,114,50,8 - EDITTEXT IDC_CREDS_PASSWORD,67,111,124,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "AFS ¼¿:",IDC_STATIC,4,7,52,8 - EDITTEXT IDC_CREDS_CELL,75,7,129,12,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE - LTEXT "ÇöÀç ID:",IDC_STATIC,4,23,52,8 - EDITTEXT IDC_CREDS_CURRENTID,75,22,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - LTEXT "¸¸±â ³¯Â¥:",IDC_STATIC,4,39,52,8 - EDITTEXT IDC_CREDS_EXPDATE,75,38,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - DEFPUSHBUTTON "È®ÀÎ",IDOK,35,141,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,89,141,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,161,141,50,14 - GROUPBOX " ",IDC_STATIC,4,68,207,70 - CONTROL "ÀÌ ¼¿¿¡ ´ëÇÑ »õ AFS ÅäÅ« È®º¸ (&O)",IDC_CREDS_LOGIN, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,81,138,10 -END - -IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "ÁÖÀÇ" -FONT 9, "±¼¸²" -BEGIN - DEFPUSHBUTTON "¿¹ (&Y)",IDOK,173,78,50,14 - PUSHBUTTON "¾Æ´Ï¿À (&N)",IDCANCEL,227,78,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,281,78,50,14 - CONTROL "ÀÌ °æ°í¸¦ ´Ù½Ã Ç¥½ÃÇÏÁö ¾ÊÀ½(&D)",IDC_BADCREDS_SHUTUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,31,80,120,10 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "(½ÇÇà Áß ¼³Á¤µÈ ÅØ½ºÆ®)",IDC_BADCREDS_DESC,31,7,300,64 -END - -IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 -STYLE WS_CHILD | WS_BORDER -EXSTYLE WS_EX_CLIENTEDGE -FONT 9, "±¼¸²" -BEGIN - GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 - LTEXT "(¼³¸íÀº ¿©±â¿¡ ¿É´Ï´Ù)",IDC_COVER_DESC,14,14,162,107 - PUSHBUTTON "´Ù½Ã ½ÃµµÇϽʽÿÀ (&A)...",IDC_COVER_BUTTON,126,107,50, - 14 -END - -IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | - WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý ¼±ÅÃ" -FONT 9, "±¼¸²" -BEGIN - RTEXT "º¼·ý:",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "¼±ÅÃ(&S)",IDOK,224,113,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,224,129,50,14 - RTEXT "¼¿ Á¶È¸(&C):",IDC_STATIC,7,9,41,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - DEFPUSHBUTTON "(½ÇÇà Áß¿¡ Ç¥½ÃµÇÁö ¾ÊÀ½)",IDC_BROWSE_RESTART,41,130, - 177,13,NOT WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE -END - -IDD_APPLIB_BROWSE DIALOG DISCARDABLE 0, 0, 281, 150 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | - WS_SYSMENU -CAPTION "(½ÇÇà Áß ¼±ÅÃµÈ Á¦¸ñ)" -FONT 9, "±¼¸²" -BEGIN - RTEXT "(½ÇÇà Áß)",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "¼±ÅÃ(&S)",IDC_BROWSE_SELECT,224,112,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,224,129,50,14 - RTEXT "¼¿ Á¶È¸(&C):",IDC_STATIC,7,9,41,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "(½ÇÇà Áß¿¡ Ç¥½ÃµÇÁö ¾ÊÀ½)",IDC_BROWSE_RESTART,43,137, - 177,13,NOT WS_TABSTOP - CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_APPLIB_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 87 - END - - IDD_APPLIB_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 7 - BOTTOMMARGIN, 160 - END - - IDD_APPLIB_CREDENTIALS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 211 - TOPMARGIN, 7 - BOTTOMMARGIN, 155 - END - - IDD_APPLIB_BADCREDS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 331 - TOPMARGIN, 7 - BOTTOMMARGIN, 92 - END - - IDD_APPLIB_COVER, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 182 - TOPMARGIN, 7 - BOTTOMMARGIN, 128 - END - - IDD_APPLIB_BROWSE_FILESET, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END - - IDD_APPLIB_BROWSE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" -IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" -IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" -IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" -IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" -IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" -IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" -IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" -IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_BADCREDS_DESC_GENERAL - "%1 ¼¿¿¡¼­ AFS ÅäÅ«À» °ü¸®ÀÚ·Î »ç¿ëÇÏÁö ¾Ê½À´Ï´Ù.\n\n%2\n\n%3" - IDS_BADCREDS_DESC_EXPIRED "%1 ¼¿ÀÇ ÅäÅ«ÀÌ ¸¸±âµÇ¾ú½À´Ï´Ù.\n\n%2\n\n%3" - IDS_BADCREDS_DESC_BADCHOICE - "%1 ¼¿¿¡¼­ °ü¸®ÀÚ·Î ·Î±×ÀÎÇÏÁö ¾Ê±â·Î °áÁ¤Çß½À´Ï´Ù.\n\n%2\n\n%3" - IDS_BADCREDS_DESC2 "°ü¸®ÀÚ·Î ·Î±×ÀÎÇÏÁö ¾Ê´Â ÀÌ»ó, %1 ¼¿°ú ÀÛ¾÷ÇÒ ¼ö Àִ Ư±ÇÀÌ ºÎÁ·ÇÕ´Ï´Ù." - IDS_BADCREDS_DESC3 "Áö±Ý »õ AFS ÅäÅ«À» È®º¸ÇϽðڽÀ´Ï±î?" - IDS_BADCREDS_DESC3_ADM "°ü¸®ÀÚ·Î ·Î±×ÀÎÇϽðڽÀ´Ï±î?" - IDS_BADCREDS_DESC_DESTROYED - "%1 ¼¿ÀÇ ÅäÅ«Àº ´õ ÀÌ»ó À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n%2\n\n%3" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS - "ÀÔ·ÂÇÑ AFS ID¸¦ ÀνÄÇÒ ¼ö ¾ø°Å³ª ÁöÁ¤ÇÑ ¾ÏÈ£°¡ Ʋ·È½À´Ï´Ù." - IDS_BROWSE_WAITING "Á¶È¸ ÁßÀÔ´Ï´Ù. Àá½Ã ±â´Ù¸®½Ê½Ã¿À..." - IDS_BROWSE_BADCELL_TITLE "ÀνĵÇÁö ¾ÊÀº ¼¿" - IDS_BROWSE_BADCELL_DESC "ÀÔ·ÂÇÑ ¼¿ À̸§À» ³×Æ®¿öÅ©¿¡¼­ ãÀ» ¼ö ¾ø½À´Ï´Ù.\n\n¼¿ À̸§À» È®ÀÎÇÏ¿© ¿Ã¹Ù·Î ÀÔ·ÂÇß´ÂÁö º¸½Ê½Ã¿À." - IDS_CREDS_NONE "(ÅäÅ« ¾øÀ½)" - IDS_CREDS_VALID "%2, %3 ¸¸±â" - IDS_CREDS_EXPIRED "(ÅäÅ« %3 ¸¸±â)" -END - -#endif // Korean resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Korean resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR) +#ifdef _WIN32 +LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "al_resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ÀÀ¿ëÇÁ·Î±×·¥ ±âº» DLL""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +32513 ICON DISCARDABLE "Resource\\error.ico" +32515 ICON DISCARDABLE "Resource\\warning.ico" +IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" +IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" +IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" +IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" +IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" +IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" +IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" +IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" +IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" +IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" +IDI_SERVER ICON DISCARDABLE "resource\\server.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" +IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" +IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" +IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" +IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" +IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" +IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" +IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" +IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" +IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" +IDI_ACL ICON DISCARDABLE "resource\\acl.ico" +IDI_CELL ICON DISCARDABLE "resource\\cell.ico" +IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" +IDI_USER ICON DISCARDABLE "resource\\user.ico" +IDI_GROUP ICON DISCARDABLE "resource\\group.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "¿À·ù" +FONT 9, "±¼¸²" +BEGIN + LTEXT "Windows´Â ÀνÄÇÒ ¼ö ¾ø´Â ¿À·ù·Î ÀÎÇÏ¿© ¿äûµÈ ÀÛ¾÷À» Á¾·áÇÒ ¼ö ¾ø½À´Ï´Ù.", + IDC_ERROR_DESC,31,7,242,33 + LTEXT "¿À·ù: %1",IDC_ERROR_STATUS,31,49,241,16 + DEFPUSHBUTTON "È®ÀÎ",IDOK,114,73,50,14 + ICON 32513,IDC_STATIC,4,7,20,20 +END + +IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 164 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "¼¿ ¼±ÅÃ" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¼¿ (&C):",IDC_STATIC,4,24,16,8 + LTEXT "ÀÛ¾÷ÇÒ AFS ¼¿À» ¼±ÅÃÇϽʽÿÀ.",IDC_STATIC,4,7,200,8 + COMBOBOX IDC_OPENCELL_CELL,24,22,191,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS ID (&I):",IDC_STATIC,22,100,53,8 + EDITTEXT IDC_OPENCELL_ID,80,98,123,13,ES_AUTOHSCROLL + LTEXT "AFS ¾ÏÈ£ (&P):",IDC_STATIC,22,116,55,8 + EDITTEXT IDC_OPENCELL_PASSWORD,80,114,124,13,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "È®ÀÎ",IDOK,57,146,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,111,146,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,165,146,50,14 + GROUPBOX "AFS ÀÎÁõ",IDC_STATIC,4,44,211,92 + LTEXT "(Á¶È¸ Áß...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "¼¿À» °ü¸®ÇÏ·Á¸é, AFS ¾ÏÈ£¸¦ ´Ù½Ã ÀÔ·ÂÇØ¾ß ÇÕ´Ï´Ù.", + IDC_STATIC,10,85,196,8 + LTEXT "¼±ÅÃµÈ ¼¿¿¡ ÀÖ´Â ÇöÀç AFS ÅäÅ«:",IDC_STATIC,10,57,196,8 +END + +IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 215, 159 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS ÀÎÁõ" +FONT 9, "±¼¸²" +BEGIN + LTEXT "AFS ID (&I):",IDC_STATIC,11,97,51,8 + EDITTEXT IDC_CREDS_ID,67,96,124,14,ES_AUTOHSCROLL + LTEXT "AFS ¾ÏÈ£ (&P):",IDC_STATIC,11,114,50,8 + EDITTEXT IDC_CREDS_PASSWORD,67,111,124,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "AFS ¼¿:",IDC_STATIC,4,7,52,8 + EDITTEXT IDC_CREDS_CELL,75,7,129,12,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE + LTEXT "ÇöÀç ID:",IDC_STATIC,4,23,52,8 + EDITTEXT IDC_CREDS_CURRENTID,75,22,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + LTEXT "¸¸±â ³¯Â¥:",IDC_STATIC,4,39,52,8 + EDITTEXT IDC_CREDS_EXPDATE,75,38,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + DEFPUSHBUTTON "È®ÀÎ",IDOK,35,141,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,89,141,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,161,141,50,14 + GROUPBOX " ",IDC_STATIC,4,68,207,70 + CONTROL "ÀÌ ¼¿¿¡ ´ëÇÑ »õ AFS ÅäÅ« È®º¸ (&O)",IDC_CREDS_LOGIN, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,81,138,10 +END + +IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "ÁÖÀÇ" +FONT 9, "±¼¸²" +BEGIN + DEFPUSHBUTTON "¿¹ (&Y)",IDOK,173,78,50,14 + PUSHBUTTON "¾Æ´Ï¿À (&N)",IDCANCEL,227,78,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,281,78,50,14 + CONTROL "ÀÌ °æ°í¸¦ ´Ù½Ã Ç¥½ÃÇÏÁö ¾ÊÀ½(&D)",IDC_BADCREDS_SHUTUP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,31,80,120,10 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "(½ÇÇà Áß ¼³Á¤µÈ ÅØ½ºÆ®)",IDC_BADCREDS_DESC,31,7,300,64 +END + +IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 +STYLE WS_CHILD | WS_BORDER +EXSTYLE WS_EX_CLIENTEDGE +FONT 9, "±¼¸²" +BEGIN + GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 + LTEXT "(¼³¸íÀº ¿©±â¿¡ ¿É´Ï´Ù)",IDC_COVER_DESC,14,14,162,107 + PUSHBUTTON "´Ù½Ã ½ÃµµÇϽʽÿÀ (&A)...",IDC_COVER_BUTTON,126,107,50, + 14 +END + +IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | + WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý ¼±ÅÃ" +FONT 9, "±¼¸²" +BEGIN + RTEXT "º¼·ý:",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "¼±ÅÃ(&S)",IDOK,224,113,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,224,129,50,14 + RTEXT "¼¿ Á¶È¸(&C):",IDC_STATIC,7,9,41,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + DEFPUSHBUTTON "(½ÇÇà Áß¿¡ Ç¥½ÃµÇÁö ¾ÊÀ½)",IDC_BROWSE_RESTART,41,130, + 177,13,NOT WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE +END + +IDD_APPLIB_BROWSE DIALOG DISCARDABLE 0, 0, 281, 150 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | + WS_SYSMENU +CAPTION "(½ÇÇà Áß ¼±ÅÃµÈ Á¦¸ñ)" +FONT 9, "±¼¸²" +BEGIN + RTEXT "(½ÇÇà Áß)",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "¼±ÅÃ(&S)",IDC_BROWSE_SELECT,224,112,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,224,129,50,14 + RTEXT "¼¿ Á¶È¸(&C):",IDC_STATIC,7,9,41,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "(½ÇÇà Áß¿¡ Ç¥½ÃµÇÁö ¾ÊÀ½)",IDC_BROWSE_RESTART,43,137, + 177,13,NOT WS_TABSTOP + CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_APPLIB_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 87 + END + + IDD_APPLIB_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 7 + BOTTOMMARGIN, 160 + END + + IDD_APPLIB_CREDENTIALS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 211 + TOPMARGIN, 7 + BOTTOMMARGIN, 155 + END + + IDD_APPLIB_BADCREDS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 331 + TOPMARGIN, 7 + BOTTOMMARGIN, 92 + END + + IDD_APPLIB_COVER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 182 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END + + IDD_APPLIB_BROWSE_FILESET, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END + + IDD_APPLIB_BROWSE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" +IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" +IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" +IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" +IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" +IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" +IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" +IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" +IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADCREDS_DESC_GENERAL + "%1 ¼¿¿¡¼­ AFS ÅäÅ«À» °ü¸®ÀÚ·Î »ç¿ëÇÏÁö ¾Ê½À´Ï´Ù.\n\n%2\n\n%3" + IDS_BADCREDS_DESC_EXPIRED "%1 ¼¿ÀÇ ÅäÅ«ÀÌ ¸¸±âµÇ¾ú½À´Ï´Ù.\n\n%2\n\n%3" + IDS_BADCREDS_DESC_BADCHOICE + "%1 ¼¿¿¡¼­ °ü¸®ÀÚ·Î ·Î±×ÀÎÇÏÁö ¾Ê±â·Î °áÁ¤Çß½À´Ï´Ù.\n\n%2\n\n%3" + IDS_BADCREDS_DESC2 "°ü¸®ÀÚ·Î ·Î±×ÀÎÇÏÁö ¾Ê´Â ÀÌ»ó, %1 ¼¿°ú ÀÛ¾÷ÇÒ ¼ö Àִ Ư±ÇÀÌ ºÎÁ·ÇÕ´Ï´Ù." + IDS_BADCREDS_DESC3 "Áö±Ý »õ AFS ÅäÅ«À» È®º¸ÇϽðڽÀ´Ï±î?" + IDS_BADCREDS_DESC3_ADM "°ü¸®ÀÚ·Î ·Î±×ÀÎÇϽðڽÀ´Ï±î?" + IDS_BADCREDS_DESC_DESTROYED + "%1 ¼¿ÀÇ ÅäÅ«Àº ´õ ÀÌ»ó À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n%2\n\n%3" + IDS_ERROR_BAD_CREDENTIALS + "ÀÔ·ÂÇÑ AFS ID¸¦ ÀνÄÇÒ ¼ö ¾ø°Å³ª ÁöÁ¤ÇÑ ¾ÏÈ£°¡ Ʋ·È½À´Ï´Ù." + IDS_BROWSE_WAITING "Á¶È¸ ÁßÀÔ´Ï´Ù. Àá½Ã ±â´Ù¸®½Ê½Ã¿À..." + IDS_BROWSE_BADCELL_TITLE "ÀνĵÇÁö ¾ÊÀº ¼¿" + IDS_BROWSE_BADCELL_DESC "ÀÔ·ÂÇÑ ¼¿ À̸§À» ³×Æ®¿öÅ©¿¡¼­ ãÀ» ¼ö ¾ø½À´Ï´Ù.\n\n¼¿ À̸§À» È®ÀÎÇÏ¿© ¿Ã¹Ù·Î ÀÔ·ÂÇß´ÂÁö º¸½Ê½Ã¿À." + IDS_CREDS_NONE "(ÅäÅ« ¾øÀ½)" + IDS_CREDS_VALID "%2, %3 ¸¸±â" + IDS_CREDS_EXPIRED "(ÅäÅ« %3 ¸¸±â)" +END + +#endif // Korean resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afsapplib/lang/pt_BR/afsapplib.rc b/src/WINNT/afsapplib/lang/pt_BR/afsapplib.rc index 8721489df..18a98c996 100644 --- a/src/WINNT/afsapplib/lang/pt_BR/afsapplib.rc +++ b/src/WINNT/afsapplib/lang/pt_BR/afsapplib.rc @@ -7,387 +7,383 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "al_resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "DLL Base da Aplicação AFS" +#include "al_resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "DLL Base da Aplicação AFS" #define AFS_VERINFO_DLL #define AFS_VERINFO_NAME "afsapplib" #define AFS_VERINFO_FILENAME "afsapplib.dll" #define AFS_VERINFO_LANG_CODE 0x416 #define AFS_VERINFO_CHARSET 1252 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "al_resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""DLL Base da Aplicação AFS""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -32513 ICON DISCARDABLE "Resource\\error.ico" -32515 ICON DISCARDABLE "Resource\\warning.ico" -IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" -IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" -IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" -IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" -IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" -IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" -IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" -IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" -IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" -IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" -IDI_SERVER ICON DISCARDABLE "resource\\server.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" -IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" -IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" -IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" -IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" -IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" -IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" -IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" -IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" -IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" -IDI_ACL ICON DISCARDABLE "resource\\acl.ico" -IDI_CELL ICON DISCARDABLE "resource\\cell.ico" -IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" -IDI_USER ICON DISCARDABLE "resource\\user.ico" -IDI_GROUP ICON DISCARDABLE "resource\\group.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Erro" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "O Windows não foi capaz de completar a tarefa pedida porque ocorreu um erro não reconhecido.", - IDC_ERROR_DESC,31,7,242,33 - LTEXT "Erro: %1",IDC_ERROR_STATUS,31,49,241,16 - DEFPUSHBUTTON "OK",IDOK,114,73,50,14 - ICON 32513,IDC_STATIC,4,7,20,20 -END - -IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 164 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "Selecionar Célula" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Célula:",IDC_STATIC,4,24,26,8 - LTEXT "Selecione a célula do AFS com a qual deseja trabalhar.", - IDC_STATIC,4,7,200,8 - COMBOBOX IDC_OPENCELL_CELL,30,22,185,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Identidade do AFS:",IDC_STATIC,12,103,65,8 - EDITTEXT IDC_OPENCELL_ID,80,101,128,13,ES_AUTOHSCROLL - LTEXT "&Senha do AFS:",IDC_STATIC,12,119,55,8 - EDITTEXT IDC_OPENCELL_PASSWORD,80,117,128,13,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,57,146,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,111,146,50,14 - PUSHBUTTON "&Ajuda",9,165,146,50,14 - GROUPBOX "Autenticação do AFS",IDC_STATIC,4,44,211,92 - LTEXT "(consultando...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "Para administrar uma célula, é preciso informar novamente sua senha do AFS:", - IDC_STATIC,10,80,196,16 - LTEXT "Seus tokens do AFS atuais dentro da célula selecionada:", - IDC_STATIC,10,57,196,8 -END - -IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 211, 141 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Autenticação do AFS" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "&Identidade do AFS:",IDC_STATIC,8,75,66,8 - EDITTEXT IDC_CREDS_ID,77,73,124,14,ES_AUTOHSCROLL - LTEXT "&Senha do AFS:",IDC_STATIC,8,92,50,8 - EDITTEXT IDC_CREDS_PASSWORD,77,89,124,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "Célula do AFS:",IDC_STATIC,4,7,52,8 - EDITTEXT IDC_CREDS_CELL,78,7,129,12,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE - LTEXT "Identidade Atual:",IDC_STATIC,4,23,57,8 - EDITTEXT IDC_CREDS_CURRENTID,78,22,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - LTEXT "Data de Vencimento:",IDC_STATIC,4,39,68,8 - EDITTEXT IDC_CREDS_EXPDATE,78,38,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - DEFPUSHBUTTON "OK",IDOK,48,123,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,102,123,50,14 - PUSHBUTTON "&Ajuda",9,156,123,50,14 - GROUPBOX " ",IDC_STATIC,4,57,203,56 - CONTROL "&Obter novos tokens do AFS para esta célula", - IDC_CREDS_LOGIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8, - 57,164,10 -END - -IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "Atenção" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "&Sim",IDOK,173,78,50,14 - PUSHBUTTON "&Não",IDCANCEL,227,78,50,14 - PUSHBUTTON "&Ajuda",9,281,78,50,14 - CONTROL "&Não mostrar novamente este aviso",IDC_BADCREDS_SHUTUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,31,80,128,10 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "(texto definido no runtime)",IDC_BADCREDS_DESC,31,7,300, - 64 -END - -IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 -STYLE WS_CHILD | WS_BORDER -EXSTYLE WS_EX_CLIENTEDGE -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 - LTEXT "(descrição vai aqui)",IDC_COVER_DESC,14,14,162,107 - PUSHBUTTON "Tentar &Novamente...",IDC_COVER_BUTTON,126,107,50,14 -END - -IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | - WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU -CAPTION "Selecionar Volume" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - RTEXT "Volume:",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "&Selecionar",IDOK,224,113,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,224,129,50,14 - RTEXT "Examinar na &célula:",IDC_STATIC,7,9,68,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,83,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE - CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY - DEFPUSHBUTTON "(Sou removido do diálogo e portanto sou invisível no runtime)", - IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP -END - -IDD_APPLIB_BROWSE DIALOG DISCARDABLE 0, 0, 281, 150 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | - WS_SYSMENU -CAPTION "(Este título selecionado no runtime)" -FONT 9, "MS Shell Dlg" -BEGIN - RTEXT "(runtime)",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "&Selecionar",IDC_BROWSE_SELECT,224,112,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,224,129,50,14 - RTEXT "Examinar na &célula:",IDC_STATIC,7,9,41,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "(Sou removido do diálogo e portanto sou invisível no runtime)", - IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP - CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_APPLIB_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 87 - END - - IDD_APPLIB_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 7 - BOTTOMMARGIN, 160 - END - - IDD_APPLIB_CREDENTIALS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 207 - TOPMARGIN, 7 - BOTTOMMARGIN, 137 - END - - IDD_APPLIB_BADCREDS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 331 - TOPMARGIN, 7 - BOTTOMMARGIN, 92 - END - - IDD_APPLIB_COVER, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 182 - TOPMARGIN, 7 - BOTTOMMARGIN, 128 - END - - IDD_APPLIB_BROWSE_FILESET, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END - - IDD_APPLIB_BROWSE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" -IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" -IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" -IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" -IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" -IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" -IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" -IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" -IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_BADCREDS_DESC_GENERAL - "Você não possui tokens do AFS como administrador na célula %1.\n\n%2\n\n%3" - IDS_BADCREDS_DESC_EXPIRED - "Seus tokens na célula %1 estão vencidos.\n\n%2\n\n%3" - IDS_BADCREDS_DESC_BADCHOICE - "Você optou por não efetuar logon como administrador na célula %1.\n\n%2\n\n%3" - IDS_BADCREDS_DESC2 "A menos que tenha efetuado logon como administrador, você pode ter privilégios insuficientes para trabalhar com a célula %1." - IDS_BADCREDS_DESC3 "Gostaria de obter novos tokens do AFS agora?" - IDS_BADCREDS_DESC3_ADM "Gostaria de efetuar logon como administrador?" - IDS_BADCREDS_DESC_DESTROYED - "Seus tokens na célula %1 não são mais válidos.\n\n%2\n\n%3" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS - "A identidade do AFS informada não é reconhecida, ou a senha especificada está incorreta." - IDS_BROWSE_WAITING "consultando o servidor--aguarde..." - IDS_BROWSE_BADCELL_TITLE "Célula Não Reconhecida" - IDS_BROWSE_BADCELL_DESC "O nome de célula informado não foi encontrado na rede.\n\nVerifique o nome da célula para certificar-se de que esteja corretamente digitado." - IDS_CREDS_NONE "(nenhum token)" - IDS_CREDS_VALID "%2, vence em %3" - IDS_CREDS_EXPIRED "(tokens vencidos %3)" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "al_resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""DLL Base da Aplicação AFS""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +32513 ICON DISCARDABLE "Resource\\error.ico" +32515 ICON DISCARDABLE "Resource\\warning.ico" +IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" +IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" +IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" +IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" +IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" +IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" +IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" +IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" +IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" +IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" +IDI_SERVER ICON DISCARDABLE "resource\\server.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" +IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" +IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" +IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" +IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" +IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" +IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" +IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" +IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" +IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" +IDI_ACL ICON DISCARDABLE "resource\\acl.ico" +IDI_CELL ICON DISCARDABLE "resource\\cell.ico" +IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" +IDI_USER ICON DISCARDABLE "resource\\user.ico" +IDI_GROUP ICON DISCARDABLE "resource\\group.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Erro" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "O Windows não foi capaz de completar a tarefa pedida porque ocorreu um erro não reconhecido.", + IDC_ERROR_DESC,31,7,242,33 + LTEXT "Erro: %1",IDC_ERROR_STATUS,31,49,241,16 + DEFPUSHBUTTON "OK",IDOK,114,73,50,14 + ICON 32513,IDC_STATIC,4,7,20,20 +END + +IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 164 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Selecionar Célula" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Célula:",IDC_STATIC,4,24,26,8 + LTEXT "Selecione a célula do AFS com a qual deseja trabalhar.", + IDC_STATIC,4,7,200,8 + COMBOBOX IDC_OPENCELL_CELL,30,22,185,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Identidade do AFS:",IDC_STATIC,12,103,65,8 + EDITTEXT IDC_OPENCELL_ID,80,101,128,13,ES_AUTOHSCROLL + LTEXT "&Senha do AFS:",IDC_STATIC,12,119,55,8 + EDITTEXT IDC_OPENCELL_PASSWORD,80,117,128,13,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,57,146,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,111,146,50,14 + PUSHBUTTON "&Ajuda",9,165,146,50,14 + GROUPBOX "Autenticação do AFS",IDC_STATIC,4,44,211,92 + LTEXT "(consultando...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "Para administrar uma célula, é preciso informar novamente sua senha do AFS:", + IDC_STATIC,10,80,196,16 + LTEXT "Seus tokens do AFS atuais dentro da célula selecionada:", + IDC_STATIC,10,57,196,8 +END + +IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 211, 141 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Autenticação do AFS" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "&Identidade do AFS:",IDC_STATIC,8,75,66,8 + EDITTEXT IDC_CREDS_ID,77,73,124,14,ES_AUTOHSCROLL + LTEXT "&Senha do AFS:",IDC_STATIC,8,92,50,8 + EDITTEXT IDC_CREDS_PASSWORD,77,89,124,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "Célula do AFS:",IDC_STATIC,4,7,52,8 + EDITTEXT IDC_CREDS_CELL,78,7,129,12,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE + LTEXT "Identidade Atual:",IDC_STATIC,4,23,57,8 + EDITTEXT IDC_CREDS_CURRENTID,78,22,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + LTEXT "Data de Vencimento:",IDC_STATIC,4,39,68,8 + EDITTEXT IDC_CREDS_EXPDATE,78,38,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + DEFPUSHBUTTON "OK",IDOK,48,123,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,102,123,50,14 + PUSHBUTTON "&Ajuda",9,156,123,50,14 + GROUPBOX " ",IDC_STATIC,4,57,203,56 + CONTROL "&Obter novos tokens do AFS para esta célula", + IDC_CREDS_LOGIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8, + 57,164,10 +END + +IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Atenção" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "&Sim",IDOK,173,78,50,14 + PUSHBUTTON "&Não",IDCANCEL,227,78,50,14 + PUSHBUTTON "&Ajuda",9,281,78,50,14 + CONTROL "&Não mostrar novamente este aviso",IDC_BADCREDS_SHUTUP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,31,80,128,10 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "(texto definido no runtime)",IDC_BADCREDS_DESC,31,7,300, + 64 +END + +IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 +STYLE WS_CHILD | WS_BORDER +EXSTYLE WS_EX_CLIENTEDGE +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 + LTEXT "(descrição vai aqui)",IDC_COVER_DESC,14,14,162,107 + PUSHBUTTON "Tentar &Novamente...",IDC_COVER_BUTTON,126,107,50,14 +END + +IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | + WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "Selecionar Volume" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + RTEXT "Volume:",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "&Selecionar",IDOK,224,113,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,224,129,50,14 + RTEXT "Examinar na &célula:",IDC_STATIC,7,9,68,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,83,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE + CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY + DEFPUSHBUTTON "(Sou removido do diálogo e portanto sou invisível no runtime)", + IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP +END + +IDD_APPLIB_BROWSE DIALOG DISCARDABLE 0, 0, 281, 150 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | + WS_SYSMENU +CAPTION "(Este título selecionado no runtime)" +FONT 9, "MS Shell Dlg" +BEGIN + RTEXT "(runtime)",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "&Selecionar",IDC_BROWSE_SELECT,224,112,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,224,129,50,14 + RTEXT "Examinar na &célula:",IDC_STATIC,7,9,41,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "(Sou removido do diálogo e portanto sou invisível no runtime)", + IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP + CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_APPLIB_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 87 + END + + IDD_APPLIB_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 7 + BOTTOMMARGIN, 160 + END + + IDD_APPLIB_CREDENTIALS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 207 + TOPMARGIN, 7 + BOTTOMMARGIN, 137 + END + + IDD_APPLIB_BADCREDS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 331 + TOPMARGIN, 7 + BOTTOMMARGIN, 92 + END + + IDD_APPLIB_COVER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 182 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END + + IDD_APPLIB_BROWSE_FILESET, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END + + IDD_APPLIB_BROWSE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" +IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" +IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" +IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" +IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" +IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" +IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" +IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" +IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADCREDS_DESC_GENERAL + "Você não possui tokens do AFS como administrador na célula %1.\n\n%2\n\n%3" + IDS_BADCREDS_DESC_EXPIRED + "Seus tokens na célula %1 estão vencidos.\n\n%2\n\n%3" + IDS_BADCREDS_DESC_BADCHOICE + "Você optou por não efetuar logon como administrador na célula %1.\n\n%2\n\n%3" + IDS_BADCREDS_DESC2 "A menos que tenha efetuado logon como administrador, você pode ter privilégios insuficientes para trabalhar com a célula %1." + IDS_BADCREDS_DESC3 "Gostaria de obter novos tokens do AFS agora?" + IDS_BADCREDS_DESC3_ADM "Gostaria de efetuar logon como administrador?" + IDS_BADCREDS_DESC_DESTROYED + "Seus tokens na célula %1 não são mais válidos.\n\n%2\n\n%3" + IDS_ERROR_BAD_CREDENTIALS + "A identidade do AFS informada não é reconhecida, ou a senha especificada está incorreta." + IDS_BROWSE_WAITING "consultando o servidor--aguarde..." + IDS_BROWSE_BADCELL_TITLE "Célula Não Reconhecida" + IDS_BROWSE_BADCELL_DESC "O nome de célula informado não foi encontrado na rede.\n\nVerifique o nome da célula para certificar-se de que esteja corretamente digitado." + IDS_CREDS_NONE "(nenhum token)" + IDS_CREDS_VALID "%2, vence em %3" + IDS_CREDS_EXPIRED "(tokens vencidos %3)" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afsapplib/lang/zh_CN/afsapplib.rc b/src/WINNT/afsapplib/lang/zh_CN/afsapplib.rc index 37832a587..73fcd7931 100644 --- a/src/WINNT/afsapplib/lang/zh_CN/afsapplib.rc +++ b/src/WINNT/afsapplib/lang/zh_CN/afsapplib.rc @@ -7,379 +7,375 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "al_resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "AFS Ó¦ÓóÌÐò»ù±¾¶¯Ì¬Á´½Ó¿â" +#include "al_resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "AFS Ó¦ÓóÌÐò»ù±¾¶¯Ì¬Á´½Ó¿â" #define AFS_VERINFO_DLL #define AFS_VERINFO_NAME "afsapplib" #define AFS_VERINFO_FILENAME "afsapplib.dll" #define AFS_VERINFO_LANG_CODE 0x804 #define AFS_VERINFO_CHARSET 936 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Chinese (P.R.C.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) -#ifdef _WIN32 -LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "al_resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Ó¦ÓóÌÐò»ù±¾¶¯Ì¬Á´½Ó¿â""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -32513 ICON DISCARDABLE "Resource\\error.ico" -32515 ICON DISCARDABLE "Resource\\warning.ico" -IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" -IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" -IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" -IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" -IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" -IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" -IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" -IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" -IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" -IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" -IDI_SERVER ICON DISCARDABLE "resource\\server.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" -IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" -IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" -IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" -IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" -IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" -IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" -IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" -IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" -IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" -IDI_ACL ICON DISCARDABLE "resource\\acl.ico" -IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" -IDI_USER ICON DISCARDABLE "resource\\user.ico" -IDI_GROUP ICON DISCARDABLE "resource\\group.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "´íÎó" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "ÓÉÓÚ·¢ÉúÁËÒ»¸öÎÞ·¨Ê¶±ðµÄ´íÎó£¬Windows ÎÞ·¨Íê³ÉÇëÇóµÄÈÎÎñ¡£", - IDC_ERROR_DESC,31,7,242,33 - LTEXT "´íÎó£º%1",IDC_ERROR_STATUS,31,49,241,16 - DEFPUSHBUTTON "È·¶¨",IDOK,114,73,50,14 - ICON 32513,IDC_STATIC,4,7,20,20 -END - -IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 164 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "Ñ¡Ôñµ¥Ôª" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "µ¥Ôª(&C)£º",IDC_STATIC,4,24,36,8 - LTEXT "Ñ¡ÔñÄúÏ£ÍûʹÓÃµÄ AFS µ¥Ôª¡£",IDC_STATIC,4,7,200,8 - COMBOBOX IDC_OPENCELL_CELL,46,22,169,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS Éí·Ý(&I)£º",IDC_STATIC,22,100,53,8 - EDITTEXT IDC_OPENCELL_ID,80,98,128,13,ES_AUTOHSCROLL - LTEXT "AFS ¿ÚÁî(&P)£º",IDC_STATIC,22,116,55,8 - EDITTEXT IDC_OPENCELL_PASSWORD,80,114,128,13,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "È·¶¨",IDOK,57,146,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,111,146,50,14 - PUSHBUTTON "°ïÖú(&H)",9,165,146,50,14 - GROUPBOX "AFS ÈÏÖ¤",IDC_STATIC,4,44,211,92 - LTEXT "(ÕýÔÚ²éѯ...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "Òª¹ÜÀíµ¥Ôª£¬±ØÐëÖØÐÂÊäÈëÄúµÄ AFS ¿ÚÁ",IDC_STATIC,10, - 85,196,8 - LTEXT "ÄúÔÚËùÑ¡µ¥ÔªÄڵĵ±Ç° AFS ÁîÅÆ£º",IDC_STATIC,10,57,196,8 -END - -IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 197, 140 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS ÈÏÖ¤" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "AFS Éí·Ý(&I)£º",IDC_STATIC,8,75,53,8 - EDITTEXT IDC_CREDS_ID,64,73,124,14,ES_AUTOHSCROLL - LTEXT "AFS ¿ÚÁî(&P)£º",IDC_STATIC,8,92,53,8 - EDITTEXT IDC_CREDS_PASSWORD,64,89,124,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "AFS µ¥Ôª£º",IDC_STATIC,4,7,52,8 - EDITTEXT IDC_CREDS_CELL,64,7,129,12,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE - LTEXT "µ±Ç°Éí·Ý£º",IDC_STATIC,4,23,52,8 - EDITTEXT IDC_CREDS_CURRENTID,64,22,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - LTEXT "µ½ÆÚÈÕÆÚ£º",IDC_STATIC,4,39,52,8 - EDITTEXT IDC_CREDS_EXPDATE,64,38,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - DEFPUSHBUTTON "È·¶¨",IDOK,35,122,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,89,122,50,14 - PUSHBUTTON "°ïÖú(&H)",9,143,122,50,14 - GROUPBOX " ",IDC_STATIC,4,57,189,56 - CONTROL "»ñµÃ¸Ãµ¥ÔªµÄРAFS ÁîÅÆ(&O)",IDC_CREDS_LOGIN,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,13,57,138,10 -END - -IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "×¢Òâ" -FONT 9, "ËÎÌå" -BEGIN - DEFPUSHBUTTON "ÊÇ(&Y)",IDOK,173,78,50,14 - PUSHBUTTON "·ñ(&N)",IDCANCEL,227,78,50,14 - PUSHBUTTON "°ïÖú(&H)",9,281,78,50,14 - CONTROL "²»ÔÙÏÔʾ´Ë¾¯¸æ(&D)",IDC_BADCREDS_SHUTUP,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,31,80,120,10 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "(ÔËÐÐʱÉèÖõÄÎı¾)",IDC_BADCREDS_DESC,31,7,300,64 -END - -IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 -STYLE WS_CHILD | WS_BORDER -EXSTYLE WS_EX_CLIENTEDGE -FONT 9, "ËÎÌå" -BEGIN - GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 - LTEXT "(ÃèÊöµ½´Ë)",IDC_COVER_DESC,14,14,162,107 - PUSHBUTTON "ÖØÊÔ(&A)...",IDC_COVER_BUTTON,126,107,50,14 -END - -IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | - WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU -CAPTION "Ñ¡Ôñ¾í" -FONT 9, "ËÎÌå" -BEGIN - RTEXT "¾í£º",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "Ñ¡Ôñ(&S)",IDOK,224,113,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,224,129,50,14 - RTEXT "²é¿´µ¥Ôª(&C)£º",IDC_STATIC,7,9,54,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,66,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE - CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY - DEFPUSHBUTTON "(ÎÒ³ýÈ¥Á˶Ի°£¬ËùÒÔÔÚÔËÐÐʱÎÒ²»¿É¼û)", - IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP -END - -IDD_APPLIB_BROWSE DIALOGEX 0, 0, 281, 150 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | - WS_SYSMENU -CAPTION "(ÔËÐÐʱѡÖиñêÌâ)" -FONT 9, "ËÎÌå" -BEGIN - RTEXT "(ÔËÐÐʱ)",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "Ñ¡Ôñ(&S)",IDC_BROWSE_SELECT,224,112,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,224,129,50,14 - RTEXT "²é¿´µ¥Ôª(&C)£º",IDC_STATIC,7,9,54,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,66,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "(ÎÒ³ýÈ¥Á˶Ի°£¬ËùÒÔÔÚÔËÐÐʱÎÒ²»¿É¼û)", - IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP - CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_APPLIB_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 87 - END - - IDD_APPLIB_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 7 - BOTTOMMARGIN, 160 - END - - IDD_APPLIB_CREDENTIALS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 193 - TOPMARGIN, 7 - BOTTOMMARGIN, 136 - END - - IDD_APPLIB_BADCREDS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 331 - TOPMARGIN, 7 - BOTTOMMARGIN, 92 - END - - IDD_APPLIB_COVER, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 182 - TOPMARGIN, 7 - BOTTOMMARGIN, 128 - END - - IDD_APPLIB_BROWSE_FILESET, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END - - IDD_APPLIB_BROWSE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" -IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" -IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" -IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" -IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" -IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" -IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" -IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" -IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_BADCREDS_DESC_GENERAL - "ÄúÔÚ %1 µ¥ÔªÄÚûÓÐ AFS µÄ¹ÜÀíÔ±ÁîÅÆ¡£\n\n%2\n\n%3" - IDS_BADCREDS_DESC_EXPIRED "ÄúÔÚ %1 µ¥ÔªÄÚµÄÁîÅÆÒѵ½ÆÚ¡£\n\n%2\n\n%3" - IDS_BADCREDS_DESC_BADCHOICE - "ÄúÒÑÑ¡ÔñÔÚ %1 µ¥ÔªÄÚ²»ÒÔ¹ÜÀíÔ±Éí·ÝµÇ¼¡£\n\n%2\n\n%3" - IDS_BADCREDS_DESC2 "³ý·ÇÄúÒѾ­ÒÔ¹ÜÀíÔ±Éí·ÝµÇ¼£¬·ñÔòÄú½«Ã»ÓÐ×ã¹»µÄÌØÈ¨À´Ê¹Óà %1 µ¥Ôª¡£" - IDS_BADCREDS_DESC3 "ÄúÏ£ÍûÏÖÔÚ»ñµÃÐ嵀 AFS ÁîÅÆÂð?" - IDS_BADCREDS_DESC3_ADM "ÄúÏ£ÍûÒÔ¹ÜÀíÔ±Éí·ÝµÇ¼Âð?" - IDS_BADCREDS_DESC_DESTROYED "ÄúÔÚ %1 µ¥ÔªÄÚµÄÁîÅÆÒÑʧЧ¡£\n\n%2\n\n%3" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS "ÎÞ·¨Ê¶±ðÄúÊäÈëµÄ AFS Éí·Ý£¬»òÄúµÄ¿ÚÁî²»ÕýÈ·¡£" - IDS_BROWSE_WAITING "ÕýÔÚ²éѯ·þÎñÆ÷--ÇëµÈ´ý..." - IDS_BROWSE_BADCELL_TITLE "ÎÞ·¨Ê¶±ðµÄµ¥Ôª" - IDS_BROWSE_BADCELL_DESC "ÍøÂçÖÐÎÞ·¨ÕÒµ½ÄúÊäÈëµÄµ¥ÔªÃû¡£\n\nÇë¼ì²éµ¥ÔªÃûÒÔÈ·ÈÏÆ´Ð´ÊÇ·ñÕýÈ·¡£" - IDS_CREDS_NONE "(ûÓÐÁîÅÆ)" - IDS_CREDS_VALID "%2£¬µ½ÆÚ %3" - IDS_CREDS_EXPIRED "(ÁîÅÆµ½ÆÚ %3)" -END - -#endif // Chinese (P.R.C.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Chinese (P.R.C.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +#ifdef _WIN32 +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "al_resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Ó¦ÓóÌÐò»ù±¾¶¯Ì¬Á´½Ó¿â""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +32513 ICON DISCARDABLE "Resource\\error.ico" +32515 ICON DISCARDABLE "Resource\\warning.ico" +IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" +IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" +IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" +IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" +IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" +IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" +IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" +IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" +IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" +IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" +IDI_SERVER ICON DISCARDABLE "resource\\server.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" +IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" +IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" +IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" +IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" +IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" +IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" +IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" +IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" +IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" +IDI_ACL ICON DISCARDABLE "resource\\acl.ico" +IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" +IDI_USER ICON DISCARDABLE "resource\\user.ico" +IDI_GROUP ICON DISCARDABLE "resource\\group.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "´íÎó" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "ÓÉÓÚ·¢ÉúÁËÒ»¸öÎÞ·¨Ê¶±ðµÄ´íÎó£¬Windows ÎÞ·¨Íê³ÉÇëÇóµÄÈÎÎñ¡£", + IDC_ERROR_DESC,31,7,242,33 + LTEXT "´íÎó£º%1",IDC_ERROR_STATUS,31,49,241,16 + DEFPUSHBUTTON "È·¶¨",IDOK,114,73,50,14 + ICON 32513,IDC_STATIC,4,7,20,20 +END + +IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 164 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Ñ¡Ôñµ¥Ôª" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "µ¥Ôª(&C)£º",IDC_STATIC,4,24,36,8 + LTEXT "Ñ¡ÔñÄúÏ£ÍûʹÓÃµÄ AFS µ¥Ôª¡£",IDC_STATIC,4,7,200,8 + COMBOBOX IDC_OPENCELL_CELL,46,22,169,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS Éí·Ý(&I)£º",IDC_STATIC,22,100,53,8 + EDITTEXT IDC_OPENCELL_ID,80,98,128,13,ES_AUTOHSCROLL + LTEXT "AFS ¿ÚÁî(&P)£º",IDC_STATIC,22,116,55,8 + EDITTEXT IDC_OPENCELL_PASSWORD,80,114,128,13,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "È·¶¨",IDOK,57,146,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,111,146,50,14 + PUSHBUTTON "°ïÖú(&H)",9,165,146,50,14 + GROUPBOX "AFS ÈÏÖ¤",IDC_STATIC,4,44,211,92 + LTEXT "(ÕýÔÚ²éѯ...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "Òª¹ÜÀíµ¥Ôª£¬±ØÐëÖØÐÂÊäÈëÄúµÄ AFS ¿ÚÁ",IDC_STATIC,10, + 85,196,8 + LTEXT "ÄúÔÚËùÑ¡µ¥ÔªÄڵĵ±Ç° AFS ÁîÅÆ£º",IDC_STATIC,10,57,196,8 +END + +IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 197, 140 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS ÈÏÖ¤" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "AFS Éí·Ý(&I)£º",IDC_STATIC,8,75,53,8 + EDITTEXT IDC_CREDS_ID,64,73,124,14,ES_AUTOHSCROLL + LTEXT "AFS ¿ÚÁî(&P)£º",IDC_STATIC,8,92,53,8 + EDITTEXT IDC_CREDS_PASSWORD,64,89,124,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "AFS µ¥Ôª£º",IDC_STATIC,4,7,52,8 + EDITTEXT IDC_CREDS_CELL,64,7,129,12,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE + LTEXT "µ±Ç°Éí·Ý£º",IDC_STATIC,4,23,52,8 + EDITTEXT IDC_CREDS_CURRENTID,64,22,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + LTEXT "µ½ÆÚÈÕÆÚ£º",IDC_STATIC,4,39,52,8 + EDITTEXT IDC_CREDS_EXPDATE,64,38,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + DEFPUSHBUTTON "È·¶¨",IDOK,35,122,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,89,122,50,14 + PUSHBUTTON "°ïÖú(&H)",9,143,122,50,14 + GROUPBOX " ",IDC_STATIC,4,57,189,56 + CONTROL "»ñµÃ¸Ãµ¥ÔªµÄРAFS ÁîÅÆ(&O)",IDC_CREDS_LOGIN,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,57,138,10 +END + +IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "×¢Òâ" +FONT 9, "ËÎÌå" +BEGIN + DEFPUSHBUTTON "ÊÇ(&Y)",IDOK,173,78,50,14 + PUSHBUTTON "·ñ(&N)",IDCANCEL,227,78,50,14 + PUSHBUTTON "°ïÖú(&H)",9,281,78,50,14 + CONTROL "²»ÔÙÏÔʾ´Ë¾¯¸æ(&D)",IDC_BADCREDS_SHUTUP,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,31,80,120,10 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "(ÔËÐÐʱÉèÖõÄÎı¾)",IDC_BADCREDS_DESC,31,7,300,64 +END + +IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 +STYLE WS_CHILD | WS_BORDER +EXSTYLE WS_EX_CLIENTEDGE +FONT 9, "ËÎÌå" +BEGIN + GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 + LTEXT "(ÃèÊöµ½´Ë)",IDC_COVER_DESC,14,14,162,107 + PUSHBUTTON "ÖØÊÔ(&A)...",IDC_COVER_BUTTON,126,107,50,14 +END + +IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | + WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "Ñ¡Ôñ¾í" +FONT 9, "ËÎÌå" +BEGIN + RTEXT "¾í£º",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "Ñ¡Ôñ(&S)",IDOK,224,113,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,224,129,50,14 + RTEXT "²é¿´µ¥Ôª(&C)£º",IDC_STATIC,7,9,54,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,66,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE + CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY + DEFPUSHBUTTON "(ÎÒ³ýÈ¥Á˶Ի°£¬ËùÒÔÔÚÔËÐÐʱÎÒ²»¿É¼û)", + IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP +END + +IDD_APPLIB_BROWSE DIALOGEX 0, 0, 281, 150 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | + WS_SYSMENU +CAPTION "(ÔËÐÐʱѡÖиñêÌâ)" +FONT 9, "ËÎÌå" +BEGIN + RTEXT "(ÔËÐÐʱ)",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "Ñ¡Ôñ(&S)",IDC_BROWSE_SELECT,224,112,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,224,129,50,14 + RTEXT "²é¿´µ¥Ôª(&C)£º",IDC_STATIC,7,9,54,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,66,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "(ÎÒ³ýÈ¥Á˶Ի°£¬ËùÒÔÔÚÔËÐÐʱÎÒ²»¿É¼û)", + IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP + CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_APPLIB_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 87 + END + + IDD_APPLIB_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 7 + BOTTOMMARGIN, 160 + END + + IDD_APPLIB_CREDENTIALS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 193 + TOPMARGIN, 7 + BOTTOMMARGIN, 136 + END + + IDD_APPLIB_BADCREDS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 331 + TOPMARGIN, 7 + BOTTOMMARGIN, 92 + END + + IDD_APPLIB_COVER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 182 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END + + IDD_APPLIB_BROWSE_FILESET, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END + + IDD_APPLIB_BROWSE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" +IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" +IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" +IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" +IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" +IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" +IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" +IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" +IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADCREDS_DESC_GENERAL + "ÄúÔÚ %1 µ¥ÔªÄÚûÓÐ AFS µÄ¹ÜÀíÔ±ÁîÅÆ¡£\n\n%2\n\n%3" + IDS_BADCREDS_DESC_EXPIRED "ÄúÔÚ %1 µ¥ÔªÄÚµÄÁîÅÆÒѵ½ÆÚ¡£\n\n%2\n\n%3" + IDS_BADCREDS_DESC_BADCHOICE + "ÄúÒÑÑ¡ÔñÔÚ %1 µ¥ÔªÄÚ²»ÒÔ¹ÜÀíÔ±Éí·ÝµÇ¼¡£\n\n%2\n\n%3" + IDS_BADCREDS_DESC2 "³ý·ÇÄúÒѾ­ÒÔ¹ÜÀíÔ±Éí·ÝµÇ¼£¬·ñÔòÄú½«Ã»ÓÐ×ã¹»µÄÌØÈ¨À´Ê¹Óà %1 µ¥Ôª¡£" + IDS_BADCREDS_DESC3 "ÄúÏ£ÍûÏÖÔÚ»ñµÃÐ嵀 AFS ÁîÅÆÂð?" + IDS_BADCREDS_DESC3_ADM "ÄúÏ£ÍûÒÔ¹ÜÀíÔ±Éí·ÝµÇ¼Âð?" + IDS_BADCREDS_DESC_DESTROYED "ÄúÔÚ %1 µ¥ÔªÄÚµÄÁîÅÆÒÑʧЧ¡£\n\n%2\n\n%3" + IDS_ERROR_BAD_CREDENTIALS "ÎÞ·¨Ê¶±ðÄúÊäÈëµÄ AFS Éí·Ý£¬»òÄúµÄ¿ÚÁî²»ÕýÈ·¡£" + IDS_BROWSE_WAITING "ÕýÔÚ²éѯ·þÎñÆ÷--ÇëµÈ´ý..." + IDS_BROWSE_BADCELL_TITLE "ÎÞ·¨Ê¶±ðµÄµ¥Ôª" + IDS_BROWSE_BADCELL_DESC "ÍøÂçÖÐÎÞ·¨ÕÒµ½ÄúÊäÈëµÄµ¥ÔªÃû¡£\n\nÇë¼ì²éµ¥ÔªÃûÒÔÈ·ÈÏÆ´Ð´ÊÇ·ñÕýÈ·¡£" + IDS_CREDS_NONE "(ûÓÐÁîÅÆ)" + IDS_CREDS_VALID "%2£¬µ½ÆÚ %3" + IDS_CREDS_EXPIRED "(ÁîÅÆµ½ÆÚ %3)" +END + +#endif // Chinese (P.R.C.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afsapplib/lang/zh_TW/afsapplib.rc b/src/WINNT/afsapplib/lang/zh_TW/afsapplib.rc index a77ddf591..66805af10 100644 --- a/src/WINNT/afsapplib/lang/zh_TW/afsapplib.rc +++ b/src/WINNT/afsapplib/lang/zh_TW/afsapplib.rc @@ -7,382 +7,378 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "al_resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "AFS Application Base DLL" +#include "al_resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "AFS Application Base DLL" #define AFS_VERINFO_DLL #define AFS_VERINFO_NAME "afsapplib" #define AFS_VERINFO_FILENAME "afsapplib.dll" #define AFS_VERINFO_LANG_CODE 0x404 #define AFS_VERINFO_CHARSET 950 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "al_resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Application Base DLL""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -32513 ICON DISCARDABLE "Resource\\error.ico" -32515 ICON DISCARDABLE "Resource\\warning.ico" -IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" -IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" -IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" -IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" -IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" -IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" -IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" -IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" -IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" -IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" -IDI_SERVER ICON DISCARDABLE "resource\\server.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" -IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" -IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" -IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" -IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" -IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" -IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" -IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" -IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" -IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" -IDI_ACL ICON DISCARDABLE "resource\\acl.ico" -IDI_CELL ICON DISCARDABLE "resource\\cell.ico" -IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" -IDI_USER ICON DISCARDABLE "resource\\user.ico" -IDI_GROUP ICON DISCARDABLE "resource\\group.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "¿ù»~" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¥Ñ©ó²£¥ÍµLªkÃѧOªº¿ù»~¡A¦]¦¹ Windows µLªk§¹¦¨©Ò­n¨Dªº§@·~¡C", - IDC_ERROR_DESC,31,7,242,33 - LTEXT "¿ù»~¡G %1",IDC_ERROR_STATUS,31,49,241,16 - DEFPUSHBUTTON "½T©w",IDOK,114,73,50,14 - ICON 32513,IDC_STATIC,4,7,20,20 -END - -IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 164 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "¿ï¨ú Cell" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "Cell (&C)¡G",IDC_STATIC,4,24,36,8 - LTEXT "¿ï¨ú±z­n§@·~ªº AFS Cell",IDC_STATIC,4,7,200,8 - COMBOBOX IDC_OPENCELL_CELL,41,22,174,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS ¨­¥÷(&I)¡G",IDC_STATIC,12,100,63,8 - EDITTEXT IDC_OPENCELL_ID,80,98,128,13,ES_AUTOHSCROLL - LTEXT "AFS ±K½X(&P)¡G",IDC_STATIC,12,116,55,8 - EDITTEXT IDC_OPENCELL_PASSWORD,80,114,128,13,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "½T©w",IDOK,57,146,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,111,146,50,14 - PUSHBUTTON "»¡©ú(&H)",9,165,146,50,14 - GROUPBOX "AFS Ų§O",IDC_STATIC,4,44,211,92 - LTEXT "¡]¬d¸ß...¡^",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "¦p­nºÞ²z Cell¡A±z¥²¶·­«·s¿é¤J AFS ±K½X¡G",IDC_STATIC,10, - 85,196,8 - LTEXT "±z¥Ø«e¦b©Ò¿ï¨ú¤§ Cell ¤¤ªº AFS °O¸¹¡G",IDC_STATIC,10,57, - 196,8 -END - -IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 197, 140 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS Ų§O" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "AFS ¨­¥÷(&I)¡G",IDC_STATIC,8,75,65,8 - EDITTEXT IDC_CREDS_ID,74,73,114,14,ES_AUTOHSCROLL - LTEXT "AFS ±K½X(&P)¡G",IDC_STATIC,8,92,50,8 - EDITTEXT IDC_CREDS_PASSWORD,74,89,114,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "AFS Cell¡G",IDC_STATIC,4,7,52,8 - EDITTEXT IDC_CREDS_CELL,64,7,129,12,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE - LTEXT "¥Ø«eªº¨­¥÷¡G",IDC_STATIC,4,23,52,8 - EDITTEXT IDC_CREDS_CURRENTID,64,22,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - LTEXT "¦³®Ä´Á­­¡G",IDC_STATIC,4,39,52,8 - EDITTEXT IDC_CREDS_EXPDATE,64,38,129,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, - WS_EX_STATICEDGE - DEFPUSHBUTTON "½T©w",IDOK,35,122,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,89,122,50,14 - PUSHBUTTON "»¡©ú(&H)",9,143,122,50,14 - GROUPBOX " ",IDC_STATIC,4,64,189,50 - CONTROL "¨ú±o¦¹ Cell ªº·s AFS °O¸¹(&O)",IDC_CREDS_LOGIN,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,5,54,138,10 -END - -IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 -STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | - WS_SYSMENU -CAPTION "ĵ§i" -FONT 9, "·s²Ó©úÅé" -BEGIN - DEFPUSHBUTTON "¬O(&Y)",IDOK,173,78,50,14 - PUSHBUTTON "§_(&N)",IDCANCEL,227,78,50,14 - PUSHBUTTON "»¡©ú(&H)",9,281,78,50,14 - CONTROL "¤£­n¦AÅã¥Ü¦¹Äµ§i(&D)",IDC_BADCREDS_SHUTUP,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,31,80,120,10 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "¡]°õ¦æ´Á¶¡³]©w¤å¦r¡^",IDC_BADCREDS_DESC,31,7,300,64 -END - -IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 -STYLE WS_CHILD | WS_BORDER -EXSTYLE WS_EX_CLIENTEDGE -FONT 9, "·s²Ó©úÅé" -BEGIN - GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 - LTEXT "¡]»¡©ú¦p¤U©Ò¥Ü¡^",IDC_COVER_DESC,14,14,162,107 - PUSHBUTTON "­«·s¹Á¸Õ(&A)...",IDC_COVER_BUTTON,126,107,50,14 -END - -IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | - WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU -CAPTION "¿ï¨ú®eÅé" -FONT 9, "·s²Ó©úÅé" -BEGIN - RTEXT "®eÅé¡G",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "¿ï¨ú(&S)",IDOK,224,113,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,224,129,50,14 - RTEXT "¼fµø Cell (&C)¡G",IDC_STATIC,7,9,41,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE - CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY - DEFPUSHBUTTON "¡]§Ú¤w¸gÂ÷¶}¹ï¸Ü¤è¶ô¡A¦]¦¹¦b°õ¦æ®É¶¡¬OÁô«¬ªº¡^", - IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP -END - -IDD_APPLIB_BROWSE DIALOGEX 0, 0, 281, 150 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | - WS_SYSMENU -CAPTION "¡]³o­Ó¼ÐÃD¬O¦b°õ¦æ´Á¶¡¿ï¨ú¡^" -FONT 9, "·s²Ó©úÅé" -BEGIN - RTEXT "¡]°õ¦æ´Á¶¡¡^",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY - EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - PUSHBUTTON "¿ï¨ú(&S)",IDC_BROWSE_SELECT,224,112,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,224,129,50,14 - RTEXT "¼fµø Cell (&C)¡G",IDC_STATIC,7,9,41,8,SS_NOTIFY - COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | - WS_TABSTOP - CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | - WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "¡]§Ú¤w¸gÂ÷¶}¡A¦]¦¹§Ú¦b°õ¦æ®É¶¡¬OÁô«¬ªº¡^", - IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP - CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_APPLIB_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 87 - END - - IDD_APPLIB_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 7 - BOTTOMMARGIN, 160 - END - - IDD_APPLIB_CREDENTIALS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 193 - TOPMARGIN, 7 - BOTTOMMARGIN, 136 - END - - IDD_APPLIB_BADCREDS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 331 - TOPMARGIN, 7 - BOTTOMMARGIN, 92 - END - - IDD_APPLIB_COVER, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 182 - TOPMARGIN, 7 - BOTTOMMARGIN, 128 - END - - IDD_APPLIB_BROWSE_FILESET, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END - - IDD_APPLIB_BROWSE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - HORZGUIDE, 23 - HORZGUIDE, 107 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" -IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" -IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" -IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" -IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" -IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" -IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" -IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" -IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_BADCREDS_DESC_GENERAL - "±z¦b %1 Cell ¤¤¨Ã¨S¦³§@¬°ºÞ²zªÌªº AFS °O¸¹¡C\n\n%2\n\n%3" - IDS_BADCREDS_DESC_EXPIRED "±z¦b %1 Cell ¤¤ªº°O¸¹¤w¸g¹L´Á¡C\n\n%2\n\n%3" - IDS_BADCREDS_DESC_BADCHOICE - "±z¥¼¿ï¾Ü¥HºÞ²zªÌ¨­¥÷µn¤J %1 Cell¡C\n\n%2\n\n%3" - IDS_BADCREDS_DESC2 "°£«D±z¥HºÞ²zªÌªº¨­¥÷µn¤J¡A§_«h±zªºÅv­­±N¤£¨¬¥H¦b %1 Cell ¤¤§@·~¡C" - IDS_BADCREDS_DESC3 "±z²{¦b­n¨ú±o·sªº AFS °O¸¹¶Ü¡H" - IDS_BADCREDS_DESC3_ADM "±z­n¥HºÞ²zªÌªº¨­¥÷µn¤J¶Ü¡H" - IDS_BADCREDS_DESC_DESTROYED "±z %1 Cell ¤¤ªº°O¸¹¤£¦A¦³®Ä¡C\n\n%2\n\n%3" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS - "µLªkÃѧO±z©Ò¿é¤Jªº AFS ¨­¥÷¡A©Î¬O±z©Ò«ü©wªº±K½X¦³»~¡C" - IDS_BROWSE_WAITING "¥¿¦b¬d¸ß¦øªA¾¹ -- ½Ðµy«Ý..." - IDS_BROWSE_BADCELL_TITLE "µLªkÃѧOªº Cell" - IDS_BROWSE_BADCELL_DESC "µLªk¦bºô¸ô¤W§ä¨ì±z©Ò¿é¤Jªº Cell ¦WºÙ¡C\n\n½Ð½T©w±z©Ò¿é¤Jªº Cell ¦WºÙ¬O§_¥¿½T¡C" - IDS_CREDS_NONE "¡]¨S¦³°O¸¹¡^" - IDS_CREDS_VALID "%2, ¹L´Á %3" - IDS_CREDS_EXPIRED "¡]°O¸¹¤w¹L´Á %3¡^" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "al_resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Application Base DLL""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +32513 ICON DISCARDABLE "Resource\\error.ico" +32515 ICON DISCARDABLE "Resource\\warning.ico" +IDI_SPIN1 ICON DISCARDABLE "resource\\spin1.ico" +IDI_SPIN2 ICON DISCARDABLE "resource\\spin2.ico" +IDI_SPIN3 ICON DISCARDABLE "resource\\spin3.ico" +IDI_SPIN4 ICON DISCARDABLE "resource\\spin4.ico" +IDI_SPIN5 ICON DISCARDABLE "resource\\spin5.ico" +IDI_SPIN6 ICON DISCARDABLE "resource\\spin6.ico" +IDI_SPIN7 ICON DISCARDABLE "resource\\spin7.ico" +IDI_SPIN8 ICON DISCARDABLE "resource\\spin8.ico" +IDI_SPINSTOP ICON DISCARDABLE "resource\\spinstop.ico" +IDI_BOSSERVICE ICON DISCARDABLE "resource\\bos.ico" +IDI_SERVER ICON DISCARDABLE "resource\\server.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "resource\\server1.ico" +IDI_SERVER_UNMON ICON DISCARDABLE "resource\\server_u.ico" +IDI_SERVICE ICON DISCARDABLE "resource\\service.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "resource\\service1.ico" +IDI_SERVICE_STOPPED ICON DISCARDABLE "resource\\service2.ico" +IDI_AGGREGATE ICON DISCARDABLE "resource\\aggreg.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "resource\\aggreg1.ico" +IDI_FILESET ICON DISCARDABLE "resource\\fileset.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "resource\\fileset1.ico" +IDI_FILESET_LOCKED ICON DISCARDABLE "resource\\locked.ico" +IDI_INITIAL_CONTAINER ICON DISCARDABLE "resource\\ic.ico" +IDI_INITIAL_OBJECT ICON DISCARDABLE "resource\\io.ico" +IDI_MULTIPLE ICON DISCARDABLE "resource\\multiple.ico" +IDI_ACL ICON DISCARDABLE "resource\\acl.ico" +IDI_CELL ICON DISCARDABLE "resource\\cell.ico" +IDI_SERVER_KEY ICON DISCARDABLE "resource\\key.ico" +IDI_USER ICON DISCARDABLE "resource\\user.ico" +IDI_GROUP ICON DISCARDABLE "resource\\group.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_APPLIB_ERROR DIALOG DISCARDABLE 0, 0, 277, 91 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "¿ù»~" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¥Ñ©ó²£¥ÍµLªkÃѧOªº¿ù»~¡A¦]¦¹ Windows µLªk§¹¦¨©Ò­n¨Dªº§@·~¡C", + IDC_ERROR_DESC,31,7,242,33 + LTEXT "¿ù»~¡G %1",IDC_ERROR_STATUS,31,49,241,16 + DEFPUSHBUTTON "½T©w",IDOK,114,73,50,14 + ICON 32513,IDC_STATIC,4,7,20,20 +END + +IDD_APPLIB_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 164 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "¿ï¨ú Cell" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "Cell (&C)¡G",IDC_STATIC,4,24,36,8 + LTEXT "¿ï¨ú±z­n§@·~ªº AFS Cell",IDC_STATIC,4,7,200,8 + COMBOBOX IDC_OPENCELL_CELL,41,22,174,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS ¨­¥÷(&I)¡G",IDC_STATIC,12,100,63,8 + EDITTEXT IDC_OPENCELL_ID,80,98,128,13,ES_AUTOHSCROLL + LTEXT "AFS ±K½X(&P)¡G",IDC_STATIC,12,116,55,8 + EDITTEXT IDC_OPENCELL_PASSWORD,80,114,128,13,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "½T©w",IDOK,57,146,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,111,146,50,14 + PUSHBUTTON "»¡©ú(&H)",9,165,146,50,14 + GROUPBOX "AFS Ų§O",IDC_STATIC,4,44,211,92 + LTEXT "¡]¬d¸ß...¡^",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "¦p­nºÞ²z Cell¡A±z¥²¶·­«·s¿é¤J AFS ±K½X¡G",IDC_STATIC,10, + 85,196,8 + LTEXT "±z¥Ø«e¦b©Ò¿ï¨ú¤§ Cell ¤¤ªº AFS °O¸¹¡G",IDC_STATIC,10,57, + 196,8 +END + +IDD_APPLIB_CREDENTIALS DIALOGEX 0, 0, 197, 140 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS Ų§O" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "AFS ¨­¥÷(&I)¡G",IDC_STATIC,8,75,65,8 + EDITTEXT IDC_CREDS_ID,74,73,114,14,ES_AUTOHSCROLL + LTEXT "AFS ±K½X(&P)¡G",IDC_STATIC,8,92,50,8 + EDITTEXT IDC_CREDS_PASSWORD,74,89,114,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "AFS Cell¡G",IDC_STATIC,4,7,52,8 + EDITTEXT IDC_CREDS_CELL,64,7,129,12,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE + LTEXT "¥Ø«eªº¨­¥÷¡G",IDC_STATIC,4,23,52,8 + EDITTEXT IDC_CREDS_CURRENTID,64,22,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + LTEXT "¦³®Ä´Á­­¡G",IDC_STATIC,4,39,52,8 + EDITTEXT IDC_CREDS_EXPDATE,64,38,129,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP, + WS_EX_STATICEDGE + DEFPUSHBUTTON "½T©w",IDOK,35,122,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,89,122,50,14 + PUSHBUTTON "»¡©ú(&H)",9,143,122,50,14 + GROUPBOX " ",IDC_STATIC,4,64,189,50 + CONTROL "¨ú±o¦¹ Cell ªº·s AFS °O¸¹(&O)",IDC_CREDS_LOGIN,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,5,54,138,10 +END + +IDD_APPLIB_BADCREDS DIALOG DISCARDABLE 0, 0, 335, 96 +STYLE DS_MODALFRAME | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "ĵ§i" +FONT 9, "·s²Ó©úÅé" +BEGIN + DEFPUSHBUTTON "¬O(&Y)",IDOK,173,78,50,14 + PUSHBUTTON "§_(&N)",IDCANCEL,227,78,50,14 + PUSHBUTTON "»¡©ú(&H)",9,281,78,50,14 + CONTROL "¤£­n¦AÅã¥Ü¦¹Äµ§i(&D)",IDC_BADCREDS_SHUTUP,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,31,80,120,10 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "¡]°õ¦æ´Á¶¡³]©w¤å¦r¡^",IDC_BADCREDS_DESC,31,7,300,64 +END + +IDD_APPLIB_COVER DIALOG DISCARDABLE 0, 0, 189, 135 +STYLE WS_CHILD | WS_BORDER +EXSTYLE WS_EX_CLIENTEDGE +FONT 9, "·s²Ó©úÅé" +BEGIN + GROUPBOX "",IDC_COVER_BORDER,7,4,175,123 + LTEXT "¡]»¡©ú¦p¤U©Ò¥Ü¡^",IDC_COVER_DESC,14,14,162,107 + PUSHBUTTON "­«·s¹Á¸Õ(&A)...",IDC_COVER_BUTTON,126,107,50,14 +END + +IDD_APPLIB_BROWSE_FILESET DIALOGEX 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | + WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "¿ï¨ú®eÅé" +FONT 9, "·s²Ó©úÅé" +BEGIN + RTEXT "®eÅé¡G",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "¿ï¨ú(&S)",IDOK,224,113,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,224,129,50,14 + RTEXT "¼fµø Cell (&C)¡G",IDC_STATIC,7,9,41,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE + CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY + DEFPUSHBUTTON "¡]§Ú¤w¸gÂ÷¶}¹ï¸Ü¤è¶ô¡A¦]¦¹¦b°õ¦æ®É¶¡¬OÁô«¬ªº¡^", + IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP +END + +IDD_APPLIB_BROWSE DIALOGEX 0, 0, 281, 150 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | + WS_SYSMENU +CAPTION "¡]³o­Ó¼ÐÃD¬O¦b°õ¦æ´Á¶¡¿ï¨ú¡^" +FONT 9, "·s²Ó©úÅé" +BEGIN + RTEXT "¡]°õ¦æ´Á¶¡¡^",IDC_BROWSE_TYPE,7,115,49,8,SS_NOTIFY + EDITTEXT IDC_BROWSE_NAMED,60,113,145,14,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "¿ï¨ú(&S)",IDC_BROWSE_SELECT,224,112,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,224,129,50,14 + RTEXT "¼fµø Cell (&C)¡G",IDC_STATIC,7,9,41,8,SS_NOTIFY + COMBOBOX IDC_BROWSE_CELL,56,7,153,91,CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + CONTROL "",IDC_BROWSE_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | + WS_BORDER | WS_TABSTOP,7,23,267,84,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "¡]§Ú¤w¸gÂ÷¶}¡A¦]¦¹§Ú¦b°õ¦æ®É¶¡¬OÁô«¬ªº¡^", + IDC_BROWSE_RESTART,43,137,177,13,NOT WS_TABSTOP + CTEXT "",IDC_BROWSE_STATUS,56,133,153,8,SS_NOTIFY +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_APPLIB_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 87 + END + + IDD_APPLIB_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 7 + BOTTOMMARGIN, 160 + END + + IDD_APPLIB_CREDENTIALS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 193 + TOPMARGIN, 7 + BOTTOMMARGIN, 136 + END + + IDD_APPLIB_BADCREDS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 331 + TOPMARGIN, 7 + BOTTOMMARGIN, 92 + END + + IDD_APPLIB_COVER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 182 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END + + IDD_APPLIB_BROWSE_FILESET, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END + + IDD_APPLIB_BROWSE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + HORZGUIDE, 23 + HORZGUIDE, 107 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_LOCAL_USER BITMAP DISCARDABLE "resource\\local_user.bmp" +IDB_LOCAL_GROUP BITMAP DISCARDABLE "resource\\local_group.bmp" +IDB_FOREIGN_USER BITMAP DISCARDABLE "resource\\foreign_user.bmp" +IDB_FOREIGN_GROUP BITMAP DISCARDABLE "resource\\foreign_group.bmp" +IDB_ANY_OTHER BITMAP DISCARDABLE "resource\\any_other.bmp" +IDB_FOREIGN_OTHER BITMAP DISCARDABLE "resource\\foreign_other.bmp" +IDB_LOCAL_OTHER BITMAP DISCARDABLE "resource\\local_other.bmp" +IDB_MASK_OBJ BITMAP DISCARDABLE "resource\\mask_obj.bmp" +IDB_UNAUTHENTICATED BITMAP DISCARDABLE "resource\\unauthenticated.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADCREDS_DESC_GENERAL + "±z¦b %1 Cell ¤¤¨Ã¨S¦³§@¬°ºÞ²zªÌªº AFS °O¸¹¡C\n\n%2\n\n%3" + IDS_BADCREDS_DESC_EXPIRED "±z¦b %1 Cell ¤¤ªº°O¸¹¤w¸g¹L´Á¡C\n\n%2\n\n%3" + IDS_BADCREDS_DESC_BADCHOICE + "±z¥¼¿ï¾Ü¥HºÞ²zªÌ¨­¥÷µn¤J %1 Cell¡C\n\n%2\n\n%3" + IDS_BADCREDS_DESC2 "°£«D±z¥HºÞ²zªÌªº¨­¥÷µn¤J¡A§_«h±zªºÅv­­±N¤£¨¬¥H¦b %1 Cell ¤¤§@·~¡C" + IDS_BADCREDS_DESC3 "±z²{¦b­n¨ú±o·sªº AFS °O¸¹¶Ü¡H" + IDS_BADCREDS_DESC3_ADM "±z­n¥HºÞ²zªÌªº¨­¥÷µn¤J¶Ü¡H" + IDS_BADCREDS_DESC_DESTROYED "±z %1 Cell ¤¤ªº°O¸¹¤£¦A¦³®Ä¡C\n\n%2\n\n%3" + IDS_ERROR_BAD_CREDENTIALS + "µLªkÃѧO±z©Ò¿é¤Jªº AFS ¨­¥÷¡A©Î¬O±z©Ò«ü©wªº±K½X¦³»~¡C" + IDS_BROWSE_WAITING "¥¿¦b¬d¸ß¦øªA¾¹ -- ½Ðµy«Ý..." + IDS_BROWSE_BADCELL_TITLE "µLªkÃѧOªº Cell" + IDS_BROWSE_BADCELL_DESC "µLªk¦bºô¸ô¤W§ä¨ì±z©Ò¿é¤Jªº Cell ¦WºÙ¡C\n\n½Ð½T©w±z©Ò¿é¤Jªº Cell ¦WºÙ¬O§_¥¿½T¡C" + IDS_CREDS_NONE "¡]¨S¦³°O¸¹¡^" + IDS_CREDS_VALID "%2, ¹L´Á %3" + IDS_CREDS_EXPIRED "¡]°O¸¹¤w¹L´Á %3¡^" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afsapplib/test/NTMakefile b/src/WINNT/afsapplib/test/NTMakefile index 63bd77fbf..81be847db 100644 --- a/src/WINNT/afsapplib/test/NTMakefile +++ b/src/WINNT/afsapplib/test/NTMakefile @@ -16,6 +16,7 @@ AFSDEV_AUXRCDEFINES = $(AFSDEV_AUXRCDEFINES) -I$(DESTDIR)\include\winnt # include the primary makefile +RELDIR=WINNT\afsapplib\test !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) ############################################################################ @@ -26,8 +27,8 @@ AFSDEV_AUXRCDEFINES = $(AFSDEV_AUXRCDEFINES) -I$(DESTDIR)\include\winnt EXEFILE = $(DESTDIR)\root.server\usr\afs\bin\WizTest.exe EXEOBJS = \ - wiztest.res \ - wiztest.obj + $(OUT)\wiztest.res \ + $(OUT)\wiztest.obj EXELIBS = \ $(DESTDIR)\lib\afs\TaAfsAppLib.lib \ @@ -41,3 +42,6 @@ $(EXEFILE) : $(EXEOBJS) $(EXELIBS) test : $(EXEFILE) + +mkdir: + diff --git a/src/WINNT/afsclass/NTMakefile b/src/WINNT/afsclass/NTMakefile index 52b578d2e..ea60db292 100644 --- a/src/WINNT/afsclass/NTMakefile +++ b/src/WINNT/afsclass/NTMakefile @@ -11,25 +11,26 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -WX # include the primary makefile +RELDIR=WINNT\afsclass !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) ############################################################################ LIBOBJS = \ - c_debug.obj \ - c_ident.obj \ - c_identlist.obj \ - c_cell.obj \ - c_svr.obj \ - c_svc.obj \ - c_agg.obj \ - c_set.obj \ - c_usr.obj \ - c_grp.obj \ - c_notify.obj \ - afsclassfn.obj \ - internal.obj \ - worker.obj + $(OUT)\c_debug.obj \ + $(OUT)\c_ident.obj \ + $(OUT)\c_identlist.obj \ + $(OUT)\c_cell.obj \ + $(OUT)\c_svr.obj \ + $(OUT)\c_svc.obj \ + $(OUT)\c_agg.obj \ + $(OUT)\c_set.obj \ + $(OUT)\c_usr.obj \ + $(OUT)\c_grp.obj \ + $(OUT)\c_notify.obj \ + $(OUT)\afsclassfn.obj \ + $(OUT)\internal.obj \ + $(OUT)\worker.obj LIBINCLUDES = \ $(DESTDIR)\include\winnt\afsclass.h \ @@ -63,3 +64,6 @@ $(LIBFILE): $(LIBOBJS) clean:: + +mkdir: + diff --git a/src/WINNT/afsclass/c_grp.cpp b/src/WINNT/afsclass/c_grp.cpp index cddcd9574..44a04b141 100644 --- a/src/WINNT/afsclass/c_grp.cpp +++ b/src/WINNT/afsclass/c_grp.cpp @@ -41,6 +41,7 @@ PTSGROUP::PTSGROUP (LPCELL lpCellParent, LPTSTR pszGroup) m_mszMembers = NULL; m_mszMemberOf = NULL; m_mszOwnerOf = NULL; + memset(&m_gs, 0, sizeof(m_gs)); } diff --git a/src/WINNT/afsclass/c_set.cpp b/src/WINNT/afsclass/c_set.cpp index c4cb5d7e1..79520b989 100644 --- a/src/WINNT/afsclass/c_set.cpp +++ b/src/WINNT/afsclass/c_set.cpp @@ -408,21 +408,21 @@ void FILESET::SetStatusFromVOS (PVOID lp) m_fs.nFiles = pEntry->fileCount; m_fs.ckQuota = pEntry->maxQuota; m_fs.ckUsed = pEntry->currentSize; - - switch (pEntry->type) - { - case VOS_BACKUP_VOLUME: - m_fs.Type = ftCLONE; - m_fs.idClone = pEntry->id; - break; - case VOS_READ_ONLY_VOLUME: - m_fs.Type = ftREPLICA; - m_fs.idReplica = pEntry->id; - break; - case VOS_READ_WRITE_VOLUME: - m_fs.Type = ftREADWRITE; - m_fs.idReadWrite = pEntry->id; - break; + + switch (pEntry->type) + { + case VOS_BACKUP_VOLUME: + m_fs.Type = ftCLONE; + m_fs.idClone = pEntry->id; + break; + case VOS_READ_ONLY_VOLUME: + m_fs.Type = ftREPLICA; + m_fs.idReplica = pEntry->id; + break; + case VOS_READ_WRITE_VOLUME: + m_fs.Type = ftREADWRITE; + m_fs.idReadWrite = pEntry->id; + break; } m_fs.State &= fsMASK_VLDB; diff --git a/src/WINNT/afsclass/c_svr.cpp b/src/WINNT/afsclass/c_svr.cpp index b1269cc94..01ef4b633 100644 --- a/src/WINNT/afsclass/c_svr.cpp +++ b/src/WINNT/afsclass/c_svr.cpp @@ -89,6 +89,7 @@ SERVER::SERVER (LPCELL lpCellParent, LPTSTR pszName) m_fDelete = FALSE; m_lastStatus = 0; + m_fVLDBOutOfDate = FALSE; /* FIXME: added because it was missing */ m_fStatusOutOfDate = TRUE; memset (&m_ss, 0x00, sizeof(SERVERSTATUS)); } diff --git a/src/WINNT/afsclass/c_usr.cpp b/src/WINNT/afsclass/c_usr.cpp index 66dd2bdeb..dafe17424 100644 --- a/src/WINNT/afsclass/c_usr.cpp +++ b/src/WINNT/afsclass/c_usr.cpp @@ -39,6 +39,7 @@ USER::USER (LPCELL lpCellParent, LPTSTR pszPrincipal, LPTSTR pszInstance) m_fStatusOutOfDate = TRUE; m_mszOwnerOf = NULL; m_mszMemberOf = NULL; + memset(&m_us, 0, sizeof(m_us)); } @@ -190,7 +191,7 @@ BOOL USER::RefreshStatus (BOOL fNotify, ULONG *pStatus) CopyAnsiToString (szLastModPrincipal, wpGetKas.wpKasPrincipalGet.Data.lastModPrincipal.principal); CopyAnsiToString (szLastModInstance, wpGetKas.wpKasPrincipalGet.Data.lastModPrincipal.instance); - m_us.KASINFO.fIsAdmin = (wpGetKas.wpKasPrincipalGet.Data.adminSetting == ADMIN) ? TRUE : FALSE; + m_us.KASINFO.fIsAdmin = (wpGetKas.wpKasPrincipalGet.Data.adminSetting == KAS_ADMIN) ? TRUE : FALSE; m_us.KASINFO.fCanGetTickets = (wpGetKas.wpKasPrincipalGet.Data.tgsSetting == TGS) ? TRUE : FALSE; m_us.KASINFO.fEncrypt = (wpGetKas.wpKasPrincipalGet.Data.encSetting == ENCRYPT) ? TRUE : FALSE; m_us.KASINFO.fCanChangePassword = (wpGetKas.wpKasPrincipalGet.Data.cpwSetting == CHANGE_PASSWORD) ? TRUE : FALSE; diff --git a/src/WINNT/afsclass/worker.cpp b/src/WINNT/afsclass/worker.cpp index 7ab8a6c07..8ba157e23 100644 --- a/src/WINNT/afsclass/worker.cpp +++ b/src/WINNT/afsclass/worker.cpp @@ -373,13 +373,9 @@ static lpUtilDatabaseServerGetDone_t lpUtilDatabaseServerGetDone = NULL; * */ -BOOL Worker_StartOneThread (BOOL fActivate, ULONG *pStatus = NULL); - BOOL Worker_LoadLibraries (ULONG *pStatus); void Worker_FreeLibraries (void); -DWORD _stdcall Worker_ThreadProc (LPARAM lp); - DWORD Worker_PerformTask (WORKERTASK wtask, LPWORKERPACKET lpwp); diff --git a/src/WINNT/afsd/NTMakefile b/src/WINNT/afsd/NTMakefile index edf83cd84..a99b91f14 100644 --- a/src/WINNT/afsd/NTMakefile +++ b/src/WINNT/afsd/NTMakefile @@ -5,7 +5,9 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) /D"_AFXDLL" -I..\kfw\inc\loadfuncs -I..\kfw\inc\krb5 -I..\kfw\inc\leash AFSDEV_NETGUI = 1 +RELDIR=WINNT\afsd !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version @@ -16,6 +18,8 @@ EXEDIR = $(DESTDIR)\root.client\usr\vice\etc INCFILEDIR = $(DESTDIR)\include\afs # header file install directory +# afsdicon and below added for WINNT\extra support + INCFILES =\ $(INCFILEDIR)\afsd.h \ $(INCFILEDIR)\cm.h \ @@ -27,6 +31,7 @@ INCFILES =\ $(INCFILEDIR)\cm_scache.h \ $(INCFILEDIR)\cm_server.h \ $(INCFILEDIR)\cm_user.h \ + $(INCFILEDIR)\cm_dns.h \ $(INCFILEDIR)\cm_utils.h \ $(INCFILEDIR)\fs_utils.h \ $(INCFILEDIR)\krb.h \ @@ -38,51 +43,98 @@ INCFILES =\ $(INCFILEDIR)\smb_ioctl.h \ $(INCFILEDIR)\afsmsg95.h \ $(INCFILEDIR)\afsrpc.h \ - $(INCFILEDIR)\cm_dns.h \ - $(INCFILEDIR)\cm_dns_private.h +!IFDEF OSICRASH + $(INCFILEDIR)\afsdcrash.h \ +!ENDIF + $(INCFILEDIR)\cm_dns_private.h \ + $(INCFILEDIR)\lanahelper.h \ + $(INCFILEDIR)\afsdicon.h \ + $(INCFILEDIR)\cm_callback.h \ + $(INCFILEDIR)\cm_aclent.h \ + $(INCFILEDIR)\cm_volume.h \ + $(INCFILEDIR)\cm_dcache.h \ + $(INCFILEDIR)\cm_access.h \ + $(INCFILEDIR)\cm_vnodeops.h \ + $(INCFILEDIR)\cm_dir.h \ + $(INCFILEDIR)\cm_utils.h \ + $(INCFILEDIR)\cm_daemon.h \ + $(INCFILEDIR)\cm_ioctl.h \ + $(INCFILEDIR)\cm_dnlc.h \ + $(INCFILEDIR)\cm_buf.h \ + $(INCFILEDIR)\cm_freelance.h \ + $(INCFILEDIR)\afsd_eventlog.h \ + $(INCFILEDIR)\afsd_eventmessages.h \ + $(INCFILEDIR)\afskfw.h IDLFILES =\ - afsrpc.h afsrpc_c.obj + afsrpc.h $(OUT)\afsrpc_c.obj + +CONFOBJS=$(OUT)\cm_config.obj \ + $(OUT)\cm_dns.obj + +$(CONFOBJS): + +RXOBJS = $(OUT)\xdr_int32.obj $(OUT)\xdr_int64.obj -CONFOBJS=cm_config.obj \ - cm_dns.obj +$(RXOBJS): + +RX= ..\..\rx + +$(RXOBJS): $(RX)\$$(@B).c + $(C2OBJ) -I$(RX) $** + +$(IDLFILES):afsrpc.idl + midl $(MIDL_FLAGS) /no_robust $(AFSDEV_AUXMIDLFLAGS) /app_config $? AFSDOBJS=\ - afsd_init.obj \ - cm_cell.obj \ - cm_server.obj \ - cm_volume.obj \ - cm_conn.obj \ - cm_user.obj \ - cm_buf.obj \ - cm_scache.obj \ - cm_dcache.obj \ - cm_access.obj \ - cm_callback.obj \ - cm_vnodeops.obj \ - cm_dir.obj \ - cm_utils.obj \ - largeintdotnet.obj \ - smb.obj \ - smb3.obj \ - smb_ioctl.obj \ - cm_ioctl.obj \ - cm_daemon.obj \ - cm_aclent.obj \ - cm_dnlc.obj \ - cm_rpc.obj \ - afsrpc_s.obj \ - cm_freelance.obj - -cm_conn.obj: cm_conn.c - $(C2OBJ) -DAFS_PTHREAD_ENV $** - -FSOBJS=fs.obj fs_utils.obj - -SLOBJS=symlink.obj fs_utils.obj + $(OUT)\afsd_init.obj \ + $(OUT)\cm_cell.obj \ + $(OUT)\cm_server.obj \ + $(OUT)\cm_volume.obj \ + $(OUT)\cm_conn.obj \ + $(OUT)\cm_user.obj \ + $(OUT)\cm_buf.obj \ + $(OUT)\cm_scache.obj \ + $(OUT)\cm_dcache.obj \ + $(OUT)\cm_access.obj \ + $(OUT)\cm_callback.obj \ + $(OUT)\cm_vnodeops.obj \ + $(OUT)\cm_dir.obj \ + $(OUT)\cm_utils.obj \ + $(OUT)\largeintdotnet.obj \ + $(OUT)\smb.obj \ + $(OUT)\smb3.obj \ + $(OUT)\smb_ioctl.obj \ + $(OUT)\cm_ioctl.obj \ + $(OUT)\cm_daemon.obj \ + $(OUT)\cm_aclent.obj \ + $(OUT)\cm_dnlc.obj \ + $(OUT)\cm_rpc.obj \ + $(OUT)\afsrpc_s.obj \ +!IFDEF OSICRASH + $(OUT)\afsdcrash.obj \ +!ENDIF + $(OUT)\cm_freelance.obj \ + $(OUT)\afsd_eventlog.obj \ + $(OUT)\afsd_flushvol.obj + +$(AFSDOBJS): + +$(OUT)\cm_conn.obj: cm_conn.c + $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $** + +FSOBJS=$(OUT)\fs.obj $(OUT)\fs_utils.obj + +SLOBJS=$(OUT)\symlink.obj $(OUT)\fs_utils.obj ILIBDIR = $(DESTDIR)\lib +# +# Rules for message compiler info for logging events +# +$(INCFILEDIR)\afsd_eventmessages.h: afsd_eventmessages.mc + mc afsd_eventmessages.mc + ############################################################################ # # Flags for linking LOGON DLL'S @@ -90,6 +142,7 @@ ILIBDIR = $(DESTDIR)\lib LOGONLINKFLAGS = -entry:DllEntryPoint + ############################################################################ # # IDL COMPILATION @@ -99,40 +152,73 @@ MIDL_FLAGS=/app_config \ /Zp4 \ /cpp_cmd $(cc) \ /cpp_opt "-E" \ + /no_robust \ /nologo .SUFFIXES: .h .idl .idl.h: - midl $(MIDL_FLAGS) $< + midl $(MIDL_FLAGS) $(AFSDEV_AUXMIDLFLAGS) $< ############################################################################ # libafsconf.dll CONF_DLLFILE = $(DESTDIR)\root.client\usr\vice\etc\libafsconf.dll +CONF_DLLLIBS = \ + $(DESTDIR)\lib\afs\afsutil.lib \ + $(DESTDIR)\lib\afs\afsreg.lib -$(CONF_DLLFILE): $(CONFOBJS) libafsconf.res - $(DLLGUILINK) -def:libafsconf.def +$(CONF_DLLFILE): $(CONFOBJS) $(OUT)\libafsconf.res $(CONF_DLLLIBS) + $(DLLGUILINK) -def:libafsconf.def dnsapi.lib $(DLLPREP) $(COPY) $*.lib $(ILIBDIR) $(DEL) $*.lib $*.exp +############################################################################ +# lanahelper.lib + +LANAHELPERLIB = $(DESTDIR)\lib\lanahelper.lib + +LANAHELPERLIB_OBJS =\ + $(OUT)\lanahelper.obj + +$(LANAHELPERLIB_OBJS): + +$(LANAHELPERLIB): $(LANAHELPERLIB_OBJS) + $(LIBARCH) netapi32.lib + +############################################################################ +# afskfw.lib + +AFSKFWLIB = $(DESTDIR)\lib\afskfw.lib + +AFSKFWLIB_OBJS =\ + $(OUT)\afskfw.obj + +$(AFSKFWLIB_OBJS): + +$(AFSKFWLIB): $(AFSKFWLIB_OBJS) + $(LIBARCH) + ############################################################################ # afslogon.dll LOGON_DLLFILE = $(DESTDIR)\root.client\usr\vice\etc\afslogon.dll LOGON_DLLOBJS =\ - afslogon.obj \ - afslogon.res + $(OUT)\afslogon.obj \ + $(OUT)\afslogon.res LOGON_DLLLIBS =\ $(DESTDIR)\lib\afsauthent.lib \ - $(DESTDIR)\lib\libafsconf.lib + $(DESTDIR)\lib\libafsconf.lib \ + $(DESTDIR)\lib\afsrxkad.lib \ + $(DESTDIR)\lib\afsdes.lib \ + $(AFSKFWLIB) -$(LOGON_DLLFILE): $(LOGON_DLLOBJS) - $(DLLGUILINK) $(LOGONLINKFLAGS) -def:afslogon.def $(LOGON_DLLLIBS) +$(LOGON_DLLFILE): $(LOGON_DLLOBJS) $(LOGON_DLLLIBS) + $(DLLGUILINK) $(LOGONLINKFLAGS) -def:afslogon.def dnsapi.lib secur32.lib $(DLLPREP) $(COPY) $*.lib $(DESTDIR)\lib $(DEL) $*.lib $*.exp @@ -143,15 +229,15 @@ $(LOGON_DLLFILE): $(LOGON_DLLOBJS) LOG95_DLLFILE = $(DESTDIR)\root.client\usr\vice\etc\afslog95.dll LOG95_DLLOBJS =\ - afslog95.obj \ - afslog95.res + $(OUT)\afslog95.obj \ + $(OUT)\afslog95.res LOG95_DLLLIBS =\ $(DESTDIR)\lib\afsauthent.lib \ $(DESTDIR)\lib\libafsconf.lib -$(LOG95_DLLFILE): $(LOG95_DLLOBJS) - $(DLLGUILINK) $(LOGONLINKFLAGS) -def:afslog95.def $(LOG95_DLLLIBS) +$(LOG95_DLLFILE): $(LOG95_DLLOBJS) $(LOG95_DLLLIBS) + $(DLLGUILINK) $(LOGONLINKFLAGS) -def:afslog95.def dnsapi.lib $(DLLPREP) $(COPY) $*.lib $(DESTDIR)\lib $(DEL) $*.lib $*.exp @@ -159,13 +245,13 @@ $(LOG95_DLLFILE): $(LOG95_DLLOBJS) ############################################################################ # Install target; primary makefile target -install_objs: cm_dns.obj cm_config.obj - $(COPY) cm_dns.obj $(DESTDIR)\lib - $(COPY) cm_config.obj $(DESTDIR)\lib +install_objs: $(OUT)\cm_dns.obj $(OUT)\cm_config.obj $(LANAHELPERLIB) + $(COPY) $(OUT)\cm_dns.obj $(DESTDIR)\lib + $(COPY) $(OUT)\cm_config.obj $(DESTDIR)\lib install_headers: $(IDLFILES) $(INCFILES) -install: install_headers $(CONF_DLLFILE) \ +install: install_headers install_objs $(CONF_DLLFILE) \ $(EXEDIR)\klog.exe \ $(EXEDIR)\tokens.exe \ $(EXEDIR)\unlog.exe $(EXEDIR)\afsd.exe $(EXEDIR)\afsd_service.exe \ @@ -215,60 +301,65 @@ EXELIBS = \ $(DESTDIR)\lib\libosi.lib \ $(DESTDIR)\lib\libafsconf.lib - # klog.exe -$(EXEDIR)\klog.exe: cklog.obj klog.res - $(EXECONLINK) $(EXELIBS) +$(EXEDIR)\klog.exe: $(OUT)\cklog.obj $(OUT)\klog.res $(EXELIBS) + $(EXECONLINK) dnsapi.lib $(EXEPREP) # tokens.exe -$(EXEDIR)\tokens.exe: ctokens.obj tokens.res - $(EXECONLINK) $(EXELIBS) +$(EXEDIR)\tokens.exe: $(OUT)\ctokens.obj $(OUT)\tokens.res $(EXELIBS) + $(EXECONLINK) dnsapi.lib $(EXEPREP) # unlog.exe -$(EXEDIR)\unlog.exe: cunlog.obj unlog.res - $(EXECONLINK) $(EXELIBS) +$(EXEDIR)\unlog.exe: $(OUT)\cunlog.obj $(OUT)\unlog.res $(EXELIBS) + $(EXECONLINK) dnsapi.lib $(EXEPREP) # afsd.exe AFSD_EXEFILE = $(EXEDIR)\afsd.exe -AFSD_EXELIBS =\ +AFSD_SDKLIBS =\ largeint.lib \ netapi32.lib \ - mpr.lib \ + mpr.lib \ + dnsapi.lib \ + rpcrt4.lib \ + user32.lib \ + Dbghelp.lib + +AFSD_EXELIBS =\ $(DESTDIR)\lib\libosi.lib \ $(DESTDIR)\lib\afsrpc.lib \ + $(DESTDIR)\lib\afsrx.lib \ $(DESTDIR)\lib\afsauthent.lib \ $(DESTDIR)\lib\afs\mtafsvldb.lib \ $(DESTDIR)\lib\afs\mtafsint.lib \ $(DESTDIR)\lib\libafsconf.lib \ $(DESTDIR)\lib\afs\afsreg.lib \ - rpcrt4.lib \ - user32.lib + $(LANAHELPERLIB) -$(AFSD_EXEFILE): afsd.obj $(AFSDOBJS) afsd.res - $(EXEGUILINK) $(AFSD_EXELIBS) +$(AFSD_EXEFILE): $(OUT)\afsd.obj $(AFSDOBJS) $(OUT)\afsd.res $(RXOBJS) $(AFSD_EXELIBS) + $(EXEGUILINK) $(AFSD_SDKLIBS) $(EXEPREP) # afsd_service.exe -$(EXEDIR)\afsd_service.exe: afsd_service.obj $(AFSDOBJS) afsd_service.res - $(EXECONLINK) $(AFSD_EXELIBS) +$(EXEDIR)\afsd_service.exe: $(OUT)\afsd_service.obj $(AFSDOBJS) $(OUT)\afsd_service.res $(RXOBJS) $(AFSD_EXELIBS) + $(EXECONLINK) $(AFSD_SDKLIBS) /MAP $(EXEPREP) # fs.exe -$(EXEDIR)\fs.exe: $(FSOBJS) fs.res - $(EXECONLINK) $(EXELIBS) +$(EXEDIR)\fs.exe: $(FSOBJS) $(OUT)\fs.res $(EXELIBS) + $(EXECONLINK) dnsapi.lib $(EXEPREP) # symlink.exe -$(EXEDIR)\symlink.exe: $(SLOBJS) symlink.res - $(EXECONLINK) $(EXELIBS) +$(EXEDIR)\symlink.exe: $(SLOBJS) $(OUT)\symlink.res $(EXELIBS) + $(EXECONLINK) dnsapi.lib $(EXEPREP) # afsshare.exe -$(EXEDIR)\afsshare.exe: afsshare.obj afsshare.res +$(EXEDIR)\afsshare.exe: $(OUT)\afsshare.obj $(OUT)\afsshare.res $(EXECONLINK) $(EXEPREP) @@ -282,26 +373,30 @@ $(EXEDIR)\afsshare.exe: afsshare.obj afsshare.res KAUTH = ..\..\kauth KPASSWD_OBJS =\ - kpasswd.obj \ - kkids.obj \ - kautils.obj \ - $(KAUTH)\kpasswd.res + $(OUT)\kpasswd.obj \ + $(OUT)\kkids.obj \ + $(OUT)\kautils.obj \ + $(OUT)\$(KAUTH)\kpasswd.res KPASSWD_LIBS =\ $(DESTDIR)\lib\afsauthent.lib \ $(DESTDIR)\lib\afsrpc.lib \ + $(DESTDIR)\lib\afsrx.lib \ $(DESTDIR)\lib\afs\afscmd.lib \ $(DESTDIR)\lib\afsdes.lib \ $(DESTDIR)\lib\afs\afsutil.lib -kpasswd.obj: $(KAUTH)/kpasswd.c - $(C2OBJ) -DAFS_PTHREAD_ENV $** +$(OUT)\kpasswd.obj: $(KAUTH)/kpasswd.c + $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $** -kkids.obj: $(KAUTH)/kkids.c - $(C2OBJ) -DAFS_PTHREAD_ENV $** +$(OUT)\kkids.obj: $(KAUTH)/kkids.c + $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $** -kautils.obj: $(KAUTH)/kautils.c - $(C2OBJ) -DAFS_PTHREAD_ENV $** +$(OUT)\kautils.obj: $(KAUTH)/kautils.c + $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $** + +$(OUT)\kpasswd.res: $(KAUTH)\kpasswd.rc + $(RC) /Fo$@ $** $(DESTDIR)\bin\kpasswd.exe: $(KPASSWD_OBJS) $(KPASSWD_LIBS) $(DEL) $(DESTDIR)\bin\kpasswd.exe @@ -312,28 +407,36 @@ $(DESTDIR)\bin\kpasswd.exe: $(KPASSWD_OBJS) $(KPASSWD_LIBS) ############################################################################ # generate versioninfo resources -afsshare.res: afsshare.rc AFS_component_version_number.h +$(OUT)\afsshare.res: afsshare.rc AFS_component_version_number.h + +$(OUT)\fs.res: fs.rc AFS_component_version_number.h -fs.res: fs.rc AFS_component_version_number.h +$(OUT)\symlink.res: symlink.rc AFS_component_version_number.h -symlink.res: symlink.rc AFS_component_version_number.h +$(OUT)\klog.res: klog.rc AFS_component_version_number.h -klog.res: klog.rc AFS_component_version_number.h +$(OUT)\tokens.res: tokens.rc AFS_component_version_number.h -tokens.res: tokens.rc AFS_component_version_number.h +$(OUT)\unlog.res: unlog.rc AFS_component_version_number.h -unlog.res: unlog.rc AFS_component_version_number.h +afsd_eventmessages.rc: afsd_eventmessages.h -afsd_service.res: afsd_service.rc AFS_component_version_number.h +$(OUT)\afsd_service.res: afsd_service.rc afsd_eventmessages.rc AFS_component_version_number.h -afslogon.res: afslogon.rc AFS_component_version_number.h +$(OUT)\afslogon.res: afslogon.rc AFS_component_version_number.h -afslog95.res: afslog95.rc AFS_component_version_number.h +$(OUT)\afslog95.res: afslog95.rc AFS_component_version_number.h -libafsconf.res: libafsconf.rc AFS_component_version_number.h +$(OUT)\libafsconf.res: libafsconf.rc AFS_component_version_number.h +############################################################################ clean:: - $(DEL) *.res + $(DEL) $(OUT)\*.res $(DEL) afsrpc.h $(DEL) afsrpc_?.* - $(DEL) $(EXELIBS) + $(DEL) afsd_eventmessages.h + $(DEL) $(CONF_DLLFILE) + $(DEL) $(LOGON_DLLFILE) + $(DEL) $(LOG95_DLLFILE) + +mkdir: diff --git a/src/WINNT/afsd/afsd.c b/src/WINNT/afsd/afsd.c index cbcea8453..8e29f678e 100644 --- a/src/WINNT/afsd/afsd.c +++ b/src/WINNT/afsd/afsd.c @@ -21,6 +21,9 @@ #include #include +#ifdef _DEBUG +#include +#endif HANDLE main_inst; HWND main_wnd; @@ -30,6 +33,9 @@ osi_log_t *afsd_logp; extern int traceOnPanic; +extern void afsd_DbgBreakAllocInit(); +extern void afsd_DbgBreakAdd(DWORD requestNumber); + /* * Notifier function for use by osi_panic */ @@ -69,7 +75,23 @@ int WINAPI WinMain( { MSG msg; - if (!InitClass(hInstance)) + afsd_SetUnhandledExceptionFilter(); + +#ifdef _DEBUG + afsd_DbgBreakAllocInit(); + _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF /* | _CRTDBG_CHECK_ALWAYS_DF */ | _CRTDBG_CHECK_CRT_DF | _CRTDBG_DELAY_FREE_MEM_DF ); + if (lpCmdLine) + { + char *allocRequest = strtok(lpCmdLine, " \t"); + while (allocRequest) + { + afsd_DbgBreakAdd(atoi(allocRequest)); + allocRequest = strtok(NULL, " \t"); + } + } +#endif + + if (!InitClass(hInstance)) return (FALSE); if (!InitInstance(hInstance, nCmdShow)) @@ -111,9 +133,8 @@ BOOL InitInstance( HWND hWnd; HDC hDC; TEXTMETRIC textmetric; - RECT rect; INT nLineHeight; - long code; + long code; char *reason; /* remember this, since it is a useful thing for some of the Windows @@ -138,7 +159,6 @@ BOOL InitInstance( if (!hWnd) return (FALSE); - /* lookup text dimensions */ hDC = GetDC(hWnd); GetTextMetrics(hDC, &textmetric); diff --git a/src/WINNT/afsd/afsd_eventlog.c b/src/WINNT/afsd/afsd_eventlog.c new file mode 100644 index 000000000..10ecffd02 --- /dev/null +++ b/src/WINNT/afsd/afsd_eventlog.c @@ -0,0 +1,222 @@ +//////////////////////////////////////////////////////////////////// +// +// +// E V E N T L O G G I N G F U N C T I O N S +// +// +//////////////////////////////////////////////////////////////////// + + +#include +#include +#include +#include "afsd_eventlog.h" + +#define SZSERVICEPATH "System\\CurrentControlSet\\Services\\" +#define SZSERVICENAME "TransarcAFSDaemon" + +static CHAR szKeyName[] = "System\\CurrentControlSet\\Services\\EventLog\\Application\\TransarcAFSDaemon"; + +static BOOL GetServicePath(LPTSTR lpPathBuf, PDWORD pdwPathBufSize); +static BOOL AddEventSource(void); + +static BOOL +GetServicePath(LPTSTR lpPathBuf, PDWORD pdwPathBufSize) +{ + HKEY hKey = NULL; + UCHAR szBuf[MAX_PATH]; + DWORD dwData = 0; + BOOL bRet = TRUE; + + do { + // Prepare path in Registry + memset(szBuf, '\0', MAX_PATH); + strcpy(szBuf, SZSERVICEPATH); + strcat(szBuf, "TransarcAFSDaemon"); + + // Open key + if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, szBuf, 0, KEY_QUERY_VALUE, &hKey ) ) + { + bRet = FALSE; + break; + } + + // prepare user's buffer and read into it + dwData = *pdwPathBufSize; + memset(lpPathBuf, '\0', dwData); + if ( RegQueryValueEx( + hKey, // handle to key + "ImagePath", // value name + NULL, // reserved + NULL, // type buffer + (LPBYTE) lpPathBuf, // data buffer + &dwData)) // size of data buffer + { + bRet = FALSE; + break; + } + + *pdwPathBufSize = dwData; + + } while (0); + + if (hKey != NULL) + RegCloseKey(hKey); + + return bRet; +} + +// +// Ensure name for message file is in proper location in Registry. +// +static BOOL +AddEventSource() +{ + HKEY hKey = NULL; + UCHAR szBuf[MAX_PATH]; + DWORD dwData, dwDisposition; + BOOL bRet = TRUE; + + do { + // Let's see if key already exists as a subkey under the + // Application key in the EventLog registry key. If not, + // create it. + if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, szKeyName, 0, + KEY_QUERY_VALUE, &hKey ) ) + { + // nope - create it + if ( RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, + NULL, REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, NULL, &hKey, + &dwDisposition)) + { + bRet = FALSE; + break; + } + + // Set the name of the message file + // Get "ImagePath" from TransarcAFSDaemon service + memset(szBuf, '\0', MAX_PATH); + dwData = MAX_PATH; + GetServicePath(szBuf, &dwData); + + // Add the name to the EventMessageFile subkey. + if ( RegSetValueEx( + hKey, // subkey handle + "EventMessageFile", // value name + 0, // must be zero + REG_EXPAND_SZ, // value type + (LPBYTE) szBuf, // pointer to value data + strlen(szBuf) + 1)) // length of value data + { + bRet = FALSE; + break; + } + + // Set the supported event types in the TypesSupported subkey. + dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | + EVENTLOG_INFORMATION_TYPE; + + if ( RegSetValueEx( + hKey, // subkey handle + "TypesSupported", // value name + 0, // must be zero + REG_DWORD, // value type + (LPBYTE) &dwData, // pointer to value data + sizeof(DWORD))) // length of value data + { + bRet = FALSE; + break; + } + } + + else + { + // key was opened - read it + memset(szBuf, '\0', MAX_PATH); + dwData = MAX_PATH; + if ( RegQueryValueEx( + hKey, // handle to key + "EventMessageFile", // value name + NULL, // reserved + NULL, // type buffer + (LPBYTE) szBuf, // data buffer + &dwData)) // size of data buffer + { + bRet = FALSE; + break; + } + } + + } while (0); + + if (hKey != NULL) + RegCloseKey(hKey); + + return bRet; +} + +// Log an event with a formatted system message as the (only) substitution +// string, from the given message ID. +VOID +LogEventMessage(WORD wEventType, DWORD dwEventID, DWORD dwMessageID) +{ + LPTSTR msgBuf; + + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_ALLOCATE_BUFFER, + NULL, dwMessageID, 0, (LPTSTR)&msgBuf, 0, NULL); + LogEvent(wEventType, dwEventID, msgBuf, NULL); + LocalFree(msgBuf); +} + +// +// Use the ReportEvent API to write an entry to the system event log. +// +#define MAXSTRINGARGS 100 +VOID +LogEvent(WORD wEventType, DWORD dwEventID, LPTSTR lpString, ...) +{ + va_list listStrings; + HANDLE hEventSource; + LPTSTR lpStrings[MAXSTRINGARGS]; + WORD wNumStrings; + + // Ensure that our event source is properly initialized. + if (!AddEventSource()) + return; + + // Get a handle to the event log. + hEventSource = RegisterEventSource(NULL, SZSERVICENAME); + if (hEventSource == NULL) + return; + + // Construct the array of substitution strings. + va_start(listStrings, lpString); + for (wNumStrings = 0; + lpString != NULL && wNumStrings < MAXSTRINGARGS; + wNumStrings++) + { + lpStrings[wNumStrings] = lpString; + // Advance to the next argument. + lpString = va_arg(listStrings, LPTSTR); + } + va_end(listStrings); + + // Make sure we were not given too many args. + if (wNumStrings >= MAXSTRINGARGS) + return; + + // Log the event. + ReportEvent(hEventSource, // handle of event source + wEventType, // event type + 0, // event category + dwEventID, // event ID + NULL, // current user's SID + wNumStrings, // strings in lpszStrings + 0, // no bytes of raw data + lpStrings, // array of error strings + NULL); // no raw data + + DeregisterEventSource(hEventSource); +} diff --git a/src/WINNT/afsd/afsd_eventlog.h b/src/WINNT/afsd/afsd_eventlog.h new file mode 100644 index 000000000..614d2d85b --- /dev/null +++ b/src/WINNT/afsd/afsd_eventlog.h @@ -0,0 +1,13 @@ +// This header contains needed definitions and declarations for afsd's +// event logging functions. + +#ifndef __AFSD_EVENTLOG_H_ +#define __AFSD_EVENTLOG_H_ 1 + +// Include the event log message definitions. +#include "afsd_eventmessages.h" + +VOID LogEventMessage(WORD wEventType, DWORD dwEventID, DWORD dwMessageID); +VOID LogEvent(WORD wEventType, DWORD dwEventID, LPTSTR lpString, ...); + +#endif /* __AFSD_EVENTLOG_H_ */ diff --git a/src/WINNT/afsd/afsd_eventmessages.mc b/src/WINNT/afsd/afsd_eventmessages.mc new file mode 100644 index 000000000..37f86ac9b --- /dev/null +++ b/src/WINNT/afsd/afsd_eventmessages.mc @@ -0,0 +1,109 @@ +;// +;// afsd_eventmessages.mc +;// +;// This file contains the message definitions for the +;// TransarcAFSDaemon service to facilitate system event logging. +;// +;// +; +;#ifndef __AFSD_EVENTMESSAGES_H_ +;#define __AFSD_EVENTMESSAGES_H_ 1 + +MessageIdTypedef=DWORD + +SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS + Informational=0x1:STATUS_SEVERITY_INFORMATIONAL + Warning=0x2:STATUS_SEVERITY_WARNING + Error=0x3:STATUS_SEVERITY_ERROR + ) + +FacilityNames=(System=0x0:FACILITY_SYSTEM + Runtime=0x2:FACILITY_RUNTIME + Stubs=0x3:FACILITY_STUBS + Io=0x4:FACILITY_IO_ERROR_CODE + ) + +LanguageNames=(English=0x409:MSG00409) + +MessageId=0x1 +Severity=Informational +Facility=System +SymbolicName=MSG_TIME_FLUSH_PER_VOLUME +Language=English +Elapsed time to flush AFS volume <%1> = %2 milliseconds. +. + +MessageId= +Severity=Informational +Facility=System +SymbolicName=MSG_TIME_FLUSH_TOTAL +Language=English +Total elapsed time to flush %1 AFS volume(s) = %2 milliseconds. +. + +MessageId= +Severity=Error +Facility=System +SymbolicName=MSG_FLUSH_NO_SHARE_NAME +Language=English +Cannot get AFS share name to flush volumes. +. + +MessageId= +Severity=Error +Facility=System +SymbolicName=MSG_FLUSH_BAD_SHARE_NAME +Language=English +Invalid share name %1; cannot flush volumes. +. + +MessageId= +Severity=Error +Facility=System +SymbolicName=MSG_FLUSH_NO_MEMORY +Language=English +Insufficient memory to flush volumes. +. + +MessageId= +Severity=Error +Facility=System +SymbolicName=MSG_FLUSH_OPEN_ENUM_ERROR +Language=English +Cannot open enumeration of network resources: %1 +. + +MessageId= +Severity=Error +Facility=System +SymbolicName=MSG_FLUSH_ENUM_ERROR +Language=English +Cannot enumerate network resources: %1 +. + +MessageId= +Severity=Warning +Facility=System +SymbolicName=MSG_FLUSH_FAILED +Language=English +Failed to flush volume %1. +. + +MessageId= +Severity=Error +Facility=System +SymbolicName=MSG_FLUSH_IMPERSONATE_ERROR +Language=English +Failed to impersonate logged-on user. +. + +MessageId= +Severity=Warning +Facility=System +SymbolicName=MSG_FLUSH_UNEXPECTED_EVENT +Language=English +Flush volumes thread received unrecognized event. +. + + +;#endif /* __AFSD_EVENTMESSAGES_H_ 1 */ diff --git a/src/WINNT/afsd/afsd_eventmessages.rc b/src/WINNT/afsd/afsd_eventmessages.rc new file mode 100644 index 000000000..6f3b1e6ba --- /dev/null +++ b/src/WINNT/afsd/afsd_eventmessages.rc @@ -0,0 +1,2 @@ +LANGUAGE 0x9,0x1 +1 11 MSG00409.bin diff --git a/src/WINNT/afsd/afsd_flushvol.c b/src/WINNT/afsd/afsd_flushvol.c new file mode 100644 index 000000000..83267fa5c --- /dev/null +++ b/src/WINNT/afsd/afsd_flushvol.c @@ -0,0 +1,497 @@ +// +// AFSD_FLUSHVOL.C +// +// Routines to handle flushing AFS volumes in response to +// System Power event notification such as Hibernate request. +// +///////////////////////////////////////////////////////////////////// + +#include +#include + +#include + +#include +#include +#include "afsd.h" +#include "afsd_init.h" +#include "smb.h" +#include +#include +#include + +#include + +#include + +#include "afsd_flushvol.h" +#include "afsd_eventlog.h" + +static FLUSHVOLTHREADINFO gThreadInfo = {0}; +static HANDLE gThreadHandle = NULL; + + +///////////////////////////////////////////////////////////////////// +// +// Call routine found in FS.EXE to flush volume. +// +// At entry, input param is UNC string for volume, +// e.g. '\\afs\all\athena.mit.edu\user\m\h\mholiday' +// +// I believe that success from 'pioctl' routine +// indicated by return value of zero (0). +// +afs_int32 +afsd_ServicePerformFlushVolumeCmd(char *data) +{ + register afs_int32 code; + struct ViceIoctl blob; + + memset(&blob, '\0', sizeof(blob)); + code = pioctl(data, VIOC_FLUSHVOLUME, &blob, 0); + + return code; +} + +BOOL +afsd_ServicePerformFlushVolumes() +{ + CONST CHAR COLON = ':'; + CONST CHAR SLASH = '\\'; + CONST DWORD NETRESBUFSIZE = 16384; + CHAR bufMessage[1024]; + UINT i; + DWORD dwServerSize; + DWORD dwRet; + DWORD dwCount; + DWORD dwNetResBufSize; + DWORD dwTotalVols = 0; + DWORD dwVolBegin, dwVolEnd; + DWORD dwFlushBegin, dwFlushEnd; + HANDLE hEnum; + LPNETRESOURCE lpNetResBuf, lpnr; + PCHAR pszShareName, pc; + afs_int32 afsRet = 0; + + // Determine the root share name (\\AFS\ALL or \\-AFS\ALL), + // and the length of the server name prefix. + pszShareName = smb_GetSharename(); + if (pszShareName == NULL) + { + LogEvent(EVENTLOG_ERROR_TYPE, MSG_FLUSH_NO_SHARE_NAME, NULL); + return FALSE; + } + pc = strrchr(pszShareName, SLASH); + if ((pc == NULL) || ((dwServerSize = pc - pszShareName) < 3)) + { + LogEvent(EVENTLOG_ERROR_TYPE, MSG_FLUSH_BAD_SHARE_NAME, + pszShareName, NULL); + free(pszShareName); + return FALSE; + } + + // Allocate a buffer to hold network resources returned by + // WNetEnumResource(). + lpNetResBuf = malloc(NETRESBUFSIZE); + if (lpNetResBuf == NULL) + { + // Out of memory, give up now. + LogEvent(EVENTLOG_ERROR_TYPE, MSG_FLUSH_NO_MEMORY, NULL); + free(pszShareName); + return FALSE; + } + + // Initialize the flush timer. Note that GetTickCount() returns + // the number of milliseconds since the system started, in a DWORD, + // so that the value wraps around every 49.7 days. We do not bother + // to handle the case where the flush elapsed time is greater than + // that. + dwFlushBegin = GetTickCount(); + + dwRet = WNetOpenEnum(RESOURCE_CONNECTED, RESOURCETYPE_ANY, 0, NULL, + &hEnum); + if (dwRet != NO_ERROR) + { + LogEventMessage(EVENTLOG_ERROR_TYPE, MSG_FLUSH_OPEN_ENUM_ERROR, + dwRet); + free(pszShareName); + return FALSE; + } + + // Loop to enumerate network resources, and flush those associated + // with AFS volumes. + while (1) + { + dwCount = -1; + memset(lpNetResBuf, 0, NETRESBUFSIZE); + dwNetResBufSize = NETRESBUFSIZE; + dwRet = WNetEnumResource(hEnum, &dwCount, + lpNetResBuf, &dwNetResBufSize); + if (dwRet != NO_ERROR) + break; + // Iterate over the returned network resources. + for (i = 0, lpnr = lpNetResBuf; i < dwCount; i++, lpnr++) + { + // Ensure resource has a remote name, and is connected. + if ((lpnr->lpRemoteName == NULL) || + (lpnr->dwScope != RESOURCE_CONNECTED)) + continue; + if ((_strnicmp(lpnr->lpRemoteName, pszShareName, + dwServerSize) == 0) && + (lpnr->lpRemoteName[dwServerSize] == SLASH)) + { + // got one! + // but we don't want to flush '\\[...]afs\all' + if (_stricmp(lpnr->lpRemoteName, + pszShareName) == 0) + continue; + ++dwTotalVols; + + dwVolBegin = GetTickCount(); + afsRet = afsd_ServicePerformFlushVolumeCmd(lpnr->lpRemoteName); + dwVolEnd = GetTickCount(); + if (afsRet == 0) + { + LogTimingEvent(MSG_TIME_FLUSH_PER_VOLUME, + lpnr->lpRemoteName, + dwVolEnd - dwVolBegin); + } + else + { + LogEvent(EVENTLOG_WARNING_TYPE, + MSG_FLUSH_FAILED, + lpnr->lpRemoteName, NULL); + } + } + } + } + WNetCloseEnum(hEnum); + free(lpNetResBuf); + free(pszShareName); + if (dwRet != ERROR_NO_MORE_ITEMS) + { + LogEventMessage(EVENTLOG_ERROR_TYPE, MSG_FLUSH_ENUM_ERROR, + dwRet); + return FALSE; + } + + dwFlushEnd = GetTickCount(); + + // display total volume count in Event Logger + sprintf(bufMessage, "%d", dwTotalVols); + LogTimingEvent(MSG_TIME_FLUSH_TOTAL, bufMessage, + dwFlushEnd - dwFlushBegin); + + return TRUE; +} + +// Report a timing event to the system event log. +// The lpszString1 argument is the first substitution string for the +// given event ID. The time argument will be converted into the +// second substitution string. +static VOID +LogTimingEvent(DWORD dwEventID, LPTSTR lpString1, DWORD dwTime) +{ + CHAR szTime[16]; + + sprintf(szTime, "%lu", dwTime); + LogEvent(EVENTLOG_INFORMATION_TYPE, dwEventID, lpString1, szTime, + NULL); +} + + +///////////////////////////////////////////////////////////////////// +// +// GetUserToken +// +// Obtain token for the currently logged-in user. +// +// This routine looks for a window which we 'know' belongs to +// the shell, and from there we follow a route which leads to +// getting a handle on an access token owned by the shell. +// +// The return value is either a handle to a suitable token, +// or else null. +// +// One of the times that this function might return null +// is when there is no logged-in user. Other cases include +// insufficient access to the desktop, etc. +// +// Disclaimer: +// Portions of this routine found in various newsgroups +// +HANDLE GetUserToken(DWORD access) +{ + HANDLE hTok = NULL; + DWORD pid = 0, tid = 0; + + // Try it the easy way first - look for a window owned by the shell on + // our current desktop. If we find one, use that to get the process id. + HWND shell = FindWindowEx(NULL, NULL, "Progman", NULL); + if (shell != NULL) + { + tid = GetWindowThreadProcessId(shell, &pid); + } + + // We are possibly running on a private window station and desktop: we must + // switch to the default (which we suppose is where we will find the + // running shell). + else + { + HWINSTA saveWinSta = GetProcessWindowStation(); + HDESK saveDesk = GetThreadDesktop(GetCurrentThreadId()); + HWINSTA winSta = NULL; + HDESK desk = NULL; + BOOL changeFlag = FALSE; + BOOL dummy = saveWinSta != NULL && + saveDesk != NULL && + (winSta = OpenWindowStation("WinSta0", FALSE, + MAXIMUM_ALLOWED)) != NULL && + (changeFlag = SetProcessWindowStation(winSta)) != 0 && + (desk = OpenDesktop("Default", 0, FALSE, + MAXIMUM_ALLOWED)) != NULL && + SetThreadDesktop(desk) != 0; + + // Now find the window and process on this desktop + shell = FindWindowEx(NULL, NULL, "Progman", NULL); + if (shell != NULL) + { + tid = GetWindowThreadProcessId(shell, &pid); + } + + // Restore our own window station and desktop + if (changeFlag) + { + SetProcessWindowStation(saveWinSta); + SetThreadDesktop(saveDesk); + } + + // Close temporary objects + if (winSta != NULL) + CloseWindowStation(winSta); + if (desk != NULL) + CloseDesktop(desk); + } + + // + // If we have a process id, use that to get the process handle and + // from there the process' access token. + // + if (pid != 0) + { + HANDLE hProc = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid); + if (hProc != NULL) + { + OpenProcessToken(hProc, access, &hTok) || (hTok = NULL); + CloseHandle(hProc); + } + } + + // Return token if we got one + return hTok; +} + +// impersonate logged-on user as client +BOOL +ImpersonateClient() +{ + DWORD dwDesiredAccess = TOKEN_ALL_ACCESS; + HANDLE hUserToken = GetUserToken(dwDesiredAccess); + + if (hUserToken == NULL) + return FALSE; + if (ImpersonateLoggedOnUser(hUserToken) == 0) + { + LogEvent(EVENTLOG_ERROR_TYPE, MSG_FLUSH_IMPERSONATE_ERROR, + NULL); + return FALSE; + } + return TRUE; +} + +///////////////////////////////////////////////////////////////////// +// +// Thread proc +// +DWORD WINAPI +afsd_ServiceFlushVolumesThreadProc(LPVOID lpParam) +{ + FLUSHVOLTHREADINFO ThreadInfo; + PFLUSHVOLTHREADINFO pThreadInfo = (PFLUSHVOLTHREADINFO) lpParam; + HANDLE arHandles[2] = {0}; + DWORD dwWaitState = 0; + + // thread running - get handles + ThreadInfo.hEventPowerEvent = pThreadInfo->hEventPowerEvent; + ThreadInfo.hEventResumeMain = pThreadInfo->hEventResumeMain; + ThreadInfo.hEventTerminate = pThreadInfo->hEventTerminate; + + // setup to wait + arHandles[0] = ThreadInfo.hEventTerminate; + arHandles[1] = ThreadInfo.hEventPowerEvent; + + // do stuff .. + while (1) + { + // wait for an event to happen + dwWaitState = WaitForMultipleObjectsEx(2, arHandles, FALSE, INFINITE, FALSE); + + switch (dwWaitState) + { + case WAIT_OBJECT_0: + // termination signaled + RevertToSelf(); + CheckAndCloseHandle(ThreadInfo.hEventPowerEvent); + CheckAndCloseHandle(ThreadInfo.hEventResumeMain); + CheckAndCloseHandle(ThreadInfo.hEventTerminate); + ExitThread(0); + break; + + case WAIT_OBJECT_0+1: + // Power event + // - flush 'em! + if (ImpersonateClient()) + { + afsd_ServicePerformFlushVolumes(); + } + // acknowledge event + ResetEvent(ThreadInfo.hEventPowerEvent); + break; + + case WAIT_ABANDONED_0: + case WAIT_ABANDONED_0+1: + case WAIT_IO_COMPLETION: + case WAIT_TIMEOUT: + // sno* + LogEvent(EVENTLOG_WARNING_TYPE, + MSG_FLUSH_UNEXPECTED_EVENT, NULL); + break; + + } // end switch + + // signal back to waiting mainline + SetEvent(ThreadInfo.hEventResumeMain); + + } // end while + + // I suppose we never get here + ExitThread(0); +} + +///////////////////////////////////////////////////////////////////// +// +// Mainline thread routines +// + +VOID +CheckAndCloseHandle(HANDLE thisHandle) +{ + if (thisHandle != NULL) + { + CloseHandle(thisHandle); + thisHandle = NULL; + } +} + +// +// Thread Creation +// +BOOL +PowerNotificationThreadCreate() +{ + BOOL bSuccess = FALSE; + DWORD dwThreadId = 0; + char eventName[MAX_PATH]; + + do + { + // create power event notification event + // bManualReset=TRUE, bInitialState=FALSE + gThreadInfo.hEventPowerEvent = CreateEvent(NULL, TRUE, FALSE, + TEXT("afsd_flushvol_EventPowerEvent")); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) + afsi_log("Event Object Already Exists: %s", eventName); + if (gThreadInfo.hEventPowerEvent == NULL) + break; + + // create mainline resume event + // bManualReset=FALSE, bInitialState=FALSE + gThreadInfo.hEventResumeMain = CreateEvent(NULL, FALSE, FALSE, + TEXT("afsd_flushvol_EventResumeMain")); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) + afsi_log("Event Object Already Exists: %s", eventName); + if (gThreadInfo.hEventResumeMain == NULL) + break; + + // create thread terminate event + // bManualReset=FALSE, bInitialState=FALSE + gThreadInfo.hEventTerminate = CreateEvent(NULL, FALSE, FALSE, + TEXT("afsd_flushvol_EventTerminate")); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) + afsi_log("Event Object Already Exists: %s", eventName); + if (gThreadInfo.hEventTerminate == NULL) + break; + + // good so far - create thread + gThreadHandle = CreateThread(NULL, 0, + afsd_ServiceFlushVolumesThreadProc, + (LPVOID) &gThreadInfo, + 0, &dwThreadId); + + if (!gThreadHandle) + break; + + bSuccess = TRUE; + + } while (0); + + + if (!bSuccess) + { + CheckAndCloseHandle(gThreadInfo.hEventPowerEvent); + CheckAndCloseHandle(gThreadInfo.hEventResumeMain); + CheckAndCloseHandle(gThreadInfo.hEventTerminate); + CheckAndCloseHandle(gThreadHandle); + } + + return bSuccess; +} + +// +// Thread Notification +// +BOOL +PowerNotificationThreadNotify() +{ + DWORD dwRet = 0; + BOOL bRet = FALSE; + + // Notify thread of power event, and wait 19 seconds + dwRet = SignalObjectAndWait( + gThreadInfo.hEventPowerEvent, // object to signal + gThreadInfo.hEventResumeMain, // object to watch + 19*1000, // timeout (ms) + FALSE // alertable + ); + + if (dwRet == WAIT_OBJECT_0) + bRet = TRUE; + + return bRet; +} + +// +// Thread Termination +// +VOID +PowerNotificationThreadExit() +{ + // ExitThread + if (gThreadHandle) + { + SetEvent(gThreadInfo.hEventTerminate); + WaitForSingleObject(gThreadHandle, INFINITE); + CloseHandle(gThreadHandle); + } +} + diff --git a/src/WINNT/afsd/afsd_flushvol.h b/src/WINNT/afsd/afsd_flushvol.h new file mode 100644 index 000000000..ca632612b --- /dev/null +++ b/src/WINNT/afsd/afsd_flushvol.h @@ -0,0 +1,45 @@ +// +// AFSD_FLUSHVOL.H +// +// Include file for routines that handle flushing AFS volumes +// in response to System Power event notification such as +// Hibernate request. +// +///////////////////////////////////////////////////////////////////// + +#ifndef _AFSD_FLUSHVOL_H_ +#define _AFSD_FLUSHVOL_H_ + +#include +#include "fs_utils.h" + +// handles +typedef struct _tagFLUSHVOLTHREADINFO { + HANDLE hEventPowerEvent; + HANDLE hEventResumeMain; + HANDLE hEventTerminate; +} FLUSHVOLTHREADINFO, *PFLUSHVOLTHREADINFO; + +// invokes fs.exe pioctl +static afs_int32 afsd_ServicePerformFlushVolumeCmd(char *data); + +// thread callback +static DWORD WINAPI afsd_ServiceFlushVolumesThreadProc(LPVOID lpParameter); + +// helper function +static VOID CheckAndCloseHandle(HANDLE thisHandle); + +// thread construction/notification/destruction +BOOL PowerNotificationThreadCreate(VOID); +BOOL PowerNotificationThreadNotify(VOID); +VOID PowerNotificationThreadExit(VOID); + +// impersonation helper(s) +static HANDLE GetUserToken(DWORD access); +static BOOL ImpersonateClient(void); + +// event logging +static VOID LogTimingEvent(DWORD dwEventID, LPTSTR lpString1, DWORD dwTime); + +#endif // _AFSD_FLUSHVOL_H_ + diff --git a/src/WINNT/afsd/afsd_init.c b/src/WINNT/afsd/afsd_init.c index 84d6a8504..8f428fe17 100644 --- a/src/WINNT/afsd/afsd_init.c +++ b/src/WINNT/afsd/afsd_init.c @@ -27,9 +27,10 @@ #include "smb.h" #include "cm_rpc.h" +#include "lanahelper.h" -extern int RXAFSCB_ExecuteRequest(); -extern int RXSTATS_ExecuteRequest(); +extern int RXAFSCB_ExecuteRequest(struct rx_call *z_call); +extern int RXSTATS_ExecuteRequest(struct rx_call *z_call); extern afs_int32 cryptall; @@ -66,6 +67,8 @@ int logReady = 0; char cm_HostName[200]; long cm_HostAddr; +char cm_NetbiosName[MAX_NB_NAME_LENGTH]; + char cm_CachePath[200]; DWORD cm_CachePathLen; @@ -89,47 +92,73 @@ HANDLE afsi_file; int cm_dnsEnabled = 1; #endif -/*#ifdef AFS_FREELANCE_CLIENT -extern int cm_freelanceEnabled; -#endif*/ +char cm_NetBiosName[32]; -void cm_InitFakeRootDir(); +extern initUpperCaseTable(); +void afsd_initUpperCaseTable() +{ + initUpperCaseTable(); +} void afsi_start() { char wd[100]; - char t[100], u[100]; + char t[100], u[100], *p, *path; int zilch; int code; afsi_file = INVALID_HANDLE_VALUE; - code = GetWindowsDirectory(wd, sizeof(wd)); - if (code == 0) return; + if (getenv("TEMP")) + { + strcpy(wd, getenv("TEMP")); + } + else + { + code = GetWindowsDirectory(wd, sizeof(wd)); + if (code == 0) return; + } strcat(wd, "\\afsd_init.log"); GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t)); afsi_file = CreateFile(wd, GENERIC_WRITE, FILE_SHARE_READ, NULL, - CREATE_ALWAYS, FILE_FLAG_WRITE_THROUGH, NULL); + OPEN_ALWAYS, FILE_FLAG_WRITE_THROUGH, NULL); + SetFilePointer(afsi_file, 0, NULL, FILE_END); GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, u, sizeof(u)); strcat(t, ": Create log file\n"); strcat(u, ": Created log file\n"); WriteFile(afsi_file, t, strlen(t), &zilch, NULL); WriteFile(afsi_file, u, strlen(u), &zilch, NULL); + p = "PATH="; + path = getenv("PATH"); + WriteFile(afsi_file, p, strlen(p), &zilch, NULL); + WriteFile(afsi_file, path, strlen(path), &zilch, NULL); + WriteFile(afsi_file, "\n", 1, &zilch, NULL); } +static int afsi_log_useTimestamp = 1; + void afsi_log(char *pattern, ...) { - char s[100], t[100], u[100]; + char s[100], t[100], d[100], u[300]; int zilch; va_list ap; va_start(ap, pattern); vsprintf(s, pattern, ap); - GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t)); - sprintf(u, "%s: %s\n", t, s); - if (afsi_file != INVALID_HANDLE_VALUE) - WriteFile(afsi_file, u, strlen(u), &zilch, NULL); + if ( afsi_log_useTimestamp ) { + GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t)); + GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, d, sizeof(d)); + sprintf(u, "%s %s: %s\n", d, t, s); + if (afsi_file != INVALID_HANDLE_VALUE) + WriteFile(afsi_file, u, strlen(u), &zilch, NULL); +#ifdef NOTSERVICE + printf("%s", u); +#endif + } else { + if (afsi_file != INVALID_HANDLE_VALUE) + WriteFile(afsi_file, s, strlen(s), &zilch, NULL); + } } /* @@ -140,11 +169,12 @@ void afsd_ForceTrace(BOOL flush) { HANDLE handle; int len; - char buf[100]; + char buf[256]; - if (!logReady) return; + if (!logReady) + return; - len = GetTempPath(99, buf); + len = GetTempPath(sizeof(buf)-10, buf); strcpy(&buf[len], "/afsd.log"); handle = CreateFile(buf, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); @@ -171,6 +201,7 @@ int afsd_InitCM(char **reasonP) long stats; long traceBufSize; long ltt, ltto; + long rx_mtu, rx_nojumbo; char rootCellName[256]; struct rx_service *serverp; static struct rx_securityClass *nullServerSecurityClassp; @@ -182,14 +213,18 @@ int afsd_InitCM(char **reasonP) long code; /*int freelanceEnabled;*/ WSADATA WSAjunk; + lana_number_t lanaNum; WSAStartup(0x0101, &WSAjunk); + afsd_initUpperCaseTable(); + /* setup osidebug server at RPC slot 1000 */ osi_LongToUID(1000, &debugID); code = osi_InitDebug(&debugID); afsi_log("osi_InitDebug code %d", code); -// osi_LockTypeSetDefault("stat"); /* comment this out for speed * + + // osi_LockTypeSetDefault("stat"); /* comment this out for speed * if (code != 0) { *reasonP = "unknown error"; return -1; @@ -205,7 +240,6 @@ int afsd_InitCM(char **reasonP) srand(ntohl(cm_HostAddr)); /* Look up configuration parameters in Registry */ - code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, KEY_QUERY_VALUE, &parmKey); if (code != ERROR_SUCCESS) { @@ -218,16 +252,24 @@ int afsd_InitCM(char **reasonP) osi_panic(buf, __FILE__, __LINE__); } - dummyLen = sizeof(LANadapter); - code = RegQueryValueEx(parmKey, "LANadapter", NULL, NULL, - (BYTE *) &LANadapter, &dummyLen); + dummyLen = sizeof(traceBufSize); + code = RegQueryValueEx(parmKey, "TraceBufferSize", NULL, NULL, + (BYTE *) &traceBufSize, &dummyLen); if (code == ERROR_SUCCESS) - afsi_log("LAN adapter number %d", LANadapter); + afsi_log("Trace Buffer size %d", traceBufSize); else { - LANadapter = -1; - afsi_log("Default LAN adapter number"); + traceBufSize = CM_CONFIGDEFAULT_TRACEBUFSIZE; + afsi_log("Default trace buffer size %d", traceBufSize); } + /* setup and enable debug log */ + afsd_logp = osi_LogCreate("afsd", traceBufSize); + afsi_log("osi_LogCreate log addr %x", (int)afsd_logp); + osi_LogEnable(afsd_logp); + logReady = 1; + + osi_Log0(afsd_logp, "Log init"); + dummyLen = sizeof(cacheSize); code = RegQueryValueEx(parmKey, "CacheSize", NULL, NULL, (BYTE *) &cacheSize, &dummyLen); @@ -294,7 +336,7 @@ int afsd_InitCM(char **reasonP) ltt = 1; afsi_log("Logoff token transfer on by default"); } - smb_LogoffTokenTransfer = ltt; + smb_LogoffTokenTransfer = ltt; if (ltt) { dummyLen = sizeof(ltto); @@ -307,8 +349,10 @@ int afsd_InitCM(char **reasonP) ltto = 10; afsi_log("Default logoff token transfer timeout 10 seconds"); } - } - smb_LogoffTransferTimeout = ltto; + } else { + ltto = 0; + } + smb_LogoffTransferTimeout = ltto; dummyLen = sizeof(cm_rootVolumeName); code = RegQueryValueEx(parmKey, "RootVolume", NULL, NULL, @@ -323,9 +367,10 @@ int afsd_InitCM(char **reasonP) cm_mountRootLen = sizeof(cm_mountRoot); code = RegQueryValueEx(parmKey, "Mountroot", NULL, NULL, cm_mountRoot, &cm_mountRootLen); - if (code == ERROR_SUCCESS) + if (code == ERROR_SUCCESS) { afsi_log("Mount root %s", cm_mountRoot); - else { + cm_mountRootLen = strlen(cm_mountRoot); + } else { strcpy(cm_mountRoot, "/afs"); cm_mountRootLen = 4; /* Don't log */ @@ -354,17 +399,6 @@ int afsd_InitCM(char **reasonP) /* Don't log */ } - dummyLen = sizeof(isGateway); - code = RegQueryValueEx(parmKey, "IsGateway", NULL, NULL, - (BYTE *) &isGateway, &dummyLen); - if (code == ERROR_SUCCESS) - afsi_log("Set for %s service", - isGateway ? "gateway" : "stand-alone"); - else { - isGateway = 0; - /* Don't log */ - } - dummyLen = sizeof(reportSessionStartups); code = RegQueryValueEx(parmKey, "ReportSessionStartups", NULL, NULL, (BYTE *) &reportSessionStartups, &dummyLen); @@ -376,16 +410,6 @@ int afsd_InitCM(char **reasonP) /* Don't log */ } - dummyLen = sizeof(traceBufSize); - code = RegQueryValueEx(parmKey, "TraceBufferSize", NULL, NULL, - (BYTE *) &traceBufSize, &dummyLen); - if (code == ERROR_SUCCESS) - afsi_log("Trace Buffer size %d", traceBufSize); - else { - traceBufSize = CM_CONFIGDEFAULT_TRACEBUFSIZE; - afsi_log("Default trace buffer size %d", traceBufSize); - } - dummyLen = sizeof(cm_sysName); code = RegQueryValueEx(parmKey, "SysName", NULL, NULL, cm_sysName, &dummyLen); @@ -435,33 +459,105 @@ int afsd_InitCM(char **reasonP) } #endif /* AFS_FREELANCE_CLIENT */ + dummyLen = sizeof(buf); + code = RegQueryValueEx(parmKey, "NetbiosName", NULL, NULL, + (BYTE *) &buf, &dummyLen); + if (code == ERROR_SUCCESS) { + DWORD len = ExpandEnvironmentStrings(buf, cm_NetBiosName, MAX_NB_NAME_LENGTH); + if ( len > 0 && len <= MAX_NB_NAME_LENGTH ) { + afsi_log("Explicit NetBios name is used %s", cm_NetBiosName); + } else { + afsi_log("Unable to Expand Explicit NetBios name: %s", buf); + cm_NetBiosName[0] = 0; /* turn it off */ + } + } + else { + cm_NetBiosName[0] = 0; /* default off */ + } + + dummyLen = sizeof(smb_hideDotFiles); + code = RegQueryValueEx(parmKey, "HideDotFiles", NULL, NULL, + (BYTE *) &smb_hideDotFiles, &dummyLen); + if (code != ERROR_SUCCESS) { + smb_hideDotFiles = 1; /* default on */ + } + afsi_log("Dot files/dirs will %sbe marked hidden", + smb_hideDotFiles ? "" : "not "); + + dummyLen = sizeof(smb_maxMpxRequests); + code = RegQueryValueEx(parmKey, "MaxMpxRequests", NULL, NULL, + (BYTE *) &smb_maxMpxRequests, &dummyLen); + if (code != ERROR_SUCCESS) { + smb_maxMpxRequests = 50; + } + afsi_log("Maximum number of multiplexed sessions is %d", smb_maxMpxRequests); + + dummyLen = sizeof(smb_maxVCPerServer); + code = RegQueryValueEx(parmKey, "MaxVCPerServer", NULL, NULL, + (BYTE *) &smb_maxVCPerServer, &dummyLen); + if (code != ERROR_SUCCESS) { + smb_maxVCPerServer = 100; + } + afsi_log("Maximum number of VCs per server is %d", smb_maxVCPerServer); + + dummyLen = sizeof(rx_nojumbo); + code = RegQueryValueEx(parmKey, "RxNoJumbo", NULL, NULL, + (BYTE *) &rx_nojumbo, &dummyLen); + if (code != ERROR_SUCCESS) { + rx_nojumbo = 0; + } + if(rx_nojumbo) + afsi_log("RX Jumbograms are disabled"); + + dummyLen = sizeof(rx_mtu); + code = RegQueryValueEx(parmKey, "RxMaxMTU", NULL, NULL, + (BYTE *) &rx_mtu, &dummyLen); + if (code != ERROR_SUCCESS || !rx_mtu) { + rx_mtu = -1; + } + if(rx_mtu != -1) + afsi_log("RX maximum MTU is %d", rx_mtu); + RegCloseKey (parmKey); + /* Call lanahelper to get Netbios name, lan adapter number and gateway flag */ + if(SUCCEEDED(code = lana_GetUncServerNameEx(cm_NetbiosName, &lanaNum, &isGateway, LANA_NETBIOS_NAME_FULL))) { + LANadapter = (lanaNum == LANA_INVALID)? -1: lanaNum; + + if(LANadapter != -1) + afsi_log("LAN adapter number %d", LANadapter); + else + afsi_log("LAN adapter number not determined"); + + if(isGateway) + afsi_log("Set for gateway service"); + + afsi_log("Using >%s< as SMB server name", cm_NetbiosName); + } else { + /* something went horribly wrong. We can't proceed without a netbios name */ + sprintf(buf,"Netbios name could not be determined: %li", code); + osi_panic(buf, __FILE__, __LINE__); + } + /* setup early variables */ /* These both used to be configurable. */ smb_UseV3 = 1; - buf_bufferSize = CM_CONFIGDEFAULT_BLOCKSIZE; + buf_bufferSize = CM_CONFIGDEFAULT_BLOCKSIZE; /* turn from 1024 byte units into memory blocks */ - cacheBlocks = (cacheSize * 1024) / buf_bufferSize; + cacheBlocks = (cacheSize * 1024) / buf_bufferSize; - /* setup and enable debug log */ - afsd_logp = osi_LogCreate("afsd", traceBufSize); - afsi_log("osi_LogCreate log addr %x", afsd_logp); - osi_LogEnable(afsd_logp); - logReady = 1; - /* get network related info */ cm_noIPAddr = CM_MAXINTERFACE_ADDR; code = syscfg_GetIFInfo(&cm_noIPAddr, - cm_IPAddr, cm_SubnetMask, - cm_NetMtu, cm_NetFlags); + cm_IPAddr, cm_SubnetMask, + cm_NetMtu, cm_NetFlags); if ( (cm_noIPAddr <= 0) || (code <= 0 ) ) afsi_log("syscfg_GetIFInfo error code %d", code); else afsi_log("First Network address %x SubnetMask %x", - cm_IPAddr[0], cm_SubnetMask[0]); + cm_IPAddr[0], cm_SubnetMask[0]); /* * Save client configuration for GetCacheConfig requests @@ -476,9 +572,41 @@ int afsd_InitCM(char **reasonP) cm_initParams.setTime = 0; cm_initParams.memCache = 0; + /* Set RX parameters before initializing RX */ + if ( rx_nojumbo ) { + rx_SetNoJumbo(); + afsi_log("rx_SetNoJumbo successful"); + } + + if ( rx_mtu != -1 ) { + rx_SetMaxMTU(rx_mtu); + afsi_log("rx_SetMaxMTU %d successful", rx_mtu); + } + + /* Open Microsoft Firewall to allow in port 7001 */ + { + HKEY hk; + DWORD dwDisp; + TCHAR* value = TEXT("7001:UDP:*:Enabled:AFS Cache Manager Callback"); + if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, + "SYSTEM\\CurrentControlSet\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\DomainProfile\\GloballyOpenP", + 0, TEXT("container"), 0, KEY_SET_VALUE, NULL, &hk, &dwDisp) == ERROR_SUCCESS) + { + RegSetValueEx (hk, TEXT("7001:UDP"), 0, REG_SZ, (PBYTE)value, sizeof(TCHAR) * (1+lstrlen(value))); + RegCloseKey (hk); + } + if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, + "SYSTEM\\CurrentControlSet\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\StandardProfile\\GloballyOpenP", + 0, TEXT("container"), 0, KEY_SET_VALUE, NULL, &hk, &dwDisp) == ERROR_SUCCESS) + { + RegSetValueEx (hk, TEXT("7001:UDP"), 0, REG_SZ, (PBYTE)value, sizeof(TCHAR) * (1+lstrlen(value))); + RegCloseKey (hk); + } + } + /* initialize RX, and tell it to listen to port 7001, which is used for - * callback RPC messages. - */ + * callback RPC messages. + */ code = rx_Init(htons(7001)); afsi_log("rx_Init code %x", code); if (code != 0) { @@ -491,25 +619,25 @@ int afsd_InitCM(char **reasonP) /* create an unauthenticated service #1 for callbacks */ nullServerSecurityClassp = rxnull_NewServerSecurityObject(); - serverp = rx_NewService(0, 1, "AFS", &nullServerSecurityClassp, 1, - RXAFSCB_ExecuteRequest); - afsi_log("rx_NewService addr %x", serverp); + serverp = rx_NewService(0, 1, "AFS", &nullServerSecurityClassp, 1, + RXAFSCB_ExecuteRequest); + afsi_log("rx_NewService addr %x", (int)serverp); if (serverp == NULL) { *reasonP = "unknown error"; return -1; } nullServerSecurityClassp = rxnull_NewServerSecurityObject(); - serverp = rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", - &nullServerSecurityClassp, 1, RXSTATS_ExecuteRequest); - afsi_log("rx_NewService addr %x", serverp); + serverp = rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", + &nullServerSecurityClassp, 1, RXSTATS_ExecuteRequest); + afsi_log("rx_NewService addr %x", (int)serverp); if (serverp == NULL) { *reasonP = "unknown error"; return -1; } - /* start server threads, *not* donating this one to the pool */ - rx_StartServer(0); + /* start server threads, *not* donating this one to the pool */ + rx_StartServer(0); afsi_log("rx_StartServer"); /* init user daemon, and other packages */ @@ -519,21 +647,21 @@ int afsd_InitCM(char **reasonP) cm_InitConn(); - cm_InitCell(); - - cm_InitServer(); + cm_InitCell(); - cm_InitVolume(); + cm_InitServer(); - cm_InitIoctl(); + cm_InitVolume(); + + cm_InitIoctl(); - smb_InitIoctl(); + smb_InitIoctl(); - cm_InitCallback(); + cm_InitCallback(); - cm_InitSCache(stats); + cm_InitSCache(stats); - code = cm_InitDCache(0, cacheBlocks); + code = cm_InitDCache(0, cacheBlocks); afsi_log("cm_InitDCache code %x", code); if (code != 0) { *reasonP = "error initializing cache"; @@ -541,28 +669,33 @@ int afsd_InitCM(char **reasonP) } #ifdef AFS_AFSDB_ENV +#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x500 if (cm_InitDNS(cm_dnsEnabled) == -1) cm_dnsEnabled = 0; /* init failed, so deactivate */ afsi_log("cm_InitDNS %d", cm_dnsEnabled); +#endif #endif code = cm_GetRootCellName(rootCellName); - afsi_log("cm_GetRootCellName code %d rcn %s", code, - (code ? "" : rootCellName)); - if (code != 0 && !cm_freelanceEnabled) { + afsi_log("cm_GetRootCellName code %d, cm_freelanceEnabled= %d, rcn= %s", + code, cm_freelanceEnabled, (code ? "" : rootCellName)); + if (code != 0 && !cm_freelanceEnabled) + { *reasonP = "can't find root cell name in afsd.ini"; return -1; + } + else if (cm_freelanceEnabled) + cm_rootCellp = NULL; + + if (code == 0 && !cm_freelanceEnabled) + { + cm_rootCellp = cm_GetCell(rootCellName, CM_FLAG_CREATE); + afsi_log("cm_GetCell addr %x", (int)cm_rootCellp); + if (cm_rootCellp == NULL) + { + *reasonP = "can't find root cell in afsdcell.ini"; + return -1; } - else if (cm_freelanceEnabled) - cm_rootCellp = NULL; - - if (code == 0 && !cm_freelanceEnabled) { - cm_rootCellp = cm_GetCell(rootCellName, CM_FLAG_CREATE); - afsi_log("cm_GetCell addr %x", cm_rootCellp); - if (cm_rootCellp == NULL) { - *reasonP = "can't find root cell in afsdcell.ini"; - return -1; - } } #ifdef AFS_FREELANCE_CLIENT @@ -582,30 +715,30 @@ int afsd_InitDaemons(char **reasonP) /* this should really be in an init daemon from here on down */ - if (!cm_freelanceEnabled) { - code = cm_GetVolumeByName(cm_rootCellp, cm_rootVolumeName, cm_rootUserp, - &req, CM_FLAG_CREATE, &cm_rootVolumep); - afsi_log("cm_GetVolumeByName code %x root vol %x", code, - (code ? 0xffffffff : cm_rootVolumep)); - if (code != 0) { + if (!cm_freelanceEnabled) { + code = cm_GetVolumeByName(cm_rootCellp, cm_rootVolumeName, cm_rootUserp, + &req, CM_FLAG_CREATE, &cm_rootVolumep); + afsi_log("cm_GetVolumeByName code %x root vol %x", code, + (code ? (cm_volume_t *)-1 : cm_rootVolumep)); + if (code != 0) { *reasonP = "can't find root volume in root cell"; return -1; - } } + } /* compute the root fid */ if (!cm_freelanceEnabled) { - cm_rootFid.cell = cm_rootCellp->cellID; - cm_rootFid.volume = cm_GetROVolumeID(cm_rootVolumep); - cm_rootFid.vnode = 1; - cm_rootFid.unique = 1; + cm_rootFid.cell = cm_rootCellp->cellID; + cm_rootFid.volume = cm_GetROVolumeID(cm_rootVolumep); + cm_rootFid.vnode = 1; + cm_rootFid.unique = 1; } else - cm_FakeRootFid(&cm_rootFid); + cm_FakeRootFid(&cm_rootFid); - code = cm_GetSCache(&cm_rootFid, &cm_rootSCachep, cm_rootUserp, &req); + code = cm_GetSCache(&cm_rootFid, &cm_rootSCachep, cm_rootUserp, &req); afsi_log("cm_GetSCache code %x scache %x", code, - (code ? 0xffffffff : cm_rootSCachep)); + (code ? (cm_scache_t *)-1 : cm_rootSCachep)); if (code != 0) { *reasonP = "unknown error"; return -1; @@ -619,25 +752,247 @@ int afsd_InitDaemons(char **reasonP) int afsd_InitSMB(char **reasonP, void *aMBfunc) { - char hostName[200]; - char *ctemp; - /* Do this last so that we don't handle requests before init is done. - * Here we initialize the SMB listener. - */ - strcpy(hostName, cm_HostName); - ctemp = strchr(hostName, '.'); /* turn ntdfs.* into ntdfs */ - if (ctemp) *ctemp = 0; - hostName[11] = 0; /* ensure that even after adding the -A, we - * leave one byte free for the netbios server - * type. - */ - strcat(hostName, "-AFS"); - _strupr(hostName); - smb_Init(afsd_logp, hostName, smb_UseV3, LANadapter, numSvThreads, - aMBfunc); - afsi_log("smb_Init"); + * Here we initialize the SMB listener. + */ + smb_Init(afsd_logp, cm_NetbiosName, smb_UseV3, LANadapter, numSvThreads, aMBfunc); + afsi_log("smb_Init"); return 0; } +#ifdef ReadOnly +#undef ReadOnly +#endif + +#ifdef File +#undef File +#endif + +#pragma pack( push, before_imagehlp, 8 ) +#include +#pragma pack( pop, before_imagehlp ) + +#define MAXNAMELEN 1024 + +void afsd_printStack(HANDLE hThread, CONTEXT *c) +{ + HANDLE hProcess = GetCurrentProcess(); + int frameNum; + DWORD offset; + DWORD symOptions; + char functionName[MAXNAMELEN]; + + IMAGEHLP_MODULE Module; + IMAGEHLP_LINE Line; + + STACKFRAME s; + IMAGEHLP_SYMBOL *pSym; + + afsi_log_useTimestamp = 0; + + pSym = (IMAGEHLP_SYMBOL *) GlobalAlloc(0, sizeof (IMAGEHLP_SYMBOL) + MAXNAMELEN); + + memset( &s, '\0', sizeof s ); + if (!SymInitialize(hProcess, NULL, 1) ) + { + afsi_log("SymInitialize(): GetLastError() = %lu\n", GetLastError() ); + + SymCleanup( hProcess ); + GlobalFree(pSym); + + return; + } + + symOptions = SymGetOptions(); + symOptions |= SYMOPT_LOAD_LINES; + symOptions &= ~SYMOPT_UNDNAME; + SymSetOptions( symOptions ); + + /* + * init STACKFRAME for first call + * Notes: AddrModeFlat is just an assumption. I hate VDM debugging. + * Notes: will have to be #ifdef-ed for Alphas; MIPSes are dead anyway, + * and good riddance. + */ +#if defined (_ALPHA_) || defined (_MIPS_) || defined (_PPC_) +#error The STACKFRAME initialization in afsd_printStack() for this platform +#error must be properly configured +#else + s.AddrPC.Offset = c->Eip; + s.AddrPC.Mode = AddrModeFlat; + s.AddrFrame.Offset = c->Ebp; + s.AddrFrame.Mode = AddrModeFlat; +#endif + + memset( pSym, '\0', sizeof (IMAGEHLP_SYMBOL) + MAXNAMELEN ); + pSym->SizeOfStruct = sizeof (IMAGEHLP_SYMBOL); + pSym->MaxNameLength = MAXNAMELEN; + + memset( &Line, '\0', sizeof Line ); + Line.SizeOfStruct = sizeof Line; + + memset( &Module, '\0', sizeof Module ); + Module.SizeOfStruct = sizeof Module; + + offset = 0; + + afsi_log("\n--# FV EIP----- RetAddr- FramePtr StackPtr Symbol" ); + + for ( frameNum = 0; ; ++ frameNum ) + { + /* + * get next stack frame (StackWalk(), SymFunctionTableAccess(), + * SymGetModuleBase()). if this returns ERROR_INVALID_ADDRESS (487) or + * ERROR_NOACCESS (998), you can assume that either you are done, or + * that the stack is so hosed that the next deeper frame could not be + * found. + */ + if ( ! StackWalk( IMAGE_FILE_MACHINE_I386, hProcess, hThread, &s, c, + NULL, SymFunctionTableAccess, SymGetModuleBase, + NULL ) ) + break; + + /* display its contents */ + afsi_log("\n%3d %c%c %08lx %08lx %08lx %08lx ", + frameNum, s.Far? 'F': '.', s.Virtual? 'V': '.', + s.AddrPC.Offset, s.AddrReturn.Offset, + s.AddrFrame.Offset, s.AddrStack.Offset ); + + if ( s.AddrPC.Offset == 0 ) + { + afsi_log("(-nosymbols- PC == 0)" ); + } + else + { + /* show procedure info from a valid PC */ + if (!SymGetSymFromAddr(hProcess, s.AddrPC.Offset, &offset, pSym)) + { + if ( GetLastError() != ERROR_INVALID_ADDRESS ) + { + afsi_log("SymGetSymFromAddr(): errno = %lu", + GetLastError()); + } + } + else + { + UnDecorateSymbolName(pSym->Name, functionName, MAXNAMELEN, + UNDNAME_NAME_ONLY); + afsi_log("%s", functionName ); + + if ( offset != 0 ) + { + afsi_log(" %+ld bytes", (long) offset); + } + } + + if (!SymGetLineFromAddr(hProcess, s.AddrPC.Offset, &offset, &Line)) + { + if (GetLastError() != ERROR_INVALID_ADDRESS) + { + afsi_log("Error: SymGetLineFromAddr(): errno = %lu", + GetLastError()); + } + } + else + { + afsi_log(" Line: %s(%lu) %+ld bytes", Line.FileName, + Line.LineNumber, offset); + } + } + + /* no return address means no deeper stackframe */ + if (s.AddrReturn.Offset == 0) + { + SetLastError(0); + break; + } + } + + if (GetLastError() != 0) + { + afsi_log("\nStackWalk(): errno = %lu\n", GetLastError()); + } + + SymCleanup(hProcess); + GlobalFree(pSym); +} + +#ifdef _DEBUG +static DWORD *afsd_crtDbgBreakCurrent = NULL; +static DWORD afsd_crtDbgBreaks[256]; +#endif + +LONG __stdcall afsd_ExceptionFilter(EXCEPTION_POINTERS *ep) +{ + CONTEXT context; +#ifdef _DEBUG + BOOL allocRequestBrk = FALSE; +#endif + + afsi_log("UnhandledException : code : 0x%x, address: 0x%x\n", + ep->ExceptionRecord->ExceptionCode, + ep->ExceptionRecord->ExceptionAddress); + +#ifdef _DEBUG + if (afsd_crtDbgBreakCurrent && + *afsd_crtDbgBreakCurrent == _CrtSetBreakAlloc(*afsd_crtDbgBreakCurrent)) + { + allocRequestBrk = TRUE; + afsi_log("Breaking on alloc request # %d\n", *afsd_crtDbgBreakCurrent); + } +#endif + + /* save context if we want to print the stack information */ + context = *ep->ContextRecord; + + afsd_printStack(GetCurrentThread(), &context); + + if (ep->ExceptionRecord->ExceptionCode == EXCEPTION_BREAKPOINT) + { + afsi_log("\nEXCEPTION_BREAKPOINT - continue execution ...\n"); + +#ifdef _DEBUG + if (allocRequestBrk) + { + afsd_crtDbgBreakCurrent++; + _CrtSetBreakAlloc(*afsd_crtDbgBreakCurrent); + } +#endif + + ep->ContextRecord->Eip++; + return EXCEPTION_CONTINUE_EXECUTION; + } + else + { + return EXCEPTION_CONTINUE_SEARCH; + } +} + +void afsd_SetUnhandledExceptionFilter() +{ + SetUnhandledExceptionFilter(afsd_ExceptionFilter); +} + +#ifdef _DEBUG +void afsd_DbgBreakAllocInit() +{ + memset(afsd_crtDbgBreaks, -1, sizeof(afsd_crtDbgBreaks)); + afsd_crtDbgBreakCurrent = afsd_crtDbgBreaks; +} + +void afsd_DbgBreakAdd(DWORD requestNumber) +{ + int i; + for (i = 0; i < sizeof(afsd_crtDbgBreaks) - 1; i++) + { + if (afsd_crtDbgBreaks[i] == -1) + { + break; + } + } + afsd_crtDbgBreaks[i] = requestNumber; + + _CrtSetBreakAlloc(afsd_crtDbgBreaks[0]); +} +#endif diff --git a/src/WINNT/afsd/afsd_init.h b/src/WINNT/afsd/afsd_init.h index 803facc3a..123bd385b 100644 --- a/src/WINNT/afsd/afsd_init.h +++ b/src/WINNT/afsd/afsd_init.h @@ -17,8 +17,8 @@ int afsd_InitCM(char **reasonP, struct cmd_syndesc *as, char *arock); int afsd_InitSMB(char **reasonP); #endif /* !DJGPP */ int afsd_InitDaemons(char **reasonP); - void afsd_ForceTrace(BOOL flush); +void afsd_SetUnhandledExceptionFilter(); extern char cm_HostName[]; - +extern char cm_NetbiosName[]; diff --git a/src/WINNT/afsd/afsd_service.c b/src/WINNT/afsd/afsd_service.c index 69419ca41..4291b1c11 100644 --- a/src/WINNT/afsd/afsd_service.c +++ b/src/WINNT/afsd/afsd_service.c @@ -24,26 +24,42 @@ #ifdef DEBUG //#define NOTSERVICE #endif +#ifdef _DEBUG +#include +#endif + +/* +// The following is defined if you want to receive Power notifications, +// including Hibernation, and also subsequent flushing of AFS volumes +// +#define REGISTER_POWER_NOTIFICATIONS +// +// Check +*/ +#include "afsd_flushvol.h" extern void afsi_log(char *pattern, ...); -extern char AFSConfigKeyName[]; +HANDLE hAFSDMainThread = NULL; HANDLE WaitToTerminate; int GlobalStatus; +#ifdef JUMP unsigned int MainThreadId; jmp_buf notifier_jmp; +#endif /* JUMP */ extern int traceOnPanic; +extern HANDLE afsi_file; /* * Notifier function for use by osi_panic */ static void afsd_notifier(char *msgp, char *filep, long line) { - char tbuffer[100]; + char tbuffer[512]; char *ptbuf[1]; HANDLE h; @@ -64,22 +80,31 @@ static void afsd_notifier(char *msgp, char *filep, long line) afsd_ForceTrace(TRUE); - if (traceOnPanic) { - _asm int 3h; - } + afsi_log("--- begin dump ---"); + cm_DumpSCache(afsi_file, "a"); +#ifdef keisa + cm_dnlcDump(afsi_file, "a"); +#endif + cm_DumpBufHashTable(afsi_file, "a"); + smb_DumpVCP(afsi_file, "a"); + afsi_log("--- end dump ---"); + + DebugBreak(); SetEvent(WaitToTerminate); +#ifdef JUMP if (GetCurrentThreadId() == MainThreadId) longjmp(notifier_jmp, 1); else +#endif /* JUMP */ ExitThread(1); } /* * For use miscellaneously in smb.c; need to do better */ -static int DummyMessageBox(HWND h, LPCTSTR l1, LPCTSTR l2, UINT ui) +static int _stdcall DummyMessageBox(HWND h, LPCTSTR l1, LPCTSTR l2, UINT ui) { return 0; } @@ -87,7 +112,44 @@ static int DummyMessageBox(HWND h, LPCTSTR l1, LPCTSTR l2, UINT ui) static SERVICE_STATUS ServiceStatus; static SERVICE_STATUS_HANDLE StatusHandle; -void afsd_ServiceControlHandler(DWORD ctrlCode) +DWORD +afsd_ServiceFlushVolume(DWORD dwlpEventData) +{ + DWORD dwRet = ERROR_NETWORK_BUSY; /* or NO_ERROR */ + + /* + ** If UI bit is not set, user interaction is not possible + ** BUT, since we are a NON-interactive service, and therefore + ** have NO user I/O, it doesn't much matter. + ** This benign code left here as example of how to find this out + */ + BOOL bUI = (dwlpEventData & 1); + + /* flush volume */ + if ( PowerNotificationThreadNotify() ) + { + dwRet = NO_ERROR; + } + + else + { + /* flush was unsuccessful, or timeout - deny shutdown */ + dwRet = ERROR_NETWORK_BUSY; + } + + /* to deny hibernate, simply return + // any value besides NO_ERROR. + // For example: + // dwRet = ERROR_NETWORK_BUSY; + */ + + return dwRet; +} + + +/* service control handler used in nt4 only for backward compat. */ +VOID WINAPI +afsd_ServiceControlHandler(DWORD ctrlCode) { HKEY parmKey; DWORD dummyLen, doTrace; @@ -137,51 +199,150 @@ doneTrace: } } -#if 1 -/* This code was moved to Drivemap.cpp*/ -/* Mount a drive into AFS if the user wants us to */ + +/* +** Extended ServiceControlHandler that provides Event types +** for monitoring Power events, for example. +*/ +DWORD WINAPI +afsd_ServiceControlHandlerEx( + DWORD ctrlCode, + DWORD dwEventType, + LPVOID lpEventData, + LPVOID lpContext + ) +{ + HKEY parmKey; + DWORD dummyLen, doTrace; + long code; + DWORD dwRet = ERROR_CALL_NOT_IMPLEMENTED; + + switch (ctrlCode) + { + case SERVICE_CONTROL_STOP: + /* Shutdown RPC */ + RpcMgmtStopServerListening(NULL); + + /* Force trace if requested */ + code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, + AFSConfigKeyName, + 0, KEY_QUERY_VALUE, &parmKey); + if (code != ERROR_SUCCESS) + goto doneTrace; + + dummyLen = sizeof(doTrace); + code = RegQueryValueEx(parmKey, "TraceOnShutdown", + NULL, NULL, + (BYTE *) &doTrace, &dummyLen); + RegCloseKey (parmKey); + if (code != ERROR_SUCCESS) + doTrace = 0; + if (doTrace) + afsd_ForceTrace(FALSE); + + doneTrace: + ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING; + ServiceStatus.dwWin32ExitCode = NO_ERROR; + ServiceStatus.dwCheckPoint = 1; + ServiceStatus.dwWaitHint = 10000; + ServiceStatus.dwControlsAccepted = 0; + SetServiceStatus(StatusHandle, &ServiceStatus); + SetEvent(WaitToTerminate); + dwRet = NO_ERROR; + break; + + case SERVICE_CONTROL_INTERROGATE: + ServiceStatus.dwCurrentState = SERVICE_RUNNING; + ServiceStatus.dwWin32ExitCode = NO_ERROR; + ServiceStatus.dwCheckPoint = 0; + ServiceStatus.dwWaitHint = 0; + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_POWEREVENT; + SetServiceStatus(StatusHandle, &ServiceStatus); + dwRet = NO_ERROR; + break; + + /* XXX handle system shutdown */ + /* XXX handle pause & continue */ + case SERVICE_CONTROL_POWEREVENT: + { + /* + ** dwEventType of this notification == WPARAM of WM_POWERBROADCAST + ** Return NO_ERROR == return TRUE for that message, i.e. accept request + ** Return any error code to deny request, + ** i.e. as if returning BROADCAST_QUERY_DENY + */ + switch((int) dwEventType) + { + case PBT_APMQUERYSUSPEND: + case PBT_APMQUERYSTANDBY: + +#ifdef REGISTER_POWER_NOTIFICATIONS + /* handle event */ + dwRet = afsd_ServiceFlushVolume((DWORD) lpEventData); +#else + dwRet = NO_ERROR; +#endif + break; + + /* allow remaining case PBT_WhatEver */ + case PBT_APMSUSPEND: + case PBT_APMSTANDBY: + case PBT_APMRESUMECRITICAL: + case PBT_APMRESUMESUSPEND: + case PBT_APMRESUMESTANDBY: + case PBT_APMBATTERYLOW: + case PBT_APMPOWERSTATUSCHANGE: + case PBT_APMOEMEVENT: + case PBT_APMRESUMEAUTOMATIC: + default: + dwRet = NO_ERROR; + } + } + } /* end switch(ctrlCode) */ + return dwRet; +} + +/* There is similar code in client_config\drivemap.cpp GlobalMountDrive() + * + * Mount a drive into AFS if there global mapping + */ /* DEE Could check first if we are run as SYSTEM */ -void CheckMountDrive() +static void MountGlobalDrives() { - char szAfsPath[_MAX_PATH]; - char szDriveToMapTo[5]; - DWORD dwResult; - char szKeyName[256]; - HKEY hKey; - DWORD dwIndex = 0; - DWORD dwDriveSize; - DWORD dwSubMountSize; - char szSubMount[256]; - DWORD dwType; - - sprintf(szKeyName, "%s\\GlobalAutoMapper", AFSConfigKeyName); + char szAfsPath[_MAX_PATH]; + char szDriveToMapTo[5]; + DWORD dwResult; + char szKeyName[256]; + HKEY hKey; + DWORD dwIndex = 0; + DWORD dwDriveSize; + DWORD dwSubMountSize; + char szSubMount[256]; + DWORD dwType; + + sprintf(szKeyName, "%s\\GlobalAutoMapper", AFSConfigKeyName); dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_QUERY_VALUE, &hKey); if (dwResult != ERROR_SUCCESS) - return; - - while (1) { - dwDriveSize = sizeof(szDriveToMapTo); - dwSubMountSize = sizeof(szSubMount); - dwResult = RegEnumValue(hKey, dwIndex++, szDriveToMapTo, &dwDriveSize, 0, &dwType, szSubMount, &dwSubMountSize); - if (dwResult != ERROR_MORE_DATA) { - if (dwResult != ERROR_SUCCESS) { - if (dwResult != ERROR_NO_MORE_ITEMS) - afsi_log("Failed to read GlobalAutoMapper values: %d\n", dwResult); - break; - } - } - -#if 0 - sprintf(szAfsPath, "\\Device\\LanmanRedirector\\%s\\%s-AFS\\%s", szDriveToMapTo, cm_HostName, szSubMount); - - dwResult = DefineDosDevice(DDD_RAW_TARGET_PATH, szDriveToMapTo, szAfsPath); -#else + return; + + while (1) { + dwDriveSize = sizeof(szDriveToMapTo); + dwSubMountSize = sizeof(szSubMount); + dwResult = RegEnumValue(hKey, dwIndex++, szDriveToMapTo, &dwDriveSize, 0, &dwType, szSubMount, &dwSubMountSize); + if (dwResult != ERROR_MORE_DATA) { + if (dwResult != ERROR_SUCCESS) { + if (dwResult != ERROR_NO_MORE_ITEMS) + afsi_log("Failed to read GlobalAutoMapper values: %d\n", dwResult); + break; + } + } + { NETRESOURCE nr; memset (&nr, 0x00, sizeof(NETRESOURCE)); - sprintf(szAfsPath,"\\\\%s-AFS\\%s",cm_HostName,szSubMount); + sprintf(szAfsPath,"\\\\%s\\%s",cm_NetbiosName,szSubMount); nr.dwScope = RESOURCE_GLOBALNET; nr.dwType=RESOURCETYPE_DISK; @@ -192,128 +353,296 @@ void CheckMountDrive() dwResult = WNetAddConnection2(&nr,NULL,NULL,FALSE); } -#endif - afsi_log("GlobalAutoMap of %s to %s %s", szDriveToMapTo, szSubMount, dwResult ? "succeeded" : "failed"); - } + afsi_log("GlobalAutoMap of %s to %s %s", szDriveToMapTo, szSubMount, dwResult ? "succeeded" : "failed"); + } - RegCloseKey(hKey); + RegCloseKey(hKey); } -#endif -void afsd_Main() +static void DismountGlobalDrives() +{ + char szAfsPath[_MAX_PATH]; + char szDriveToMapTo[5]; + DWORD dwResult; + char szKeyName[256]; + HKEY hKey; + DWORD dwIndex = 0; + DWORD dwDriveSize; + DWORD dwSubMountSize; + char szSubMount[256]; + DWORD dwType; + + sprintf(szKeyName, "%s\\GlobalAutoMapper", AFSConfigKeyName); + + dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_QUERY_VALUE, &hKey); + if (dwResult != ERROR_SUCCESS) + return; + + while (1) { + dwDriveSize = sizeof(szDriveToMapTo); + dwSubMountSize = sizeof(szSubMount); + dwResult = RegEnumValue(hKey, dwIndex++, szDriveToMapTo, &dwDriveSize, 0, &dwType, szSubMount, &dwSubMountSize); + if (dwResult != ERROR_MORE_DATA) { + if (dwResult != ERROR_SUCCESS) { + if (dwResult != ERROR_NO_MORE_ITEMS) + afsi_log("Failed to read GlobalAutoMapper values: %d\n", dwResult); + break; + } + } + + sprintf(szAfsPath,"\\\\%s\\%s",cm_NetbiosName,szSubMount); + + dwResult = WNetCancelConnection(szAfsPath, TRUE); + + afsi_log("Disconnect from GlobalAutoMap of %s to %s %s", szDriveToMapTo, szSubMount, dwResult ? "succeeded" : "failed"); + } + + RegCloseKey(hKey); +} + +typedef BOOL ( APIENTRY * AfsdInitHook )(void); +#define AFSD_INIT_HOOK "AfsdInitHook" +#define AFSD_HOOK_DLL "afsdhook.dll" + +/* +control serviceex exists only on 2000/xp. These functions will be loaded dynamically. +*/ + +typedef SERVICE_STATUS_HANDLE ( * RegisterServiceCtrlHandlerExFunc )( LPCTSTR , LPHANDLER_FUNCTION_EX , LPVOID ); +typedef SERVICE_STATUS_HANDLE ( * RegisterServiceCtrlHandlerFunc )( LPCTSTR , LPHANDLER_FUNCTION ); + +RegisterServiceCtrlHandlerExFunc pRegisterServiceCtrlHandlerEx = NULL; +RegisterServiceCtrlHandlerFunc pRegisterServiceCtrlHandler = NULL; + +void afsd_Main(DWORD argc, LPTSTR *argv) { long code; char *reason; +#ifdef JUMP int jmpret; +#endif /* JUMP */ + HANDLE hInitHookDll; + HANDLE hAdvApi32; + AfsdInitHook initHook; - osi_InitPanic(afsd_notifier); +#ifdef _DEBUG + _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF /*| _CRTDBG_CHECK_ALWAYS_DF*/ | + _CRTDBG_CHECK_CRT_DF /* | _CRTDBG_DELAY_FREE_MEM_DF */ ); +#endif + + osi_InitPanic(afsd_notifier); osi_InitTraceOption(); GlobalStatus = 0; - WaitToTerminate = CreateEvent(NULL, TRUE, FALSE, NULL); + afsi_start(); + + WaitToTerminate = CreateEvent(NULL, TRUE, FALSE, TEXT("afsd_service_WaitToTerminate")); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) + afsi_log("Event Object Already Exists: %s", TEXT("afsd_service_WaitToTerminate")); #ifndef NOTSERVICE - StatusHandle = RegisterServiceCtrlHandler(AFS_DAEMON_SERVICE_NAME, - (LPHANDLER_FUNCTION) afsd_ServiceControlHandler); + hAdvApi32 = LoadLibrary("advapi32.dll"); + if (hAdvApi32 == NULL) + { + afsi_log("Fatal: cannot load advapi32.dll"); + return; + } + + pRegisterServiceCtrlHandlerEx = (RegisterServiceCtrlHandlerExFunc)GetProcAddress(hAdvApi32, "RegisterServiceCtrlHandlerExA"); + if (pRegisterServiceCtrlHandlerEx) + { + afsi_log("running on 2000+ - using RegisterServiceCtrlHandlerEx"); + StatusHandle = RegisterServiceCtrlHandlerEx(AFS_DAEMON_SERVICE_NAME, afsd_ServiceControlHandlerEx, NULL ); + } + else + { + StatusHandle = RegisterServiceCtrlHandler(AFS_DAEMON_SERVICE_NAME, afsd_ServiceControlHandler); + } ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; ServiceStatus.dwServiceSpecificExitCode = 0; ServiceStatus.dwCurrentState = SERVICE_START_PENDING; ServiceStatus.dwWin32ExitCode = NO_ERROR; ServiceStatus.dwCheckPoint = 1; - ServiceStatus.dwWaitHint = 15000; - ServiceStatus.dwControlsAccepted = 0; + ServiceStatus.dwWaitHint = 30000; + /* accept Power Events */ + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_POWEREVENT; SetServiceStatus(StatusHandle, &ServiceStatus); #endif -{ - HANDLE h; char *ptbuf[1]; - h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); - ptbuf[0] = "AFS start pending"; - ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL); - DeregisterEventSource(h); -} - afsi_start(); + { + HANDLE h; char *ptbuf[1]; + h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); + ptbuf[0] = "AFS start pending"; + ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL); + DeregisterEventSource(h); + } + +#ifdef REGISTER_POWER_NOTIFICATIONS + /* create thread used to flush cache */ + PowerNotificationThreadCreate(); +#endif - MainThreadId = GetCurrentThreadId(); + /* allow an exit to be called prior to any initialization */ + hInitHookDll = LoadLibrary(AFSD_HOOK_DLL); + if (hInitHookDll) + { + BOOL hookRc = FALSE; + initHook = ( AfsdInitHook ) GetProcAddress(hInitHookDll, AFSD_INIT_HOOK); + if (initHook) + { + hookRc = initHook(); + } + FreeLibrary(hInitHookDll); + hInitHookDll = NULL; + + if (hookRc == FALSE) + { + ServiceStatus.dwCurrentState = SERVICE_STOPPED; + ServiceStatus.dwWin32ExitCode = NO_ERROR; + ServiceStatus.dwCheckPoint = 0; + ServiceStatus.dwWaitHint = 0; + ServiceStatus.dwControlsAccepted = 0; + SetServiceStatus(StatusHandle, &ServiceStatus); + + /* exit if initialization failed */ + return; + } + else + { + /* allow another 15 seconds to start */ + ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + ServiceStatus.dwServiceSpecificExitCode = 0; + ServiceStatus.dwCurrentState = SERVICE_START_PENDING; + ServiceStatus.dwWin32ExitCode = NO_ERROR; + ServiceStatus.dwCheckPoint = 2; + ServiceStatus.dwWaitHint = 20000; + /* accept Power Events */ + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_POWEREVENT; + SetServiceStatus(StatusHandle, &ServiceStatus); + } + } + +#ifdef JUMP + MainThreadId = GetCurrentThreadId(); jmpret = setjmp(notifier_jmp); - if (jmpret == 0) { + if (jmpret == 0) +#endif /* JUMP */ + { code = afsd_InitCM(&reason); - if (code != 0) + if (code != 0) { + afsi_log("afsd_InitCM failed: %s (code = %d)", reason, code); osi_panic(reason, __FILE__, __LINE__); + } +#ifndef NOTSERVICE + ServiceStatus.dwCheckPoint++; + ServiceStatus.dwWaitHint -= 5000; + SetServiceStatus(StatusHandle, &ServiceStatus); +#endif code = afsd_InitDaemons(&reason); - if (code != 0) + if (code != 0) { + afsi_log("afsd_InitDaemons failed: %s (code = %d)", reason, code); osi_panic(reason, __FILE__, __LINE__); + } - code = afsd_InitSMB(&reason, DummyMessageBox); - if (code != 0) +#ifndef NOTSERVICE + ServiceStatus.dwCheckPoint++; + ServiceStatus.dwWaitHint -= 5000; + SetServiceStatus(StatusHandle, &ServiceStatus); +#endif + code = afsd_InitSMB(&reason, MessageBox); + if (code != 0) { + afsi_log("afsd_InitSMB failed: %s (code = %d)", reason, code); osi_panic(reason, __FILE__, __LINE__); + } + + MountGlobalDrives(); #ifndef NOTSERVICE ServiceStatus.dwCurrentState = SERVICE_RUNNING; ServiceStatus.dwWin32ExitCode = NO_ERROR; ServiceStatus.dwCheckPoint = 0; ServiceStatus.dwWaitHint = 0; - ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP; + + /* accept Power events */ + ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_POWEREVENT; SetServiceStatus(StatusHandle, &ServiceStatus); #endif - { - HANDLE h; char *ptbuf[1]; + { + HANDLE h; char *ptbuf[1]; h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); ptbuf[0] = "AFS running"; ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL); DeregisterEventSource(h); - } + } } - /* Check if we should mount a drive into AFS */ - CheckMountDrive(); - WaitForSingleObject(WaitToTerminate, INFINITE); - -{ - HANDLE h; char *ptbuf[1]; + + { + HANDLE h; char *ptbuf[1]; h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); ptbuf[0] = "AFS quitting"; - ReportEvent(h, - GlobalStatus ? EVENTLOG_ERROR_TYPE : EVENTLOG_INFORMATION_TYPE, - 0, 0, NULL, 1, 0, ptbuf, NULL); - DeregisterEventSource(h); -} + ReportEvent(h, GlobalStatus ? EVENTLOG_ERROR_TYPE : EVENTLOG_INFORMATION_TYPE, + 0, 0, NULL, 1, 0, ptbuf, NULL); + DeregisterEventSource(h); + } + + DismountGlobalDrives(); + smb_Shutdown(); + rx_Finalize(); + +#ifdef REGISTER_POWER_NOTIFICATIONS + /* terminate thread used to flush cache */ + PowerNotificationThreadExit(); +#endif - ServiceStatus.dwCurrentState = SERVICE_STOPPED; - ServiceStatus.dwWin32ExitCode = NO_ERROR; + /* Remove the ExceptionFilter */ + SetUnhandledExceptionFilter(NULL); + + ServiceStatus.dwCurrentState = SERVICE_STOPPED; + ServiceStatus.dwWin32ExitCode = GlobalStatus ? ERROR_EXCEPTION_IN_SERVICE : NO_ERROR; ServiceStatus.dwCheckPoint = 0; ServiceStatus.dwWaitHint = 0; - ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP; + ServiceStatus.dwControlsAccepted = 0; SetServiceStatus(StatusHandle, &ServiceStatus); } -#ifdef NOTSERVICE -void main() +DWORD __stdcall afsdMain_thread(void* notUsed) { - afsd_Main(); - Sleep(1000); - return ; + char * argv[2] = {AFS_DAEMON_SERVICE_NAME, NULL}; + afsd_Main(1, (LPTSTR*)argv); + return(0); } -#else -#ifdef _CRTAPI1 -void _CRTAPI1 main(void) -#else -void main() -#endif +int +main(void) { - LONG status = ERROR_SUCCESS; - SERVICE_TABLE_ENTRY dispatchTable[] = { + static SERVICE_TABLE_ENTRY dispatchTable[] = { {AFS_DAEMON_SERVICE_NAME, (LPSERVICE_MAIN_FUNCTION) afsd_Main}, {NULL, NULL} }; if (!StartServiceCtrlDispatcher(dispatchTable)) - status = GetLastError(); + { + LONG status = GetLastError(); + if (status == ERROR_FAILED_SERVICE_CONTROLLER_CONNECT) + { + DWORD tid; + hAFSDMainThread = CreateThread(NULL, 0, afsdMain_thread, 0, 0, &tid); + + printf("Hit to terminate OpenAFS Client Service\n"); + getchar(); + SetEvent(WaitToTerminate); + } + } + + if ( hAFSDMainThread ) { + WaitForSingleObject( hAFSDMainThread, INFINITE ); + CloseHandle( hAFSDMainThread ); + } + return(0); } -#endif diff --git a/src/WINNT/afsd/afskfw-int.h b/src/WINNT/afsd/afskfw-int.h new file mode 100644 index 000000000..329b83689 --- /dev/null +++ b/src/WINNT/afsd/afskfw-int.h @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2003 SkyRope, LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - 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. + * - Neither the name of Skyrope, LLC nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission from Skyrope, LLC. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER + * 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. + * + * Portions of this code are derived from portions of the MIT + * Leash Ticket Manager and LoadFuncs utilities. For these portions the + * following copyright applies. + * + * Copyright (c) 2003,2004 by the Massachusetts Institute of Technology. + * All rights reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + */ + +#ifndef AFSKRB5_INT_H +#define AFSKRB5_INT_H + +#include +#ifdef USE_MS2MIT +#define SECURITY_WIN32 +#include +#include +#endif /* USE_MS2MIT */ +#include +#include +#include +#include + +#ifdef USE_MS2MIT +#include +#endif /* USE_MS2MIT */ + +#include +#include + +#include + +/* Defined in the KRBV4W32 version of krb.h but not the Kerberos V version */ +/* Required for some of the loadfuncs headers */ +typedef struct ktext far *KTEXT; +typedef struct ktext far *KTEXT_FP; +#include + +/* AFS has its own version of com_err.h */ +typedef afs_int32 errcode_t; + +#include +#include +#include +#include +#include +#include +#include + +// service definitions +#define SERVICE_DLL "advapi32.dll" +typedef SC_HANDLE (WINAPI *FP_OpenSCManagerA)(char *, char *, DWORD); +typedef SC_HANDLE (WINAPI *FP_OpenServiceA)(SC_HANDLE, char *, DWORD); +typedef BOOL (WINAPI *FP_QueryServiceStatus)(SC_HANDLE, LPSERVICE_STATUS); +typedef BOOL (WINAPI *FP_CloseServiceHandle)(SC_HANDLE); + +#define KRB5_DEFAULT_LIFE 60*60*10 /* 10 hours */ +#define LSA_CCNAME "MSLSA:" + +#define KTC_ERROR 11862784L +#define KTC_TOOBIG 11862785L +#define KTC_INVAL 11862786L +#define KTC_NOENT 11862787L +#define KTC_PIOCTLFAIL 11862788L +#define KTC_NOPIOCTL 11862789L +#define KTC_NOCELL 11862790L +#define KTC_NOCM 11862791L + +/* User Query data structures and functions */ + +struct textField { + char * buf; /* Destination buffer address */ + int len; /* Destination buffer length */ + char * label; /* Label for this field */ + char * def; /* Default response for this field */ + int echo; /* 0 = no, 1 = yes, 2 = asterisks */ +}; + +#define ID_TEXT 150 +#define ID_MID_TEXT 300 + +struct principal_ccache_data { + struct principal_ccache_data * next; + char * principal; + char * ccache_name; + int from_lsa; + int expired; + int expiration_time; + int renew; +}; + +struct cell_principal_map { + struct cell_principal_map * next; + char * cell; + char * principal; + int active; +}; + +/* In order to avoid including the private CCAPI headers */ +typedef int cc_int32; + +#define CC_API_VER_1 1 +#define CC_API_VER_2 2 + +#define CCACHE_API cc_int32 + +/* +** The Official Error Codes +*/ +#define CC_NOERROR 0 +#define CC_BADNAME 1 +#define CC_NOTFOUND 2 +#define CC_END 3 +#define CC_IO 4 +#define CC_WRITE 5 +#define CC_NOMEM 6 +#define CC_FORMAT 7 +#define CC_LOCKED 8 +#define CC_BAD_API_VERSION 9 +#define CC_NO_EXIST 10 +#define CC_NOT_SUPP 11 +#define CC_BAD_PARM 12 +#define CC_ERR_CACHE_ATTACH 13 +#define CC_ERR_CACHE_RELEASE 14 +#define CC_ERR_CACHE_FULL 15 +#define CC_ERR_CRED_VERSION 16 + +enum { + CC_CRED_VUNKNOWN = 0, // For validation + CC_CRED_V4 = 1, + CC_CRED_V5 = 2, + CC_CRED_VMAX = 3 // For validation +}; + +typedef struct opaque_dll_control_block_type* apiCB; +typedef struct _infoNC { + char* name; + char* principal; + cc_int32 vers; +} infoNC; + +TYPEDEF_FUNC( +CCACHE_API, +CALLCONV_C, +cc_initialize, + ( + apiCB** cc_ctx, // < DLL's primary control structure. + // returned here, passed everywhere else + cc_int32 api_version, // > ver supported by caller (use CC_API_VER_1) + cc_int32* api_supported, // < if ~NULL, max ver supported by DLL + const char** vendor // < if ~NULL, vendor name in read only C string + ) +); + +TYPEDEF_FUNC( +CCACHE_API, +CALLCONV_C, +cc_shutdown, + ( + apiCB** cc_ctx // <> DLL's primary control structure. NULL after + ) +); + +TYPEDEF_FUNC( +CCACHE_API, +CALLCONV_C, +cc_get_NC_info, + ( + apiCB* cc_ctx, // > DLL's primary control structure + struct _infoNC*** ppNCi // < (NULL before call) null terminated, + // list of a structs (free via cc_free_infoNC()) + ) +); + +TYPEDEF_FUNC( +CCACHE_API, +CALLCONV_C, +cc_free_NC_info, + ( + apiCB* cc_ctx, + struct _infoNC*** ppNCi // < free list of structs returned by + // cc_get_cache_names(). set to NULL on return + ) +); +#define CCAPI_DLL "krbcc32.dll" + +/* Function Prototypes */ +DWORD GetServiceStatus(LPSTR, LPSTR, DWORD *); +void KFW_AFS_error(LONG, LPCSTR); + +void UnloadFuncs(FUNC_INFO [], HINSTANCE); +int LoadFuncs(const char*, FUNC_INFO [], HINSTANCE*, int*, int, int, int); +int KFW_get_ccache(krb5_context, krb5_principal, krb5_ccache *); +int KFW_error(krb5_error_code, LPCSTR, int, krb5_context *, krb5_ccache *); +int KFW_kinit(krb5_context, krb5_ccache, HWND, char *, char *, krb5_deltat, + DWORD, DWORD, krb5_deltat, DWORD, DWORD); +int KFW_renew(krb5_context, krb5_ccache); +int KFW_destroy(krb5_context, krb5_ccache); +BOOL KFW_ms2mit(krb5_context, krb5_ccache, BOOL); +int KFW_AFS_unlog(void); +int KFW_AFS_klog(krb5_context, krb5_ccache, char*, char*, char*, int, char*); +void KFW_import_ccache_data(void); +BOOL MSLSA_IsKerberosLogon(); +char *afs_realm_of_cell(struct afsconf_cell *); +#endif /* AFSKFW_INT_H */ diff --git a/src/WINNT/afsd/afskfw.c b/src/WINNT/afsd/afskfw.c new file mode 100644 index 000000000..d03dc24f7 --- /dev/null +++ b/src/WINNT/afsd/afskfw.c @@ -0,0 +1,3204 @@ +/* + * Copyright (c) 2003 SkyRope, LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - 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. + * - Neither the name of Skyrope, LLC nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission from Skyrope, LLC. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER + * 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. + * + * Portions of this code are derived from portions of the MIT + * Leash Ticket Manager and LoadFuncs utilities. For these portions the + * following copyright applies. + * + * Copyright (c) 2003,2004 by the Massachusetts Institute of Technology. + * All rights reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + */ + + +#define USE_MS2MIT +#define USE_KRB4 +#include "afskfw-int.h" +#include "afskfw.h" + +#include +#include /* for life_to_time */ + +/* + * TIMING _____________________________________________________________________ + * + */ + +#define cminREMIND_TEST 1 // test every minute for expired creds +#define cminREMIND_WARN 15 // warn if creds expire in 15 minutes +#define cminRENEW 20 // renew creds when there are 20 minutes remaining +#define cminMINLIFE 30 // minimum life of Kerberos creds + +#define c100ns1SECOND (LONGLONG)10000000 +#define cmsec1SECOND 1000 +#define cmsec1MINUTE 60000 +#define csec1MINUTE 60 + +/* Function Pointer Declarations for Delayed Loading */ +// CCAPI +DECL_FUNC_PTR(cc_initialize); +DECL_FUNC_PTR(cc_shutdown); +DECL_FUNC_PTR(cc_get_NC_info); +DECL_FUNC_PTR(cc_free_NC_info); + +// leash functions +DECL_FUNC_PTR(Leash_get_default_lifetime); +DECL_FUNC_PTR(Leash_get_default_forwardable); +DECL_FUNC_PTR(Leash_get_default_renew_till); +DECL_FUNC_PTR(Leash_get_default_noaddresses); +DECL_FUNC_PTR(Leash_get_default_proxiable); +DECL_FUNC_PTR(Leash_get_default_publicip); +DECL_FUNC_PTR(Leash_get_default_use_krb4); +DECL_FUNC_PTR(Leash_get_default_life_min); +DECL_FUNC_PTR(Leash_get_default_life_max); +DECL_FUNC_PTR(Leash_get_default_renew_min); +DECL_FUNC_PTR(Leash_get_default_renew_max); +DECL_FUNC_PTR(Leash_get_default_renewable); + +// krb5 functions +DECL_FUNC_PTR(krb5_change_password); +DECL_FUNC_PTR(krb5_get_init_creds_opt_init); +DECL_FUNC_PTR(krb5_get_init_creds_opt_set_tkt_life); +DECL_FUNC_PTR(krb5_get_init_creds_opt_set_renew_life); +DECL_FUNC_PTR(krb5_get_init_creds_opt_set_forwardable); +DECL_FUNC_PTR(krb5_get_init_creds_opt_set_proxiable); +DECL_FUNC_PTR(krb5_get_init_creds_opt_set_address_list); +DECL_FUNC_PTR(krb5_get_init_creds_password); +DECL_FUNC_PTR(krb5_build_principal_ext); +DECL_FUNC_PTR(krb5_cc_get_name); +DECL_FUNC_PTR(krb5_cc_resolve); +DECL_FUNC_PTR(krb5_cc_default); +DECL_FUNC_PTR(krb5_cc_default_name); +DECL_FUNC_PTR(krb5_cc_set_default_name); +DECL_FUNC_PTR(krb5_cc_initialize); +DECL_FUNC_PTR(krb5_cc_destroy); +DECL_FUNC_PTR(krb5_cc_close); +DECL_FUNC_PTR(krb5_cc_store_cred); +DECL_FUNC_PTR(krb5_cc_copy_creds); +DECL_FUNC_PTR(krb5_cc_retrieve_cred); +DECL_FUNC_PTR(krb5_cc_get_principal); +DECL_FUNC_PTR(krb5_cc_start_seq_get); +DECL_FUNC_PTR(krb5_cc_next_cred); +DECL_FUNC_PTR(krb5_cc_end_seq_get); +DECL_FUNC_PTR(krb5_cc_remove_cred); +DECL_FUNC_PTR(krb5_cc_set_flags); +DECL_FUNC_PTR(krb5_cc_get_type); +DECL_FUNC_PTR(krb5_free_context); +DECL_FUNC_PTR(krb5_free_cred_contents); +DECL_FUNC_PTR(krb5_free_principal); +DECL_FUNC_PTR(krb5_get_in_tkt_with_password); +DECL_FUNC_PTR(krb5_init_context); +DECL_FUNC_PTR(krb5_parse_name); +DECL_FUNC_PTR(krb5_timeofday); +DECL_FUNC_PTR(krb5_timestamp_to_sfstring); +DECL_FUNC_PTR(krb5_unparse_name); +DECL_FUNC_PTR(krb5_get_credentials); +DECL_FUNC_PTR(krb5_mk_req); +DECL_FUNC_PTR(krb5_sname_to_principal); +DECL_FUNC_PTR(krb5_get_credentials_renew); +DECL_FUNC_PTR(krb5_free_data); +DECL_FUNC_PTR(krb5_free_data_contents); +DECL_FUNC_PTR(krb5_free_unparsed_name); +DECL_FUNC_PTR(krb5_os_localaddr); +DECL_FUNC_PTR(krb5_copy_keyblock_contents); +DECL_FUNC_PTR(krb5_copy_data); +DECL_FUNC_PTR(krb5_free_creds); +DECL_FUNC_PTR(krb5_build_principal); +DECL_FUNC_PTR(krb5_get_renewed_creds); +DECL_FUNC_PTR(krb5_get_default_config_files); +DECL_FUNC_PTR(krb5_free_config_files); +DECL_FUNC_PTR(krb5_get_default_realm); +DECL_FUNC_PTR(krb5_free_ticket); +DECL_FUNC_PTR(krb5_decode_ticket); +DECL_FUNC_PTR(krb5_get_host_realm); +DECL_FUNC_PTR(krb5_free_host_realm); +DECL_FUNC_PTR(krb5_free_addresses); +DECL_FUNC_PTR(krb5_c_random_make_octets); + +// Krb524 functions +DECL_FUNC_PTR(krb524_init_ets); +DECL_FUNC_PTR(krb524_convert_creds_kdc); + +// krb4 functions +DECL_FUNC_PTR(krb_get_cred); +DECL_FUNC_PTR(tkt_string); +DECL_FUNC_PTR(krb_get_tf_realm); +DECL_FUNC_PTR(krb_mk_req); + +// ComErr functions +DECL_FUNC_PTR(com_err); +DECL_FUNC_PTR(error_message); + +// Profile functions +DECL_FUNC_PTR(profile_init); +DECL_FUNC_PTR(profile_release); +DECL_FUNC_PTR(profile_get_subsection_names); +DECL_FUNC_PTR(profile_free_list); +DECL_FUNC_PTR(profile_get_string); +DECL_FUNC_PTR(profile_release_string); + +// Service functions +DECL_FUNC_PTR(OpenSCManagerA); +DECL_FUNC_PTR(OpenServiceA); +DECL_FUNC_PTR(QueryServiceStatus); +DECL_FUNC_PTR(CloseServiceHandle); +#ifdef USE_MS2MIT +DECL_FUNC_PTR(LsaNtStatusToWinError); +#endif /* USE_MS2MIT */ + +#ifdef USE_MS2MIT +// LSA Functions +DECL_FUNC_PTR(LsaConnectUntrusted); +DECL_FUNC_PTR(LsaLookupAuthenticationPackage); +DECL_FUNC_PTR(LsaCallAuthenticationPackage); +DECL_FUNC_PTR(LsaFreeReturnBuffer); +DECL_FUNC_PTR(LsaGetLogonSessionData); +#endif /* USE_MS2MIT */ + +// AFS36 Token Functions +DECL_FUNC_PTR(ktc_ListTokens); +DECL_FUNC_PTR(ktc_GetToken); +DECL_FUNC_PTR(ktc_SetToken); +DECL_FUNC_PTR(ktc_ForgetAllTokens); + +// AFS36 Config Functions +DECL_FUNC_PTR(cm_SearchCellFile); +DECL_FUNC_PTR(cm_GetRootCellName); + +// CCAPI +FUNC_INFO ccapi_fi[] = { + MAKE_FUNC_INFO(cc_initialize), + MAKE_FUNC_INFO(cc_shutdown), + MAKE_FUNC_INFO(cc_get_NC_info), + MAKE_FUNC_INFO(cc_free_NC_info), + END_FUNC_INFO +}; + +FUNC_INFO leash_fi[] = { + MAKE_FUNC_INFO(Leash_get_default_lifetime), + MAKE_FUNC_INFO(Leash_get_default_renew_till), + MAKE_FUNC_INFO(Leash_get_default_forwardable), + MAKE_FUNC_INFO(Leash_get_default_noaddresses), + MAKE_FUNC_INFO(Leash_get_default_proxiable), + MAKE_FUNC_INFO(Leash_get_default_publicip), + MAKE_FUNC_INFO(Leash_get_default_use_krb4), + MAKE_FUNC_INFO(Leash_get_default_life_min), + MAKE_FUNC_INFO(Leash_get_default_life_max), + MAKE_FUNC_INFO(Leash_get_default_renew_min), + MAKE_FUNC_INFO(Leash_get_default_renew_max), + MAKE_FUNC_INFO(Leash_get_default_renewable), + END_FUNC_INFO +}; + +FUNC_INFO k5_fi[] = { + MAKE_FUNC_INFO(krb5_change_password), + MAKE_FUNC_INFO(krb5_get_init_creds_opt_init), + MAKE_FUNC_INFO(krb5_get_init_creds_opt_set_tkt_life), + MAKE_FUNC_INFO(krb5_get_init_creds_opt_set_renew_life), + MAKE_FUNC_INFO(krb5_get_init_creds_opt_set_forwardable), + MAKE_FUNC_INFO(krb5_get_init_creds_opt_set_proxiable), + MAKE_FUNC_INFO(krb5_get_init_creds_opt_set_address_list), + MAKE_FUNC_INFO(krb5_get_init_creds_password), + MAKE_FUNC_INFO(krb5_build_principal_ext), + MAKE_FUNC_INFO(krb5_cc_get_name), + MAKE_FUNC_INFO(krb5_cc_resolve), + MAKE_FUNC_INFO(krb5_cc_default), + MAKE_FUNC_INFO(krb5_cc_default_name), + MAKE_FUNC_INFO(krb5_cc_set_default_name), + MAKE_FUNC_INFO(krb5_cc_initialize), + MAKE_FUNC_INFO(krb5_cc_destroy), + MAKE_FUNC_INFO(krb5_cc_close), + MAKE_FUNC_INFO(krb5_cc_copy_creds), + MAKE_FUNC_INFO(krb5_cc_store_cred), + MAKE_FUNC_INFO(krb5_cc_retrieve_cred), + MAKE_FUNC_INFO(krb5_cc_get_principal), + MAKE_FUNC_INFO(krb5_cc_start_seq_get), + MAKE_FUNC_INFO(krb5_cc_next_cred), + MAKE_FUNC_INFO(krb5_cc_end_seq_get), + MAKE_FUNC_INFO(krb5_cc_remove_cred), + MAKE_FUNC_INFO(krb5_cc_set_flags), + MAKE_FUNC_INFO(krb5_cc_get_type), + MAKE_FUNC_INFO(krb5_free_context), + MAKE_FUNC_INFO(krb5_free_cred_contents), + MAKE_FUNC_INFO(krb5_free_principal), + MAKE_FUNC_INFO(krb5_get_in_tkt_with_password), + MAKE_FUNC_INFO(krb5_init_context), + MAKE_FUNC_INFO(krb5_parse_name), + MAKE_FUNC_INFO(krb5_timeofday), + MAKE_FUNC_INFO(krb5_timestamp_to_sfstring), + MAKE_FUNC_INFO(krb5_unparse_name), + MAKE_FUNC_INFO(krb5_get_credentials), + MAKE_FUNC_INFO(krb5_mk_req), + MAKE_FUNC_INFO(krb5_sname_to_principal), + MAKE_FUNC_INFO(krb5_get_credentials_renew), + MAKE_FUNC_INFO(krb5_free_data), + MAKE_FUNC_INFO(krb5_free_data_contents), + MAKE_FUNC_INFO(krb5_free_unparsed_name), + MAKE_FUNC_INFO(krb5_os_localaddr), + MAKE_FUNC_INFO(krb5_copy_keyblock_contents), + MAKE_FUNC_INFO(krb5_copy_data), + MAKE_FUNC_INFO(krb5_free_creds), + MAKE_FUNC_INFO(krb5_build_principal), + MAKE_FUNC_INFO(krb5_get_renewed_creds), + MAKE_FUNC_INFO(krb5_free_addresses), + MAKE_FUNC_INFO(krb5_get_default_config_files), + MAKE_FUNC_INFO(krb5_free_config_files), + MAKE_FUNC_INFO(krb5_get_default_realm), + MAKE_FUNC_INFO(krb5_free_ticket), + MAKE_FUNC_INFO(krb5_decode_ticket), + MAKE_FUNC_INFO(krb5_get_host_realm), + MAKE_FUNC_INFO(krb5_free_host_realm), + MAKE_FUNC_INFO(krb5_free_addresses), + MAKE_FUNC_INFO(krb5_c_random_make_octets), + END_FUNC_INFO +}; + +FUNC_INFO k4_fi[] = { + MAKE_FUNC_INFO(krb_get_cred), + MAKE_FUNC_INFO(krb_get_tf_realm), + MAKE_FUNC_INFO(krb_mk_req), + MAKE_FUNC_INFO(tkt_string), + END_FUNC_INFO +}; + +FUNC_INFO k524_fi[] = { + MAKE_FUNC_INFO(krb524_init_ets), + MAKE_FUNC_INFO(krb524_convert_creds_kdc), + END_FUNC_INFO +}; + +FUNC_INFO profile_fi[] = { + MAKE_FUNC_INFO(profile_init), + MAKE_FUNC_INFO(profile_release), + MAKE_FUNC_INFO(profile_get_subsection_names), + MAKE_FUNC_INFO(profile_free_list), + MAKE_FUNC_INFO(profile_get_string), + MAKE_FUNC_INFO(profile_release_string), + END_FUNC_INFO +}; + +FUNC_INFO ce_fi[] = { + MAKE_FUNC_INFO(com_err), + MAKE_FUNC_INFO(error_message), + END_FUNC_INFO +}; + +FUNC_INFO service_fi[] = { + MAKE_FUNC_INFO(OpenSCManagerA), + MAKE_FUNC_INFO(OpenServiceA), + MAKE_FUNC_INFO(QueryServiceStatus), + MAKE_FUNC_INFO(CloseServiceHandle), +#ifdef USE_MS2MIT + MAKE_FUNC_INFO(LsaNtStatusToWinError), +#endif /* USE_MS2MIT */ + END_FUNC_INFO +}; + +#ifdef USE_MS2MIT +FUNC_INFO lsa_fi[] = { + MAKE_FUNC_INFO(LsaConnectUntrusted), + MAKE_FUNC_INFO(LsaLookupAuthenticationPackage), + MAKE_FUNC_INFO(LsaCallAuthenticationPackage), + MAKE_FUNC_INFO(LsaFreeReturnBuffer), + MAKE_FUNC_INFO(LsaGetLogonSessionData), + END_FUNC_INFO +}; +#endif /* USE_MS2MIT */ + +FUNC_INFO afst_fi[] = { + MAKE_FUNC_INFO(ktc_ListTokens), + MAKE_FUNC_INFO(ktc_GetToken), + MAKE_FUNC_INFO(ktc_SetToken), + MAKE_FUNC_INFO(ktc_ForgetAllTokens), + END_FUNC_INFO +}; + +FUNC_INFO afsc_fi[] = { + MAKE_FUNC_INFO(cm_SearchCellFile), + MAKE_FUNC_INFO(cm_GetRootCellName), + END_FUNC_INFO +}; + +/* Static Prototypes */ +char *afs_realm_of_cell(struct afsconf_cell *); +static long get_cellconfig_callback(void *, struct sockaddr_in *, char *); +int KFW_AFS_get_cellconfig(char *, struct afsconf_cell *, char *); +static krb5_error_code KRB5_CALLCONV KRB5_prompter( krb5_context context, + void *data, const char *name, const char *banner, int num_prompts, + krb5_prompt prompts[]); + + +/* Static Declarations */ +static int inited = 0; +static int mid_cnt = 0; +static struct textField * mid_tb = NULL; +static HINSTANCE hKrb5 = 0; +static HINSTANCE hKrb4 = 0; +static HINSTANCE hKrb524 = 0; +#ifdef USE_MS2MIT +static HINSTANCE hSecur32 = 0; +#endif /* USE_MS2MIT */ +static HINSTANCE hAdvApi32 = 0; +static HINSTANCE hAfsTokens = 0; +static HINSTANCE hAfsConf = 0; +static HINSTANCE hComErr = 0; +static HINSTANCE hService = 0; +static HINSTANCE hProfile = 0; +static HINSTANCE hLeash = 0; +static HINSTANCE hCCAPI = 0; +static struct principal_ccache_data * princ_cc_data = NULL; +static struct cell_principal_map * cell_princ_map = NULL; + +void +KFW_initialize(void) +{ + static int inited = 0; + + if ( !inited ) { + char mutexName[MAX_PATH]; + HANDLE hMutex = NULL; + + sprintf(mutexName, "AFS KFW Init pid=%d", getpid()); + + hMutex = CreateMutex( NULL, TRUE, mutexName ); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) { + if ( WaitForSingleObject( hMutex, INFINITE ) != WAIT_OBJECT_0 ) { + return; + } + } + if ( !inited ) { + inited = 1; + LoadFuncs(KRB5_DLL, k5_fi, &hKrb5, 0, 1, 0, 0); + LoadFuncs(KRB4_DLL, k4_fi, &hKrb4, 0, 1, 0, 0); + LoadFuncs(COMERR_DLL, ce_fi, &hComErr, 0, 0, 1, 0); + LoadFuncs(SERVICE_DLL, service_fi, &hService, 0, 1, 0, 0); +#ifdef USE_MS2MIT + LoadFuncs(SECUR32_DLL, lsa_fi, &hSecur32, 0, 1, 1, 1); +#endif /* USE_MS2MIT */ + LoadFuncs(KRB524_DLL, k524_fi, &hKrb524, 0, 1, 1, 1); + LoadFuncs(PROFILE_DLL, profile_fi, &hProfile, 0, 1, 0, 0); + LoadFuncs(AFSTOKENS_DLL, afst_fi, &hAfsTokens, 0, 1, 0, 0); + LoadFuncs(AFSCONF_DLL, afsc_fi, &hAfsConf, 0, 1, 0, 0); + LoadFuncs(LEASH_DLL, leash_fi, &hLeash, 0, 1, 0, 0); + LoadFuncs(CCAPI_DLL, ccapi_fi, &hCCAPI, 0, 1, 0, 0); + + if ( KFW_is_available() ) { + char rootcell[MAXCELLCHARS+1]; +#ifdef USE_MS2MIT + KFW_import_windows_lsa(); +#endif /* USE_MS2MIT */ + KFW_import_ccache_data(); + KFW_AFS_renew_expiring_tokens(); + + /* WIN32 NOTE: no way to get max chars */ + if (!pcm_GetRootCellName(rootcell)) + KFW_AFS_renew_token_for_cell(rootcell); + } + } + ReleaseMutex(hMutex); + CloseHandle(hMutex); + } +} + +void +KFW_cleanup(void) +{ + if (hKrb5) + FreeLibrary(hKrb5); + if (hKrb4) + FreeLibrary(hKrb4); + if (hProfile) + FreeLibrary(hProfile); + if (hAfsTokens) + FreeLibrary(hAfsTokens); + if (hAfsConf) + FreeLibrary(hAfsConf); + if (hComErr) + FreeLibrary(hComErr); + if (hService) + FreeLibrary(hService); +#ifdef USE_MS2MIT + if (hSecur32) + FreeLibrary(hSecur32); +#endif /* USE_MS2MIT */ + if (hKrb524) + FreeLibrary(hKrb524); + if (hLeash) + FreeLibrary(hLeash); + if (hCCAPI) + FreeLibrary(hCCAPI); +} + +static char OpenAFSConfigKeyName[] = "SOFTWARE\\OpenAFS\\Client"; + +int +KFW_is_available(void) +{ + HKEY parmKey; + DWORD code, len; + DWORD enableKFW = 1; + + code = RegOpenKeyEx(HKEY_CURRENT_USER, OpenAFSConfigKeyName, + 0, KEY_QUERY_VALUE, &parmKey); + if (code != ERROR_SUCCESS) + code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, OpenAFSConfigKeyName, + 0, KEY_QUERY_VALUE, &parmKey); + if (code == ERROR_SUCCESS) { + len = sizeof(enableKFW); + code = RegQueryValueEx(parmKey, "EnableKFW", NULL, NULL, + (BYTE *) &enableKFW, &len); + if (code != ERROR_SUCCESS) { + enableKFW = 1; + } + RegCloseKey (parmKey); + } + + if ( !enableKFW ) + return FALSE; + + KFW_initialize(); + if ( hKrb5 && hComErr && hService && +#ifdef USE_MS2MIT + hSecur32 && +#endif /* USE_MS2MIT */ + hKrb524 && + hProfile && hAfsTokens && hAfsConf && hLeash && hCCAPI ) + return TRUE; + return FALSE; +} + +int +KRB5_error(krb5_error_code rc, LPCSTR FailedFunctionName, + int FreeContextFlag, krb5_context * ctx, + krb5_ccache * cache) +{ + char message[256]; + const char *errText; + int krb5Error = ((int)(rc & 255)); + + /* + switch (krb5Error) + { + // Wrong password + case 31: + case 8: + return; + } + */ + + errText = perror_message(rc); + _snprintf(message, sizeof(message), + "%s\n(Kerberos error %ld)\n\n%s failed", + errText, + krb5Error, + FailedFunctionName); + + if ( IsDebuggerPresent() ) + OutputDebugString(message); + + MessageBox(NULL, message, "Kerberos Five", MB_OK | MB_ICONERROR | + MB_TASKMODAL | + MB_SETFOREGROUND); + if (FreeContextFlag == 1) + { + if (ctx && *ctx != NULL) + { + if (cache && *cache != NULL) { + pkrb5_cc_close(*ctx, *cache); + *cache = NULL; + } + + pkrb5_free_context(*ctx); + *ctx = NULL; + } + } + + return rc; +} + +void +KFW_AFS_update_princ_ccache_data(krb5_context ctx, krb5_ccache cc, int lsa) +{ + struct principal_ccache_data * next = princ_cc_data; + krb5_principal principal = 0; + char * pname = NULL; + const char * ccname = NULL; + krb5_error_code code = 0; + krb5_error_code cc_code = 0; + krb5_cc_cursor cur; + krb5_creds creds; + krb5_flags flags=0; + krb5_timestamp now; + + if (ctx == 0 || cc == 0) + return; + + code = pkrb5_cc_get_principal(ctx, cc, &principal); + if ( code ) return; + + code = pkrb5_unparse_name(ctx, principal, &pname); + if ( code ) goto cleanup; + + ccname = pkrb5_cc_get_name(ctx, cc); + if (!ccname) goto cleanup; + + // Search the existing list to see if we have a match + if ( next ) { + for ( ; next ; next = next->next ) { + if ( !strcmp(next->principal,pname) && !strcmp(next->ccache_name, ccname) ) + break; + } + } + + // If not, match add a new node to the beginning of the list and assign init it + if ( !next ) { + next = (struct principal_ccache_data *) malloc(sizeof(struct principal_ccache_data)); + next->next = princ_cc_data; + princ_cc_data = next; + next->principal = _strdup(pname); + next->ccache_name = _strdup(ccname); + next->from_lsa = lsa; + next->expired = 1; + next->expiration_time = 0; + next->renew = 0; + } + + flags = 0; // turn off OPENCLOSE mode + code = pkrb5_cc_set_flags(ctx, cc, flags); + if ( code ) goto cleanup; + + code = pkrb5_timeofday(ctx, &now); + + cc_code = pkrb5_cc_start_seq_get(ctx, cc, &cur); + + while (!(cc_code = pkrb5_cc_next_cred(ctx, cc, &cur, &creds))) { + if ( creds.ticket_flags & TKT_FLG_INITIAL ) { + int valid; + // we found the ticket we are looking for + // check validity of timestamp + // We add a 5 minutes fudge factor to compensate for potential + // clock skew errors between the KDC and client OS + + valid = ((creds.times.starttime > 0) && + now >= (creds.times.starttime - 300) && + now < (creds.times.endtime + 300) && + !(creds.ticket_flags & TKT_FLG_INVALID)); + + if ( next->from_lsa) { + next->expired = 0; + next->expiration_time = creds.times.endtime; + next->renew = 1; + } else if ( valid ) { + next->expired = 0; + next->expiration_time = creds.times.endtime; + next->renew = (creds.times.renew_till > creds.times.endtime) && + (creds.ticket_flags & TKT_FLG_RENEWABLE); + } else { + next->expired = 1; + next->expiration_time = 0; + next->renew = 0; + } + + pkrb5_free_cred_contents(ctx, &creds); + cc_code = KRB5_CC_END; + break; + } + pkrb5_free_cred_contents(ctx, &creds); + } + + if (cc_code == KRB5_CC_END) { + code = pkrb5_cc_end_seq_get(ctx, cc, &cur); + if (code) goto cleanup; + } + + cleanup: + flags = KRB5_TC_OPENCLOSE; //turn on OPENCLOSE + code = pkrb5_cc_set_flags(ctx, cc, flags); + + if ( pname ) + pkrb5_free_unparsed_name(ctx,pname); + if ( principal ) + pkrb5_free_principal(ctx,principal); +} + +int +KFW_AFS_find_ccache_for_principal(krb5_context ctx, char * principal, char **ccache, int valid_only) +{ + struct principal_ccache_data * next = princ_cc_data; + char * response = NULL; + + if ( !principal || !ccache ) + return 0; + + while ( next ) { + if ( (!valid_only || !next->expired) && !strcmp(next->principal,principal) ) { + if (response) { + // we always want to prefer the MS Kerberos LSA cache or + // the cache afscreds created specifically for the principal + // if the current entry is either one, drop the previous find + if ( next->from_lsa || !strcmp(next->ccache_name,principal) ) + free(response); + } + response = _strdup(next->ccache_name); + // MS Kerberos LSA is our best option so use it and quit + if ( next->from_lsa ) + break; + } + next = next->next; + } + + if ( response ) { + *ccache = response; + return 1; + } + return 0; +} + +void +KFW_AFS_delete_princ_ccache_data(krb5_context ctx, char * pname, char * ccname) +{ + struct principal_ccache_data ** next = &princ_cc_data; + + if ( !pname && !ccname ) + return; + + while ( (*next) ) { + if ( !strcmp((*next)->principal,pname) || + !strcmp((*next)->ccache_name,ccname) ) { + void * temp; + free((*next)->principal); + free((*next)->ccache_name); + temp = (*next); + (*next) = (*next)->next; + free(temp); + } + } +} + +void +KFW_AFS_update_cell_princ_map(krb5_context ctx, char * cell, char *pname, int active) +{ + struct cell_principal_map * next = cell_princ_map; + + // Search the existing list to see if we have a match + if ( next ) { + for ( ; next ; next = next->next ) { + if ( !strcmp(next->cell, cell) ) { + if ( !strcmp(next->principal,pname) ) { + next->active = active; + break; + } else { + // OpenAFS currently has a restriction of one active token per cell + // Therefore, whenever we update the table with a new active cell we + // must mark all of the other principal to cell entries as inactive. + if (active) + next->active = 0; + } + } + } + } + + // If not, match add a new node to the beginning of the list and assign init it + if ( !next ) { + next = (struct cell_principal_map *) malloc(sizeof(struct cell_principal_map)); + next->next = cell_princ_map; + cell_princ_map = next; + next->principal = _strdup(pname); + next->cell = _strdup(cell); + next->active = active; + } +} + +void +KFW_AFS_delete_cell_princ_maps(krb5_context ctx, char * pname, char * cell) +{ + struct cell_principal_map ** next = &cell_princ_map; + + if ( !pname && !cell ) + return; + + while ( (*next) ) { + if ( !strcmp((*next)->principal,pname) || + !strcmp((*next)->cell,cell) ) { + void * temp; + free((*next)->principal); + free((*next)->cell); + temp = (*next); + (*next) = (*next)->next; + free(temp); + } + } +} + +// Returns (if possible) a principal which has been known in +// the past to have been used to obtain tokens for the specified +// cell. +// TODO: Attempt to return one which has not yet expired by checking +// the principal/ccache data +int +KFW_AFS_find_principals_for_cell(krb5_context ctx, char * cell, char **principals[], int active_only) +{ + struct cell_principal_map * next_map = cell_princ_map; + const char * princ = NULL; + int count = 0, i; + + if ( !cell ) + return 0; + + while ( next_map ) { + if ( (!active_only || next_map->active) && !strcmp(next_map->cell,cell) ) { + count++; + } + next_map = next_map->next; + } + + if ( !principals || !count ) + return count; + + *principals = (char **) malloc(sizeof(char *) * count); + for ( next_map = cell_princ_map, i=0 ; next_map && inext ) + { + if ( (!active_only || next_map->active) && !strcmp(next_map->cell,cell) ) { + (*principals)[i++] = _strdup(next_map->principal); + } + } + return count; +} + +int +KFW_AFS_find_cells_for_princ(krb5_context ctx, char * pname, char **cells[], int active_only) +{ + int count = 0, i; + struct cell_principal_map * next_map = cell_princ_map; + const char * princ = NULL; + + if ( !pname ) + return 0; + + while ( next_map ) { + if ( (!active_only || next_map->active) && !strcmp(next_map->principal,pname) ) { + count++; + } + next_map = next_map->next; + } + + if ( !cells ) + return count; + + *cells = (char **) malloc(sizeof(char *) * count); + for ( next_map = cell_princ_map, i=0 ; next_map && inext ) + { + if ( (!active_only || next_map->active) && !strcmp(next_map->principal,pname) ) { + (*cells)[i++] = _strdup(next_map->cell); + } + } + return count; +} + +/* Given a principal return an existing ccache or create one and return */ +int +KFW_get_ccache(krb5_context alt_ctx, krb5_principal principal, krb5_ccache * cc) +{ + krb5_context ctx; + char * pname = 0; + char * ccname = 0; + krb5_error_code code; + + if (!pkrb5_init_context) + return 0; + + if ( alt_ctx ) { + ctx = alt_ctx; + } else { + code = pkrb5_init_context(&ctx); + if (code) goto cleanup; + } + + if ( principal ) { + code = pkrb5_unparse_name(ctx, principal, &pname); + if (code) goto cleanup; + + if ( !KFW_AFS_find_ccache_for_principal(ctx,pname,&ccname,TRUE) && + !KFW_AFS_find_ccache_for_principal(ctx,pname,&ccname,FALSE)) { + ccname = (char *)malloc(strlen(pname) + 5); + sprintf(ccname,"API:%s",pname); + } + code = pkrb5_cc_resolve(ctx, ccname, cc); + } else { + code = pkrb5_cc_default(ctx, cc); + if (code) goto cleanup; + } + + cleanup: + if (ccname) + free(ccname); + if (pname) + pkrb5_free_unparsed_name(ctx,pname); + if (ctx && (ctx != alt_ctx)) + pkrb5_free_context(ctx); + return(code); +} + +#ifdef USE_MS2MIT +// Import Microsoft Credentials into a new MIT ccache +void +KFW_import_windows_lsa(void) +{ + krb5_context ctx = 0; + krb5_ccache cc = 0; + krb5_principal princ = 0; + char * pname = NULL; + krb5_data * realm; + krb5_error_code code; + char cell[128]=""; + int i; + + if (!pkrb5_init_context) + return; + +#ifdef COMMENT + if ( !MSLSA_IsKerberosLogon() ) + return; +#endif + + code = pkrb5_init_context(&ctx); + if (code) goto cleanup; + + code = pkrb5_cc_resolve(ctx, LSA_CCNAME, &cc); + if (code) goto cleanup; + + KFW_AFS_update_princ_ccache_data(ctx, cc, TRUE); + + code = pkrb5_cc_get_principal(ctx, cc, &princ); + if ( code ) goto cleanup; + + code = pkrb5_unparse_name(ctx,princ,&pname); + if ( code ) goto cleanup; + + realm = krb5_princ_realm(ctx, princ); + for ( i=0; ilength; i++ ) { + cell[i] = tolower(realm->data[i]); + } + cell[i] = '\0'; + + code = KFW_AFS_klog(ctx, cc, "afs", cell, realm->data, pLeash_get_default_lifetime(),NULL); + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"KFW_AFS_klog() returns: %d\n",code); + OutputDebugString(message); + } + if ( code ) goto cleanup; + + KFW_AFS_update_cell_princ_map(ctx, cell, pname, TRUE); + + cleanup: + if (pname) + pkrb5_free_unparsed_name(ctx,pname); + if (princ) + pkrb5_free_principal(ctx,princ); + if (cc) + pkrb5_cc_close(ctx,cc); + if (ctx) + pkrb5_free_context(ctx); +} +#endif /* USE_MS2MIT */ + +// If there are existing MIT credentials, copy them to a new +// ccache named after the principal + +// Enumerate all existing MIT ccaches and construct entries +// in the principal_ccache table + +// Enumerate all existing AFS Tokens and construct entries +// in the cell_principal table +void +KFW_import_ccache_data(void) +{ + krb5_context ctx = 0; + krb5_ccache cc = 0; + krb5_principal principal = 0; + krb5_creds creds; + krb5_error_code code; + krb5_error_code cc_code; + krb5_cc_cursor cur; + apiCB * cc_ctx = 0; + struct _infoNC ** pNCi = NULL; + int i, j, flags; + + if ( !pcc_initialize ) + return; + + if ( IsDebuggerPresent() ) + OutputDebugString("KFW_import_ccache_data()\n"); + + code = pcc_initialize(&cc_ctx, CC_API_VER_2, NULL, NULL); + if (code) goto cleanup; + + code = pcc_get_NC_info(cc_ctx, &pNCi); + if (code) goto cleanup; + + code = pkrb5_init_context(&ctx); + if (code) goto cleanup; + + for ( i=0; pNCi[i]; i++ ) { + if ( pNCi[i]->vers != CC_CRED_V5 ) + continue; + if ( IsDebuggerPresent() ) { + OutputDebugString("Principal: "); + OutputDebugString(pNCi[i]->principal); + OutputDebugString(" in ccache "); + OutputDebugString(pNCi[i]->name); + OutputDebugString("\n"); + } + if ( strcmp(pNCi[i]->name,pNCi[i]->principal) + && strcmp(pNCi[i]->name,LSA_CCNAME) + ) { + int found = 0; + for ( j=0; pNCi[j]; j++ ) { + if (!strcmp(pNCi[j]->name,pNCi[i]->principal)) { + found = 1; + break; + } + } + + code = pkrb5_cc_resolve(ctx, pNCi[i]->principal, &cc); + if (code) goto loop_cleanup; + + if (!found) { + krb5_ccache oldcc = 0; + + if ( IsDebuggerPresent() ) + OutputDebugString("copying ccache data to new ccache\n"); + + code = pkrb5_parse_name(ctx, pNCi[i]->principal, &principal); + if (code) goto loop_cleanup; + code = pkrb5_cc_initialize(ctx, cc, principal); + if (code) goto loop_cleanup; + + code = pkrb5_cc_resolve(ctx, pNCi[i]->name, &oldcc); + if (code) goto loop_cleanup; + code = pkrb5_cc_copy_creds(ctx,oldcc,cc); + if (code) { + code = pkrb5_cc_close(ctx,cc); + cc = 0; + code = pkrb5_cc_close(ctx,oldcc); + cc = 0; + KRB5_error(code, "krb5_cc_copy_creds", 0, NULL, NULL); + continue; + } + code = pkrb5_cc_close(ctx,oldcc); + } + } else { + code = pkrb5_cc_resolve(ctx, pNCi[i]->name, &cc); + if (code) goto loop_cleanup; + } + + flags = 0; // turn off OPENCLOSE mode + code = pkrb5_cc_set_flags(ctx, cc, flags); + if ( code ) goto cleanup; + + KFW_AFS_update_princ_ccache_data(ctx, cc, !strcmp(pNCi[i]->name,LSA_CCNAME)); + + cc_code = pkrb5_cc_start_seq_get(ctx, cc, &cur); + + while (!(cc_code = pkrb5_cc_next_cred(ctx, cc, &cur, &creds))) { + krb5_data * sname = krb5_princ_name(ctx, creds.server); + krb5_data * cell = krb5_princ_component(ctx, creds.server, 1); + krb5_data * realm = krb5_princ_realm(ctx, creds.server); + if ( sname && cell && !strcmp("afs",sname->data) ) { + struct ktc_principal aserver; + struct ktc_principal aclient; + struct ktc_token atoken; + int active = TRUE; + + if ( IsDebuggerPresent() ) { + OutputDebugString("Found AFS ticket: "); + OutputDebugString(sname->data); + if ( cell->data ) { + OutputDebugString("/"); + OutputDebugString(cell->data); + } + OutputDebugString("@"); + OutputDebugString(realm->data); + OutputDebugString("\n"); + } + + memset(&aserver, '\0', sizeof(aserver)); + strcpy(aserver.name, sname->data); + strcpy(aserver.cell, cell->data); + + code = pktc_GetToken(&aserver, &atoken, sizeof(atoken), &aclient); + if (!code) { + // Found a token in AFS Client Server which matches + char pname[128], *p, *q; + for ( p=pname, q=aclient.name; *q; p++, q++) + *p = *q; + for ( *p++ = '@', q=aclient.cell; *q; p++, q++) + *p = toupper(*q); + *p = '\0'; + + if ( IsDebuggerPresent() ) { + OutputDebugString("Found AFS token: "); + OutputDebugString(pname); + OutputDebugString("\n"); + } + + if ( strcmp(pname,pNCi[i]->principal) ) + active = FALSE; + KFW_AFS_update_cell_princ_map(ctx, cell->data, pNCi[i]->principal, active); + } else { + // Attempt to import it + KFW_AFS_update_cell_princ_map(ctx, cell->data, pNCi[i]->principal, active); + + if ( IsDebuggerPresent() ) { + OutputDebugString("Calling KFW_AFS_klog() to obtain token\n"); + } + + code = KFW_AFS_klog(ctx, cc, "afs", cell->data, realm->data, pLeash_get_default_lifetime(),NULL); + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"KFW_AFS_klog() returns: %d\n",code); + OutputDebugString(message); + } + } + } else if ( IsDebuggerPresent() ) { + OutputDebugString("Found ticket: "); + OutputDebugString(sname->data); + if ( cell && cell->data ) { + OutputDebugString("/"); + OutputDebugString(cell->data); + } + OutputDebugString("@"); + OutputDebugString(realm->data); + OutputDebugString("\n"); + } + pkrb5_free_cred_contents(ctx, &creds); + } + + if (cc_code == KRB5_CC_END) { + cc_code = pkrb5_cc_end_seq_get(ctx, cc, &cur); + if (cc_code) goto loop_cleanup; + } + + loop_cleanup: + flags = KRB5_TC_OPENCLOSE; //turn on OPENCLOSE + code = pkrb5_cc_set_flags(ctx, cc, flags); + if (cc) { + pkrb5_cc_close(ctx,cc); + cc = 0; + } + if (principal) { + pkrb5_free_principal(ctx,principal); + principal = 0; + } + } + + cleanup: + if (ctx) + pkrb5_free_context(ctx); + if (pNCi) + pcc_free_NC_info(cc_ctx, &pNCi); + if (cc_ctx) + pcc_shutdown(&cc_ctx); +} + + +int +KFW_AFS_get_cred(char * username, + char * cell, + char * password, + int lifetime, + char * smbname, + char ** reasonP ) +{ + krb5_context ctx = 0; + krb5_ccache cc = 0; + char * realm = 0; + char ** realmlist = 0; + krb5_principal principal = 0; + char * pname = 0; + krb5_error_code code; + char local_cell[MAXCELLCHARS+1]; + char **cells = NULL; + int cell_count=0; + struct afsconf_cell cellconfig; + + if (!pkrb5_init_context) + return 0; + + if ( IsDebuggerPresent() ) { + OutputDebugString("KFW_AFS_get_cred for token "); + OutputDebugString(username); + OutputDebugString(" in cell "); + OutputDebugString(cell); + OutputDebugString("\n"); + } + + code = pkrb5_init_context(&ctx); + if ( code ) goto cleanup; + + code = KFW_AFS_get_cellconfig( cell, (void*)&cellconfig, local_cell); + if ( code ) goto cleanup; + + realm = strchr(username,'@'); + if (realm) { + *realm = '\0'; + realm++; + } + if ( !realm || !realm[0] ) + realm = afs_realm_of_cell(&cellconfig); // do not free + + if ( IsDebuggerPresent() ) { + OutputDebugString("Realm: "); + OutputDebugString(realm); + OutputDebugString("\n"); + } + + code = pkrb5_build_principal(ctx, &principal, strlen(realm), + realm, username, + NULL, + NULL); + + code = KFW_get_ccache(ctx, principal, &cc); + if ( code ) goto cleanup; + + code = pkrb5_unparse_name(ctx, principal, &pname); + if ( code ) goto cleanup; + + if ( lifetime == 0 ) + lifetime = pLeash_get_default_lifetime(); + + code = KFW_kinit(ctx, cc, HWND_DESKTOP, + pname, + password, + lifetime, + pLeash_get_default_forwardable(), + pLeash_get_default_proxiable(), + pLeash_get_default_renewable() ? pLeash_get_default_renew_till() : 0, + pLeash_get_default_noaddresses(), + pLeash_get_default_publicip()); + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"KFW_kinit() returns: %d\n",code); + OutputDebugString(message); + } + if ( code ) goto cleanup; + + KFW_AFS_update_princ_ccache_data(ctx, cc, FALSE); + + code = KFW_AFS_klog(ctx, cc, "afs", cell, realm, lifetime,smbname); + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"KFW_AFS_klog() returns: %d\n",code); + OutputDebugString(message); + } + if ( code ) goto cleanup; + + KFW_AFS_update_cell_princ_map(ctx, cell, pname, TRUE); + + // Attempt to obtain new tokens for other cells supported by the same + // principal + cell_count = KFW_AFS_find_cells_for_princ(ctx, pname, &cells, TRUE); + if ( cell_count > 1 ) { + while ( cell_count-- ) { + if ( strcmp(cells[cell_count],cell) ) { + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"found another cell for the same principal: %s\n",cell); + OutputDebugString(message); + } + code = KFW_AFS_get_cellconfig( cells[cell_count], (void*)&cellconfig, local_cell); + if ( code ) continue; + + realm = afs_realm_of_cell(&cellconfig); // do not free + if ( IsDebuggerPresent() ) { + OutputDebugString("Realm: "); + OutputDebugString(realm); + OutputDebugString("\n"); + } + + code = KFW_AFS_klog(ctx, cc, "afs", cells[cell_count], realm, lifetime,smbname); + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"KFW_AFS_klog() returns: %d\n",code); + OutputDebugString(message); + } + } + free(cells[cell_count]); + } + free(cells); + } else if ( cell_count == 1 ) { + free(cells[0]); + free(cells); + } + + cleanup: + if ( pname ) + pkrb5_free_unparsed_name(ctx,pname); + if ( cc ) + pkrb5_cc_close(ctx, cc); + + if ( code && reasonP ) { + *reasonP = (char *)perror_message(code); + } + return(code); +} + +int +KFW_AFS_destroy_tickets_for_cell(char * cell) +{ + krb5_context ctx = 0; + krb5_error_code code; + int count; + char ** principals = NULL; + + if (!pkrb5_init_context) + return 0; + + if ( IsDebuggerPresent() ) { + OutputDebugString("KFW_AFS_destroy_ticets_for_cell: "); + OutputDebugString(cell); + OutputDebugString("\n"); + } + + code = pkrb5_init_context(&ctx); + if (code) ctx = 0; + + count = KFW_AFS_find_principals_for_cell(ctx, cell, &principals, FALSE); + if ( count > 0 ) { + krb5_principal princ = 0; + krb5_ccache cc = 0; + + while ( count-- ) { + int cell_count = KFW_AFS_find_cells_for_princ(ctx, principals[count], NULL, TRUE); + if ( cell_count > 1 ) { + // TODO - What we really should do here is verify whether or not any of the + // other cells which use this principal to obtain its credentials actually + // have valid tokens or not. If they are currently using these credentials + // we will skip them. For the time being we assume that if there is an active + // map in the table that they are actively being used. + goto loop_cleanup; + } + + code = pkrb5_parse_name(ctx, principals[count], &princ); + if (code) goto loop_cleanup; + + code = KFW_get_ccache(ctx, princ, &cc); + if (code) goto loop_cleanup; + + code = pkrb5_cc_destroy(ctx, cc); + if (!code) cc = 0; + + loop_cleanup: + if ( cc ) { + pkrb5_cc_close(ctx, cc); + cc = 0; + } + if ( princ ) { + pkrb5_free_principal(ctx, princ); + princ = 0; + } + + KFW_AFS_update_cell_princ_map(ctx, cell, principals[count], FALSE); + free(principals[count]); + } + free(principals); + } + pkrb5_free_context(ctx); + return 0; +} + +int +KFW_AFS_renew_expiring_tokens(void) +{ + krb5_error_code code = 0; + krb5_context ctx = 0; + krb5_ccache cc = 0; + krb5_timestamp now; + struct principal_ccache_data * pcc_next = princ_cc_data; + int cell_count; + char ** cells=NULL; + const char * realm = NULL; + char local_cell[MAXCELLCHARS+1]=""; + struct afsconf_cell cellconfig; + + if (!pkrb5_init_context) + return 0; + + if ( pcc_next == NULL ) // nothing to do + return 0; + + if ( IsDebuggerPresent() ) { + OutputDebugString("KFW_AFS_renew_expiring_tokens\n"); + } + + code = pkrb5_init_context(&ctx); + if (code) goto cleanup; + + code = pkrb5_timeofday(ctx, &now); + if (code) goto cleanup; + + for ( ; pcc_next ; pcc_next = pcc_next->next ) { + if ( pcc_next->expired ) + continue; + + if ( now >= (pcc_next->expiration_time) ) { + if ( !pcc_next->from_lsa ) { + pcc_next->expired = 1; + continue; + } + } + + if ( pcc_next->renew && now >= (pcc_next->expiration_time - cminRENEW * csec1MINUTE) ) { + code = pkrb5_cc_resolve(ctx, pcc_next->ccache_name, &cc); + if ( code ) + goto loop_cleanup; + code = KFW_renew(ctx,cc); +#ifdef USE_MS2MIT + if ( code && pcc_next->from_lsa) + goto loop_cleanup; +#endif /* USE_MS2MIT */ + + + KFW_AFS_update_princ_ccache_data(ctx, cc, pcc_next->from_lsa); + if (code) goto loop_cleanup; + + // Attempt to obtain new tokens for other cells supported by the same + // principal + cell_count = KFW_AFS_find_cells_for_princ(ctx, pcc_next->principal, &cells, TRUE); + if ( cell_count > 0 ) { + while ( cell_count-- ) { + if ( IsDebuggerPresent() ) { + OutputDebugString("Cell: "); + OutputDebugString(cells[cell_count]); + OutputDebugString("\n"); + } + code = KFW_AFS_get_cellconfig( cells[cell_count], (void*)&cellconfig, local_cell); + if ( code ) continue; + realm = afs_realm_of_cell(&cellconfig); // do not free + if ( IsDebuggerPresent() ) { + OutputDebugString("Realm: "); + OutputDebugString(realm); + OutputDebugString("\n"); + } + code = KFW_AFS_klog(ctx, cc, "afs", cells[cell_count], (char *)realm, pLeash_get_default_lifetime(),NULL); + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"KFW_AFS_klog() returns: %d\n",code); + OutputDebugString(message); + } + free(cells[cell_count]); + } + free(cells); + } + } + + loop_cleanup: + if ( cc ) { + pkrb5_cc_close(ctx,cc); + cc = 0; + } + } + + cleanup: + if ( cc ) + pkrb5_cc_close(ctx,cc); + if ( ctx ) + pkrb5_free_context(ctx); + + return 0; +} + + +BOOL +KFW_AFS_renew_token_for_cell(char * cell) +{ + krb5_error_code code = 0; + krb5_context ctx = 0; + int count; + char ** principals = NULL; + + if (!pkrb5_init_context) + return 0; + + if ( IsDebuggerPresent() ) { + OutputDebugString("KFW_AFS_renew_token_for_cell:"); + OutputDebugString(cell); + OutputDebugString("\n"); + } + + code = pkrb5_init_context(&ctx); + if (code) goto cleanup; + + count = KFW_AFS_find_principals_for_cell(ctx, cell, &principals, TRUE); + if ( count == 0 ) { + // We know we must have a credential somewhere since we are + // trying to renew a token + + KFW_import_ccache_data(); + count = KFW_AFS_find_principals_for_cell(ctx, cell, &principals, TRUE); + } + if ( count > 0 ) { + krb5_principal princ = 0; + krb5_principal service = 0; +#ifdef COMMENT + krb5_creds mcreds, creds; +#endif /* COMMENT */ + krb5_ccache cc = 0; + const char * realm = NULL; + struct afsconf_cell cellconfig; + char local_cell[MAXCELLCHARS+1]; + + while ( count-- ) { + code = pkrb5_parse_name(ctx, principals[count], &princ); + if (code) goto loop_cleanup; + + code = KFW_get_ccache(ctx, princ, &cc); + if (code) goto loop_cleanup; + + code = KFW_AFS_get_cellconfig( cell, (void*)&cellconfig, local_cell); + if ( code ) goto loop_cleanup; + + realm = afs_realm_of_cell(&cellconfig); // do not free + if ( IsDebuggerPresent() ) { + OutputDebugString("Realm: "); + OutputDebugString(realm); + OutputDebugString("\n"); + } + +#ifdef COMMENT + /* krb5_cc_remove_cred() is not implemented + * for a single cred + */ + code = pkrb5_build_principal(ctx, &service, strlen(realm), + realm, "afs", cell, NULL); + if (!code) { + memset(&mcreds, 0, sizeof(krb5_creds)); + mcreds.client = princ; + mcreds.server = service; + + code = pkrb5_cc_retrieve_cred(ctx, cc, 0, &mcreds, &creds); + if (!code) { + if ( IsDebuggerPresent() ) { + char * cname, *sname; + pkrb5_unparse_name(ctx, creds.client, &cname); + pkrb5_unparse_name(ctx, creds.server, &sname); + OutputDebugString("Removing credential for client \""); + OutputDebugString(cname); + OutputDebugString("\" and service \""); + OutputDebugString(sname); + OutputDebugString("\"\n"); + pkrb5_free_unparsed_name(ctx,cname); + pkrb5_free_unparsed_name(ctx,sname); + } + + code = pkrb5_cc_remove_cred(ctx, cc, 0, &creds); + pkrb5_free_principal(ctx, creds.client); + pkrb5_free_principal(ctx, creds.server); + } + } +#endif /* COMMENT */ + + code = KFW_AFS_klog(ctx, cc, "afs", cell, (char *)realm, pLeash_get_default_lifetime(),NULL); + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"KFW_AFS_klog() returns: %d\n",code); + OutputDebugString(message); + } + + loop_cleanup: + if (cc) { + pkrb5_cc_close(ctx, cc); + cc = 0; + } + if (princ) { + pkrb5_free_principal(ctx, princ); + princ = 0; + } + if (service) { + pkrb5_free_principal(ctx, service); + princ = 0; + } + + KFW_AFS_update_cell_princ_map(ctx, cell, principals[count], code ? FALSE : TRUE); + free(principals[count]); + } + free(principals); + } else + code = -1; // we did not renew the tokens + + cleanup: + pkrb5_free_context(ctx); + return (code ? FALSE : TRUE); + +} + +int +KFW_AFS_renew_tokens_for_all_cells(void) +{ + struct cell_principal_map * next = cell_princ_map; + + if ( IsDebuggerPresent() ) + OutputDebugString("KFW_AFS_renew_tokens_for_all()\n"); + + if ( !next ) + return 0; + + for ( ; next ; next = next->next ) { + if ( next->active ) + KFW_AFS_renew_token_for_cell(next->cell); + } + return 0; +} + +int +KFW_renew(krb5_context alt_ctx, krb5_ccache alt_cc) +{ + krb5_error_code code = 0; + krb5_context ctx = 0; + krb5_ccache cc = 0; + krb5_principal me = 0; + krb5_principal server = 0; + krb5_creds my_creds; + krb5_data *realm = 0; + + if (!pkrb5_init_context) + return 0; + + memset(&my_creds, 0, sizeof(krb5_creds)); + + if ( alt_ctx ) { + ctx = alt_ctx; + } else { + code = pkrb5_init_context(&ctx); + if (code) goto cleanup; + } + + if ( alt_cc ) { + cc = alt_cc; + } else { + code = pkrb5_cc_default(ctx, &cc); + if (code) goto cleanup; + } + + code = pkrb5_cc_get_principal(ctx, cc, &me); + if (code) goto cleanup; + + realm = krb5_princ_realm(ctx, me); + + code = pkrb5_build_principal_ext(ctx, &server, + realm->length,realm->data, + KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME, + realm->length,realm->data, + 0); + if ( code ) + goto cleanup; + + if ( IsDebuggerPresent() ) { + char * cname, *sname; + pkrb5_unparse_name(ctx, me, &cname); + pkrb5_unparse_name(ctx, server, &sname); + OutputDebugString("Renewing credential for client \""); + OutputDebugString(cname); + OutputDebugString("\" and service \""); + OutputDebugString(sname); + OutputDebugString("\"\n"); + pkrb5_free_unparsed_name(ctx,cname); + pkrb5_free_unparsed_name(ctx,sname); + } + + my_creds.client = me; + my_creds.server = server; + + code = pkrb5_get_renewed_creds(ctx, &my_creds, me, cc, NULL); + if (code) { + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"krb5_get_renewed_creds() failed: %d\n",code); + OutputDebugString(message); + } + goto cleanup; + } + + code = pkrb5_cc_initialize(ctx, cc, me); + if (code) { + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"krb5_cc_initialize() failed: %d\n",code); + OutputDebugString(message); + } + goto cleanup; + } + + code = pkrb5_cc_store_cred(ctx, cc, &my_creds); + if (code) { + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"krb5_cc_store_cred() failed: %d\n",code); + OutputDebugString(message); + } + goto cleanup; + } + + cleanup: + if (my_creds.client == me) + my_creds.client = 0; + if (my_creds.server == server) + my_creds.server = 0; + pkrb5_free_cred_contents(ctx, &my_creds); + if (me) + pkrb5_free_principal(ctx, me); + if (server) + pkrb5_free_principal(ctx, server); + if (cc && (cc != alt_cc)) + pkrb5_cc_close(ctx, cc); + if (ctx && (ctx != alt_ctx)) + pkrb5_free_context(ctx); + return(code); +} + +int +KFW_kinit( krb5_context alt_ctx, + krb5_ccache alt_cc, + HWND hParent, + char *principal_name, + char *password, + krb5_deltat lifetime, + DWORD forwardable, + DWORD proxiable, + krb5_deltat renew_life, + DWORD addressless, + DWORD publicIP + ) +{ + krb5_error_code code = 0; + krb5_context ctx = 0; + krb5_ccache cc = 0; + krb5_principal me = 0; + char* name = 0; + krb5_creds my_creds; + krb5_get_init_creds_opt options; + krb5_address ** addrs = NULL; + int i = 0, addr_count = 0; + + if (!pkrb5_init_context) + return 0; + + pkrb5_get_init_creds_opt_init(&options); + memset(&my_creds, 0, sizeof(my_creds)); + + if (alt_ctx) + { + ctx = alt_ctx; + } + else + { + code = pkrb5_init_context(&ctx); + if (code) goto cleanup; + } + + if ( alt_cc ) { + cc = alt_cc; + } else { + code = pkrb5_cc_default(ctx, &cc); + if (code) goto cleanup; + } + + code = pkrb5_parse_name(ctx, principal_name, &me); + if (code) + goto cleanup; + + code = pkrb5_unparse_name(ctx, me, &name); + if (code) + goto cleanup; + + if (lifetime == 0) + lifetime = pLeash_get_default_lifetime(); + else + lifetime *= 5*60; + + if (renew_life > 0) + renew_life *= 5*60; + + if (lifetime) + pkrb5_get_init_creds_opt_set_tkt_life(&options, lifetime); + pkrb5_get_init_creds_opt_set_forwardable(&options, + forwardable ? 1 : 0); + pkrb5_get_init_creds_opt_set_proxiable(&options, + proxiable ? 1 : 0); + pkrb5_get_init_creds_opt_set_renew_life(&options, + renew_life); + if (addressless) + pkrb5_get_init_creds_opt_set_address_list(&options,NULL); + else { + if (publicIP) + { + // we are going to add the public IP address specified by the user + // to the list provided by the operating system + krb5_address ** local_addrs=NULL; + DWORD netIPAddr; + + pkrb5_os_localaddr(ctx, &local_addrs); + while ( local_addrs[i++] ); + addr_count = i + 1; + + addrs = (krb5_address **) malloc((addr_count+1) * sizeof(krb5_address *)); + if ( !addrs ) { + pkrb5_free_addresses(ctx, local_addrs); + goto cleanup; + } + memset(addrs, 0, sizeof(krb5_address *) * (addr_count+1)); + i = 0; + while ( local_addrs[i] ) { + addrs[i] = (krb5_address *)malloc(sizeof(krb5_address)); + if (addrs[i] == NULL) { + pkrb5_free_addresses(ctx, local_addrs); + goto cleanup; + } + + addrs[i]->magic = local_addrs[i]->magic; + addrs[i]->addrtype = local_addrs[i]->addrtype; + addrs[i]->length = local_addrs[i]->length; + addrs[i]->contents = (unsigned char *)malloc(addrs[i]->length); + if (!addrs[i]->contents) { + pkrb5_free_addresses(ctx, local_addrs); + goto cleanup; + } + + memcpy(addrs[i]->contents,local_addrs[i]->contents, + local_addrs[i]->length); /* safe */ + i++; + } + pkrb5_free_addresses(ctx, local_addrs); + + addrs[i] = (krb5_address *)malloc(sizeof(krb5_address)); + if (addrs[i] == NULL) + goto cleanup; + + addrs[i]->magic = KV5M_ADDRESS; + addrs[i]->addrtype = AF_INET; + addrs[i]->length = 4; + addrs[i]->contents = (unsigned char *)malloc(addrs[i]->length); + if (!addrs[i]->contents) + goto cleanup; + + netIPAddr = htonl(publicIP); + memcpy(addrs[i]->contents,&netIPAddr,4); + + pkrb5_get_init_creds_opt_set_address_list(&options,addrs); + + } + } + + code = pkrb5_get_init_creds_password(ctx, + &my_creds, + me, + password, // password + KRB5_prompter, // prompter + hParent, // prompter data + 0, // start time + 0, // service name + &options); + if (code) + goto cleanup; + + code = pkrb5_cc_initialize(ctx, cc, me); + if (code) + goto cleanup; + + code = pkrb5_cc_store_cred(ctx, cc, &my_creds); + if (code) + goto cleanup; + + cleanup: + if ( addrs ) { + for ( i=0;icontents ) + free(addrs[i]->contents); + free(addrs[i]); + } + } + } + if (my_creds.client == me) + my_creds.client = 0; + pkrb5_free_cred_contents(ctx, &my_creds); + if (name) + pkrb5_free_unparsed_name(ctx, name); + if (me) + pkrb5_free_principal(ctx, me); + if (cc && (cc != alt_cc)) + pkrb5_cc_close(ctx, cc); + if (ctx && (ctx != alt_ctx)) + pkrb5_free_context(ctx); + return(code); +} + + +int +KFW_kdestroy(krb5_context alt_ctx, krb5_ccache alt_cc) +{ + krb5_context ctx; + krb5_ccache cc; + krb5_error_code code; + + if (!pkrb5_init_context) + return 0; + + if (alt_ctx) + { + ctx = alt_ctx; + } + else + { + code = pkrb5_init_context(&ctx); + if (code) goto cleanup; + } + + if ( alt_cc ) { + cc = alt_cc; + } else { + code = pkrb5_cc_default(ctx, &cc); + if (code) goto cleanup; + } + + code = pkrb5_cc_destroy(ctx, cc); + if ( !code ) cc = 0; + + cleanup: + if (cc && (cc != alt_cc)) + pkrb5_cc_close(ctx, cc); + if (ctx && (ctx != alt_ctx)) + pkrb5_free_context(ctx); + + return(code); +} + + +#ifdef USE_MS2MIT +static BOOL +GetSecurityLogonSessionData(PSECURITY_LOGON_SESSION_DATA * ppSessionData) +{ + NTSTATUS Status = 0; + HANDLE TokenHandle; + TOKEN_STATISTICS Stats; + DWORD ReqLen; + BOOL Success; + + if (!ppSessionData) + return FALSE; + *ppSessionData = NULL; + + Success = OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY, &TokenHandle ); + if ( !Success ) + return FALSE; + + Success = GetTokenInformation( TokenHandle, TokenStatistics, &Stats, sizeof(TOKEN_STATISTICS), &ReqLen ); + CloseHandle( TokenHandle ); + if ( !Success ) + return FALSE; + + Status = pLsaGetLogonSessionData( &Stats.AuthenticationId, ppSessionData ); + if ( FAILED(Status) || !ppSessionData ) + return FALSE; + + return TRUE; +} + +// +// MSLSA_IsKerberosLogon() does not validate whether or not there are valid tickets in the +// cache. It validates whether or not it is reasonable to assume that if we +// attempted to retrieve valid tickets we could do so. Microsoft does not +// automatically renew expired tickets. Therefore, the cache could contain +// expired or invalid tickets. Microsoft also caches the user's password +// and will use it to retrieve new TGTs if the cache is empty and tickets +// are requested. + +static BOOL +MSLSA_IsKerberosLogon(VOID) +{ + PSECURITY_LOGON_SESSION_DATA pSessionData = NULL; + BOOL Success = FALSE; + + if ( GetSecurityLogonSessionData(&pSessionData) ) { + if ( pSessionData->AuthenticationPackage.Buffer ) { + WCHAR buffer[256]; + WCHAR *usBuffer; + int usLength; + + Success = FALSE; + usBuffer = (pSessionData->AuthenticationPackage).Buffer; + usLength = (pSessionData->AuthenticationPackage).Length; + if (usLength < 256) + { + lstrcpynW (buffer, usBuffer, usLength); + lstrcatW (buffer,L""); + if ( !lstrcmpW(L"Kerberos",buffer) ) + Success = TRUE; + } + } + pLsaFreeReturnBuffer(pSessionData); + } + return Success; +} +#endif /* USE_MS2MIT */ + +static BOOL CALLBACK +MultiInputDialogProc( HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam) +{ + int i; + + switch ( message ) { + case WM_INITDIALOG: + if ( GetDlgCtrlID((HWND) wParam) != ID_MID_TEXT ) + { + SetFocus(GetDlgItem( hDialog, ID_MID_TEXT)); + return FALSE; + } + for ( i=0; i < mid_cnt ; i++ ) { + if (mid_tb[i].echo == 0) + SendDlgItemMessage(hDialog, ID_MID_TEXT+i, EM_SETPASSWORDCHAR, 32, 0); + else if (mid_tb[i].echo == 2) + SendDlgItemMessage(hDialog, ID_MID_TEXT+i, EM_SETPASSWORDCHAR, '*', 0); + } + return TRUE; + + case WM_COMMAND: + switch ( LOWORD(wParam) ) { + case IDOK: + for ( i=0; i < mid_cnt ; i++ ) { + if ( !GetDlgItemText(hDialog, ID_MID_TEXT+i, mid_tb[i].buf, mid_tb[i].len) ) + *mid_tb[i].buf = '\0'; + } + /* fallthrough */ + case IDCANCEL: + EndDialog(hDialog, LOWORD(wParam)); + return TRUE; + } + } + return FALSE; +} + +static LPWORD +lpwAlign( LPWORD lpIn ) +{ + ULONG ul; + + ul = (ULONG) lpIn; + ul += 3; + ul >>=2; + ul <<=2; + return (LPWORD) ul;; +} + +/* + * dialog widths are measured in 1/4 character widths + * dialog height are measured in 1/8 character heights + */ + +static LRESULT +MultiInputDialog( HINSTANCE hinst, HWND hwndOwner, + char * ptext[], int numlines, int width, + int tb_cnt, struct textField * tb) +{ + HGLOBAL hgbl; + LPDLGTEMPLATE lpdt; + LPDLGITEMTEMPLATE lpdit; + LPWORD lpw; + LPWSTR lpwsz; + LRESULT ret; + int nchar, i, pwid; + + hgbl = GlobalAlloc(GMEM_ZEROINIT, 4096); + if (!hgbl) + return -1; + + mid_cnt = tb_cnt; + mid_tb = tb; + + lpdt = (LPDLGTEMPLATE)GlobalLock(hgbl); + + // Define a dialog box. + + lpdt->style = WS_POPUP | WS_BORDER | WS_SYSMENU + | DS_MODALFRAME | WS_CAPTION | DS_CENTER + | DS_SETFOREGROUND | DS_3DLOOK + | DS_SETFONT | DS_FIXEDSYS | DS_NOFAILCREATE; + lpdt->cdit = numlines + (2 * tb_cnt) + 2; // number of controls + lpdt->x = 10; + lpdt->y = 10; + lpdt->cx = 20 + width * 4; + lpdt->cy = 20 + (numlines + tb_cnt + 4) * 14; + + lpw = (LPWORD) (lpdt + 1); + *lpw++ = 0; // no menu + *lpw++ = 0; // predefined dialog box class (by default) + + lpwsz = (LPWSTR) lpw; + nchar = MultiByteToWideChar (CP_ACP, 0, "", -1, lpwsz, 128); + lpw += nchar; + *lpw++ = 8; // font size (points) + lpwsz = (LPWSTR) lpw; + nchar = MultiByteToWideChar (CP_ACP, 0, "MS Shell Dlg", + -1, lpwsz, 128); + lpw += nchar; + + //----------------------- + // Define an OK button. + //----------------------- + lpw = lpwAlign (lpw); // align DLGITEMTEMPLATE on DWORD boundary + lpdit = (LPDLGITEMTEMPLATE) lpw; + lpdit->style = WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON | WS_TABSTOP | WS_BORDER; + lpdit->dwExtendedStyle = 0; + lpdit->x = (lpdt->cx - 14)/4 - 20; + lpdit->y = 10 + (numlines + tb_cnt + 2) * 14; + lpdit->cx = 40; + lpdit->cy = 14; + lpdit->id = IDOK; // OK button identifier + + lpw = (LPWORD) (lpdit + 1); + *lpw++ = 0xFFFF; + *lpw++ = 0x0080; // button class + + lpwsz = (LPWSTR) lpw; + nchar = MultiByteToWideChar (CP_ACP, 0, "OK", -1, lpwsz, 50); + lpw += nchar; + *lpw++ = 0; // no creation data + + //----------------------- + // Define an Cancel button. + //----------------------- + lpw = lpwAlign (lpw); // align DLGITEMTEMPLATE on DWORD boundary + lpdit = (LPDLGITEMTEMPLATE) lpw; + lpdit->style = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_TABSTOP | WS_BORDER; + lpdit->dwExtendedStyle = 0; + lpdit->x = (lpdt->cx - 14)*3/4 - 20; + lpdit->y = 10 + (numlines + tb_cnt + 2) * 14; + lpdit->cx = 40; + lpdit->cy = 14; + lpdit->id = IDCANCEL; // CANCEL button identifier + + lpw = (LPWORD) (lpdit + 1); + *lpw++ = 0xFFFF; + *lpw++ = 0x0080; // button class + + lpwsz = (LPWSTR) lpw; + nchar = MultiByteToWideChar (CP_ACP, 0, "Cancel", -1, lpwsz, 50); + lpw += nchar; + *lpw++ = 0; // no creation data + + /* Add controls for preface data */ + for ( i=0; istyle = WS_CHILD | WS_VISIBLE | SS_LEFT; + lpdit->dwExtendedStyle = 0; + lpdit->x = 10; + lpdit->y = 10 + i * 14; + lpdit->cx = strlen(ptext[i]) * 4 + 10; + lpdit->cy = 14; + lpdit->id = ID_TEXT + i; // text identifier + + lpw = (LPWORD) (lpdit + 1); + *lpw++ = 0xFFFF; + *lpw++ = 0x0082; // static class + + lpwsz = (LPWSTR) lpw; + nchar = MultiByteToWideChar (CP_ACP, 0, ptext[i], + -1, lpwsz, 2*width); + lpw += nchar; + *lpw++ = 0; // no creation data + } + + for ( i=0, pwid = 0; istyle = WS_CHILD | WS_VISIBLE | SS_LEFT; + lpdit->dwExtendedStyle = 0; + lpdit->x = 10; + lpdit->y = 10 + (numlines + i + 1) * 14; + lpdit->cx = pwid * 4; + lpdit->cy = 14; + lpdit->id = ID_TEXT + numlines + i; // text identifier + + lpw = (LPWORD) (lpdit + 1); + *lpw++ = 0xFFFF; + *lpw++ = 0x0082; // static class + + lpwsz = (LPWSTR) lpw; + nchar = MultiByteToWideChar (CP_ACP, 0, tb[i].label ? tb[i].label : "", + -1, lpwsz, 128); + lpw += nchar; + *lpw++ = 0; // no creation data + + /*----------------------- + * Define an edit control. + *-----------------------*/ + lpw = lpwAlign (lpw); /* align DLGITEMTEMPLATE on DWORD boundary */ + lpdit = (LPDLGITEMTEMPLATE) lpw; + lpdit->style = WS_CHILD | WS_VISIBLE | ES_LEFT | WS_TABSTOP | WS_BORDER | (tb[i].echo == 1 ? 0L : ES_PASSWORD); + lpdit->dwExtendedStyle = 0; + lpdit->x = 10 + (pwid + 1) * 4; + lpdit->y = 10 + (numlines + i + 1) * 14; + lpdit->cx = (width - (pwid + 1)) * 4; + lpdit->cy = 14; + lpdit->id = ID_MID_TEXT + i; // identifier + + lpw = (LPWORD) (lpdit + 1); + *lpw++ = 0xFFFF; + *lpw++ = 0x0081; // edit class + + lpwsz = (LPWSTR) lpw; + nchar = MultiByteToWideChar (CP_ACP, 0, tb[i].def ? tb[i].def : "", + -1, lpwsz, 128); + lpw += nchar; + *lpw++ = 0; // no creation data + } + + GlobalUnlock(hgbl); + ret = DialogBoxIndirect(hinst, (LPDLGTEMPLATE) hgbl, + hwndOwner, (DLGPROC) MultiInputDialogProc); + GlobalFree(hgbl); + + switch ( ret ) { + case 0: /* Timeout */ + return -1; + case IDOK: + return 1; + case IDCANCEL: + return 0; + default: { + char buf[256]; + sprintf(buf,"DialogBoxIndirect() failed: %d",GetLastError()); + MessageBox(hwndOwner, + buf, + "GetLastError()", + MB_OK | MB_ICONINFORMATION | MB_TASKMODAL); + return -1; + } + } +} + +static int +multi_field_dialog(HWND hParent, char * preface, int n, struct textField tb[]) +{ + HINSTANCE hInst = 0; + int maxwidth = 0; + int numlines = 0; + int len; + char * plines[16], *p = preface ? preface : ""; + int i; + + for ( i=0; i<16; i++ ) + plines[i] = NULL; + + while (*p && numlines < 16) { + plines[numlines++] = p; + for ( ;*p && *p != '\r' && *p != '\n'; p++ ); + if ( *p == '\r' && *(p+1) == '\n' ) { + *p++ = '\0'; + p++; + } else if ( *p == '\n' ) { + *p++ = '\0'; + } + if ( strlen(plines[numlines-1]) > maxwidth ) + maxwidth = strlen(plines[numlines-1]); + } + + for ( i=0;i 40 ? 40 : tb[i].len); + if ( maxwidth < len ) + maxwidth = len; + } + + return(MultiInputDialog(hInst, hParent, plines, numlines, maxwidth, n, tb)); +} + +static krb5_error_code KRB5_CALLCONV +KRB5_prompter( krb5_context context, + void *data, + const char *name, + const char *banner, + int num_prompts, + krb5_prompt prompts[]) +{ + krb5_error_code errcode = 0; + int i; + struct textField * tb = NULL; + int len = 0, blen=0, nlen=0; + HWND hParent = (HWND)data; + + if (name) + nlen = strlen(name)+2; + + if (banner) + blen = strlen(banner)+2; + + tb = (struct textField *) malloc(sizeof(struct textField) * num_prompts); + if ( tb != NULL ) { + int ok; + memset(tb,0,sizeof(struct textField) * num_prompts); + for ( i=0; i < num_prompts; i++ ) { + tb[i].buf = prompts[i].reply->data; + tb[i].len = prompts[i].reply->length; + tb[i].label = prompts[i].prompt; + tb[i].def = NULL; + tb[i].echo = (prompts[i].hidden ? 2 : 1); + } + + ok = multi_field_dialog(hParent,(char *)banner,num_prompts,tb); + if ( ok ) { + for ( i=0; i < num_prompts; i++ ) + prompts[i].reply->length = strlen(prompts[i].reply->data); + } else + errcode = -2; + } + + if ( tb ) + free(tb); + if (errcode) { + for (i = 0; i < num_prompts; i++) { + memset(prompts[i].reply->data, 0, prompts[i].reply->length); + } + } + return errcode; +} + +BOOL +KFW_AFS_wait_for_service_start(void) +{ + char HostName[64]; + DWORD CurrentState; + + CurrentState = SERVICE_START_PENDING; + memset(HostName, '\0', sizeof(HostName)); + gethostname(HostName, sizeof(HostName)); + + while (CurrentState != SERVICE_RUNNING || CurrentState != SERVICE_STOPPED) + { + if (GetServiceStatus(HostName, TRANSARCAFSDAEMON, &CurrentState) != NOERROR) + return(0); + if ( IsDebuggerPresent() ) { + switch ( CurrentState ) { + case SERVICE_STOPPED: + OutputDebugString("SERVICE_STOPPED\n"); + break; + case SERVICE_START_PENDING: + OutputDebugString("SERVICE_START_PENDING\n"); + break; + case SERVICE_STOP_PENDING: + OutputDebugString("SERVICE_STOP_PENDING\n"); + break; + case SERVICE_RUNNING: + OutputDebugString("SERVICE_RUNNING\n"); + break; + case SERVICE_CONTINUE_PENDING: + OutputDebugString("SERVICE_CONTINUE_PENDING\n"); + break; + case SERVICE_PAUSE_PENDING: + OutputDebugString("SERVICE_PAUSE_PENDING\n"); + break; + case SERVICE_PAUSED: + OutputDebugString("SERVICE_PAUSED\n"); + break; + default: + OutputDebugString("UNKNOWN Service State\n"); + } + } + if (CurrentState == SERVICE_STOPPED) + return(0); + if (CurrentState == SERVICE_RUNNING) + return(1); + Sleep(500); + } + return(0); +} + + +int +KFW_AFS_unlog(void) +{ + long rc; + char HostName[64]; + DWORD CurrentState; + + CurrentState = 0; + memset(HostName, '\0', sizeof(HostName)); + gethostname(HostName, sizeof(HostName)); + if (GetServiceStatus(HostName, TRANSARCAFSDAEMON, &CurrentState) != NOERROR) + return(0); + if (CurrentState != SERVICE_RUNNING) + return(0); + + rc = pktc_ForgetAllTokens(); + + return(0); +} + +int +KFW_AFS_klog( + krb5_context alt_ctx, + krb5_ccache alt_cc, + char *service, + char *cell, + char *realm, + int LifeTime, + char *smbname + ) +{ + long rc = 0; + CREDENTIALS creds; + KTEXT_ST ticket; + struct ktc_principal aserver; + struct ktc_principal aclient; + char realm_of_user[REALM_SZ]; /* Kerberos realm of user */ + char realm_of_cell[REALM_SZ]; /* Kerberos realm of cell */ + char local_cell[MAXCELLCHARS+1]; + char Dmycell[MAXCELLCHARS+1]; + struct ktc_token atoken; + struct ktc_token btoken; + struct afsconf_cell ak_cellconfig; /* General information about the cell */ + char RealmName[128]; + char CellName[128]; + char ServiceName[128]; + DWORD CurrentState; + char HostName[64]; + BOOL try_krb5 = 0; + krb5_context ctx = 0; + krb5_ccache cc = 0; + krb5_creds increds; + krb5_creds * k5creds = 0; + krb5_error_code code; + krb5_principal client_principal = 0; + char * cname = 0, *sname = 0; + int i, retry = 0; + + CurrentState = 0; + memset(HostName, '\0', sizeof(HostName)); + gethostname(HostName, sizeof(HostName)); + if (GetServiceStatus(HostName, TRANSARCAFSDAEMON, &CurrentState) != NOERROR) { + if ( IsDebuggerPresent() ) + OutputDebugString("Unable to retrieve AFSD Service Status\n"); + return(-1); + } + if (CurrentState != SERVICE_RUNNING) { + if ( IsDebuggerPresent() ) + OutputDebugString("AFSD Service NOT RUNNING\n"); + return(-2); + } + + if (!pkrb5_init_context) + return 0; + + memset(RealmName, '\0', sizeof(RealmName)); + memset(CellName, '\0', sizeof(CellName)); + memset(ServiceName, '\0', sizeof(ServiceName)); + memset(realm_of_user, '\0', sizeof(realm_of_user)); + memset(realm_of_cell, '\0', sizeof(realm_of_cell)); + if (cell && cell[0]) + strcpy(Dmycell, cell); + else + memset(Dmycell, '\0', sizeof(Dmycell)); + + // NULL or empty cell returns information on local cell + if (rc = KFW_AFS_get_cellconfig(Dmycell, &ak_cellconfig, local_cell)) + { + // KFW_AFS_error(rc, "get_cellconfig()"); + return(rc); + } + + if ( alt_ctx ) { + ctx = alt_ctx; + } else { + code = pkrb5_init_context(&ctx); + if (code) goto cleanup; + } + + if ( alt_cc ) { + cc = alt_cc; + } else { + code = pkrb5_cc_default(ctx, &cc); + if (code) goto skip_krb5_init; + } + + memset((char *)&increds, 0, sizeof(increds)); + + code = pkrb5_cc_get_principal(ctx, cc, &client_principal); + if (code) { + if ( code == KRB5_CC_NOTFOUND && IsDebuggerPresent() ) + { + OutputDebugString("Principal Not Found for ccache\n"); + } + goto skip_krb5_init; + } + i = krb5_princ_realm(ctx, client_principal)->length; + if (i > REALM_SZ-1) + i = REALM_SZ-1; + strncpy(realm_of_user,krb5_princ_realm(ctx, client_principal)->data,i); + realm_of_user[i] = 0; + try_krb5 = 1; + + skip_krb5_init: +#ifdef USE_KRB4 + if ( !try_krb5 || !realm_of_user[0] ) { + if ((rc = (*pkrb_get_tf_realm)((*ptkt_string)(), realm_of_user)) != KSUCCESS) + { + goto cleanup; + } + } +#else + goto cleanup; +#endif + strcpy(realm_of_cell, afs_realm_of_cell(&ak_cellconfig)); + + if (strlen(service) == 0) + strcpy(ServiceName, "afs"); + else + strcpy(ServiceName, service); + + if (strlen(cell) == 0) + strcpy(CellName, local_cell); + else + strcpy(CellName, cell); + + if (strlen(realm) == 0) + strcpy(RealmName, realm_of_cell); + else + strcpy(RealmName, realm); + + memset(&creds, '\0', sizeof(creds)); + + if ( try_krb5 ) { + int len; + + /* First try service/cell@REALM */ + if (code = pkrb5_build_principal(ctx, &increds.server, + strlen(RealmName), + RealmName, + ServiceName, + CellName, + 0)) + { + goto cleanup; + } + + increds.client = client_principal; + increds.times.endtime = 0; + /* Ask for DES since that is what V4 understands */ + increds.keyblock.enctype = ENCTYPE_DES_CBC_CRC; + + + if ( IsDebuggerPresent() ) { + pkrb5_unparse_name(ctx, increds.client, &cname); + pkrb5_unparse_name(ctx, increds.server, &sname); + OutputDebugString("Getting tickets for \""); + OutputDebugString(cname); + OutputDebugString("\" and service \""); + OutputDebugString(sname); + OutputDebugString("\"\n"); + cname = sname = 0; + } + + code = pkrb5_get_credentials(ctx, 0, cc, &increds, &k5creds); + if (code == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || + code == KRB5KRB_ERR_GENERIC /* heimdal */ || + code == KRB5KRB_AP_ERR_MSG_TYPE) { + /* Or service@REALM */ + pkrb5_free_principal(ctx,increds.server); + increds.server = 0; + code = pkrb5_build_principal(ctx, &increds.server, + strlen(RealmName), + RealmName, + ServiceName, + 0); + + if ( IsDebuggerPresent() ) { + char * cname, *sname; + pkrb5_unparse_name(ctx, increds.client, &cname); + pkrb5_unparse_name(ctx, increds.server, &sname); + OutputDebugString("krb5_get_credentials() returned Service Principal Unknown\n"); + OutputDebugString("Trying again: getting tickets for \""); + OutputDebugString(cname); + OutputDebugString("\" and service \""); + OutputDebugString(sname); + OutputDebugString("\"\n"); + pkrb5_free_unparsed_name(ctx,cname); + pkrb5_free_unparsed_name(ctx,sname); + cname = sname = 0; + } + + if (!code) + code = pkrb5_get_credentials(ctx, 0, cc, &increds, &k5creds); + } + + if ((code == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || + code == KRB5KRB_ERR_GENERIC /* heimdal */ || + code == KRB5KRB_AP_ERR_MSG_TYPE) && + strcmp(RealmName, realm_of_cell)) { + /* Or service/cell@REALM_OF_CELL */ + strcpy(RealmName, realm_of_cell); + pkrb5_free_principal(ctx,increds.server); + increds.server = 0; + code = pkrb5_build_principal(ctx, &increds.server, + strlen(RealmName), + RealmName, + ServiceName, + CellName, + 0); + + if ( IsDebuggerPresent() ) { + char * cname, *sname; + pkrb5_unparse_name(ctx, increds.client, &cname); + pkrb5_unparse_name(ctx, increds.server, &sname); + OutputDebugString("krb5_get_credentials() returned Service Principal Unknown\n"); + OutputDebugString("Trying again: getting tickets for \""); + OutputDebugString(cname); + OutputDebugString("\" and service \""); + OutputDebugString(sname); + OutputDebugString("\"\n"); + pkrb5_free_unparsed_name(ctx,cname); + pkrb5_free_unparsed_name(ctx,sname); + cname = sname = 0; + } + + if (!code) + code = pkrb5_get_credentials(ctx, 0, cc, &increds, &k5creds); + + + if (code == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN || + code == KRB5KRB_ERR_GENERIC /* heimdal */ || + code == KRB5KRB_AP_ERR_MSG_TYPE) { + /* Or service@REALM_OF_CELL */ + pkrb5_free_principal(ctx,increds.server); + increds.server = 0; + code = pkrb5_build_principal(ctx, &increds.server, + strlen(RealmName), + RealmName, + ServiceName, + 0); + + if ( IsDebuggerPresent() ) { + char * cname, *sname; + pkrb5_unparse_name(ctx, increds.client, &cname); + pkrb5_unparse_name(ctx, increds.server, &sname); + OutputDebugString("krb5_get_credentials() returned Service Principal Unknown\n"); + OutputDebugString("Trying again: getting tickets for \""); + OutputDebugString(cname); + OutputDebugString("\" and service \""); + OutputDebugString(sname); + OutputDebugString("\"\n"); + pkrb5_free_unparsed_name(ctx,cname); + pkrb5_free_unparsed_name(ctx,sname); + cname = sname = 0; + } + + if (!code) + code = pkrb5_get_credentials(ctx, 0, cc, &increds, &k5creds); + } + } + + if (code) { + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"krb5_get_credentials returns: %d\n",code); + OutputDebugString(message); + } + try_krb5 = 0; + goto use_krb4; + } + + /* This code inserts the entire K5 ticket into the token + * No need to perform a krb524 translation which is + * commented out in the code below + */ + if (k5creds->ticket.length > MAXKTCTICKETLEN) + goto try_krb524d; + + memset(&aserver, '\0', sizeof(aserver)); + strncpy(aserver.name, ServiceName, MAXKTCNAMELEN - 1); + strncpy(aserver.cell, CellName, MAXKTCREALMLEN - 1); + + memset(&atoken, '\0', sizeof(atoken)); + atoken.kvno = RXKAD_TKT_TYPE_KERBEROS_V5; + atoken.startTime = k5creds->times.starttime; + atoken.endTime = k5creds->times.endtime; + memcpy(&atoken.sessionKey, k5creds->keyblock.contents, k5creds->keyblock.length); + atoken.ticketLen = k5creds->ticket.length; + memcpy(atoken.ticket, k5creds->ticket.data, atoken.ticketLen); + + retry_gettoken5: + rc = pktc_GetToken(&aserver, &btoken, sizeof(btoken), &aclient); + if (rc != 0 && rc != KTC_NOENT && rc != KTC_NOCELL) { + if ( rc == KTC_NOCM && retry < 20 ) { + Sleep(500); + retry++; + goto retry_gettoken5; + } + goto try_krb524d; + } + + if (atoken.kvno == btoken.kvno && + atoken.ticketLen == btoken.ticketLen && + !memcmp(&atoken.sessionKey, &btoken.sessionKey, sizeof(atoken.sessionKey)) && + !memcmp(atoken.ticket, btoken.ticket, atoken.ticketLen)) + { + /* Success - Nothing to do */ + goto cleanup; + } + + // * Reset the "aclient" structure before we call ktc_SetToken. + // * This structure was first set by the ktc_GetToken call when + // * we were comparing whether identical tokens already existed. + + len = min(k5creds->client->data[0].length,MAXKTCNAMELEN - 1); + strncpy(aclient.name, k5creds->client->data[0].data, len); + aclient.name[len] = '\0'; + + if ( k5creds->client->length > 1 ) { + char * p; + strcat(aclient.name, "."); + p = aclient.name + strlen(aclient.name); + len = min(k5creds->client->data[1].length,MAXKTCNAMELEN - strlen(aclient.name) - 1); + strncpy(p, k5creds->client->data[1].data, len); + p[len] = '\0'; + } + aclient.instance[0] = '\0'; + + strcpy(aclient.cell, realm_of_cell); + + len = min(k5creds->client->realm.length,strlen(realm_of_cell)); + if ( strncmp(realm_of_cell, k5creds->client->realm.data, len) ) { + char * p; + strcat(aclient.name, "@"); + p = aclient.name + strlen(aclient.name); + len = min(k5creds->client->realm.length,MAXKTCNAMELEN - strlen(aclient.name) - 1); + strncpy(p, k5creds->client->realm.data, len); + p[len] = '\0'; + } + + if ( smbname ) { + strncpy(aclient.smbname, smbname, MAXRANDOMNAMELEN); + aclient.smbname[MAXRANDOMNAMELEN-1] = '\0'; + } else { + aclient.smbname[0] = '\0'; + } + + rc = pktc_SetToken(&aserver, &atoken, &aclient, 0); + if (!rc) + goto cleanup; /* We have successfully inserted the token */ + + try_krb524d: + /* Otherwise, the ticket could have been too large so try to + * convert using the krb524d running with the KDC + */ + code = pkrb524_convert_creds_kdc(ctx, k5creds, &creds); + pkrb5_free_creds(ctx, k5creds); + if (code) { + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"krb524_convert_creds_kdc returns: %d\n",code); + OutputDebugString(message); + } + try_krb5 = 0; + goto use_krb4; + } + } else { + use_krb4: +#ifdef USE_KRB4 + code = (*pkrb_get_cred)(ServiceName, CellName, RealmName, &creds); + if (code == NO_TKT_FIL) { + // if the problem is that we have no krb4 tickets + // do not attempt to continue + goto cleanup; + } + if (code != KSUCCESS) + code = (*pkrb_get_cred)(ServiceName, "", RealmName, &creds); + + if (code != KSUCCESS) + { + if ((code = (*pkrb_mk_req)(&ticket, ServiceName, CellName, RealmName, 0)) == KSUCCESS) + { + if ((code = (*pkrb_get_cred)(ServiceName, CellName, RealmName, &creds)) != KSUCCESS) + { + goto cleanup; + } + } + else if ((code = (*pkrb_mk_req)(&ticket, ServiceName, "", RealmName, 0)) == KSUCCESS) + { + if ((code = (*pkrb_get_cred)(ServiceName, "", RealmName, &creds)) != KSUCCESS) + { + goto cleanup; + } + } + else + { + goto cleanup; + } + } +#else + goto cleanup; +#endif + } + + memset(&aserver, '\0', sizeof(aserver)); + strncpy(aserver.name, ServiceName, MAXKTCNAMELEN - 1); + strncpy(aserver.cell, CellName, MAXKTCREALMLEN - 1); + + memset(&atoken, '\0', sizeof(atoken)); + atoken.kvno = creds.kvno; + atoken.startTime = creds.issue_date; + atoken.endTime = creds.issue_date + life_to_time(0,creds.lifetime); + memcpy(&atoken.sessionKey, creds.session, 8); + atoken.ticketLen = creds.ticket_st.length; + memcpy(atoken.ticket, creds.ticket_st.dat, atoken.ticketLen); + + retry_gettoken: + rc = pktc_GetToken(&aserver, &btoken, sizeof(btoken), &aclient); + if (rc != 0 && rc != KTC_NOENT && rc != KTC_NOCELL) { + if ( rc == KTC_NOCM && retry < 20 ) { + Sleep(500); + retry++; + goto retry_gettoken; + } + KFW_AFS_error(rc, "ktc_GetToken()"); + code = rc; + goto cleanup; + } + + if (atoken.kvno == btoken.kvno && + atoken.ticketLen == btoken.ticketLen && + !memcmp(&atoken.sessionKey, &btoken.sessionKey, sizeof(atoken.sessionKey)) && + !memcmp(atoken.ticket, btoken.ticket, atoken.ticketLen)) + { + goto cleanup; + } + + // * Reset the "aclient" structure before we call ktc_SetToken. + // * This structure was first set by the ktc_GetToken call when + // * we were comparing whether identical tokens already existed. + + strncpy(aclient.name, creds.pname, MAXKTCNAMELEN - 1); + if (creds.pinst[0]) + { + strncat(aclient.name, ".", MAXKTCNAMELEN - 1); + strncat(aclient.name, creds.pinst, MAXKTCNAMELEN - 1); + } + strcpy(aclient.instance, ""); + + if ( strcmp(realm_of_cell, creds.realm) ) + { + strncat(aclient.name, "@", MAXKTCNAMELEN - 1); + strncpy(aclient.name, creds.realm, MAXKTCREALMLEN - 1); + } + aclient.name[MAXKTCREALMLEN-1] = '\0'; + + strcpy(aclient.cell, CellName); + + if ( smbname ) { + strncpy(aclient.smbname, smbname, MAXRANDOMNAMELEN); + aclient.smbname[MAXRANDOMNAMELEN-1] = '\0'; + } else { + aclient.smbname[0] = '\0'; + } + + if (rc = pktc_SetToken(&aserver, &atoken, &aclient, 0)) + { + KFW_AFS_error(rc, "ktc_SetToken()"); + code = rc; + goto cleanup; + } + + cleanup: + if (cname) + pkrb5_free_unparsed_name(ctx,cname); + if (sname) + pkrb5_free_unparsed_name(ctx,sname); + if (client_principal) + pkrb5_free_principal(ctx,client_principal); + /* increds.client == client_principal */ + if (increds.server) + pkrb5_free_principal(ctx,increds.server); + if (cc && (cc != alt_cc)) + pkrb5_cc_close(ctx, cc); + if (ctx && (ctx != alt_ctx)) + pkrb5_free_context(ctx); + + return(rc? rc : code); +} + +/**************************************/ +/* afs_realm_of_cell(): */ +/**************************************/ +static char * +afs_realm_of_cell(struct afsconf_cell *cellconfig) +{ + static char krbrlm[REALM_SZ+1]=""; + krb5_context ctx = 0; + char ** realmlist=NULL; + krb5_error_code r; + + if (!cellconfig) + return 0; + + if (!pkrb5_init_context) + return 0; + + r = pkrb5_init_context(&ctx); + if ( !r ) + r = pkrb5_get_host_realm(ctx, cellconfig->hostName[0], &realmlist); + if ( !r && realmlist && realmlist[0] ) { + strcpy(krbrlm, realmlist[0]); + pkrb5_free_host_realm(ctx, realmlist); + } + if (ctx) + pkrb5_free_context(ctx); + + if ( !krbrlm[0] ) + { + char *s = krbrlm; + char *t = cellconfig->name; + int c; + + while (c = *t++) + { + if (islower(c)) c=toupper(c); + *s++ = c; + } + *s++ = 0; + } + return(krbrlm); +} + +/**************************************/ +/* KFW_AFS_get_cellconfig(): */ +/**************************************/ +int +KFW_AFS_get_cellconfig(char *cell, struct afsconf_cell *cellconfig, char *local_cell) +{ + int rc; + char newcell[MAXCELLCHARS+1]; + + local_cell[0] = (char)0; + memset(cellconfig, 0, sizeof(*cellconfig)); + + /* WIN32: cm_GetRootCellName(local_cell) - NOTE: no way to get max chars */ + if (rc = pcm_GetRootCellName(local_cell)) + { + return(rc); + } + + if (strlen(cell) == 0) + strcpy(cell, local_cell); + + /* WIN32: cm_SearchCellFile(cell, pcallback, pdata) */ + strcpy(cellconfig->name, cell); + + return pcm_SearchCellFile(cell, newcell, get_cellconfig_callback, (void*)cellconfig); +} + +/**************************************/ +/* get_cellconfig_callback(): */ +/**************************************/ +static long +get_cellconfig_callback(void *cellconfig, struct sockaddr_in *addrp, char *namep) +{ + struct afsconf_cell *cc = (struct afsconf_cell *)cellconfig; + + cc->hostAddr[cc->numServers] = *addrp; + strcpy(cc->hostName[cc->numServers], namep); + cc->numServers++; + return(0); +} + + +/**************************************/ +/* KFW_AFS_error(): */ +/**************************************/ +void +KFW_AFS_error(LONG rc, LPCSTR FailedFunctionName) +{ + char message[256]; + const char *errText; + + // Using AFS defines as error messages for now, until Transarc + // gets back to me with "string" translations of each of these + // const. defines. + if (rc == KTC_ERROR) + errText = "KTC_ERROR"; + else if (rc == KTC_TOOBIG) + errText = "KTC_TOOBIG"; + else if (rc == KTC_INVAL) + errText = "KTC_INVAL"; + else if (rc == KTC_NOENT) + errText = "KTC_NOENT"; + else if (rc == KTC_PIOCTLFAIL) + errText = "KTC_PIOCTLFAIL"; + else if (rc == KTC_NOPIOCTL) + errText = "KTC_NOPIOCTL"; + else if (rc == KTC_NOCELL) + errText = "KTC_NOCELL"; + else if (rc == KTC_NOCM) + errText = "KTC_NOCM: The service, Transarc AFS Daemon, most likely is not started!"; + else + errText = "Unknown error!"; + + sprintf(message, "%s (0x%x)\n(%s failed)", errText, rc, FailedFunctionName); + + if ( IsDebuggerPresent() ) { + OutputDebugString(message); + OutputDebugString("\n"); + } + MessageBox(NULL, message, "AFS", MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND); + return; +} + +static DWORD +GetServiceStatus( + LPSTR lpszMachineName, + LPSTR lpszServiceName, + DWORD *lpdwCurrentState) +{ + DWORD hr = NOERROR; + SC_HANDLE schSCManager = NULL; + SC_HANDLE schService = NULL; + DWORD fdwDesiredAccess = 0; + SERVICE_STATUS ssServiceStatus = {0}; + BOOL fRet = FALSE; + + *lpdwCurrentState = 0; + + fdwDesiredAccess = GENERIC_READ; + + schSCManager = OpenSCManager(lpszMachineName, + NULL, + fdwDesiredAccess); + + if(schSCManager == NULL) + { + hr = GetLastError(); + goto cleanup; + } + + schService = OpenService(schSCManager, + lpszServiceName, + fdwDesiredAccess); + + if(schService == NULL) + { + hr = GetLastError(); + goto cleanup; + } + + fRet = QueryServiceStatus(schService, + &ssServiceStatus); + + if(fRet == FALSE) + { + hr = GetLastError(); + goto cleanup; + } + + *lpdwCurrentState = ssServiceStatus.dwCurrentState; + +cleanup: + + CloseServiceHandle(schService); + CloseServiceHandle(schSCManager); + + return(hr); +} + +void +UnloadFuncs( + FUNC_INFO fi[], + HINSTANCE h + ) +{ + int n; + if (fi) + for (n = 0; fi[n].func_ptr_var; n++) + *(fi[n].func_ptr_var) = 0; + if (h) FreeLibrary(h); +} + +int +LoadFuncs( + const char* dll_name, + FUNC_INFO fi[], + HINSTANCE* ph, // [out, optional] - DLL handle + int* pindex, // [out, optional] - index of last func loaded (-1 if none) + int cleanup, // cleanup function pointers and unload on error + int go_on, // continue loading even if some functions cannot be loaded + int silent // do not pop-up a system dialog if DLL cannot be loaded + ) +{ + HINSTANCE h; + int i, n, last_i; + int error = 0; + UINT em; + + if (ph) *ph = 0; + if (pindex) *pindex = -1; + + for (n = 0; fi[n].func_ptr_var; n++) + *(fi[n].func_ptr_var) = 0; + + if (silent) + em = SetErrorMode(SEM_FAILCRITICALERRORS); + h = LoadLibrary(dll_name); + if (silent) + SetErrorMode(em); + + if (!h) + return 0; + + last_i = -1; + for (i = 0; (go_on || !error) && (i < n); i++) + { + void* p = (void*)GetProcAddress(h, fi[i].func_name); + if (!p) + error = 1; + else + { + last_i = i; + *(fi[i].func_ptr_var) = p; + } + } + if (pindex) *pindex = last_i; + if (error && cleanup && !go_on) { + for (i = 0; i < n; i++) { + *(fi[i].func_ptr_var) = 0; + } + FreeLibrary(h); + return 0; + } + if (ph) *ph = h; + if (error) return 0; + return 1; +} + +BOOL KFW_probe_kdc(struct afsconf_cell * cellconfig) +{ + krb5_context ctx = 0; + krb5_ccache cc = 0; + krb5_error_code code; + krb5_data pwdata; + const char * realm = 0; + krb5_principal principal = 0; + char * pname = 0; + char password[PROBE_PASSWORD_LEN+1]; + BOOL serverReachable = 0; + + realm = afs_realm_of_cell(cellconfig); // do not free + + code = pkrb5_build_principal(ctx, &principal, strlen(realm), + realm, PROBE_USERNAME, NULL, NULL); + if ( code ) goto cleanup; + + code = KFW_get_ccache(ctx, principal, &cc); + if ( code ) goto cleanup; + + code = pkrb5_unparse_name(ctx, principal, &pname); + if ( code ) goto cleanup; + + pwdata.data = password; + pwdata.length = PROBE_PASSWORD_LEN; + code = pkrb5_c_random_make_octets(ctx, &pwdata); + if (code) { + int i; + for ( i=0 ; i +#include +#include +#include + +#define MAXCELLCHARS 64 +#define MAXHOSTCHARS 64 +#define MAXHOSTSPERCELL 8 +#define TRANSARCAFSDAEMON "TransarcAFSDaemon" + +void KFW_initialize(void); +void KFW_cleanup(void); +int KFW_is_available(void); +int KFW_AFS_destroy_tickets_for_cell(char *); +int KFW_AFS_renew_expiring_tokens(void); +int KFW_AFS_get_cred( char * username, + char * cell, + char * password, + int lifetime, + char * smbname, + char ** reasonP ); +int KFW_AFS_renew_token_for_cell(char * cell); +int KFW_AFS_renew_tokens_for_all_cells(void); +BOOL KFW_AFS_wait_for_service_start(void); +BOOL KFW_probe_kdc(struct afsconf_cell *); +int KFW_AFS_get_cellconfig(char *, struct afsconf_cell *, char *); +void KFW_import_windows_lsa(void); + +/* From afs/krb_prot.h */ +/* values for kerb error codes */ +#define KERB_ERR_OK 0 +#define KERB_ERR_NAME_EXP 1 +#define KERB_ERR_SERVICE_EXP 2 +#define KERB_ERR_AUTH_EXP 3 +#define KERB_ERR_PKT_VER 4 +#define KERB_ERR_NAME_MAST_KEY_VER 5 +#define KERB_ERR_SERV_MAST_KEY_VER 6 +#define KERB_ERR_BYTE_ORDER 7 +#define KERB_ERR_PRINCIPAL_UNKNOWN 8 +#define KERB_ERR_PRINCIPAL_NOT_UNIQUE 9 +#define KERB_ERR_NULL_KEY 10 + +/* From afs/krb.h */ +#define RD_AP_TIME 37 /* delta_t too big */ +#define INTK_BADPW 62 /* Incorrect password */ + +#define PROBE_USERNAME "OPENAFS-KDC-PROBE" +#define PROBE_PASSWORD_LEN 16 + +#ifdef __cplusplus +} +#endif +#endif /* AFSKFW_H */ diff --git a/src/WINNT/afsd/afslogon.c b/src/WINNT/afsd/afslogon.c index ff671c1b9..8cb927031 100644 --- a/src/WINNT/afsd/afslogon.c +++ b/src/WINNT/afsd/afslogon.c @@ -74,7 +74,7 @@ void DebugEvent0(char *a) HANDLE h; char *ptbuf[1]; if (!ISLOGONTRACE(TraceOption)) return; - h = RegisterEventSource(NULL, a); + h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); ptbuf[0] = a; ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL); DeregisterEventSource(h); @@ -87,9 +87,10 @@ void DebugEvent(char *a,char *b,...) va_list marker; if (!ISLOGONTRACE(TraceOption)) return; - h = RegisterEventSource(NULL, a); + h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); va_start(marker,b); _vsnprintf(buf,MAXBUF_,b,marker); + buf[MAXBUF_] = '\0'; ptbuf[0] = buf; ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);\ DeregisterEventSource(h); @@ -138,7 +139,7 @@ WCHAR *GetLogonScript(CHAR *pname) return NULL; } - buf=(WCHAR *)LocalAlloc(LMEM_FIXED, LSPsize); + buf=(WCHAR *)LocalAlloc(LMEM_FIXED,LSPsize); script=(WCHAR *)LocalAlloc(LMEM_FIXED,LSPsize+(MAXRANDOMNAMELEN)*sizeof(WCHAR)); /* * Explicitly call UNICODE version @@ -148,18 +149,18 @@ WCHAR *GetLogonScript(CHAR *pname) &LSPtype, (LPBYTE)buf, &LSPsize); MultiByteToWideChar(CP_ACP,0,pname,strlen(pname)+1,randomName,(strlen(pname)+1)*sizeof(WCHAR)); swprintf(script,buf,randomName); - free(buf); + LocalFree(buf); #ifdef DEBUG_VERBOSE - { + { HANDLE h; char *ptbuf[1],buf[132],tbuf[255]; WideCharToMultiByte(CP_ACP,0,script,LSPsize,tbuf,255,NULL,NULL); - h = RegisterEventSource(NULL, "AFS AfsLogon - GetLogonScript"); + h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); sprintf(buf, "Script[%s,%d] Return Code[%x]",tbuf,LSPsize,code); ptbuf[0] = buf; ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL); DeregisterEventSource(h); - } + } #endif RegCloseKey (NPKey); @@ -193,7 +194,7 @@ BOOLEAN AFSWillAutoStart(void) goto close_svc; /* Allocate buffer */ - pConfig = (LPQUERY_SERVICE_CONFIG)GlobalAlloc(GMEM_FIXED, BufSize); + pConfig = (LPQUERY_SERVICE_CONFIG)GlobalAlloc(GMEM_FIXED,BufSize); if (!pConfig) goto close_svc; @@ -235,6 +236,7 @@ BOOLEAN APIENTRY DllEntryPoint(HANDLE dll, DWORD reason, PVOID reserved) case DLL_PROCESS_ATTACH: /* Initialize AFS libraries */ rx_Init(0); + initAFSDirPath(); ka_Init(0); break; @@ -262,52 +264,52 @@ DWORD APIENTRY NPGetCaps(DWORD index) static void GetLoginBehavior(int *pRetryInterval, BOOLEAN *pFailSilently) { - long result; - HKEY hKey; - DWORD dummyLen; + long result; + HKEY hKey; + DWORD dummyLen; result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PARMS_KEY, 0, KEY_QUERY_VALUE, &hKey); - if (result != ERROR_SUCCESS) { - *pRetryInterval = DEFAULT_RETRY_INTERVAL; - *pFailSilently = DEFAULT_FAIL_SILENTLY; - return; - } + if (result != ERROR_SUCCESS) { + *pRetryInterval = DEFAULT_RETRY_INTERVAL; + *pFailSilently = DEFAULT_FAIL_SILENTLY; + return; + } - result = RegQueryValueEx(hKey, REG_CLIENT_RETRY_INTERVAL_PARM, 0, 0, (BYTE *)pRetryInterval, &dummyLen); - if (result != ERROR_SUCCESS) - *pRetryInterval = DEFAULT_RETRY_INTERVAL; + result = RegQueryValueEx(hKey, REG_CLIENT_RETRY_INTERVAL_PARM, 0, 0, (BYTE *)pRetryInterval, &dummyLen); + if (result != ERROR_SUCCESS) + *pRetryInterval = DEFAULT_RETRY_INTERVAL; - result = RegQueryValueEx(hKey, REG_CLIENT_FAIL_SILENTLY_PARM, 0, 0, (BYTE *)pFailSilently, &dummyLen); - if (result != ERROR_SUCCESS) - *pFailSilently = DEFAULT_FAIL_SILENTLY; + result = RegQueryValueEx(hKey, REG_CLIENT_FAIL_SILENTLY_PARM, 0, 0, (BYTE *)pFailSilently, &dummyLen); + if (result != ERROR_SUCCESS) + *pFailSilently = DEFAULT_FAIL_SILENTLY; - /* Make sure this is really a bool value in the strict sense*/ - *pFailSilently = !!*pFailSilently; - - RegCloseKey(hKey); -} + /* Make sure this is really a bool value in the strict sense*/ + *pFailSilently = !!*pFailSilently; + + RegCloseKey(hKey); +} BOOL IsServiceRunning (void) { - SERVICE_STATUS Status; - SC_HANDLE hManager; - memset (&Status, 0x00, sizeof(Status)); - Status.dwCurrentState = SERVICE_STOPPED; - - if ((hManager = OpenSCManager (NULL, NULL, GENERIC_READ)) != NULL) - { - SC_HANDLE hService; - if ((hService = OpenService (hManager, TEXT("TransarcAFSDaemon"), GENERIC_READ)) != NULL) - { + SERVICE_STATUS Status; + SC_HANDLE hManager; + memset (&Status, 0x00, sizeof(Status)); + Status.dwCurrentState = SERVICE_STOPPED; + + if ((hManager = OpenSCManager (NULL, NULL, GENERIC_READ)) != NULL) + { + SC_HANDLE hService; + if ((hService = OpenService (hManager, TEXT("TransarcAFSDaemon"), GENERIC_READ)) != NULL) + { QueryServiceStatus (hService, &Status); CloseServiceHandle (hService); - } + } - CloseServiceHandle (hManager); - } - DebugEvent("AFS AfsLogon - Test Service Running","Return Code[%x] ?Running[%d]",Status.dwCurrentState,(Status.dwCurrentState == SERVICE_RUNNING)); - return (Status.dwCurrentState == SERVICE_RUNNING); -} + CloseServiceHandle (hManager); + } + DebugEvent("AFS AfsLogon - Test Service Running","Return Code[%x] ?Running[%d]",Status.dwCurrentState,(Status.dwCurrentState == SERVICE_RUNNING)); + return (Status.dwCurrentState == SERVICE_RUNNING); +} DWORD APIENTRY NPLogonNotify( PLUID lpLogonId, @@ -319,10 +321,10 @@ DWORD APIENTRY NPLogonNotify( LPVOID StationHandle, LPWSTR *lpLogonScript) { - char uname[256]; + char uname[256]=""; char *ctemp; - char password[256]; - char cell[256]; + char password[256]=""; + char cell[256]=""; MSV1_0_INTERACTIVE_LOGON *IL; DWORD code; int pw_exp; @@ -337,6 +339,9 @@ DWORD APIENTRY NPLogonNotify( int sleepInterval = DEFAULT_SLEEP_INTERVAL; /* seconds */ BOOLEAN afsWillAutoStart; CHAR RandomName[MAXRANDOMNAMELEN]; + BOOLEAN uppercased_name = TRUE; + + /* Initialize Logon Script to none */ *lpLogonScript=NULL; IL = (MSV1_0_INTERACTIVE_LOGON *) lpAuthentInfo; @@ -349,147 +354,191 @@ DWORD APIENTRY NPLogonNotify( wcstombs(password, IL->Password.Buffer, 256); /* Make sure AD-DOMANS sent from login that is sent to us is striped */ - ctemp = strchr(uname, '@'); - if (ctemp) *ctemp = 0; + ctemp = strchr(uname, '@'); + if (ctemp) *ctemp = 0; + + /* is the name all uppercase? */ + for ( ctemp = uname; *ctemp ; ctemp++) { + if ( islower(*ctemp) ) { + uppercased_name = FALSE; + break; + } + } (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PARMS_KEY, - 0, KEY_QUERY_VALUE, &NPKey); + 0, KEY_QUERY_VALUE, &NPKey); LSPsize=sizeof(TraceOption); RegQueryValueEx(NPKey, "TraceOption", NULL, - &LSPtype, (LPBYTE)&TraceOption, &LSPsize); - RegCloseKey (NPKey); + &LSPtype, (LPBYTE)&TraceOption, &LSPsize); + RegCloseKey (NPKey); /* * Get Logon OPTIONS */ (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PROVIDER_KEY, - 0, KEY_QUERY_VALUE, &NPKey); + 0, KEY_QUERY_VALUE, &NPKey); LSPsize=sizeof(LogonOption); code = RegQueryValueEx(NPKey, "LogonOptions", NULL, - &LSPtype, (LPBYTE)&LogonOption, &LSPsize); + &LSPtype, (LPBYTE)&LogonOption, &LSPsize); RegCloseKey (NPKey); if ((code!=0) || (LSPtype!=REG_DWORD)) LogonOption=LOGON_OPTION_INTEGRATED; /*default to integrated logon only*/ - DebugEvent("AFS AfsLogon - NPLogonNotify","LogonOption[%x], Service AutoStart[%d]",LogonOption,AFSWillAutoStart()); - /* Check for zero length password if integrated logon*/ - if ( ISLOGONINTEGRATED(LogonOption) && (password[0] == 0) ) { - code = GT_PW_NULL; - reason = "zero length password is illegal"; - code=0; - } - /* Get cell name if doing integrated logon */ - if (ISLOGONINTEGRATED(LogonOption)) - { + afsWillAutoStart = AFSWillAutoStart(); + + DebugEvent("AFS AfsLogon - NPLogonNotify","LogonOption[%x], Service AutoStart[%d]", + LogonOption,afsWillAutoStart); + + /* Get local machine specified login behavior (or defaults) */ + GetLoginBehavior(&retryInterval, &failSilently); + + /* Check for zero length password if integrated logon*/ + if ( ISLOGONINTEGRATED(LogonOption) ) { + if ( password[0] == 0 ) { + code = GT_PW_NULL; + reason = "zero length password is illegal"; + code=0; + } + + /* Get cell name if doing integrated logon */ code = cm_GetRootCellName(cell); if (code < 0) { code = KTC_NOCELL; reason = "unknown cell"; code=0; } - } - - /* Get user specified login behavior (or defaults) */ - GetLoginBehavior(&retryInterval, &failSilently); - - afsWillAutoStart = AFSWillAutoStart(); - - *lpLogonScript = GetLogonScript(GenRandomName(RandomName)); /*only do if high security option is on*/ + /*only do if high security option is on*/ + if (ISHIGHSECURITY(LogonOption)) + *lpLogonScript = GetLogonScript(GenRandomName(RandomName)); + } /* loop until AFS is started. */ while (TRUE) { - code=0; + code=0; - /* is service started yet?*/ - if (ISLOGONINTEGRATED(LogonOption) && !ISHIGHSECURITY(LogonOption)) /* if Integrated Logon only */ + /* is service started yet?*/ + DebugEvent("AFS AfsLogon - ka_UserAuthenticateGeneral2","Code[%x] uname[%s] Cell[%s]", + code,uname,cell); + + /* if Integrated Logon only */ + if (ISLOGONINTEGRATED(LogonOption) && !ISHIGHSECURITY(LogonOption)) { - DebugEvent("AFS AfsLogon - ka_UserAuthenticateGeneral2","Code[%x],uame[%s] Cell[%s]",code,uname,cell); - code = ka_UserAuthenticateGeneral2( - KA_USERAUTH_VERSION+KA_USERAUTH_AUTHENT_LOGON, - uname, "", cell, password,uname, 0, &pw_exp, 0, - &reason); - DebugEvent("AFS AfsLogon - (INTEGERTED only)ka_UserAuthenticateGeneral2","Code[%x]",code); - } else if (ISLOGONINTEGRATED(LogonOption) && ISHIGHSECURITY(LogonOption)) /* if Integrated Logon and High Security pass random generated name*/ + if ( KFW_is_available() ) + code = KFW_AFS_get_cred(uname, cell, password, 0, uname, &reason); + else + code = ka_UserAuthenticateGeneral2(KA_USERAUTH_VERSION+KA_USERAUTH_AUTHENT_LOGON, + uname, "", cell, password, uname, 0, &pw_exp, 0, + &reason); + DebugEvent("AFS AfsLogon - (INTEGRATED only)ka_UserAuthenticateGeneral2","Code[%x]", + code); + if ( code && code != KTC_NOCM && code != KTC_NOCMRPC && uppercased_name ) { + for ( ctemp = uname; *ctemp ; ctemp++) { + *ctemp = tolower(*ctemp); + } + uppercased_name = FALSE; + continue; + } + } + /* if Integrated Logon and High Security pass random generated name*/ + else if (ISLOGONINTEGRATED(LogonOption) && ISHIGHSECURITY(LogonOption)) { - code = ka_UserAuthenticateGeneral2( - KA_USERAUTH_VERSION+KA_USERAUTH_AUTHENT_LOGON, - uname, "", cell, password,RandomName, 0, &pw_exp, 0, - &reason); - DebugEvent("AFS AfsLogon - (Both)ka_UserAuthenticateGeneral2","Code[%x],RandomName[%s]",code,RandomName); - } else { /*JUST check to see if its running*/ + if ( KFW_is_available() ) + code = KFW_AFS_get_cred(uname, cell, password, 0, RandomName, &reason); + else + code = ka_UserAuthenticateGeneral2(KA_USERAUTH_VERSION+KA_USERAUTH_AUTHENT_LOGON, + uname, "", cell, password,RandomName, 0, &pw_exp, 0, + &reason); + DebugEvent("AFS AfsLogon - (Both)ka_UserAuthenticateGeneral2","Code[%x] RandomName[%s]", + code, RandomName); + + if ( code && code != KTC_NOCM && code != KTC_NOCMRPC && uppercased_name ) { + for ( ctemp = uname; *ctemp ; ctemp++) { + *ctemp = tolower(*ctemp); + } + uppercased_name = FALSE; + continue; + } + } else { + /*JUST check to see if its running*/ if (IsServiceRunning()) - break; + break; code = KTC_NOCM; if (!afsWillAutoStart) - break; + break; } - + /* If we've failed because the client isn't running yet and the - * client is set to autostart (and therefore it makes sense for - * us to wait for it to start) then sleep a while and try again. - * If the error was something else, then give up. */ + * client is set to autostart (and therefore it makes sense for + * us to wait for it to start) then sleep a while and try again. + * If the error was something else, then give up. */ if (code != KTC_NOCM && code != KTC_NOCMRPC || !afsWillAutoStart) break; - /* If the retry interval has expired and we still aren't - * logged in, then just give up if we are not in interactive - * mode or the failSilently flag is set, otherwise let the - * user know we failed and give them a chance to try again. */ + /* If the retry interval has expired and we still aren't + * logged in, then just give up if we are not in interactive + * mode or the failSilently flag is set, otherwise let the + * user know we failed and give them a chance to try again. */ if (retryInterval <= 0) { - reason = "AFS not running"; - if (!interactive || failSilently) - break; + reason = "AFS not running"; + if (!interactive || failSilently) + break; flag = MessageBox(hwndOwner, - "AFS is still starting. Retry?", - "AFS Logon", - MB_ICONQUESTION | MB_RETRYCANCEL); + "AFS is still starting. Retry?", + "AFS Logon", + MB_ICONQUESTION | MB_RETRYCANCEL); if (flag == IDCANCEL) - break; - - /* Wait just a little while and try again */ - retryInterval = sleepInterval = DEFAULT_SLEEP_INTERVAL; + break; + + /* Wait just a little while and try again */ + retryInterval = sleepInterval = DEFAULT_SLEEP_INTERVAL; } - + if (retryInterval < sleepInterval) sleepInterval = retryInterval; - + Sleep(sleepInterval * 1000); retryInterval -= sleepInterval; - } + } + + /* remove any kerberos 5 tickets currently held by the SYSTEM account */ + if ( KFW_is_available() ) + KFW_AFS_destroy_tickets_for_cell(cell); if (code) { - char msg[128]; + char msg[128]; sprintf(msg, "Integrated login failed: %s", reason); - + if (interactive && !failSilently) MessageBox(hwndOwner, msg, "AFS Logon", MB_OK); else { - HANDLE h; - char *ptbuf[1]; - - h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); - ptbuf[0] = msg; - ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, 1008, NULL, - 1, 0, ptbuf, NULL); - DeregisterEventSource(h); - } + HANDLE h; + char *ptbuf[1]; + + h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); + ptbuf[0] = msg; + ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, 1008, NULL, + 1, 0, ptbuf, NULL); + DeregisterEventSource(h); + } code = MapAuthError(code); SetLastError(code); - if (ISHIGHSECURITY(LogonOption) && (code!=0)) + + if (ISLOGONINTEGRATED(LogonOption) && (code!=0)) { if (*lpLogonScript) LocalFree(*lpLogonScript); *lpLogonScript = NULL; - if (!(afsWillAutoStart || ISLOGONINTEGRATED(LogonOption))) // its not running, so if not autostart or integrated logon then just skip - return 0; + if (!afsWillAutoStart) // its not running, so if not autostart or integrated logon then just skip + code = 0; } } + DebugEvent("AFS AfsLogon - Exit","Return Code[%x]",code); return code; } diff --git a/src/WINNT/afsd/cklog.c b/src/WINNT/afsd/cklog.c index 24a607265..9f3d901ac 100644 --- a/src/WINNT/afsd/cklog.c +++ b/src/WINNT/afsd/cklog.c @@ -19,7 +19,7 @@ #define AFS_KERBEROS_ENV -#define KABADARGUMENT 1 +#define BAD_ARGUMENT 1 #define KLOGEXIT(code) exit(code) int CommandProc(); @@ -226,7 +226,7 @@ CommandProc (as, arock) if (size <= 0 || size >= sizeof(name)) { size = sizeof(name) - 1; if (!GetUserName(name, &size)) { - KLOGEXIT( KABADARGUMENT ); + KLOGEXIT( BAD_ARGUMENT ); } } } @@ -251,7 +251,7 @@ CommandProc (as, arock) bad_lifetime: if (!Silent) fprintf (stderr, "%s: translating '%s' to lifetime failed\n", rn, life); - return KABADARGUMENT; + return BAD_ARGUMENT; } if (*sp == ':') { life = sp+1; /* skip the colon */ @@ -269,7 +269,7 @@ bad_lifetime: fprintf (stderr, "%s: a lifetime of %.2f hours is too long, must be less than %d.\n", rn, (double)lifetime/3600.0, MAXKTCTICKETLIFETIME/3600); - KLOGEXIT( KABADARGUMENT ); + KLOGEXIT( BAD_ARGUMENT ); } } else lifetime = 0; @@ -289,7 +289,7 @@ bad_lifetime: reason = NULL; if (reason) { fprintf (stderr, "Unable to login because %s.\n", reason); - KLOGEXIT( KABADARGUMENT ); + KLOGEXIT( BAD_ARGUMENT ); } } } diff --git a/src/WINNT/afsd/cm.h b/src/WINNT/afsd/cm.h index 600199761..62fa7f88e 100644 --- a/src/WINNT/afsd/cm.h +++ b/src/WINNT/afsd/cm.h @@ -17,11 +17,12 @@ #endif /* DJGPP */ /* from .xg file */ -long VL_GetEntryByID(struct rx_connection *, long, long, struct vldbentry *); -long VL_GetEntryByNameO(struct rx_connection *, char *, struct vldbentry *); -long VL_ProbeServer(struct rx_connection *); -long VL_GetEntryBYIDN(struct rx_connection *, long, long, struct nvldbentry *); -long VL_GetEntryByNameN(struct rx_connection *, char *, struct nvldbentry *); +/* FIXME: these were "long" but Windows NT wants "int" */ +int VL_GetEntryByID(struct rx_connection *, afs_int32, afs_int32, struct vldbentry *); +int VL_GetEntryByNameO(struct rx_connection *, char *, struct vldbentry *); +int VL_ProbeServer(struct rx_connection *); +int VL_GetEntryBYIDN(struct rx_connection *, afs_int32, afs_int32, struct nvldbentry *); +int VL_GetEntryByNameN(struct rx_connection *, char *, struct nvldbentry *); /* from .xg file */ extern StartRXAFS_FetchData (struct rx_call *, @@ -48,9 +49,9 @@ extern RXAFS_FetchStatus (struct rx_connection *, int StartRXAFS_StoreData (struct rx_call *, struct AFSFid *Fid, struct AFSStoreStatus *InStatus, - afs_int32 Pos, - afs_int32 Length, - afs_int32 FileLength); + afs_uint32 Pos, + afs_uint32 Length, + afs_uint32 FileLength); int EndRXAFS_StoreData(struct rx_call *, struct AFSFetchStatus *OutStatus, @@ -218,7 +219,6 @@ int RXAFS_Lookup (struct rx_connection *, #define CM_ERROR_EXISTS (CM_ERROR_BASE+11) #define CM_ERROR_CROSSDEVLINK (CM_ERROR_BASE+12) #define CM_ERROR_BADOP (CM_ERROR_BASE+13) -#define CM_ERROR_BADSMB (CM_ERROR_BASE+32) /* CM_ERROR_BADPASSWORD used to be here */ #define CM_ERROR_NOTDIR (CM_ERROR_BASE+15) #define CM_ERROR_ISDIR (CM_ERROR_BASE+16) @@ -235,9 +235,8 @@ int RXAFS_Lookup (struct rx_connection *, #define CM_ERROR_REMOTECONN (CM_ERROR_BASE+27) #define CM_ERROR_ATSYS (CM_ERROR_BASE+28) #define CM_ERROR_NOSUCHPATH (CM_ERROR_BASE+29) - #define CM_ERROR_CLOCKSKEW (CM_ERROR_BASE+31) - +#define CM_ERROR_BADSMB (CM_ERROR_BASE+32) #define CM_ERROR_ALLBUSY (CM_ERROR_BASE+33) #define CM_ERROR_NOFILES (CM_ERROR_BASE+34) #define CM_ERROR_PARTIALWRITE (CM_ERROR_BASE+35) @@ -246,5 +245,5 @@ int RXAFS_Lookup (struct rx_connection *, #define CM_ERROR_BUFFERTOOSMALL (CM_ERROR_BASE+38) #define CM_ERROR_RENAME_IDENTICAL (CM_ERROR_BASE+39) #define CM_ERROR_ALLOFFLINE (CM_ERROR_BASE+40) - +#define CM_ERROR_AMBIGUOUS_FILENAME (CM_ERROR_BASE+41) #endif /* __CM_H_ENV__ */ diff --git a/src/WINNT/afsd/cm_access.c b/src/WINNT/afsd/cm_access.c index 9b6e1e358..740ec3ec6 100644 --- a/src/WINNT/afsd/cm_access.c +++ b/src/WINNT/afsd/cm_access.c @@ -118,43 +118,43 @@ long cm_GetAccessRights(struct cm_scache *scp, struct cm_user *up, { long code; cm_fid_t tfid; - cm_scache_t *aclScp; + cm_scache_t *aclScp; /* pretty easy: just force a pass through the fetch status code */ osi_Log2(afsd_logp, "GetAccess scp %x user %x", scp, up); - /* first, start by finding out whether we have a directory or something + /* first, start by finding out whether we have a directory or something * else, so we can find what object's ACL we need. - */ - code = cm_SyncOp(scp, NULL, up, reqp, 0, CM_SCACHESYNC_GETSTATUS - | CM_SCACHESYNC_NEEDCALLBACK); + */ + code = cm_SyncOp(scp, NULL, up, reqp, 0, CM_SCACHESYNC_GETSTATUS + | CM_SCACHESYNC_NEEDCALLBACK); - if (code) return code; + if (code) return code; - if (scp->fileType != CM_SCACHETYPE_DIRECTORY) { + if (scp->fileType != CM_SCACHETYPE_DIRECTORY) { /* not a dir, use parent dir's acl */ tfid.cell = scp->fid.cell; - tfid.volume = scp->fid.volume; - tfid.vnode = scp->parentVnode; - tfid.unique = scp->parentUnique; + tfid.volume = scp->fid.volume; + tfid.vnode = scp->parentVnode; + tfid.unique = scp->parentUnique; lock_ReleaseMutex(&scp->mx); code = cm_GetSCache(&tfid, &aclScp, up, reqp); - if (code) { + if (code) { lock_ObtainMutex(&scp->mx); - return code; - } + return code; + } osi_Log1(afsd_logp, "GetAccess parent %x", aclScp); lock_ObtainMutex(&aclScp->mx); - code = cm_GetCallback(aclScp, up, reqp, 1); - lock_ReleaseMutex(&aclScp->mx); - cm_ReleaseSCache(aclScp); - lock_ObtainMutex(&scp->mx); - } - else { + code = cm_GetCallback(aclScp, up, reqp, 1); + lock_ReleaseMutex(&aclScp->mx); + cm_ReleaseSCache(aclScp); + lock_ObtainMutex(&scp->mx); + } + else { code = cm_GetCallback(scp, up, reqp, 1); - } + } return code; } diff --git a/src/WINNT/afsd/cm_aclent.c b/src/WINNT/afsd/cm_aclent.c index c0433753a..6dc9dff77 100644 --- a/src/WINNT/afsd/cm_aclent.c +++ b/src/WINNT/afsd/cm_aclent.c @@ -104,10 +104,10 @@ static cm_aclent_t *GetFreeACLEnt(void) aclp->backp = NULL; } - /* release the old user */ - if (aclp->userp) { + /* release the old user */ + if (aclp->userp) { cm_ReleaseUser(aclp->userp); - aclp->userp = NULL; + aclp->userp = NULL; } return aclp; } @@ -144,8 +144,8 @@ long cm_AddACLCache(cm_scache_t *scp, cm_user_t *userp, long rights) aclp->backp = scp; aclp->nextp = scp->randomACLp; scp->randomACLp = aclp; + cm_HoldUser(userp); aclp->userp = userp; - cm_HoldUser(userp); aclp->randomAccess = rights; aclp->tgtLifetime = cm_TGTLifeTime(userp); lock_ReleaseWrite(&cm_aclLock); @@ -228,8 +228,8 @@ void cm_InvalidateACLUser(cm_scache_t *scp, cm_user_t *userp) for (aclp = *laclpp; aclp; laclpp = &aclp->nextp, aclp = *laclpp) { if (userp == aclp->userp) { /* One for a given user/scache */ *laclpp = aclp->nextp; - cm_ReleaseUser(aclp->userp); - aclp->userp = NULL; + cm_ReleaseUser(aclp->userp); + aclp->userp = NULL; aclp->backp = (struct cm_scache *) 0; break; } diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index b4790d9d1..6f5a30cad 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -22,7 +22,7 @@ #include "afsd.h" -void afsi_log(); +extern void afsi_log(char *pattern, ...); /* This module implements the buffer package used by the local transaction * system (cm). It is initialized by calling cm_Init, which calls buf_Init; @@ -401,6 +401,9 @@ long buf_AddBuffers(long nbuffers) HANDLE hm; long cs; + afsi_log("%d buffers being added to the existing cache of size %d", + nbuffers, buf_nbuffers); + /* * Cache file mapping constrained by * system allocation granularity; @@ -1368,43 +1371,83 @@ long buf_CleanVnode(struct cm_scache *scp, cm_user_t *userp, cm_req_t *reqp) { long code; cm_buf_t *bp; /* buffer we're hacking on */ - cm_buf_t *nbp; /* next one */ + cm_buf_t *nbp; /* next one */ long i; i = BUF_FILEHASH(&scp->fid); code = 0; lock_ObtainWrite(&buf_globalLock); - bp = buf_fileHashTablepp[i]; - if (bp) bp->refCount++; - lock_ReleaseWrite(&buf_globalLock); + bp = buf_fileHashTablepp[i]; + if (bp) bp->refCount++; + lock_ReleaseWrite(&buf_globalLock); for(; bp; bp = nbp) { /* clean buffer synchronously */ if (cm_FidCmp(&bp->fid, &scp->fid) == 0) { if (userp) { + cm_HoldUser(userp); lock_ObtainMutex(&bp->mx); - if (bp->userp) cm_ReleaseUser(bp->userp); - bp->userp = userp; + if (bp->userp) + cm_ReleaseUser(bp->userp); + bp->userp = userp; lock_ReleaseMutex(&bp->mx); - cm_HoldUser(userp); - } + } buf_CleanAsync(bp, reqp); - buf_CleanWait(bp); - lock_ObtainMutex(&bp->mx); + buf_CleanWait(bp); + lock_ObtainMutex(&bp->mx); if (bp->flags & CM_BUF_ERROR) { if (code == 0 || code == -1) code = bp->error; - if (code == 0) code = -1; - } - lock_ReleaseMutex(&bp->mx); + if (code == 0) code = -1; + } + lock_ReleaseMutex(&bp->mx); } lock_ObtainWrite(&buf_globalLock); buf_LockedRelease(bp); - nbp = bp->fileHashp; - if (nbp) nbp->refCount++; + nbp = bp->fileHashp; + if (nbp) nbp->refCount++; lock_ReleaseWrite(&buf_globalLock); } /* for loop over a bunch of buffers */ - /* done */ + /* done */ return code; } + +/* dump the contents of the buf_hashTablepp. */ +int cm_DumpBufHashTable(FILE *outputFile, char *cookie) +{ + int zilch; + cm_buf_t *bp; + char output[1024]; + int i; + + if (buf_hashTablepp == NULL) + return -1; + + lock_ObtainRead(&buf_globalLock); + + sprintf(output, "%s - dumping buf_HashTable - buf_hashSize=%d\n", cookie, buf_hashSize); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + + for (i = 0; i < buf_hashSize; i++) + { + for(bp = buf_hashTablepp[i]; bp; bp=bp->hashp) + { + if (bp->refCount) + { + sprintf(output, "%s bp=0x%08X, hash=%d, fid (cell=%d, volume=%d," + "vnode=%d, unique=%d), size=%d refCount=%d\n", + cookie, (void *)bp, i, bp->fid.cell, bp->fid.volume, + bp->fid.vnode, bp->fid.unique, bp->size, bp->refCount); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + } + } + } + + sprintf(output, "%s - Done dumping buf_HashTable.\n", cookie); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + + lock_ReleaseRead(&buf_globalLock); + return 0; +} + diff --git a/src/WINNT/afsd/cm_callback.c b/src/WINNT/afsd/cm_callback.c index 5862c1292..81f1f423c 100644 --- a/src/WINNT/afsd/cm_callback.c +++ b/src/WINNT/afsd/cm_callback.c @@ -25,6 +25,8 @@ #include "afsd.h" +/*extern void afsi_log(char *pattern, ...);*/ + /* read/write lock for all global storage in this module */ osi_rwlock_t cm_callbackLock; @@ -745,14 +747,15 @@ long cm_GetCallback(cm_scache_t *scp, struct cm_user *userp, struct cm_req *reqp, long flags) { long code; - cm_conn_t *connp; - AFSFetchStatus afsStatus; - AFSVolSync volSync; - AFSCallBack callback; - AFSFid tfid; - cm_callbackRequest_t cbr; - int mustCall; - long sflags; + cm_conn_t *connp; + AFSFetchStatus afsStatus; + AFSVolSync volSync; + AFSCallBack callback; + AFSFid tfid; + cm_callbackRequest_t cbr; + int mustCall; + long sflags; + cm_fid_t sfid; #ifdef AFS_FREELANCE_CLIENT // yj @@ -760,14 +763,14 @@ long cm_GetCallback(cm_scache_t *scp, struct cm_user *userp, // specially. We need to fetch the status by calling // cm_MergeStatus and mark that cm_fakeDirCallback is 2 if (cm_freelanceEnabled && - scp->fid.cell==0x1 && + scp->fid.cell==0x1 && scp->fid.volume==0x20000001 && scp->fid.unique==0x1 && scp->fid.vnode==0x1) { // Start by indicating that we're in the process // of fetching the callback - lock_ObtainMutex(&cm_Freelance_Lock); + lock_ObtainMutex(&cm_Freelance_Lock); cm_fakeGettingCallback = 1; lock_ReleaseMutex(&cm_Freelance_Lock); @@ -796,41 +799,42 @@ long cm_GetCallback(cm_scache_t *scp, struct cm_user *userp, while (1) { if (!mustCall && cm_HaveCallback(scp)) return 0; - /* turn off mustCall, since it has now forced us past the check above */ - mustCall = 0; + /* turn off mustCall, since it has now forced us past the check above */ + mustCall = 0; - /* otherwise, we have to make an RPC to get the status */ + /* otherwise, we have to make an RPC to get the status */ sflags = CM_SCACHESYNC_FETCHSTATUS | CM_SCACHESYNC_GETCALLBACK; - cm_SyncOp(scp, NULL, NULL, NULL, 0, sflags); - cm_StartCallbackGrantingCall(scp, &cbr); + cm_SyncOp(scp, NULL, NULL, NULL, 0, sflags); + cm_StartCallbackGrantingCall(scp, &cbr); + sfid = scp->fid; lock_ReleaseMutex(&scp->mx); /* now make the RPC */ osi_Log1(afsd_logp, "CALL FetchStatus vp %x", (long) scp); - do { - code = cm_Conn(&scp->fid, userp, reqp, &connp); - if (code) continue; + do { + code = cm_Conn(&sfid, userp, reqp, &connp); + if (code) continue; - code = RXAFS_FetchStatus(connp->callp, &tfid, - &afsStatus, &callback, &volSync); + code = RXAFS_FetchStatus(connp->callp, &tfid, + &afsStatus, &callback, &volSync); - } while (cm_Analyze(connp, userp, reqp, &scp->fid, &volSync, - &cbr, code)); - code = cm_MapRPCError(code, reqp); + } while (cm_Analyze(connp, userp, reqp, &sfid, &volSync, + &cbr, code)); + code = cm_MapRPCError(code, reqp); osi_Log0(afsd_logp, "CALL FetchStatus DONE"); lock_ObtainMutex(&scp->mx); - cm_SyncOpDone(scp, NULL, sflags); + cm_SyncOpDone(scp, NULL, sflags); if (code == 0) { - cm_EndCallbackGrantingCall(scp, &cbr, &callback, 0); - cm_MergeStatus(scp, &afsStatus, &volSync, userp, 0); - } - else - cm_EndCallbackGrantingCall(NULL, NULL, NULL, 0); - - /* now check to see if we got an error */ - if (code) return code; - } + cm_EndCallbackGrantingCall(scp, &cbr, &callback, 0); + cm_MergeStatus(scp, &afsStatus, &volSync, userp, 0); + } + else + cm_EndCallbackGrantingCall(NULL, NULL, NULL, 0); + + /* now check to see if we got an error */ + if (code) return code; + } } /* called periodically by cm_daemon to shut down use of expired callbacks */ @@ -865,3 +869,11 @@ int SRXAFSCB_GetCellByNum(struct rx_call *a_call, afs_int32 a_cellnum, /* XXXX */ return RXGEN_OPCODE; } + +/* debug interface: not implemented */ +int SRXAFSCB_TellMeAboutYourself(struct rx_call *a_call, afs_int32 a_cellnum, + char **a_name, serverList *a_hosts) +{ + /* XXXX */ + return RXGEN_OPCODE; +} diff --git a/src/WINNT/afsd/cm_cell.c b/src/WINNT/afsd/cm_cell.c index e2ba9e4ca..c2e942a1c 100644 --- a/src/WINNT/afsd/cm_cell.c +++ b/src/WINNT/afsd/cm_cell.c @@ -63,65 +63,73 @@ cm_cell_t *cm_GetCell(char *namep, long flags) cm_cell_t *cm_GetCell_Gen(char *namep, char *newnamep, long flags) { cm_cell_t *cp; - long code; - static cellCounter = 1; /* locked by cm_cellLock */ + long code; + static cellCounter = 1; /* locked by cm_cellLock */ int ttl; - char fullname[200]; + char fullname[200]=""; lock_ObtainWrite(&cm_cellLock); for(cp = cm_allCellsp; cp; cp=cp->nextp) { if (strcmp(namep, cp->namep) == 0) { - strcpy(fullname, cp->namep); - break; + strcpy(fullname, cp->namep); + break; } - } + } if ((!cp && (flags & CM_FLAG_CREATE)) #ifdef AFS_AFSDB_ENV - /* if it's from DNS, see if it has expired */ - || (cp && (cp->flags & CM_CELLFLAG_DNS) && (time(0) > cp->timeout)) + /* if it's from DNS, see if it has expired */ + || (cp && (cp->flags & CM_CELLFLAG_DNS) && (time(0) > cp->timeout)) #endif ) { if (!cp) cp = malloc(sizeof(*cp)); - memset(cp, 0, sizeof(*cp)); - code = cm_SearchCellFile(namep, fullname, cm_AddCellProc, cp); + memset(cp, 0, sizeof(*cp)); + code = cm_SearchCellFile(namep, fullname, cm_AddCellProc, cp); if (code) { + afsi_log("in cm_GetCell_gen cm_SearchCellFile(%s) returns code= %d fullname= %s", + namep, code, fullname); + #ifdef AFS_AFSDB_ENV - if (cm_dnsEnabled /*&& cm_DomainValid(namep)*/) - code = cm_SearchCellByDNS(namep, fullname, &ttl, cm_AddCellProc, cp); + if (cm_dnsEnabled /*&& cm_DomainValid(namep)*/) { + code = cm_SearchCellByDNS(namep, fullname, &ttl, cm_AddCellProc, cp); + if ( code ) + afsi_log("in cm_GetCell_gen cm_SearchCellByDNS(%s) returns code= %d fullname= %s", + namep, code, fullname); + } #endif - if (code) { - free(cp); - cp = NULL; - goto done; - } + if (code) { + free(cp); + cp = NULL; + goto done; + } #ifdef AFS_AFSDB_ENV - else { /* got cell from DNS */ - cp->flags |= CM_CELLFLAG_DNS; - cp->timeout = time(0) + ttl; - } + else { /* got cell from DNS */ + cp->flags |= CM_CELLFLAG_DNS; + cp->timeout = time(0) + ttl; + } #endif } /* randomise among those vlservers having the same rank*/ cm_RandomizeServer(&cp->vlServersp); - /* otherwise we found the cell, and so we're nearly done */ - lock_InitializeMutex(&cp->mx, "cm_cell_t mutex"); + /* otherwise we found the cell, and so we're nearly done */ + lock_InitializeMutex(&cp->mx, "cm_cell_t mutex"); /* copy in name */ - cp->namep = malloc(strlen(fullname)+1); - strcpy(cp->namep, fullname); + cp->namep = malloc(strlen(fullname)+1); + strcpy(cp->namep, fullname); /* thread on global list */ - cp->nextp = cm_allCellsp; - cm_allCellsp = cp; + cp->nextp = cm_allCellsp; + cm_allCellsp = cp; - cp->cellID = cellCounter++; - } + cp->cellID = cellCounter++; + } -done: - if (newnamep) + done: + /* fullname is not valid if cp == NULL */ + if (cp && newnamep) strcpy(newnamep, fullname); lock_ReleaseWrite(&cm_cellLock); return cp; diff --git a/src/WINNT/afsd/cm_config.c b/src/WINNT/afsd/cm_config.c index 2501ff85a..af94ede2c 100644 --- a/src/WINNT/afsd/cm_config.c +++ b/src/WINNT/afsd/cm_config.c @@ -23,17 +23,25 @@ #include "cm_config.h" #ifdef AFS_AFSDB_ENV +#if !defined(DJGPP) && defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x500 +#include +#define DNSAPI_ENV +#else #include "cm_dns.h" +#endif #include #endif char AFSConfigKeyName[] = "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"; +/* TODO: these should be pulled in from dirpath.h */ #define AFS_THISCELL "ThisCell" #define AFS_CELLSERVDB_UNIX "CellServDB" #define AFS_CELLSERVDB_NT "afsdcell.ini" +#ifndef AFSDIR_CLIENT_ETC_DIRPATH #define AFSDIR_CLIENT_ETC_DIRPATH "c:/afs" +#endif #if defined(DJGPP) || defined(AFS_WIN95_ENV) #define AFS_CELLSERVDB AFS_CELLSERVDB_UNIX #ifdef DJGPP @@ -44,18 +52,52 @@ extern int errno; #define AFS_CELLSERVDB AFS_CELLSERVDB_NT #endif /* DJGPP || WIN95 */ +#ifdef DEBUG +DWORD TraceOption=1; + +#define TRACE_OPTION_EVENT 1 +#define ISLOGONTRACE(v) ( ((v) & TRACE_OPTION_EVENT)==TRACE_OPTION_EVENT) + +void DebugEvent0_local(char *a) +{ + HANDLE h; char *ptbuf[1]; + if (!ISLOGONTRACE(TraceOption)) + return; + h = RegisterEventSource(NULL, a); + ptbuf[0] = a; + ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL); + DeregisterEventSource(h); +} + +#define MAXBUF_ 512 + +void DebugEvent_local(char *a,char *b,...) +{ + HANDLE h; char *ptbuf[1],buf[MAXBUF_+1]; + va_list marker; + if (!ISLOGONTRACE(TraceOption)) + return; + h = RegisterEventSource(NULL, a); + va_start(marker,b); + _vsnprintf(buf,MAXBUF_,b,marker); + ptbuf[0] = buf; + ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);\ + DeregisterEventSource(h); + va_end(marker); +} +#endif /* DEBUG */ static long cm_ParsePair(char *lineBufferp, char *leftp, char *rightp) { char *tp; - char tc; - int sawEquals; + char tc; + int sawEquals; int sawBracket; - sawEquals = 0; + sawEquals = 0; sawBracket = 0; - for(tp = lineBufferp; *tp; tp++) { - tc = *tp; + for(tp = lineBufferp; *tp; tp++) { + tc = *tp; if (sawBracket) { if (tc == ']') @@ -64,33 +106,38 @@ static long cm_ParsePair(char *lineBufferp, char *leftp, char *rightp) } /* comment or line end */ - if (tc == '#' || tc == '\r' || tc == '\n') break; + if (tc == '#' || tc == '\r' || tc == '\n') + break; - /* square bracket comment -- look for closing delim - if (tc == '[') {sawBracket = 1; continue;} + /* square bracket comment -- look for closing delim */ + if (tc == '[') { + sawBracket = 1; + continue; + } /* space or tab */ - if (tc == ' ' || tc == '\t') continue; + if (tc == ' ' || tc == '\t') + continue; - if (tc == '=') { - sawEquals = 1; - continue; + if (tc == '=') { + sawEquals = 1; + continue; } - /* now we have a real character, put it in the appropriate bucket */ - if (sawEquals == 0) { + /* now we have a real character, put it in the appropriate bucket */ + if (sawEquals == 0) { *leftp++ = tc; - } - else { + } + else { *rightp++ = tc; - } } + } /* null terminate the strings */ *leftp = 0; - *rightp = 0; + *rightp = 0; - return 0; /* and return success */ + return 0; /* and return success */ } /* search for a cell, and either return an error code if we don't find it, @@ -105,69 +152,80 @@ static long cm_ParsePair(char *lineBufferp, char *leftp, char *rightp) long cm_SearchCellFile(char *cellNamep, char *newCellNamep, cm_configProc_t *procp, void *rockp) { - char wdir[256]; - int tlen; - FILE *tfilep, *bestp, *tempp; - char *tp; - char lineBuffer[256]; - struct hostent *thp; - char *valuep; - struct sockaddr_in vlSockAddr; - int inRightCell; - int foundCell; - long code; + char wdir[257]; + int tlen; + FILE *tfilep, *bestp, *tempp; + char *tp; + char lineBuffer[257]; + struct hostent *thp; + char *valuep; + struct sockaddr_in vlSockAddr; + int inRightCell; + int foundCell; + long code; int tracking = 1, partial = 0; #if defined(DJGPP) || defined(AFS_WIN95_ENV) long ip_addr; - int c1, c2, c3, c4; - char aname[256]; + int c1, c2, c3, c4; + char aname[241]; + char *afsconf_path; #endif - char *afsconf_path; foundCell = 0; #if !defined(DJGPP) code = GetWindowsDirectory(wdir, sizeof(wdir)); - if (code == 0 || code > sizeof(wdir)) return -1; + if (code == 0 || code > sizeof(wdir)) + return -1; /* add trailing backslash, if required */ - tlen = strlen(wdir); - if (wdir[tlen-1] != '\\') strcat(wdir, "\\"); + tlen = strlen(wdir); + if (wdir[tlen-1] != '\\') strcat(wdir, "\\"); #else - strcpy(wdir, cm_confDir); - strcat(wdir,"/"); + strcpy(wdir, cm_confDir); + strcat(wdir,"/"); #endif /* !DJGPP */ - strcat(wdir, AFS_CELLSERVDB); + strcat(wdir, AFS_CELLSERVDB); - tfilep = fopen(wdir, "r"); + tfilep = fopen(wdir, "r"); - if (!tfilep) { - /* If we are using DJGPP client, cellservdb will be in afsconf dir. */ - /* If we are in Win95 here, we are linking with klog etc. and are - using DJGPP client even though DJGPP is not defined. So we still - need to check AFSCONF for location. */ - afsconf_path = getenv("AFSCONF"); - if (!afsconf_path) - strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH); - else - strcpy(wdir, afsconf_path); - strcat(wdir, "/"); - strcat(wdir, AFS_CELLSERVDB_UNIX); - /*fprintf(stderr, "opening cellservdb file %s\n", wdir);*/ - tfilep = fopen(wdir, "r"); - if (!tfilep) return -2; - } +#if defined(DJGPP) || defined(AFS_WIN95_ENV) + if (!tfilep) { + /* If we are using DJGPP client, cellservdb will be in afsconf dir. */ + /* If we are in Win95 here, we are linking with klog etc. and are + using DJGPP client even though DJGPP is not defined. So we still + need to check AFSCONF for location. */ + afsconf_path = getenv("AFSCONF"); + if (!afsconf_path) + strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH); + else + strcpy(wdir, afsconf_path); + strcat(wdir, "/"); + strcat(wdir, AFS_CELLSERVDB_UNIX); + /*fprintf(stderr, "opening cellservdb file %s\n", wdir);*/ + tfilep = fopen(wdir, "r"); + if (!tfilep) return -2; + } +#else + /* If we are NT or higher, we don't do DJGPP, So just fail */ + if ( !tfilep ) + return -2; +#endif bestp = fopen(wdir, "r"); - + +#ifdef DEBUG + DebugEvent_local("AFS- cm_searchfile fopen", "Handle[%x], wdir[%s]", bestp, wdir); +#endif + /* have we seen the cell line for the guy we're looking for? */ inRightCell = 0; while (1) { - tp = fgets(lineBuffer, sizeof(lineBuffer), tfilep); - if (tracking) + tp = fgets(lineBuffer, sizeof(lineBuffer), tfilep); + if (tracking) (void) fgets(lineBuffer, sizeof(lineBuffer), bestp); - if (tp == NULL) { + if (tp == NULL) { if (feof(tfilep)) { /* hit EOF */ if (partial) { @@ -188,36 +246,40 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep, return (foundCell? 0 : -3); } } - } - - /* turn trailing cr or lf into null */ - tp = strchr(lineBuffer, '\r'); - if (tp) *tp = 0; - tp = strchr(lineBuffer, '\n'); - if (tp) *tp = 0; - + } + + /* turn trailing cr or lf into null */ + tp = strchr(lineBuffer, '\r'); + if (tp) *tp = 0; + tp = strchr(lineBuffer, '\n'); + if (tp) *tp = 0; + /* skip blank lines */ - if (lineBuffer[0] == 0) continue; + if (lineBuffer[0] == 0) continue; - if (lineBuffer[0] == '>') { + if (lineBuffer[0] == '>') { /* trim off at white space or '#' chars */ - tp = strchr(lineBuffer, ' '); - if (tp) *tp = 0; - tp = strchr(lineBuffer, '\t'); - if (tp) *tp = 0; - tp = strchr(lineBuffer, '#'); - if (tp) *tp = 0; + tp = strchr(lineBuffer, ' '); + if (tp) *tp = 0; + tp = strchr(lineBuffer, '\t'); + if (tp) *tp = 0; + tp = strchr(lineBuffer, '#'); + if (tp) *tp = 0; /* now see if this is the right cell */ - if (stricmp(lineBuffer+1, cellNamep) == 0) { + if (stricmp(lineBuffer+1, cellNamep) == 0) { /* found the cell we're looking for */ if (newCellNamep) strcpy(newCellNamep, lineBuffer+1); - inRightCell = 1; + inRightCell = 1; tracking = 0; +#ifdef DEBUG + DebugEvent_local("AFS- cm_searchfile is cell", "inRightCell[%x], linebuffer[%s]", + inRightCell, lineBuffer); +#endif } else if (strnicmp(lineBuffer+1, cellNamep, - strlen(cellNamep)) == 0) { + strlen(cellNamep)) == 0) { /* partial match */ if (partial) { /* ambiguous */ fclose(tfilep); @@ -230,89 +292,198 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep, tracking = 0; partial = 1; } - else inRightCell = 0; - } - else { + else inRightCell = 0; + } + else { #if !defined(DJGPP) && !defined(AFS_WIN95_ENV) - valuep = strchr(lineBuffer, '#'); + valuep = strchr(lineBuffer, '#'); if (valuep == NULL) { fclose(tfilep); fclose(bestp); return -4; } - valuep++; /* skip the "#" */ - valuep += strspn(valuep, " \t"); /* skip SP & TAB */ - /* strip spaces and tabs in the end. They should not be there according to CellServDB format - so do this just in case */ - while (valuep[strlen(valuep) - 1] == ' ' || valuep[strlen(valuep) - 1] == '\t') valuep[strlen(valuep) - 1] = '\0'; - - /* strip spaces and tabs in the end. They should not be there according to CellServDB format - so do this just in case */ - while (valuep[strlen(valuep) - 1] == ' ' || valuep[strlen(valuep) - 1] == '\t') valuep[strlen(valuep) - 1] = '\0'; + valuep++; /* skip the "#" */ + + valuep += strspn(valuep, " \t"); /* skip SP & TAB */ + /* strip spaces and tabs in the end. They should not be there according to CellServDB format + so do this just in case */ + while (valuep[strlen(valuep) - 1] == ' ' || valuep[strlen(valuep) - 1] == '\t') + valuep[strlen(valuep) - 1] = '\0'; + #endif /* !DJGPP */ if (inRightCell) { #if !defined(DJGPP) && !defined(AFS_WIN95_ENV) /* add the server to the VLDB list */ - thp = gethostbyname(valuep); - if (thp) { + WSASetLastError(0); + thp = gethostbyname(valuep); +#ifdef DEBUG + { + int iErr = WSAGetLastError(); + DebugEvent_local("AFS- cm_searchfile inRightCell", + "thp[%x], valuep[%s], WSAGetLastError[%d]", + thp, valuep, iErr); + } +#endif + if (thp) { memcpy(&vlSockAddr.sin_addr.s_addr, thp->h_addr, - sizeof(long)); - vlSockAddr.sin_family = AF_INET; - /* sin_port supplied by connection code */ + sizeof(long)); + vlSockAddr.sin_family = AF_INET; + /* sin_port supplied by connection code */ if (procp) (*procp)(rockp, &vlSockAddr, valuep); - foundCell = 1; + foundCell = 1; } #else - /* For DJGPP, we will read IP address instead - of name/comment field */ - code = sscanf(lineBuffer, "%d.%d.%d.%d #%s", - &c1, &c2, &c3, &c4, aname); - tp = (char *) &ip_addr; - *tp++ = c1; - *tp++ = c2; - *tp++ = c3; - *tp++ = c4; - memcpy(&vlSockAddr.sin_addr.s_addr, &ip_addr, - sizeof(long)); - vlSockAddr.sin_family = AF_INET; - /* sin_port supplied by connection code */ - if (procp) - (*procp)(rockp, &vlSockAddr, valuep); - foundCell = 1; + /* For DJGPP, we will read IP address instead + of name/comment field */ + code = sscanf(lineBuffer, "%d.%d.%d.%d #%s", + &c1, &c2, &c3, &c4, aname); + tp = (char *) &ip_addr; + *tp++ = c1; + *tp++ = c2; + *tp++ = c3; + *tp++ = c4; + memcpy(&vlSockAddr.sin_addr.s_addr, &ip_addr, + sizeof(long)); + vlSockAddr.sin_family = AF_INET; + /* sin_port supplied by connection code */ + if (procp) + (*procp)(rockp, &vlSockAddr, valuep); + foundCell = 1; #endif /* !DJGPP */ - } - } /* a vldb line */ - } /* while loop processing all lines */ + } + } /* a vldb line */ + } /* while loop processing all lines */ + + /* if for some unknown reason cell is not found, return negative code (-11) ??? */ + return (foundCell) ? 0 : -11; } long cm_SearchCellByDNS(char *cellNamep, char *newCellNamep, int *ttl, cm_configProc_t *procp, void *rockp) { #ifdef AFS_AFSDB_ENV - int rc; - int cellHosts[AFSMAXCELLHOSTS]; - int numServers; - int i; - struct sockaddr_in vlSockAddr; - - rc = getAFSServer(cellNamep, cellHosts, &numServers, ttl); - if (rc == 0 && numServers > 0) { /* found the cell */ - for (i = 0; i < numServers; i++) { - memcpy(&vlSockAddr.sin_addr.s_addr, &cellHosts[i], - sizeof(long)); +#ifndef DNSAPI_ENV + int rc; + int cellHosts[AFSMAXCELLHOSTS]; + int numServers; + int i; + struct sockaddr_in vlSockAddr; + +#ifdef DEBUG + DebugEvent_local("AFS SearchCellDNS-","Doing search for [%s]", cellNamep); +#endif + rc = getAFSServer(cellNamep, cellHosts, &numServers, ttl); + if (rc == 0 && numServers > 0) { /* found the cell */ + for (i = 0; i < numServers; i++) { + memcpy(&vlSockAddr.sin_addr.s_addr, &cellHosts[i], + sizeof(long)); vlSockAddr.sin_family = AF_INET; /* sin_port supplied by connection code */ if (procp) (*procp)(rockp, &vlSockAddr, NULL); if(newCellNamep) strcpy(newCellNamep,cellNamep); - } - return 0; /* found cell */ - } - else -#endif /* AFS_AFSDB_ENV */ + } + return 0; /* found cell */ + } + else return -1; /* not found */ +#else /* DNSAPI_ENV */ + PDNS_RECORD pDnsCell, pDnsIter, pDnsVol,pDnsVolIter, pDnsCIter; + LPSTR vlServers[AFSMAXCELLHOSTS]; + IP4_ADDRESS vlAddrs[AFSMAXCELLHOSTS]; + WORD nvlServers; + DWORD wttl, i; + BOOL success; + struct sockaddr_in vlSockAddr; + + success = FALSE; + +#ifdef DEBUG + DebugEvent_local("AFS SearchCellDNS-","Doing search for [%s]", cellNamep); +#endif + + /* query the AFSDB records of cell */ + if(DnsQuery_A(cellNamep, DNS_TYPE_AFSDB, DNS_QUERY_STANDARD, NULL, &pDnsCell, NULL) == ERROR_SUCCESS) { + + memset((void*) &vlSockAddr, 0, sizeof(vlSockAddr)); + + nvlServers = 0; wttl = 0; + + /* go through the returned records */ + for(pDnsIter = pDnsCell;pDnsIter; pDnsIter = pDnsIter->pNext) { + /* if we find an AFSDB record with Preference set to 1, we found a volserver */ + if(pDnsIter->wType == DNS_TYPE_AFSDB && pDnsIter->Data.Afsdb.wPreference == 1) { + vlServers[nvlServers++] = pDnsIter->Data.Afsdb.pNameExchange; + if(!wttl) wttl = pDnsIter->dwTtl; + if(nvlServers == AFSMAXCELLHOSTS) break; + } + } + + for(i=0;ipNext) { + if(pDnsIter->wType == DNS_TYPE_A) + /* check if its for one of the volservers */ + for(i=0;ipName, vlServers[i]) == 0) + vlAddrs[i] = pDnsIter->Data.A.IpAddress; + } + + for(i=0;ipNext) { + /* if we get an A record, keep it */ + if(pDnsVolIter->wType == DNS_TYPE_A && stricmp(vlServers[i], pDnsVolIter->pName)==0) { + vlAddrs[i] = pDnsVolIter->Data.A.IpAddress; + break; + } + /* if we get a CNAME, look for a corresponding A record */ + if(pDnsVolIter->wType == DNS_TYPE_CNAME && stricmp(vlServers[i], pDnsVolIter->pName)==0) { + for(pDnsCIter=pDnsVolIter; pDnsCIter; pDnsCIter=pDnsCIter->pNext) { + if(pDnsCIter->wType == DNS_TYPE_A && stricmp(pDnsVolIter->Data.CNAME.pNameHost, pDnsCIter->pName)==0) { + vlAddrs[i] = pDnsCIter->Data.A.IpAddress; + break; + } + } + if(vlAddrs[i]) break; + /* TODO: if the additional section is missing, then do another lookup for the CNAME */ + } + } + /* we are done with the volserver lookup */ + DnsRecordListFree(pDnsVol, DnsFreeRecordListDeep); + } + } + + /* if we found a volserver, then add it */ + if(vlAddrs[i]) { + vlSockAddr.sin_family = AF_INET; + vlSockAddr.sin_addr.s_addr = vlAddrs[i]; + if(procp) + (*procp)(rockp, &vlSockAddr, vlServers[i]); + success = TRUE; + } + } + + DnsRecordListFree(pDnsCell, DnsFreeRecordListDeep); + } + + if(!success) return -1; + else { + strcpy(newCellNamep, cellNamep); + if(ttl) *ttl = (int) wttl; + return 0; + } + +#endif /* DNSAPI_ENV */ +#else + return -1; /* not found */ +#endif /* AFS_AFSDB_ENV */ } #if !defined(DJGPP) && !defined(AFS_WIN95_ENV) @@ -331,7 +502,7 @@ long cm_GetRootCellName(char *cellNamep) code = RegQueryValueEx(parmKey, "Cell", NULL, NULL, cellNamep, &dummyLen); RegCloseKey (parmKey); - if (code != ERROR_SUCCESS) + if (code != ERROR_SUCCESS || cellNamep[0] == 0) return -1; return 0; @@ -342,13 +513,13 @@ long cm_GetRootCellName(char *cellNamep) { FILE *thisCell; char thisCellPath[256]; - char *afsconf_path; char *newline; #ifdef DJGPP strcpy(thisCellPath, cm_confDir); #else /* Win 95 */ + char *afsconf_path; afsconf_path = getenv("AFSCONF"); if (!afsconf_path) strcpy(thisCellPath, AFSDIR_CLIENT_ETC_DIRPATH); @@ -377,14 +548,14 @@ long cm_GetRootCellName(char *cellNamep) cm_configFile_t *cm_CommonOpen(char *namep, char *rwp) { char wdir[256]; - long code; - long tlen; - FILE *tfilep; - char *afsconf_path; + long code; + long tlen; + FILE *tfilep; #if !defined(DJGPP) && !defined(AFS_WIN95_ENV) code = GetWindowsDirectory(wdir, sizeof(wdir)); - if (code == 0 || code > sizeof(wdir)) return NULL; + if (code == 0 || code > sizeof(wdir)) + return 0; /* add trailing backslash, if required */ tlen = strlen(wdir); @@ -393,7 +564,7 @@ cm_configFile_t *cm_CommonOpen(char *namep, char *rwp) #ifdef DJGPP strcpy(wdir,cm_confDir); #else - afsconf_path = getenv("AFSCONF"); + char *afsconf_path = getenv("AFSCONF"); if (!afsconf_path) strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH); else @@ -544,17 +715,19 @@ long cm_AppendNewCellLine(cm_configFile_t *filep, char *linep) long cm_CloseCellFile(cm_configFile_t *filep) { char wdir[256]; - char sdir[256]; - long code; - long closeCode; - int tlen; - char *afsconf_path; - + char sdir[256]; + long code; + long closeCode; + int tlen; +#ifdef AFS_WIN95_ENV + char *afsconf_path; +#endif closeCode = fclose((FILE *)filep); #if !defined(DJGPP) && !defined(AFS_WIN95_ENV) code = GetWindowsDirectory(wdir, sizeof(wdir)); - if (code == 0 || code > sizeof(wdir)) return NULL; + if (code == 0 || code > sizeof(wdir)) + return closeCode; /* add trailing backslash, if required */ tlen = strlen(wdir); @@ -588,7 +761,8 @@ long cm_CloseCellFile(cm_configFile_t *filep) code = rename(sdir, wdir); /* do the rename */ - if (code) code = errno; + if (code) + code = errno; return code; } @@ -596,9 +770,11 @@ long cm_CloseCellFile(cm_configFile_t *filep) void cm_GetConfigDir(char *dir) { char wdir[256]; - char *afsconf_path; - int code; - int tlen; + int code; + int tlen; +#ifdef AFS_WIN95_ENV + char *afsconf_path; +#endif #if !defined(DJGPP) && !defined(AFS_WIN95_ENV) code = GetWindowsDirectory(wdir, sizeof(wdir)); diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index 6ebdf6522..06aceb1ad 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -29,6 +29,9 @@ osi_rwlock_t cm_connLock; long RDRtimeout = CM_CONN_DEFAULTRDRTIMEOUT; +#define LANMAN_WKS_PARAM_KEY "SYSTEM\\CurrentControlSet\\Services\\lanmanworkstation\\parameters" +#define LANMAN_WKS_SESSION_TIMEOUT "SessTimeout" + afs_int32 cryptall = 0; void cm_PutConn(cm_conn_t *connp) @@ -41,11 +44,37 @@ void cm_PutConn(cm_conn_t *connp) void cm_InitConn(void) { static osi_once_t once; + long code; + DWORD sessTimeout; + HKEY parmKey; - if (osi_Once(&once)) { + if (osi_Once(&once)) { lock_InitializeRWLock(&cm_connLock, "connection global lock"); - osi_EndOnce(&once); + + /* keisa - read timeout value for lanmanworkstation service. + * It is used as hardtimeout for connections. + * Default value is 45 + */ + code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, LANMAN_WKS_PARAM_KEY, + 0, KEY_QUERY_VALUE, &parmKey); + if (code == ERROR_SUCCESS) + { + DWORD dummyLen = sizeof(sessTimeout); + code = RegQueryValueEx(parmKey, LANMAN_WKS_SESSION_TIMEOUT, NULL, NULL, + (BYTE *) &sessTimeout, &dummyLen); + if (code == ERROR_SUCCESS) + { + afsi_log("lanmanworkstation : SessTimeout %d", sessTimeout); + RDRtimeout = sessTimeout; + } + else + { + RDRtimeout = CM_CONN_DEFAULTRDRTIMEOUT; + } } + + osi_EndOnce(&once); + } } void cm_InitReq(cm_req_t *reqp) @@ -108,6 +137,7 @@ long cm_GetServerList(struct cm_fid *fidp, struct cm_user *userp, * * volSyncp and/or cbrp may also be NULL. */ +int cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp, struct cm_fid *fidp, AFSVolSync *volSyncp, cm_callbackRequest_t *cbrp, long errorCode) @@ -134,7 +164,30 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp, if (reqp->flags & CM_REQ_NORETRY) goto out; - /* if all servers are offline, mark them non-busy and start over */ + /* if timeout - check that is did not exceed the SMB timeout + and retry */ + if (errorCode == CM_ERROR_TIMEDOUT) + { + long timeUsed, timeLeft; + /* timeleft - get if from reqp the same way as cmXonnByMServers does */ +#ifndef DJGPP + timeUsed = (GetCurrentTime() - reqp->startTime) / 1000; +#else + gettimeofday(&now, NULL); + timeUsed = sub_time(now, reqp->startTime) / 1000; +#endif + + /* leave 5 seconds margin for sleep */ + timeLeft = RDRtimeout - timeUsed; + if (timeLeft > 5) + { + thrd_Sleep(3000); + cm_CheckServers(CM_FLAG_CHECKDOWNSERVERS, NULL); + retry = 1; + } + } + + /* if all servers are offline, mark them non-busy and start over */ if (errorCode == CM_ERROR_ALLOFFLINE) { osi_Log0(afsd_logp, "cm_Analyze passed CM_ERROR_ALLOFFLINE."); thrd_Sleep(5000); @@ -170,12 +223,8 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp, /* special codes: missing volumes */ if (errorCode == VNOVOL || errorCode == VMOVED || errorCode == VOFFLINE || errorCode == VSALVAGE || errorCode == VNOSERVICE) { - long oldSum, newSum; - int same; - /* Log server being offline for this volume */ - osi_Log4(afsd_logp, "cm_Analyze found server %d.%d.%d.%d -marked offline for a volume", + osi_Log4(afsd_logp, "cm_Analyze found server %d.%d.%d.%d marked offline for a volume", ((serverp->addr.sin_addr.s_addr & 0xff)), ((serverp->addr.sin_addr.s_addr & 0xff00)>> 8), ((serverp->addr.sin_addr.s_addr & 0xff0000)>> 16), @@ -270,7 +319,7 @@ long cm_ConnByMServers(cm_serverRef_t *serversp, cm_user_t *usersp, cm_serverRef_t *tsrp; cm_server_t *tsp; long firstError = 0; - int someBusy = 0, someOffline = 0; + int someBusy = 0, someOffline = 0, allDown = 1; long timeUsed, timeLeft, hardTimeLeft; #ifdef DJGPP struct timeval now; @@ -296,61 +345,67 @@ long cm_ConnByMServers(cm_serverRef_t *serversp, cm_user_t *usersp, lock_ObtainWrite(&cm_serverLock); - for(tsrp = serversp; tsrp; tsrp=tsrp->next) { - tsp = tsrp->server; - tsp->refCount++; - lock_ReleaseWrite(&cm_serverLock); - if (!(tsp->flags & CM_SERVERFLAG_DOWN)) { - if (tsrp->status == busy) - someBusy = 1; - else if (tsrp->status == offline) - someOffline = 1; - else { - code = cm_ConnByServer(tsp, usersp, connpp); - if (code == 0) { - cm_PutServer(tsp); - /* Set RPC timeout */ - if (timeLeft > CM_CONN_CONNDEADTIME) - timeLeft = CM_CONN_CONNDEADTIME; - - if (hardTimeLeft > CM_CONN_HARDDEADTIME) - hardTimeLeft = CM_CONN_HARDDEADTIME; - - lock_ObtainMutex(&(*connpp)->mx); - rx_SetConnDeadTime((*connpp)->callp, - timeLeft); - rx_SetConnHardDeadTime((*connpp)->callp, - (u_short) hardTimeLeft); - lock_ReleaseMutex(&(*connpp)->mx); - - return 0; - } - if (firstError == 0) firstError = code; - } + for(tsrp = serversp; tsrp; tsrp=tsrp->next) { + tsp = tsrp->server; + tsp->refCount++; + lock_ReleaseWrite(&cm_serverLock); + if (!(tsp->flags & CM_SERVERFLAG_DOWN)) { + allDown = 0; + if (tsrp->status == busy) + someBusy = 1; + else if (tsrp->status == offline) + someOffline = 1; + else { + code = cm_ConnByServer(tsp, usersp, connpp); + if (code == 0) { + cm_PutServer(tsp); + /* Set RPC timeout */ + if (timeLeft > CM_CONN_CONNDEADTIME) + timeLeft = CM_CONN_CONNDEADTIME; + + if (hardTimeLeft > CM_CONN_HARDDEADTIME) + hardTimeLeft = CM_CONN_HARDDEADTIME; + + lock_ObtainMutex(&(*connpp)->mx); + rx_SetConnDeadTime((*connpp)->callp, + timeLeft); + rx_SetConnHardDeadTime((*connpp)->callp, + (u_short) hardTimeLeft); + lock_ReleaseMutex(&(*connpp)->mx); + + return 0; } - lock_ObtainWrite(&cm_serverLock); - osi_assert(tsp->refCount-- > 0); - } + if (firstError == 0) + firstError = code; + } + } + lock_ObtainWrite(&cm_serverLock); + osi_assert(tsp->refCount-- > 0); + } lock_ReleaseWrite(&cm_serverLock); if (firstError == 0) { - if (someBusy) firstError = CM_ERROR_ALLBUSY; - else if (someOffline) firstError = CM_ERROR_ALLOFFLINE; - else if (serversp) firstError = CM_ERROR_TIMEDOUT; + if (someBusy) + firstError = CM_ERROR_ALLBUSY; + else if (someOffline) + firstError = CM_ERROR_ALLOFFLINE; + else if (!allDown && serversp) + firstError = CM_ERROR_TIMEDOUT; /* Only return CM_ERROR_NOSUCHVOLUME if there are no servers for this volume */ - else firstError = CM_ERROR_NOSUCHVOLUME; + else + firstError = CM_ERROR_NOSUCHVOLUME; } osi_Log1(afsd_logp, "cm_ConnByMServers returning %x", firstError); - return firstError; + return firstError; } /* called with a held server to GC all bad connections hanging off of the server */ void cm_GCConnections(cm_server_t *serverp) { cm_conn_t *tcp; - cm_conn_t **lcpp; - cm_user_t *userp; + cm_conn_t **lcpp; + cm_user_t *userp; lock_ObtainWrite(&cm_connLock); lcpp = &serverp->connsp; @@ -358,38 +413,38 @@ void cm_GCConnections(cm_server_t *serverp) userp = tcp->userp; if (userp && tcp->refCount == 0 && (userp->vcRefs == 0)) { /* do the deletion of this guy */ - cm_ReleaseUser(userp); - *lcpp = tcp->nextp; + cm_ReleaseUser(userp); + *lcpp = tcp->nextp; rx_DestroyConnection(tcp->callp); - lock_FinalizeMutex(&tcp->mx); - free(tcp); - } - else { + lock_FinalizeMutex(&tcp->mx); + free(tcp); + } + else { /* just advance to the next */ - lcpp = &tcp->nextp; - } + lcpp = &tcp->nextp; } + } lock_ReleaseWrite(&cm_connLock); } static void cm_NewRXConnection(cm_conn_t *tcp, cm_ucell_t *ucellp, cm_server_t *serverp) { - unsigned short port; - int serviceID; - int secIndex; - struct rx_securityClass *secObjp; + unsigned short port; + int serviceID; + int secIndex; + struct rx_securityClass *secObjp; afs_int32 level; if (serverp->type == CM_SERVER_VLDB) { port = htons(7003); - serviceID = 52; - } - else { + serviceID = 52; + } + else { osi_assert(serverp->type == CM_SERVER_FILE); - port = htons(7000); - serviceID = 1; - } + port = htons(7000); + serviceID = 1; + } if (ucellp->flags & CM_UCELLFLAG_RXKAD) { secIndex = 2; if (cryptall) { @@ -398,67 +453,69 @@ static void cm_NewRXConnection(cm_conn_t *tcp, cm_ucell_t *ucellp, } else { level = rxkad_clear; } - secObjp = rxkad_NewClientSecurityObject(level, - &ucellp->sessionKey, ucellp->kvno, - ucellp->ticketLen, ucellp->ticketp); - } - else { - /* normal auth */ - secIndex = 0; - secObjp = rxnull_NewClientSecurityObject(); - } + secObjp = rxkad_NewClientSecurityObject(level, + &ucellp->sessionKey, ucellp->kvno, + ucellp->ticketLen, ucellp->ticketp); + } + else { + /* normal auth */ + secIndex = 0; + secObjp = rxnull_NewClientSecurityObject(); + } osi_assert(secObjp != NULL); - tcp->callp = rx_NewConnection(serverp->addr.sin_addr.s_addr, - port, - serviceID, - secObjp, - secIndex); + tcp->callp = rx_NewConnection(serverp->addr.sin_addr.s_addr, + port, + serviceID, + secObjp, + secIndex); rx_SetConnDeadTime(tcp->callp, CM_CONN_CONNDEADTIME); rx_SetConnHardDeadTime(tcp->callp, CM_CONN_HARDDEADTIME); tcp->ucgen = ucellp->gen; + if (secObjp) + rxs_Release(secObjp); /* Decrement the initial refCount */ } long cm_ConnByServer(cm_server_t *serverp, cm_user_t *userp, cm_conn_t **connpp) { cm_conn_t *tcp; - cm_ucell_t *ucellp; + cm_ucell_t *ucellp; lock_ObtainMutex(&userp->mx); lock_ObtainWrite(&cm_connLock); for(tcp = serverp->connsp; tcp; tcp=tcp->nextp) { if (tcp->userp == userp) break; - } + } /* find ucell structure */ - ucellp = cm_GetUCell(userp, serverp->cellp); + ucellp = cm_GetUCell(userp, serverp->cellp); if (!tcp) { tcp = malloc(sizeof(*tcp)); - memset(tcp, 0, sizeof(*tcp)); - tcp->nextp = serverp->connsp; - serverp->connsp = tcp; - tcp->userp = userp; - cm_HoldUser(userp); - lock_InitializeMutex(&tcp->mx, "cm_conn_t mutex"); - tcp->serverp = serverp; + memset(tcp, 0, sizeof(*tcp)); + tcp->nextp = serverp->connsp; + serverp->connsp = tcp; + cm_HoldUser(userp); + tcp->userp = userp; + lock_InitializeMutex(&tcp->mx, "cm_conn_t mutex"); + tcp->serverp = serverp; tcp->cryptlevel = rxkad_clear; cm_NewRXConnection(tcp, ucellp, serverp); tcp->refCount = 1; - } + } else { if ((tcp->ucgen < ucellp->gen) || (tcp->cryptlevel != cryptall)) { rx_DestroyConnection(tcp->callp); cm_NewRXConnection(tcp, ucellp, serverp); } - tcp->refCount++; + tcp->refCount++; } lock_ReleaseWrite(&cm_connLock); - lock_ReleaseMutex(&userp->mx); + lock_ReleaseMutex(&userp->mx); /* return this pointer to our caller */ - osi_Log1(afsd_logp, "cm_ConnByServer returning conn 0x%x", (long) tcp); + osi_Log1(afsd_logp, "cm_ConnByServer returning conn 0x%x", (long) tcp); *connpp = tcp; - return 0; + return 0; } long cm_Conn(struct cm_fid *fidp, struct cm_user *userp, cm_req_t *reqp, diff --git a/src/WINNT/afsd/cm_daemon.c b/src/WINNT/afsd/cm_daemon.c index 33b3dc5e1..305aba537 100644 --- a/src/WINNT/afsd/cm_daemon.c +++ b/src/WINNT/afsd/cm_daemon.c @@ -70,35 +70,35 @@ void cm_QueueBKGRequest(cm_scache_t *scp, cm_bkgProc_t *procp, long p1, long p2, { cm_bkgRequest_t *rp; - rp = malloc(sizeof(*rp)); - memset(rp, 0, sizeof(*rp)); + rp = malloc(sizeof(*rp)); + memset(rp, 0, sizeof(*rp)); - rp->scp = scp; - cm_HoldSCache(scp); - rp->userp = userp; - cm_HoldUser(userp); - rp->procp = procp; - rp->p1 = p1; - rp->p2 = p2; - rp->p3 = p3; - rp->p4 = p4; - - lock_ObtainWrite(&cm_daemonLock); + cm_HoldSCache(scp); + rp->scp = scp; + cm_HoldUser(userp); + rp->userp = userp; + rp->procp = procp; + rp->p1 = p1; + rp->p2 = p2; + rp->p3 = p3; + rp->p4 = p4; + + lock_ObtainWrite(&cm_daemonLock); cm_bkgQueueCount++; - osi_QAdd((osi_queue_t **) &cm_bkgListp, &rp->q); - if (!cm_bkgListEndp) cm_bkgListEndp = rp; - lock_ReleaseWrite(&cm_daemonLock); - - osi_Wakeup((long) &cm_bkgListp); + osi_QAdd((osi_queue_t **) &cm_bkgListp, &rp->q); + if (!cm_bkgListEndp) cm_bkgListEndp = rp; + lock_ReleaseWrite(&cm_daemonLock); + + osi_Wakeup((long) &cm_bkgListp); } /* periodic check daemon */ void cm_Daemon(long parm) { - long now; + long now; long lastLockCheck; - long lastVolCheck; - long lastCBExpirationCheck; + long lastVolCheck; + long lastCBExpirationCheck; long lastDownServerCheck; long lastUpServerCheck; long lastTokenCacheCheck; diff --git a/src/WINNT/afsd/cm_dcache.c b/src/WINNT/afsd/cm_dcache.c index 6a7a3ac96..aba7a7932 100644 --- a/src/WINNT/afsd/cm_dcache.c +++ b/src/WINNT/afsd/cm_dcache.c @@ -22,6 +22,10 @@ #include "afsd.h" +#ifdef DEBUG +extern void afsi_log(char *pattern, ...); +#endif + osi_mutex_t cm_bufGetMutex; #ifdef AFS_FREELANCE_CLIENT extern osi_mutex_t cm_Freelance_Lock; @@ -1155,7 +1159,7 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *up, afsStatus.UnixModeBits = 0x1ff; afsStatus.ParentVnode = 0x1; afsStatus.ParentUnique = 0x1; - afsStatus.SegSize = 0; + afsStatus.ResidencyMask = 0; afsStatus.ClientModTime = 0x3b49f6e2; afsStatus.ServerModTime = 0x3b49f6e2; afsStatus.Group = 0; diff --git a/src/WINNT/afsd/cm_dnlc.c b/src/WINNT/afsd/cm_dnlc.c index ec53fbb5d..5bfa220be 100644 --- a/src/WINNT/afsd/cm_dnlc.c +++ b/src/WINNT/afsd/cm_dnlc.c @@ -153,7 +153,7 @@ cm_dnlcEnter ( adp, aname, avc ) dnlcstats.enters++; for (tnc = nameHash[skey], safety=0; tnc; tnc = tnc->next, safety++ ) - if ((tnc->dirp == adp) && (!cm_stricmp(tnc->name, aname))) + if ((tnc->dirp == adp) && (!strcmp(tnc->name, aname))) break; /* preexisting entry */ else if ( tnc->next == nameHash[skey]) /* end of list */ { @@ -206,7 +206,7 @@ cm_dnlcLookup ( adp, sp) unsigned int key, skey; char* aname = sp->searchNamep; char *ts = aname; - struct nc * tnc; + struct nc * tnc, * tnc_begin; int safety, match; if (!cm_useDnlc) @@ -224,45 +224,62 @@ cm_dnlcLookup ( adp, sp) lock_ObtainRead(&cm_dnlcLock); dnlcstats.lookups++; /* Is a dnlcread lock sufficient? */ - for ( tvc = (cm_scache_t *) 0, tnc = nameHash[skey], safety=0; + ts = 0; + tnc_begin = nameHash[skey]; + for ( tvc = (cm_scache_t *) 0, tnc = tnc_begin, safety=0; tnc; tnc = tnc->next, safety++ ) { if (tnc->dirp == adp) { + if( cm_debugDnlc ) + osi_Log1(afsd_logp,"Looking at [%s]", + osi_LogSaveString(afsd_logp,tnc->name)); + if ( sp->caseFold ) /* case insensitive */ { - match = cm_stricmp(tnc->name, aname); - if ( !match ) /* something matches */ - { - /* determine what type of match it is */ - if ( !strcmp(tnc->name, aname)) - { - /* exact match, do nothing */ - } - else if ( cm_NoneUpper(tnc->name)) - sp->LCfound = 1; - else if ( cm_NoneLower(tnc->name)) - sp->UCfound = 1; - else sp->NCfound = 1; - tvc = tnc->vp; - break; - } + match = cm_stricmp(tnc->name, aname); + if ( !match ) /* something matches */ + { + tvc = tnc->vp; + ts = tnc->name; + + /* determine what type of match it is */ + if ( !strcmp(tnc->name, aname)) + { + /* exact match. */ + sp->ExactFound = 1; + + if( cm_debugDnlc ) + osi_Log1(afsd_logp,"DNLC found exact match [%s]", + osi_LogSaveString(afsd_logp,tnc->name)); + break; + } + else if ( cm_NoneUpper(tnc->name)) + sp->LCfound = 1; + else if ( cm_NoneLower(tnc->name)) + sp->UCfound = 1; + else + sp->NCfound = 1; + /* Don't break here. We might find an exact match yet */ + } } else /* case sensitive */ { - match = strcmp(tnc->name, aname); - if ( !match ) /* found a match */ - { - tvc = tnc->vp; - break; - } + match = strcmp(tnc->name, aname); + if ( !match ) /* found a match */ + { + sp->ExactFound = 1; + tvc = tnc->vp; + ts = tnc->name; + break; + } } } if (tnc->next == nameHash[skey]) - { /* end of list */ + { /* end of list */ break; } - else if (safety >NCSIZE) + else if (tnc->next == tnc_begin || safety >NCSIZE) { dnlcstats.cycles++; lock_ReleaseRead(&cm_dnlcLock); @@ -275,24 +292,31 @@ cm_dnlcLookup ( adp, sp) } } + if(cm_debugDnlc && ts) { + osi_Log3(afsd_logp, "DNLC matched [%s] for [%s] with vnode[%ld]", + osi_LogSaveString(afsd_logp,ts), + osi_LogSaveString(afsd_logp,aname), + (long) tvc->fid.vnode); + } + if (!tvc) - dnlcstats.misses++; /* Is a dnlcread lock sufficient? */ + dnlcstats.misses++; /* Is a dnlcread lock sufficient? */ else { - sp->found = 1; - sp->fid.vnode = tvc->fid.vnode; - sp->fid.unique = tvc->fid.unique; + sp->found = 1; + sp->fid.vnode = tvc->fid.vnode; + sp->fid.unique = tvc->fid.unique; } lock_ReleaseRead(&cm_dnlcLock); if (tvc) { - lock_ObtainWrite(&cm_scacheLock); - tvc->refCount++; /* scache entry held */ - lock_ReleaseWrite(&cm_scacheLock); + lock_ObtainWrite(&cm_scacheLock); + tvc->refCount++; /* scache entry held */ + lock_ReleaseWrite(&cm_scacheLock); } if ( cm_debugDnlc && tvc ) - osi_Log1(afsd_logp, "cm_dnlcLookup found %x", tvc); + osi_Log1(afsd_logp, "cm_dnlcLookup found %x", tvc); return tvc; } @@ -354,7 +378,7 @@ cm_dnlcRemove ( adp, aname) for (tnc = nameHash[skey], safety=0; tnc; safety++) { if ( (tnc->dirp == adp) && (tnc->key == key) - && !cm_stricmp(tnc->name,aname) ) + && !strcmp(tnc->name,aname) ) { tnc->dirp = (cm_scache_t *) 0; /* now it won't match anything */ tmp = tnc->next; diff --git a/src/WINNT/afsd/cm_dns.c b/src/WINNT/afsd/cm_dns.c index b0e1da0e2..e817fc294 100644 --- a/src/WINNT/afsd/cm_dns.c +++ b/src/WINNT/afsd/cm_dns.c @@ -19,12 +19,14 @@ #include #include +/*extern void afsi_log(char *pattern, ...);*/ + extern int errno; static char dns_addr[30]; #ifdef DJGPP extern char cm_confDir[]; #endif -int cm_dnsEnabled = -1; +static int cm_dnsEnabled = -1; void DNSlowerCase(char *str) { @@ -41,7 +43,6 @@ int cm_InitDNS(int enabled) char configpath[100]; int len; int code; - char *path; char *addr; if (!enabled) { fprintf(stderr, "DNS support disabled\n"); cm_dnsEnabled = 0; return 0; } @@ -55,7 +56,7 @@ int cm_InitDNS(int enabled) #ifdef DJGPP strcpy(configpath, cm_confDir); #elif defined(AFS_WIN95_ENV) - path = getenv("AFSCONF"); + char *path = getenv("AFSCONF"); if (path) strcpy(configpath, path); else strcpy(configpath, "c:\\afscli"); #else /* nt */ @@ -250,7 +251,6 @@ PDNS_HDR get_DNS_Response(SOCKET commSock, SOCKADDR_IN sockAddr, char *buffer) /*static char buffer[BUFSIZE];*/ int addrLen = sizeof(SOCKADDR_IN); - int res; int size; #ifndef WIN32_LEAN_AND_MEAN @@ -548,7 +548,6 @@ u_char * processReplyBuffer_Addr(PDNS_HDR replyBuff) { u_char *ptr = (u_char *) replyBuff; int answerCount = ntohs((replyBuff)->rr_count); - u_char i; PDNS_A_RR_HDR rrPtr; @@ -597,9 +596,11 @@ int getAFSServer(char *cellName, int *cellHosts, int *numServers, int *ttl) fprintf(stderr, "getAFSServer: cell %s, cm_dnsEnabled=%d\n", cellName, cm_dnsEnabled); #endif +#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x500 if (cm_dnsEnabled == -1) { /* not yet initialized, eg when called by klog */ cm_InitDNS(1); /* assume enabled */ } +#endif if (cm_dnsEnabled == 0) { /* possibly we failed in cm_InitDNS above */ fprintf(stderr, "DNS initialization failed, disabled\n"); *numServers = 0; @@ -640,7 +641,7 @@ int getAFSServer(char *cellName, int *cellHosts, int *numServers, int *ttl) else *numServers = 0; - close(commSock); + closesocket(commSock); if (*numServers == 0) return(-1); @@ -655,8 +656,6 @@ int DNSgetAddr(SOCKET commSock, char *hostName, struct in_addr *iNet) SOCKADDR_IN sockAddr; char buffer[BUFSIZE]; - - int i; u_char *addr; u_long *aPtr; int rc; diff --git a/src/WINNT/afsd/cm_freelance.c b/src/WINNT/afsd/cm_freelance.c index 9f82b1cde..62ec62ec9 100644 --- a/src/WINNT/afsd/cm_freelance.c +++ b/src/WINNT/afsd/cm_freelance.c @@ -18,6 +18,8 @@ #include "cm_freelance.h" #include "stdio.h" +extern void afsi_log(char *pattern, ...); + int cm_noLocalMountPoints; int cm_fakeDirSize; int cm_fakeDirCallback=0; @@ -49,11 +51,9 @@ void cm_InitFreelance() { /* to be called while holding freelance lock unless during init. */ void cm_InitFakeRootDir() { - int i, j, t1, t2; + int i, t1, t2; char* currentPos; int noChunks; - char mask; - // allocate space for the fake info cm_dirHeader_t fakeDirHeader; @@ -229,10 +229,11 @@ void cm_InitFakeRootDir() { int cm_FakeRootFid(cm_fid_t *fidp) { - fidp->cell = 0x1; /* root cell */ - fidp->volume = 0x20000001; /* root.afs ? */ - fidp->vnode = 0x1; - fidp->unique = 0x1; + fidp->cell = 0x1; /* root cell */ + fidp->volume = 0x20000001; /* root.afs ? */ + fidp->vnode = 0x1; + fidp->unique = 0x1; + return 0; } int cm_getLocalMountPointChange() { @@ -241,6 +242,7 @@ int cm_getLocalMountPointChange() { int cm_clearLocalMountPointChange() { cm_localMountPointChangeFlag = 0; + return 0; } /* called directly from ioctl */ @@ -255,7 +257,7 @@ int cm_noteLocalMountPointChange() { int cm_reInitLocalMountPoints() { cm_fid_t aFid; - int i, j, hash; + int i, hash; cm_scache_t *scp, **lscpp, *tscp; @@ -332,6 +334,7 @@ int cm_reInitLocalMountPoints() { lock_ReleaseMutex(&cm_Freelance_Lock); printf("----- reinit complete -----\n\n"); + return 0; } @@ -343,7 +346,7 @@ long cm_InitLocalMountPoints() { FILE *fp; char line[200]; - int n, i; + int i; char* t; cm_localMountPoint_t* aLocalMountPoint; char hdir[120]; @@ -484,13 +487,12 @@ long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, cm_fid_t long cm_FreelanceRemoveMount(char *toremove) { - int i, n, t1, t2; + int i, n; char* cp; char line[200]; char shortname[200]; char hfile[120], hfile2[120]; FILE *fp1, *fp2; - char cmd[200]; int found=0; lock_ObtainMutex(&cm_Freelance_Lock); diff --git a/src/WINNT/afsd/cm_ioctl.c b/src/WINNT/afsd/cm_ioctl.c index f2016fbe8..57099b367 100644 --- a/src/WINNT/afsd/cm_ioctl.c +++ b/src/WINNT/afsd/cm_ioctl.c @@ -39,14 +39,15 @@ #include "cm_rpc.h" +#ifdef _DEBUG +#include +#endif + /* Copied from afs_tokens.h */ #define PIOCTL_LOGON 0x1 #define MAX_PATH 260 osi_mutex_t cm_Afsdsbmt_Lock; -#ifdef AFS_FREELANCE_CLIENT -extern osi_mutex_t cm_Freelance_Lock; -#endif extern afs_int32 cryptall; @@ -112,16 +113,18 @@ void cm_ResetACLCache(cm_user_t *userp) */ void TranslateExtendedChars(char *str) { - char *p; - - if (!str || !*str) - return; +#ifdef DJGPP + char *p; +#endif + + if (!str || !*str) + return; #ifndef DJGPP - CharToOem(str, str); + CharToOem(str, str); #else - p = str; - while (*p) *p++ &= 0x7f; /* turn off high bit; probably not right */ + p = str; + while (*p) *p++ &= 0x7f; /* turn off high bit; probably not right */ #endif } @@ -176,15 +179,19 @@ void cm_SkipIoctlPath(smb_ioctl_t *ioctlp) void cm_NormalizeAfsPath (char *outpathp, char *inpathp) { char *cp; - - if (!strnicmp (inpathp, "/afs", strlen("/afs"))) + char bslash_mountRoot[256]; + + strncpy(bslash_mountRoot, cm_mountRoot, sizeof(bslash_mountRoot) - 1); + bslash_mountRoot[0] = '\\'; + + if (!strnicmp (inpathp, cm_mountRoot, strlen(cm_mountRoot))) lstrcpy (outpathp, inpathp); - else if (!strnicmp (inpathp, "\\afs", strlen("\\afs"))) + else if (!strnicmp (inpathp, bslash_mountRoot, strlen(bslash_mountRoot))) lstrcpy (outpathp, inpathp); else if ((inpathp[0] == '/') || (inpathp[0] == '\\')) - sprintf (outpathp, "/afs%s", inpathp); + sprintf (outpathp, "%s%s", cm_mountRoot, inpathp); else // inpathp looks like "/usr" - sprintf (outpathp, "/afs/%s", inpathp); + sprintf (outpathp, "%s/%s", cm_mountRoot, inpathp); for (cp = outpathp; *cp != 0; ++cp) { if (*cp == '\\') @@ -195,8 +202,8 @@ void cm_NormalizeAfsPath (char *outpathp, char *inpathp) outpathp[strlen(outpathp)-1] = 0; } - if (!strcmpi (outpathp, "/afs")) { - strcpy (outpathp, "/afs/"); + if (!strcmpi (outpathp, cm_mountRoot)) { + strcpy (outpathp, cm_mountRoot); } } @@ -918,12 +925,35 @@ long cm_IoctlGetCell(struct smb_ioctl *ioctlp, struct cm_user *userp) else return CM_ERROR_NOMORETOKENS; /* mapped to EDOM */ } +extern long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *namep); + long cm_IoctlNewCell(struct smb_ioctl *ioctlp, struct cm_user *userp) { - /* don't need to do, since NT cache manager will re-read afsdcell.ini - * on every access to a new cell. - */ - return CM_ERROR_INVAL; + /* NT cache manager will read cell information from afsdcell.ini each time + * cell is accessed. So, this call is necessary only if list of server for a cell + * changes (or IP addresses of cell servers changes). + * All that needs to be done is to refresh server information for all cells that + * are already loaded. + + * cell list will be cm_CellLock and cm_ServerLock will be held for write. + */ + + cm_cell_t *tcellp; + + cm_SkipIoctlPath(ioctlp); + lock_ObtainWrite(&cm_cellLock); + + for(tcellp = cm_allCellsp; tcellp; tcellp=tcellp->nextp) + { + /* delete all previous server lists - cm_FreeServerList will ask for write on cm_ServerLock*/ + cm_FreeServerList(&tcellp->vlServersp); + tcellp->vlServersp = NULL; + cm_SearchCellFile(tcellp->namep, tcellp->namep, cm_AddCellProc, tcellp); + cm_RandomizeServer(&tcellp->vlServersp); + } + + lock_ReleaseWrite(&cm_cellLock); + return 0; } long cm_IoctlGetWsCell(smb_ioctl_t *ioctlp, cm_user_t *userp) @@ -1030,7 +1060,8 @@ long cm_IoctlSetSPrefs(struct smb_ioctl *ioctlp, struct cm_user *userp) vlonly = spin->flags; if ( vlonly ) type = CM_SERVER_VLDB; - else type = CM_SERVER_FILE; + else + type = CM_SERVER_FILE; for ( i=0; i < noServers; i++) { @@ -1040,7 +1071,7 @@ long cm_IoctlSetSPrefs(struct smb_ioctl *ioctlp, struct cm_user *userp) tmp.sin_family = AF_INET; tsp = cm_FindServer(&tmp, type); - if ( tsp ) /* an existing server */ + if ( tsp ) /* an existing server - ref count increased */ { tsp->ipRank = rank; /* no need to protect by mutex*/ @@ -1056,13 +1087,13 @@ long cm_IoctlSetSPrefs(struct smb_ioctl *ioctlp, struct cm_user *userp) /* set preferences for an existing vlserver */ cm_ChangeRankCellVLServer(tsp); } + cm_PutServer(tsp); /* decrease refcount */ } - else /* add a new server without a cell*/ + else /* add a new server without a cell */ { - tsp = cm_NewServer(&tmp, type, NULL); + tsp = cm_NewServer(&tmp, type, NULL); /* refcount = 1 */ tsp->ipRank = rank; } - cm_PutServer(tsp); } return 0; } @@ -1124,53 +1155,53 @@ long cm_IoctlStoreBehind(struct smb_ioctl *ioctlp, struct cm_user *userp) long cm_IoctlCreateMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp) { char leaf[256]; - long code; - cm_scache_t *dscp; - cm_attr_t tattr; - char *cp; + long code; + cm_scache_t *dscp; + cm_attr_t tattr; + char *cp; cm_req_t req; - char mpInfo[256]; - char fullCell[256]; + char mpInfo[256]; + char fullCell[256]; char volume[256]; char cell[256]; int ttl; cm_InitReq(&req); - code = cm_ParseIoctlParent(ioctlp, userp, &req, &dscp, leaf); - if (code) return code; + code = cm_ParseIoctlParent(ioctlp, userp, &req, &dscp, leaf); + if (code) return code; - /* Translate chars for the mount point name */ - TranslateExtendedChars(leaf); + /* Translate chars for the mount point name */ + TranslateExtendedChars(leaf); - /* - * The fs command allows the user to specify partial cell names on NT. These must - * be expanded to the full cell name for mount points so that the mount points will - * work on UNIX clients. - */ + /* + * The fs command allows the user to specify partial cell names on NT. These must + * be expanded to the full cell name for mount points so that the mount points will + * work on UNIX clients. + */ /* Extract the possibly partial cell name */ strcpy(cell, ioctlp->inDatap + 1); /* Skip the mp type character */ - if (cp = strchr(cell, ':')) { + if (cp = strchr(cell, ':')) { /* Extract the volume name */ - *cp = 0; + *cp = 0; strcpy(volume, cp + 1); - /* Get the full name for this cell */ - code = cm_SearchCellFile(cell, fullCell, 0, 0); + /* Get the full name for this cell */ + code = cm_SearchCellFile(cell, fullCell, 0, 0); #ifdef AFS_AFSDB_ENV if (code && cm_dnsEnabled) - code = cm_SearchCellByDNS(cell, fullCell, &ttl, 0, 0); + code = cm_SearchCellByDNS(cell, fullCell, &ttl, 0, 0); #endif - if (code) + if (code) return CM_ERROR_NOSUCHCELL; - sprintf(mpInfo, "%c%s:%s", *ioctlp->inDatap, fullCell, volume); + sprintf(mpInfo, "%c%s:%s", *ioctlp->inDatap, fullCell, volume); } else { - /* No cell name specified */ - strcpy(mpInfo, ioctlp->inDatap); - } + /* No cell name specified */ + strcpy(mpInfo, ioctlp->inDatap); + } #ifdef AFS_FREELANCE_CLIENT if (cm_freelanceEnabled && dscp == cm_rootSCachep) { @@ -1181,21 +1212,20 @@ long cm_IoctlCreateMountPoint(struct smb_ioctl *ioctlp, struct cm_user *userp) } #endif /* create the symlink with mode 644. The lack of X bits tells - * us that it is a mount point. - */ + * us that it is a mount point. + */ tattr.mask = CM_ATTRMASK_UNIXMODEBITS | CM_ATTRMASK_CLIENTMODTIME; - tattr.unixModeBits = 0644; + tattr.unixModeBits = 0644; tattr.clientModTime = time(NULL); - code = cm_SymLink(dscp, leaf, mpInfo, 0, &tattr, userp, &req); + code = cm_SymLink(dscp, leaf, mpInfo, 0, &tattr, userp, &req); if (code == 0 && (dscp->flags & CM_SCACHEFLAG_ANYWATCH)) smb_NotifyChange(FILE_ACTION_ADDED, - FILE_NOTIFY_CHANGE_DIR_NAME, - dscp, leaf, NULL, TRUE); + FILE_NOTIFY_CHANGE_DIR_NAME, + dscp, leaf, NULL, TRUE); - cm_ReleaseSCache(dscp); - - return code; + cm_ReleaseSCache(dscp); + return code; } long cm_IoctlSymlink(struct smb_ioctl *ioctlp, struct cm_user *userp) @@ -1272,7 +1302,8 @@ long cm_IoctlListlink(struct smb_ioctl *ioctlp, struct cm_user *userp) if (code == 0) { cp = ioctlp->outDatap; if (newRootScp != NULL) { - strcpy(cp, "/afs/"); + strcpy(cp, cm_mountRoot); + strcat(cp, "/"); cp += strlen(cp); } strcpy(cp, spacep->data); @@ -1286,6 +1317,33 @@ long cm_IoctlListlink(struct smb_ioctl *ioctlp, struct cm_user *userp) return code; } +long cm_IoctlIslink(struct smb_ioctl *ioctlp, struct cm_user *userp) +{/*CHECK FOR VALID SYMLINK*/ + long code; + cm_scache_t *dscp; + cm_scache_t *scp; + char *cp; + cm_req_t req; + + cm_InitReq(&req); + + code = cm_ParseIoctlPath(ioctlp, userp, &req, &dscp); + if (code) return code; + + cp = ioctlp->inDatap; + osi_LogEvent("cm_IoctlListlink",NULL," name[%s]",cp); + + code = cm_Lookup(dscp, cp, CM_FLAG_NOMOUNTCHASE, userp, &req, &scp); + cm_ReleaseSCache(dscp); + if (code) return code; + + /* Check that it's a real symlink */ + if (scp->fileType != CM_SCACHETYPE_SYMLINK) + code = CM_ERROR_INVAL; + cm_ReleaseSCache(scp); + return code; +} + long cm_IoctlDeletelink(struct smb_ioctl *ioctlp, struct cm_user *userp) { long code; @@ -1736,8 +1794,8 @@ long cm_IoctlMakeSubmount(smb_ioctl_t *ioctlp, cm_user_t *userp) */ WritePrivateProfileString("AFS Submounts", submountreqp, - (strlen(&afspath[strlen("/afs")])) ? - &afspath[strlen("/afs")]:"/", + (strlen(&afspath[strlen(cm_mountRoot)])) ? + &afspath[strlen(cm_mountRoot)]:"/", "afsdsbmt.ini"); strcpy(ioctlp->outDatap, submountreqp); @@ -1850,8 +1908,8 @@ long cm_IoctlMakeSubmount(smb_ioctl_t *ioctlp, cm_user_t *userp) sprintf(ioctlp->outDatap, "auto%ld", nextAutoSubmount); WritePrivateProfileString("AFS Submounts", ioctlp->outDatap, - (strlen(&afspath[lstrlen("/afs")])) ? - &afspath[lstrlen("/afs")]:"/", + (strlen(&afspath[lstrlen(cm_mountRoot)])) ? + &afspath[lstrlen(cm_mountRoot)]:"/", "afsdsbmt.ini"); ioctlp->outDatap += strlen(ioctlp->outDatap) +1; @@ -1898,3 +1956,78 @@ long cm_IoctlGetSMBName(smb_ioctl_t *ioctlp, cm_user_t *userp) return 0; } +/* + * functions to dump contents of various structures. + * In debug build (linked with crt debug library) will dump allocated but not freed memory + */ +extern int cm_DumpSCache(FILE *outputFile, char *cookie); +extern int cm_DumpBufHashTable(FILE *outputFile, char *cookie); +extern int smb_DumpVCP(FILE *outputFile, char *cookie); + +long cm_IoctlMemoryDump(struct smb_ioctl *ioctlp, struct cm_user *userp) +{ + long inValue = 0; + HANDLE hLogFile; + char logfileName[MAX_PATH+1]; + char *cookie; + +#ifdef _DEBUG + static _CrtMemState memstate; +#endif + + cm_SkipIoctlPath(ioctlp); + memcpy(&inValue, ioctlp->inDatap, sizeof(long)); + + if (getenv("TEMP")) + { + strncpy(logfileName, getenv("TEMP"), MAX_PATH); + logfileName[MAX_PATH] = '\0'; + } + else + { + GetWindowsDirectory(logfileName, sizeof(logfileName)); + } + strncat(logfileName, "\\afsd_alloc.log", sizeof(logfileName)); + + hLogFile = CreateFile(logfileName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + + if (!hLogFile) + { + /* error */ + inValue = -1; + memcpy(ioctlp->outDatap, &inValue, sizeof(long)); + ioctlp->outDatap += sizeof(long); + + return 0; + } + + SetFilePointer(hLogFile, 0, NULL, FILE_END); + + cookie = inValue ? "b" : "e"; + +#ifdef _DEBUG + + if (inValue) + { + _CrtMemCheckpoint(&memstate); + } + else + { + _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_WARN, hLogFile); + _CrtMemDumpAllObjectsSince(&memstate); + } +#endif + + /* dump all interesting data */ + cm_DumpSCache(hLogFile, cookie); + cm_DumpBufHashTable(hLogFile, cookie); + smb_DumpVCP(hLogFile, cookie); + + CloseHandle(hLogFile); + + memcpy(ioctlp->outDatap, &inValue, sizeof(long)); + ioctlp->outDatap += sizeof(long); + + return 0; +} diff --git a/src/WINNT/afsd/cm_ioctl.h b/src/WINNT/afsd/cm_ioctl.h index 04ba13bfa..4e9089e2e 100644 --- a/src/WINNT/afsd/cm_ioctl.h +++ b/src/WINNT/afsd/cm_ioctl.h @@ -113,6 +113,8 @@ extern long cm_IoctlDelAllToken(smb_ioctl_t *ioctlp, cm_user_t *userp); extern long cm_IoctlSymlink(smb_ioctl_t *ioctlp, cm_user_t *userp); +extern long cm_IoctlIslink(smb_ioctl_t *ioctlp, cm_user_t *userp); + extern long cm_IoctlListlink(smb_ioctl_t *ioctlp, cm_user_t *userp); extern long cm_IoctlDeletelink(smb_ioctl_t *ioctlp, cm_user_t *userp); @@ -129,6 +131,7 @@ extern long cm_IoctlFreemountAddCell(smb_ioctl_t *ioctlp, cm_user_t *userp); extern long cm_IoctlFreemountRemoveCell(smb_ioctl_t *ioctlp, cm_user_t *userp); +extern long cm_IoctlMemoryDump(smb_ioctl_t *ioctlp, cm_user_t *userp); #endif /* __CM_IOCTL_INTERFACES_ONLY__ */ #endif /* __CM_IOCTL_H_ENV__ */ diff --git a/src/WINNT/afsd/cm_rpc.c b/src/WINNT/afsd/cm_rpc.c index 882e056a6..17845c34f 100644 --- a/src/WINNT/afsd/cm_rpc.c +++ b/src/WINNT/afsd/cm_rpc.c @@ -37,7 +37,7 @@ * can match them up. A list of session keys, searched by UUID, is maintained. */ -extern void afsi_log(); +extern void afsi_log(char *pattern, ...); typedef struct tokenEvent { afs_uuid_t uuid; diff --git a/src/WINNT/afsd/cm_scache.c b/src/WINNT/afsd/cm_scache.c index d3add6009..ced5db1ba 100644 --- a/src/WINNT/afsd/cm_scache.c +++ b/src/WINNT/afsd/cm_scache.c @@ -22,6 +22,8 @@ #include "afsd.h" +/*extern void afsi_log(char *pattern, ...);*/ + extern osi_hyper_t hzero; /* hash table stuff */ @@ -305,7 +307,7 @@ long cm_GetSCache(cm_fid_t *fidp, cm_scache_t **outScpp, cm_user_t *userp, lock_ObtainMutex(&cm_Freelance_Lock); scp->length.LowPart = strlen(mp)+4; - scp->mountPointStringp=malloc(strlen(mp)); + scp->mountPointStringp=malloc(strlen(mp)+1); strcpy(scp->mountPointStringp,mp); lock_ReleaseMutex(&cm_Freelance_Lock); @@ -806,7 +808,7 @@ void cm_MergeStatus(cm_scache_t *scp, AFSFetchStatus *statusp, AFSVolSync *volp, statusp->UnixModeBits = 0x1ff; statusp->ParentVnode = 0x1; statusp->ParentUnique = 0x1; - statusp->SegSize = 0; + statusp->ResidencyMask = 0; statusp->ClientModTime = 0x3b49f6e2; statusp->ServerModTime = 0x3b49f6e2; statusp->Group = 0; @@ -964,5 +966,60 @@ int cm_FindFileType(cm_fid_t *fidp) } } lock_ReleaseWrite(&cm_scacheLock); - return NULL; + return 0; +} + +/* dump all scp's that have reference count > 0 to a file. + * cookie is used to identify this batch for easy parsing, + * and it a string provided by a caller + */ +int cm_DumpSCache(FILE *outputFile, char *cookie) +{ + int zilch; + cm_scache_t *scp; + char output[1024]; + int i; + + lock_ObtainRead(&cm_scacheLock); + + sprintf(output, "%s - dumping scache - cm_currentSCaches=%d, cm_maxSCaches=%d\n", cookie, cm_currentSCaches, cm_maxSCaches); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + + for (scp = cm_scacheLRULastp; scp; scp = (cm_scache_t *) osi_QPrev(&scp->q)) + { + if (scp->refCount != 0) + { + sprintf(output, "%s fid (cell=%d, volume=%d, vnode=%d, unique=%d) refCount=%d\n", + cookie, scp->fid.cell, scp->fid.volume, scp->fid.vnode, scp->fid.unique, + scp->refCount); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + } + } + + sprintf(output, "%s - dumping cm_hashTable - cm_hashTableSize=%d\n", cookie, cm_hashTableSize); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + + for (i = 0; i < cm_hashTableSize; i++) + { + for(scp = cm_hashTablep[i]; scp; scp=scp->nextp) + { + if (scp) + { + if (scp->refCount) + { + sprintf(output, "%s scp=0x%08X, hash=%d, fid (cell=%d, volume=%d, vnode=%d, unique=%d) refCount=%d\n", + cookie, (void *)scp, i, scp->fid.cell, scp->fid.volume, scp->fid.vnode, + scp->fid.unique, scp->refCount); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + } + } + } + } + + sprintf(output, "%s - Done dumping scache.\n", cookie); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + + lock_ReleaseRead(&cm_scacheLock); + return (0); } + diff --git a/src/WINNT/afsd/cm_server.c b/src/WINNT/afsd/cm_server.c index 16672eb8b..71cfc645c 100644 --- a/src/WINNT/afsd/cm_server.c +++ b/src/WINNT/afsd/cm_server.c @@ -199,17 +199,21 @@ cm_server_t *cm_NewServer(struct sockaddr_in *socketp, int type, cm_cell_t *cell osi_assert(socketp->sin_family == AF_INET); tsp = malloc(sizeof(*tsp)); - memset(tsp, 0, sizeof(*tsp)); + memset(tsp, 0, sizeof(*tsp)); tsp->type = type; - tsp->cellp = cellp; - tsp->refCount = 1; - tsp->allNextp = cm_allServersp; - cm_allServersp = tsp; + tsp->cellp = cellp; + tsp->refCount = 1; lock_InitializeMutex(&tsp->mx, "cm_server_t mutex"); tsp->addr = *socketp; cm_SetServerPrefs(tsp); - return tsp; + + lock_ObtainWrite(&cm_serverLock); /* get server lock */ + tsp->allNextp = cm_allServersp; + cm_allServersp = tsp; + lock_ReleaseWrite(&cm_serverLock); /* release server lock */ + + return tsp; } /* find a server based on its properties */ @@ -256,6 +260,8 @@ long cm_ChecksumServerList(cm_serverRef_t *serversp) int first = 1; cm_serverRef_t *tsrp; + lock_ObtainWrite(&cm_serverLock); + for (tsrp = serversp; tsrp; tsrp=tsrp->next) { if (first) first = 0; @@ -264,6 +270,7 @@ long cm_ChecksumServerList(cm_serverRef_t *serversp) sum ^= (long) tsrp->server; } + lock_ReleaseWrite(&cm_serverLock); return sum; } @@ -276,11 +283,14 @@ void cm_InsertServerList(cm_serverRef_t** list, cm_serverRef_t* element) cm_serverRef_t *current=*list; unsigned short ipRank = element->server->ipRank; + lock_ObtainWrite(&cm_serverLock); + /* insertion into empty list or at the beginning of the list */ if ( !current || (current->server->ipRank > ipRank) ) { element->next = *list; *list = element; + lock_ReleaseWrite(&cm_serverLock); return ; } @@ -292,6 +302,7 @@ void cm_InsertServerList(cm_serverRef_t** list, cm_serverRef_t* element) } element->next = current->next; current->next = element; + lock_ReleaseWrite(&cm_serverLock); } /* ** Re-sort the server list with the modified rank @@ -307,6 +318,7 @@ long cm_ChangeRankServer(cm_serverRef_t** list, cm_server_t* server) if ( (!*current) || !((*current)->next) ) return 1; /* list unchanged: return success */ + lock_ObtainWrite(&cm_serverLock); /* if the server is on the list, delete it from list */ while ( *current ) { @@ -318,8 +330,10 @@ long cm_ChangeRankServer(cm_serverRef_t** list, cm_server_t* server) } current = & ( (*current)->next); } - /* if this volume is not replicated on this server */ - if ( !element) + lock_ReleaseWrite(&cm_serverLock); + + /* if this volume is not replicated on this server */ + if (!element) return 1; /* server is not on list */ /* re-insert deleted element into the list with modified rank*/ @@ -340,6 +354,8 @@ void cm_RandomizeServer(cm_serverRef_t** list) if ( !tsrp || ! tsrp->next ) return ; + lock_ObtainWrite(&cm_serverLock); + /* count the number of servers with the lowest rank */ lowestRank = tsrp->server->ipRank; for ( count=1, tsrp=tsrp->next; tsrp; tsrp=tsrp->next) @@ -351,12 +367,17 @@ void cm_RandomizeServer(cm_serverRef_t** list) } /* if there is only one server with the lowest rank, we are done */ - if ( count <= 1 ) + if ( count <= 1 ) { + lock_ReleaseWrite(&cm_serverLock); return ; + } picked = rand() % count; - if ( !picked ) + if ( !picked ) { + lock_ReleaseWrite(&cm_serverLock); return ; + } + tsrp = *list; while (--picked >= 0) { @@ -366,4 +387,23 @@ void cm_RandomizeServer(cm_serverRef_t** list) lastTsrp->next = tsrp->next; /* delete random element from list*/ tsrp->next = *list; /* insert element at the beginning of list */ *list = tsrp; + lock_ReleaseWrite(&cm_serverLock); } + +void cm_FreeServerList(cm_serverRef_t** list) +{ + cm_serverRef_t *current = *list; + cm_serverRef_t *next = 0; + + lock_ObtainWrite(&cm_serverLock); + + while (current) + { + next = current->next; + free(current); + current = next; + } + + lock_ReleaseWrite(&cm_serverLock); +} + diff --git a/src/WINNT/afsd/cm_user.c b/src/WINNT/afsd/cm_user.c index 471f47c67..d59c2367e 100644 --- a/src/WINNT/afsd/cm_user.c +++ b/src/WINNT/afsd/cm_user.c @@ -100,7 +100,7 @@ void cm_HoldUser(cm_user_t *up) void cm_ReleaseUser(cm_user_t *up) { cm_ucell_t *ucp; - cm_ucell_t *ncp; + cm_ucell_t *ncp; if (up == NULL) return; @@ -108,13 +108,13 @@ void cm_ReleaseUser(cm_user_t *up) osi_assert(up->refCount-- > 0); if (up->refCount == 0) { lock_FinalizeMutex(&up->mx); - for(ucp = up->cellInfop; ucp; ucp = ncp) { + for(ucp = up->cellInfop; ucp; ucp = ncp) { ncp = ucp->nextp; if (ucp->ticketp) free(ucp->ticketp); - free(ucp); - } - free(up); + free(ucp); } + free(up); + } lock_ReleaseWrite(&cm_userLock); } @@ -154,12 +154,12 @@ void cm_CheckTokenCache(long now) */ lock_ObtainWrite(&smb_rctLock); for(vcp=smb_allVCsp; vcp; vcp=vcp->nextp) { - for(usersp=vcp->usersp; usersp; usersp=usersp->nextp) { + for(usersp=vcp->usersp; usersp; usersp=usersp->nextp) { if (usersp->unp) { - if ((userp=usersp->unp->userp)==0) - continue; - } else - continue; + if ((userp=usersp->unp->userp)==0) + continue; + } else + continue; lock_ObtainMutex(&userp->mx); for(ucellp=userp->cellInfop; ucellp; ucellp=ucellp->nextp) { if(ucellp->flags & CM_UCELLFLAG_RXKAD) { diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index e06667789..4b50a0d36 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -28,6 +28,10 @@ #define ROVOL 1 #define BACKVOL 2 +#ifdef DEBUG +extern void afsi_log(char *pattern, ...); +#endif + unsigned int cm_mountRootGen = 0; char cm_sysName[100]; @@ -430,207 +434,213 @@ long cm_ApplyDir(cm_scache_t *scp, cm_DirFuncp_t funcp, void *parmp, osi_hyper_t *startOffsetp, cm_user_t *userp, cm_req_t *reqp, cm_scache_t **retscp) { - char *tp; - long code; - cm_dirEntry_t *dep; - cm_buf_t *bufferp; - long temp; - osi_hyper_t dirLength; - osi_hyper_t bufferOffset; - osi_hyper_t curOffset; - osi_hyper_t thyper; - long entryInDir; - long entryInBuffer; + char *tp; + long code; + cm_dirEntry_t *dep; + cm_buf_t *bufferp; + long temp; + osi_hyper_t dirLength; + osi_hyper_t bufferOffset; + osi_hyper_t curOffset; + osi_hyper_t thyper; + long entryInDir; + long entryInBuffer; cm_pageHeader_t *pageHeaderp; - int slotInPage; - long nextEntryCookie; - int numDirChunks; /* # of 32 byte dir chunks in this entry */ + int slotInPage; + long nextEntryCookie; + int numDirChunks; /* # of 32 byte dir chunks in this entry */ - /* get the directory size */ + /* get the directory size */ lock_ObtainMutex(&scp->mx); - code = cm_SyncOp(scp, NULL, userp, reqp, PRSFS_LOOKUP, - CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); + code = cm_SyncOp(scp, NULL, userp, reqp, PRSFS_LOOKUP, + CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); if (code) { lock_ReleaseMutex(&scp->mx); - return code; - } + return code; + } - if (scp->fileType != CM_SCACHETYPE_DIRECTORY) { + if (scp->fileType != CM_SCACHETYPE_DIRECTORY) { lock_ReleaseMutex(&scp->mx); return CM_ERROR_NOTDIR; - } + } - if ( retscp ) /* if this is a lookup call */ + if (retscp) /* if this is a lookup call */ { cm_lookupSearch_t* sp = parmp; + int casefold = sp->caseFold; + + sp->caseFold = 0; /* we have a strong preference for exact matches */ if ( *retscp = cm_dnlcLookup(scp, sp)) /* dnlc hit */ { + sp->caseFold = casefold; lock_ReleaseMutex(&scp->mx); return 0; } + + sp->caseFold = casefold; } /* * XXX We only get the length once. It might change when we drop the * lock. */ - dirLength = scp->length; + dirLength = scp->length; lock_ReleaseMutex(&scp->mx); - bufferp = NULL; - bufferOffset.LowPart = bufferOffset.HighPart = 0; + bufferp = NULL; + bufferOffset.LowPart = bufferOffset.HighPart = 0; if (startOffsetp) - curOffset = *startOffsetp; + curOffset = *startOffsetp; else { - curOffset.HighPart = 0; - curOffset.LowPart = 0; - } + curOffset.HighPart = 0; + curOffset.LowPart = 0; + } - while (1) { + while (1) { /* make sure that curOffset.LowPart doesn't point to the first - * 32 bytes in the 2nd through last dir page, and that it + * 32 bytes in the 2nd through last dir page, and that it * doesn't point at the first 13 32-byte chunks in the first * dir page, since those are dir and page headers, and don't * contain useful information. - */ + */ temp = curOffset.LowPart & (2048-1); - if (curOffset.HighPart == 0 && curOffset.LowPart < 2048) { - /* we're in the first page */ - if (temp < 13*32) temp = 13*32; + if (curOffset.HighPart == 0 && curOffset.LowPart < 2048) { + /* we're in the first page */ + if (temp < 13*32) temp = 13*32; } else { /* we're in a later dir page */ - if (temp < 32) temp = 32; - } + if (temp < 32) temp = 32; + } - /* make sure the low order 5 bits are zero */ - temp &= ~(32-1); + /* make sure the low order 5 bits are zero */ + temp &= ~(32-1); - /* now put temp bits back ito curOffset.LowPart */ - curOffset.LowPart &= ~(2048-1); - curOffset.LowPart |= temp; + /* now put temp bits back ito curOffset.LowPart */ + curOffset.LowPart &= ~(2048-1); + curOffset.LowPart |= temp; - /* check if we've passed the dir's EOF */ - if (LargeIntegerGreaterThanOrEqualTo(curOffset, dirLength)) + /* check if we've passed the dir's EOF */ + if (LargeIntegerGreaterThanOrEqualTo(curOffset, dirLength)) break; - /* see if we can use the bufferp we have now; compute in which - * page the current offset would be, and check whether that's + /* see if we can use the bufferp we have now; compute in which + * page the current offset would be, and check whether that's * the offset of the buffer we have. If not, get the buffer. */ - thyper.HighPart = curOffset.HighPart; - thyper.LowPart = curOffset.LowPart & ~(buf_bufferSize-1); - if (!bufferp || !LargeIntegerEqualTo(thyper, bufferOffset)) { + thyper.HighPart = curOffset.HighPart; + thyper.LowPart = curOffset.LowPart & ~(buf_bufferSize-1); + if (!bufferp || !LargeIntegerEqualTo(thyper, bufferOffset)) { /* wrong buffer */ - if (bufferp) { + if (bufferp) { lock_ReleaseMutex(&bufferp->mx); - buf_Release(bufferp); - bufferp = NULL; + buf_Release(bufferp); + bufferp = NULL; } lock_ObtainRead(&scp->bufCreateLock); - code = buf_Get(scp, &thyper, &bufferp); + code = buf_Get(scp, &thyper, &bufferp); lock_ReleaseRead(&scp->bufCreateLock); lock_ObtainMutex(&bufferp->mx); - if (code) break; - bufferOffset = thyper; + if (code) break; + bufferOffset = thyper; - /* now get the data in the cache */ - while (1) { - lock_ObtainMutex(&scp->mx); + /* now get the data in the cache */ + while (1) { + lock_ObtainMutex(&scp->mx); code = cm_SyncOp(scp, bufferp, userp, reqp, - PRSFS_LOOKUP, - CM_SCACHESYNC_NEEDCALLBACK - | CM_SCACHESYNC_READ - | CM_SCACHESYNC_BUFLOCKED); + PRSFS_LOOKUP, + CM_SCACHESYNC_NEEDCALLBACK + | CM_SCACHESYNC_READ + | CM_SCACHESYNC_BUFLOCKED); if (code) { lock_ReleaseMutex(&scp->mx); break; } - if (cm_HaveBuffer(scp, bufferp, 1)) { + if (cm_HaveBuffer(scp, bufferp, 1)) { lock_ReleaseMutex(&scp->mx); break; } - /* otherwise, load the buffer and try again */ - lock_ReleaseMutex(&bufferp->mx); - code = cm_GetBuffer(scp, bufferp, NULL, userp, - reqp); - lock_ReleaseMutex(&scp->mx); - lock_ObtainMutex(&bufferp->mx); - if (code) break; - } - if (code) { + /* otherwise, load the buffer and try again */ + lock_ReleaseMutex(&bufferp->mx); + code = cm_GetBuffer(scp, bufferp, NULL, userp, + reqp); + lock_ReleaseMutex(&scp->mx); + lock_ObtainMutex(&bufferp->mx); + if (code) break; + } + if (code) { lock_ReleaseMutex(&bufferp->mx); buf_Release(bufferp); - bufferp = NULL; - break; + bufferp = NULL; + break; } - } /* if (wrong buffer) ... */ + } /* if (wrong buffer) ... */ - /* now we have the buffer containing the entry we're interested - * in; copy it out if it represents a non-deleted entry. - */ + /* now we have the buffer containing the entry we're interested + * in; copy it out if it represents a non-deleted entry. + */ entryInDir = curOffset.LowPart & (2048-1); - entryInBuffer = curOffset.LowPart & (buf_bufferSize - 1); + entryInBuffer = curOffset.LowPart & (buf_bufferSize - 1); /* page header will help tell us which entries are free. Page * header can change more often than once per buffer, since * AFS 3 dir page size may be less than (but not more than) a * buffer package buffer. - */ + */ /* only look intra-buffer */ temp = curOffset.LowPart & (buf_bufferSize - 1); - temp &= ~(2048 - 1); /* turn off intra-page bits */ + temp &= ~(2048 - 1); /* turn off intra-page bits */ pageHeaderp = (cm_pageHeader_t *) (bufferp->datap + temp); /* now determine which entry we're looking at in the page. If * it is free (there's a free bitmap at the start of the dir), * we should skip these 32 bytes. - */ - slotInPage = (entryInDir & 0x7e0) >> 5; - if (!(pageHeaderp->freeBitmap[slotInPage>>3] - & (1 << (slotInPage & 0x7)))) { + */ + slotInPage = (entryInDir & 0x7e0) >> 5; + if (!(pageHeaderp->freeBitmap[slotInPage>>3] + & (1 << (slotInPage & 0x7)))) { /* this entry is free */ - numDirChunks = 1; /* only skip this guy */ - goto nextEntry; - } + numDirChunks = 1; /* only skip this guy */ + goto nextEntry; + } tp = bufferp->datap + entryInBuffer; - dep = (cm_dirEntry_t *) tp; /* now points to AFS3 dir entry */ + dep = (cm_dirEntry_t *) tp; /* now points to AFS3 dir entry */ - /* while we're here, compute the next entry's location, too, + /* while we're here, compute the next entry's location, too, * since we'll need it when writing out the cookie into the * dir listing stream. - */ + */ numDirChunks = cm_NameEntries(dep->name, NULL); - /* compute the offset of the cookie representing the next entry */ - nextEntryCookie = curOffset.LowPart + /* compute the offset of the cookie representing the next entry */ + nextEntryCookie = curOffset.LowPart + (CM_DIR_CHUNKSIZE * numDirChunks); - if (dep->fid.vnode != 0) { + if (dep->fid.vnode != 0) { /* this is one of the entries to use: it is not deleted */ code = (*funcp)(scp, dep, parmp, &curOffset); - if (code) break; + if (code) break; } /* if we're including this name */ -nextEntry: - /* and adjust curOffset to be where the new cookie is */ + nextEntry: + /* and adjust curOffset to be where the new cookie is */ thyper.HighPart = 0; - thyper.LowPart = CM_DIR_CHUNKSIZE * numDirChunks; - curOffset = LargeIntegerAdd(thyper, curOffset); - } /* while copying data for dir listing */ + thyper.LowPart = CM_DIR_CHUNKSIZE * numDirChunks; + curOffset = LargeIntegerAdd(thyper, curOffset); + } /* while copying data for dir listing */ /* release the mutex */ - if (bufferp) { + if (bufferp) { lock_ReleaseMutex(&bufferp->mx); - buf_Release(bufferp); + buf_Release(bufferp); } - return code; + return code; } int cm_NoneUpper(char *s) @@ -655,15 +665,15 @@ long cm_LookupSearchProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *rockp, osi_hyper_t *offp) { cm_lookupSearch_t *sp; - int match; + int match; char shortName[13]; char *matchName; - sp = rockp; + sp = (cm_lookupSearch_t *) rockp; matchName = dep->name; if (sp->caseFold) - match = cm_stricmp(matchName, sp->searchNamep); + match = cm_stricmp(matchName, sp->searchNamep); else match = strcmp(matchName, sp->searchNamep); @@ -682,12 +692,13 @@ long cm_LookupSearchProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *rockp, return 0; sp->found = 1; + if(!sp->caseFold) sp->ExactFound = 1; if (!sp->caseFold || matchName == shortName) { sp->fid.vnode = ntohl(dep->fid.vnode); sp->fid.unique = ntohl(dep->fid.unique); - return CM_ERROR_STOPNOW; - } + return CM_ERROR_STOPNOW; + } /* * If we get here, we are doing a case-insensitive search, and we @@ -699,10 +710,11 @@ long cm_LookupSearchProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *rockp, /* Exact matches are the best. */ match = strcmp(matchName, sp->searchNamep); if (match == 0) { + sp->ExactFound = 1; sp->fid.vnode = ntohl(dep->fid.vnode); sp->fid.unique = ntohl(dep->fid.unique); - return CM_ERROR_STOPNOW; - } + return CM_ERROR_STOPNOW; + } /* Lower-case matches are next. */ if (sp->LCfound) @@ -955,16 +967,16 @@ long cm_Lookup(cm_scache_t *dscp, char *namep, long flags, cm_user_t *userp, { long code; int dnlcHit = 1; /* did we hit in the dnlc? yes, we did */ - cm_scache_t *tscp = NULL; - cm_scache_t *mountedScp; - cm_lookupSearch_t rock; - char tname[256]; + cm_scache_t *tscp = NULL; + cm_scache_t *mountedScp; + cm_lookupSearch_t rock; + char tname[256]; int getroot; if (dscp->fid.vnode == 1 && dscp->fid.unique == 1 - && strcmp(namep, "..") == 0) { + && strcmp(namep, "..") == 0) { if (dscp->dotdotFidp == (cm_fid_t *)NULL - || dscp->dotdotFidp->volume == 0) + || dscp->dotdotFidp->volume == 0) return CM_ERROR_NOSUCHVOLUME; rock.fid = *dscp->dotdotFidp; goto haveFid; @@ -972,98 +984,100 @@ long cm_Lookup(cm_scache_t *dscp, char *namep, long flags, cm_user_t *userp, if (cm_ExpandSysName(namep, tname, sizeof(tname))) { namep = tname; - } + } memset(&rock, 0, sizeof(rock)); - rock.fid.cell = dscp->fid.cell; - rock.fid.volume = dscp->fid.volume; - rock.searchNamep = namep; - rock.caseFold = (flags & CM_FLAG_CASEFOLD); + rock.fid.cell = dscp->fid.cell; + rock.fid.volume = dscp->fid.volume; + rock.searchNamep = namep; + rock.caseFold = (flags & CM_FLAG_CASEFOLD); rock.hasTilde = ((strchr(namep, '~') != NULL) ? 1 : 0); /* If NOMOUNTCHASE, bypass DNLC by passing NULL scp pointer */ code = cm_ApplyDir(dscp, cm_LookupSearchProc, &rock, NULL, userp, reqp, - (flags & CM_FLAG_NOMOUNTCHASE) ? NULL : &tscp); + (flags & CM_FLAG_NOMOUNTCHASE) ? NULL : &tscp); /* code == 0 means we fell off the end of the dir, while stopnow means - * that we stopped early, probably because we found the entry we're + * that we stopped early, probably because we found the entry we're * looking for. Any other non-zero code is an error. - */ - if (code && code != CM_ERROR_STOPNOW) return code; + */ + if (code && code != CM_ERROR_STOPNOW) + return code; getroot = (dscp==cm_rootSCachep) ; - if (!rock.found) { - if (!cm_freelanceEnabled || !getroot) { - if (flags & CM_FLAG_CHECKPATH) - return CM_ERROR_NOSUCHPATH; - else - return CM_ERROR_NOSUCHFILE; - } - else { /* nonexistent dir on freelance root, so add it */ - code = cm_FreelanceAddMount(namep, namep, "root.cell.", + if (!rock.found) { + if (!cm_freelanceEnabled || !getroot) { + if (flags & CM_FLAG_CHECKPATH) + return CM_ERROR_NOSUCHPATH; + else + return CM_ERROR_NOSUCHFILE; + } + else { /* nonexistent dir on freelance root, so add it */ + code = cm_FreelanceAddMount(namep, namep, "root.cell.", &rock.fid); - if (code < 0) { /* add mount point failed, so give up */ - if (flags & CM_FLAG_CHECKPATH) - return CM_ERROR_NOSUCHPATH; - else - return CM_ERROR_NOSUCHFILE; - } - tscp = NULL; /* to force call of cm_GetSCache */ - } + if (code < 0) { /* add mount point failed, so give up */ + if (flags & CM_FLAG_CHECKPATH) + return CM_ERROR_NOSUCHPATH; + else + return CM_ERROR_NOSUCHFILE; + } + tscp = NULL; /* to force call of cm_GetSCache */ + } } - + haveFid: if ( !tscp ) /* we did not find it in the dnlc */ { dnlcHit = 0; - code = cm_GetSCache(&rock.fid, &tscp, userp, reqp); - if (code) return code; + code = cm_GetSCache(&rock.fid, &tscp, userp, reqp); + if (code) + return code; } - /* tscp is now held */ - + /* tscp is now held */ + lock_ObtainMutex(&tscp->mx); code = cm_SyncOp(tscp, NULL, userp, reqp, 0, - CM_SCACHESYNC_GETSTATUS | CM_SCACHESYNC_NEEDCALLBACK); - if (code) { + CM_SCACHESYNC_GETSTATUS | CM_SCACHESYNC_NEEDCALLBACK); + if (code) { lock_ReleaseMutex(&tscp->mx); cm_ReleaseSCache(tscp); - return code; + return code; } - /* tscp is now locked */ + /* tscp is now locked */ - if (!(flags & CM_FLAG_NOMOUNTCHASE) + if (!(flags & CM_FLAG_NOMOUNTCHASE) && tscp->fileType == CM_SCACHETYPE_MOUNTPOINT) { /* mount points are funny: they have a volume name to mount - * the root of. - */ + * the root of. + */ code = cm_ReadMountPoint(tscp, userp, reqp); - if (code == 0) + if (code == 0) code = cm_FollowMountPoint(tscp, dscp, userp, reqp, - &mountedScp); + &mountedScp); lock_ReleaseMutex(&tscp->mx); cm_ReleaseSCache(tscp); if (code) { - return code; - } - tscp = mountedScp; + return code; } + tscp = mountedScp; + } else { lock_ReleaseMutex(&tscp->mx); } /* copy back pointer */ - *outpScpp = tscp; + *outpScpp = tscp; /* insert scache in dnlc */ - if ( !dnlcHit && !(flags & CM_FLAG_NOMOUNTCHASE) ) { + if ( !dnlcHit && !(flags & CM_FLAG_NOMOUNTCHASE) && rock.ExactFound ) { /* lock the directory entry to prevent racing callback revokes */ lock_ObtainMutex(&dscp->mx); if ( dscp->cbServerp && dscp->cbExpires ) - cm_dnlcEnter(dscp, namep, tscp); + cm_dnlcEnter(dscp, namep, tscp); lock_ReleaseMutex(&dscp->mx); } /* and return */ - return 0; + return 0; } long cm_Unlink(cm_scache_t *dscp, char *namep, cm_user_t *userp, cm_req_t *reqp) @@ -1268,140 +1282,140 @@ long cm_NameI(cm_scache_t *rootSCachep, char *pathp, long flags, cm_HoldSCache(tscp); symlinkCount = 0; while (1) { - tc = *tp++; - - /* map Unix slashes into DOS ones so we can interpret Unix - * symlinks properly - */ - if (tc == '/') tc = '\\'; + tc = *tp++; - if (!haveComponent) { + /* map Unix slashes into DOS ones so we can interpret Unix + * symlinks properly + */ + if (tc == '/') tc = '\\'; + + if (!haveComponent) { if (tc == '\\') continue; - else if (tc == 0) { + else if (tc == 0) { if (phase == 1) { phase = 2; tp = pathp; continue; } - code = 0; - break; - } - else { + code = 0; + break; + } + else { haveComponent = 1; - cp = component; - *cp++ = tc; + cp = component; + *cp++ = tc; + } + } + else { + /* we have a component here */ + if (tc == 0 || tc == '\\') { + /* end of the component; we're at the last + * component if tc == 0. However, if the last + * is a symlink, we have more to do. + */ + *cp++ = 0; /* add null termination */ + extraFlag = 0; + if ((flags & CM_FLAG_DIRSEARCH) && tc == 0) + extraFlag = CM_FLAG_NOMOUNTCHASE; + code = cm_Lookup(tscp, component, + flags | extraFlag, + userp, reqp, &nscp); + + if (code) { + cm_ReleaseSCache(tscp); + if (psp) cm_FreeSpace(psp); + return code; + } + haveComponent = 0; /* component done */ + dirScp = tscp; /* for some symlinks */ + tscp = nscp; /* already held */ + if (tc == 0 && !(flags & CM_FLAG_FOLLOW) && phase == 2) { + code = 0; + cm_ReleaseSCache(dirScp); + break; + } + + /* now, if tscp is a symlink, we should follow + * it and assemble the path again. + */ + lock_ObtainMutex(&tscp->mx); + code = cm_SyncOp(tscp, NULL, userp, reqp, 0, + CM_SCACHESYNC_GETSTATUS + | CM_SCACHESYNC_NEEDCALLBACK); + if (code) { + lock_ReleaseMutex(&tscp->mx); + cm_ReleaseSCache(tscp); + cm_ReleaseSCache(dirScp); + break; + } + if (tscp->fileType == CM_SCACHETYPE_SYMLINK) { + /* this is a symlink; assemble a new buffer */ + lock_ReleaseMutex(&tscp->mx); + if (symlinkCount++ >= 16) { + cm_ReleaseSCache(tscp); + cm_ReleaseSCache(dirScp); + if (psp) cm_FreeSpace(psp); + return CM_ERROR_TOOBIG; + } + if (tc == 0) restp = ""; + else restp = tp; + code = cm_AssembleLink(tscp, restp, &linkScp, &tempsp, userp, reqp); + if (code) { + /* something went wrong */ + cm_ReleaseSCache(tscp); + cm_ReleaseSCache(dirScp); + break; } - } - else { - /* we have a component here */ - if (tc == 0 || tc == '\\') { - /* end of the component; we're at the last - * component if tc == 0. However, if the last - * is a symlink, we have more to do. - */ - *cp++ = 0; /* add null termination */ - extraFlag = 0; - if ((flags & CM_FLAG_DIRSEARCH) && tc == 0) - extraFlag = CM_FLAG_NOMOUNTCHASE; - code = cm_Lookup(tscp, component, - flags | extraFlag, - userp, reqp, &nscp); - if (code) { - cm_ReleaseSCache(tscp); - if (psp) cm_FreeSpace(psp); - return code; - } - haveComponent = 0; /* component done */ - dirScp = tscp; /* for some symlinks */ - tscp = nscp; /* already held */ - if (tc == 0 && !(flags & CM_FLAG_FOLLOW) && phase == 2) { - code = 0; - cm_ReleaseSCache(dirScp); - break; - } - - /* now, if tscp is a symlink, we should follow - * it and assemble the path again. - */ - lock_ObtainMutex(&tscp->mx); - code = cm_SyncOp(tscp, NULL, userp, reqp, 0, - CM_SCACHESYNC_GETSTATUS - | CM_SCACHESYNC_NEEDCALLBACK); - if (code) { - lock_ReleaseMutex(&tscp->mx); - cm_ReleaseSCache(tscp); - cm_ReleaseSCache(dirScp); - break; - } - if (tscp->fileType == CM_SCACHETYPE_SYMLINK) { - /* this is a symlink; assemble a new buffer */ - lock_ReleaseMutex(&tscp->mx); - if (symlinkCount++ >= 16) { - cm_ReleaseSCache(tscp); - cm_ReleaseSCache(dirScp); - if (psp) cm_FreeSpace(psp); - return CM_ERROR_TOOBIG; - } - if (tc == 0) restp = ""; - else restp = tp; - code = cm_AssembleLink(tscp, restp, - &linkScp, &tempsp, userp, reqp); - if (code) { - /* something went wrong */ - cm_ReleaseSCache(tscp); - cm_ReleaseSCache(dirScp); - break; - } - - /* otherwise, tempsp has the new path, - * and linkScp is the new root from - * which to interpret that path. - * Continue with the namei processing, - * also doing the bookkeeping for the - * space allocation and tracking the - * vnode reference counts. - */ - if (psp) cm_FreeSpace(psp); - psp = tempsp; - tp = psp->data; - cm_ReleaseSCache(tscp); - tscp = linkScp; /* already held - * by AssembleLink */ - /* now, if linkScp is null, that's - * AssembleLink's way of telling us that - * the sym link is relative to the dir - * containing the link. We have a ref - * to it in dirScp, and we hold it now - * and reuse it as the new spot in the - * dir hierarchy. - */ - if (tscp == NULL) { - cm_HoldSCache(dirScp); - tscp = dirScp; - } - } /* if we have a sym link */ - else { - /* not a symlink, we may be done */ - lock_ReleaseMutex(&tscp->mx); - if (tc == 0) { - if (phase == 1) { - phase = 2; - tp = pathp; - continue; - } - cm_ReleaseSCache(dirScp); - code = 0; - break; - } - } - cm_ReleaseSCache(dirScp); - } /* end of a component */ - else *cp++ = tc; - } /* we have a component */ - } /* big while loop over all components */ + + /* otherwise, tempsp has the new path, + * and linkScp is the new root from + * which to interpret that path. + * Continue with the namei processing, + * also doing the bookkeeping for the + * space allocation and tracking the + * vnode reference counts. + */ + if (psp) cm_FreeSpace(psp); + psp = tempsp; + tp = psp->data; + cm_ReleaseSCache(tscp); + tscp = linkScp; /* already held + * by AssembleLink */ + /* now, if linkScp is null, that's + * AssembleLink's way of telling us that + * the sym link is relative to the dir + * containing the link. We have a ref + * to it in dirScp, and we hold it now + * and reuse it as the new spot in the + * dir hierarchy. + */ + if (tscp == NULL) { + cm_HoldSCache(dirScp); + tscp = dirScp; + } + } /* if we have a sym link */ + else { + /* not a symlink, we may be done */ + lock_ReleaseMutex(&tscp->mx); + if (tc == 0) { + if (phase == 1) { + phase = 2; + tp = pathp; + continue; + } + cm_ReleaseSCache(dirScp); + code = 0; + break; + } + } + cm_ReleaseSCache(dirScp); + } /* end of a component */ + else *cp++ = tc; + } /* we have a component */ + } /* big while loop over all components */ /* already held */ - if (psp) cm_FreeSpace(psp); + if (psp) cm_FreeSpace(psp); if (code == 0) *outScpp = tscp; return code; } @@ -2395,8 +2409,8 @@ long cm_Lock(cm_scache_t *scp, unsigned char LockType, if (code == 0 || Timeout != 0) { fileLock = malloc(sizeof(cm_file_lock_t)); fileLock->LockType = LockType; - fileLock->userp = userp; cm_HoldUser(userp); + fileLock->userp = userp; fileLock->fid = scp->fid; fileLock->LOffset = LOffset; fileLock->LLength = LLength; @@ -2434,7 +2448,7 @@ long cm_Unlock(cm_scache_t *scp, unsigned char LockType, q = scp->fileLocks; while (q) { fileLock = (cm_file_lock_t *) - ((char *) q - offsetof(cm_file_lock_t, fileq)); + ((char *) q - offsetof(cm_file_lock_t, fileq)); if (!found && fileLock->userp == userp && LargeIntegerEqualTo(fileLock->LOffset, LOffset) @@ -2474,7 +2488,8 @@ long cm_Unlock(cm_scache_t *scp, unsigned char LockType, lock_ReleaseMutex(&scp->mx); do { code = cm_Conn(&scp->fid, userp, reqp, &connp); - if (code) break; + if (code) + break; code = RXAFS_ReleaseLock(connp->callp, &tfid, &volSync); } while (cm_Analyze(connp, userp, reqp, &scp->fid, &volSync, NULL, code)); @@ -2590,7 +2605,7 @@ long cm_RetryLock(cm_file_lock_t *oldFileLock, int vcp_is_dead) code = cm_MapRPCError(code, &req); } -handleCode: + handleCode: if (code != 0 && code != CM_ERROR_WOULDBLOCK) { lock_ObtainMutex(&scp->mx); osi_QRemove(&scp->fileLocks, &oldFileLock->fileq); @@ -2602,6 +2617,7 @@ handleCode: else if (code != CM_ERROR_WOULDBLOCK) { oldFileLock->flags |= CM_FILELOCK_FLAG_INVALID; cm_ReleaseUser(oldFileLock->userp); + oldFileLock->userp = NULL; } lock_ReleaseWrite(&cm_scacheLock); diff --git a/src/WINNT/afsd/cm_vnodeops.h b/src/WINNT/afsd/cm_vnodeops.h index d4667b192..dfa462422 100644 --- a/src/WINNT/afsd/cm_vnodeops.h +++ b/src/WINNT/afsd/cm_vnodeops.h @@ -33,7 +33,7 @@ typedef struct cm_lookupSearch { cm_fid_t fid; char *searchNamep; int found; - int LCfound, UCfound, NCfound; + int LCfound, UCfound, NCfound, ExactFound; int caseFold; int hasTilde; } cm_lookupSearch_t; diff --git a/src/WINNT/afsd/cm_volume.c b/src/WINNT/afsd/cm_volume.c index 994e526c5..723dcf72a 100644 --- a/src/WINNT/afsd/cm_volume.c +++ b/src/WINNT/afsd/cm_volume.c @@ -43,14 +43,14 @@ void cm_InitVolume(void) long cm_UpdateVolume(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *reqp, cm_volume_t *volp) { - cm_conn_t *connp; - int i; + cm_conn_t *connp; + int i; cm_serverRef_t *tsrp; - cm_server_t *tsp; - struct sockaddr_in tsockAddr; - long tflags; - u_long tempAddr; - struct vldbentry vldbEntry; /* don't use NVLDB yet; they're not common */ + cm_server_t *tsp; + struct sockaddr_in tsockAddr; + long tflags; + u_long tempAddr; + struct vldbentry vldbEntry; /* don't use NVLDB yet; they're not common */ int ROcount = 0; long code; @@ -71,34 +71,34 @@ long cm_UpdateVolume(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *reqp, free(tsrp); } - /* now we have volume structure locked and held; make RPC to fill it */ - do { + /* now we have volume structure locked and held; make RPC to fill it */ + do { code = cm_ConnByMServers(cellp->vlServersp, userp, reqp, - &connp); - if (code) continue; + &connp); + if (code) continue; osi_Log1(afsd_logp, "CALL VL_GetEntryByNameO name %s", - volp->namep); - code = VL_GetEntryByNameO(connp->callp, volp->namep, &vldbEntry); + volp->namep); + code = VL_GetEntryByNameO(connp->callp, volp->namep, &vldbEntry); } while (cm_Analyze(connp, userp, reqp, NULL, NULL, NULL, code)); - code = cm_MapVLRPCError(code, reqp); + code = cm_MapVLRPCError(code, reqp); - if (code == 0) { + if (code == 0) { /* decode the response */ lock_ObtainWrite(&cm_volumeLock); - if (vldbEntry.flags & VLF_RWEXISTS) - volp->rwID = vldbEntry.volumeId[0]; + if (vldbEntry.flags & VLF_RWEXISTS) + volp->rwID = vldbEntry.volumeId[0]; else - volp->rwID = 0; - if (vldbEntry.flags & VLF_ROEXISTS) - volp->roID = vldbEntry.volumeId[1]; - else - volp->roID = 0; - if (vldbEntry.flags & VLF_BACKEXISTS) - volp->bkID = vldbEntry.volumeId[2]; + volp->rwID = 0; + if (vldbEntry.flags & VLF_ROEXISTS) + volp->roID = vldbEntry.volumeId[1]; + else + volp->roID = 0; + if (vldbEntry.flags & VLF_BACKEXISTS) + volp->bkID = vldbEntry.volumeId[2]; else - volp->bkID = 0; + volp->bkID = 0; lock_ReleaseWrite(&cm_volumeLock); - for(i=0; icellp ) tsp->cellp = cellp; - osi_assert(tsp != NULL); + osi_assert(tsp != NULL); - /* and add it to the list(s). */ + /* and add it to the list(s). */ /* - * Each call to cm_NewServerRef() increments the - * ref count of tsp. These reference will be dropped, + * Each call to cm_NewServerRef() increments the + * ref count of tsp. These reference will be dropped, * if and when the volume is reset; see reset code * earlier in this function. */ if ((tflags & VLSF_RWVOL) - && (vldbEntry.flags & VLF_RWEXISTS)) { + && (vldbEntry.flags & VLF_RWEXISTS)) { tsrp = cm_NewServerRef(tsp); tsrp->next = volp->rwServersp; - volp->rwServersp = tsrp; + volp->rwServersp = tsrp; } - if ((tflags & VLSF_ROVOL) - && (vldbEntry.flags & VLF_ROEXISTS)) { + if ((tflags & VLSF_ROVOL) + && (vldbEntry.flags & VLF_ROEXISTS)) { tsrp = cm_NewServerRef(tsp); cm_InsertServerList(&volp->roServersp, tsrp); ROcount++; - } + } /* We don't use VLSF_BACKVOL !?! */ - if ((tflags & VLSF_RWVOL) - && (vldbEntry.flags & VLF_BACKEXISTS)) { + if ((tflags & VLSF_RWVOL) + && (vldbEntry.flags & VLF_BACKEXISTS)) { tsrp = cm_NewServerRef(tsp); - tsrp->next = volp->bkServersp; - volp->bkServersp = tsrp; + tsrp->next = volp->bkServersp; + volp->bkServersp = tsrp; } /* Drop the reference obtained by cm_FindServer() */ cm_PutServer(tsp); - } + } /* * Randomize RO list @@ -264,6 +264,8 @@ void cm_ForceUpdateVolume(cm_fid_t *fidp, cm_user_t *userp, cm_req_t *reqp) cm_volume_t *volp; long code; + if (!fidp) return; + cellp = cm_FindCellByID(fidp->cell); if (!cellp) return; diff --git a/src/WINNT/afsd/fs.c b/src/WINNT/afsd/fs.c index a981f238a..4daad5b6e 100644 --- a/src/WINNT/afsd/fs.c +++ b/src/WINNT/afsd/fs.c @@ -23,11 +23,6 @@ #include #include -typedef long afs_int32; -typedef unsigned long afs_uint32; -typedef short afs_int16; -typedef unsigned short afs_uint16; - #include "fs.h" #include "fs_utils.h" #include "cmd.h" @@ -48,6 +43,8 @@ static char tspace[1024]; static struct ubik_client *uclient; #endif /* not WIN32 */ +static MemDumpCmd(struct cmd_syndesc *asp); +static CSCPolicyCmd(struct cmd_syndesc *asp); extern afs_int32 VL_GetEntryByNameO(); @@ -519,25 +516,25 @@ char *name; { double QuotaUsed =0.0; double PartUsed =0.0; int WARN = 0; - printf("%-20s",name); + printf("%-25.25s",name); if (status->MaxQuota != 0) { - printf("%8d%8d", status->MaxQuota, status->BlocksInUse); + printf("%10d%10d", status->MaxQuota, status->BlocksInUse); QuotaUsed = ((((double)status->BlocksInUse)/status->MaxQuota) * 100.0); } else { - printf("no limit%8d", status->BlocksInUse); + printf("no limit%10d", status->BlocksInUse); } if (QuotaUsed > 90.0){ - printf(" %8.0f%%<<", QuotaUsed); + printf(" %5.0f%%<<", QuotaUsed); WARN = 1; } - else printf(" %8.0f%% ", QuotaUsed); + else printf(" %5.0f%% ", QuotaUsed); PartUsed = (100.0 - ((((double)status->PartBlocksAvail)/status->PartMaxBlocks) * 100.0)); if (PartUsed > 97.0){ - printf(" %8.0f%%<<", PartUsed); + printf(" %9.0f%%<<", PartUsed); WARN = 1; } - else printf(" %8.0f%% ", PartUsed); + else printf(" %9.0f%% ", PartUsed); if (WARN){ printf("\t<PartMaxBlocks, status->PartMaxBlocks - status->PartBlocksAvail, status->PartBlocksAvail); + printf("%10d%10d%10d", status->PartMaxBlocks, status->PartMaxBlocks - status->PartBlocksAvail, status->PartBlocksAvail); PartUsed = (100.0 - ((((double)status->PartBlocksAvail)/status->PartMaxBlocks) * 100.0)); if (PartUsed > 90.0){ - printf(" %8.0f%%<<", PartUsed); + printf(" %4.0f%%<<", PartUsed); WARN = 1; } - else printf(" %8.0f%% ", PartUsed); + else printf(" %4.0f%% ", PartUsed); if (WARN){ printf("\t<parms[0].items); for(ti=as->parms[0].items; ti; ti=ti->next) { /* once per file */ @@ -1176,8 +1173,8 @@ register struct cmd_syndesc *as; { char *name; struct VolumeStatus *status; - printf("%-20s%-9s%-8s%-11s%-11s\n", - "Volume Name"," kbytes ", " used", " avail ", " %used"); + printf("%-25s%-10s%-10s%-10s%-6s\n", "Volume Name", " kbytes", + " used", " avail", " %used"); SetDotDefault(&as->parms[0].items); for(ti=as->parms[0].items; ti; ti=ti->next) { /* once per file */ @@ -1855,9 +1852,22 @@ register struct cmd_syndesc *as; { Die(errno, 0); return 0; #else /* WIN32 */ - fprintf(stderr, "fs: 'newcell' not implemented, since afsdcell.ini is\n"); - fprintf(stderr, "fs: re-read on every reference to a new cell, on Windows/NT.\n"); - return -1; + register afs_int32 code; + struct ViceIoctl blob; + + blob.in_size = 0; + blob.in = (char *) 0; + blob.out_size = MAXSIZE; + blob.out = space; + + code = pioctl((char *) 0, VIOCNEWCELL, &blob, 1); + + if (code) { + Die(errno, (char *) 0); + } + else + printf("Cell servers information refreshed\n"); + return 0; #endif /* WIN32 */ } @@ -2099,6 +2109,7 @@ register struct cmd_syndesc *as; { } } } + return(0); } @@ -2282,6 +2293,8 @@ struct afsconf_cell *info; info->hostAddr[i].sin_port, USER_SERVICE_ID, sc, scIndex); + if (sc) + rxs_Release(sc); /* Decrement the initial refCount */ code = ubik_ClientInit(serverconns, &uclient); if (code) { @@ -2360,6 +2373,92 @@ static addServer(name, rank) return code; } +static BOOL IsWindowsNT (void) +{ + static BOOL fChecked = FALSE; + static BOOL fIsWinNT = FALSE; + + if (!fChecked) + { + OSVERSIONINFO Version; + + fChecked = TRUE; + + memset (&Version, 0x00, sizeof(Version)); + Version.dwOSVersionInfoSize = sizeof(Version); + + if (GetVersionEx (&Version)) + { + if (Version.dwPlatformId == VER_PLATFORM_WIN32_NT) + fIsWinNT = TRUE; + } + } + return fIsWinNT; +} + + +BOOL IsAdmin (void) +{ + static BOOL fAdmin = FALSE; + static BOOL fTested = FALSE; + + if (!fTested) + { + /* Obtain the SID for BUILTIN\Administrators. If this is Windows NT, + * expect this call to succeed; if it does not, we can presume that + * it's not NT and therefore the user always has administrative + * privileges. + */ + PSID psidAdmin = NULL; + SID_IDENTIFIER_AUTHORITY auth = SECURITY_NT_AUTHORITY; + + fTested = TRUE; + + if (!AllocateAndInitializeSid (&auth, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &psidAdmin)) + fAdmin = TRUE; + else + { + /* Then open our current ProcessToken */ + HANDLE hToken; + + if (OpenProcessToken (GetCurrentProcess(), TOKEN_QUERY, &hToken)) + { + /* We'll have to allocate a chunk of memory to store the list of + * groups to which this user belongs; find out how much memory + * we'll need. + */ + DWORD dwSize = 0; + PTOKEN_GROUPS pGroups; + + GetTokenInformation (hToken, TokenGroups, NULL, dwSize, &dwSize); + + pGroups = (PTOKEN_GROUPS)malloc(dwSize); + + /* Allocate that buffer, and read in the list of groups. */ + if (GetTokenInformation (hToken, TokenGroups, pGroups, dwSize, &dwSize)) + { + /* Look through the list of group SIDs and see if any of them + * matches the Administrator group SID. + */ + size_t iGroup = 0; + for (; (!fAdmin) && (iGroup < pGroups->GroupCount); ++iGroup) + { + if (EqualSid (psidAdmin, pGroups->Groups[ iGroup ].Sid)) + fAdmin = TRUE; + } + } + + if (pGroups) + free(pGroups); + } + } + + if (psidAdmin) + FreeSid (psidAdmin); + } + + return fAdmin; +} static SetPrefCmd(as) register struct cmd_syndesc *as; { @@ -2379,11 +2478,16 @@ register struct cmd_syndesc *as; { gblob.out_size = MAXSIZE; -#ifndef WIN32 - if (geteuid()) { - fprintf (stderr,"Permission denied: requires root access.\n"); - return EACCES; - } +#ifdef WIN32 + if ( !IsAdmin() ) { + fprintf (stderr,"Permission denied: requires Administrator access.\n"); + return EACCES; + } +#else /* WIN32 */ + if (geteuid()) { + fprintf (stderr,"Permission denied: requires root access.\n"); + return EACCES; + } #endif /* WIN32 */ code = 0; @@ -2716,7 +2820,7 @@ char **argv; { cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, "output to named file"); cmd_AddParm(ts, "-numeric", CMD_FLAG, CMD_OPTIONAL, "addresses only"); cmd_AddParm(ts, "-vlservers", CMD_FLAG, CMD_OPTIONAL, "VL servers"); -/* cmd_AddParm(ts, "-cell", CMD_FLAG, CMD_OPTIONAL, "cellname"); */ + /* cmd_AddParm(ts, "-cell", CMD_FLAG, CMD_OPTIONAL, "cellname"); */ cmd_CreateAlias(ts, "gp"); ts = cmd_CreateSyntax("setacl", SetACLCmd, 0, "set access control list"); @@ -2791,12 +2895,12 @@ char **argv; { cmd_AddParm(ts, "-rw", CMD_FLAG, CMD_OPTIONAL, "force r/w volume"); cmd_AddParm(ts, "-fast", CMD_FLAG, CMD_OPTIONAL, "don't check name with VLDB"); -/* - -defect 3069 - + /* + * + * defect 3069 + * cmd_AddParm(ts, "-root", CMD_FLAG, CMD_OPTIONAL, "create cellular mount point"); -*/ + */ ts = cmd_CreateSyntax("rmmount", RemoveMountCmd, 0, "remove mount point"); @@ -2831,17 +2935,19 @@ defect 3069 cmd_CreateAlias(ts, "sq"); ts = cmd_CreateSyntax("newcell", NewCellCmd, 0, "configure new cell"); +#ifndef WIN32 cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "cell name"); cmd_AddParm(ts, "-servers", CMD_LIST, CMD_REQUIRED, "primary servers"); cmd_AddParm(ts, "-linkedcell", CMD_SINGLE, CMD_OPTIONAL, "linked cell name"); +#endif #ifdef FS_ENABLE_SERVER_DEBUG_PORTS -/* - * Turn this on only if you wish to be able to talk to a server which is listening - * on alternative ports. This is not intended for general use and may not be - * supported in the cache manager. It is not a way to run two servers at the - * same host, since the cache manager cannot properly distinguish those two hosts. - */ + /* + * Turn this on only if you wish to be able to talk to a server which is listening + * on alternative ports. This is not intended for general use and may not be + * supported in the cache manager. It is not a way to run two servers at the + * same host, since the cache manager cannot properly distinguish those two hosts. + */ cmd_AddParm(ts, "-fsport", CMD_SINGLE, CMD_OPTIONAL, "cell's fileserver port"); cmd_AddParm(ts, "-vlport", CMD_SINGLE, CMD_OPTIONAL, "cell's vldb server port"); #endif @@ -2854,9 +2960,9 @@ defect 3069 ts = cmd_CreateSyntax("wscell", WSCellCmd, 0, "list workstation's cell"); -/* - ts = cmd_CreateSyntax("primarycell", PrimaryCellCmd, 0, "obsolete (listed primary cell)"); -*/ + /* + ts = cmd_CreateSyntax("primarycell", PrimaryCellCmd, 0, "obsolete (listed primary cell)"); + */ ts = cmd_CreateSyntax("monitor", MonitorCmd, 0, "set cache monitor host address"); cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "host name or 'off'"); @@ -2904,6 +3010,17 @@ defect 3069 cmd_AddParm(ts, "-dump", CMD_FLAG, CMD_OPTIONAL, "dump log contents"); cmd_CreateAlias(ts, "tr"); + ts = cmd_CreateSyntax("memdump", MemDumpCmd, 0, "dump memory allocs in debug builds"); + cmd_AddParm(ts, "-begin", CMD_FLAG, CMD_OPTIONAL, "set a memory checkpoint"); + cmd_AddParm(ts, "-end", CMD_FLAG, CMD_OPTIONAL, "dump memory allocs"); + + ts = cmd_CreateSyntax("cscpolicy", CSCPolicyCmd, 0, "change client side caching policy for AFS shares"); + cmd_AddParm(ts, "-share", CMD_SINGLE, CMD_OPTIONAL, "AFS share"); + cmd_AddParm(ts, "-manual", CMD_FLAG, CMD_OPTIONAL, "manual caching of documents"); + cmd_AddParm(ts, "-programs", CMD_FLAG, CMD_OPTIONAL, "automatic caching of programs and documents"); + cmd_AddParm(ts, "-documents", CMD_FLAG, CMD_OPTIONAL, "automatic caching of documents"); + cmd_AddParm(ts, "-disable", CMD_FLAG, CMD_OPTIONAL, "disable caching"); + code = cmd_Dispatch(argc, argv); #ifndef WIN32 @@ -2960,3 +3077,95 @@ void Die(code, filename) #endif /* not WIN32 */ } } /*Die*/ + +static MemDumpCmd(struct cmd_syndesc *asp) +{ + long code; + struct ViceIoctl blob; + long inValue; + long outValue; + + if ((asp->parms[0].items && asp->parms[1].items)) { + fprintf(stderr, "fs trace: must use at most one of '-begin' or '-end'\n"); + return EINVAL; + } + + /* determine if we're turning this tracing on or off */ + inValue = 0; + if (asp->parms[0].items) + inValue = 1; /* begin */ + else if (asp->parms[1].items) + inValue = 0; /* end */ + + blob.in_size = sizeof(long); + blob.in = (char *) &inValue; + blob.out_size = sizeof(long); + blob.out = (char *) &outValue; + + code = pioctl(NULL, VIOC_TRACEMEMDUMP, &blob, 1); + if (code) { + Die(errno, NULL); + return code; + } + + if (outValue) printf("AFS memdump begin.\n"); + else printf("AFS memdump end.\n"); + + return 0; +} + +static CSCPolicyCmd(struct cmd_syndesc *asp) +{ + struct cmd_item *ti; + char *share = NULL; + char sbmtpath[256]; + char *policy; + + for(ti=asp->parms[0].items; ti;ti=ti->next) { + share = ti->data; + if (share) + { + break; + } + } + + if (share) + { + policy = "manual"; + + if (asp->parms[1].items) + policy = "manual"; + if (asp->parms[2].items) + policy = "programs"; + if (asp->parms[3].items) + policy = "documents"; + if (asp->parms[4].items) + policy = "disable"; + + strcpy(sbmtpath, "afsdsbmt.ini"); + WritePrivateProfileString("CSC Policy", share, policy, sbmtpath); + + printf("CSC policy on share \"%s\" changed to \"%s\".\n\n", share, policy); + printf("Close all applications that accessed files on this share or restart AFS Client for the change to take effect.\n"); + } + else + { + char policies[1024]; + DWORD len = sizeof(policies); + + /* list current csc policies */ + strcpy(sbmtpath, "afsdsbmt.ini"); + + GetPrivateProfileSection("CSC Policy", policies, len, sbmtpath); + + printf("Current CSC policies:\n"); + policy = policies; + while (policy[0]) + { + printf(" %s\n", policy); + policy += strlen(policy) + 1; + } + } + + return (0); +} diff --git a/src/WINNT/afsd/fs.h b/src/WINNT/afsd/fs.h index cd2efdcb2..cfd473e20 100644 --- a/src/WINNT/afsd/fs.h +++ b/src/WINNT/afsd/fs.h @@ -17,7 +17,7 @@ extern void ZapAcl(struct Acl *); extern int PruneList (struct AclEntry **, int); -extern void ChangeList(struct Acl *, long, char *, long); +extern void ChangeList(struct Acl *, afs_int32, char *, afs_int32); extern int CleanAcl(struct Acl *); diff --git a/src/WINNT/afsd/fs_utils.c b/src/WINNT/afsd/fs_utils.c index 6e2c930fd..064f1f986 100644 --- a/src/WINNT/afsd/fs_utils.c +++ b/src/WINNT/afsd/fs_utils.c @@ -24,7 +24,7 @@ #include "afsd.h" #include "smb.h" #include "cmd.h" -#include "fs_utils.h" +#include long fs_ExtractDriveLetter(char *inPathp, char *outPathp) @@ -130,12 +130,12 @@ struct hostent *hostutil_GetHostByName(char *namep) } /* get hostname or addr, given addr in network byte order */ -char *hostutil_GetNameByINet(long addr) +char *hostutil_GetNameByINet(afs_uint32 addr) { static char hostNameBuffer[256]; struct hostent *thp; - thp = gethostbyaddr((char *) &addr, sizeof(long), AF_INET); + thp = gethostbyaddr((char *) &addr, sizeof(afs_uint32), AF_INET); if (thp) strcpy(hostNameBuffer, thp->h_name); else { @@ -219,3 +219,35 @@ long *aval; else *aval = total; return 0; } + +char *cm_mount_root="afs"; +char *cm_slash_mount_root="/afs"; +char *cm_back_slash_mount_root="\\afs"; +#define AFSCONFIGKEYNAME TEXT("SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters") + +void fs_utils_InitMountRoot() +{ + HKEY parmKey; + char mountRoot[MAX_PATH+1]; + char *pmount=mountRoot; + DWORD len=sizeof(mountRoot)-1; + printf("int mountroot \n"); + if ((RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSCONFIGKEYNAME,0, KEY_QUERY_VALUE, &parmKey)!= ERROR_SUCCESS) + || (RegQueryValueEx(parmKey, "Mountroot", NULL, NULL,(LPBYTE)(mountRoot), &len)!= ERROR_SUCCESS) + || (len==sizeof(mountRoot)-1) + ) + strcpy(mountRoot, "\\afs"); + RegCloseKey(parmKey); + mountRoot[len]=0; /*safety see ms-help://MS.MSDNQTR.2002OCT.1033/sysinfo/base/regqueryvalueex.htm*/ + cm_mount_root=malloc(len+1); + cm_slash_mount_root=malloc(len+2); + cm_back_slash_mount_root=malloc(len+2); + if ((*pmount=='/') || (*pmount='\\')) + pmount++; + strcpy(cm_mount_root,pmount); + strcpy(cm_slash_mount_root+1,pmount); + cm_slash_mount_root[0]='/'; + strcpy(cm_back_slash_mount_root+1,pmount); + cm_back_slash_mount_root[0]='\\'; +} + diff --git a/src/WINNT/afsd/fs_utils.h b/src/WINNT/afsd/fs_utils.h index 6e09e1d63..dabe1aeb6 100644 --- a/src/WINNT/afsd/fs_utils.h +++ b/src/WINNT/afsd/fs_utils.h @@ -25,14 +25,22 @@ /* Fake error code since NT errno.h doesn't define it */ #include -extern char *hostutil_GetNameByINet(long addr); +#ifndef hostutil_GetNameByINet +extern char *hostutil_GetNameByINet(afs_uint32 addr); +#endif +#ifndef hostutil_GetHostByName extern struct hostent *hostutil_GetHostByName(char *namep); +#endif -extern long util_GetInt32(char *stringp, long *valuep); +// extern long util_GetInt32(char *stringp, long *valuep); extern long fs_StripDriveLetter(char *inPathp, char *outPathp, long outSize); extern long fs_ExtractDriveLetter(char *inPathp, char *outPathp); +extern char *cm_mount_root; /*"afs"*/ +extern char *cm_slash_mount_root; /*"/afs"*/ +extern char *cm_back_slash_mount_root; /*"\\afs"*/ +extern void fs_utils_InitMountRoot(); #endif /* FS_UTILS_H_ENV */ diff --git a/src/WINNT/afsd/lanahelper.cpp b/src/WINNT/afsd/lanahelper.cpp new file mode 100644 index 000000000..625102730 --- /dev/null +++ b/src/WINNT/afsd/lanahelper.cpp @@ -0,0 +1,627 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define NOLOGGING +#ifndef NOLOGGING +extern "C" { +#include + + void afsi_log(TCHAR *p, ...) { + va_list marker; + TCHAR buffer[200]; + + va_start(marker,p); + _vstprintf(buffer,p,marker); + va_end(marker); + _tcscat(buffer,_T("\n")); + + OutputDebugString(buffer); + } +} +#endif + +static const char *szAFSConfigKeyName = "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"; +static const char *szNetbiosNameValue = "NetbiosName"; +static const char *szIsGatewayValue = "IsGateway"; +static const char *szLanAdapterValue = "LanAdapter"; +static const char *szNoFindLanaByName = "NoFindLanaByName"; + +// Use the IShellFolder API to get the connection name for the given Guid. +static HRESULT lana_ShellGetNameFromGuidW(WCHAR *wGuid, WCHAR *wName, int NameSize) +{ + // This is the GUID for the network connections folder. It is constant. + // {7007ACC7-3202-11D1-AAD2-00805FC1270E} + const GUID CLSID_NetworkConnections = { + 0x7007ACC7, 0x3202, 0x11D1, { + 0xAA, 0xD2, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E + } + }; + LPITEMIDLIST pidl; + IShellFolder *pShellFolder; + IMalloc *pShellMalloc; + + // Build the display name in the form "::{GUID}". + if (wcslen(wGuid) >= MAX_PATH) + return E_INVALIDARG; + WCHAR szAdapterGuid[MAX_PATH + 2]; + swprintf(szAdapterGuid, L"::%ls", wGuid); + + // Initialize COM. + CoInitialize(NULL); + + // Get the shell allocator. + HRESULT hr = SHGetMalloc(&pShellMalloc); + if (SUCCEEDED(hr)) + { + // Create an instance of the network connections folder. + hr = CoCreateInstance(CLSID_NetworkConnections, NULL, + CLSCTX_INPROC_SERVER, IID_IShellFolder, + reinterpret_cast(&pShellFolder)); + } + if (SUCCEEDED(hr)) + { + hr = pShellFolder->ParseDisplayName(NULL, NULL, szAdapterGuid, NULL, + &pidl, NULL); + } + if (SUCCEEDED(hr)) { + // Get the display name; this returns the friendly name. + STRRET sName; + hr = pShellFolder->GetDisplayNameOf(pidl, SHGDN_NORMAL, &sName); + if (SUCCEEDED(hr)) + wcsncpy(wName, sName.pOleStr, NameSize); + pShellMalloc->Free(pidl); + } + + CoUninitialize(); + return hr; +} + +// Get the Connection Name for the given GUID. +extern "C" int lana_GetNameFromGuid(char *Guid, char **Name) +{ + typedef HRESULT (WINAPI *HrLanProcAddr)(GUID *, PCWSTR, PWSTR, LPDWORD); + HrLanProcAddr HrLanProc = NULL; + HMODULE hNetMan; + int size; + WCHAR *wGuid = NULL; + WCHAR wName[MAX_PATH]; + DWORD NameSize = MAX_PATH; + char *name = NULL; + HRESULT status; + + // Convert the Guid string to Unicode. First we ask only for the size + // of the converted string. Then we allocate a buffer of sufficient + // size to hold the result of the conversion. + size = MultiByteToWideChar(CP_ACP, 0, Guid, -1, NULL, 0); + wGuid = (WCHAR *) malloc(size * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, Guid, -1, wGuid, size); + + // First try the IShellFolder interface, which was unimplemented + // for the network connections folder before XP. + + /* XXX pbh 9/11/03 - revert to using the undocumented APIs on XP while + * waiting to hear back from PSS about the slow reboot issue. + * This is an ugly, misleading hack, but is minimally invasive + * and will be easy to rollback. + */ + + //status = getname_shellfolder(wGuid, wName, NameSize); + status = E_NOTIMPL; + + /* XXX end of pbh 9/11/03 temporary hack*/ + + if (status == E_NOTIMPL) { + // The IShellFolder interface is not implemented on this platform. + // Try the (undocumented) HrLanConnectionNameFromGuidOrPath API + // from the netman DLL. +#ifndef NOLOGGING + afsi_log("IShellFolder API not implemented, trying HrLanConnectionNameFromGuidOrPath"); +#endif + hNetMan = LoadLibrary("netman.dll"); + if (hNetMan == NULL) { + free(wGuid); + return -1; + } + /* Super Secret Microsoft Call */ + HrLanProc = (HrLanProcAddr) GetProcAddress(hNetMan, + "HrLanConnectionNameFromGuidOrPath"); + if (HrLanProc == NULL) { + FreeLibrary(hNetMan); + free(wGuid); + return -1; + } + status = HrLanProc(NULL, wGuid, wName, &NameSize); + FreeLibrary(hNetMan); + } + free(wGuid); + if (FAILED(status)) { +#ifndef NOLOGGING + afsi_log("lana_GetNameFromGuid: failed to get connection name (status %ld)", + status); +#endif + return -1; + } + + // Get the required buffer size, and then convert the string. + size = WideCharToMultiByte(CP_ACP, 0, wName, -1, NULL, 0, NULL, NULL); + name = (char *) malloc(size); + if (name == NULL) + return -1; + WideCharToMultiByte(CP_ACP, 0, wName, -1, name, size, NULL, NULL); +#ifndef NOLOGGING + afsi_log("Connection name for %s is '%s'", Guid, name); +#endif + if (*Name) + *Name = name; + else + free(name); + return 0; +} + +// Return an array of LANAINFOs corresponding to a connection named LanaName +// (NULL LanaName matches all connections), and has an IPv4 binding. Returns +// NULL if something goes wrong. +// NOTE: caller must free the returned block if non NULL. +extern "C" LANAINFO * lana_FindLanaByName(const char *LanaName) +{ + const char RegNetBiosLinkageKeyName[] = + "System\\CurrentControlSet\\Services\\NetBios\\Linkage"; + HKEY hkey; + LONG status; + struct { + BYTE flags; + BYTE number; + } lanamap[MAX_LANA+1]; + DWORD lanamapsize = sizeof(lanamap); + DWORD type; + char *bindpaths = NULL; + DWORD bindpathsize; + int nlana; + int i; + char *guid; + char *name; + char *pBind; + char *p; + + LANAINFO * lanainfo; + + // Open the NetBios Linkage key. + status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, RegNetBiosLinkageKeyName, 0, + KEY_QUERY_VALUE, &hkey); + + if (status != ERROR_SUCCESS) { +#ifndef NOLOGGING + afsi_log("Failed to open NetBios Linkage key (status %ld)", status); +#endif + return NULL; + } + + // Read the lana map. + status = RegQueryValueEx(hkey, "LanaMap", 0, &type, + (BYTE *) &lanamap, &lanamapsize); + if (status != ERROR_SUCCESS) { +#ifndef NOLOGGING + afsi_log("Failed to read LanaMap (status %ld)", status); +#endif + RegCloseKey(hkey); + return NULL; + } + if (lanamapsize == 0) { +#ifndef NOLOGGING + afsi_log("No data in LanaMap"); +#endif + return NULL; + } + nlana = lanamapsize / sizeof(lanamap[0]); + + // Get the bind paths for NetBios so we can match them up + // with the lana map. First we query for the size, so we + // can allocate an appropriate buffer. + status = RegQueryValueEx(hkey, "Bind", 0, &type, NULL, &bindpathsize); + if (status == ERROR_SUCCESS && bindpathsize != 0) { + bindpaths = (char *) malloc(bindpathsize * sizeof(char)); + if (bindpaths == NULL) { +#ifndef NOLOGGING + afsi_log("Cannot allocate %ld bytes for bindpaths", bindpathsize); +#endif + RegCloseKey(hkey); + return NULL; + } + status = RegQueryValueEx(hkey, "Bind", 0, &type, + (BYTE *) bindpaths, &bindpathsize); + } + RegCloseKey(hkey); + if (status != ERROR_SUCCESS) { +#ifndef NOLOGGING + afsi_log("Failed to read bind paths (status %ld)", status); +#endif + if (bindpaths != NULL) + free(bindpaths); + return NULL; + } + if (bindpathsize == 0) { +#ifndef NOLOGGING + afsi_log("No bindpath data"); +#endif + if (bindpaths != NULL) + free(bindpaths); + return NULL; + } + + if (LanaName) + { + lanainfo = (LANAINFO *) malloc(sizeof(LANAINFO)*2); + if(lanainfo == NULL) { + free(bindpaths); + return NULL; + } + memset(lanainfo, 0, sizeof(LANAINFO) * 2); + lanainfo[0].lana_number = LANA_INVALID; + } + else + { + lanainfo = (LANAINFO *) malloc(sizeof(LANAINFO)*(nlana+1)); + if(lanainfo == NULL) { + free(bindpaths); + return NULL; + } + memset(lanainfo, 0, sizeof(LANAINFO) * (nlana+1)); + } + + int index = 0; + + // Iterate over the lana map entries and bind paths. + for (i = 0, pBind = bindpaths; i < nlana; + i++, pBind += strlen(pBind) + 1) { + // Ignore an invalid map entry. + if ((lanamap[i].flags & 1) == 0) + continue; + + // check for an IPv4 binding + if(!strstr(pBind,"_Tcpip_")) + continue; + + // Find the beginning of the GUID. + guid = strchr(pBind, '{'); + if (guid == NULL) + continue; // Malformed path entry? + guid = strdup(guid); + if (guid == NULL) + continue; + // Find the end of the GUID. + p = strchr(guid, '}'); + if (p == NULL) { + free(guid); // Malformed GUID? + continue; + } + *++p = '\0'; // Ignore anything after the GUID. + status = lana_GetNameFromGuid(guid, &name); + free(guid); + + if (status == 0 && name != 0) + { + if (LanaName) + { + if (strcmp(name, LanaName) ==0) + { + lanainfo[index].lana_number = lanamap[i].number; + _tcscpy(lanainfo[index].lana_name, name); + free(name); + index++; + break; + } + } + else + { + lanainfo[index].lana_number = lanamap[i].number; + _tcscpy(lanainfo[index].lana_name, name); + free(name); + index++; + } + } + } + + lanainfo[index].lana_number = LANA_INVALID; + + free(bindpaths); + return lanainfo; +} + +extern "C" lana_number_t lana_FindLoopback(void) +{ + NCB ncb; + LANA_ENUM lana_list; + int status; + int i; + + memset(&ncb, 0, sizeof(ncb)); + ncb.ncb_command = NCBENUM; + ncb.ncb_buffer = (UCHAR *) &lana_list; + ncb.ncb_length = sizeof(lana_list); + status = Netbios(&ncb); + if (status != 0) { +#ifndef NOLOGGING + afsi_log("Netbios NCBENUM failed: status %ld", status); +#endif + return LANA_INVALID; + } + for (i = 0; i < lana_list.length; i++) { + if (lana_IsLoopback(lana_list.lana[i])) { + // Found one, return it. +#ifndef NOLOGGING + afsi_log("lana_FindLoopback: Found LAN adapter %d", + lana_list.lana[i]); +#endif + return lana_list.lana[i]; + } + } + // Could not find a loopback adapter. + return LANA_INVALID; +} + +// Is the given lana a Windows Loopback Adapter? +// TODO: implement a better check for loopback +// TODO: also check for proper bindings (IPv4) +extern "C" BOOL lana_IsLoopback(lana_number_t lana) +{ + NCB ncb; + struct { + ADAPTER_STATUS status; + NAME_BUFFER names[MAX_LANA+1]; + } astat; + unsigned char kWLA_MAC[6] = { 0x02, 0x00, 0x4c, 0x4f, 0x4f, 0x50 }; + int status; + + // Reset the adapter: in Win32, this is required for every process, and + // acts as an init call, not as a real hardware reset. + memset(&ncb, 0, sizeof(ncb)); + ncb.ncb_command = NCBRESET; + ncb.ncb_callname[0] = 100; + ncb.ncb_callname[2] = 100; + ncb.ncb_lana_num = lana; + status = Netbios(&ncb); + if (status == 0) + status = ncb.ncb_retcode; + if (status != 0) { +#ifndef NOLOGGING + afsi_log("NCBRESET failed: lana %u, status %ld", lana, status); +#endif + return FALSE; + } + + // Use the NCBASTAT command to get the adapter address. + memset(&ncb, 0, sizeof(ncb)); + ncb.ncb_command = NCBASTAT; + ncb.ncb_lana_num = lana; + strcpy((char *) ncb.ncb_callname, "* "); + ncb.ncb_buffer = (UCHAR *) &astat; + ncb.ncb_length = sizeof(astat); + status = Netbios(&ncb); + if (status == 0) + status = ncb.ncb_retcode; + if (ncb.ncb_retcode != 0) { +#ifndef NOLOGGING + afsi_log("NCBASTAT failed: lana %u, status %ld", lana, status); +#endif + return FALSE; + } + return (memcmp(astat.status.adapter_address, kWLA_MAC, 6) == 0); +} + +// Get the netbios named used/to-be-used by the AFS SMB server. +// IF THEN +// Use specified lana +// ELSE +// Look for an adapter named "AFS", failing which, +// look for a loopback adapter. +// ENDIF +// IF lana is for a loopback && !IsGateway THEN +// IF netbios name is specified THEN +// use specified netbios name +// ELSE +// use "AFS" +// ENDIF +// ELSE +// use netbios name "-AFS" +// ENDIF +// Return ERROR_SUCCESS if netbios name was successfully generated. +// Returns the lana number to use in *pLana (if pLana is non-NULL) and also +// the IsGateway setting in *pIsGateway (if pIsGateway is non-NULL). +// the type of name returned. +// +// buffer is assumed to hold at least MAX_NB_NAME_LENGTH bytes. +// +// flags : +// LANA_NETBIOS_NAME_IN : Use the values of *pLana and *pIsGateway as [in] parameters. +// LANA_NETBIOS_NAME_SUFFIX : Only return the suffix of netbios name +// LANA_NETBIOS_NAME_FULL : Return full netbios name +extern "C" long lana_GetUncServerNameEx(char *buffer, lana_number_t * pLana, int * pIsGateway, int flags) { + HKEY hkConfig; + DWORD dummyLen; + LONG rv; + int regLana; + int regGateway, regNoFindLanaByName; + TCHAR regNbName[MAX_NB_NAME_LENGTH]; + TCHAR nbName[MAX_NB_NAME_LENGTH]; + TCHAR hostname[MAX_COMPUTERNAME_LENGTH+1]; + + rv = RegOpenKeyEx(HKEY_LOCAL_MACHINE,szAFSConfigKeyName,0,KEY_READ,&hkConfig); + if(rv == ERROR_SUCCESS) { + if(!(flags & LANA_NETBIOS_NAME_IN) || !pLana) { + dummyLen = sizeof(regLana); + rv = RegQueryValueEx(hkConfig, szLanAdapterValue, NULL, NULL, (LPBYTE) ®Lana, &dummyLen); + if(rv != ERROR_SUCCESS) regLana = -1; + } else + regLana = *pLana; + + if(!(flags & LANA_NETBIOS_NAME_IN) || !pIsGateway) { + dummyLen = sizeof(regGateway); + rv = RegQueryValueEx(hkConfig, szIsGatewayValue, NULL, NULL, (LPBYTE) ®Gateway, &dummyLen); + if(rv != ERROR_SUCCESS) regGateway = 0; + } else + regGateway = *pIsGateway; + + dummyLen = sizeof(regNoFindLanaByName); + rv = RegQueryValueEx(hkConfig, szNoFindLanaByName, NULL, NULL, (LPBYTE) ®NoFindLanaByName, &dummyLen); + if(rv != ERROR_SUCCESS) regNoFindLanaByName = 0; + + // Do not care if the call fails for insufficient buffer size. We are not interested + // in netbios names over 15 chars. + dummyLen = sizeof(regNbName); + rv = RegQueryValueEx(hkConfig, szNetbiosNameValue, NULL, NULL, (LPBYTE) ®NbName, &dummyLen); + if(rv != ERROR_SUCCESS) regNbName[0] = 0; + else regNbName[15] = 0; + + RegCloseKey(hkConfig); + } else { + if(flags & LANA_NETBIOS_NAME_IN) { + regLana = (pLana)? *pLana: -1; + regGateway = (pIsGateway)? *pIsGateway: 0; + } else { + regLana = -1; + regGateway = 0; + } + regNoFindLanaByName = 0; + regNbName[0] = 0; + } + + if(regLana < 0 || regLana > MAX_LANA) + regLana = -1; + + if(regLana == -1) { + LANAINFO *lanaInfo = NULL; + int nLana = LANA_INVALID; + + if (!regNoFindLanaByName) + lanaInfo = lana_FindLanaByName("AFS"); + if(lanaInfo != NULL) { + nLana = lanaInfo[0].lana_number; + free(lanaInfo); + } else + nLana = LANA_INVALID; + + if(nLana == LANA_INVALID && !regGateway) { + nLana = lana_FindLoopback(); + } + if(nLana != LANA_INVALID) + regLana = nLana; + } + + if(regNbName[0] && + (regLana >=0 && lana_IsLoopback((lana_number_t) regLana))) { + strncpy(nbName,regNbName,15); + nbName[16] = 0; + strupr(nbName); + } else { + char * dot; + + if(flags & LANA_NETBIOS_NAME_SUFFIX) { + strcpy(nbName,"-AFS"); + } else { + dummyLen = sizeof(hostname); + // assume we are not a cluster. + rv = GetComputerName(hostname, &dummyLen); + if(!SUCCEEDED(rv)) { // should not happen, but... + return rv; + } + strncpy(nbName, hostname, 11); + nbName[11] = 0; + if(dot = strchr(nbName,'.')) + *dot = 0; + strcat(nbName,"-AFS"); + } + } + + if(pLana) *pLana = regLana; + if(pIsGateway) *pIsGateway = regGateway; + + strcpy(buffer, nbName); + + return ERROR_SUCCESS; +} + +extern "C" void lana_GetUncServerNameDynamic(int lanaNumber, BOOL isGateway, TCHAR *name, int type) { + char szName[MAX_NB_NAME_LENGTH]; + lana_number_t lana = (lana_number_t) lanaNumber; + int gateway = (int) isGateway; + + if(SUCCEEDED(lana_GetUncServerNameEx(szName, &lana, &gateway, LANA_NETBIOS_NAME_IN | type))) { +#ifdef _UNICODE + mbswcs(name,szName,MAX_NB_NAME_LENGTH); +#else + strncpy(name,szName,MAX_NB_NAME_LENGTH); +#endif + } else + *name = _T('\0'); +} + +extern "C" void lana_GetUncServerName(TCHAR *name, int type) { + char szName[MAX_NB_NAME_LENGTH]; + + if(SUCCEEDED(lana_GetUncServerNameEx(szName,NULL,NULL,type))) { +#ifdef _UNICODE + mbswcs(name,szName,MAX_NB_NAME_LENGTH); +#else + strncpy(name,szName,MAX_NB_NAME_LENGTH); +#endif + } else { + *name = _T('\0'); + } +} + +extern "C" void lana_GetAfsNameString(int lanaNumber, BOOL isGateway, TCHAR* name) +{ + TCHAR netbiosName[32]; + lana_GetUncServerNameDynamic(lanaNumber, isGateway, netbiosName, LANA_NETBIOS_NAME_FULL); + _stprintf(name, _T("Your UNC name to reach the root of AFS is \\\\%s\\all"), netbiosName); +} + +extern "C" void lana_GetNetbiosName(LPTSTR pszName, int type) +{ + HKEY hkCfg; + TCHAR name[MAX_NB_NAME_LENGTH]; + DWORD dummyLen; + + memset(name, 0, sizeof(name)); + if (GetVersion() >= 0x80000000) // not WindowsNT + { + if (type == LANA_NETBIOS_NAME_SUFFIX) + { + _tcscpy(pszName, TEXT("-afs")); + return; + } + + if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,szAFSConfigKeyName,0,KEY_READ,&hkCfg) == ERROR_SUCCESS) { + dummyLen = sizeof(name); + if(RegQueryValueEx(hkCfg,TEXT("Gateway"),NULL,NULL,(LPBYTE) name,&dummyLen) == ERROR_SUCCESS) + name[0] = _T('\0'); + RegCloseKey(hkCfg); + } + + if (_tcslen(name) == 0) + { + _tcscpy(pszName, TEXT("unknown")); + return; + } + + _tcscpy(pszName, name); + _tcscat(pszName, TEXT("-afs")); + return; + } + + lana_GetUncServerName(name,type); + _tcslwr(name); + _tcscpy(pszName, name); + return; +} + diff --git a/src/WINNT/afsd/lanahelper.h b/src/WINNT/afsd/lanahelper.h new file mode 100644 index 000000000..6a44a7263 --- /dev/null +++ b/src/WINNT/afsd/lanahelper.h @@ -0,0 +1,54 @@ +#ifndef __LANAHELPER_H__ +#define __LANAHELPER_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + typedef BYTE lana_number_t; + +#define LANA_INVALID 0xff + + int lana_GetNameFromGuid(char *Guid, char **Name); + + struct LANAINFO + { + lana_number_t lana_number; + TCHAR lana_name[MAX_PATH]; + }; + +#define LANA_INVALID 0xff +#define MAX_NB_NAME_LENGTH 17 + +#define LANA_NETBIOS_NAME_SUFFIX 1 +#define LANA_NETBIOS_NAME_FULL 0 + +#define LANA_NETBIOS_NAME_IN 2 + + int lana_GetNameFromGuid(char *Guid, char **Name); + + struct LANAINFO * lana_FindLanaByName(const char *LanaName); + + lana_number_t lana_FindLoopback(void); + + BOOL lana_IsLoopback(lana_number_t lana); + + long lana_GetUncServerNameEx(char *buffer, lana_number_t * pLana, int * pIsGateway, int flags); + + void lana_GetUncServerNameDynamic(int lanaNumber, BOOL isGateway, TCHAR *name, int type); + + void lana_GetUncServerName(TCHAR *name, int type); + + void lana_GetAfsNameString(int lanaNumber, BOOL isGateway, TCHAR* name); + + void lana_GetNetbiosName(LPTSTR pszName, int type); + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/WINNT/afsd/sample/token.c b/src/WINNT/afsd/sample/token.c index d11b86d44..f3f1810ee 100644 --- a/src/WINNT/afsd/sample/token.c +++ b/src/WINNT/afsd/sample/token.c @@ -7,294 +7,294 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include -#include "krb_auth.h" -#include "afs_tokens.h" -#include "cm_config.h" -#include "cmd.h" - -#define AFS_KERBEROS_ENV - -#define KABADARGUMENT 1 -#define KLOGEXIT(code) exit(code) - -int CommandProc(); - -static int zero_argc; -static char **zero_argv; - -void main (argc, argv) - int argc; - char *argv[]; -{ struct cmd_syndesc *ts; - int code; - WSADATA WSAjunk; - - zero_argc = argc; - zero_argv = argv; - - /* Start up sockets */ - WSAStartup(0x0101, &WSAjunk); - - ts = cmd_CreateSyntax((char *) 0, CommandProc, 0, "obtain Kerberos authentication"); - -#define aXFLAG 0 -#define aPRINCIPAL 1 -#define aPASSWORD 2 -#define aCELL 3 -#define aSERVERS 4 -#define aPIPE 5 -#define aSILENT 6 -#define aLIFETIME 7 -#define aSETPAG 8 -#define aTMP 9 - - - cmd_AddParm(ts, "-x", CMD_FLAG, CMD_OPTIONAL, "(obsolete, noop)"); - cmd_Seek(ts, aPRINCIPAL); - cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_OPTIONAL, "user name"); - cmd_AddParm(ts, "-password", CMD_SINGLE, CMD_OPTIONAL, "user's password"); - cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name"); - cmd_AddParm(ts, "-servers", CMD_LIST, CMD_OPTIONAL, "explicit list of servers"); - cmd_AddParm(ts, "-pipe", CMD_FLAG, CMD_OPTIONAL, "read password from stdin"); - cmd_AddParm(ts, "-silent", CMD_FLAG, CMD_OPTIONAL, "silent operation"); - cmd_AddParm(ts, "-lifetime", CMD_SINGLE, CMD_OPTIONAL, "ticket lifetime in hh[:mm[:ss]]"); - cmd_AddParm(ts, "-setpag", CMD_FLAG, CMD_OPTIONAL, "Create a new setpag before authenticating"); - cmd_AddParm(ts, "-tmp", CMD_FLAG, CMD_OPTIONAL, "write Kerberos-style ticket file in /tmp"); - - code = cmd_Dispatch(argc, argv); - KLOGEXIT(code); -} - -static char *getpipepass() { - static char gpbuf[BUFSIZ]; - /* read a password from stdin, stop on \n or eof */ - register int i, tc; - memset(gpbuf, 0, sizeof(gpbuf)); - for(i=0; i<(sizeof(gpbuf)-1); i++) { - tc = fgetc(stdin); - if (tc == '\n' || tc == EOF) break; - gpbuf[i] = tc; - } - return gpbuf; -} - -/* good_gets is like gets except that it take a max string length and won't - * write past the end of its input buffer. It returns a variety of negative - * numbers in case of errors and zero if there was no characters read (a blank - * line for instance). Otherwise it returns the length of the string read in. - */ - -static int good_gets (s, max) - char *s; - int max; -{ int l; /* length of string read */ - if (!fgets (s, max, stdin)) { - if (feof(stdin)) return EOF; /* EOF on input, nothing read */ - else return -2; /* I don't think this can happen */ - } - l = strlen (s); - if (l && (s[l-1] == '\n')) s[--l] = 0; - return l; -} - -static int read_pw_string(char *s, int max) -{ - int ok = 0; - HANDLE h; - int md; - - /* set no echo */ - h = GetStdHandle (STD_INPUT_HANDLE); - GetConsoleMode (h, &md); - SetConsoleMode (h, md & ~ENABLE_ECHO_INPUT); - - while (!ok) { - printf("Password:"); - fflush(stdout); - if (good_gets(s, max) <= 0) { - printf("\n"); fflush(stdout); - if (feof (stdin)) break; /* just give up */ - else continue; /* try again: blank line */ - } - ok = 1; - } - - if (!ok) - memset(s, 0, max); - - /* reset echo */ - SetConsoleMode (h, md); - printf("\n"); fflush(stdout); - - s[max-1] = 0; /* force termination */ - return !ok; -} - -CommandProc (as, arock) - char *arock; - struct cmd_syndesc *as; -{ - char name[MAXKTCNAMELEN]; - char defaultCell[256]; - char realm[MAXKTCREALMLEN]; - int code; - int i, dosetpag; - int lifetime; /* requested ticket lifetime */ - - char passwd[BUFSIZ]; - - static char rn[] = "klog"; /*Routine name*/ - static int Pipe = 0; /* reading from a pipe */ - static int Silent = 0; /* Don't want error messages */ - - int foundPassword = 0; /*Not yet, anyway*/ - int foundExplicitCell = 0; /*Not yet, anyway*/ - int writeTicketFile = 0; /* write ticket file to /tmp */ - int password_expires = -1; - - char *reason; /* string describing errors */ - - /* blow away command line arguments */ - for (i=1; iparms[aSILENT].itemsp ? 1 : 0); - Pipe = (as->parms[aPIPE].itemsp ? 1 : 0); - - /* Determine if we should also do a setpag based on -setpag switch */ - dosetpag = (as->parms[aSETPAG].itemsp ? 1 : 0); - - if (as->parms[aTMP].itemsp) { - writeTicketFile = 1; - } - - cm_GetRootCellName(defaultCell); - - /* Parse our arguments. */ - - if (as->parms[aCELL].itemsp) { - /* - * cell name explicitly mentioned; take it in if no other cell name - * has already been specified and if the name actually appears. If - * the given cell name differs from our own, we don't do a lookup. - */ - foundExplicitCell = 1; - strncpy (realm, as->parms[aCELL].itemsp->data, sizeof(realm)); - } - - if (as->parms[aSERVERS].itemsp) { - fprintf (stderr, "SERVERS option not available.\n"); - } - - if (as->parms[aPRINCIPAL].itemsp) { - strcpy(name, as->parms[aPRINCIPAL].itemsp->data); - } else { - /* No explicit name provided. */ - DWORD size = GetEnvironmentVariable("USERNAME", name, sizeof(name) - 1); - if (size <= 0 || size >= sizeof(name)) - KLOGEXIT( KABADARGUMENT ); - } - - if (as->parms[aPASSWORD].itemsp) { - /* - * Current argument is the desired password string. Remember it in - * our local buffer, and zero out the argument string - anyone can - * see it there with ps! - */ - foundPassword = 1; - strncpy (passwd, as->parms[aPASSWORD].itemsp->data, sizeof(passwd)); - memset (as->parms[aPASSWORD].itemsp->data, 0, - strlen(as->parms[aPASSWORD].itemsp->data)); - } - - if (as->parms[aLIFETIME].itemsp) { - char *life = as->parms[aLIFETIME].itemsp->data; - char *sp; /* string ptr to rest of life */ - lifetime = 3600*strtol (life, &sp, 0); /* hours */ - if (sp == life) { -bad_lifetime: - if (!Silent) fprintf (stderr, "%s: translating '%s' to lifetime failed\n", - rn, life); - return KABADARGUMENT; - } - if (*sp == ':') { - life = sp+1; /* skip the colon */ - lifetime += 60*strtol (life, &sp, 0); /* minutes */ - if (sp == life) goto bad_lifetime; - if (*sp == ':') { - life = sp+1; - lifetime += strtol (life, &sp, 0); /* seconds */ - if (sp == life) goto bad_lifetime; - if (*sp) goto bad_lifetime; - } else if (*sp) goto bad_lifetime; - } else if (*sp) goto bad_lifetime; - if (lifetime > MAXKTCTICKETLIFETIME) { - if (!Silent) - fprintf (stderr, - "%s: a lifetime of %.2f hours is too long, must be less than %d.\n", - rn, (double)lifetime/3600.0, MAXKTCTICKETLIFETIME/3600); - KLOGEXIT( KABADARGUMENT ); - } - } else lifetime = 0; - - if (!foundExplicitCell) strcpy (realm, defaultCell); - - /* Get the password if it wasn't provided. */ - if (!foundPassword) { - if (Pipe) { - strncpy(passwd, getpipepass(), sizeof(passwd)); - } - else { - if (read_pw_string(passwd, sizeof(passwd))) - reason = "can't read password from terminal"; - else if (strlen(passwd) == 0) - reason = "zero length password is illegal"; - else - reason = NULL; - if (reason) { - fprintf (stderr, "Unable to login because %s.\n", reason); - KLOGEXIT( KABADARGUMENT ); - } - } - } - - code = ka_UserAuthenticateGeneral (0, name, "", realm, passwd, lifetime, - &password_expires, 0, &reason); - memset (passwd, 0, sizeof(passwd)); - if (code) { - if (!Silent) { - fprintf (stderr, - "Unable to authenticate to AFS because %s.\n", reason); - } - KLOGEXIT( code ); - } - -#ifndef AFS_KERBEROS_ENV - if (writeTicketFile) { - code = krb_write_ticket_file (realm); - if (!Silent) { - if (code) - com_err (rn, code, "writing Kerberos ticket file"); - else fprintf (stderr, "Wrote ticket file to /tmp\n"); - } - } -#endif - -#ifdef DEBUGEXPIRES - if (password_expires >= 0) { - printf ("password expires at %ld\n", password_expires); - } -#endif /* DEBUGEXPIRES */ - - return 0; -} - -/* dummies to substitute for OSI */ -void *osi_Alloc(int sz) { - return malloc(sz); -} -void osi_Free(void *vs, int sz) { - free(vs); -} +#include +#include "krb_auth.h" +#include "afs_tokens.h" +#include "cm_config.h" +#include "cmd.h" + +#define AFS_KERBEROS_ENV + +#define KABADARGUMENT 1 +#define KLOGEXIT(code) exit(code) + +int CommandProc(); + +static int zero_argc; +static char **zero_argv; + +void main (argc, argv) + int argc; + char *argv[]; +{ struct cmd_syndesc *ts; + int code; + WSADATA WSAjunk; + + zero_argc = argc; + zero_argv = argv; + + /* Start up sockets */ + WSAStartup(0x0101, &WSAjunk); + + ts = cmd_CreateSyntax((char *) 0, CommandProc, 0, "obtain Kerberos authentication"); + +#define aXFLAG 0 +#define aPRINCIPAL 1 +#define aPASSWORD 2 +#define aCELL 3 +#define aSERVERS 4 +#define aPIPE 5 +#define aSILENT 6 +#define aLIFETIME 7 +#define aSETPAG 8 +#define aTMP 9 + + + cmd_AddParm(ts, "-x", CMD_FLAG, CMD_OPTIONAL, "(obsolete, noop)"); + cmd_Seek(ts, aPRINCIPAL); + cmd_AddParm(ts, "-principal", CMD_SINGLE, CMD_OPTIONAL, "user name"); + cmd_AddParm(ts, "-password", CMD_SINGLE, CMD_OPTIONAL, "user's password"); + cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name"); + cmd_AddParm(ts, "-servers", CMD_LIST, CMD_OPTIONAL, "explicit list of servers"); + cmd_AddParm(ts, "-pipe", CMD_FLAG, CMD_OPTIONAL, "read password from stdin"); + cmd_AddParm(ts, "-silent", CMD_FLAG, CMD_OPTIONAL, "silent operation"); + cmd_AddParm(ts, "-lifetime", CMD_SINGLE, CMD_OPTIONAL, "ticket lifetime in hh[:mm[:ss]]"); + cmd_AddParm(ts, "-setpag", CMD_FLAG, CMD_OPTIONAL, "Create a new setpag before authenticating"); + cmd_AddParm(ts, "-tmp", CMD_FLAG, CMD_OPTIONAL, "write Kerberos-style ticket file in /tmp"); + + code = cmd_Dispatch(argc, argv); + KLOGEXIT(code); +} + +static char *getpipepass() { + static char gpbuf[BUFSIZ]; + /* read a password from stdin, stop on \n or eof */ + register int i, tc; + memset(gpbuf, 0, sizeof(gpbuf)); + for(i=0; i<(sizeof(gpbuf)-1); i++) { + tc = fgetc(stdin); + if (tc == '\n' || tc == EOF) break; + gpbuf[i] = tc; + } + return gpbuf; +} + +/* good_gets is like gets except that it take a max string length and won't + * write past the end of its input buffer. It returns a variety of negative + * numbers in case of errors and zero if there was no characters read (a blank + * line for instance). Otherwise it returns the length of the string read in. + */ + +static int good_gets (s, max) + char *s; + int max; +{ int l; /* length of string read */ + if (!fgets (s, max, stdin)) { + if (feof(stdin)) return EOF; /* EOF on input, nothing read */ + else return -2; /* I don't think this can happen */ + } + l = strlen (s); + if (l && (s[l-1] == '\n')) s[--l] = 0; + return l; +} + +static int read_pw_string(char *s, int max) +{ + int ok = 0; + HANDLE h; + int md; + + /* set no echo */ + h = GetStdHandle (STD_INPUT_HANDLE); + GetConsoleMode (h, &md); + SetConsoleMode (h, md & ~ENABLE_ECHO_INPUT); + + while (!ok) { + printf("Password:"); + fflush(stdout); + if (good_gets(s, max) <= 0) { + printf("\n"); fflush(stdout); + if (feof (stdin)) break; /* just give up */ + else continue; /* try again: blank line */ + } + ok = 1; + } + + if (!ok) + memset(s, 0, max); + + /* reset echo */ + SetConsoleMode (h, md); + printf("\n"); fflush(stdout); + + s[max-1] = 0; /* force termination */ + return !ok; +} + +CommandProc (as, arock) + char *arock; + struct cmd_syndesc *as; +{ + char name[MAXKTCNAMELEN]; + char defaultCell[256]; + char realm[MAXKTCREALMLEN]; + int code; + int i, dosetpag; + int lifetime; /* requested ticket lifetime */ + + char passwd[BUFSIZ]; + + static char rn[] = "klog"; /*Routine name*/ + static int Pipe = 0; /* reading from a pipe */ + static int Silent = 0; /* Don't want error messages */ + + int foundPassword = 0; /*Not yet, anyway*/ + int foundExplicitCell = 0; /*Not yet, anyway*/ + int writeTicketFile = 0; /* write ticket file to /tmp */ + int password_expires = -1; + + char *reason; /* string describing errors */ + + /* blow away command line arguments */ + for (i=1; iparms[aSILENT].itemsp ? 1 : 0); + Pipe = (as->parms[aPIPE].itemsp ? 1 : 0); + + /* Determine if we should also do a setpag based on -setpag switch */ + dosetpag = (as->parms[aSETPAG].itemsp ? 1 : 0); + + if (as->parms[aTMP].itemsp) { + writeTicketFile = 1; + } + + cm_GetRootCellName(defaultCell); + + /* Parse our arguments. */ + + if (as->parms[aCELL].itemsp) { + /* + * cell name explicitly mentioned; take it in if no other cell name + * has already been specified and if the name actually appears. If + * the given cell name differs from our own, we don't do a lookup. + */ + foundExplicitCell = 1; + strncpy (realm, as->parms[aCELL].itemsp->data, sizeof(realm)); + } + + if (as->parms[aSERVERS].itemsp) { + fprintf (stderr, "SERVERS option not available.\n"); + } + + if (as->parms[aPRINCIPAL].itemsp) { + strcpy(name, as->parms[aPRINCIPAL].itemsp->data); + } else { + /* No explicit name provided. */ + DWORD size = GetEnvironmentVariable("USERNAME", name, sizeof(name) - 1); + if (size <= 0 || size >= sizeof(name)) + KLOGEXIT( KABADARGUMENT ); + } + + if (as->parms[aPASSWORD].itemsp) { + /* + * Current argument is the desired password string. Remember it in + * our local buffer, and zero out the argument string - anyone can + * see it there with ps! + */ + foundPassword = 1; + strncpy (passwd, as->parms[aPASSWORD].itemsp->data, sizeof(passwd)); + memset (as->parms[aPASSWORD].itemsp->data, 0, + strlen(as->parms[aPASSWORD].itemsp->data)); + } + + if (as->parms[aLIFETIME].itemsp) { + char *life = as->parms[aLIFETIME].itemsp->data; + char *sp; /* string ptr to rest of life */ + lifetime = 3600*strtol (life, &sp, 0); /* hours */ + if (sp == life) { +bad_lifetime: + if (!Silent) fprintf (stderr, "%s: translating '%s' to lifetime failed\n", + rn, life); + return KABADARGUMENT; + } + if (*sp == ':') { + life = sp+1; /* skip the colon */ + lifetime += 60*strtol (life, &sp, 0); /* minutes */ + if (sp == life) goto bad_lifetime; + if (*sp == ':') { + life = sp+1; + lifetime += strtol (life, &sp, 0); /* seconds */ + if (sp == life) goto bad_lifetime; + if (*sp) goto bad_lifetime; + } else if (*sp) goto bad_lifetime; + } else if (*sp) goto bad_lifetime; + if (lifetime > MAXKTCTICKETLIFETIME) { + if (!Silent) + fprintf (stderr, + "%s: a lifetime of %.2f hours is too long, must be less than %d.\n", + rn, (double)lifetime/3600.0, MAXKTCTICKETLIFETIME/3600); + KLOGEXIT( KABADARGUMENT ); + } + } else lifetime = 0; + + if (!foundExplicitCell) strcpy (realm, defaultCell); + + /* Get the password if it wasn't provided. */ + if (!foundPassword) { + if (Pipe) { + strncpy(passwd, getpipepass(), sizeof(passwd)); + } + else { + if (read_pw_string(passwd, sizeof(passwd))) + reason = "can't read password from terminal"; + else if (strlen(passwd) == 0) + reason = "zero length password is illegal"; + else + reason = NULL; + if (reason) { + fprintf (stderr, "Unable to login because %s.\n", reason); + KLOGEXIT( KABADARGUMENT ); + } + } + } + + code = ka_UserAuthenticateGeneral (0, name, "", realm, passwd, lifetime, + &password_expires, 0, &reason); + memset (passwd, 0, sizeof(passwd)); + if (code) { + if (!Silent) { + fprintf (stderr, + "Unable to authenticate to AFS because %s.\n", reason); + } + KLOGEXIT( code ); + } + +#ifndef AFS_KERBEROS_ENV + if (writeTicketFile) { + code = krb_write_ticket_file (realm); + if (!Silent) { + if (code) + com_err (rn, code, "writing Kerberos ticket file"); + else fprintf (stderr, "Wrote ticket file to /tmp\n"); + } + } +#endif + +#ifdef DEBUGEXPIRES + if (password_expires >= 0) { + printf ("password expires at %ld\n", password_expires); + } +#endif /* DEBUGEXPIRES */ + + return 0; +} + +/* dummies to substitute for OSI */ +void *osi_Alloc(int sz) { + return malloc(sz); +} +void osi_Free(void *vs, int sz) { + free(vs); +} diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index fceb2c707..48d4074dc 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -32,6 +32,7 @@ #include "afsd.h" #include "smb.h" +#include "lanahelper.h" /* These characters are illegal in Windows filenames */ static char *illegalChars = "\\/:*?\"<>|"; @@ -40,13 +41,12 @@ BOOL isWindows2000 = FALSE; smb_vc_t *dead_vcp = NULL; smb_vc_t *active_vcp = NULL; +/* TODO; logout mechanism needs to be thread-safe */ char *loggedOutName = NULL; smb_user_t *loggedOutUserp = NULL; unsigned long loggedOutTime; int loggedOut = 0; -#ifdef DJGPP int smbShutdownFlag = 0; -#endif /* DJGPP */ int smb_LogoffTokenTransfer; unsigned long smb_LogoffTransferTimeout; @@ -57,15 +57,16 @@ long ongoingOps = 0; unsigned int sessionGen = 0; -void afsi_log(); +extern void afsi_log(char *pattern, ...); +extern HANDLE afsi_file; osi_hyper_t hzero = {0, 0}; osi_hyper_t hones = {0xFFFFFFFF, -1}; -osi_log_t *smb_logp; +osi_log_t * smb_logp; osi_rwlock_t smb_globalLock; osi_rwlock_t smb_rctLock; -osi_rwlock_t smb_ListenerLock; +osi_mutex_t smb_ListenerLock; char smb_LANadapter; unsigned char smb_sharename[NCBNAMSZ+1] = {0}; @@ -83,14 +84,17 @@ int smb_NumServerThreads; int numNCBs, numSessions; -#define NCBmax 100 +int smb_maxVCPerServer; +int smb_maxMpxRequests; + +#define NCBmax MAXIMUM_WAIT_OBJECTS EVENT_HANDLE NCBavails[NCBmax], NCBevents[NCBmax]; EVENT_HANDLE **NCBreturns; DWORD NCBsessions[NCBmax]; NCB *NCBs[NCBmax]; struct smb_packet *bufs[NCBmax]; -#define Sessionmax 100 +#define Sessionmax MAXIMUM_WAIT_OBJECTS EVENT_HANDLE SessionEvents[Sessionmax]; unsigned short LSNs[Sessionmax]; int lanas[Sessionmax]; @@ -107,6 +111,9 @@ int smb_RawBufSel[SMB_RAW_BUFS]; char *smb_RawBufs; #endif /* DJGPP */ +#define SMB_MASKFLAG_TILDE 1 +#define SMB_MASKFLAG_CASEFOLD 2 + #define RAWTIMEOUT INFINITE /* for raw write */ @@ -117,7 +124,7 @@ typedef struct raw_write_cont { #ifndef DJGPP char *buf; #else - dos_ptr buf; + dos_ptr buf; #endif /* DJGPP */ int writeMode; long alreadyWritten; @@ -128,12 +135,17 @@ long smb_dirSearchCounter = 1; smb_dirSearch_t *smb_firstDirSearchp; smb_dirSearch_t *smb_lastDirSearchp; +/* hide dot files? */ +int smb_hideDotFiles; + /* global state about V3 protocols */ int smb_useV3; /* try to negotiate V3 */ #ifndef DJGPP +static showErrors = 1; /* MessageBox or something like it */ -int (WINAPI *smb_MBfunc)(HWND, LPCTSTR, LPCTSTR, UINT) = NULL; +int (_stdcall *smb_MBfunc)(HWND, LPCTSTR, LPCTSTR, UINT) = NULL; +extern HANDLE WaitToTerminate; #endif /* DJGPP */ /* GMT time info: @@ -145,7 +157,7 @@ long smb_localZero; /* Time difference for converting to kludge-GMT */ int smb_NowTZ; -char *smb_localNamep; +char *smb_localNamep = NULL; smb_vc_t *smb_allVCsp; @@ -155,10 +167,14 @@ smb_waitingLock_t *smb_allWaitingLocks; /* forward decl */ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, - NCB *ncbp, raw_write_cont_t *rwcp); + NCB *ncbp, raw_write_cont_t *rwcp); void smb_NetbiosInit(); -extern char cm_HostName[]; #ifdef DJGPP +#ifndef AFS_WIN95_ENV +DWORD smb_ServerExceptionFilter(void); +#endif + +extern char cm_HostName[]; extern char cm_confDir[]; #endif @@ -169,6 +185,8 @@ extern char cm_confDir[]; *(sizep) = strlen(cm_HostName) #endif /* DJGPP */ +extern char AFSConfigKeyName[]; + /* * Demo expiration * @@ -325,10 +343,10 @@ unsigned int smb_Attributes(cm_scache_t *scp) unsigned int attrs; if (scp->fileType == CM_SCACHETYPE_DIRECTORY - || scp->fileType == CM_SCACHETYPE_MOUNTPOINT) - attrs = 0x10; + || scp->fileType == CM_SCACHETYPE_MOUNTPOINT) + attrs = SMB_ATTR_DIRECTORY; else - attrs = 0; + attrs = 0; /* * We used to mark a file RO if it was in an RO volume, but that @@ -338,49 +356,71 @@ unsigned int smb_Attributes(cm_scache_t *scp) if ((scp->unixModeBits & 0222) == 0 || (scp->flags & CM_SCACHEFLAG_RO)) #endif if ((scp->unixModeBits & 0222) == 0) - attrs |= 1; /* turn on read-only flag */ + attrs |= SMB_ATTR_READONLY; /* turn on read-only flag */ return attrs; } +/* Check if the named file/dir is a dotfile/dotdir */ +/* String pointed to by lastComp can have leading slashes, but otherwise should have + no other patch components */ +unsigned int smb_IsDotFile(char *lastComp) { + char *s; + if(lastComp) { + /* skip over slashes */ + for(s=lastComp;*s && (*s == '\\' || *s == '/'); s++); + } + else + return 0; + + /* nulls, curdir and parent dir doesn't count */ + if(!*s) return 0; + if(*s == '.') { + if(!*(s + 1)) return 0; + if(*(s+1) == '.' && !*(s + 2)) return 0; + return 1; + } + return 0; +} + static int ExtractBits(WORD bits, short start, short len) { - int end; - WORD num; + int end; + WORD num; - end = start + len; - - num = bits << (16 - end); - num = num >> ((16 - end) + start); + end = start + len; - return (int)num; + num = bits << (16 - end); + num = num >> ((16 - end) + start); + + return (int)num; } #ifndef DJGPP void ShowUnixTime(char *FuncName, long unixTime) { - FILETIME ft; - WORD wDate, wTime; + FILETIME ft; + WORD wDate, wTime; smb_LargeSearchTimeFromUnixTime(&ft, unixTime); - if (!FileTimeToDosDateTime(&ft, &wDate, &wTime)) - osi_Log1(afsd_logp, "Failed to convert filetime to dos datetime: %d", GetLastError()); - else { - int day, month, year, sec, min, hour; - char msg[256]; - - day = ExtractBits(wDate, 0, 5); - month = ExtractBits(wDate, 5, 4); - year = ExtractBits(wDate, 9, 7) + 1980; - - sec = ExtractBits(wTime, 0, 5); - min = ExtractBits(wTime, 5, 6); - hour = ExtractBits(wTime, 11, 5); - - sprintf(msg, "%s = %02d-%02d-%04d %02d:%02d:%02d", FuncName, month, day, year, hour, min, sec); - osi_Log1(afsd_logp, "%s", osi_LogSaveString(afsd_logp, msg)); - } + if (!FileTimeToDosDateTime(&ft, &wDate, &wTime)) + osi_Log1(smb_logp, "Failed to convert filetime to dos datetime: %d", GetLastError()); + else { + int day, month, year, sec, min, hour; + char msg[256]; + + day = ExtractBits(wDate, 0, 5); + month = ExtractBits(wDate, 5, 4); + year = ExtractBits(wDate, 9, 7) + 1980; + + sec = ExtractBits(wTime, 0, 5); + min = ExtractBits(wTime, 5, 6); + hour = ExtractBits(wTime, 11, 5); + + sprintf(msg, "%s = %02d-%02d-%04d %02d:%02d:%02d", FuncName, month, day, year, hour, min, sec); + osi_Log1(smb_logp, "%s", osi_LogSaveString(smb_logp, msg)); + } } #endif /* DJGPP */ @@ -394,13 +434,13 @@ void GetTimeZoneInfo(BOOL *pDST, LONG *pDstBias, LONG *pBias) /* Get the time zone info. NT uses this to calc if we are in DST. */ GetTimeZoneInformation(&timeZoneInformation); - /* Return the daylight bias */ - *pDstBias = timeZoneInformation.DaylightBias; + /* Return the daylight bias */ + *pDstBias = timeZoneInformation.DaylightBias; - /* Return the bias */ - *pBias = timeZoneInformation.Bias; + /* Return the bias */ + *pBias = timeZoneInformation.Bias; - /* Now determine if DST is being observed */ + /* Now determine if DST is being observed */ /* Get the UTC (GMT) time */ GetSystemTime(&utc); @@ -431,51 +471,51 @@ void GetTimeZoneInfo(BOOL *pDST, LONG *pDstBias, LONG *pBias) /* Determine if we are observing daylight savings time */ void GetTimeZoneInfo(BOOL *pDST, LONG *pDstBias, LONG *pBias) { - struct timeb t; + struct timeb t; - ftime(&t); - *pDST = t.dstflag; - *pDstBias = -60; /* where can this be different? */ - *pBias = t.timezone; + ftime(&t); + *pDST = t.dstflag; + *pDstBias = -60; /* where can this be different? */ + *pBias = t.timezone; } #endif /* DJGPP */ void CompensateForSmbClientLastWriteTimeBugs(long *pLastWriteTime) { - BOOL dst; /* Will be TRUE if observing DST */ - LONG dstBias; /* Offset from local time if observing DST */ - LONG bias; /* Offset from GMT for local time */ - - /* - * This function will adjust the last write time to compensate - * for two bugs in the smb client: - * - * 1) During Daylight Savings Time, the LastWriteTime is ahead - * in time by the DaylightBias (ignoring the sign - the - * DaylightBias is always stored as a negative number). If - * the DaylightBias is -60, then the LastWriteTime will be - * ahead by 60 minutes. - * - * 2) If the local time zone is a positive offset from GMT, then - * the LastWriteTime will be the correct local time plus the - * Bias (ignoring the sign - a positive offset from GMT is - * always stored as a negative Bias). If the Bias is -120, - * then the LastWriteTime will be ahead by 120 minutes. - * - * These bugs can occur at the same time. - */ + BOOL dst; /* Will be TRUE if observing DST */ + LONG dstBias; /* Offset from local time if observing DST */ + LONG bias; /* Offset from GMT for local time */ - GetTimeZoneInfo(&dst, &dstBias, &bias); - - /* First adjust for DST */ - if (dst) - *pLastWriteTime -= (-dstBias * 60); /* Convert dstBias to seconds */ - - /* Now adjust for a positive offset from GMT (a negative bias). */ - if (bias < 0) - *pLastWriteTime -= (-bias * 60); /* Convert bias to seconds */ -} + /* + * This function will adjust the last write time to compensate + * for two bugs in the smb client: + * + * 1) During Daylight Savings Time, the LastWriteTime is ahead + * in time by the DaylightBias (ignoring the sign - the + * DaylightBias is always stored as a negative number). If + * the DaylightBias is -60, then the LastWriteTime will be + * ahead by 60 minutes. + * + * 2) If the local time zone is a positive offset from GMT, then + * the LastWriteTime will be the correct local time plus the + * Bias (ignoring the sign - a positive offset from GMT is + * always stored as a negative Bias). If the Bias is -120, + * then the LastWriteTime will be ahead by 120 minutes. + * + * These bugs can occur at the same time. + */ + + GetTimeZoneInfo(&dst, &dstBias, &bias); + + /* First adjust for DST */ + if (dst) + *pLastWriteTime -= (-dstBias * 60); /* Convert dstBias to seconds */ + + /* Now adjust for a positive offset from GMT (a negative bias). */ + if (bias < 0) + *pLastWriteTime -= (-bias * 60); /* Convert bias to seconds */ +} /* * Calculate the difference (in seconds) between local time and GMT. @@ -493,7 +533,14 @@ smb_CalculateNowTZ() local_tm = *(localtime(&t)); days = local_tm.tm_yday - gmt_tm.tm_yday; - hours = 24 * days + local_tm.tm_hour - gmt_tm.tm_hour; + hours = 24 * days + local_tm.tm_hour - gmt_tm.tm_hour +#ifdef COMMENT + /* There is a problem with DST immediately after the time change + * which may continue to exist until the machine is rebooted + */ + - (local_tm.tm_isdst ? 1 : 0) +#endif /* COMMENT */ + ; minutes = 60 * hours + local_tm.tm_min - gmt_tm.tm_min; seconds = 60 * minutes + local_tm.tm_sec - gmt_tm.tm_sec; @@ -543,22 +590,22 @@ void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, long unixTime) #else /* DJGPP */ void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, long unixTime) { - /* unixTime: seconds since 1/1/1970 00:00:00 GMT */ - /* FILETIME: 100ns intervals since 1/1/1601 00:00:00 ??? */ - LARGE_INTEGER *ft = (LARGE_INTEGER *) largeTimep; - LARGE_INTEGER ut; - int leap_years = 89; /* leap years betw 1/1/1601 and 1/1/1970 */ - - /* set ft to number of 100ns intervals betw 1/1/1601 and 1/1/1970 GMT */ - *ft = ConvertLongToLargeInteger(((EPOCH_YEAR-1601) * 365 + leap_years) + /* unixTime: seconds since 1/1/1970 00:00:00 GMT */ + /* FILETIME: 100ns intervals since 1/1/1601 00:00:00 ??? */ + LARGE_INTEGER *ft = (LARGE_INTEGER *) largeTimep; + LARGE_INTEGER ut; + int leap_years = 89; /* leap years betw 1/1/1601 and 1/1/1970 */ + + /* set ft to number of 100ns intervals betw 1/1/1601 and 1/1/1970 GMT */ + *ft = ConvertLongToLargeInteger(((EPOCH_YEAR-1601) * 365 + leap_years) * 24 * 60); - *ft = LargeIntegerMultiplyByLong(*ft, 60); - *ft = LargeIntegerMultiplyByLong(*ft, 10000000); + *ft = LargeIntegerMultiplyByLong(*ft, 60); + *ft = LargeIntegerMultiplyByLong(*ft, 10000000); - /* add unix time */ - ut = ConvertLongToLargeInteger(unixTime); - ut = LargeIntegerMultiplyByLong(ut, 10000000); - *ft = LargeIntegerAdd(*ft, ut); + /* add unix time */ + ut = ConvertLongToLargeInteger(unixTime); + ut = LargeIntegerMultiplyByLong(ut, 10000000); + *ft = LargeIntegerAdd(*ft, ut); } #endif /* !DJGPP */ @@ -588,69 +635,68 @@ void smb_UnixTimeFromLargeSearchTime(long *unixTimep, FILETIME *largeTimep) #else /* DJGPP */ void smb_UnixTimeFromLargeSearchTime(long *unixTimep, FILETIME *largeTimep) { - /* unixTime: seconds since 1/1/1970 00:00:00 GMT */ - /* FILETIME: 100ns intervals since 1/1/1601 00:00:00 GMT? */ - LARGE_INTEGER *ft = (LARGE_INTEGER *) largeTimep; - LARGE_INTEGER a; - int leap_years = 89; - - /* set to number of 100ns intervals betw 1/1/1601 and 1/1/1970 */ - a = ConvertLongToLargeInteger(((EPOCH_YEAR-1601) * 365 + leap_years) * 24 * 60 -); - a = LargeIntegerMultiplyByLong(a, 60); - a = LargeIntegerMultiplyByLong(a, 10000000); - - /* subtract it from ft */ - a = LargeIntegerSubtract(*ft, a); - - /* divide down to seconds */ - *unixTimep = LargeIntegerDivideByLong(a, 10000000); + /* unixTime: seconds since 1/1/1970 00:00:00 GMT */ + /* FILETIME: 100ns intervals since 1/1/1601 00:00:00 GMT? */ + LARGE_INTEGER *ft = (LARGE_INTEGER *) largeTimep; + LARGE_INTEGER a; + int leap_years = 89; + + /* set to number of 100ns intervals betw 1/1/1601 and 1/1/1970 */ + a = ConvertLongToLargeInteger(((EPOCH_YEAR-1601) * 365 + leap_years) * 24 * 60); + a = LargeIntegerMultiplyByLong(a, 60); + a = LargeIntegerMultiplyByLong(a, 10000000); + + /* subtract it from ft */ + a = LargeIntegerSubtract(*ft, a); + + /* divide down to seconds */ + *unixTimep = LargeIntegerDivideByLong(a, 10000000); } #endif /* !DJGPP */ void smb_SearchTimeFromUnixTime(long *dosTimep, long unixTime) { struct tm *ltp; - int dosDate; - int dosTime; - struct tm localJunk; + int dosDate; + int dosTime; + struct tm localJunk; ltp = localtime((time_t*) &unixTime); /* if we fail, make up something */ - if (!ltp) { + if (!ltp) { ltp = &localJunk; - localJunk.tm_year = 89 - 20; - localJunk.tm_mon = 4; - localJunk.tm_mday = 12; - localJunk.tm_hour = 0; - localJunk.tm_min = 0; - localJunk.tm_sec = 0; - } + localJunk.tm_year = 89 - 20; + localJunk.tm_mon = 4; + localJunk.tm_mday = 12; + localJunk.tm_hour = 0; + localJunk.tm_min = 0; + localJunk.tm_sec = 0; + } dosDate = ((ltp->tm_year-80)<<9) | ((ltp->tm_mon+1) << 5) | (ltp->tm_mday); - dosTime = (ltp->tm_hour<<11) | (ltp->tm_min << 5) | (ltp->tm_sec / 2); - *dosTimep = (dosDate<<16) | dosTime; -} + dosTime = (ltp->tm_hour<<11) | (ltp->tm_min << 5) | (ltp->tm_sec / 2); + *dosTimep = (dosDate<<16) | dosTime; +} void smb_UnixTimeFromSearchTime(long *unixTimep, long searchTime) { unsigned short dosDate; - unsigned short dosTime; + unsigned short dosTime; struct tm localTm; - dosDate = searchTime & 0xffff; - dosTime = (searchTime >> 16) & 0xffff; + dosDate = searchTime & 0xffff; + dosTime = (searchTime >> 16) & 0xffff; - localTm.tm_year = 80 + ((dosDate>>9) & 0x3f); - localTm.tm_mon = ((dosDate >> 5) & 0xf) - 1; /* January is 0 in localTm */ - localTm.tm_mday = (dosDate) & 0x1f; - localTm.tm_hour = (dosTime>>11) & 0x1f; - localTm.tm_min = (dosTime >> 5) & 0x3f; - localTm.tm_sec = (dosTime & 0x1f) * 2; - localTm.tm_isdst = -1; /* compute whether DST in effect */ - - *unixTimep = mktime(&localTm); + localTm.tm_year = 80 + ((dosDate>>9) & 0x3f); + localTm.tm_mon = ((dosDate >> 5) & 0xf) - 1; /* January is 0 in localTm */ + localTm.tm_mday = (dosDate) & 0x1f; + localTm.tm_hour = (dosTime>>11) & 0x1f; + localTm.tm_min = (dosTime >> 5) & 0x3f; + localTm.tm_sec = (dosTime & 0x1f) * 2; + localTm.tm_isdst = -1; /* compute whether DST in effect */ + + *unixTimep = mktime(&localTm); } void smb_DosUTimeFromUnixTime(long *dosUTimep, long unixTime) @@ -663,7 +709,7 @@ void smb_UnixTimeFromDosUTime(long *unixTimep, long dosTime) #ifndef DJGPP *unixTimep = dosTime + smb_localZero; #else /* DJGPP */ - /* dosTime seems to be already adjusted for GMT */ + /* dosTime seems to be already adjusted for GMT */ *unixTimep = dosTime; #endif /* !DJGPP */ } @@ -676,36 +722,36 @@ smb_vc_t *smb_FindVC(unsigned short lsn, int flags, int lana) for(vcp = smb_allVCsp; vcp; vcp=vcp->nextp) { if (lsn == vcp->lsn && lana == vcp->lana) { vcp->refCount++; - break; + break; } - } - if (!vcp && (flags & SMB_FLAG_CREATE)) { + } + if (!vcp && (flags & SMB_FLAG_CREATE)) { vcp = malloc(sizeof(*vcp)); - memset(vcp, 0, sizeof(*vcp)); - vcp->refCount = 1; - vcp->tidCounter = 1; - vcp->fidCounter = 1; - vcp->uidCounter = 1; /* UID 0 is reserved for blank user */ - vcp->nextp = smb_allVCsp; - smb_allVCsp = vcp; - lock_InitializeMutex(&vcp->mx, "vc_t mutex"); - vcp->lsn = lsn; - vcp->lana = lana; - } - lock_ReleaseWrite(&smb_rctLock); - return vcp; + memset(vcp, 0, sizeof(*vcp)); + vcp->refCount = 1; + vcp->tidCounter = 1; + vcp->fidCounter = 1; + vcp->uidCounter = 1; /* UID 0 is reserved for blank user */ + vcp->nextp = smb_allVCsp; + smb_allVCsp = vcp; + lock_InitializeMutex(&vcp->mx, "vc_t mutex"); + vcp->lsn = lsn; + vcp->lana = lana; + } + lock_ReleaseWrite(&smb_rctLock); + return vcp; } int smb_IsStarMask(char *maskp) { int i; - char tc; + char tc; for(i=0; i<11; i++) { tc = *maskp++; - if (tc == '?' || tc == '*' || tc == '>') return 1; - } - return 0; + if (tc == '?' || tc == '*' || tc == '>') return 1; + } + return 0; } void smb_ReleaseVC(smb_vc_t *vcp) @@ -730,47 +776,54 @@ smb_tid_t *smb_FindTID(smb_vc_t *vcp, unsigned short tid, int flags) for(tidp = vcp->tidsp; tidp; tidp = tidp->nextp) { if (tid == tidp->tid) { tidp->refCount++; - break; - } - } - if (!tidp && (flags & SMB_FLAG_CREATE)) { + break; + } + } + if (!tidp && (flags & SMB_FLAG_CREATE)) { tidp = malloc(sizeof(*tidp)); - memset(tidp, 0, sizeof(*tidp)); - tidp->nextp = vcp->tidsp; - tidp->refCount = 1; - tidp->vcp = vcp; - vcp->tidsp = tidp; - lock_InitializeMutex(&tidp->mx, "tid_t mutex"); - tidp->tid = tid; - } - lock_ReleaseWrite(&smb_rctLock); - return tidp; -} + memset(tidp, 0, sizeof(*tidp)); + tidp->nextp = vcp->tidsp; + tidp->refCount = 1; + tidp->vcp = vcp; + vcp->refCount++; + vcp->tidsp = tidp; + lock_InitializeMutex(&tidp->mx, "tid_t mutex"); + tidp->tid = tid; + } + lock_ReleaseWrite(&smb_rctLock); + return tidp; +} void smb_ReleaseTID(smb_tid_t *tidp) { smb_tid_t *tp; - smb_tid_t **ltpp; - cm_user_t *userp; + smb_tid_t **ltpp; + cm_user_t *userp; + smb_vc_t *vcp; userp = NULL; + vcp = NULL; lock_ObtainWrite(&smb_rctLock); osi_assert(tidp->refCount-- > 0); - if (tidp->refCount == 0 && (tidp->flags & SMB_TIDFLAG_DELETE)) { + if (tidp->refCount == 0 && (tidp->flags & SMB_TIDFLAG_DELETE)) { ltpp = &tidp->vcp->tidsp; for(tp = *ltpp; tp; ltpp = &tp->nextp, tp = *ltpp) { if (tp == tidp) break; - } - osi_assert(tp != NULL); - *ltpp = tp->nextp; - lock_FinalizeMutex(&tidp->mx); - userp = tidp->userp; /* remember to drop ref later */ - } - lock_ReleaseWrite(&smb_rctLock); - if (userp) { - cm_ReleaseUser(userp); + } + osi_assert(tp != NULL); + *ltpp = tp->nextp; + lock_FinalizeMutex(&tidp->mx); + userp = tidp->userp; /* remember to drop ref later */ + vcp = tidp->vcp; } -} + lock_ReleaseWrite(&smb_rctLock); + if (userp) { + cm_ReleaseUser(userp); + } + if (vcp) { + smb_ReleaseVC(vcp); + } +} smb_user_t *smb_FindUID(smb_vc_t *vcp, unsigned short uid, int flags) { @@ -780,24 +833,25 @@ smb_user_t *smb_FindUID(smb_vc_t *vcp, unsigned short uid, int flags) for(uidp = vcp->usersp; uidp; uidp = uidp->nextp) { if (uid == uidp->userID) { uidp->refCount++; - osi_LogEvent("AFS smb_FindUID (Find by UID)",NULL," VCP[%x] found-uid[%d] name[%s]",vcp,uidp->userID,(uidp->unp) ? uidp->unp->name : ""); + osi_LogEvent("AFS smb_FindUID (Find by UID)",NULL," VCP[%x] found-uid[%d] name[%s]",(int)vcp,uidp->userID,(uidp->unp) ? uidp->unp->name : ""); break; } - } - if (!uidp && (flags & SMB_FLAG_CREATE)) { + } + if (!uidp && (flags & SMB_FLAG_CREATE)) { uidp = malloc(sizeof(*uidp)); - memset(uidp, 0, sizeof(*uidp)); - uidp->nextp = vcp->usersp; - uidp->refCount = 1; - uidp->vcp = vcp; - vcp->usersp = uidp; - lock_InitializeMutex(&uidp->mx, "uid_t mutex"); - uidp->userID = uid; - osi_LogEvent("AFS smb_FindUID (Find by UID)",NULL,"VCP[%x] new-uid[%d] name[%s]",vcp,uidp->userID,(uidp->unp ? uidp->unp->name : "")); - } - lock_ReleaseWrite(&smb_rctLock); - return uidp; -} + memset(uidp, 0, sizeof(*uidp)); + uidp->nextp = vcp->usersp; + uidp->refCount = 1; + uidp->vcp = vcp; + vcp->refCount++; + vcp->usersp = uidp; + lock_InitializeMutex(&uidp->mx, "uid_t mutex"); + uidp->userID = uid; + osi_LogEvent("AFS smb_FindUID (Find by UID)",NULL,"VCP[%x] new-uid[%d] name[%s]",(int)vcp,uidp->userID,(uidp->unp ? uidp->unp->name : "")); + } + lock_ReleaseWrite(&smb_rctLock); + return uidp; +} smb_username_t *smb_FindUserByName(char *usern, char *machine, int flags) { @@ -806,23 +860,24 @@ smb_username_t *smb_FindUserByName(char *usern, char *machine, int flags) lock_ObtainWrite(&smb_rctLock); for(unp = usernamesp; unp; unp = unp->nextp) { if (stricmp(unp->name, usern) == 0 && - stricmp(unp->machine, machine) == 0) { + stricmp(unp->machine, machine) == 0) { unp->refCount++; break; } } - if (!unp && (flags & SMB_FLAG_CREATE)) { - unp = malloc(sizeof(*unp)); - memset(unp, 0, sizeof(*unp)); - unp->nextp = usernamesp; - unp->name = strdup(usern); - unp->machine = strdup(machine); - usernamesp = unp; - lock_InitializeMutex(&unp->mx, "username_t mutex"); - } + if (!unp && (flags & SMB_FLAG_CREATE)) { + unp = malloc(sizeof(*unp)); + memset(unp, 0, sizeof(*unp)); + unp->refCount = 1; + unp->nextp = usernamesp; + unp->name = strdup(usern); + unp->machine = strdup(machine); + usernamesp = unp; + lock_InitializeMutex(&unp->mx, "username_t mutex"); + } lock_ReleaseWrite(&smb_rctLock); return unp; -} +} smb_user_t *smb_FindUserByNameThisSession(smb_vc_t *vcp, char *usern) { @@ -830,44 +885,53 @@ smb_user_t *smb_FindUserByNameThisSession(smb_vc_t *vcp, char *usern) lock_ObtainWrite(&smb_rctLock); for(uidp = vcp->usersp; uidp; uidp = uidp->nextp) { - if (!uidp->unp) + if (!uidp->unp) continue; - if (stricmp(uidp->unp->name, usern) == 0) { + if (stricmp(uidp->unp->name, usern) == 0) { uidp->refCount++; - osi_LogEvent("AFS smb_FindUserByNameThisSession",NULL,"VCP[%x] uid[%d] match-name[%s]",vcp,uidp->userID,usern); + osi_LogEvent("AFS smb_FindUserByNameThisSession",NULL,"VCP[%x] uid[%d] match-name[%s]",(int)vcp,uidp->userID,usern); break; - } else + } else continue; - } + } lock_ReleaseWrite(&smb_rctLock); return uidp; } void smb_ReleaseUID(smb_user_t *uidp) { smb_user_t *up; - smb_user_t **lupp; - cm_user_t *userp; + smb_user_t **lupp; + cm_user_t *userp; + smb_vc_t *vcp; userp = NULL; + vcp = NULL; lock_ObtainWrite(&smb_rctLock); osi_assert(uidp->refCount-- > 0); - if (uidp->refCount == 0 && (uidp->flags & SMB_USERFLAG_DELETE)) { + if (uidp->refCount == 0 && (uidp->flags & SMB_USERFLAG_DELETE)) { lupp = &uidp->vcp->usersp; for(up = *lupp; up; lupp = &up->nextp, up = *lupp) { if (up == uidp) break; - } - osi_assert(up != NULL); - *lupp = up->nextp; - lock_FinalizeMutex(&uidp->mx); - if (uidp->unp) - userp = uidp->unp->userp; /* remember to drop ref later */ + } + osi_assert(up != NULL); + *lupp = up->nextp; + lock_FinalizeMutex(&uidp->mx); + if (uidp->unp) { + userp = uidp->unp->userp; /* remember to drop ref later */ + uidp->unp->userp = NULL; } + vcp = uidp->vcp; + uidp->vcp = NULL; + } lock_ReleaseWrite(&smb_rctLock); - if (userp) { + if (userp) { cm_ReleaseUserVCRef(userp); - cm_ReleaseUser(userp); - } -} + cm_ReleaseUser(userp); + } + if (vcp) { + smb_ReleaseVC(vcp); + } +} /* retrieve a held reference to a user structure corresponding to an incoming * request. @@ -876,22 +940,22 @@ void smb_ReleaseUID(smb_user_t *uidp) cm_user_t *smb_GetUser(smb_vc_t *vcp, smb_packet_t *inp) { smb_user_t *uidp; - cm_user_t *up; - smb_t *smbp; - + cm_user_t *up; + smb_t *smbp; + smbp = (smb_t *) inp; - uidp = smb_FindUID(vcp, smbp->uid, 0); - if ((!uidp) || (!uidp->unp)) - return NULL; + uidp = smb_FindUID(vcp, smbp->uid, 0); + if ((!uidp) || (!uidp->unp)) + return NULL; lock_ObtainMutex(&uidp->mx); - up = uidp->unp->userp; - cm_HoldUser(up); + up = uidp->unp->userp; + cm_HoldUser(up); lock_ReleaseMutex(&uidp->mx); - smb_ReleaseUID(uidp); + smb_ReleaseUID(uidp); - return up; + return up; } /* @@ -904,6 +968,8 @@ char *smb_GetTIDPath(smb_vc_t *vcp, unsigned short tid) char *tpath; tidp = smb_FindTID(vcp, tid, 0); + if (!tidp) + return NULL; tpath = tidp->pathname; smb_ReleaseTID(tidp); return tpath; @@ -916,8 +982,10 @@ char *smb_GetTIDPath(smb_vc_t *vcp, unsigned short tid) */ int smb_ChainFID(int fid, smb_packet_t *inp) { - if (inp->fid == 0 || inp->inCount == 0) return fid; - else return inp->fid; + if (inp->fid == 0 || inp->inCount == 0) + return fid; + else + return inp->fid; } /* are we a priv'd user? What does this mean on NT? */ @@ -926,61 +994,85 @@ int smb_SUser(cm_user_t *userp) return 1; } -/* find a file ID. If pass in 0, we'll allocate on on a create operation. */ +/* find a file ID. If we pass in 0 we select an used File ID. + * If the SMB_FLAG_CREATE flag is set, we allocate a new + * smb_fid_t data structure if desired File ID cannot be found. + */ smb_fid_t *smb_FindFID(smb_vc_t *vcp, unsigned short fid, int flags) { smb_fid_t *fidp; - int newFid; + int newFid = 0; + if (fid == 0 && !(flags & SMB_FLAG_CREATE)) + return NULL; + + lock_ObtainWrite(&smb_rctLock); /* figure out if we need to allocate a new file ID */ - if (fid == 0) { - newFid = 1; - fid = vcp->fidCounter; + if (fid == 0) { + newFid = 1; + fid = vcp->fidCounter; } - else newFid = 0; - lock_ObtainWrite(&smb_rctLock); retry: for(fidp = vcp->fidsp; fidp; fidp = (smb_fid_t *) osi_QNext(&fidp->q)) { if (fid == fidp->fid) { if (newFid) { fid++; - if (fid == 0) fid = 1; - goto retry; - } + if (fid == 0) + fid = 1; + goto retry; + } fidp->refCount++; - break; + break; } + } + if (!fidp && (flags & SMB_FLAG_CREATE)) { + char eventName[MAX_PATH]; + EVENT_HANDLE event; + sprintf(eventName,"fid_t event vcp=%d fid=%d", vcp->vcID, fid); + event = thrd_CreateEvent(NULL, FALSE, TRUE, eventName); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) { + afsi_log("Event Object Already Exists: %s", eventName); + thrd_CloseHandle(event); + fid++; + if (fid == 0) + fid = 1; + goto retry; } - if (!fidp && (flags & SMB_FLAG_CREATE)) { + fidp = malloc(sizeof(*fidp)); - memset(fidp, 0, sizeof(*fidp)); + memset(fidp, 0, sizeof(*fidp)); osi_QAdd((osi_queue_t **)&vcp->fidsp, &fidp->q); - fidp->refCount = 1; - fidp->vcp = vcp; - lock_InitializeMutex(&fidp->mx, "fid_t mutex"); - fidp->fid = fid; + fidp->refCount = 1; + fidp->vcp = vcp; + vcp->refCount++; + lock_InitializeMutex(&fidp->mx, "fid_t mutex"); + fidp->fid = fid; fidp->curr_chunk = fidp->prev_chunk = -2; - fidp->raw_write_event = thrd_CreateEvent(NULL, FALSE, TRUE, NULL); - if (newFid) { - vcp->fidCounter = fid+1; - if (vcp->fidCounter == 0) vcp->fidCounter = 1; - } + fidp->raw_write_event = event; + if (newFid) { + vcp->fidCounter = fid+1; + if (vcp->fidCounter == 0) + vcp->fidCounter = 1; } - lock_ReleaseWrite(&smb_rctLock); - return fidp; + } + lock_ReleaseWrite(&smb_rctLock); + return fidp; } void smb_ReleaseFID(smb_fid_t *fidp) { cm_scache_t *scp; - smb_vc_t *vcp; - smb_ioctl_t *ioctlp; + smb_vc_t *vcp = NULL; + smb_ioctl_t *ioctlp; + + if (!fidp) + return; scp = NULL; lock_ObtainWrite(&smb_rctLock); osi_assert(fidp->refCount-- > 0); - if (fidp->refCount == 0 && (fidp->flags & SMB_FID_DELETE)) { + if (fidp->refCount == 0 && (fidp->flags & SMB_FID_DELETE)) { vcp = fidp->vcp; if (!(fidp->flags & SMB_FID_IOCTL)) scp = fidp->scp; @@ -988,20 +1080,24 @@ void smb_ReleaseFID(smb_fid_t *fidp) thrd_CloseHandle(fidp->raw_write_event); /* and see if there is ioctl stuff to free */ - ioctlp = fidp->ioctlp; - if (ioctlp) { + ioctlp = fidp->ioctlp; + if (ioctlp) { if (ioctlp->prefix) cm_FreeSpace(ioctlp->prefix); if (ioctlp->inAllocp) free(ioctlp->inAllocp); if (ioctlp->outAllocp) free(ioctlp->outAllocp); free(ioctlp); - } - - free(fidp); } + + free(fidp); + + /* do not call smb_ReleaseVC() because we already have the lock */ + vcp->refCount--; + } lock_ReleaseWrite(&smb_rctLock); /* now release the scache structure */ - if (scp) cm_ReleaseSCache(scp); + if (scp) + cm_ReleaseSCache(scp); } /* @@ -1042,64 +1138,65 @@ char VNLCComputerName[] = "%LCCOMPUTERNAME%"; /* List available shares */ int smb_ListShares() { - char sbmtpath[256]; - char pathName[256]; - char shareBuf[4096]; - int num_shares=0; - char *this_share; - int len; - char *p; - int print_afs = 0; - int code; - - /*strcpy(shareNameList[num_shares], "all"); - strcpy(pathNameList[num_shares++], "/afs");*/ - fprintf(stderr, "The following shares are available:\n"); - fprintf(stderr, "Share Name (AFS Path)\n"); - fprintf(stderr, "---------------------\n"); - fprintf(stderr, "\\\\%s\\%-16s (/afs)\n", smb_localNamep, "ALL"); + char sbmtpath[256]; + char pathName[256]; + char shareBuf[4096]; + int num_shares=0; + char *this_share; + int len; + char *p; + int print_afs = 0; + int code; + + /*strcpy(shareNameList[num_shares], "all"); + strcpy(pathNameList[num_shares++], "/afs");*/ + fprintf(stderr, "The following shares are available:\n"); + fprintf(stderr, "Share Name (AFS Path)\n"); + fprintf(stderr, "---------------------\n"); + fprintf(stderr, "\\\\%s\\%-16s (%s)\n", smb_localNamep, "ALL", cm_mountRoot); #ifndef DJGPP code = GetWindowsDirectory(sbmtpath, sizeof(sbmtpath)); - if (code == 0 || code > sizeof(sbmtpath)) return -1; + if (code == 0 || code > sizeof(sbmtpath)) return -1; #else - strcpy(sbmtpath, cm_confDir); + strcpy(sbmtpath, cm_confDir); #endif /* !DJGPP */ - strcat(sbmtpath, "/afsdsbmt.ini"); - len = GetPrivateProfileString("AFS Submounts", NULL, NULL, - shareBuf, sizeof(shareBuf), - sbmtpath); - if (len == 0) { - return num_shares; - } + strcat(sbmtpath, "/afsdsbmt.ini"); + len = GetPrivateProfileString("AFS Submounts", NULL, NULL, + shareBuf, sizeof(shareBuf), + sbmtpath); + if (len == 0) { + return num_shares; + } - this_share = shareBuf; - do - { - print_afs = 0; - /*strcpy(shareNameList[num_shares], this_share);*/ - len = GetPrivateProfileString("AFS Submounts", this_share, - NULL, - pathName, 256, - sbmtpath); - if (!len) return num_shares; - p = pathName; - if (strncmp(p, "/afs", 4) != 0) + this_share = shareBuf; + do + { + print_afs = 0; + /*strcpy(shareNameList[num_shares], this_share);*/ + len = GetPrivateProfileString("AFS Submounts", this_share, + NULL, + pathName, 256, + sbmtpath); + if (!len) + return num_shares; + p = pathName; + if (strncmp(p, cm_mountRoot, strlen(cm_mountRoot)) != 0) print_afs = 1; - while (*p) { + while (*p) { if (*p == '\\') *p = '/'; /* change to / */ p++; - } + } - fprintf(stderr, "\\\\%s\\%-16s (%s%s)\n", - smb_localNamep, this_share, (print_afs ? "/afs" : "\0"), - pathName); - num_shares++; - while (*this_share != NULL) this_share++; /* find next NULL */ - this_share++; /* skip past the NULL */ - } while (*this_share != NULL); /* stop at final NULL */ + fprintf(stderr, "\\\\%s\\%-16s (%s%s)\n", + smb_localNamep, this_share, (print_afs ? cm_mountRoot : "\0"), + pathName); + num_shares++; + while (*this_share != 0) this_share++; /* find next NUL */ + this_share++; /* skip past the NUL */ + } while (*this_share != 0); /* stop at final NUL */ - return num_shares; + return num_shares; } /* find a shareName in the table of submounts */ @@ -1112,82 +1209,179 @@ int smb_FindShare(smb_vc_t *vcp, smb_packet_t *inp, char *shareName, smb_user_t *uidp; char temp[1024]; DWORD sizeTemp; - char sbmtpath[256]; - char *p, *q; + char sbmtpath[MAX_PATH]; + char *p, *q; + HKEY parmKey; + DWORD code; + DWORD allSubmount = 1; if (strcmp(shareName, "IPC$") == 0) { *pathNamep = NULL; return 0; } - if (_stricmp(shareName, "all") == 0) { + /* if allSubmounts == 0, only return the //mountRoot/all share + * if in fact it has been been created in the subMounts table. + * This is to allow sites that want to restrict access to the + * world to do so. + */ + code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSConfigKeyName, + 0, KEY_QUERY_VALUE, &parmKey); + if (code == ERROR_SUCCESS) { + len = sizeof(allSubmount); + code = RegQueryValueEx(parmKey, "AllSubmount", NULL, NULL, + (BYTE *) &allSubmount, &len); + if (code != ERROR_SUCCESS) { + allSubmount = 1; + } + RegCloseKey (parmKey); + } + + if (allSubmount && _stricmp(shareName, "all") == 0) { *pathNamep = NULL; return 1; } + /* In case, the all share is disabled we need to still be able + * to handle ioctl requests + */ + if (_stricmp(shareName, "ioctl$") == 0) { + *pathNamep = strdup("/.__ioctl__"); + return 1; + } + #ifndef DJGPP - strcpy(sbmtpath, "afsdsbmt.ini"); + strcpy(sbmtpath, "afsdsbmt.ini"); #else /* DJGPP */ - strcpy(sbmtpath, cm_confDir); - strcat(sbmtpath, "/afsdsbmt.ini"); + strcpy(sbmtpath, cm_confDir); + strcat(sbmtpath, "/afsdsbmt.ini"); #endif /* !DJGPP */ len = GetPrivateProfileString("AFS Submounts", shareName, "", - pathName, sizeof(pathName), sbmtpath); - if (len == 0 || len == sizeof(pathName) - 1) { - *pathNamep = NULL; - return 0; - } - + pathName, sizeof(pathName), sbmtpath); + if (len != 0 && len != sizeof(pathName) - 1) { /* We can accept either unix or PC style AFS pathnames. Convert - Unix-style to PC style here for internal use. */ + * Unix-style to PC style here for internal use. + */ p = pathName; - if (strncmp(p, "/afs", 4) == 0) - p += 4; /* skip /afs */ + if (strncmp(p, cm_mountRoot, strlen(cm_mountRoot)) == 0) + p += strlen(cm_mountRoot); /* skip mount path */ q = p; while (*q) { - if (*q == '/') *q = '\\'; /* change to \ */ - q++; + if (*q == '/') *q = '\\'; /* change to \ */ + q++; } - while (1) - { - if (var = smb_stristr(p, VNUserName)) { - uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0); - if (uidp && uidp->unp) - smb_subst(p, var, sizeof(VNUserName), - uidp->unp->name); - else - smb_subst(p, var, sizeof(VNUserName), - " "); - smb_ReleaseUID(uidp); - } - else if (var = smb_stristr(p, VNLCUserName)) { - uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0); - if (uidp && uidp->unp) - strcpy(temp, uidp->unp->name); - else strcpy(temp, " "); - _strlwr(temp); - smb_subst(p, var, sizeof(VNLCUserName), temp); - smb_ReleaseUID(uidp); - } - else if (var = smb_stristr(p, VNComputerName)) { - sizeTemp = sizeof(temp); - GetComputerName((LPTSTR)temp, &sizeTemp); - smb_subst(p, var, sizeof(VNComputerName), - temp); - } - else if (var = smb_stristr(p, VNLCComputerName)) { - sizeTemp = sizeof(temp); - GetComputerName((LPTSTR)temp, &sizeTemp); - _strlwr(temp); - smb_subst(p, var, sizeof(VNLCComputerName), - temp); - } - else break; + while (1) + { + if (var = smb_stristr(p, VNUserName)) { + uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0); + if (uidp && uidp->unp) + smb_subst(p, var, sizeof(VNUserName),uidp->unp->name); + else + smb_subst(p, var, sizeof(VNUserName)," "); + if (uidp) + smb_ReleaseUID(uidp); + } + else if (var = smb_stristr(p, VNLCUserName)) + { + uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0); + if (uidp && uidp->unp) + strcpy(temp, uidp->unp->name); + else + strcpy(temp, " "); + _strlwr(temp); + smb_subst(p, var, sizeof(VNLCUserName), temp); + if (uidp) + smb_ReleaseUID(uidp); + } + else if (var = smb_stristr(p, VNComputerName)) + { + sizeTemp = sizeof(temp); + GetComputerName((LPTSTR)temp, &sizeTemp); + smb_subst(p, var, sizeof(VNComputerName), temp); + } + else if (var = smb_stristr(p, VNLCComputerName)) + { + sizeTemp = sizeof(temp); + GetComputerName((LPTSTR)temp, &sizeTemp); + _strlwr(temp); + smb_subst(p, var, sizeof(VNLCComputerName), temp); + } + else + break; + } + *pathNamep = strdup(p); + return 1; + } + else /* create \\\ */ + { + char * p = shareName; + int rw = 0; + + if ( *p == '.' ) { + p++; + rw = 1; + } + /* Get the full name for this cell */ + code = cm_SearchCellFile(p, temp, 0, 0); +#ifdef AFS_AFSDB_ENV + if (code && cm_dnsEnabled) { + int ttl; + code = cm_SearchCellByDNS(p, temp, &ttl, 0, 0); + } +#endif + /* construct the path */ + if (code == 0) { + sprintf(pathName,rw ? "/.%s/" : "/%s/",temp); + *pathNamep = strdup(strlwr(pathName)); + return 1; + } } + /* failure */ + *pathNamep = NULL; + return 0; +} - *pathNamep = strdup(p); - return 1; +/* Client-side offline caching policy types */ +#define CSC_POLICY_MANUAL 0 +#define CSC_POLICY_DOCUMENTS 1 +#define CSC_POLICY_PROGRAMS 2 +#define CSC_POLICY_DISABLE 3 + +int smb_FindShareCSCPolicy(char *shareName) +{ + DWORD len; + char policy[1024]; + char sbmtpath[256]; + +#ifndef DJGPP + strcpy(sbmtpath, "afsdsbmt.ini"); +#else /* DJGPP */ + strcpy(sbmtpath, cm_confDir); + strcat(sbmtpath, "/afsdsbmt.ini"); +#endif /* !DJGPP */ + len = GetPrivateProfileString("CSC Policy", shareName, "", + policy, sizeof(policy), sbmtpath); + if (len == 0 || len == sizeof(policy) - 1) { + return CSC_POLICY_MANUAL; + } + + if (stricmp(policy, "documents") == 0) + { + return CSC_POLICY_DOCUMENTS; + } + + if (stricmp(policy, "programs") == 0) + { + return CSC_POLICY_PROGRAMS; + } + + if (stricmp(policy, "disable") == 0) + { + return CSC_POLICY_DISABLE; + } + + return CSC_POLICY_MANUAL; } /* find a dir search structure by cookie value, and return it held. @@ -1197,22 +1391,22 @@ smb_dirSearch_t *smb_FindDirSearchNL(long cookie) { smb_dirSearch_t *dsp; - for(dsp = smb_firstDirSearchp; dsp; dsp = (smb_dirSearch_t *) osi_QNext(&dsp->q)) { + for(dsp = smb_firstDirSearchp; dsp; dsp = (smb_dirSearch_t *) osi_QNext(&dsp->q)) { if (dsp->cookie == cookie) { if (dsp != smb_firstDirSearchp) { /* move to head of LRU queue, too, if we're not already there */ - if (smb_lastDirSearchp == (smb_dirSearch_t *) &dsp->q) - smb_lastDirSearchp = (smb_dirSearch_t *) - osi_QPrev(&dsp->q); + if (smb_lastDirSearchp == (smb_dirSearch_t *) &dsp->q) + smb_lastDirSearchp = (smb_dirSearch_t *) + osi_QPrev(&dsp->q); osi_QRemove((osi_queue_t **) &smb_firstDirSearchp, &dsp->q); - osi_QAdd((osi_queue_t **) &smb_firstDirSearchp, &dsp->q); - if (!smb_lastDirSearchp) - smb_lastDirSearchp = (smb_dirSearch_t *) &dsp->q; + osi_QAdd((osi_queue_t **) &smb_firstDirSearchp, &dsp->q); + if (!smb_lastDirSearchp) + smb_lastDirSearchp = (smb_dirSearch_t *) &dsp->q; } dsp->refCount++; - break; - } - } + break; + } + } return dsp; } @@ -1221,39 +1415,39 @@ void smb_DeleteDirSearch(smb_dirSearch_t *dsp) lock_ObtainWrite(&smb_globalLock); dsp->flags |= SMB_DIRSEARCH_DELETE; lock_ReleaseWrite(&smb_globalLock); - lock_ObtainMutex(&dsp->mx); + lock_ObtainMutex(&dsp->mx); if(dsp->scp != NULL) { - lock_ObtainMutex(&dsp->scp->mx); - if (dsp->flags & SMB_DIRSEARCH_BULKST) { - dsp->flags &= ~SMB_DIRSEARCH_BULKST; + lock_ObtainMutex(&dsp->scp->mx); + if (dsp->flags & SMB_DIRSEARCH_BULKST) { + dsp->flags &= ~SMB_DIRSEARCH_BULKST; dsp->scp->flags &= ~CM_SCACHEFLAG_BULKSTATTING; dsp->scp->bulkStatProgress = hones; - } - lock_ReleaseMutex(&dsp->scp->mx); - } - lock_ReleaseMutex(&dsp->mx); + } + lock_ReleaseMutex(&dsp->scp->mx); + } + lock_ReleaseMutex(&dsp->mx); } void smb_ReleaseDirSearch(smb_dirSearch_t *dsp) { cm_scache_t *scp; - scp = NULL; + scp = NULL; lock_ObtainWrite(&smb_globalLock); osi_assert(dsp->refCount-- > 0); - if (dsp->refCount == 0 && (dsp->flags & SMB_DIRSEARCH_DELETE)) { + if (dsp->refCount == 0 && (dsp->flags & SMB_DIRSEARCH_DELETE)) { if (&dsp->q == (osi_queue_t *) smb_lastDirSearchp) - smb_lastDirSearchp = (smb_dirSearch_t *) osi_QPrev(&smb_lastDirSearchp->q); + smb_lastDirSearchp = (smb_dirSearch_t *) osi_QPrev(&smb_lastDirSearchp->q); osi_QRemove((osi_queue_t **) &smb_firstDirSearchp, &dsp->q); - lock_FinalizeMutex(&dsp->mx); - scp = dsp->scp; - free(dsp); - } + lock_FinalizeMutex(&dsp->mx); + scp = dsp->scp; + free(dsp); + } lock_ReleaseWrite(&smb_globalLock); - + /* do this now to avoid spurious locking hierarchy creation */ - if (scp) cm_ReleaseSCache(scp); + if (scp) cm_ReleaseSCache(scp); } /* find a dir search structure by cookie value, and return it held */ @@ -1264,7 +1458,7 @@ smb_dirSearch_t *smb_FindDirSearch(long cookie) lock_ObtainWrite(&smb_globalLock); dsp = smb_FindDirSearchNL(cookie); lock_ReleaseWrite(&smb_globalLock); - return dsp; + return dsp; } /* GC some dir search entries, in the address space expected by the specific protocol. @@ -1275,36 +1469,37 @@ void smb_GCDirSearches(int isV3) { smb_dirSearch_t *prevp; smb_dirSearch_t *tp; - smb_dirSearch_t *victimsp[SMB_DIRSEARCH_GCMAX]; - int victimCount; - int i; + smb_dirSearch_t *victimsp[SMB_DIRSEARCH_GCMAX]; + int victimCount; + int i; victimCount = 0; /* how many have we got so far */ for(tp = smb_lastDirSearchp; tp; tp=prevp) { - prevp = (smb_dirSearch_t *) osi_QPrev(&tp->q); /* we'll move tp from queue, so - * do this early. - */ + /* we'll move tp from queue, so + * do this early. + */ + prevp = (smb_dirSearch_t *) osi_QPrev(&tp->q); /* if no one is using this guy, and we're either in the new protocol, - * or we're in the old one and this is a small enough ID to be useful - * to the old protocol, GC this guy. - */ + * or we're in the old one and this is a small enough ID to be useful + * to the old protocol, GC this guy. + */ if (tp->refCount == 0 && (isV3 || tp->cookie <= 255)) { /* hold and delete */ tp->flags |= SMB_DIRSEARCH_DELETE; - victimsp[victimCount++] = tp; - tp->refCount++; - } + victimsp[victimCount++] = tp; + tp->refCount++; + } /* don't do more than this */ - if (victimCount >= SMB_DIRSEARCH_GCMAX) break; - } + if (victimCount >= SMB_DIRSEARCH_GCMAX) break; + } /* now release them */ - lock_ReleaseWrite(&smb_globalLock); - for(i = 0; i < victimCount; i++) { + lock_ReleaseWrite(&smb_globalLock); + for(i = 0; i < victimCount; i++) { smb_ReleaseDirSearch(victimsp[i]); - } - lock_ObtainWrite(&smb_globalLock); + } + lock_ObtainWrite(&smb_globalLock); } /* function for allocating a dir search entry. We need these to remember enough context @@ -1317,48 +1512,48 @@ smb_dirSearch_t *smb_NewDirSearch(int isV3) { smb_dirSearch_t *dsp; int counter; - int maxAllowed; + int maxAllowed; lock_ObtainWrite(&smb_globalLock); counter = 0; /* what's the biggest ID allowed in this version of the protocol */ - if (isV3) maxAllowed = 65535; - else maxAllowed = 255; + if (isV3) maxAllowed = 65535; + else maxAllowed = 255; while(1) { /* twice so we have enough tries to find guys we GC after one pass; - * 10 extra is just in case I mis-counted. - */ - if (++counter > 2*maxAllowed+10) osi_panic("afsd: dir search cookie leak", - __FILE__, __LINE__); - if (smb_dirSearchCounter > maxAllowed) { - smb_dirSearchCounter = 1; - smb_GCDirSearches(isV3); /* GC some (drops global lock) */ - } + * 10 extra is just in case I mis-counted. + */ + if (++counter > 2*maxAllowed+10) osi_panic("afsd: dir search cookie leak", + __FILE__, __LINE__); + if (smb_dirSearchCounter > maxAllowed) { + smb_dirSearchCounter = 1; + smb_GCDirSearches(isV3); /* GC some (drops global lock) */ + } dsp = smb_FindDirSearchNL(smb_dirSearchCounter); - if (dsp) { + if (dsp) { /* don't need to watch for refcount zero and deleted, since - * we haven't dropped the global lock. - */ + * we haven't dropped the global lock. + */ dsp->refCount--; - ++smb_dirSearchCounter; - continue; - } + ++smb_dirSearchCounter; + continue; + } - dsp = malloc(sizeof(*dsp)); - memset(dsp, 0, sizeof(*dsp)); - osi_QAdd((osi_queue_t **) &smb_firstDirSearchp, &dsp->q); - if (!smb_lastDirSearchp) smb_lastDirSearchp = (smb_dirSearch_t *) &dsp->q; - dsp->cookie = smb_dirSearchCounter; + dsp = malloc(sizeof(*dsp)); + memset(dsp, 0, sizeof(*dsp)); + osi_QAdd((osi_queue_t **) &smb_firstDirSearchp, &dsp->q); + if (!smb_lastDirSearchp) smb_lastDirSearchp = (smb_dirSearch_t *) &dsp->q; + dsp->cookie = smb_dirSearchCounter; ++smb_dirSearchCounter; - dsp->refCount = 1; - lock_InitializeMutex(&dsp->mx, "cm_dirSearch_t"); - dsp->lastTime = osi_Time(); - break; - } + dsp->refCount = 1; + lock_InitializeMutex(&dsp->mx, "cm_dirSearch_t"); + dsp->lastTime = osi_Time(); + break; + } lock_ReleaseWrite(&smb_globalLock); - return dsp; + return dsp; } static smb_packet_t *GetPacket(void) @@ -1370,15 +1565,16 @@ static smb_packet_t *GetPacket(void) lock_ObtainWrite(&smb_globalLock); tbp = smb_packetFreeListp; - if (tbp) smb_packetFreeListp = tbp->nextp; + if (tbp) + smb_packetFreeListp = tbp->nextp; lock_ReleaseWrite(&smb_globalLock); - if (!tbp) { + if (!tbp) { #ifndef DJGPP - tbp = GlobalAlloc(GMEM_FIXED, 65540); + tbp = calloc(65540,1); #else /* DJGPP */ - tbp = malloc(sizeof(smb_packet_t)); + tbp = malloc(sizeof(smb_packet_t)); #endif /* !DJGPP */ - tbp->magic = SMB_PACKETMAGIC; + tbp->magic = SMB_PACKETMAGIC; tbp->ncbp = NULL; tbp->vcp = NULL; tbp->resumeCode = 0; @@ -1389,30 +1585,31 @@ static smb_packet_t *GetPacket(void) tbp->oddByte = 0; tbp->ncb_length = 0; tbp->flags = 0; + tbp->spacep = NULL; #ifdef DJGPP - npar = SMB_PACKETSIZE >> 4; /* number of paragraphs */ - { - signed int retval = - __dpmi_allocate_dos_memory(npar, &tb_sel); /* DOS segment */ - if (retval == -1) { - afsi_log("Cannot allocate %d paragraphs of DOS memory", - npar); - osi_panic("",__FILE__,__LINE__); - } - else { - afsi_log("Allocated %d paragraphs of DOS mem at 0x%X", - npar, retval); - seg = retval; - } - } - tbp->dos_pkt = (seg * 16) + 0; /* DOS physical address */ - tbp->dos_pkt_sel = tb_sel; + npar = SMB_PACKETSIZE >> 4; /* number of paragraphs */ + { + signed int retval = + __dpmi_allocate_dos_memory(npar, &tb_sel); /* DOS segment */ + if (retval == -1) { + afsi_log("Cannot allocate %d paragraphs of DOS memory", + npar); + osi_panic("",__FILE__,__LINE__); + } + else { + afsi_log("Allocated %d paragraphs of DOS mem at 0x%X", + npar, retval); + seg = retval; + } + } + tbp->dos_pkt = (seg * 16) + 0; /* DOS physical address */ + tbp->dos_pkt_sel = tb_sel; #endif /* DJGPP */ } - osi_assert(tbp->magic == SMB_PACKETMAGIC); + osi_assert(tbp->magic == SMB_PACKETMAGIC); - return tbp; + return tbp; } smb_packet_t *smb_CopyPacket(smb_packet_t *pkt) @@ -1420,63 +1617,63 @@ smb_packet_t *smb_CopyPacket(smb_packet_t *pkt) smb_packet_t *tbp; tbp = GetPacket(); memcpy(tbp, pkt, sizeof(smb_packet_t)); - tbp->wctp = tbp->data + ((unsigned int)pkt->wctp - - (unsigned int)pkt->data); + tbp->wctp = tbp->data + ((unsigned int)pkt->wctp - (unsigned int)pkt->data); return tbp; } static NCB *GetNCB(void) { smb_ncb_t *tbp; - NCB *ncbp; + NCB *ncbp; #ifdef DJGPP - unsigned int npar, seg, tb_sel; + unsigned int npar, seg, tb_sel; #endif /* DJGPP */ lock_ObtainWrite(&smb_globalLock); tbp = smb_ncbFreeListp; - if (tbp) smb_ncbFreeListp = tbp->nextp; + if (tbp) + smb_ncbFreeListp = tbp->nextp; lock_ReleaseWrite(&smb_globalLock); - if (!tbp) { + if (!tbp) { #ifndef DJGPP - tbp = GlobalAlloc(GMEM_FIXED, sizeof(*tbp)); + tbp = calloc(sizeof(*tbp),1); #else /* DJGPP */ - tbp = malloc(sizeof(*tbp)); - npar = (sizeof(NCB)+15) >> 4; /* number of paragraphs */ - { - signed int retval = - __dpmi_allocate_dos_memory(npar, &tb_sel); /* DOS segment */ - if (retval == -1) { - afsi_log("Cannot allocate %d paragraphs of DOS mem in GetNCB", - npar); - osi_panic("",__FILE__,__LINE__); - } else { - afsi_log("Allocated %d paragraphs of DOS mem at 0x%X in GetNCB", - npar, retval); - seg = retval; - } - } - tbp->dos_ncb = (seg * 16) + 0; /* DOS physical address */ - tbp->dos_ncb_sel = tb_sel; + tbp = malloc(sizeof(*tbp)); + npar = (sizeof(NCB)+15) >> 4; /* number of paragraphs */ + { + signed int retval = + __dpmi_allocate_dos_memory(npar, &tb_sel); /* DOS segment */ + if (retval == -1) { + afsi_log("Cannot allocate %d paragraphs of DOS mem in GetNCB", + npar); + osi_panic("",__FILE__,__LINE__); + } else { + afsi_log("Allocated %d paragraphs of DOS mem at 0x%X in GetNCB", + npar, retval); + seg = retval; + } + } + tbp->dos_ncb = (seg * 16) + 0; /* DOS physical address */ + tbp->dos_ncb_sel = tb_sel; #endif /* !DJGPP */ - tbp->magic = SMB_NCBMAGIC; + tbp->magic = SMB_NCBMAGIC; } - osi_assert(tbp->magic == SMB_NCBMAGIC); + osi_assert(tbp->magic == SMB_NCBMAGIC); memset(&tbp->ncb, 0, sizeof(NCB)); - ncbp = &tbp->ncb; + ncbp = &tbp->ncb; #ifdef DJGPP - dos_memset(tbp->dos_ncb, 0, sizeof(NCB)); + dos_memset(tbp->dos_ncb, 0, sizeof(NCB)); #endif /* DJGPP */ - return ncbp; + return ncbp; } void smb_FreePacket(smb_packet_t *tbp) { - osi_assert(tbp->magic == SMB_PACKETMAGIC); + osi_assert(tbp->magic == SMB_PACKETMAGIC); - lock_ObtainWrite(&smb_globalLock); + lock_ObtainWrite(&smb_globalLock); tbp->nextp = smb_packetFreeListp; smb_packetFreeListp = tbp; tbp->magic = SMB_PACKETMAGIC; @@ -1490,39 +1687,39 @@ void smb_FreePacket(smb_packet_t *tbp) tbp->oddByte = 0; tbp->ncb_length = 0; tbp->flags = 0; - lock_ReleaseWrite(&smb_globalLock); + lock_ReleaseWrite(&smb_globalLock); } static void FreeNCB(NCB *bufferp) { smb_ncb_t *tbp; - tbp = (smb_ncb_t *) bufferp; - osi_assert(tbp->magic == SMB_NCBMAGIC); + tbp = (smb_ncb_t *) bufferp; + osi_assert(tbp->magic == SMB_NCBMAGIC); - lock_ObtainWrite(&smb_globalLock); + lock_ObtainWrite(&smb_globalLock); tbp->nextp = smb_ncbFreeListp; smb_ncbFreeListp = tbp; - lock_ReleaseWrite(&smb_globalLock); + lock_ReleaseWrite(&smb_globalLock); } /* get a ptr to the data part of a packet, and its count */ unsigned char *smb_GetSMBData(smb_packet_t *smbp, int *nbytesp) { - int parmBytes; - int dataBytes; - unsigned char *afterParmsp; + int parmBytes; + int dataBytes; + unsigned char *afterParmsp; - parmBytes = *smbp->wctp << 1; + parmBytes = *smbp->wctp << 1; afterParmsp = smbp->wctp + parmBytes + 1; - dataBytes = afterParmsp[0] + (afterParmsp[1]<<8); - if (nbytesp) *nbytesp = dataBytes; + dataBytes = afterParmsp[0] + (afterParmsp[1]<<8); + if (nbytesp) *nbytesp = dataBytes; /* don't forget to skip the data byte count, since it follows - * the parameters; that's where the "2" comes from below. - */ - return (unsigned char *) (afterParmsp + 2); + * the parameters; that's where the "2" comes from below. + */ + return (unsigned char *) (afterParmsp + 2); } /* must set all the returned parameters before playing around with the @@ -1531,40 +1728,40 @@ unsigned char *smb_GetSMBData(smb_packet_t *smbp, int *nbytesp) */ void smb_SetSMBDataLength(smb_packet_t *smbp, unsigned int dsize) { - unsigned char *afterParmsp; + unsigned char *afterParmsp; afterParmsp = smbp->wctp + ((*smbp->wctp)<<1) + 1; *afterParmsp++ = dsize & 0xff; - *afterParmsp = (dsize>>8) & 0xff; + *afterParmsp = (dsize>>8) & 0xff; } /* return the parm'th parameter in the smbp packet */ unsigned int smb_GetSMBParm(smb_packet_t *smbp, int parm) { - int parmCount; + int parmCount; unsigned char *parmDatap; parmCount = *smbp->wctp; if (parm >= parmCount) { #ifndef DJGPP - HANDLE h; + HANDLE h; char *ptbuf[1]; char s[100]; h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); sprintf(s, "Bad SMB param %d out of %d, ncb len %d", - parm, parmCount, smbp->ncb_length); + parm, parmCount, smbp->ncb_length); ptbuf[0] = s; ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1006, NULL, - 1, smbp->ncb_length, ptbuf, smbp); + 1, smbp->ncb_length, ptbuf, smbp); DeregisterEventSource(h); #else /* DJGPP */ - char s[100]; + char s[100]; - sprintf(s, "Bad SMB param %d out of %d, ncb len %d", - parm, parmCount, smbp->ncb_length); - osi_Log0(afsd_logp, s); + sprintf(s, "Bad SMB param %d out of %d, ncb len %d", + parm, parmCount, smbp->ncb_length); + osi_Log0(smb_logp, s); #endif /* !DJGPP */ osi_panic(s, __FILE__, __LINE__); } @@ -1576,7 +1773,7 @@ unsigned int smb_GetSMBParm(smb_packet_t *smbp, int parm) /* return the parm'th parameter in the smbp packet */ unsigned int smb_GetSMBOffsetParm(smb_packet_t *smbp, int parm, int offset) { - int parmCount; + int parmCount; unsigned char *parmDatap; parmCount = *smbp->wctp; @@ -1588,25 +1785,25 @@ unsigned int smb_GetSMBOffsetParm(smb_packet_t *smbp, int parm, int offset) char s[100]; h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); sprintf(s, "Bad SMB param %d offset %d out of %d, ncb len %d", - parm, offset, parmCount, smbp->ncb_length); + parm, offset, parmCount, smbp->ncb_length); ptbuf[0] = s; ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1006, NULL, - 1, smbp->ncb_length, ptbuf, smbp); + 1, smbp->ncb_length, ptbuf, smbp); DeregisterEventSource(h); #else /* DJGPP */ - char s[100]; + char s[100]; - sprintf(s, "Bad SMB param %d offset %d out of %d, " - "ncb len %d", - parm, offset, parmCount, smbp->ncb_length); - osi_Log0(afsd_logp, s); + sprintf(s, "Bad SMB param %d offset %d out of %d, " + "ncb len %d", + parm, offset, parmCount, smbp->ncb_length); + osi_Log0(smb_logp, s); #endif /* !DJGPP */ osi_panic(s, __FILE__, __LINE__); } parmDatap = smbp->wctp + (2*parm) + 1 + offset; - return parmDatap[0] + (parmDatap[1] << 8); + return parmDatap[0] + (parmDatap[1] << 8); } void smb_SetSMBParm(smb_packet_t *smbp, int slot, unsigned int parmValue) @@ -1616,9 +1813,9 @@ void smb_SetSMBParm(smb_packet_t *smbp, int slot, unsigned int parmValue) /* make sure we have enough slots */ if (*smbp->wctp <= slot) *smbp->wctp = slot+1; - parmDatap = smbp->wctp + 2*slot + 1 + smbp->oddByte; - *parmDatap++ = parmValue & 0xff; - *parmDatap = (parmValue>>8) & 0xff; + parmDatap = smbp->wctp + 2*slot + 1 + smbp->oddByte; + *parmDatap++ = parmValue & 0xff; + *parmDatap = (parmValue>>8) & 0xff; } void smb_SetSMBParmLong(smb_packet_t *smbp, int slot, unsigned int parmValue) @@ -1669,80 +1866,84 @@ void smb_StripLastComponent(char *outPathp, char **lastComponentp, char *inPathp { char *lastSlashp; - lastSlashp = strrchr(inPathp, '\\'); + lastSlashp = strrchr(inPathp, '\\'); if (lastComponentp) *lastComponentp = lastSlashp; - if (lastSlashp) { + if (lastSlashp) { while (1) { - if (inPathp == lastSlashp) break; + if (inPathp == lastSlashp) + break; *outPathp++ = *inPathp++; - } - *outPathp++ = 0; - } + } + *outPathp++ = 0; + } else { *outPathp++ = 0; - } + } } unsigned char *smb_ParseASCIIBlock(unsigned char *inp, char **chainpp) { - if (*inp++ != 0x4) return NULL; - if (chainpp) { + if (*inp++ != 0x4) + return NULL; + if (chainpp) { *chainpp = inp + strlen(inp) + 1; /* skip over null-terminated string */ - } - return inp; + } + return inp; } unsigned char *smb_ParseVblBlock(unsigned char *inp, char **chainpp, int *lengthp) { int tlen; - if (*inp++ != 0x5) return NULL; - tlen = inp[0] + (inp[1]<<8); - inp += 2; /* skip length field */ + if (*inp++ != 0x5) + return NULL; + tlen = inp[0] + (inp[1]<<8); + inp += 2; /* skip length field */ - if (chainpp) { + if (chainpp) { *chainpp = inp + tlen; - } + } - if (lengthp) *lengthp = tlen; + if (lengthp) + *lengthp = tlen; - return inp; -} + return inp; +} /* format a packet as a response */ void smb_FormatResponsePacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *op) { smb_t *outp; - smb_t *inSmbp; + smb_t *inSmbp; - outp = (smb_t *) op; + outp = (smb_t *) op; - /* zero the basic structure through the smb_wct field, and zero the data - * size field, assuming that wct stays zero; otherwise, you have to - * explicitly set the data size field, too. - */ + /* zero the basic structure through the smb_wct field, and zero the data + * size field, assuming that wct stays zero; otherwise, you have to + * explicitly set the data size field, too. + */ inSmbp = (smb_t *) inp; memset(outp, 0, sizeof(smb_t)+2); - outp->id[0] = 0xff; - outp->id[1] = 'S'; - outp->id[2] = 'M'; - outp->id[3] = 'B'; + outp->id[0] = 0xff; + outp->id[1] = 'S'; + outp->id[2] = 'M'; + outp->id[3] = 'B'; if (inp) { outp->com = inSmbp->com; - outp->tid = inSmbp->tid; - outp->pid = inSmbp->pid; - outp->uid = inSmbp->uid; - outp->mid = inSmbp->mid; + outp->tid = inSmbp->tid; + outp->pid = inSmbp->pid; + outp->uid = inSmbp->uid; + outp->mid = inSmbp->mid; outp->res[0] = inSmbp->res[0]; outp->res[1] = inSmbp->res[1]; - op->inCom = inSmbp->com; + op->inCom = inSmbp->com; } - outp->reb = 0x80; /* SERVER_RESP */ + outp->reb = 0x80; /* SERVER_RESP */ outp->flg2 = 0x1; /* KNOWS_LONG_NAMES */ /* copy fields in generic packet area */ - op->wctp = &outp->wct; + op->wctp = &outp->wct; } /* send a (probably response) packet; vcp tells us to whom to send it. @@ -1751,49 +1952,49 @@ void smb_FormatResponsePacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *op void smb_SendPacket(smb_vc_t *vcp, smb_packet_t *inp) { NCB *ncbp; - int extra; - long code; - unsigned char *tp; + int extra; + long code = 0; + unsigned char *tp; int localNCB = 0; #ifdef DJGPP - dos_ptr dos_ncb; + dos_ptr dos_ncb; #endif /* DJGPP */ - ncbp = inp->ncbp; + ncbp = inp->ncbp; if (ncbp == NULL) { ncbp = GetNCB(); localNCB = 1; } #ifdef DJGPP - dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; + dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; #endif /* DJGPP */ memset((char *)ncbp, 0, sizeof(NCB)); - extra = 2 * (*inp->wctp); /* space used by parms, in bytes */ + extra = 2 * (*inp->wctp); /* space used by parms, in bytes */ tp = inp->wctp + 1+ extra; /* points to count of data bytes */ - extra += tp[0] + (tp[1]<<8); - extra += ((unsigned int)inp->wctp - (unsigned int)inp->data); /* distance to last wct field */ - extra += 3; /* wct and length fields */ + extra += tp[0] + (tp[1]<<8); + extra += ((unsigned int)inp->wctp - (unsigned int)inp->data); /* distance to last wct field */ + extra += 3; /* wct and length fields */ - ncbp->ncb_length = extra; /* bytes to send */ - ncbp->ncb_lsn = (unsigned char) vcp->lsn; /* vc to use */ + ncbp->ncb_length = extra; /* bytes to send */ + ncbp->ncb_lsn = (unsigned char) vcp->lsn; /* vc to use */ ncbp->ncb_lana_num = vcp->lana; - ncbp->ncb_command = NCBSEND; /* op means send data */ + ncbp->ncb_command = NCBSEND; /* op means send data */ #ifndef DJGPP - ncbp->ncb_buffer = (char *) inp;/* packet */ - code = Netbios(ncbp); + ncbp->ncb_buffer = (char *) inp;/* packet */ + code = Netbios(ncbp); #else /* DJGPP */ - ncbp->ncb_buffer = inp->dos_pkt;/* packet */ - ((smb_ncb_t*)ncbp)->orig_pkt = inp; + ncbp->ncb_buffer = inp->dos_pkt;/* packet */ + ((smb_ncb_t*)ncbp)->orig_pkt = inp; - /* copy header information from virtual to DOS address space */ - dosmemput((char*)inp, SMB_PACKETSIZE, inp->dos_pkt); - code = Netbios(ncbp, dos_ncb); + /* copy header information from virtual to DOS address space */ + dosmemput((char*)inp, SMB_PACKETSIZE, inp->dos_pkt); + code = Netbios(ncbp, dos_ncb); #endif /* !DJGPP */ if (code != 0) - osi_Log1(afsd_logp, "SendPacket failure code %d", code); + osi_Log1(smb_logp, "SendPacket failure code %d", code); if (localNCB) FreeNCB(ncbp); @@ -1804,65 +2005,69 @@ void smb_MapNTError(long code, unsigned long *NTStatusp) unsigned long NTStatus; /* map CM_ERROR_* errors to NT 32-bit status codes */ - if (code == CM_ERROR_NOSUCHCELL) { + if (code == CM_ERROR_NOSUCHCELL) { NTStatus = 0xC000000FL; /* No such file */ - } - else if (code == CM_ERROR_NOSUCHVOLUME) { + } + else if (code == CM_ERROR_NOSUCHVOLUME) { NTStatus = 0xC000000FL; /* No such file */ - } - else if (code == CM_ERROR_TIMEDOUT) { - NTStatus = 0xC00000CFL; /* Paused */ - } - else if (code == CM_ERROR_RETRY) { + } + else if (code == CM_ERROR_TIMEDOUT) { + NTStatus = 0xC00000CFL; /* Sharing Paused */ + } + else if (code == CM_ERROR_RETRY) { NTStatus = 0xC000022DL; /* Retry */ - } - else if (code == CM_ERROR_NOACCESS) { + } + else if (code == CM_ERROR_NOACCESS) { NTStatus = 0xC0000022L; /* Access denied */ - } + } else if (code == CM_ERROR_READONLY) { NTStatus = 0xC00000A2L; /* Write protected */ - } - else if (code == CM_ERROR_NOSUCHFILE) { + } + else if (code == CM_ERROR_NOSUCHFILE) { NTStatus = 0xC000000FL; /* No such file */ - } + } else if (code == CM_ERROR_NOSUCHPATH) { NTStatus = 0xC000003AL; /* Object path not found */ - } - else if (code == CM_ERROR_TOOBIG) { + } + else if (code == CM_ERROR_TOOBIG) { NTStatus = 0xC000007BL; /* Invalid image format */ - } - else if (code == CM_ERROR_INVAL) { + } + else if (code == CM_ERROR_INVAL) { NTStatus = 0xC000000DL; /* Invalid parameter */ - } - else if (code == CM_ERROR_BADFD) { + } + else if (code == CM_ERROR_BADFD) { NTStatus = 0xC0000008L; /* Invalid handle */ - } - else if (code == CM_ERROR_BADFDOP) { + } + else if (code == CM_ERROR_BADFDOP) { NTStatus = 0xC0000022L; /* Access denied */ - } - else if (code == CM_ERROR_EXISTS) { + } + else if (code == CM_ERROR_EXISTS) { NTStatus = 0xC0000035L; /* Object name collision */ - } + } else if (code == CM_ERROR_NOTEMPTY) { NTStatus = 0xC0000101L; /* Directory not empty */ - } - else if (code == CM_ERROR_CROSSDEVLINK) { + } + else if (code == CM_ERROR_CROSSDEVLINK) { NTStatus = 0xC00000D4L; /* Not same device */ - } + } else if (code == CM_ERROR_NOTDIR) { NTStatus = 0xC0000103L; /* Not a directory */ - } - else if (code == CM_ERROR_ISDIR) { + } + else if (code == CM_ERROR_ISDIR) { NTStatus = 0xC00000BAL; /* File is a directory */ - } - else if (code == CM_ERROR_BADOP) { + } + else if (code == CM_ERROR_BADOP) { NTStatus = 0xC09820FFL; /* SMB no support */ - } + } else if (code == CM_ERROR_BADSHARENAME) { NTStatus = 0xC00000CCL; /* Bad network name */ } else if (code == CM_ERROR_NOIPC) { - NTStatus = 0xC00000CCL; /* Bad network name */ +#ifdef COMMENT + NTStatus = 0xC0000022L; /* Access Denied */ +#else + NTStatus = 0xC000013DL; /* Remote Resources */ +#endif } else if (code == CM_ERROR_CLOCKSKEW) { NTStatus = 0xC0000133L; /* Time difference at DC */ @@ -1894,100 +2099,107 @@ void smb_MapNTError(long code, unsigned long *NTStatusp) else if (code == CM_ERROR_BUFFERTOOSMALL) { NTStatus = 0xC0000023L; /* Buffer too small */ } - else { + else if (code == CM_ERROR_AMBIGUOUS_FILENAME) { +#ifdef COMMENT + NTStatus = 0xC000049CL; /* Potential file found */ +#else + NTStatus = 0xC0000035L; /* Object name collision */ +#endif + } + else { NTStatus = 0xC0982001L; /* SMB non-specific error */ - } + } - *NTStatusp = NTStatus; - osi_Log2(afsd_logp, "SMB SEND code %x as NT %x", code, NTStatus); + *NTStatusp = NTStatus; + osi_Log2(smb_logp, "SMB SEND code %x as NT %x", code, NTStatus); } void smb_MapCoreError(long code, smb_vc_t *vcp, unsigned short *scodep, unsigned char *classp) { unsigned char class; - unsigned short error; + unsigned short error; /* map CM_ERROR_* errors to SMB errors */ - if (code == CM_ERROR_NOSUCHCELL) { + if (code == CM_ERROR_NOSUCHCELL) { class = 1; - error = 3; /* bad path */ - } - else if (code == CM_ERROR_NOSUCHVOLUME) { + error = 3; /* bad path */ + } + else if (code == CM_ERROR_NOSUCHVOLUME) { class = 1; - error = 3; /* bad path */ - } - else if (code == CM_ERROR_TIMEDOUT) { + error = 3; /* bad path */ + } + else if (code == CM_ERROR_TIMEDOUT) { class = 2; - error = 81; /* server is paused */ - } - else if (code == CM_ERROR_RETRY) { + error = 81; /* server is paused */ + } + else if (code == CM_ERROR_RETRY) { class = 2; /* shouldn't happen */ - error = 1; - } - else if (code == CM_ERROR_NOACCESS) { + error = 1; + } + else if (code == CM_ERROR_NOACCESS) { class = 2; - error = 4; /* bad access */ - } + error = 4; /* bad access */ + } else if (code == CM_ERROR_READONLY) { class = 3; error = 19; /* read only */ } - else if (code == CM_ERROR_NOSUCHFILE) { + else if (code == CM_ERROR_NOSUCHFILE) { class = 1; - error = 2; /* ENOENT! */ - } + error = 2; /* ENOENT! */ + } else if (code == CM_ERROR_NOSUCHPATH) { class = 1; error = 3; /* Bad path */ } - else if (code == CM_ERROR_TOOBIG) { + else if (code == CM_ERROR_TOOBIG) { class = 1; error = 11; /* bad format */ - } - else if (code == CM_ERROR_INVAL) { + } + else if (code == CM_ERROR_INVAL) { class = 2; /* server non-specific error code */ - error = 1; - } - else if (code == CM_ERROR_BADFD) { + error = 1; + } + else if (code == CM_ERROR_BADFD) { class = 1; - error = 6; /* invalid file handle */ - } - else if (code == CM_ERROR_BADFDOP) { + error = 6; /* invalid file handle */ + } + else if (code == CM_ERROR_BADFDOP) { class = 1; /* invalid op on FD */ - error = 5; - } - else if (code == CM_ERROR_EXISTS) { + error = 5; + } + else if (code == CM_ERROR_EXISTS) { class = 1; - error = 80; /* file already exists */ - } + error = 80; /* file already exists */ + } else if (code == CM_ERROR_NOTEMPTY) { class = 1; error = 5; /* delete directory not empty */ } - else if (code == CM_ERROR_CROSSDEVLINK) { + else if (code == CM_ERROR_CROSSDEVLINK) { class = 1; - error = 17; /* EXDEV */ - } + error = 17; /* EXDEV */ + } else if (code == CM_ERROR_NOTDIR) { class = 1; /* bad path */ - error = 3; - } - else if (code == CM_ERROR_ISDIR) { + error = 3; + } + else if (code == CM_ERROR_ISDIR) { class = 1; /* access denied; DOS doesn't have a good match */ - error = 5; - } - else if (code == CM_ERROR_BADOP) { + error = 5; + } + else if (code == CM_ERROR_BADOP) { class = 2; - error = 65535; - } + error = 65535; + } else if (code == CM_ERROR_BADSHARENAME) { class = 2; error = 6; } else if (code == CM_ERROR_NOIPC) { - class = 1; - error = 66; + class = 2; + error = 4; /* bad access */ } else if (code == CM_ERROR_CLOCKSKEW) { class = 1; /* invalid function */ @@ -2041,18 +2253,18 @@ void smb_MapCoreError(long code, smb_vc_t *vcp, unsigned short *scodep, class = 1; error = 18; /* no files in search */ } - else if (code == CM_ERROR_RENAME_IDENTICAL) { - class = 1; - error = 183; /* Samba uses this */ - } - else { + else if (code == CM_ERROR_RENAME_IDENTICAL) { + class = 1; + error = 183; /* Samba uses this */ + } + else { class = 2; - error = 1; - } + error = 1; + } *scodep = error; - *classp = class; - osi_Log3(afsd_logp, "SMB SEND code %x as SMB %d: %d", code, class, error); + *classp = class; + osi_Log3(smb_logp, "SMB SEND code %x as SMB %d: %d", code, class, error); } long smb_SendCoreBadOp(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) @@ -2086,15 +2298,15 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp long count, minCount, finalCount; unsigned short fd; smb_fid_t *fidp; - long code; + long code = 0; cm_user_t *userp = NULL; - NCB *ncbp; - int rc; + NCB *ncbp; + int rc; #ifndef DJGPP - char *rawBuf = NULL; + char *rawBuf = NULL; #else - dos_ptr rawBuf = NULL; - dos_ptr dos_ncb; + dos_ptr rawBuf = NULL; + dos_ptr dos_ncb; #endif /* DJGPP */ rawBuf = NULL; @@ -2106,8 +2318,8 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp offset.HighPart = 0; /* too bad */ offset.LowPart = smb_GetSMBParm(inp, 1) | (smb_GetSMBParm(inp, 2) << 16); - osi_Log3(afsd_logp, "smb_ReceieveCoreReadRaw fd %d, off 0x%x, size 0x%x", - fd, offset.LowPart, count); + osi_Log3(smb_logp, "smb_ReceieveCoreReadRaw fd %d, off 0x%x, size 0x%x", + fd, offset.LowPart, count); fidp = smb_FindFID(vcp, fd, 0); if (!fidp) @@ -2120,21 +2332,21 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp #ifndef DJGPP smb_RawBufs = *(char **)smb_RawBufs; #else /* DJGPP */ - smb_RawBufs = _farpeekl(_dos_ds, smb_RawBufs); + smb_RawBufs = _farpeekl(_dos_ds, smb_RawBufs); #endif /* !DJGPP */ } lock_ReleaseMutex(&smb_RawBufLock); if (!rawBuf) goto send1a; - if (fidp->flags & SMB_FID_IOCTL) - { + if (fidp->flags & SMB_FID_IOCTL) + { #ifndef DJGPP - rc = smb_IoctlReadRaw(fidp, vcp, inp, outp); + rc = smb_IoctlReadRaw(fidp, vcp, inp, outp); #else - rc = smb_IoctlReadRaw(fidp, vcp, inp, outp, rawBuf); + rc = smb_IoctlReadRaw(fidp, vcp, inp, outp, rawBuf); #endif - if (rawBuf) { + if (rawBuf) { /* Give back raw buffer */ lock_ObtainMutex(&smb_RawBufLock); #ifndef DJGPP @@ -2145,32 +2357,35 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp smb_RawBufs = rawBuf; lock_ReleaseMutex(&smb_RawBufLock); - } - return rc; } + + smb_ReleaseFID(fidp); + return rc; + } - userp = smb_GetUser(vcp, inp); + userp = smb_GetUser(vcp, inp); #ifndef DJGPP code = smb_ReadData(fidp, &offset, count, rawBuf, userp, &finalCount); #else /* DJGPP */ - /* have to give ReadData flag so it will treat buffer as DOS mem. */ - code = smb_ReadData(fidp, &offset, count, (unsigned char *)rawBuf, - userp, &finalCount, TRUE /* rawFlag */); + /* have to give ReadData flag so it will treat buffer as DOS mem. */ + code = smb_ReadData(fidp, &offset, count, (unsigned char *)rawBuf, + userp, &finalCount, TRUE /* rawFlag */); #endif /* !DJGPP */ if (code != 0) goto send; -send: - cm_ReleaseUser(userp); -send1a: + send: + cm_ReleaseUser(userp); + + send1a: smb_ReleaseFID(fidp); -send1: + send1: ncbp = outp->ncbp; #ifdef DJGPP - dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; + dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; #endif /* DJGPP */ memset((char *)ncbp, 0, sizeof(NCB)); @@ -2186,7 +2401,7 @@ send1: code = Netbios(ncbp, dos_ncb); #endif /* !DJGPP */ if (code != 0) - osi_Log1(afsd_logp, "ReadRaw send failure code %d", code); + osi_Log1(smb_logp, "ReadRaw send failure code %d", code); if (rawBuf) { /* Give back raw buffer */ @@ -2194,7 +2409,7 @@ send1: #ifndef DJGPP *((char **) rawBuf) = smb_RawBufs; #else /* DJGPP */ - _farpokel(_dos_ds, rawBuf, smb_RawBufs); + _farpokel(_dos_ds, rawBuf, smb_RawBufs); #endif /* !DJGPP */ smb_RawBufs = rawBuf; @@ -2217,26 +2432,32 @@ long smb_ReceiveCoreUnlockRecord(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t long smb_ReceiveNegotiate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { char *namep; - int coreProtoIndex; - int v3ProtoIndex; + int coreProtoIndex; + int v3ProtoIndex; int NTProtoIndex; - int protoIndex; /* index we're using */ - int namex; - int dbytes; + int protoIndex; /* index we're using */ + int namex; + int dbytes; int entryLength; - int tcounter; + int tcounter; char protocol_array[10][1024]; /* protocol signature of the client */ - osi_Log1(afsd_logp, "SMB receive negotiate; %d + 1 ongoing ops", - ongoingOps - 1); + osi_Log1(smb_logp, "SMB receive negotiate; %d + 1 ongoing ops", + ongoingOps - 1); if (!isGateway) { if (active_vcp) { DWORD now = GetCurrentTime(); if (now - last_msg_time >= 30000 - && now - last_msg_time <= 90000) { - osi_Log1(afsd_logp, - "Setting dead_vcp %x", active_vcp); + && now - last_msg_time <= 90000) { + osi_Log1(smb_logp, + "Setting dead_vcp %x", active_vcp); + if (dead_vcp) { + smb_ReleaseVC(dead_vcp); + osi_Log1(smb_logp, + "Previous dead_vcp %x", dead_vcp); + } + smb_HoldVC(active_vcp); dead_vcp = active_vcp; dead_vcp->flags |= SMB_VCFLAG_ALREADYDEAD; } @@ -2245,39 +2466,39 @@ long smb_ReceiveNegotiate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) inp->flags |= SMB_PACKETFLAG_PROFILE_UPDATE_OK; - namep = smb_GetSMBData(inp, &dbytes); - namex = 0; + namep = smb_GetSMBData(inp, &dbytes); + namex = 0; tcounter = 0; coreProtoIndex = -1; /* not found */ - v3ProtoIndex = -1; + v3ProtoIndex = -1; NTProtoIndex = -1; - while(namex < dbytes) { - osi_Log1(afsd_logp, "Protocol %s", - osi_LogSaveString(afsd_logp, namep+1)); + while(namex < dbytes) { + osi_Log1(smb_logp, "Protocol %s", + osi_LogSaveString(smb_logp, namep+1)); strcpy(protocol_array[tcounter], namep+1); /* namep points at the first protocol, or really, a 0x02 - * byte preceding the null-terminated ASCII name. - */ - if (strcmp("PC NETWORK PROGRAM 1.0", namep+1) == 0) { - coreProtoIndex = tcounter; - } - else if (smb_useV3 && strcmp("LM1.2X002", namep+1) == 0) { + * byte preceding the null-terminated ASCII name. + */ + if (strcmp("PC NETWORK PROGRAM 1.0", namep+1) == 0) { + coreProtoIndex = tcounter; + } + else if (smb_useV3 && strcmp("LM1.2X002", namep+1) == 0) { v3ProtoIndex = tcounter; - } + } else if (smb_useV3 && strcmp("NT LM 0.12", namep+1) == 0) { NTProtoIndex = tcounter; } /* compute size of protocol entry */ entryLength = strlen(namep+1); - entryLength += 2; /* 0x02 bytes and null termination */ + entryLength += 2; /* 0x02 bytes and null termination */ - /* advance over this protocol entry */ + /* advance over this protocol entry */ namex += entryLength; - namep += entryLength; - tcounter++; /* which proto entry we're looking at */ - } + namep += entryLength; + tcounter++; /* which proto entry we're looking at */ + } #ifndef NOMOREFILESFIX /* * NOTE: We can determine what OS (NT4.0, W2K, W9X, etc) @@ -2285,62 +2506,62 @@ long smb_ReceiveNegotiate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) * ie. the order in which it sends us the protocol list. * * Special handling for Windows 2000 clients (defect 11765 ) + * Proto signature is the same for Win XP. */ if (tcounter == 6) { - int i = 0; - smb_t *ip = (smb_t *) inp; - smb_t *op = (smb_t *) outp; - - if ((strcmp("PC NETWORK PROGRAM 1.0", protocol_array[0]) == 0) && - (strcmp("LANMAN1.0", protocol_array[1]) == 0) && - (strcmp("Windows for Workgroups 3.1a", protocol_array[2]) == 0) && - (strcmp("LM1.2X002", protocol_array[3]) == 0) && - (strcmp("LANMAN2.1", protocol_array[4]) == 0) && - (strcmp("NT LM 0.12", protocol_array[5]) == 0)) { - isWindows2000 = TRUE; - osi_Log0(afsd_logp, "Looks like a Windows 2000 client"); - /* - * HACK: for now - just negotiate a lower protocol till we - * figure out which flag/flag2 or some other field - * (capabilities maybe?) to set in order for this to work - * correctly with Windows 2000 clients (defect 11765) - */ - NTProtoIndex = -1; - /* Things to try (after looking at tcpdump output could be - * setting flags and flags2 to 0x98 and 0xc853 like this - * op->reb = 0x98; op->flg2 = 0xc853; - * osi_Log2(afsd_logp, "Flags:0x%x Flags2:0x%x", ip->reb, ip->flg2); - */ - } - } - // NOMOREFILESFIX -#endif + int i = 0; + smb_t *ip = (smb_t *) inp; + smb_t *op = (smb_t *) outp; + + if ((strcmp("PC NETWORK PROGRAM 1.0", protocol_array[0]) == 0) && + (strcmp("LANMAN1.0", protocol_array[1]) == 0) && + (strcmp("Windows for Workgroups 3.1a", protocol_array[2]) == 0) && + (strcmp("LM1.2X002", protocol_array[3]) == 0) && + (strcmp("LANMAN2.1", protocol_array[4]) == 0) && + (strcmp("NT LM 0.12", protocol_array[5]) == 0)) { + isWindows2000 = TRUE; + osi_Log0(smb_logp, "Looks like a Windows 2000 client"); + /* + * HACK: for now - just negotiate a lower protocol till we + * figure out which flag/flag2 or some other field + * (capabilities maybe?) to set in order for this to work + * correctly with Windows 2000 clients (defect 11765) + */ + NTProtoIndex = -1; + /* Things to try (after looking at tcpdump output could be + * setting flags and flags2 to 0x98 and 0xc853 like this + * op->reb = 0x98; op->flg2 = 0xc853; + * osi_Log2(smb_logp, "Flags:0x%x Flags2:0x%x", ip->reb, ip->flg2); + */ + } + } +#endif /* NOMOREFILESFIX */ - if (NTProtoIndex != -1) { + if (NTProtoIndex != -1) { protoIndex = NTProtoIndex; vcp->flags |= (SMB_VCFLAG_USENT | SMB_VCFLAG_USEV3); } else if (v3ProtoIndex != -1) { - protoIndex = v3ProtoIndex; - vcp->flags |= SMB_VCFLAG_USEV3; - } - else if (coreProtoIndex != -1) { - protoIndex = coreProtoIndex; - vcp->flags |= SMB_VCFLAG_USECORE; - } + protoIndex = v3ProtoIndex; + vcp->flags |= SMB_VCFLAG_USEV3; + } + else if (coreProtoIndex != -1) { + protoIndex = coreProtoIndex; + vcp->flags |= SMB_VCFLAG_USECORE; + } else protoIndex = -1; - if (protoIndex == -1) - return CM_ERROR_INVAL; + if (protoIndex == -1) + return CM_ERROR_INVAL; else if (NTProtoIndex != -1) { smb_SetSMBParm(outp, 0, protoIndex); - smb_SetSMBParmByte(outp, 1, 0); /* share level security, no passwd encrypt */ - smb_SetSMBParm(outp, 1, 8); /* max multiplexed requests */ - smb_SetSMBParm(outp, 2, 100); /* max VCs per consumer/server connection */ - smb_SetSMBParmLong(outp, 3, SMB_PACKETSIZE); /* xmit buffer size */ + smb_SetSMBParmByte(outp, 1, 0); /* share level security, no passwd encrypt */ + smb_SetSMBParm(outp, 1, smb_maxMpxRequests); /* max multiplexed requests */ + smb_SetSMBParm(outp, 2, smb_maxVCPerServer); /* max VCs per consumer/server connection */ + smb_SetSMBParmLong(outp, 3, SMB_PACKETSIZE); /* xmit buffer size */ smb_SetSMBParmLong(outp, 5, 65536); /* raw buffer size */ - smb_SetSMBParm(outp, 7, 1); /* next 2: session key */ - smb_SetSMBParm(outp, 8, 1); + smb_SetSMBParm(outp, 7, 1); /* next 2: session key */ + smb_SetSMBParm(outp, 8, 1); /* * Tried changing the capabilities to support for W2K - defect 117695 * Maybe something else needs to be changed here? @@ -2351,38 +2572,39 @@ long smb_ReceiveNegotiate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) else smb_SetSMBParmLong(outp, 9, 0x251); */ - smb_SetSMBParmLong(outp, 9, 0x251); /* Capabilities: * - * 32-bit error codes * - * and NT Find * - * and NT SMB's * - * and raw mode */ - smb_SetSMBParmLong(outp, 11, 0);/* XXX server time: do we need? */ - smb_SetSMBParmLong(outp, 13, 0);/* XXX server date: do we need? */ - smb_SetSMBParm(outp, 15, 0); /* XXX server tzone: do we need? */ + /* Capabilities: * + * 32-bit error codes * + * and NT Find * + * and NT SMB's * + * and raw mode */ + smb_SetSMBParmLong(outp, 9, 0x251); + smb_SetSMBParmLong(outp, 11, 0);/* XXX server time: do we need? */ + smb_SetSMBParmLong(outp, 13, 0);/* XXX server date: do we need? */ + smb_SetSMBParm(outp, 15, 0); /* XXX server tzone: do we need? */ smb_SetSMBParmByte(outp, 16, 0);/* Encryption key length */ - smb_SetSMBDataLength(outp, 0); /* perhaps should specify 8 bytes anyway */ + smb_SetSMBDataLength(outp, 0); /* perhaps should specify 8 bytes anyway */ } else if (v3ProtoIndex != -1) { - smb_SetSMBParm(outp, 0, protoIndex); - smb_SetSMBParm(outp, 1, 0); /* share level security, no passwd encrypt */ - smb_SetSMBParm(outp, 2, SMB_PACKETSIZE); - smb_SetSMBParm(outp, 3, 8); /* max multiplexed requests */ - smb_SetSMBParm(outp, 4, 100); /* max VCs per consumer/server connection */ - smb_SetSMBParm(outp, 5, 0); /* no support of block mode for read or write */ - smb_SetSMBParm(outp, 6, 1); /* next 2: session key */ - smb_SetSMBParm(outp, 7, 1); - smb_SetSMBParm(outp, 8, 0); /* XXX server time: do we need? */ - smb_SetSMBParm(outp, 9, 0); /* XXX server date: do we need? */ - smb_SetSMBParm(outp, 10, 0); /* XXX server tzone: do we need? */ - smb_SetSMBParm(outp, 11, 0); /* resvd */ - smb_SetSMBParm(outp, 12, 0); /* resvd */ - smb_SetSMBDataLength(outp, 0); /* perhaps should specify 8 bytes anyway */ - } + smb_SetSMBParm(outp, 0, protoIndex); + smb_SetSMBParm(outp, 1, 0); /* share level security, no passwd encrypt */ + smb_SetSMBParm(outp, 2, SMB_PACKETSIZE); + smb_SetSMBParm(outp, 3, smb_maxMpxRequests); /* max multiplexed requests */ + smb_SetSMBParm(outp, 4, smb_maxVCPerServer); /* max VCs per consumer/server connection */ + smb_SetSMBParm(outp, 5, 0); /* no support of block mode for read or write */ + smb_SetSMBParm(outp, 6, 1); /* next 2: session key */ + smb_SetSMBParm(outp, 7, 1); + smb_SetSMBParm(outp, 8, 0); /* XXX server time: do we need? */ + smb_SetSMBParm(outp, 9, 0); /* XXX server date: do we need? */ + smb_SetSMBParm(outp, 10, 0); /* XXX server tzone: do we need? */ + smb_SetSMBParm(outp, 11, 0); /* resvd */ + smb_SetSMBParm(outp, 12, 0); /* resvd */ + smb_SetSMBDataLength(outp, 0); /* perhaps should specify 8 bytes anyway */ + } else if (coreProtoIndex != -1) { - smb_SetSMBParm(outp, 0, protoIndex); - smb_SetSMBDataLength(outp, 0); - } - return 0; + smb_SetSMBParm(outp, 0, protoIndex); + smb_SetSMBDataLength(outp, 0); + } + return 0; } void smb_Daemon(void *parmp) @@ -2395,7 +2617,7 @@ void smb_Daemon(void *parmp) if ((count % 360) == 0) /* every hour */ smb_CalculateNowTZ(); /* XXX GC dir search entries */ - } + } } void smb_WaitingLocksDaemon() @@ -2405,7 +2627,7 @@ void smb_WaitingLocksDaemon() smb_vc_t *vcp; smb_packet_t *inp, *outp; NCB *ncbp; - long code; + long code = 0; while(1) { lock_ObtainWrite(&smb_globalLock); @@ -2425,7 +2647,7 @@ void smb_WaitingLocksDaemon() nwL = (smb_waitingLock_t *) osi_QNext(&wL->q); lock_ReleaseWrite(&smb_globalLock); code = cm_RetryLock((cm_file_lock_t *) wL->lockp, - wL->vcp->flags & SMB_VCFLAG_ALREADYDEAD); + wL->vcp->flags & SMB_VCFLAG_ALREADYDEAD); if (code == CM_ERROR_WOULDBLOCK) { /* no progress */ if (wL->timeRemaining != 0xffffffff @@ -2433,7 +2655,7 @@ void smb_WaitingLocksDaemon() goto endWait; continue; } -endWait: + endWait: vcp = wL->vcp; inp = wL->inp; outp = wL->outp; @@ -2468,44 +2690,44 @@ endWait: long smb_ReceiveCoreGetDiskAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { - osi_Log0(afsd_logp, "SMB receive get disk attributes"); - - smb_SetSMBParm(outp, 0, 32000); - smb_SetSMBParm(outp, 1, 64); - smb_SetSMBParm(outp, 2, 1024); - smb_SetSMBParm(outp, 3, 30000); - smb_SetSMBParm(outp, 4, 0); - smb_SetSMBDataLength(outp, 0); + osi_Log0(smb_logp, "SMB receive get disk attributes"); + + smb_SetSMBParm(outp, 0, 32000); + smb_SetSMBParm(outp, 1, 64); + smb_SetSMBParm(outp, 2, 1024); + smb_SetSMBParm(outp, 3, 30000); + smb_SetSMBParm(outp, 4, 0); + smb_SetSMBDataLength(outp, 0); return 0; } long smb_ReceiveCoreTreeConnect(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *rsp) { - smb_tid_t *tidp; - unsigned short newTid; - char shareName[256]; + smb_tid_t *tidp; + unsigned short newTid; + char shareName[256]; char *sharePath; int shareFound; - char *tp; - char *pathp; - char *passwordp; - cm_user_t *userp; - - osi_Log0(afsd_logp, "SMB receive tree connect"); + char *tp; + char *pathp; + char *passwordp; + cm_user_t *userp; + + osi_Log0(smb_logp, "SMB receive tree connect"); /* parse input parameters */ tp = smb_GetSMBData(inp, NULL); pathp = smb_ParseASCIIBlock(tp, &tp); - passwordp = smb_ParseASCIIBlock(tp, &tp); + passwordp = smb_ParseASCIIBlock(tp, &tp); tp = strrchr(pathp, '\\'); - if (!tp) + if (!tp) return CM_ERROR_BADSMB; - strcpy(shareName, tp+1); + strcpy(shareName, tp+1); - userp = smb_GetUser(vcp, inp); + userp = smb_GetUser(vcp, inp); lock_ObtainMutex(&vcp->mx); - newTid = vcp->tidCounter++; + newTid = vcp->tidCounter++; lock_ReleaseMutex(&vcp->mx); tidp = smb_FindTID(vcp, newTid, SMB_FLAG_CREATE); @@ -2514,18 +2736,18 @@ long smb_ReceiveCoreTreeConnect(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t * smb_ReleaseTID(tidp); return CM_ERROR_BADSHARENAME; } - lock_ObtainMutex(&tidp->mx); - tidp->userp = userp; + lock_ObtainMutex(&tidp->mx); + tidp->userp = userp; tidp->pathname = sharePath; - lock_ReleaseMutex(&tidp->mx); - smb_ReleaseTID(tidp); + lock_ReleaseMutex(&tidp->mx); + smb_ReleaseTID(tidp); - smb_SetSMBParm(rsp, 0, SMB_PACKETSIZE); - smb_SetSMBParm(rsp, 1, newTid); - smb_SetSMBDataLength(rsp, 0); - - osi_Log1(afsd_logp, "SMB tree connect created ID %d", newTid); - return 0; + smb_SetSMBParm(rsp, 0, SMB_PACKETSIZE); + smb_SetSMBParm(rsp, 1, newTid); + smb_SetSMBDataLength(rsp, 0); + + osi_Log1(smb_logp, "SMB tree connect created ID %d", newTid); + return 0; } unsigned char *smb_ParseDataBlock(unsigned char *inp, char **chainpp, int *lengthp) @@ -2533,16 +2755,16 @@ unsigned char *smb_ParseDataBlock(unsigned char *inp, char **chainpp, int *lengt int tlen; if (*inp++ != 0x1) return NULL; - tlen = inp[0] + (inp[1]<<8); - inp += 2; /* skip length field */ + tlen = inp[0] + (inp[1]<<8); + inp += 2; /* skip length field */ - if (chainpp) { + if (chainpp) { *chainpp = inp + tlen; - } + } - if (lengthp) *lengthp = tlen; + if (lengthp) *lengthp = tlen; - return inp; + return inp; } /* set maskp to the mask part of the incoming path. @@ -2553,10 +2775,10 @@ unsigned char *smb_ParseDataBlock(unsigned char *inp, char **chainpp, int *lengt int smb_Get8Dot3MaskFromPath(unsigned char *maskp, unsigned char *pathp) { char *tp; - char *up; - int i; - int tc; - int valid8Dot3; + char *up; + int i; + int tc; + int valid8Dot3; /* starts off valid */ valid8Dot3 = 1; @@ -2565,68 +2787,78 @@ int smb_Get8Dot3MaskFromPath(unsigned char *maskp, unsigned char *pathp) memset(maskp, ' ', 11); /* find last backslash, or use whole thing if there is none */ - tp = strrchr(pathp, '\\'); - if (!tp) tp = pathp; - else tp++; /* skip slash */ + tp = strrchr(pathp, '\\'); + if (!tp) tp = pathp; + else tp++; /* skip slash */ up = maskp; /* names starting with a dot are illegal */ if (*tp == '.') valid8Dot3 = 0; - for(i=0;; i++) { + for(i=0;; i++) { tc = *tp++; - if (tc == 0) return valid8Dot3; - if (tc == '.' || tc == '"') break; - if (i < 8) *up++ = tc; - else valid8Dot3 = 0; - } + if (tc == 0) return valid8Dot3; + if (tc == '.' || tc == '"') break; + if (i < 8) *up++ = tc; + else valid8Dot3 = 0; + } - /* if we get here, tp point after the dot */ - up = maskp+8; /* ext goes here */ - for(i=0;;i++) { - tc = *tp++; - if (tc == 0) return valid8Dot3; - - /* too many dots */ - if (tc == '.' || tc == '"') valid8Dot3 = 0; - - /* copy extension if not too long */ - if (i < 3) *up++ = tc; - else valid8Dot3 = 0; - } + /* if we get here, tp point after the dot */ + up = maskp+8; /* ext goes here */ + for(i=0;;i++) { + tc = *tp++; + if (tc == 0) + return valid8Dot3; + + /* too many dots */ + if (tc == '.' || tc == '"') + valid8Dot3 = 0; + + /* copy extension if not too long */ + if (i < 3) + *up++ = tc; + else + valid8Dot3 = 0; + } + + /* unreachable */ } int smb_Match8Dot3Mask(char *unixNamep, char *maskp) { char umask[11]; - int valid; - int i; - char tc1; - char tc2; - char *tp1; - char *tp2; - + int valid; + int i; + char tc1; + char tc2; + char *tp1; + char *tp2; + /* XXX redo this, calling smb_V3MatchMask with a converted mask */ - valid = smb_Get8Dot3MaskFromPath(umask, unixNamep); - if (!valid) return 0; + valid = smb_Get8Dot3MaskFromPath(umask, unixNamep); + if (!valid) + return 0; /* otherwise, we have a valid 8.3 name; see if we have a match, - * treating '?' as a wildcard in maskp (but not in the file name). - */ + * treating '?' as a wildcard in maskp (but not in the file name). + */ tp1 = umask; /* real name, in mask format */ - tp2 = maskp; /* mask, in mask format */ + tp2 = maskp; /* mask, in mask format */ for(i=0; i<11; i++) { tc1 = *tp1++; /* char from real name */ - tc2 = *tp2++; /* char from mask */ + tc2 = *tp2++; /* char from mask */ tc1 = (char) cm_foldUpper[(unsigned char)tc1]; tc2 = (char) cm_foldUpper[(unsigned char)tc2]; - if (tc1 == tc2) continue; - if (tc2 == '?' && tc1 != ' ') continue; - if (tc2 == '>') continue; + if (tc1 == tc2) + continue; + if (tc2 == '?' && tc1 != ' ') + continue; + if (tc2 == '>') + continue; return 0; - } + } /* we got a match */ return 1; @@ -2636,264 +2868,269 @@ char *smb_FindMask(char *pathp) { char *tp; - tp = strrchr(pathp, '\\'); /* find last slash */ + tp = strrchr(pathp, '\\'); /* find last slash */ - if (tp) return tp+1; /* skip the slash */ - else return pathp; /* no slash, return the entire path */ + if (tp) + return tp+1; /* skip the slash */ + else + return pathp; /* no slash, return the entire path */ } long smb_ReceiveCoreSearchVolume(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { unsigned char *pathp; - unsigned char *tp; - unsigned char mask[11]; - unsigned char *statBlockp; + unsigned char *tp; + unsigned char mask[11]; + unsigned char *statBlockp; unsigned char initStatBlock[21]; int statLen; - osi_Log0(afsd_logp, "SMB receive search volume"); + osi_Log0(smb_logp, "SMB receive search volume"); /* pull pathname and stat block out of request */ tp = smb_GetSMBData(inp, NULL); - pathp = smb_ParseASCIIBlock(tp, (char **) &tp); - osi_assert(pathp != NULL); - statBlockp = smb_ParseVblBlock(tp, (char **) &tp, &statLen); - osi_assert(statBlockp != NULL); + pathp = smb_ParseASCIIBlock(tp, (char **) &tp); + osi_assert(pathp != NULL); + statBlockp = smb_ParseVblBlock(tp, (char **) &tp, &statLen); + osi_assert(statBlockp != NULL); if (statLen == 0) { statBlockp = initStatBlock; statBlockp[0] = 8; } /* for returning to caller */ - smb_Get8Dot3MaskFromPath(mask, pathp); + smb_Get8Dot3MaskFromPath(mask, pathp); smb_SetSMBParm(outp, 0, 1); /* we're returning one entry */ - tp = smb_GetSMBData(outp, NULL); - *tp++ = 5; - *tp++ = 43; /* bytes in a dir entry */ - *tp++ = 0; /* high byte in counter */ - - /* now marshall the dir entry, starting with the search status */ - *tp++ = statBlockp[0]; /* Reserved */ - memcpy(tp, mask, 11); tp += 11; /* FileName */ + tp = smb_GetSMBData(outp, NULL); + *tp++ = 5; + *tp++ = 43; /* bytes in a dir entry */ + *tp++ = 0; /* high byte in counter */ + + /* now marshall the dir entry, starting with the search status */ + *tp++ = statBlockp[0]; /* Reserved */ + memcpy(tp, mask, 11); tp += 11; /* FileName */ /* now pass back server use info, with 1st byte non-zero */ - *tp++ = 1; - memset(tp, 0, 4); tp += 4; /* reserved for server use */ - - memcpy(tp, statBlockp+17, 4); tp += 4; /* reserved for consumer */ - - *tp++ = 0x8; /* attribute: volume */ + *tp++ = 1; + memset(tp, 0, 4); tp += 4; /* reserved for server use */ + + memcpy(tp, statBlockp+17, 4); tp += 4; /* reserved for consumer */ + + *tp++ = 0x8; /* attribute: volume */ /* copy out time */ - *tp++ = 0; - *tp++ = 0; - - /* copy out date */ - *tp++ = 18; - *tp++ = 178; - + *tp++ = 0; + *tp++ = 0; + + /* copy out date */ + *tp++ = 18; + *tp++ = 178; + /* 4 byte file size */ - *tp++ = 0; - *tp++ = 0; - *tp++ = 0; - *tp++ = 0; + *tp++ = 0; + *tp++ = 0; + *tp++ = 0; + *tp++ = 0; /* finally, null-terminated 8.3 pathname, which we set to AFS */ - memset(tp, ' ', 13); - strcpy(tp, "AFS"); - - /* set the length of the data part of the packet to 43 + 3, for the dir - * entry plus the 5 and the length fields. - */ - smb_SetSMBDataLength(outp, 46); + memset(tp, ' ', 13); + strcpy(tp, "AFS"); + + /* set the length of the data part of the packet to 43 + 3, for the dir + * entry plus the 5 and the length fields. + */ + smb_SetSMBDataLength(outp, 46); return 0; } long smb_ApplyDirListPatches(smb_dirListPatch_t **dirPatchespp, cm_user_t *userp, cm_req_t *reqp) { - long code; - cm_scache_t *scp; - char *dptr; - long dosTime; - u_short shortTemp; - char attr; - smb_dirListPatch_t *patchp; - smb_dirListPatch_t *npatchp; - - for(patchp = *dirPatchespp; patchp; patchp = - (smb_dirListPatch_t *) osi_QNext(&patchp->q)) { + long code = 0; + cm_scache_t *scp; + char *dptr; + long dosTime; + u_short shortTemp; + char attr; + smb_dirListPatch_t *patchp; + smb_dirListPatch_t *npatchp; + + for(patchp = *dirPatchespp; patchp; patchp = + (smb_dirListPatch_t *) osi_QNext(&patchp->q)) { code = cm_GetSCache(&patchp->fid, &scp, userp, reqp); - if (code) continue; - lock_ObtainMutex(&scp->mx); - code = cm_SyncOp(scp, NULL, userp, reqp, 0, - CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); - if (code) { + if (code) continue; + lock_ObtainMutex(&scp->mx); + code = cm_SyncOp(scp, NULL, userp, reqp, 0, + CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); + if (code) { lock_ReleaseMutex(&scp->mx); cm_ReleaseSCache(scp); continue; - } + } dptr = patchp->dptr; attr = smb_Attributes(scp); - *dptr++ = attr; + /* check hidden attribute (the flag is only ON when dot file hiding is on ) */ + if( patchp->flags & SMB_DIRLISTPATCH_DOTFILE ) + attr |= SMB_ATTR_HIDDEN; + *dptr++ = attr; /* get dos time */ - smb_SearchTimeFromUnixTime(&dosTime, scp->clientModTime); + smb_SearchTimeFromUnixTime(&dosTime, scp->clientModTime); - /* copy out time */ - shortTemp = dosTime & 0xffff; + /* copy out time */ + shortTemp = dosTime & 0xffff; *((u_short *)dptr) = shortTemp; - dptr += 2; + dptr += 2; /* and copy out date */ - shortTemp = (dosTime>>16) & 0xffff; + shortTemp = (dosTime>>16) & 0xffff; *((u_short *)dptr) = shortTemp; - dptr += 2; + dptr += 2; - /* copy out file length */ + /* copy out file length */ *((u_long *)dptr) = scp->length.LowPart; - dptr += 4; - lock_ReleaseMutex(&scp->mx); - cm_ReleaseSCache(scp); + dptr += 4; + lock_ReleaseMutex(&scp->mx); + cm_ReleaseSCache(scp); } - /* now free the patches */ - for(patchp = *dirPatchespp; patchp; patchp = npatchp) { + /* now free the patches */ + for(patchp = *dirPatchespp; patchp; patchp = npatchp) { npatchp = (smb_dirListPatch_t *) osi_QNext(&patchp->q); - free(patchp); - } + free(patchp); + } - /* and mark the list as empty */ - *dirPatchespp = NULL; + /* and mark the list as empty */ + *dirPatchespp = NULL; - return code; + return code; } long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { int attribute; - long nextCookie; - char *tp; - long code; - char *pathp; - cm_dirEntry_t *dep; - int maxCount; - smb_dirListPatch_t *dirListPatchesp; - smb_dirListPatch_t *curPatchp; - int dataLength; - cm_buf_t *bufferp; - long temp; - osi_hyper_t dirLength; - osi_hyper_t bufferOffset; - osi_hyper_t curOffset; - osi_hyper_t thyper; - unsigned char *inCookiep; - smb_dirSearch_t *dsp; - cm_scache_t *scp; - long entryInDir; - long entryInBuffer; - unsigned long clientCookie; + long nextCookie; + char *tp; + long code = 0; + char *pathp; + cm_dirEntry_t *dep; + int maxCount; + smb_dirListPatch_t *dirListPatchesp; + smb_dirListPatch_t *curPatchp; + int dataLength; + cm_buf_t *bufferp; + long temp; + osi_hyper_t dirLength; + osi_hyper_t bufferOffset; + osi_hyper_t curOffset; + osi_hyper_t thyper; + unsigned char *inCookiep; + smb_dirSearch_t *dsp; + cm_scache_t *scp; + long entryInDir; + long entryInBuffer; + unsigned long clientCookie; cm_pageHeader_t *pageHeaderp; - cm_user_t *userp = NULL; - int slotInPage; + cm_user_t *userp = NULL; + int slotInPage; char shortName[13]; char *actualName; char *shortNameEnd; - char mask[11]; - int returnedNames; - long nextEntryCookie; - int numDirChunks; /* # of 32 byte dir chunks in this entry */ - char resByte; /* reserved byte from the cookie */ - char *op; /* output data ptr */ - char *origOp; /* original value of op */ - cm_space_t *spacep; /* for pathname buffer */ - int starPattern; + char mask[11]; + int returnedNames; + long nextEntryCookie; + int numDirChunks; /* # of 32 byte dir chunks in this entry */ + char resByte; /* reserved byte from the cookie */ + char *op; /* output data ptr */ + char *origOp; /* original value of op */ + cm_space_t *spacep; /* for pathname buffer */ + int starPattern; int rootPath = 0; - int caseFold; + int caseFold; char *tidPathp; - cm_req_t req; - cm_fid_t fid; - int fileType; + cm_req_t req; + cm_fid_t fid; + int fileType; cm_InitReq(&req); - maxCount = smb_GetSMBParm(inp, 0); + maxCount = smb_GetSMBParm(inp, 0); - dirListPatchesp = NULL; + dirListPatchesp = NULL; - caseFold = CM_FLAG_CASEFOLD; + caseFold = CM_FLAG_CASEFOLD; tp = smb_GetSMBData(inp, NULL); - pathp = smb_ParseASCIIBlock(tp, &tp); - inCookiep = smb_ParseVblBlock(tp, &tp, &dataLength); - - /* bail out if request looks bad */ - if (!tp || !pathp) { - return CM_ERROR_BADSMB; - } + pathp = smb_ParseASCIIBlock(tp, &tp); + inCookiep = smb_ParseVblBlock(tp, &tp, &dataLength); + + /* bail out if request looks bad */ + if (!tp || !pathp) { + return CM_ERROR_BADSMB; + } /* We can handle long names */ if (vcp->flags & SMB_VCFLAG_USENT) ((smb_t *)outp)->flg2 |= 0x40; /* IS_LONG_NAME */ - + /* make sure we got a whole search status */ if (dataLength < 21) { - nextCookie = 0; /* start at the beginning of the dir */ - resByte = 0; - clientCookie = 0; + nextCookie = 0; /* start at the beginning of the dir */ + resByte = 0; + clientCookie = 0; attribute = smb_GetSMBParm(inp, 1); /* handle volume info in another function */ if (attribute & 0x8) return smb_ReceiveCoreSearchVolume(vcp, inp, outp); - osi_Log2(afsd_logp, "SMB receive search dir count %d |%s|", - maxCount, osi_LogSaveString(afsd_logp, pathp)); + osi_Log2(smb_logp, "SMB receive search dir count %d [%s]", + maxCount, osi_LogSaveString(smb_logp, pathp)); if (*pathp == 0) { /* null pathp, treat as root dir */ - if (!(attribute & 0x10)) /* exclude dirs */ + if (!(attribute & SMB_ATTR_DIRECTORY)) /* exclude dirs */ return CM_ERROR_NOFILES; rootPath = 1; } - dsp = smb_NewDirSearch(0); + dsp = smb_NewDirSearch(0); dsp->attribute = attribute; - smb_Get8Dot3MaskFromPath(mask, pathp); + smb_Get8Dot3MaskFromPath(mask, pathp); memcpy(dsp->mask, mask, 11); /* track if this is likely to match a lot of entries */ - if (smb_IsStarMask(mask)) starPattern = 1; - else starPattern = 0; - } + if (smb_IsStarMask(mask)) starPattern = 1; + else starPattern = 0; + } else { /* pull the next cookie value out of the search status block */ - nextCookie = inCookiep[13] + (inCookiep[14]<<8) + (inCookiep[15]<<16) - + (inCookiep[16]<<24); + nextCookie = inCookiep[13] + (inCookiep[14]<<8) + (inCookiep[15]<<16) + + (inCookiep[16]<<24); dsp = smb_FindDirSearch(inCookiep[12]); if (!dsp) { /* can't find dir search status; fatal error */ return CM_ERROR_BADFD; - } + } attribute = dsp->attribute; resByte = inCookiep[0]; /* copy out client cookie, in host byte order. Don't bother - * interpreting it, since we're just passing it through, anyway. - */ + * interpreting it, since we're just passing it through, anyway. + */ memcpy(&clientCookie, &inCookiep[17], 4); memcpy(mask, dsp->mask, 11); /* assume we're doing a star match if it has continued for more * than one call. - */ - starPattern = 1; - } + */ + starPattern = 1; + } - osi_Log3(afsd_logp, "SMB dir search cookie 0x%x, connection %d, attr 0x%x", - nextCookie, dsp->cookie, attribute); + osi_Log3(smb_logp, "SMB dir search cookie 0x%x, connection %d, attr 0x%x", + nextCookie, dsp->cookie, attribute); userp = smb_GetUser(vcp, inp); @@ -2901,27 +3138,27 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou lock_ObtainMutex(&dsp->mx); if (dsp->scp) { scp = dsp->scp; - cm_HoldSCache(scp); - code = 0; - } - else { + cm_HoldSCache(scp); + code = 0; + } + else { spacep = inp->spacep; - smb_StripLastComponent(spacep->data, NULL, pathp); - lock_ReleaseMutex(&dsp->mx); + smb_StripLastComponent(spacep->data, NULL, pathp); + lock_ReleaseMutex(&dsp->mx); tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); - code = cm_NameI(cm_rootSCachep, spacep->data, - caseFold | CM_FLAG_FOLLOW, userp, tidPathp, &req, &scp); - lock_ObtainMutex(&dsp->mx); + code = cm_NameI(cm_rootSCachep, spacep->data, + caseFold | CM_FLAG_FOLLOW, userp, tidPathp, &req, &scp); + lock_ObtainMutex(&dsp->mx); if (code == 0) { if (dsp->scp != 0) cm_ReleaseSCache(dsp->scp); dsp->scp = scp; /* we need one hold for the entry we just stored into, - * and one for our own processing. When we're done with this - * function, we'll drop the one for our own processing. - * We held it once from the namei call, and so we do another hold - * now. - */ - cm_HoldSCache(scp); + * and one for our own processing. When we're done with this + * function, we'll drop the one for our own processing. + * We held it once from the namei call, and so we do another hold + * now. + */ + cm_HoldSCache(scp); lock_ObtainMutex(&scp->mx); if ((scp->flags & CM_SCACHEFLAG_BULKSTATTING) == 0 && LargeIntegerGreaterOrEqualToZero(scp->bulkStatProgress)) { @@ -2930,179 +3167,180 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou } lock_ReleaseMutex(&scp->mx); } - } + } lock_ReleaseMutex(&dsp->mx); - if (code) { + if (code) { cm_ReleaseUser(userp); smb_DeleteDirSearch(dsp); smb_ReleaseDirSearch(dsp); - return code; - } + return code; + } /* reserves space for parameter; we'll adjust it again later to the - * real count of the # of entries we returned once we've actually - * assembled the directory listing. - */ + * real count of the # of entries we returned once we've actually + * assembled the directory listing. + */ smb_SetSMBParm(outp, 0, 0); - /* get the directory size */ + /* get the directory size */ lock_ObtainMutex(&scp->mx); - code = cm_SyncOp(scp, NULL, userp, &req, 0, - CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); + code = cm_SyncOp(scp, NULL, userp, &req, 0, + CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); if (code) { lock_ReleaseMutex(&scp->mx); - cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); + cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); smb_DeleteDirSearch(dsp); smb_ReleaseDirSearch(dsp); - return code; - } + return code; + } - dirLength = scp->length; - bufferp = NULL; - bufferOffset.LowPart = bufferOffset.HighPart = 0; - curOffset.HighPart = 0; - curOffset.LowPart = nextCookie; + dirLength = scp->length; + bufferp = NULL; + bufferOffset.LowPart = bufferOffset.HighPart = 0; + curOffset.HighPart = 0; + curOffset.LowPart = nextCookie; origOp = op = smb_GetSMBData(outp, NULL); - /* and write out the basic header */ - *op++ = 5; /* variable block */ - op += 2; /* skip vbl block length; we'll fill it in later */ - code = 0; - returnedNames = 0; - while (1) { + /* and write out the basic header */ + *op++ = 5; /* variable block */ + op += 2; /* skip vbl block length; we'll fill it in later */ + code = 0; + returnedNames = 0; + while (1) { /* make sure that curOffset.LowPart doesn't point to the first - * 32 bytes in the 2nd through last dir page, and that it doesn't - * point at the first 13 32-byte chunks in the first dir page, - * since those are dir and page headers, and don't contain useful - * information. - */ + * 32 bytes in the 2nd through last dir page, and that it doesn't + * point at the first 13 32-byte chunks in the first dir page, + * since those are dir and page headers, and don't contain useful + * information. + */ temp = curOffset.LowPart & (2048-1); - if (curOffset.HighPart == 0 && curOffset.LowPart < 2048) { + if (curOffset.HighPart == 0 && curOffset.LowPart < 2048) { /* we're in the first page */ - if (temp < 13*32) temp = 13*32; + if (temp < 13*32) temp = 13*32; } else { /* we're in a later dir page */ - if (temp < 32) temp = 32; - } + if (temp < 32) temp = 32; + } - /* make sure the low order 5 bits are zero */ - temp &= ~(32-1); - - /* now put temp bits back ito curOffset.LowPart */ - curOffset.LowPart &= ~(2048-1); - curOffset.LowPart |= temp; + /* make sure the low order 5 bits are zero */ + temp &= ~(32-1); + + /* now put temp bits back ito curOffset.LowPart */ + curOffset.LowPart &= ~(2048-1); + curOffset.LowPart |= temp; /* check if we've returned all the names that will fit in the - * response packet. - */ - if (returnedNames >= maxCount) break; - - /* check if we've passed the dir's EOF */ - if (LargeIntegerGreaterThanOrEqualTo(curOffset, dirLength)) break; + * response packet. + */ + if (returnedNames >= maxCount) + break; - /* see if we can use the bufferp we have now; compute in which page - * the current offset would be, and check whether that's the offset - * of the buffer we have. If not, get the buffer. + /* check if we've passed the dir's EOF */ + if (LargeIntegerGreaterThanOrEqualTo(curOffset, dirLength)) break; + + /* see if we can use the bufferp we have now; compute in which page + * the current offset would be, and check whether that's the offset + * of the buffer we have. If not, get the buffer. */ - thyper.HighPart = curOffset.HighPart; - thyper.LowPart = curOffset.LowPart & ~(buf_bufferSize-1); - if (!bufferp || !LargeIntegerEqualTo(thyper, bufferOffset)) { + thyper.HighPart = curOffset.HighPart; + thyper.LowPart = curOffset.LowPart & ~(buf_bufferSize-1); + if (!bufferp || !LargeIntegerEqualTo(thyper, bufferOffset)) { /* wrong buffer */ - if (bufferp) { - buf_Release(bufferp); - bufferp = NULL; - } + if (bufferp) { + buf_Release(bufferp); + bufferp = NULL; + } lock_ReleaseMutex(&scp->mx); lock_ObtainRead(&scp->bufCreateLock); - code = buf_Get(scp, &thyper, &bufferp); + code = buf_Get(scp, &thyper, &bufferp); lock_ReleaseRead(&scp->bufCreateLock); /* now, if we're doing a star match, do bulk fetching of all of - * the status info for files in the dir. - */ - if (starPattern) { + * the status info for files in the dir. + */ + if (starPattern) { smb_ApplyDirListPatches(&dirListPatchesp, userp, - &req); + &req); if ((dsp->flags & SMB_DIRSEARCH_BULKST) && LargeIntegerGreaterThanOrEqualTo(thyper, scp->bulkStatProgress)) { - /* Don't bulk stat if risking timeout */ - int now = GetCurrentTime(); - if (now - req.startTime > 5000) { - scp->bulkStatProgress = thyper; - scp->flags &= ~CM_SCACHEFLAG_BULKSTATTING; - dsp->flags &= ~SMB_DIRSEARCH_BULKST; - } else - cm_TryBulkStat(scp, &thyper, - userp, &req); + /* Don't bulk stat if risking timeout */ + int now = GetCurrentTime(); + if (now - req.startTime > 5000) { + scp->bulkStatProgress = thyper; + scp->flags &= ~CM_SCACHEFLAG_BULKSTATTING; + dsp->flags &= ~SMB_DIRSEARCH_BULKST; + } else + cm_TryBulkStat(scp, &thyper, userp, &req); } } - lock_ObtainMutex(&scp->mx); - if (code) break; - bufferOffset = thyper; + lock_ObtainMutex(&scp->mx); + if (code) + break; + bufferOffset = thyper; - /* now get the data in the cache */ - while (1) { + /* now get the data in the cache */ + while (1) { code = cm_SyncOp(scp, bufferp, userp, &req, - PRSFS_LOOKUP, - CM_SCACHESYNC_NEEDCALLBACK - | CM_SCACHESYNC_READ); + PRSFS_LOOKUP, + CM_SCACHESYNC_NEEDCALLBACK + | CM_SCACHESYNC_READ); if (code) break; - if (cm_HaveBuffer(scp, bufferp, 0)) break; - - /* otherwise, load the buffer and try again */ - code = cm_GetBuffer(scp, bufferp, NULL, userp, - &req); - if (code) break; - } - if (code) { + if (cm_HaveBuffer(scp, bufferp, 0)) break; + + /* otherwise, load the buffer and try again */ + code = cm_GetBuffer(scp, bufferp, NULL, userp, + &req); + if (code) break; + } + if (code) { buf_Release(bufferp); - bufferp = NULL; - break; + bufferp = NULL; + break; } - } /* if (wrong buffer) ... */ - - /* now we have the buffer containing the entry we're interested in; copy - * it out if it represents a non-deleted entry. - */ + } /* if (wrong buffer) ... */ + + /* now we have the buffer containing the entry we're interested in; copy + * it out if it represents a non-deleted entry. + */ entryInDir = curOffset.LowPart & (2048-1); - entryInBuffer = curOffset.LowPart & (buf_bufferSize - 1); + entryInBuffer = curOffset.LowPart & (buf_bufferSize - 1); /* page header will help tell us which entries are free. Page header - * can change more often than once per buffer, since AFS 3 dir page size - * may be less than (but not more than a buffer package buffer. - */ + * can change more often than once per buffer, since AFS 3 dir page size + * may be less than (but not more than a buffer package buffer. + */ temp = curOffset.LowPart & (buf_bufferSize - 1); /* only look intra-buffer */ - temp &= ~(2048 - 1); /* turn off intra-page bits */ + temp &= ~(2048 - 1); /* turn off intra-page bits */ pageHeaderp = (cm_pageHeader_t *) (bufferp->datap + temp); /* now determine which entry we're looking at in the page. If it is - * free (there's a free bitmap at the start of the dir), we should - * skip these 32 bytes. - */ - slotInPage = (entryInDir & 0x7e0) >> 5; - if (!(pageHeaderp->freeBitmap[slotInPage>>3] & (1 << (slotInPage & 0x7)))) { + * free (there's a free bitmap at the start of the dir), we should + * skip these 32 bytes. + */ + slotInPage = (entryInDir & 0x7e0) >> 5; + if (!(pageHeaderp->freeBitmap[slotInPage>>3] & (1 << (slotInPage & 0x7)))) { /* this entry is free */ - numDirChunks = 1; /* only skip this guy */ - goto nextEntry; - } + numDirChunks = 1; /* only skip this guy */ + goto nextEntry; + } tp = bufferp->datap + entryInBuffer; - dep = (cm_dirEntry_t *) tp; /* now points to AFS3 dir entry */ + dep = (cm_dirEntry_t *) tp; /* now points to AFS3 dir entry */ - /* while we're here, compute the next entry's location, too, + /* while we're here, compute the next entry's location, too, * since we'll need it when writing out the cookie into the dir * listing stream. - * - * XXXX Probably should do more sanity checking. - */ + * + * XXXX Probably should do more sanity checking. + */ numDirChunks = cm_NameEntries(dep->name, NULL); - /* compute the offset of the cookie representing the next entry */ - nextEntryCookie = curOffset.LowPart + (CM_DIR_CHUNKSIZE * numDirChunks); + /* compute the offset of the cookie representing the next entry */ + nextEntryCookie = curOffset.LowPart + (CM_DIR_CHUNKSIZE * numDirChunks); /* Compute 8.3 name if necessary */ actualName = dep->name; @@ -3111,38 +3349,43 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou actualName = shortName; } - if (dep->fid.vnode != 0 && smb_Match8Dot3Mask(actualName, mask)) { + if (dep->fid.vnode != 0 && smb_Match8Dot3Mask(actualName, mask)) { /* this is one of the entries to use: it is not deleted * and it matches the star pattern we're looking for. - */ - - /* Eliminate entries that don't match requested - attributes */ - if (!(dsp->attribute & 0x10)) /* no directories */ - { - /* We have already done the cm_TryBulkStat above */ - fid.cell = scp->fid.cell; - fid.volume = scp->fid.volume; - fid.vnode = ntohl(dep->fid.vnode); - fid.unique = ntohl(dep->fid.unique); - fileType = cm_FindFileType(&fid); - osi_Log2(afsd_logp, "smb_ReceiveCoreSearchDir: file %s " - "has filetype %d", dep->name, - fileType); - if (fileType == CM_SCACHETYPE_DIRECTORY) - goto nextEntry; - } + */ + + /* Eliminate entries that don't match requested + attributes */ + + /* no hidden files */ + if(smb_hideDotFiles && !(dsp->attribute & SMB_ATTR_HIDDEN) && smb_IsDotFile(actualName)) + goto nextEntry; + + if (!(dsp->attribute & SMB_ATTR_DIRECTORY)) /* no directories */ + { + /* We have already done the cm_TryBulkStat above */ + fid.cell = scp->fid.cell; + fid.volume = scp->fid.volume; + fid.vnode = ntohl(dep->fid.vnode); + fid.unique = ntohl(dep->fid.unique); + fileType = cm_FindFileType(&fid); + osi_Log2(smb_logp, "smb_ReceiveCoreSearchDir: file %s " + "has filetype %d", dep->name, + fileType); + if (fileType == CM_SCACHETYPE_DIRECTORY) + goto nextEntry; + } *op++ = resByte; - memcpy(op, mask, 11); op += 11; - *op++ = (char) dsp->cookie; /* they say it must be non-zero */ - *op++ = nextEntryCookie & 0xff; - *op++ = (nextEntryCookie>>8) & 0xff; - *op++ = (nextEntryCookie>>16) & 0xff; - *op++ = (nextEntryCookie>>24) & 0xff; - memcpy(op, &clientCookie, 4); op += 4; - - /* now we emit the attribute. This is sort of tricky, + memcpy(op, mask, 11); op += 11; + *op++ = (char) dsp->cookie; /* they say it must be non-zero */ + *op++ = nextEntryCookie & 0xff; + *op++ = (nextEntryCookie>>8) & 0xff; + *op++ = (nextEntryCookie>>16) & 0xff; + *op++ = (nextEntryCookie>>24) & 0xff; + memcpy(op, &clientCookie, 4); op += 4; + + /* now we emit the attribute. This is sort of tricky, * since we need to really stat the file to find out * what type of entry we've got. Right now, we're * copying out data from a buffer, while holding the @@ -3154,26 +3397,36 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou * record to make it easy to find this point later. * The replay will happen at a time when it is safe to * unlock the directory. - */ + */ curPatchp = malloc(sizeof(*curPatchp)); - osi_QAdd((osi_queue_t **) &dirListPatchesp, &curPatchp->q); - curPatchp->dptr = op; + osi_QAdd((osi_queue_t **) &dirListPatchesp, &curPatchp->q); + curPatchp->dptr = op; curPatchp->fid.cell = scp->fid.cell; - curPatchp->fid.volume = scp->fid.volume; - curPatchp->fid.vnode = ntohl(dep->fid.vnode); - curPatchp->fid.unique = ntohl(dep->fid.unique); + curPatchp->fid.volume = scp->fid.volume; + curPatchp->fid.vnode = ntohl(dep->fid.vnode); + curPatchp->fid.unique = ntohl(dep->fid.unique); + + /* do hidden attribute here since name won't be around when applying + * dir list patches + */ + + if ( smb_hideDotFiles && smb_IsDotFile(actualName) ) + curPatchp->flags = SMB_DIRLISTPATCH_DOTFILE; + else + curPatchp->flags = 0; + op += 9; /* skip attr, time, date and size */ - + /* zero out name area. The spec says to pad with * spaces, but Samba doesn't, and neither do we. */ memset(op, 0, 13); - /* finally, we get to copy out the name; we know that + /* finally, we get to copy out the name; we know that * it fits in 8.3 or the pattern wouldn't match, but it * never hurts to be sure. - */ - strncpy(op, actualName, 13); + */ + strncpy(op, actualName, 13); /* Uppercase if requested by client */ if ((((smb_t *)inp)->flg2 & 1) == 0) @@ -3181,31 +3434,31 @@ long smb_ReceiveCoreSearchDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou op += 13; - /* now, adjust the # of entries copied */ - returnedNames++; + /* now, adjust the # of entries copied */ + returnedNames++; } /* if we're including this name */ -nextEntry: - /* and adjust curOffset to be where the new cookie is */ + nextEntry: + /* and adjust curOffset to be where the new cookie is */ thyper.HighPart = 0; - thyper.LowPart = CM_DIR_CHUNKSIZE * numDirChunks; - curOffset = LargeIntegerAdd(thyper, curOffset); - } /* while copying data for dir listing */ + thyper.LowPart = CM_DIR_CHUNKSIZE * numDirChunks; + curOffset = LargeIntegerAdd(thyper, curOffset); + } /* while copying data for dir listing */ /* release the mutex */ lock_ReleaseMutex(&scp->mx); - if (bufferp) buf_Release(bufferp); + if (bufferp) buf_Release(bufferp); /* apply and free last set of patches; if not doing a star match, this - * will be empty, but better safe (and freeing everything) than sorry. - */ - smb_ApplyDirListPatches(&dirListPatchesp, userp, &req); + * will be empty, but better safe (and freeing everything) than sorry. + */ + smb_ApplyDirListPatches(&dirListPatchesp, userp, &req); /* special return code for unsuccessful search */ if (code == 0 && dataLength < 21 && returnedNames == 0) code = CM_ERROR_NOFILES; - osi_Log2(afsd_logp, "SMB search dir done, %d names, code %d", + osi_Log2(smb_logp, "SMB search dir done, %d names, code %d", returnedNames, code); if (code != 0) { @@ -3216,26 +3469,26 @@ nextEntry: return code; } - /* finalize the output buffer */ - smb_SetSMBParm(outp, 0, returnedNames); + /* finalize the output buffer */ + smb_SetSMBParm(outp, 0, returnedNames); temp = (long) (op - origOp); - smb_SetSMBDataLength(outp, temp); + smb_SetSMBDataLength(outp, temp); /* the data area is a variable block, which has a 5 (already there) * followed by the length of the # of data bytes. We now know this to * be "temp," although that includes the 3 bytes of vbl block header. * Deduct for them and fill in the length field. - */ + */ temp -= 3; /* deduct vbl block info */ - osi_assert(temp == (43 * returnedNames)); - origOp[1] = temp & 0xff; - origOp[2] = (temp>>8) & 0xff; - if (returnedNames == 0) smb_DeleteDirSearch(dsp); - smb_ReleaseDirSearch(dsp); - cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); - return code; -} + osi_assert(temp == (43 * returnedNames)); + origOp[1] = temp & 0xff; + origOp[2] = (temp>>8) & 0xff; + if (returnedNames == 0) smb_DeleteDirSearch(dsp); + smb_ReleaseDirSearch(dsp); + cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); + return code; +} /* verify that this is a valid path to a directory. I don't know why they * don't use the get file attributes call. @@ -3243,76 +3496,76 @@ nextEntry: long smb_ReceiveCoreCheckPath(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { char *pathp; - long code; - cm_scache_t *rootScp; + long code = 0; + cm_scache_t *rootScp; cm_scache_t *newScp; - cm_user_t *userp; - unsigned int attrs; - int caseFold; + cm_user_t *userp; + unsigned int attrs; + int caseFold; char *tidPathp; cm_req_t req; cm_InitReq(&req); - pathp = smb_GetSMBData(inp, NULL); - pathp = smb_ParseASCIIBlock(pathp, NULL); - osi_Log1(afsd_logp, "SMB receive check path %s", - osi_LogSaveString(afsd_logp, pathp)); - - if (!pathp) { + pathp = smb_GetSMBData(inp, NULL); + pathp = smb_ParseASCIIBlock(pathp, NULL); + osi_Log1(smb_logp, "SMB receive check path %s", + osi_LogSaveString(smb_logp, pathp)); + + if (!pathp) { return CM_ERROR_BADFD; } - rootScp = cm_rootSCachep; + rootScp = cm_rootSCachep; userp = smb_GetUser(vcp, inp); - caseFold = CM_FLAG_CASEFOLD; + caseFold = CM_FLAG_CASEFOLD; tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); - code = cm_NameI(rootScp, pathp, - caseFold | CM_FLAG_FOLLOW | CM_FLAG_CHECKPATH, - userp, tidPathp, &req, &newScp); + code = cm_NameI(rootScp, pathp, + caseFold | CM_FLAG_FOLLOW | CM_FLAG_CHECKPATH, + userp, tidPathp, &req, &newScp); - if (code) { + if (code) { cm_ReleaseUser(userp); - return code; - } + return code; + } /* now lock the vnode with a callback; returns with newScp locked */ lock_ObtainMutex(&newScp->mx); - code = cm_SyncOp(newScp, NULL, userp, &req, PRSFS_LOOKUP, - CM_SCACHESYNC_GETSTATUS | CM_SCACHESYNC_NEEDCALLBACK); - if (code && code != CM_ERROR_NOACCESS) { + code = cm_SyncOp(newScp, NULL, userp, &req, PRSFS_LOOKUP, + CM_SCACHESYNC_GETSTATUS | CM_SCACHESYNC_NEEDCALLBACK); + if (code && code != CM_ERROR_NOACCESS) { lock_ReleaseMutex(&newScp->mx); - cm_ReleaseSCache(newScp); - cm_ReleaseUser(userp); - return code; - } + cm_ReleaseSCache(newScp); + cm_ReleaseUser(userp); + return code; + } attrs = smb_Attributes(newScp); if (!(attrs & 0x10)) - code = CM_ERROR_NOTDIR; + code = CM_ERROR_NOTDIR; - lock_ReleaseMutex(&newScp->mx); - - cm_ReleaseSCache(newScp); - cm_ReleaseUser(userp); - return code; -} + lock_ReleaseMutex(&newScp->mx); + + cm_ReleaseSCache(newScp); + cm_ReleaseUser(userp); + return code; +} long smb_ReceiveCoreSetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { char *pathp; - long code; - cm_scache_t *rootScp; - unsigned short attribute; - cm_attr_t attr; + long code = 0; + cm_scache_t *rootScp; + unsigned short attribute; + cm_attr_t attr; cm_scache_t *newScp; - long dosTime; - cm_user_t *userp; - int caseFold; + long dosTime; + cm_user_t *userp; + int caseFold; char *tidPathp; cm_req_t req; @@ -3320,46 +3573,46 @@ long smb_ReceiveCoreSetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack /* decode basic attributes we're passed */ attribute = smb_GetSMBParm(inp, 0); - dosTime = smb_GetSMBParm(inp, 1) | (smb_GetSMBParm(inp, 2) << 16); + dosTime = smb_GetSMBParm(inp, 1) | (smb_GetSMBParm(inp, 2) << 16); - pathp = smb_GetSMBData(inp, NULL); - pathp = smb_ParseASCIIBlock(pathp, NULL); + pathp = smb_GetSMBData(inp, NULL); + pathp = smb_ParseASCIIBlock(pathp, NULL); - if (!pathp) { + if (!pathp) { return CM_ERROR_BADSMB; } - osi_Log2(afsd_logp, "SMB receive setfile attributes time %d, attr 0x%x", - dosTime, attribute); + osi_Log2(smb_logp, "SMB receive setfile attributes time %d, attr 0x%x", + dosTime, attribute); - rootScp = cm_rootSCachep; + rootScp = cm_rootSCachep; userp = smb_GetUser(vcp, inp); caseFold = CM_FLAG_CASEFOLD; tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); - code = cm_NameI(rootScp, pathp, caseFold | CM_FLAG_FOLLOW, userp, - tidPathp, &req, &newScp); + code = cm_NameI(rootScp, pathp, caseFold | CM_FLAG_FOLLOW, userp, + tidPathp, &req, &newScp); - if (code) { - cm_ReleaseUser(userp); - return code; - } + if (code) { + cm_ReleaseUser(userp); + return code; + } /* now lock the vnode with a callback; returns with newScp locked; we * need the current status to determine what the new status is, in some * cases. - */ + */ lock_ObtainMutex(&newScp->mx); - code = cm_SyncOp(newScp, NULL, userp, &req, 0, - CM_SCACHESYNC_GETSTATUS | CM_SCACHESYNC_NEEDCALLBACK); - if (code) { + code = cm_SyncOp(newScp, NULL, userp, &req, 0, + CM_SCACHESYNC_GETSTATUS | CM_SCACHESYNC_NEEDCALLBACK); + if (code) { lock_ReleaseMutex(&newScp->mx); - cm_ReleaseSCache(newScp); - cm_ReleaseUser(userp); - return code; - } + cm_ReleaseSCache(newScp); + cm_ReleaseUser(userp); + return code; + } /* Check for RO volume */ if (newScp->flags & CM_SCACHEFLAG_RO) { @@ -3372,43 +3625,43 @@ long smb_ReceiveCoreSetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack /* prepare for setattr call */ attr.mask = 0; if (dosTime != 0) { - attr.mask |= CM_ATTRMASK_CLIENTMODTIME; - smb_UnixTimeFromDosUTime(&attr.clientModTime, dosTime); + attr.mask |= CM_ATTRMASK_CLIENTMODTIME; + smb_UnixTimeFromDosUTime(&attr.clientModTime, dosTime); } if ((newScp->unixModeBits & 0222) && (attribute & 1) != 0) { /* we're told to make a writable file read-only */ - attr.unixModeBits = newScp->unixModeBits & ~0222; - attr.mask |= CM_ATTRMASK_UNIXMODEBITS; - } + attr.unixModeBits = newScp->unixModeBits & ~0222; + attr.mask |= CM_ATTRMASK_UNIXMODEBITS; + } else if ((newScp->unixModeBits & 0222) == 0 && (attribute & 1) == 0) { /* we're told to make a read-only file writable */ - attr.unixModeBits = newScp->unixModeBits | 0222; - attr.mask |= CM_ATTRMASK_UNIXMODEBITS; - } - lock_ReleaseMutex(&newScp->mx); + attr.unixModeBits = newScp->unixModeBits | 0222; + attr.mask |= CM_ATTRMASK_UNIXMODEBITS; + } + lock_ReleaseMutex(&newScp->mx); /* now call setattr */ if (attr.mask) - code = cm_SetAttr(newScp, &attr, userp, &req); + code = cm_SetAttr(newScp, &attr, userp, &req); else code = 0; - cm_ReleaseSCache(newScp); + cm_ReleaseSCache(newScp); cm_ReleaseUser(userp); - return code; + return code; } long smb_ReceiveCoreGetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { char *pathp; - long code; - cm_scache_t *rootScp; + long code = 0; + cm_scache_t *rootScp; cm_scache_t *newScp, *dscp; - long dosTime; - int attrs; - cm_user_t *userp; - int caseFold; + long dosTime; + int attrs; + cm_user_t *userp; + int caseFold; char *tidPathp; cm_space_t *spacep; char *lastComp; @@ -3416,25 +3669,25 @@ long smb_ReceiveCoreGetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack cm_InitReq(&req); - pathp = smb_GetSMBData(inp, NULL); - pathp = smb_ParseASCIIBlock(pathp, NULL); + pathp = smb_GetSMBData(inp, NULL); + pathp = smb_ParseASCIIBlock(pathp, NULL); - if (!pathp) { + if (!pathp) { return CM_ERROR_BADSMB; } if (*pathp == 0) /* null path */ pathp = "\\"; - osi_Log1(afsd_logp, "SMB receive getfile attributes path %s", - osi_LogSaveString(afsd_logp, pathp)); + osi_Log1(smb_logp, "SMB receive getfile attributes path %s", + osi_LogSaveString(smb_logp, pathp)); - rootScp = cm_rootSCachep; + rootScp = cm_rootSCachep; userp = smb_GetUser(vcp, inp); /* we shouldn't need this for V3 requests, but we seem to */ - caseFold = CM_FLAG_CASEFOLD; + caseFold = CM_FLAG_CASEFOLD; tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); @@ -3451,13 +3704,16 @@ long smb_ReceiveCoreGetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack * to explicitly ignore the requests for mount points that haven't * yet been evaluated and for directories that haven't yet been * fetched. + * + * We should modify this hack to provide a fake desktop.ini file + * http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_extending/custom.asp */ spacep = inp->spacep; smb_StripLastComponent(spacep->data, &lastComp, pathp); - if (strcmp(lastComp, "\\desktop.ini") == 0) { + if (lastComp && stricmp(lastComp, "\\desktop.ini") == 0) { code = cm_NameI(rootScp, spacep->data, - caseFold | CM_FLAG_DIRSEARCH | CM_FLAG_FOLLOW, - userp, tidPathp, &req, &dscp); + caseFold | CM_FLAG_DIRSEARCH | CM_FLAG_FOLLOW, + userp, tidPathp, &req, &dscp); if (code == 0) { if (dscp->fileType == CM_SCACHETYPE_MOUNTPOINT && !dscp->mountRootFidp) @@ -3477,67 +3733,75 @@ long smb_ReceiveCoreGetFileAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_pack } } - code = cm_NameI(rootScp, pathp, caseFold | CM_FLAG_FOLLOW, userp, - tidPathp, &req, &newScp); + code = cm_NameI(rootScp, pathp, caseFold | CM_FLAG_FOLLOW, userp, + tidPathp, &req, &newScp); - if (code) { - cm_ReleaseUser(userp); - return code; - } + if (code) { + cm_ReleaseUser(userp); + return code; + } /* now lock the vnode with a callback; returns with newScp locked */ lock_ObtainMutex(&newScp->mx); - code = cm_SyncOp(newScp, NULL, userp, &req, 0, - CM_SCACHESYNC_GETSTATUS | CM_SCACHESYNC_NEEDCALLBACK); - if (code) { + code = cm_SyncOp(newScp, NULL, userp, &req, 0, + CM_SCACHESYNC_GETSTATUS | CM_SCACHESYNC_NEEDCALLBACK); + if (code) { lock_ReleaseMutex(&newScp->mx); - cm_ReleaseSCache(newScp); - cm_ReleaseUser(userp); - return code; - } + cm_ReleaseSCache(newScp); + cm_ReleaseUser(userp); + return code; + } +#ifdef undef + /* use smb_Attributes instead. Also the fact that a file is + * in a readonly volume doesn't mean it shojuld be marked as RO + */ if (newScp->fileType == CM_SCACHETYPE_DIRECTORY - || newScp->fileType == CM_SCACHETYPE_MOUNTPOINT) - attrs = 0x10; + || newScp->fileType == CM_SCACHETYPE_MOUNTPOINT) + attrs = SMB_ATTR_DIRECTORY; else - attrs = 0; + attrs = 0; if ((newScp->unixModeBits & 0222) == 0 || (newScp->flags & CM_SCACHEFLAG_RO)) - attrs |= 1; /* turn on read-only flag */ - smb_SetSMBParm(outp, 0, attrs); - - smb_DosUTimeFromUnixTime(&dosTime, newScp->clientModTime); - smb_SetSMBParm(outp, 1, dosTime & 0xffff); - smb_SetSMBParm(outp, 2, (dosTime>>16) & 0xffff); - smb_SetSMBParm(outp, 3, newScp->length.LowPart & 0xffff); - smb_SetSMBParm(outp, 4, (newScp->length.LowPart >> 16) & 0xffff); - smb_SetSMBParm(outp, 5, 0); - smb_SetSMBParm(outp, 6, 0); - smb_SetSMBParm(outp, 7, 0); - smb_SetSMBParm(outp, 8, 0); - smb_SetSMBParm(outp, 9, 0); - smb_SetSMBDataLength(outp, 0); - lock_ReleaseMutex(&newScp->mx); - - cm_ReleaseSCache(newScp); - cm_ReleaseUser(userp); + attrs |= SMB_ATTR_READONLY; /* turn on read-only flag */ +#else + attrs = smb_Attributes(newScp); +#endif + + smb_SetSMBParm(outp, 0, attrs); + + smb_DosUTimeFromUnixTime(&dosTime, newScp->clientModTime); + smb_SetSMBParm(outp, 1, dosTime & 0xffff); + smb_SetSMBParm(outp, 2, (dosTime>>16) & 0xffff); + smb_SetSMBParm(outp, 3, newScp->length.LowPart & 0xffff); + smb_SetSMBParm(outp, 4, (newScp->length.LowPart >> 16) & 0xffff); + smb_SetSMBParm(outp, 5, 0); + smb_SetSMBParm(outp, 6, 0); + smb_SetSMBParm(outp, 7, 0); + smb_SetSMBParm(outp, 8, 0); + smb_SetSMBParm(outp, 9, 0); + smb_SetSMBDataLength(outp, 0); + lock_ReleaseMutex(&newScp->mx); + + cm_ReleaseSCache(newScp); + cm_ReleaseUser(userp); - return 0; -} + return 0; +} long smb_ReceiveCoreTreeDisconnect(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { - smb_tid_t *tidp; + smb_tid_t *tidp; - osi_Log0(afsd_logp, "SMB receive tree disconnect"); + osi_Log0(smb_logp, "SMB receive tree disconnect"); /* find the tree and free it */ - tidp = smb_FindTID(vcp, ((smb_t *)inp)->tid, 0); - if (tidp) { + tidp = smb_FindTID(vcp, ((smb_t *)inp)->tid, 0); + if (tidp) { lock_ObtainMutex(&tidp->mx); tidp->flags |= SMB_TIDFLAG_DELETE; - lock_ReleaseMutex(&tidp->mx); + lock_ReleaseMutex(&tidp->mx); smb_ReleaseTID(tidp); - } + } return 0; } @@ -3545,64 +3809,74 @@ long smb_ReceiveCoreTreeDisconnect(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_ long smb_ReceiveCoreOpen(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { smb_fid_t *fidp; - char *pathp; + char *pathp; char *lastNamep; - int share; - int attribute; - long code; - cm_user_t *userp; - cm_scache_t *scp; - long dosTime; - int caseFold; + int share; + int attribute; + long code = 0; + cm_user_t *userp; + cm_scache_t *scp; + long dosTime; + int caseFold; cm_space_t *spacep; char *tidPathp; cm_req_t req; cm_InitReq(&req); - osi_Log0(afsd_logp, "SMB receive open"); - - pathp = smb_GetSMBData(inp, NULL); - pathp = smb_ParseASCIIBlock(pathp, NULL); + pathp = smb_GetSMBData(inp, NULL); + pathp = smb_ParseASCIIBlock(pathp, NULL); + osi_Log1(smb_logp, "SMB receive open file [%s]", osi_LogSaveString(smb_logp, pathp)); + +#ifdef DEBUG_VERBOSE + { + char *hexpath; + + hexpath = osi_HexifyString( pathp ); + DEBUG_EVENT2("AFS", "CoreOpen H[%s] A[%s]", hexpath, pathp); + free(hexpath); + } +#endif + share = smb_GetSMBParm(inp, 0); - attribute = smb_GetSMBParm(inp, 1); + attribute = smb_GetSMBParm(inp, 1); spacep = inp->spacep; smb_StripLastComponent(spacep->data, &lastNamep, pathp); if (lastNamep && strcmp(lastNamep, SMB_IOCTL_FILENAME) == 0) { /* special case magic file name for receiving IOCTL requests - * (since IOCTL calls themselves aren't getting through). - */ - fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); + * (since IOCTL calls themselves aren't getting through). + */ + fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); smb_SetupIoctlFid(fidp, spacep); smb_SetSMBParm(outp, 0, fidp->fid); - smb_SetSMBParm(outp, 1, 0); /* attrs */ - smb_SetSMBParm(outp, 2, 0); /* next 2 are DOS time */ - smb_SetSMBParm(outp, 3, 0); - smb_SetSMBParm(outp, 4, 0); /* next 2 are length */ - smb_SetSMBParm(outp, 5, 0x7fff); + smb_SetSMBParm(outp, 1, 0); /* attrs */ + smb_SetSMBParm(outp, 2, 0); /* next 2 are DOS time */ + smb_SetSMBParm(outp, 3, 0); + smb_SetSMBParm(outp, 4, 0); /* next 2 are length */ + smb_SetSMBParm(outp, 5, 0x7fff); /* pass the open mode back */ - smb_SetSMBParm(outp, 6, (share & 0xf)); - smb_SetSMBDataLength(outp, 0); - smb_ReleaseFID(fidp); - return 0; - } + smb_SetSMBParm(outp, 6, (share & 0xf)); + smb_SetSMBDataLength(outp, 0); + smb_ReleaseFID(fidp); + return 0; + } userp = smb_GetUser(vcp, inp); caseFold = CM_FLAG_CASEFOLD; tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); - code = cm_NameI(cm_rootSCachep, pathp, caseFold | CM_FLAG_FOLLOW, userp, - tidPathp, &req, &scp); + code = cm_NameI(cm_rootSCachep, pathp, caseFold | CM_FLAG_FOLLOW, userp, + tidPathp, &req, &scp); - if (code) { - cm_ReleaseUser(userp); + if (code) { + cm_ReleaseUser(userp); return code; } - code = cm_CheckOpen(scp, share & 0x7, 0, userp, &req); + code = cm_CheckOpen(scp, share & 0x7, 0, userp, &req); if (code) { cm_ReleaseSCache(scp); cm_ReleaseUser(userp); @@ -3612,47 +3886,47 @@ long smb_ReceiveCoreOpen(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) /* don't need callback to check file type, since file types never * change, and namei and cm_Lookup all stat the object at least once on * a successful return. - */ - if (scp->fileType != CM_SCACHETYPE_FILE) { + */ + if (scp->fileType != CM_SCACHETYPE_FILE) { cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); - return CM_ERROR_ISDIR; - } + cm_ReleaseUser(userp); + return CM_ERROR_ISDIR; + } - fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); - osi_assert(fidp); + fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); + osi_assert(fidp); /* save a pointer to the vnode */ - fidp->scp = scp; - - if ((share & 0xf) == 0) - fidp->flags |= SMB_FID_OPENREAD; + fidp->scp = scp; + + if ((share & 0xf) == 0) + fidp->flags |= SMB_FID_OPENREAD; else if ((share & 0xf) == 1) - fidp->flags |= SMB_FID_OPENWRITE; - else fidp->flags |= (SMB_FID_OPENREAD | SMB_FID_OPENWRITE); + fidp->flags |= SMB_FID_OPENWRITE; + else + fidp->flags |= (SMB_FID_OPENREAD | SMB_FID_OPENWRITE); lock_ObtainMutex(&scp->mx); smb_SetSMBParm(outp, 0, fidp->fid); - smb_SetSMBParm(outp, 1, smb_Attributes(scp)); + smb_SetSMBParm(outp, 1, smb_Attributes(scp)); smb_DosUTimeFromUnixTime(&dosTime, scp->clientModTime); - smb_SetSMBParm(outp, 2, dosTime & 0xffff); - smb_SetSMBParm(outp, 3, (dosTime >> 16) & 0xffff); - smb_SetSMBParm(outp, 4, scp->length.LowPart & 0xffff); - smb_SetSMBParm(outp, 5, (scp->length.LowPart >> 16) & 0xffff); + smb_SetSMBParm(outp, 2, dosTime & 0xffff); + smb_SetSMBParm(outp, 3, (dosTime >> 16) & 0xffff); + smb_SetSMBParm(outp, 4, scp->length.LowPart & 0xffff); + smb_SetSMBParm(outp, 5, (scp->length.LowPart >> 16) & 0xffff); /* pass the open mode back; XXXX add access checks */ - smb_SetSMBParm(outp, 6, (share & 0xf)); - smb_SetSMBDataLength(outp, 0); + smb_SetSMBParm(outp, 6, (share & 0xf)); + smb_SetSMBDataLength(outp, 0); lock_ReleaseMutex(&scp->mx); /* notify open */ - cm_Open(scp, 0, userp); + cm_Open(scp, 0, userp); /* send and free packet */ - smb_ReleaseFID(fidp); - cm_ReleaseUser(userp); - /* don't release scp, since we've squirreled away the pointer in the fid struct */ - - return 0; + smb_ReleaseFID(fidp); + cm_ReleaseUser(userp); + /* don't release scp, since we've squirreled away the pointer in the fid struct */ + return 0; } typedef struct smb_unlinkRock { @@ -3661,79 +3935,83 @@ typedef struct smb_unlinkRock { cm_req_t *reqp; smb_vc_t *vcp; char *maskp; /* pointer to the star pattern */ - int hasTilde; + int flags; int any; } smb_unlinkRock_t; int smb_UnlinkProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp) { - long code; - smb_unlinkRock_t *rockp; - int caseFold; + long code = 0; + smb_unlinkRock_t *rockp; + int caseFold; int match; char shortName[13]; char *matchName; - rockp = vrockp; + rockp = vrockp; - if (rockp->vcp->flags & SMB_VCFLAG_USEV3) - caseFold = CM_FLAG_CASEFOLD; - else - caseFold = CM_FLAG_CASEFOLD | CM_FLAG_8DOT3; + caseFold = ((rockp->flags & SMB_MASKFLAG_CASEFOLD)? CM_FLAG_CASEFOLD : 0); + if (!(rockp->vcp->flags & SMB_VCFLAG_USEV3)) + caseFold |= CM_FLAG_8DOT3; matchName = dep->name; match = smb_V3MatchMask(matchName, rockp->maskp, caseFold); if (!match - && rockp->hasTilde + && (rockp->flags & SMB_MASKFLAG_TILDE) && !cm_Is8Dot3(dep->name)) { cm_Gen8Dot3Name(dep, shortName, NULL); matchName = shortName; - match = smb_V3MatchMask(matchName, rockp->maskp, caseFold); + /* 8.3 matches are always case insensitive */ + match = smb_V3MatchMask(matchName, rockp->maskp, caseFold | CM_FLAG_CASEFOLD); } if (match) { osi_Log1(smb_logp, "Unlinking %s", - osi_LogSaveString(smb_logp, matchName)); - code = cm_Unlink(dscp, dep->name, rockp->userp, rockp->reqp); + osi_LogSaveString(smb_logp, matchName)); + code = cm_Unlink(dscp, dep->name, rockp->userp, rockp->reqp); if (code == 0 && (dscp->flags & CM_SCACHEFLAG_ANYWATCH)) smb_NotifyChange(FILE_ACTION_REMOVED, - FILE_NOTIFY_CHANGE_FILE_NAME, - dscp, dep->name, NULL, TRUE); - if (code == 0) + FILE_NOTIFY_CHANGE_FILE_NAME, + dscp, dep->name, NULL, TRUE); + if (code == 0) { rockp->any = 1; + /* If we made a case sensitive exact match, we might as well quit now. */ + if(!(rockp->flags & SMB_MASKFLAG_CASEFOLD) && !strcmp(matchName, rockp->maskp)) + code = CM_ERROR_STOPNOW; + } } - else code = 0; + else code = 0; - return code; + return code; } long smb_ReceiveCoreUnlink(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { int attribute; - long code; - char *pathp; - char *tp; - cm_space_t *spacep; - cm_scache_t *dscp; - char *lastNamep; - smb_unlinkRock_t rock; - cm_user_t *userp; - osi_hyper_t thyper; - int caseFold; + long code = 0; + char *pathp; + char *tp; + cm_space_t *spacep; + cm_scache_t *dscp; + char *lastNamep; + smb_unlinkRock_t rock; + cm_user_t *userp; + osi_hyper_t thyper; + int caseFold; char *tidPathp; - cm_req_t req; + cm_req_t req; cm_InitReq(&req); - attribute = smb_GetSMBParm(inp, 0); + attribute = smb_GetSMBParm(inp, 0); tp = smb_GetSMBData(inp, NULL); - pathp = smb_ParseASCIIBlock(tp, &tp); + pathp = smb_ParseASCIIBlock(tp, &tp); osi_Log1(smb_logp, "SMB receive unlink %s", - osi_LogSaveString(smb_logp, pathp)); + osi_LogSaveString(smb_logp, pathp)); spacep = inp->spacep; - smb_StripLastComponent(spacep->data, &lastNamep, pathp); + smb_StripLastComponent(spacep->data, &lastNamep, pathp); userp = smb_GetUser(vcp, inp); @@ -3741,102 +4019,122 @@ long smb_ReceiveCoreUnlink(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); code = cm_NameI(cm_rootSCachep, spacep->data, caseFold, userp, tidPathp, - &req, &dscp); + &req, &dscp); - if (code) { - cm_ReleaseUser(userp); - return code; - } + if (code) { + cm_ReleaseUser(userp); + return code; + } - /* otherwise, scp points to the parent directory. - */ - if (!lastNamep) lastNamep = pathp; - else lastNamep++; + /* otherwise, scp points to the parent directory. */ + if (!lastNamep) + lastNamep = pathp; + else + lastNamep++; rock.any = 0; - rock.maskp = smb_FindMask(pathp); - rock.hasTilde = ((strchr(rock.maskp, '~') != NULL) ? 1 : 0); + rock.maskp = smb_FindMask(pathp); + rock.flags = ((strchr(rock.maskp, '~') != NULL) ? SMB_MASKFLAG_TILDE : 0); thyper.LowPart = 0; - thyper.HighPart = 0; + thyper.HighPart = 0; rock.userp = userp; rock.reqp = &req; - rock.dscp = dscp; - rock.vcp = vcp; + rock.dscp = dscp; + rock.vcp = vcp; + + /* Now, if we aren't dealing with a wildcard match, we first try an exact + * match. If that fails, we do a case insensitve match. + */ + if (!(rock.flags & SMB_MASKFLAG_TILDE) && + !smb_IsStarMask(rock.maskp)) { code = cm_ApplyDir(dscp, smb_UnlinkProc, &rock, &thyper, userp, &req, NULL); + if(!rock.any) { + thyper.LowPart = 0; + thyper.HighPart = 0; + rock.flags |= SMB_MASKFLAG_CASEFOLD; + } + } + + if (!rock.any) + code = cm_ApplyDir(dscp, smb_UnlinkProc, &rock, &thyper, userp, &req, NULL); + + if (code == CM_ERROR_STOPNOW) + code = 0; - cm_ReleaseUser(userp); + cm_ReleaseUser(userp); - cm_ReleaseSCache(dscp); + cm_ReleaseSCache(dscp); - if (code == 0 && !rock.any) + if (code == 0 && !rock.any) code = CM_ERROR_NOSUCHFILE; - return code; + return code; } typedef struct smb_renameRock { - cm_scache_t *odscp; /* old dir */ - cm_scache_t *ndscp; /* new dir */ - cm_user_t *userp; /* user */ + cm_scache_t *odscp; /* old dir */ + cm_scache_t *ndscp; /* new dir */ + cm_user_t *userp; /* user */ cm_req_t *reqp; /* request struct */ - smb_vc_t *vcp; /* virtual circuit */ + smb_vc_t *vcp; /* virtual circuit */ char *maskp; /* pointer to star pattern of old file name */ - int hasTilde; /* star pattern might be shortname? */ - char *newNamep; /* ptr to the new file's name */ + int flags; /* tilde, casefold, etc */ + char *newNamep; /* ptr to the new file's name */ } smb_renameRock_t; int smb_RenameProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp) { - long code; - smb_renameRock_t *rockp; - int caseFold; + long code = 0; + smb_renameRock_t *rockp; + int caseFold; int match; char shortName[13]; - rockp = vrockp; + rockp = (smb_renameRock_t *) vrockp; - if (rockp->vcp->flags & SMB_VCFLAG_USEV3) - caseFold = CM_FLAG_CASEFOLD; - else - caseFold = CM_FLAG_CASEFOLD | CM_FLAG_8DOT3; + caseFold = ((rockp->flags & SMB_MASKFLAG_CASEFOLD)? CM_FLAG_CASEFOLD : 0); + if (!(rockp->vcp->flags & SMB_VCFLAG_USEV3)) + caseFold |= CM_FLAG_8DOT3; match = smb_V3MatchMask(dep->name, rockp->maskp, caseFold); if (!match - && rockp->hasTilde + && (rockp->flags & SMB_MASKFLAG_TILDE) && !cm_Is8Dot3(dep->name)) { cm_Gen8Dot3Name(dep, shortName, NULL); match = smb_V3MatchMask(shortName, rockp->maskp, caseFold); } if (match) { - code = cm_Rename(rockp->odscp, dep->name, - rockp->ndscp, rockp->newNamep, rockp->userp, - rockp->reqp); + code = cm_Rename(rockp->odscp, dep->name, + rockp->ndscp, rockp->newNamep, rockp->userp, + rockp->reqp); /* if the call worked, stop doing the search now, since we * really only want to rename one file. - */ - if (code == 0) code = CM_ERROR_STOPNOW; + */ + if (code == 0) + code = CM_ERROR_STOPNOW; } - else code = 0; + else code = 0; - return code; + return code; } long smb_ReceiveCoreRename(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { - long code; - char *oldPathp; - char *newPathp; - char *tp; - cm_space_t *spacep; - smb_renameRock_t rock; - cm_scache_t *oldDscp; - cm_scache_t *newDscp; - cm_scache_t *tmpscp; - char *oldLastNamep; - char *newLastNamep; - osi_hyper_t thyper; - cm_user_t *userp; - int caseFold; + long code = 0; + char *oldPathp; + char *newPathp; + char *tp; + cm_space_t *spacep = NULL; + smb_renameRock_t rock; + cm_scache_t *oldDscp = NULL; + cm_scache_t *newDscp = NULL; + cm_scache_t *tmpscp= NULL; + cm_scache_t *tmpscp2 = NULL; + char *oldLastNamep; + char *newLastNamep; + osi_hyper_t thyper; + cm_user_t *userp; + int caseFold; char *tidPathp; DWORD filter; cm_req_t req; @@ -3844,88 +4142,122 @@ long smb_ReceiveCoreRename(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) cm_InitReq(&req); tp = smb_GetSMBData(inp, NULL); - oldPathp = smb_ParseASCIIBlock(tp, &tp); - newPathp = smb_ParseASCIIBlock(tp, &tp); + oldPathp = smb_ParseASCIIBlock(tp, &tp); + newPathp = smb_ParseASCIIBlock(tp, &tp); - osi_Log2(afsd_logp, "smb rename %s to %s", - osi_LogSaveString(afsd_logp, oldPathp), - osi_LogSaveString(afsd_logp, newPathp)); + osi_Log2(smb_logp, "smb rename [%s] to [%s]", + osi_LogSaveString(smb_logp, oldPathp), + osi_LogSaveString(smb_logp, newPathp)); spacep = inp->spacep; - smb_StripLastComponent(spacep->data, &oldLastNamep, oldPathp); + smb_StripLastComponent(spacep->data, &oldLastNamep, oldPathp); userp = smb_GetUser(vcp, inp); -/* - * Changed to use CASEFOLD always. This enables us to rename Foo/baz when - * what actually exists is foo/baz. I don't know why the code used to be - * the way it was. 1/29/96 - * - * caseFold = ((vcp->flags & SMB_VCFLAG_USEV3) ? 0: CM_FLAG_CASEFOLD); - * - * Changed to use CM_FLAG_FOLLOW. 7/24/96 - * - * caseFold = CM_FLAG_CASEFOLD; - */ + /* + * Changed to use CASEFOLD always. This enables us to rename Foo/baz when + * what actually exists is foo/baz. I don't know why the code used to be + * the way it was. 1/29/96 + * + * caseFold = ((vcp->flags & SMB_VCFLAG_USEV3) ? 0: CM_FLAG_CASEFOLD); + * + * Changed to use CM_FLAG_FOLLOW. 7/24/96 + * + * caseFold = CM_FLAG_CASEFOLD; + */ caseFold = CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD; tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); code = cm_NameI(cm_rootSCachep, spacep->data, caseFold, - userp, tidPathp, &req, &oldDscp); + userp, tidPathp, &req, &oldDscp); - if (code) { - cm_ReleaseUser(userp); - return code; - } + if (code) { + cm_ReleaseUser(userp); + return code; + } smb_StripLastComponent(spacep->data, &newLastNamep, newPathp); code = cm_NameI(cm_rootSCachep, spacep->data, caseFold, - userp, tidPathp, &req, &newDscp); + userp, tidPathp, &req, &newDscp); - if (code) { + if (code) { cm_ReleaseSCache(oldDscp); - cm_ReleaseUser(userp); - return code; - } + cm_ReleaseUser(userp); + return code; + } - /* otherwise, oldDscp and newDscp point to the corresponding directories. - * next, get the component names, and lower case them. - */ + /* otherwise, oldDscp and newDscp point to the corresponding directories. + * next, get the component names, and lower case them. + */ - /* handle the old name first */ - if (!oldLastNamep) oldLastNamep = oldPathp; - else oldLastNamep++; + /* handle the old name first */ + if (!oldLastNamep) + oldLastNamep = oldPathp; + else + oldLastNamep++; /* and handle the new name, too */ - if (!newLastNamep) newLastNamep = newPathp; - else newLastNamep++; + if (!newLastNamep) + newLastNamep = newPathp; + else + newLastNamep++; + + /* TODO: The old name could be a wildcard. The new name must not be */ /* do the vnode call */ - rock.odscp = oldDscp; - rock.ndscp = newDscp; - rock.userp = userp; + rock.odscp = oldDscp; + rock.ndscp = newDscp; + rock.userp = userp; rock.reqp = &req; - rock.vcp = vcp; - rock.maskp = oldLastNamep; - rock.hasTilde = ((strchr(oldLastNamep, '~') != NULL) ? 1 : 0); - rock.newNamep = newLastNamep; + rock.vcp = vcp; + rock.maskp = oldLastNamep; + rock.flags = ((strchr(oldLastNamep, '~') != NULL) ? SMB_MASKFLAG_TILDE : 0); + rock.newNamep = newLastNamep; - /* now search the dir for the pattern, and do the appropriate rename when - * found. + /* Check if the file already exists; if so return error */ + code = cm_Lookup(newDscp,newLastNamep,CM_FLAG_CHECKPATH,userp,&req,&tmpscp); + if ((code != CM_ERROR_NOSUCHFILE) && (code != CM_ERROR_NOSUCHPATH) && (code != CM_ERROR_NOSUCHVOLUME) ) { + osi_Log2(afsd_logp, " lookup returns %ld for [%s]", code, + osi_LogSaveString(afsd_logp, newLastNamep)); + + /* Check if the old and the new names differ only in case. If so return + * success, else return CM_ERROR_EXISTS */ - thyper.LowPart = 0; /* search dir from here */ - thyper.HighPart = 0; - /* search for file to already exhist, if so return error*/ + if (!code && oldDscp == newDscp && !stricmp(oldLastNamep, newLastNamep)) { + + /* This would be a success only if the old file is *as same as* the new file */ + code = cm_Lookup(oldDscp, oldLastNamep, CM_FLAG_CHECKPATH, userp, &req, &tmpscp2); + if (!code) { + if (tmpscp == tmpscp2) + code = 0; + else + code = CM_ERROR_EXISTS; + cm_ReleaseSCache(tmpscp2); + tmpscp2 = NULL; + } else { + code = CM_ERROR_NOSUCHFILE; + } + } else { + /* file exist, do not rename, also fixes move */ + osi_Log0(afsd_logp, "Can't rename. Target already exists"); + code = CM_ERROR_EXISTS; + } - code = cm_Lookup(newDscp,newLastNamep,CM_FLAG_CHECKPATH,userp,&req,&tmpscp); - if((code != CM_ERROR_NOSUCHFILE) && (code != CM_ERROR_NOSUCHPATH) && (code != CM_ERROR_NOSUCHVOLUME) ) { - cm_ReleaseSCache(tmpscp); - return CM_ERROR_EXISTS; /* file exist, do not rename, also - fixes move*/ + if(tmpscp != NULL) + cm_ReleaseSCache(tmpscp); + cm_ReleaseSCache(newDscp); + cm_ReleaseSCache(oldDscp); + cm_ReleaseUser(userp); + return code; } - code = cm_ApplyDir(oldDscp, smb_RenameProc, &rock, &thyper, userp, &req, NULL); - if (code == CM_ERROR_STOPNOW) + /* Now search the directory for the pattern, and do the appropriate rename when found */ + thyper.LowPart = 0; /* search dir from here */ + thyper.HighPart = 0; + + code = cm_ApplyDir(oldDscp, smb_RenameProc, &rock, &thyper, userp, &req, NULL); + + if (code == CM_ERROR_STOPNOW) code = 0; else if (code == 0) code = CM_ERROR_NOSUCHFILE; @@ -3939,25 +4271,25 @@ long smb_ReceiveCoreRename(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) if (oldDscp == newDscp) { if (oldDscp->flags & CM_SCACHEFLAG_ANYWATCH) smb_NotifyChange(FILE_ACTION_RENAMED_OLD_NAME, - filter, oldDscp, oldLastNamep, - newLastNamep, TRUE); + filter, oldDscp, oldLastNamep, + newLastNamep, TRUE); } else { if (oldDscp->flags & CM_SCACHEFLAG_ANYWATCH) smb_NotifyChange(FILE_ACTION_RENAMED_OLD_NAME, - filter, oldDscp, oldLastNamep, - NULL, TRUE); + filter, oldDscp, oldLastNamep, + NULL, TRUE); if (newDscp->flags & CM_SCACHEFLAG_ANYWATCH) smb_NotifyChange(FILE_ACTION_RENAMED_NEW_NAME, - filter, newDscp, newLastNamep, - NULL, TRUE); + filter, newDscp, newLastNamep, + NULL, TRUE); } - cm_ReleaseUser(userp); - - cm_ReleaseSCache(oldDscp); - cm_ReleaseSCache(newDscp); - - return code; + if(tmpscp != NULL) + cm_ReleaseSCache(tmpscp); + cm_ReleaseUser(userp); + cm_ReleaseSCache(oldDscp); + cm_ReleaseSCache(newDscp); + return code; } typedef struct smb_rmdirRock { @@ -3965,24 +4297,27 @@ typedef struct smb_rmdirRock { cm_user_t *userp; cm_req_t *reqp; char *maskp; /* pointer to the star pattern */ - int hasTilde; + int flags; int any; } smb_rmdirRock_t; int smb_RmdirProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp) { - long code; - smb_rmdirRock_t *rockp; + long code = 0; + smb_rmdirRock_t *rockp; int match; char shortName[13]; char *matchName; - rockp = vrockp; + rockp = (smb_rmdirRock_t *) vrockp; matchName = dep->name; - match = (cm_stricmp(matchName, rockp->maskp) == 0); + if (rockp->flags & SMB_MASKFLAG_CASEFOLD) + match = (cm_stricmp(matchName, rockp->maskp) == 0); + else + match = (strcmp(matchName, rockp->maskp) == 0); if (!match - && rockp->hasTilde + && (rockp->flags & SMB_MASKFLAG_TILDE) && !cm_Is8Dot3(dep->name)) { cm_Gen8Dot3Name(dep, shortName, NULL); matchName = shortName; @@ -3990,113 +4325,125 @@ int smb_RmdirProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper } if (match) { osi_Log1(smb_logp, "Removing directory %s", - osi_LogSaveString(smb_logp, matchName)); - code = cm_RemoveDir(dscp, dep->name, rockp->userp, rockp->reqp); + osi_LogSaveString(smb_logp, matchName)); + code = cm_RemoveDir(dscp, dep->name, rockp->userp, rockp->reqp); if (code == 0 && (dscp->flags & CM_SCACHEFLAG_ANYWATCH)) smb_NotifyChange(FILE_ACTION_REMOVED, - FILE_NOTIFY_CHANGE_DIR_NAME, - dscp, dep->name, NULL, TRUE); + FILE_NOTIFY_CHANGE_DIR_NAME, + dscp, dep->name, NULL, TRUE); if (code == 0) rockp->any = 1; } - else code = 0; + else code = 0; - return code; + return code; } long smb_ReceiveCoreRemoveDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { - long code; - char *pathp; - char *tp; - cm_space_t *spacep; - cm_scache_t *dscp; - char *lastNamep; + long code = 0; + char *pathp; + char *tp; + cm_space_t *spacep; + cm_scache_t *dscp; + char *lastNamep; smb_rmdirRock_t rock; - cm_user_t *userp; + cm_user_t *userp; osi_hyper_t thyper; - int caseFold; + int caseFold; char *tidPathp; - cm_req_t req; + cm_req_t req; cm_InitReq(&req); tp = smb_GetSMBData(inp, NULL); - pathp = smb_ParseASCIIBlock(tp, &tp); + pathp = smb_ParseASCIIBlock(tp, &tp); spacep = inp->spacep; - smb_StripLastComponent(spacep->data, &lastNamep, pathp); + smb_StripLastComponent(spacep->data, &lastNamep, pathp); userp = smb_GetUser(vcp, inp); - caseFold = CM_FLAG_CASEFOLD; + caseFold = CM_FLAG_CASEFOLD; tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); code = cm_NameI(cm_rootSCachep, spacep->data, caseFold | CM_FLAG_FOLLOW, - userp, tidPathp, &req, &dscp); + userp, tidPathp, &req, &dscp); - if (code) { - cm_ReleaseUser(userp); - return code; - } + if (code) { + cm_ReleaseUser(userp); + return code; + } - /* otherwise, scp points to the parent directory. */ - if (!lastNamep) lastNamep = pathp; - else lastNamep++; + /* otherwise, scp points to the parent directory. */ + if (!lastNamep) + lastNamep = pathp; + else + lastNamep++; rock.any = 0; rock.maskp = lastNamep; - rock.hasTilde = ((strchr(rock.maskp, '~') != NULL) ? 1 : 0); + rock.flags = ((strchr(rock.maskp, '~') != NULL) ? SMB_MASKFLAG_TILDE : 0); thyper.LowPart = 0; thyper.HighPart = 0; rock.userp = userp; rock.reqp = &req; rock.dscp = dscp; - code = cm_ApplyDir(dscp, smb_RmdirProc, &rock, &thyper, userp, &req, NULL); + /* First do a case sensitive match, and if that fails, do a case insensitive match */ + code = cm_ApplyDir(dscp, smb_RmdirProc, &rock, &thyper, userp, &req, NULL); + if (code == 0 && !rock.any) { + thyper.LowPart = 0; + thyper.HighPart = 0; + rock.flags |= SMB_MASKFLAG_CASEFOLD; + code = cm_ApplyDir(dscp, smb_RmdirProc, &rock, &thyper, userp, &req, NULL); + } - cm_ReleaseUser(userp); + cm_ReleaseUser(userp); - cm_ReleaseSCache(dscp); + cm_ReleaseSCache(dscp); if (code == 0 && !rock.any) code = CM_ERROR_NOSUCHFILE; - return code; + return code; } long smb_ReceiveCoreFlush(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { unsigned short fid; - smb_fid_t *fidp; - cm_user_t *userp; - long code; - cm_req_t req; + smb_fid_t *fidp; + cm_user_t *userp; + long code = 0; + cm_req_t req; cm_InitReq(&req); fid = smb_GetSMBParm(inp, 0); - osi_Log1(afsd_logp, "SMB flush fid %d", fid); + osi_Log1(smb_logp, "SMB flush fid %d", fid); fid = smb_ChainFID(fid, inp); - fidp = smb_FindFID(vcp, fid, 0); - if (!fidp || (fidp->flags & SMB_FID_IOCTL)) { - return CM_ERROR_BADFD; - } + fidp = smb_FindFID(vcp, fid, 0); + if (!fidp || (fidp->flags & SMB_FID_IOCTL)) { + if (fidp) + smb_ReleaseFID(fidp); + return CM_ERROR_BADFD; + } - userp = smb_GetUser(vcp, inp); + userp = smb_GetUser(vcp, inp); - lock_ObtainMutex(&fidp->mx); - if (fidp->flags & SMB_FID_OPENWRITE) - code = cm_FSync(fidp->scp, userp, &req); - else code = 0; - lock_ReleaseMutex(&fidp->mx); + lock_ObtainMutex(&fidp->mx); + if (fidp->flags & SMB_FID_OPENWRITE) + code = cm_FSync(fidp->scp, userp, &req); + else + code = 0; + lock_ReleaseMutex(&fidp->mx); - smb_ReleaseFID(fidp); + smb_ReleaseFID(fidp); - cm_ReleaseUser(userp); + cm_ReleaseUser(userp); - return code; + return code; } struct smb_FullNameRock { @@ -4111,17 +4458,17 @@ int smb_FullNameProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *rockp, char shortName[13]; struct smb_FullNameRock *vrockp; - vrockp = rockp; + vrockp = (struct smb_FullNameRock *)rockp; if (!cm_Is8Dot3(dep->name)) { cm_Gen8Dot3Name(dep, shortName, NULL); - if (strcmp(shortName, vrockp->name) == 0) { + if (cm_stricmp(shortName, vrockp->name) == 0) { vrockp->fullName = strdup(dep->name); return CM_ERROR_STOPNOW; } } - if (stricmp(dep->name, vrockp->name) == 0 + if (cm_stricmp(dep->name, vrockp->name) == 0 && ntohl(dep->fid.vnode) == vrockp->vnode->fid.vnode && ntohl(dep->fid.unique) == vrockp->vnode->fid.unique) { vrockp->fullName = strdup(dep->name); @@ -4134,7 +4481,7 @@ void smb_FullName(cm_scache_t *dscp, cm_scache_t *scp, char *pathp, char **newPathp, cm_user_t *userp, cm_req_t *reqp) { struct smb_FullNameRock rock; - long code; + long code = 0; rock.name = pathp; rock.vnode = scp; @@ -4150,10 +4497,10 @@ void smb_FullName(cm_scache_t *dscp, cm_scache_t *scp, char *pathp, long smb_ReceiveCoreClose(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { unsigned short fid; - smb_fid_t *fidp; - cm_user_t *userp; + smb_fid_t *fidp; + cm_user_t *userp; long dosTime; - long code; + long code = 0; cm_req_t req; cm_InitReq(&req); @@ -4161,17 +4508,17 @@ long smb_ReceiveCoreClose(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) fid = smb_GetSMBParm(inp, 0); dosTime = smb_GetSMBParm(inp, 1) | (smb_GetSMBParm(inp, 2) << 16); - osi_Log1(afsd_logp, "SMB close fid %d", fid); + osi_Log1(smb_logp, "SMB close fid %d", fid); fid = smb_ChainFID(fid, inp); - fidp = smb_FindFID(vcp, fid, 0); - if (!fidp) { - return CM_ERROR_BADFD; - } + fidp = smb_FindFID(vcp, fid, 0); + if (!fidp) { + return CM_ERROR_BADFD; + } userp = smb_GetUser(vcp, inp); - lock_ObtainMutex(&fidp->mx); + lock_ObtainMutex(&fidp->mx); /* Don't jump the gun on an async raw write */ while (fidp->raw_writers) { @@ -4183,19 +4530,19 @@ long smb_ReceiveCoreClose(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) fidp->flags |= SMB_FID_DELETE; /* watch for ioctl closes, and read-only opens */ - if (fidp->scp != NULL - && (fidp->flags & (SMB_FID_OPENWRITE | SMB_FID_DELONCLOSE)) - == SMB_FID_OPENWRITE) { + if (fidp->scp != NULL + && (fidp->flags & (SMB_FID_OPENWRITE | SMB_FID_DELONCLOSE)) + == SMB_FID_OPENWRITE) { if (dosTime != 0 && dosTime != -1) { fidp->scp->mask |= CM_SCACHEMASK_CLIENTMODTIME; - /* This fixes defect 10958 */ - CompensateForSmbClientLastWriteTimeBugs(&dosTime); - smb_UnixTimeFromDosUTime(&fidp->scp->clientModTime, - dosTime); + /* This fixes defect 10958 */ + CompensateForSmbClientLastWriteTimeBugs(&dosTime); + smb_UnixTimeFromDosUTime(&fidp->scp->clientModTime, dosTime); } - code = cm_FSync(fidp->scp, userp, &req); + code = cm_FSync(fidp->scp, userp, &req); } - else code = 0; + else + code = 0; if (fidp->flags & SMB_FID_DELONCLOSE) { cm_scache_t *dscp = fidp->NTopen_dscp; @@ -4207,31 +4554,31 @@ long smb_ReceiveCoreClose(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) code = cm_RemoveDir(dscp, fullPathp, userp, &req); if (code == 0 && (dscp->flags & CM_SCACHEFLAG_ANYWATCH)) smb_NotifyChange(FILE_ACTION_REMOVED, - FILE_NOTIFY_CHANGE_DIR_NAME, - dscp, fullPathp, NULL, TRUE); + FILE_NOTIFY_CHANGE_DIR_NAME, + dscp, fullPathp, NULL, TRUE); } - else { + else + { code = cm_Unlink(dscp, fullPathp, userp, &req); if (code == 0 && (dscp->flags & CM_SCACHEFLAG_ANYWATCH)) smb_NotifyChange(FILE_ACTION_REMOVED, - FILE_NOTIFY_CHANGE_FILE_NAME, - dscp, fullPathp, NULL, TRUE); + FILE_NOTIFY_CHANGE_FILE_NAME, + dscp, fullPathp, NULL, TRUE); } free(fullPathp); } - lock_ReleaseMutex(&fidp->mx); + lock_ReleaseMutex(&fidp->mx); - if (fidp->flags & SMB_FID_NTOPEN) { + if (fidp->flags & SMB_FID_NTOPEN) { cm_ReleaseSCache(fidp->NTopen_dscp); free(fidp->NTopen_pathp); } if (fidp->NTopen_wholepathp) free(fidp->NTopen_wholepathp); - smb_ReleaseFID(fidp); - + + smb_ReleaseFID(fidp); cm_ReleaseUser(userp); - - return code; + return code; } /* @@ -4246,7 +4593,7 @@ long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, #endif /* !DJGPP */ { osi_hyper_t offset; - long code; + long code = 0; cm_scache_t *scp; cm_buf_t *bufferp; osi_hyper_t fileLength; @@ -4279,7 +4626,7 @@ long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, /* start by looking up the file's end */ code = cm_SyncOp(scp, NULL, userp, &req, 0, - CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); + CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); if (code) goto done; /* now we have the entry locked, look up the length */ @@ -4305,81 +4652,82 @@ long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, *readp = count; - /* now, copy the data one buffer at a time, + /* now, copy the data one buffer at a time, * until we've filled the request packet */ - while (1) { + while (1) { /* if we've copied all the data requested, we're done */ - if (count <= 0) break; + if (count <= 0) break; - /* otherwise, load up a buffer of data */ - thyper.HighPart = offset.HighPart; - thyper.LowPart = offset.LowPart & ~(buf_bufferSize-1); - if (!bufferp || !LargeIntegerEqualTo(thyper, bufferOffset)) { + /* otherwise, load up a buffer of data */ + thyper.HighPart = offset.HighPart; + thyper.LowPart = offset.LowPart & ~(buf_bufferSize-1); + if (!bufferp || !LargeIntegerEqualTo(thyper, bufferOffset)) { /* wrong buffer */ - if (bufferp) { - buf_Release(bufferp); - bufferp = NULL; + if (bufferp) { + buf_Release(bufferp); + bufferp = NULL; } lock_ReleaseMutex(&scp->mx); lock_ObtainRead(&scp->bufCreateLock); - code = buf_Get(scp, &thyper, &bufferp); + code = buf_Get(scp, &thyper, &bufferp); lock_ReleaseRead(&scp->bufCreateLock); - lock_ObtainMutex(&scp->mx); - if (code) goto done; - bufferOffset = thyper; + lock_ObtainMutex(&scp->mx); + if (code) goto done; + bufferOffset = thyper; - /* now get the data in the cache */ - while (1) { + /* now get the data in the cache */ + while (1) { code = cm_SyncOp(scp, bufferp, userp, &req, 0, - CM_SCACHESYNC_NEEDCALLBACK - | CM_SCACHESYNC_READ); + CM_SCACHESYNC_NEEDCALLBACK + | CM_SCACHESYNC_READ); if (code) goto done; - if (cm_HaveBuffer(scp, bufferp, 0)) break; - - /* otherwise, load the buffer and try again */ - code = cm_GetBuffer(scp, bufferp, NULL, userp, &req); - if (code) break; - } - if (code) { + if (cm_HaveBuffer(scp, bufferp, 0)) break; + + /* otherwise, load the buffer and try again */ + code = cm_GetBuffer(scp, bufferp, NULL, userp, &req); + if (code) break; + } + if (code) { buf_Release(bufferp); - bufferp = NULL; + bufferp = NULL; goto done; } - } /* if (wrong buffer) ... */ + } /* if (wrong buffer) ... */ - /* now we have the right buffer loaded. Copy out the - * data from here to the user's buffer. - */ + /* now we have the right buffer loaded. Copy out the + * data from here to the user's buffer. + */ bufIndex = offset.LowPart & (buf_bufferSize - 1); /* and figure out how many bytes we want from this buffer */ - nbytes = buf_bufferSize - bufIndex; /* what remains in buffer */ - if (nbytes > count) nbytes = count; /* don't go past EOF */ + nbytes = buf_bufferSize - bufIndex; /* what remains in buffer */ + if (nbytes > count) nbytes = count; /* don't go past EOF */ - /* now copy the data */ + /* now copy the data */ #ifdef DJGPP - if (dosflag) - dosmemput(bufferp->datap + bufIndex, nbytes, (dos_ptr)op); - else + if (dosflag) + dosmemput(bufferp->datap + bufIndex, nbytes, (dos_ptr)op); + else #endif /* DJGPP */ - memcpy(op, bufferp->datap + bufIndex, nbytes); + memcpy(op, bufferp->datap + bufIndex, nbytes); /* adjust counters, pointers, etc. */ - op += nbytes; - count -= nbytes; - thyper.LowPart = nbytes; - thyper.HighPart = 0; - offset = LargeIntegerAdd(thyper, offset); - } /* while 1 */ - -done: + op += nbytes; + count -= nbytes; + thyper.LowPart = nbytes; + thyper.HighPart = 0; + offset = LargeIntegerAdd(thyper, offset); + } /* while 1 */ + + done: lock_ReleaseMutex(&scp->mx); lock_ReleaseMutex(&fidp->mx); - if (bufferp) buf_Release(bufferp); + if (bufferp) + buf_Release(bufferp); if (code == 0 && sequential) cm_ConsiderPrefetch(scp, &lastByte, userp, &req); @@ -4399,26 +4747,26 @@ long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, #endif /* !DJGPP */ { osi_hyper_t offset; - long code; + long code = 0; long written = 0; cm_scache_t *scp; - osi_hyper_t fileLength; /* file's length at start of write */ + osi_hyper_t fileLength; /* file's length at start of write */ osi_hyper_t minLength; /* don't read past this */ long nbytes; /* # of bytes to transfer this iteration */ - cm_buf_t *bufferp; - osi_hyper_t thyper; /* hyper tmp variable */ - osi_hyper_t bufferOffset; - long bufIndex; /* index in buffer where our data is */ - int doWriteBack; - osi_hyper_t writeBackOffset; /* offset of region to write back when - * I/O is done */ + cm_buf_t *bufferp; + osi_hyper_t thyper; /* hyper tmp variable */ + osi_hyper_t bufferOffset; + long bufIndex; /* index in buffer where our data is */ + int doWriteBack; + osi_hyper_t writeBackOffset; /* offset of region to write back when + * I/O is done */ DWORD filter = 0; cm_req_t req; cm_InitReq(&req); - bufferp = NULL; - doWriteBack = 0; + bufferp = NULL; + doWriteBack = 0; offset = *offsetp; lock_ObtainMutex(&fidp->mx); @@ -4426,19 +4774,20 @@ long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, lock_ObtainMutex(&scp->mx); /* start by looking up the file's end */ - code = cm_SyncOp(scp, NULL, userp, &req, 0, - CM_SCACHESYNC_NEEDCALLBACK - | CM_SCACHESYNC_SETSTATUS - | CM_SCACHESYNC_GETSTATUS); - if (code) goto done; + code = cm_SyncOp(scp, NULL, userp, &req, 0, + CM_SCACHESYNC_NEEDCALLBACK + | CM_SCACHESYNC_SETSTATUS + | CM_SCACHESYNC_GETSTATUS); + if (code) + goto done; /* make sure we have a writable FD */ - if (!(fidp->flags & SMB_FID_OPENWRITE)) { + if (!(fidp->flags & SMB_FID_OPENWRITE)) { code = CM_ERROR_BADFDOP; goto done; - } + } - /* now we have the entry locked, look up the length */ + /* now we have the entry locked, look up the length */ fileLength = scp->length; minLength = fileLength; if (LargeIntegerGreaterThan(minLength, scp->serverLength)) @@ -4446,87 +4795,86 @@ long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, /* adjust file length if we extend past EOF */ thyper.LowPart = count; - thyper.HighPart = 0; + thyper.HighPart = 0; thyper = LargeIntegerAdd(offset, thyper); /* where write should end */ if (LargeIntegerGreaterThan(thyper, fileLength)) { /* we'd write past EOF, so extend the file */ scp->mask |= CM_SCACHEMASK_LENGTH; - scp->length = thyper; - filter |= - (FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_SIZE); - } else + scp->length = thyper; + filter |= (FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_SIZE); + } else filter |= FILE_NOTIFY_CHANGE_LAST_WRITE; - /* now, if the new position (thyper) and the old (offset) are in + /* now, if the new position (thyper) and the old (offset) are in * different storeback windows, remember to store back the previous * storeback window when we're done with the write. - */ + */ if ((thyper.LowPart & (-cm_chunkSize)) != - (offset.LowPart & (-cm_chunkSize))) { + (offset.LowPart & (-cm_chunkSize))) { /* they're different */ - doWriteBack = 1; - writeBackOffset.HighPart = offset.HighPart; - writeBackOffset.LowPart = offset.LowPart & (-cm_chunkSize); - } + doWriteBack = 1; + writeBackOffset.HighPart = offset.HighPart; + writeBackOffset.LowPart = offset.LowPart & (-cm_chunkSize); + } - *writtenp = count; + *writtenp = count; - /* now, copy the data one buffer at a time, until we've filled the + /* now, copy the data one buffer at a time, until we've filled the * request packet */ - while (1) { + while (1) { /* if we've copied all the data requested, we're done */ - if (count <= 0) break; + if (count <= 0) break; /* handle over quota or out of space */ - if (scp->flags & (CM_SCACHEFLAG_OVERQUOTA - | CM_SCACHEFLAG_OUTOFSPACE)) { + if (scp->flags & (CM_SCACHEFLAG_OVERQUOTA | CM_SCACHEFLAG_OUTOFSPACE)) { *writtenp = written; break; } - /* otherwise, load up a buffer of data */ - thyper.HighPart = offset.HighPart; - thyper.LowPart = offset.LowPart & ~(buf_bufferSize-1); - if (!bufferp || !LargeIntegerEqualTo(thyper, bufferOffset)) { + /* otherwise, load up a buffer of data */ + thyper.HighPart = offset.HighPart; + thyper.LowPart = offset.LowPart & ~(buf_bufferSize-1); + if (!bufferp || !LargeIntegerEqualTo(thyper, bufferOffset)) { /* wrong buffer */ - if (bufferp) { + if (bufferp) { lock_ReleaseMutex(&bufferp->mx); - buf_Release(bufferp); - bufferp = NULL; - } + buf_Release(bufferp); + bufferp = NULL; + } lock_ReleaseMutex(&scp->mx); lock_ObtainRead(&scp->bufCreateLock); - code = buf_Get(scp, &thyper, &bufferp); + code = buf_Get(scp, &thyper, &bufferp); lock_ReleaseRead(&scp->bufCreateLock); - lock_ObtainMutex(&bufferp->mx); - lock_ObtainMutex(&scp->mx); - if (code) goto done; + lock_ObtainMutex(&bufferp->mx); + lock_ObtainMutex(&scp->mx); + if (code) goto done; - bufferOffset = thyper; + bufferOffset = thyper; - /* now get the data in the cache */ - while (1) { + /* now get the data in the cache */ + while (1) { code = cm_SyncOp(scp, bufferp, userp, &req, 0, - CM_SCACHESYNC_NEEDCALLBACK - | CM_SCACHESYNC_WRITE - | CM_SCACHESYNC_BUFLOCKED); - if (code) goto done; + CM_SCACHESYNC_NEEDCALLBACK + | CM_SCACHESYNC_WRITE + | CM_SCACHESYNC_BUFLOCKED); + if (code) + goto done; /* If we're overwriting the entire buffer, or * if we're writing at or past EOF, mark the * buffer as current so we don't call * cm_GetBuffer. This skips the fetch from the * server in those cases where we're going to - * obliterate all the data in the buffer anyway, + * obliterate all the data in the buffer anyway, * or in those cases where there is no useful * data at the server to start with. - * - * Use minLength instead of scp->length, since + * + * Use minLength instead of scp->length, since * the latter has already been updated by this * call. - */ + */ if (LargeIntegerGreaterThanOrEqualTo( bufferp->offset, minLength) || LargeIntegerEqualTo(offset, bufferp->offset) @@ -4542,81 +4890,83 @@ long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, bufferp->dataVersion = scp->dataVersion; } - if (cm_HaveBuffer(scp, bufferp, 1)) break; - - /* otherwise, load the buffer and try again */ - lock_ReleaseMutex(&bufferp->mx); - code = cm_GetBuffer(scp, bufferp, NULL, userp, - &req); - lock_ReleaseMutex(&scp->mx); - lock_ObtainMutex(&bufferp->mx); + if (cm_HaveBuffer(scp, bufferp, 1)) break; + + /* otherwise, load the buffer and try again */ + lock_ReleaseMutex(&bufferp->mx); + code = cm_GetBuffer(scp, bufferp, NULL, userp, + &req); + lock_ReleaseMutex(&scp->mx); + lock_ObtainMutex(&bufferp->mx); lock_ObtainMutex(&scp->mx); - if (code) break; - } - if (code) { + if (code) break; + } + if (code) { lock_ReleaseMutex(&bufferp->mx); buf_Release(bufferp); - bufferp = NULL; + bufferp = NULL; goto done; } - } /* if (wrong buffer) ... */ + } /* if (wrong buffer) ... */ - /* now we have the right buffer loaded. Copy out the - * data from here to the user's buffer. - */ + /* now we have the right buffer loaded. Copy out the + * data from here to the user's buffer. + */ bufIndex = offset.LowPart & (buf_bufferSize - 1); /* and figure out how many bytes we want from this buffer */ - nbytes = buf_bufferSize - bufIndex; /* what remains in buffer */ - if (nbytes > count) nbytes = count; /* don't go past end of request */ + nbytes = buf_bufferSize - bufIndex; /* what remains in buffer */ + if (nbytes > count) + nbytes = count; /* don't go past end of request */ - /* now copy the data */ + /* now copy the data */ #ifdef DJGPP - if (dosflag) - dosmemget((dos_ptr)op, nbytes, bufferp->datap + bufIndex); - else + if (dosflag) + dosmemget((dos_ptr)op, nbytes, bufferp->datap + bufIndex); + else #endif /* DJGPP */ - memcpy(bufferp->datap + bufIndex, op, nbytes); - buf_SetDirty(bufferp); + memcpy(bufferp->datap + bufIndex, op, nbytes); + buf_SetDirty(bufferp); /* and record the last writer */ if (bufferp->userp != userp) { - if (bufferp->userp) cm_ReleaseUser(bufferp->userp); - bufferp->userp = userp; - cm_HoldUser(userp); + cm_HoldUser(userp); + if (bufferp->userp) + cm_ReleaseUser(bufferp->userp); + bufferp->userp = userp; } /* adjust counters, pointers, etc. */ - op += nbytes; - count -= nbytes; + op += nbytes; + count -= nbytes; written += nbytes; - thyper.LowPart = nbytes; - thyper.HighPart = 0; - offset = LargeIntegerAdd(thyper, offset); - } /* while 1 */ + thyper.LowPart = nbytes; + thyper.HighPart = 0; + offset = LargeIntegerAdd(thyper, offset); + } /* while 1 */ -done: + done: lock_ReleaseMutex(&scp->mx); lock_ReleaseMutex(&fidp->mx); - if (bufferp) { + if (bufferp) { lock_ReleaseMutex(&bufferp->mx); - buf_Release(bufferp); + buf_Release(bufferp); } if (code == 0 && filter != 0 && (fidp->flags & SMB_FID_NTOPEN) && (fidp->NTopen_dscp->flags & CM_SCACHEFLAG_ANYWATCH)) { smb_NotifyChange(FILE_ACTION_MODIFIED, filter, - fidp->NTopen_dscp, fidp->NTopen_pathp, - NULL, TRUE); + fidp->NTopen_dscp, fidp->NTopen_pathp, + NULL, TRUE); } - if (code == 0 && doWriteBack) { + if (code == 0 && doWriteBack) { lock_ObtainMutex(&scp->mx); cm_SyncOp(scp, NULL, userp, &req, 0, CM_SCACHESYNC_ASYNCSTORE); lock_ReleaseMutex(&scp->mx); - cm_QueueBKGRequest(scp, cm_BkgStore, writeBackOffset.LowPart, - writeBackOffset.HighPart, cm_chunkSize, 0, userp); - } + cm_QueueBKGRequest(scp, cm_BkgStore, writeBackOffset.LowPart, + writeBackOffset.HighPart, cm_chunkSize, 0, userp); + } return code; } @@ -4624,54 +4974,54 @@ done: long smb_ReceiveCoreWrite(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { osi_hyper_t offset; - long count, written = 0; - unsigned short fd; - smb_fid_t *fidp; - long code; - cm_user_t *userp; - cm_attr_t truncAttr; /* attribute struct used for truncating file */ - char *op; - int inDataBlockCount; - - fd = smb_GetSMBParm(inp, 0); - count = smb_GetSMBParm(inp, 1); - offset.HighPart = 0; /* too bad */ - offset.LowPart = smb_GetSMBParm(inp, 2) | (smb_GetSMBParm(inp, 3) << 16); - - op = smb_GetSMBData(inp, NULL); + long count, written = 0; + unsigned short fd; + smb_fid_t *fidp; + long code = 0; + cm_user_t *userp; + cm_attr_t truncAttr; /* attribute struct used for truncating file */ + char *op; + int inDataBlockCount; + + fd = smb_GetSMBParm(inp, 0); + count = smb_GetSMBParm(inp, 1); + offset.HighPart = 0; /* too bad */ + offset.LowPart = smb_GetSMBParm(inp, 2) | (smb_GetSMBParm(inp, 3) << 16); + + op = smb_GetSMBData(inp, NULL); op = smb_ParseDataBlock(op, NULL, &inDataBlockCount); - osi_Log3(afsd_logp, "smb_ReceiveCoreWrite fd %d, off 0x%x, size 0x%x", - fd, offset.LowPart, count); + osi_Log3(smb_logp, "smb_ReceiveCoreWrite fd %d, off 0x%x, size 0x%x", + fd, offset.LowPart, count); fd = smb_ChainFID(fd, inp); - fidp = smb_FindFID(vcp, fd, 0); - if (!fidp) { + fidp = smb_FindFID(vcp, fd, 0); + if (!fidp) { return CM_ERROR_BADFD; - } + } - if (fidp->flags & SMB_FID_IOCTL) - return smb_IoctlWrite(fidp, vcp, inp, outp); + if (fidp->flags & SMB_FID_IOCTL) + return smb_IoctlWrite(fidp, vcp, inp, outp); userp = smb_GetUser(vcp, inp); /* special case: 0 bytes transferred means truncate to this position */ - if (count == 0) { + if (count == 0) { cm_req_t req; cm_InitReq(&req); truncAttr.mask = CM_ATTRMASK_LENGTH; - truncAttr.length.LowPart = offset.LowPart; - truncAttr.length.HighPart = 0; + truncAttr.length.LowPart = offset.LowPart; + truncAttr.length.HighPart = 0; lock_ObtainMutex(&fidp->mx); - code = cm_SetAttr(fidp->scp, &truncAttr, userp, &req); + code = cm_SetAttr(fidp->scp, &truncAttr, userp, &req); lock_ReleaseMutex(&fidp->mx); smb_SetSMBParm(outp, 0, /* count */ 0); - smb_SetSMBDataLength(outp, 0); + smb_SetSMBDataLength(outp, 0); fidp->flags |= SMB_FID_LENGTHSETDONE; - goto done; - } + goto done; + } /* * Work around bug in NT client @@ -4697,14 +5047,14 @@ long smb_ReceiveCoreWrite(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) code = CM_ERROR_PARTIALWRITE; /* set the packet data length to 3 bytes for the data block header, - * plus the size of the data. - */ + * plus the size of the data. + */ smb_SetSMBParm(outp, 0, written); - smb_SetSMBDataLength(outp, 0); + smb_SetSMBDataLength(outp, 0); -done: - smb_ReleaseFID(fidp); - cm_ReleaseUser(userp); + done: + smb_ReleaseFID(fidp); + cm_ReleaseUser(userp); return code; } @@ -4718,28 +5068,28 @@ void smb_CompleteWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, #ifndef DJGPP char *rawBuf; #else /* DJGPP */ - dos_ptr rawBuf; + dos_ptr rawBuf; #endif /* !DJGPP */ long written = 0; - long code; + long code = 0; fd = smb_GetSMBParm(inp, 0); fidp = smb_FindFID(vcp, fd, 0); - osi_Log2(afsd_logp, "Completing Raw Write offset %x count %x", - rwcp->offset.LowPart, rwcp->count); + osi_Log2(smb_logp, "Completing Raw Write offset %x count %x", + rwcp->offset.LowPart, rwcp->count); userp = smb_GetUser(vcp, inp); #ifndef DJGPP rawBuf = rwcp->buf; code = smb_WriteData(fidp, &rwcp->offset, rwcp->count, rawBuf, userp, - &written); + &written); #else /* DJGPP */ rawBuf = (dos_ptr) rwcp->buf; code = smb_WriteData(fidp, &rwcp->offset, rwcp->count, - (unsigned char *) rawBuf, userp, - &written, TRUE); + (unsigned char *) rawBuf, userp, + &written, TRUE); #endif /* !DJGPP */ if (rwcp->writeMode & 0x1) { /* synchronous */ @@ -4766,7 +5116,7 @@ void smb_CompleteWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, #ifndef DJGPP *((char **)rawBuf) = smb_RawBufs; #else /* DJGPP */ - _farpokel(_dos_ds, rawBuf, smb_RawBufs); + _farpokel(_dos_ds, rawBuf, smb_RawBufs); #endif /* !DJGPP */ smb_RawBufs = rawBuf; lock_ReleaseMutex(&smb_RawBufLock); @@ -4783,39 +5133,39 @@ long smb_ReceiveCoreWriteRawDummy(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, raw_write_cont_t *rwcp) { osi_hyper_t offset; - long count, written = 0; + long count, written = 0; long totalCount; - unsigned short fd; - smb_fid_t *fidp; - long code; - cm_user_t *userp; - char *op; + unsigned short fd; + smb_fid_t *fidp; + long code = 0; + cm_user_t *userp; + char *op; unsigned short writeMode; #ifndef DJGPP char *rawBuf; #else /* DJGPP */ - dos_ptr rawBuf; + dos_ptr rawBuf; #endif /* !DJGPP */ - fd = smb_GetSMBParm(inp, 0); + fd = smb_GetSMBParm(inp, 0); totalCount = smb_GetSMBParm(inp, 1); - count = smb_GetSMBParm(inp, 10); - offset.HighPart = 0; /* too bad */ - offset.LowPart = smb_GetSMBParm(inp, 3) | (smb_GetSMBParm(inp, 4) << 16); + count = smb_GetSMBParm(inp, 10); + offset.HighPart = 0; /* too bad */ + offset.LowPart = smb_GetSMBParm(inp, 3) | (smb_GetSMBParm(inp, 4) << 16); writeMode = smb_GetSMBParm(inp, 7); op = (char *) inp->data; op += smb_GetSMBParm(inp, 11); - osi_Log4(afsd_logp, - "smb_ReceiveCoreWriteRaw fd %d, off 0x%x, size 0x%x, WriteMode 0x%x", - fd, offset.LowPart, count, writeMode); + osi_Log4(smb_logp, + "smb_ReceiveCoreWriteRaw fd %d, off 0x%x, size 0x%x, WriteMode 0x%x", + fd, offset.LowPart, count, writeMode); fd = smb_ChainFID(fd, inp); - fidp = smb_FindFID(vcp, fd, 0); - if (!fidp) { + fidp = smb_FindFID(vcp, fd, 0); + if (!fidp) { return CM_ERROR_BADFD; - } + } userp = smb_GetUser(vcp, inp); @@ -4852,12 +5202,13 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out #ifndef DJGPP smb_RawBufs = *(char **)smb_RawBufs; #else /* DJGPP */ - smb_RawBufs = _farpeekl(_dos_ds, smb_RawBufs); + smb_RawBufs = _farpeekl(_dos_ds, smb_RawBufs); #endif /* !DJGPP */ } else code = CM_ERROR_USESTD; - lock_ReleaseMutex(&smb_RawBufLock); + + lock_ReleaseMutex(&smb_RawBufLock); } /* Don't allow a premature Close */ @@ -4888,10 +5239,10 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out rwcp->alreadyWritten = written; /* set the packet data length to 3 bytes for the data block header, - * plus the size of the data. - */ + * plus the size of the data. + */ smb_SetSMBParm(outp, 0, 0xffff); - smb_SetSMBDataLength(outp, 0); + smb_SetSMBDataLength(outp, 0); return 0; } @@ -4899,304 +5250,316 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out long smb_ReceiveCoreRead(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { osi_hyper_t offset; - long count, finalCount; - unsigned short fd; - smb_fid_t *fidp; - long code; - cm_user_t *userp; - char *op; + long count, finalCount; + unsigned short fd; + smb_fid_t *fidp; + long code = 0; + cm_user_t *userp; + char *op; - fd = smb_GetSMBParm(inp, 0); - count = smb_GetSMBParm(inp, 1); - offset.HighPart = 0; /* too bad */ - offset.LowPart = smb_GetSMBParm(inp, 2) | (smb_GetSMBParm(inp, 3) << 16); + fd = smb_GetSMBParm(inp, 0); + count = smb_GetSMBParm(inp, 1); + offset.HighPart = 0; /* too bad */ + offset.LowPart = smb_GetSMBParm(inp, 2) | (smb_GetSMBParm(inp, 3) << 16); - osi_Log3(afsd_logp, "smb_ReceiveCoreRead fd %d, off 0x%x, size 0x%x", - fd, offset.LowPart, count); + osi_Log3(smb_logp, "smb_ReceiveCoreRead fd %d, off 0x%x, size 0x%x", + fd, offset.LowPart, count); fd = smb_ChainFID(fd, inp); - fidp = smb_FindFID(vcp, fd, 0); - if (!fidp) { + fidp = smb_FindFID(vcp, fd, 0); + if (!fidp) { return CM_ERROR_BADFD; - } + } - if (fidp->flags & SMB_FID_IOCTL) { + if (fidp->flags & SMB_FID_IOCTL) { return smb_IoctlRead(fidp, vcp, inp, outp); - } + } userp = smb_GetUser(vcp, inp); /* remember this for final results */ - smb_SetSMBParm(outp, 0, count); - smb_SetSMBParm(outp, 1, 0); - smb_SetSMBParm(outp, 2, 0); - smb_SetSMBParm(outp, 3, 0); - smb_SetSMBParm(outp, 4, 0); + smb_SetSMBParm(outp, 0, count); + smb_SetSMBParm(outp, 1, 0); + smb_SetSMBParm(outp, 2, 0); + smb_SetSMBParm(outp, 3, 0); + smb_SetSMBParm(outp, 4, 0); /* set the packet data length to 3 bytes for the data block header, - * plus the size of the data. - */ - smb_SetSMBDataLength(outp, count+3); + * plus the size of the data. + */ + smb_SetSMBDataLength(outp, count+3); /* get op ptr after putting in the parms, since otherwise we don't - * know where the data really is. - */ - op = smb_GetSMBData(outp, NULL); + * know where the data really is. + */ + op = smb_GetSMBData(outp, NULL); /* now emit the data block header: 1 byte of type and 2 bytes of length */ - *op++ = 1; /* data block marker */ - *op++ = (unsigned char) (count & 0xff); - *op++ = (unsigned char) ((count >> 8) & 0xff); + *op++ = 1; /* data block marker */ + *op++ = (unsigned char) (count & 0xff); + *op++ = (unsigned char) ((count >> 8) & 0xff); #ifndef DJGPP code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount); #else /* DJGPP */ - code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount, FALSE); + code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount, FALSE); #endif /* !DJGPP */ /* fix some things up */ smb_SetSMBParm(outp, 0, finalCount); smb_SetSMBDataLength(outp, finalCount+3); - smb_ReleaseFID(fidp); + smb_ReleaseFID(fidp); - cm_ReleaseUser(userp); - return code; + cm_ReleaseUser(userp); + return code; } long smb_ReceiveCoreMakeDir(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { char *pathp; - long code; + long code = 0; cm_space_t *spacep; - char *tp; - cm_user_t *userp; - cm_scache_t *dscp; /* dir we're dealing with */ - cm_scache_t *scp; /* file we're creating */ - cm_attr_t setAttr; - int initialModeBits; - char *lastNamep; - int caseFold; + char *tp; + cm_user_t *userp; + cm_scache_t *dscp; /* dir we're dealing with */ + cm_scache_t *scp; /* file we're creating */ + cm_attr_t setAttr; + int initialModeBits; + char *lastNamep; + int caseFold; char *tidPathp; cm_req_t req; cm_InitReq(&req); - scp = NULL; + scp = NULL; /* compute initial mode bits based on read-only flag in attributes */ - initialModeBits = 0777; + initialModeBits = 0777; tp = smb_GetSMBData(inp, NULL); - pathp = smb_ParseASCIIBlock(tp, &tp); + pathp = smb_ParseASCIIBlock(tp, &tp); if (strcmp(pathp, "\\") == 0) return CM_ERROR_EXISTS; spacep = inp->spacep; - smb_StripLastComponent(spacep->data, &lastNamep, pathp); + smb_StripLastComponent(spacep->data, &lastNamep, pathp); userp = smb_GetUser(vcp, inp); - caseFold = CM_FLAG_CASEFOLD; + caseFold = CM_FLAG_CASEFOLD; tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); code = cm_NameI(cm_rootSCachep, spacep->data, - caseFold | CM_FLAG_FOLLOW | CM_FLAG_CHECKPATH, - userp, tidPathp, &req, &dscp); + caseFold | CM_FLAG_FOLLOW | CM_FLAG_CHECKPATH, + userp, tidPathp, &req, &dscp); - if (code) { - cm_ReleaseUser(userp); - return code; - } + if (code) { + cm_ReleaseUser(userp); + return code; + } - /* otherwise, scp points to the parent directory. Do a lookup, and + /* otherwise, scp points to the parent directory. Do a lookup, and * fail if we find it. Otherwise, we do the create. - */ - if (!lastNamep) lastNamep = pathp; - else lastNamep++; - code = cm_Lookup(dscp, lastNamep, caseFold, userp, &req, &scp); - if (scp) cm_ReleaseSCache(scp); - if (code != CM_ERROR_NOSUCHFILE) { - if (code == 0) code = CM_ERROR_EXISTS; + */ + if (!lastNamep) + lastNamep = pathp; + else + lastNamep++; + code = cm_Lookup(dscp, lastNamep, 0, userp, &req, &scp); + if (scp) cm_ReleaseSCache(scp); + if (code != CM_ERROR_NOSUCHFILE) { + if (code == 0) code = CM_ERROR_EXISTS; cm_ReleaseSCache(dscp); - cm_ReleaseUser(userp); - return code; - } + cm_ReleaseUser(userp); + return code; + } setAttr.mask = CM_ATTRMASK_CLIENTMODTIME; setAttr.clientModTime = time(NULL); code = cm_MakeDir(dscp, lastNamep, 0, &setAttr, userp, &req); if (code == 0 && (dscp->flags & CM_SCACHEFLAG_ANYWATCH)) smb_NotifyChange(FILE_ACTION_ADDED, - FILE_NOTIFY_CHANGE_DIR_NAME, - dscp, lastNamep, NULL, TRUE); + FILE_NOTIFY_CHANGE_DIR_NAME, + dscp, lastNamep, NULL, TRUE); /* we don't need this any longer */ cm_ReleaseSCache(dscp); - if (code) { + if (code) { /* something went wrong creating or truncating the file */ - cm_ReleaseUser(userp); - return code; - } + cm_ReleaseUser(userp); + return code; + } /* otherwise we succeeded */ - smb_SetSMBDataLength(outp, 0); - cm_ReleaseUser(userp); + smb_SetSMBDataLength(outp, 0); + cm_ReleaseUser(userp); - return 0; + return 0; } BOOL smb_IsLegalFilename(char *filename) { - /* - * Find the longest substring of filename that does not contain - * any of the chars in illegalChars. If that substring is less - * than the length of the whole string, then one or more of the - * illegal chars is in filename. - */ - if (strcspn(filename, illegalChars) < strlen(filename)) - return FALSE; - - return TRUE; + /* + * Find the longest substring of filename that does not contain + * any of the chars in illegalChars. If that substring is less + * than the length of the whole string, then one or more of the + * illegal chars is in filename. + */ + if (strcspn(filename, illegalChars) < strlen(filename)) + return FALSE; + + return TRUE; } long smb_ReceiveCoreCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { char *pathp; - long code; + long code = 0; cm_space_t *spacep; - char *tp; - int excl; - cm_user_t *userp; - cm_scache_t *dscp; /* dir we're dealing with */ - cm_scache_t *scp; /* file we're creating */ - cm_attr_t setAttr; - int initialModeBits; - smb_fid_t *fidp; - int attributes; - char *lastNamep; - int caseFold; - long dosTime; + char *tp; + int excl; + cm_user_t *userp; + cm_scache_t *dscp; /* dir we're dealing with */ + cm_scache_t *scp; /* file we're creating */ + cm_attr_t setAttr; + int initialModeBits; + smb_fid_t *fidp; + int attributes; + char *lastNamep; + int caseFold; + long dosTime; char *tidPathp; cm_req_t req; cm_InitReq(&req); - scp = NULL; - excl = (inp->inCom == 0x03)? 0 : 1; + scp = NULL; + excl = (inp->inCom == 0x03)? 0 : 1; - attributes = smb_GetSMBParm(inp, 0); - dosTime = smb_GetSMBParm(inp, 1) | (smb_GetSMBParm(inp, 2) << 16); + attributes = smb_GetSMBParm(inp, 0); + dosTime = smb_GetSMBParm(inp, 1) | (smb_GetSMBParm(inp, 2) << 16); /* compute initial mode bits based on read-only flag in attributes */ - initialModeBits = 0666; - if (attributes & 1) initialModeBits &= ~0222; + initialModeBits = 0666; + if (attributes & 1) initialModeBits &= ~0222; tp = smb_GetSMBData(inp, NULL); - pathp = smb_ParseASCIIBlock(tp, &tp); + pathp = smb_ParseASCIIBlock(tp, &tp); spacep = inp->spacep; - smb_StripLastComponent(spacep->data, &lastNamep, pathp); + smb_StripLastComponent(spacep->data, &lastNamep, pathp); userp = smb_GetUser(vcp, inp); - caseFold = CM_FLAG_CASEFOLD; + caseFold = CM_FLAG_CASEFOLD; tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); code = cm_NameI(cm_rootSCachep, spacep->data, caseFold | CM_FLAG_FOLLOW, - userp, tidPathp, &req, &dscp); + userp, tidPathp, &req, &dscp); - if (code) { - cm_ReleaseUser(userp); - return code; - } + if (code) { + cm_ReleaseUser(userp); + return code; + } - /* otherwise, scp points to the parent directory. Do a lookup, and + /* otherwise, scp points to the parent directory. Do a lookup, and * truncate the file if we find it, otherwise we create the file. - */ - if (!lastNamep) lastNamep = pathp; - else lastNamep++; + */ + if (!lastNamep) lastNamep = pathp; + else lastNamep++; + + if (!smb_IsLegalFilename(lastNamep)) + return CM_ERROR_BADNTFILENAME; - if (!smb_IsLegalFilename(lastNamep)) - return CM_ERROR_BADNTFILENAME; + osi_Log1(smb_logp, "SMB receive create [%s]", osi_LogSaveString( smb_logp, pathp )); +#ifdef DEBUG_VERBOSE + { + char *hexp; + hexp = osi_HexifyString( lastNamep ); + DEBUG_EVENT2("AFS", "CoreCreate H[%s] A[%s]", hexp, lastNamep ); + free(hexp); + } +#endif - code = cm_Lookup(dscp, lastNamep, caseFold, userp, &req, &scp); - if (code && code != CM_ERROR_NOSUCHFILE) { + code = cm_Lookup(dscp, lastNamep, 0, userp, &req, &scp); + if (code && code != CM_ERROR_NOSUCHFILE) { cm_ReleaseSCache(dscp); - cm_ReleaseUser(userp); - return code; - } + cm_ReleaseUser(userp); + return code; + } - /* if we get here, if code is 0, the file exists and is represented by - * scp. Otherwise, we have to create it. - */ + /* if we get here, if code is 0, the file exists and is represented by + * scp. Otherwise, we have to create it. + */ if (code == 0) { if (excl) { /* oops, file shouldn't be there */ - cm_ReleaseSCache(dscp); - cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); - return CM_ERROR_EXISTS; - } + cm_ReleaseSCache(dscp); + cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); + return CM_ERROR_EXISTS; + } setAttr.mask = CM_ATTRMASK_LENGTH; - setAttr.length.LowPart = 0; - setAttr.length.HighPart = 0; + setAttr.length.LowPart = 0; + setAttr.length.HighPart = 0; code = cm_SetAttr(scp, &setAttr, userp, &req); - } - else { + } + else { setAttr.mask = CM_ATTRMASK_CLIENTMODTIME; smb_UnixTimeFromDosUTime(&setAttr.clientModTime, dosTime); - code = cm_Create(dscp, lastNamep, 0, &setAttr, &scp, userp, - &req); + code = cm_Create(dscp, lastNamep, 0, &setAttr, &scp, userp, + &req); if (code == 0 && (dscp->flags & CM_SCACHEFLAG_ANYWATCH)) smb_NotifyChange(FILE_ACTION_ADDED, - FILE_NOTIFY_CHANGE_FILE_NAME, - dscp, lastNamep, NULL, TRUE); - if (!excl && code == CM_ERROR_EXISTS) { + FILE_NOTIFY_CHANGE_FILE_NAME, + dscp, lastNamep, NULL, TRUE); + if (!excl && code == CM_ERROR_EXISTS) { /* not an exclusive create, and someone else tried * creating it already, then we open it anyway. We * don't bother retrying after this, since if this next * fails, that means that the file was deleted after * we started this call. - */ - code = cm_Lookup(dscp, lastNamep, caseFold, userp, - &req, &scp); - if (code == 0) { + */ + code = cm_Lookup(dscp, lastNamep, caseFold, userp, + &req, &scp); + if (code == 0) { setAttr.mask = CM_ATTRMASK_LENGTH; - setAttr.length.LowPart = 0; - setAttr.length.HighPart = 0; - code = cm_SetAttr(scp, &setAttr, userp, &req); - } - } + setAttr.length.LowPart = 0; + setAttr.length.HighPart = 0; + code = cm_SetAttr(scp, &setAttr, userp, &req); + } } + } /* we don't need this any longer */ cm_ReleaseSCache(dscp); - if (code) { + if (code) { /* something went wrong creating or truncating the file */ - if (scp) cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); - return code; - } - + if (scp) cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); + return code; + } + /* make sure we only open files */ if (scp->fileType != CM_SCACHETYPE_FILE) { cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); - return CM_ERROR_ISDIR; + cm_ReleaseUser(userp); + return CM_ERROR_ISDIR; } - /* now all we have to do is open the file itself */ - fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); - osi_assert(fidp); + /* now all we have to do is open the file itself */ + fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); + osi_assert(fidp); /* save a pointer to the vnode */ - fidp->scp = scp; + fidp->scp = scp; /* always create it open for read/write */ fidp->flags |= (SMB_FID_OPENREAD | SMB_FID_OPENWRITE); @@ -5204,65 +5567,65 @@ long smb_ReceiveCoreCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) smb_ReleaseFID(fidp); smb_SetSMBParm(outp, 0, fidp->fid); - smb_SetSMBDataLength(outp, 0); + smb_SetSMBDataLength(outp, 0); cm_Open(scp, 0, userp); - cm_ReleaseUser(userp); - /* leave scp held since we put it in fidp->scp */ - return 0; + cm_ReleaseUser(userp); + /* leave scp held since we put it in fidp->scp */ + return 0; } long smb_ReceiveCoreSeek(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { - long code; - long offset; - int whence; - unsigned short fd; - smb_fid_t *fidp; - cm_scache_t *scp; - cm_user_t *userp; + long code = 0; + long offset; + int whence; + unsigned short fd; + smb_fid_t *fidp; + cm_scache_t *scp; + cm_user_t *userp; cm_req_t req; cm_InitReq(&req); - fd = smb_GetSMBParm(inp, 0); + fd = smb_GetSMBParm(inp, 0); whence = smb_GetSMBParm(inp, 1); - offset = smb_GetSMBParm(inp, 2) | (smb_GetSMBParm(inp, 3) << 16); + offset = smb_GetSMBParm(inp, 2) | (smb_GetSMBParm(inp, 3) << 16); /* try to find the file descriptor */ fd = smb_ChainFID(fd, inp); - fidp = smb_FindFID(vcp, fd, 0); - if (!fidp || (fidp->flags & SMB_FID_IOCTL)) { + fidp = smb_FindFID(vcp, fd, 0); + if (!fidp || (fidp->flags & SMB_FID_IOCTL)) { return CM_ERROR_BADFD; - } + } userp = smb_GetUser(vcp, inp); - lock_ObtainMutex(&fidp->mx); - scp = fidp->scp; + lock_ObtainMutex(&fidp->mx); + scp = fidp->scp; lock_ObtainMutex(&scp->mx); code = cm_SyncOp(scp, NULL, userp, &req, 0, - CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); + CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); if (code == 0) { if (whence == 1) { - /* offset from current offset */ - offset += fidp->offset; + /* offset from current offset */ + offset += fidp->offset; } else if (whence == 2) { - /* offset from current EOF */ - offset += scp->length.LowPart; + /* offset from current EOF */ + offset += scp->length.LowPart; } - fidp->offset = offset; - smb_SetSMBParm(outp, 0, offset & 0xffff); - smb_SetSMBParm(outp, 1, (offset>>16) & 0xffff); - smb_SetSMBDataLength(outp, 0); - } + fidp->offset = offset; + smb_SetSMBParm(outp, 0, offset & 0xffff); + smb_SetSMBParm(outp, 1, (offset>>16) & 0xffff); + smb_SetSMBDataLength(outp, 0); + } lock_ReleaseMutex(&scp->mx); - lock_ReleaseMutex(&fidp->mx); - smb_ReleaseFID(fidp); - cm_ReleaseUser(userp); - return code; + lock_ReleaseMutex(&fidp->mx); + smb_ReleaseFID(fidp); + cm_ReleaseUser(userp); + return code; } /* dispatch all of the requests received in a packet. Due to chaining, this may @@ -5271,20 +5634,19 @@ long smb_ReceiveCoreSeek(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, NCB *ncbp, raw_write_cont_t *rwcp) { - static showErrors = 1; - smb_dispatch_t *dp; - smb_t *smbp; - unsigned long code; - unsigned char *outWctp; - int nparms; /* # of bytes of parameters */ - char tbuffer[200]; - int nbytes; /* bytes of data, excluding count */ - int temp; - unsigned char *tp; - unsigned short errCode; + smb_dispatch_t *dp; + smb_t *smbp; + unsigned long code = 0; + unsigned char *outWctp; + int nparms; /* # of bytes of parameters */ + char tbuffer[200]; + int nbytes; /* bytes of data, excluding count */ + int temp; + unsigned char *tp; + unsigned short errCode; unsigned long NTStatus; - int noSend; - unsigned char errClass; + int noSend; + unsigned char errClass; unsigned int oldGen; DWORD oldTime, newTime; @@ -5292,13 +5654,13 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, smbp = (smb_t *) inp->data; if (!(outp->flags & SMB_PACKETFLAG_SUSPENDED)) { - /* setup the basic parms for the initial request in the packet */ + /* setup the basic parms for the initial request in the packet */ inp->inCom = smbp->com; - inp->wctp = &smbp->wct; - inp->inCount = 0; + inp->wctp = &smbp->wct; + inp->inCount = 0; inp->ncb_length = ncbp->ncb_length; } - noSend = 0; + noSend = 0; /* Sanity check */ if (ncbp->ncb_length < offsetof(struct smb, vdata)) { @@ -5314,8 +5676,8 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, 1, ncbp->ncb_length, ptbuf, inp); DeregisterEventSource(h); #else /* DJGPP */ - osi_Log1(smb_logp, "SMB message too short, len %d", - ncbp->ncb_length); + osi_Log1(smb_logp, "SMB message too short, len %d", + ncbp->ncb_length); #endif /* !DJGPP */ return; @@ -5324,17 +5686,17 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, /* We are an ongoing op */ thrd_Increment(&ongoingOps); - /* set up response packet for receiving output */ + /* set up response packet for receiving output */ if (!(outp->flags & SMB_PACKETFLAG_SUSPENDED)) - smb_FormatResponsePacket(vcp, inp, outp); - outWctp = outp->wctp; + smb_FormatResponsePacket(vcp, inp, outp); + outWctp = outp->wctp; /* Remember session generation number and time */ oldGen = sessionGen; oldTime = GetCurrentTime(); while(inp->inCom != 0xff) { - dp = &smb_dispatchTable[inp->inCom]; + dp = &smb_dispatchTable[inp->inCom]; if (outp->flags & SMB_PACKETFLAG_SUSPENDED) { outp->flags &= ~SMB_PACKETFLAG_SUSPENDED; @@ -5342,48 +5704,48 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, goto resume; } - /* process each request in the packet; inCom, wctp and inCount - * are already set up. - */ - osi_Log2(afsd_logp, "SMB received op 0x%x lsn %d", inp->inCom, - ncbp->ncb_lsn); + /* process each request in the packet; inCom, wctp and inCount + * are already set up. + */ + osi_Log2(smb_logp, "SMB received op 0x%x lsn %d", inp->inCom, + ncbp->ncb_lsn); /* now do the dispatch */ /* start by formatting the response record a little, as a default */ - if (dp->flags & SMB_DISPATCHFLAG_CHAINED) { + if (dp->flags & SMB_DISPATCHFLAG_CHAINED) { outWctp[0] = 2; - outWctp[1] = 0xff; /* no operation */ - outWctp[2] = 0; /* padding */ - outWctp[3] = 0; - outWctp[4] = 0; - } + outWctp[1] = 0xff; /* no operation */ + outWctp[2] = 0; /* padding */ + outWctp[3] = 0; + outWctp[4] = 0; + } else { /* not a chained request, this is a more reasonable default */ - outWctp[0] = 0; /* wct of zero */ - outWctp[1] = 0; /* and bcc (word) of zero */ - outWctp[2] = 0; - } + outWctp[0] = 0; /* wct of zero */ + outWctp[1] = 0; /* and bcc (word) of zero */ + outWctp[2] = 0; + } /* once set, stays set. Doesn't matter, since we never chain - * "no response" calls. - */ + * "no response" calls. + */ if (dp->flags & SMB_DISPATCHFLAG_NORESPONSE) - noSend = 1; + noSend = 1; - if (dp->procp) { + if (dp->procp) { /* we have a recognized operation */ if (inp->inCom == 0x1d) /* Raw Write */ code = smb_ReceiveCoreWriteRaw (vcp, inp, outp, - rwcp); + rwcp); else { - osi_LogEvent("AFS Dispatch %s",(myCrt_Dispatch(inp->inCom)),"vcp[%x] lana[%d] lsn[%d]",vcp,vcp->lana,vcp->lsn); - osi_Log4(afsd_logp,"Dispatch %s vcp[%x] lana[%d] lsn[%d]",(myCrt_Dispatch(inp->inCom)),vcp,vcp->lana,vcp->lsn); + osi_LogEvent("AFS Dispatch %s",(myCrt_Dispatch(inp->inCom)),"vcp[%x] lana[%d] lsn[%d]",(int)vcp,vcp->lana,vcp->lsn); + osi_Log4(smb_logp,"Dispatch %s vcp[%x] lana[%d] lsn[%d]",(myCrt_Dispatch(inp->inCom)),vcp,vcp->lana,vcp->lsn); code = (*(dp->procp)) (vcp, inp, outp); - osi_LogEvent("AFS Dispatch return",NULL,"Code[%d]",(code==0)?0:code-CM_ERROR_BASE,""); - osi_Log1(afsd_logp,"Dispatch return code[%d]",(code==0)?0:code-CM_ERROR_BASE); - } + osi_LogEvent("AFS Dispatch return",NULL,"Code[%d]",(code==0)?0:code-CM_ERROR_BASE); + osi_Log1(smb_logp,"Dispatch return code[%d]",(code==0)?0:code-CM_ERROR_BASE); + } if (oldGen != sessionGen) { #ifndef DJGPP @@ -5393,29 +5755,33 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, newTime = GetCurrentTime(); h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); sprintf(s, "Pkt straddled session startup, took %d ms, ncb length %d", - newTime - oldTime, ncbp->ncb_length); + newTime - oldTime, ncbp->ncb_length); ptbuf[0] = s; ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, - 1005, NULL, 1, ncbp->ncb_length, ptbuf, smbp); + 1005, NULL, 1, ncbp->ncb_length, ptbuf, smbp); DeregisterEventSource(h); #else /* DJGPP */ - osi_Log1(afsd_logp, "Pkt straddled session startup, " - "ncb length %d", ncbp->ncb_length); + osi_Log1(smb_logp, "Pkt straddled session startup, " + "ncb length %d", ncbp->ncb_length); #endif /* !DJGPP */ } - } - else { + } + else { /* bad opcode, fail the request, after displaying it */ +#ifdef NOTSERVICE + smb_LogPacket(inp); +#endif /* NOTSERVICE */ + #ifndef DJGPP if (showErrors) { sprintf(tbuffer, "Received bad SMB req 0x%x", inp->inCom); - code = (*smb_MBfunc)(NULL, tbuffer, "Cancel: don't show again", - MB_OKCANCEL); - if (code == IDCANCEL) showErrors = 0; + code = (*smb_MBfunc)(NULL, tbuffer, "Cancel: don't show again", + MB_OKCANCEL|MB_SERVICE_NOTIFICATION); + if (code == IDCANCEL) showErrors = 0; } #endif /* DJGPP */ - code = CM_ERROR_BADOP; - } + code = CM_ERROR_BADOP; + } /* catastrophic failure: log as much as possible */ if (code == CM_ERROR_BADSMB) { @@ -5425,19 +5791,22 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, char s[100]; osi_Log1(smb_logp, - "Invalid SMB, ncb_length %d", - ncbp->ncb_length); + "Invalid SMB, ncb_length %d", + ncbp->ncb_length); h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); sprintf(s, "Invalid SMB message, length %d", - ncbp->ncb_length); + ncbp->ncb_length); ptbuf[0] = s; ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1002, NULL, - 1, ncbp->ncb_length, ptbuf, smbp); + 1, ncbp->ncb_length, ptbuf, smbp); DeregisterEventSource(h); +#ifdef NOTSERVICE + smb_LogPacket(inp); +#endif /* NOTSERVICE */ #else /* DJGPP */ - osi_Log1(afsd_logp, "Invalid SMB message, length %d", - ncbp->ncb_length); + osi_Log1(smb_logp, "Invalid SMB message, length %d", + ncbp->ncb_length); #endif /* !DJGPP */ code = CM_ERROR_INVAL; @@ -5448,10 +5817,10 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, return; } -resume: + resume: /* now, if we failed, turn the current response into an empty - * one, and fill in the response packet's error code. - */ + * one, and fill in the response packet's error code. + */ if (code) { if (vcp->flags & SMB_VCFLAG_STATUS32) { smb_MapNTError(code, &NTStatus); @@ -5474,7 +5843,7 @@ resume: break; } else { - smb_MapCoreError(code, vcp, &errCode, &errClass); + smb_MapCoreError(code, vcp, &errCode, &errClass); outWctp = outp->wctp; smbp = (smb_t *) &outp->data; if (code != CM_ERROR_PARTIALWRITE) { @@ -5487,49 +5856,50 @@ resume: } smbp->errLow = (unsigned char) (errCode & 0xff); smbp->errHigh = (unsigned char) ((errCode >> 8) & 0xff); - smbp->rcls = errClass; + smbp->rcls = errClass; break; } } /* error occurred */ - /* if we're here, we've finished one request. Look to see if + /* if we're here, we've finished one request. Look to see if * this is a chained opcode. If it is, setup things to process * the chained request, and setup the output buffer to hold the * chained response. Start by finding the next input record. - */ - if (!(dp->flags & SMB_DISPATCHFLAG_CHAINED)) - break; /* not a chained req */ - tp = inp->wctp; /* points to start of last request */ - if (tp[0] < 2) break; /* in a chained request, the first two - * parm fields are required, and are - * AndXCommand/AndXReserved and - * AndXOffset. */ - if (tp[1] == 0xff) break; /* no more chained opcodes */ - inp->inCom = tp[1]; - inp->wctp = inp->data + tp[3] + (tp[4] << 8); - inp->inCount++; - - /* and now append the next output request to the end of this - * last request. Begin by finding out where the last response + */ + if (!(dp->flags & SMB_DISPATCHFLAG_CHAINED)) + break; /* not a chained req */ + tp = inp->wctp; /* points to start of last request */ + /* in a chained request, the first two + * parm fields are required, and are + * AndXCommand/AndXReserved and + * AndXOffset. */ + if (tp[0] < 2) break; + if (tp[1] == 0xff) break; /* no more chained opcodes */ + inp->inCom = tp[1]; + inp->wctp = inp->data + tp[3] + (tp[4] << 8); + inp->inCount++; + + /* and now append the next output request to the end of this + * last request. Begin by finding out where the last response * ends, since that's where we'll put our new response. - */ - outWctp = outp->wctp; /* ptr to out parameters */ - osi_assert (outWctp[0] >= 2); /* need this for all chained requests */ - nparms = outWctp[0] << 1; - tp = outWctp + nparms + 1; /* now points to bcc field */ - nbytes = tp[0] + (tp[1] << 8); /* # of data bytes */ - tp += 2 /* for the count itself */ + nbytes; + */ + outWctp = outp->wctp; /* ptr to out parameters */ + osi_assert (outWctp[0] >= 2); /* need this for all chained requests */ + nparms = outWctp[0] << 1; + tp = outWctp + nparms + 1; /* now points to bcc field */ + nbytes = tp[0] + (tp[1] << 8); /* # of data bytes */ + tp += 2 /* for the count itself */ + nbytes; /* tp now points to the new output record; go back and patch the - * second parameter (off2) to point to the new record. - */ + * second parameter (off2) to point to the new record. + */ temp = (unsigned int)tp - ((unsigned int) outp->data); - outWctp[3] = (unsigned char) (temp & 0xff); - outWctp[4] = (unsigned char) ((temp >> 8) & 0xff); - outWctp[2] = 0; /* padding */ - outWctp[1] = inp->inCom; /* next opcode */ + outWctp[3] = (unsigned char) (temp & 0xff); + outWctp[4] = (unsigned char) ((temp >> 8) & 0xff); + outWctp[2] = 0; /* padding */ + outWctp[1] = inp->inCom; /* next opcode */ /* finally, setup for the next iteration */ - outp->wctp = tp; + outp->wctp = tp; outWctp = tp; } /* while loop over all requests in the packet */ @@ -5545,19 +5915,27 @@ resume: } } - /* now send the output packet, and return */ - if (!noSend) + /* now send the output packet, and return */ + if (!noSend) smb_SendPacket(vcp, outp); thrd_Decrement(&ongoingOps); if (!(vcp->flags & SMB_VCFLAG_ALREADYDEAD)) { + if (active_vcp) { + smb_ReleaseVC(active_vcp); + osi_Log2(smb_logp, + "Replacing active_vcp %x with %x", active_vcp, vcp); + } + smb_HoldVC(vcp); active_vcp = vcp; last_msg_time = GetCurrentTime(); } - else if (active_vcp == vcp) + else if (active_vcp == vcp) { + smb_ReleaseVC(active_vcp); active_vcp = NULL; + } - return; + return; } #ifndef DJGPP @@ -5568,15 +5946,48 @@ resume: */ void smb_ClientWaiter(void *parmp) { - DWORD code, idx; + DWORD code; + int idx; + + while (1) { + code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBevents, + FALSE, INFINITE); + if (code == WAIT_OBJECT_0) + continue; + + /* error checking */ + if (code >= WAIT_ABANDONED_0 && code < (WAIT_ABANDONED_0 + numNCBs)) + { + int abandonIdx = code - WAIT_ABANDONED_0; + afsi_log("Error: smb_ClientWaiter event %d abandoned, errno %d\n", abandonIdx, GetLastError()); + } + + if (code == WAIT_IO_COMPLETION) + { + afsi_log("Error: smb_ClientWaiter WAIT_IO_COMPLETION\n"); + continue; + } + + if (code == WAIT_TIMEOUT) + { + afsi_log("Error: smb_ClientWaiter WAIT_TIMEOUT, errno %d\n", GetLastError()); + } - while (1) { - code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBevents, - FALSE, INFINITE); - if (code == WAIT_OBJECT_0) - continue; - idx = code - WAIT_OBJECT_0; + if (code == WAIT_FAILED) + { + afsi_log("Error: smb_ClientWaiter WAIT_FAILED, errno %d\n", GetLastError()); + } + idx = code - WAIT_OBJECT_0; + + /* check idx range! */ + if (idx < 0 || idx > (sizeof(NCBevents) / sizeof(NCBevents[0]))) + { + /* this is fatal - log as much as possible */ + afsi_log("Fatal: NCBevents idx [ %d ] out of range.\n", idx); + osi_assert(0); + } + thrd_ResetEvent(NCBevents[idx]); thrd_SetEvent(NCBreturns[0][idx]); } @@ -5589,10 +6000,11 @@ void smb_ClientWaiter(void *parmp) */ void smb_ServerWaiter(void *parmp) { - DWORD code, idx_session, idx_NCB; + DWORD code; + int idx_session, idx_NCB; NCB *ncbp; #ifdef DJGPP - dos_ptr dos_ncb; + dos_ptr dos_ncb; #endif /* DJGPP */ while (1) { @@ -5601,15 +6013,78 @@ void smb_ServerWaiter(void *parmp) FALSE, INFINITE); if (code == WAIT_OBJECT_0) continue; - idx_session = code - WAIT_OBJECT_0; + + if (code >= WAIT_ABANDONED_0 && code < (WAIT_ABANDONED_0 + numSessions)) + { + int abandonIdx = code - WAIT_ABANDONED_0; + afsi_log("Error: smb_ServerWaiter (SessionEvents) event %d abandoned, errno %d\n", abandonIdx, GetLastError()); + } + + if (code == WAIT_IO_COMPLETION) + { + afsi_log("Error: smb_ServerWaiter (SessionEvents) WAIT_IO_COMPLETION\n"); + continue; + } + + if (code == WAIT_TIMEOUT) + { + afsi_log("Error: smb_ServerWaiter (SessionEvents) WAIT_TIMEOUT, errno %d\n", GetLastError()); + } + + if (code == WAIT_FAILED) + { + afsi_log("Error: smb_ServerWaiter (SessionEvents) WAIT_FAILED, errno %d\n", GetLastError()); + } + + idx_session = code - WAIT_OBJECT_0; + + /* check idx range! */ + if (idx_session < 0 || idx_session > (sizeof(SessionEvents) / sizeof(SessionEvents[0]))) + { + /* this is fatal - log as much as possible */ + afsi_log("Fatal: session idx [ %d ] out of range.\n", idx_session); + osi_assert(0); + } /* Get an NCB */ -NCBretry: + NCBretry: code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBavails, FALSE, INFINITE); if (code == WAIT_OBJECT_0) goto NCBretry; - idx_NCB = code - WAIT_OBJECT_0; + + /* error checking */ + if (code >= WAIT_ABANDONED_0 && code < (WAIT_ABANDONED_0 + numNCBs)) + { + int abandonIdx = code - WAIT_ABANDONED_0; + afsi_log("Error: smb_ClientWaiter (NCBavails) event %d abandoned, errno %d\n", abandonIdx, GetLastError()); + } + + if (code == WAIT_IO_COMPLETION) + { + afsi_log("Error: smb_ClientWaiter (NCBavails) WAIT_IO_COMPLETION\n"); + continue; + } + + if (code == WAIT_TIMEOUT) + { + afsi_log("Error: smb_ClientWaiter (NCBavails) WAIT_TIMEOUT, errno %d\n", GetLastError()); + } + + if (code == WAIT_FAILED) + { + afsi_log("Error: smb_ClientWaiter (NCBavails) WAIT_FAILED, errno %d\n", GetLastError()); + } + + idx_NCB = code - WAIT_OBJECT_0; + + /* check idx range! */ + if (idx_NCB < 0 || idx_NCB > (sizeof(NCBsessions) / sizeof(NCBsessions[0]))) + { + /* this is fatal - log as much as possible */ + afsi_log("Fatal: idx_NCB [ %d ] out of range.\n", idx_NCB); + osi_assert(0); + } /* Link them together */ NCBsessions[idx_NCB] = idx_session; @@ -5617,7 +6092,7 @@ NCBretry: /* Fire it up */ ncbp = NCBs[idx_NCB]; #ifdef DJGPP - dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; + dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; #endif /* DJGPP */ ncbp->ncb_lsn = (unsigned char) LSNs[idx_session]; ncbp->ncb_command = NCBRECV | ASYNCH; @@ -5652,14 +6127,15 @@ void smb_Server(VOID *parmp) int myIdx = (int) parmp; NCB *ncbp; NCB *outncbp; - smb_packet_t *bufp; + smb_packet_t *bufp; smb_packet_t *outbufp; - DWORD code, rcode, idx_NCB, idx_session; + DWORD code, rcode; + int idx_NCB, idx_session; UCHAR rc; - smb_vc_t *vcp; + smb_vc_t *vcp = NULL; smb_t *smbp; #ifdef DJGPP - dos_ptr dos_ncb; + dos_ptr dos_ncb; #endif /* DJGPP */ outncbp = GetNCB(); @@ -5674,7 +6150,7 @@ void smb_Server(VOID *parmp) if (tod > EXPIREDATE) { (*smb_MBfunc)(NULL, "AFS demo expiration", "afsd dispatcher", - MB_OK|MB_ICONSTOP|MB_SETFOREGROUND); + MB_OK|MB_ICONSTOP|MB_SETFOREGROUND|MB_SERVICE_NOTIFICATION); trhd_Exit(1); } } @@ -5682,9 +6158,42 @@ void smb_Server(VOID *parmp) code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBreturns[myIdx], FALSE, INFINITE); - if (code == WAIT_OBJECT_0) + if (code == WAIT_OBJECT_0) { continue; - idx_NCB = code - WAIT_OBJECT_0; + } + + /* error checking */ + if (code >= WAIT_ABANDONED_0 && code < (WAIT_ABANDONED_0 + numNCBs)) + { + int abandonIdx = code - WAIT_ABANDONED_0; + afsi_log("Error: smb_Server ( NCBreturns[%d] ) event %d abandoned, errno %d\n", myIdx, abandonIdx, GetLastError()); + } + + if (code == WAIT_IO_COMPLETION) + { + afsi_log("Error: smb_Server ( NCBreturns[%d] ) WAIT_IO_COMPLETION\n", myIdx); + continue; + } + + if (code == WAIT_TIMEOUT) + { + afsi_log("Error: smb_Server ( NCBreturns[%d] ) WAIT_TIMEOUT, errno %d\n", myIdx, GetLastError()); + } + + if (code == WAIT_FAILED) + { + afsi_log("Error: smb_Server ( NCBreturns[%d] ) WAIT_FAILED, errno %d\n", myIdx, GetLastError()); + } + + idx_NCB = code - WAIT_OBJECT_0; + + /* check idx range! */ + if (idx_NCB < 0 || idx_NCB > (sizeof(NCBs) / sizeof(NCBs[0]))) + { + /* this is fatal - log as much as possible */ + afsi_log("Fatal: idx_NCB [ %d ] out of range.\n", idx_NCB); + osi_assert(0); + } ncbp = NCBs[idx_NCB]; #ifdef DJGPP @@ -5694,45 +6203,59 @@ void smb_Server(VOID *parmp) rc = ncbp->ncb_retcode; if (rc != NRC_PENDING && rc != NRC_GOODRET) - osi_Log1(afsd_logp, "NCBRECV failure code %d", rc); + osi_Log1(smb_logp, "NCBRECV failure code %d", rc); switch (rc) { case NRC_GOODRET: break; case NRC_PENDING: /* Can this happen? Or is it just my - * UNIX paranoia? */ + * UNIX paranoia? + */ continue; case NRC_SCLOSED: case NRC_SNUMOUT: /* Client closed session */ + if (reportSessionStartups) + { + afsi_log("session [ %d ] closed", idx_session); + } dead_sessions[idx_session] = TRUE; + if (vcp) + smb_ReleaseVC(vcp); vcp = smb_FindVC(ncbp->ncb_lsn, 0, lanas[idx_session]); - /* Should also release vcp. Also, would do - * sanity check that all TID's are gone. */ - if (dead_vcp) - osi_Log1(afsd_logp, - "dead_vcp already set, %x", - dead_vcp); - if (!dead_vcp - && !(vcp->flags & SMB_VCFLAG_ALREADYDEAD)) { - osi_Log2(afsd_logp, - "setting dead_vcp %x, user struct %x", - vcp, vcp->usersp); - dead_vcp = vcp; - vcp->flags |= SMB_VCFLAG_ALREADYDEAD; - } - if (vcp->justLoggedOut) { - loggedOut = 1; - loggedOutTime = vcp->logoffTime; - loggedOutName = - strdup(vcp->justLoggedOut->unp->name); - loggedOutUserp = vcp->justLoggedOut; - lock_ObtainWrite(&smb_rctLock); - loggedOutUserp->refCount++; - lock_ReleaseWrite(&smb_rctLock); - } + /* Should also release vcp. [done] 2004-05-11 jaltman + * Also, should do + * sanity check that all TID's are gone. + * + * TODO: check if we could use LSNs[idx_session] instead, + * also cleanup after dead vcp + */ + if (vcp) { + if (dead_vcp) + osi_Log1(smb_logp, + "dead_vcp already set, %x", + dead_vcp); + if (!dead_vcp && !(vcp->flags & SMB_VCFLAG_ALREADYDEAD)) { + osi_Log2(smb_logp, + "setting dead_vcp %x, user struct %x", + vcp, vcp->usersp); + smb_HoldVC(vcp); + dead_vcp = vcp; + vcp->flags |= SMB_VCFLAG_ALREADYDEAD; + } + if (vcp->justLoggedOut) { + loggedOut = 1; + loggedOutTime = vcp->logoffTime; + loggedOutName = + strdup(vcp->justLoggedOut->unp->name); + loggedOutUserp = vcp->justLoggedOut; + lock_ObtainWrite(&smb_rctLock); + loggedOutUserp->refCount++; + lock_ReleaseWrite(&smb_rctLock); + } + } goto doneWithNCB; case NRC_INCOMP: @@ -5743,33 +6266,31 @@ void smb_Server(VOID *parmp) char *ptbuf[1]; char s[100]; - osi_Log1(smb_logp, - "dispatch smb recv failed, message incomplete, ncb_length %d", - ncbp->ncb_length); - h = RegisterEventSource(NULL, - AFS_DAEMON_EVENT_NAME); + osi_Log1(smb_logp, "dispatch smb recv failed, message incomplete, ncb_length %d", + ncbp->ncb_length); + h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); sprintf(s, "SMB message incomplete, length %d", - ncbp->ncb_length); + ncbp->ncb_length); ptbuf[0] = s; ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, - 1001, NULL, 1, - ncbp->ncb_length, ptbuf, - bufp); + 1001, NULL, 1, + ncbp->ncb_length, ptbuf, + bufp); DeregisterEventSource(h); #else /* DJGPP */ osi_Log1(smb_logp, - "dispatch smb recv failed, message incomplete, ncb_length %d", - ncbp->ncb_length); - osi_Log1(smb_logp, - "SMB message incomplete, " - "length %d", ncbp->ncb_length); + "dispatch smb recv failed, message incomplete, ncb_length %d", + ncbp->ncb_length); + osi_Log1(smb_logp, + "SMB message incomplete, " + "length %d", ncbp->ncb_length); #endif /* !DJGPP */ /* * We used to discard the packet. * Instead, try handling it normally. * - continue; + continue; */ break; } @@ -5777,8 +6298,10 @@ void smb_Server(VOID *parmp) default: /* A weird error code. Log it, sleep, and * continue. */ - if (vcp->errorCount++ > 3) + if (vcp && vcp->errorCount++ > 3) { + afsi_log("session [ %d ] closed, vcp->errorCount = %d", idx_session, vcp->errorCount); dead_sessions[idx_session] = TRUE; + } else { thrd_Sleep(1000); thrd_SetEvent(SessionEvents[idx_session]); @@ -5792,28 +6315,91 @@ void smb_Server(VOID *parmp) if (smb_concurrentCalls > smb_maxObsConcurrentCalls) smb_maxObsConcurrentCalls = smb_concurrentCalls; + if (vcp) + smb_ReleaseVC(vcp); vcp = smb_FindVC(ncbp->ncb_lsn, 0, ncbp->ncb_lana_num); + /* + * If at this point vcp is NULL (implies that packet was invalid) + * then we are in big trouble. This means either : + * a) we have the wrong NCB. + * b) Netbios screwed up the call. + * Obviously this implies that + * ( LSNs[idx_session] != ncbp->ncb_lsn || + * lanas[idx_session] != ncbp->ncb_lana_num ) + * Either way, we can't do anything with this packet. + * Log, sleep and resume. + */ + if(!vcp) { + HANDLE h; + char buf[1000]; + char *ptbuf[1]; + + sprintf(buf, + "Bad vcp!! : " + "LSNs[idx_session]=[%d]," + "lanas[idx_session]=[%d]," + "ncbp->ncb_lsn=[%d]," + "ncbp->ncb_lana_num=[%d]", + LSNs[idx_session], + lanas[idx_session], + ncbp->ncb_lsn, + ncbp->ncb_lana_num); + + ptbuf[0] = buf; + + h = RegisterEventSource(NULL,AFS_DAEMON_EVENT_NAME); + if(h) { + ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1001, NULL,1,sizeof(*ncbp),ptbuf,(void*)ncbp); + DeregisterEventSource(h); + } + + /* Also log in the trace log. */ + osi_Log4(smb_logp, "Server: BAD VCP!" + "LSNs[idx_session]=[%d]," + "lanas[idx_session]=[%d]," + "ncbp->ncb_lsn=[%d]," + "ncbp->ncb_lana_num=[%d]", + LSNs[idx_session], + lanas[idx_session], + ncbp->ncb_lsn, + ncbp->ncb_lana_num); + + /* thrd_Sleep(1000); Don't bother sleeping */ + thrd_SetEvent(SessionEvents[idx_session]); + smb_concurrentCalls--; + continue; + } + + vcp->errorCount = 0; bufp = (struct smb_packet *) ncbp->ncb_buffer; #ifdef DJGPP bufp = ((smb_ncb_t *) ncbp)->orig_pkt; - /* copy whole packet to virtual memory */ - /*fprintf(stderr, "smb_Server: copying dos packet at 0x%x, " - "bufp=0x%x\n", - bufp->dos_pkt / 16, bufp);*/ - fflush(stderr); - dosmemget(bufp->dos_pkt, ncbp->ncb_length, bufp->data); + /* copy whole packet to virtual memory */ + /*fprintf(stderr, "smb_Server: copying dos packet at 0x%x, " + "bufp=0x%x\n", + bufp->dos_pkt / 16, bufp);*/ + fflush(stderr); + dosmemget(bufp->dos_pkt, ncbp->ncb_length, bufp->data); #endif /* DJGPP */ smbp = (smb_t *)bufp->data; outbufp->flags = 0; +#if !defined(DJGPP) && !defined(AFS_WIN32_ENV) + __try + { +#endif if (smbp->com == 0x1d) { /* Special handling for Write Raw */ raw_write_cont_t rwc; EVENT_HANDLE rwevent; - smb_DispatchPacket(vcp, bufp, outbufp, ncbp, &rwc); + char eventName[MAX_PATH]; + + smb_DispatchPacket(vcp, bufp, outbufp, ncbp, &rwc); if (rwc.code == 0) { - rwevent = thrd_CreateEvent(NULL, FALSE, FALSE, NULL); + rwevent = thrd_CreateEvent(NULL, FALSE, FALSE, TEXT("smb_Server() rwevent")); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) + afsi_log("Event Object Already Exists: %s", eventName); ncbp->ncb_command = NCBRECV | ASYNCH; ncbp->ncb_lsn = (unsigned char) vcp->lsn; ncbp->ncb_lana_num = vcp->lana; @@ -5825,32 +6411,66 @@ void smb_Server(VOID *parmp) #else Netbios(ncbp, dos_ncb); #endif /* !DJGPP */ - rcode = thrd_WaitForSingleObject_Event(rwevent, - RAWTIMEOUT); + rcode = thrd_WaitForSingleObject_Event(rwevent, RAWTIMEOUT); thrd_CloseHandle(rwevent); } thrd_SetEvent(SessionEvents[idx_session]); if (rwc.code == 0) - smb_CompleteWriteRaw(vcp, bufp, outbufp, ncbp, - &rwc); + smb_CompleteWriteRaw(vcp, bufp, outbufp, ncbp, &rwc); } else if (smbp->com == 0xa0) { - /* - * Serialize the handling for NT Transact - * (defect 11626) - */ - smb_DispatchPacket(vcp, bufp, outbufp, ncbp, NULL); + /* + * Serialize the handling for NT Transact + * (defect 11626) + */ + smb_DispatchPacket(vcp, bufp, outbufp, ncbp, NULL); thrd_SetEvent(SessionEvents[idx_session]); - } else { + } else { thrd_SetEvent(SessionEvents[idx_session]); + /* TODO: what else needs to be serialized? */ smb_DispatchPacket(vcp, bufp, outbufp, ncbp, NULL); } +#if !defined(DJGPP) && !defined(AFS_WIN95_ENV) + } + __except( smb_ServerExceptionFilter() ) { + } +#endif smb_concurrentCalls--; doneWithNCB: thrd_SetEvent(NCBavails[idx_NCB]); } + if (vcp) + smb_ReleaseVC(vcp); +} + +/* + * Exception filter for the server threads. If an exception occurs in the + * dispatch routines, which is where exceptions are most common, then do a + * force trace and give control to upstream exception handlers. Useful for + * debugging. + */ +#if !defined(DJGPP) && !defined(AFS_WIN95_ENV) +DWORD smb_ServerExceptionFilter(void) { + /* While this is not the best time to do a trace, if it succeeds, then + * we have a trace (assuming tracing was enabled). Otherwise, this should + * throw a second exception. + */ + HANDLE h; + char *ptbuf[1]; + + ptbuf[0] = "Unhandled exception forcing trace"; + + h = RegisterEventSource(NULL,AFS_DAEMON_EVENT_NAME); + if(h) { + ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1001, NULL,1,0,ptbuf,NULL); + DeregisterEventSource(h); + } + + afsd_ForceTrace(TRUE); + return EXCEPTION_CONTINUE_SEARCH; } +#endif /* * Create a new NCB and associated events, packet buffer, and "space" buffer. @@ -5863,13 +6483,25 @@ void InitNCBslot(int idx) struct smb_packet *bufp; EVENT_HANDLE retHandle; int i; + char eventName[MAX_PATH]; + + osi_assert( idx < (sizeof(NCBs) / sizeof(NCBs[0])) ); NCBs[idx] = GetNCB(); - NCBavails[idx] = thrd_CreateEvent(NULL, FALSE, TRUE, NULL); + sprintf(eventName,"NCBavails[%d]", idx); + NCBavails[idx] = thrd_CreateEvent(NULL, FALSE, TRUE, eventName); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) + afsi_log("Event Object Already Exists: %s", eventName); #ifndef DJGPP - NCBevents[idx] = thrd_CreateEvent(NULL, TRUE, FALSE, NULL); + sprintf(eventName,"NCBevents[%d]", idx); + NCBevents[idx] = thrd_CreateEvent(NULL, TRUE, FALSE, eventName); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) + afsi_log("Event Object Already Exists: %s", eventName); #endif /* !DJGPP */ - retHandle = thrd_CreateEvent(NULL, FALSE, FALSE, NULL); + sprintf(eventName,"NCBReturns[0<=idos_ncb; + dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; #endif /* DJGPP */ + /* retrieve computer name */ + GetComputerName(cname, &cnamelen); + _strupr(cname); + while (1) { memset(ncbp, 0, sizeof(NCB)); flags = 0; -#ifdef DJGPP - /* terminate if shutdown flag is set */ - if (smbShutdownFlag == 1) - thrd_Exit(1); -#endif /* DJGPP */ #ifndef NOEXPIRE /* check for demo expiration */ @@ -5915,46 +6546,77 @@ void smb_Listener(void *parmp) unsigned long tod = time((void *) 0); if (tod > EXPIREDATE) { (*smb_MBfunc)(NULL, "AFS demo expiration", - "afsd listener", - MB_OK|MB_ICONSTOP|MB_SETFOREGROUND); - ExitThread(1); + "afsd listener", + MB_OK|MB_ICONSTOP|MB_SETFOREGROUND|MB_SERVICE_NOTIFICATION); +#ifndef DJGPP + ExitThread(1); +#else + thrd_Exit(1); +#endif } } #endif /* !NOEXPIRE */ - ncbp->ncb_command = NCBLISTEN; - ncbp->ncb_rto = 0; /* No receive timeout */ - ncbp->ncb_sto = 0; /* No send timeout */ + ncbp->ncb_command = NCBLISTEN; + ncbp->ncb_rto = 0; /* No receive timeout */ + ncbp->ncb_sto = 0; /* No send timeout */ /* pad out with spaces instead of null termination */ len = strlen(smb_localNamep); - strncpy(ncbp->ncb_name, smb_localNamep, NCBNAMSZ); - for(i=len; incb_name[i] = ' '; + strncpy(ncbp->ncb_name, smb_localNamep, NCBNAMSZ); + for(i=len; incb_name[i] = ' '; - strcpy(ncbp->ncb_callname, "*"); - for(i=1; incb_callname[i] = ' '; + strcpy(ncbp->ncb_callname, "*"); + for(i=1; incb_callname[i] = ' '; ncbp->ncb_lana_num = lana; #ifndef DJGPP - code = Netbios(ncbp); + code = Netbios(ncbp); #else /* DJGPP */ - code = Netbios(ncbp, dos_ncb); + code = Netbios(ncbp, dos_ncb); +#endif - if (code != 0) - { - fprintf(stderr, "NCBLISTEN lana=%d failed with code %d\n", - ncbp->ncb_lana_num, code); - osi_Log2(0, "NCBLISTEN lana=%d failed with code %d", - ncbp->ncb_lana_num, code); - fprintf(stderr, "\nClient exiting due to network failure " - "(possibly due to power-saving mode)\n"); - fprintf(stderr, "Please restart client.\n"); - afs_exit(AFS_EXITCODE_NETWORK_FAILURE); - } -#endif /* !DJGPP */ + if (code != 0) + { +#ifndef DJGPP + char tbuffer[256]; +#endif + + /* terminate silently if shutdown flag is set */ + if (smbShutdownFlag == 1) { +#ifndef DJGPP + ExitThread(1); +#else + thrd_Exit(1); +#endif + } - osi_assert(code == 0); + osi_Log2(smb_logp, + "NCBLISTEN lana=%d failed with code %d", + ncbp->ncb_lana_num, code); + osi_Log0(smb_logp, + "Client exiting due to network failure. Please restart client.\n"); + +#ifndef DJGPP + sprintf(tbuffer, + "Client exiting due to network failure. Please restart client.\n" + "NCBLISTEN lana=%d failed with code %d", + ncbp->ncb_lana_num, code); + if (showErrors) + code = (*smb_MBfunc)(NULL, tbuffer, "AFS Client Service: Fatal Error", + MB_OK|MB_SERVICE_NOTIFICATION); + osi_assert(tbuffer); + ExitThread(1); +#else + fprintf(stderr, "NCBLISTEN lana=%d failed with code %d\n", + ncbp->ncb_lana_num, code); + fprintf(stderr, "\nClient exiting due to network failure " + "(possibly due to power-saving mode)\n"); + fprintf(stderr, "Please restart client.\n"); + afs_exit(AFS_EXITCODE_NETWORK_FAILURE); +#endif /* !DJGPP */ + } /* check for remote conns */ /* first get remote name and insert null terminator */ @@ -5965,14 +6627,13 @@ void smb_Listener(void *parmp) break; } } - /* get local name and compare */ - GetComputerName(cname, &cnamelen); - _strupr(cname); + + /* compare with local name */ if (!isGateway) if (strncmp(rname, cname, NCBNAMSZ) != 0) flags |= SMB_VCFLAG_REMOTECONN; - osi_Log1(afsd_logp, "New session lsn %d", ncbp->ncb_lsn); + osi_Log1(smb_logp, "New session lsn %d", ncbp->ncb_lsn); /* lock */ lock_ObtainMutex(&smb_ListenerLock); @@ -5980,54 +6641,69 @@ void smb_Listener(void *parmp) sessionGen++; /* Log session startup */ -#ifdef NOSERVICE - fprintf(stderr, "New session(ncb_lsn,ncb_lana_num) %d,%d starting from host " - "%s\n", - ncbp->ncb_lsn,ncbp->ncb_lana_num, rname); +#ifdef NOTSERVICE + fprintf(stderr, "New session(ncb_lsn,ncb_lana_num) %d,%d starting from host " + "%s\n", + ncbp->ncb_lsn,ncbp->ncb_lana_num, rname); #endif - if (reportSessionStartups) { + afsi_log("New session(ncb_lsn,ncb_lana_num) (%d,%d) starting from host %s, %d ongoing ops", + ncbp->ncb_lsn,ncbp->ncb_lana_num, rname, ongoingOps); + + if (reportSessionStartups) { #ifndef DJGPP HANDLE h; char *ptbuf[1]; char s[100]; h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); - sprintf(s, "SMB session startup, %d ongoing ops", - ongoingOps); + sprintf(s, "SMB session startup, %d ongoing ops", ongoingOps); ptbuf[0] = s; ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, 1004, NULL, - 1, 0, ptbuf, NULL); + 1, 0, ptbuf, NULL); DeregisterEventSource(h); #else /* DJGPP */ afsi_log("NCBLISTEN completed, call from %s",rname); - osi_Log1(afsd_logp, "SMB session startup, %d ongoing ops", - ongoingOps); + osi_Log1(smb_logp, "SMB session startup, %d ongoing ops", + ongoingOps); time(&now); - fprintf(stderr, "%s: New session %d starting from host " - "%s\n", - asctime(localtime(&now)), ncbp->ncb_lsn, rname); + fprintf(stderr, "%s: New session %d starting from host %s\n", + asctime(localtime(&now)), ncbp->ncb_lsn, rname); fflush(stderr); #endif /* !DJGPP */ } - /* now ncbp->ncb_lsn is the connection ID */ - vcp = smb_FindVC(ncbp->ncb_lsn, SMB_FLAG_CREATE, ncbp->ncb_lana_num); + /* now ncbp->ncb_lsn is the connection ID */ + vcp = smb_FindVC(ncbp->ncb_lsn, SMB_FLAG_CREATE, ncbp->ncb_lana_num); vcp->flags |= flags; - strcpy(vcp->rname, rname); + strcpy(vcp->rname, rname); /* Allocate slot in session arrays */ /* Re-use dead session if possible, otherwise add one more */ - for (i = 0; i < numSessions; i++) { + /* But don't look at session[0], it is reserved */ + for (i = 1; i < numSessions; i++) { if (dead_sessions[i]) { + afsi_log("connecting to dead session [ %d ]", i); dead_sessions[i] = FALSE; break; } } + + /* assert that we do not exceed the maximum number of sessions or NCBs. + * we should probably want to wait for a session to be freed in case + * we run out. + */ + + osi_assert(i < Sessionmax && numNCBs < NCBmax - 1); + LSNs[i] = ncbp->ncb_lsn; lanas[i] = ncbp->ncb_lana_num; if (i == numSessions) { /* Add new NCB for new session */ + char eventName[MAX_PATH]; + + osi_Log1(smb_logp, "smb_Listener creating new session %d", i); + InitNCBslot(numNCBs); numNCBs++; thrd_SetEvent(NCBavails[0]); @@ -6035,8 +6711,12 @@ void smb_Listener(void *parmp) for (j = 0; j < smb_NumServerThreads; j++) thrd_SetEvent(NCBreturns[j][0]); /* Also add new session event */ - SessionEvents[i] = thrd_CreateEvent(NULL, FALSE, TRUE, NULL); + sprintf(eventName, "SessionEvents[%d]", i); + SessionEvents[i] = thrd_CreateEvent(NULL, FALSE, TRUE, eventName); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) + afsi_log("Event Object Already Exists: %s", eventName); numSessions++; + afsi_log("increasing numNCBs [ %d ] numSessions [ %d ]", numNCBs, numSessions); thrd_SetEvent(SessionEvents[0]); } else { thrd_SetEvent(SessionEvents[i]); @@ -6044,7 +6724,7 @@ void smb_Listener(void *parmp) /* unlock */ lock_ReleaseMutex(&smb_ListenerLock); - } /* dispatch while loop */ + } /* dispatch while loop */ } /* initialize Netbios */ @@ -6059,23 +6739,17 @@ void smb_NetbiosInit() int delname_tried=0; int len; int lana_found = 0; + OSVERSIONINFO Version; - /*******************************************************************/ - /* ms loopback adapter scan */ - /*******************************************************************/ - struct - { - ADAPTER_STATUS status; - NAME_BUFFER NameBuff [30]; - } Adapter; - - int j; - BOOL wla_found; - - /* AFAIK, this is the default for the ms loopback adapter.*/ + /* AFAIK, this is the default for the ms loopback adapter.*/ unsigned char kWLA_MAC[6] = { 0x02, 0x00, 0x4c, 0x4f, 0x4f, 0x50 }; /*******************************************************************/ + /* Get the version of Windows */ + memset(&Version, 0x00, sizeof(Version)); + Version.dwOSVersionInfoSize = sizeof(Version); + GetVersionEx(&Version); + /* setup the NCB system */ ncbp = GetNCB(); #ifdef DJGPP @@ -6085,7 +6759,7 @@ void smb_NetbiosInit() #ifndef DJGPP if (smb_LANadapter == -1) { ncbp->ncb_command = NCBENUM; - ncbp->ncb_buffer = &lana_list; + ncbp->ncb_buffer = (PUCHAR)&lana_list; ncbp->ncb_length = sizeof(lana_list); code = Netbios(ncbp); if (code != 0) { @@ -6108,39 +6782,16 @@ void smb_NetbiosInit() ncbp->ncb_callname[2] = 100; ncbp->ncb_lana_num = lana_list.lana[i]; code = Netbios(ncbp); - if (code == 0) code = ncbp->ncb_retcode; + if (code == 0) + code = ncbp->ncb_retcode; if (code != 0) { - sprintf(s, "Netbios NCBRESET lana %d error code %d", lana_list.lana[i], code); - afsi_log(s); - lana_list.lana[i] = 255; /* invalid lana */ + sprintf(s, "Netbios NCBRESET lana %d error code %d", lana_list.lana[i], code); + afsi_log(s); + lana_list.lana[i] = 255; /* invalid lana */ } else { sprintf(s, "Netbios NCBRESET lana %d succeeded", lana_list.lana[i]); afsi_log(s); - /* check to see if this is the "Microsoft Loopback Adapter" */ - memset( ncbp, 0, sizeof (*ncbp) ); - ncbp->ncb_command = NCBASTAT; - ncbp->ncb_lana_num = lana_list.lana[i]; - strcpy( ncbp->ncb_callname, "* " ); - ncbp->ncb_buffer = (char *) &Adapter; - ncbp->ncb_length = sizeof(Adapter); - code = Netbios( ncbp ); - - if ( code == 0 ) { - wla_found = TRUE; - for (j=0; wla_found && (j<6); j++) - wla_found = ( Adapter.status.adapter_address[j] == kWLA_MAC[j] ); - - if ( wla_found ) { - sprintf(s, "Windows Loopback Adapter detected lana %d", lana_list.lana[i]); - afsi_log(s); - - /* select this lana; no need to continue */ - lana_list.length = 1; - lana_list.lana[0] = lana_list.lana[i]; - break; - } - } - } + } } #else /* for DJGPP, there is no NCBENUM and NCBRESET is a real reset. so @@ -6156,18 +6807,14 @@ void smb_NetbiosInit() } #endif /* !DJGPP */ - try_addname: /* and declare our name so we can receive connections */ memset(ncbp, 0, sizeof(*ncbp)); len=lstrlen(smb_localNamep); memset(smb_sharename,' ',NCBNAMSZ); memcpy(smb_sharename,smb_localNamep,len); -#if 0 - /*ncbp->ncb_lana_num = smb_LANadapter;*/ - strcpy(ncbp->ncb_name, smb_localNamep); - len = strlen(smb_localNamep); - for(i=len; incb_name[i] = ' '; -#endif + sprintf(s, "lana_list.length %d", lana_list.length); + afsi_log(s); + /* Keep the name so we can unregister it later */ for (l = 0; l < lana_list.length; l++) { lana = lana_list.lana[l]; @@ -6192,7 +6839,7 @@ void smb_NetbiosInit() if (code == 0) code = ncbp->ncb_retcode; if (code == 0) { - fprintf(stderr, "Netbios NCBADDNAME succeeded on lana %d\n", lana); + afsi_log("Netbios NCBADDNAME succeeded on lana %d\n", lana); #ifdef DJGPP /* we only use one LANA with djgpp */ lana_list.lana[0] = lana; @@ -6202,13 +6849,12 @@ void smb_NetbiosInit() else { sprintf(s, "Netbios NCBADDNAME lana %d error code %d", lana, code); afsi_log(s); - fprintf(stderr, "Netbios NCBADDNAME lana %d error code %d\n", lana, code); if (code == NRC_BRIDGE) { /* invalid LANA num */ lana_list.lana[l] = 255; continue; } else if (code == NRC_DUPNAME) { - /* Name already exists; try to delete it */ + afsi_log("Name already exists; try to delete it"); memset(ncbp, 0, sizeof(*ncbp)); ncbp->ncb_command = NCBDELNAME; memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ); @@ -6219,9 +6865,10 @@ void smb_NetbiosInit() code = Netbios(ncbp, dos_ncb); #endif /* DJGPP */ if (code == 0) code = ncbp->ncb_retcode; - else - fprintf(stderr, "Netbios NCBDELNAME lana %d error code %d\n", lana, code); - fflush(stderr); + else { + sprintf(s, "Netbios NCBDELNAME lana %d error code %d\n", lana, code); + afsi_log(s); + } if (code != 0 || delname_tried) { lana_list.lana[l] = 255; } @@ -6259,25 +6906,24 @@ void smb_NetbiosInit() } void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt, - int nThreads + int nThreads #ifndef DJGPP - , void *aMBfunc + , void *aMBfunc #endif ) { thread_t phandle; - int lpid; - int i; - long code; - int len; - NCB *ncbp; + int lpid; + int i; + int len; struct tm myTime; - char s[100]; #ifdef DJGPP - int npar, seg, sel; - dos_ptr rawBuf; + int npar, seg, sel; + dos_ptr rawBuf; #endif /* DJGPP */ + EVENT_HANDLE retHandle; + char eventName[MAX_PATH]; #ifndef DJGPP smb_MBfunc = aMBfunc; @@ -6289,13 +6935,12 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt, unsigned long tod = time((void *) 0); if (tod > EXPIREDATE) { #ifndef DJGPP - (*smb_MBfunc)(NULL, "AFS demo expiration", - "afsd", - MB_OK|MB_ICONSTOP|MB_SETFOREGROUND); + (*smb_MBfunc)(NULL, "AFS demo expiration", "afsd", + MB_OK|MB_ICONSTOP|MB_SETFOREGROUND|MB_SERVICE_NOTIFICATION); exit(1); #else /* DJGPP */ - fprintf(stderr, "AFS demo expiration\n"); - afs_exit(0); + fprintf(stderr, "AFS demo expiration\n"); + afs_exit(0); #endif /* !DJGPP */ } } @@ -6320,14 +6965,15 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt, /* initialize the remote debugging log */ smb_logp = logp; - /* remember the name */ + /* remember the name */ len = strlen(snamep); - smb_localNamep = malloc(len+1); - strcpy(smb_localNamep, snamep); + smb_localNamep = malloc(len+1); + strcpy(smb_localNamep, snamep); + afsi_log("smb_localNamep is >%s<", smb_localNamep); /* and the global lock */ - lock_InitializeRWLock(&smb_globalLock, "smb global lock"); - lock_InitializeRWLock(&smb_rctLock, "smb refct and tree struct lock"); + lock_InitializeRWLock(&smb_globalLock, "smb global lock"); + lock_InitializeRWLock(&smb_rctLock, "smb refct and tree struct lock"); /* Raw I/O data structures */ lock_InitializeMutex(&smb_RawBufLock, "smb raw buffer lock"); @@ -6336,64 +6982,77 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt, /* 4 Raw I/O buffers */ #ifndef DJGPP - smb_RawBufs = GlobalAlloc(GMEM_FIXED, 65536); + smb_RawBufs = calloc(65536,1); *((char **)smb_RawBufs) = NULL; for (i=0; i<3; i++) { - char *rawBuf = GlobalAlloc(GMEM_FIXED, 65536); + char *rawBuf = calloc(65536,1); *((char **)rawBuf) = smb_RawBufs; smb_RawBufs = rawBuf; } #else /* DJGPP */ + npar = 65536 >> 4; /* number of paragraphs */ + seg = __dpmi_allocate_dos_memory(npar, &smb_RawBufSel[0]); + if (seg == -1) { + afsi_log("Cannot allocate %d paragraphs of DOS memory", + npar); + osi_panic("",__FILE__,__LINE__); + } + else { + afsi_log("Allocated %d paragraphs of DOS mem at 0x%X", + npar, seg); + } + smb_RawBufs = (seg * 16) + 0; /* DOS physical address */ + + _farpokel(_dos_ds, smb_RawBufs, NULL); + for (i=0; i> 4; /* number of paragraphs */ - seg = __dpmi_allocate_dos_memory(npar, &smb_RawBufSel[0]); + seg = __dpmi_allocate_dos_memory(npar, &smb_RawBufSel[i+1]); if (seg == -1) { - afsi_log("Cannot allocate %d paragraphs of DOS memory", - npar); - osi_panic("",__FILE__,__LINE__); - } - else { - afsi_log("Allocated %d paragraphs of DOS mem at 0x%X", - npar, seg); - } - smb_RawBufs = (seg * 16) + 0; /* DOS physical address */ - - _farpokel(_dos_ds, smb_RawBufs, NULL); - for (i=0; i> 4; /* number of paragraphs */ - seg = __dpmi_allocate_dos_memory(npar, &smb_RawBufSel[i+1]); - if (seg == -1) { afsi_log("Cannot allocate %d paragraphs of DOS memory", - npar); + npar); osi_panic("",__FILE__,__LINE__); - } - else { + } + else { afsi_log("Allocated %d paragraphs of DOS mem at 0x%X", - npar, seg); - } - rawBuf = (seg * 16) + 0; /* DOS physical address */ - /*_farpokel(_dos_ds, smb_RawBufs, smb_RawBufs);*/ - _farpokel(_dos_ds, rawBuf, smb_RawBufs); - smb_RawBufs = rawBuf; + npar, seg); } + rawBuf = (seg * 16) + 0; /* DOS physical address */ + /*_farpokel(_dos_ds, smb_RawBufs, smb_RawBufs);*/ + _farpokel(_dos_ds, rawBuf, smb_RawBufs); + smb_RawBufs = rawBuf; + } #endif /* !DJGPP */ /* global free lists */ smb_ncbFreeListp = NULL; - smb_packetFreeListp = NULL; + smb_packetFreeListp = NULL; - smb_NetbiosInit(); + smb_NetbiosInit(); /* Initialize listener and server structures */ memset(dead_sessions, 0, sizeof(dead_sessions)); - SessionEvents[0] = thrd_CreateEvent(NULL, FALSE, FALSE, NULL); + sprintf(eventName, "SessionEvents[0]"); + SessionEvents[0] = thrd_CreateEvent(NULL, FALSE, FALSE, eventName); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) + afsi_log("Event Object Already Exists: %s", eventName); numSessions = 1; smb_NumServerThreads = nThreads; - NCBavails[0] = thrd_CreateEvent(NULL, FALSE, FALSE, NULL); - NCBevents[0] = thrd_CreateEvent(NULL, FALSE, FALSE, NULL); + sprintf(eventName, "NCBavails[0]"); + NCBavails[0] = thrd_CreateEvent(NULL, FALSE, FALSE, eventName); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) + afsi_log("Event Object Already Exists: %s", eventName); + sprintf(eventName, "NCBevents[0]"); + NCBevents[0] = thrd_CreateEvent(NULL, FALSE, FALSE, eventName); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) + afsi_log("Event Object Already Exists: %s", eventName); NCBreturns = malloc(nThreads * sizeof(EVENT_HANDLE *)); - for (i = 0; i < nThreads; i++) { + sprintf(eventName, "NCBreturns[0<=idos_ncb; + /* setup the NCB system */ + ncbp = GetNCB(); +#ifdef DJGPP + dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; +#endif - /* Block new sessions by setting shutdown flag */ - /*smbShutdownFlag = 1;*/ + /* Block new sessions by setting shutdown flag */ + smbShutdownFlag = 1; - /* Hang up all sessions */ - for (i = 1; i < numSessions; i++) - { - if (dead_sessions[i]) + /* Hang up all sessions */ + memset((char *)ncbp, 0, sizeof(NCB)); + for (i = 1; i < numSessions; i++) + { + if (dead_sessions[i]) continue; - - /*fprintf(stderr, "NCBHANGUP session %d LSN %d\n", i, LSNs[i]);*/ - ncbp->ncb_command = NCBHANGUP; - ncbp->ncb_lana_num = lanas[i]; /*smb_LANadapter;*/ - ncbp->ncb_lsn = LSNs[i]; - code = Netbios(ncbp, dos_ncb); - /*fprintf(stderr, "returned from NCBHANGUP session %d LSN %d\n", i, LS - Ns[i]);*/ - if (code == 0) code = ncbp->ncb_retcode; - if (code != 0) { + + /*fprintf(stderr, "NCBHANGUP session %d LSN %d\n", i, LSNs[i]);*/ + ncbp->ncb_command = NCBHANGUP; + ncbp->ncb_lana_num = lanas[i]; /*smb_LANadapter;*/ + ncbp->ncb_lsn = LSNs[i]; +#ifndef DJGPP + code = Netbios(ncbp); +#else + code = Netbios(ncbp, dos_ncb); +#endif + /*fprintf(stderr, "returned from NCBHANGUP session %d LSN %d\n", i, LSNs[i]);*/ + if (code == 0) code = ncbp->ncb_retcode; + if (code != 0) { + osi_Log1(smb_logp, "Netbios NCBHANGUP error code %d", code); fprintf(stderr, "Session %d Netbios NCBHANGUP error code %d", i, code); - } } + } -#if 1 - /* Delete Netbios name */ + /* Delete Netbios name */ + memset((char *)ncbp, 0, sizeof(NCB)); for (i = 0; i < lana_list.length; i++) { if (lana_list.lana[i] == 255) continue; ncbp->ncb_command = NCBDELNAME; ncbp->ncb_lana_num = lana_list.lana[i]; memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ); +#ifndef DJGPP + code = Netbios(ncbp); +#else code = Netbios(ncbp, dos_ncb); +#endif if (code == 0) code = ncbp->ncb_retcode; if (code != 0) { fprintf(stderr, "Netbios NCBDELNAME lana %d error code %d", @@ -6583,6 +7252,129 @@ void smb_Shutdown(void) } fflush(stderr); } -#endif } -#endif /* DJGPP */ + +/* Get the UNC \\\ prefix. */ +char *smb_GetSharename() +{ + char *name; + + /* Make sure we have been properly initialized. */ + if (smb_localNamep == NULL) + return NULL; + + /* Allocate space for \\\, plus the + * terminator. + */ + name = malloc(strlen(smb_localNamep) + strlen("ALL") + 4); + sprintf(name, "\\\\%s\\%s", smb_localNamep, "ALL"); + return name; +} + +#ifdef NOTSERVICE + +void smb_LogPacket(smb_packet_t *packet) +{ + BYTE *vp, *cp; + unsigned length, paramlen, datalen, i, j; + char buf[81]; + char hex[]={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; + + if(!packet) return; + + osi_Log0(smb_logp, "*** SMB packet dump ***"); + + vp = (BYTE *) packet->data; + + datalen = *((WORD*)(vp + (paramlen = ((unsigned)*(vp+20)) << 1))); + length = paramlen + 2 + datalen; + + + for(i=0;i < length; i+=16) + { + memset( buf, ' ', 80 ); + buf[80] = 0; + + itoa( i, buf, 16 ); + + buf[strlen(buf)] = ' '; + + cp = (BYTE*) buf + 7; + + for(j=0;j < 16 && (i+j)> 4]; + *(cp++) = hex[vp[i+j] & 0xf]; + *(cp++) = ' '; + + if(j==7) + { + *(cp++) = '-'; + *(cp++) = ' '; + } + } + + for(j=0;j < 16 && (i+j) vp[i+j] )? vp[i+j]:'.'; + if(j==7) + { + *(cp++) = ' '; + *(cp++) = '-'; + *(cp++) = ' '; + } + } + + *cp = 0; + + osi_Log0( smb_logp, buf ); + } + + osi_Log0(smb_logp, "*** End SMB packet dump ***"); + +} + +#endif /* NOTSERVICE */ + +int smb_DumpVCP(FILE *outputFile, char *cookie) +{ + int zilch; + char output[1024]; + + smb_vc_t *vcp; + + lock_ObtainRead(&smb_rctLock); + + sprintf(output, "begin dumping vcpsp\n"); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + + for(vcp = smb_allVCsp; vcp; vcp=vcp->nextp) + { + smb_fid_t *fidp; + + sprintf(output, "%s vcp=0x%08X, refCount=%d, flags=%d, vcID=%d, lsn=%d, uidCounter=%d, tidCounter=%d, fidCounter=%d\n", + cookie, vcp, vcp->refCount, vcp->flags, vcp->vcID, vcp->lsn, vcp->uidCounter, vcp->tidCounter, vcp->fidCounter); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + + sprintf(output, "begin dumping fidsp\n"); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + + for (fidp = vcp->fidsp; fidp; fidp = (smb_fid_t *) osi_QNext(&fidp->q)) + { + sprintf(output, "%s -- fidp=0x%08X, refCount=%d, fid=%d, vcp=0x%08X, scp=0x%08X, ioctlp=0x%08X, NTopen_pathp=%s, NTopen_wholepathp=%s\n", + cookie, fidp, fidp->refCount, fidp->fid, fidp->vcp, fidp->scp, fidp->ioctlp, + fidp->NTopen_pathp ? fidp->NTopen_pathp : "NULL", + fidp->NTopen_wholepathp ? fidp->NTopen_wholepathp : "NULL"); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + } + + sprintf(output, "done dumping fidsp\n"); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + } + + sprintf(output, "done dumping vcpsp\n"); + WriteFile(outputFile, output, strlen(output), &zilch, NULL); + + lock_ReleaseRead(&smb_rctLock); + return 0; +} diff --git a/src/WINNT/afsd/smb.h b/src/WINNT/afsd/smb.h index 8afe8d459..caa7c1316 100644 --- a/src/WINNT/afsd/smb.h +++ b/src/WINNT/afsd/smb.h @@ -258,6 +258,18 @@ typedef struct smb_fid { #define SMB_FID_LOOKSLIKECOPY (SMB_FID_LENGTHSETDONE | SMB_FID_MTIMESETDONE) #define SMB_FID_NTOPEN 0x100 /* have dscp and pathp */ +/* + * SMB file attributes + */ +#define SMB_ATTR_ARCHIVE 0x20 +#define SMB_ATTR_COMPRESSED 0x800 /* file or dir is compressed */ +#define SMB_ATTR_NORMAL 0x80 /* normal file. Only valid if used alone */ +#define SMB_ATTR_HIDDEN 0x2 /* hidden file for the purpose of dir listings */ +#define SMB_ATTR_READONLY 0x1 +#define SMB_ATTR_TEMPORARY 0x100 +#define SMB_ATTR_DIRECTORY 0x10 +#define SMB_ATTR_SYSTEM 0x4 + /* for tracking in-progress directory searches */ typedef struct smb_dirSearch { osi_queue_t q; /* queue of all outstanding cookies */ @@ -281,11 +293,16 @@ typedef struct smb_dirSearch { /* type for patching directory listings */ typedef struct smb_dirListPatch { osi_queue_t q; - char *dptr; /* ptr to attr, time, data, sizel, sizeh */ + char *dptr; /* ptr to attr, time, data, sizel, sizeh */ + long flags; /* flags. See below */ cm_fid_t fid; cm_dirEntry_t *dep; /* temp */ } smb_dirListPatch_t; +/* dirListPatch Flags */ +#define SMB_DIRLISTPATCH_DOTFILE 1 /* the file referenced is a dot file + Note: will not be set if smb_hideDotFiles is false */ + /* waiting lock list elements */ typedef struct smb_waitingLock { osi_queue_t q; @@ -296,7 +313,7 @@ typedef struct smb_waitingLock { void *lockp; } smb_waitingLock_t; -smb_waitingLock_t *smb_allWaitingLocks; +extern smb_waitingLock_t *smb_allWaitingLocks; typedef long (smb_proc_t)(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp); @@ -334,7 +351,7 @@ extern void smb_DosUTimeFromUnixTime(long *dosUTimep, long unixTime); extern void smb_UnixTimeFromDosUTime(long *unixTimep, long dosUTime); -extern smb_vc_t *smb_FindVC(unsigned short lsn, int flags, int lana); +extern smb_vc_t *smb_FindVC(unsigned short lsn, int flags, int lana); extern void smb_ReleaseVC(smb_vc_t *vcp); @@ -344,6 +361,14 @@ extern void smb_ReleaseTID(smb_tid_t *tidp); extern smb_user_t *smb_FindUID(smb_vc_t *vcp, unsigned short uid, int flags); +extern smb_username_t *smb_FindUserByName(char *usern, char *machine, int flags); + +extern smb_user_t *smb_FindUserByNameThisSession(smb_vc_t *vcp, char *usern); + +extern smb_username_t *smb_FindUserByName(char *usern, char *machine, int flags); + +extern smb_user_t *smb_FindUserByNameThisSession(smb_vc_t *vcp, char *usern); + extern void smb_ReleaseUID(smb_user_t *uidp); extern cm_user_t *smb_GetUser(smb_vc_t *vcp, smb_packet_t *inp); @@ -356,6 +381,8 @@ extern void smb_ReleaseFID(smb_fid_t *fidp); extern int smb_FindShare(smb_vc_t *vcp, smb_packet_t *inp, char *shareName, char **pathNamep); +extern int smb_FindShareCSCPolicy(char *shareName); + extern smb_dirSearch_t *smb_FindDirSearchNL(long cookie); extern void smb_DeleteDirSearch(smb_dirSearch_t *dsp); @@ -420,9 +447,19 @@ extern osi_rwlock_t smb_rctLock; extern int smb_LogoffTokenTransfer; extern unsigned long smb_LogoffTransferTimeout; +extern int smb_maxVCPerServer; /* max # of VCs per server */ +extern int smb_maxMpxRequests; /* max # of mpx requests */ + +extern int smb_hideDotFiles; +extern unsigned int smb_IsDotFile(char *lastComp); + extern void smb_FormatResponsePacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *op); +extern char *myCrt_2Dispatch(int i); + +extern char *myCrt_2Dispatch(int i); + extern unsigned int smb_Attributes(cm_scache_t *scp); extern int smb_ChainFID(int fid, smb_packet_t *inp); @@ -449,11 +486,16 @@ extern long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, extern BOOL smb_IsLegalFilename(char *filename); +extern char *smb_GetSharename(void); + /* include other include files */ #include "smb3.h" #include "smb_ioctl.h" #include "smb_iocons.h" - -cm_user_t *smb_FindOrCreateUser(smb_vc_t *vcp, char *usern); +cm_user_t *smb_FindOrCreateUser(smb_vc_t *vcp, char *usern); + +#ifdef NOTSERVICE +extern void smb_LogPacket(smb_packet_t *packet); +#endif /* NOTSERVICE */ #endif /* whole file */ diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index aadbe0f2c..95097b7cb 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -7,8 +7,6 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -//#define NOSERVICE 1 - #include #include @@ -27,8 +25,6 @@ #include "smb.h" -extern smb_vc_t *dead_vcp; - extern osi_hyper_t hzero; smb_packet_t *smb_Directory_Watches = NULL; @@ -44,21 +40,21 @@ smb_tran2Packet_t *smb_tran2AssemblyQueuep; cm_user_t *smb_GetTran2User(smb_vc_t *vcp, smb_tran2Packet_t *inp) { smb_user_t *uidp; - cm_user_t *up = NULL; + cm_user_t *up = NULL; - uidp = smb_FindUID(vcp, inp->uid, 0); - if (!uidp) return NULL; + uidp = smb_FindUID(vcp, inp->uid, 0); + if (!uidp) return NULL; lock_ObtainMutex(&uidp->mx); - if (uidp->unp) { - up = uidp->unp->userp; - cm_HoldUser(up); - } + if (uidp->unp) { + up = uidp->unp->userp; + cm_HoldUser(up); + } lock_ReleaseMutex(&uidp->mx); - smb_ReleaseUID(uidp); - - return up; + smb_ReleaseUID(uidp); + + return up; } /* @@ -72,7 +68,7 @@ unsigned long smb_ExtAttributes(cm_scache_t *scp) if (scp->fileType == CM_SCACHETYPE_DIRECTORY || scp->fileType == CM_SCACHETYPE_MOUNTPOINT) - attrs = 0x10; + attrs = SMB_ATTR_DIRECTORY; else attrs = 0; /* @@ -83,37 +79,38 @@ unsigned long smb_ExtAttributes(cm_scache_t *scp) if ((scp->unixModeBits & 0222) == 0 || (scp->flags & CM_SCACHEFLAG_RO)) #endif if ((scp->unixModeBits & 0222) == 0) - attrs |= 1; /* Read-only */ + attrs |= SMB_ATTR_READONLY; /* Read-only */ if (attrs == 0) - attrs = 0x80; /* FILE_ATTRIBUTE_NORMAL */ + attrs = SMB_ATTR_NORMAL; /* FILE_ATTRIBUTE_NORMAL */ return attrs; } int smb_V3IsStarMask(char *maskp) { - char tc; + char tc; while (tc = *maskp++) - if (tc == '?' || tc == '*') return 1; + if (tc == '?' || tc == '*') + return 1; return 0; } unsigned char *smb_ParseString(unsigned char *inp, char **chainpp) { - if (chainpp) { + if (chainpp) { /* skip over null-terminated string */ *chainpp = inp + strlen(inp) + 1; - } - return inp; -} + } + return inp; +} long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { char *tp; char *usern, *pwd, *pwdx; - smb_user_t *uidp, *dead_uidp; + smb_user_t *uidp; unsigned short newUid; unsigned long caps; cm_user_t *userp; @@ -154,7 +151,7 @@ long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t * userp = unp->userp; newUid = (unsigned short)uidp->userID; /* For some reason these are different types!*/ osi_LogEvent("AFS smb_ReceiveV3SessionSetupX",NULL,"FindUserByName:Lana[%d],lsn[%d],userid[%d],name[%s]",vcp->lana,vcp->lsn,newUid,usern); - osi_Log3(afsd_logp,"smb_ReceiveV3SessionSetupX FindUserByName:Lana[%d],lsn[%d],userid[%d]",vcp->lana,vcp->lsn,newUid); + osi_Log3(smb_logp,"smb_ReceiveV3SessionSetupX FindUserByName:Lana[%d],lsn[%d],userid[%d]",vcp->lana,vcp->lsn,newUid); smb_ReleaseUID(uidp); } else { @@ -164,8 +161,10 @@ long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t * /* Create a new UID and cm_user_t structure */ userp = unp->userp; if (!userp) - userp = cm_NewUser(); + userp = cm_NewUser(); lock_ObtainMutex(&vcp->mx); + if (!vcp->uidCounter) + vcp->uidCounter++; /* handle unlikely wraparounds */ newUid = (strlen(usern)==0)?0:vcp->uidCounter++; lock_ReleaseMutex(&vcp->mx); @@ -177,8 +176,8 @@ long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t * uidp = smb_FindUID(vcp, newUid, SMB_FLAG_CREATE); lock_ObtainMutex(&uidp->mx); uidp->unp = unp; - osi_LogEvent("AFS smb_ReceiveV3SessionSetupX",NULL,"MakeNewUser:VCP[%x],Lana[%d],lsn[%d],userid[%d],TicketKTCName[%s]",vcp,vcp->lana,vcp->lsn,newUid,usern); - osi_Log4(afsd_logp,"smb_ReceiveV3SessionSetupX MakeNewUser:VCP[%x],Lana[%d],lsn[%d],userid[%d]",vcp,vcp->lana,vcp->lsn,newUid); + osi_LogEvent("AFS smb_ReceiveV3SessionSetupX",NULL,"MakeNewUser:VCP[%x],Lana[%d],lsn[%d],userid[%d],TicketKTCName[%s]",(int)vcp,vcp->lana,vcp->lsn,newUid,usern); + osi_Log4(smb_logp,"smb_ReceiveV3SessionSetupX MakeNewUser:VCP[%x],Lana[%d],lsn[%d],userid[%d]",vcp,vcp->lana,vcp->lsn,newUid); lock_ReleaseMutex(&uidp->mx); smb_ReleaseUID(uidp); } @@ -188,8 +187,8 @@ long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t * /* Also to the next chained message */ ((smb_t *)inp)->uid = newUid; - osi_Log3(afsd_logp, "SMB3 session setup name %s creating ID %d%s", - osi_LogSaveString(afsd_logp, usern), newUid, osi_LogSaveString(afsd_logp, s1)); + osi_Log3(smb_logp, "SMB3 session setup name %s creating ID %d%s", + osi_LogSaveString(smb_logp, usern), newUid, osi_LogSaveString(smb_logp, s1)); smb_SetSMBParm(outp, 2, 0); smb_SetSMBDataLength(outp, 0); return 0; @@ -205,17 +204,18 @@ long smb_ReceiveV3UserLogoffX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou inp->flags |= SMB_PACKETFLAG_PROFILE_UPDATE_OK; /* find the tree and free it */ - uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0); - if (uidp) { + uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0); + /* TODO: smb_ReleaseUID() ? */ + if (uidp) { char *s1 = NULL, *s2 = NULL; if (s2 == NULL) s2 = " "; if (s1 == NULL) {s1 = s2; s2 = " ";} - osi_Log4(afsd_logp, "SMB3 user logoffX uid %d name %s%s%s", - uidp->userID, - osi_LogSaveString(afsd_logp, - (uidp->unp) ? uidp->unp->name: " "), s1, s2); + osi_Log4(smb_logp, "SMB3 user logoffX uid %d name %s%s%s", + uidp->userID, + osi_LogSaveString(smb_logp, + (uidp->unp) ? uidp->unp->name: " "), s1, s2); lock_ObtainMutex(&uidp->mx); uidp->flags |= SMB_USERFLAG_DELETE; @@ -223,49 +223,51 @@ long smb_ReceiveV3UserLogoffX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *ou * it doesn't get deleted right away * because the vcp points to it */ - lock_ReleaseMutex(&uidp->mx); - } - else - osi_Log0(afsd_logp, "SMB3 user logoffX"); + lock_ReleaseMutex(&uidp->mx); + } + else + osi_Log0(smb_logp, "SMB3 user logoffX"); - smb_SetSMBDataLength(outp, 0); - return 0; + smb_SetSMBDataLength(outp, 0); + return 0; } +#define SMB_SUPPORT_SEARCH_BITS 0x0001 + long smb_ReceiveV3TreeConnectX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { - smb_tid_t *tidp; - unsigned short newTid; - char shareName[256]; + smb_tid_t *tidp; + unsigned short newTid; + char shareName[256]; char *sharePath; int shareFound; - char *tp; - char *pathp; - char *passwordp; + char *tp; + char *pathp; + char *passwordp; char *servicep; - cm_user_t *userp; + cm_user_t *userp; - osi_Log0(afsd_logp, "SMB3 receive tree connect"); + osi_Log0(smb_logp, "SMB3 receive tree connect"); /* parse input parameters */ tp = smb_GetSMBData(inp, NULL); - passwordp = smb_ParseString(tp, &tp); + passwordp = smb_ParseString(tp, &tp); pathp = smb_ParseString(tp, &tp); servicep = smb_ParseString(tp, &tp); tp = strrchr(pathp, '\\'); - if (!tp) { - return CM_ERROR_BADSMB; - } - strcpy(shareName, tp+1); + if (!tp) { + return CM_ERROR_BADSMB; + } + strcpy(shareName, tp+1); if (strcmp(servicep, "IPC") == 0 || strcmp(shareName, "IPC$") == 0) return CM_ERROR_NOIPC; - userp = smb_GetUser(vcp, inp); + userp = smb_GetUser(vcp, inp); lock_ObtainMutex(&vcp->mx); - newTid = vcp->tidCounter++; + newTid = vcp->tidCounter++; lock_ReleaseMutex(&vcp->mx); tidp = smb_FindTID(vcp, newTid, SMB_FLAG_CREATE); @@ -274,68 +276,71 @@ long smb_ReceiveV3TreeConnectX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *o smb_ReleaseTID(tidp); return CM_ERROR_BADSHARENAME; } - lock_ObtainMutex(&tidp->mx); - tidp->userp = userp; + lock_ObtainMutex(&tidp->mx); + tidp->userp = userp; tidp->pathname = sharePath; - lock_ReleaseMutex(&tidp->mx); - smb_ReleaseTID(tidp); + lock_ReleaseMutex(&tidp->mx); + smb_ReleaseTID(tidp); if (vcp->flags & SMB_VCFLAG_USENT) - smb_SetSMBParm(outp, 2, 0); /* OptionalSupport bits */ + { + int policy = smb_FindShareCSCPolicy(shareName); + smb_SetSMBParm(outp, 2, SMB_SUPPORT_SEARCH_BITS | (policy << 2)); + } ((smb_t *)outp)->tid = newTid; ((smb_t *)inp)->tid = newTid; tp = smb_GetSMBData(outp, NULL); - *tp++ = 'A'; - *tp++ = ':'; - *tp++ = 0; - smb_SetSMBDataLength(outp, 3); - - osi_Log1(afsd_logp, "SMB3 tree connect created ID %d", newTid); - return 0; + *tp++ = 'A'; + *tp++ = ':'; + *tp++ = 0; + smb_SetSMBDataLength(outp, 3); + + osi_Log1(smb_logp, "SMB3 tree connect created ID %d", newTid); + return 0; } /* must be called with global tran lock held */ smb_tran2Packet_t *smb_FindTran2Packet(smb_vc_t *vcp, smb_packet_t *inp) { smb_tran2Packet_t *tp; - smb_t *smbp; + smb_t *smbp; - smbp = (smb_t *) inp->data; + smbp = (smb_t *) inp->data; for(tp = smb_tran2AssemblyQueuep; tp; tp = (smb_tran2Packet_t *) osi_QNext(&tp->q)) { if (tp->vcp == vcp && tp->mid == smbp->mid && tp->tid == smbp->tid) - return tp; - } - return NULL; + return tp; + } + return NULL; } smb_tran2Packet_t *smb_NewTran2Packet(smb_vc_t *vcp, smb_packet_t *inp, int totalParms, int totalData) { smb_tran2Packet_t *tp; - smb_t *smbp; + smb_t *smbp; - smbp = (smb_t *) inp->data; + smbp = (smb_t *) inp->data; tp = malloc(sizeof(*tp)); - memset(tp, 0, sizeof(*tp)); - tp->vcp = vcp; - smb_HoldVC(vcp); - tp->curData = tp->curParms = 0; - tp->totalData = totalData; - tp->totalParms = totalParms; - tp->tid = smbp->tid; - tp->mid = smbp->mid; - tp->uid = smbp->uid; - tp->pid = smbp->pid; + memset(tp, 0, sizeof(*tp)); + tp->vcp = vcp; + smb_HoldVC(vcp); + tp->curData = tp->curParms = 0; + tp->totalData = totalData; + tp->totalParms = totalParms; + tp->tid = smbp->tid; + tp->mid = smbp->mid; + tp->uid = smbp->uid; + tp->pid = smbp->pid; tp->res[0] = smbp->res[0]; osi_QAdd((osi_queue_t **)&smb_tran2AssemblyQueuep, &tp->q); - tp->opcode = smb_GetSMBParm(inp, 14); + tp->opcode = smb_GetSMBParm(inp, 14); if (totalParms != 0) - tp->parmsp = malloc(totalParms); + tp->parmsp = malloc(totalParms); if (totalData != 0) - tp->datap = malloc(totalData); + tp->datap = malloc(totalData); tp->flags |= SMB_TRAN2PFLAG_ALLOC; - return tp; + return tp; } smb_tran2Packet_t *smb_GetTran2ResponsePacket(smb_vc_t *vcp, @@ -348,18 +353,18 @@ smb_tran2Packet_t *smb_GetTran2ResponsePacket(smb_vc_t *vcp, unsigned short dataAlign; tp = malloc(sizeof(*tp)); - memset(tp, 0, sizeof(*tp)); - tp->vcp = NULL; - tp->curData = tp->curParms = 0; - tp->totalData = totalData; - tp->totalParms = totalParms; + memset(tp, 0, sizeof(*tp)); + tp->vcp = NULL; + tp->curData = tp->curParms = 0; + tp->totalData = totalData; + tp->totalParms = totalParms; tp->oldTotalParms = totalParms; - tp->tid = inp->tid; - tp->mid = inp->mid; - tp->uid = inp->uid; - tp->pid = inp->pid; + tp->tid = inp->tid; + tp->mid = inp->mid; + tp->uid = inp->uid; + tp->pid = inp->pid; tp->res[0] = inp->res[0]; - tp->opcode = inp->opcode; + tp->opcode = inp->opcode; /* * We calculate where the parameters and data will start. @@ -376,20 +381,20 @@ smb_tran2Packet_t *smb_GetTran2ResponsePacket(smb_vc_t *vcp, dataOffset += dataAlign; tp->datap = outp->data + dataOffset; - return tp; + return tp; } /* free a tran2 packet; must be called with smb_globalLock held */ void smb_FreeTran2Packet(smb_tran2Packet_t *t2p) { - if (t2p->vcp) smb_ReleaseVC(t2p->vcp); + if (t2p->vcp) smb_ReleaseVC(t2p->vcp); if (t2p->flags & SMB_TRAN2PFLAG_ALLOC) { if (t2p->parmsp) free(t2p->parmsp); if (t2p->datap) free(t2p->datap); } - free(t2p); + free(t2p); } /* called with a VC, an input packet to respond to, and an error code. @@ -398,29 +403,29 @@ void smb_FreeTran2Packet(smb_tran2Packet_t *t2p) void smb_SendTran2Error(smb_vc_t *vcp, smb_tran2Packet_t *t2p, smb_packet_t *tp, long code) { - smb_t *smbp; - unsigned short errCode; - unsigned char errClass; + smb_t *smbp; + unsigned short errCode; + unsigned char errClass; unsigned long NTStatus; - if (vcp->flags & SMB_VCFLAG_STATUS32) + if (vcp->flags & SMB_VCFLAG_STATUS32) smb_MapNTError(code, &NTStatus); else smb_MapCoreError(code, vcp, &errCode, &errClass); - smb_FormatResponsePacket(vcp, NULL, tp); - smbp = (smb_t *) tp; - + smb_FormatResponsePacket(vcp, NULL, tp); + smbp = (smb_t *) tp; + /* We can handle long names */ if (vcp->flags & SMB_VCFLAG_USENT) smbp->flg2 |= 0x40; /* IS_LONG_NAME */ - /* now copy important fields from the tran 2 packet */ - smbp->com = 0x32; /* tran 2 response */ - smbp->tid = t2p->tid; - smbp->mid = t2p->mid; - smbp->pid = t2p->pid; - smbp->uid = t2p->uid; + /* now copy important fields from the tran 2 packet */ + smbp->com = 0x32; /* tran 2 response */ + smbp->tid = t2p->tid; + smbp->mid = t2p->mid; + smbp->pid = t2p->pid; + smbp->uid = t2p->uid; smbp->res[0] = t2p->res[0]; if (vcp->flags & SMB_VCFLAG_STATUS32) { smbp->rcls = (unsigned char) (NTStatus & 0xff); @@ -430,83 +435,83 @@ void smb_SendTran2Error(smb_vc_t *vcp, smb_tran2Packet_t *t2p, smbp->flg2 |= 0x4000; } else { - smbp->rcls = errClass; + smbp->rcls = errClass; smbp->errLow = (unsigned char) (errCode & 0xff); smbp->errHigh = (unsigned char) ((errCode >> 8) & 0xff); } - /* send packet */ - smb_SendPacket(vcp, tp); + /* send packet */ + smb_SendPacket(vcp, tp); } void smb_SendTran2Packet(smb_vc_t *vcp, smb_tran2Packet_t *t2p, smb_packet_t *tp) { - smb_t *smbp; - unsigned short parmOffset; + smb_t *smbp; + unsigned short parmOffset; unsigned short dataOffset; unsigned short totalLength; unsigned short dataAlign; - char *datap; + char *datap; - smb_FormatResponsePacket(vcp, NULL, tp); - smbp = (smb_t *) tp; + smb_FormatResponsePacket(vcp, NULL, tp); + smbp = (smb_t *) tp; /* We can handle long names */ if (vcp->flags & SMB_VCFLAG_USENT) smbp->flg2 |= 0x40; /* IS_LONG_NAME */ - - /* now copy important fields from the tran 2 packet */ - smbp->com = 0x32; /* tran 2 response */ - smbp->tid = t2p->tid; - smbp->mid = t2p->mid; - smbp->pid = t2p->pid; - smbp->uid = t2p->uid; + + /* now copy important fields from the tran 2 packet */ + smbp->com = 0x32; /* tran 2 response */ + smbp->tid = t2p->tid; + smbp->mid = t2p->mid; + smbp->pid = t2p->pid; + smbp->uid = t2p->uid; smbp->res[0] = t2p->res[0]; - totalLength = 1 + t2p->totalData + t2p->totalParms; + totalLength = 1 + t2p->totalData + t2p->totalParms; - /* now add the core parameters (tran2 info) to the packet */ - smb_SetSMBParm(tp, 0, t2p->totalParms); /* parm bytes */ - smb_SetSMBParm(tp, 1, t2p->totalData); /* data bytes */ - smb_SetSMBParm(tp, 2, 0); /* reserved */ - smb_SetSMBParm(tp, 3, t2p->totalParms); /* parm bytes in this packet */ + /* now add the core parameters (tran2 info) to the packet */ + smb_SetSMBParm(tp, 0, t2p->totalParms); /* parm bytes */ + smb_SetSMBParm(tp, 1, t2p->totalData); /* data bytes */ + smb_SetSMBParm(tp, 2, 0); /* reserved */ + smb_SetSMBParm(tp, 3, t2p->totalParms); /* parm bytes in this packet */ parmOffset = 10*2 + 35; /* parm offset in packet */ parmOffset++; /* round to even */ - smb_SetSMBParm(tp, 4, parmOffset); /* 11 parm words plus * - * hdr, bcc and wct */ - smb_SetSMBParm(tp, 5, 0); /* parm displacement */ - smb_SetSMBParm(tp, 6, t2p->totalData); /* data in this packet */ + smb_SetSMBParm(tp, 4, parmOffset); /* 11 parm words plus * + * hdr, bcc and wct */ + smb_SetSMBParm(tp, 5, 0); /* parm displacement */ + smb_SetSMBParm(tp, 6, t2p->totalData); /* data in this packet */ dataOffset = parmOffset + t2p->oldTotalParms; dataAlign = dataOffset & 2; /* quad-align */ dataOffset += dataAlign; - smb_SetSMBParm(tp, 7, dataOffset); /* offset of data */ - smb_SetSMBParm(tp, 8, 0); /* data displacement */ - smb_SetSMBParm(tp, 9, 0); /* low: setup word count * - * high: resvd */ - - datap = smb_GetSMBData(tp, NULL); + smb_SetSMBParm(tp, 7, dataOffset); /* offset of data */ + smb_SetSMBParm(tp, 8, 0); /* data displacement */ + smb_SetSMBParm(tp, 9, 0); /* low: setup word count * + * high: resvd */ + + datap = smb_GetSMBData(tp, NULL); *datap++ = 0; /* we rounded to even */ totalLength += dataAlign; - smb_SetSMBDataLength(tp, totalLength); + smb_SetSMBDataLength(tp, totalLength); - /* next, send the datagram */ - smb_SendPacket(vcp, tp); -} + /* next, send the datagram */ + smb_SendPacket(vcp, tp); +} long smb_ReceiveV3Tran2A(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { - smb_tran2Packet_t *asp; - int totalParms; - int totalData; - int parmDisp; - int dataDisp; - int parmOffset; - int dataOffset; - int parmCount; - int dataCount; - int firstPacket; - long code; + smb_tran2Packet_t *asp; + int totalParms; + int totalData; + int parmDisp; + int dataDisp; + int parmOffset; + int dataOffset; + int parmCount; + int dataCount; + int firstPacket; + long code = 0; /* We sometimes see 0 word count. What to do? */ if (*inp->wctp == 0) { @@ -514,7 +519,7 @@ long smb_ReceiveV3Tran2A(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) HANDLE h; char *ptbuf[1]; - osi_Log0(afsd_logp, "TRANSACTION2 word count = 0"); + osi_Log0(smb_logp, "TRANSACTION2 word count = 0"); h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); ptbuf[0] = "Transaction2 word count = 0"; @@ -522,93 +527,105 @@ long smb_ReceiveV3Tran2A(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) 1, inp->ncb_length, ptbuf, inp); DeregisterEventSource(h); #else /* DJGPP */ - osi_Log0(afsd_logp, "TRANSACTION2 word count = 0"); + osi_Log0(smb_logp, "TRANSACTION2 word count = 0"); #endif /* !DJGPP */ - smb_SetSMBDataLength(outp, 0); - smb_SendPacket(vcp, outp); + smb_SetSMBDataLength(outp, 0); + smb_SendPacket(vcp, outp); return 0; } - totalParms = smb_GetSMBParm(inp, 0); - totalData = smb_GetSMBParm(inp, 1); + totalParms = smb_GetSMBParm(inp, 0); + totalData = smb_GetSMBParm(inp, 1); - firstPacket = (inp->inCom == 0x32); + firstPacket = (inp->inCom == 0x32); /* find the packet we're reassembling */ lock_ObtainWrite(&smb_globalLock); - asp = smb_FindTran2Packet(vcp, inp); - if (!asp) { - asp = smb_NewTran2Packet(vcp, inp, totalParms, totalData); + asp = smb_FindTran2Packet(vcp, inp); + if (!asp) { + asp = smb_NewTran2Packet(vcp, inp, totalParms, totalData); } - lock_ReleaseWrite(&smb_globalLock); + lock_ReleaseWrite(&smb_globalLock); - /* now merge in this latest packet; start by looking up offsets */ + /* now merge in this latest packet; start by looking up offsets */ if (firstPacket) { parmDisp = dataDisp = 0; - parmOffset = smb_GetSMBParm(inp, 10); - dataOffset = smb_GetSMBParm(inp, 12); - parmCount = smb_GetSMBParm(inp, 9); - dataCount = smb_GetSMBParm(inp, 11); + parmOffset = smb_GetSMBParm(inp, 10); + dataOffset = smb_GetSMBParm(inp, 12); + parmCount = smb_GetSMBParm(inp, 9); + dataCount = smb_GetSMBParm(inp, 11); asp->maxReturnParms = smb_GetSMBParm(inp, 2); - asp->maxReturnData = smb_GetSMBParm(inp, 3); - - osi_Log3(afsd_logp, "SMB3 received T2 init packet total data %d, cur data %d, max return data %d", - totalData, dataCount, asp->maxReturnData); - } - else { - parmDisp = smb_GetSMBParm(inp, 4); - parmOffset = smb_GetSMBParm(inp, 3); - dataDisp = smb_GetSMBParm(inp, 7); - dataOffset = smb_GetSMBParm(inp, 6); - parmCount = smb_GetSMBParm(inp, 2); - dataCount = smb_GetSMBParm(inp, 5); - - osi_Log2(afsd_logp, "SMB3 received T2 aux packet parms %d, data %d", - parmCount, dataCount); - } + asp->maxReturnData = smb_GetSMBParm(inp, 3); - /* now copy the parms and data */ + osi_Log3(smb_logp, "SMB3 received T2 init packet total data %d, cur data %d, max return data %d", + totalData, dataCount, asp->maxReturnData); + } + else { + parmDisp = smb_GetSMBParm(inp, 4); + parmOffset = smb_GetSMBParm(inp, 3); + dataDisp = smb_GetSMBParm(inp, 7); + dataOffset = smb_GetSMBParm(inp, 6); + parmCount = smb_GetSMBParm(inp, 2); + dataCount = smb_GetSMBParm(inp, 5); + + osi_Log2(smb_logp, "SMB3 received T2 aux packet parms %d, data %d", + parmCount, dataCount); + } + + /* now copy the parms and data */ + if ( parmCount != 0 ) + { memcpy(((char *)asp->parmsp) + parmDisp, inp->data + parmOffset, parmCount); + } + if ( dataCount != 0 ) { memcpy(asp->datap + dataDisp, inp->data + dataOffset, dataCount); - - /* account for new bytes */ - asp->curData += dataCount; - asp->curParms += parmCount; - - /* finally, if we're done, remove the packet from the queue and dispatch it */ - if (asp->totalData <= asp->curData && asp->totalParms <= asp->curParms) { + } + + /* account for new bytes */ + asp->curData += dataCount; + asp->curParms += parmCount; + + /* finally, if we're done, remove the packet from the queue and dispatch it */ + if (asp->totalData <= asp->curData && asp->totalParms <= asp->curParms) { /* we've received it all */ - lock_ObtainWrite(&smb_globalLock); + lock_ObtainWrite(&smb_globalLock); osi_QRemove((osi_queue_t **) &smb_tran2AssemblyQueuep, &asp->q); - lock_ReleaseWrite(&smb_globalLock); - - /* now dispatch it */ - osi_LogEvent("AFS-Dispatch-2[%s]",myCrt_2Dispatch(asp->opcode),"vcp[%x] lana[%d] lsn[%d]",vcp,vcp->lana,vcp->lsn); - osi_Log4(afsd_logp,"AFS Server - Dispatch-2 %s vcp[%x] lana[%d] lsn[%d]",myCrt_2Dispatch(asp->opcode),vcp,vcp->lana,vcp->lsn); - code = (*smb_tran2DispatchTable[asp->opcode].procp)(vcp, asp, outp); + lock_ReleaseWrite(&smb_globalLock); + + /* now dispatch it */ + if ( asp->opcode >= 0 && asp->opcode < 20 && smb_tran2DispatchTable[asp->opcode].procp) { + osi_LogEvent("AFS-Dispatch-2[%s]",myCrt_2Dispatch(asp->opcode),"vcp[%x] lana[%d] lsn[%d]",(int)vcp,vcp->lana,vcp->lsn); + osi_Log4(smb_logp,"AFS Server - Dispatch-2 %s vcp[%x] lana[%d] lsn[%d]",myCrt_2Dispatch(asp->opcode),vcp,vcp->lana,vcp->lsn); + code = (*smb_tran2DispatchTable[asp->opcode].procp)(vcp, asp, outp); + } + else { + osi_LogEvent("AFS-Dispatch-2 [invalid]", NULL, "op[%x] vcp[%x] lana[%d] lsn[%d]", asp->opcode, vcp, vcp->lana, vcp->lsn); + osi_Log4(smb_logp,"AFS Server - Dispatch-2 [INVALID] op[%x] vcp[%x] lana[%d] lsn[%d]", asp->opcode, vcp, vcp->lana, vcp->lsn); + code = CM_ERROR_BADOP; + } /* if an error is returned, we're supposed to send an error packet, - * otherwise the dispatched function already did the data sending. - * We give dispatched proc the responsibility since it knows how much - * space to allocate. - */ - if (code != 0) { - smb_SendTran2Error(vcp, asp, outp, code); - } + * otherwise the dispatched function already did the data sending. + * We give dispatched proc the responsibility since it knows how much + * space to allocate. + */ + if (code != 0) { + smb_SendTran2Error(vcp, asp, outp, code); + } /* free the input tran 2 packet */ lock_ObtainWrite(&smb_globalLock); - smb_FreeTran2Packet(asp); + smb_FreeTran2Packet(asp); lock_ReleaseWrite(&smb_globalLock); - } - else if (firstPacket) { + } + else if (firstPacket) { /* the first packet in a multi-packet request, we need to send an - * ack to get more data. - */ - smb_SetSMBDataLength(outp, 0); - smb_SendPacket(vcp, outp); - } + * ack to get more data. + */ + smb_SetSMBDataLength(outp, 0); + smb_SendPacket(vcp, outp); + } return 0; } @@ -616,218 +633,235 @@ long smb_ReceiveV3Tran2A(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) long smb_ReceiveTran2Open(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *op) { char *pathp; - smb_tran2Packet_t *outp; - long code; + smb_tran2Packet_t *outp; + long code = 0; cm_space_t *spacep; - int excl; - cm_user_t *userp; - cm_scache_t *dscp; /* dir we're dealing with */ - cm_scache_t *scp; /* file we're creating */ - cm_attr_t setAttr; - int initialModeBits; - smb_fid_t *fidp; - int attributes; - char *lastNamep; - long dosTime; - int openFun; - int trunc; - int openMode; - int extraInfo; - int openAction; - int parmSlot; /* which parm we're dealing with */ - long returnEALength; + int excl; + cm_user_t *userp; + cm_scache_t *dscp; /* dir we're dealing with */ + cm_scache_t *scp; /* file we're creating */ + cm_attr_t setAttr; + int initialModeBits; + smb_fid_t *fidp; + int attributes; + char *lastNamep; + long dosTime; + int openFun; + int trunc; + int openMode; + int extraInfo; + int openAction; + int parmSlot; /* which parm we're dealing with */ + long returnEALength; char *tidPathp; cm_req_t req; cm_InitReq(&req); - scp = NULL; + scp = NULL; extraInfo = (p->parmsp[0] & 1); /* return extra info */ - returnEALength = (p->parmsp[0] & 8); /* return extended attr length */ + returnEALength = (p->parmsp[0] & 8); /* return extended attr length */ openFun = p->parmsp[6]; /* open function */ - excl = ((openFun & 3) == 0); - trunc = ((openFun & 3) == 2); /* truncate it */ + excl = ((openFun & 3) == 0); + trunc = ((openFun & 3) == 2); /* truncate it */ openMode = (p->parmsp[1] & 0x7); - openAction = 0; /* tracks what we did */ + openAction = 0; /* tracks what we did */ - attributes = p->parmsp[3]; - dosTime = p->parmsp[4] | (p->parmsp[5] << 16); + attributes = p->parmsp[3]; + dosTime = p->parmsp[4] | (p->parmsp[5] << 16); /* compute initial mode bits based on read-only flag in attributes */ - initialModeBits = 0666; - if (attributes & 1) initialModeBits &= ~0222; + initialModeBits = 0666; + if (attributes & 1) initialModeBits &= ~0222; - pathp = (char *) (&p->parmsp[14]); + pathp = (char *) (&p->parmsp[14]); - outp = smb_GetTran2ResponsePacket(vcp, p, op, 40, 0); + outp = smb_GetTran2ResponsePacket(vcp, p, op, 40, 0); spacep = cm_GetSpace(); - smb_StripLastComponent(spacep->data, &lastNamep, pathp); + smb_StripLastComponent(spacep->data, &lastNamep, pathp); if (lastNamep && strcmp(lastNamep, SMB_IOCTL_FILENAME) == 0) { /* special case magic file name for receiving IOCTL requests - * (since IOCTL calls themselves aren't getting through). - */ - fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); - smb_SetupIoctlFid(fidp, spacep); + * (since IOCTL calls themselves aren't getting through). + */ + fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); + smb_SetupIoctlFid(fidp, spacep); - /* copy out remainder of the parms */ + /* copy out remainder of the parms */ parmSlot = 0; outp->parmsp[parmSlot] = fidp->fid; parmSlot++; if (extraInfo) { - outp->parmsp[parmSlot] = /* attrs */ 0; parmSlot++; - outp->parmsp[parmSlot] = 0; parmSlot++; /* mod time */ - outp->parmsp[parmSlot] = 0; parmSlot++; - outp->parmsp[parmSlot] = 0; parmSlot++; /* len */ - outp->parmsp[parmSlot] = 0x7fff; parmSlot++; - outp->parmsp[parmSlot] = openMode; parmSlot++; - outp->parmsp[parmSlot] = 0; parmSlot++; /* file type 0 ==> normal file or dir */ - outp->parmsp[parmSlot] = 0; parmSlot++; /* IPC junk */ - } + outp->parmsp[parmSlot] = /* attrs */ 0; parmSlot++; + outp->parmsp[parmSlot] = 0; parmSlot++; /* mod time */ + outp->parmsp[parmSlot] = 0; parmSlot++; + outp->parmsp[parmSlot] = 0; parmSlot++; /* len */ + outp->parmsp[parmSlot] = 0x7fff; parmSlot++; + outp->parmsp[parmSlot] = openMode; parmSlot++; + outp->parmsp[parmSlot] = 0; parmSlot++; /* file type 0 ==> normal file or dir */ + outp->parmsp[parmSlot] = 0; parmSlot++; /* IPC junk */ + } /* and the final "always present" stuff */ - outp->parmsp[parmSlot] = /* openAction found existing file */ 1; parmSlot++; + outp->parmsp[parmSlot] = /* openAction found existing file */ 1; parmSlot++; /* next write out the "unique" ID */ outp->parmsp[parmSlot] = 0x1234; parmSlot++; outp->parmsp[parmSlot] = 0x5678; parmSlot++; - outp->parmsp[parmSlot] = 0; parmSlot++; + outp->parmsp[parmSlot] = 0; parmSlot++; if (returnEALength) { outp->parmsp[parmSlot] = 0; parmSlot++; outp->parmsp[parmSlot] = 0; parmSlot++; - } + } - outp->totalData = 0; - outp->totalParms = parmSlot * 2; + outp->totalData = 0; + outp->totalParms = parmSlot * 2; - smb_SendTran2Packet(vcp, outp, op); + smb_SendTran2Packet(vcp, outp, op); - smb_FreeTran2Packet(outp); + smb_FreeTran2Packet(outp); /* and clean up fid reference */ - smb_ReleaseFID(fidp); - return 0; - } + smb_ReleaseFID(fidp); + return 0; + } + +#ifdef DEBUG_VERBOSE + { + char *hexp, *asciip; + asciip = (lastNamep ? lastNamep : pathp); + hexp = osi_HexifyString( asciip ); + DEBUG_EVENT2("AFS","T2Open H[%s] A[%s]", hexp, asciip); + free(hexp); + } +#endif userp = smb_GetTran2User(vcp, p); + /* In the off chance that userp is NULL, we log and abandon */ + if(!userp) { + osi_Log1(smb_logp, "ReceiveTran2Open user [%d] not resolvable", p->uid); + smb_FreeTran2Packet(outp); + return CM_ERROR_BADSMB; + } + tidPathp = smb_GetTIDPath(vcp, p->tid); dscp = NULL; code = cm_NameI(cm_rootSCachep, pathp, - CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, - userp, tidPathp, &req, &scp); + CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, + userp, tidPathp, &req, &scp); if (code != 0) { code = cm_NameI(cm_rootSCachep, spacep->data, - CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, - userp, tidPathp, &req, &dscp); + CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, + userp, tidPathp, &req, &dscp); cm_FreeSpace(spacep); - if (code) { - cm_ReleaseUser(userp); + if (code) { + cm_ReleaseUser(userp); smb_FreeTran2Packet(outp); - return code; - } + return code; + } - /* otherwise, scp points to the parent directory. Do a lookup, + /* otherwise, scp points to the parent directory. Do a lookup, * and truncate the file if we find it, otherwise we create the * file. - */ - if (!lastNamep) lastNamep = pathp; - else lastNamep++; - code = cm_Lookup(dscp, lastNamep, CM_FLAG_CASEFOLD, userp, - &req, &scp); - if (code && code != CM_ERROR_NOSUCHFILE) { + */ + if (!lastNamep) lastNamep = pathp; + else lastNamep++; + code = cm_Lookup(dscp, lastNamep, CM_FLAG_CASEFOLD, userp, + &req, &scp); + if (code && code != CM_ERROR_NOSUCHFILE) { cm_ReleaseSCache(dscp); - cm_ReleaseUser(userp); + cm_ReleaseUser(userp); smb_FreeTran2Packet(outp); - return code; - } + return code; + } } - else { - cm_FreeSpace(spacep); + else { + cm_FreeSpace(spacep); } - /* if we get here, if code is 0, the file exists and is represented by - * scp. Otherwise, we have to create it. - */ + /* if we get here, if code is 0, the file exists and is represented by + * scp. Otherwise, we have to create it. + */ if (code == 0) { - code = cm_CheckOpen(scp, openMode, trunc, userp, &req); - if (code) { - if (dscp) cm_ReleaseSCache(dscp); - cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); + code = cm_CheckOpen(scp, openMode, trunc, userp, &req); + if (code) { + if (dscp) cm_ReleaseSCache(dscp); + cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); smb_FreeTran2Packet(outp); - return code; - } + return code; + } if (excl) { /* oops, file shouldn't be there */ - if (dscp) cm_ReleaseSCache(dscp); - cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); + if (dscp) cm_ReleaseSCache(dscp); + cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); smb_FreeTran2Packet(outp); - return CM_ERROR_EXISTS; - } + return CM_ERROR_EXISTS; + } if (trunc) { setAttr.mask = CM_ATTRMASK_LENGTH; - setAttr.length.LowPart = 0; - setAttr.length.HighPart = 0; + setAttr.length.LowPart = 0; + setAttr.length.HighPart = 0; code = cm_SetAttr(scp, &setAttr, userp, &req); - openAction = 3; /* truncated existing file */ - } - else openAction = 1; /* found existing file */ - } - else if (!(openFun & 0x10)) { + openAction = 3; /* truncated existing file */ + } + else openAction = 1; /* found existing file */ + } + else if (!(openFun & SMB_ATTR_DIRECTORY)) { /* don't create if not found */ - if (dscp) cm_ReleaseSCache(dscp); - osi_assert(scp == NULL); - cm_ReleaseUser(userp); + if (dscp) cm_ReleaseSCache(dscp); + osi_assert(scp == NULL); + cm_ReleaseUser(userp); smb_FreeTran2Packet(outp); - return CM_ERROR_NOSUCHFILE; - } - else { + return CM_ERROR_NOSUCHFILE; + } + else { osi_assert(dscp != NULL && scp == NULL); openAction = 2; /* created file */ setAttr.mask = CM_ATTRMASK_CLIENTMODTIME; smb_UnixTimeFromSearchTime(&setAttr.clientModTime, dosTime); - code = cm_Create(dscp, lastNamep, 0, &setAttr, &scp, userp, - &req); + code = cm_Create(dscp, lastNamep, 0, &setAttr, &scp, userp, + &req); if (code == 0 && (dscp->flags & CM_SCACHEFLAG_ANYWATCH)) smb_NotifyChange(FILE_ACTION_ADDED, - FILE_NOTIFY_CHANGE_FILE_NAME, - dscp, lastNamep, NULL, TRUE); - if (!excl && code == CM_ERROR_EXISTS) { + FILE_NOTIFY_CHANGE_FILE_NAME, + dscp, lastNamep, NULL, TRUE); + if (!excl && code == CM_ERROR_EXISTS) { /* not an exclusive create, and someone else tried * creating it already, then we open it anyway. We * don't bother retrying after this, since if this next * fails, that means that the file was deleted after we * started this call. - */ - code = cm_Lookup(dscp, lastNamep, CM_FLAG_CASEFOLD, - userp, &req, &scp); - if (code == 0) { - if (trunc) { + */ + code = cm_Lookup(dscp, lastNamep, CM_FLAG_CASEFOLD, + userp, &req, &scp); + if (code == 0) { + if (trunc) { setAttr.mask = CM_ATTRMASK_LENGTH; - setAttr.length.LowPart = 0; - setAttr.length.HighPart = 0; - code = cm_SetAttr(scp, &setAttr, userp, - &req); - } + setAttr.length.LowPart = 0; + setAttr.length.HighPart = 0; + code = cm_SetAttr(scp, &setAttr, userp, + &req); + } } /* lookup succeeded */ - } } + } /* we don't need this any longer */ if (dscp) cm_ReleaseSCache(dscp); - if (code) { + if (code) { /* something went wrong creating or truncating the file */ - if (scp) cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); + if (scp) cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); smb_FreeTran2Packet(outp); - return code; - } + return code; + } /* make sure we're about to open a file */ if (scp->fileType != CM_SCACHETYPE_FILE) { @@ -837,81 +871,81 @@ long smb_ReceiveTran2Open(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *op) return CM_ERROR_ISDIR; } - /* now all we have to do is open the file itself */ - fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); - osi_assert(fidp); + /* now all we have to do is open the file itself */ + fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); + osi_assert(fidp); /* save a pointer to the vnode */ - fidp->scp = scp; + fidp->scp = scp; /* compute open mode */ - if (openMode != 1) fidp->flags |= SMB_FID_OPENREAD; - if (openMode == 1 || openMode == 2) - fidp->flags |= SMB_FID_OPENWRITE; + if (openMode != 1) fidp->flags |= SMB_FID_OPENREAD; + if (openMode == 1 || openMode == 2) + fidp->flags |= SMB_FID_OPENWRITE; smb_ReleaseFID(fidp); cm_Open(scp, 0, userp); - /* copy out remainder of the parms */ + /* copy out remainder of the parms */ parmSlot = 0; outp->parmsp[parmSlot] = fidp->fid; parmSlot++; lock_ObtainMutex(&scp->mx); if (extraInfo) { - outp->parmsp[parmSlot] = smb_Attributes(scp); parmSlot++; + outp->parmsp[parmSlot] = smb_Attributes(scp); parmSlot++; smb_SearchTimeFromUnixTime(&dosTime, scp->clientModTime); - outp->parmsp[parmSlot] = dosTime & 0xffff; parmSlot++; - outp->parmsp[parmSlot] = (dosTime>>16) & 0xffff; parmSlot++; - outp->parmsp[parmSlot] = (unsigned short) (scp->length.LowPart & 0xffff); - parmSlot++; - outp->parmsp[parmSlot] = (unsigned short) ((scp->length.LowPart >> 16) & 0xffff); - parmSlot++; - outp->parmsp[parmSlot] = openMode; parmSlot++; - outp->parmsp[parmSlot] = 0; parmSlot++; /* file type 0 ==> normal file or dir */ - outp->parmsp[parmSlot] = 0; parmSlot++; /* IPC junk */ - } + outp->parmsp[parmSlot] = (unsigned short)(dosTime & 0xffff); parmSlot++; + outp->parmsp[parmSlot] = (unsigned short)((dosTime>>16) & 0xffff); parmSlot++; + outp->parmsp[parmSlot] = (unsigned short) (scp->length.LowPart & 0xffff); + parmSlot++; + outp->parmsp[parmSlot] = (unsigned short) ((scp->length.LowPart >> 16) & 0xffff); + parmSlot++; + outp->parmsp[parmSlot] = openMode; parmSlot++; + outp->parmsp[parmSlot] = 0; parmSlot++; /* file type 0 ==> normal file or dir */ + outp->parmsp[parmSlot] = 0; parmSlot++; /* IPC junk */ + } /* and the final "always present" stuff */ - outp->parmsp[parmSlot] = openAction; parmSlot++; + outp->parmsp[parmSlot] = openAction; parmSlot++; /* next write out the "unique" ID */ outp->parmsp[parmSlot] = (unsigned short) (scp->fid.vnode & 0xffff); parmSlot++; outp->parmsp[parmSlot] = (unsigned short) (scp->fid.volume & 0xffff); parmSlot++; - outp->parmsp[parmSlot] = 0; parmSlot++; - if (returnEALength) { + outp->parmsp[parmSlot] = 0; parmSlot++; + if (returnEALength) { outp->parmsp[parmSlot] = 0; parmSlot++; outp->parmsp[parmSlot] = 0; parmSlot++; - } + } lock_ReleaseMutex(&scp->mx); outp->totalData = 0; /* total # of data bytes */ - outp->totalParms = parmSlot * 2; /* shorts are two bytes */ + outp->totalParms = parmSlot * 2; /* shorts are two bytes */ smb_SendTran2Packet(vcp, outp, op); - smb_FreeTran2Packet(outp); + smb_FreeTran2Packet(outp); - cm_ReleaseUser(userp); - /* leave scp held since we put it in fidp->scp */ - return 0; -} + cm_ReleaseUser(userp); + /* leave scp held since we put it in fidp->scp */ + return 0; +} long smb_ReceiveTran2FindFirst(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *outp) { - return CM_ERROR_BADOP; + return CM_ERROR_BADOP; } long smb_ReceiveTran2FindNext(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *outp) { - return CM_ERROR_BADOP; + return CM_ERROR_BADOP; } long smb_ReceiveTran2QFSInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *op) { smb_tran2Packet_t *outp; - smb_tran2QFSInfo_t qi; + smb_tran2QFSInfo_t qi; int responseSize; osi_hyper_t temp; static char FSname[6] = {'A', 0, 'F', 0, 'S', 0}; - osi_Log1(afsd_logp, "T2 QFSInfo type 0x%x", p->parmsp[0]); + osi_Log1(smb_logp, "T2 QFSInfo type 0x%x", p->parmsp[0]); switch (p->parmsp[0]) { case 1: responseSize = sizeof(qi.u.allocInfo); break; @@ -923,32 +957,32 @@ long smb_ReceiveTran2QFSInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t * default: return CM_ERROR_INVAL; } - outp = smb_GetTran2ResponsePacket(vcp, p, op, 0, responseSize); + outp = smb_GetTran2ResponsePacket(vcp, p, op, 0, responseSize); switch (p->parmsp[0]) { case 1: /* alloc info */ - qi.u.allocInfo.FSID = 0; - qi.u.allocInfo.sectorsPerAllocUnit = 1; - qi.u.allocInfo.totalAllocUnits = 0x7fffffff; - qi.u.allocInfo.availAllocUnits = 0x3fffffff; - qi.u.allocInfo.bytesPerSector = 1024; + qi.u.allocInfo.FSID = 0; + qi.u.allocInfo.sectorsPerAllocUnit = 1; + qi.u.allocInfo.totalAllocUnits = 0x7fffffff; + qi.u.allocInfo.availAllocUnits = 0x3fffffff; + qi.u.allocInfo.bytesPerSector = 1024; break; - case 2: + case 2: /* volume info */ - qi.u.volumeInfo.vsn = 1234; - qi.u.volumeInfo.vnCount = 4; + qi.u.volumeInfo.vsn = 1234; + qi.u.volumeInfo.vnCount = 4; /* we're supposed to pad it out with zeroes to the end */ memset(&qi.u.volumeInfo.label, 0, sizeof(qi.u.volumeInfo.label)); - strcpy(qi.u.volumeInfo.label, "AFS"); + memcpy(qi.u.volumeInfo.label, "AFS", 4); break; case 0x102: /* FS volume info */ memset((char *)&qi.u.FSvolumeInfo.vct, 0, sizeof(FILETIME)); qi.u.FSvolumeInfo.vsn = 1234; - qi.u.FSvolumeInfo.vnCount = 4; - strcpy(qi.u.FSvolumeInfo.label, "AFS"); + qi.u.FSvolumeInfo.vnCount = 8; + memcpy(qi.u.FSvolumeInfo.label, "A\0F\0S\0\0", 8); break; case 0x103: @@ -983,23 +1017,23 @@ long smb_ReceiveTran2QFSInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t * qi.u.FSattributeInfo.FSnameLength = 6; memcpy(qi.u.FSattributeInfo.FSname, FSname, 6); break; - } + } /* copy out return data, and set corresponding sizes */ outp->totalParms = 0; - outp->totalData = responseSize; - memcpy(outp->datap, &qi, responseSize); + outp->totalData = responseSize; + memcpy(outp->datap, &qi, responseSize); /* send and free the packets */ smb_SendTran2Packet(vcp, outp, op); - smb_FreeTran2Packet(outp); + smb_FreeTran2Packet(outp); - return 0; + return 0; } long smb_ReceiveTran2SetFSInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *outp) { - return CM_ERROR_BADOP; + return CM_ERROR_BADOP; } struct smb_ShortNameRock { @@ -1019,7 +1053,7 @@ int cm_GetShortNameProc(cm_scache_t *scp, cm_dirEntry_t *dep, void *vrockp, /* compare both names and vnodes, though probably just comparing vnodes * would be safe enough. */ - if (stricmp(dep->name, rockp->maskp) != 0) + if (cm_stricmp(dep->name, rockp->maskp) != 0) return 0; if (ntohl(dep->fid.vnode) != rockp->vnode) return 0; @@ -1037,14 +1071,14 @@ long cm_GetShortName(char *pathp, cm_user_t *userp, cm_req_t *reqp, cm_space_t *spacep; cm_scache_t *dscp; int caseFold = CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD; - long code; + long code = 0; osi_hyper_t thyper; spacep = cm_GetSpace(); smb_StripLastComponent(spacep->data, &lastNamep, pathp); code = cm_NameI(cm_rootSCachep, spacep->data, caseFold, userp, tidPathp, - reqp, &dscp); + reqp, &dscp); cm_FreeSpace(spacep); if (code) return code; @@ -1056,7 +1090,7 @@ long cm_GetShortName(char *pathp, cm_user_t *userp, cm_req_t *reqp, rock.vnode = vnode; rock.maskp = lastNamep; code = cm_ApplyDir(dscp, cm_GetShortNameProc, &rock, &thyper, userp, - reqp, NULL); + reqp, NULL); cm_ReleaseSCache(dscp); @@ -1072,19 +1106,19 @@ long cm_GetShortName(char *pathp, cm_user_t *userp, cm_req_t *reqp, long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *opx) { smb_tran2Packet_t *outp; - unsigned long dosTime; + unsigned long dosTime; FILETIME ft; - unsigned short infoLevel; - int nbytesRequired; - unsigned short attributes; + unsigned short infoLevel; + int nbytesRequired; + unsigned short attributes; unsigned long extAttributes; char shortName[13]; unsigned int len; - cm_user_t *userp; + cm_user_t *userp; cm_space_t *spacep; - cm_scache_t *scp, *dscp; - long code; - char *op; + cm_scache_t *scp, *dscp; + long code = 0; + char *op; char *tidPathp; char *lastComp; cm_req_t req; @@ -1092,23 +1126,23 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t cm_InitReq(&req); infoLevel = p->parmsp[0]; - if (infoLevel == 6) nbytesRequired = 0; - else if (infoLevel == 1) nbytesRequired = 22; - else if (infoLevel == 2) nbytesRequired = 26; + if (infoLevel == 6) nbytesRequired = 0; + else if (infoLevel == 1) nbytesRequired = 22; + else if (infoLevel == 2) nbytesRequired = 26; else if (infoLevel == 0x101) nbytesRequired = 40; else if (infoLevel == 0x102) nbytesRequired = 24; else if (infoLevel == 0x103) nbytesRequired = 4; else if (infoLevel == 0x108) nbytesRequired = 30; - else { - osi_Log2(afsd_logp, "Bad Tran2 op 0x%x infolevel 0x%x", - p->opcode, infoLevel); + else { + osi_Log2(smb_logp, "Bad Tran2 op 0x%x infolevel 0x%x", + p->opcode, infoLevel); smb_SendTran2Error(vcp, p, opx, CM_ERROR_INVAL); - return 0; - } - osi_Log2(afsd_logp, "T2 QPathInfo type 0x%x path %s", infoLevel, - osi_LogSaveString(afsd_logp, (char *)(&p->parmsp[3]))); + return 0; + } + osi_Log2(smb_logp, "T2 QPathInfo type 0x%x path %s", infoLevel, + osi_LogSaveString(smb_logp, (char *)(&p->parmsp[3]))); - outp = smb_GetTran2ResponsePacket(vcp, p, opx, 2, nbytesRequired); + outp = smb_GetTran2ResponsePacket(vcp, p, opx, 2, nbytesRequired); if (infoLevel > 0x100) outp->totalParms = 2; @@ -1116,17 +1150,22 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t outp->totalParms = 0; outp->totalData = nbytesRequired; - /* now, if we're at infoLevel 6, we're only being asked to check - * the syntax, so we just OK things now. In particular, we're *not* - * being asked to verify anything about the state of any parent dirs. - */ + /* now, if we're at infoLevel 6, we're only being asked to check + * the syntax, so we just OK things now. In particular, we're *not* + * being asked to verify anything about the state of any parent dirs. + */ if (infoLevel == 6) { smb_SendTran2Packet(vcp, outp, opx); - smb_FreeTran2Packet(outp); + smb_FreeTran2Packet(outp); return 0; - } + } - userp = smb_GetTran2User(vcp, p); + userp = smb_GetTran2User(vcp, p); + if(!userp) { + osi_Log1(smb_logp, "ReceiveTran2QPathInfo unable to resolve user [%d]", p->uid); + smb_FreeTran2Packet(outp); + return CM_ERROR_BADSMB; + } tidPathp = smb_GetTIDPath(vcp, p->tid); @@ -1149,62 +1188,63 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t smb_StripLastComponent(spacep->data, &lastComp, (char *)(&p->parmsp[3])); /* Make sure that lastComp is not NULL */ - if (lastComp) + if (lastComp) { if (strcmp(lastComp, "\\desktop.ini") == 0) { - code = cm_NameI(cm_rootSCachep, spacep->data, - CM_FLAG_CASEFOLD - | CM_FLAG_DIRSEARCH - | CM_FLAG_FOLLOW, - userp, tidPathp, &req, &dscp); - if (code == 0) { - if (dscp->fileType == CM_SCACHETYPE_MOUNTPOINT - && !dscp->mountRootFidp) - code = CM_ERROR_NOSUCHFILE; - else if (dscp->fileType == CM_SCACHETYPE_DIRECTORY) { - cm_buf_t *bp = buf_Find(dscp, &hzero); - if (bp) - buf_Release(bp); - else - code = CM_ERROR_NOSUCHFILE; - } - cm_ReleaseSCache(dscp); - if (code) { - cm_FreeSpace(spacep); - cm_ReleaseUser(userp); - smb_SendTran2Error(vcp, p, opx, code); - smb_FreeTran2Packet(outp); - return 0; - } - } - } + code = cm_NameI(cm_rootSCachep, spacep->data, + CM_FLAG_CASEFOLD + | CM_FLAG_DIRSEARCH + | CM_FLAG_FOLLOW, + userp, tidPathp, &req, &dscp); + if (code == 0) { + if (dscp->fileType == CM_SCACHETYPE_MOUNTPOINT + && !dscp->mountRootFidp) + code = CM_ERROR_NOSUCHFILE; + else if (dscp->fileType == CM_SCACHETYPE_DIRECTORY) { + cm_buf_t *bp = buf_Find(dscp, &hzero); + if (bp) + buf_Release(bp); + else + code = CM_ERROR_NOSUCHFILE; + } + cm_ReleaseSCache(dscp); + if (code) { + cm_FreeSpace(spacep); + cm_ReleaseUser(userp); + smb_SendTran2Error(vcp, p, opx, code); + smb_FreeTran2Packet(outp); + return 0; + } + } + } + } cm_FreeSpace(spacep); } /* now do namei and stat, and copy out the info */ - code = cm_NameI(cm_rootSCachep, (char *)(&p->parmsp[3]), - CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, userp, tidPathp, &req, &scp); + code = cm_NameI(cm_rootSCachep, (char *)(&p->parmsp[3]), + CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, userp, tidPathp, &req, &scp); if (code) { cm_ReleaseUser(userp); - smb_SendTran2Error(vcp, p, opx, code); - smb_FreeTran2Packet(outp); - return 0; - } + smb_SendTran2Error(vcp, p, opx, code); + smb_FreeTran2Packet(outp); + return 0; + } - lock_ObtainMutex(&scp->mx); + lock_ObtainMutex(&scp->mx); code = cm_SyncOp(scp, NULL, userp, &req, 0, - CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); + CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); if (code) goto done; - /* now we have the status in the cache entry, and everything is locked. + /* now we have the status in the cache entry, and everything is locked. * Marshall the output data. - */ + */ op = outp->datap; /* for info level 108, figure out short name */ if (infoLevel == 0x108) { code = cm_GetShortName((char *)(&p->parmsp[3]), userp, &req, - tidPathp, scp->fid.vnode, shortName, - (size_t *) &len); + tidPathp, scp->fid.vnode, shortName, + (size_t *) &len); if (code) { goto done; } @@ -1218,11 +1258,11 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t } if (infoLevel == 1 || infoLevel == 2) { smb_SearchTimeFromUnixTime(&dosTime, scp->clientModTime); - *((u_long *)op) = dosTime; op += 4; /* creation time */ - *((u_long *)op) = dosTime; op += 4; /* access time */ - *((u_long *)op) = dosTime; op += 4; /* write time */ - *((u_long *)op) = scp->length.LowPart; op += 4; /* length */ - *((u_long *)op) = scp->length.LowPart; op += 4; /* alloc size */ + *((u_long *)op) = dosTime; op += 4; /* creation time */ + *((u_long *)op) = dosTime; op += 4; /* access time */ + *((u_long *)op) = dosTime; op += 4; /* write time */ + *((u_long *)op) = scp->length.LowPart; op += 4; /* length */ + *((u_long *)op) = scp->length.LowPart; op += 4; /* alloc size */ attributes = smb_Attributes(scp); *((u_short *)op) = attributes; op += 2; /* attributes */ } @@ -1256,20 +1296,22 @@ long smb_ReceiveTran2QPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t /* send and free the packets */ -done: + done: lock_ReleaseMutex(&scp->mx); - cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); - if (code == 0) smb_SendTran2Packet(vcp, outp, opx); - else smb_SendTran2Error(vcp, p, opx, code); - smb_FreeTran2Packet(outp); + cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); + if (code == 0) + smb_SendTran2Packet(vcp, outp, opx); + else + smb_SendTran2Error(vcp, p, opx, code); + smb_FreeTran2Packet(outp); - return 0; + return 0; } long smb_ReceiveTran2SetPathInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *outp) { - return CM_ERROR_BADOP; + return CM_ERROR_BADOP; } long smb_ReceiveTran2QFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *opx) @@ -1281,16 +1323,16 @@ long smb_ReceiveTran2QFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t int nbytesRequired; unsigned short fid; cm_user_t *userp; - smb_fid_t *fidp; + smb_fid_t *fidp; cm_scache_t *scp; char *op; - long code; + long code = 0; cm_req_t req; cm_InitReq(&req); - fid = p->parmsp[0]; - fidp = smb_FindFID(vcp, fid, 0); + fid = p->parmsp[0]; + fidp = smb_FindFID(vcp, fid, 0); if (fidp == NULL) { smb_SendTran2Error(vcp, p, opx, CM_ERROR_BADFD); @@ -1303,12 +1345,13 @@ long smb_ReceiveTran2QFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t else if (infoLevel == 0x103) nbytesRequired = 4; else if (infoLevel == 0x104) nbytesRequired = 6; else { - osi_Log2(afsd_logp, "Bad Tran2 op 0x%x infolevel 0x%x", - p->opcode, infoLevel); + osi_Log2(smb_logp, "Bad Tran2 op 0x%x infolevel 0x%x", + p->opcode, infoLevel); smb_SendTran2Error(vcp, p, opx, CM_ERROR_INVAL); + smb_ReleaseFID(fidp); return 0; } - osi_Log2(afsd_logp, "T2 QFileInfo type 0x%x fid %d", infoLevel, fid); + osi_Log2(smb_logp, "T2 QFileInfo type 0x%x fid %d", infoLevel, fid); outp = smb_GetTran2ResponsePacket(vcp, p, opx, 2, nbytesRequired); @@ -1319,11 +1362,16 @@ long smb_ReceiveTran2QFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t outp->totalData = nbytesRequired; userp = smb_GetTran2User(vcp, p); + if(!userp) { + osi_Log1(smb_logp, "ReceiveTran2QFileInfo unable to resolve user [%d]", p->uid); + code = CM_ERROR_BADSMB; + goto done; + } scp = fidp->scp; lock_ObtainMutex(&scp->mx); code = cm_SyncOp(scp, NULL, userp, &req, 0, - CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); + CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); if (code) goto done; /* now we have the status in the cache entry, and everything is locked. @@ -1367,7 +1415,7 @@ long smb_ReceiveTran2QFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t } /* send and free the packets */ -done: + done: lock_ReleaseMutex(&scp->mx); cm_ReleaseUser(userp); smb_ReleaseFID(fidp); @@ -1380,7 +1428,7 @@ done: long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *op) { - long code; + long code = 0; unsigned short fid; smb_fid_t *fidp; unsigned short infoLevel; @@ -1391,7 +1439,7 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet cm_InitReq(&req); - fid = p->parmsp[0]; + fid = p->parmsp[0]; fidp = smb_FindFID(vcp, fid, 0); if (fidp == NULL) { @@ -1401,23 +1449,26 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet infoLevel = p->parmsp[1]; if (infoLevel > 0x104 || infoLevel < 0x101) { - osi_Log2(afsd_logp, "Bad Tran2 op 0x%x infolevel 0x%x", + osi_Log2(smb_logp, "Bad Tran2 op 0x%x infolevel 0x%x", p->opcode, infoLevel); smb_SendTran2Error(vcp, p, op, CM_ERROR_INVAL); + smb_ReleaseFID(fidp); return 0; } if (infoLevel == 0x102 && !(fidp->flags & SMB_FID_OPENDELETE)) { smb_SendTran2Error(vcp, p, op, CM_ERROR_NOACCESS); + smb_ReleaseFID(fidp); return 0; } if ((infoLevel == 0x103 || infoLevel == 0x104) && !(fidp->flags & SMB_FID_OPENWRITE)) { smb_SendTran2Error(vcp, p, op, CM_ERROR_NOACCESS); + smb_ReleaseFID(fidp); return 0; } - osi_Log1(afsd_logp, "T2 SFileInfo type 0x%x", infoLevel); + osi_Log1(smb_logp, "T2 SFileInfo type 0x%x", infoLevel); outp = smb_GetTran2ResponsePacket(vcp, p, op, 2, 0); @@ -1425,6 +1476,11 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet outp->totalData = 0; userp = smb_GetTran2User(vcp, p); + if(!userp) { + osi_Log1(smb_logp,"ReceiveTran2SetFileInfo unable to resolve user [%d]", p->uid); + code = CM_ERROR_BADSMB; + goto done; + } scp = fidp->scp; @@ -1438,8 +1494,8 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet */ lock_ObtainMutex(&scp->mx); code = cm_SyncOp(scp, NULL, userp, &req, 0, - CM_SCACHESYNC_GETSTATUS - | CM_SCACHESYNC_NEEDCALLBACK); + CM_SCACHESYNC_GETSTATUS + | CM_SCACHESYNC_NEEDCALLBACK); if (code) { lock_ReleaseMutex(&scp->mx); goto done; @@ -1447,16 +1503,20 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet /* prepare for setattr call */ attr.mask = 0; + lastMod = *((FILETIME *)(p->datap + 16)); - /* when called as result of move a b, lastMod is (-1, -1). If the check for -1 is not present, timestamp - of the resulting file will be 1969 (-1) + /* when called as result of move a b, lastMod is (-1, -1). + * If the check for -1 is not present, timestamp + * of the resulting file will be 1969 (-1) */ - if (LargeIntegerNotEqualToZero(*((LARGE_INTEGER *)&lastMod)) && lastMod.dwLowDateTime != -1 && lastMod.dwHighDateTime != -1) { + if (LargeIntegerNotEqualToZero(*((LARGE_INTEGER *)&lastMod)) && + lastMod.dwLowDateTime != -1 && lastMod.dwHighDateTime != -1) { attr.mask |= CM_ATTRMASK_CLIENTMODTIME; smb_UnixTimeFromLargeSearchTime(&attr.clientModTime, &lastMod); fidp->flags |= SMB_FID_MTIMESETDONE; } + attribute = *((u_long *)(p->datap + 32)); if (attribute != 0) { if ((scp->unixModeBits & 0222) @@ -1501,7 +1561,7 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet fidp->flags &= ~SMB_FID_DELONCLOSE; } } -done: + done: cm_ReleaseUser(userp); smb_ReleaseFID(fidp); if (code == 0) smb_SendTran2Packet(vcp, outp, op); @@ -1513,75 +1573,74 @@ done: long smb_ReceiveTran2FSCTL(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *outp) { - return CM_ERROR_BADOP; + return CM_ERROR_BADOP; } long smb_ReceiveTran2IOCTL(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *outp) { - return CM_ERROR_BADOP; + return CM_ERROR_BADOP; } long smb_ReceiveTran2FindNotifyFirst(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *outp) { - return CM_ERROR_BADOP; + return CM_ERROR_BADOP; } long smb_ReceiveTran2FindNotifyNext(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *outp) { - return CM_ERROR_BADOP; + return CM_ERROR_BADOP; } long smb_ReceiveTran2MKDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *outp) { - return CM_ERROR_BADOP; + return CM_ERROR_BADOP; } long smb_ApplyV3DirListPatches(cm_scache_t *dscp, smb_dirListPatch_t **dirPatchespp, int infoLevel, cm_user_t *userp, cm_req_t *reqp) { - long code; - cm_scache_t *scp; - cm_scache_t *targetScp; /* target if scp is a symlink */ - char *dptr; - long dosTime; + long code = 0; + cm_scache_t *scp; + cm_scache_t *targetScp; /* target if scp is a symlink */ + char *dptr; + long dosTime; FILETIME ft; - int shortTemp; - unsigned short attr; + int shortTemp; + unsigned short attr; unsigned long lattr; - smb_dirListPatch_t *patchp; - smb_dirListPatch_t *npatchp; + smb_dirListPatch_t *patchp; + smb_dirListPatch_t *npatchp; - for(patchp = *dirPatchespp; patchp; patchp = - (smb_dirListPatch_t *) osi_QNext(&patchp->q)) { + for(patchp = *dirPatchespp; patchp; patchp = + (smb_dirListPatch_t *) osi_QNext(&patchp->q)) { code = cm_GetSCache(&patchp->fid, &scp, userp, reqp); - if (code) continue; - lock_ObtainMutex(&scp->mx); - code = cm_SyncOp(scp, NULL, userp, reqp, 0, - CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); - if (code) { + if (code) continue; + lock_ObtainMutex(&scp->mx); + code = cm_SyncOp(scp, NULL, userp, reqp, 0, + CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); + if (code) { lock_ReleaseMutex(&scp->mx); cm_ReleaseSCache(scp); continue; - } + } - /* now watch for a symlink */ - if (scp->fileType == CM_SCACHETYPE_SYMLINK) { + /* now watch for a symlink */ + if (scp->fileType == CM_SCACHETYPE_SYMLINK) { lock_ReleaseMutex(&scp->mx); - code = cm_EvaluateSymLink(dscp, scp, &targetScp, userp, - reqp); - if (code == 0) { + code = cm_EvaluateSymLink(dscp, scp, &targetScp, userp, reqp); + if (code == 0) { /* we have a more accurate file to use (the * target of the symbolic link). Otherwise, * we'll just use the symlink anyway. - */ - osi_Log2(afsd_logp, "symlink vp %x to vp %x", - scp, targetScp); + */ + osi_Log2(smb_logp, "symlink vp %x to vp %x", + scp, targetScp); cm_ReleaseSCache(scp); - scp = targetScp; - } - lock_ObtainMutex(&scp->mx); - } + scp = targetScp; + } + lock_ObtainMutex(&scp->mx); + } dptr = patchp->dptr; @@ -1613,6 +1672,9 @@ long smb_ApplyV3DirListPatches(cm_scache_t *dscp, /* Copy attributes */ lattr = smb_ExtAttributes(scp); + /* merge in hidden (dot file) attribute */ + if( patchp->flags & SMB_DIRLISTPATCH_DOTFILE ) + lattr |= SMB_ATTR_HIDDEN; *((u_long *)dptr) = lattr; dptr += 4; } @@ -1660,39 +1722,110 @@ long smb_ApplyV3DirListPatches(cm_scache_t *dscp, /* finally copy out attributes as short */ attr = smb_Attributes(scp); + /* merge in hidden (dot file) attribute */ + if( patchp->flags & SMB_DIRLISTPATCH_DOTFILE ) + attr |= SMB_ATTR_HIDDEN; *dptr++ = attr & 0xff; *dptr++ = (attr >> 8) & 0xff; } - lock_ReleaseMutex(&scp->mx); - cm_ReleaseSCache(scp); + lock_ReleaseMutex(&scp->mx); + cm_ReleaseSCache(scp); } - /* now free the patches */ - for(patchp = *dirPatchespp; patchp; patchp = npatchp) { + /* now free the patches */ + for(patchp = *dirPatchespp; patchp; patchp = npatchp) { npatchp = (smb_dirListPatch_t *) osi_QNext(&patchp->q); - free(patchp); + free(patchp); } - /* and mark the list as empty */ - *dirPatchespp = NULL; + /* and mark the list as empty */ + *dirPatchespp = NULL; - return code; + return code; +} + +#ifndef USE_OLD_MATCHING +// char table for case insensitive comparison +char mapCaseTable[256]; + +VOID initUpperCaseTable(VOID) +{ + int i; + for (i = 0; i < 256; ++i) + mapCaseTable[i] = toupper(i); + // make '"' match '.' + mapCaseTable[(int)'"'] = toupper('.'); +} + +// Compare 'pattern' (containing metacharacters '*' and '?') with the file +// name 'name'. +// Note : this procedure works recursively calling itself. +// Parameters +// PSZ pattern : string containing metacharacters. +// PSZ name : file name to be compared with 'pattern'. +// Return value +// BOOL : TRUE/FALSE (match/mistmatch) + +BOOL szWildCardMatchFileName(PSZ pattern, PSZ name) { + PSZ pename; // points to the last 'name' character + PSZ p; + pename = name + strlen(name) - 1; + while (*name) { + switch (*pattern) { + case '?': + if (*(++pattern) != '<' || *(++pattern) != '*') { + if (*name == '.') return FALSE; + ++name; + break; + } /* endif */ + case '<': + case '*': + while ((*pattern == '<') || (*pattern == '*') || (*pattern == '?')) ++pattern; + if (!*pattern) return TRUE; + for (p = pename; p >= name; --p) { + if ((mapCaseTable[*p] == mapCaseTable[*pattern]) && + szWildCardMatchFileName(pattern + 1, p + 1)) + return TRUE; + } /* endfor */ + return FALSE; + default: + if (mapCaseTable[*name] != mapCaseTable[*pattern]) return FALSE; + ++pattern, ++name; + break; + } /* endswitch */ + } /* endwhile */ return !*pattern; +} + +/* do a case-folding search of the star name mask with the name in namep. + * Return 1 if we match, otherwise 0. + */ +int smb_V3MatchMask(char *namep, char *maskp, int flags) +{ + /* make sure we only match 8.3 names, if requested */ + if ((flags & CM_FLAG_8DOT3) && !cm_Is8Dot3(namep)) + return 0; + + return szWildCardMatchFileName(maskp, namep) ? 1:0; } +#else /* USE_OLD_MATCHING */ /* do a case-folding search of the star name mask with the name in namep. * Return 1 if we match, otherwise 0. */ int smb_V3MatchMask(char *namep, char *maskp, int flags) { unsigned char tcp1, tcp2; /* Pattern characters */ - unsigned char tcn1; /* Name characters */ - int sawDot = 0, sawStar = 0; + unsigned char tcn1; /* Name characters */ + int sawDot = 0, sawStar = 0, req8dot3 = 0; char *starNamep, *starMaskp; static char nullCharp[] = {0}; + int casefold = flags & CM_FLAG_CASEFOLD; /* make sure we only match 8.3 names, if requested */ - if ((flags & CM_FLAG_8DOT3) && !cm_Is8Dot3(namep)) return 0; + req8dot3 = (flags & CM_FLAG_8DOT3); + if (req8dot3 && !cm_Is8Dot3(namep)) + return 0; /* loop */ while (1) { @@ -1749,8 +1882,8 @@ int smb_V3MatchMask(char *namep, char *maskp, int flags) tcp2 = *maskp++; if (tcp2 == 0) return 1; - else if (tcp2 == '.' || tcp2 == '"') { - while (tcn1 != '.' && tcn1 != 0) + else if ((req8dot3 && tcp2 == '.') || tcp2 == '"') { + while (req8dot3 && tcn1 != '.' && tcn1 != 0) tcn1 = *++namep; if (tcn1 == 0) { if (sawDot) @@ -1776,12 +1909,13 @@ int smb_V3MatchMask(char *namep, char *maskp, int flags) tcp2 = *maskp++; /* skip over characters that don't match tcp2 */ - while (tcn1 != '.' && tcn1 != 0 - && cm_foldUpper[tcn1] != cm_foldUpper[tcp2]) + while (req8dot3 && tcn1 != '.' && tcn1 != 0 && + ((casefold && cm_foldUpper[tcn1] != cm_foldUpper[tcp2]) || + (!casefold && tcn1 != tcp2))) tcn1 = *++namep; /* No match */ - if (tcn1 == '.' || tcn1 == 0) + if ((req8dot3 && tcn1 == '.') || tcn1 == 0) return 0; /* Remember where we are */ @@ -1795,7 +1929,8 @@ int smb_V3MatchMask(char *namep, char *maskp, int flags) } else { /* tcp1 is not a wildcard */ - if (cm_foldUpper[tcn1] == cm_foldUpper[tcp1]) { + if ((casefold && cm_foldUpper[tcn1] == cm_foldUpper[tcp1]) || + (!casefold && tcn1 == tcp1)) { /* they match */ namep++; continue; @@ -1812,272 +1947,286 @@ int smb_V3MatchMask(char *namep, char *maskp, int flags) } } } +#endif /* USE_OLD_MATCHING */ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *opx) { int attribute; - long nextCookie; - char *tp; - long code; - char *pathp; - cm_dirEntry_t *dep; - int maxCount; - smb_dirListPatch_t *dirListPatchesp; - smb_dirListPatch_t *curPatchp; - cm_buf_t *bufferp; - long temp; - long orbytes; /* # of bytes in this output record */ - long ohbytes; /* # of bytes, except file name */ - long onbytes; /* # of bytes in name, incl. term. null */ - osi_hyper_t dirLength; - osi_hyper_t bufferOffset; - osi_hyper_t curOffset; - osi_hyper_t thyper; - smb_dirSearch_t *dsp; - cm_scache_t *scp; - long entryInDir; - long entryInBuffer; + long nextCookie; + char *tp; + long code = 0; + char *pathp; + cm_dirEntry_t *dep; + int maxCount; + smb_dirListPatch_t *dirListPatchesp; + smb_dirListPatch_t *curPatchp; + cm_buf_t *bufferp; + long temp; + long orbytes; /* # of bytes in this output record */ + long ohbytes; /* # of bytes, except file name */ + long onbytes; /* # of bytes in name, incl. term. null */ + osi_hyper_t dirLength; + osi_hyper_t bufferOffset; + osi_hyper_t curOffset; + osi_hyper_t thyper; + smb_dirSearch_t *dsp; + cm_scache_t *scp; + long entryInDir; + long entryInBuffer; cm_pageHeader_t *pageHeaderp; - cm_user_t *userp = NULL; - int slotInPage; - int returnedNames; - long nextEntryCookie; - int numDirChunks; /* # of 32 byte dir chunks in this entry */ - char *op; /* output data ptr */ + cm_user_t *userp = NULL; + int slotInPage; + int returnedNames; + long nextEntryCookie; + int numDirChunks; /* # of 32 byte dir chunks in this entry */ + char *op; /* output data ptr */ char *origOp; /* original value of op */ - cm_space_t *spacep; /* for pathname buffer */ - long maxReturnData; /* max # of return data */ - long maxReturnParms; /* max # of return parms */ - long bytesInBuffer; /* # data bytes in the output buffer */ - int starPattern; - char *maskp; /* mask part of path */ - int infoLevel; - int searchFlags; - int eos; - smb_tran2Packet_t *outp; /* response packet */ + cm_space_t *spacep; /* for pathname buffer */ + long maxReturnData; /* max # of return data */ + long maxReturnParms; /* max # of return parms */ + long bytesInBuffer; /* # data bytes in the output buffer */ + int starPattern; + char *maskp; /* mask part of path */ + int infoLevel; + int searchFlags; + int eos; + smb_tran2Packet_t *outp; /* response packet */ char *tidPathp; int align; char shortName[13]; /* 8.3 name if needed */ int NeedShortName; + int foundInexact; char *shortNameEnd; - int fileType; - cm_fid_t fid; - - cm_req_t req; + int fileType; + cm_fid_t fid; + + cm_req_t req; cm_InitReq(&req); eos = 0; if (p->opcode == 1) { /* find first; obtain basic parameters from request */ - attribute = p->parmsp[0]; - maxCount = p->parmsp[1]; - infoLevel = p->parmsp[3]; - searchFlags = p->parmsp[2]; - dsp = smb_NewDirSearch(1); - dsp->attribute = attribute; - pathp = ((char *) p->parmsp) + 12; /* points to path */ - nextCookie = 0; - maskp = strrchr(pathp, '\\'); - if (maskp == NULL) maskp = pathp; + attribute = p->parmsp[0]; + maxCount = p->parmsp[1]; + infoLevel = p->parmsp[3]; + searchFlags = p->parmsp[2]; + dsp = smb_NewDirSearch(1); + dsp->attribute = attribute; + pathp = ((char *) p->parmsp) + 12; /* points to path */ + nextCookie = 0; + maskp = strrchr(pathp, '\\'); + if (maskp == NULL) maskp = pathp; else maskp++; /* skip over backslash */ - strcpy(dsp->mask, maskp); /* and save mask */ + strcpy(dsp->mask, maskp); /* and save mask */ /* track if this is likely to match a lot of entries */ - starPattern = smb_V3IsStarMask(maskp); + starPattern = smb_V3IsStarMask(maskp); } - else { + else { osi_assert(p->opcode == 2); - /* find next; obtain basic parameters from request or open dir file */ - dsp = smb_FindDirSearch(p->parmsp[0]); - if (!dsp) return CM_ERROR_BADFD; - attribute = dsp->attribute; - maxCount = p->parmsp[1]; - infoLevel = p->parmsp[2]; - searchFlags = p->parmsp[5]; - pathp = NULL; - nextCookie = p->parmsp[3] | (p->parmsp[4] << 16); - maskp = dsp->mask; + /* find next; obtain basic parameters from request or open dir file */ + dsp = smb_FindDirSearch(p->parmsp[0]); + if (!dsp) return CM_ERROR_BADFD; + attribute = dsp->attribute; + maxCount = p->parmsp[1]; + infoLevel = p->parmsp[2]; + searchFlags = p->parmsp[5]; + pathp = NULL; + nextCookie = p->parmsp[3] | (p->parmsp[4] << 16); + maskp = dsp->mask; starPattern = 1; /* assume, since required a Find Next */ - } + } - osi_Log4(afsd_logp, - "T2 search dir attr 0x%x, info level %d, max count %d, flags 0x%x", - attribute, infoLevel, maxCount, searchFlags); + osi_Log4(smb_logp, + "T2 search dir attr 0x%x, info level %d, max count %d, flags 0x%x", + attribute, infoLevel, maxCount, searchFlags); - osi_Log2(afsd_logp, "...T2 search op %d, nextCookie 0x%x", - p->opcode, nextCookie); + osi_Log2(smb_logp, "...T2 search op %d, nextCookie 0x%x", + p->opcode, nextCookie); if (infoLevel >= 0x101) searchFlags &= ~4; /* no resume keys */ - dirListPatchesp = NULL; + dirListPatchesp = NULL; maxReturnData = p->maxReturnData; - if (p->opcode == 1) /* find first */ - maxReturnParms = 10; /* bytes */ - else - maxReturnParms = 8; /* bytes */ + if (p->opcode == 1) /* find first */ + maxReturnParms = 10; /* bytes */ + else + maxReturnParms = 8; /* bytes */ #ifndef CM_CONFIG_MULTITRAN2RESPONSES - if (maxReturnData > 6000) maxReturnData = 6000; + if (maxReturnData > 6000) + maxReturnData = 6000; #endif /* CM_CONFIG_MULTITRAN2RESPONSES */ outp = smb_GetTran2ResponsePacket(vcp, p, opx, maxReturnParms, - maxReturnData); + maxReturnData); - osi_Log1(afsd_logp, "T2 receive search dir %s", - osi_LogSaveString(afsd_logp, pathp)); + osi_Log1(smb_logp, "T2 receive search dir %s", + osi_LogSaveString(smb_logp, pathp)); - /* bail out if request looks bad */ - if (p->opcode == 1 && !pathp) { - return CM_ERROR_BADSMB; - } + /* bail out if request looks bad */ + if (p->opcode == 1 && !pathp) { + smb_ReleaseDirSearch(dsp); + smb_FreeTran2Packet(outp); + return CM_ERROR_BADSMB; + } - osi_Log2(afsd_logp, "T2 dir search cookie 0x%x, connection %d", - nextCookie, dsp->cookie); - - userp = smb_GetTran2User(vcp, p); + osi_Log2(smb_logp, "T2 dir search cookie 0x%x, connection %d", + nextCookie, dsp->cookie); + + userp = smb_GetTran2User(vcp, p); + if (!userp) { + osi_Log1(smb_logp, "T2 dir search unable to resolve user [%d]", p->uid); + smb_ReleaseDirSearch(dsp); + smb_FreeTran2Packet(outp); + return CM_ERROR_BADSMB; + } /* try to get the vnode for the path name next */ lock_ObtainMutex(&dsp->mx); if (dsp->scp) { scp = dsp->scp; - cm_HoldSCache(scp); - code = 0; - } - else { + cm_HoldSCache(scp); + code = 0; + } + else { spacep = cm_GetSpace(); - smb_StripLastComponent(spacep->data, NULL, pathp); - lock_ReleaseMutex(&dsp->mx); + smb_StripLastComponent(spacep->data, NULL, pathp); + lock_ReleaseMutex(&dsp->mx); tidPathp = smb_GetTIDPath(vcp, p->tid); - code = cm_NameI(cm_rootSCachep, spacep->data, - CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, - userp, tidPathp, &req, &scp); - cm_FreeSpace(spacep); + code = cm_NameI(cm_rootSCachep, spacep->data, + CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, + userp, tidPathp, &req, &scp); + cm_FreeSpace(spacep); - lock_ObtainMutex(&dsp->mx); + lock_ObtainMutex(&dsp->mx); if (code == 0) { - if (dsp->scp != 0) cm_ReleaseSCache(dsp->scp); + if (dsp->scp != 0) cm_ReleaseSCache(dsp->scp); dsp->scp = scp; /* we need one hold for the entry we just stored into, - * and one for our own processing. When we're done + * and one for our own processing. When we're done * with this function, we'll drop the one for our own * processing. We held it once from the namei call, * and so we do another hold now. - */ - cm_HoldSCache(scp); + */ + cm_HoldSCache(scp); lock_ObtainMutex(&scp->mx); if ((scp->flags & CM_SCACHEFLAG_BULKSTATTING) == 0 && LargeIntegerGreaterOrEqualToZero(scp->bulkStatProgress)) { - scp->flags |= CM_SCACHEFLAG_BULKSTATTING; + scp->flags |= CM_SCACHEFLAG_BULKSTATTING; dsp->flags |= SMB_DIRSEARCH_BULKST; } lock_ReleaseMutex(&scp->mx); - } } + } lock_ReleaseMutex(&dsp->mx); - if (code) { + if (code) { cm_ReleaseUser(userp); - smb_FreeTran2Packet(outp); + smb_FreeTran2Packet(outp); smb_DeleteDirSearch(dsp); smb_ReleaseDirSearch(dsp); - return code; + return code; } - /* get the directory size */ + /* get the directory size */ lock_ObtainMutex(&scp->mx); - code = cm_SyncOp(scp, NULL, userp, &req, 0, - CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); + code = cm_SyncOp(scp, NULL, userp, &req, 0, + CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); if (code) { lock_ReleaseMutex(&scp->mx); - cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); - smb_FreeTran2Packet(outp); + cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); + smb_FreeTran2Packet(outp); smb_DeleteDirSearch(dsp); smb_ReleaseDirSearch(dsp); - return code; - } - - dirLength = scp->length; - bufferp = NULL; - bufferOffset.LowPart = bufferOffset.HighPart = 0; - curOffset.HighPart = 0; - curOffset.LowPart = nextCookie; + return code; + } + + startsearch: + dirLength = scp->length; + bufferp = NULL; + bufferOffset.LowPart = bufferOffset.HighPart = 0; + curOffset.HighPart = 0; + curOffset.LowPart = nextCookie; origOp = outp->datap; - code = 0; - returnedNames = 0; - bytesInBuffer = 0; - while (1) { + foundInexact = 0; + code = 0; + returnedNames = 0; + bytesInBuffer = 0; + while (1) { op = origOp; if (searchFlags & 4) /* skip over resume key */ op += 4; /* make sure that curOffset.LowPart doesn't point to the first - * 32 bytes in the 2nd through last dir page, and that it doesn't - * point at the first 13 32-byte chunks in the first dir page, - * since those are dir and page headers, and don't contain useful - * information. - */ + * 32 bytes in the 2nd through last dir page, and that it doesn't + * point at the first 13 32-byte chunks in the first dir page, + * since those are dir and page headers, and don't contain useful + * information. + */ temp = curOffset.LowPart & (2048-1); - if (curOffset.HighPart == 0 && curOffset.LowPart < 2048) { + if (curOffset.HighPart == 0 && curOffset.LowPart < 2048) { /* we're in the first page */ - if (temp < 13*32) temp = 13*32; + if (temp < 13*32) temp = 13*32; } else { /* we're in a later dir page */ - if (temp < 32) temp = 32; - } + if (temp < 32) temp = 32; + } - /* make sure the low order 5 bits are zero */ - temp &= ~(32-1); + /* make sure the low order 5 bits are zero */ + temp &= ~(32-1); - /* now put temp bits back ito curOffset.LowPart */ - curOffset.LowPart &= ~(2048-1); - curOffset.LowPart |= temp; - - /* check if we've returned all the names that will fit in the - * response packet; we check return count as well as the number - * of bytes requested. We check the # of bytes after we find - * the dir entry, since we'll need to check its size. - */ - if (returnedNames >= maxCount) break; - - /* check if we've passed the dir's EOF */ - if (LargeIntegerGreaterThanOrEqualTo(curOffset, dirLength)) { - eos = 1; - break; - } - - /* see if we can use the bufferp we have now; compute in which - * page the current offset would be, and check whether that's - * the offset of the buffer we have. If not, get the buffer. - */ - thyper.HighPart = curOffset.HighPart; - thyper.LowPart = curOffset.LowPart & ~(buf_bufferSize-1); - if (!bufferp || !LargeIntegerEqualTo(thyper, bufferOffset)) { + /* now put temp bits back ito curOffset.LowPart */ + curOffset.LowPart &= ~(2048-1); + curOffset.LowPart |= temp; + + /* check if we've passed the dir's EOF */ + if (LargeIntegerGreaterThanOrEqualTo(curOffset, dirLength)) { + eos = 1; + break; + } + + /* check if we've returned all the names that will fit in the + * response packet; we check return count as well as the number + * of bytes requested. We check the # of bytes after we find + * the dir entry, since we'll need to check its size. + */ + if (returnedNames >= maxCount) { + break; + } + + /* see if we can use the bufferp we have now; compute in which + * page the current offset would be, and check whether that's + * the offset of the buffer we have. If not, get the buffer. + */ + thyper.HighPart = curOffset.HighPart; + thyper.LowPart = curOffset.LowPart & ~(buf_bufferSize-1); + if (!bufferp || !LargeIntegerEqualTo(thyper, bufferOffset)) { /* wrong buffer */ - if (bufferp) { - buf_Release(bufferp); - bufferp = NULL; - } + if (bufferp) { + buf_Release(bufferp); + bufferp = NULL; + } lock_ReleaseMutex(&scp->mx); lock_ObtainRead(&scp->bufCreateLock); - code = buf_Get(scp, &thyper, &bufferp); + code = buf_Get(scp, &thyper, &bufferp); lock_ReleaseRead(&scp->bufCreateLock); /* now, if we're doing a star match, do bulk fetching * of all of the status info for files in the dir. - */ - if (starPattern) { + */ + if (starPattern) { smb_ApplyV3DirListPatches(scp, &dirListPatchesp, - infoLevel, userp, - &req); + infoLevel, userp, + &req); if ((dsp->flags & SMB_DIRSEARCH_BULKST) - && LargeIntegerGreaterThanOrEqualTo( - thyper, scp->bulkStatProgress)) { + && LargeIntegerGreaterThanOrEqualTo(thyper, scp->bulkStatProgress)) { /* Don't bulk stat if risking timeout */ int now = GetCurrentTime(); if (now - req.startTime > 5000) { @@ -2085,79 +2234,77 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t scp->flags &= ~CM_SCACHEFLAG_BULKSTATTING; dsp->flags &= ~SMB_DIRSEARCH_BULKST; } else - cm_TryBulkStat(scp, &thyper, - userp, &req); + cm_TryBulkStat(scp, &thyper, userp, &req); } } - lock_ObtainMutex(&scp->mx); - if (code) break; - bufferOffset = thyper; + lock_ObtainMutex(&scp->mx); + if (code) break; + bufferOffset = thyper; - /* now get the data in the cache */ - while (1) { + /* now get the data in the cache */ + while (1) { code = cm_SyncOp(scp, bufferp, userp, &req, - PRSFS_LOOKUP, - CM_SCACHESYNC_NEEDCALLBACK - | CM_SCACHESYNC_READ); + PRSFS_LOOKUP, + CM_SCACHESYNC_NEEDCALLBACK + | CM_SCACHESYNC_READ); if (code) break; - if (cm_HaveBuffer(scp, bufferp, 0)) break; - - /* otherwise, load the buffer and try again */ - code = cm_GetBuffer(scp, bufferp, NULL, userp, - &req); - if (code) break; - } - if (code) { + if (cm_HaveBuffer(scp, bufferp, 0)) break; + + /* otherwise, load the buffer and try again */ + code = cm_GetBuffer(scp, bufferp, NULL, userp, + &req); + if (code) break; + } + if (code) { buf_Release(bufferp); - bufferp = NULL; - break; + bufferp = NULL; + break; } - } /* if (wrong buffer) ... */ + } /* if (wrong buffer) ... */ - /* now we have the buffer containing the entry we're interested - * in; copy it out if it represents a non-deleted entry. - */ + /* now we have the buffer containing the entry we're interested + * in; copy it out if it represents a non-deleted entry. + */ entryInDir = curOffset.LowPart & (2048-1); - entryInBuffer = curOffset.LowPart & (buf_bufferSize - 1); + entryInBuffer = curOffset.LowPart & (buf_bufferSize - 1); /* page header will help tell us which entries are free. Page * header can change more often than once per buffer, since * AFS 3 dir page size may be less than (but not more than) * a buffer package buffer. - */ + */ /* only look intra-buffer */ temp = curOffset.LowPart & (buf_bufferSize - 1); - temp &= ~(2048 - 1); /* turn off intra-page bits */ + temp &= ~(2048 - 1); /* turn off intra-page bits */ pageHeaderp = (cm_pageHeader_t *) (bufferp->datap + temp); /* now determine which entry we're looking at in the page. * If it is free (there's a free bitmap at the start of the * dir), we should skip these 32 bytes. - */ - slotInPage = (entryInDir & 0x7e0) >> 5; - if (!(pageHeaderp->freeBitmap[slotInPage>>3] - & (1 << (slotInPage & 0x7)))) { + */ + slotInPage = (entryInDir & 0x7e0) >> 5; + if (!(pageHeaderp->freeBitmap[slotInPage>>3] + & (1 << (slotInPage & 0x7)))) { /* this entry is free */ - numDirChunks = 1; /* only skip this guy */ - goto nextEntry; - } + numDirChunks = 1; /* only skip this guy */ + goto nextEntry; + } tp = bufferp->datap + entryInBuffer; - dep = (cm_dirEntry_t *) tp; /* now points to AFS3 dir entry */ + dep = (cm_dirEntry_t *) tp; /* now points to AFS3 dir entry */ - /* while we're here, compute the next entry's location, too, + /* while we're here, compute the next entry's location, too, * since we'll need it when writing out the cookie into the dir * listing stream. - * - * XXXX Probably should do more sanity checking. - */ + * + * XXXX Probably should do more sanity checking. + */ numDirChunks = cm_NameEntries(dep->name, &onbytes); - /* compute offset of cookie representing next entry */ - nextEntryCookie = curOffset.LowPart - + (CM_DIR_CHUNKSIZE * numDirChunks); + /* compute offset of cookie representing next entry */ + nextEntryCookie = curOffset.LowPart + (CM_DIR_CHUNKSIZE * numDirChunks); /* Need 8.3 name? */ NeedShortName = 0; @@ -2168,28 +2315,33 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t NeedShortName = 1; } - if (dep->fid.vnode != 0 - && (smb_V3MatchMask(dep->name, maskp, CM_FLAG_CASEFOLD) - || (NeedShortName - && smb_V3MatchMask(shortName, maskp, - CM_FLAG_CASEFOLD)))) { - - /* Eliminate entries that don't match requested - attributes */ - if (!(dsp->attribute & 0x10)) /* no directories */ - { - /* We have already done the cm_TryBulkStat above */ - fid.cell = scp->fid.cell; - fid.volume = scp->fid.volume; - fid.vnode = ntohl(dep->fid.vnode); - fid.unique = ntohl(dep->fid.unique); - fileType = cm_FindFileType(&fid); - /*osi_Log2(afsd_logp, "smb_ReceiveTran2SearchDir: file %s " - "has filetype %d", dep->name, - fileType);*/ - if (fileType == CM_SCACHETYPE_DIRECTORY) - goto nextEntry; - } + /* When matching, we are using doing a case fold if we have a wildcard mask. + * If we get a non-wildcard match, it's a lookup for a specific file. + */ + if (dep->fid.vnode != 0 && + (smb_V3MatchMask(dep->name, maskp, (starPattern? CM_FLAG_CASEFOLD : 0)) + || (NeedShortName + && smb_V3MatchMask(shortName, maskp, CM_FLAG_CASEFOLD)))) { + + /* Eliminate entries that don't match requested attributes */ + if (smb_hideDotFiles && !(dsp->attribute & SMB_ATTR_HIDDEN) && + smb_IsDotFile(dep->name)) + goto nextEntry; /* no hidden files */ + + if (!(dsp->attribute & SMB_ATTR_DIRECTORY)) /* no directories */ + { + /* We have already done the cm_TryBulkStat above */ + fid.cell = scp->fid.cell; + fid.volume = scp->fid.volume; + fid.vnode = ntohl(dep->fid.vnode); + fid.unique = ntohl(dep->fid.unique); + fileType = cm_FindFileType(&fid); + /*osi_Log2(smb_logp, "smb_ReceiveTran2SearchDir: file %s " + "has filetype %d", dep->name, + fileType);*/ + if (fileType == CM_SCACHETYPE_DIRECTORY) + goto nextEntry; + } /* finally check if this name will fit */ @@ -2204,13 +2356,13 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t if (infoLevel == 0x104) ohbytes += 26; /* Short name & length */ - if (searchFlags & 4) { - ohbytes += 4; /* if resume key required */ - } + if (searchFlags & 4) { + ohbytes += 4; /* if resume key required */ + } - if (infoLevel != 1 - && infoLevel != 0x101 - && infoLevel != 0x103) + if (infoLevel != 1 + && infoLevel != 0x101 + && infoLevel != 0x103) ohbytes += 4; /* EASIZE */ /* add header to name & term. null */ @@ -2221,39 +2373,39 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t * even the aligned version (so we don't have to worry * about an * overflow when we pad things out below). * That's the reason for the alignment arithmetic below. - */ + */ if (infoLevel >= 0x101) align = (4 - (orbytes & 3)) & 3; else align = 0; if (orbytes + bytesInBuffer + align > maxReturnData) - break; + break; /* this is one of the entries to use: it is not deleted * and it matches the star pattern we're looking for. * Put out the name, preceded by its length. - */ + */ /* First zero everything else */ memset(origOp, 0, ohbytes); if (infoLevel <= 0x101) - *(origOp + ohbytes - 1) = (unsigned char) onbytes; + *(origOp + ohbytes - 1) = (unsigned char) onbytes; else if (infoLevel == 0x103) *((u_long *)(op + 8)) = onbytes; else *((u_long *)(op + 60)) = onbytes; - strcpy(origOp+ohbytes, dep->name); + strcpy(origOp+ohbytes, dep->name); /* Short name if requested and needed */ - if (infoLevel == 0x104) { + if (infoLevel == 0x104) { if (NeedShortName) { strcpy(op + 70, shortName); *(op + 68) = shortNameEnd - shortName; } } - /* now, adjust the # of entries copied */ - returnedNames++; + /* now, adjust the # of entries copied */ + returnedNames++; /* NextEntryOffset and FileIndex */ if (infoLevel >= 101) { @@ -2262,34 +2414,41 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *((u_long *)(op+4)) = nextEntryCookie; } - /* now we emit the attribute. This is tricky, since - * we need to really stat the file to find out what + /* now we emit the attribute. This is tricky, since + * we need to really stat the file to find out what * type of entry we've got. Right now, we're copying * out data from * a buffer, while holding the scp * locked, so it isn't really convenient to stat * something now. We'll put in a place holder - * now, and make a second pass before returning this + * now, and make a second pass before returning this * to get the real attributes. So, we just skip the * data for now, and adjust it later. We allocate a * patch record to make it easy to find this point * later. The replay will happen at a time when it is * safe to unlock the directory. - */ + */ if (infoLevel != 0x103) { curPatchp = malloc(sizeof(*curPatchp)); - osi_QAdd((osi_queue_t **) &dirListPatchesp, - &curPatchp->q); + osi_QAdd((osi_queue_t **) &dirListPatchesp, + &curPatchp->q); curPatchp->dptr = op; if (infoLevel >= 0x101) curPatchp->dptr += 8; + + if (smb_hideDotFiles && smb_IsDotFile(dep->name)) { + curPatchp->flags = SMB_DIRLISTPATCH_DOTFILE; + } + else + curPatchp->flags = 0; + curPatchp->fid.cell = scp->fid.cell; curPatchp->fid.volume = scp->fid.volume; curPatchp->fid.vnode = ntohl(dep->fid.vnode); curPatchp->fid.unique = ntohl(dep->fid.unique); - /* temp */ - curPatchp->dep = dep; - } + /* temp */ + curPatchp->dep = dep; + } if (searchFlags & 4) /* put out resume key */ @@ -2297,312 +2456,344 @@ long smb_ReceiveTran2SearchDir(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t /* Adjust byte ptr and count */ origOp += orbytes; /* skip entire record */ - bytesInBuffer += orbytes; + bytesInBuffer += orbytes; /* and pad the record out */ - while (--align >= 0) { + while (--align >= 0) { *origOp++ = 0; - bytesInBuffer++; - } - + bytesInBuffer++; + } + } /* if we're including this name */ + else if(!NeedShortName && + !starPattern && + !foundInexact && + dep->fid.vnode != 0 && + smb_V3MatchMask(dep->name, maskp, CM_FLAG_CASEFOLD)) { + /* We were looking for exact matches, but here's an inexact one*/ + foundInexact = 1; + } -nextEntry: - /* and adjust curOffset to be where the new cookie is */ + nextEntry: + /* and adjust curOffset to be where the new cookie is */ thyper.HighPart = 0; - thyper.LowPart = CM_DIR_CHUNKSIZE * numDirChunks; - curOffset = LargeIntegerAdd(thyper, curOffset); - } /* while copying data for dir listing */ + thyper.LowPart = CM_DIR_CHUNKSIZE * numDirChunks; + curOffset = LargeIntegerAdd(thyper, curOffset); + } /* while copying data for dir listing */ + + /* If we didn't get a star pattern, we did an exact match during the first pass. + * If there were no exact matches found, we fail over to inexact matches by + * marking the query as a star pattern (matches all case permutations), and + * re-running the query. + */ + if (returnedNames == 0 && !starPattern && foundInexact) { + osi_Log0(afsd_logp,"T2 Search: No exact matches. Re-running for inexact matches"); + starPattern = 1; + goto startsearch; + } /* release the mutex */ lock_ReleaseMutex(&scp->mx); - if (bufferp) buf_Release(bufferp); + if (bufferp) buf_Release(bufferp); /* apply and free last set of patches; if not doing a star match, this * will be empty, but better safe (and freeing everything) than sorry. - */ - smb_ApplyV3DirListPatches(scp, &dirListPatchesp, infoLevel, userp, - &req); + */ + smb_ApplyV3DirListPatches(scp, &dirListPatchesp, infoLevel, userp, + &req); - /* now put out the final parameters */ + /* now put out the final parameters */ if (returnedNames == 0) eos = 1; - if (p->opcode == 1) { + if (p->opcode == 1) { /* find first */ - outp->parmsp[0] = (unsigned short) dsp->cookie; - outp->parmsp[1] = returnedNames; - outp->parmsp[2] = eos; - outp->parmsp[3] = 0; /* nothing wrong with EAS */ - outp->parmsp[4] = 0; /* don't need last name to continue - * search, cookie is enough. Normally, - * this is the offset of the file name - * of the last entry returned. - */ - outp->totalParms = 10; /* in bytes */ - } - else { - /* find next */ - outp->parmsp[0] = returnedNames; - outp->parmsp[1] = eos; - outp->parmsp[2] = 0; /* EAS error */ - outp->parmsp[3] = 0; /* last name, as above */ - outp->totalParms = 8; /* in bytes */ - } + outp->parmsp[0] = (unsigned short) dsp->cookie; + outp->parmsp[1] = returnedNames; + outp->parmsp[2] = eos; + outp->parmsp[3] = 0; /* nothing wrong with EAS */ + outp->parmsp[4] = 0; + /* don't need last name to continue + * search, cookie is enough. Normally, + * this is the offset of the file name + * of the last entry returned. + */ + outp->totalParms = 10; /* in bytes */ + } + else { + /* find next */ + outp->parmsp[0] = returnedNames; + outp->parmsp[1] = eos; + outp->parmsp[2] = 0; /* EAS error */ + outp->parmsp[3] = 0; /* last name, as above */ + outp->totalParms = 8; /* in bytes */ + } /* return # of bytes in the buffer */ - outp->totalData = bytesInBuffer; + outp->totalData = bytesInBuffer; - osi_Log2(afsd_logp, "T2 search dir done, %d names, code %d", - returnedNames, code); + osi_Log2(smb_logp, "T2 search dir done, %d names, code %d", + returnedNames, code); /* Return error code if unsuccessful on first request */ if (code == 0 && p->opcode == 1 && returnedNames == 0) code = CM_ERROR_NOSUCHFILE; /* if we're supposed to close the search after this request, or if - * we're supposed to close the search if we're done, and we're done, - * or if something went wrong, close the search. - */ - /* ((searchFlags & 1) || ((searchFlags & 2) && eos) */ - if ((searchFlags & 1) || (returnedNames == 0) || ((searchFlags & 2) && - eos) || code != 0) + * we're supposed to close the search if we're done, and we're done, + * or if something went wrong, close the search. + */ + /* ((searchFlags & 1) || ((searchFlags & 2) && eos) */ + if ((searchFlags & 1) || (returnedNames == 0) || + ((searchFlags & 2) && eos) || code != 0) smb_DeleteDirSearch(dsp); if (code) - smb_SendTran2Error(vcp, p, opx, code); + smb_SendTran2Error(vcp, p, opx, code); else { - smb_SendTran2Packet(vcp, outp, opx); + smb_SendTran2Packet(vcp, outp, opx); } smb_FreeTran2Packet(outp); - smb_ReleaseDirSearch(dsp); - cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); - return 0; + smb_ReleaseDirSearch(dsp); + cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); + return 0; } long smb_ReceiveV3FindClose(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { - int dirHandle; - smb_dirSearch_t *dsp; + int dirHandle; + smb_dirSearch_t *dsp; - dirHandle = smb_GetSMBParm(inp, 0); + dirHandle = smb_GetSMBParm(inp, 0); - osi_Log1(afsd_logp, "SMB3 find close handle %d", dirHandle); + osi_Log1(smb_logp, "SMB3 find close handle %d", dirHandle); - dsp = smb_FindDirSearch(dirHandle); + dsp = smb_FindDirSearch(dirHandle); - if (!dsp) + if (!dsp) return CM_ERROR_BADFD; - /* otherwise, we have an FD to destroy */ - smb_DeleteDirSearch(dsp); - smb_ReleaseDirSearch(dsp); + /* otherwise, we have an FD to destroy */ + smb_DeleteDirSearch(dsp); + smb_ReleaseDirSearch(dsp); /* and return results */ smb_SetSMBDataLength(outp, 0); - return 0; + return 0; } long smb_ReceiveV3FindNotifyClose(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { smb_SetSMBDataLength(outp, 0); - return 0; + return 0; } long smb_ReceiveV3OpenX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { char *pathp; - long code; + long code = 0; cm_space_t *spacep; - int excl; - cm_user_t *userp; - cm_scache_t *dscp; /* dir we're dealing with */ - cm_scache_t *scp; /* file we're creating */ - cm_attr_t setAttr; - int initialModeBits; - smb_fid_t *fidp; - int attributes; - char *lastNamep; - long dosTime; - int openFun; - int trunc; - int openMode; - int extraInfo; - int openAction; - int parmSlot; /* which parm we're dealing with */ + int excl; + cm_user_t *userp; + cm_scache_t *dscp; /* dir we're dealing with */ + cm_scache_t *scp; /* file we're creating */ + cm_attr_t setAttr; + int initialModeBits; + smb_fid_t *fidp; + int attributes; + char *lastNamep; + long dosTime; + int openFun; + int trunc; + int openMode; + int extraInfo; + int openAction; + int parmSlot; /* which parm we're dealing with */ char *tidPathp; cm_req_t req; cm_InitReq(&req); - scp = NULL; + scp = NULL; extraInfo = (smb_GetSMBParm(inp, 2) & 1); /* return extra info */ openFun = smb_GetSMBParm(inp, 8); /* open function */ - excl = ((openFun & 3) == 0); - trunc = ((openFun & 3) == 2); /* truncate it */ + excl = ((openFun & 3) == 0); + trunc = ((openFun & 3) == 2); /* truncate it */ openMode = (smb_GetSMBParm(inp, 3) & 0x7); - openAction = 0; /* tracks what we did */ + openAction = 0; /* tracks what we did */ + + attributes = smb_GetSMBParm(inp, 5); + dosTime = smb_GetSMBParm(inp, 6) | (smb_GetSMBParm(inp, 7) << 16); - attributes = smb_GetSMBParm(inp, 5); - dosTime = smb_GetSMBParm(inp, 6) | (smb_GetSMBParm(inp, 7) << 16); - /* compute initial mode bits based on read-only flag in attributes */ - initialModeBits = 0666; - if (attributes & 1) initialModeBits &= ~0222; + initialModeBits = 0666; + if (attributes & 1) initialModeBits &= ~0222; - pathp = smb_GetSMBData(inp, NULL); + pathp = smb_GetSMBData(inp, NULL); spacep = inp->spacep; - smb_StripLastComponent(spacep->data, &lastNamep, pathp); + smb_StripLastComponent(spacep->data, &lastNamep, pathp); if (lastNamep && strcmp(lastNamep, SMB_IOCTL_FILENAME) == 0) { /* special case magic file name for receiving IOCTL requests - * (since IOCTL calls themselves aren't getting through). - */ - fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); - smb_SetupIoctlFid(fidp, spacep); + * (since IOCTL calls themselves aren't getting through). + */ +#ifdef NOTSERVICE + osi_Log0(smb_logp, "IOCTL Open"); +#endif + + fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); + smb_SetupIoctlFid(fidp, spacep); /* set inp->fid so that later read calls in same msg can find fid */ - inp->fid = fidp->fid; + inp->fid = fidp->fid; - /* copy out remainder of the parms */ + /* copy out remainder of the parms */ parmSlot = 2; smb_SetSMBParm(outp, parmSlot, fidp->fid); parmSlot++; if (extraInfo) { - smb_SetSMBParm(outp, parmSlot, /* attrs */ 0); parmSlot++; - smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* mod time */ - smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; - smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* len */ - smb_SetSMBParm(outp, parmSlot, 0x7fff); parmSlot++; - smb_SetSMBParm(outp, parmSlot, openMode); parmSlot++; - smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* file type 0 ==> normal file or dir */ - smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* IPC junk */ - } + smb_SetSMBParm(outp, parmSlot, /* attrs */ 0); parmSlot++; + smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* mod time */ + smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; + smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* len */ + smb_SetSMBParm(outp, parmSlot, 0x7fff); parmSlot++; + smb_SetSMBParm(outp, parmSlot, openMode); parmSlot++; + smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* file type 0 ==> normal file or dir */ + smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* IPC junk */ + } /* and the final "always present" stuff */ - smb_SetSMBParm(outp, parmSlot, /* openAction found existing file */ 1); parmSlot++; + smb_SetSMBParm(outp, parmSlot, /* openAction found existing file */ 1); parmSlot++; /* next write out the "unique" ID */ smb_SetSMBParm(outp, parmSlot, 0x1234); parmSlot++; smb_SetSMBParm(outp, parmSlot, 0x5678); parmSlot++; - smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; - smb_SetSMBDataLength(outp, 0); + smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; + smb_SetSMBDataLength(outp, 0); /* and clean up fid reference */ - smb_ReleaseFID(fidp); - return 0; - } + smb_ReleaseFID(fidp); + return 0; + } - userp = smb_GetUser(vcp, inp); +#ifdef DEBUG_VERBOSE + { + char *hexp, *asciip; + asciip = (lastNamep ? lastNamep : pathp ); + hexp = osi_HexifyString(asciip); + DEBUG_EVENT2("AFS", "V3Open H[%s] A[%s]", hexp, asciip ); + free(hexp); + } +#endif + userp = smb_GetUser(vcp, inp); dscp = NULL; tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); code = cm_NameI(cm_rootSCachep, pathp, - CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, - userp, tidPathp, &req, &scp); + CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, + userp, tidPathp, &req, &scp); if (code != 0) { code = cm_NameI(cm_rootSCachep, spacep->data, - CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, - userp, tidPathp, &req, &dscp); + CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, + userp, tidPathp, &req, &dscp); - if (code) { - cm_ReleaseUser(userp); - return code; - } + if (code) { + cm_ReleaseUser(userp); + return code; + } - /* otherwise, scp points to the parent directory. Do a lookup, - * and truncate the file if we find it, otherwise we create the - * file. - */ - if (!lastNamep) lastNamep = pathp; - else lastNamep++; - code = cm_Lookup(dscp, lastNamep, CM_FLAG_CASEFOLD, userp, - &req, &scp); - if (code && code != CM_ERROR_NOSUCHFILE) { + /* otherwise, scp points to the parent directory. Do a lookup, + * and truncate the file if we find it, otherwise we create the + * file. + */ + if (!lastNamep) lastNamep = pathp; + else lastNamep++; + code = cm_Lookup(dscp, lastNamep, CM_FLAG_CASEFOLD, userp, + &req, &scp); + if (code && code != CM_ERROR_NOSUCHFILE) { cm_ReleaseSCache(dscp); - cm_ReleaseUser(userp); - return code; - } + cm_ReleaseUser(userp); + return code; + } } - /* if we get here, if code is 0, the file exists and is represented by - * scp. Otherwise, we have to create it. The dir may be represented - * by dscp, or we may have found the file directly. If code is non-zero, - * scp is NULL. - */ + /* if we get here, if code is 0, the file exists and is represented by + * scp. Otherwise, we have to create it. The dir may be represented + * by dscp, or we may have found the file directly. If code is non-zero, + * scp is NULL. + */ if (code == 0) { - code = cm_CheckOpen(scp, openMode, trunc, userp, &req); - if (code) { - if (dscp) cm_ReleaseSCache(dscp); - cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); - return code; - } + code = cm_CheckOpen(scp, openMode, trunc, userp, &req); + if (code) { + if (dscp) cm_ReleaseSCache(dscp); + cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); + return code; + } if (excl) { /* oops, file shouldn't be there */ - if (dscp) cm_ReleaseSCache(dscp); - cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); - return CM_ERROR_EXISTS; - } + if (dscp) cm_ReleaseSCache(dscp); + cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); + return CM_ERROR_EXISTS; + } if (trunc) { setAttr.mask = CM_ATTRMASK_LENGTH; - setAttr.length.LowPart = 0; - setAttr.length.HighPart = 0; + setAttr.length.LowPart = 0; + setAttr.length.HighPart = 0; code = cm_SetAttr(scp, &setAttr, userp, &req); - openAction = 3; /* truncated existing file */ + openAction = 3; /* truncated existing file */ } - else openAction = 1; /* found existing file */ - } + else openAction = 1; /* found existing file */ + } else if (!(openFun & 0x10)) { /* don't create if not found */ - if (dscp) cm_ReleaseSCache(dscp); - cm_ReleaseUser(userp); - return CM_ERROR_NOSUCHFILE; - } - else { + if (dscp) cm_ReleaseSCache(dscp); + cm_ReleaseUser(userp); + return CM_ERROR_NOSUCHFILE; + } + else { osi_assert(dscp != NULL); - osi_Log1(afsd_logp, "smb_ReceiveV3OpenX creating file %s", - osi_LogSaveString(afsd_logp, lastNamep)); + osi_Log1(smb_logp, "smb_ReceiveV3OpenX creating file %s", + osi_LogSaveString(smb_logp, lastNamep)); openAction = 2; /* created file */ setAttr.mask = CM_ATTRMASK_CLIENTMODTIME; smb_UnixTimeFromDosUTime(&setAttr.clientModTime, dosTime); - code = cm_Create(dscp, lastNamep, 0, &setAttr, &scp, userp, - &req); + code = cm_Create(dscp, lastNamep, 0, &setAttr, &scp, userp, + &req); if (code == 0 && (dscp->flags & CM_SCACHEFLAG_ANYWATCH)) smb_NotifyChange(FILE_ACTION_ADDED, - FILE_NOTIFY_CHANGE_FILE_NAME, - dscp, lastNamep, NULL, TRUE); - if (!excl && code == CM_ERROR_EXISTS) { + FILE_NOTIFY_CHANGE_FILE_NAME, + dscp, lastNamep, NULL, TRUE); + if (!excl && code == CM_ERROR_EXISTS) { /* not an exclusive create, and someone else tried * creating it already, then we open it anyway. We * don't bother retrying after this, since if this next * fails, that means that the file was deleted after we * started this call. - */ - code = cm_Lookup(dscp, lastNamep, CM_FLAG_CASEFOLD, - userp, &req, &scp); - if (code == 0) { - if (trunc) { + */ + code = cm_Lookup(dscp, lastNamep, CM_FLAG_CASEFOLD, + userp, &req, &scp); + if (code == 0) { + if (trunc) { setAttr.mask = CM_ATTRMASK_LENGTH; - setAttr.length.LowPart = 0; - setAttr.length.HighPart = 0; - code = cm_SetAttr(scp, &setAttr, userp, - &req); - } + setAttr.length.LowPart = 0; + setAttr.length.HighPart = 0; + code = cm_SetAttr(scp, &setAttr, userp, &req); + } } /* lookup succeeded */ - } } + } /* we don't need this any longer */ if (dscp) cm_ReleaseSCache(dscp); - if (code) { + if (code) { /* something went wrong creating or truncating the file */ - if (scp) cm_ReleaseSCache(scp); - cm_ReleaseUser(userp); - return code; - } + if (scp) cm_ReleaseSCache(scp); + cm_ReleaseUser(userp); + return code; + } /* make sure we're about to open a file */ if (scp->fileType != CM_SCACHETYPE_FILE) { @@ -2611,55 +2802,55 @@ long smb_ReceiveV3OpenX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) return CM_ERROR_ISDIR; } - /* now all we have to do is open the file itself */ - fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); - osi_assert(fidp); + /* now all we have to do is open the file itself */ + fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE); + osi_assert(fidp); /* save a pointer to the vnode */ - fidp->scp = scp; + fidp->scp = scp; /* compute open mode */ - if (openMode != 1) fidp->flags |= SMB_FID_OPENREAD; - if (openMode == 1 || openMode == 2) - fidp->flags |= SMB_FID_OPENWRITE; + if (openMode != 1) fidp->flags |= SMB_FID_OPENREAD; + if (openMode == 1 || openMode == 2) + fidp->flags |= SMB_FID_OPENWRITE; smb_ReleaseFID(fidp); cm_Open(scp, 0, userp); /* set inp->fid so that later read calls in same msg can find fid */ - inp->fid = fidp->fid; + inp->fid = fidp->fid; - /* copy out remainder of the parms */ + /* copy out remainder of the parms */ parmSlot = 2; smb_SetSMBParm(outp, parmSlot, fidp->fid); parmSlot++; lock_ObtainMutex(&scp->mx); if (extraInfo) { - smb_SetSMBParm(outp, parmSlot, smb_Attributes(scp)); parmSlot++; + smb_SetSMBParm(outp, parmSlot, smb_Attributes(scp)); parmSlot++; smb_DosUTimeFromUnixTime(&dosTime, scp->clientModTime); - smb_SetSMBParm(outp, parmSlot, dosTime & 0xffff); parmSlot++; - smb_SetSMBParm(outp, parmSlot, (dosTime>>16) & 0xffff); parmSlot++; - smb_SetSMBParm(outp, parmSlot, scp->length.LowPart & 0xffff); parmSlot++; - smb_SetSMBParm(outp, parmSlot, (scp->length.LowPart >> 16) & 0xffff); parmSlot++; - smb_SetSMBParm(outp, parmSlot, openMode); parmSlot++; - smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* file type 0 ==> normal file or dir */ - smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* IPC junk */ + smb_SetSMBParm(outp, parmSlot, dosTime & 0xffff); parmSlot++; + smb_SetSMBParm(outp, parmSlot, (dosTime>>16) & 0xffff); parmSlot++; + smb_SetSMBParm(outp, parmSlot, scp->length.LowPart & 0xffff); parmSlot++; + smb_SetSMBParm(outp, parmSlot, (scp->length.LowPart >> 16) & 0xffff); parmSlot++; + smb_SetSMBParm(outp, parmSlot, openMode); parmSlot++; + smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* file type 0 ==> normal file or dir */ + smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; /* IPC junk */ } /* and the final "always present" stuff */ - smb_SetSMBParm(outp, parmSlot, openAction); parmSlot++; + smb_SetSMBParm(outp, parmSlot, openAction); parmSlot++; /* next write out the "unique" ID */ smb_SetSMBParm(outp, parmSlot, scp->fid.vnode & 0xffff); parmSlot++; smb_SetSMBParm(outp, parmSlot, scp->fid.volume & 0xffff); parmSlot++; - smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; + smb_SetSMBParm(outp, parmSlot, 0); parmSlot++; lock_ReleaseMutex(&scp->mx); - smb_SetSMBDataLength(outp, 0); + smb_SetSMBDataLength(outp, 0); - osi_Log1(afsd_logp, "SMB OpenX opening fid %d", fidp->fid); + osi_Log1(smb_logp, "SMB OpenX opening fid %d", fidp->fid); - cm_ReleaseUser(userp); - /* leave scp held since we put it in fidp->scp */ - return 0; -} + cm_ReleaseUser(userp); + /* leave scp held since we put it in fidp->scp */ + return 0; +} long smb_ReceiveV3LockingX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { @@ -2675,7 +2866,7 @@ long smb_ReceiveV3LockingX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) LARGE_INTEGER LOffset, LLength; smb_waitingLock_t *waitingLock; void *lockp; - long code; + long code = 0; int i; cm_InitReq(&req); @@ -2688,7 +2879,7 @@ long smb_ReceiveV3LockingX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) return CM_ERROR_BADFD; } /* set inp->fid so that later read calls in same msg can find fid */ - inp->fid = fid; + inp->fid = fid; userp = smb_GetUser(vcp, inp); @@ -2794,59 +2985,59 @@ doneSync: long smb_ReceiveV3GetAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { unsigned short fid; - smb_fid_t *fidp; - cm_scache_t *scp; - long code; - long searchTime; - cm_user_t *userp; + smb_fid_t *fidp; + cm_scache_t *scp; + long code = 0; + long searchTime; + cm_user_t *userp; cm_req_t req; cm_InitReq(&req); - fid = smb_GetSMBParm(inp, 0); - fid = smb_ChainFID(fid, inp); + fid = smb_GetSMBParm(inp, 0); + fid = smb_ChainFID(fid, inp); - fidp = smb_FindFID(vcp, fid, 0); - if (!fidp || (fidp->flags & SMB_FID_IOCTL)) { + fidp = smb_FindFID(vcp, fid, 0); + if (!fidp || (fidp->flags & SMB_FID_IOCTL)) { return CM_ERROR_BADFD; - } + } - userp = smb_GetUser(vcp, inp); + userp = smb_GetUser(vcp, inp); - scp = fidp->scp; + scp = fidp->scp; - /* otherwise, stat the file */ + /* otherwise, stat the file */ lock_ObtainMutex(&scp->mx); - code = cm_SyncOp(scp, NULL, userp, &req, 0, - CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); + code = cm_SyncOp(scp, NULL, userp, &req, 0, + CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); if (code) goto done; /* decode times. We need a search time, but the response to this - * call provides the date first, not the time, as returned in the - * searchTime variable. So we take the high-order bits first. - */ + * call provides the date first, not the time, as returned in the + * searchTime variable. So we take the high-order bits first. + */ smb_SearchTimeFromUnixTime(&searchTime, scp->clientModTime); - smb_SetSMBParm(outp, 0, (searchTime >> 16) & 0xffff); /* ctime */ - smb_SetSMBParm(outp, 1, searchTime & 0xffff); - smb_SetSMBParm(outp, 2, (searchTime >> 16) & 0xffff); /* atime */ - smb_SetSMBParm(outp, 3, searchTime & 0xffff); - smb_SetSMBParm(outp, 4, (searchTime >> 16) & 0xffff); /* mtime */ - smb_SetSMBParm(outp, 5, searchTime & 0xffff); - - /* now handle file size and allocation size */ - smb_SetSMBParm(outp, 6, scp->length.LowPart & 0xffff); /* file size */ - smb_SetSMBParm(outp, 7, (scp->length.LowPart >> 16) & 0xffff); - smb_SetSMBParm(outp, 8, scp->length.LowPart & 0xffff); /* alloc size */ - smb_SetSMBParm(outp, 9, (scp->length.LowPart >> 16) & 0xffff); - + smb_SetSMBParm(outp, 0, (searchTime >> 16) & 0xffff); /* ctime */ + smb_SetSMBParm(outp, 1, searchTime & 0xffff); + smb_SetSMBParm(outp, 2, (searchTime >> 16) & 0xffff); /* atime */ + smb_SetSMBParm(outp, 3, searchTime & 0xffff); + smb_SetSMBParm(outp, 4, (searchTime >> 16) & 0xffff); /* mtime */ + smb_SetSMBParm(outp, 5, searchTime & 0xffff); + + /* now handle file size and allocation size */ + smb_SetSMBParm(outp, 6, scp->length.LowPart & 0xffff); /* file size */ + smb_SetSMBParm(outp, 7, (scp->length.LowPart >> 16) & 0xffff); + smb_SetSMBParm(outp, 8, scp->length.LowPart & 0xffff); /* alloc size */ + smb_SetSMBParm(outp, 9, (scp->length.LowPart >> 16) & 0xffff); + /* file attribute */ - smb_SetSMBParm(outp, 10, smb_Attributes(scp)); + smb_SetSMBParm(outp, 10, smb_Attributes(scp)); - /* and finalize stuff */ - smb_SetSMBDataLength(outp, 0); - code = 0; + /* and finalize stuff */ + smb_SetSMBDataLength(outp, 0); + code = 0; -done: + done: lock_ReleaseMutex(&scp->mx); cm_ReleaseUser(userp); smb_ReleaseFID(fidp); @@ -2856,42 +3047,49 @@ done: long smb_ReceiveV3SetAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { unsigned short fid; - smb_fid_t *fidp; - cm_scache_t *scp; - long code; + smb_fid_t *fidp; + cm_scache_t *scp; + long code = 0; long searchTime; - long unixTime; - cm_user_t *userp; - cm_attr_t attrs; + long unixTime; + cm_user_t *userp; + cm_attr_t attrs; cm_req_t req; cm_InitReq(&req); - fid = smb_GetSMBParm(inp, 0); - fid = smb_ChainFID(fid, inp); + fid = smb_GetSMBParm(inp, 0); + fid = smb_ChainFID(fid, inp); - fidp = smb_FindFID(vcp, fid, 0); - if (!fidp || (fidp->flags & SMB_FID_IOCTL)) { + fidp = smb_FindFID(vcp, fid, 0); + if (!fidp || (fidp->flags & SMB_FID_IOCTL)) { return CM_ERROR_BADFD; - } + } - userp = smb_GetUser(vcp, inp); + userp = smb_GetUser(vcp, inp); - scp = fidp->scp; + scp = fidp->scp; /* now prepare to call cm_setattr. This message only sets various times, - * and AFS only implements mtime, and we'll set the mtime if that's - * requested. The others we'll ignore. - */ + * and AFS only implements mtime, and we'll set the mtime if that's + * requested. The others we'll ignore. + */ searchTime = smb_GetSMBParm(inp, 5) | (smb_GetSMBParm(inp, 6) << 16); - if (searchTime != 0) { + if (searchTime != 0) { smb_UnixTimeFromSearchTime(&unixTime, searchTime); - attrs.mask = CM_ATTRMASK_CLIENTMODTIME; - attrs.clientModTime = unixTime; - code = cm_SetAttr(scp, &attrs, userp, &req); + + if ( unixTime != -1 ) { + attrs.mask = CM_ATTRMASK_CLIENTMODTIME; + attrs.clientModTime = unixTime; + code = cm_SetAttr(scp, &attrs, userp, &req); + + osi_Log1(smb_logp, "SMB receive V3SetAttributes [fid=%ld]", fid); + } else { + osi_Log1(smb_logp, "**smb_UnixTimeFromSearchTime failed searchTime=%ld", searchTime); } - else code = 0; + } + else code = 0; cm_ReleaseUser(userp); smb_ReleaseFID(fidp); @@ -2902,59 +3100,59 @@ long smb_ReceiveV3SetAttributes(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t * long smb_ReceiveV3ReadX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { osi_hyper_t offset; - long count, finalCount; - unsigned short fd; - smb_fid_t *fidp; - long code; - cm_user_t *userp; - char *op; - - fd = smb_GetSMBParm(inp, 2); - count = smb_GetSMBParm(inp, 5); - offset.HighPart = 0; /* too bad */ - offset.LowPart = smb_GetSMBParm(inp, 3) | (smb_GetSMBParm(inp, 4) << 16); + long count, finalCount; + unsigned short fd; + smb_fid_t *fidp; + long code = 0; + cm_user_t *userp; + char *op; - osi_Log3(afsd_logp, "smb_ReceiveV3Read fd %d, off 0x%x, size 0x%x", - fd, offset.LowPart, count); + fd = smb_GetSMBParm(inp, 2); + count = smb_GetSMBParm(inp, 5); + offset.HighPart = 0; /* too bad */ + offset.LowPart = smb_GetSMBParm(inp, 3) | (smb_GetSMBParm(inp, 4) << 16); + + osi_Log3(smb_logp, "smb_ReceiveV3Read fd %d, off 0x%x, size 0x%x", + fd, offset.LowPart, count); fd = smb_ChainFID(fd, inp); - fidp = smb_FindFID(vcp, fd, 0); - if (!fidp) { + fidp = smb_FindFID(vcp, fd, 0); + if (!fidp) { return CM_ERROR_BADFD; - } + } /* set inp->fid so that later read calls in same msg can find fid */ - inp->fid = fd; + inp->fid = fd; - if (fidp->flags & SMB_FID_IOCTL) { + if (fidp->flags & SMB_FID_IOCTL) { return smb_IoctlV3Read(fidp, vcp, inp, outp); - } + } userp = smb_GetUser(vcp, inp); /* 0 and 1 are reserved for request chaining, were setup by our caller, - * and will be further filled in after we return. - */ - smb_SetSMBParm(outp, 2, 0); /* remaining bytes, for pipes */ - smb_SetSMBParm(outp, 3, 0); /* resvd */ - smb_SetSMBParm(outp, 4, 0); /* resvd */ + * and will be further filled in after we return. + */ + smb_SetSMBParm(outp, 2, 0); /* remaining bytes, for pipes */ + smb_SetSMBParm(outp, 3, 0); /* resvd */ + smb_SetSMBParm(outp, 4, 0); /* resvd */ smb_SetSMBParm(outp, 5, count); /* # of bytes we're going to read */ - /* fill in #6 when we have all the parameters' space reserved */ - smb_SetSMBParm(outp, 7, 0); /* resv'd */ - smb_SetSMBParm(outp, 8, 0); /* resv'd */ - smb_SetSMBParm(outp, 9, 0); /* resv'd */ - smb_SetSMBParm(outp, 10, 0); /* resv'd */ + /* fill in #6 when we have all the parameters' space reserved */ + smb_SetSMBParm(outp, 7, 0); /* resv'd */ + smb_SetSMBParm(outp, 8, 0); /* resv'd */ + smb_SetSMBParm(outp, 9, 0); /* resv'd */ + smb_SetSMBParm(outp, 10, 0); /* resv'd */ smb_SetSMBParm(outp, 11, 0); /* reserved */ /* get op ptr after putting in the parms, since otherwise we don't - * know where the data really is. - */ - op = smb_GetSMBData(outp, NULL); + * know where the data really is. + */ + op = smb_GetSMBData(outp, NULL); - /* now fill in offset from start of SMB header to first data byte (to op) */ - smb_SetSMBParm(outp, 6, ((int) (op - outp->data))); + /* now fill in offset from start of SMB header to first data byte (to op) */ + smb_SetSMBParm(outp, 6, ((int) (op - outp->data))); /* set the packet data length the count of the # of bytes */ - smb_SetSMBDataLength(outp, count); + smb_SetSMBDataLength(outp, count); #ifndef DJGPP code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount); @@ -2966,11 +3164,11 @@ long smb_ReceiveV3ReadX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) smb_SetSMBParm(outp, 5, finalCount); smb_SetSMBDataLength(outp, finalCount); - smb_ReleaseFID(fidp); + smb_ReleaseFID(fidp); - cm_ReleaseUser(userp); - return code; -} + cm_ReleaseUser(userp); + return code; +} /* * Values for createDisp, copied from NTDDK.H @@ -2986,18 +3184,20 @@ long smb_ReceiveV3ReadX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { char *pathp, *realPathp; - long code; + long code = 0; cm_space_t *spacep; cm_user_t *userp; cm_scache_t *dscp; /* parent dir */ cm_scache_t *scp; /* file to create or open */ cm_attr_t setAttr; char *lastNamep; + char *treeStartp; unsigned short nameLength; unsigned int flags; unsigned int requestOpLock; unsigned int requestBatchOpLock; unsigned int mustBeDir; + unsigned int treeCreate; int realDirFlag; unsigned int desiredAccess; unsigned int extAttributes; @@ -3019,6 +3219,7 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) cm_InitReq(&req); + treeCreate = FALSE; foundscp = FALSE; scp = NULL; @@ -3046,7 +3247,7 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) | (smb_GetSMBOffsetParm(inp, 20, 1) << 16); /* mustBeDir is never set; createOptions directory bit seems to be - * more important + * more important */ if (createOptions & 1) realDirFlag = 1; @@ -3071,6 +3272,9 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) spacep = inp->spacep; smb_StripLastComponent(spacep->data, &lastNamep, realPathp); + osi_Log1(smb_logp,"NTCreateX for [%s]",osi_LogSaveString(smb_logp,realPathp)); + osi_Log4(smb_logp,"NTCreateX da=[%x] ea=[%x] cd=[%x] co=[%x]", desiredAccess, extAttributes, createDisp, createOptions); + if (lastNamep && strcmp(lastNamep, SMB_IOCTL_FILENAME) == 0) { /* special case magic file name for receiving IOCTL requests * (since IOCTL calls themselves aren't getting through). @@ -3107,19 +3311,41 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) return 0; } - userp = smb_GetUser(vcp, inp); +#ifdef DEBUG_VERBOSE + { + char *hexp, *asciip; + asciip = (lastNamep? lastNamep : realPathp); + hexp = osi_HexifyString( asciip ); + DEBUG_EVENT2("AFS", "NTCreateX H[%s] A[%s]", hexp, asciip); + free(hexp); + } +#endif + userp = smb_GetUser(vcp, inp); + if (!userp) { + osi_Log1(smb_logp, "NTCreateX Invalid user [%d]", ((smb_t *) inp)->uid); + free(realPathp); + return CM_ERROR_INVAL; + } if (baseFid == 0) { baseDirp = cm_rootSCachep; tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); } else { - baseFidp = smb_FindFID(vcp, baseFid, 0); + baseFidp = smb_FindFID(vcp, baseFid, 0); + if (!baseFidp) { + osi_Log1(smb_logp, "NTCreateX Invalid base fid [%d]", baseFid); + free(realPathp); + cm_ReleaseUser(userp); + return CM_ERROR_INVAL; + } baseDirp = baseFidp->scp; tidPathp = NULL; } - /* compute open mode */ + osi_Log1(smb_logp, "NTCreateX tidPathp=[%s]", (tidPathp==NULL)?"null": osi_LogSaveString(smb_logp,tidPathp)); + + /* compute open mode */ fidflags = 0; if (desiredAccess & DELETE) fidflags |= SMB_FID_OPENDELETE; @@ -3130,34 +3356,108 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) dscp = NULL; code = 0; - code = cm_NameI(baseDirp, realPathp, CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, - userp, tidPathp, &req, &scp); - if (code == 0) foundscp = TRUE; - if (code != 0 - || (fidflags & (SMB_FID_OPENDELETE | SMB_FID_OPENWRITE))) { + /* For an exclusive create, we want to do a case sensitive match for the last component. */ + if (createDisp == 2 || createDisp == 4 || createDisp == 5) { + code = cm_NameI(baseDirp, spacep->data, CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, + userp, tidPathp, &req, &dscp); + if (code == 0) { + code = cm_Lookup(dscp, (lastNamep)?(lastNamep+1):realPathp, CM_FLAG_FOLLOW, + userp, &req, &scp); + if (code == CM_ERROR_NOSUCHFILE) { + code = cm_Lookup(dscp, (lastNamep)?(lastNamep+1):realPathp, + CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, userp, &req, &scp); + if (code == 0 && realDirFlag == 1) { + cm_ReleaseSCache(scp); + cm_ReleaseSCache(dscp); + cm_ReleaseUser(userp); + free(realPathp); + return CM_ERROR_EXISTS; + } + } + } else + dscp = NULL; + } else { + code = cm_NameI(baseDirp, realPathp, CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, + userp, tidPathp, &req, &scp); + } + if (code == 0) + foundscp = TRUE; + + if (!foundscp || (fidflags & (SMB_FID_OPENDELETE | SMB_FID_OPENWRITE))) { /* look up parent directory */ - code = cm_NameI(baseDirp, spacep->data, - CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD | CM_FLAG_CHECKPATH, - userp, tidPathp, &req, &dscp); + /* If we are trying to create a path (i.e. multiple nested directories), then we don't *need* + * the immediate parent. We have to work our way up realPathp until we hit something that we + * recognize. + */ - if (baseFid != 0) smb_ReleaseFID(baseFidp); + if ( !dscp ) { + while (1) { + char *tp; + + code = cm_NameI(baseDirp, spacep->data, + CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, + userp, tidPathp, &req, &dscp); + + if (code && + (tp = strrchr(spacep->data,'\\')) && + (createDisp == 2) && + (realDirFlag == 1)) { + *tp++ = 0; + treeCreate = TRUE; + treeStartp = realPathp + (tp - spacep->data); + + if (*tp && !smb_IsLegalFilename(tp)) { + if(baseFid != 0) + smb_ReleaseFID(baseFidp); + cm_ReleaseUser(userp); + free(realPathp); + return CM_ERROR_BADNTFILENAME; + } + } + else + break; + } + } else + code = 0; - if (code) { - cm_ReleaseUser(userp); - free(realPathp); - return code; - } + if (baseFid != 0) + smb_ReleaseFID(baseFidp); - if (!lastNamep) lastNamep = realPathp; - else lastNamep++; + if (code) { + osi_Log0(smb_logp,"NTCreateX parent not found"); + cm_ReleaseUser(userp); + free(realPathp); + return code; + } - if (!smb_IsLegalFilename(lastNamep)) - return CM_ERROR_BADNTFILENAME; + if (treeCreate && dscp->fileType == CM_SCACHETYPE_FILE) { + /* A file exists where we want a directory. */ + cm_ReleaseSCache(dscp); + cm_ReleaseUser(userp); + free(realPathp); + return CM_ERROR_EXISTS; + } - if (!foundscp) { - code = cm_Lookup(dscp, lastNamep, - CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, - userp, &req, &scp); + if (!lastNamep) + lastNamep = realPathp; + else + lastNamep++; + + if (!smb_IsLegalFilename(lastNamep)) { + cm_ReleaseSCache(dscp); + cm_ReleaseUser(userp); + free(realPathp); + return CM_ERROR_BADNTFILENAME; + } + + if (!foundscp && !treeCreate) { + if(createDisp == 2 || createDisp == 4) + code = cm_Lookup(dscp, lastNamep, + CM_FLAG_FOLLOW, userp, &req, &scp); + else + code = cm_Lookup(dscp, lastNamep, + CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, + userp, &req, &scp); if (code && code != CM_ERROR_NOSUCHFILE) { cm_ReleaseSCache(dscp); cm_ReleaseUser(userp); @@ -3167,7 +3467,8 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) } } else { - if (baseFid != 0) smb_ReleaseFID(baseFidp); + if (baseFid != 0) + smb_ReleaseFID(baseFidp); } /* if we get here, if code is 0, the file exists and is represented by @@ -3175,7 +3476,7 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) * by dscp, or we may have found the file directly. If code is non-zero, * scp is NULL. */ - if (code == 0) { + if (code == 0 && !treeCreate) { code = cm_CheckNTOpen(scp, desiredAccess, createDisp, userp, &req); if (code) { @@ -3214,8 +3515,8 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) } else if (realDirFlag == 0 || realDirFlag == -1) { osi_assert(dscp != NULL); - osi_Log1(afsd_logp, "smb_ReceiveNTCreateX creating file %s", - osi_LogSaveString(afsd_logp, lastNamep)); + osi_Log1(smb_logp, "smb_ReceiveNTCreateX creating file %s", + osi_LogSaveString(smb_logp, lastNamep)); openAction = 2; /* created file */ setAttr.mask = CM_ATTRMASK_CLIENTMODTIME; setAttr.clientModTime = time(NULL); @@ -3246,48 +3547,96 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) } } else { - /* create directory */ - osi_assert(dscp != NULL); - osi_Log1(afsd_logp, "smb_ReceiveNTCreateX creating directory %s", - osi_LogSaveString(afsd_logp, lastNamep)); + char *tp, *pp; + char *cp; /* This component */ + int clen = 0; /* length of component */ + cm_scache_t *tscp; + int isLast = 0; + + /* create directory */ + if ( !treeCreate ) treeStartp = lastNamep; + osi_assert(dscp != NULL); + osi_Log1(smb_logp, "smb_ReceiveNTCreateX creating directory [%s]", + osi_LogSaveString(smb_logp, treeStartp)); openAction = 2; /* created directory */ + setAttr.mask = CM_ATTRMASK_CLIENTMODTIME; setAttr.clientModTime = time(NULL); - code = cm_MakeDir(dscp, lastNamep, 0, &setAttr, userp, &req); - if (code == 0 && (dscp->flags & CM_SCACHEFLAG_ANYWATCH)) - smb_NotifyChange(FILE_ACTION_ADDED, - FILE_NOTIFY_CHANGE_DIR_NAME, - dscp, lastNamep, NULL, TRUE); - if (code == 0 - || (code == CM_ERROR_EXISTS && createDisp != 2)) { - /* Not an exclusive create, and someone else tried - * creating it already, then we open it anyway. We - * don't bother retrying after this, since if this next - * fails, that means that the file was deleted after we - * started this call. - */ - code = cm_Lookup(dscp, lastNamep, CM_FLAG_CASEFOLD, - userp, &req, &scp); + + pp = treeStartp; + cp = spacep->data; + tscp = dscp; + + while(pp && *pp) { + tp = strchr(pp, '\\'); + if(!tp) { + strcpy(cp,pp); + clen = strlen(cp); + isLast = 1; /* indicate last component. the supplied path never ends in a slash */ + } + else { + clen = tp - pp; + strncpy(cp,pp,clen); + *(cp + clen) = 0; + tp++; + } + pp = tp; + + if(clen == 0) continue; /* the supplied path can't have consecutive slashes either , but */ + + /* cp is the next component to be created. */ + code = cm_MakeDir(tscp, cp, 0, &setAttr, userp, &req); + if (code == 0 && (tscp->flags & CM_SCACHEFLAG_ANYWATCH)) + smb_NotifyChange(FILE_ACTION_ADDED, + FILE_NOTIFY_CHANGE_DIR_NAME, + tscp, cp, NULL, TRUE); + if (code == 0 || + (code == CM_ERROR_EXISTS && createDisp != 2)) { + /* Not an exclusive create, and someone else tried + * creating it already, then we open it anyway. We + * don't bother retrying after this, since if this next + * fails, that means that the file was deleted after we + * started this call. + */ + code = cm_Lookup(tscp, cp, CM_FLAG_CASEFOLD, + userp, &req, &scp); + } + if(code) break; + + if(!isLast) { /* for anything other than dscp, release it unless it's the last one */ + cm_ReleaseSCache(tscp); + tscp = scp; /* Newly created directory will be next parent */ + } } + + /* + if we get here and code == 0, then scp is the last directory created, and tscp is the + parent of scp. dscp got released if dscp != tscp. both tscp and scp are held. + */ + dscp = tscp; } if (code) { /* something went wrong creating or truncating the file */ if (scp) cm_ReleaseSCache(scp); + if (dscp) cm_ReleaseSCache(dscp); cm_ReleaseUser(userp); free(realPathp); return code; } - /* make sure we have file vs. dir right */ + /* make sure we have file vs. dir right (only applies for single component case) */ if (realDirFlag == 0 && scp->fileType != CM_SCACHETYPE_FILE) { cm_ReleaseSCache(scp); + if (dscp) cm_ReleaseSCache(dscp); cm_ReleaseUser(userp); free(realPathp); return CM_ERROR_ISDIR; } + /* (only applies to single component case) */ if (realDirFlag == 1 && scp->fileType == CM_SCACHETYPE_FILE) { cm_ReleaseSCache(scp); + if (dscp) cm_ReleaseSCache(dscp); cm_ReleaseUser(userp); free(realPathp); return CM_ERROR_NOTDIR; @@ -3339,13 +3688,15 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) lock_ReleaseMutex(&scp->mx); smb_SetSMBDataLength(outp, 0); - osi_Log2(afsd_logp, "SMB NT CreateX opening fid %d path %s", fidp->fid, - osi_LogSaveString(afsd_logp, realPathp)); + osi_Log2(smb_logp, "SMB NT CreateX opening fid %d path %s", fidp->fid, + osi_LogSaveString(smb_logp, realPathp)); smb_ReleaseFID(fidp); cm_ReleaseUser(userp); + /* Can't free realPathp if we get here since fidp->NTopen_wholepathp is pointing there */ + /* leave scp held since we put it in fidp->scp */ return 0; } @@ -3357,7 +3708,7 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) { char *pathp, *realPathp; - long code; + long code = 0; cm_space_t *spacep; cm_user_t *userp; cm_scache_t *dscp; /* parent dir */ @@ -3369,10 +3720,18 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out unsigned int requestOpLock; unsigned int requestBatchOpLock; unsigned int mustBeDir; + unsigned int extendedRespRequired; int realDirFlag; unsigned int desiredAccess; +#ifdef DEBUG_VERBOSE + unsigned int allocSize; + unsigned int shareAccess; +#endif unsigned int extAttributes; unsigned int createDisp; +#ifdef DEBUG_VERBOSE + unsigned int sdLen; +#endif unsigned int createOptions; int initialModeBits; unsigned short baseFid; @@ -3405,6 +3764,8 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out requestOpLock = flags & 0x02; requestBatchOpLock = flags & 0x04; mustBeDir = flags & 0x08; + extendedRespRequired = flags & 0x10; + /* * Why all of a sudden 32-bit FID? * We will reject all bits higher than 16. @@ -3413,11 +3774,26 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out return CM_ERROR_INVAL; baseFid = (unsigned short)lparmp[1]; desiredAccess = lparmp[2]; +#ifdef DEBUG_VERBOSE + allocSize = lparmp[3]; +#endif /* DEBUG_VERSOSE */ extAttributes = lparmp[5]; +#ifdef DEBUG_VEROSE + shareAccess = lparmp[6]; +#endif createDisp = lparmp[7]; createOptions = lparmp[8]; +#ifdef DEBUG_VERBOSE + sdLen = lparmp[9]; +#endif nameLength = lparmp[11]; +#ifdef DEBUG_VERBOSE + osi_Log4(smb_logp,"NTTransCreate with da[%x],ea[%x],sa[%x],cd[%x]",desiredAccess,extAttributes,shareAccess,createDisp); + osi_Log2(smb_logp,"... co[%x],sdl[%x],as[%x]",createOptions,sdLen,allocSize); + osi_Log1(smb_logp,"... flags[%x]",flags); +#endif + /* mustBeDir is never set; createOptions directory bit seems to be * more important */ @@ -3449,41 +3825,91 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out * Will add it if necessary. */ +#ifdef DEBUG_VERBOSE + { + char *hexp, *asciip; + asciip = (lastNamep? lastNamep : realPathp); + hexp = osi_HexifyString( asciip ); + DEBUG_EVENT2("AFS", "NTTranCreate H[%s] A[%s]", hexp, asciip); + free(hexp); + } +#endif + userp = smb_GetUser(vcp, inp); + if(!userp) { + osi_Log1(smb_logp, "NTTranCreate invalid user [%d]", ((smb_t *) inp)->uid); + free(realPathp); + return CM_ERROR_INVAL; + } if (baseFid == 0) { baseDirp = cm_rootSCachep; tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); } else { - baseFidp = smb_FindFID(vcp, baseFid, 0); + baseFidp = smb_FindFID(vcp, baseFid, 0); + if(!baseFidp) { + osi_Log1(smb_logp, "NTTranCreate Invalid fid [%d]", baseFid); + free(realPathp); + cm_ReleaseUser(userp); + return CM_ERROR_INVAL; + } baseDirp = baseFidp->scp; tidPathp = NULL; } - /* compute open mode */ - fidflags = 0; - if (desiredAccess & DELETE) - fidflags |= SMB_FID_OPENDELETE; - if (desiredAccess & AFS_ACCESS_READ) - fidflags |= SMB_FID_OPENREAD; - if (desiredAccess & AFS_ACCESS_WRITE) - fidflags |= SMB_FID_OPENWRITE; + /* compute open mode */ + fidflags = 0; + if (desiredAccess & DELETE) + fidflags |= SMB_FID_OPENDELETE; + if (desiredAccess & AFS_ACCESS_READ) + fidflags |= SMB_FID_OPENREAD; + if (desiredAccess & AFS_ACCESS_WRITE) + fidflags |= SMB_FID_OPENWRITE; dscp = NULL; code = 0; - code = cm_NameI(baseDirp, realPathp, CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, - userp, tidPathp, &req, &scp); + if (createDisp == 2 || createDisp == 4 || createDisp == 5) { + code = cm_NameI(baseDirp, spacep->data, CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, + userp, tidPathp, &req, &dscp); + if (code == 0) { + code = cm_Lookup(dscp, (lastNamep)?(lastNamep+1):realPathp, CM_FLAG_FOLLOW, + userp, &req, &scp); + if (code == CM_ERROR_NOSUCHFILE) { + code = cm_Lookup(dscp, (lastNamep)?(lastNamep+1):realPathp, + CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, userp, &req, &scp); + if (code == 0 && realDirFlag == 1) { + cm_ReleaseSCache(scp); + cm_ReleaseSCache(dscp); + cm_ReleaseUser(userp); + free(realPathp); + return CM_ERROR_EXISTS; + } + } + } else + dscp = NULL; + } else { + code = cm_NameI(baseDirp, realPathp, CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, + userp, tidPathp, &req, &scp); + } + if (code == 0) foundscp = TRUE; if (code != 0 || (fidflags & (SMB_FID_OPENDELETE | SMB_FID_OPENWRITE))) { /* look up parent directory */ - code = cm_NameI(baseDirp, spacep->data, - CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, - userp, tidPathp, &req, &dscp); - cm_FreeSpace(spacep); + if ( !dscp ) { + code = cm_NameI(baseDirp, spacep->data, + CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, + userp, tidPathp, &req, &dscp); + } else + code = 0; + + cm_FreeSpace(spacep); - if (baseFid != 0) smb_ReleaseFID(baseFidp); + if (baseFid != 0) { + smb_ReleaseFID(baseFidp); + baseFidp = 0; + } if (code) { cm_ReleaseUser(userp); @@ -3494,13 +3920,17 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out if (!lastNamep) lastNamep = realPathp; else lastNamep++; - if (!smb_IsLegalFilename(lastNamep)) - return CM_ERROR_BADNTFILENAME; + if (!smb_IsLegalFilename(lastNamep)) + return CM_ERROR_BADNTFILENAME; if (!foundscp) { - code = cm_Lookup(dscp, lastNamep, - CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, - userp, &req, &scp); + if (createDisp == 2 || createDisp == 4) + code = cm_Lookup(dscp, lastNamep, + CM_FLAG_FOLLOW, userp, &req, &scp); + else + code = cm_Lookup(dscp, lastNamep, + CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD, + userp, &req, &scp); if (code && code != CM_ERROR_NOSUCHFILE) { cm_ReleaseSCache(dscp); cm_ReleaseUser(userp); @@ -3510,7 +3940,10 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out } } else { - if (baseFid != 0) smb_ReleaseFID(baseFidp); + if (baseFid != 0) { + smb_ReleaseFID(baseFidp); + baseFidp = 0; + } cm_FreeSpace(spacep); } @@ -3558,8 +3991,8 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out } else if (realDirFlag == 0 || realDirFlag == -1) { osi_assert(dscp != NULL); - osi_Log1(afsd_logp, "smb_ReceiveNTTranCreate creating file %s", - osi_LogSaveString(afsd_logp, lastNamep)); + osi_Log1(smb_logp, "smb_ReceiveNTTranCreate creating file %s", + osi_LogSaveString(smb_logp, lastNamep)); openAction = 2; /* created file */ setAttr.mask = CM_ATTRMASK_CLIENTMODTIME; setAttr.clientModTime = time(NULL); @@ -3592,9 +4025,9 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out else { /* create directory */ osi_assert(dscp != NULL); - osi_Log1(afsd_logp, + osi_Log1(smb_logp, "smb_ReceiveNTTranCreate creating directory %s", - osi_LogSaveString(afsd_logp, lastNamep)); + osi_LogSaveString(smb_logp, lastNamep)); openAction = 2; /* created directory */ setAttr.mask = CM_ATTRMASK_CLIENTMODTIME; setAttr.clientModTime = time(NULL); @@ -3647,13 +4080,13 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out fidp->flags = fidflags; - /* save parent dir and pathname for deletion or change notification */ - if (fidflags & (SMB_FID_OPENDELETE | SMB_FID_OPENWRITE)) { - fidp->flags |= SMB_FID_NTOPEN; - fidp->NTopen_dscp = dscp; - cm_HoldSCache(dscp); - fidp->NTopen_pathp = strdup(lastNamep); - } + /* save parent dir and pathname for deletion or change notification */ + if (fidflags & (SMB_FID_OPENDELETE | SMB_FID_OPENWRITE)) { + fidp->flags |= SMB_FID_NTOPEN; + fidp->NTopen_dscp = dscp; + cm_HoldSCache(dscp); + fidp->NTopen_pathp = strdup(lastNamep); + } fidp->NTopen_wholepathp = realPathp; /* we don't need this any longer */ @@ -3664,60 +4097,115 @@ long smb_ReceiveNTTranCreate(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out /* set inp->fid so that later read calls in same msg can find fid */ inp->fid = fidp->fid; - /* out parms */ - parmOffset = 8*4 + 39; - parmOffset += 1; /* pad to 4 */ - dataOffset = parmOffset + 70; + /* check whether we are required to send an extended response */ + if (!extendedRespRequired) { + /* out parms */ + parmOffset = 8*4 + 39; + parmOffset += 1; /* pad to 4 */ + dataOffset = parmOffset + 70; + + parmSlot = 1; + outp->oddByte = 1; + /* Total Parameter Count */ + smb_SetSMBParmLong(outp, parmSlot, 70); parmSlot += 2; + /* Total Data Count */ + smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2; + /* Parameter Count */ + smb_SetSMBParmLong(outp, parmSlot, 70); parmSlot += 2; + /* Parameter Offset */ + smb_SetSMBParmLong(outp, parmSlot, parmOffset); parmSlot += 2; + /* Parameter Displacement */ + smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2; + /* Data Count */ + smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2; + /* Data Offset */ + smb_SetSMBParmLong(outp, parmSlot, dataOffset); parmSlot += 2; + /* Data Displacement */ + smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2; + smb_SetSMBParmByte(outp, parmSlot, 0); /* Setup Count */ + smb_SetSMBDataLength(outp, 70); - parmSlot = 1; - outp->oddByte = 1; - /* Total Parameter Count */ - smb_SetSMBParmLong(outp, parmSlot, 70); parmSlot += 2; - /* Total Data Count */ - smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2; - /* Parameter Count */ - smb_SetSMBParmLong(outp, parmSlot, 70); parmSlot += 2; - /* Parameter Offset */ - smb_SetSMBParmLong(outp, parmSlot, parmOffset); parmSlot += 2; - /* Parameter Displacement */ - smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2; - /* Data Count */ - smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2; - /* Data Offset */ - smb_SetSMBParmLong(outp, parmSlot, dataOffset); parmSlot += 2; - /* Data Displacement */ - smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2; - smb_SetSMBParmByte(outp, parmSlot, 0); /* Setup Count */ - smb_SetSMBDataLength(outp, 70); - - lock_ObtainMutex(&scp->mx); - outData = smb_GetSMBData(outp, NULL); - outData++; /* round to get to parmOffset */ - *outData = 0; outData++; /* oplock */ - *outData = 0; outData++; /* reserved */ - *((USHORT *)outData) = fidp->fid; outData += 2; /* fid */ - *((ULONG *)outData) = openAction; outData += 4; - *((ULONG *)outData) = 0; outData += 4; /* EA error offset */ - smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime); - *((FILETIME *)outData) = ft; outData += 8; /* creation time */ - *((FILETIME *)outData) = ft; outData += 8; /* last access time */ - *((FILETIME *)outData) = ft; outData += 8; /* last write time */ - *((FILETIME *)outData) = ft; outData += 8; /* change time */ - *((ULONG *)outData) = smb_ExtAttributes(scp); outData += 4; - *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* alloc sz */ - *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* EOF */ - *((USHORT *)outData) = 0; outData += 2; /* filetype */ - *((USHORT *)outData) = 0; outData += 2; /* dev state */ - *((USHORT *)outData) = (scp->fileType == CM_SCACHETYPE_DIRECTORY); - outData += 2; /* is a dir? */ - lock_ReleaseMutex(&scp->mx); + lock_ObtainMutex(&scp->mx); + outData = smb_GetSMBData(outp, NULL); + outData++; /* round to get to parmOffset */ + *outData = 0; outData++; /* oplock */ + *outData = 0; outData++; /* reserved */ + *((USHORT *)outData) = fidp->fid; outData += 2; /* fid */ + *((ULONG *)outData) = openAction; outData += 4; + *((ULONG *)outData) = 0; outData += 4; /* EA error offset */ + smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime); + *((FILETIME *)outData) = ft; outData += 8; /* creation time */ + *((FILETIME *)outData) = ft; outData += 8; /* last access time */ + *((FILETIME *)outData) = ft; outData += 8; /* last write time */ + *((FILETIME *)outData) = ft; outData += 8; /* change time */ + *((ULONG *)outData) = smb_ExtAttributes(scp); outData += 4; + *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* alloc sz */ + *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* EOF */ + *((USHORT *)outData) = 0; outData += 2; /* filetype */ + *((USHORT *)outData) = 0; outData += 2; /* dev state */ + *((USHORT *)outData) = (scp->fileType == CM_SCACHETYPE_DIRECTORY); + outData += 2; /* is a dir? */ + lock_ReleaseMutex(&scp->mx); + } else { + /* out parms */ + parmOffset = 8*4 + 39; + parmOffset += 1; /* pad to 4 */ + dataOffset = parmOffset + 104; + + parmSlot = 1; + outp->oddByte = 1; + /* Total Parameter Count */ + smb_SetSMBParmLong(outp, parmSlot, 101); parmSlot += 2; + /* Total Data Count */ + smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2; + /* Parameter Count */ + smb_SetSMBParmLong(outp, parmSlot, 101); parmSlot += 2; + /* Parameter Offset */ + smb_SetSMBParmLong(outp, parmSlot, parmOffset); parmSlot += 2; + /* Parameter Displacement */ + smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2; + /* Data Count */ + smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2; + /* Data Offset */ + smb_SetSMBParmLong(outp, parmSlot, dataOffset); parmSlot += 2; + /* Data Displacement */ + smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2; + smb_SetSMBParmByte(outp, parmSlot, 0); /* Setup Count */ + smb_SetSMBDataLength(outp, 105); + + lock_ObtainMutex(&scp->mx); + outData = smb_GetSMBData(outp, NULL); + outData++; /* round to get to parmOffset */ + *outData = 0; outData++; /* oplock */ + *outData = 1; outData++; /* response type */ + *((USHORT *)outData) = fidp->fid; outData += 2; /* fid */ + *((ULONG *)outData) = openAction; outData += 4; + *((ULONG *)outData) = 0; outData += 4; /* EA error offset */ + smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime); + *((FILETIME *)outData) = ft; outData += 8; /* creation time */ + *((FILETIME *)outData) = ft; outData += 8; /* last access time */ + *((FILETIME *)outData) = ft; outData += 8; /* last write time */ + *((FILETIME *)outData) = ft; outData += 8; /* change time */ + *((ULONG *)outData) = smb_ExtAttributes(scp); outData += 4; + *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* alloc sz */ + *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* EOF */ + *((USHORT *)outData) = 0; outData += 2; /* filetype */ + *((USHORT *)outData) = 0; outData += 2; /* dev state */ + *((USHORT *)outData) = (scp->fileType == CM_SCACHETYPE_DIRECTORY); + outData += 1; /* is a dir? */ + memset(outData,0,24); outData += 24; /* Volume ID and file ID */ + *((ULONG *)outData) = 0x001f01ffL; outData += 4; /* Maxmimal access rights */ + *((ULONG *)outData) = 0; outData += 4; /* Guest Access rights */ + lock_ReleaseMutex(&scp->mx); + } - osi_Log1(afsd_logp, "SMB NTTranCreate opening fid %d", fidp->fid); + osi_Log1(smb_logp, "SMB NTTranCreate opening fid %d", fidp->fid); smb_ReleaseFID(fidp); cm_ReleaseUser(userp); + /* free(realPathp); Can't free realPathp here because fidp->NTopen_wholepathp points there */ /* leave scp held since we put it in fidp->scp */ return 0; } @@ -3733,31 +4221,35 @@ long smb_ReceiveNTTranNotifyChange(smb_vc_t *vcp, smb_packet_t *inp, filter = smb_GetSMBParm(inp, 19) | (smb_GetSMBParm(inp, 20) << 16); fid = smb_GetSMBParm(inp, 21); - watchtree = smb_GetSMBParm(inp, 22) && 0xffff; + watchtree = smb_GetSMBParm(inp, 22) && 0xffff; /* TODO: should this be 0xff ? */ + + fidp = smb_FindFID(vcp, fid, 0); + if (!fidp) { + osi_Log1(smb_logp, "ERROR: NotifyChange given invalid fid [%d]", fid); + return CM_ERROR_BADFD; + } savedPacketp = smb_CopyPacket(inp); + smb_HoldVC(vcp); savedPacketp->vcp = vcp; lock_ObtainMutex(&smb_Dir_Watch_Lock); savedPacketp->nextp = smb_Directory_Watches; smb_Directory_Watches = savedPacketp; lock_ReleaseMutex(&smb_Dir_Watch_Lock); - fidp = smb_FindFID(vcp, fid, 0); - - osi_Log4(afsd_logp, "Request for NotifyChange filter 0x%x fid %d wtree %d file %s", - filter, fid, watchtree, osi_LogSaveString(afsd_logp, fidp->NTopen_wholepathp)); + osi_Log4(smb_logp, "Request for NotifyChange filter 0x%x fid %d wtree %d file %s", + filter, fid, watchtree, osi_LogSaveString(smb_logp, fidp->NTopen_wholepathp)); - scp = fidp->scp; - lock_ObtainMutex(&scp->mx); - if (watchtree) - scp->flags |= CM_SCACHEFLAG_WATCHEDSUBTREE; - else - scp->flags |= CM_SCACHEFLAG_WATCHED; - lock_ReleaseMutex(&scp->mx); - smb_ReleaseFID(fidp); + scp = fidp->scp; + lock_ObtainMutex(&scp->mx); + if (watchtree) + scp->flags |= CM_SCACHEFLAG_WATCHEDSUBTREE; + else + scp->flags |= CM_SCACHEFLAG_WATCHED; + lock_ReleaseMutex(&scp->mx); + smb_ReleaseFID(fidp); outp->flags |= SMB_PACKETFLAG_NOSEND; - return 0; } @@ -3850,7 +4342,7 @@ long smb_ReceiveNTTransact(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) function = smb_GetSMBParm(inp, 18); - osi_Log1(afsd_logp, "SMB NT Transact function %d", function); + osi_Log1(smb_logp, "SMB NT Transact function %d", function); /* We can handle long names */ if (vcp->flags & SMB_VCFLAG_USENT) @@ -3903,7 +4395,7 @@ void smb_NotifyChange(DWORD action, DWORD notifyFilter, filter = smb_GetSMBParm(watch, 19) | (smb_GetSMBParm(watch, 20) << 16); fid = smb_GetSMBParm(watch, 21); - wtree = smb_GetSMBParm(watch, 22) & 0xffff; + wtree = smb_GetSMBParm(watch, 22) & 0xffff; /* TODO: should this be 0xff ? */ maxLen = smb_GetSMBOffsetParm(watch, 5, 1) | (smb_GetSMBOffsetParm(watch, 6, 1) << 16); vcp = watch->vcp; @@ -3916,6 +4408,11 @@ void smb_NotifyChange(DWORD action, DWORD notifyFilter, filter = 0x17; fidp = smb_FindFID(vcp, fid, 0); + if (!fidp) { + lastWatch = watch; + watch = watch->nextp; + continue; + } if (fidp->scp != dscp || (filter & notifyFilter) == 0 || (!isDirectParent && !wtree)) { @@ -3926,9 +4423,9 @@ void smb_NotifyChange(DWORD action, DWORD notifyFilter, } smb_ReleaseFID(fidp); - osi_Log4(afsd_logp, + osi_Log4(smb_logp, "Sending Change Notification for fid %d filter 0x%x wtree %d file %s", - fid, filter, wtree, osi_LogSaveString(afsd_logp, filename)); + fid, filter, wtree, osi_LogSaveString(smb_logp, filename)); nextWatch = watch->nextp; if (watch == smb_Directory_Watches) @@ -4031,6 +4528,7 @@ void smb_NotifyChange(DWORD action, DWORD notifyFilter, } smb_SendPacket(vcp, watch); + smb_ReleaseVC(vcp); smb_FreePacket(watch); watch = nextWatch; } @@ -4045,7 +4543,7 @@ long smb_ReceiveNTCancel(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) smb_fid_t *fidp; cm_scache_t *scp; - osi_Log0(afsd_logp, "SMB3 receive NT cancel"); + osi_Log0(smb_logp, "SMB3 receive NT cancel"); lock_ObtainMutex(&smb_Dir_Watch_Lock); watch = smb_Directory_Watches; @@ -4064,20 +4562,27 @@ long smb_ReceiveNTCancel(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) fid = smb_GetSMBParm(watch, 21); watchtree = smb_GetSMBParm(watch, 22) & 0xffff; + if (vcp != watch->vcp) + osi_Log2(smb_logp, "smb_ReceiveNTCancel: vcp %x not equal to watch vcp %x", + vcp, watch->vcp); + fidp = smb_FindFID(vcp, fid, 0); - - osi_Log3(afsd_logp, "Cancelling change notification for fid %d wtree %d file %s", - fid, watchtree, - osi_LogSaveString(afsd_logp, (fidp)?fidp->NTopen_wholepathp:"")); - - scp = fidp->scp; - lock_ObtainMutex(&scp->mx); - if (watchtree) - scp->flags &= ~CM_SCACHEFLAG_WATCHEDSUBTREE; - else - scp->flags &= ~CM_SCACHEFLAG_WATCHED; - lock_ReleaseMutex(&scp->mx); - smb_ReleaseFID(fidp); + if (fidp) { + osi_Log3(smb_logp, "Cancelling change notification for fid %d wtree %d file %s", + fid, watchtree, + osi_LogSaveString(smb_logp, (fidp)?fidp->NTopen_wholepathp:"")); + + scp = fidp->scp; + lock_ObtainMutex(&scp->mx); + if (watchtree) + scp->flags &= ~CM_SCACHEFLAG_WATCHEDSUBTREE; + else + scp->flags &= ~CM_SCACHEFLAG_WATCHED; + lock_ReleaseMutex(&scp->mx); + smb_ReleaseFID(fidp); + } else { + osi_Log2(smb_logp,"NTCancel unable to resolve fid [%d] in vcp[%x]", fid,vcp); + } /* assume STATUS32; return 0xC0000120 (CANCELED) */ replyWctp = watch->wctp; @@ -4090,6 +4595,8 @@ long smb_ReceiveNTCancel(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) ((smb_t *)watch)->errHigh = 0xC0; ((smb_t *)watch)->flg2 |= 0x4000; smb_SendPacket(vcp, watch); + if (watch->vcp) + smb_ReleaseVC(watch->vcp); smb_FreePacket(watch); return 0; } @@ -4108,7 +4615,6 @@ void smb3_Init() cm_user_t *smb_FindCMUserByName(/*smb_vc_t *vcp,*/ char *usern, char *machine) { - cm_user_t *userp; /*int newUid;*/ smb_username_t *unp; @@ -4117,9 +4623,9 @@ cm_user_t *smb_FindCMUserByName(/*smb_vc_t *vcp,*/ char *usern, char *machine) lock_ObtainMutex(&unp->mx); unp->userp = cm_NewUser(); lock_ReleaseMutex(&unp->mx); - osi_LogEvent("AFS smb_FindCMUserByName New User",NULL,"name[%s] machine[%s]",usern,machine); + osi_LogEvent("AFS smb_FindCMUserByName : New User",NULL,"name[%s] machine[%s]",usern,machine); } else { - osi_LogEvent("AFS smb_FindCMUserByName Found",NULL,"name[%s] machine[%s]",usern,machine); + osi_LogEvent("AFS smb_FindCMUserByName : Found",NULL,"name[%s] machine[%s]",usern,machine); } return unp->userp; } diff --git a/src/WINNT/afsd/smb_iocons.h b/src/WINNT/afsd/smb_iocons.h index a122e04c2..f30fd50d0 100644 --- a/src/WINNT/afsd/smb_iocons.h +++ b/src/WINNT/afsd/smb_iocons.h @@ -82,14 +82,14 @@ typedef struct cm_cacheParms { #define VIOCNEWGETTOK 0x1f #define VIOCDELTOK 0x20 #define VIOCDELALLTOK 0x21 - +#define VIOC_ISSYMLINK 0x22 #define VIOC_SYMLINK 0x23 #define VIOC_LISTSYMLINK 0x24 #define VIOC_DELSYMLINK 0x25 #define VIOC_MAKESUBMOUNT 0x26 -#define VIOC_SHUTDOWN 0x27 +#define VIOC_SHUTDOWN 0x27 #define VIOC_GETRXKCRYPT 0x27 #define VIOC_SETRXKCRYPT 0x28 - +#define VIOC_TRACEMEMDUMP 0x29 #endif /* __SMB_IOCONS_H_ENV_ */ diff --git a/src/WINNT/afsd/smb_ioctl.c b/src/WINNT/afsd/smb_ioctl.c index a5d36df76..b8391d342 100644 --- a/src/WINNT/afsd/smb_ioctl.c +++ b/src/WINNT/afsd/smb_ioctl.c @@ -28,7 +28,6 @@ smb_ioctlProc_t *smb_ioctlProcsp[SMB_IOCTL_MAXPROCS]; /*extern unsigned char smb_LANadapter;*/ -extern LANA_ENUM lana_list; void smb_InitIoctl(void) { @@ -69,9 +68,12 @@ void smb_InitIoctl(void) smb_ioctlProcsp[VIOC_MAKESUBMOUNT] = cm_IoctlMakeSubmount; smb_ioctlProcsp[VIOC_GETRXKCRYPT] = cm_IoctlGetRxkcrypt; smb_ioctlProcsp[VIOC_SETRXKCRYPT] = cm_IoctlSetRxkcrypt; + smb_ioctlProcsp[VIOC_ISSYMLINK] = cm_IoctlIslink; #ifdef DJGPP smb_ioctlProcsp[VIOC_SHUTDOWN] = cm_IoctlShutdown; #endif + smb_ioctlProcsp[VIOC_TRACEMEMDUMP] = cm_IoctlMemoryDump; + smb_ioctlProcsp[VIOC_ISSYMLINK] = cm_IoctlIslink; } /* called to make a fid structure into an IOCTL fid structure */ @@ -203,8 +205,8 @@ long smb_IoctlRead(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, op = smb_GetSMBData(outp, NULL); *op++ = 1; - *op++ = count & 0xff; - *op++ = (count >> 8) & 0xff; + *op++ = (char)(count & 0xff); + *op++ = (char)((count >> 8) & 0xff); /* now copy the data into the response packet */ memcpy(op, iop->outCopied + iop->outAllocp, count); @@ -291,7 +293,7 @@ long smb_IoctlV3Read(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_pack osi_Log1(afsd_logp, "Ioctl no uid user %x no name", userp); } - smb_ReleaseUID(uidp); + if (uidp) smb_ReleaseUID(uidp); } iop->tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); @@ -379,10 +381,13 @@ long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, osi_Log3(afsd_logp, "Ioctl uid %d user %x name %s", uidp->userID, userp, osi_LogSaveString(afsd_logp, uidp->unp->name)); - else + else if (uidp) osi_Log2(afsd_logp, "Ioctl uid %d user %x no name", uidp->userID, userp); - smb_ReleaseUID(uidp); + else + osi_Log1(afsd_logp, "Ioctl no uid user %x no name", + userp); + if (uidp) smb_ReleaseUID(uidp); } iop->tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid); diff --git a/src/WINNT/afslegal/NTMakefile b/src/WINNT/afslegal/NTMakefile index 05c5709a3..522230e70 100644 --- a/src/WINNT/afslegal/NTMakefile +++ b/src/WINNT/afslegal/NTMakefile @@ -9,6 +9,7 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -WX # include the primary makefile +RELDIR=WINNT\afslegal !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version @@ -18,8 +19,8 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -WX EXEFILE = $(DESTDIR)\root.server\usr\afs\bin\afslegal.exe EXEOBJS = \ - afslegal_stub.res \ - afslegal.obj + $(OUT)\afslegal_stub.res \ + $(OUT)\afslegal.obj EXELIBS = \ $(DESTDIR)\lib\afs\talocale.lib \ @@ -40,4 +41,11 @@ lang :: ############################################################################ # Dependencies -afslegal_stub.res : afslegal_stub.rc AFS_component_version_number.h +$(OUT)\afslegal_stub.res : AFS_component_version_number.h + +mkdir: + -mkdir $(OUT)\lang + cd lang + nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir + cd .. + diff --git a/src/WINNT/afslegal/lang/NTMakefile b/src/WINNT/afslegal/lang/NTMakefile index 1757c8a13..c80da333e 100644 --- a/src/WINNT/afslegal/lang/NTMakefile +++ b/src/WINNT/afslegal/lang/NTMakefile @@ -10,7 +10,7 @@ AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include -I.. # include the primary makefile - +RELDIR=WINNT\afslegal\lang !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\..\config\NTMakefile.version @@ -35,7 +35,7 @@ DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\afslegal_$(LANGID).dll RCFILE = $(LANGNAME)\afslegal.rc -RESFILE = afslegal_$(LANGID).res +RESFILE = $(OUT)\afslegal_$(LANGID).res DLLOBJS = $(RESFILE) @@ -60,3 +60,6 @@ clean :: $(RESFILE) : $(RCFILE) AFS_component_version_number.h $(RC) /fo$(RESFILE) /c$(LANGCP) $(RCFILE) + +mkdir: + diff --git a/src/WINNT/afslegal/resource.h b/src/WINNT/afslegal/resource.h index 8fd0b72d1..818d5952f 100644 --- a/src/WINNT/afslegal/resource.h +++ b/src/WINNT/afslegal/resource.h @@ -7,11 +7,11 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#define IDS_MESSAGE_1 1 -#define IDS_MESSAGE_2 2 -#define IDS_MESSAGE_3 3 -#define IDS_MESSAGE_4 4 -#define IDS_MESSAGE_5 5 +#define IDS_MESSAGE_1 0 +#define IDS_MESSAGE_2 1 +#define IDS_MESSAGE_3 2 +#define IDS_MESSAGE_4 3 +#define IDS_MESSAGE_5 4 #define IDD_LAWYER 101 #define IDC_TITLE 1000 #define IDC_MESSAGE 1001 diff --git a/src/WINNT/afsreg/NTMakefile b/src/WINNT/afsreg/NTMakefile index d02d02b62..e427baa32 100644 --- a/src/WINNT/afsreg/NTMakefile +++ b/src/WINNT/afsreg/NTMakefile @@ -5,6 +5,7 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=WINNT\afsreg !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) INCFILES = \ @@ -13,13 +14,17 @@ INCFILES = \ $(DESTDIR)\include\WINNT\afssw.h \ $(DESTDIR)\include\WINNT\vptab.h + LIBFILE = $(DESTDIR)\lib\afs\afsreg.lib LIBOBJS = \ - afsreg.obj \ - syscfg.obj \ - afssw.obj \ - vptab.obj + $(OUT)\afsreg.obj \ + $(OUT)\syscfg.obj \ + $(OUT)\afssw.obj \ + $(OUT)\vptab.obj + +$(LIBOBJS): $$(@B).c + $(C2OBJ) $** $(LIBFILE): $(LIBOBJS) $(LIBARCH) diff --git a/src/WINNT/afsreg/test/NTMakefile b/src/WINNT/afsreg/test/NTMakefile index 44860fb92..62b8749bf 100644 --- a/src/WINNT/afsreg/test/NTMakefile +++ b/src/WINNT/afsreg/test/NTMakefile @@ -5,14 +5,15 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=WINNT\afsreg\test !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) -test tests: getifinfo.exe regman.exe dupkey.exe +test tests: $(OUT)\getifinfo.exe $(OUT)\regman.exe $(OUT)\dupkey.exe -getifinfo.exe: getifinfo.obj $(DESTDIR)\lib\afs\afsreg.lib +$(OUT)\getifinfo.exe: $(OUT)\getifinfo.obj $(DESTDIR)\lib\afs\afsreg.lib $(EXECONLINK) -dupkey.exe: dupkey.obj $(DESTDIR)\lib\afs\afsreg.lib +$(OUT)\dupkey.exe: $(OUT)\dupkey.obj $(DESTDIR)\lib\afs\afsreg.lib $(EXECONLINK) REGMAN_EXELIBS =\ @@ -21,5 +22,8 @@ REGMAN_EXELIBS =\ $(DESTDIR)\lib\afs\afscom_err.lib \ $(DESTDIR)\lib\afs\afsutil.lib -regman.exe: regman.obj $(REGMAN_EXELIBS) +$(OUT)\regman.exe: $(OUT)\regman.obj $(REGMAN_EXELIBS) $(EXECONLINK) + +mkdir: + diff --git a/src/WINNT/afssvrcfg/NTMakefile b/src/WINNT/afssvrcfg/NTMakefile index 61ff9048e..257130f24 100644 --- a/src/WINNT/afssvrcfg/NTMakefile +++ b/src/WINNT/afssvrcfg/NTMakefile @@ -6,46 +6,46 @@ # directory or online at http://www.openafs.org/dl/license10.html # AFSDEV_AUXCDEFINES = /DUNICODE +RELDIR=WINNT\afssvrcfg !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version - ############################################################################ # Definitions for building afssvrcfg.exe. EXEFILE = $(DESTDIR)\root.server\usr\afs\bin\afssvrcfg.exe EXEOBJS =\ - char_conv.obj \ - admin_info_dlg.obj \ - cfg_utils.obj \ - create_partition_dlg.obj \ - file_server_page.obj \ - graphics.obj \ - info_page.obj \ - intro_page.obj \ - partitions_page.obj \ - partition_page.obj \ - replicatition_page.obj \ - services_page.obj \ - toolbox.obj \ - afscfg.obj \ - backup_server_page.obj \ - config_server_page.obj \ - db_server_page.obj \ - get_cur_config.obj \ - help.obj \ - info2_page.obj \ - logfile.obj \ - partition_utils.obj \ - root_afs_page.obj \ - sys_control_page.obj \ - volume_utils.obj \ - salvage_dlg.obj \ - get_pw_dlg.obj \ - salvage_results_dlg.obj \ - validation.obj \ - afscfg_stub.res + $(OUT)\char_conv.obj \ + $(OUT)\admin_info_dlg.obj \ + $(OUT)\cfg_utils.obj \ + $(OUT)\create_partition_dlg.obj \ + $(OUT)\file_server_page.obj \ + $(OUT)\graphics.obj \ + $(OUT)\info_page.obj \ + $(OUT)\intro_page.obj \ + $(OUT)\partitions_page.obj \ + $(OUT)\partition_page.obj \ + $(OUT)\replicatition_page.obj \ + $(OUT)\services_page.obj \ + $(OUT)\toolbox.obj \ + $(OUT)\afscfg.obj \ + $(OUT)\backup_server_page.obj \ + $(OUT)\config_server_page.obj \ + $(OUT)\db_server_page.obj \ + $(OUT)\get_cur_config.obj \ + $(OUT)\help.obj \ + $(OUT)\info2_page.obj \ + $(OUT)\logfile.obj \ + $(OUT)\partition_utils.obj \ + $(OUT)\root_afs_page.obj \ + $(OUT)\sys_control_page.obj \ + $(OUT)\volume_utils.obj \ + $(OUT)\salvage_dlg.obj \ + $(OUT)\get_pw_dlg.obj \ + $(OUT)\salvage_results_dlg.obj \ + $(OUT)\validation.obj \ + $(OUT)\afscfg_stub.res VCLIBS =\ comctl32.lib \ @@ -58,8 +58,8 @@ EXELIBS =\ $(DESTDIR)\lib\afs\afsbosadmin.lib \ $(DESTDIR)\lib\afs\afsvosadmin.lib \ $(DESTDIR)\lib\afs\afsclientadmin.lib \ - $(DESTDIR)\lib\afs\afsadminutil.lib - + $(DESTDIR)\lib\afs\afsadminutil.lib \ + $(DESTDIR)\lib\lanahelper.lib $(EXEFILE): $(EXEOBJS) $(EXELIBS) $(EXEGUILINK) $(VCLIBS) @@ -69,9 +69,7 @@ $(EXEFILE): $(EXEOBJS) $(EXELIBS) ############################################################################ # Definitions for generating versioninfo resource via RC -afscfg_stub.res: afscfg_stub.rc AFS_component_version_number.h - $(RC) $*.rc - +$(OUT)\afscfg_stub.res:afscfg_stub.rc AFS_component_version_number.h ############################################################################ # Install target; primary makefile target @@ -84,7 +82,7 @@ install: $(EXEFILE) lang lang:: $(CD) lang - for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install + for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /e /f NTMakefile install $(CD) .. @@ -93,3 +91,9 @@ lang:: clean:: +mkdir: + -mkdir $(OUT)\lang + cd lang + nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir + cd .. + diff --git a/src/WINNT/afssvrcfg/afscfg.cpp b/src/WINNT/afssvrcfg/afscfg.cpp index 2f41449dc..511a43543 100644 --- a/src/WINNT/afssvrcfg/afscfg.cpp +++ b/src/WINNT/afssvrcfg/afscfg.cpp @@ -27,6 +27,7 @@ extern "C" { #include #include } +#include /* @@ -121,7 +122,7 @@ LOGFILE g_LogFile; * EXPORTED FUNCTIONS _________________________________________________________________ * */ -int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR pszCmdLineA, int nCmdShow) +extern "C" int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR pszCmdLineA, int nCmdShow) { afs_status_t nStatus; @@ -259,19 +260,10 @@ LPTSTR GetSalvageLogFileName() { return g_CfgData.szSalvageLogFileName; } LPTSTR GetClientNetbiosName() { - static TCHAR szValue[MAX_MACHINE_NAME_LEN + 1]; + static TCHAR szValue[MAX_MACHINE_NAME_LEN + 1] = ""; - lstrcpy(szValue, g_CfgData.szLocalName); - - szValue[11] = TEXT('\0'); - - for (LPTSTR pch = szValue; *pch != TEXT('\0'); pch++) { - if (*pch == TEXT('.')) { - *pch = TEXT('\0'); - break; - } - } - lstrcat(szValue, TEXT("-AFS")); + if ( szValue[0] == 0 ) + CopyAnsiToString(GetClientNetbiosNameA(), szValue); return szValue; } @@ -389,19 +381,12 @@ char *GetClientCellNameA() char *GetClientNetbiosNameA() { - static char szValueA[MAX_MACHINE_NAME_LEN + 1]; - char *dotp; - - CopyStringToAnsi(szValueA, g_CfgData.szLocalName); - - szValueA[11] = '\0'; - - if ((dotp = strchr(szValueA, '.')) != NULL) { - *dotp = '\0'; - } - strcat(szValueA, "-AFS"); + static char szValueA[MAX_MACHINE_NAME_LEN + 1]=""; + + if ( szValueA[0] == 0 ) + lana_GetNetbiosName(szValueA, LANA_NETBIOS_NAME_FULL); - return szValueA; + return szValueA; } char *GetSalvageLogFileNameA() diff --git a/src/WINNT/afssvrcfg/afscfg.h b/src/WINNT/afssvrcfg/afscfg.h index 4f6842fa3..c94f08483 100644 --- a/src/WINNT/afssvrcfg/afscfg.h +++ b/src/WINNT/afssvrcfg/afscfg.h @@ -30,7 +30,7 @@ extern "C" { #define LOG_FILE_NAME "afs_server_config_log.txt" -// Enum for the steps in the wizard. Used to index into the array of steps. +/* Enum for the steps in the wizard. Used to index into the array of steps. */ enum StateID { sidSTEP_ONE, sidSTEP_TWO, diff --git a/src/WINNT/afssvrcfg/cfg_utils.cpp b/src/WINNT/afssvrcfg/cfg_utils.cpp index aa3461251..ff6ca87c5 100644 --- a/src/WINNT/afssvrcfg/cfg_utils.cpp +++ b/src/WINNT/afssvrcfg/cfg_utils.cpp @@ -109,9 +109,9 @@ void LogError(afs_status_t nErrorCode) const char *pszMsg = GetAdminLibErrorCodeMessage(nErrorCode); if (pszMsg) - g_LogFile.Write("Error %0xd has occurred: %s.\r\n", (UINT)nErrorCode, pszMsg); + g_LogFile.Write("Error 0x%0x has occurred: %s.\r\n", (UINT)nErrorCode, pszMsg); else - g_LogFile.Write("Error %0xd has occurred.\r\n", (UINT)nErrorCode); + g_LogFile.Write("Error 0x%0x has occurred.\r\n", (UINT)nErrorCode); } void ShowError(HWND hDlg, afs_status_t nErrorCode, UINT uiErrorMsgID) diff --git a/src/WINNT/afssvrcfg/config_server_page.cpp b/src/WINNT/afssvrcfg/config_server_page.cpp index 56bde11f0..eab047aae 100644 --- a/src/WINNT/afssvrcfg/config_server_page.cpp +++ b/src/WINNT/afssvrcfg/config_server_page.cpp @@ -85,11 +85,8 @@ static void ShowConfigControls(BOOL bShow = TRUE); static void UpdateConfigProgress(int nStepNum); static void ShowTitle(); static void ViewLog(); -static void LogConfigState(); static void ShowConfigFailedMsg(); static BOOL Unconfiguring(); -static void SetButtonText(UINT uiMsgID); -static char *GetAfsRootDir(); static BOOL GetCellServDB(char **ppszCellServDB); static BOOL FreeCellServDB(); static char *GetVicepName(); @@ -1389,10 +1386,20 @@ static BOOL CreateRootAfsDriveMapping() char chDriveLetter; try_again: + NETRESOURCE nr; + memset (&nr, 0x00, sizeof(NETRESOURCE)); + for (chDriveLetter = 'D'; (chDriveLetter <= 'Z') && !m_bRootAfsDriveMappingCreated; chDriveLetter++) { m_szDriveToMapTo[0] = chDriveLetter; g_LogFile.Write("Attempting to map %s to %s: ", m_szDriveToMapTo, szAfsRootDir); - m_bRootAfsDriveMappingCreated = (WNetAddConnection(A2S(szAfsRootDir), TEXT(""), A2S(m_szDriveToMapTo)) == NO_ERROR); + + nr.dwType=RESOURCETYPE_DISK; + nr.lpLocalName=m_szDriveToMapTo; + nr.lpRemoteName=szAfsRootDir; + nr.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE; + DWORD res=WNetAddConnection2(&nr,NULL,NULL,0); + m_bRootAfsDriveMappingCreated = (res == NO_ERROR); + // m_bRootAfsDriveMappingCreated = (WNetAddConnection(A2S(szAfsRootDir), TEXT(""), A2S(m_szDriveToMapTo)) == NO_ERROR); g_LogFile.Write(m_bRootAfsDriveMappingCreated ? "succeeded.\r\n" : "failed.\r\n"); } diff --git a/src/WINNT/afssvrcfg/create_partition_dlg.cpp b/src/WINNT/afssvrcfg/create_partition_dlg.cpp index b591ea724..93f419bef 100644 --- a/src/WINNT/afssvrcfg/create_partition_dlg.cpp +++ b/src/WINNT/afssvrcfg/create_partition_dlg.cpp @@ -40,16 +40,16 @@ static TCHAR szDrive[4]; static TCHAR szSize[32]; static rwWindowData arwDialog[] = { - { IDC_TITLE, raSizeX | raRepaint }, - { IDC_DRIVE_LIST, raSizeX | raSizeY, MAKELONG(350, 150) }, - { IDC_ARGS_FRAME, raSizeX | raMoveY }, - { IDC_NAME_STATIC, raMoveY | raRepaint }, - { IDC_VICEP_STATIC, raMoveY | raRepaint }, - { IDC_PARTITION_NAME, raMoveY | raRepaint }, - { IDC_CREATE, raMoveX | raMoveY }, - { IDC_CLOSE, raMoveX | raMoveY }, - { 9, raMoveX | raMoveY }, - { idENDLIST, 0 } + { IDC_TITLE, raSizeX | raRepaint, 0, 0 }, + { IDC_DRIVE_LIST, raSizeX | raSizeY, MAKELONG(350, 150), 0 }, + { IDC_ARGS_FRAME, raSizeX | raMoveY, 0, 0 }, + { IDC_NAME_STATIC, raMoveY | raRepaint, 0, 0 }, + { IDC_VICEP_STATIC, raMoveY | raRepaint, 0, 0 }, + { IDC_PARTITION_NAME, raMoveY | raRepaint, 0, 0 }, + { IDC_CREATE, raMoveX | raMoveY, 0, 0 }, + { IDC_CLOSE, raMoveX | raMoveY, 0, 0 }, + { 9, raMoveX | raMoveY, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/afssvrcfg/get_cur_config.cpp b/src/WINNT/afssvrcfg/get_cur_config.cpp index b43854b09..6766e791f 100644 --- a/src/WINNT/afssvrcfg/get_cur_config.cpp +++ b/src/WINNT/afssvrcfg/get_cur_config.cpp @@ -44,7 +44,6 @@ static vos_vldbEntry_t vldbRootCellEntry; */ BOOL CALLBACK GetCurConfigDlgProc(HWND hwndDlg, UINT msg, WPARAM wp, LPARAM lp); static DWORD CALLBACK GetCurrentConfigState(LPPROGRESSDISPLAY ppd, LPARAM lp); -static void SetConfigDefaults(); static void ShowMsg(UINT uiMsgID); static void NextStep(UINT uiMsgID); @@ -59,7 +58,7 @@ int GetCurrentConfig(HWND hParent, BOOL& bCanceled) bCancel = FALSE; bBakConfigured = FALSE; - pProg = new PROGRESSDISPLAY(hParent, IDD_GET_CURRENT_CONFIG, (DLGPROC)GetCurConfigDlgProc); + pProg = New2 (PROGRESSDISPLAY,(hParent, IDD_GET_CURRENT_CONFIG, (DLGPROC)GetCurConfigDlgProc)); pProg->SetProgressRange(0, MAX_STEPS); HWND hLogo = GetDlgItem(pProg->GetWindow(), IDC_LOGO); diff --git a/src/WINNT/afssvrcfg/hourglass.h b/src/WINNT/afssvrcfg/hourglass.h index 15c00688f..4b58c6a7b 100755 --- a/src/WINNT/afssvrcfg/hourglass.h +++ b/src/WINNT/afssvrcfg/hourglass.h @@ -7,24 +7,23 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include - -typedef class HOURGLASS -{ - protected: - HCURSOR m_OldCursor; - - public: - HOURGLASS (LPCSTR idCursor = IDC_WAIT) - { - m_OldCursor = GetCursor(); - SetCursor (LoadCursor (NULL, idCursor)); - } - - virtual ~HOURGLASS (void) - { - SetCursor (m_OldCursor); - } - -} HOURGLASS, *PHOURGLASS; - +#include + +typedef class HOURGLASS +{ + protected: + HCURSOR m_OldCursor; + + public: + HOURGLASS (LPCSTR idCursor = IDC_WAIT) + { + m_OldCursor = GetCursor(); + SetCursor (LoadCursor (NULL, idCursor)); + } + + virtual ~HOURGLASS (void) + { + SetCursor (m_OldCursor); + } + +} HOURGLASS, *PHOURGLASS; diff --git a/src/WINNT/afssvrcfg/lang/NTMakefile b/src/WINNT/afssvrcfg/lang/NTMakefile index 89a70db1e..333d338fb 100644 --- a/src/WINNT/afssvrcfg/lang/NTMakefile +++ b/src/WINNT/afssvrcfg/lang/NTMakefile @@ -10,7 +10,7 @@ AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include -I.. # include the primary makefile - +RELDIR=WINNT\afssvrcfg\lang !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\..\config\NTMakefile.version @@ -35,7 +35,7 @@ DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\afssvrcfg_$(LANGID).dll RCFILE = $(LANGNAME)\afscfg.rc -RESFILE = afscfg_$(LANGID).res +RESFILE = $(OUT)\afscfg_$(LANGID).res DLLOBJS = $(RESFILE) @@ -48,7 +48,8 @@ $(DLLFILE) : $(DLLOBJS) install : $(DLLFILE) clean :: - @if exist *.res del *.res + @if exist $(OUT)\*.res del $(OUT)\*.res + @if exist AFS_component_version_number.h del AFS_component_version_number.h @if exist RC*. del RC*. @if exist RD*. del RD*. @@ -60,3 +61,6 @@ clean :: $(RESFILE) : $(RCFILE) AFS_component_version_number.h $(RC) /fo$(RESFILE) /c$(LANGCP) $(RCFILE) + +mkdir: + diff --git a/src/WINNT/afssvrcfg/partitions_page.cpp b/src/WINNT/afssvrcfg/partitions_page.cpp index 8a7fa054d..ffa1f6b70 100644 --- a/src/WINNT/afssvrcfg/partitions_page.cpp +++ b/src/WINNT/afssvrcfg/partitions_page.cpp @@ -44,7 +44,8 @@ static TCHAR szYes[cchRESOURCE]; static TCHAR szNo[cchRESOURCE]; static const UINT DISK_DRIVE_IMAGE = 0; -static const UINT DISABLED_DISK_DRIVE_IMAGE = 1; +//static const UINT DISABLED_DISK_DRIVE_IMAGE = 1; +//static const UINT DISK_DRIVE_WITH_WARNING_IMAGE = 2; // Remember the config state of the FS so we can detect when it changes. // When it changes we must redisplay the partition info. diff --git a/src/WINNT/afssvrcfg/resource.h b/src/WINNT/afssvrcfg/resource.h index 9cfb7b818..e4f5c7cf8 100644 --- a/src/WINNT/afssvrcfg/resource.h +++ b/src/WINNT/afssvrcfg/resource.h @@ -7,306 +7,323 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#define IDS_NEXT 1 -#define IDS_FINISH 2 -#define IDS_HELP_TITLE 3 -#define IDS_HELP_DESC 4 -#define IDS_CANCEL_DESC 6 -#define IDS_PARTITION_ALREADY_CREATED 7 -#define IDS_NOT_A_FS_SERVER 8 -#define IDS_ROOT_AFS_ALREADY_EXISTS 9 -#define IDS_NO_PARTITION_EXISTS 10 -#define IDS_ALREADY_REPLICATED 11 -#define IDS_ROOT_AFS_DOESNT_EXIST 12 -#define IDS_ALREADY_CONFIGURED 13 -#define IDS_NOTHING_TO_CONFIGURE 14 -#define IDS_EXIT 15 -#define IDS_START_FS_STEP 16 -#define IDS_CANCEL_CONFIG_MSG 17 -#define IDS_WIZARD_APP_TITLE 18 -#define IDS_CANCEL_PENDING 19 -#define IDS_CHECK_FS_CONFIG 20 -#define IDS_CHECK_DB_CONFIG 21 -#define IDS_CHECK_BAK_CONFIG 22 -#define IDS_CHECK_PARTITION 23 -#define IDS_CHECK_ROOT_AFS 24 -#define IDS_CHECK_REP 25 -#define IDS_CANCEL_GET_CONFIG 26 -#define IDS_ALREADY_A_BACKUP_SERVER 27 -#define IDS_NOT_A_DB_SERVER 28 +#define IDS_NEXT 0 +#define IDS_FINISH 1 +#define IDS_HELP_TITLE 2 +#define IDS_HELP_DESC 3 +#define IDS_CANCEL_DESC 4 +#define IDS_PARTITION_ALREADY_CREATED 5 +#define IDS_NOT_A_FS_SERVER 6 +#define IDS_ROOT_AFS_ALREADY_EXISTS 7 +#define IDS_NO_PARTITION_EXISTS 8 +#define IDS_ALREADY_REPLICATED 9 +#define IDS_ROOT_AFS_DOESNT_EXIST 10 +#define IDS_ALREADY_CONFIGURED 11 +#define IDS_NOTHING_TO_CONFIGURE 12 +#define IDS_EXIT 13 + +#define IDS_START_FS_STEP 16 +#define IDS_CANCEL_CONFIG_MSG 17 +#define IDS_WIZARD_APP_TITLE 18 +#define IDS_CANCEL_PENDING 19 +#define IDS_CHECK_FS_CONFIG 20 +#define IDS_CHECK_DB_CONFIG 21 +#define IDS_CHECK_BAK_CONFIG 22 +#define IDS_CHECK_PARTITION 23 +#define IDS_CHECK_ROOT_AFS 24 +#define IDS_CHECK_REP 25 +#define IDS_CANCEL_GET_CONFIG 26 +#define IDS_ALREADY_A_BACKUP_SERVER 27 +#define IDS_NOT_A_DB_SERVER 28 #define IDS_ALREADY_A_SYS_CONTROL_SERVER 29 #define IDS_ALREADY_A_SYS_CONTROL_CLIENT 30 -#define IDS_SC_NOT_A_DB_OR_FS_SERVER 31 -#define IDS_DRIVE 32 -#define IDS_NAME_OR_ERROR 33 -#define IDS_BIN_NOT_A_DB_OR_FS_SERVER 34 -#define IDS_CHECK_SCS 35 -#define IDS_CHECK_SCC 36 -#define IDS_SIZE 37 -#define IDS_ERROR_SEP 38 -#define IDS_MUST_CONFIG_FS 39 -#define IDS_MUST_CONFIG_DB 40 -#define IDS_MUST_MAKE_PARTITION 41 -#define IDS_MUST_CREATE_ROOT_AFS 42 -#define IDS_MUST_REPLICATE 43 -#define IDS_CHECK_AFS_CLIENT 44 -#define IDS_ERROR_HOST_NAME 45 -#define IDS_ERROR_DRIVE_COMPRESSED 46 -#define IDS_ERROR_CFG_HOST_OPEN 47 -#define IDS_ERROR_AFS_CLIENT_NOT_INSTALLED 49 -#define IDS_ERROR_AFS_CLIENT_CHECK 50 -#define IDS_ERROR_FS_IS_NOT_NTFS 51 -#define IDS_ERROR_DRIVE_HAS_DATA 52 -#define IDS_PARTITION_STEP_DESC 53 -#define IDS_ERROR_DRIVE_CONTAINS_NT 54 -#define IDS_DB_STEP_DESC 55 -#define IDS_FS_STEP_DESC 56 -#define IDS_SCC_STEP_DESC 57 -#define IDS_SCS_STEP_DESC 58 -#define IDS_ROOT_AFS_STEP_DESC 59 -#define IDS_REP_STEP_DESC 60 -#define IDS_PARTITIONS_PAGE_TITLE 61 -#define IDS_CONFIGURE 62 -#define IDS_DB_AND_BK_STEP_DESC 63 -#define IDS_PARTITION_STEP 64 -#define IDS_CONFIG_COMMON_FUNCS 65 -#define IDS_START_DB_STEP 66 -#define IDS_START_SCC_STEP 67 -#define IDS_START_SCS_STEP 68 -#define IDS_CREATE_ROOT_AFS_STEP 69 -#define IDS_REP_STEP 70 -#define IDS_START_AUTH_STEP 71 -#define IDS_SERVICES_PAGE_TITLE 72 -#define IDS_CONFIG_SUCCEEDED 73 -#define IDS_CONFIG_CANCELED 74 -#define IDS_CONFIG_FAILED 75 -#define IDS_ERROR_NO_LICENSE_NUM 76 -#define IDS_VERIFY_CLIENT_INSTALL_STEP 77 -#define IDS_SET_SERVER_LICENSE_STEP 78 -#define IDS_DEFINE_CELL_NAME_STEP 79 -#define IDS_DEFINE_CELL_MEMBERSHIP_STEP 80 -#define IDS_START_BOS_SERVER_STEP 81 -#define IDS_START_AUTH_SERVER_STEP 82 -#define IDS_CREATE_PRINCIPAL_AND_KEY_STEP 83 -#define IDS_START_DB_AND_BK_STEP 84 -#define IDS_CREATE_ADMIN_PRINCIPAL_STEP 85 -#define IDS_START_CLIENT_STEP 86 -#define IDS_SET_ROOT_ACL_STEP 87 -#define IDS_CREATE_ROOT_CELL_STEP 88 -#define IDS_MOUNT_ROOT_CELL_STANDARD_STEP 89 -#define IDS_SET_ROOT_CELL_ACL_STEP 90 -#define IDS_MOUNT_ROOT_CELL_RW_STEP 91 -#define IDS_ENABLE_AUTH_CHECKING_STEP 92 -#define IDS_OBTAIN_ADMIN_CREDS_STEP 93 -#define IDS_RESTART_SERVERS_STEP 94 -#define IDS_ALREADY_A_FS_SERVER 95 -#define IDS_ALREADY_A_DB_SERVER 96 -#define IDS_INTRO_PAGE 97 -#define IDS_INFO_PAGE 98 -#define IDS_FS_PAGE 99 -#define IDS_DB_PAGE 100 +#define IDS_SC_NOT_A_DB_OR_FS_SERVER 31 + +#define IDS_DRIVE 32 +#define IDS_NAME_OR_ERROR 33 +#define IDS_BIN_NOT_A_DB_OR_FS_SERVER 34 +#define IDS_CHECK_SCS 35 +#define IDS_CHECK_SCC 36 +#define IDS_SIZE 37 +#define IDS_ERROR_SEP 38 +#define IDS_MUST_CONFIG_FS 39 +#define IDS_MUST_CONFIG_DB 40 +#define IDS_MUST_MAKE_PARTITION 41 +#define IDS_MUST_CREATE_ROOT_AFS 42 +#define IDS_MUST_REPLICATE 43 +#define IDS_CHECK_AFS_CLIENT 44 +#define IDS_ERROR_HOST_NAME 45 +#define IDS_ERROR_DRIVE_COMPRESSED 46 +#define IDS_ERROR_CFG_HOST_OPEN 47 + +#define IDS_STOP_CLIENT_STEP 48 +#define IDS_ERROR_LOCAL_HOST_NAME 49 +#define IDS_GET_TOKENS_ERROR 50 +#define IDS_CANT_SALVAGE_WHEN_FS_NOT_CONFIGURED 51 +#define IDS_SALVAGING 52 +#define IDS_CURRENT_SALVAGE_LOG 53 +#define IDS_FINAL_SALVAGE_LOG 54 +#define IDS_SALVAGE_COMPLETE 55 +#define IDS_CANT_GET_SALVAGE_LOG 56 +#define IDS_ERROR_SAVING_SALVAGE_LOG_TO_DISK 57 +#define IDS_VALIDATION_ERROR_TEMPLATE 58 +#define IDS_CELL_NAME_VALIDATION_TYPE 59 +#define IDS_SERVER_NAME_VALIDATION_TYPE 60 +#define IDS_PASSWORD_VALIDATION_TYPE 61 +#define IDS_UID_VALIDATION_TYPE 62 +#define IDS_USER_NAME_VALIDATION_TYPE 63 + +#define IDS_ERROR_AFS_CLIENT_NOT_INSTALLED 64 +#define IDS_ERROR_AFS_CLIENT_CHECK 65 +#define IDS_ERROR_FS_IS_NOT_NTFS 66 +#define IDS_ERROR_DRIVE_HAS_DATA 67 +#define IDS_PARTITION_STEP_DESC 68 +#define IDS_ERROR_DRIVE_CONTAINS_NT 69 +#define IDS_DB_STEP_DESC 70 +#define IDS_FS_STEP_DESC 71 +#define IDS_SCC_STEP_DESC 72 +#define IDS_SCS_STEP_DESC 73 +#define IDS_ROOT_AFS_STEP_DESC 74 +#define IDS_REP_STEP_DESC 75 +#define IDS_PARTITIONS_PAGE_TITLE 76 +#define IDS_CONFIGURE 77 +#define IDS_DB_AND_BK_STEP_DESC 78 + +#define IDS_PARTITION_STEP 80 +#define IDS_CONFIG_COMMON_FUNCS 81 +#define IDS_START_DB_STEP 82 +#define IDS_START_SCC_STEP 83 +#define IDS_START_SCS_STEP 84 +#define IDS_CREATE_ROOT_AFS_STEP 85 +#define IDS_REP_STEP 86 +#define IDS_START_AUTH_STEP 87 +#define IDS_SERVICES_PAGE_TITLE 88 +#define IDS_CONFIG_SUCCEEDED 89 +#define IDS_CONFIG_CANCELED 90 +#define IDS_CONFIG_FAILED 91 +#define IDS_ERROR_NO_LICENSE_NUM 92 +#define IDS_VERIFY_CLIENT_INSTALL_STEP 93 +#define IDS_SET_SERVER_LICENSE_STEP 94 +#define IDS_DEFINE_CELL_NAME_STEP 95 + +#define IDS_DEFINE_CELL_MEMBERSHIP_STEP 96 +#define IDS_START_BOS_SERVER_STEP 97 +#define IDS_START_AUTH_SERVER_STEP 98 +#define IDS_CREATE_PRINCIPAL_AND_KEY_STEP 99 +#define IDS_START_DB_AND_BK_STEP 100 +#define IDS_CREATE_ADMIN_PRINCIPAL_STEP 101 +#define IDS_START_CLIENT_STEP 102 +#define IDS_SET_ROOT_ACL_STEP 103 +#define IDS_CREATE_ROOT_CELL_STEP 104 +#define IDS_MOUNT_ROOT_CELL_STANDARD_STEP 105 +#define IDS_SET_ROOT_CELL_ACL_STEP 106 +#define IDS_MOUNT_ROOT_CELL_RW_STEP 107 +#define IDS_ENABLE_AUTH_CHECKING_STEP 108 +#define IDS_OBTAIN_ADMIN_CREDS_STEP 109 +#define IDS_RESTART_SERVERS_STEP 110 +#define IDS_ALREADY_A_FS_SERVER 111 + +#define IDS_ALREADY_A_DB_SERVER 112 +#define IDS_INTRO_PAGE 113 +#define IDS_INFO_PAGE 114 +#define IDS_FS_PAGE 115 +#define IDS_DB_PAGE 116 +#define IDS_CFG_TOOL_APP_TITLE 117 +#define IDS_BK_PAGE 118 +#define IDS_ROOT_AFS_PAGE 119 +#define IDS_NAME 120 +#define IDS_REP_PAGE 121 +#define IDS_SC_PAGE 122 +#define IDS_CONFIG_PAGE 123 + +#define IDS_PARTITION_PAGE 128 +#define IDS_GRAPHIC_FONT 129 +#define IDS_CURRENT_STEP 130 +#define IDS_ADD_TO_CELLSERVDB_STEP 131 +#define IDS_RESTART_ALL_DB_SERVERS_STEP 132 +#define IDS_CONFIG_SUCCEEDED_NEED_CELLSERVDB_UPDATE 133 +#define IDS_SYS_CONTROL_SERVER_ONLY_MSG 134 + +#define IDS_DONT_CONFIG_SYS_CONTROL_SERVER_MSG 144 +#define IDS_CLIENT_CELL_WILL_CHANGE 145 +#define IDS_INFO_PAGE2 146 +#define IDS_CONFIG_SUCCEEDED_FIRST_SERVER 147 +#define IDS_CONFIG_SCS 148 +#define IDS_CONFIG_INTO_CELL_MSG 149 +#define IDS_VIEW_LOG 150 +#define IDS_VIEW_LOG_ERROR 151 +#define IDS_ERROR_NO_LOG_FILE 152 +#define IDS_UPDATING_CELLSERVDB_HOST_SUCCEEDED 153 +#define IDS_UPDATING_CELLSERVDB_HOST_FAILED 154 +#define IDS_CELL_NAME_LEN_ERROR 155 +#define IDS_CONFIG_CHECK_FAILED 156 +#define IDS_YES 157 + +#define IDS_NO 160 +#define IDS_FREE 161 +#define IDS_TOTAL 162 +#define IDS_DRIVE2 163 +#define IDS_SERVICE_STATUS 164 +#define IDS_SERVICE 165 +#define IDS_FS_RUNNING 166 +#define IDS_FS_STOPPED 167 + +#define IDS_DB_RUNNING 176 +#define IDS_DB_STOPPED 177 +#define IDS_BK_RUNNING 178 +#define IDS_BK_STOPPED 179 +#define IDS_SC_RUNNING 180 +#define IDS_SCS_STOPPED 181 +#define IDS_SC_STOPPED 182 +#define IDS_SCC_STOPPED 183 +#define IDS_FS_HOW_TO_RUN 184 +#define IDS_FS_HOW_TO_STOP 185 +#define IDS_DB_HOW_TO_RUN 186 +#define IDS_DB_HOW_TO_STOP 187 +#define IDS_BK_HOW_TO_RUN 188 + +#define IDS_BK_HOW_TO_STOP 192 +#define IDS_SCS_HOW_TO_RUN 193 +#define IDS_SCS_HOW_TO_STOP 194 +#define IDS_DB_PARTIAL_CONFIG 195 +#define IDS_DB_DETAILS 196 +#define IDS_BK_DISABLED 197 +#define IDS_BK_ENABLE 198 +#define IDS_SC_DISABLED 199 +#define IDS_SC_ENABLE 200 +#define IDS_FS_WILL_RUN 201 +#define IDS_FS_WILL_STOP 202 +#define IDS_DB_WILL_RUN 203 +#define IDS_DB_WILL_STOP 204 +#define IDS_BK_WILL_RUN 205 +#define IDS_BK_WILL_STOP 206 +#define IDS_SCS_WILL_RUN 207 + +#define IDS_SCS_WILL_STOP 208 +#define IDS_ERROR_DRIVE_ALREADY_HAS_AFS 209 +#define IDS_VOLUME_HAS_NO_NAME 210 +#define IDS_PARTITION_CREATED 211 +#define IDS_PARTITION_EXISTS 212 +#define IDS_SCS_RUNNING 213 +#define IDS_WARNING_DRIVE_HAS_RECYCLE_BIN 214 +#define IDS_SCC_WILL_RUN 215 +#define IDS_SCC_WILL_STOP 216 +#define IDS_SCC_RUNNING 217 +#define IDS_SCC_HOW_TO_RUN 218 +#define IDS_SCC_HOW_TO_STOP 219 +#define IDS_SCS_ENABLE 220 +#define IDS_SCC_ENABLE 221 +#define IDS_UNCONFIG_DB_STEP 222 +#define IDS_UNCONFIG_DB_STEP_DESC 223 + +#define IDS_UNCONFIG_DB_AND_BK_STEP 224 +#define IDS_UNCONFIG_DB_AND_BK_STEP_DESC 225 +#define IDS_UNCONFIG_BK_STEP 226 +#define IDS_UNCONFIG_BK_STEP_DESC 227 +#define IDS_UNCONFIG_FS_STEP 228 +#define IDS_UNCONFIG_FS_STEP_DESC 229 +#define IDS_UNCONFIG_SCS_STEP 230 +#define IDS_UNCONFIG_SCS_STEP_DESC 231 +#define IDS_UNCONFIG_SCC_STEP 232 +#define IDS_UNCONFIG_SCC_STEP_DESC 233 +#define IDS_INVALIDATE_CONFIG_INFO_STEP 234 +#define IDS_GET_OTHER_HOSTNAME 235 +#define IDS_CLOSE 236 +#define IDS_CELLSERVDB_UPDATE_ERR_MSG 237 +#define IDS_DELETE_PARTITION_PROMPT 238 +#define IDS_INVALIDATE_CFG_INFO 239 + +#define IDS_CELL_IS_GONE_MUST_EXIT 240 +#define IDS_CFG_MAN_CANT_CONTINUE 241 +#define IDS_CONFIG_INFO_INVALIDATED 242 +#define IDS_GET_TOKENS_FAILED 243 + +#define IDS_START_BK_STEP 256 +#define IDS_BK_STEP_DESC 257 +#define IDS_CONFIG_ERROR 258 +#define IDS_CREATE_PARTITION_ERROR 259 +#define IDS_REMOVE_PARTITION_ERROR 260 +#define IDS_READ_PARTITIONS_ERROR 261 +#define IDS_CELLSERVDB_UPDATE_PROBLEM 262 +#define IDS_GET_PARTITION_LIST_ERROR 263 +#define IDS_EXPORTED 264 +#define IDS_CANT_DELETE_EXPORTED_PARTITION 265 +#define IDS_CHECK_CONFIG_INFO 266 +#define IDS_ERROR_CFG_HOST_CLOSE 267 +#define IDS_FAILED_OPEN_CELL 268 +#define IDS_FAILED_OPEN_NULL_CELL 269 +#define IDS_CREATE_ROOT_VOLUMES_IF_NECESSARY_PROMPT 270 +#define IDS_REP_ROOT_VOLUMES_IF_NECESSARY_PROMPT 271 + +#define IDS_TRANSARC_AFS_SERVER 272 +#define IDS_CANT_INIT_ADMIN_LIBS 273 +#define IDS_CANT_OPEN_LOG_FILE 274 +#define IDS_NEED_CLIENT_INFO 275 +#define IDS_NEED_SERVER_INFO 276 +#define IDS_ADVANCED_OPEN 277 +#define IDS_ADVANCED_CLOSED 278 +#define IDS_BOS_OPEN_FAILED 279 +#define IDS_SALVAGE_ERROR 280 +#define IDS_INVALID_NUM_SALVAGE_PROCESSSES 281 +#define IDS_WRONG_CELL 282 +#define IDS_CELLSERVDB_UPDATE_ERRORS_ARE_IN_LOG_FILE 283 +#define IDS_GET_CREDENTIALS_STEP 284 +#define IDS_MUST_ENTER_SCS_NAME 285 +#define IDS_NOT_SAME_CELL 286 +#define IDS_LAST_DB_SERVER 287 + +#define IDS_BAD_PW 288 +#define IDS_ERROR_CLIENT_VERSION 289 +#define IDS_CANT_MAP_ROOT_AFS 290 +#define IDS_NO_MSG_STEP 291 + +#define IDS_PARTITION_NAME_VALIDATION_TYPE 304 +#define IDS_VOLUME_NAME_VALIDATION_TYPE 305 +#define IDS_NUM_SALVAGE_PROCS_VALIDATION_TYPE 306 +#define IDS_PATH_NAME_VALIDATION_TYPE 307 +#define IDS_FILE_NAME_VALIDATION_TYPE 308 +#define IDS_GENERIC_VALIDATION_TYPE 309 + #define IDI_APP_ICON 100 #define IDD_WIZARD 101 -#define IDS_CFG_TOOL_APP_TITLE 101 -#define IDS_BK_PAGE 102 -#define IDS_ROOT_AFS_PAGE 103 -#define IDB_GRAPHIC_256 104 -#define IDS_NAME 104 -#define IDS_REP_PAGE 105 -#define IDI_FOLDER 106 -#define IDB_GRAPHIC_16 107 -#define IDS_SC_PAGE 108 -#define IDI_FILE 109 -#define IDD_INITIAL_CONFIG 110 -#define IDS_CONFIG_PAGE 111 -#define IDD_PARTITION_PAGE 112 -#define IDS_PARTITION_PAGE 113 -#define IDI_UPSERVER 114 -#define IDD_DB_SERVER_PAGE 115 -#define IDS_GRAPHIC_FONT 116 -#define IDS_CURRENT_STEP 118 -#define IDD_ROOT_VOLUMES_PAGE 119 -#define IDD_GET_CURRENT_CONFIG 120 -#define IDS_ADD_TO_CELLSERVDB_STEP 121 -#define IDD_FILE_SERVER_PAGE 122 -#define IDS_RESTART_ALL_DB_SERVERS_STEP 123 -#define IDD_REPLICATION_PAGE 124 -#define IDS_CONFIG_SUCCEEDED_NEED_CELLSERVDB_UPDATE 125 -#define IDD_CONFIG_SERVER_PAGE 126 -#define IDS_SYS_CONTROL_SERVER_ONLY_MSG 127 -#define IDD_INFO_PAGE 128 -#define IDS_DONT_CONFIG_SYS_CONTROL_SERVER_MSG 129 -#define IDS_CLIENT_CELL_WILL_CHANGE 130 -#define IDS_INFO_PAGE2 131 -#define IDS_CONFIG_SUCCEEDED_FIRST_SERVER 132 -#define IDS_CONFIG_SCS 133 -#define IDS_CONFIG_INTO_CELL_MSG 134 -#define IDS_VIEW_LOG 135 -#define IDS_VIEW_LOG_ERROR 136 -#define IDS_ERROR_NO_LOG_FILE 137 -#define IDS_UPDATING_CELLSERVDB_HOST_SUCCEEDED 138 -#define IDS_UPDATING_CELLSERVDB_HOST_FAILED 139 -#define IDS_CELL_NAME_LEN_ERROR 140 -#define IDS_CONFIG_CHECK_FAILED 141 -#define IDS_YES 143 -#define IDS_NO 144 -#define IDD_CREATE_PARTITION 146 -#define IDD_INTRO_PAGE 148 -#define IDS_FREE 149 -#define IDD_BACKUP_SERVER_PAGE 150 -#define IDS_TOTAL 151 -#define IDS_DRIVE2 152 -#define IDD_SYS_CONTROL_PAGE 153 -#define IDS_SERVICE_STATUS 154 -#define IDS_SERVICE 156 -#define IDS_FS_RUNNING 157 -#define IDS_FS_STOPPED 158 -#define IDD_INFO_PAGE2_FIRST_SERVER 159 -#define IDS_DB_RUNNING 160 -#define IDD_INFO_PAGE2_NOT_FIRST_SERVER 161 -#define IDS_DB_STOPPED 162 -#define IDI_DISABLED_DISK_DRIVE 163 -#define IDD_SERVICES_PAGE 164 -#define IDS_BK_RUNNING 165 -#define IDI_DISK_DRIVE 166 -#define IDD_PARTITIONS_PAGE 167 -#define IDS_BK_STOPPED 168 -#define IDD_SERVICES_PAGE1 168 -#define IDS_SC_RUNNING 169 -#define IDI_DISK_DRIVE_WITH_WARNING 169 -#define IDS_SCS_STOPPED 169 -#define IDS_SC_STOPPED 170 -#define IDS_SCC_STOPPED 170 -#define IDI_AFS_DISK_DRIVE 170 -#define IDS_FS_HOW_TO_RUN 171 -#define IDS_FS_HOW_TO_STOP 172 -#define IDS_DB_HOW_TO_RUN 173 -#define IDS_DB_HOW_TO_STOP 174 -#define IDS_BK_HOW_TO_RUN 175 -#define IDS_BK_HOW_TO_STOP 176 -#define IDS_SC_HOW_TO_RUN 177 -#define IDS_SCS_HOW_TO_RUN 177 -#define IDS_SC_HOW_TO_STOP 178 -#define IDS_SCS_HOW_TO_STOP 178 -#define IDS_DB_PARTIAL_CONFIG 179 -#define IDS_DB_DETAILS 180 -#define IDS_BK_DISABLED 181 -#define IDS_BK_ENABLE 182 -#define IDS_SC_DISABLED 183 -#define IDS_SC_ENABLE 184 -#define IDS_FS_WILL_RUN 185 -#define IDS_FS_WILL_STOP 186 -#define IDS_DB_WILL_RUN 187 -#define IDS_DB_WILL_STOP 188 -#define IDS_BK_WILL_RUN 189 -#define IDS_BK_WILL_STOP 190 -#define IDS_SC_WILL_RUN 191 -#define IDS_SCS_WILL_RUN 191 -#define IDS_SC_WILL_STOP 192 -#define IDS_SCS_WILL_STOP 192 -#define IDS_ERROR_DRIVE_ALREADY_HAS_AFS 193 -#define IDD_ADMIN_INFO 193 -#define IDS_VOLUME_HAS_NO_NAME 194 -#define IDD_CONFIG_SERVER 194 -#define IDS_PARTITION_CREATED 195 -#define IDS_PARTITION_EXISTS 196 -#define IDS_SCS_RUNNING 197 -#define IDS_WARNING_DRIVE_HAS_RECYCLE_BIN 198 -#define IDD_CELLSERVDB_ERRORS 198 -#define IDS_SCC_WILL_RUN 199 -#define IDS_SCC_WILL_STOP 200 -#define IDS_SCC_RUNNING 201 -#define IDS_SCC_HOW_TO_RUN 202 -#define IDS_SCC_HOW_TO_STOP 203 -#define IDS_SCS_ENABLE 204 -#define IDS_SCC_ENABLE 205 -#define IDS_UNCONFIG_DB_STEP 206 -#define IDS_UNCONFIG_DB_STEP_DESC 207 -#define IDS_UNCONFIG_DB_AND_BK_STEP 208 -#define IDS_UNCONFIG_DB_AND_BK_STEP_DESC 209 -#define IDS_UNCONFIG_BK_STEP 210 -#define IDS_UNCONFIG_BK_STEP_DESC 211 -#define IDS_UNCONFIG_FS_STEP 212 -#define IDS_UNCONFIG_FS_STEP_DESC 213 -#define IDS_UNCONFIG_SCS_STEP 214 -#define IDS_UNCONFIG_SCS_STEP_DESC 215 -#define IDS_UNCONFIG_SCC_STEP 216 -#define IDS_UNCONFIG_SCC_STEP_DESC 217 -#define IDS_INVALIDATE_CONFIG_INFO_STEP 218 -#define IDS_GET_OTHER_HOSTNAME 219 -#define IDS_CLOSE 220 -#define IDS_CELLSERVDB_UPDATE_ERR_MSG 221 -#define IDS_DELETE_PARTITION_PROMPT 222 -#define IDS_INVALIDATE_CFG_INFO 223 -#define IDS_START_BK_STEP 224 -#define IDS_BK_STEP_DESC 225 -#define IDS_CONFIG_ERROR 226 -#define IDS_CREATE_PARTITION_ERROR 227 -#define IDS_REMOVE_PARTITION_ERROR 228 -#define IDS_READ_PARTITIONS_ERROR 229 -#define IDS_CELLSERVDB_UPDATE_PROBLEM 230 -#define IDS_GET_PARTITION_LIST_ERROR 231 -#define IDS_EXPORTED 232 -#define IDS_CANT_DELETE_EXPORTED_PARTITION 233 -#define IDS_CHECK_CONFIG_INFO 234 -#define IDS_ERROR_CFG_HOST_CLOSE 235 -#define IDS_FAILED_OPEN_CELL 236 -#define IDS_FAILED_OPEN_NULL_CELL 237 -#define IDS_CREATE_ROOT_VOLUMES_IF_NECESSARY_PROMPT 238 -#define IDS_REP_ROOT_VOLUMES_IF_NECESSARY_PROMPT 239 -#define IDS_TRANSARC_AFS_SERVER 240 -#define IDS_CANT_INIT_ADMIN_LIBS 241 -#define IDS_CANT_OPEN_LOG_FILE 242 -#define IDS_NEED_CLIENT_INFO 243 -#define IDS_NEED_SERVER_INFO 244 -#define IDD_SALVAGE 244 -#define IDS_ADVANCED_OPEN 245 -#define IDD_SALVAGE1 245 -#define IDS_ADVANCED_CLOSED 246 -#define IDS_BOS_OPEN_FAILED 247 -#define IDS_SALVAGE_ERROR 248 -#define IDS_INVALID_NUM_SALVAGE_PROCESSSES 249 -#define IDS_WRONG_CELL 250 -#define IDS_CELLSERVDB_UPDATE_ERRORS_ARE_IN_LOG_FILE 251 -#define IDS_GET_CREDENTIALS_STEP 252 -#define IDS_MUST_ENTER_SCS_NAME 253 -#define IDS_NOT_SAME_CELL 254 -#define IDS_LAST_DB_SERVER 255 -#define IDS_CELL_IS_GONE_MUST_EXIT 256 -#define IDS_CFG_MAN_CANT_CONTINUE 257 -#define IDS_CONFIG_INFO_INVALIDATED 258 -#define IDS_GET_TOKENS_FAILED 259 -#define IDD_GET_PW 259 -#define IDS_BAD_PW 300 -#define IDS_ERROR_CLIENT_VERSION 301 -#define IDS_CANT_MAP_ROOT_AFS 302 -#define IDS_NO_MSG_STEP 303 -#define IDS_STOP_CLIENT_STEP 304 -#define IDS_ERROR_LOCAL_HOST_NAME 305 -#define IDS_GET_TOKENS_ERROR 306 -#define IDS_CANT_SALVAGE_WHEN_FS_NOT_CONFIGURED 307 -#define IDD_SALVAGE_RESULTS 308 -#define IDS_SALVAGING 308 -#define IDS_CURRENT_SALVAGE_LOG 309 -#define IDS_FINAL_SALVAGE_LOG 310 -#define IDS_SALVAGE_COMPLETE 311 -#define IDS_CANT_GET_SALVAGE_LOG 312 -#define IDS_ERROR_SAVING_SALVAGE_LOG_TO_DISK 313 -#define IDS_VALIDATION_ERROR_TEMPLATE 314 -#define IDS_CELL_NAME_VALIDATION_TYPE 315 -#define IDS_SERVER_NAME_VALIDATION_TYPE 316 -#define IDS_PASSWORD_VALIDATION_TYPE 317 -#define IDS_UID_VALIDATION_TYPE 318 -#define IDS_USER_NAME_VALIDATION_TYPE 319 -#define IDS_PARTITION_NAME_VALIDATION_TYPE 320 -#define IDS_VOLUME_NAME_VALIDATION_TYPE 321 -#define IDS_NUM_SALVAGE_PROCS_VALIDATION_TYPE 322 -#define IDS_PATH_NAME_VALIDATION_TYPE 323 -#define IDS_FILE_NAME_VALIDATION_TYPE 324 -#define IDS_GENERIC_VALIDATION_TYPE 325 -#define IDC_OPERATION 900 -#define IDC_PROGRESS 901 -#define IDC_OPERATION2 902 +#define IDB_GRAPHIC_256 102 +#define IDI_FOLDER 103 +#define IDB_GRAPHIC_16 104 +#define IDI_FILE 105 +#define IDD_INITIAL_CONFIG 106 +#define IDD_PARTITION_PAGE 107 +#define IDI_UPSERVER 108 +#define IDD_DB_SERVER_PAGE 109 +#define IDD_ROOT_VOLUMES_PAGE 110 +#define IDD_GET_CURRENT_CONFIG 111 +#define IDD_FILE_SERVER_PAGE 112 +#define IDD_REPLICATION_PAGE 113 +#define IDD_CONFIG_SERVER_PAGE 114 +#define IDD_INFO_PAGE 115 +#define IDD_CREATE_PARTITION 116 +#define IDD_INTRO_PAGE 117 +#define IDD_BACKUP_SERVER_PAGE 118 +#define IDD_SYS_CONTROL_PAGE 119 +#define IDD_INFO_PAGE2_FIRST_SERVER 120 +#define IDD_INFO_PAGE2_NOT_FIRST_SERVER 121 +#define IDI_DISABLED_DISK_DRIVE 122 +#define IDD_SERVICES_PAGE 123 +#define IDI_DISK_DRIVE 124 +#define IDD_PARTITIONS_PAGE 125 +#define IDD_SERVICES_PAGE1 126 +#define IDI_DISK_DRIVE_WITH_WARNING 127 +#define IDI_AFS_DISK_DRIVE 128 +#define IDD_ADMIN_INFO 129 +#define IDD_CONFIG_SERVER 130 +#define IDD_CELLSERVDB_ERRORS 131 +#define IDD_SALVAGE 132 +#define IDD_SALVAGE1 133 +#define IDD_GET_PW 134 +#define IDD_SALVAGE_RESULTS 135 + +#define IDC_OPERATION 836 +#define IDC_PROGRESS 837 +#define IDC_OPERATION2 838 #define IDNEXT 1001 #define IDC_CREATE_PARTITIONS 1002 #define IDBACK 1003 diff --git a/src/WINNT/afssvrcfg/salvage_dlg.cpp b/src/WINNT/afssvrcfg/salvage_dlg.cpp index 3352acf9a..4b30e1362 100644 --- a/src/WINNT/afssvrcfg/salvage_dlg.cpp +++ b/src/WINNT/afssvrcfg/salvage_dlg.cpp @@ -50,7 +50,6 @@ static int nNumProcesses; * */ static void OnInitDialog(HWND hwndDlg); -static void CheckEnableButtons(); static void OnAdvanced(); static void UpdateControls(); static BOOL OnSalvage(); diff --git a/src/WINNT/afssvrcfg/salvage_results_dlg.cpp b/src/WINNT/afssvrcfg/salvage_results_dlg.cpp index 615feb525..41e983917 100644 --- a/src/WINNT/afssvrcfg/salvage_results_dlg.cpp +++ b/src/WINNT/afssvrcfg/salvage_results_dlg.cpp @@ -29,10 +29,10 @@ static const int EDIT_CONTROL_MAX_CHARS = 64000; // Max chars an static const char *SALVAGE_LOG_FILE_NAME = "SalvageLog.txt"; static rwWindowData arwDialog[] = { - { IDC_LOG, raSizeX | raSizeY, MAKELONG(350, 150) }, - { IDC_CLOSE, raMoveX | raMoveY }, - { 9, raMoveX | raMoveY }, - { idENDLIST, 0 } + { IDC_LOG, raSizeX | raSizeY, MAKELONG(350, 150), 0 }, + { IDC_CLOSE, raMoveX | raMoveY, 0, 0 }, + { 9, raMoveX | raMoveY, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/afssvrcfg/services_page.cpp b/src/WINNT/afssvrcfg/services_page.cpp index 6dbe35540..091ca903d 100644 --- a/src/WINNT/afssvrcfg/services_page.cpp +++ b/src/WINNT/afssvrcfg/services_page.cpp @@ -70,7 +70,7 @@ static void CheckEnableSc(); static void EnableScMachine(BOOL bEnable = TRUE); static void OnScMachineChange(); static void CheckEnableBak(); -static void PrepareToConfig(CONFIG_STATE& state, BOOL bRunning, BOOL bOn); +static BOOL PrepareToConfig(CONFIG_STATE& state, BOOL bRunning, BOOL bOn, UINT uiCtrlID); static BOOL PrepareToConfig(); static void CheckEnableApply(); diff --git a/src/WINNT/afssvrcfg/validation.cpp b/src/WINNT/afssvrcfg/validation.cpp index add51a8d1..0bfb75a19 100644 --- a/src/WINNT/afssvrcfg/validation.cpp +++ b/src/WINNT/afssvrcfg/validation.cpp @@ -8,137 +8,133 @@ */ /* - * INCLUDES _________________________________________________________________ - * - */ -#include "afscfg.h" -#include "resource.h" -#include "validation.h" - - -/* - * DEFINITIONS _________________________________________________________________ - * - */ - - -/* - * PROTOTYPES _________________________________________________________________ - * - */ -BOOL Validation_IsValid(TCHAR *pszInput, VALIDATION_TYPE type, BOOL bShowError); - -static BOOL CheckAfsPartitionName(TCHAR *pszInput, int &nErrorMsgResID); -static BOOL CheckAfsCellName(TCHAR *pszInput, int &nErrorMsgResID); -static BOOL CheckAfsPassword(TCHAR *pszInput, int &nErrorMsgResID); -static BOOL CheckAfsUid(TCHAR *pszInput, int &nErrorMsgResID); -static BOOL CheckAfsServerName(TCHAR *pszInput, int &nErrorMsgResID); -static BOOL CheckFileName(TCHAR *pszInput, int &nErrorMsgResID); -static BOOL CheckPath(TCHAR *pszInput, int &nErrorMsgResID); -static void ShowError(int nErrorMsgResID); - - -/* - * EXPORTED FUNCTIONS _________________________________________________________________ - * - */ -BOOL Validation_IsValid(TCHAR *pszInput, VALIDATION_TYPE type, BOOL bShowError) -{ - BOOL bValid; - int nErrorMsgResID; - - switch (type) { - case VALID_AFS_PARTITION_NAME: bValid = CheckAfsPartitionName(pszInput, nErrorMsgResID); - break; - - case VALID_AFS_CELL_NAME: bValid = CheckAfsCellName(pszInput, nErrorMsgResID); - break; - - case VALID_AFS_PASSWORD: bValid = CheckAfsPassword(pszInput, nErrorMsgResID); - break; - - case VALID_AFS_UID: bValid = CheckAfsUid(pszInput, nErrorMsgResID); - break; - - case VALID_AFS_SERVER_NAME: bValid = CheckAfsServerName(pszInput, nErrorMsgResID); - break; - - default: nErrorMsgResID = 0; - ASSERT(FALSE); - return FALSE; - } - - if (!bValid && bShowError) - ShowError(nErrorMsgResID); - - return bValid; -} - - - -/* - * STATIC FUNCTIONS _________________________________________________________________ - * - */ - - /* - * Utility Functions _________________________________________________________________ - * - */ -static BOOL CheckAfsPartitionName(TCHAR *pszPartitionName, int &nErrorMsgResID) -{ - short bIsValid; - afs_status_t nStatus; - - char *pszName = new char[strlen("/vicpe") + lstrlen(pszPartitionName) + 1]; - if (!pszName) { - ASSERT(FALSE); - return TRUE; - } - - strcpy(pszName, "/vicep"); - strcat(pszName, S2A(pszPartitionName)); - - int nResult = cfg_HostPartitionNameValid(pszName, &bIsValid, &nStatus); - ASSERT(nResult); - - if (!bIsValid) - nErrorMsgResID = IDS_PARTITION_NAME_VALIDATION_TYPE; - - delete pszName; - - return bIsValid; -} - -static BOOL CheckAfsCellName(TCHAR *pszInput, int &nErrorMsgResID) -{ - nErrorMsgResID = 0; - - return TRUE; -} - -static BOOL CheckAfsPassword(TCHAR *pszInput, int &nErrorMsgResID) -{ - nErrorMsgResID = 0; - - return TRUE; -} - -static BOOL CheckAfsUid(TCHAR *pszInput, int &nErrorMsgResID) -{ - nErrorMsgResID = 0; - - return TRUE; -} - -static BOOL CheckAfsServerName(TCHAR *pszInput, int &nErrorMsgResID) -{ - nErrorMsgResID = 0; - - return TRUE; -} - -static void ShowError(int nErrorMsgResID) -{ - Message(MB_ICONSTOP | MB_OK, GetAppTitleID(), IDS_VALIDATION_ERROR_TEMPLATE, TEXT("%m%m"), nErrorMsgResID, nErrorMsgResID); -} +* INCLUDES _________________________________________________________________ +* +*/ +#include "afscfg.h" +#include "resource.h" +#include "validation.h" + + +/* + * DEFINITIONS _________________________________________________________________ + * + */ + + +/* + * PROTOTYPES _________________________________________________________________ + * + */ +static BOOL CheckAfsPartitionName(TCHAR *pszInput, int &nErrorMsgResID); +static BOOL CheckAfsCellName(TCHAR *pszInput, int &nErrorMsgResID); +static BOOL CheckAfsPassword(TCHAR *pszInput, int &nErrorMsgResID); +static BOOL CheckAfsUid(TCHAR *pszInput, int &nErrorMsgResID); +static BOOL CheckAfsServerName(TCHAR *pszInput, int &nErrorMsgResID); +static void ShowError(int nErrorMsgResID); + + +/* + * EXPORTED FUNCTIONS _________________________________________________________________ + * + */ +BOOL Validation_IsValid(TCHAR *pszInput, VALIDATION_TYPE type, BOOL bShowError) +{ + BOOL bValid; + int nErrorMsgResID; + + switch (type) { + case VALID_AFS_PARTITION_NAME: bValid = CheckAfsPartitionName(pszInput, nErrorMsgResID); + break; + + case VALID_AFS_CELL_NAME: bValid = CheckAfsCellName(pszInput, nErrorMsgResID); + break; + + case VALID_AFS_PASSWORD: bValid = CheckAfsPassword(pszInput, nErrorMsgResID); + break; + + case VALID_AFS_UID: bValid = CheckAfsUid(pszInput, nErrorMsgResID); + break; + + case VALID_AFS_SERVER_NAME: bValid = CheckAfsServerName(pszInput, nErrorMsgResID); + break; + + default: nErrorMsgResID = 0; + ASSERT(FALSE); + return FALSE; + } + + if (!bValid && bShowError) + ShowError(nErrorMsgResID); + + return bValid; +} + + + +/* + * STATIC FUNCTIONS _________________________________________________________________ + * + */ + + /* + * Utility Functions _________________________________________________________________ + * + */ +static BOOL CheckAfsPartitionName(TCHAR *pszPartitionName, int &nErrorMsgResID) +{ + short bIsValid; + afs_status_t nStatus; + + char *pszName = new char[strlen("/vicpe") + lstrlen(pszPartitionName) + 1]; + if (!pszName) { + ASSERT(FALSE); + return TRUE; + } + + strcpy(pszName, "/vicep"); + strcat(pszName, S2A(pszPartitionName)); + + int nResult = cfg_HostPartitionNameValid(pszName, &bIsValid, &nStatus); + ASSERT(nResult); + + if (!bIsValid) + nErrorMsgResID = IDS_PARTITION_NAME_VALIDATION_TYPE; + + delete pszName; + + return bIsValid; +} + +static BOOL CheckAfsCellName(TCHAR *pszInput, int &nErrorMsgResID) +{ + nErrorMsgResID = 0; + + return TRUE; +} + +static BOOL CheckAfsPassword(TCHAR *pszInput, int &nErrorMsgResID) +{ + nErrorMsgResID = 0; + + return TRUE; +} + +static BOOL CheckAfsUid(TCHAR *pszInput, int &nErrorMsgResID) +{ + nErrorMsgResID = 0; + + return TRUE; +} + +static BOOL CheckAfsServerName(TCHAR *pszInput, int &nErrorMsgResID) +{ + nErrorMsgResID = 0; + + return TRUE; +} + +static void ShowError(int nErrorMsgResID) +{ + Message(MB_ICONSTOP | MB_OK, GetAppTitleID(), IDS_VALIDATION_ERROR_TEMPLATE, TEXT("%m%m"), nErrorMsgResID, nErrorMsgResID); +} diff --git a/src/WINNT/afssvrcfg/validation.h b/src/WINNT/afssvrcfg/validation.h index 0be954eb1..1621763fc 100644 --- a/src/WINNT/afssvrcfg/validation.h +++ b/src/WINNT/afssvrcfg/validation.h @@ -7,22 +7,21 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#ifndef _VALIDATION_H_ -#define _VALIDATION_H_ - - -enum VALIDATION_TYPE { - VALID_AFS_PARTITION_NAME, - VALID_AFS_CELL_NAME, - VALID_AFS_PASSWORD, - VALID_AFS_UID, - VALID_AFS_SERVER_NAME, - VALID_FILENAME, - VALID_PATH -}; - - -BOOL Validation_IsValid(TCHAR *pszInput, VALIDATION_TYPE type, BOOL bShowErorr = TRUE); - -#endif // _VALIDATION_H_ - +#ifndef _VALIDATION_H_ +#define _VALIDATION_H_ + + +enum VALIDATION_TYPE { + VALID_AFS_PARTITION_NAME, + VALID_AFS_CELL_NAME, + VALID_AFS_PASSWORD, + VALID_AFS_UID, + VALID_AFS_SERVER_NAME, + VALID_FILENAME, + VALID_PATH +}; + + +BOOL Validation_IsValid(TCHAR *pszInput, VALIDATION_TYPE type, BOOL bShowErorr = TRUE); + +#endif // _VALIDATION_H_ diff --git a/src/WINNT/afssvrcfg/volume_utils.cpp b/src/WINNT/afssvrcfg/volume_utils.cpp index 83b4c546f..039176a38 100644 --- a/src/WINNT/afssvrcfg/volume_utils.cpp +++ b/src/WINNT/afssvrcfg/volume_utils.cpp @@ -29,7 +29,7 @@ extern "C" { */ static HWND m_hDriveList = 0; -static const UINT MAX_DRIVES = 26; +//static const UINT MAX_DRIVES = 26; static const UINT DISK_DRIVE_IMAGE = 0; static const UINT DISABLED_DISK_DRIVE_IMAGE = 1; static const UINT DISK_DRIVE_WITH_WARNING_IMAGE = 2; diff --git a/src/WINNT/afssvrcpa/NTMakefile b/src/WINNT/afssvrcpa/NTMakefile index bfc41bcd6..487e7b215 100644 --- a/src/WINNT/afssvrcpa/NTMakefile +++ b/src/WINNT/afssvrcpa/NTMakefile @@ -5,19 +5,19 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=WINNT\afssvrcpa !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version - ############################################################################ # Definitions for building a DLL. DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\afsserver.cpl DLLOBJS =\ - afssvrcpa_stub.res \ - cpl_interface.obj \ - AFS_component_version_number.obj + $(OUT)\cpl_interface.obj \ + $(OUT)\AFS_component_version_number.obj \ + $(OUT)\afssvrcpa_stub.res DLLLIBS =\ $(DESTDIR)\lib\afs\afsreg.lib \ @@ -34,9 +34,7 @@ $(DLLFILE): $(DLLOBJS) ############################################################################ # Definitions for generating versioninfo resource via RC -afssvrcpa_stub.res: afssvrcpa_stub.rc AFS_component_version_number.h - $(RC) $*.rc - +$(OUT)\afssvrcpa_stub.res: afssvrcpa_stub.rc AFS_component_version_number.h ############################################################################ # Install target; primary makefile target @@ -49,7 +47,7 @@ install: $(DLLFILE) lang lang:: $(CD) lang - for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install + for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /e /f NTMakefile install $(CD) .. @@ -58,3 +56,10 @@ lang:: clean:: + +mkdir: + -mkdir $(OUT)\lang + cd lang + nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir + cd .. + diff --git a/src/WINNT/afssvrcpa/lang/NTMakefile b/src/WINNT/afssvrcpa/lang/NTMakefile index 46ae826af..d3c9c18b0 100644 --- a/src/WINNT/afssvrcpa/lang/NTMakefile +++ b/src/WINNT/afssvrcpa/lang/NTMakefile @@ -10,7 +10,7 @@ AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include -I.. # include the primary makefile - +RELDIR=WINNT\afssvrcpa\lang !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\..\config\NTMakefile.version @@ -35,7 +35,7 @@ DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\afsserver_$(LANGID).dll RCFILE = $(LANGNAME)\afssvrcpa.rc -RESFILE = afssvrcpa_$(LANGID).res +RESFILE = $(OUT)\afssvrcpa_$(LANGID).res DLLOBJS = $(RESFILE) @@ -48,7 +48,8 @@ $(DLLFILE) : $(DLLOBJS) install : $(DLLFILE) clean :: - @if exist *.res del *.res + @if exist $(OUT)\*.res del $(OUT)\*.res + @if exist AFS_component_version_number.h del AFS_component_version_number.h @if exist RC*. del RC*. @if exist RD*. del RD*. @@ -60,3 +61,6 @@ clean :: $(RESFILE) : $(RCFILE) AFS_component_version_number.h $(RC) /fo$(RESFILE) /c$(LANGCP) $(RCFILE) + +mkdir: + diff --git a/src/WINNT/afssvrcpa/resource.h b/src/WINNT/afssvrcpa/resource.h index 200352182..03a8fe2ec 100644 --- a/src/WINNT/afssvrcpa/resource.h +++ b/src/WINNT/afssvrcpa/resource.h @@ -7,8 +7,9 @@ * directory or online at http://www.openafs.org/dl/license10.html */ +#define IDS_ERROR_LOADING_ICON 0 +#define IDS_CPA_TITLE 1 +#define IDS_EXECUTION_ERROR 2 +#define IDS_APP_NAME 3 + #define IDI_AFSD 103 -#define IDS_ERROR_LOADING_ICON 104 -#define IDS_CPA_TITLE 105 -#define IDS_EXECUTION_ERROR 106 -#define IDS_APP_NAME 107 diff --git a/src/WINNT/afssvrmgr/NTMakefile b/src/WINNT/afssvrmgr/NTMakefile index d91c14051..97619e3e5 100644 --- a/src/WINNT/afssvrmgr/NTMakefile +++ b/src/WINNT/afssvrmgr/NTMakefile @@ -14,7 +14,7 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -WX AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include # include the primary makefile - +RELDIR=WINNT\afssvrmgr !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version @@ -26,67 +26,67 @@ AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include EXEFILE = $(DESTDIR)\root.server\usr\afs\bin\TaAfsServerManager.exe EXEOBJS = \ - svrmgr_stub.res \ - action.obj \ - agg_col.obj \ - agg_general.obj \ - agg_prop.obj \ - agg_tab.obj \ - alert.obj \ - cmdline.obj \ - columns.obj \ - command.obj \ - creds.obj \ - dispatch.obj \ - dispguts.obj \ - display.obj \ - general.obj \ - helpfunc.obj \ - options.obj \ - prefs.obj \ - problems.obj \ - propcache.obj \ - set_clone.obj \ - set_col.obj \ - set_create.obj \ - set_createrep.obj \ - set_delete.obj \ - set_dump.obj \ - set_general.obj \ - set_move.obj \ - set_prop.obj \ - set_quota.obj \ - set_release.obj \ - set_rename.obj \ - set_repprop.obj \ - set_restore.obj \ - set_tab.obj \ - subset.obj \ - svc_col.obj \ - svc_create.obj \ - svc_delete.obj \ - svc_general.obj \ - svc_prop.obj \ - svc_startstop.obj \ - svc_tab.obj \ - svc_viewlog.obj \ - svr_address.obj \ - svr_col.obj \ - svr_execute.obj \ - svr_general.obj \ - svr_getdates.obj \ - svr_hosts.obj \ - svr_install.obj \ - svr_prop.obj \ - svr_prune.obj \ - svr_salvage.obj \ - svr_security.obj \ - svr_syncvldb.obj \ - svr_uninstall.obj \ - svr_window.obj \ - svrmgr.obj \ - task.obj \ - window.obj + $(OUT)\svrmgr_stub.res \ + $(OUT)\action.obj \ + $(OUT)\agg_col.obj \ + $(OUT)\agg_general.obj \ + $(OUT)\agg_prop.obj \ + $(OUT)\agg_tab.obj \ + $(OUT)\alert.obj \ + $(OUT)\cmdline.obj \ + $(OUT)\columns.obj \ + $(OUT)\command.obj \ + $(OUT)\creds.obj \ + $(OUT)\dispatch.obj \ + $(OUT)\dispguts.obj \ + $(OUT)\display.obj \ + $(OUT)\general.obj \ + $(OUT)\helpfunc.obj \ + $(OUT)\options.obj \ + $(OUT)\prefs.obj \ + $(OUT)\problems.obj \ + $(OUT)\propcache.obj \ + $(OUT)\set_clone.obj \ + $(OUT)\set_col.obj \ + $(OUT)\set_create.obj \ + $(OUT)\set_createrep.obj \ + $(OUT)\set_delete.obj \ + $(OUT)\set_dump.obj \ + $(OUT)\set_general.obj \ + $(OUT)\set_move.obj \ + $(OUT)\set_prop.obj \ + $(OUT)\set_quota.obj \ + $(OUT)\set_release.obj \ + $(OUT)\set_rename.obj \ + $(OUT)\set_repprop.obj \ + $(OUT)\set_restore.obj \ + $(OUT)\set_tab.obj \ + $(OUT)\subset.obj \ + $(OUT)\svc_col.obj \ + $(OUT)\svc_create.obj \ + $(OUT)\svc_delete.obj \ + $(OUT)\svc_general.obj \ + $(OUT)\svc_prop.obj \ + $(OUT)\svc_startstop.obj \ + $(OUT)\svc_tab.obj \ + $(OUT)\svc_viewlog.obj \ + $(OUT)\svr_address.obj \ + $(OUT)\svr_col.obj \ + $(OUT)\svr_execute.obj \ + $(OUT)\svr_general.obj \ + $(OUT)\svr_getdates.obj \ + $(OUT)\svr_hosts.obj \ + $(OUT)\svr_install.obj \ + $(OUT)\svr_prop.obj \ + $(OUT)\svr_prune.obj \ + $(OUT)\svr_salvage.obj \ + $(OUT)\svr_security.obj \ + $(OUT)\svr_syncvldb.obj \ + $(OUT)\svr_uninstall.obj \ + $(OUT)\svr_window.obj \ + $(OUT)\svrmgr.obj \ + $(OUT)\task.obj \ + $(OUT)\window.obj VCLIBS =\ comctl32.lib \ @@ -114,5 +114,11 @@ install : $(EXEFILE) lang # Dependencies # -svrmgr_stub.res : svrmgr_stub.rc AFS_component_version_number.h +$(OUT)\svrmgr_stub.res : AFS_component_version_number.h +mkdir: + -mkdir $(OUT)\lang + cd lang + nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir + cd .. + diff --git a/src/WINNT/afssvrmgr/action.cpp b/src/WINNT/afssvrmgr/action.cpp index 560818ebd..4f9301721 100644 --- a/src/WINNT/afssvrmgr/action.cpp +++ b/src/WINNT/afssvrmgr/action.cpp @@ -118,9 +118,9 @@ static struct l } l; rwWindowData awdActions[] = { - { IDC_ACTION_DESC, raSizeX | raRepaint }, - { IDC_ACTION_LIST, raSizeX | raSizeY, MAKELONG(cxMIN_ACTION,cyMIN_ACTION) }, - { idENDLIST, 0 } + { IDC_ACTION_DESC, raSizeX | raRepaint, 0, 0 }, + { IDC_ACTION_LIST, raSizeX | raSizeY, MAKELONG(cxMIN_ACTION,cyMIN_ACTION), 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/afssvrmgr/agg_tab.cpp b/src/WINNT/afssvrmgr/agg_tab.cpp index 290709f56..a4ac9150d 100644 --- a/src/WINNT/afssvrmgr/agg_tab.cpp +++ b/src/WINNT/afssvrmgr/agg_tab.cpp @@ -27,10 +27,10 @@ extern "C" { */ rwWindowData awdAggregates[] = { - { IDC_AGG_DESC, raSizeX }, - { IDC_AGG_LIST, raSizeX | raSizeY }, - { IDC_AGG_CREATESET, raMoveX | raMoveY }, - { idENDLIST, 0 } + { IDC_AGG_DESC, raSizeX, 0, 0 }, + { IDC_AGG_LIST, raSizeX | raSizeY, 0, 0 }, + { IDC_AGG_CREATESET, raMoveX | raMoveY, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/afssvrmgr/alert.cpp b/src/WINNT/afssvrmgr/alert.cpp index db8a1256c..597db4cca 100644 --- a/src/WINNT/afssvrmgr/alert.cpp +++ b/src/WINNT/afssvrmgr/alert.cpp @@ -357,7 +357,6 @@ void Alert_Scout_ServerStatus (LPIDENT lpi, ULONG status) lpoa->nAlerts ++; lpoa->aAlerts[ iInsert ].alert = alertTIMEOUT; lpoa->aAlerts[ iInsert ].aiTIMEOUT.status = status; - lpoa->aAlerts[ iInsert ].aiTIMEOUT.stLastAttempt; GetSystemTime (&lpoa->aAlerts[ iInsert ].aiTIMEOUT.stLastAttempt); fChanged = TRUE; @@ -713,7 +712,7 @@ BOOL Alert_StartScout (ULONG *pStatus) { if (hScout == 0) // create scout? { - heScoutWakeup = CreateEvent (NULL, FALSE, FALSE, NULL); + heScoutWakeup = CreateEvent (NULL, FALSE, FALSE, TEXT("AfsSvrMgr Alert Scout Wakeup")); DWORD dwThreadID; if ((hScout = CreateThread (NULL, 0, diff --git a/src/WINNT/afssvrmgr/cmdline.cpp b/src/WINNT/afssvrmgr/cmdline.cpp index 229302768..287250ba3 100644 --- a/src/WINNT/afssvrmgr/cmdline.cpp +++ b/src/WINNT/afssvrmgr/cmdline.cpp @@ -43,15 +43,15 @@ static struct { BOOL fPresent; TCHAR szValue[ cchRESOURCE ]; } aSWITCHES[] = { - { TEXT("cell"), TRUE }, - { TEXT("subset"), TRUE }, - { TEXT("server"), TRUE }, - { TEXT("reset"), FALSE }, - { TEXT("confirm"), FALSE }, - { TEXT("user"), TRUE }, - { TEXT("password"), TRUE }, - { TEXT("lookup"), FALSE }, - { TEXT("useexisting"), FALSE } + { TEXT("cell"), TRUE, FALSE, TEXT("") }, + { TEXT("subset"), TRUE, FALSE, TEXT("") }, + { TEXT("server"), TRUE, FALSE, TEXT("") }, + { TEXT("reset"), FALSE, FALSE, TEXT("") }, + { TEXT("confirm"), FALSE, FALSE, TEXT("") }, + { TEXT("user"), TRUE, FALSE, TEXT("") }, + { TEXT("password"), TRUE, FALSE, TEXT("") }, + { TEXT("lookup"), FALSE, FALSE, TEXT("") }, + { TEXT("useexisting"), FALSE, FALSE, TEXT("") } }; #define nSWITCHES (sizeof(aSWITCHES) / sizeof(aSWITCHES[0])) @@ -245,7 +245,7 @@ CMDLINEOP ParseCommandLine (LPTSTR pszCmdLine) ULONG status; if (!AfsAppLib_SetCredentials (pszCell, aSWITCHES[ swUSER ].szValue, aSWITCHES[ swPASSWORD ].szValue, &status)) { - ImmediateErrorDialog (status, IDS_ERROR_BAD_CREDENTIALS); + ImmediateErrorDialog (status, IDS_SVR_ERROR_BAD_CREDENTIALS); return opCLOSEAPP; } } diff --git a/src/WINNT/afssvrmgr/columns.cpp b/src/WINNT/afssvrmgr/columns.cpp index 8ae99105c..50a1c4feb 100644 --- a/src/WINNT/afssvrmgr/columns.cpp +++ b/src/WINNT/afssvrmgr/columns.cpp @@ -62,14 +62,14 @@ static struct } COLUMNS[] = { - { IDS_COL_SERVERS, FALSE }, // ceSERVERS - { IDS_COL_FILESETS, FALSE }, // ceFILESETS - { IDS_COL_AGGREGATES, FALSE }, // ceAGGREGATES - { IDS_COL_SERVICES, FALSE }, // ceSERVICES - { IDS_COL_REPLICAS, FALSE }, // ceREPLICAS - { IDS_COL_AGGS_MOVE, TRUE }, // ceAGG_MOVE - { IDS_COL_AGGS_CREATE, TRUE }, // ceAGG_CREATE - { IDS_COL_AGGS_RESTORE, TRUE } // ceAGG_RESTORE + { IDS_COL_SERVERS, FALSE, {0}, FALSE }, // ceSERVERS + { IDS_COL_FILESETS, FALSE, {0}, FALSE }, // ceFILESETS + { IDS_COL_AGGREGATES, FALSE, {0}, FALSE }, // ceAGGREGATES + { IDS_COL_SERVICES, FALSE, {0}, FALSE }, // ceSERVICES + { IDS_COL_REPLICAS, FALSE, {0}, FALSE }, // ceREPLICAS + { IDS_COL_AGGS_MOVE, TRUE, {0}, FALSE }, // ceAGG_MOVE + { IDS_COL_AGGS_CREATE, TRUE, {0}, FALSE }, // ceAGG_CREATE + { IDS_COL_AGGS_RESTORE, TRUE, {0}, FALSE } // ceAGG_RESTORE }; #define nCOLUMNS (sizeof(COLUMNS)/sizeof(COLUMNS[0])) diff --git a/src/WINNT/afssvrmgr/creds.cpp b/src/WINNT/afssvrmgr/creds.cpp index 1647d42ad..0ad004e5f 100644 --- a/src/WINNT/afssvrmgr/creds.cpp +++ b/src/WINNT/afssvrmgr/creds.cpp @@ -94,7 +94,7 @@ void OpenCellDlg_Hook_OnOK (HWND hDlg, LPOPENCELLDLG_PARAMS lpp) ULONG status; if ((lpp->hCreds = AfsAppLib_SetCredentials (lpp->szCell, szUser, szPassword, &status)) == NULL) { - ErrorDialog (status, IDS_ERROR_BAD_CREDENTIALS); + ErrorDialog (status, IDS_SVR_ERROR_BAD_CREDENTIALS); } else { diff --git a/src/WINNT/afssvrmgr/dispguts.cpp b/src/WINNT/afssvrmgr/dispguts.cpp index 35db7adb9..dae9a3760 100644 --- a/src/WINNT/afssvrmgr/dispguts.cpp +++ b/src/WINNT/afssvrmgr/dispguts.cpp @@ -118,8 +118,8 @@ void Display_Servers_Internal (LPDISPLAYREQUEST pdr) // Add an entry in the Servers list for each server in the cell. // - LPIDENT lpiSelStart = (LPIDENT)FL_GetSelectedData (pdr->hList); - BOOL fRefresh = FALSE; +// LPIDENT lpiSelStart = (LPIDENT)FL_GetSelectedData (pdr->hList); +// BOOL fRefresh = FALSE; LPCELL lpCell; if (!g.lpiCell || !(lpCell = g.lpiCell->OpenCell())) diff --git a/src/WINNT/afssvrmgr/lang/NTMakefile b/src/WINNT/afssvrmgr/lang/NTMakefile index 544c20ec0..1d0f2d846 100644 --- a/src/WINNT/afssvrmgr/lang/NTMakefile +++ b/src/WINNT/afssvrmgr/lang/NTMakefile @@ -10,7 +10,7 @@ AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include -I.. # include the primary makefile - +RELDIR=WINNT\afssvrmgr\lang !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\..\config\NTMakefile.version @@ -35,7 +35,7 @@ DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\TaAfsServerManager_$(LANGID).dll RCFILE = $(LANGNAME)\svrmgr.rc -RESFILE = svrmgr_$(LANGID).res +RESFILE = $(OUT)\svrmgr_$(LANGID).res DLLOBJS = $(RESFILE) @@ -48,7 +48,8 @@ $(DLLFILE) : $(DLLOBJS) install : $(DLLFILE) clean :: - @if exist *.res del *.res + @if exist $(OUT)\*.res del $(OUT)\*.res + @if exist AFS_component_version_number.h del AFS_component_version_number.h @if exist RC*. del RC*. @if exist RD*. del RD*. @@ -60,3 +61,6 @@ clean :: $(RESFILE) : $(RCFILE) AFS_component_version_number.h $(RC) /fo$(RESFILE) /c$(LANGCP) $(RCFILE) + +mkdir: + diff --git a/src/WINNT/afssvrmgr/lang/de_DE/svrmgr.rc b/src/WINNT/afssvrmgr/lang/de_DE/svrmgr.rc index 4a957e104..f09fb9be9 100644 --- a/src/WINNT/afssvrmgr/lang/de_DE/svrmgr.rc +++ b/src/WINNT/afssvrmgr/lang/de_DE/svrmgr.rc @@ -7,3027 +7,3027 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "AFS Server Manager" +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "AFS Server Manager" #define AFS_VERINFO_NAME "svrmgr" #define AFS_VERINFO_FILENAME "svrmgr.exe" #define AFS_VERINFO_LANG_CODE 0x407 #define AFS_VERINFO_CHARSET 1252 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_SERVICES, DIALOG - BEGIN - RIGHTMARGIN, 165 - END - - IDD_AGGREGATES, DIALOG - BEGIN - RIGHTMARGIN, 118 - END - - IDD_FILESETS, DIALOG - BEGIN - RIGHTMARGIN, 180 - END - - IDD_SVR_LISTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_AGG_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 262 - TOPMARGIN, 5 - BOTTOMMARGIN, 154 - END - - IDD_SVR_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 183 - END - - IDD_SVR_SCOUT, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 216 - TOPMARGIN, 5 - BOTTOMMARGIN, 153 - END - - IDD_SVC_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 268 - TOPMARGIN, 5 - BOTTOMMARGIN, 209 - END - - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 315 - TOPMARGIN, 2 - BOTTOMMARGIN, 224 - END - - IDD_SERVER, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 207 - TOPMARGIN, 2 - BOTTOMMARGIN, 135 - END - - IDD_SVC_CREATE, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 228 - END - - IDD_SET_REPSITES, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 216 - TOPMARGIN, 5 - BOTTOMMARGIN, 163 - END - - IDD_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 7 - BOTTOMMARGIN, 253 - HORZGUIDE, 160 - END - - IDD_TIMEOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 232 - TOPMARGIN, 7 - BOTTOMMARGIN, 153 - END - - IDD_COLUMNS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 281 - TOPMARGIN, 5 - BOTTOMMARGIN, 143 - END - - IDD_REFRESHALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 68 - END - - IDD_SET_CREATE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 317 - TOPMARGIN, 4 - BOTTOMMARGIN, 205 - END - - IDD_SET_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 98 - END - - IDD_SET_CLONE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 341 - TOPMARGIN, 7 - BOTTOMMARGIN, 81 - END - - IDD_SVC_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 189 - END - - IDD_SVR_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 152 - END - - IDD_AGG_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 252 - TOPMARGIN, 5 - BOTTOMMARGIN, 146 - END - - IDD_SET_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 268 - TOPMARGIN, 5 - BOTTOMMARGIN, 177 - END - - IDD_SET_MOVETO, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 170 - END - - IDD_SET_MOVING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SVC_LOGNAME, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 102 - END - - IDD_SVC_VIEWLOG, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 181 - END - - IDD_SET_SETQUOTA, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 267 - TOPMARGIN, 4 - BOTTOMMARGIN, 126 - END - - IDD_ACTIONS, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 234 - TOPMARGIN, 2 - BOTTOMMARGIN, 56 - END - - IDD_SVR_SYNCVLDB, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 265 - TOPMARGIN, 4 - BOTTOMMARGIN, 95 - END - - IDD_SET_CREATEREP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 167 - END - - IDD_SVR_INSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 163 - END - - IDD_SVR_UNINSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 135 - END - - IDD_SVR_PRUNE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 257 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_SET_RENAME, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 129 - END - - IDD_SVC_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 64 - END - - IDD_SVR_GETDATES, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_GETDATES_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 128 - END - - IDD_SET_DUMP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 291 - TOPMARGIN, 7 - BOTTOMMARGIN, 140 - END - - IDD_SET_RESTORE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 288 - TOPMARGIN, 4 - BOTTOMMARGIN, 244 - END - - IDD_SVC_BOS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_DUMPING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SET_RESTORING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SET_CLONESYS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 300 - TOPMARGIN, 7 - BOTTOMMARGIN, 158 - END - - IDD_SUBSETS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 276 - TOPMARGIN, 5 - BOTTOMMARGIN, 177 - END - - IDD_SUBSET_LOADSAVE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 276 - TOPMARGIN, 4 - BOTTOMMARGIN, 141 - END - - IDD_HELP_FIND, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 214 - TOPMARGIN, 4 - BOTTOMMARGIN, 69 - END - - IDD_HELP_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 214 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_HELP_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 226 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_OPENINGCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 236 - TOPMARGIN, 2 - BOTTOMMARGIN, 41 - END - - IDD_OPTIONS_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 274 - TOPMARGIN, 5 - BOTTOMMARGIN, 131 - END - - IDD_SVR_KEYS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_CREATEKEY, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - END - - IDD_SVC_STARTSTOP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 141 - END - - IDD_SVR_EXECUTE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_SALVAGE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 267 - END - - IDD_SVR_SALVAGE_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 174 - END - - IDD_SET_RELEASE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 297 - TOPMARGIN, 7 - BOTTOMMARGIN, 99 - END - - IDD_SVR_HOSTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_ADDHOST, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 238 - TOPMARGIN, 4 - BOTTOMMARGIN, 102 - END - - IDD_SVR_ADDRESS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 204 - TOPMARGIN, 4 - BOTTOMMARGIN, 111 - END - - IDD_SVR_NEWADDR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 219 - TOPMARGIN, 4 - BOTTOMMARGIN, 65 - END -END -#endif // APSTUDIO_INVOKED - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Server Manager""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_MAIN MENU DISCARDABLE -BEGIN - POPUP "&Zelle" - BEGIN - MENUITEM "Aus&wählen...", M_CELL_OPEN - MENUITEM "&Authentifizierung...", M_CREDENTIALS - MENUITEM SEPARATOR - MENUITEM "E&xit", M_EXIT - END - POPUP "&Anzeige" - BEGIN - POPUP "&Server" - BEGIN - MENUITEM "&Große Symbole", M_SVR_VIEW_LARGE - , CHECKED - MENUITEM "&Kleine Symbole", M_SVR_VIEW_SMALL - , CHECKED - MENUITEM "&Details", M_SVR_VIEW_REPORT - , CHECKED - MENUITEM SEPARATOR - MENUITEM "&Normal", M_SVR_VIEW_ONEICON - , CHECKED - MENUITEM "&Alle Symbole", M_SVR_VIEW_TWOICONS - , CHECKED - MENUITEM "Nur &Status", M_SVR_VIEW_STATUS - , CHECKED - END - POPUP "Schnellansicht-&Teilfenster" - BEGIN - MENUITEM "&Keine", M_DIVIDE_NONE, CHECKED - MENUITEM "&Vertikal teilen", M_DIVIDE_H, CHECKED - MENUITEM "&Horizontal teilen", M_DIVIDE_V, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "Laufende O&perationen", M_ACTIONS, CHECKED - MENUITEM SEPARATOR - MENUITEM "Über&wachte Server...", M_SUBSET - MENUITEM "Spa<en...", M_COLUMNS - MENUITEM "&Optionen...", M_OPTIONS - MENUITEM SEPARATOR - MENUITEM "Alles &aktualisieren", M_REFRESHALL - END - POPUP "&Hilfe" - BEGIN - MENUITEM "&Inhalt", M_HELP - MENUITEM "Befehl &suchen...", M_HELP_FIND - MENUITEM "&Fehlercode suchen...", M_HELP_XLATE - MENUITEM SEPARATOR - MENUITEM "&Info zu AFS Server Manager...", M_ABOUT - END -END - -MENU_AGG MENU DISCARDABLE -BEGIN - MENUITEM "Volume &erstellen...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "Volumes &sichern...", M_SET_CLONE - MENUITEM "Alle Vol&umes freigeben", M_SET_UNLOCK - MENUITEM "VLDB s&ynchronisieren...", M_SYNCVLDB - MENUITEM "Volumes &wiederherstellen...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "A&ktualisieren", M_REFRESH - MENUITEM "&Merkmale", M_PROPERTIES -END - -MENU_SVC MENU DISCARDABLE -BEGIN - MENUITEM "&Starten", M_SVC_START - MENUITEM "Sto&ppen", M_SVC_STOP - MENUITEM "E&rneut starten", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "Protokolldatei &anzeigen", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "&Löschen", M_SVC_DELETE - MENUITEM SEPARATOR - MENUITEM "A&ktualisieren", M_REFRESH - MENUITEM "&Merkmale", M_PROPERTIES -END - -MENU_AGG_NONE MENU DISCARDABLE -BEGIN - POPUP "&Anzeige" - BEGIN - MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED - MENUITEM "&Alle Symbole", M_VIEW_TWOICONS, CHECKED - MENUITEM "Nur &Status", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "Volume &erstellen...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "Alles &aktualisieren", M_REFRESHALL -END - -MENU_SVC_NONE MENU DISCARDABLE -BEGIN - POPUP "&Anzeige" - BEGIN - MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED - MENUITEM "&Alle Symbole", M_VIEW_TWOICONS, CHECKED - MENUITEM "Nur &Status", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "Servi&ce erstellen...", M_SVC_CREATE - MENUITEM SEPARATOR - MENUITEM "Alles &aktualisieren", M_REFRESHALL -END - -MENU_SET MENU DISCARDABLE -BEGIN - MENUITEM "Re&plikation...", M_SET_REPLICATION - MENUITEM "&Jetzt freigeben", M_SET_RELEASE - MENUITEM SEPARATOR - MENUITEM "&Sicherung...", M_SET_CLONE - MENUITEM "Speicherauszug in &Datei...", M_SET_DUMP - MENUITEM "Aus Datei &wiederherstellen...", M_SET_RESTORE - MENUITEM "&Quote festlegen...", M_SET_SETQUOTA - MENUITEM "Wieder&herstellung...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "&Verschieben nach...", M_SET_MOVETO - MENUITEM "Umbe&nennen...", M_SET_RENAME - MENUITEM "&Löschen", M_SET_DELETE - MENUITEM SEPARATOR - MENUITEM "Spe&rren", M_SET_LOCK - MENUITEM "Sperre a&ufheben", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "A&ktualisieren", M_REFRESH - MENUITEM "&Merkmale", M_PROPERTIES -END - -MENU_SVR MENU DISCARDABLE -BEGIN - MENUITEM "Server-Fenster ö&ffnen", M_SVR_OPEN - MENUITEM "Server-Fenster s&chließen", M_SVR_CLOSE - MENUITEM "Diesen Server über&wachen", M_SVR_MONITOR, CHECKED - MENUITEM SEPARATOR - MENUITEM "&Server-Sicherheit editieren...", M_SVR_SECURITY - MENUITEM "Datenbank-&Hosts verwalten...", M_SVR_HOSTS - MENUITEM "Volumes &sichern...", M_SET_CLONE - MENUITEM "Alle Vol&umes freigeben", M_SET_UNLOCK - MENUITEM "VLDB s&ynchronisieren...", M_SYNCVLDB - MENUITEM "Volumes &wiederherstellen...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "Datei &installieren...", M_SVR_INSTALL - MENUITEM "Datei &deinstallieren...", M_SVR_UNINSTALL - MENUITEM "Al&te Dateien löschen...", M_SVR_PRUNE - MENUITEM SEPARATOR - MENUITEM "Da&teidatumsangaben abrufen...", M_SVR_GETDATES - MENUITEM "Protokolldatei &anzeigen...", M_VIEWLOG - MENUITEM "Befehl a&usführen...", M_EXECUTE - MENUITEM SEPARATOR - MENUITEM "A&ktualisieren", M_REFRESH - MENUITEM "&Merkmale", M_PROPERTIES -END - -MENU_SVR_NONE MENU DISCARDABLE -BEGIN - POPUP "&Anzeige" - BEGIN - MENUITEM "&Große Symbole", M_SVR_VIEW_LARGE, CHECKED - MENUITEM "&Kleine Symbole", M_SVR_VIEW_SMALL, CHECKED - MENUITEM "&Details", M_SVR_VIEW_REPORT, CHECKED - MENUITEM SEPARATOR - MENUITEM "&Normal", M_SVR_VIEW_ONEICON, CHECKED - MENUITEM "&Alle Symbole", M_SVR_VIEW_TWOICONS, CHECKED - MENUITEM "Nur &Status", M_SVR_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "Über&wachte Server...", M_SUBSET - MENUITEM SEPARATOR - MENUITEM "Alle Vol&umes freigeben", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "Alle s&chließen", M_SVR_CLOSEALL - MENUITEM "Alles &aktualisieren", M_REFRESHALL -END - -MENU_SET_NONE MENU DISCARDABLE -BEGIN - POPUP "&Anzeige" - BEGIN - MENUITEM "Nach &Volume", M_SET_VIEW_REPORT, CHECKED - MENUITEM "Nach &Partition", M_SET_VIEW_TREELIST, CHECKED - MENUITEM "Keine &Details", M_SET_VIEW_TREE, CHECKED - MENUITEM SEPARATOR - MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED - MENUITEM "&Alle Symbole", M_VIEW_TWOICONS, CHECKED - MENUITEM "Nur &Status", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "Volume &erstellen...", M_SET_CREATE - MENUITEM "Aus Datei &wiederherstellen...", M_SET_RESTORE - MENUITEM SEPARATOR - MENUITEM "Volumes &sichern...", M_SET_CLONE - MENUITEM SEPARATOR - MENUITEM "Alle frei&geben", M_SET_UNLOCK - MENUITEM "Alles &aktualisieren", M_REFRESHALL -END - -MENU_COLUMNS MENU DISCARDABLE -BEGIN - MENUITEM "&Spalten...", M_COLUMNS -END - -MENU_SVC_BOS MENU DISCARDABLE -BEGIN - MENUITEM "E&rneut starten", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "Protokolldatei &anzeigen", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "A&ktualisieren", M_REFRESH - MENUITEM "&Merkmale", M_PROPERTIES -END - -MENU_SET_DRAGDROP MENU DISCARDABLE -BEGIN - MENUITEM "Hierher &verschieben...", M_SET_MOVEHERE - MENUITEM "Hie&r nachbilden...", M_SET_REPHERE - MENUITEM SEPARATOR - MENUITEM "&Abbrechen", IDC_STATIC -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SERVICES DIALOGEX 0, 0, 179, 92 -STYLE DS_CENTER | WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Services:",IDC_SVC_DESC,0,5,179,8 - CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,0,17,179, - 61,WS_EX_STATICEDGE - PUSHBUTTON "&Erstellen...",IDC_SVC_CREATE,44,80,39,12 - PUSHBUTTON "&Löschen",IDC_SVC_DELETE,86,80,39,12 - PUSHBUTTON "E&rneut starten",IDC_SVC_RESTART,128,80,49,12 -END - -IDD_AGGREGATES DIALOGEX 0, 0, 165, 84 -STYLE DS_CENTER | WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Partitionen:",IDC_AGG_DESC,0,5,165,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,0,17,165, - 53,WS_EX_STATICEDGE - PUSHBUTTON "Volume &erstellen...",IDC_AGG_CREATESET,102,72,63,12 -END - -IDD_FILESETS DIALOGEX 0, 0, 194, 92 -STYLE DS_CENTER | WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Volumes:",IDC_SET_DESC,0,5,194,8 - CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,0,17,194, - 61,WS_EX_STATICEDGE - PUSHBUTTON "&Erstellen...",IDC_SET_CREATE,1,80,39,12 - PUSHBUTTON "&Löschen",IDC_SET_DELETE,41,80,39,12 - PUSHBUTTON "&Nachbildung...",IDC_SET_REP,82,80,51,12 - PUSHBUTTON "&Quote festlegen...",IDC_SET_SETQUOTA,135,80,57,12 -END - -IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, - 135,WS_EX_CLIENTEDGE - PUSHBUTTON "&Administrator hinzufügen",IDC_LIST_ADD,51,160,87,14 - PUSHBUTTON "Administ&rator entfernen",IDC_LIST_REMOVE,141,160,80,14 - LTEXT "Administratoren für Server %1:",IDC_LIST_NAME,5,7,216,8 -END - -IDD_AGG_GENERAL DIALOGEX 0, 0, 267, 160 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "ID:",IDC_STATIC,5,30,31,8 - LTEXT "(Abfragen)",IDC_AGG_ID,38,30,214,8 - LTEXT "Gerät:",IDC_STATIC,5,46,31,8 - LTEXT "(Abfragen)",IDC_AGG_DEVICE,38,46,214,8 - LTEXT "Volumes:",IDC_STATIC,5,62,31,8 - LTEXT "(Abfragen)",IDC_AGG_FILESETS,38,62,214,8 - CONTROL "&Warnung anzeigen, wenn kombinierte Volume-Quote Kapazität überschreitet", - IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | - BS_MULTILINE | WS_TABSTOP,38,75,224,15 - LTEXT "Syntax:",IDC_STATIC,5,93,31,8 - LTEXT "(Abfragen)",IDC_AGG_USAGE,38,93,214,8 - CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,38,105,224,8, - WS_EX_STATICEDGE - CONTROL "&Warnung anzeigen, wenn die Belegung der Partition den", - IDC_AGG_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38, - 116,222,10 - CONTROL "Stan&dardschwellenwert für diesen Server überschreitet", - IDC_AGG_WARN_AGGFULL_DEF,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,49,131,203,9 - CONTROL "den Schwellenwer&t von",IDC_AGG_WARN_AGGFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,49,145,88,8 - EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,140,142,29,12, - ES_AUTOHSCROLL - LTEXT "% der Größe überschreitet",IDC_AGG_WARN_AGGFULL_DESC, - 171,145,88,8 - ICON IDI_AGGREGATE,IDC_STATIC,5,5,20,20 - LTEXT "Partition %2 (Server %1)",IDC_AGG_NAME,38,14,214,8 -END - -IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "IP-Adresse:",IDC_STATIC,5,29,43,8 - LISTBOX IDC_SVR_ADDRESSES,53,29,70,12,LBS_NOSEL | NOT WS_BORDER | - WS_VSCROLL - PUSHBUTTON "&Adressen ändern...",IDC_SVR_CHANGEADDR,144,27,77,12 - PUSHBUTTON "Authentifizie&rung anfordern",IDC_SVR_AUTH_YES,16,87,93, - 14 - PUSHBUTTON "Nicht a&uthentifizierte erlauben",IDC_SVR_AUTH_NO,113, - 87,99,14 - LTEXT "Anzahl der Partitionen:",IDC_STATIC,11,131,90,8 - LTEXT "(Abfragen)",IDC_SVR_NUMAGGREGATES,108,131,99,8 - LTEXT "Gesamtkapazität:",IDC_STATIC,11,148,60,8 - LTEXT "(Abfragen)",IDC_SVR_CAPACITY,108,148,99,8 - LTEXT "Kombinierte Volume-Quote:",IDC_STATIC,11,165,89,8 - LTEXT "(Abfragen)",IDC_SVR_ALLOCATION,108,165,99,8 - ICON IDI_SERVER,IDC_STATIC,5,5,20,20 - LTEXT "(Server-Name)",IDC_SVR_NAME,55,13,93,8 - GROUPBOX "Sicherheit",IDC_STATIC,5,52,216,57 - GROUPBOX "Speicher",IDC_STATIC,5,115,216,68 - LTEXT "Sie können festlegen, daß nur authentifizierte Zugriffe auf diesen Server möglich sind.", - IDC_STATIC,11,66,198,16 -END - -IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 221, 158 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "eine Partition dieses Servers zu",IDC_SVR_WARN_AGGFULL, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,18,116,9 - EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,127,16,24,12,ES_AUTOHSCROLL - LTEXT "% belegt ist",IDC_STATIC,168,18,45,8 - CONTROL "ein Volume dieses Servers zu",IDC_SVR_WARN_SETFULL, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,32,109,9 - EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,121,30,24,12,ES_AUTOHSCROLL - LTEXT "% belegt ist",IDC_STATIC,165,32,39,8 - CONTROL "die kombinierte Quote einer Partition die Kapazität überschreitet", - IDC_SVR_WARN_AGGALLOC,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,8,46,212,9 - CONTROL "ein Service dieses Servers gestoppt wird", - IDC_SVR_WARN_SVCSTOP,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,8,60,195,9 - CONTROL "ein Volume dieses Servers keinen VLDB-Eintrag besitzt", - IDC_SVR_WARN_SETNOVLDB,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,8,74,195,9 - CONTROL "VLDB auf eine Offline-Partition dieses Servers verweist", - IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,8,88,195,9 - CONTROL "VLDB auf ein Offline-Volume dieses Servers verweist", - IDC_SVR_WARN_SETNOSERV,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,8,103,195,9 - CONTROL "Server-Informationen aktualisieren: alle", - IDC_SVR_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,8,142,137,9 - EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,145,140,27,13,ES_AUTOHSCROLL - LTEXT "Minuten",IDC_STATIC,189,142,25,8 - LTEXT "Warnung anzeigen, falls",IDC_STATIC,5,5,195,8 -END - -IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 225, 207 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - PUSHBUTTON "Service-Protokoll &anzeigen",IDC_SVC_VIEWLOG,24,182,91, - 14 - PUSHBUTTON "Jetzt &starten",IDC_SVC_START,118,182,45,14 - PUSHBUTTON "Jetzt sto&ppen",IDC_SVC_STOP,166,182,49,14 - CONTROL "&Warnung anzeigen, falls dieser Service stoppt", - IDC_SVC_WARNSTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 11,159,200,10 - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "Service %2 (Server %1)",IDC_SVC_NAME,52,13,168,8 - LTEXT "Typ:",IDC_STATIC,5,29,44,8 - LTEXT "(Abfragen)",IDC_SVC_TYPE,76,29,141,8 - LTEXT "Parameter:",IDC_STATIC,5,45,44,8 - EDITTEXT IDC_SVC_PARAMS,76,45,141,13,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP - LTEXT "Benachrichtigung:",IDC_STATIC,5,61,58,8 - LTEXT "(Abfragen)",IDC_SVC_NOTIFIER,76,61,141,8 - LTEXT "Zuletzt gestartet:",IDC_STATIC,5,77,57,8 - LTEXT "(Abfragen)",IDC_SVC_STARTDATE,76,77,141,8 - LTEXT "Zuletzt gestoppt:",IDC_STATIC,5,93,54,8 - LTEXT "(Abfragen)",IDC_SVC_STOPDATE,76,93,141,8 - LTEXT "Letzter Fehler:",IDC_STATIC,5,109,46,8 - EDITTEXT IDC_SVC_LASTERROR,76,109,141,13,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - GROUPBOX "Service-Status",IDC_STATIC,5,127,215,75 - LTEXT "Der aktuelle Status dieses Services wird ermittelt...", - IDC_SVC_STATUS,11,142,200,8 -END - -IDD_SET_GENERAL DIALOGEX 0, 0, 273, 214 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Volume-ID:",IDC_STATIC,5,30,39,8 - LTEXT "(Unbekannt)",IDC_SET_ID,49,30,219,8 - LTEXT "Erstellt:",IDC_STATIC,5,46,39,8 - LTEXT "(Abfragen)",IDC_SET_CREATEDATE,49,46,219,8 - LTEXT "Aktualisiert:",IDC_STATIC,5,62,39,8 - LTEXT "(Abfragen)",IDC_SET_UPDATEDATE,49,62,112,8 - LTEXT "Zugriff:",IDC_STATIC,5,78,39,8 - LTEXT "(Abfragen)",IDC_SET_ACCESSDATE,49,78,219,8 - LTEXT "Gesichert:",IDC_STATIC,5,94,39,8 - LTEXT "(Abfragen)",IDC_SET_BACKUPDATE,49,94,219,8 - LTEXT "Dateianzahl:",IDC_STATIC,5,110,40,8 - LTEXT "(Abfragen)",IDC_SET_FILES,49,110,219,8 - LTEXT "Status:",IDC_STATIC,5,126,39,8 - LTEXT "(Abfragen)",IDC_SET_STATUS,49,126,101,8 - PUSHBUTTON "&Sperren",IDC_SET_LOCK,156,124,49,13 - PUSHBUTTON "Sperre a&ufheben",IDC_SET_UNLOCK,207,124,61,13 - LTEXT "Syntax:",IDC_STATIC,5,142,31,8 - LTEXT "(Abfragen)",IDC_SET_USAGE,49,142,136,8 - PUSHBUTTON "&Quote festlegen...",IDC_SET_QUOTA,207,140,61,13 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,49,156,219,8, - WS_EX_STATICEDGE - CONTROL "&Warnung anzeigen, falls die Belegung dieses Volumes", - IDC_SET_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,28, - 170,240,10 - CONTROL "den Stan&dardschwellenwert für diesen Server (%1%% seiner Größe) überschreitet", - IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,34,181,227,16 - CONTROL "den Schwellenwer&t von",IDC_SET_WARN_SETFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,34,199,88,9 - EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,129,197,29,12, - ES_AUTOHSCROLL - LTEXT "% der Größe überschreitet",IDC_SET_WARN_SETFULL_DESC, - 163,199,105,8 - ICON IDI_FILESET,IDC_STATIC,5,5,20,20 - LTEXT "Volume %3 (Server %1, Partition %2)",IDC_SET_NAME,49,14, - 219,8 -END - -IDD_MAIN DIALOGEX 0, 0, 317, 226 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | - WS_SYSMENU | WS_THICKFRAME -CAPTION "AFS Server Manager" -MENU MENU_MAIN -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Ausgewählte Zelle:",IDC_STATIC,2,8,61,8 - LTEXT "(Der Zellenname wird hier plaziert)",IDC_CELL,69,8,202, - 9 - LTEXT "AFS-Token:",IDC_STATIC,2,19,55,8 - LTEXT "%2:%1 (Token laufen %3 ab)",IDC_AFS_ID,69,19,208,9 - CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,31,313, - 193,WS_EX_CLIENTEDGE - CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 - ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 -STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Server" -CLASS "ServerWindowClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_TABS,"SysTabControl32",0x0,2,2,205,133 -END - -IDD_SVC_CREATE DIALOGEX 0, 0, 225, 233 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Server:",IDC_STATIC,5,36,44,8 - COMBOBOX IDC_SVC_SERVER,65,33,111,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Ser&vice:",IDC_STATIC,5,52,44,8 - COMBOBOX IDC_SVC_NAME,65,50,111,104,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Befehl:",IDC_STATIC,5,70,44,8 - EDITTEXT IDC_SVC_COMMAND,65,68,152,13,ES_AUTOHSCROLL - LTEXT "&Parameter:",IDC_STATIC,5,88,44,8 - EDITTEXT IDC_SVC_PARAMS,66,86,151,13,ES_AUTOHSCROLL - LTEXT "Be&nachrichtigung:",IDC_STATIC,5,105,57,8 - EDITTEXT IDC_SVC_NOTIFIER,65,103,152,13,ES_AUTOHSCROLL - LTEXT "Pro&tokolldatei:",IDC_STATIC,5,122,44,8 - EDITTEXT IDC_SVC_LOGFILE,65,120,152,13,ES_AUTOHSCROLL - CONTROL "E&infach (fortlaufende Ausführung)",IDC_SVC_TYPE_SIMPLE, - "Button",BS_AUTORADIOBUTTON,11,154,201,10 - CONTROL "Diesen Se&rvice jetzt starten",IDC_SVC_RUNNOW,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 - CONTROL "&FS (Dateisystem)",IDC_SVC_TYPE_FS,"Button", - BS_AUTORADIOBUTTON,11,180,201,10 - CONTROL "&Cron (Ausführung in bestimmten Intervallen)", - IDC_SVC_TYPE_CRON,"Button",BS_AUTORADIOBUTTON,11,195,201, - 10 - LTEXT "&Ausführung bei:",IDC_STATIC,23,209,41,8 - COMBOBOX IDC_SVC_RUNDAY,70,207,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "um",IDC_STATIC,143,209,11,8 - CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,159,207, - 53,13,WS_EX_CLIENTEDGE - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "Neuer Service",IDC_SVC_DESC,52,13,168,8 - GROUPBOX "Service-Typ",IDC_STATIC,5,141,215,87 -END - -IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, - 199,58,WS_EX_CLIENTEDGE - PUSHBUTTON "Jetzt f&reigeben",IDC_SET_RELEASE,11,143,56,14 - PUSHBUTTON "&Erstellen...",IDC_SET_REPSITE_ADD,129,143,38,14 - PUSHBUTTON "&Löschen",IDC_SET_REPSITE_DELETE,172,143,38,14 - LTEXT "Server:",-1,11,31,37,8 - LTEXT "(Server-Name)",IDC_SET_SERVER,55,31,147,8 - LTEXT "Partition:",-1,11,44,37,8 - LTEXT "(Partitionsname)",IDC_SET_AGGREGATE,55,44,147,8 - LTEXT "Volume:",-1,11,18,37,8 - LTEXT "(Volume-Name)",IDC_SET_NAME,55,18,147,8 - GROUPBOX "Volume lesen/schreiben",-1,5,5,211,56 - GROUPBOX "Volume-Replikate",-1,5,67,211,96 -END - -IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 257 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Zelle auswählen - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Zelle:",IDC_STATIC,4,24,17,8 - COMBOBOX IDC_OPENCELL_CELL,24,22,191,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - GROUPBOX "AFS-Authentifizierung",IDC_STATIC,4,44,211,92 - LTEXT "AFS-&Identität:",IDC_STATIC,22,103,55,8 - EDITTEXT IDC_OPENCELL_ID,80,101,129,14,ES_AUTOHSCROLL - LTEXT "AFS-&Kennwort:",IDC_STATIC,22,119,55,8 - EDITTEXT IDC_OPENCELL_PASSWORD,80,117,129,14,ES_PASSWORD | - ES_AUTOHSCROLL - PUSHBUTTON "&Weitere >>",IDC_ADVANCED,4,140,53,14 - DEFPUSHBUTTON "OK",IDOK,86,140,41,14 - PUSHBUTTON "Abbrechen",IDCANCEL,130,140,41,14 - PUSHBUTTON "&Hilfe",9,174,140,41,14 - CONTROL "A&lle Server dieser Zelle überwachen",IDC_MON_ALL, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10,203,185,9 - CONTROL "&Nur einen Server überwachen:",IDC_MON_ONE,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,10,216,110,10 - EDITTEXT IDC_MON_SERVER,125,215,83,13,ES_AUTOHSCROLL - CONTROL "Nur &Server in Untergruppe überwachen:",IDC_MON_SOME, - "Button",BS_AUTORADIOBUTTON | BS_MULTILINE | WS_TABSTOP, - 10,232,107,14 - COMBOBOX IDC_MON_SUBSET,125,231,83,93,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Wählen Sie die AFS-Zelle, mit der Sie arbeiten möchten.", - IDC_STATIC,4,7,200,8 - GROUPBOX "Server überwachen",IDC_ADVANCED_GROUP,4,164,211,89 - LTEXT "Sie können die Überwachung auf eine Untergruppe der in dieser Zelle verfügbaren Server begrenzen, um die Geschwindigkeit zu erhöhen.", - IDC_STATIC,10,176,201,24 - LTEXT "(Abfrage läuft...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "Sie müssen Ihr AFS-Kennwort erneut eingeben, um eine Zelle zu verwalten:", - IDC_STATIC,10,82,196,16 - LTEXT "Ihre aktuellen AFS-Token in der ausgewählten Zelle:", - IDC_STATIC,10,57,196,8 -END - -IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Warnung - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "&Weiter warten, bis der Task normal beendet wird", - IDC_TIMEOUT_WAIT,"Button",BS_AUTORADIOBUTTON,24,91,208, - 10 - CONTROL "&Task beenden",IDC_TIMEOUT_KILL,"Button", - BS_AUTORADIOBUTTON,24,105,208,10 - DEFPUSHBUTTON "OK",IDOK,93,139,50,14 - LTEXT "Zeit, die der Task aktiv war:",IDC_STATIC,4,123,142,8 - LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,151,123,29,8 - LTEXT "Der AFS Server Manager hat unerwartet lange auf die Beendigung eines Netzwerk-Tasks gewartet.", - IDC_STATIC,4,7,228,18 - LTEXT "Der Task kann weiter ausgeführt werden (empfohlen), oder Sie können dem AFS Server Manager erlauben, den Task zu beenden, wenn Sie sicher sind, daß dieser niemals abgeschlossen wird.", - IDC_STATIC,4,30,228,26 - LTEXT "Beachten Sie, daß der Task weiterhin aktiv ist, auch wenn dieses Fenster angezeigt wird; wenn der Task abgeschlossen ist, schließt sich dieses Fenster automatisch.", - IDC_STATIC,4,61,228,24 -END - -IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 -STYLE WS_POPUP | WS_CAPTION -CAPTION "Spalten" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Anzuzeigende Spalten für Auflistung au&swählen:", - IDC_STATIC,5,7,154,10 - COMBOBOX IDC_COLUMNS,164,5,118,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Verfügbare Spalten:",IDC_STATIC,12,40,100,8 - LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "&Anzuzeigende Spalten:",IDC_STATIC,173,41,100,8 - LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "&Hinzufügen >>",IDC_COL_INSERT,117,68,50,14 - PUSHBUTTON "<< Entfe&rnen",IDC_COL_DELETE,117,88,50,14 - PUSHBUTTON "Nach &oben",IDC_COL_UP,173,122,48,14 - PUSHBUTTON "Nach &unten",IDC_COL_DOWN,224,122,48,14 - GROUPBOX "Spalten auflisten",IDC_STATIC,5,25,276,118 -END - -IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 264, 72 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Aktualisieren - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, - 256,8 - LTEXT "0%% abgeschlossen",IDC_REFRESH_PERCENT,4,49,202,8 - LTEXT "",IDC_REFRESH_CURRENT,4,60,201,8 - LTEXT "Bitte warten...",IDC_REFRESH_DESC,4,7,256,25 - PUSHBUTTON "Über&springen",IDC_REFRESH_SKIP,209,54,51,15,NOT - WS_TABSTOP -END - -IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Volume erstellen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Name:",IDC_STATIC,4,30,39,8 - EDITTEXT IDC_SET_NAME,46,28,116,14,ES_AUTOHSCROLL - LTEXT "&Quote:",IDC_STATIC,4,48,39,8 - EDITTEXT IDC_SET_QUOTA,46,46,32,14,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,90,47,30,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "&Sicherung:",IDC_STATIC,4,66,39,8 - CONTROL "Siche&rungsversion dieses Volumes ebenfalls erstellen", - IDC_SET_CLONE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,46, - 66,185,8 - LTEXT "&Server:",IDC_STATIC,4,84,39,8 - COMBOBOX IDC_SET_SERVER,46,82,116,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Partition:",IDC_STATIC,4,102,39,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,46,102,271, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "OK",IDOK,156,191,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,211,191,50,14 - PUSHBUTTON "&Hilfe",9,267,191,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "Neues Volume",IDC_STATIC,46,12,170,8 -END - -IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 277, 102 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Volume löschen" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "Abbrechen",IDCANCEL,169,84,50,14 - PUSHBUTTON "OK",IDOK,115,84,50,14 - PUSHBUTTON "&Hilfe",9,223,84,50,14 - CONTROL "Volume %3 von Server %1, Partition %2 &löschen", - IDC_DELSET_SERVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 34,45,236,10 - CONTROL "&VLDB-Eintrag für Volume %3 löschen",IDC_DELSET_VLDB, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,34,60,236,10 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "Achtung!\n\nDiese Operation löscht Volume %3 dauerhaft.", - IDC_DELSET_DESC,31,7,242,33 -END - -IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Volume sichern - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "OK",IDOK,183,67,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,237,67,50,14 - PUSHBUTTON "&Hilfe",9,291,67,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,21,20 - LTEXT "Eine Volume-Sicherung stellt sich als schreibgeschützte Kopie dieses Volumes dar. Ein Read/Write-Volume kann über nur eine Sicherungsversion verfügen.", - IDC_STATIC,34,9,307,17 - LTEXT "Klicken Sie auf OK, um eine Sicherung des Volumes %3 auf Server %1, Partition %2 zu erstellen. Wenn bereits eine Sicherung dieses Volumes vorhanden ist, wird die Sicherung aktualisiert.", - IDC_CLONE_DESC,34,32,307,24 -END - -IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "Bekannte Probleme",IDC_PROBLEM_BOX,5,36,215,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,138,120,61,12 - ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "Service %2 (Server %1)",IDC_PROBLEM_TITLE,52,13,168,8 -END - -IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "Bekannte Probleme",IDC_PROBLEM_BOX,5,36,216,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,172,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,201,49,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,136,120,61,12 - ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "%1",IDC_PROBLEM_TITLE,42,13,179,8 -END - -IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "Bekannte Probleme",IDC_PROBLEM_BOX,5,35,247,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,170,119,61,12 - ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "Partition %2 (Server %1)",IDC_PROBLEM_TITLE,38,14,214,8 -END - -IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "Bekannte Probleme",IDC_PROBLEM_BOX,5,35,263,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,249,48,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 - ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "Volume %3 (Server %1, Partition %2)",IDC_PROBLEM_TITLE, - 49,14,219,8 -END - -IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Volume verschieben" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,70,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "OK",IDOK,115,156,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,169,156,50,14 - PUSHBUTTON "&Hilfe",9,223,156,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,21,20 - LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,242,24 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 - LTEXT "Volu&me verschieben nach:",IDC_STATIC,4,43,116,8 -END - -IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "Volume verschieben - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "Volume %3 wird von Partition %2 auf Server %1 zu Partition %5 auf Server %4 verschoben...", - IDC_MOVESET_DESC,4,41,229,19 -END - -IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 277, 106 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Protokolldatei anzeigen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Protokolldatei anzeigen auf &Server:",IDC_STATIC,4,40, - 73,17 - COMBOBOX IDC_VIEWLOG_SERVER,82,42,126,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "Au&f Server anzuzeigende Datei:",IDC_STATIC,4,61,73,18 - EDITTEXT IDC_VIEWLOG_FILENAME,82,62,191,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,169,88,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,223,88,50,14 - ICON IDI_SERVICE,IDC_STATIC,4,4,20,20 - LTEXT "Geben Sie den vollständigen Pfad der anzuzeigenden Protokolldatei ein.", - IDC_VIEWLOG_DESC,31,10,242,21 -END - -IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 286, 185 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Protokolldatei anzeigen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Dateiinhalt:",IDC_SVC_VIEWLOG_CONTENTS,4,41,277,8 - EDITTEXT IDC_VIEWLOG_TEXT,4,51,277,113,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL - PUSHBUTTON "Speichern &unter...",IDC_VIEWLOG_SAVEAS,168,167,61,14 - DEFPUSHBUTTON "S&chließen",IDOK,231,167,50,14 - ICON IDI_SERVICE,-1,4,7,20,20 - LTEXT "Protokolldatei [für Service %2] auf Server %1", - IDC_SVC_VIEWLOG_DESC,33,7,246,10 - LTEXT "Dateiname auf Server: %1",IDC_SVC_VIEWLOG_FILENAME,33, - 23,248,8 -END - -IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Volume-Quote festlegen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Aktuelle Quote:",IDC_STATIC,4,49,50,8 - LTEXT "(Unbekannt)",IDC_SET_USAGE,59,49,208,8 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,59,60,208,8, - WS_EX_STATICEDGE - LTEXT "Neue &Quote:",IDC_STATIC,4,81,47,8 - EDITTEXT IDC_SET_QUOTA,59,79,32,13,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,103,79,30,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "OK",IDOK,109,112,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,163,112,50,14 - PUSHBUTTON "&Hilfe",9,217,112,50,14 - PUSHBUTTON "&Merkmale...",IDC_AGG_PROPERTIES,212,28,55,12 - LTEXT "Partition:",IDC_STATIC,4,30,47,8 - LTEXT "Partition %2 von Server %1",IDC_SET_AGGREGATE,59,30,141, - 8 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "Volume %1",IDC_SET_NAME,59,11,208,8 -END - -IDD_ACTIONS DIALOGEX 0, 0, 236, 58 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "Laufende Operationen - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Die folgenden Operationen sind momentan aktiv:", - IDC_ACTION_DESC,2,2,232,8 - CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | - 0x3,2,14,232,43 -END - -IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "VLDB synchronisieren" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "OK",IDOK,107,81,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,161,81,50,14 - PUSHBUTTON "&Hilfe",9,215,81,50,14 - ICON 32515,IDC_STATIC,4,4,21,20 - LTEXT "(Wird zur Laufzeit festgelegt)",IDC_SYNC_DESC,37,4,228, - 32 - LTEXT "(Wird zur Laufzeit festgelegt)",IDC_SYNC_DESC2,37,44, - 228,24 -END - -IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Volume nachbilden" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,62,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "OK",IDOK,115,153,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,169,153,50,14 - PUSHBUTTON "&Hilfe",9,223,153,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "Neues Replikat von Volume %3",IDC_SET_NAME,31,12,242,8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 - LTEXT "E&rstellen eines neuen Replikats dieses Volumes auf:", - IDC_STATIC,4,35,166,8 -END - -IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 248, 167 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Datei installieren" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Quellendatei:",IDC_STATIC,4,81,49,8 - EDITTEXT IDC_FILENAME,56,79,129,14,ES_AUTOHSCROLL - PUSHBUTTON "&Durchsuchen...",IDC_BROWSE,188,79,55,14 - LTEXT "Ziel-&Server:",IDC_STATIC,4,101,45,8 - COMBOBOX IDC_SERVER,56,99,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Ziel&name:",IDC_STATIC,4,121,49,8 - EDITTEXT IDC_DIRECTORY,56,119,129,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,86,149,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,140,149,50,14 - PUSHBUTTON "&Hilfe",9,194,149,50,14 - ICON IDI_INSTALL,IDC_STATIC,4,4,21,20 - LTEXT "Installieren der Datei auf Server",IDC_STATIC,32,12,175, - 8 - LTEXT "(Text wird zur Laufzeit festgelegt)\n(Text wird zur Laufzeit festgelegt)\n(Text wird zur Laufzeit festgelegt)\n(Text wird zur Laufzeit festgelegt)", - IDC_INSTALL_DESC,4,29,240,41 -END - -IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Datei deinstallieren" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Server:",IDC_STATIC,4,68,35,8 - COMBOBOX IDC_SERVER,41,66,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Ziel&datei:",IDC_STATIC,4,87,35,8 - EDITTEXT IDC_FILENAME,41,85,175,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,88,121,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,141,121,50,14 - PUSHBUTTON "&Hilfe",9,194,121,50,14 - ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 - LTEXT "Deinstallieren der Datei von Server",IDC_STATIC,32,12, - 128,8 - LTEXT "Diese Operation ermöglicht Ihnen die Wiederherstellung einer zuvor installierten Kopie einer Datei auf einem bestimmten Server. Wenn keine zuvor installierte Kopie der ausgewählten Datei vorhanden ist, wird die Datei entfernt.", - IDC_STATIC,4,29,240,32 -END - -IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 261, 141 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Alte Dateien löschen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Server:",-1,4,56,44,8 - COMBOBOX IDC_SERVER,80,54,119,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Alle &Kerndateien löschen",IDC_OP_DELETE_CORE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,80,73,176,10 - CONTROL "Alle .&BAK-Dateien löschen (Dateisicherungen)", - IDC_OP_DELETE_BAK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 80,84,176,10 - CONTROL "Alle .&OLD-Dateien löschen (ältere Dateisicherungen)", - IDC_OP_DELETE_OLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 80,95,176,10 - DEFPUSHBUTTON "OK",IDOK,98,123,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,152,123,50,14 - PUSHBUTTON "&Hilfe",9,205,123,50,14 - ICON IDI_PRUNE,-1,4,4,20,20 - LTEXT "Löschen alter Dateien vom Server",-1,32,12,123,8 - LTEXT "Diese Operation löscht Sicherungskopien installierter Dateien auf einem bestimmten Server.", - -1,4,29,238,16 - LTEXT "Zu löschende Dateien:",-1,3,73,73,17 -END - -IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Volume umbenennen" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Alter Name:",IDC_STATIC,31,67,39,8 - EDITTEXT IDC_RENSET_OLD,78,65,122,14,ES_AUTOHSCROLL | ES_READONLY - LTEXT "&Neuer Name:",IDC_STATIC,31,85,43,8 - EDITTEXT IDC_RENSET_NEW,78,83,122,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,115,115,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,169,115,50,14 - PUSHBUTTON "Hilfe",9,223,115,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "Geben Sie einen neuen Namen für Volume %3 ein. Die Namen der Sicherung und der Replikate eines Volumes werden automatisch geändert.\n\nAchtung: Wenn Sie ein angehängtes Volume umbenennen, müssen Sie dessen Mount-Punkte löschen und erneut erstellen.", - IDC_RENSET_DESC,31,7,242,48 -END - -IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 277, 68 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Service löschen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "Abbrechen",IDCANCEL,169,50,50,14 - PUSHBUTTON "OK",IDOK,115,50,50,14 - PUSHBUTTON "Hilfe",9,223,50,50,14 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "Achtung!\n\nDiese Operation stoppt Service %2 und löscht ihn von Server %1.", - IDC_DELSVC_DESC,31,7,242,33 -END - -IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Dateidatumsangaben abrufen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Server:",-1,4,56,42,8 - COMBOBOX IDC_SERVER,94,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Abzu&fragende Datei:",-1,4,73,79,16 - EDITTEXT IDC_FILENAME,94,73,135,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,86,107,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,140,107,50,14 - PUSHBUTTON "&Hilfe",9,194,107,50,14 - ICON IDI_GETDATES,-1,4,4,20,20 - LTEXT "Abrufen der Datumsangaben von Dateien auf Server",-1,32, - 12,185,8 - LTEXT "Diese Operation ruft das Datum ab, an dem eine Datei sowie ihre Sicherungskopien (falls vorhanden) zuletzt bearbeitet wurden.", - -1,4,29,240,16 -END - -IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Dateidatumsangaben abrufen - Ergebnisse" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Server:",IDC_STATIC,4,30,39,8 - LTEXT "(Wird zur Laufzeit festgelegt)",IDC_SERVER,48,30,132,8 - LTEXT "Dateiname:",IDC_STATIC,4,45,39,8 - LTEXT "(Wird zur Laufzeit festgelegt)",IDC_FILENAME,48,45,132, - 8 - LTEXT "Dateidatum:",IDC_STATIC,4,60,39,8 - LTEXT "(Unbekannt; Datei konnte nicht gefunden werden)", - IDC_DATE_FILE,48,60,197,8 - LTEXT ".BAK-Datum:",IDC_STATIC,4,75,41,8 - LTEXT "(Unbekannt; Datei konnte nicht gefunden werden)", - IDC_DATE_BAK,48,75,196,8 - LTEXT ".OLD-Datum:",IDC_STATIC,4,90,42,8 - LTEXT "(Unbekannt; Datei konnte nicht gefunden werden)", - IDC_DATE_OLD,48,90,196,8 - DEFPUSHBUTTON "S&chließen",IDOK,99,114,50,14 - ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 - LTEXT "Abrufen der Datumsangaben von Dateien auf Server", - IDC_STATIC,32,12,186,8 -END - -IDD_SET_DUMP DIALOGEX 0, 0, 295, 144 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Speicherauszug von Volume erstellen - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Speicherauszugsdatei erstellen; &Name:",IDC_STATIC,4,40, - 100,16 - EDITTEXT IDC_DUMP_FILENAME,109,40,121,14,ES_AUTOHSCROLL - PUSHBUTTON "&Durchsuchen...",IDC_DUMP_BROWSE,237,40,54,14 - CONTROL "Sp&eicherauszug des gesamten Inhalts von Volume %3 (Partition %1:%2) erstellen", - IDC_DUMP_FULL,"Button",BS_AUTORADIOBUTTON | BS_MULTILINE | - WS_GROUP,10,76,274,16 - CONTROL "Speicherauszug nur für Dateien erstellen, die geändert wurden &seit", - IDC_DUMP_LIMIT_TIME,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,10,98,143,16 - CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,160,100, - 51,13,WS_EX_CLIENTEDGE - CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,218,100, - 56,13,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "OK",IDOK,131,126,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,185,126,50,14 - PUSHBUTTON "&Hilfe",9,241,126,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "Diese Operation kopiert den Inhalt eines Volumes in eine einzelne Datei, damit das Volume einfach gesichert werden kann. Die auf diese Weise erstellten Inhaltskopien von Volumes können später wiederhergestellt werden.", - IDC_STATIC,30,7,255,26 - GROUPBOX "Speicherauszugparameter",IDC_STATIC,4,62,287,59 -END - -IDD_SET_RESTORE DIALOGEX 0, 0, 292, 248 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Volume wiederherstellen - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Wiede&rherzustellende Datei:",IDC_STATIC,4,29,69,16 - EDITTEXT IDC_RESTORE_FILENAME,78,30,150,14,ES_AUTOHSCROLL - PUSHBUTTON "&Durchsuchen...",IDC_RESTORE_BROWSE,232,30,55,14 - CONTROL "Diese &ist eine schrittweise steigende Speicherauszugsdatei", - IDC_RESTORE_INCREMENTAL,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,77,48,201,10 - LTEXT "&Volume:",IDC_STATIC,11,108,26,8 - EDITTEXT IDC_RESTORE_SETNAME,50,106,115,14,ES_AUTOHSCROLL - LTEXT "&Server:",IDC_STATIC,11,145,24,8 - COMBOBOX IDC_RESTORE_SERVER,51,143,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "&Partition:",IDC_STATIC,11,162,36,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,50,161,231, - 55,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "OK",IDOK,128,230,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,183,230,50,14 - PUSHBUTTON "&Hilfe",9,238,230,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "Volume aus Speicherauszugsdatei wiederherstellen", - IDC_STATIC,33,11,224,8 - GROUPBOX "Ziel-Volume",IDC_STATIC,4,63,284,160 - LTEXT "Wenn Sie ein Volume aus einer Speicherauszugsdatei wiederherstellen, können Sie entweder ein neues Volume erstellen oder ein vorhandenes Read/Write-Volume überschreiben.", - IDC_STATIC,11,76,267,24 - LTEXT "(Wird zur Laufzeit festgelegt)\n(Wird zur Laufzeit festgelegt)", - IDC_RESTORE_CREATE,51,121,229,17 -END - -IDD_SVC_BOS DIALOGEX 0, 0, 225, 207 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "&Periodisch alle Services auf diesem Server stoppen und erneut starten", - IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | - WS_TABSTOP,11,71,196,16 - LTEXT "E&rneut starten",IDC_BOS_GENRES_DESC1,23,96,25,8 - COMBOBOX IDC_BOS_GENRES_DATE,54,94,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "&um",IDC_BOS_GENRES_DESC2,127,97,12,8 - CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,147, - 94,53,13,WS_EX_CLIENTEDGE - CONTROL "Periodisch alle Services auf diesem Server auf neue &Binärdateien testen", - IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | - WS_TABSTOP,11,153,201,14 - LTEXT "Te&st",IDC_BOS_BINRES_DESC1,23,178,25,8 - COMBOBOX IDC_BOS_BINRES_DATE,54,176,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "u&m",IDC_BOS_BINRES_DESC2,127,179,12,8 - CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,147, - 176,53,13,WS_EX_CLIENTEDGE - ICON IDI_BOSSERVICE,IDC_STATIC,5,5,20,20 - LTEXT "Service %2 (Server %1)",IDC_SVC_NAME,52,13,168,8 - GROUPBOX "BOS-Service",IDC_STATIC,5,27,215,175 - LTEXT "Mit dem BOS-Service können periodisch alle Services auf diesem Server gestoppt und erneut gestartet werden (einschließlich des BOS-Services selbst).", - IDC_STATIC,11,41,200,24 - LTEXT "Der BOS-Service kann ebenfalls dazu verwendet werden, um alle Services auf einem Server periodisch zu testen oder um nur die Services zu stoppen und erneut zu starten, deren Binärdateien aktualisiert wurden.", - IDC_STATIC,11,115,200,32 -END - -IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "Speicherauszug von Volume erstellen - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "Speicherauszugsdatei %4 wird von Volume %3 erstellt...", - IDC_DUMPSET_DESC,4,41,229,19 -END - -IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "Volume wiederherstellen - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "Volume %1 wird aus Speicherauszugsdatei %2 wiederhergestellt...", - IDC_RESTORESET_DESC,4,41,229,19 -END - -IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 306, 162 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Volumes sichern - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "Sicherungsversionen &aller Volumes dieser Zelle erstellen", - IDC_CLONE_ALL,"Button",BS_AUTORADIOBUTTON,30,49,214,10 - GROUPBOX " ",IDC_STATIC,25,66,260,67 - CONTROL "Nur Sicherungen für V&olumes erstellen, die folgenden Kriterien entsprechen:", - IDC_CLONE_SOME,"Button",BS_AUTORADIOBUTTON,30,64,250,11 - CONTROL "Nur Volumes auf &Server:",IDC_CLONE_SVR_LIMIT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,45,83,92,10 - COMBOBOX IDC_CLONE_SVR,191,82,85,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Nur Volumes auf &Partition:",IDC_CLONE_AGG_LIMIT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,45,99,97,10 - COMBOBOX IDC_CLONE_AGG,191,98,85,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Nur Volumes, die &beginnen mit:",IDC_CLONE_PREFIX_LIMIT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,116,109,10 - EDITTEXT IDC_CLONE_PREFIX,191,115,85,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,140,144,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,194,144,50,14 - PUSHBUTTON "&Hilfe",9,250,144,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "Eine Volume-Sicherung stellt sich als schreibgeschützte Kopie des Volumes dar. Ein Read/Write-Volume kann über nur eine Sicherungskopie verfügen.\n\nSie können Sicherungsversionen für mehrere Volumes gleichzeitig erstellen.", - IDC_STATIC,28,7,272,40 -END - -IDD_SUBSETS DIALOGEX 0, 0, 281, 182 -STYLE WS_POPUP | WS_CAPTION -CAPTION "Überwachte Server" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Untergruppenname:",IDC_STATIC,11,77,63,8 - EDITTEXT IDC_SUBSET_NAME,76,75,106,14,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_TABSTOP - PUSHBUTTON "Ö&ffnen...",IDC_SUBSET_LOAD,185,75,39,14 - PUSHBUTTON "&Speichern...",IDC_SUBSET_SAVE,229,75,41,14 - CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x153,12,111,193,58,WS_EX_CLIENTEDGE - PUSHBUTTON "&Alle überwachen",IDC_SUBSET_ALL,209,122,64,14 - PUSHBUTTON "Kei&ne überwachen",IDC_SUBSET_NONE,209,140,64,14 - LTEXT "Wenn Sie mit einer sehr großen Zelle arbeiten, können Sie bestimmte Server von der Überwachung ausnehmen, um die Leistung zu verbessern. Der AFS Server Manager zeigt keine Volumes, Partitionen oder Services von Servern an, die nicht überwacht werden.", - IDC_STATIC,5,5,271,32 - LTEXT "Sie können die Überwachung eines Servers jederzeit aktivieren (oder inaktivieren). Sie können Server-Untergruppen erstellen, um Listen mit zu überwachenden Servern zu bestimmen.", - IDC_STATIC,5,37,271,23 - GROUPBOX "Aktuelle Untergruppe",IDC_STATIC,5,63,271,114 - LTEXT "Zu überwachende Server:",IDC_STATIC,12,95,91,8 -END - -IDD_SUBSET_LOADSAVE DIALOGEX 0, 0, 280, 145 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | - WS_CAPTION | WS_SYSMENU -CAPTION "(Titel wird zur Laufzeit festgelegt)" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Untergruppen&name:",1090,5,112,63,8,SS_NOTIFY - EDITTEXT IDC_SUBSET_NAME,73,110,149,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "Ö&ffnen",IDOK,226,110,50,14 - PUSHBUTTON "&Abbrechen",IDCANCEL,226,127,50,14 - CONTROL "Liste 1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | - LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,272,82, - WS_EX_CLIENTEDGE - PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT - WS_TABSTOP - PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT - WS_TABSTOP - LTEXT "Bereits für diese Zelle definierte Untergruppen:", - IDC_STATIC,4,6,150,8 -END - -IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Befehl suchen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - COMBOBOX IDC_FIND_COMMAND,4,38,137,170,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "&Hilfe anzeigen",IDOK,147,38,67,14 - PUSHBUTTON "&Abbrechen",IDCANCEL,147,55,67,14 - LTEXT "Um festzustellen, wie Sie mit dem AFS Server Manager eine Aufgabe durchführen, wählen Sie unten eine Befehlszeile aus und klicken auf ""Hilfe anzeigen"".", - IDC_STATIC,4,4,210,25 -END - -IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 141 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Fehlercode suchen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "F&ehlernummer:",IDC_STATIC,4,41,45,8 - EDITTEXT IDC_ERROR_NUMBER,59,39,78,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "Überse&tzen",IDC_ERROR_TRANSLATE,147,39,67,14 - PUSHBUTTON "S&chließen",IDCANCEL,85,123,48,14 - LTEXT "(Text wird zur Laufzeit festgelegt)",IDC_ERROR_DESC,4, - 71,210,42 - LTEXT "Um die Bedeutung eines Fehlercodes festzustellen, geben Sie den Code unten ein und klicken dann auf ""Übersetzen"".", - IDC_STATIC,4,4,210,25 - CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 -END - -IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Informationen zu AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 - LTEXT "AFS Server Manager Version 3.5",IDC_STATIC,33,8,163,8 - LTEXT "Copyright © IBM Corporation 1989, 1999",IDC_STATIC,33, - 20,183,8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 - CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 - PUSHBUTTON "S&chließen",IDOK,89,123,50,14 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 -END - -IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Der AFS Server Manager sucht in Zelle %1 nach Servern...", - IDC_OPENCELL_DESC,41,15,183,16 - GROUPBOX "",IDC_STATIC,4,2,231,39 - ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 279, 136 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "Vollständige Domänennamen für Server anzeigen (z.B. ""machine.company.com"")", - IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,5,269,10 - CONTROL "&Warnung anzeigen, wenn ohne Verwaltungs-Token gearbeitet wird", - IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,19,269,10 - CONTROL "...werden immer die Merkmale des Servers angezeigt", - IDC_OPT_SVR_DBL_PROP,"Button",BS_AUTORADIOBUTTON,7,50, - 253,10 - CONTROL "...werden die Merkmale des Servers nur angezeigt, wenn die Schnellansicht geöffnet ist", - IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,7,60,255,16 - CONTROL "...wird immer ein Fenster für diesen Server geöffnet", - IDC_OPT_SVR_DBL_OPEN,"Button",BS_AUTORADIOBUTTON,7,77, - 253,10 - CONTROL "...führt das Öffnen eines Server-Fensters zur Überwachung dieses Servers", - IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,103,253,10 - CONTROL "...führt das Schließen eines Server-Fensters dazu, daß dieser Server nicht mehr überwacht wird", - IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | - BS_MULTILINE | WS_TABSTOP,7,114,261,15 - LTEXT "Durch Doppelklicken auf das Symbol eines Servers...", - IDC_STATIC,5,38,269,8 - LTEXT "Wenn eine Server-Untergruppe im Gebrauch und die Schnellansicht geschlossen ist...", - IDC_STATIC,5,91,272,8 -END - -IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,22,216, - 135,WS_EX_CLIENTEDGE - PUSHBUTTON "Server-Schlüssel &hinzufügen",IDC_KEY_ADD,29,160,96,14 - PUSHBUTTON "Server-Schlüssel entfe&rnen",IDC_KEY_REMOVE,129,160,93, - 14 - LTEXT "Schlüssel für Server:",IDC_KEY_NAME,5,7,216,8 -END - -IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Server-Schlüssel hinzufügen" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Version:",IDC_STATIC,7,37,26,8 - EDITTEXT IDC_KEY_VERSION,43,35,43,14,ES_AUTOHSCROLL - LTEXT "Wert:",IDC_STATIC,7,58,21,8 - CONTROL "Diese Zeichenfolge verschlüsseln:",IDC_KEY_BYSTRING, - "Button",BS_AUTORADIOBUTTON | BS_MULTILINE,39,53,75,23 - CONTROL "Diesen Schlüssel verwenden:",IDC_KEY_BYDATA,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,40,75,72,15 - EDITTEXT IDC_KEY_STRING,119,56,155,14,ES_PASSWORD | - ES_AUTOHSCROLL - EDITTEXT IDC_KEY_DATA,119,75,103,14,ES_AUTOHSCROLL - PUSHBUTTON "Wahlf&rei",IDC_KEY_RANDOM,226,75,48,14 - LTEXT "Erinnerung: Nach dem Hinzufügen eines neuen Schlüssels zu einem Server sollten Sie das AFS-Konto ändern, um den neuen Schlüssel zu verwenden. Nach ein paar Tagen können Sie alle alten Server-Schlüssel entfernen.", - IDC_STATIC,7,99,267,25 - DEFPUSHBUTTON "OK",IDOK,116,129,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,170,129,50,14 - PUSHBUTTON "Hilfe",9,224,129,50,14 - LTEXT "Neuer Schlüssel für Server %1",IDC_KEY_TITLE,43,14,181, - 8 - ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 -END - -IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 277, 145 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Service starten/stoppen" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "OK",IDOK,115,127,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,169,127,50,14 - PUSHBUTTON "&Hilfe",9,223,127,50,14 - ICON IDI_SERVICE,IDC_STATIC,4,7,21,20 - LTEXT "Klicken Sie auf OK, um Service %2 auf Server %1 zu starten/stoppen.", - IDC_STARTSTOP_TEXT,31,12,242,9 - CONTROL "&Permanent (IDS_START/STOPSERVICE_PERMANENT)", - IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,37,64,226,18 - CONTROL "&Temporär (IDS_START/STOPSERVICE_TEMPORARY)", - IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,37,85,226,18 - GROUPBOX "Servicestart",IDC_STATIC,31,31,242,81 - LTEXT "Sie können diese Änderung permanent gestalten, damit Service %2 (nicht) automatisch gestartet wird, wenn Server %1 erneut gestartet wird.", - IDC_STARTSTOP_STARTUP,38,45,228,16 -END - -IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 248, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Befehl ausführen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Server:",IDC_STATIC,4,56,42,8 - COMBOBOX IDC_SERVER,50,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Befehl:",IDC_STATIC,4,75,42,8 - EDITTEXT IDC_COMMAND,50,73,194,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,86,107,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,140,107,50,14 - PUSHBUTTON "&Hilfe",9,194,107,50,14 - ICON IDI_SERVER,IDC_STATIC,4,4,20,20 - LTEXT "Befehl auf Server ausführen",IDC_STATIC,32,12,195,8 - LTEXT "Mit dieser Operation können Sie einen Befehl auf einem fernen Server ausführen.\nEr wird normalerweise dazu verwendet, um einen Server erneut zu starten, indem das Skript /etc/reboot ausgeführt wird.", - IDC_STATIC,4,29,240,16 -END - -IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 286, 271 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Volumes wiederherstellen - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Server:",IDC_STATIC,30,59,35,8 - COMBOBOX IDC_SERVER,67,57,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Partition:",IDC_STATIC,30,76,35,8 - COMBOBOX IDC_AGGREGATE,67,74,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "&Alle Partitionen wiederherstellen",IDC_AGGREGATE_ALL, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,76,113,10 - LTEXT "V&olume:",IDC_STATIC,29,94,35,8 - COMBOBOX IDC_FILESET,67,92,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "A&lle Volumes wiederherstellen",IDC_FILESET_ALL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,163,94,107,10 - DEFPUSHBUTTON "OK",IDOK,85,114,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,139,114,50,14 - PUSHBUTTON "&Hilfe",9,232,114,50,14 - PUSHBUTTON "&Weitere >>",IDC_ADVANCED,4,114,53,14 - LTEXT "Pfad für &temporäre Dateien:",IDC_STATIC,10,148,89,8 - EDITTEXT IDC_SALVAGE_TEMPDIR,102,147,173,13,ES_AUTOHSCROLL - CONTROL "Pa&rallele Wiederherstellungen; Anzahl der Prozesse:", - IDC_SALVAGE_SIMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 29,163,178,10 - EDITTEXT IDC_SALVAGE_NUM,214,162,25,13,ES_AUTOHSCROLL - CONTROL "Kei&ne beschädigten Volumes wiederherstellen", - IDC_SALVAGE_READONLY,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,29,173,165,10 - CONTROL "Lesevorgänge in kleine &Blöcke unterteilen", - IDC_SALVAGE_BLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 29,183,152,10 - CONTROL "&Wiederherstellung aller gekennzeichneten Volumes erzwingen", - IDC_SALVAGE_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 29,193,218,10 - CONTROL "Wi&ederaufbau der Verzeichnisstruktur erzwingen", - IDC_SALVAGE_FIXDIRS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,29,203,170,10 - LTEXT "Dateiname für Ergebnisprotoko&ll:",IDC_STATIC,10,217, - 104,8 - EDITTEXT IDC_SALVAGE_LOG_FILE,118,216,156,13,ES_AUTOHSCROLL - CONTROL "L&iste beschädigter inodes in Ergebnisprotokoll aufnehmen", - IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,30,230,213,10 - CONTROL "Liste der im Besitz von AFS befindlichen root inodes in Ergebnisprotokoll aufnehmen", - IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | - BS_MULTILINE | WS_TABSTOP,30,241,246,15 - ICON IDI_SERVER,IDC_STATIC,4,7,21,20 - LTEXT "Mit dieser Operation können Sie Probleme auf einem oder mehreren Volumes beheben.\n\nHinweis: Wenn Sie eine komplette Partition oder einen Server in einem Schritt wiederherstellen, wird der Server temporär offline geschaltet.", - IDC_STATIC,31,8,247,46 - GROUPBOX "Erweiterte Wiederherstellungsoptionen", - IDC_ADVANCED_GROUP,4,134,278,128 -END - -IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Volumes wiederherstellen - Ergebnisse" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "S&chließen",IDOK,232,160,50,14 - LTEXT "Ergebnisse der Wiederherstellungsoperationen:", - IDC_STATIC,4,33,277,8 - EDITTEXT IDC_SALVAGE_DETAILS,4,43,277,113,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP - ICON IDI_SERVER,IDC_STATIC,4,7,21,20 - LTEXT "Volume %3 auf Partition %2 des Servers %1 wiederherstellen", - IDC_SALVAGE_TITLE,33,15,248,8 -END - -IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 301, 103 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Volume freigeben" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "OK",IDOK,140,85,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,194,85,50,14 - PUSHBUTTON "&Hilfe",9,247,85,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,21,20 - LTEXT "Mit dieser Operation können Sie die Replikate von Volume %3 aktualisieren. Sie können entweder Replikate aktualisieren, die nicht auf dem neuesten Stand sind, oder aber alle Replikate.", - IDC_RELSET_DESC,34,7,254,25 - CONTROL "N&ur Volume-Replikate aktualisieren, die nicht nicht auf dem neuesten Stand sind", - IDC_RELSET_NORMAL,"Button",BS_AUTORADIOBUTTON,8,41,264, - 10 - CONTROL "&Alle Volume-Replikate aktualisieren, auch wenn diese auf dem neuesten Stand sind", - IDC_RELSET_FORCE,"Button",BS_AUTORADIOBUTTON,8,56,276,10 -END - -IDD_SVR_HOSTS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - PUSHBUTTON "Host-Server &hinzufügen",IDC_HOST_ADD,56,160,82,14 - PUSHBUTTON "Host-Server entfe&rnen",IDC_HOST_REMOVE,141,160,80,14 - LTEXT "Vom Server erkannte Datenbank-Host-Server:", - IDC_HOST_TITLE,5,7,216,8 - CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, - 135,WS_EX_CLIENTEDGE -END - -IDD_SVR_ADDHOST DIALOGEX 0, 0, 242, 106 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "Host-Server hinzufügen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Host:",-1,31,55,26,8 - EDITTEXT IDC_ADDHOST_HOST,61,53,103,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,80,88,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,134,88,50,14 - ICON IDI_SERVER,-1,4,4,21,20 - LTEXT "Sie haben das Hinzufügen eines Datenbank-Host-Servers zur Liste gewählt, die auf Server %1 gespeichert wird.\n\nGeben Sie unten den Namen des neuen Datenbank-Hosts ein.", - IDC_ADDHOST_DESC,27,8,211,40 - PUSHBUTTON "Hilfe",9,188,88,50,14 -END - -IDD_SVR_ADDRESS DIALOGEX 0, 0, 208, 115 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "Server-Adressen ändern" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "In VLDB aufgezeichnete IP-Adressen für Server %1:", - IDC_TITLE,4,4,200,8 - LISTBOX IDC_SVR_ADDRESSES,4,14,147,40,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Ä&ndern...",IDC_ADDR_CHANGE,154,24,50,14 - PUSHBUTTON "&Entfernen",IDC_ADDR_REMOVE,154,40,50,14 - DEFPUSHBUTTON "OK",IDOK,46,97,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,100,97,50,14 - PUSHBUTTON "Hilfe",9,154,97,50,14 - LTEXT "Hinweis: Beim Start eines Datei-Servers registriert dieser seine aktuellen IP-Adressen automatisch mit VLDB.", - IDC_STATIC,4,64,200,18 -END - -IDD_SVR_NEWADDR DIALOGEX 0, 0, 223, 69 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "IP-Adresse ändern" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "OK",IDOK,61,51,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,115,51,50,14 - PUSHBUTTON "Hilfe",9,169,51,50,14 - LTEXT "Geben Sie die neue IP-Adresse ein, die %1 in VLDB ersetzen soll:", - IDC_TITLE,4,4,215,17 - CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,42,28, - 87,11 - LTEXT "Adresse:",IDC_STATIC,4,30,28,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" -32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" -32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" -IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" -IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" -IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" -IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" -IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" -IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" -IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" -IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" -IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" -IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" -IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" -IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" -IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" -IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" -IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -ACCEL_MAIN ACCELERATORS DISCARDABLE -BEGIN - VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT - VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT - VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT - VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT - VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT - VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT - VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT - VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, - NOINVERT - VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVR_LISTS_TITLE "Server %1 - Admin-Listen" - IDS_TAB_SERVICES "Services" - IDS_TAB_AGGREGATES "Partitionen" - IDS_TAB_FILESETS "Volumes" - IDS_SERVICE_NONESELECTED "Wählen Sie einen anzuzeigenden Server aus." - IDS_SERVICE_GOTSELECTED "Service-Prozesse auf Server %1:" - IDS_AGGREGATE_ALL "Partitionen auf allen Servern:" - IDS_AGGREGATE_ONE "Partitionen auf Server %1:" - IDS_FILESET_ALL "Alle Volumes in Zelle %1:" - IDS_FILESET_ONE "Volumes auf Server %1:" - IDS_SVR_LISTS_TAB "Admin-Listen" - IDS_SVR_PROP_TITLE "Server %1 - Merkmale" - IDS_SVR_GENERAL_TAB "Allgemein" - IDS_SVR_SCOUT_TAB "Einstellungen" - IDS_SERVER_TITLE "Server %1 - AFS Server Manager" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_DESC "Server %1 in Zelle %2:" - IDS_SVC_PROP_TITLE "Service %2 auf Server %1 - Merkmale" - IDS_SVC_GENERAL_TAB "Allgemein" - IDS_SVC_ADD_TITLE "Service erstellen" - IDS_SVC_ADD_TAB "Service erstellen" - IDS_AGG_PROP_TITLE "Partition %2 auf Server %1 - Merkmale" - IDS_AGG_GENERAL_TAB "Allgemein" - IDS_SET_REP_TITLE "Volume %1 - Nachbildung" - IDS_SET_REPSITES_TAB "Nachbildungsstandorte" - IDS_SET_PROP_TITLE "Volume %1 - Merkmale" - IDS_SET_GENERAL_TAB "Allgemein" - IDS_SET_UNLOCKBTN "Jetzt Sperre &aufheben" - IDS_SET_LOCKBTN "Jetzt &sperren" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_USAGE_FILESET "%1 verwendet von %2 Quote (%3%%)" - IDS_USAGE_AGGREGATE "%1 verwendet von %2 Kapazität (%3%%)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGCOL_ALLOCATED "Kombinierte Quote" - IDS_SVRCOL_NAME "Server" - IDS_SVRCOL_STATUS "Status" - IDS_SETCOL_DATE_ACCESS "Letzter Zugriff" - IDS_SETCOL_DATE_BACKUP "Letzte Sicherung" - IDS_SVCCOL_NAME "Service" - IDS_SVCCOL_TYPE "Typ" - IDS_SVCCOL_PARAMS "Parameter" - IDS_SVCCOL_STATUS "Status" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_DATE_START "Zuletzt gestartet" - IDS_SVCCOL_DATE_STOP "Zuletzt gestoppt" - IDS_SVCCOL_DATE_STARTSTOP "Zuletzt gestartet/gestoppt" - IDS_SVCCOL_DATE_FAILED "Zuletzt fehlgeschlagen" - IDS_SVCCOL_LASTERROR "Letzter Exit-Code" - IDS_AGGCOL_NAME "Partition" - IDS_AGGCOL_ID "ID" - IDS_AGGCOL_DEVICE "Gerät" - IDS_AGGCOL_USED "Verwendet" - IDS_AGGCOL_USED_PER "% verwendet" - IDS_AGGCOL_FREE "Frei" - IDS_AGGCOL_TOTAL "Kapazität" - IDS_AGGCOL_STATUS "Status" - IDS_SETCOL_NAME "Volume" - IDS_SETCOL_TYPE "Typ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETCOL_DATE_CREATE "Erstellt" - IDS_SETCOL_DATE_UPDATE "Zuletzt aktualisiert" - IDS_SETCOL_STATUS "Status" - IDS_SETCOL_QUOTA_USED "Verwendet" - IDS_SETCOL_QUOTA_USED_PER "% verwendet" - IDS_SETCOL_QUOTA_FREE "Frei" - IDS_SETCOL_QUOTA_TOTAL "Quote" - IDS_TRYAGAINBTN "Erneut &versuchen" - IDS_NO_CELL_SELECTED "(Es wurde keine Zelle angegeben)" - IDS_NO_AFS_ID "(Es sind keine Token verfügbar)" - IDS_AFS_ID_WILLEXP "%1 (Token laufen %2 ab)" - IDS_ELAPSED_TIME "%1" - IDS_SEARCHING_FOR_SERVERS - "Bitte warten; Informationen über Zelle %1 werden abgerufen..." - IDS_STATUS_NOALERTS "Normal" - IDS_TITLE_BROWSE_USER "Benutzer auswählen" - IDS_AGGTYPE_OTHER "Unbekannt (%1)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATEFILESET "Volume %3 wird auf Partition %1:%2 erstellt" - IDS_ACTION_DELETEFILESET "Volume %3 wird von Partition %1:%2 gelöscht" - IDS_ACTION_MOVEFILESET "Volume %3 wird auf Partition %1:%2 verschoben" - IDS_ACTION_SETFILESETQUOTA "Die Quote für Volume %3 wird geändert" - IDS_SVCSTOP_DESC2 "Klicken Sie auf OK, um diesen Service zu stoppen." - IDS_SVCSTART_DESC2 "Klicken Sie auf OK, um diesen Service zu starten." - IDS_SYNCVLDB_SVR_DESC "Achtung!\n\nWenn Sie fortfahren, ändert der AFS Server Manager die VLDB, um die Inhalte aller Partitionen auf Server %1 abzugleichen." - IDS_SYNCVLDB_SVR_DESC2 "Wenn die VLDB ein Volume aufführt, das momentan in keiner Partition auf Server %1 gefunden werden kann, dann wird der VLDB-Eintrag für dieses Volume gelöscht!" - IDS_SYNCVLDB_AGG_DESC "Achtung!\n\nWenn Sie fortfahren, ändert der AFS Server Manager die VLDB, um die Inhalte von Partition %2 auf Server %1 abzugleichen." - IDS_SYNCVLDB_AGG_DESC2 "Wenn die VLDB ein Volume aufführt, das momentan nicht in dieser Partition gefunden werden kann, dann wird der VLDB-Eintrag für dieses Volume gelöscht!" - IDS_PROMPT_BROWSE_USER "Benutzer:" - IDS_PREVIEWIN_BUTTON "<< &Voranzeige" - IDS_PREVIEWOUT_BUTTON "Voran&zeige >>" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ADMCOL_TYPE_USER "Benutzer" - IDS_TITLE_BROWSE_PRINCIPAL "Principal auswählen" - IDS_TITLE_BROWSE_OWNGROUP "Eignergruppe auswählen" - IDS_PROMPT_BROWSE_PRINCIPAL "Principal:" - IDS_PROMPT_BROWSE_OWNGROUP "Eignergruppe:" - IDS_ACTION_CLONE "Sicherungsversion von Volume %3 wird erstellt" - IDS_ACTION_CLONESYS "Es werden mehrere Volume-Sicherungen erstellt" - IDS_CLONESYS_FAILED "Von Volume %1 konnte keine Sicherung erstellt werden, da der Fehler 0x%2 (%3) aufgetreten ist." - IDS_SET_UNSPECIFIED "(Nicht angegeben)" - IDS_SETCOL_ID "ID" - IDS_SETCOL_FILES "Dateianzahl" - IDS_SET_DUMP_NAME "Speicherauszug von %1.DMP" - IDS_ACTION_DUMP "Speicherauszug von Volume %3 wird erstellt (Partition %1:%2)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FILESETNAME_ERROR "%1 - %2" - IDS_SETCOL_AGGREGATE "Partition" - IDS_REFRESH_DESC_CELL "Der AFS Server Manager ermittelt den Status von Servern in Zelle %1. Dies kann einen Moment dauern..." - IDS_REFRESH_DESC_SERVER "Der AFS Server Manager ermittelt den Status von Server %1. Dies kann einen Moment dauern..." - IDS_REFRESH_CURRENT_CELL "Aktuelle Prüfung von: Zelle %1" - IDS_REFRESH_CURRENT_SERVER "Aktuelle Prüfung von: Server %2" - IDS_REFRESH_CURRENT_AGGREGATE - "Aktuelle Prüfung von: Partition %3 auf Server %2" - IDS_REFRESH_CURRENT_FILESET - "Aktuelle Prüfung von: Volume %4 auf Server %2, Partition %3" - IDS_REFRESH_CURRENT_SERVICE - "Aktuelle Prüfung von: Service %3 auf Server %2" - IDS_REFRESH_PERCENT "%1%% abgeschlossen" - IDS_PROBLEMS "Probleme" - IDS_SERVER_NO_PROBLEMS "Dieser Server weist keine bekannten Probleme auf." - IDS_SERVICE_NO_PROBLEMS "Dieser Service weist keine bekannten Probleme auf." - IDS_AGGREGATE_NO_PROBLEMS - "Diese Partition weist keine bekannten Probleme auf." - IDS_FILESET_NO_PROBLEMS "Dieses Volume weist keine bekannten Probleme auf." - IDS_AGGTYPE_TYPE1 "UFS" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGTYPE_TYPE2 "LFS" - IDS_AGGTYPE_TYPE3 "AIX" - IDS_AGGTYPE_TYPE4 "VXFS" - IDS_AGGTYPE_TYPE5 "DMEPI" - IDS_REFRESH_CURRENT_VLDB - "Aktuelle Prüfung von: Volume Location Database (VLDB, Datenbank der Volume-Adressen)" - IDS_FILESETTYPE_RW "Read/Write" - IDS_FILESETTYPE_RO "Replikat" - IDS_FILESETTYPE_CLONE "Sicherung" - IDS_MOVESET_READWRITE "Wenn Sie fortfahren, wird Volume %3 von Partition %2 auf Server %1 an eine andere Position verschoben." - IDS_MOVESET_READONLY "Wenn Sie fortfahren, wird das Volume-Replikat %3 von Partition %2 auf Server %1 entfernt. Desweiteren wird ein weiteres Volume-Replikat auf der Partition erstellt, die Sie unten angeben." - IDS_SVC_START_TITLE "Service starten" - IDS_SVC_STOP_TITLE "Service stoppen" - IDS_SERVICESTATUS_STARTING "Dieser Service wird momentan gestartet." - IDS_SERVICESTATUS_RUNNING "Dieser Service ist momentan aktiv." - IDS_SERVICESTATUS_STOPPED "Dieser Service wird momentan angehalten." - IDS_SERVICESTATUS_STOPPING "Dieser Service wird momentan gestoppt." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICESTATUS_UNKNOWN "Der Status dieses Services ist unbekannt." - IDS_SVC_RESTART_BUTTON "Jetzt stoppen und &neu starten" - IDS_PROBLEM_BOX "Bekannte Probleme (%1)" - IDS_VIEWLOG_DESC_NOFILE "Der AFS Server Manager konnte die Protokolldatei für Service %2 auf Server %1 nicht finden. Geben Sie unten den vollständigen Pfad zur Protokolldatei des Services ein." - IDS_NO_GROUP "(Keine Eignergruppe)" - IDS_VIEWLOG_FROMSERVER "Protokolldatei auf Server %1" - IDS_VIEWLOG_FROMSERVICE "Protokolldatei für Service %2 auf Server %1" - IDS_VIEWLOG_TRUNCATED "Dateiinhalte (es werden nur die letzten %1 Zeilen angezeigt):" - IDS_SAVELOG_FILTER "Textdatei|*.TXT|" - IDS_ADVANCEDIN_BUTTON "<< &Weitere" - IDS_ADVANCEDOUT_BUTTON "&Weitere >>" - IDS_REPTYPE_RELEASE "Nachbildung freigeben" - IDS_REPTYPE_SCHEDULED "Geplante Nachbildung" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_UPDATEALL_BUTTON "Alles akt&ualisieren" - IDS_UPDATETHIS_BUTTON "Akt&ualisieren" - IDS_SERVER_MULTIPLE_PROBLEMS - "Dieser Server weist %1 bekannte Probleme auf." - IDS_SERVICE_MULTIPLE_PROBLEMS - "Dieser Service weist %1 bekannte Probleme auf." - IDS_AGGREGATE_MULTIPLE_PROBLEMS - "Diese Partition weist %1 bekannte Probleme auf." - IDS_FILESET_MULTIPLE_PROBLEMS - "Dieses Volume weist %1 bekannte Probleme auf." - IDS_FILESETTYPE_RO_STAGE "Replikat" - IDS_SERVICETYPE_SIMPLE_LONG "Einfach (fortlaufende Ausführung)" - IDS_SERVICETYPE_CRON_LONG "Cron (Ausführung in bestimmten Intervallen)" - IDS_QUOTAUNITS_KB "KB" - IDS_QUOTAUNITS_MB "MB" - IDS_NO_QUOTA_REPLICA "(Bei diese Volume handelt es sich um ein Replikat und daher verfügt es über keine Quote)" - IDS_NO_QUOTA_CLONE "(Bei diese Volume handelt es sich um eine Sicherung und daher verfügt es über keine Quote)" - IDS_USAGE_REPLICA "%1 verwendet" - IDS_USAGE_CLONE "%1 verwendet" - IDS_COL_AGGS_MOVE "Bei der Erstellung eines Volumes erfolgt eine Partitionierung" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_SERVICE "%1:%2" - IDS_SERVICETYPE_SIMPLE "Einfach" - IDS_SERVICETYPE_CRON "Cron" - IDS_SERVICESTATE_STOPPED "Gestoppt" - IDS_SERVICESTATE_STOPPING "Wird gestoppt" - IDS_SERVICESTATE_STARTING "Wird gestartet" - IDS_SERVICESTATE_RUNNING "Aktiv" - IDS_SERVICETYPE_FS_LONG "FS (Dateisystem)" - IDS_SERVICETYPE_FS "FS" - IDS_SERVICE_LASTERROR "%1" - IDS_SERVICES_IN_CELL "Alle Services in Zelle %1:" - IDS_SERVICE_STARTDATE "%1 wurde gestartet" - IDS_SERVICE_STOPDATE "%1 wurde gestoppt" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_PERCENTAGE "%1 %%" - IDS_AGGREGATES_IN_SERVER "Partitionen auf Server %1:" - IDS_AGGREGATES_IN_CELL "Alle Partitionen in Zelle %1:" - IDS_AGGREGATES_IN_NOTHING "Partitionen:" - IDS_FILESETS_IN_SERVER "Volumes auf Server %1:" - IDS_FILESETS_IN_CELL "Alle Volumes in Zelle %1:" - IDS_FILESETS_IN_NOTHING "Volumes:" - IDS_SERVICES_IN_SERVER "Services auf Server %1:" - IDS_SERVICES_IN_NOTHING "Services:" - IDS_UNKNOWN "(Unbekannt)" - IDS_UNKNOWN_GROUP "Gruppe #%1 (Name nicht bekannt)" - IDS_AGGFULL_WARN_OFF "der Standardschwellenwert (Warnung ist auf dem Server inaktiviert)" - IDS_SERVER_AGGREGATE "%1:%2" - IDS_SERVERNAME_ERROR "%1 - %2" - IDS_AGGREGATENAME_ERROR "%1 - %2" - IDS_SETFULL_WARN_OFF "der Standardschwellenwert (Warnung ist auf dem Server inaktiviert)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_LASTERRORDATE "%1 - Exit-Code %2" - IDS_COL_SERVERS "Server in einer Zelle" - IDS_COL_FILESETS "Volumes auf einem Server" - IDS_COL_AGGREGATES "Partitionen auf einem Server" - IDS_COL_SERVICES "Services auf einem Server" - IDS_COL_REPLICAS "Replikate eines Volumes" - IDS_COLUMNS_TITLE "Anzeigespalten auswählen - AFS Server Manager" - IDS_REPCOL_SERVER "Server" - IDS_REPCOL_AGGREGATE "Partition" - IDS_REPCOL_DATE_UPDATE "Letzte Aktualisierung" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COL_AGGS_CREATE "Beim Verschieben eines Volumes erfolgt eine Partitionierung" - IDS_WARN_TITLE "Achtung" - IDS_WARN_DISABLE_AUTH "Wenn Sie auf ""Nicht authentifizierte erlauben"" klicken, ermöglichen Sie es nicht authentifizierten Principals, die Services auf diesem Server zu ändern. Da viele die Identität Root besitzen, stellt diese Aktion +" - IDS_WARN_DISABLE_AUTH2 "eine beachtliche Schwachstelle für die Sicherheit des Servers dar.\n\nSind Sie sicher, daß Sie diese Änderung vornehmen möchten?" - IDS_SVR_NO_ADDR "(Nicht angegeben)" - IDS_TITLE_BAD_CELL "Unbekannter Zellenname" - IDS_DESC_BAD_CELL "Der von Ihnen eingegebene Zellenname konnte nicht im Netzwerk gefunden werden.\n\nÜberprüfen Sie Ihren Eintrag erneut, um sicherzustellen, daß dieser korrekt ist." - IDS_AGGFULL_WARN_ON "der Stan&dardschwellenwert für diesen Server (%1%% seiner Größe)" - IDS_SETFULL_WARN_ON "der Stan&dardschwellenwert für diesen Server (%1%% seiner Größe)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS - "Die eingegebene AFS-ID wurde nicht erkannt, oder das angegebene Kennwort ist falsch." - IDS_CREDS_NONE "(keine Token)" - IDS_CREDS_VALID "%2, läuft %3 ab" - IDS_CREDS_EXPIRED "(Token %3 abgelaufen)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGG_FILESETS "%1 (Kombinierte Quote: %2)" - IDS_ACTION_DESC_NONE "Momentan laufen keine Operationen." - IDS_ACTION_DESC_ONE "Momentan läuft die folgende Operation:" - IDS_ACTION_DESC_MULT "Die folgenden Operationen sind momentan aktiv:" - IDS_ACTCOL_OPERATION "Operation" - IDS_ACTCOL_ELAPSED "Abgelaufene Zeit" - IDS_ACTION_REFRESH "Neuanzeige der Zelleninformationen" - IDS_ACTION_CREATESERVER "Server %1 wird erstellt" - IDS_ACTION_DELETESERVER "Server %1 wird gelöscht" - IDS_ACTION_GETSERVERLOGFILE - "Protokolldatei %2 wird von Server %1 abgerufen" - IDS_ACTION_SETSERVERAUTH - "Für Server %1 werden die Zugriffsbeschränkungen geändert" - IDS_ACTION_CHANGESERVERSTATUS "Die Merkmale von Server %1 werden geändert" - IDS_ACTION_STARTSERVICE "Service %2 wird auf Server %1 gestartet" - IDS_ACTION_STOPSERVICE "Service %2 wird auf Server %1 gestoppt" - IDS_ACTION_RESTARTSERVICE "Service %2 wird auf Server %1 erneut gestartet" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SYNCVLDB_SVR "VLDB wird mit Server %1 synchronisiert" - IDS_ACTION_SYNCVLDB_AGG "VLDB wird mit Partition %1:%2 synchronisiert" - IDS_ACTION_SCOUT "Server %1 wird auf Probleme untersucht" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SETREPPARAMS "Die Nachbildungsmerkmale für Volume %3 werden geändert" - IDS_ACTION_CREATEREPLICA - "Von Volume %3 wird auf Partition %1:%2 ein Replikat erstellt" - IDS_DELSET_REPLICA_DESC "Achtung!\n\nWenn Sie fortfahren, wird das Replikat von Volume %3 auf Partition %2 des Servers %1 entfernt." - IDS_DELSET_CLONE_DESC "Achtung!\n\nWenn Sie fortfahren, wird die Volume-Sicherung %3 von Partition %2 des Servers %1 entfernt." - IDS_INSTALL_DESC1 "Diese Operation kopiert eine Datei von diesem Computer auf einen anderen. +" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_INSTALL_DESC2 "Wenn die Datei bereits auf dem Zielcomputer vorhanden ist, wird diese gesichert und sie erhält die Erweiterung .BAK; vorhandene Sicherungen der Datei erhalten die Erweiterung .OLD, und vorhandene .OLD-Dateien werden gelöscht." - IDS_ACTION_INSTALLFILE "Datei %2 wird auf Server %1 installiert" - IDS_ACTION_UNINSTALLFILE "Datei %2 wird von Server %1 deinstalliert" - IDS_ACTION_PRUNEFILES "Dateien werden von Server %1 entfernt" - IDS_FILTER_ALLFILES "Alle Dateien|*.*|" - IDS_ACTION_RENAMEFILESET "Volume %1 wird in %2 umbenannt" - IDS_RECUR_DAILY "jeden Tag" - IDS_RECUR_SUNDAY "jeden Sonntag" - IDS_RECUR_MONDAY "jeden Montag" - IDS_RECUR_TUESDAY "jeden Dienstag" - IDS_RECUR_WEDNESDAY "jeden Mittwoch" - IDS_RECUR_THURSDAY "jeden Donnerstag" - IDS_RECUR_FRIDAY "jeden Freitag" - IDS_RECUR_SATURDAY "jeden Samstag" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATESERVICE "Service %2 wird auf Server %1 erstellt" - IDS_ACTION_DELETESERVICE "Service %2 wird von Server %1 gelöscht" - IDS_ACTION_RELEASEFILESET "Volume %3 wird freigegeben" - IDS_ACTION_GETDATES "Datumsangaben werden für Datei %2 auf Server %1 abgerufen" - IDS_LASTMODIFIED "Letzte Änderung %1" - IDS_SVR_SECURITY_TITLE "Server-Sicherheit - %1" - IDS_SVR_LIST_TAB "Administratoren" - IDS_ACTION_ADMINLIST_LOAD "Administratoren werden für Server %1 abgerufen" - IDS_ACTION_ADMINLIST_SAVE - "Administratoren werden für Server %1 geschrieben" - IDS_ADMCOL_PRINCIPAL "Mitglied" - IDS_ADMCOL_TYPE "Typ" - IDS_ADMCOL_TYPE_GROUP "Gruppe" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_RESTORE "Volume %1 wird wiederhergestellt" - IDS_COL_AGGS_RESTORE "Beim Wiederherstellen eines Volumes erfolgt eine Partitionierung" - IDS_RESTORE_FILTER "Volume-Speicherauszugsdateien|*.DMP|Alle Dateien|*.*|" - IDS_SVC_BOS_TAB "BOS" - IDS_ACTION_SETRESTART "Neustartzeiten der Services werden für Server %1 geändert" - IDS_RESTORE_CREATESET "Volume %1 wird auf dem Server und der Partition erstellt, die von Ihnen unten angegeben werden." - IDS_RESTORE_OVERWRITESET - "Achtung! Volume %3 ist auf Partition %2 von Server %1 vorhanden und wird überschrieben, wenn Sie fortfahren!" - IDS_SUBSET_TITLE_LOAD "Server-Untergruppe öffnen" - IDS_SUBSET_TITLE_SAVE "Server-Untergruppe speichern" - IDS_BUTTON_OPEN "Ö&ffnen" - IDS_BUTTON_SAVE "&Speichern" - IDS_SUBSET_SAVE_TITLE "Achtung" - IDS_SUBSET_SAVE_DESC "Es ist bereits eine Server-Untergruppe mit Namen %1 vorhanden.\n\nMöchten Sie diese Untergruppe überschreiben?" - IDS_SUBSET_CHANGED "%1 [GEÄNDERT]" - IDS_SUBSET_TAB "Überwachte Server" - IDS_SUBSET_DISCARD_TITLE "Untergruppen speichern?" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SUBSET_DISCARD_DESC "Sie haben die Liste momentan überwachter Server nicht als Untergruppe gespeichert. Wenn Sie diese Liste speichern, können Sie sie später verwenden, um mit der Überwachung derselben Server-Gruppe fortzufahren.\n\n+" - IDS_SUBSET_DISCARD_DESC2 - "Möchten Sie eine Untergruppe erstellen, die die Liste der momentan überwachten Server enthält?" - IDS_SUBSET_NONAME "(Nicht benannt)" - IDS_SUBSET_NOSUBSET "(Alle Server werden überwacht)" - IDS_SUBSET_SERVERSUBSET "Server %1" - IDS_FILESET_SOME "Volumes aller überwachten Server in Zelle %1:" - IDS_AGGREGATE_SOME "Partitionen aller überwachten Server in Zelle %1:" - IDS_SERVICE_SOME "Services aller überwachten Server in Zelle %1:" - IDS_FILESET_UNMON "Server %1 wird nicht überwacht" - IDS_AGGREGATE_UNMON "Server %1 wird nicht überwacht" - IDS_SERVICE_UNMON "Server %1 wird nicht überwacht" - IDS_SUBSET_DELETE_TITLE "Untergruppe löschen?" - IDS_SUBSET_DELETE_DESC "Sind Sie sicher, daß Sie die Server-Untergruppe %1 löschen möchten?" - IDS_ERROR_TRANSLATED "Fehlernummer 0x%1 (%2):\n\n%3" - IDS_ERROR_NOTTRANSLATED "Fehlernummer 0x%1 (%2) wurde nicht erkannt." - IDS_FIND_NOTHING_TITLE "Kein Befehl ausgewählt" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FIND_NOTHING_DESC "Um festzustellen, wie eine Operation durchgeführt wird, wählen Sie zunächst eine Befehlszeile aus der Liste aus, oder geben Sie ein Schlüsselwort ein." - IDS_FIND_UNKNOWN_TITLE "Unbekannter Befehl" - IDS_FIND_UNKNOWN_DESC "Der AFS Server Manager konnte für den Befehl ""%1"" keine Hilfethemen finden." - IDS_HELPABOUT_DESC1 "Achtung: Dieses Computerprogramm ist durch Copyright und internationale Verträge geschützt. +" - IDS_HELPABOUT_DESC2 "Nicht autorisierte Vervielfältigung oder Verteilung dieser Lizenzsoftware oder Teilen davon wird strafrechtlich verfolgt.\n\n+" - IDS_HELPABOUT_DESC3 "AFS ist eine Marke von Transarc Corporation, einer Firma von IBM." - IDS_CANT_QUIT_TITLE "AFS Server Manager" - IDS_CANT_QUIT_REBOOT "Achtung!\n\nDer AFS Server Manager führt momentan eine oder mehrere Operationen durch. Wenn Sie Windows jetzt herunterfahren, können diese Operationen nicht erfolgreich abgeschlossen werden.\n\nSind Sie sicher, daß Sie Windows neu starten möchten?" - IDS_APP_TITLE "AFS Server Manager" - IDS_ACTION_OPENCELL "In Zelle %1 wird nach Servern gesucht" - IDS_OPTIONS_TITLE "Optionen - AFS Server Manager" - IDS_OPTIONS_GENERAL_TAB "Allgemein" - IDS_BADCREDS_DESC "Wenn Sie nicht als Administrator angemeldet sind, besitzen Sie keine ausreichenden Berechtigungen, die Zelle %1 zu verwalten. Nicht ausreichende Berechtigungen können dazu führen, daß der AFS Server Manager Probleme in einer Zelle entdeckt, in der keine Probleme existieren." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CONFIRMATION_TITLE "Bestätigung - AFS Server Manager" - IDS_NO_GROUP_CHECKBOX "Keine Eignergruppe" - IDS_AFS_ID_DIDEXP "%1 (Token abgelaufen %2)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_QUERYING "(Abfragen)" - IDS_ADMCOL_TYPE_FOREIGN_GROUP "Fremdgruppe" - IDS_ADMCOL_TYPE_FOREIGN_USER "Fremdbenutzer" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_NOTIFIER "Benachrichtigung" - IDS_SVC_NONOTIFIER "(keine)" - IDS_SVR_KEY_TAB "Server-Schlüssel" - IDS_KEYNAME_NOTIME "Schlüssel für Server %1:" - IDS_KEYNAME_WITHTIME "Schlüssel für Server %1 (geändert %2):" - IDS_SVRKEY_VERSION "Version" - IDS_SVRKEY_DATA "Wert" - IDS_SVRKEY_CHECKSUM "Kontrollsumme" - IDS_SVRKEY_DATA_UNKNOWN "(verdeckt)" - IDS_STARTSERVICE_TITLE "Service starten" - IDS_STOPSERVICE_TITLE "Service stoppen" - IDS_STARTSERVICE_TEXT "Klicken Sie auf OK, um Service %2 auf Server %1 zu starten." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STOPSERVICE_TEXT "Klicken Sie auf OK, um Service %2 auf Server %1 zu stoppen." - IDS_STARTSERVICE_STARTUP - "Sie können diese Änderung permanent machen, damit Service %2 automatisch gestartet wird, wenn Server %1 erneut gestartet wird." - IDS_STOPSERVICE_STARTUP "Sie können diese Änderung permanent machen, damit Service %2 nicht automatisch gestartet wird, wenn Server %1 erneut gestartet wird." - IDS_STARTSERVICE_PERMANENT - "&Permanent (Service %2 starten, wenn Server %1 neu gestartet wird)" - IDS_STARTSERVICE_TEMPORARY - "&Temporär (Service %2 nicht starten, wenn Server %1 neu gestartet wird)" - IDS_STOPSERVICE_PERMANENT - "&Permanent (Service %2 nicht starten, wenn Server %1 neu gestartet wird)" - IDS_STOPSERVICE_TEMPORARY - "&Temporär (Service %2 starten, wenn Server %1 neu gestartet wird)" - IDS_ACTION_EXECUTE "%2 wird auf Server %1 ausgeführt" - IDS_ACTION_SALVAGE_SVR "Alle Volumes auf Server %1 werden wiederhergestellt" - IDS_ACTION_SALVAGE_AGG "Alle Volumes auf Partition %1:2 werden wiederhergestellt" - IDS_ACTION_SALVAGE_VOL "Volume %3 wird auf Partition %1:2 wiederhergestellt" - IDS_SALVAGE_SVR "Alle Volumes auf Server %1 wiederherstellen" - IDS_SALVAGE_AGG "Alle Volumes auf Server %1, Partition %2 wiederherstellen" - IDS_SALVAGE_SET "Volume %3 auf Server %1, Partition %2 wiederherstellen" - IDS_SETSTATUS_SALVAGE "Volume wird wiederhergestellt" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETSTATUS_LOCKED "Volume ist gesperrt" - IDS_SETSTATUS_NO_VOL "Volume fehlt" - IDS_SETSTATUS_BUSY "Volume ist momentan ausgelastet" - IDS_SETSTATUS_MOVED "Volume wurde verschoben" - IDS_SVR_CAPACITY "%1" - IDS_SVR_ALLOCATION "%1 (%2%%)" - IDS_SVRCOL_ADDRESS "Adresse" - IDS_HOST_TITLE "Vom Server %1 erkannte Datenbank-Host-Server:" - IDS_SVR_HOSTS_TITLE "Server %1 - Datenbank-Hosts" - IDS_SVR_HOST_TAB "Datenbank-Hosts" - IDS_ACTION_HOSTLIST_LOAD "Host-Liste wird von Server %1 abgerufen" - IDS_ACTION_HOSTLIST_SAVE "Host-Liste wird auf Server %1 geschrieben" - IDS_SETSTATUS_1ALERT "Volume weist ein Problem auf" - IDS_SETSTATUS_2ALERT "Volume weist %1 Probleme auf" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CHANGEADDR "IP-Adresse wird für Server %1 geändert" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_ADDSITE "vos addsite" - IDS_COMMAND_VOS_BACKUP "vos backup" - IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" - IDS_COMMAND_VOS_CREATE "vos create" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_DELENTRY "vos delentry" - IDS_COMMAND_VOS_DUMP "vos dump" - IDS_COMMAND_VOS_EXAMINE "vos examine" - IDS_COMMAND_VOS_LISTPART "vos listpart" - IDS_COMMAND_VOS_LISTVLDB "vos listvldb" - IDS_COMMAND_VOS_LISTVOL "vos listvol" - IDS_COMMAND_VOS_LOCK "vos lock" - IDS_COMMAND_VOS_MOVE "vos move" - IDS_COMMAND_VOS_PARTINFO "vos partinfo" - IDS_COMMAND_VOS_RELEASE "vos release" - IDS_COMMAND_VOS_REMOVE "vos remove" - IDS_COMMAND_VOS_REMSITE "vos remsite" - IDS_COMMAND_VOS_RENAME "vos rename" - IDS_COMMAND_VOS_RESTORE "vos restore" - IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" - IDS_COMMAND_VOS_UNLOCK "vos unlock" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" - IDS_COMMAND_VOS_ZAP "vos zap" - IDS_COMMAND_BOS_ADDHOST "bos addhost" - IDS_COMMAND_BOS_ADDKEY "bos addkey" - IDS_COMMAND_BOS_ADDUSER "bos adduser" - IDS_COMMAND_BOS_CREATE "bos create" - IDS_COMMAND_BOS_DELETE "bos delete" - IDS_COMMAND_BOS_EXEC "bos exec" - IDS_COMMAND_BOS_GETDATE "bos getdate" - IDS_COMMAND_BOS_GETLOG "bos getlog" - IDS_COMMAND_BOS_GETRESTART "bos getrestart" - IDS_COMMAND_BOS_INSTALL "bos install" - IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" - IDS_COMMAND_BOS_LISTKEYS "bos listkeys" - IDS_COMMAND_BOS_LISTUSERS "bos listusers" - IDS_COMMAND_BOS_PRUNE "bos prune" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_BOS_REMOVEHOST "bos removehost" - IDS_COMMAND_BOS_REMOVEKEY "bos removekey" - IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" - IDS_COMMAND_BOS_RESTART "bos restart" - IDS_COMMAND_BOS_SALVAGE "bos salvage" - IDS_COMMAND_BOS_SETAUTH "bos setauth" - IDS_COMMAND_BOS_SETRESTART "bos setrestart" - IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" - IDS_COMMAND_BOS_START "bos start" - IDS_COMMAND_BOS_STARTUP "bos startup" - IDS_COMMAND_BOS_STATUS "bos status" - IDS_COMMAND_BOS_STOP "bos stop" - IDS_COMMAND_BOS_UNINSTALL "bos uninstall" - IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" - IDS_COMMAND_FS_LISTQUOTA "fs listquota" - IDS_COMMAND_FS_QUOTA "fs quota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_FS_SETQUOTA "fs setquota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCSHORT_UNMONITORED - "Server %1 wird nicht auf Probleme hin überwacht" - IDS_ALERT_DESCSHORT_TIMEOUT - "Kontakt zu Server %1 konnte nicht hergestellt werden; letzter Fehler: %3" - IDS_ALERT_DESCSHORT_AGG_FULL - "Die Partitionsbelegung für %2 überschreitet den Warnschwellenwert von %3%% (%4)" - IDS_ALERT_DESCSHORT_SET_FULL - "Die Volume-Belegung für %3 überschreitet den Warnschwellenwert von %4%% (%5)" - IDS_ALERT_DESCSHORT_NO_VLDBENT - "Volume %3 verfügt über keinen VLDB-Eintrag" - IDS_ALERT_DESCSHORT_NO_SVRENT_SET - "Volume %3 besitzt einen VLDB-Eintrag, konnte aber nicht auf Partition %2 des Servers %1 gefunden werden" - IDS_ALERT_DESCSHORT_STOPPED "Service %2 um %3 gestoppt" - IDS_ALERT_DESCSHORT_NO_SVRENT_AGG - "Verweis auf Partition %2 von VLDB; diese konnte aber auf Server %1 nicht gefunden werden" - IDS_ALERT_DESCSHORT_BADCREDS - "Sie verfügen möglicherweise nicht über ausreichende Berechtigungen, um Server %1 zu verwalten" - IDS_ALERT_DESCSHORT_AGG_ALLOC - "Die kombinierte Volume-Quote auf Partition %2 überschreitet ihre Kapazität" - IDS_ALERT_DESCSHORT_STATE_NO_VNODE - "Das Volume %3 ist beschädigt und kann nicht verwendet werden." - IDS_ALERT_DESCSHORT_STATE_NO_SERVICE - "Es ist kein Service aktiv, um Volume %3 zu dienen." - IDS_ALERT_DESCSHORT_STATE_OFFLINE - "Volume %3 ist offline und kann nicht verwendet werden." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_TIMEOUT - "Der Kontakt konnte zu Server %1 nicht hergestellt werden. Der letzte Versuch, der um %2 durchgeführt wurde, hat den Fehler ""%3"" ergeben." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_AGG_FULL - "Die Belegung von Partition %2 auf Server %1 überschreitet ihren Warnschwellenwert von %3%% (%4)." - IDS_ALERT_DESCFULL_SET_FULL - "Die Belegung von Volume %3 (Server %1, Partition %2) überschreitet dessen Warnschwellenwert von %4%% (%5)." - IDS_ALERT_DESCFULL_NO_VLDBENT - "Volume %3 ist auf Partition %2 des Servers %1 vorhanden, verfügt aber über keinen entsprechenden VLDB-Eintrag." - IDS_ALERT_DESCFULL_NO_SVRENT_SET - "Für Volume %3 ist ein VLDB-Eintrag vorhanden, das Volume konnte aber auf Partition %2 des Servers %1 nicht gefunden werden." - IDS_ALERT_DESCFULL_STOPPED - "Der Service %2 des Servers %1 wurde um %3 mit Exit-Code %5 gestoppt." - IDS_ALERT_DESCFULL_NO_SVRENT_AGG - "Die VLDB verweist auf Volumes der Partition %2 des Servers %1, die Partition konnte jedoch nicht gefunden werden." - IDS_ALERT_DESCFULL_BADCREDS - "Der AFS Server Manager kann möglicherweise Fehler entdecken, die auf Server %1 nicht existieren, da Sie nicht über AFS-Token als Administrator in dieser Zelle verfügen." - IDS_ALERT_DESCFULL_AGG_ALLOC - "Die kombinierte Quote von Volumes auf Partition %2 des Servers %1, die zusammen %4 ergibt, überschreitet die Kapazität der Partition von %3." - IDS_ALERT_DESCFULL_STATE_NO_VNODE - "Das Volume %3 auf Partition %2 des Servers %1 verfügt über keinen zugeordneten Vnode. (Volume-Status ist 0x%4.)" - IDS_ALERT_DESCFULL_STATE_NO_SERVICE - "Auf Server %1 ist kein Dateiexportservice aktiv, daher kann Volume %3 auf Partition %2 nicht verwendet werden. (Volume-Status ist 0x%4.)" - IDS_ALERT_DESCFULL_STATE_OFFLINE - "Das Volume %3 auf Partition %2 des Servers %1 ist offline und kann nicht verwendet werden. (Volume-Status ist 0x%4.)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_TIMEOUT "Klicken Sie auf Erneut versuchen, um erneut zu versuchen, den Kontakt zu diesem Server herzustellen." - IDS_ALERT_FIX_AGG_FULL "Klicken Sie auf Warnungen, um den Warnschwellenwert für die Belegung dieser Partition zu ändern." - IDS_ALERT_FIX_SET_FULL "Klicken Sie auf Warnungen, um den Warnschwellenwert für die Belegung dieses Volumes zu ändern." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_NO_VLDBENT - "Die VLDB ist möglicherweise nicht auf dem neuesten Stand; in diesem Fall verwenden Sie den Befehl VLDB synchronisieren, um diese zu aktualisieren." - IDS_ALERT_FIX_NO_SVRENT_SET - "Prüfen Sie den Server und die Partition, um sicherzustellen, daß diese einwandfrei funktionieren." - IDS_ALERT_FIX_STOPPED "Klicken Sie auf Protokoll anzeigen, um das Service-Protokoll für diesen Service anzuzeigen." - IDS_ALERT_FIX_NO_SVRENT_AGG - "Prüfen Sie den Server, um sicherzustellen, daß die Partition exportiert wurde und einwandfrei funktioniert." - IDS_ALERT_FIX_BADCREDS "Klicken Sie auf Authentifizierung, um neue AFS-Token zu erhalten." - IDS_ALERT_FIX_AGG_ALLOC "Verkleinern Sie die Quote für Volumes auf dieser Partition, oder verschieben Sie ein oder mehrere Volumes auf eine andere Partition." - IDS_ALERT_FIX_STATE_NO_VNODE " " - IDS_ALERT_FIX_STATE_NO_SERVICE " " - IDS_ALERT_FIX_STATE_OFFLINE " " -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_BUTTON_TRYAGAIN "Erneut &versuchen" - IDS_ALERT_BUTTON_WARNINGS "&Warnungen..." - IDS_ALERT_BUTTON_VIEWLOG "Protokoll &anzeigen" - IDS_ALERT_BUTTON_SHOWME "A&nzeigen" - IDS_ALERT_BUTTON_GETCREDS "Au&thentifizierung" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_CELLSERVERS_NOCELL - "Es wurde keine Zelle angegeben. Sie müssen die AFS-Zelle angeben, mit der Sie arbeiten möchten, um den AFS Server Manager zu verwenden. Wählen Sie eine Zelle aus, indem Sie das Menüelement ""Öffnen..."" im Menü ""Zelle"" auswählen." - IDS_ERROR_REFRESH_CELLSERVERS - "Die Liste der Server konnte für die Zelle %1 nicht abgerufen werden.\n\nFehler: %2" - IDS_ERROR_CANT_OPEN_CELL - "Der AFS Server Manager konnte keine Server in der Zelle %1 erreichen.\n\nBitte überprüfen Sie, ob der Name der Zelle richtig eingegeben wurde." - IDS_ERROR_REFRESH_AGGREGATES - "Die Liste der Partitionen konnte für Server %1 nicht abgerufen werden.\n\nFehler: %2" - IDS_ERROR_REFRESH_SERVER_STATUS - "Der aktuelle Status von Server %1 konnte nicht abgerufen werden." - IDS_ERROR_CHANGE_SERVER_STATUS - "Der AFS Server Manager konnte die Merkmale für Server %1 nicht ändern." - IDS_ERROR_REFRESH_AGGREGATE_STATUS - "Der aktuelle Status von Partition %2 auf Server %1 konnte nicht abgerufen werden." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_FILESET_STATUS - "Der aktuelle Status von Volume %3 (Server %1, Partition %2) konnte nicht abgerufen werden." - IDS_ERROR_REFRESH_SERVICE_STATUS - "Der aktuelle Status von Service %2 auf Server %1 konnte nicht ermittelt werden." - IDS_ERROR_MOVE_FILESET "Der AFS Server Manager konnte Volume %3 nicht von Partition %2 des Servers %1 zu Partition %5 auf Server %4 verschieben." - IDS_ERROR_VIEW_LOGFILE "Die Datei %2 konnte von Server %1 nicht gelesen werden.\n\nPrüfen Sie, ob der Name der Datei richtig eingegeben wurde, und ob Sie über ausreichende Berechtigungen verfügen, um die Datei anzuzeigen." - IDS_ERROR_NOT_REPLICATED - "Der Nachbildungsstatus von Volume %1 konnte nicht ermittelt werden." - IDS_ERROR_CANT_CREATE_FILESET - "Der AFS Server Manager konnte Volume %3 auf Partition %2 des Servers %1 nicht erstellen." - IDS_ERROR_CANT_DELETE_FILESET - "Der AFS Server Manager konnte Volume %3 (Partition %2 von Server %1) nicht löschen." - IDS_ERROR_CANT_CREATE_VLDB_ENTRY - "Der AFS Server Manager konnte keinen VLDB-Eintrag für Volume %3 auf Partition %2 des Servers %1 erstellen." - IDS_ERROR_CANT_SET_FILESET_QUOTA - "Der AFS Server Manager konnte die Quote für Volume %3 auf Partition %2 des Servers %1 nicht ändern." - IDS_ERROR_CANT_CREATE_SERVER - "Der AFS Server Manager konnte den angeforderten Server-Eintrag in Zelle %1 nicht erstellen." - IDS_ERROR_CANT_PING_SERVER - "Der AFS Server Manager konnte die IP-Adresse von Server %1 nicht ermitteln." - IDS_ERROR_CANT_DELETE_SERVER - "Der AFS Server Manager konnte Server %1 nicht löschen." - IDS_ERROR_CANT_DELETE_SERVER_FILESETS - "Server %1 konnte nicht gelöscht werden, da er weiterhin ein oder mehrere Volumes enthält. Ein Server kann nur gelöscht werden, wenn er keine Volumes enthält." - IDS_ERROR_CHANGE_AGGREGATE_STATUS - "Der AFS Server Manager konnte die Merkmale für Partition %2 auf Server %1 nicht ändern." - IDS_ERROR_CHANGE_SERVICE_STATUS - "Der AFS Server Manager konnte die Merkmale für Service %2 auf Server %1 nicht ändern." - IDS_ERROR_CANT_START_SERVICE - "Der AFS Server Manager konnte Service %2 auf Server %1 nicht starten." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_STOP_SERVICE - "Der AFS Server Manager konnte Service %2 auf Server %1 nicht stoppen." - IDS_ERROR_CANT_RESTART_SERVICE - "Der AFS Server Manager konnte Service %2 auf Server %1 nicht stoppen und erneut starten." - IDS_ERROR_CHANGE_REPLICA_STATUS - "Der AFS Server Manager konnte die Nachbildungsmerkmale für Volume %3 auf Partition %2 des Servers %1 nicht ändern." - IDS_ERROR_CANT_SYNCVLDB "Der AFS Server Manager konnte die VLDB nicht aktualisieren." - IDS_ERROR_CANT_CREATE_REPLICA - "Der AFS Server Manager konnte kein Replikat von Volume %3 auf Partition %2 des Servers %1 erstellen." - IDS_ERROR_CANT_INSTALL_FILE - "Der AFS Server Manager konnte die Datei %2 auf Server %1 nicht installieren." - IDS_ERROR_CANT_UNINSTALL_FILE - "Der AFS Server Manager konnte die Datei %2 von Server %1 nicht deinstallieren." - IDS_ERROR_CANT_PRUNE_FILES - "Der AFS Server Manager konnte die angeforderten Dateien nicht von Server %1 entfernen." - IDS_ERROR_CANT_RENAME_FILESET - "Der AFS Server Manager konnte Volume %1 nicht in ""%2"" umbenennen." - IDS_ERROR_CANT_CREATE_SERVICE - "Der AFS Server Manager konnte Service %2 nicht auf Server %1 erstellen." - IDS_ERROR_CANT_DELETE_SERVICE - "Der AFS Server Manager konnte Service %2 nicht von Server %1 löschen." - IDS_ERROR_CANT_RELEASE_FILESET - "Der AFS Server Manager konnte das nachgebildete Volume %3 nicht freigeben." - IDS_ERROR_CANT_UPDATE_FILESET - "Der AFS Server Manager konnte das Volume-Replikat %3 auf Partition %1 des Servers %2 nicht aktualisieren." - IDS_ERROR_CANT_UPDATE_ALL - "Der AFS Server Manager konnte Replikate von Volume %3 nicht aktualisieren." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_LOAD_ADMLIST - "Der AFS Server Manager konnte die Liste der Administratoren für Server %1 nicht lesen." - IDS_ERROR_CANT_LOAD_KEYLIST - "Der AFS Server Manager konnte die Liste der Server-Schlüssel für Server %1 nicht lesen." - IDS_ERROR_CANT_CREATE_KEY - "Der AFS Server Manager konnte keinen neuen Server-Schlüssel für Server %1 erstellen." - IDS_ERROR_CANT_SAVE_ADMLIST - "Der AFS Server Manager konnte die Liste der Administratoren für Server %1 nicht ändern." - IDS_ERROR_CANT_CLONE "Der AFS Server Manager konnte keine Sicherungskopie von Volume %3 auf Partition %2 des Servers %1 erstellen." - IDS_ERROR_CANT_CLONESYS "Der AFS Server Manager konnte keine der angeforderten Sicherungs-Volumes erstellen." - IDS_ERROR_CANT_DUMP_FILESET - "Der AFS Server Manager konnte keinen Speicherauszug von Volume %3 (Server %1, Partition %2) in Datei %4 erstellen." - IDS_ERROR_CANT_RESTORE_FILESET - "Der AFS Server Manager konnte Datei %4 auf Volume %3 (Server %1, Partition %2) nicht wiederherstellen." - IDS_ERROR_CANT_SET_RESTART_TIMES - "Der AFS Server Manager konnte die Neustartzeiten für Services auf Server %1 nicht ändern." - IDS_ERROR_CANT_DELETE_REPLICATED_FILESET - "Der AFS Server Manager konnte Volume %3 von Partition %2 des Servers %1 nicht löschen.\n\nVolume %3 kann nicht gelöscht werden, bevor alle Replikate gelöscht wurden." - IDS_CMDLINE_TITLE "Fehler - AFS Server Manager" - IDS_CMDLINE_SYNTAX "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig." - IDS_CMDLINE_UNRECOGNIZED - "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nParameter ""%1"" wurde nicht erkannt." - IDS_CMDLINE_DUPLICATE "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nDer Parameter ""%1"" wurde mehrmals angegeben." - IDS_CMDLINE_UNEXPECTVALUE - "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nDem Parameter ""%1"" darf kein Wert zugewiesen werden." - IDS_CMDLINE_MISSINGVAL "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nDem Parameter ""%1"" muß ein Wert folgen." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CMDLINE_SUBSETNOTCELL - "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nDer Parameter ""/SUBSET"" kann nur zusammen mit dem Parameter ""/CELL"" angegeben werden." - IDS_CMDLINE_INVALIDSUBSET - "Die von Ihnen angegebene Server-Untergruppe, ""%2"", wurde nicht für die Zelle %1 definiert." - IDS_CMDLINE_SERVERNOTCELL - "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nDer Parameter ""/SERVER"" kann nur zusammen mit dem Parameter ""/CELL"" angegeben werden." - IDS_CMDLINE_RESET_TITLE "AFS Server Manager" - IDS_CMDLINE_RESET_DESC "Der AFS Server Manager hat die angegebenen Einstellungen gelöscht." - IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE - "Der AFS Server Manager konnte die VLDB nicht mit Partition %2 von Server %1 synchronisieren, da die Partition entweder nicht vorhanden ist oder nicht exportiert wurde.\n\nWenn Sie diese Partition vom Server %1 entfernen möchten, müssen Sie die VLDB-Einträge der Volumes löschen, die darauf verweisen." - IDS_CMDLINE_USERPASSWORD - "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nUm neue AFS-Token zu erhalten, müssen die Parameter ""/USER"" und ""/PASSWORD"" angegeben werden." - IDS_ERROR_CANT_DELETE_KEY - "Der AFS Server Manager konnte Server-Schlüssel %2 nicht von Server %1 löschen." - IDS_ERROR_CANT_GETRANDOMKEY - "Der AFS Server Manager konnte keinen wahlfreien Schlüssel für Server %1 erstellen." - IDS_ERROR_CANT_EXECUTE_COMMAND - "Der AFS Server Manager konnte den folgenden Befehl nicht auf Server %1 ausführen:\n\n ""%2""" - IDS_ERROR_CANT_READ_SALVAGE_LOG - "Der AFS Server Manager hat die Wiederherstellung erfolgreich abgeschlossen, konnte jedoch die Protokolldatei nicht abrufen, die die einzelnen Ergebnisse der Wiederherstellung beschreibt." - IDS_ERROR_CANT_SALVAGE "Der AFS Server Manager konnte die angeforderte Wiederherstellung nicht durchführen." - IDS_ERROR_CANT_AUTH_ON "Der AFS Server Manager konnte die Überprüfung der Authentifizierung für Server %1 nicht aktivieren." - IDS_ERROR_CANT_AUTH_OFF "Der AFS Server Manager konnte die Überprüfung der Authentifizierung für Server %1 nicht inaktivieren." - IDS_ERROR_CANT_LOAD_HOSTLIST - "Der AFS Server Manager konnte die Liste der Datenbank-Host-Server nicht von Server %1 lesen." - IDS_ERROR_CANT_SAVE_HOSTLIST - "Der AFS Server Manager konnte die Liste der Datenbank-Host-Server auf Server %1 nicht ändern." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL - "Der AFS Server Manager konnte nicht gestartet werden, da das AFS Control Center nicht ordnungsgemäß installiert wurde.\n\nSie müssen das AFS Control Center möglicherweise erneut installieren." - IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN - "Der AFS Server Manager konnte aufgrund eines unbekannten Problems nicht gestartet werden.\n\nSie müssen das AFS Control Center möglicherweise erneut installieren." - IDS_ERROR_CANT_CHANGEADDR - "Der AFS Server Manager konnte die IP-Adresse in der VLDB für Server %1 nicht ändern." -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_SERVICES, DIALOG + BEGIN + RIGHTMARGIN, 165 + END + + IDD_AGGREGATES, DIALOG + BEGIN + RIGHTMARGIN, 118 + END + + IDD_FILESETS, DIALOG + BEGIN + RIGHTMARGIN, 180 + END + + IDD_SVR_LISTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_AGG_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 262 + TOPMARGIN, 5 + BOTTOMMARGIN, 154 + END + + IDD_SVR_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 183 + END + + IDD_SVR_SCOUT, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 216 + TOPMARGIN, 5 + BOTTOMMARGIN, 153 + END + + IDD_SVC_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 268 + TOPMARGIN, 5 + BOTTOMMARGIN, 209 + END + + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 315 + TOPMARGIN, 2 + BOTTOMMARGIN, 224 + END + + IDD_SERVER, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 207 + TOPMARGIN, 2 + BOTTOMMARGIN, 135 + END + + IDD_SVC_CREATE, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 228 + END + + IDD_SET_REPSITES, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 216 + TOPMARGIN, 5 + BOTTOMMARGIN, 163 + END + + IDD_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 7 + BOTTOMMARGIN, 253 + HORZGUIDE, 160 + END + + IDD_TIMEOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 232 + TOPMARGIN, 7 + BOTTOMMARGIN, 153 + END + + IDD_COLUMNS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 281 + TOPMARGIN, 5 + BOTTOMMARGIN, 143 + END + + IDD_REFRESHALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 260 + TOPMARGIN, 7 + BOTTOMMARGIN, 68 + END + + IDD_SET_CREATE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 317 + TOPMARGIN, 4 + BOTTOMMARGIN, 205 + END + + IDD_SET_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 98 + END + + IDD_SET_CLONE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 341 + TOPMARGIN, 7 + BOTTOMMARGIN, 81 + END + + IDD_SVC_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 189 + END + + IDD_SVR_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 152 + END + + IDD_AGG_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 252 + TOPMARGIN, 5 + BOTTOMMARGIN, 146 + END + + IDD_SET_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 268 + TOPMARGIN, 5 + BOTTOMMARGIN, 177 + END + + IDD_SET_MOVETO, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 170 + END + + IDD_SET_MOVING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SVC_LOGNAME, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 102 + END + + IDD_SVC_VIEWLOG, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 181 + END + + IDD_SET_SETQUOTA, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 267 + TOPMARGIN, 4 + BOTTOMMARGIN, 126 + END + + IDD_ACTIONS, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 234 + TOPMARGIN, 2 + BOTTOMMARGIN, 56 + END + + IDD_SVR_SYNCVLDB, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 265 + TOPMARGIN, 4 + BOTTOMMARGIN, 95 + END + + IDD_SET_CREATEREP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 167 + END + + IDD_SVR_INSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 163 + END + + IDD_SVR_UNINSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 135 + END + + IDD_SVR_PRUNE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 257 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_SET_RENAME, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 129 + END + + IDD_SVC_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 64 + END + + IDD_SVR_GETDATES, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_GETDATES_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 128 + END + + IDD_SET_DUMP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 291 + TOPMARGIN, 7 + BOTTOMMARGIN, 140 + END + + IDD_SET_RESTORE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 288 + TOPMARGIN, 4 + BOTTOMMARGIN, 244 + END + + IDD_SVC_BOS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_DUMPING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SET_RESTORING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SET_CLONESYS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 300 + TOPMARGIN, 7 + BOTTOMMARGIN, 158 + END + + IDD_SUBSETS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 276 + TOPMARGIN, 5 + BOTTOMMARGIN, 177 + END + + IDD_SUBSET_LOADSAVE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 276 + TOPMARGIN, 4 + BOTTOMMARGIN, 141 + END + + IDD_HELP_FIND, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 214 + TOPMARGIN, 4 + BOTTOMMARGIN, 69 + END + + IDD_HELP_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 214 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_HELP_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 226 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_OPENINGCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 236 + TOPMARGIN, 2 + BOTTOMMARGIN, 41 + END + + IDD_OPTIONS_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 274 + TOPMARGIN, 5 + BOTTOMMARGIN, 131 + END + + IDD_SVR_KEYS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_CREATEKEY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + END + + IDD_SVC_STARTSTOP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 141 + END + + IDD_SVR_EXECUTE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_SALVAGE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 267 + END + + IDD_SVR_SALVAGE_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 174 + END + + IDD_SET_RELEASE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 297 + TOPMARGIN, 7 + BOTTOMMARGIN, 99 + END + + IDD_SVR_HOSTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_ADDHOST, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 238 + TOPMARGIN, 4 + BOTTOMMARGIN, 102 + END + + IDD_SVR_ADDRESS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 204 + TOPMARGIN, 4 + BOTTOMMARGIN, 111 + END + + IDD_SVR_NEWADDR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 219 + TOPMARGIN, 4 + BOTTOMMARGIN, 65 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Server Manager""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_MAIN MENU DISCARDABLE +BEGIN + POPUP "&Zelle" + BEGIN + MENUITEM "Aus&wählen...", M_CELL_OPEN + MENUITEM "&Authentifizierung...", M_CREDENTIALS + MENUITEM SEPARATOR + MENUITEM "E&xit", M_EXIT + END + POPUP "&Anzeige" + BEGIN + POPUP "&Server" + BEGIN + MENUITEM "&Große Symbole", M_SVR_VIEW_LARGE + , CHECKED + MENUITEM "&Kleine Symbole", M_SVR_VIEW_SMALL + , CHECKED + MENUITEM "&Details", M_SVR_VIEW_REPORT + , CHECKED + MENUITEM SEPARATOR + MENUITEM "&Normal", M_SVR_VIEW_ONEICON + , CHECKED + MENUITEM "&Alle Symbole", M_SVR_VIEW_TWOICONS + , CHECKED + MENUITEM "Nur &Status", M_SVR_VIEW_STATUS + , CHECKED + END + POPUP "Schnellansicht-&Teilfenster" + BEGIN + MENUITEM "&Keine", M_DIVIDE_NONE, CHECKED + MENUITEM "&Vertikal teilen", M_DIVIDE_H, CHECKED + MENUITEM "&Horizontal teilen", M_DIVIDE_V, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "Laufende O&perationen", M_ACTIONS, CHECKED + MENUITEM SEPARATOR + MENUITEM "Über&wachte Server...", M_SUBSET + MENUITEM "Spa<en...", M_COLUMNS + MENUITEM "&Optionen...", M_OPTIONS + MENUITEM SEPARATOR + MENUITEM "Alles &aktualisieren", M_REFRESHALL + END + POPUP "&Hilfe" + BEGIN + MENUITEM "&Inhalt", M_HELP + MENUITEM "Befehl &suchen...", M_HELP_FIND + MENUITEM "&Fehlercode suchen...", M_HELP_XLATE + MENUITEM SEPARATOR + MENUITEM "&Info zu AFS Server Manager...", M_ABOUT + END +END + +MENU_AGG MENU DISCARDABLE +BEGIN + MENUITEM "Volume &erstellen...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "Volumes &sichern...", M_SET_CLONE + MENUITEM "Alle Vol&umes freigeben", M_SET_UNLOCK + MENUITEM "VLDB s&ynchronisieren...", M_SYNCVLDB + MENUITEM "Volumes &wiederherstellen...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "A&ktualisieren", M_REFRESH + MENUITEM "&Merkmale", M_PROPERTIES +END + +MENU_SVC MENU DISCARDABLE +BEGIN + MENUITEM "&Starten", M_SVC_START + MENUITEM "Sto&ppen", M_SVC_STOP + MENUITEM "E&rneut starten", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "Protokolldatei &anzeigen", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "&Löschen", M_SVC_DELETE + MENUITEM SEPARATOR + MENUITEM "A&ktualisieren", M_REFRESH + MENUITEM "&Merkmale", M_PROPERTIES +END + +MENU_AGG_NONE MENU DISCARDABLE +BEGIN + POPUP "&Anzeige" + BEGIN + MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED + MENUITEM "&Alle Symbole", M_VIEW_TWOICONS, CHECKED + MENUITEM "Nur &Status", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "Volume &erstellen...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "Alles &aktualisieren", M_REFRESHALL +END + +MENU_SVC_NONE MENU DISCARDABLE +BEGIN + POPUP "&Anzeige" + BEGIN + MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED + MENUITEM "&Alle Symbole", M_VIEW_TWOICONS, CHECKED + MENUITEM "Nur &Status", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "Servi&ce erstellen...", M_SVC_CREATE + MENUITEM SEPARATOR + MENUITEM "Alles &aktualisieren", M_REFRESHALL +END + +MENU_SET MENU DISCARDABLE +BEGIN + MENUITEM "Re&plikation...", M_SET_REPLICATION + MENUITEM "&Jetzt freigeben", M_SET_RELEASE + MENUITEM SEPARATOR + MENUITEM "&Sicherung...", M_SET_CLONE + MENUITEM "Speicherauszug in &Datei...", M_SET_DUMP + MENUITEM "Aus Datei &wiederherstellen...", M_SET_RESTORE + MENUITEM "&Quote festlegen...", M_SET_SETQUOTA + MENUITEM "Wieder&herstellung...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "&Verschieben nach...", M_SET_MOVETO + MENUITEM "Umbe&nennen...", M_SET_RENAME + MENUITEM "&Löschen", M_SET_DELETE + MENUITEM SEPARATOR + MENUITEM "Spe&rren", M_SET_LOCK + MENUITEM "Sperre a&ufheben", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "A&ktualisieren", M_REFRESH + MENUITEM "&Merkmale", M_PROPERTIES +END + +MENU_SVR MENU DISCARDABLE +BEGIN + MENUITEM "Server-Fenster ö&ffnen", M_SVR_OPEN + MENUITEM "Server-Fenster s&chließen", M_SVR_CLOSE + MENUITEM "Diesen Server über&wachen", M_SVR_MONITOR, CHECKED + MENUITEM SEPARATOR + MENUITEM "&Server-Sicherheit editieren...", M_SVR_SECURITY + MENUITEM "Datenbank-&Hosts verwalten...", M_SVR_HOSTS + MENUITEM "Volumes &sichern...", M_SET_CLONE + MENUITEM "Alle Vol&umes freigeben", M_SET_UNLOCK + MENUITEM "VLDB s&ynchronisieren...", M_SYNCVLDB + MENUITEM "Volumes &wiederherstellen...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "Datei &installieren...", M_SVR_INSTALL + MENUITEM "Datei &deinstallieren...", M_SVR_UNINSTALL + MENUITEM "Al&te Dateien löschen...", M_SVR_PRUNE + MENUITEM SEPARATOR + MENUITEM "Da&teidatumsangaben abrufen...", M_SVR_GETDATES + MENUITEM "Protokolldatei &anzeigen...", M_VIEWLOG + MENUITEM "Befehl a&usführen...", M_EXECUTE + MENUITEM SEPARATOR + MENUITEM "A&ktualisieren", M_REFRESH + MENUITEM "&Merkmale", M_PROPERTIES +END + +MENU_SVR_NONE MENU DISCARDABLE +BEGIN + POPUP "&Anzeige" + BEGIN + MENUITEM "&Große Symbole", M_SVR_VIEW_LARGE, CHECKED + MENUITEM "&Kleine Symbole", M_SVR_VIEW_SMALL, CHECKED + MENUITEM "&Details", M_SVR_VIEW_REPORT, CHECKED + MENUITEM SEPARATOR + MENUITEM "&Normal", M_SVR_VIEW_ONEICON, CHECKED + MENUITEM "&Alle Symbole", M_SVR_VIEW_TWOICONS, CHECKED + MENUITEM "Nur &Status", M_SVR_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "Über&wachte Server...", M_SUBSET + MENUITEM SEPARATOR + MENUITEM "Alle Vol&umes freigeben", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "Alle s&chließen", M_SVR_CLOSEALL + MENUITEM "Alles &aktualisieren", M_REFRESHALL +END + +MENU_SET_NONE MENU DISCARDABLE +BEGIN + POPUP "&Anzeige" + BEGIN + MENUITEM "Nach &Volume", M_SET_VIEW_REPORT, CHECKED + MENUITEM "Nach &Partition", M_SET_VIEW_TREELIST, CHECKED + MENUITEM "Keine &Details", M_SET_VIEW_TREE, CHECKED + MENUITEM SEPARATOR + MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED + MENUITEM "&Alle Symbole", M_VIEW_TWOICONS, CHECKED + MENUITEM "Nur &Status", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "Volume &erstellen...", M_SET_CREATE + MENUITEM "Aus Datei &wiederherstellen...", M_SET_RESTORE + MENUITEM SEPARATOR + MENUITEM "Volumes &sichern...", M_SET_CLONE + MENUITEM SEPARATOR + MENUITEM "Alle frei&geben", M_SET_UNLOCK + MENUITEM "Alles &aktualisieren", M_REFRESHALL +END + +MENU_COLUMNS MENU DISCARDABLE +BEGIN + MENUITEM "&Spalten...", M_COLUMNS +END + +MENU_SVC_BOS MENU DISCARDABLE +BEGIN + MENUITEM "E&rneut starten", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "Protokolldatei &anzeigen", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "A&ktualisieren", M_REFRESH + MENUITEM "&Merkmale", M_PROPERTIES +END + +MENU_SET_DRAGDROP MENU DISCARDABLE +BEGIN + MENUITEM "Hierher &verschieben...", M_SET_MOVEHERE + MENUITEM "Hie&r nachbilden...", M_SET_REPHERE + MENUITEM SEPARATOR + MENUITEM "&Abbrechen", IDC_STATIC +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SERVICES DIALOGEX 0, 0, 179, 92 +STYLE DS_CENTER | WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Services:",IDC_SVC_DESC,0,5,179,8 + CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,0,17,179, + 61,WS_EX_STATICEDGE + PUSHBUTTON "&Erstellen...",IDC_SVC_CREATE,44,80,39,12 + PUSHBUTTON "&Löschen",IDC_SVC_DELETE,86,80,39,12 + PUSHBUTTON "E&rneut starten",IDC_SVC_RESTART,128,80,49,12 +END + +IDD_AGGREGATES DIALOGEX 0, 0, 165, 84 +STYLE DS_CENTER | WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Partitionen:",IDC_AGG_DESC,0,5,165,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,0,17,165, + 53,WS_EX_STATICEDGE + PUSHBUTTON "Volume &erstellen...",IDC_AGG_CREATESET,102,72,63,12 +END + +IDD_FILESETS DIALOGEX 0, 0, 194, 92 +STYLE DS_CENTER | WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Volumes:",IDC_SET_DESC,0,5,194,8 + CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,0,17,194, + 61,WS_EX_STATICEDGE + PUSHBUTTON "&Erstellen...",IDC_SET_CREATE,1,80,39,12 + PUSHBUTTON "&Löschen",IDC_SET_DELETE,41,80,39,12 + PUSHBUTTON "&Nachbildung...",IDC_SET_REP,82,80,51,12 + PUSHBUTTON "&Quote festlegen...",IDC_SET_SETQUOTA,135,80,57,12 +END + +IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, + 135,WS_EX_CLIENTEDGE + PUSHBUTTON "&Administrator hinzufügen",IDC_LIST_ADD,51,160,87,14 + PUSHBUTTON "Administ&rator entfernen",IDC_LIST_REMOVE,141,160,80,14 + LTEXT "Administratoren für Server %1:",IDC_LIST_NAME,5,7,216,8 +END + +IDD_AGG_GENERAL DIALOGEX 0, 0, 267, 160 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "ID:",IDC_STATIC,5,30,31,8 + LTEXT "(Abfragen)",IDC_AGG_ID,38,30,214,8 + LTEXT "Gerät:",IDC_STATIC,5,46,31,8 + LTEXT "(Abfragen)",IDC_AGG_DEVICE,38,46,214,8 + LTEXT "Volumes:",IDC_STATIC,5,62,31,8 + LTEXT "(Abfragen)",IDC_AGG_FILESETS,38,62,214,8 + CONTROL "&Warnung anzeigen, wenn kombinierte Volume-Quote Kapazität überschreitet", + IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | + BS_MULTILINE | WS_TABSTOP,38,75,224,15 + LTEXT "Syntax:",IDC_STATIC,5,93,31,8 + LTEXT "(Abfragen)",IDC_AGG_USAGE,38,93,214,8 + CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,38,105,224,8, + WS_EX_STATICEDGE + CONTROL "&Warnung anzeigen, wenn die Belegung der Partition den", + IDC_AGG_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38, + 116,222,10 + CONTROL "Stan&dardschwellenwert für diesen Server überschreitet", + IDC_AGG_WARN_AGGFULL_DEF,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,49,131,203,9 + CONTROL "den Schwellenwer&t von",IDC_AGG_WARN_AGGFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,49,145,88,8 + EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,140,142,29,12, + ES_AUTOHSCROLL + LTEXT "% der Größe überschreitet",IDC_AGG_WARN_AGGFULL_DESC, + 171,145,88,8 + ICON IDI_AGGREGATE,IDC_STATIC,5,5,20,20 + LTEXT "Partition %2 (Server %1)",IDC_AGG_NAME,38,14,214,8 +END + +IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "IP-Adresse:",IDC_STATIC,5,29,43,8 + LISTBOX IDC_SVR_ADDRESSES,53,29,70,12,LBS_NOSEL | NOT WS_BORDER | + WS_VSCROLL + PUSHBUTTON "&Adressen ändern...",IDC_SVR_CHANGEADDR,144,27,77,12 + PUSHBUTTON "Authentifizie&rung anfordern",IDC_SVR_AUTH_YES,16,87,93, + 14 + PUSHBUTTON "Nicht a&uthentifizierte erlauben",IDC_SVR_AUTH_NO,113, + 87,99,14 + LTEXT "Anzahl der Partitionen:",IDC_STATIC,11,131,90,8 + LTEXT "(Abfragen)",IDC_SVR_NUMAGGREGATES,108,131,99,8 + LTEXT "Gesamtkapazität:",IDC_STATIC,11,148,60,8 + LTEXT "(Abfragen)",IDC_SVR_CAPACITY,108,148,99,8 + LTEXT "Kombinierte Volume-Quote:",IDC_STATIC,11,165,89,8 + LTEXT "(Abfragen)",IDC_SVR_ALLOCATION,108,165,99,8 + ICON IDI_SERVER,IDC_STATIC,5,5,20,20 + LTEXT "(Server-Name)",IDC_SVR_NAME,55,13,93,8 + GROUPBOX "Sicherheit",IDC_STATIC,5,52,216,57 + GROUPBOX "Speicher",IDC_STATIC,5,115,216,68 + LTEXT "Sie können festlegen, daß nur authentifizierte Zugriffe auf diesen Server möglich sind.", + IDC_STATIC,11,66,198,16 +END + +IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 221, 158 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "eine Partition dieses Servers zu",IDC_SVR_WARN_AGGFULL, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,18,116,9 + EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,127,16,24,12,ES_AUTOHSCROLL + LTEXT "% belegt ist",IDC_STATIC,168,18,45,8 + CONTROL "ein Volume dieses Servers zu",IDC_SVR_WARN_SETFULL, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,32,109,9 + EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,121,30,24,12,ES_AUTOHSCROLL + LTEXT "% belegt ist",IDC_STATIC,165,32,39,8 + CONTROL "die kombinierte Quote einer Partition die Kapazität überschreitet", + IDC_SVR_WARN_AGGALLOC,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,8,46,212,9 + CONTROL "ein Service dieses Servers gestoppt wird", + IDC_SVR_WARN_SVCSTOP,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,8,60,195,9 + CONTROL "ein Volume dieses Servers keinen VLDB-Eintrag besitzt", + IDC_SVR_WARN_SETNOVLDB,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,8,74,195,9 + CONTROL "VLDB auf eine Offline-Partition dieses Servers verweist", + IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,8,88,195,9 + CONTROL "VLDB auf ein Offline-Volume dieses Servers verweist", + IDC_SVR_WARN_SETNOSERV,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,8,103,195,9 + CONTROL "Server-Informationen aktualisieren: alle", + IDC_SVR_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,8,142,137,9 + EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,145,140,27,13,ES_AUTOHSCROLL + LTEXT "Minuten",IDC_STATIC,189,142,25,8 + LTEXT "Warnung anzeigen, falls",IDC_STATIC,5,5,195,8 +END + +IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 225, 207 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + PUSHBUTTON "Service-Protokoll &anzeigen",IDC_SVC_VIEWLOG,24,182,91, + 14 + PUSHBUTTON "Jetzt &starten",IDC_SVC_START,118,182,45,14 + PUSHBUTTON "Jetzt sto&ppen",IDC_SVC_STOP,166,182,49,14 + CONTROL "&Warnung anzeigen, falls dieser Service stoppt", + IDC_SVC_WARNSTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 11,159,200,10 + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "Service %2 (Server %1)",IDC_SVC_NAME,52,13,168,8 + LTEXT "Typ:",IDC_STATIC,5,29,44,8 + LTEXT "(Abfragen)",IDC_SVC_TYPE,76,29,141,8 + LTEXT "Parameter:",IDC_STATIC,5,45,44,8 + EDITTEXT IDC_SVC_PARAMS,76,45,141,13,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP + LTEXT "Benachrichtigung:",IDC_STATIC,5,61,58,8 + LTEXT "(Abfragen)",IDC_SVC_NOTIFIER,76,61,141,8 + LTEXT "Zuletzt gestartet:",IDC_STATIC,5,77,57,8 + LTEXT "(Abfragen)",IDC_SVC_STARTDATE,76,77,141,8 + LTEXT "Zuletzt gestoppt:",IDC_STATIC,5,93,54,8 + LTEXT "(Abfragen)",IDC_SVC_STOPDATE,76,93,141,8 + LTEXT "Letzter Fehler:",IDC_STATIC,5,109,46,8 + EDITTEXT IDC_SVC_LASTERROR,76,109,141,13,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + GROUPBOX "Service-Status",IDC_STATIC,5,127,215,75 + LTEXT "Der aktuelle Status dieses Services wird ermittelt...", + IDC_SVC_STATUS,11,142,200,8 +END + +IDD_SET_GENERAL DIALOGEX 0, 0, 273, 214 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Volume-ID:",IDC_STATIC,5,30,39,8 + LTEXT "(Unbekannt)",IDC_SET_ID,49,30,219,8 + LTEXT "Erstellt:",IDC_STATIC,5,46,39,8 + LTEXT "(Abfragen)",IDC_SET_CREATEDATE,49,46,219,8 + LTEXT "Aktualisiert:",IDC_STATIC,5,62,39,8 + LTEXT "(Abfragen)",IDC_SET_UPDATEDATE,49,62,112,8 + LTEXT "Zugriff:",IDC_STATIC,5,78,39,8 + LTEXT "(Abfragen)",IDC_SET_ACCESSDATE,49,78,219,8 + LTEXT "Gesichert:",IDC_STATIC,5,94,39,8 + LTEXT "(Abfragen)",IDC_SET_BACKUPDATE,49,94,219,8 + LTEXT "Dateianzahl:",IDC_STATIC,5,110,40,8 + LTEXT "(Abfragen)",IDC_SET_FILES,49,110,219,8 + LTEXT "Status:",IDC_STATIC,5,126,39,8 + LTEXT "(Abfragen)",IDC_SET_STATUS,49,126,101,8 + PUSHBUTTON "&Sperren",IDC_SET_LOCK,156,124,49,13 + PUSHBUTTON "Sperre a&ufheben",IDC_SET_UNLOCK,207,124,61,13 + LTEXT "Syntax:",IDC_STATIC,5,142,31,8 + LTEXT "(Abfragen)",IDC_SET_USAGE,49,142,136,8 + PUSHBUTTON "&Quote festlegen...",IDC_SET_QUOTA,207,140,61,13 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,49,156,219,8, + WS_EX_STATICEDGE + CONTROL "&Warnung anzeigen, falls die Belegung dieses Volumes", + IDC_SET_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,28, + 170,240,10 + CONTROL "den Stan&dardschwellenwert für diesen Server (%1%% seiner Größe) überschreitet", + IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,34,181,227,16 + CONTROL "den Schwellenwer&t von",IDC_SET_WARN_SETFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,34,199,88,9 + EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,129,197,29,12, + ES_AUTOHSCROLL + LTEXT "% der Größe überschreitet",IDC_SET_WARN_SETFULL_DESC, + 163,199,105,8 + ICON IDI_FILESET,IDC_STATIC,5,5,20,20 + LTEXT "Volume %3 (Server %1, Partition %2)",IDC_SET_NAME,49,14, + 219,8 +END + +IDD_MAIN DIALOGEX 0, 0, 317, 226 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | + WS_SYSMENU | WS_THICKFRAME +CAPTION "AFS Server Manager" +MENU MENU_MAIN +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Ausgewählte Zelle:",IDC_STATIC,2,8,61,8 + LTEXT "(Der Zellenname wird hier plaziert)",IDC_CELL,69,8,202, + 9 + LTEXT "AFS-Token:",IDC_STATIC,2,19,55,8 + LTEXT "%2:%1 (Token laufen %3 ab)",IDC_AFS_ID,69,19,208,9 + CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,31,313, + 193,WS_EX_CLIENTEDGE + CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 + ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 +STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Server" +CLASS "ServerWindowClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_TABS,"SysTabControl32",0x0,2,2,205,133 +END + +IDD_SVC_CREATE DIALOGEX 0, 0, 225, 233 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Server:",IDC_STATIC,5,36,44,8 + COMBOBOX IDC_SVC_SERVER,65,33,111,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Ser&vice:",IDC_STATIC,5,52,44,8 + COMBOBOX IDC_SVC_NAME,65,50,111,104,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Befehl:",IDC_STATIC,5,70,44,8 + EDITTEXT IDC_SVC_COMMAND,65,68,152,13,ES_AUTOHSCROLL + LTEXT "&Parameter:",IDC_STATIC,5,88,44,8 + EDITTEXT IDC_SVC_PARAMS,66,86,151,13,ES_AUTOHSCROLL + LTEXT "Be&nachrichtigung:",IDC_STATIC,5,105,57,8 + EDITTEXT IDC_SVC_NOTIFIER,65,103,152,13,ES_AUTOHSCROLL + LTEXT "Pro&tokolldatei:",IDC_STATIC,5,122,44,8 + EDITTEXT IDC_SVC_LOGFILE,65,120,152,13,ES_AUTOHSCROLL + CONTROL "E&infach (fortlaufende Ausführung)",IDC_SVC_TYPE_SIMPLE, + "Button",BS_AUTORADIOBUTTON,11,154,201,10 + CONTROL "Diesen Se&rvice jetzt starten",IDC_SVC_RUNNOW,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 + CONTROL "&FS (Dateisystem)",IDC_SVC_TYPE_FS,"Button", + BS_AUTORADIOBUTTON,11,180,201,10 + CONTROL "&Cron (Ausführung in bestimmten Intervallen)", + IDC_SVC_TYPE_CRON,"Button",BS_AUTORADIOBUTTON,11,195,201, + 10 + LTEXT "&Ausführung bei:",IDC_STATIC,23,209,41,8 + COMBOBOX IDC_SVC_RUNDAY,70,207,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "um",IDC_STATIC,143,209,11,8 + CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,159,207, + 53,13,WS_EX_CLIENTEDGE + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "Neuer Service",IDC_SVC_DESC,52,13,168,8 + GROUPBOX "Service-Typ",IDC_STATIC,5,141,215,87 +END + +IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, + 199,58,WS_EX_CLIENTEDGE + PUSHBUTTON "Jetzt f&reigeben",IDC_SET_RELEASE,11,143,56,14 + PUSHBUTTON "&Erstellen...",IDC_SET_REPSITE_ADD,129,143,38,14 + PUSHBUTTON "&Löschen",IDC_SET_REPSITE_DELETE,172,143,38,14 + LTEXT "Server:",-1,11,31,37,8 + LTEXT "(Server-Name)",IDC_SET_SERVER,55,31,147,8 + LTEXT "Partition:",-1,11,44,37,8 + LTEXT "(Partitionsname)",IDC_SET_AGGREGATE,55,44,147,8 + LTEXT "Volume:",-1,11,18,37,8 + LTEXT "(Volume-Name)",IDC_SET_NAME,55,18,147,8 + GROUPBOX "Volume lesen/schreiben",-1,5,5,211,56 + GROUPBOX "Volume-Replikate",-1,5,67,211,96 +END + +IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 257 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Zelle auswählen - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Zelle:",IDC_STATIC,4,24,17,8 + COMBOBOX IDC_OPENCELL_CELL,24,22,191,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + GROUPBOX "AFS-Authentifizierung",IDC_STATIC,4,44,211,92 + LTEXT "AFS-&Identität:",IDC_STATIC,22,103,55,8 + EDITTEXT IDC_OPENCELL_ID,80,101,129,14,ES_AUTOHSCROLL + LTEXT "AFS-&Kennwort:",IDC_STATIC,22,119,55,8 + EDITTEXT IDC_OPENCELL_PASSWORD,80,117,129,14,ES_PASSWORD | + ES_AUTOHSCROLL + PUSHBUTTON "&Weitere >>",IDC_ADVANCED,4,140,53,14 + DEFPUSHBUTTON "OK",IDOK,86,140,41,14 + PUSHBUTTON "Abbrechen",IDCANCEL,130,140,41,14 + PUSHBUTTON "&Hilfe",9,174,140,41,14 + CONTROL "A&lle Server dieser Zelle überwachen",IDC_MON_ALL, + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10,203,185,9 + CONTROL "&Nur einen Server überwachen:",IDC_MON_ONE,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,10,216,110,10 + EDITTEXT IDC_MON_SERVER,125,215,83,13,ES_AUTOHSCROLL + CONTROL "Nur &Server in Untergruppe überwachen:",IDC_MON_SOME, + "Button",BS_AUTORADIOBUTTON | BS_MULTILINE | WS_TABSTOP, + 10,232,107,14 + COMBOBOX IDC_MON_SUBSET,125,231,83,93,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Wählen Sie die AFS-Zelle, mit der Sie arbeiten möchten.", + IDC_STATIC,4,7,200,8 + GROUPBOX "Server überwachen",IDC_ADVANCED_GROUP,4,164,211,89 + LTEXT "Sie können die Überwachung auf eine Untergruppe der in dieser Zelle verfügbaren Server begrenzen, um die Geschwindigkeit zu erhöhen.", + IDC_STATIC,10,176,201,24 + LTEXT "(Abfrage läuft...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "Sie müssen Ihr AFS-Kennwort erneut eingeben, um eine Zelle zu verwalten:", + IDC_STATIC,10,82,196,16 + LTEXT "Ihre aktuellen AFS-Token in der ausgewählten Zelle:", + IDC_STATIC,10,57,196,8 +END + +IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Warnung - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "&Weiter warten, bis der Task normal beendet wird", + IDC_TIMEOUT_WAIT,"Button",BS_AUTORADIOBUTTON,24,91,208, + 10 + CONTROL "&Task beenden",IDC_TIMEOUT_KILL,"Button", + BS_AUTORADIOBUTTON,24,105,208,10 + DEFPUSHBUTTON "OK",IDOK,93,139,50,14 + LTEXT "Zeit, die der Task aktiv war:",IDC_STATIC,4,123,142,8 + LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,151,123,29,8 + LTEXT "Der AFS Server Manager hat unerwartet lange auf die Beendigung eines Netzwerk-Tasks gewartet.", + IDC_STATIC,4,7,228,18 + LTEXT "Der Task kann weiter ausgeführt werden (empfohlen), oder Sie können dem AFS Server Manager erlauben, den Task zu beenden, wenn Sie sicher sind, daß dieser niemals abgeschlossen wird.", + IDC_STATIC,4,30,228,26 + LTEXT "Beachten Sie, daß der Task weiterhin aktiv ist, auch wenn dieses Fenster angezeigt wird; wenn der Task abgeschlossen ist, schließt sich dieses Fenster automatisch.", + IDC_STATIC,4,61,228,24 +END + +IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 +STYLE WS_POPUP | WS_CAPTION +CAPTION "Spalten" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Anzuzeigende Spalten für Auflistung au&swählen:", + IDC_STATIC,5,7,154,10 + COMBOBOX IDC_COLUMNS,164,5,118,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Verfügbare Spalten:",IDC_STATIC,12,40,100,8 + LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LTEXT "&Anzuzeigende Spalten:",IDC_STATIC,173,41,100,8 + LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "&Hinzufügen >>",IDC_COL_INSERT,117,68,50,14 + PUSHBUTTON "<< Entfe&rnen",IDC_COL_DELETE,117,88,50,14 + PUSHBUTTON "Nach &oben",IDC_COL_UP,173,122,48,14 + PUSHBUTTON "Nach &unten",IDC_COL_DOWN,224,122,48,14 + GROUPBOX "Spalten auflisten",IDC_STATIC,5,25,276,118 +END + +IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 264, 72 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Aktualisieren - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, + 256,8 + LTEXT "0%% abgeschlossen",IDC_REFRESH_PERCENT,4,49,202,8 + LTEXT "",IDC_REFRESH_CURRENT,4,60,201,8 + LTEXT "Bitte warten...",IDC_REFRESH_DESC,4,7,256,25 + PUSHBUTTON "Über&springen",IDC_REFRESH_SKIP,209,54,51,15,NOT + WS_TABSTOP +END + +IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Volume erstellen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Name:",IDC_STATIC,4,30,39,8 + EDITTEXT IDC_SET_NAME,46,28,116,14,ES_AUTOHSCROLL + LTEXT "&Quote:",IDC_STATIC,4,48,39,8 + EDITTEXT IDC_SET_QUOTA,46,46,32,14,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,90,47,30,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "&Sicherung:",IDC_STATIC,4,66,39,8 + CONTROL "Siche&rungsversion dieses Volumes ebenfalls erstellen", + IDC_SET_CLONE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,46, + 66,185,8 + LTEXT "&Server:",IDC_STATIC,4,84,39,8 + COMBOBOX IDC_SET_SERVER,46,82,116,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Partition:",IDC_STATIC,4,102,39,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,46,102,271, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "OK",IDOK,156,191,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,211,191,50,14 + PUSHBUTTON "&Hilfe",9,267,191,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "Neues Volume",IDC_STATIC,46,12,170,8 +END + +IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 277, 102 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Volume löschen" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Abbrechen",IDCANCEL,169,84,50,14 + PUSHBUTTON "OK",IDOK,115,84,50,14 + PUSHBUTTON "&Hilfe",9,223,84,50,14 + CONTROL "Volume %3 von Server %1, Partition %2 &löschen", + IDC_DELSET_SERVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 34,45,236,10 + CONTROL "&VLDB-Eintrag für Volume %3 löschen",IDC_DELSET_VLDB, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,34,60,236,10 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "Achtung!\n\nDiese Operation löscht Volume %3 dauerhaft.", + IDC_DELSET_DESC,31,7,242,33 +END + +IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Volume sichern - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,183,67,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,237,67,50,14 + PUSHBUTTON "&Hilfe",9,291,67,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,21,20 + LTEXT "Eine Volume-Sicherung stellt sich als schreibgeschützte Kopie dieses Volumes dar. Ein Read/Write-Volume kann über nur eine Sicherungsversion verfügen.", + IDC_STATIC,34,9,307,17 + LTEXT "Klicken Sie auf OK, um eine Sicherung des Volumes %3 auf Server %1, Partition %2 zu erstellen. Wenn bereits eine Sicherung dieses Volumes vorhanden ist, wird die Sicherung aktualisiert.", + IDC_CLONE_DESC,34,32,307,24 +END + +IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "Bekannte Probleme",IDC_PROBLEM_BOX,5,36,215,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,138,120,61,12 + ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "Service %2 (Server %1)",IDC_PROBLEM_TITLE,52,13,168,8 +END + +IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "Bekannte Probleme",IDC_PROBLEM_BOX,5,36,216,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,172,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,201,49,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,136,120,61,12 + ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "%1",IDC_PROBLEM_TITLE,42,13,179,8 +END + +IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "Bekannte Probleme",IDC_PROBLEM_BOX,5,35,247,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,170,119,61,12 + ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "Partition %2 (Server %1)",IDC_PROBLEM_TITLE,38,14,214,8 +END + +IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "Bekannte Probleme",IDC_PROBLEM_BOX,5,35,263,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,249,48,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 + ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "Volume %3 (Server %1, Partition %2)",IDC_PROBLEM_TITLE, + 49,14,219,8 +END + +IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Volume verschieben" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,70,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "OK",IDOK,115,156,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,169,156,50,14 + PUSHBUTTON "&Hilfe",9,223,156,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,21,20 + LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,242,24 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 + LTEXT "Volu&me verschieben nach:",IDC_STATIC,4,43,116,8 +END + +IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "Volume verschieben - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "Volume %3 wird von Partition %2 auf Server %1 zu Partition %5 auf Server %4 verschoben...", + IDC_MOVESET_DESC,4,41,229,19 +END + +IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 277, 106 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Protokolldatei anzeigen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Protokolldatei anzeigen auf &Server:",IDC_STATIC,4,40, + 73,17 + COMBOBOX IDC_VIEWLOG_SERVER,82,42,126,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "Au&f Server anzuzeigende Datei:",IDC_STATIC,4,61,73,18 + EDITTEXT IDC_VIEWLOG_FILENAME,82,62,191,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,169,88,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,223,88,50,14 + ICON IDI_SERVICE,IDC_STATIC,4,4,20,20 + LTEXT "Geben Sie den vollständigen Pfad der anzuzeigenden Protokolldatei ein.", + IDC_VIEWLOG_DESC,31,10,242,21 +END + +IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 286, 185 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Protokolldatei anzeigen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Dateiinhalt:",IDC_SVC_VIEWLOG_CONTENTS,4,41,277,8 + EDITTEXT IDC_VIEWLOG_TEXT,4,51,277,113,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL + PUSHBUTTON "Speichern &unter...",IDC_VIEWLOG_SAVEAS,168,167,61,14 + DEFPUSHBUTTON "S&chließen",IDOK,231,167,50,14 + ICON IDI_SERVICE,-1,4,7,20,20 + LTEXT "Protokolldatei [für Service %2] auf Server %1", + IDC_SVC_VIEWLOG_DESC,33,7,246,10 + LTEXT "Dateiname auf Server: %1",IDC_SVC_VIEWLOG_FILENAME,33, + 23,248,8 +END + +IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Volume-Quote festlegen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Aktuelle Quote:",IDC_STATIC,4,49,50,8 + LTEXT "(Unbekannt)",IDC_SET_USAGE,59,49,208,8 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,59,60,208,8, + WS_EX_STATICEDGE + LTEXT "Neue &Quote:",IDC_STATIC,4,81,47,8 + EDITTEXT IDC_SET_QUOTA,59,79,32,13,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,103,79,30,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "OK",IDOK,109,112,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,163,112,50,14 + PUSHBUTTON "&Hilfe",9,217,112,50,14 + PUSHBUTTON "&Merkmale...",IDC_AGG_PROPERTIES,212,28,55,12 + LTEXT "Partition:",IDC_STATIC,4,30,47,8 + LTEXT "Partition %2 von Server %1",IDC_SET_AGGREGATE,59,30,141, + 8 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "Volume %1",IDC_SET_NAME,59,11,208,8 +END + +IDD_ACTIONS DIALOGEX 0, 0, 236, 58 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_TOOLWINDOW +CAPTION "Laufende Operationen - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Die folgenden Operationen sind momentan aktiv:", + IDC_ACTION_DESC,2,2,232,8 + CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | + 0x3,2,14,232,43 +END + +IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "VLDB synchronisieren" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,107,81,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,161,81,50,14 + PUSHBUTTON "&Hilfe",9,215,81,50,14 + ICON 32515,IDC_STATIC,4,4,21,20 + LTEXT "(Wird zur Laufzeit festgelegt)",IDC_SYNC_DESC,37,4,228, + 32 + LTEXT "(Wird zur Laufzeit festgelegt)",IDC_SYNC_DESC2,37,44, + 228,24 +END + +IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Volume nachbilden" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,62,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "OK",IDOK,115,153,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,169,153,50,14 + PUSHBUTTON "&Hilfe",9,223,153,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "Neues Replikat von Volume %3",IDC_SET_NAME,31,12,242,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 + LTEXT "E&rstellen eines neuen Replikats dieses Volumes auf:", + IDC_STATIC,4,35,166,8 +END + +IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 248, 167 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Datei installieren" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Quellendatei:",IDC_STATIC,4,81,49,8 + EDITTEXT IDC_FILENAME,56,79,129,14,ES_AUTOHSCROLL + PUSHBUTTON "&Durchsuchen...",IDC_BROWSE,188,79,55,14 + LTEXT "Ziel-&Server:",IDC_STATIC,4,101,45,8 + COMBOBOX IDC_SERVER,56,99,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Ziel&name:",IDC_STATIC,4,121,49,8 + EDITTEXT IDC_DIRECTORY,56,119,129,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,86,149,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,140,149,50,14 + PUSHBUTTON "&Hilfe",9,194,149,50,14 + ICON IDI_INSTALL,IDC_STATIC,4,4,21,20 + LTEXT "Installieren der Datei auf Server",IDC_STATIC,32,12,175, + 8 + LTEXT "(Text wird zur Laufzeit festgelegt)\n(Text wird zur Laufzeit festgelegt)\n(Text wird zur Laufzeit festgelegt)\n(Text wird zur Laufzeit festgelegt)", + IDC_INSTALL_DESC,4,29,240,41 +END + +IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Datei deinstallieren" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Server:",IDC_STATIC,4,68,35,8 + COMBOBOX IDC_SERVER,41,66,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Ziel&datei:",IDC_STATIC,4,87,35,8 + EDITTEXT IDC_FILENAME,41,85,175,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,88,121,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,141,121,50,14 + PUSHBUTTON "&Hilfe",9,194,121,50,14 + ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 + LTEXT "Deinstallieren der Datei von Server",IDC_STATIC,32,12, + 128,8 + LTEXT "Diese Operation ermöglicht Ihnen die Wiederherstellung einer zuvor installierten Kopie einer Datei auf einem bestimmten Server. Wenn keine zuvor installierte Kopie der ausgewählten Datei vorhanden ist, wird die Datei entfernt.", + IDC_STATIC,4,29,240,32 +END + +IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 261, 141 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Alte Dateien löschen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Server:",-1,4,56,44,8 + COMBOBOX IDC_SERVER,80,54,119,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Alle &Kerndateien löschen",IDC_OP_DELETE_CORE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,80,73,176,10 + CONTROL "Alle .&BAK-Dateien löschen (Dateisicherungen)", + IDC_OP_DELETE_BAK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 80,84,176,10 + CONTROL "Alle .&OLD-Dateien löschen (ältere Dateisicherungen)", + IDC_OP_DELETE_OLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 80,95,176,10 + DEFPUSHBUTTON "OK",IDOK,98,123,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,152,123,50,14 + PUSHBUTTON "&Hilfe",9,205,123,50,14 + ICON IDI_PRUNE,-1,4,4,20,20 + LTEXT "Löschen alter Dateien vom Server",-1,32,12,123,8 + LTEXT "Diese Operation löscht Sicherungskopien installierter Dateien auf einem bestimmten Server.", + -1,4,29,238,16 + LTEXT "Zu löschende Dateien:",-1,3,73,73,17 +END + +IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Volume umbenennen" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Alter Name:",IDC_STATIC,31,67,39,8 + EDITTEXT IDC_RENSET_OLD,78,65,122,14,ES_AUTOHSCROLL | ES_READONLY + LTEXT "&Neuer Name:",IDC_STATIC,31,85,43,8 + EDITTEXT IDC_RENSET_NEW,78,83,122,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,115,115,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,169,115,50,14 + PUSHBUTTON "Hilfe",9,223,115,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "Geben Sie einen neuen Namen für Volume %3 ein. Die Namen der Sicherung und der Replikate eines Volumes werden automatisch geändert.\n\nAchtung: Wenn Sie ein angehängtes Volume umbenennen, müssen Sie dessen Mount-Punkte löschen und erneut erstellen.", + IDC_RENSET_DESC,31,7,242,48 +END + +IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 277, 68 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Service löschen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Abbrechen",IDCANCEL,169,50,50,14 + PUSHBUTTON "OK",IDOK,115,50,50,14 + PUSHBUTTON "Hilfe",9,223,50,50,14 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "Achtung!\n\nDiese Operation stoppt Service %2 und löscht ihn von Server %1.", + IDC_DELSVC_DESC,31,7,242,33 +END + +IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Dateidatumsangaben abrufen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Server:",-1,4,56,42,8 + COMBOBOX IDC_SERVER,94,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Abzu&fragende Datei:",-1,4,73,79,16 + EDITTEXT IDC_FILENAME,94,73,135,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,86,107,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,140,107,50,14 + PUSHBUTTON "&Hilfe",9,194,107,50,14 + ICON IDI_GETDATES,-1,4,4,20,20 + LTEXT "Abrufen der Datumsangaben von Dateien auf Server",-1,32, + 12,185,8 + LTEXT "Diese Operation ruft das Datum ab, an dem eine Datei sowie ihre Sicherungskopien (falls vorhanden) zuletzt bearbeitet wurden.", + -1,4,29,240,16 +END + +IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Dateidatumsangaben abrufen - Ergebnisse" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Server:",IDC_STATIC,4,30,39,8 + LTEXT "(Wird zur Laufzeit festgelegt)",IDC_SERVER,48,30,132,8 + LTEXT "Dateiname:",IDC_STATIC,4,45,39,8 + LTEXT "(Wird zur Laufzeit festgelegt)",IDC_FILENAME,48,45,132, + 8 + LTEXT "Dateidatum:",IDC_STATIC,4,60,39,8 + LTEXT "(Unbekannt; Datei konnte nicht gefunden werden)", + IDC_DATE_FILE,48,60,197,8 + LTEXT ".BAK-Datum:",IDC_STATIC,4,75,41,8 + LTEXT "(Unbekannt; Datei konnte nicht gefunden werden)", + IDC_DATE_BAK,48,75,196,8 + LTEXT ".OLD-Datum:",IDC_STATIC,4,90,42,8 + LTEXT "(Unbekannt; Datei konnte nicht gefunden werden)", + IDC_DATE_OLD,48,90,196,8 + DEFPUSHBUTTON "S&chließen",IDOK,99,114,50,14 + ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 + LTEXT "Abrufen der Datumsangaben von Dateien auf Server", + IDC_STATIC,32,12,186,8 +END + +IDD_SET_DUMP DIALOGEX 0, 0, 295, 144 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Speicherauszug von Volume erstellen - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Speicherauszugsdatei erstellen; &Name:",IDC_STATIC,4,40, + 100,16 + EDITTEXT IDC_DUMP_FILENAME,109,40,121,14,ES_AUTOHSCROLL + PUSHBUTTON "&Durchsuchen...",IDC_DUMP_BROWSE,237,40,54,14 + CONTROL "Sp&eicherauszug des gesamten Inhalts von Volume %3 (Partition %1:%2) erstellen", + IDC_DUMP_FULL,"Button",BS_AUTORADIOBUTTON | BS_MULTILINE | + WS_GROUP,10,76,274,16 + CONTROL "Speicherauszug nur für Dateien erstellen, die geändert wurden &seit", + IDC_DUMP_LIMIT_TIME,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,10,98,143,16 + CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,160,100, + 51,13,WS_EX_CLIENTEDGE + CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,218,100, + 56,13,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "OK",IDOK,131,126,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,185,126,50,14 + PUSHBUTTON "&Hilfe",9,241,126,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "Diese Operation kopiert den Inhalt eines Volumes in eine einzelne Datei, damit das Volume einfach gesichert werden kann. Die auf diese Weise erstellten Inhaltskopien von Volumes können später wiederhergestellt werden.", + IDC_STATIC,30,7,255,26 + GROUPBOX "Speicherauszugparameter",IDC_STATIC,4,62,287,59 +END + +IDD_SET_RESTORE DIALOGEX 0, 0, 292, 248 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Volume wiederherstellen - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Wiede&rherzustellende Datei:",IDC_STATIC,4,29,69,16 + EDITTEXT IDC_RESTORE_FILENAME,78,30,150,14,ES_AUTOHSCROLL + PUSHBUTTON "&Durchsuchen...",IDC_RESTORE_BROWSE,232,30,55,14 + CONTROL "Diese &ist eine schrittweise steigende Speicherauszugsdatei", + IDC_RESTORE_INCREMENTAL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,77,48,201,10 + LTEXT "&Volume:",IDC_STATIC,11,108,26,8 + EDITTEXT IDC_RESTORE_SETNAME,50,106,115,14,ES_AUTOHSCROLL + LTEXT "&Server:",IDC_STATIC,11,145,24,8 + COMBOBOX IDC_RESTORE_SERVER,51,143,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "&Partition:",IDC_STATIC,11,162,36,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,50,161,231, + 55,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "OK",IDOK,128,230,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,183,230,50,14 + PUSHBUTTON "&Hilfe",9,238,230,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "Volume aus Speicherauszugsdatei wiederherstellen", + IDC_STATIC,33,11,224,8 + GROUPBOX "Ziel-Volume",IDC_STATIC,4,63,284,160 + LTEXT "Wenn Sie ein Volume aus einer Speicherauszugsdatei wiederherstellen, können Sie entweder ein neues Volume erstellen oder ein vorhandenes Read/Write-Volume überschreiben.", + IDC_STATIC,11,76,267,24 + LTEXT "(Wird zur Laufzeit festgelegt)\n(Wird zur Laufzeit festgelegt)", + IDC_RESTORE_CREATE,51,121,229,17 +END + +IDD_SVC_BOS DIALOGEX 0, 0, 225, 207 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "&Periodisch alle Services auf diesem Server stoppen und erneut starten", + IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | + WS_TABSTOP,11,71,196,16 + LTEXT "E&rneut starten",IDC_BOS_GENRES_DESC1,23,96,25,8 + COMBOBOX IDC_BOS_GENRES_DATE,54,94,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "&um",IDC_BOS_GENRES_DESC2,127,97,12,8 + CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,147, + 94,53,13,WS_EX_CLIENTEDGE + CONTROL "Periodisch alle Services auf diesem Server auf neue &Binärdateien testen", + IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | + WS_TABSTOP,11,153,201,14 + LTEXT "Te&st",IDC_BOS_BINRES_DESC1,23,178,25,8 + COMBOBOX IDC_BOS_BINRES_DATE,54,176,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "u&m",IDC_BOS_BINRES_DESC2,127,179,12,8 + CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,147, + 176,53,13,WS_EX_CLIENTEDGE + ICON IDI_BOSSERVICE,IDC_STATIC,5,5,20,20 + LTEXT "Service %2 (Server %1)",IDC_SVC_NAME,52,13,168,8 + GROUPBOX "BOS-Service",IDC_STATIC,5,27,215,175 + LTEXT "Mit dem BOS-Service können periodisch alle Services auf diesem Server gestoppt und erneut gestartet werden (einschließlich des BOS-Services selbst).", + IDC_STATIC,11,41,200,24 + LTEXT "Der BOS-Service kann ebenfalls dazu verwendet werden, um alle Services auf einem Server periodisch zu testen oder um nur die Services zu stoppen und erneut zu starten, deren Binärdateien aktualisiert wurden.", + IDC_STATIC,11,115,200,32 +END + +IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "Speicherauszug von Volume erstellen - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "Speicherauszugsdatei %4 wird von Volume %3 erstellt...", + IDC_DUMPSET_DESC,4,41,229,19 +END + +IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "Volume wiederherstellen - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "Volume %1 wird aus Speicherauszugsdatei %2 wiederhergestellt...", + IDC_RESTORESET_DESC,4,41,229,19 +END + +IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 306, 162 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Volumes sichern - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "Sicherungsversionen &aller Volumes dieser Zelle erstellen", + IDC_CLONE_ALL,"Button",BS_AUTORADIOBUTTON,30,49,214,10 + GROUPBOX " ",IDC_STATIC,25,66,260,67 + CONTROL "Nur Sicherungen für V&olumes erstellen, die folgenden Kriterien entsprechen:", + IDC_CLONE_SOME,"Button",BS_AUTORADIOBUTTON,30,64,250,11 + CONTROL "Nur Volumes auf &Server:",IDC_CLONE_SVR_LIMIT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,45,83,92,10 + COMBOBOX IDC_CLONE_SVR,191,82,85,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Nur Volumes auf &Partition:",IDC_CLONE_AGG_LIMIT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,45,99,97,10 + COMBOBOX IDC_CLONE_AGG,191,98,85,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Nur Volumes, die &beginnen mit:",IDC_CLONE_PREFIX_LIMIT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,116,109,10 + EDITTEXT IDC_CLONE_PREFIX,191,115,85,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,140,144,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,194,144,50,14 + PUSHBUTTON "&Hilfe",9,250,144,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "Eine Volume-Sicherung stellt sich als schreibgeschützte Kopie des Volumes dar. Ein Read/Write-Volume kann über nur eine Sicherungskopie verfügen.\n\nSie können Sicherungsversionen für mehrere Volumes gleichzeitig erstellen.", + IDC_STATIC,28,7,272,40 +END + +IDD_SUBSETS DIALOGEX 0, 0, 281, 182 +STYLE WS_POPUP | WS_CAPTION +CAPTION "Überwachte Server" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Untergruppenname:",IDC_STATIC,11,77,63,8 + EDITTEXT IDC_SUBSET_NAME,76,75,106,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_TABSTOP + PUSHBUTTON "Ö&ffnen...",IDC_SUBSET_LOAD,185,75,39,14 + PUSHBUTTON "&Speichern...",IDC_SUBSET_SAVE,229,75,41,14 + CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x153,12,111,193,58,WS_EX_CLIENTEDGE + PUSHBUTTON "&Alle überwachen",IDC_SUBSET_ALL,209,122,64,14 + PUSHBUTTON "Kei&ne überwachen",IDC_SUBSET_NONE,209,140,64,14 + LTEXT "Wenn Sie mit einer sehr großen Zelle arbeiten, können Sie bestimmte Server von der Überwachung ausnehmen, um die Leistung zu verbessern. Der AFS Server Manager zeigt keine Volumes, Partitionen oder Services von Servern an, die nicht überwacht werden.", + IDC_STATIC,5,5,271,32 + LTEXT "Sie können die Überwachung eines Servers jederzeit aktivieren (oder inaktivieren). Sie können Server-Untergruppen erstellen, um Listen mit zu überwachenden Servern zu bestimmen.", + IDC_STATIC,5,37,271,23 + GROUPBOX "Aktuelle Untergruppe",IDC_STATIC,5,63,271,114 + LTEXT "Zu überwachende Server:",IDC_STATIC,12,95,91,8 +END + +IDD_SUBSET_LOADSAVE DIALOGEX 0, 0, 280, 145 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | + WS_CAPTION | WS_SYSMENU +CAPTION "(Titel wird zur Laufzeit festgelegt)" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Untergruppen&name:",1090,5,112,63,8,SS_NOTIFY + EDITTEXT IDC_SUBSET_NAME,73,110,149,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "Ö&ffnen",IDOK,226,110,50,14 + PUSHBUTTON "&Abbrechen",IDCANCEL,226,127,50,14 + CONTROL "Liste 1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | + LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,272,82, + WS_EX_CLIENTEDGE + PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT + WS_TABSTOP + PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT + WS_TABSTOP + LTEXT "Bereits für diese Zelle definierte Untergruppen:", + IDC_STATIC,4,6,150,8 +END + +IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Befehl suchen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + COMBOBOX IDC_FIND_COMMAND,4,38,137,170,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "&Hilfe anzeigen",IDOK,147,38,67,14 + PUSHBUTTON "&Abbrechen",IDCANCEL,147,55,67,14 + LTEXT "Um festzustellen, wie Sie mit dem AFS Server Manager eine Aufgabe durchführen, wählen Sie unten eine Befehlszeile aus und klicken auf ""Hilfe anzeigen"".", + IDC_STATIC,4,4,210,25 +END + +IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 141 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Fehlercode suchen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "F&ehlernummer:",IDC_STATIC,4,41,45,8 + EDITTEXT IDC_ERROR_NUMBER,59,39,78,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "Überse&tzen",IDC_ERROR_TRANSLATE,147,39,67,14 + PUSHBUTTON "S&chließen",IDCANCEL,85,123,48,14 + LTEXT "(Text wird zur Laufzeit festgelegt)",IDC_ERROR_DESC,4, + 71,210,42 + LTEXT "Um die Bedeutung eines Fehlercodes festzustellen, geben Sie den Code unten ein und klicken dann auf ""Übersetzen"".", + IDC_STATIC,4,4,210,25 + CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 +END + +IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Informationen zu AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 + LTEXT "AFS Server Manager Version 3.5",IDC_STATIC,33,8,163,8 + LTEXT "Copyright © IBM Corporation 1989, 1999",IDC_STATIC,33, + 20,183,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 + CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 + PUSHBUTTON "S&chließen",IDOK,89,123,50,14 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 +END + +IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Der AFS Server Manager sucht in Zelle %1 nach Servern...", + IDC_OPENCELL_DESC,41,15,183,16 + GROUPBOX "",IDC_STATIC,4,2,231,39 + ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 279, 136 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "Vollständige Domänennamen für Server anzeigen (z.B. ""machine.company.com"")", + IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,5,269,10 + CONTROL "&Warnung anzeigen, wenn ohne Verwaltungs-Token gearbeitet wird", + IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,19,269,10 + CONTROL "...werden immer die Merkmale des Servers angezeigt", + IDC_OPT_SVR_DBL_PROP,"Button",BS_AUTORADIOBUTTON,7,50, + 253,10 + CONTROL "...werden die Merkmale des Servers nur angezeigt, wenn die Schnellansicht geöffnet ist", + IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,7,60,255,16 + CONTROL "...wird immer ein Fenster für diesen Server geöffnet", + IDC_OPT_SVR_DBL_OPEN,"Button",BS_AUTORADIOBUTTON,7,77, + 253,10 + CONTROL "...führt das Öffnen eines Server-Fensters zur Überwachung dieses Servers", + IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,103,253,10 + CONTROL "...führt das Schließen eines Server-Fensters dazu, daß dieser Server nicht mehr überwacht wird", + IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | + BS_MULTILINE | WS_TABSTOP,7,114,261,15 + LTEXT "Durch Doppelklicken auf das Symbol eines Servers...", + IDC_STATIC,5,38,269,8 + LTEXT "Wenn eine Server-Untergruppe im Gebrauch und die Schnellansicht geschlossen ist...", + IDC_STATIC,5,91,272,8 +END + +IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,22,216, + 135,WS_EX_CLIENTEDGE + PUSHBUTTON "Server-Schlüssel &hinzufügen",IDC_KEY_ADD,29,160,96,14 + PUSHBUTTON "Server-Schlüssel entfe&rnen",IDC_KEY_REMOVE,129,160,93, + 14 + LTEXT "Schlüssel für Server:",IDC_KEY_NAME,5,7,216,8 +END + +IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Server-Schlüssel hinzufügen" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Version:",IDC_STATIC,7,37,26,8 + EDITTEXT IDC_KEY_VERSION,43,35,43,14,ES_AUTOHSCROLL + LTEXT "Wert:",IDC_STATIC,7,58,21,8 + CONTROL "Diese Zeichenfolge verschlüsseln:",IDC_KEY_BYSTRING, + "Button",BS_AUTORADIOBUTTON | BS_MULTILINE,39,53,75,23 + CONTROL "Diesen Schlüssel verwenden:",IDC_KEY_BYDATA,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,40,75,72,15 + EDITTEXT IDC_KEY_STRING,119,56,155,14,ES_PASSWORD | + ES_AUTOHSCROLL + EDITTEXT IDC_KEY_DATA,119,75,103,14,ES_AUTOHSCROLL + PUSHBUTTON "Wahlf&rei",IDC_KEY_RANDOM,226,75,48,14 + LTEXT "Erinnerung: Nach dem Hinzufügen eines neuen Schlüssels zu einem Server sollten Sie das AFS-Konto ändern, um den neuen Schlüssel zu verwenden. Nach ein paar Tagen können Sie alle alten Server-Schlüssel entfernen.", + IDC_STATIC,7,99,267,25 + DEFPUSHBUTTON "OK",IDOK,116,129,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,170,129,50,14 + PUSHBUTTON "Hilfe",9,224,129,50,14 + LTEXT "Neuer Schlüssel für Server %1",IDC_KEY_TITLE,43,14,181, + 8 + ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 +END + +IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 277, 145 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Service starten/stoppen" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,115,127,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,169,127,50,14 + PUSHBUTTON "&Hilfe",9,223,127,50,14 + ICON IDI_SERVICE,IDC_STATIC,4,7,21,20 + LTEXT "Klicken Sie auf OK, um Service %2 auf Server %1 zu starten/stoppen.", + IDC_STARTSTOP_TEXT,31,12,242,9 + CONTROL "&Permanent (IDS_START/STOPSERVICE_PERMANENT)", + IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,37,64,226,18 + CONTROL "&Temporär (IDS_START/STOPSERVICE_TEMPORARY)", + IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,37,85,226,18 + GROUPBOX "Servicestart",IDC_STATIC,31,31,242,81 + LTEXT "Sie können diese Änderung permanent gestalten, damit Service %2 (nicht) automatisch gestartet wird, wenn Server %1 erneut gestartet wird.", + IDC_STARTSTOP_STARTUP,38,45,228,16 +END + +IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 248, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Befehl ausführen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Server:",IDC_STATIC,4,56,42,8 + COMBOBOX IDC_SERVER,50,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Befehl:",IDC_STATIC,4,75,42,8 + EDITTEXT IDC_COMMAND,50,73,194,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,86,107,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,140,107,50,14 + PUSHBUTTON "&Hilfe",9,194,107,50,14 + ICON IDI_SERVER,IDC_STATIC,4,4,20,20 + LTEXT "Befehl auf Server ausführen",IDC_STATIC,32,12,195,8 + LTEXT "Mit dieser Operation können Sie einen Befehl auf einem fernen Server ausführen.\nEr wird normalerweise dazu verwendet, um einen Server erneut zu starten, indem das Skript /etc/reboot ausgeführt wird.", + IDC_STATIC,4,29,240,16 +END + +IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 286, 271 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Volumes wiederherstellen - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Server:",IDC_STATIC,30,59,35,8 + COMBOBOX IDC_SERVER,67,57,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Partition:",IDC_STATIC,30,76,35,8 + COMBOBOX IDC_AGGREGATE,67,74,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "&Alle Partitionen wiederherstellen",IDC_AGGREGATE_ALL, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,76,113,10 + LTEXT "V&olume:",IDC_STATIC,29,94,35,8 + COMBOBOX IDC_FILESET,67,92,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "A&lle Volumes wiederherstellen",IDC_FILESET_ALL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,163,94,107,10 + DEFPUSHBUTTON "OK",IDOK,85,114,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,139,114,50,14 + PUSHBUTTON "&Hilfe",9,232,114,50,14 + PUSHBUTTON "&Weitere >>",IDC_ADVANCED,4,114,53,14 + LTEXT "Pfad für &temporäre Dateien:",IDC_STATIC,10,148,89,8 + EDITTEXT IDC_SALVAGE_TEMPDIR,102,147,173,13,ES_AUTOHSCROLL + CONTROL "Pa&rallele Wiederherstellungen; Anzahl der Prozesse:", + IDC_SALVAGE_SIMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 29,163,178,10 + EDITTEXT IDC_SALVAGE_NUM,214,162,25,13,ES_AUTOHSCROLL + CONTROL "Kei&ne beschädigten Volumes wiederherstellen", + IDC_SALVAGE_READONLY,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,29,173,165,10 + CONTROL "Lesevorgänge in kleine &Blöcke unterteilen", + IDC_SALVAGE_BLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 29,183,152,10 + CONTROL "&Wiederherstellung aller gekennzeichneten Volumes erzwingen", + IDC_SALVAGE_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 29,193,218,10 + CONTROL "Wi&ederaufbau der Verzeichnisstruktur erzwingen", + IDC_SALVAGE_FIXDIRS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,29,203,170,10 + LTEXT "Dateiname für Ergebnisprotoko&ll:",IDC_STATIC,10,217, + 104,8 + EDITTEXT IDC_SALVAGE_LOG_FILE,118,216,156,13,ES_AUTOHSCROLL + CONTROL "L&iste beschädigter inodes in Ergebnisprotokoll aufnehmen", + IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,30,230,213,10 + CONTROL "Liste der im Besitz von AFS befindlichen root inodes in Ergebnisprotokoll aufnehmen", + IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | + BS_MULTILINE | WS_TABSTOP,30,241,246,15 + ICON IDI_SERVER,IDC_STATIC,4,7,21,20 + LTEXT "Mit dieser Operation können Sie Probleme auf einem oder mehreren Volumes beheben.\n\nHinweis: Wenn Sie eine komplette Partition oder einen Server in einem Schritt wiederherstellen, wird der Server temporär offline geschaltet.", + IDC_STATIC,31,8,247,46 + GROUPBOX "Erweiterte Wiederherstellungsoptionen", + IDC_ADVANCED_GROUP,4,134,278,128 +END + +IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Volumes wiederherstellen - Ergebnisse" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "S&chließen",IDOK,232,160,50,14 + LTEXT "Ergebnisse der Wiederherstellungsoperationen:", + IDC_STATIC,4,33,277,8 + EDITTEXT IDC_SALVAGE_DETAILS,4,43,277,113,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP + ICON IDI_SERVER,IDC_STATIC,4,7,21,20 + LTEXT "Volume %3 auf Partition %2 des Servers %1 wiederherstellen", + IDC_SALVAGE_TITLE,33,15,248,8 +END + +IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 301, 103 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Volume freigeben" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,140,85,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,194,85,50,14 + PUSHBUTTON "&Hilfe",9,247,85,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,21,20 + LTEXT "Mit dieser Operation können Sie die Replikate von Volume %3 aktualisieren. Sie können entweder Replikate aktualisieren, die nicht auf dem neuesten Stand sind, oder aber alle Replikate.", + IDC_RELSET_DESC,34,7,254,25 + CONTROL "N&ur Volume-Replikate aktualisieren, die nicht nicht auf dem neuesten Stand sind", + IDC_RELSET_NORMAL,"Button",BS_AUTORADIOBUTTON,8,41,264, + 10 + CONTROL "&Alle Volume-Replikate aktualisieren, auch wenn diese auf dem neuesten Stand sind", + IDC_RELSET_FORCE,"Button",BS_AUTORADIOBUTTON,8,56,276,10 +END + +IDD_SVR_HOSTS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + PUSHBUTTON "Host-Server &hinzufügen",IDC_HOST_ADD,56,160,82,14 + PUSHBUTTON "Host-Server entfe&rnen",IDC_HOST_REMOVE,141,160,80,14 + LTEXT "Vom Server erkannte Datenbank-Host-Server:", + IDC_HOST_TITLE,5,7,216,8 + CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, + 135,WS_EX_CLIENTEDGE +END + +IDD_SVR_ADDHOST DIALOGEX 0, 0, 242, 106 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Host-Server hinzufügen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Host:",-1,31,55,26,8 + EDITTEXT IDC_ADDHOST_HOST,61,53,103,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,80,88,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,134,88,50,14 + ICON IDI_SERVER,-1,4,4,21,20 + LTEXT "Sie haben das Hinzufügen eines Datenbank-Host-Servers zur Liste gewählt, die auf Server %1 gespeichert wird.\n\nGeben Sie unten den Namen des neuen Datenbank-Hosts ein.", + IDC_ADDHOST_DESC,27,8,211,40 + PUSHBUTTON "Hilfe",9,188,88,50,14 +END + +IDD_SVR_ADDRESS DIALOGEX 0, 0, 208, 115 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Server-Adressen ändern" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "In VLDB aufgezeichnete IP-Adressen für Server %1:", + IDC_TITLE,4,4,200,8 + LISTBOX IDC_SVR_ADDRESSES,4,14,147,40,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Ä&ndern...",IDC_ADDR_CHANGE,154,24,50,14 + PUSHBUTTON "&Entfernen",IDC_ADDR_REMOVE,154,40,50,14 + DEFPUSHBUTTON "OK",IDOK,46,97,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,100,97,50,14 + PUSHBUTTON "Hilfe",9,154,97,50,14 + LTEXT "Hinweis: Beim Start eines Datei-Servers registriert dieser seine aktuellen IP-Adressen automatisch mit VLDB.", + IDC_STATIC,4,64,200,18 +END + +IDD_SVR_NEWADDR DIALOGEX 0, 0, 223, 69 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "IP-Adresse ändern" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,61,51,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,115,51,50,14 + PUSHBUTTON "Hilfe",9,169,51,50,14 + LTEXT "Geben Sie die neue IP-Adresse ein, die %1 in VLDB ersetzen soll:", + IDC_TITLE,4,4,215,17 + CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,42,28, + 87,11 + LTEXT "Adresse:",IDC_STATIC,4,30,28,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" +32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" +32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" +IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" +IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" +IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" +IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" +IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" +IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" +IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" +IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" +IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" +IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" +IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" +IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" +IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" +IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" +IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +ACCEL_MAIN ACCELERATORS DISCARDABLE +BEGIN + VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT + VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT + VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT + VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT + VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT + VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT + VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT + VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, + NOINVERT + VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_LISTS_TITLE "Server %1 - Admin-Listen" + IDS_TAB_SERVICES "Services" + IDS_TAB_AGGREGATES "Partitionen" + IDS_TAB_FILESETS "Volumes" + IDS_SERVICE_NONESELECTED "Wählen Sie einen anzuzeigenden Server aus." + IDS_SERVICE_GOTSELECTED "Service-Prozesse auf Server %1:" + IDS_AGGREGATE_ALL "Partitionen auf allen Servern:" + IDS_AGGREGATE_ONE "Partitionen auf Server %1:" + IDS_FILESET_ALL "Alle Volumes in Zelle %1:" + IDS_FILESET_ONE "Volumes auf Server %1:" + IDS_SVR_LISTS_TAB "Admin-Listen" + IDS_SVR_PROP_TITLE "Server %1 - Merkmale" + IDS_SVR_GENERAL_TAB "Allgemein" + IDS_SVR_SCOUT_TAB "Einstellungen" + IDS_SERVER_TITLE "Server %1 - AFS Server Manager" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_DESC "Server %1 in Zelle %2:" + IDS_SVC_PROP_TITLE "Service %2 auf Server %1 - Merkmale" + IDS_SVC_GENERAL_TAB "Allgemein" + IDS_SVC_ADD_TITLE "Service erstellen" + IDS_SVC_ADD_TAB "Service erstellen" + IDS_AGG_PROP_TITLE "Partition %2 auf Server %1 - Merkmale" + IDS_AGG_GENERAL_TAB "Allgemein" + IDS_SET_REP_TITLE "Volume %1 - Nachbildung" + IDS_SET_REPSITES_TAB "Nachbildungsstandorte" + IDS_SET_PROP_TITLE "Volume %1 - Merkmale" + IDS_SET_GENERAL_TAB "Allgemein" + IDS_SET_UNLOCKBTN "Jetzt Sperre &aufheben" + IDS_SET_LOCKBTN "Jetzt &sperren" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_USAGE_FILESET "%1 verwendet von %2 Quote (%3%%)" + IDS_USAGE_AGGREGATE "%1 verwendet von %2 Kapazität (%3%%)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGCOL_ALLOCATED "Kombinierte Quote" + IDS_SVRCOL_NAME "Server" + IDS_SVRCOL_STATUS "Status" + IDS_SETCOL_DATE_ACCESS "Letzter Zugriff" + IDS_SETCOL_DATE_BACKUP "Letzte Sicherung" + IDS_SVCCOL_NAME "Service" + IDS_SVCCOL_TYPE "Typ" + IDS_SVCCOL_PARAMS "Parameter" + IDS_SVCCOL_STATUS "Status" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_DATE_START "Zuletzt gestartet" + IDS_SVCCOL_DATE_STOP "Zuletzt gestoppt" + IDS_SVCCOL_DATE_STARTSTOP "Zuletzt gestartet/gestoppt" + IDS_SVCCOL_DATE_FAILED "Zuletzt fehlgeschlagen" + IDS_SVCCOL_LASTERROR "Letzter Exit-Code" + IDS_AGGCOL_NAME "Partition" + IDS_AGGCOL_ID "ID" + IDS_AGGCOL_DEVICE "Gerät" + IDS_AGGCOL_USED "Verwendet" + IDS_AGGCOL_USED_PER "% verwendet" + IDS_AGGCOL_FREE "Frei" + IDS_AGGCOL_TOTAL "Kapazität" + IDS_AGGCOL_STATUS "Status" + IDS_SETCOL_NAME "Volume" + IDS_SETCOL_TYPE "Typ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETCOL_DATE_CREATE "Erstellt" + IDS_SETCOL_DATE_UPDATE "Zuletzt aktualisiert" + IDS_SETCOL_STATUS "Status" + IDS_SETCOL_QUOTA_USED "Verwendet" + IDS_SETCOL_QUOTA_USED_PER "% verwendet" + IDS_SETCOL_QUOTA_FREE "Frei" + IDS_SETCOL_QUOTA_TOTAL "Quote" + IDS_TRYAGAINBTN "Erneut &versuchen" + IDS_NO_CELL_SELECTED "(Es wurde keine Zelle angegeben)" + IDS_NO_AFS_ID "(Es sind keine Token verfügbar)" + IDS_AFS_ID_WILLEXP "%1 (Token laufen %2 ab)" + IDS_ELAPSED_TIME "%1" + IDS_SEARCHING_FOR_SERVERS + "Bitte warten; Informationen über Zelle %1 werden abgerufen..." + IDS_STATUS_NOALERTS "Normal" + IDS_TITLE_BROWSE_USER "Benutzer auswählen" + IDS_AGGTYPE_OTHER "Unbekannt (%1)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATEFILESET "Volume %3 wird auf Partition %1:%2 erstellt" + IDS_ACTION_DELETEFILESET "Volume %3 wird von Partition %1:%2 gelöscht" + IDS_ACTION_MOVEFILESET "Volume %3 wird auf Partition %1:%2 verschoben" + IDS_ACTION_SETFILESETQUOTA "Die Quote für Volume %3 wird geändert" + IDS_SVCSTOP_DESC2 "Klicken Sie auf OK, um diesen Service zu stoppen." + IDS_SVCSTART_DESC2 "Klicken Sie auf OK, um diesen Service zu starten." + IDS_SYNCVLDB_SVR_DESC "Achtung!\n\nWenn Sie fortfahren, ändert der AFS Server Manager die VLDB, um die Inhalte aller Partitionen auf Server %1 abzugleichen." + IDS_SYNCVLDB_SVR_DESC2 "Wenn die VLDB ein Volume aufführt, das momentan in keiner Partition auf Server %1 gefunden werden kann, dann wird der VLDB-Eintrag für dieses Volume gelöscht!" + IDS_SYNCVLDB_AGG_DESC "Achtung!\n\nWenn Sie fortfahren, ändert der AFS Server Manager die VLDB, um die Inhalte von Partition %2 auf Server %1 abzugleichen." + IDS_SYNCVLDB_AGG_DESC2 "Wenn die VLDB ein Volume aufführt, das momentan nicht in dieser Partition gefunden werden kann, dann wird der VLDB-Eintrag für dieses Volume gelöscht!" + IDS_PROMPT_BROWSE_USER "Benutzer:" + IDS_PREVIEWIN_BUTTON "<< &Voranzeige" + IDS_PREVIEWOUT_BUTTON "Voran&zeige >>" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ADMCOL_TYPE_USER "Benutzer" + IDS_TITLE_BROWSE_PRINCIPAL "Principal auswählen" + IDS_TITLE_BROWSE_OWNGROUP "Eignergruppe auswählen" + IDS_PROMPT_BROWSE_PRINCIPAL "Principal:" + IDS_PROMPT_BROWSE_OWNGROUP "Eignergruppe:" + IDS_ACTION_CLONE "Sicherungsversion von Volume %3 wird erstellt" + IDS_ACTION_CLONESYS "Es werden mehrere Volume-Sicherungen erstellt" + IDS_CLONESYS_FAILED "Von Volume %1 konnte keine Sicherung erstellt werden, da der Fehler 0x%2 (%3) aufgetreten ist." + IDS_SET_UNSPECIFIED "(Nicht angegeben)" + IDS_SETCOL_ID "ID" + IDS_SETCOL_FILES "Dateianzahl" + IDS_SET_DUMP_NAME "Speicherauszug von %1.DMP" + IDS_ACTION_DUMP "Speicherauszug von Volume %3 wird erstellt (Partition %1:%2)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FILESETNAME_ERROR "%1 - %2" + IDS_SETCOL_AGGREGATE "Partition" + IDS_REFRESH_DESC_CELL "Der AFS Server Manager ermittelt den Status von Servern in Zelle %1. Dies kann einen Moment dauern..." + IDS_REFRESH_DESC_SERVER "Der AFS Server Manager ermittelt den Status von Server %1. Dies kann einen Moment dauern..." + IDS_REFRESH_CURRENT_CELL "Aktuelle Prüfung von: Zelle %1" + IDS_REFRESH_CURRENT_SERVER "Aktuelle Prüfung von: Server %2" + IDS_REFRESH_CURRENT_AGGREGATE + "Aktuelle Prüfung von: Partition %3 auf Server %2" + IDS_REFRESH_CURRENT_FILESET + "Aktuelle Prüfung von: Volume %4 auf Server %2, Partition %3" + IDS_REFRESH_CURRENT_SERVICE + "Aktuelle Prüfung von: Service %3 auf Server %2" + IDS_REFRESH_PERCENT "%1%% abgeschlossen" + IDS_PROBLEMS "Probleme" + IDS_SERVER_NO_PROBLEMS "Dieser Server weist keine bekannten Probleme auf." + IDS_SERVICE_NO_PROBLEMS "Dieser Service weist keine bekannten Probleme auf." + IDS_AGGREGATE_NO_PROBLEMS + "Diese Partition weist keine bekannten Probleme auf." + IDS_FILESET_NO_PROBLEMS "Dieses Volume weist keine bekannten Probleme auf." + IDS_AGGTYPE_TYPE1 "UFS" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGTYPE_TYPE2 "LFS" + IDS_AGGTYPE_TYPE3 "AIX" + IDS_AGGTYPE_TYPE4 "VXFS" + IDS_AGGTYPE_TYPE5 "DMEPI" + IDS_REFRESH_CURRENT_VLDB + "Aktuelle Prüfung von: Volume Location Database (VLDB, Datenbank der Volume-Adressen)" + IDS_FILESETTYPE_RW "Read/Write" + IDS_FILESETTYPE_RO "Replikat" + IDS_FILESETTYPE_CLONE "Sicherung" + IDS_MOVESET_READWRITE "Wenn Sie fortfahren, wird Volume %3 von Partition %2 auf Server %1 an eine andere Position verschoben." + IDS_MOVESET_READONLY "Wenn Sie fortfahren, wird das Volume-Replikat %3 von Partition %2 auf Server %1 entfernt. Desweiteren wird ein weiteres Volume-Replikat auf der Partition erstellt, die Sie unten angeben." + IDS_SVC_START_TITLE "Service starten" + IDS_SVC_STOP_TITLE "Service stoppen" + IDS_SERVICESTATUS_STARTING "Dieser Service wird momentan gestartet." + IDS_SERVICESTATUS_RUNNING "Dieser Service ist momentan aktiv." + IDS_SERVICESTATUS_STOPPED "Dieser Service wird momentan angehalten." + IDS_SERVICESTATUS_STOPPING "Dieser Service wird momentan gestoppt." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICESTATUS_UNKNOWN "Der Status dieses Services ist unbekannt." + IDS_SVC_RESTART_BUTTON "Jetzt stoppen und &neu starten" + IDS_PROBLEM_BOX "Bekannte Probleme (%1)" + IDS_VIEWLOG_DESC_NOFILE "Der AFS Server Manager konnte die Protokolldatei für Service %2 auf Server %1 nicht finden. Geben Sie unten den vollständigen Pfad zur Protokolldatei des Services ein." + IDS_NO_GROUP "(Keine Eignergruppe)" + IDS_VIEWLOG_FROMSERVER "Protokolldatei auf Server %1" + IDS_VIEWLOG_FROMSERVICE "Protokolldatei für Service %2 auf Server %1" + IDS_VIEWLOG_TRUNCATED "Dateiinhalte (es werden nur die letzten %1 Zeilen angezeigt):" + IDS_SAVELOG_FILTER "Textdatei|*.TXT|" + IDS_ADVANCEDIN_BUTTON "<< &Weitere" + IDS_ADVANCEDOUT_BUTTON "&Weitere >>" + IDS_REPTYPE_RELEASE "Nachbildung freigeben" + IDS_REPTYPE_SCHEDULED "Geplante Nachbildung" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_UPDATEALL_BUTTON "Alles akt&ualisieren" + IDS_UPDATETHIS_BUTTON "Akt&ualisieren" + IDS_SERVER_MULTIPLE_PROBLEMS + "Dieser Server weist %1 bekannte Probleme auf." + IDS_SERVICE_MULTIPLE_PROBLEMS + "Dieser Service weist %1 bekannte Probleme auf." + IDS_AGGREGATE_MULTIPLE_PROBLEMS + "Diese Partition weist %1 bekannte Probleme auf." + IDS_FILESET_MULTIPLE_PROBLEMS + "Dieses Volume weist %1 bekannte Probleme auf." + IDS_FILESETTYPE_RO_STAGE "Replikat" + IDS_SERVICETYPE_SIMPLE_LONG "Einfach (fortlaufende Ausführung)" + IDS_SERVICETYPE_CRON_LONG "Cron (Ausführung in bestimmten Intervallen)" + IDS_QUOTAUNITS_KB "KB" + IDS_QUOTAUNITS_MB "MB" + IDS_NO_QUOTA_REPLICA "(Bei diese Volume handelt es sich um ein Replikat und daher verfügt es über keine Quote)" + IDS_NO_QUOTA_CLONE "(Bei diese Volume handelt es sich um eine Sicherung und daher verfügt es über keine Quote)" + IDS_USAGE_REPLICA "%1 verwendet" + IDS_USAGE_CLONE "%1 verwendet" + IDS_COL_AGGS_MOVE "Bei der Erstellung eines Volumes erfolgt eine Partitionierung" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PERCENTAGE "%1 %%" + IDS_AGGREGATES_IN_SERVER "Partitionen auf Server %1:" + IDS_AGGREGATES_IN_CELL "Alle Partitionen in Zelle %1:" + IDS_AGGREGATES_IN_NOTHING "Partitionen:" + IDS_FILESETS_IN_SERVER "Volumes auf Server %1:" + IDS_FILESETS_IN_CELL "Alle Volumes in Zelle %1:" + IDS_FILESETS_IN_NOTHING "Volumes:" + IDS_SERVICES_IN_SERVER "Services auf Server %1:" + IDS_SERVICES_IN_NOTHING "Services:" + IDS_UNKNOWN "(Unbekannt)" + IDS_UNKNOWN_GROUP "Gruppe #%1 (Name nicht bekannt)" + IDS_AGGFULL_WARN_OFF "der Standardschwellenwert (Warnung ist auf dem Server inaktiviert)" + IDS_SERVER_AGGREGATE "%1:%2" + IDS_SERVERNAME_ERROR "%1 - %2" + IDS_AGGREGATENAME_ERROR "%1 - %2" + IDS_SETFULL_WARN_OFF "der Standardschwellenwert (Warnung ist auf dem Server inaktiviert)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_LASTERRORDATE "%1 - Exit-Code %2" + IDS_COL_SERVERS "Server in einer Zelle" + IDS_COL_FILESETS "Volumes auf einem Server" + IDS_COL_AGGREGATES "Partitionen auf einem Server" + IDS_COL_SERVICES "Services auf einem Server" + IDS_COL_REPLICAS "Replikate eines Volumes" + IDS_COLUMNS_TITLE "Anzeigespalten auswählen - AFS Server Manager" + IDS_REPCOL_SERVER "Server" + IDS_REPCOL_AGGREGATE "Partition" + IDS_REPCOL_DATE_UPDATE "Letzte Aktualisierung" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COL_AGGS_CREATE "Beim Verschieben eines Volumes erfolgt eine Partitionierung" + IDS_WARN_TITLE "Achtung" + IDS_WARN_DISABLE_AUTH "Wenn Sie auf ""Nicht authentifizierte erlauben"" klicken, ermöglichen Sie es nicht authentifizierten Principals, die Services auf diesem Server zu ändern. Da viele die Identität Root besitzen, stellt diese Aktion +" + IDS_WARN_DISABLE_AUTH2 "eine beachtliche Schwachstelle für die Sicherheit des Servers dar.\n\nSind Sie sicher, daß Sie diese Änderung vornehmen möchten?" + IDS_SVR_NO_ADDR "(Nicht angegeben)" + IDS_TITLE_BAD_CELL "Unbekannter Zellenname" + IDS_DESC_BAD_CELL "Der von Ihnen eingegebene Zellenname konnte nicht im Netzwerk gefunden werden.\n\nÜberprüfen Sie Ihren Eintrag erneut, um sicherzustellen, daß dieser korrekt ist." + IDS_AGGFULL_WARN_ON "der Stan&dardschwellenwert für diesen Server (%1%% seiner Größe)" + IDS_SETFULL_WARN_ON "der Stan&dardschwellenwert für diesen Server (%1%% seiner Größe)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_ERROR_BAD_CREDENTIALS + "Die eingegebene AFS-ID wurde nicht erkannt, oder das angegebene Kennwort ist falsch." + IDS_SVR_CREDS_NONE "(keine Token)" + IDS_SVR_CREDS_VALID "%2, läuft %3 ab" + IDS_SVR_CREDS_EXPIRED "(Token %3 abgelaufen)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGG_FILESETS "%1 (Kombinierte Quote: %2)" + IDS_ACTION_DESC_NONE "Momentan laufen keine Operationen." + IDS_ACTION_DESC_ONE "Momentan läuft die folgende Operation:" + IDS_ACTION_DESC_MULT "Die folgenden Operationen sind momentan aktiv:" + IDS_ACTCOL_OPERATION "Operation" + IDS_ACTCOL_ELAPSED "Abgelaufene Zeit" + IDS_ACTION_REFRESH "Neuanzeige der Zelleninformationen" + IDS_ACTION_CREATESERVER "Server %1 wird erstellt" + IDS_ACTION_DELETESERVER "Server %1 wird gelöscht" + IDS_ACTION_GETSERVERLOGFILE + "Protokolldatei %2 wird von Server %1 abgerufen" + IDS_ACTION_SETSERVERAUTH + "Für Server %1 werden die Zugriffsbeschränkungen geändert" + IDS_ACTION_CHANGESERVERSTATUS "Die Merkmale von Server %1 werden geändert" + IDS_ACTION_STARTSERVICE "Service %2 wird auf Server %1 gestartet" + IDS_ACTION_STOPSERVICE "Service %2 wird auf Server %1 gestoppt" + IDS_ACTION_RESTARTSERVICE "Service %2 wird auf Server %1 erneut gestartet" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SYNCVLDB_SVR "VLDB wird mit Server %1 synchronisiert" + IDS_ACTION_SYNCVLDB_AGG "VLDB wird mit Partition %1:%2 synchronisiert" + IDS_ACTION_SCOUT "Server %1 wird auf Probleme untersucht" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SETREPPARAMS "Die Nachbildungsmerkmale für Volume %3 werden geändert" + IDS_ACTION_CREATEREPLICA + "Von Volume %3 wird auf Partition %1:%2 ein Replikat erstellt" + IDS_DELSET_REPLICA_DESC "Achtung!\n\nWenn Sie fortfahren, wird das Replikat von Volume %3 auf Partition %2 des Servers %1 entfernt." + IDS_DELSET_CLONE_DESC "Achtung!\n\nWenn Sie fortfahren, wird die Volume-Sicherung %3 von Partition %2 des Servers %1 entfernt." + IDS_INSTALL_DESC1 "Diese Operation kopiert eine Datei von diesem Computer auf einen anderen. +" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_INSTALL_DESC2 "Wenn die Datei bereits auf dem Zielcomputer vorhanden ist, wird diese gesichert und sie erhält die Erweiterung .BAK; vorhandene Sicherungen der Datei erhalten die Erweiterung .OLD, und vorhandene .OLD-Dateien werden gelöscht." + IDS_ACTION_INSTALLFILE "Datei %2 wird auf Server %1 installiert" + IDS_ACTION_UNINSTALLFILE "Datei %2 wird von Server %1 deinstalliert" + IDS_ACTION_PRUNEFILES "Dateien werden von Server %1 entfernt" + IDS_FILTER_ALLFILES "Alle Dateien|*.*|" + IDS_ACTION_RENAMEFILESET "Volume %1 wird in %2 umbenannt" + IDS_RECUR_DAILY "jeden Tag" + IDS_RECUR_SUNDAY "jeden Sonntag" + IDS_RECUR_MONDAY "jeden Montag" + IDS_RECUR_TUESDAY "jeden Dienstag" + IDS_RECUR_WEDNESDAY "jeden Mittwoch" + IDS_RECUR_THURSDAY "jeden Donnerstag" + IDS_RECUR_FRIDAY "jeden Freitag" + IDS_RECUR_SATURDAY "jeden Samstag" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATESERVICE "Service %2 wird auf Server %1 erstellt" + IDS_ACTION_DELETESERVICE "Service %2 wird von Server %1 gelöscht" + IDS_ACTION_RELEASEFILESET "Volume %3 wird freigegeben" + IDS_ACTION_GETDATES "Datumsangaben werden für Datei %2 auf Server %1 abgerufen" + IDS_LASTMODIFIED "Letzte Änderung %1" + IDS_SVR_SECURITY_TITLE "Server-Sicherheit - %1" + IDS_SVR_LIST_TAB "Administratoren" + IDS_ACTION_ADMINLIST_LOAD "Administratoren werden für Server %1 abgerufen" + IDS_ACTION_ADMINLIST_SAVE + "Administratoren werden für Server %1 geschrieben" + IDS_ADMCOL_PRINCIPAL "Mitglied" + IDS_ADMCOL_TYPE "Typ" + IDS_ADMCOL_TYPE_GROUP "Gruppe" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_RESTORE "Volume %1 wird wiederhergestellt" + IDS_COL_AGGS_RESTORE "Beim Wiederherstellen eines Volumes erfolgt eine Partitionierung" + IDS_RESTORE_FILTER "Volume-Speicherauszugsdateien|*.DMP|Alle Dateien|*.*|" + IDS_SVC_BOS_TAB "BOS" + IDS_ACTION_SETRESTART "Neustartzeiten der Services werden für Server %1 geändert" + IDS_RESTORE_CREATESET "Volume %1 wird auf dem Server und der Partition erstellt, die von Ihnen unten angegeben werden." + IDS_RESTORE_OVERWRITESET + "Achtung! Volume %3 ist auf Partition %2 von Server %1 vorhanden und wird überschrieben, wenn Sie fortfahren!" + IDS_SUBSET_TITLE_LOAD "Server-Untergruppe öffnen" + IDS_SUBSET_TITLE_SAVE "Server-Untergruppe speichern" + IDS_BUTTON_OPEN "Ö&ffnen" + IDS_BUTTON_SAVE "&Speichern" + IDS_SUBSET_SAVE_TITLE "Achtung" + IDS_SUBSET_SAVE_DESC "Es ist bereits eine Server-Untergruppe mit Namen %1 vorhanden.\n\nMöchten Sie diese Untergruppe überschreiben?" + IDS_SUBSET_CHANGED "%1 [GEÄNDERT]" + IDS_SUBSET_TAB "Überwachte Server" + IDS_SUBSET_DISCARD_TITLE "Untergruppen speichern?" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SUBSET_DISCARD_DESC "Sie haben die Liste momentan überwachter Server nicht als Untergruppe gespeichert. Wenn Sie diese Liste speichern, können Sie sie später verwenden, um mit der Überwachung derselben Server-Gruppe fortzufahren.\n\n+" + IDS_SUBSET_DISCARD_DESC2 + "Möchten Sie eine Untergruppe erstellen, die die Liste der momentan überwachten Server enthält?" + IDS_SUBSET_NONAME "(Nicht benannt)" + IDS_SUBSET_NOSUBSET "(Alle Server werden überwacht)" + IDS_SUBSET_SERVERSUBSET "Server %1" + IDS_FILESET_SOME "Volumes aller überwachten Server in Zelle %1:" + IDS_AGGREGATE_SOME "Partitionen aller überwachten Server in Zelle %1:" + IDS_SERVICE_SOME "Services aller überwachten Server in Zelle %1:" + IDS_FILESET_UNMON "Server %1 wird nicht überwacht" + IDS_AGGREGATE_UNMON "Server %1 wird nicht überwacht" + IDS_SERVICE_UNMON "Server %1 wird nicht überwacht" + IDS_SUBSET_DELETE_TITLE "Untergruppe löschen?" + IDS_SUBSET_DELETE_DESC "Sind Sie sicher, daß Sie die Server-Untergruppe %1 löschen möchten?" + IDS_ERROR_TRANSLATED "Fehlernummer 0x%1 (%2):\n\n%3" + IDS_ERROR_NOTTRANSLATED "Fehlernummer 0x%1 (%2) wurde nicht erkannt." + IDS_FIND_NOTHING_TITLE "Kein Befehl ausgewählt" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FIND_NOTHING_DESC "Um festzustellen, wie eine Operation durchgeführt wird, wählen Sie zunächst eine Befehlszeile aus der Liste aus, oder geben Sie ein Schlüsselwort ein." + IDS_FIND_UNKNOWN_TITLE "Unbekannter Befehl" + IDS_FIND_UNKNOWN_DESC "Der AFS Server Manager konnte für den Befehl ""%1"" keine Hilfethemen finden." + IDS_HELPABOUT_DESC1 "Achtung: Dieses Computerprogramm ist durch Copyright und internationale Verträge geschützt. +" + IDS_HELPABOUT_DESC2 "Nicht autorisierte Vervielfältigung oder Verteilung dieser Lizenzsoftware oder Teilen davon wird strafrechtlich verfolgt.\n\n+" + IDS_HELPABOUT_DESC3 "AFS ist eine Marke von Transarc Corporation, einer Firma von IBM." + IDS_CANT_QUIT_TITLE "AFS Server Manager" + IDS_CANT_QUIT_REBOOT "Achtung!\n\nDer AFS Server Manager führt momentan eine oder mehrere Operationen durch. Wenn Sie Windows jetzt herunterfahren, können diese Operationen nicht erfolgreich abgeschlossen werden.\n\nSind Sie sicher, daß Sie Windows neu starten möchten?" + IDS_APP_TITLE "AFS Server Manager" + IDS_ACTION_OPENCELL "In Zelle %1 wird nach Servern gesucht" + IDS_OPTIONS_TITLE "Optionen - AFS Server Manager" + IDS_OPTIONS_GENERAL_TAB "Allgemein" + IDS_BADCREDS_DESC "Wenn Sie nicht als Administrator angemeldet sind, besitzen Sie keine ausreichenden Berechtigungen, die Zelle %1 zu verwalten. Nicht ausreichende Berechtigungen können dazu führen, daß der AFS Server Manager Probleme in einer Zelle entdeckt, in der keine Probleme existieren." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CONFIRMATION_TITLE "Bestätigung - AFS Server Manager" + IDS_NO_GROUP_CHECKBOX "Keine Eignergruppe" + IDS_AFS_ID_DIDEXP "%1 (Token abgelaufen %2)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_QUERYING "(Abfragen)" + IDS_ADMCOL_TYPE_FOREIGN_GROUP "Fremdgruppe" + IDS_ADMCOL_TYPE_FOREIGN_USER "Fremdbenutzer" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_NOTIFIER "Benachrichtigung" + IDS_SVC_NONOTIFIER "(keine)" + IDS_SVR_KEY_TAB "Server-Schlüssel" + IDS_KEYNAME_NOTIME "Schlüssel für Server %1:" + IDS_KEYNAME_WITHTIME "Schlüssel für Server %1 (geändert %2):" + IDS_SVRKEY_VERSION "Version" + IDS_SVRKEY_DATA "Wert" + IDS_SVRKEY_CHECKSUM "Kontrollsumme" + IDS_SVRKEY_DATA_UNKNOWN "(verdeckt)" + IDS_STARTSERVICE_TITLE "Service starten" + IDS_STOPSERVICE_TITLE "Service stoppen" + IDS_STARTSERVICE_TEXT "Klicken Sie auf OK, um Service %2 auf Server %1 zu starten." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_STOPSERVICE_TEXT "Klicken Sie auf OK, um Service %2 auf Server %1 zu stoppen." + IDS_STARTSERVICE_STARTUP + "Sie können diese Änderung permanent machen, damit Service %2 automatisch gestartet wird, wenn Server %1 erneut gestartet wird." + IDS_STOPSERVICE_STARTUP "Sie können diese Änderung permanent machen, damit Service %2 nicht automatisch gestartet wird, wenn Server %1 erneut gestartet wird." + IDS_STARTSERVICE_PERMANENT + "&Permanent (Service %2 starten, wenn Server %1 neu gestartet wird)" + IDS_STARTSERVICE_TEMPORARY + "&Temporär (Service %2 nicht starten, wenn Server %1 neu gestartet wird)" + IDS_STOPSERVICE_PERMANENT + "&Permanent (Service %2 nicht starten, wenn Server %1 neu gestartet wird)" + IDS_STOPSERVICE_TEMPORARY + "&Temporär (Service %2 starten, wenn Server %1 neu gestartet wird)" + IDS_ACTION_EXECUTE "%2 wird auf Server %1 ausgeführt" + IDS_ACTION_SALVAGE_SVR "Alle Volumes auf Server %1 werden wiederhergestellt" + IDS_ACTION_SALVAGE_AGG "Alle Volumes auf Partition %1:2 werden wiederhergestellt" + IDS_ACTION_SALVAGE_VOL "Volume %3 wird auf Partition %1:2 wiederhergestellt" + IDS_SALVAGE_SVR "Alle Volumes auf Server %1 wiederherstellen" + IDS_SALVAGE_AGG "Alle Volumes auf Server %1, Partition %2 wiederherstellen" + IDS_SALVAGE_SET "Volume %3 auf Server %1, Partition %2 wiederherstellen" + IDS_SETSTATUS_SALVAGE "Volume wird wiederhergestellt" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETSTATUS_LOCKED "Volume ist gesperrt" + IDS_SETSTATUS_NO_VOL "Volume fehlt" + IDS_SETSTATUS_BUSY "Volume ist momentan ausgelastet" + IDS_SETSTATUS_MOVED "Volume wurde verschoben" + IDS_SVR_CAPACITY "%1" + IDS_SVR_ALLOCATION "%1 (%2%%)" + IDS_SVRCOL_ADDRESS "Adresse" + IDS_HOST_TITLE "Vom Server %1 erkannte Datenbank-Host-Server:" + IDS_SVR_HOSTS_TITLE "Server %1 - Datenbank-Hosts" + IDS_SVR_HOST_TAB "Datenbank-Hosts" + IDS_ACTION_HOSTLIST_LOAD "Host-Liste wird von Server %1 abgerufen" + IDS_ACTION_HOSTLIST_SAVE "Host-Liste wird auf Server %1 geschrieben" + IDS_SETSTATUS_1ALERT "Volume weist ein Problem auf" + IDS_SETSTATUS_2ALERT "Volume weist %1 Probleme auf" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CHANGEADDR "IP-Adresse wird für Server %1 geändert" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_ADDSITE "vos addsite" + IDS_COMMAND_VOS_BACKUP "vos backup" + IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" + IDS_COMMAND_VOS_CREATE "vos create" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_DELENTRY "vos delentry" + IDS_COMMAND_VOS_DUMP "vos dump" + IDS_COMMAND_VOS_EXAMINE "vos examine" + IDS_COMMAND_VOS_LISTPART "vos listpart" + IDS_COMMAND_VOS_LISTVLDB "vos listvldb" + IDS_COMMAND_VOS_LISTVOL "vos listvol" + IDS_COMMAND_VOS_LOCK "vos lock" + IDS_COMMAND_VOS_MOVE "vos move" + IDS_COMMAND_VOS_PARTINFO "vos partinfo" + IDS_COMMAND_VOS_RELEASE "vos release" + IDS_COMMAND_VOS_REMOVE "vos remove" + IDS_COMMAND_VOS_REMSITE "vos remsite" + IDS_COMMAND_VOS_RENAME "vos rename" + IDS_COMMAND_VOS_RESTORE "vos restore" + IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" + IDS_COMMAND_VOS_UNLOCK "vos unlock" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" + IDS_COMMAND_VOS_ZAP "vos zap" + IDS_COMMAND_BOS_ADDHOST "bos addhost" + IDS_COMMAND_BOS_ADDKEY "bos addkey" + IDS_COMMAND_BOS_ADDUSER "bos adduser" + IDS_COMMAND_BOS_CREATE "bos create" + IDS_COMMAND_BOS_DELETE "bos delete" + IDS_COMMAND_BOS_EXEC "bos exec" + IDS_COMMAND_BOS_GETDATE "bos getdate" + IDS_COMMAND_BOS_GETLOG "bos getlog" + IDS_COMMAND_BOS_GETRESTART "bos getrestart" + IDS_COMMAND_BOS_INSTALL "bos install" + IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" + IDS_COMMAND_BOS_LISTKEYS "bos listkeys" + IDS_COMMAND_BOS_LISTUSERS "bos listusers" + IDS_COMMAND_BOS_PRUNE "bos prune" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_BOS_REMOVEHOST "bos removehost" + IDS_COMMAND_BOS_REMOVEKEY "bos removekey" + IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" + IDS_COMMAND_BOS_RESTART "bos restart" + IDS_COMMAND_BOS_SALVAGE "bos salvage" + IDS_COMMAND_BOS_SETAUTH "bos setauth" + IDS_COMMAND_BOS_SETRESTART "bos setrestart" + IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" + IDS_COMMAND_BOS_START "bos start" + IDS_COMMAND_BOS_STARTUP "bos startup" + IDS_COMMAND_BOS_STATUS "bos status" + IDS_COMMAND_BOS_STOP "bos stop" + IDS_COMMAND_BOS_UNINSTALL "bos uninstall" + IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" + IDS_COMMAND_FS_LISTQUOTA "fs listquota" + IDS_COMMAND_FS_QUOTA "fs quota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_FS_SETQUOTA "fs setquota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCSHORT_UNMONITORED + "Server %1 wird nicht auf Probleme hin überwacht" + IDS_ALERT_DESCSHORT_TIMEOUT + "Kontakt zu Server %1 konnte nicht hergestellt werden; letzter Fehler: %3" + IDS_ALERT_DESCSHORT_AGG_FULL + "Die Partitionsbelegung für %2 überschreitet den Warnschwellenwert von %3%% (%4)" + IDS_ALERT_DESCSHORT_SET_FULL + "Die Volume-Belegung für %3 überschreitet den Warnschwellenwert von %4%% (%5)" + IDS_ALERT_DESCSHORT_NO_VLDBENT + "Volume %3 verfügt über keinen VLDB-Eintrag" + IDS_ALERT_DESCSHORT_NO_SVRENT_SET + "Volume %3 besitzt einen VLDB-Eintrag, konnte aber nicht auf Partition %2 des Servers %1 gefunden werden" + IDS_ALERT_DESCSHORT_STOPPED "Service %2 um %3 gestoppt" + IDS_ALERT_DESCSHORT_NO_SVRENT_AGG + "Verweis auf Partition %2 von VLDB; diese konnte aber auf Server %1 nicht gefunden werden" + IDS_ALERT_DESCSHORT_BADCREDS + "Sie verfügen möglicherweise nicht über ausreichende Berechtigungen, um Server %1 zu verwalten" + IDS_ALERT_DESCSHORT_AGG_ALLOC + "Die kombinierte Volume-Quote auf Partition %2 überschreitet ihre Kapazität" + IDS_ALERT_DESCSHORT_STATE_NO_VNODE + "Das Volume %3 ist beschädigt und kann nicht verwendet werden." + IDS_ALERT_DESCSHORT_STATE_NO_SERVICE + "Es ist kein Service aktiv, um Volume %3 zu dienen." + IDS_ALERT_DESCSHORT_STATE_OFFLINE + "Volume %3 ist offline und kann nicht verwendet werden." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_TIMEOUT + "Der Kontakt konnte zu Server %1 nicht hergestellt werden. Der letzte Versuch, der um %2 durchgeführt wurde, hat den Fehler ""%3"" ergeben." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_AGG_FULL + "Die Belegung von Partition %2 auf Server %1 überschreitet ihren Warnschwellenwert von %3%% (%4)." + IDS_ALERT_DESCFULL_SET_FULL + "Die Belegung von Volume %3 (Server %1, Partition %2) überschreitet dessen Warnschwellenwert von %4%% (%5)." + IDS_ALERT_DESCFULL_NO_VLDBENT + "Volume %3 ist auf Partition %2 des Servers %1 vorhanden, verfügt aber über keinen entsprechenden VLDB-Eintrag." + IDS_ALERT_DESCFULL_NO_SVRENT_SET + "Für Volume %3 ist ein VLDB-Eintrag vorhanden, das Volume konnte aber auf Partition %2 des Servers %1 nicht gefunden werden." + IDS_ALERT_DESCFULL_STOPPED + "Der Service %2 des Servers %1 wurde um %3 mit Exit-Code %5 gestoppt." + IDS_ALERT_DESCFULL_NO_SVRENT_AGG + "Die VLDB verweist auf Volumes der Partition %2 des Servers %1, die Partition konnte jedoch nicht gefunden werden." + IDS_ALERT_DESCFULL_BADCREDS + "Der AFS Server Manager kann möglicherweise Fehler entdecken, die auf Server %1 nicht existieren, da Sie nicht über AFS-Token als Administrator in dieser Zelle verfügen." + IDS_ALERT_DESCFULL_AGG_ALLOC + "Die kombinierte Quote von Volumes auf Partition %2 des Servers %1, die zusammen %4 ergibt, überschreitet die Kapazität der Partition von %3." + IDS_ALERT_DESCFULL_STATE_NO_VNODE + "Das Volume %3 auf Partition %2 des Servers %1 verfügt über keinen zugeordneten Vnode. (Volume-Status ist 0x%4.)" + IDS_ALERT_DESCFULL_STATE_NO_SERVICE + "Auf Server %1 ist kein Dateiexportservice aktiv, daher kann Volume %3 auf Partition %2 nicht verwendet werden. (Volume-Status ist 0x%4.)" + IDS_ALERT_DESCFULL_STATE_OFFLINE + "Das Volume %3 auf Partition %2 des Servers %1 ist offline und kann nicht verwendet werden. (Volume-Status ist 0x%4.)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_TIMEOUT "Klicken Sie auf Erneut versuchen, um erneut zu versuchen, den Kontakt zu diesem Server herzustellen." + IDS_ALERT_FIX_AGG_FULL "Klicken Sie auf Warnungen, um den Warnschwellenwert für die Belegung dieser Partition zu ändern." + IDS_ALERT_FIX_SET_FULL "Klicken Sie auf Warnungen, um den Warnschwellenwert für die Belegung dieses Volumes zu ändern." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_NO_VLDBENT + "Die VLDB ist möglicherweise nicht auf dem neuesten Stand; in diesem Fall verwenden Sie den Befehl VLDB synchronisieren, um diese zu aktualisieren." + IDS_ALERT_FIX_NO_SVRENT_SET + "Prüfen Sie den Server und die Partition, um sicherzustellen, daß diese einwandfrei funktionieren." + IDS_ALERT_FIX_STOPPED "Klicken Sie auf Protokoll anzeigen, um das Service-Protokoll für diesen Service anzuzeigen." + IDS_ALERT_FIX_NO_SVRENT_AGG + "Prüfen Sie den Server, um sicherzustellen, daß die Partition exportiert wurde und einwandfrei funktioniert." + IDS_ALERT_FIX_BADCREDS "Klicken Sie auf Authentifizierung, um neue AFS-Token zu erhalten." + IDS_ALERT_FIX_AGG_ALLOC "Verkleinern Sie die Quote für Volumes auf dieser Partition, oder verschieben Sie ein oder mehrere Volumes auf eine andere Partition." + IDS_ALERT_FIX_STATE_NO_VNODE " " + IDS_ALERT_FIX_STATE_NO_SERVICE " " + IDS_ALERT_FIX_STATE_OFFLINE " " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_BUTTON_TRYAGAIN "Erneut &versuchen" + IDS_ALERT_BUTTON_WARNINGS "&Warnungen..." + IDS_ALERT_BUTTON_VIEWLOG "Protokoll &anzeigen" + IDS_ALERT_BUTTON_SHOWME "A&nzeigen" + IDS_ALERT_BUTTON_GETCREDS "Au&thentifizierung" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_CELLSERVERS_NOCELL + "Es wurde keine Zelle angegeben. Sie müssen die AFS-Zelle angeben, mit der Sie arbeiten möchten, um den AFS Server Manager zu verwenden. Wählen Sie eine Zelle aus, indem Sie das Menüelement ""Öffnen..."" im Menü ""Zelle"" auswählen." + IDS_ERROR_REFRESH_CELLSERVERS + "Die Liste der Server konnte für die Zelle %1 nicht abgerufen werden.\n\nFehler: %2" + IDS_ERROR_CANT_OPEN_CELL + "Der AFS Server Manager konnte keine Server in der Zelle %1 erreichen.\n\nBitte überprüfen Sie, ob der Name der Zelle richtig eingegeben wurde." + IDS_ERROR_REFRESH_AGGREGATES + "Die Liste der Partitionen konnte für Server %1 nicht abgerufen werden.\n\nFehler: %2" + IDS_ERROR_REFRESH_SERVER_STATUS + "Der aktuelle Status von Server %1 konnte nicht abgerufen werden." + IDS_ERROR_CHANGE_SERVER_STATUS + "Der AFS Server Manager konnte die Merkmale für Server %1 nicht ändern." + IDS_ERROR_REFRESH_AGGREGATE_STATUS + "Der aktuelle Status von Partition %2 auf Server %1 konnte nicht abgerufen werden." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_FILESET_STATUS + "Der aktuelle Status von Volume %3 (Server %1, Partition %2) konnte nicht abgerufen werden." + IDS_ERROR_REFRESH_SERVICE_STATUS + "Der aktuelle Status von Service %2 auf Server %1 konnte nicht ermittelt werden." + IDS_ERROR_MOVE_FILESET "Der AFS Server Manager konnte Volume %3 nicht von Partition %2 des Servers %1 zu Partition %5 auf Server %4 verschieben." + IDS_ERROR_VIEW_LOGFILE "Die Datei %2 konnte von Server %1 nicht gelesen werden.\n\nPrüfen Sie, ob der Name der Datei richtig eingegeben wurde, und ob Sie über ausreichende Berechtigungen verfügen, um die Datei anzuzeigen." + IDS_ERROR_NOT_REPLICATED + "Der Nachbildungsstatus von Volume %1 konnte nicht ermittelt werden." + IDS_ERROR_CANT_CREATE_FILESET + "Der AFS Server Manager konnte Volume %3 auf Partition %2 des Servers %1 nicht erstellen." + IDS_ERROR_CANT_DELETE_FILESET + "Der AFS Server Manager konnte Volume %3 (Partition %2 von Server %1) nicht löschen." + IDS_ERROR_CANT_CREATE_VLDB_ENTRY + "Der AFS Server Manager konnte keinen VLDB-Eintrag für Volume %3 auf Partition %2 des Servers %1 erstellen." + IDS_ERROR_CANT_SET_FILESET_QUOTA + "Der AFS Server Manager konnte die Quote für Volume %3 auf Partition %2 des Servers %1 nicht ändern." + IDS_ERROR_CANT_CREATE_SERVER + "Der AFS Server Manager konnte den angeforderten Server-Eintrag in Zelle %1 nicht erstellen." + IDS_ERROR_CANT_PING_SERVER + "Der AFS Server Manager konnte die IP-Adresse von Server %1 nicht ermitteln." + IDS_ERROR_CANT_DELETE_SERVER + "Der AFS Server Manager konnte Server %1 nicht löschen." + IDS_ERROR_CANT_DELETE_SERVER_FILESETS + "Server %1 konnte nicht gelöscht werden, da er weiterhin ein oder mehrere Volumes enthält. Ein Server kann nur gelöscht werden, wenn er keine Volumes enthält." + IDS_ERROR_CHANGE_AGGREGATE_STATUS + "Der AFS Server Manager konnte die Merkmale für Partition %2 auf Server %1 nicht ändern." + IDS_ERROR_CHANGE_SERVICE_STATUS + "Der AFS Server Manager konnte die Merkmale für Service %2 auf Server %1 nicht ändern." + IDS_ERROR_CANT_START_SERVICE + "Der AFS Server Manager konnte Service %2 auf Server %1 nicht starten." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_STOP_SERVICE + "Der AFS Server Manager konnte Service %2 auf Server %1 nicht stoppen." + IDS_ERROR_CANT_RESTART_SERVICE + "Der AFS Server Manager konnte Service %2 auf Server %1 nicht stoppen und erneut starten." + IDS_ERROR_CHANGE_REPLICA_STATUS + "Der AFS Server Manager konnte die Nachbildungsmerkmale für Volume %3 auf Partition %2 des Servers %1 nicht ändern." + IDS_ERROR_CANT_SYNCVLDB "Der AFS Server Manager konnte die VLDB nicht aktualisieren." + IDS_ERROR_CANT_CREATE_REPLICA + "Der AFS Server Manager konnte kein Replikat von Volume %3 auf Partition %2 des Servers %1 erstellen." + IDS_ERROR_CANT_INSTALL_FILE + "Der AFS Server Manager konnte die Datei %2 auf Server %1 nicht installieren." + IDS_ERROR_CANT_UNINSTALL_FILE + "Der AFS Server Manager konnte die Datei %2 von Server %1 nicht deinstallieren." + IDS_ERROR_CANT_PRUNE_FILES + "Der AFS Server Manager konnte die angeforderten Dateien nicht von Server %1 entfernen." + IDS_ERROR_CANT_RENAME_FILESET + "Der AFS Server Manager konnte Volume %1 nicht in ""%2"" umbenennen." + IDS_ERROR_CANT_CREATE_SERVICE + "Der AFS Server Manager konnte Service %2 nicht auf Server %1 erstellen." + IDS_ERROR_CANT_DELETE_SERVICE + "Der AFS Server Manager konnte Service %2 nicht von Server %1 löschen." + IDS_ERROR_CANT_RELEASE_FILESET + "Der AFS Server Manager konnte das nachgebildete Volume %3 nicht freigeben." + IDS_ERROR_CANT_UPDATE_FILESET + "Der AFS Server Manager konnte das Volume-Replikat %3 auf Partition %1 des Servers %2 nicht aktualisieren." + IDS_ERROR_CANT_UPDATE_ALL + "Der AFS Server Manager konnte Replikate von Volume %3 nicht aktualisieren." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_LOAD_ADMLIST + "Der AFS Server Manager konnte die Liste der Administratoren für Server %1 nicht lesen." + IDS_ERROR_CANT_LOAD_KEYLIST + "Der AFS Server Manager konnte die Liste der Server-Schlüssel für Server %1 nicht lesen." + IDS_ERROR_CANT_CREATE_KEY + "Der AFS Server Manager konnte keinen neuen Server-Schlüssel für Server %1 erstellen." + IDS_ERROR_CANT_SAVE_ADMLIST + "Der AFS Server Manager konnte die Liste der Administratoren für Server %1 nicht ändern." + IDS_ERROR_CANT_CLONE "Der AFS Server Manager konnte keine Sicherungskopie von Volume %3 auf Partition %2 des Servers %1 erstellen." + IDS_ERROR_CANT_CLONESYS "Der AFS Server Manager konnte keine der angeforderten Sicherungs-Volumes erstellen." + IDS_ERROR_CANT_DUMP_FILESET + "Der AFS Server Manager konnte keinen Speicherauszug von Volume %3 (Server %1, Partition %2) in Datei %4 erstellen." + IDS_ERROR_CANT_RESTORE_FILESET + "Der AFS Server Manager konnte Datei %4 auf Volume %3 (Server %1, Partition %2) nicht wiederherstellen." + IDS_ERROR_CANT_SET_RESTART_TIMES + "Der AFS Server Manager konnte die Neustartzeiten für Services auf Server %1 nicht ändern." + IDS_ERROR_CANT_DELETE_REPLICATED_FILESET + "Der AFS Server Manager konnte Volume %3 von Partition %2 des Servers %1 nicht löschen.\n\nVolume %3 kann nicht gelöscht werden, bevor alle Replikate gelöscht wurden." + IDS_CMDLINE_TITLE "Fehler - AFS Server Manager" + IDS_CMDLINE_SYNTAX "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig." + IDS_CMDLINE_UNRECOGNIZED + "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nParameter ""%1"" wurde nicht erkannt." + IDS_CMDLINE_DUPLICATE "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nDer Parameter ""%1"" wurde mehrmals angegeben." + IDS_CMDLINE_UNEXPECTVALUE + "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nDem Parameter ""%1"" darf kein Wert zugewiesen werden." + IDS_CMDLINE_MISSINGVAL "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nDem Parameter ""%1"" muß ein Wert folgen." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CMDLINE_SUBSETNOTCELL + "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nDer Parameter ""/SUBSET"" kann nur zusammen mit dem Parameter ""/CELL"" angegeben werden." + IDS_CMDLINE_INVALIDSUBSET + "Die von Ihnen angegebene Server-Untergruppe, ""%2"", wurde nicht für die Zelle %1 definiert." + IDS_CMDLINE_SERVERNOTCELL + "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nDer Parameter ""/SERVER"" kann nur zusammen mit dem Parameter ""/CELL"" angegeben werden." + IDS_CMDLINE_RESET_TITLE "AFS Server Manager" + IDS_CMDLINE_RESET_DESC "Der AFS Server Manager hat die angegebenen Einstellungen gelöscht." + IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE + "Der AFS Server Manager konnte die VLDB nicht mit Partition %2 von Server %1 synchronisieren, da die Partition entweder nicht vorhanden ist oder nicht exportiert wurde.\n\nWenn Sie diese Partition vom Server %1 entfernen möchten, müssen Sie die VLDB-Einträge der Volumes löschen, die darauf verweisen." + IDS_CMDLINE_USERPASSWORD + "Die von Ihnen für den AFS Server Manager angegebene Befehlszeile ist ungültig.\n\nUm neue AFS-Token zu erhalten, müssen die Parameter ""/USER"" und ""/PASSWORD"" angegeben werden." + IDS_ERROR_CANT_DELETE_KEY + "Der AFS Server Manager konnte Server-Schlüssel %2 nicht von Server %1 löschen." + IDS_ERROR_CANT_GETRANDOMKEY + "Der AFS Server Manager konnte keinen wahlfreien Schlüssel für Server %1 erstellen." + IDS_ERROR_CANT_EXECUTE_COMMAND + "Der AFS Server Manager konnte den folgenden Befehl nicht auf Server %1 ausführen:\n\n ""%2""" + IDS_ERROR_CANT_READ_SALVAGE_LOG + "Der AFS Server Manager hat die Wiederherstellung erfolgreich abgeschlossen, konnte jedoch die Protokolldatei nicht abrufen, die die einzelnen Ergebnisse der Wiederherstellung beschreibt." + IDS_ERROR_CANT_SALVAGE "Der AFS Server Manager konnte die angeforderte Wiederherstellung nicht durchführen." + IDS_ERROR_CANT_AUTH_ON "Der AFS Server Manager konnte die Überprüfung der Authentifizierung für Server %1 nicht aktivieren." + IDS_ERROR_CANT_AUTH_OFF "Der AFS Server Manager konnte die Überprüfung der Authentifizierung für Server %1 nicht inaktivieren." + IDS_ERROR_CANT_LOAD_HOSTLIST + "Der AFS Server Manager konnte die Liste der Datenbank-Host-Server nicht von Server %1 lesen." + IDS_ERROR_CANT_SAVE_HOSTLIST + "Der AFS Server Manager konnte die Liste der Datenbank-Host-Server auf Server %1 nicht ändern." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL + "Der AFS Server Manager konnte nicht gestartet werden, da das AFS Control Center nicht ordnungsgemäß installiert wurde.\n\nSie müssen das AFS Control Center möglicherweise erneut installieren." + IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN + "Der AFS Server Manager konnte aufgrund eines unbekannten Problems nicht gestartet werden.\n\nSie müssen das AFS Control Center möglicherweise erneut installieren." + IDS_ERROR_CANT_CHANGEADDR + "Der AFS Server Manager konnte die IP-Adresse in der VLDB für Server %1 nicht ändern." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_SERVICE "%1:%2" + IDS_SERVICETYPE_SIMPLE "Einfach" + IDS_SERVICETYPE_CRON "Cron" + IDS_SERVICESTATE_STOPPED "Gestoppt" + IDS_SERVICESTATE_STOPPING "Wird gestoppt" + IDS_SERVICESTATE_STARTING "Wird gestartet" + IDS_SERVICESTATE_RUNNING "Aktiv" + IDS_SERVICETYPE_FS_LONG "FS (Dateisystem)" + IDS_SERVICETYPE_FS "FS" + IDS_SERVICE_LASTERROR "%1" + IDS_SERVICES_IN_CELL "Alle Services in Zelle %1:" + IDS_SERVICE_STARTDATE "%1 wurde gestartet" + IDS_SERVICE_STOPDATE "%1 wurde gestoppt" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afssvrmgr/lang/en_US/svrmgr.rc b/src/WINNT/afssvrmgr/lang/en_US/svrmgr.rc index c6bb6c082..60b509370 100644 --- a/src/WINNT/afssvrmgr/lang/en_US/svrmgr.rc +++ b/src/WINNT/afssvrmgr/lang/en_US/svrmgr.rc @@ -2393,23 +2393,6 @@ BEGIN IDS_COL_AGGS_MOVE "partitions when creating a volume" END -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_SERVICE "%1:%2" - IDS_SERVICETYPE_SIMPLE "Simple" - IDS_SERVICETYPE_CRON "Cron" - IDS_SERVICESTATE_STOPPED "Stopped" - IDS_SERVICESTATE_STOPPING "Stopping" - IDS_SERVICESTATE_STARTING "Starting" - IDS_SERVICESTATE_RUNNING "Running" - IDS_SERVICETYPE_FS_LONG "FS (filesystem)" - IDS_SERVICETYPE_FS "FS" - IDS_SERVICE_LASTERROR "%1" - IDS_SERVICES_IN_CELL "All services in cell %1:" - IDS_SERVICE_STARTDATE "Started %1" - IDS_SERVICE_STOPDATE "Stopped %1" -END - STRINGTABLE DISCARDABLE BEGIN IDS_PERCENTAGE "%1 %%" @@ -2459,11 +2442,11 @@ END STRINGTABLE DISCARDABLE BEGIN - IDS_ERROR_BAD_CREDENTIALS + IDS_SVR_ERROR_BAD_CREDENTIALS "The AFS identity you have entered is unrecognized, or the password you have specified is incorrect." - IDS_CREDS_NONE "(no tokens)" - IDS_CREDS_VALID "%2, expires %3" - IDS_CREDS_EXPIRED "(tokens expired %3)" + IDS_SVR_CREDS_NONE "(no tokens)" + IDS_SVR_CREDS_VALID "%2, expires %3" + IDS_SVR_CREDS_EXPIRED "(tokens expired %3)" END STRINGTABLE DISCARDABLE @@ -2987,6 +2970,23 @@ BEGIN "The AFS Server Manager was unable to change the IP address in VLDB for server %1." END +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_SERVICE "%1:%2" + IDS_SERVICETYPE_SIMPLE "Simple" + IDS_SERVICETYPE_CRON "Cron" + IDS_SERVICESTATE_STOPPED "Stopped" + IDS_SERVICESTATE_STOPPING "Stopping" + IDS_SERVICESTATE_STARTING "Starting" + IDS_SERVICESTATE_RUNNING "Running" + IDS_SERVICETYPE_FS_LONG "FS (filesystem)" + IDS_SERVICETYPE_FS "FS" + IDS_SERVICE_LASTERROR "%1" + IDS_SERVICES_IN_CELL "All services in cell %1:" + IDS_SERVICE_STARTDATE "Started %1" + IDS_SERVICE_STOPDATE "Stopped %1" +END + #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/WINNT/afssvrmgr/lang/es_ES/svrmgr.rc b/src/WINNT/afssvrmgr/lang/es_ES/svrmgr.rc index 0412efade..75d5e7378 100644 --- a/src/WINNT/afssvrmgr/lang/es_ES/svrmgr.rc +++ b/src/WINNT/afssvrmgr/lang/es_ES/svrmgr.rc @@ -7,3054 +7,3054 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "AFS Server Manager" +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "AFS Server Manager" #define AFS_VERINFO_NAME "svrmgr" #define AFS_VERINFO_FILENAME "svrmgr.exe" #define AFS_VERINFO_LANG_CODE 0x40a #define AFS_VERINFO_CHARSET 1252 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_SERVICES, DIALOG - BEGIN - RIGHTMARGIN, 165 - END - - IDD_AGGREGATES, DIALOG - BEGIN - RIGHTMARGIN, 118 - END - - IDD_FILESETS, DIALOG - BEGIN - RIGHTMARGIN, 180 - END - - IDD_SVR_LISTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_AGG_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 301 - TOPMARGIN, 5 - BOTTOMMARGIN, 155 - END - - IDD_SVR_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 183 - END - - IDD_SVR_SCOUT, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 261 - TOPMARGIN, 5 - BOTTOMMARGIN, 153 - END - - IDD_SVC_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 228 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 294 - TOPMARGIN, 5 - BOTTOMMARGIN, 208 - END - - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 315 - TOPMARGIN, 2 - BOTTOMMARGIN, 224 - END - - IDD_SERVER, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 207 - TOPMARGIN, 2 - BOTTOMMARGIN, 135 - END - - IDD_SVC_CREATE, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 237 - TOPMARGIN, 5 - BOTTOMMARGIN, 228 - END - - IDD_SET_REPSITES, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 216 - TOPMARGIN, 5 - BOTTOMMARGIN, 163 - END - - IDD_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 224 - TOPMARGIN, 7 - BOTTOMMARGIN, 254 - HORZGUIDE, 160 - END - - IDD_TIMEOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 232 - TOPMARGIN, 7 - BOTTOMMARGIN, 153 - END - - IDD_COLUMNS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 281 - TOPMARGIN, 5 - BOTTOMMARGIN, 143 - END - - IDD_REFRESHALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 68 - END - - IDD_SET_CREATE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 317 - TOPMARGIN, 4 - BOTTOMMARGIN, 205 - END - - IDD_SET_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 98 - END - - IDD_SET_CLONE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 341 - TOPMARGIN, 7 - BOTTOMMARGIN, 81 - END - - IDD_SVC_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 189 - END - - IDD_SVR_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 152 - END - - IDD_AGG_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 252 - TOPMARGIN, 5 - BOTTOMMARGIN, 146 - END - - IDD_SET_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 268 - TOPMARGIN, 5 - BOTTOMMARGIN, 177 - END - - IDD_SET_MOVETO, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 170 - END - - IDD_SET_MOVING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SVC_LOGNAME, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 307 - TOPMARGIN, 4 - BOTTOMMARGIN, 102 - END - - IDD_SVC_VIEWLOG, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 181 - END - - IDD_SET_SETQUOTA, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 267 - TOPMARGIN, 4 - BOTTOMMARGIN, 126 - END - - IDD_ACTIONS, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 234 - TOPMARGIN, 2 - BOTTOMMARGIN, 56 - END - - IDD_SVR_SYNCVLDB, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 265 - TOPMARGIN, 4 - BOTTOMMARGIN, 95 - END - - IDD_SET_CREATEREP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 167 - END - - IDD_SVR_INSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 260 - TOPMARGIN, 4 - BOTTOMMARGIN, 153 - END - - IDD_SVR_UNINSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 135 - END - - IDD_SVR_PRUNE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 314 - TOPMARGIN, 4 - BOTTOMMARGIN, 129 - END - - IDD_SET_RENAME, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 129 - END - - IDD_SVC_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 64 - END - - IDD_SVR_GETDATES, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_GETDATES_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 128 - END - - IDD_SET_DUMP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 307 - TOPMARGIN, 7 - BOTTOMMARGIN, 139 - END - - IDD_SET_RESTORE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 297 - TOPMARGIN, 4 - BOTTOMMARGIN, 243 - END - - IDD_SVC_BOS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 291 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_DUMPING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SET_RESTORING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SET_CLONESYS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 326 - TOPMARGIN, 7 - BOTTOMMARGIN, 158 - END - - IDD_SUBSETS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 300 - TOPMARGIN, 5 - BOTTOMMARGIN, 178 - END - - IDD_SUBSET_LOADSAVE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 276 - TOPMARGIN, 4 - BOTTOMMARGIN, 141 - END - - IDD_HELP_FIND, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 214 - TOPMARGIN, 4 - BOTTOMMARGIN, 69 - END - - IDD_HELP_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 214 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_HELP_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 226 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_OPENINGCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 236 - TOPMARGIN, 2 - BOTTOMMARGIN, 41 - END - - IDD_OPTIONS_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 368 - TOPMARGIN, 5 - BOTTOMMARGIN, 131 - END - - IDD_SVR_KEYS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_CREATEKEY, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - END - - IDD_SVC_STARTSTOP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 128 - END - - IDD_SVR_EXECUTE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_SALVAGE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 306 - TOPMARGIN, 7 - BOTTOMMARGIN, 251 - END - - IDD_SVR_SALVAGE_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 174 - END - - IDD_SET_RELEASE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 285 - TOPMARGIN, 7 - BOTTOMMARGIN, 99 - END - - IDD_SVR_HOSTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 241 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_ADDHOST, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 221 - TOPMARGIN, 4 - BOTTOMMARGIN, 102 - END - - IDD_SVR_ADDRESS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 204 - TOPMARGIN, 4 - BOTTOMMARGIN, 111 - END - - IDD_SVR_NEWADDR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 219 - TOPMARGIN, 4 - BOTTOMMARGIN, 65 - END -END -#endif // APSTUDIO_INVOKED - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Server Manager""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_MAIN MENU DISCARDABLE -BEGIN - POPUP "&Célula" - BEGIN - MENUITEM "S&eleccionar...", M_CELL_OPEN - MENUITEM "&Autentificación...", M_CREDENTIALS - MENUITEM SEPARATOR - MENUITEM "&Salir", M_EXIT - END - POPUP "&Ver" - BEGIN - POPUP "&Servidores" - BEGIN - MENUITEM "Iconos &grandes", M_SVR_VIEW_LARGE - , CHECKED - MENUITEM "Iconos &pequeños", M_SVR_VIEW_SMALL - , CHECKED - MENUITEM "&Detalles", M_SVR_VIEW_REPORT - , CHECKED - MENUITEM SEPARATOR - MENUITEM "&Normal", M_SVR_VIEW_ONEICON - , CHECKED - MENUITEM "&Todos los iconos", M_SVR_VIEW_TWOICONS - , CHECKED - MENUITEM "Sólo &estado", M_SVR_VIEW_STATUS - , CHECKED - END - POPUP "Panel de &vista rápida" - BEGIN - MENUITEM "&Ninguno", M_DIVIDE_NONE, CHECKED - MENUITEM "Barra de división &vertical", M_DIVIDE_H, CHECKED - MENUITEM "Barra de división &horizontal", M_DIVIDE_V, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "O&peraciones en curso", M_ACTIONS, CHECKED - MENUITEM SEPARATOR - MENUITEM "Servidores s&upervisados...", M_SUBSET - MENUITEM "&Columnas...", M_COLUMNS - MENUITEM "&Opciones...", M_OPTIONS - MENUITEM SEPARATOR - MENUITEM "Ac&tualizar todo", M_REFRESHALL - END - POPUP "A&yuda" - BEGIN - MENUITEM "&Contenido", M_HELP - MENUITEM "Buscar &mandato...", M_HELP_FIND - MENUITEM "Buscar código de &error...", M_HELP_XLATE - MENUITEM SEPARATOR - MENUITEM "&Acerca de AFS Server Manager...", M_ABOUT - END -END - -MENU_AGG MENU DISCARDABLE -BEGIN - MENUITEM "&Crear volumen...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "C&opia de seguridad de volúmenes...", M_SET_CLONE - MENUITEM "&Desbloquear todos los volúmenes", M_SET_UNLOCK - MENUITEM "S&incronizar VLDB...", M_SYNCVLDB - MENUITEM "Recu&perar volúmenes...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "Ac&tualizar", M_REFRESH - MENUITEM "P&ropiedades", M_PROPERTIES -END - -MENU_SVC MENU DISCARDABLE -BEGIN - MENUITEM "&Iniciar", M_SVC_START - MENUITEM "&Detener", M_SVC_STOP - MENUITEM "R&einiciar", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "&Ver archivo de registro", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "Su&primir", M_SVC_DELETE - MENUITEM SEPARATOR - MENUITEM "Ac&tualizar", M_REFRESH - MENUITEM "P&ropiedades", M_PROPERTIES -END - -MENU_AGG_NONE MENU DISCARDABLE -BEGIN - POPUP "&Ver" - BEGIN - MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED - MENUITEM "&Todos los iconos", M_VIEW_TWOICONS, CHECKED - MENUITEM "Sólo &estado", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "&Crear volumen...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "Ac&tualizar todo", M_REFRESHALL -END - -MENU_SVC_NONE MENU DISCARDABLE -BEGIN - POPUP "&Ver" - BEGIN - MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED - MENUITEM "&Todos los iconos", M_VIEW_TWOICONS, CHECKED - MENUITEM "Sólo &estado", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "&Crear servicio...", M_SVC_CREATE - MENUITEM SEPARATOR - MENUITEM "Ac&tualizar todo", M_REFRESHALL -END - -MENU_SET MENU DISCARDABLE -BEGIN - MENUITEM "Du&plicación...", M_SET_REPLICATION - MENUITEM "Li&berar ahora", M_SET_RELEASE - MENUITEM SEPARATOR - MENUITEM "&Copia de seguridad...", M_SET_CLONE - MENUITEM "&Volcar en archivo...", M_SET_DUMP - MENUITEM "Restaurar desde arc&hivo...", M_SET_RESTORE - MENUITEM "Establecer c&uota...", M_SET_SETQUOTA - MENUITEM "R&ecuperar...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "&Mover a...", M_SET_MOVETO - MENUITEM "Cambiar &nombre...", M_SET_RENAME - MENUITEM "&Suprimir", M_SET_DELETE - MENUITEM SEPARATOR - MENUITEM "Blo&quear", M_SET_LOCK - MENUITEM "&Desbloquear", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "Ac&tualizar", M_REFRESH - MENUITEM "P&ropiedades", M_PROPERTIES -END - -MENU_SVR MENU DISCARDABLE -BEGIN - MENUITEM "&Abrir ventana de servidor", M_SVR_OPEN - MENUITEM "&Cerrar ventana de servidor", M_SVR_CLOSE - MENUITEM "&Supervisar este servidor", M_SVR_MONITOR, CHECKED - MENUITEM SEPARATOR - MENUITEM "Editar seguridad de ser&vidor...", M_SVR_SECURITY - MENUITEM "Ad&ministrar sistemas principales de base de datos...", - M_SVR_HOSTS - MENUITEM "C&opia de seguridad de seguridad de volúmenes...", M_SET_CLONE - MENUITEM "Desblo&quear todos los volúmenes", M_SET_UNLOCK - MENUITEM "Sincroni&zar VLDB...", M_SYNCVLDB - MENUITEM "Rec&uperar volúmenes...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "&Instalar archivo...", M_SVR_INSTALL - MENUITEM "&Desinstalar archivo...", M_SVR_UNINSTALL - MENUITEM "&Podar archivos antiguos...", M_SVR_PRUNE - MENUITEM SEPARATOR - MENUITEM "Obtener &fechas de archivo...", M_SVR_GETDATES - MENUITEM "Ver archivo de re&gistro...", M_VIEWLOG - MENUITEM "E&jecutar mandato...", M_EXECUTE - MENUITEM SEPARATOR - MENUITEM "Ac&tualizar", M_REFRESH - MENUITEM "P&ropiedades", M_PROPERTIES -END - -MENU_SVR_NONE MENU DISCARDABLE -BEGIN - POPUP "&Ver" - BEGIN - MENUITEM "Iconos &grandes", M_SVR_VIEW_LARGE, CHECKED - MENUITEM "Iconos &pequeños", M_SVR_VIEW_SMALL, CHECKED - MENUITEM "&Detalles", M_SVR_VIEW_REPORT, CHECKED - MENUITEM SEPARATOR - MENUITEM "&Normal", M_SVR_VIEW_ONEICON, CHECKED - MENUITEM "&Todos los iconos", M_SVR_VIEW_TWOICONS, CHECKED - MENUITEM "Sólo &estado", M_SVR_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "Servidores &supervisados...", M_SUBSET - MENUITEM SEPARATOR - MENUITEM "&Desbloquear todos los volúmenes", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "&Cerrar todo", M_SVR_CLOSEALL - MENUITEM "Ac&tualizar todo", M_REFRESHALL -END - -MENU_SET_NONE MENU DISCARDABLE -BEGIN - POPUP "&Ver" - BEGIN - MENUITEM "Por &volumen", M_SET_VIEW_REPORT, CHECKED - MENUITEM "Por &partición", M_SET_VIEW_TREELIST, CHECKED - MENUITEM "Sin &detalles", M_SET_VIEW_TREE, CHECKED - MENUITEM SEPARATOR - MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED - MENUITEM "&Todos los iconos", M_VIEW_TWOICONS, CHECKED - MENUITEM "Sólo &estado", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "&Crear volumen...", M_SET_CREATE - MENUITEM "&Restaurar desde archivo...", M_SET_RESTORE - MENUITEM SEPARATOR - MENUITEM "C&opia de seguridad de volúmenes,...", M_SET_CLONE - MENUITEM SEPARATOR - MENUITEM "&Desbloquear todo", M_SET_UNLOCK - MENUITEM "Ac&tualizar todo", M_REFRESHALL -END - -MENU_COLUMNS MENU DISCARDABLE -BEGIN - MENUITEM "&Columnas...", M_COLUMNS -END - -MENU_SVC_BOS MENU DISCARDABLE -BEGIN - MENUITEM "R&einiciar", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "&Ver archivo de registro", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "Ac&tualizar", M_REFRESH - MENUITEM "P&ropiedades", M_PROPERTIES -END - -MENU_SET_DRAGDROP MENU DISCARDABLE -BEGIN - MENUITEM "&Mover aquí...", M_SET_MOVEHERE - MENUITEM "&Duplicar aquí...", M_SET_REPHERE - MENUITEM SEPARATOR - MENUITEM "&Cancelar", IDC_STATIC -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SERVICES DIALOGEX 0, 0, 179, 92 -STYLE DS_CENTER | WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Servicios:",IDC_SVC_DESC,0,5,179,8 - CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,0,17,179, - 61,WS_EX_STATICEDGE - PUSHBUTTON "&Crear...",IDC_SVC_CREATE,56,80,39,12 - PUSHBUTTON "Su&primir",IDC_SVC_DELETE,98,80,39,12 - PUSHBUTTON "&Reiniciar",IDC_SVC_RESTART,140,80,39,12 -END - -IDD_AGGREGATES DIALOGEX 0, 0, 165, 84 -STYLE DS_CENTER | WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Particiones:",IDC_AGG_DESC,0,5,165,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,0,17,165, - 53,WS_EX_STATICEDGE - PUSHBUTTON "&Crear volumen...",IDC_AGG_CREATESET,102,72,63,12 -END - -IDD_FILESETS DIALOGEX 0, 0, 194, 92 -STYLE DS_CENTER | WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Volúmenes:",IDC_SET_DESC,0,5,194,8 - CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,0,17,194, - 61,WS_EX_STATICEDGE - PUSHBUTTON "&Crear...",IDC_SET_CREATE,4,80,34,12 - PUSHBUTTON "Su&primir",IDC_SET_DELETE,40,80,36,12 - PUSHBUTTON "&Duplicación...",IDC_SET_REP,78,80,50,12 - PUSHBUTTON "Establecer c&uota...",IDC_SET_SETQUOTA,130,80,62,12 -END - -IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, - 135,WS_EX_CLIENTEDGE - PUSHBUTTON "&Añadir administrador",IDC_LIST_ADD,66,160,71,14 - PUSHBUTTON "&Eliminar administrador",IDC_LIST_REMOVE,141,160,80,14 - LTEXT "Administradores para servidor %1:",IDC_LIST_NAME,5,7, - 216,8 -END - -IDD_AGG_GENERAL DIALOGEX 0, 0, 306, 160 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "ID:",IDC_STATIC,5,30,31,8 - LTEXT "(consultando)",IDC_AGG_ID,47,30,214,8 - LTEXT "Dispositivo:",IDC_STATIC,5,46,40,8 - LTEXT "(consultando)",IDC_AGG_DEVICE,47,46,214,8 - LTEXT "Volúmenes:",IDC_STATIC,5,62,39,8 - LTEXT "(consultando)",IDC_AGG_FILESETS,47,62,214,8 - CONTROL "Visualizar un a&viso si la cuota de volumen combinada supera la capacidad", - IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 48,76,253,10 - LTEXT "Uso:",IDC_STATIC,5,90,31,8 - LTEXT "(consultando)",IDC_AGG_USAGE,47,90,214,8 - CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,30,103,224,8, - WS_EX_STATICEDGE - CONTROL "Visualizar un a&viso si el uso de la partición supera ", - IDC_AGG_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47, - 116,214,10 - CONTROL "el umbral &por omisión para este servidor", - IDC_AGG_WARN_AGGFULL_DEF,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,49,131,203,9 - CONTROL "un &umbral de",IDC_AGG_WARN_AGGFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,49,145,62,9 - EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,112,143,29,12, - ES_AUTOHSCROLL - LTEXT "% de su tamaño",IDC_AGG_WARN_AGGFULL_DESC,152,145,100,8 - ICON IDI_AGGREGATE,IDC_STATIC,5,5,21,20 - LTEXT "Partición %2 (servidor %1)",IDC_AGG_NAME,38,14,214,8 -END - -IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Dirección IP:",IDC_STATIC,5,29,43,8 - LISTBOX IDC_SVR_ADDRESSES,53,29,70,12,LBS_NOSEL | NOT WS_BORDER | - WS_VSCROLL - PUSHBUTTON "Cambiar &direcciones...",IDC_SVR_CHANGEADDR,144,27,77, - 12 - PUSHBUTTON "&Requerir autentificación",IDC_SVR_AUTH_YES,41,81,84,12 - PUSHBUTTON "Permitir &no autentificado",IDC_SVR_AUTH_NO,129,81,80, - 12 - LTEXT "Número de particiones",IDC_STATIC,11,131,75,8 - LTEXT "(consultando)",IDC_SVR_NUMAGGREGATES,112,131,99,8 - LTEXT "Capacidad total:",IDC_STATIC,11,148,77,8 - LTEXT "(consultando)",IDC_SVR_CAPACITY,112,147,99,8 - LTEXT "Cuota de volumen combinada:",IDC_STATIC,11,165,96,8 - LTEXT "(consultando)",IDC_SVR_ALLOCATION,112,165,99,8 - ICON IDI_SERVER,IDC_STATIC,5,5,20,20 - LTEXT "(nombre de servidor)",IDC_SVR_NAME,55,13,93,8 - GROUPBOX "Seguridad",IDC_STATIC,5,52,216,52 - GROUPBOX "Almacenamiento",IDC_STATIC,5,115,216,68 - LTEXT "Puede requerir que se autentifique el acceso a este servidor.", - IDC_STATIC,11,67,210,8 -END - -IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 266, 158 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "cualquier partición de este servidor se llena en un", - IDC_SVR_WARN_AGGFULL,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,18,171,9 - EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,186,16,24,12,ES_AUTOHSCROLL - LTEXT "%",IDC_STATIC,215,18,28,8 - CONTROL "cualquier volumen de este servidor se llena en un", - IDC_SVR_WARN_SETFULL,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,32,169,9 - EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,186,30,24,12,ES_AUTOHSCROLL - LTEXT "%",IDC_STATIC,215,32,44,8 - CONTROL "la cuota combinada de cualquier partición supera su capacidad", - IDC_SVR_WARN_AGGALLOC,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,46,218,9 - CONTROL "se detiene la ejecución de algún servicio de este servidor", - IDC_SVR_WARN_SVCSTOP,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,60,218,9 - CONTROL "algún volumen de este servidor carece de entrada de VLDB", - IDC_SVR_WARN_SETNOVLDB,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,74,218,9 - CONTROL "VLDB hace referencia a cualquier partición fuera de línea de este servidor", - IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,88,249,9 - CONTROL "VLDB hace referencia a cualquier volumen fuera de línea de este servidor", - IDC_SVR_WARN_SETNOSERV,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,103,249,9 - CONTROL "Actualizar información de servidor cada", - IDC_SVR_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,142,138,9 - EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,151,140,27,13,ES_AUTOHSCROLL - LTEXT "minutos",IDC_STATIC,184,142,25,8 - LTEXT "Visualizar un aviso si",IDC_STATIC,5,5,195,8 -END - -IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 233, 207 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - PUSHBUTTON "&Ver registro de servicio",IDC_SVC_VIEWLOG,34,182,78,14 - PUSHBUTTON "&Iniciar ahora",IDC_SVC_START,123,182,46,14 - PUSHBUTTON "De&tener ahora",IDC_SVC_STOP,172,182,50,14 - CONTROL "Visualizar un &aviso si se detiene el servicio", - IDC_SVC_WARNSTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 15,159,200,10 - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "Servicio %2 (servidor %1)",IDC_SVC_NAME,40,13,168,8 - LTEXT "Tipo:",IDC_STATIC,5,29,44,8 - LTEXT "(consultando)",IDC_SVC_TYPE,60,29,168,8 - LTEXT "Parámetros:",IDC_STATIC,5,45,44,8 - EDITTEXT IDC_SVC_PARAMS,60,45,168,13,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP - LTEXT "Notificador:",IDC_STATIC,5,61,44,8 - LTEXT "(consultando)",IDC_SVC_NOTIFIER,60,61,168,8 - LTEXT "Último inicio:",IDC_STATIC,5,78,42,8 - LTEXT "(consultando)",IDC_SVC_STARTDATE,60,77,168,8 - LTEXT "Última parada:",IDC_STATIC,5,93,47,8 - LTEXT "(consultando)",IDC_SVC_STOPDATE,60,93,168,8 - LTEXT "Última anomalía:",IDC_STATIC,5,109,53,8 - EDITTEXT IDC_SVC_LASTERROR,60,109,168,13,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - GROUPBOX "Estado de servicio",IDC_STATIC,5,127,223,75 - LTEXT "El estado actual de este servicio se está determinando...", - IDC_SVC_STATUS,11,142,200,8 -END - -IDD_SET_GENERAL DIALOGEX 0, 0, 299, 214 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "ID de volumen:",IDC_STATIC,5,30,52,8 - LTEXT "(desconocido)",IDC_SET_ID,73,30,219,8 - LTEXT "Creado:",IDC_STATIC,5,46,39,8 - LTEXT "(consultando)",IDC_SET_CREATEDATE,73,46,219,8 - LTEXT "Actualizado:",IDC_STATIC,5,62,39,8 - LTEXT "(consultando)",IDC_SET_UPDATEDATE,73,62,112,8 - LTEXT "Accedido:",IDC_STATIC,5,78,39,8 - LTEXT "(consultando)",IDC_SET_ACCESSDATE,73,78,219,8 - LTEXT "Copia de seguridad:",IDC_STATIC,5,94,65,8 - LTEXT "(consultando)",IDC_SET_BACKUPDATE,73,94,219,8 - LTEXT "Cuenta de archivos:",IDC_STATIC,5,110,67,8 - LTEXT "(consultando)",IDC_SET_FILES,73,110,219,8 - LTEXT "Estado",IDC_STATIC,5,126,26,8 - LTEXT "(consultando)",IDC_SET_STATUS,73,126,115,8 - PUSHBUTTON "&Bloquear",IDC_SET_LOCK,191,124,49,12 - PUSHBUTTON "&Desbloquear",IDC_SET_UNLOCK,245,124,49,12 - LTEXT "Uso:",IDC_STATIC,5,142,31,8 - LTEXT "(consultando)",IDC_SET_USAGE,73,142,136,8 - PUSHBUTTON "&Establecer cuota...",IDC_SET_QUOTA,229,140,65,12 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,75,156,219,8, - WS_EX_STATICEDGE - CONTROL "&Visualizar un aviso si el uso de este volumen supera", - IDC_SET_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20, - 170,219,10 - CONTROL "el umbral por &omisión para este servidor (%1%% de su tamaño)", - IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,39,185,207,9 - CONTROL "un &umbral de",IDC_SET_WARN_SETFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,39,199,62,9 - EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,102,196,29,12, - ES_AUTOHSCROLL - LTEXT "% de su tamaño",IDC_SET_WARN_SETFULL_DESC,139,199,105,8 - ICON IDI_FILESET,IDC_STATIC,5,5,21,20 - LTEXT "Volumen %3 (servidor %1, partición %2)",IDC_SET_NAME,75, - 14,219,8 -END - -IDD_MAIN DIALOGEX 0, 0, 317, 226 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | - WS_SYSMENU | WS_THICKFRAME -CAPTION "AFS Server Manager" -MENU MENU_MAIN -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Célula seleccionada:",IDC_STATIC,2,8,69,8 - LTEXT "(el nombre de célula se colocará aquí)",IDC_CELL,73,8, - 208,9 - LTEXT "Señales de AFS:",IDC_STATIC,2,19,55,8 - LTEXT "%2:%1 (caducarán las señales %3)",IDC_AFS_ID,74,19,208, - 9 - CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,31,313, - 193,WS_EX_CLIENTEDGE - CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 - ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 -STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Servidor" -CLASS "ServerWindowClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_TABS,"SysTabControl32",0x0,2,2,205,133 -END - -IDD_SVC_CREATE DIALOGEX 0, 0, 242, 233 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "&Servidor:",IDC_STATIC,5,36,44,8 - COMBOBOX IDC_SVC_SERVER,69,33,116,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Ser&vicio:",IDC_STATIC,5,52,44,8 - COMBOBOX IDC_SVC_NAME,69,50,116,104,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Mandato:",IDC_STATIC,5,70,44,8 - EDITTEXT IDC_SVC_COMMAND,69,68,168,13,ES_AUTOHSCROLL - LTEXT "&Parámetros:",IDC_STATIC,5,88,44,8 - EDITTEXT IDC_SVC_PARAMS,69,86,168,13,ES_AUTOHSCROLL - LTEXT "&Notificador:",IDC_STATIC,5,105,44,8 - EDITTEXT IDC_SVC_NOTIFIER,69,103,168,13,ES_AUTOHSCROLL - LTEXT "Archivo de ®istro:",IDC_STATIC,5,122,63,8 - EDITTEXT IDC_SVC_LOGFILE,69,120,168,13,ES_AUTOHSCROLL - CONTROL "S&encillo (se ejecuta de modo continuo)", - IDC_SVC_TYPE_SIMPLE,"Button",BS_AUTORADIOBUTTON,11,154, - 201,10 - CONTROL "Iniciar este servicio a&hora",IDC_SVC_RUNNOW,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 - CONTROL "&FS (sistema de archivos)",IDC_SVC_TYPE_FS,"Button", - BS_AUTORADIOBUTTON,11,180,201,10 - CONTROL "&Cron (se ejecuta a intervalos especificados)", - IDC_SVC_TYPE_CRON,"Button",BS_AUTORADIOBUTTON,11,195,201, - 10 - LTEXT "C&uándo ejecutar:",IDC_STATIC,23,209,56,8 - COMBOBOX IDC_SVC_RUNDAY,84,207,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "a las",IDC_STATIC,157,209,18,8 - CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,178,207, - 53,13,WS_EX_CLIENTEDGE - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "Servicio nuevo",IDC_SVC_DESC,39,13,168,8 - GROUPBOX "Tipo de servicio",IDC_STATIC,5,141,232,87 -END - -IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, - 199,58,WS_EX_CLIENTEDGE - PUSHBUTTON "&Liberar ahora",IDC_SET_RELEASE,11,143,52,14 - PUSHBUTTON "&Crear...",IDC_SET_REPSITE_ADD,129,143,38,14 - PUSHBUTTON "Su&primir",IDC_SET_REPSITE_DELETE,172,143,38,14 - LTEXT "Servidor:",-1,11,31,37,8 - LTEXT "(nombre de servidor)",IDC_SET_SERVER,55,31,147,8 - LTEXT "Partición:",-1,11,44,37,8 - LTEXT "(nombre de partición)",IDC_SET_AGGREGATE,55,44,147,8 - LTEXT "Volumen:",-1,11,18,37,8 - LTEXT "(nombre de volumen)",IDC_SET_NAME,55,18,147,8 - GROUPBOX "Leer/Grabar volumen",-1,5,5,211,56 - GROUPBOX "Duplicados de volumen",-1,5,67,211,96 -END - -IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 228, 258 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Seleccionar célula - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Célula:",IDC_STATIC,4,24,27,8 - COMBOBOX IDC_OPENCELL_CELL,33,22,191,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - GROUPBOX "Autentificación de AFS",IDC_STATIC,4,44,220,92 - LTEXT "&Identidad de AFS:",IDC_STATIC,22,104,60,8 - EDITTEXT IDC_OPENCELL_ID,89,102,129,14,ES_AUTOHSCROLL - LTEXT "C&ontraseña de AFS:",IDC_STATIC,22,120,66,8 - EDITTEXT IDC_OPENCELL_PASSWORD,89,118,129,14,ES_PASSWORD | - ES_AUTOHSCROLL - PUSHBUTTON "A&vanzado >>",IDC_ADVANCED,4,146,53,14 - DEFPUSHBUTTON "Aceptar",IDOK,86,146,41,14 - PUSHBUTTON "Cancelar",IDCANCEL,135,146,41,14 - PUSHBUTTON "A&yuda",9,183,146,41,14 - CONTROL "Supervisar &todos los servidores de esta célula", - IDC_MON_ALL,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10, - 204,185,9 - CONTROL "&Sólo un servidor:",IDC_MON_ONE,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,10,219,110,10 - EDITTEXT IDC_MON_SERVER,137,218,83,13,ES_AUTOHSCROLL - CONTROL "Sólo los servidores del s&ubconjunto:",IDC_MON_SOME, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10,235,126,13 - COMBOBOX IDC_MON_SUBSET,137,233,83,93,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Seleccione la célula de AFS con la que le gustaría trabajar.", - IDC_STATIC,4,7,200,8 - GROUPBOX "Supervisar servidores",IDC_ADVANCED_GROUP,4,170,220,84 - LTEXT "Para un rendimiento más rápido, puede optar por supervisar sólo un subconjunto de los servidores disponibles en esta célula.", - IDC_STATIC,10,182,206,17 - LTEXT "(consultando...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "Para administrar una célula, debe volver a entrar la contraseña de AFS:", - IDC_STATIC,10,83,204,17 - LTEXT "Las señales de AFS actuales dentro de la célula seleccionada:", - IDC_STATIC,10,57,207,8 -END - -IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Aviso - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "&Continuar esperando hasta que la tarea finalice con normalidad", - IDC_TIMEOUT_WAIT,"Button",BS_AUTORADIOBUTTON,15,87,211, - 10 - CONTROL "&Finalizar la tarea",IDC_TIMEOUT_KILL,"Button", - BS_AUTORADIOBUTTON,15,101,208,10 - DEFPUSHBUTTON "Aceptar",IDOK,93,139,50,14 - LTEXT "Tiempo transcurrido para la ejecución de la tarea:", - IDC_STATIC,4,119,160,8 - LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,169,119,29,8 - LTEXT "El AFS Server Manager ha estado esperando durante un período de tiempo inesperadamente largo a que finalizase una tarea de red.", - IDC_STATIC,4,7,228,18 - LTEXT "Puede continuar permitiendo la ejecución de la tarea (recomendado), o bien en el caso de que crea que la tarea no finalizará nunca, puede dejar que el AFS Server Manager la finalice.", - IDC_STATIC,4,30,228,26 - LTEXT "Por favor, tenga en cuenta que la tarea sigue en curso mientras se muestra esta ventana; si finaliza la tarea, esta ventana se cerrará automáticamente.", - IDC_STATIC,4,60,228,24 -END - -IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 -STYLE WS_POPUP | WS_CAPTION -CAPTION "Columnas" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Seleccione las columnas para visualizar al efectuar el listado:", - IDC_STATIC,5,7,126,18 - COMBOBOX IDC_COLUMNS,134,9,147,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Columnas disponibles:",IDC_STATIC,12,40,100,8 - LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "Columnas para &visualizar:",IDC_STATIC,173,41,100,8 - LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Aña&dir >>",IDC_COL_INSERT,119,68,46,14 - PUSHBUTTON "<< &Eliminar",IDC_COL_DELETE,119,88,46,14 - PUSHBUTTON "Mover hacia a&rriba",IDC_COL_UP,142,122,63,14 - PUSHBUTTON "Mover hacia a&bajo",IDC_COL_DOWN,208,122,65,14 - GROUPBOX "Listar columnas",IDC_STATIC,5,25,276,118 -END - -IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 264, 72 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Actualizando - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, - 256,8 - LTEXT "0% completado",IDC_REFRESH_PERCENT,4,49,216,8 - LTEXT "",IDC_REFRESH_CURRENT,4,60,216,8 - LTEXT "Espere, por favor...",IDC_REFRESH_DESC,4,7,256,25 - PUSHBUTTON "&Omitir",IDC_REFRESH_SKIP,222,58,38,12,NOT WS_TABSTOP -END - -IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Crear volumen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "&Nombre:",IDC_STATIC,4,30,39,8 - EDITTEXT IDC_SET_NAME,46,28,116,14,ES_AUTOHSCROLL - LTEXT "&Cuota:",IDC_STATIC,4,48,39,8 - EDITTEXT IDC_SET_QUOTA,46,46,32,14,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,90,47,30,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "C&opia de seguridad:",IDC_STATIC,4,66,65,8 - CONTROL "C&rear también una versión de copia de seguridad de este volumen", - IDC_SET_CLONE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,90, - 66,224,8 - LTEXT "&Servidor:",IDC_STATIC,4,84,39,8 - COMBOBOX IDC_SET_SERVER,46,82,116,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Partición:",IDC_STATIC,4,102,39,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,46,102,271, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "Aceptar",IDOK,156,191,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,211,191,50,14 - PUSHBUTTON "A&yuda",9,267,191,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "Volumen nuevo",IDC_STATIC,46,12,170,8 -END - -IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 277, 102 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Suprimir volumen" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "Cancelar",IDCANCEL,169,84,50,14 - PUSHBUTTON "Aceptar",IDOK,115,84,50,14 - PUSHBUTTON "A&yuda",9,223,84,50,14 - CONTROL "&Suprimir volumen %3 del servidor %1, partición %2", - IDC_DELSET_SERVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 46,45,227,10 - CONTROL "Suprimir entrada de &VLDB para volumen %3", - IDC_DELSET_VLDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,46, - 60,227,10 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "¡Precaución!\n\nEsta operación hará que el volumen %3 se elimine permanentemente.", - IDC_DELSET_DESC,31,7,242,33 -END - -IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Volumen de copia de seguridad - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "Aceptar",IDOK,183,67,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,237,67,50,14 - PUSHBUTTON "A&yuda",9,291,67,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,21,20 - LTEXT "Una copia de seguridad de volumen actúa como una copia de sólo lectura de dicho volumen. Un volumen de leer/grabar sólo puede tener una versión de copia de seguridad. ", - IDC_STATIC,34,9,307,17 - LTEXT "Pulse en Aceptar para crear una copia de seguridad del volumen %3 en el servidor %1, partición %2. Si ya existe una copia de seguridad de este volumen, la copia de seguridad se actualizará. ", - IDC_CLONE_DESC,34,32,307,24 -END - -IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "Problemas conocidos",IDC_PROBLEM_BOX,5,36,215,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,138,120,61,12 - ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "Servicio %2 (servidor %1)",IDC_PROBLEM_TITLE,52,13,168, - 8 -END - -IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "Problemas conocidos",IDC_PROBLEM_BOX,5,36,216,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,172,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,201,49,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,136,120,61,12 - ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "%1",IDC_PROBLEM_TITLE,42,13,179,8 -END - -IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "Problemas conocidos",IDC_PROBLEM_BOX,5,35,247,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,170,119,61,12 - ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "Partición %2 (servidor %1)",IDC_PROBLEM_TITLE,38,14,214, - 8 -END - -IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "Problemas conocidos",IDC_PROBLEM_BOX,5,35,263,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,249,48,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 - ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "Volumen %3 (servidor %1, partición %2)", - IDC_PROBLEM_TITLE,49,14,219,8 -END - -IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Mover volumen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,70,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "Aceptar",IDOK,115,156,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,169,156,50,14 - PUSHBUTTON "A&yuda",9,223,156,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,21,20 - LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,242,24 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 - LTEXT "&Mover volumen a:",IDC_STATIC,4,43,116,8 -END - -IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "Moviendo volumen - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "Moviendo volumen %3 desde partición %2 en servidor %1 a partición %5 en servidor %4...", - IDC_MOVESET_DESC,4,41,229,19 -END - -IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 311, 106 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Ver archivo de registro" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Ver archivo de registro en &servidor:",IDC_STATIC,4,45, - 110,8 - COMBOBOX IDC_VIEWLOG_SERVER,115,43,126,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "&Archivo en servidor a visualizar:",IDC_STATIC,4,64,100, - 8 - EDITTEXT IDC_VIEWLOG_FILENAME,115,62,191,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "Aceptar",IDOK,199,88,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,257,88,50,14 - ICON IDI_SERVICE,IDC_STATIC,4,4,21,20 - LTEXT "Por favor, entre la vía de acceso completa del archivo de registro que desea visualizar.", - IDC_VIEWLOG_DESC,65,10,242,21 -END - -IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 286, 185 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Ver archivo de registro" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Contenido del archivo:",IDC_SVC_VIEWLOG_CONTENTS,4,41, - 277,8 - EDITTEXT IDC_VIEWLOG_TEXT,4,51,277,113,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL - PUSHBUTTON "Guardar &como...",IDC_VIEWLOG_SAVEAS,170,167,56,14 - DEFPUSHBUTTON "Ce&rrar",IDOK,231,167,50,14 - ICON IDI_SERVICE,-1,4,7,20,20 - LTEXT "Registrar archivo [para servicio %2] en servidor %1", - IDC_SVC_VIEWLOG_DESC,33,7,248,8 - LTEXT "Nombre de archivo en servidor: %1", - IDC_SVC_VIEWLOG_FILENAME,33,23,248,8 -END - -IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Establecer cuota de volumen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Cuota actual:",IDC_STATIC,4,49,47,8 - LTEXT "(desconocido)",IDC_SET_USAGE,59,49,208,8 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,59,60,208,8, - WS_EX_STATICEDGE - LTEXT "Nueva &cuota:",IDC_STATIC,4,81,47,8 - EDITTEXT IDC_SET_QUOTA,59,79,32,13,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,103,79,30,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Aceptar",IDOK,109,112,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,163,112,50,14 - PUSHBUTTON "A&yuda",9,217,112,50,14 - PUSHBUTTON "&Propiedades...",IDC_AGG_PROPERTIES,212,28,55,12 - LTEXT "Partición:",IDC_STATIC,4,30,47,8 - LTEXT "Partición %2 de servidor %1",IDC_SET_AGGREGATE,59,30, - 141,8 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "Volumen %1",IDC_SET_NAME,59,11,208,8 -END - -IDD_ACTIONS DIALOGEX 0, 0, 236, 58 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "Operaciones en curso - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "La operaciones siguientes están actualmente en curso:", - IDC_ACTION_DESC,2,2,232,8 - CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | - 0x3,2,14,232,43 -END - -IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Sincronizar VLDB" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "Aceptar",IDOK,107,81,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,161,81,50,14 - PUSHBUTTON "A&yuda",9,215,81,50,14 - ICON 32515,IDC_STATIC,4,4,21,20 - LTEXT "(definido en el momento de la ejecución)",IDC_SYNC_DESC, - 37,4,228,32 - LTEXT "(definido en el momento de la ejecución)", - IDC_SYNC_DESC2,37,44,228,24 -END - -IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Duplicar volumen" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,62,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "Aceptar",IDOK,115,153,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,169,153,50,14 - PUSHBUTTON "A&yuda",9,223,153,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "Duplicado nuevo del volumen %3",IDC_SET_NAME,31,12,242, - 8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 - LTEXT "&Crear un duplicado nuevo de este volumen en:", - IDC_STATIC,4,35,149,8 -END - -IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 264, 157 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Instalar archivo" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Archivo de origen:",IDC_STATIC,4,74,63,8 - EDITTEXT IDC_FILENAME,71,72,135,14,ES_AUTOHSCROLL - PUSHBUTTON "&Examinar...",IDC_BROWSE,210,72,50,14 - LTEXT "&Servidor de destino:",IDC_STATIC,4,94,63,8 - COMBOBOX IDC_SERVER,71,92,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Nombre de destino:",IDC_STATIC,4,114,63,8 - EDITTEXT IDC_DIRECTORY,71,112,135,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "Aceptar",IDOK,86,139,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,140,139,50,14 - PUSHBUTTON "A&yuda",9,210,139,50,14 - ICON IDI_INSTALL,IDC_STATIC,4,4,21,20 - LTEXT "Instalar archivo en servidor",IDC_STATIC,32,12,127,8 - LTEXT "(texto definido en el momento de la ejecución)\n(texto definido en el momento de la ejecución)\n(texto definido en el momento de la ejecución)\n(texto definido en el momento de la ejecución)", - IDC_INSTALL_DESC,4,29,256,33 -END - -IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Desinstalar archivo" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Servidor:",IDC_STATIC,4,66,35,8 - COMBOBOX IDC_SERVER,67,64,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Archivo de destino:",IDC_STATIC,4,85,61,8 - EDITTEXT IDC_FILENAME,67,83,175,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "Aceptar",IDOK,88,121,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,141,121,50,14 - PUSHBUTTON "A&yuda",9,194,121,50,14 - ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 - LTEXT "Desinstalar archivo del servidor",IDC_STATIC,32,12,127, - 8 - LTEXT "Esta operación le permite restaurar una copia instalada con anterioridad de un archivo en un determinado servidor. Si no existe ninguna copia instalada con anterioridad del archivo seleccionado, se eliminará el archivo. ", - IDC_STATIC,4,29,240,26 -END - -IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 318, 133 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Podar archivos antiguos" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Servidor:",-1,4,56,44,8 - COMBOBOX IDC_SERVER,53,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Todos los archivos de &imagen de la memoria", - IDC_OP_DELETE_CORE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 70,73,178,10 - CONTROL "Todos los archivos .&BAK (copias de seguridad de archivo)", - IDC_OP_DELETE_BAK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 70,84,220,10 - CONTROL "Todos los archivos .&OLD (copias de seguridad de archivos más antiguos)", - IDC_OP_DELETE_OLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 70,95,243,10 - DEFPUSHBUTTON "Aceptar",IDOK,148,115,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,202,115,50,14 - PUSHBUTTON "A&yuda",9,264,115,50,14 - ICON IDI_PRUNE,-1,4,4,21,20 - LTEXT "Podar archivos antiguos del servidor",-1,32,12,128,8 - LTEXT "Esta operación elimina copias de seguridad de los archivos instalados en un determinado servidor.", - -1,4,29,310,16 - LTEXT "Archivos a suprimir:",-1,4,73,62,8 -END - -IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Cambiar nombre de volumen" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Nombre &antiguo",IDC_STATIC,31,67,54,8 - EDITTEXT IDC_RENSET_OLD,89,65,122,14,ES_AUTOHSCROLL | ES_READONLY - LTEXT "Nombre &nuevo",IDC_STATIC,31,85,55,8 - EDITTEXT IDC_RENSET_NEW,89,83,122,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "Aceptar",IDOK,115,115,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,169,115,50,14 - PUSHBUTTON "Ayuda",9,223,115,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "Para cambiar el nombre del volumen %3, entre uno nuevo. Se redenominan automáticamente el nombre de copia de seguridad del volumen y sus duplicados.\n\nPrecaución: si es un volumen montado, elimínelo y cree nuevos puntos de montaje.", - IDC_RENSET_DESC,31,7,242,48 -END - -IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 277, 68 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Suprimir servicio" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "Cancelar",IDCANCEL,169,50,50,14 - PUSHBUTTON "Aceptar",IDOK,115,50,50,14 - PUSHBUTTON "Ayuda",9,223,50,50,14 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "¡Precaución!\n\nEsta operación hará que el servicio %2 se detenga y se elimine del servidor %1.", - IDC_DELSVC_DESC,31,7,242,33 -END - -IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Obtener fechas de archivo" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Servidor:",-1,4,56,42,8 - COMBOBOX IDC_SERVER,71,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Archivo a consultar:",-1,4,75,64,8 - EDITTEXT IDC_FILENAME,71,73,135,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "Aceptar",IDOK,86,107,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,140,107,50,14 - PUSHBUTTON "A&yuda",9,194,107,50,14 - ICON IDI_GETDATES,-1,4,4,20,20 - LTEXT "Obtener fechas de archivos del servidor",-1,32,12,127,8 - LTEXT "Esta operación obtiene la fecha en que se modificaron por última vez un archivo y sus copias de seguridad (si es que existen).", - -1,4,29,240,16 -END - -IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Obtener fechas de archivos - Resultados" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Servidor:",IDC_STATIC,4,30,39,8 - LTEXT "(definido en el momento de la ejecución)",IDC_SERVER,72, - 30,137,8 - LTEXT "Nombre de archivo:",IDC_STATIC,4,45,63,8 - LTEXT "(definido en el momento de la ejecución)",IDC_FILENAME, - 72,45,137,8 - LTEXT "Fecha de archivo:",IDC_STATIC,4,60,60,8 - LTEXT "(desconocida; no ha podido encontrarse el archivo)", - IDC_DATE_FILE,72,60,168,8 - LTEXT "Fecha de .BAK:",IDC_STATIC,4,75,59,8 - LTEXT "(desconocida; no ha podido encontrarse el archivo)", - IDC_DATE_BAK,72,75,167,8 - LTEXT "Fecha de .OLD:",IDC_STATIC,4,90,60,8 - LTEXT "(desconocida; no ha podido encontrarse el archivo)", - IDC_DATE_OLD,72,90,166,8 - DEFPUSHBUTTON "Ce&rrar",IDOK,99,114,50,14 - ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 - LTEXT "Obtener fechas de archivos del servidor",IDC_STATIC,32, - 12,127,8 -END - -IDD_SET_DUMP DIALOGEX 0, 0, 311, 143 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Volumen de vuelco - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Crear archivo de vuelco con el &nombre:",IDC_STATIC,4, - 42,79,18 - EDITTEXT IDC_DUMP_FILENAME,86,44,151,14,ES_AUTOHSCROLL - PUSHBUTTON "&Examinar...",IDC_DUMP_BROWSE,257,44,50,14 - CONTROL "Volcar &todo el contenido del volumen %3 (partición %1:%2)", - IDC_DUMP_FULL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10, - 78,274,10 - CONTROL "Volcar sólo los archivos que hayan cambiado &desde", - IDC_DUMP_LIMIT_TIME,"Button",BS_AUTORADIOBUTTON,10,94, - 178,10 - CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,190,93,51, - 13,WS_EX_CLIENTEDGE - CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,248,93,56, - 13,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "Aceptar",IDOK,131,125,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,185,125,50,14 - PUSHBUTTON "A&yuda",9,257,125,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,21,20 - LTEXT "Esta operación copia el contenido de un volumen en un único archivo, por lo que puede efectuarse la copia de seguridad del volumen de una manera sencilla. El contenido de los volúmenes volcados de este modo puede restaurarse con posterioridad.", - IDC_STATIC,46,7,261,33 - GROUPBOX "Parámetros de vuelco",IDC_STATIC,4,62,303,53 -END - -IDD_SET_RESTORE DIALOGEX 0, 0, 301, 247 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Restaurar volumen - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Archivo a &restaurar:",IDC_STATIC,4,33,61,8 - EDITTEXT IDC_RESTORE_FILENAME,69,30,175,14,ES_AUTOHSCROLL - PUSHBUTTON "&Examinar...",IDC_RESTORE_BROWSE,247,30,50,14 - CONTROL "Este es un archivo de vuelco &gradual", - IDC_RESTORE_INCREMENTAL,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,69,46,214,10 - LTEXT "&Volumen:",IDC_STATIC,11,102,38,8 - EDITTEXT IDC_RESTORE_SETNAME,52,100,115,14,ES_AUTOHSCROLL - LTEXT "&Servidor:",IDC_STATIC,11,145,36,8 - COMBOBOX IDC_RESTORE_SERVER,53,143,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "&Partición:",IDC_STATIC,11,162,36,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,52,161,231, - 55,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "Aceptar",IDOK,128,229,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,183,229,50,14 - PUSHBUTTON "A&yuda",9,247,229,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,21,20 - LTEXT "Restaurar volumen desde archivo de vuelco",IDC_STATIC, - 33,11,224,8 - GROUPBOX "Volumen de destino",IDC_STATIC,4,63,293,160 - LTEXT "Al restaurar un volumen desde un archivo de vuelco, puede crear un volumen nuevo o sobregrabar un volumen de leer/grabar existente.", - IDC_STATIC,11,78,259,16 - LTEXT "(definido en el momento de la ejecución)\n(definido en el momento de la ejecución)", - IDC_RESTORE_CREATE,53,119,229,17 -END - -IDD_SVC_BOS DIALOGEX 0, 0, 296, 207 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "Detener y reiniciar &periódicamente todos los servicios en este servidor", - IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, - 71,231,10 - LTEXT "&Reiniciar",IDC_BOS_GENRES_DESC1,23,87,35,8 - COMBOBOX IDC_BOS_GENRES_DATE,61,84,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "&en",IDC_BOS_GENRES_DESC2,134,87,8,8 - CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,145, - 84,53,13,WS_EX_CLIENTEDGE - CONTROL "Probar periódicamente si hay &binarios nuevos en todos los servicios de este servidor", - IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, - 151,278,10 - LTEXT "Pr&obar",IDC_BOS_BINRES_DESC1,23,167,25,8 - COMBOBOX IDC_BOS_BINRES_DATE,59,164,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "e&n",IDC_BOS_BINRES_DESC2,132,167,8,8 - CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,143, - 164,53,13,WS_EX_CLIENTEDGE - ICON IDI_BOSSERVICE,IDC_STATIC,5,5,21,20 - LTEXT "Servicio %2 (servidor %1)",IDC_SVC_NAME,37,13,168,8 - GROUPBOX "Servicio BOS",IDC_STATIC,5,27,285,175 - LTEXT "El servicio BOS puede utilizarse para detener y reiniciar periódicamente todos los servicios en este servidor (incluyendo el propio servicio BOS).", - IDC_STATIC,11,45,260,18 - LTEXT "El servicio BOS también puede utilizarse para probar periódicamente todos los servicios de un servidor, deteniendo y reiniciando sólo los servicios cuyos archivos binarios se hayan actualizado.", - IDC_STATIC,11,118,263,25 -END - -IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "Volcando volumen - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "Creando archivo de vuelco %4 desde volumen %3...", - IDC_DUMPSET_DESC,4,41,229,19 -END - -IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "Restaurando volumen - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "Restaurando volumen %1 desde archivo de vuelco %2...", - IDC_RESTORESET_DESC,4,41,229,19 -END - -IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 330, 162 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Copia de seguridad de volúmenes- AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "Crear versiones de copia de seguridad de &todos los volúmenes de esta célula", - IDC_CLONE_ALL,"Button",BS_AUTORADIOBUTTON,30,53,277,10 - GROUPBOX " ",IDC_STATIC,21,77,265,60 - CONTROL "Crear &sólo copias de seguridad para los volúmenes que satisfagan los siguientes criterios:", - IDC_CLONE_SOME,"Button",BS_AUTORADIOBUTTON,30,67,293,11 - CONTROL "Sólo los volúmenes del s&ervidor:",IDC_CLONE_SVR_LIMIT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,41,87,124,10 - COMBOBOX IDC_CLONE_SVR,186,86,85,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Sólo los volúmenes de la &partición:", - IDC_CLONE_AGG_LIMIT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,41,103,128,10 - COMBOBOX IDC_CLONE_AGG,186,102,85,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Sólo los volúmenes que &comiencen por:", - IDC_CLONE_PREFIX_LIMIT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,41,120,141,10 - EDITTEXT IDC_CLONE_PREFIX,186,119,85,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "Aceptar",IDOK,154,144,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,208,144,50,14 - PUSHBUTTON "A&yuda",9,276,144,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "Un volumen actúa como una copia de sólo lectura de dicho volumen. Un volumen de leer/grabar sólo puede tener una versión de copia de seguridad.\n\nPuede crear versiones de copia de seguridad para más de un volumen a la vez.", - IDC_STATIC,30,7,244,40 -END - -IDD_SUBSETS DIALOGEX 0, 0, 305, 183 -STYLE WS_POPUP | WS_CAPTION -CAPTION "Servidores supervisados" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Nombre de subconjunto:",IDC_STATIC,12,77,79,8 - EDITTEXT IDC_SUBSET_NAME,93,75,116,14,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_TABSTOP - PUSHBUTTON "&Abrir...",IDC_SUBSET_LOAD,214,75,39,14 - PUSHBUTTON "&Guardar...",IDC_SUBSET_SAVE,257,75,39,14 - CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x153,12,111,193,58,WS_EX_CLIENTEDGE - PUSHBUTTON "Supervisar &todos",IDC_SUBSET_ALL,216,122,77,14 - PUSHBUTTON "No supervisar &ninguno",IDC_SUBSET_NONE,216,140,77,14 - LTEXT "Para mejorar el rendimiento al trabajar en una célula grande, puede optar por no supervisar los problemas de determinados servidores. El AFS Server Manager no mostrará los volúmenes, particiones o servicios del servidor no supervisado. ", - IDC_STATIC,5,5,295,24 - LTEXT "Puede optar por supervisar (o no supervisar) un servidor en cualquier momento. Puede crear subconjuntos de servidor para designar las listas de servidores que deben supervisarse. ", - IDC_STATIC,5,37,295,18 - GROUPBOX "Subconjunto actual",IDC_STATIC,5,64,295,114 - LTEXT "Servidores a supervisar:",IDC_STATIC,12,95,112,8 -END - -IDD_SUBSET_LOADSAVE DIALOGEX 0, 0, 280, 145 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | - WS_CAPTION | WS_SYSMENU -CAPTION "(título definido en el momento de la ejecución)" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "&Nombre de subconjunto:",1090,5,109,45,18,SS_NOTIFY - EDITTEXT IDC_SUBSET_NAME,54,110,165,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "&Abrir",IDOK,226,110,50,14 - PUSHBUTTON "Cance&lar",IDCANCEL,226,127,50,14 - CONTROL "List1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | - LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,272,82, - WS_EX_CLIENTEDGE - PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT - WS_TABSTOP - PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT - WS_TABSTOP - LTEXT "Subconjuntos ya definidos para esta célula:",IDC_STATIC, - 4,6,166,8 -END - -IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Buscar mandato" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - COMBOBOX IDC_FIND_COMMAND,4,38,137,170,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Visualizar a&yuda",IDOK,147,38,67,14 - PUSHBUTTON "&Cancelar",IDCANCEL,147,55,67,14 - LTEXT "Para averiguar el modo de utilizar el AFS Server Manager para efectuar una tarea, seleccione una línea de mandatos a continuación y pulse en el botón Mostrar ayuda.", - IDC_STATIC,4,4,210,25 -END - -IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 141 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Buscar código de error" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Número de &error:",IDC_STATIC,4,41,53,8 - EDITTEXT IDC_ERROR_NUMBER,59,39,78,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "&Convertir",IDC_ERROR_TRANSLATE,147,39,67,14 - PUSHBUTTON "Ce&rrar",IDCANCEL,85,123,48,14 - LTEXT "(texto definido en el momento de la ejecución)", - IDC_ERROR_DESC,4,71,210,42 - LTEXT "Para averiguar que es lo que significa un código de error, escriba el código a continuación y pulse en el botón ""Convertir"".", - IDC_STATIC,4,4,210,25 - CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 -END - -IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Acerca de AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 - LTEXT "AFS Server Manager versión 3.5",IDC_STATIC,33,8,163,8 - LTEXT "Copyright © IBM Corporation 1989, 1999",IDC_STATIC,33, - 20,183,8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 - CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 - PUSHBUTTON "Ce&rrar",IDOK,89,123,50,14 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 -END - -IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "El AFS Server Manager está buscando servidores en la célula %1...", - IDC_OPENCELL_DESC,41,15,183,16 - GROUPBOX "",IDC_STATIC,4,2,231,39 - ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 373, 136 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "Mostrar nombres de dominio totalmente calificados para los servidores (por ejemplo, ""máquina.compañía.com"")", - IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,5,363,10 - CONTROL "Mostrar un &aviso si se trabaja sin señales administrativas", - IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,19,363,10 - CONTROL "...muestra siempre las propiedades de dicho servidor", - IDC_OPT_SVR_DBL_PROP,"Button",BS_AUTORADIOBUTTON,17,50, - 253,10 - CONTROL "...muestra las propiedades del servidor sólo si el Panel de Vista rápida está abierto.", - IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON,17, - 63,341,10 - CONTROL "...siempre abre una ventana para dicho servidor", - IDC_OPT_SVR_DBL_OPEN,"Button",BS_AUTORADIOBUTTON,17,75, - 253,10 - CONTROL "...abrir una ventana de servidor hace que se supervise dicho servidor", - IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,17,107,253,10 - CONTROL "...cerrar una ventana de servidor hace que no se supervise dicho servidor", - IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,17,121,253,10 - LTEXT "Haciendo una doble pulsación en un icono de servidor...", - IDC_STATIC,5,38,363,8 - LTEXT "Si se está utilizando un subconjunto de servidor y se cierra el panel de Vista rápida...", - IDC_STATIC,5,95,363,8 -END - -IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,22,216, - 135,WS_EX_CLIENTEDGE - PUSHBUTTON "&Añadir clave de servidor",IDC_KEY_ADD,46,160,82,14 - PUSHBUTTON "&Eliminar clave de servidor",IDC_KEY_REMOVE,133,160,87, - 14 - LTEXT "Claves para servidor:",IDC_KEY_NAME,5,7,216,8 -END - -IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Añadir clave de servidor" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Versión:",IDC_STATIC,7,37,26,8 - EDITTEXT IDC_KEY_VERSION,43,35,43,14,ES_AUTOHSCROLL - LTEXT "Valor:",IDC_STATIC,7,58,21,8 - CONTROL "Cifrar esta serie:",IDC_KEY_BYSTRING,"Button", - BS_AUTORADIOBUTTON,43,58,73,10 - CONTROL "Utilizar esta clave:",IDC_KEY_BYDATA,"Button", - BS_AUTORADIOBUTTON,43,76,71,10 - EDITTEXT IDC_KEY_STRING,119,56,155,14,ES_PASSWORD | - ES_AUTOHSCROLL - EDITTEXT IDC_KEY_DATA,119,75,103,14,ES_AUTOHSCROLL - PUSHBUTTON "A&leatorio",IDC_KEY_RANDOM,226,75,48,14 - LTEXT "Aviso: después de añadir una clave nueva al servidor, debería modificar la cuenta de AFS para utilizar la clave nueva. Después de algunos días, puede eliminar las claves de servidor antiguas. ", - IDC_STATIC,7,99,267,27 - DEFPUSHBUTTON "Aceptar",IDOK,116,129,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,170,129,50,14 - PUSHBUTTON "Ayuda",9,224,129,50,14 - LTEXT "Clave nueva para servidor %1",IDC_KEY_TITLE,43,14,181,8 - ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 -END - -IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 277, 132 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Iniciar/detener servicio" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "Aceptar",IDOK,115,114,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,169,114,50,14 - PUSHBUTTON "A&yuda",9,223,114,50,14 - ICON IDI_SERVICE,IDC_STATIC,4,7,21,20 - LTEXT "Pulsar en Aceptar para iniciar/detener servicio %2 en servidor %1.", - IDC_STARTSTOP_TEXT,31,12,242,9 - CONTROL "&Permanente (IDS_START/STOPSERVICE_PERMANENT)", - IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON,37, - 68,226,10 - CONTROL "&Temporal (IDS_START/STOPSERVICE_TEMPORARY)", - IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON,37, - 83,226,10 - GROUPBOX "Inicio de servicio",IDC_STATIC,31,31,242,70 - LTEXT "Puede hacer que este cambio sea permanente, por lo que el servicio %2 (no) se iniciciará automáticamente si se reinicia el servidor %1.", - IDC_STARTSTOP_STARTUP,38,45,223,16 -END - -IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 248, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Ejecutar mandato" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Servidor:",IDC_STATIC,4,63,42,8 - COMBOBOX IDC_SERVER,50,61,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Mandato:",IDC_STATIC,4,82,42,8 - EDITTEXT IDC_COMMAND,50,80,194,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "Aceptar",IDOK,86,107,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,140,107,50,14 - PUSHBUTTON "A&yuda",9,194,107,50,14 - ICON IDI_SERVER,IDC_STATIC,4,4,21,20 - LTEXT "Ejecutar mandato en servidor",IDC_STATIC,32,12,185,8 - LTEXT "Esta operación le permite emitir un mandato en un servidor remoto.\nNormalmente se utiliza para reiniciar un servidor ejecutando el archivo de mandatos /etc/reboot.", - IDC_STATIC,4,29,240,27 -END - -IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 310, 255 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Recuperar volúmenes - AFS Server Manager" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Servidor:",IDC_STATIC,30,55,35,8 - COMBOBOX IDC_SERVER,67,53,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Partición:",IDC_STATIC,30,72,35,8 - COMBOBOX IDC_AGGREGATE,67,70,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Re&cuperar todas las particiones",IDC_AGGREGATE_ALL, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,163,72,117,10 - LTEXT "V&olumen:",IDC_STATIC,29,90,35,8 - COMBOBOX IDC_FILESET,67,88,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Rec&uperar todos los volúmenes",IDC_FILESET_ALL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,162,90,118,10 - DEFPUSHBUTTON "Aceptar",IDOK,131,108,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,188,108,50,14 - PUSHBUTTON "A&yuda",9,254,108,50,14 - PUSHBUTTON "A&vanzado >>",IDC_ADVANCED,4,108,53,14 - LTEXT "Vía de acceso para archivos &temporales:",IDC_STATIC,10, - 142,130,8 - EDITTEXT IDC_SALVAGE_TEMPDIR,145,141,144,13,ES_AUTOHSCROLL - CONTROL "Operaciones de recuperación pa&ralelas; número de procesos:", - IDC_SALVAGE_SIMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 29,157,207,10 - EDITTEXT IDC_SALVAGE_NUM,239,156,25,13,ES_AUTOHSCROLL - CONTROL "&No recuperar volúmenes dañados",IDC_SALVAGE_READONLY, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,167,194,10 - CONTROL "&Descomponer operaciones de lectura en bloques pequeños", - IDC_SALVAGE_BLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 29,177,250,10 - CONTROL "&Forzar la recuperación de todos los volúmenes indicados", - IDC_SALVAGE_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 29,187,241,10 - CONTROL "Forzar r&econstrucción de estructura de directorios", - IDC_SALVAGE_FIXDIRS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,29,197,244,10 - LTEXT "Nombre del arc&hivo para registro de resultados:", - IDC_STATIC,10,211,148,8 - EDITTEXT IDC_SALVAGE_LOG_FILE,159,210,144,13,ES_AUTOHSCROLL - CONTROL "&Incluir lista de inodos dañados en registro de resultados", - IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,30,224,226,10 - CONTROL "Incluir lista de inodos de raíz que &posee AFS en registro de resultados", - IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,30,235,267,10 - ICON IDI_SERVER,IDC_STATIC,4,7,20,20 - LTEXT "Esta operación le permite arreglar problemas en uno o más volúmenes.\n\nNota: Si recupera toda una partición o servidor a la vez, el servidor se llevará fuera de línea temporalmente.", - IDC_STATIC,33,7,254,42 - GROUPBOX "Opciones de recuperación avanzadas",IDC_ADVANCED_GROUP, - 4,129,302,122 -END - -IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Recuperar volúmenes - Resultados" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "Ce&rrar",IDOK,232,160,50,14 - LTEXT "Resultados de operación de recuperación:",IDC_STATIC,4, - 33,277,8 - EDITTEXT IDC_SALVAGE_DETAILS,4,43,277,113,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP - ICON IDI_SERVER,IDC_STATIC,4,7,21,20 - LTEXT "Volumen de recuperación %3 en partición %2 del servidor %1", - IDC_SALVAGE_TITLE,33,15,248,8 -END - -IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 289, 103 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Liberar volumen" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "Aceptar",IDOK,115,85,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,169,85,50,14 - PUSHBUTTON "A&yuda",9,235,85,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "Esta operación le permite actualizar los duplicados del volumen %3. Puede optar por actualizar sólo los duplicados obsoletos, o todos los duplicados. ", - IDC_RELSET_DESC,43,7,242,28 - CONTROL "Actualizar &sólo los duplicados de volumen que estén obsoletos", - IDC_RELSET_NORMAL,"Button",BS_AUTORADIOBUTTON,46,41,221, - 10 - CONTROL "Actualizar &todos los duplicados de volumen, aunque no estén obsoletos", - IDC_RELSET_FORCE,"Button",BS_AUTORADIOBUTTON,46,56,237, - 10 -END - -IDD_SVR_HOSTS DIALOGEX 0, 0, 246, 179 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - PUSHBUTTON "&Añadir servidor de sistema principal",IDC_HOST_ADD,6, - 160,115,14 - PUSHBUTTON "&Eliminar servidor de sistema principal", - IDC_HOST_REMOVE,123,160,118,14 - LTEXT "Servidores de sistemas principales de base de datos reconocidos por el servidor:", - IDC_HOST_TITLE,5,5,223,17 - CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,236, - 135,WS_EX_CLIENTEDGE -END - -IDD_SVR_ADDHOST DIALOGEX 0, 0, 225, 106 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "Añadir servidor de sistema principal" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "&Sistema principal:",-1,31,63,26,8 - EDITTEXT IDC_ADDHOST_HOST,61,61,103,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "Aceptar",IDOK,63,88,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,117,88,50,14 - ICON IDI_SERVER,-1,4,4,20,20 - LTEXT "Ha optado por añadir un servidor de sistema principal de base de datos a la lista que está almacenado en el servidor %1.\n\nEntre a continuación el nombre del sistema principal de base de datos nuevo.", - IDC_ADDHOST_DESC,31,10,190,48 - PUSHBUTTON "Ayuda",9,171,88,50,14 -END - -IDD_SVR_ADDRESS DIALOGEX 0, 0, 208, 115 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "Cambiar direcciones de servidor" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Direcciones IP registradas en VLDB para servidor %1:", - IDC_TITLE,4,4,200,8 - LISTBOX IDC_SVR_ADDRESSES,4,14,147,40,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "&Cambiar...",IDC_ADDR_CHANGE,154,24,50,14 - PUSHBUTTON "&Eliminar",IDC_ADDR_REMOVE,154,40,50,14 - DEFPUSHBUTTON "Aceptar",IDOK,46,97,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,100,97,50,14 - PUSHBUTTON "Ayuda",9,154,97,50,14 - LTEXT "Nota: cuando se inicia un servidor de archivos, registra automáticamente su(s) dirección(es) de IP actual(es) con VLDB.", - IDC_STATIC,4,64,200,28 -END - -IDD_SVR_NEWADDR DIALOGEX 0, 0, 223, 69 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "Cambiar dirección IP" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "Aceptar",IDOK,61,51,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,115,51,50,14 - PUSHBUTTON "Ayuda",9,169,51,50,14 - LTEXT "Entre la dirección IP nueva que debería sustituir %1 en VLDB:", - IDC_TITLE,4,4,215,8 - CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,42,23, - 90,14 - LTEXT "Dirección:",IDC_STATIC,4,26,35,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" -32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" -32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" -IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" -IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" -IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" -IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" -IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" -IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" -IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" -IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" -IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" -IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" -IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" -IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" -IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" -IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" -IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -ACCEL_MAIN ACCELERATORS DISCARDABLE -BEGIN - VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT - VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT - VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT - VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT - VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT - VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT - VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT - VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, - NOINVERT - VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT -END - - -///////////////////////////////////////////////////////////////////////////// -// -// AVI -// - -AVI_SETMOVE AVI DISCARDABLE -BEGIN - -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVR_LISTS_TITLE "Servidor %1 - Listas de administración" - IDS_TAB_SERVICES "Servicios" - IDS_TAB_AGGREGATES "Particiones" - IDS_TAB_FILESETS "Volúmenes" - IDS_SERVICE_NONESELECTED "Seleccione un servidor a visualizar." - IDS_SERVICE_GOTSELECTED "Procesos de servicio en servidor %1:" - IDS_AGGREGATE_ALL "Particiones en todos los servidores:" - IDS_AGGREGATE_ONE "Particiones en servidor %1:" - IDS_FILESET_ALL "Todos los volúmenes de la célula %1:" - IDS_FILESET_ONE "Volúmenes en servidor %1:" - IDS_SVR_LISTS_TAB "Listas de administración" - IDS_SVR_PROP_TITLE "Servidor %1 - Propiedades" - IDS_SVR_GENERAL_TAB "General" - IDS_SVR_SCOUT_TAB "Configuración" - IDS_SERVER_TITLE "Servidor %1 - AFS Server Manager" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_DESC "Servidor %1 en célula %2:" - IDS_SVC_PROP_TITLE "Servicio %2 en servidor %1 - Propiedades" - IDS_SVC_GENERAL_TAB "General" - IDS_SVC_ADD_TITLE "Crear servicio" - IDS_SVC_ADD_TAB "Crear servicio" - IDS_AGG_PROP_TITLE "Partición %2 en servidor %1 - Propiedades" - IDS_AGG_GENERAL_TAB "General" - IDS_SET_REP_TITLE "Volumen %1 - Duplicación" - IDS_SET_REPSITES_TAB "Sitios de duplicación" - IDS_SET_PROP_TITLE "Volumen %1 - Propiedades" - IDS_SET_GENERAL_TAB "General" - IDS_SET_UNLOCKBTN "Desb&loquear ahora" - IDS_SET_LOCKBTN "&Bloquear ahora" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_USAGE_FILESET "%1 utilizado de cuota de %2 (%3%%)" - IDS_USAGE_AGGREGATE "%1 utilizado de capacidad de %2 (%3%%)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGCOL_ALLOCATED "Cuota combinada" - IDS_SVRCOL_NAME "Servidor" - IDS_SVRCOL_STATUS "Estado" - IDS_SETCOL_DATE_ACCESS "Último acceso" - IDS_SETCOL_DATE_BACKUP "Última copia de seguridad" - IDS_SVCCOL_NAME "Servicio" - IDS_SVCCOL_TYPE "Tipo" - IDS_SVCCOL_PARAMS "Parámetros" - IDS_SVCCOL_STATUS "Estado" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_DATE_START "Último inicio" - IDS_SVCCOL_DATE_STOP "Última parada" - IDS_SVCCOL_DATE_STARTSTOP "Último inicio/parada" - IDS_SVCCOL_DATE_FAILED "Última anomalía" - IDS_SVCCOL_LASTERROR "Último código de salida" - IDS_AGGCOL_NAME "Partición" - IDS_AGGCOL_ID "ID" - IDS_AGGCOL_DEVICE "Dispositivo" - IDS_AGGCOL_USED "Utilizado" - IDS_AGGCOL_USED_PER "% Utilizado" - IDS_AGGCOL_FREE "Libre" - IDS_AGGCOL_TOTAL "Capacidad" - IDS_AGGCOL_STATUS "Estado" - IDS_SETCOL_NAME "Volumen" - IDS_SETCOL_TYPE "Tipo" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETCOL_DATE_CREATE "Creado" - IDS_SETCOL_DATE_UPDATE "Última actualización" - IDS_SETCOL_STATUS "Estado" - IDS_SETCOL_QUOTA_USED "Utilizado" - IDS_SETCOL_QUOTA_USED_PER "% Utilizado" - IDS_SETCOL_QUOTA_FREE "Libre" - IDS_SETCOL_QUOTA_TOTAL "Cuota" - IDS_TRYAGAINBTN "Volver &a intentar" - IDS_NO_CELL_SELECTED "(no se ha especificado ninguna célula)" - IDS_NO_AFS_ID "(no hay señales disponibles)" - IDS_AFS_ID_WILLEXP "%1 (caducarán las señales %2)" - IDS_ELAPSED_TIME "%1" - IDS_SEARCHING_FOR_SERVERS - "Espere, por favor; obteniendo información acerca de la célula %1 ..." - IDS_STATUS_NOALERTS "Normal" - IDS_TITLE_BROWSE_USER "Seleccionar usuario" - IDS_AGGTYPE_OTHER "Desconocido (%1)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATEFILESET "Creando volumen %3 en partición %1:%2" - IDS_ACTION_DELETEFILESET "Suprimiendo volumen %3 de partición %1:%2" - IDS_ACTION_MOVEFILESET "Moviendo volumen %3 a partición %1:%2" - IDS_ACTION_SETFILESETQUOTA "Cambiando la cuota para volumen %3" - IDS_SVCSTOP_DESC2 "Pulsar en Aceptar para detener este servicio." - IDS_SVCSTART_DESC2 "Pulsar en Aceptar para iniciar este servicio." - IDS_SYNCVLDB_SVR_DESC "¡Precaución!\n\nSi continúa, el AFS Server Manager modificará VLDB para se corresponda con el contenido de todas las particiones del servidor %1." - IDS_SYNCVLDB_SVR_DESC2 "Si VLDB menciona un volumen que, por cualquier motivo, no puede encontrarse en la actualidad en ninguna partición del servidor %1, se eliminará la entrada de VLDB para dicho volumen!" - IDS_SYNCVLDB_AGG_DESC "¡Precaución!\n\nSi continúa, el AFS Server Manager modificará VLDB para que se corresponda con el contenido de la partición %2 en el servidor %1." - IDS_SYNCVLDB_AGG_DESC2 "Si VLDB menciona un volumen que, por cualquier motivo, no puede encontrarse en la actualidad en esta partición, se eliminará la entrada de VLDB para dicho volumen!" - IDS_PROMPT_BROWSE_USER "Usuario:" - IDS_PREVIEWIN_BUTTON "<< &Vista preliminar" - IDS_PREVIEWOUT_BUTTON "&Vista preliminar >>" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ADMCOL_TYPE_USER "Usuario" - IDS_TITLE_BROWSE_PRINCIPAL "Seleccionar principal" - IDS_TITLE_BROWSE_OWNGROUP "Seleccionar grupo propietario" - IDS_PROMPT_BROWSE_PRINCIPAL "Principal:" - IDS_PROMPT_BROWSE_OWNGROUP "Grupo propietario" - IDS_ACTION_CLONE "Creando versión predeterminada de volumen %3" - IDS_ACTION_CLONESYS "Creando múltiples copias de seguridad de volumen" - IDS_CLONESYS_FAILED "No se ha podido crear una copia de seguridad del volumen %1 debido al error 0x%2 (%3)." - IDS_SET_UNSPECIFIED "(no especificado)" - IDS_SETCOL_ID "ID" - IDS_SETCOL_FILES "Contador de archivo" - IDS_SET_DUMP_NAME "Vuelco de %1.DMP" - IDS_ACTION_DUMP "Volcando volumen %3 (partición %1:%2)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FILESETNAME_ERROR "%1 - %2" - IDS_SETCOL_AGGREGATE "Partición" - IDS_REFRESH_DESC_CELL "El AFS Server Manager está determinando el estado de los servidores en la célula %1. Esta operación puede llevar algunos momentos..." - IDS_REFRESH_DESC_SERVER "El AFS Server Manager está determinando el estado del servidor %1. Esta operación puede llevar algunos momentos..." - IDS_REFRESH_CURRENT_CELL "En la actualidad se está examinando : célula %1" - IDS_REFRESH_CURRENT_SERVER - "En la actualidad se está examinando : servidor %2" - IDS_REFRESH_CURRENT_AGGREGATE - "En la actualidad se está examinando : partición %3 en servidor %2" - IDS_REFRESH_CURRENT_FILESET - "En la actualidad se está examinando : volumen %4 en servidor %2, partición %3" - IDS_REFRESH_CURRENT_SERVICE - "En la actualidad se está examinando : servicio %3 en servidor %2" - IDS_REFRESH_PERCENT "%1%% finalizado" - IDS_PROBLEMS "Problemas" - IDS_SERVER_NO_PROBLEMS "Este servidor no tiene problemas conocidos." - IDS_SERVICE_NO_PROBLEMS "Este servicio no tiene problemas conocidos." - IDS_AGGREGATE_NO_PROBLEMS "Esta partición no tiene problemas conocidos." - IDS_FILESET_NO_PROBLEMS "Este volumen no tiene problemas conocidos." - IDS_AGGTYPE_TYPE1 "UFS" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGTYPE_TYPE2 "LFS" - IDS_AGGTYPE_TYPE3 "AIX" - IDS_AGGTYPE_TYPE4 "VXFS" - IDS_AGGTYPE_TYPE5 "DMEPI" - IDS_REFRESH_CURRENT_VLDB - "En la actualidad se está examinando : base de datos de ubicación de volumen (VLDB)" - IDS_FILESETTYPE_RW "Leer/Grabar" - IDS_FILESETTYPE_RO "Duplicado" - IDS_FILESETTYPE_CLONE "Copia de seguridad" - IDS_MOVESET_READWRITE "Continuar hará que el volumen %3 se mueva de la partición %2 del servidor %1 a otra ubicación." - IDS_MOVESET_READONLY "Continuar hará que el duplicado de volúmenes %3 se elimine de la partición %2 del servidor %1 y que se cree otro duplicado de volumen creado en la partición especificada a continuación. " - IDS_SVC_START_TITLE "Iniciar servicio" - IDS_SVC_STOP_TITLE "Detener servicio" - IDS_SERVICESTATUS_STARTING - "Este servicio se está iniciando en la actualidad." - IDS_SERVICESTATUS_RUNNING - "El servicio se está ejecutando en la actualidad." - IDS_SERVICESTATUS_STOPPED "Este servicio está detenido en la actualidad." - IDS_SERVICESTATUS_STOPPING - "Este servicio se está deteniendo en la actualidad." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICESTATUS_UNKNOWN "El estado de este servicio es desconocido." - IDS_SVC_RESTART_BUTTON "Detener y &reiniciar ahora" - IDS_PROBLEM_BOX "Problemas conocidos (%1)" - IDS_VIEWLOG_DESC_NOFILE "El AFS Server Manager no ha podido encontrar el archivo de registro para el servicio %2 en el servidor %1. Por favor, entre a continuación la vía de acceso completa al archivo de registro de servicio." - IDS_NO_GROUP "(no hay grupo propietario)" - IDS_VIEWLOG_FROMSERVER "Registrar archivo en servidor %1" - IDS_VIEWLOG_FROMSERVICE "Registrar archivo para servicio %2 en servidor %1" - IDS_VIEWLOG_TRUNCATED "Contenido de archivo (sólo se muestran las últimas %1 líneas):" - IDS_SAVELOG_FILTER "Archivo de texto|*.TXT|" - IDS_ADVANCEDIN_BUTTON "<< &Avanzado" - IDS_ADVANCEDOUT_BUTTON "&Avanzado >>" - IDS_REPTYPE_RELEASE "Liberar duplicación" - IDS_REPTYPE_SCHEDULED "Duplicación programada" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_UPDATEALL_BUTTON "&Actualizar todo" - IDS_UPDATETHIS_BUTTON "&Actualizar" - IDS_SERVER_MULTIPLE_PROBLEMS "Este servidor tiene %1 problemas conocidos." - IDS_SERVICE_MULTIPLE_PROBLEMS - "Este servicio tiene %1 problemas conocidos." - IDS_AGGREGATE_MULTIPLE_PROBLEMS - "Esta partición tiene %1 problemas conocidos." - IDS_FILESET_MULTIPLE_PROBLEMS "Este volumen tiene %1 problemas conocidos." - IDS_FILESETTYPE_RO_STAGE "Duplicado" - IDS_SERVICETYPE_SIMPLE_LONG "Sencillo (se ejecuta de modo continuo)" - IDS_SERVICETYPE_CRON_LONG "Cron (se ejecuta a intervalos especificados)" - IDS_QUOTAUNITS_KB "Kb" - IDS_QUOTAUNITS_MB "Mb" - IDS_NO_QUOTA_REPLICA "(este volumen es un duplicado y por tanto no tiene cuota)" - IDS_NO_QUOTA_CLONE "(este volumen es una copia de seguridad y por tanto no tiene cuota)" - IDS_USAGE_REPLICA "%1 utilizado" - IDS_USAGE_CLONE "%1 utilizado" - IDS_COL_AGGS_MOVE "particiones al crear un volumen" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_SERVICE "%1:%2" - IDS_SERVICETYPE_SIMPLE "Sencillo" - IDS_SERVICETYPE_CRON "Cron" - IDS_SERVICESTATE_STOPPED "Detenido" - IDS_SERVICESTATE_STOPPING "Deteniéndose" - IDS_SERVICESTATE_STARTING "Iniciándose" - IDS_SERVICESTATE_RUNNING "Ejecutándose" - IDS_SERVICETYPE_FS_LONG "FS (sistema de archivos)" - IDS_SERVICETYPE_FS "FS" - IDS_SERVICE_LASTERROR "%1" - IDS_SERVICES_IN_CELL "Todos los servicios de la célula %1:" - IDS_SERVICE_STARTDATE "Iniciado %1" - IDS_SERVICE_STOPDATE "Detenido %1" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_PERCENTAGE "%1 %%" - IDS_AGGREGATES_IN_SERVER "Particiones en servidor %1:" - IDS_AGGREGATES_IN_CELL "Todas las particiones de la célula %1:" - IDS_AGGREGATES_IN_NOTHING "Particiones:" - IDS_FILESETS_IN_SERVER "Volúmenes en servidor %1:" - IDS_FILESETS_IN_CELL "Todos los volúmenes de la célula %1:" - IDS_FILESETS_IN_NOTHING "Volúmenes:" - IDS_SERVICES_IN_SERVER "Servicios en servidor %1:" - IDS_SERVICES_IN_NOTHING "Servicios:" - IDS_UNKNOWN "(desconocido)" - IDS_UNKNOWN_GROUP "grupo #%1 (nombre desconocido)" - IDS_AGGFULL_WARN_OFF "El umbral por omisión (aviso inhabilitado en el servidor)" - IDS_SERVER_AGGREGATE "%1:%2" - IDS_SERVERNAME_ERROR "%1 - %2" - IDS_AGGREGATENAME_ERROR "%1 - %2" - IDS_SETFULL_WARN_OFF "El umbral por omisión (aviso inhabilitado en el servidor)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_LASTERRORDATE "%1 - Código de salida %2" - IDS_COL_SERVERS "servidores de una célula" - IDS_COL_FILESETS "volúmenes de un servidor" - IDS_COL_AGGREGATES "particiones de un servidor" - IDS_COL_SERVICES "servicios de un servidor" - IDS_COL_REPLICAS "duplicados de un volumen" - IDS_COLUMNS_TITLE "Seleccionar Mostrar columnas - AFS Server Manager" - IDS_REPCOL_SERVER "Servidor" - IDS_REPCOL_AGGREGATE "Partición" - IDS_REPCOL_DATE_UPDATE "Última actualización" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COL_AGGS_CREATE "particiones al mover un volumen" - IDS_WARN_TITLE "Precaución" - IDS_WARN_DISABLE_AUTH "Al pulsar en el botón ""Permitir no autentificados"", permitirá que principales no autentificados manipulen los servicios de este servidor. Puesto que hay muchos servicios que se ejecutan bajo la identidad de raíz, esta acción representa +" - IDS_WARN_DISABLE_AUTH2 "un defecto significativo en la seguridad del servidor.\n\n¿Está seguro de que desea efectuar este cambio?" - IDS_SVR_NO_ADDR "(no especificado)" - IDS_TITLE_BAD_CELL "Nombre de célula no reconocido" - IDS_DESC_BAD_CELL "El nombre de célula que ha entrado no se ha podido encontrar en la red.\n\nPor favor compruebe la entrada de nuevo para asegurarse de que es correcta." - IDS_AGGFULL_WARN_ON "el umbral &por omisión para este servidor (%1%% de su tamaño)" - IDS_SETFULL_WARN_ON "el umbral &por omisión para este servidor (%1%% de su tamaño)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS - "La identidad de AFS que ha entrado no está reconocida, o bien la contraseña que ha especificado es incorrecta." - IDS_CREDS_NONE "(no hay señales)" - IDS_CREDS_VALID "%2, caduca %3" - IDS_CREDS_EXPIRED "(señales caducadas %3)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGG_FILESETS "%1 (Cuota combinada: %2)" - IDS_ACTION_DESC_NONE "No hay operaciones en curso." - IDS_ACTION_DESC_ONE "La operación siguiente está actualmente en curso:" - IDS_ACTION_DESC_MULT "La operaciones siguientes están actualmente en curso:" - IDS_ACTCOL_OPERATION "Operación" - IDS_ACTCOL_ELAPSED "Tiempo transcurrido" - IDS_ACTION_REFRESH "Renovando información de célula" - IDS_ACTION_CREATESERVER "Creación de servidor %1" - IDS_ACTION_DELETESERVER "Suprimiendo servidor %1" - IDS_ACTION_GETSERVERLOGFILE - "Obtención del archivo de registro %2 desde el servidor %1" - IDS_ACTION_SETSERVERAUTH - "Cambiando restricciones de acceso para servidor %1" - IDS_ACTION_CHANGESERVERSTATUS "Cambiando propiedades del servidor %1" - IDS_ACTION_STARTSERVICE "Iniciando servicio %2 en servidor %1" - IDS_ACTION_STOPSERVICE "Deteniendo servicio %2 en servidor %1" - IDS_ACTION_RESTARTSERVICE "Reiniciando servicio %2 en servidor %1" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SYNCVLDB_SVR "Sincronizando VLDB con servidor %1" - IDS_ACTION_SYNCVLDB_AGG "Sincronizando VLDB con partición %1:%2" - IDS_ACTION_SCOUT "Comprobando si hay problemas en el servidor %1" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SETREPPARAMS "Cambiando propiedades de duplicación para volumen %3" - IDS_ACTION_CREATEREPLICA - "Creando duplicado de volumen %3 en partición %1:%2" - IDS_DELSET_REPLICA_DESC "¡Precaución!\n\nContinuar hará que se elimine el duplicado del volumen %3 en la partición %2 del servidor %1." - IDS_DELSET_CLONE_DESC "¡Precaución!\n\nContinuar hará que se elimine la copia de seguridad del volumen %3 de la partición %2 del servidor %1." - IDS_INSTALL_DESC1 "Esta operación copia un archivo de este sistema en otro. +" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_INSTALL_DESC2 "Si el archivo ya existe en el sistema de destino, se hará copia de seguridad del mismo y se le otorgará una extensión .BAK; a cualquier copia de seguridad existente se le dará una extensión .OLD y, se eliminará cualquier archivo .OLD existente." - IDS_ACTION_INSTALLFILE "Instalando el archivo %2 en el servidor %1" - IDS_ACTION_UNINSTALLFILE "Desinstalando el archivo %2 del servidor %1" - IDS_ACTION_PRUNEFILES "Podando archivos del servidor %1" - IDS_FILTER_ALLFILES "Todos los archivos|*.*|" - IDS_ACTION_RENAMEFILESET "Cambiando el nombre del volumen %1 por %2" - IDS_RECUR_DAILY "cada día" - IDS_RECUR_SUNDAY "cada domingo" - IDS_RECUR_MONDAY "cada lunes" - IDS_RECUR_TUESDAY "cada martes" - IDS_RECUR_WEDNESDAY "cada miércoles" - IDS_RECUR_THURSDAY "cada jueves" - IDS_RECUR_FRIDAY "cada viernes" - IDS_RECUR_SATURDAY "cada sábado" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATESERVICE "Creando el servicio %2 en servidor %1" - IDS_ACTION_DELETESERVICE "Suprimiendo el archivo %2 del servidor %1" - IDS_ACTION_RELEASEFILESET "Liberando el volumen %3" - IDS_ACTION_GETDATES "Obtención de fechas para el archivo %2 en el servidor %1" - IDS_LASTMODIFIED "Modificado por última vez %1" - IDS_SVR_SECURITY_TITLE "Seguridad de servidor - %1" - IDS_SVR_LIST_TAB "Administradores" - IDS_ACTION_ADMINLIST_LOAD "Obtención de administradores para servidor %1" - IDS_ACTION_ADMINLIST_SAVE - "Escribiendo administradores para el servidor %1" - IDS_ADMCOL_PRINCIPAL "Miembro" - IDS_ADMCOL_TYPE "Tipo" - IDS_ADMCOL_TYPE_GROUP "Grupo" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_RESTORE "Restaurando el volumen %1" - IDS_COL_AGGS_RESTORE "particiones al restaurar un volumen" - IDS_RESTORE_FILTER "Archivos de vuelco de volumen|*.DMP|Todos los archivos|*.*|" - IDS_SVC_BOS_TAB "BOS" - IDS_ACTION_SETRESTART "Cambiando horas de reinicio de servicio para el servidor %1" - IDS_RESTORE_CREATESET "El volumen %1 se creará en el servidor y partición especificada a continuación." - IDS_RESTORE_OVERWRITESET - "¡Precaución! El volumen %3 existe en la partición %2 del servidor %1 y si continúa se sobregrabará!" - IDS_SUBSET_TITLE_LOAD "Abrir subconjunto de servidor" - IDS_SUBSET_TITLE_SAVE "Guardar subconjunto de servidor" - IDS_BUTTON_OPEN "&Abrir" - IDS_BUTTON_SAVE "&Guardar" - IDS_SUBSET_SAVE_TITLE "Precaución" - IDS_SUBSET_SAVE_DESC "Ya hay un subconjunto de servidor con el nombre %1.\n\n¿Desea sobregrabar este subconjunto?" - IDS_SUBSET_CHANGED "%1 [MODIFICADO]" - IDS_SUBSET_TAB "Servidores supervisados" - IDS_SUBSET_DISCARD_TITLE "¿Guardar subconjunto?" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SUBSET_DISCARD_DESC "No ha guardado como subconjunto la lista de los servidores supervisados en la actualidad. Si guarda esta lista, puede utilizarla con posterioridad para proseguir la supervisión de este mismo conjunto de servidores.\n\n+" - IDS_SUBSET_DISCARD_DESC2 - "¿Desea crear un subconjunto que contenga la lista de servidores supervisados en la actualidad?" - IDS_SUBSET_NONAME "(sin título)" - IDS_SUBSET_NOSUBSET "(se están supervisando todos los servidores)" - IDS_SUBSET_SERVERSUBSET "Servidor %1" - IDS_FILESET_SOME "Volúmenes de todos los servidores supervisados en la célula %1:" - IDS_AGGREGATE_SOME "Particiones en todos los servidores supervisados en la célula %1:" - IDS_SERVICE_SOME "Servicios en todos los servidores supervisados en la célula %1:" - IDS_FILESET_UNMON "El servidor %1 no está siendo supervisado" - IDS_AGGREGATE_UNMON "El servidor %1 no está siendo supervisado" - IDS_SERVICE_UNMON "El servidor %1 no está siendo supervisado" - IDS_SUBSET_DELETE_TITLE "¿Suprimir subconjunto?" - IDS_SUBSET_DELETE_DESC "¿Está seguro de que desea suprimir el subconjunto de servidor %1?" - IDS_ERROR_TRANSLATED "Número de error 0x%1 (%2):\n\n%3" - IDS_ERROR_NOTTRANSLATED "El número de error 0x%1 (%2) no está reconocido." - IDS_FIND_NOTHING_TITLE "No hay ningún mandato seleccionado" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FIND_NOTHING_DESC "Para averiguar el modo de efectuar una operación, seleccione en primer lugar una línea de mandatos de la lista o escriba una palabra clave." - IDS_FIND_UNKNOWN_TITLE "Mandato desconocido" - IDS_FIND_UNKNOWN_DESC "El AFS Server Manager no ha podido encontrar ningún tema de ayuda para el mandato ""%1""." - IDS_HELPABOUT_DESC1 "Aviso: este programa de sistema está protegido por el copyright y tratados internacionales. +" - IDS_HELPABOUT_DESC2 "La reproducción o distribución no autorizada de este software puede dar como resultado la aplicación de graves sanciones civiles y penales y se perseguirá por todos los medios legales posibles.\n\n+" - IDS_HELPABOUT_DESC3 "AFS es una marca registrada de Transarc Corporation, una compañía de IBM." - IDS_CANT_QUIT_TITLE "AFS Server Manager" - IDS_CANT_QUIT_REBOOT "¡Precaución!\n\nEl AFS Server Manager está efectuando en la actualidad una o más operaciones. Si cierra Windows en este momento, dichas operaciones no finalizarán satisfactoriamente.\n\n¿Está seguro de que desea reiniciar Windows?" - IDS_APP_TITLE "AFS Server Manager" - IDS_ACTION_OPENCELL "Búsqueda de servidores en la célula %1" - IDS_OPTIONS_TITLE "Opciones - AFS Server Manager" - IDS_OPTIONS_GENERAL_TAB "General" - IDS_BADCREDS_DESC "A menos que inicie la sesión como administrador, es posible que no disponga de privilegios suficientes para administrar satisfactoriamente la célula %1. No disponer de suficientes privilegios de acceso puede hacer que el AFS Server Manager encuentre problemas en una célula en la que no existan dichos problemas." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CONFIRMATION_TITLE "Confirmación - AFS Server Manager" - IDS_NO_GROUP_CHECKBOX "No hay grupo propietario" - IDS_AFS_ID_DIDEXP "%1 (han caducado las señales %2)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_QUERYING "(consultando)" - IDS_ADMCOL_TYPE_FOREIGN_GROUP "Grupo exterior" - IDS_ADMCOL_TYPE_FOREIGN_USER "Usuario exterior" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_NOTIFIER "Notificador" - IDS_SVC_NONOTIFIER "(ninguno)" - IDS_SVR_KEY_TAB "Claves de servidor" - IDS_KEYNAME_NOTIME "Claves para servidor %1:" - IDS_KEYNAME_WITHTIME "Claves para servidor %1: (modificado %2):" - IDS_SVRKEY_VERSION "Versión" - IDS_SVRKEY_DATA "Valor" - IDS_SVRKEY_CHECKSUM "Suma de comprobación" - IDS_SVRKEY_DATA_UNKNOWN "(oculto)" - IDS_STARTSERVICE_TITLE "Iniciar servicio" - IDS_STOPSERVICE_TITLE "Detener servicio" - IDS_STARTSERVICE_TEXT "Pulsar en Aceptar para iniciar el servicio %2 en el servidor %1." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STOPSERVICE_TEXT "Pulsar en Aceptar para detener el servicio %2 en el servidor %1." - IDS_STARTSERVICE_STARTUP - "Puede hacer que este cambio sea permanente, por lo que el servicio %2 se iniciciará automáticamente si se reinicia el servidor %1." - IDS_STOPSERVICE_STARTUP "Puede hacer que este cambio sea permanente, por lo que el servicio %2 no se iniciciará automáticamente si se reinicia el servidor %1." - IDS_STARTSERVICE_PERMANENT - "&Permanente (iniciar servicio %2 si se reinicia el servidor %1)" - IDS_STARTSERVICE_TEMPORARY - "&Temporal (no iniciar servicio %2 si se reinicia el servidor %1)" - IDS_STOPSERVICE_PERMANENT - "&Permanente (no iniciar servicio %2 si se reinicia el servidor %1)" - IDS_STOPSERVICE_TEMPORARY - "&Temporal (iniciar servicio %2 si se reinicia el servidor %1)" - IDS_ACTION_EXECUTE "Ejecutando %2 en el servidor %1" - IDS_ACTION_SALVAGE_SVR "Recuperando todos los volúmenes en el servidor %1:" - IDS_ACTION_SALVAGE_AGG "Recuperando todos los volúmenes en la partición %1:2:" - IDS_ACTION_SALVAGE_VOL "Recuperando el volumen %3 en la partición %1:2" - IDS_SALVAGE_SVR "Recuperar todos los volúmenes en el servidor %1:" - IDS_SALVAGE_AGG "Recuperar todos los volúmenes en el servidor %1, partición %2:" - IDS_SALVAGE_SET "Recuperar el volumen %3 en el servidor %1, partición %2" - IDS_SETSTATUS_SALVAGE "Recuperando el volumen" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETSTATUS_LOCKED "El volumen está bloqueado" - IDS_SETSTATUS_NO_VOL "Falta el volumen" - IDS_SETSTATUS_BUSY "El volumen está ocupado en la actualidad" - IDS_SETSTATUS_MOVED "Se ha movido el volumen" - IDS_SVR_CAPACITY "%1" - IDS_SVR_ALLOCATION "%1 (%2%%)" - IDS_SVRCOL_ADDRESS "Dirección" - IDS_HOST_TITLE "Servidores de sistema principal de base de datos que reconoce el servidor %1:" - IDS_SVR_HOSTS_TITLE "Servidor %1 - Sistemas principales de bases de datos" - IDS_SVR_HOST_TAB "Sistemas principales de base de datos" - IDS_ACTION_HOSTLIST_LOAD - "Obtención de lista de sistemas principales desde el servidor %1" - IDS_ACTION_HOSTLIST_SAVE - "Escribiendo lista de sistemas principales en el servidor %1" - IDS_SETSTATUS_1ALERT "El volumen tiene un problema" - IDS_SETSTATUS_2ALERT "El volumen tiene %1 problemas" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CHANGEADDR "Cambiando dirección IP para el servidor %1" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_ADDSITE "vos addsite" - IDS_COMMAND_VOS_BACKUP "vos backup" - IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" - IDS_COMMAND_VOS_CREATE "vos create" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_DELENTRY "vos delentry" - IDS_COMMAND_VOS_DUMP "vos dump" - IDS_COMMAND_VOS_EXAMINE "vos examine" - IDS_COMMAND_VOS_LISTPART "vos listpart" - IDS_COMMAND_VOS_LISTVLDB "vos listvldb" - IDS_COMMAND_VOS_LISTVOL "vos listvol" - IDS_COMMAND_VOS_LOCK "vos lock" - IDS_COMMAND_VOS_MOVE "vos move" - IDS_COMMAND_VOS_PARTINFO "vos partinfo" - IDS_COMMAND_VOS_RELEASE "vos release" - IDS_COMMAND_VOS_REMOVE "vos remove" - IDS_COMMAND_VOS_REMSITE "vos remsite" - IDS_COMMAND_VOS_RENAME "vos rename" - IDS_COMMAND_VOS_RESTORE "vos restore" - IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" - IDS_COMMAND_VOS_UNLOCK "vos unlock" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" - IDS_COMMAND_VOS_ZAP "vos zap" - IDS_COMMAND_BOS_ADDHOST "bos addhost" - IDS_COMMAND_BOS_ADDKEY "bos addkey" - IDS_COMMAND_BOS_ADDUSER "bos adduser" - IDS_COMMAND_BOS_CREATE "bos create" - IDS_COMMAND_BOS_DELETE "bos delete" - IDS_COMMAND_BOS_EXEC "bos exec" - IDS_COMMAND_BOS_GETDATE "bos getdate" - IDS_COMMAND_BOS_GETLOG "bos getlog" - IDS_COMMAND_BOS_GETRESTART "bos getrestart" - IDS_COMMAND_BOS_INSTALL "bos install" - IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" - IDS_COMMAND_BOS_LISTKEYS "bos listkeys" - IDS_COMMAND_BOS_LISTUSERS "bos listusers" - IDS_COMMAND_BOS_PRUNE "bos prune" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_BOS_REMOVEHOST "bos removehost" - IDS_COMMAND_BOS_REMOVEKEY "bos removekey" - IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" - IDS_COMMAND_BOS_RESTART "bos restart" - IDS_COMMAND_BOS_SALVAGE "bos salvage" - IDS_COMMAND_BOS_SETAUTH "bos setauth" - IDS_COMMAND_BOS_SETRESTART "bos setrestart" - IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" - IDS_COMMAND_BOS_START "bos start" - IDS_COMMAND_BOS_STARTUP "bos startup" - IDS_COMMAND_BOS_STATUS "bos status" - IDS_COMMAND_BOS_STOP "bos stop" - IDS_COMMAND_BOS_UNINSTALL "bos uninstall" - IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" - IDS_COMMAND_FS_LISTQUOTA "fs listquota" - IDS_COMMAND_FS_QUOTA "fs quota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_FS_SETQUOTA "fs setquota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCSHORT_UNMONITORED - "No se están supervisando problemas en el servidor %1" - IDS_ALERT_DESCSHORT_TIMEOUT - "No se ha podido entrar en contacto con el servidor %1; último error: %3" - IDS_ALERT_DESCSHORT_AGG_FULL - "La utilización de la partición para %2 supera el umbral de aviso de %3%% (%4)" - IDS_ALERT_DESCSHORT_SET_FULL - "La utilización de volumen para %3 supera el umbral de aviso de %4%% (%5)" - IDS_ALERT_DESCSHORT_NO_VLDBENT - "El volumen %3 no tiene ninguna entrada de VLDB" - IDS_ALERT_DESCSHORT_NO_SVRENT_SET - "El volumen %3 tiene una entrada de VLDB pero no se ha encontrado en la partición %2 del servidor %1" - IDS_ALERT_DESCSHORT_STOPPED "Servicio %2 detenido en %3" - IDS_ALERT_DESCSHORT_NO_SVRENT_AGG - "VLDB hace referencia a la partición %2 pero no se ha encontrado en el servidor %1" - IDS_ALERT_DESCSHORT_BADCREDS - "Es posible que no tenga suficientes privilegios para administrar el servidor %1" - IDS_ALERT_DESCSHORT_AGG_ALLOC - "La cuota de volumen combinada de la partición %2 ha superado su capacidad" - IDS_ALERT_DESCSHORT_STATE_NO_VNODE - "El volumen %3 está dañado y no puede utilizarse." - IDS_ALERT_DESCSHORT_STATE_NO_SERVICE - "No hay ningún servicio que esté ejecutándose para servir el volumen %3." - IDS_ALERT_DESCSHORT_STATE_OFFLINE - "El volumen %3 está fuera de línea y no puede utilizarse." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_TIMEOUT - "No ha podido contactarse con el servidor %1. El último intento, efectuado en %2, ha dado como resultado el error ""%3""." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_AGG_FULL - "La utilización de la partición %2 en el servidor %1 supera su umbral de aviso de %3%% (%4)." - IDS_ALERT_DESCFULL_SET_FULL - "La utilización del volumen %3 (servidor %1, partición %2) supera su umbral de aviso de %4%% (%5)." - IDS_ALERT_DESCFULL_NO_VLDBENT - "El volumen %3 existe en la partición %2 del servidor %1, pero no tiene ninguna entrada de VLDB correspondiente." - IDS_ALERT_DESCFULL_NO_SVRENT_SET - "Existe una entrada de VLDB para el volumen %3, pero el volumen pero no se ha encontrado en la partición %2 del servidor %1." - IDS_ALERT_DESCFULL_STOPPED - "El servicio %2 del servidor %1 se ha detenido en %3 con código de salida %5." - IDS_ALERT_DESCFULL_NO_SVRENT_AGG - "VLDB hace referencia a volúmenes en la partición %2 del servidor %1, pero no se ha encontrado la partición. " - IDS_ALERT_DESCFULL_BADCREDS - "Es posible que el AFS Server Manager esté detectando errores que no existen en el servidor %1 debido a que no dispone de señales de AFS como administrador dentro de esta célula." - IDS_ALERT_DESCFULL_AGG_ALLOC - "La cuota combinada de volúmenes de la partición %2 del servidor %1, que totaliza %4, supera la capacidad de la partición de %3." - IDS_ALERT_DESCFULL_STATE_NO_VNODE - "El volumen %3 de la partición %2 del servidor %1 no tiene ningún Vnode asociado con el mismo. (El estado del volumen es 0x%4.)" - IDS_ALERT_DESCFULL_STATE_NO_SERVICE - "No hay ningún servicio de exportador de archivos ejecutándose en el servidor %1, por lo que no puede utilizarse el volumen %3 de la partición %2. (El estado del volumen es 0x%4.)" - IDS_ALERT_DESCFULL_STATE_OFFLINE - "El volumen %3 de la partición %2 del servidor %1 está fuera de línea y no puede utilizarse. (El estado del volumen es 0x%4.)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_TIMEOUT "Pulse en el botón Intentar de nuevo para intentar volver a contactar con este servidor." - IDS_ALERT_FIX_AGG_FULL "Pulse en el botón Avisos para cambiar el umbral de aviso para la utilización de esta partición." - IDS_ALERT_FIX_SET_FULL "Pulse en el botón Avisos para cambiar el umbral de aviso para la utilización de este volumen." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_NO_VLDBENT - "VLDB está posiblemente sin actualizar; si es así, utilice el mandato Sincronizar VLDB para actualizarlo." - IDS_ALERT_FIX_NO_SVRENT_SET - "Compruebe el servidor y la partición para asegurarse de que están funcionando de modo adecuado." - IDS_ALERT_FIX_STOPPED "Pulse en el botón Ver registro para ver el registro de servicio para este servicio." - IDS_ALERT_FIX_NO_SVRENT_AGG - "Compruebe el servidor para asegurarse de que se ha exportado la partición y de que está funcionando debidamente." - IDS_ALERT_FIX_BADCREDS "Pulse en el botón Autentificación para obtener señales de AFS nuevas." - IDS_ALERT_FIX_AGG_ALLOC "Reduzca la cuota para los volúmenes de esta partición, o mueva uno o más volúmenes a otra partición." - IDS_ALERT_FIX_STATE_NO_VNODE " " - IDS_ALERT_FIX_STATE_NO_SERVICE " " - IDS_ALERT_FIX_STATE_OFFLINE " " -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_BUTTON_TRYAGAIN "Volver &a intentar" - IDS_ALERT_BUTTON_WARNINGS "Av&isos..." - IDS_ALERT_BUTTON_VIEWLOG "&Ver registro" - IDS_ALERT_BUTTON_SHOWME "&Personalizar" - IDS_ALERT_BUTTON_GETCREDS "&Autentificación" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_CELLSERVERS_NOCELL - "No se ha especificado ninguna célula. Para utilizar el AFS Server Manager, debe especificar la célula de AFS con la que desearía trabajar. Elija una célula seleccionando el elemento ""Abrir..."" menu de ""Célula"" menu más arriba." - IDS_ERROR_REFRESH_CELLSERVERS - "No ha podido obtenerse la lista de servidores para la célula %1.\n\nError: %2" - IDS_ERROR_CANT_OPEN_CELL - "El AFS Server Manager no ha podido ponerse en contacto con ningún servidor de la célula %1.\n\nPor favor, vuelva a efectuar la comprobación para asegurarse de que ha escrito correctamente el nombre de la célula." - IDS_ERROR_REFRESH_AGGREGATES - "No ha podido obtenerse la lista de particiones para el servidor %1.\n\nError: %2" - IDS_ERROR_REFRESH_SERVER_STATUS - "No ha podido obtenerse el estado actual del servidor %1." - IDS_ERROR_CHANGE_SERVER_STATUS - "El AFS Server Manager no ha podido cambiar las propiedades para el servidor %1." - IDS_ERROR_REFRESH_AGGREGATE_STATUS - "No ha podido obtenerse el estado actual de la partición %2 en el servidor %1." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_FILESET_STATUS - "No puede obtenerse el estado actual del volumen %3 (servidor %1, partición %2)." - IDS_ERROR_REFRESH_SERVICE_STATUS - "No ha podido determinarse el estado actual del servicio %2 en el servidor %1." - IDS_ERROR_MOVE_FILESET "El AFS Server Manager no ha podido mover el volumen %3 desde la partición %2 del servidor %1 a la partición %5 en el servidor %4." - IDS_ERROR_VIEW_LOGFILE "No ha podido leerse el archivo %2 desde el servidor %1.\n\nAsegúrese de que ha entrado correctamente el nombre del archivo y de que tiene suficientes permisos para ver el archivo. " - IDS_ERROR_NOT_REPLICATED - "No se ha podido determinar el estado de duplicación del volumen %1." - IDS_ERROR_CANT_CREATE_FILESET - "El AFS Server Manager no ha podido crear el volumen %3 en la partición %2 del servidor %1." - IDS_ERROR_CANT_DELETE_FILESET - "El AFS Server Manager no ha podido suprimir el volumen %3 (partición %2 del servidor %1)." - IDS_ERROR_CANT_CREATE_VLDB_ENTRY - "El AFS Server Manager no ha podido crear una entrada VLDB para el volumen %3 en la partición %2 del servidor %1." - IDS_ERROR_CANT_SET_FILESET_QUOTA - "El AFS Server Manager no ha podido cambiar la cuota para el volumen %3 en la partición %2 del servidor %1." - IDS_ERROR_CANT_CREATE_SERVER - "El AFS Server Manager no ha podido crear la entrada de servidor solicitada en la célula %1. " - IDS_ERROR_CANT_PING_SERVER - "El AFS Server Manager no ha podido determinar la dirección IP del servidor %1." - IDS_ERROR_CANT_DELETE_SERVER - "El AFS Server Manager no ha podido suprimir el servidor %1." - IDS_ERROR_CANT_DELETE_SERVER_FILESETS - "No puede suprimirse el servidor %1 debido a que es el sistema principal de uno o más volúmenes. Un servidor sólo puede eliminarse en el caso de que no contenga ningún volumen." - IDS_ERROR_CHANGE_AGGREGATE_STATUS - "El AFS Server Manager no ha podido cambiar las propiedades de la partición %2 del servidor %1." - IDS_ERROR_CHANGE_SERVICE_STATUS - "El AFS Server Manager no ha podido cambiar las propiedades del servicio %2 en el servidor %1." - IDS_ERROR_CANT_START_SERVICE - "El AFS Server Manager no ha podido iniciar el servicio %2 en el servidor %1." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_STOP_SERVICE - "El AFS Server Manager no ha podido detener el servicio %2 en el servidor %1." - IDS_ERROR_CANT_RESTART_SERVICE - "El AFS Server Manager no ha podido detener y reiniciar el servicio %2 en el servidor %1." - IDS_ERROR_CHANGE_REPLICA_STATUS - "El AFS Server Manager no ha podido cambiar las propiedades de duplicación para el volumen %3 en la partición %2 del servidor %1." - IDS_ERROR_CANT_SYNCVLDB "El AFS Server Manager no ha podido actualizar VLDB." - IDS_ERROR_CANT_CREATE_REPLICA - "El AFS Server Manager no ha podido crear un duplicado del volumen %3 en la partición %2 del servidor %1." - IDS_ERROR_CANT_INSTALL_FILE - "El AFS Server Manager no ha podido instalar el archivo %2 en el servidor %1." - IDS_ERROR_CANT_UNINSTALL_FILE - "El AFS Server Manager no ha podido desinstalar el archivo %2 en el servidor %1." - IDS_ERROR_CANT_PRUNE_FILES - "El AFS Server Manager no ha podido eliminar los archivos solicitados del servidor %1." - IDS_ERROR_CANT_RENAME_FILESET - "El AFS Server Manager no ha podido cambiar el nombre del volumen %1 por ""%2""." - IDS_ERROR_CANT_CREATE_SERVICE - "El AFS Server Manager no ha podido crear el servicio %2 en el servidor %1." - IDS_ERROR_CANT_DELETE_SERVICE - "El AFS Server Manager no ha podido suprimir el servicio %2 del servidor %1." - IDS_ERROR_CANT_RELEASE_FILESET - "El AFS Server Manager no ha podido liberar el volumen duplicado %3." - IDS_ERROR_CANT_UPDATE_FILESET - "El AFS Server Manager no ha podido actualizar el duplicado de volumen %3 en la partición %1 del servidor %2." - IDS_ERROR_CANT_UPDATE_ALL - "El AFS Server Manager no ha podido actualizar ningún duplicado del volumen %3." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_LOAD_ADMLIST - "El AFS Server Manager no ha podido leer la lista de administradores para el servidor %1." - IDS_ERROR_CANT_LOAD_KEYLIST - "El AFS Server Manager no ha podido leer la lista de claves de servidor para el servidor %1." - IDS_ERROR_CANT_CREATE_KEY - "El AFS Server Manager no ha podido crear una clave de servidor nueva para el servidor %1." - IDS_ERROR_CANT_SAVE_ADMLIST - "El AFS Server Manager no ha podido cambiar la lista de administradores para el servidor %1." - IDS_ERROR_CANT_CLONE "El AFS Server Manager no ha podido crear una versión de copia de seguridad del volumen %3 en la partición %2 del servidor %1." - IDS_ERROR_CANT_CLONESYS "El AFS Server Manager no ha podido crear ninguno de los volúmenes de copia de seguridad solicitados." - IDS_ERROR_CANT_DUMP_FILESET - "El AFS Server Manager no ha podido volcar el contenido del volumen %3 (servidor %1, partición %2) en el archivo %4." - IDS_ERROR_CANT_RESTORE_FILESET - "El AFS Server Manager no ha podido restaurar el archivo %4 en el volumen %3 (servidor %1, partición %2)." - IDS_ERROR_CANT_SET_RESTART_TIMES - "El AFS Server Manager no ha podido cambiar las horas de reinicio para los servicios del servidor %1." - IDS_ERROR_CANT_DELETE_REPLICATED_FILESET - "El AFS Server Manager no ha podido suprimir el volumen %3 de la partición %2 del servidor %1.\n\nEl volumen %3 no puede eliminarse a menos que en primer lugar se hayan eliminado todos sus duplicados." - IDS_CMDLINE_TITLE "Error - AFS Server Manager" - IDS_CMDLINE_SYNTAX "La línea de mandatos que ha especificado para el AFS Server Manager no es válida." - IDS_CMDLINE_UNRECOGNIZED - "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nNo se reconoce el parámetro ""%1""." - IDS_CMDLINE_DUPLICATE "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nEl parámetro ""%1"" se ha especificado más de una vez." - IDS_CMDLINE_UNEXPECTVALUE - "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nNo se debe proporcionar un valor al parámetro ""%1""." - IDS_CMDLINE_MISSINGVAL "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nEl parámetro ""%1"" debe ir seguido de un valor." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CMDLINE_SUBSETNOTCELL - "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nEl parámetro ""/SUBSET"" sólo puede especificarse en el caso de que también se haya especificado el parámetro ""/CELL""." - IDS_CMDLINE_INVALIDSUBSET - "El subconjunto de servidor que ha especificado, ""%2"", no se ha definido para la célula %1." - IDS_CMDLINE_SERVERNOTCELL - "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nEl parámetro ""/SERVER"" sólo puede especificarse en el caso de que también se haya especificado el parámetro ""/CELL""." - IDS_CMDLINE_RESET_TITLE "AFS Server Manager" - IDS_CMDLINE_RESET_DESC "El AFS Server Manager ha borrado la configuración especificada." - IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE - "El AFS Server Manager no puede sincronizar VLDB con la partición %2 del servidor %1 ya que la partición no existe o no ha sido exportada.\n\nPara eliminar esta partición del servidor %1, debe eliminar la entradas de VLDB de volumen que hacen referencia a la misma." - IDS_CMDLINE_USERPASSWORD - "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nPara obtener señales de AFS nuevas, deben especificarse tanto el parámetro ""/USER"" como el parámetro ""/PASSWORD"". " - IDS_ERROR_CANT_DELETE_KEY - "El AFS Server Manager no ha podido suprimir la clave de servidor %2 del servidor %1." - IDS_ERROR_CANT_GETRANDOMKEY - "El AFS Server Manager no ha podido generar una clave aleatoria para el servidor %1." - IDS_ERROR_CANT_EXECUTE_COMMAND - "El AFS Server Manager no ha podido ejecutar el mandato siguiente en el servidor %1.\n\n ""%2""" - IDS_ERROR_CANT_READ_SALVAGE_LOG - "El AFS Server Manager ha completado la operación de recuperación de modo satisfactorio, pero no ha podido recuperar el archivo de registro que describe el resultado específico de la operación de recuperación." - IDS_ERROR_CANT_SALVAGE "El AFS Server Manager no ha podido efectuar la operación de recuperación solicitada." - IDS_ERROR_CANT_AUTH_ON "El AFS Server Manager no ha podido habilitar la comprobación de autentificación para el servidor %1." - IDS_ERROR_CANT_AUTH_OFF "El AFS Server Manager no ha podido inhabilitar la comprobación de autentificación para el servidor %1." - IDS_ERROR_CANT_LOAD_HOSTLIST - "El AFS Server Manager no ha podido leer la lista de servidores de sistema principal de base de datos del servidor %1." - IDS_ERROR_CANT_SAVE_HOSTLIST - "El AFS Server Manager no ha podido cambiar la lista de servidores de sistemas principales de base de datos en el servidor %1." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL - "El AFS Server Manager no ha podido iniciarse debido a que el AFS Control Center no se ha instalado debidamente en este sistema.\n\nEs posible que tenga que volver a instalar el AFS Control Center." - IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN - "El AFS Server Manager no ha podido iniciarse debido a un problema desconocido.\n\nEs posible que tenga que volver a instalar el AFS Control Center." - IDS_ERROR_CANT_CHANGEADDR - "El AFS Server Manager no ha podido cambiar la dirección IP en VLDB para el servidor %1." -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_SERVICES, DIALOG + BEGIN + RIGHTMARGIN, 165 + END + + IDD_AGGREGATES, DIALOG + BEGIN + RIGHTMARGIN, 118 + END + + IDD_FILESETS, DIALOG + BEGIN + RIGHTMARGIN, 180 + END + + IDD_SVR_LISTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_AGG_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 301 + TOPMARGIN, 5 + BOTTOMMARGIN, 155 + END + + IDD_SVR_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 183 + END + + IDD_SVR_SCOUT, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 261 + TOPMARGIN, 5 + BOTTOMMARGIN, 153 + END + + IDD_SVC_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 228 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 294 + TOPMARGIN, 5 + BOTTOMMARGIN, 208 + END + + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 315 + TOPMARGIN, 2 + BOTTOMMARGIN, 224 + END + + IDD_SERVER, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 207 + TOPMARGIN, 2 + BOTTOMMARGIN, 135 + END + + IDD_SVC_CREATE, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 237 + TOPMARGIN, 5 + BOTTOMMARGIN, 228 + END + + IDD_SET_REPSITES, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 216 + TOPMARGIN, 5 + BOTTOMMARGIN, 163 + END + + IDD_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 224 + TOPMARGIN, 7 + BOTTOMMARGIN, 254 + HORZGUIDE, 160 + END + + IDD_TIMEOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 232 + TOPMARGIN, 7 + BOTTOMMARGIN, 153 + END + + IDD_COLUMNS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 281 + TOPMARGIN, 5 + BOTTOMMARGIN, 143 + END + + IDD_REFRESHALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 260 + TOPMARGIN, 7 + BOTTOMMARGIN, 68 + END + + IDD_SET_CREATE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 317 + TOPMARGIN, 4 + BOTTOMMARGIN, 205 + END + + IDD_SET_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 98 + END + + IDD_SET_CLONE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 341 + TOPMARGIN, 7 + BOTTOMMARGIN, 81 + END + + IDD_SVC_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 189 + END + + IDD_SVR_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 152 + END + + IDD_AGG_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 252 + TOPMARGIN, 5 + BOTTOMMARGIN, 146 + END + + IDD_SET_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 268 + TOPMARGIN, 5 + BOTTOMMARGIN, 177 + END + + IDD_SET_MOVETO, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 170 + END + + IDD_SET_MOVING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SVC_LOGNAME, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 307 + TOPMARGIN, 4 + BOTTOMMARGIN, 102 + END + + IDD_SVC_VIEWLOG, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 181 + END + + IDD_SET_SETQUOTA, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 267 + TOPMARGIN, 4 + BOTTOMMARGIN, 126 + END + + IDD_ACTIONS, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 234 + TOPMARGIN, 2 + BOTTOMMARGIN, 56 + END + + IDD_SVR_SYNCVLDB, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 265 + TOPMARGIN, 4 + BOTTOMMARGIN, 95 + END + + IDD_SET_CREATEREP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 167 + END + + IDD_SVR_INSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 260 + TOPMARGIN, 4 + BOTTOMMARGIN, 153 + END + + IDD_SVR_UNINSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 135 + END + + IDD_SVR_PRUNE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 314 + TOPMARGIN, 4 + BOTTOMMARGIN, 129 + END + + IDD_SET_RENAME, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 129 + END + + IDD_SVC_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 64 + END + + IDD_SVR_GETDATES, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_GETDATES_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 128 + END + + IDD_SET_DUMP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 307 + TOPMARGIN, 7 + BOTTOMMARGIN, 139 + END + + IDD_SET_RESTORE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 297 + TOPMARGIN, 4 + BOTTOMMARGIN, 243 + END + + IDD_SVC_BOS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 291 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_DUMPING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SET_RESTORING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SET_CLONESYS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 326 + TOPMARGIN, 7 + BOTTOMMARGIN, 158 + END + + IDD_SUBSETS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 300 + TOPMARGIN, 5 + BOTTOMMARGIN, 178 + END + + IDD_SUBSET_LOADSAVE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 276 + TOPMARGIN, 4 + BOTTOMMARGIN, 141 + END + + IDD_HELP_FIND, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 214 + TOPMARGIN, 4 + BOTTOMMARGIN, 69 + END + + IDD_HELP_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 214 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_HELP_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 226 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_OPENINGCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 236 + TOPMARGIN, 2 + BOTTOMMARGIN, 41 + END + + IDD_OPTIONS_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 368 + TOPMARGIN, 5 + BOTTOMMARGIN, 131 + END + + IDD_SVR_KEYS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_CREATEKEY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + END + + IDD_SVC_STARTSTOP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END + + IDD_SVR_EXECUTE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_SALVAGE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 306 + TOPMARGIN, 7 + BOTTOMMARGIN, 251 + END + + IDD_SVR_SALVAGE_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 174 + END + + IDD_SET_RELEASE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 285 + TOPMARGIN, 7 + BOTTOMMARGIN, 99 + END + + IDD_SVR_HOSTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 241 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_ADDHOST, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 221 + TOPMARGIN, 4 + BOTTOMMARGIN, 102 + END + + IDD_SVR_ADDRESS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 204 + TOPMARGIN, 4 + BOTTOMMARGIN, 111 + END + + IDD_SVR_NEWADDR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 219 + TOPMARGIN, 4 + BOTTOMMARGIN, 65 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Server Manager""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_MAIN MENU DISCARDABLE +BEGIN + POPUP "&Célula" + BEGIN + MENUITEM "S&eleccionar...", M_CELL_OPEN + MENUITEM "&Autentificación...", M_CREDENTIALS + MENUITEM SEPARATOR + MENUITEM "&Salir", M_EXIT + END + POPUP "&Ver" + BEGIN + POPUP "&Servidores" + BEGIN + MENUITEM "Iconos &grandes", M_SVR_VIEW_LARGE + , CHECKED + MENUITEM "Iconos &pequeños", M_SVR_VIEW_SMALL + , CHECKED + MENUITEM "&Detalles", M_SVR_VIEW_REPORT + , CHECKED + MENUITEM SEPARATOR + MENUITEM "&Normal", M_SVR_VIEW_ONEICON + , CHECKED + MENUITEM "&Todos los iconos", M_SVR_VIEW_TWOICONS + , CHECKED + MENUITEM "Sólo &estado", M_SVR_VIEW_STATUS + , CHECKED + END + POPUP "Panel de &vista rápida" + BEGIN + MENUITEM "&Ninguno", M_DIVIDE_NONE, CHECKED + MENUITEM "Barra de división &vertical", M_DIVIDE_H, CHECKED + MENUITEM "Barra de división &horizontal", M_DIVIDE_V, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "O&peraciones en curso", M_ACTIONS, CHECKED + MENUITEM SEPARATOR + MENUITEM "Servidores s&upervisados...", M_SUBSET + MENUITEM "&Columnas...", M_COLUMNS + MENUITEM "&Opciones...", M_OPTIONS + MENUITEM SEPARATOR + MENUITEM "Ac&tualizar todo", M_REFRESHALL + END + POPUP "A&yuda" + BEGIN + MENUITEM "&Contenido", M_HELP + MENUITEM "Buscar &mandato...", M_HELP_FIND + MENUITEM "Buscar código de &error...", M_HELP_XLATE + MENUITEM SEPARATOR + MENUITEM "&Acerca de AFS Server Manager...", M_ABOUT + END +END + +MENU_AGG MENU DISCARDABLE +BEGIN + MENUITEM "&Crear volumen...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "C&opia de seguridad de volúmenes...", M_SET_CLONE + MENUITEM "&Desbloquear todos los volúmenes", M_SET_UNLOCK + MENUITEM "S&incronizar VLDB...", M_SYNCVLDB + MENUITEM "Recu&perar volúmenes...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "Ac&tualizar", M_REFRESH + MENUITEM "P&ropiedades", M_PROPERTIES +END + +MENU_SVC MENU DISCARDABLE +BEGIN + MENUITEM "&Iniciar", M_SVC_START + MENUITEM "&Detener", M_SVC_STOP + MENUITEM "R&einiciar", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "&Ver archivo de registro", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "Su&primir", M_SVC_DELETE + MENUITEM SEPARATOR + MENUITEM "Ac&tualizar", M_REFRESH + MENUITEM "P&ropiedades", M_PROPERTIES +END + +MENU_AGG_NONE MENU DISCARDABLE +BEGIN + POPUP "&Ver" + BEGIN + MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED + MENUITEM "&Todos los iconos", M_VIEW_TWOICONS, CHECKED + MENUITEM "Sólo &estado", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "&Crear volumen...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "Ac&tualizar todo", M_REFRESHALL +END + +MENU_SVC_NONE MENU DISCARDABLE +BEGIN + POPUP "&Ver" + BEGIN + MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED + MENUITEM "&Todos los iconos", M_VIEW_TWOICONS, CHECKED + MENUITEM "Sólo &estado", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "&Crear servicio...", M_SVC_CREATE + MENUITEM SEPARATOR + MENUITEM "Ac&tualizar todo", M_REFRESHALL +END + +MENU_SET MENU DISCARDABLE +BEGIN + MENUITEM "Du&plicación...", M_SET_REPLICATION + MENUITEM "Li&berar ahora", M_SET_RELEASE + MENUITEM SEPARATOR + MENUITEM "&Copia de seguridad...", M_SET_CLONE + MENUITEM "&Volcar en archivo...", M_SET_DUMP + MENUITEM "Restaurar desde arc&hivo...", M_SET_RESTORE + MENUITEM "Establecer c&uota...", M_SET_SETQUOTA + MENUITEM "R&ecuperar...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "&Mover a...", M_SET_MOVETO + MENUITEM "Cambiar &nombre...", M_SET_RENAME + MENUITEM "&Suprimir", M_SET_DELETE + MENUITEM SEPARATOR + MENUITEM "Blo&quear", M_SET_LOCK + MENUITEM "&Desbloquear", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "Ac&tualizar", M_REFRESH + MENUITEM "P&ropiedades", M_PROPERTIES +END + +MENU_SVR MENU DISCARDABLE +BEGIN + MENUITEM "&Abrir ventana de servidor", M_SVR_OPEN + MENUITEM "&Cerrar ventana de servidor", M_SVR_CLOSE + MENUITEM "&Supervisar este servidor", M_SVR_MONITOR, CHECKED + MENUITEM SEPARATOR + MENUITEM "Editar seguridad de ser&vidor...", M_SVR_SECURITY + MENUITEM "Ad&ministrar sistemas principales de base de datos...", + M_SVR_HOSTS + MENUITEM "C&opia de seguridad de seguridad de volúmenes...", M_SET_CLONE + MENUITEM "Desblo&quear todos los volúmenes", M_SET_UNLOCK + MENUITEM "Sincroni&zar VLDB...", M_SYNCVLDB + MENUITEM "Rec&uperar volúmenes...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "&Instalar archivo...", M_SVR_INSTALL + MENUITEM "&Desinstalar archivo...", M_SVR_UNINSTALL + MENUITEM "&Podar archivos antiguos...", M_SVR_PRUNE + MENUITEM SEPARATOR + MENUITEM "Obtener &fechas de archivo...", M_SVR_GETDATES + MENUITEM "Ver archivo de re&gistro...", M_VIEWLOG + MENUITEM "E&jecutar mandato...", M_EXECUTE + MENUITEM SEPARATOR + MENUITEM "Ac&tualizar", M_REFRESH + MENUITEM "P&ropiedades", M_PROPERTIES +END + +MENU_SVR_NONE MENU DISCARDABLE +BEGIN + POPUP "&Ver" + BEGIN + MENUITEM "Iconos &grandes", M_SVR_VIEW_LARGE, CHECKED + MENUITEM "Iconos &pequeños", M_SVR_VIEW_SMALL, CHECKED + MENUITEM "&Detalles", M_SVR_VIEW_REPORT, CHECKED + MENUITEM SEPARATOR + MENUITEM "&Normal", M_SVR_VIEW_ONEICON, CHECKED + MENUITEM "&Todos los iconos", M_SVR_VIEW_TWOICONS, CHECKED + MENUITEM "Sólo &estado", M_SVR_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "Servidores &supervisados...", M_SUBSET + MENUITEM SEPARATOR + MENUITEM "&Desbloquear todos los volúmenes", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "&Cerrar todo", M_SVR_CLOSEALL + MENUITEM "Ac&tualizar todo", M_REFRESHALL +END + +MENU_SET_NONE MENU DISCARDABLE +BEGIN + POPUP "&Ver" + BEGIN + MENUITEM "Por &volumen", M_SET_VIEW_REPORT, CHECKED + MENUITEM "Por &partición", M_SET_VIEW_TREELIST, CHECKED + MENUITEM "Sin &detalles", M_SET_VIEW_TREE, CHECKED + MENUITEM SEPARATOR + MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED + MENUITEM "&Todos los iconos", M_VIEW_TWOICONS, CHECKED + MENUITEM "Sólo &estado", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "&Crear volumen...", M_SET_CREATE + MENUITEM "&Restaurar desde archivo...", M_SET_RESTORE + MENUITEM SEPARATOR + MENUITEM "C&opia de seguridad de volúmenes,...", M_SET_CLONE + MENUITEM SEPARATOR + MENUITEM "&Desbloquear todo", M_SET_UNLOCK + MENUITEM "Ac&tualizar todo", M_REFRESHALL +END + +MENU_COLUMNS MENU DISCARDABLE +BEGIN + MENUITEM "&Columnas...", M_COLUMNS +END + +MENU_SVC_BOS MENU DISCARDABLE +BEGIN + MENUITEM "R&einiciar", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "&Ver archivo de registro", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "Ac&tualizar", M_REFRESH + MENUITEM "P&ropiedades", M_PROPERTIES +END + +MENU_SET_DRAGDROP MENU DISCARDABLE +BEGIN + MENUITEM "&Mover aquí...", M_SET_MOVEHERE + MENUITEM "&Duplicar aquí...", M_SET_REPHERE + MENUITEM SEPARATOR + MENUITEM "&Cancelar", IDC_STATIC +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SERVICES DIALOGEX 0, 0, 179, 92 +STYLE DS_CENTER | WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Servicios:",IDC_SVC_DESC,0,5,179,8 + CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,0,17,179, + 61,WS_EX_STATICEDGE + PUSHBUTTON "&Crear...",IDC_SVC_CREATE,56,80,39,12 + PUSHBUTTON "Su&primir",IDC_SVC_DELETE,98,80,39,12 + PUSHBUTTON "&Reiniciar",IDC_SVC_RESTART,140,80,39,12 +END + +IDD_AGGREGATES DIALOGEX 0, 0, 165, 84 +STYLE DS_CENTER | WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Particiones:",IDC_AGG_DESC,0,5,165,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,0,17,165, + 53,WS_EX_STATICEDGE + PUSHBUTTON "&Crear volumen...",IDC_AGG_CREATESET,102,72,63,12 +END + +IDD_FILESETS DIALOGEX 0, 0, 194, 92 +STYLE DS_CENTER | WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Volúmenes:",IDC_SET_DESC,0,5,194,8 + CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,0,17,194, + 61,WS_EX_STATICEDGE + PUSHBUTTON "&Crear...",IDC_SET_CREATE,4,80,34,12 + PUSHBUTTON "Su&primir",IDC_SET_DELETE,40,80,36,12 + PUSHBUTTON "&Duplicación...",IDC_SET_REP,78,80,50,12 + PUSHBUTTON "Establecer c&uota...",IDC_SET_SETQUOTA,130,80,62,12 +END + +IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, + 135,WS_EX_CLIENTEDGE + PUSHBUTTON "&Añadir administrador",IDC_LIST_ADD,66,160,71,14 + PUSHBUTTON "&Eliminar administrador",IDC_LIST_REMOVE,141,160,80,14 + LTEXT "Administradores para servidor %1:",IDC_LIST_NAME,5,7, + 216,8 +END + +IDD_AGG_GENERAL DIALOGEX 0, 0, 306, 160 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "ID:",IDC_STATIC,5,30,31,8 + LTEXT "(consultando)",IDC_AGG_ID,47,30,214,8 + LTEXT "Dispositivo:",IDC_STATIC,5,46,40,8 + LTEXT "(consultando)",IDC_AGG_DEVICE,47,46,214,8 + LTEXT "Volúmenes:",IDC_STATIC,5,62,39,8 + LTEXT "(consultando)",IDC_AGG_FILESETS,47,62,214,8 + CONTROL "Visualizar un a&viso si la cuota de volumen combinada supera la capacidad", + IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 48,76,253,10 + LTEXT "Uso:",IDC_STATIC,5,90,31,8 + LTEXT "(consultando)",IDC_AGG_USAGE,47,90,214,8 + CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,30,103,224,8, + WS_EX_STATICEDGE + CONTROL "Visualizar un a&viso si el uso de la partición supera ", + IDC_AGG_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,47, + 116,214,10 + CONTROL "el umbral &por omisión para este servidor", + IDC_AGG_WARN_AGGFULL_DEF,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,49,131,203,9 + CONTROL "un &umbral de",IDC_AGG_WARN_AGGFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,49,145,62,9 + EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,112,143,29,12, + ES_AUTOHSCROLL + LTEXT "% de su tamaño",IDC_AGG_WARN_AGGFULL_DESC,152,145,100,8 + ICON IDI_AGGREGATE,IDC_STATIC,5,5,21,20 + LTEXT "Partición %2 (servidor %1)",IDC_AGG_NAME,38,14,214,8 +END + +IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Dirección IP:",IDC_STATIC,5,29,43,8 + LISTBOX IDC_SVR_ADDRESSES,53,29,70,12,LBS_NOSEL | NOT WS_BORDER | + WS_VSCROLL + PUSHBUTTON "Cambiar &direcciones...",IDC_SVR_CHANGEADDR,144,27,77, + 12 + PUSHBUTTON "&Requerir autentificación",IDC_SVR_AUTH_YES,41,81,84,12 + PUSHBUTTON "Permitir &no autentificado",IDC_SVR_AUTH_NO,129,81,80, + 12 + LTEXT "Número de particiones",IDC_STATIC,11,131,75,8 + LTEXT "(consultando)",IDC_SVR_NUMAGGREGATES,112,131,99,8 + LTEXT "Capacidad total:",IDC_STATIC,11,148,77,8 + LTEXT "(consultando)",IDC_SVR_CAPACITY,112,147,99,8 + LTEXT "Cuota de volumen combinada:",IDC_STATIC,11,165,96,8 + LTEXT "(consultando)",IDC_SVR_ALLOCATION,112,165,99,8 + ICON IDI_SERVER,IDC_STATIC,5,5,20,20 + LTEXT "(nombre de servidor)",IDC_SVR_NAME,55,13,93,8 + GROUPBOX "Seguridad",IDC_STATIC,5,52,216,52 + GROUPBOX "Almacenamiento",IDC_STATIC,5,115,216,68 + LTEXT "Puede requerir que se autentifique el acceso a este servidor.", + IDC_STATIC,11,67,210,8 +END + +IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 266, 158 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "cualquier partición de este servidor se llena en un", + IDC_SVR_WARN_AGGFULL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,18,171,9 + EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,186,16,24,12,ES_AUTOHSCROLL + LTEXT "%",IDC_STATIC,215,18,28,8 + CONTROL "cualquier volumen de este servidor se llena en un", + IDC_SVR_WARN_SETFULL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,32,169,9 + EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,186,30,24,12,ES_AUTOHSCROLL + LTEXT "%",IDC_STATIC,215,32,44,8 + CONTROL "la cuota combinada de cualquier partición supera su capacidad", + IDC_SVR_WARN_AGGALLOC,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,46,218,9 + CONTROL "se detiene la ejecución de algún servicio de este servidor", + IDC_SVR_WARN_SVCSTOP,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,60,218,9 + CONTROL "algún volumen de este servidor carece de entrada de VLDB", + IDC_SVR_WARN_SETNOVLDB,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,74,218,9 + CONTROL "VLDB hace referencia a cualquier partición fuera de línea de este servidor", + IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,88,249,9 + CONTROL "VLDB hace referencia a cualquier volumen fuera de línea de este servidor", + IDC_SVR_WARN_SETNOSERV,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,103,249,9 + CONTROL "Actualizar información de servidor cada", + IDC_SVR_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,142,138,9 + EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,151,140,27,13,ES_AUTOHSCROLL + LTEXT "minutos",IDC_STATIC,184,142,25,8 + LTEXT "Visualizar un aviso si",IDC_STATIC,5,5,195,8 +END + +IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 233, 207 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + PUSHBUTTON "&Ver registro de servicio",IDC_SVC_VIEWLOG,34,182,78,14 + PUSHBUTTON "&Iniciar ahora",IDC_SVC_START,123,182,46,14 + PUSHBUTTON "De&tener ahora",IDC_SVC_STOP,172,182,50,14 + CONTROL "Visualizar un &aviso si se detiene el servicio", + IDC_SVC_WARNSTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 15,159,200,10 + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "Servicio %2 (servidor %1)",IDC_SVC_NAME,40,13,168,8 + LTEXT "Tipo:",IDC_STATIC,5,29,44,8 + LTEXT "(consultando)",IDC_SVC_TYPE,60,29,168,8 + LTEXT "Parámetros:",IDC_STATIC,5,45,44,8 + EDITTEXT IDC_SVC_PARAMS,60,45,168,13,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP + LTEXT "Notificador:",IDC_STATIC,5,61,44,8 + LTEXT "(consultando)",IDC_SVC_NOTIFIER,60,61,168,8 + LTEXT "Último inicio:",IDC_STATIC,5,78,42,8 + LTEXT "(consultando)",IDC_SVC_STARTDATE,60,77,168,8 + LTEXT "Última parada:",IDC_STATIC,5,93,47,8 + LTEXT "(consultando)",IDC_SVC_STOPDATE,60,93,168,8 + LTEXT "Última anomalía:",IDC_STATIC,5,109,53,8 + EDITTEXT IDC_SVC_LASTERROR,60,109,168,13,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + GROUPBOX "Estado de servicio",IDC_STATIC,5,127,223,75 + LTEXT "El estado actual de este servicio se está determinando...", + IDC_SVC_STATUS,11,142,200,8 +END + +IDD_SET_GENERAL DIALOGEX 0, 0, 299, 214 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "ID de volumen:",IDC_STATIC,5,30,52,8 + LTEXT "(desconocido)",IDC_SET_ID,73,30,219,8 + LTEXT "Creado:",IDC_STATIC,5,46,39,8 + LTEXT "(consultando)",IDC_SET_CREATEDATE,73,46,219,8 + LTEXT "Actualizado:",IDC_STATIC,5,62,39,8 + LTEXT "(consultando)",IDC_SET_UPDATEDATE,73,62,112,8 + LTEXT "Accedido:",IDC_STATIC,5,78,39,8 + LTEXT "(consultando)",IDC_SET_ACCESSDATE,73,78,219,8 + LTEXT "Copia de seguridad:",IDC_STATIC,5,94,65,8 + LTEXT "(consultando)",IDC_SET_BACKUPDATE,73,94,219,8 + LTEXT "Cuenta de archivos:",IDC_STATIC,5,110,67,8 + LTEXT "(consultando)",IDC_SET_FILES,73,110,219,8 + LTEXT "Estado",IDC_STATIC,5,126,26,8 + LTEXT "(consultando)",IDC_SET_STATUS,73,126,115,8 + PUSHBUTTON "&Bloquear",IDC_SET_LOCK,191,124,49,12 + PUSHBUTTON "&Desbloquear",IDC_SET_UNLOCK,245,124,49,12 + LTEXT "Uso:",IDC_STATIC,5,142,31,8 + LTEXT "(consultando)",IDC_SET_USAGE,73,142,136,8 + PUSHBUTTON "&Establecer cuota...",IDC_SET_QUOTA,229,140,65,12 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,75,156,219,8, + WS_EX_STATICEDGE + CONTROL "&Visualizar un aviso si el uso de este volumen supera", + IDC_SET_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20, + 170,219,10 + CONTROL "el umbral por &omisión para este servidor (%1%% de su tamaño)", + IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,39,185,207,9 + CONTROL "un &umbral de",IDC_SET_WARN_SETFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,39,199,62,9 + EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,102,196,29,12, + ES_AUTOHSCROLL + LTEXT "% de su tamaño",IDC_SET_WARN_SETFULL_DESC,139,199,105,8 + ICON IDI_FILESET,IDC_STATIC,5,5,21,20 + LTEXT "Volumen %3 (servidor %1, partición %2)",IDC_SET_NAME,75, + 14,219,8 +END + +IDD_MAIN DIALOGEX 0, 0, 317, 226 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | + WS_SYSMENU | WS_THICKFRAME +CAPTION "AFS Server Manager" +MENU MENU_MAIN +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Célula seleccionada:",IDC_STATIC,2,8,69,8 + LTEXT "(el nombre de célula se colocará aquí)",IDC_CELL,73,8, + 208,9 + LTEXT "Señales de AFS:",IDC_STATIC,2,19,55,8 + LTEXT "%2:%1 (caducarán las señales %3)",IDC_AFS_ID,74,19,208, + 9 + CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,31,313, + 193,WS_EX_CLIENTEDGE + CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 + ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 +STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Servidor" +CLASS "ServerWindowClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_TABS,"SysTabControl32",0x0,2,2,205,133 +END + +IDD_SVC_CREATE DIALOGEX 0, 0, 242, 233 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "&Servidor:",IDC_STATIC,5,36,44,8 + COMBOBOX IDC_SVC_SERVER,69,33,116,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Ser&vicio:",IDC_STATIC,5,52,44,8 + COMBOBOX IDC_SVC_NAME,69,50,116,104,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Mandato:",IDC_STATIC,5,70,44,8 + EDITTEXT IDC_SVC_COMMAND,69,68,168,13,ES_AUTOHSCROLL + LTEXT "&Parámetros:",IDC_STATIC,5,88,44,8 + EDITTEXT IDC_SVC_PARAMS,69,86,168,13,ES_AUTOHSCROLL + LTEXT "&Notificador:",IDC_STATIC,5,105,44,8 + EDITTEXT IDC_SVC_NOTIFIER,69,103,168,13,ES_AUTOHSCROLL + LTEXT "Archivo de ®istro:",IDC_STATIC,5,122,63,8 + EDITTEXT IDC_SVC_LOGFILE,69,120,168,13,ES_AUTOHSCROLL + CONTROL "S&encillo (se ejecuta de modo continuo)", + IDC_SVC_TYPE_SIMPLE,"Button",BS_AUTORADIOBUTTON,11,154, + 201,10 + CONTROL "Iniciar este servicio a&hora",IDC_SVC_RUNNOW,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 + CONTROL "&FS (sistema de archivos)",IDC_SVC_TYPE_FS,"Button", + BS_AUTORADIOBUTTON,11,180,201,10 + CONTROL "&Cron (se ejecuta a intervalos especificados)", + IDC_SVC_TYPE_CRON,"Button",BS_AUTORADIOBUTTON,11,195,201, + 10 + LTEXT "C&uándo ejecutar:",IDC_STATIC,23,209,56,8 + COMBOBOX IDC_SVC_RUNDAY,84,207,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "a las",IDC_STATIC,157,209,18,8 + CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,178,207, + 53,13,WS_EX_CLIENTEDGE + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "Servicio nuevo",IDC_SVC_DESC,39,13,168,8 + GROUPBOX "Tipo de servicio",IDC_STATIC,5,141,232,87 +END + +IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, + 199,58,WS_EX_CLIENTEDGE + PUSHBUTTON "&Liberar ahora",IDC_SET_RELEASE,11,143,52,14 + PUSHBUTTON "&Crear...",IDC_SET_REPSITE_ADD,129,143,38,14 + PUSHBUTTON "Su&primir",IDC_SET_REPSITE_DELETE,172,143,38,14 + LTEXT "Servidor:",-1,11,31,37,8 + LTEXT "(nombre de servidor)",IDC_SET_SERVER,55,31,147,8 + LTEXT "Partición:",-1,11,44,37,8 + LTEXT "(nombre de partición)",IDC_SET_AGGREGATE,55,44,147,8 + LTEXT "Volumen:",-1,11,18,37,8 + LTEXT "(nombre de volumen)",IDC_SET_NAME,55,18,147,8 + GROUPBOX "Leer/Grabar volumen",-1,5,5,211,56 + GROUPBOX "Duplicados de volumen",-1,5,67,211,96 +END + +IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 228, 258 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Seleccionar célula - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Célula:",IDC_STATIC,4,24,27,8 + COMBOBOX IDC_OPENCELL_CELL,33,22,191,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + GROUPBOX "Autentificación de AFS",IDC_STATIC,4,44,220,92 + LTEXT "&Identidad de AFS:",IDC_STATIC,22,104,60,8 + EDITTEXT IDC_OPENCELL_ID,89,102,129,14,ES_AUTOHSCROLL + LTEXT "C&ontraseña de AFS:",IDC_STATIC,22,120,66,8 + EDITTEXT IDC_OPENCELL_PASSWORD,89,118,129,14,ES_PASSWORD | + ES_AUTOHSCROLL + PUSHBUTTON "A&vanzado >>",IDC_ADVANCED,4,146,53,14 + DEFPUSHBUTTON "Aceptar",IDOK,86,146,41,14 + PUSHBUTTON "Cancelar",IDCANCEL,135,146,41,14 + PUSHBUTTON "A&yuda",9,183,146,41,14 + CONTROL "Supervisar &todos los servidores de esta célula", + IDC_MON_ALL,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10, + 204,185,9 + CONTROL "&Sólo un servidor:",IDC_MON_ONE,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,10,219,110,10 + EDITTEXT IDC_MON_SERVER,137,218,83,13,ES_AUTOHSCROLL + CONTROL "Sólo los servidores del s&ubconjunto:",IDC_MON_SOME, + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10,235,126,13 + COMBOBOX IDC_MON_SUBSET,137,233,83,93,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Seleccione la célula de AFS con la que le gustaría trabajar.", + IDC_STATIC,4,7,200,8 + GROUPBOX "Supervisar servidores",IDC_ADVANCED_GROUP,4,170,220,84 + LTEXT "Para un rendimiento más rápido, puede optar por supervisar sólo un subconjunto de los servidores disponibles en esta célula.", + IDC_STATIC,10,182,206,17 + LTEXT "(consultando...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "Para administrar una célula, debe volver a entrar la contraseña de AFS:", + IDC_STATIC,10,83,204,17 + LTEXT "Las señales de AFS actuales dentro de la célula seleccionada:", + IDC_STATIC,10,57,207,8 +END + +IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Aviso - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "&Continuar esperando hasta que la tarea finalice con normalidad", + IDC_TIMEOUT_WAIT,"Button",BS_AUTORADIOBUTTON,15,87,211, + 10 + CONTROL "&Finalizar la tarea",IDC_TIMEOUT_KILL,"Button", + BS_AUTORADIOBUTTON,15,101,208,10 + DEFPUSHBUTTON "Aceptar",IDOK,93,139,50,14 + LTEXT "Tiempo transcurrido para la ejecución de la tarea:", + IDC_STATIC,4,119,160,8 + LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,169,119,29,8 + LTEXT "El AFS Server Manager ha estado esperando durante un período de tiempo inesperadamente largo a que finalizase una tarea de red.", + IDC_STATIC,4,7,228,18 + LTEXT "Puede continuar permitiendo la ejecución de la tarea (recomendado), o bien en el caso de que crea que la tarea no finalizará nunca, puede dejar que el AFS Server Manager la finalice.", + IDC_STATIC,4,30,228,26 + LTEXT "Por favor, tenga en cuenta que la tarea sigue en curso mientras se muestra esta ventana; si finaliza la tarea, esta ventana se cerrará automáticamente.", + IDC_STATIC,4,60,228,24 +END + +IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 +STYLE WS_POPUP | WS_CAPTION +CAPTION "Columnas" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Seleccione las columnas para visualizar al efectuar el listado:", + IDC_STATIC,5,7,126,18 + COMBOBOX IDC_COLUMNS,134,9,147,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Columnas disponibles:",IDC_STATIC,12,40,100,8 + LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LTEXT "Columnas para &visualizar:",IDC_STATIC,173,41,100,8 + LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Aña&dir >>",IDC_COL_INSERT,119,68,46,14 + PUSHBUTTON "<< &Eliminar",IDC_COL_DELETE,119,88,46,14 + PUSHBUTTON "Mover hacia a&rriba",IDC_COL_UP,142,122,63,14 + PUSHBUTTON "Mover hacia a&bajo",IDC_COL_DOWN,208,122,65,14 + GROUPBOX "Listar columnas",IDC_STATIC,5,25,276,118 +END + +IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 264, 72 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Actualizando - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, + 256,8 + LTEXT "0% completado",IDC_REFRESH_PERCENT,4,49,216,8 + LTEXT "",IDC_REFRESH_CURRENT,4,60,216,8 + LTEXT "Espere, por favor...",IDC_REFRESH_DESC,4,7,256,25 + PUSHBUTTON "&Omitir",IDC_REFRESH_SKIP,222,58,38,12,NOT WS_TABSTOP +END + +IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Crear volumen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "&Nombre:",IDC_STATIC,4,30,39,8 + EDITTEXT IDC_SET_NAME,46,28,116,14,ES_AUTOHSCROLL + LTEXT "&Cuota:",IDC_STATIC,4,48,39,8 + EDITTEXT IDC_SET_QUOTA,46,46,32,14,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,90,47,30,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "C&opia de seguridad:",IDC_STATIC,4,66,65,8 + CONTROL "C&rear también una versión de copia de seguridad de este volumen", + IDC_SET_CLONE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,90, + 66,224,8 + LTEXT "&Servidor:",IDC_STATIC,4,84,39,8 + COMBOBOX IDC_SET_SERVER,46,82,116,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Partición:",IDC_STATIC,4,102,39,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,46,102,271, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "Aceptar",IDOK,156,191,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,211,191,50,14 + PUSHBUTTON "A&yuda",9,267,191,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "Volumen nuevo",IDC_STATIC,46,12,170,8 +END + +IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 277, 102 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Suprimir volumen" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Cancelar",IDCANCEL,169,84,50,14 + PUSHBUTTON "Aceptar",IDOK,115,84,50,14 + PUSHBUTTON "A&yuda",9,223,84,50,14 + CONTROL "&Suprimir volumen %3 del servidor %1, partición %2", + IDC_DELSET_SERVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 46,45,227,10 + CONTROL "Suprimir entrada de &VLDB para volumen %3", + IDC_DELSET_VLDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,46, + 60,227,10 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "¡Precaución!\n\nEsta operación hará que el volumen %3 se elimine permanentemente.", + IDC_DELSET_DESC,31,7,242,33 +END + +IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Volumen de copia de seguridad - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Aceptar",IDOK,183,67,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,237,67,50,14 + PUSHBUTTON "A&yuda",9,291,67,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,21,20 + LTEXT "Una copia de seguridad de volumen actúa como una copia de sólo lectura de dicho volumen. Un volumen de leer/grabar sólo puede tener una versión de copia de seguridad. ", + IDC_STATIC,34,9,307,17 + LTEXT "Pulse en Aceptar para crear una copia de seguridad del volumen %3 en el servidor %1, partición %2. Si ya existe una copia de seguridad de este volumen, la copia de seguridad se actualizará. ", + IDC_CLONE_DESC,34,32,307,24 +END + +IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "Problemas conocidos",IDC_PROBLEM_BOX,5,36,215,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,138,120,61,12 + ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "Servicio %2 (servidor %1)",IDC_PROBLEM_TITLE,52,13,168, + 8 +END + +IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "Problemas conocidos",IDC_PROBLEM_BOX,5,36,216,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,172,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,201,49,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,136,120,61,12 + ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "%1",IDC_PROBLEM_TITLE,42,13,179,8 +END + +IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "Problemas conocidos",IDC_PROBLEM_BOX,5,35,247,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,170,119,61,12 + ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "Partición %2 (servidor %1)",IDC_PROBLEM_TITLE,38,14,214, + 8 +END + +IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "Problemas conocidos",IDC_PROBLEM_BOX,5,35,263,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,249,48,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 + ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "Volumen %3 (servidor %1, partición %2)", + IDC_PROBLEM_TITLE,49,14,219,8 +END + +IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Mover volumen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,70,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "Aceptar",IDOK,115,156,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,169,156,50,14 + PUSHBUTTON "A&yuda",9,223,156,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,21,20 + LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,242,24 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 + LTEXT "&Mover volumen a:",IDC_STATIC,4,43,116,8 +END + +IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "Moviendo volumen - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "Moviendo volumen %3 desde partición %2 en servidor %1 a partición %5 en servidor %4...", + IDC_MOVESET_DESC,4,41,229,19 +END + +IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 311, 106 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Ver archivo de registro" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Ver archivo de registro en &servidor:",IDC_STATIC,4,45, + 110,8 + COMBOBOX IDC_VIEWLOG_SERVER,115,43,126,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "&Archivo en servidor a visualizar:",IDC_STATIC,4,64,100, + 8 + EDITTEXT IDC_VIEWLOG_FILENAME,115,62,191,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "Aceptar",IDOK,199,88,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,257,88,50,14 + ICON IDI_SERVICE,IDC_STATIC,4,4,21,20 + LTEXT "Por favor, entre la vía de acceso completa del archivo de registro que desea visualizar.", + IDC_VIEWLOG_DESC,65,10,242,21 +END + +IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 286, 185 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Ver archivo de registro" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Contenido del archivo:",IDC_SVC_VIEWLOG_CONTENTS,4,41, + 277,8 + EDITTEXT IDC_VIEWLOG_TEXT,4,51,277,113,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL + PUSHBUTTON "Guardar &como...",IDC_VIEWLOG_SAVEAS,170,167,56,14 + DEFPUSHBUTTON "Ce&rrar",IDOK,231,167,50,14 + ICON IDI_SERVICE,-1,4,7,20,20 + LTEXT "Registrar archivo [para servicio %2] en servidor %1", + IDC_SVC_VIEWLOG_DESC,33,7,248,8 + LTEXT "Nombre de archivo en servidor: %1", + IDC_SVC_VIEWLOG_FILENAME,33,23,248,8 +END + +IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Establecer cuota de volumen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Cuota actual:",IDC_STATIC,4,49,47,8 + LTEXT "(desconocido)",IDC_SET_USAGE,59,49,208,8 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,59,60,208,8, + WS_EX_STATICEDGE + LTEXT "Nueva &cuota:",IDC_STATIC,4,81,47,8 + EDITTEXT IDC_SET_QUOTA,59,79,32,13,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,103,79,30,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Aceptar",IDOK,109,112,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,163,112,50,14 + PUSHBUTTON "A&yuda",9,217,112,50,14 + PUSHBUTTON "&Propiedades...",IDC_AGG_PROPERTIES,212,28,55,12 + LTEXT "Partición:",IDC_STATIC,4,30,47,8 + LTEXT "Partición %2 de servidor %1",IDC_SET_AGGREGATE,59,30, + 141,8 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "Volumen %1",IDC_SET_NAME,59,11,208,8 +END + +IDD_ACTIONS DIALOGEX 0, 0, 236, 58 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_TOOLWINDOW +CAPTION "Operaciones en curso - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "La operaciones siguientes están actualmente en curso:", + IDC_ACTION_DESC,2,2,232,8 + CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | + 0x3,2,14,232,43 +END + +IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Sincronizar VLDB" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Aceptar",IDOK,107,81,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,161,81,50,14 + PUSHBUTTON "A&yuda",9,215,81,50,14 + ICON 32515,IDC_STATIC,4,4,21,20 + LTEXT "(definido en el momento de la ejecución)",IDC_SYNC_DESC, + 37,4,228,32 + LTEXT "(definido en el momento de la ejecución)", + IDC_SYNC_DESC2,37,44,228,24 +END + +IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Duplicar volumen" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,62,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "Aceptar",IDOK,115,153,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,169,153,50,14 + PUSHBUTTON "A&yuda",9,223,153,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "Duplicado nuevo del volumen %3",IDC_SET_NAME,31,12,242, + 8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 + LTEXT "&Crear un duplicado nuevo de este volumen en:", + IDC_STATIC,4,35,149,8 +END + +IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 264, 157 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Instalar archivo" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Archivo de origen:",IDC_STATIC,4,74,63,8 + EDITTEXT IDC_FILENAME,71,72,135,14,ES_AUTOHSCROLL + PUSHBUTTON "&Examinar...",IDC_BROWSE,210,72,50,14 + LTEXT "&Servidor de destino:",IDC_STATIC,4,94,63,8 + COMBOBOX IDC_SERVER,71,92,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Nombre de destino:",IDC_STATIC,4,114,63,8 + EDITTEXT IDC_DIRECTORY,71,112,135,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "Aceptar",IDOK,86,139,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,140,139,50,14 + PUSHBUTTON "A&yuda",9,210,139,50,14 + ICON IDI_INSTALL,IDC_STATIC,4,4,21,20 + LTEXT "Instalar archivo en servidor",IDC_STATIC,32,12,127,8 + LTEXT "(texto definido en el momento de la ejecución)\n(texto definido en el momento de la ejecución)\n(texto definido en el momento de la ejecución)\n(texto definido en el momento de la ejecución)", + IDC_INSTALL_DESC,4,29,256,33 +END + +IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Desinstalar archivo" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Servidor:",IDC_STATIC,4,66,35,8 + COMBOBOX IDC_SERVER,67,64,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Archivo de destino:",IDC_STATIC,4,85,61,8 + EDITTEXT IDC_FILENAME,67,83,175,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "Aceptar",IDOK,88,121,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,141,121,50,14 + PUSHBUTTON "A&yuda",9,194,121,50,14 + ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 + LTEXT "Desinstalar archivo del servidor",IDC_STATIC,32,12,127, + 8 + LTEXT "Esta operación le permite restaurar una copia instalada con anterioridad de un archivo en un determinado servidor. Si no existe ninguna copia instalada con anterioridad del archivo seleccionado, se eliminará el archivo. ", + IDC_STATIC,4,29,240,26 +END + +IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 318, 133 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Podar archivos antiguos" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Servidor:",-1,4,56,44,8 + COMBOBOX IDC_SERVER,53,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Todos los archivos de &imagen de la memoria", + IDC_OP_DELETE_CORE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 70,73,178,10 + CONTROL "Todos los archivos .&BAK (copias de seguridad de archivo)", + IDC_OP_DELETE_BAK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 70,84,220,10 + CONTROL "Todos los archivos .&OLD (copias de seguridad de archivos más antiguos)", + IDC_OP_DELETE_OLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 70,95,243,10 + DEFPUSHBUTTON "Aceptar",IDOK,148,115,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,202,115,50,14 + PUSHBUTTON "A&yuda",9,264,115,50,14 + ICON IDI_PRUNE,-1,4,4,21,20 + LTEXT "Podar archivos antiguos del servidor",-1,32,12,128,8 + LTEXT "Esta operación elimina copias de seguridad de los archivos instalados en un determinado servidor.", + -1,4,29,310,16 + LTEXT "Archivos a suprimir:",-1,4,73,62,8 +END + +IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Cambiar nombre de volumen" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Nombre &antiguo",IDC_STATIC,31,67,54,8 + EDITTEXT IDC_RENSET_OLD,89,65,122,14,ES_AUTOHSCROLL | ES_READONLY + LTEXT "Nombre &nuevo",IDC_STATIC,31,85,55,8 + EDITTEXT IDC_RENSET_NEW,89,83,122,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "Aceptar",IDOK,115,115,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,169,115,50,14 + PUSHBUTTON "Ayuda",9,223,115,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "Para cambiar el nombre del volumen %3, entre uno nuevo. Se redenominan automáticamente el nombre de copia de seguridad del volumen y sus duplicados.\n\nPrecaución: si es un volumen montado, elimínelo y cree nuevos puntos de montaje.", + IDC_RENSET_DESC,31,7,242,48 +END + +IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 277, 68 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Suprimir servicio" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Cancelar",IDCANCEL,169,50,50,14 + PUSHBUTTON "Aceptar",IDOK,115,50,50,14 + PUSHBUTTON "Ayuda",9,223,50,50,14 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "¡Precaución!\n\nEsta operación hará que el servicio %2 se detenga y se elimine del servidor %1.", + IDC_DELSVC_DESC,31,7,242,33 +END + +IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Obtener fechas de archivo" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Servidor:",-1,4,56,42,8 + COMBOBOX IDC_SERVER,71,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Archivo a consultar:",-1,4,75,64,8 + EDITTEXT IDC_FILENAME,71,73,135,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "Aceptar",IDOK,86,107,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,140,107,50,14 + PUSHBUTTON "A&yuda",9,194,107,50,14 + ICON IDI_GETDATES,-1,4,4,20,20 + LTEXT "Obtener fechas de archivos del servidor",-1,32,12,127,8 + LTEXT "Esta operación obtiene la fecha en que se modificaron por última vez un archivo y sus copias de seguridad (si es que existen).", + -1,4,29,240,16 +END + +IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Obtener fechas de archivos - Resultados" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Servidor:",IDC_STATIC,4,30,39,8 + LTEXT "(definido en el momento de la ejecución)",IDC_SERVER,72, + 30,137,8 + LTEXT "Nombre de archivo:",IDC_STATIC,4,45,63,8 + LTEXT "(definido en el momento de la ejecución)",IDC_FILENAME, + 72,45,137,8 + LTEXT "Fecha de archivo:",IDC_STATIC,4,60,60,8 + LTEXT "(desconocida; no ha podido encontrarse el archivo)", + IDC_DATE_FILE,72,60,168,8 + LTEXT "Fecha de .BAK:",IDC_STATIC,4,75,59,8 + LTEXT "(desconocida; no ha podido encontrarse el archivo)", + IDC_DATE_BAK,72,75,167,8 + LTEXT "Fecha de .OLD:",IDC_STATIC,4,90,60,8 + LTEXT "(desconocida; no ha podido encontrarse el archivo)", + IDC_DATE_OLD,72,90,166,8 + DEFPUSHBUTTON "Ce&rrar",IDOK,99,114,50,14 + ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 + LTEXT "Obtener fechas de archivos del servidor",IDC_STATIC,32, + 12,127,8 +END + +IDD_SET_DUMP DIALOGEX 0, 0, 311, 143 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Volumen de vuelco - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Crear archivo de vuelco con el &nombre:",IDC_STATIC,4, + 42,79,18 + EDITTEXT IDC_DUMP_FILENAME,86,44,151,14,ES_AUTOHSCROLL + PUSHBUTTON "&Examinar...",IDC_DUMP_BROWSE,257,44,50,14 + CONTROL "Volcar &todo el contenido del volumen %3 (partición %1:%2)", + IDC_DUMP_FULL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10, + 78,274,10 + CONTROL "Volcar sólo los archivos que hayan cambiado &desde", + IDC_DUMP_LIMIT_TIME,"Button",BS_AUTORADIOBUTTON,10,94, + 178,10 + CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,190,93,51, + 13,WS_EX_CLIENTEDGE + CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,248,93,56, + 13,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "Aceptar",IDOK,131,125,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,185,125,50,14 + PUSHBUTTON "A&yuda",9,257,125,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,21,20 + LTEXT "Esta operación copia el contenido de un volumen en un único archivo, por lo que puede efectuarse la copia de seguridad del volumen de una manera sencilla. El contenido de los volúmenes volcados de este modo puede restaurarse con posterioridad.", + IDC_STATIC,46,7,261,33 + GROUPBOX "Parámetros de vuelco",IDC_STATIC,4,62,303,53 +END + +IDD_SET_RESTORE DIALOGEX 0, 0, 301, 247 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Restaurar volumen - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Archivo a &restaurar:",IDC_STATIC,4,33,61,8 + EDITTEXT IDC_RESTORE_FILENAME,69,30,175,14,ES_AUTOHSCROLL + PUSHBUTTON "&Examinar...",IDC_RESTORE_BROWSE,247,30,50,14 + CONTROL "Este es un archivo de vuelco &gradual", + IDC_RESTORE_INCREMENTAL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,69,46,214,10 + LTEXT "&Volumen:",IDC_STATIC,11,102,38,8 + EDITTEXT IDC_RESTORE_SETNAME,52,100,115,14,ES_AUTOHSCROLL + LTEXT "&Servidor:",IDC_STATIC,11,145,36,8 + COMBOBOX IDC_RESTORE_SERVER,53,143,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "&Partición:",IDC_STATIC,11,162,36,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,52,161,231, + 55,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "Aceptar",IDOK,128,229,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,183,229,50,14 + PUSHBUTTON "A&yuda",9,247,229,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,21,20 + LTEXT "Restaurar volumen desde archivo de vuelco",IDC_STATIC, + 33,11,224,8 + GROUPBOX "Volumen de destino",IDC_STATIC,4,63,293,160 + LTEXT "Al restaurar un volumen desde un archivo de vuelco, puede crear un volumen nuevo o sobregrabar un volumen de leer/grabar existente.", + IDC_STATIC,11,78,259,16 + LTEXT "(definido en el momento de la ejecución)\n(definido en el momento de la ejecución)", + IDC_RESTORE_CREATE,53,119,229,17 +END + +IDD_SVC_BOS DIALOGEX 0, 0, 296, 207 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "Detener y reiniciar &periódicamente todos los servicios en este servidor", + IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, + 71,231,10 + LTEXT "&Reiniciar",IDC_BOS_GENRES_DESC1,23,87,35,8 + COMBOBOX IDC_BOS_GENRES_DATE,61,84,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "&en",IDC_BOS_GENRES_DESC2,134,87,8,8 + CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,145, + 84,53,13,WS_EX_CLIENTEDGE + CONTROL "Probar periódicamente si hay &binarios nuevos en todos los servicios de este servidor", + IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, + 151,278,10 + LTEXT "Pr&obar",IDC_BOS_BINRES_DESC1,23,167,25,8 + COMBOBOX IDC_BOS_BINRES_DATE,59,164,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "e&n",IDC_BOS_BINRES_DESC2,132,167,8,8 + CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,143, + 164,53,13,WS_EX_CLIENTEDGE + ICON IDI_BOSSERVICE,IDC_STATIC,5,5,21,20 + LTEXT "Servicio %2 (servidor %1)",IDC_SVC_NAME,37,13,168,8 + GROUPBOX "Servicio BOS",IDC_STATIC,5,27,285,175 + LTEXT "El servicio BOS puede utilizarse para detener y reiniciar periódicamente todos los servicios en este servidor (incluyendo el propio servicio BOS).", + IDC_STATIC,11,45,260,18 + LTEXT "El servicio BOS también puede utilizarse para probar periódicamente todos los servicios de un servidor, deteniendo y reiniciando sólo los servicios cuyos archivos binarios se hayan actualizado.", + IDC_STATIC,11,118,263,25 +END + +IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "Volcando volumen - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "Creando archivo de vuelco %4 desde volumen %3...", + IDC_DUMPSET_DESC,4,41,229,19 +END + +IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "Restaurando volumen - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "Restaurando volumen %1 desde archivo de vuelco %2...", + IDC_RESTORESET_DESC,4,41,229,19 +END + +IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 330, 162 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Copia de seguridad de volúmenes- AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "Crear versiones de copia de seguridad de &todos los volúmenes de esta célula", + IDC_CLONE_ALL,"Button",BS_AUTORADIOBUTTON,30,53,277,10 + GROUPBOX " ",IDC_STATIC,21,77,265,60 + CONTROL "Crear &sólo copias de seguridad para los volúmenes que satisfagan los siguientes criterios:", + IDC_CLONE_SOME,"Button",BS_AUTORADIOBUTTON,30,67,293,11 + CONTROL "Sólo los volúmenes del s&ervidor:",IDC_CLONE_SVR_LIMIT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,41,87,124,10 + COMBOBOX IDC_CLONE_SVR,186,86,85,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Sólo los volúmenes de la &partición:", + IDC_CLONE_AGG_LIMIT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,41,103,128,10 + COMBOBOX IDC_CLONE_AGG,186,102,85,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Sólo los volúmenes que &comiencen por:", + IDC_CLONE_PREFIX_LIMIT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,41,120,141,10 + EDITTEXT IDC_CLONE_PREFIX,186,119,85,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "Aceptar",IDOK,154,144,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,208,144,50,14 + PUSHBUTTON "A&yuda",9,276,144,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "Un volumen actúa como una copia de sólo lectura de dicho volumen. Un volumen de leer/grabar sólo puede tener una versión de copia de seguridad.\n\nPuede crear versiones de copia de seguridad para más de un volumen a la vez.", + IDC_STATIC,30,7,244,40 +END + +IDD_SUBSETS DIALOGEX 0, 0, 305, 183 +STYLE WS_POPUP | WS_CAPTION +CAPTION "Servidores supervisados" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Nombre de subconjunto:",IDC_STATIC,12,77,79,8 + EDITTEXT IDC_SUBSET_NAME,93,75,116,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_TABSTOP + PUSHBUTTON "&Abrir...",IDC_SUBSET_LOAD,214,75,39,14 + PUSHBUTTON "&Guardar...",IDC_SUBSET_SAVE,257,75,39,14 + CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x153,12,111,193,58,WS_EX_CLIENTEDGE + PUSHBUTTON "Supervisar &todos",IDC_SUBSET_ALL,216,122,77,14 + PUSHBUTTON "No supervisar &ninguno",IDC_SUBSET_NONE,216,140,77,14 + LTEXT "Para mejorar el rendimiento al trabajar en una célula grande, puede optar por no supervisar los problemas de determinados servidores. El AFS Server Manager no mostrará los volúmenes, particiones o servicios del servidor no supervisado. ", + IDC_STATIC,5,5,295,24 + LTEXT "Puede optar por supervisar (o no supervisar) un servidor en cualquier momento. Puede crear subconjuntos de servidor para designar las listas de servidores que deben supervisarse. ", + IDC_STATIC,5,37,295,18 + GROUPBOX "Subconjunto actual",IDC_STATIC,5,64,295,114 + LTEXT "Servidores a supervisar:",IDC_STATIC,12,95,112,8 +END + +IDD_SUBSET_LOADSAVE DIALOGEX 0, 0, 280, 145 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | + WS_CAPTION | WS_SYSMENU +CAPTION "(título definido en el momento de la ejecución)" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "&Nombre de subconjunto:",1090,5,109,45,18,SS_NOTIFY + EDITTEXT IDC_SUBSET_NAME,54,110,165,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "&Abrir",IDOK,226,110,50,14 + PUSHBUTTON "Cance&lar",IDCANCEL,226,127,50,14 + CONTROL "List1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | + LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,272,82, + WS_EX_CLIENTEDGE + PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT + WS_TABSTOP + PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT + WS_TABSTOP + LTEXT "Subconjuntos ya definidos para esta célula:",IDC_STATIC, + 4,6,166,8 +END + +IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Buscar mandato" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + COMBOBOX IDC_FIND_COMMAND,4,38,137,170,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Visualizar a&yuda",IDOK,147,38,67,14 + PUSHBUTTON "&Cancelar",IDCANCEL,147,55,67,14 + LTEXT "Para averiguar el modo de utilizar el AFS Server Manager para efectuar una tarea, seleccione una línea de mandatos a continuación y pulse en el botón Mostrar ayuda.", + IDC_STATIC,4,4,210,25 +END + +IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 141 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Buscar código de error" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Número de &error:",IDC_STATIC,4,41,53,8 + EDITTEXT IDC_ERROR_NUMBER,59,39,78,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "&Convertir",IDC_ERROR_TRANSLATE,147,39,67,14 + PUSHBUTTON "Ce&rrar",IDCANCEL,85,123,48,14 + LTEXT "(texto definido en el momento de la ejecución)", + IDC_ERROR_DESC,4,71,210,42 + LTEXT "Para averiguar que es lo que significa un código de error, escriba el código a continuación y pulse en el botón ""Convertir"".", + IDC_STATIC,4,4,210,25 + CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 +END + +IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Acerca de AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 + LTEXT "AFS Server Manager versión 3.5",IDC_STATIC,33,8,163,8 + LTEXT "Copyright © IBM Corporation 1989, 1999",IDC_STATIC,33, + 20,183,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 + CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 + PUSHBUTTON "Ce&rrar",IDOK,89,123,50,14 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 +END + +IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "El AFS Server Manager está buscando servidores en la célula %1...", + IDC_OPENCELL_DESC,41,15,183,16 + GROUPBOX "",IDC_STATIC,4,2,231,39 + ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 373, 136 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "Mostrar nombres de dominio totalmente calificados para los servidores (por ejemplo, ""máquina.compañía.com"")", + IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,5,363,10 + CONTROL "Mostrar un &aviso si se trabaja sin señales administrativas", + IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,19,363,10 + CONTROL "...muestra siempre las propiedades de dicho servidor", + IDC_OPT_SVR_DBL_PROP,"Button",BS_AUTORADIOBUTTON,17,50, + 253,10 + CONTROL "...muestra las propiedades del servidor sólo si el Panel de Vista rápida está abierto.", + IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON,17, + 63,341,10 + CONTROL "...siempre abre una ventana para dicho servidor", + IDC_OPT_SVR_DBL_OPEN,"Button",BS_AUTORADIOBUTTON,17,75, + 253,10 + CONTROL "...abrir una ventana de servidor hace que se supervise dicho servidor", + IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,17,107,253,10 + CONTROL "...cerrar una ventana de servidor hace que no se supervise dicho servidor", + IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,17,121,253,10 + LTEXT "Haciendo una doble pulsación en un icono de servidor...", + IDC_STATIC,5,38,363,8 + LTEXT "Si se está utilizando un subconjunto de servidor y se cierra el panel de Vista rápida...", + IDC_STATIC,5,95,363,8 +END + +IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,22,216, + 135,WS_EX_CLIENTEDGE + PUSHBUTTON "&Añadir clave de servidor",IDC_KEY_ADD,46,160,82,14 + PUSHBUTTON "&Eliminar clave de servidor",IDC_KEY_REMOVE,133,160,87, + 14 + LTEXT "Claves para servidor:",IDC_KEY_NAME,5,7,216,8 +END + +IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Añadir clave de servidor" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Versión:",IDC_STATIC,7,37,26,8 + EDITTEXT IDC_KEY_VERSION,43,35,43,14,ES_AUTOHSCROLL + LTEXT "Valor:",IDC_STATIC,7,58,21,8 + CONTROL "Cifrar esta serie:",IDC_KEY_BYSTRING,"Button", + BS_AUTORADIOBUTTON,43,58,73,10 + CONTROL "Utilizar esta clave:",IDC_KEY_BYDATA,"Button", + BS_AUTORADIOBUTTON,43,76,71,10 + EDITTEXT IDC_KEY_STRING,119,56,155,14,ES_PASSWORD | + ES_AUTOHSCROLL + EDITTEXT IDC_KEY_DATA,119,75,103,14,ES_AUTOHSCROLL + PUSHBUTTON "A&leatorio",IDC_KEY_RANDOM,226,75,48,14 + LTEXT "Aviso: después de añadir una clave nueva al servidor, debería modificar la cuenta de AFS para utilizar la clave nueva. Después de algunos días, puede eliminar las claves de servidor antiguas. ", + IDC_STATIC,7,99,267,27 + DEFPUSHBUTTON "Aceptar",IDOK,116,129,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,170,129,50,14 + PUSHBUTTON "Ayuda",9,224,129,50,14 + LTEXT "Clave nueva para servidor %1",IDC_KEY_TITLE,43,14,181,8 + ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 +END + +IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 277, 132 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Iniciar/detener servicio" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Aceptar",IDOK,115,114,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,169,114,50,14 + PUSHBUTTON "A&yuda",9,223,114,50,14 + ICON IDI_SERVICE,IDC_STATIC,4,7,21,20 + LTEXT "Pulsar en Aceptar para iniciar/detener servicio %2 en servidor %1.", + IDC_STARTSTOP_TEXT,31,12,242,9 + CONTROL "&Permanente (IDS_START/STOPSERVICE_PERMANENT)", + IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON,37, + 68,226,10 + CONTROL "&Temporal (IDS_START/STOPSERVICE_TEMPORARY)", + IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON,37, + 83,226,10 + GROUPBOX "Inicio de servicio",IDC_STATIC,31,31,242,70 + LTEXT "Puede hacer que este cambio sea permanente, por lo que el servicio %2 (no) se iniciciará automáticamente si se reinicia el servidor %1.", + IDC_STARTSTOP_STARTUP,38,45,223,16 +END + +IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 248, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Ejecutar mandato" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Servidor:",IDC_STATIC,4,63,42,8 + COMBOBOX IDC_SERVER,50,61,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Mandato:",IDC_STATIC,4,82,42,8 + EDITTEXT IDC_COMMAND,50,80,194,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "Aceptar",IDOK,86,107,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,140,107,50,14 + PUSHBUTTON "A&yuda",9,194,107,50,14 + ICON IDI_SERVER,IDC_STATIC,4,4,21,20 + LTEXT "Ejecutar mandato en servidor",IDC_STATIC,32,12,185,8 + LTEXT "Esta operación le permite emitir un mandato en un servidor remoto.\nNormalmente se utiliza para reiniciar un servidor ejecutando el archivo de mandatos /etc/reboot.", + IDC_STATIC,4,29,240,27 +END + +IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 310, 255 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Recuperar volúmenes - AFS Server Manager" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Servidor:",IDC_STATIC,30,55,35,8 + COMBOBOX IDC_SERVER,67,53,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Partición:",IDC_STATIC,30,72,35,8 + COMBOBOX IDC_AGGREGATE,67,70,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Re&cuperar todas las particiones",IDC_AGGREGATE_ALL, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,163,72,117,10 + LTEXT "V&olumen:",IDC_STATIC,29,90,35,8 + COMBOBOX IDC_FILESET,67,88,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Rec&uperar todos los volúmenes",IDC_FILESET_ALL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,162,90,118,10 + DEFPUSHBUTTON "Aceptar",IDOK,131,108,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,188,108,50,14 + PUSHBUTTON "A&yuda",9,254,108,50,14 + PUSHBUTTON "A&vanzado >>",IDC_ADVANCED,4,108,53,14 + LTEXT "Vía de acceso para archivos &temporales:",IDC_STATIC,10, + 142,130,8 + EDITTEXT IDC_SALVAGE_TEMPDIR,145,141,144,13,ES_AUTOHSCROLL + CONTROL "Operaciones de recuperación pa&ralelas; número de procesos:", + IDC_SALVAGE_SIMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 29,157,207,10 + EDITTEXT IDC_SALVAGE_NUM,239,156,25,13,ES_AUTOHSCROLL + CONTROL "&No recuperar volúmenes dañados",IDC_SALVAGE_READONLY, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,167,194,10 + CONTROL "&Descomponer operaciones de lectura en bloques pequeños", + IDC_SALVAGE_BLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 29,177,250,10 + CONTROL "&Forzar la recuperación de todos los volúmenes indicados", + IDC_SALVAGE_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 29,187,241,10 + CONTROL "Forzar r&econstrucción de estructura de directorios", + IDC_SALVAGE_FIXDIRS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,29,197,244,10 + LTEXT "Nombre del arc&hivo para registro de resultados:", + IDC_STATIC,10,211,148,8 + EDITTEXT IDC_SALVAGE_LOG_FILE,159,210,144,13,ES_AUTOHSCROLL + CONTROL "&Incluir lista de inodos dañados en registro de resultados", + IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,30,224,226,10 + CONTROL "Incluir lista de inodos de raíz que &posee AFS en registro de resultados", + IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,30,235,267,10 + ICON IDI_SERVER,IDC_STATIC,4,7,20,20 + LTEXT "Esta operación le permite arreglar problemas en uno o más volúmenes.\n\nNota: Si recupera toda una partición o servidor a la vez, el servidor se llevará fuera de línea temporalmente.", + IDC_STATIC,33,7,254,42 + GROUPBOX "Opciones de recuperación avanzadas",IDC_ADVANCED_GROUP, + 4,129,302,122 +END + +IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Recuperar volúmenes - Resultados" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Ce&rrar",IDOK,232,160,50,14 + LTEXT "Resultados de operación de recuperación:",IDC_STATIC,4, + 33,277,8 + EDITTEXT IDC_SALVAGE_DETAILS,4,43,277,113,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP + ICON IDI_SERVER,IDC_STATIC,4,7,21,20 + LTEXT "Volumen de recuperación %3 en partición %2 del servidor %1", + IDC_SALVAGE_TITLE,33,15,248,8 +END + +IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 289, 103 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Liberar volumen" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Aceptar",IDOK,115,85,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,169,85,50,14 + PUSHBUTTON "A&yuda",9,235,85,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "Esta operación le permite actualizar los duplicados del volumen %3. Puede optar por actualizar sólo los duplicados obsoletos, o todos los duplicados. ", + IDC_RELSET_DESC,43,7,242,28 + CONTROL "Actualizar &sólo los duplicados de volumen que estén obsoletos", + IDC_RELSET_NORMAL,"Button",BS_AUTORADIOBUTTON,46,41,221, + 10 + CONTROL "Actualizar &todos los duplicados de volumen, aunque no estén obsoletos", + IDC_RELSET_FORCE,"Button",BS_AUTORADIOBUTTON,46,56,237, + 10 +END + +IDD_SVR_HOSTS DIALOGEX 0, 0, 246, 179 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + PUSHBUTTON "&Añadir servidor de sistema principal",IDC_HOST_ADD,6, + 160,115,14 + PUSHBUTTON "&Eliminar servidor de sistema principal", + IDC_HOST_REMOVE,123,160,118,14 + LTEXT "Servidores de sistemas principales de base de datos reconocidos por el servidor:", + IDC_HOST_TITLE,5,5,223,17 + CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,236, + 135,WS_EX_CLIENTEDGE +END + +IDD_SVR_ADDHOST DIALOGEX 0, 0, 225, 106 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Añadir servidor de sistema principal" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "&Sistema principal:",-1,31,63,26,8 + EDITTEXT IDC_ADDHOST_HOST,61,61,103,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "Aceptar",IDOK,63,88,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,117,88,50,14 + ICON IDI_SERVER,-1,4,4,20,20 + LTEXT "Ha optado por añadir un servidor de sistema principal de base de datos a la lista que está almacenado en el servidor %1.\n\nEntre a continuación el nombre del sistema principal de base de datos nuevo.", + IDC_ADDHOST_DESC,31,10,190,48 + PUSHBUTTON "Ayuda",9,171,88,50,14 +END + +IDD_SVR_ADDRESS DIALOGEX 0, 0, 208, 115 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Cambiar direcciones de servidor" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Direcciones IP registradas en VLDB para servidor %1:", + IDC_TITLE,4,4,200,8 + LISTBOX IDC_SVR_ADDRESSES,4,14,147,40,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "&Cambiar...",IDC_ADDR_CHANGE,154,24,50,14 + PUSHBUTTON "&Eliminar",IDC_ADDR_REMOVE,154,40,50,14 + DEFPUSHBUTTON "Aceptar",IDOK,46,97,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,100,97,50,14 + PUSHBUTTON "Ayuda",9,154,97,50,14 + LTEXT "Nota: cuando se inicia un servidor de archivos, registra automáticamente su(s) dirección(es) de IP actual(es) con VLDB.", + IDC_STATIC,4,64,200,28 +END + +IDD_SVR_NEWADDR DIALOGEX 0, 0, 223, 69 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Cambiar dirección IP" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "Aceptar",IDOK,61,51,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,115,51,50,14 + PUSHBUTTON "Ayuda",9,169,51,50,14 + LTEXT "Entre la dirección IP nueva que debería sustituir %1 en VLDB:", + IDC_TITLE,4,4,215,8 + CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,42,23, + 90,14 + LTEXT "Dirección:",IDC_STATIC,4,26,35,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" +32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" +32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" +IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" +IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" +IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" +IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" +IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" +IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" +IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" +IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" +IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" +IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" +IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" +IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" +IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" +IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" +IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +ACCEL_MAIN ACCELERATORS DISCARDABLE +BEGIN + VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT + VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT + VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT + VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT + VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT + VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT + VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT + VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, + NOINVERT + VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// AVI +// + +AVI_SETMOVE AVI DISCARDABLE +BEGIN + +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_LISTS_TITLE "Servidor %1 - Listas de administración" + IDS_TAB_SERVICES "Servicios" + IDS_TAB_AGGREGATES "Particiones" + IDS_TAB_FILESETS "Volúmenes" + IDS_SERVICE_NONESELECTED "Seleccione un servidor a visualizar." + IDS_SERVICE_GOTSELECTED "Procesos de servicio en servidor %1:" + IDS_AGGREGATE_ALL "Particiones en todos los servidores:" + IDS_AGGREGATE_ONE "Particiones en servidor %1:" + IDS_FILESET_ALL "Todos los volúmenes de la célula %1:" + IDS_FILESET_ONE "Volúmenes en servidor %1:" + IDS_SVR_LISTS_TAB "Listas de administración" + IDS_SVR_PROP_TITLE "Servidor %1 - Propiedades" + IDS_SVR_GENERAL_TAB "General" + IDS_SVR_SCOUT_TAB "Configuración" + IDS_SERVER_TITLE "Servidor %1 - AFS Server Manager" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_DESC "Servidor %1 en célula %2:" + IDS_SVC_PROP_TITLE "Servicio %2 en servidor %1 - Propiedades" + IDS_SVC_GENERAL_TAB "General" + IDS_SVC_ADD_TITLE "Crear servicio" + IDS_SVC_ADD_TAB "Crear servicio" + IDS_AGG_PROP_TITLE "Partición %2 en servidor %1 - Propiedades" + IDS_AGG_GENERAL_TAB "General" + IDS_SET_REP_TITLE "Volumen %1 - Duplicación" + IDS_SET_REPSITES_TAB "Sitios de duplicación" + IDS_SET_PROP_TITLE "Volumen %1 - Propiedades" + IDS_SET_GENERAL_TAB "General" + IDS_SET_UNLOCKBTN "Desb&loquear ahora" + IDS_SET_LOCKBTN "&Bloquear ahora" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_USAGE_FILESET "%1 utilizado de cuota de %2 (%3%%)" + IDS_USAGE_AGGREGATE "%1 utilizado de capacidad de %2 (%3%%)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGCOL_ALLOCATED "Cuota combinada" + IDS_SVRCOL_NAME "Servidor" + IDS_SVRCOL_STATUS "Estado" + IDS_SETCOL_DATE_ACCESS "Último acceso" + IDS_SETCOL_DATE_BACKUP "Última copia de seguridad" + IDS_SVCCOL_NAME "Servicio" + IDS_SVCCOL_TYPE "Tipo" + IDS_SVCCOL_PARAMS "Parámetros" + IDS_SVCCOL_STATUS "Estado" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_DATE_START "Último inicio" + IDS_SVCCOL_DATE_STOP "Última parada" + IDS_SVCCOL_DATE_STARTSTOP "Último inicio/parada" + IDS_SVCCOL_DATE_FAILED "Última anomalía" + IDS_SVCCOL_LASTERROR "Último código de salida" + IDS_AGGCOL_NAME "Partición" + IDS_AGGCOL_ID "ID" + IDS_AGGCOL_DEVICE "Dispositivo" + IDS_AGGCOL_USED "Utilizado" + IDS_AGGCOL_USED_PER "% Utilizado" + IDS_AGGCOL_FREE "Libre" + IDS_AGGCOL_TOTAL "Capacidad" + IDS_AGGCOL_STATUS "Estado" + IDS_SETCOL_NAME "Volumen" + IDS_SETCOL_TYPE "Tipo" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETCOL_DATE_CREATE "Creado" + IDS_SETCOL_DATE_UPDATE "Última actualización" + IDS_SETCOL_STATUS "Estado" + IDS_SETCOL_QUOTA_USED "Utilizado" + IDS_SETCOL_QUOTA_USED_PER "% Utilizado" + IDS_SETCOL_QUOTA_FREE "Libre" + IDS_SETCOL_QUOTA_TOTAL "Cuota" + IDS_TRYAGAINBTN "Volver &a intentar" + IDS_NO_CELL_SELECTED "(no se ha especificado ninguna célula)" + IDS_NO_AFS_ID "(no hay señales disponibles)" + IDS_AFS_ID_WILLEXP "%1 (caducarán las señales %2)" + IDS_ELAPSED_TIME "%1" + IDS_SEARCHING_FOR_SERVERS + "Espere, por favor; obteniendo información acerca de la célula %1 ..." + IDS_STATUS_NOALERTS "Normal" + IDS_TITLE_BROWSE_USER "Seleccionar usuario" + IDS_AGGTYPE_OTHER "Desconocido (%1)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATEFILESET "Creando volumen %3 en partición %1:%2" + IDS_ACTION_DELETEFILESET "Suprimiendo volumen %3 de partición %1:%2" + IDS_ACTION_MOVEFILESET "Moviendo volumen %3 a partición %1:%2" + IDS_ACTION_SETFILESETQUOTA "Cambiando la cuota para volumen %3" + IDS_SVCSTOP_DESC2 "Pulsar en Aceptar para detener este servicio." + IDS_SVCSTART_DESC2 "Pulsar en Aceptar para iniciar este servicio." + IDS_SYNCVLDB_SVR_DESC "¡Precaución!\n\nSi continúa, el AFS Server Manager modificará VLDB para se corresponda con el contenido de todas las particiones del servidor %1." + IDS_SYNCVLDB_SVR_DESC2 "Si VLDB menciona un volumen que, por cualquier motivo, no puede encontrarse en la actualidad en ninguna partición del servidor %1, se eliminará la entrada de VLDB para dicho volumen!" + IDS_SYNCVLDB_AGG_DESC "¡Precaución!\n\nSi continúa, el AFS Server Manager modificará VLDB para que se corresponda con el contenido de la partición %2 en el servidor %1." + IDS_SYNCVLDB_AGG_DESC2 "Si VLDB menciona un volumen que, por cualquier motivo, no puede encontrarse en la actualidad en esta partición, se eliminará la entrada de VLDB para dicho volumen!" + IDS_PROMPT_BROWSE_USER "Usuario:" + IDS_PREVIEWIN_BUTTON "<< &Vista preliminar" + IDS_PREVIEWOUT_BUTTON "&Vista preliminar >>" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ADMCOL_TYPE_USER "Usuario" + IDS_TITLE_BROWSE_PRINCIPAL "Seleccionar principal" + IDS_TITLE_BROWSE_OWNGROUP "Seleccionar grupo propietario" + IDS_PROMPT_BROWSE_PRINCIPAL "Principal:" + IDS_PROMPT_BROWSE_OWNGROUP "Grupo propietario" + IDS_ACTION_CLONE "Creando versión predeterminada de volumen %3" + IDS_ACTION_CLONESYS "Creando múltiples copias de seguridad de volumen" + IDS_CLONESYS_FAILED "No se ha podido crear una copia de seguridad del volumen %1 debido al error 0x%2 (%3)." + IDS_SET_UNSPECIFIED "(no especificado)" + IDS_SETCOL_ID "ID" + IDS_SETCOL_FILES "Contador de archivo" + IDS_SET_DUMP_NAME "Vuelco de %1.DMP" + IDS_ACTION_DUMP "Volcando volumen %3 (partición %1:%2)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FILESETNAME_ERROR "%1 - %2" + IDS_SETCOL_AGGREGATE "Partición" + IDS_REFRESH_DESC_CELL "El AFS Server Manager está determinando el estado de los servidores en la célula %1. Esta operación puede llevar algunos momentos..." + IDS_REFRESH_DESC_SERVER "El AFS Server Manager está determinando el estado del servidor %1. Esta operación puede llevar algunos momentos..." + IDS_REFRESH_CURRENT_CELL "En la actualidad se está examinando : célula %1" + IDS_REFRESH_CURRENT_SERVER + "En la actualidad se está examinando : servidor %2" + IDS_REFRESH_CURRENT_AGGREGATE + "En la actualidad se está examinando : partición %3 en servidor %2" + IDS_REFRESH_CURRENT_FILESET + "En la actualidad se está examinando : volumen %4 en servidor %2, partición %3" + IDS_REFRESH_CURRENT_SERVICE + "En la actualidad se está examinando : servicio %3 en servidor %2" + IDS_REFRESH_PERCENT "%1%% finalizado" + IDS_PROBLEMS "Problemas" + IDS_SERVER_NO_PROBLEMS "Este servidor no tiene problemas conocidos." + IDS_SERVICE_NO_PROBLEMS "Este servicio no tiene problemas conocidos." + IDS_AGGREGATE_NO_PROBLEMS "Esta partición no tiene problemas conocidos." + IDS_FILESET_NO_PROBLEMS "Este volumen no tiene problemas conocidos." + IDS_AGGTYPE_TYPE1 "UFS" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGTYPE_TYPE2 "LFS" + IDS_AGGTYPE_TYPE3 "AIX" + IDS_AGGTYPE_TYPE4 "VXFS" + IDS_AGGTYPE_TYPE5 "DMEPI" + IDS_REFRESH_CURRENT_VLDB + "En la actualidad se está examinando : base de datos de ubicación de volumen (VLDB)" + IDS_FILESETTYPE_RW "Leer/Grabar" + IDS_FILESETTYPE_RO "Duplicado" + IDS_FILESETTYPE_CLONE "Copia de seguridad" + IDS_MOVESET_READWRITE "Continuar hará que el volumen %3 se mueva de la partición %2 del servidor %1 a otra ubicación." + IDS_MOVESET_READONLY "Continuar hará que el duplicado de volúmenes %3 se elimine de la partición %2 del servidor %1 y que se cree otro duplicado de volumen creado en la partición especificada a continuación. " + IDS_SVC_START_TITLE "Iniciar servicio" + IDS_SVC_STOP_TITLE "Detener servicio" + IDS_SERVICESTATUS_STARTING + "Este servicio se está iniciando en la actualidad." + IDS_SERVICESTATUS_RUNNING + "El servicio se está ejecutando en la actualidad." + IDS_SERVICESTATUS_STOPPED "Este servicio está detenido en la actualidad." + IDS_SERVICESTATUS_STOPPING + "Este servicio se está deteniendo en la actualidad." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICESTATUS_UNKNOWN "El estado de este servicio es desconocido." + IDS_SVC_RESTART_BUTTON "Detener y &reiniciar ahora" + IDS_PROBLEM_BOX "Problemas conocidos (%1)" + IDS_VIEWLOG_DESC_NOFILE "El AFS Server Manager no ha podido encontrar el archivo de registro para el servicio %2 en el servidor %1. Por favor, entre a continuación la vía de acceso completa al archivo de registro de servicio." + IDS_NO_GROUP "(no hay grupo propietario)" + IDS_VIEWLOG_FROMSERVER "Registrar archivo en servidor %1" + IDS_VIEWLOG_FROMSERVICE "Registrar archivo para servicio %2 en servidor %1" + IDS_VIEWLOG_TRUNCATED "Contenido de archivo (sólo se muestran las últimas %1 líneas):" + IDS_SAVELOG_FILTER "Archivo de texto|*.TXT|" + IDS_ADVANCEDIN_BUTTON "<< &Avanzado" + IDS_ADVANCEDOUT_BUTTON "&Avanzado >>" + IDS_REPTYPE_RELEASE "Liberar duplicación" + IDS_REPTYPE_SCHEDULED "Duplicación programada" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_UPDATEALL_BUTTON "&Actualizar todo" + IDS_UPDATETHIS_BUTTON "&Actualizar" + IDS_SERVER_MULTIPLE_PROBLEMS "Este servidor tiene %1 problemas conocidos." + IDS_SERVICE_MULTIPLE_PROBLEMS + "Este servicio tiene %1 problemas conocidos." + IDS_AGGREGATE_MULTIPLE_PROBLEMS + "Esta partición tiene %1 problemas conocidos." + IDS_FILESET_MULTIPLE_PROBLEMS "Este volumen tiene %1 problemas conocidos." + IDS_FILESETTYPE_RO_STAGE "Duplicado" + IDS_SERVICETYPE_SIMPLE_LONG "Sencillo (se ejecuta de modo continuo)" + IDS_SERVICETYPE_CRON_LONG "Cron (se ejecuta a intervalos especificados)" + IDS_QUOTAUNITS_KB "Kb" + IDS_QUOTAUNITS_MB "Mb" + IDS_NO_QUOTA_REPLICA "(este volumen es un duplicado y por tanto no tiene cuota)" + IDS_NO_QUOTA_CLONE "(este volumen es una copia de seguridad y por tanto no tiene cuota)" + IDS_USAGE_REPLICA "%1 utilizado" + IDS_USAGE_CLONE "%1 utilizado" + IDS_COL_AGGS_MOVE "particiones al crear un volumen" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PERCENTAGE "%1 %%" + IDS_AGGREGATES_IN_SERVER "Particiones en servidor %1:" + IDS_AGGREGATES_IN_CELL "Todas las particiones de la célula %1:" + IDS_AGGREGATES_IN_NOTHING "Particiones:" + IDS_FILESETS_IN_SERVER "Volúmenes en servidor %1:" + IDS_FILESETS_IN_CELL "Todos los volúmenes de la célula %1:" + IDS_FILESETS_IN_NOTHING "Volúmenes:" + IDS_SERVICES_IN_SERVER "Servicios en servidor %1:" + IDS_SERVICES_IN_NOTHING "Servicios:" + IDS_UNKNOWN "(desconocido)" + IDS_UNKNOWN_GROUP "grupo #%1 (nombre desconocido)" + IDS_AGGFULL_WARN_OFF "El umbral por omisión (aviso inhabilitado en el servidor)" + IDS_SERVER_AGGREGATE "%1:%2" + IDS_SERVERNAME_ERROR "%1 - %2" + IDS_AGGREGATENAME_ERROR "%1 - %2" + IDS_SETFULL_WARN_OFF "El umbral por omisión (aviso inhabilitado en el servidor)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_LASTERRORDATE "%1 - Código de salida %2" + IDS_COL_SERVERS "servidores de una célula" + IDS_COL_FILESETS "volúmenes de un servidor" + IDS_COL_AGGREGATES "particiones de un servidor" + IDS_COL_SERVICES "servicios de un servidor" + IDS_COL_REPLICAS "duplicados de un volumen" + IDS_COLUMNS_TITLE "Seleccionar Mostrar columnas - AFS Server Manager" + IDS_REPCOL_SERVER "Servidor" + IDS_REPCOL_AGGREGATE "Partición" + IDS_REPCOL_DATE_UPDATE "Última actualización" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COL_AGGS_CREATE "particiones al mover un volumen" + IDS_WARN_TITLE "Precaución" + IDS_WARN_DISABLE_AUTH "Al pulsar en el botón ""Permitir no autentificados"", permitirá que principales no autentificados manipulen los servicios de este servidor. Puesto que hay muchos servicios que se ejecutan bajo la identidad de raíz, esta acción representa +" + IDS_WARN_DISABLE_AUTH2 "un defecto significativo en la seguridad del servidor.\n\n¿Está seguro de que desea efectuar este cambio?" + IDS_SVR_NO_ADDR "(no especificado)" + IDS_TITLE_BAD_CELL "Nombre de célula no reconocido" + IDS_DESC_BAD_CELL "El nombre de célula que ha entrado no se ha podido encontrar en la red.\n\nPor favor compruebe la entrada de nuevo para asegurarse de que es correcta." + IDS_AGGFULL_WARN_ON "el umbral &por omisión para este servidor (%1%% de su tamaño)" + IDS_SETFULL_WARN_ON "el umbral &por omisión para este servidor (%1%% de su tamaño)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_ERROR_BAD_CREDENTIALS + "La identidad de AFS que ha entrado no está reconocida, o bien la contraseña que ha especificado es incorrecta." + IDS_SVR_CREDS_NONE "(no hay señales)" + IDS_SVR_CREDS_VALID "%2, caduca %3" + IDS_SVR_CREDS_EXPIRED "(señales caducadas %3)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGG_FILESETS "%1 (Cuota combinada: %2)" + IDS_ACTION_DESC_NONE "No hay operaciones en curso." + IDS_ACTION_DESC_ONE "La operación siguiente está actualmente en curso:" + IDS_ACTION_DESC_MULT "La operaciones siguientes están actualmente en curso:" + IDS_ACTCOL_OPERATION "Operación" + IDS_ACTCOL_ELAPSED "Tiempo transcurrido" + IDS_ACTION_REFRESH "Renovando información de célula" + IDS_ACTION_CREATESERVER "Creación de servidor %1" + IDS_ACTION_DELETESERVER "Suprimiendo servidor %1" + IDS_ACTION_GETSERVERLOGFILE + "Obtención del archivo de registro %2 desde el servidor %1" + IDS_ACTION_SETSERVERAUTH + "Cambiando restricciones de acceso para servidor %1" + IDS_ACTION_CHANGESERVERSTATUS "Cambiando propiedades del servidor %1" + IDS_ACTION_STARTSERVICE "Iniciando servicio %2 en servidor %1" + IDS_ACTION_STOPSERVICE "Deteniendo servicio %2 en servidor %1" + IDS_ACTION_RESTARTSERVICE "Reiniciando servicio %2 en servidor %1" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SYNCVLDB_SVR "Sincronizando VLDB con servidor %1" + IDS_ACTION_SYNCVLDB_AGG "Sincronizando VLDB con partición %1:%2" + IDS_ACTION_SCOUT "Comprobando si hay problemas en el servidor %1" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SETREPPARAMS "Cambiando propiedades de duplicación para volumen %3" + IDS_ACTION_CREATEREPLICA + "Creando duplicado de volumen %3 en partición %1:%2" + IDS_DELSET_REPLICA_DESC "¡Precaución!\n\nContinuar hará que se elimine el duplicado del volumen %3 en la partición %2 del servidor %1." + IDS_DELSET_CLONE_DESC "¡Precaución!\n\nContinuar hará que se elimine la copia de seguridad del volumen %3 de la partición %2 del servidor %1." + IDS_INSTALL_DESC1 "Esta operación copia un archivo de este sistema en otro. +" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_INSTALL_DESC2 "Si el archivo ya existe en el sistema de destino, se hará copia de seguridad del mismo y se le otorgará una extensión .BAK; a cualquier copia de seguridad existente se le dará una extensión .OLD y, se eliminará cualquier archivo .OLD existente." + IDS_ACTION_INSTALLFILE "Instalando el archivo %2 en el servidor %1" + IDS_ACTION_UNINSTALLFILE "Desinstalando el archivo %2 del servidor %1" + IDS_ACTION_PRUNEFILES "Podando archivos del servidor %1" + IDS_FILTER_ALLFILES "Todos los archivos|*.*|" + IDS_ACTION_RENAMEFILESET "Cambiando el nombre del volumen %1 por %2" + IDS_RECUR_DAILY "cada día" + IDS_RECUR_SUNDAY "cada domingo" + IDS_RECUR_MONDAY "cada lunes" + IDS_RECUR_TUESDAY "cada martes" + IDS_RECUR_WEDNESDAY "cada miércoles" + IDS_RECUR_THURSDAY "cada jueves" + IDS_RECUR_FRIDAY "cada viernes" + IDS_RECUR_SATURDAY "cada sábado" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATESERVICE "Creando el servicio %2 en servidor %1" + IDS_ACTION_DELETESERVICE "Suprimiendo el archivo %2 del servidor %1" + IDS_ACTION_RELEASEFILESET "Liberando el volumen %3" + IDS_ACTION_GETDATES "Obtención de fechas para el archivo %2 en el servidor %1" + IDS_LASTMODIFIED "Modificado por última vez %1" + IDS_SVR_SECURITY_TITLE "Seguridad de servidor - %1" + IDS_SVR_LIST_TAB "Administradores" + IDS_ACTION_ADMINLIST_LOAD "Obtención de administradores para servidor %1" + IDS_ACTION_ADMINLIST_SAVE + "Escribiendo administradores para el servidor %1" + IDS_ADMCOL_PRINCIPAL "Miembro" + IDS_ADMCOL_TYPE "Tipo" + IDS_ADMCOL_TYPE_GROUP "Grupo" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_RESTORE "Restaurando el volumen %1" + IDS_COL_AGGS_RESTORE "particiones al restaurar un volumen" + IDS_RESTORE_FILTER "Archivos de vuelco de volumen|*.DMP|Todos los archivos|*.*|" + IDS_SVC_BOS_TAB "BOS" + IDS_ACTION_SETRESTART "Cambiando horas de reinicio de servicio para el servidor %1" + IDS_RESTORE_CREATESET "El volumen %1 se creará en el servidor y partición especificada a continuación." + IDS_RESTORE_OVERWRITESET + "¡Precaución! El volumen %3 existe en la partición %2 del servidor %1 y si continúa se sobregrabará!" + IDS_SUBSET_TITLE_LOAD "Abrir subconjunto de servidor" + IDS_SUBSET_TITLE_SAVE "Guardar subconjunto de servidor" + IDS_BUTTON_OPEN "&Abrir" + IDS_BUTTON_SAVE "&Guardar" + IDS_SUBSET_SAVE_TITLE "Precaución" + IDS_SUBSET_SAVE_DESC "Ya hay un subconjunto de servidor con el nombre %1.\n\n¿Desea sobregrabar este subconjunto?" + IDS_SUBSET_CHANGED "%1 [MODIFICADO]" + IDS_SUBSET_TAB "Servidores supervisados" + IDS_SUBSET_DISCARD_TITLE "¿Guardar subconjunto?" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SUBSET_DISCARD_DESC "No ha guardado como subconjunto la lista de los servidores supervisados en la actualidad. Si guarda esta lista, puede utilizarla con posterioridad para proseguir la supervisión de este mismo conjunto de servidores.\n\n+" + IDS_SUBSET_DISCARD_DESC2 + "¿Desea crear un subconjunto que contenga la lista de servidores supervisados en la actualidad?" + IDS_SUBSET_NONAME "(sin título)" + IDS_SUBSET_NOSUBSET "(se están supervisando todos los servidores)" + IDS_SUBSET_SERVERSUBSET "Servidor %1" + IDS_FILESET_SOME "Volúmenes de todos los servidores supervisados en la célula %1:" + IDS_AGGREGATE_SOME "Particiones en todos los servidores supervisados en la célula %1:" + IDS_SERVICE_SOME "Servicios en todos los servidores supervisados en la célula %1:" + IDS_FILESET_UNMON "El servidor %1 no está siendo supervisado" + IDS_AGGREGATE_UNMON "El servidor %1 no está siendo supervisado" + IDS_SERVICE_UNMON "El servidor %1 no está siendo supervisado" + IDS_SUBSET_DELETE_TITLE "¿Suprimir subconjunto?" + IDS_SUBSET_DELETE_DESC "¿Está seguro de que desea suprimir el subconjunto de servidor %1?" + IDS_ERROR_TRANSLATED "Número de error 0x%1 (%2):\n\n%3" + IDS_ERROR_NOTTRANSLATED "El número de error 0x%1 (%2) no está reconocido." + IDS_FIND_NOTHING_TITLE "No hay ningún mandato seleccionado" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FIND_NOTHING_DESC "Para averiguar el modo de efectuar una operación, seleccione en primer lugar una línea de mandatos de la lista o escriba una palabra clave." + IDS_FIND_UNKNOWN_TITLE "Mandato desconocido" + IDS_FIND_UNKNOWN_DESC "El AFS Server Manager no ha podido encontrar ningún tema de ayuda para el mandato ""%1""." + IDS_HELPABOUT_DESC1 "Aviso: este programa de sistema está protegido por el copyright y tratados internacionales. +" + IDS_HELPABOUT_DESC2 "La reproducción o distribución no autorizada de este software puede dar como resultado la aplicación de graves sanciones civiles y penales y se perseguirá por todos los medios legales posibles.\n\n+" + IDS_HELPABOUT_DESC3 "AFS es una marca registrada de Transarc Corporation, una compañía de IBM." + IDS_CANT_QUIT_TITLE "AFS Server Manager" + IDS_CANT_QUIT_REBOOT "¡Precaución!\n\nEl AFS Server Manager está efectuando en la actualidad una o más operaciones. Si cierra Windows en este momento, dichas operaciones no finalizarán satisfactoriamente.\n\n¿Está seguro de que desea reiniciar Windows?" + IDS_APP_TITLE "AFS Server Manager" + IDS_ACTION_OPENCELL "Búsqueda de servidores en la célula %1" + IDS_OPTIONS_TITLE "Opciones - AFS Server Manager" + IDS_OPTIONS_GENERAL_TAB "General" + IDS_BADCREDS_DESC "A menos que inicie la sesión como administrador, es posible que no disponga de privilegios suficientes para administrar satisfactoriamente la célula %1. No disponer de suficientes privilegios de acceso puede hacer que el AFS Server Manager encuentre problemas en una célula en la que no existan dichos problemas." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CONFIRMATION_TITLE "Confirmación - AFS Server Manager" + IDS_NO_GROUP_CHECKBOX "No hay grupo propietario" + IDS_AFS_ID_DIDEXP "%1 (han caducado las señales %2)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_QUERYING "(consultando)" + IDS_ADMCOL_TYPE_FOREIGN_GROUP "Grupo exterior" + IDS_ADMCOL_TYPE_FOREIGN_USER "Usuario exterior" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_NOTIFIER "Notificador" + IDS_SVC_NONOTIFIER "(ninguno)" + IDS_SVR_KEY_TAB "Claves de servidor" + IDS_KEYNAME_NOTIME "Claves para servidor %1:" + IDS_KEYNAME_WITHTIME "Claves para servidor %1: (modificado %2):" + IDS_SVRKEY_VERSION "Versión" + IDS_SVRKEY_DATA "Valor" + IDS_SVRKEY_CHECKSUM "Suma de comprobación" + IDS_SVRKEY_DATA_UNKNOWN "(oculto)" + IDS_STARTSERVICE_TITLE "Iniciar servicio" + IDS_STOPSERVICE_TITLE "Detener servicio" + IDS_STARTSERVICE_TEXT "Pulsar en Aceptar para iniciar el servicio %2 en el servidor %1." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_STOPSERVICE_TEXT "Pulsar en Aceptar para detener el servicio %2 en el servidor %1." + IDS_STARTSERVICE_STARTUP + "Puede hacer que este cambio sea permanente, por lo que el servicio %2 se iniciciará automáticamente si se reinicia el servidor %1." + IDS_STOPSERVICE_STARTUP "Puede hacer que este cambio sea permanente, por lo que el servicio %2 no se iniciciará automáticamente si se reinicia el servidor %1." + IDS_STARTSERVICE_PERMANENT + "&Permanente (iniciar servicio %2 si se reinicia el servidor %1)" + IDS_STARTSERVICE_TEMPORARY + "&Temporal (no iniciar servicio %2 si se reinicia el servidor %1)" + IDS_STOPSERVICE_PERMANENT + "&Permanente (no iniciar servicio %2 si se reinicia el servidor %1)" + IDS_STOPSERVICE_TEMPORARY + "&Temporal (iniciar servicio %2 si se reinicia el servidor %1)" + IDS_ACTION_EXECUTE "Ejecutando %2 en el servidor %1" + IDS_ACTION_SALVAGE_SVR "Recuperando todos los volúmenes en el servidor %1:" + IDS_ACTION_SALVAGE_AGG "Recuperando todos los volúmenes en la partición %1:2:" + IDS_ACTION_SALVAGE_VOL "Recuperando el volumen %3 en la partición %1:2" + IDS_SALVAGE_SVR "Recuperar todos los volúmenes en el servidor %1:" + IDS_SALVAGE_AGG "Recuperar todos los volúmenes en el servidor %1, partición %2:" + IDS_SALVAGE_SET "Recuperar el volumen %3 en el servidor %1, partición %2" + IDS_SETSTATUS_SALVAGE "Recuperando el volumen" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETSTATUS_LOCKED "El volumen está bloqueado" + IDS_SETSTATUS_NO_VOL "Falta el volumen" + IDS_SETSTATUS_BUSY "El volumen está ocupado en la actualidad" + IDS_SETSTATUS_MOVED "Se ha movido el volumen" + IDS_SVR_CAPACITY "%1" + IDS_SVR_ALLOCATION "%1 (%2%%)" + IDS_SVRCOL_ADDRESS "Dirección" + IDS_HOST_TITLE "Servidores de sistema principal de base de datos que reconoce el servidor %1:" + IDS_SVR_HOSTS_TITLE "Servidor %1 - Sistemas principales de bases de datos" + IDS_SVR_HOST_TAB "Sistemas principales de base de datos" + IDS_ACTION_HOSTLIST_LOAD + "Obtención de lista de sistemas principales desde el servidor %1" + IDS_ACTION_HOSTLIST_SAVE + "Escribiendo lista de sistemas principales en el servidor %1" + IDS_SETSTATUS_1ALERT "El volumen tiene un problema" + IDS_SETSTATUS_2ALERT "El volumen tiene %1 problemas" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CHANGEADDR "Cambiando dirección IP para el servidor %1" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_ADDSITE "vos addsite" + IDS_COMMAND_VOS_BACKUP "vos backup" + IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" + IDS_COMMAND_VOS_CREATE "vos create" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_DELENTRY "vos delentry" + IDS_COMMAND_VOS_DUMP "vos dump" + IDS_COMMAND_VOS_EXAMINE "vos examine" + IDS_COMMAND_VOS_LISTPART "vos listpart" + IDS_COMMAND_VOS_LISTVLDB "vos listvldb" + IDS_COMMAND_VOS_LISTVOL "vos listvol" + IDS_COMMAND_VOS_LOCK "vos lock" + IDS_COMMAND_VOS_MOVE "vos move" + IDS_COMMAND_VOS_PARTINFO "vos partinfo" + IDS_COMMAND_VOS_RELEASE "vos release" + IDS_COMMAND_VOS_REMOVE "vos remove" + IDS_COMMAND_VOS_REMSITE "vos remsite" + IDS_COMMAND_VOS_RENAME "vos rename" + IDS_COMMAND_VOS_RESTORE "vos restore" + IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" + IDS_COMMAND_VOS_UNLOCK "vos unlock" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" + IDS_COMMAND_VOS_ZAP "vos zap" + IDS_COMMAND_BOS_ADDHOST "bos addhost" + IDS_COMMAND_BOS_ADDKEY "bos addkey" + IDS_COMMAND_BOS_ADDUSER "bos adduser" + IDS_COMMAND_BOS_CREATE "bos create" + IDS_COMMAND_BOS_DELETE "bos delete" + IDS_COMMAND_BOS_EXEC "bos exec" + IDS_COMMAND_BOS_GETDATE "bos getdate" + IDS_COMMAND_BOS_GETLOG "bos getlog" + IDS_COMMAND_BOS_GETRESTART "bos getrestart" + IDS_COMMAND_BOS_INSTALL "bos install" + IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" + IDS_COMMAND_BOS_LISTKEYS "bos listkeys" + IDS_COMMAND_BOS_LISTUSERS "bos listusers" + IDS_COMMAND_BOS_PRUNE "bos prune" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_BOS_REMOVEHOST "bos removehost" + IDS_COMMAND_BOS_REMOVEKEY "bos removekey" + IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" + IDS_COMMAND_BOS_RESTART "bos restart" + IDS_COMMAND_BOS_SALVAGE "bos salvage" + IDS_COMMAND_BOS_SETAUTH "bos setauth" + IDS_COMMAND_BOS_SETRESTART "bos setrestart" + IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" + IDS_COMMAND_BOS_START "bos start" + IDS_COMMAND_BOS_STARTUP "bos startup" + IDS_COMMAND_BOS_STATUS "bos status" + IDS_COMMAND_BOS_STOP "bos stop" + IDS_COMMAND_BOS_UNINSTALL "bos uninstall" + IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" + IDS_COMMAND_FS_LISTQUOTA "fs listquota" + IDS_COMMAND_FS_QUOTA "fs quota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_FS_SETQUOTA "fs setquota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCSHORT_UNMONITORED + "No se están supervisando problemas en el servidor %1" + IDS_ALERT_DESCSHORT_TIMEOUT + "No se ha podido entrar en contacto con el servidor %1; último error: %3" + IDS_ALERT_DESCSHORT_AGG_FULL + "La utilización de la partición para %2 supera el umbral de aviso de %3%% (%4)" + IDS_ALERT_DESCSHORT_SET_FULL + "La utilización de volumen para %3 supera el umbral de aviso de %4%% (%5)" + IDS_ALERT_DESCSHORT_NO_VLDBENT + "El volumen %3 no tiene ninguna entrada de VLDB" + IDS_ALERT_DESCSHORT_NO_SVRENT_SET + "El volumen %3 tiene una entrada de VLDB pero no se ha encontrado en la partición %2 del servidor %1" + IDS_ALERT_DESCSHORT_STOPPED "Servicio %2 detenido en %3" + IDS_ALERT_DESCSHORT_NO_SVRENT_AGG + "VLDB hace referencia a la partición %2 pero no se ha encontrado en el servidor %1" + IDS_ALERT_DESCSHORT_BADCREDS + "Es posible que no tenga suficientes privilegios para administrar el servidor %1" + IDS_ALERT_DESCSHORT_AGG_ALLOC + "La cuota de volumen combinada de la partición %2 ha superado su capacidad" + IDS_ALERT_DESCSHORT_STATE_NO_VNODE + "El volumen %3 está dañado y no puede utilizarse." + IDS_ALERT_DESCSHORT_STATE_NO_SERVICE + "No hay ningún servicio que esté ejecutándose para servir el volumen %3." + IDS_ALERT_DESCSHORT_STATE_OFFLINE + "El volumen %3 está fuera de línea y no puede utilizarse." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_TIMEOUT + "No ha podido contactarse con el servidor %1. El último intento, efectuado en %2, ha dado como resultado el error ""%3""." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_AGG_FULL + "La utilización de la partición %2 en el servidor %1 supera su umbral de aviso de %3%% (%4)." + IDS_ALERT_DESCFULL_SET_FULL + "La utilización del volumen %3 (servidor %1, partición %2) supera su umbral de aviso de %4%% (%5)." + IDS_ALERT_DESCFULL_NO_VLDBENT + "El volumen %3 existe en la partición %2 del servidor %1, pero no tiene ninguna entrada de VLDB correspondiente." + IDS_ALERT_DESCFULL_NO_SVRENT_SET + "Existe una entrada de VLDB para el volumen %3, pero el volumen pero no se ha encontrado en la partición %2 del servidor %1." + IDS_ALERT_DESCFULL_STOPPED + "El servicio %2 del servidor %1 se ha detenido en %3 con código de salida %5." + IDS_ALERT_DESCFULL_NO_SVRENT_AGG + "VLDB hace referencia a volúmenes en la partición %2 del servidor %1, pero no se ha encontrado la partición. " + IDS_ALERT_DESCFULL_BADCREDS + "Es posible que el AFS Server Manager esté detectando errores que no existen en el servidor %1 debido a que no dispone de señales de AFS como administrador dentro de esta célula." + IDS_ALERT_DESCFULL_AGG_ALLOC + "La cuota combinada de volúmenes de la partición %2 del servidor %1, que totaliza %4, supera la capacidad de la partición de %3." + IDS_ALERT_DESCFULL_STATE_NO_VNODE + "El volumen %3 de la partición %2 del servidor %1 no tiene ningún Vnode asociado con el mismo. (El estado del volumen es 0x%4.)" + IDS_ALERT_DESCFULL_STATE_NO_SERVICE + "No hay ningún servicio de exportador de archivos ejecutándose en el servidor %1, por lo que no puede utilizarse el volumen %3 de la partición %2. (El estado del volumen es 0x%4.)" + IDS_ALERT_DESCFULL_STATE_OFFLINE + "El volumen %3 de la partición %2 del servidor %1 está fuera de línea y no puede utilizarse. (El estado del volumen es 0x%4.)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_TIMEOUT "Pulse en el botón Intentar de nuevo para intentar volver a contactar con este servidor." + IDS_ALERT_FIX_AGG_FULL "Pulse en el botón Avisos para cambiar el umbral de aviso para la utilización de esta partición." + IDS_ALERT_FIX_SET_FULL "Pulse en el botón Avisos para cambiar el umbral de aviso para la utilización de este volumen." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_NO_VLDBENT + "VLDB está posiblemente sin actualizar; si es así, utilice el mandato Sincronizar VLDB para actualizarlo." + IDS_ALERT_FIX_NO_SVRENT_SET + "Compruebe el servidor y la partición para asegurarse de que están funcionando de modo adecuado." + IDS_ALERT_FIX_STOPPED "Pulse en el botón Ver registro para ver el registro de servicio para este servicio." + IDS_ALERT_FIX_NO_SVRENT_AGG + "Compruebe el servidor para asegurarse de que se ha exportado la partición y de que está funcionando debidamente." + IDS_ALERT_FIX_BADCREDS "Pulse en el botón Autentificación para obtener señales de AFS nuevas." + IDS_ALERT_FIX_AGG_ALLOC "Reduzca la cuota para los volúmenes de esta partición, o mueva uno o más volúmenes a otra partición." + IDS_ALERT_FIX_STATE_NO_VNODE " " + IDS_ALERT_FIX_STATE_NO_SERVICE " " + IDS_ALERT_FIX_STATE_OFFLINE " " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_BUTTON_TRYAGAIN "Volver &a intentar" + IDS_ALERT_BUTTON_WARNINGS "Av&isos..." + IDS_ALERT_BUTTON_VIEWLOG "&Ver registro" + IDS_ALERT_BUTTON_SHOWME "&Personalizar" + IDS_ALERT_BUTTON_GETCREDS "&Autentificación" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_CELLSERVERS_NOCELL + "No se ha especificado ninguna célula. Para utilizar el AFS Server Manager, debe especificar la célula de AFS con la que desearía trabajar. Elija una célula seleccionando el elemento ""Abrir..."" menu de ""Célula"" menu más arriba." + IDS_ERROR_REFRESH_CELLSERVERS + "No ha podido obtenerse la lista de servidores para la célula %1.\n\nError: %2" + IDS_ERROR_CANT_OPEN_CELL + "El AFS Server Manager no ha podido ponerse en contacto con ningún servidor de la célula %1.\n\nPor favor, vuelva a efectuar la comprobación para asegurarse de que ha escrito correctamente el nombre de la célula." + IDS_ERROR_REFRESH_AGGREGATES + "No ha podido obtenerse la lista de particiones para el servidor %1.\n\nError: %2" + IDS_ERROR_REFRESH_SERVER_STATUS + "No ha podido obtenerse el estado actual del servidor %1." + IDS_ERROR_CHANGE_SERVER_STATUS + "El AFS Server Manager no ha podido cambiar las propiedades para el servidor %1." + IDS_ERROR_REFRESH_AGGREGATE_STATUS + "No ha podido obtenerse el estado actual de la partición %2 en el servidor %1." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_FILESET_STATUS + "No puede obtenerse el estado actual del volumen %3 (servidor %1, partición %2)." + IDS_ERROR_REFRESH_SERVICE_STATUS + "No ha podido determinarse el estado actual del servicio %2 en el servidor %1." + IDS_ERROR_MOVE_FILESET "El AFS Server Manager no ha podido mover el volumen %3 desde la partición %2 del servidor %1 a la partición %5 en el servidor %4." + IDS_ERROR_VIEW_LOGFILE "No ha podido leerse el archivo %2 desde el servidor %1.\n\nAsegúrese de que ha entrado correctamente el nombre del archivo y de que tiene suficientes permisos para ver el archivo. " + IDS_ERROR_NOT_REPLICATED + "No se ha podido determinar el estado de duplicación del volumen %1." + IDS_ERROR_CANT_CREATE_FILESET + "El AFS Server Manager no ha podido crear el volumen %3 en la partición %2 del servidor %1." + IDS_ERROR_CANT_DELETE_FILESET + "El AFS Server Manager no ha podido suprimir el volumen %3 (partición %2 del servidor %1)." + IDS_ERROR_CANT_CREATE_VLDB_ENTRY + "El AFS Server Manager no ha podido crear una entrada VLDB para el volumen %3 en la partición %2 del servidor %1." + IDS_ERROR_CANT_SET_FILESET_QUOTA + "El AFS Server Manager no ha podido cambiar la cuota para el volumen %3 en la partición %2 del servidor %1." + IDS_ERROR_CANT_CREATE_SERVER + "El AFS Server Manager no ha podido crear la entrada de servidor solicitada en la célula %1. " + IDS_ERROR_CANT_PING_SERVER + "El AFS Server Manager no ha podido determinar la dirección IP del servidor %1." + IDS_ERROR_CANT_DELETE_SERVER + "El AFS Server Manager no ha podido suprimir el servidor %1." + IDS_ERROR_CANT_DELETE_SERVER_FILESETS + "No puede suprimirse el servidor %1 debido a que es el sistema principal de uno o más volúmenes. Un servidor sólo puede eliminarse en el caso de que no contenga ningún volumen." + IDS_ERROR_CHANGE_AGGREGATE_STATUS + "El AFS Server Manager no ha podido cambiar las propiedades de la partición %2 del servidor %1." + IDS_ERROR_CHANGE_SERVICE_STATUS + "El AFS Server Manager no ha podido cambiar las propiedades del servicio %2 en el servidor %1." + IDS_ERROR_CANT_START_SERVICE + "El AFS Server Manager no ha podido iniciar el servicio %2 en el servidor %1." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_STOP_SERVICE + "El AFS Server Manager no ha podido detener el servicio %2 en el servidor %1." + IDS_ERROR_CANT_RESTART_SERVICE + "El AFS Server Manager no ha podido detener y reiniciar el servicio %2 en el servidor %1." + IDS_ERROR_CHANGE_REPLICA_STATUS + "El AFS Server Manager no ha podido cambiar las propiedades de duplicación para el volumen %3 en la partición %2 del servidor %1." + IDS_ERROR_CANT_SYNCVLDB "El AFS Server Manager no ha podido actualizar VLDB." + IDS_ERROR_CANT_CREATE_REPLICA + "El AFS Server Manager no ha podido crear un duplicado del volumen %3 en la partición %2 del servidor %1." + IDS_ERROR_CANT_INSTALL_FILE + "El AFS Server Manager no ha podido instalar el archivo %2 en el servidor %1." + IDS_ERROR_CANT_UNINSTALL_FILE + "El AFS Server Manager no ha podido desinstalar el archivo %2 en el servidor %1." + IDS_ERROR_CANT_PRUNE_FILES + "El AFS Server Manager no ha podido eliminar los archivos solicitados del servidor %1." + IDS_ERROR_CANT_RENAME_FILESET + "El AFS Server Manager no ha podido cambiar el nombre del volumen %1 por ""%2""." + IDS_ERROR_CANT_CREATE_SERVICE + "El AFS Server Manager no ha podido crear el servicio %2 en el servidor %1." + IDS_ERROR_CANT_DELETE_SERVICE + "El AFS Server Manager no ha podido suprimir el servicio %2 del servidor %1." + IDS_ERROR_CANT_RELEASE_FILESET + "El AFS Server Manager no ha podido liberar el volumen duplicado %3." + IDS_ERROR_CANT_UPDATE_FILESET + "El AFS Server Manager no ha podido actualizar el duplicado de volumen %3 en la partición %1 del servidor %2." + IDS_ERROR_CANT_UPDATE_ALL + "El AFS Server Manager no ha podido actualizar ningún duplicado del volumen %3." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_LOAD_ADMLIST + "El AFS Server Manager no ha podido leer la lista de administradores para el servidor %1." + IDS_ERROR_CANT_LOAD_KEYLIST + "El AFS Server Manager no ha podido leer la lista de claves de servidor para el servidor %1." + IDS_ERROR_CANT_CREATE_KEY + "El AFS Server Manager no ha podido crear una clave de servidor nueva para el servidor %1." + IDS_ERROR_CANT_SAVE_ADMLIST + "El AFS Server Manager no ha podido cambiar la lista de administradores para el servidor %1." + IDS_ERROR_CANT_CLONE "El AFS Server Manager no ha podido crear una versión de copia de seguridad del volumen %3 en la partición %2 del servidor %1." + IDS_ERROR_CANT_CLONESYS "El AFS Server Manager no ha podido crear ninguno de los volúmenes de copia de seguridad solicitados." + IDS_ERROR_CANT_DUMP_FILESET + "El AFS Server Manager no ha podido volcar el contenido del volumen %3 (servidor %1, partición %2) en el archivo %4." + IDS_ERROR_CANT_RESTORE_FILESET + "El AFS Server Manager no ha podido restaurar el archivo %4 en el volumen %3 (servidor %1, partición %2)." + IDS_ERROR_CANT_SET_RESTART_TIMES + "El AFS Server Manager no ha podido cambiar las horas de reinicio para los servicios del servidor %1." + IDS_ERROR_CANT_DELETE_REPLICATED_FILESET + "El AFS Server Manager no ha podido suprimir el volumen %3 de la partición %2 del servidor %1.\n\nEl volumen %3 no puede eliminarse a menos que en primer lugar se hayan eliminado todos sus duplicados." + IDS_CMDLINE_TITLE "Error - AFS Server Manager" + IDS_CMDLINE_SYNTAX "La línea de mandatos que ha especificado para el AFS Server Manager no es válida." + IDS_CMDLINE_UNRECOGNIZED + "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nNo se reconoce el parámetro ""%1""." + IDS_CMDLINE_DUPLICATE "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nEl parámetro ""%1"" se ha especificado más de una vez." + IDS_CMDLINE_UNEXPECTVALUE + "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nNo se debe proporcionar un valor al parámetro ""%1""." + IDS_CMDLINE_MISSINGVAL "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nEl parámetro ""%1"" debe ir seguido de un valor." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CMDLINE_SUBSETNOTCELL + "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nEl parámetro ""/SUBSET"" sólo puede especificarse en el caso de que también se haya especificado el parámetro ""/CELL""." + IDS_CMDLINE_INVALIDSUBSET + "El subconjunto de servidor que ha especificado, ""%2"", no se ha definido para la célula %1." + IDS_CMDLINE_SERVERNOTCELL + "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nEl parámetro ""/SERVER"" sólo puede especificarse en el caso de que también se haya especificado el parámetro ""/CELL""." + IDS_CMDLINE_RESET_TITLE "AFS Server Manager" + IDS_CMDLINE_RESET_DESC "El AFS Server Manager ha borrado la configuración especificada." + IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE + "El AFS Server Manager no puede sincronizar VLDB con la partición %2 del servidor %1 ya que la partición no existe o no ha sido exportada.\n\nPara eliminar esta partición del servidor %1, debe eliminar la entradas de VLDB de volumen que hacen referencia a la misma." + IDS_CMDLINE_USERPASSWORD + "La línea de mandatos que ha especificado para el AFS Server Manager no es válida.\n\nPara obtener señales de AFS nuevas, deben especificarse tanto el parámetro ""/USER"" como el parámetro ""/PASSWORD"". " + IDS_ERROR_CANT_DELETE_KEY + "El AFS Server Manager no ha podido suprimir la clave de servidor %2 del servidor %1." + IDS_ERROR_CANT_GETRANDOMKEY + "El AFS Server Manager no ha podido generar una clave aleatoria para el servidor %1." + IDS_ERROR_CANT_EXECUTE_COMMAND + "El AFS Server Manager no ha podido ejecutar el mandato siguiente en el servidor %1.\n\n ""%2""" + IDS_ERROR_CANT_READ_SALVAGE_LOG + "El AFS Server Manager ha completado la operación de recuperación de modo satisfactorio, pero no ha podido recuperar el archivo de registro que describe el resultado específico de la operación de recuperación." + IDS_ERROR_CANT_SALVAGE "El AFS Server Manager no ha podido efectuar la operación de recuperación solicitada." + IDS_ERROR_CANT_AUTH_ON "El AFS Server Manager no ha podido habilitar la comprobación de autentificación para el servidor %1." + IDS_ERROR_CANT_AUTH_OFF "El AFS Server Manager no ha podido inhabilitar la comprobación de autentificación para el servidor %1." + IDS_ERROR_CANT_LOAD_HOSTLIST + "El AFS Server Manager no ha podido leer la lista de servidores de sistema principal de base de datos del servidor %1." + IDS_ERROR_CANT_SAVE_HOSTLIST + "El AFS Server Manager no ha podido cambiar la lista de servidores de sistemas principales de base de datos en el servidor %1." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL + "El AFS Server Manager no ha podido iniciarse debido a que el AFS Control Center no se ha instalado debidamente en este sistema.\n\nEs posible que tenga que volver a instalar el AFS Control Center." + IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN + "El AFS Server Manager no ha podido iniciarse debido a un problema desconocido.\n\nEs posible que tenga que volver a instalar el AFS Control Center." + IDS_ERROR_CANT_CHANGEADDR + "El AFS Server Manager no ha podido cambiar la dirección IP en VLDB para el servidor %1." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_SERVICE "%1:%2" + IDS_SERVICETYPE_SIMPLE "Sencillo" + IDS_SERVICETYPE_CRON "Cron" + IDS_SERVICESTATE_STOPPED "Detenido" + IDS_SERVICESTATE_STOPPING "Deteniéndose" + IDS_SERVICESTATE_STARTING "Iniciándose" + IDS_SERVICESTATE_RUNNING "Ejecutándose" + IDS_SERVICETYPE_FS_LONG "FS (sistema de archivos)" + IDS_SERVICETYPE_FS "FS" + IDS_SERVICE_LASTERROR "%1" + IDS_SERVICES_IN_CELL "Todos los servicios de la célula %1:" + IDS_SERVICE_STARTDATE "Iniciado %1" + IDS_SERVICE_STOPDATE "Detenido %1" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afssvrmgr/lang/ja_JP/svrmgr.rc b/src/WINNT/afssvrmgr/lang/ja_JP/svrmgr.rc index 7713c0183..37d45bd73 100644 --- a/src/WINNT/afssvrmgr/lang/ja_JP/svrmgr.rc +++ b/src/WINNT/afssvrmgr/lang/ja_JP/svrmgr.rc @@ -7,3004 +7,3004 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" #define AFS_VERINFO_NAME "svrmgr" #define AFS_VERINFO_FILENAME "svrmgr.exe" #define AFS_VERINFO_LANG_CODE 0x411 #define AFS_VERINFO_CHARSET 932 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Japanese resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) -#ifdef _WIN32 -LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_AGGREGATES, DIALOG - BEGIN - RIGHTMARGIN, 118 - END - - IDD_FILESETS, DIALOG - BEGIN - RIGHTMARGIN, 180 - END - - IDD_SVR_LISTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_AGG_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 262 - TOPMARGIN, 5 - BOTTOMMARGIN, 155 - END - - IDD_SVR_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 183 - END - - IDD_SVR_SCOUT, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 216 - TOPMARGIN, 5 - BOTTOMMARGIN, 153 - END - - IDD_SVC_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 268 - TOPMARGIN, 5 - BOTTOMMARGIN, 209 - END - - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 315 - TOPMARGIN, 2 - BOTTOMMARGIN, 224 - END - - IDD_SERVER, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 207 - TOPMARGIN, 2 - BOTTOMMARGIN, 135 - END - - IDD_SVC_CREATE, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 228 - END - - IDD_SET_REPSITES, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 216 - TOPMARGIN, 5 - BOTTOMMARGIN, 163 - END - - IDD_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 7 - BOTTOMMARGIN, 253 - HORZGUIDE, 160 - END - - IDD_TIMEOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 232 - TOPMARGIN, 7 - BOTTOMMARGIN, 153 - END - - IDD_COLUMNS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 281 - TOPMARGIN, 5 - BOTTOMMARGIN, 143 - END - - IDD_REFRESHALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 68 - END - - IDD_SET_CREATE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 317 - TOPMARGIN, 4 - BOTTOMMARGIN, 205 - END - - IDD_SET_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 303 - TOPMARGIN, 7 - BOTTOMMARGIN, 99 - END - - IDD_SET_CLONE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 341 - TOPMARGIN, 7 - BOTTOMMARGIN, 81 - END - - IDD_SVC_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 189 - END - - IDD_SVR_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 152 - END - - IDD_AGG_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 252 - TOPMARGIN, 5 - BOTTOMMARGIN, 146 - END - - IDD_SET_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 268 - TOPMARGIN, 5 - BOTTOMMARGIN, 177 - END - - IDD_SET_MOVETO, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 170 - END - - IDD_SET_MOVING, DIALOG - BEGIN - LEFTMARGIN, 1 - RIGHTMARGIN, 306 - TOPMARGIN, 2 - BOTTOMMARGIN, 63 - END - - IDD_SVC_LOGNAME, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 274 - TOPMARGIN, 1 - BOTTOMMARGIN, 105 - END - - IDD_SVC_VIEWLOG, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 305 - TOPMARGIN, 7 - END - - IDD_SET_SETQUOTA, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 267 - TOPMARGIN, 4 - BOTTOMMARGIN, 127 - END - - IDD_ACTIONS, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 234 - TOPMARGIN, 2 - BOTTOMMARGIN, 56 - END - - IDD_SVR_SYNCVLDB, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 265 - TOPMARGIN, 4 - BOTTOMMARGIN, 95 - END - - IDD_SET_CREATEREP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 167 - END - - IDD_SVR_INSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 2 - BOTTOMMARGIN, 154 - END - - IDD_SVR_UNINSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 135 - END - - IDD_SVR_PRUNE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 251 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_SET_RENAME, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 129 - END - - IDD_SVC_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 303 - TOPMARGIN, 7 - BOTTOMMARGIN, 65 - END - - IDD_SVR_GETDATES, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_GETDATES_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 128 - END - - IDD_SET_DUMP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 303 - TOPMARGIN, 7 - BOTTOMMARGIN, 141 - END - - IDD_SET_RESTORE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 288 - TOPMARGIN, 4 - BOTTOMMARGIN, 244 - END - - IDD_SVC_BOS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 259 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_DUMPING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 302 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SET_RESTORING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 302 - TOPMARGIN, 2 - BOTTOMMARGIN, 64 - END - - IDD_SET_CLONESYS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 254 - TOPMARGIN, 7 - BOTTOMMARGIN, 159 - END - - IDD_SUBSETS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 276 - TOPMARGIN, 5 - BOTTOMMARGIN, 177 - END - - IDD_SUBSET_LOADSAVE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 276 - TOPMARGIN, 4 - BOTTOMMARGIN, 141 - END - - IDD_HELP_FIND, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 214 - TOPMARGIN, 4 - BOTTOMMARGIN, 69 - END - - IDD_HELP_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 214 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_HELP_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 226 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_OPENINGCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 236 - TOPMARGIN, 2 - BOTTOMMARGIN, 41 - END - - IDD_OPTIONS_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 274 - TOPMARGIN, 5 - BOTTOMMARGIN, 131 - END - - IDD_SVR_KEYS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_CREATEKEY, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - END - - IDD_SVC_STARTSTOP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 306 - TOPMARGIN, 7 - END - - IDD_SVR_EXECUTE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_SALVAGE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 7 - BOTTOMMARGIN, 250 - END - - IDD_SVR_SALVAGE_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 174 - END - - IDD_SET_RELEASE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 98 - END - - IDD_SVR_HOSTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_ADDHOST, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 303 - TOPMARGIN, 4 - BOTTOMMARGIN, 103 - END - - IDD_SVR_ADDRESS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 207 - TOPMARGIN, 4 - BOTTOMMARGIN, 111 - END - - IDD_SVR_NEWADDR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 228 - TOPMARGIN, 4 - BOTTOMMARGIN, 62 - END -END -#endif // APSTUDIO_INVOKED - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_MAIN MENU DISCARDABLE -BEGIN - POPUP "ƒZƒ‹(&C)" - BEGIN - MENUITEM "‘I‘ð(&S)...", M_CELL_OPEN - MENUITEM "”FØ(&A)...", M_CREDENTIALS - MENUITEM SEPARATOR - MENUITEM "I—¹(&X)", M_EXIT - END - POPUP "•\ަ(&V)" - BEGIN - POPUP "ƒT[ƒo[(&S)" - BEGIN - MENUITEM "‘åƒAƒCƒRƒ“(&G)", M_SVR_VIEW_LARGE - , CHECKED - MENUITEM "¬ƒAƒCƒRƒ“(&M)", M_SVR_VIEW_SMALL - , CHECKED - MENUITEM "Ú×(&D)", M_SVR_VIEW_REPORT - , CHECKED - MENUITEM SEPARATOR - MENUITEM "•W€(&N)", M_SVR_VIEW_ONEICON - , CHECKED - MENUITEM "‚·‚ׂẴAƒCƒRƒ“(&A)", M_SVR_VIEW_TWOICONS - , CHECKED - MENUITEM "ó‹µ‚Ì‚Ý(&S)", M_SVR_VIEW_STATUS - , CHECKED - END - POPUP "ƒNƒBƒbƒNEƒrƒ…[EƒyƒCƒ“(&Q)" - BEGIN - MENUITEM "‚È‚µ(&N)", M_DIVIDE_NONE, CHECKED - MENUITEM "c‚É•ªŠ„(&V)", M_DIVIDE_H, CHECKED - MENUITEM "‰¡‚É•ªŠ„(&H)", M_DIVIDE_V, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "is’†‚Ì‘€ì(&P)", M_ACTIONS, CHECKED - MENUITEM SEPARATOR - MENUITEM "ƒ‚ƒjƒ^[‚³‚ê‚éƒT[ƒo[(&M)...", M_SUBSET - MENUITEM "—ñ(&C)...", M_COLUMNS - MENUITEM "ƒIƒvƒVƒ‡ƒ“(&O)...", M_OPTIONS - MENUITEM SEPARATOR - MENUITEM "‚·‚ׂčŐV•\ަ(&F)", M_REFRESHALL - END - POPUP "ƒwƒ‹ƒv(&H)" - BEGIN - MENUITEM "–ÚŽŸ(&C)", M_HELP - MENUITEM "ƒRƒ}ƒ“ƒhŒŸõ(&F)...", M_HELP_FIND - MENUITEM "ƒGƒ‰[EƒR[ƒh‚ÌŒŸõ(&L)...", M_HELP_XLATE - MENUITEM SEPARATOR - MENUITEM "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ɂ‚¢‚Ä(&A)...", M_ABOUT - END -END - -MENU_AGG MENU DISCARDABLE -BEGIN - MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̍쐬(&C)...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv(&B)...", M_SET_CLONE - MENUITEM "‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒƒbƒN‰ðœ(&U)", M_SET_UNLOCK - MENUITEM "VLDB ‚Ì“¯Šú‰»(&Y)...", M_SYNCVLDB - MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̃Tƒ‹ƒx[ƒW(&G)...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "ÅV•\ަ(&F)", M_REFRESH - MENUITEM "ƒvƒƒpƒeƒB[(&R)", M_PROPERTIES -END - -MENU_SVC MENU DISCARDABLE -BEGIN - MENUITEM "ŠJŽn(&S)", M_SVC_START - MENUITEM "’âŽ~(&S)", M_SVC_STOP - MENUITEM "ÄŽn“®(&R)", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "ƒƒOEƒtƒ@ƒCƒ‹‚Ì•\ަ(&V)", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "íœ(&L)", M_SVC_DELETE - MENUITEM SEPARATOR - MENUITEM "ÅV•\ަ(&F)", M_REFRESH - MENUITEM "ƒvƒƒpƒeƒB[(&R)", M_PROPERTIES -END - -MENU_AGG_NONE MENU DISCARDABLE -BEGIN - POPUP "•\ަ(&V)" - BEGIN - MENUITEM "•W€(&N)", M_VIEW_ONEICON, CHECKED - MENUITEM "‚·‚ׂẴAƒCƒRƒ“(&A)", M_VIEW_TWOICONS, CHECKED - MENUITEM "ó‹µ‚Ì‚Ý(&S)", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̍쐬(&C)...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "‚·‚ׂčŐV•\ަ(&F)", M_REFRESHALL -END - -MENU_SVC_NONE MENU DISCARDABLE -BEGIN - POPUP "•\ަ(&V)" - BEGIN - MENUITEM "•W€(&N)", M_VIEW_ONEICON, CHECKED - MENUITEM "‚·‚ׂẴAƒCƒRƒ“(&A)", M_VIEW_TWOICONS, CHECKED - MENUITEM "ó‹µ‚Ì‚Ý(&S)", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "ƒT[ƒrƒX‚̍쐬(&C)...", M_SVC_CREATE - MENUITEM SEPARATOR - MENUITEM "‚·‚ׂčŐV•\ަ(&F)", M_REFRESHALL -END - -MENU_SET MENU DISCARDABLE -BEGIN - MENUITEM "•¡»(&P)...", M_SET_REPLICATION - MENUITEM "‘¦Žž‰ð•ú(&S)", M_SET_RELEASE - MENUITEM SEPARATOR - MENUITEM "ƒoƒbƒNƒAƒbƒv(&B)...", M_SET_CLONE - MENUITEM "ƒtƒ@ƒCƒ‹‚Ƀ_ƒ“ƒv(&D)...", M_SET_DUMP - MENUITEM "ƒtƒ@ƒCƒ‹‚©‚畜Œ³(&R)...", M_SET_RESTORE - MENUITEM "Š„‚è“–‚ėʂ̐ݒè(&Q)...", M_SET_SETQUOTA - MENUITEM "ƒTƒ‹ƒx[ƒW(&G)...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "ˆÚ“®æ(&M)...", M_SET_MOVETO - MENUITEM "–¼‘O•ύX(&N)...", M_SET_RENAME - MENUITEM "íœ(&L)", M_SET_DELETE - MENUITEM SEPARATOR - MENUITEM "ƒƒbƒN(&K)", M_SET_LOCK - MENUITEM "ƒƒbƒN‰ðœ(&U)", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "ÅV•\ަ(&F)", M_REFRESH - MENUITEM "ƒvƒƒpƒeƒB[(&R)", M_PROPERTIES -END - -MENU_SVR MENU DISCARDABLE -BEGIN - MENUITEM "ƒT[ƒo[EƒEƒBƒ“ƒhƒE‚̃I[ƒvƒ“(&O)", M_SVR_OPEN - MENUITEM "ƒT[ƒo[EƒEƒBƒ“ƒhƒE‚̃Nƒ[ƒY(&C)", M_SVR_CLOSE - MENUITEM "‚±‚̃T[ƒo[‚ðƒ‚ƒjƒ^[(&M)", M_SVR_MONITOR, CHECKED - MENUITEM SEPARATOR - MENUITEM "ƒT[ƒo[EƒZƒLƒ…ƒŠƒeƒB[‚̕ҏW(&S)...", M_SVR_SECURITY - MENUITEM "ƒf[ƒ^ƒx[ƒXEƒzƒXƒg‚ÌŠÇ—(&H)...", M_SVR_HOSTS - MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv(&B)...", M_SET_CLONE - MENUITEM "‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒƒbƒN‰ðœ(&U)", M_SET_UNLOCK - MENUITEM "VLDB ‚Ì“¯Šú‰»(&Y)...", M_SYNCVLDB - MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̃Tƒ‹ƒx[ƒW(&G)...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "ƒtƒ@ƒCƒ‹‚̃Cƒ“ƒXƒg[ƒ‹(&I)...", M_SVR_INSTALL - MENUITEM "ƒtƒ@ƒCƒ‹‚̃Aƒ“ƒCƒ“ƒXƒg[ƒ‹(&U)...", M_SVR_UNINSTALL - MENUITEM "‹Œƒtƒ@ƒCƒ‹‚̍폜(&P)...", M_SVR_PRUNE - MENUITEM SEPARATOR - MENUITEM "ƒtƒ@ƒCƒ‹“ú•t‚̎擾(&T)...", M_SVR_GETDATES - MENUITEM "ƒƒOEƒtƒ@ƒCƒ‹‚Ì•\ަ(&V)...", M_VIEWLOG - MENUITEM "ƒRƒ}ƒ“ƒh‚ÌŽÀs(&X)...", M_EXECUTE - MENUITEM SEPARATOR - MENUITEM "ÅV•\ަ(&F)", M_REFRESH - MENUITEM "ƒvƒƒpƒeƒB[(&R)", M_PROPERTIES -END - -MENU_SVR_NONE MENU DISCARDABLE -BEGIN - POPUP "•\ަ(&V)" - BEGIN - MENUITEM "‘åƒAƒCƒRƒ“(&G)", M_SVR_VIEW_LARGE, CHECKED - MENUITEM "¬ƒAƒCƒRƒ“(&M)", M_SVR_VIEW_SMALL, CHECKED - MENUITEM "Ú×(&D)", M_SVR_VIEW_REPORT, CHECKED - MENUITEM SEPARATOR - MENUITEM "•W€(&N)", M_SVR_VIEW_ONEICON, CHECKED - MENUITEM "‚·‚ׂẴAƒCƒRƒ“(&A)", M_SVR_VIEW_TWOICONS, CHECKED - MENUITEM "ó‹µ‚Ì‚Ý(&S)", M_SVR_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "ƒ‚ƒjƒ^[‚³‚ê‚éƒT[ƒo[(&M)...", M_SUBSET - MENUITEM SEPARATOR - MENUITEM "‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒƒbƒN‰ðœ(&U)", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "‚·‚ׂăNƒ[ƒY(&C)", M_SVR_CLOSEALL - MENUITEM "‚·‚ׂčŐV•\ަ(&F)", M_REFRESHALL -END - -MENU_SET_NONE MENU DISCARDABLE -BEGIN - POPUP "•\ަ(&V)" - BEGIN - MENUITEM "ƒ{ƒŠƒ…[ƒ€‚²‚Æ(&V)", M_SET_VIEW_REPORT, CHECKED - MENUITEM "ƒp[ƒeƒBƒVƒ‡ƒ“‚²‚Æ(&P)", M_SET_VIEW_TREELIST, CHECKED - MENUITEM "Ú×‚È‚µ(&D)", M_SET_VIEW_TREE, CHECKED - MENUITEM SEPARATOR - MENUITEM "•W€(&N)", M_VIEW_ONEICON, CHECKED - MENUITEM "‚·‚ׂẴAƒCƒRƒ“(&A)", M_VIEW_TWOICONS, CHECKED - MENUITEM "ó‹µ‚Ì‚Ý(&S)", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̍쐬(&C)...", M_SET_CREATE - MENUITEM "ƒtƒ@ƒCƒ‹‚©‚畜Œ³(&R)...", M_SET_RESTORE - MENUITEM SEPARATOR - MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv(&B)...", M_SET_CLONE - MENUITEM SEPARATOR - MENUITEM "‚·‚ׂăƒbƒN‰ðœ(&U)", M_SET_UNLOCK - MENUITEM "‚·‚ׂčŐV•\ަ(&F)", M_REFRESHALL -END - -MENU_COLUMNS MENU DISCARDABLE -BEGIN - MENUITEM "—ñ(&C)...", M_COLUMNS -END - -MENU_SVC_BOS MENU DISCARDABLE -BEGIN - MENUITEM "ÄŽn“®(&R)", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "ƒƒOEƒtƒ@ƒCƒ‹‚Ì•\ަ(&V)", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "ÅV•\ަ(&F)", M_REFRESH - MENUITEM "ƒvƒƒpƒeƒB[(&R)", M_PROPERTIES -END - -MENU_SET_DRAGDROP MENU DISCARDABLE -BEGIN - MENUITEM "‚±‚±‚Ɉړ®(&M)...", M_SET_MOVEHERE - MENUITEM "‚±‚±‚É•¡»(&R)...", M_SET_REPHERE - MENUITEM SEPARATOR - MENUITEM "ŽæÁ‚µ(&C)", IDC_STATIC -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SERVICES DIALOGEX 0, 0, 179, 92 -STYLE DS_CENTER | WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 -BEGIN - LTEXT "ƒT[ƒrƒX:",IDC_SVC_DESC,0,5,179,8 - CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,0,17,179, - 55,WS_EX_STATICEDGE - PUSHBUTTON "ì¬(&C)...",IDC_SVC_CREATE,44,78,42,12 - PUSHBUTTON "íœ(&L)",IDC_SVC_DELETE,88,78,39,12 - PUSHBUTTON "ÄŽn“®(&R)",IDC_SVC_RESTART,129,78,45,12 -END - -IDD_AGGREGATES DIALOGEX 0, 0, 165, 84 -STYLE DS_CENTER | WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 -BEGIN - LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“:",IDC_AGG_DESC,0,5,159,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,0,16,165, - 47,WS_EX_STATICEDGE - PUSHBUTTON "ƒ{ƒŠƒ…[ƒ€‚̍쐬(&C)...",IDC_AGG_CREATESET,71,70,90,12 -END - -IDD_FILESETS DIALOGEX 0, 0, 231, 92 -STYLE DS_CENTER | WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 -BEGIN - LTEXT "ƒ{ƒŠƒ…[ƒ€:",IDC_SET_DESC,0,5,224,8 - CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,0,17,224, - 51,WS_EX_STATICEDGE - PUSHBUTTON "ì¬(&C)...",IDC_SET_CREATE,1,77,42,12 - PUSHBUTTON "íœ(&L)",IDC_SET_DELETE,45,77,39,12 - PUSHBUTTON "•¡»(&R)...",IDC_SET_REP,85,77,51,12 - PUSHBUTTON "Š„‚è“–‚ėʂ̐ݒè(&Q)...",IDC_SET_SETQUOTA,137,77,90,12 -END - -IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,23,216, - 129,WS_EX_CLIENTEDGE - PUSHBUTTON "ŠÇ—ŽÒ‚̒ljÁ(&A)",IDC_LIST_ADD,69,157,69,14 - PUSHBUTTON "ŠÇ—ŽÒ‚̍폜(&R)",IDC_LIST_REMOVE,138,157,80,14 - LTEXT "ƒT[ƒo[ %1 ‚ÌŠÇ—ŽÒ:",IDC_LIST_NAME,5,7,216,10 -END - -IDD_AGG_GENERAL DIALOGEX 0, 0, 267, 160 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ID:",IDC_STATIC,7,30,31,8 - LTEXT "(Æ‰ï’†)",IDC_AGG_ID,54,30,208,8 - LTEXT "‘•’u:",IDC_STATIC,7,46,31,8 - LTEXT "(Æ‰ï’†)",IDC_AGG_DEVICE,54,46,208,8 - LTEXT "ƒ{ƒŠƒ…[ƒ€:",IDC_STATIC,7,62,39,8 - LTEXT "(Æ‰ï’†)",IDC_AGG_FILESETS,54,62,208,8 - CONTROL "Œ‹‡ƒ{ƒŠƒ…[ƒ€Š„‚è“–‚Ä—Ê‚ª—e—ʂ𒴂¦‚½ê‡‚ÍŒx‚ð•\ަ(&V)", - IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 18,76,221,10 - LTEXT "Žg—p—¦:",IDC_STATIC,7,90,27,8 - LTEXT "(Æ‰ï’†)",IDC_AGG_USAGE,54,90,200,8 - CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,38,103,224,8, - WS_EX_STATICEDGE - CONTROL "ƒp[ƒeƒBƒVƒ‡ƒ“‚ÌŽg—p—¦‚ª’´‰ß‚µ‚½ê‡‚ÉŒx‚ð•\ަ(&W)", - IDC_AGG_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18, - 116,220,10 - CONTROL "‚±‚̃T[ƒo[‚̃fƒtƒHƒ‹ƒg‚µ‚«‚¢’l(&D)", - IDC_AGG_WARN_AGGFULL_DEF,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,49,129,203,9 - CONTROL "‚»‚̃TƒCƒY‚Ì",IDC_AGG_WARN_AGGFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,49,143,55,9 - EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,112,141,29,12, - ES_AUTOHSCROLL - LTEXT "% ‚Ì‚µ‚«‚¢’l(&T)",IDC_AGG_WARN_AGGFULL_DESC,166,143,92, - 8 - ICON IDI_AGGREGATE,IDC_STATIC,5,5,20,20 - LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“ %2 (ƒT[ƒo[ %1)",IDC_AGG_NAME,34,8,228, - 16 -END - -IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "IP ƒAƒhƒŒƒX:",IDC_STATIC,5,34,37,8 - LISTBOX IDC_SVR_ADDRESSES,53,32,70,10,LBS_NOSEL | NOT WS_BORDER | - WS_VSCROLL - PUSHBUTTON "ƒAƒhƒŒƒX‚̕ύX(&A)...",IDC_SVR_CHANGEADDR,134,32,82,12 - PUSHBUTTON "”FØ‚ª•K—v(&R)",IDC_SVR_AUTH_YES,41,81,84,12 - PUSHBUTTON "–¢”FØ‚ð‹–‰Â(&U)",IDC_SVR_AUTH_NO,129,81,80,12 - LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“”:",IDC_STATIC,11,131,90,8 - LTEXT "(Æ‰ï’†)",IDC_SVR_NUMAGGREGATES,113,131,99,8 - LTEXT "‘—e—Ê:",IDC_STATIC,11,148,48,8 - LTEXT "(Æ‰ï’†)",IDC_SVR_CAPACITY,113,148,99,8 - LTEXT "Œ‹‡ƒ{ƒŠƒ…[ƒ€Š„‚è“–‚Ä—Ê:",IDC_STATIC,11,165,93,8 - LTEXT "(Æ‰ï’†)",IDC_SVR_ALLOCATION,113,165,99,8 - ICON IDI_SERVER,IDC_STATIC,5,5,20,20 - LTEXT "(ƒT[ƒo[–¼)",IDC_SVR_NAME,39,10,179,15 - GROUPBOX "ƒZƒLƒ…ƒŠƒeƒB[",IDC_STATIC,5,52,216,52 - GROUPBOX "‹L‰¯ˆæ",IDC_STATIC,5,115,216,68 - LTEXT "‚±‚̃T[ƒo[‚Ö‚Ì‘SƒAƒNƒZƒX‚Ì”FØ‚ð•K—v‚ɂł«‚Ü‚·B", - IDC_STATIC,11,67,201,8 -END - -IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 244, 158 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - CONTROL "‚±‚̃T[ƒo[‚̃p[ƒeƒBƒVƒ‡ƒ“‚ª",IDC_SVR_WARN_AGGFULL, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,18,116,9 - EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,144,16,24,12,ES_AUTOHSCROLL - LTEXT "% ƒtƒ‹",IDC_STATIC,184,18,25,8 - CONTROL "‚±‚̃T[ƒo[‚̃{ƒŠƒ…[ƒ€‚ª",IDC_SVR_WARN_SETFULL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,12,32,116,9 - EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,144,30,24,12,ES_AUTOHSCROLL - LTEXT "% ƒtƒ‹",IDC_STATIC,184,32,25,8 - CONTROL "ƒp[ƒeƒBƒVƒ‡ƒ“‚ÌŒ‹‡Š„‚è“–‚Ä—Ê‚ª—e—ʂ𒴂¦‚½", - IDC_SVR_WARN_AGGALLOC,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,46,195,9 - CONTROL "‚±‚̃T[ƒo[‚̃T[ƒrƒX‚ªŽÀs‚ð’âŽ~‚µ‚½", - IDC_SVR_WARN_SVCSTOP,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,60,195,9 - CONTROL "‚±‚̃T[ƒo[‚̃{ƒŠƒ…[ƒ€‚É VLDB €–Ú‚ª‚È‚¢", - IDC_SVR_WARN_SETNOVLDB,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,74,195,9 - CONTROL "VLDB ‚ª‚±‚̃T[ƒo[‚̃Iƒtƒ‰ƒCƒ“Eƒp[ƒeƒBƒVƒ‡ƒ“‚ðŽQÆ", - IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,88,195,9 - CONTROL "VLDB ‚ª‚±‚̃T[ƒo[‚̃Iƒtƒ‰ƒCƒ“Eƒ{ƒŠƒ…[ƒ€‚ðŽQÆ", - IDC_SVR_WARN_SETNOSERV,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,103,195,9 - CONTROL "ƒT[ƒo[î•ñ‚ð",IDC_SVR_AUTOREFRESH,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,6,140,63,9 - EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,79,138,27,13,ES_AUTOHSCROLL - LTEXT "•ª‚²‚ƂɍŐV•\ަ",IDC_STATIC,125,140,65,8 - LTEXT "ˆÈ‰º‚̏ꍇ‚ÉŒx‚ð•\ަ",IDC_STATIC,5,5,195,8 -END - -IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 225, 207 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - PUSHBUTTON "ƒT[ƒrƒXEƒƒO‚Ì•\ަ(&V)",IDC_SVC_VIEWLOG,8,184,101,14 - PUSHBUTTON "‘¦ŽžŠJŽn(&S)",IDC_SVC_START,110,184,53,14 - PUSHBUTTON "‘¦Žž’âŽ~(&P)",IDC_SVC_STOP,164,184,53,14 - CONTROL "ƒT[ƒrƒX‚ª’âŽ~‚µ‚Ä‚¢‚½ê‡‚ÍŒx‚ð•\ަ(&W)", - IDC_SVC_WARNSTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 11,164,200,10 - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "ƒT[ƒrƒX %2 (ƒT[ƒo[ %1)",IDC_SVC_NAME,31,6,188,20 - LTEXT "ƒ^ƒCƒv:",IDC_STATIC,7,34,37,8 - LTEXT "(Æ‰ï’†)",IDC_SVC_TYPE,77,34,138,8 - LTEXT "ƒpƒ‰ƒ[ƒ^[:",IDC_STATIC,7,50,42,8 - EDITTEXT IDC_SVC_PARAMS,58,50,156,13,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP - LTEXT "ƒm[ƒeƒBƒtƒ@ƒCƒ„[:",IDC_STATIC,7,66,63,8 - LTEXT "(Æ‰ï’†)",IDC_SVC_NOTIFIER,77,66,138,8 - LTEXT "ÅIŠJŽn:",IDC_STATIC,7,82,34,8 - LTEXT "(Æ‰ï’†)",IDC_SVC_STARTDATE,77,82,138,8 - LTEXT "ÅI’âŽ~:",IDC_STATIC,7,98,34,8 - LTEXT "(Æ‰ï’†)",IDC_SVC_STOPDATE,77,98,138,8 - LTEXT "ÅIáŠQ:",IDC_STATIC,7,115,34,8 - EDITTEXT IDC_SVC_LASTERROR,58,114,156,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - GROUPBOX "ƒT[ƒrƒXó‹µ",IDC_STATIC,5,131,215,71 - LTEXT "‚±‚̃T[ƒrƒX‚ÌŒ»Ý‚̏󋵂𔻕ʒ†...",IDC_SVC_STATUS,11, - 147,203,8 -END - -IDD_SET_GENERAL DIALOGEX 0, 0, 273, 214 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒ{ƒŠƒ…[ƒ€ ID:",IDC_STATIC,5,30,51,8 - LTEXT "(•s–¾)",IDC_SET_ID,89,30,173,8 - LTEXT "ì¬:",IDC_STATIC,5,46,39,8 - LTEXT "(Æ‰ï’†)",IDC_SET_CREATEDATE,89,46,173,8 - LTEXT "XV:",IDC_STATIC,5,62,39,8 - LTEXT "(Æ‰ï’†)",IDC_SET_UPDATEDATE,89,62,173,8 - LTEXT "ƒAƒNƒZƒX:",IDC_STATIC,5,78,39,8 - LTEXT "(Æ‰ï’†)",IDC_SET_ACCESSDATE,89,78,173,8 - LTEXT "ƒoƒbƒNƒAƒbƒv:",IDC_STATIC,5,94,50,8 - LTEXT "(Æ‰ï’†)",IDC_SET_BACKUPDATE,89,94,173,8 - LTEXT "ƒtƒ@ƒCƒ‹EƒJƒEƒ“ƒg:",IDC_STATIC,5,110,74,8 - LTEXT "(Æ‰ï’†)",IDC_SET_FILES,89,110,173,8 - LTEXT "ó‹µ:",IDC_STATIC,5,125,18,8 - LTEXT "(Æ‰ï’†)",IDC_SET_STATUS,38,125,108,8 - PUSHBUTTON "ƒƒbƒN(&L)",IDC_SET_LOCK,152,123,49,12 - PUSHBUTTON "ƒƒbƒN‰ðœ(&U)",IDC_SET_UNLOCK,204,123,61,12 - LTEXT "Žg—p—¦:",IDC_STATIC,5,141,24,8 - LTEXT "(Æ‰ï’†)",IDC_SET_USAGE,38,141,125,8 - PUSHBUTTON "Š„‚è“–‚ėʂ̐ݒè(&Q)...",IDC_SET_QUOTA,175,139,90,12 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,49,156,213,8, - WS_EX_STATICEDGE - CONTROL "ƒ{ƒŠƒ…[ƒ€Žg—p—¦‚ª’´‰ß‚µ‚½ê‡‚ÍŒx‚ð•\ަ(&W)", - IDC_SET_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10, - 170,219,10 - CONTROL "‚±‚̃T[ƒo[‚̃fƒtƒHƒ‹ƒg‚µ‚«‚¢’l(&D) (ƒTƒCƒY‚Ì %1%%)", - IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,19,184,249,9 - CONTROL "‚»‚̃TƒCƒY‚Ì",IDC_SET_WARN_SETFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,19,197,59,9 - EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,86,195,29,12,ES_AUTOHSCROLL - LTEXT "% ‚Ì‚µ‚«‚¢’l(&T)",IDC_SET_WARN_SETFULL_DESC,147,197,64, - 8 - ICON IDI_FILESET,IDC_STATIC,5,5,20,20 - LTEXT "ƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2)", - IDC_SET_NAME,31,5,237,17 -END - -IDD_MAIN DIALOGEX 0, 0, 317, 226 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | - WS_SYSMENU | WS_THICKFRAME -CAPTION "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -MENU MENU_MAIN -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "‘I‘ð‚µ‚½ƒZƒ‹:",IDC_STATIC,2,8,50,8 - LTEXT "(ƒZƒ‹–¼‚ª‚±‚±‚É“ü‚è‚Ü‚·)",IDC_CELL,62,8,208,9 - LTEXT "AFS ƒg[ƒNƒ“:",IDC_STATIC,2,21,50,8 - LTEXT "%2:%1 (ƒg[ƒNƒ“‚ÌŠúŒÀ %3 ‚ɐ؂ê‚Ü‚·)",IDC_AFS_ID,62,21, - 218,16 - CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,43,313, - 181,WS_EX_CLIENTEDGE - CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 - ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 -STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "ƒT[ƒo[" -CLASS "ServerWindowClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - CONTROL "",IDC_TABS,"SysTabControl32",0x0,2,2,205,133 -END - -IDD_SVC_CREATE DIALOGEX 0, 0, 225, 233 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒT[ƒo[(&S):",IDC_STATIC,5,36,49,8 - COMBOBOX IDC_SVC_SERVER,62,33,116,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "ƒT[ƒrƒX(&V):",IDC_STATIC,5,52,49,8 - COMBOBOX IDC_SVC_NAME,62,50,116,104,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "ƒRƒ}ƒ“ƒh(&C):",IDC_STATIC,5,70,49,8 - EDITTEXT IDC_SVC_COMMAND,89,68,128,13,ES_AUTOHSCROLL - LTEXT "ƒpƒ‰ƒ[ƒ^[(&P):",IDC_STATIC,5,88,65,8 - EDITTEXT IDC_SVC_PARAMS,89,86,128,13,ES_AUTOHSCROLL - LTEXT "ƒm[ƒeƒBƒtƒ@ƒCƒ„[(&N):",IDC_STATIC,5,105,75,8 - EDITTEXT IDC_SVC_NOTIFIER,89,103,128,13,ES_AUTOHSCROLL - LTEXT "ƒƒOEƒtƒ@ƒCƒ‹(&L):",IDC_STATIC,5,122,72,8 - EDITTEXT IDC_SVC_LOGFILE,89,120,128,13,ES_AUTOHSCROLL - CONTROL "ƒVƒ“ƒvƒ‹(&I) (˜A‘±‚µ‚ÄŽÀs)",IDC_SVC_TYPE_SIMPLE,"Button", - BS_AUTORADIOBUTTON,11,154,201,10 - CONTROL "‚±‚̃T[ƒrƒX‚𑦎žŠJŽn(&T)",IDC_SVC_RUNNOW,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 - CONTROL "FS(&F) (ƒtƒ@ƒCƒ‹EƒVƒXƒeƒ€)",IDC_SVC_TYPE_FS,"Button", - BS_AUTORADIOBUTTON,11,180,201,10 - CONTROL "Cron(&R) (Žw’è‚ÌŠÔŠu‚ÅŽÀs)",IDC_SVC_TYPE_CRON,"Button", - BS_AUTORADIOBUTTON,11,195,201,10 - LTEXT "ŽÀs“úŽž(&W):",IDC_STATIC,23,209,42,8 - COMBOBOX IDC_SVC_RUNDAY,76,207,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,158,207, - 53,13,WS_EX_CLIENTEDGE - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "V‹KƒT[ƒrƒX",IDC_SVC_DESC,35,9,179,14 - GROUPBOX "ƒT[ƒrƒXEƒ^ƒCƒv",IDC_STATIC,5,141,215,87 -END - -IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, - 199,58,WS_EX_CLIENTEDGE - PUSHBUTTON "‘¦Žž‰ð•ú(&R)",IDC_SET_RELEASE,11,145,53,14 - PUSHBUTTON "ì¬(&C)...",IDC_SET_REPSITE_ADD,126,145,42,14 - PUSHBUTTON "íœ(&L)",IDC_SET_REPSITE_DELETE,172,145,38,14 - LTEXT "ƒT[ƒo[:",-1,9,31,42,8 - LTEXT "(ƒT[ƒo[–¼)",IDC_SET_SERVER,58,31,156,8 - LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“:",-1,9,44,42,8 - LTEXT "(ƒp[ƒeƒBƒVƒ‡ƒ“–¼)",IDC_SET_AGGREGATE,58,44,156,8 - LTEXT "ƒ{ƒŠƒ…[ƒ€:",-1,9,18,42,8 - LTEXT "(ƒ{ƒŠƒ…[ƒ€–¼)",IDC_SET_NAME,58,18,156,8 - GROUPBOX "“ǂݎæ‚è / ‘‚«ž‚݃{ƒŠƒ…[ƒ€",-1,5,5,211,56 - GROUPBOX "ƒ{ƒŠƒ…[ƒ€EƒŒƒvƒŠƒJ",-1,5,67,211,96 -END - -IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 257 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒZƒ‹‚Ì‘I‘ð - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒZƒ‹(&C):",IDC_STATIC,4,24,33,8 - COMBOBOX IDC_OPENCELL_CELL,43,22,171,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - GROUPBOX "AFS ”FØ",IDC_STATIC,4,44,211,92 - LTEXT "AFS ID(&I):",IDC_STATIC,22,100,55,8 - EDITTEXT IDC_OPENCELL_ID,100,98,109,14,ES_AUTOHSCROLL - LTEXT "AFS ƒpƒXƒ[ƒh(&P):",IDC_STATIC,22,116,67,8 - EDITTEXT IDC_OPENCELL_PASSWORD,100,114,109,14,ES_PASSWORD | - ES_AUTOHSCROLL - PUSHBUTTON "Šg’£(&V) >>",IDC_ADVANCED,4,140,53,14 - DEFPUSHBUTTON "—¹‰ð",IDOK,76,140,41,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,120,140,41,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,164,140,45,14 - CONTROL "‚±‚̃Zƒ‹‚Ì‚·‚ׂẴT[ƒo[‚ðƒ‚ƒjƒ^[(&L)",IDC_MON_ALL, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10,196,185,9 - CONTROL "1 ƒT[ƒo[‚̂݃‚ƒjƒ^[(&M):",IDC_MON_ONE,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,10,209,106,10 - EDITTEXT IDC_MON_SERVER,125,207,83,13,ES_AUTOHSCROLL - CONTROL "ŽŸ‚̃TƒuƒZƒbƒg‚̃T[ƒo[‚̂݃‚ƒjƒ^[(&S):",IDC_MON_SOME, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10,223,146,10 - COMBOBOX IDC_MON_SUBSET,125,235,83,93,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "‘€ì‚µ‚½‚¢ AFS ƒZƒ‹‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢B",IDC_STATIC,4,7, - 200,8 - GROUPBOX "ƒT[ƒo[‚̃‚ƒjƒ^[",IDC_ADVANCED_GROUP,4,162,211,91 - LTEXT "‚æ‚è‚æ‚¢ƒpƒtƒH[ƒ}ƒ“ƒX‚Ì‚½‚߂ɁA‚±‚̃Zƒ‹‚ÅŽg—p‰Â”\‚ȃT[ƒo[‚̃TƒuƒZƒbƒg‚Ì‚Ý‚ðƒ‚ƒjƒ^[‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", - IDC_STATIC,10,172,199,20 - LTEXT "(Æ‰ï’†...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "ƒZƒ‹‚ÌŠÇ—‚É‚Í AFS ƒpƒXƒ[ƒh‚ðÄ“ü—Í‚µ‚Ä‚­‚¾‚³‚¢:", - IDC_STATIC,10,85,197,8 - LTEXT "‘I‘ð‚µ‚½ƒZƒ‹“à‚ÌŒ»Ý‚Ì AFS ƒg[ƒNƒ“:",IDC_STATIC,10,57, - 196,8 -END - -IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Œx - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - CONTROL "ƒ^ƒXƒN‚ª³í‚ÉŠ®—¹‚·‚é‚܂őҋ@‚𑱍s(&C)", - IDC_TIMEOUT_WAIT,"Button",BS_AUTORADIOBUTTON,21,87,208, - 10 - CONTROL "ƒ^ƒXƒN‚̏I—¹(&T)",IDC_TIMEOUT_KILL,"Button", - BS_AUTORADIOBUTTON,21,101,208,10 - DEFPUSHBUTTON "—¹‰ð",IDOK,93,137,50,14 - LTEXT "ƒ^ƒXƒN‚ÌŽÀsŒo‰ßŽžŠÔ:",IDC_STATIC,6,119,137,8 - LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,155,119,29,8 - LTEXT "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚Í—\‘zŠO‚É’·‚¢ŽžŠÔAƒlƒbƒgƒ[ƒNEƒ^ƒXƒN‚ÌŠ®—¹‚ð‘Ò‹@‚µ‚Ü‚µ‚½B", - IDC_STATIC,4,7,228,18 - LTEXT "ƒ^ƒXƒN‚ÉŽÀs‚𑱂¯‚³‚¹‚é („§) ‚©Aƒ^ƒXƒN‚ªŠ®—¹‚µ‚È‚¢‚ÆŽv‚í‚ê‚éê‡‚Í AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚Ƀ^ƒXƒN‚ðI—¹‚³‚¹‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", - IDC_STATIC,4,28,228,23 - LTEXT "‚±‚̃EƒBƒ“ƒhƒE‚ª•\ަ‚³‚ê‚Ä‚àAƒ^ƒXƒN‚ª‚Ü‚¾is’†‚Å‚ ‚邱‚ƂɒˆÓ‚µ‚Ä‚­‚¾‚³‚¢Bƒ^ƒXƒN‚ªŠ®—¹‚·‚邯A‚±‚̃EƒBƒ“ƒhƒE‚ÍŽ©“®“I‚ɃNƒ[ƒY‚µ‚Ü‚·B", - IDC_STATIC,4,59,228,21 -END - -IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 -STYLE WS_POPUP | WS_CAPTION -CAPTION "—ñ" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒŠƒXƒgŽž‚É•\ަ‚·‚é—ñ‚Ì‘I‘ð(&S):",IDC_STATIC,5,7,111,8 - COMBOBOX IDC_COLUMNS,134,5,147,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Žg—p‰Â”\‚È—ñ(&C):",IDC_STATIC,12,40,100,8 - LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "•\ަ‚·‚é—ñ(&I):",IDC_STATIC,173,41,100,8 - LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "’ljÁ(&A) >>",IDC_COL_INSERT,119,68,46,14 - PUSHBUTTON "<< íœ(&R)",IDC_COL_DELETE,119,88,47,14 - PUSHBUTTON "ã‚Ɉړ®(&U)",IDC_COL_UP,170,124,53,14 - PUSHBUTTON "‰º‚Ɉړ®(&D)",IDC_COL_DOWN,224,124,53,14 - GROUPBOX "—ñ‚ÌƒŠƒXƒg",IDC_STATIC,5,25,276,118 -END - -IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 269, 72 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "ƒŠƒtƒŒƒbƒVƒ…’† - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, - 256,8 - LTEXT "0%% Š®—¹",IDC_REFRESH_PERCENT,4,49,171,8 - LTEXT "",IDC_REFRESH_CURRENT,4,60,192,8 - LTEXT "‚¨‘Ò‚¿‚­‚¾‚³‚¢...",IDC_REFRESH_DESC,4,7,256,25 - PUSHBUTTON "ƒXƒLƒbƒv(&S)",IDC_REFRESH_SKIP,205,54,53,12,NOT - WS_TABSTOP -END - -IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚̍쐬" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "–¼‘O(&N):",IDC_STATIC,6,30,39,8 - EDITTEXT IDC_SET_NAME,76,28,116,14,ES_AUTOHSCROLL - LTEXT "Š„‚è“–‚Ä—Ê(&Q):",IDC_STATIC,6,48,58,8 - EDITTEXT IDC_SET_QUOTA,76,46,32,14,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,120,47,30,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "ƒoƒbƒNƒAƒbƒv(&B):",IDC_STATIC,6,66,60,8 - CONTROL "‚±‚̃{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚àì¬(&R)", - IDC_SET_CLONE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,76, - 66,210,8 - LTEXT "ƒT[ƒo[(&S):",IDC_STATIC,6,84,49,8 - COMBOBOX IDC_SET_SERVER,76,82,116,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“(&P):",IDC_STATIC,6,100,73,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,46,112,271, - 70,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "—¹‰ð",IDOK,152,188,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,207,188,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,263,188,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "V‹Kƒ{ƒŠƒ…[ƒ€",IDC_STATIC,31,7,284,15 -END - -IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 307, 103 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚̍폜" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - DEFPUSHBUTTON "ŽæÁ‚µ",IDCANCEL,196,85,50,14 - CONTROL "ƒ{ƒŠƒ…[ƒ€ %3 ‚ðƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚©‚çíœ(&D)", - IDC_DELSET_SERVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 8,48,295,11 - PUSHBUTTON "—¹‰ð",IDOK,142,85,50,14 - CONTROL "ƒ{ƒŠƒ…[ƒ€ %3 ‚Ì VLDB €–Ú‚ðíœ(&V)",IDC_DELSET_VLDB, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,67,282,10 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,250,85,50,14 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "’ˆÓ!\n\n‚±‚Ì‘€ì‚ðs‚¤‚ƁAƒ{ƒŠƒ…[ƒ€ %3 ‚͉i‹v‚ɍ폜‚³‚ê‚Ü‚·B", - IDC_DELSET_DESC,31,8,272,29 -END - -IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - DEFPUSHBUTTON "—¹‰ð",IDOK,178,66,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,232,66,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,286,66,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "ƒ{ƒŠƒ…[ƒ€EƒoƒbƒNƒAƒbƒv‚́A‚»‚̃{ƒŠƒ…[ƒ€‚̓ǂݎæ‚èê—pƒRƒs[‚̂悤‚È“­‚«‚ð‚µ‚Ü‚·B“ǂݎæ‚è/‘‚«ž‚݃{ƒŠƒ…[ƒ€‚̓oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚ð 1 ‚‚¾‚¯Ž‚‚±‚Æ‚ª‚Å‚«‚Ü‚·B", - IDC_STATIC,29,5,312,16 - LTEXT "ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€ %3 ‚̃oƒbƒNƒAƒbƒv‚ðì¬‚·‚é‚ɂ́Au—¹‰ðv‚ðƒNƒŠƒbƒN‚µ‚Ü‚·B‚±‚̃{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv‚ª‚·‚łɑ¶Ý‚·‚éê‡AƒoƒbƒNƒAƒbƒv‚͍XV‚³‚ê‚Ü‚·B", - IDC_CLONE_DESC,29,29,312,30 -END - -IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - GROUPBOX "Šù’m‚Ì–â‘è",IDC_PROBLEM_BOX,5,36,215,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,138,120,61,12 - ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "ƒT[ƒrƒX %2 (ƒT[ƒo[ %1)",IDC_PROBLEM_TITLE,32,8,186, - 21 -END - -IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - GROUPBOX "Šù’m‚Ì–â‘è",IDC_PROBLEM_BOX,5,38,216,112 - LTEXT "99:",IDC_PROBLEM_HEADER,11,51,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,27,60,172,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,204,51,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,139,134,61,12 - ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "%1",IDC_PROBLEM_TITLE,32,10,189,20 -END - -IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - GROUPBOX "Šù’m‚Ì–â‘è",IDC_PROBLEM_BOX,5,35,247,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,170,119,61,12 - ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“ %2 (ƒT[ƒo[ %1)",IDC_PROBLEM_TITLE,33,8, - 219,16 -END - -IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - GROUPBOX "Šù’m‚Ì–â‘è",IDC_PROBLEM_BOX,5,35,263,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,249,48,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 - ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "ƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2)", - IDC_PROBLEM_TITLE,31,5,237,20 -END - -IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚̈ړ®" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,72,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "—¹‰ð",IDOK,115,153,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,167,153,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,219,153,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,236,24 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 - LTEXT "ƒ{ƒŠƒ…[ƒ€‚̈ړ®æ(&M):",IDC_STATIC,4,41,116,8 -END - -IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 307, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€ˆÚ“®’† - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,5,0,295,26 - LTEXT "ƒ{ƒŠƒ…[ƒ€ %3 ‚ðƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚©‚çƒT[ƒo[ %4 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %5 ‚Ɉړ®’†...", - IDC_MOVESET_DESC,1,29,305,34 -END - -IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 277, 106 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒƒOEƒtƒ@ƒCƒ‹‚Ì•\ަ" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒT[ƒo[‚̃ƒOEƒtƒ@ƒCƒ‹‚ð•\ަ(&S):",IDC_STATIC,2,35, - 137,8 - COMBOBOX IDC_VIEWLOG_SERVER,82,45,126,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "•\ަ‚·‚éƒT[ƒo[‚̃tƒ@ƒCƒ‹(&F):",IDC_STATIC,2,63,121,8 - EDITTEXT IDC_VIEWLOG_FILENAME,82,73,185,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "—¹‰ð",IDOK,166,91,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,220,91,50,14 - ICON IDI_SERVICE,IDC_STATIC,2,1,20,20 - LTEXT "•\ަ‚µ‚½‚¢ƒƒOEƒtƒ@ƒCƒ‹‚Ì‘SƒpƒX‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B", - IDC_VIEWLOG_DESC,29,1,243,28 -END - -IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 307, 185 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "ƒƒOEƒtƒ@ƒCƒ‹‚Ì•\ަ" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒtƒ@ƒCƒ‹EƒRƒ“ƒeƒ“ƒc:",IDC_SVC_VIEWLOG_CONTENTS,4,48, - 280,8 - EDITTEXT IDC_VIEWLOG_TEXT,4,61,280,99,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL - PUSHBUTTON "•Ê–¼•ÛŠÇ(&A)...",IDC_VIEWLOG_SAVEAS,167,167,58,14 - DEFPUSHBUTTON "ƒNƒ[ƒY(&C)",IDOK,227,167,53,14 - ICON IDI_SERVICE,-1,4,7,20,20 - LTEXT "ƒT[ƒo[ %1 ‚Ì [ƒT[ƒrƒX %2 ‚Ì] ƒƒOEƒtƒ@ƒCƒ‹", - IDC_SVC_VIEWLOG_DESC,30,9,273,15 - LTEXT "ƒT[ƒo[‚̃tƒ@ƒCƒ‹–¼: %1",IDC_SVC_VIEWLOG_FILENAME,30, - 32,273,8 -END - -IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€Š„‚è“–‚ėʂ̐ݒè" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "Œ»sŠ„‚è“–‚Ä—Ê:",IDC_STATIC,4,66,50,8 - LTEXT "(•s–¾)",IDC_SET_USAGE,62,66,194,8 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,62,78,201,8, - WS_EX_STATICEDGE - LTEXT "V‹KŠ„‚è“–‚Ä—Ê(&Q):",IDC_STATIC,4,95,65,8 - EDITTEXT IDC_SET_QUOTA,79,93,32,13,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,123,93,30,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "—¹‰ð",IDOK,106,113,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,160,113,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,214,113,50,14 - PUSHBUTTON "ƒvƒƒpƒeƒB[(&P)...",IDC_AGG_PROPERTIES,193,34,69,12 - LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“:",IDC_STATIC,4,36,50,8 - LTEXT "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2",IDC_SET_AGGREGATE,62, - 36,123,21 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "ƒ{ƒŠƒ…[ƒ€ %1",IDC_SET_NAME,36,8,228,19 -END - -IDD_ACTIONS DIALOGEX 0, 0, 236, 58 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "is’†‚Ì‘€ì - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 -BEGIN - LTEXT "ŽŸ‚Ì‘€ì‚ªŒ»Ýis’†‚Å‚·:",IDC_ACTION_DESC,2,2,232,8 - CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | - 0x3,2,14,232,43 -END - -IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "VLDB ‚Ì“¯Šú‰»" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - DEFPUSHBUTTON "—¹‰ð",IDOK,107,79,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,161,79,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,215,79,50,14 - ICON 32515,IDC_STATIC,4,4,20,20 - LTEXT "(ŽÀsŽž‚ɐݒè)",IDC_SYNC_DESC,29,4,236,32 - LTEXT "(ŽÀsŽž‚ɐݒè)",IDC_SYNC_DESC2,29,46,236,24 -END - -IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚Ì•¡»" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,67,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "—¹‰ð",IDOK,112,150,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,166,150,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,220,150,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,21 - LTEXT "ƒ{ƒŠƒ…[ƒ€ %3 ‚̐V‹KƒŒƒvƒŠƒJ",IDC_SET_NAME,31,7,242,17 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 - LTEXT "‚±‚̃{ƒŠƒ…[ƒ€‚̐V‹KƒŒƒvƒŠƒJ‚ðì¬‚·‚éêŠ(&C):", - IDC_STATIC,4,34,259,8 -END - -IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 248, 156 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒtƒ@ƒCƒ‹‚̃Cƒ“ƒXƒg[ƒ‹" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒ\[ƒXEƒtƒ@ƒCƒ‹(&F):",IDC_STATIC,6,62,81,8 - EDITTEXT IDC_FILENAME,51,72,135,14,ES_AUTOHSCROLL - PUSHBUTTON "ŽQÆ(&B)...",IDC_BROWSE,191,72,50,14 - LTEXT "ƒ^[ƒQƒbƒgEƒT[ƒo[(&S):",IDC_STATIC,6,88,97,8 - COMBOBOX IDC_SERVER,51,97,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "ƒ^[ƒQƒbƒg–¼(&N):",IDC_STATIC,6,112,66,8 - EDITTEXT IDC_DIRECTORY,51,121,135,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "—¹‰ð",IDOK,83,140,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,137,140,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,191,140,50,14 - ICON IDI_INSTALL,IDC_STATIC,4,2,20,20 - LTEXT "ƒT[ƒo[‚Ƀtƒ@ƒCƒ‹‚ðƒCƒ“ƒXƒg[ƒ‹",IDC_STATIC,32,6,205, - 15 - LTEXT "(ƒeƒLƒXƒg‚ÍŽÀsŽž‚ɐݒè)\n(ƒeƒLƒXƒg‚ÍŽÀsŽž‚ɐݒè)\n(ƒeƒLƒXƒg‚ÍŽÀsŽž‚ɐݒè)\n(ƒeƒLƒXƒg‚ÍŽÀsŽž‚ɐݒè)", - IDC_INSTALL_DESC,4,27,240,31 -END - -IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒtƒ@ƒCƒ‹‚̃Aƒ“ƒCƒ“ƒXƒg[ƒ‹" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒT[ƒo[(&S):",IDC_STATIC,6,66,49,8 - COMBOBOX IDC_SERVER,64,64,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "ƒ^[ƒQƒbƒgEƒtƒ@ƒCƒ‹(&F):",IDC_STATIC,6,85,97,8 - EDITTEXT IDC_FILENAME,64,97,175,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "—¹‰ð",IDOK,88,119,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,141,119,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,194,119,50,14 - ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 - LTEXT "ƒT[ƒo[‚©‚çƒtƒ@ƒCƒ‹‚ðƒAƒ“ƒCƒ“ƒXƒg[ƒ‹",IDC_STATIC,32, - 12,205,8 - LTEXT "‚±‚Ì‘€ì‚́A“Á’è‚̃T[ƒo[ã‚ɈȑO‚ɃCƒ“ƒXƒg[ƒ‹‚³‚ꂽƒtƒ@ƒCƒ‹‚̃Rƒs[‚𕜌³‚µ‚Ü‚·B‘I‘ð‚µ‚½ƒtƒ@ƒCƒ‹‚ɈȑOƒCƒ“ƒXƒg[ƒ‹‚³‚ꂽƒRƒs[‚ª‚È‚¢ê‡Aƒtƒ@ƒCƒ‹‚͍폜‚³‚ê‚Ü‚·B", - IDC_STATIC,6,29,234,26 -END - -IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 255, 141 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "‹Œƒtƒ@ƒCƒ‹‚̍폜" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒT[ƒo[:",-1,4,56,41,8 - COMBOBOX IDC_SERVER,57,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "‚·‚ׂẴRƒAEƒtƒ@ƒCƒ‹‚ðíœ(&C)",IDC_OP_DELETE_CORE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,85,138,10 - CONTROL "‚·‚×‚Ä‚Ì .BAK ƒtƒ@ƒCƒ‹‚ðíœ(&B) (ƒtƒ@ƒCƒ‹EƒoƒbƒNƒAƒbƒv)", - IDC_OP_DELETE_BAK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 13,96,229,10 - CONTROL "‚·‚×‚Ä‚Ì .OLD ƒtƒ@ƒCƒ‹‚ðíœ(&O) (‹Œƒtƒ@ƒCƒ‹EƒoƒbƒNƒAƒbƒv)", - IDC_OP_DELETE_OLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 13,107,232,10 - DEFPUSHBUTTON "—¹‰ð",IDOK,38,121,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,92,121,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,201,121,50,14 - ICON IDI_PRUNE,-1,6,5,20,20 - LTEXT "‹Œƒtƒ@ƒCƒ‹‚ðƒT[ƒo[‚©‚çíœ",-1,39,10,205,11 - LTEXT "‚±‚Ì‘€ì‚́A“Á’è‚̃T[ƒo[‚ɃCƒ“ƒXƒg[ƒ‹‚³‚ꂽƒtƒ@ƒCƒ‹‚̃oƒbƒNƒAƒbƒvEƒRƒs[‚ðíœ‚µ‚Ü‚·B", - -1,7,32,240,16 - LTEXT "íœ‚·‚éƒtƒ@ƒCƒ‹:",-1,4,73,66,8 -END - -IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚Ì–¼‘O•ύX" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "Œ»Ý‚Ì–¼‘O(&O):",IDC_STATIC,31,67,51,8 - EDITTEXT IDC_RENSET_OLD,94,65,122,14,ES_AUTOHSCROLL | ES_READONLY - LTEXT "V‚µ‚¢–¼‘O(&N):",IDC_STATIC,31,85,51,8 - EDITTEXT IDC_RENSET_NEW,94,83,122,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "—¹‰ð",IDOK,112,111,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,166,111,50,14 - PUSHBUTTON "ƒwƒ‹ƒv",9,220,111,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,21 - LTEXT "ƒ{ƒŠƒ…[ƒ€ %3 ‚𖼑O•ύX‚·‚é‚ɂ́AV‚µ‚¢–¼‘O‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢BŽ©“®“I‚Ƀ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv‚Æ‚»‚Ì‚·‚ׂẴŒƒvƒŠƒJ‚Ì–¼‘O‚ª•ύX‚³‚ê‚Ü‚·B\n\n’ˆÓ: ƒ}ƒEƒ“ƒg‚³‚ꂽƒ{ƒŠƒ…[ƒ€‚𖼑O•ύX‚·‚éê‡‚́A‚»‚̃}ƒEƒ“ƒgEƒ|ƒCƒ“ƒg‚̍폜‚ƍč쐬‚ª•K—v‚ɂȂè‚Ü‚·B", - IDC_RENSET_DESC,29,7,242,48 -END - -IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 307, 69 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒT[ƒrƒX‚̍폜" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - DEFPUSHBUTTON "ŽæÁ‚µ",IDCANCEL,195,47,50,14 - PUSHBUTTON "—¹‰ð",IDOK,141,47,50,14 - PUSHBUTTON "ƒwƒ‹ƒv",9,249,47,50,14 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "’ˆÓ!\n\n‚±‚Ì‘€ì‚É‚æ‚èAƒT[ƒrƒX %2 ‚Í’âŽ~‚³‚êAƒT[ƒo[ %1 ‚©‚çíœ‚³‚ê‚Ü‚·B", - IDC_DELSVC_DESC,31,7,266,33 -END - -IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒtƒ@ƒCƒ‹“ú•t‚̎擾" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒT[ƒo[(&S):",-1,4,56,49,8 - COMBOBOX IDC_SERVER,62,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Æ‰ï‚·‚éƒtƒ@ƒCƒ‹(&F):",-1,4,73,81,8 - EDITTEXT IDC_FILENAME,62,85,135,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "—¹‰ð",IDOK,84,104,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,138,104,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,192,104,50,14 - ICON IDI_GETDATES,-1,4,4,20,20 - LTEXT "ƒT[ƒo[‚̃tƒ@ƒCƒ‹‚Ì“ú•t‚ðŽæ“¾",-1,32,10,212,10 - LTEXT "‚±‚Ì‘€ì‚́Aƒtƒ@ƒCƒ‹‚Æ‚»‚̃oƒbƒNƒAƒbƒv (‘¶Ý‚·‚éê‡) ‚ªÅŒã‚ɕύX‚³‚ꂽ“ú•t‚ðŽæ“¾‚µ‚Ü‚·B", - -1,6,29,234,16 -END - -IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒtƒ@ƒCƒ‹“ú•t‚̎擾 - Œ‹‰Ê" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒT[ƒo[:",IDC_STATIC,6,30,39,8 - LTEXT "(ŽÀsŽž‚ɐݒè)",IDC_SERVER,58,30,179,8 - LTEXT "ƒtƒ@ƒCƒ‹–¼:",IDC_STATIC,6,45,42,8 - LTEXT "(ŽÀsŽž‚ɐݒè)",IDC_FILENAME,58,45,179,8 - LTEXT "ƒtƒ@ƒCƒ‹“ú•t:",IDC_STATIC,6,60,44,8 - LTEXT "(•s–¾Aƒtƒ@ƒCƒ‹‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ)",IDC_DATE_FILE,58,60, - 179,8 - LTEXT ".BAK “ú•t:",IDC_STATIC,6,75,37,8 - LTEXT "(•s–¾Aƒtƒ@ƒCƒ‹‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ)",IDC_DATE_BAK,58,75, - 179,8 - LTEXT ".OLD “ú•t:",IDC_STATIC,6,90,37,8 - LTEXT "(•s–¾Aƒtƒ@ƒCƒ‹‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ)",IDC_DATE_OLD,58,90, - 179,8 - DEFPUSHBUTTON "ƒNƒ[ƒY(&C)",IDOK,99,112,53,14 - ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 - LTEXT "ƒT[ƒo[‚̃tƒ@ƒCƒ‹‚Ì“ú•t‚ðŽæ“¾",IDC_STATIC,32,12,212,8 -END - -IDD_SET_DUMP DIALOGEX 0, 0, 307, 145 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚̃_ƒ“ƒv - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ì¬‚·‚éƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹(&N):",IDC_STATIC,4,36,114,8 - EDITTEXT IDC_DUMP_FILENAME,82,46,151,14,ES_AUTOHSCROLL - PUSHBUTTON "ŽQÆ(&B)...",IDC_DUMP_BROWSE,239,46,49,14 - CONTROL "ƒ{ƒŠƒ…[ƒ€ %3 (ƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2) ‚Ì“à—e‘S‘Ì‚ðƒ_ƒ“ƒv(&E)", - IDC_DUMP_FULL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,8, - 75,289,13 - CONTROL "‚±‚Ì“úŽžˆÈ~‚ɕύX‚³‚ꂽƒtƒ@ƒCƒ‹‚̂݃_ƒ“ƒv(&S)", - IDC_DUMP_LIMIT_TIME,"Button",BS_AUTORADIOBUTTON,8,96,157, - 10 - CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,171,103, - 51,13,WS_EX_CLIENTEDGE - CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,231,103, - 56,13,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "—¹‰ð",IDOK,141,126,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,193,126,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,249,126,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "‚±‚Ì‘€ì‚̓{ƒŠƒ…[ƒ€‚Ì“à—e‚ð 1 ‚‚̃tƒ@ƒCƒ‹‚ɃRƒs[‚·‚邽‚߁Aƒ{ƒŠƒ…[ƒ€‚ðŠÈ’P‚ɃoƒbƒNƒAƒbƒv‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B‚±‚Ì•û–@‚Ń_ƒ“ƒv‚³‚ꂽƒ{ƒŠƒ…[ƒ€‚Ì“à—e‚́AŒã‚Å•œŒ³‚ª‰Â”\‚Å‚·B", - IDC_STATIC,30,7,255,24 - GROUPBOX "ƒ_ƒ“ƒvEƒpƒ‰ƒ[ƒ^[",IDC_STATIC,4,62,299,58 -END - -IDD_SET_RESTORE DIALOGEX 0, 0, 292, 248 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚Ì•œŒ³ - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "•œŒ³‚·‚éƒtƒ@ƒCƒ‹(&R):",IDC_STATIC,4,32,62,8 - EDITTEXT IDC_RESTORE_FILENAME,75,29,154,14,ES_AUTOHSCROLL - PUSHBUTTON "ŽQÆ(&B)...",IDC_RESTORE_BROWSE,236,29,50,14 - CONTROL "‚±‚ê‚Í‘•ªƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹‚Å‚·(&I)", - IDC_RESTORE_INCREMENTAL,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,75,50,142,10 - LTEXT "ƒ{ƒŠƒ…[ƒ€(&V):",IDC_STATIC,11,103,48,8 - EDITTEXT IDC_RESTORE_SETNAME,75,101,115,14,ES_AUTOHSCROLL - LTEXT "ƒT[ƒo[(&S):",IDC_STATIC,11,146,44,8 - COMBOBOX IDC_RESTORE_SERVER,75,145,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“(&P):",IDC_STATIC,11,161,55,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,50,176,231, - 42,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "—¹‰ð",IDOK,125,229,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,180,229,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,235,229,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "ƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹‚©‚çƒ{ƒŠƒ…[ƒ€‚𕜌³",IDC_STATIC,33,8, - 255,9 - GROUPBOX "ƒ^[ƒQƒbƒgEƒ{ƒŠƒ…[ƒ€",IDC_STATIC,4,63,284,160 - LTEXT "ƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹‚©‚çƒ{ƒŠƒ…[ƒ€‚𕜌³‚·‚邯‚«‚́AV‚µ‚¢ƒ{ƒŠƒ…[ƒ€‚ðì¬‚·‚é‚©AŠù‘¶‚̓ǂݎæ‚è/‘‚«ž‚݃{ƒŠƒ…[ƒ€‚ɏ㏑‚«‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", - IDC_STATIC,8,76,276,18 - LTEXT "(ŽÀsŽž‚ɐݒè)\n(ŽÀsŽž‚ɐݒè)",IDC_RESTORE_CREATE,31, - 120,253,17 -END - -IDD_SVC_BOS DIALOGEX 0, 0, 265, 207 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - CONTROL "‚±‚̃T[ƒo[‚Ì‘SƒT[ƒrƒX‚ð’èŠú“I‚É’âŽ~/ÄŽn“®(&P)", - IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, - 76,204,10 - LTEXT "ÄŽn“®(&R)",IDC_BOS_GENRES_DESC1,21,92,37,8 - COMBOBOX IDC_BOS_GENRES_DATE,65,89,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,157, - 89,53,13,WS_EX_CLIENTEDGE - CONTROL "‚±‚̃T[ƒo[‚Ì‘SƒT[ƒrƒX‚̐V‹KƒoƒCƒiƒŠ[‚ð’èŠú“I‚ɃeƒXƒg(&B)", - IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, - 157,246,10 - LTEXT "ƒeƒXƒg(&S)",IDC_BOS_BINRES_DESC1,21,173,36,8 - COMBOBOX IDC_BOS_BINRES_DATE,65,170,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,157, - 170,53,13,WS_EX_CLIENTEDGE - ICON IDI_BOSSERVICE,IDC_STATIC,5,5,20,20 - LTEXT "ƒT[ƒrƒX %2 (ƒT[ƒo[ %1)",IDC_SVC_NAME,33,8,224,16 - GROUPBOX "BOS ƒT[ƒrƒX",IDC_STATIC,5,33,254,169 - LTEXT "BOS ƒT[ƒrƒX‚ðŽg—p‚µ‚āA‚±‚̃T[ƒo[‚Ì‚·‚ׂẴT[ƒrƒX (BOS ƒT[ƒrƒXŽ©‘Ì‚ðŠÜ‚Þ) ‚ð’âŽ~‚¨‚æ‚эĎn“®‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", - IDC_STATIC,9,47,248,22 - LTEXT "‚Ü‚½ABOS ƒT[ƒrƒX‚ðŽg—p‚µ‚āAƒT[ƒo[‚Ì‚·‚ׂẴT[ƒrƒX‚ð’èŠú“I‚ɃeƒXƒg‚µAƒoƒCƒiƒŠ[Eƒtƒ@ƒCƒ‹‚ªXV‚³‚ꂽƒT[ƒrƒX‚݂̂ð’âŽ~‚¨‚æ‚эĎn“®‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", - IDC_STATIC,11,113,240,35 -END - -IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 307, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚̃_ƒ“ƒv’† - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,4,0,296,30 - LTEXT "ƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹ %4 ‚ðƒ{ƒŠƒ…[ƒ€ %3 ‚©‚çì¬’†...", - IDC_DUMPSET_DESC,4,36,294,24 -END - -IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 307, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚Ì•œŒ³’† - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,4,0,295,29 - LTEXT "ƒ{ƒŠƒ…[ƒ€ %1 ‚ðƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹ %2 ‚©‚畜Œ³’†...", - IDC_RESTORESET_DESC,4,34,294,30 -END - -IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 258, 163 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - CONTROL "‚±‚̃Zƒ‹‚Ì‘Sƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚ðì¬(&A)", - IDC_CLONE_ALL,"Button",BS_AUTORADIOBUTTON,6,53,242,10 - GROUPBOX " ",IDC_STATIC,4,68,249,67 - CONTROL "ˆÈ‰º‚̊‚Ɉê’v‚·‚éƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv‚̂ݍ쐬(&O)", - IDC_CLONE_SOME,"Button",BS_AUTORADIOBUTTON,6,67,234,11 - CONTROL "ŽŸ‚̃T[ƒo[‚̃{ƒŠƒ…[ƒ€‚Ì‚Ý(&S):",IDC_CLONE_SVR_LIMIT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,83,140,10 - COMBOBOX IDC_CLONE_SVR,164,82,85,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "ŽŸ‚̃p[ƒeƒBƒVƒ‡ƒ“‚̃{ƒŠƒ…[ƒ€‚Ì‚Ý(&P):", - IDC_CLONE_AGG_LIMIT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,6,99,140,10 - COMBOBOX IDC_CLONE_AGG,164,98,85,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "–¼‘O‚ªŽŸ‚ÅŽn‚Ü‚éƒ{ƒŠƒ…[ƒ€‚Ì‚Ý(&B):", - IDC_CLONE_PREFIX_LIMIT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,6,116,140,10 - EDITTEXT IDC_CLONE_PREFIX,164,115,85,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "—¹‰ð",IDOK,92,142,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,146,142,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,201,142,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "ƒ{ƒŠƒ…[ƒ€EƒoƒbƒNƒAƒbƒv‚́A‚»‚̃{ƒŠƒ…[ƒ€‚̓ǂݎæ‚èê—pƒRƒs[‚̂悤‚È“­‚«‚ð‚µ‚Ü‚·B“ǂݎæ‚è/‘‚«ž‚݃{ƒŠƒ…[ƒ€‚̓oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚ð 1 ‚‚¾‚¯Ž‚‚±‚Æ‚ª‚Å‚«‚Ü‚·B\n\n•¡”‚̃{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚𓯎ž‚ɍ쐬‚Å‚«‚Ü‚·B", - IDC_STATIC,30,7,214,40 -END - -IDD_SUBSETS DIALOGEX 0, 0, 281, 182 -STYLE WS_POPUP | WS_CAPTION -CAPTION "ƒ‚ƒjƒ^[‚³‚ê‚éƒT[ƒo[" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒTƒuƒZƒbƒg–¼:",IDC_STATIC,13,73,50,8 - EDITTEXT IDC_SUBSET_NAME,54,84,111,14,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_TABSTOP - PUSHBUTTON "ƒI[ƒvƒ“(&O)...",IDC_SUBSET_LOAD,171,84,58,14 - PUSHBUTTON "•ÛŠÇ(&S)...",IDC_SUBSET_SAVE,230,84,42,14 - CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x153,7,111,182,58,WS_EX_CLIENTEDGE - PUSHBUTTON "‚·‚ׂă‚ƒjƒ^[(&A)",IDC_SUBSET_ALL,196,122,77,14 - PUSHBUTTON "ƒ‚ƒjƒ^[‚µ‚È‚¢(&N)",IDC_SUBSET_NONE,196,140,77,14 - LTEXT "‘å‚«‚ȃZƒ‹‚ł̃pƒtƒH[ƒ}ƒ“ƒX‚ð‰ü‘P‚·‚é‚ɂ́A–â‘è‚ɂ‚¢‚Ä“Á’è‚̃T[ƒo[‚ðƒ‚ƒjƒ^[‚µ‚È‚¢‚±‚Æ‚ð‘I‘ð‚µ‚Ü‚·BAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚́Aƒ‚ƒjƒ^[‚³‚ê‚È‚¢ƒT[ƒo[‚̃{ƒŠƒ…[ƒ€Aƒp[ƒeƒBƒVƒ‡ƒ“A‚Ü‚½‚̓T[ƒrƒX‚Í•\ަ‚µ‚Ü‚¹‚ñB", - IDC_STATIC,5,2,271,27 - LTEXT "ƒT[ƒo[‚̃‚ƒjƒ^[ (‚Ü‚½‚̓‚ƒjƒ^[‚µ‚È‚¢) ‚Í‚¢‚‚łà‘I‘ð‚Å‚«‚Ü‚·BƒT[ƒo[EƒTƒuƒZƒbƒg‚ðì¬‚µ‚āAƒ‚ƒjƒ^[‚·‚éƒT[ƒo[‚ÌƒŠƒXƒg‚ðŽw’è‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", - IDC_STATIC,5,36,271,20 - GROUPBOX "Œ»sƒTƒuƒZƒbƒg",IDC_STATIC,5,63,271,114 - LTEXT "ƒ‚ƒjƒ^[‚·‚éƒT[ƒo[:",IDC_STATIC,12,100,82,8 -END - -IDD_SUBSET_LOADSAVE DIALOGEX 0, 0, 280, 145 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | - WS_CAPTION | WS_SYSMENU -CAPTION "(ƒ^ƒCƒgƒ‹‚ÍŽÀsŽž‚ɐݒè)" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 -BEGIN - LTEXT "ƒTƒuƒZƒbƒg–¼(&N):",1090,5,108,66,8,SS_NOTIFY - EDITTEXT IDC_SUBSET_NAME,54,120,159,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "ƒI[ƒvƒ“(&O)",IDOK,221,108,53,14 - PUSHBUTTON "ŽæÁ‚µ(&L)",IDCANCEL,221,125,53,14 - CONTROL "List1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | - LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,272,82, - WS_EX_CLIENTEDGE - PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT - WS_TABSTOP - PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT - WS_TABSTOP - LTEXT "‚±‚̃Zƒ‹‚É‚·‚łɒè‹`‚³‚ê‚Ä‚¢‚éƒTƒuƒZƒbƒg:",IDC_STATIC,4, - 6,162,8 -END - -IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "ƒRƒ}ƒ“ƒhŒŸõ" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - COMBOBOX IDC_FIND_COMMAND,4,36,137,170,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "ƒwƒ‹ƒv‚Ì•\ަ(&H)",IDOK,144,36,69,14 - PUSHBUTTON "ŽæÁ‚µ(&C)",IDCANCEL,144,53,69,14 - LTEXT "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ðŽg—p‚µ‚ă^ƒXƒN‚ðŽÀs‚·‚é•û–@‚ðŒ©‚é‚ɂ́A‰º‚̃Rƒ}ƒ“ƒhs‚ð‘I‘ð‚µ‚Äuƒwƒ‹ƒv‚Ì•\ަvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B", - IDC_STATIC,4,4,210,25 -END - -IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 141 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "ƒGƒ‰[EƒR[ƒh‚ÌŒŸõ" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒGƒ‰[”ԍ†(&E):",IDC_STATIC,4,41,50,8 - EDITTEXT IDC_ERROR_NUMBER,63,39,78,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "•ÏŠ·(&T)",IDC_ERROR_TRANSLATE,147,39,67,14 - PUSHBUTTON "ƒNƒ[ƒY(&C)",IDCANCEL,85,121,53,14 - LTEXT "(ƒeƒLƒXƒg‚ÍŽÀsŽž‚ɐݒè)",IDC_ERROR_DESC,4,65,210,48 - LTEXT "ƒGƒ‰[EƒR[ƒh‚̈Ӗ¡‚𒲂ׂé‚ɂ́AƒR[ƒh‚ð‰º‚É“ü—Í‚µ‚āu•ÏŠ·vƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B", - IDC_STATIC,4,4,210,25 - CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 -END - -IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ɂ‚¢‚Ä" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 - LTEXT "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[ ƒo[ƒWƒ‡ƒ“ 3.5",IDC_STATIC, - 33,8,163,8 - LTEXT "Copyright (C) IBM Corporation 1989, 1999",IDC_STATIC,33, - 20,183,8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 - CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 - PUSHBUTTON "ƒNƒ[ƒY(&C)",IDOK,89,121,53,14 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 -END - -IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ª %1 ƒZƒ‹“à‚̃T[ƒo[‚ðŒŸõ’†...", - IDC_OPENCELL_DESC,41,15,183,16 - GROUPBOX "",IDC_STATIC,4,2,231,39 - ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 309, 136 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - CONTROL "ƒT[ƒo[‚ÌŠ®‘SCüƒhƒƒCƒ“–¼ (—á: ""machine.company.com"") ‚ð•\ަ", - IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,11,5,238,10 - CONTROL "ŠÇ—ƒg[ƒNƒ“‚È‚µ‚Å‹@”\‚·‚éê‡‚ÉŒx‚ð•\ަ(&W)", - IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,11,19,238,10 - CONTROL "...í‚ɃT[ƒo[EƒvƒƒpƒeƒB[‚ð•\ަ", - IDC_OPT_SVR_DBL_PROP,"Button",BS_AUTORADIOBUTTON,11,50, - 238,10 - CONTROL "...ƒNƒBƒbƒNEƒrƒ…[EƒyƒCƒ“‚̃I[ƒvƒ“Žž‚̂݃T[ƒo[EƒvƒƒpƒeƒB[‚ð•\ަ", - IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON,11, - 63,238,10 - CONTROL "...í‚É‚»‚̃T[ƒo[‚̃EƒBƒ“ƒhƒE‚ðƒI[ƒvƒ“", - IDC_OPT_SVR_DBL_OPEN,"Button",BS_AUTORADIOBUTTON,11,75, - 238,10 - CONTROL "...ƒT[ƒo[EƒEƒBƒ“ƒhƒE‚̃I[ƒvƒ“‚ŁA‚»‚̃T[ƒo[‚ðƒ‚ƒjƒ^[", - IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,11,107,238,10 - CONTROL "...ƒT[ƒo[EƒEƒBƒ“ƒhƒE‚̃Nƒ[ƒY‚ŁA‚»‚̃T[ƒo[‚ðƒ‚ƒjƒ^[‰ðœ", - IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,11,121,238,10 - LTEXT "ƒT[ƒo[‚̃AƒCƒRƒ“‚ðƒ_ƒuƒ‹ƒNƒŠƒbƒN‚·‚邯...",IDC_STATIC, - 7,38,238,8 - LTEXT "ƒT[ƒo[EƒTƒuƒZƒbƒg‚ªŽg—p’†‚ŃNƒBƒbƒNEƒrƒ…[EƒyƒCƒ“‚̃Nƒ[ƒYŽž...", - IDC_STATIC,7,95,238,8 -END - -IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,23,216, - 129,WS_EX_CLIENTEDGE - PUSHBUTTON "ƒT[ƒo[Œ®‚̒ljÁ(&A)",IDC_KEY_ADD,46,157,85,14 - PUSHBUTTON "ƒT[ƒo[Œ®‚̍폜(&R)",IDC_KEY_REMOVE,133,157,85,14 - LTEXT "ƒT[ƒo[‚ÌŒ®:",IDC_KEY_NAME,5,5,216,11 -END - -IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒT[ƒo[Œ®‚̒ljÁ" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒo[ƒWƒ‡ƒ“:",IDC_STATIC,9,37,38,8 - EDITTEXT IDC_KEY_VERSION,57,35,43,14,ES_AUTOHSCROLL - LTEXT "’l:",IDC_STATIC,9,55,21,8 - CONTROL "‚±‚̃XƒgƒŠƒ“ƒO‚ðˆÃ†‰»:",IDC_KEY_BYSTRING,"Button", - BS_AUTORADIOBUTTON,43,54,101,10 - CONTROL "‚±‚ÌŒ®‚ðŽg—p:",IDC_KEY_BYDATA,"Button", - BS_AUTORADIOBUTTON,43,86,61,10 - EDITTEXT IDC_KEY_STRING,112,65,155,14,ES_PASSWORD | - ES_AUTOHSCROLL - EDITTEXT IDC_KEY_DATA,112,83,103,14,ES_AUTOHSCROLL - PUSHBUTTON "ƒ‰ƒ“ƒ_ƒ€(&R)",IDC_KEY_RANDOM,220,83,53,14 - LTEXT "’ˆÓ: V‚µ‚¢Œ®‚ðƒT[ƒo[‚ɒljÁ‚µ‚½ŒãAV‚µ‚¢Œ®‚ðŽg—p‚·‚邿‚¤‚É AFS ƒAƒJƒEƒ“ƒg‚ð•ύX‚µ‚Ä‚­‚¾‚³‚¢B”“úŒãAŒÃ‚¢ƒT[ƒo[Œ®‚Í‚·‚ׂč폜‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", - IDC_STATIC,9,101,260,21 - DEFPUSHBUTTON "—¹‰ð",IDOK,113,127,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,167,127,50,14 - PUSHBUTTON "ƒwƒ‹ƒv",9,221,127,50,14 - LTEXT "ƒT[ƒo[ %1 ‚̐V‹KŒ®",IDC_KEY_TITLE,39,11,229,18 - ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 -END - -IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 307, 133 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒT[ƒrƒX‚ÌŠJŽn/’âŽ~" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - DEFPUSHBUTTON "—¹‰ð",IDOK,112,116,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,166,116,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,220,116,50,14 - ICON IDI_SERVICE,IDC_STATIC,4,7,20,20 - LTEXT "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ðŠJŽn/’âŽ~‚·‚é‚ɂ́u—¹‰ðv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B", - IDC_STARTSTOP_TEXT,31,8,272,17 - CONTROL "‰i‘±(&P) (IDS_START/STOPSERVICE_PERMANENT)", - IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON,8,79, - 294,10 - CONTROL "ˆêŽž(&T) (IDS_START/STOPSERVICE_TEMPORARY)", - IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON,8,96, - 294,10 - GROUPBOX "ƒT[ƒrƒXŽn“®",IDC_STATIC,4,35,302,76 - LTEXT "‚±‚̕ύX‚͉i‘±“I‚È‚à‚̂ɂ·‚邱‚Æ‚ª‚Å‚«AƒT[ƒo[ %1 ‚ªÄŽn“®‚³‚ê‚邯ީ“®“I‚ɃT[ƒrƒX %2 ‚ªŠJŽn‚³‚ê‚Ü‚· (‚³‚ê‚Ü‚¹‚ñ)B", - IDC_STARTSTOP_STARTUP,8,48,294,23 -END - -IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 248, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒRƒ}ƒ“ƒh‚ÌŽÀs" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒT[ƒo[(&S):",IDC_STATIC,7,56,44,8 - COMBOBOX IDC_SERVER,58,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "ƒRƒ}ƒ“ƒh(&C):",IDC_STATIC,7,75,44,8 - EDITTEXT IDC_COMMAND,58,73,183,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "—¹‰ð",IDOK,84,105,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,138,105,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,192,105,50,14 - ICON IDI_SERVER,IDC_STATIC,4,4,20,20 - LTEXT "ƒT[ƒo[‚̃Rƒ}ƒ“ƒh‚ðŽÀs",IDC_STATIC,36,12,204,8 - LTEXT "‚±‚Ì‘€ì‚́AƒŠƒ‚[ƒgEƒT[ƒo[‚ł̃Rƒ}ƒ“ƒh‚Ì”­s‚ð‰Â”\‚É‚µ‚Ü‚·B\nˆê”Ê‚É /etc/reboot ƒXƒNƒŠƒvƒg‚ÌŽÀs‚É‚æ‚éƒT[ƒo[‚̍Ďn“®‚ÉŽg—p‚³‚ê‚Ü‚·B", - IDC_STATIC,7,29,231,16 -END - -IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 248, 254 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚̃Tƒ‹ƒx[ƒW - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒT[ƒo[(&S):",IDC_STATIC,9,43,44,8 - COMBOBOX IDC_SERVER,78,41,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“(&P):",IDC_STATIC,9,55,59,8 - COMBOBOX IDC_AGGREGATE,78,54,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "‚·‚ׂẴp[ƒeƒBƒVƒ‡ƒ“‚ðƒTƒ‹ƒx[ƒW(&A)", - IDC_AGGREGATE_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 81,70,145,10 - LTEXT "ƒ{ƒŠƒ…[ƒ€(&O):",IDC_STATIC,9,83,49,8 - COMBOBOX IDC_FILESET,78,81,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒTƒ‹ƒx[ƒW(&L)",IDC_FILESET_ALL, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,81,96,145,10 - DEFPUSHBUTTON "—¹‰ð",IDOK,85,108,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,139,108,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,193,108,50,14 - PUSHBUTTON "Šg’£(&V) >>",IDC_ADVANCED,6,108,53,14 - LTEXT "ˆêŽžƒtƒ@ƒCƒ‹‚̃pƒX(&T):",IDC_STATIC,5,141,77,8 - EDITTEXT IDC_SALVAGE_TEMPDIR,97,140,144,13,ES_AUTOHSCROLL - CONTROL "•ÀsƒTƒ‹ƒx[ƒW‘€ìAƒvƒƒZƒX”(&R):",IDC_SALVAGE_SIMUL, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,157,148,10 - EDITTEXT IDC_SALVAGE_NUM,202,156,25,13,ES_AUTOHSCROLL - CONTROL "‘¹ƒ{ƒŠƒ…[ƒ€‚ðƒTƒ‹ƒx[ƒW‚µ‚È‚¢(&N)", - IDC_SALVAGE_READONLY,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,29,167,154,10 - CONTROL "“ǂݎæ‚è‘€ì‚ð¬‚³‚ȃuƒƒbƒN‚É•ªŠ„(&B)", - IDC_SALVAGE_BLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 29,177,162,10 - CONTROL "ަ‚³‚ꂽ‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ð‹­§ƒTƒ‹ƒx[ƒW(&F)", - IDC_SALVAGE_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 29,187,193,10 - CONTROL "ƒfƒBƒŒƒNƒgƒŠ[\‘¢‚ð‹­§Äì¬(&E)",IDC_SALVAGE_FIXDIRS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,197,146,10 - LTEXT "Œ‹‰ÊƒƒO‚̃tƒ@ƒCƒ‹–¼(&M):",IDC_STATIC,8,211,79,8 - EDITTEXT IDC_SALVAGE_LOG_FILE,98,210,140,13,ES_AUTOHSCROLL - CONTROL "‘¹ inode ‚ÌƒŠƒXƒg‚ðŒ‹‰ÊƒƒO‚É“ü‚ê‚é(&I)", - IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,30,225,165,10 - CONTROL "AFS Š—L‚̃‹[ƒginode‚ÌƒŠƒXƒg‚ðŒ‹‰ÊƒƒO‚É“ü‚ê‚é(&W)", - IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,30,236,206,10 - ICON IDI_SERVER,IDC_STATIC,4,7,20,20 - LTEXT "‚±‚Ì‘€ì‚́A•¡”‚̃{ƒŠƒ…[ƒ€‚ł̖â‘è‚̏C³‚ð‰Â”\‚É‚µ‚Ü‚·B\n\n’ˆÓ: ƒp[ƒeƒBƒVƒ‡ƒ“‘S‘Ì‚©ƒT[ƒo[‘S‘Ì‚ðˆê“x‚ɃTƒ‹ƒx[ƒW‚·‚éê‡AƒT[ƒo[‚͈ꎞ“I‚ɃIƒtƒ‰ƒCƒ“‚ɂȂè‚Ü‚·B", - IDC_STATIC,27,5,210,33 - GROUPBOX "Šg’£ƒTƒ‹ƒx[ƒWEƒIƒvƒVƒ‡ƒ“",IDC_ADVANCED_GROUP,4,128, - 240,122 -END - -IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "ƒ{ƒŠƒ…[ƒ€‚̃Tƒ‹ƒx[ƒW - Œ‹‰Ê" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - DEFPUSHBUTTON "ƒNƒ[ƒY(&C)",IDOK,222,158,53,14 - LTEXT "ƒTƒ‹ƒx[ƒW‘€ì‚ÌŒ‹‰Ê:",IDC_STATIC,7,41,271,8 - EDITTEXT IDC_SALVAGE_DETAILS,4,55,277,99,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP - ICON IDI_SERVER,IDC_STATIC,4,7,20,20 - LTEXT "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€ %3 ‚ðƒTƒ‹ƒx[ƒW", - IDC_SALVAGE_TITLE,30,10,249,24 -END - -IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 277, 102 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒ{ƒŠƒ…[ƒ€‚̉ð•ú" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - DEFPUSHBUTTON "—¹‰ð",IDOK,112,82,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,166,82,50,14 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,220,82,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "‚±‚Ì‘€ì‚́A%3 ƒ{ƒŠƒ…[ƒ€‚̃ŒƒvƒŠƒJ‚ðXV‚µ‚Ü‚·BŒÃ‚­‚È‚Á‚½ƒŒƒvƒŠƒJ‚݂̂ðXV‚·‚é‚©A‚·‚ׂẴŒƒvƒŠƒJ‚ðXV‚·‚é‚©‚ð‘I‘ð‚·‚é‚±‚Æ‚ª‚Å‚«‚Ü‚·B", - IDC_RELSET_DESC,30,7,242,29 - CONTROL "ŒÃ‚¢ƒ{ƒŠƒ…[ƒ€EƒŒƒvƒŠƒJ‚̂ݍXV(&U)",IDC_RELSET_NORMAL, - "Button",BS_AUTORADIOBUTTON,31,46,239,10 - CONTROL "‚·‚ׂẴ{ƒŠƒ…[ƒ€EƒŒƒvƒŠƒJ‚ðXV(&A)", - IDC_RELSET_FORCE,"Button",BS_AUTORADIOBUTTON,31,63,239, - 10 -END - -IDD_SVR_HOSTS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - PUSHBUTTON "ƒzƒXƒgEƒT[ƒo[‚̒ljÁ(&A)",IDC_HOST_ADD,10,157,100,14 - PUSHBUTTON "ƒzƒXƒgEƒT[ƒo[‚̍폜(&R)",IDC_HOST_REMOVE,115,157,100, - 14 - LTEXT "ƒT[ƒo[‚ª”Fޝ‚·‚éƒf[ƒ^ƒx[ƒXEƒzƒXƒgEƒT[ƒo[:", - IDC_HOST_TITLE,5,7,216,13 - CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,26,216, - 126,WS_EX_CLIENTEDGE -END - -IDD_SVR_ADDHOST DIALOGEX 0, 0, 307, 107 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "ƒzƒXƒgEƒT[ƒo[‚̒ljÁ" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒzƒXƒg(&H):",-1,31,61,42,8 - EDITTEXT IDC_ADDHOST_HOST,81,59,103,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "—¹‰ð",IDOK,60,85,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,114,85,50,14 - ICON IDI_SERVER,-1,4,4,20,20 - LTEXT "ƒf[ƒ^ƒx[ƒXEƒzƒXƒgEƒT[ƒo[‚ðƒT[ƒo[ %1 ‚ɕۊǂ³‚ꂽƒŠƒXƒg‚ɒljÁ‚·‚邱‚Æ‚ð‘I‘ð‚µ‚Ü‚µ‚½B\n\nV‚µ‚¢ƒf[ƒ^ƒx[ƒXEƒzƒXƒg‚Ì–¼‘O‚ð‰º‚É“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B", - IDC_ADDHOST_DESC,31,5,268,42 - PUSHBUTTON "ƒwƒ‹ƒv",9,168,85,50,14 -END - -IDD_SVR_ADDRESS DIALOGEX 0, 0, 211, 115 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "ƒT[ƒo[EƒAƒhƒŒƒX‚̕ύX" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒT[ƒo[ %1 ‚Ì VLDB ‚É‹L˜^‚³‚ꂽ IP ƒAƒhƒŒƒX:", - IDC_TITLE,4,2,200,16 - LISTBOX IDC_SVR_ADDRESSES,4,23,147,40,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "•ύX(&C)...",IDC_ADDR_CHANGE,152,33,50,14 - PUSHBUTTON "íœ(&R)",IDC_ADDR_REMOVE,152,49,50,14 - DEFPUSHBUTTON "—¹‰ð",IDOK,43,95,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,97,95,50,14 - PUSHBUTTON "ƒwƒ‹ƒv",9,151,95,50,14 - LTEXT "’: ƒtƒ@ƒCƒ‹EƒT[ƒo[‚ÍŽn“®Žž‚ɁAŽ©“®“I‚É‚»‚ÌŒ»s IP ƒAƒhƒŒƒX‚ð VLDB ‚É“o˜^‚µ‚Ü‚·B", - IDC_STATIC,4,71,200,18 -END - -IDD_SVR_NEWADDR DIALOGEX 0, 0, 233, 69 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "IP ƒAƒhƒŒƒX‚̕ύX" -CLASS "AFSManagerClass" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - DEFPUSHBUTTON "—¹‰ð",IDOK,66,48,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,120,48,50,14 - PUSHBUTTON "ƒwƒ‹ƒv",9,174,48,50,14 - LTEXT "VLDB ‚Ì %1 ‚ð’u‚«Š·‚¦‚éV‹K IP ƒAƒhƒŒƒX‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢:", - IDC_TITLE,8,6,220,15 - CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,52,27, - 168,14 - LTEXT "ƒAƒhƒŒƒX:",IDC_STATIC,9,30,34,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" -32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" -32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" -IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" -IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" -IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" -IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" -IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" -IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" -IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" -IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" -IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" -IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" -IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" -IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" -IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" -IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" -IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -ACCEL_MAIN ACCELERATORS DISCARDABLE -BEGIN - VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT - VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT - VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT - VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT - VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT - VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT - VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT - VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, - NOINVERT - VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT -END - - -///////////////////////////////////////////////////////////////////////////// -// -// AVI -// - -AVI_SETMOVE AVI DISCARDABLE "Resource\\setmove.avi" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVR_LISTS_TITLE "ƒT[ƒo[ %1 - ŠÇ—ƒŠƒXƒg" - IDS_TAB_SERVICES "ƒT[ƒrƒX" - IDS_TAB_AGGREGATES "ƒp[ƒeƒBƒVƒ‡ƒ“" - IDS_TAB_FILESETS "ƒ{ƒŠƒ…[ƒ€" - IDS_SERVICE_NONESELECTED "•\ަ‚·‚éƒT[ƒo[‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_SERVICE_GOTSELECTED "ƒT[ƒo[ %1 ‚̃T[ƒrƒXEƒvƒƒZƒX:" - IDS_AGGREGATE_ALL "‚·‚ׂẴT[ƒo[‚̃p[ƒeƒBƒVƒ‡ƒ“:" - IDS_AGGREGATE_ONE "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“:" - IDS_FILESET_ALL "ƒZƒ‹ %1 ‚Ì‚·‚ׂẴ{ƒŠƒ…[ƒ€:" - IDS_FILESET_ONE "ƒT[ƒo[ %1 ‚̃{ƒŠƒ…[ƒ€:" - IDS_SVR_LISTS_TAB "ŠÇ—ƒŠƒXƒg" - IDS_SVR_PROP_TITLE "ƒT[ƒo[ %1 - ƒvƒƒpƒeƒB[" - IDS_SVR_GENERAL_TAB "ˆê”Ê" - IDS_SVR_SCOUT_TAB "Ý’è" - IDS_SERVER_TITLE "ƒT[ƒo[ %1 - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_DESC "ƒZƒ‹ %2 ‚̃T[ƒo[ %1:" - IDS_SVC_PROP_TITLE "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 - ƒvƒƒpƒeƒB[" - IDS_SVC_GENERAL_TAB "ˆê”Ê" - IDS_SVC_ADD_TITLE "ƒT[ƒrƒX‚̍쐬" - IDS_SVC_ADD_TAB "ƒT[ƒrƒX‚̍쐬" - IDS_AGG_PROP_TITLE "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 - ƒvƒƒpƒeƒB[" - IDS_AGG_GENERAL_TAB "ˆê”Ê" - IDS_SET_REP_TITLE "ƒ{ƒŠƒ…[ƒ€ %1 - ƒŒƒvƒŠƒJ" - IDS_SET_REPSITES_TAB "•¡»ƒTƒCƒg" - IDS_SET_PROP_TITLE "ƒ{ƒŠƒ…[ƒ€ %1 - ƒvƒƒpƒeƒB[" - IDS_SET_GENERAL_TAB "ˆê”Ê" - IDS_SET_UNLOCKBTN "‘¦ŽžƒƒbƒN‰ðœ(&L)" - IDS_SET_LOCKBTN "‘¦ŽžƒƒbƒN(&L)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_USAGE_FILESET "%2 Š„‚è“–‚Ä—Ê‚Ì %1 ‚ðŽg—p (%3%%)" - IDS_USAGE_AGGREGATE "%2 —e—Ê‚Ì %1 ‚ðŽg—p (%3%%)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGCOL_ALLOCATED "Œ‹‡Š„‚è“–‚Ä—Ê" - IDS_SVRCOL_NAME "ƒT[ƒo[" - IDS_SVRCOL_STATUS "ó‹µ" - IDS_SETCOL_DATE_ACCESS "ÅIƒAƒNƒZƒX" - IDS_SETCOL_DATE_BACKUP "ÅIƒoƒbƒNƒAƒbƒv" - IDS_SVCCOL_NAME "ƒT[ƒrƒX" - IDS_SVCCOL_TYPE "ƒ^ƒCƒv" - IDS_SVCCOL_PARAMS "ƒpƒ‰ƒ[ƒ^[" - IDS_SVCCOL_STATUS "ó‹µ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_DATE_START "ÅIŠJŽn" - IDS_SVCCOL_DATE_STOP "ÅI’âŽ~" - IDS_SVCCOL_DATE_STARTSTOP "ÅIŠJŽn/’âŽ~" - IDS_SVCCOL_DATE_FAILED "ÅIáŠQ" - IDS_SVCCOL_LASTERROR "ÅII—¹ƒR[ƒh" - IDS_AGGCOL_NAME "ƒp[ƒeƒBƒVƒ‡ƒ“" - IDS_AGGCOL_ID "ID" - IDS_AGGCOL_DEVICE "‘•’u" - IDS_AGGCOL_USED "Žg—p—Ê" - IDS_AGGCOL_USED_PER "Žg—p—¦ (%)" - IDS_AGGCOL_FREE "‹ó‚«" - IDS_AGGCOL_TOTAL "—e—Ê" - IDS_AGGCOL_STATUS "ó‹µ" - IDS_SETCOL_NAME "ƒ{ƒŠƒ…[ƒ€" - IDS_SETCOL_TYPE "ƒ^ƒCƒv" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETCOL_DATE_CREATE "ì¬" - IDS_SETCOL_DATE_UPDATE "ÅIXV" - IDS_SETCOL_STATUS "ó‹µ" - IDS_SETCOL_QUOTA_USED "Žg—p—Ê" - IDS_SETCOL_QUOTA_USED_PER "Žg—p—¦ (%)" - IDS_SETCOL_QUOTA_FREE "‹ó‚«" - IDS_SETCOL_QUOTA_TOTAL "Š„‚è“–‚Ä—Ê" - IDS_TRYAGAINBTN "ÄŽŽs(&A)" - IDS_NO_CELL_SELECTED "(ƒZƒ‹‚ªŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ)" - IDS_NO_AFS_ID "(Žg—p‰Â”\‚ȃg[ƒNƒ“‚ª‚ ‚è‚Ü‚¹‚ñ)" - IDS_AFS_ID_WILLEXP "%1 (ƒg[ƒNƒ“‚ÌŠúŒÀ‚ª %2 ‚ɐ؂ê‚Ü‚·)" - IDS_ELAPSED_TIME "%1" - IDS_SEARCHING_FOR_SERVERS - "‚¨‘Ò‚¿‚­‚¾‚³‚¢BƒZƒ‹ %1 ‚ÉŠÖ‚·‚éî•ñ‚ðŽæ“¾’†‚Å‚·..." - IDS_STATUS_NOALERTS "•W€" - IDS_TITLE_BROWSE_USER "ƒ†[ƒU[‚Ì‘I‘ð" - IDS_AGGTYPE_OTHER "•s–¾ (%1)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATEFILESET "ƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2 ‚Ƀ{ƒŠƒ…[ƒ€ %3 ‚ðì¬" - IDS_ACTION_DELETEFILESET "ƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2 ‚©‚çƒ{ƒŠƒ…[ƒ€ %3 ‚ðíœ" - IDS_ACTION_MOVEFILESET "ƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2 ‚Öƒ{ƒŠƒ…[ƒ€ %3 ‚ðˆÚ“®" - IDS_ACTION_SETFILESETQUOTA "ƒ{ƒŠƒ…[ƒ€ %3 ‚ÌŠ„‚è“–‚Ä—Ê‚ð•ύX" - IDS_SVCSTOP_DESC2 "‚±‚̃T[ƒrƒX‚ð’âŽ~‚·‚é‚ɂ́u—¹‰ðv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_SVCSTART_DESC2 "‚±‚̃T[ƒrƒX‚ðŠJŽn‚·‚é‚ɂ́u—¹‰ðv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_SYNCVLDB_SVR_DESC "’ˆÓ!\n\n‘±s‚·‚邯AAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚̓T[ƒo[ %1 ‚Ì‚·‚ׂẴp[ƒeƒBƒVƒ‡ƒ“‚Ì“à—e‚Ɉê’v‚·‚邿‚¤‚É VLDB ‚ð•ύX‚µ‚Ü‚·B" - IDS_SYNCVLDB_SVR_DESC2 "VLDB ‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“‚ÉŒ»Ýƒ{ƒŠƒ…[ƒ€‚ªŒ©‚‚©‚ç‚È‚¢‚±‚Æ‚ð’Ê’m‚µ‚½ê‡A‚»‚̃{ƒŠƒ…[ƒ€‚Ì VLDB €–ڂ͍폜‚³‚ê‚Ü‚·!" - IDS_SYNCVLDB_AGG_DESC "’ˆÓ!\n\n‘±s‚·‚邯AAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚̓T[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ì“à—e‚Ɉê’v‚·‚邿‚¤‚É VLDB ‚ð•ύX‚µ‚Ü‚·B" - IDS_SYNCVLDB_AGG_DESC2 "VLDB ‚ª‚±‚̃p[ƒeƒBƒVƒ‡ƒ“‚ÉŒ»Ýƒ{ƒŠƒ…[ƒ€‚ªŒ©‚‚©‚ç‚È‚¢‚±‚Æ‚ð’Ê’m‚µ‚½ê‡A‚»‚̃{ƒŠƒ…[ƒ€‚Ì VLDB €–ڂ͍폜‚³‚ê‚Ü‚·!" - IDS_PROMPT_BROWSE_USER "ƒ†[ƒU[:" - IDS_PREVIEWIN_BUTTON "<< ƒvƒŠƒrƒ…[(&P)" - IDS_PREVIEWOUT_BUTTON "ƒvƒŠƒrƒ…[(&P) >>" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ADMCOL_TYPE_USER "ƒ†[ƒU[" - IDS_TITLE_BROWSE_PRINCIPAL "ƒvƒŠƒ“ƒVƒpƒ‹‚Ì‘I‘ð" - IDS_TITLE_BROWSE_OWNGROUP "Š—LƒOƒ‹[ƒv‚Ì‘I‘ð" - IDS_PROMPT_BROWSE_PRINCIPAL "ƒvƒŠƒ“ƒVƒpƒ‹:" - IDS_PROMPT_BROWSE_OWNGROUP "Š—LƒOƒ‹[ƒv:" - IDS_ACTION_CLONE "ƒ{ƒŠƒ…[ƒ€ %3 ‚̃oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚ðì¬’†" - IDS_ACTION_CLONESYS "•¡”‚̃{ƒŠƒ…[ƒ€EƒoƒbƒNƒAƒbƒv‚ðì¬’†" - IDS_CLONESYS_FAILED "ƒGƒ‰[ 0x%2 ‚Ì‚½‚߁Aƒ{ƒŠƒ…[ƒ€ %1 ‚̃oƒbƒNƒAƒbƒv‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½ (%3)B" - IDS_SET_UNSPECIFIED "(–¢Žw’è)" - IDS_SETCOL_ID "ID" - IDS_SETCOL_FILES "ƒtƒ@ƒCƒ‹EƒJƒEƒ“ƒg" - IDS_SET_DUMP_NAME "%1.DMP ‚̃_ƒ“ƒv" - IDS_ACTION_DUMP "ƒ{ƒŠƒ…[ƒ€ %3 ‚̃_ƒ“ƒv’† (ƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FILESETNAME_ERROR "%1 - %2" - IDS_SETCOL_AGGREGATE "ƒp[ƒeƒBƒVƒ‡ƒ“" - IDS_REFRESH_DESC_CELL "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ª %1 ƒZƒ‹“à‚̃T[ƒo[‚̏󋵂𔻕ʒ†‚Å‚·B‚µ‚Î‚ç‚­ŽžŠÔ‚ª‚©‚©‚è‚Ü‚·..." - IDS_REFRESH_DESC_SERVER "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̏󋵂𔻕ʒ†‚Å‚·B‚µ‚Î‚ç‚­ŽžŠÔ‚ª‚©‚©‚è‚Ü‚·..." - IDS_REFRESH_CURRENT_CELL "Œ»ÝŒŸ¸’†: ƒZƒ‹ %1" - IDS_REFRESH_CURRENT_SERVER "Œ»ÝŒŸ¸’†: ƒT[ƒo[ %2" - IDS_REFRESH_CURRENT_AGGREGATE - "Œ»ÝŒŸ¸’†: ƒT[ƒo[ %2 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %3" - IDS_REFRESH_CURRENT_FILESET - "Œ»ÝŒŸ¸’†: ƒT[ƒo[ %2 ‚̃{ƒŠƒ…[ƒ€ %4Aƒp[ƒeƒBƒVƒ‡ƒ“ %3" - IDS_REFRESH_CURRENT_SERVICE "Œ»ÝŒŸ¸’†: ƒT[ƒo[ %2 ‚̃T[ƒrƒX %3" - IDS_REFRESH_PERCENT "%1%% Š®—¹" - IDS_PROBLEMS "–â‘è" - IDS_SERVER_NO_PROBLEMS "‚±‚̃T[ƒo[‚ɂ͊ù’m‚Ì–â‘è‚Í‚ ‚è‚Ü‚¹‚ñB" - IDS_SERVICE_NO_PROBLEMS "‚±‚̃T[ƒrƒX‚ɂ͊ù’m‚Ì–â‘è‚Í‚ ‚è‚Ü‚¹‚ñB" - IDS_AGGREGATE_NO_PROBLEMS "‚±‚̃p[ƒeƒBƒVƒ‡ƒ“‚ɂ͊ù’m‚Ì–â‘è‚Í‚ ‚è‚Ü‚¹‚ñB" - IDS_FILESET_NO_PROBLEMS "‚±‚̃{ƒŠƒ…[ƒ€‚ɂ͊ù’m‚Ì–â‘è‚Í‚ ‚è‚Ü‚¹‚ñB" - IDS_AGGTYPE_TYPE1 "UFS" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGTYPE_TYPE2 "LFS" - IDS_AGGTYPE_TYPE3 "AIX" - IDS_AGGTYPE_TYPE4 "VXFS" - IDS_AGGTYPE_TYPE5 "DMEPI" - IDS_REFRESH_CURRENT_VLDB - "Œ»ÝŒŸ¸’†: ƒ{ƒŠƒ…[ƒ€EƒƒP[ƒVƒ‡ƒ“Eƒf[ƒ^ƒx[ƒX(VLDB)" - IDS_FILESETTYPE_RW "“ǂݎæ‚è/‘‚«ž‚Ý" - IDS_FILESETTYPE_RO "ƒŒƒvƒŠƒJ" - IDS_FILESETTYPE_CLONE "ƒoƒbƒNƒAƒbƒv" - IDS_MOVESET_READWRITE "‘±s‚·‚邯Aƒ{ƒŠƒ…[ƒ€ %3 ‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚©‚瑼‚̏ꏊ‚ÖˆÚ“®‚³‚ê‚Ü‚·B" - IDS_MOVESET_READONLY "‘±s‚·‚邯Aƒ{ƒŠƒ…[ƒ€EƒŒƒvƒŠƒJ %3 ‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 A‚¨‚æ‚шȉº‚ÉŽw’肵‚½ƒp[ƒeƒBƒVƒ‡ƒ“ã‚ɍ쐬‚³‚ꂽ•ʂ̃{ƒŠƒ…[ƒ€EƒŒƒvƒŠƒJ‚©‚çíœ‚³‚ê‚Ü‚·B" - IDS_SVC_START_TITLE "ƒT[ƒrƒX‚ÌŠJŽn" - IDS_SVC_STOP_TITLE "ƒT[ƒrƒX‚Ì’âŽ~" - IDS_SERVICESTATUS_STARTING "‚±‚̃T[ƒrƒX‚ÍŒ»ÝŠJŽn’†‚Å‚·B" - IDS_SERVICESTATUS_RUNNING "‚±‚̃T[ƒrƒX‚ÍŒ»ÝŽÀs’†‚Å‚·B" - IDS_SERVICESTATUS_STOPPED "‚±‚̃T[ƒrƒX‚ÍŒ»Ý’âŽ~‚³‚ê‚Ä‚¢‚Ü‚·B" - IDS_SERVICESTATUS_STOPPING "‚±‚̃T[ƒrƒX‚ÍŒ»Ý’âŽ~’†‚Å‚·B" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICESTATUS_UNKNOWN "‚±‚̃T[ƒrƒX‚̏󋵂͕s–¾‚Å‚·B" - IDS_SVC_RESTART_BUTTON "‘¦Žž’âŽ~‚¨‚æ‚эĎn“®(&R)" - IDS_PROBLEM_BOX "Šù’m‚Ì–â‘è (%1)" - IDS_VIEWLOG_DESC_NOFILE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚̃ƒOEƒtƒ@ƒCƒ‹‚ðŒ©‚Â‚¯‚ç‚ê‚Ü‚¹‚ñ‚Å‚µ‚½BƒT[ƒrƒX‚̃ƒOEƒtƒ@ƒCƒ‹‚Ì‘SƒpƒX‚ð‰º‚É“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_NO_GROUP "(Š—LƒOƒ‹[ƒv‚È‚µ)" - IDS_VIEWLOG_FROMSERVER "ƒT[ƒo[ %1 ‚̃ƒOEƒtƒ@ƒCƒ‹" - IDS_VIEWLOG_FROMSERVICE "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ƒƒOEƒtƒ@ƒCƒ‹" - IDS_VIEWLOG_TRUNCATED "ƒtƒ@ƒCƒ‹‚Ì“à—e (ÅŒã‚Ì %1 s‚̂ݕ\ަ):" - IDS_SAVELOG_FILTER "ƒeƒLƒXƒgEƒtƒ@ƒCƒ‹|*.TXT|" - IDS_ADVANCEDIN_BUTTON "<< Šg’£(&A)" - IDS_ADVANCEDOUT_BUTTON "Šg’£(&A) >>" - IDS_REPTYPE_RELEASE "ƒŠƒŠ[ƒX•¡»" - IDS_REPTYPE_SCHEDULED "ƒXƒPƒWƒ…[ƒ‹•¡»" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_UPDATEALL_BUTTON "‚·‚ׂčXV(&U)" - IDS_UPDATETHIS_BUTTON "XV(&U)" - IDS_SERVER_MULTIPLE_PROBLEMS "‚±‚̃T[ƒo[‚É‚Í %1 ‚ÌŠù’m–â‘肪‚ ‚è‚Ü‚·B" - IDS_SERVICE_MULTIPLE_PROBLEMS "‚±‚̃T[ƒrƒX‚É‚Í %1 ‚ÌŠù’m–â‘肪‚ ‚è‚Ü‚·B" - IDS_AGGREGATE_MULTIPLE_PROBLEMS - "‚±‚̃p[ƒeƒBƒVƒ‡ƒ“‚É‚Í %1 ‚ÌŠù’m–â‘肪‚ ‚è‚Ü‚·B" - IDS_FILESET_MULTIPLE_PROBLEMS - "‚±‚̃{ƒŠƒ…[ƒ€‚É‚Í %1 ‚ÌŠù’m–â‘肪‚ ‚è‚Ü‚·B" - IDS_FILESETTYPE_RO_STAGE "ƒŒƒvƒŠƒJ" - IDS_SERVICETYPE_SIMPLE_LONG "ƒVƒ“ƒvƒ‹ (˜A‘±‚µ‚ÄŽÀs)" - IDS_SERVICETYPE_CRON_LONG "Cron (Žw’è‚ÌŠÔŠu‚ÅŽÀs)" - IDS_QUOTAUNITS_KB "kb" - IDS_QUOTAUNITS_MB "MB" - IDS_NO_QUOTA_REPLICA "(‚±‚̃{ƒŠƒ…[ƒ€‚̓ŒƒvƒŠƒJ‚Ì‚½‚߁AŠ„‚è“–‚Ä—Ê‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñ)" - IDS_NO_QUOTA_CLONE "(‚±‚̃{ƒŠƒ…[ƒ€‚̓oƒbƒNƒAƒbƒv‚Ì‚½‚߁AŠ„‚è“–‚Ä—Ê‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñ)" - IDS_USAGE_REPLICA "%1 Žg—p" - IDS_USAGE_CLONE "%1 Žg—p" - IDS_COL_AGGS_MOVE "ƒ{ƒŠƒ…[ƒ€ì¬Žž‚̃p[ƒeƒBƒVƒ‡ƒ“" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_SERVICE "%1:%2" - IDS_SERVICETYPE_SIMPLE "ƒVƒ“ƒvƒ‹" - IDS_SERVICETYPE_CRON "Cron" - IDS_SERVICESTATE_STOPPED "’âŽ~" - IDS_SERVICESTATE_STOPPING "’âŽ~’†" - IDS_SERVICESTATE_STARTING "ŠJŽn’†" - IDS_SERVICESTATE_RUNNING "ŽÀs’†" - IDS_SERVICETYPE_FS_LONG "FS (ƒtƒ@ƒCƒ‹EƒVƒXƒeƒ€)" - IDS_SERVICETYPE_FS "FS" - IDS_SERVICE_LASTERROR "%1" - IDS_SERVICES_IN_CELL "ƒZƒ‹ %1 ‚Ì‚·‚ׂẴT[ƒrƒX:" - IDS_SERVICE_STARTDATE "ŠJŽn %1" - IDS_SERVICE_STOPDATE "’âŽ~ %1" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_PERCENTAGE "%1 %%" - IDS_AGGREGATES_IN_SERVER "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“:" - IDS_AGGREGATES_IN_CELL "ƒZƒ‹ %1 ‚Ì‚·‚ׂẴp[ƒeƒBƒVƒ‡ƒ“:" - IDS_AGGREGATES_IN_NOTHING "ƒp[ƒeƒBƒVƒ‡ƒ“:" - IDS_FILESETS_IN_SERVER "ƒT[ƒo[ %1 ‚̃{ƒŠƒ…[ƒ€:" - IDS_FILESETS_IN_CELL "ƒZƒ‹ %1 ‚Ì‚·‚ׂẴ{ƒŠƒ…[ƒ€:" - IDS_FILESETS_IN_NOTHING "ƒ{ƒŠƒ…[ƒ€:" - IDS_SERVICES_IN_SERVER "ƒT[ƒo[ %1 ‚̃T[ƒrƒX:" - IDS_SERVICES_IN_NOTHING "ƒT[ƒrƒX:" - IDS_UNKNOWN "(•s–¾)" - IDS_UNKNOWN_GROUP "ƒOƒ‹[ƒv #%1 (–¼‘O‚Í•s–¾)" - IDS_AGGFULL_WARN_OFF "ƒfƒtƒHƒ‹ƒg‚µ‚«‚¢’l (Œx‚̓T[ƒo[‚ÅŽg—p•s‰Â)" - IDS_SERVER_AGGREGATE "%1:%2" - IDS_SERVERNAME_ERROR "%1 - %2" - IDS_AGGREGATENAME_ERROR "%1 - %2" - IDS_SETFULL_WARN_OFF "ƒfƒtƒHƒ‹ƒg‚µ‚«‚¢’l (Œx‚̓T[ƒo[‚ÅŽg—p•s‰Â)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_LASTERRORDATE "%1 - I—¹ƒR[ƒh %2" - IDS_COL_SERVERS "ƒZƒ‹‚̃T[ƒo[" - IDS_COL_FILESETS "ƒT[ƒo[‚̃{ƒŠƒ…[ƒ€" - IDS_COL_AGGREGATES "ƒT[ƒo[‚̃p[ƒeƒBƒVƒ‡ƒ“" - IDS_COL_SERVICES "ƒT[ƒo[‚̃T[ƒrƒX" - IDS_COL_REPLICAS "ƒ{ƒŠƒ…[ƒ€‚̃ŒƒvƒŠƒJ" - IDS_COLUMNS_TITLE "•\ަ—ñ‚Ì‘I‘ð - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" - IDS_REPCOL_SERVER "ƒT[ƒo[" - IDS_REPCOL_AGGREGATE "ƒp[ƒeƒBƒVƒ‡ƒ“" - IDS_REPCOL_DATE_UPDATE "ÅIXV" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COL_AGGS_CREATE "ƒ{ƒŠƒ…[ƒ€ˆÚ“®Žž‚̃p[ƒeƒBƒVƒ‡ƒ“" - IDS_WARN_TITLE "’ˆÓ" - IDS_WARN_DISABLE_AUTH "u–¢”FØ‚ð‹–‰Âvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚·‚邯A–¢”FØ‚̃vƒŠƒ“ƒVƒpƒ‹‚ª‚±‚̃T[ƒo[‚̃T[ƒrƒX‚𑀍삷‚邱‚Æ‚ª‰Â”\‚ɂȂè‚Ü‚·Bƒ‹[ƒg ID ‚̉º‚ł͐”‘½‚­‚̃T[ƒrƒX‚ªŽÀs‚³‚ê‚Ä‚¢‚邽‚߁A‚±‚̃AƒNƒVƒ‡ƒ“‚Í+" - IDS_WARN_DISABLE_AUTH2 "ƒT[ƒo[‚̃ZƒLƒ…ƒŠƒeƒB[‚ɏd‘å‚ÈŒ‡Š×‚ð‚à‚½‚炵‚Ü‚·B\n\n‚±‚̕ύX‚ðs‚Á‚Ä‚à‚¢‚¢‚Å‚·‚©?" - IDS_SVR_NO_ADDR "(–¢Žw’è)" - IDS_TITLE_BAD_CELL "”Fޝ‚³‚ê‚Ä‚¢‚È‚¢ƒZƒ‹–¼" - IDS_DESC_BAD_CELL "“ü—Í‚µ‚½ƒZƒ‹–¼‚ªƒlƒbƒgƒ[ƒNã‚ÉŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B\n\n“ü—Í‚ª³‚µ‚¢‚©‚Ç‚¤‚©‚ð‚à‚¤ˆê“xŠm”F‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_AGGFULL_WARN_ON "‚±‚̃T[ƒo[‚̃fƒtƒHƒ‹ƒg‚µ‚«‚¢’l(&D) (ƒTƒCƒY‚Ì %1%%)" - IDS_SETFULL_WARN_ON "‚±‚̃T[ƒo[‚̃fƒtƒHƒ‹ƒg‚µ‚«‚¢’l(&D) (ƒTƒCƒY‚Ì %1%%)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS - "“ü—Í‚µ‚½ AFS ID ‚ª”Fޝ‚³‚ê‚È‚¢‚©A‚Ü‚½‚ÍŽw’肵‚½ƒpƒXƒ[ƒh‚ª³‚µ‚­‚ ‚è‚Ü‚¹‚ñB" - IDS_CREDS_NONE "(ƒg[ƒNƒ“‚È‚µ)" - IDS_CREDS_VALID "%2, ŠúŒÀØ‚ê %3" - IDS_CREDS_EXPIRED "(ƒg[ƒNƒ“‚ªŠúŒÀØ‚ê %3)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGG_FILESETS "%1 (Œ‹‡Š„‚è“–‚Ä—Ê: %2)" - IDS_ACTION_DESC_NONE "is’†‚Ì‘€ì‚Í‚ ‚è‚Ü‚¹‚ñB" - IDS_ACTION_DESC_ONE "ŽŸ‚Ì‘€ì‚ªŒ»Ýis’†‚Å‚·:" - IDS_ACTION_DESC_MULT "ŽŸ‚Ì‘€ì‚ªŒ»Ýis’†‚Å‚·:" - IDS_ACTCOL_OPERATION "‘€ì" - IDS_ACTCOL_ELAPSED "Œo‰ßŽžŠÔ" - IDS_ACTION_REFRESH "ƒZƒ‹î•ñ‚̍ŐV•\ަ’†" - IDS_ACTION_CREATESERVER "ƒT[ƒo[ %1 ‚̍쐬’†" - IDS_ACTION_DELETESERVER "ƒT[ƒo[ %1 ‚̍폜’†" - IDS_ACTION_GETSERVERLOGFILE "ƒƒOEƒtƒ@ƒCƒ‹ %2 ‚ðƒT[ƒo[ %1 ‚©‚çŽæ“¾’†" - IDS_ACTION_SETSERVERAUTH "ƒT[ƒo[ %1 ‚̃AƒNƒZƒX§ŒÀ‚ð•ύX’†" - IDS_ACTION_CHANGESERVERSTATUS "ƒT[ƒo[ %1 ‚̃vƒƒpƒeƒB[‚ð•ύX’†" - IDS_ACTION_STARTSERVICE "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ðŠJŽn’†" - IDS_ACTION_STOPSERVICE "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ð’âŽ~’†" - IDS_ACTION_RESTARTSERVICE "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ðÄŽn“®’†" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SYNCVLDB_SVR "VLDB ‚ðƒT[ƒo[ %1 ‚Æ“¯Šú‰»’†" - IDS_ACTION_SYNCVLDB_AGG "VLDB ‚ðƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2 ‚Æ“¯Šú‰»’†" - IDS_ACTION_SCOUT "ƒT[ƒo[ %1 ‚Ì–â‘è‚ðŒŸ¸’†" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SETREPPARAMS "ƒ{ƒŠƒ…[ƒ€ %3 ‚Ì•¡»ƒvƒƒpƒeƒB[‚ð•ύX’†" - IDS_ACTION_CREATEREPLICA - "ƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2 ‚Ƀ{ƒŠƒ…[ƒ€ %3 ‚̃ŒƒvƒŠƒJ‚ðì¬’†" - IDS_DELSET_REPLICA_DESC "’ˆÓ!\n\n‘±s‚·‚邯AƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€ %3 ‚̃ŒƒvƒŠƒJ‚ªíœ‚³‚ê‚Ü‚·B" - IDS_DELSET_CLONE_DESC "’ˆÓ!\n\n‘±s‚·‚邯Aƒ{ƒŠƒ…[ƒ€EƒoƒbƒNƒAƒbƒv %3 ‚ªƒT[ƒo[ %1‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚©‚çíœ‚³‚ê‚Ü‚·B" - IDS_INSTALL_DESC1 "‚±‚Ì‘€ì‚́Aƒtƒ@ƒCƒ‹‚ð‚±‚ÌƒRƒ“ƒsƒ…[ƒ^[‚©‚瑼‚ÖƒRƒs[‚µ‚Ü‚·B+" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_INSTALL_DESC2 "ƒtƒ@ƒCƒ‹‚ª‚·‚łɃRƒs[æ‚̃Rƒ“ƒsƒ…[ƒ^[‚É‘¶Ý‚·‚éê‡‚́A‚»‚̃tƒ@ƒCƒ‹‚̓oƒbƒNƒAƒbƒv‚³‚êA.BAK Šg’£Žq‚ª•t‚¯‚ç‚ê‚Ü‚·BŠù‘¶‚̃oƒbƒNƒAƒbƒv‚É‚Í .OLD Šg’£Žq‚ª•t‚¯‚ç‚êAŠù‘¶‚Ì .OLD ƒtƒ@ƒCƒ‹‚͍폜‚³‚ê‚Ü‚·B" - IDS_ACTION_INSTALLFILE "ƒT[ƒo[ %1 ‚Ƀtƒ@ƒCƒ‹ %2 ‚ðƒCƒ“ƒXƒg[ƒ‹’†" - IDS_ACTION_UNINSTALLFILE - "ƒT[ƒo[ %1 ‚©‚çƒtƒ@ƒCƒ‹ %2 ‚ðƒAƒ“ƒCƒ“ƒXƒg[ƒ‹’†" - IDS_ACTION_PRUNEFILES "ƒT[ƒo[ %1 ‚©‚çƒtƒ@ƒCƒ‹‚ðíœ’†" - IDS_FILTER_ALLFILES "‚·‚ׂẴtƒ@ƒCƒ‹|*.*|" - IDS_ACTION_RENAMEFILESET "ƒ{ƒŠƒ…[ƒ€ %1 ‚ð %2 ‚É–¼‘O•ύX’†" - IDS_RECUR_DAILY "–ˆ“ú" - IDS_RECUR_SUNDAY "–ˆ“ú—j“ú" - IDS_RECUR_MONDAY "–ˆŒŽ—j“ú" - IDS_RECUR_TUESDAY "–ˆ‰Î—j“ú" - IDS_RECUR_WEDNESDAY "–ˆ…—j“ú" - IDS_RECUR_THURSDAY "–ˆ–Ø—j“ú" - IDS_RECUR_FRIDAY "–ˆ‹à—j“ú" - IDS_RECUR_SATURDAY "–ˆ“y—j“ú" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATESERVICE "ƒT[ƒo[ %1 ‚ɃT[ƒrƒX %2 ‚ðì¬’†" - IDS_ACTION_DELETESERVICE "ƒT[ƒo[ %1 ‚©‚çƒT[ƒrƒX %2 ‚ðíœ’†" - IDS_ACTION_RELEASEFILESET "ƒ{ƒŠƒ…[ƒ€ %3 ‚ð‰ð•ú’†" - IDS_ACTION_GETDATES "ƒT[ƒo[ %1 ‚̃tƒ@ƒCƒ‹ %2 ‚Ì“ú•t‚ðŽæ“¾’†" - IDS_LASTMODIFIED "ÅI•ύX %1" - IDS_SVR_SECURITY_TITLE "ƒT[ƒo[EƒZƒLƒ…ƒŠƒeƒB[ - %1" - IDS_SVR_LIST_TAB "ŠÇ—ŽÒ" - IDS_ACTION_ADMINLIST_LOAD "ƒT[ƒo[ %1 ‚ÌŠÇ—ŽÒ‚ðŽæ“¾’†" - IDS_ACTION_ADMINLIST_SAVE "ƒT[ƒo[ %1 ‚ÌŠÇ—ŽÒ‚ð‘‚«ž‚Ý’†" - IDS_ADMCOL_PRINCIPAL "ƒƒ“ƒo[" - IDS_ADMCOL_TYPE "ƒ^ƒCƒv" - IDS_ADMCOL_TYPE_GROUP "ƒOƒ‹[ƒv" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_RESTORE "ƒ{ƒŠƒ…[ƒ€ %1 ‚Ì•œŒ³’†" - IDS_COL_AGGS_RESTORE "ƒ{ƒŠƒ…[ƒ€•œŒ³Žž‚̃p[ƒeƒBƒVƒ‡ƒ“" - IDS_RESTORE_FILTER "ƒ{ƒŠƒ…[ƒ€Eƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹|*.DMP|‚·‚ׂẴtƒ@ƒCƒ‹|*.*|" - IDS_SVC_BOS_TAB "BOS" - IDS_ACTION_SETRESTART "ƒT[ƒo[ %1 ‚̃T[ƒrƒXÄŽn“®Žž‚ð•ύX’†" - IDS_RESTORE_CREATESET "‰º‚ÅŽw’肵‚½ƒT[ƒo[‚¨‚æ‚уp[ƒeƒBƒVƒ‡ƒ“‚Ƀ{ƒŠƒ…[ƒ€ %1 ‚ªì¬‚³‚ê‚Ü‚·B" - IDS_RESTORE_OVERWRITESET - "’ˆÓ! ƒ{ƒŠƒ…[ƒ€ %3 ‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚É‘¶Ý‚µ‚Ü‚·B‘±s‚·‚邯ã‘‚«‚³‚ê‚Ü‚·!" - IDS_SUBSET_TITLE_LOAD "ƒT[ƒo[EƒTƒuƒZƒbƒg‚̃I[ƒvƒ“" - IDS_SUBSET_TITLE_SAVE "ƒT[ƒo[EƒTƒuƒZƒbƒg‚̕ۊÇ" - IDS_BUTTON_OPEN "ƒI[ƒvƒ“(&O)" - IDS_BUTTON_SAVE "•ÛŠÇ(&S)" - IDS_SUBSET_SAVE_TITLE "’ˆÓ" - IDS_SUBSET_SAVE_DESC "ƒT[ƒo[EƒTƒuƒZƒbƒg‚Í %1 ‚Ì–¼‘O‚Å‚·‚łɑ¶Ý‚µ‚Ü‚·B\n\n‚±‚̃TƒuƒZƒbƒg‚ðã‘‚«‚µ‚Ü‚·‚©?" - IDS_SUBSET_CHANGED "%1 [•ύXÏ‚Ý]" - IDS_SUBSET_TAB "ƒ‚ƒjƒ^[‚³‚ê‚éƒT[ƒo[" - IDS_SUBSET_DISCARD_TITLE "ƒTƒuƒZƒbƒg‚ð•ÛŠÇ‚µ‚Ü‚·‚©?" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SUBSET_DISCARD_DESC "Œ»Ýƒ‚ƒjƒ^[‚³‚ê‚Ä‚¢‚éƒT[ƒo[‚ÌƒŠƒXƒg‚ðƒTƒuƒZƒbƒg‚Æ‚µ‚ĕۊǂµ‚Ä‚¢‚Ü‚¹‚ñB‚±‚ÌƒŠƒXƒg‚ð•ÛŠÇ‚·‚邯AŒã‚Å‚±‚ê‚ðŽg—p‚µ‚ăT[ƒo[‚̂邱‚ê‚Æ“¯‚¶ƒZƒbƒg‚̃‚ƒjƒ^[‚𑱂¯‚邱‚Æ‚ª‚Å‚«‚Ü‚·B\n\n+" - IDS_SUBSET_DISCARD_DESC2 - "Œ»Ýƒ‚ƒjƒ^[‚³‚ê‚Ä‚¢‚éƒT[ƒo[‚ÌƒŠƒXƒg‚ðŠÜ‚ÞƒTƒuƒZƒbƒg‚ðì¬‚µ‚Ü‚·‚©?" - IDS_SUBSET_NONAME "(–³‘è)" - IDS_SUBSET_NOSUBSET "(‚·‚ׂẴT[ƒo[‚ªƒ‚ƒjƒ^[‚³‚ê‚Ä‚¢‚Ü‚·)" - IDS_SUBSET_SERVERSUBSET "ƒT[ƒo[ %1" - IDS_FILESET_SOME "ƒZƒ‹ %1 ‚Ń‚ƒjƒ^[‚³‚ê‚Ä‚¢‚é‚·‚ׂẴT[ƒo[‚̃{ƒŠƒ…[ƒ€:" - IDS_AGGREGATE_SOME "ƒZƒ‹ %1 ‚Ń‚ƒjƒ^[‚³‚ê‚Ä‚¢‚é‚·‚ׂẴT[ƒo[‚̃p[ƒeƒBƒVƒ‡ƒ“:" - IDS_SERVICE_SOME "ƒZƒ‹ %1 ‚Ń‚ƒjƒ^[‚³‚ê‚Ä‚¢‚é‚·‚ׂẴT[ƒo[‚̃T[ƒrƒX:" - IDS_FILESET_UNMON "ƒT[ƒo[ %1 ‚̓‚ƒjƒ^[‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ" - IDS_AGGREGATE_UNMON "ƒT[ƒo[ %1 ‚̓‚ƒjƒ^[‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ" - IDS_SERVICE_UNMON "ƒT[ƒo[ %1 ‚̓‚ƒjƒ^[‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ" - IDS_SUBSET_DELETE_TITLE "ƒTƒuƒZƒbƒg‚ðíœ‚µ‚Ü‚·‚©?" - IDS_SUBSET_DELETE_DESC "ƒT[ƒo[EƒTƒuƒZƒbƒg %1 ‚ðíœ‚µ‚Ä‚à‚¢‚¢‚Å‚·‚©?" - IDS_ERROR_TRANSLATED "ƒGƒ‰[”ԍ† 0x%1 (%2):\n\n%3" - IDS_ERROR_NOTTRANSLATED "ƒGƒ‰[”ԍ† 0x%1 (%2) ‚ª”Fޝ‚Å‚«‚Ü‚¹‚ñB" - IDS_FIND_NOTHING_TITLE "ƒRƒ}ƒ“ƒh‚ª‘I‘ð‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FIND_NOTHING_DESC "‘€ì‚ÌŽÀs•û–@‚ɂ‚¢‚ẮAƒŠƒXƒg‚©‚çƒRƒ}ƒ“ƒhs‚ð‘I‘ð‚·‚é‚©AƒL[ƒ[ƒh‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_FIND_UNKNOWN_TITLE "•s–¾‚ȃRƒ}ƒ“ƒh" - IDS_FIND_UNKNOWN_DESC "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚Í ""%1"" ƒRƒ}ƒ“ƒh‚̃wƒ‹ƒvEƒgƒsƒbƒN‚ðŒ©‚Â‚¯‚ç‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_HELPABOUT_DESC1 "Œx: ‚±‚̃Rƒ“ƒsƒ…[ƒ^[EƒvƒƒOƒ‰ƒ€‚́A’˜ìŒ ‚¨‚æ‚э‘Û‹K–ñ‚É‚æ‚è•ی삳‚ê‚Ä‚¢‚Ü‚·B+" - IDS_HELPABOUT_DESC2 "‹–‰Â‚È‚­‚±‚̃\ƒtƒgƒEƒFƒA‚ð•¡ŽÊ‚ ‚é‚¢‚Í”z•z‚·‚邯A–¯Ž–‚Ü‚½‚ÍŒYŽ–ã‚̔ƍ߂ƂȂèA–@—¥‚Ì‚à‚Æ‘i‚³‚ê‚éê‡‚ª‚ ‚è‚Ü‚·B\n\n+" - IDS_HELPABOUT_DESC3 "AFS ‚Í Transarc Corporation (IBM company) ‚̏¤•W‚Å‚·B" - IDS_CANT_QUIT_TITLE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" - IDS_CANT_QUIT_REBOOT "’ˆÓ!\n\nAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÍŒ»Ý‘€ì‚ðŽÀs’†‚Å‚·B‚¢‚Ü Windows ‚ðƒVƒƒƒbƒgƒ_ƒEƒ“‚·‚邯A‚±‚ê‚ç‚Ì‘€ì‚͐³í‚ÉŠ®—¹‚µ‚Ü‚¹‚ñB\n\nWindows ‚ðÄŽn“®‚µ‚Ü‚·‚©?" - IDS_APP_TITLE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" - IDS_ACTION_OPENCELL "%1 ƒZƒ‹“à‚̃T[ƒo[‚ðŒŸõ’†" - IDS_OPTIONS_TITLE "ƒIƒvƒVƒ‡ƒ“ - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" - IDS_OPTIONS_GENERAL_TAB "ˆê”Ê" - IDS_BADCREDS_DESC "ŠÇ—ŽÒ‚Æ‚µ‚ăƒOƒCƒ“‚µ‚È‚¢‚ƁA%1 ƒZƒ‹‚ÌŠÇ—‚ɏ\•ª‚ÈŒ ŒÀ‚ª—^‚¦‚ç‚ê‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·BƒAƒNƒZƒXŒ ŒÀ‚ª\•ª‚łȂ¢‚ƁA–â‘肪‘¶Ý‚µ‚È‚¢‚Æ‚«‚É AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒZƒ‹‚Å–â‘è‚ðŒ©‚Â‚¯‚éê‡‚ª‚ ‚è‚Ü‚·B" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CONFIRMATION_TITLE "Šm”F - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" - IDS_NO_GROUP_CHECKBOX "Š—LƒOƒ‹[ƒv‚È‚µ" - IDS_AFS_ID_DIDEXP "%1 (ƒg[ƒNƒ“‚ÌŠúŒÀ‚ª %2 ‚ɐ؂ê‚Ü‚µ‚½)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_QUERYING "(Æ‰ï’†)" - IDS_ADMCOL_TYPE_FOREIGN_GROUP "ŠO•”ƒOƒ‹[ƒv" - IDS_ADMCOL_TYPE_FOREIGN_USER "ŠO•”ƒ†[ƒU[" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_NOTIFIER "ƒm[ƒeƒBƒtƒ@ƒCƒ„[" - IDS_SVC_NONOTIFIER "(‚È‚µ)" - IDS_SVR_KEY_TAB "ƒT[ƒo[Œ®" - IDS_KEYNAME_NOTIME "ƒT[ƒo[ %1 ‚ÌŒ®:" - IDS_KEYNAME_WITHTIME "ƒT[ƒo[ %1 ‚ÌŒ® (•ύX %2):" - IDS_SVRKEY_VERSION "ƒo[ƒWƒ‡ƒ“" - IDS_SVRKEY_DATA "’l" - IDS_SVRKEY_CHECKSUM "ƒ`ƒFƒbƒNƒTƒ€" - IDS_SVRKEY_DATA_UNKNOWN "(‰B‚·)" - IDS_STARTSERVICE_TITLE "ƒT[ƒrƒX‚ÌŠJŽn" - IDS_STOPSERVICE_TITLE "ƒT[ƒrƒX‚Ì’âŽ~" - IDS_STARTSERVICE_TEXT "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ðŠJŽn‚·‚é‚ɂ́u—¹‰ðv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STOPSERVICE_TEXT "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ð’âŽ~‚·‚é‚ɂ́u—¹‰ðv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_STARTSERVICE_STARTUP - "‚±‚̕ύX‚͉i‘±“I‚È‚à‚̂ɂ·‚邱‚Æ‚ª‚Å‚«A‚»‚ê‚É‚æ‚Á‚ăT[ƒo[ %1 ‚ªÄŽn“®‚³‚ê‚邯ީ“®“I‚ɃT[ƒrƒX %2 ‚ªŠJŽn‚³‚ê‚Ü‚·B" - IDS_STOPSERVICE_STARTUP "‚±‚̕ύX‚͉i‘±“I‚È‚à‚̂ɂ·‚邱‚Æ‚ª‚Å‚«A‚»‚ê‚É‚æ‚Á‚ăT[ƒo[ %1‚ªÄŽn“®‚³‚ê‚邯ީ“®“I‚ɂ̓T[ƒrƒX %2 ‚ªŠJŽn‚³‚ê‚Ü‚¹‚ñB" - IDS_STARTSERVICE_PERMANENT - "‰i‘±(&P) (ƒT[ƒo[ %1 ‚̍Ďn“®Žž‚ɃT[ƒrƒX %2 ‚ðŠJŽn)" - IDS_STARTSERVICE_TEMPORARY - "ˆêŽž(&T) (ƒT[ƒo[ %1 ‚̍Ďn“®Žž‚ɃT[ƒrƒX %2 ‚ðŠJŽn‚µ‚È‚¢)" - IDS_STOPSERVICE_PERMANENT - "‰i‘±(&P) (ƒT[ƒo[ %1 ‚̍Ďn“®Žž‚ɃT[ƒrƒX %2 ‚ðŠJŽn‚µ‚È‚¢)" - IDS_STOPSERVICE_TEMPORARY - "ˆêŽž(&T) (ƒT[ƒo[ %1 ‚̍Ďn“®Žž‚ɃT[ƒrƒX %2 ‚ðŠJŽn)" - IDS_ACTION_EXECUTE "ƒT[ƒo[ %1 ‚Å %2 ‚ðŽÀs’†" - IDS_ACTION_SALVAGE_SVR "ƒT[ƒo[ %1 ‚Ì‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒTƒ‹ƒx[ƒW’†" - IDS_ACTION_SALVAGE_AGG "ƒp[ƒeƒBƒVƒ‡ƒ“ %1:2 ‚Ì‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒTƒ‹ƒx[ƒW’†" - IDS_ACTION_SALVAGE_VOL "ƒp[ƒeƒBƒVƒ‡ƒ“ %1:2 ‚̃{ƒŠƒ…[ƒ€ %3 ‚ðƒTƒ‹ƒx[ƒW’†" - IDS_SALVAGE_SVR "ƒT[ƒo[ %1 ‚Ì‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒTƒ‹ƒx[ƒW" - IDS_SALVAGE_AGG "ƒT[ƒo[ %1 ƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ì‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒTƒ‹ƒx[ƒW" - IDS_SALVAGE_SET "ƒT[ƒo[ %1 ƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€ %3 ‚ðƒTƒ‹ƒx[ƒW" - IDS_SETSTATUS_SALVAGE "ƒ{ƒŠƒ…[ƒ€‚̃Tƒ‹ƒx[ƒW’†" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETSTATUS_LOCKED "ƒ{ƒŠƒ…[ƒ€‚ªƒƒbƒN‚³‚ê‚Ä‚¢‚Ü‚·" - IDS_SETSTATUS_NO_VOL "ƒ{ƒŠƒ…[ƒ€‚ª‚ ‚è‚Ü‚¹‚ñ" - IDS_SETSTATUS_BUSY "ƒ{ƒŠƒ…[ƒ€‚ªŒ»ÝŽg—p’†‚Å‚·" - IDS_SETSTATUS_MOVED "ƒ{ƒŠƒ…[ƒ€‚ªˆÚ“®‚³‚ê‚Ü‚µ‚½" - IDS_SVR_CAPACITY "%1" - IDS_SVR_ALLOCATION "%1 (%2%%)" - IDS_SVRCOL_ADDRESS "ƒAƒhƒŒƒX" - IDS_HOST_TITLE "ƒT[ƒo[ %1 ‚ª”Fޝ‚·‚éƒf[ƒ^ƒx[ƒXEƒzƒXƒgEƒT[ƒo[:" - IDS_SVR_HOSTS_TITLE "ƒT[ƒo[ %1 - ƒf[ƒ^ƒx[ƒXEƒzƒXƒg" - IDS_SVR_HOST_TAB "ƒf[ƒ^ƒx[ƒXEƒzƒXƒg" - IDS_ACTION_HOSTLIST_LOAD "ƒT[ƒo[ %1 ‚©‚çƒzƒXƒgEƒŠƒXƒg‚ðŽæ“¾’†" - IDS_ACTION_HOSTLIST_SAVE "ƒT[ƒo[ %1 ‚ɃzƒXƒgEƒŠƒXƒg‚ð‘‚«ž‚Ý’†" - IDS_SETSTATUS_1ALERT "ƒ{ƒŠƒ…[ƒ€‚É 1 ‚–â‘肪‚ ‚è‚Ü‚·" - IDS_SETSTATUS_2ALERT "ƒ{ƒŠƒ…[ƒ€‚É %1 ‚Ì–â‘肪‚ ‚è‚Ü‚·" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CHANGEADDR "ƒT[ƒo[ %1 ‚Ì IP ƒAƒhƒŒƒX‚ð•ύX’†" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_ADDSITE "vos addsite" - IDS_COMMAND_VOS_BACKUP "vos backup" - IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" - IDS_COMMAND_VOS_CREATE "vos create" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_DELENTRY "vos delentry" - IDS_COMMAND_VOS_DUMP "vos dump" - IDS_COMMAND_VOS_EXAMINE "vos examine" - IDS_COMMAND_VOS_LISTPART "vos listpart" - IDS_COMMAND_VOS_LISTVLDB "vos listvldb" - IDS_COMMAND_VOS_LISTVOL "vos listvol" - IDS_COMMAND_VOS_LOCK "vos lock" - IDS_COMMAND_VOS_MOVE "vos move" - IDS_COMMAND_VOS_PARTINFO "vos partinfo" - IDS_COMMAND_VOS_RELEASE "vos release" - IDS_COMMAND_VOS_REMOVE "vos remove" - IDS_COMMAND_VOS_REMSITE "vos remsite" - IDS_COMMAND_VOS_RENAME "vos rename" - IDS_COMMAND_VOS_RESTORE "vos restore" - IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" - IDS_COMMAND_VOS_UNLOCK "vos unlock" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" - IDS_COMMAND_VOS_ZAP "vos zap" - IDS_COMMAND_BOS_ADDHOST "bos addhost" - IDS_COMMAND_BOS_ADDKEY "bos addkey" - IDS_COMMAND_BOS_ADDUSER "bos adduser" - IDS_COMMAND_BOS_CREATE "bos create" - IDS_COMMAND_BOS_DELETE "bos delete" - IDS_COMMAND_BOS_EXEC "bos exec" - IDS_COMMAND_BOS_GETDATE "bos getdate" - IDS_COMMAND_BOS_GETLOG "bos getlog" - IDS_COMMAND_BOS_GETRESTART "bos getrestart" - IDS_COMMAND_BOS_INSTALL "bos install" - IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" - IDS_COMMAND_BOS_LISTKEYS "bos listkeys" - IDS_COMMAND_BOS_LISTUSERS "bos listusers" - IDS_COMMAND_BOS_PRUNE "bos prune" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_BOS_REMOVEHOST "bos removehost" - IDS_COMMAND_BOS_REMOVEKEY "bos removekey" - IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" - IDS_COMMAND_BOS_RESTART "bos restart" - IDS_COMMAND_BOS_SALVAGE "bos salvage" - IDS_COMMAND_BOS_SETAUTH "bos setauth" - IDS_COMMAND_BOS_SETRESTART "bos setrestart" - IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" - IDS_COMMAND_BOS_START "bos start" - IDS_COMMAND_BOS_STARTUP "bos startup" - IDS_COMMAND_BOS_STATUS "bos status" - IDS_COMMAND_BOS_STOP "bos stop" - IDS_COMMAND_BOS_UNINSTALL "bos uninstall" - IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" - IDS_COMMAND_FS_LISTQUOTA "fs listquota" - IDS_COMMAND_FS_QUOTA "fs quota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_FS_SETQUOTA "fs setquota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCSHORT_UNMONITORED - "ƒT[ƒo[ %1 ‚Í–â‘è‚ɂ‚¢‚ă‚ƒjƒ^[‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ" - IDS_ALERT_DESCSHORT_TIMEOUT - "ƒT[ƒo[ %1 ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½BÅIƒGƒ‰[: %3" - IDS_ALERT_DESCSHORT_AGG_FULL - "%2 ‚̃p[ƒeƒBƒVƒ‡ƒ“Žg—p—¦‚ªŒx‚µ‚«‚¢’l %3%% ‚ð’´‚¦‚Ü‚µ‚½ (%4)" - IDS_ALERT_DESCSHORT_SET_FULL - "%3 ‚̃{ƒŠƒ…[ƒ€Žg—p—¦‚ªŒx‚µ‚«‚¢’l %4%% ‚ð’´‚¦‚Ü‚µ‚½ (%5)" - IDS_ALERT_DESCSHORT_NO_VLDBENT "ƒ{ƒŠƒ…[ƒ€ %3 ‚É VLDB €–Ú‚ª‚ ‚è‚Ü‚¹‚ñ" - IDS_ALERT_DESCSHORT_NO_SVRENT_SET - "ƒ{ƒŠƒ…[ƒ€ %3 ‚Í VLDB €–Ú‚ðŽ‚Á‚Ä‚¢‚Ü‚·‚ªAƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚ÉŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ALERT_DESCSHORT_STOPPED "ƒT[ƒrƒX %2 ‚ª %3 ‚É’âŽ~‚µ‚Ü‚µ‚½" - IDS_ALERT_DESCSHORT_NO_SVRENT_AGG - "ƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚Í VLDB ‚É‚æ‚Á‚ÄƒŠƒtƒŒƒbƒVƒ…‚³‚ê‚Ü‚µ‚½‚ªAƒT[ƒo[ %1 ‚ÉŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ALERT_DESCSHORT_BADCREDS - "ƒT[ƒo[ %1 ‚ðŠÇ—‚·‚邽‚߂ɏ\•ª‚ÈŒ ŒÀ‚ª‚ ‚è‚Ü‚¹‚ñ" - IDS_ALERT_DESCSHORT_AGG_ALLOC - "ƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚ÌŒ‹‡ƒ{ƒŠƒ…[ƒ€Š„‚è“–‚Ä—Ê‚ª‚»‚Ì—e—ʂ𒴂¦‚Ü‚µ‚½" - IDS_ALERT_DESCSHORT_STATE_NO_VNODE - "%3 ƒ{ƒŠƒ…[ƒ€‚͉ó‚ê‚Ä‚¢‚邽‚ߎg—p‚Å‚«‚Ü‚¹‚ñB" - IDS_ALERT_DESCSHORT_STATE_NO_SERVICE - "ƒ{ƒŠƒ…[ƒ€ %3 ‚ðˆµ‚¤ƒT[ƒrƒX‚ªŽÀs‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB" - IDS_ALERT_DESCSHORT_STATE_OFFLINE - "%3 ƒ{ƒŠƒ…[ƒ€‚̓Iƒtƒ‰ƒCƒ“‚Ì‚½‚ߎg—p‚Å‚«‚Ü‚¹‚ñB" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_TIMEOUT - "ƒT[ƒo[ %1 ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñB%2 ‚ɍs‚í‚ꂽÅŒã‚ÌŽŽs‚̓Gƒ‰[ ""%3"" ‚ɂȂè‚Ü‚µ‚½B" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_AGG_FULL - "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚ÌŽg—p—¦‚ª‚»‚ÌŒx‚µ‚«‚¢’l %3%% ‚ð’´‚¦‚Ü‚µ‚½ (%4)B" - IDS_ALERT_DESCFULL_SET_FULL - "ƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2) ‚ÌŽg—p—¦‚ª‚»‚ÌŒx‚µ‚«‚¢’l %4%% ‚ð’´‚¦‚Ü‚µ‚½ (%5)B" - IDS_ALERT_DESCFULL_NO_VLDBENT - "ƒ{ƒŠƒ…[ƒ€ %3 ‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚É‘¶Ý‚µ‚Ü‚·‚ªA‘Ήž‚·‚é VLDB €–Ú‚ª‚ ‚è‚Ü‚¹‚ñB" - IDS_ALERT_DESCFULL_NO_SVRENT_SET - "ƒ{ƒŠƒ…[ƒ€ %3 ‚Ì VLDB €–Ú‚ª‘¶Ý‚µ‚Ü‚·‚ªAƒ{ƒŠƒ…[ƒ€‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚ÉŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ALERT_DESCFULL_STOPPED - "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ª %3 ‚ɏI—¹ƒR[ƒh %5 ‚Å’âŽ~‚µ‚Ü‚µ‚½B" - IDS_ALERT_DESCFULL_NO_SVRENT_AGG - "VLDB ‚̓T[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€‚ðŽQÆ‚µ‚Ü‚·‚ªAƒp[ƒeƒBƒVƒ‡ƒ“‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ALERT_DESCFULL_BADCREDS - "‚±‚̃Zƒ‹“à‚ÅŠÇ—ŽÒ‚Æ‚µ‚Ä‚Ì AFS ƒg[ƒNƒ“‚ðŽ‚Á‚Ä‚¢‚È‚¢‚½‚߁AAFSƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚É‘¶Ý‚µ‚È‚¢ƒGƒ‰[‚ðŒŸo‚µ‚Ü‚µ‚½B" - IDS_ALERT_DESCFULL_AGG_ALLOC - "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€‚ÌŒ‹‡Š„‚è“–‚ėʁA‡Œv %4A‚ªƒp[ƒeƒBƒVƒ‡ƒ“‚Ì—e—Ê %3 ‚ð’´‚¦‚Ü‚µ‚½B" - IDS_ALERT_DESCFULL_STATE_NO_VNODE - "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ì %3 ƒ{ƒŠƒ…[ƒ€‚ªŠÖ˜A‚·‚é Vnode ‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñB(ƒ{ƒŠƒ…[ƒ€ó‹µ‚Í 0x%4)" - IDS_ALERT_DESCFULL_STATE_NO_SERVICE - "ƒT[ƒo[ %1 ‚Ńtƒ@ƒCƒ‹EƒGƒNƒXƒ|[ƒ^[EƒT[ƒrƒX‚ªŽÀs‚³‚ê‚Ä‚¢‚È‚¢‚½‚߁Aƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ì %3 ƒ{ƒŠƒ…[ƒ€‚ðŽg—p‚Å‚«‚Ü‚¹‚ñB(ƒ{ƒŠƒ…[ƒ€ó‹µ‚Í 0x%4)" - IDS_ALERT_DESCFULL_STATE_OFFLINE - "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ì %3 ƒ{ƒŠƒ…[ƒ€‚ªƒIƒtƒ‰ƒCƒ“‚Ì‚½‚ߎg—p‚Å‚«‚Ü‚¹‚ñB(ƒ{ƒŠƒ…[ƒ€ó‹µ‚Í 0x%4)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_TIMEOUT "‚±‚̃T[ƒo[‚ɍĐڑ±‚·‚é‚ɂ́AuÄŽŽsvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_ALERT_FIX_AGG_FULL "‚±‚̃p[ƒeƒBƒVƒ‡ƒ“‚ÌŽg—p—¦‚ÌŒx‚µ‚«‚¢’l‚ð•ύX‚·‚é‚ɂ́AuŒxvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_ALERT_FIX_SET_FULL "‚±‚̃{ƒŠƒ…[ƒ€‚ÌŽg—p—¦‚ÌŒx‚µ‚«‚¢’l‚ð•ύX‚·‚é‚ɂ́AuŒxvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_NO_VLDBENT - "VLDB ‚ªŒÃ‚­‚È‚Á‚Ä‚¢‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B‚»‚̏ꍇ‚́AuVLDB ‚Ì“¯Šú‰»vƒRƒ}ƒ“ƒh‚Å‚±‚ê‚ðXV‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_ALERT_FIX_NO_SVRENT_SET - "ƒT[ƒo[‚ƃp[ƒeƒBƒVƒ‡ƒ“‚ª³‚µ‚­‹@”\‚µ‚Ä‚¢‚é‚©‚ðŠm”F‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_ALERT_FIX_STOPPED "‚±‚̃T[ƒrƒX‚̃T[ƒrƒXEƒƒO‚ðŒ©‚é‚ɂ́AuƒƒO‚Ì•\ަvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_ALERT_FIX_NO_SVRENT_AGG - "ƒT[ƒo[‚𒲂ׂāAƒp[ƒeƒBƒVƒ‡ƒ“‚ªƒGƒNƒXƒ|[ƒg‚³‚êA³‚µ‚­‹@”\‚µ‚Ä‚¢‚é‚©‚ðŠm”F‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_ALERT_FIX_BADCREDS "V‚µ‚¢ AFS ƒg[ƒNƒ“‚ðŽæ“¾‚·‚é‚ɂ́Au”FØvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_ALERT_FIX_AGG_ALLOC "‚±‚̃p[ƒeƒBƒVƒ‡ƒ“‚̃{ƒŠƒ…[ƒ€‚ÌŠ„‚è“–‚Ä—Ê‚ðŒ¸‚ç‚·‚©A1 ‚‚܂½‚Í•¡”‚̃{ƒŠƒ…[ƒ€‚𑼂̃p[ƒeƒBƒVƒ‡ƒ“‚ÖˆÚ“®‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_ALERT_FIX_STATE_NO_VNODE " " - IDS_ALERT_FIX_STATE_NO_SERVICE " " - IDS_ALERT_FIX_STATE_OFFLINE " " -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_BUTTON_TRYAGAIN "ÄŽŽs(&A)" - IDS_ALERT_BUTTON_WARNINGS "Œx(&W)..." - IDS_ALERT_BUTTON_VIEWLOG "ƒƒO‚Ì•\ަ(&V)" - IDS_ALERT_BUTTON_SHOWME "•\ަ(&S)" - IDS_ALERT_BUTTON_GETCREDS "”FØ(&A)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_CELLSERVERS_NOCELL - "ƒZƒ‹‚ªŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñBAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ðŽg—p‚·‚邽‚߂ɂ́A‘€ì‚µ‚½‚¢ AFS ƒZƒ‹‚ðŽw’è‚·‚é•K—v‚ª‚ ‚è‚Ü‚·Bã‚́uƒZƒ‹vƒƒjƒ…[‚ŁuƒI[ƒvƒ“...vƒƒjƒ…[€–Ú‚ð‘I‚ñ‚ŁAƒZƒ‹‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_ERROR_REFRESH_CELLSERVERS - "ƒT[ƒo[‚ÌƒŠƒXƒg‚ð %1 ƒZƒ‹‚ɂ‚¢‚Ď擾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒGƒ‰[: %2" - IDS_ERROR_CANT_OPEN_CELL - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒZƒ‹ %1 “à‚̃T[ƒo[‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒZƒ‹‚Ì–¼‘O‚𐳂µ‚­“ü—Í‚µ‚½‚©‚ð‚à‚¤ˆê“xŠm”F‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_ERROR_REFRESH_AGGREGATES - "ƒp[ƒeƒBƒVƒ‡ƒ“‚ÌƒŠƒXƒg‚ð %1 ƒT[ƒo[‚ɂ‚¢‚Ď擾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒGƒ‰[: %2" - IDS_ERROR_REFRESH_SERVER_STATUS - "ƒT[ƒo[ %1 ‚ÌŒ»Ý‚Ìó‹µ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CHANGE_SERVER_STATUS - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃vƒƒpƒeƒB[‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_REFRESH_AGGREGATE_STATUS - "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚ÌŒ»Ý‚Ìó‹µ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_FILESET_STATUS - "ƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2) ‚ÌŒ»Ý‚Ìó‹µ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_REFRESH_SERVICE_STATUS - "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ÌŒ»Ý‚̏󋵂𔻕ʂł«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_MOVE_FILESET "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒ{ƒŠƒ…[ƒ€ %3 ‚ðƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚©‚çƒT[ƒo[ %4 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %5 ‚ÖˆÚ“®‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_VIEW_LOGFILE "%2 ƒtƒ@ƒCƒ‹‚ðƒT[ƒo[ %1 ‚©‚ç“ǂݎæ‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒtƒ@ƒCƒ‹–¼‚𐳂µ‚­“ü—Í‚µ‚½‚©A‚Ü‚½ƒtƒ@ƒCƒ‹‚ðŒ©‚é‚½‚߂ɏ\•ª‚È‹–‰Â‚ðŽ‚Á‚Ä‚¢‚é‚©‚𒲂ׂĂ­‚¾‚³‚¢B" - IDS_ERROR_NOT_REPLICATED - "ƒ{ƒŠƒ…[ƒ€ %1 ‚Ì•¡»ó‹µ‚𔻕ʂł«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_CREATE_FILESET - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ƀ{ƒŠƒ…[ƒ€ %3 ‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_DELETE_FILESET - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2) ‚ðíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_CREATE_VLDB_ENTRY - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ƀ{ƒŠƒ…[ƒ€ %3 ‚Ì VLDB €–Ú‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_SET_FILESET_QUOTA - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€ %3‚ÌŠ„‚è“–‚Ä—Ê‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_CREATE_SERVER - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒZƒ‹ %1 “à‚Å•K—v‚ȃT[ƒo[€–Ú‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_PING_SERVER - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚Ì IP ƒAƒhƒŒƒX‚𔻕ʂł«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_DELETE_SERVER - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚ðíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_DELETE_SERVER_FILESETS - "ƒT[ƒo[ %1 ‚͂܂¾ƒ{ƒŠƒ…[ƒ€‚̃zƒXƒg‚Å‚ ‚邽‚ߍ폜‚Å‚«‚Ü‚¹‚ñBƒT[ƒo[‚̓{ƒŠƒ…[ƒ€‚ðŽ‚½‚È‚­‚È‚é‚܂ō폜‚Å‚«‚Ü‚¹‚ñB" - IDS_ERROR_CHANGE_AGGREGATE_STATUS - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃vƒƒpƒeƒB[‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CHANGE_SERVICE_STATUS - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚̃vƒƒpƒeƒB[‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_START_SERVICE - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ðŠJŽn‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_STOP_SERVICE - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ð’âŽ~‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_RESTART_SERVICE - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ð’âŽ~‚¨‚æ‚эĎn“®‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CHANGE_REPLICA_STATUS - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€ %3‚Ì•¡»ƒvƒƒpƒeƒB[‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_SYNCVLDB "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ª VLDB ‚ðXV‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_CREATE_REPLICA - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ƀ{ƒŠƒ…[ƒ€ %3 ‚̃ŒƒvƒŠƒJ‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_INSTALL_FILE - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚É %2 ƒtƒ@ƒCƒ‹‚ðƒCƒ“ƒXƒg[ƒ‹‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_UNINSTALL_FILE - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚É %2 ƒtƒ@ƒCƒ‹‚ðƒAƒ“ƒCƒ“ƒXƒg[ƒ‹‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_PRUNE_FILES - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚©‚ç—v‹‚³‚ꂽƒtƒ@ƒCƒ‹‚ðíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_RENAME_FILESET - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒ{ƒŠƒ…[ƒ€ %1 ‚ð ""%2"" ‚É–¼‘O•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_CREATE_SERVICE - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚ɃT[ƒrƒX %2 ‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_DELETE_SERVICE - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚©‚çƒT[ƒrƒX %2 ‚ðíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_RELEASE_FILESET - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ª•¡»‚³‚ꂽƒ{ƒŠƒ…[ƒ€ %3 ‚ð‰ð•ú‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_UPDATE_FILESET - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %2 ƒp[ƒeƒBƒVƒ‡ƒ“ %1 ‚̃{ƒŠƒ…[ƒ€EƒŒƒvƒŠƒJ %3 ‚ðXV‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_UPDATE_ALL - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒ{ƒŠƒ…[ƒ€ %3 ‚̃ŒƒvƒŠƒJ‚ðXV‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_LOAD_ADMLIST - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚ÌŠÇ—ŽÒ‚ÌƒŠƒXƒg‚ð“ǂݎæ‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_LOAD_KEYLIST - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒo[Œ®‚ÌƒŠƒXƒg‚ð“ǂݎæ‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_CREATE_KEY - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̐V‚µ‚¢ƒT[ƒo[Œ®‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_SAVE_ADMLIST - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚ÌŠÇ—ŽÒ‚ÌƒŠƒXƒg‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_CLONE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ƀ{ƒŠƒ…[ƒ€ %3 ‚̃oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_CLONESYS "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ª—v‹‚³‚ꂽƒoƒbƒNƒAƒbƒvEƒ{ƒŠƒ…[ƒ€‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_DUMP_FILESET - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2) ‚Ì“à—e‚ðƒtƒ@ƒCƒ‹ %4 ‚Öƒ_ƒ“ƒv‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_RESTORE_FILESET - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒtƒ@ƒCƒ‹ %4 ‚ðƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2) ‚Ö•œŒ³‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_SET_RESTART_TIMES - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒrƒX‚̍Ďn“®Žž‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_DELETE_REPLICATED_FILESET - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚©‚çƒ{ƒŠƒ…[ƒ€ %3 ‚ðíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\n‚·‚ׂẴŒƒvƒŠƒJ‚ªíœ‚³‚ê‚é‚܂Ń{ƒŠƒ…[ƒ€ %3 ‚͍폜‚Å‚«‚Ü‚¹‚ñB" - IDS_CMDLINE_TITLE "ƒGƒ‰[ - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" - IDS_CMDLINE_SYNTAX "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B" - IDS_CMDLINE_UNRECOGNIZED - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\n""%1"" ƒpƒ‰ƒ[ƒ^[‚ª”Fޝ‚Å‚«‚Ü‚¹‚ñB" - IDS_CMDLINE_DUPLICATE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\n""%1"" ƒpƒ‰ƒ[ƒ^[‚ª•¡”‰ñŽw’肳‚ê‚Ä‚¢‚Ü‚·B" - IDS_CMDLINE_UNEXPECTVALUE - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\n""%1"" ƒpƒ‰ƒ[ƒ^[‚É’l‚ª‚ ‚è‚Ü‚¹‚ñB" - IDS_CMDLINE_MISSINGVAL "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\n""%1"" ƒpƒ‰ƒ[ƒ^[‚ÌŒã‚É’l‚ª‘±‚¢‚Ä‚¢‚Ü‚¹‚ñB" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CMDLINE_SUBSETNOTCELL - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\n""/SUBSET""ƒpƒ‰ƒ[ƒ^[‚Í ""/CELL"" ƒpƒ‰ƒ[ƒ^[‚ªŽw’肳‚ꂽê‡‚ɂ̂ݎw’è‚Å‚«‚Ü‚·B" - IDS_CMDLINE_INVALIDSUBSET - "Žw’肵‚½ƒT[ƒo[EƒTƒuƒZƒbƒg ""%2"" ‚ª %1 ƒZƒ‹‚É’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB" - IDS_CMDLINE_SERVERNOTCELL - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\n""/SERVER""ƒpƒ‰ƒ[ƒ^[‚Í ""/CELL"" ƒpƒ‰ƒ[ƒ^[‚ªŽw’肳‚ꂽê‡‚ɂ̂ݎw’è‚Å‚«‚Ü‚·B" - IDS_CMDLINE_RESET_TITLE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" - IDS_CMDLINE_RESET_DESC "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªŽw’肳‚ꂽÝ’è‚ðƒNƒŠƒA‚µ‚Ü‚µ‚½B" - IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE - "ƒp[ƒeƒBƒVƒ‡ƒ“‚ª‘¶Ý‚µ‚È‚¢‚©AƒGƒNƒXƒ|[ƒg‚³‚ê‚Ä‚¢‚È‚¢‚½‚߁AAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚Í VLDB ‚ðƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Æ“¯Šú‰»‚Å‚«‚Ü‚¹‚ñB\n\n‚±‚̃p[ƒeƒBƒVƒ‡ƒ“‚ðƒT[ƒo[ %1 ‚©‚çíœ‚·‚é‚ɂ́A‚±‚ê‚ðŽQÆ‚·‚éƒ{ƒŠƒ…[ƒ€ VLDB €–Ú‚ðíœ‚·‚é•K—v‚ª‚ ‚è‚Ü‚·B" - IDS_CMDLINE_USERPASSWORD - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\nV‚µ‚¢ AFS ƒg[ƒNƒ“‚ðŽæ“¾‚·‚é‚ɂ́A ""/USER"" ‚¨‚æ‚Ñ ""/PASSWORD"" ƒpƒ‰ƒ[ƒ^[‚ðŽw’è‚·‚é•K—v‚ª‚ ‚è‚Ü‚·B" - IDS_ERROR_CANT_DELETE_KEY - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚©‚çƒT[ƒo[Œ® %2 ‚ðíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_GETRANDOMKEY - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃‰ƒ“ƒ_ƒ€Œ®‚𐶐¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_EXECUTE_COMMAND - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚ÅŽŸ‚̃Rƒ}ƒ“ƒh‚ðŽÀs‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½:\n\n ""%2""" - IDS_ERROR_CANT_READ_SALVAGE_LOG - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒTƒ‹ƒx[ƒW‘€ì‚𐳏í‚ÉŠ®—¹‚µ‚Ü‚µ‚½‚ªAƒTƒ‹ƒx[ƒW‘€ì‚ÌŒ‹‰Ê‚ðŽ¦‚·ƒƒOEƒtƒ@ƒCƒ‹‚ðŒŸõ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_SALVAGE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ª—v‹‚³‚ꂽƒTƒ‹ƒx[ƒW‘€ì‚ðŽÀs‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_AUTH_ON "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚Ì”FØŒŸ¸‚ðŽg—p‰Â”\‚ɂł«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_AUTH_OFF "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚Ì”FØŒŸ¸‚ðŽg—p•s‰Â‚ɂł«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_LOAD_HOSTLIST - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚©‚çƒf[ƒ^ƒx[ƒXEƒzƒXƒgEƒT[ƒo[‚ÌƒŠƒXƒg‚ð“ǂݎæ‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_ERROR_CANT_SAVE_HOSTLIST - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃f[ƒ^ƒx[ƒXEƒzƒXƒgEƒT[ƒo[‚ÌƒŠƒXƒg‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL - "AFS ƒRƒ“ƒgƒ[ƒ‹EƒZƒ“ƒ^[‚ª‚±‚̃Rƒ“ƒsƒ…[ƒ^[‚ɐ³‚µ‚­ƒCƒ“ƒXƒg[ƒ‹‚³‚ê‚Ä‚¢‚È‚¢‚½‚߁AAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªŠJŽn‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nAFS ƒRƒ“ƒgƒ[ƒ‹EƒZƒ“ƒ^[‚̍ăCƒ“ƒXƒg[ƒ‹‚ª•K—v‚Å‚ ‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B" - IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN - "•s–¾‚È–â‘è‚Ì‚½‚ß‚É AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ðŠJŽn‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nAFS ƒRƒ“ƒgƒ[ƒ‹EƒZƒ“ƒ^[‚̍ăCƒ“ƒXƒg[ƒ‹‚ª•K—v‚Å‚ ‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B" - IDS_ERROR_CANT_CHANGEADDR - "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚Ì VLDB “à‚Ì IP ƒAƒhƒŒƒX‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" -END - -#endif // Japanese resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Japanese resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) +#ifdef _WIN32 +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_AGGREGATES, DIALOG + BEGIN + RIGHTMARGIN, 118 + END + + IDD_FILESETS, DIALOG + BEGIN + RIGHTMARGIN, 180 + END + + IDD_SVR_LISTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_AGG_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 262 + TOPMARGIN, 5 + BOTTOMMARGIN, 155 + END + + IDD_SVR_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 183 + END + + IDD_SVR_SCOUT, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 216 + TOPMARGIN, 5 + BOTTOMMARGIN, 153 + END + + IDD_SVC_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 268 + TOPMARGIN, 5 + BOTTOMMARGIN, 209 + END + + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 315 + TOPMARGIN, 2 + BOTTOMMARGIN, 224 + END + + IDD_SERVER, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 207 + TOPMARGIN, 2 + BOTTOMMARGIN, 135 + END + + IDD_SVC_CREATE, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 228 + END + + IDD_SET_REPSITES, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 216 + TOPMARGIN, 5 + BOTTOMMARGIN, 163 + END + + IDD_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 7 + BOTTOMMARGIN, 253 + HORZGUIDE, 160 + END + + IDD_TIMEOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 232 + TOPMARGIN, 7 + BOTTOMMARGIN, 153 + END + + IDD_COLUMNS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 281 + TOPMARGIN, 5 + BOTTOMMARGIN, 143 + END + + IDD_REFRESHALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 260 + TOPMARGIN, 7 + BOTTOMMARGIN, 68 + END + + IDD_SET_CREATE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 317 + TOPMARGIN, 4 + BOTTOMMARGIN, 205 + END + + IDD_SET_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 303 + TOPMARGIN, 7 + BOTTOMMARGIN, 99 + END + + IDD_SET_CLONE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 341 + TOPMARGIN, 7 + BOTTOMMARGIN, 81 + END + + IDD_SVC_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 189 + END + + IDD_SVR_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 152 + END + + IDD_AGG_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 252 + TOPMARGIN, 5 + BOTTOMMARGIN, 146 + END + + IDD_SET_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 268 + TOPMARGIN, 5 + BOTTOMMARGIN, 177 + END + + IDD_SET_MOVETO, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 170 + END + + IDD_SET_MOVING, DIALOG + BEGIN + LEFTMARGIN, 1 + RIGHTMARGIN, 306 + TOPMARGIN, 2 + BOTTOMMARGIN, 63 + END + + IDD_SVC_LOGNAME, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 274 + TOPMARGIN, 1 + BOTTOMMARGIN, 105 + END + + IDD_SVC_VIEWLOG, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 305 + TOPMARGIN, 7 + END + + IDD_SET_SETQUOTA, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 267 + TOPMARGIN, 4 + BOTTOMMARGIN, 127 + END + + IDD_ACTIONS, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 234 + TOPMARGIN, 2 + BOTTOMMARGIN, 56 + END + + IDD_SVR_SYNCVLDB, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 265 + TOPMARGIN, 4 + BOTTOMMARGIN, 95 + END + + IDD_SET_CREATEREP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 167 + END + + IDD_SVR_INSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 2 + BOTTOMMARGIN, 154 + END + + IDD_SVR_UNINSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 135 + END + + IDD_SVR_PRUNE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 251 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_SET_RENAME, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 129 + END + + IDD_SVC_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 303 + TOPMARGIN, 7 + BOTTOMMARGIN, 65 + END + + IDD_SVR_GETDATES, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_GETDATES_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 128 + END + + IDD_SET_DUMP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 303 + TOPMARGIN, 7 + BOTTOMMARGIN, 141 + END + + IDD_SET_RESTORE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 288 + TOPMARGIN, 4 + BOTTOMMARGIN, 244 + END + + IDD_SVC_BOS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 259 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_DUMPING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 302 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SET_RESTORING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 302 + TOPMARGIN, 2 + BOTTOMMARGIN, 64 + END + + IDD_SET_CLONESYS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 159 + END + + IDD_SUBSETS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 276 + TOPMARGIN, 5 + BOTTOMMARGIN, 177 + END + + IDD_SUBSET_LOADSAVE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 276 + TOPMARGIN, 4 + BOTTOMMARGIN, 141 + END + + IDD_HELP_FIND, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 214 + TOPMARGIN, 4 + BOTTOMMARGIN, 69 + END + + IDD_HELP_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 214 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_HELP_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 226 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_OPENINGCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 236 + TOPMARGIN, 2 + BOTTOMMARGIN, 41 + END + + IDD_OPTIONS_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 274 + TOPMARGIN, 5 + BOTTOMMARGIN, 131 + END + + IDD_SVR_KEYS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_CREATEKEY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + END + + IDD_SVC_STARTSTOP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 306 + TOPMARGIN, 7 + END + + IDD_SVR_EXECUTE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_SALVAGE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 7 + BOTTOMMARGIN, 250 + END + + IDD_SVR_SALVAGE_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 174 + END + + IDD_SET_RELEASE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 98 + END + + IDD_SVR_HOSTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_ADDHOST, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 303 + TOPMARGIN, 4 + BOTTOMMARGIN, 103 + END + + IDD_SVR_ADDRESS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 207 + TOPMARGIN, 4 + BOTTOMMARGIN, 111 + END + + IDD_SVR_NEWADDR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 228 + TOPMARGIN, 4 + BOTTOMMARGIN, 62 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_MAIN MENU DISCARDABLE +BEGIN + POPUP "ƒZƒ‹(&C)" + BEGIN + MENUITEM "‘I‘ð(&S)...", M_CELL_OPEN + MENUITEM "”FØ(&A)...", M_CREDENTIALS + MENUITEM SEPARATOR + MENUITEM "I—¹(&X)", M_EXIT + END + POPUP "•\ަ(&V)" + BEGIN + POPUP "ƒT[ƒo[(&S)" + BEGIN + MENUITEM "‘åƒAƒCƒRƒ“(&G)", M_SVR_VIEW_LARGE + , CHECKED + MENUITEM "¬ƒAƒCƒRƒ“(&M)", M_SVR_VIEW_SMALL + , CHECKED + MENUITEM "Ú×(&D)", M_SVR_VIEW_REPORT + , CHECKED + MENUITEM SEPARATOR + MENUITEM "•W€(&N)", M_SVR_VIEW_ONEICON + , CHECKED + MENUITEM "‚·‚ׂẴAƒCƒRƒ“(&A)", M_SVR_VIEW_TWOICONS + , CHECKED + MENUITEM "ó‹µ‚Ì‚Ý(&S)", M_SVR_VIEW_STATUS + , CHECKED + END + POPUP "ƒNƒBƒbƒNEƒrƒ…[EƒyƒCƒ“(&Q)" + BEGIN + MENUITEM "‚È‚µ(&N)", M_DIVIDE_NONE, CHECKED + MENUITEM "c‚É•ªŠ„(&V)", M_DIVIDE_H, CHECKED + MENUITEM "‰¡‚É•ªŠ„(&H)", M_DIVIDE_V, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "is’†‚Ì‘€ì(&P)", M_ACTIONS, CHECKED + MENUITEM SEPARATOR + MENUITEM "ƒ‚ƒjƒ^[‚³‚ê‚éƒT[ƒo[(&M)...", M_SUBSET + MENUITEM "—ñ(&C)...", M_COLUMNS + MENUITEM "ƒIƒvƒVƒ‡ƒ“(&O)...", M_OPTIONS + MENUITEM SEPARATOR + MENUITEM "‚·‚ׂčŐV•\ަ(&F)", M_REFRESHALL + END + POPUP "ƒwƒ‹ƒv(&H)" + BEGIN + MENUITEM "–ÚŽŸ(&C)", M_HELP + MENUITEM "ƒRƒ}ƒ“ƒhŒŸõ(&F)...", M_HELP_FIND + MENUITEM "ƒGƒ‰[EƒR[ƒh‚ÌŒŸõ(&L)...", M_HELP_XLATE + MENUITEM SEPARATOR + MENUITEM "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ɂ‚¢‚Ä(&A)...", M_ABOUT + END +END + +MENU_AGG MENU DISCARDABLE +BEGIN + MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̍쐬(&C)...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv(&B)...", M_SET_CLONE + MENUITEM "‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒƒbƒN‰ðœ(&U)", M_SET_UNLOCK + MENUITEM "VLDB ‚Ì“¯Šú‰»(&Y)...", M_SYNCVLDB + MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̃Tƒ‹ƒx[ƒW(&G)...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "ÅV•\ަ(&F)", M_REFRESH + MENUITEM "ƒvƒƒpƒeƒB[(&R)", M_PROPERTIES +END + +MENU_SVC MENU DISCARDABLE +BEGIN + MENUITEM "ŠJŽn(&S)", M_SVC_START + MENUITEM "’âŽ~(&S)", M_SVC_STOP + MENUITEM "ÄŽn“®(&R)", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "ƒƒOEƒtƒ@ƒCƒ‹‚Ì•\ަ(&V)", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "íœ(&L)", M_SVC_DELETE + MENUITEM SEPARATOR + MENUITEM "ÅV•\ަ(&F)", M_REFRESH + MENUITEM "ƒvƒƒpƒeƒB[(&R)", M_PROPERTIES +END + +MENU_AGG_NONE MENU DISCARDABLE +BEGIN + POPUP "•\ަ(&V)" + BEGIN + MENUITEM "•W€(&N)", M_VIEW_ONEICON, CHECKED + MENUITEM "‚·‚ׂẴAƒCƒRƒ“(&A)", M_VIEW_TWOICONS, CHECKED + MENUITEM "ó‹µ‚Ì‚Ý(&S)", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̍쐬(&C)...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "‚·‚ׂčŐV•\ަ(&F)", M_REFRESHALL +END + +MENU_SVC_NONE MENU DISCARDABLE +BEGIN + POPUP "•\ަ(&V)" + BEGIN + MENUITEM "•W€(&N)", M_VIEW_ONEICON, CHECKED + MENUITEM "‚·‚ׂẴAƒCƒRƒ“(&A)", M_VIEW_TWOICONS, CHECKED + MENUITEM "ó‹µ‚Ì‚Ý(&S)", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "ƒT[ƒrƒX‚̍쐬(&C)...", M_SVC_CREATE + MENUITEM SEPARATOR + MENUITEM "‚·‚ׂčŐV•\ަ(&F)", M_REFRESHALL +END + +MENU_SET MENU DISCARDABLE +BEGIN + MENUITEM "•¡»(&P)...", M_SET_REPLICATION + MENUITEM "‘¦Žž‰ð•ú(&S)", M_SET_RELEASE + MENUITEM SEPARATOR + MENUITEM "ƒoƒbƒNƒAƒbƒv(&B)...", M_SET_CLONE + MENUITEM "ƒtƒ@ƒCƒ‹‚Ƀ_ƒ“ƒv(&D)...", M_SET_DUMP + MENUITEM "ƒtƒ@ƒCƒ‹‚©‚畜Œ³(&R)...", M_SET_RESTORE + MENUITEM "Š„‚è“–‚ėʂ̐ݒè(&Q)...", M_SET_SETQUOTA + MENUITEM "ƒTƒ‹ƒx[ƒW(&G)...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "ˆÚ“®æ(&M)...", M_SET_MOVETO + MENUITEM "–¼‘O•ύX(&N)...", M_SET_RENAME + MENUITEM "íœ(&L)", M_SET_DELETE + MENUITEM SEPARATOR + MENUITEM "ƒƒbƒN(&K)", M_SET_LOCK + MENUITEM "ƒƒbƒN‰ðœ(&U)", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "ÅV•\ަ(&F)", M_REFRESH + MENUITEM "ƒvƒƒpƒeƒB[(&R)", M_PROPERTIES +END + +MENU_SVR MENU DISCARDABLE +BEGIN + MENUITEM "ƒT[ƒo[EƒEƒBƒ“ƒhƒE‚̃I[ƒvƒ“(&O)", M_SVR_OPEN + MENUITEM "ƒT[ƒo[EƒEƒBƒ“ƒhƒE‚̃Nƒ[ƒY(&C)", M_SVR_CLOSE + MENUITEM "‚±‚̃T[ƒo[‚ðƒ‚ƒjƒ^[(&M)", M_SVR_MONITOR, CHECKED + MENUITEM SEPARATOR + MENUITEM "ƒT[ƒo[EƒZƒLƒ…ƒŠƒeƒB[‚̕ҏW(&S)...", M_SVR_SECURITY + MENUITEM "ƒf[ƒ^ƒx[ƒXEƒzƒXƒg‚ÌŠÇ—(&H)...", M_SVR_HOSTS + MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv(&B)...", M_SET_CLONE + MENUITEM "‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒƒbƒN‰ðœ(&U)", M_SET_UNLOCK + MENUITEM "VLDB ‚Ì“¯Šú‰»(&Y)...", M_SYNCVLDB + MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̃Tƒ‹ƒx[ƒW(&G)...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "ƒtƒ@ƒCƒ‹‚̃Cƒ“ƒXƒg[ƒ‹(&I)...", M_SVR_INSTALL + MENUITEM "ƒtƒ@ƒCƒ‹‚̃Aƒ“ƒCƒ“ƒXƒg[ƒ‹(&U)...", M_SVR_UNINSTALL + MENUITEM "‹Œƒtƒ@ƒCƒ‹‚̍폜(&P)...", M_SVR_PRUNE + MENUITEM SEPARATOR + MENUITEM "ƒtƒ@ƒCƒ‹“ú•t‚̎擾(&T)...", M_SVR_GETDATES + MENUITEM "ƒƒOEƒtƒ@ƒCƒ‹‚Ì•\ަ(&V)...", M_VIEWLOG + MENUITEM "ƒRƒ}ƒ“ƒh‚ÌŽÀs(&X)...", M_EXECUTE + MENUITEM SEPARATOR + MENUITEM "ÅV•\ަ(&F)", M_REFRESH + MENUITEM "ƒvƒƒpƒeƒB[(&R)", M_PROPERTIES +END + +MENU_SVR_NONE MENU DISCARDABLE +BEGIN + POPUP "•\ަ(&V)" + BEGIN + MENUITEM "‘åƒAƒCƒRƒ“(&G)", M_SVR_VIEW_LARGE, CHECKED + MENUITEM "¬ƒAƒCƒRƒ“(&M)", M_SVR_VIEW_SMALL, CHECKED + MENUITEM "Ú×(&D)", M_SVR_VIEW_REPORT, CHECKED + MENUITEM SEPARATOR + MENUITEM "•W€(&N)", M_SVR_VIEW_ONEICON, CHECKED + MENUITEM "‚·‚ׂẴAƒCƒRƒ“(&A)", M_SVR_VIEW_TWOICONS, CHECKED + MENUITEM "ó‹µ‚Ì‚Ý(&S)", M_SVR_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "ƒ‚ƒjƒ^[‚³‚ê‚éƒT[ƒo[(&M)...", M_SUBSET + MENUITEM SEPARATOR + MENUITEM "‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒƒbƒN‰ðœ(&U)", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "‚·‚ׂăNƒ[ƒY(&C)", M_SVR_CLOSEALL + MENUITEM "‚·‚ׂčŐV•\ަ(&F)", M_REFRESHALL +END + +MENU_SET_NONE MENU DISCARDABLE +BEGIN + POPUP "•\ަ(&V)" + BEGIN + MENUITEM "ƒ{ƒŠƒ…[ƒ€‚²‚Æ(&V)", M_SET_VIEW_REPORT, CHECKED + MENUITEM "ƒp[ƒeƒBƒVƒ‡ƒ“‚²‚Æ(&P)", M_SET_VIEW_TREELIST, CHECKED + MENUITEM "Ú×‚È‚µ(&D)", M_SET_VIEW_TREE, CHECKED + MENUITEM SEPARATOR + MENUITEM "•W€(&N)", M_VIEW_ONEICON, CHECKED + MENUITEM "‚·‚ׂẴAƒCƒRƒ“(&A)", M_VIEW_TWOICONS, CHECKED + MENUITEM "ó‹µ‚Ì‚Ý(&S)", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̍쐬(&C)...", M_SET_CREATE + MENUITEM "ƒtƒ@ƒCƒ‹‚©‚畜Œ³(&R)...", M_SET_RESTORE + MENUITEM SEPARATOR + MENUITEM "ƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv(&B)...", M_SET_CLONE + MENUITEM SEPARATOR + MENUITEM "‚·‚ׂăƒbƒN‰ðœ(&U)", M_SET_UNLOCK + MENUITEM "‚·‚ׂčŐV•\ަ(&F)", M_REFRESHALL +END + +MENU_COLUMNS MENU DISCARDABLE +BEGIN + MENUITEM "—ñ(&C)...", M_COLUMNS +END + +MENU_SVC_BOS MENU DISCARDABLE +BEGIN + MENUITEM "ÄŽn“®(&R)", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "ƒƒOEƒtƒ@ƒCƒ‹‚Ì•\ަ(&V)", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "ÅV•\ަ(&F)", M_REFRESH + MENUITEM "ƒvƒƒpƒeƒB[(&R)", M_PROPERTIES +END + +MENU_SET_DRAGDROP MENU DISCARDABLE +BEGIN + MENUITEM "‚±‚±‚Ɉړ®(&M)...", M_SET_MOVEHERE + MENUITEM "‚±‚±‚É•¡»(&R)...", M_SET_REPHERE + MENUITEM SEPARATOR + MENUITEM "ŽæÁ‚µ(&C)", IDC_STATIC +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SERVICES DIALOGEX 0, 0, 179, 92 +STYLE DS_CENTER | WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 +BEGIN + LTEXT "ƒT[ƒrƒX:",IDC_SVC_DESC,0,5,179,8 + CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,0,17,179, + 55,WS_EX_STATICEDGE + PUSHBUTTON "ì¬(&C)...",IDC_SVC_CREATE,44,78,42,12 + PUSHBUTTON "íœ(&L)",IDC_SVC_DELETE,88,78,39,12 + PUSHBUTTON "ÄŽn“®(&R)",IDC_SVC_RESTART,129,78,45,12 +END + +IDD_AGGREGATES DIALOGEX 0, 0, 165, 84 +STYLE DS_CENTER | WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 +BEGIN + LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“:",IDC_AGG_DESC,0,5,159,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,0,16,165, + 47,WS_EX_STATICEDGE + PUSHBUTTON "ƒ{ƒŠƒ…[ƒ€‚̍쐬(&C)...",IDC_AGG_CREATESET,71,70,90,12 +END + +IDD_FILESETS DIALOGEX 0, 0, 231, 92 +STYLE DS_CENTER | WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 +BEGIN + LTEXT "ƒ{ƒŠƒ…[ƒ€:",IDC_SET_DESC,0,5,224,8 + CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,0,17,224, + 51,WS_EX_STATICEDGE + PUSHBUTTON "ì¬(&C)...",IDC_SET_CREATE,1,77,42,12 + PUSHBUTTON "íœ(&L)",IDC_SET_DELETE,45,77,39,12 + PUSHBUTTON "•¡»(&R)...",IDC_SET_REP,85,77,51,12 + PUSHBUTTON "Š„‚è“–‚ėʂ̐ݒè(&Q)...",IDC_SET_SETQUOTA,137,77,90,12 +END + +IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,23,216, + 129,WS_EX_CLIENTEDGE + PUSHBUTTON "ŠÇ—ŽÒ‚̒ljÁ(&A)",IDC_LIST_ADD,69,157,69,14 + PUSHBUTTON "ŠÇ—ŽÒ‚̍폜(&R)",IDC_LIST_REMOVE,138,157,80,14 + LTEXT "ƒT[ƒo[ %1 ‚ÌŠÇ—ŽÒ:",IDC_LIST_NAME,5,7,216,10 +END + +IDD_AGG_GENERAL DIALOGEX 0, 0, 267, 160 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ID:",IDC_STATIC,7,30,31,8 + LTEXT "(Æ‰ï’†)",IDC_AGG_ID,54,30,208,8 + LTEXT "‘•’u:",IDC_STATIC,7,46,31,8 + LTEXT "(Æ‰ï’†)",IDC_AGG_DEVICE,54,46,208,8 + LTEXT "ƒ{ƒŠƒ…[ƒ€:",IDC_STATIC,7,62,39,8 + LTEXT "(Æ‰ï’†)",IDC_AGG_FILESETS,54,62,208,8 + CONTROL "Œ‹‡ƒ{ƒŠƒ…[ƒ€Š„‚è“–‚Ä—Ê‚ª—e—ʂ𒴂¦‚½ê‡‚ÍŒx‚ð•\ަ(&V)", + IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 18,76,221,10 + LTEXT "Žg—p—¦:",IDC_STATIC,7,90,27,8 + LTEXT "(Æ‰ï’†)",IDC_AGG_USAGE,54,90,200,8 + CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,38,103,224,8, + WS_EX_STATICEDGE + CONTROL "ƒp[ƒeƒBƒVƒ‡ƒ“‚ÌŽg—p—¦‚ª’´‰ß‚µ‚½ê‡‚ÉŒx‚ð•\ަ(&W)", + IDC_AGG_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18, + 116,220,10 + CONTROL "‚±‚̃T[ƒo[‚̃fƒtƒHƒ‹ƒg‚µ‚«‚¢’l(&D)", + IDC_AGG_WARN_AGGFULL_DEF,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,49,129,203,9 + CONTROL "‚»‚̃TƒCƒY‚Ì",IDC_AGG_WARN_AGGFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,49,143,55,9 + EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,112,141,29,12, + ES_AUTOHSCROLL + LTEXT "% ‚Ì‚µ‚«‚¢’l(&T)",IDC_AGG_WARN_AGGFULL_DESC,166,143,92, + 8 + ICON IDI_AGGREGATE,IDC_STATIC,5,5,20,20 + LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“ %2 (ƒT[ƒo[ %1)",IDC_AGG_NAME,34,8,228, + 16 +END + +IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "IP ƒAƒhƒŒƒX:",IDC_STATIC,5,34,37,8 + LISTBOX IDC_SVR_ADDRESSES,53,32,70,10,LBS_NOSEL | NOT WS_BORDER | + WS_VSCROLL + PUSHBUTTON "ƒAƒhƒŒƒX‚̕ύX(&A)...",IDC_SVR_CHANGEADDR,134,32,82,12 + PUSHBUTTON "”FØ‚ª•K—v(&R)",IDC_SVR_AUTH_YES,41,81,84,12 + PUSHBUTTON "–¢”FØ‚ð‹–‰Â(&U)",IDC_SVR_AUTH_NO,129,81,80,12 + LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“”:",IDC_STATIC,11,131,90,8 + LTEXT "(Æ‰ï’†)",IDC_SVR_NUMAGGREGATES,113,131,99,8 + LTEXT "‘—e—Ê:",IDC_STATIC,11,148,48,8 + LTEXT "(Æ‰ï’†)",IDC_SVR_CAPACITY,113,148,99,8 + LTEXT "Œ‹‡ƒ{ƒŠƒ…[ƒ€Š„‚è“–‚Ä—Ê:",IDC_STATIC,11,165,93,8 + LTEXT "(Æ‰ï’†)",IDC_SVR_ALLOCATION,113,165,99,8 + ICON IDI_SERVER,IDC_STATIC,5,5,20,20 + LTEXT "(ƒT[ƒo[–¼)",IDC_SVR_NAME,39,10,179,15 + GROUPBOX "ƒZƒLƒ…ƒŠƒeƒB[",IDC_STATIC,5,52,216,52 + GROUPBOX "‹L‰¯ˆæ",IDC_STATIC,5,115,216,68 + LTEXT "‚±‚̃T[ƒo[‚Ö‚Ì‘SƒAƒNƒZƒX‚Ì”FØ‚ð•K—v‚ɂł«‚Ü‚·B", + IDC_STATIC,11,67,201,8 +END + +IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 244, 158 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + CONTROL "‚±‚̃T[ƒo[‚̃p[ƒeƒBƒVƒ‡ƒ“‚ª",IDC_SVR_WARN_AGGFULL, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,18,116,9 + EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,144,16,24,12,ES_AUTOHSCROLL + LTEXT "% ƒtƒ‹",IDC_STATIC,184,18,25,8 + CONTROL "‚±‚̃T[ƒo[‚̃{ƒŠƒ…[ƒ€‚ª",IDC_SVR_WARN_SETFULL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,12,32,116,9 + EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,144,30,24,12,ES_AUTOHSCROLL + LTEXT "% ƒtƒ‹",IDC_STATIC,184,32,25,8 + CONTROL "ƒp[ƒeƒBƒVƒ‡ƒ“‚ÌŒ‹‡Š„‚è“–‚Ä—Ê‚ª—e—ʂ𒴂¦‚½", + IDC_SVR_WARN_AGGALLOC,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,46,195,9 + CONTROL "‚±‚̃T[ƒo[‚̃T[ƒrƒX‚ªŽÀs‚ð’âŽ~‚µ‚½", + IDC_SVR_WARN_SVCSTOP,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,60,195,9 + CONTROL "‚±‚̃T[ƒo[‚̃{ƒŠƒ…[ƒ€‚É VLDB €–Ú‚ª‚È‚¢", + IDC_SVR_WARN_SETNOVLDB,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,74,195,9 + CONTROL "VLDB ‚ª‚±‚̃T[ƒo[‚̃Iƒtƒ‰ƒCƒ“Eƒp[ƒeƒBƒVƒ‡ƒ“‚ðŽQÆ", + IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,88,195,9 + CONTROL "VLDB ‚ª‚±‚̃T[ƒo[‚̃Iƒtƒ‰ƒCƒ“Eƒ{ƒŠƒ…[ƒ€‚ðŽQÆ", + IDC_SVR_WARN_SETNOSERV,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,103,195,9 + CONTROL "ƒT[ƒo[î•ñ‚ð",IDC_SVR_AUTOREFRESH,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,6,140,63,9 + EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,79,138,27,13,ES_AUTOHSCROLL + LTEXT "•ª‚²‚ƂɍŐV•\ަ",IDC_STATIC,125,140,65,8 + LTEXT "ˆÈ‰º‚̏ꍇ‚ÉŒx‚ð•\ަ",IDC_STATIC,5,5,195,8 +END + +IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 225, 207 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + PUSHBUTTON "ƒT[ƒrƒXEƒƒO‚Ì•\ަ(&V)",IDC_SVC_VIEWLOG,8,184,101,14 + PUSHBUTTON "‘¦ŽžŠJŽn(&S)",IDC_SVC_START,110,184,53,14 + PUSHBUTTON "‘¦Žž’âŽ~(&P)",IDC_SVC_STOP,164,184,53,14 + CONTROL "ƒT[ƒrƒX‚ª’âŽ~‚µ‚Ä‚¢‚½ê‡‚ÍŒx‚ð•\ަ(&W)", + IDC_SVC_WARNSTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 11,164,200,10 + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "ƒT[ƒrƒX %2 (ƒT[ƒo[ %1)",IDC_SVC_NAME,31,6,188,20 + LTEXT "ƒ^ƒCƒv:",IDC_STATIC,7,34,37,8 + LTEXT "(Æ‰ï’†)",IDC_SVC_TYPE,77,34,138,8 + LTEXT "ƒpƒ‰ƒ[ƒ^[:",IDC_STATIC,7,50,42,8 + EDITTEXT IDC_SVC_PARAMS,58,50,156,13,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP + LTEXT "ƒm[ƒeƒBƒtƒ@ƒCƒ„[:",IDC_STATIC,7,66,63,8 + LTEXT "(Æ‰ï’†)",IDC_SVC_NOTIFIER,77,66,138,8 + LTEXT "ÅIŠJŽn:",IDC_STATIC,7,82,34,8 + LTEXT "(Æ‰ï’†)",IDC_SVC_STARTDATE,77,82,138,8 + LTEXT "ÅI’âŽ~:",IDC_STATIC,7,98,34,8 + LTEXT "(Æ‰ï’†)",IDC_SVC_STOPDATE,77,98,138,8 + LTEXT "ÅIáŠQ:",IDC_STATIC,7,115,34,8 + EDITTEXT IDC_SVC_LASTERROR,58,114,156,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + GROUPBOX "ƒT[ƒrƒXó‹µ",IDC_STATIC,5,131,215,71 + LTEXT "‚±‚̃T[ƒrƒX‚ÌŒ»Ý‚̏󋵂𔻕ʒ†...",IDC_SVC_STATUS,11, + 147,203,8 +END + +IDD_SET_GENERAL DIALOGEX 0, 0, 273, 214 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒ{ƒŠƒ…[ƒ€ ID:",IDC_STATIC,5,30,51,8 + LTEXT "(•s–¾)",IDC_SET_ID,89,30,173,8 + LTEXT "ì¬:",IDC_STATIC,5,46,39,8 + LTEXT "(Æ‰ï’†)",IDC_SET_CREATEDATE,89,46,173,8 + LTEXT "XV:",IDC_STATIC,5,62,39,8 + LTEXT "(Æ‰ï’†)",IDC_SET_UPDATEDATE,89,62,173,8 + LTEXT "ƒAƒNƒZƒX:",IDC_STATIC,5,78,39,8 + LTEXT "(Æ‰ï’†)",IDC_SET_ACCESSDATE,89,78,173,8 + LTEXT "ƒoƒbƒNƒAƒbƒv:",IDC_STATIC,5,94,50,8 + LTEXT "(Æ‰ï’†)",IDC_SET_BACKUPDATE,89,94,173,8 + LTEXT "ƒtƒ@ƒCƒ‹EƒJƒEƒ“ƒg:",IDC_STATIC,5,110,74,8 + LTEXT "(Æ‰ï’†)",IDC_SET_FILES,89,110,173,8 + LTEXT "ó‹µ:",IDC_STATIC,5,125,18,8 + LTEXT "(Æ‰ï’†)",IDC_SET_STATUS,38,125,108,8 + PUSHBUTTON "ƒƒbƒN(&L)",IDC_SET_LOCK,152,123,49,12 + PUSHBUTTON "ƒƒbƒN‰ðœ(&U)",IDC_SET_UNLOCK,204,123,61,12 + LTEXT "Žg—p—¦:",IDC_STATIC,5,141,24,8 + LTEXT "(Æ‰ï’†)",IDC_SET_USAGE,38,141,125,8 + PUSHBUTTON "Š„‚è“–‚ėʂ̐ݒè(&Q)...",IDC_SET_QUOTA,175,139,90,12 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,49,156,213,8, + WS_EX_STATICEDGE + CONTROL "ƒ{ƒŠƒ…[ƒ€Žg—p—¦‚ª’´‰ß‚µ‚½ê‡‚ÍŒx‚ð•\ަ(&W)", + IDC_SET_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10, + 170,219,10 + CONTROL "‚±‚̃T[ƒo[‚̃fƒtƒHƒ‹ƒg‚µ‚«‚¢’l(&D) (ƒTƒCƒY‚Ì %1%%)", + IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,19,184,249,9 + CONTROL "‚»‚̃TƒCƒY‚Ì",IDC_SET_WARN_SETFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,19,197,59,9 + EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,86,195,29,12,ES_AUTOHSCROLL + LTEXT "% ‚Ì‚µ‚«‚¢’l(&T)",IDC_SET_WARN_SETFULL_DESC,147,197,64, + 8 + ICON IDI_FILESET,IDC_STATIC,5,5,20,20 + LTEXT "ƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2)", + IDC_SET_NAME,31,5,237,17 +END + +IDD_MAIN DIALOGEX 0, 0, 317, 226 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | + WS_SYSMENU | WS_THICKFRAME +CAPTION "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +MENU MENU_MAIN +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "‘I‘ð‚µ‚½ƒZƒ‹:",IDC_STATIC,2,8,50,8 + LTEXT "(ƒZƒ‹–¼‚ª‚±‚±‚É“ü‚è‚Ü‚·)",IDC_CELL,62,8,208,9 + LTEXT "AFS ƒg[ƒNƒ“:",IDC_STATIC,2,21,50,8 + LTEXT "%2:%1 (ƒg[ƒNƒ“‚ÌŠúŒÀ %3 ‚ɐ؂ê‚Ü‚·)",IDC_AFS_ID,62,21, + 218,16 + CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,43,313, + 181,WS_EX_CLIENTEDGE + CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 + ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 +STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "ƒT[ƒo[" +CLASS "ServerWindowClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + CONTROL "",IDC_TABS,"SysTabControl32",0x0,2,2,205,133 +END + +IDD_SVC_CREATE DIALOGEX 0, 0, 225, 233 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒT[ƒo[(&S):",IDC_STATIC,5,36,49,8 + COMBOBOX IDC_SVC_SERVER,62,33,116,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ƒT[ƒrƒX(&V):",IDC_STATIC,5,52,49,8 + COMBOBOX IDC_SVC_NAME,62,50,116,104,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ƒRƒ}ƒ“ƒh(&C):",IDC_STATIC,5,70,49,8 + EDITTEXT IDC_SVC_COMMAND,89,68,128,13,ES_AUTOHSCROLL + LTEXT "ƒpƒ‰ƒ[ƒ^[(&P):",IDC_STATIC,5,88,65,8 + EDITTEXT IDC_SVC_PARAMS,89,86,128,13,ES_AUTOHSCROLL + LTEXT "ƒm[ƒeƒBƒtƒ@ƒCƒ„[(&N):",IDC_STATIC,5,105,75,8 + EDITTEXT IDC_SVC_NOTIFIER,89,103,128,13,ES_AUTOHSCROLL + LTEXT "ƒƒOEƒtƒ@ƒCƒ‹(&L):",IDC_STATIC,5,122,72,8 + EDITTEXT IDC_SVC_LOGFILE,89,120,128,13,ES_AUTOHSCROLL + CONTROL "ƒVƒ“ƒvƒ‹(&I) (˜A‘±‚µ‚ÄŽÀs)",IDC_SVC_TYPE_SIMPLE,"Button", + BS_AUTORADIOBUTTON,11,154,201,10 + CONTROL "‚±‚̃T[ƒrƒX‚𑦎žŠJŽn(&T)",IDC_SVC_RUNNOW,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 + CONTROL "FS(&F) (ƒtƒ@ƒCƒ‹EƒVƒXƒeƒ€)",IDC_SVC_TYPE_FS,"Button", + BS_AUTORADIOBUTTON,11,180,201,10 + CONTROL "Cron(&R) (Žw’è‚ÌŠÔŠu‚ÅŽÀs)",IDC_SVC_TYPE_CRON,"Button", + BS_AUTORADIOBUTTON,11,195,201,10 + LTEXT "ŽÀs“úŽž(&W):",IDC_STATIC,23,209,42,8 + COMBOBOX IDC_SVC_RUNDAY,76,207,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,158,207, + 53,13,WS_EX_CLIENTEDGE + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "V‹KƒT[ƒrƒX",IDC_SVC_DESC,35,9,179,14 + GROUPBOX "ƒT[ƒrƒXEƒ^ƒCƒv",IDC_STATIC,5,141,215,87 +END + +IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, + 199,58,WS_EX_CLIENTEDGE + PUSHBUTTON "‘¦Žž‰ð•ú(&R)",IDC_SET_RELEASE,11,145,53,14 + PUSHBUTTON "ì¬(&C)...",IDC_SET_REPSITE_ADD,126,145,42,14 + PUSHBUTTON "íœ(&L)",IDC_SET_REPSITE_DELETE,172,145,38,14 + LTEXT "ƒT[ƒo[:",-1,9,31,42,8 + LTEXT "(ƒT[ƒo[–¼)",IDC_SET_SERVER,58,31,156,8 + LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“:",-1,9,44,42,8 + LTEXT "(ƒp[ƒeƒBƒVƒ‡ƒ“–¼)",IDC_SET_AGGREGATE,58,44,156,8 + LTEXT "ƒ{ƒŠƒ…[ƒ€:",-1,9,18,42,8 + LTEXT "(ƒ{ƒŠƒ…[ƒ€–¼)",IDC_SET_NAME,58,18,156,8 + GROUPBOX "“ǂݎæ‚è / ‘‚«ž‚݃{ƒŠƒ…[ƒ€",-1,5,5,211,56 + GROUPBOX "ƒ{ƒŠƒ…[ƒ€EƒŒƒvƒŠƒJ",-1,5,67,211,96 +END + +IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 257 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒZƒ‹‚Ì‘I‘ð - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒZƒ‹(&C):",IDC_STATIC,4,24,33,8 + COMBOBOX IDC_OPENCELL_CELL,43,22,171,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + GROUPBOX "AFS ”FØ",IDC_STATIC,4,44,211,92 + LTEXT "AFS ID(&I):",IDC_STATIC,22,100,55,8 + EDITTEXT IDC_OPENCELL_ID,100,98,109,14,ES_AUTOHSCROLL + LTEXT "AFS ƒpƒXƒ[ƒh(&P):",IDC_STATIC,22,116,67,8 + EDITTEXT IDC_OPENCELL_PASSWORD,100,114,109,14,ES_PASSWORD | + ES_AUTOHSCROLL + PUSHBUTTON "Šg’£(&V) >>",IDC_ADVANCED,4,140,53,14 + DEFPUSHBUTTON "—¹‰ð",IDOK,76,140,41,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,120,140,41,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,164,140,45,14 + CONTROL "‚±‚̃Zƒ‹‚Ì‚·‚ׂẴT[ƒo[‚ðƒ‚ƒjƒ^[(&L)",IDC_MON_ALL, + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10,196,185,9 + CONTROL "1 ƒT[ƒo[‚̂݃‚ƒjƒ^[(&M):",IDC_MON_ONE,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,10,209,106,10 + EDITTEXT IDC_MON_SERVER,125,207,83,13,ES_AUTOHSCROLL + CONTROL "ŽŸ‚̃TƒuƒZƒbƒg‚̃T[ƒo[‚̂݃‚ƒjƒ^[(&S):",IDC_MON_SOME, + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10,223,146,10 + COMBOBOX IDC_MON_SUBSET,125,235,83,93,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "‘€ì‚µ‚½‚¢ AFS ƒZƒ‹‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢B",IDC_STATIC,4,7, + 200,8 + GROUPBOX "ƒT[ƒo[‚̃‚ƒjƒ^[",IDC_ADVANCED_GROUP,4,162,211,91 + LTEXT "‚æ‚è‚æ‚¢ƒpƒtƒH[ƒ}ƒ“ƒX‚Ì‚½‚߂ɁA‚±‚̃Zƒ‹‚ÅŽg—p‰Â”\‚ȃT[ƒo[‚̃TƒuƒZƒbƒg‚Ì‚Ý‚ðƒ‚ƒjƒ^[‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", + IDC_STATIC,10,172,199,20 + LTEXT "(Æ‰ï’†...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "ƒZƒ‹‚ÌŠÇ—‚É‚Í AFS ƒpƒXƒ[ƒh‚ðÄ“ü—Í‚µ‚Ä‚­‚¾‚³‚¢:", + IDC_STATIC,10,85,197,8 + LTEXT "‘I‘ð‚µ‚½ƒZƒ‹“à‚ÌŒ»Ý‚Ì AFS ƒg[ƒNƒ“:",IDC_STATIC,10,57, + 196,8 +END + +IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Œx - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + CONTROL "ƒ^ƒXƒN‚ª³í‚ÉŠ®—¹‚·‚é‚܂őҋ@‚𑱍s(&C)", + IDC_TIMEOUT_WAIT,"Button",BS_AUTORADIOBUTTON,21,87,208, + 10 + CONTROL "ƒ^ƒXƒN‚̏I—¹(&T)",IDC_TIMEOUT_KILL,"Button", + BS_AUTORADIOBUTTON,21,101,208,10 + DEFPUSHBUTTON "—¹‰ð",IDOK,93,137,50,14 + LTEXT "ƒ^ƒXƒN‚ÌŽÀsŒo‰ßŽžŠÔ:",IDC_STATIC,6,119,137,8 + LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,155,119,29,8 + LTEXT "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚Í—\‘zŠO‚É’·‚¢ŽžŠÔAƒlƒbƒgƒ[ƒNEƒ^ƒXƒN‚ÌŠ®—¹‚ð‘Ò‹@‚µ‚Ü‚µ‚½B", + IDC_STATIC,4,7,228,18 + LTEXT "ƒ^ƒXƒN‚ÉŽÀs‚𑱂¯‚³‚¹‚é („§) ‚©Aƒ^ƒXƒN‚ªŠ®—¹‚µ‚È‚¢‚ÆŽv‚í‚ê‚éê‡‚Í AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚Ƀ^ƒXƒN‚ðI—¹‚³‚¹‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", + IDC_STATIC,4,28,228,23 + LTEXT "‚±‚̃EƒBƒ“ƒhƒE‚ª•\ަ‚³‚ê‚Ä‚àAƒ^ƒXƒN‚ª‚Ü‚¾is’†‚Å‚ ‚邱‚ƂɒˆÓ‚µ‚Ä‚­‚¾‚³‚¢Bƒ^ƒXƒN‚ªŠ®—¹‚·‚邯A‚±‚̃EƒBƒ“ƒhƒE‚ÍŽ©“®“I‚ɃNƒ[ƒY‚µ‚Ü‚·B", + IDC_STATIC,4,59,228,21 +END + +IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 +STYLE WS_POPUP | WS_CAPTION +CAPTION "—ñ" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒŠƒXƒgŽž‚É•\ަ‚·‚é—ñ‚Ì‘I‘ð(&S):",IDC_STATIC,5,7,111,8 + COMBOBOX IDC_COLUMNS,134,5,147,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Žg—p‰Â”\‚È—ñ(&C):",IDC_STATIC,12,40,100,8 + LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LTEXT "•\ަ‚·‚é—ñ(&I):",IDC_STATIC,173,41,100,8 + LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "’ljÁ(&A) >>",IDC_COL_INSERT,119,68,46,14 + PUSHBUTTON "<< íœ(&R)",IDC_COL_DELETE,119,88,47,14 + PUSHBUTTON "ã‚Ɉړ®(&U)",IDC_COL_UP,170,124,53,14 + PUSHBUTTON "‰º‚Ɉړ®(&D)",IDC_COL_DOWN,224,124,53,14 + GROUPBOX "—ñ‚ÌƒŠƒXƒg",IDC_STATIC,5,25,276,118 +END + +IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 269, 72 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "ƒŠƒtƒŒƒbƒVƒ…’† - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, + 256,8 + LTEXT "0%% Š®—¹",IDC_REFRESH_PERCENT,4,49,171,8 + LTEXT "",IDC_REFRESH_CURRENT,4,60,192,8 + LTEXT "‚¨‘Ò‚¿‚­‚¾‚³‚¢...",IDC_REFRESH_DESC,4,7,256,25 + PUSHBUTTON "ƒXƒLƒbƒv(&S)",IDC_REFRESH_SKIP,205,54,53,12,NOT + WS_TABSTOP +END + +IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚̍쐬" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "–¼‘O(&N):",IDC_STATIC,6,30,39,8 + EDITTEXT IDC_SET_NAME,76,28,116,14,ES_AUTOHSCROLL + LTEXT "Š„‚è“–‚Ä—Ê(&Q):",IDC_STATIC,6,48,58,8 + EDITTEXT IDC_SET_QUOTA,76,46,32,14,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,120,47,30,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "ƒoƒbƒNƒAƒbƒv(&B):",IDC_STATIC,6,66,60,8 + CONTROL "‚±‚̃{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚àì¬(&R)", + IDC_SET_CLONE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,76, + 66,210,8 + LTEXT "ƒT[ƒo[(&S):",IDC_STATIC,6,84,49,8 + COMBOBOX IDC_SET_SERVER,76,82,116,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“(&P):",IDC_STATIC,6,100,73,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,46,112,271, + 70,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "—¹‰ð",IDOK,152,188,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,207,188,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,263,188,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "V‹Kƒ{ƒŠƒ…[ƒ€",IDC_STATIC,31,7,284,15 +END + +IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 307, 103 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚̍폜" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + DEFPUSHBUTTON "ŽæÁ‚µ",IDCANCEL,196,85,50,14 + CONTROL "ƒ{ƒŠƒ…[ƒ€ %3 ‚ðƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚©‚çíœ(&D)", + IDC_DELSET_SERVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 8,48,295,11 + PUSHBUTTON "—¹‰ð",IDOK,142,85,50,14 + CONTROL "ƒ{ƒŠƒ…[ƒ€ %3 ‚Ì VLDB €–Ú‚ðíœ(&V)",IDC_DELSET_VLDB, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,67,282,10 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,250,85,50,14 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "’ˆÓ!\n\n‚±‚Ì‘€ì‚ðs‚¤‚ƁAƒ{ƒŠƒ…[ƒ€ %3 ‚͉i‹v‚ɍ폜‚³‚ê‚Ü‚·B", + IDC_DELSET_DESC,31,8,272,29 +END + +IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + DEFPUSHBUTTON "—¹‰ð",IDOK,178,66,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,232,66,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,286,66,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "ƒ{ƒŠƒ…[ƒ€EƒoƒbƒNƒAƒbƒv‚́A‚»‚̃{ƒŠƒ…[ƒ€‚̓ǂݎæ‚èê—pƒRƒs[‚̂悤‚È“­‚«‚ð‚µ‚Ü‚·B“ǂݎæ‚è/‘‚«ž‚݃{ƒŠƒ…[ƒ€‚̓oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚ð 1 ‚‚¾‚¯Ž‚‚±‚Æ‚ª‚Å‚«‚Ü‚·B", + IDC_STATIC,29,5,312,16 + LTEXT "ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€ %3 ‚̃oƒbƒNƒAƒbƒv‚ðì¬‚·‚é‚ɂ́Au—¹‰ðv‚ðƒNƒŠƒbƒN‚µ‚Ü‚·B‚±‚̃{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv‚ª‚·‚łɑ¶Ý‚·‚éê‡AƒoƒbƒNƒAƒbƒv‚͍XV‚³‚ê‚Ü‚·B", + IDC_CLONE_DESC,29,29,312,30 +END + +IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + GROUPBOX "Šù’m‚Ì–â‘è",IDC_PROBLEM_BOX,5,36,215,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,138,120,61,12 + ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "ƒT[ƒrƒX %2 (ƒT[ƒo[ %1)",IDC_PROBLEM_TITLE,32,8,186, + 21 +END + +IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + GROUPBOX "Šù’m‚Ì–â‘è",IDC_PROBLEM_BOX,5,38,216,112 + LTEXT "99:",IDC_PROBLEM_HEADER,11,51,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,27,60,172,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,204,51,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,139,134,61,12 + ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "%1",IDC_PROBLEM_TITLE,32,10,189,20 +END + +IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + GROUPBOX "Šù’m‚Ì–â‘è",IDC_PROBLEM_BOX,5,35,247,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,170,119,61,12 + ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“ %2 (ƒT[ƒo[ %1)",IDC_PROBLEM_TITLE,33,8, + 219,16 +END + +IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + GROUPBOX "Šù’m‚Ì–â‘è",IDC_PROBLEM_BOX,5,35,263,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,249,48,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 + ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "ƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2)", + IDC_PROBLEM_TITLE,31,5,237,20 +END + +IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚̈ړ®" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,72,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "—¹‰ð",IDOK,115,153,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,167,153,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,219,153,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,236,24 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 + LTEXT "ƒ{ƒŠƒ…[ƒ€‚̈ړ®æ(&M):",IDC_STATIC,4,41,116,8 +END + +IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 307, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€ˆÚ“®’† - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,5,0,295,26 + LTEXT "ƒ{ƒŠƒ…[ƒ€ %3 ‚ðƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚©‚çƒT[ƒo[ %4 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %5 ‚Ɉړ®’†...", + IDC_MOVESET_DESC,1,29,305,34 +END + +IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 277, 106 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒƒOEƒtƒ@ƒCƒ‹‚Ì•\ަ" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒT[ƒo[‚̃ƒOEƒtƒ@ƒCƒ‹‚ð•\ަ(&S):",IDC_STATIC,2,35, + 137,8 + COMBOBOX IDC_VIEWLOG_SERVER,82,45,126,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "•\ަ‚·‚éƒT[ƒo[‚̃tƒ@ƒCƒ‹(&F):",IDC_STATIC,2,63,121,8 + EDITTEXT IDC_VIEWLOG_FILENAME,82,73,185,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "—¹‰ð",IDOK,166,91,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,220,91,50,14 + ICON IDI_SERVICE,IDC_STATIC,2,1,20,20 + LTEXT "•\ަ‚µ‚½‚¢ƒƒOEƒtƒ@ƒCƒ‹‚Ì‘SƒpƒX‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B", + IDC_VIEWLOG_DESC,29,1,243,28 +END + +IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 307, 185 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "ƒƒOEƒtƒ@ƒCƒ‹‚Ì•\ަ" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒtƒ@ƒCƒ‹EƒRƒ“ƒeƒ“ƒc:",IDC_SVC_VIEWLOG_CONTENTS,4,48, + 280,8 + EDITTEXT IDC_VIEWLOG_TEXT,4,61,280,99,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL + PUSHBUTTON "•Ê–¼•ÛŠÇ(&A)...",IDC_VIEWLOG_SAVEAS,167,167,58,14 + DEFPUSHBUTTON "ƒNƒ[ƒY(&C)",IDOK,227,167,53,14 + ICON IDI_SERVICE,-1,4,7,20,20 + LTEXT "ƒT[ƒo[ %1 ‚Ì [ƒT[ƒrƒX %2 ‚Ì] ƒƒOEƒtƒ@ƒCƒ‹", + IDC_SVC_VIEWLOG_DESC,30,9,273,15 + LTEXT "ƒT[ƒo[‚̃tƒ@ƒCƒ‹–¼: %1",IDC_SVC_VIEWLOG_FILENAME,30, + 32,273,8 +END + +IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€Š„‚è“–‚ėʂ̐ݒè" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "Œ»sŠ„‚è“–‚Ä—Ê:",IDC_STATIC,4,66,50,8 + LTEXT "(•s–¾)",IDC_SET_USAGE,62,66,194,8 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,62,78,201,8, + WS_EX_STATICEDGE + LTEXT "V‹KŠ„‚è“–‚Ä—Ê(&Q):",IDC_STATIC,4,95,65,8 + EDITTEXT IDC_SET_QUOTA,79,93,32,13,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,123,93,30,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "—¹‰ð",IDOK,106,113,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,160,113,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,214,113,50,14 + PUSHBUTTON "ƒvƒƒpƒeƒB[(&P)...",IDC_AGG_PROPERTIES,193,34,69,12 + LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“:",IDC_STATIC,4,36,50,8 + LTEXT "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2",IDC_SET_AGGREGATE,62, + 36,123,21 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "ƒ{ƒŠƒ…[ƒ€ %1",IDC_SET_NAME,36,8,228,19 +END + +IDD_ACTIONS DIALOGEX 0, 0, 236, 58 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_TOOLWINDOW +CAPTION "is’†‚Ì‘€ì - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 +BEGIN + LTEXT "ŽŸ‚Ì‘€ì‚ªŒ»Ýis’†‚Å‚·:",IDC_ACTION_DESC,2,2,232,8 + CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | + 0x3,2,14,232,43 +END + +IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "VLDB ‚Ì“¯Šú‰»" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + DEFPUSHBUTTON "—¹‰ð",IDOK,107,79,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,161,79,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,215,79,50,14 + ICON 32515,IDC_STATIC,4,4,20,20 + LTEXT "(ŽÀsŽž‚ɐݒè)",IDC_SYNC_DESC,29,4,236,32 + LTEXT "(ŽÀsŽž‚ɐݒè)",IDC_SYNC_DESC2,29,46,236,24 +END + +IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚Ì•¡»" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,67,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "—¹‰ð",IDOK,112,150,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,166,150,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,220,150,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,21 + LTEXT "ƒ{ƒŠƒ…[ƒ€ %3 ‚̐V‹KƒŒƒvƒŠƒJ",IDC_SET_NAME,31,7,242,17 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 + LTEXT "‚±‚̃{ƒŠƒ…[ƒ€‚̐V‹KƒŒƒvƒŠƒJ‚ðì¬‚·‚éêŠ(&C):", + IDC_STATIC,4,34,259,8 +END + +IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 248, 156 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒtƒ@ƒCƒ‹‚̃Cƒ“ƒXƒg[ƒ‹" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒ\[ƒXEƒtƒ@ƒCƒ‹(&F):",IDC_STATIC,6,62,81,8 + EDITTEXT IDC_FILENAME,51,72,135,14,ES_AUTOHSCROLL + PUSHBUTTON "ŽQÆ(&B)...",IDC_BROWSE,191,72,50,14 + LTEXT "ƒ^[ƒQƒbƒgEƒT[ƒo[(&S):",IDC_STATIC,6,88,97,8 + COMBOBOX IDC_SERVER,51,97,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ƒ^[ƒQƒbƒg–¼(&N):",IDC_STATIC,6,112,66,8 + EDITTEXT IDC_DIRECTORY,51,121,135,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "—¹‰ð",IDOK,83,140,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,137,140,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,191,140,50,14 + ICON IDI_INSTALL,IDC_STATIC,4,2,20,20 + LTEXT "ƒT[ƒo[‚Ƀtƒ@ƒCƒ‹‚ðƒCƒ“ƒXƒg[ƒ‹",IDC_STATIC,32,6,205, + 15 + LTEXT "(ƒeƒLƒXƒg‚ÍŽÀsŽž‚ɐݒè)\n(ƒeƒLƒXƒg‚ÍŽÀsŽž‚ɐݒè)\n(ƒeƒLƒXƒg‚ÍŽÀsŽž‚ɐݒè)\n(ƒeƒLƒXƒg‚ÍŽÀsŽž‚ɐݒè)", + IDC_INSTALL_DESC,4,27,240,31 +END + +IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒtƒ@ƒCƒ‹‚̃Aƒ“ƒCƒ“ƒXƒg[ƒ‹" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒT[ƒo[(&S):",IDC_STATIC,6,66,49,8 + COMBOBOX IDC_SERVER,64,64,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ƒ^[ƒQƒbƒgEƒtƒ@ƒCƒ‹(&F):",IDC_STATIC,6,85,97,8 + EDITTEXT IDC_FILENAME,64,97,175,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "—¹‰ð",IDOK,88,119,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,141,119,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,194,119,50,14 + ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 + LTEXT "ƒT[ƒo[‚©‚çƒtƒ@ƒCƒ‹‚ðƒAƒ“ƒCƒ“ƒXƒg[ƒ‹",IDC_STATIC,32, + 12,205,8 + LTEXT "‚±‚Ì‘€ì‚́A“Á’è‚̃T[ƒo[ã‚ɈȑO‚ɃCƒ“ƒXƒg[ƒ‹‚³‚ꂽƒtƒ@ƒCƒ‹‚̃Rƒs[‚𕜌³‚µ‚Ü‚·B‘I‘ð‚µ‚½ƒtƒ@ƒCƒ‹‚ɈȑOƒCƒ“ƒXƒg[ƒ‹‚³‚ꂽƒRƒs[‚ª‚È‚¢ê‡Aƒtƒ@ƒCƒ‹‚͍폜‚³‚ê‚Ü‚·B", + IDC_STATIC,6,29,234,26 +END + +IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 255, 141 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "‹Œƒtƒ@ƒCƒ‹‚̍폜" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒT[ƒo[:",-1,4,56,41,8 + COMBOBOX IDC_SERVER,57,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "‚·‚ׂẴRƒAEƒtƒ@ƒCƒ‹‚ðíœ(&C)",IDC_OP_DELETE_CORE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,85,138,10 + CONTROL "‚·‚×‚Ä‚Ì .BAK ƒtƒ@ƒCƒ‹‚ðíœ(&B) (ƒtƒ@ƒCƒ‹EƒoƒbƒNƒAƒbƒv)", + IDC_OP_DELETE_BAK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 13,96,229,10 + CONTROL "‚·‚×‚Ä‚Ì .OLD ƒtƒ@ƒCƒ‹‚ðíœ(&O) (‹Œƒtƒ@ƒCƒ‹EƒoƒbƒNƒAƒbƒv)", + IDC_OP_DELETE_OLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 13,107,232,10 + DEFPUSHBUTTON "—¹‰ð",IDOK,38,121,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,92,121,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,201,121,50,14 + ICON IDI_PRUNE,-1,6,5,20,20 + LTEXT "‹Œƒtƒ@ƒCƒ‹‚ðƒT[ƒo[‚©‚çíœ",-1,39,10,205,11 + LTEXT "‚±‚Ì‘€ì‚́A“Á’è‚̃T[ƒo[‚ɃCƒ“ƒXƒg[ƒ‹‚³‚ꂽƒtƒ@ƒCƒ‹‚̃oƒbƒNƒAƒbƒvEƒRƒs[‚ðíœ‚µ‚Ü‚·B", + -1,7,32,240,16 + LTEXT "íœ‚·‚éƒtƒ@ƒCƒ‹:",-1,4,73,66,8 +END + +IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚Ì–¼‘O•ύX" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "Œ»Ý‚Ì–¼‘O(&O):",IDC_STATIC,31,67,51,8 + EDITTEXT IDC_RENSET_OLD,94,65,122,14,ES_AUTOHSCROLL | ES_READONLY + LTEXT "V‚µ‚¢–¼‘O(&N):",IDC_STATIC,31,85,51,8 + EDITTEXT IDC_RENSET_NEW,94,83,122,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "—¹‰ð",IDOK,112,111,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,166,111,50,14 + PUSHBUTTON "ƒwƒ‹ƒv",9,220,111,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,21 + LTEXT "ƒ{ƒŠƒ…[ƒ€ %3 ‚𖼑O•ύX‚·‚é‚ɂ́AV‚µ‚¢–¼‘O‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢BŽ©“®“I‚Ƀ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv‚Æ‚»‚Ì‚·‚ׂẴŒƒvƒŠƒJ‚Ì–¼‘O‚ª•ύX‚³‚ê‚Ü‚·B\n\n’ˆÓ: ƒ}ƒEƒ“ƒg‚³‚ꂽƒ{ƒŠƒ…[ƒ€‚𖼑O•ύX‚·‚éê‡‚́A‚»‚̃}ƒEƒ“ƒgEƒ|ƒCƒ“ƒg‚̍폜‚ƍč쐬‚ª•K—v‚ɂȂè‚Ü‚·B", + IDC_RENSET_DESC,29,7,242,48 +END + +IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 307, 69 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒT[ƒrƒX‚̍폜" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + DEFPUSHBUTTON "ŽæÁ‚µ",IDCANCEL,195,47,50,14 + PUSHBUTTON "—¹‰ð",IDOK,141,47,50,14 + PUSHBUTTON "ƒwƒ‹ƒv",9,249,47,50,14 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "’ˆÓ!\n\n‚±‚Ì‘€ì‚É‚æ‚èAƒT[ƒrƒX %2 ‚Í’âŽ~‚³‚êAƒT[ƒo[ %1 ‚©‚çíœ‚³‚ê‚Ü‚·B", + IDC_DELSVC_DESC,31,7,266,33 +END + +IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒtƒ@ƒCƒ‹“ú•t‚̎擾" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒT[ƒo[(&S):",-1,4,56,49,8 + COMBOBOX IDC_SERVER,62,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Æ‰ï‚·‚éƒtƒ@ƒCƒ‹(&F):",-1,4,73,81,8 + EDITTEXT IDC_FILENAME,62,85,135,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "—¹‰ð",IDOK,84,104,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,138,104,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,192,104,50,14 + ICON IDI_GETDATES,-1,4,4,20,20 + LTEXT "ƒT[ƒo[‚̃tƒ@ƒCƒ‹‚Ì“ú•t‚ðŽæ“¾",-1,32,10,212,10 + LTEXT "‚±‚Ì‘€ì‚́Aƒtƒ@ƒCƒ‹‚Æ‚»‚̃oƒbƒNƒAƒbƒv (‘¶Ý‚·‚éê‡) ‚ªÅŒã‚ɕύX‚³‚ꂽ“ú•t‚ðŽæ“¾‚µ‚Ü‚·B", + -1,6,29,234,16 +END + +IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒtƒ@ƒCƒ‹“ú•t‚̎擾 - Œ‹‰Ê" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒT[ƒo[:",IDC_STATIC,6,30,39,8 + LTEXT "(ŽÀsŽž‚ɐݒè)",IDC_SERVER,58,30,179,8 + LTEXT "ƒtƒ@ƒCƒ‹–¼:",IDC_STATIC,6,45,42,8 + LTEXT "(ŽÀsŽž‚ɐݒè)",IDC_FILENAME,58,45,179,8 + LTEXT "ƒtƒ@ƒCƒ‹“ú•t:",IDC_STATIC,6,60,44,8 + LTEXT "(•s–¾Aƒtƒ@ƒCƒ‹‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ)",IDC_DATE_FILE,58,60, + 179,8 + LTEXT ".BAK “ú•t:",IDC_STATIC,6,75,37,8 + LTEXT "(•s–¾Aƒtƒ@ƒCƒ‹‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ)",IDC_DATE_BAK,58,75, + 179,8 + LTEXT ".OLD “ú•t:",IDC_STATIC,6,90,37,8 + LTEXT "(•s–¾Aƒtƒ@ƒCƒ‹‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ)",IDC_DATE_OLD,58,90, + 179,8 + DEFPUSHBUTTON "ƒNƒ[ƒY(&C)",IDOK,99,112,53,14 + ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 + LTEXT "ƒT[ƒo[‚̃tƒ@ƒCƒ‹‚Ì“ú•t‚ðŽæ“¾",IDC_STATIC,32,12,212,8 +END + +IDD_SET_DUMP DIALOGEX 0, 0, 307, 145 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚̃_ƒ“ƒv - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ì¬‚·‚éƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹(&N):",IDC_STATIC,4,36,114,8 + EDITTEXT IDC_DUMP_FILENAME,82,46,151,14,ES_AUTOHSCROLL + PUSHBUTTON "ŽQÆ(&B)...",IDC_DUMP_BROWSE,239,46,49,14 + CONTROL "ƒ{ƒŠƒ…[ƒ€ %3 (ƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2) ‚Ì“à—e‘S‘Ì‚ðƒ_ƒ“ƒv(&E)", + IDC_DUMP_FULL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,8, + 75,289,13 + CONTROL "‚±‚Ì“úŽžˆÈ~‚ɕύX‚³‚ꂽƒtƒ@ƒCƒ‹‚̂݃_ƒ“ƒv(&S)", + IDC_DUMP_LIMIT_TIME,"Button",BS_AUTORADIOBUTTON,8,96,157, + 10 + CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,171,103, + 51,13,WS_EX_CLIENTEDGE + CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,231,103, + 56,13,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "—¹‰ð",IDOK,141,126,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,193,126,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,249,126,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "‚±‚Ì‘€ì‚̓{ƒŠƒ…[ƒ€‚Ì“à—e‚ð 1 ‚‚̃tƒ@ƒCƒ‹‚ɃRƒs[‚·‚邽‚߁Aƒ{ƒŠƒ…[ƒ€‚ðŠÈ’P‚ɃoƒbƒNƒAƒbƒv‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B‚±‚Ì•û–@‚Ń_ƒ“ƒv‚³‚ꂽƒ{ƒŠƒ…[ƒ€‚Ì“à—e‚́AŒã‚Å•œŒ³‚ª‰Â”\‚Å‚·B", + IDC_STATIC,30,7,255,24 + GROUPBOX "ƒ_ƒ“ƒvEƒpƒ‰ƒ[ƒ^[",IDC_STATIC,4,62,299,58 +END + +IDD_SET_RESTORE DIALOGEX 0, 0, 292, 248 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚Ì•œŒ³ - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "•œŒ³‚·‚éƒtƒ@ƒCƒ‹(&R):",IDC_STATIC,4,32,62,8 + EDITTEXT IDC_RESTORE_FILENAME,75,29,154,14,ES_AUTOHSCROLL + PUSHBUTTON "ŽQÆ(&B)...",IDC_RESTORE_BROWSE,236,29,50,14 + CONTROL "‚±‚ê‚Í‘•ªƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹‚Å‚·(&I)", + IDC_RESTORE_INCREMENTAL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,75,50,142,10 + LTEXT "ƒ{ƒŠƒ…[ƒ€(&V):",IDC_STATIC,11,103,48,8 + EDITTEXT IDC_RESTORE_SETNAME,75,101,115,14,ES_AUTOHSCROLL + LTEXT "ƒT[ƒo[(&S):",IDC_STATIC,11,146,44,8 + COMBOBOX IDC_RESTORE_SERVER,75,145,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“(&P):",IDC_STATIC,11,161,55,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,50,176,231, + 42,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "—¹‰ð",IDOK,125,229,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,180,229,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,235,229,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "ƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹‚©‚çƒ{ƒŠƒ…[ƒ€‚𕜌³",IDC_STATIC,33,8, + 255,9 + GROUPBOX "ƒ^[ƒQƒbƒgEƒ{ƒŠƒ…[ƒ€",IDC_STATIC,4,63,284,160 + LTEXT "ƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹‚©‚çƒ{ƒŠƒ…[ƒ€‚𕜌³‚·‚邯‚«‚́AV‚µ‚¢ƒ{ƒŠƒ…[ƒ€‚ðì¬‚·‚é‚©AŠù‘¶‚̓ǂݎæ‚è/‘‚«ž‚݃{ƒŠƒ…[ƒ€‚ɏ㏑‚«‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", + IDC_STATIC,8,76,276,18 + LTEXT "(ŽÀsŽž‚ɐݒè)\n(ŽÀsŽž‚ɐݒè)",IDC_RESTORE_CREATE,31, + 120,253,17 +END + +IDD_SVC_BOS DIALOGEX 0, 0, 265, 207 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + CONTROL "‚±‚̃T[ƒo[‚Ì‘SƒT[ƒrƒX‚ð’èŠú“I‚É’âŽ~/ÄŽn“®(&P)", + IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, + 76,204,10 + LTEXT "ÄŽn“®(&R)",IDC_BOS_GENRES_DESC1,21,92,37,8 + COMBOBOX IDC_BOS_GENRES_DATE,65,89,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,157, + 89,53,13,WS_EX_CLIENTEDGE + CONTROL "‚±‚̃T[ƒo[‚Ì‘SƒT[ƒrƒX‚̐V‹KƒoƒCƒiƒŠ[‚ð’èŠú“I‚ɃeƒXƒg(&B)", + IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, + 157,246,10 + LTEXT "ƒeƒXƒg(&S)",IDC_BOS_BINRES_DESC1,21,173,36,8 + COMBOBOX IDC_BOS_BINRES_DATE,65,170,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,157, + 170,53,13,WS_EX_CLIENTEDGE + ICON IDI_BOSSERVICE,IDC_STATIC,5,5,20,20 + LTEXT "ƒT[ƒrƒX %2 (ƒT[ƒo[ %1)",IDC_SVC_NAME,33,8,224,16 + GROUPBOX "BOS ƒT[ƒrƒX",IDC_STATIC,5,33,254,169 + LTEXT "BOS ƒT[ƒrƒX‚ðŽg—p‚µ‚āA‚±‚̃T[ƒo[‚Ì‚·‚ׂẴT[ƒrƒX (BOS ƒT[ƒrƒXŽ©‘Ì‚ðŠÜ‚Þ) ‚ð’âŽ~‚¨‚æ‚эĎn“®‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", + IDC_STATIC,9,47,248,22 + LTEXT "‚Ü‚½ABOS ƒT[ƒrƒX‚ðŽg—p‚µ‚āAƒT[ƒo[‚Ì‚·‚ׂẴT[ƒrƒX‚ð’èŠú“I‚ɃeƒXƒg‚µAƒoƒCƒiƒŠ[Eƒtƒ@ƒCƒ‹‚ªXV‚³‚ꂽƒT[ƒrƒX‚݂̂ð’âŽ~‚¨‚æ‚эĎn“®‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", + IDC_STATIC,11,113,240,35 +END + +IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 307, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚̃_ƒ“ƒv’† - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,4,0,296,30 + LTEXT "ƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹ %4 ‚ðƒ{ƒŠƒ…[ƒ€ %3 ‚©‚çì¬’†...", + IDC_DUMPSET_DESC,4,36,294,24 +END + +IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 307, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚Ì•œŒ³’† - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,4,0,295,29 + LTEXT "ƒ{ƒŠƒ…[ƒ€ %1 ‚ðƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹ %2 ‚©‚畜Œ³’†...", + IDC_RESTORESET_DESC,4,34,294,30 +END + +IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 258, 163 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + CONTROL "‚±‚̃Zƒ‹‚Ì‘Sƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚ðì¬(&A)", + IDC_CLONE_ALL,"Button",BS_AUTORADIOBUTTON,6,53,242,10 + GROUPBOX " ",IDC_STATIC,4,68,249,67 + CONTROL "ˆÈ‰º‚̊‚Ɉê’v‚·‚éƒ{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒv‚̂ݍ쐬(&O)", + IDC_CLONE_SOME,"Button",BS_AUTORADIOBUTTON,6,67,234,11 + CONTROL "ŽŸ‚̃T[ƒo[‚̃{ƒŠƒ…[ƒ€‚Ì‚Ý(&S):",IDC_CLONE_SVR_LIMIT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,83,140,10 + COMBOBOX IDC_CLONE_SVR,164,82,85,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "ŽŸ‚̃p[ƒeƒBƒVƒ‡ƒ“‚̃{ƒŠƒ…[ƒ€‚Ì‚Ý(&P):", + IDC_CLONE_AGG_LIMIT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,6,99,140,10 + COMBOBOX IDC_CLONE_AGG,164,98,85,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "–¼‘O‚ªŽŸ‚ÅŽn‚Ü‚éƒ{ƒŠƒ…[ƒ€‚Ì‚Ý(&B):", + IDC_CLONE_PREFIX_LIMIT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,6,116,140,10 + EDITTEXT IDC_CLONE_PREFIX,164,115,85,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "—¹‰ð",IDOK,92,142,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,146,142,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,201,142,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "ƒ{ƒŠƒ…[ƒ€EƒoƒbƒNƒAƒbƒv‚́A‚»‚̃{ƒŠƒ…[ƒ€‚̓ǂݎæ‚èê—pƒRƒs[‚̂悤‚È“­‚«‚ð‚µ‚Ü‚·B“ǂݎæ‚è/‘‚«ž‚݃{ƒŠƒ…[ƒ€‚̓oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚ð 1 ‚‚¾‚¯Ž‚‚±‚Æ‚ª‚Å‚«‚Ü‚·B\n\n•¡”‚̃{ƒŠƒ…[ƒ€‚̃oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚𓯎ž‚ɍ쐬‚Å‚«‚Ü‚·B", + IDC_STATIC,30,7,214,40 +END + +IDD_SUBSETS DIALOGEX 0, 0, 281, 182 +STYLE WS_POPUP | WS_CAPTION +CAPTION "ƒ‚ƒjƒ^[‚³‚ê‚éƒT[ƒo[" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒTƒuƒZƒbƒg–¼:",IDC_STATIC,13,73,50,8 + EDITTEXT IDC_SUBSET_NAME,54,84,111,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_TABSTOP + PUSHBUTTON "ƒI[ƒvƒ“(&O)...",IDC_SUBSET_LOAD,171,84,58,14 + PUSHBUTTON "•ÛŠÇ(&S)...",IDC_SUBSET_SAVE,230,84,42,14 + CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x153,7,111,182,58,WS_EX_CLIENTEDGE + PUSHBUTTON "‚·‚ׂă‚ƒjƒ^[(&A)",IDC_SUBSET_ALL,196,122,77,14 + PUSHBUTTON "ƒ‚ƒjƒ^[‚µ‚È‚¢(&N)",IDC_SUBSET_NONE,196,140,77,14 + LTEXT "‘å‚«‚ȃZƒ‹‚ł̃pƒtƒH[ƒ}ƒ“ƒX‚ð‰ü‘P‚·‚é‚ɂ́A–â‘è‚ɂ‚¢‚Ä“Á’è‚̃T[ƒo[‚ðƒ‚ƒjƒ^[‚µ‚È‚¢‚±‚Æ‚ð‘I‘ð‚µ‚Ü‚·BAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚́Aƒ‚ƒjƒ^[‚³‚ê‚È‚¢ƒT[ƒo[‚̃{ƒŠƒ…[ƒ€Aƒp[ƒeƒBƒVƒ‡ƒ“A‚Ü‚½‚̓T[ƒrƒX‚Í•\ަ‚µ‚Ü‚¹‚ñB", + IDC_STATIC,5,2,271,27 + LTEXT "ƒT[ƒo[‚̃‚ƒjƒ^[ (‚Ü‚½‚̓‚ƒjƒ^[‚µ‚È‚¢) ‚Í‚¢‚‚łà‘I‘ð‚Å‚«‚Ü‚·BƒT[ƒo[EƒTƒuƒZƒbƒg‚ðì¬‚µ‚āAƒ‚ƒjƒ^[‚·‚éƒT[ƒo[‚ÌƒŠƒXƒg‚ðŽw’è‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", + IDC_STATIC,5,36,271,20 + GROUPBOX "Œ»sƒTƒuƒZƒbƒg",IDC_STATIC,5,63,271,114 + LTEXT "ƒ‚ƒjƒ^[‚·‚éƒT[ƒo[:",IDC_STATIC,12,100,82,8 +END + +IDD_SUBSET_LOADSAVE DIALOGEX 0, 0, 280, 145 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | + WS_CAPTION | WS_SYSMENU +CAPTION "(ƒ^ƒCƒgƒ‹‚ÍŽÀsŽž‚ɐݒè)" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 +BEGIN + LTEXT "ƒTƒuƒZƒbƒg–¼(&N):",1090,5,108,66,8,SS_NOTIFY + EDITTEXT IDC_SUBSET_NAME,54,120,159,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "ƒI[ƒvƒ“(&O)",IDOK,221,108,53,14 + PUSHBUTTON "ŽæÁ‚µ(&L)",IDCANCEL,221,125,53,14 + CONTROL "List1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | + LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,272,82, + WS_EX_CLIENTEDGE + PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT + WS_TABSTOP + PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT + WS_TABSTOP + LTEXT "‚±‚̃Zƒ‹‚É‚·‚łɒè‹`‚³‚ê‚Ä‚¢‚éƒTƒuƒZƒbƒg:",IDC_STATIC,4, + 6,162,8 +END + +IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "ƒRƒ}ƒ“ƒhŒŸõ" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + COMBOBOX IDC_FIND_COMMAND,4,36,137,170,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "ƒwƒ‹ƒv‚Ì•\ަ(&H)",IDOK,144,36,69,14 + PUSHBUTTON "ŽæÁ‚µ(&C)",IDCANCEL,144,53,69,14 + LTEXT "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ðŽg—p‚µ‚ă^ƒXƒN‚ðŽÀs‚·‚é•û–@‚ðŒ©‚é‚ɂ́A‰º‚̃Rƒ}ƒ“ƒhs‚ð‘I‘ð‚µ‚Äuƒwƒ‹ƒv‚Ì•\ަvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B", + IDC_STATIC,4,4,210,25 +END + +IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 141 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "ƒGƒ‰[EƒR[ƒh‚ÌŒŸõ" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒGƒ‰[”ԍ†(&E):",IDC_STATIC,4,41,50,8 + EDITTEXT IDC_ERROR_NUMBER,63,39,78,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "•ÏŠ·(&T)",IDC_ERROR_TRANSLATE,147,39,67,14 + PUSHBUTTON "ƒNƒ[ƒY(&C)",IDCANCEL,85,121,53,14 + LTEXT "(ƒeƒLƒXƒg‚ÍŽÀsŽž‚ɐݒè)",IDC_ERROR_DESC,4,65,210,48 + LTEXT "ƒGƒ‰[EƒR[ƒh‚̈Ӗ¡‚𒲂ׂé‚ɂ́AƒR[ƒh‚ð‰º‚É“ü—Í‚µ‚āu•ÏŠ·vƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B", + IDC_STATIC,4,4,210,25 + CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 +END + +IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ɂ‚¢‚Ä" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 + LTEXT "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[ ƒo[ƒWƒ‡ƒ“ 3.5",IDC_STATIC, + 33,8,163,8 + LTEXT "Copyright (C) IBM Corporation 1989, 1999",IDC_STATIC,33, + 20,183,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 + CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 + PUSHBUTTON "ƒNƒ[ƒY(&C)",IDOK,89,121,53,14 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 +END + +IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ª %1 ƒZƒ‹“à‚̃T[ƒo[‚ðŒŸõ’†...", + IDC_OPENCELL_DESC,41,15,183,16 + GROUPBOX "",IDC_STATIC,4,2,231,39 + ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 309, 136 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + CONTROL "ƒT[ƒo[‚ÌŠ®‘SCüƒhƒƒCƒ“–¼ (—á: ""machine.company.com"") ‚ð•\ަ", + IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,11,5,238,10 + CONTROL "ŠÇ—ƒg[ƒNƒ“‚È‚µ‚Å‹@”\‚·‚éê‡‚ÉŒx‚ð•\ަ(&W)", + IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,11,19,238,10 + CONTROL "...í‚ɃT[ƒo[EƒvƒƒpƒeƒB[‚ð•\ަ", + IDC_OPT_SVR_DBL_PROP,"Button",BS_AUTORADIOBUTTON,11,50, + 238,10 + CONTROL "...ƒNƒBƒbƒNEƒrƒ…[EƒyƒCƒ“‚̃I[ƒvƒ“Žž‚̂݃T[ƒo[EƒvƒƒpƒeƒB[‚ð•\ަ", + IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON,11, + 63,238,10 + CONTROL "...í‚É‚»‚̃T[ƒo[‚̃EƒBƒ“ƒhƒE‚ðƒI[ƒvƒ“", + IDC_OPT_SVR_DBL_OPEN,"Button",BS_AUTORADIOBUTTON,11,75, + 238,10 + CONTROL "...ƒT[ƒo[EƒEƒBƒ“ƒhƒE‚̃I[ƒvƒ“‚ŁA‚»‚̃T[ƒo[‚ðƒ‚ƒjƒ^[", + IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,11,107,238,10 + CONTROL "...ƒT[ƒo[EƒEƒBƒ“ƒhƒE‚̃Nƒ[ƒY‚ŁA‚»‚̃T[ƒo[‚ðƒ‚ƒjƒ^[‰ðœ", + IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,11,121,238,10 + LTEXT "ƒT[ƒo[‚̃AƒCƒRƒ“‚ðƒ_ƒuƒ‹ƒNƒŠƒbƒN‚·‚邯...",IDC_STATIC, + 7,38,238,8 + LTEXT "ƒT[ƒo[EƒTƒuƒZƒbƒg‚ªŽg—p’†‚ŃNƒBƒbƒNEƒrƒ…[EƒyƒCƒ“‚̃Nƒ[ƒYŽž...", + IDC_STATIC,7,95,238,8 +END + +IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,23,216, + 129,WS_EX_CLIENTEDGE + PUSHBUTTON "ƒT[ƒo[Œ®‚̒ljÁ(&A)",IDC_KEY_ADD,46,157,85,14 + PUSHBUTTON "ƒT[ƒo[Œ®‚̍폜(&R)",IDC_KEY_REMOVE,133,157,85,14 + LTEXT "ƒT[ƒo[‚ÌŒ®:",IDC_KEY_NAME,5,5,216,11 +END + +IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒT[ƒo[Œ®‚̒ljÁ" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒo[ƒWƒ‡ƒ“:",IDC_STATIC,9,37,38,8 + EDITTEXT IDC_KEY_VERSION,57,35,43,14,ES_AUTOHSCROLL + LTEXT "’l:",IDC_STATIC,9,55,21,8 + CONTROL "‚±‚̃XƒgƒŠƒ“ƒO‚ðˆÃ†‰»:",IDC_KEY_BYSTRING,"Button", + BS_AUTORADIOBUTTON,43,54,101,10 + CONTROL "‚±‚ÌŒ®‚ðŽg—p:",IDC_KEY_BYDATA,"Button", + BS_AUTORADIOBUTTON,43,86,61,10 + EDITTEXT IDC_KEY_STRING,112,65,155,14,ES_PASSWORD | + ES_AUTOHSCROLL + EDITTEXT IDC_KEY_DATA,112,83,103,14,ES_AUTOHSCROLL + PUSHBUTTON "ƒ‰ƒ“ƒ_ƒ€(&R)",IDC_KEY_RANDOM,220,83,53,14 + LTEXT "’ˆÓ: V‚µ‚¢Œ®‚ðƒT[ƒo[‚ɒljÁ‚µ‚½ŒãAV‚µ‚¢Œ®‚ðŽg—p‚·‚邿‚¤‚É AFS ƒAƒJƒEƒ“ƒg‚ð•ύX‚µ‚Ä‚­‚¾‚³‚¢B”“úŒãAŒÃ‚¢ƒT[ƒo[Œ®‚Í‚·‚ׂč폜‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B", + IDC_STATIC,9,101,260,21 + DEFPUSHBUTTON "—¹‰ð",IDOK,113,127,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,167,127,50,14 + PUSHBUTTON "ƒwƒ‹ƒv",9,221,127,50,14 + LTEXT "ƒT[ƒo[ %1 ‚̐V‹KŒ®",IDC_KEY_TITLE,39,11,229,18 + ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 +END + +IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 307, 133 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒT[ƒrƒX‚ÌŠJŽn/’âŽ~" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + DEFPUSHBUTTON "—¹‰ð",IDOK,112,116,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,166,116,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,220,116,50,14 + ICON IDI_SERVICE,IDC_STATIC,4,7,20,20 + LTEXT "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ðŠJŽn/’âŽ~‚·‚é‚ɂ́u—¹‰ðv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B", + IDC_STARTSTOP_TEXT,31,8,272,17 + CONTROL "‰i‘±(&P) (IDS_START/STOPSERVICE_PERMANENT)", + IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON,8,79, + 294,10 + CONTROL "ˆêŽž(&T) (IDS_START/STOPSERVICE_TEMPORARY)", + IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON,8,96, + 294,10 + GROUPBOX "ƒT[ƒrƒXŽn“®",IDC_STATIC,4,35,302,76 + LTEXT "‚±‚̕ύX‚͉i‘±“I‚È‚à‚̂ɂ·‚邱‚Æ‚ª‚Å‚«AƒT[ƒo[ %1 ‚ªÄŽn“®‚³‚ê‚邯ީ“®“I‚ɃT[ƒrƒX %2 ‚ªŠJŽn‚³‚ê‚Ü‚· (‚³‚ê‚Ü‚¹‚ñ)B", + IDC_STARTSTOP_STARTUP,8,48,294,23 +END + +IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 248, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒRƒ}ƒ“ƒh‚ÌŽÀs" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒT[ƒo[(&S):",IDC_STATIC,7,56,44,8 + COMBOBOX IDC_SERVER,58,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ƒRƒ}ƒ“ƒh(&C):",IDC_STATIC,7,75,44,8 + EDITTEXT IDC_COMMAND,58,73,183,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "—¹‰ð",IDOK,84,105,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,138,105,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,192,105,50,14 + ICON IDI_SERVER,IDC_STATIC,4,4,20,20 + LTEXT "ƒT[ƒo[‚̃Rƒ}ƒ“ƒh‚ðŽÀs",IDC_STATIC,36,12,204,8 + LTEXT "‚±‚Ì‘€ì‚́AƒŠƒ‚[ƒgEƒT[ƒo[‚ł̃Rƒ}ƒ“ƒh‚Ì”­s‚ð‰Â”\‚É‚µ‚Ü‚·B\nˆê”Ê‚É /etc/reboot ƒXƒNƒŠƒvƒg‚ÌŽÀs‚É‚æ‚éƒT[ƒo[‚̍Ďn“®‚ÉŽg—p‚³‚ê‚Ü‚·B", + IDC_STATIC,7,29,231,16 +END + +IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 248, 254 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚̃Tƒ‹ƒx[ƒW - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒT[ƒo[(&S):",IDC_STATIC,9,43,44,8 + COMBOBOX IDC_SERVER,78,41,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ƒp[ƒeƒBƒVƒ‡ƒ“(&P):",IDC_STATIC,9,55,59,8 + COMBOBOX IDC_AGGREGATE,78,54,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "‚·‚ׂẴp[ƒeƒBƒVƒ‡ƒ“‚ðƒTƒ‹ƒx[ƒW(&A)", + IDC_AGGREGATE_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 81,70,145,10 + LTEXT "ƒ{ƒŠƒ…[ƒ€(&O):",IDC_STATIC,9,83,49,8 + COMBOBOX IDC_FILESET,78,81,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒTƒ‹ƒx[ƒW(&L)",IDC_FILESET_ALL, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,81,96,145,10 + DEFPUSHBUTTON "—¹‰ð",IDOK,85,108,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,139,108,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,193,108,50,14 + PUSHBUTTON "Šg’£(&V) >>",IDC_ADVANCED,6,108,53,14 + LTEXT "ˆêŽžƒtƒ@ƒCƒ‹‚̃pƒX(&T):",IDC_STATIC,5,141,77,8 + EDITTEXT IDC_SALVAGE_TEMPDIR,97,140,144,13,ES_AUTOHSCROLL + CONTROL "•ÀsƒTƒ‹ƒx[ƒW‘€ìAƒvƒƒZƒX”(&R):",IDC_SALVAGE_SIMUL, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,157,148,10 + EDITTEXT IDC_SALVAGE_NUM,202,156,25,13,ES_AUTOHSCROLL + CONTROL "‘¹ƒ{ƒŠƒ…[ƒ€‚ðƒTƒ‹ƒx[ƒW‚µ‚È‚¢(&N)", + IDC_SALVAGE_READONLY,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,29,167,154,10 + CONTROL "“ǂݎæ‚è‘€ì‚ð¬‚³‚ȃuƒƒbƒN‚É•ªŠ„(&B)", + IDC_SALVAGE_BLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 29,177,162,10 + CONTROL "ަ‚³‚ꂽ‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ð‹­§ƒTƒ‹ƒx[ƒW(&F)", + IDC_SALVAGE_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 29,187,193,10 + CONTROL "ƒfƒBƒŒƒNƒgƒŠ[\‘¢‚ð‹­§Äì¬(&E)",IDC_SALVAGE_FIXDIRS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,197,146,10 + LTEXT "Œ‹‰ÊƒƒO‚̃tƒ@ƒCƒ‹–¼(&M):",IDC_STATIC,8,211,79,8 + EDITTEXT IDC_SALVAGE_LOG_FILE,98,210,140,13,ES_AUTOHSCROLL + CONTROL "‘¹ inode ‚ÌƒŠƒXƒg‚ðŒ‹‰ÊƒƒO‚É“ü‚ê‚é(&I)", + IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,30,225,165,10 + CONTROL "AFS Š—L‚̃‹[ƒginode‚ÌƒŠƒXƒg‚ðŒ‹‰ÊƒƒO‚É“ü‚ê‚é(&W)", + IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,30,236,206,10 + ICON IDI_SERVER,IDC_STATIC,4,7,20,20 + LTEXT "‚±‚Ì‘€ì‚́A•¡”‚̃{ƒŠƒ…[ƒ€‚ł̖â‘è‚̏C³‚ð‰Â”\‚É‚µ‚Ü‚·B\n\n’ˆÓ: ƒp[ƒeƒBƒVƒ‡ƒ“‘S‘Ì‚©ƒT[ƒo[‘S‘Ì‚ðˆê“x‚ɃTƒ‹ƒx[ƒW‚·‚éê‡AƒT[ƒo[‚͈ꎞ“I‚ɃIƒtƒ‰ƒCƒ“‚ɂȂè‚Ü‚·B", + IDC_STATIC,27,5,210,33 + GROUPBOX "Šg’£ƒTƒ‹ƒx[ƒWEƒIƒvƒVƒ‡ƒ“",IDC_ADVANCED_GROUP,4,128, + 240,122 +END + +IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "ƒ{ƒŠƒ…[ƒ€‚̃Tƒ‹ƒx[ƒW - Œ‹‰Ê" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + DEFPUSHBUTTON "ƒNƒ[ƒY(&C)",IDOK,222,158,53,14 + LTEXT "ƒTƒ‹ƒx[ƒW‘€ì‚ÌŒ‹‰Ê:",IDC_STATIC,7,41,271,8 + EDITTEXT IDC_SALVAGE_DETAILS,4,55,277,99,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP + ICON IDI_SERVER,IDC_STATIC,4,7,20,20 + LTEXT "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€ %3 ‚ðƒTƒ‹ƒx[ƒW", + IDC_SALVAGE_TITLE,30,10,249,24 +END + +IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 277, 102 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ{ƒŠƒ…[ƒ€‚̉ð•ú" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + DEFPUSHBUTTON "—¹‰ð",IDOK,112,82,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,166,82,50,14 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,220,82,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "‚±‚Ì‘€ì‚́A%3 ƒ{ƒŠƒ…[ƒ€‚̃ŒƒvƒŠƒJ‚ðXV‚µ‚Ü‚·BŒÃ‚­‚È‚Á‚½ƒŒƒvƒŠƒJ‚݂̂ðXV‚·‚é‚©A‚·‚ׂẴŒƒvƒŠƒJ‚ðXV‚·‚é‚©‚ð‘I‘ð‚·‚é‚±‚Æ‚ª‚Å‚«‚Ü‚·B", + IDC_RELSET_DESC,30,7,242,29 + CONTROL "ŒÃ‚¢ƒ{ƒŠƒ…[ƒ€EƒŒƒvƒŠƒJ‚̂ݍXV(&U)",IDC_RELSET_NORMAL, + "Button",BS_AUTORADIOBUTTON,31,46,239,10 + CONTROL "‚·‚ׂẴ{ƒŠƒ…[ƒ€EƒŒƒvƒŠƒJ‚ðXV(&A)", + IDC_RELSET_FORCE,"Button",BS_AUTORADIOBUTTON,31,63,239, + 10 +END + +IDD_SVR_HOSTS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + PUSHBUTTON "ƒzƒXƒgEƒT[ƒo[‚̒ljÁ(&A)",IDC_HOST_ADD,10,157,100,14 + PUSHBUTTON "ƒzƒXƒgEƒT[ƒo[‚̍폜(&R)",IDC_HOST_REMOVE,115,157,100, + 14 + LTEXT "ƒT[ƒo[‚ª”Fޝ‚·‚éƒf[ƒ^ƒx[ƒXEƒzƒXƒgEƒT[ƒo[:", + IDC_HOST_TITLE,5,7,216,13 + CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,26,216, + 126,WS_EX_CLIENTEDGE +END + +IDD_SVR_ADDHOST DIALOGEX 0, 0, 307, 107 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "ƒzƒXƒgEƒT[ƒo[‚̒ljÁ" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒzƒXƒg(&H):",-1,31,61,42,8 + EDITTEXT IDC_ADDHOST_HOST,81,59,103,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "—¹‰ð",IDOK,60,85,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,114,85,50,14 + ICON IDI_SERVER,-1,4,4,20,20 + LTEXT "ƒf[ƒ^ƒx[ƒXEƒzƒXƒgEƒT[ƒo[‚ðƒT[ƒo[ %1 ‚ɕۊǂ³‚ꂽƒŠƒXƒg‚ɒljÁ‚·‚邱‚Æ‚ð‘I‘ð‚µ‚Ü‚µ‚½B\n\nV‚µ‚¢ƒf[ƒ^ƒx[ƒXEƒzƒXƒg‚Ì–¼‘O‚ð‰º‚É“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B", + IDC_ADDHOST_DESC,31,5,268,42 + PUSHBUTTON "ƒwƒ‹ƒv",9,168,85,50,14 +END + +IDD_SVR_ADDRESS DIALOGEX 0, 0, 211, 115 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "ƒT[ƒo[EƒAƒhƒŒƒX‚̕ύX" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒT[ƒo[ %1 ‚Ì VLDB ‚É‹L˜^‚³‚ꂽ IP ƒAƒhƒŒƒX:", + IDC_TITLE,4,2,200,16 + LISTBOX IDC_SVR_ADDRESSES,4,23,147,40,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "•ύX(&C)...",IDC_ADDR_CHANGE,152,33,50,14 + PUSHBUTTON "íœ(&R)",IDC_ADDR_REMOVE,152,49,50,14 + DEFPUSHBUTTON "—¹‰ð",IDOK,43,95,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,97,95,50,14 + PUSHBUTTON "ƒwƒ‹ƒv",9,151,95,50,14 + LTEXT "’: ƒtƒ@ƒCƒ‹EƒT[ƒo[‚ÍŽn“®Žž‚ɁAŽ©“®“I‚É‚»‚ÌŒ»s IP ƒAƒhƒŒƒX‚ð VLDB ‚É“o˜^‚µ‚Ü‚·B", + IDC_STATIC,4,71,200,18 +END + +IDD_SVR_NEWADDR DIALOGEX 0, 0, 233, 69 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "IP ƒAƒhƒŒƒX‚̕ύX" +CLASS "AFSManagerClass" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + DEFPUSHBUTTON "—¹‰ð",IDOK,66,48,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,120,48,50,14 + PUSHBUTTON "ƒwƒ‹ƒv",9,174,48,50,14 + LTEXT "VLDB ‚Ì %1 ‚ð’u‚«Š·‚¦‚éV‹K IP ƒAƒhƒŒƒX‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢:", + IDC_TITLE,8,6,220,15 + CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,52,27, + 168,14 + LTEXT "ƒAƒhƒŒƒX:",IDC_STATIC,9,30,34,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" +32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" +32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" +IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" +IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" +IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" +IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" +IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" +IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" +IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" +IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" +IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" +IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" +IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" +IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" +IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" +IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" +IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +ACCEL_MAIN ACCELERATORS DISCARDABLE +BEGIN + VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT + VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT + VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT + VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT + VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT + VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT + VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT + VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, + NOINVERT + VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// AVI +// + +AVI_SETMOVE AVI DISCARDABLE "Resource\\setmove.avi" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_LISTS_TITLE "ƒT[ƒo[ %1 - ŠÇ—ƒŠƒXƒg" + IDS_TAB_SERVICES "ƒT[ƒrƒX" + IDS_TAB_AGGREGATES "ƒp[ƒeƒBƒVƒ‡ƒ“" + IDS_TAB_FILESETS "ƒ{ƒŠƒ…[ƒ€" + IDS_SERVICE_NONESELECTED "•\ަ‚·‚éƒT[ƒo[‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_SERVICE_GOTSELECTED "ƒT[ƒo[ %1 ‚̃T[ƒrƒXEƒvƒƒZƒX:" + IDS_AGGREGATE_ALL "‚·‚ׂẴT[ƒo[‚̃p[ƒeƒBƒVƒ‡ƒ“:" + IDS_AGGREGATE_ONE "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“:" + IDS_FILESET_ALL "ƒZƒ‹ %1 ‚Ì‚·‚ׂẴ{ƒŠƒ…[ƒ€:" + IDS_FILESET_ONE "ƒT[ƒo[ %1 ‚̃{ƒŠƒ…[ƒ€:" + IDS_SVR_LISTS_TAB "ŠÇ—ƒŠƒXƒg" + IDS_SVR_PROP_TITLE "ƒT[ƒo[ %1 - ƒvƒƒpƒeƒB[" + IDS_SVR_GENERAL_TAB "ˆê”Ê" + IDS_SVR_SCOUT_TAB "Ý’è" + IDS_SERVER_TITLE "ƒT[ƒo[ %1 - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_DESC "ƒZƒ‹ %2 ‚̃T[ƒo[ %1:" + IDS_SVC_PROP_TITLE "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 - ƒvƒƒpƒeƒB[" + IDS_SVC_GENERAL_TAB "ˆê”Ê" + IDS_SVC_ADD_TITLE "ƒT[ƒrƒX‚̍쐬" + IDS_SVC_ADD_TAB "ƒT[ƒrƒX‚̍쐬" + IDS_AGG_PROP_TITLE "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 - ƒvƒƒpƒeƒB[" + IDS_AGG_GENERAL_TAB "ˆê”Ê" + IDS_SET_REP_TITLE "ƒ{ƒŠƒ…[ƒ€ %1 - ƒŒƒvƒŠƒJ" + IDS_SET_REPSITES_TAB "•¡»ƒTƒCƒg" + IDS_SET_PROP_TITLE "ƒ{ƒŠƒ…[ƒ€ %1 - ƒvƒƒpƒeƒB[" + IDS_SET_GENERAL_TAB "ˆê”Ê" + IDS_SET_UNLOCKBTN "‘¦ŽžƒƒbƒN‰ðœ(&L)" + IDS_SET_LOCKBTN "‘¦ŽžƒƒbƒN(&L)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_USAGE_FILESET "%2 Š„‚è“–‚Ä—Ê‚Ì %1 ‚ðŽg—p (%3%%)" + IDS_USAGE_AGGREGATE "%2 —e—Ê‚Ì %1 ‚ðŽg—p (%3%%)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGCOL_ALLOCATED "Œ‹‡Š„‚è“–‚Ä—Ê" + IDS_SVRCOL_NAME "ƒT[ƒo[" + IDS_SVRCOL_STATUS "ó‹µ" + IDS_SETCOL_DATE_ACCESS "ÅIƒAƒNƒZƒX" + IDS_SETCOL_DATE_BACKUP "ÅIƒoƒbƒNƒAƒbƒv" + IDS_SVCCOL_NAME "ƒT[ƒrƒX" + IDS_SVCCOL_TYPE "ƒ^ƒCƒv" + IDS_SVCCOL_PARAMS "ƒpƒ‰ƒ[ƒ^[" + IDS_SVCCOL_STATUS "ó‹µ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_DATE_START "ÅIŠJŽn" + IDS_SVCCOL_DATE_STOP "ÅI’âŽ~" + IDS_SVCCOL_DATE_STARTSTOP "ÅIŠJŽn/’âŽ~" + IDS_SVCCOL_DATE_FAILED "ÅIáŠQ" + IDS_SVCCOL_LASTERROR "ÅII—¹ƒR[ƒh" + IDS_AGGCOL_NAME "ƒp[ƒeƒBƒVƒ‡ƒ“" + IDS_AGGCOL_ID "ID" + IDS_AGGCOL_DEVICE "‘•’u" + IDS_AGGCOL_USED "Žg—p—Ê" + IDS_AGGCOL_USED_PER "Žg—p—¦ (%)" + IDS_AGGCOL_FREE "‹ó‚«" + IDS_AGGCOL_TOTAL "—e—Ê" + IDS_AGGCOL_STATUS "ó‹µ" + IDS_SETCOL_NAME "ƒ{ƒŠƒ…[ƒ€" + IDS_SETCOL_TYPE "ƒ^ƒCƒv" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETCOL_DATE_CREATE "ì¬" + IDS_SETCOL_DATE_UPDATE "ÅIXV" + IDS_SETCOL_STATUS "ó‹µ" + IDS_SETCOL_QUOTA_USED "Žg—p—Ê" + IDS_SETCOL_QUOTA_USED_PER "Žg—p—¦ (%)" + IDS_SETCOL_QUOTA_FREE "‹ó‚«" + IDS_SETCOL_QUOTA_TOTAL "Š„‚è“–‚Ä—Ê" + IDS_TRYAGAINBTN "ÄŽŽs(&A)" + IDS_NO_CELL_SELECTED "(ƒZƒ‹‚ªŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ)" + IDS_NO_AFS_ID "(Žg—p‰Â”\‚ȃg[ƒNƒ“‚ª‚ ‚è‚Ü‚¹‚ñ)" + IDS_AFS_ID_WILLEXP "%1 (ƒg[ƒNƒ“‚ÌŠúŒÀ‚ª %2 ‚ɐ؂ê‚Ü‚·)" + IDS_ELAPSED_TIME "%1" + IDS_SEARCHING_FOR_SERVERS + "‚¨‘Ò‚¿‚­‚¾‚³‚¢BƒZƒ‹ %1 ‚ÉŠÖ‚·‚éî•ñ‚ðŽæ“¾’†‚Å‚·..." + IDS_STATUS_NOALERTS "•W€" + IDS_TITLE_BROWSE_USER "ƒ†[ƒU[‚Ì‘I‘ð" + IDS_AGGTYPE_OTHER "•s–¾ (%1)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATEFILESET "ƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2 ‚Ƀ{ƒŠƒ…[ƒ€ %3 ‚ðì¬" + IDS_ACTION_DELETEFILESET "ƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2 ‚©‚çƒ{ƒŠƒ…[ƒ€ %3 ‚ðíœ" + IDS_ACTION_MOVEFILESET "ƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2 ‚Öƒ{ƒŠƒ…[ƒ€ %3 ‚ðˆÚ“®" + IDS_ACTION_SETFILESETQUOTA "ƒ{ƒŠƒ…[ƒ€ %3 ‚ÌŠ„‚è“–‚Ä—Ê‚ð•ύX" + IDS_SVCSTOP_DESC2 "‚±‚̃T[ƒrƒX‚ð’âŽ~‚·‚é‚ɂ́u—¹‰ðv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_SVCSTART_DESC2 "‚±‚̃T[ƒrƒX‚ðŠJŽn‚·‚é‚ɂ́u—¹‰ðv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_SYNCVLDB_SVR_DESC "’ˆÓ!\n\n‘±s‚·‚邯AAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚̓T[ƒo[ %1 ‚Ì‚·‚ׂẴp[ƒeƒBƒVƒ‡ƒ“‚Ì“à—e‚Ɉê’v‚·‚邿‚¤‚É VLDB ‚ð•ύX‚µ‚Ü‚·B" + IDS_SYNCVLDB_SVR_DESC2 "VLDB ‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“‚ÉŒ»Ýƒ{ƒŠƒ…[ƒ€‚ªŒ©‚‚©‚ç‚È‚¢‚±‚Æ‚ð’Ê’m‚µ‚½ê‡A‚»‚̃{ƒŠƒ…[ƒ€‚Ì VLDB €–ڂ͍폜‚³‚ê‚Ü‚·!" + IDS_SYNCVLDB_AGG_DESC "’ˆÓ!\n\n‘±s‚·‚邯AAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚̓T[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ì“à—e‚Ɉê’v‚·‚邿‚¤‚É VLDB ‚ð•ύX‚µ‚Ü‚·B" + IDS_SYNCVLDB_AGG_DESC2 "VLDB ‚ª‚±‚̃p[ƒeƒBƒVƒ‡ƒ“‚ÉŒ»Ýƒ{ƒŠƒ…[ƒ€‚ªŒ©‚‚©‚ç‚È‚¢‚±‚Æ‚ð’Ê’m‚µ‚½ê‡A‚»‚̃{ƒŠƒ…[ƒ€‚Ì VLDB €–ڂ͍폜‚³‚ê‚Ü‚·!" + IDS_PROMPT_BROWSE_USER "ƒ†[ƒU[:" + IDS_PREVIEWIN_BUTTON "<< ƒvƒŠƒrƒ…[(&P)" + IDS_PREVIEWOUT_BUTTON "ƒvƒŠƒrƒ…[(&P) >>" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ADMCOL_TYPE_USER "ƒ†[ƒU[" + IDS_TITLE_BROWSE_PRINCIPAL "ƒvƒŠƒ“ƒVƒpƒ‹‚Ì‘I‘ð" + IDS_TITLE_BROWSE_OWNGROUP "Š—LƒOƒ‹[ƒv‚Ì‘I‘ð" + IDS_PROMPT_BROWSE_PRINCIPAL "ƒvƒŠƒ“ƒVƒpƒ‹:" + IDS_PROMPT_BROWSE_OWNGROUP "Š—LƒOƒ‹[ƒv:" + IDS_ACTION_CLONE "ƒ{ƒŠƒ…[ƒ€ %3 ‚̃oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚ðì¬’†" + IDS_ACTION_CLONESYS "•¡”‚̃{ƒŠƒ…[ƒ€EƒoƒbƒNƒAƒbƒv‚ðì¬’†" + IDS_CLONESYS_FAILED "ƒGƒ‰[ 0x%2 ‚Ì‚½‚߁Aƒ{ƒŠƒ…[ƒ€ %1 ‚̃oƒbƒNƒAƒbƒv‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½ (%3)B" + IDS_SET_UNSPECIFIED "(–¢Žw’è)" + IDS_SETCOL_ID "ID" + IDS_SETCOL_FILES "ƒtƒ@ƒCƒ‹EƒJƒEƒ“ƒg" + IDS_SET_DUMP_NAME "%1.DMP ‚̃_ƒ“ƒv" + IDS_ACTION_DUMP "ƒ{ƒŠƒ…[ƒ€ %3 ‚̃_ƒ“ƒv’† (ƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FILESETNAME_ERROR "%1 - %2" + IDS_SETCOL_AGGREGATE "ƒp[ƒeƒBƒVƒ‡ƒ“" + IDS_REFRESH_DESC_CELL "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ª %1 ƒZƒ‹“à‚̃T[ƒo[‚̏󋵂𔻕ʒ†‚Å‚·B‚µ‚Î‚ç‚­ŽžŠÔ‚ª‚©‚©‚è‚Ü‚·..." + IDS_REFRESH_DESC_SERVER "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̏󋵂𔻕ʒ†‚Å‚·B‚µ‚Î‚ç‚­ŽžŠÔ‚ª‚©‚©‚è‚Ü‚·..." + IDS_REFRESH_CURRENT_CELL "Œ»ÝŒŸ¸’†: ƒZƒ‹ %1" + IDS_REFRESH_CURRENT_SERVER "Œ»ÝŒŸ¸’†: ƒT[ƒo[ %2" + IDS_REFRESH_CURRENT_AGGREGATE + "Œ»ÝŒŸ¸’†: ƒT[ƒo[ %2 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %3" + IDS_REFRESH_CURRENT_FILESET + "Œ»ÝŒŸ¸’†: ƒT[ƒo[ %2 ‚̃{ƒŠƒ…[ƒ€ %4Aƒp[ƒeƒBƒVƒ‡ƒ“ %3" + IDS_REFRESH_CURRENT_SERVICE "Œ»ÝŒŸ¸’†: ƒT[ƒo[ %2 ‚̃T[ƒrƒX %3" + IDS_REFRESH_PERCENT "%1%% Š®—¹" + IDS_PROBLEMS "–â‘è" + IDS_SERVER_NO_PROBLEMS "‚±‚̃T[ƒo[‚ɂ͊ù’m‚Ì–â‘è‚Í‚ ‚è‚Ü‚¹‚ñB" + IDS_SERVICE_NO_PROBLEMS "‚±‚̃T[ƒrƒX‚ɂ͊ù’m‚Ì–â‘è‚Í‚ ‚è‚Ü‚¹‚ñB" + IDS_AGGREGATE_NO_PROBLEMS "‚±‚̃p[ƒeƒBƒVƒ‡ƒ“‚ɂ͊ù’m‚Ì–â‘è‚Í‚ ‚è‚Ü‚¹‚ñB" + IDS_FILESET_NO_PROBLEMS "‚±‚̃{ƒŠƒ…[ƒ€‚ɂ͊ù’m‚Ì–â‘è‚Í‚ ‚è‚Ü‚¹‚ñB" + IDS_AGGTYPE_TYPE1 "UFS" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGTYPE_TYPE2 "LFS" + IDS_AGGTYPE_TYPE3 "AIX" + IDS_AGGTYPE_TYPE4 "VXFS" + IDS_AGGTYPE_TYPE5 "DMEPI" + IDS_REFRESH_CURRENT_VLDB + "Œ»ÝŒŸ¸’†: ƒ{ƒŠƒ…[ƒ€EƒƒP[ƒVƒ‡ƒ“Eƒf[ƒ^ƒx[ƒX(VLDB)" + IDS_FILESETTYPE_RW "“ǂݎæ‚è/‘‚«ž‚Ý" + IDS_FILESETTYPE_RO "ƒŒƒvƒŠƒJ" + IDS_FILESETTYPE_CLONE "ƒoƒbƒNƒAƒbƒv" + IDS_MOVESET_READWRITE "‘±s‚·‚邯Aƒ{ƒŠƒ…[ƒ€ %3 ‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚©‚瑼‚̏ꏊ‚ÖˆÚ“®‚³‚ê‚Ü‚·B" + IDS_MOVESET_READONLY "‘±s‚·‚邯Aƒ{ƒŠƒ…[ƒ€EƒŒƒvƒŠƒJ %3 ‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 A‚¨‚æ‚шȉº‚ÉŽw’肵‚½ƒp[ƒeƒBƒVƒ‡ƒ“ã‚ɍ쐬‚³‚ꂽ•ʂ̃{ƒŠƒ…[ƒ€EƒŒƒvƒŠƒJ‚©‚çíœ‚³‚ê‚Ü‚·B" + IDS_SVC_START_TITLE "ƒT[ƒrƒX‚ÌŠJŽn" + IDS_SVC_STOP_TITLE "ƒT[ƒrƒX‚Ì’âŽ~" + IDS_SERVICESTATUS_STARTING "‚±‚̃T[ƒrƒX‚ÍŒ»ÝŠJŽn’†‚Å‚·B" + IDS_SERVICESTATUS_RUNNING "‚±‚̃T[ƒrƒX‚ÍŒ»ÝŽÀs’†‚Å‚·B" + IDS_SERVICESTATUS_STOPPED "‚±‚̃T[ƒrƒX‚ÍŒ»Ý’âŽ~‚³‚ê‚Ä‚¢‚Ü‚·B" + IDS_SERVICESTATUS_STOPPING "‚±‚̃T[ƒrƒX‚ÍŒ»Ý’âŽ~’†‚Å‚·B" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICESTATUS_UNKNOWN "‚±‚̃T[ƒrƒX‚̏󋵂͕s–¾‚Å‚·B" + IDS_SVC_RESTART_BUTTON "‘¦Žž’âŽ~‚¨‚æ‚эĎn“®(&R)" + IDS_PROBLEM_BOX "Šù’m‚Ì–â‘è (%1)" + IDS_VIEWLOG_DESC_NOFILE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚̃ƒOEƒtƒ@ƒCƒ‹‚ðŒ©‚Â‚¯‚ç‚ê‚Ü‚¹‚ñ‚Å‚µ‚½BƒT[ƒrƒX‚̃ƒOEƒtƒ@ƒCƒ‹‚Ì‘SƒpƒX‚ð‰º‚É“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_NO_GROUP "(Š—LƒOƒ‹[ƒv‚È‚µ)" + IDS_VIEWLOG_FROMSERVER "ƒT[ƒo[ %1 ‚̃ƒOEƒtƒ@ƒCƒ‹" + IDS_VIEWLOG_FROMSERVICE "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ƒƒOEƒtƒ@ƒCƒ‹" + IDS_VIEWLOG_TRUNCATED "ƒtƒ@ƒCƒ‹‚Ì“à—e (ÅŒã‚Ì %1 s‚̂ݕ\ަ):" + IDS_SAVELOG_FILTER "ƒeƒLƒXƒgEƒtƒ@ƒCƒ‹|*.TXT|" + IDS_ADVANCEDIN_BUTTON "<< Šg’£(&A)" + IDS_ADVANCEDOUT_BUTTON "Šg’£(&A) >>" + IDS_REPTYPE_RELEASE "ƒŠƒŠ[ƒX•¡»" + IDS_REPTYPE_SCHEDULED "ƒXƒPƒWƒ…[ƒ‹•¡»" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_UPDATEALL_BUTTON "‚·‚ׂčXV(&U)" + IDS_UPDATETHIS_BUTTON "XV(&U)" + IDS_SERVER_MULTIPLE_PROBLEMS "‚±‚̃T[ƒo[‚É‚Í %1 ‚ÌŠù’m–â‘肪‚ ‚è‚Ü‚·B" + IDS_SERVICE_MULTIPLE_PROBLEMS "‚±‚̃T[ƒrƒX‚É‚Í %1 ‚ÌŠù’m–â‘肪‚ ‚è‚Ü‚·B" + IDS_AGGREGATE_MULTIPLE_PROBLEMS + "‚±‚̃p[ƒeƒBƒVƒ‡ƒ“‚É‚Í %1 ‚ÌŠù’m–â‘肪‚ ‚è‚Ü‚·B" + IDS_FILESET_MULTIPLE_PROBLEMS + "‚±‚̃{ƒŠƒ…[ƒ€‚É‚Í %1 ‚ÌŠù’m–â‘肪‚ ‚è‚Ü‚·B" + IDS_FILESETTYPE_RO_STAGE "ƒŒƒvƒŠƒJ" + IDS_SERVICETYPE_SIMPLE_LONG "ƒVƒ“ƒvƒ‹ (˜A‘±‚µ‚ÄŽÀs)" + IDS_SERVICETYPE_CRON_LONG "Cron (Žw’è‚ÌŠÔŠu‚ÅŽÀs)" + IDS_QUOTAUNITS_KB "kb" + IDS_QUOTAUNITS_MB "MB" + IDS_NO_QUOTA_REPLICA "(‚±‚̃{ƒŠƒ…[ƒ€‚̓ŒƒvƒŠƒJ‚Ì‚½‚߁AŠ„‚è“–‚Ä—Ê‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñ)" + IDS_NO_QUOTA_CLONE "(‚±‚̃{ƒŠƒ…[ƒ€‚̓oƒbƒNƒAƒbƒv‚Ì‚½‚߁AŠ„‚è“–‚Ä—Ê‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñ)" + IDS_USAGE_REPLICA "%1 Žg—p" + IDS_USAGE_CLONE "%1 Žg—p" + IDS_COL_AGGS_MOVE "ƒ{ƒŠƒ…[ƒ€ì¬Žž‚̃p[ƒeƒBƒVƒ‡ƒ“" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PERCENTAGE "%1 %%" + IDS_AGGREGATES_IN_SERVER "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“:" + IDS_AGGREGATES_IN_CELL "ƒZƒ‹ %1 ‚Ì‚·‚ׂẴp[ƒeƒBƒVƒ‡ƒ“:" + IDS_AGGREGATES_IN_NOTHING "ƒp[ƒeƒBƒVƒ‡ƒ“:" + IDS_FILESETS_IN_SERVER "ƒT[ƒo[ %1 ‚̃{ƒŠƒ…[ƒ€:" + IDS_FILESETS_IN_CELL "ƒZƒ‹ %1 ‚Ì‚·‚ׂẴ{ƒŠƒ…[ƒ€:" + IDS_FILESETS_IN_NOTHING "ƒ{ƒŠƒ…[ƒ€:" + IDS_SERVICES_IN_SERVER "ƒT[ƒo[ %1 ‚̃T[ƒrƒX:" + IDS_SERVICES_IN_NOTHING "ƒT[ƒrƒX:" + IDS_UNKNOWN "(•s–¾)" + IDS_UNKNOWN_GROUP "ƒOƒ‹[ƒv #%1 (–¼‘O‚Í•s–¾)" + IDS_AGGFULL_WARN_OFF "ƒfƒtƒHƒ‹ƒg‚µ‚«‚¢’l (Œx‚̓T[ƒo[‚ÅŽg—p•s‰Â)" + IDS_SERVER_AGGREGATE "%1:%2" + IDS_SERVERNAME_ERROR "%1 - %2" + IDS_AGGREGATENAME_ERROR "%1 - %2" + IDS_SETFULL_WARN_OFF "ƒfƒtƒHƒ‹ƒg‚µ‚«‚¢’l (Œx‚̓T[ƒo[‚ÅŽg—p•s‰Â)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_LASTERRORDATE "%1 - I—¹ƒR[ƒh %2" + IDS_COL_SERVERS "ƒZƒ‹‚̃T[ƒo[" + IDS_COL_FILESETS "ƒT[ƒo[‚̃{ƒŠƒ…[ƒ€" + IDS_COL_AGGREGATES "ƒT[ƒo[‚̃p[ƒeƒBƒVƒ‡ƒ“" + IDS_COL_SERVICES "ƒT[ƒo[‚̃T[ƒrƒX" + IDS_COL_REPLICAS "ƒ{ƒŠƒ…[ƒ€‚̃ŒƒvƒŠƒJ" + IDS_COLUMNS_TITLE "•\ަ—ñ‚Ì‘I‘ð - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" + IDS_REPCOL_SERVER "ƒT[ƒo[" + IDS_REPCOL_AGGREGATE "ƒp[ƒeƒBƒVƒ‡ƒ“" + IDS_REPCOL_DATE_UPDATE "ÅIXV" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COL_AGGS_CREATE "ƒ{ƒŠƒ…[ƒ€ˆÚ“®Žž‚̃p[ƒeƒBƒVƒ‡ƒ“" + IDS_WARN_TITLE "’ˆÓ" + IDS_WARN_DISABLE_AUTH "u–¢”FØ‚ð‹–‰Âvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚·‚邯A–¢”FØ‚̃vƒŠƒ“ƒVƒpƒ‹‚ª‚±‚̃T[ƒo[‚̃T[ƒrƒX‚𑀍삷‚邱‚Æ‚ª‰Â”\‚ɂȂè‚Ü‚·Bƒ‹[ƒg ID ‚̉º‚ł͐”‘½‚­‚̃T[ƒrƒX‚ªŽÀs‚³‚ê‚Ä‚¢‚邽‚߁A‚±‚̃AƒNƒVƒ‡ƒ“‚Í+" + IDS_WARN_DISABLE_AUTH2 "ƒT[ƒo[‚̃ZƒLƒ…ƒŠƒeƒB[‚ɏd‘å‚ÈŒ‡Š×‚ð‚à‚½‚炵‚Ü‚·B\n\n‚±‚̕ύX‚ðs‚Á‚Ä‚à‚¢‚¢‚Å‚·‚©?" + IDS_SVR_NO_ADDR "(–¢Žw’è)" + IDS_TITLE_BAD_CELL "”Fޝ‚³‚ê‚Ä‚¢‚È‚¢ƒZƒ‹–¼" + IDS_DESC_BAD_CELL "“ü—Í‚µ‚½ƒZƒ‹–¼‚ªƒlƒbƒgƒ[ƒNã‚ÉŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B\n\n“ü—Í‚ª³‚µ‚¢‚©‚Ç‚¤‚©‚ð‚à‚¤ˆê“xŠm”F‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_AGGFULL_WARN_ON "‚±‚̃T[ƒo[‚̃fƒtƒHƒ‹ƒg‚µ‚«‚¢’l(&D) (ƒTƒCƒY‚Ì %1%%)" + IDS_SETFULL_WARN_ON "‚±‚̃T[ƒo[‚̃fƒtƒHƒ‹ƒg‚µ‚«‚¢’l(&D) (ƒTƒCƒY‚Ì %1%%)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_ERROR_BAD_CREDENTIALS + "“ü—Í‚µ‚½ AFS ID ‚ª”Fޝ‚³‚ê‚È‚¢‚©A‚Ü‚½‚ÍŽw’肵‚½ƒpƒXƒ[ƒh‚ª³‚µ‚­‚ ‚è‚Ü‚¹‚ñB" + IDS_SVR_CREDS_NONE "(ƒg[ƒNƒ“‚È‚µ)" + IDS_SVR_CREDS_VALID "%2, ŠúŒÀØ‚ê %3" + IDS_SVR_CREDS_EXPIRED "(ƒg[ƒNƒ“‚ªŠúŒÀØ‚ê %3)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGG_FILESETS "%1 (Œ‹‡Š„‚è“–‚Ä—Ê: %2)" + IDS_ACTION_DESC_NONE "is’†‚Ì‘€ì‚Í‚ ‚è‚Ü‚¹‚ñB" + IDS_ACTION_DESC_ONE "ŽŸ‚Ì‘€ì‚ªŒ»Ýis’†‚Å‚·:" + IDS_ACTION_DESC_MULT "ŽŸ‚Ì‘€ì‚ªŒ»Ýis’†‚Å‚·:" + IDS_ACTCOL_OPERATION "‘€ì" + IDS_ACTCOL_ELAPSED "Œo‰ßŽžŠÔ" + IDS_ACTION_REFRESH "ƒZƒ‹î•ñ‚̍ŐV•\ަ’†" + IDS_ACTION_CREATESERVER "ƒT[ƒo[ %1 ‚̍쐬’†" + IDS_ACTION_DELETESERVER "ƒT[ƒo[ %1 ‚̍폜’†" + IDS_ACTION_GETSERVERLOGFILE "ƒƒOEƒtƒ@ƒCƒ‹ %2 ‚ðƒT[ƒo[ %1 ‚©‚çŽæ“¾’†" + IDS_ACTION_SETSERVERAUTH "ƒT[ƒo[ %1 ‚̃AƒNƒZƒX§ŒÀ‚ð•ύX’†" + IDS_ACTION_CHANGESERVERSTATUS "ƒT[ƒo[ %1 ‚̃vƒƒpƒeƒB[‚ð•ύX’†" + IDS_ACTION_STARTSERVICE "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ðŠJŽn’†" + IDS_ACTION_STOPSERVICE "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ð’âŽ~’†" + IDS_ACTION_RESTARTSERVICE "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ðÄŽn“®’†" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SYNCVLDB_SVR "VLDB ‚ðƒT[ƒo[ %1 ‚Æ“¯Šú‰»’†" + IDS_ACTION_SYNCVLDB_AGG "VLDB ‚ðƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2 ‚Æ“¯Šú‰»’†" + IDS_ACTION_SCOUT "ƒT[ƒo[ %1 ‚Ì–â‘è‚ðŒŸ¸’†" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SETREPPARAMS "ƒ{ƒŠƒ…[ƒ€ %3 ‚Ì•¡»ƒvƒƒpƒeƒB[‚ð•ύX’†" + IDS_ACTION_CREATEREPLICA + "ƒp[ƒeƒBƒVƒ‡ƒ“ %1:%2 ‚Ƀ{ƒŠƒ…[ƒ€ %3 ‚̃ŒƒvƒŠƒJ‚ðì¬’†" + IDS_DELSET_REPLICA_DESC "’ˆÓ!\n\n‘±s‚·‚邯AƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€ %3 ‚̃ŒƒvƒŠƒJ‚ªíœ‚³‚ê‚Ü‚·B" + IDS_DELSET_CLONE_DESC "’ˆÓ!\n\n‘±s‚·‚邯Aƒ{ƒŠƒ…[ƒ€EƒoƒbƒNƒAƒbƒv %3 ‚ªƒT[ƒo[ %1‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚©‚çíœ‚³‚ê‚Ü‚·B" + IDS_INSTALL_DESC1 "‚±‚Ì‘€ì‚́Aƒtƒ@ƒCƒ‹‚ð‚±‚ÌƒRƒ“ƒsƒ…[ƒ^[‚©‚瑼‚ÖƒRƒs[‚µ‚Ü‚·B+" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_INSTALL_DESC2 "ƒtƒ@ƒCƒ‹‚ª‚·‚łɃRƒs[æ‚̃Rƒ“ƒsƒ…[ƒ^[‚É‘¶Ý‚·‚éê‡‚́A‚»‚̃tƒ@ƒCƒ‹‚̓oƒbƒNƒAƒbƒv‚³‚êA.BAK Šg’£Žq‚ª•t‚¯‚ç‚ê‚Ü‚·BŠù‘¶‚̃oƒbƒNƒAƒbƒv‚É‚Í .OLD Šg’£Žq‚ª•t‚¯‚ç‚êAŠù‘¶‚Ì .OLD ƒtƒ@ƒCƒ‹‚͍폜‚³‚ê‚Ü‚·B" + IDS_ACTION_INSTALLFILE "ƒT[ƒo[ %1 ‚Ƀtƒ@ƒCƒ‹ %2 ‚ðƒCƒ“ƒXƒg[ƒ‹’†" + IDS_ACTION_UNINSTALLFILE + "ƒT[ƒo[ %1 ‚©‚çƒtƒ@ƒCƒ‹ %2 ‚ðƒAƒ“ƒCƒ“ƒXƒg[ƒ‹’†" + IDS_ACTION_PRUNEFILES "ƒT[ƒo[ %1 ‚©‚çƒtƒ@ƒCƒ‹‚ðíœ’†" + IDS_FILTER_ALLFILES "‚·‚ׂẴtƒ@ƒCƒ‹|*.*|" + IDS_ACTION_RENAMEFILESET "ƒ{ƒŠƒ…[ƒ€ %1 ‚ð %2 ‚É–¼‘O•ύX’†" + IDS_RECUR_DAILY "–ˆ“ú" + IDS_RECUR_SUNDAY "–ˆ“ú—j“ú" + IDS_RECUR_MONDAY "–ˆŒŽ—j“ú" + IDS_RECUR_TUESDAY "–ˆ‰Î—j“ú" + IDS_RECUR_WEDNESDAY "–ˆ…—j“ú" + IDS_RECUR_THURSDAY "–ˆ–Ø—j“ú" + IDS_RECUR_FRIDAY "–ˆ‹à—j“ú" + IDS_RECUR_SATURDAY "–ˆ“y—j“ú" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATESERVICE "ƒT[ƒo[ %1 ‚ɃT[ƒrƒX %2 ‚ðì¬’†" + IDS_ACTION_DELETESERVICE "ƒT[ƒo[ %1 ‚©‚çƒT[ƒrƒX %2 ‚ðíœ’†" + IDS_ACTION_RELEASEFILESET "ƒ{ƒŠƒ…[ƒ€ %3 ‚ð‰ð•ú’†" + IDS_ACTION_GETDATES "ƒT[ƒo[ %1 ‚̃tƒ@ƒCƒ‹ %2 ‚Ì“ú•t‚ðŽæ“¾’†" + IDS_LASTMODIFIED "ÅI•ύX %1" + IDS_SVR_SECURITY_TITLE "ƒT[ƒo[EƒZƒLƒ…ƒŠƒeƒB[ - %1" + IDS_SVR_LIST_TAB "ŠÇ—ŽÒ" + IDS_ACTION_ADMINLIST_LOAD "ƒT[ƒo[ %1 ‚ÌŠÇ—ŽÒ‚ðŽæ“¾’†" + IDS_ACTION_ADMINLIST_SAVE "ƒT[ƒo[ %1 ‚ÌŠÇ—ŽÒ‚ð‘‚«ž‚Ý’†" + IDS_ADMCOL_PRINCIPAL "ƒƒ“ƒo[" + IDS_ADMCOL_TYPE "ƒ^ƒCƒv" + IDS_ADMCOL_TYPE_GROUP "ƒOƒ‹[ƒv" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_RESTORE "ƒ{ƒŠƒ…[ƒ€ %1 ‚Ì•œŒ³’†" + IDS_COL_AGGS_RESTORE "ƒ{ƒŠƒ…[ƒ€•œŒ³Žž‚̃p[ƒeƒBƒVƒ‡ƒ“" + IDS_RESTORE_FILTER "ƒ{ƒŠƒ…[ƒ€Eƒ_ƒ“ƒvEƒtƒ@ƒCƒ‹|*.DMP|‚·‚ׂẴtƒ@ƒCƒ‹|*.*|" + IDS_SVC_BOS_TAB "BOS" + IDS_ACTION_SETRESTART "ƒT[ƒo[ %1 ‚̃T[ƒrƒXÄŽn“®Žž‚ð•ύX’†" + IDS_RESTORE_CREATESET "‰º‚ÅŽw’肵‚½ƒT[ƒo[‚¨‚æ‚уp[ƒeƒBƒVƒ‡ƒ“‚Ƀ{ƒŠƒ…[ƒ€ %1 ‚ªì¬‚³‚ê‚Ü‚·B" + IDS_RESTORE_OVERWRITESET + "’ˆÓ! ƒ{ƒŠƒ…[ƒ€ %3 ‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚É‘¶Ý‚µ‚Ü‚·B‘±s‚·‚邯ã‘‚«‚³‚ê‚Ü‚·!" + IDS_SUBSET_TITLE_LOAD "ƒT[ƒo[EƒTƒuƒZƒbƒg‚̃I[ƒvƒ“" + IDS_SUBSET_TITLE_SAVE "ƒT[ƒo[EƒTƒuƒZƒbƒg‚̕ۊÇ" + IDS_BUTTON_OPEN "ƒI[ƒvƒ“(&O)" + IDS_BUTTON_SAVE "•ÛŠÇ(&S)" + IDS_SUBSET_SAVE_TITLE "’ˆÓ" + IDS_SUBSET_SAVE_DESC "ƒT[ƒo[EƒTƒuƒZƒbƒg‚Í %1 ‚Ì–¼‘O‚Å‚·‚łɑ¶Ý‚µ‚Ü‚·B\n\n‚±‚̃TƒuƒZƒbƒg‚ðã‘‚«‚µ‚Ü‚·‚©?" + IDS_SUBSET_CHANGED "%1 [•ύXÏ‚Ý]" + IDS_SUBSET_TAB "ƒ‚ƒjƒ^[‚³‚ê‚éƒT[ƒo[" + IDS_SUBSET_DISCARD_TITLE "ƒTƒuƒZƒbƒg‚ð•ÛŠÇ‚µ‚Ü‚·‚©?" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SUBSET_DISCARD_DESC "Œ»Ýƒ‚ƒjƒ^[‚³‚ê‚Ä‚¢‚éƒT[ƒo[‚ÌƒŠƒXƒg‚ðƒTƒuƒZƒbƒg‚Æ‚µ‚ĕۊǂµ‚Ä‚¢‚Ü‚¹‚ñB‚±‚ÌƒŠƒXƒg‚ð•ÛŠÇ‚·‚邯AŒã‚Å‚±‚ê‚ðŽg—p‚µ‚ăT[ƒo[‚̂邱‚ê‚Æ“¯‚¶ƒZƒbƒg‚̃‚ƒjƒ^[‚𑱂¯‚邱‚Æ‚ª‚Å‚«‚Ü‚·B\n\n+" + IDS_SUBSET_DISCARD_DESC2 + "Œ»Ýƒ‚ƒjƒ^[‚³‚ê‚Ä‚¢‚éƒT[ƒo[‚ÌƒŠƒXƒg‚ðŠÜ‚ÞƒTƒuƒZƒbƒg‚ðì¬‚µ‚Ü‚·‚©?" + IDS_SUBSET_NONAME "(–³‘è)" + IDS_SUBSET_NOSUBSET "(‚·‚ׂẴT[ƒo[‚ªƒ‚ƒjƒ^[‚³‚ê‚Ä‚¢‚Ü‚·)" + IDS_SUBSET_SERVERSUBSET "ƒT[ƒo[ %1" + IDS_FILESET_SOME "ƒZƒ‹ %1 ‚Ń‚ƒjƒ^[‚³‚ê‚Ä‚¢‚é‚·‚ׂẴT[ƒo[‚̃{ƒŠƒ…[ƒ€:" + IDS_AGGREGATE_SOME "ƒZƒ‹ %1 ‚Ń‚ƒjƒ^[‚³‚ê‚Ä‚¢‚é‚·‚ׂẴT[ƒo[‚̃p[ƒeƒBƒVƒ‡ƒ“:" + IDS_SERVICE_SOME "ƒZƒ‹ %1 ‚Ń‚ƒjƒ^[‚³‚ê‚Ä‚¢‚é‚·‚ׂẴT[ƒo[‚̃T[ƒrƒX:" + IDS_FILESET_UNMON "ƒT[ƒo[ %1 ‚̓‚ƒjƒ^[‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ" + IDS_AGGREGATE_UNMON "ƒT[ƒo[ %1 ‚̓‚ƒjƒ^[‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ" + IDS_SERVICE_UNMON "ƒT[ƒo[ %1 ‚̓‚ƒjƒ^[‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ" + IDS_SUBSET_DELETE_TITLE "ƒTƒuƒZƒbƒg‚ðíœ‚µ‚Ü‚·‚©?" + IDS_SUBSET_DELETE_DESC "ƒT[ƒo[EƒTƒuƒZƒbƒg %1 ‚ðíœ‚µ‚Ä‚à‚¢‚¢‚Å‚·‚©?" + IDS_ERROR_TRANSLATED "ƒGƒ‰[”ԍ† 0x%1 (%2):\n\n%3" + IDS_ERROR_NOTTRANSLATED "ƒGƒ‰[”ԍ† 0x%1 (%2) ‚ª”Fޝ‚Å‚«‚Ü‚¹‚ñB" + IDS_FIND_NOTHING_TITLE "ƒRƒ}ƒ“ƒh‚ª‘I‘ð‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FIND_NOTHING_DESC "‘€ì‚ÌŽÀs•û–@‚ɂ‚¢‚ẮAƒŠƒXƒg‚©‚çƒRƒ}ƒ“ƒhs‚ð‘I‘ð‚·‚é‚©AƒL[ƒ[ƒh‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_FIND_UNKNOWN_TITLE "•s–¾‚ȃRƒ}ƒ“ƒh" + IDS_FIND_UNKNOWN_DESC "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚Í ""%1"" ƒRƒ}ƒ“ƒh‚̃wƒ‹ƒvEƒgƒsƒbƒN‚ðŒ©‚Â‚¯‚ç‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_HELPABOUT_DESC1 "Œx: ‚±‚̃Rƒ“ƒsƒ…[ƒ^[EƒvƒƒOƒ‰ƒ€‚́A’˜ìŒ ‚¨‚æ‚э‘Û‹K–ñ‚É‚æ‚è•ی삳‚ê‚Ä‚¢‚Ü‚·B+" + IDS_HELPABOUT_DESC2 "‹–‰Â‚È‚­‚±‚̃\ƒtƒgƒEƒFƒA‚ð•¡ŽÊ‚ ‚é‚¢‚Í”z•z‚·‚邯A–¯Ž–‚Ü‚½‚ÍŒYŽ–ã‚̔ƍ߂ƂȂèA–@—¥‚Ì‚à‚Æ‘i‚³‚ê‚éê‡‚ª‚ ‚è‚Ü‚·B\n\n+" + IDS_HELPABOUT_DESC3 "AFS ‚Í Transarc Corporation (IBM company) ‚̏¤•W‚Å‚·B" + IDS_CANT_QUIT_TITLE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" + IDS_CANT_QUIT_REBOOT "’ˆÓ!\n\nAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÍŒ»Ý‘€ì‚ðŽÀs’†‚Å‚·B‚¢‚Ü Windows ‚ðƒVƒƒƒbƒgƒ_ƒEƒ“‚·‚邯A‚±‚ê‚ç‚Ì‘€ì‚͐³í‚ÉŠ®—¹‚µ‚Ü‚¹‚ñB\n\nWindows ‚ðÄŽn“®‚µ‚Ü‚·‚©?" + IDS_APP_TITLE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" + IDS_ACTION_OPENCELL "%1 ƒZƒ‹“à‚̃T[ƒo[‚ðŒŸõ’†" + IDS_OPTIONS_TITLE "ƒIƒvƒVƒ‡ƒ“ - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" + IDS_OPTIONS_GENERAL_TAB "ˆê”Ê" + IDS_BADCREDS_DESC "ŠÇ—ŽÒ‚Æ‚µ‚ăƒOƒCƒ“‚µ‚È‚¢‚ƁA%1 ƒZƒ‹‚ÌŠÇ—‚ɏ\•ª‚ÈŒ ŒÀ‚ª—^‚¦‚ç‚ê‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·BƒAƒNƒZƒXŒ ŒÀ‚ª\•ª‚łȂ¢‚ƁA–â‘肪‘¶Ý‚µ‚È‚¢‚Æ‚«‚É AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒZƒ‹‚Å–â‘è‚ðŒ©‚Â‚¯‚éê‡‚ª‚ ‚è‚Ü‚·B" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CONFIRMATION_TITLE "Šm”F - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" + IDS_NO_GROUP_CHECKBOX "Š—LƒOƒ‹[ƒv‚È‚µ" + IDS_AFS_ID_DIDEXP "%1 (ƒg[ƒNƒ“‚ÌŠúŒÀ‚ª %2 ‚ɐ؂ê‚Ü‚µ‚½)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_QUERYING "(Æ‰ï’†)" + IDS_ADMCOL_TYPE_FOREIGN_GROUP "ŠO•”ƒOƒ‹[ƒv" + IDS_ADMCOL_TYPE_FOREIGN_USER "ŠO•”ƒ†[ƒU[" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_NOTIFIER "ƒm[ƒeƒBƒtƒ@ƒCƒ„[" + IDS_SVC_NONOTIFIER "(‚È‚µ)" + IDS_SVR_KEY_TAB "ƒT[ƒo[Œ®" + IDS_KEYNAME_NOTIME "ƒT[ƒo[ %1 ‚ÌŒ®:" + IDS_KEYNAME_WITHTIME "ƒT[ƒo[ %1 ‚ÌŒ® (•ύX %2):" + IDS_SVRKEY_VERSION "ƒo[ƒWƒ‡ƒ“" + IDS_SVRKEY_DATA "’l" + IDS_SVRKEY_CHECKSUM "ƒ`ƒFƒbƒNƒTƒ€" + IDS_SVRKEY_DATA_UNKNOWN "(‰B‚·)" + IDS_STARTSERVICE_TITLE "ƒT[ƒrƒX‚ÌŠJŽn" + IDS_STOPSERVICE_TITLE "ƒT[ƒrƒX‚Ì’âŽ~" + IDS_STARTSERVICE_TEXT "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ðŠJŽn‚·‚é‚ɂ́u—¹‰ðv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_STOPSERVICE_TEXT "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ð’âŽ~‚·‚é‚ɂ́u—¹‰ðv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_STARTSERVICE_STARTUP + "‚±‚̕ύX‚͉i‘±“I‚È‚à‚̂ɂ·‚邱‚Æ‚ª‚Å‚«A‚»‚ê‚É‚æ‚Á‚ăT[ƒo[ %1 ‚ªÄŽn“®‚³‚ê‚邯ީ“®“I‚ɃT[ƒrƒX %2 ‚ªŠJŽn‚³‚ê‚Ü‚·B" + IDS_STOPSERVICE_STARTUP "‚±‚̕ύX‚͉i‘±“I‚È‚à‚̂ɂ·‚邱‚Æ‚ª‚Å‚«A‚»‚ê‚É‚æ‚Á‚ăT[ƒo[ %1‚ªÄŽn“®‚³‚ê‚邯ީ“®“I‚ɂ̓T[ƒrƒX %2 ‚ªŠJŽn‚³‚ê‚Ü‚¹‚ñB" + IDS_STARTSERVICE_PERMANENT + "‰i‘±(&P) (ƒT[ƒo[ %1 ‚̍Ďn“®Žž‚ɃT[ƒrƒX %2 ‚ðŠJŽn)" + IDS_STARTSERVICE_TEMPORARY + "ˆêŽž(&T) (ƒT[ƒo[ %1 ‚̍Ďn“®Žž‚ɃT[ƒrƒX %2 ‚ðŠJŽn‚µ‚È‚¢)" + IDS_STOPSERVICE_PERMANENT + "‰i‘±(&P) (ƒT[ƒo[ %1 ‚̍Ďn“®Žž‚ɃT[ƒrƒX %2 ‚ðŠJŽn‚µ‚È‚¢)" + IDS_STOPSERVICE_TEMPORARY + "ˆêŽž(&T) (ƒT[ƒo[ %1 ‚̍Ďn“®Žž‚ɃT[ƒrƒX %2 ‚ðŠJŽn)" + IDS_ACTION_EXECUTE "ƒT[ƒo[ %1 ‚Å %2 ‚ðŽÀs’†" + IDS_ACTION_SALVAGE_SVR "ƒT[ƒo[ %1 ‚Ì‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒTƒ‹ƒx[ƒW’†" + IDS_ACTION_SALVAGE_AGG "ƒp[ƒeƒBƒVƒ‡ƒ“ %1:2 ‚Ì‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒTƒ‹ƒx[ƒW’†" + IDS_ACTION_SALVAGE_VOL "ƒp[ƒeƒBƒVƒ‡ƒ“ %1:2 ‚̃{ƒŠƒ…[ƒ€ %3 ‚ðƒTƒ‹ƒx[ƒW’†" + IDS_SALVAGE_SVR "ƒT[ƒo[ %1 ‚Ì‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒTƒ‹ƒx[ƒW" + IDS_SALVAGE_AGG "ƒT[ƒo[ %1 ƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ì‚·‚ׂẴ{ƒŠƒ…[ƒ€‚ðƒTƒ‹ƒx[ƒW" + IDS_SALVAGE_SET "ƒT[ƒo[ %1 ƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€ %3 ‚ðƒTƒ‹ƒx[ƒW" + IDS_SETSTATUS_SALVAGE "ƒ{ƒŠƒ…[ƒ€‚̃Tƒ‹ƒx[ƒW’†" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETSTATUS_LOCKED "ƒ{ƒŠƒ…[ƒ€‚ªƒƒbƒN‚³‚ê‚Ä‚¢‚Ü‚·" + IDS_SETSTATUS_NO_VOL "ƒ{ƒŠƒ…[ƒ€‚ª‚ ‚è‚Ü‚¹‚ñ" + IDS_SETSTATUS_BUSY "ƒ{ƒŠƒ…[ƒ€‚ªŒ»ÝŽg—p’†‚Å‚·" + IDS_SETSTATUS_MOVED "ƒ{ƒŠƒ…[ƒ€‚ªˆÚ“®‚³‚ê‚Ü‚µ‚½" + IDS_SVR_CAPACITY "%1" + IDS_SVR_ALLOCATION "%1 (%2%%)" + IDS_SVRCOL_ADDRESS "ƒAƒhƒŒƒX" + IDS_HOST_TITLE "ƒT[ƒo[ %1 ‚ª”Fޝ‚·‚éƒf[ƒ^ƒx[ƒXEƒzƒXƒgEƒT[ƒo[:" + IDS_SVR_HOSTS_TITLE "ƒT[ƒo[ %1 - ƒf[ƒ^ƒx[ƒXEƒzƒXƒg" + IDS_SVR_HOST_TAB "ƒf[ƒ^ƒx[ƒXEƒzƒXƒg" + IDS_ACTION_HOSTLIST_LOAD "ƒT[ƒo[ %1 ‚©‚çƒzƒXƒgEƒŠƒXƒg‚ðŽæ“¾’†" + IDS_ACTION_HOSTLIST_SAVE "ƒT[ƒo[ %1 ‚ɃzƒXƒgEƒŠƒXƒg‚ð‘‚«ž‚Ý’†" + IDS_SETSTATUS_1ALERT "ƒ{ƒŠƒ…[ƒ€‚É 1 ‚–â‘肪‚ ‚è‚Ü‚·" + IDS_SETSTATUS_2ALERT "ƒ{ƒŠƒ…[ƒ€‚É %1 ‚Ì–â‘肪‚ ‚è‚Ü‚·" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CHANGEADDR "ƒT[ƒo[ %1 ‚Ì IP ƒAƒhƒŒƒX‚ð•ύX’†" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_ADDSITE "vos addsite" + IDS_COMMAND_VOS_BACKUP "vos backup" + IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" + IDS_COMMAND_VOS_CREATE "vos create" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_DELENTRY "vos delentry" + IDS_COMMAND_VOS_DUMP "vos dump" + IDS_COMMAND_VOS_EXAMINE "vos examine" + IDS_COMMAND_VOS_LISTPART "vos listpart" + IDS_COMMAND_VOS_LISTVLDB "vos listvldb" + IDS_COMMAND_VOS_LISTVOL "vos listvol" + IDS_COMMAND_VOS_LOCK "vos lock" + IDS_COMMAND_VOS_MOVE "vos move" + IDS_COMMAND_VOS_PARTINFO "vos partinfo" + IDS_COMMAND_VOS_RELEASE "vos release" + IDS_COMMAND_VOS_REMOVE "vos remove" + IDS_COMMAND_VOS_REMSITE "vos remsite" + IDS_COMMAND_VOS_RENAME "vos rename" + IDS_COMMAND_VOS_RESTORE "vos restore" + IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" + IDS_COMMAND_VOS_UNLOCK "vos unlock" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" + IDS_COMMAND_VOS_ZAP "vos zap" + IDS_COMMAND_BOS_ADDHOST "bos addhost" + IDS_COMMAND_BOS_ADDKEY "bos addkey" + IDS_COMMAND_BOS_ADDUSER "bos adduser" + IDS_COMMAND_BOS_CREATE "bos create" + IDS_COMMAND_BOS_DELETE "bos delete" + IDS_COMMAND_BOS_EXEC "bos exec" + IDS_COMMAND_BOS_GETDATE "bos getdate" + IDS_COMMAND_BOS_GETLOG "bos getlog" + IDS_COMMAND_BOS_GETRESTART "bos getrestart" + IDS_COMMAND_BOS_INSTALL "bos install" + IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" + IDS_COMMAND_BOS_LISTKEYS "bos listkeys" + IDS_COMMAND_BOS_LISTUSERS "bos listusers" + IDS_COMMAND_BOS_PRUNE "bos prune" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_BOS_REMOVEHOST "bos removehost" + IDS_COMMAND_BOS_REMOVEKEY "bos removekey" + IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" + IDS_COMMAND_BOS_RESTART "bos restart" + IDS_COMMAND_BOS_SALVAGE "bos salvage" + IDS_COMMAND_BOS_SETAUTH "bos setauth" + IDS_COMMAND_BOS_SETRESTART "bos setrestart" + IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" + IDS_COMMAND_BOS_START "bos start" + IDS_COMMAND_BOS_STARTUP "bos startup" + IDS_COMMAND_BOS_STATUS "bos status" + IDS_COMMAND_BOS_STOP "bos stop" + IDS_COMMAND_BOS_UNINSTALL "bos uninstall" + IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" + IDS_COMMAND_FS_LISTQUOTA "fs listquota" + IDS_COMMAND_FS_QUOTA "fs quota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_FS_SETQUOTA "fs setquota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCSHORT_UNMONITORED + "ƒT[ƒo[ %1 ‚Í–â‘è‚ɂ‚¢‚ă‚ƒjƒ^[‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ" + IDS_ALERT_DESCSHORT_TIMEOUT + "ƒT[ƒo[ %1 ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½BÅIƒGƒ‰[: %3" + IDS_ALERT_DESCSHORT_AGG_FULL + "%2 ‚̃p[ƒeƒBƒVƒ‡ƒ“Žg—p—¦‚ªŒx‚µ‚«‚¢’l %3%% ‚ð’´‚¦‚Ü‚µ‚½ (%4)" + IDS_ALERT_DESCSHORT_SET_FULL + "%3 ‚̃{ƒŠƒ…[ƒ€Žg—p—¦‚ªŒx‚µ‚«‚¢’l %4%% ‚ð’´‚¦‚Ü‚µ‚½ (%5)" + IDS_ALERT_DESCSHORT_NO_VLDBENT "ƒ{ƒŠƒ…[ƒ€ %3 ‚É VLDB €–Ú‚ª‚ ‚è‚Ü‚¹‚ñ" + IDS_ALERT_DESCSHORT_NO_SVRENT_SET + "ƒ{ƒŠƒ…[ƒ€ %3 ‚Í VLDB €–Ú‚ðŽ‚Á‚Ä‚¢‚Ü‚·‚ªAƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚ÉŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ALERT_DESCSHORT_STOPPED "ƒT[ƒrƒX %2 ‚ª %3 ‚É’âŽ~‚µ‚Ü‚µ‚½" + IDS_ALERT_DESCSHORT_NO_SVRENT_AGG + "ƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚Í VLDB ‚É‚æ‚Á‚ÄƒŠƒtƒŒƒbƒVƒ…‚³‚ê‚Ü‚µ‚½‚ªAƒT[ƒo[ %1 ‚ÉŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ALERT_DESCSHORT_BADCREDS + "ƒT[ƒo[ %1 ‚ðŠÇ—‚·‚邽‚߂ɏ\•ª‚ÈŒ ŒÀ‚ª‚ ‚è‚Ü‚¹‚ñ" + IDS_ALERT_DESCSHORT_AGG_ALLOC + "ƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚ÌŒ‹‡ƒ{ƒŠƒ…[ƒ€Š„‚è“–‚Ä—Ê‚ª‚»‚Ì—e—ʂ𒴂¦‚Ü‚µ‚½" + IDS_ALERT_DESCSHORT_STATE_NO_VNODE + "%3 ƒ{ƒŠƒ…[ƒ€‚͉ó‚ê‚Ä‚¢‚邽‚ߎg—p‚Å‚«‚Ü‚¹‚ñB" + IDS_ALERT_DESCSHORT_STATE_NO_SERVICE + "ƒ{ƒŠƒ…[ƒ€ %3 ‚ðˆµ‚¤ƒT[ƒrƒX‚ªŽÀs‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB" + IDS_ALERT_DESCSHORT_STATE_OFFLINE + "%3 ƒ{ƒŠƒ…[ƒ€‚̓Iƒtƒ‰ƒCƒ“‚Ì‚½‚ߎg—p‚Å‚«‚Ü‚¹‚ñB" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_TIMEOUT + "ƒT[ƒo[ %1 ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñB%2 ‚ɍs‚í‚ꂽÅŒã‚ÌŽŽs‚̓Gƒ‰[ ""%3"" ‚ɂȂè‚Ü‚µ‚½B" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_AGG_FULL + "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚ÌŽg—p—¦‚ª‚»‚ÌŒx‚µ‚«‚¢’l %3%% ‚ð’´‚¦‚Ü‚µ‚½ (%4)B" + IDS_ALERT_DESCFULL_SET_FULL + "ƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2) ‚ÌŽg—p—¦‚ª‚»‚ÌŒx‚µ‚«‚¢’l %4%% ‚ð’´‚¦‚Ü‚µ‚½ (%5)B" + IDS_ALERT_DESCFULL_NO_VLDBENT + "ƒ{ƒŠƒ…[ƒ€ %3 ‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚É‘¶Ý‚µ‚Ü‚·‚ªA‘Ήž‚·‚é VLDB €–Ú‚ª‚ ‚è‚Ü‚¹‚ñB" + IDS_ALERT_DESCFULL_NO_SVRENT_SET + "ƒ{ƒŠƒ…[ƒ€ %3 ‚Ì VLDB €–Ú‚ª‘¶Ý‚µ‚Ü‚·‚ªAƒ{ƒŠƒ…[ƒ€‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚ÉŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ALERT_DESCFULL_STOPPED + "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ª %3 ‚ɏI—¹ƒR[ƒh %5 ‚Å’âŽ~‚µ‚Ü‚µ‚½B" + IDS_ALERT_DESCFULL_NO_SVRENT_AGG + "VLDB ‚̓T[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€‚ðŽQÆ‚µ‚Ü‚·‚ªAƒp[ƒeƒBƒVƒ‡ƒ“‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ALERT_DESCFULL_BADCREDS + "‚±‚̃Zƒ‹“à‚ÅŠÇ—ŽÒ‚Æ‚µ‚Ä‚Ì AFS ƒg[ƒNƒ“‚ðŽ‚Á‚Ä‚¢‚È‚¢‚½‚߁AAFSƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚É‘¶Ý‚µ‚È‚¢ƒGƒ‰[‚ðŒŸo‚µ‚Ü‚µ‚½B" + IDS_ALERT_DESCFULL_AGG_ALLOC + "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€‚ÌŒ‹‡Š„‚è“–‚ėʁA‡Œv %4A‚ªƒp[ƒeƒBƒVƒ‡ƒ“‚Ì—e—Ê %3 ‚ð’´‚¦‚Ü‚µ‚½B" + IDS_ALERT_DESCFULL_STATE_NO_VNODE + "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ì %3 ƒ{ƒŠƒ…[ƒ€‚ªŠÖ˜A‚·‚é Vnode ‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñB(ƒ{ƒŠƒ…[ƒ€ó‹µ‚Í 0x%4)" + IDS_ALERT_DESCFULL_STATE_NO_SERVICE + "ƒT[ƒo[ %1 ‚Ńtƒ@ƒCƒ‹EƒGƒNƒXƒ|[ƒ^[EƒT[ƒrƒX‚ªŽÀs‚³‚ê‚Ä‚¢‚È‚¢‚½‚߁Aƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ì %3 ƒ{ƒŠƒ…[ƒ€‚ðŽg—p‚Å‚«‚Ü‚¹‚ñB(ƒ{ƒŠƒ…[ƒ€ó‹µ‚Í 0x%4)" + IDS_ALERT_DESCFULL_STATE_OFFLINE + "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ì %3 ƒ{ƒŠƒ…[ƒ€‚ªƒIƒtƒ‰ƒCƒ“‚Ì‚½‚ߎg—p‚Å‚«‚Ü‚¹‚ñB(ƒ{ƒŠƒ…[ƒ€ó‹µ‚Í 0x%4)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_TIMEOUT "‚±‚̃T[ƒo[‚ɍĐڑ±‚·‚é‚ɂ́AuÄŽŽsvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_ALERT_FIX_AGG_FULL "‚±‚̃p[ƒeƒBƒVƒ‡ƒ“‚ÌŽg—p—¦‚ÌŒx‚µ‚«‚¢’l‚ð•ύX‚·‚é‚ɂ́AuŒxvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_ALERT_FIX_SET_FULL "‚±‚̃{ƒŠƒ…[ƒ€‚ÌŽg—p—¦‚ÌŒx‚µ‚«‚¢’l‚ð•ύX‚·‚é‚ɂ́AuŒxvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_NO_VLDBENT + "VLDB ‚ªŒÃ‚­‚È‚Á‚Ä‚¢‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B‚»‚̏ꍇ‚́AuVLDB ‚Ì“¯Šú‰»vƒRƒ}ƒ“ƒh‚Å‚±‚ê‚ðXV‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_ALERT_FIX_NO_SVRENT_SET + "ƒT[ƒo[‚ƃp[ƒeƒBƒVƒ‡ƒ“‚ª³‚µ‚­‹@”\‚µ‚Ä‚¢‚é‚©‚ðŠm”F‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_ALERT_FIX_STOPPED "‚±‚̃T[ƒrƒX‚̃T[ƒrƒXEƒƒO‚ðŒ©‚é‚ɂ́AuƒƒO‚Ì•\ަvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_ALERT_FIX_NO_SVRENT_AGG + "ƒT[ƒo[‚𒲂ׂāAƒp[ƒeƒBƒVƒ‡ƒ“‚ªƒGƒNƒXƒ|[ƒg‚³‚êA³‚µ‚­‹@”\‚µ‚Ä‚¢‚é‚©‚ðŠm”F‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_ALERT_FIX_BADCREDS "V‚µ‚¢ AFS ƒg[ƒNƒ“‚ðŽæ“¾‚·‚é‚ɂ́Au”FØvƒ{ƒ^ƒ“‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_ALERT_FIX_AGG_ALLOC "‚±‚̃p[ƒeƒBƒVƒ‡ƒ“‚̃{ƒŠƒ…[ƒ€‚ÌŠ„‚è“–‚Ä—Ê‚ðŒ¸‚ç‚·‚©A1 ‚‚܂½‚Í•¡”‚̃{ƒŠƒ…[ƒ€‚𑼂̃p[ƒeƒBƒVƒ‡ƒ“‚ÖˆÚ“®‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_ALERT_FIX_STATE_NO_VNODE " " + IDS_ALERT_FIX_STATE_NO_SERVICE " " + IDS_ALERT_FIX_STATE_OFFLINE " " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_BUTTON_TRYAGAIN "ÄŽŽs(&A)" + IDS_ALERT_BUTTON_WARNINGS "Œx(&W)..." + IDS_ALERT_BUTTON_VIEWLOG "ƒƒO‚Ì•\ަ(&V)" + IDS_ALERT_BUTTON_SHOWME "•\ަ(&S)" + IDS_ALERT_BUTTON_GETCREDS "”FØ(&A)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_CELLSERVERS_NOCELL + "ƒZƒ‹‚ªŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñBAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ðŽg—p‚·‚邽‚߂ɂ́A‘€ì‚µ‚½‚¢ AFS ƒZƒ‹‚ðŽw’è‚·‚é•K—v‚ª‚ ‚è‚Ü‚·Bã‚́uƒZƒ‹vƒƒjƒ…[‚ŁuƒI[ƒvƒ“...vƒƒjƒ…[€–Ú‚ð‘I‚ñ‚ŁAƒZƒ‹‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_ERROR_REFRESH_CELLSERVERS + "ƒT[ƒo[‚ÌƒŠƒXƒg‚ð %1 ƒZƒ‹‚ɂ‚¢‚Ď擾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒGƒ‰[: %2" + IDS_ERROR_CANT_OPEN_CELL + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒZƒ‹ %1 “à‚̃T[ƒo[‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒZƒ‹‚Ì–¼‘O‚𐳂µ‚­“ü—Í‚µ‚½‚©‚ð‚à‚¤ˆê“xŠm”F‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_ERROR_REFRESH_AGGREGATES + "ƒp[ƒeƒBƒVƒ‡ƒ“‚ÌƒŠƒXƒg‚ð %1 ƒT[ƒo[‚ɂ‚¢‚Ď擾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒGƒ‰[: %2" + IDS_ERROR_REFRESH_SERVER_STATUS + "ƒT[ƒo[ %1 ‚ÌŒ»Ý‚Ìó‹µ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CHANGE_SERVER_STATUS + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃vƒƒpƒeƒB[‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_REFRESH_AGGREGATE_STATUS + "ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚ÌŒ»Ý‚Ìó‹µ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_FILESET_STATUS + "ƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2) ‚ÌŒ»Ý‚Ìó‹µ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_REFRESH_SERVICE_STATUS + "ƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ÌŒ»Ý‚̏󋵂𔻕ʂł«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_MOVE_FILESET "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒ{ƒŠƒ…[ƒ€ %3 ‚ðƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚©‚çƒT[ƒo[ %4 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %5 ‚ÖˆÚ“®‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_VIEW_LOGFILE "%2 ƒtƒ@ƒCƒ‹‚ðƒT[ƒo[ %1 ‚©‚ç“ǂݎæ‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒtƒ@ƒCƒ‹–¼‚𐳂µ‚­“ü—Í‚µ‚½‚©A‚Ü‚½ƒtƒ@ƒCƒ‹‚ðŒ©‚é‚½‚߂ɏ\•ª‚È‹–‰Â‚ðŽ‚Á‚Ä‚¢‚é‚©‚𒲂ׂĂ­‚¾‚³‚¢B" + IDS_ERROR_NOT_REPLICATED + "ƒ{ƒŠƒ…[ƒ€ %1 ‚Ì•¡»ó‹µ‚𔻕ʂł«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_CREATE_FILESET + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ƀ{ƒŠƒ…[ƒ€ %3 ‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_DELETE_FILESET + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2) ‚ðíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_CREATE_VLDB_ENTRY + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ƀ{ƒŠƒ…[ƒ€ %3 ‚Ì VLDB €–Ú‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_SET_FILESET_QUOTA + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€ %3‚ÌŠ„‚è“–‚Ä—Ê‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_CREATE_SERVER + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒZƒ‹ %1 “à‚Å•K—v‚ȃT[ƒo[€–Ú‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_PING_SERVER + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚Ì IP ƒAƒhƒŒƒX‚𔻕ʂł«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_DELETE_SERVER + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚ðíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_DELETE_SERVER_FILESETS + "ƒT[ƒo[ %1 ‚͂܂¾ƒ{ƒŠƒ…[ƒ€‚̃zƒXƒg‚Å‚ ‚邽‚ߍ폜‚Å‚«‚Ü‚¹‚ñBƒT[ƒo[‚̓{ƒŠƒ…[ƒ€‚ðŽ‚½‚È‚­‚È‚é‚܂ō폜‚Å‚«‚Ü‚¹‚ñB" + IDS_ERROR_CHANGE_AGGREGATE_STATUS + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃vƒƒpƒeƒB[‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CHANGE_SERVICE_STATUS + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚̃vƒƒpƒeƒB[‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_START_SERVICE + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ðŠJŽn‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_STOP_SERVICE + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ð’âŽ~‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_RESTART_SERVICE + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒrƒX %2 ‚ð’âŽ~‚¨‚æ‚эĎn“®‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CHANGE_REPLICA_STATUS + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ƒp[ƒeƒBƒVƒ‡ƒ“ %2 ‚̃{ƒŠƒ…[ƒ€ %3‚Ì•¡»ƒvƒƒpƒeƒB[‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_SYNCVLDB "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ª VLDB ‚ðXV‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_CREATE_REPLICA + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ƀ{ƒŠƒ…[ƒ€ %3 ‚̃ŒƒvƒŠƒJ‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_INSTALL_FILE + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚É %2 ƒtƒ@ƒCƒ‹‚ðƒCƒ“ƒXƒg[ƒ‹‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_UNINSTALL_FILE + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚É %2 ƒtƒ@ƒCƒ‹‚ðƒAƒ“ƒCƒ“ƒXƒg[ƒ‹‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_PRUNE_FILES + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚©‚ç—v‹‚³‚ꂽƒtƒ@ƒCƒ‹‚ðíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_RENAME_FILESET + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒ{ƒŠƒ…[ƒ€ %1 ‚ð ""%2"" ‚É–¼‘O•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_CREATE_SERVICE + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚ɃT[ƒrƒX %2 ‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_DELETE_SERVICE + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚©‚çƒT[ƒrƒX %2 ‚ðíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_RELEASE_FILESET + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ª•¡»‚³‚ꂽƒ{ƒŠƒ…[ƒ€ %3 ‚ð‰ð•ú‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_UPDATE_FILESET + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %2 ƒp[ƒeƒBƒVƒ‡ƒ“ %1 ‚̃{ƒŠƒ…[ƒ€EƒŒƒvƒŠƒJ %3 ‚ðXV‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_UPDATE_ALL + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒ{ƒŠƒ…[ƒ€ %3 ‚̃ŒƒvƒŠƒJ‚ðXV‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_LOAD_ADMLIST + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚ÌŠÇ—ŽÒ‚ÌƒŠƒXƒg‚ð“ǂݎæ‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_LOAD_KEYLIST + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒo[Œ®‚ÌƒŠƒXƒg‚ð“ǂݎæ‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_CREATE_KEY + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̐V‚µ‚¢ƒT[ƒo[Œ®‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_SAVE_ADMLIST + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚ÌŠÇ—ŽÒ‚ÌƒŠƒXƒg‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_CLONE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Ƀ{ƒŠƒ…[ƒ€ %3 ‚̃oƒbƒNƒAƒbƒvEƒo[ƒWƒ‡ƒ“‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_CLONESYS "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ª—v‹‚³‚ꂽƒoƒbƒNƒAƒbƒvEƒ{ƒŠƒ…[ƒ€‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_DUMP_FILESET + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2) ‚Ì“à—e‚ðƒtƒ@ƒCƒ‹ %4 ‚Öƒ_ƒ“ƒv‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_RESTORE_FILESET + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒtƒ@ƒCƒ‹ %4 ‚ðƒ{ƒŠƒ…[ƒ€ %3 (ƒT[ƒo[ %1Aƒp[ƒeƒBƒVƒ‡ƒ“ %2) ‚Ö•œŒ³‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_SET_RESTART_TIMES + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃T[ƒrƒX‚̍Ďn“®Žž‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_DELETE_REPLICATED_FILESET + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚©‚çƒ{ƒŠƒ…[ƒ€ %3 ‚ðíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\n‚·‚ׂẴŒƒvƒŠƒJ‚ªíœ‚³‚ê‚é‚܂Ń{ƒŠƒ…[ƒ€ %3 ‚͍폜‚Å‚«‚Ü‚¹‚ñB" + IDS_CMDLINE_TITLE "ƒGƒ‰[ - AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" + IDS_CMDLINE_SYNTAX "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B" + IDS_CMDLINE_UNRECOGNIZED + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\n""%1"" ƒpƒ‰ƒ[ƒ^[‚ª”Fޝ‚Å‚«‚Ü‚¹‚ñB" + IDS_CMDLINE_DUPLICATE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\n""%1"" ƒpƒ‰ƒ[ƒ^[‚ª•¡”‰ñŽw’肳‚ê‚Ä‚¢‚Ü‚·B" + IDS_CMDLINE_UNEXPECTVALUE + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\n""%1"" ƒpƒ‰ƒ[ƒ^[‚É’l‚ª‚ ‚è‚Ü‚¹‚ñB" + IDS_CMDLINE_MISSINGVAL "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\n""%1"" ƒpƒ‰ƒ[ƒ^[‚ÌŒã‚É’l‚ª‘±‚¢‚Ä‚¢‚Ü‚¹‚ñB" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CMDLINE_SUBSETNOTCELL + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\n""/SUBSET""ƒpƒ‰ƒ[ƒ^[‚Í ""/CELL"" ƒpƒ‰ƒ[ƒ^[‚ªŽw’肳‚ꂽê‡‚ɂ̂ݎw’è‚Å‚«‚Ü‚·B" + IDS_CMDLINE_INVALIDSUBSET + "Žw’肵‚½ƒT[ƒo[EƒTƒuƒZƒbƒg ""%2"" ‚ª %1 ƒZƒ‹‚É’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB" + IDS_CMDLINE_SERVERNOTCELL + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\n""/SERVER""ƒpƒ‰ƒ[ƒ^[‚Í ""/CELL"" ƒpƒ‰ƒ[ƒ^[‚ªŽw’肳‚ꂽê‡‚ɂ̂ݎw’è‚Å‚«‚Ü‚·B" + IDS_CMDLINE_RESET_TITLE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[" + IDS_CMDLINE_RESET_DESC "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªŽw’肳‚ꂽÝ’è‚ðƒNƒŠƒA‚µ‚Ü‚µ‚½B" + IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE + "ƒp[ƒeƒBƒVƒ‡ƒ“‚ª‘¶Ý‚µ‚È‚¢‚©AƒGƒNƒXƒ|[ƒg‚³‚ê‚Ä‚¢‚È‚¢‚½‚߁AAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚Í VLDB ‚ðƒT[ƒo[ %1 ‚̃p[ƒeƒBƒVƒ‡ƒ“ %2 ‚Æ“¯Šú‰»‚Å‚«‚Ü‚¹‚ñB\n\n‚±‚̃p[ƒeƒBƒVƒ‡ƒ“‚ðƒT[ƒo[ %1 ‚©‚çíœ‚·‚é‚ɂ́A‚±‚ê‚ðŽQÆ‚·‚éƒ{ƒŠƒ…[ƒ€ VLDB €–Ú‚ðíœ‚·‚é•K—v‚ª‚ ‚è‚Ü‚·B" + IDS_CMDLINE_USERPASSWORD + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ÉŽw’肵‚½ƒRƒ}ƒ“ƒhs‚ª–³Œø‚Å‚·B\n\nV‚µ‚¢ AFS ƒg[ƒNƒ“‚ðŽæ“¾‚·‚é‚ɂ́A ""/USER"" ‚¨‚æ‚Ñ ""/PASSWORD"" ƒpƒ‰ƒ[ƒ^[‚ðŽw’è‚·‚é•K—v‚ª‚ ‚è‚Ü‚·B" + IDS_ERROR_CANT_DELETE_KEY + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚©‚çƒT[ƒo[Œ® %2 ‚ðíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_GETRANDOMKEY + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃‰ƒ“ƒ_ƒ€Œ®‚𐶐¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_EXECUTE_COMMAND + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚ÅŽŸ‚̃Rƒ}ƒ“ƒh‚ðŽÀs‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½:\n\n ""%2""" + IDS_ERROR_CANT_READ_SALVAGE_LOG + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒTƒ‹ƒx[ƒW‘€ì‚𐳏í‚ÉŠ®—¹‚µ‚Ü‚µ‚½‚ªAƒTƒ‹ƒx[ƒW‘€ì‚ÌŒ‹‰Ê‚ðŽ¦‚·ƒƒOEƒtƒ@ƒCƒ‹‚ðŒŸõ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_SALVAGE "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ª—v‹‚³‚ꂽƒTƒ‹ƒx[ƒW‘€ì‚ðŽÀs‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_AUTH_ON "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚Ì”FØŒŸ¸‚ðŽg—p‰Â”\‚ɂł«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_AUTH_OFF "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚Ì”FØŒŸ¸‚ðŽg—p•s‰Â‚ɂł«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_LOAD_HOSTLIST + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚©‚çƒf[ƒ^ƒx[ƒXEƒzƒXƒgEƒT[ƒo[‚ÌƒŠƒXƒg‚ð“ǂݎæ‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_ERROR_CANT_SAVE_HOSTLIST + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚̃f[ƒ^ƒx[ƒXEƒzƒXƒgEƒT[ƒo[‚ÌƒŠƒXƒg‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL + "AFS ƒRƒ“ƒgƒ[ƒ‹EƒZƒ“ƒ^[‚ª‚±‚̃Rƒ“ƒsƒ…[ƒ^[‚ɐ³‚µ‚­ƒCƒ“ƒXƒg[ƒ‹‚³‚ê‚Ä‚¢‚È‚¢‚½‚߁AAFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªŠJŽn‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nAFS ƒRƒ“ƒgƒ[ƒ‹EƒZƒ“ƒ^[‚̍ăCƒ“ƒXƒg[ƒ‹‚ª•K—v‚Å‚ ‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B" + IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN + "•s–¾‚È–â‘è‚Ì‚½‚ß‚É AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ðŠJŽn‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nAFS ƒRƒ“ƒgƒ[ƒ‹EƒZƒ“ƒ^[‚̍ăCƒ“ƒXƒg[ƒ‹‚ª•K—v‚Å‚ ‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B" + IDS_ERROR_CANT_CHANGEADDR + "AFS ƒT[ƒo[Eƒ}ƒl[ƒWƒƒ[‚ªƒT[ƒo[ %1 ‚Ì VLDB “à‚Ì IP ƒAƒhƒŒƒX‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_SERVICE "%1:%2" + IDS_SERVICETYPE_SIMPLE "ƒVƒ“ƒvƒ‹" + IDS_SERVICETYPE_CRON "Cron" + IDS_SERVICESTATE_STOPPED "’âŽ~" + IDS_SERVICESTATE_STOPPING "’âŽ~’†" + IDS_SERVICESTATE_STARTING "ŠJŽn’†" + IDS_SERVICESTATE_RUNNING "ŽÀs’†" + IDS_SERVICETYPE_FS_LONG "FS (ƒtƒ@ƒCƒ‹EƒVƒXƒeƒ€)" + IDS_SERVICETYPE_FS "FS" + IDS_SERVICE_LASTERROR "%1" + IDS_SERVICES_IN_CELL "ƒZƒ‹ %1 ‚Ì‚·‚ׂẴT[ƒrƒX:" + IDS_SERVICE_STARTDATE "ŠJŽn %1" + IDS_SERVICE_STOPDATE "’âŽ~ %1" +END + +#endif // Japanese resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afssvrmgr/lang/ko_KR/svrmgr.rc b/src/WINNT/afssvrmgr/lang/ko_KR/svrmgr.rc index 4efa49b24..fbe61f7a2 100644 --- a/src/WINNT/afssvrmgr/lang/ko_KR/svrmgr.rc +++ b/src/WINNT/afssvrmgr/lang/ko_KR/svrmgr.rc @@ -7,2981 +7,2981 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" #define AFS_VERINFO_NAME "svrmgr" #define AFS_VERINFO_FILENAME "svrmgr.exe" #define AFS_VERINFO_LANG_CODE 0x412 #define AFS_VERINFO_CHARSET 949 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Korean resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR) -#ifdef _WIN32 -LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_SERVICES, DIALOG - BEGIN - RIGHTMARGIN, 165 - END - - IDD_AGGREGATES, DIALOG - BEGIN - RIGHTMARGIN, 118 - END - - IDD_FILESETS, DIALOG - BEGIN - RIGHTMARGIN, 180 - END - - IDD_SVR_LISTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_AGG_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 262 - TOPMARGIN, 5 - BOTTOMMARGIN, 155 - END - - IDD_SVR_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 183 - END - - IDD_SVR_SCOUT, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 153 - END - - IDD_SVC_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 268 - TOPMARGIN, 5 - BOTTOMMARGIN, 209 - END - - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 315 - TOPMARGIN, 2 - BOTTOMMARGIN, 224 - END - - IDD_SERVER, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 207 - TOPMARGIN, 2 - BOTTOMMARGIN, 135 - END - - IDD_SVC_CREATE, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 228 - END - - IDD_SET_REPSITES, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 216 - TOPMARGIN, 5 - BOTTOMMARGIN, 163 - END - - IDD_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 7 - BOTTOMMARGIN, 253 - HORZGUIDE, 160 - END - - IDD_TIMEOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 232 - TOPMARGIN, 7 - BOTTOMMARGIN, 153 - END - - IDD_COLUMNS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 281 - TOPMARGIN, 5 - BOTTOMMARGIN, 143 - END - - IDD_REFRESHALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 68 - END - - IDD_SET_CREATE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 317 - TOPMARGIN, 4 - BOTTOMMARGIN, 205 - END - - IDD_SET_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 98 - END - - IDD_SET_CLONE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 341 - TOPMARGIN, 7 - BOTTOMMARGIN, 81 - END - - IDD_SVC_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 189 - END - - IDD_SVR_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 152 - END - - IDD_AGG_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 252 - TOPMARGIN, 5 - BOTTOMMARGIN, 146 - END - - IDD_SET_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 268 - TOPMARGIN, 5 - BOTTOMMARGIN, 177 - END - - IDD_SET_MOVETO, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 170 - END - - IDD_SET_MOVING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SVC_LOGNAME, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 102 - END - - IDD_SVC_VIEWLOG, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 181 - END - - IDD_SET_SETQUOTA, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 267 - TOPMARGIN, 4 - BOTTOMMARGIN, 126 - END - - IDD_ACTIONS, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 234 - TOPMARGIN, 2 - BOTTOMMARGIN, 56 - END - - IDD_SVR_SYNCVLDB, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 265 - TOPMARGIN, 4 - BOTTOMMARGIN, 95 - END - - IDD_SET_CREATEREP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 167 - END - - IDD_SVR_INSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 152 - END - - IDD_SVR_UNINSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 135 - END - - IDD_SVR_PRUNE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 196 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_SET_RENAME, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 129 - END - - IDD_SVC_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 290 - TOPMARGIN, 7 - BOTTOMMARGIN, 81 - END - - IDD_SVR_GETDATES, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_GETDATES_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 128 - END - - IDD_SET_DUMP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 291 - TOPMARGIN, 7 - BOTTOMMARGIN, 140 - END - - IDD_SET_RESTORE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 288 - TOPMARGIN, 4 - BOTTOMMARGIN, 244 - END - - IDD_SVC_BOS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_DUMPING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SET_RESTORING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SET_CLONESYS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 254 - TOPMARGIN, 7 - BOTTOMMARGIN, 159 - END - - IDD_SUBSETS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 276 - TOPMARGIN, 5 - BOTTOMMARGIN, 177 - END - - IDD_SUBSET_LOADSAVE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 276 - TOPMARGIN, 4 - BOTTOMMARGIN, 141 - END - - IDD_HELP_FIND, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 214 - TOPMARGIN, 4 - BOTTOMMARGIN, 69 - END - - IDD_HELP_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 214 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_HELP_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 226 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_OPENINGCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 236 - TOPMARGIN, 2 - BOTTOMMARGIN, 41 - END - - IDD_OPTIONS_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 274 - TOPMARGIN, 5 - BOTTOMMARGIN, 131 - END - - IDD_SVR_KEYS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_CREATEKEY, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - END - - IDD_SVC_STARTSTOP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 289 - TOPMARGIN, 7 - BOTTOMMARGIN, 145 - END - - IDD_SVR_EXECUTE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 254 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_SALVAGE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 7 - BOTTOMMARGIN, 250 - END - - IDD_SVR_SALVAGE_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 174 - END - - IDD_SET_RELEASE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 98 - END - - IDD_SVR_HOSTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_ADDHOST, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 221 - TOPMARGIN, 4 - BOTTOMMARGIN, 102 - END - - IDD_SVR_ADDRESS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 204 - TOPMARGIN, 4 - BOTTOMMARGIN, 111 - END - - IDD_SVR_NEWADDR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 219 - TOPMARGIN, 4 - BOTTOMMARGIN, 65 - END -END -#endif // APSTUDIO_INVOKED - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_MAIN MENU DISCARDABLE -BEGIN - POPUP "¼¿(&C)" - BEGIN - MENUITEM "¼±ÅÃ(&S)...", M_CELL_OPEN - MENUITEM "ÀÎÁõ(&A)", M_CREDENTIALS - MENUITEM SEPARATOR - MENUITEM "Á¾·á(&X)", M_EXIT - END - POPUP "º¸±â(&V)" - BEGIN - POPUP "¼­¹ö(&S)" - BEGIN - MENUITEM "Å« ¾ÆÀÌÄÜ(&G)", M_SVR_VIEW_LARGE - , CHECKED - MENUITEM "ÀÛÀº ¾ÆÀÌÄÜ(&M)", M_SVR_VIEW_SMALL - , CHECKED - MENUITEM "ÀÚ¼¼È÷(&D)", M_SVR_VIEW_REPORT - , CHECKED - MENUITEM SEPARATOR - MENUITEM "Ç¥ÁØ(&N)", M_SVR_VIEW_ONEICON - , CHECKED - MENUITEM "¸ðµç ¾ÆÀÌÄÜ(&A)", M_SVR_VIEW_TWOICONS - , CHECKED - MENUITEM "»óŸ¸(&S)", M_SVR_VIEW_STATUS - , CHECKED - END - POPUP "»¡¸® º¸±â ºÐÇÒ¿µ¿ª(&Q)" - BEGIN - MENUITEM "¾øÀ½(&N)", M_DIVIDE_NONE, CHECKED - MENUITEM "¼öÁ÷ ºÐÇÒ(&V)", M_DIVIDE_H, CHECKED - MENUITEM "¼öÆò ºÐÇÒ(&H)", M_DIVIDE_V, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "ÁøÇà ÁßÀÎ Á¶ÀÛ(&P)", M_ACTIONS, CHECKED - MENUITEM SEPARATOR - MENUITEM "¸ð´ÏÅ͵Ǵ ¼­¹ö(&M)...", M_SUBSET - MENUITEM "Ä÷³(&C)...", M_COLUMNS - MENUITEM "¿É¼Ç(&O)...", M_OPTIONS - MENUITEM SEPARATOR - MENUITEM "¸ðµÎ »õ·Î °íħ(&F)", M_REFRESHALL - END - POPUP "µµ¿ò¸»(&H)" - BEGIN - MENUITEM "¸ñÂ÷(&C)", M_HELP - MENUITEM "¸í·É ã±â(&F)...", M_HELP_FIND - MENUITEM "¿À·ù ÄÚµå ã±â(&L)...", M_HELP_XLATE - MENUITEM SEPARATOR - MENUITEM "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ Á¤º¸(&A)...", M_ABOUT - END -END - -MENU_AGG MENU DISCARDABLE -BEGIN - MENUITEM "º¼·ý ÀÛ¼º(&C)...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "º¼·ý ¹é¾÷(&B)...", M_SET_CLONE - MENUITEM "¸ðµç º¼·ý Àá±ÝÇØÁ¦(&U)", M_SET_UNLOCK - MENUITEM "VLDB µ¿±âÈ­(&Y)...", M_SYNCVLDB - MENUITEM "º¼·ý º¹¿ø(&G)...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "»õ·Î °íħ(&F)", M_REFRESH - MENUITEM "Ư¼º(&R)", M_PROPERTIES -END - -MENU_SVC MENU DISCARDABLE -BEGIN - MENUITEM "½ÃÀÛ(&S)", M_SVC_START - MENUITEM "Á¤Áö(&T)", M_SVC_STOP - MENUITEM "Àç½ÃÀÛ(&R)", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "·Î±× ÆÄÀÏ º¸±â(&V)", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "»èÁ¦(&L)", M_SVC_DELETE - MENUITEM SEPARATOR - MENUITEM "»õ·Î °íħ(&F)", M_REFRESH - MENUITEM "Ư¼º(&R)", M_PROPERTIES -END - -MENU_AGG_NONE MENU DISCARDABLE -BEGIN - POPUP "º¸±â(&V)" - BEGIN - MENUITEM "Ç¥ÁØ(&N)", M_VIEW_ONEICON, CHECKED - MENUITEM "¸ðµç ¾ÆÀÌÄÜ(&A)", M_VIEW_TWOICONS, CHECKED - MENUITEM "»óŸ¸(&S)", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "º¼·ý ÀÛ¼º(&C)...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "¸ðµÎ »õ·Î °íħ(&F)", M_REFRESHALL -END - -MENU_SVC_NONE MENU DISCARDABLE -BEGIN - POPUP "º¸±â(&V)" - BEGIN - MENUITEM "Ç¥ÁØ(&N)", M_VIEW_ONEICON, CHECKED - MENUITEM "¸ðµç ¾ÆÀÌÄÜ(&A)", M_VIEW_TWOICONS, CHECKED - MENUITEM "»óŸ¸(&S)", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "¼­ºñ½º ÀÛ¼º(&C)...", M_SVC_CREATE - MENUITEM SEPARATOR - MENUITEM "¸ðµÎ »õ·Î °íħ(&F)", M_REFRESHALL -END - -MENU_SET MENU DISCARDABLE -BEGIN - MENUITEM "º¹Á¦(&E)...", M_SET_REPLICATION - MENUITEM "Áö±Ý ÇØÁ¦(&S)", M_SET_RELEASE - MENUITEM SEPARATOR - MENUITEM "¹é¾÷(&B)...", M_SET_CLONE - MENUITEM "ÆÄÀÏ¿¡ ´ýÇÁ(&D)...", M_SET_DUMP - MENUITEM "ÆÄÀϷκÎÅÍ º¹¿ø(&R)...", M_SET_RESTORE - MENUITEM "ÇÒ´ç·® ¼³Á¤(&Q)...", M_SET_SETQUOTA - MENUITEM "º¹¿ø(&G)...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "´ÙÀ½À¸·Î À̵¿(&M)...", M_SET_MOVETO - MENUITEM "À̸§ º¯°æ(&N)...", M_SET_RENAME - MENUITEM "»èÁ¦(&L)", M_SET_DELETE - MENUITEM SEPARATOR - MENUITEM "Àá±Ý(&K)", M_SET_LOCK - MENUITEM "Àá±ÝÇØÁ¦(&U)", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "»õ·Î °íħ(&F)", M_REFRESH - MENUITEM "Ư¼º(&R)", M_PROPERTIES -END - -MENU_SVR MENU DISCARDABLE -BEGIN - MENUITEM "¼­¹ö â ¿­±â(&O)", M_SVR_OPEN - MENUITEM "¼­¹ö ⠴ݱâ(&C)", M_SVR_CLOSE - MENUITEM "ÀÌ ¼­¹ö ¸ð´ÏÅÍ(&M)", M_SVR_MONITOR, CHECKED - MENUITEM SEPARATOR - MENUITEM "¼­¹ö º¸¾È ÆíÁý(&S)...", M_SVR_SECURITY - MENUITEM "µ¥ÀÌÅͺ£À̽º È£½ºÆ® °ü¸®(&H)...", M_SVR_HOSTS - MENUITEM "º¼·ý ¹é¾÷(&B)...", M_SET_CLONE - MENUITEM "¸ðµç º¼·ý Àá±ÝÇØÁ¦(&U)", M_SET_UNLOCK - MENUITEM "VLDB µ¿±âÈ­(&Y)...", M_SYNCVLDB - MENUITEM "º¼·ý º¹¿ø(&G)...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "ÆÄÀÏ ¼³Ä¡(&I)...", M_SVR_INSTALL - MENUITEM "ÆÄÀÏ ¼³Ä¡ ÇØÁ¦(&U)...", M_SVR_UNINSTALL - MENUITEM "ÀÌÀü ÆÄÀÏ Á¤¸®(&P)...", M_SVR_PRUNE - MENUITEM SEPARATOR - MENUITEM "ÆÄÀÏ ³¯Â¥ È®º¸(&T)...", M_SVR_GETDATES - MENUITEM "·Î±× ÆÄÀÏ º¸±â(&V)...", M_VIEWLOG - MENUITEM "¸í·É ½ÇÇà(&X)...", M_EXECUTE - MENUITEM SEPARATOR - MENUITEM "»õ·Î °íħ(&F)", M_REFRESH - MENUITEM "Ư¼º(&R)", M_PROPERTIES -END - -MENU_SVR_NONE MENU DISCARDABLE -BEGIN - POPUP "º¸±â(&V)" - BEGIN - MENUITEM "Å« ¾ÆÀÌÄÜ(&G)", M_SVR_VIEW_LARGE, CHECKED - MENUITEM "ÀÛÀº ¾ÆÀÌÄÜ(&M)", M_SVR_VIEW_SMALL, CHECKED - MENUITEM "ÀÚ¼¼È÷(&D)", M_SVR_VIEW_REPORT, CHECKED - MENUITEM SEPARATOR - MENUITEM "Ç¥ÁØ(&N)", M_SVR_VIEW_ONEICON, CHECKED - MENUITEM "¸ðµç ¾ÆÀÌÄÜ(&A)", M_SVR_VIEW_TWOICONS, CHECKED - MENUITEM "»óŸ¸(&S)", M_SVR_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "¸ð´ÏÅ͵Ǵ ¼­¹ö(&M)...", M_SUBSET - MENUITEM SEPARATOR - MENUITEM "¸ðµç º¼·ý Àá±ÝÇØÁ¦(&U)", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "¸ðµÎ ´Ý±â(&C)", M_SVR_CLOSEALL - MENUITEM "¸ðµÎ »õ·Î °íħ(&F)", M_REFRESHALL -END - -MENU_SET_NONE MENU DISCARDABLE -BEGIN - POPUP "º¸±â(&V)" - BEGIN - MENUITEM "º¼·ýº°(&V)", M_SET_VIEW_REPORT, CHECKED - MENUITEM "ÆÄƼ¼Çº°(&P)", M_SET_VIEW_TREELIST, CHECKED - MENUITEM "¼¼ºÎ»çÇ× ¾øÀ½(&D)", M_SET_VIEW_TREE, CHECKED - MENUITEM SEPARATOR - MENUITEM "Ç¥ÁØ(&N)", M_VIEW_ONEICON, CHECKED - MENUITEM "¸ðµç ¾ÆÀÌÄÜ(&A)", M_VIEW_TWOICONS, CHECKED - MENUITEM "»óŸ¸(&S)", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "º¼·ý ÀÛ¼º(&C)...", M_SET_CREATE - MENUITEM "ÆÄÀϷκÎÅÍ º¹¿ø(&R)...", M_SET_RESTORE - MENUITEM SEPARATOR - MENUITEM "º¼·ý ¹é¾÷(&B)...", M_SET_CLONE - MENUITEM SEPARATOR - MENUITEM "¸ðµÎ Àá±ÝÇØÁ¦(&U)", M_SET_UNLOCK - MENUITEM "¸ðµÎ »õ·Î °íħ(&F)", M_REFRESHALL -END - -MENU_COLUMNS MENU DISCARDABLE -BEGIN - MENUITEM "Ä÷³(&C)...", M_COLUMNS -END - -MENU_SVC_BOS MENU DISCARDABLE -BEGIN - MENUITEM "Àç½ÃÀÛ(&R)", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "·Î±× ÆÄÀÏ º¸±â(&V)", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "»õ·Î °íħ(&F)", M_REFRESH - MENUITEM "Ư¼º(&R)", M_PROPERTIES -END - -MENU_SET_DRAGDROP MENU DISCARDABLE -BEGIN - MENUITEM "¿©±â·Î À̵¿(&M)...", M_SET_MOVEHERE - MENUITEM "¿©±â¼­ º¹Á¦(&R)...", M_SET_REPHERE - MENUITEM SEPARATOR - MENUITEM "Ãë¼Ò(&C)", IDC_STATIC -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SERVICES DIALOGEX 0, 0, 179, 92 -STYLE DS_CENTER | WS_CHILD -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - LTEXT "¼­ºñ½º:",IDC_SVC_DESC,0,5,179,8 - CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,0,17,179, - 61,WS_EX_STATICEDGE - PUSHBUTTON "ÀÛ¼º(&C)...",IDC_SVC_CREATE,56,80,39,12 - PUSHBUTTON "»èÁ¦(&L)",IDC_SVC_DELETE,98,80,39,12 - PUSHBUTTON "Àç½ÃÀÛ(&R)",IDC_SVC_RESTART,140,80,39,12 -END - -IDD_AGGREGATES DIALOGEX 0, 0, 165, 84 -STYLE DS_CENTER | WS_CHILD -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - LTEXT "ÆÄƼ¼Ç:",IDC_AGG_DESC,0,5,165,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,0,17,165, - 53,WS_EX_STATICEDGE - PUSHBUTTON "º¼·ý ÀÛ¼º(&C)...",IDC_AGG_CREATESET,102,72,63,12 -END - -IDD_FILESETS DIALOGEX 0, 0, 194, 92 -STYLE DS_CENTER | WS_CHILD -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - LTEXT "º¼·ý:",IDC_SET_DESC,0,5,194,8 - CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,0,17,194, - 61,WS_EX_STATICEDGE - PUSHBUTTON "ÀÛ¼º(&C)...",IDC_SET_CREATE,3,80,39,12 - PUSHBUTTON "»èÁ¦(&L)",IDC_SET_DELETE,45,80,39,12 - PUSHBUTTON "º¹Á¦(&R)...",IDC_SET_REP,87,80,45,12 - PUSHBUTTON "ÇÒ´ç·® ¼³Á¤(&Q)...",IDC_SET_SETQUOTA,136,80,57,12 -END - -IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, - 135,WS_EX_CLIENTEDGE - PUSHBUTTON "°ü¸®ÀÚ Ãß°¡(&A)",IDC_LIST_ADD,72,160,65,14 - PUSHBUTTON "°ü¸®ÀÚ Á¦°Å(&R)",IDC_LIST_REMOVE,141,160,80,14 - LTEXT "%1 ¼­¹öÀÇ °ü¸®ÀÚ:",IDC_LIST_NAME,5,7,216,8 -END - -IDD_AGG_GENERAL DIALOGEX 0, 0, 267, 160 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - LTEXT "ID:",IDC_STATIC,5,30,31,8 - LTEXT "(Á¶È¸ Áß)",IDC_AGG_ID,38,30,214,8 - LTEXT "ÀåÄ¡:",IDC_STATIC,5,46,31,8 - LTEXT "(Á¶È¸ Áß)",IDC_AGG_DEVICE,38,46,214,8 - LTEXT "º¼·ý:",IDC_STATIC,5,62,31,8 - LTEXT "(Á¶È¸ Áß)",IDC_AGG_FILESETS,38,62,214,8 - CONTROL "Á¶ÇÕµÈ º¼·ý ÇÒ´ç·®ÀÌ ¿ë·®À» ÃʰúÇÏ¸é °æ°í Ç¥½Ã", - IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 38,76,215,10 - LTEXT "»ç¿ë·®:",IDC_STATIC,5,90,31,8 - LTEXT "(Á¶È¸ Áß)",IDC_AGG_USAGE,38,90,214,8 - CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,38,103,218,8, - WS_EX_STATICEDGE - CONTROL "ÆÄƼ¼Ç »ç¿ë·®ÀÌ ÃʰúµÇ¸é °æ°í Ç¥½Ã",IDC_AGG_WARN,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,38,116,214,10 - CONTROL "ÀÌ ¼­¹ö¿¡ ´ëÇÑ ±âº» ÀÓ°è°ª(&D)", - IDC_AGG_WARN_AGGFULL_DEF,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,49,131,203,9 - CONTROL "ÀÓ°è°ª(&T)",IDC_AGG_WARN_AGGFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,49,145,53,9 - EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,112,143,29,12, - ES_AUTOHSCROLL - LTEXT "Å©±âÀÇ ¹éºÐÀ²",IDC_AGG_WARN_AGGFULL_DESC,152,145,100,8 - ICON IDI_AGGREGATE,IDC_STATIC,5,5,20,20 - LTEXT "%2 ÆÄƼ¼Ç(%1 ¼­¹ö)",IDC_AGG_NAME,38,14,214,8 -END - -IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - LTEXT "IP ÁÖ¼Ò",IDC_STATIC,5,29,36,8 - LISTBOX IDC_SVR_ADDRESSES,53,29,70,12,LBS_NOSEL | NOT WS_BORDER | - WS_VSCROLL - PUSHBUTTON "ÁÖ¼Ò º¯°æ(&A)...",IDC_SVR_CHANGEADDR,144,28,77,12 - PUSHBUTTON "ÀÎÁõ ÇÊ¿ä(&R)",IDC_SVR_AUTH_YES,41,81,84,12 - PUSHBUTTON "¹ÌÀÎÁõ Çã¿ë(&U)",IDC_SVR_AUTH_NO,129,81,80,12 - LTEXT "ÆÄƼ¼Ç ¼ö:",IDC_STATIC,11,131,90,8 - LTEXT "(Á¶È¸ Áß)",IDC_SVR_NUMAGGREGATES,108,131,99,8 - LTEXT "ÃÑ ¿ë·®:",IDC_STATIC,11,148,48,8 - LTEXT "(Á¶È¸ Áß)",IDC_SVR_CAPACITY,108,148,99,8 - LTEXT "Á¶ÇÕµÈ º¼·ý ÇÒ´ç·®:",IDC_STATIC,11,165,79,8 - LTEXT "(Á¶È¸ Áß)",IDC_SVR_ALLOCATION,108,165,99,8 - ICON IDI_SERVER,IDC_STATIC,5,5,20,20 - LTEXT "(¼­¹ö À̸§)",IDC_SVR_NAME,55,13,93,8 - GROUPBOX "º¸¾È",IDC_STATIC,5,52,216,52 - GROUPBOX "±â¾ï¿µ¿ª",IDC_STATIC,5,115,216,68 - LTEXT "ÀÌ ¼­¹ö¿¡ ´ëÇÑ ¸ðµç ¾×¼¼½º°¡ ÀÎÁõµÇ¾î¾ß ÇÕ´Ï´Ù.", - IDC_STATIC,11,67,198,8 -END - -IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 221, 158 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - CONTROL "¼­¹ö¿¡ ÀÖ´Â ¸ðµç ÆÄƼ¼ÇÀÇ »ç¿ë·®ÀÌ", - IDC_SVR_WARN_AGGFULL,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,18,124,9 - EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,140,17,24,12,ES_AUTOHSCROLL - LTEXT "% ÀÎ °æ¿ì",IDC_STATIC,176,19,38,8 - CONTROL "¼­¹ö¿¡ ÀÖ´Â ¸ðµç º¼·ýÀÇ »ç¿ë·®ÀÌ",IDC_SVR_WARN_SETFULL, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,32,120,9 - EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,135,31,24,12,ES_AUTOHSCROLL - LTEXT "% ÀÎ °æ¿ì",IDC_STATIC,172,33,36,8 - CONTROL "¸ðµç ÆÄƼ¼ÇÀÇ Á¶ÇÕµÈ ÇÒ´ç·®ÀÌ ¿ë·®À» ÃʰúÇÒ °æ¿ì", - IDC_SVR_WARN_AGGALLOC,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,46,200,9 - CONTROL "¼­¹ö¿¡ ÀÖ´Â ¸ðµç ¼­ºñ½ºÀÇ ½ÇÇàÀÌ ÁßÁöµÈ °æ¿ì", - IDC_SVR_WARN_SVCSTOP,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,60,195,9 - CONTROL "¼­¹öÀÇ ¸ðµç º¼·ý¿¡ VLDB Ç׸ñÀÌ ¾øÀ» °æ¿ì", - IDC_SVR_WARN_SETNOVLDB,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,74,195,9 - CONTROL "VLDB°¡ ¼­¹öÀÇ ¸ðµç ¿ÀÇÁ¶óÀÎ ÆÄƼ¼ÇÀ» ÂüÁ¶ÇÒ °æ¿ì", - IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,88,195,9 - CONTROL "VLDB°¡ ¼­¹öÀÇ ¸ðµç ¿ÀÇÁ¶óÀÎ º¼·ýÀ» ÂüÁ¶ÇÒ °æ¿ì", - IDC_SVR_WARN_SETNOSERV,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,103,195,9 - CONTROL "¼­¹ö Á¤º¸¸¦ ",IDC_SVR_AUTOREFRESH,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,5,142,51,11 - LTEXT "´ÙÀ½ÀÇ °æ¿ì¿¡ °æ°í¸¦ Ç¥½ÃÇÕ´Ï´Ù",IDC_STATIC,5,5,195,8 - EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,65,140,27,13,ES_AUTOHSCROLL - LTEXT "ºÐ¸¶´Ù »õ·Î °íħ",IDC_STATIC,106,143,74,8 -END - -IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 225, 207 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - PUSHBUTTON "¼­ºñ½º ·Î±× º¸±â(&V)",IDC_SVC_VIEWLOG,55,182,66,14 - PUSHBUTTON "Áö±Ý ½ÃÀÛ(&S)",IDC_SVC_START,126,182,43,14 - PUSHBUTTON "Áö±Ý Á¤Áö(&P)",IDC_SVC_STOP,169,182,43,14 - CONTROL "ÀÌ ¼­¹ö°¡ Á¤ÁöÇÏ¸é °æ°í Ç¥½Ã(&W)",IDC_SVC_WARNSTOP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,159,200,10 - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "%2 ¼­ºñ½º(%1 ¼­¹ö)",IDC_SVC_NAME,52,13,168,8 - LTEXT "À¯Çü:",IDC_STATIC,5,29,44,8 - LTEXT "(Á¶È¸ Áß)",IDC_SVC_TYPE,52,29,168,8 - LTEXT "¸Å°³º¯¼ö:",IDC_STATIC,5,45,44,8 - EDITTEXT IDC_SVC_PARAMS,52,45,168,13,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP - LTEXT "ÁöÁ¤ÀÚ:",IDC_STATIC,5,61,44,8 - LTEXT "(Á¶È¸ Áß)",IDC_SVC_NOTIFIER,52,61,168,8 - LTEXT "ÃÖÁ¾ ½ÃÀÛ:",IDC_STATIC,5,77,44,8 - LTEXT "(Á¶È¸ Áß)",IDC_SVC_STARTDATE,52,77,168,8 - LTEXT "ÃÖÁ¾ Á¤Áö:",IDC_STATIC,5,93,44,8 - LTEXT "(Á¶È¸ Áß)",IDC_SVC_STOPDATE,52,90,168,8 - LTEXT "ÃÖÁ¾ Àå¾Ö:",IDC_STATIC,5,109,44,8 - EDITTEXT IDC_SVC_LASTERROR,52,109,168,13,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - GROUPBOX "¼­ºñ½º »óÅÂ",IDC_STATIC,5,127,215,75 - LTEXT "ÀÌ ¼­ºñ½ºÀÇ ÇöÀç »óŸ¦ ÆÇº° ÁßÀÔ´Ï´Ù...", - IDC_SVC_STATUS,11,142,200,8 -END - -IDD_SET_GENERAL DIALOGEX 0, 0, 273, 214 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - LTEXT "º¼·ý ID:",IDC_STATIC,5,30,39,8 - LTEXT "(¾Ë ¼ö ¾øÀ½)",IDC_SET_ID,49,30,219,8 - LTEXT "ÀÛ¼º:",IDC_STATIC,5,46,39,8 - LTEXT "(Á¶È¸ Áß)",IDC_SET_CREATEDATE,49,46,219,8 - LTEXT "°»½Å:",IDC_STATIC,5,62,39,8 - LTEXT "(Á¶È¸ Áß)",IDC_SET_UPDATEDATE,49,62,112,8 - LTEXT "¾×¼¼½º:",IDC_STATIC,5,78,39,8 - LTEXT "(Á¶È¸ Áß)",IDC_SET_ACCESSDATE,49,78,219,8 - LTEXT "¹é¾÷:",IDC_STATIC,5,94,39,8 - LTEXT "(Á¶È¸ Áß)",IDC_SET_BACKUPDATE,49,94,219,8 - LTEXT "ÆÄÀÏ °è¼ö:",IDC_STATIC,5,110,34,8 - LTEXT "(Á¶È¸ Áß)",IDC_SET_FILES,49,110,219,8 - LTEXT "»óÅÂ:",IDC_STATIC,5,126,39,8 - LTEXT "(Á¶È¸ Áß)",IDC_SET_STATUS,49,126,115,8 - PUSHBUTTON "Àá±Ý(&L)",IDC_SET_LOCK,169,124,49,12 - PUSHBUTTON "Àá±ÝÇØÁ¦(&U)",IDC_SET_UNLOCK,219,124,49,12 - LTEXT "»ç¿ë·®:",IDC_STATIC,5,142,31,8 - LTEXT "(Á¶È¸ Áß)",IDC_SET_USAGE,49,142,136,8 - PUSHBUTTON "ÇÒ´ç·® ¼³Á¤(&Q)...",IDC_SET_QUOTA,210,140,58,12 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,49,156,219,8, - WS_EX_STATICEDGE - CONTROL "ÀÌ º¼·ýÀÇ »ç¿ë·®ÀÌ ÃʰúµÇ¸é °æ°í Ç¥½Ã(&W)",IDC_SET_WARN, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,49,170,219,10 - CONTROL "ÀÌ ¼­¹öÀÇ ±âº» ÀÓ°è°ª(&D)(±× Å©±âÀÇ %1%%)", - IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,61,185,207,9 - CONTROL "ÀÓ°è°ª(&T)",IDC_SET_WARN_SETFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,61,199,44,9 - EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,115,197,29,12, - ES_AUTOHSCROLL - LTEXT "Å©±âÀÇ ¹éºÐÀ²",IDC_SET_WARN_SETFULL_DESC,163,199,86,8 - ICON IDI_FILESET,IDC_STATIC,5,5,20,20 - LTEXT "%3 º¼·ý(%1 ¼­¹ö, %2 ÆÄƼ¼Ç)",IDC_SET_NAME,49,14,219,8 -END - -IDD_MAIN DIALOGEX 0, 0, 317, 226 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | - WS_SYSMENU | WS_THICKFRAME -CAPTION "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -MENU MENU_MAIN -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¼±ÅÃµÈ ¼¿:",IDC_STATIC,2,8,55,8 - LTEXT "(¼¿ À̸§Àº ¿©±â¿¡ À§Ä¡ÇÕ´Ï´Ù)",IDC_CELL,62,8,208,9 - LTEXT "AFS ÅäÅ«:",IDC_STATIC,2,19,55,8 - LTEXT "%2:%1(ÅäÅ«Àº %3¿¡ ¸¸±âµË´Ï´Ù)",IDC_AFS_ID,62,19,217,9 - CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,31,313, - 193,WS_EX_CLIENTEDGE - CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 - ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 -STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "¼­¹ö" -CLASS "ServerWindowClass" -FONT 9, "±¼¸²" -BEGIN - CONTROL "",IDC_TABS,"SysTabControl32",0x0,2,2,205,133 -END - -IDD_SVC_CREATE DIALOGEX 0, 0, 225, 233 -STYLE WS_CHILD -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - LTEXT "¼­¹ö(&S):",IDC_STATIC,5,36,44,8 - COMBOBOX IDC_SVC_SERVER,52,33,116,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "¼­ºñ½º(&V):",IDC_STATIC,5,52,44,8 - COMBOBOX IDC_SVC_NAME,52,50,116,104,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "¸í·É(&C):",IDC_STATIC,5,70,44,8 - EDITTEXT IDC_SVC_COMMAND,52,68,168,13,ES_AUTOHSCROLL - LTEXT "¸Å°³º¯¼ö(&P):",IDC_STATIC,5,88,44,8 - EDITTEXT IDC_SVC_PARAMS,52,86,168,13,ES_AUTOHSCROLL - LTEXT "ÁöÁ¤ÀÚ(&N):",IDC_STATIC,5,105,44,8 - EDITTEXT IDC_SVC_NOTIFIER,52,103,168,13,ES_AUTOHSCROLL - LTEXT "·Î±× ÆÄÀÏ(&L):",IDC_STATIC,5,122,44,8 - EDITTEXT IDC_SVC_LOGFILE,52,120,168,13,ES_AUTOHSCROLL - CONTROL "´Ü¼ø(¿¬¼Ó ½ÇÇà)(&I)",IDC_SVC_TYPE_SIMPLE,"Button", - BS_AUTORADIOBUTTON,11,154,201,10 - CONTROL "Áö±Ý ÀÌ ¼­ºñ½º ½ÃÀÛ(&T)",IDC_SVC_RUNNOW,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 - CONTROL "FS(ÆÄÀÏ ½Ã½ºÅÛ)(&F)",IDC_SVC_TYPE_FS,"Button", - BS_AUTORADIOBUTTON,11,180,201,10 - CONTROL "Å©·Ð(ÁöÁ¤µÈ °£°ÝÀ¸·Î ½ÇÇà)(&C)",IDC_SVC_TYPE_CRON, - "Button",BS_AUTORADIOBUTTON,11,195,201,10 - LTEXT "½ÇÇà ½Ã±â(&W):",IDC_STATIC,23,209,41,8 - COMBOBOX IDC_SVC_RUNDAY,70,207,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "½Ã°£",IDC_STATIC,143,209,8,8 - CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,154,207, - 53,13,WS_EX_CLIENTEDGE - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "»õ·Î¿î ¼­ºñ½º",IDC_SVC_DESC,52,13,168,8 - GROUPBOX "¼­ºñ½º À¯Çü",IDC_STATIC,5,141,215,87 -END - -IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 -STYLE WS_CHILD -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, - 199,58,WS_EX_CLIENTEDGE - PUSHBUTTON "Áö±Ý ÇØÁ¦(&R)",IDC_SET_RELEASE,11,143,52,14 - PUSHBUTTON "ÀÛ¼º(&C)...",IDC_SET_REPSITE_ADD,129,143,38,14 - PUSHBUTTON "»èÁ¦(&L)",IDC_SET_REPSITE_DELETE,172,143,38,14 - LTEXT "¼­¹ö:",-1,11,31,37,8 - LTEXT "(¼­¹ö À̸§)",IDC_SET_SERVER,55,31,147,8 - LTEXT "ÆÄƼ¼Ç:",-1,11,44,37,8 - LTEXT "(ÆÄƼ¼Ç À̸§)",IDC_SET_AGGREGATE,55,44,147,8 - LTEXT "º¼·ý:",-1,11,18,37,8 - LTEXT "(º¼·ý À̸§)",IDC_SET_NAME,55,18,147,8 - GROUPBOX "º¼·ý Àбâ/¾²±â",-1,5,5,211,56 - GROUPBOX "º¼·ý º¹Á¦º»",-1,5,67,211,96 -END - -IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 257 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "¼¿ ¼±Åà - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¼¿(&C):",IDC_STATIC,4,24,16,8 - COMBOBOX IDC_OPENCELL_CELL,24,22,191,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - GROUPBOX "AFS ÀÎÁõ",IDC_STATIC,4,44,211,92 - LTEXT "AFS ½Äº°(&I):",IDC_STATIC,22,100,55,8 - EDITTEXT IDC_OPENCELL_ID,80,98,129,14,ES_AUTOHSCROLL - LTEXT "AFS ¾ÏÈ£(&P):",IDC_STATIC,22,116,55,8 - EDITTEXT IDC_OPENCELL_PASSWORD,80,114,129,14,ES_PASSWORD | - ES_AUTOHSCROLL - PUSHBUTTON "°í±Þ(&V) >>",IDC_ADVANCED,4,146,53,14 - DEFPUSHBUTTON "È®ÀÎ",IDOK,86,146,41,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,130,146,41,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,174,146,41,14 - CONTROL "ÀÌ ¼¿ÀÇ ¸ðµç ¼­¹ö ¸ð´ÏÅÍ(&L)",IDC_MON_ALL,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,10,204,109,9 - CONTROL "ÇϳªÀÇ ¼­¹ö¸¸ ¸ð´ÏÅÍ(&M):",IDC_MON_ONE,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,10,219,103,10 - EDITTEXT IDC_MON_SERVER,125,218,83,13,ES_AUTOHSCROLL - CONTROL "¼­ºê¼¼Æ®ÀÇ ¼­¹ö¸¸ ¸ð´ÏÅÍ(&S):",IDC_MON_SOME,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,10,235,110,10 - COMBOBOX IDC_MON_SUBSET,125,233,83,93,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "ÀÛ¾÷ÇÒ AFS ¼¿À» ¼±ÅÃÇϽʽÿÀ.",IDC_STATIC,4,7,200,8 - GROUPBOX "¼­¹ö ¸ð´ÏÅÍ",IDC_ADVANCED_GROUP,4,169,211,84 - LTEXT "´õ ºü¸¥ ¼º´ÉÀ» À§ÇØ ÀÌ ¼¿¿¡¼­ »ç¿ëÇÒ ¼ö ÀÖ´Â ¼­¹öÀÇ ºÎºÐÁýÇÕ¸¸ ¸ð´ÏÅÍÇÒ ¼ö ÀÖ½À´Ï´Ù.", - IDC_STATIC,10,182,199,17 - LTEXT "(Á¶È¸ Áß...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "¼¿À» °ü¸®ÇÏ·Á¸é, AFS ¾ÏÈ£¸¦ ´Ù½Ã ÀÔ·ÂÇØ¾ß ÇÕ´Ï´Ù.", - IDC_STATIC,10,85,196,8 - LTEXT "¼±ÅÃµÈ ¼¿¿¡ ÀÖ´Â ÇöÀç AFS ÅäÅ«:",IDC_STATIC,10,57,196,8 -END - -IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "°æ°í - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - CONTROL "ÀÛ¾÷ÀÌ Á¤»óÀûÀ¸·Î ¿Ï·áÇÒ ¶§±îÁö °è¼Ó ±â´Ù¸²(&C)", - IDC_TIMEOUT_WAIT,"Button",BS_AUTORADIOBUTTON,24,87,208, - 10 - CONTROL "ÀÛ¾÷À» Áö±Ý ÁߴܽÃÅ´(&T)",IDC_TIMEOUT_KILL,"Button", - BS_AUTORADIOBUTTON,24,101,208,10 - DEFPUSHBUTTON "È®ÀÎ",IDOK,93,139,50,14 - LTEXT "ÀÛ¾÷À» ½ÇÇàÇÏ´Â µ¥ ¼Ò¿äµÈ ½Ã°£:",IDC_STATIC,4,119,140, - 10 - LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,151,120,38,8 - LTEXT "³×Æ®¿öÅ© ÀÛ¾÷ÀÌ ¿À·£ ½Ã°£µ¿¾È ¿Ï·áÇÏÁö ¸øÇϰí ÀÖ½À´Ï´Ù.", - IDC_STATIC,4,7,228,18 - LTEXT "ÀÛ¾÷ÀÌ Á¾·áµÉ ¶§±îÁö ±â´Ù¸®°Å³ª(±ÇÀå) ÀÛ¾÷ÀÌ ³¡³ªÁö ¾ÊÀ» °ÍÀ¸·Î ÆÇ´ÜµÉ °æ¿ì AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥À¸·Î ÀÛ¾÷À» ÁߴܽÃų ¼ö ÀÖ½À´Ï´Ù.", - IDC_STATIC,4,30,228,26 - LTEXT "ÇöÀçÀÇ Ã¢ÀÌ Ç¥½ÃµÇ´Â µ¿¾È¿¡´Â ÀÛ¾÷ÀÌ °è¼Ó ÁøÇà ÁßÀ̶ó´Â Á¡À» À¯ÀÇÇϽʽÿÀ. ÀÛ¾÷ÀÌ Á¾·áµÇ¸é â ÀÚµ¿À¸·Î ´ÝÈü´Ï´Ù.", - IDC_STATIC,4,63,228,17 -END - -IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 -STYLE WS_POPUP | WS_CAPTION -CAPTION "Ä÷³" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¸ñ·Ï ³ª¿­½Ã Ç¥½ÃÇÒ Ä÷³ ¼±ÅÃ(&S).",IDC_STATIC,5,7,126,8 - COMBOBOX IDC_COLUMNS,134,5,147,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "»ç¿ë°¡´ÉÇÑ Ä÷³(&C):",IDC_STATIC,12,40,100,8 - LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "Ç¥½ÃÇÒ Ä÷³(&I):",IDC_STATIC,173,41,100,8 - LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Ãß°¡(&A) >>",IDC_COL_INSERT,119,68,46,14 - PUSHBUTTON "<< Á¦°Å(&R)",IDC_COL_DELETE,119,88,46,14 - PUSHBUTTON "À§·Î À̵¿(&U)",IDC_COL_UP,173,122,48,14 - PUSHBUTTON "¾Æ·¡·Î À̵¿(&D)",IDC_COL_DOWN,224,122,50,14 - GROUPBOX "Ä÷³ Ç¥½Ã",IDC_STATIC,5,25,276,118 -END - -IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 264, 72 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "»õ·Î °íħ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, - 256,8 - LTEXT "0%% ¿Ï·á",IDC_REFRESH_PERCENT,4,49,209,8 - LTEXT "",IDC_REFRESH_CURRENT,4,60,208,8 - LTEXT "±â´Ù¸®½Ê½Ã¿À...",IDC_REFRESH_DESC,4,7,256,25 - PUSHBUTTON "°Ç³Ê¶Ù±â(&S)",IDC_REFRESH_SKIP,217,56,43,12,NOT - WS_TABSTOP -END - -IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý ÀÛ¼º" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "À̸§(&N):",IDC_STATIC,4,30,39,8 - EDITTEXT IDC_SET_NAME,46,28,116,14,ES_AUTOHSCROLL - LTEXT "ÇÒ´ç·®(&Q):",IDC_STATIC,4,48,39,8 - EDITTEXT IDC_SET_QUOTA,46,46,32,14,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,98,47,33,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "¹é¾÷(&B):",IDC_STATIC,4,66,39,8 - CONTROL "ÀÌ º¼·ý¿¡ ´ëÇÑ ¹é¾÷ ¹öÀüµµ ÀÛ¼º(&R)",IDC_SET_CLONE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,67,162,8 - LTEXT "¼­¹ö(&S):",IDC_STATIC,4,84,39,8 - COMBOBOX IDC_SET_SERVER,46,82,116,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "ÆÄƼ¼Ç(&P):",IDC_STATIC,4,102,39,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,46,102,271, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "È®ÀÎ",IDOK,156,191,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,211,191,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,267,191,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "»õ·Î¿î º¼·ý",IDC_STATIC,46,12,170,8 -END - -IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 277, 102 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý »èÁ¦" -FONT 9, "±¼¸²" -BEGIN - DEFPUSHBUTTON "Ãë¼Ò",IDCANCEL,169,84,50,14 - PUSHBUTTON "È®ÀÎ",IDOK,115,84,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,223,84,50,14 - CONTROL "%1 ¼­¹ö, %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý »èÁ¦(&D)", - IDC_DELSET_SERVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 46,45,227,10 - CONTROL "%3 º¼·ý¿¡¼­ VLDB Ç׸ñ »èÁ¦(&V)",IDC_DELSET_VLDB,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,46,60,227,10 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "ÁÖÀÇ!\n\n%3 º¼·ýÀ» ¿µ±¸ÀûÀ¸·Î »èÁ¦ÇÕ´Ï´Ù.", - IDC_DELSET_DESC,31,7,242,33 -END - -IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "¹é¾÷ º¼·ý - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - DEFPUSHBUTTON "È®ÀÎ",IDOK,183,67,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,237,67,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,291,67,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,21,20 - LTEXT "º¼·ý ¹é¾÷Àº ±× º¼·ýÀÇ Àбâ Àü¿ë »çº»Ã³·³ µ¿ÀÛÇÕ´Ï´Ù. Àбâ/¾²±â º¼·ý¿¡´Â ¹é¾÷ ¹öÀüÀÌ Çϳª¸¸ ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù.", - IDC_STATIC,34,9,307,17 - LTEXT "È®ÀÎÀ» ´­·¯ %1 ¼­¹ö, %2 ÆÄƼ¼ÇÀÇ %3 º¼·ýÀÇ ¹é¾÷À» ÀÛ¼ºÇϽʽÿÀ. ÀÌ º¼·ýÀÇ ¹é¾÷ÀÌ ÀÌ¹Ì ÀÖÀ¸¸é, ±× ¹é¾÷ÀÌ °»½ÅµË´Ï´Ù.", - IDC_CLONE_DESC,34,32,307,24 -END - -IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - GROUPBOX "¹ß°ßµÈ ¹®Á¦Á¡",IDC_PROBLEM_BOX,5,36,215,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT - PUSHBUTTON "button 1",IDC_PROBLEM_REMEDY,138,120,61,12 - ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "%2 ¼­ºñ½º(%1 ¼­¹ö)",IDC_PROBLEM_TITLE,52,13,168,16 -END - -IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - GROUPBOX "¾Ë·ÁÁø ¹®Á¦Á¡",IDC_PROBLEM_BOX,5,36,216,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,172,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,201,49,10,83,SBS_VERT - PUSHBUTTON "button 1",IDC_PROBLEM_REMEDY,136,120,61,12 - ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "%1",IDC_PROBLEM_TITLE,42,13,179,8 -END - -IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - GROUPBOX "¾Ë·ÁÁø ¹®Á¦Á¡",IDC_PROBLEM_BOX,5,35,247,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT - PUSHBUTTON "button 1",IDC_PROBLEM_REMEDY,170,119,61,12 - ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "%2 ÆÄƼ¼Ç(%1 ¼­¹ö)",IDC_PROBLEM_TITLE,38,14,214,8 -END - -IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - GROUPBOX "¾Ë·ÁÁø ¹®Á¦Á¡",IDC_PROBLEM_BOX,5,35,263,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,250,45,12,67,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 - ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "%3 º¼·ý(%1 ¼­¹ö, %2 ÆÄƼ¼Ç)",IDC_PROBLEM_TITLE,49,14, - 219,8 -END - -IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý À̵¿" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,70,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "È®ÀÎ",IDOK,115,156,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,169,156,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,223,156,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,21,20 - LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,242,24 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 - LTEXT "´ÙÀ½À¸·Î º¼·ý À̵¿(&M):",IDC_STATIC,4,43,116,8 -END - -IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý À̵¿ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "%3 º¼·ýÀ» %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %4 ¼­¹öÀÇ %5 ÆÄƼ¼ÇÀ¸·Î À̵¿ ÁßÀÔ´Ï´Ù...", - IDC_MOVESET_DESC,4,41,229,19 -END - -IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 277, 106 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "·Î±× ÆÄÀÏ º¸±â" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¼­¹öÀÇ ·Î±× ÆÄÀÏ º¸±â(&S):",IDC_STATIC,10,45,73,8 - COMBOBOX IDC_VIEWLOG_SERVER,89,43,126,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "¼­¹ö¿¡¼­ ¿­¶÷ÇÒ ÆÄÀÏ(&F):",IDC_STATIC,10,64,73,8 - EDITTEXT IDC_VIEWLOG_FILENAME,89,62,179,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È®ÀÎ",IDOK,169,88,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,223,88,50,14 - ICON IDI_SERVICE,IDC_STATIC,4,4,20,20 - LTEXT "¿­¶÷ÇÒ ÆÄÀÏÀÇ Àüü °æ·Î¸¦ ÀÔ·ÂÇϽʽÿÀ.", - IDC_VIEWLOG_DESC,31,10,242,21 -END - -IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 286, 185 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "·Î±× ÆÄÀÏ º¸±â" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "ÆÄÀÏ ³»¿ë:",IDC_SVC_VIEWLOG_CONTENTS,4,41,277,8 - EDITTEXT IDC_VIEWLOG_TEXT,4,51,277,113,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL - PUSHBUTTON "´Ù¸¥ À̸§À¸·Î ÀúÀå(&A)...",IDC_VIEWLOG_SAVEAS,145,167, - 81,14 - DEFPUSHBUTTON "´Ý±â(&C)",IDOK,231,167,50,14 - ICON IDI_SERVICE,-1,4,7,20,20 - LTEXT "%1 ¼­¹öÀÇ ·Î±× ÆÄÀÏ [%2 ¼­ºñ½º¿¡ ´ëÇØ]", - IDC_SVC_VIEWLOG_DESC,33,7,248,8 - LTEXT "¼­¹ö¿¡¼­ÀÇ ÆÄÀÏ À̸§: %1",IDC_SVC_VIEWLOG_FILENAME,33, - 23,248,8 -END - -IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý ÇÒ´ç·® ¼³Á¤" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - LTEXT "ÇöÀç ÇÒ´ç·®:",IDC_STATIC,4,49,47,8 - LTEXT "(¾Ë ¼ö ¾øÀ½)",IDC_SET_USAGE,59,49,208,8 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,59,60,208,8, - WS_EX_STATICEDGE - LTEXT "»õ ÇÒ´ç·®(&Q):",IDC_STATIC,4,81,47,8 - EDITTEXT IDC_SET_QUOTA,59,79,32,13,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,103,79,30,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "È®ÀÎ",IDOK,109,112,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,163,112,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,217,112,50,14 - PUSHBUTTON "Ư¼º(&P)...",IDC_AGG_PROPERTIES,212,28,55,12 - LTEXT "ÆÄƼ¼Ç:",IDC_STATIC,4,30,47,8 - LTEXT "%1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç",IDC_SET_AGGREGATE,59,30,141,8 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "%1 º¼·ý",IDC_SET_NAME,59,11,208,8 -END - -IDD_ACTIONS DIALOGEX 0, 0, 236, 58 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "ÁøÇà ÁßÀÎ Á¶ÀÛ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - LTEXT "´ÙÀ½ Á¶ÀÛÀÌ ÇöÀç ÁøÇà ÁßÀÔ´Ï´Ù.",IDC_ACTION_DESC,2,2, - 232,8 - CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | - 0x3,2,14,232,43 -END - -IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "VLDB µ¿±âÈ­" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - DEFPUSHBUTTON "È®ÀÎ",IDOK,107,81,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,161,81,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,215,81,50,14 - ICON 32515,IDC_STATIC,4,4,21,20 - LTEXT "(½ÇÇà Áß ¼³Á¤)",IDC_SYNC_DESC,37,4,228,32 - LTEXT "(½ÇÇà Áß ¼³Á¤)",IDC_SYNC_DESC2,37,44,228,24 -END - -IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý º¹Á¦" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,62,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "È®ÀÎ",IDOK,115,153,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,169,153,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,223,153,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,21,20 - LTEXT "%3 º¼·ýÀÇ »õ º¹Á¦º»",IDC_SET_NAME,31,12,242,8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 - LTEXT "´ÙÀ½¿¡¼­ ÀÌ º¼·ýÀÇ »õ º¹Á¦º» ÀÛ¼º(&C):",IDC_STATIC,4,35, - 125,8 -END - -IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 248, 156 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ÆÄÀÏ ¼³Ä¡" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¿øº» ÆÄÀÏ(&F):",IDC_STATIC,4,74,49,8 - EDITTEXT IDC_FILENAME,56,72,135,14,ES_AUTOHSCROLL - PUSHBUTTON "ã¾Æº¸±â(&B)...",IDC_BROWSE,194,72,50,14 - LTEXT "¸ñÇ¥ ¼­¹ö(&S):",IDC_STATIC,4,94,45,8 - COMBOBOX IDC_SERVER,56,92,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "¸ñÇ¥ À̸§(&N):",IDC_STATIC,4,114,49,8 - EDITTEXT IDC_DIRECTORY,56,112,135,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È®ÀÎ",IDOK,86,138,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,140,138,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,194,138,50,14 - ICON IDI_INSTALL,IDC_STATIC,4,4,20,20 - LTEXT "¼­¹ö¿¡ ÆÄÀÏ ¼³Ä¡",IDC_STATIC,32,12,127,8 - LTEXT "(½ÇÇà Áß ¼³Á¤µÈ ÅØ½ºÆ®)\n(½ÇÇà Áß ¼³Á¤µÈ ÅØ½ºÆ®)\n(½ÇÇà Áß ¼³Á¤µÈ ÅØ½ºÆ®)\n(½ÇÇà Áß ¼³Á¤µÈ ÅØ½ºÆ®)", - IDC_INSTALL_DESC,4,29,240,33 -END - -IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ÆÄÀÏ ¼³Ä¡ ÇØÁ¦" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¼­¹ö(&S):",IDC_STATIC,4,66,31,8 - COMBOBOX IDC_SERVER,41,64,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "¸ñÇ¥ ÆÄÀÏ(&F):",IDC_STATIC,4,85,32,8 - EDITTEXT IDC_FILENAME,41,83,175,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È®ÀÎ",IDOK,88,121,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,141,121,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,194,121,50,14 - ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 - LTEXT "¼­¹ö¿¡¼­ ÆÄÀÏ ¼³Ä¡¸¦ ÇØÁ¦ÇÕ´Ï´Ù",IDC_STATIC,32,12,127,8 - LTEXT "ÀÌ Á¶ÀÛÀ» »ç¿ëÇÏ¿© »çÀü¿¡ ¼³Ä¡µÈ ÆÄÀÏÀÇ »çº»À» ƯÁ¤ ¼­¹ö¿¡ º¹¿øÇÒ ¼ö ÀÖ½À´Ï´Ù. ¼±ÅÃµÈ ÆÄÀÏÀÇ »çÀü ¼³Ä¡ »çº»ÀÌ ¾øÀ¸¸é, ÆÄÀÏÀº Á¦°ÅµË´Ï´Ù.", - IDC_STATIC,4,29,240,26 -END - -IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 200, 141 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ÀÌÀü ÆÄÀÏ Á¤¸®" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¼­¹ö:",-1,4,56,44,8 - COMBOBOX IDC_SERVER,53,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "¸ðµç ÄÚ¾î ÆÄÀÏ »èÁ¦(&C)",IDC_OP_DELETE_CORE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,53,73,143,9 - CONTROL "¸ðµç .&BAK ÆÄÀÏ(ÆÄÀÏ ¹é¾÷) »èÁ¦",IDC_OP_DELETE_BAK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,84,143,8 - CONTROL "¸ðµç .OLD ÆÄÀÏ(ÀÌÀü ÆÄÀÏ ¹é¾÷) »èÁ¦(&O)", - IDC_OP_DELETE_OLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 53,96,143,9 - DEFPUSHBUTTON "È®ÀÎ",IDOK,39,123,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,93,123,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,146,123,50,14 - ICON IDI_PRUNE,-1,4,4,20,20 - LTEXT "¼­¹ö¿¡¼­ ÀÌÀü ÆÄÀÏÀ» Á¤¸®ÇÕ´Ï´Ù",-1,32,12,117,8 - LTEXT "ÀÌ Á¶ÀÛÀº ƯÁ¤ ¼­¹ö¿¡ ¼³Ä¡µÈ ÆÄÀÏÀÇ ¹é¾÷ »çº»À» »èÁ¦ÇÕ´Ï´Ù.", - -1,4,29,192,16 - LTEXT "»èÁ¦ÇÒ ÆÄÀÏ:",-1,4,73,45,8 -END - -IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý À̸§ º¯°æ" -FONT 9, "±¼¸²" -BEGIN - LTEXT "ÀÌÀü À̸§(&O):",IDC_STATIC,31,67,39,8 - EDITTEXT IDC_RENSET_OLD,74,65,122,14,ES_AUTOHSCROLL | ES_READONLY - LTEXT "»õ À̸§(&N):",IDC_STATIC,31,85,39,8 - EDITTEXT IDC_RENSET_NEW,74,83,122,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È®ÀÎ",IDOK,115,115,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,169,115,50,14 - PUSHBUTTON "µµ¿ò¸»",9,223,115,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "%3 º¼·ýÀÇ À̸§À» º¯°æÇÏ·Á¸é, ¾Æ·¡¿¡ »õ À̸§À» ÀÔ·ÂÇϽʽÿÀ. À̸§À» º¯°æÇÏ¸é º¼·ýÀÇ ¹é¾÷ ¹× ±× º¹Á¦º»ÀÌ ¸ðµÎ ÀÚµ¿À¸·Î º¯°æµË´Ï´Ù.\n\nÁÖÀÇ: ¸¶¿îÆ®µÈ º¼·ýÀÇ À̸§À» º¯°æÇÒ °æ¿ì¿¡´Â ÇØ´ç ¸¶¿îÆ® Æ÷ÀÎÆ®¸¦ »èÁ¦ÇÏ°í ´Ù½Ã ÀÛ¼ºÇØ¾ß ÇÕ´Ï´Ù.", - IDC_RENSET_DESC,31,7,242,48 -END - -IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 294, 85 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "¼­ºñ½º »èÁ¦" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - DEFPUSHBUTTON "Ãë¼Ò",IDCANCEL,169,67,50,14 - PUSHBUTTON "È®ÀÎ",IDOK,115,67,50,14 - PUSHBUTTON "µµ¿ò¸»",9,240,67,50,14 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "ÁÖÀÇ!\n\nÀÌ Á¶ÀÛÀ¸·Î ÀÎÇØ %2 ¼­ºñ½º°¡ Á¤ÁöµÇ°í %1 ¼­¹ö·ÎºÎÅÍ »èÁ¦µË´Ï´Ù.", - IDC_DELSVC_DESC,48,7,242,37 -END - -IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ÆÄÀÏ ³¯Â¥ È®º¸" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¼­¹ö(&S):",-1,10,55,42,8 - COMBOBOX IDC_SERVER,66,56,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Á¶È¸ÇÒ ÆÄÀÏ(&F):",-1,10,75,53,8 - EDITTEXT IDC_FILENAME,66,72,135,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È®ÀÎ",IDOK,86,107,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,140,107,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,194,107,50,14 - ICON IDI_GETDATES,-1,4,4,20,21 - LTEXT "¼­¹ö¿¡¼­ ÆÄÀÏ ³¯Â¥¸¦ È®º¸ÇϽʽÿÀ",-1,32,12,127,8 - LTEXT "ÀÌ Á¶ÀÛÀ» ÅëÇØ ÆÄÀÏ ¹× ±× ¹é¾÷(ÀÖ´Â °æ¿ì)ÀÌ ÃÖÁ¾ ¼öÁ¤µÈ ³¯Â¥¸¦ È®º¸ÇÕ´Ï´Ù.", - -1,4,29,240,16 -END - -IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ÆÄÀÏ ³¯Â¥ È®º¸ - °á°ú" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¼­¹ö:",IDC_STATIC,10,31,39,8 - LTEXT "(½ÇÇà Áß ¼³Á¤)",IDC_SERVER,51,31,137,8 - LTEXT "ÆÄÀÏ À̸§:",IDC_STATIC,10,47,39,8 - LTEXT "(½ÇÇà Áß ¼³Á¤)",IDC_FILENAME,51,47,137,8 - LTEXT "ÆÄÀÏ ³¯Â¥:",IDC_STATIC,10,61,39,8 - LTEXT "(¾Ë ¼ö ¾øÀ½. ÆÄÀÏÀ» ãÀ» ¼ö ¾øÀ½)",IDC_DATE_FILE,51,61, - 184,8 - LTEXT ".BAK ³¯Â¥:",IDC_STATIC,10,77,39,8 - LTEXT "(¾Ë ¼ö ¾øÀ½. ÆÄÀÏÀ» ãÀ» ¼ö ¾øÀ½)",IDC_DATE_BAK,51,77, - 179,8 - LTEXT ".OLD ³¯Â¥:",IDC_STATIC,10,91,39,8 - LTEXT "(¾Ë ¼ö ¾øÀ½. ÆÄÀÏÀ» ãÀ» ¼ö ¾øÀ½)",IDC_DATE_OLD,51,91, - 180,8 - DEFPUSHBUTTON "´Ý±â(&C)",IDOK,99,114,50,14 - ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 - LTEXT "¼­¹ö¿¡¼­ ÆÄÀÏ ³¯Â¥¸¦ È®º¸ÇϽʽÿÀ",IDC_STATIC,32,12,127, - 8 -END - -IDD_SET_DUMP DIALOGEX 0, 0, 295, 144 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý ´ýÇÁ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "ÀÛ¼ºµÉ ´ýÇÁ ÆÄÀÏ ÀÛ¼º(&N):",IDC_STATIC,4,42,77,8 - EDITTEXT IDC_DUMP_FILENAME,86,40,143,14,ES_AUTOHSCROLL - PUSHBUTTON "ã¾Æº¸±â(&B)...",IDC_DUMP_BROWSE,237,40,48,14 - CONTROL "%3 º¼·ýÀÇ Àüü ³»¿ë ´ýÇÁ(ÆÄƼ¼Ç %1:%2)(&E)", - IDC_DUMP_FULL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10, - 78,197,10 - CONTROL "´ÙÀ½ ÀÌÈÄ¿¡ º¯°æµÈ ÆÄÀϸ¸ ´ýÇÁ(&S)",IDC_DUMP_LIMIT_TIME, - "Button",BS_AUTORADIOBUTTON,10,94,141,10 - CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,160,93,51, - 13,WS_EX_CLIENTEDGE - CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,218,93,56, - 13,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "È®ÀÎ",IDOK,131,126,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,185,126,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,241,126,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "ÀÌ Á¶ÀÛÀº º¼·ýÀÇ ³»¿ëÀ» ÇϳªÀÇ ÆÄÀÏ·Î º¹»çÇϹǷΠº¼·ýÀ» ½±°Ô ¹é¾÷ÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÌ·± ¹æ¹ýÀ¸·Î ´ýÇÁµÈ º¼·ýÀÇ ³»¿ëÀº ³ªÁß¿¡ º¹¿øµË´Ï´Ù.", - IDC_STATIC,30,7,261,24 - GROUPBOX "´ýÇÁ ¸Å°³º¯¼ö",IDC_STATIC,4,62,287,53 -END - -IDD_SET_RESTORE DIALOGEX 0, 0, 292, 248 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý º¹¿ø - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "º¹¿øÇÒ ÆÄÀÏ(&R):",IDC_STATIC,4,33,48,8 - EDITTEXT IDC_RESTORE_FILENAME,57,30,175,14,ES_AUTOHSCROLL - PUSHBUTTON "ã¾Æº¸±â(&B)...",IDC_RESTORE_BROWSE,238,30,50,14 - CONTROL "ÁõºÐ ´ýÇÁ ÆÄÀÏÀÓ(&I)",IDC_RESTORE_INCREMENTAL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,57,46,86,10 - LTEXT "º¼·ý(&V):",IDC_STATIC,11,102,23,8 - EDITTEXT IDC_RESTORE_SETNAME,50,100,115,14,ES_AUTOHSCROLL - LTEXT "¼­¹ö(&S):",IDC_STATIC,11,145,24,8 - COMBOBOX IDC_RESTORE_SERVER,51,143,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "ÆÄƼ¼Ç(&P):",IDC_STATIC,11,162,36,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,50,161,231, - 55,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "È®ÀÎ",IDOK,128,230,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,183,230,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,238,230,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "´ýÇÁ ÆÄÀϷκÎÅÍ º¼·ýÀ» º¹¿øÇϽʽÿÀ",IDC_STATIC,33,11, - 224,8 - GROUPBOX "¸ñÇ¥ º¼·ý",IDC_STATIC,4,63,284,160 - LTEXT "´ýÇÁ ÆÄÀϷκÎÅÍ º¼·ýÀ» º¹¿øÇÒ ¶§ »õ º¼·ýÀ» ÀÛ¼ºÇϰųª ±âÁ¸ÀÇ Àбâ/¾²±â º¼·ý¿¡ °ãÃľµ ¼ö ÀÖ½À´Ï´Ù.", - IDC_STATIC,11,78,259,16 - LTEXT "(½ÇÇà Áß ¼³Á¤)\n(½ÇÇà Áß ¼³Á¤)",IDC_RESTORE_CREATE,51, - 119,229,17 -END - -IDD_SVC_BOS DIALOGEX 0, 0, 225, 207 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - CONTROL "ÀÌ ¼­¹ö¿¡¼­ Á¤±âÀûÀ¸·Î ¸ðµç ¼­ºñ½º¸¦ Á¤ÁöÇÏ°í ´Ù½Ã ½ÃÀÛ(&P)", - IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, - 71,201,10 - LTEXT "Àç½ÃÀÛ(&R)",IDC_BOS_GENRES_DESC1,23,87,25,8 - COMBOBOX IDC_BOS_GENRES_DATE,54,84,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "½Ã°£(&A)",IDC_BOS_GENRES_DESC2,127,87,8,8 - CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,138, - 84,53,13,WS_EX_CLIENTEDGE - CONTROL "»õ ÀÌÁø ÆÄÀÏÀÇ °æ¿ì ¸ðµç ¼­ºñ½º¸¦ Á¤±âÀûÀ¸·Î °Ë»ç(&B)", - IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, - 151,201,10 - LTEXT "°Ë»ç(&S)",IDC_BOS_BINRES_DESC1,23,167,25,8 - COMBOBOX IDC_BOS_BINRES_DATE,54,164,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "½Ã°£(&T)",IDC_BOS_BINRES_DESC2,127,167,8,8 - CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,138, - 164,53,13,WS_EX_CLIENTEDGE - ICON IDI_BOSSERVICE,IDC_STATIC,5,5,20,20 - LTEXT "%2 ¼­ºñ½º(%1 ¼­¹ö)",IDC_SVC_NAME,46,13,174,8 - GROUPBOX "BOS ¼­ºñ½º",IDC_STATIC,5,27,215,175 - LTEXT "BOS ¼­ºñ½º¸¦ »ç¿ëÇÏ¿© ÀÌ ¼­¹öÀÇ ¸ðµç ¼­ºñ½º¸¦ Á¤±âÀûÀ¸·Î Á¤ÁöÇÏ°í ´Ù½Ã ½ÃÀÛÇÒ ¼ö ÀÖ½À´Ï´Ù(BOS ¼­ºñ½º ÀÚü Æ÷ÇÔ).", - IDC_STATIC,11,45,200,18 - LTEXT "¶ÇÇÑ BOS ¼­ºñ½º¸¦ »ç¿ëÇÏ¿© ¼­¹öÀÇ ¸ðµç ¼­ºñ½º¸¦ Á¤±âÀûÀ¸·Î °Ë»çÇϰí ÀÌÁø ÆÄÀÏÀÌ °»½ÅµÈ ¼­ºñ½º¸¸ Á¤ÁöÇÏ°í ´Ù½Ã ½ÃÀÛÇÒ ¼ö ÀÖ½À´Ï´Ù.", - IDC_STATIC,11,118,200,25 -END - -IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý ´ýÇÁ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "%3 º¼·ý¿¡¼­ %4 ´ýÇÁ ÆÄÀÏ ÀÛ¼º Áß...",IDC_DUMPSET_DESC,4, - 41,229,19 -END - -IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý º¹¿ø - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "%2 ´ýÇÁ ÆÄÀÏ¿¡¼­ %1 º¼·ý º¹¿ø Áß...", - IDC_RESTORESET_DESC,4,41,229,19 -END - -IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 258, 163 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý ¹é¾÷ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - CONTROL "ÀÌ ¼¿ÀÇ ¸ðµç º¼·ý¿¡ ´ëÇÑ ¹é¾÷ ¹öÀü ÀÛ¼º(&A)", - IDC_CLONE_ALL,"Button",BS_AUTORADIOBUTTON,30,46,214,10 - GROUPBOX " ",IDC_STATIC,23,68,231,67 - CONTROL "´ÙÀ½ ±âÁذú ÀÏÄ¡ÇÏ´Â º¼·ý¿¡ ´ëÇÑ ¹é¾÷¸¸ ÀÛ¼º(&O)", - IDC_CLONE_SOME,"Button",BS_AUTORADIOBUTTON,30,60,214,10 - CONTROL "¼­¹ö¿¡ ÀÖ´Â º¼·ý¸¸(&S):",IDC_CLONE_SVR_LIMIT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,41,83,92,10 - COMBOBOX IDC_CLONE_SVR,152,82,85,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "ÆÄƼ¼Ç¿¡ ÀÖ´Â º¼·ý¸¸(&P):",IDC_CLONE_AGG_LIMIT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,41,99,97,10 - COMBOBOX IDC_CLONE_AGG,152,98,85,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "´ÙÀ½À¸·Î ½ÃÀÛÇÏ´Â º¼·ý¸¸(&B):",IDC_CLONE_PREFIX_LIMIT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,41,116,106,10 - EDITTEXT IDC_CLONE_PREFIX,152,115,85,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È®ÀÎ",IDOK,95,145,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,149,145,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,204,145,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "º¼·ý ¹é¾÷Àº ±× º¼·ýÀÇ Àбâ Àü¿ë »çº»Ã³·³ µ¿ÀÛÇÕ´Ï´Ù. Àбâ/¾²±â º¼·ý¿¡´Â ÇϳªÀÇ ¹é¾÷ ¹öÀü¸¸ ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù.\n\nµ¿½Ã¿¡ Çϳª ÀÌ»óÀÇ º¼·ý¿¡ ´ëÇÑ ¹é¾÷ ¹öÀüÀ» ÀÛ¼ºÇÒ ¼ö ÀÖ½À´Ï´Ù.", - IDC_STATIC,30,7,216,34 -END - -IDD_SUBSETS DIALOGEX 0, 0, 281, 182 -STYLE WS_POPUP | WS_CAPTION -CAPTION "¸ð´ÏÅ͵Ǵ ¼­¹ö" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - LTEXT "¼­ºê¼¼Æ® À̸§:",IDC_STATIC,12,77,56,8 - EDITTEXT IDC_SUBSET_NAME,74,75,106,14,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_TABSTOP - PUSHBUTTON "¿­±â(&O)...",IDC_SUBSET_LOAD,185,75,39,14 - PUSHBUTTON "ÀúÀå(&S)...",IDC_SUBSET_SAVE,229,75,39,14 - CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x153,12,111,193,58,WS_EX_CLIENTEDGE - PUSHBUTTON "ÀüºÎ ¸ð´ÏÅÍÇÔ(&A)",IDC_SUBSET_ALL,211,122,57,14 - PUSHBUTTON "¸ð´ÏÅÍ ¾ÈÇÔ(&N)",IDC_SUBSET_NONE,211,140,57,14 - LTEXT "Å« ¼¿¿¡¼­ ÀÛ¾÷ÇÒ ¶§ ¼º´ÉÀ» Çâ»ó½ÃŰ·Á¸é ¹®Á¦Á¡À» ã±â À§ÇØ Æ¯Á¤ ¼­¹ö¸¦ ¸ð´ÏÅÍÇÏÁö ¸¶½Ê½Ã¿À. AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº ¸ð´ÏÅ͵ÇÁö ¾ÊÀº ¼­¹öÀÇ º¼·ý, ÆÄƼ¼Ç ¶Ç´Â ¼­ºñ½º¸¦ Ç¥½ÃÇÏÁö ¾Ê½À´Ï´Ù.", - IDC_STATIC,5,5,271,24 - LTEXT "¾ðÁ¦µçÁö ¼­¹ö¸¦ ¸ð´ÏÅÍ(¶Ç´Â ¸ð´ÏÅÍÇÏÁö ¾ÊÀ» ¼ö ÀÖÀ½)ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¼­¹ö ¼­ºê¼¼Æ®¸¦ ÀÛ¼ºÇÏ¿© ¸ð´ÏÅÍÇÒ ¼­¹ö ¸ñ·ÏÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.", - IDC_STATIC,5,37,271,18 - GROUPBOX "ÇöÀç ¼­ºê¼¼Æ®",IDC_STATIC,5,63,271,114 - LTEXT "¸ð´ÏÅÍÇÒ ¼­¹ö:",IDC_STATIC,12,95,60,8 -END - -IDD_SUBSET_LOADSAVE DIALOG DISCARDABLE 0, 0, 280, 145 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | - WS_CAPTION | WS_SYSMENU -CAPTION "(½ÇÇà Áß ¼³Á¤µÈ Á¦¸ñ)" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¼­ºê¼¼Æ® À̸§(&N):",1090,5,112,45,8,SS_NOTIFY - EDITTEXT IDC_SUBSET_NAME,54,110,165,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "¿­±â(&O)",IDOK,226,110,50,14 - PUSHBUTTON "Ãë¼Ò(&L)",IDCANCEL,226,127,50,14 - CONTROL "List1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | - LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,272,82, - WS_EX_CLIENTEDGE - PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT - WS_TABSTOP - PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT - WS_TABSTOP - LTEXT "ÀÌ ¼¿¿¡ ´ëÇØ Á¤ÀÇµÈ ¼­ºê¼¼Æ®:",IDC_STATIC,4,6,114,8 -END - -IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "ã±â ¸í·É" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - COMBOBOX IDC_FIND_COMMAND,4,38,137,170,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "µµ¿ò¸» Ç¥½Ã(&H)",IDOK,147,38,67,14 - PUSHBUTTON "Ãë¼Ò(&C)",IDCANCEL,147,55,67,14 - LTEXT "ÀÛ¾÷À» ¼öÇàÇϱâ À§ÇØ AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥À» »ç¿ëÇÏ´Â ¹æ¹ýÀ» ¾Ë¾Æº¸·Á¸é, ¾Æ·¡ÀÇ ¸í·ÉÇàÀ» ¼±ÅÃÇÏ°í µµ¿ò¸» Ç¥½Ã ´ÜÃ߸¦ ´©¸£½Ê½Ã¿À.", - IDC_STATIC,4,4,210,25 -END - -IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 141 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "¿À·ù ÄÚµå ã±â" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¿À·ù ¹øÈ£(&E):",IDC_STATIC,4,41,45,8 - EDITTEXT IDC_ERROR_NUMBER,59,39,78,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "º¯È¯(&T)",IDC_ERROR_TRANSLATE,147,39,67,14 - PUSHBUTTON "´Ý±â(&C)",IDCANCEL,85,123,48,14 - LTEXT "(½ÇÇà Áß ¼³Á¤µÈ ÅØ½ºÆ®)",IDC_ERROR_DESC,4,71,210,42 - LTEXT "¿À·ù ÄÚµåÀÇ Àǹ̸¦ ¾Ë¾Æº¸·Á¸é, ¾Æ·¡¿¡ Äڵ带 ÀÔ·ÂÇϰí ""º¯È¯"" ´ÜÃ߸¦ ´©¸£½Ê½Ã¿À.", - IDC_STATIC,4,4,210,25 - CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 -END - -IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇÑ Á¤º¸" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 - LTEXT "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ ¹öÀü 3.5",IDC_STATIC,33,8,163,8 - LTEXT "Copyright IBM Corporation 1989, 1999",IDC_STATIC,33,20, - 183,8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 - CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 - PUSHBUTTON "´Ý±â(&C)",IDOK,89,123,50,14 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 -END - -IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼¿¿¡ ÀÖ´Â ¼­¹ö¸¦ Ž»ö ÁßÀÔ´Ï´Ù...", - IDC_OPENCELL_DESC,41,15,183,16 - GROUPBOX "",IDC_STATIC,4,2,231,39 - ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 279, 136 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - CONTROL "¼­¹öÀÇ ¿ÏÀüÇÑ µµ¸ÞÀÎ À̸§ Ç¥½Ã(¿¹: ""machine.company.com"")", - IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,5,269,10 - CONTROL "°ü¸® ÅäÅ« ¾øÀÌ ÀÛ¾÷ÇÏ´Â °æ¿ì, °æ°í Ç¥½Ã(&W)", - IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,19,269,10 - CONTROL "Ç×»ó ±× ¼­¹öÀÇ Æ¯¼º Ç¥½Ã",IDC_OPT_SVR_DBL_PROP,"Button", - BS_AUTORADIOBUTTON,21,50,253,10 - CONTROL "ºü¸¥ º¸±â ºÐÇÒ ¿µ¿ªÀÌ ¿­·Á ÀÖÀ» ¶§¸¸ ±× ¼­¹öÀÇ Æ¯¼º Ç¥½Ã", - IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON,21, - 63,253,10 - CONTROL "¾ðÁ¦³ª ±× ¼­¹ö¿¡ ´ëÇÑ Ã¢À» ¿­¾î ³õÀ½", - IDC_OPT_SVR_DBL_OPEN,"Button",BS_AUTORADIOBUTTON,21,75, - 253,10 - CONTROL "±× ¼­¹ö°¡ ¸ð´ÏÅ͵ǵµ·Ï ¼­¹ö â ¿­±â", - IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,21,107,253,10 - CONTROL "±× ¼­¹ö°¡ ¸ð´ÏÅ͵ÇÁö ¾Êµµ·Ï ¼­¹ö ⠴ݱâ", - IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,21,121,253,10 - LTEXT "¼­¹öÀÇ ¾ÆÀÌÄÜÀ» µÎ ¹ø ´©¸£´Â °æ¿ì",IDC_STATIC,5,38,269, - 8 - LTEXT "¼­¹ö ¼­ºê¼¼Æ®¸¦ »ç¿ë ÁßÀÌ°í ºü¸¥ º¸±â ºÐÇÒ ¿µ¿ªÀÌ ´ÝÈù °æ¿ì", - IDC_STATIC,5,95,269,8 -END - -IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,22,216, - 135,WS_EX_CLIENTEDGE - PUSHBUTTON "¼­¹ö Ű Ãß°¡(&A)",IDC_KEY_ADD,72,160,65,14 - PUSHBUTTON "¼­¹ö Ű Á¦°Å(&R)",IDC_KEY_REMOVE,141,160,80,14 - LTEXT "¼­¹ö¿ë Ű:",IDC_KEY_NAME,5,7,216,8 -END - -IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "¼­¹ö Ű Ãß°¡" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¹öÀü:",IDC_STATIC,7,37,26,8 - EDITTEXT IDC_KEY_VERSION,43,35,43,14,ES_AUTOHSCROLL - LTEXT "°ª:",IDC_STATIC,7,58,21,8 - CONTROL "ÇØ´ç ¹®ÀÚ¿­ ¾Ïȣȭ:",IDC_KEY_BYSTRING,"Button", - BS_AUTORADIOBUTTON,43,58,73,10 - CONTROL "ÇØ´ç Ű »ç¿ë:",IDC_KEY_BYDATA,"Button", - BS_AUTORADIOBUTTON,43,76,57,10 - EDITTEXT IDC_KEY_STRING,119,56,155,14,ES_PASSWORD | - ES_AUTOHSCROLL - EDITTEXT IDC_KEY_DATA,119,75,103,14,ES_AUTOHSCROLL - PUSHBUTTON "ÀÓÀǼ±ÅÃ(&R)",IDC_KEY_RANDOM,226,75,48,14 - LTEXT "ÁÖÀÇ: ¼­¹ö¿¡ »õ ۸¦ Ãß°¡ÇÑ ÈÄ AFS °èÁ¤À» ¼öÁ¤ÇÏ¿© »õ ۸¦ »ç¿ëÇØ¾ß ÇÕ´Ï´Ù. ¸çÄ¥ÀÌ Áö³ª¸é ÀÌÀü ¼­¹ö ۸¦ Á¦°ÅÇÒ ¼ö ÀÖ½À´Ï´Ù.", - IDC_STATIC,7,99,267,18 - DEFPUSHBUTTON "È®ÀÎ",IDOK,116,129,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,170,129,50,14 - PUSHBUTTON "µµ¿ò¸»",9,224,129,50,14 - LTEXT "%1 ¼­¹ö¿¡ ´ëÇÑ »õ Ű",IDC_KEY_TITLE,43,14,181,8 - ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 -END - -IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 293, 149 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "¼­ºñ½º ½ÃÀÛ/Á¤Áö" -FONT 9, "±¼¸²" -BEGIN - DEFPUSHBUTTON "È®ÀÎ",IDOK,115,131,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,169,131,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,239,131,50,14 - ICON IDI_SERVICE,IDC_STATIC,4,7,20,21 - LTEXT "È®ÀÎÀ» ´­·¯ %1 ¼­¹öÀÇ %2 ¼­ºñ½º¸¦ ½ÃÀÛ/Á¤ÁöÇϽʽÿÀ", - IDC_STARTSTOP_TEXT,47,12,242,9 - CONTROL "¿µ±¸(&P)(IDS_START/STOPSERVICE_PERMANENT)", - IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON,37, - 81,226,10 - CONTROL "ÀÓ½Ã(&T)(IDS_START/STOPSERVICE_TEMPORARY)", - IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON,37, - 97,226,10 - GROUPBOX "¼­ºñ½º ½Ãµ¿",IDC_STATIC,33,32,256,78 - LTEXT "%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛÇÒ ¶§ ÀÚµ¿À¸·Î %2 ¼­ºñ½º¸¦ ½ÃÀÛÇϵµ·Ï(¶Ç´Â ÀÚµ¿À¸·Î ½ÃÀÛÇÏÁö ¾Êµµ·Ï) ÀÌ º¯°æ»çÇ×À» ¿µ±¸ÀûÀ¸·Î ¸¸µé ¼ö ÀÖ½À´Ï´Ù.", - IDC_STARTSTOP_STARTUP,38,45,245,28 -END - -IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 259, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "½ÇÇà ¸í·É" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¼­¹ö(&S):",IDC_STATIC,10,56,38,8 - COMBOBOX IDC_SERVER,50,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "¸í·É(&C):",IDC_STATIC,10,75,38,8 - EDITTEXT IDC_COMMAND,50,73,194,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È®ÀÎ",IDOK,86,107,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,140,107,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,204,107,50,14 - ICON IDI_SERVER,IDC_STATIC,4,4,20,20 - LTEXT "¼­¹ö¿¡¼­ ¸í·ÉÀ» ½ÇÇàÇÕ´Ï´Ù",IDC_STATIC,32,12,185,8 - LTEXT "ÀÌ Á¶ÀÛÀ» »ç¿ëÇÏ¿© ¿ø°Ý ¼­¹ö¿¡¼­ ¸í·ÉÀ» ½ÇÇàÇÒ ¼ö ÀÖ½À´Ï´Ù.\nÀÌ´Â ÁÖ·Î /etc/reboot ½ºÅ©¸³Æ®¸¦ ½ÇÇàÇÏ¿© ¼­¹ö¸¦ ´Ù½Ã ½ÃÀÛÇÒ ¶§ »ç¿ëµË´Ï´Ù.", - IDC_STATIC,4,29,250,16 -END - -IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 248, 254 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý º¹¿ø - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - LTEXT "¼­¹ö(&S):",IDC_STATIC,30,50,35,8 - COMBOBOX IDC_SERVER,67,48,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "ÆÄƼ¼Ç(&P):",IDC_STATIC,30,67,35,8 - COMBOBOX IDC_AGGREGATE,67,65,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "¸ðµç ÆÄƼ¼Ç º¹¿ø(&A)",IDC_AGGREGATE_ALL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,163,67,81,10 - LTEXT "º¼·ý(&O):",IDC_STATIC,29,85,35,8 - COMBOBOX IDC_FILESET,67,83,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "¸ðµç º¼·ý º¹¿ø(&L)",IDC_FILESET_ALL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,163,85,79,10 - DEFPUSHBUTTON "È®ÀÎ",IDOK,85,108,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,139,108,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,194,108,50,14 - PUSHBUTTON "°í±Þ(&V) >>",IDC_ADVANCED,4,108,53,14 - LTEXT "Àӽà ÆÄÀÏ °æ·Î(&T):",IDC_STATIC,10,142,74,8 - EDITTEXT IDC_SALVAGE_TEMPDIR,89,140,137,13,ES_AUTOHSCROLL - CONTROL "º´·Ä º¹¿ø Á¶ÀÛ(&R), ÇÁ·Î¼¼½º ¼ö:",IDC_SALVAGE_SIMUL, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,157,119,10 - EDITTEXT IDC_SALVAGE_NUM,158,155,25,13,ES_AUTOHSCROLL - CONTROL "ÈÑ¼ÕµÈ º¼·ýÀ» º¹¿øÇÏÁö ¾Ê±â(&N)",IDC_SALVAGE_READONLY, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,167,123,10 - CONTROL "Àбâ Á¶ÀÛÀ» ÀÛÀº ºí·ÏÀ¸·Î ³ª´®(&B)",IDC_SALVAGE_BLOCK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,177,139,10 - CONTROL "Ç¥½ÃµÈ ¸ðµç º¼·ýÀ» °­Á¦·Î º¹¿ø(&F)",IDC_SALVAGE_FORCE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,187,136,10 - CONTROL "µð·ºÅ丮 ±¸Á¶¸¦ °­Á¦·Î À籸¼º(&E)",IDC_SALVAGE_FIXDIRS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,197,123,10 - LTEXT "°á°ú ·Î±×ÀÇ ÆÄÀÏ À̸§(&L):",IDC_STATIC,10,211,77,8 - EDITTEXT IDC_SALVAGE_LOG_FILE,92,210,137,13,ES_AUTOHSCROLL - CONTROL "°á°ú ·Î±×¿¡ ÈÑ¼ÕµÈ i-³ëµå ¸ñ·Ï Æ÷ÇÔ(&I)", - IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,30,224,203,10 - CONTROL "°á°ú ·Î±×¿¡ AFS¿¡ ¼ÓÇÑ ·çÆ® ¸ñ·Ï Æ÷ÇÔ(&W)", - IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,30,235,203,10 - ICON IDI_SERVER,IDC_STATIC,4,7,20,20 - LTEXT "ÀÌ Á¶ÀÛÀ¸·Î Çϳª ÀÌ»óÀÇ º¼·ý¿¡ ÀÖ´Â ¹®Á¦Á¡À» ¼öÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.\n\nÁÖ: Àüü ÆÄƼ¼Ç ¶Ç´Â ¼­¹ö¸¦ ÇÑ ¹ø¿¡ º¹¿øÇϸé, ¼­¹ö´Â ÀϽÃÀûÀ¸·Î ¿ÀÇÁ¶óÀÎÀÌ µË´Ï´Ù.", - IDC_STATIC,30,7,214,32 - GROUPBOX "°í±Þ º¹¿ø ¿É¼Ç",IDC_ADVANCED_GROUP,4,128,240,122 -END - -IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "º¼·ý º¹¿ø - °á°ú" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²" -BEGIN - DEFPUSHBUTTON "´Ý±â(&C)",IDOK,232,160,50,14 - LTEXT "º¹¿ø Á¶ÀÛÀÇ °á°ú:",IDC_STATIC,4,33,277,8 - EDITTEXT IDC_SALVAGE_DETAILS,4,43,277,113,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP - ICON IDI_SERVER,IDC_STATIC,4,7,21,20 - LTEXT "%1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ýÀ» º¹¿øÇÕ´Ï´Ù", - IDC_SALVAGE_TITLE,33,15,248,8 -END - -IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 277, 102 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "º¼·ý ÇØÁ¦" -FONT 9, "±¼¸²" -BEGIN - DEFPUSHBUTTON "È®ÀÎ",IDOK,115,84,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,169,84,50,14 - PUSHBUTTON "µµ¿ò¸»(&H)",9,223,84,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "ÀÌ Á¶ÀÛÀ¸·Î %3 º¼·ýÀÇ º¹Á¦º»À» °»½ÅÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿À·¡µÈ º¹Á¦º»À» °»½ÅÇϰųª ¸ðµç º¹Á¦º»À» °»½ÅÇÒ ¼ö ÀÖ½À´Ï´Ù.", - IDC_RELSET_DESC,31,7,242,26 - CONTROL "¿À·¡µÈ º¼·ýÀÇ º¹Á¦º»¸¸ °»½Å(&U)",IDC_RELSET_NORMAL, - "Button",BS_AUTORADIOBUTTON,46,41,173,10 - CONTROL "¿À·¡µÇÁö ¾Ê¾Ò¾îµµ ¸ðµç º¼·ýÀÇ º¹Á¦º» °»½Å(&A)", - IDC_RELSET_FORCE,"Button",BS_AUTORADIOBUTTON,46,56,172, - 10 -END - -IDD_SVR_HOSTS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - PUSHBUTTON "È£½ºÆ® ¼­¹ö Ãß°¡(&A)",IDC_HOST_ADD,68,160,69,14 - PUSHBUTTON "È£½ºÆ® ¼­¹ö Á¦°Å(&R)",IDC_HOST_REMOVE,141,160,80,14 - LTEXT "¼­¹ö¿¡¼­ ÀνĵǴ µ¥ÀÌÅͺ£À̽º È£½ºÆ® ¼­¹ö:", - IDC_HOST_TITLE,5,7,216,8 - CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, - 135,WS_EX_CLIENTEDGE -END - -IDD_SVR_ADDHOST DIALOGEX 0, 0, 225, 106 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "È£½ºÆ® ¼­¹ö Ãß°¡" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - LTEXT "È£½ºÆ®(&H):",-1,31,55,26,8 - EDITTEXT IDC_ADDHOST_HOST,61,53,103,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È®ÀÎ",IDOK,63,88,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,117,88,50,14 - ICON IDI_SERVER,-1,4,4,21,20 - LTEXT "%1 ¼­¹ö¿¡ ÀúÀåµÈ ¸ñ·Ï¿¡ µ¥ÀÌÅͺ£À̽º È£½ºÆ® ¼­¹ö¸¦ Ãß°¡Çϱâ·Î Çß½À´Ï´Ù.\n\n¾Æ·¡¿¡ »õ µ¥ÀÌÅͺ£À̽º È£½ºÆ® À̸§À» ÀÔ·ÂÇϽʽÿÀ.", - IDC_ADDHOST_DESC,31,10,190,34 - PUSHBUTTON "µµ¿ò¸»",9,171,88,50,14 -END - -IDD_SVR_ADDRESS DIALOGEX 0, 0, 208, 115 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "¼­¹ö ÁÖ¼Ò º¯°æ" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - LTEXT "VLDB¿¡ ±â·ÏµÈ %1 ¼­¹ö¿ë IP ÁÖ¼Ò:",IDC_TITLE,4,4,200,8 - LISTBOX IDC_SVR_ADDRESSES,4,14,147,40,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "º¯°æ(&C)...",IDC_ADDR_CHANGE,154,24,50,14 - PUSHBUTTON "Á¦°Å(&R)",IDC_ADDR_REMOVE,154,40,50,14 - DEFPUSHBUTTON "È®ÀÎ",IDOK,46,97,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,100,97,50,14 - PUSHBUTTON "µµ¿ò¸»",9,154,97,50,14 - LTEXT "ÁÖ: ÆÄÀÏ ¼­¹ö°¡ ½ÃÀÛµÉ ¶§ VLDB¸¦ ÀÌ¿ëÇÏ¿© ÇöÀç IP ÁÖ¼Ò°¡ ÀÚµ¿À¸·Î µî·ÏµË´Ï´Ù.", - IDC_STATIC,4,64,200,18 -END - -IDD_SVR_NEWADDR DIALOGEX 0, 0, 223, 69 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "IP ÁÖ¼Ò º¯°æ" -CLASS "AFSManagerClass" -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "È®ÀÎ",IDOK,61,51,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,115,51,50,14 - PUSHBUTTON "µµ¿ò¸»",9,169,51,50,14 - LTEXT "VLDB¿¡¼­ %1À»(¸¦) ¹Ù²Ü »õ IP ÁÖ¼Ò¸¦ ÀÔ·ÂÇϽʽÿÀ.", - IDC_TITLE,4,4,215,8 - CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,42,23, - 90,14 - LTEXT "ÁÖ¼Ò:",IDC_STATIC,4,26,28,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" -32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" -32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" -IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" -IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" -IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" -IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" -IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" -IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" -IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" -IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" -IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" -IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" -IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" -IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" -IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" -IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" -IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -ACCEL_MAIN ACCELERATORS DISCARDABLE -BEGIN - VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT - VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT - VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT - VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT - VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT - VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT - VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT - VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, - NOINVERT - VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT -END - - -///////////////////////////////////////////////////////////////////////////// -// -// AVI -// - -AVI_SETMOVE AVI DISCARDABLE "Resource\\setmove.avi" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVR_LISTS_TITLE "%1 ¼­¹ö - °ü¸® ¸ñ·Ï" - IDS_TAB_SERVICES "¼­ºñ½º" - IDS_TAB_AGGREGATES "ÆÄƼ¼Ç" - IDS_TAB_FILESETS "º¼·ý" - IDS_SERVICE_NONESELECTED "º¼ ¼­¹ö¸¦ ¼±ÅÃÇϽʽÿÀ." - IDS_SERVICE_GOTSELECTED "¼­ºñ½º´Â %1 ¼­¹ö¿¡¼­ ÀÛ¾÷ÇÕ´Ï´Ù." - IDS_AGGREGATE_ALL "¸ðµç ¼­¹öÀÇ ÆÄƼ¼Ç:" - IDS_AGGREGATE_ONE "%1 ¼­¹öÀÇ ÆÄƼ¼Ç:" - IDS_FILESET_ALL "%1 ¼¿¿¡ ÀÖ´Â ¸ðµç º¼·ý:" - IDS_FILESET_ONE "%1 ¼­¹ö¿¡ ÀÖ´Â º¼·ý:" - IDS_SVR_LISTS_TAB "°ü¸® ¸ñ·Ï" - IDS_SVR_PROP_TITLE "%1 ¼­¹ö - Ư¼º" - IDS_SVR_GENERAL_TAB "ÀϹÝ" - IDS_SVR_SCOUT_TAB "¼³Á¤" - IDS_SERVER_TITLE "%1 ¼­¹ö - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_DESC "%2 ¼¿¿¡ ÀÖ´Â %1 ¼­¹ö:" - IDS_SVC_PROP_TITLE "%1 ¼­¹ö¿¡ ÀÖ´Â %2 ¼­ºñ½º - Ư¼º" - IDS_SVC_GENERAL_TAB "ÀϹÝ" - IDS_SVC_ADD_TITLE "¼­ºñ½º ÀÛ¼º" - IDS_SVC_ADD_TAB "¼­ºñ½º ÀÛ¼º" - IDS_AGG_PROP_TITLE "%1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç - Ư¼º" - IDS_AGG_GENERAL_TAB "ÀϹÝ" - IDS_SET_REP_TITLE "%1 º¼·ý - º¹Á¦" - IDS_SET_REPSITES_TAB "º¹Á¦ »çÀÌÆ®" - IDS_SET_PROP_TITLE "%1 º¼·ý - Ư¼º" - IDS_SET_GENERAL_TAB "ÀϹÝ" - IDS_SET_UNLOCKBTN "Áö±Ý Àá±ÝÇØÁ¦(&L)" - IDS_SET_LOCKBTN "Áö±Ý Àá±Ý(&L)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_USAGE_FILESET "%2 ÇÒ´ç·® Áß %1 »ç¿ë(%3%%)" - IDS_USAGE_AGGREGATE "%2 ¿ë·® Áß %1 »ç¿ë(%3%%)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGCOL_ALLOCATED "°áÇÕÇÑ ÇÒ´ç·®" - IDS_SVRCOL_NAME "¼­¹ö" - IDS_SVRCOL_STATUS "»óÅÂ" - IDS_SETCOL_DATE_ACCESS "ÃÖÁ¾ ¾×¼¼½º" - IDS_SETCOL_DATE_BACKUP "ÃÖÁ¾ ¹é¾÷" - IDS_SVCCOL_NAME "¼­ºñ½º" - IDS_SVCCOL_TYPE "À¯Çü" - IDS_SVCCOL_PARAMS "¸Å°³º¯¼ö" - IDS_SVCCOL_STATUS "»óÅÂ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_DATE_START "ÃÖÁ¾ ½ÃÀÛ" - IDS_SVCCOL_DATE_STOP "ÃÖÁ¾ Á¤Áö" - IDS_SVCCOL_DATE_STARTSTOP "ÃÖÁ¾ ½ÃÀÛ/Á¤Áö" - IDS_SVCCOL_DATE_FAILED "ÃÖÁ¾ ½ÇÆÐ" - IDS_SVCCOL_LASTERROR "ÃÖÁ¾ Á¾·á ÄÚµå" - IDS_AGGCOL_NAME "ÆÄƼ¼Ç" - IDS_AGGCOL_ID "ID" - IDS_AGGCOL_DEVICE "ÀåÄ¡" - IDS_AGGCOL_USED "»ç¿ë" - IDS_AGGCOL_USED_PER "% »ç¿ë" - IDS_AGGCOL_FREE "»ç¿ë°¡´É(ÇÑ)" - IDS_AGGCOL_TOTAL "¿ë·®" - IDS_AGGCOL_STATUS "»óÅÂ" - IDS_SETCOL_NAME "º¼·ý" - IDS_SETCOL_TYPE "À¯Çü" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETCOL_DATE_CREATE "ÀÛ¼º" - IDS_SETCOL_DATE_UPDATE "ÃÖÁ¾ °»½Å" - IDS_SETCOL_STATUS "»óÅÂ" - IDS_SETCOL_QUOTA_USED "»ç¿ë" - IDS_SETCOL_QUOTA_USED_PER "% »ç¿ë" - IDS_SETCOL_QUOTA_FREE "»ç¿ë°¡´É(ÇÑ)" - IDS_SETCOL_QUOTA_TOTAL "ÇÒ´ç·®" - IDS_TRYAGAINBTN "Àç½Ãµµ(&A)" - IDS_NO_CELL_SELECTED "(ÁöÁ¤µÈ ¼¿ÀÌ ¾øÀ½)" - IDS_NO_AFS_ID "(»ç¿ë°¡´ÉÇÑ ÅäÅ«ÀÌ ¾øÀ½)" - IDS_AFS_ID_WILLEXP "%1(%2¿¡ ¸¸±âµÇ´Â ÅäÅ«)" - IDS_ELAPSED_TIME "%1" - IDS_SEARCHING_FOR_SERVERS - "±â´Ù¸®½Ê½Ã¿À. %1 ¼¿¿¡ ´ëÇÑ Á¤º¸¸¦ È®º¸ÇÏ´Â ÁßÀÔ´Ï´Ù..." - IDS_STATUS_NOALERTS "Ç¥ÁØ" - IDS_TITLE_BROWSE_USER "»ç¿ëÀÚ ¼±ÅÃ" - IDS_AGGTYPE_OTHER "¾Ë ¼ö ¾øÀ½(%1)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATEFILESET "%1 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý ÀÛ¼º Áß:%2" - IDS_ACTION_DELETEFILESET "%1 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý »èÁ¦ Áß:%2" - IDS_ACTION_MOVEFILESET "%1 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý À̵¿ Áß:%2" - IDS_ACTION_SETFILESETQUOTA "%3 º¼·ý¿¡ ´ëÇÑ ÇÒ´ç·® º¯°æ Áß" - IDS_SVCSTOP_DESC2 "È®ÀÎÀ» ´­·¯ ÀÌ ¼­ºñ½º¸¦ Á¤ÁöÇϽʽÿÀ." - IDS_SVCSTART_DESC2 "È®ÀÎÀ» ´­·¯ ÀÌ ¼­ºñ½º¸¦ ½ÃÀÛÇϽʽÿÀ." - IDS_SYNCVLDB_SVR_DESC "ÁÖÀÇ!\n\n°è¼Ó ÁøÇàÇϸé, AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº VLDB¸¦ ¼öÁ¤ÇÏ¿© %1 ¼­¹öÀÇ ¸ðµç ÆÄƼ¼Ç ³»¿ë°ú ÀÏÄ¡Çϵµ·Ï ¸¸µì´Ï´Ù." - IDS_SYNCVLDB_SVR_DESC2 "VLDB¿¡¼­ %1 ¼­¹öÀÇ ÆÄƼ¼Ç¿¡¼­ ÇöÀç ãÀ» ¼ö ¾ø´Â º¼·ýÀ» ¾ð±ÞÇϸé, ±× º¼·ý¿¡ ´ëÇÑ VLDB°¡ »èÁ¦µË´Ï´Ù." - IDS_SYNCVLDB_AGG_DESC "ÁÖÀÇ!\n\n°è¼Ó ÁøÇàÇϸé, AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº VLDB¸¦ ¼öÁ¤ÇÏ¿© %1 ¼­¹öÀÇ %2 ÆÄƼ¼ÇÀÇ ³»¿ë°ú ÀÏÄ¡Çϵµ·Ï ¸¸µì´Ï´Ù." - IDS_SYNCVLDB_AGG_DESC2 "VLDB¿¡¼­ ÀÌ ÆÄƼ¼Ç¿¡¼­ ÇöÀç ãÀ» ¼ö ¾ø´Â º¼·ýÀ» ¾ð±ÞÇϸé, ±× º¼·ý¿¡ ´ëÇÑ VLDB ÀÔ·Â Ç׸ñÀÌ »èÁ¦µË´Ï´Ù." - IDS_PROMPT_BROWSE_USER "»ç¿ëÀÚ:" - IDS_PREVIEWIN_BUTTON "<< ¹Ì¸®º¸±â(&P)" - IDS_PREVIEWOUT_BUTTON "¹Ì¸®º¸±â(&P) >>" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ADMCOL_TYPE_USER "»ç¿ëÀÚ" - IDS_TITLE_BROWSE_PRINCIPAL "°èÁ¤ ¼±ÅÃ" - IDS_TITLE_BROWSE_OWNGROUP "¼ÒÀ¯ÇÏ´Â ±×·ì ¼±ÅÃ" - IDS_PROMPT_BROWSE_PRINCIPAL "°èÁ¤:" - IDS_PROMPT_BROWSE_OWNGROUP "¼ÒÀ¯ÇÏ´Â ±×·ì:" - IDS_ACTION_CLONE "%3 º¼·ýÀÇ ¹é¾÷ ¹öÀü ÀÛ¼º Áß" - IDS_ACTION_CLONESYS "¿©·¯ º¼·ý ¹é¾÷ ÀÛ¼º Áß" - IDS_CLONESYS_FAILED "0x%2(%3) ¿À·ù·Î ÀÎÇØ %1 º¼·ýÀÇ ¹é¾÷À» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_SET_UNSPECIFIED "(¹ÌÁöÁ¤)" - IDS_SETCOL_ID "ID" - IDS_SETCOL_FILES "ÆÄÀÏ °è¼ö" - IDS_SET_DUMP_NAME "%1" - IDS_ACTION_DUMP "%3 º¼·ý ´ýÇÁ Áß(%1 ÆÄƼ¼Ç:%2)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FILESETNAME_ERROR "%1 - %2" - IDS_SETCOL_AGGREGATE "ÆÄƼ¼Ç" - IDS_REFRESH_DESC_CELL "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼¿¿¡¼­ÀÇ ¼­¹ö »óŸ¦ ÆÇº° ÁßÀÔ´Ï´Ù. ÀÌ´Â ½Ã°£ÀÌ ¾à°£ °É¸± ¼ö ÀÖ½À´Ï´Ù..." - IDS_REFRESH_DESC_SERVER "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼­¹öÀÇ »óŸ¦ ÆÇº° ÁßÀÔ´Ï´Ù. ÀÌ´Â ½Ã°£ÀÌ ¾à°£ °É¸± ¼ö ÀÖ½À´Ï´Ù..." - IDS_REFRESH_CURRENT_CELL "ÇöÀç %1 ¼¿ Á¶»ç Áß" - IDS_REFRESH_CURRENT_SERVER "ÇöÀç %2 ¼­¹ö Á¶»ç Áß" - IDS_REFRESH_CURRENT_AGGREGATE "ÇöÀç %2 ¼­¹öÀÇ %3 ÆÄƼ¼Ç Á¶»ç Áß" - IDS_REFRESH_CURRENT_FILESET "ÇöÀç %2 ¼­¹ö, %3 ÆÄƼ¼ÇÀÇ %4 º¼·ý Á¶»ç Áß" - IDS_REFRESH_CURRENT_SERVICE "ÇöÀç ¼­¹ö %2ÀÇ %3 ¼­ºñ½º Á¶»ç Áß" - IDS_REFRESH_PERCENT "%1%% ¿Ï·á" - IDS_PROBLEMS "¹®Á¦Á¡" - IDS_SERVER_NO_PROBLEMS "ÀÌ ¼­¹ö¿¡´Â ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ¾ø½À´Ï´Ù." - IDS_SERVICE_NO_PROBLEMS "ÀÌ ¼­ºñ½º¿¡´Â ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ¾ø½À´Ï´Ù." - IDS_AGGREGATE_NO_PROBLEMS "ÀÌ ÆÄƼ¼Ç¿¡´Â ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ¾ø½À´Ï´Ù." - IDS_FILESET_NO_PROBLEMS "ÀÌ º¼·ý¿¡´Â ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ¾ø½À´Ï´Ù." - IDS_AGGTYPE_TYPE1 "UFS" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGTYPE_TYPE2 "LFS" - IDS_AGGTYPE_TYPE3 "AIX" - IDS_AGGTYPE_TYPE4 "VXFS" - IDS_AGGTYPE_TYPE5 "DMEPI" - IDS_REFRESH_CURRENT_VLDB "ÇöÀç º¼·ý À§Ä¡ µ¥ÀÌÅͺ£À̽º(VLDB) Á¶»ç Áß" - IDS_FILESETTYPE_RW "Àбâ/¾²±â" - IDS_FILESETTYPE_RO "º¹Á¦º»" - IDS_FILESETTYPE_CLONE "¹é¾÷" - IDS_MOVESET_READWRITE "°è¼Ó ÁøÇàÇϸé %3 º¼·ýÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ ´Ù¸¥ À§Ä¡·Î À̵¿µË´Ï´Ù." - IDS_MOVESET_READONLY "°è¼Ó ÁøÇàÇϸé %3 º¹Á¦º»ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ ¾Æ·¡¿¡ ÁöÁ¤ÇÑ ÆÄƼ¼Ç¿¡ ÀÛ¼ºµÈ ¶Ç´Ù¸¥ º¼·ý º¹Á¦º»À¸·Î À̵¿µË´Ï´Ù." - IDS_SVC_START_TITLE "¼­ºñ½º ½ÃÀÛ" - IDS_SVC_STOP_TITLE "¼­ºñ½º Á¤Áö" - IDS_SERVICESTATUS_STARTING "ÀÌ ¼­ºñ½º´Â ÇöÀç ½ÃÀÛ ÁßÀÔ´Ï´Ù." - IDS_SERVICESTATUS_RUNNING "ÀÌ ¼­ºñ½º´Â ÇöÀç ½ÇÇà ÁßÀÔ´Ï´Ù." - IDS_SERVICESTATUS_STOPPED "ÀÌ ¼­ºñ½º´Â ÇöÀç Á¤Áö ÁßÀÔ´Ï´Ù." - IDS_SERVICESTATUS_STOPPING "ÀÌ ¼­ºñ½º´Â ÇöÀç Á¤Áö ÁßÀÔ´Ï´Ù." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICESTATUS_UNKNOWN "ÀÌ ¼­ºñ½ºÀÇ »óŸ¦ ¾Ë ¼ö ¾ø½À´Ï´Ù." - IDS_SVC_RESTART_BUTTON "Á¤ÁöÇϰí Áö±Ý Àç½ÃÀÛ(&R)" - IDS_PROBLEM_BOX "¾Ë·ÁÁø ¹®Á¦Á¡(%1)" - IDS_VIEWLOG_DESC_NOFILE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¿¡ ´ëÇÑ ·Î±× ÆÄÀÏÀ» ãÁö ¸øÇß½À´Ï´Ù. ¾Æ·¡ÀÇ ¼­ºñ½º ·Î±× ÆÄÀÏ¿¡ ´ëÇÑ Àüü °æ·Î¸¦ ÀÔ·ÂÇϽʽÿÀ." - IDS_NO_GROUP "(¼ÒÀ¯ÇÏ´Â ±×·ì ¾øÀ½)" - IDS_VIEWLOG_FROMSERVER "%1 ¼­¹öÀÇ ·Î±× ÆÄÀÏ" - IDS_VIEWLOG_FROMSERVICE "%1 ¼­¹öÀÇ %2 ¼­ºñ½º¿¡ ´ëÇÑ ·Î±× ÆÄÀÏ" - IDS_VIEWLOG_TRUNCATED "ÆÄÀÏ ³»¿ë(ÃÖÁ¾ %1 Çุ Ç¥½Ã):" - IDS_SAVELOG_FILTER "ÅØ½ºÆ® ÆÄÀÏ|*.TXT|" - IDS_ADVANCEDIN_BUTTON "<< °í±Þ(&A)" - IDS_ADVANCEDOUT_BUTTON "°í±Þ(&A) >>" - IDS_REPTYPE_RELEASE "º¹Á¦º» ÇØÁ¦" - IDS_REPTYPE_SCHEDULED "½ºÄÉÁìµÈ º¹Á¦" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_UPDATEALL_BUTTON "¸ðµÎ °»½Å(&U)" - IDS_UPDATETHIS_BUTTON "°»½Å(&U)" - IDS_SERVER_MULTIPLE_PROBLEMS - "ÀÌ ¼­¹ö¿¡´Â %1°³ÀÇ ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ÀÖ½À´Ï´Ù." - IDS_SERVICE_MULTIPLE_PROBLEMS - "ÀÌ ¼­ºñ½º¿¡´Â %1°³ÀÇ ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ÀÖ½À´Ï´Ù." - IDS_AGGREGATE_MULTIPLE_PROBLEMS - "ÀÌ ÆÄƼ¼Ç¿¡´Â %1°³ÀÇ ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ÀÖ½À´Ï´Ù." - IDS_FILESET_MULTIPLE_PROBLEMS - "ÀÌ º¼·ý¿¡´Â %1°³ÀÇ ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ÀÖ½À´Ï´Ù." - IDS_FILESETTYPE_RO_STAGE "º¹Á¦º»" - IDS_SERVICETYPE_SIMPLE_LONG "°£´Ü(¿¬¼Ó ½ÇÇà)" - IDS_SERVICETYPE_CRON_LONG "Å©·Ð(ƯÁ¤ °£°Ý ½ÇÇà)" - IDS_QUOTAUNITS_KB "KB" - IDS_QUOTAUNITS_MB "MB" - IDS_NO_QUOTA_REPLICA "(ÀÌ º¼·ýÀº º¹Á¦º»À̹ǷΠÇÒ´ç·®ÀÌ ¾ø½À´Ï´Ù)" - IDS_NO_QUOTA_CLONE "(ÀÌ º¼·ýÀº ¹é¾÷À̹ǷΠÇÒ´ç·®ÀÌ ¾ø½À´Ï´Ù)" - IDS_USAGE_REPLICA "%1 »ç¿ë" - IDS_USAGE_CLONE "%1 »ç¿ë" - IDS_COL_AGGS_MOVE "º¼·ý ÀÛ¼º½Ã ÆÄƼ¼Ç" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_SERVICE "%1:%2" - IDS_SERVICETYPE_SIMPLE "°£´Ü" - IDS_SERVICETYPE_CRON "Å©·Ð" - IDS_SERVICESTATE_STOPPED "Á¤ÁöµÊ" - IDS_SERVICESTATE_STOPPING "Á¤Áö Áß" - IDS_SERVICESTATE_STARTING "½ÃÀÛ Áß" - IDS_SERVICESTATE_RUNNING "½ÇÇà Áß" - IDS_SERVICETYPE_FS_LONG "FS(ÆÄÀÏ ½Ã½ºÅÛ)" - IDS_SERVICETYPE_FS "FS" - IDS_SERVICE_LASTERROR "%1" - IDS_SERVICES_IN_CELL "%1 ¼¿ÀÇ ¸ðµç ¼­ºñ½º:" - IDS_SERVICE_STARTDATE "%1 ½ÃÀÛµÊ" - IDS_SERVICE_STOPDATE "%1 Á¤ÁöµÊ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_PERCENTAGE "%1 %%" - IDS_AGGREGATES_IN_SERVER "%1 ¼­¹öÀÇ ÆÄƼ¼Ç:" - IDS_AGGREGATES_IN_CELL "%1 ¼¿¿¡¼­ÀÇ ¸ðµç ÆÄƼ¼Ç:" - IDS_AGGREGATES_IN_NOTHING "ÆÄƼ¼Ç:" - IDS_FILESETS_IN_SERVER "%1 ¼­¹ö¿¡ ÀÖ´Â º¼·ý:" - IDS_FILESETS_IN_CELL "%1 ¼¿¿¡ ÀÖ´Â ¸ðµç º¼·ý:" - IDS_FILESETS_IN_NOTHING "º¼·ý:" - IDS_SERVICES_IN_SERVER "%1 ¼­¹ö¿¡ ÀÖ´Â ¼­ºñ½º:" - IDS_SERVICES_IN_NOTHING "¼­ºñ½º:" - IDS_UNKNOWN "(¾Ë ¼ö ¾øÀ½)" - IDS_UNKNOWN_GROUP "#%1 ±×·ì(À̸§À» ¾Ë ¼ö ¾øÀ½)" - IDS_AGGFULL_WARN_OFF "±âº» ÀÓ°è°ª(¼­¹ö¿¡¼­ °æ°í »ç¿ë ºÒ°¡´É)" - IDS_SERVER_AGGREGATE "%1:%2" - IDS_SERVERNAME_ERROR "%1 - %2" - IDS_AGGREGATENAME_ERROR "%1 - %2" - IDS_SETFULL_WARN_OFF "±âº» ÀÓ°è°ª(¼­¹ö¿¡¼­ °æ°í »ç¿ë ºÒ°¡´É)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_LASTERRORDATE "%1 - %2 Á¾·á ÄÚµå" - IDS_COL_SERVERS "¼¿ÀÇ ¼­¹ö" - IDS_COL_FILESETS "¼­¹öÀÇ º¼·ý" - IDS_COL_AGGREGATES "¼­¹öÀÇ ÆÄƼ¼Ç" - IDS_COL_SERVICES "¼­¹öÀÇ ¼­ºñ½º" - IDS_COL_REPLICAS "º¼·ýÀÇ º¹Á¦º»" - IDS_COLUMNS_TITLE "Ä÷³ Ç¥½Ã ¼±Åà - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" - IDS_REPCOL_SERVER "¼­¹ö" - IDS_REPCOL_AGGREGATE "ÆÄƼ¼Ç" - IDS_REPCOL_DATE_UPDATE "ÃÖÁ¾ °»½Å" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COL_AGGS_CREATE "º¼·ý À̵¿½Ã ÆÄƼ¼Ç" - IDS_WARN_TITLE "ÁÖÀÇ" - IDS_WARN_DISABLE_AUTH """ºñÀÎÁõ Çã¿ë"" ´ÜÃ߸¦ ´­·¯ ÀÎÁõµÇÁö ¾ÊÀº °èÁ¤¿¡¼­ ÀÌ ¼­¹öÀÇ ¼­ºñ½º¸¦ ó¸®ÇÏ°Ô ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¸¹Àº ¼­ºñ½º°¡ ·çÆ® ½Äº°ÇÏ¿¡¼­ ½ÇÇàµÇ¹Ç·Î ÀÌ Á¶Ä¡´Â +" - IDS_WARN_DISABLE_AUTH2 "¼­¹ö º¸¾È¸é¿¡¼­ °áÁ¤ÀûÀÎ ÇêÁ¡À» µå·¯³À´Ï´Ù.\n\nº¯°æÇϽðڽÀ´Ï±î?" - IDS_SVR_NO_ADDR "(¹ÌÁöÁ¤)" - IDS_TITLE_BAD_CELL "ÀνĵÇÁö ¾ÊÀº ¼¿ À̸§" - IDS_DESC_BAD_CELL "ÀÔ·ÂÇÑ ¼¿ À̸§À» ³×Æ®¿öÅ©¿¡¼­ ãÀ» ¼ö ¾ø½À´Ï´Ù.\n\nÀÔ·Â Ç׸ñÀÌ ¸Â´ÂÁö ´Ù½Ã È®ÀÎÇϽʽÿÀ." - IDS_AGGFULL_WARN_ON "ÀÌ ¼­¹öÀÇ ±âº» ÀÓ°è°ª(&D)(±× Å©±âÀÇ %1%%)" - IDS_SETFULL_WARN_ON "ÀÌ ¼­¹öÀÇ ±âº» ÀÓ°è°ª(&D)(±× Å©±âÀÇ %1%%)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS - "ÀÔ·ÂÇÑ AFS ½Äº°À» ÀνÄÇÒ ¼ö ¾ø°Å³ª ÁöÁ¤ÇÑ ¾ÏÈ£°¡ Ʋ·È½À´Ï´Ù." - IDS_CREDS_NONE "(ÅäÅ« ¾øÀ½)" - IDS_CREDS_VALID "%2, %3 ¸¸±â" - IDS_CREDS_EXPIRED "(ÅäÅ« %3 ¸¸±â)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGG_FILESETS "%1(°áÇÕµÈ ÇÒ´ç·®: %2)" - IDS_ACTION_DESC_NONE "ÁøÇà ÁßÀÎ Á¶ÀÛÀÌ ¾ø½À´Ï´Ù." - IDS_ACTION_DESC_ONE "´ÙÀ½ Á¶ÀÛÀÌ ÇöÀç ÁøÇà ÁßÀÔ´Ï´Ù." - IDS_ACTION_DESC_MULT "´ÙÀ½ Á¶ÀÛÀÌ ÇöÀç ÁøÇà ÁßÀÔ´Ï´Ù." - IDS_ACTCOL_OPERATION "Á¶ÀÛ" - IDS_ACTCOL_ELAPSED "°æ°úµÈ ½Ã°£" - IDS_ACTION_REFRESH "¼¿ Á¤º¸ »õ·Î °íÄ¡´Â Áß" - IDS_ACTION_CREATESERVER "%1 ¼­¹ö ÀÛ¼º Áß" - IDS_ACTION_DELETESERVER "%1 ¼­¹ö »èÁ¦ Áß" - IDS_ACTION_GETSERVERLOGFILE "%1 ¼­¹ö¿¡¼­ %2 ·Î±× ÆÄÀÏ È®º¸ Áß" - IDS_ACTION_SETSERVERAUTH "%1 ¼­¹ö¿¡ ´ëÇÑ ¾×¼¼½º Á¦ÇÑ º¯°æ Áß" - IDS_ACTION_CHANGESERVERSTATUS "%1 ¼­¹öÀÇ Æ¯¼º º¯°æ Áß" - IDS_ACTION_STARTSERVICE "%1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º ½ÃÀÛ Áß" - IDS_ACTION_STOPSERVICE "%1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º Á¤Áö Áß" - IDS_ACTION_RESTARTSERVICE "%1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º ´Ù½Ã ½ÃÀÛ Áß" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SYNCVLDB_SVR "VLDB ¹× %1 ¼­¹öÀÇ µ¿±âÈ­" - IDS_ACTION_SYNCVLDB_AGG "VLDB ¹× %1 ÆÄƼ¼ÇÀÇ µ¿±âÈ­:%2" - IDS_ACTION_SCOUT "¹®Á¦°¡ ÀÖ´ÂÁö %1 ¼­¹ö È®ÀÎ Áß" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SETREPPARAMS "%3 º¼·ý¿¡ ´ëÇÑ º¹Á¦ Ư¼º º¯°æ Áß" - IDS_ACTION_CREATEREPLICA "%1 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ýÀÇ º¹Á¦º» ÀÛ¼º Áß:%2" - IDS_DELSET_REPLICA_DESC "ÁÖÀÇ!\n\n°è¼Ó ÁøÇàÇϸé, %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ýÀÇ º¹Á¦º»ÀÌ Á¦°ÅµË´Ï´Ù." - IDS_DELSET_CLONE_DESC "ÁÖÀÇ!\n\n°è¼Ó ÁøÇàÇϸé, %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý ¹é¾÷ÀÌ Á¦°ÅµË´Ï´Ù." - IDS_INSTALL_DESC1 "ÀÌ Á¶ÀÛÀº ÀÌ ÄÄÇ»ÅÍÀÇ ÆÄÀÏÀ» ¶Ç ´Ù¸¥ ÄÄÇ»ÅÍ·Î º¹»çÇÕ´Ï´Ù. +" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_INSTALL_DESC2 "ÆÄÀÏÀÌ ¸ñÇ¥ ÄÄÇ»ÅÍ¿¡ ÀÌ¹Ì Á¸ÀçÇϸé, ¹é¾÷µÇ°í .BAK È®ÀåÀÚ°¡ ºÎ¿©µË´Ï´Ù. ±âÁ¸ÀÇ ¸ðµç ¹é¾÷¿¡´Â .OLD È®ÀåÀÚ°¡ ºÎ¿©µÇ°í ±âÁ¸ÀÇ .OLD ÆÄÀÏÀº »èÁ¦µË´Ï´Ù." - IDS_ACTION_INSTALLFILE "%1 ¼­¹ö¿¡ %2 ÆÄÀÏ ¼³Ä¡ Áß" - IDS_ACTION_UNINSTALLFILE "%1 ¼­¹ö¿¡¼­ %2 ÆÄÀÏ ¼³Ä¡ÇØÁ¦ Áß" - IDS_ACTION_PRUNEFILES "%1 ¼­¹ö¿¡¼­ ÆÄÀÏ Á¤¸® Áß" - IDS_FILTER_ALLFILES "¸ðµç ÆÄÀÏ|*.*|" - IDS_ACTION_RENAMEFILESET "º¼·ý À̸§À» %1¿¡¼­ %2(À¸)·Î º¯°æ Áß" - IDS_RECUR_DAILY "¸ÅÀÏ" - IDS_RECUR_SUNDAY "ÀÏ¿äÀϸ¶´Ù" - IDS_RECUR_MONDAY "¿ù¿äÀϸ¶´Ù" - IDS_RECUR_TUESDAY "È­¿äÀϸ¶´Ù" - IDS_RECUR_WEDNESDAY "¼ö¿äÀϸ¶´Ù" - IDS_RECUR_THURSDAY "¸ñ¿äÀϸ¶´Ù" - IDS_RECUR_FRIDAY "±Ý¿äÀϸ¶´Ù" - IDS_RECUR_SATURDAY "Åä¿äÀϸ¶´Ù" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATESERVICE "%1 ¼­¹ö¿¡ %2 ¼­ºñ½º ÀÛ¼º Áß" - IDS_ACTION_DELETESERVICE "%1 ¼­¹ö·ÎºÎÅÍ %2 ¼­ºñ½º »èÁ¦ Áß" - IDS_ACTION_RELEASEFILESET "%3 º¼·ý ÇØÁ¦ Áß" - IDS_ACTION_GETDATES "%1 ¼­¹ö¿¡¼­ %2 ÆÄÀÏ¿¡ ´ëÇÑ ³¯Â¥ È®º¸ Áß" - IDS_LASTMODIFIED "%1 ÃÖÁ¾ ¼öÁ¤" - IDS_SVR_SECURITY_TITLE "¼­¹ö º¸¾È - %1" - IDS_SVR_LIST_TAB "°ü¸®ÀÚ" - IDS_ACTION_ADMINLIST_LOAD "%1 ¼­¹ö¿¡ ´ëÇÑ °ü¸®ÀÚ È®º¸ Áß" - IDS_ACTION_ADMINLIST_SAVE "%1 ¼­¹ö¿¡ ´ëÇÑ °ü¸®ÀÚ ±â·Ï Áß" - IDS_ADMCOL_PRINCIPAL "±¸¼º¿ø" - IDS_ADMCOL_TYPE "À¯Çü" - IDS_ADMCOL_TYPE_GROUP "±×·ì" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_RESTORE "%1 º¼·ý º¹¿ø Áß" - IDS_COL_AGGS_RESTORE "º¼·ý º¹¿ø½Ã ÆÄƼ¼Ç" - IDS_RESTORE_FILTER "º¼·ý ´ýÇÁ ÆÄÀÏ|*.DMP|¸ðµç ÆÄÀÏ|*.*|" - IDS_SVC_BOS_TAB "BOS" - IDS_ACTION_SETRESTART "%1 ¼­¹ö¿¡ ´ëÇÑ ¼­ºñ½º Àç½ÃÀÛ ½Ã°£ º¯°æ Áß" - IDS_RESTORE_CREATESET "%1 º¼·ýÀº ¾Æ·¡¿¡ ÁöÁ¤ÇÑ ¼­¹ö ¹× ÆÄƼ¼Ç¿¡ ÀÛ¼ºµË´Ï´Ù." - IDS_RESTORE_OVERWRITESET - "ÁÖÀÇ! %3 º¼·ýÀº %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ ÀÖÀ¸¸ç, °è¼Ó ÁøÇàÇϸé, °ãÃľ²¿©Áý´Ï´Ù." - IDS_SUBSET_TITLE_LOAD "¼­¹ö ¼­ºê¼¼Æ® ¿­±â" - IDS_SUBSET_TITLE_SAVE "¼­¹ö ¼­ºê¼¼Æ® ÀúÀå" - IDS_BUTTON_OPEN "¿­±â(&O)" - IDS_BUTTON_SAVE "ÀúÀå(&S)" - IDS_SUBSET_SAVE_TITLE "ÁÖÀÇ" - IDS_SUBSET_SAVE_DESC "¼­¹ö ¼­ºê¼¼Æ®´Â ÀÌ¹Ì %1(ÀÌ)¶ó´Â À̸§À¸·Î Á¸ÀçÇÕ´Ï´Ù.\n\nÀÌ ¼­ºê¼¼Æ®¿¡ °ãÃľ²½Ã°Ú½À´Ï±î?" - IDS_SUBSET_CHANGED "%1 [¼öÁ¤µÊ]" - IDS_SUBSET_TAB "¸ð´ÏÅ͵Ǵ ¼­¹ö" - IDS_SUBSET_DISCARD_TITLE "¼­ºê¼¼Æ® ÀúÀå?" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SUBSET_DISCARD_DESC "ÇöÀç ¸ð´ÏÅ͵Ǵ ¼­¹ö ¸ñ·ÏÀ» ¼­ºê¼¼Æ®·Î ÀúÀåÇÏÁö ¾Ê¾Ò½À´Ï´Ù. ÀÌ ¸ñ·ÏÀ» ÀúÀåÇϸé, ³ªÁß¿¡ µ¿ÀÏÇÑ ¼­¹ö ¼¼Æ®¸¦ °è¼Ó ¸ð´ÏÅÍÇÒ ¶§ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.\n\n+" - IDS_SUBSET_DISCARD_DESC2 - "ÇöÀç ¸ð´ÏÅ͵Ǵ ¼­¹ö ¸ñ·ÏÀ» Æ÷ÇÔÇÒ ¼­ºê¼¼Æ®¸¦ ÀÛ¼ºÇϽðٽÀ´Ï±î?" - IDS_SUBSET_NONAME "(Á¦¸ñ ¾øÀ½)" - IDS_SUBSET_NOSUBSET "(¸ðµç ¼­¹ö°¡ ¸ð´ÏÅ͵ǰí ÀÖ½À´Ï´Ù)" - IDS_SUBSET_SERVERSUBSET "%1 ¼­¹ö" - IDS_FILESET_SOME "%1 ¼¿¿¡¼­ ¸ð´ÏÅ͵Ǵ ¸ðµç ¼­¹öÀÇ º¼·ý:" - IDS_AGGREGATE_SOME "%1 ¼¿¿¡¼­ ¸ð´ÏÅ͵Ǵ ¸ðµç ¼­¹öÀÇ ÆÄƼ¼Ç:" - IDS_SERVICE_SOME "%1 ¼¿¿¡¼­ ¸ð´ÏÅ͵Ǵ ¸ðµç ¼­¹öÀÇ ¼­ºñ½º:" - IDS_FILESET_UNMON "%1 ¼­¹ö´Â ¸ð´ÏÅ͵ǰí ÀÖÁö ¾Ê½À´Ï´Ù" - IDS_AGGREGATE_UNMON "%1 ¼­¹ö´Â ¸ð´ÏÅ͵ǰí ÀÖÁö ¾Ê½À´Ï´Ù" - IDS_SERVICE_UNMON "%1 ¼­¹ö´Â ¸ð´ÏÅ͵ǰí ÀÖÁö ¾Ê½À´Ï´Ù" - IDS_SUBSET_DELETE_TITLE "¼­ºê¼¼Æ® »èÁ¦?" - IDS_SUBSET_DELETE_DESC "%1 ¼­¹ö ¼­ºê¼¼Æ®¸¦ »èÁ¦ÇϽðڽÀ´Ï±î?" - IDS_ERROR_TRANSLATED "¿À·ù ¹øÈ£ 0x%1(%2):\n\n%3" - IDS_ERROR_NOTTRANSLATED "¿À·ù ¹øÈ£ 0x%1(%2)Àº(´Â) ÀνĵÇÁö ¾Ê½À´Ï´Ù." - IDS_FIND_NOTHING_TITLE "¼±ÅÃµÈ ¸í·É ¾øÀ½" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FIND_NOTHING_DESC "Á¶ÀÛ ¼öÇà ¹æ¹ýÀ» ¾Ë¾Æº¸·Á¸é, ¸ÕÀú ¸ñ·Ï¿¡¼­ ¸í·ÉÇàÀ» ¼±ÅÃÇϰųª Ű¿öµå¸¦ ÀÔ·ÂÇϽʽÿÀ." - IDS_FIND_UNKNOWN_TITLE "¾Ë ¼ö ¾ø´Â ¸í·É" - IDS_FIND_UNKNOWN_DESC "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ ""%1"" ¸í·É¿¡ ´ëÇÑ µµ¿ò¸» ÁÖÁ¦¸¦ ãÁö ¸øÇß½À´Ï´Ù." - IDS_HELPABOUT_DESC1 "°æ°í: ÀÌ ÄÄÇ»ÅÍ ÇÁ·Î±×·¥Àº ÀúÀÛ±Ç ¹× ±¹Á¦ Çù¾à¿¡ ÀÇÇØ º¸È£µË´Ï´Ù." - IDS_HELPABOUT_DESC2 "Çã°¡ ¾øÀÌ ÀÌ ¼ÒÇÁÆ®¿þ¾î¸¦ Àç»ý»êÇϰųª ºÐ¹èÇÏ¸é ½É°¢ÇÑ ¹Î»ç ¹× Çü»ç »ç°ÇÀ» ÀÏÀ¸Å³ ¼ö ÀÖÀ¸¸ç ¹ýÀÌ Çã¿ëÇÏ´Â ¹üÀ§ ³»¿¡¼­ ÃÖ´ëÀÇ Ã³¹úÀ» ¹Þ°Ô µË´Ï´Ù.\n\n+" - IDS_HELPABOUT_DESC3 "AFS´Â IBM»ç Transarc CorporationÀÇ µî·Ï»óÇ¥ÀÔ´Ï´Ù." - IDS_CANT_QUIT_TITLE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" - IDS_CANT_QUIT_REBOOT "ÁÖÀÇ!\n\nAFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº ÇöÀç Çϳª ÀÌ»óÀÇ Á¶ÀÛÀ» ¼öÇà ÁßÀÔ´Ï´Ù. Windows¸¦ Áö±Ý Á¾·áÇϸé, ½ÇÇà ÁßÀÎ Á¶ÀÛÀ» ³¡³¾ ¼ö ¾ø½À´Ï´Ù.\n\nWindows¸¦ ´Ù½Ã ½ÃÀÛÇϽðڽÀ´Ï±î?" - IDS_APP_TITLE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" - IDS_ACTION_OPENCELL "%1 ¼¿¿¡¼­ ¼­¹ö ã´Â Áß" - IDS_OPTIONS_TITLE "¿É¼Ç - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" - IDS_OPTIONS_GENERAL_TAB "ÀϹÝ" - IDS_BADCREDS_DESC "°ü¸®ÀÚ·Î ·Î±×ÀÎÇÏÁö ¾ÊÀ¸¸é %1 ¼¿À» °ü¸®ÇÏ´Â µ¥ ÇÊ¿äÇÑ Æ¯±ÇÀÌ ºÎÁ·ÇÕ´Ï´Ù. ¾×¼¼½º Ư±ÇÀÌ ºÎÁ·ÇÏ°Ô µÇ¸é, AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº ¹®Á¦°¡ ¾øÀ» °æ¿ì¿¡µµ ¼¿¿¡¼­ ¹®Á¦Á¡À» ã°Ô µË´Ï´Ù." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CONFIRMATION_TITLE "È®ÀÎ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" - IDS_NO_GROUP_CHECKBOX "¼ÒÀ¯ÇÏ´Â ±×·ì ¾øÀ½" - IDS_AFS_ID_DIDEXP "%1(%2¿¡ ¸¸±âµÇ´Â ÅäÅ«)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_QUERYING "(Á¶È¸ Áß)" - IDS_ADMCOL_TYPE_FOREIGN_GROUP "¿Ü·¡ ±×·ì" - IDS_ADMCOL_TYPE_FOREIGN_USER "¿Ü·¡ »ç¿ëÀÚ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_NOTIFIER "ÁöÁ¤ÀÚ" - IDS_SVC_NONOTIFIER "(¾øÀ½)" - IDS_SVR_KEY_TAB "¼­¹ö Ű" - IDS_KEYNAME_NOTIME "%1 ¼­¹ö¿¡ ´ëÇÑ Å°:" - IDS_KEYNAME_WITHTIME "%1 ¼­¹ö¿¡ ´ëÇÑ Å°(%2 ¼öÁ¤)" - IDS_SVRKEY_VERSION "¹öÀü" - IDS_SVRKEY_DATA "°ª" - IDS_SVRKEY_CHECKSUM "üũ¼¶" - IDS_SVRKEY_DATA_UNKNOWN "(¼û°ÜÁü)" - IDS_STARTSERVICE_TITLE "¼­ºñ½º ½ÃÀÛ" - IDS_STOPSERVICE_TITLE "¼­ºñ½º Á¤Áö" - IDS_STARTSERVICE_TEXT "È®ÀÎÀ» ´­·¯ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ ½ÃÀÛÇϽʽÿÀ." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STOPSERVICE_TEXT "È®ÀÎÀ» ´­·¯ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ Á¤ÁöÇϽʽÿÀ." - IDS_STARTSERVICE_STARTUP - "%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛµÉ ¶§ ÀÚµ¿À¸·Î %2 ¼­ºñ½º¸¦ ½ÃÀÛÇϵµ·Ï ÀÌ º¯°æ»çÇ×À» ¿µ±¸ÀûÀ¸·Î ¸¸µé ¼ö ÀÖ½À´Ï´Ù." - IDS_STOPSERVICE_STARTUP "%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛÇÒ ¶§ ÀÚµ¿À¸·Î %2 ¼­ºñ½º¸¦ ½ÃÀÛÇÏÁö ¾Êµµ·Ï ÀÌ º¯°æ»çÇ×À» ¿µ±¸ÀûÀ¸·Î ¸¸µé ¼ö ÀÖ½À´Ï´Ù." - IDS_STARTSERVICE_PERMANENT - "¿µ±¸(&P)(%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛµÉ ¶§ %2 ¼­ºñ½º ½ÃÀÛ)" - IDS_STARTSERVICE_TEMPORARY - "ÀÓ½Ã(&T)(%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛµÉ ¶§ %2 ¼­ºñ½º¸¦ ½ÃÀÛÇÏÁö ¾ÊÀ½)" - IDS_STOPSERVICE_PERMANENT - "¿µ±¸(&P)(%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛµÉ ¶§ %2 ¼­ºñ½º¸¦ ½ÃÀÛÇÏÁö ¾ÊÀ½)" - IDS_STOPSERVICE_TEMPORARY - "ÀÓ½Ã(&T)(%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛµÉ ¶§ %2 ¼­ºñ½º ½ÃÀÛ)" - IDS_ACTION_EXECUTE "%1 ¼­¹ö¿¡¼­ %2 ½ÇÇà Áß" - IDS_ACTION_SALVAGE_SVR "%1 ¼­¹ö¿¡¼­ ¸ðµç º¼·ý º¹¿ø Áß" - IDS_ACTION_SALVAGE_AGG "%1:2 ÆÄƼ¼Ç»óÀÇ ¸ðµç º¼·ý º¹¿ø Áß" - IDS_ACTION_SALVAGE_VOL "%1:2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý º¹¿ø Áß" - IDS_SALVAGE_SVR "%1 ¼­¹ö»óÀÇ ¸ðµç º¼·ý º¹¿ø" - IDS_SALVAGE_AGG "%1 ¼­¹ö, %2 ÆÄƼ¼Ç»óÀÇ ¸ðµç º¼·ý º¹¿ø" - IDS_SALVAGE_SET "%1 ¼­¹ö, %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý º¹¿ø" - IDS_SETSTATUS_SALVAGE "º¼·ý º¹¿ø Áß" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETSTATUS_LOCKED "º¼·ýÀÌ Àá°å½À´Ï´Ù" - IDS_SETSTATUS_NO_VOL "º¼·ýÀÌ ´©¶ôµÇ¾ú½À´Ï´Ù" - IDS_SETSTATUS_BUSY "ÇöÀç º¼·ýÀÌ »ç¿ë ÁßÀÔ´Ï´Ù" - IDS_SETSTATUS_MOVED "À̵¿µÈ º¼·ý" - IDS_SVR_CAPACITY "%1" - IDS_SVR_ALLOCATION "%1(%2%%)" - IDS_SVRCOL_ADDRESS "ÁÖ¼Ò" - IDS_HOST_TITLE "%1 ¼­¹ö¿¡¼­ ÀÎ½ÄµÈ µ¥ÀÌÅͺ£À̽º È£½ºÆ® ¼­¹ö:" - IDS_SVR_HOSTS_TITLE "%1 ¼­¹ö - µ¥ÀÌÅͺ£À̽º È£½ºÆ®" - IDS_SVR_HOST_TAB "µ¥ÀÌÅͺ£À̽º È£½ºÆ®" - IDS_ACTION_HOSTLIST_LOAD "%1 ¼­¹ö¿¡¼­ È£½ºÆ® ¸ñ·Ï È®º¸ Áß" - IDS_ACTION_HOSTLIST_SAVE "%1 ¼­¹ö¿¡ È£½ºÆ® ¸ñ·Ï ±â·Ï Áß" - IDS_SETSTATUS_1ALERT "º¼·ý¿¡ ÇϳªÀÇ ¹®Á¦Á¡ÀÌ ÀÖ½À´Ï´Ù" - IDS_SETSTATUS_2ALERT "º¼·ý¿¡ %1°³ÀÇ ¹®Á¦Á¡ÀÌ ÀÖ½À´Ï´Ù" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CHANGEADDR "%1 ¼­¹ö¿ë IP ÁÖ¼Ò º¯°æ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_ADDSITE "vos addsite" - IDS_COMMAND_VOS_BACKUP "vos backup" - IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" - IDS_COMMAND_VOS_CREATE "vos create" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_DELENTRY "vos delentry" - IDS_COMMAND_VOS_DUMP "vos dump" - IDS_COMMAND_VOS_EXAMINE "vos examine" - IDS_COMMAND_VOS_LISTPART "vos listpart" - IDS_COMMAND_VOS_LISTVLDB "vos listvldb" - IDS_COMMAND_VOS_LISTVOL "vos listvol" - IDS_COMMAND_VOS_LOCK "vos lock" - IDS_COMMAND_VOS_MOVE "vos move" - IDS_COMMAND_VOS_PARTINFO "vos partinfo" - IDS_COMMAND_VOS_RELEASE "vos release" - IDS_COMMAND_VOS_REMOVE "vos remove" - IDS_COMMAND_VOS_REMSITE "vos remsite" - IDS_COMMAND_VOS_RENAME "vos rename" - IDS_COMMAND_VOS_RESTORE "vos restore" - IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" - IDS_COMMAND_VOS_UNLOCK "vos unlock" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" - IDS_COMMAND_VOS_ZAP "vos zap" - IDS_COMMAND_BOS_ADDHOST "bos addhost" - IDS_COMMAND_BOS_ADDKEY "bos addkey" - IDS_COMMAND_BOS_ADDUSER "bos adduser" - IDS_COMMAND_BOS_CREATE "bos create" - IDS_COMMAND_BOS_DELETE "bos delete" - IDS_COMMAND_BOS_EXEC "bos exec" - IDS_COMMAND_BOS_GETDATE "bos getdate" - IDS_COMMAND_BOS_GETLOG "bos getlog" - IDS_COMMAND_BOS_GETRESTART "bos getrestart" - IDS_COMMAND_BOS_INSTALL "bos install" - IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" - IDS_COMMAND_BOS_LISTKEYS "bos listkeys" - IDS_COMMAND_BOS_LISTUSERS "bos listusers" - IDS_COMMAND_BOS_PRUNE "bos prune" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_BOS_REMOVEHOST "bos removehost" - IDS_COMMAND_BOS_REMOVEKEY "bos removekey" - IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" - IDS_COMMAND_BOS_RESTART "bos restart" - IDS_COMMAND_BOS_SALVAGE "bos salvage" - IDS_COMMAND_BOS_SETAUTH "bos setauth" - IDS_COMMAND_BOS_SETRESTART "bos setrestart" - IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" - IDS_COMMAND_BOS_START "bos start" - IDS_COMMAND_BOS_STARTUP "bos startup" - IDS_COMMAND_BOS_STATUS "bos status" - IDS_COMMAND_BOS_STOP "bos stop" - IDS_COMMAND_BOS_UNINSTALL "bos uninstall" - IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" - IDS_COMMAND_FS_LISTQUOTA "fs listquota" - IDS_COMMAND_FS_QUOTA "fs quota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_FS_SETQUOTA "fs setquota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCSHORT_UNMONITORED - "%1 ¼­¹ö´Â ¹®Á¦Á¡¿¡ ´ëÇØ ¸ð´ÏÅ͵ÇÁö ¾Ê°í ÀÖ½À´Ï´Ù" - IDS_ALERT_DESCSHORT_TIMEOUT "%1 ¼­¹ö¿¡ Á¢¼ÓÇÒ ¼ö ¾ø½À´Ï´Ù. ÃÖÁ¾ ¿À·ù: %3" - IDS_ALERT_DESCSHORT_AGG_FULL - "%2¿¡ ´ëÇÑ ÆÄƼ¼Ç »ç¿ë·®ÀÌ °æ°í ÀÓ°è°ªÀÎ %3%%(%4)À»(¸¦) ÃʰúÇÕ´Ï´Ù" - IDS_ALERT_DESCSHORT_SET_FULL - "%3¿¡ ´ëÇÑ º¼·ý »ç¿ë·®ÀÌ °æ°í ÀÓ°è°ªÀÎ %4%%(%5)À»(¸¦) ÃʰúÇÕ´Ï´Ù" - IDS_ALERT_DESCSHORT_NO_VLDBENT "%3 º¼·ý¿¡ VLDB ÀÔ·Â Ç׸ñÀÌ ¾ø½À´Ï´Ù" - IDS_ALERT_DESCSHORT_NO_SVRENT_SET - "%3 º¼·ý¿¡ VLDB ÀÔ·Â Ç׸ñÀÌ ÀÖÁö¸¸ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ ãÁö ¸øÇß½À´Ï´Ù" - IDS_ALERT_DESCSHORT_STOPPED "%2 ¼­ºñ½º°¡ %3¿¡¼­ Á¤ÁöµÇ¾ú½À´Ï´Ù" - IDS_ALERT_DESCSHORT_NO_SVRENT_AGG - "%2 ÆÄƼ¼ÇÀÌ VLDB¿¡ ÀÇÇØ ÂüÁ¶µÇ¾úÀ¸³ª %1 ¼­¹ö¿¡¼­ ãÁö ¸øÇß½À´Ï´Ù" - IDS_ALERT_DESCSHORT_BADCREDS "%1 ¼­¹ö °ü¸®¿¡ ÇÊ¿äÇÑ Æ¯±ÇÀÌ ºÎÁ·ÇÕ´Ï´Ù" - IDS_ALERT_DESCSHORT_AGG_ALLOC - "%2 ÆÄƼ¼Ç¿¡¼­ °áÇÕµÈ º¼·ý ÇÒ´ç·®ÀÌ ±× ¿ë·®À» ÃʰúÇÕ´Ï´Ù" - IDS_ALERT_DESCSHORT_STATE_NO_VNODE - "%3 º¼·ýÀº ÈѼյǾúÀ¸¹Ç·Î »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ALERT_DESCSHORT_STATE_NO_SERVICE - "%3 º¼·ýÀ» ó¸®ÇÒ ½ÇÇà ÁßÀÎ ¼­ºñ½º°¡ ¾ø½À´Ï´Ù." - IDS_ALERT_DESCSHORT_STATE_OFFLINE - "%3 º¼·ýÀº ¿ÀÇÁ ¶óÀÎÀ̹ǷΠ»ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_TIMEOUT - "%1 ¼­¹ö¿Í Á¢¼ÓÇÒ ¼ö ¾ø½À´Ï´Ù. %2¿¡¼­ ÀÌ·ç¾îÁø ÃÖÁ¾ ½Ãµµ·Î ""%3"" ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_AGG_FULL - "%1 ¼­¹ö¿¡¼­ÀÇ %2 ÆÄƼ¼Ç »ç¿ë·®ÀÌ °æ°í ÀÓ°è°ªÀÎ %3%%(%4)À»(¸¦) ÃʰúÇÕ´Ï´Ù." - IDS_ALERT_DESCFULL_SET_FULL - "%3 º¼·ý(%1 ¼­¹ö, %2 ÆÄƼ¼Ç)ÀÇ »ç¿ë·®ÀÌ °æ°í ÀÓ°è°ªÀÎ %4%%(%5)À»(¸¦) ÃʰúÇÕ´Ï´Ù." - IDS_ALERT_DESCFULL_NO_VLDBENT - "%3 º¼·ýÀº %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ ÀÖÀ¸³ª ÇØ´ç VLDB ÀÔ·Â Ç׸ñÀÌ ¾ø½À´Ï´Ù." - IDS_ALERT_DESCFULL_NO_SVRENT_SET - "%3 º¼·ý¿¡ ´ëÇÑ VLDB ÀÔ·Â Ç׸ñÀÌ ÀÖÀ¸³ª %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ º¼·ýÀ» ãÁö ¸øÇß½À´Ï´Ù." - IDS_ALERT_DESCFULL_STOPPED - "%1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º°¡ %5 Á¾·á ÄÚµå¿Í ÇÔ²² %3¿¡¼­ Á¤ÁöÇß½À´Ï´Ù." - IDS_ALERT_DESCFULL_NO_SVRENT_AGG - "VLDB´Â %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ ÀÖ´Â º¼·ýÀ» ÂüÁ¶ÇÏÁö¸¸ ÆÄƼ¼ÇÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù." - IDS_ALERT_DESCFULL_BADCREDS - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼­¹ö¿¡ ¾ø´Â ¿À·ù¸¦ ¹ß°ßÇÒ ¼öµµ ÀÖ½À´Ï´Ù. ¿Ö³ÄÇϸé, ÀÌ ¼¿¿¡¼­´Â AFS ÅäÅ«À» °ü¸®ÀÚ·Î »ç¿ëÇÏÁö ¾Ê±â ¶§¹®ÀÔ´Ï´Ù." - IDS_ALERT_DESCFULL_AGG_ALLOC - "%4ÀÌ(°¡) µÇ´Â %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ °áÇÕµÈ º¼·ý ÇÒ´ç·®ÀÌ %3ÀÇ ÆÄƼ¼Ç ¿ë·®À» ÃʰúÇÕ´Ï´Ù." - IDS_ALERT_DESCFULL_STATE_NO_VNODE - "%1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ ÀÖ´Â %3 º¼·ý¿¡ ¿¬°üµÈ Vnode°¡ ¾ø½À´Ï´Ù.(º¼·ý »óÅ´ 0x%4ÀÔ´Ï´Ù.)" - IDS_ALERT_DESCFULL_STATE_NO_SERVICE - "%1 ¼­¹ö¿¡ ½ÇÇà ÁßÀÎ ÆÄÀÏ ¹ÝÃâ±â ¼­ºñ½º°¡ ¾øÀ¸¹Ç·Î, %2 ÆÄƼ¼ÇÀÇ %3 º¼·ýÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.(º¼·ý »óÅ´ 0x%4ÀÔ´Ï´Ù.)" - IDS_ALERT_DESCFULL_STATE_OFFLINE - "%1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ ÀÖ´Â %3 º¼·ýÀº ¿ÀÇÁ ¶óÀÎÀ̹ǷΠ»ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.(º¼·ý »óÅ´ 0x%4ÀÔ´Ï´Ù.)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_TIMEOUT "´Ù½Ã ½ÃÀÛ ´ÜÃ߸¦ ´­·¯ ÀÌ ¼­¹ö¿¡ ´Ù½Ã Á¢¼ÓÇϽʽÿÀ." - IDS_ALERT_FIX_AGG_FULL "°æ°í ´ÜÃ߸¦ ´­·¯ ÀÌ ÆÄƼ¼ÇÀÇ »ç¿ë·®¿¡ ´ëÇÑ °æ°í ÀÓ°è°ªÀ» º¯°æÇϽʽÿÀ." - IDS_ALERT_FIX_SET_FULL "°æ°í ´ÜÃ߸¦ ´­·¯ ÀÌ º¼·ý »ç¿ë·®¿¡ ´ëÇÑ °æ°í ÀÓ°è°ªÀ» º¯°æÇϽʽÿÀ." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_NO_VLDBENT - "VLDB°¡ ¿À·¡µÇ¾úÀ» °¡´É¼ºÀÌ ÀÖ´Â °æ¿ì, VLDB µ¿±âÈ­¸¦ »ç¿ëÇÏ¿© °»½ÅÇϽʽÿÀ." - IDS_ALERT_FIX_NO_SVRENT_SET - "¼­¹ö ¹× ÆÄƼ¼ÇÀ» Á¡°ËÇÏ¿© Á¦´ë·Î ÀÛµ¿ÇÏ´ÂÁö È®ÀÎÇϽʽÿÀ." - IDS_ALERT_FIX_STOPPED "·Î±× º¸±â ´ÜÃ߸¦ ´­·¯ ÀÌ ¼­ºñ½º¿¡ ´ëÇÑ ¼­ºñ½º ·Î±×¸¦ º¸½Ê½Ã¿À." - IDS_ALERT_FIX_NO_SVRENT_AGG - "¼­¹ö¸¦ Á¡°ËÇÏ¿© ÆÄƼ¼ÇÀÌ ¹ÝÃâµÇ´ÂÁö¿Í Á¦´ë·Î ÀÛµ¿ÇÏ´ÂÁö¸¦ È®ÀÎÇϽʽÿÀ." - IDS_ALERT_FIX_BADCREDS "ÀÎÁõ ´ÜÃ߸¦ ´­·¯ »õ AFS ÅäÅ«À» È®º¸ÇϽʽÿÀ." - IDS_ALERT_FIX_AGG_ALLOC "ÀÌ ÆÄƼ¼Ç¿¡¼­ º¼·ý¿¡ ´ëÇÑ ÇÒ´ç·®À» ÁÙÀ̰ųª Çϳª ÀÌ»óÀÇ º¼·ýÀ» ´Ù¸¥ ÆÄƼ¼ÇÀ¸·Î ¿Å±â½Ê½Ã¿À." - IDS_ALERT_FIX_STATE_NO_VNODE " " - IDS_ALERT_FIX_STATE_NO_SERVICE " " - IDS_ALERT_FIX_STATE_OFFLINE " " -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_BUTTON_TRYAGAIN "Àç½Ãµµ(&A)" - IDS_ALERT_BUTTON_WARNINGS "°æ°í(&W)..." - IDS_ALERT_BUTTON_VIEWLOG "·Î±× º¸±â(&V)" - IDS_ALERT_BUTTON_SHOWME "È­¸é¿¡ Ç¥½Ã(&S)" - IDS_ALERT_BUTTON_GETCREDS "ÀÎÁõ(&A)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_CELLSERVERS_NOCELL - "ÁöÁ¤µÈ ¼¿ÀÌ ¾ø½À´Ï´Ù. AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥À» »ç¿ëÇÏ·Á¸é, ÀÛ¾÷ÇÒ AFS ¼¿À» ÁöÁ¤ÇØ¾ß ÇÕ´Ï´Ù. À§ÀÇ ""¼¿"" ¸Þ´º¿¡¼­ ""¿­±â..."" ¸Þ´º Ç׸ñÀ» ¼±ÅÃÇÏ¿© ¼¿À» ¼±ÅÃÇϽʽÿÀ." - IDS_ERROR_REFRESH_CELLSERVERS - "%1 ¼¿¿¡ ´ëÇÑ ¼­¹ö ¸ñ·ÏÀ» È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n¿À·ù: %2" - IDS_ERROR_CANT_OPEN_CELL - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼¿¿¡ ÀÖ´Â ¼­¹ö¿Í Á¢¼ÓÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n¼¿ À̸§À» ¿Ã¹Ù¸£°Ô ÀÔ·ÂÇß´ÂÁö ´Ù½Ã È®ÀÎÇϽʽÿÀ." - IDS_ERROR_REFRESH_AGGREGATES - "%1 ¼­¹ö¿¡ ´ëÇÑ ÆÄƼ¼Ç ¸ñ·ÏÀ» È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n¿À·ù: %2" - IDS_ERROR_REFRESH_SERVER_STATUS - "%1 ¼­¹öÀÇ ÇöÀç »óŸ¦ È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CHANGE_SERVER_STATUS - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ Æ¯¼ºÀ» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_REFRESH_AGGREGATE_STATUS - "%1 ¼­¹ö¿¡¼­ %2 ÆÄƼ¼ÇÀÇ ÇöÀç »óŸ¦ È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_FILESET_STATUS - "%3 º¼·ý(%1 ¼­¹ö, %2 ÆÄƼ¼Ç)ÀÇ ÇöÀç »óŸ¦ È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_REFRESH_SERVICE_STATUS - "%1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½ºÀÇ ÇöÀç »óŸ¦ ÆÇº°ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_MOVE_FILESET "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ ÀÖ´Â %3 º¼·ýÀ» %4 ¼­¹öÀÇ %5 ÆÄƼ¼ÇÀ¸·Î À̵¿ÇÏÁö ¸øÇß½À´Ï´Ù." - IDS_ERROR_VIEW_LOGFILE "%1 ¼­¹ö¿¡¼­ %2 ÆÄÀÏÀ» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù.\n\nÆÄÀÏ À̸§À» ¿Ã¹Ù¸£°Ô ÀÔ·ÂÇß´ÂÁö È®ÀÎÇÏ°í ÆÄÀÏÀ» º¼ ¼ö Àִ Ư±ÇÀÌ ÃæºÐÇÑÁöµµ È®ÀÎÇϽʽÿÀ." - IDS_ERROR_NOT_REPLICATED "%1 º¼·ýÀÇ º¹Á¦ »óŸ¦ ÆÇº°ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_CREATE_FILESET - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ %3 º¼·ýÀ» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_DELETE_FILESET - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %3 º¼·ý(%1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç)À» »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_CREATE_VLDB_ENTRY - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý¿¡ ´ëÇÑ VLDB ÀÔ·Â Ç׸ñÀ» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_SET_FILESET_QUOTA - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý¿¡ ´ëÇÑ ÇÒ´ç·®À» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_CREATE_SERVER - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼¿ ³»¿¡ ¿äûµÈ ¼­¹ö ÀÔ·Â Ç׸ñÀ» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_PING_SERVER - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ IP ÁÖ¼Ò¸¦ ÆÇº°ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_DELETE_SERVER - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¸¦ »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_DELETE_SERVER_FILESETS - "%1 ¼­¹ö´Â ¾ÆÁ÷µµ Çϳª ÀÌ»óÀÇ º¼·ýÀ» º¸À¯ÇϹǷΠ»èÁ¦µÉ ¼ö ¾ø½À´Ï´Ù. ¼­¹ö´Â º¼·ýÀÌ ¾øÀ» ¶§¸¸ »èÁ¦µÉ ¼ö ÀÖ½À´Ï´Ù." - IDS_ERROR_CHANGE_AGGREGATE_STATUS - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ÆÄƼ¼Ç¿¡ ´ëÇÑ Æ¯¼ºÀ» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CHANGE_SERVICE_STATUS - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¿¡ ´ëÇÑ Æ¯¼ºÀ» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_START_SERVICE - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_STOP_SERVICE - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ Á¤ÁöÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_RESTART_SERVICE - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ Á¤ÁöÇÑ ÈÄ ´Ù½Ã ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CHANGE_REPLICA_STATUS - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý¿¡ ´ëÇÑ º¹Á¦ Ư¼ºÀ» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_SYNCVLDB "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ VLDB¸¦ °»½ÅÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_CREATE_REPLICA - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ýÀÇ º¹Á¦º»À» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_INSTALL_FILE - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ÆÄÀÏÀ» ¼³Ä¡ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_UNINSTALL_FILE - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ÆÄÀÏÀ» ¼³Ä¡ÇØÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_PRUNE_FILES - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ ¿äûµÈ ÆÄÀÏÀ» Á¦°ÅÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_RENAME_FILESET - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ º¼·ý À̸§À» %1¿¡¼­ ""%2""(À¸)·Î º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_CREATE_SERVICE - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_DELETE_SERVICE - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_RELEASE_FILESET - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ º¹Á¦µÈ %3 º¼·ýÀ» ÇØÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_UPDATE_FILESET - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %2 ¼­¹öÀÇ %1 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý º¹Á¦º»À» °»½ÅÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_UPDATE_ALL - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %3 º¼·ýÀÇ º¹Á¦º»À» °»½ÅÇÒ ¼ö ¾ø½À´Ï´Ù." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_LOAD_ADMLIST - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ °ü¸®ÀÚ ¸ñ·ÏÀ» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_LOAD_KEYLIST - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ ¼­¹ö Ű ¸ñ·ÏÀ» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_CREATE_KEY - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ »õ ¼­¹ö ۸¦ ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_SAVE_ADMLIST - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ °ü¸®ÀÚ ¸ñ·ÏÀ» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_CLONE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ %3 º¼·ýÀÇ ¹é¾÷ ¹öÀüÀ» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_CLONESYS "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ ¿äûµÈ ¹é¾÷ º¼·ýÀ» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_DUMP_FILESET - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %3 º¼·ý(%1 ¼­¹ö, %2 ÆÄƼ¼Ç)ÀÇ ³»¿ëÀ» %4 ÆÄÀÏ¿¡ ´ýÇÁÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_RESTORE_FILESET - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %3 º¼·ý(%1 ¼­¹ö, %2 ÆÄƼ¼Ç)¿¡ %4 ÆÄÀÏÀ» º¹¿øÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_SET_RESTART_TIMES - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ ¼­ºñ½ºÀÇ Àç½ÃÀÛ ½Ã°£À» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_DELETE_REPLICATED_FILESET - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ýÀ» »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n%3 º¼·ýÀº ¸ðµç º¹Á¦º»ÀÌ ¸ÕÀú »èÁ¦µÇÁö ¾Ê´Â ÀÌ»ó »èÁ¦µÉ ¼ö ¾ø½À´Ï´Ù." - IDS_CMDLINE_TITLE "¿À·ù - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" - IDS_CMDLINE_SYNTAX "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù." - IDS_CMDLINE_UNRECOGNIZED - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n""%1"" ¸Å°³º¯¼ö¸¦ ÀνÄÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_CMDLINE_DUPLICATE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n""%1"" ¸Å°³º¯¼ö°¡ ÇÑ ¹ø ÀÌ»ó ÁöÁ¤µÇ¾ú½À´Ï´Ù." - IDS_CMDLINE_UNEXPECTVALUE - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n""%1"" ¸Å°³º¯¼ö¿¡ °ªÀ» Á¦°øÇÏÁö ¸»¾Æ¾ß ÇÕ´Ï´Ù." - IDS_CMDLINE_MISSINGVAL "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n""%1"" ¸Å°³º¯¼ö ´ÙÀ½¿¡ °ªÀÌ ¿Í¾ß ÇÕ´Ï´Ù." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CMDLINE_SUBSETNOTCELL - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n""/SUBSET"" ¸Å°³º¯¼ö´Â ""/CELL"" ¸Å°³º¯¼ö°¡ ÁöÁ¤µÉ °æ¿ì¿¡¸¸ ÁöÁ¤µÉ ¼ö ÀÖ½À´Ï´Ù." - IDS_CMDLINE_INVALIDSUBSET - "ÁöÁ¤ÇÑ ""%2"" ¼­¹ö ¼­ºê¼¼Æ®´Â %1 ¼¿¿¡ ´ëÇØ Á¤ÀǵÇÁö ¾Ê¾Ò½À´Ï´Ù." - IDS_CMDLINE_SERVERNOTCELL - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n""/SERVER"" ¸Å°³º¯¼ö´Â ""/CELL"" ¸Å°³º¯¼ö°¡ ÁöÁ¤µÉ °æ¿ì¿¡¸¸ ÁöÁ¤µÉ ¼ö ÀÖ½À´Ï´Ù." - IDS_CMDLINE_RESET_TITLE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" - IDS_CMDLINE_RESET_DESC "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ ÁöÁ¤µÈ ¼³Á¤À» Áö¿ü½À´Ï´Ù." - IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº ÆÄƼ¼ÇÀÌ ¾ø°Å³ª ¹ÝÃâµÇÁö ¾Ê¾Ò±â ¶§¹®¿¡ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç°ú VLDB¸¦ µ¿±âÈ­ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n%1 ¼­¹ö¿¡¼­ ÀÌ ÆÄƼ¼ÇÀ» Á¦°ÅÇÏ·Á¸é, À̸¦ ÂüÁ¶ÇÏ´Â º¼·ý VLDB ÀÔ·Â Ç׸ñÀ» »èÁ¦ÇØ¾ß ÇÕ´Ï´Ù." - IDS_CMDLINE_USERPASSWORD - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n»õ AFS ÅäÅ«À» È®º¸ÇÏ·Á¸é, ""/USER"" ¹× ""/PASSWORD"" ¸Å°³º¯¼ö°¡ µÑ ´Ù ÁöÁ¤µÇ¾î¾ß ÇÕ´Ï´Ù." - IDS_ERROR_CANT_DELETE_KEY - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼­¹ö¿¡¼­ %2 ¼­¹ö ۸¦ »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_GETRANDOMKEY - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼­¹ö¿¡ ´ëÇÑ ÀÓÀÇ Å°¸¦ »ý¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_EXECUTE_COMMAND - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼­¹ö¿¡¼­ ´ÙÀ½ ¸í·ÉÀ» ½ÇÇàÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n ""%2""" - IDS_ERROR_CANT_READ_SALVAGE_LOG - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ º¹¿ø Á¶ÀÛÀ» ³¡³ÂÁö¸¸ º¹¿ø Á¶ÀÛÀÇ °íÀ¯ÇÑ °á°ú¸¦ ¼³¸íÇÏ´Â ·Î±× ÆÄÀÏÀ» °Ë»öÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_SALVAGE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ ¿äûµÈ º¹¿ø Á¶ÀÛÀ» ¼öÇàÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_AUTH_ON "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ ÀÎÁõ È®ÀÎÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_AUTH_OFF "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ ÀÎÁõ È®ÀÎ »ç¿ëÀ» ÁߴܽÃŰÁö ¸øÇß½À´Ï´Ù." - IDS_ERROR_CANT_LOAD_HOSTLIST - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ µ¥ÀÌÅͺ£À̽º È£½ºÆ® ¼­¹ö ¸ñ·ÏÀ» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù." - IDS_ERROR_CANT_SAVE_HOSTLIST - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ µ¥ÀÌÅͺ£À̽º È£½ºÆ® ¼­¹ö ¸ñ·ÏÀ» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº AFS Á¦¾î ¼¾ÅͰ¡ ÀÌ ÄÄÇ»ÅÍ¿¡ Á¦´ë·Î ¼³Ä¡µÇÁö ¾Ê¾ÒÀ¸¹Ç·Î ½ÃÀÛµÉ ¼ö ¾ø½À´Ï´Ù.\n\nAFS Á¦¾î ¼¾Å͸¦ ´Ù½Ã ¼³Ä¡ÇØ¾ß ÇÕ´Ï´Ù." - IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº ¾Ë ¼ö ¾ø´Â ¹®Á¦Á¡À¸·Î ½ÃÀÛµÉ ¼ö ¾ø½À´Ï´Ù.\n\nAFS Á¦¾î ¼¾Å͸¦ ´Ù½Ã ¼³Ä¡ÇØ¾ß ÇÕ´Ï´Ù." - IDS_ERROR_CANT_CHANGEADDR - "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿ë VLDB¿¡¼­ IP ÁÖ¼Ò¸¦ º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." -END - -#endif // Korean resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Korean resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR) +#ifdef _WIN32 +LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_SERVICES, DIALOG + BEGIN + RIGHTMARGIN, 165 + END + + IDD_AGGREGATES, DIALOG + BEGIN + RIGHTMARGIN, 118 + END + + IDD_FILESETS, DIALOG + BEGIN + RIGHTMARGIN, 180 + END + + IDD_SVR_LISTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_AGG_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 262 + TOPMARGIN, 5 + BOTTOMMARGIN, 155 + END + + IDD_SVR_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 183 + END + + IDD_SVR_SCOUT, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 153 + END + + IDD_SVC_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 268 + TOPMARGIN, 5 + BOTTOMMARGIN, 209 + END + + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 315 + TOPMARGIN, 2 + BOTTOMMARGIN, 224 + END + + IDD_SERVER, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 207 + TOPMARGIN, 2 + BOTTOMMARGIN, 135 + END + + IDD_SVC_CREATE, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 228 + END + + IDD_SET_REPSITES, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 216 + TOPMARGIN, 5 + BOTTOMMARGIN, 163 + END + + IDD_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 7 + BOTTOMMARGIN, 253 + HORZGUIDE, 160 + END + + IDD_TIMEOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 232 + TOPMARGIN, 7 + BOTTOMMARGIN, 153 + END + + IDD_COLUMNS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 281 + TOPMARGIN, 5 + BOTTOMMARGIN, 143 + END + + IDD_REFRESHALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 260 + TOPMARGIN, 7 + BOTTOMMARGIN, 68 + END + + IDD_SET_CREATE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 317 + TOPMARGIN, 4 + BOTTOMMARGIN, 205 + END + + IDD_SET_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 98 + END + + IDD_SET_CLONE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 341 + TOPMARGIN, 7 + BOTTOMMARGIN, 81 + END + + IDD_SVC_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 189 + END + + IDD_SVR_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 152 + END + + IDD_AGG_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 252 + TOPMARGIN, 5 + BOTTOMMARGIN, 146 + END + + IDD_SET_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 268 + TOPMARGIN, 5 + BOTTOMMARGIN, 177 + END + + IDD_SET_MOVETO, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 170 + END + + IDD_SET_MOVING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SVC_LOGNAME, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 102 + END + + IDD_SVC_VIEWLOG, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 181 + END + + IDD_SET_SETQUOTA, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 267 + TOPMARGIN, 4 + BOTTOMMARGIN, 126 + END + + IDD_ACTIONS, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 234 + TOPMARGIN, 2 + BOTTOMMARGIN, 56 + END + + IDD_SVR_SYNCVLDB, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 265 + TOPMARGIN, 4 + BOTTOMMARGIN, 95 + END + + IDD_SET_CREATEREP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 167 + END + + IDD_SVR_INSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 152 + END + + IDD_SVR_UNINSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 135 + END + + IDD_SVR_PRUNE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 196 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_SET_RENAME, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 129 + END + + IDD_SVC_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 290 + TOPMARGIN, 7 + BOTTOMMARGIN, 81 + END + + IDD_SVR_GETDATES, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_GETDATES_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 128 + END + + IDD_SET_DUMP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 291 + TOPMARGIN, 7 + BOTTOMMARGIN, 140 + END + + IDD_SET_RESTORE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 288 + TOPMARGIN, 4 + BOTTOMMARGIN, 244 + END + + IDD_SVC_BOS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_DUMPING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SET_RESTORING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SET_CLONESYS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 159 + END + + IDD_SUBSETS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 276 + TOPMARGIN, 5 + BOTTOMMARGIN, 177 + END + + IDD_SUBSET_LOADSAVE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 276 + TOPMARGIN, 4 + BOTTOMMARGIN, 141 + END + + IDD_HELP_FIND, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 214 + TOPMARGIN, 4 + BOTTOMMARGIN, 69 + END + + IDD_HELP_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 214 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_HELP_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 226 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_OPENINGCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 236 + TOPMARGIN, 2 + BOTTOMMARGIN, 41 + END + + IDD_OPTIONS_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 274 + TOPMARGIN, 5 + BOTTOMMARGIN, 131 + END + + IDD_SVR_KEYS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_CREATEKEY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + END + + IDD_SVC_STARTSTOP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 289 + TOPMARGIN, 7 + BOTTOMMARGIN, 145 + END + + IDD_SVR_EXECUTE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 254 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_SALVAGE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 7 + BOTTOMMARGIN, 250 + END + + IDD_SVR_SALVAGE_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 174 + END + + IDD_SET_RELEASE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 98 + END + + IDD_SVR_HOSTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_ADDHOST, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 221 + TOPMARGIN, 4 + BOTTOMMARGIN, 102 + END + + IDD_SVR_ADDRESS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 204 + TOPMARGIN, 4 + BOTTOMMARGIN, 111 + END + + IDD_SVR_NEWADDR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 219 + TOPMARGIN, 4 + BOTTOMMARGIN, 65 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_MAIN MENU DISCARDABLE +BEGIN + POPUP "¼¿(&C)" + BEGIN + MENUITEM "¼±ÅÃ(&S)...", M_CELL_OPEN + MENUITEM "ÀÎÁõ(&A)", M_CREDENTIALS + MENUITEM SEPARATOR + MENUITEM "Á¾·á(&X)", M_EXIT + END + POPUP "º¸±â(&V)" + BEGIN + POPUP "¼­¹ö(&S)" + BEGIN + MENUITEM "Å« ¾ÆÀÌÄÜ(&G)", M_SVR_VIEW_LARGE + , CHECKED + MENUITEM "ÀÛÀº ¾ÆÀÌÄÜ(&M)", M_SVR_VIEW_SMALL + , CHECKED + MENUITEM "ÀÚ¼¼È÷(&D)", M_SVR_VIEW_REPORT + , CHECKED + MENUITEM SEPARATOR + MENUITEM "Ç¥ÁØ(&N)", M_SVR_VIEW_ONEICON + , CHECKED + MENUITEM "¸ðµç ¾ÆÀÌÄÜ(&A)", M_SVR_VIEW_TWOICONS + , CHECKED + MENUITEM "»óŸ¸(&S)", M_SVR_VIEW_STATUS + , CHECKED + END + POPUP "»¡¸® º¸±â ºÐÇÒ¿µ¿ª(&Q)" + BEGIN + MENUITEM "¾øÀ½(&N)", M_DIVIDE_NONE, CHECKED + MENUITEM "¼öÁ÷ ºÐÇÒ(&V)", M_DIVIDE_H, CHECKED + MENUITEM "¼öÆò ºÐÇÒ(&H)", M_DIVIDE_V, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "ÁøÇà ÁßÀÎ Á¶ÀÛ(&P)", M_ACTIONS, CHECKED + MENUITEM SEPARATOR + MENUITEM "¸ð´ÏÅ͵Ǵ ¼­¹ö(&M)...", M_SUBSET + MENUITEM "Ä÷³(&C)...", M_COLUMNS + MENUITEM "¿É¼Ç(&O)...", M_OPTIONS + MENUITEM SEPARATOR + MENUITEM "¸ðµÎ »õ·Î °íħ(&F)", M_REFRESHALL + END + POPUP "µµ¿ò¸»(&H)" + BEGIN + MENUITEM "¸ñÂ÷(&C)", M_HELP + MENUITEM "¸í·É ã±â(&F)...", M_HELP_FIND + MENUITEM "¿À·ù ÄÚµå ã±â(&L)...", M_HELP_XLATE + MENUITEM SEPARATOR + MENUITEM "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ Á¤º¸(&A)...", M_ABOUT + END +END + +MENU_AGG MENU DISCARDABLE +BEGIN + MENUITEM "º¼·ý ÀÛ¼º(&C)...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "º¼·ý ¹é¾÷(&B)...", M_SET_CLONE + MENUITEM "¸ðµç º¼·ý Àá±ÝÇØÁ¦(&U)", M_SET_UNLOCK + MENUITEM "VLDB µ¿±âÈ­(&Y)...", M_SYNCVLDB + MENUITEM "º¼·ý º¹¿ø(&G)...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "»õ·Î °íħ(&F)", M_REFRESH + MENUITEM "Ư¼º(&R)", M_PROPERTIES +END + +MENU_SVC MENU DISCARDABLE +BEGIN + MENUITEM "½ÃÀÛ(&S)", M_SVC_START + MENUITEM "Á¤Áö(&T)", M_SVC_STOP + MENUITEM "Àç½ÃÀÛ(&R)", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "·Î±× ÆÄÀÏ º¸±â(&V)", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "»èÁ¦(&L)", M_SVC_DELETE + MENUITEM SEPARATOR + MENUITEM "»õ·Î °íħ(&F)", M_REFRESH + MENUITEM "Ư¼º(&R)", M_PROPERTIES +END + +MENU_AGG_NONE MENU DISCARDABLE +BEGIN + POPUP "º¸±â(&V)" + BEGIN + MENUITEM "Ç¥ÁØ(&N)", M_VIEW_ONEICON, CHECKED + MENUITEM "¸ðµç ¾ÆÀÌÄÜ(&A)", M_VIEW_TWOICONS, CHECKED + MENUITEM "»óŸ¸(&S)", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "º¼·ý ÀÛ¼º(&C)...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "¸ðµÎ »õ·Î °íħ(&F)", M_REFRESHALL +END + +MENU_SVC_NONE MENU DISCARDABLE +BEGIN + POPUP "º¸±â(&V)" + BEGIN + MENUITEM "Ç¥ÁØ(&N)", M_VIEW_ONEICON, CHECKED + MENUITEM "¸ðµç ¾ÆÀÌÄÜ(&A)", M_VIEW_TWOICONS, CHECKED + MENUITEM "»óŸ¸(&S)", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "¼­ºñ½º ÀÛ¼º(&C)...", M_SVC_CREATE + MENUITEM SEPARATOR + MENUITEM "¸ðµÎ »õ·Î °íħ(&F)", M_REFRESHALL +END + +MENU_SET MENU DISCARDABLE +BEGIN + MENUITEM "º¹Á¦(&E)...", M_SET_REPLICATION + MENUITEM "Áö±Ý ÇØÁ¦(&S)", M_SET_RELEASE + MENUITEM SEPARATOR + MENUITEM "¹é¾÷(&B)...", M_SET_CLONE + MENUITEM "ÆÄÀÏ¿¡ ´ýÇÁ(&D)...", M_SET_DUMP + MENUITEM "ÆÄÀϷκÎÅÍ º¹¿ø(&R)...", M_SET_RESTORE + MENUITEM "ÇÒ´ç·® ¼³Á¤(&Q)...", M_SET_SETQUOTA + MENUITEM "º¹¿ø(&G)...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "´ÙÀ½À¸·Î À̵¿(&M)...", M_SET_MOVETO + MENUITEM "À̸§ º¯°æ(&N)...", M_SET_RENAME + MENUITEM "»èÁ¦(&L)", M_SET_DELETE + MENUITEM SEPARATOR + MENUITEM "Àá±Ý(&K)", M_SET_LOCK + MENUITEM "Àá±ÝÇØÁ¦(&U)", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "»õ·Î °íħ(&F)", M_REFRESH + MENUITEM "Ư¼º(&R)", M_PROPERTIES +END + +MENU_SVR MENU DISCARDABLE +BEGIN + MENUITEM "¼­¹ö â ¿­±â(&O)", M_SVR_OPEN + MENUITEM "¼­¹ö ⠴ݱâ(&C)", M_SVR_CLOSE + MENUITEM "ÀÌ ¼­¹ö ¸ð´ÏÅÍ(&M)", M_SVR_MONITOR, CHECKED + MENUITEM SEPARATOR + MENUITEM "¼­¹ö º¸¾È ÆíÁý(&S)...", M_SVR_SECURITY + MENUITEM "µ¥ÀÌÅͺ£À̽º È£½ºÆ® °ü¸®(&H)...", M_SVR_HOSTS + MENUITEM "º¼·ý ¹é¾÷(&B)...", M_SET_CLONE + MENUITEM "¸ðµç º¼·ý Àá±ÝÇØÁ¦(&U)", M_SET_UNLOCK + MENUITEM "VLDB µ¿±âÈ­(&Y)...", M_SYNCVLDB + MENUITEM "º¼·ý º¹¿ø(&G)...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "ÆÄÀÏ ¼³Ä¡(&I)...", M_SVR_INSTALL + MENUITEM "ÆÄÀÏ ¼³Ä¡ ÇØÁ¦(&U)...", M_SVR_UNINSTALL + MENUITEM "ÀÌÀü ÆÄÀÏ Á¤¸®(&P)...", M_SVR_PRUNE + MENUITEM SEPARATOR + MENUITEM "ÆÄÀÏ ³¯Â¥ È®º¸(&T)...", M_SVR_GETDATES + MENUITEM "·Î±× ÆÄÀÏ º¸±â(&V)...", M_VIEWLOG + MENUITEM "¸í·É ½ÇÇà(&X)...", M_EXECUTE + MENUITEM SEPARATOR + MENUITEM "»õ·Î °íħ(&F)", M_REFRESH + MENUITEM "Ư¼º(&R)", M_PROPERTIES +END + +MENU_SVR_NONE MENU DISCARDABLE +BEGIN + POPUP "º¸±â(&V)" + BEGIN + MENUITEM "Å« ¾ÆÀÌÄÜ(&G)", M_SVR_VIEW_LARGE, CHECKED + MENUITEM "ÀÛÀº ¾ÆÀÌÄÜ(&M)", M_SVR_VIEW_SMALL, CHECKED + MENUITEM "ÀÚ¼¼È÷(&D)", M_SVR_VIEW_REPORT, CHECKED + MENUITEM SEPARATOR + MENUITEM "Ç¥ÁØ(&N)", M_SVR_VIEW_ONEICON, CHECKED + MENUITEM "¸ðµç ¾ÆÀÌÄÜ(&A)", M_SVR_VIEW_TWOICONS, CHECKED + MENUITEM "»óŸ¸(&S)", M_SVR_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "¸ð´ÏÅ͵Ǵ ¼­¹ö(&M)...", M_SUBSET + MENUITEM SEPARATOR + MENUITEM "¸ðµç º¼·ý Àá±ÝÇØÁ¦(&U)", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "¸ðµÎ ´Ý±â(&C)", M_SVR_CLOSEALL + MENUITEM "¸ðµÎ »õ·Î °íħ(&F)", M_REFRESHALL +END + +MENU_SET_NONE MENU DISCARDABLE +BEGIN + POPUP "º¸±â(&V)" + BEGIN + MENUITEM "º¼·ýº°(&V)", M_SET_VIEW_REPORT, CHECKED + MENUITEM "ÆÄƼ¼Çº°(&P)", M_SET_VIEW_TREELIST, CHECKED + MENUITEM "¼¼ºÎ»çÇ× ¾øÀ½(&D)", M_SET_VIEW_TREE, CHECKED + MENUITEM SEPARATOR + MENUITEM "Ç¥ÁØ(&N)", M_VIEW_ONEICON, CHECKED + MENUITEM "¸ðµç ¾ÆÀÌÄÜ(&A)", M_VIEW_TWOICONS, CHECKED + MENUITEM "»óŸ¸(&S)", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "º¼·ý ÀÛ¼º(&C)...", M_SET_CREATE + MENUITEM "ÆÄÀϷκÎÅÍ º¹¿ø(&R)...", M_SET_RESTORE + MENUITEM SEPARATOR + MENUITEM "º¼·ý ¹é¾÷(&B)...", M_SET_CLONE + MENUITEM SEPARATOR + MENUITEM "¸ðµÎ Àá±ÝÇØÁ¦(&U)", M_SET_UNLOCK + MENUITEM "¸ðµÎ »õ·Î °íħ(&F)", M_REFRESHALL +END + +MENU_COLUMNS MENU DISCARDABLE +BEGIN + MENUITEM "Ä÷³(&C)...", M_COLUMNS +END + +MENU_SVC_BOS MENU DISCARDABLE +BEGIN + MENUITEM "Àç½ÃÀÛ(&R)", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "·Î±× ÆÄÀÏ º¸±â(&V)", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "»õ·Î °íħ(&F)", M_REFRESH + MENUITEM "Ư¼º(&R)", M_PROPERTIES +END + +MENU_SET_DRAGDROP MENU DISCARDABLE +BEGIN + MENUITEM "¿©±â·Î À̵¿(&M)...", M_SET_MOVEHERE + MENUITEM "¿©±â¼­ º¹Á¦(&R)...", M_SET_REPHERE + MENUITEM SEPARATOR + MENUITEM "Ãë¼Ò(&C)", IDC_STATIC +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SERVICES DIALOGEX 0, 0, 179, 92 +STYLE DS_CENTER | WS_CHILD +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + LTEXT "¼­ºñ½º:",IDC_SVC_DESC,0,5,179,8 + CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,0,17,179, + 61,WS_EX_STATICEDGE + PUSHBUTTON "ÀÛ¼º(&C)...",IDC_SVC_CREATE,56,80,39,12 + PUSHBUTTON "»èÁ¦(&L)",IDC_SVC_DELETE,98,80,39,12 + PUSHBUTTON "Àç½ÃÀÛ(&R)",IDC_SVC_RESTART,140,80,39,12 +END + +IDD_AGGREGATES DIALOGEX 0, 0, 165, 84 +STYLE DS_CENTER | WS_CHILD +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + LTEXT "ÆÄƼ¼Ç:",IDC_AGG_DESC,0,5,165,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,0,17,165, + 53,WS_EX_STATICEDGE + PUSHBUTTON "º¼·ý ÀÛ¼º(&C)...",IDC_AGG_CREATESET,102,72,63,12 +END + +IDD_FILESETS DIALOGEX 0, 0, 194, 92 +STYLE DS_CENTER | WS_CHILD +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + LTEXT "º¼·ý:",IDC_SET_DESC,0,5,194,8 + CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,0,17,194, + 61,WS_EX_STATICEDGE + PUSHBUTTON "ÀÛ¼º(&C)...",IDC_SET_CREATE,3,80,39,12 + PUSHBUTTON "»èÁ¦(&L)",IDC_SET_DELETE,45,80,39,12 + PUSHBUTTON "º¹Á¦(&R)...",IDC_SET_REP,87,80,45,12 + PUSHBUTTON "ÇÒ´ç·® ¼³Á¤(&Q)...",IDC_SET_SETQUOTA,136,80,57,12 +END + +IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, + 135,WS_EX_CLIENTEDGE + PUSHBUTTON "°ü¸®ÀÚ Ãß°¡(&A)",IDC_LIST_ADD,72,160,65,14 + PUSHBUTTON "°ü¸®ÀÚ Á¦°Å(&R)",IDC_LIST_REMOVE,141,160,80,14 + LTEXT "%1 ¼­¹öÀÇ °ü¸®ÀÚ:",IDC_LIST_NAME,5,7,216,8 +END + +IDD_AGG_GENERAL DIALOGEX 0, 0, 267, 160 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + LTEXT "ID:",IDC_STATIC,5,30,31,8 + LTEXT "(Á¶È¸ Áß)",IDC_AGG_ID,38,30,214,8 + LTEXT "ÀåÄ¡:",IDC_STATIC,5,46,31,8 + LTEXT "(Á¶È¸ Áß)",IDC_AGG_DEVICE,38,46,214,8 + LTEXT "º¼·ý:",IDC_STATIC,5,62,31,8 + LTEXT "(Á¶È¸ Áß)",IDC_AGG_FILESETS,38,62,214,8 + CONTROL "Á¶ÇÕµÈ º¼·ý ÇÒ´ç·®ÀÌ ¿ë·®À» ÃʰúÇÏ¸é °æ°í Ç¥½Ã", + IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 38,76,215,10 + LTEXT "»ç¿ë·®:",IDC_STATIC,5,90,31,8 + LTEXT "(Á¶È¸ Áß)",IDC_AGG_USAGE,38,90,214,8 + CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,38,103,218,8, + WS_EX_STATICEDGE + CONTROL "ÆÄƼ¼Ç »ç¿ë·®ÀÌ ÃʰúµÇ¸é °æ°í Ç¥½Ã",IDC_AGG_WARN,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,38,116,214,10 + CONTROL "ÀÌ ¼­¹ö¿¡ ´ëÇÑ ±âº» ÀÓ°è°ª(&D)", + IDC_AGG_WARN_AGGFULL_DEF,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,49,131,203,9 + CONTROL "ÀÓ°è°ª(&T)",IDC_AGG_WARN_AGGFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,49,145,53,9 + EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,112,143,29,12, + ES_AUTOHSCROLL + LTEXT "Å©±âÀÇ ¹éºÐÀ²",IDC_AGG_WARN_AGGFULL_DESC,152,145,100,8 + ICON IDI_AGGREGATE,IDC_STATIC,5,5,20,20 + LTEXT "%2 ÆÄƼ¼Ç(%1 ¼­¹ö)",IDC_AGG_NAME,38,14,214,8 +END + +IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + LTEXT "IP ÁÖ¼Ò",IDC_STATIC,5,29,36,8 + LISTBOX IDC_SVR_ADDRESSES,53,29,70,12,LBS_NOSEL | NOT WS_BORDER | + WS_VSCROLL + PUSHBUTTON "ÁÖ¼Ò º¯°æ(&A)...",IDC_SVR_CHANGEADDR,144,28,77,12 + PUSHBUTTON "ÀÎÁõ ÇÊ¿ä(&R)",IDC_SVR_AUTH_YES,41,81,84,12 + PUSHBUTTON "¹ÌÀÎÁõ Çã¿ë(&U)",IDC_SVR_AUTH_NO,129,81,80,12 + LTEXT "ÆÄƼ¼Ç ¼ö:",IDC_STATIC,11,131,90,8 + LTEXT "(Á¶È¸ Áß)",IDC_SVR_NUMAGGREGATES,108,131,99,8 + LTEXT "ÃÑ ¿ë·®:",IDC_STATIC,11,148,48,8 + LTEXT "(Á¶È¸ Áß)",IDC_SVR_CAPACITY,108,148,99,8 + LTEXT "Á¶ÇÕµÈ º¼·ý ÇÒ´ç·®:",IDC_STATIC,11,165,79,8 + LTEXT "(Á¶È¸ Áß)",IDC_SVR_ALLOCATION,108,165,99,8 + ICON IDI_SERVER,IDC_STATIC,5,5,20,20 + LTEXT "(¼­¹ö À̸§)",IDC_SVR_NAME,55,13,93,8 + GROUPBOX "º¸¾È",IDC_STATIC,5,52,216,52 + GROUPBOX "±â¾ï¿µ¿ª",IDC_STATIC,5,115,216,68 + LTEXT "ÀÌ ¼­¹ö¿¡ ´ëÇÑ ¸ðµç ¾×¼¼½º°¡ ÀÎÁõµÇ¾î¾ß ÇÕ´Ï´Ù.", + IDC_STATIC,11,67,198,8 +END + +IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 221, 158 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + CONTROL "¼­¹ö¿¡ ÀÖ´Â ¸ðµç ÆÄƼ¼ÇÀÇ »ç¿ë·®ÀÌ", + IDC_SVR_WARN_AGGFULL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,18,124,9 + EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,140,17,24,12,ES_AUTOHSCROLL + LTEXT "% ÀÎ °æ¿ì",IDC_STATIC,176,19,38,8 + CONTROL "¼­¹ö¿¡ ÀÖ´Â ¸ðµç º¼·ýÀÇ »ç¿ë·®ÀÌ",IDC_SVR_WARN_SETFULL, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,32,120,9 + EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,135,31,24,12,ES_AUTOHSCROLL + LTEXT "% ÀÎ °æ¿ì",IDC_STATIC,172,33,36,8 + CONTROL "¸ðµç ÆÄƼ¼ÇÀÇ Á¶ÇÕµÈ ÇÒ´ç·®ÀÌ ¿ë·®À» ÃʰúÇÒ °æ¿ì", + IDC_SVR_WARN_AGGALLOC,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,46,200,9 + CONTROL "¼­¹ö¿¡ ÀÖ´Â ¸ðµç ¼­ºñ½ºÀÇ ½ÇÇàÀÌ ÁßÁöµÈ °æ¿ì", + IDC_SVR_WARN_SVCSTOP,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,60,195,9 + CONTROL "¼­¹öÀÇ ¸ðµç º¼·ý¿¡ VLDB Ç׸ñÀÌ ¾øÀ» °æ¿ì", + IDC_SVR_WARN_SETNOVLDB,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,74,195,9 + CONTROL "VLDB°¡ ¼­¹öÀÇ ¸ðµç ¿ÀÇÁ¶óÀÎ ÆÄƼ¼ÇÀ» ÂüÁ¶ÇÒ °æ¿ì", + IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,88,195,9 + CONTROL "VLDB°¡ ¼­¹öÀÇ ¸ðµç ¿ÀÇÁ¶óÀÎ º¼·ýÀ» ÂüÁ¶ÇÒ °æ¿ì", + IDC_SVR_WARN_SETNOSERV,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,103,195,9 + CONTROL "¼­¹ö Á¤º¸¸¦ ",IDC_SVR_AUTOREFRESH,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,5,142,51,11 + LTEXT "´ÙÀ½ÀÇ °æ¿ì¿¡ °æ°í¸¦ Ç¥½ÃÇÕ´Ï´Ù",IDC_STATIC,5,5,195,8 + EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,65,140,27,13,ES_AUTOHSCROLL + LTEXT "ºÐ¸¶´Ù »õ·Î °íħ",IDC_STATIC,106,143,74,8 +END + +IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 225, 207 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + PUSHBUTTON "¼­ºñ½º ·Î±× º¸±â(&V)",IDC_SVC_VIEWLOG,55,182,66,14 + PUSHBUTTON "Áö±Ý ½ÃÀÛ(&S)",IDC_SVC_START,126,182,43,14 + PUSHBUTTON "Áö±Ý Á¤Áö(&P)",IDC_SVC_STOP,169,182,43,14 + CONTROL "ÀÌ ¼­¹ö°¡ Á¤ÁöÇÏ¸é °æ°í Ç¥½Ã(&W)",IDC_SVC_WARNSTOP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,159,200,10 + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "%2 ¼­ºñ½º(%1 ¼­¹ö)",IDC_SVC_NAME,52,13,168,8 + LTEXT "À¯Çü:",IDC_STATIC,5,29,44,8 + LTEXT "(Á¶È¸ Áß)",IDC_SVC_TYPE,52,29,168,8 + LTEXT "¸Å°³º¯¼ö:",IDC_STATIC,5,45,44,8 + EDITTEXT IDC_SVC_PARAMS,52,45,168,13,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP + LTEXT "ÁöÁ¤ÀÚ:",IDC_STATIC,5,61,44,8 + LTEXT "(Á¶È¸ Áß)",IDC_SVC_NOTIFIER,52,61,168,8 + LTEXT "ÃÖÁ¾ ½ÃÀÛ:",IDC_STATIC,5,77,44,8 + LTEXT "(Á¶È¸ Áß)",IDC_SVC_STARTDATE,52,77,168,8 + LTEXT "ÃÖÁ¾ Á¤Áö:",IDC_STATIC,5,93,44,8 + LTEXT "(Á¶È¸ Áß)",IDC_SVC_STOPDATE,52,90,168,8 + LTEXT "ÃÖÁ¾ Àå¾Ö:",IDC_STATIC,5,109,44,8 + EDITTEXT IDC_SVC_LASTERROR,52,109,168,13,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + GROUPBOX "¼­ºñ½º »óÅÂ",IDC_STATIC,5,127,215,75 + LTEXT "ÀÌ ¼­ºñ½ºÀÇ ÇöÀç »óŸ¦ ÆÇº° ÁßÀÔ´Ï´Ù...", + IDC_SVC_STATUS,11,142,200,8 +END + +IDD_SET_GENERAL DIALOGEX 0, 0, 273, 214 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + LTEXT "º¼·ý ID:",IDC_STATIC,5,30,39,8 + LTEXT "(¾Ë ¼ö ¾øÀ½)",IDC_SET_ID,49,30,219,8 + LTEXT "ÀÛ¼º:",IDC_STATIC,5,46,39,8 + LTEXT "(Á¶È¸ Áß)",IDC_SET_CREATEDATE,49,46,219,8 + LTEXT "°»½Å:",IDC_STATIC,5,62,39,8 + LTEXT "(Á¶È¸ Áß)",IDC_SET_UPDATEDATE,49,62,112,8 + LTEXT "¾×¼¼½º:",IDC_STATIC,5,78,39,8 + LTEXT "(Á¶È¸ Áß)",IDC_SET_ACCESSDATE,49,78,219,8 + LTEXT "¹é¾÷:",IDC_STATIC,5,94,39,8 + LTEXT "(Á¶È¸ Áß)",IDC_SET_BACKUPDATE,49,94,219,8 + LTEXT "ÆÄÀÏ °è¼ö:",IDC_STATIC,5,110,34,8 + LTEXT "(Á¶È¸ Áß)",IDC_SET_FILES,49,110,219,8 + LTEXT "»óÅÂ:",IDC_STATIC,5,126,39,8 + LTEXT "(Á¶È¸ Áß)",IDC_SET_STATUS,49,126,115,8 + PUSHBUTTON "Àá±Ý(&L)",IDC_SET_LOCK,169,124,49,12 + PUSHBUTTON "Àá±ÝÇØÁ¦(&U)",IDC_SET_UNLOCK,219,124,49,12 + LTEXT "»ç¿ë·®:",IDC_STATIC,5,142,31,8 + LTEXT "(Á¶È¸ Áß)",IDC_SET_USAGE,49,142,136,8 + PUSHBUTTON "ÇÒ´ç·® ¼³Á¤(&Q)...",IDC_SET_QUOTA,210,140,58,12 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,49,156,219,8, + WS_EX_STATICEDGE + CONTROL "ÀÌ º¼·ýÀÇ »ç¿ë·®ÀÌ ÃʰúµÇ¸é °æ°í Ç¥½Ã(&W)",IDC_SET_WARN, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,49,170,219,10 + CONTROL "ÀÌ ¼­¹öÀÇ ±âº» ÀÓ°è°ª(&D)(±× Å©±âÀÇ %1%%)", + IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,61,185,207,9 + CONTROL "ÀÓ°è°ª(&T)",IDC_SET_WARN_SETFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,61,199,44,9 + EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,115,197,29,12, + ES_AUTOHSCROLL + LTEXT "Å©±âÀÇ ¹éºÐÀ²",IDC_SET_WARN_SETFULL_DESC,163,199,86,8 + ICON IDI_FILESET,IDC_STATIC,5,5,20,20 + LTEXT "%3 º¼·ý(%1 ¼­¹ö, %2 ÆÄƼ¼Ç)",IDC_SET_NAME,49,14,219,8 +END + +IDD_MAIN DIALOGEX 0, 0, 317, 226 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | + WS_SYSMENU | WS_THICKFRAME +CAPTION "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +MENU MENU_MAIN +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¼±ÅÃµÈ ¼¿:",IDC_STATIC,2,8,55,8 + LTEXT "(¼¿ À̸§Àº ¿©±â¿¡ À§Ä¡ÇÕ´Ï´Ù)",IDC_CELL,62,8,208,9 + LTEXT "AFS ÅäÅ«:",IDC_STATIC,2,19,55,8 + LTEXT "%2:%1(ÅäÅ«Àº %3¿¡ ¸¸±âµË´Ï´Ù)",IDC_AFS_ID,62,19,217,9 + CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,31,313, + 193,WS_EX_CLIENTEDGE + CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 + ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 +STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "¼­¹ö" +CLASS "ServerWindowClass" +FONT 9, "±¼¸²" +BEGIN + CONTROL "",IDC_TABS,"SysTabControl32",0x0,2,2,205,133 +END + +IDD_SVC_CREATE DIALOGEX 0, 0, 225, 233 +STYLE WS_CHILD +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + LTEXT "¼­¹ö(&S):",IDC_STATIC,5,36,44,8 + COMBOBOX IDC_SVC_SERVER,52,33,116,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "¼­ºñ½º(&V):",IDC_STATIC,5,52,44,8 + COMBOBOX IDC_SVC_NAME,52,50,116,104,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "¸í·É(&C):",IDC_STATIC,5,70,44,8 + EDITTEXT IDC_SVC_COMMAND,52,68,168,13,ES_AUTOHSCROLL + LTEXT "¸Å°³º¯¼ö(&P):",IDC_STATIC,5,88,44,8 + EDITTEXT IDC_SVC_PARAMS,52,86,168,13,ES_AUTOHSCROLL + LTEXT "ÁöÁ¤ÀÚ(&N):",IDC_STATIC,5,105,44,8 + EDITTEXT IDC_SVC_NOTIFIER,52,103,168,13,ES_AUTOHSCROLL + LTEXT "·Î±× ÆÄÀÏ(&L):",IDC_STATIC,5,122,44,8 + EDITTEXT IDC_SVC_LOGFILE,52,120,168,13,ES_AUTOHSCROLL + CONTROL "´Ü¼ø(¿¬¼Ó ½ÇÇà)(&I)",IDC_SVC_TYPE_SIMPLE,"Button", + BS_AUTORADIOBUTTON,11,154,201,10 + CONTROL "Áö±Ý ÀÌ ¼­ºñ½º ½ÃÀÛ(&T)",IDC_SVC_RUNNOW,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 + CONTROL "FS(ÆÄÀÏ ½Ã½ºÅÛ)(&F)",IDC_SVC_TYPE_FS,"Button", + BS_AUTORADIOBUTTON,11,180,201,10 + CONTROL "Å©·Ð(ÁöÁ¤µÈ °£°ÝÀ¸·Î ½ÇÇà)(&C)",IDC_SVC_TYPE_CRON, + "Button",BS_AUTORADIOBUTTON,11,195,201,10 + LTEXT "½ÇÇà ½Ã±â(&W):",IDC_STATIC,23,209,41,8 + COMBOBOX IDC_SVC_RUNDAY,70,207,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "½Ã°£",IDC_STATIC,143,209,8,8 + CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,154,207, + 53,13,WS_EX_CLIENTEDGE + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "»õ·Î¿î ¼­ºñ½º",IDC_SVC_DESC,52,13,168,8 + GROUPBOX "¼­ºñ½º À¯Çü",IDC_STATIC,5,141,215,87 +END + +IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 +STYLE WS_CHILD +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, + 199,58,WS_EX_CLIENTEDGE + PUSHBUTTON "Áö±Ý ÇØÁ¦(&R)",IDC_SET_RELEASE,11,143,52,14 + PUSHBUTTON "ÀÛ¼º(&C)...",IDC_SET_REPSITE_ADD,129,143,38,14 + PUSHBUTTON "»èÁ¦(&L)",IDC_SET_REPSITE_DELETE,172,143,38,14 + LTEXT "¼­¹ö:",-1,11,31,37,8 + LTEXT "(¼­¹ö À̸§)",IDC_SET_SERVER,55,31,147,8 + LTEXT "ÆÄƼ¼Ç:",-1,11,44,37,8 + LTEXT "(ÆÄƼ¼Ç À̸§)",IDC_SET_AGGREGATE,55,44,147,8 + LTEXT "º¼·ý:",-1,11,18,37,8 + LTEXT "(º¼·ý À̸§)",IDC_SET_NAME,55,18,147,8 + GROUPBOX "º¼·ý Àбâ/¾²±â",-1,5,5,211,56 + GROUPBOX "º¼·ý º¹Á¦º»",-1,5,67,211,96 +END + +IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 257 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "¼¿ ¼±Åà - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¼¿(&C):",IDC_STATIC,4,24,16,8 + COMBOBOX IDC_OPENCELL_CELL,24,22,191,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + GROUPBOX "AFS ÀÎÁõ",IDC_STATIC,4,44,211,92 + LTEXT "AFS ½Äº°(&I):",IDC_STATIC,22,100,55,8 + EDITTEXT IDC_OPENCELL_ID,80,98,129,14,ES_AUTOHSCROLL + LTEXT "AFS ¾ÏÈ£(&P):",IDC_STATIC,22,116,55,8 + EDITTEXT IDC_OPENCELL_PASSWORD,80,114,129,14,ES_PASSWORD | + ES_AUTOHSCROLL + PUSHBUTTON "°í±Þ(&V) >>",IDC_ADVANCED,4,146,53,14 + DEFPUSHBUTTON "È®ÀÎ",IDOK,86,146,41,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,130,146,41,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,174,146,41,14 + CONTROL "ÀÌ ¼¿ÀÇ ¸ðµç ¼­¹ö ¸ð´ÏÅÍ(&L)",IDC_MON_ALL,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,10,204,109,9 + CONTROL "ÇϳªÀÇ ¼­¹ö¸¸ ¸ð´ÏÅÍ(&M):",IDC_MON_ONE,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,10,219,103,10 + EDITTEXT IDC_MON_SERVER,125,218,83,13,ES_AUTOHSCROLL + CONTROL "¼­ºê¼¼Æ®ÀÇ ¼­¹ö¸¸ ¸ð´ÏÅÍ(&S):",IDC_MON_SOME,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,10,235,110,10 + COMBOBOX IDC_MON_SUBSET,125,233,83,93,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ÀÛ¾÷ÇÒ AFS ¼¿À» ¼±ÅÃÇϽʽÿÀ.",IDC_STATIC,4,7,200,8 + GROUPBOX "¼­¹ö ¸ð´ÏÅÍ",IDC_ADVANCED_GROUP,4,169,211,84 + LTEXT "´õ ºü¸¥ ¼º´ÉÀ» À§ÇØ ÀÌ ¼¿¿¡¼­ »ç¿ëÇÒ ¼ö ÀÖ´Â ¼­¹öÀÇ ºÎºÐÁýÇÕ¸¸ ¸ð´ÏÅÍÇÒ ¼ö ÀÖ½À´Ï´Ù.", + IDC_STATIC,10,182,199,17 + LTEXT "(Á¶È¸ Áß...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "¼¿À» °ü¸®ÇÏ·Á¸é, AFS ¾ÏÈ£¸¦ ´Ù½Ã ÀÔ·ÂÇØ¾ß ÇÕ´Ï´Ù.", + IDC_STATIC,10,85,196,8 + LTEXT "¼±ÅÃµÈ ¼¿¿¡ ÀÖ´Â ÇöÀç AFS ÅäÅ«:",IDC_STATIC,10,57,196,8 +END + +IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "°æ°í - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + CONTROL "ÀÛ¾÷ÀÌ Á¤»óÀûÀ¸·Î ¿Ï·áÇÒ ¶§±îÁö °è¼Ó ±â´Ù¸²(&C)", + IDC_TIMEOUT_WAIT,"Button",BS_AUTORADIOBUTTON,24,87,208, + 10 + CONTROL "ÀÛ¾÷À» Áö±Ý ÁߴܽÃÅ´(&T)",IDC_TIMEOUT_KILL,"Button", + BS_AUTORADIOBUTTON,24,101,208,10 + DEFPUSHBUTTON "È®ÀÎ",IDOK,93,139,50,14 + LTEXT "ÀÛ¾÷À» ½ÇÇàÇÏ´Â µ¥ ¼Ò¿äµÈ ½Ã°£:",IDC_STATIC,4,119,140, + 10 + LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,151,120,38,8 + LTEXT "³×Æ®¿öÅ© ÀÛ¾÷ÀÌ ¿À·£ ½Ã°£µ¿¾È ¿Ï·áÇÏÁö ¸øÇϰí ÀÖ½À´Ï´Ù.", + IDC_STATIC,4,7,228,18 + LTEXT "ÀÛ¾÷ÀÌ Á¾·áµÉ ¶§±îÁö ±â´Ù¸®°Å³ª(±ÇÀå) ÀÛ¾÷ÀÌ ³¡³ªÁö ¾ÊÀ» °ÍÀ¸·Î ÆÇ´ÜµÉ °æ¿ì AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥À¸·Î ÀÛ¾÷À» ÁߴܽÃų ¼ö ÀÖ½À´Ï´Ù.", + IDC_STATIC,4,30,228,26 + LTEXT "ÇöÀçÀÇ Ã¢ÀÌ Ç¥½ÃµÇ´Â µ¿¾È¿¡´Â ÀÛ¾÷ÀÌ °è¼Ó ÁøÇà ÁßÀ̶ó´Â Á¡À» À¯ÀÇÇϽʽÿÀ. ÀÛ¾÷ÀÌ Á¾·áµÇ¸é â ÀÚµ¿À¸·Î ´ÝÈü´Ï´Ù.", + IDC_STATIC,4,63,228,17 +END + +IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 +STYLE WS_POPUP | WS_CAPTION +CAPTION "Ä÷³" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¸ñ·Ï ³ª¿­½Ã Ç¥½ÃÇÒ Ä÷³ ¼±ÅÃ(&S).",IDC_STATIC,5,7,126,8 + COMBOBOX IDC_COLUMNS,134,5,147,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "»ç¿ë°¡´ÉÇÑ Ä÷³(&C):",IDC_STATIC,12,40,100,8 + LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LTEXT "Ç¥½ÃÇÒ Ä÷³(&I):",IDC_STATIC,173,41,100,8 + LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Ãß°¡(&A) >>",IDC_COL_INSERT,119,68,46,14 + PUSHBUTTON "<< Á¦°Å(&R)",IDC_COL_DELETE,119,88,46,14 + PUSHBUTTON "À§·Î À̵¿(&U)",IDC_COL_UP,173,122,48,14 + PUSHBUTTON "¾Æ·¡·Î À̵¿(&D)",IDC_COL_DOWN,224,122,50,14 + GROUPBOX "Ä÷³ Ç¥½Ã",IDC_STATIC,5,25,276,118 +END + +IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 264, 72 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "»õ·Î °íħ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, + 256,8 + LTEXT "0%% ¿Ï·á",IDC_REFRESH_PERCENT,4,49,209,8 + LTEXT "",IDC_REFRESH_CURRENT,4,60,208,8 + LTEXT "±â´Ù¸®½Ê½Ã¿À...",IDC_REFRESH_DESC,4,7,256,25 + PUSHBUTTON "°Ç³Ê¶Ù±â(&S)",IDC_REFRESH_SKIP,217,56,43,12,NOT + WS_TABSTOP +END + +IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý ÀÛ¼º" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "À̸§(&N):",IDC_STATIC,4,30,39,8 + EDITTEXT IDC_SET_NAME,46,28,116,14,ES_AUTOHSCROLL + LTEXT "ÇÒ´ç·®(&Q):",IDC_STATIC,4,48,39,8 + EDITTEXT IDC_SET_QUOTA,46,46,32,14,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,98,47,33,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "¹é¾÷(&B):",IDC_STATIC,4,66,39,8 + CONTROL "ÀÌ º¼·ý¿¡ ´ëÇÑ ¹é¾÷ ¹öÀüµµ ÀÛ¼º(&R)",IDC_SET_CLONE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,45,67,162,8 + LTEXT "¼­¹ö(&S):",IDC_STATIC,4,84,39,8 + COMBOBOX IDC_SET_SERVER,46,82,116,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ÆÄƼ¼Ç(&P):",IDC_STATIC,4,102,39,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,46,102,271, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "È®ÀÎ",IDOK,156,191,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,211,191,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,267,191,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "»õ·Î¿î º¼·ý",IDC_STATIC,46,12,170,8 +END + +IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 277, 102 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý »èÁ¦" +FONT 9, "±¼¸²" +BEGIN + DEFPUSHBUTTON "Ãë¼Ò",IDCANCEL,169,84,50,14 + PUSHBUTTON "È®ÀÎ",IDOK,115,84,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,223,84,50,14 + CONTROL "%1 ¼­¹ö, %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý »èÁ¦(&D)", + IDC_DELSET_SERVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 46,45,227,10 + CONTROL "%3 º¼·ý¿¡¼­ VLDB Ç׸ñ »èÁ¦(&V)",IDC_DELSET_VLDB,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,46,60,227,10 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "ÁÖÀÇ!\n\n%3 º¼·ýÀ» ¿µ±¸ÀûÀ¸·Î »èÁ¦ÇÕ´Ï´Ù.", + IDC_DELSET_DESC,31,7,242,33 +END + +IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "¹é¾÷ º¼·ý - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + DEFPUSHBUTTON "È®ÀÎ",IDOK,183,67,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,237,67,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,291,67,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,21,20 + LTEXT "º¼·ý ¹é¾÷Àº ±× º¼·ýÀÇ Àбâ Àü¿ë »çº»Ã³·³ µ¿ÀÛÇÕ´Ï´Ù. Àбâ/¾²±â º¼·ý¿¡´Â ¹é¾÷ ¹öÀüÀÌ Çϳª¸¸ ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù.", + IDC_STATIC,34,9,307,17 + LTEXT "È®ÀÎÀ» ´­·¯ %1 ¼­¹ö, %2 ÆÄƼ¼ÇÀÇ %3 º¼·ýÀÇ ¹é¾÷À» ÀÛ¼ºÇϽʽÿÀ. ÀÌ º¼·ýÀÇ ¹é¾÷ÀÌ ÀÌ¹Ì ÀÖÀ¸¸é, ±× ¹é¾÷ÀÌ °»½ÅµË´Ï´Ù.", + IDC_CLONE_DESC,34,32,307,24 +END + +IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + GROUPBOX "¹ß°ßµÈ ¹®Á¦Á¡",IDC_PROBLEM_BOX,5,36,215,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT + PUSHBUTTON "button 1",IDC_PROBLEM_REMEDY,138,120,61,12 + ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "%2 ¼­ºñ½º(%1 ¼­¹ö)",IDC_PROBLEM_TITLE,52,13,168,16 +END + +IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + GROUPBOX "¾Ë·ÁÁø ¹®Á¦Á¡",IDC_PROBLEM_BOX,5,36,216,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,172,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,201,49,10,83,SBS_VERT + PUSHBUTTON "button 1",IDC_PROBLEM_REMEDY,136,120,61,12 + ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "%1",IDC_PROBLEM_TITLE,42,13,179,8 +END + +IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + GROUPBOX "¾Ë·ÁÁø ¹®Á¦Á¡",IDC_PROBLEM_BOX,5,35,247,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT + PUSHBUTTON "button 1",IDC_PROBLEM_REMEDY,170,119,61,12 + ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "%2 ÆÄƼ¼Ç(%1 ¼­¹ö)",IDC_PROBLEM_TITLE,38,14,214,8 +END + +IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + GROUPBOX "¾Ë·ÁÁø ¹®Á¦Á¡",IDC_PROBLEM_BOX,5,35,263,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,250,45,12,67,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 + ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "%3 º¼·ý(%1 ¼­¹ö, %2 ÆÄƼ¼Ç)",IDC_PROBLEM_TITLE,49,14, + 219,8 +END + +IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý À̵¿" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,70,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "È®ÀÎ",IDOK,115,156,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,169,156,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,223,156,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,21,20 + LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,242,24 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 + LTEXT "´ÙÀ½À¸·Î º¼·ý À̵¿(&M):",IDC_STATIC,4,43,116,8 +END + +IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý À̵¿ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "%3 º¼·ýÀ» %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %4 ¼­¹öÀÇ %5 ÆÄƼ¼ÇÀ¸·Î À̵¿ ÁßÀÔ´Ï´Ù...", + IDC_MOVESET_DESC,4,41,229,19 +END + +IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 277, 106 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "·Î±× ÆÄÀÏ º¸±â" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¼­¹öÀÇ ·Î±× ÆÄÀÏ º¸±â(&S):",IDC_STATIC,10,45,73,8 + COMBOBOX IDC_VIEWLOG_SERVER,89,43,126,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "¼­¹ö¿¡¼­ ¿­¶÷ÇÒ ÆÄÀÏ(&F):",IDC_STATIC,10,64,73,8 + EDITTEXT IDC_VIEWLOG_FILENAME,89,62,179,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È®ÀÎ",IDOK,169,88,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,223,88,50,14 + ICON IDI_SERVICE,IDC_STATIC,4,4,20,20 + LTEXT "¿­¶÷ÇÒ ÆÄÀÏÀÇ Àüü °æ·Î¸¦ ÀÔ·ÂÇϽʽÿÀ.", + IDC_VIEWLOG_DESC,31,10,242,21 +END + +IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 286, 185 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "·Î±× ÆÄÀÏ º¸±â" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "ÆÄÀÏ ³»¿ë:",IDC_SVC_VIEWLOG_CONTENTS,4,41,277,8 + EDITTEXT IDC_VIEWLOG_TEXT,4,51,277,113,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL + PUSHBUTTON "´Ù¸¥ À̸§À¸·Î ÀúÀå(&A)...",IDC_VIEWLOG_SAVEAS,145,167, + 81,14 + DEFPUSHBUTTON "´Ý±â(&C)",IDOK,231,167,50,14 + ICON IDI_SERVICE,-1,4,7,20,20 + LTEXT "%1 ¼­¹öÀÇ ·Î±× ÆÄÀÏ [%2 ¼­ºñ½º¿¡ ´ëÇØ]", + IDC_SVC_VIEWLOG_DESC,33,7,248,8 + LTEXT "¼­¹ö¿¡¼­ÀÇ ÆÄÀÏ À̸§: %1",IDC_SVC_VIEWLOG_FILENAME,33, + 23,248,8 +END + +IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý ÇÒ´ç·® ¼³Á¤" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + LTEXT "ÇöÀç ÇÒ´ç·®:",IDC_STATIC,4,49,47,8 + LTEXT "(¾Ë ¼ö ¾øÀ½)",IDC_SET_USAGE,59,49,208,8 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,59,60,208,8, + WS_EX_STATICEDGE + LTEXT "»õ ÇÒ´ç·®(&Q):",IDC_STATIC,4,81,47,8 + EDITTEXT IDC_SET_QUOTA,59,79,32,13,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,103,79,30,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "È®ÀÎ",IDOK,109,112,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,163,112,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,217,112,50,14 + PUSHBUTTON "Ư¼º(&P)...",IDC_AGG_PROPERTIES,212,28,55,12 + LTEXT "ÆÄƼ¼Ç:",IDC_STATIC,4,30,47,8 + LTEXT "%1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç",IDC_SET_AGGREGATE,59,30,141,8 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "%1 º¼·ý",IDC_SET_NAME,59,11,208,8 +END + +IDD_ACTIONS DIALOGEX 0, 0, 236, 58 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_TOOLWINDOW +CAPTION "ÁøÇà ÁßÀÎ Á¶ÀÛ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + LTEXT "´ÙÀ½ Á¶ÀÛÀÌ ÇöÀç ÁøÇà ÁßÀÔ´Ï´Ù.",IDC_ACTION_DESC,2,2, + 232,8 + CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | + 0x3,2,14,232,43 +END + +IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "VLDB µ¿±âÈ­" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + DEFPUSHBUTTON "È®ÀÎ",IDOK,107,81,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,161,81,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,215,81,50,14 + ICON 32515,IDC_STATIC,4,4,21,20 + LTEXT "(½ÇÇà Áß ¼³Á¤)",IDC_SYNC_DESC,37,4,228,32 + LTEXT "(½ÇÇà Áß ¼³Á¤)",IDC_SYNC_DESC2,37,44,228,24 +END + +IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý º¹Á¦" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,62,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "È®ÀÎ",IDOK,115,153,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,169,153,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,223,153,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,21,20 + LTEXT "%3 º¼·ýÀÇ »õ º¹Á¦º»",IDC_SET_NAME,31,12,242,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 + LTEXT "´ÙÀ½¿¡¼­ ÀÌ º¼·ýÀÇ »õ º¹Á¦º» ÀÛ¼º(&C):",IDC_STATIC,4,35, + 125,8 +END + +IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 248, 156 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ÆÄÀÏ ¼³Ä¡" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¿øº» ÆÄÀÏ(&F):",IDC_STATIC,4,74,49,8 + EDITTEXT IDC_FILENAME,56,72,135,14,ES_AUTOHSCROLL + PUSHBUTTON "ã¾Æº¸±â(&B)...",IDC_BROWSE,194,72,50,14 + LTEXT "¸ñÇ¥ ¼­¹ö(&S):",IDC_STATIC,4,94,45,8 + COMBOBOX IDC_SERVER,56,92,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "¸ñÇ¥ À̸§(&N):",IDC_STATIC,4,114,49,8 + EDITTEXT IDC_DIRECTORY,56,112,135,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È®ÀÎ",IDOK,86,138,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,140,138,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,194,138,50,14 + ICON IDI_INSTALL,IDC_STATIC,4,4,20,20 + LTEXT "¼­¹ö¿¡ ÆÄÀÏ ¼³Ä¡",IDC_STATIC,32,12,127,8 + LTEXT "(½ÇÇà Áß ¼³Á¤µÈ ÅØ½ºÆ®)\n(½ÇÇà Áß ¼³Á¤µÈ ÅØ½ºÆ®)\n(½ÇÇà Áß ¼³Á¤µÈ ÅØ½ºÆ®)\n(½ÇÇà Áß ¼³Á¤µÈ ÅØ½ºÆ®)", + IDC_INSTALL_DESC,4,29,240,33 +END + +IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ÆÄÀÏ ¼³Ä¡ ÇØÁ¦" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¼­¹ö(&S):",IDC_STATIC,4,66,31,8 + COMBOBOX IDC_SERVER,41,64,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "¸ñÇ¥ ÆÄÀÏ(&F):",IDC_STATIC,4,85,32,8 + EDITTEXT IDC_FILENAME,41,83,175,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È®ÀÎ",IDOK,88,121,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,141,121,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,194,121,50,14 + ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 + LTEXT "¼­¹ö¿¡¼­ ÆÄÀÏ ¼³Ä¡¸¦ ÇØÁ¦ÇÕ´Ï´Ù",IDC_STATIC,32,12,127,8 + LTEXT "ÀÌ Á¶ÀÛÀ» »ç¿ëÇÏ¿© »çÀü¿¡ ¼³Ä¡µÈ ÆÄÀÏÀÇ »çº»À» ƯÁ¤ ¼­¹ö¿¡ º¹¿øÇÒ ¼ö ÀÖ½À´Ï´Ù. ¼±ÅÃµÈ ÆÄÀÏÀÇ »çÀü ¼³Ä¡ »çº»ÀÌ ¾øÀ¸¸é, ÆÄÀÏÀº Á¦°ÅµË´Ï´Ù.", + IDC_STATIC,4,29,240,26 +END + +IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 200, 141 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ÀÌÀü ÆÄÀÏ Á¤¸®" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¼­¹ö:",-1,4,56,44,8 + COMBOBOX IDC_SERVER,53,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "¸ðµç ÄÚ¾î ÆÄÀÏ »èÁ¦(&C)",IDC_OP_DELETE_CORE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,53,73,143,9 + CONTROL "¸ðµç .&BAK ÆÄÀÏ(ÆÄÀÏ ¹é¾÷) »èÁ¦",IDC_OP_DELETE_BAK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,84,143,8 + CONTROL "¸ðµç .OLD ÆÄÀÏ(ÀÌÀü ÆÄÀÏ ¹é¾÷) »èÁ¦(&O)", + IDC_OP_DELETE_OLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 53,96,143,9 + DEFPUSHBUTTON "È®ÀÎ",IDOK,39,123,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,93,123,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,146,123,50,14 + ICON IDI_PRUNE,-1,4,4,20,20 + LTEXT "¼­¹ö¿¡¼­ ÀÌÀü ÆÄÀÏÀ» Á¤¸®ÇÕ´Ï´Ù",-1,32,12,117,8 + LTEXT "ÀÌ Á¶ÀÛÀº ƯÁ¤ ¼­¹ö¿¡ ¼³Ä¡µÈ ÆÄÀÏÀÇ ¹é¾÷ »çº»À» »èÁ¦ÇÕ´Ï´Ù.", + -1,4,29,192,16 + LTEXT "»èÁ¦ÇÒ ÆÄÀÏ:",-1,4,73,45,8 +END + +IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý À̸§ º¯°æ" +FONT 9, "±¼¸²" +BEGIN + LTEXT "ÀÌÀü À̸§(&O):",IDC_STATIC,31,67,39,8 + EDITTEXT IDC_RENSET_OLD,74,65,122,14,ES_AUTOHSCROLL | ES_READONLY + LTEXT "»õ À̸§(&N):",IDC_STATIC,31,85,39,8 + EDITTEXT IDC_RENSET_NEW,74,83,122,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È®ÀÎ",IDOK,115,115,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,169,115,50,14 + PUSHBUTTON "µµ¿ò¸»",9,223,115,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "%3 º¼·ýÀÇ À̸§À» º¯°æÇÏ·Á¸é, ¾Æ·¡¿¡ »õ À̸§À» ÀÔ·ÂÇϽʽÿÀ. À̸§À» º¯°æÇÏ¸é º¼·ýÀÇ ¹é¾÷ ¹× ±× º¹Á¦º»ÀÌ ¸ðµÎ ÀÚµ¿À¸·Î º¯°æµË´Ï´Ù.\n\nÁÖÀÇ: ¸¶¿îÆ®µÈ º¼·ýÀÇ À̸§À» º¯°æÇÒ °æ¿ì¿¡´Â ÇØ´ç ¸¶¿îÆ® Æ÷ÀÎÆ®¸¦ »èÁ¦ÇÏ°í ´Ù½Ã ÀÛ¼ºÇØ¾ß ÇÕ´Ï´Ù.", + IDC_RENSET_DESC,31,7,242,48 +END + +IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 294, 85 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "¼­ºñ½º »èÁ¦" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + DEFPUSHBUTTON "Ãë¼Ò",IDCANCEL,169,67,50,14 + PUSHBUTTON "È®ÀÎ",IDOK,115,67,50,14 + PUSHBUTTON "µµ¿ò¸»",9,240,67,50,14 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "ÁÖÀÇ!\n\nÀÌ Á¶ÀÛÀ¸·Î ÀÎÇØ %2 ¼­ºñ½º°¡ Á¤ÁöµÇ°í %1 ¼­¹ö·ÎºÎÅÍ »èÁ¦µË´Ï´Ù.", + IDC_DELSVC_DESC,48,7,242,37 +END + +IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ÆÄÀÏ ³¯Â¥ È®º¸" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¼­¹ö(&S):",-1,10,55,42,8 + COMBOBOX IDC_SERVER,66,56,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Á¶È¸ÇÒ ÆÄÀÏ(&F):",-1,10,75,53,8 + EDITTEXT IDC_FILENAME,66,72,135,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È®ÀÎ",IDOK,86,107,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,140,107,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,194,107,50,14 + ICON IDI_GETDATES,-1,4,4,20,21 + LTEXT "¼­¹ö¿¡¼­ ÆÄÀÏ ³¯Â¥¸¦ È®º¸ÇϽʽÿÀ",-1,32,12,127,8 + LTEXT "ÀÌ Á¶ÀÛÀ» ÅëÇØ ÆÄÀÏ ¹× ±× ¹é¾÷(ÀÖ´Â °æ¿ì)ÀÌ ÃÖÁ¾ ¼öÁ¤µÈ ³¯Â¥¸¦ È®º¸ÇÕ´Ï´Ù.", + -1,4,29,240,16 +END + +IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ÆÄÀÏ ³¯Â¥ È®º¸ - °á°ú" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¼­¹ö:",IDC_STATIC,10,31,39,8 + LTEXT "(½ÇÇà Áß ¼³Á¤)",IDC_SERVER,51,31,137,8 + LTEXT "ÆÄÀÏ À̸§:",IDC_STATIC,10,47,39,8 + LTEXT "(½ÇÇà Áß ¼³Á¤)",IDC_FILENAME,51,47,137,8 + LTEXT "ÆÄÀÏ ³¯Â¥:",IDC_STATIC,10,61,39,8 + LTEXT "(¾Ë ¼ö ¾øÀ½. ÆÄÀÏÀ» ãÀ» ¼ö ¾øÀ½)",IDC_DATE_FILE,51,61, + 184,8 + LTEXT ".BAK ³¯Â¥:",IDC_STATIC,10,77,39,8 + LTEXT "(¾Ë ¼ö ¾øÀ½. ÆÄÀÏÀ» ãÀ» ¼ö ¾øÀ½)",IDC_DATE_BAK,51,77, + 179,8 + LTEXT ".OLD ³¯Â¥:",IDC_STATIC,10,91,39,8 + LTEXT "(¾Ë ¼ö ¾øÀ½. ÆÄÀÏÀ» ãÀ» ¼ö ¾øÀ½)",IDC_DATE_OLD,51,91, + 180,8 + DEFPUSHBUTTON "´Ý±â(&C)",IDOK,99,114,50,14 + ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 + LTEXT "¼­¹ö¿¡¼­ ÆÄÀÏ ³¯Â¥¸¦ È®º¸ÇϽʽÿÀ",IDC_STATIC,32,12,127, + 8 +END + +IDD_SET_DUMP DIALOGEX 0, 0, 295, 144 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý ´ýÇÁ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "ÀÛ¼ºµÉ ´ýÇÁ ÆÄÀÏ ÀÛ¼º(&N):",IDC_STATIC,4,42,77,8 + EDITTEXT IDC_DUMP_FILENAME,86,40,143,14,ES_AUTOHSCROLL + PUSHBUTTON "ã¾Æº¸±â(&B)...",IDC_DUMP_BROWSE,237,40,48,14 + CONTROL "%3 º¼·ýÀÇ Àüü ³»¿ë ´ýÇÁ(ÆÄƼ¼Ç %1:%2)(&E)", + IDC_DUMP_FULL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10, + 78,197,10 + CONTROL "´ÙÀ½ ÀÌÈÄ¿¡ º¯°æµÈ ÆÄÀϸ¸ ´ýÇÁ(&S)",IDC_DUMP_LIMIT_TIME, + "Button",BS_AUTORADIOBUTTON,10,94,141,10 + CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,160,93,51, + 13,WS_EX_CLIENTEDGE + CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,218,93,56, + 13,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "È®ÀÎ",IDOK,131,126,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,185,126,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,241,126,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "ÀÌ Á¶ÀÛÀº º¼·ýÀÇ ³»¿ëÀ» ÇϳªÀÇ ÆÄÀÏ·Î º¹»çÇϹǷΠº¼·ýÀ» ½±°Ô ¹é¾÷ÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÌ·± ¹æ¹ýÀ¸·Î ´ýÇÁµÈ º¼·ýÀÇ ³»¿ëÀº ³ªÁß¿¡ º¹¿øµË´Ï´Ù.", + IDC_STATIC,30,7,261,24 + GROUPBOX "´ýÇÁ ¸Å°³º¯¼ö",IDC_STATIC,4,62,287,53 +END + +IDD_SET_RESTORE DIALOGEX 0, 0, 292, 248 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý º¹¿ø - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "º¹¿øÇÒ ÆÄÀÏ(&R):",IDC_STATIC,4,33,48,8 + EDITTEXT IDC_RESTORE_FILENAME,57,30,175,14,ES_AUTOHSCROLL + PUSHBUTTON "ã¾Æº¸±â(&B)...",IDC_RESTORE_BROWSE,238,30,50,14 + CONTROL "ÁõºÐ ´ýÇÁ ÆÄÀÏÀÓ(&I)",IDC_RESTORE_INCREMENTAL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,57,46,86,10 + LTEXT "º¼·ý(&V):",IDC_STATIC,11,102,23,8 + EDITTEXT IDC_RESTORE_SETNAME,50,100,115,14,ES_AUTOHSCROLL + LTEXT "¼­¹ö(&S):",IDC_STATIC,11,145,24,8 + COMBOBOX IDC_RESTORE_SERVER,51,143,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "ÆÄƼ¼Ç(&P):",IDC_STATIC,11,162,36,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,50,161,231, + 55,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "È®ÀÎ",IDOK,128,230,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,183,230,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,238,230,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "´ýÇÁ ÆÄÀϷκÎÅÍ º¼·ýÀ» º¹¿øÇϽʽÿÀ",IDC_STATIC,33,11, + 224,8 + GROUPBOX "¸ñÇ¥ º¼·ý",IDC_STATIC,4,63,284,160 + LTEXT "´ýÇÁ ÆÄÀϷκÎÅÍ º¼·ýÀ» º¹¿øÇÒ ¶§ »õ º¼·ýÀ» ÀÛ¼ºÇϰųª ±âÁ¸ÀÇ Àбâ/¾²±â º¼·ý¿¡ °ãÃľµ ¼ö ÀÖ½À´Ï´Ù.", + IDC_STATIC,11,78,259,16 + LTEXT "(½ÇÇà Áß ¼³Á¤)\n(½ÇÇà Áß ¼³Á¤)",IDC_RESTORE_CREATE,51, + 119,229,17 +END + +IDD_SVC_BOS DIALOGEX 0, 0, 225, 207 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + CONTROL "ÀÌ ¼­¹ö¿¡¼­ Á¤±âÀûÀ¸·Î ¸ðµç ¼­ºñ½º¸¦ Á¤ÁöÇÏ°í ´Ù½Ã ½ÃÀÛ(&P)", + IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, + 71,201,10 + LTEXT "Àç½ÃÀÛ(&R)",IDC_BOS_GENRES_DESC1,23,87,25,8 + COMBOBOX IDC_BOS_GENRES_DATE,54,84,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "½Ã°£(&A)",IDC_BOS_GENRES_DESC2,127,87,8,8 + CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,138, + 84,53,13,WS_EX_CLIENTEDGE + CONTROL "»õ ÀÌÁø ÆÄÀÏÀÇ °æ¿ì ¸ðµç ¼­ºñ½º¸¦ Á¤±âÀûÀ¸·Î °Ë»ç(&B)", + IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, + 151,201,10 + LTEXT "°Ë»ç(&S)",IDC_BOS_BINRES_DESC1,23,167,25,8 + COMBOBOX IDC_BOS_BINRES_DATE,54,164,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "½Ã°£(&T)",IDC_BOS_BINRES_DESC2,127,167,8,8 + CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,138, + 164,53,13,WS_EX_CLIENTEDGE + ICON IDI_BOSSERVICE,IDC_STATIC,5,5,20,20 + LTEXT "%2 ¼­ºñ½º(%1 ¼­¹ö)",IDC_SVC_NAME,46,13,174,8 + GROUPBOX "BOS ¼­ºñ½º",IDC_STATIC,5,27,215,175 + LTEXT "BOS ¼­ºñ½º¸¦ »ç¿ëÇÏ¿© ÀÌ ¼­¹öÀÇ ¸ðµç ¼­ºñ½º¸¦ Á¤±âÀûÀ¸·Î Á¤ÁöÇÏ°í ´Ù½Ã ½ÃÀÛÇÒ ¼ö ÀÖ½À´Ï´Ù(BOS ¼­ºñ½º ÀÚü Æ÷ÇÔ).", + IDC_STATIC,11,45,200,18 + LTEXT "¶ÇÇÑ BOS ¼­ºñ½º¸¦ »ç¿ëÇÏ¿© ¼­¹öÀÇ ¸ðµç ¼­ºñ½º¸¦ Á¤±âÀûÀ¸·Î °Ë»çÇϰí ÀÌÁø ÆÄÀÏÀÌ °»½ÅµÈ ¼­ºñ½º¸¸ Á¤ÁöÇÏ°í ´Ù½Ã ½ÃÀÛÇÒ ¼ö ÀÖ½À´Ï´Ù.", + IDC_STATIC,11,118,200,25 +END + +IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý ´ýÇÁ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "%3 º¼·ý¿¡¼­ %4 ´ýÇÁ ÆÄÀÏ ÀÛ¼º Áß...",IDC_DUMPSET_DESC,4, + 41,229,19 +END + +IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý º¹¿ø - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "%2 ´ýÇÁ ÆÄÀÏ¿¡¼­ %1 º¼·ý º¹¿ø Áß...", + IDC_RESTORESET_DESC,4,41,229,19 +END + +IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 258, 163 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý ¹é¾÷ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + CONTROL "ÀÌ ¼¿ÀÇ ¸ðµç º¼·ý¿¡ ´ëÇÑ ¹é¾÷ ¹öÀü ÀÛ¼º(&A)", + IDC_CLONE_ALL,"Button",BS_AUTORADIOBUTTON,30,46,214,10 + GROUPBOX " ",IDC_STATIC,23,68,231,67 + CONTROL "´ÙÀ½ ±âÁذú ÀÏÄ¡ÇÏ´Â º¼·ý¿¡ ´ëÇÑ ¹é¾÷¸¸ ÀÛ¼º(&O)", + IDC_CLONE_SOME,"Button",BS_AUTORADIOBUTTON,30,60,214,10 + CONTROL "¼­¹ö¿¡ ÀÖ´Â º¼·ý¸¸(&S):",IDC_CLONE_SVR_LIMIT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,41,83,92,10 + COMBOBOX IDC_CLONE_SVR,152,82,85,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "ÆÄƼ¼Ç¿¡ ÀÖ´Â º¼·ý¸¸(&P):",IDC_CLONE_AGG_LIMIT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,41,99,97,10 + COMBOBOX IDC_CLONE_AGG,152,98,85,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "´ÙÀ½À¸·Î ½ÃÀÛÇÏ´Â º¼·ý¸¸(&B):",IDC_CLONE_PREFIX_LIMIT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,41,116,106,10 + EDITTEXT IDC_CLONE_PREFIX,152,115,85,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È®ÀÎ",IDOK,95,145,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,149,145,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,204,145,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "º¼·ý ¹é¾÷Àº ±× º¼·ýÀÇ Àбâ Àü¿ë »çº»Ã³·³ µ¿ÀÛÇÕ´Ï´Ù. Àбâ/¾²±â º¼·ý¿¡´Â ÇϳªÀÇ ¹é¾÷ ¹öÀü¸¸ ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù.\n\nµ¿½Ã¿¡ Çϳª ÀÌ»óÀÇ º¼·ý¿¡ ´ëÇÑ ¹é¾÷ ¹öÀüÀ» ÀÛ¼ºÇÒ ¼ö ÀÖ½À´Ï´Ù.", + IDC_STATIC,30,7,216,34 +END + +IDD_SUBSETS DIALOGEX 0, 0, 281, 182 +STYLE WS_POPUP | WS_CAPTION +CAPTION "¸ð´ÏÅ͵Ǵ ¼­¹ö" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + LTEXT "¼­ºê¼¼Æ® À̸§:",IDC_STATIC,12,77,56,8 + EDITTEXT IDC_SUBSET_NAME,74,75,106,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_TABSTOP + PUSHBUTTON "¿­±â(&O)...",IDC_SUBSET_LOAD,185,75,39,14 + PUSHBUTTON "ÀúÀå(&S)...",IDC_SUBSET_SAVE,229,75,39,14 + CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x153,12,111,193,58,WS_EX_CLIENTEDGE + PUSHBUTTON "ÀüºÎ ¸ð´ÏÅÍÇÔ(&A)",IDC_SUBSET_ALL,211,122,57,14 + PUSHBUTTON "¸ð´ÏÅÍ ¾ÈÇÔ(&N)",IDC_SUBSET_NONE,211,140,57,14 + LTEXT "Å« ¼¿¿¡¼­ ÀÛ¾÷ÇÒ ¶§ ¼º´ÉÀ» Çâ»ó½ÃŰ·Á¸é ¹®Á¦Á¡À» ã±â À§ÇØ Æ¯Á¤ ¼­¹ö¸¦ ¸ð´ÏÅÍÇÏÁö ¸¶½Ê½Ã¿À. AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº ¸ð´ÏÅ͵ÇÁö ¾ÊÀº ¼­¹öÀÇ º¼·ý, ÆÄƼ¼Ç ¶Ç´Â ¼­ºñ½º¸¦ Ç¥½ÃÇÏÁö ¾Ê½À´Ï´Ù.", + IDC_STATIC,5,5,271,24 + LTEXT "¾ðÁ¦µçÁö ¼­¹ö¸¦ ¸ð´ÏÅÍ(¶Ç´Â ¸ð´ÏÅÍÇÏÁö ¾ÊÀ» ¼ö ÀÖÀ½)ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¼­¹ö ¼­ºê¼¼Æ®¸¦ ÀÛ¼ºÇÏ¿© ¸ð´ÏÅÍÇÒ ¼­¹ö ¸ñ·ÏÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.", + IDC_STATIC,5,37,271,18 + GROUPBOX "ÇöÀç ¼­ºê¼¼Æ®",IDC_STATIC,5,63,271,114 + LTEXT "¸ð´ÏÅÍÇÒ ¼­¹ö:",IDC_STATIC,12,95,60,8 +END + +IDD_SUBSET_LOADSAVE DIALOG DISCARDABLE 0, 0, 280, 145 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | + WS_CAPTION | WS_SYSMENU +CAPTION "(½ÇÇà Áß ¼³Á¤µÈ Á¦¸ñ)" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¼­ºê¼¼Æ® À̸§(&N):",1090,5,112,45,8,SS_NOTIFY + EDITTEXT IDC_SUBSET_NAME,54,110,165,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "¿­±â(&O)",IDOK,226,110,50,14 + PUSHBUTTON "Ãë¼Ò(&L)",IDCANCEL,226,127,50,14 + CONTROL "List1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | + LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,272,82, + WS_EX_CLIENTEDGE + PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT + WS_TABSTOP + PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT + WS_TABSTOP + LTEXT "ÀÌ ¼¿¿¡ ´ëÇØ Á¤ÀÇµÈ ¼­ºê¼¼Æ®:",IDC_STATIC,4,6,114,8 +END + +IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "ã±â ¸í·É" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + COMBOBOX IDC_FIND_COMMAND,4,38,137,170,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "µµ¿ò¸» Ç¥½Ã(&H)",IDOK,147,38,67,14 + PUSHBUTTON "Ãë¼Ò(&C)",IDCANCEL,147,55,67,14 + LTEXT "ÀÛ¾÷À» ¼öÇàÇϱâ À§ÇØ AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥À» »ç¿ëÇÏ´Â ¹æ¹ýÀ» ¾Ë¾Æº¸·Á¸é, ¾Æ·¡ÀÇ ¸í·ÉÇàÀ» ¼±ÅÃÇÏ°í µµ¿ò¸» Ç¥½Ã ´ÜÃ߸¦ ´©¸£½Ê½Ã¿À.", + IDC_STATIC,4,4,210,25 +END + +IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 141 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "¿À·ù ÄÚµå ã±â" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¿À·ù ¹øÈ£(&E):",IDC_STATIC,4,41,45,8 + EDITTEXT IDC_ERROR_NUMBER,59,39,78,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "º¯È¯(&T)",IDC_ERROR_TRANSLATE,147,39,67,14 + PUSHBUTTON "´Ý±â(&C)",IDCANCEL,85,123,48,14 + LTEXT "(½ÇÇà Áß ¼³Á¤µÈ ÅØ½ºÆ®)",IDC_ERROR_DESC,4,71,210,42 + LTEXT "¿À·ù ÄÚµåÀÇ Àǹ̸¦ ¾Ë¾Æº¸·Á¸é, ¾Æ·¡¿¡ Äڵ带 ÀÔ·ÂÇϰí ""º¯È¯"" ´ÜÃ߸¦ ´©¸£½Ê½Ã¿À.", + IDC_STATIC,4,4,210,25 + CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 +END + +IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇÑ Á¤º¸" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 + LTEXT "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ ¹öÀü 3.5",IDC_STATIC,33,8,163,8 + LTEXT "Copyright IBM Corporation 1989, 1999",IDC_STATIC,33,20, + 183,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 + CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 + PUSHBUTTON "´Ý±â(&C)",IDOK,89,123,50,14 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 +END + +IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼¿¿¡ ÀÖ´Â ¼­¹ö¸¦ Ž»ö ÁßÀÔ´Ï´Ù...", + IDC_OPENCELL_DESC,41,15,183,16 + GROUPBOX "",IDC_STATIC,4,2,231,39 + ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 279, 136 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + CONTROL "¼­¹öÀÇ ¿ÏÀüÇÑ µµ¸ÞÀÎ À̸§ Ç¥½Ã(¿¹: ""machine.company.com"")", + IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,5,269,10 + CONTROL "°ü¸® ÅäÅ« ¾øÀÌ ÀÛ¾÷ÇÏ´Â °æ¿ì, °æ°í Ç¥½Ã(&W)", + IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,19,269,10 + CONTROL "Ç×»ó ±× ¼­¹öÀÇ Æ¯¼º Ç¥½Ã",IDC_OPT_SVR_DBL_PROP,"Button", + BS_AUTORADIOBUTTON,21,50,253,10 + CONTROL "ºü¸¥ º¸±â ºÐÇÒ ¿µ¿ªÀÌ ¿­·Á ÀÖÀ» ¶§¸¸ ±× ¼­¹öÀÇ Æ¯¼º Ç¥½Ã", + IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON,21, + 63,253,10 + CONTROL "¾ðÁ¦³ª ±× ¼­¹ö¿¡ ´ëÇÑ Ã¢À» ¿­¾î ³õÀ½", + IDC_OPT_SVR_DBL_OPEN,"Button",BS_AUTORADIOBUTTON,21,75, + 253,10 + CONTROL "±× ¼­¹ö°¡ ¸ð´ÏÅ͵ǵµ·Ï ¼­¹ö â ¿­±â", + IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,21,107,253,10 + CONTROL "±× ¼­¹ö°¡ ¸ð´ÏÅ͵ÇÁö ¾Êµµ·Ï ¼­¹ö ⠴ݱâ", + IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,21,121,253,10 + LTEXT "¼­¹öÀÇ ¾ÆÀÌÄÜÀ» µÎ ¹ø ´©¸£´Â °æ¿ì",IDC_STATIC,5,38,269, + 8 + LTEXT "¼­¹ö ¼­ºê¼¼Æ®¸¦ »ç¿ë ÁßÀÌ°í ºü¸¥ º¸±â ºÐÇÒ ¿µ¿ªÀÌ ´ÝÈù °æ¿ì", + IDC_STATIC,5,95,269,8 +END + +IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,22,216, + 135,WS_EX_CLIENTEDGE + PUSHBUTTON "¼­¹ö Ű Ãß°¡(&A)",IDC_KEY_ADD,72,160,65,14 + PUSHBUTTON "¼­¹ö Ű Á¦°Å(&R)",IDC_KEY_REMOVE,141,160,80,14 + LTEXT "¼­¹ö¿ë Ű:",IDC_KEY_NAME,5,7,216,8 +END + +IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "¼­¹ö Ű Ãß°¡" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¹öÀü:",IDC_STATIC,7,37,26,8 + EDITTEXT IDC_KEY_VERSION,43,35,43,14,ES_AUTOHSCROLL + LTEXT "°ª:",IDC_STATIC,7,58,21,8 + CONTROL "ÇØ´ç ¹®ÀÚ¿­ ¾Ïȣȭ:",IDC_KEY_BYSTRING,"Button", + BS_AUTORADIOBUTTON,43,58,73,10 + CONTROL "ÇØ´ç Ű »ç¿ë:",IDC_KEY_BYDATA,"Button", + BS_AUTORADIOBUTTON,43,76,57,10 + EDITTEXT IDC_KEY_STRING,119,56,155,14,ES_PASSWORD | + ES_AUTOHSCROLL + EDITTEXT IDC_KEY_DATA,119,75,103,14,ES_AUTOHSCROLL + PUSHBUTTON "ÀÓÀǼ±ÅÃ(&R)",IDC_KEY_RANDOM,226,75,48,14 + LTEXT "ÁÖÀÇ: ¼­¹ö¿¡ »õ ۸¦ Ãß°¡ÇÑ ÈÄ AFS °èÁ¤À» ¼öÁ¤ÇÏ¿© »õ ۸¦ »ç¿ëÇØ¾ß ÇÕ´Ï´Ù. ¸çÄ¥ÀÌ Áö³ª¸é ÀÌÀü ¼­¹ö ۸¦ Á¦°ÅÇÒ ¼ö ÀÖ½À´Ï´Ù.", + IDC_STATIC,7,99,267,18 + DEFPUSHBUTTON "È®ÀÎ",IDOK,116,129,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,170,129,50,14 + PUSHBUTTON "µµ¿ò¸»",9,224,129,50,14 + LTEXT "%1 ¼­¹ö¿¡ ´ëÇÑ »õ Ű",IDC_KEY_TITLE,43,14,181,8 + ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 +END + +IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 293, 149 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "¼­ºñ½º ½ÃÀÛ/Á¤Áö" +FONT 9, "±¼¸²" +BEGIN + DEFPUSHBUTTON "È®ÀÎ",IDOK,115,131,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,169,131,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,239,131,50,14 + ICON IDI_SERVICE,IDC_STATIC,4,7,20,21 + LTEXT "È®ÀÎÀ» ´­·¯ %1 ¼­¹öÀÇ %2 ¼­ºñ½º¸¦ ½ÃÀÛ/Á¤ÁöÇϽʽÿÀ", + IDC_STARTSTOP_TEXT,47,12,242,9 + CONTROL "¿µ±¸(&P)(IDS_START/STOPSERVICE_PERMANENT)", + IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON,37, + 81,226,10 + CONTROL "ÀÓ½Ã(&T)(IDS_START/STOPSERVICE_TEMPORARY)", + IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON,37, + 97,226,10 + GROUPBOX "¼­ºñ½º ½Ãµ¿",IDC_STATIC,33,32,256,78 + LTEXT "%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛÇÒ ¶§ ÀÚµ¿À¸·Î %2 ¼­ºñ½º¸¦ ½ÃÀÛÇϵµ·Ï(¶Ç´Â ÀÚµ¿À¸·Î ½ÃÀÛÇÏÁö ¾Êµµ·Ï) ÀÌ º¯°æ»çÇ×À» ¿µ±¸ÀûÀ¸·Î ¸¸µé ¼ö ÀÖ½À´Ï´Ù.", + IDC_STARTSTOP_STARTUP,38,45,245,28 +END + +IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 259, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "½ÇÇà ¸í·É" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¼­¹ö(&S):",IDC_STATIC,10,56,38,8 + COMBOBOX IDC_SERVER,50,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "¸í·É(&C):",IDC_STATIC,10,75,38,8 + EDITTEXT IDC_COMMAND,50,73,194,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È®ÀÎ",IDOK,86,107,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,140,107,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,204,107,50,14 + ICON IDI_SERVER,IDC_STATIC,4,4,20,20 + LTEXT "¼­¹ö¿¡¼­ ¸í·ÉÀ» ½ÇÇàÇÕ´Ï´Ù",IDC_STATIC,32,12,185,8 + LTEXT "ÀÌ Á¶ÀÛÀ» »ç¿ëÇÏ¿© ¿ø°Ý ¼­¹ö¿¡¼­ ¸í·ÉÀ» ½ÇÇàÇÒ ¼ö ÀÖ½À´Ï´Ù.\nÀÌ´Â ÁÖ·Î /etc/reboot ½ºÅ©¸³Æ®¸¦ ½ÇÇàÇÏ¿© ¼­¹ö¸¦ ´Ù½Ã ½ÃÀÛÇÒ ¶§ »ç¿ëµË´Ï´Ù.", + IDC_STATIC,4,29,250,16 +END + +IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 248, 254 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý º¹¿ø - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + LTEXT "¼­¹ö(&S):",IDC_STATIC,30,50,35,8 + COMBOBOX IDC_SERVER,67,48,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ÆÄƼ¼Ç(&P):",IDC_STATIC,30,67,35,8 + COMBOBOX IDC_AGGREGATE,67,65,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "¸ðµç ÆÄƼ¼Ç º¹¿ø(&A)",IDC_AGGREGATE_ALL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,163,67,81,10 + LTEXT "º¼·ý(&O):",IDC_STATIC,29,85,35,8 + COMBOBOX IDC_FILESET,67,83,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "¸ðµç º¼·ý º¹¿ø(&L)",IDC_FILESET_ALL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,163,85,79,10 + DEFPUSHBUTTON "È®ÀÎ",IDOK,85,108,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,139,108,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,194,108,50,14 + PUSHBUTTON "°í±Þ(&V) >>",IDC_ADVANCED,4,108,53,14 + LTEXT "Àӽà ÆÄÀÏ °æ·Î(&T):",IDC_STATIC,10,142,74,8 + EDITTEXT IDC_SALVAGE_TEMPDIR,89,140,137,13,ES_AUTOHSCROLL + CONTROL "º´·Ä º¹¿ø Á¶ÀÛ(&R), ÇÁ·Î¼¼½º ¼ö:",IDC_SALVAGE_SIMUL, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,157,119,10 + EDITTEXT IDC_SALVAGE_NUM,158,155,25,13,ES_AUTOHSCROLL + CONTROL "ÈÑ¼ÕµÈ º¼·ýÀ» º¹¿øÇÏÁö ¾Ê±â(&N)",IDC_SALVAGE_READONLY, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,167,123,10 + CONTROL "Àбâ Á¶ÀÛÀ» ÀÛÀº ºí·ÏÀ¸·Î ³ª´®(&B)",IDC_SALVAGE_BLOCK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,177,139,10 + CONTROL "Ç¥½ÃµÈ ¸ðµç º¼·ýÀ» °­Á¦·Î º¹¿ø(&F)",IDC_SALVAGE_FORCE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,187,136,10 + CONTROL "µð·ºÅ丮 ±¸Á¶¸¦ °­Á¦·Î À籸¼º(&E)",IDC_SALVAGE_FIXDIRS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,197,123,10 + LTEXT "°á°ú ·Î±×ÀÇ ÆÄÀÏ À̸§(&L):",IDC_STATIC,10,211,77,8 + EDITTEXT IDC_SALVAGE_LOG_FILE,92,210,137,13,ES_AUTOHSCROLL + CONTROL "°á°ú ·Î±×¿¡ ÈÑ¼ÕµÈ i-³ëµå ¸ñ·Ï Æ÷ÇÔ(&I)", + IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,30,224,203,10 + CONTROL "°á°ú ·Î±×¿¡ AFS¿¡ ¼ÓÇÑ ·çÆ® ¸ñ·Ï Æ÷ÇÔ(&W)", + IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,30,235,203,10 + ICON IDI_SERVER,IDC_STATIC,4,7,20,20 + LTEXT "ÀÌ Á¶ÀÛÀ¸·Î Çϳª ÀÌ»óÀÇ º¼·ý¿¡ ÀÖ´Â ¹®Á¦Á¡À» ¼öÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.\n\nÁÖ: Àüü ÆÄƼ¼Ç ¶Ç´Â ¼­¹ö¸¦ ÇÑ ¹ø¿¡ º¹¿øÇϸé, ¼­¹ö´Â ÀϽÃÀûÀ¸·Î ¿ÀÇÁ¶óÀÎÀÌ µË´Ï´Ù.", + IDC_STATIC,30,7,214,32 + GROUPBOX "°í±Þ º¹¿ø ¿É¼Ç",IDC_ADVANCED_GROUP,4,128,240,122 +END + +IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "º¼·ý º¹¿ø - °á°ú" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²" +BEGIN + DEFPUSHBUTTON "´Ý±â(&C)",IDOK,232,160,50,14 + LTEXT "º¹¿ø Á¶ÀÛÀÇ °á°ú:",IDC_STATIC,4,33,277,8 + EDITTEXT IDC_SALVAGE_DETAILS,4,43,277,113,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP + ICON IDI_SERVER,IDC_STATIC,4,7,21,20 + LTEXT "%1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ýÀ» º¹¿øÇÕ´Ï´Ù", + IDC_SALVAGE_TITLE,33,15,248,8 +END + +IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 277, 102 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "º¼·ý ÇØÁ¦" +FONT 9, "±¼¸²" +BEGIN + DEFPUSHBUTTON "È®ÀÎ",IDOK,115,84,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,169,84,50,14 + PUSHBUTTON "µµ¿ò¸»(&H)",9,223,84,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "ÀÌ Á¶ÀÛÀ¸·Î %3 º¼·ýÀÇ º¹Á¦º»À» °»½ÅÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿À·¡µÈ º¹Á¦º»À» °»½ÅÇϰųª ¸ðµç º¹Á¦º»À» °»½ÅÇÒ ¼ö ÀÖ½À´Ï´Ù.", + IDC_RELSET_DESC,31,7,242,26 + CONTROL "¿À·¡µÈ º¼·ýÀÇ º¹Á¦º»¸¸ °»½Å(&U)",IDC_RELSET_NORMAL, + "Button",BS_AUTORADIOBUTTON,46,41,173,10 + CONTROL "¿À·¡µÇÁö ¾Ê¾Ò¾îµµ ¸ðµç º¼·ýÀÇ º¹Á¦º» °»½Å(&A)", + IDC_RELSET_FORCE,"Button",BS_AUTORADIOBUTTON,46,56,172, + 10 +END + +IDD_SVR_HOSTS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + PUSHBUTTON "È£½ºÆ® ¼­¹ö Ãß°¡(&A)",IDC_HOST_ADD,68,160,69,14 + PUSHBUTTON "È£½ºÆ® ¼­¹ö Á¦°Å(&R)",IDC_HOST_REMOVE,141,160,80,14 + LTEXT "¼­¹ö¿¡¼­ ÀνĵǴ µ¥ÀÌÅͺ£À̽º È£½ºÆ® ¼­¹ö:", + IDC_HOST_TITLE,5,7,216,8 + CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, + 135,WS_EX_CLIENTEDGE +END + +IDD_SVR_ADDHOST DIALOGEX 0, 0, 225, 106 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "È£½ºÆ® ¼­¹ö Ãß°¡" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + LTEXT "È£½ºÆ®(&H):",-1,31,55,26,8 + EDITTEXT IDC_ADDHOST_HOST,61,53,103,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È®ÀÎ",IDOK,63,88,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,117,88,50,14 + ICON IDI_SERVER,-1,4,4,21,20 + LTEXT "%1 ¼­¹ö¿¡ ÀúÀåµÈ ¸ñ·Ï¿¡ µ¥ÀÌÅͺ£À̽º È£½ºÆ® ¼­¹ö¸¦ Ãß°¡Çϱâ·Î Çß½À´Ï´Ù.\n\n¾Æ·¡¿¡ »õ µ¥ÀÌÅͺ£À̽º È£½ºÆ® À̸§À» ÀÔ·ÂÇϽʽÿÀ.", + IDC_ADDHOST_DESC,31,10,190,34 + PUSHBUTTON "µµ¿ò¸»",9,171,88,50,14 +END + +IDD_SVR_ADDRESS DIALOGEX 0, 0, 208, 115 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "¼­¹ö ÁÖ¼Ò º¯°æ" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + LTEXT "VLDB¿¡ ±â·ÏµÈ %1 ¼­¹ö¿ë IP ÁÖ¼Ò:",IDC_TITLE,4,4,200,8 + LISTBOX IDC_SVR_ADDRESSES,4,14,147,40,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "º¯°æ(&C)...",IDC_ADDR_CHANGE,154,24,50,14 + PUSHBUTTON "Á¦°Å(&R)",IDC_ADDR_REMOVE,154,40,50,14 + DEFPUSHBUTTON "È®ÀÎ",IDOK,46,97,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,100,97,50,14 + PUSHBUTTON "µµ¿ò¸»",9,154,97,50,14 + LTEXT "ÁÖ: ÆÄÀÏ ¼­¹ö°¡ ½ÃÀÛµÉ ¶§ VLDB¸¦ ÀÌ¿ëÇÏ¿© ÇöÀç IP ÁÖ¼Ò°¡ ÀÚµ¿À¸·Î µî·ÏµË´Ï´Ù.", + IDC_STATIC,4,64,200,18 +END + +IDD_SVR_NEWADDR DIALOGEX 0, 0, 223, 69 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "IP ÁÖ¼Ò º¯°æ" +CLASS "AFSManagerClass" +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "È®ÀÎ",IDOK,61,51,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,115,51,50,14 + PUSHBUTTON "µµ¿ò¸»",9,169,51,50,14 + LTEXT "VLDB¿¡¼­ %1À»(¸¦) ¹Ù²Ü »õ IP ÁÖ¼Ò¸¦ ÀÔ·ÂÇϽʽÿÀ.", + IDC_TITLE,4,4,215,8 + CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,42,23, + 90,14 + LTEXT "ÁÖ¼Ò:",IDC_STATIC,4,26,28,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" +32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" +32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" +IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" +IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" +IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" +IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" +IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" +IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" +IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" +IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" +IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" +IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" +IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" +IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" +IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" +IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" +IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +ACCEL_MAIN ACCELERATORS DISCARDABLE +BEGIN + VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT + VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT + VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT + VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT + VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT + VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT + VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT + VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, + NOINVERT + VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// AVI +// + +AVI_SETMOVE AVI DISCARDABLE "Resource\\setmove.avi" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_LISTS_TITLE "%1 ¼­¹ö - °ü¸® ¸ñ·Ï" + IDS_TAB_SERVICES "¼­ºñ½º" + IDS_TAB_AGGREGATES "ÆÄƼ¼Ç" + IDS_TAB_FILESETS "º¼·ý" + IDS_SERVICE_NONESELECTED "º¼ ¼­¹ö¸¦ ¼±ÅÃÇϽʽÿÀ." + IDS_SERVICE_GOTSELECTED "¼­ºñ½º´Â %1 ¼­¹ö¿¡¼­ ÀÛ¾÷ÇÕ´Ï´Ù." + IDS_AGGREGATE_ALL "¸ðµç ¼­¹öÀÇ ÆÄƼ¼Ç:" + IDS_AGGREGATE_ONE "%1 ¼­¹öÀÇ ÆÄƼ¼Ç:" + IDS_FILESET_ALL "%1 ¼¿¿¡ ÀÖ´Â ¸ðµç º¼·ý:" + IDS_FILESET_ONE "%1 ¼­¹ö¿¡ ÀÖ´Â º¼·ý:" + IDS_SVR_LISTS_TAB "°ü¸® ¸ñ·Ï" + IDS_SVR_PROP_TITLE "%1 ¼­¹ö - Ư¼º" + IDS_SVR_GENERAL_TAB "ÀϹÝ" + IDS_SVR_SCOUT_TAB "¼³Á¤" + IDS_SERVER_TITLE "%1 ¼­¹ö - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_DESC "%2 ¼¿¿¡ ÀÖ´Â %1 ¼­¹ö:" + IDS_SVC_PROP_TITLE "%1 ¼­¹ö¿¡ ÀÖ´Â %2 ¼­ºñ½º - Ư¼º" + IDS_SVC_GENERAL_TAB "ÀϹÝ" + IDS_SVC_ADD_TITLE "¼­ºñ½º ÀÛ¼º" + IDS_SVC_ADD_TAB "¼­ºñ½º ÀÛ¼º" + IDS_AGG_PROP_TITLE "%1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç - Ư¼º" + IDS_AGG_GENERAL_TAB "ÀϹÝ" + IDS_SET_REP_TITLE "%1 º¼·ý - º¹Á¦" + IDS_SET_REPSITES_TAB "º¹Á¦ »çÀÌÆ®" + IDS_SET_PROP_TITLE "%1 º¼·ý - Ư¼º" + IDS_SET_GENERAL_TAB "ÀϹÝ" + IDS_SET_UNLOCKBTN "Áö±Ý Àá±ÝÇØÁ¦(&L)" + IDS_SET_LOCKBTN "Áö±Ý Àá±Ý(&L)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_USAGE_FILESET "%2 ÇÒ´ç·® Áß %1 »ç¿ë(%3%%)" + IDS_USAGE_AGGREGATE "%2 ¿ë·® Áß %1 »ç¿ë(%3%%)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGCOL_ALLOCATED "°áÇÕÇÑ ÇÒ´ç·®" + IDS_SVRCOL_NAME "¼­¹ö" + IDS_SVRCOL_STATUS "»óÅÂ" + IDS_SETCOL_DATE_ACCESS "ÃÖÁ¾ ¾×¼¼½º" + IDS_SETCOL_DATE_BACKUP "ÃÖÁ¾ ¹é¾÷" + IDS_SVCCOL_NAME "¼­ºñ½º" + IDS_SVCCOL_TYPE "À¯Çü" + IDS_SVCCOL_PARAMS "¸Å°³º¯¼ö" + IDS_SVCCOL_STATUS "»óÅÂ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_DATE_START "ÃÖÁ¾ ½ÃÀÛ" + IDS_SVCCOL_DATE_STOP "ÃÖÁ¾ Á¤Áö" + IDS_SVCCOL_DATE_STARTSTOP "ÃÖÁ¾ ½ÃÀÛ/Á¤Áö" + IDS_SVCCOL_DATE_FAILED "ÃÖÁ¾ ½ÇÆÐ" + IDS_SVCCOL_LASTERROR "ÃÖÁ¾ Á¾·á ÄÚµå" + IDS_AGGCOL_NAME "ÆÄƼ¼Ç" + IDS_AGGCOL_ID "ID" + IDS_AGGCOL_DEVICE "ÀåÄ¡" + IDS_AGGCOL_USED "»ç¿ë" + IDS_AGGCOL_USED_PER "% »ç¿ë" + IDS_AGGCOL_FREE "»ç¿ë°¡´É(ÇÑ)" + IDS_AGGCOL_TOTAL "¿ë·®" + IDS_AGGCOL_STATUS "»óÅÂ" + IDS_SETCOL_NAME "º¼·ý" + IDS_SETCOL_TYPE "À¯Çü" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETCOL_DATE_CREATE "ÀÛ¼º" + IDS_SETCOL_DATE_UPDATE "ÃÖÁ¾ °»½Å" + IDS_SETCOL_STATUS "»óÅÂ" + IDS_SETCOL_QUOTA_USED "»ç¿ë" + IDS_SETCOL_QUOTA_USED_PER "% »ç¿ë" + IDS_SETCOL_QUOTA_FREE "»ç¿ë°¡´É(ÇÑ)" + IDS_SETCOL_QUOTA_TOTAL "ÇÒ´ç·®" + IDS_TRYAGAINBTN "Àç½Ãµµ(&A)" + IDS_NO_CELL_SELECTED "(ÁöÁ¤µÈ ¼¿ÀÌ ¾øÀ½)" + IDS_NO_AFS_ID "(»ç¿ë°¡´ÉÇÑ ÅäÅ«ÀÌ ¾øÀ½)" + IDS_AFS_ID_WILLEXP "%1(%2¿¡ ¸¸±âµÇ´Â ÅäÅ«)" + IDS_ELAPSED_TIME "%1" + IDS_SEARCHING_FOR_SERVERS + "±â´Ù¸®½Ê½Ã¿À. %1 ¼¿¿¡ ´ëÇÑ Á¤º¸¸¦ È®º¸ÇÏ´Â ÁßÀÔ´Ï´Ù..." + IDS_STATUS_NOALERTS "Ç¥ÁØ" + IDS_TITLE_BROWSE_USER "»ç¿ëÀÚ ¼±ÅÃ" + IDS_AGGTYPE_OTHER "¾Ë ¼ö ¾øÀ½(%1)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATEFILESET "%1 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý ÀÛ¼º Áß:%2" + IDS_ACTION_DELETEFILESET "%1 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý »èÁ¦ Áß:%2" + IDS_ACTION_MOVEFILESET "%1 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý À̵¿ Áß:%2" + IDS_ACTION_SETFILESETQUOTA "%3 º¼·ý¿¡ ´ëÇÑ ÇÒ´ç·® º¯°æ Áß" + IDS_SVCSTOP_DESC2 "È®ÀÎÀ» ´­·¯ ÀÌ ¼­ºñ½º¸¦ Á¤ÁöÇϽʽÿÀ." + IDS_SVCSTART_DESC2 "È®ÀÎÀ» ´­·¯ ÀÌ ¼­ºñ½º¸¦ ½ÃÀÛÇϽʽÿÀ." + IDS_SYNCVLDB_SVR_DESC "ÁÖÀÇ!\n\n°è¼Ó ÁøÇàÇϸé, AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº VLDB¸¦ ¼öÁ¤ÇÏ¿© %1 ¼­¹öÀÇ ¸ðµç ÆÄƼ¼Ç ³»¿ë°ú ÀÏÄ¡Çϵµ·Ï ¸¸µì´Ï´Ù." + IDS_SYNCVLDB_SVR_DESC2 "VLDB¿¡¼­ %1 ¼­¹öÀÇ ÆÄƼ¼Ç¿¡¼­ ÇöÀç ãÀ» ¼ö ¾ø´Â º¼·ýÀ» ¾ð±ÞÇϸé, ±× º¼·ý¿¡ ´ëÇÑ VLDB°¡ »èÁ¦µË´Ï´Ù." + IDS_SYNCVLDB_AGG_DESC "ÁÖÀÇ!\n\n°è¼Ó ÁøÇàÇϸé, AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº VLDB¸¦ ¼öÁ¤ÇÏ¿© %1 ¼­¹öÀÇ %2 ÆÄƼ¼ÇÀÇ ³»¿ë°ú ÀÏÄ¡Çϵµ·Ï ¸¸µì´Ï´Ù." + IDS_SYNCVLDB_AGG_DESC2 "VLDB¿¡¼­ ÀÌ ÆÄƼ¼Ç¿¡¼­ ÇöÀç ãÀ» ¼ö ¾ø´Â º¼·ýÀ» ¾ð±ÞÇϸé, ±× º¼·ý¿¡ ´ëÇÑ VLDB ÀÔ·Â Ç׸ñÀÌ »èÁ¦µË´Ï´Ù." + IDS_PROMPT_BROWSE_USER "»ç¿ëÀÚ:" + IDS_PREVIEWIN_BUTTON "<< ¹Ì¸®º¸±â(&P)" + IDS_PREVIEWOUT_BUTTON "¹Ì¸®º¸±â(&P) >>" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ADMCOL_TYPE_USER "»ç¿ëÀÚ" + IDS_TITLE_BROWSE_PRINCIPAL "°èÁ¤ ¼±ÅÃ" + IDS_TITLE_BROWSE_OWNGROUP "¼ÒÀ¯ÇÏ´Â ±×·ì ¼±ÅÃ" + IDS_PROMPT_BROWSE_PRINCIPAL "°èÁ¤:" + IDS_PROMPT_BROWSE_OWNGROUP "¼ÒÀ¯ÇÏ´Â ±×·ì:" + IDS_ACTION_CLONE "%3 º¼·ýÀÇ ¹é¾÷ ¹öÀü ÀÛ¼º Áß" + IDS_ACTION_CLONESYS "¿©·¯ º¼·ý ¹é¾÷ ÀÛ¼º Áß" + IDS_CLONESYS_FAILED "0x%2(%3) ¿À·ù·Î ÀÎÇØ %1 º¼·ýÀÇ ¹é¾÷À» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_SET_UNSPECIFIED "(¹ÌÁöÁ¤)" + IDS_SETCOL_ID "ID" + IDS_SETCOL_FILES "ÆÄÀÏ °è¼ö" + IDS_SET_DUMP_NAME "%1" + IDS_ACTION_DUMP "%3 º¼·ý ´ýÇÁ Áß(%1 ÆÄƼ¼Ç:%2)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FILESETNAME_ERROR "%1 - %2" + IDS_SETCOL_AGGREGATE "ÆÄƼ¼Ç" + IDS_REFRESH_DESC_CELL "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼¿¿¡¼­ÀÇ ¼­¹ö »óŸ¦ ÆÇº° ÁßÀÔ´Ï´Ù. ÀÌ´Â ½Ã°£ÀÌ ¾à°£ °É¸± ¼ö ÀÖ½À´Ï´Ù..." + IDS_REFRESH_DESC_SERVER "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼­¹öÀÇ »óŸ¦ ÆÇº° ÁßÀÔ´Ï´Ù. ÀÌ´Â ½Ã°£ÀÌ ¾à°£ °É¸± ¼ö ÀÖ½À´Ï´Ù..." + IDS_REFRESH_CURRENT_CELL "ÇöÀç %1 ¼¿ Á¶»ç Áß" + IDS_REFRESH_CURRENT_SERVER "ÇöÀç %2 ¼­¹ö Á¶»ç Áß" + IDS_REFRESH_CURRENT_AGGREGATE "ÇöÀç %2 ¼­¹öÀÇ %3 ÆÄƼ¼Ç Á¶»ç Áß" + IDS_REFRESH_CURRENT_FILESET "ÇöÀç %2 ¼­¹ö, %3 ÆÄƼ¼ÇÀÇ %4 º¼·ý Á¶»ç Áß" + IDS_REFRESH_CURRENT_SERVICE "ÇöÀç ¼­¹ö %2ÀÇ %3 ¼­ºñ½º Á¶»ç Áß" + IDS_REFRESH_PERCENT "%1%% ¿Ï·á" + IDS_PROBLEMS "¹®Á¦Á¡" + IDS_SERVER_NO_PROBLEMS "ÀÌ ¼­¹ö¿¡´Â ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ¾ø½À´Ï´Ù." + IDS_SERVICE_NO_PROBLEMS "ÀÌ ¼­ºñ½º¿¡´Â ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ¾ø½À´Ï´Ù." + IDS_AGGREGATE_NO_PROBLEMS "ÀÌ ÆÄƼ¼Ç¿¡´Â ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ¾ø½À´Ï´Ù." + IDS_FILESET_NO_PROBLEMS "ÀÌ º¼·ý¿¡´Â ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ¾ø½À´Ï´Ù." + IDS_AGGTYPE_TYPE1 "UFS" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGTYPE_TYPE2 "LFS" + IDS_AGGTYPE_TYPE3 "AIX" + IDS_AGGTYPE_TYPE4 "VXFS" + IDS_AGGTYPE_TYPE5 "DMEPI" + IDS_REFRESH_CURRENT_VLDB "ÇöÀç º¼·ý À§Ä¡ µ¥ÀÌÅͺ£À̽º(VLDB) Á¶»ç Áß" + IDS_FILESETTYPE_RW "Àбâ/¾²±â" + IDS_FILESETTYPE_RO "º¹Á¦º»" + IDS_FILESETTYPE_CLONE "¹é¾÷" + IDS_MOVESET_READWRITE "°è¼Ó ÁøÇàÇϸé %3 º¼·ýÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ ´Ù¸¥ À§Ä¡·Î À̵¿µË´Ï´Ù." + IDS_MOVESET_READONLY "°è¼Ó ÁøÇàÇϸé %3 º¹Á¦º»ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ ¾Æ·¡¿¡ ÁöÁ¤ÇÑ ÆÄƼ¼Ç¿¡ ÀÛ¼ºµÈ ¶Ç´Ù¸¥ º¼·ý º¹Á¦º»À¸·Î À̵¿µË´Ï´Ù." + IDS_SVC_START_TITLE "¼­ºñ½º ½ÃÀÛ" + IDS_SVC_STOP_TITLE "¼­ºñ½º Á¤Áö" + IDS_SERVICESTATUS_STARTING "ÀÌ ¼­ºñ½º´Â ÇöÀç ½ÃÀÛ ÁßÀÔ´Ï´Ù." + IDS_SERVICESTATUS_RUNNING "ÀÌ ¼­ºñ½º´Â ÇöÀç ½ÇÇà ÁßÀÔ´Ï´Ù." + IDS_SERVICESTATUS_STOPPED "ÀÌ ¼­ºñ½º´Â ÇöÀç Á¤Áö ÁßÀÔ´Ï´Ù." + IDS_SERVICESTATUS_STOPPING "ÀÌ ¼­ºñ½º´Â ÇöÀç Á¤Áö ÁßÀÔ´Ï´Ù." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICESTATUS_UNKNOWN "ÀÌ ¼­ºñ½ºÀÇ »óŸ¦ ¾Ë ¼ö ¾ø½À´Ï´Ù." + IDS_SVC_RESTART_BUTTON "Á¤ÁöÇϰí Áö±Ý Àç½ÃÀÛ(&R)" + IDS_PROBLEM_BOX "¾Ë·ÁÁø ¹®Á¦Á¡(%1)" + IDS_VIEWLOG_DESC_NOFILE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¿¡ ´ëÇÑ ·Î±× ÆÄÀÏÀ» ãÁö ¸øÇß½À´Ï´Ù. ¾Æ·¡ÀÇ ¼­ºñ½º ·Î±× ÆÄÀÏ¿¡ ´ëÇÑ Àüü °æ·Î¸¦ ÀÔ·ÂÇϽʽÿÀ." + IDS_NO_GROUP "(¼ÒÀ¯ÇÏ´Â ±×·ì ¾øÀ½)" + IDS_VIEWLOG_FROMSERVER "%1 ¼­¹öÀÇ ·Î±× ÆÄÀÏ" + IDS_VIEWLOG_FROMSERVICE "%1 ¼­¹öÀÇ %2 ¼­ºñ½º¿¡ ´ëÇÑ ·Î±× ÆÄÀÏ" + IDS_VIEWLOG_TRUNCATED "ÆÄÀÏ ³»¿ë(ÃÖÁ¾ %1 Çุ Ç¥½Ã):" + IDS_SAVELOG_FILTER "ÅØ½ºÆ® ÆÄÀÏ|*.TXT|" + IDS_ADVANCEDIN_BUTTON "<< °í±Þ(&A)" + IDS_ADVANCEDOUT_BUTTON "°í±Þ(&A) >>" + IDS_REPTYPE_RELEASE "º¹Á¦º» ÇØÁ¦" + IDS_REPTYPE_SCHEDULED "½ºÄÉÁìµÈ º¹Á¦" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_UPDATEALL_BUTTON "¸ðµÎ °»½Å(&U)" + IDS_UPDATETHIS_BUTTON "°»½Å(&U)" + IDS_SERVER_MULTIPLE_PROBLEMS + "ÀÌ ¼­¹ö¿¡´Â %1°³ÀÇ ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ÀÖ½À´Ï´Ù." + IDS_SERVICE_MULTIPLE_PROBLEMS + "ÀÌ ¼­ºñ½º¿¡´Â %1°³ÀÇ ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ÀÖ½À´Ï´Ù." + IDS_AGGREGATE_MULTIPLE_PROBLEMS + "ÀÌ ÆÄƼ¼Ç¿¡´Â %1°³ÀÇ ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ÀÖ½À´Ï´Ù." + IDS_FILESET_MULTIPLE_PROBLEMS + "ÀÌ º¼·ý¿¡´Â %1°³ÀÇ ¾Ë·ÁÁø ¹®Á¦Á¡ÀÌ ÀÖ½À´Ï´Ù." + IDS_FILESETTYPE_RO_STAGE "º¹Á¦º»" + IDS_SERVICETYPE_SIMPLE_LONG "°£´Ü(¿¬¼Ó ½ÇÇà)" + IDS_SERVICETYPE_CRON_LONG "Å©·Ð(ƯÁ¤ °£°Ý ½ÇÇà)" + IDS_QUOTAUNITS_KB "KB" + IDS_QUOTAUNITS_MB "MB" + IDS_NO_QUOTA_REPLICA "(ÀÌ º¼·ýÀº º¹Á¦º»À̹ǷΠÇÒ´ç·®ÀÌ ¾ø½À´Ï´Ù)" + IDS_NO_QUOTA_CLONE "(ÀÌ º¼·ýÀº ¹é¾÷À̹ǷΠÇÒ´ç·®ÀÌ ¾ø½À´Ï´Ù)" + IDS_USAGE_REPLICA "%1 »ç¿ë" + IDS_USAGE_CLONE "%1 »ç¿ë" + IDS_COL_AGGS_MOVE "º¼·ý ÀÛ¼º½Ã ÆÄƼ¼Ç" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PERCENTAGE "%1 %%" + IDS_AGGREGATES_IN_SERVER "%1 ¼­¹öÀÇ ÆÄƼ¼Ç:" + IDS_AGGREGATES_IN_CELL "%1 ¼¿¿¡¼­ÀÇ ¸ðµç ÆÄƼ¼Ç:" + IDS_AGGREGATES_IN_NOTHING "ÆÄƼ¼Ç:" + IDS_FILESETS_IN_SERVER "%1 ¼­¹ö¿¡ ÀÖ´Â º¼·ý:" + IDS_FILESETS_IN_CELL "%1 ¼¿¿¡ ÀÖ´Â ¸ðµç º¼·ý:" + IDS_FILESETS_IN_NOTHING "º¼·ý:" + IDS_SERVICES_IN_SERVER "%1 ¼­¹ö¿¡ ÀÖ´Â ¼­ºñ½º:" + IDS_SERVICES_IN_NOTHING "¼­ºñ½º:" + IDS_UNKNOWN "(¾Ë ¼ö ¾øÀ½)" + IDS_UNKNOWN_GROUP "#%1 ±×·ì(À̸§À» ¾Ë ¼ö ¾øÀ½)" + IDS_AGGFULL_WARN_OFF "±âº» ÀÓ°è°ª(¼­¹ö¿¡¼­ °æ°í »ç¿ë ºÒ°¡´É)" + IDS_SERVER_AGGREGATE "%1:%2" + IDS_SERVERNAME_ERROR "%1 - %2" + IDS_AGGREGATENAME_ERROR "%1 - %2" + IDS_SETFULL_WARN_OFF "±âº» ÀÓ°è°ª(¼­¹ö¿¡¼­ °æ°í »ç¿ë ºÒ°¡´É)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_LASTERRORDATE "%1 - %2 Á¾·á ÄÚµå" + IDS_COL_SERVERS "¼¿ÀÇ ¼­¹ö" + IDS_COL_FILESETS "¼­¹öÀÇ º¼·ý" + IDS_COL_AGGREGATES "¼­¹öÀÇ ÆÄƼ¼Ç" + IDS_COL_SERVICES "¼­¹öÀÇ ¼­ºñ½º" + IDS_COL_REPLICAS "º¼·ýÀÇ º¹Á¦º»" + IDS_COLUMNS_TITLE "Ä÷³ Ç¥½Ã ¼±Åà - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" + IDS_REPCOL_SERVER "¼­¹ö" + IDS_REPCOL_AGGREGATE "ÆÄƼ¼Ç" + IDS_REPCOL_DATE_UPDATE "ÃÖÁ¾ °»½Å" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COL_AGGS_CREATE "º¼·ý À̵¿½Ã ÆÄƼ¼Ç" + IDS_WARN_TITLE "ÁÖÀÇ" + IDS_WARN_DISABLE_AUTH """ºñÀÎÁõ Çã¿ë"" ´ÜÃ߸¦ ´­·¯ ÀÎÁõµÇÁö ¾ÊÀº °èÁ¤¿¡¼­ ÀÌ ¼­¹öÀÇ ¼­ºñ½º¸¦ ó¸®ÇÏ°Ô ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¸¹Àº ¼­ºñ½º°¡ ·çÆ® ½Äº°ÇÏ¿¡¼­ ½ÇÇàµÇ¹Ç·Î ÀÌ Á¶Ä¡´Â +" + IDS_WARN_DISABLE_AUTH2 "¼­¹ö º¸¾È¸é¿¡¼­ °áÁ¤ÀûÀÎ ÇêÁ¡À» µå·¯³À´Ï´Ù.\n\nº¯°æÇϽðڽÀ´Ï±î?" + IDS_SVR_NO_ADDR "(¹ÌÁöÁ¤)" + IDS_TITLE_BAD_CELL "ÀνĵÇÁö ¾ÊÀº ¼¿ À̸§" + IDS_DESC_BAD_CELL "ÀÔ·ÂÇÑ ¼¿ À̸§À» ³×Æ®¿öÅ©¿¡¼­ ãÀ» ¼ö ¾ø½À´Ï´Ù.\n\nÀÔ·Â Ç׸ñÀÌ ¸Â´ÂÁö ´Ù½Ã È®ÀÎÇϽʽÿÀ." + IDS_AGGFULL_WARN_ON "ÀÌ ¼­¹öÀÇ ±âº» ÀÓ°è°ª(&D)(±× Å©±âÀÇ %1%%)" + IDS_SETFULL_WARN_ON "ÀÌ ¼­¹öÀÇ ±âº» ÀÓ°è°ª(&D)(±× Å©±âÀÇ %1%%)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_ERROR_BAD_CREDENTIALS + "ÀÔ·ÂÇÑ AFS ½Äº°À» ÀνÄÇÒ ¼ö ¾ø°Å³ª ÁöÁ¤ÇÑ ¾ÏÈ£°¡ Ʋ·È½À´Ï´Ù." + IDS_SVR_CREDS_NONE "(ÅäÅ« ¾øÀ½)" + IDS_SVR_CREDS_VALID "%2, %3 ¸¸±â" + IDS_SVR_CREDS_EXPIRED "(ÅäÅ« %3 ¸¸±â)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGG_FILESETS "%1(°áÇÕµÈ ÇÒ´ç·®: %2)" + IDS_ACTION_DESC_NONE "ÁøÇà ÁßÀÎ Á¶ÀÛÀÌ ¾ø½À´Ï´Ù." + IDS_ACTION_DESC_ONE "´ÙÀ½ Á¶ÀÛÀÌ ÇöÀç ÁøÇà ÁßÀÔ´Ï´Ù." + IDS_ACTION_DESC_MULT "´ÙÀ½ Á¶ÀÛÀÌ ÇöÀç ÁøÇà ÁßÀÔ´Ï´Ù." + IDS_ACTCOL_OPERATION "Á¶ÀÛ" + IDS_ACTCOL_ELAPSED "°æ°úµÈ ½Ã°£" + IDS_ACTION_REFRESH "¼¿ Á¤º¸ »õ·Î °íÄ¡´Â Áß" + IDS_ACTION_CREATESERVER "%1 ¼­¹ö ÀÛ¼º Áß" + IDS_ACTION_DELETESERVER "%1 ¼­¹ö »èÁ¦ Áß" + IDS_ACTION_GETSERVERLOGFILE "%1 ¼­¹ö¿¡¼­ %2 ·Î±× ÆÄÀÏ È®º¸ Áß" + IDS_ACTION_SETSERVERAUTH "%1 ¼­¹ö¿¡ ´ëÇÑ ¾×¼¼½º Á¦ÇÑ º¯°æ Áß" + IDS_ACTION_CHANGESERVERSTATUS "%1 ¼­¹öÀÇ Æ¯¼º º¯°æ Áß" + IDS_ACTION_STARTSERVICE "%1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º ½ÃÀÛ Áß" + IDS_ACTION_STOPSERVICE "%1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º Á¤Áö Áß" + IDS_ACTION_RESTARTSERVICE "%1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º ´Ù½Ã ½ÃÀÛ Áß" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SYNCVLDB_SVR "VLDB ¹× %1 ¼­¹öÀÇ µ¿±âÈ­" + IDS_ACTION_SYNCVLDB_AGG "VLDB ¹× %1 ÆÄƼ¼ÇÀÇ µ¿±âÈ­:%2" + IDS_ACTION_SCOUT "¹®Á¦°¡ ÀÖ´ÂÁö %1 ¼­¹ö È®ÀÎ Áß" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SETREPPARAMS "%3 º¼·ý¿¡ ´ëÇÑ º¹Á¦ Ư¼º º¯°æ Áß" + IDS_ACTION_CREATEREPLICA "%1 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ýÀÇ º¹Á¦º» ÀÛ¼º Áß:%2" + IDS_DELSET_REPLICA_DESC "ÁÖÀÇ!\n\n°è¼Ó ÁøÇàÇϸé, %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ýÀÇ º¹Á¦º»ÀÌ Á¦°ÅµË´Ï´Ù." + IDS_DELSET_CLONE_DESC "ÁÖÀÇ!\n\n°è¼Ó ÁøÇàÇϸé, %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý ¹é¾÷ÀÌ Á¦°ÅµË´Ï´Ù." + IDS_INSTALL_DESC1 "ÀÌ Á¶ÀÛÀº ÀÌ ÄÄÇ»ÅÍÀÇ ÆÄÀÏÀ» ¶Ç ´Ù¸¥ ÄÄÇ»ÅÍ·Î º¹»çÇÕ´Ï´Ù. +" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_INSTALL_DESC2 "ÆÄÀÏÀÌ ¸ñÇ¥ ÄÄÇ»ÅÍ¿¡ ÀÌ¹Ì Á¸ÀçÇϸé, ¹é¾÷µÇ°í .BAK È®ÀåÀÚ°¡ ºÎ¿©µË´Ï´Ù. ±âÁ¸ÀÇ ¸ðµç ¹é¾÷¿¡´Â .OLD È®ÀåÀÚ°¡ ºÎ¿©µÇ°í ±âÁ¸ÀÇ .OLD ÆÄÀÏÀº »èÁ¦µË´Ï´Ù." + IDS_ACTION_INSTALLFILE "%1 ¼­¹ö¿¡ %2 ÆÄÀÏ ¼³Ä¡ Áß" + IDS_ACTION_UNINSTALLFILE "%1 ¼­¹ö¿¡¼­ %2 ÆÄÀÏ ¼³Ä¡ÇØÁ¦ Áß" + IDS_ACTION_PRUNEFILES "%1 ¼­¹ö¿¡¼­ ÆÄÀÏ Á¤¸® Áß" + IDS_FILTER_ALLFILES "¸ðµç ÆÄÀÏ|*.*|" + IDS_ACTION_RENAMEFILESET "º¼·ý À̸§À» %1¿¡¼­ %2(À¸)·Î º¯°æ Áß" + IDS_RECUR_DAILY "¸ÅÀÏ" + IDS_RECUR_SUNDAY "ÀÏ¿äÀϸ¶´Ù" + IDS_RECUR_MONDAY "¿ù¿äÀϸ¶´Ù" + IDS_RECUR_TUESDAY "È­¿äÀϸ¶´Ù" + IDS_RECUR_WEDNESDAY "¼ö¿äÀϸ¶´Ù" + IDS_RECUR_THURSDAY "¸ñ¿äÀϸ¶´Ù" + IDS_RECUR_FRIDAY "±Ý¿äÀϸ¶´Ù" + IDS_RECUR_SATURDAY "Åä¿äÀϸ¶´Ù" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATESERVICE "%1 ¼­¹ö¿¡ %2 ¼­ºñ½º ÀÛ¼º Áß" + IDS_ACTION_DELETESERVICE "%1 ¼­¹ö·ÎºÎÅÍ %2 ¼­ºñ½º »èÁ¦ Áß" + IDS_ACTION_RELEASEFILESET "%3 º¼·ý ÇØÁ¦ Áß" + IDS_ACTION_GETDATES "%1 ¼­¹ö¿¡¼­ %2 ÆÄÀÏ¿¡ ´ëÇÑ ³¯Â¥ È®º¸ Áß" + IDS_LASTMODIFIED "%1 ÃÖÁ¾ ¼öÁ¤" + IDS_SVR_SECURITY_TITLE "¼­¹ö º¸¾È - %1" + IDS_SVR_LIST_TAB "°ü¸®ÀÚ" + IDS_ACTION_ADMINLIST_LOAD "%1 ¼­¹ö¿¡ ´ëÇÑ °ü¸®ÀÚ È®º¸ Áß" + IDS_ACTION_ADMINLIST_SAVE "%1 ¼­¹ö¿¡ ´ëÇÑ °ü¸®ÀÚ ±â·Ï Áß" + IDS_ADMCOL_PRINCIPAL "±¸¼º¿ø" + IDS_ADMCOL_TYPE "À¯Çü" + IDS_ADMCOL_TYPE_GROUP "±×·ì" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_RESTORE "%1 º¼·ý º¹¿ø Áß" + IDS_COL_AGGS_RESTORE "º¼·ý º¹¿ø½Ã ÆÄƼ¼Ç" + IDS_RESTORE_FILTER "º¼·ý ´ýÇÁ ÆÄÀÏ|*.DMP|¸ðµç ÆÄÀÏ|*.*|" + IDS_SVC_BOS_TAB "BOS" + IDS_ACTION_SETRESTART "%1 ¼­¹ö¿¡ ´ëÇÑ ¼­ºñ½º Àç½ÃÀÛ ½Ã°£ º¯°æ Áß" + IDS_RESTORE_CREATESET "%1 º¼·ýÀº ¾Æ·¡¿¡ ÁöÁ¤ÇÑ ¼­¹ö ¹× ÆÄƼ¼Ç¿¡ ÀÛ¼ºµË´Ï´Ù." + IDS_RESTORE_OVERWRITESET + "ÁÖÀÇ! %3 º¼·ýÀº %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ ÀÖÀ¸¸ç, °è¼Ó ÁøÇàÇϸé, °ãÃľ²¿©Áý´Ï´Ù." + IDS_SUBSET_TITLE_LOAD "¼­¹ö ¼­ºê¼¼Æ® ¿­±â" + IDS_SUBSET_TITLE_SAVE "¼­¹ö ¼­ºê¼¼Æ® ÀúÀå" + IDS_BUTTON_OPEN "¿­±â(&O)" + IDS_BUTTON_SAVE "ÀúÀå(&S)" + IDS_SUBSET_SAVE_TITLE "ÁÖÀÇ" + IDS_SUBSET_SAVE_DESC "¼­¹ö ¼­ºê¼¼Æ®´Â ÀÌ¹Ì %1(ÀÌ)¶ó´Â À̸§À¸·Î Á¸ÀçÇÕ´Ï´Ù.\n\nÀÌ ¼­ºê¼¼Æ®¿¡ °ãÃľ²½Ã°Ú½À´Ï±î?" + IDS_SUBSET_CHANGED "%1 [¼öÁ¤µÊ]" + IDS_SUBSET_TAB "¸ð´ÏÅ͵Ǵ ¼­¹ö" + IDS_SUBSET_DISCARD_TITLE "¼­ºê¼¼Æ® ÀúÀå?" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SUBSET_DISCARD_DESC "ÇöÀç ¸ð´ÏÅ͵Ǵ ¼­¹ö ¸ñ·ÏÀ» ¼­ºê¼¼Æ®·Î ÀúÀåÇÏÁö ¾Ê¾Ò½À´Ï´Ù. ÀÌ ¸ñ·ÏÀ» ÀúÀåÇϸé, ³ªÁß¿¡ µ¿ÀÏÇÑ ¼­¹ö ¼¼Æ®¸¦ °è¼Ó ¸ð´ÏÅÍÇÒ ¶§ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.\n\n+" + IDS_SUBSET_DISCARD_DESC2 + "ÇöÀç ¸ð´ÏÅ͵Ǵ ¼­¹ö ¸ñ·ÏÀ» Æ÷ÇÔÇÒ ¼­ºê¼¼Æ®¸¦ ÀÛ¼ºÇϽðٽÀ´Ï±î?" + IDS_SUBSET_NONAME "(Á¦¸ñ ¾øÀ½)" + IDS_SUBSET_NOSUBSET "(¸ðµç ¼­¹ö°¡ ¸ð´ÏÅ͵ǰí ÀÖ½À´Ï´Ù)" + IDS_SUBSET_SERVERSUBSET "%1 ¼­¹ö" + IDS_FILESET_SOME "%1 ¼¿¿¡¼­ ¸ð´ÏÅ͵Ǵ ¸ðµç ¼­¹öÀÇ º¼·ý:" + IDS_AGGREGATE_SOME "%1 ¼¿¿¡¼­ ¸ð´ÏÅ͵Ǵ ¸ðµç ¼­¹öÀÇ ÆÄƼ¼Ç:" + IDS_SERVICE_SOME "%1 ¼¿¿¡¼­ ¸ð´ÏÅ͵Ǵ ¸ðµç ¼­¹öÀÇ ¼­ºñ½º:" + IDS_FILESET_UNMON "%1 ¼­¹ö´Â ¸ð´ÏÅ͵ǰí ÀÖÁö ¾Ê½À´Ï´Ù" + IDS_AGGREGATE_UNMON "%1 ¼­¹ö´Â ¸ð´ÏÅ͵ǰí ÀÖÁö ¾Ê½À´Ï´Ù" + IDS_SERVICE_UNMON "%1 ¼­¹ö´Â ¸ð´ÏÅ͵ǰí ÀÖÁö ¾Ê½À´Ï´Ù" + IDS_SUBSET_DELETE_TITLE "¼­ºê¼¼Æ® »èÁ¦?" + IDS_SUBSET_DELETE_DESC "%1 ¼­¹ö ¼­ºê¼¼Æ®¸¦ »èÁ¦ÇϽðڽÀ´Ï±î?" + IDS_ERROR_TRANSLATED "¿À·ù ¹øÈ£ 0x%1(%2):\n\n%3" + IDS_ERROR_NOTTRANSLATED "¿À·ù ¹øÈ£ 0x%1(%2)Àº(´Â) ÀνĵÇÁö ¾Ê½À´Ï´Ù." + IDS_FIND_NOTHING_TITLE "¼±ÅÃµÈ ¸í·É ¾øÀ½" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FIND_NOTHING_DESC "Á¶ÀÛ ¼öÇà ¹æ¹ýÀ» ¾Ë¾Æº¸·Á¸é, ¸ÕÀú ¸ñ·Ï¿¡¼­ ¸í·ÉÇàÀ» ¼±ÅÃÇϰųª Ű¿öµå¸¦ ÀÔ·ÂÇϽʽÿÀ." + IDS_FIND_UNKNOWN_TITLE "¾Ë ¼ö ¾ø´Â ¸í·É" + IDS_FIND_UNKNOWN_DESC "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ ""%1"" ¸í·É¿¡ ´ëÇÑ µµ¿ò¸» ÁÖÁ¦¸¦ ãÁö ¸øÇß½À´Ï´Ù." + IDS_HELPABOUT_DESC1 "°æ°í: ÀÌ ÄÄÇ»ÅÍ ÇÁ·Î±×·¥Àº ÀúÀÛ±Ç ¹× ±¹Á¦ Çù¾à¿¡ ÀÇÇØ º¸È£µË´Ï´Ù." + IDS_HELPABOUT_DESC2 "Çã°¡ ¾øÀÌ ÀÌ ¼ÒÇÁÆ®¿þ¾î¸¦ Àç»ý»êÇϰųª ºÐ¹èÇÏ¸é ½É°¢ÇÑ ¹Î»ç ¹× Çü»ç »ç°ÇÀ» ÀÏÀ¸Å³ ¼ö ÀÖÀ¸¸ç ¹ýÀÌ Çã¿ëÇÏ´Â ¹üÀ§ ³»¿¡¼­ ÃÖ´ëÀÇ Ã³¹úÀ» ¹Þ°Ô µË´Ï´Ù.\n\n+" + IDS_HELPABOUT_DESC3 "AFS´Â IBM»ç Transarc CorporationÀÇ µî·Ï»óÇ¥ÀÔ´Ï´Ù." + IDS_CANT_QUIT_TITLE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" + IDS_CANT_QUIT_REBOOT "ÁÖÀÇ!\n\nAFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº ÇöÀç Çϳª ÀÌ»óÀÇ Á¶ÀÛÀ» ¼öÇà ÁßÀÔ´Ï´Ù. Windows¸¦ Áö±Ý Á¾·áÇϸé, ½ÇÇà ÁßÀÎ Á¶ÀÛÀ» ³¡³¾ ¼ö ¾ø½À´Ï´Ù.\n\nWindows¸¦ ´Ù½Ã ½ÃÀÛÇϽðڽÀ´Ï±î?" + IDS_APP_TITLE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" + IDS_ACTION_OPENCELL "%1 ¼¿¿¡¼­ ¼­¹ö ã´Â Áß" + IDS_OPTIONS_TITLE "¿É¼Ç - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" + IDS_OPTIONS_GENERAL_TAB "ÀϹÝ" + IDS_BADCREDS_DESC "°ü¸®ÀÚ·Î ·Î±×ÀÎÇÏÁö ¾ÊÀ¸¸é %1 ¼¿À» °ü¸®ÇÏ´Â µ¥ ÇÊ¿äÇÑ Æ¯±ÇÀÌ ºÎÁ·ÇÕ´Ï´Ù. ¾×¼¼½º Ư±ÇÀÌ ºÎÁ·ÇÏ°Ô µÇ¸é, AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº ¹®Á¦°¡ ¾øÀ» °æ¿ì¿¡µµ ¼¿¿¡¼­ ¹®Á¦Á¡À» ã°Ô µË´Ï´Ù." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CONFIRMATION_TITLE "È®ÀÎ - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" + IDS_NO_GROUP_CHECKBOX "¼ÒÀ¯ÇÏ´Â ±×·ì ¾øÀ½" + IDS_AFS_ID_DIDEXP "%1(%2¿¡ ¸¸±âµÇ´Â ÅäÅ«)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_QUERYING "(Á¶È¸ Áß)" + IDS_ADMCOL_TYPE_FOREIGN_GROUP "¿Ü·¡ ±×·ì" + IDS_ADMCOL_TYPE_FOREIGN_USER "¿Ü·¡ »ç¿ëÀÚ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_NOTIFIER "ÁöÁ¤ÀÚ" + IDS_SVC_NONOTIFIER "(¾øÀ½)" + IDS_SVR_KEY_TAB "¼­¹ö Ű" + IDS_KEYNAME_NOTIME "%1 ¼­¹ö¿¡ ´ëÇÑ Å°:" + IDS_KEYNAME_WITHTIME "%1 ¼­¹ö¿¡ ´ëÇÑ Å°(%2 ¼öÁ¤)" + IDS_SVRKEY_VERSION "¹öÀü" + IDS_SVRKEY_DATA "°ª" + IDS_SVRKEY_CHECKSUM "üũ¼¶" + IDS_SVRKEY_DATA_UNKNOWN "(¼û°ÜÁü)" + IDS_STARTSERVICE_TITLE "¼­ºñ½º ½ÃÀÛ" + IDS_STOPSERVICE_TITLE "¼­ºñ½º Á¤Áö" + IDS_STARTSERVICE_TEXT "È®ÀÎÀ» ´­·¯ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ ½ÃÀÛÇϽʽÿÀ." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_STOPSERVICE_TEXT "È®ÀÎÀ» ´­·¯ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ Á¤ÁöÇϽʽÿÀ." + IDS_STARTSERVICE_STARTUP + "%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛµÉ ¶§ ÀÚµ¿À¸·Î %2 ¼­ºñ½º¸¦ ½ÃÀÛÇϵµ·Ï ÀÌ º¯°æ»çÇ×À» ¿µ±¸ÀûÀ¸·Î ¸¸µé ¼ö ÀÖ½À´Ï´Ù." + IDS_STOPSERVICE_STARTUP "%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛÇÒ ¶§ ÀÚµ¿À¸·Î %2 ¼­ºñ½º¸¦ ½ÃÀÛÇÏÁö ¾Êµµ·Ï ÀÌ º¯°æ»çÇ×À» ¿µ±¸ÀûÀ¸·Î ¸¸µé ¼ö ÀÖ½À´Ï´Ù." + IDS_STARTSERVICE_PERMANENT + "¿µ±¸(&P)(%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛµÉ ¶§ %2 ¼­ºñ½º ½ÃÀÛ)" + IDS_STARTSERVICE_TEMPORARY + "ÀÓ½Ã(&T)(%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛµÉ ¶§ %2 ¼­ºñ½º¸¦ ½ÃÀÛÇÏÁö ¾ÊÀ½)" + IDS_STOPSERVICE_PERMANENT + "¿µ±¸(&P)(%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛµÉ ¶§ %2 ¼­ºñ½º¸¦ ½ÃÀÛÇÏÁö ¾ÊÀ½)" + IDS_STOPSERVICE_TEMPORARY + "ÀÓ½Ã(&T)(%1 ¼­¹ö°¡ ´Ù½Ã ½ÃÀÛµÉ ¶§ %2 ¼­ºñ½º ½ÃÀÛ)" + IDS_ACTION_EXECUTE "%1 ¼­¹ö¿¡¼­ %2 ½ÇÇà Áß" + IDS_ACTION_SALVAGE_SVR "%1 ¼­¹ö¿¡¼­ ¸ðµç º¼·ý º¹¿ø Áß" + IDS_ACTION_SALVAGE_AGG "%1:2 ÆÄƼ¼Ç»óÀÇ ¸ðµç º¼·ý º¹¿ø Áß" + IDS_ACTION_SALVAGE_VOL "%1:2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý º¹¿ø Áß" + IDS_SALVAGE_SVR "%1 ¼­¹ö»óÀÇ ¸ðµç º¼·ý º¹¿ø" + IDS_SALVAGE_AGG "%1 ¼­¹ö, %2 ÆÄƼ¼Ç»óÀÇ ¸ðµç º¼·ý º¹¿ø" + IDS_SALVAGE_SET "%1 ¼­¹ö, %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý º¹¿ø" + IDS_SETSTATUS_SALVAGE "º¼·ý º¹¿ø Áß" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETSTATUS_LOCKED "º¼·ýÀÌ Àá°å½À´Ï´Ù" + IDS_SETSTATUS_NO_VOL "º¼·ýÀÌ ´©¶ôµÇ¾ú½À´Ï´Ù" + IDS_SETSTATUS_BUSY "ÇöÀç º¼·ýÀÌ »ç¿ë ÁßÀÔ´Ï´Ù" + IDS_SETSTATUS_MOVED "À̵¿µÈ º¼·ý" + IDS_SVR_CAPACITY "%1" + IDS_SVR_ALLOCATION "%1(%2%%)" + IDS_SVRCOL_ADDRESS "ÁÖ¼Ò" + IDS_HOST_TITLE "%1 ¼­¹ö¿¡¼­ ÀÎ½ÄµÈ µ¥ÀÌÅͺ£À̽º È£½ºÆ® ¼­¹ö:" + IDS_SVR_HOSTS_TITLE "%1 ¼­¹ö - µ¥ÀÌÅͺ£À̽º È£½ºÆ®" + IDS_SVR_HOST_TAB "µ¥ÀÌÅͺ£À̽º È£½ºÆ®" + IDS_ACTION_HOSTLIST_LOAD "%1 ¼­¹ö¿¡¼­ È£½ºÆ® ¸ñ·Ï È®º¸ Áß" + IDS_ACTION_HOSTLIST_SAVE "%1 ¼­¹ö¿¡ È£½ºÆ® ¸ñ·Ï ±â·Ï Áß" + IDS_SETSTATUS_1ALERT "º¼·ý¿¡ ÇϳªÀÇ ¹®Á¦Á¡ÀÌ ÀÖ½À´Ï´Ù" + IDS_SETSTATUS_2ALERT "º¼·ý¿¡ %1°³ÀÇ ¹®Á¦Á¡ÀÌ ÀÖ½À´Ï´Ù" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CHANGEADDR "%1 ¼­¹ö¿ë IP ÁÖ¼Ò º¯°æ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_ADDSITE "vos addsite" + IDS_COMMAND_VOS_BACKUP "vos backup" + IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" + IDS_COMMAND_VOS_CREATE "vos create" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_DELENTRY "vos delentry" + IDS_COMMAND_VOS_DUMP "vos dump" + IDS_COMMAND_VOS_EXAMINE "vos examine" + IDS_COMMAND_VOS_LISTPART "vos listpart" + IDS_COMMAND_VOS_LISTVLDB "vos listvldb" + IDS_COMMAND_VOS_LISTVOL "vos listvol" + IDS_COMMAND_VOS_LOCK "vos lock" + IDS_COMMAND_VOS_MOVE "vos move" + IDS_COMMAND_VOS_PARTINFO "vos partinfo" + IDS_COMMAND_VOS_RELEASE "vos release" + IDS_COMMAND_VOS_REMOVE "vos remove" + IDS_COMMAND_VOS_REMSITE "vos remsite" + IDS_COMMAND_VOS_RENAME "vos rename" + IDS_COMMAND_VOS_RESTORE "vos restore" + IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" + IDS_COMMAND_VOS_UNLOCK "vos unlock" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" + IDS_COMMAND_VOS_ZAP "vos zap" + IDS_COMMAND_BOS_ADDHOST "bos addhost" + IDS_COMMAND_BOS_ADDKEY "bos addkey" + IDS_COMMAND_BOS_ADDUSER "bos adduser" + IDS_COMMAND_BOS_CREATE "bos create" + IDS_COMMAND_BOS_DELETE "bos delete" + IDS_COMMAND_BOS_EXEC "bos exec" + IDS_COMMAND_BOS_GETDATE "bos getdate" + IDS_COMMAND_BOS_GETLOG "bos getlog" + IDS_COMMAND_BOS_GETRESTART "bos getrestart" + IDS_COMMAND_BOS_INSTALL "bos install" + IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" + IDS_COMMAND_BOS_LISTKEYS "bos listkeys" + IDS_COMMAND_BOS_LISTUSERS "bos listusers" + IDS_COMMAND_BOS_PRUNE "bos prune" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_BOS_REMOVEHOST "bos removehost" + IDS_COMMAND_BOS_REMOVEKEY "bos removekey" + IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" + IDS_COMMAND_BOS_RESTART "bos restart" + IDS_COMMAND_BOS_SALVAGE "bos salvage" + IDS_COMMAND_BOS_SETAUTH "bos setauth" + IDS_COMMAND_BOS_SETRESTART "bos setrestart" + IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" + IDS_COMMAND_BOS_START "bos start" + IDS_COMMAND_BOS_STARTUP "bos startup" + IDS_COMMAND_BOS_STATUS "bos status" + IDS_COMMAND_BOS_STOP "bos stop" + IDS_COMMAND_BOS_UNINSTALL "bos uninstall" + IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" + IDS_COMMAND_FS_LISTQUOTA "fs listquota" + IDS_COMMAND_FS_QUOTA "fs quota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_FS_SETQUOTA "fs setquota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCSHORT_UNMONITORED + "%1 ¼­¹ö´Â ¹®Á¦Á¡¿¡ ´ëÇØ ¸ð´ÏÅ͵ÇÁö ¾Ê°í ÀÖ½À´Ï´Ù" + IDS_ALERT_DESCSHORT_TIMEOUT "%1 ¼­¹ö¿¡ Á¢¼ÓÇÒ ¼ö ¾ø½À´Ï´Ù. ÃÖÁ¾ ¿À·ù: %3" + IDS_ALERT_DESCSHORT_AGG_FULL + "%2¿¡ ´ëÇÑ ÆÄƼ¼Ç »ç¿ë·®ÀÌ °æ°í ÀÓ°è°ªÀÎ %3%%(%4)À»(¸¦) ÃʰúÇÕ´Ï´Ù" + IDS_ALERT_DESCSHORT_SET_FULL + "%3¿¡ ´ëÇÑ º¼·ý »ç¿ë·®ÀÌ °æ°í ÀÓ°è°ªÀÎ %4%%(%5)À»(¸¦) ÃʰúÇÕ´Ï´Ù" + IDS_ALERT_DESCSHORT_NO_VLDBENT "%3 º¼·ý¿¡ VLDB ÀÔ·Â Ç׸ñÀÌ ¾ø½À´Ï´Ù" + IDS_ALERT_DESCSHORT_NO_SVRENT_SET + "%3 º¼·ý¿¡ VLDB ÀÔ·Â Ç׸ñÀÌ ÀÖÁö¸¸ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ ãÁö ¸øÇß½À´Ï´Ù" + IDS_ALERT_DESCSHORT_STOPPED "%2 ¼­ºñ½º°¡ %3¿¡¼­ Á¤ÁöµÇ¾ú½À´Ï´Ù" + IDS_ALERT_DESCSHORT_NO_SVRENT_AGG + "%2 ÆÄƼ¼ÇÀÌ VLDB¿¡ ÀÇÇØ ÂüÁ¶µÇ¾úÀ¸³ª %1 ¼­¹ö¿¡¼­ ãÁö ¸øÇß½À´Ï´Ù" + IDS_ALERT_DESCSHORT_BADCREDS "%1 ¼­¹ö °ü¸®¿¡ ÇÊ¿äÇÑ Æ¯±ÇÀÌ ºÎÁ·ÇÕ´Ï´Ù" + IDS_ALERT_DESCSHORT_AGG_ALLOC + "%2 ÆÄƼ¼Ç¿¡¼­ °áÇÕµÈ º¼·ý ÇÒ´ç·®ÀÌ ±× ¿ë·®À» ÃʰúÇÕ´Ï´Ù" + IDS_ALERT_DESCSHORT_STATE_NO_VNODE + "%3 º¼·ýÀº ÈѼյǾúÀ¸¹Ç·Î »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ALERT_DESCSHORT_STATE_NO_SERVICE + "%3 º¼·ýÀ» ó¸®ÇÒ ½ÇÇà ÁßÀÎ ¼­ºñ½º°¡ ¾ø½À´Ï´Ù." + IDS_ALERT_DESCSHORT_STATE_OFFLINE + "%3 º¼·ýÀº ¿ÀÇÁ ¶óÀÎÀ̹ǷΠ»ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_TIMEOUT + "%1 ¼­¹ö¿Í Á¢¼ÓÇÒ ¼ö ¾ø½À´Ï´Ù. %2¿¡¼­ ÀÌ·ç¾îÁø ÃÖÁ¾ ½Ãµµ·Î ""%3"" ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_AGG_FULL + "%1 ¼­¹ö¿¡¼­ÀÇ %2 ÆÄƼ¼Ç »ç¿ë·®ÀÌ °æ°í ÀÓ°è°ªÀÎ %3%%(%4)À»(¸¦) ÃʰúÇÕ´Ï´Ù." + IDS_ALERT_DESCFULL_SET_FULL + "%3 º¼·ý(%1 ¼­¹ö, %2 ÆÄƼ¼Ç)ÀÇ »ç¿ë·®ÀÌ °æ°í ÀÓ°è°ªÀÎ %4%%(%5)À»(¸¦) ÃʰúÇÕ´Ï´Ù." + IDS_ALERT_DESCFULL_NO_VLDBENT + "%3 º¼·ýÀº %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ ÀÖÀ¸³ª ÇØ´ç VLDB ÀÔ·Â Ç׸ñÀÌ ¾ø½À´Ï´Ù." + IDS_ALERT_DESCFULL_NO_SVRENT_SET + "%3 º¼·ý¿¡ ´ëÇÑ VLDB ÀÔ·Â Ç׸ñÀÌ ÀÖÀ¸³ª %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ º¼·ýÀ» ãÁö ¸øÇß½À´Ï´Ù." + IDS_ALERT_DESCFULL_STOPPED + "%1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º°¡ %5 Á¾·á ÄÚµå¿Í ÇÔ²² %3¿¡¼­ Á¤ÁöÇß½À´Ï´Ù." + IDS_ALERT_DESCFULL_NO_SVRENT_AGG + "VLDB´Â %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ ÀÖ´Â º¼·ýÀ» ÂüÁ¶ÇÏÁö¸¸ ÆÄƼ¼ÇÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù." + IDS_ALERT_DESCFULL_BADCREDS + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼­¹ö¿¡ ¾ø´Â ¿À·ù¸¦ ¹ß°ßÇÒ ¼öµµ ÀÖ½À´Ï´Ù. ¿Ö³ÄÇϸé, ÀÌ ¼¿¿¡¼­´Â AFS ÅäÅ«À» °ü¸®ÀÚ·Î »ç¿ëÇÏÁö ¾Ê±â ¶§¹®ÀÔ´Ï´Ù." + IDS_ALERT_DESCFULL_AGG_ALLOC + "%4ÀÌ(°¡) µÇ´Â %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ °áÇÕµÈ º¼·ý ÇÒ´ç·®ÀÌ %3ÀÇ ÆÄƼ¼Ç ¿ë·®À» ÃʰúÇÕ´Ï´Ù." + IDS_ALERT_DESCFULL_STATE_NO_VNODE + "%1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ ÀÖ´Â %3 º¼·ý¿¡ ¿¬°üµÈ Vnode°¡ ¾ø½À´Ï´Ù.(º¼·ý »óÅ´ 0x%4ÀÔ´Ï´Ù.)" + IDS_ALERT_DESCFULL_STATE_NO_SERVICE + "%1 ¼­¹ö¿¡ ½ÇÇà ÁßÀÎ ÆÄÀÏ ¹ÝÃâ±â ¼­ºñ½º°¡ ¾øÀ¸¹Ç·Î, %2 ÆÄƼ¼ÇÀÇ %3 º¼·ýÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.(º¼·ý »óÅ´ 0x%4ÀÔ´Ï´Ù.)" + IDS_ALERT_DESCFULL_STATE_OFFLINE + "%1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ ÀÖ´Â %3 º¼·ýÀº ¿ÀÇÁ ¶óÀÎÀ̹ǷΠ»ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.(º¼·ý »óÅ´ 0x%4ÀÔ´Ï´Ù.)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_TIMEOUT "´Ù½Ã ½ÃÀÛ ´ÜÃ߸¦ ´­·¯ ÀÌ ¼­¹ö¿¡ ´Ù½Ã Á¢¼ÓÇϽʽÿÀ." + IDS_ALERT_FIX_AGG_FULL "°æ°í ´ÜÃ߸¦ ´­·¯ ÀÌ ÆÄƼ¼ÇÀÇ »ç¿ë·®¿¡ ´ëÇÑ °æ°í ÀÓ°è°ªÀ» º¯°æÇϽʽÿÀ." + IDS_ALERT_FIX_SET_FULL "°æ°í ´ÜÃ߸¦ ´­·¯ ÀÌ º¼·ý »ç¿ë·®¿¡ ´ëÇÑ °æ°í ÀÓ°è°ªÀ» º¯°æÇϽʽÿÀ." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_NO_VLDBENT + "VLDB°¡ ¿À·¡µÇ¾úÀ» °¡´É¼ºÀÌ ÀÖ´Â °æ¿ì, VLDB µ¿±âÈ­¸¦ »ç¿ëÇÏ¿© °»½ÅÇϽʽÿÀ." + IDS_ALERT_FIX_NO_SVRENT_SET + "¼­¹ö ¹× ÆÄƼ¼ÇÀ» Á¡°ËÇÏ¿© Á¦´ë·Î ÀÛµ¿ÇÏ´ÂÁö È®ÀÎÇϽʽÿÀ." + IDS_ALERT_FIX_STOPPED "·Î±× º¸±â ´ÜÃ߸¦ ´­·¯ ÀÌ ¼­ºñ½º¿¡ ´ëÇÑ ¼­ºñ½º ·Î±×¸¦ º¸½Ê½Ã¿À." + IDS_ALERT_FIX_NO_SVRENT_AGG + "¼­¹ö¸¦ Á¡°ËÇÏ¿© ÆÄƼ¼ÇÀÌ ¹ÝÃâµÇ´ÂÁö¿Í Á¦´ë·Î ÀÛµ¿ÇÏ´ÂÁö¸¦ È®ÀÎÇϽʽÿÀ." + IDS_ALERT_FIX_BADCREDS "ÀÎÁõ ´ÜÃ߸¦ ´­·¯ »õ AFS ÅäÅ«À» È®º¸ÇϽʽÿÀ." + IDS_ALERT_FIX_AGG_ALLOC "ÀÌ ÆÄƼ¼Ç¿¡¼­ º¼·ý¿¡ ´ëÇÑ ÇÒ´ç·®À» ÁÙÀ̰ųª Çϳª ÀÌ»óÀÇ º¼·ýÀ» ´Ù¸¥ ÆÄƼ¼ÇÀ¸·Î ¿Å±â½Ê½Ã¿À." + IDS_ALERT_FIX_STATE_NO_VNODE " " + IDS_ALERT_FIX_STATE_NO_SERVICE " " + IDS_ALERT_FIX_STATE_OFFLINE " " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_BUTTON_TRYAGAIN "Àç½Ãµµ(&A)" + IDS_ALERT_BUTTON_WARNINGS "°æ°í(&W)..." + IDS_ALERT_BUTTON_VIEWLOG "·Î±× º¸±â(&V)" + IDS_ALERT_BUTTON_SHOWME "È­¸é¿¡ Ç¥½Ã(&S)" + IDS_ALERT_BUTTON_GETCREDS "ÀÎÁõ(&A)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_CELLSERVERS_NOCELL + "ÁöÁ¤µÈ ¼¿ÀÌ ¾ø½À´Ï´Ù. AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥À» »ç¿ëÇÏ·Á¸é, ÀÛ¾÷ÇÒ AFS ¼¿À» ÁöÁ¤ÇØ¾ß ÇÕ´Ï´Ù. À§ÀÇ ""¼¿"" ¸Þ´º¿¡¼­ ""¿­±â..."" ¸Þ´º Ç׸ñÀ» ¼±ÅÃÇÏ¿© ¼¿À» ¼±ÅÃÇϽʽÿÀ." + IDS_ERROR_REFRESH_CELLSERVERS + "%1 ¼¿¿¡ ´ëÇÑ ¼­¹ö ¸ñ·ÏÀ» È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n¿À·ù: %2" + IDS_ERROR_CANT_OPEN_CELL + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼¿¿¡ ÀÖ´Â ¼­¹ö¿Í Á¢¼ÓÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n¼¿ À̸§À» ¿Ã¹Ù¸£°Ô ÀÔ·ÂÇß´ÂÁö ´Ù½Ã È®ÀÎÇϽʽÿÀ." + IDS_ERROR_REFRESH_AGGREGATES + "%1 ¼­¹ö¿¡ ´ëÇÑ ÆÄƼ¼Ç ¸ñ·ÏÀ» È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n¿À·ù: %2" + IDS_ERROR_REFRESH_SERVER_STATUS + "%1 ¼­¹öÀÇ ÇöÀç »óŸ¦ È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CHANGE_SERVER_STATUS + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ Æ¯¼ºÀ» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_REFRESH_AGGREGATE_STATUS + "%1 ¼­¹ö¿¡¼­ %2 ÆÄƼ¼ÇÀÇ ÇöÀç »óŸ¦ È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_FILESET_STATUS + "%3 º¼·ý(%1 ¼­¹ö, %2 ÆÄƼ¼Ç)ÀÇ ÇöÀç »óŸ¦ È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_REFRESH_SERVICE_STATUS + "%1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½ºÀÇ ÇöÀç »óŸ¦ ÆÇº°ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_MOVE_FILESET "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ ÀÖ´Â %3 º¼·ýÀ» %4 ¼­¹öÀÇ %5 ÆÄƼ¼ÇÀ¸·Î À̵¿ÇÏÁö ¸øÇß½À´Ï´Ù." + IDS_ERROR_VIEW_LOGFILE "%1 ¼­¹ö¿¡¼­ %2 ÆÄÀÏÀ» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù.\n\nÆÄÀÏ À̸§À» ¿Ã¹Ù¸£°Ô ÀÔ·ÂÇß´ÂÁö È®ÀÎÇÏ°í ÆÄÀÏÀ» º¼ ¼ö Àִ Ư±ÇÀÌ ÃæºÐÇÑÁöµµ È®ÀÎÇϽʽÿÀ." + IDS_ERROR_NOT_REPLICATED "%1 º¼·ýÀÇ º¹Á¦ »óŸ¦ ÆÇº°ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_CREATE_FILESET + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ %3 º¼·ýÀ» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_DELETE_FILESET + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %3 º¼·ý(%1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç)À» »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_CREATE_VLDB_ENTRY + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý¿¡ ´ëÇÑ VLDB ÀÔ·Â Ç׸ñÀ» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_SET_FILESET_QUOTA + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý¿¡ ´ëÇÑ ÇÒ´ç·®À» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_CREATE_SERVER + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼¿ ³»¿¡ ¿äûµÈ ¼­¹ö ÀÔ·Â Ç׸ñÀ» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_PING_SERVER + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ IP ÁÖ¼Ò¸¦ ÆÇº°ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_DELETE_SERVER + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¸¦ »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_DELETE_SERVER_FILESETS + "%1 ¼­¹ö´Â ¾ÆÁ÷µµ Çϳª ÀÌ»óÀÇ º¼·ýÀ» º¸À¯ÇϹǷΠ»èÁ¦µÉ ¼ö ¾ø½À´Ï´Ù. ¼­¹ö´Â º¼·ýÀÌ ¾øÀ» ¶§¸¸ »èÁ¦µÉ ¼ö ÀÖ½À´Ï´Ù." + IDS_ERROR_CHANGE_AGGREGATE_STATUS + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ÆÄƼ¼Ç¿¡ ´ëÇÑ Æ¯¼ºÀ» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CHANGE_SERVICE_STATUS + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¿¡ ´ëÇÑ Æ¯¼ºÀ» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_START_SERVICE + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_STOP_SERVICE + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ Á¤ÁöÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_RESTART_SERVICE + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ Á¤ÁöÇÑ ÈÄ ´Ù½Ã ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CHANGE_REPLICA_STATUS + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý¿¡ ´ëÇÑ º¹Á¦ Ư¼ºÀ» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_SYNCVLDB "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ VLDB¸¦ °»½ÅÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_CREATE_REPLICA + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ýÀÇ º¹Á¦º»À» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_INSTALL_FILE + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ÆÄÀÏÀ» ¼³Ä¡ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_UNINSTALL_FILE + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ÆÄÀÏÀ» ¼³Ä¡ÇØÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_PRUNE_FILES + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ ¿äûµÈ ÆÄÀÏÀ» Á¦°ÅÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_RENAME_FILESET + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ º¼·ý À̸§À» %1¿¡¼­ ""%2""(À¸)·Î º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_CREATE_SERVICE + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_DELETE_SERVICE + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ %2 ¼­ºñ½º¸¦ »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_RELEASE_FILESET + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ º¹Á¦µÈ %3 º¼·ýÀ» ÇØÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_UPDATE_FILESET + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %2 ¼­¹öÀÇ %1 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ý º¹Á¦º»À» °»½ÅÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_UPDATE_ALL + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %3 º¼·ýÀÇ º¹Á¦º»À» °»½ÅÇÒ ¼ö ¾ø½À´Ï´Ù." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_LOAD_ADMLIST + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ °ü¸®ÀÚ ¸ñ·ÏÀ» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_LOAD_KEYLIST + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ ¼­¹ö Ű ¸ñ·ÏÀ» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_CREATE_KEY + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ »õ ¼­¹ö ۸¦ ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_SAVE_ADMLIST + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ °ü¸®ÀÚ ¸ñ·ÏÀ» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_CLONE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡ %3 º¼·ýÀÇ ¹é¾÷ ¹öÀüÀ» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_CLONESYS "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ ¿äûµÈ ¹é¾÷ º¼·ýÀ» ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_DUMP_FILESET + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %3 º¼·ý(%1 ¼­¹ö, %2 ÆÄƼ¼Ç)ÀÇ ³»¿ëÀ» %4 ÆÄÀÏ¿¡ ´ýÇÁÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_RESTORE_FILESET + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %3 º¼·ý(%1 ¼­¹ö, %2 ÆÄƼ¼Ç)¿¡ %4 ÆÄÀÏÀ» º¹¿øÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_SET_RESTART_TIMES + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ ¼­ºñ½ºÀÇ Àç½ÃÀÛ ½Ã°£À» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_DELETE_REPLICATED_FILESET + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç¿¡¼­ %3 º¼·ýÀ» »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n%3 º¼·ýÀº ¸ðµç º¹Á¦º»ÀÌ ¸ÕÀú »èÁ¦µÇÁö ¾Ê´Â ÀÌ»ó »èÁ¦µÉ ¼ö ¾ø½À´Ï´Ù." + IDS_CMDLINE_TITLE "¿À·ù - AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" + IDS_CMDLINE_SYNTAX "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù." + IDS_CMDLINE_UNRECOGNIZED + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n""%1"" ¸Å°³º¯¼ö¸¦ ÀνÄÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_CMDLINE_DUPLICATE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n""%1"" ¸Å°³º¯¼ö°¡ ÇÑ ¹ø ÀÌ»ó ÁöÁ¤µÇ¾ú½À´Ï´Ù." + IDS_CMDLINE_UNEXPECTVALUE + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n""%1"" ¸Å°³º¯¼ö¿¡ °ªÀ» Á¦°øÇÏÁö ¸»¾Æ¾ß ÇÕ´Ï´Ù." + IDS_CMDLINE_MISSINGVAL "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n""%1"" ¸Å°³º¯¼ö ´ÙÀ½¿¡ °ªÀÌ ¿Í¾ß ÇÕ´Ï´Ù." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CMDLINE_SUBSETNOTCELL + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n""/SUBSET"" ¸Å°³º¯¼ö´Â ""/CELL"" ¸Å°³º¯¼ö°¡ ÁöÁ¤µÉ °æ¿ì¿¡¸¸ ÁöÁ¤µÉ ¼ö ÀÖ½À´Ï´Ù." + IDS_CMDLINE_INVALIDSUBSET + "ÁöÁ¤ÇÑ ""%2"" ¼­¹ö ¼­ºê¼¼Æ®´Â %1 ¼¿¿¡ ´ëÇØ Á¤ÀǵÇÁö ¾Ê¾Ò½À´Ï´Ù." + IDS_CMDLINE_SERVERNOTCELL + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n""/SERVER"" ¸Å°³º¯¼ö´Â ""/CELL"" ¸Å°³º¯¼ö°¡ ÁöÁ¤µÉ °æ¿ì¿¡¸¸ ÁöÁ¤µÉ ¼ö ÀÖ½À´Ï´Ù." + IDS_CMDLINE_RESET_TITLE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥" + IDS_CMDLINE_RESET_DESC "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ ÁöÁ¤µÈ ¼³Á¤À» Áö¿ü½À´Ï´Ù." + IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº ÆÄƼ¼ÇÀÌ ¾ø°Å³ª ¹ÝÃâµÇÁö ¾Ê¾Ò±â ¶§¹®¿¡ %1 ¼­¹öÀÇ %2 ÆÄƼ¼Ç°ú VLDB¸¦ µ¿±âÈ­ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n%1 ¼­¹ö¿¡¼­ ÀÌ ÆÄƼ¼ÇÀ» Á¦°ÅÇÏ·Á¸é, À̸¦ ÂüÁ¶ÇÏ´Â º¼·ý VLDB ÀÔ·Â Ç׸ñÀ» »èÁ¦ÇØ¾ß ÇÕ´Ï´Ù." + IDS_CMDLINE_USERPASSWORD + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥¿¡ ´ëÇØ ÁöÁ¤ÇÑ ¸í·ÉÇàÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.\n\n»õ AFS ÅäÅ«À» È®º¸ÇÏ·Á¸é, ""/USER"" ¹× ""/PASSWORD"" ¸Å°³º¯¼ö°¡ µÑ ´Ù ÁöÁ¤µÇ¾î¾ß ÇÕ´Ï´Ù." + IDS_ERROR_CANT_DELETE_KEY + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼­¹ö¿¡¼­ %2 ¼­¹ö ۸¦ »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_GETRANDOMKEY + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼­¹ö¿¡ ´ëÇÑ ÀÓÀÇ Å°¸¦ »ý¼ºÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_EXECUTE_COMMAND + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº %1 ¼­¹ö¿¡¼­ ´ÙÀ½ ¸í·ÉÀ» ½ÇÇàÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n ""%2""" + IDS_ERROR_CANT_READ_SALVAGE_LOG + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ º¹¿ø Á¶ÀÛÀ» ³¡³ÂÁö¸¸ º¹¿ø Á¶ÀÛÀÇ °íÀ¯ÇÑ °á°ú¸¦ ¼³¸íÇÏ´Â ·Î±× ÆÄÀÏÀ» °Ë»öÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_SALVAGE "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ ¿äûµÈ º¹¿ø Á¶ÀÛÀ» ¼öÇàÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_AUTH_ON "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ ÀÎÁõ È®ÀÎÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_AUTH_OFF "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡ ´ëÇÑ ÀÎÁõ È®ÀÎ »ç¿ëÀ» ÁߴܽÃŰÁö ¸øÇß½À´Ï´Ù." + IDS_ERROR_CANT_LOAD_HOSTLIST + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ µ¥ÀÌÅͺ£À̽º È£½ºÆ® ¼­¹ö ¸ñ·ÏÀ» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù." + IDS_ERROR_CANT_SAVE_HOSTLIST + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿¡¼­ µ¥ÀÌÅͺ£À̽º È£½ºÆ® ¼­¹ö ¸ñ·ÏÀ» º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº AFS Á¦¾î ¼¾ÅͰ¡ ÀÌ ÄÄÇ»ÅÍ¿¡ Á¦´ë·Î ¼³Ä¡µÇÁö ¾Ê¾ÒÀ¸¹Ç·Î ½ÃÀÛµÉ ¼ö ¾ø½À´Ï´Ù.\n\nAFS Á¦¾î ¼¾Å͸¦ ´Ù½Ã ¼³Ä¡ÇØ¾ß ÇÕ´Ï´Ù." + IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥Àº ¾Ë ¼ö ¾ø´Â ¹®Á¦Á¡À¸·Î ½ÃÀÛµÉ ¼ö ¾ø½À´Ï´Ù.\n\nAFS Á¦¾î ¼¾Å͸¦ ´Ù½Ã ¼³Ä¡ÇØ¾ß ÇÕ´Ï´Ù." + IDS_ERROR_CANT_CHANGEADDR + "AFS ¼­¹ö °ü¸® ÇÁ·Î±×·¥ÀÌ %1 ¼­¹ö¿ë VLDB¿¡¼­ IP ÁÖ¼Ò¸¦ º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_SERVICE "%1:%2" + IDS_SERVICETYPE_SIMPLE "°£´Ü" + IDS_SERVICETYPE_CRON "Å©·Ð" + IDS_SERVICESTATE_STOPPED "Á¤ÁöµÊ" + IDS_SERVICESTATE_STOPPING "Á¤Áö Áß" + IDS_SERVICESTATE_STARTING "½ÃÀÛ Áß" + IDS_SERVICESTATE_RUNNING "½ÇÇà Áß" + IDS_SERVICETYPE_FS_LONG "FS(ÆÄÀÏ ½Ã½ºÅÛ)" + IDS_SERVICETYPE_FS "FS" + IDS_SERVICE_LASTERROR "%1" + IDS_SERVICES_IN_CELL "%1 ¼¿ÀÇ ¸ðµç ¼­ºñ½º:" + IDS_SERVICE_STARTDATE "%1 ½ÃÀÛµÊ" + IDS_SERVICE_STOPDATE "%1 Á¤ÁöµÊ" +END + +#endif // Korean resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afssvrmgr/lang/pt_BR/svrmgr.rc b/src/WINNT/afssvrmgr/lang/pt_BR/svrmgr.rc index 373c3c170..6a6817e2d 100644 --- a/src/WINNT/afssvrmgr/lang/pt_BR/svrmgr.rc +++ b/src/WINNT/afssvrmgr/lang/pt_BR/svrmgr.rc @@ -7,3024 +7,3024 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "Gerenciador de Servidor do AFS" +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "Gerenciador de Servidor do AFS" #define AFS_VERINFO_NAME "svrmgr" #define AFS_VERINFO_FILENAME "svrmgr.exe" #define AFS_VERINFO_LANG_CODE 0x416 #define AFS_VERINFO_CHARSET 1252 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_SERVICES, DIALOG - BEGIN - RIGHTMARGIN, 165 - END - - IDD_AGGREGATES, DIALOG - BEGIN - RIGHTMARGIN, 118 - END - - IDD_FILESETS, DIALOG - BEGIN - RIGHTMARGIN, 180 - END - - IDD_SVR_LISTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_AGG_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 262 - TOPMARGIN, 5 - BOTTOMMARGIN, 155 - END - - IDD_SVR_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 183 - END - - IDD_SVR_SCOUT, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 216 - TOPMARGIN, 5 - BOTTOMMARGIN, 153 - END - - IDD_SVC_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 268 - TOPMARGIN, 5 - BOTTOMMARGIN, 209 - END - - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 315 - TOPMARGIN, 2 - BOTTOMMARGIN, 224 - END - - IDD_SERVER, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 207 - TOPMARGIN, 2 - BOTTOMMARGIN, 135 - END - - IDD_SVC_CREATE, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 228 - END - - IDD_SET_REPSITES, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 216 - TOPMARGIN, 5 - BOTTOMMARGIN, 163 - END - - IDD_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 7 - BOTTOMMARGIN, 250 - HORZGUIDE, 160 - END - - IDD_TIMEOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 232 - TOPMARGIN, 7 - BOTTOMMARGIN, 153 - END - - IDD_COLUMNS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 281 - TOPMARGIN, 5 - BOTTOMMARGIN, 143 - END - - IDD_REFRESHALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 68 - END - - IDD_SET_CREATE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 317 - TOPMARGIN, 4 - BOTTOMMARGIN, 205 - END - - IDD_SET_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 98 - END - - IDD_SET_CLONE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 341 - TOPMARGIN, 7 - BOTTOMMARGIN, 81 - END - - IDD_SVC_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 189 - END - - IDD_SVR_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 152 - END - - IDD_AGG_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 252 - TOPMARGIN, 5 - BOTTOMMARGIN, 146 - END - - IDD_SET_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 268 - TOPMARGIN, 5 - BOTTOMMARGIN, 177 - END - - IDD_SET_MOVETO, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 170 - END - - IDD_SET_MOVING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SVC_LOGNAME, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 102 - END - - IDD_SVC_VIEWLOG, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 181 - END - - IDD_SET_SETQUOTA, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 267 - TOPMARGIN, 4 - BOTTOMMARGIN, 126 - END - - IDD_ACTIONS, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 234 - TOPMARGIN, 2 - BOTTOMMARGIN, 56 - END - - IDD_SVR_SYNCVLDB, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 265 - TOPMARGIN, 4 - BOTTOMMARGIN, 95 - END - - IDD_SET_CREATEREP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 167 - END - - IDD_SVR_INSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 259 - TOPMARGIN, 4 - BOTTOMMARGIN, 153 - END - - IDD_SVR_UNINSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 135 - END - - IDD_SVR_PRUNE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 196 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_SET_RENAME, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 129 - END - - IDD_SVC_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 64 - END - - IDD_SVR_GETDATES, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_GETDATES_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 128 - END - - IDD_SET_DUMP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 290 - TOPMARGIN, 7 - BOTTOMMARGIN, 140 - END - - IDD_SET_RESTORE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 288 - TOPMARGIN, 4 - BOTTOMMARGIN, 244 - END - - IDD_SVC_BOS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_DUMPING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SET_RESTORING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SET_CLONESYS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 254 - TOPMARGIN, 7 - BOTTOMMARGIN, 159 - END - - IDD_SUBSETS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 292 - TOPMARGIN, 5 - BOTTOMMARGIN, 178 - END - - IDD_SUBSET_LOADSAVE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 296 - TOPMARGIN, 4 - BOTTOMMARGIN, 142 - END - - IDD_HELP_FIND, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 214 - TOPMARGIN, 4 - BOTTOMMARGIN, 69 - END - - IDD_HELP_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 214 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_HELP_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 226 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_OPENINGCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 236 - TOPMARGIN, 2 - BOTTOMMARGIN, 41 - END - - IDD_OPTIONS_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 274 - TOPMARGIN, 5 - BOTTOMMARGIN, 131 - END - - IDD_SVR_KEYS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_CREATEKEY, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - END - - IDD_SVC_STARTSTOP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 315 - TOPMARGIN, 7 - BOTTOMMARGIN, 129 - END - - IDD_SVR_EXECUTE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_SALVAGE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 250 - TOPMARGIN, 7 - BOTTOMMARGIN, 267 - END - - IDD_SVR_SALVAGE_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 174 - END - - IDD_SET_RELEASE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 98 - END - - IDD_SVR_HOSTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_ADDHOST, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 221 - TOPMARGIN, 4 - BOTTOMMARGIN, 102 - END - - IDD_SVR_ADDRESS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 204 - TOPMARGIN, 4 - BOTTOMMARGIN, 111 - END - - IDD_SVR_NEWADDR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 219 - TOPMARGIN, 4 - BOTTOMMARGIN, 65 - END -END -#endif // APSTUDIO_INVOKED - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""Gerenciador de Servidor do AFS""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_MAIN MENU DISCARDABLE -BEGIN - POPUP "&Célula" - BEGIN - MENUITEM "&Selecionar...", M_CELL_OPEN - MENUITEM "&Autenticação...", M_CREDENTIALS - MENUITEM SEPARATOR - MENUITEM "Sai&r", M_EXIT - END - POPUP "E&xibir" - BEGIN - POPUP "&Servidores" - BEGIN - MENUITEM "Ícones &Grandes", M_SVR_VIEW_LARGE - , CHECKED - MENUITEM "Ícones &Pequenos", M_SVR_VIEW_SMALL - , CHECKED - MENUITEM "&Detalhes", M_SVR_VIEW_REPORT - , CHECKED - MENUITEM SEPARATOR - MENUITEM "&Normal", M_SVR_VIEW_ONEICON - , CHECKED - MENUITEM "&Todos os Ícones", M_SVR_VIEW_TWOICONS - , CHECKED - MENUITEM "&Somente Status", M_SVR_VIEW_STATUS - , CHECKED - END - POPUP "Painel de &Exibição Rápida" - BEGIN - MENUITEM "&Nenhum", M_DIVIDE_NONE, CHECKED - MENUITEM "Dividir &Verticalmente", M_DIVIDE_H, CHECKED - MENUITEM "Dividir &Horizontalmente", M_DIVIDE_V, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "O&perações Em Andamento", M_ACTIONS, CHECKED - MENUITEM SEPARATOR - MENUITEM "Servidores &Monitorados...", M_SUBSET - MENUITEM "&Colunas...", M_COLUMNS - MENUITEM "&Opções...", M_OPTIONS - MENUITEM SEPARATOR - MENUITEM "A&tualizar Tudo", M_REFRESHALL - END - POPUP "&Ajuda" - BEGIN - MENUITEM "&Conteúdo", M_HELP - MENUITEM "&Procurar Comando...", M_HELP_FIND - MENUITEM "Pes&quisar Código de Erro...", M_HELP_XLATE - MENUITEM SEPARATOR - MENUITEM "&Sobre o Gerenciador de Servidor do AFS...", M_ABOUT - END -END - -MENU_AGG MENU DISCARDABLE -BEGIN - MENUITEM "&Criar Volume...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "Fazer &Backup de Volumes...", M_SET_CLONE - MENUITEM "&Desbloquear Todos os Volumes", M_SET_UNLOCK - MENUITEM "S&incronizar VLDB...", M_SYNCVLDB - MENUITEM "&Recuperar Volumes...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "A&tualizar", M_REFRESH - MENUITEM "&Propriedades", M_PROPERTIES -END - -MENU_SVC MENU DISCARDABLE -BEGIN - MENUITEM "&Iniciar", M_SVC_START - MENUITEM "Pa&rar", M_SVC_STOP - MENUITEM "Rei&niciar", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "Exibir Arquivo de &Log", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "E&xcluir", M_SVC_DELETE - MENUITEM SEPARATOR - MENUITEM "A&tualizar", M_REFRESH - MENUITEM "&Propriedades", M_PROPERTIES -END - -MENU_AGG_NONE MENU DISCARDABLE -BEGIN - POPUP "E&xibir" - BEGIN - MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED - MENUITEM "&Todos os Ícones", M_VIEW_TWOICONS, CHECKED - MENUITEM "&Somente Status", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "&Criar Volume...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "A&tualizar Tudo", M_REFRESHALL -END - -MENU_SVC_NONE MENU DISCARDABLE -BEGIN - POPUP "E&xibir" - BEGIN - MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED - MENUITEM "&Todos os Ícones", M_VIEW_TWOICONS, CHECKED - MENUITEM "&Somente Status", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "&Criar Serviço...", M_SVC_CREATE - MENUITEM SEPARATOR - MENUITEM "A&tualizar Tudo", M_REFRESHALL -END - -MENU_SET MENU DISCARDABLE -BEGIN - MENUITEM "R&eplicação...", M_SET_REPLICATION - MENUITEM "&Liberar Agora", M_SET_RELEASE - MENUITEM SEPARATOR - MENUITEM "Fazer &Backup...", M_SET_CLONE - MENUITEM "Descarre&gar para Arquivo...", M_SET_DUMP - MENUITEM "Res&taurar do Arquivo...", M_SET_RESTORE - MENUITEM "Definir &Quota...", M_SET_SETQUOTA - MENUITEM "&Recuperar...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "&Mover Para...", M_SET_MOVETO - MENUITEM "Re&nomear...", M_SET_RENAME - MENUITEM "E&xcluir", M_SET_DELETE - MENUITEM SEPARATOR - MENUITEM "Bloq&uear", M_SET_LOCK - MENUITEM "&Desbloquear", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "Atuali&zar", M_REFRESH - MENUITEM "&Propriedades", M_PROPERTIES -END - -MENU_SVR MENU DISCARDABLE -BEGIN - MENUITEM "Abrir &Janela do Servidor", M_SVR_OPEN - MENUITEM "&Fechar Janela do Servidor", M_SVR_CLOSE - MENUITEM "&Monitorar este Servidor", M_SVR_MONITOR, CHECKED - MENUITEM SEPARATOR - MENUITEM "Editar &Segurança do Servidor...", M_SVR_SECURITY - MENUITEM "Gerenciar &Hosts de Banco de Dados...", M_SVR_HOSTS - MENUITEM "Fazer &Backup de Volumes...", M_SET_CLONE - MENUITEM "&Desbloquear Todos os Volumes", M_SET_UNLOCK - MENUITEM "Si&ncronizar VLDB...", M_SYNCVLDB - MENUITEM "Recuperar &Volumes...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "&Instalar Arquivo...", M_SVR_INSTALL - MENUITEM "&Remover Instalação de Arquivo...", M_SVR_UNINSTALL - MENUITEM "Eliminar Arquivos Anti&gos...", M_SVR_PRUNE - MENUITEM SEPARATOR - MENUITEM "Obter Da&tas de Arquivo...", M_SVR_GETDATES - MENUITEM "Exibir Arquivo de &Log...", M_VIEWLOG - MENUITEM "&Executar Comando...", M_EXECUTE - MENUITEM SEPARATOR - MENUITEM "Atuali&zar", M_REFRESH - MENUITEM "&Propriedades", M_PROPERTIES -END - -MENU_SVR_NONE MENU DISCARDABLE -BEGIN - POPUP "E&xibir" - BEGIN - MENUITEM "Ícones &Grandes", M_SVR_VIEW_LARGE, CHECKED - MENUITEM "Ícones &Pequenos", M_SVR_VIEW_SMALL, CHECKED - MENUITEM "&Detalhes", M_SVR_VIEW_REPORT, CHECKED - MENUITEM SEPARATOR - MENUITEM "&Normal", M_SVR_VIEW_ONEICON, CHECKED - MENUITEM "&Todos os Ícones", M_SVR_VIEW_TWOICONS, CHECKED - MENUITEM "&Somente Status", M_SVR_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "Servidores &Monitorados...", M_SUBSET - MENUITEM SEPARATOR - MENUITEM "&Desbloquear Todos os Volumes", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "&Fechar Tudo", M_SVR_CLOSEALL - MENUITEM "A&tualizar Tudo", M_REFRESHALL -END - -MENU_SET_NONE MENU DISCARDABLE -BEGIN - POPUP "E&xibir" - BEGIN - MENUITEM "Por &Volume", M_SET_VIEW_REPORT, CHECKED - MENUITEM "Por &Partição", M_SET_VIEW_TREELIST, CHECKED - MENUITEM "Sem &Detalhes", M_SET_VIEW_TREE, CHECKED - MENUITEM SEPARATOR - MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED - MENUITEM "&Todos os Ícones", M_VIEW_TWOICONS, CHECKED - MENUITEM "&Somente Status", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "&Criar Volume...", M_SET_CREATE - MENUITEM "&Restaurar do Arquivo...", M_SET_RESTORE - MENUITEM SEPARATOR - MENUITEM "Fazer &Backup de Volumes...", M_SET_CLONE - MENUITEM SEPARATOR - MENUITEM "&Desbloquear Todos", M_SET_UNLOCK - MENUITEM "A&tualizar Tudo", M_REFRESHALL -END - -MENU_COLUMNS MENU DISCARDABLE -BEGIN - MENUITEM "&Colunas...", M_COLUMNS -END - -MENU_SVC_BOS MENU DISCARDABLE -BEGIN - MENUITEM "&Reiniciar", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "E&xibir Arquivo de Log", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "A&tualizar", M_REFRESH - MENUITEM "&Propriedades", M_PROPERTIES -END - -MENU_SET_DRAGDROP MENU DISCARDABLE -BEGIN - MENUITEM "&Mover Aqui...", M_SET_MOVEHERE - MENUITEM "&Replicar Aqui...", M_SET_REPHERE - MENUITEM SEPARATOR - MENUITEM "&Cancelar", IDC_STATIC -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SERVICES DIALOGEX 0, 0, 179, 92 -STYLE DS_CENTER | WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Serviços:",IDC_SVC_DESC,0,5,179,8 - CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,0,17,179, - 61,WS_EX_STATICEDGE - PUSHBUTTON "&Criar...",IDC_SVC_CREATE,56,80,39,12 - PUSHBUTTON "E&xcluir",IDC_SVC_DELETE,98,80,39,12 - PUSHBUTTON "&Reiniciar",IDC_SVC_RESTART,140,80,39,12 -END - -IDD_AGGREGATES DIALOGEX 0, 0, 165, 84 -STYLE DS_CENTER | WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Partições:",IDC_AGG_DESC,0,5,165,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,0,17,165, - 53,WS_EX_STATICEDGE - PUSHBUTTON "&Criar Volume...",IDC_AGG_CREATESET,102,72,63,12 -END - -IDD_FILESETS DIALOGEX 0, 0, 194, 92 -STYLE DS_CENTER | WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Volumes:",IDC_SET_DESC,0,5,194,8 - CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,0,17,194, - 61,WS_EX_STATICEDGE - PUSHBUTTON "&Criar...",IDC_SET_CREATE,6,80,39,12 - PUSHBUTTON "E&xcluir",IDC_SET_DELETE,48,80,39,12 - PUSHBUTTON "&Replicação...",IDC_SET_REP,90,80,51,12 - PUSHBUTTON "Definir &Quota...",IDC_SET_SETQUOTA,144,80,49,12 -END - -IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, - 135,WS_EX_CLIENTEDGE - PUSHBUTTON "&Incluir Administrador",IDC_LIST_ADD,61,160,72,14 - PUSHBUTTON "&Remover Administrador",IDC_LIST_REMOVE,141,160,80,14 - LTEXT "Administradores para o servidor %1:",IDC_LIST_NAME,5,7, - 216,8 -END - -IDD_AGG_GENERAL DIALOGEX 0, 0, 267, 160 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "ID:",IDC_STATIC,5,30,31,8 - LTEXT "(consultando)",IDC_AGG_ID,47,30,214,8 - LTEXT "Dispositivo:",IDC_STATIC,5,46,37,8 - LTEXT "(consultando)",IDC_AGG_DEVICE,47,46,214,8 - LTEXT "Volumes:",IDC_STATIC,5,62,31,8 - LTEXT "(consultando)",IDC_AGG_FILESETS,47,62,214,8 - CONTROL "Exibir um aviso se a "a combinada dos volumes exceder a capacidade", - IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 11,76,246,10 - LTEXT "Uso:",IDC_STATIC,5,90,31,8 - LTEXT "(consultando)",IDC_AGG_USAGE,38,90,214,8 - CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,38,103,224,8, - WS_EX_STATICEDGE - CONTROL "Exibir um aviso se o uso da &partição exceder", - IDC_AGG_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38, - 116,214,10 - CONTROL "o limite padrão para este &servidor", - IDC_AGG_WARN_AGGFULL_DEF,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,49,131,203,9 - CONTROL "um &limite de",IDC_AGG_WARN_AGGFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,49,145,54,9 - EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,106,143,29,12, - ES_AUTOHSCROLL - LTEXT "% de seu tamanho",IDC_AGG_WARN_AGGFULL_DESC,152,145,100, - 8 - ICON IDI_AGGREGATE,IDC_STATIC,5,5,20,20 - LTEXT "Partição %2 (servidor %1)",IDC_AGG_NAME,38,14,214,8 -END - -IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Endereço IP:",IDC_STATIC,5,29,43,8 - LISTBOX IDC_SVR_ADDRESSES,53,29,70,12,LBS_NOSEL | NOT WS_BORDER | - WS_VSCROLL - PUSHBUTTON "Alterar &Endereços...",IDC_SVR_CHANGEADDR,144,27,77,12 - PUSHBUTTON "E&xigir Autenticação",IDC_SVR_AUTH_YES,36,85,84,12 - PUSHBUTTON "Permitir &Não Autenticado",IDC_SVR_AUTH_NO,130,85,85,14 - LTEXT "Número de partições:",IDC_STATIC,11,131,90,8 - LTEXT "(consultando)",IDC_SVR_NUMAGGREGATES,115,131,99,8 - LTEXT "Capacidade total:",IDC_STATIC,11,148,63,8 - LTEXT "(consultando)",IDC_SVR_CAPACITY,115,148,99,8 - LTEXT "Quota combinada dos volumes:",IDC_STATIC,11,165,100,8 - LTEXT "(consultando)",IDC_SVR_ALLOCATION,115,165,99,8 - ICON IDI_SERVER,IDC_STATIC,5,5,20,20 - LTEXT "(nome do servidor)",IDC_SVR_NAME,55,13,93,8 - GROUPBOX "Segurança",IDC_STATIC,5,52,216,52 - GROUPBOX "Armazenamento",IDC_STATIC,5,115,216,68 - LTEXT "Pode-se exigir que todo acesso a este servidor seja autenticado.", - IDC_STATIC,11,64,198,16 -END - -IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 221, 158 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "qualquer partição neste servidor se tornar", - IDC_SVR_WARN_AGGFULL,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,18,143,9 - EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,154,16,20,12,ES_AUTOHSCROLL - LTEXT "% cheia",IDC_STATIC,188,18,28,8 - CONTROL "qualquer volume neste servidor se tornar", - IDC_SVR_WARN_SETFULL,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,32,144,9 - EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,154,30,20,12,ES_AUTOHSCROLL - LTEXT "% cheio",IDC_STATIC,188,32,28,8 - CONTROL "a quota combinada em qualquer partição exceder sua capacidade", - IDC_SVR_WARN_AGGALLOC,"Button",BS_AUTOCHECKBOX | - BS_MULTILINE | WS_TABSTOP,5,46,200,14 - CONTROL "qualquer serviço neste servidor parar de executar", - IDC_SVR_WARN_SVCSTOP,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,64,195,9 - CONTROL "qualquer volume neste servidor não tiver entrada no VLDB", - IDC_SVR_WARN_SETNOVLDB,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,78,195,9 - CONTROL "o VLDB referenciar qualquer partição offline neste servidor", - IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,92,199,9 - CONTROL "o VLDB referenciar qualquer volume offline neste servidor", - IDC_SVR_WARN_SETNOSERV,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,107,195,9 - CONTROL "Atualizar informações do servidor a cada", - IDC_SVR_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,132,142,9 - EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,147,130,27,13,ES_AUTOHSCROLL - LTEXT "minutos",IDC_STATIC,190,132,25,8 - LTEXT "Exibir um aviso se",IDC_STATIC,5,5,195,8 -END - -IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 225, 207 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - PUSHBUTTON "E&xibir Log do Serviço",IDC_SVC_VIEWLOG,33,182,72,14 - PUSHBUTTON "&Iniciar Agora",IDC_SVC_START,113,182,48,14 - PUSHBUTTON "&Parar Agora",IDC_SVC_STOP,169,182,48,14 - CONTROL "Exibir um &aviso se este serviço alguma vez parar", - IDC_SVC_WARNSTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 11,159,200,10 - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "Serviço %2 (servidor %1)",IDC_SVC_NAME,52,13,168,8 - LTEXT "Tipo:",IDC_STATIC,5,29,44,12 - LTEXT "(consultando)",IDC_SVC_TYPE,52,29,168,12 - LTEXT "Parâmetros:",IDC_STATIC,5,45,44,12 - EDITTEXT IDC_SVC_PARAMS,53,45,157,12,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP - LTEXT "Notificador:",IDC_STATIC,5,61,44,12 - LTEXT "(consultando)",IDC_SVC_NOTIFIER,53,61,162,12 - LTEXT "Último Início:",IDC_STATIC,5,77,44,12 - LTEXT "(consultando)",IDC_SVC_STARTDATE,53,78,162,12 - LTEXT "Última Parada:",IDC_STATIC,5,93,48,10 - LTEXT "(consultando)",IDC_SVC_STOPDATE,53,93,162,12 - LTEXT "Última Falha:",IDC_STATIC,5,110,44,12 - EDITTEXT IDC_SVC_LASTERROR,53,110,158,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - GROUPBOX "Status do Serviço",IDC_STATIC,5,127,215,75 - LTEXT "O status atual deste serviço está sendo determinado...", - IDC_SVC_STATUS,11,142,200,8 -END - -IDD_SET_GENERAL DIALOGEX 0, 0, 273, 214 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "ID do Volume:",IDC_STATIC,5,30,46,8 - LTEXT "(desconhecido)",IDC_SET_ID,52,30,207,8 - LTEXT "Criado:",IDC_STATIC,5,46,39,8 - LTEXT "(consultando)",IDC_SET_CREATEDATE,52,46,208,8 - LTEXT "Atualizado:",IDC_STATIC,5,62,39,8 - LTEXT "(consultando)",IDC_SET_UPDATEDATE,52,62,216,8 - LTEXT "Acessado:",IDC_STATIC,5,78,39,8 - LTEXT "(consultando)",IDC_SET_ACCESSDATE,52,78,216,8 - LTEXT "Feito Backup:",IDC_STATIC,5,94,45,8 - LTEXT "(consultando)",IDC_SET_BACKUPDATE,52,94,212,8 - LTEXT "Contagem de Arquivos:",IDC_STATIC,5,106,45,16 - LTEXT "(consultando)",IDC_SET_FILES,52,110,193,8 - LTEXT "Status:",IDC_STATIC,5,126,39,8 - LTEXT "(consultando)",IDC_SET_STATUS,52,126,93,8 - PUSHBUTTON "&Bloquear",IDC_SET_LOCK,156,124,54,12 - PUSHBUTTON "&Desbloquear",IDC_SET_UNLOCK,214,124,54,12 - LTEXT "Uso:",IDC_STATIC,5,142,31,8 - LTEXT "(consultando)",IDC_SET_USAGE,52,142,136,8 - PUSHBUTTON "Definir &Quota...",IDC_SET_QUOTA,214,140,54,12 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,49,156,219,8, - WS_EX_STATICEDGE - CONTROL "Exibir um &aviso se o uso deste volume exceder", - IDC_SET_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,49, - 170,219,10 - CONTROL "o limite padrão para este &servidor (%1%% de seu tamanho)", - IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,61,185,207,9 - CONTROL "um &limite de",IDC_SET_WARN_SETFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,61,199,62,9 - EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,123,197,29,12, - ES_AUTOHSCROLL - LTEXT "% de seu tamanho",IDC_SET_WARN_SETFULL_DESC,163,199,105, - 8 - ICON IDI_FILESET,IDC_STATIC,5,5,20,20 - LTEXT "Volume %3 (servidor %1, partição %2)",IDC_SET_NAME,49, - 14,219,8 -END - -IDD_MAIN DIALOGEX 0, 0, 317, 226 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | - WS_SYSMENU | WS_THICKFRAME -CAPTION "Gerenciador de Servidor do AFS" -MENU MENU_MAIN -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Célula Selecionada:",IDC_STATIC,2,8,55,8 - LTEXT "(nome da célula será colocado aqui)",IDC_CELL,62,8,208, - 9 - LTEXT "Tokens do AFS:",IDC_STATIC,2,19,55,8 - LTEXT "%2:%1 (tokens expiram em %3)",IDC_AFS_ID,62,19,208,9 - CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,31,313, - 193,WS_EX_CLIENTEDGE - CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 - ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 -STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Servidor" -CLASS "ServerWindowClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_TABS," SysTabControl32",0x0,2,2,205,133 -END - -IDD_SVC_CREATE DIALOGEX 0, 0, 225, 233 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "&Servidor:",IDC_STATIC,5,36,44,8 - COMBOBOX IDC_SVC_SERVER,52,33,116,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Ser&viço:",IDC_STATIC,5,52,44,8 - COMBOBOX IDC_SVC_NAME,52,50,116,104,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Comando:",IDC_STATIC,5,70,44,8 - EDITTEXT IDC_SVC_COMMAND,52,68,168,13,ES_AUTOHSCROLL - LTEXT "&Parâmetros:",IDC_STATIC,5,88,44,8 - EDITTEXT IDC_SVC_PARAMS,52,86,168,13,ES_AUTOHSCROLL - LTEXT "&Notificador:",IDC_STATIC,5,105,44,8 - EDITTEXT IDC_SVC_NOTIFIER,52,103,168,13,ES_AUTOHSCROLL - LTEXT "Arquivo de &Log:",IDC_STATIC,5,122,44,16 - EDITTEXT IDC_SVC_LOGFILE,52,120,168,13,ES_AUTOHSCROLL - CONTROL "S&imples (executa continuamente)",IDC_SVC_TYPE_SIMPLE, - "Button",BS_AUTORADIOBUTTON,11,154,201,10 - CONTROL "Iniciar este serviço a&gora",IDC_SVC_RUNNOW,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 - CONTROL "&FS (sistema de arquivos)",IDC_SVC_TYPE_FS,"Button", - BS_AUTORADIOBUTTON,11,180,201,10 - CONTROL "C&ron (executa a intervalos especificados)", - IDC_SVC_TYPE_CRON,"Button",BS_AUTORADIOBUTTON,11,195,201, - 10 - LTEXT "&Quando executar:",IDC_STATIC,13,209,59,8 - COMBOBOX IDC_SVC_RUNDAY,75,207,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "às",IDC_STATIC,148,209,8,8 - CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,159,207, - 53,13,WS_EX_CLIENTEDGE - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "Novo serviço",IDC_SVC_DESC,52,13,168,8 - GROUPBOX "Tipo de Serviço",IDC_STATIC,5,141,215,87 -END - -IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, - 199,58,WS_EX_CLIENTEDGE - PUSHBUTTON "&Liberar Agora",IDC_SET_RELEASE,11,143,52,14 - PUSHBUTTON "&Criar...",IDC_SET_REPSITE_ADD,129,143,38,14 - PUSHBUTTON "E&xcluir",IDC_SET_REPSITE_DELETE,172,143,38,14 - LTEXT "Servidor:",-1,11,31,37,8 - LTEXT "(nome do servidor)",IDC_SET_SERVER,55,31,147,8 - LTEXT "Partição:",-1,11,44,37,8 - LTEXT "(nome da partição)",IDC_SET_AGGREGATE,55,44,147,8 - LTEXT "Volume:",-1,11,18,37,8 - LTEXT "(nome do volume)",IDC_SET_NAME,55,18,147,8 - GROUPBOX "Volume de Leitura/Gravação",-1,5,5,211,56 - GROUPBOX "Réplicas do Volume",-1,5,67,211,96 -END - -IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 254 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Selecionar Célula - Gerenciador de Servidor do AFS" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Célula:",IDC_STATIC,4,24,24,8 - COMBOBOX IDC_OPENCELL_CELL,28,22,187,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - GROUPBOX "Autenticação do AFS",IDC_STATIC,4,44,211,95 - LTEXT "&Identidade do AFS:",IDC_STATIC,15,105,61,8 - EDITTEXT IDC_OPENCELL_ID,80,103,129,14,ES_AUTOHSCROLL - LTEXT "&Senha do AFS:",IDC_STATIC,15,121,55,8 - EDITTEXT IDC_OPENCELL_PASSWORD,80,119,129,14,ES_PASSWORD | - ES_AUTOHSCROLL - PUSHBUTTON "A&vançado >>",IDC_ADVANCED,4,146,53,14 - DEFPUSHBUTTON "OK",IDOK,86,146,41,14 - PUSHBUTTON "Cancelar",IDCANCEL,130,146,41,14 - PUSHBUTTON "&Ajuda",9,174,146,41,14 - CONTROL "Monitorar &todos os servidores nesta célula", - IDC_MON_ALL,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10, - 202,185,9 - CONTROL "&Monitorar somente um servidor:",IDC_MON_ONE,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,10,215,110,10 - EDITTEXT IDC_MON_SERVER,125,214,83,13,ES_AUTOHSCROLL - CONTROL "Monitorar somente os servidores no s&ubconjunto:", - IDC_MON_SOME,"Button",BS_AUTORADIOBUTTON | BS_MULTILINE | - WS_TABSTOP,10,229,110,17 - COMBOBOX IDC_MON_SUBSET,125,231,83,93,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Selecione a célula do AFS com a qual deseja trabalhar.", - IDC_STATIC,4,7,200,8 - GROUPBOX "Monitorar Servidores",IDC_ADVANCED_GROUP,4,166,211,84 - LTEXT "Para melhor desempenho, pode-se escolher monitorar somente um subconjunto dos servidores disponíveis nesta célula.", - IDC_STATIC,10,180,199,17 - LTEXT "(consultando...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "Para administrar uma célula, é preciso informar novamente sua senha do AFS:", - IDC_STATIC,10,81,196,17 - LTEXT "Seus tokens do AFS atuais dentro da célula selecionada:", - IDC_STATIC,10,57,196,8 -END - -IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Aviso - Gerenciador de Servidor do AFS" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "&Continuar aguardando até que a tarefa conclua normalmente", - IDC_TIMEOUT_WAIT,"Button",BS_AUTORADIOBUTTON,24,89,208, - 10 - CONTROL "&Terminar a tarefa",IDC_TIMEOUT_KILL,"Button", - BS_AUTORADIOBUTTON,24,103,208,10 - DEFPUSHBUTTON "OK",IDOK,93,139,50,14 - LTEXT "Tempo decorrido de execução da tarefa:",IDC_STATIC,4, - 119,142,8 - LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,151,119,29,8 - LTEXT "O Gerenciador de Servidor do AFS esteve aguardando por um tempo inesperadamente longo que uma tarefa da rede fosse concluída.", - IDC_STATIC,4,7,228,18 - LTEXT "Você pode deixar que a tarefa seja executada (recomendado) ou, se tiver confiança que a tarefa nunca vai terminar, permitir que o Gerenciador de Servidor do AFS termine a tarefa.", - IDC_STATIC,4,30,228,26 - LTEXT "Note que a tarefa ainda está em andamento enquanto esta janela está sendo exibida: se a tarefa concluir, esta janela fechará automaticamente.", - IDC_STATIC,4,60,228,25 -END - -IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 -STYLE WS_POPUP | WS_CAPTION -CAPTION "Colunas" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Selecionar colunas a exibir ao listar:",IDC_STATIC,5,7, - 126,8 - COMBOBOX IDC_COLUMNS,134,5,147,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Colunas &Disponíveis:",IDC_STATIC,12,40,100,8 - LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "Colunas a E&xibir:",IDC_STATIC,173,41,100,8 - LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "&Incluir >>",IDC_COL_INSERT,119,68,46,14 - PUSHBUTTON "<< &Remover",IDC_COL_DELETE,119,88,46,14 - PUSHBUTTON "Mover para &Cima",IDC_COL_UP,149,122,60,14 - PUSHBUTTON "Mover para &Baixo",IDC_COL_DOWN,215,122,60,14 - GROUPBOX "Listar Colunas",IDC_STATIC,5,25,276,118 -END - -IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 264, 72 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Atualizando - Gerenciador de Servidor do AFS" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, - 256,8 - LTEXT "0%% concluído",IDC_REFRESH_PERCENT,4,49,216,8 - LTEXT "",IDC_REFRESH_CURRENT,4,60,216,8 - LTEXT "Aguarde...",IDC_REFRESH_DESC,4,7,256,25 - PUSHBUTTON "&Saltar",IDC_REFRESH_SKIP,222,58,38,12,NOT WS_TABSTOP -END - -IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Criar Volume" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "&Nome:",IDC_STATIC,4,30,39,8 - EDITTEXT IDC_SET_NAME,46,28,116,14,ES_AUTOHSCROLL - LTEXT "&Quota:",IDC_STATIC,4,48,39,8 - EDITTEXT IDC_SET_QUOTA,46,46,32,14,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,90,47,30,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "&Backup:",IDC_STATIC,4,66,39,8 - CONTROL "&Criar também uma versão de backup deste volume", - IDC_SET_CLONE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,46, - 66,181,8 - LTEXT "&Servidor:",IDC_STATIC,4,84,39,8 - COMBOBOX IDC_SET_SERVER,46,82,116,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Partição:",IDC_STATIC,4,102,39,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,46,102,271, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "OK",IDOK,156,191,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,211,191,50,14 - PUSHBUTTON "&Ajuda",9,267,191,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "Novo volume",IDC_STATIC,46,12,170,8 -END - -IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 277, 102 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Excluir Volume" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "Cancelar",IDCANCEL,169,84,50,14 - PUSHBUTTON "OK",IDOK,115,84,50,14 - PUSHBUTTON "&Ajuda",9,223,84,50,14 - CONTROL "&Excluir o volume %3 do servidor %1, partição %2", - IDC_DELSET_SERVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 16,45,251,10 - CONTROL "Excluir a entrada no &VLDB para o volume %3", - IDC_DELSET_VLDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16, - 60,251,10 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "Atenção!\n\nEsta operação excluirá permanentemente o volume %3.", - IDC_DELSET_DESC,31,7,242,33 -END - -IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Fazer Backup de Volume - Gerenciador de Servidor do AFS" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "OK",IDOK,183,67,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,237,67,50,14 - PUSHBUTTON "&Ajuda",9,291,67,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "Um backup de volume atua como uma cópia somente de leitura desse volume. Um volume de leitura/gravação pode ter somente uma versão de backup.", - IDC_STATIC,34,9,307,17 - LTEXT "Clique em OK para criar um backup do volume %3 no servidor %1, partição %2. Se já existir um backup desse volume, ele será atualizado.", - IDC_CLONE_DESC,34,32,307,28 -END - -IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "Problemas Conhecidos",IDC_PROBLEM_BOX,5,36,215,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,138,120,61,12 - ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "Serviço %2 (servidor %1)",IDC_PROBLEM_TITLE,52,13,168,8 -END - -IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "Problemas Conhecidos",IDC_PROBLEM_BOX,5,36,216,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,172,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,201,49,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,136,120,61,12 - ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "%1",IDC_PROBLEM_TITLE,42,13,179,8 -END - -IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "Problemas Conhecidos",IDC_PROBLEM_BOX,5,35,247,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,170,119,61,12 - ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "Partição %2 (servidor %1)",IDC_PROBLEM_TITLE,38,14,214, - 8 -END - -IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - GROUPBOX "Problemas Conhecidos",IDC_PROBLEM_BOX,5,35,263,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,249,48,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 - ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "Volume %3 (servidor %1, partição %2)",IDC_PROBLEM_TITLE, - 49,14,219,8 -END - -IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Mover Volume" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,70,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "OK",IDOK,115,156,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,169,156,50,14 - PUSHBUTTON "&Ajuda",9,223,156,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,21,20 - LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,242,24 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 - LTEXT "&Mover volume para:",IDC_STATIC,4,43,116,8 -END - -IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "Movendo Volume - Gerenciador de Servidor do AFS" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_ANIMATE," SysAnimate32",WS_TABSTOP | 0x6,0,0,229, - 33 - LTEXT "Movendo o volume %3 da partição %2 no servidor %1 para a partição %5 no servidor %4...", - IDC_MOVESET_DESC,4,41,229,19 -END - -IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 277, 106 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Exibir Arquivo de Log" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Exibir arquivo de log no &servidor:",IDC_STATIC,4,45, - 107,8 - COMBOBOX IDC_VIEWLOG_SERVER,114,43,126,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "&Arquivo no servidor a exibir:",IDC_STATIC,4,64,87,8 - EDITTEXT IDC_VIEWLOG_FILENAME,97,62,176,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,169,88,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,223,88,50,14 - ICON IDI_SERVICE,IDC_STATIC,4,4,20,20 - LTEXT "Digite o caminho completo do arquivo de log que deseja exibir.", - IDC_VIEWLOG_DESC,31,10,242,21 -END - -IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 286, 185 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Exibir Arquivo de Log" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Conteúdo do arquivo:",IDC_SVC_VIEWLOG_CONTENTS,4,41,277, - 8 - EDITTEXT IDC_VIEWLOG_TEXT,4,51,277,113,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL - PUSHBUTTON "Salvar &Como:",IDC_VIEWLOG_SAVEAS,173,167,53,14 - DEFPUSHBUTTON "&Fechar",IDOK,231,167,50,14 - ICON IDI_SERVICE,-1,4,7,20,20 - LTEXT "Arquivo de log [para o serviço %2] no servidor %1", - IDC_SVC_VIEWLOG_DESC,33,7,248,8 - LTEXT "Nome do arquivo no servidor: %1", - IDC_SVC_VIEWLOG_FILENAME,33,23,248,8 -END - -IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Definir Quota do Volume" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Quota Atual:",IDC_STATIC,4,49,47,8 - LTEXT "(desconhecida)",IDC_SET_USAGE,59,49,208,8 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,59,60,208,8, - WS_EX_STATICEDGE - LTEXT "Nova &Quota:",IDC_STATIC,4,81,47,8 - EDITTEXT IDC_SET_QUOTA,59,79,32,13,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,103,79,30,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "OK",IDOK,109,112,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,163,112,50,14 - PUSHBUTTON "&Ajuda",9,217,112,50,14 - PUSHBUTTON "&Propriedades...",IDC_AGG_PROPERTIES,212,28,55,12 - LTEXT "Partição:",IDC_STATIC,4,30,47,8 - LTEXT "Partição %2 do servidor %1",IDC_SET_AGGREGATE,59,30,141, - 8 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "Volume %1",IDC_SET_NAME,59,11,208,8 -END - -IDD_ACTIONS DIALOGEX 0, 0, 236, 58 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "Operações em Andamento - Gerenciador de Servidor do AFS" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "As seguintes operações estão em andamento:", - IDC_ACTION_DESC,2,2,232,8 - CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | - 0x3,2,14,232,43 -END - -IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Sincronizar VLDB" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "OK",IDOK,107,81,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,161,81,50,14 - PUSHBUTTON "&Ajuda",9,215,81,50,14 - ICON 32515,IDC_STATIC,4,4,21,20 - LTEXT "(definido no runtime)",IDC_SYNC_DESC,37,4,228,32 - LTEXT "(definido no runtime)",IDC_SYNC_DESC2,37,44,228,24 -END - -IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Replicar Volume" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,62,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "OK",IDOK,115,153,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,169,153,50,14 - PUSHBUTTON "&Ajuda",9,223,153,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,21,20 - LTEXT "Nova réplica do volume %3",IDC_SET_NAME,31,12,242,8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 - LTEXT "&Criar uma nova réplica deste volume em:",IDC_STATIC,4, - 35,125,8 -END - -IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 263, 157 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Instalar Arquivo" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Ar&quivo de origem:",IDC_STATIC,4,74,62,8 - EDITTEXT IDC_FILENAME,71,72,135,14,ES_AUTOHSCROLL - PUSHBUTTON "&Procurar...",IDC_BROWSE,209,72,50,14 - LTEXT "&Servidor de destino:",IDC_STATIC,4,94,63,8 - COMBOBOX IDC_SERVER,71,92,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Nome de destino:",IDC_STATIC,4,114,62,8 - EDITTEXT IDC_DIRECTORY,71,112,135,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,101,139,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,155,139,50,14 - PUSHBUTTON "&Ajuda",9,209,139,50,14 - ICON IDI_INSTALL,IDC_STATIC,4,4,21,20 - LTEXT "Instalar arquivo no servidor",IDC_STATIC,32,12,127,8 - LTEXT "(texto definido no runtime)\n(texto definido no runtime)\n(texto definido no runtime)\n(texto definido no runtime)", - IDC_INSTALL_DESC,4,29,255,33 -END - -IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Remover Instalação de Arquivo" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Servidor:",IDC_STATIC,4,66,35,8 - COMBOBOX IDC_SERVER,67,64,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Arquivo de destino:",IDC_STATIC,4,85,63,8 - EDITTEXT IDC_FILENAME,67,83,175,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,88,121,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,141,121,50,14 - PUSHBUTTON "&Ajuda",9,194,121,50,14 - ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 - LTEXT "Remover instalação do arquivo do servidor",IDC_STATIC, - 32,12,140,8 - LTEXT "Esta operação permite restaurar uma cópia anteriormente instalada de um arquivo em um servidor específico. Se não existir nenhuma cópia instalada anteriormente do arquivo selecionado, o arquivo será removido.", - IDC_STATIC,4,29,240,26 -END - -IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 200, 141 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Eliminar Arquivos Antigos" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Servidor:",-1,8,56,40,8 - COMBOBOX IDC_SERVER,53,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Excluir todos os arquivos de &núcleo", - IDC_OP_DELETE_CORE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 53,70,143,10 - CONTROL "Excluir todos os arquivos .&BAK (backups de arquivos)", - IDC_OP_DELETE_BAK,"Button",BS_AUTOCHECKBOX | - BS_MULTILINE | WS_TABSTOP,53,82,143,17 - CONTROL "Excluir todos os arquivos .&OLD (backups mais antigos de arquivos)", - IDC_OP_DELETE_OLD,"Button",BS_AUTOCHECKBOX | - BS_MULTILINE | WS_TABSTOP,53,101,143,17 - DEFPUSHBUTTON "OK",IDOK,39,123,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,93,123,50,14 - PUSHBUTTON "&Ajuda",9,146,123,50,14 - ICON IDI_PRUNE,-1,4,4,20,20 - LTEXT "Eliminar arquivos antigos do servidor",-1,32,12,136,8 - LTEXT "Esta operação exclui cópias de backup de arquivos instalados em um servidor específico.", - -1,4,29,192,16 - LTEXT "Arquivos a excluir:",-1,8,70,45,16 -END - -IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Renomear Volume" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Nome &Antigo:",IDC_STATIC,25,67,43,8 - EDITTEXT IDC_RENSET_OLD,74,65,122,14,ES_AUTOHSCROLL | ES_READONLY - LTEXT "&Novo nome:",IDC_STATIC,25,85,39,8 - EDITTEXT IDC_RENSET_NEW,74,83,122,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,115,115,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,169,115,50,14 - PUSHBUTTON "Ajuda",9,223,115,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "Para renomear o volume %3, digite abaixo um novo nome. Renomear altera automaticamente o nome do backup de um volume e de suas réplicas.\n\nAtenção: se você renomear um volume montado, será preciso excluir e recriar seu ponto de montagem.", - IDC_RENSET_DESC,31,7,242,48 -END - -IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 277, 68 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Excluir Serviço" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "Cancelar",IDCANCEL,169,50,50,14 - PUSHBUTTON "OK",IDOK,115,50,50,14 - PUSHBUTTON "Ajuda",9,223,50,50,14 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "Atenção!\n\nEsta operação fará com que o serviço %2 seja interrompido e excluído do servidor %1.", - IDC_DELSVC_DESC,31,7,242,33 -END - -IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Obter Datas de Arquivo" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Servidor:",-1,6,56,42,8 - COMBOBOX IDC_SERVER,72,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Arquivo a consultar:",-1,6,75,63,8 - EDITTEXT IDC_FILENAME,72,73,135,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,86,107,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,140,107,50,14 - PUSHBUTTON "&Ajuda",9,194,107,50,14 - ICON IDI_GETDATES,-1,4,4,20,20 - LTEXT "Obter datas de arquivos no servidor",-1,32,12,127,8 - LTEXT "Esta operação obtém a data em que um arquivo e seus backups (se existirem) foram modificados por último.", - -1,4,29,240,16 -END - -IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Obter Datas de Arquivo - Resultados" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Servidor:",IDC_STATIC,4,30,39,8 - LTEXT "(definido no runtime)",IDC_SERVER,65,30,137,8 - LTEXT "Nome do Arquivo:",IDC_STATIC,4,45,58,8 - LTEXT "(definido no runtime)",IDC_FILENAME,65,45,137,8 - LTEXT "Data do arquivo:",IDC_STATIC,4,60,53,8 - LTEXT "(desconhecida: o arquivo não foi encontrado)", - IDC_DATE_FILE,65,60,176,8 - LTEXT "Data de .BAK:",IDC_STATIC,4,75,48,8 - LTEXT "(desconhecida: o arquivo não foi encontrado)", - IDC_DATE_BAK,65,75,176,8 - LTEXT "Data de .OLD:",IDC_STATIC,4,90,49,8 - LTEXT "(desconhecida: o arquivo não foi encontrado)", - IDC_DATE_OLD,65,90,176,8 - DEFPUSHBUTTON "&Fechar",IDOK,99,114,50,14 - ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 - LTEXT "Obter datas de arquivos no servidor",IDC_STATIC,32,12, - 127,8 -END - -IDD_SET_DUMP DIALOGEX 0, 0, 295, 144 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Descarregar Volume - Gerenciador de Servidor do AFS" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Criar arquivo de descarga &chamado",IDC_STATIC,6,39,77, - 17 - EDITTEXT IDC_DUMP_FILENAME,86,40,151,14,ES_AUTOHSCROLL - PUSHBUTTON "&Procurar...",IDC_DUMP_BROWSE,240,40,50,14 - CONTROL "Descarregar &todo o conteúdo do volume %3 (partição %1:%2)", - IDC_DUMP_FULL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,5, - 78,274,10 - CONTROL "Descarregar somente arquivos alterados &desde", - IDC_DUMP_LIMIT_TIME,"Button",BS_AUTORADIOBUTTON,5,94,160, - 10 - CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,169,93,51, - 13,WS_EX_CLIENTEDGE - CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,227,93,56, - 13,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "OK",IDOK,131,126,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,185,126,50,14 - PUSHBUTTON "&Ajuda",9,240,126,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,21,20 - LTEXT "Esta operação copia o conteúdo de um volume para um arquivo único, de forma que se pode fazer facilmente o backup de um volume. O conteúdo de volumes descarregados desta forma pode ser restaurado mais tarde.", - IDC_STATIC,29,7,261,24 - GROUPBOX "Parâmetros de Descarga",IDC_STATIC,4,62,286,53 -END - -IDD_SET_RESTORE DIALOGEX 0, 0, 292, 248 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Restaurar Volume - Gerenciador de Servidor do AFS" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Arquivo a &restaurar:",IDC_STATIC,4,33,48,19 - EDITTEXT IDC_RESTORE_FILENAME,57,30,175,14,ES_AUTOHSCROLL - PUSHBUTTON "&Procurar...",IDC_RESTORE_BROWSE,238,30,50,14 - CONTROL "Este é um arquivo de descarga de &incremento", - IDC_RESTORE_INCREMENTAL,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,57,46,175,10 - LTEXT "&Volume:",IDC_STATIC,11,102,23,8 - EDITTEXT IDC_RESTORE_SETNAME,50,100,115,14,ES_AUTOHSCROLL - LTEXT "&Servidor:",IDC_STATIC,11,145,33,8 - COMBOBOX IDC_RESTORE_SERVER,51,143,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "&Partição:",IDC_STATIC,11,162,36,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,50,161,231, - 55,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "OK",IDOK,128,230,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,183,230,50,14 - PUSHBUTTON "&Ajuda",9,238,230,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "Restaurar volume do arquivo de descarga",IDC_STATIC,33, - 11,224,8 - GROUPBOX "Volume de destino",IDC_STATIC,4,63,284,160 - LTEXT "Quando se restaura um volume de um arquivo de descarga, pode-se criar um novo volume ou sobrepor um volume existente de leitura/gravação.", - IDC_STATIC,11,78,259,16 - LTEXT "(definido no runtime)\n(definido no runtime)", - IDC_RESTORE_CREATE,51,119,229,17 -END - -IDD_SVC_BOS DIALOGEX 0, 0, 225, 207 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "&Periodicamente parar e reiniciar todos os serviços neste servidor", - IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | - WS_TABSTOP,11,72,193,14 - LTEXT "&Reiniciar",IDC_BOS_GENRES_DESC1,20,91,30,8 - COMBOBOX IDC_BOS_GENRES_DATE,54,89,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "à&s",IDC_BOS_GENRES_DESC2,127,91,13,8 - CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,143, - 89,53,13,WS_EX_CLIENTEDGE - CONTROL "Periodicamente testar todos os serviços neste servidor para novos &binários", - IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | - WS_TABSTOP,11,149,201,17 - LTEXT "&Testar",IDC_BOS_BINRES_DESC1,23,174,25,8 - COMBOBOX IDC_BOS_BINRES_DATE,54,171,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "às",IDC_BOS_BINRES_DESC2,127,174,8,8 - CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,143, - 171,53,13,WS_EX_CLIENTEDGE - ICON IDI_BOSSERVICE,IDC_STATIC,5,5,20,20 - LTEXT "Serviço %2 (servidor %1)",IDC_SVC_NAME,44,13,176,8 - GROUPBOX "Serviço BOS",IDC_STATIC,5,27,215,175 - LTEXT "O serviço BOS pode ser usado para parar e reiniciar periodicamente todos os serviços neste servidor (inclusive o próprio serviço BOS).", - IDC_STATIC,11,41,200,27 - LTEXT "O serviço BOS também pode ser usado para testar periodicamente todos os serviços em um servidor, parando e reiniciando somente aqueles cujos arquivos binários forem atualizados.", - IDC_STATIC,11,112,200,32 -END - -IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "Descarregando Volume - Gerenciador de Servidor do AFS" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_ANIMATE," SysAnimate32",WS_TABSTOP | 0x6,0,0,229, - 33 - LTEXT "Criando arquivo de descarga %4 do volume %3...", - IDC_DUMPSET_DESC,4,41,229,19 -END - -IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "Restaurando Volume - Gerenciador de Servidor do AFS" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "",IDC_ANIMATE," SysAnimate32",WS_TABSTOP | 0x6,0,0,229, - 33 - LTEXT "Restaurando o volume %1 do arquivo de descarga %2...", - IDC_RESTORESET_DESC,4,41,229,19 -END - -IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 258, 163 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Fazer Backup de Volumes - Gerenciador de Servidor do AFS" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "Criar versões de backup de &todos os volumes nesta célula", - IDC_CLONE_ALL,"Button",BS_AUTORADIOBUTTON,25,48,214,10 - GROUPBOX " ",IDC_STATIC,23,63,231,77 - CONTROL "Somente criar &backups para os volumes que correspondam aos seguintes critérios:", - IDC_CLONE_SOME,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,25,59,214,18 - CONTROL "Somente volumes no &servidor:",IDC_CLONE_SVR_LIMIT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,84,115,10 - COMBOBOX IDC_CLONE_SVR,158,83,85,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Somente volumes na &partição:",IDC_CLONE_AGG_LIMIT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,100,113,10 - COMBOBOX IDC_CLONE_AGG,158,99,85,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Somente volumes &começando com:",IDC_CLONE_PREFIX_LIMIT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,117,125,10 - EDITTEXT IDC_CLONE_PREFIX,158,116,85,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,95,145,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,149,145,50,14 - PUSHBUTTON "&Ajuda",9,204,145,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "Um backup de volume atua como uma cópia somente de leitura desse volume. Somente um volume de leitura/gravação pode ter uma versão de backup.\nPode-se criar versões de backup para mais de um volume ao mesmo tempo.", - IDC_STATIC,30,7,214,40 -END - -IDD_SUBSETS DIALOGEX 0, 0, 297, 183 -STYLE WS_POPUP | WS_CAPTION -CAPTION "Servidores Monitorados" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Nome do subconjunto:",IDC_STATIC,10,77,74,8 - EDITTEXT IDC_SUBSET_NAME,85,75,113,14,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_TABSTOP - PUSHBUTTON "&Abrir...",IDC_SUBSET_LOAD,204,75,39,14 - PUSHBUTTON "&Salvar...",IDC_SUBSET_SAVE,248,75,39,14 - CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x153,12,111,193,58,WS_EX_CLIENTEDGE - PUSHBUTTON "Monitorar &Todos",IDC_SUBSET_ALL,211,122,78,14 - PUSHBUTTON "Não Monitorar &Nenhum",IDC_SUBSET_NONE,211,140,78,14 - LTEXT "Para melhorar o desempenho ao trabalhar numa célula grande, pode-se optar por não monitorar certos servidores. O Gerenciador de Servidor do AFS não mostrará os volumes, partições ou serviços em nenhum servidor que não seja monitorado.", - IDC_STATIC,5,5,287,24 - LTEXT "Pode-se escolher monitorar (ou não) um servidor por vez. É possível criar subconjuntos de servidores para designar listas de servidores que devem ser monitorados.", - IDC_STATIC,5,34,287,26 - GROUPBOX "Subconjunto Atual",IDC_STATIC,5,64,287,114 - LTEXT "Servidores a Monitorar:",IDC_STATIC,10,95,89,8 -END - -IDD_SUBSET_LOADSAVE DIALOGEX 0, 0, 300, 146 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | - WS_CAPTION | WS_SYSMENU -CAPTION "(título definido no runtime)" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "&Nome do Subconjunto:",1090,5,112,78,8,SS_NOTIFY - EDITTEXT IDC_SUBSET_NAME,84,110,156,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "&Abrir",IDOK,246,110,50,14 - PUSHBUTTON "Cance&lar",IDCANCEL,246,128,50,14 - CONTROL "List1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | - LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,292,82, - WS_EX_CLIENTEDGE - PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT - WS_TABSTOP - PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT - WS_TABSTOP - LTEXT "Subconjuntos já definidos para esta célula:",IDC_STATIC, - 4,6,155,8 -END - -IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Procurar Comando" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - COMBOBOX IDC_FIND_COMMAND,4,38,137,170,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Exibir &Ajuda",IDOK,147,38,67,14 - PUSHBUTTON "&Cancelar",IDCANCEL,147,55,67,14 - LTEXT "Para descobrir como usar o Gerenciador de Servidor do AFS para realizar uma tarefa, selecione uma linha de comando abaixo e clique no botão Exibir Ajuda.", - IDC_STATIC,4,4,210,25 -END - -IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 141 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Pesquisar Código de Erro" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Número do &Erro:",IDC_STATIC,4,41,51,8 - EDITTEXT IDC_ERROR_NUMBER,59,39,78,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "&Converter",IDC_ERROR_TRANSLATE,147,39,67,14 - PUSHBUTTON "&Fechar",IDCANCEL,85,123,48,14 - LTEXT "(texto definido no runtime)",IDC_ERROR_DESC,4,64,210,55 - LTEXT "Para descobrir o que significa um código de erro, digite o código abaixo e clique no botão ""Converter"".", - IDC_STATIC,4,4,210,25 - CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 -END - -IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Sobre o Gerenciador de Servidor do AFS" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 - LTEXT "Gerenciador de Servidor do AFS versão 3.5",IDC_STATIC, - 33,8,163,8 - LTEXT "Copyright © IBM Corporation 1989, 1999",IDC_STATIC,33, - 20,183,8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 - CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 - PUSHBUTTON "&Fechar",IDOK,89,123,50,14 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 -END - -IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "O Gerenciador de Servidor do AFS está procurando servidores na célula %1...", - IDC_OPENCELL_DESC,41,15,183,16 - GROUPBOX "",IDC_STATIC,4,2,231,39 - ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 279, 136 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - CONTROL "Exibir nomes completos de domínio para servidores (tais como, ""machine.company.com"")", - IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | - BS_MULTILINE | WS_TABSTOP,5,2,269,17 - CONTROL "Exibir um &aviso ao trabalhar sem tokens administrativos", - IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,20,269,10 - CONTROL "...sempre mostra as propriedades desse servidor", - IDC_OPT_SVR_DBL_PROP,"Button",BS_AUTORADIOBUTTON,17,42, - 253,10 - CONTROL "...mostra as propriedades desse servidor somente se o Painel de Exibição Rápida estiver aberto", - IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,17,52,253,15 - CONTROL "...sempre abre uma janela para esse servidor", - IDC_OPT_SVR_DBL_OPEN,"Button",BS_AUTORADIOBUTTON,17,67, - 253,10 - CONTROL "...abrir uma janela de servidor faz com que esse servidor seja monitorado", - IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,17,98,253,10 - CONTROL "...fechar uma janela de servidor faz com que esse servidor deixe de ser monitorado", - IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | - BS_MULTILINE | WS_TABSTOP,17,109,253,17 - LTEXT "Dar um clique duplo no ícone de um servidor...", - IDC_STATIC,5,32,269,8 - LTEXT "Se um subconjunto de servidores estiver em uso e o painel de Exibição Rápida estiver fechado...", - IDC_STATIC,5,80,269,16 -END - -IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,22,216, - 135,WS_EX_CLIENTEDGE - PUSHBUTTON "&Incluir Chave do Servidor",IDC_KEY_ADD,17,160,98,14 - PUSHBUTTON "&Remover Chave do Servidor",IDC_KEY_REMOVE,123,160,98, - 14 - LTEXT "Chaves para o servidor:",IDC_KEY_NAME,5,7,216,8 -END - -IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Incluir chave do Servidor" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Versão:",IDC_STATIC,7,37,26,8 - EDITTEXT IDC_KEY_VERSION,43,35,43,14,ES_AUTOHSCROLL - LTEXT "Valor:",IDC_STATIC,7,58,21,8 - CONTROL "Criptografar esta cadeia:",IDC_KEY_BYSTRING,"Button", - BS_AUTORADIOBUTTON,27,58,90,10 - CONTROL "Usar esta chave:",IDC_KEY_BYDATA,"Button", - BS_AUTORADIOBUTTON,27,76,73,10 - EDITTEXT IDC_KEY_STRING,119,56,155,14,ES_PASSWORD | - ES_AUTOHSCROLL - EDITTEXT IDC_KEY_DATA,119,75,103,14,ES_AUTOHSCROLL - PUSHBUTTON "&Aleatória",IDC_KEY_RANDOM,226,75,48,14 - LTEXT "Lembrete: após incluir uma chave para um servidor, deve-se modificar a conta do AFS para usar a nova chave. Após alguns dias, pode-se remover quaisquer chaves antigas do servidor.", - IDC_STATIC,7,99,267,25 - DEFPUSHBUTTON "OK",IDOK,116,129,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,170,129,50,14 - PUSHBUTTON "Ajuda",9,224,129,50,14 - LTEXT "Nova chave para o servidor %1",IDC_KEY_TITLE,43,14,181, - 8 - ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 -END - -IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 319, 133 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Iniciar/Parar Serviço" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "OK",IDOK,115,115,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,169,115,50,14 - PUSHBUTTON "&Ajuda",9,265,115,50,14 - ICON IDI_SERVICE,IDC_STATIC,4,7,21,20 - LTEXT "Clique em OK para iniciar/parar o serviço %2 no servidor %1.", - IDC_STARTSTOP_TEXT,73,12,242,9 - CONTROL "&Permanente (IDS_START/STOPSERVICE_PERMANENT)", - IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON,37, - 68,272,10 - CONTROL "&Temporária (IDS_START/STOPSERVICE_TEMPORARY)", - IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON,37, - 83,270,10 - GROUPBOX "Inicialização do Serviço",IDC_STATIC,31,31,284,70 - LTEXT "Pode-se tornar esta alteração permanente, de modo que o serviço %2 inicie (ou não) automaticamente se o servidor %1 for reiniciado.", - IDC_STARTSTOP_STARTUP,38,45,223,16 -END - -IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 248, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Executar Comando" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Servidor:",IDC_STATIC,4,60,42,8 - COMBOBOX IDC_SERVER,50,58,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Comando:",IDC_STATIC,4,79,42,8 - EDITTEXT IDC_COMMAND,50,77,194,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,86,107,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,140,107,50,14 - PUSHBUTTON "&Ajuda",9,194,107,50,14 - ICON IDI_SERVER,IDC_STATIC,4,4,20,20 - LTEXT "Executar comando no servidor",IDC_STATIC,32,12,185,8 - LTEXT "Esta operação permite emitir um comando em um servidor remoto.\nNormalmente é usada para reiniciar um servidor executando o script /etc/reboot.", - IDC_STATIC,4,29,240,24 -END - -IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 254, 271 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Recuperar Volumes - Gerenciador de Servidor do AFS" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "&Servidor:",IDC_STATIC,9,50,35,8 - COMBOBOX IDC_SERVER,46,48,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Partição:",IDC_STATIC,9,67,35,8 - COMBOBOX IDC_AGGREGATE,46,65,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Re&cuperar todas as partições",IDC_AGGREGATE_ALL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,138,65,108,11 - LTEXT "V&olume:",IDC_STATIC,8,85,35,8 - COMBOBOX IDC_FILESET,46,83,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Rec&uperar todos os volumes",IDC_FILESET_ALL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,138,84,105,10 - DEFPUSHBUTTON "OK",IDOK,85,104,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,142,104,50,14 - PUSHBUTTON "&Ajuda",9,199,104,50,14 - PUSHBUTTON "A&vançado >>",IDC_ADVANCED,4,104,53,14 - LTEXT "Caminho para arquivos &temporários:",IDC_STATIC,10,125, - 74,17 - EDITTEXT IDC_SALVAGE_TEMPDIR,100,124,144,13,ES_AUTOHSCROLL - CONTROL "Operações Pa&ralelas de recuperação; número de processos:", - IDC_SALVAGE_SIMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 8,159,205,10 - EDITTEXT IDC_SALVAGE_NUM,213,156,19,13,ES_AUTOHSCROLL - CONTROL "&Não recuperar volumes danificados", - IDC_SALVAGE_READONLY,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,8,169,123,10 - CONTROL "&Quebrar operações de leitura em pequenos blocos", - IDC_SALVAGE_BLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 8,179,180,10 - CONTROL "&Forçar recuperação de todos os volumes indicados", - IDC_SALVAGE_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 8,189,181,10 - CONTROL "Forçar r&econstrução da estrutura de diretórios", - IDC_SALVAGE_FIXDIRS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,8,199,157,10 - LTEXT "Nome do arquivo para o &log de resultados:",IDC_STATIC, - 10,214,74,17 - EDITTEXT IDC_SALVAGE_LOG_FILE,92,215,144,13,ES_AUTOHSCROLL - CONTROL "Incluir lista de inodes &danificados no log de resultados", - IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,8,235,203,10 - CONTROL "&Incluir lista de inodes raiz de propriedade do AFS no log de resultados", - IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,8,249,232,10 - ICON IDI_SERVER,IDC_STATIC,4,7,20,20 - LTEXT "Esta operação permite resolver problemas em um ou mais volumes.\n\nNota: Se você recuperar toda uma partição ou servidor de uma só vez, o servidor será posto temporariamente off-line.", - IDC_STATIC,36,7,214,32 - GROUPBOX "Opções Avançadas de Recuperação",IDC_ADVANCED_GROUP,4, - 145,246,122 -END - -IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Recuperar Volumes - Resultados" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "&Fechar",IDOK,232,160,50,14 - LTEXT "Resultados da operação de recuperação:",IDC_STATIC,4,33, - 277,8 - EDITTEXT IDC_SALVAGE_DETAILS,4,43,277,113,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP - ICON IDI_SERVER,IDC_STATIC,4,7,21,20 - LTEXT "Recuperar volume %3 na partição %2 do servidor %1", - IDC_SALVAGE_TITLE,33,15,248,8 -END - -IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 277, 102 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Liberar Volume" -FONT 9, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "OK",IDOK,115,84,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,169,84,50,14 - PUSHBUTTON "&Ajuda",9,223,84,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "Esta operação permite atualizar as réplicas do volume %3. Pode-se escolher atualizar somente réplicas desatualizadas, ou todas as réplicas.", - IDC_RELSET_DESC,31,7,242,26 - CONTROL "&Atualizar somente as réplicas do volume que estejam desatualizadas", - IDC_RELSET_NORMAL,"Button",BS_AUTORADIOBUTTON,13,41,227, - 10 - CONTROL "Atualizar &todas as réplicas do volume, mesmo que não estejam desatualizadas", - IDC_RELSET_FORCE,"Button",BS_AUTORADIOBUTTON,13,56,258, - 10 -END - -IDD_SVR_HOSTS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - PUSHBUTTON "&Incluir Servidor Host",IDC_HOST_ADD,67,160,68,14 - PUSHBUTTON "&Remover Servidor Host",IDC_HOST_REMOVE,141,160,80,14 - LTEXT "Servidores host de banco de dados reconhecidos pelo servidor:", - IDC_HOST_TITLE,5,7,216,8 - CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, - 135,WS_EX_CLIENTEDGE -END - -IDD_SVR_ADDHOST DIALOGEX 0, 0, 225, 106 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "Incluir Servidor Host" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "&Host:",-1,31,55,26,8 - EDITTEXT IDC_ADDHOST_HOST,61,53,103,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,63,88,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,117,88,50,14 - ICON IDI_SERVER,-1,4,4,21,20 - LTEXT "Você escolheu incluir um servidor host de banco de dados à lista armazenada no servidor %1.\n\nDigite abaixo o nome do novo host de banco de dados.", - IDC_ADDHOST_DESC,31,10,190,34 - PUSHBUTTON "Ajuda",9,171,88,50,14 -END - -IDD_SVR_ADDRESS DIALOGEX 0, 0, 208, 115 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "Alterar Endereços de Servidor" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Endereços IP gravados no VLDB para o servidor %1:", - IDC_TITLE,4,4,200,8 - LISTBOX IDC_SVR_ADDRESSES,4,14,147,40,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Al&terar...",IDC_ADDR_CHANGE,154,24,50,14 - PUSHBUTTON "&Remover",IDC_ADDR_REMOVE,154,40,50,14 - DEFPUSHBUTTON "OK",IDOK,46,97,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,100,97,50,14 - PUSHBUTTON "Ajuda",9,154,97,50,14 - LTEXT "Nota: quando um servidor de arquivos é iniciado, ele registra automaticamente seu(s) endereço(s) IP atual (atuais) com o VLDB.", - IDC_STATIC,4,64,200,25 -END - -IDD_SVR_NEWADDR DIALOGEX 0, 0, 223, 69 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "Alterar Endereço IP" -CLASS "AFSManagerClass" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,61,51,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,115,51,50,14 - PUSHBUTTON "Ajuda",9,169,51,50,14 - LTEXT "Digite o novo endereço IP que deve substituir %1 no VLDB:", - IDC_TITLE,4,4,215,8 - CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,45,23, - 90,14 - LTEXT "Endereço:",IDC_STATIC,4,26,36,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" -32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" -32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" -IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" -IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" -IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" -IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" -IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" -IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" -IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" -IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" -IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" -IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" -IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" -IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" -IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" -IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" -IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -ACCEL_MAIN ACCELERATORS DISCARDABLE -BEGIN - VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT - VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT - VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT - VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT - VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT - VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT - VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT - VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, - NOINVERT - VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVR_LISTS_TITLE "Servidor %1 - Listas de Admin" - IDS_TAB_SERVICES "Serviços" - IDS_TAB_AGGREGATES "Partições" - IDS_TAB_FILESETS "Volumes" - IDS_SERVICE_NONESELECTED "Selecione um servidor para ser exibido." - IDS_SERVICE_GOTSELECTED "Processos de serviço no servidor %1:" - IDS_AGGREGATE_ALL "Partições em todos os servidores:" - IDS_AGGREGATE_ONE "Partições no servidor %1:" - IDS_FILESET_ALL "Todos os volumes na célula %1:" - IDS_FILESET_ONE "Volumes no servidor %1:" - IDS_SVR_LISTS_TAB "Listas de Admin" - IDS_SVR_PROP_TITLE "Servidor %1 - Propriedades" - IDS_SVR_GENERAL_TAB "Geral" - IDS_SVR_SCOUT_TAB "Definições" - IDS_SERVER_TITLE "Servidor %1 - Gerenciador de Servidor do AFS" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_DESC "Servidor %1 na célula %2:" - IDS_SVC_PROP_TITLE "Serviço %2 no Servidor %1 - Propriedades" - IDS_SVC_GENERAL_TAB "Geral" - IDS_SVC_ADD_TITLE "Criar Serviço" - IDS_SVC_ADD_TAB "Criar Serviço" - IDS_AGG_PROP_TITLE "Partição %2 no Servidor %1 - Propriedades" - IDS_AGG_GENERAL_TAB "Geral" - IDS_SET_REP_TITLE "Volume %1 - Replicação" - IDS_SET_REPSITES_TAB "Locais de Replicação" - IDS_SET_PROP_TITLE "Volume %1 - Propriedades" - IDS_SET_GENERAL_TAB "Geral" - IDS_SET_UNLOCKBTN "&Desbloquear Agora" - IDS_SET_LOCKBTN "&Bloquear Agora" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_USAGE_FILESET "%1 usado da quota de %2 (%3%%)" - IDS_USAGE_AGGREGATE "%1 usado da capacidade de %2 (%3%%)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGCOL_ALLOCATED "Quota Combinada" - IDS_SVRCOL_NAME "Servidor" - IDS_SVRCOL_STATUS "Status" - IDS_SETCOL_DATE_ACCESS "Último Acesso" - IDS_SETCOL_DATE_BACKUP "Último Backup" - IDS_SVCCOL_NAME "Serviço" - IDS_SVCCOL_TYPE "Tipo" - IDS_SVCCOL_PARAMS "Parâmetros" - IDS_SVCCOL_STATUS "Status" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_DATE_START "Último Início" - IDS_SVCCOL_DATE_STOP "Última Parada" - IDS_SVCCOL_DATE_STARTSTOP "Último Início/Parada" - IDS_SVCCOL_DATE_FAILED "Última Falha" - IDS_SVCCOL_LASTERROR "Último Código de Saída" - IDS_AGGCOL_NAME "Partição" - IDS_AGGCOL_ID "ID" - IDS_AGGCOL_DEVICE "Dispositivo" - IDS_AGGCOL_USED "Usado" - IDS_AGGCOL_USED_PER "% Usado" - IDS_AGGCOL_FREE "Livre" - IDS_AGGCOL_TOTAL "Capacidade" - IDS_AGGCOL_STATUS "Status" - IDS_SETCOL_NAME "Volume" - IDS_SETCOL_TYPE "Tipo" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETCOL_DATE_CREATE "Criado" - IDS_SETCOL_DATE_UPDATE "Última Atualização" - IDS_SETCOL_STATUS "Status" - IDS_SETCOL_QUOTA_USED "Usado" - IDS_SETCOL_QUOTA_USED_PER "% Usado" - IDS_SETCOL_QUOTA_FREE "Livre" - IDS_SETCOL_QUOTA_TOTAL "Quota" - IDS_TRYAGAINBTN "Tentar &Novamente" - IDS_NO_CELL_SELECTED "(nenhuma célula foi especificada)" - IDS_NO_AFS_ID "(nenhum token está disponível)" - IDS_AFS_ID_WILLEXP "%1 (tokens irão vencer em %2)" - IDS_ELAPSED_TIME "%1" - IDS_SEARCHING_FOR_SERVERS - "Aguarde: obtendo informações sobre a célula %1..." - IDS_STATUS_NOALERTS "Normal" - IDS_TITLE_BROWSE_USER "Selecionar Usuário" - IDS_AGGTYPE_OTHER "Desconhecido (%1)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATEFILESET "Criando volume %3 na partição %1:%2" - IDS_ACTION_DELETEFILESET "Excluindo volume %3 da partição %1:%2" - IDS_ACTION_MOVEFILESET "Movendo volume %3 para a partição %1:%2" - IDS_ACTION_SETFILESETQUOTA "Alterando a quota para o volume %3" - IDS_SVCSTOP_DESC2 "Clique em OK para interromper este serviço." - IDS_SVCSTART_DESC2 "Clique em OK para iniciar este serviço." - IDS_SYNCVLDB_SVR_DESC "Atenção!\n\nSe você prosseguir, o Gerenciador de Servidor do AFS modificará o VLDB para corresponder ao conteúdo de todas as partições no servidor %1." - IDS_SYNCVLDB_SVR_DESC2 "Se o VLDB mencionar um volume que por algum motivo não possa ser localizado no momento em nenhuma partição no servidor %1, a entrada para aquele volume no VLDB será excluída!" - IDS_SYNCVLDB_AGG_DESC "Atenção!\n\nSe você prosseguir, o Gerenciador de Servidor do AFS modificará o VLDB para corresponder ao conteúdo da partição %2 no servidor %1." - IDS_SYNCVLDB_AGG_DESC2 "Se o VLDB mencionar um volume que por algum motivo não possa ser localizado nessa partição, a entrada para aquele volume no VLDB será excluída!" - IDS_PROMPT_BROWSE_USER "Usuário:" - IDS_PREVIEWIN_BUTTON "<< &Pré-exibição" - IDS_PREVIEWOUT_BUTTON "&Pré-exibição >>" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ADMCOL_TYPE_USER "Usuário" - IDS_TITLE_BROWSE_PRINCIPAL "Selecionar Usuário Principal" - IDS_TITLE_BROWSE_OWNGROUP "Selecionar Grupo Proprietário" - IDS_PROMPT_BROWSE_PRINCIPAL "Proprietário:" - IDS_PROMPT_BROWSE_OWNGROUP "Grupo Proprietário:" - IDS_ACTION_CLONE "Criando versão de backup do volume %3" - IDS_ACTION_CLONESYS "Criando múltiplos backups do volume" - IDS_CLONESYS_FAILED "Não foi possível criar um backup do volume %1 devido ao erro 0x%2 (%3)." - IDS_SET_UNSPECIFIED "(não especificado)" - IDS_SETCOL_ID "ID" - IDS_SETCOL_FILES "Contagem de Arquivos" - IDS_SET_DUMP_NAME "Descarga de %1.DMP" - IDS_ACTION_DUMP "Descarregando o volume %3 (partição %1:%2)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FILESETNAME_ERROR "%1 - %2" - IDS_SETCOL_AGGREGATE "Partição" - IDS_REFRESH_DESC_CELL "O Gerenciador de Servidor do AFS está determinando o status dos servidores na célula %1. Isto pode levar alguns minutos..." - IDS_REFRESH_DESC_SERVER "O Gerenciador de Servidor do AFS está determinando o status do servidor %1. Isto pode levar alguns momentos..." - IDS_REFRESH_CURRENT_CELL "Examinando no momento: célula %1" - IDS_REFRESH_CURRENT_SERVER "Examinando no momento: servidor %1" - IDS_REFRESH_CURRENT_AGGREGATE - "Examinando no momento: partição %3 no servidor %2" - IDS_REFRESH_CURRENT_FILESET - "Examinando no momento: volume %4 no servidor %2, partição %3" - IDS_REFRESH_CURRENT_SERVICE - "Examinando no momento: serviço %3 no servidor %2" - IDS_REFRESH_PERCENT "%1%% concluído" - IDS_PROBLEMS "Problemas" - IDS_SERVER_NO_PROBLEMS "Este servidor não tem problemas conhecidos." - IDS_SERVICE_NO_PROBLEMS "Este serviço não tem problemas conhecidos." - IDS_AGGREGATE_NO_PROBLEMS "Esta partição não tem problemas conhecidos." - IDS_FILESET_NO_PROBLEMS "Este volume não tem problemas conhecidos." - IDS_AGGTYPE_TYPE1 "UFS" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGTYPE_TYPE2 "LFS" - IDS_AGGTYPE_TYPE3 "AIX" - IDS_AGGTYPE_TYPE4 "VXFS" - IDS_AGGTYPE_TYPE5 "DMEPI" - IDS_REFRESH_CURRENT_VLDB - "Examinando no momento: banco de dados de localização de volumes (VLDB)" - IDS_FILESETTYPE_RW "Leitura/Gravação" - IDS_FILESETTYPE_RO "Réplica" - IDS_FILESETTYPE_CLONE "Backup" - IDS_MOVESET_READWRITE "Prosseguir fará com que o volume %3 seja movido da partição %2 do servidor %1 para outra localização." - IDS_MOVESET_READONLY "Prosseguir fará com que a réplica do volume %3 seja removida da partição %2 do servidor %1, e que outra réplica do volume seja criada na partição especificada abaixo." - IDS_SVC_START_TITLE "Iniciar Serviço" - IDS_SVC_STOP_TITLE "Parar Serviço" - IDS_SERVICESTATUS_STARTING "Este serviço está iniciando no momento." - IDS_SERVICESTATUS_RUNNING "Este serviço está em execução no momento." - IDS_SERVICESTATUS_STOPPED "Este serviço está parado no momento." - IDS_SERVICESTATUS_STOPPING "Este serviço está parando no momento." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICESTATUS_UNKNOWN "O status deste serviço é desconhecido." - IDS_SVC_RESTART_BUTTON "Parar e &Reiniciar Agora" - IDS_PROBLEM_BOX "Problemas Conhecidos (%1)" - IDS_VIEWLOG_DESC_NOFILE "O Gerenciador de Servidor do AFS não conseguiu encontrar o arquivo de log para o serviço %2 no servidor %1. Digite abaixo o nome completo do caminho para o arquivo de log do serviço." - IDS_NO_GROUP "(nenhum grupo proprietário)" - IDS_VIEWLOG_FROMSERVER "Arquivo de log no servidor %1" - IDS_VIEWLOG_FROMSERVICE "Arquivo de log para o serviço %2 no servidor %1" - IDS_VIEWLOG_TRUNCATED "Conteúdo do arquivo (somente as últimas %1 linhas são exibidas):" - IDS_SAVELOG_FILTER "Arquivo de Texto|*.TXT|" - IDS_ADVANCEDIN_BUTTON "<< A&vançado" - IDS_ADVANCEDOUT_BUTTON "A&vançado >>" - IDS_REPTYPE_RELEASE "Liberar Replicação" - IDS_REPTYPE_SCHEDULED "Replicação Programada" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_UPDATEALL_BUTTON "A&tualizar Tudo" - IDS_UPDATETHIS_BUTTON "At&ualizar" - IDS_SERVER_MULTIPLE_PROBLEMS "Este servidor tem %1 problemas conhecidos." - IDS_SERVICE_MULTIPLE_PROBLEMS "Este serviço tem %1 problemas conhecidos." - IDS_AGGREGATE_MULTIPLE_PROBLEMS - "Esta partição tem %1 problemas conhecidos." - IDS_FILESET_MULTIPLE_PROBLEMS "Este volume tem %1 problemas conhecidos." - IDS_FILESETTYPE_RO_STAGE "Réplica" - IDS_SERVICETYPE_SIMPLE_LONG "Simples (executa continuamente)" - IDS_SERVICETYPE_CRON_LONG - "Cronometrado (executa a intervalos especificados)" - IDS_QUOTAUNITS_KB "kb" - IDS_QUOTAUNITS_MB "MB" - IDS_NO_QUOTA_REPLICA "(este volume é uma réplica e portanto não tem quota)" - IDS_NO_QUOTA_CLONE "(este volume é um backup e portanto não tem quota)" - IDS_USAGE_REPLICA "%1 usado" - IDS_USAGE_CLONE "%1 usado" - IDS_COL_AGGS_MOVE "partições ao criar um volume" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_SERVICE "%1:%2" - IDS_SERVICETYPE_SIMPLE "Simples" - IDS_SERVICETYPE_CRON "Cronometrado" - IDS_SERVICESTATE_STOPPED "Parado" - IDS_SERVICESTATE_STOPPING "Parando" - IDS_SERVICESTATE_STARTING "Iniciando" - IDS_SERVICESTATE_RUNNING "Executando" - IDS_SERVICETYPE_FS_LONG "FS (sistema de arquivos)" - IDS_SERVICETYPE_FS "FS" - IDS_SERVICE_LASTERROR "%1" - IDS_SERVICES_IN_CELL "Todos os serviços na célula %1:" - IDS_SERVICE_STARTDATE "Iniciado %1" - IDS_SERVICE_STOPDATE "Parado %1" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_PERCENTAGE "%1 %%" - IDS_AGGREGATES_IN_SERVER "Partições no servidor %1:" - IDS_AGGREGATES_IN_CELL "Todas as partições na célula %1:" - IDS_AGGREGATES_IN_NOTHING "Partições:" - IDS_FILESETS_IN_SERVER "Volumes no servidor %1:" - IDS_FILESETS_IN_CELL "Todos os volumes na célula %1:" - IDS_FILESETS_IN_NOTHING "Volumes:" - IDS_SERVICES_IN_SERVER "Serviços no servidor %1:" - IDS_SERVICES_IN_NOTHING "Serviços:" - IDS_UNKNOWN "(desconhecido)" - IDS_UNKNOWN_GROUP "grupo #%1 (nome desconhecido)" - IDS_AGGFULL_WARN_OFF "o limite padrão (aviso desativado no servidor)" - IDS_SERVER_AGGREGATE "%1:%2" - IDS_SERVERNAME_ERROR "%1 - %2" - IDS_AGGREGATENAME_ERROR "%1 - %2" - IDS_SETFULL_WARN_OFF "o limite padrão (aviso desativado no servidor)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_LASTERRORDATE "%1 - Código de saída %2" - IDS_COL_SERVERS "servidores em uma célula" - IDS_COL_FILESETS "volumes em um servidor" - IDS_COL_AGGREGATES "partições em um servidor" - IDS_COL_SERVICES "serviços em um servidor" - IDS_COL_REPLICAS "réplicas de um volume" - IDS_COLUMNS_TITLE "Selecionar Colunas de Exibição - Gerenciador de Servidor do AFS" - IDS_REPCOL_SERVER "Servidor" - IDS_REPCOL_AGGREGATE "Partição" - IDS_REPCOL_DATE_UPDATE "Última Atualização" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COL_AGGS_CREATE "partições ao mover um volume" - IDS_WARN_TITLE "Atenção" - IDS_WARN_DISABLE_AUTH "Clicando o botão ""Permitir Não Autenticado"", você permitirá que proprietários não autenticados manipulem os serviços neste servidor. Como muitos serviços executam sob a identidade root, esta ação representa +" - IDS_WARN_DISABLE_AUTH2 "um risco significativo na segurança do servidor.\n\nDeseja realmente fazer esta alteração?" - IDS_SVR_NO_ADDR "(não especificado)" - IDS_TITLE_BAD_CELL "Nome de Célula Não Reconhecido" - IDS_DESC_BAD_CELL "O nome de célula informado não foi encontrado na rede.\n\nVerifique o nome novamente para certificar-se de que esteja correto." - IDS_AGGFULL_WARN_ON "o &limite padrão para este servidor (%1%% de seu tamanho)" - IDS_SETFULL_WARN_ON "o &limite padrão para este servidor (%1%% de seu tamanho)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS - "A identificação do AFS informada não é reconhecida, ou a senha especificada está incorreta." - IDS_CREDS_NONE "(nenhum token)" - IDS_CREDS_VALID "%2, vence em %3" - IDS_CREDS_EXPIRED "(tokens vencidos em %3)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGG_FILESETS "%1 (Quota combinada: %2)" - IDS_ACTION_DESC_NONE "Não há operações em andamento." - IDS_ACTION_DESC_ONE "A seguinte operação está em andamento:" - IDS_ACTION_DESC_MULT "As seguintes operações estão em andamento:" - IDS_ACTCOL_OPERATION "Operação" - IDS_ACTCOL_ELAPSED "Tempo Decorrido" - IDS_ACTION_REFRESH "Atualizando informações da célula" - IDS_ACTION_CREATESERVER "Criando o servidor %1" - IDS_ACTION_DELETESERVER "Excluindo o servidor %1" - IDS_ACTION_GETSERVERLOGFILE "Obtendo o arquivo de log %2 do servidor %1" - IDS_ACTION_SETSERVERAUTH - "Alterando as restrições de acesso para o servidor %1" - IDS_ACTION_CHANGESERVERSTATUS "Alterando as propriedades do servidor %1" - IDS_ACTION_STARTSERVICE "Iniciando o serviço %2 no servidor %1" - IDS_ACTION_STOPSERVICE "Parando o serviço %2 no servidor %1" - IDS_ACTION_RESTARTSERVICE "Reiniciando o serviço %2 no servidor %1" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SYNCVLDB_SVR "Sincronizando o VLDB com o servidor %1" - IDS_ACTION_SYNCVLDB_AGG "Sincronizando o VLDB com a partição %1:%2" - IDS_ACTION_SCOUT "Verificando o servidor %1 para problemas" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SETREPPARAMS "alterando as propriedades de replicação para o volume %3" - IDS_ACTION_CREATEREPLICA "Criando réplica do volume %3 na partição %1:%2" - IDS_DELSET_REPLICA_DESC " Atenção!\n\nProsseguir fará com que a réplica do volume %3 na partição %2 do servidor %1 seja removida." - IDS_DELSET_CLONE_DESC " Atenção!\n\nProsseguir fará com que a réplica do volume %3 seja removida da partição %2 do servidor %1." - IDS_INSTALL_DESC1 "Esta operação copia um arquivo deste computador para outro. +" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_INSTALL_DESC2 "Se o arquivo já existir no computador de destino, será feito um backup dele com a extensão .BAK; qualquer backup existente receberá a extensão .OLD, e qualquer arquivo .OLD existente será excluído." - IDS_ACTION_INSTALLFILE "Instalando o arquivo %2 no servidor %1." - IDS_ACTION_UNINSTALLFILE - "Removendo a instalação do arquivo %2 a partir do servidor %1." - IDS_ACTION_PRUNEFILES "Eliminando arquivos do servidor %1" - IDS_FILTER_ALLFILES "Todos os arquivos|*.*|" - IDS_ACTION_RENAMEFILESET "Renomeando o volume %1 para %2" - IDS_RECUR_DAILY "todos os dias" - IDS_RECUR_SUNDAY "todo Domingo" - IDS_RECUR_MONDAY "toda Segunda-Feira" - IDS_RECUR_TUESDAY "toda Terça-Feira" - IDS_RECUR_WEDNESDAY "toda Quarta-Feira" - IDS_RECUR_THURSDAY "toda Quinta-Feira" - IDS_RECUR_FRIDAY "toda Sexta-Feira" - IDS_RECUR_SATURDAY "todo Sábado" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATESERVICE "Criando o serviço %2 no servidor %1" - IDS_ACTION_DELETESERVICE "Excluindo o serviço %2 do servidor %1" - IDS_ACTION_RELEASEFILESET "Liberando o volume %3" - IDS_ACTION_GETDATES "Obtendo datas para o arquivo %2 no servidor %1" - IDS_LASTMODIFIED "Modificado por último em %1" - IDS_SVR_SECURITY_TITLE "Segurança do Servidor -%1" - IDS_SVR_LIST_TAB "Administradores" - IDS_ACTION_ADMINLIST_LOAD "Obtendo administradores para o servidor %1" - IDS_ACTION_ADMINLIST_SAVE "Gravando administradores para o servidor %1" - IDS_ADMCOL_PRINCIPAL "Membro" - IDS_ADMCOL_TYPE "Tipo" - IDS_ADMCOL_TYPE_GROUP "Grupo" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_RESTORE "Restaurando o volume %1" - IDS_COL_AGGS_RESTORE "partições ao restaurar um volume" - IDS_RESTORE_FILTER "Arquivos de Descarga de Volume|*.DMP|Todos os arquivos|*.*|" - IDS_SVC_BOS_TAB "BOS" - IDS_ACTION_SETRESTART "Alterando horários de reinício de serviços para o servidor %1" - IDS_RESTORE_CREATESET "O volume %1 será criado no servidor e na partição que forem especificados abaixo." - IDS_RESTORE_OVERWRITESET - "Atenção! O Volume %3 existe na partição %2 do servidor %1, e será sobreposto se você prosseguir!" - IDS_SUBSET_TITLE_LOAD "Abrir Subconjunto de Servidores" - IDS_SUBSET_TITLE_SAVE "Salvar Subconjunto de Servidores" - IDS_BUTTON_OPEN "&Abrir" - IDS_BUTTON_SAVE "&Salvar" - IDS_SUBSET_SAVE_TITLE "Atenção" - IDS_SUBSET_SAVE_DESC "Já existe um subconjunto de servidores com o nome %1.\n\nDeseja sobrepor este subconjunto?" - IDS_SUBSET_CHANGED "%1 [MODIFICADO]" - IDS_SUBSET_TAB "Servidores Monitorados" - IDS_SUBSET_DISCARD_TITLE "Salvar Subconjunto?" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SUBSET_DISCARD_DESC "Você não salvou a lista de servidores monitorados atualmente como um subconjunto. Se a lista for salva, poderá ser usada mais tarde para continuar a monitorar este mesmo conjunto de servidores.\n\n+" - IDS_SUBSET_DISCARD_DESC2 - "Deseja criar um subconjunto para conter a lista dos servidores monitorados atualmente?" - IDS_SUBSET_NONAME "(sem título)" - IDS_SUBSET_NOSUBSET "(todos os servidores estão sendo monitorados)" - IDS_SUBSET_SERVERSUBSET "Servidor %1" - IDS_FILESET_SOME "Volumes em todos os servidores monitorados na célula %1:" - IDS_AGGREGATE_SOME "Partições em todos os servidores monitorados na célula %1:" - IDS_SERVICE_SOME "Serviços em todos os servidores monitorados na célula %1:" - IDS_FILESET_UNMON "O servidor %1 não está sendo monitorado" - IDS_AGGREGATE_UNMON "O servidor %1 não está sendo monitorado" - IDS_SERVICE_UNMON "O servidor %1 não está sendo monitorado" - IDS_SUBSET_DELETE_TITLE "Excluir Subconjunto?" - IDS_SUBSET_DELETE_DESC "Tem certeza que deseja excluir o subconjunto de servidores %1?" - IDS_ERROR_TRANSLATED "Erro número 0x%1 (%2):\n\n%3" - IDS_ERROR_NOTTRANSLATED "Erro número 0x%1 (%2) não é reconhecido." - IDS_FIND_NOTHING_TITLE "Nenhum Comando Selecionado" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FIND_NOTHING_DESC "Para descobrir como realizar uma operação, selecione primeiro uma linha de comando na lista ou digite uma palavra-chave." - IDS_FIND_UNKNOWN_TITLE "Comando Desconhecido" - IDS_FIND_UNKNOWN_DESC "O Gerenciador de Servidor do AFS não encontrou nenhum tópico de ajuda para o comando ""%1""." - IDS_HELPABOUT_DESC1 "Aviso: este programa de computador é protegido por direitos autorais e por tratados internacionais. +" - IDS_HELPABOUT_DESC2 "A reprodução ou distribuição não autorizadas neste software pode resultar em pesadas penalidades civis e criminais, e será processada até o máximo possível permitido por lei.\n\n+" - IDS_HELPABOUT_DESC3 "AFS é uma marca da Transarc Corporation, uma empresa IBM." - IDS_CANT_QUIT_TITLE "Gerenciador de Servidor do AFS" - IDS_CANT_QUIT_REBOOT "Atenção!\n\nO Gerenciador de Servidor do AFS está realizando uma ou mais operações no momento. Se você encerrar o Windows agora, essas operações não concluirão com êxito.\n\nTem certeza de que deseja reiniciar o Windows?" - IDS_APP_TITLE "Gerenciador de Servidor do AFS" - IDS_ACTION_OPENCELL "Procurando Servidores na célula %1" - IDS_OPTIONS_TITLE "Opções - Gerenciador de Servidor do AFS" - IDS_OPTIONS_GENERAL_TAB "Geral" - IDS_BADCREDS_DESC "A menos que esteja com logon efetuado como administrador, você pode ter privilégios insuficientes para administrar com êxito na célula %1. Privilégios de acesso insuficientes podem fazer com que o Gerenciador de Servidor do AFS encontre problemas em uma célula quando na verdade tais problemas não existem." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CONFIRMATION_TITLE "Confirmação - Gerenciador de Servidor do AFS" - IDS_NO_GROUP_CHECKBOX "Nenhum Grupo Proprietário" - IDS_AFS_ID_DIDEXP "%1 (tokens vencidos em %2)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_QUERYING "(consultando)" - IDS_ADMCOL_TYPE_FOREIGN_GROUP "Grupo Externo" - IDS_ADMCOL_TYPE_FOREIGN_USER "Usuário Externo" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_NOTIFIER "Notificador" - IDS_SVC_NONOTIFIER "(nenhum)" - IDS_SVR_KEY_TAB "Chaves de Servidor" - IDS_KEYNAME_NOTIME "Chaves para o servidor %1:" - IDS_KEYNAME_WITHTIME "Chaves para o Servidor %1 (modificadas em %2):" - IDS_SVRKEY_VERSION "Versão" - IDS_SVRKEY_DATA "Valor" - IDS_SVRKEY_CHECKSUM "Soma de Verificação" - IDS_SVRKEY_DATA_UNKNOWN "(oculta)" - IDS_STARTSERVICE_TITLE "Iniciar Serviço" - IDS_STOPSERVICE_TITLE "Parar Serviço" - IDS_STARTSERVICE_TEXT "Clique em OK para iniciar o serviço %2 no servidor %1." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STOPSERVICE_TEXT "Clique em OK para parar o serviço %2 no servidor %1." - IDS_STARTSERVICE_STARTUP - "É possível tornar esta alteração permanente, de modo que o serviço %2 inicie automaticamente se o servidor %1 for reiniciado." - IDS_STOPSERVICE_STARTUP "É possível tornar esta alteração permanente, de modo que o serviço %2 não inicie automaticamente se o servidor %1 for reiniciado." - IDS_STARTSERVICE_PERMANENT - "&Permanente (iniciar o serviço %2 se o servidor %1 reiniciar)" - IDS_STARTSERVICE_TEMPORARY - "&Temporária (não iniciar o serviço %2 se o servidor %1 reiniciar)" - IDS_STOPSERVICE_PERMANENT - "&Permanente (não iniciar o serviço %2 se o servidor %1 reiniciar)" - IDS_STOPSERVICE_TEMPORARY - "&Temporária (iniciar o serviço %2 se o servidor %1 reiniciar)" - IDS_ACTION_EXECUTE "Executando %2 no servidor %1" - IDS_ACTION_SALVAGE_SVR "Recuperando todos os volumes no servidor %1" - IDS_ACTION_SALVAGE_AGG "Recuperando todos os volumes na partição %1:2" - IDS_ACTION_SALVAGE_VOL "Recuperando o volume %3 na partição %1:2" - IDS_SALVAGE_SVR "Recuperar todos os volumes no servidor %1" - IDS_SALVAGE_AGG "Recuperar todos os volumes no servidor %1, partição %2" - IDS_SALVAGE_SET "Recuperar o volume %3 no servidor %1, partição %2" - IDS_SETSTATUS_SALVAGE "Recuperando o volume" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETSTATUS_LOCKED "O volume está bloqueado" - IDS_SETSTATUS_NO_VOL "Volume ausente" - IDS_SETSTATUS_BUSY "Volume ocupado no momento" - IDS_SETSTATUS_MOVED "Volume movido" - IDS_SVR_CAPACITY "%1" - IDS_SVR_ALLOCATION "%1 (%2%%)" - IDS_SVRCOL_ADDRESS "Endereço" - IDS_HOST_TITLE "Servidores host de banco de dados reconhecidos pelo servidor %1:" - IDS_SVR_HOSTS_TITLE "Servidor %1 - Hosts de Banco de Dados" - IDS_SVR_HOST_TAB "Hosts de Banco de Dados" - IDS_ACTION_HOSTLIST_LOAD "Obtendo a lista de hosts do servidor %1" - IDS_ACTION_HOSTLIST_SAVE "Gravando a lista de hosts no servidor %1" - IDS_SETSTATUS_1ALERT "O volume tem um problema" - IDS_SETSTATUS_2ALERT "O volume tem %1 problemas" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CHANGEADDR "Alterando o endereço IP para o servidor %1" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_ADDSITE "vos addsite" - IDS_COMMAND_VOS_BACKUP "vos backup" - IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" - IDS_COMMAND_VOS_CREATE "vos create" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_DELENTRY "vos delentry" - IDS_COMMAND_VOS_DUMP "vos dump" - IDS_COMMAND_VOS_EXAMINE "vos examine" - IDS_COMMAND_VOS_LISTPART "vos listpart" - IDS_COMMAND_VOS_LISTVLDB "vos listvldb" - IDS_COMMAND_VOS_LISTVOL "vos listvol" - IDS_COMMAND_VOS_LOCK "vos lock" - IDS_COMMAND_VOS_MOVE "vos move" - IDS_COMMAND_VOS_PARTINFO "vos partinfo" - IDS_COMMAND_VOS_RELEASE "vos release" - IDS_COMMAND_VOS_REMOVE "vos remove" - IDS_COMMAND_VOS_REMSITE "vos remsite" - IDS_COMMAND_VOS_RENAME "vos rename" - IDS_COMMAND_VOS_RESTORE "vos restore" - IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" - IDS_COMMAND_VOS_UNLOCK "vos unlock" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" - IDS_COMMAND_VOS_ZAP "vos zap" - IDS_COMMAND_BOS_ADDHOST "bos addhost" - IDS_COMMAND_BOS_ADDKEY "bos addkey" - IDS_COMMAND_BOS_ADDUSER "bos adduser" - IDS_COMMAND_BOS_CREATE "bos create" - IDS_COMMAND_BOS_DELETE "bos delete" - IDS_COMMAND_BOS_EXEC "bos exec" - IDS_COMMAND_BOS_GETDATE "bos getdate" - IDS_COMMAND_BOS_GETLOG "bos getlog" - IDS_COMMAND_BOS_GETRESTART "bos getrestart" - IDS_COMMAND_BOS_INSTALL "bos install" - IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" - IDS_COMMAND_BOS_LISTKEYS "bos listkeys" - IDS_COMMAND_BOS_LISTUSERS "bos listusers" - IDS_COMMAND_BOS_PRUNE "bos prune" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_BOS_REMOVEHOST "bos removehost" - IDS_COMMAND_BOS_REMOVEKEY "bos removekey" - IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" - IDS_COMMAND_BOS_RESTART "bos restart" - IDS_COMMAND_BOS_SALVAGE "bos salvage" - IDS_COMMAND_BOS_SETAUTH "bos setauth" - IDS_COMMAND_BOS_SETRESTART "bos setrestart" - IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" - IDS_COMMAND_BOS_START "bos start" - IDS_COMMAND_BOS_STARTUP "bos startup" - IDS_COMMAND_BOS_STATUS "bos status" - IDS_COMMAND_BOS_STOP "bos stop" - IDS_COMMAND_BOS_UNINSTALL "bos uninstall" - IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" - IDS_COMMAND_FS_LISTQUOTA "fs listquota" - IDS_COMMAND_FS_QUOTA "fs quota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_FS_SETQUOTA "fs setquota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCSHORT_UNMONITORED - "O servidor %1 não está sendo monitorado para detectar problemas" - IDS_ALERT_DESCSHORT_TIMEOUT - "O servidor %1 não pôde ser contactado; último erro: %3" - IDS_ALERT_DESCSHORT_AGG_FULL - "Uso da partição para %2 excede o limite de aviso de %3%% (%4)" - IDS_ALERT_DESCSHORT_SET_FULL - "O uso do volume para %3 excede o limite de aviso de %4%% (%5)" - IDS_ALERT_DESCSHORT_NO_VLDBENT "O volume %3 não possui entrada no VLDB" - IDS_ALERT_DESCSHORT_NO_SVRENT_SET - "O volume %3 tem uma entrada no VLDB mas não foi encontrado na partição %2 do servidor %1" - IDS_ALERT_DESCSHORT_STOPPED "Serviço %2 parado em %3" - IDS_ALERT_DESCSHORT_NO_SVRENT_AGG - "A partição %2 é referenciada pelo VLDB mas não foi encontrada no servidor %1" - IDS_ALERT_DESCSHORT_BADCREDS - "Você pode ter privilégios insuficientes para administrar o servidor %1" - IDS_ALERT_DESCSHORT_AGG_ALLOC - "A quota combinada de volumes na partição %2 excede sua capacidade" - IDS_ALERT_DESCSHORT_STATE_NO_VNODE - "O volume %3 está danificado e não pode ser usado" - IDS_ALERT_DESCSHORT_STATE_NO_SERVICE - "Não há nenhum serviço em execução para servir o volume %3" - IDS_ALERT_DESCSHORT_STATE_OFFLINE - "O volume %3 está offline e não pode ser usado" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_TIMEOUT - "O servidor %1 não pôde ser contactado. A última tentativa, feita em %2, resultou no erro ""%3""." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_AGG_FULL - "O uso da partição %2 no servidor %1 excede seu limite de aviso de %3%% (%4)." - IDS_ALERT_DESCFULL_SET_FULL - "O uso do volume %3 (servidor %1, partição %2) excede seu limite de aviso do %4%% (%5)." - IDS_ALERT_DESCFULL_NO_VLDBENT - "O volume %3 existe na partição %2 do servidor %1, mas não tem uma entrada correspondente no VLDB." - IDS_ALERT_DESCFULL_NO_SVRENT_SET - "Existe no VLDB uma entrada para o volume %3, mas este não foi encontrado na partição %2 do servidor %1." - IDS_ALERT_DESCFULL_STOPPED - "O serviço %2 no servidor %1 parou em %3 com o código de saída %5." - IDS_ALERT_DESCFULL_NO_SVRENT_AGG - "O VLDB faz referência a volumes na partição %2 do servidor %1, mas a partição não pôde ser encontrada." - IDS_ALERT_DESCFULL_BADCREDS - "O Gerenciador de Servidor do AFS pode estar detectando erros inexistentes no servidor %1 porque você não tem tokens do AFS como administrador nesta célula." - IDS_ALERT_DESCFULL_AGG_ALLOC - "A quota combinada de volumes na partição %2 do servidor %1, totalizando %4, excede a capacidade %3 da partição." - IDS_ALERT_DESCFULL_STATE_NO_VNODE - "O volume %3 na partição %2 do servidor %1 não tem um Vnode associado a ele. (O estado do volume é 0x%4.)" - IDS_ALERT_DESCFULL_STATE_NO_SERVICE - "Não existe um serviço exportador de arquivos executando no servidor %1, e portanto o volume %3 na partição %4 não pode ser usado. (O estado do volume é 0x%4.)" - IDS_ALERT_DESCFULL_STATE_OFFLINE - "O volume %3 na partição %2 do servidor %1 está offline e não pode ser usado. (O estado do volume é 0x%4.)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_TIMEOUT "Clique no botão Tentar Novamente para tentar contactar novamente este servidor." - IDS_ALERT_FIX_AGG_FULL "Clique no botão Avisos para alterar o limite de aviso para o uso desta partição." - IDS_ALERT_FIX_SET_FULL "Clique no botão Avisos para alterar o limite de aviso para o uso deste volume." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_NO_VLDBENT - "O VLDB está possivelmente desatualizado; se for o caso, use o comando Sincronizar VLDB para atualizá-lo." - IDS_ALERT_FIX_NO_SVRENT_SET - "Verifique o servidor e partição para assegurar-se de que eles estão funcionando corretamente." - IDS_ALERT_FIX_STOPPED "Clique no botão Exibir Log para exibir o log de serviço para este serviço." - IDS_ALERT_FIX_NO_SVRENT_AGG - "Verifique o servidor para assegurar que a partição está exportada e funcionando corretamente." - IDS_ALERT_FIX_BADCREDS "Clique no botão Autenticação para obter novos tokens do AFS." - IDS_ALERT_FIX_AGG_ALLOC "Reduza a quota para volumes nesta partição, ou mova um ou mais volumes para outra partição." - IDS_ALERT_FIX_STATE_NO_VNODE " " - IDS_ALERT_FIX_STATE_NO_SERVICE " " - IDS_ALERT_FIX_STATE_OFFLINE " " -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_BUTTON_TRYAGAIN "Tentar &Novamente" - IDS_ALERT_BUTTON_WARNINGS "&Avisos..." - IDS_ALERT_BUTTON_VIEWLOG "E&xibir Log" - IDS_ALERT_BUTTON_SHOWME "&Mostre-me" - IDS_ALERT_BUTTON_GETCREDS "&Autenticação" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_CELLSERVERS_NOCELL - "Nenhuma célula foi especificada. Para usar o Gerenciador de Servidor do AFS, deve-se especificar a célula do AFS com a qual se deseja trabalhar. Escolha uma célula selecionando o item de menu ""Abrir..."" no menu ""Célula"" acima." - IDS_ERROR_REFRESH_CELLSERVERS - "A lista de servidores não pode ser obtida para a célula %1.\n\nErro: %2" - IDS_ERROR_CANT_OPEN_CELL - "O Gerenciador de Servidor do AFS não conseguiu contactar nenhum servidor na célula %1.\n\nCertifique-se de ter digitado corretamente o nome da célula." - IDS_ERROR_REFRESH_AGGREGATES - "A lista de servidores não pôde ser obtida para o servidor %1.\n\nErro: %2" - IDS_ERROR_REFRESH_SERVER_STATUS - "O status atual do servidor %1 não pôde ser obtido." - IDS_ERROR_CHANGE_SERVER_STATUS - "O Gerenciador de Servidor do AFS não conseguiu alterar as propriedades para o servidor %1." - IDS_ERROR_REFRESH_AGGREGATE_STATUS - "O status atual da partição %2 no servidor %1 não pôde ser obtido." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_FILESET_STATUS - "O status atual do volume %3 (servidor %1, partição %2) não pôde ser obtido." - IDS_ERROR_REFRESH_SERVICE_STATUS - "O status atual do serviço %2 no servidor %1 não pôde ser determinado." - IDS_ERROR_MOVE_FILESET "O Gerenciador de Servidor do AFS não conseguiu mover o volume %3 da partição %2 no servidor %1 para a partição %5 no servidor %4." - IDS_ERROR_VIEW_LOGFILE "O arquivo %2 não pôde ser lido a partir do servidor %1.\n\nCertifique-se de que digitou o nome do arquivo corretamente, e de que possui permissões suficientes para exibir o arquivo." - IDS_ERROR_NOT_REPLICATED - "O status de replicação do volume %1 não pôde ser determinado." - IDS_ERROR_CANT_CREATE_FILESET - "O Gerenciador de Servidor do AFS não conseguiu criar o volume %3 na partição %2 do servidor %1." - IDS_ERROR_CANT_DELETE_FILESET - "O Gerenciador de Servidor do AFS não conseguiu excluir o volume %3 (partição %2 do servidor %1)." - IDS_ERROR_CANT_CREATE_VLDB_ENTRY - "O Gerenciador de Servidor do AFS não conseguiu criar uma entrada no VLDB para o volume %3 na partição %2 do servidor %1." - IDS_ERROR_CANT_SET_FILESET_QUOTA - "O Gerenciador de Servidor do AFS não conseguiu alterar a quota para o volume %3 na partição %2 do servidor %1." - IDS_ERROR_CANT_CREATE_SERVER - "O Gerenciador de Servidor do AFS não conseguiu criar a entrada pedida de servidor na célula %1." - IDS_ERROR_CANT_PING_SERVER - "O Gerenciador de Servidor do AFS não conseguiu determinar o endereço IP do servidor %1." - IDS_ERROR_CANT_DELETE_SERVER - "O Gerenciador de Servidor do AFS não conseguiu excluir o servidor %1." - IDS_ERROR_CANT_DELETE_SERVER_FILESETS - "O servidor %1 não pode ser excluído porque ainda abriga um ou mais volumes. Um servidor não pode ser excluído a menos que não contenha volumes." - IDS_ERROR_CHANGE_AGGREGATE_STATUS - "O Gerenciador de Servidor do AFS não conseguiu alterar as propriedades para a partição %2 no servidor %1." - IDS_ERROR_CHANGE_SERVICE_STATUS - "O Gerenciador de Servidor do AFS não conseguiu alterar as propriedades para o serviço %2 no servidor %1." - IDS_ERROR_CANT_START_SERVICE - "O Gerenciador de Servidor do AFS não conseguiu iniciar o serviço %2 no servidor %1." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_STOP_SERVICE - "O Gerenciador de Servidor do AFS não conseguiu parar o serviço %2 no servidor %1." - IDS_ERROR_CANT_RESTART_SERVICE - "O Gerenciador de Servidor do AFS não conseguiu parar e reiniciar o serviço %2 no servidor %1." - IDS_ERROR_CHANGE_REPLICA_STATUS - "O Gerenciador de Servidor do AFS não conseguiu alterar as propriedades de replicação para o volume %3 na partição %2 do servidor %1." - IDS_ERROR_CANT_SYNCVLDB "O Gerenciador de Servidor do AFS não conseguiu atualizar o VLDB." - IDS_ERROR_CANT_CREATE_REPLICA - "O Gerenciador de Servidor do AFS não conseguiu criar uma réplica do volume %3 na partição %2 do servidor %1." - IDS_ERROR_CANT_INSTALL_FILE - "O Gerenciador de Servidor do AFS não conseguiu instalar o arquivo %2 no servidor %1." - IDS_ERROR_CANT_UNINSTALL_FILE - "O Gerenciador de Servidor do AFS não conseguiu remover a instalação do arquivo %2 no servidor %1." - IDS_ERROR_CANT_PRUNE_FILES - "O Gerenciador de Servidor do AFS não conseguiu remover os arquivos pedidos do servidor %1." - IDS_ERROR_CANT_RENAME_FILESET - "O Gerenciador de Servidor do AFS não conseguiu renomear o volume %1 para ""%2""." - IDS_ERROR_CANT_CREATE_SERVICE - "O Gerenciador de Servidor do AFS não conseguiu criar o serviço %2 no servidor %1." - IDS_ERROR_CANT_DELETE_SERVICE - "O Gerenciador de Servidor do AFS não conseguiu excluir o serviço %2 do servidor %1." - IDS_ERROR_CANT_RELEASE_FILESET - "O Gerenciador de Servidor do AFS não conseguiu liberar o volume replicado %3." - IDS_ERROR_CANT_UPDATE_FILESET - "O Gerenciador de Servidor do AFS não conseguiu atualizar a réplica do volume %3 na partição %1 do servidor %2." - IDS_ERROR_CANT_UPDATE_ALL - "O Gerenciador de Servidor do AFS não conseguiu atualizar nenhuma réplica do volume %3." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_LOAD_ADMLIST - "O Gerenciador de Servidor do AFS não conseguiu ler a lista de administradores para o servidor %1." - IDS_ERROR_CANT_LOAD_KEYLIST - "O Gerenciador de Servidor do AFS não conseguiu ler a lista de chaves de servidor para o servidor %1." - IDS_ERROR_CANT_CREATE_KEY - "O Gerenciador de Servidor do AFS não conseguiu criar uma nova chave de servidor para o servidor %1." - IDS_ERROR_CANT_SAVE_ADMLIST - "O Gerenciador de Servidor do AFS não conseguiu alterar a lista de administradores para o servidor %1." - IDS_ERROR_CANT_CLONE "O Gerenciador de Servidor do AFS não conseguiu criar uma versão de backup do volume %3 na partição %2 do servidor %1." - IDS_ERROR_CANT_CLONESYS "O Gerenciador de Servidor do AFS não conseguiu criar nenhum dos volumes de backup pedidos." - IDS_ERROR_CANT_DUMP_FILESET - "O Gerenciador de Servidor do AFS não conseguiu descarregar o conteúdo do volume %3 (servidor %1, partição %2) no arquivo %4." - IDS_ERROR_CANT_RESTORE_FILESET - "O Gerenciador de Servidor do AFS não conseguiu o arquivo %4 para o volume %3 (servidor %1, partição %2)." - IDS_ERROR_CANT_SET_RESTART_TIMES - "O Gerenciador de Servidor do AFS não conseguiu alterar os horários de reinício para os serviços no servidor %1." - IDS_ERROR_CANT_DELETE_REPLICATED_FILESET - "O Gerenciador de Servidor do AFS não consegue excluir o volume %3 da partição %2 do servidor %1.\n\nO volume %3 não pode ser excluído sem antes excluir todas as suas réplicas." - IDS_CMDLINE_TITLE "Erro - Gerenciador de Servidor do AFS" - IDS_CMDLINE_SYNTAX "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida." - IDS_CMDLINE_UNRECOGNIZED - "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nO parâmetro ""%1"" não é reconhecido." - IDS_CMDLINE_DUPLICATE "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nO parâmetro ""%1"" está especificado mais de uma vez." - IDS_CMDLINE_UNEXPECTVALUE - "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nO parâmetro ""%1"" não deveria ter um valor." - IDS_CMDLINE_MISSINGVAL "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nO parâmetro ""%1"" deve ser seguido por um valor." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CMDLINE_SUBSETNOTCELL - "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nO parâmetro ""/SUBSET"" pode ser especificado somente se o parâmetro ""/CELL"" também for especificado." - IDS_CMDLINE_INVALIDSUBSET - "O subconjunto de servidores especificado, ""%2"", não foi definido para a célula %1." - IDS_CMDLINE_SERVERNOTCELL - "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nO parâmetro ""/SERVER"" pode ser especificado somente se o parâmetro ""/CELL"" também for especificado." - IDS_CMDLINE_RESET_TITLE "Gerenciador de Servidor do AFS" - IDS_CMDLINE_RESET_DESC "O Gerenciador de Servidor do AFS limpou as definições especificadas." - IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE - "O Gerenciador de Servidor do AFS não consegue sincronizar o VLDB com a partição %2 do servidor %1 porque a partição não existe ou não está exportada.\n\nPara remover esta partição do servidor %1, é preciso excluir as entradas de volume no VLDB que se referem a ela." - IDS_CMDLINE_USERPASSWORD - "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nPara obter novos tokens do AFS, os parâmetros ""USER"" e ""PASSWORD"" devem ser especificados." - IDS_ERROR_CANT_DELETE_KEY - "O Gerenciador de Servidor do AFS não conseguiu excluir a chave de servidor %2 do servidor %1." - IDS_ERROR_CANT_GETRANDOMKEY - "O Gerenciador de Servidor do AFS não conseguiu gerar uma chave aleatória para o servidor %1." - IDS_ERROR_CANT_EXECUTE_COMMAND - "O Gerenciador de Servidor do AFS não conseguiu executar o seguinte comando no servidor %1:\n\n ""%2""" - IDS_ERROR_CANT_READ_SALVAGE_LOG - "O Gerenciador de Servidor do AFS concluiu a operação de recuperação com êxito, mas não foi capaz de recuperar o arquivo de log descrevendo os resultados específicos da operação de recuperação." - IDS_ERROR_CANT_SALVAGE "O Gerenciador de Servidor do AFS não foi capaz de realizar a operação de recuperação pedida." - IDS_ERROR_CANT_AUTH_ON "O Gerenciador de Servidor do AFS não conseguiu ativar a verificação de autenticação para o servidor %1." - IDS_ERROR_CANT_AUTH_OFF "O Gerenciador de Servidor do AFS não conseguiu desativar a verificação de autenticação para o servidor %1." - IDS_ERROR_CANT_LOAD_HOSTLIST - "O Gerenciador de Servidor do AFS não conseguiu ler a lista de servidores host de banco de dados do servidor %1." - IDS_ERROR_CANT_SAVE_HOSTLIST - "O Gerenciador de Servidor do AFS não conseguiu alterar a lista de servidores host de banco de dados no servidor %1." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL - "O Gerenciador de Servidor do AFS não conseguiu iniciar porque o Centro de Controle do AFS não estava instalado corretamente.\n\nPode ser necessário reinstalar o Centro de Controle do AFS." - IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN - "O Gerenciador de Servidor do AFS não conseguiu iniciar devido a um problema desconhecido.\n\nPode ser necessário reinstalar o Centro de Controle do AFS." - IDS_ERROR_CANT_CHANGEADDR - "O Gerenciador de Servidor do AFS não conseguiu alterar o endereço IP no VLDB para o servidor %1." -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_SERVICES, DIALOG + BEGIN + RIGHTMARGIN, 165 + END + + IDD_AGGREGATES, DIALOG + BEGIN + RIGHTMARGIN, 118 + END + + IDD_FILESETS, DIALOG + BEGIN + RIGHTMARGIN, 180 + END + + IDD_SVR_LISTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_AGG_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 262 + TOPMARGIN, 5 + BOTTOMMARGIN, 155 + END + + IDD_SVR_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 183 + END + + IDD_SVR_SCOUT, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 216 + TOPMARGIN, 5 + BOTTOMMARGIN, 153 + END + + IDD_SVC_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 268 + TOPMARGIN, 5 + BOTTOMMARGIN, 209 + END + + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 315 + TOPMARGIN, 2 + BOTTOMMARGIN, 224 + END + + IDD_SERVER, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 207 + TOPMARGIN, 2 + BOTTOMMARGIN, 135 + END + + IDD_SVC_CREATE, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 228 + END + + IDD_SET_REPSITES, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 216 + TOPMARGIN, 5 + BOTTOMMARGIN, 163 + END + + IDD_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 7 + BOTTOMMARGIN, 250 + HORZGUIDE, 160 + END + + IDD_TIMEOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 232 + TOPMARGIN, 7 + BOTTOMMARGIN, 153 + END + + IDD_COLUMNS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 281 + TOPMARGIN, 5 + BOTTOMMARGIN, 143 + END + + IDD_REFRESHALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 260 + TOPMARGIN, 7 + BOTTOMMARGIN, 68 + END + + IDD_SET_CREATE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 317 + TOPMARGIN, 4 + BOTTOMMARGIN, 205 + END + + IDD_SET_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 98 + END + + IDD_SET_CLONE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 341 + TOPMARGIN, 7 + BOTTOMMARGIN, 81 + END + + IDD_SVC_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 189 + END + + IDD_SVR_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 152 + END + + IDD_AGG_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 252 + TOPMARGIN, 5 + BOTTOMMARGIN, 146 + END + + IDD_SET_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 268 + TOPMARGIN, 5 + BOTTOMMARGIN, 177 + END + + IDD_SET_MOVETO, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 170 + END + + IDD_SET_MOVING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SVC_LOGNAME, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 102 + END + + IDD_SVC_VIEWLOG, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 181 + END + + IDD_SET_SETQUOTA, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 267 + TOPMARGIN, 4 + BOTTOMMARGIN, 126 + END + + IDD_ACTIONS, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 234 + TOPMARGIN, 2 + BOTTOMMARGIN, 56 + END + + IDD_SVR_SYNCVLDB, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 265 + TOPMARGIN, 4 + BOTTOMMARGIN, 95 + END + + IDD_SET_CREATEREP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 167 + END + + IDD_SVR_INSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 259 + TOPMARGIN, 4 + BOTTOMMARGIN, 153 + END + + IDD_SVR_UNINSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 135 + END + + IDD_SVR_PRUNE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 196 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_SET_RENAME, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 129 + END + + IDD_SVC_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 64 + END + + IDD_SVR_GETDATES, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_GETDATES_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 128 + END + + IDD_SET_DUMP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 290 + TOPMARGIN, 7 + BOTTOMMARGIN, 140 + END + + IDD_SET_RESTORE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 288 + TOPMARGIN, 4 + BOTTOMMARGIN, 244 + END + + IDD_SVC_BOS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_DUMPING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SET_RESTORING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SET_CLONESYS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 159 + END + + IDD_SUBSETS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 292 + TOPMARGIN, 5 + BOTTOMMARGIN, 178 + END + + IDD_SUBSET_LOADSAVE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 296 + TOPMARGIN, 4 + BOTTOMMARGIN, 142 + END + + IDD_HELP_FIND, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 214 + TOPMARGIN, 4 + BOTTOMMARGIN, 69 + END + + IDD_HELP_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 214 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_HELP_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 226 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_OPENINGCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 236 + TOPMARGIN, 2 + BOTTOMMARGIN, 41 + END + + IDD_OPTIONS_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 274 + TOPMARGIN, 5 + BOTTOMMARGIN, 131 + END + + IDD_SVR_KEYS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_CREATEKEY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + END + + IDD_SVC_STARTSTOP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 315 + TOPMARGIN, 7 + BOTTOMMARGIN, 129 + END + + IDD_SVR_EXECUTE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_SALVAGE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 250 + TOPMARGIN, 7 + BOTTOMMARGIN, 267 + END + + IDD_SVR_SALVAGE_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 174 + END + + IDD_SET_RELEASE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 98 + END + + IDD_SVR_HOSTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_ADDHOST, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 221 + TOPMARGIN, 4 + BOTTOMMARGIN, 102 + END + + IDD_SVR_ADDRESS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 204 + TOPMARGIN, 4 + BOTTOMMARGIN, 111 + END + + IDD_SVR_NEWADDR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 219 + TOPMARGIN, 4 + BOTTOMMARGIN, 65 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""Gerenciador de Servidor do AFS""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_MAIN MENU DISCARDABLE +BEGIN + POPUP "&Célula" + BEGIN + MENUITEM "&Selecionar...", M_CELL_OPEN + MENUITEM "&Autenticação...", M_CREDENTIALS + MENUITEM SEPARATOR + MENUITEM "Sai&r", M_EXIT + END + POPUP "E&xibir" + BEGIN + POPUP "&Servidores" + BEGIN + MENUITEM "Ícones &Grandes", M_SVR_VIEW_LARGE + , CHECKED + MENUITEM "Ícones &Pequenos", M_SVR_VIEW_SMALL + , CHECKED + MENUITEM "&Detalhes", M_SVR_VIEW_REPORT + , CHECKED + MENUITEM SEPARATOR + MENUITEM "&Normal", M_SVR_VIEW_ONEICON + , CHECKED + MENUITEM "&Todos os Ícones", M_SVR_VIEW_TWOICONS + , CHECKED + MENUITEM "&Somente Status", M_SVR_VIEW_STATUS + , CHECKED + END + POPUP "Painel de &Exibição Rápida" + BEGIN + MENUITEM "&Nenhum", M_DIVIDE_NONE, CHECKED + MENUITEM "Dividir &Verticalmente", M_DIVIDE_H, CHECKED + MENUITEM "Dividir &Horizontalmente", M_DIVIDE_V, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "O&perações Em Andamento", M_ACTIONS, CHECKED + MENUITEM SEPARATOR + MENUITEM "Servidores &Monitorados...", M_SUBSET + MENUITEM "&Colunas...", M_COLUMNS + MENUITEM "&Opções...", M_OPTIONS + MENUITEM SEPARATOR + MENUITEM "A&tualizar Tudo", M_REFRESHALL + END + POPUP "&Ajuda" + BEGIN + MENUITEM "&Conteúdo", M_HELP + MENUITEM "&Procurar Comando...", M_HELP_FIND + MENUITEM "Pes&quisar Código de Erro...", M_HELP_XLATE + MENUITEM SEPARATOR + MENUITEM "&Sobre o Gerenciador de Servidor do AFS...", M_ABOUT + END +END + +MENU_AGG MENU DISCARDABLE +BEGIN + MENUITEM "&Criar Volume...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "Fazer &Backup de Volumes...", M_SET_CLONE + MENUITEM "&Desbloquear Todos os Volumes", M_SET_UNLOCK + MENUITEM "S&incronizar VLDB...", M_SYNCVLDB + MENUITEM "&Recuperar Volumes...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "A&tualizar", M_REFRESH + MENUITEM "&Propriedades", M_PROPERTIES +END + +MENU_SVC MENU DISCARDABLE +BEGIN + MENUITEM "&Iniciar", M_SVC_START + MENUITEM "Pa&rar", M_SVC_STOP + MENUITEM "Rei&niciar", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "Exibir Arquivo de &Log", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "E&xcluir", M_SVC_DELETE + MENUITEM SEPARATOR + MENUITEM "A&tualizar", M_REFRESH + MENUITEM "&Propriedades", M_PROPERTIES +END + +MENU_AGG_NONE MENU DISCARDABLE +BEGIN + POPUP "E&xibir" + BEGIN + MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED + MENUITEM "&Todos os Ícones", M_VIEW_TWOICONS, CHECKED + MENUITEM "&Somente Status", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "&Criar Volume...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "A&tualizar Tudo", M_REFRESHALL +END + +MENU_SVC_NONE MENU DISCARDABLE +BEGIN + POPUP "E&xibir" + BEGIN + MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED + MENUITEM "&Todos os Ícones", M_VIEW_TWOICONS, CHECKED + MENUITEM "&Somente Status", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "&Criar Serviço...", M_SVC_CREATE + MENUITEM SEPARATOR + MENUITEM "A&tualizar Tudo", M_REFRESHALL +END + +MENU_SET MENU DISCARDABLE +BEGIN + MENUITEM "R&eplicação...", M_SET_REPLICATION + MENUITEM "&Liberar Agora", M_SET_RELEASE + MENUITEM SEPARATOR + MENUITEM "Fazer &Backup...", M_SET_CLONE + MENUITEM "Descarre&gar para Arquivo...", M_SET_DUMP + MENUITEM "Res&taurar do Arquivo...", M_SET_RESTORE + MENUITEM "Definir &Quota...", M_SET_SETQUOTA + MENUITEM "&Recuperar...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "&Mover Para...", M_SET_MOVETO + MENUITEM "Re&nomear...", M_SET_RENAME + MENUITEM "E&xcluir", M_SET_DELETE + MENUITEM SEPARATOR + MENUITEM "Bloq&uear", M_SET_LOCK + MENUITEM "&Desbloquear", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "Atuali&zar", M_REFRESH + MENUITEM "&Propriedades", M_PROPERTIES +END + +MENU_SVR MENU DISCARDABLE +BEGIN + MENUITEM "Abrir &Janela do Servidor", M_SVR_OPEN + MENUITEM "&Fechar Janela do Servidor", M_SVR_CLOSE + MENUITEM "&Monitorar este Servidor", M_SVR_MONITOR, CHECKED + MENUITEM SEPARATOR + MENUITEM "Editar &Segurança do Servidor...", M_SVR_SECURITY + MENUITEM "Gerenciar &Hosts de Banco de Dados...", M_SVR_HOSTS + MENUITEM "Fazer &Backup de Volumes...", M_SET_CLONE + MENUITEM "&Desbloquear Todos os Volumes", M_SET_UNLOCK + MENUITEM "Si&ncronizar VLDB...", M_SYNCVLDB + MENUITEM "Recuperar &Volumes...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "&Instalar Arquivo...", M_SVR_INSTALL + MENUITEM "&Remover Instalação de Arquivo...", M_SVR_UNINSTALL + MENUITEM "Eliminar Arquivos Anti&gos...", M_SVR_PRUNE + MENUITEM SEPARATOR + MENUITEM "Obter Da&tas de Arquivo...", M_SVR_GETDATES + MENUITEM "Exibir Arquivo de &Log...", M_VIEWLOG + MENUITEM "&Executar Comando...", M_EXECUTE + MENUITEM SEPARATOR + MENUITEM "Atuali&zar", M_REFRESH + MENUITEM "&Propriedades", M_PROPERTIES +END + +MENU_SVR_NONE MENU DISCARDABLE +BEGIN + POPUP "E&xibir" + BEGIN + MENUITEM "Ícones &Grandes", M_SVR_VIEW_LARGE, CHECKED + MENUITEM "Ícones &Pequenos", M_SVR_VIEW_SMALL, CHECKED + MENUITEM "&Detalhes", M_SVR_VIEW_REPORT, CHECKED + MENUITEM SEPARATOR + MENUITEM "&Normal", M_SVR_VIEW_ONEICON, CHECKED + MENUITEM "&Todos os Ícones", M_SVR_VIEW_TWOICONS, CHECKED + MENUITEM "&Somente Status", M_SVR_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "Servidores &Monitorados...", M_SUBSET + MENUITEM SEPARATOR + MENUITEM "&Desbloquear Todos os Volumes", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "&Fechar Tudo", M_SVR_CLOSEALL + MENUITEM "A&tualizar Tudo", M_REFRESHALL +END + +MENU_SET_NONE MENU DISCARDABLE +BEGIN + POPUP "E&xibir" + BEGIN + MENUITEM "Por &Volume", M_SET_VIEW_REPORT, CHECKED + MENUITEM "Por &Partição", M_SET_VIEW_TREELIST, CHECKED + MENUITEM "Sem &Detalhes", M_SET_VIEW_TREE, CHECKED + MENUITEM SEPARATOR + MENUITEM "&Normal", M_VIEW_ONEICON, CHECKED + MENUITEM "&Todos os Ícones", M_VIEW_TWOICONS, CHECKED + MENUITEM "&Somente Status", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "&Criar Volume...", M_SET_CREATE + MENUITEM "&Restaurar do Arquivo...", M_SET_RESTORE + MENUITEM SEPARATOR + MENUITEM "Fazer &Backup de Volumes...", M_SET_CLONE + MENUITEM SEPARATOR + MENUITEM "&Desbloquear Todos", M_SET_UNLOCK + MENUITEM "A&tualizar Tudo", M_REFRESHALL +END + +MENU_COLUMNS MENU DISCARDABLE +BEGIN + MENUITEM "&Colunas...", M_COLUMNS +END + +MENU_SVC_BOS MENU DISCARDABLE +BEGIN + MENUITEM "&Reiniciar", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "E&xibir Arquivo de Log", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "A&tualizar", M_REFRESH + MENUITEM "&Propriedades", M_PROPERTIES +END + +MENU_SET_DRAGDROP MENU DISCARDABLE +BEGIN + MENUITEM "&Mover Aqui...", M_SET_MOVEHERE + MENUITEM "&Replicar Aqui...", M_SET_REPHERE + MENUITEM SEPARATOR + MENUITEM "&Cancelar", IDC_STATIC +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SERVICES DIALOGEX 0, 0, 179, 92 +STYLE DS_CENTER | WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Serviços:",IDC_SVC_DESC,0,5,179,8 + CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,0,17,179, + 61,WS_EX_STATICEDGE + PUSHBUTTON "&Criar...",IDC_SVC_CREATE,56,80,39,12 + PUSHBUTTON "E&xcluir",IDC_SVC_DELETE,98,80,39,12 + PUSHBUTTON "&Reiniciar",IDC_SVC_RESTART,140,80,39,12 +END + +IDD_AGGREGATES DIALOGEX 0, 0, 165, 84 +STYLE DS_CENTER | WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Partições:",IDC_AGG_DESC,0,5,165,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,0,17,165, + 53,WS_EX_STATICEDGE + PUSHBUTTON "&Criar Volume...",IDC_AGG_CREATESET,102,72,63,12 +END + +IDD_FILESETS DIALOGEX 0, 0, 194, 92 +STYLE DS_CENTER | WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Volumes:",IDC_SET_DESC,0,5,194,8 + CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,0,17,194, + 61,WS_EX_STATICEDGE + PUSHBUTTON "&Criar...",IDC_SET_CREATE,6,80,39,12 + PUSHBUTTON "E&xcluir",IDC_SET_DELETE,48,80,39,12 + PUSHBUTTON "&Replicação...",IDC_SET_REP,90,80,51,12 + PUSHBUTTON "Definir &Quota...",IDC_SET_SETQUOTA,144,80,49,12 +END + +IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, + 135,WS_EX_CLIENTEDGE + PUSHBUTTON "&Incluir Administrador",IDC_LIST_ADD,61,160,72,14 + PUSHBUTTON "&Remover Administrador",IDC_LIST_REMOVE,141,160,80,14 + LTEXT "Administradores para o servidor %1:",IDC_LIST_NAME,5,7, + 216,8 +END + +IDD_AGG_GENERAL DIALOGEX 0, 0, 267, 160 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "ID:",IDC_STATIC,5,30,31,8 + LTEXT "(consultando)",IDC_AGG_ID,47,30,214,8 + LTEXT "Dispositivo:",IDC_STATIC,5,46,37,8 + LTEXT "(consultando)",IDC_AGG_DEVICE,47,46,214,8 + LTEXT "Volumes:",IDC_STATIC,5,62,31,8 + LTEXT "(consultando)",IDC_AGG_FILESETS,47,62,214,8 + CONTROL "Exibir um aviso se a "a combinada dos volumes exceder a capacidade", + IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 11,76,246,10 + LTEXT "Uso:",IDC_STATIC,5,90,31,8 + LTEXT "(consultando)",IDC_AGG_USAGE,38,90,214,8 + CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,38,103,224,8, + WS_EX_STATICEDGE + CONTROL "Exibir um aviso se o uso da &partição exceder", + IDC_AGG_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38, + 116,214,10 + CONTROL "o limite padrão para este &servidor", + IDC_AGG_WARN_AGGFULL_DEF,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,49,131,203,9 + CONTROL "um &limite de",IDC_AGG_WARN_AGGFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,49,145,54,9 + EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,106,143,29,12, + ES_AUTOHSCROLL + LTEXT "% de seu tamanho",IDC_AGG_WARN_AGGFULL_DESC,152,145,100, + 8 + ICON IDI_AGGREGATE,IDC_STATIC,5,5,20,20 + LTEXT "Partição %2 (servidor %1)",IDC_AGG_NAME,38,14,214,8 +END + +IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Endereço IP:",IDC_STATIC,5,29,43,8 + LISTBOX IDC_SVR_ADDRESSES,53,29,70,12,LBS_NOSEL | NOT WS_BORDER | + WS_VSCROLL + PUSHBUTTON "Alterar &Endereços...",IDC_SVR_CHANGEADDR,144,27,77,12 + PUSHBUTTON "E&xigir Autenticação",IDC_SVR_AUTH_YES,36,85,84,12 + PUSHBUTTON "Permitir &Não Autenticado",IDC_SVR_AUTH_NO,130,85,85,14 + LTEXT "Número de partições:",IDC_STATIC,11,131,90,8 + LTEXT "(consultando)",IDC_SVR_NUMAGGREGATES,115,131,99,8 + LTEXT "Capacidade total:",IDC_STATIC,11,148,63,8 + LTEXT "(consultando)",IDC_SVR_CAPACITY,115,148,99,8 + LTEXT "Quota combinada dos volumes:",IDC_STATIC,11,165,100,8 + LTEXT "(consultando)",IDC_SVR_ALLOCATION,115,165,99,8 + ICON IDI_SERVER,IDC_STATIC,5,5,20,20 + LTEXT "(nome do servidor)",IDC_SVR_NAME,55,13,93,8 + GROUPBOX "Segurança",IDC_STATIC,5,52,216,52 + GROUPBOX "Armazenamento",IDC_STATIC,5,115,216,68 + LTEXT "Pode-se exigir que todo acesso a este servidor seja autenticado.", + IDC_STATIC,11,64,198,16 +END + +IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 221, 158 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "qualquer partição neste servidor se tornar", + IDC_SVR_WARN_AGGFULL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,18,143,9 + EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,154,16,20,12,ES_AUTOHSCROLL + LTEXT "% cheia",IDC_STATIC,188,18,28,8 + CONTROL "qualquer volume neste servidor se tornar", + IDC_SVR_WARN_SETFULL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,32,144,9 + EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,154,30,20,12,ES_AUTOHSCROLL + LTEXT "% cheio",IDC_STATIC,188,32,28,8 + CONTROL "a quota combinada em qualquer partição exceder sua capacidade", + IDC_SVR_WARN_AGGALLOC,"Button",BS_AUTOCHECKBOX | + BS_MULTILINE | WS_TABSTOP,5,46,200,14 + CONTROL "qualquer serviço neste servidor parar de executar", + IDC_SVR_WARN_SVCSTOP,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,64,195,9 + CONTROL "qualquer volume neste servidor não tiver entrada no VLDB", + IDC_SVR_WARN_SETNOVLDB,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,78,195,9 + CONTROL "o VLDB referenciar qualquer partição offline neste servidor", + IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,92,199,9 + CONTROL "o VLDB referenciar qualquer volume offline neste servidor", + IDC_SVR_WARN_SETNOSERV,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,107,195,9 + CONTROL "Atualizar informações do servidor a cada", + IDC_SVR_AUTOREFRESH,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,132,142,9 + EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,147,130,27,13,ES_AUTOHSCROLL + LTEXT "minutos",IDC_STATIC,190,132,25,8 + LTEXT "Exibir um aviso se",IDC_STATIC,5,5,195,8 +END + +IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 225, 207 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + PUSHBUTTON "E&xibir Log do Serviço",IDC_SVC_VIEWLOG,33,182,72,14 + PUSHBUTTON "&Iniciar Agora",IDC_SVC_START,113,182,48,14 + PUSHBUTTON "&Parar Agora",IDC_SVC_STOP,169,182,48,14 + CONTROL "Exibir um &aviso se este serviço alguma vez parar", + IDC_SVC_WARNSTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 11,159,200,10 + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "Serviço %2 (servidor %1)",IDC_SVC_NAME,52,13,168,8 + LTEXT "Tipo:",IDC_STATIC,5,29,44,12 + LTEXT "(consultando)",IDC_SVC_TYPE,52,29,168,12 + LTEXT "Parâmetros:",IDC_STATIC,5,45,44,12 + EDITTEXT IDC_SVC_PARAMS,53,45,157,12,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP + LTEXT "Notificador:",IDC_STATIC,5,61,44,12 + LTEXT "(consultando)",IDC_SVC_NOTIFIER,53,61,162,12 + LTEXT "Último Início:",IDC_STATIC,5,77,44,12 + LTEXT "(consultando)",IDC_SVC_STARTDATE,53,78,162,12 + LTEXT "Última Parada:",IDC_STATIC,5,93,48,10 + LTEXT "(consultando)",IDC_SVC_STOPDATE,53,93,162,12 + LTEXT "Última Falha:",IDC_STATIC,5,110,44,12 + EDITTEXT IDC_SVC_LASTERROR,53,110,158,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + GROUPBOX "Status do Serviço",IDC_STATIC,5,127,215,75 + LTEXT "O status atual deste serviço está sendo determinado...", + IDC_SVC_STATUS,11,142,200,8 +END + +IDD_SET_GENERAL DIALOGEX 0, 0, 273, 214 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "ID do Volume:",IDC_STATIC,5,30,46,8 + LTEXT "(desconhecido)",IDC_SET_ID,52,30,207,8 + LTEXT "Criado:",IDC_STATIC,5,46,39,8 + LTEXT "(consultando)",IDC_SET_CREATEDATE,52,46,208,8 + LTEXT "Atualizado:",IDC_STATIC,5,62,39,8 + LTEXT "(consultando)",IDC_SET_UPDATEDATE,52,62,216,8 + LTEXT "Acessado:",IDC_STATIC,5,78,39,8 + LTEXT "(consultando)",IDC_SET_ACCESSDATE,52,78,216,8 + LTEXT "Feito Backup:",IDC_STATIC,5,94,45,8 + LTEXT "(consultando)",IDC_SET_BACKUPDATE,52,94,212,8 + LTEXT "Contagem de Arquivos:",IDC_STATIC,5,106,45,16 + LTEXT "(consultando)",IDC_SET_FILES,52,110,193,8 + LTEXT "Status:",IDC_STATIC,5,126,39,8 + LTEXT "(consultando)",IDC_SET_STATUS,52,126,93,8 + PUSHBUTTON "&Bloquear",IDC_SET_LOCK,156,124,54,12 + PUSHBUTTON "&Desbloquear",IDC_SET_UNLOCK,214,124,54,12 + LTEXT "Uso:",IDC_STATIC,5,142,31,8 + LTEXT "(consultando)",IDC_SET_USAGE,52,142,136,8 + PUSHBUTTON "Definir &Quota...",IDC_SET_QUOTA,214,140,54,12 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,49,156,219,8, + WS_EX_STATICEDGE + CONTROL "Exibir um &aviso se o uso deste volume exceder", + IDC_SET_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,49, + 170,219,10 + CONTROL "o limite padrão para este &servidor (%1%% de seu tamanho)", + IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,61,185,207,9 + CONTROL "um &limite de",IDC_SET_WARN_SETFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,61,199,62,9 + EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,123,197,29,12, + ES_AUTOHSCROLL + LTEXT "% de seu tamanho",IDC_SET_WARN_SETFULL_DESC,163,199,105, + 8 + ICON IDI_FILESET,IDC_STATIC,5,5,20,20 + LTEXT "Volume %3 (servidor %1, partição %2)",IDC_SET_NAME,49, + 14,219,8 +END + +IDD_MAIN DIALOGEX 0, 0, 317, 226 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | + WS_SYSMENU | WS_THICKFRAME +CAPTION "Gerenciador de Servidor do AFS" +MENU MENU_MAIN +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Célula Selecionada:",IDC_STATIC,2,8,55,8 + LTEXT "(nome da célula será colocado aqui)",IDC_CELL,62,8,208, + 9 + LTEXT "Tokens do AFS:",IDC_STATIC,2,19,55,8 + LTEXT "%2:%1 (tokens expiram em %3)",IDC_AFS_ID,62,19,208,9 + CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,31,313, + 193,WS_EX_CLIENTEDGE + CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 + ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 +STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Servidor" +CLASS "ServerWindowClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_TABS," SysTabControl32",0x0,2,2,205,133 +END + +IDD_SVC_CREATE DIALOGEX 0, 0, 225, 233 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "&Servidor:",IDC_STATIC,5,36,44,8 + COMBOBOX IDC_SVC_SERVER,52,33,116,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Ser&viço:",IDC_STATIC,5,52,44,8 + COMBOBOX IDC_SVC_NAME,52,50,116,104,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Comando:",IDC_STATIC,5,70,44,8 + EDITTEXT IDC_SVC_COMMAND,52,68,168,13,ES_AUTOHSCROLL + LTEXT "&Parâmetros:",IDC_STATIC,5,88,44,8 + EDITTEXT IDC_SVC_PARAMS,52,86,168,13,ES_AUTOHSCROLL + LTEXT "&Notificador:",IDC_STATIC,5,105,44,8 + EDITTEXT IDC_SVC_NOTIFIER,52,103,168,13,ES_AUTOHSCROLL + LTEXT "Arquivo de &Log:",IDC_STATIC,5,122,44,16 + EDITTEXT IDC_SVC_LOGFILE,52,120,168,13,ES_AUTOHSCROLL + CONTROL "S&imples (executa continuamente)",IDC_SVC_TYPE_SIMPLE, + "Button",BS_AUTORADIOBUTTON,11,154,201,10 + CONTROL "Iniciar este serviço a&gora",IDC_SVC_RUNNOW,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 + CONTROL "&FS (sistema de arquivos)",IDC_SVC_TYPE_FS,"Button", + BS_AUTORADIOBUTTON,11,180,201,10 + CONTROL "C&ron (executa a intervalos especificados)", + IDC_SVC_TYPE_CRON,"Button",BS_AUTORADIOBUTTON,11,195,201, + 10 + LTEXT "&Quando executar:",IDC_STATIC,13,209,59,8 + COMBOBOX IDC_SVC_RUNDAY,75,207,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "às",IDC_STATIC,148,209,8,8 + CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,159,207, + 53,13,WS_EX_CLIENTEDGE + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "Novo serviço",IDC_SVC_DESC,52,13,168,8 + GROUPBOX "Tipo de Serviço",IDC_STATIC,5,141,215,87 +END + +IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, + 199,58,WS_EX_CLIENTEDGE + PUSHBUTTON "&Liberar Agora",IDC_SET_RELEASE,11,143,52,14 + PUSHBUTTON "&Criar...",IDC_SET_REPSITE_ADD,129,143,38,14 + PUSHBUTTON "E&xcluir",IDC_SET_REPSITE_DELETE,172,143,38,14 + LTEXT "Servidor:",-1,11,31,37,8 + LTEXT "(nome do servidor)",IDC_SET_SERVER,55,31,147,8 + LTEXT "Partição:",-1,11,44,37,8 + LTEXT "(nome da partição)",IDC_SET_AGGREGATE,55,44,147,8 + LTEXT "Volume:",-1,11,18,37,8 + LTEXT "(nome do volume)",IDC_SET_NAME,55,18,147,8 + GROUPBOX "Volume de Leitura/Gravação",-1,5,5,211,56 + GROUPBOX "Réplicas do Volume",-1,5,67,211,96 +END + +IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 254 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Selecionar Célula - Gerenciador de Servidor do AFS" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Célula:",IDC_STATIC,4,24,24,8 + COMBOBOX IDC_OPENCELL_CELL,28,22,187,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + GROUPBOX "Autenticação do AFS",IDC_STATIC,4,44,211,95 + LTEXT "&Identidade do AFS:",IDC_STATIC,15,105,61,8 + EDITTEXT IDC_OPENCELL_ID,80,103,129,14,ES_AUTOHSCROLL + LTEXT "&Senha do AFS:",IDC_STATIC,15,121,55,8 + EDITTEXT IDC_OPENCELL_PASSWORD,80,119,129,14,ES_PASSWORD | + ES_AUTOHSCROLL + PUSHBUTTON "A&vançado >>",IDC_ADVANCED,4,146,53,14 + DEFPUSHBUTTON "OK",IDOK,86,146,41,14 + PUSHBUTTON "Cancelar",IDCANCEL,130,146,41,14 + PUSHBUTTON "&Ajuda",9,174,146,41,14 + CONTROL "Monitorar &todos os servidores nesta célula", + IDC_MON_ALL,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,10, + 202,185,9 + CONTROL "&Monitorar somente um servidor:",IDC_MON_ONE,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,10,215,110,10 + EDITTEXT IDC_MON_SERVER,125,214,83,13,ES_AUTOHSCROLL + CONTROL "Monitorar somente os servidores no s&ubconjunto:", + IDC_MON_SOME,"Button",BS_AUTORADIOBUTTON | BS_MULTILINE | + WS_TABSTOP,10,229,110,17 + COMBOBOX IDC_MON_SUBSET,125,231,83,93,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Selecione a célula do AFS com a qual deseja trabalhar.", + IDC_STATIC,4,7,200,8 + GROUPBOX "Monitorar Servidores",IDC_ADVANCED_GROUP,4,166,211,84 + LTEXT "Para melhor desempenho, pode-se escolher monitorar somente um subconjunto dos servidores disponíveis nesta célula.", + IDC_STATIC,10,180,199,17 + LTEXT "(consultando...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "Para administrar uma célula, é preciso informar novamente sua senha do AFS:", + IDC_STATIC,10,81,196,17 + LTEXT "Seus tokens do AFS atuais dentro da célula selecionada:", + IDC_STATIC,10,57,196,8 +END + +IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Aviso - Gerenciador de Servidor do AFS" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "&Continuar aguardando até que a tarefa conclua normalmente", + IDC_TIMEOUT_WAIT,"Button",BS_AUTORADIOBUTTON,24,89,208, + 10 + CONTROL "&Terminar a tarefa",IDC_TIMEOUT_KILL,"Button", + BS_AUTORADIOBUTTON,24,103,208,10 + DEFPUSHBUTTON "OK",IDOK,93,139,50,14 + LTEXT "Tempo decorrido de execução da tarefa:",IDC_STATIC,4, + 119,142,8 + LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,151,119,29,8 + LTEXT "O Gerenciador de Servidor do AFS esteve aguardando por um tempo inesperadamente longo que uma tarefa da rede fosse concluída.", + IDC_STATIC,4,7,228,18 + LTEXT "Você pode deixar que a tarefa seja executada (recomendado) ou, se tiver confiança que a tarefa nunca vai terminar, permitir que o Gerenciador de Servidor do AFS termine a tarefa.", + IDC_STATIC,4,30,228,26 + LTEXT "Note que a tarefa ainda está em andamento enquanto esta janela está sendo exibida: se a tarefa concluir, esta janela fechará automaticamente.", + IDC_STATIC,4,60,228,25 +END + +IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 +STYLE WS_POPUP | WS_CAPTION +CAPTION "Colunas" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Selecionar colunas a exibir ao listar:",IDC_STATIC,5,7, + 126,8 + COMBOBOX IDC_COLUMNS,134,5,147,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Colunas &Disponíveis:",IDC_STATIC,12,40,100,8 + LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LTEXT "Colunas a E&xibir:",IDC_STATIC,173,41,100,8 + LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "&Incluir >>",IDC_COL_INSERT,119,68,46,14 + PUSHBUTTON "<< &Remover",IDC_COL_DELETE,119,88,46,14 + PUSHBUTTON "Mover para &Cima",IDC_COL_UP,149,122,60,14 + PUSHBUTTON "Mover para &Baixo",IDC_COL_DOWN,215,122,60,14 + GROUPBOX "Listar Colunas",IDC_STATIC,5,25,276,118 +END + +IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 264, 72 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Atualizando - Gerenciador de Servidor do AFS" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, + 256,8 + LTEXT "0%% concluído",IDC_REFRESH_PERCENT,4,49,216,8 + LTEXT "",IDC_REFRESH_CURRENT,4,60,216,8 + LTEXT "Aguarde...",IDC_REFRESH_DESC,4,7,256,25 + PUSHBUTTON "&Saltar",IDC_REFRESH_SKIP,222,58,38,12,NOT WS_TABSTOP +END + +IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Criar Volume" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "&Nome:",IDC_STATIC,4,30,39,8 + EDITTEXT IDC_SET_NAME,46,28,116,14,ES_AUTOHSCROLL + LTEXT "&Quota:",IDC_STATIC,4,48,39,8 + EDITTEXT IDC_SET_QUOTA,46,46,32,14,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,90,47,30,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "&Backup:",IDC_STATIC,4,66,39,8 + CONTROL "&Criar também uma versão de backup deste volume", + IDC_SET_CLONE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,46, + 66,181,8 + LTEXT "&Servidor:",IDC_STATIC,4,84,39,8 + COMBOBOX IDC_SET_SERVER,46,82,116,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Partição:",IDC_STATIC,4,102,39,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,46,102,271, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "OK",IDOK,156,191,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,211,191,50,14 + PUSHBUTTON "&Ajuda",9,267,191,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "Novo volume",IDC_STATIC,46,12,170,8 +END + +IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 277, 102 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Excluir Volume" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Cancelar",IDCANCEL,169,84,50,14 + PUSHBUTTON "OK",IDOK,115,84,50,14 + PUSHBUTTON "&Ajuda",9,223,84,50,14 + CONTROL "&Excluir o volume %3 do servidor %1, partição %2", + IDC_DELSET_SERVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 16,45,251,10 + CONTROL "Excluir a entrada no &VLDB para o volume %3", + IDC_DELSET_VLDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16, + 60,251,10 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "Atenção!\n\nEsta operação excluirá permanentemente o volume %3.", + IDC_DELSET_DESC,31,7,242,33 +END + +IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Fazer Backup de Volume - Gerenciador de Servidor do AFS" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,183,67,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,237,67,50,14 + PUSHBUTTON "&Ajuda",9,291,67,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "Um backup de volume atua como uma cópia somente de leitura desse volume. Um volume de leitura/gravação pode ter somente uma versão de backup.", + IDC_STATIC,34,9,307,17 + LTEXT "Clique em OK para criar um backup do volume %3 no servidor %1, partição %2. Se já existir um backup desse volume, ele será atualizado.", + IDC_CLONE_DESC,34,32,307,28 +END + +IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "Problemas Conhecidos",IDC_PROBLEM_BOX,5,36,215,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,138,120,61,12 + ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "Serviço %2 (servidor %1)",IDC_PROBLEM_TITLE,52,13,168,8 +END + +IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "Problemas Conhecidos",IDC_PROBLEM_BOX,5,36,216,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,172,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,201,49,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,136,120,61,12 + ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "%1",IDC_PROBLEM_TITLE,42,13,179,8 +END + +IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "Problemas Conhecidos",IDC_PROBLEM_BOX,5,35,247,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,170,119,61,12 + ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "Partição %2 (servidor %1)",IDC_PROBLEM_TITLE,38,14,214, + 8 +END + +IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + GROUPBOX "Problemas Conhecidos",IDC_PROBLEM_BOX,5,35,263,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,249,48,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 + ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "Volume %3 (servidor %1, partição %2)",IDC_PROBLEM_TITLE, + 49,14,219,8 +END + +IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Mover Volume" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,70,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "OK",IDOK,115,156,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,169,156,50,14 + PUSHBUTTON "&Ajuda",9,223,156,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,21,20 + LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,242,24 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 + LTEXT "&Mover volume para:",IDC_STATIC,4,43,116,8 +END + +IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "Movendo Volume - Gerenciador de Servidor do AFS" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_ANIMATE," SysAnimate32",WS_TABSTOP | 0x6,0,0,229, + 33 + LTEXT "Movendo o volume %3 da partição %2 no servidor %1 para a partição %5 no servidor %4...", + IDC_MOVESET_DESC,4,41,229,19 +END + +IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 277, 106 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Exibir Arquivo de Log" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Exibir arquivo de log no &servidor:",IDC_STATIC,4,45, + 107,8 + COMBOBOX IDC_VIEWLOG_SERVER,114,43,126,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "&Arquivo no servidor a exibir:",IDC_STATIC,4,64,87,8 + EDITTEXT IDC_VIEWLOG_FILENAME,97,62,176,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,169,88,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,223,88,50,14 + ICON IDI_SERVICE,IDC_STATIC,4,4,20,20 + LTEXT "Digite o caminho completo do arquivo de log que deseja exibir.", + IDC_VIEWLOG_DESC,31,10,242,21 +END + +IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 286, 185 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Exibir Arquivo de Log" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Conteúdo do arquivo:",IDC_SVC_VIEWLOG_CONTENTS,4,41,277, + 8 + EDITTEXT IDC_VIEWLOG_TEXT,4,51,277,113,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL + PUSHBUTTON "Salvar &Como:",IDC_VIEWLOG_SAVEAS,173,167,53,14 + DEFPUSHBUTTON "&Fechar",IDOK,231,167,50,14 + ICON IDI_SERVICE,-1,4,7,20,20 + LTEXT "Arquivo de log [para o serviço %2] no servidor %1", + IDC_SVC_VIEWLOG_DESC,33,7,248,8 + LTEXT "Nome do arquivo no servidor: %1", + IDC_SVC_VIEWLOG_FILENAME,33,23,248,8 +END + +IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Definir Quota do Volume" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Quota Atual:",IDC_STATIC,4,49,47,8 + LTEXT "(desconhecida)",IDC_SET_USAGE,59,49,208,8 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,59,60,208,8, + WS_EX_STATICEDGE + LTEXT "Nova &Quota:",IDC_STATIC,4,81,47,8 + EDITTEXT IDC_SET_QUOTA,59,79,32,13,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,103,79,30,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "OK",IDOK,109,112,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,163,112,50,14 + PUSHBUTTON "&Ajuda",9,217,112,50,14 + PUSHBUTTON "&Propriedades...",IDC_AGG_PROPERTIES,212,28,55,12 + LTEXT "Partição:",IDC_STATIC,4,30,47,8 + LTEXT "Partição %2 do servidor %1",IDC_SET_AGGREGATE,59,30,141, + 8 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "Volume %1",IDC_SET_NAME,59,11,208,8 +END + +IDD_ACTIONS DIALOGEX 0, 0, 236, 58 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_TOOLWINDOW +CAPTION "Operações em Andamento - Gerenciador de Servidor do AFS" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "As seguintes operações estão em andamento:", + IDC_ACTION_DESC,2,2,232,8 + CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | + 0x3,2,14,232,43 +END + +IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Sincronizar VLDB" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,107,81,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,161,81,50,14 + PUSHBUTTON "&Ajuda",9,215,81,50,14 + ICON 32515,IDC_STATIC,4,4,21,20 + LTEXT "(definido no runtime)",IDC_SYNC_DESC,37,4,228,32 + LTEXT "(definido no runtime)",IDC_SYNC_DESC2,37,44,228,24 +END + +IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Replicar Volume" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,62,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "OK",IDOK,115,153,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,169,153,50,14 + PUSHBUTTON "&Ajuda",9,223,153,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,21,20 + LTEXT "Nova réplica do volume %3",IDC_SET_NAME,31,12,242,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 + LTEXT "&Criar uma nova réplica deste volume em:",IDC_STATIC,4, + 35,125,8 +END + +IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 263, 157 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Instalar Arquivo" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Ar&quivo de origem:",IDC_STATIC,4,74,62,8 + EDITTEXT IDC_FILENAME,71,72,135,14,ES_AUTOHSCROLL + PUSHBUTTON "&Procurar...",IDC_BROWSE,209,72,50,14 + LTEXT "&Servidor de destino:",IDC_STATIC,4,94,63,8 + COMBOBOX IDC_SERVER,71,92,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Nome de destino:",IDC_STATIC,4,114,62,8 + EDITTEXT IDC_DIRECTORY,71,112,135,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,101,139,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,155,139,50,14 + PUSHBUTTON "&Ajuda",9,209,139,50,14 + ICON IDI_INSTALL,IDC_STATIC,4,4,21,20 + LTEXT "Instalar arquivo no servidor",IDC_STATIC,32,12,127,8 + LTEXT "(texto definido no runtime)\n(texto definido no runtime)\n(texto definido no runtime)\n(texto definido no runtime)", + IDC_INSTALL_DESC,4,29,255,33 +END + +IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Remover Instalação de Arquivo" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Servidor:",IDC_STATIC,4,66,35,8 + COMBOBOX IDC_SERVER,67,64,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Arquivo de destino:",IDC_STATIC,4,85,63,8 + EDITTEXT IDC_FILENAME,67,83,175,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,88,121,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,141,121,50,14 + PUSHBUTTON "&Ajuda",9,194,121,50,14 + ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 + LTEXT "Remover instalação do arquivo do servidor",IDC_STATIC, + 32,12,140,8 + LTEXT "Esta operação permite restaurar uma cópia anteriormente instalada de um arquivo em um servidor específico. Se não existir nenhuma cópia instalada anteriormente do arquivo selecionado, o arquivo será removido.", + IDC_STATIC,4,29,240,26 +END + +IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 200, 141 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Eliminar Arquivos Antigos" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Servidor:",-1,8,56,40,8 + COMBOBOX IDC_SERVER,53,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Excluir todos os arquivos de &núcleo", + IDC_OP_DELETE_CORE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 53,70,143,10 + CONTROL "Excluir todos os arquivos .&BAK (backups de arquivos)", + IDC_OP_DELETE_BAK,"Button",BS_AUTOCHECKBOX | + BS_MULTILINE | WS_TABSTOP,53,82,143,17 + CONTROL "Excluir todos os arquivos .&OLD (backups mais antigos de arquivos)", + IDC_OP_DELETE_OLD,"Button",BS_AUTOCHECKBOX | + BS_MULTILINE | WS_TABSTOP,53,101,143,17 + DEFPUSHBUTTON "OK",IDOK,39,123,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,93,123,50,14 + PUSHBUTTON "&Ajuda",9,146,123,50,14 + ICON IDI_PRUNE,-1,4,4,20,20 + LTEXT "Eliminar arquivos antigos do servidor",-1,32,12,136,8 + LTEXT "Esta operação exclui cópias de backup de arquivos instalados em um servidor específico.", + -1,4,29,192,16 + LTEXT "Arquivos a excluir:",-1,8,70,45,16 +END + +IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Renomear Volume" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Nome &Antigo:",IDC_STATIC,25,67,43,8 + EDITTEXT IDC_RENSET_OLD,74,65,122,14,ES_AUTOHSCROLL | ES_READONLY + LTEXT "&Novo nome:",IDC_STATIC,25,85,39,8 + EDITTEXT IDC_RENSET_NEW,74,83,122,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,115,115,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,169,115,50,14 + PUSHBUTTON "Ajuda",9,223,115,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "Para renomear o volume %3, digite abaixo um novo nome. Renomear altera automaticamente o nome do backup de um volume e de suas réplicas.\n\nAtenção: se você renomear um volume montado, será preciso excluir e recriar seu ponto de montagem.", + IDC_RENSET_DESC,31,7,242,48 +END + +IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 277, 68 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Excluir Serviço" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Cancelar",IDCANCEL,169,50,50,14 + PUSHBUTTON "OK",IDOK,115,50,50,14 + PUSHBUTTON "Ajuda",9,223,50,50,14 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "Atenção!\n\nEsta operação fará com que o serviço %2 seja interrompido e excluído do servidor %1.", + IDC_DELSVC_DESC,31,7,242,33 +END + +IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Obter Datas de Arquivo" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Servidor:",-1,6,56,42,8 + COMBOBOX IDC_SERVER,72,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Arquivo a consultar:",-1,6,75,63,8 + EDITTEXT IDC_FILENAME,72,73,135,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,86,107,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,140,107,50,14 + PUSHBUTTON "&Ajuda",9,194,107,50,14 + ICON IDI_GETDATES,-1,4,4,20,20 + LTEXT "Obter datas de arquivos no servidor",-1,32,12,127,8 + LTEXT "Esta operação obtém a data em que um arquivo e seus backups (se existirem) foram modificados por último.", + -1,4,29,240,16 +END + +IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Obter Datas de Arquivo - Resultados" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Servidor:",IDC_STATIC,4,30,39,8 + LTEXT "(definido no runtime)",IDC_SERVER,65,30,137,8 + LTEXT "Nome do Arquivo:",IDC_STATIC,4,45,58,8 + LTEXT "(definido no runtime)",IDC_FILENAME,65,45,137,8 + LTEXT "Data do arquivo:",IDC_STATIC,4,60,53,8 + LTEXT "(desconhecida: o arquivo não foi encontrado)", + IDC_DATE_FILE,65,60,176,8 + LTEXT "Data de .BAK:",IDC_STATIC,4,75,48,8 + LTEXT "(desconhecida: o arquivo não foi encontrado)", + IDC_DATE_BAK,65,75,176,8 + LTEXT "Data de .OLD:",IDC_STATIC,4,90,49,8 + LTEXT "(desconhecida: o arquivo não foi encontrado)", + IDC_DATE_OLD,65,90,176,8 + DEFPUSHBUTTON "&Fechar",IDOK,99,114,50,14 + ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 + LTEXT "Obter datas de arquivos no servidor",IDC_STATIC,32,12, + 127,8 +END + +IDD_SET_DUMP DIALOGEX 0, 0, 295, 144 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Descarregar Volume - Gerenciador de Servidor do AFS" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Criar arquivo de descarga &chamado",IDC_STATIC,6,39,77, + 17 + EDITTEXT IDC_DUMP_FILENAME,86,40,151,14,ES_AUTOHSCROLL + PUSHBUTTON "&Procurar...",IDC_DUMP_BROWSE,240,40,50,14 + CONTROL "Descarregar &todo o conteúdo do volume %3 (partição %1:%2)", + IDC_DUMP_FULL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,5, + 78,274,10 + CONTROL "Descarregar somente arquivos alterados &desde", + IDC_DUMP_LIMIT_TIME,"Button",BS_AUTORADIOBUTTON,5,94,160, + 10 + CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,169,93,51, + 13,WS_EX_CLIENTEDGE + CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,227,93,56, + 13,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "OK",IDOK,131,126,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,185,126,50,14 + PUSHBUTTON "&Ajuda",9,240,126,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,21,20 + LTEXT "Esta operação copia o conteúdo de um volume para um arquivo único, de forma que se pode fazer facilmente o backup de um volume. O conteúdo de volumes descarregados desta forma pode ser restaurado mais tarde.", + IDC_STATIC,29,7,261,24 + GROUPBOX "Parâmetros de Descarga",IDC_STATIC,4,62,286,53 +END + +IDD_SET_RESTORE DIALOGEX 0, 0, 292, 248 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Restaurar Volume - Gerenciador de Servidor do AFS" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Arquivo a &restaurar:",IDC_STATIC,4,33,48,19 + EDITTEXT IDC_RESTORE_FILENAME,57,30,175,14,ES_AUTOHSCROLL + PUSHBUTTON "&Procurar...",IDC_RESTORE_BROWSE,238,30,50,14 + CONTROL "Este é um arquivo de descarga de &incremento", + IDC_RESTORE_INCREMENTAL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,57,46,175,10 + LTEXT "&Volume:",IDC_STATIC,11,102,23,8 + EDITTEXT IDC_RESTORE_SETNAME,50,100,115,14,ES_AUTOHSCROLL + LTEXT "&Servidor:",IDC_STATIC,11,145,33,8 + COMBOBOX IDC_RESTORE_SERVER,51,143,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "&Partição:",IDC_STATIC,11,162,36,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,50,161,231, + 55,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "OK",IDOK,128,230,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,183,230,50,14 + PUSHBUTTON "&Ajuda",9,238,230,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "Restaurar volume do arquivo de descarga",IDC_STATIC,33, + 11,224,8 + GROUPBOX "Volume de destino",IDC_STATIC,4,63,284,160 + LTEXT "Quando se restaura um volume de um arquivo de descarga, pode-se criar um novo volume ou sobrepor um volume existente de leitura/gravação.", + IDC_STATIC,11,78,259,16 + LTEXT "(definido no runtime)\n(definido no runtime)", + IDC_RESTORE_CREATE,51,119,229,17 +END + +IDD_SVC_BOS DIALOGEX 0, 0, 225, 207 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "&Periodicamente parar e reiniciar todos os serviços neste servidor", + IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | + WS_TABSTOP,11,72,193,14 + LTEXT "&Reiniciar",IDC_BOS_GENRES_DESC1,20,91,30,8 + COMBOBOX IDC_BOS_GENRES_DATE,54,89,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "à&s",IDC_BOS_GENRES_DESC2,127,91,13,8 + CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,143, + 89,53,13,WS_EX_CLIENTEDGE + CONTROL "Periodicamente testar todos os serviços neste servidor para novos &binários", + IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | + WS_TABSTOP,11,149,201,17 + LTEXT "&Testar",IDC_BOS_BINRES_DESC1,23,174,25,8 + COMBOBOX IDC_BOS_BINRES_DATE,54,171,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "às",IDC_BOS_BINRES_DESC2,127,174,8,8 + CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,143, + 171,53,13,WS_EX_CLIENTEDGE + ICON IDI_BOSSERVICE,IDC_STATIC,5,5,20,20 + LTEXT "Serviço %2 (servidor %1)",IDC_SVC_NAME,44,13,176,8 + GROUPBOX "Serviço BOS",IDC_STATIC,5,27,215,175 + LTEXT "O serviço BOS pode ser usado para parar e reiniciar periodicamente todos os serviços neste servidor (inclusive o próprio serviço BOS).", + IDC_STATIC,11,41,200,27 + LTEXT "O serviço BOS também pode ser usado para testar periodicamente todos os serviços em um servidor, parando e reiniciando somente aqueles cujos arquivos binários forem atualizados.", + IDC_STATIC,11,112,200,32 +END + +IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "Descarregando Volume - Gerenciador de Servidor do AFS" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_ANIMATE," SysAnimate32",WS_TABSTOP | 0x6,0,0,229, + 33 + LTEXT "Criando arquivo de descarga %4 do volume %3...", + IDC_DUMPSET_DESC,4,41,229,19 +END + +IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "Restaurando Volume - Gerenciador de Servidor do AFS" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "",IDC_ANIMATE," SysAnimate32",WS_TABSTOP | 0x6,0,0,229, + 33 + LTEXT "Restaurando o volume %1 do arquivo de descarga %2...", + IDC_RESTORESET_DESC,4,41,229,19 +END + +IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 258, 163 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Fazer Backup de Volumes - Gerenciador de Servidor do AFS" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "Criar versões de backup de &todos os volumes nesta célula", + IDC_CLONE_ALL,"Button",BS_AUTORADIOBUTTON,25,48,214,10 + GROUPBOX " ",IDC_STATIC,23,63,231,77 + CONTROL "Somente criar &backups para os volumes que correspondam aos seguintes critérios:", + IDC_CLONE_SOME,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,25,59,214,18 + CONTROL "Somente volumes no &servidor:",IDC_CLONE_SVR_LIMIT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,84,115,10 + COMBOBOX IDC_CLONE_SVR,158,83,85,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Somente volumes na &partição:",IDC_CLONE_AGG_LIMIT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,100,113,10 + COMBOBOX IDC_CLONE_AGG,158,99,85,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Somente volumes &começando com:",IDC_CLONE_PREFIX_LIMIT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,117,125,10 + EDITTEXT IDC_CLONE_PREFIX,158,116,85,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,95,145,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,149,145,50,14 + PUSHBUTTON "&Ajuda",9,204,145,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "Um backup de volume atua como uma cópia somente de leitura desse volume. Somente um volume de leitura/gravação pode ter uma versão de backup.\nPode-se criar versões de backup para mais de um volume ao mesmo tempo.", + IDC_STATIC,30,7,214,40 +END + +IDD_SUBSETS DIALOGEX 0, 0, 297, 183 +STYLE WS_POPUP | WS_CAPTION +CAPTION "Servidores Monitorados" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Nome do subconjunto:",IDC_STATIC,10,77,74,8 + EDITTEXT IDC_SUBSET_NAME,85,75,113,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_TABSTOP + PUSHBUTTON "&Abrir...",IDC_SUBSET_LOAD,204,75,39,14 + PUSHBUTTON "&Salvar...",IDC_SUBSET_SAVE,248,75,39,14 + CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x153,12,111,193,58,WS_EX_CLIENTEDGE + PUSHBUTTON "Monitorar &Todos",IDC_SUBSET_ALL,211,122,78,14 + PUSHBUTTON "Não Monitorar &Nenhum",IDC_SUBSET_NONE,211,140,78,14 + LTEXT "Para melhorar o desempenho ao trabalhar numa célula grande, pode-se optar por não monitorar certos servidores. O Gerenciador de Servidor do AFS não mostrará os volumes, partições ou serviços em nenhum servidor que não seja monitorado.", + IDC_STATIC,5,5,287,24 + LTEXT "Pode-se escolher monitorar (ou não) um servidor por vez. É possível criar subconjuntos de servidores para designar listas de servidores que devem ser monitorados.", + IDC_STATIC,5,34,287,26 + GROUPBOX "Subconjunto Atual",IDC_STATIC,5,64,287,114 + LTEXT "Servidores a Monitorar:",IDC_STATIC,10,95,89,8 +END + +IDD_SUBSET_LOADSAVE DIALOGEX 0, 0, 300, 146 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | + WS_CAPTION | WS_SYSMENU +CAPTION "(título definido no runtime)" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "&Nome do Subconjunto:",1090,5,112,78,8,SS_NOTIFY + EDITTEXT IDC_SUBSET_NAME,84,110,156,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "&Abrir",IDOK,246,110,50,14 + PUSHBUTTON "Cance&lar",IDCANCEL,246,128,50,14 + CONTROL "List1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | + LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,292,82, + WS_EX_CLIENTEDGE + PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT + WS_TABSTOP + PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT + WS_TABSTOP + LTEXT "Subconjuntos já definidos para esta célula:",IDC_STATIC, + 4,6,155,8 +END + +IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Procurar Comando" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + COMBOBOX IDC_FIND_COMMAND,4,38,137,170,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Exibir &Ajuda",IDOK,147,38,67,14 + PUSHBUTTON "&Cancelar",IDCANCEL,147,55,67,14 + LTEXT "Para descobrir como usar o Gerenciador de Servidor do AFS para realizar uma tarefa, selecione uma linha de comando abaixo e clique no botão Exibir Ajuda.", + IDC_STATIC,4,4,210,25 +END + +IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 141 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Pesquisar Código de Erro" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Número do &Erro:",IDC_STATIC,4,41,51,8 + EDITTEXT IDC_ERROR_NUMBER,59,39,78,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "&Converter",IDC_ERROR_TRANSLATE,147,39,67,14 + PUSHBUTTON "&Fechar",IDCANCEL,85,123,48,14 + LTEXT "(texto definido no runtime)",IDC_ERROR_DESC,4,64,210,55 + LTEXT "Para descobrir o que significa um código de erro, digite o código abaixo e clique no botão ""Converter"".", + IDC_STATIC,4,4,210,25 + CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 +END + +IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "Sobre o Gerenciador de Servidor do AFS" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 + LTEXT "Gerenciador de Servidor do AFS versão 3.5",IDC_STATIC, + 33,8,163,8 + LTEXT "Copyright © IBM Corporation 1989, 1999",IDC_STATIC,33, + 20,183,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 + CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 + PUSHBUTTON "&Fechar",IDOK,89,123,50,14 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 +END + +IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "O Gerenciador de Servidor do AFS está procurando servidores na célula %1...", + IDC_OPENCELL_DESC,41,15,183,16 + GROUPBOX "",IDC_STATIC,4,2,231,39 + ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 279, 136 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + CONTROL "Exibir nomes completos de domínio para servidores (tais como, ""machine.company.com"")", + IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | + BS_MULTILINE | WS_TABSTOP,5,2,269,17 + CONTROL "Exibir um &aviso ao trabalhar sem tokens administrativos", + IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,20,269,10 + CONTROL "...sempre mostra as propriedades desse servidor", + IDC_OPT_SVR_DBL_PROP,"Button",BS_AUTORADIOBUTTON,17,42, + 253,10 + CONTROL "...mostra as propriedades desse servidor somente se o Painel de Exibição Rápida estiver aberto", + IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,17,52,253,15 + CONTROL "...sempre abre uma janela para esse servidor", + IDC_OPT_SVR_DBL_OPEN,"Button",BS_AUTORADIOBUTTON,17,67, + 253,10 + CONTROL "...abrir uma janela de servidor faz com que esse servidor seja monitorado", + IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,17,98,253,10 + CONTROL "...fechar uma janela de servidor faz com que esse servidor deixe de ser monitorado", + IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | + BS_MULTILINE | WS_TABSTOP,17,109,253,17 + LTEXT "Dar um clique duplo no ícone de um servidor...", + IDC_STATIC,5,32,269,8 + LTEXT "Se um subconjunto de servidores estiver em uso e o painel de Exibição Rápida estiver fechado...", + IDC_STATIC,5,80,269,16 +END + +IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,22,216, + 135,WS_EX_CLIENTEDGE + PUSHBUTTON "&Incluir Chave do Servidor",IDC_KEY_ADD,17,160,98,14 + PUSHBUTTON "&Remover Chave do Servidor",IDC_KEY_REMOVE,123,160,98, + 14 + LTEXT "Chaves para o servidor:",IDC_KEY_NAME,5,7,216,8 +END + +IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Incluir chave do Servidor" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Versão:",IDC_STATIC,7,37,26,8 + EDITTEXT IDC_KEY_VERSION,43,35,43,14,ES_AUTOHSCROLL + LTEXT "Valor:",IDC_STATIC,7,58,21,8 + CONTROL "Criptografar esta cadeia:",IDC_KEY_BYSTRING,"Button", + BS_AUTORADIOBUTTON,27,58,90,10 + CONTROL "Usar esta chave:",IDC_KEY_BYDATA,"Button", + BS_AUTORADIOBUTTON,27,76,73,10 + EDITTEXT IDC_KEY_STRING,119,56,155,14,ES_PASSWORD | + ES_AUTOHSCROLL + EDITTEXT IDC_KEY_DATA,119,75,103,14,ES_AUTOHSCROLL + PUSHBUTTON "&Aleatória",IDC_KEY_RANDOM,226,75,48,14 + LTEXT "Lembrete: após incluir uma chave para um servidor, deve-se modificar a conta do AFS para usar a nova chave. Após alguns dias, pode-se remover quaisquer chaves antigas do servidor.", + IDC_STATIC,7,99,267,25 + DEFPUSHBUTTON "OK",IDOK,116,129,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,170,129,50,14 + PUSHBUTTON "Ajuda",9,224,129,50,14 + LTEXT "Nova chave para o servidor %1",IDC_KEY_TITLE,43,14,181, + 8 + ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 +END + +IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 319, 133 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Iniciar/Parar Serviço" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,115,115,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,169,115,50,14 + PUSHBUTTON "&Ajuda",9,265,115,50,14 + ICON IDI_SERVICE,IDC_STATIC,4,7,21,20 + LTEXT "Clique em OK para iniciar/parar o serviço %2 no servidor %1.", + IDC_STARTSTOP_TEXT,73,12,242,9 + CONTROL "&Permanente (IDS_START/STOPSERVICE_PERMANENT)", + IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON,37, + 68,272,10 + CONTROL "&Temporária (IDS_START/STOPSERVICE_TEMPORARY)", + IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON,37, + 83,270,10 + GROUPBOX "Inicialização do Serviço",IDC_STATIC,31,31,284,70 + LTEXT "Pode-se tornar esta alteração permanente, de modo que o serviço %2 inicie (ou não) automaticamente se o servidor %1 for reiniciado.", + IDC_STARTSTOP_STARTUP,38,45,223,16 +END + +IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 248, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Executar Comando" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Servidor:",IDC_STATIC,4,60,42,8 + COMBOBOX IDC_SERVER,50,58,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Comando:",IDC_STATIC,4,79,42,8 + EDITTEXT IDC_COMMAND,50,77,194,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,86,107,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,140,107,50,14 + PUSHBUTTON "&Ajuda",9,194,107,50,14 + ICON IDI_SERVER,IDC_STATIC,4,4,20,20 + LTEXT "Executar comando no servidor",IDC_STATIC,32,12,185,8 + LTEXT "Esta operação permite emitir um comando em um servidor remoto.\nNormalmente é usada para reiniciar um servidor executando o script /etc/reboot.", + IDC_STATIC,4,29,240,24 +END + +IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 254, 271 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Recuperar Volumes - Gerenciador de Servidor do AFS" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "&Servidor:",IDC_STATIC,9,50,35,8 + COMBOBOX IDC_SERVER,46,48,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Partição:",IDC_STATIC,9,67,35,8 + COMBOBOX IDC_AGGREGATE,46,65,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Re&cuperar todas as partições",IDC_AGGREGATE_ALL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,138,65,108,11 + LTEXT "V&olume:",IDC_STATIC,8,85,35,8 + COMBOBOX IDC_FILESET,46,83,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Rec&uperar todos os volumes",IDC_FILESET_ALL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,138,84,105,10 + DEFPUSHBUTTON "OK",IDOK,85,104,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,142,104,50,14 + PUSHBUTTON "&Ajuda",9,199,104,50,14 + PUSHBUTTON "A&vançado >>",IDC_ADVANCED,4,104,53,14 + LTEXT "Caminho para arquivos &temporários:",IDC_STATIC,10,125, + 74,17 + EDITTEXT IDC_SALVAGE_TEMPDIR,100,124,144,13,ES_AUTOHSCROLL + CONTROL "Operações Pa&ralelas de recuperação; número de processos:", + IDC_SALVAGE_SIMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 8,159,205,10 + EDITTEXT IDC_SALVAGE_NUM,213,156,19,13,ES_AUTOHSCROLL + CONTROL "&Não recuperar volumes danificados", + IDC_SALVAGE_READONLY,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,8,169,123,10 + CONTROL "&Quebrar operações de leitura em pequenos blocos", + IDC_SALVAGE_BLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 8,179,180,10 + CONTROL "&Forçar recuperação de todos os volumes indicados", + IDC_SALVAGE_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 8,189,181,10 + CONTROL "Forçar r&econstrução da estrutura de diretórios", + IDC_SALVAGE_FIXDIRS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,8,199,157,10 + LTEXT "Nome do arquivo para o &log de resultados:",IDC_STATIC, + 10,214,74,17 + EDITTEXT IDC_SALVAGE_LOG_FILE,92,215,144,13,ES_AUTOHSCROLL + CONTROL "Incluir lista de inodes &danificados no log de resultados", + IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,8,235,203,10 + CONTROL "&Incluir lista de inodes raiz de propriedade do AFS no log de resultados", + IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,8,249,232,10 + ICON IDI_SERVER,IDC_STATIC,4,7,20,20 + LTEXT "Esta operação permite resolver problemas em um ou mais volumes.\n\nNota: Se você recuperar toda uma partição ou servidor de uma só vez, o servidor será posto temporariamente off-line.", + IDC_STATIC,36,7,214,32 + GROUPBOX "Opções Avançadas de Recuperação",IDC_ADVANCED_GROUP,4, + 145,246,122 +END + +IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Recuperar Volumes - Resultados" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "&Fechar",IDOK,232,160,50,14 + LTEXT "Resultados da operação de recuperação:",IDC_STATIC,4,33, + 277,8 + EDITTEXT IDC_SALVAGE_DETAILS,4,43,277,113,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP + ICON IDI_SERVER,IDC_STATIC,4,7,21,20 + LTEXT "Recuperar volume %3 na partição %2 do servidor %1", + IDC_SALVAGE_TITLE,33,15,248,8 +END + +IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 277, 102 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Liberar Volume" +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,115,84,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,169,84,50,14 + PUSHBUTTON "&Ajuda",9,223,84,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "Esta operação permite atualizar as réplicas do volume %3. Pode-se escolher atualizar somente réplicas desatualizadas, ou todas as réplicas.", + IDC_RELSET_DESC,31,7,242,26 + CONTROL "&Atualizar somente as réplicas do volume que estejam desatualizadas", + IDC_RELSET_NORMAL,"Button",BS_AUTORADIOBUTTON,13,41,227, + 10 + CONTROL "Atualizar &todas as réplicas do volume, mesmo que não estejam desatualizadas", + IDC_RELSET_FORCE,"Button",BS_AUTORADIOBUTTON,13,56,258, + 10 +END + +IDD_SVR_HOSTS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + PUSHBUTTON "&Incluir Servidor Host",IDC_HOST_ADD,67,160,68,14 + PUSHBUTTON "&Remover Servidor Host",IDC_HOST_REMOVE,141,160,80,14 + LTEXT "Servidores host de banco de dados reconhecidos pelo servidor:", + IDC_HOST_TITLE,5,7,216,8 + CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, + 135,WS_EX_CLIENTEDGE +END + +IDD_SVR_ADDHOST DIALOGEX 0, 0, 225, 106 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Incluir Servidor Host" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "&Host:",-1,31,55,26,8 + EDITTEXT IDC_ADDHOST_HOST,61,53,103,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,63,88,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,117,88,50,14 + ICON IDI_SERVER,-1,4,4,21,20 + LTEXT "Você escolheu incluir um servidor host de banco de dados à lista armazenada no servidor %1.\n\nDigite abaixo o nome do novo host de banco de dados.", + IDC_ADDHOST_DESC,31,10,190,34 + PUSHBUTTON "Ajuda",9,171,88,50,14 +END + +IDD_SVR_ADDRESS DIALOGEX 0, 0, 208, 115 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Alterar Endereços de Servidor" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Endereços IP gravados no VLDB para o servidor %1:", + IDC_TITLE,4,4,200,8 + LISTBOX IDC_SVR_ADDRESSES,4,14,147,40,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Al&terar...",IDC_ADDR_CHANGE,154,24,50,14 + PUSHBUTTON "&Remover",IDC_ADDR_REMOVE,154,40,50,14 + DEFPUSHBUTTON "OK",IDOK,46,97,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,100,97,50,14 + PUSHBUTTON "Ajuda",9,154,97,50,14 + LTEXT "Nota: quando um servidor de arquivos é iniciado, ele registra automaticamente seu(s) endereço(s) IP atual (atuais) com o VLDB.", + IDC_STATIC,4,64,200,25 +END + +IDD_SVR_NEWADDR DIALOGEX 0, 0, 223, 69 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Alterar Endereço IP" +CLASS "AFSManagerClass" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,61,51,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,115,51,50,14 + PUSHBUTTON "Ajuda",9,169,51,50,14 + LTEXT "Digite o novo endereço IP que deve substituir %1 no VLDB:", + IDC_TITLE,4,4,215,8 + CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,45,23, + 90,14 + LTEXT "Endereço:",IDC_STATIC,4,26,36,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" +32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" +32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" +IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" +IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" +IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" +IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" +IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" +IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" +IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" +IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" +IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" +IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" +IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" +IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" +IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" +IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" +IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +ACCEL_MAIN ACCELERATORS DISCARDABLE +BEGIN + VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT + VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT + VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT + VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT + VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT + VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT + VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT + VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, + NOINVERT + VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_LISTS_TITLE "Servidor %1 - Listas de Admin" + IDS_TAB_SERVICES "Serviços" + IDS_TAB_AGGREGATES "Partições" + IDS_TAB_FILESETS "Volumes" + IDS_SERVICE_NONESELECTED "Selecione um servidor para ser exibido." + IDS_SERVICE_GOTSELECTED "Processos de serviço no servidor %1:" + IDS_AGGREGATE_ALL "Partições em todos os servidores:" + IDS_AGGREGATE_ONE "Partições no servidor %1:" + IDS_FILESET_ALL "Todos os volumes na célula %1:" + IDS_FILESET_ONE "Volumes no servidor %1:" + IDS_SVR_LISTS_TAB "Listas de Admin" + IDS_SVR_PROP_TITLE "Servidor %1 - Propriedades" + IDS_SVR_GENERAL_TAB "Geral" + IDS_SVR_SCOUT_TAB "Definições" + IDS_SERVER_TITLE "Servidor %1 - Gerenciador de Servidor do AFS" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_DESC "Servidor %1 na célula %2:" + IDS_SVC_PROP_TITLE "Serviço %2 no Servidor %1 - Propriedades" + IDS_SVC_GENERAL_TAB "Geral" + IDS_SVC_ADD_TITLE "Criar Serviço" + IDS_SVC_ADD_TAB "Criar Serviço" + IDS_AGG_PROP_TITLE "Partição %2 no Servidor %1 - Propriedades" + IDS_AGG_GENERAL_TAB "Geral" + IDS_SET_REP_TITLE "Volume %1 - Replicação" + IDS_SET_REPSITES_TAB "Locais de Replicação" + IDS_SET_PROP_TITLE "Volume %1 - Propriedades" + IDS_SET_GENERAL_TAB "Geral" + IDS_SET_UNLOCKBTN "&Desbloquear Agora" + IDS_SET_LOCKBTN "&Bloquear Agora" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_USAGE_FILESET "%1 usado da quota de %2 (%3%%)" + IDS_USAGE_AGGREGATE "%1 usado da capacidade de %2 (%3%%)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGCOL_ALLOCATED "Quota Combinada" + IDS_SVRCOL_NAME "Servidor" + IDS_SVRCOL_STATUS "Status" + IDS_SETCOL_DATE_ACCESS "Último Acesso" + IDS_SETCOL_DATE_BACKUP "Último Backup" + IDS_SVCCOL_NAME "Serviço" + IDS_SVCCOL_TYPE "Tipo" + IDS_SVCCOL_PARAMS "Parâmetros" + IDS_SVCCOL_STATUS "Status" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_DATE_START "Último Início" + IDS_SVCCOL_DATE_STOP "Última Parada" + IDS_SVCCOL_DATE_STARTSTOP "Último Início/Parada" + IDS_SVCCOL_DATE_FAILED "Última Falha" + IDS_SVCCOL_LASTERROR "Último Código de Saída" + IDS_AGGCOL_NAME "Partição" + IDS_AGGCOL_ID "ID" + IDS_AGGCOL_DEVICE "Dispositivo" + IDS_AGGCOL_USED "Usado" + IDS_AGGCOL_USED_PER "% Usado" + IDS_AGGCOL_FREE "Livre" + IDS_AGGCOL_TOTAL "Capacidade" + IDS_AGGCOL_STATUS "Status" + IDS_SETCOL_NAME "Volume" + IDS_SETCOL_TYPE "Tipo" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETCOL_DATE_CREATE "Criado" + IDS_SETCOL_DATE_UPDATE "Última Atualização" + IDS_SETCOL_STATUS "Status" + IDS_SETCOL_QUOTA_USED "Usado" + IDS_SETCOL_QUOTA_USED_PER "% Usado" + IDS_SETCOL_QUOTA_FREE "Livre" + IDS_SETCOL_QUOTA_TOTAL "Quota" + IDS_TRYAGAINBTN "Tentar &Novamente" + IDS_NO_CELL_SELECTED "(nenhuma célula foi especificada)" + IDS_NO_AFS_ID "(nenhum token está disponível)" + IDS_AFS_ID_WILLEXP "%1 (tokens irão vencer em %2)" + IDS_ELAPSED_TIME "%1" + IDS_SEARCHING_FOR_SERVERS + "Aguarde: obtendo informações sobre a célula %1..." + IDS_STATUS_NOALERTS "Normal" + IDS_TITLE_BROWSE_USER "Selecionar Usuário" + IDS_AGGTYPE_OTHER "Desconhecido (%1)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATEFILESET "Criando volume %3 na partição %1:%2" + IDS_ACTION_DELETEFILESET "Excluindo volume %3 da partição %1:%2" + IDS_ACTION_MOVEFILESET "Movendo volume %3 para a partição %1:%2" + IDS_ACTION_SETFILESETQUOTA "Alterando a quota para o volume %3" + IDS_SVCSTOP_DESC2 "Clique em OK para interromper este serviço." + IDS_SVCSTART_DESC2 "Clique em OK para iniciar este serviço." + IDS_SYNCVLDB_SVR_DESC "Atenção!\n\nSe você prosseguir, o Gerenciador de Servidor do AFS modificará o VLDB para corresponder ao conteúdo de todas as partições no servidor %1." + IDS_SYNCVLDB_SVR_DESC2 "Se o VLDB mencionar um volume que por algum motivo não possa ser localizado no momento em nenhuma partição no servidor %1, a entrada para aquele volume no VLDB será excluída!" + IDS_SYNCVLDB_AGG_DESC "Atenção!\n\nSe você prosseguir, o Gerenciador de Servidor do AFS modificará o VLDB para corresponder ao conteúdo da partição %2 no servidor %1." + IDS_SYNCVLDB_AGG_DESC2 "Se o VLDB mencionar um volume que por algum motivo não possa ser localizado nessa partição, a entrada para aquele volume no VLDB será excluída!" + IDS_PROMPT_BROWSE_USER "Usuário:" + IDS_PREVIEWIN_BUTTON "<< &Pré-exibição" + IDS_PREVIEWOUT_BUTTON "&Pré-exibição >>" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ADMCOL_TYPE_USER "Usuário" + IDS_TITLE_BROWSE_PRINCIPAL "Selecionar Usuário Principal" + IDS_TITLE_BROWSE_OWNGROUP "Selecionar Grupo Proprietário" + IDS_PROMPT_BROWSE_PRINCIPAL "Proprietário:" + IDS_PROMPT_BROWSE_OWNGROUP "Grupo Proprietário:" + IDS_ACTION_CLONE "Criando versão de backup do volume %3" + IDS_ACTION_CLONESYS "Criando múltiplos backups do volume" + IDS_CLONESYS_FAILED "Não foi possível criar um backup do volume %1 devido ao erro 0x%2 (%3)." + IDS_SET_UNSPECIFIED "(não especificado)" + IDS_SETCOL_ID "ID" + IDS_SETCOL_FILES "Contagem de Arquivos" + IDS_SET_DUMP_NAME "Descarga de %1.DMP" + IDS_ACTION_DUMP "Descarregando o volume %3 (partição %1:%2)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FILESETNAME_ERROR "%1 - %2" + IDS_SETCOL_AGGREGATE "Partição" + IDS_REFRESH_DESC_CELL "O Gerenciador de Servidor do AFS está determinando o status dos servidores na célula %1. Isto pode levar alguns minutos..." + IDS_REFRESH_DESC_SERVER "O Gerenciador de Servidor do AFS está determinando o status do servidor %1. Isto pode levar alguns momentos..." + IDS_REFRESH_CURRENT_CELL "Examinando no momento: célula %1" + IDS_REFRESH_CURRENT_SERVER "Examinando no momento: servidor %1" + IDS_REFRESH_CURRENT_AGGREGATE + "Examinando no momento: partição %3 no servidor %2" + IDS_REFRESH_CURRENT_FILESET + "Examinando no momento: volume %4 no servidor %2, partição %3" + IDS_REFRESH_CURRENT_SERVICE + "Examinando no momento: serviço %3 no servidor %2" + IDS_REFRESH_PERCENT "%1%% concluído" + IDS_PROBLEMS "Problemas" + IDS_SERVER_NO_PROBLEMS "Este servidor não tem problemas conhecidos." + IDS_SERVICE_NO_PROBLEMS "Este serviço não tem problemas conhecidos." + IDS_AGGREGATE_NO_PROBLEMS "Esta partição não tem problemas conhecidos." + IDS_FILESET_NO_PROBLEMS "Este volume não tem problemas conhecidos." + IDS_AGGTYPE_TYPE1 "UFS" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGTYPE_TYPE2 "LFS" + IDS_AGGTYPE_TYPE3 "AIX" + IDS_AGGTYPE_TYPE4 "VXFS" + IDS_AGGTYPE_TYPE5 "DMEPI" + IDS_REFRESH_CURRENT_VLDB + "Examinando no momento: banco de dados de localização de volumes (VLDB)" + IDS_FILESETTYPE_RW "Leitura/Gravação" + IDS_FILESETTYPE_RO "Réplica" + IDS_FILESETTYPE_CLONE "Backup" + IDS_MOVESET_READWRITE "Prosseguir fará com que o volume %3 seja movido da partição %2 do servidor %1 para outra localização." + IDS_MOVESET_READONLY "Prosseguir fará com que a réplica do volume %3 seja removida da partição %2 do servidor %1, e que outra réplica do volume seja criada na partição especificada abaixo." + IDS_SVC_START_TITLE "Iniciar Serviço" + IDS_SVC_STOP_TITLE "Parar Serviço" + IDS_SERVICESTATUS_STARTING "Este serviço está iniciando no momento." + IDS_SERVICESTATUS_RUNNING "Este serviço está em execução no momento." + IDS_SERVICESTATUS_STOPPED "Este serviço está parado no momento." + IDS_SERVICESTATUS_STOPPING "Este serviço está parando no momento." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICESTATUS_UNKNOWN "O status deste serviço é desconhecido." + IDS_SVC_RESTART_BUTTON "Parar e &Reiniciar Agora" + IDS_PROBLEM_BOX "Problemas Conhecidos (%1)" + IDS_VIEWLOG_DESC_NOFILE "O Gerenciador de Servidor do AFS não conseguiu encontrar o arquivo de log para o serviço %2 no servidor %1. Digite abaixo o nome completo do caminho para o arquivo de log do serviço." + IDS_NO_GROUP "(nenhum grupo proprietário)" + IDS_VIEWLOG_FROMSERVER "Arquivo de log no servidor %1" + IDS_VIEWLOG_FROMSERVICE "Arquivo de log para o serviço %2 no servidor %1" + IDS_VIEWLOG_TRUNCATED "Conteúdo do arquivo (somente as últimas %1 linhas são exibidas):" + IDS_SAVELOG_FILTER "Arquivo de Texto|*.TXT|" + IDS_ADVANCEDIN_BUTTON "<< A&vançado" + IDS_ADVANCEDOUT_BUTTON "A&vançado >>" + IDS_REPTYPE_RELEASE "Liberar Replicação" + IDS_REPTYPE_SCHEDULED "Replicação Programada" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_UPDATEALL_BUTTON "A&tualizar Tudo" + IDS_UPDATETHIS_BUTTON "At&ualizar" + IDS_SERVER_MULTIPLE_PROBLEMS "Este servidor tem %1 problemas conhecidos." + IDS_SERVICE_MULTIPLE_PROBLEMS "Este serviço tem %1 problemas conhecidos." + IDS_AGGREGATE_MULTIPLE_PROBLEMS + "Esta partição tem %1 problemas conhecidos." + IDS_FILESET_MULTIPLE_PROBLEMS "Este volume tem %1 problemas conhecidos." + IDS_FILESETTYPE_RO_STAGE "Réplica" + IDS_SERVICETYPE_SIMPLE_LONG "Simples (executa continuamente)" + IDS_SERVICETYPE_CRON_LONG + "Cronometrado (executa a intervalos especificados)" + IDS_QUOTAUNITS_KB "kb" + IDS_QUOTAUNITS_MB "MB" + IDS_NO_QUOTA_REPLICA "(este volume é uma réplica e portanto não tem quota)" + IDS_NO_QUOTA_CLONE "(este volume é um backup e portanto não tem quota)" + IDS_USAGE_REPLICA "%1 usado" + IDS_USAGE_CLONE "%1 usado" + IDS_COL_AGGS_MOVE "partições ao criar um volume" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PERCENTAGE "%1 %%" + IDS_AGGREGATES_IN_SERVER "Partições no servidor %1:" + IDS_AGGREGATES_IN_CELL "Todas as partições na célula %1:" + IDS_AGGREGATES_IN_NOTHING "Partições:" + IDS_FILESETS_IN_SERVER "Volumes no servidor %1:" + IDS_FILESETS_IN_CELL "Todos os volumes na célula %1:" + IDS_FILESETS_IN_NOTHING "Volumes:" + IDS_SERVICES_IN_SERVER "Serviços no servidor %1:" + IDS_SERVICES_IN_NOTHING "Serviços:" + IDS_UNKNOWN "(desconhecido)" + IDS_UNKNOWN_GROUP "grupo #%1 (nome desconhecido)" + IDS_AGGFULL_WARN_OFF "o limite padrão (aviso desativado no servidor)" + IDS_SERVER_AGGREGATE "%1:%2" + IDS_SERVERNAME_ERROR "%1 - %2" + IDS_AGGREGATENAME_ERROR "%1 - %2" + IDS_SETFULL_WARN_OFF "o limite padrão (aviso desativado no servidor)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_LASTERRORDATE "%1 - Código de saída %2" + IDS_COL_SERVERS "servidores em uma célula" + IDS_COL_FILESETS "volumes em um servidor" + IDS_COL_AGGREGATES "partições em um servidor" + IDS_COL_SERVICES "serviços em um servidor" + IDS_COL_REPLICAS "réplicas de um volume" + IDS_COLUMNS_TITLE "Selecionar Colunas de Exibição - Gerenciador de Servidor do AFS" + IDS_REPCOL_SERVER "Servidor" + IDS_REPCOL_AGGREGATE "Partição" + IDS_REPCOL_DATE_UPDATE "Última Atualização" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COL_AGGS_CREATE "partições ao mover um volume" + IDS_WARN_TITLE "Atenção" + IDS_WARN_DISABLE_AUTH "Clicando o botão ""Permitir Não Autenticado"", você permitirá que proprietários não autenticados manipulem os serviços neste servidor. Como muitos serviços executam sob a identidade root, esta ação representa +" + IDS_WARN_DISABLE_AUTH2 "um risco significativo na segurança do servidor.\n\nDeseja realmente fazer esta alteração?" + IDS_SVR_NO_ADDR "(não especificado)" + IDS_TITLE_BAD_CELL "Nome de Célula Não Reconhecido" + IDS_DESC_BAD_CELL "O nome de célula informado não foi encontrado na rede.\n\nVerifique o nome novamente para certificar-se de que esteja correto." + IDS_AGGFULL_WARN_ON "o &limite padrão para este servidor (%1%% de seu tamanho)" + IDS_SETFULL_WARN_ON "o &limite padrão para este servidor (%1%% de seu tamanho)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_ERROR_BAD_CREDENTIALS + "A identificação do AFS informada não é reconhecida, ou a senha especificada está incorreta." + IDS_SVR_CREDS_NONE "(nenhum token)" + IDS_SVR_CREDS_VALID "%2, vence em %3" + IDS_SVR_CREDS_EXPIRED "(tokens vencidos em %3)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGG_FILESETS "%1 (Quota combinada: %2)" + IDS_ACTION_DESC_NONE "Não há operações em andamento." + IDS_ACTION_DESC_ONE "A seguinte operação está em andamento:" + IDS_ACTION_DESC_MULT "As seguintes operações estão em andamento:" + IDS_ACTCOL_OPERATION "Operação" + IDS_ACTCOL_ELAPSED "Tempo Decorrido" + IDS_ACTION_REFRESH "Atualizando informações da célula" + IDS_ACTION_CREATESERVER "Criando o servidor %1" + IDS_ACTION_DELETESERVER "Excluindo o servidor %1" + IDS_ACTION_GETSERVERLOGFILE "Obtendo o arquivo de log %2 do servidor %1" + IDS_ACTION_SETSERVERAUTH + "Alterando as restrições de acesso para o servidor %1" + IDS_ACTION_CHANGESERVERSTATUS "Alterando as propriedades do servidor %1" + IDS_ACTION_STARTSERVICE "Iniciando o serviço %2 no servidor %1" + IDS_ACTION_STOPSERVICE "Parando o serviço %2 no servidor %1" + IDS_ACTION_RESTARTSERVICE "Reiniciando o serviço %2 no servidor %1" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SYNCVLDB_SVR "Sincronizando o VLDB com o servidor %1" + IDS_ACTION_SYNCVLDB_AGG "Sincronizando o VLDB com a partição %1:%2" + IDS_ACTION_SCOUT "Verificando o servidor %1 para problemas" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SETREPPARAMS "alterando as propriedades de replicação para o volume %3" + IDS_ACTION_CREATEREPLICA "Criando réplica do volume %3 na partição %1:%2" + IDS_DELSET_REPLICA_DESC " Atenção!\n\nProsseguir fará com que a réplica do volume %3 na partição %2 do servidor %1 seja removida." + IDS_DELSET_CLONE_DESC " Atenção!\n\nProsseguir fará com que a réplica do volume %3 seja removida da partição %2 do servidor %1." + IDS_INSTALL_DESC1 "Esta operação copia um arquivo deste computador para outro. +" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_INSTALL_DESC2 "Se o arquivo já existir no computador de destino, será feito um backup dele com a extensão .BAK; qualquer backup existente receberá a extensão .OLD, e qualquer arquivo .OLD existente será excluído." + IDS_ACTION_INSTALLFILE "Instalando o arquivo %2 no servidor %1." + IDS_ACTION_UNINSTALLFILE + "Removendo a instalação do arquivo %2 a partir do servidor %1." + IDS_ACTION_PRUNEFILES "Eliminando arquivos do servidor %1" + IDS_FILTER_ALLFILES "Todos os arquivos|*.*|" + IDS_ACTION_RENAMEFILESET "Renomeando o volume %1 para %2" + IDS_RECUR_DAILY "todos os dias" + IDS_RECUR_SUNDAY "todo Domingo" + IDS_RECUR_MONDAY "toda Segunda-Feira" + IDS_RECUR_TUESDAY "toda Terça-Feira" + IDS_RECUR_WEDNESDAY "toda Quarta-Feira" + IDS_RECUR_THURSDAY "toda Quinta-Feira" + IDS_RECUR_FRIDAY "toda Sexta-Feira" + IDS_RECUR_SATURDAY "todo Sábado" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATESERVICE "Criando o serviço %2 no servidor %1" + IDS_ACTION_DELETESERVICE "Excluindo o serviço %2 do servidor %1" + IDS_ACTION_RELEASEFILESET "Liberando o volume %3" + IDS_ACTION_GETDATES "Obtendo datas para o arquivo %2 no servidor %1" + IDS_LASTMODIFIED "Modificado por último em %1" + IDS_SVR_SECURITY_TITLE "Segurança do Servidor -%1" + IDS_SVR_LIST_TAB "Administradores" + IDS_ACTION_ADMINLIST_LOAD "Obtendo administradores para o servidor %1" + IDS_ACTION_ADMINLIST_SAVE "Gravando administradores para o servidor %1" + IDS_ADMCOL_PRINCIPAL "Membro" + IDS_ADMCOL_TYPE "Tipo" + IDS_ADMCOL_TYPE_GROUP "Grupo" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_RESTORE "Restaurando o volume %1" + IDS_COL_AGGS_RESTORE "partições ao restaurar um volume" + IDS_RESTORE_FILTER "Arquivos de Descarga de Volume|*.DMP|Todos os arquivos|*.*|" + IDS_SVC_BOS_TAB "BOS" + IDS_ACTION_SETRESTART "Alterando horários de reinício de serviços para o servidor %1" + IDS_RESTORE_CREATESET "O volume %1 será criado no servidor e na partição que forem especificados abaixo." + IDS_RESTORE_OVERWRITESET + "Atenção! O Volume %3 existe na partição %2 do servidor %1, e será sobreposto se você prosseguir!" + IDS_SUBSET_TITLE_LOAD "Abrir Subconjunto de Servidores" + IDS_SUBSET_TITLE_SAVE "Salvar Subconjunto de Servidores" + IDS_BUTTON_OPEN "&Abrir" + IDS_BUTTON_SAVE "&Salvar" + IDS_SUBSET_SAVE_TITLE "Atenção" + IDS_SUBSET_SAVE_DESC "Já existe um subconjunto de servidores com o nome %1.\n\nDeseja sobrepor este subconjunto?" + IDS_SUBSET_CHANGED "%1 [MODIFICADO]" + IDS_SUBSET_TAB "Servidores Monitorados" + IDS_SUBSET_DISCARD_TITLE "Salvar Subconjunto?" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SUBSET_DISCARD_DESC "Você não salvou a lista de servidores monitorados atualmente como um subconjunto. Se a lista for salva, poderá ser usada mais tarde para continuar a monitorar este mesmo conjunto de servidores.\n\n+" + IDS_SUBSET_DISCARD_DESC2 + "Deseja criar um subconjunto para conter a lista dos servidores monitorados atualmente?" + IDS_SUBSET_NONAME "(sem título)" + IDS_SUBSET_NOSUBSET "(todos os servidores estão sendo monitorados)" + IDS_SUBSET_SERVERSUBSET "Servidor %1" + IDS_FILESET_SOME "Volumes em todos os servidores monitorados na célula %1:" + IDS_AGGREGATE_SOME "Partições em todos os servidores monitorados na célula %1:" + IDS_SERVICE_SOME "Serviços em todos os servidores monitorados na célula %1:" + IDS_FILESET_UNMON "O servidor %1 não está sendo monitorado" + IDS_AGGREGATE_UNMON "O servidor %1 não está sendo monitorado" + IDS_SERVICE_UNMON "O servidor %1 não está sendo monitorado" + IDS_SUBSET_DELETE_TITLE "Excluir Subconjunto?" + IDS_SUBSET_DELETE_DESC "Tem certeza que deseja excluir o subconjunto de servidores %1?" + IDS_ERROR_TRANSLATED "Erro número 0x%1 (%2):\n\n%3" + IDS_ERROR_NOTTRANSLATED "Erro número 0x%1 (%2) não é reconhecido." + IDS_FIND_NOTHING_TITLE "Nenhum Comando Selecionado" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FIND_NOTHING_DESC "Para descobrir como realizar uma operação, selecione primeiro uma linha de comando na lista ou digite uma palavra-chave." + IDS_FIND_UNKNOWN_TITLE "Comando Desconhecido" + IDS_FIND_UNKNOWN_DESC "O Gerenciador de Servidor do AFS não encontrou nenhum tópico de ajuda para o comando ""%1""." + IDS_HELPABOUT_DESC1 "Aviso: este programa de computador é protegido por direitos autorais e por tratados internacionais. +" + IDS_HELPABOUT_DESC2 "A reprodução ou distribuição não autorizadas neste software pode resultar em pesadas penalidades civis e criminais, e será processada até o máximo possível permitido por lei.\n\n+" + IDS_HELPABOUT_DESC3 "AFS é uma marca da Transarc Corporation, uma empresa IBM." + IDS_CANT_QUIT_TITLE "Gerenciador de Servidor do AFS" + IDS_CANT_QUIT_REBOOT "Atenção!\n\nO Gerenciador de Servidor do AFS está realizando uma ou mais operações no momento. Se você encerrar o Windows agora, essas operações não concluirão com êxito.\n\nTem certeza de que deseja reiniciar o Windows?" + IDS_APP_TITLE "Gerenciador de Servidor do AFS" + IDS_ACTION_OPENCELL "Procurando Servidores na célula %1" + IDS_OPTIONS_TITLE "Opções - Gerenciador de Servidor do AFS" + IDS_OPTIONS_GENERAL_TAB "Geral" + IDS_BADCREDS_DESC "A menos que esteja com logon efetuado como administrador, você pode ter privilégios insuficientes para administrar com êxito na célula %1. Privilégios de acesso insuficientes podem fazer com que o Gerenciador de Servidor do AFS encontre problemas em uma célula quando na verdade tais problemas não existem." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CONFIRMATION_TITLE "Confirmação - Gerenciador de Servidor do AFS" + IDS_NO_GROUP_CHECKBOX "Nenhum Grupo Proprietário" + IDS_AFS_ID_DIDEXP "%1 (tokens vencidos em %2)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_QUERYING "(consultando)" + IDS_ADMCOL_TYPE_FOREIGN_GROUP "Grupo Externo" + IDS_ADMCOL_TYPE_FOREIGN_USER "Usuário Externo" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_NOTIFIER "Notificador" + IDS_SVC_NONOTIFIER "(nenhum)" + IDS_SVR_KEY_TAB "Chaves de Servidor" + IDS_KEYNAME_NOTIME "Chaves para o servidor %1:" + IDS_KEYNAME_WITHTIME "Chaves para o Servidor %1 (modificadas em %2):" + IDS_SVRKEY_VERSION "Versão" + IDS_SVRKEY_DATA "Valor" + IDS_SVRKEY_CHECKSUM "Soma de Verificação" + IDS_SVRKEY_DATA_UNKNOWN "(oculta)" + IDS_STARTSERVICE_TITLE "Iniciar Serviço" + IDS_STOPSERVICE_TITLE "Parar Serviço" + IDS_STARTSERVICE_TEXT "Clique em OK para iniciar o serviço %2 no servidor %1." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_STOPSERVICE_TEXT "Clique em OK para parar o serviço %2 no servidor %1." + IDS_STARTSERVICE_STARTUP + "É possível tornar esta alteração permanente, de modo que o serviço %2 inicie automaticamente se o servidor %1 for reiniciado." + IDS_STOPSERVICE_STARTUP "É possível tornar esta alteração permanente, de modo que o serviço %2 não inicie automaticamente se o servidor %1 for reiniciado." + IDS_STARTSERVICE_PERMANENT + "&Permanente (iniciar o serviço %2 se o servidor %1 reiniciar)" + IDS_STARTSERVICE_TEMPORARY + "&Temporária (não iniciar o serviço %2 se o servidor %1 reiniciar)" + IDS_STOPSERVICE_PERMANENT + "&Permanente (não iniciar o serviço %2 se o servidor %1 reiniciar)" + IDS_STOPSERVICE_TEMPORARY + "&Temporária (iniciar o serviço %2 se o servidor %1 reiniciar)" + IDS_ACTION_EXECUTE "Executando %2 no servidor %1" + IDS_ACTION_SALVAGE_SVR "Recuperando todos os volumes no servidor %1" + IDS_ACTION_SALVAGE_AGG "Recuperando todos os volumes na partição %1:2" + IDS_ACTION_SALVAGE_VOL "Recuperando o volume %3 na partição %1:2" + IDS_SALVAGE_SVR "Recuperar todos os volumes no servidor %1" + IDS_SALVAGE_AGG "Recuperar todos os volumes no servidor %1, partição %2" + IDS_SALVAGE_SET "Recuperar o volume %3 no servidor %1, partição %2" + IDS_SETSTATUS_SALVAGE "Recuperando o volume" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETSTATUS_LOCKED "O volume está bloqueado" + IDS_SETSTATUS_NO_VOL "Volume ausente" + IDS_SETSTATUS_BUSY "Volume ocupado no momento" + IDS_SETSTATUS_MOVED "Volume movido" + IDS_SVR_CAPACITY "%1" + IDS_SVR_ALLOCATION "%1 (%2%%)" + IDS_SVRCOL_ADDRESS "Endereço" + IDS_HOST_TITLE "Servidores host de banco de dados reconhecidos pelo servidor %1:" + IDS_SVR_HOSTS_TITLE "Servidor %1 - Hosts de Banco de Dados" + IDS_SVR_HOST_TAB "Hosts de Banco de Dados" + IDS_ACTION_HOSTLIST_LOAD "Obtendo a lista de hosts do servidor %1" + IDS_ACTION_HOSTLIST_SAVE "Gravando a lista de hosts no servidor %1" + IDS_SETSTATUS_1ALERT "O volume tem um problema" + IDS_SETSTATUS_2ALERT "O volume tem %1 problemas" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CHANGEADDR "Alterando o endereço IP para o servidor %1" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_ADDSITE "vos addsite" + IDS_COMMAND_VOS_BACKUP "vos backup" + IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" + IDS_COMMAND_VOS_CREATE "vos create" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_DELENTRY "vos delentry" + IDS_COMMAND_VOS_DUMP "vos dump" + IDS_COMMAND_VOS_EXAMINE "vos examine" + IDS_COMMAND_VOS_LISTPART "vos listpart" + IDS_COMMAND_VOS_LISTVLDB "vos listvldb" + IDS_COMMAND_VOS_LISTVOL "vos listvol" + IDS_COMMAND_VOS_LOCK "vos lock" + IDS_COMMAND_VOS_MOVE "vos move" + IDS_COMMAND_VOS_PARTINFO "vos partinfo" + IDS_COMMAND_VOS_RELEASE "vos release" + IDS_COMMAND_VOS_REMOVE "vos remove" + IDS_COMMAND_VOS_REMSITE "vos remsite" + IDS_COMMAND_VOS_RENAME "vos rename" + IDS_COMMAND_VOS_RESTORE "vos restore" + IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" + IDS_COMMAND_VOS_UNLOCK "vos unlock" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" + IDS_COMMAND_VOS_ZAP "vos zap" + IDS_COMMAND_BOS_ADDHOST "bos addhost" + IDS_COMMAND_BOS_ADDKEY "bos addkey" + IDS_COMMAND_BOS_ADDUSER "bos adduser" + IDS_COMMAND_BOS_CREATE "bos create" + IDS_COMMAND_BOS_DELETE "bos delete" + IDS_COMMAND_BOS_EXEC "bos exec" + IDS_COMMAND_BOS_GETDATE "bos getdate" + IDS_COMMAND_BOS_GETLOG "bos getlog" + IDS_COMMAND_BOS_GETRESTART "bos getrestart" + IDS_COMMAND_BOS_INSTALL "bos install" + IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" + IDS_COMMAND_BOS_LISTKEYS "bos listkeys" + IDS_COMMAND_BOS_LISTUSERS "bos listusers" + IDS_COMMAND_BOS_PRUNE "bos prune" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_BOS_REMOVEHOST "bos removehost" + IDS_COMMAND_BOS_REMOVEKEY "bos removekey" + IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" + IDS_COMMAND_BOS_RESTART "bos restart" + IDS_COMMAND_BOS_SALVAGE "bos salvage" + IDS_COMMAND_BOS_SETAUTH "bos setauth" + IDS_COMMAND_BOS_SETRESTART "bos setrestart" + IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" + IDS_COMMAND_BOS_START "bos start" + IDS_COMMAND_BOS_STARTUP "bos startup" + IDS_COMMAND_BOS_STATUS "bos status" + IDS_COMMAND_BOS_STOP "bos stop" + IDS_COMMAND_BOS_UNINSTALL "bos uninstall" + IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" + IDS_COMMAND_FS_LISTQUOTA "fs listquota" + IDS_COMMAND_FS_QUOTA "fs quota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_FS_SETQUOTA "fs setquota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCSHORT_UNMONITORED + "O servidor %1 não está sendo monitorado para detectar problemas" + IDS_ALERT_DESCSHORT_TIMEOUT + "O servidor %1 não pôde ser contactado; último erro: %3" + IDS_ALERT_DESCSHORT_AGG_FULL + "Uso da partição para %2 excede o limite de aviso de %3%% (%4)" + IDS_ALERT_DESCSHORT_SET_FULL + "O uso do volume para %3 excede o limite de aviso de %4%% (%5)" + IDS_ALERT_DESCSHORT_NO_VLDBENT "O volume %3 não possui entrada no VLDB" + IDS_ALERT_DESCSHORT_NO_SVRENT_SET + "O volume %3 tem uma entrada no VLDB mas não foi encontrado na partição %2 do servidor %1" + IDS_ALERT_DESCSHORT_STOPPED "Serviço %2 parado em %3" + IDS_ALERT_DESCSHORT_NO_SVRENT_AGG + "A partição %2 é referenciada pelo VLDB mas não foi encontrada no servidor %1" + IDS_ALERT_DESCSHORT_BADCREDS + "Você pode ter privilégios insuficientes para administrar o servidor %1" + IDS_ALERT_DESCSHORT_AGG_ALLOC + "A quota combinada de volumes na partição %2 excede sua capacidade" + IDS_ALERT_DESCSHORT_STATE_NO_VNODE + "O volume %3 está danificado e não pode ser usado" + IDS_ALERT_DESCSHORT_STATE_NO_SERVICE + "Não há nenhum serviço em execução para servir o volume %3" + IDS_ALERT_DESCSHORT_STATE_OFFLINE + "O volume %3 está offline e não pode ser usado" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_TIMEOUT + "O servidor %1 não pôde ser contactado. A última tentativa, feita em %2, resultou no erro ""%3""." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_AGG_FULL + "O uso da partição %2 no servidor %1 excede seu limite de aviso de %3%% (%4)." + IDS_ALERT_DESCFULL_SET_FULL + "O uso do volume %3 (servidor %1, partição %2) excede seu limite de aviso do %4%% (%5)." + IDS_ALERT_DESCFULL_NO_VLDBENT + "O volume %3 existe na partição %2 do servidor %1, mas não tem uma entrada correspondente no VLDB." + IDS_ALERT_DESCFULL_NO_SVRENT_SET + "Existe no VLDB uma entrada para o volume %3, mas este não foi encontrado na partição %2 do servidor %1." + IDS_ALERT_DESCFULL_STOPPED + "O serviço %2 no servidor %1 parou em %3 com o código de saída %5." + IDS_ALERT_DESCFULL_NO_SVRENT_AGG + "O VLDB faz referência a volumes na partição %2 do servidor %1, mas a partição não pôde ser encontrada." + IDS_ALERT_DESCFULL_BADCREDS + "O Gerenciador de Servidor do AFS pode estar detectando erros inexistentes no servidor %1 porque você não tem tokens do AFS como administrador nesta célula." + IDS_ALERT_DESCFULL_AGG_ALLOC + "A quota combinada de volumes na partição %2 do servidor %1, totalizando %4, excede a capacidade %3 da partição." + IDS_ALERT_DESCFULL_STATE_NO_VNODE + "O volume %3 na partição %2 do servidor %1 não tem um Vnode associado a ele. (O estado do volume é 0x%4.)" + IDS_ALERT_DESCFULL_STATE_NO_SERVICE + "Não existe um serviço exportador de arquivos executando no servidor %1, e portanto o volume %3 na partição %4 não pode ser usado. (O estado do volume é 0x%4.)" + IDS_ALERT_DESCFULL_STATE_OFFLINE + "O volume %3 na partição %2 do servidor %1 está offline e não pode ser usado. (O estado do volume é 0x%4.)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_TIMEOUT "Clique no botão Tentar Novamente para tentar contactar novamente este servidor." + IDS_ALERT_FIX_AGG_FULL "Clique no botão Avisos para alterar o limite de aviso para o uso desta partição." + IDS_ALERT_FIX_SET_FULL "Clique no botão Avisos para alterar o limite de aviso para o uso deste volume." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_NO_VLDBENT + "O VLDB está possivelmente desatualizado; se for o caso, use o comando Sincronizar VLDB para atualizá-lo." + IDS_ALERT_FIX_NO_SVRENT_SET + "Verifique o servidor e partição para assegurar-se de que eles estão funcionando corretamente." + IDS_ALERT_FIX_STOPPED "Clique no botão Exibir Log para exibir o log de serviço para este serviço." + IDS_ALERT_FIX_NO_SVRENT_AGG + "Verifique o servidor para assegurar que a partição está exportada e funcionando corretamente." + IDS_ALERT_FIX_BADCREDS "Clique no botão Autenticação para obter novos tokens do AFS." + IDS_ALERT_FIX_AGG_ALLOC "Reduza a quota para volumes nesta partição, ou mova um ou mais volumes para outra partição." + IDS_ALERT_FIX_STATE_NO_VNODE " " + IDS_ALERT_FIX_STATE_NO_SERVICE " " + IDS_ALERT_FIX_STATE_OFFLINE " " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_BUTTON_TRYAGAIN "Tentar &Novamente" + IDS_ALERT_BUTTON_WARNINGS "&Avisos..." + IDS_ALERT_BUTTON_VIEWLOG "E&xibir Log" + IDS_ALERT_BUTTON_SHOWME "&Mostre-me" + IDS_ALERT_BUTTON_GETCREDS "&Autenticação" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_CELLSERVERS_NOCELL + "Nenhuma célula foi especificada. Para usar o Gerenciador de Servidor do AFS, deve-se especificar a célula do AFS com a qual se deseja trabalhar. Escolha uma célula selecionando o item de menu ""Abrir..."" no menu ""Célula"" acima." + IDS_ERROR_REFRESH_CELLSERVERS + "A lista de servidores não pode ser obtida para a célula %1.\n\nErro: %2" + IDS_ERROR_CANT_OPEN_CELL + "O Gerenciador de Servidor do AFS não conseguiu contactar nenhum servidor na célula %1.\n\nCertifique-se de ter digitado corretamente o nome da célula." + IDS_ERROR_REFRESH_AGGREGATES + "A lista de servidores não pôde ser obtida para o servidor %1.\n\nErro: %2" + IDS_ERROR_REFRESH_SERVER_STATUS + "O status atual do servidor %1 não pôde ser obtido." + IDS_ERROR_CHANGE_SERVER_STATUS + "O Gerenciador de Servidor do AFS não conseguiu alterar as propriedades para o servidor %1." + IDS_ERROR_REFRESH_AGGREGATE_STATUS + "O status atual da partição %2 no servidor %1 não pôde ser obtido." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_FILESET_STATUS + "O status atual do volume %3 (servidor %1, partição %2) não pôde ser obtido." + IDS_ERROR_REFRESH_SERVICE_STATUS + "O status atual do serviço %2 no servidor %1 não pôde ser determinado." + IDS_ERROR_MOVE_FILESET "O Gerenciador de Servidor do AFS não conseguiu mover o volume %3 da partição %2 no servidor %1 para a partição %5 no servidor %4." + IDS_ERROR_VIEW_LOGFILE "O arquivo %2 não pôde ser lido a partir do servidor %1.\n\nCertifique-se de que digitou o nome do arquivo corretamente, e de que possui permissões suficientes para exibir o arquivo." + IDS_ERROR_NOT_REPLICATED + "O status de replicação do volume %1 não pôde ser determinado." + IDS_ERROR_CANT_CREATE_FILESET + "O Gerenciador de Servidor do AFS não conseguiu criar o volume %3 na partição %2 do servidor %1." + IDS_ERROR_CANT_DELETE_FILESET + "O Gerenciador de Servidor do AFS não conseguiu excluir o volume %3 (partição %2 do servidor %1)." + IDS_ERROR_CANT_CREATE_VLDB_ENTRY + "O Gerenciador de Servidor do AFS não conseguiu criar uma entrada no VLDB para o volume %3 na partição %2 do servidor %1." + IDS_ERROR_CANT_SET_FILESET_QUOTA + "O Gerenciador de Servidor do AFS não conseguiu alterar a quota para o volume %3 na partição %2 do servidor %1." + IDS_ERROR_CANT_CREATE_SERVER + "O Gerenciador de Servidor do AFS não conseguiu criar a entrada pedida de servidor na célula %1." + IDS_ERROR_CANT_PING_SERVER + "O Gerenciador de Servidor do AFS não conseguiu determinar o endereço IP do servidor %1." + IDS_ERROR_CANT_DELETE_SERVER + "O Gerenciador de Servidor do AFS não conseguiu excluir o servidor %1." + IDS_ERROR_CANT_DELETE_SERVER_FILESETS + "O servidor %1 não pode ser excluído porque ainda abriga um ou mais volumes. Um servidor não pode ser excluído a menos que não contenha volumes." + IDS_ERROR_CHANGE_AGGREGATE_STATUS + "O Gerenciador de Servidor do AFS não conseguiu alterar as propriedades para a partição %2 no servidor %1." + IDS_ERROR_CHANGE_SERVICE_STATUS + "O Gerenciador de Servidor do AFS não conseguiu alterar as propriedades para o serviço %2 no servidor %1." + IDS_ERROR_CANT_START_SERVICE + "O Gerenciador de Servidor do AFS não conseguiu iniciar o serviço %2 no servidor %1." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_STOP_SERVICE + "O Gerenciador de Servidor do AFS não conseguiu parar o serviço %2 no servidor %1." + IDS_ERROR_CANT_RESTART_SERVICE + "O Gerenciador de Servidor do AFS não conseguiu parar e reiniciar o serviço %2 no servidor %1." + IDS_ERROR_CHANGE_REPLICA_STATUS + "O Gerenciador de Servidor do AFS não conseguiu alterar as propriedades de replicação para o volume %3 na partição %2 do servidor %1." + IDS_ERROR_CANT_SYNCVLDB "O Gerenciador de Servidor do AFS não conseguiu atualizar o VLDB." + IDS_ERROR_CANT_CREATE_REPLICA + "O Gerenciador de Servidor do AFS não conseguiu criar uma réplica do volume %3 na partição %2 do servidor %1." + IDS_ERROR_CANT_INSTALL_FILE + "O Gerenciador de Servidor do AFS não conseguiu instalar o arquivo %2 no servidor %1." + IDS_ERROR_CANT_UNINSTALL_FILE + "O Gerenciador de Servidor do AFS não conseguiu remover a instalação do arquivo %2 no servidor %1." + IDS_ERROR_CANT_PRUNE_FILES + "O Gerenciador de Servidor do AFS não conseguiu remover os arquivos pedidos do servidor %1." + IDS_ERROR_CANT_RENAME_FILESET + "O Gerenciador de Servidor do AFS não conseguiu renomear o volume %1 para ""%2""." + IDS_ERROR_CANT_CREATE_SERVICE + "O Gerenciador de Servidor do AFS não conseguiu criar o serviço %2 no servidor %1." + IDS_ERROR_CANT_DELETE_SERVICE + "O Gerenciador de Servidor do AFS não conseguiu excluir o serviço %2 do servidor %1." + IDS_ERROR_CANT_RELEASE_FILESET + "O Gerenciador de Servidor do AFS não conseguiu liberar o volume replicado %3." + IDS_ERROR_CANT_UPDATE_FILESET + "O Gerenciador de Servidor do AFS não conseguiu atualizar a réplica do volume %3 na partição %1 do servidor %2." + IDS_ERROR_CANT_UPDATE_ALL + "O Gerenciador de Servidor do AFS não conseguiu atualizar nenhuma réplica do volume %3." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_LOAD_ADMLIST + "O Gerenciador de Servidor do AFS não conseguiu ler a lista de administradores para o servidor %1." + IDS_ERROR_CANT_LOAD_KEYLIST + "O Gerenciador de Servidor do AFS não conseguiu ler a lista de chaves de servidor para o servidor %1." + IDS_ERROR_CANT_CREATE_KEY + "O Gerenciador de Servidor do AFS não conseguiu criar uma nova chave de servidor para o servidor %1." + IDS_ERROR_CANT_SAVE_ADMLIST + "O Gerenciador de Servidor do AFS não conseguiu alterar a lista de administradores para o servidor %1." + IDS_ERROR_CANT_CLONE "O Gerenciador de Servidor do AFS não conseguiu criar uma versão de backup do volume %3 na partição %2 do servidor %1." + IDS_ERROR_CANT_CLONESYS "O Gerenciador de Servidor do AFS não conseguiu criar nenhum dos volumes de backup pedidos." + IDS_ERROR_CANT_DUMP_FILESET + "O Gerenciador de Servidor do AFS não conseguiu descarregar o conteúdo do volume %3 (servidor %1, partição %2) no arquivo %4." + IDS_ERROR_CANT_RESTORE_FILESET + "O Gerenciador de Servidor do AFS não conseguiu o arquivo %4 para o volume %3 (servidor %1, partição %2)." + IDS_ERROR_CANT_SET_RESTART_TIMES + "O Gerenciador de Servidor do AFS não conseguiu alterar os horários de reinício para os serviços no servidor %1." + IDS_ERROR_CANT_DELETE_REPLICATED_FILESET + "O Gerenciador de Servidor do AFS não consegue excluir o volume %3 da partição %2 do servidor %1.\n\nO volume %3 não pode ser excluído sem antes excluir todas as suas réplicas." + IDS_CMDLINE_TITLE "Erro - Gerenciador de Servidor do AFS" + IDS_CMDLINE_SYNTAX "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida." + IDS_CMDLINE_UNRECOGNIZED + "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nO parâmetro ""%1"" não é reconhecido." + IDS_CMDLINE_DUPLICATE "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nO parâmetro ""%1"" está especificado mais de uma vez." + IDS_CMDLINE_UNEXPECTVALUE + "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nO parâmetro ""%1"" não deveria ter um valor." + IDS_CMDLINE_MISSINGVAL "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nO parâmetro ""%1"" deve ser seguido por um valor." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CMDLINE_SUBSETNOTCELL + "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nO parâmetro ""/SUBSET"" pode ser especificado somente se o parâmetro ""/CELL"" também for especificado." + IDS_CMDLINE_INVALIDSUBSET + "O subconjunto de servidores especificado, ""%2"", não foi definido para a célula %1." + IDS_CMDLINE_SERVERNOTCELL + "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nO parâmetro ""/SERVER"" pode ser especificado somente se o parâmetro ""/CELL"" também for especificado." + IDS_CMDLINE_RESET_TITLE "Gerenciador de Servidor do AFS" + IDS_CMDLINE_RESET_DESC "O Gerenciador de Servidor do AFS limpou as definições especificadas." + IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE + "O Gerenciador de Servidor do AFS não consegue sincronizar o VLDB com a partição %2 do servidor %1 porque a partição não existe ou não está exportada.\n\nPara remover esta partição do servidor %1, é preciso excluir as entradas de volume no VLDB que se referem a ela." + IDS_CMDLINE_USERPASSWORD + "A linha de comando especificada para o Gerenciador de Servidor do AFS é inválida.\n\nPara obter novos tokens do AFS, os parâmetros ""USER"" e ""PASSWORD"" devem ser especificados." + IDS_ERROR_CANT_DELETE_KEY + "O Gerenciador de Servidor do AFS não conseguiu excluir a chave de servidor %2 do servidor %1." + IDS_ERROR_CANT_GETRANDOMKEY + "O Gerenciador de Servidor do AFS não conseguiu gerar uma chave aleatória para o servidor %1." + IDS_ERROR_CANT_EXECUTE_COMMAND + "O Gerenciador de Servidor do AFS não conseguiu executar o seguinte comando no servidor %1:\n\n ""%2""" + IDS_ERROR_CANT_READ_SALVAGE_LOG + "O Gerenciador de Servidor do AFS concluiu a operação de recuperação com êxito, mas não foi capaz de recuperar o arquivo de log descrevendo os resultados específicos da operação de recuperação." + IDS_ERROR_CANT_SALVAGE "O Gerenciador de Servidor do AFS não foi capaz de realizar a operação de recuperação pedida." + IDS_ERROR_CANT_AUTH_ON "O Gerenciador de Servidor do AFS não conseguiu ativar a verificação de autenticação para o servidor %1." + IDS_ERROR_CANT_AUTH_OFF "O Gerenciador de Servidor do AFS não conseguiu desativar a verificação de autenticação para o servidor %1." + IDS_ERROR_CANT_LOAD_HOSTLIST + "O Gerenciador de Servidor do AFS não conseguiu ler a lista de servidores host de banco de dados do servidor %1." + IDS_ERROR_CANT_SAVE_HOSTLIST + "O Gerenciador de Servidor do AFS não conseguiu alterar a lista de servidores host de banco de dados no servidor %1." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL + "O Gerenciador de Servidor do AFS não conseguiu iniciar porque o Centro de Controle do AFS não estava instalado corretamente.\n\nPode ser necessário reinstalar o Centro de Controle do AFS." + IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN + "O Gerenciador de Servidor do AFS não conseguiu iniciar devido a um problema desconhecido.\n\nPode ser necessário reinstalar o Centro de Controle do AFS." + IDS_ERROR_CANT_CHANGEADDR + "O Gerenciador de Servidor do AFS não conseguiu alterar o endereço IP no VLDB para o servidor %1." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_SERVICE "%1:%2" + IDS_SERVICETYPE_SIMPLE "Simples" + IDS_SERVICETYPE_CRON "Cronometrado" + IDS_SERVICESTATE_STOPPED "Parado" + IDS_SERVICESTATE_STOPPING "Parando" + IDS_SERVICESTATE_STARTING "Iniciando" + IDS_SERVICESTATE_RUNNING "Executando" + IDS_SERVICETYPE_FS_LONG "FS (sistema de arquivos)" + IDS_SERVICETYPE_FS "FS" + IDS_SERVICE_LASTERROR "%1" + IDS_SERVICES_IN_CELL "Todos os serviços na célula %1:" + IDS_SERVICE_STARTDATE "Iniciado %1" + IDS_SERVICE_STOPDATE "Parado %1" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afssvrmgr/lang/zh_CN/svrmgr.rc b/src/WINNT/afssvrmgr/lang/zh_CN/svrmgr.rc index 5e64adb19..3f195e3e8 100644 --- a/src/WINNT/afssvrmgr/lang/zh_CN/svrmgr.rc +++ b/src/WINNT/afssvrmgr/lang/zh_CN/svrmgr.rc @@ -7,2926 +7,2926 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "AFS ·þÎñÆ÷¹ÜÀíÆ÷" +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "AFS ·þÎñÆ÷¹ÜÀíÆ÷" #define AFS_VERINFO_NAME "svrmgr" #define AFS_VERINFO_FILENAME "svrmgr.exe" #define AFS_VERINFO_LANG_CODE 0x804 #define AFS_VERINFO_CHARSET 936 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Chinese (P.R.C.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) -#ifdef _WIN32 -LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_SERVICES, DIALOG - BEGIN - RIGHTMARGIN, 165 - END - - IDD_AGGREGATES, DIALOG - BEGIN - RIGHTMARGIN, 118 - END - - IDD_FILESETS, DIALOG - BEGIN - RIGHTMARGIN, 180 - END - - IDD_SVR_LISTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_AGG_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 262 - TOPMARGIN, 5 - BOTTOMMARGIN, 155 - END - - IDD_SVR_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 183 - END - - IDD_SVR_SCOUT, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 216 - TOPMARGIN, 5 - BOTTOMMARGIN, 153 - END - - IDD_SVC_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 268 - TOPMARGIN, 5 - BOTTOMMARGIN, 209 - END - - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 315 - TOPMARGIN, 2 - BOTTOMMARGIN, 224 - END - - IDD_SERVER, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 207 - TOPMARGIN, 2 - BOTTOMMARGIN, 135 - END - - IDD_SVC_CREATE, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 228 - END - - IDD_SET_REPSITES, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 216 - TOPMARGIN, 5 - BOTTOMMARGIN, 163 - END - - IDD_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 7 - BOTTOMMARGIN, 253 - HORZGUIDE, 160 - END - - IDD_TIMEOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 232 - TOPMARGIN, 7 - BOTTOMMARGIN, 153 - END - - IDD_COLUMNS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 281 - TOPMARGIN, 5 - BOTTOMMARGIN, 143 - END - - IDD_REFRESHALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 68 - END - - IDD_SET_CREATE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 317 - TOPMARGIN, 4 - BOTTOMMARGIN, 205 - END - - IDD_SET_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 303 - TOPMARGIN, 7 - BOTTOMMARGIN, 99 - END - - IDD_SET_CLONE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 341 - TOPMARGIN, 7 - BOTTOMMARGIN, 81 - END - - IDD_SVC_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 189 - END - - IDD_SVR_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 152 - END - - IDD_AGG_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 252 - TOPMARGIN, 5 - BOTTOMMARGIN, 146 - END - - IDD_SET_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 268 - TOPMARGIN, 5 - BOTTOMMARGIN, 177 - END - - IDD_SET_MOVETO, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 170 - END - - IDD_SET_MOVING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SVC_LOGNAME, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 102 - END - - IDD_SVC_VIEWLOG, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 181 - END - - IDD_SET_SETQUOTA, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 267 - TOPMARGIN, 4 - BOTTOMMARGIN, 126 - END - - IDD_ACTIONS, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 234 - TOPMARGIN, 2 - BOTTOMMARGIN, 56 - END - - IDD_SVR_SYNCVLDB, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 265 - TOPMARGIN, 4 - BOTTOMMARGIN, 95 - END - - IDD_SET_CREATEREP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 167 - END - - IDD_SVR_INSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 152 - END - - IDD_SVR_UNINSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 135 - END - - IDD_SVR_PRUNE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 196 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_SET_RENAME, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 129 - END - - IDD_SVC_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 64 - END - - IDD_SVR_GETDATES, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_GETDATES_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 128 - END - - IDD_SET_DUMP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 291 - TOPMARGIN, 7 - BOTTOMMARGIN, 140 - END - - IDD_SET_RESTORE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 288 - TOPMARGIN, 4 - BOTTOMMARGIN, 244 - END - - IDD_SVC_BOS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_DUMPING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SET_RESTORING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SET_CLONESYS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 254 - TOPMARGIN, 7 - BOTTOMMARGIN, 159 - END - - IDD_SUBSETS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 276 - TOPMARGIN, 5 - BOTTOMMARGIN, 177 - END - - IDD_SUBSET_LOADSAVE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 276 - TOPMARGIN, 4 - BOTTOMMARGIN, 141 - END - - IDD_HELP_FIND, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 214 - TOPMARGIN, 4 - BOTTOMMARGIN, 69 - END - - IDD_HELP_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 214 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_HELP_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 226 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_OPENINGCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 236 - TOPMARGIN, 2 - BOTTOMMARGIN, 41 - END - - IDD_OPTIONS_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 274 - TOPMARGIN, 5 - BOTTOMMARGIN, 131 - END - - IDD_SVR_KEYS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_CREATEKEY, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - END - - IDD_SVC_STARTSTOP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 128 - END - - IDD_SVR_EXECUTE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_SALVAGE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 7 - BOTTOMMARGIN, 250 - END - - IDD_SVR_SALVAGE_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 174 - END - - IDD_SET_RELEASE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 98 - END - - IDD_SVR_HOSTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_ADDHOST, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 221 - TOPMARGIN, 4 - BOTTOMMARGIN, 102 - END - - IDD_SVR_ADDRESS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 204 - TOPMARGIN, 4 - BOTTOMMARGIN, 111 - END - - IDD_SVR_NEWADDR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 219 - TOPMARGIN, 4 - BOTTOMMARGIN, 65 - END -END -#endif // APSTUDIO_INVOKED - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ·þÎñÆ÷¹ÜÀíÆ÷""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_MAIN MENU DISCARDABLE -BEGIN - POPUP "µ¥Ôª(&C)" - BEGIN - MENUITEM "Ñ¡Ôñ(&S)...", M_CELL_OPEN - MENUITEM "ÈÏÖ¤(&A)...", M_CREDENTIALS - MENUITEM SEPARATOR - MENUITEM "Í˳ö(&X)", M_EXIT - END - POPUP "ÊÓͼ(&V)" - BEGIN - POPUP "·þÎñÆ÷(&S)" - BEGIN - MENUITEM "´óͼ±ê(&G)", M_SVR_VIEW_LARGE - , CHECKED - MENUITEM "Сͼ±ê(&M)", M_SVR_VIEW_SMALL - , CHECKED - MENUITEM "Ïêϸ×ÊÁÏ(&D)", M_SVR_VIEW_REPORT - , CHECKED - MENUITEM SEPARATOR - MENUITEM "Õý³£(&N)", M_SVR_VIEW_ONEICON - , CHECKED - MENUITEM "ËùÓÐͼ±ê(&A)", M_SVR_VIEW_TWOICONS - , CHECKED - MENUITEM "½öÏÔʾ״̬(&S)", M_SVR_VIEW_STATUS - , CHECKED - END - POPUP "¿ìËÙä¯ÀÀÏÔʾ´°¿Ú(&Q)" - BEGIN - MENUITEM "ÎÞ(&N)", M_DIVIDE_NONE, CHECKED - MENUITEM "´¹Ö±·Ö¸î(&V)", M_DIVIDE_H, CHECKED - MENUITEM "ˮƽ·Ö¸î(&H)", M_DIVIDE_V, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "ÕýÔÚ½øÐеIJÙ×÷(&P)", M_ACTIONS, CHECKED - MENUITEM SEPARATOR - MENUITEM "±»¼àÊӵķþÎñÆ÷(&M)...", M_SUBSET - MENUITEM "ÁÐ(&C)...", M_COLUMNS - MENUITEM "Ñ¡Ïî(&O)...", M_OPTIONS - MENUITEM SEPARATOR - MENUITEM "Ë¢ÐÂËùÓÐ(&F)", M_REFRESHALL - END - POPUP "°ïÖú(&H)" - BEGIN - MENUITEM "Ŀ¼(&C)", M_HELP - MENUITEM "²éÕÒÃüÁî(&F)...", M_HELP_FIND - MENUITEM "²éÕÒ´íÎó´úÂë(&L)...", M_HELP_XLATE - MENUITEM SEPARATOR - MENUITEM "¹ØÓÚ AFS ·þÎñÆ÷¹ÜÀíÆ÷(&A)...", M_ABOUT - END -END - -MENU_AGG MENU DISCARDABLE -BEGIN - MENUITEM "´´½¨¾í(&C)...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "±¸·Ý¾í(&B)...", M_SET_CLONE - MENUITEM "½âËøËùÓоí(&U)", M_SET_UNLOCK - MENUITEM "ͬ²½ VLDB(&Y)...", M_SYNCVLDB - MENUITEM "Íì¾È¾í(&G)...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "Ë¢ÐÂ(&F)", M_REFRESH - MENUITEM "ÌØÐÔ(&R)", M_PROPERTIES -END - -MENU_SVC MENU DISCARDABLE -BEGIN - MENUITEM "Æô¶¯(&S)", M_SVC_START - MENUITEM "Í£Ö¹(&S)", M_SVC_STOP - MENUITEM "ÖØÐÂÆô¶¯(&R)", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "²é¿´ÈÕÖ¾Îļþ(&V)", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "ɾ³ý(&L)", M_SVC_DELETE - MENUITEM SEPARATOR - MENUITEM "Ë¢ÐÂ(&F)", M_REFRESH - MENUITEM "ÌØÐÔ(&R)", M_PROPERTIES -END - -MENU_AGG_NONE MENU DISCARDABLE -BEGIN - POPUP "ÊÓͼ(&V)" - BEGIN - MENUITEM "Õý³£(&N)", M_VIEW_ONEICON, CHECKED - MENUITEM "ËùÓÐͼ±ê(&A)", M_VIEW_TWOICONS, CHECKED - MENUITEM "½öÏÔʾ״̬(&S)", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "´´½¨¾í(&C)...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "Ë¢ÐÂËùÓÐ(&F)", M_REFRESHALL -END - -MENU_SVC_NONE MENU DISCARDABLE -BEGIN - POPUP "ÊÓͼ(&V)" - BEGIN - MENUITEM "Õý³£(&N)", M_VIEW_ONEICON, CHECKED - MENUITEM "ËùÓÐͼ±ê(&A)", M_VIEW_TWOICONS, CHECKED - MENUITEM "½öÏÔʾ״̬(&S)", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "´´½¨·þÎñ(&C)...", M_SVC_CREATE - MENUITEM SEPARATOR - MENUITEM "Ë¢ÐÂËùÓÐ(&F)", M_REFRESHALL -END - -MENU_SET MENU DISCARDABLE -BEGIN - MENUITEM "¸´ÖÆ(&P)...", M_SET_REPLICATION - MENUITEM "ÏÖÔÚÊÍ·Å(&S)", M_SET_RELEASE - MENUITEM SEPARATOR - MENUITEM "±¸·Ý(&B)...", M_SET_CLONE - MENUITEM "ת´¢µ½Îļþ(&D)...", M_SET_DUMP - MENUITEM "´ÓÎļþ»Ö¸´(&R)...", M_SET_RESTORE - MENUITEM "ÉèÖÃÏÞ¶î(&Q)...", M_SET_SETQUOTA - MENUITEM "Íì¾È(&G)...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "ÒÆ¶¯µ½(&M)...", M_SET_MOVETO - MENUITEM "ÖØÃüÃû(&N)...", M_SET_RENAME - MENUITEM "ɾ³ý(&L)", M_SET_DELETE - MENUITEM SEPARATOR - MENUITEM "Ëø¶¨(&K)", M_SET_LOCK - MENUITEM "½âËø(&U)", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "Ë¢ÐÂ(&F)", M_REFRESH - MENUITEM "ÌØÐÔ(&R)", M_PROPERTIES -END - -MENU_SVR MENU DISCARDABLE -BEGIN - MENUITEM "´ò¿ª·þÎñÆ÷´°¿Ú(&O)", M_SVR_OPEN - MENUITEM "¹Ø±Õ·þÎñÆ÷´°¿Ú(&C)", M_SVR_CLOSE - MENUITEM "¼àÊÓ´Ë·þÎñÆ÷(&M)", M_SVR_MONITOR, CHECKED - MENUITEM SEPARATOR - MENUITEM "±à¼­·þÎñÆ÷°²È«ÐÔ(&S)...", M_SVR_SECURITY - MENUITEM "¹ÜÀíÊý¾Ý¿âÖ÷»ú(&H)...", M_SVR_HOSTS - MENUITEM "±¸·Ý¾í(&B)...", M_SET_CLONE - MENUITEM "½âËøËùÓоí(&U)", M_SET_UNLOCK - MENUITEM "ͬ²½ VLDB(&Y)...", M_SYNCVLDB - MENUITEM "Íì¾È¾í(&G)...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "°²×°Îļþ(&I)...", M_SVR_INSTALL - MENUITEM "жװÎļþ(&U)...", M_SVR_UNINSTALL - MENUITEM "ɾ³ý¾ÉÎļþ(&P)...", M_SVR_PRUNE - MENUITEM SEPARATOR - MENUITEM "»ñµÃÎļþÈÕÆÚ(&T)...", M_SVR_GETDATES - MENUITEM "²é¿´ÈÕÖ¾Îļþ(&V)...", M_VIEWLOG - MENUITEM "Ö´ÐÐÃüÁî(&X)...", M_EXECUTE - MENUITEM SEPARATOR - MENUITEM "Ë¢ÐÂ(&F)", M_REFRESH - MENUITEM "ÌØÐÔ(&R)", M_PROPERTIES -END - -MENU_SVR_NONE MENU DISCARDABLE -BEGIN - POPUP "ÊÓͼ(&V)" - BEGIN - MENUITEM "´óͼ±ê(&G)", M_SVR_VIEW_LARGE, CHECKED - MENUITEM "Сͼ±ê(&M)", M_SVR_VIEW_SMALL, CHECKED - MENUITEM "Ïêϸ×ÊÁÏ(&D)", M_SVR_VIEW_REPORT, CHECKED - MENUITEM SEPARATOR - MENUITEM "Õý³£(&N)", M_SVR_VIEW_ONEICON, CHECKED - MENUITEM "ËùÓÐͼ±ê(&A)", M_SVR_VIEW_TWOICONS, CHECKED - MENUITEM "½öÏÔʾ״̬(&S)", M_SVR_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "±»¼àÊӵķþÎñÆ÷(&M)...", M_SUBSET - MENUITEM SEPARATOR - MENUITEM "½âËøËùÓоí(&U)", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "¹Ø±ÕËùÓÐ(&C)", M_SVR_CLOSEALL - MENUITEM "Ë¢ÐÂËùÓÐ(&F)", M_REFRESHALL -END - -MENU_SET_NONE MENU DISCARDABLE -BEGIN - POPUP "ÊÓͼ(&V)" - BEGIN - MENUITEM "°´¾í(&V)", M_SET_VIEW_REPORT, CHECKED - MENUITEM "°´·ÖÇø(&P)", M_SET_VIEW_TREELIST, CHECKED - MENUITEM "ÎÞÏêϸÐÅÏ¢(&D)", M_SET_VIEW_TREE, CHECKED - MENUITEM SEPARATOR - MENUITEM "Õý³£(&N)", M_VIEW_ONEICON, CHECKED - MENUITEM "ËùÓÐͼ±ê(&A)", M_VIEW_TWOICONS, CHECKED - MENUITEM "½öÏÔʾ״̬(&S)", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "´´½¨¾í(&C)...", M_SET_CREATE - MENUITEM "´ÓÎļþ»Ö¸´(&R)...", M_SET_RESTORE - MENUITEM SEPARATOR - MENUITEM "±¸·Ý¾í(&B)...", M_SET_CLONE - MENUITEM SEPARATOR - MENUITEM "½âËøËùÓÐ(&U)", M_SET_UNLOCK - MENUITEM "Ë¢ÐÂËùÓÐ(&F)", M_REFRESHALL -END - -MENU_COLUMNS MENU DISCARDABLE -BEGIN - MENUITEM "ÁÐ(&C)...", M_COLUMNS -END - -MENU_SVC_BOS MENU DISCARDABLE -BEGIN - MENUITEM "ÖØÐÂÆô¶¯(&R)", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "²é¿´ÈÕÖ¾Îļþ(&V)", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "Ë¢ÐÂ(&F)", M_REFRESH - MENUITEM "ÌØÐÔ(&R)", M_PROPERTIES -END - -MENU_SET_DRAGDROP MENU DISCARDABLE -BEGIN - MENUITEM "ÒÆ¶¯ÕâÀï(&M)...", M_SET_MOVEHERE - MENUITEM "¸´ÖÆÕâÀï(&R)...", M_SET_REPHERE - MENUITEM SEPARATOR - MENUITEM "È¡Ïû(&C)", IDC_STATIC -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SERVICES DIALOGEX 0, 0, 179, 92 -STYLE DS_CENTER | WS_CHILD -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "·þÎñ£º",IDC_SVC_DESC,0,5,179,8 - CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,0,17,179, - 61,WS_EX_STATICEDGE - PUSHBUTTON "´´½¨(&C)...",IDC_SVC_CREATE,37,80,46,12 - PUSHBUTTON "ɾ³ý(&L)",IDC_SVC_DELETE,86,80,39,12 - PUSHBUTTON "ÖØÐÂÆô¶¯(&R)",IDC_SVC_RESTART,128,80,48,12 -END - -IDD_AGGREGATES DIALOGEX 0, 0, 165, 84 -STYLE DS_CENTER | WS_CHILD -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "·ÖÇø£º",IDC_AGG_DESC,0,5,165,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,0,17,165, - 53,WS_EX_STATICEDGE - PUSHBUTTON "´´½¨¾í(&C)...",IDC_AGG_CREATESET,102,72,63,12 -END - -IDD_FILESETS DIALOGEX 0, 0, 194, 92 -STYLE DS_CENTER | WS_CHILD -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "¾í£º",IDC_SET_DESC,0,5,194,8 - CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,0,17,194, - 61,WS_EX_STATICEDGE - PUSHBUTTON "´´½¨(&C)...",IDC_SET_CREATE,1,80,42,12 - PUSHBUTTON "ɾ³ý(&L)",IDC_SET_DELETE,45,80,36,12 - PUSHBUTTON "¸´ÖÆ(&R)...",IDC_SET_REP,84,80,48,12 - PUSHBUTTON "ÉèÖÃÏÞ¶î(&Q)...",IDC_SET_SETQUOTA,134,80,59,12 -END - -IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, - 135,WS_EX_CLIENTEDGE - PUSHBUTTON "Ìí¼Ó¹ÜÀíÔ±(&A)",IDC_LIST_ADD,72,160,65,14 - PUSHBUTTON "³ýÈ¥¹ÜÀíÔ±(&R)",IDC_LIST_REMOVE,141,160,80,14 - LTEXT "·þÎñÆ÷ %1 µÄ¹ÜÀíÔ±£º",IDC_LIST_NAME,5,7,216,8 -END - -IDD_AGG_GENERAL DIALOGEX 0, 0, 267, 160 -STYLE WS_CHILD -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "±êʶ·û£º",IDC_STATIC,5,30,36,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_AGG_ID,40,30,214,8 - LTEXT "É豸£º",IDC_STATIC,5,46,31,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_AGG_DEVICE,40,46,214,8 - LTEXT "¾í£º",IDC_STATIC,5,62,31,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_AGG_FILESETS,40,62,214,8 - CONTROL "Èç¹û×éºÏµÄ¾íÏ޶¹ýÈÝÁ¿£¬ÏÔʾ¾¯¸æ(&W)", - IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 38,76,224,10 - LTEXT "Ó÷¨£º",IDC_STATIC,5,90,31,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_AGG_USAGE,38,90,214,8 - CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,38,103,224,8, - WS_EX_STATICEDGE - CONTROL "Èç¹û·ÖÇøÊ¹Óó¬³öÏ޶ÏÔʾ¾¯¸æ(&W)",IDC_AGG_WARN,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,38,116,214,10 - CONTROL "¸Ã·þÎñÆ÷µÄȱʡãÐÖµ(&D)",IDC_AGG_WARN_AGGFULL_DEF,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,49,131,203,9 - CONTROL "Æä´óСµÄ",IDC_AGG_WARN_AGGFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,49,145,62,9 - EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,112,143,29,12, - ES_AUTOHSCROLL - LTEXT "% ãÐÖµ(&T)",IDC_AGG_WARN_AGGFULL_DESC,152,145,100,8 - ICON IDI_AGGREGATE,IDC_STATIC,5,5,20,20 - LTEXT "·ÖÇø %2 (·þÎñÆ÷ %1)",IDC_AGG_NAME,38,14,214,8 -END - -IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 -STYLE WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - LTEXT "IP µØÖ·£º",IDC_STATIC,5,29,43,8 - LISTBOX IDC_SVR_ADDRESSES,53,29,70,12,LBS_NOSEL | NOT WS_BORDER | - WS_VSCROLL - PUSHBUTTON "¸ü¸ÄµØÖ·(&A)...",IDC_SVR_CHANGEADDR,144,27,77,12 - PUSHBUTTON "ÐèÒªÈÏÖ¤(&R)",IDC_SVR_AUTH_YES,41,81,84,12 - PUSHBUTTON "ÔÊÐíδÑéÖ¤µÄ(&U)",IDC_SVR_AUTH_NO,129,81,80,12 - LTEXT "·ÖÇøÊý£º",IDC_STATIC,11,131,90,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SVR_NUMAGGREGATES,108,131,99,8 - LTEXT "×ÜÈÝÁ¿£º",IDC_STATIC,11,148,48,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SVR_CAPACITY,108,148,99,8 - LTEXT "×éºÏµÄ¾íÏ޶",IDC_STATIC,11,165,79,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SVR_ALLOCATION,108,165,99,8 - ICON IDI_SERVER,IDC_STATIC,5,5,20,20 - LTEXT "(·þÎñÆ÷Ãû)",IDC_SVR_NAME,55,13,93,8 - GROUPBOX "°²È«ÐÔ",IDC_STATIC,5,52,216,52 - GROUPBOX "´æ´¢",IDC_STATIC,5,115,216,68 - LTEXT "Äú¿ÉÒÔÒªÇó¶Ô´Ë·þÎñÆ÷µÄ´æÈ¡¶¼±ØÐë¾­¹ýÈÏÖ¤¡£",IDC_STATIC, - 11,67,198,8 -END - -IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 221, 158 -STYLE WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - CONTROL "¸Ã·þÎñÆ÷µÄÈκηÖÇø±ä³É",IDC_SVR_WARN_AGGFULL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,12,18,127,9 - EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,144,16,24,12,ES_AUTOHSCROLL - LTEXT "% Âú",IDC_STATIC,184,18,28,8 - CONTROL "¸Ã·þÎñÆ÷µÄÈκξí±ä³É",IDC_SVR_WARN_SETFULL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,12,32,125,9 - EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,144,30,24,12,ES_AUTOHSCROLL - LTEXT "% Âú",IDC_STATIC,184,32,24,8 - CONTROL "ÈκηÖÇøµÄ×éºÏµÄÏ޶¹ýÆäÈÝÁ¿",IDC_SVR_WARN_AGGALLOC, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,46,200,9 - CONTROL "¸Ã·þÎñÆ÷ÉϵÄÈκηþÎñÍ£Ö¹ÔËÐÐ",IDC_SVR_WARN_SVCSTOP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,60,195,9 - CONTROL "¸Ã·þÎñÆ÷µÄÈκξíûÓÐ VLDB ÌõÄ¿",IDC_SVR_WARN_SETNOVLDB, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,74,195,9 - CONTROL "VLDB ÒýÓø÷þÎñÆ÷ÉϵÄÈκÎÍÑ»ú·ÖÇø", - IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,88,195,9 - CONTROL "VLDB ÒýÓø÷þÎñÆ÷ÉϵÄÈκÎÍÑ»ú¾í",IDC_SVR_WARN_SETNOSERV, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,103,195,9 - CONTROL "ˢзþÎñÆ÷ÐÅÏ¢£¬Ã¿¸ô",IDC_SVR_AUTOREFRESH,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,5,142,116,9 - EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,123,140,27,13,ES_AUTOHSCROLL - LTEXT "·ÖÖÓ",IDC_STATIC,164,142,25,8 - LTEXT "ÏÔʾ¾¯¸æ£¬Èç¹û",IDC_STATIC,5,5,195,8 -END - -IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 225, 207 -STYLE WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - PUSHBUTTON "²é¿´·þÎñÈÕÖ¾(&V)",IDC_SVC_VIEWLOG,47,182,66,14 - PUSHBUTTON "ÏÖÔÚÆô¶¯(&S)",IDC_SVC_START,118,182,49,14 - PUSHBUTTON "ÏÖÔÚÍ£Ö¹(&P)",IDC_SVC_STOP,169,182,49,14 - CONTROL "Èç¹û¸Ã·þÎñÔøÍ£Ö¹¹ý£¬ÏÔʾ¾¯¸æ(&W)",IDC_SVC_WARNSTOP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,159,200,10 - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "·þÎñ %2 (·þÎñÆ÷ %1)",IDC_SVC_NAME,52,13,168,8 - LTEXT "ÀàÐÍ£º",IDC_STATIC,5,29,44,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SVC_TYPE,64,29,155,8 - LTEXT "²ÎÊý£º",IDC_STATIC,5,45,44,8 - EDITTEXT IDC_SVC_PARAMS,64,45,155,13,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP - LTEXT "֪ͨÆ÷£º",IDC_STATIC,5,61,44,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SVC_NOTIFIER,64,61,155,8 - LTEXT "×î½üÒ»´ÎÆô¶¯£º",IDC_STATIC,5,77,57,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SVC_STARTDATE,64,77,155,8 - LTEXT "×î½üÒ»´ÎÍ£Ö¹£º",IDC_STATIC,5,93,57,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SVC_STOPDATE,64,93,155,8 - LTEXT "×î½üÒ»´Îʧ°Ü£º",IDC_STATIC,5,109,57,8 - EDITTEXT IDC_SVC_LASTERROR,64,109,155,13,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - GROUPBOX "·þÎñ״̬",IDC_STATIC,5,127,215,75 - LTEXT "ÕýÔÚÈ·¶¨¸Ã·þÎñµÄµ±Ç°×´Ì¬...",IDC_SVC_STATUS,11,142,200, - 8 -END - -IDD_SET_GENERAL DIALOGEX 0, 0, 273, 214 -STYLE WS_CHILD -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "¾í±êʶ·û£º",IDC_STATIC,5,30,45,8 - LTEXT "(δ֪)",IDC_SET_ID,59,30,208,8 - LTEXT "ÒÑ´´½¨µÄ£º",IDC_STATIC,5,46,45,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_CREATEDATE,59,46,208,8 - LTEXT "ÒѸüеģº",IDC_STATIC,5,62,45,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_UPDATEDATE,59,62,112,8 - LTEXT "ÒÑ´æÈ¡µÄ£º",IDC_STATIC,5,78,45,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_ACCESSDATE,59,78,208,8 - LTEXT "Òѱ¸·ÝµÄ£º",IDC_STATIC,5,94,45,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_BACKUPDATE,59,94,208,8 - LTEXT "Îļþ¼ÆÊý£º",IDC_STATIC,5,110,45,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_FILES,59,110,208,8 - LTEXT "״̬£º",IDC_STATIC,5,126,45,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_STATUS,59,126,75,8 - PUSHBUTTON "Ëø¶¨(&L)",IDC_SET_LOCK,142,124,61,12 - PUSHBUTTON "½âËø(&U)",IDC_SET_UNLOCK,207,124,61,12 - LTEXT "Ó÷¨£º",IDC_STATIC,5,142,45,8 - LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_USAGE,59,142,136,8 - PUSHBUTTON "ÉèÖÃÏÞ¶î(&Q)...",IDC_SET_QUOTA,207,140,61,12 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,49,156,219,8, - WS_EX_STATICEDGE - CONTROL "Èç¹û¸Ã¾íʹÓó¬³öÏ޶ÏÔʾ¾¯¸æ(&W)",IDC_SET_WARN,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,49,170,219,10 - CONTROL "¸Ã·þÎñÆ÷µÄȱʡãÐÖµ(&D) (Æä´óСµÄ %1%%)", - IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,61,185,207,9 - CONTROL "Æä´óСµÄ",IDC_SET_WARN_SETFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,61,199,62,9 - EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,123,197,29,12, - ES_AUTOHSCROLL - LTEXT "% ãÐÖµ(&T)",IDC_SET_WARN_SETFULL_DESC,163,199,105,8 - ICON IDI_FILESET,IDC_STATIC,5,5,20,20 - LTEXT "¾í %3 (·þÎñÆ÷ %1£¬·ÖÇø %2)",IDC_SET_NAME,49,14,219,8 -END - -IDD_MAIN DIALOGEX 0, 0, 317, 226 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | - WS_SYSMENU | WS_THICKFRAME -CAPTION "AFS ·þÎñÆ÷¹ÜÀíÆ÷" -MENU MENU_MAIN -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "ËùÑ¡µ¥Ôª£º",IDC_STATIC,2,8,55,8 - LTEXT "(µ¥ÔªÃû½«·ÅÓÚ´Ë)",IDC_CELL,62,8,222,9 - LTEXT "AFS ÁîÅÆ£º",IDC_STATIC,2,19,55,8 - LTEXT "%2:%1(ÁîÅÆ½«ÔÚ %3 µ½ÆÚ)",IDC_AFS_ID,62,19,222,9 - CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,31,313, - 193,WS_EX_CLIENTEDGE - CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 - ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 -STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "·þÎñÆ÷" -CLASS "ServerWindowClass" -FONT 9, "ËÎÌå" -BEGIN - CONTROL "",IDC_TABS,"SysTabControl32",0x0,2,2,205,133 -END - -IDD_SVC_CREATE DIALOGEX 0, 0, 225, 233 -STYLE WS_CHILD -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,5,36,44,8 - COMBOBOX IDC_SVC_SERVER,57,33,116,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "·þÎñ(&V)£º",IDC_STATIC,5,52,44,8 - COMBOBOX IDC_SVC_NAME,57,50,116,104,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "ÃüÁî(&C)£º",IDC_STATIC,5,70,44,8 - EDITTEXT IDC_SVC_COMMAND,57,68,163,13,ES_AUTOHSCROLL - LTEXT "²ÎÊý(&P)£º",IDC_STATIC,5,88,44,8 - EDITTEXT IDC_SVC_PARAMS,57,86,163,13,ES_AUTOHSCROLL - LTEXT "֪ͨÆ÷(&N)£º",IDC_STATIC,5,105,44,8 - EDITTEXT IDC_SVC_NOTIFIER,57,103,163,13,ES_AUTOHSCROLL - LTEXT "ÈÕÖ¾Îļþ(&L)£º",IDC_STATIC,5,122,52,8 - EDITTEXT IDC_SVC_LOGFILE,57,120,163,13,ES_AUTOHSCROLL - CONTROL "¼òµ¥(&I)(²»¼ä¶ÏÔËÐÐ)",IDC_SVC_TYPE_SIMPLE,"Button", - BS_AUTORADIOBUTTON,11,154,201,10 - CONTROL "ÏÖÔÚÆô¶¯¸Ã·þÎñ(&T)",IDC_SVC_RUNNOW,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 - CONTROL "&FS (Îļþϵͳ)",IDC_SVC_TYPE_FS,"Button", - BS_AUTORADIOBUTTON,11,180,201,10 - CONTROL "C&ron (ÔÚÖ¸¶¨¼ä¸ôÔËÐÐ)",IDC_SVC_TYPE_CRON,"Button", - BS_AUTORADIOBUTTON,11,195,201,10 - LTEXT "ºÎʱÔËÐÐ(&W)£º",IDC_STATIC,23,209,52,8 - COMBOBOX IDC_SVC_RUNDAY,75,207,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,148,207, - 68,13,WS_EX_CLIENTEDGE - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "н¨·þÎñ",IDC_SVC_DESC,52,13,168,8 - GROUPBOX "·þÎñÀàÐÍ",IDC_STATIC,5,141,215,87 -END - -IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 -STYLE WS_CHILD -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, - 199,58,WS_EX_CLIENTEDGE - PUSHBUTTON "ÏÖÔÚÊÍ·Å(&R)",IDC_SET_RELEASE,11,143,52,14 - PUSHBUTTON "´´½¨(&C)...",IDC_SET_REPSITE_ADD,108,143,47,14 - PUSHBUTTON "ɾ³ý(&L)",IDC_SET_REPSITE_DELETE,162,143,47,14 - LTEXT "·þÎñÆ÷£º",-1,11,31,37,8 - LTEXT "(·þÎñÆ÷Ãû)",IDC_SET_SERVER,55,31,147,8 - LTEXT "·ÖÇø£º",-1,11,44,37,8 - LTEXT "(·ÖÇøÃû)",IDC_SET_AGGREGATE,55,44,147,8 - LTEXT "¾í£º",-1,11,18,37,8 - LTEXT "(¾íÃû)",IDC_SET_NAME,55,18,147,8 - GROUPBOX "¶Á£¯Ð´¾í",-1,5,5,211,56 - GROUPBOX "¾í¸±±¾",-1,5,67,211,96 -END - -IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 257 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ñ¡Ôñµ¥Ôª - AFS ·þÎñÆ÷¹ÜÀíÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "µ¥Ôª(&C)£º",IDC_STATIC,4,24,38,8 - COMBOBOX IDC_OPENCELL_CELL,45,22,170,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - GROUPBOX "AFS ÈÏÖ¤",IDC_STATIC,4,44,211,92 - LTEXT "AFS Éí·Ý(&I)£º",IDC_STATIC,22,100,55,8 - EDITTEXT IDC_OPENCELL_ID,80,98,129,14,ES_AUTOHSCROLL - LTEXT "AFS ¿ÚÁî(&P)£º",IDC_STATIC,22,116,55,8 - EDITTEXT IDC_OPENCELL_PASSWORD,80,114,129,14,ES_PASSWORD | - ES_AUTOHSCROLL - PUSHBUTTON "¸ß¼¶(&V) >>",IDC_ADVANCED,4,146,53,14 - DEFPUSHBUTTON "È·¶¨",IDOK,86,146,41,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,130,146,41,14 - PUSHBUTTON "°ïÖú(&H)",9,174,146,41,14 - CONTROL "¼àÊӸõ¥ÔªµÄËùÓзþÎñÆ÷(&L)",IDC_MON_ALL,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,10,204,185,9 - CONTROL "½ö¼àÊÓÒ»¸ö·þÎñÆ÷(&M)£º",IDC_MON_ONE,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,10,219,110,10 - EDITTEXT IDC_MON_SERVER,125,218,83,13,ES_AUTOHSCROLL - CONTROL "½ö¼àÊÓ×Ó¼¯ÖеķþÎñÆ÷(&S)£º",IDC_MON_SOME,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,10,235,110,10 - COMBOBOX IDC_MON_SUBSET,125,233,83,93,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Ñ¡ÔñÄúÏ£ÍûʹÓÃµÄ AFS µ¥Ôª¡£",IDC_STATIC,4,7,200,8 - GROUPBOX "¼àÊÓ·þÎñÆ÷",IDC_ADVANCED_GROUP,4,169,211,84 - LTEXT "ΪÁ˵õ½¸ü¿ìËÙµÄÐÔÄÜ£¬Äú¿ÉÒÔÑ¡Ôñ½ö¼àÊӸõ¥ÔªÖпÉÓõķþÎñÆ÷×Ó¼¯¡£", - IDC_STATIC,10,182,199,17 - LTEXT "(ÕýÔÚ²éѯ...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "Òª¹ÜÀíµ¥Ôª£¬±ØÐëÖØÐÂÊäÈëÄúµÄ AFS ¿ÚÁ",IDC_STATIC,10, - 85,196,8 - LTEXT "ÄúÔÚËùÑ¡µ¥ÔªÄڵĵ±Ç° AFS ÁîÅÆ£º",IDC_STATIC,10,57,196,8 -END - -IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "¾¯¸æ - AFS ·þÎñÆ÷¹ÜÀíÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - CONTROL "¼ÌÐøµÈ´ýÖ±ÖÁÈÎÎñÕý³£Íê³É(&C)",IDC_TIMEOUT_WAIT,"Button", - BS_AUTORADIOBUTTON,24,87,208,10 - CONTROL "ÖÕÖ¹ÈÎÎñ(&T)",IDC_TIMEOUT_KILL,"Button", - BS_AUTORADIOBUTTON,24,101,208,10 - DEFPUSHBUTTON "È·¶¨",IDOK,93,139,50,14 - LTEXT "ÈÎÎñÒÑÔËÐеÄʱ¼ä£º",IDC_STATIC,4,119,142,8 - LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,151,119,32,8 - LTEXT "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÒѾ­µÈ´ýÁ˺ܳ¤Ò»¶Îʱ¼ä£¬ÍøÂçÈÎÎñ»¹Î´Íê³É¡£", - IDC_STATIC,4,7,228,18 - LTEXT "Äú¿ÉÒÔÈÃÈÎÎñ¼ÌÐøÔËÐÐ(½¨Òé)£¬»òÕßÈç¹ûÄúÈ·ÐÅÈÎÎñÎÞ·¨Íê³É£¬Äú¿ÉÒÔÔÊÐí AFS ·þÎñÆ÷¹ÜÀíÆ÷ÖÕÖ¹ÈÎÎñ¡£", - IDC_STATIC,4,30,228,26 - LTEXT "Çë×¢ÒâÏÔʾ¸Ã´°¿Úʱ£¬ÈÎÎñÈÔÔÚÔËÐУ»Èç¹ûÈÎÎñÍê³É£¬¸Ã´°¿Ú»á×Ô¶¯¹Ø±Õ¡£", - IDC_STATIC,4,63,228,17 -END - -IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 -STYLE WS_POPUP | WS_CAPTION -CAPTION "ÁÐ" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "Ñ¡ÔñÁÐʾʱÏÔʾµÄÁÐ(&S)£º",IDC_STATIC,5,7,126,8 - COMBOBOX IDC_COLUMNS,134,5,147,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "¿ÉÓõÄÁÐ(&C)£º",IDC_STATIC,12,40,100,8 - LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "ÒªÏÔʾµÄÁÐ(&I)£º",IDC_STATIC,173,41,100,8 - LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Ìí¼Ó(&A) >>",IDC_COL_INSERT,119,68,46,14 - PUSHBUTTON "<< ³ýÈ¥(&R)",IDC_COL_DELETE,119,88,46,14 - PUSHBUTTON "ÏòÉÏÒÆ¶¯(&U)",IDC_COL_UP,173,122,48,14 - PUSHBUTTON "ÏòÏÂÒÆ¶¯(&D)",IDC_COL_DOWN,224,122,48,14 - GROUPBOX "ÁгöÁÐ",IDC_STATIC,5,25,276,118 -END - -IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 264, 72 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "ˢР- AFS ·þÎñÆ÷¹ÜÀíÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, - 256,8 - LTEXT "Íê³É 0%%",IDC_REFRESH_PERCENT,4,49,216,8 - LTEXT "",IDC_REFRESH_CURRENT,4,60,216,8 - LTEXT "ÇëµÈ´ý...",IDC_REFRESH_DESC,4,7,256,25 - PUSHBUTTON "Ìø¹ý(&S)",IDC_REFRESH_SKIP,222,58,38,12,NOT WS_TABSTOP -END - -IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "´´½¨¾í" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "Ãû³Æ(&N)£º",IDC_STATIC,4,30,39,8 - EDITTEXT IDC_SET_NAME,50,28,116,14,ES_AUTOHSCROLL - LTEXT "ÏÞ¶î(&Q)£º",IDC_STATIC,4,48,39,8 - EDITTEXT IDC_SET_QUOTA,50,46,32,14,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,94,47,30,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "±¸·Ý(&B)£º",IDC_STATIC,4,66,39,8 - CONTROL "ͬʱ´´½¨¸Ã¾íµÄÒ»¸ö±¸·Ý°æ±¾(&R)",IDC_SET_CLONE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,50,66,162,8 - LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,4,84,46,8 - COMBOBOX IDC_SET_SERVER,50,82,116,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "·ÖÇø(&P)£º",IDC_STATIC,4,102,39,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,46,102,271, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "È·¶¨",IDOK,156,191,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,211,191,50,14 - PUSHBUTTON "°ïÖú(&H)",9,267,191,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "н¨¾í",IDC_STATIC,46,12,170,8 -END - -IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 307, 103 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ɾ³ý¾í" -FONT 9, "ËÎÌå" -BEGIN - DEFPUSHBUTTON "È¡Ïû",IDCANCEL,199,85,50,14 - PUSHBUTTON "È·¶¨",IDOK,144,85,50,14 - PUSHBUTTON "°ïÖú(&H)",9,253,85,50,14 - CONTROL "´Ó·þÎñÆ÷ %1£¬·ÖÇø %2 ÉÏɾ³ý¾í %3(&D)",IDC_DELSET_SERVER, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,61,45,242,10 - CONTROL "ɾ³ý¾í %3 µÄ VLDB ÌõÄ¿(&V)",IDC_DELSET_VLDB,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,61,60,242,10 - ICON 32515,IDC_STATIC,4,7,21,21 - LTEXT "×¢Ò⣡\n\n¸Ã²Ù×÷½«µ¼ÖÂÓÀ¾Ãɾ³ý¾í %3",IDC_DELSET_DESC,61, - 7,242,33 -END - -IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "±¸·Ý¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - DEFPUSHBUTTON "È·¶¨",IDOK,183,67,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,237,67,50,14 - PUSHBUTTON "°ïÖú(&H)",9,291,67,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,21,20 - LTEXT "¾í±¸·ÝÀàËÆÓڸþíµÄÖ»¶Á¸±±¾¡£¶Á£¯Ð´¾íÖ»ÄÜÓÐÒ»¸ö±¸·Ý°æ±¾¡£", - IDC_STATIC,34,9,307,17 - LTEXT "µ¥»÷È·¶¨À´Îª·þÎñÆ÷ %1£¬·ÖÇø %2 Éϵľí %3 ´´½¨Ò»¸ö±¸·Ý¡£ Èç¹û¸Ã¾íÒÑ´æÔÚ±¸·Ý£¬»á×Ô¶¯¸üС£", - IDC_CLONE_DESC,34,32,307,24 -END - -IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 -STYLE WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - GROUPBOX "ÒÑÖªÎÊÌâ",IDC_PROBLEM_BOX,5,36,215,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,138,120,61,12 - ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "·þÎñ %2 (·þÎñÆ÷ %1)",IDC_PROBLEM_TITLE,52,13,168,8 -END - -IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 -STYLE WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - GROUPBOX "ÒÑÖªÎÊÌâ",IDC_PROBLEM_BOX,5,36,216,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,172,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,201,49,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,136,120,61,12 - ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "%1",IDC_PROBLEM_TITLE,42,13,179,8 -END - -IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 -STYLE WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - GROUPBOX "ÒÑÖªÎÊÌâ",IDC_PROBLEM_BOX,5,35,247,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,170,119,61,12 - ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "·ÖÇø %2 (·þÎñÆ÷ %1)",IDC_PROBLEM_TITLE,38,14,214,8 -END - -IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 -STYLE WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - GROUPBOX "ÒÑÖªÎÊÌâ",IDC_PROBLEM_BOX,5,35,263,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,249,48,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 - ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "¾í %3 (·þÎñÆ÷ %1£¬·ÖÇø %2)",IDC_PROBLEM_TITLE,49,14,219, - 8 -END - -IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ÒÆ¶¯¾í" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,70,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "È·¶¨",IDOK,115,156,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,169,156,50,14 - PUSHBUTTON "°ïÖú(&H)",9,223,156,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,21,20 - LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,242,24 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 - LTEXT "ÒÆ¶¯¾íµ½(&M)£º",IDC_STATIC,4,43,116,8 -END - -IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "ÒÆ¶¯¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "´Ó·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏÒÆ¶¯¾í %3 µ½·þÎñÆ÷ %4 µÄ·ÖÇø %5...", - IDC_MOVESET_DESC,4,41,229,19 -END - -IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 277, 106 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "²é¿´ÈÕÖ¾Îļþ" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "²é¿´ÈÕÖ¾ÎļþµÄ·þÎñÆ÷(&S)£º",IDC_STATIC,4,45,109,8 - COMBOBOX IDC_VIEWLOG_SERVER,116,43,126,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "·þÎñÆ÷ÉÏÒª²é¿´µÄÎļþ(&F)£º",IDC_STATIC,4,64,109,8 - EDITTEXT IDC_VIEWLOG_FILENAME,116,62,157,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È·¶¨",IDOK,169,88,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,223,88,50,14 - ICON IDI_SERVICE,IDC_STATIC,4,4,20,20 - LTEXT "ÇëÊäÈëÄúÏ£Íû²é¿´µÄÈÕÖ¾ÎļþµÄ¾ø¶Ô·¾¶¡£", - IDC_VIEWLOG_DESC,31,10,242,21 -END - -IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 286, 185 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "²é¿´ÈÕÖ¾Îļþ" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "ÎļþĿ¼£º",IDC_SVC_VIEWLOG_CONTENTS,4,41,277,8 - EDITTEXT IDC_VIEWLOG_TEXT,4,51,277,113,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL - PUSHBUTTON "Áí´æÎª(&A)...",IDC_VIEWLOG_SAVEAS,173,167,53,14 - DEFPUSHBUTTON "¹Ø±Õ(&C)",IDOK,231,167,50,14 - ICON IDI_SERVICE,-1,4,7,20,20 - LTEXT "ÔÚ·þÎñÆ÷ %1 ÉϵÄ[·þÎñ %2 µÄ]ÈÕÖ¾Îļþ", - IDC_SVC_VIEWLOG_DESC,33,7,248,8 - LTEXT "·þÎñÆ÷ÉϵÄÎļþÃû£º%1",IDC_SVC_VIEWLOG_FILENAME,33,23, - 248,8 -END - -IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ÉèÖþíÏÞ¶î" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "µ±Ç°Ï޶",IDC_STATIC,4,49,47,8 - LTEXT "(δ֪)",IDC_SET_USAGE,59,49,208,8 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,59,60,208,8, - WS_EX_STATICEDGE - LTEXT "ÐÂÏÞ¶î(&Q)£º",IDC_STATIC,4,81,47,8 - EDITTEXT IDC_SET_QUOTA,59,79,32,13,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,103,79,30,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "È·¶¨",IDOK,109,112,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,163,112,50,14 - PUSHBUTTON "°ïÖú(&H)",9,217,112,50,14 - PUSHBUTTON "ÌØÐÔ(&P)...",IDC_AGG_PROPERTIES,212,28,55,12 - LTEXT "·ÖÇø£º",IDC_STATIC,4,30,47,8 - LTEXT "·þÎñÆ÷ %1 µÄ·ÖÇø %2",IDC_SET_AGGREGATE,59,30,141,8 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "¾í %1",IDC_SET_NAME,59,11,208,8 -END - -IDD_ACTIONS DIALOGEX 0, 0, 236, 58 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "ÕýÔÚ½øÐеIJÙ×÷ - AFS ·þÎñÆ÷¹ÜÀíÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "ÏÂÁвÙ×÷ÕýÔÚ½øÐУº",IDC_ACTION_DESC,2,2,232,8 - CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | - 0x3,2,14,232,43 -END - -IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ͬ²½ VLDB" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - DEFPUSHBUTTON "È·¶¨",IDOK,107,81,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,161,81,50,14 - PUSHBUTTON "°ïÖú(&H)",9,215,81,50,14 - ICON 32515,IDC_STATIC,4,4,21,20 - LTEXT "(ÔËÐÐʱÉèÖÃ)",IDC_SYNC_DESC,37,4,228,32 - LTEXT "(ÔËÐÐʱÉèÖÃ)",IDC_SYNC_DESC2,37,44,228,24 -END - -IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "¸´Öƾí" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,62,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "È·¶¨",IDOK,115,153,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,169,153,50,14 - PUSHBUTTON "°ïÖú(&H)",9,223,153,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,21,20 - LTEXT "¾í %3 µÄи±±¾",IDC_SET_NAME,31,12,242,8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 - LTEXT "´´½¨¸Ã¾íµÄÒ»¸öи±±¾ÔÚ(&C)£º",IDC_STATIC,4,35,125,8 -END - -IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 248, 156 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "°²×°Îļþ" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "Ô´Îļþ(&F)£º",IDC_STATIC,4,74,49,8 - EDITTEXT IDC_FILENAME,66,72,126,14,ES_AUTOHSCROLL - PUSHBUTTON "ä¯ÀÀ(&B)...",IDC_BROWSE,194,72,50,14 - LTEXT "Ä¿±ê·þÎñÆ÷(&S)£º",IDC_STATIC,4,93,60,8 - COMBOBOX IDC_SERVER,66,92,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Ä¿±êÃû³Æ(&N)£º",IDC_STATIC,4,114,60,8 - EDITTEXT IDC_DIRECTORY,66,112,135,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È·¶¨",IDOK,86,138,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,140,138,50,14 - PUSHBUTTON "°ïÖú(&H)",9,194,138,50,14 - ICON IDI_INSTALL,IDC_STATIC,4,4,20,20 - LTEXT "ÔÚ·þÎñÆ÷Éϰ²×°Îļþ",IDC_STATIC,32,12,127,8 - LTEXT "(ÔËÐÐʱÉèÖõÄÎı¾)\n(ÔËÐÐʱÉèÖõÄÎı¾)\n(ÔËÐÐʱÉèÖõÄÎı¾)\n(ÔËÐÐʱÉèÖõÄÎı¾)", - IDC_INSTALL_DESC,4,29,240,33 -END - -IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "жװÎļþ" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,4,66,52,8 - COMBOBOX IDC_SERVER,58,64,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Ä¿±êÎļþ(&F)£º",IDC_STATIC,4,85,52,8 - EDITTEXT IDC_FILENAME,58,83,175,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È·¶¨",IDOK,88,121,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,141,121,50,14 - PUSHBUTTON "°ïÖú(&H)",9,194,121,50,14 - ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 - LTEXT "´Ó·þÎñÆ÷жװÎļþ",IDC_STATIC,32,12,127,8 - LTEXT "¸Ã²Ù×÷ÔÊÐíÄúÔÚÒ»¸öÌØÊâ·þÎñÆ÷Éϻָ´Ò»¸öÔ¤ÏȰ²×°µÄÎļþµÄ¸±±¾¡£Èç¹ûËùÑ¡ÎļþÎÞ´ËÀั±¾´æÔÚ£¬½«³ýÈ¥¸ÃÎļþ¡£", - IDC_STATIC,4,29,240,26 -END - -IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 200, 141 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ɾ³ý¾ÉÎļþ" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "·þÎñÆ÷£º",-1,4,56,44,8 - COMBOBOX IDC_SERVER,53,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "ɾ³ýËùÓкËÐÄÎļþ(&C)",IDC_OP_DELETE_CORE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,53,73,143,10 - CONTROL "ɾ³ý.BAKÀ©Õ¹ÃûÎļþ(Îļþ±¸·Ý)(&B)",IDC_OP_DELETE_BAK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,84,143,10 - CONTROL "ɾ³ý.OLDÀ©Õ¹ÃûÎļþ(¾ÉÎļþ±¸·Ý)(&O)",IDC_OP_DELETE_OLD, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,95,143,10 - DEFPUSHBUTTON "È·¶¨",IDOK,39,123,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,93,123,50,14 - PUSHBUTTON "°ïÖú(&H)",9,146,123,50,14 - ICON IDI_PRUNE,-1,4,4,20,20 - LTEXT "´Ó·þÎñÆ÷ÉÏɾ³ý¾ÉÎļþ",-1,32,12,101,8 - LTEXT "¸Ã²Ù×÷ɾ³ýÔÚÌØ¶¨·þÎñÆ÷ÉϵÄÎļþ±¸·Ý¡£",-1,4,29,192,16 - LTEXT "ɾ³ýÎļþ£º",-1,4,73,45,8 -END - -IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ÖØÃüÃû¾í" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "¾ÉÃû³Æ(&O)£º",IDC_STATIC,31,67,46,8 - EDITTEXT IDC_RENSET_OLD,88,65,122,14,ES_AUTOHSCROLL | ES_READONLY - LTEXT "ÐÂÃû³Æ(&N)£º",IDC_STATIC,31,85,46,8 - EDITTEXT IDC_RENSET_NEW,88,83,122,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È·¶¨",IDOK,115,115,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,169,115,50,14 - PUSHBUTTON "°ïÖú",9,223,115,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "ÒªÖØÃüÃû¾í %3£¬ÔÚÏÂÃæÊäÈëÒ»¸öÐÂÃû³Æ¡£ÖØÃüÃû»á×Ô¶¯¸ü¸Ä¾íµÄ±¸·ÝºÍËùÓи±±¾µÄÃû³Æ¡£\n\n×¢Ò⣺Èç¹ûÄúÖØÃüÃûÒ»¸ö°²×°µÄ¾í£¬Äú±ØÐëɾ³ý²¢ÖØÐ´´½¨Æä°²×°µã¡£", - IDC_RENSET_DESC,31,7,242,48 -END - -IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 277, 68 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ɾ³ý·þÎñ" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - DEFPUSHBUTTON "È¡Ïû",IDCANCEL,169,50,50,14 - PUSHBUTTON "È·¶¨",IDOK,115,50,50,14 - PUSHBUTTON "°ïÖú",9,223,50,50,14 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "×¢Ò⣡\n\n¸Ã²Ù×÷½«µ¼Ö·þÎñ %2 Í£Ö¹²¢´Ó·þÎñÆ÷ %1 ÉÏÓÀ¾Ãɾ³ý", - IDC_DELSVC_DESC,31,7,242,33 -END - -IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "»ñµÃÎļþÈÕÆÚ" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "·þÎñÆ÷(&S)£º",-1,4,56,68,8 - COMBOBOX IDC_SERVER,74,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Òª²éѯµÄÎļþ(&F)£º",-1,4,75,68,8 - EDITTEXT IDC_FILENAME,74,73,135,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È·¶¨",IDOK,86,107,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,140,107,50,14 - PUSHBUTTON "°ïÖú(&H)",9,194,107,50,14 - ICON IDI_GETDATES,-1,4,4,20,20 - LTEXT "»ñµÃ·þÎñÆ÷ÉϵÄÎļþÈÕÆÚ",-1,32,12,127,8 - LTEXT "¸Ã²Ù×÷»ñµÃÎļþ¼°Æä±¸·Ý(Èç¹û´æÔڵϰ)×î½üÒ»´ÎÐ޸ĵÄÈÕÆÚ¡£", - -1,4,29,240,16 -END - -IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "»ñµÃÎļþÈÕÆÚ - ½á¹û" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "·þÎñÆ÷£º",IDC_STATIC,4,30,39,8 - LTEXT "(ÔËÐÐʱÉèÖÃ)",IDC_SERVER,56,30,137,8 - LTEXT "ÎļþÃû£º",IDC_STATIC,4,45,39,8 - LTEXT "(ÔËÐÐʱÉèÖÃ)",IDC_FILENAME,56,45,137,8 - LTEXT "ÎļþÈÕÆÚ£º",IDC_STATIC,4,60,45,8 - LTEXT "(δ֪£»ÎÞ·¨ÕÒµ½Îļþ)",IDC_DATE_FILE,56,60,188,8 - LTEXT ".BAK ÈÕÆÚ£º",IDC_STATIC,4,75,45,8 - LTEXT "(δ֪£»ÎÞ·¨ÕÒµ½Îļþ)",IDC_DATE_BAK,56,75,188,8 - LTEXT ".OLD ÈÕÆÚ£º",IDC_STATIC,4,90,45,8 - LTEXT "(δ֪£»ÎÞ·¨ÕÒµ½Îļþ)",IDC_DATE_OLD,56,90,188,8 - DEFPUSHBUTTON "¹Ø±Õ(&C)",IDOK,99,114,50,14 - ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 - LTEXT "»ñµÃ·þÎñÆ÷ÉϵÄÎļþÈÕÆÚ",IDC_STATIC,32,12,127,8 -END - -IDD_SET_DUMP DIALOGEX 0, 0, 295, 144 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ת´¢¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "´´½¨×ª´¢Îļþ²¢ÃüÃûΪ(&N)£º",IDC_STATIC,4,42,100,8 - EDITTEXT IDC_DUMP_FILENAME,106,40,132,14,ES_AUTOHSCROLL - PUSHBUTTON "ä¯ÀÀ(&B)...",IDC_DUMP_BROWSE,241,40,50,14 - CONTROL "ת´¢¾í %3 ËùÓеÄÄÚÈÝ(·ÖÇø %1:%2)",IDC_DUMP_FULL,"Button", - BS_AUTORADIOBUTTON | WS_GROUP,10,78,274,10 - CONTROL "½öת´¢×ÔÓÒÃæÊ±¼äÒÔÀ´¸ü¸ÄµÄÎļþ(&S)",IDC_DUMP_LIMIT_TIME, - "Button",BS_AUTORADIOBUTTON,10,93,153,10 - CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,170,93,51, - 13,WS_EX_CLIENTEDGE - CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,228,93,56, - 13,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "È·¶¨",IDOK,131,126,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,185,126,50,14 - PUSHBUTTON "°ïÖú(&H)",9,241,126,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "¸Ã²Ù×÷¸´ÖÆÒ»¸ö¾íµÄÄÚÈݵ½Ò»¸öµ¥¶ÀÎļþ£¬ÒÔ±ã¸Ã¾í¿ÉÒÔ·½±ãµØ±¸·Ý¡£ÕâÑùת´¢µÄ¾íÄÚÈÝÒÔºó¿ÉÒÔ»Ö¸´¡£", - IDC_STATIC,30,7,261,24 - GROUPBOX "ת´¢²ÎÊý",IDC_STATIC,4,62,287,53 -END - -IDD_SET_RESTORE DIALOGEX 0, 0, 292, 248 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "»Ö¸´¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "Òª»Ö¸´µÄÎļþ(&R)£º",IDC_STATIC,4,33,70,8 - EDITTEXT IDC_RESTORE_FILENAME,75,30,157,14,ES_AUTOHSCROLL - PUSHBUTTON "ä¯ÀÀ(&B)...",IDC_RESTORE_BROWSE,238,30,50,14 - CONTROL "ÕâÊÇÒ»¸öÔöÁ¿×ª´¢Îļþ(&I)",IDC_RESTORE_INCREMENTAL, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,75,46,114,10 - LTEXT "¾í(&V)£º",IDC_STATIC,11,102,31,8 - EDITTEXT IDC_RESTORE_SETNAME,57,100,115,14,ES_AUTOHSCROLL - LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,11,145,44,8 - COMBOBOX IDC_RESTORE_SERVER,57,143,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "·ÖÇø(&P)£º",IDC_STATIC,11,162,36,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,50,161,231, - 55,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "È·¶¨",IDOK,128,230,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,183,230,50,14 - PUSHBUTTON "°ïÖú(&H)",9,238,230,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "´Óת´¢Îļþ»Ö¸´¾í",IDC_STATIC,33,11,224,8 - GROUPBOX "Ä¿±ê¾í",IDC_STATIC,4,63,284,160 - LTEXT "µ±Äú´Óת´¢Îļþ»Ö¸´¾íʱ£¬¿ÉÒÔ´´½¨Ò»¸öоí»ò¸²¸ÇÒ»¸öÏÖÓеĶÁ/д¾í¡£", - IDC_STATIC,11,78,259,16 - LTEXT "(ÔËÐÐʱÉèÖÃ)\n(ÔËÐÐʱÉèÖÃ)",IDC_RESTORE_CREATE,57,119, - 229,17 -END - -IDD_SVC_BOS DIALOGEX 0, 0, 225, 207 -STYLE WS_CHILD -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - CONTROL "ÖÜÆÚÐÔÍ£Ö¹ºÍÖØÐÂÆô¶¯¸Ã·þÎñÆ÷ÉϵÄËùÓзþÎñ(&P)", - IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, - 71,193,10 - LTEXT "ÖØÐÂÆô¶¯(&R)",IDC_BOS_GENRES_DESC1,17,87,47,8 - COMBOBOX IDC_BOS_GENRES_DATE,68,84,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "ÔÚ(&A)",IDC_BOS_GENRES_DESC2,139,87,20,8 - CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,164, - 84,53,13,WS_EX_CLIENTEDGE - CONTROL "Ϊжþ½øÖÆÎļþÖÜÆÚÐÔ²âÊԸ÷þÎñÆ÷ÉϵÄËùÓзþÎñ(&B)", - IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, - 151,201,10 - LTEXT "²âÊÔ(&S)",IDC_BOS_BINRES_DESC1,17,167,33,8 - COMBOBOX IDC_BOS_BINRES_DATE,68,164,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "ÔÚ(&T)",IDC_BOS_BINRES_DESC2,139,167,20,8 - CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,164, - 164,53,13,WS_EX_CLIENTEDGE - ICON IDI_BOSSERVICE,IDC_STATIC,5,5,20,20 - LTEXT "·þÎñ %2 (·þÎñÆ÷ %1)",IDC_SVC_NAME,52,13,168,8 - GROUPBOX "BOS ·þÎñ",IDC_STATIC,5,27,215,175 - LTEXT "BOS ·þÎñÄÜÓÃÀ´ÖÜÆÚÐÔÍ£Ö¹ºÍÖØÐÂÆô¶¯¸Ã·þÎñÆ÷ÉϵÄËùÓзþÎñ(°üÀ¨ BOS ·þÎñ±¾Éí)¡£", - IDC_STATIC,11,45,200,18 - LTEXT "BOS ·þÎñÒ²ÄÜÓÃÀ´ÖÜÆÚÐÔ²âÊÔ·þÎñÆ÷ÉϵÄËùÓзþÎñ£¬½öÍ£Ö¹ºÍÖØÐÂÆô¶¯¶þ½øÖÆÎļþÒѸüеķþÎñ¡£", - IDC_STATIC,11,118,200,25 -END - -IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "ת´¢¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "´Ó¾í %3 ´´½¨×ª´¢Îļþ %4...",IDC_DUMPSET_DESC,4,41,229, - 19 -END - -IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "»Ö¸´¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "´Óת´¢Îļþ %2 »Ö¸´¾í %1...",IDC_RESTORESET_DESC,4,41, - 229,19 -END - -IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 258, 163 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "±¸·Ý¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - CONTROL "´´½¨¸Ãµ¥ÔªÖеÄËùÓоíµÄ±¸·Ý°æ±¾(&A)",IDC_CLONE_ALL, - "Button",BS_AUTORADIOBUTTON,30,53,214,10 - GROUPBOX " ",IDC_STATIC,23,68,231,67 - CONTROL "½öΪ·ûºÏÏÂÁбê×¼µÄ¾í´´½¨±¸·Ý(&O)£º",IDC_CLONE_SOME, - "Button",BS_AUTORADIOBUTTON,43,67,200,11 - CONTROL "½ö¶Ô·þÎñÆ÷Éϵľí(&S)£º",IDC_CLONE_SVR_LIMIT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,41,83,92,10 - COMBOBOX IDC_CLONE_SVR,152,82,85,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "½ö·ÖÇøÉϵľí(&P)£º",IDC_CLONE_AGG_LIMIT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,41,99,97,10 - COMBOBOX IDC_CLONE_AGG,152,98,85,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "½ö¶ÔÒÔÓÒÃæ¿ªÊ¼µÄ¾í£º",IDC_CLONE_PREFIX_LIMIT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,41,116,106,10 - EDITTEXT IDC_CLONE_PREFIX,152,115,85,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È·¶¨",IDOK,95,145,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,149,145,50,14 - PUSHBUTTON "°ïÖú(&H)",9,204,145,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "¾í±¸·ÝÀàËÆÓڸþíµÄÖ»¶Á¸±±¾¡£¶Á£¯Ð´¾íÖ»ÄÜÓÐÒ»¸ö±¸·Ý°æ±¾¡£\n\nÄú¿ÉÒÔͬʱΪ¶à¸ö¾í´´½¨±¸·Ý°æ±¾¡£", - IDC_STATIC,30,7,214,40 -END - -IDD_SUBSETS DIALOGEX 0, 0, 281, 182 -STYLE WS_POPUP | WS_CAPTION -CAPTION "±»¼àÊӵķþÎñÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "×Ó¼¯Ãû³Æ£º",IDC_STATIC,12,77,44,8 - EDITTEXT IDC_SUBSET_NAME,64,75,116,14,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_TABSTOP - PUSHBUTTON "´ò¿ª(&O)...",IDC_SUBSET_LOAD,181,75,47,14 - PUSHBUTTON "±£´æ(&S)...",IDC_SUBSET_SAVE,231,75,43,14 - CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x153,12,111,193,58,WS_EX_CLIENTEDGE - PUSHBUTTON "¼àÊÓËùÓÐ(&A)",IDC_SUBSET_ALL,211,122,57,14 - PUSHBUTTON "²»¼àÊÓ(&N)",IDC_SUBSET_NONE,211,140,57,14 - LTEXT "µ±ÔÚÒ»½Ï´óµ¥ÔªÖй¤×÷£¬ÏëÒª¸Ä½øÐÔÄÜ£¬Äú¿ÉÒÔÑ¡Ôñ²»¼àÊÓijЩ·þÎñÆ÷ÊÇ·ñ³öÎÊÌâ¡£AFS ·þÎñÆ÷¹ÜÀíÆ÷²»»áÏÔʾδ±»¼àÊӵķþÎñÆ÷ÉÏµÄ¾í¡¢·ÖÇø»ò·þÎñ¡£", - IDC_STATIC,5,5,271,24 - LTEXT "Äú¿ÉÒÔÔÚÈκÎʱ¿ÌÑ¡Ôñ¼àÊÓ(»ò²»¼àÊÓ)·þÎñÆ÷¡£Äú¿ÉÒÔ´´½¨·þÎñÆ÷×Ó¼¯À´Ö¸¶¨Ó¦¼àÊӵķþÎñÆ÷ÁÐ±í¡£", - IDC_STATIC,5,37,271,18 - GROUPBOX "µ±Ç°×Ó¼¯",IDC_STATIC,5,63,271,114 - LTEXT "Òª¼àÊӵķþÎñÆ÷£º",IDC_STATIC,12,95,69,8 -END - -IDD_SUBSET_LOADSAVE DIALOGEX 0, 0, 280, 145 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | - WS_CAPTION | WS_SYSMENU -CAPTION "(ÔËÐÐʱÉèÖõıêÌâ)" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "×Ó¼¯Ãû³Æ(&N)£º",1090,5,112,52,8,SS_NOTIFY - EDITTEXT IDC_SUBSET_NAME,60,110,160,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "´ò¿ª(&O)",IDOK,226,110,50,14 - PUSHBUTTON "È¡Ïû(&L)",IDCANCEL,226,127,50,14 - CONTROL "Áбí1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | - LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,272,82, - WS_EX_CLIENTEDGE - PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT - WS_TABSTOP - PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT - WS_TABSTOP - LTEXT "ÒÑΪ¸Ãµ¥Ôª¶¨ÒåµÄ×Ó¼¯£º",IDC_STATIC,4,6,114,8 -END - -IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "²éÕÒÃüÁî" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - COMBOBOX IDC_FIND_COMMAND,4,38,137,170,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "ÏÔʾ°ïÖú(&H)",IDOK,147,38,67,14 - PUSHBUTTON "È¡Ïû(&C)",IDCANCEL,147,55,67,14 - LTEXT "Òª²éÕÒÈçºÎʹÓà AFS ÕÊ»§¹ÜÀíÆ÷À´Ö´ÐÐÈÎÎñ£¬Ñ¡ÔñÏÂÃæµÄÒ»¸öÃüÁîÐв¢µ¥»÷¡°ÏÔʾ°ïÖú¡±°´Å¥¡£", - IDC_STATIC,4,4,210,25 -END - -IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 141 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "²éÕÒ´íÎó´úÂë" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "´íÎóºÅ(&E)£º",IDC_STATIC,4,41,45,8 - EDITTEXT IDC_ERROR_NUMBER,59,39,78,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "ת»»(&T)",IDC_ERROR_TRANSLATE,147,39,67,14 - PUSHBUTTON "¹Ø±Õ(&C)",IDCANCEL,85,123,48,14 - LTEXT "(ÔËÐÐʱÉèÖõÄÎı¾)",IDC_ERROR_DESC,4,71,210,42 - LTEXT "Òª²éÕÒ´íÎó´úÂëµÄº¬Ò壬ÔÚÏÂÃæÊäÈë´úÂëÈ»ºóµ¥»÷""ת»»""°´Å¥¡£", - IDC_STATIC,4,4,210,25 - CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 -END - -IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "¹ØÓÚ AFS ·þÎñÆ÷¹ÜÀíÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 - LTEXT "AFS ·þÎñÆ÷¹ÜÀíÆ÷£¬°æ±¾ 3.5",IDC_STATIC,33,8,163,8 - LTEXT "°æÈ¨ËùÓÐ(C) IBM ¹«Ë¾ 1989£¬1999",IDC_STATIC,33,20,183,8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 - CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 - PUSHBUTTON "¹Ø±Õ(&C)",IDOK,89,123,50,14 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 -END - -IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÕýÔÚµ¥Ôª %1 ÖÐËÑË÷·þÎñÆ÷...", - IDC_OPENCELL_DESC,41,15,183,16 - GROUPBOX "",IDC_STATIC,4,2,231,39 - ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 279, 136 -STYLE WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - CONTROL "Ϊ·þÎñÆ÷ÏÔʾȫÏÞ¶¨ÓòÃû(ÀýÈ磬""machine.company.com"")", - IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,5,269,10 - CONTROL "Èç¹û²»ÓùÜÀíÁîÅÆ¹¤×÷£¬ÏÔʾ¾¯¸æ(&W)", - IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,19,269,10 - CONTROL "...×ÜÊÇÏÔʾ·þÎñÆ÷µÄÌØÐÔ",IDC_OPT_SVR_DBL_PROP,"Button", - BS_AUTORADIOBUTTON,21,50,253,10 - CONTROL "...½öµ±¿ìËٲ鿴ÏÔʾ´°¿Ú´ò¿ªÊ±£¬ÏÔʾ·þÎñÆ÷ÌØÐÔ", - IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON,21, - 63,253,10 - CONTROL "...×ÜÊÇΪ·þÎñÆ÷´ò¿ªÒ»¸ö´°¿Ú",IDC_OPT_SVR_DBL_OPEN, - "Button",BS_AUTORADIOBUTTON,21,75,253,10 - CONTROL "...´ò¿ªÒ»¸ö·þÎñÆ÷´°¿Ú»áʹ¸Ã·þÎñÆ÷´¦ÓÚ±»¼àÊÓ״̬", - IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,21,107,253,10 - CONTROL "...¹Ø±ÕÒ»¸ö·þÎñÆ÷´°¿Ú»áʹ¸Ã·þÎñÆ÷½áÊø±»¼àÊÓ״̬", - IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,21,121,253,10 - LTEXT "Ë«»÷·þÎñÆ÷ͼ±ê...",IDC_STATIC,5,38,269,8 - LTEXT "Èç¹û·þÎñÆ÷×Ó¼¯ÕýÔÚʹÓÃÇÒ¿ìËٲ鿴ÏÔʾ´°¿ÚÊǹرյÄ...", - IDC_STATIC,5,95,269,8 -END - -IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,22,216, - 135,WS_EX_CLIENTEDGE - PUSHBUTTON "Ìí¼Ó·þÎñÆ÷ÃÜÔ¿(&A)",IDC_KEY_ADD,58,160,80,14 - PUSHBUTTON "³ýÈ¥·þÎñÆ÷ÃÜÔ¿(&R)",IDC_KEY_REMOVE,141,160,80,14 - LTEXT "·þÎñÆ÷ÃÜÔ¿£º",IDC_KEY_NAME,5,7,216,8 -END - -IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ìí¼Ó·þÎñÆ÷ÃÜÔ¿" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "°æ±¾£º",IDC_STATIC,7,37,26,8 - EDITTEXT IDC_KEY_VERSION,43,35,43,14,ES_AUTOHSCROLL - LTEXT "Öµ£º",IDC_STATIC,7,58,21,8 - CONTROL "¼ÓÃܸÃ×Ö·û´®£º",IDC_KEY_BYSTRING,"Button", - BS_AUTORADIOBUTTON,43,58,73,10 - CONTROL "ʹÓøÃÃÜÔ¿£º",IDC_KEY_BYDATA,"Button", - BS_AUTORADIOBUTTON,43,76,57,10 - EDITTEXT IDC_KEY_STRING,119,56,155,14,ES_PASSWORD | - ES_AUTOHSCROLL - EDITTEXT IDC_KEY_DATA,119,75,103,14,ES_AUTOHSCROLL - PUSHBUTTON "Ëæ»ú(&R)",IDC_KEY_RANDOM,226,75,48,14 - LTEXT "×¢Ò⣺ÔÚ¶Ô·þÎñÆ÷Ìí¼ÓÐÂÃÜÔ¿ºó£¬Äú±ØÐëÐÞ¸Ä AFS ÕÊ»§ÒÔʹÓÃÐÂÃÜÔ¿¡£¼¸Ììºó£¬Äú¿ÉÒÔ³ýÈ¥ÈκξɵķþÎñÆ÷ÃÜÔ¿¡£", - IDC_STATIC,7,99,267,18 - DEFPUSHBUTTON "È·¶¨",IDOK,116,129,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,170,129,50,14 - PUSHBUTTON "°ïÖú",9,224,129,50,14 - LTEXT "Ϊ·þÎñÆ÷ %1 н¨ÃÜÔ¿",IDC_KEY_TITLE,43,14,181,8 - ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 -END - -IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 277, 132 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Æô¶¯£¯Í£Ö¹·þÎñ" -FONT 9, "ËÎÌå" -BEGIN - DEFPUSHBUTTON "È·¶¨",IDOK,115,114,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,169,114,50,14 - PUSHBUTTON "°ïÖú(&H)",9,223,114,50,14 - ICON IDI_SERVICE,IDC_STATIC,4,7,21,20 - LTEXT "µ¥»÷È·¶¨Æô¶¯£¯Í£Ö¹·þÎñÆ÷ %1 µÄ·þÎñ %2¡£", - IDC_STARTSTOP_TEXT,31,12,242,9 - CONTROL "ÓÀ¾Ã(&P) (IDS_START/STOPSERVICE_PERMANENT)", - IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON,37, - 68,226,10 - CONTROL "ÁÙʱ(&T) (IDS_START/STOPSERVICE_TEMPORARY)", - IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON,37, - 83,226,10 - GROUPBOX "·þÎñÆô¶¯",IDC_STATIC,31,31,242,70 - LTEXT "Äú¿ÉÒÔÓÀ¾Ã±£³Ö¸Ã¸ü¸Ä£¬ÒÔ±ã·þÎñÆ÷ %1 ÖØÐÂÆô¶¯Ê±£¬·þÎñ %2 »á(²»»á)×Ô¶¯Æô¶¯¡£", - IDC_STARTSTOP_STARTUP,38,45,223,16 -END - -IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 248, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Ö´ÐÐÃüÁî" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,4,56,46,8 - COMBOBOX IDC_SERVER,56,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "ÃüÁî(&C)£º",IDC_STATIC,4,75,46,8 - EDITTEXT IDC_COMMAND,56,73,188,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È·¶¨",IDOK,86,107,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,140,107,50,14 - PUSHBUTTON "°ïÖú(&H)",9,194,107,50,14 - ICON IDI_SERVER,IDC_STATIC,4,4,20,20 - LTEXT "ÔÚ·þÎñÆ÷ÉÏÖ´ÐÐÃüÁî",IDC_STATIC,32,12,185,8 - LTEXT "¸Ã²Ù×÷ÔÊÐíÄúÔÚÒ»¸öÔ¶³Ì·þÎñÆ÷ÉÏ·¢³öÃüÁî¡£\n Ëü±»µäÐ͵ØÓÃÓÚÖ´ÐÐ /etc/reboot ½Å±¾À´ÖØÐÂÆô¶¯·þÎñÆ÷¡£", - IDC_STATIC,4,29,240,16 -END - -IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 248, 254 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Íì¾È¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,30,50,44,8 - COMBOBOX IDC_SERVER,78,48,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "·ÖÇø(&P)£º",IDC_STATIC,30,67,44,8 - COMBOBOX IDC_AGGREGATE,78,65,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Íì¾ÈËùÓзÖÇø(&A)",IDC_AGGREGATE_ALL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,170,67,73,10 - LTEXT "¾í(&O)£º",IDC_STATIC,29,85,44,8 - COMBOBOX IDC_FILESET,78,83,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "Íì¾ÈËùÓоí(&L)",IDC_FILESET_ALL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,170,85,73,10 - DEFPUSHBUTTON "È·¶¨",IDOK,85,108,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,139,108,50,14 - PUSHBUTTON "°ïÖú(&H)",9,194,108,50,14 - PUSHBUTTON "¸ß¼¶(&V) >>",IDC_ADVANCED,4,108,53,14 - LTEXT "ÁÙʱÎļþµÄ·¾¶(&T)£º",IDC_STATIC,10,142,76,8 - EDITTEXT IDC_SALVAGE_TEMPDIR,92,141,144,13,ES_AUTOHSCROLL - CONTROL "²¢ÐÐÍì¾È²Ù×÷£»½ø³ÌÊý(&R)£º",IDC_SALVAGE_SIMUL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,29,157,171,10 - EDITTEXT IDC_SALVAGE_NUM,202,156,25,13,ES_AUTOHSCROLL - CONTROL "²»ÒªÍì¾ÈÒÑË𻵵ľí(&N)",IDC_SALVAGE_READONLY,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,29,167,123,10 - CONTROL "½«¶ÁÈ¡²Ù×÷·Ö³ÉС¿é",IDC_SALVAGE_BLOCK,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,29,177,139,10 - CONTROL "Ç¿ÖÆÍì¾ÈËùÓÐָʾµÄ¾í(&F)",IDC_SALVAGE_FORCE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,29,187,136,10 - CONTROL "Ç¿ÖÆÖØ½¨Ä¿Â¼½á¹¹(&E)",IDC_SALVAGE_FIXDIRS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,29,197,123,10 - LTEXT "½á¹ûÈÕÖ¾µÄÎļþÃû(&U)£º",IDC_STATIC,10,211,85,8 - EDITTEXT IDC_SALVAGE_LOG_FILE,98,210,144,13,ES_AUTOHSCROLL - CONTROL "½á¹ûÈÕÖ¾ÖаüÀ¨Ë𻵵ÄÄÚ½áµãÁбí(&I)", - IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,30,224,203,10 - CONTROL "½á¹ûÈÕÖ¾ÖаüÀ¨ AFS ÓµÓеĸùÄÚ½áµãÁбí(&W)", - IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,30,235,203,10 - ICON IDI_SERVER,IDC_STATIC,4,7,20,20 - LTEXT "¸Ã²Ù×÷ÔÊÐíÄúÔÚÒ»¸ö»ò¶à¸ö¾íÉÏÐÞÕýÎÊÌâ¡£\n\n×¢Ò⣺Èç¹ûÄúÁ¢¼´Íì¾ÈÕû¸ö·ÖÇø»ò·þÎñÆ÷£¬·þÎñÆ÷»áÁÙʱÍÑ»ú¡£", - IDC_STATIC,30,7,214,32 - GROUPBOX "¸ß¼¶Íì¾ÈÑ¡Ïî",IDC_ADVANCED_GROUP,4,128,240,122 -END - -IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Íì¾È¾í - ½á¹û" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå" -BEGIN - DEFPUSHBUTTON "¹Ø±Õ(&C)",IDOK,232,160,50,14 - LTEXT "Íì¾È²Ù×÷½á¹û£º",IDC_STATIC,4,33,277,8 - EDITTEXT IDC_SALVAGE_DETAILS,4,43,277,113,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP - ICON IDI_SERVER,IDC_STATIC,4,7,21,20 - LTEXT "Íì¾È·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ¾í %3",IDC_SALVAGE_TITLE,33, - 15,248,8 -END - -IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 277, 102 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Êͷží" -FONT 9, "ËÎÌå" -BEGIN - DEFPUSHBUTTON "È·¶¨",IDOK,115,84,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,169,84,50,14 - PUSHBUTTON "°ïÖú(&H)",9,223,84,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "¸Ã²Ù×÷ÔÊÐíÄú¸üоí %3 µÄ¸±±¾¡£Äú¿ÉÒÔÑ¡Ôñ½ö¸üйýʱµÄ¸±±¾£¬»ò¸üÐÂËùÓи±±¾¡£", - IDC_RELSET_DESC,31,7,242,26 - CONTROL "½ö¸üйýʱµÄ¸±±¾(&U)",IDC_RELSET_NORMAL,"Button", - BS_AUTORADIOBUTTON,46,41,173,10 - CONTROL "¼´Ê¹ÓÐδ¹ýʱ¸±±¾£¬Ò²¸üÐÂËùÓоí(&A)",IDC_RELSET_FORCE, - "Button",BS_AUTORADIOBUTTON,46,56,172,10 -END - -IDD_SVR_HOSTS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - PUSHBUTTON "Ìí¼ÓÖ÷»ú·þÎñÆ÷(&A)",IDC_HOST_ADD,59,160,80,14 - PUSHBUTTON "³ýÈ¥Ö÷»ú·þÎñÆ÷(&R)",IDC_HOST_REMOVE,141,160,80,14 - LTEXT "·þÎñÆ÷ʶ±ðµÄÊý¾Ý¿âÖ÷»ú·þÎñÆ÷£º",IDC_HOST_TITLE,5,7,216, - 8 - CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, - 135,WS_EX_CLIENTEDGE -END - -IDD_SVR_ADDHOST DIALOGEX 0, 0, 225, 106 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "Ìí¼ÓÖ÷»ú·þÎñÆ÷" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "Ö÷»ú(&H)£º",-1,31,55,38,8 - EDITTEXT IDC_ADDHOST_HOST,71,53,103,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "È·¶¨",IDOK,63,88,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,117,88,50,14 - ICON IDI_SERVER,-1,4,4,20,20 - LTEXT "ÄúÒÑÑ¡ÔñÌí¼ÓÒ»¸öÊý¾Ý¿âÖ÷»ú·þÎñÆ÷µ½´æ´¢ÔÚ·þÎñÆ÷ %1 ÉϵÄÁбíÖС£\n\nÔÚÏÂÃæÊäÈëÐÂÊý¾Ý¿âÖ÷»úÃû¡£", - IDC_ADDHOST_DESC,31,10,190,34 - PUSHBUTTON "°ïÖú",9,171,88,50,14 -END - -IDD_SVR_ADDRESS DIALOGEX 0, 0, 208, 115 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "¸ü¸Ä·þÎñÆ÷µØÖ·" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - LTEXT "Ϊ·þÎñÆ÷ %1 ¼Ç¼ÔÚ VLDB ÖÐµÄ IP µØÖ·£º",IDC_TITLE,4,4, - 200,8 - LISTBOX IDC_SVR_ADDRESSES,4,14,147,40,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "¸ü¸Ä(&C)...",IDC_ADDR_CHANGE,154,24,50,14 - PUSHBUTTON "³ýÈ¥(&R)",IDC_ADDR_REMOVE,154,40,50,14 - DEFPUSHBUTTON "È·¶¨",IDOK,46,97,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,100,97,50,14 - PUSHBUTTON "°ïÖú",9,154,97,50,14 - LTEXT "×¢£ºµ±Îļþ·þÎñÆ÷Æô¶¯Ê±£¬ËüÓà VLDB ×Ô¶¯×¢²áÆäµ±Ç°µÄ IP µØÖ·¡£", - IDC_STATIC,4,64,200,18 -END - -IDD_SVR_NEWADDR DIALOGEX 0, 0, 223, 69 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "¸ü¸Ä IP µØÖ·" -CLASS "AFSManagerClass" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "È·¶¨",IDOK,61,51,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,115,51,50,14 - PUSHBUTTON "°ïÖú",9,169,51,50,14 - LTEXT "ÊäÈëÐ嵀 IP µØÖ·ÒÔÌæ»» VLDB ÖÐµÄ %1£º",IDC_TITLE,4,4, - 215,8 - CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,42,23, - 90,14 - LTEXT "µØÖ·£º",IDC_STATIC,4,26,28,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" -32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" -32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" -IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" -IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" -IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" -IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" -IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" -IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" -IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" -IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" -IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" -IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" -IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" -IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" -IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" -IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" -IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -ACCEL_MAIN ACCELERATORS DISCARDABLE -BEGIN - VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT - VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT - VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT - VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT - VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT - VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT - VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT - VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, - NOINVERT - VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVR_LISTS_TITLE "·þÎñÆ÷ %1 - ¹ÜÀíÔ±Áбí" - IDS_TAB_SERVICES "·þÎñ" - IDS_TAB_AGGREGATES "·ÖÇø" - IDS_TAB_FILESETS "¾í" - IDS_SERVICE_NONESELECTED "Ñ¡ÔñÒª²é¿´µÄ·þÎñÆ÷¡£" - IDS_SERVICE_GOTSELECTED "ÔÚ·þÎñÆ÷ %1 ÉϽøÐеķþÎñ£º" - IDS_AGGREGATE_ALL "ËùÓзþÎñÆ÷ÉϵķÖÇø£º" - IDS_AGGREGATE_ONE "·þÎñÆ÷ %1 ÉϵķÖÇø£º" - IDS_FILESET_ALL "µ¥Ôª %1 ÖеÄËùÓÐ¾í£º" - IDS_FILESET_ONE "·þÎñÆ÷ %1 ÉϵÄËùÓÐ¾í£º" - IDS_SVR_LISTS_TAB "¹ÜÀíÔ±Áбí" - IDS_SVR_PROP_TITLE "·þÎñÆ÷ %1 - ÌØÐÔ" - IDS_SVR_GENERAL_TAB "Ò»°ã" - IDS_SVR_SCOUT_TAB "ÉèÖÃ" - IDS_SERVER_TITLE "·þÎñÆ÷ %1 - AFS ·þÎñÆ÷¹ÜÀíÆ÷" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_DESC "µ¥Ôª %2 ÖеķþÎñÆ÷ %1£º" - IDS_SVC_PROP_TITLE "·þÎñÆ÷ %1 ÉϵķþÎñ %2 - ÌØÐÔ" - IDS_SVC_GENERAL_TAB "Ò»°ã" - IDS_SVC_ADD_TITLE "´´½¨·þÎñ" - IDS_SVC_ADD_TAB "´´½¨·þÎñ" - IDS_AGG_PROP_TITLE "·þÎñÆ÷ %1 ÉϵķÖÇø %2 - ÌØÐÔ" - IDS_AGG_GENERAL_TAB "Ò»°ã" - IDS_SET_REP_TITLE "¾í %1 - ¸´ÖÆ" - IDS_SET_REPSITES_TAB "¸´ÖÆÕ¾µã" - IDS_SET_PROP_TITLE "¾í %1 - ÌØÐÔ" - IDS_SET_GENERAL_TAB "Ò»°ã" - IDS_SET_UNLOCKBTN "ÏÖÔÚ½âËø(&L)" - IDS_SET_LOCKBTN "ÏÖÔÚËø¶¨(&L)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_USAGE_FILESET "ʹÓÃÁË %1£¬ÏÞ¶îΪ %2 (%3%%)" - IDS_USAGE_AGGREGATE "ʹÓÃÁË %1£¬ÈÝÁ¿Îª %2 (%3%%)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGCOL_ALLOCATED "×éºÏµÄÏÞ¶î" - IDS_SVRCOL_NAME "·þÎñÆ÷" - IDS_SVRCOL_STATUS "״̬" - IDS_SETCOL_DATE_ACCESS "×î½üÒ»´Î´æÈ¡" - IDS_SETCOL_DATE_BACKUP "×î½üÒ»´Î±¸·Ý" - IDS_SVCCOL_NAME "·þÎñ" - IDS_SVCCOL_TYPE "ÀàÐÍ" - IDS_SVCCOL_PARAMS "²ÎÊý" - IDS_SVCCOL_STATUS "״̬" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_DATE_START "×î½üÒ»´ÎÆô¶¯" - IDS_SVCCOL_DATE_STOP "×î½üÒ»´ÎÍ£Ö¹" - IDS_SVCCOL_DATE_STARTSTOP "×î½üÒ»´ÎÆô¶¯£¯Í£Ö¹" - IDS_SVCCOL_DATE_FAILED "×î½üÒ»´Îʧ°Ü" - IDS_SVCCOL_LASTERROR "×î½üÒ»´ÎµÄÍ˳öÂë" - IDS_AGGCOL_NAME "·ÖÇø" - IDS_AGGCOL_ID "±êʶ·û" - IDS_AGGCOL_DEVICE "É豸" - IDS_AGGCOL_USED "ÒÑʹÓÃ" - IDS_AGGCOL_USED_PER "ÒÑʹÓà %" - IDS_AGGCOL_FREE "×ÔÓÉ" - IDS_AGGCOL_TOTAL "ÈÝÁ¿" - IDS_AGGCOL_STATUS "״̬" - IDS_SETCOL_NAME "¾í" - IDS_SETCOL_TYPE "ÀàÐÍ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETCOL_DATE_CREATE "ÒÑ´´½¨" - IDS_SETCOL_DATE_UPDATE "×î½üÒ»´Î¸üÐÂ" - IDS_SETCOL_STATUS "״̬" - IDS_SETCOL_QUOTA_USED "ÒÑʹÓÃ" - IDS_SETCOL_QUOTA_USED_PER "ÒÑʹÓà %" - IDS_SETCOL_QUOTA_FREE "×ÔÓÉ" - IDS_SETCOL_QUOTA_TOTAL "ÏÞ¶î" - IDS_TRYAGAINBTN "ÔÙÊÔÒ»´Î(&A)" - IDS_NO_CELL_SELECTED "(δָ¶¨µ¥Ôª)" - IDS_NO_AFS_ID "(ÎÞÁîÅÆ¿ÉÓÃ)" - IDS_AFS_ID_WILLEXP "%1(ÁîÅÆ½«ÔÚ %2 µ½ÆÚ)" - IDS_ELAPSED_TIME "%1" - IDS_SEARCHING_FOR_SERVERS "ÇëµÈ´ý£»ÕýÔÚ»ñÈ¡¹ØÓÚµ¥Ôª %1 µÄÐÅÏ¢..." - IDS_STATUS_NOALERTS "Õý³£" - IDS_TITLE_BROWSE_USER "Ñ¡ÔñÓû§" - IDS_AGGTYPE_OTHER "δ֪ (%1)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATEFILESET "ÔÚ·ÖÇø %1:%2 ÉÏ´´½¨¾í %3" - IDS_ACTION_DELETEFILESET "´Ó·ÖÇø %1:%2 ÉÏɾ³ý¾í %3" - IDS_ACTION_MOVEFILESET "ÒÆ¶¯¾í %3 µ½·ÖÇø %1:%2" - IDS_ACTION_SETFILESETQUOTA "Ϊ¾í %3 ¸ü¸ÄÏÞ¶î" - IDS_SVCSTOP_DESC2 "µ¥»÷È·¶¨Í£Ö¹¸Ã·þÎñ¡£" - IDS_SVCSTART_DESC2 "µ¥»÷È·¶¨Æô¶¯¸Ã·þÎñ¡£" - IDS_SYNCVLDB_SVR_DESC "×¢Ò⣡\n\nÈç¹ûÄú¼ÌÐø£¬AFS ·þÎñÆ÷¹ÜÀíÆ÷½«ÐÞ¸Ä VLDB ÒÔÆ¥Åä·þÎñÆ÷ %1 ÉÏËùÓзÖÇøµÄÄÚÈÝ¡£" - IDS_SYNCVLDB_SVR_DESC2 "Èç¹û VLDB Ìá¼°Ò»¸ö¾í£¬µ«¸Ã¾íÏÖÔÚÎÞ·¨ÔÚ·þÎñÆ÷ %1 µÄÈκηÖÇøÉÏÕÒµ½£¬½«É¾³ý¸Ã¾íµÄ VLDB ÌõÄ¿£¡" - IDS_SYNCVLDB_AGG_DESC "×¢Ò⣡\n\nÈç¹ûÄú¼ÌÐø£¬AFS ·þÎñÆ÷¹ÜÀíÆ÷½«ÐÞ¸Ä VLDB ÒÔÆ¥Åä·þÎñÆ÷ %1 ÉÏ·ÖÇø %2 µÄÄÚÈÝ¡£" - IDS_SYNCVLDB_AGG_DESC2 "Èç¹û VLDB Ìá¼°Ò»¸ö¾í£¬µ«¸Ã¾íÏÖÔÚÎÞ·¨Ôڸ÷ÖÇøÉÏÕÒµ½£¬½«É¾³ý¸Ã¾íµÄ VLDB ÌõÄ¿£¡" - IDS_PROMPT_BROWSE_USER "Óû§£º" - IDS_PREVIEWIN_BUTTON "<< Ô¤ÀÀ(&P)" - IDS_PREVIEWOUT_BUTTON "Ô¤ÀÀ(&P) >>" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ADMCOL_TYPE_USER "Óû§" - IDS_TITLE_BROWSE_PRINCIPAL "Ñ¡ÔñίÍÐÈË" - IDS_TITLE_BROWSE_OWNGROUP "Ñ¡ÔñÓµÓÐ×é" - IDS_PROMPT_BROWSE_PRINCIPAL "ίÍÐÈË£º" - IDS_PROMPT_BROWSE_OWNGROUP "ÓµÓÐ×飺" - IDS_ACTION_CLONE "´´½¨¾í %3 µÄ±¸·Ý°æ±¾" - IDS_ACTION_CLONESYS "´´½¨¶à¸ö¾í±¸·Ý" - IDS_CLONESYS_FAILED "¾í %1 µÄ±¸·ÝÎÞ·¨´´½¨£¬Ô­ÒòÊÇ´íÎó 0x%2 (%3)¡£" - IDS_SET_UNSPECIFIED "(δָ¶¨µÄ)" - IDS_SETCOL_ID "±êʶ·û" - IDS_SETCOL_FILES "Îļþ¼ÆÊý" - IDS_SET_DUMP_NAME "%1.DMP µÄת´¢" - IDS_ACTION_DUMP "ת´¢¾í %3(·ÖÇø %1:%2)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FILESETNAME_ERROR "%1 - %2" - IDS_SETCOL_AGGREGATE "·ÖÇø" - IDS_REFRESH_DESC_CELL "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÕýÔÚÈ·¶¨µ¥Ôª %1 ÖзþÎñÆ÷µÄ״̬¡£Õâ¿ÉÄÜÐèÒª¼¸·ÖÖÓ..." - IDS_REFRESH_DESC_SERVER "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÕýÔÚÈ·¶¨·þÎñÆ÷ %1 µÄ״̬¡£Õâ¿ÉÄÜÐèÒª¼¸·ÖÖÓ..." - IDS_REFRESH_CURRENT_CELL "ÕýÔÚ¼ì²é£ºµ¥Ôª %1" - IDS_REFRESH_CURRENT_SERVER "ÕýÔÚ¼ì²é£º·þÎñÆ÷ %2" - IDS_REFRESH_CURRENT_AGGREGATE "ÕýÔÚ¼ì²é£º·þÎñÆ÷ %2 µÄ·ÖÇø %3" - IDS_REFRESH_CURRENT_FILESET "ÕýÔÚ¼ì²é£º·þÎñÆ÷ %2£¬·ÖÇø %3 µÄ¾í %4" - IDS_REFRESH_CURRENT_SERVICE "ÕýÔÚ¼ì²é£º·þÎñÆ÷ %2 ÉϵķþÎñ %3" - IDS_REFRESH_PERCENT "%1%% Íê³É" - IDS_PROBLEMS "ÎÊÌâ" - IDS_SERVER_NO_PROBLEMS "¸Ã·þÎñÆ÷ÎÞÒÑÖªÎÊÌâ¡£" - IDS_SERVICE_NO_PROBLEMS "¸Ã·þÎñÎÞÒÑÖªÎÊÌâ¡£" - IDS_AGGREGATE_NO_PROBLEMS "¸Ã·ÖÇøÎÞÒÑÖªÎÊÌâ¡£" - IDS_FILESET_NO_PROBLEMS "¸Ã¾íÎÞÒÑÖªÎÊÌâ¡£" - IDS_AGGTYPE_TYPE1 "UFS" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGTYPE_TYPE2 "LFS" - IDS_AGGTYPE_TYPE3 "AIX" - IDS_AGGTYPE_TYPE4 "VXFS" - IDS_AGGTYPE_TYPE5 "DMEPI" - IDS_REFRESH_CURRENT_VLDB "ÕýÔÚ¼ì²é£º¾íλÖÃÊý¾Ý¿â (VLDB)" - IDS_FILESETTYPE_RW "¶ÁÈ¡£¯Ð´Èë" - IDS_FILESETTYPE_RO "¸±±¾" - IDS_FILESETTYPE_CLONE "±¸·Ý" - IDS_MOVESET_READWRITE "¼ÌÐø½«µ¼Ö¾í %3 ´Ó·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏÒÆ¶¯µ½ÁíÒ»¸öλÖá£" - IDS_MOVESET_READONLY "¼ÌÐø½«µ¼ÖÂ¾í¸±±¾ %3 ´Ó·þÎñÆ÷ %1 µÄ·ÖÇø %2 Éϱ»É¾³ý£¬²¢ÔÚÄúÔÚÏÂÃæÖ¸¶¨µÄ·ÖÇøÉÏ´´½¨ÁíÒ»¸ö¾í¸±±¾¡£" - IDS_SVC_START_TITLE "Æô¶¯·þÎñ" - IDS_SVC_STOP_TITLE "Í£Ö¹·þÎñ" - IDS_SERVICESTATUS_STARTING "¸Ã·þÎñµ±Ç°ÕýÔÚÆô¶¯¡£" - IDS_SERVICESTATUS_RUNNING "¸Ã·þÎñµ±Ç°ÕýÔÚÔËÐС£" - IDS_SERVICESTATUS_STOPPED "¸Ã·þÎñµ±Ç°Í£Ö¹¡£" - IDS_SERVICESTATUS_STOPPING "¸Ã·þÎñµ±Ç°ÕýÔÚÍ£Ö¹¡£" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICESTATUS_UNKNOWN "¸Ã·þÎñ״̬δ֪¡£" - IDS_SVC_RESTART_BUTTON "ÏÖÔÚÍ£Ö¹²¢ÖØÐÂÆô¶¯(&R)" - IDS_PROBLEM_BOX "ÒÑÖªÎÊÌâ (%1)" - IDS_VIEWLOG_DESC_NOFILE "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÕÒµ½·þÎñÆ÷ %1 ÉϵķþÎñ %2 µÄÈÕÖ¾Îļþ¡£ÇëÔÚÏÂÃæÊäÈë·þÎñÈÕÖ¾ÎļþµÄ¾ø¶Ô·¾¶¡£" - IDS_NO_GROUP "(ÎÞÓµÓÐ×é)" - IDS_VIEWLOG_FROMSERVER "·þÎñÆ÷ %1 ÉϵÄÈÕÖ¾Îļþ" - IDS_VIEWLOG_FROMSERVICE "·þÎñÆ÷ %1 ÉÏ·þÎñ %2 µÄÈÕÖ¾Îļþ" - IDS_VIEWLOG_TRUNCATED "ÎļþĿ¼(½öÏÔʾ×îºó %1 ÐÐ)£º" - IDS_SAVELOG_FILTER "Îı¾Îļþ|*.TXT|" - IDS_ADVANCEDIN_BUTTON "<< ¸ß¼¶(&A)" - IDS_ADVANCEDOUT_BUTTON "¸ß¼¶(&A) >>" - IDS_REPTYPE_RELEASE "ÊͷŸ´ÖÆ" - IDS_REPTYPE_SCHEDULED "¶¨ÆÚ¸´ÖÆ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_UPDATEALL_BUTTON "¸üÐÂËùÓÐ(&U)" - IDS_UPDATETHIS_BUTTON "¸üÐÂ(&U)" - IDS_SERVER_MULTIPLE_PROBLEMS "¸Ã·þÎñÆ÷ÓÐ %1 ¸öÒÑÖªÎÊÌâ¡£" - IDS_SERVICE_MULTIPLE_PROBLEMS "¸Ã·þÎñÓÐ %1 ¸öÒÑÖªÎÊÌâ¡£" - IDS_AGGREGATE_MULTIPLE_PROBLEMS "¸Ã·ÖÇøÓÐ %1 ¸öÒÑÖªÎÊÌâ¡£" - IDS_FILESET_MULTIPLE_PROBLEMS "¸Ã¾íÓÐ %1 ¸öÒÑÖªÎÊÌâ¡£" - IDS_FILESETTYPE_RO_STAGE "¸±±¾" - IDS_SERVICETYPE_SIMPLE_LONG "¼òµ¥£¨²»¼ä¶ÏÔËÐУ©" - IDS_SERVICETYPE_CRON_LONG "Cron £¨ÔÚÖ¸¶¨¼ä¸ôÔËÐУ©" - IDS_QUOTAUNITS_KB "KB" - IDS_QUOTAUNITS_MB "MB" - IDS_NO_QUOTA_REPLICA "(¸Ã¾íÊǸ±±¾£¬Òò¶øÎÞÏÞ¶î)" - IDS_NO_QUOTA_CLONE "(¸Ã¾íÊDZ¸·Ý£¬Òò¶øÎÞÏÞ¶î)" - IDS_USAGE_REPLICA "ÒÑʹÓà %1" - IDS_USAGE_CLONE "ÒÑʹÓà %1" - IDS_COL_AGGS_MOVE "µ±´´½¨¾íʱµÄ·ÖÇø" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_SERVICE "%1:%2" - IDS_SERVICETYPE_SIMPLE "¼òµ¥" - IDS_SERVICETYPE_CRON "Cron" - IDS_SERVICESTATE_STOPPED "ÒÑÍ£Ö¹" - IDS_SERVICESTATE_STOPPING "ÕýÔÚÍ£Ö¹" - IDS_SERVICESTATE_STARTING "ÕýÔÚÆô¶¯" - IDS_SERVICESTATE_RUNNING "ÕýÔÚÔËÐÐ" - IDS_SERVICETYPE_FS_LONG "FS (Îļþϵͳ)" - IDS_SERVICETYPE_FS "FS" - IDS_SERVICE_LASTERROR "%1" - IDS_SERVICES_IN_CELL "µ¥Ôª %1 ÖÐËùÓзþÎñ£º" - IDS_SERVICE_STARTDATE "ÒÑÆô¶¯ %1" - IDS_SERVICE_STOPDATE "ÒÑÍ£Ö¹ %1" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_PERCENTAGE "%1 %%" - IDS_AGGREGATES_IN_SERVER "·þÎñÆ÷ %1 ÉϵķÖÇø£º" - IDS_AGGREGATES_IN_CELL "µ¥Ôª %1 ÖÐËùÓзÖÇø£º" - IDS_AGGREGATES_IN_NOTHING "·ÖÇø£º" - IDS_FILESETS_IN_SERVER "·þÎñÆ÷ %1 ÉϵÄËùÓÐ¾í£º" - IDS_FILESETS_IN_CELL "µ¥Ôª %1 ÖеÄËùÓÐ¾í£º" - IDS_FILESETS_IN_NOTHING "¾í£º" - IDS_SERVICES_IN_SERVER "·þÎñÆ÷ %1 ÉÏËùÓзþÎñ£º" - IDS_SERVICES_IN_NOTHING "·þÎñ£º" - IDS_UNKNOWN "(δ֪)" - IDS_UNKNOWN_GROUP "×é #%1 (Ãû³ÆÎ´Öª)" - IDS_AGGFULL_WARN_OFF "ȱʡãÐÖµ(·þÎñÆ÷ÉϽûÓþ¯¸æ)" - IDS_SERVER_AGGREGATE "%1:%2" - IDS_SERVERNAME_ERROR "%1 - %2" - IDS_AGGREGATENAME_ERROR "%1 - %2" - IDS_SETFULL_WARN_OFF "ȱʡãÐÖµ(·þÎñÆ÷ÉϽûÓþ¯¸æ)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_LASTERRORDATE "%1 - Í˳öÂë %2" - IDS_COL_SERVERS "µ¥ÔªÖеķþÎñÆ÷" - IDS_COL_FILESETS "·þÎñÆ÷Éϵľí" - IDS_COL_AGGREGATES "·þÎñÆ÷ÉϵķÖÇø" - IDS_COL_SERVICES "·þÎñÆ÷ÉϵķþÎñ" - IDS_COL_REPLICAS "¾í¸±±¾" - IDS_COLUMNS_TITLE "Ñ¡ÔñÏÔʾÁÐ - AFS ·þÎñÆ÷¹ÜÀíÆ÷" - IDS_REPCOL_SERVER "·þÎñÆ÷" - IDS_REPCOL_AGGREGATE "·ÖÇø" - IDS_REPCOL_DATE_UPDATE "×î½ü¸üÐÂ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COL_AGGS_CREATE "ÒÆ¶¯¾íʱµÄ·ÖÇø" - IDS_WARN_TITLE "×¢Òâ" - IDS_WARN_DISABLE_AUTH "ͨ¹ýµ¥»÷""ÔÊÐí²»ÑéÖ¤""°´Å¥£¬Äú¿ÉÔÊÐíδ¾­ÑéÖ¤µÄίÍÐÈËÀ´²Ù×÷¸Ã·þÎñÆ÷ÉϵķþÎñ¡£ÓÉÓÚÐí¶à·þÎñÒÔ root Éí·ÝÔËÐУ¬¸Ã²Ù×÷´ú±í +" - IDS_WARN_DISABLE_AUTH2 "·þÎñÆ÷°²È«ÐÔµÄÒ»¸öÑÏÖØÈ±ÏÝ¡£\n\nÄúÈ·ÈÏÒª¸ü¸ÄÂð?" - IDS_SVR_NO_ADDR "(δָ¶¨µÄ)" - IDS_TITLE_BAD_CELL "ÎÞ·¨Ê¶±ðµÄµ¥ÔªÃû" - IDS_DESC_BAD_CELL "ÍøÂçÉÏÕÒ²»µ½ÄúÊäÈëµÄµ¥ÔªÃû¡£\n\n ÇëÔٴμì²éÄúµÄÌõÄ¿£¬ÒÔÈ·ÈÏÊÇÕýÈ·µÄ¡£" - IDS_AGGFULL_WARN_ON "¸Ã·þÎñÆ÷µÄȱʡãÐÖµ(&D) (Æä´óСµÄ %1%%)" - IDS_SETFULL_WARN_ON "¸Ã·þÎñÆ÷µÄȱʡãÐÖµ(&D) (Æä´óСµÄ %1%%)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS - "ÎÞ·¨Ê¶±ðÄúÊäÈëµÄ AFS Éí·Ý£¬»òÄúÖ¸¶¨µÄ¿ÚÁî²»ÕýÈ·¡£" - IDS_CREDS_NONE "(ûÓÐÁîÅÆ)" - IDS_CREDS_VALID "%2£¬ÔÚ %3 µ½ÆÚ" - IDS_CREDS_EXPIRED "(ÁîÅÆÒÑÔÚ %3 µ½ÆÚ)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGG_FILESETS "%1 (×éºÏµÄÏ޶%2)" - IDS_ACTION_DESC_NONE "ûÓÐÕýÔÚ½øÐеIJÙ×÷¡£" - IDS_ACTION_DESC_ONE "´Ë²Ù×÷ÕýÔÚ½øÐУº" - IDS_ACTION_DESC_MULT "ÏÂÁвÙ×÷ÕýÔÚ½øÐУº" - IDS_ACTCOL_OPERATION "²Ù×÷" - IDS_ACTCOL_ELAPSED "Òѹýʱ¼ä" - IDS_ACTION_REFRESH "ÕýÔÚˢе¥ÔªÐÅÏ¢" - IDS_ACTION_CREATESERVER "ÕýÔÚ´´½¨·þÎñÆ÷ %1" - IDS_ACTION_DELETESERVER "ÕýÔÚɾ³ý·þÎñÆ÷ %1" - IDS_ACTION_GETSERVERLOGFILE "ÕýÔÚ´Ó·þÎñÆ÷ %1 »ñÈ¡ÈÕÖ¾Îļþ %2" - IDS_ACTION_SETSERVERAUTH "ÕýÔÚΪ·þÎñÆ÷ %1 ¸ü¸Ä´æÈ¡ÏÞÖÆ" - IDS_ACTION_CHANGESERVERSTATUS "ÕýÔÚ¸ü¸Ä·þÎñÆ÷ %1 µÄÌØÐÔ" - IDS_ACTION_STARTSERVICE "ÕýÔÚÆô¶¯·þÎñÆ÷ %1 µÄ·þÎñ %2" - IDS_ACTION_STOPSERVICE "ÕýÔÚÍ£Ö¹·þÎñÆ÷ %1 µÄ·þÎñ %2" - IDS_ACTION_RESTARTSERVICE "ÕýÔÚÖØÐÂÆô¶¯·þÎñÆ÷ %1 µÄ·þÎñ %2" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SYNCVLDB_SVR "ÕýÔÚʹ VLDB Óë·þÎñÆ÷ %1 ͬ²½" - IDS_ACTION_SYNCVLDB_AGG "ÕýÔÚʹ VLDB Óë·ÖÇø %1:%2 ͬ²½" - IDS_ACTION_SCOUT "ÕýÔÚ¼ì²é·þÎñÆ÷ %1 µÄÎÊÌâ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SETREPPARAMS "ÕýÔÚ¸ü¸Ä¾í %3 µÄ¸´ÖÆÌØÐÔ" - IDS_ACTION_CREATEREPLICA "ÕýÔÚ·ÖÇø %1:%2 ÉÏ´´½¨¾í %3 µÄ¸±±¾" - IDS_DELSET_REPLICA_DESC "×¢Ò⣡\n\n¼ÌÐø½«É¾³ý·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ¾í %3 µÄ¸±±¾¡£" - IDS_DELSET_CLONE_DESC "×¢Ò⣡\n\n¼ÌÐø½«É¾³ý·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ¾í±¸·Ý %3 ¡£" - IDS_INSTALL_DESC1 "¸Ã²Ù×÷¸´ÖÆÎļþµ½Áíһ̨¼ÆËã»ú¡£+" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_INSTALL_DESC2 "Èç¹ûÎļþÒÑ´æÔÚÓÚÄ¿±ê¼ÆËã»ú£¬»á½«Ëü×ö±¸·Ý²¢ÒÔ .BAK ×÷ΪÀ©Õ¹Ãû£»ÈκÎÏÖÓеı¸·ÝÎļþÀ©Õ¹Ãû»áת»»Îª .OLD£¬ÈκÎÏÖÓеÄÀ©Õ¹ÃûΪ .OLD µÄÎļþ½«±»É¾³ý¡£" - IDS_ACTION_INSTALLFILE "ÕýÔÚ·þÎñÆ÷ %1 Éϰ²×°Îļþ %2" - IDS_ACTION_UNINSTALLFILE "ÕýÔÚ´Ó·þÎñÆ÷ %1 ÉÏжװÎļþ %2" - IDS_ACTION_PRUNEFILES "ÕýÔÚ´Ó·þÎñÆ÷ %1 ÉÏɾ³ýÎļþ" - IDS_FILTER_ALLFILES "ËùÓÐÎļþ|*.*|" - IDS_ACTION_RENAMEFILESET "ÕýÔÚÖØÃüÃû¾í %1 Ϊ %2" - IDS_RECUR_DAILY "ÿÌì" - IDS_RECUR_SUNDAY "ÿÖÜÈÕ" - IDS_RECUR_MONDAY "ÿÖÜÒ»" - IDS_RECUR_TUESDAY "ÿÖܶþ" - IDS_RECUR_WEDNESDAY "ÿÖÜÈý" - IDS_RECUR_THURSDAY "ÿÖÜËÄ" - IDS_RECUR_FRIDAY "ÿÖÜÎå" - IDS_RECUR_SATURDAY "ÿÖÜÁù" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATESERVICE "ÕýÔÚ·þÎñÆ÷ %1 ÉÏ´´½¨·þÎñ %2" - IDS_ACTION_DELETESERVICE "ÕýÔÚ´Ó·þÎñÆ÷ %1 ÉÏɾ³ýÎļþ %2" - IDS_ACTION_RELEASEFILESET "ÕýÔÚÊͷží %3" - IDS_ACTION_GETDATES "ÕýÔÚ»ñÈ¡·þÎñÆ÷ %1 ÉϵÄÎļþ %2 µÄÈÕÆÚ" - IDS_LASTMODIFIED "×î½üÒ»´ÎÐÞ¸Ä %1" - IDS_SVR_SECURITY_TITLE "·þÎñÆ÷°²È«ÐÔ - %1" - IDS_SVR_LIST_TAB "¹ÜÀíÔ±" - IDS_ACTION_ADMINLIST_LOAD "ÕýÔÚ»ñÈ¡·þÎñÆ÷ %1 µÄ¹ÜÀíÔ±" - IDS_ACTION_ADMINLIST_SAVE "ÕýÔÚдÈë·þÎñÆ÷ %1 µÄ¹ÜÀíÔ±" - IDS_ADMCOL_PRINCIPAL "³ÉÔ±" - IDS_ADMCOL_TYPE "ÀàÐÍ" - IDS_ADMCOL_TYPE_GROUP "×é" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_RESTORE "ÕýÔÚ»Ö¸´¾í %1" - IDS_COL_AGGS_RESTORE "»Ö¸´¾íʱµÄ·ÖÇø" - IDS_RESTORE_FILTER "¾íת´¢Îļþ |*.DMP|ËùÓÐÎļþ|*.*|" - IDS_SVC_BOS_TAB "BOS" - IDS_ACTION_SETRESTART "ÕýÔÚ¸ü¸Ä·þÎñÆ÷ %1 µÄ·þÎñÖØÐÂÆô¶¯Ê±¼ä" - IDS_RESTORE_CREATESET "¾í %1 ½«´´½¨ÔÚÄúÔÚÏÂÃæÖ¸¶¨µÄ·þÎñÆ÷µÄ·ÖÇøÉÏ¡£" - IDS_RESTORE_OVERWRITESET - "×¢Ò⣡¾í %3 ´æÔÚÓÚ·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏ£¬Èç¹ûÄú¼ÌÐø£¬½«¸²¸ÇËü£¡" - IDS_SUBSET_TITLE_LOAD "´ò¿ª·þÎñÆ÷×Ó¼¯" - IDS_SUBSET_TITLE_SAVE "±£´æ·þÎñÆ÷×Ó¼¯" - IDS_BUTTON_OPEN "´ò¿ª(&O)" - IDS_BUTTON_SAVE "±£´æ(&S)" - IDS_SUBSET_SAVE_TITLE "×¢Òâ" - IDS_SUBSET_SAVE_DESC "ÃûΪ %1 µÄ·þÎñÆ÷×Ó¼¯ÒÑ´æÔÚ¡£\n\nÄúÏ븲¸Ç¸Ã×Ó¼¯Âð£¿" - IDS_SUBSET_CHANGED "%1 [ÒÑÐ޸ĵÄ]" - IDS_SUBSET_TAB "±»¼àÊӵķþÎñÆ÷" - IDS_SUBSET_DISCARD_TITLE "±£´æ×Ó¼¯£¿" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SUBSET_DISCARD_DESC "Äú»¹Î´½«µ±Ç°¼àÊӵķþÎñÆ÷ÁÐ±í±£´æÎª×Ó¼¯¡£Èç¹û±£´æ¸ÃÁÐ±í£¬ÒÔºóÄú¿ÉÒÔ¼ÌÐø¼àÊÓÕâЩ·þÎñÆ÷¡£\n\n+" - IDS_SUBSET_DISCARD_DESC2 - "ÄúÊÇ·ñÒª´´½¨Ò»¸ö×Ó¼¯À´°üº¬µ±Ç°¼àÊӵķþÎñÆ÷µÄÁÐ±í£¿" - IDS_SUBSET_NONAME "(δÃüÃûµÄ)" - IDS_SUBSET_NOSUBSET "(ËùÓзþÎñÆ÷Õý±»¼àÊÓ)" - IDS_SUBSET_SERVERSUBSET "·þÎñÆ÷ %1" - IDS_FILESET_SOME "µ¥Ôª %1 ÖÐËùÓб»¼àÊÓ·þÎñÆ÷µÄ¾í£º" - IDS_AGGREGATE_SOME "µ¥Ôª %1 ÖÐËùÓб»¼àÊÓ·þÎñÆ÷µÄ·ÖÇø£º" - IDS_SERVICE_SOME "µ¥Ôª %1 ÖÐËùÓб»¼àÊÓ·þÎñÆ÷µÄ·þÎñ£º" - IDS_FILESET_UNMON "·þÎñÆ÷ %1 δ±»¼àÊÓ" - IDS_AGGREGATE_UNMON "·þÎñÆ÷ %1 δ±»¼àÊÓ" - IDS_SERVICE_UNMON "·þÎñÆ÷ %1 δ±»¼àÊÓ" - IDS_SUBSET_DELETE_TITLE "ɾ³ý×Ó¼¯£¿" - IDS_SUBSET_DELETE_DESC "ÄúÈ·¶¨ÒªÉ¾³ý·þÎñÆ÷×Ó¼¯ %1£¿" - IDS_ERROR_TRANSLATED "´íÎóºÅ 0x%1 (%2):\n\n%3" - IDS_ERROR_NOTTRANSLATED "ÎÞ·¨±æÈÏ´íÎóºÅ 0x%1 (%2)¡£" - IDS_FIND_NOTHING_TITLE "δѡÔñÃüÁî" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FIND_NOTHING_DESC "Òª²éÕÒÈçºÎÖ´ÐÐÒ»¸ö²Ù×÷£¬Ê×ÏÈ´ÓÁбíÑ¡ÔñÒ»¸öÃüÁîÐлòÊäÈëÒ»¸ö¹Ø¼ü×Ö¡£" - IDS_FIND_UNKNOWN_TITLE "δ֪ÃüÁî" - IDS_FIND_UNKNOWN_DESC "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÕÒµ½ÃüÁî""%1"" µÄÈκΰïÖúÖ÷Ìâ¡£" - IDS_HELPABOUT_DESC1 "¾¯¸æ£º¸Ã¼ÆËã»ú³ÌÐòÊܵ½°æÈ¨¼°¹ú¼ÊÌõÔ¼µÄ±£»¤¡£+" - IDS_HELPABOUT_DESC2 "δ¾­ÊÚȨ¸´ÖÆ»ò·Ö·¢¸ÃÈí¼þ»áÊܵ½ÑÏÀ÷µÄÃñÊ»òÐÌÊ´¦·££¬²¢½«Êܵ½·¨ÂÉÑϳ͡£\n\n+" - IDS_HELPABOUT_DESC3 "AFS ÊÇ Transarc ¹«Ë¾(IBM ¹«Ë¾)µÄÉ̱ꡣ" - IDS_CANT_QUIT_TITLE "AFS ·þÎñÆ÷¹ÜÀíÆ÷" - IDS_CANT_QUIT_REBOOT "×¢Ò⣡\n\n AFS ·þÎñÆ÷¹ÜÀíÆ÷ÕýÔÚÖ´ÐÐÒ»¸ö»ò¸ü¶à²Ù×÷¡£Èç¹ûÄúÏÖÔÚ¹Ø±Õ Windows£¬½«ÎÞ·¨³É¹¦Íê³ÉÄÇЩ²Ù×÷¡£\n\n ÄúÈ·¶¨ÒªÖØÐÂÆô¶¯ Windows Âð£¿" - IDS_APP_TITLE "AFS ·þÎñÆ÷¹ÜÀíÆ÷" - IDS_ACTION_OPENCELL "ÔÚµ¥Ôª %1 ÖвéÕÒ·þÎñÆ÷" - IDS_OPTIONS_TITLE "Ñ¡Ïî - AFS ·þÎñÆ÷¹ÜÀíÆ÷" - IDS_OPTIONS_GENERAL_TAB "Ò»°ã" - IDS_BADCREDS_DESC "³ý·Ç×÷Ϊ¹ÜÀíÔ±µÇ¼£¬·ñÔòÄú¿ÉÄÜ»áûÓгä×ãµÄÌØÈ¨³É¹¦¹ÜÀí %1 µ¥Ôª¡£Ã»Óгä×ãµÄ´æÈ¡ÌØÈ¨¿ÉÄܻᵼÖÂÕý³£Çé¿öÏ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ò²»áÔÚµ¥ÔªÖÐÕÒµ½ÎÊÌâ¡£" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CONFIRMATION_TITLE "È·ÈÏ - AFS ·þÎñÆ÷¹ÜÀíÆ÷" - IDS_NO_GROUP_CHECKBOX "ÎÞÓµÓÐ×é" - IDS_AFS_ID_DIDEXP "%1(ÁîÅÆÒÑÔÚ %2 µ½ÆÚ)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_QUERYING "(ÕýÔÚ²éѯ)" - IDS_ADMCOL_TYPE_FOREIGN_GROUP "Íⲿ×é" - IDS_ADMCOL_TYPE_FOREIGN_USER "ÍⲿÓû§" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_NOTIFIER "֪ͨÆ÷" - IDS_SVC_NONOTIFIER "(ÎÞ)" - IDS_SVR_KEY_TAB "·þÎñÆ÷ÃÜÔ¿" - IDS_KEYNAME_NOTIME "·þÎñÆ÷ %1 µÄÃÜÔ¿£º" - IDS_KEYNAME_WITHTIME "·þÎñÆ÷ %1 µÄÃÜÔ¿(ÒÑÐÞ¸ÄµÄ %2)£º" - IDS_SVRKEY_VERSION "°æ±¾" - IDS_SVRKEY_DATA "Öµ" - IDS_SVRKEY_CHECKSUM "УÑéºÍ" - IDS_SVRKEY_DATA_UNKNOWN "(Òþ²ØµÄ)" - IDS_STARTSERVICE_TITLE "Æô¶¯·þÎñ" - IDS_STOPSERVICE_TITLE "Í£Ö¹·þÎñ" - IDS_STARTSERVICE_TEXT "µ¥»÷¡°È·¶¨¡±ÒÔÆô¶¯·þÎñÆ÷ %1 ÉϵķþÎñ %2¡£" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STOPSERVICE_TEXT "µ¥»÷¡°È·¶¨¡±ÒÔÍ£Ö¹·þÎñÆ÷ %1 ÉϵķþÎñ %2¡£" - IDS_STARTSERVICE_STARTUP - "Äú¿ÉÒÔÓÀ¾Ã±£³Ö¸Ã¸ü¸Ä£¬ÒÔ±ã·þÎñÆ÷ %1 ÖØÐÂÆô¶¯Ê±£¬·þÎñ %2 »á×Ô¶¯Æô¶¯¡£" - IDS_STOPSERVICE_STARTUP "Äú¿ÉÒÔÓÀ¾Ã±£³Ö¸Ã¸ü¸Ä£¬ÒÔ±ã·þÎñÆ÷ %1 ÖØÐÂÆô¶¯Ê±£¬·þÎñ %2 ²»»á×Ô¶¯Æô¶¯¡£" - IDS_STARTSERVICE_PERMANENT "ÓÀ¾Ã(Èç¹û·þÎñÆ÷ %1 ÖØÐÂÆô¶¯£¬Æô¶¯·þÎñ %2)(&P)" - IDS_STARTSERVICE_TEMPORARY - "ÁÙʱ(Èç¹û·þÎñÆ÷ %1 ÖØÐÂÆô¶¯£¬²»Æô¶¯·þÎñ %2)(&T)" - IDS_STOPSERVICE_PERMANENT - "ÓÀ¾Ã(Èç¹û·þÎñÆ÷ %1 ÖØÐÂÆô¶¯£¬²»Æô¶¯·þÎñ %2)(&P)" - IDS_STOPSERVICE_TEMPORARY "ÁÙʱ(Èç¹û·þÎñÆ÷ %1 ÖØÐÂÆô¶¯£¬Æô¶¯·þÎñ %2)(&T)" - IDS_ACTION_EXECUTE "Ö´ÐзþÎñÆ÷ %1 µÄ %2" - IDS_ACTION_SALVAGE_SVR "Íì¾È·þÎñÆ÷ %1 ÉϵÄËùÓÐ¾í£º" - IDS_ACTION_SALVAGE_AGG "Íì¾È·ÖÇø %1:2 ÉϵÄËùÓÐ¾í£º" - IDS_ACTION_SALVAGE_VOL "Íì¾È·ÖÇø %1:2 Éϵľí %3" - IDS_SALVAGE_SVR "Íì¾È·þÎñÆ÷ %1 ÉϵÄËùÓоí" - IDS_SALVAGE_AGG "Íì¾È·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄËùÓоí" - IDS_SALVAGE_SET "Íì¾È·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ¾í %3" - IDS_SETSTATUS_SALVAGE "Íì¾È¾í" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETSTATUS_LOCKED "¾í±»Ëø¶¨" - IDS_SETSTATUS_NO_VOL "¾í¶ªÊ§" - IDS_SETSTATUS_BUSY "¾íµ±Ç°½Ïæ" - IDS_SETSTATUS_MOVED "ÒÑÒÆ¶¯µÄ¾í" - IDS_SVR_CAPACITY "%1" - IDS_SVR_ALLOCATION "%1 (%2%%)" - IDS_SVRCOL_ADDRESS "µØÖ·" - IDS_HOST_TITLE "·þÎñÆ÷ %1 ʶ±ðµÄÊý¾Ý¿âÖ÷»ú·þÎñÆ÷£º" - IDS_SVR_HOSTS_TITLE "·þÎñÆ÷ %1 - Êý¾Ý¿âÖ÷»ú" - IDS_SVR_HOST_TAB "Êý¾Ý¿âÖ÷»ú" - IDS_ACTION_HOSTLIST_LOAD "ÕýÔÚ´Ó·þÎñÆ÷ %1 »ñÈ¡Ö÷»úÁбí" - IDS_ACTION_HOSTLIST_SAVE "дÖ÷»úÁÐ±íµ½·þÎñÆ÷ %1" - IDS_SETSTATUS_1ALERT "¾íÓÐÒ»¸öÎÊÌâ" - IDS_SETSTATUS_2ALERT "¾íÓÐ %1 ¸öÎÊÌâ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CHANGEADDR "Ϊ·þÎñÆ÷ %1 ¸ü¸Ä IP µØÖ·" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_ADDSITE "vos addsite" - IDS_COMMAND_VOS_BACKUP "vos backup" - IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" - IDS_COMMAND_VOS_CREATE "vos create" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_DELENTRY "vos delentry" - IDS_COMMAND_VOS_DUMP "vos dump" - IDS_COMMAND_VOS_EXAMINE "vos examine" - IDS_COMMAND_VOS_LISTPART "vos listpart" - IDS_COMMAND_VOS_LISTVLDB "vos listvldb" - IDS_COMMAND_VOS_LISTVOL "vos listvol" - IDS_COMMAND_VOS_LOCK "vos lock" - IDS_COMMAND_VOS_MOVE "vos move" - IDS_COMMAND_VOS_PARTINFO "vos partinfo" - IDS_COMMAND_VOS_RELEASE "vos release" - IDS_COMMAND_VOS_REMOVE "vos remove" - IDS_COMMAND_VOS_REMSITE "vos remsite" - IDS_COMMAND_VOS_RENAME "vos rename" - IDS_COMMAND_VOS_RESTORE "vos restore" - IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" - IDS_COMMAND_VOS_UNLOCK "vos unlock" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" - IDS_COMMAND_VOS_ZAP "vos zap" - IDS_COMMAND_BOS_ADDHOST "bos addhost" - IDS_COMMAND_BOS_ADDKEY "bos addkey" - IDS_COMMAND_BOS_ADDUSER "bos adduser" - IDS_COMMAND_BOS_CREATE "bos create" - IDS_COMMAND_BOS_DELETE "bos delete" - IDS_COMMAND_BOS_EXEC "bos exec" - IDS_COMMAND_BOS_GETDATE "bos getdate" - IDS_COMMAND_BOS_GETLOG "bos getlog" - IDS_COMMAND_BOS_GETRESTART "bos getrestart" - IDS_COMMAND_BOS_INSTALL "bos install" - IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" - IDS_COMMAND_BOS_LISTKEYS "bos listkeys" - IDS_COMMAND_BOS_LISTUSERS "bos listusers" - IDS_COMMAND_BOS_PRUNE "bos prune" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_BOS_REMOVEHOST "bos removehost" - IDS_COMMAND_BOS_REMOVEKEY "bos removekey" - IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" - IDS_COMMAND_BOS_RESTART "bos restart" - IDS_COMMAND_BOS_SALVAGE "bos salvage" - IDS_COMMAND_BOS_SETAUTH "bos setauth" - IDS_COMMAND_BOS_SETRESTART "bos setrestart" - IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" - IDS_COMMAND_BOS_START "bos start" - IDS_COMMAND_BOS_STARTUP "bos startup" - IDS_COMMAND_BOS_STATUS "bos status" - IDS_COMMAND_BOS_STOP "bos stop" - IDS_COMMAND_BOS_UNINSTALL "bos uninstall" - IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" - IDS_COMMAND_FS_LISTQUOTA "fs listquota" - IDS_COMMAND_FS_QUOTA "fs quota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_FS_SETQUOTA "fs setquota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCSHORT_UNMONITORED "·þÎñÆ÷ %1 δ±»¼àÊÓ" - IDS_ALERT_DESCSHORT_TIMEOUT "ÎÞ·¨ÁªÏµ·þÎñÆ÷ %1£»×î½üÒ»´Î´íÎó£º%3" - IDS_ALERT_DESCSHORT_AGG_FULL "%2 ʹÓõķÖÇø³¬³ö¾¯¸æãÐÖµ %3%% (%4)" - IDS_ALERT_DESCSHORT_SET_FULL "%3 ʹÓÃµÄ¾í³¬³ö¾¯¸æãÐÖµ %4%% (%5)" - IDS_ALERT_DESCSHORT_NO_VLDBENT "¾í %3 ÎÞ VLDB ÌõÄ¿" - IDS_ALERT_DESCSHORT_NO_SVRENT_SET - "¾í %3 ÓÐ VLDB ÌõÄ¿µ«ÔÚ·þÎñÆ÷ %1 µÄ·ÖÇø %1 ÉÏÕÒ²»µ½" - IDS_ALERT_DESCSHORT_STOPPED "·þÎñ %2 Í£Ö¹ÓÚ %3" - IDS_ALERT_DESCSHORT_NO_SVRENT_AGG - "·ÖÇø %2 ±» VLDB ÒýÓõ«ÎÞ·¨ÔÚ·þÎñÆ÷ %1 ÉÏÕÒµ½" - IDS_ALERT_DESCSHORT_BADCREDS "Äú¿ÉÄÜûÓÐ×ã¹»µÄÌØÈ¨¹ÜÀí·þÎñÆ÷ %1" - IDS_ALERT_DESCSHORT_AGG_ALLOC "·ÖÇø %2 ÉÏ×éºÏµÄ¾íÏ޶³öÆäÈÝÁ¿" - IDS_ALERT_DESCSHORT_STATE_NO_VNODE "¾í %3 Ë𻵣¬ÎÞ·¨Ê¹Óá£" - IDS_ALERT_DESCSHORT_STATE_NO_SERVICE "ÎÞÔËÐеķþÎñ¿É¹©¾í %3 ʹÓá£" - IDS_ALERT_DESCSHORT_STATE_OFFLINE "¾í %3 ÍÑ»ú£¬ÎÞ·¨Ê¹Óá£" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_TIMEOUT - "ÎÞ·¨ÁªÏµ·þÎñÆ÷ %1¡£×î½üÒ»´Î³¢ÊÔ£¬·¢ÉúÓÚ %2£¬²úÉú´íÎó""%3""¡£" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_AGG_FULL - "·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄʹÓó¬³öÆä¾¯¸æãÐÖµ %3%% (%4)¡£" - IDS_ALERT_DESCFULL_SET_FULL - "¾í %3 (·þÎñÆ÷ %1£¬·ÖÇø %2)µÄʹÓó¬³öÆä¾¯¸æãÐÖµ %4%%(%5)¡£" - IDS_ALERT_DESCFULL_NO_VLDBENT - "¾í %3 ´æÔÚÓÚ·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏ£¬µ«Ã»ÓÐÏàÓ¦µÄ VLDB ÌõÄ¿¡£" - IDS_ALERT_DESCFULL_NO_SVRENT_SET - "¾í %3 ÓÐ VLDB ÌõÄ¿£¬µ«ÔÚ·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏÕÒ²»µ½¡£" - IDS_ALERT_DESCFULL_STOPPED "·þÎñÆ÷ %1 µÄ·þÎñ %2 Í£Ö¹ÓÚ %3£¬Í˳öÂëΪ %5¡£" - IDS_ALERT_DESCFULL_NO_SVRENT_AGG - "VLDB Ö¸·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ¾í£¬µ«ÕÒ²»µ½¸Ã·ÖÇø¡£" - IDS_ALERT_DESCFULL_BADCREDS - "AFS ·þÎñÆ÷¹ÜÀíÆ÷¿ÉÄܼì²âµ½·þÎñÆ÷ %1 Éϲ»´æÔڵĴíÎó£¬ÕâÊÇÒòΪÄúûÓиõ¥Ôª¹ÜÀíÔ±µÄ AFS ÁîÅÆ¡£ " - IDS_ALERT_DESCFULL_AGG_ALLOC - "·þÎñÆ÷ %1 µÄ·ÖÇøµÄ %2 ÉÏ×éºÏµÄ¾íÏ޶×ܹ² %4£¬³¬³ö·ÖÇøÈÝÁ¿ %3¡£" - IDS_ALERT_DESCFULL_STATE_NO_VNODE - "·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ %3 ¾íûÓÐ Vnode ÓëÖ®¹ØÁª¡£(¾í״̬Ϊ 0x%4¡£)" - IDS_ALERT_DESCFULL_STATE_NO_SERVICE - "·þÎñÆ÷ %1 ÉÏûÓÐÎļþµ÷³öÆ÷·þÎñÔËÐУ¬ÎÞ·¨Ê¹Ó÷ÖÇø %2 µÄ¾í %3¡£(¾í״̬Ϊ 0x%4¡£)" - IDS_ALERT_DESCFULL_STATE_OFFLINE - "·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ %3 ¾íÍÑ»ú£¬ÎÞ·¨Ê¹Óá£(¾í״̬Ϊ 0x%4¡£)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_TIMEOUT "µ¥»÷¡°ÔÙÊÔÒ»´Î¡±°´Å¥£¬³¢ÊÔÖØÐÂÁ¬½Ó¸Ã·þÎñÆ÷¡£" - IDS_ALERT_FIX_AGG_FULL "µ¥»÷¡°¾¯¸æ¡±°´Å¥Îª¸Ã·ÖÇøµÄʹÓøü¸Ä¾¯¸æãÐÖµ¡£" - IDS_ALERT_FIX_SET_FULL "µ¥»÷¡°¾¯¸æ¡±°´Å¥Îª¸Ã¾íµÄʹÓøü¸Ä¾¯¸æãÐÖµ¡£" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_NO_VLDBENT - "VLDB ¿ÉÄܹýʱ£»Èç¹ûÕâÑù£¬Ê¹Óá°Í¬²½ VLDB¡±ÃüÁî½øÐиüС£" - IDS_ALERT_FIX_NO_SVRENT_SET "¼ì²é·þÎñÆ÷ºÍ·ÖÇøÒÔÈ·±£ËüÃǹ¤×÷Õý³£¡£" - IDS_ALERT_FIX_STOPPED "µ¥»÷¡°²é¿´ÈÕÖ¾¡±°´Å¥Îª¸Ã·þÎñ²é¿´·þÎñÈÕÖ¾¡£" - IDS_ALERT_FIX_NO_SVRENT_AGG "¼ì²é·þÎñÆ÷ÒÔÈ·±£·ÖÇøÒѵ¼³öÇÒ¹¤×÷Õý³£¡£" - IDS_ALERT_FIX_BADCREDS "µ¥»÷¡°ÈÏÖ¤¡±°´Å¥ÒÔ»ñµÃÐ嵀 AFS ÁîÅÆ¡£" - IDS_ALERT_FIX_AGG_ALLOC "¼õÉٸ÷ÖÇøµÄ¾íÏ޶»òÕßÒÆ¶¯Ò»¸ö»ò¶à¸ö¾íµ½ÁíÒ»·ÖÇø¡£" - IDS_ALERT_FIX_STATE_NO_VNODE " " - IDS_ALERT_FIX_STATE_NO_SERVICE " " - IDS_ALERT_FIX_STATE_OFFLINE " " -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_BUTTON_TRYAGAIN "ÔÙÊÔÒ»´Î(&A)" - IDS_ALERT_BUTTON_WARNINGS "¾¯¸æ(&W)..." - IDS_ALERT_BUTTON_VIEWLOG "²é¿´ÈÕÖ¾(&V)" - IDS_ALERT_BUTTON_SHOWME "ÏÔʾ(&S)" - IDS_ALERT_BUTTON_GETCREDS "ÈÏÖ¤(&A)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_CELLSERVERS_NOCELL - "δָ¶¨µ¥Ôª¡£ÒªÊ¹Óà AFS ·þÎñÆ÷¹ÜÀíÆ÷£¬Äú±ØÐëÖ¸¶¨ÒªÊ¹ÓÃµÄ AFS µ¥Ôª¡£Í¨¹ýÑ¡Ôñ""´ò¿ª..."" ²Ëµ¥Ïî(ÔÚÉÏÃæµÄ""µ¥Ôª "" ²Ëµ¥ÖÐ)À´Ñ¡Ôñµ¥Ôª¡£" - IDS_ERROR_REFRESH_CELLSERVERS - "ÎÞ·¨»ñµÃµ¥Ôª %1 µÄ·þÎñÆ÷ÁÐ±í¡£\n\n´íÎó£º %2" - IDS_ERROR_CANT_OPEN_CELL - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÁªÏµµ¥Ôª %1 ÖеÄÈκηþÎñÆ÷¡£\n\nÇëÖØÐ¼ì²éÒÔÈ·ÈÏÒÑÕýÈ·ÊäÈëµ¥ÔªÃû¡£" - IDS_ERROR_REFRESH_AGGREGATES "ÎÞ·¨»ñµÃ·þÎñÆ÷ %1 µÄ·ÖÇøÁÐ±í¡£\n\n´íÎó£º%2" - IDS_ERROR_REFRESH_SERVER_STATUS "ÎÞ·¨»ñµÃ·þÎñÆ÷ %1 µÄµ±Ç°×´Ì¬¡£" - IDS_ERROR_CHANGE_SERVER_STATUS - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 ¸ü¸ÄÌØÐÔ¡£" - IDS_ERROR_REFRESH_AGGREGATE_STATUS - "ÎÞ·¨»ñµÃ·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄµ±Ç°×´Ì¬¡£" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_FILESET_STATUS - "ÎÞ·¨»ñµÃ¾í %3 (·þÎñÆ÷¡¡%1£¬·ÖÇø %2)µÄµ±Ç°×´Ì¬¡£" - IDS_ERROR_REFRESH_SERVICE_STATUS - "ÎÞ·¨È·¶¨·þÎñÆ÷ %1 µÄ·þÎñ %2 µÄµ±Ç°×´Ì¬¡£" - IDS_ERROR_MOVE_FILESET "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´Ó·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏÒÆ¶¯¾í %3 µ½·þÎñÆ÷ %4 µÄ·ÖÇø %5¡£" - IDS_ERROR_VIEW_LOGFILE "ÎÞ·¨´Ó·þÎñÆ÷ %1 ¶ÁÈ¡Îļþ %2¡£\n\n¼ì²éÒÔÈ·ÈÏÄúÒÑÕýÈ·ÊäÈëÎļþÃû£¬²¢ÇÒÓÐ×ã¹»µÄȨÏ޲鿴Îļþ¡£" - IDS_ERROR_NOT_REPLICATED "ÎÞ·¨È·¶¨¾í %1 µÄ¸´ÖÆ×´Ì¬¡£" - IDS_ERROR_CANT_CREATE_FILESET - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚ·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏ´´½¨¾í %3¡£" - IDS_ERROR_CANT_DELETE_FILESET - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨É¾³ý¾í %3 (·þÎñÆ÷ %1 µÄ·ÖÇø %2)¡£" - IDS_ERROR_CANT_CREATE_VLDB_ENTRY - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚ·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏΪ¾í %3 ´´½¨ VLDB ÌõÄ¿¡£" - IDS_ERROR_CANT_SET_FILESET_QUOTA - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 µÄ·ÖÇø %2 Éϵľí %3 ¸ü¸ÄÏÞ¶î¡£" - IDS_ERROR_CANT_CREATE_SERVER - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚµ¥Ôª %1 Öд´½¨ÇëÇóµÄ·þÎñÆ÷ÌõÄ¿¡£" - IDS_ERROR_CANT_PING_SERVER - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨È·¶¨·þÎñÆ÷ %1 µÄ IP µØÖ·¡£" - IDS_ERROR_CANT_DELETE_SERVER "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨É¾³ý·þÎñÆ÷ %1¡£" - IDS_ERROR_CANT_DELETE_SERVER_FILESETS - "ÎÞ·¨É¾³ý·þÎñÆ÷ %1£¬ÒòΪËüÈÔÓµÓÐÒ»¸ö»ò¶à¸ö¾í¡£³ý·Ç·þÎñÆ÷²»°üº¬¾í£¬·ñÔò²»ÄÜɾ³ý¡£" - IDS_ERROR_CHANGE_AGGREGATE_STATUS - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸ü¸Ä·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄÌØÐÔ¡£" - IDS_ERROR_CHANGE_SERVICE_STATUS - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸ü¸Ä·þÎñÆ÷ %1 µÄ·þÎñ %2 µÄÌØÐÔ¡£" - IDS_ERROR_CANT_START_SERVICE - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Æô¶¯·þÎñÆ÷ %1 µÄ·þÎñ %2¡£" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_STOP_SERVICE - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Í£Ö¹·þÎñÆ÷ %1 µÄ·þÎñ %2¡£" - IDS_ERROR_CANT_RESTART_SERVICE - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Í£Ö¹²¢ÖØÐÂÆô¶¯·þÎñÆ÷ %1 µÄ·þÎñ %2¡£" - IDS_ERROR_CHANGE_REPLICA_STATUS - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 µÄ·ÖÇø %2 Éϵľí %3 ¸ü¸Ä¸´ÖÆÌØÐÔ¡£" - IDS_ERROR_CANT_SYNCVLDB "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸üРVLDB¡£" - IDS_ERROR_CANT_CREATE_REPLICA - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´´½¨·þÎñÆ÷ %1 µÄ·ÖÇø %2 Éϵľí %3 µÄ¸±±¾¡£" - IDS_ERROR_CANT_INSTALL_FILE - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚ·þÎñÆ÷ %1 Éϰ²×°Îļþ %2¡£" - IDS_ERROR_CANT_UNINSTALL_FILE - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚ·þÎñÆ÷ %1 ÉÏжװÎļþ %2¡£" - IDS_ERROR_CANT_PRUNE_FILES - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´Ó·þÎñÆ÷ %1 ÉϳýÈ¥ÇëÇóµÄÎļþ¡£" - IDS_ERROR_CANT_RENAME_FILESET "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÖØÃüÃû¾í %1 Ϊ""%2""¡£" - IDS_ERROR_CANT_CREATE_SERVICE - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚ·þÎñÆ÷ %1 ÉÏ´´½¨·þÎñ %2¡£" - IDS_ERROR_CANT_DELETE_SERVICE - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´Ó·þÎñÆ÷ %1 ÉÏɾ³ý·þÎñ %2¡£" - IDS_ERROR_CANT_RELEASE_FILESET "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÊͷŸ´ÖƵľí %3¡£" - IDS_ERROR_CANT_UPDATE_FILESET - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸üзþÎñÆ÷ %2 µÄ·ÖÇø %1 µÄ¾í¸±±¾ %3¡£" - IDS_ERROR_CANT_UPDATE_ALL "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸üоí %3 µÄÈκθ±±¾¡£" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_LOAD_ADMLIST - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¶ÁÈ¡·þÎñÆ÷ %1 µÄ¹ÜÀíÔ±ÁÐ±í¡£" - IDS_ERROR_CANT_LOAD_KEYLIST - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¶ÁÈ¡·þÎñÆ÷ %1 µÄ·þÎñÆ÷ÃÜÔ¿ÁÐ±í¡£" - IDS_ERROR_CANT_CREATE_KEY - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 н¨·þÎñÆ÷ÃÜÔ¿¡£" - IDS_ERROR_CANT_SAVE_ADMLIST - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸ü¸Ä·þÎñÆ÷ %1 µÄ¹ÜÀíÔ±ÁÐ±í¡£" - IDS_ERROR_CANT_CLONE "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´´½¨·þÎñÆ÷ %1 µÄ·ÖÇø %2 Éϵľí %3 µÄ±¸·Ý°æ±¾¡£" - IDS_ERROR_CANT_CLONESYS "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´´½¨ÈκÎÇëÇóµÄ±¸·Ý¾í¡£" - IDS_ERROR_CANT_DUMP_FILESET - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨×ª´¢¾í %3 (·þÎñÆ÷ %1£¬·ÖÇø %2)µÄÄÚÈݵ½Îļþ %4¡£" - IDS_ERROR_CANT_RESTORE_FILESET - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨»Ö¸´Îļþ %4 µ½¾í %3(·þÎñÆ÷ %1£¬·ÖÇø %2)¡£" - IDS_ERROR_CANT_SET_RESTART_TIMES - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸ü¸Ä·þÎñÆ÷ %1 ·þÎñµÄÖØÐÂÆô¶¯Ê±¼ä¡£" - IDS_ERROR_CANT_DELETE_REPLICATED_FILESET - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨É¾³ý·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ¾í %3¡£\n\nÎÞ·¨É¾³ý¾í %3£¬³ý·ÇÊ×ÏÈɾ³ýÆäËùÓи±±¾¡£" - IDS_CMDLINE_TITLE "³ö´í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" - IDS_CMDLINE_SYNTAX "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£" - IDS_CMDLINE_UNRECOGNIZED - "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\n ÎÞ·¨Ê¶±ð²ÎÊý ""%1""¡£" - IDS_CMDLINE_DUPLICATE "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\n ²ÎÊý""%1""±»Ö¸¶¨¶à´Î¡£" - IDS_CMDLINE_UNEXPECTVALUE - "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\n ²ÎÊý ""%1"" ²»Ó¦¸³ÓèÖµ¡£" - IDS_CMDLINE_MISSINGVAL "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\n ²ÎÊý ""%1"" ±ØÐë´øÓÐÖµ¡£" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CMDLINE_SUBSETNOTCELL - "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\n²ÎÊý""/SUBSET""½öµ±²ÎÊý""/CELL""Ö¸¶¨Ê±²ÅÖ¸¶¨¡£" - IDS_CMDLINE_INVALIDSUBSET - "ÄúÖ¸¶¨µÄ·þÎñÆ÷×Ó¼¯£¬""%2""£¬Ã»ÓÐΪµ¥Ôª %1 ¶¨Òå¡£" - IDS_CMDLINE_SERVERNOTCELL - "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\n²ÎÊý""/SERVER""½öµ±Ö¸¶¨²ÎÊý""/CELL""ʱ²ÅÖ¸¶¨¡£" - IDS_CMDLINE_RESET_TITLE "AFS ·þÎñÆ÷¹ÜÀíÆ÷" - IDS_CMDLINE_RESET_DESC "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÒÑÇå³ýÖ¸¶¨µÄÉèÖá£" - IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Ê¹·þÎñÆ÷ %1 µÄ·ÖÇø %2 Óë VLDB ͬ²½£¬ÒòΪ¸Ã·ÖÇø²»´æÔÚ»òδµ¼³ö¡£\n\nÒª´Ó·þÎñÆ÷ %1 ÉϳýÈ¥¸Ã·ÖÇø£¬Äú±ØÐëɾ³ýÏàÓ¦µÄ¾í VLDB ÌõÄ¿¡£" - IDS_CMDLINE_USERPASSWORD - "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\nÒª»ñµÃÐ嵀 AFS ÁîÅÆ£¬±ØÐëͬʱָ¶¨²ÎÊý""/USER"" ¼° ""/PASSWORD""¡£" - IDS_ERROR_CANT_DELETE_KEY - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´Ó·þÎñÆ÷ %1 ÉÏɾ³ý·þÎñÆ÷ÃÜÔ¿ %2¡£" - IDS_ERROR_CANT_GETRANDOMKEY - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 Éú³ÉÒ»¸öËæ»úÃÜÔ¿¡£" - IDS_ERROR_CANT_EXECUTE_COMMAND - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚ·þÎñÆ÷ %1 ÉÏÖ´ÐÐÏÂÁÐÃüÁ\n\n ""%2""" - IDS_ERROR_CANT_READ_SALVAGE_LOG - "AFS ·þÎñÆ÷¹ÜÀíÆ÷³É¹¦Íê³ÉÍì¾È²Ù×÷£¬µ«ÎÞ·¨¼ìË÷ÃèÊöÍì¾È²Ù×÷ÌØ¶¨½á¹ûµÄÈÕÖ¾Îļþ¡£" - IDS_ERROR_CANT_SALVAGE "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Ö´ÐÐÇëÇóµÄÍì¾È²Ù×÷¡£" - IDS_ERROR_CANT_AUTH_ON "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 ÆôÓÃÈÏÖ¤¼ì²é¡£" - IDS_ERROR_CANT_AUTH_OFF "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 ½ûÓÃÈÏÖ¤¼ì²é¡£" - IDS_ERROR_CANT_LOAD_HOSTLIST - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´Ó·þÎñÆ÷ %1 É϶ÁÈ¡Êý¾Ý¿âÖ÷»ú·þÎñÆ÷ÁÐ±í¡£" - IDS_ERROR_CANT_SAVE_HOSTLIST - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸ü¸Ä·þÎñÆ÷ %1 ÉϵÄÊý¾Ý¿âÖ÷»ú·þÎñÆ÷ÁÐ±í¡£" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Æô¶¯£¬ÒòΪ¸Ã¼ÆËã»úÉÏδÕýÈ·°²×° AFS ¿ØÖÆÖÐÐÄ¡£\n\nÄú¿ÉÄÜÐèÒªÖØÐ°²×° AFS ¿ØÖÆÖÐÐÄ¡£" - IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN - "ÓÉÓÚÒ»¸öδ֪ÎÊÌ⣬AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Æô¶¯¡£\n\nÄú¿ÉÄÜÐèÒªÖØÐ°²×° AFS ¿ØÖÆÖÐÐÄ¡£" - IDS_ERROR_CANT_CHANGEADDR - "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 ¸ü¸Ä VLDB ÖÐµÄ IP µØÖ·¡£" -END - -#endif // Chinese (P.R.C.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Chinese (P.R.C.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +#ifdef _WIN32 +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_SERVICES, DIALOG + BEGIN + RIGHTMARGIN, 165 + END + + IDD_AGGREGATES, DIALOG + BEGIN + RIGHTMARGIN, 118 + END + + IDD_FILESETS, DIALOG + BEGIN + RIGHTMARGIN, 180 + END + + IDD_SVR_LISTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_AGG_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 262 + TOPMARGIN, 5 + BOTTOMMARGIN, 155 + END + + IDD_SVR_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 183 + END + + IDD_SVR_SCOUT, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 216 + TOPMARGIN, 5 + BOTTOMMARGIN, 153 + END + + IDD_SVC_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 268 + TOPMARGIN, 5 + BOTTOMMARGIN, 209 + END + + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 315 + TOPMARGIN, 2 + BOTTOMMARGIN, 224 + END + + IDD_SERVER, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 207 + TOPMARGIN, 2 + BOTTOMMARGIN, 135 + END + + IDD_SVC_CREATE, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 228 + END + + IDD_SET_REPSITES, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 216 + TOPMARGIN, 5 + BOTTOMMARGIN, 163 + END + + IDD_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 7 + BOTTOMMARGIN, 253 + HORZGUIDE, 160 + END + + IDD_TIMEOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 232 + TOPMARGIN, 7 + BOTTOMMARGIN, 153 + END + + IDD_COLUMNS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 281 + TOPMARGIN, 5 + BOTTOMMARGIN, 143 + END + + IDD_REFRESHALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 260 + TOPMARGIN, 7 + BOTTOMMARGIN, 68 + END + + IDD_SET_CREATE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 317 + TOPMARGIN, 4 + BOTTOMMARGIN, 205 + END + + IDD_SET_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 303 + TOPMARGIN, 7 + BOTTOMMARGIN, 99 + END + + IDD_SET_CLONE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 341 + TOPMARGIN, 7 + BOTTOMMARGIN, 81 + END + + IDD_SVC_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 189 + END + + IDD_SVR_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 152 + END + + IDD_AGG_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 252 + TOPMARGIN, 5 + BOTTOMMARGIN, 146 + END + + IDD_SET_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 268 + TOPMARGIN, 5 + BOTTOMMARGIN, 177 + END + + IDD_SET_MOVETO, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 170 + END + + IDD_SET_MOVING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SVC_LOGNAME, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 102 + END + + IDD_SVC_VIEWLOG, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 181 + END + + IDD_SET_SETQUOTA, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 267 + TOPMARGIN, 4 + BOTTOMMARGIN, 126 + END + + IDD_ACTIONS, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 234 + TOPMARGIN, 2 + BOTTOMMARGIN, 56 + END + + IDD_SVR_SYNCVLDB, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 265 + TOPMARGIN, 4 + BOTTOMMARGIN, 95 + END + + IDD_SET_CREATEREP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 167 + END + + IDD_SVR_INSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 152 + END + + IDD_SVR_UNINSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 135 + END + + IDD_SVR_PRUNE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 196 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_SET_RENAME, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 129 + END + + IDD_SVC_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 64 + END + + IDD_SVR_GETDATES, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_GETDATES_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 128 + END + + IDD_SET_DUMP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 291 + TOPMARGIN, 7 + BOTTOMMARGIN, 140 + END + + IDD_SET_RESTORE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 288 + TOPMARGIN, 4 + BOTTOMMARGIN, 244 + END + + IDD_SVC_BOS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_DUMPING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SET_RESTORING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SET_CLONESYS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 159 + END + + IDD_SUBSETS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 276 + TOPMARGIN, 5 + BOTTOMMARGIN, 177 + END + + IDD_SUBSET_LOADSAVE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 276 + TOPMARGIN, 4 + BOTTOMMARGIN, 141 + END + + IDD_HELP_FIND, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 214 + TOPMARGIN, 4 + BOTTOMMARGIN, 69 + END + + IDD_HELP_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 214 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_HELP_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 226 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_OPENINGCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 236 + TOPMARGIN, 2 + BOTTOMMARGIN, 41 + END + + IDD_OPTIONS_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 274 + TOPMARGIN, 5 + BOTTOMMARGIN, 131 + END + + IDD_SVR_KEYS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_CREATEKEY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + END + + IDD_SVC_STARTSTOP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END + + IDD_SVR_EXECUTE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_SALVAGE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 7 + BOTTOMMARGIN, 250 + END + + IDD_SVR_SALVAGE_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 174 + END + + IDD_SET_RELEASE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 98 + END + + IDD_SVR_HOSTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_ADDHOST, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 221 + TOPMARGIN, 4 + BOTTOMMARGIN, 102 + END + + IDD_SVR_ADDRESS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 204 + TOPMARGIN, 4 + BOTTOMMARGIN, 111 + END + + IDD_SVR_NEWADDR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 219 + TOPMARGIN, 4 + BOTTOMMARGIN, 65 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ·þÎñÆ÷¹ÜÀíÆ÷""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_MAIN MENU DISCARDABLE +BEGIN + POPUP "µ¥Ôª(&C)" + BEGIN + MENUITEM "Ñ¡Ôñ(&S)...", M_CELL_OPEN + MENUITEM "ÈÏÖ¤(&A)...", M_CREDENTIALS + MENUITEM SEPARATOR + MENUITEM "Í˳ö(&X)", M_EXIT + END + POPUP "ÊÓͼ(&V)" + BEGIN + POPUP "·þÎñÆ÷(&S)" + BEGIN + MENUITEM "´óͼ±ê(&G)", M_SVR_VIEW_LARGE + , CHECKED + MENUITEM "Сͼ±ê(&M)", M_SVR_VIEW_SMALL + , CHECKED + MENUITEM "Ïêϸ×ÊÁÏ(&D)", M_SVR_VIEW_REPORT + , CHECKED + MENUITEM SEPARATOR + MENUITEM "Õý³£(&N)", M_SVR_VIEW_ONEICON + , CHECKED + MENUITEM "ËùÓÐͼ±ê(&A)", M_SVR_VIEW_TWOICONS + , CHECKED + MENUITEM "½öÏÔʾ״̬(&S)", M_SVR_VIEW_STATUS + , CHECKED + END + POPUP "¿ìËÙä¯ÀÀÏÔʾ´°¿Ú(&Q)" + BEGIN + MENUITEM "ÎÞ(&N)", M_DIVIDE_NONE, CHECKED + MENUITEM "´¹Ö±·Ö¸î(&V)", M_DIVIDE_H, CHECKED + MENUITEM "ˮƽ·Ö¸î(&H)", M_DIVIDE_V, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "ÕýÔÚ½øÐеIJÙ×÷(&P)", M_ACTIONS, CHECKED + MENUITEM SEPARATOR + MENUITEM "±»¼àÊӵķþÎñÆ÷(&M)...", M_SUBSET + MENUITEM "ÁÐ(&C)...", M_COLUMNS + MENUITEM "Ñ¡Ïî(&O)...", M_OPTIONS + MENUITEM SEPARATOR + MENUITEM "Ë¢ÐÂËùÓÐ(&F)", M_REFRESHALL + END + POPUP "°ïÖú(&H)" + BEGIN + MENUITEM "Ŀ¼(&C)", M_HELP + MENUITEM "²éÕÒÃüÁî(&F)...", M_HELP_FIND + MENUITEM "²éÕÒ´íÎó´úÂë(&L)...", M_HELP_XLATE + MENUITEM SEPARATOR + MENUITEM "¹ØÓÚ AFS ·þÎñÆ÷¹ÜÀíÆ÷(&A)...", M_ABOUT + END +END + +MENU_AGG MENU DISCARDABLE +BEGIN + MENUITEM "´´½¨¾í(&C)...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "±¸·Ý¾í(&B)...", M_SET_CLONE + MENUITEM "½âËøËùÓоí(&U)", M_SET_UNLOCK + MENUITEM "ͬ²½ VLDB(&Y)...", M_SYNCVLDB + MENUITEM "Íì¾È¾í(&G)...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "Ë¢ÐÂ(&F)", M_REFRESH + MENUITEM "ÌØÐÔ(&R)", M_PROPERTIES +END + +MENU_SVC MENU DISCARDABLE +BEGIN + MENUITEM "Æô¶¯(&S)", M_SVC_START + MENUITEM "Í£Ö¹(&S)", M_SVC_STOP + MENUITEM "ÖØÐÂÆô¶¯(&R)", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "²é¿´ÈÕÖ¾Îļþ(&V)", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "ɾ³ý(&L)", M_SVC_DELETE + MENUITEM SEPARATOR + MENUITEM "Ë¢ÐÂ(&F)", M_REFRESH + MENUITEM "ÌØÐÔ(&R)", M_PROPERTIES +END + +MENU_AGG_NONE MENU DISCARDABLE +BEGIN + POPUP "ÊÓͼ(&V)" + BEGIN + MENUITEM "Õý³£(&N)", M_VIEW_ONEICON, CHECKED + MENUITEM "ËùÓÐͼ±ê(&A)", M_VIEW_TWOICONS, CHECKED + MENUITEM "½öÏÔʾ״̬(&S)", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "´´½¨¾í(&C)...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "Ë¢ÐÂËùÓÐ(&F)", M_REFRESHALL +END + +MENU_SVC_NONE MENU DISCARDABLE +BEGIN + POPUP "ÊÓͼ(&V)" + BEGIN + MENUITEM "Õý³£(&N)", M_VIEW_ONEICON, CHECKED + MENUITEM "ËùÓÐͼ±ê(&A)", M_VIEW_TWOICONS, CHECKED + MENUITEM "½öÏÔʾ״̬(&S)", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "´´½¨·þÎñ(&C)...", M_SVC_CREATE + MENUITEM SEPARATOR + MENUITEM "Ë¢ÐÂËùÓÐ(&F)", M_REFRESHALL +END + +MENU_SET MENU DISCARDABLE +BEGIN + MENUITEM "¸´ÖÆ(&P)...", M_SET_REPLICATION + MENUITEM "ÏÖÔÚÊÍ·Å(&S)", M_SET_RELEASE + MENUITEM SEPARATOR + MENUITEM "±¸·Ý(&B)...", M_SET_CLONE + MENUITEM "ת´¢µ½Îļþ(&D)...", M_SET_DUMP + MENUITEM "´ÓÎļþ»Ö¸´(&R)...", M_SET_RESTORE + MENUITEM "ÉèÖÃÏÞ¶î(&Q)...", M_SET_SETQUOTA + MENUITEM "Íì¾È(&G)...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "ÒÆ¶¯µ½(&M)...", M_SET_MOVETO + MENUITEM "ÖØÃüÃû(&N)...", M_SET_RENAME + MENUITEM "ɾ³ý(&L)", M_SET_DELETE + MENUITEM SEPARATOR + MENUITEM "Ëø¶¨(&K)", M_SET_LOCK + MENUITEM "½âËø(&U)", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "Ë¢ÐÂ(&F)", M_REFRESH + MENUITEM "ÌØÐÔ(&R)", M_PROPERTIES +END + +MENU_SVR MENU DISCARDABLE +BEGIN + MENUITEM "´ò¿ª·þÎñÆ÷´°¿Ú(&O)", M_SVR_OPEN + MENUITEM "¹Ø±Õ·þÎñÆ÷´°¿Ú(&C)", M_SVR_CLOSE + MENUITEM "¼àÊÓ´Ë·þÎñÆ÷(&M)", M_SVR_MONITOR, CHECKED + MENUITEM SEPARATOR + MENUITEM "±à¼­·þÎñÆ÷°²È«ÐÔ(&S)...", M_SVR_SECURITY + MENUITEM "¹ÜÀíÊý¾Ý¿âÖ÷»ú(&H)...", M_SVR_HOSTS + MENUITEM "±¸·Ý¾í(&B)...", M_SET_CLONE + MENUITEM "½âËøËùÓоí(&U)", M_SET_UNLOCK + MENUITEM "ͬ²½ VLDB(&Y)...", M_SYNCVLDB + MENUITEM "Íì¾È¾í(&G)...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "°²×°Îļþ(&I)...", M_SVR_INSTALL + MENUITEM "жװÎļþ(&U)...", M_SVR_UNINSTALL + MENUITEM "ɾ³ý¾ÉÎļþ(&P)...", M_SVR_PRUNE + MENUITEM SEPARATOR + MENUITEM "»ñµÃÎļþÈÕÆÚ(&T)...", M_SVR_GETDATES + MENUITEM "²é¿´ÈÕÖ¾Îļþ(&V)...", M_VIEWLOG + MENUITEM "Ö´ÐÐÃüÁî(&X)...", M_EXECUTE + MENUITEM SEPARATOR + MENUITEM "Ë¢ÐÂ(&F)", M_REFRESH + MENUITEM "ÌØÐÔ(&R)", M_PROPERTIES +END + +MENU_SVR_NONE MENU DISCARDABLE +BEGIN + POPUP "ÊÓͼ(&V)" + BEGIN + MENUITEM "´óͼ±ê(&G)", M_SVR_VIEW_LARGE, CHECKED + MENUITEM "Сͼ±ê(&M)", M_SVR_VIEW_SMALL, CHECKED + MENUITEM "Ïêϸ×ÊÁÏ(&D)", M_SVR_VIEW_REPORT, CHECKED + MENUITEM SEPARATOR + MENUITEM "Õý³£(&N)", M_SVR_VIEW_ONEICON, CHECKED + MENUITEM "ËùÓÐͼ±ê(&A)", M_SVR_VIEW_TWOICONS, CHECKED + MENUITEM "½öÏÔʾ״̬(&S)", M_SVR_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "±»¼àÊӵķþÎñÆ÷(&M)...", M_SUBSET + MENUITEM SEPARATOR + MENUITEM "½âËøËùÓоí(&U)", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "¹Ø±ÕËùÓÐ(&C)", M_SVR_CLOSEALL + MENUITEM "Ë¢ÐÂËùÓÐ(&F)", M_REFRESHALL +END + +MENU_SET_NONE MENU DISCARDABLE +BEGIN + POPUP "ÊÓͼ(&V)" + BEGIN + MENUITEM "°´¾í(&V)", M_SET_VIEW_REPORT, CHECKED + MENUITEM "°´·ÖÇø(&P)", M_SET_VIEW_TREELIST, CHECKED + MENUITEM "ÎÞÏêϸÐÅÏ¢(&D)", M_SET_VIEW_TREE, CHECKED + MENUITEM SEPARATOR + MENUITEM "Õý³£(&N)", M_VIEW_ONEICON, CHECKED + MENUITEM "ËùÓÐͼ±ê(&A)", M_VIEW_TWOICONS, CHECKED + MENUITEM "½öÏÔʾ״̬(&S)", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "´´½¨¾í(&C)...", M_SET_CREATE + MENUITEM "´ÓÎļþ»Ö¸´(&R)...", M_SET_RESTORE + MENUITEM SEPARATOR + MENUITEM "±¸·Ý¾í(&B)...", M_SET_CLONE + MENUITEM SEPARATOR + MENUITEM "½âËøËùÓÐ(&U)", M_SET_UNLOCK + MENUITEM "Ë¢ÐÂËùÓÐ(&F)", M_REFRESHALL +END + +MENU_COLUMNS MENU DISCARDABLE +BEGIN + MENUITEM "ÁÐ(&C)...", M_COLUMNS +END + +MENU_SVC_BOS MENU DISCARDABLE +BEGIN + MENUITEM "ÖØÐÂÆô¶¯(&R)", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "²é¿´ÈÕÖ¾Îļþ(&V)", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "Ë¢ÐÂ(&F)", M_REFRESH + MENUITEM "ÌØÐÔ(&R)", M_PROPERTIES +END + +MENU_SET_DRAGDROP MENU DISCARDABLE +BEGIN + MENUITEM "ÒÆ¶¯ÕâÀï(&M)...", M_SET_MOVEHERE + MENUITEM "¸´ÖÆÕâÀï(&R)...", M_SET_REPHERE + MENUITEM SEPARATOR + MENUITEM "È¡Ïû(&C)", IDC_STATIC +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SERVICES DIALOGEX 0, 0, 179, 92 +STYLE DS_CENTER | WS_CHILD +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "·þÎñ£º",IDC_SVC_DESC,0,5,179,8 + CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,0,17,179, + 61,WS_EX_STATICEDGE + PUSHBUTTON "´´½¨(&C)...",IDC_SVC_CREATE,37,80,46,12 + PUSHBUTTON "ɾ³ý(&L)",IDC_SVC_DELETE,86,80,39,12 + PUSHBUTTON "ÖØÐÂÆô¶¯(&R)",IDC_SVC_RESTART,128,80,48,12 +END + +IDD_AGGREGATES DIALOGEX 0, 0, 165, 84 +STYLE DS_CENTER | WS_CHILD +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "·ÖÇø£º",IDC_AGG_DESC,0,5,165,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,0,17,165, + 53,WS_EX_STATICEDGE + PUSHBUTTON "´´½¨¾í(&C)...",IDC_AGG_CREATESET,102,72,63,12 +END + +IDD_FILESETS DIALOGEX 0, 0, 194, 92 +STYLE DS_CENTER | WS_CHILD +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "¾í£º",IDC_SET_DESC,0,5,194,8 + CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,0,17,194, + 61,WS_EX_STATICEDGE + PUSHBUTTON "´´½¨(&C)...",IDC_SET_CREATE,1,80,42,12 + PUSHBUTTON "ɾ³ý(&L)",IDC_SET_DELETE,45,80,36,12 + PUSHBUTTON "¸´ÖÆ(&R)...",IDC_SET_REP,84,80,48,12 + PUSHBUTTON "ÉèÖÃÏÞ¶î(&Q)...",IDC_SET_SETQUOTA,134,80,59,12 +END + +IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, + 135,WS_EX_CLIENTEDGE + PUSHBUTTON "Ìí¼Ó¹ÜÀíÔ±(&A)",IDC_LIST_ADD,72,160,65,14 + PUSHBUTTON "³ýÈ¥¹ÜÀíÔ±(&R)",IDC_LIST_REMOVE,141,160,80,14 + LTEXT "·þÎñÆ÷ %1 µÄ¹ÜÀíÔ±£º",IDC_LIST_NAME,5,7,216,8 +END + +IDD_AGG_GENERAL DIALOGEX 0, 0, 267, 160 +STYLE WS_CHILD +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "±êʶ·û£º",IDC_STATIC,5,30,36,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_AGG_ID,40,30,214,8 + LTEXT "É豸£º",IDC_STATIC,5,46,31,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_AGG_DEVICE,40,46,214,8 + LTEXT "¾í£º",IDC_STATIC,5,62,31,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_AGG_FILESETS,40,62,214,8 + CONTROL "Èç¹û×éºÏµÄ¾íÏ޶¹ýÈÝÁ¿£¬ÏÔʾ¾¯¸æ(&W)", + IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 38,76,224,10 + LTEXT "Ó÷¨£º",IDC_STATIC,5,90,31,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_AGG_USAGE,38,90,214,8 + CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,38,103,224,8, + WS_EX_STATICEDGE + CONTROL "Èç¹û·ÖÇøÊ¹Óó¬³öÏ޶ÏÔʾ¾¯¸æ(&W)",IDC_AGG_WARN,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,38,116,214,10 + CONTROL "¸Ã·þÎñÆ÷µÄȱʡãÐÖµ(&D)",IDC_AGG_WARN_AGGFULL_DEF,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,49,131,203,9 + CONTROL "Æä´óСµÄ",IDC_AGG_WARN_AGGFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,49,145,62,9 + EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,112,143,29,12, + ES_AUTOHSCROLL + LTEXT "% ãÐÖµ(&T)",IDC_AGG_WARN_AGGFULL_DESC,152,145,100,8 + ICON IDI_AGGREGATE,IDC_STATIC,5,5,20,20 + LTEXT "·ÖÇø %2 (·þÎñÆ÷ %1)",IDC_AGG_NAME,38,14,214,8 +END + +IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 +STYLE WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + LTEXT "IP µØÖ·£º",IDC_STATIC,5,29,43,8 + LISTBOX IDC_SVR_ADDRESSES,53,29,70,12,LBS_NOSEL | NOT WS_BORDER | + WS_VSCROLL + PUSHBUTTON "¸ü¸ÄµØÖ·(&A)...",IDC_SVR_CHANGEADDR,144,27,77,12 + PUSHBUTTON "ÐèÒªÈÏÖ¤(&R)",IDC_SVR_AUTH_YES,41,81,84,12 + PUSHBUTTON "ÔÊÐíδÑéÖ¤µÄ(&U)",IDC_SVR_AUTH_NO,129,81,80,12 + LTEXT "·ÖÇøÊý£º",IDC_STATIC,11,131,90,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SVR_NUMAGGREGATES,108,131,99,8 + LTEXT "×ÜÈÝÁ¿£º",IDC_STATIC,11,148,48,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SVR_CAPACITY,108,148,99,8 + LTEXT "×éºÏµÄ¾íÏ޶",IDC_STATIC,11,165,79,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SVR_ALLOCATION,108,165,99,8 + ICON IDI_SERVER,IDC_STATIC,5,5,20,20 + LTEXT "(·þÎñÆ÷Ãû)",IDC_SVR_NAME,55,13,93,8 + GROUPBOX "°²È«ÐÔ",IDC_STATIC,5,52,216,52 + GROUPBOX "´æ´¢",IDC_STATIC,5,115,216,68 + LTEXT "Äú¿ÉÒÔÒªÇó¶Ô´Ë·þÎñÆ÷µÄ´æÈ¡¶¼±ØÐë¾­¹ýÈÏÖ¤¡£",IDC_STATIC, + 11,67,198,8 +END + +IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 221, 158 +STYLE WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + CONTROL "¸Ã·þÎñÆ÷µÄÈκηÖÇø±ä³É",IDC_SVR_WARN_AGGFULL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,12,18,127,9 + EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,144,16,24,12,ES_AUTOHSCROLL + LTEXT "% Âú",IDC_STATIC,184,18,28,8 + CONTROL "¸Ã·þÎñÆ÷µÄÈκξí±ä³É",IDC_SVR_WARN_SETFULL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,12,32,125,9 + EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,144,30,24,12,ES_AUTOHSCROLL + LTEXT "% Âú",IDC_STATIC,184,32,24,8 + CONTROL "ÈκηÖÇøµÄ×éºÏµÄÏ޶¹ýÆäÈÝÁ¿",IDC_SVR_WARN_AGGALLOC, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,46,200,9 + CONTROL "¸Ã·þÎñÆ÷ÉϵÄÈκηþÎñÍ£Ö¹ÔËÐÐ",IDC_SVR_WARN_SVCSTOP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,60,195,9 + CONTROL "¸Ã·þÎñÆ÷µÄÈκξíûÓÐ VLDB ÌõÄ¿",IDC_SVR_WARN_SETNOVLDB, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,74,195,9 + CONTROL "VLDB ÒýÓø÷þÎñÆ÷ÉϵÄÈκÎÍÑ»ú·ÖÇø", + IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,88,195,9 + CONTROL "VLDB ÒýÓø÷þÎñÆ÷ÉϵÄÈκÎÍÑ»ú¾í",IDC_SVR_WARN_SETNOSERV, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,103,195,9 + CONTROL "ˢзþÎñÆ÷ÐÅÏ¢£¬Ã¿¸ô",IDC_SVR_AUTOREFRESH,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,5,142,116,9 + EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,123,140,27,13,ES_AUTOHSCROLL + LTEXT "·ÖÖÓ",IDC_STATIC,164,142,25,8 + LTEXT "ÏÔʾ¾¯¸æ£¬Èç¹û",IDC_STATIC,5,5,195,8 +END + +IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 225, 207 +STYLE WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + PUSHBUTTON "²é¿´·þÎñÈÕÖ¾(&V)",IDC_SVC_VIEWLOG,47,182,66,14 + PUSHBUTTON "ÏÖÔÚÆô¶¯(&S)",IDC_SVC_START,118,182,49,14 + PUSHBUTTON "ÏÖÔÚÍ£Ö¹(&P)",IDC_SVC_STOP,169,182,49,14 + CONTROL "Èç¹û¸Ã·þÎñÔøÍ£Ö¹¹ý£¬ÏÔʾ¾¯¸æ(&W)",IDC_SVC_WARNSTOP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,159,200,10 + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "·þÎñ %2 (·þÎñÆ÷ %1)",IDC_SVC_NAME,52,13,168,8 + LTEXT "ÀàÐÍ£º",IDC_STATIC,5,29,44,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SVC_TYPE,64,29,155,8 + LTEXT "²ÎÊý£º",IDC_STATIC,5,45,44,8 + EDITTEXT IDC_SVC_PARAMS,64,45,155,13,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP + LTEXT "֪ͨÆ÷£º",IDC_STATIC,5,61,44,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SVC_NOTIFIER,64,61,155,8 + LTEXT "×î½üÒ»´ÎÆô¶¯£º",IDC_STATIC,5,77,57,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SVC_STARTDATE,64,77,155,8 + LTEXT "×î½üÒ»´ÎÍ£Ö¹£º",IDC_STATIC,5,93,57,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SVC_STOPDATE,64,93,155,8 + LTEXT "×î½üÒ»´Îʧ°Ü£º",IDC_STATIC,5,109,57,8 + EDITTEXT IDC_SVC_LASTERROR,64,109,155,13,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + GROUPBOX "·þÎñ״̬",IDC_STATIC,5,127,215,75 + LTEXT "ÕýÔÚÈ·¶¨¸Ã·þÎñµÄµ±Ç°×´Ì¬...",IDC_SVC_STATUS,11,142,200, + 8 +END + +IDD_SET_GENERAL DIALOGEX 0, 0, 273, 214 +STYLE WS_CHILD +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "¾í±êʶ·û£º",IDC_STATIC,5,30,45,8 + LTEXT "(δ֪)",IDC_SET_ID,59,30,208,8 + LTEXT "ÒÑ´´½¨µÄ£º",IDC_STATIC,5,46,45,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_CREATEDATE,59,46,208,8 + LTEXT "ÒѸüеģº",IDC_STATIC,5,62,45,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_UPDATEDATE,59,62,112,8 + LTEXT "ÒÑ´æÈ¡µÄ£º",IDC_STATIC,5,78,45,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_ACCESSDATE,59,78,208,8 + LTEXT "Òѱ¸·ÝµÄ£º",IDC_STATIC,5,94,45,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_BACKUPDATE,59,94,208,8 + LTEXT "Îļþ¼ÆÊý£º",IDC_STATIC,5,110,45,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_FILES,59,110,208,8 + LTEXT "״̬£º",IDC_STATIC,5,126,45,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_STATUS,59,126,75,8 + PUSHBUTTON "Ëø¶¨(&L)",IDC_SET_LOCK,142,124,61,12 + PUSHBUTTON "½âËø(&U)",IDC_SET_UNLOCK,207,124,61,12 + LTEXT "Ó÷¨£º",IDC_STATIC,5,142,45,8 + LTEXT "(ÕýÔÚ²éѯ)",IDC_SET_USAGE,59,142,136,8 + PUSHBUTTON "ÉèÖÃÏÞ¶î(&Q)...",IDC_SET_QUOTA,207,140,61,12 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,49,156,219,8, + WS_EX_STATICEDGE + CONTROL "Èç¹û¸Ã¾íʹÓó¬³öÏ޶ÏÔʾ¾¯¸æ(&W)",IDC_SET_WARN,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,49,170,219,10 + CONTROL "¸Ã·þÎñÆ÷µÄȱʡãÐÖµ(&D) (Æä´óСµÄ %1%%)", + IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,61,185,207,9 + CONTROL "Æä´óСµÄ",IDC_SET_WARN_SETFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,61,199,62,9 + EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,123,197,29,12, + ES_AUTOHSCROLL + LTEXT "% ãÐÖµ(&T)",IDC_SET_WARN_SETFULL_DESC,163,199,105,8 + ICON IDI_FILESET,IDC_STATIC,5,5,20,20 + LTEXT "¾í %3 (·þÎñÆ÷ %1£¬·ÖÇø %2)",IDC_SET_NAME,49,14,219,8 +END + +IDD_MAIN DIALOGEX 0, 0, 317, 226 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | + WS_SYSMENU | WS_THICKFRAME +CAPTION "AFS ·þÎñÆ÷¹ÜÀíÆ÷" +MENU MENU_MAIN +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "ËùÑ¡µ¥Ôª£º",IDC_STATIC,2,8,55,8 + LTEXT "(µ¥ÔªÃû½«·ÅÓÚ´Ë)",IDC_CELL,62,8,222,9 + LTEXT "AFS ÁîÅÆ£º",IDC_STATIC,2,19,55,8 + LTEXT "%2:%1(ÁîÅÆ½«ÔÚ %3 µ½ÆÚ)",IDC_AFS_ID,62,19,222,9 + CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,31,313, + 193,WS_EX_CLIENTEDGE + CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 + ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 +STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "·þÎñÆ÷" +CLASS "ServerWindowClass" +FONT 9, "ËÎÌå" +BEGIN + CONTROL "",IDC_TABS,"SysTabControl32",0x0,2,2,205,133 +END + +IDD_SVC_CREATE DIALOGEX 0, 0, 225, 233 +STYLE WS_CHILD +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,5,36,44,8 + COMBOBOX IDC_SVC_SERVER,57,33,116,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "·þÎñ(&V)£º",IDC_STATIC,5,52,44,8 + COMBOBOX IDC_SVC_NAME,57,50,116,104,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ÃüÁî(&C)£º",IDC_STATIC,5,70,44,8 + EDITTEXT IDC_SVC_COMMAND,57,68,163,13,ES_AUTOHSCROLL + LTEXT "²ÎÊý(&P)£º",IDC_STATIC,5,88,44,8 + EDITTEXT IDC_SVC_PARAMS,57,86,163,13,ES_AUTOHSCROLL + LTEXT "֪ͨÆ÷(&N)£º",IDC_STATIC,5,105,44,8 + EDITTEXT IDC_SVC_NOTIFIER,57,103,163,13,ES_AUTOHSCROLL + LTEXT "ÈÕÖ¾Îļþ(&L)£º",IDC_STATIC,5,122,52,8 + EDITTEXT IDC_SVC_LOGFILE,57,120,163,13,ES_AUTOHSCROLL + CONTROL "¼òµ¥(&I)(²»¼ä¶ÏÔËÐÐ)",IDC_SVC_TYPE_SIMPLE,"Button", + BS_AUTORADIOBUTTON,11,154,201,10 + CONTROL "ÏÖÔÚÆô¶¯¸Ã·þÎñ(&T)",IDC_SVC_RUNNOW,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 + CONTROL "&FS (Îļþϵͳ)",IDC_SVC_TYPE_FS,"Button", + BS_AUTORADIOBUTTON,11,180,201,10 + CONTROL "C&ron (ÔÚÖ¸¶¨¼ä¸ôÔËÐÐ)",IDC_SVC_TYPE_CRON,"Button", + BS_AUTORADIOBUTTON,11,195,201,10 + LTEXT "ºÎʱÔËÐÐ(&W)£º",IDC_STATIC,23,209,52,8 + COMBOBOX IDC_SVC_RUNDAY,75,207,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,148,207, + 68,13,WS_EX_CLIENTEDGE + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "н¨·þÎñ",IDC_SVC_DESC,52,13,168,8 + GROUPBOX "·þÎñÀàÐÍ",IDC_STATIC,5,141,215,87 +END + +IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 +STYLE WS_CHILD +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, + 199,58,WS_EX_CLIENTEDGE + PUSHBUTTON "ÏÖÔÚÊÍ·Å(&R)",IDC_SET_RELEASE,11,143,52,14 + PUSHBUTTON "´´½¨(&C)...",IDC_SET_REPSITE_ADD,108,143,47,14 + PUSHBUTTON "ɾ³ý(&L)",IDC_SET_REPSITE_DELETE,162,143,47,14 + LTEXT "·þÎñÆ÷£º",-1,11,31,37,8 + LTEXT "(·þÎñÆ÷Ãû)",IDC_SET_SERVER,55,31,147,8 + LTEXT "·ÖÇø£º",-1,11,44,37,8 + LTEXT "(·ÖÇøÃû)",IDC_SET_AGGREGATE,55,44,147,8 + LTEXT "¾í£º",-1,11,18,37,8 + LTEXT "(¾íÃû)",IDC_SET_NAME,55,18,147,8 + GROUPBOX "¶Á£¯Ð´¾í",-1,5,5,211,56 + GROUPBOX "¾í¸±±¾",-1,5,67,211,96 +END + +IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 257 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ñ¡Ôñµ¥Ôª - AFS ·þÎñÆ÷¹ÜÀíÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "µ¥Ôª(&C)£º",IDC_STATIC,4,24,38,8 + COMBOBOX IDC_OPENCELL_CELL,45,22,170,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + GROUPBOX "AFS ÈÏÖ¤",IDC_STATIC,4,44,211,92 + LTEXT "AFS Éí·Ý(&I)£º",IDC_STATIC,22,100,55,8 + EDITTEXT IDC_OPENCELL_ID,80,98,129,14,ES_AUTOHSCROLL + LTEXT "AFS ¿ÚÁî(&P)£º",IDC_STATIC,22,116,55,8 + EDITTEXT IDC_OPENCELL_PASSWORD,80,114,129,14,ES_PASSWORD | + ES_AUTOHSCROLL + PUSHBUTTON "¸ß¼¶(&V) >>",IDC_ADVANCED,4,146,53,14 + DEFPUSHBUTTON "È·¶¨",IDOK,86,146,41,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,130,146,41,14 + PUSHBUTTON "°ïÖú(&H)",9,174,146,41,14 + CONTROL "¼àÊӸõ¥ÔªµÄËùÓзþÎñÆ÷(&L)",IDC_MON_ALL,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,10,204,185,9 + CONTROL "½ö¼àÊÓÒ»¸ö·þÎñÆ÷(&M)£º",IDC_MON_ONE,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,10,219,110,10 + EDITTEXT IDC_MON_SERVER,125,218,83,13,ES_AUTOHSCROLL + CONTROL "½ö¼àÊÓ×Ó¼¯ÖеķþÎñÆ÷(&S)£º",IDC_MON_SOME,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,10,235,110,10 + COMBOBOX IDC_MON_SUBSET,125,233,83,93,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Ñ¡ÔñÄúÏ£ÍûʹÓÃµÄ AFS µ¥Ôª¡£",IDC_STATIC,4,7,200,8 + GROUPBOX "¼àÊÓ·þÎñÆ÷",IDC_ADVANCED_GROUP,4,169,211,84 + LTEXT "ΪÁ˵õ½¸ü¿ìËÙµÄÐÔÄÜ£¬Äú¿ÉÒÔÑ¡Ôñ½ö¼àÊӸõ¥ÔªÖпÉÓõķþÎñÆ÷×Ó¼¯¡£", + IDC_STATIC,10,182,199,17 + LTEXT "(ÕýÔÚ²éѯ...)",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "Òª¹ÜÀíµ¥Ôª£¬±ØÐëÖØÐÂÊäÈëÄúµÄ AFS ¿ÚÁ",IDC_STATIC,10, + 85,196,8 + LTEXT "ÄúÔÚËùÑ¡µ¥ÔªÄڵĵ±Ç° AFS ÁîÅÆ£º",IDC_STATIC,10,57,196,8 +END + +IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "¾¯¸æ - AFS ·þÎñÆ÷¹ÜÀíÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + CONTROL "¼ÌÐøµÈ´ýÖ±ÖÁÈÎÎñÕý³£Íê³É(&C)",IDC_TIMEOUT_WAIT,"Button", + BS_AUTORADIOBUTTON,24,87,208,10 + CONTROL "ÖÕÖ¹ÈÎÎñ(&T)",IDC_TIMEOUT_KILL,"Button", + BS_AUTORADIOBUTTON,24,101,208,10 + DEFPUSHBUTTON "È·¶¨",IDOK,93,139,50,14 + LTEXT "ÈÎÎñÒÑÔËÐеÄʱ¼ä£º",IDC_STATIC,4,119,142,8 + LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,151,119,32,8 + LTEXT "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÒѾ­µÈ´ýÁ˺ܳ¤Ò»¶Îʱ¼ä£¬ÍøÂçÈÎÎñ»¹Î´Íê³É¡£", + IDC_STATIC,4,7,228,18 + LTEXT "Äú¿ÉÒÔÈÃÈÎÎñ¼ÌÐøÔËÐÐ(½¨Òé)£¬»òÕßÈç¹ûÄúÈ·ÐÅÈÎÎñÎÞ·¨Íê³É£¬Äú¿ÉÒÔÔÊÐí AFS ·þÎñÆ÷¹ÜÀíÆ÷ÖÕÖ¹ÈÎÎñ¡£", + IDC_STATIC,4,30,228,26 + LTEXT "Çë×¢ÒâÏÔʾ¸Ã´°¿Úʱ£¬ÈÎÎñÈÔÔÚÔËÐУ»Èç¹ûÈÎÎñÍê³É£¬¸Ã´°¿Ú»á×Ô¶¯¹Ø±Õ¡£", + IDC_STATIC,4,63,228,17 +END + +IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 +STYLE WS_POPUP | WS_CAPTION +CAPTION "ÁÐ" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "Ñ¡ÔñÁÐʾʱÏÔʾµÄÁÐ(&S)£º",IDC_STATIC,5,7,126,8 + COMBOBOX IDC_COLUMNS,134,5,147,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "¿ÉÓõÄÁÐ(&C)£º",IDC_STATIC,12,40,100,8 + LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LTEXT "ÒªÏÔʾµÄÁÐ(&I)£º",IDC_STATIC,173,41,100,8 + LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Ìí¼Ó(&A) >>",IDC_COL_INSERT,119,68,46,14 + PUSHBUTTON "<< ³ýÈ¥(&R)",IDC_COL_DELETE,119,88,46,14 + PUSHBUTTON "ÏòÉÏÒÆ¶¯(&U)",IDC_COL_UP,173,122,48,14 + PUSHBUTTON "ÏòÏÂÒÆ¶¯(&D)",IDC_COL_DOWN,224,122,48,14 + GROUPBOX "ÁгöÁÐ",IDC_STATIC,5,25,276,118 +END + +IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 264, 72 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "ˢР- AFS ·þÎñÆ÷¹ÜÀíÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, + 256,8 + LTEXT "Íê³É 0%%",IDC_REFRESH_PERCENT,4,49,216,8 + LTEXT "",IDC_REFRESH_CURRENT,4,60,216,8 + LTEXT "ÇëµÈ´ý...",IDC_REFRESH_DESC,4,7,256,25 + PUSHBUTTON "Ìø¹ý(&S)",IDC_REFRESH_SKIP,222,58,38,12,NOT WS_TABSTOP +END + +IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "´´½¨¾í" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "Ãû³Æ(&N)£º",IDC_STATIC,4,30,39,8 + EDITTEXT IDC_SET_NAME,50,28,116,14,ES_AUTOHSCROLL + LTEXT "ÏÞ¶î(&Q)£º",IDC_STATIC,4,48,39,8 + EDITTEXT IDC_SET_QUOTA,50,46,32,14,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,94,47,30,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "±¸·Ý(&B)£º",IDC_STATIC,4,66,39,8 + CONTROL "ͬʱ´´½¨¸Ã¾íµÄÒ»¸ö±¸·Ý°æ±¾(&R)",IDC_SET_CLONE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,50,66,162,8 + LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,4,84,46,8 + COMBOBOX IDC_SET_SERVER,50,82,116,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "·ÖÇø(&P)£º",IDC_STATIC,4,102,39,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,46,102,271, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "È·¶¨",IDOK,156,191,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,211,191,50,14 + PUSHBUTTON "°ïÖú(&H)",9,267,191,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "н¨¾í",IDC_STATIC,46,12,170,8 +END + +IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 307, 103 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ɾ³ý¾í" +FONT 9, "ËÎÌå" +BEGIN + DEFPUSHBUTTON "È¡Ïû",IDCANCEL,199,85,50,14 + PUSHBUTTON "È·¶¨",IDOK,144,85,50,14 + PUSHBUTTON "°ïÖú(&H)",9,253,85,50,14 + CONTROL "´Ó·þÎñÆ÷ %1£¬·ÖÇø %2 ÉÏɾ³ý¾í %3(&D)",IDC_DELSET_SERVER, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,61,45,242,10 + CONTROL "ɾ³ý¾í %3 µÄ VLDB ÌõÄ¿(&V)",IDC_DELSET_VLDB,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,61,60,242,10 + ICON 32515,IDC_STATIC,4,7,21,21 + LTEXT "×¢Ò⣡\n\n¸Ã²Ù×÷½«µ¼ÖÂÓÀ¾Ãɾ³ý¾í %3",IDC_DELSET_DESC,61, + 7,242,33 +END + +IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "±¸·Ý¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + DEFPUSHBUTTON "È·¶¨",IDOK,183,67,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,237,67,50,14 + PUSHBUTTON "°ïÖú(&H)",9,291,67,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,21,20 + LTEXT "¾í±¸·ÝÀàËÆÓڸþíµÄÖ»¶Á¸±±¾¡£¶Á£¯Ð´¾íÖ»ÄÜÓÐÒ»¸ö±¸·Ý°æ±¾¡£", + IDC_STATIC,34,9,307,17 + LTEXT "µ¥»÷È·¶¨À´Îª·þÎñÆ÷ %1£¬·ÖÇø %2 Éϵľí %3 ´´½¨Ò»¸ö±¸·Ý¡£ Èç¹û¸Ã¾íÒÑ´æÔÚ±¸·Ý£¬»á×Ô¶¯¸üС£", + IDC_CLONE_DESC,34,32,307,24 +END + +IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 +STYLE WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + GROUPBOX "ÒÑÖªÎÊÌâ",IDC_PROBLEM_BOX,5,36,215,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,138,120,61,12 + ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "·þÎñ %2 (·þÎñÆ÷ %1)",IDC_PROBLEM_TITLE,52,13,168,8 +END + +IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 +STYLE WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + GROUPBOX "ÒÑÖªÎÊÌâ",IDC_PROBLEM_BOX,5,36,216,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,172,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,201,49,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,136,120,61,12 + ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "%1",IDC_PROBLEM_TITLE,42,13,179,8 +END + +IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 +STYLE WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + GROUPBOX "ÒÑÖªÎÊÌâ",IDC_PROBLEM_BOX,5,35,247,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,170,119,61,12 + ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "·ÖÇø %2 (·þÎñÆ÷ %1)",IDC_PROBLEM_TITLE,38,14,214,8 +END + +IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 +STYLE WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + GROUPBOX "ÒÑÖªÎÊÌâ",IDC_PROBLEM_BOX,5,35,263,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,249,48,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 + ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "¾í %3 (·þÎñÆ÷ %1£¬·ÖÇø %2)",IDC_PROBLEM_TITLE,49,14,219, + 8 +END + +IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ÒÆ¶¯¾í" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,70,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "È·¶¨",IDOK,115,156,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,169,156,50,14 + PUSHBUTTON "°ïÖú(&H)",9,223,156,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,21,20 + LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,242,24 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 + LTEXT "ÒÆ¶¯¾íµ½(&M)£º",IDC_STATIC,4,43,116,8 +END + +IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "ÒÆ¶¯¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "´Ó·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏÒÆ¶¯¾í %3 µ½·þÎñÆ÷ %4 µÄ·ÖÇø %5...", + IDC_MOVESET_DESC,4,41,229,19 +END + +IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 277, 106 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "²é¿´ÈÕÖ¾Îļþ" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "²é¿´ÈÕÖ¾ÎļþµÄ·þÎñÆ÷(&S)£º",IDC_STATIC,4,45,109,8 + COMBOBOX IDC_VIEWLOG_SERVER,116,43,126,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "·þÎñÆ÷ÉÏÒª²é¿´µÄÎļþ(&F)£º",IDC_STATIC,4,64,109,8 + EDITTEXT IDC_VIEWLOG_FILENAME,116,62,157,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È·¶¨",IDOK,169,88,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,223,88,50,14 + ICON IDI_SERVICE,IDC_STATIC,4,4,20,20 + LTEXT "ÇëÊäÈëÄúÏ£Íû²é¿´µÄÈÕÖ¾ÎļþµÄ¾ø¶Ô·¾¶¡£", + IDC_VIEWLOG_DESC,31,10,242,21 +END + +IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 286, 185 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "²é¿´ÈÕÖ¾Îļþ" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "ÎļþĿ¼£º",IDC_SVC_VIEWLOG_CONTENTS,4,41,277,8 + EDITTEXT IDC_VIEWLOG_TEXT,4,51,277,113,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL + PUSHBUTTON "Áí´æÎª(&A)...",IDC_VIEWLOG_SAVEAS,173,167,53,14 + DEFPUSHBUTTON "¹Ø±Õ(&C)",IDOK,231,167,50,14 + ICON IDI_SERVICE,-1,4,7,20,20 + LTEXT "ÔÚ·þÎñÆ÷ %1 ÉϵÄ[·þÎñ %2 µÄ]ÈÕÖ¾Îļþ", + IDC_SVC_VIEWLOG_DESC,33,7,248,8 + LTEXT "·þÎñÆ÷ÉϵÄÎļþÃû£º%1",IDC_SVC_VIEWLOG_FILENAME,33,23, + 248,8 +END + +IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ÉèÖþíÏÞ¶î" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "µ±Ç°Ï޶",IDC_STATIC,4,49,47,8 + LTEXT "(δ֪)",IDC_SET_USAGE,59,49,208,8 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,59,60,208,8, + WS_EX_STATICEDGE + LTEXT "ÐÂÏÞ¶î(&Q)£º",IDC_STATIC,4,81,47,8 + EDITTEXT IDC_SET_QUOTA,59,79,32,13,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,103,79,30,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "È·¶¨",IDOK,109,112,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,163,112,50,14 + PUSHBUTTON "°ïÖú(&H)",9,217,112,50,14 + PUSHBUTTON "ÌØÐÔ(&P)...",IDC_AGG_PROPERTIES,212,28,55,12 + LTEXT "·ÖÇø£º",IDC_STATIC,4,30,47,8 + LTEXT "·þÎñÆ÷ %1 µÄ·ÖÇø %2",IDC_SET_AGGREGATE,59,30,141,8 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "¾í %1",IDC_SET_NAME,59,11,208,8 +END + +IDD_ACTIONS DIALOGEX 0, 0, 236, 58 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_TOOLWINDOW +CAPTION "ÕýÔÚ½øÐеIJÙ×÷ - AFS ·þÎñÆ÷¹ÜÀíÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "ÏÂÁвÙ×÷ÕýÔÚ½øÐУº",IDC_ACTION_DESC,2,2,232,8 + CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | + 0x3,2,14,232,43 +END + +IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ͬ²½ VLDB" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + DEFPUSHBUTTON "È·¶¨",IDOK,107,81,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,161,81,50,14 + PUSHBUTTON "°ïÖú(&H)",9,215,81,50,14 + ICON 32515,IDC_STATIC,4,4,21,20 + LTEXT "(ÔËÐÐʱÉèÖÃ)",IDC_SYNC_DESC,37,4,228,32 + LTEXT "(ÔËÐÐʱÉèÖÃ)",IDC_SYNC_DESC2,37,44,228,24 +END + +IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "¸´Öƾí" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,62,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "È·¶¨",IDOK,115,153,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,169,153,50,14 + PUSHBUTTON "°ïÖú(&H)",9,223,153,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,21,20 + LTEXT "¾í %3 µÄи±±¾",IDC_SET_NAME,31,12,242,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 + LTEXT "´´½¨¸Ã¾íµÄÒ»¸öи±±¾ÔÚ(&C)£º",IDC_STATIC,4,35,125,8 +END + +IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 248, 156 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "°²×°Îļþ" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "Ô´Îļþ(&F)£º",IDC_STATIC,4,74,49,8 + EDITTEXT IDC_FILENAME,66,72,126,14,ES_AUTOHSCROLL + PUSHBUTTON "ä¯ÀÀ(&B)...",IDC_BROWSE,194,72,50,14 + LTEXT "Ä¿±ê·þÎñÆ÷(&S)£º",IDC_STATIC,4,93,60,8 + COMBOBOX IDC_SERVER,66,92,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Ä¿±êÃû³Æ(&N)£º",IDC_STATIC,4,114,60,8 + EDITTEXT IDC_DIRECTORY,66,112,135,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È·¶¨",IDOK,86,138,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,140,138,50,14 + PUSHBUTTON "°ïÖú(&H)",9,194,138,50,14 + ICON IDI_INSTALL,IDC_STATIC,4,4,20,20 + LTEXT "ÔÚ·þÎñÆ÷Éϰ²×°Îļþ",IDC_STATIC,32,12,127,8 + LTEXT "(ÔËÐÐʱÉèÖõÄÎı¾)\n(ÔËÐÐʱÉèÖõÄÎı¾)\n(ÔËÐÐʱÉèÖõÄÎı¾)\n(ÔËÐÐʱÉèÖõÄÎı¾)", + IDC_INSTALL_DESC,4,29,240,33 +END + +IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "жװÎļþ" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,4,66,52,8 + COMBOBOX IDC_SERVER,58,64,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Ä¿±êÎļþ(&F)£º",IDC_STATIC,4,85,52,8 + EDITTEXT IDC_FILENAME,58,83,175,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È·¶¨",IDOK,88,121,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,141,121,50,14 + PUSHBUTTON "°ïÖú(&H)",9,194,121,50,14 + ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 + LTEXT "´Ó·þÎñÆ÷жװÎļþ",IDC_STATIC,32,12,127,8 + LTEXT "¸Ã²Ù×÷ÔÊÐíÄúÔÚÒ»¸öÌØÊâ·þÎñÆ÷Éϻָ´Ò»¸öÔ¤ÏȰ²×°µÄÎļþµÄ¸±±¾¡£Èç¹ûËùÑ¡ÎļþÎÞ´ËÀั±¾´æÔÚ£¬½«³ýÈ¥¸ÃÎļþ¡£", + IDC_STATIC,4,29,240,26 +END + +IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 200, 141 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ɾ³ý¾ÉÎļþ" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "·þÎñÆ÷£º",-1,4,56,44,8 + COMBOBOX IDC_SERVER,53,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "ɾ³ýËùÓкËÐÄÎļþ(&C)",IDC_OP_DELETE_CORE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,53,73,143,10 + CONTROL "ɾ³ý.BAKÀ©Õ¹ÃûÎļþ(Îļþ±¸·Ý)(&B)",IDC_OP_DELETE_BAK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,84,143,10 + CONTROL "ɾ³ý.OLDÀ©Õ¹ÃûÎļþ(¾ÉÎļþ±¸·Ý)(&O)",IDC_OP_DELETE_OLD, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,95,143,10 + DEFPUSHBUTTON "È·¶¨",IDOK,39,123,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,93,123,50,14 + PUSHBUTTON "°ïÖú(&H)",9,146,123,50,14 + ICON IDI_PRUNE,-1,4,4,20,20 + LTEXT "´Ó·þÎñÆ÷ÉÏɾ³ý¾ÉÎļþ",-1,32,12,101,8 + LTEXT "¸Ã²Ù×÷ɾ³ýÔÚÌØ¶¨·þÎñÆ÷ÉϵÄÎļþ±¸·Ý¡£",-1,4,29,192,16 + LTEXT "ɾ³ýÎļþ£º",-1,4,73,45,8 +END + +IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ÖØÃüÃû¾í" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "¾ÉÃû³Æ(&O)£º",IDC_STATIC,31,67,46,8 + EDITTEXT IDC_RENSET_OLD,88,65,122,14,ES_AUTOHSCROLL | ES_READONLY + LTEXT "ÐÂÃû³Æ(&N)£º",IDC_STATIC,31,85,46,8 + EDITTEXT IDC_RENSET_NEW,88,83,122,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È·¶¨",IDOK,115,115,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,169,115,50,14 + PUSHBUTTON "°ïÖú",9,223,115,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "ÒªÖØÃüÃû¾í %3£¬ÔÚÏÂÃæÊäÈëÒ»¸öÐÂÃû³Æ¡£ÖØÃüÃû»á×Ô¶¯¸ü¸Ä¾íµÄ±¸·ÝºÍËùÓи±±¾µÄÃû³Æ¡£\n\n×¢Ò⣺Èç¹ûÄúÖØÃüÃûÒ»¸ö°²×°µÄ¾í£¬Äú±ØÐëɾ³ý²¢ÖØÐ´´½¨Æä°²×°µã¡£", + IDC_RENSET_DESC,31,7,242,48 +END + +IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 277, 68 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ɾ³ý·þÎñ" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + DEFPUSHBUTTON "È¡Ïû",IDCANCEL,169,50,50,14 + PUSHBUTTON "È·¶¨",IDOK,115,50,50,14 + PUSHBUTTON "°ïÖú",9,223,50,50,14 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "×¢Ò⣡\n\n¸Ã²Ù×÷½«µ¼Ö·þÎñ %2 Í£Ö¹²¢´Ó·þÎñÆ÷ %1 ÉÏÓÀ¾Ãɾ³ý", + IDC_DELSVC_DESC,31,7,242,33 +END + +IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "»ñµÃÎļþÈÕÆÚ" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "·þÎñÆ÷(&S)£º",-1,4,56,68,8 + COMBOBOX IDC_SERVER,74,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Òª²éѯµÄÎļþ(&F)£º",-1,4,75,68,8 + EDITTEXT IDC_FILENAME,74,73,135,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È·¶¨",IDOK,86,107,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,140,107,50,14 + PUSHBUTTON "°ïÖú(&H)",9,194,107,50,14 + ICON IDI_GETDATES,-1,4,4,20,20 + LTEXT "»ñµÃ·þÎñÆ÷ÉϵÄÎļþÈÕÆÚ",-1,32,12,127,8 + LTEXT "¸Ã²Ù×÷»ñµÃÎļþ¼°Æä±¸·Ý(Èç¹û´æÔڵϰ)×î½üÒ»´ÎÐ޸ĵÄÈÕÆÚ¡£", + -1,4,29,240,16 +END + +IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "»ñµÃÎļþÈÕÆÚ - ½á¹û" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "·þÎñÆ÷£º",IDC_STATIC,4,30,39,8 + LTEXT "(ÔËÐÐʱÉèÖÃ)",IDC_SERVER,56,30,137,8 + LTEXT "ÎļþÃû£º",IDC_STATIC,4,45,39,8 + LTEXT "(ÔËÐÐʱÉèÖÃ)",IDC_FILENAME,56,45,137,8 + LTEXT "ÎļþÈÕÆÚ£º",IDC_STATIC,4,60,45,8 + LTEXT "(δ֪£»ÎÞ·¨ÕÒµ½Îļþ)",IDC_DATE_FILE,56,60,188,8 + LTEXT ".BAK ÈÕÆÚ£º",IDC_STATIC,4,75,45,8 + LTEXT "(δ֪£»ÎÞ·¨ÕÒµ½Îļþ)",IDC_DATE_BAK,56,75,188,8 + LTEXT ".OLD ÈÕÆÚ£º",IDC_STATIC,4,90,45,8 + LTEXT "(δ֪£»ÎÞ·¨ÕÒµ½Îļþ)",IDC_DATE_OLD,56,90,188,8 + DEFPUSHBUTTON "¹Ø±Õ(&C)",IDOK,99,114,50,14 + ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 + LTEXT "»ñµÃ·þÎñÆ÷ÉϵÄÎļþÈÕÆÚ",IDC_STATIC,32,12,127,8 +END + +IDD_SET_DUMP DIALOGEX 0, 0, 295, 144 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ת´¢¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "´´½¨×ª´¢Îļþ²¢ÃüÃûΪ(&N)£º",IDC_STATIC,4,42,100,8 + EDITTEXT IDC_DUMP_FILENAME,106,40,132,14,ES_AUTOHSCROLL + PUSHBUTTON "ä¯ÀÀ(&B)...",IDC_DUMP_BROWSE,241,40,50,14 + CONTROL "ת´¢¾í %3 ËùÓеÄÄÚÈÝ(·ÖÇø %1:%2)",IDC_DUMP_FULL,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,10,78,274,10 + CONTROL "½öת´¢×ÔÓÒÃæÊ±¼äÒÔÀ´¸ü¸ÄµÄÎļþ(&S)",IDC_DUMP_LIMIT_TIME, + "Button",BS_AUTORADIOBUTTON,10,93,153,10 + CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,170,93,51, + 13,WS_EX_CLIENTEDGE + CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,228,93,56, + 13,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "È·¶¨",IDOK,131,126,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,185,126,50,14 + PUSHBUTTON "°ïÖú(&H)",9,241,126,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "¸Ã²Ù×÷¸´ÖÆÒ»¸ö¾íµÄÄÚÈݵ½Ò»¸öµ¥¶ÀÎļþ£¬ÒÔ±ã¸Ã¾í¿ÉÒÔ·½±ãµØ±¸·Ý¡£ÕâÑùת´¢µÄ¾íÄÚÈÝÒÔºó¿ÉÒÔ»Ö¸´¡£", + IDC_STATIC,30,7,261,24 + GROUPBOX "ת´¢²ÎÊý",IDC_STATIC,4,62,287,53 +END + +IDD_SET_RESTORE DIALOGEX 0, 0, 292, 248 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "»Ö¸´¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "Òª»Ö¸´µÄÎļþ(&R)£º",IDC_STATIC,4,33,70,8 + EDITTEXT IDC_RESTORE_FILENAME,75,30,157,14,ES_AUTOHSCROLL + PUSHBUTTON "ä¯ÀÀ(&B)...",IDC_RESTORE_BROWSE,238,30,50,14 + CONTROL "ÕâÊÇÒ»¸öÔöÁ¿×ª´¢Îļþ(&I)",IDC_RESTORE_INCREMENTAL, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,75,46,114,10 + LTEXT "¾í(&V)£º",IDC_STATIC,11,102,31,8 + EDITTEXT IDC_RESTORE_SETNAME,57,100,115,14,ES_AUTOHSCROLL + LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,11,145,44,8 + COMBOBOX IDC_RESTORE_SERVER,57,143,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "·ÖÇø(&P)£º",IDC_STATIC,11,162,36,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,50,161,231, + 55,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "È·¶¨",IDOK,128,230,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,183,230,50,14 + PUSHBUTTON "°ïÖú(&H)",9,238,230,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "´Óת´¢Îļþ»Ö¸´¾í",IDC_STATIC,33,11,224,8 + GROUPBOX "Ä¿±ê¾í",IDC_STATIC,4,63,284,160 + LTEXT "µ±Äú´Óת´¢Îļþ»Ö¸´¾íʱ£¬¿ÉÒÔ´´½¨Ò»¸öоí»ò¸²¸ÇÒ»¸öÏÖÓеĶÁ/д¾í¡£", + IDC_STATIC,11,78,259,16 + LTEXT "(ÔËÐÐʱÉèÖÃ)\n(ÔËÐÐʱÉèÖÃ)",IDC_RESTORE_CREATE,57,119, + 229,17 +END + +IDD_SVC_BOS DIALOGEX 0, 0, 225, 207 +STYLE WS_CHILD +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + CONTROL "ÖÜÆÚÐÔÍ£Ö¹ºÍÖØÐÂÆô¶¯¸Ã·þÎñÆ÷ÉϵÄËùÓзþÎñ(&P)", + IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, + 71,193,10 + LTEXT "ÖØÐÂÆô¶¯(&R)",IDC_BOS_GENRES_DESC1,17,87,47,8 + COMBOBOX IDC_BOS_GENRES_DATE,68,84,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "ÔÚ(&A)",IDC_BOS_GENRES_DESC2,139,87,20,8 + CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,164, + 84,53,13,WS_EX_CLIENTEDGE + CONTROL "Ϊжþ½øÖÆÎļþÖÜÆÚÐÔ²âÊԸ÷þÎñÆ÷ÉϵÄËùÓзþÎñ(&B)", + IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, + 151,201,10 + LTEXT "²âÊÔ(&S)",IDC_BOS_BINRES_DESC1,17,167,33,8 + COMBOBOX IDC_BOS_BINRES_DATE,68,164,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "ÔÚ(&T)",IDC_BOS_BINRES_DESC2,139,167,20,8 + CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,164, + 164,53,13,WS_EX_CLIENTEDGE + ICON IDI_BOSSERVICE,IDC_STATIC,5,5,20,20 + LTEXT "·þÎñ %2 (·þÎñÆ÷ %1)",IDC_SVC_NAME,52,13,168,8 + GROUPBOX "BOS ·þÎñ",IDC_STATIC,5,27,215,175 + LTEXT "BOS ·þÎñÄÜÓÃÀ´ÖÜÆÚÐÔÍ£Ö¹ºÍÖØÐÂÆô¶¯¸Ã·þÎñÆ÷ÉϵÄËùÓзþÎñ(°üÀ¨ BOS ·þÎñ±¾Éí)¡£", + IDC_STATIC,11,45,200,18 + LTEXT "BOS ·þÎñÒ²ÄÜÓÃÀ´ÖÜÆÚÐÔ²âÊÔ·þÎñÆ÷ÉϵÄËùÓзþÎñ£¬½öÍ£Ö¹ºÍÖØÐÂÆô¶¯¶þ½øÖÆÎļþÒѸüеķþÎñ¡£", + IDC_STATIC,11,118,200,25 +END + +IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "ת´¢¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "´Ó¾í %3 ´´½¨×ª´¢Îļþ %4...",IDC_DUMPSET_DESC,4,41,229, + 19 +END + +IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "»Ö¸´¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "´Óת´¢Îļþ %2 »Ö¸´¾í %1...",IDC_RESTORESET_DESC,4,41, + 229,19 +END + +IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 258, 163 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "±¸·Ý¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + CONTROL "´´½¨¸Ãµ¥ÔªÖеÄËùÓоíµÄ±¸·Ý°æ±¾(&A)",IDC_CLONE_ALL, + "Button",BS_AUTORADIOBUTTON,30,53,214,10 + GROUPBOX " ",IDC_STATIC,23,68,231,67 + CONTROL "½öΪ·ûºÏÏÂÁбê×¼µÄ¾í´´½¨±¸·Ý(&O)£º",IDC_CLONE_SOME, + "Button",BS_AUTORADIOBUTTON,43,67,200,11 + CONTROL "½ö¶Ô·þÎñÆ÷Éϵľí(&S)£º",IDC_CLONE_SVR_LIMIT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,41,83,92,10 + COMBOBOX IDC_CLONE_SVR,152,82,85,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "½ö·ÖÇøÉϵľí(&P)£º",IDC_CLONE_AGG_LIMIT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,41,99,97,10 + COMBOBOX IDC_CLONE_AGG,152,98,85,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "½ö¶ÔÒÔÓÒÃæ¿ªÊ¼µÄ¾í£º",IDC_CLONE_PREFIX_LIMIT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,41,116,106,10 + EDITTEXT IDC_CLONE_PREFIX,152,115,85,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È·¶¨",IDOK,95,145,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,149,145,50,14 + PUSHBUTTON "°ïÖú(&H)",9,204,145,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "¾í±¸·ÝÀàËÆÓڸþíµÄÖ»¶Á¸±±¾¡£¶Á£¯Ð´¾íÖ»ÄÜÓÐÒ»¸ö±¸·Ý°æ±¾¡£\n\nÄú¿ÉÒÔͬʱΪ¶à¸ö¾í´´½¨±¸·Ý°æ±¾¡£", + IDC_STATIC,30,7,214,40 +END + +IDD_SUBSETS DIALOGEX 0, 0, 281, 182 +STYLE WS_POPUP | WS_CAPTION +CAPTION "±»¼àÊӵķþÎñÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "×Ó¼¯Ãû³Æ£º",IDC_STATIC,12,77,44,8 + EDITTEXT IDC_SUBSET_NAME,64,75,116,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_TABSTOP + PUSHBUTTON "´ò¿ª(&O)...",IDC_SUBSET_LOAD,181,75,47,14 + PUSHBUTTON "±£´æ(&S)...",IDC_SUBSET_SAVE,231,75,43,14 + CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x153,12,111,193,58,WS_EX_CLIENTEDGE + PUSHBUTTON "¼àÊÓËùÓÐ(&A)",IDC_SUBSET_ALL,211,122,57,14 + PUSHBUTTON "²»¼àÊÓ(&N)",IDC_SUBSET_NONE,211,140,57,14 + LTEXT "µ±ÔÚÒ»½Ï´óµ¥ÔªÖй¤×÷£¬ÏëÒª¸Ä½øÐÔÄÜ£¬Äú¿ÉÒÔÑ¡Ôñ²»¼àÊÓijЩ·þÎñÆ÷ÊÇ·ñ³öÎÊÌâ¡£AFS ·þÎñÆ÷¹ÜÀíÆ÷²»»áÏÔʾδ±»¼àÊӵķþÎñÆ÷ÉÏµÄ¾í¡¢·ÖÇø»ò·þÎñ¡£", + IDC_STATIC,5,5,271,24 + LTEXT "Äú¿ÉÒÔÔÚÈκÎʱ¿ÌÑ¡Ôñ¼àÊÓ(»ò²»¼àÊÓ)·þÎñÆ÷¡£Äú¿ÉÒÔ´´½¨·þÎñÆ÷×Ó¼¯À´Ö¸¶¨Ó¦¼àÊӵķþÎñÆ÷ÁÐ±í¡£", + IDC_STATIC,5,37,271,18 + GROUPBOX "µ±Ç°×Ó¼¯",IDC_STATIC,5,63,271,114 + LTEXT "Òª¼àÊӵķþÎñÆ÷£º",IDC_STATIC,12,95,69,8 +END + +IDD_SUBSET_LOADSAVE DIALOGEX 0, 0, 280, 145 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | + WS_CAPTION | WS_SYSMENU +CAPTION "(ÔËÐÐʱÉèÖõıêÌâ)" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "×Ó¼¯Ãû³Æ(&N)£º",1090,5,112,52,8,SS_NOTIFY + EDITTEXT IDC_SUBSET_NAME,60,110,160,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "´ò¿ª(&O)",IDOK,226,110,50,14 + PUSHBUTTON "È¡Ïû(&L)",IDCANCEL,226,127,50,14 + CONTROL "Áбí1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | + LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,272,82, + WS_EX_CLIENTEDGE + PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT + WS_TABSTOP + PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT + WS_TABSTOP + LTEXT "ÒÑΪ¸Ãµ¥Ôª¶¨ÒåµÄ×Ó¼¯£º",IDC_STATIC,4,6,114,8 +END + +IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "²éÕÒÃüÁî" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + COMBOBOX IDC_FIND_COMMAND,4,38,137,170,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "ÏÔʾ°ïÖú(&H)",IDOK,147,38,67,14 + PUSHBUTTON "È¡Ïû(&C)",IDCANCEL,147,55,67,14 + LTEXT "Òª²éÕÒÈçºÎʹÓà AFS ÕÊ»§¹ÜÀíÆ÷À´Ö´ÐÐÈÎÎñ£¬Ñ¡ÔñÏÂÃæµÄÒ»¸öÃüÁîÐв¢µ¥»÷¡°ÏÔʾ°ïÖú¡±°´Å¥¡£", + IDC_STATIC,4,4,210,25 +END + +IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 141 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "²éÕÒ´íÎó´úÂë" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "´íÎóºÅ(&E)£º",IDC_STATIC,4,41,45,8 + EDITTEXT IDC_ERROR_NUMBER,59,39,78,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "ת»»(&T)",IDC_ERROR_TRANSLATE,147,39,67,14 + PUSHBUTTON "¹Ø±Õ(&C)",IDCANCEL,85,123,48,14 + LTEXT "(ÔËÐÐʱÉèÖõÄÎı¾)",IDC_ERROR_DESC,4,71,210,42 + LTEXT "Òª²éÕÒ´íÎó´úÂëµÄº¬Ò壬ÔÚÏÂÃæÊäÈë´úÂëÈ»ºóµ¥»÷""ת»»""°´Å¥¡£", + IDC_STATIC,4,4,210,25 + CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 +END + +IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "¹ØÓÚ AFS ·þÎñÆ÷¹ÜÀíÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 + LTEXT "AFS ·þÎñÆ÷¹ÜÀíÆ÷£¬°æ±¾ 3.5",IDC_STATIC,33,8,163,8 + LTEXT "°æÈ¨ËùÓÐ(C) IBM ¹«Ë¾ 1989£¬1999",IDC_STATIC,33,20,183,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 + CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 + PUSHBUTTON "¹Ø±Õ(&C)",IDOK,89,123,50,14 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 +END + +IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÕýÔÚµ¥Ôª %1 ÖÐËÑË÷·þÎñÆ÷...", + IDC_OPENCELL_DESC,41,15,183,16 + GROUPBOX "",IDC_STATIC,4,2,231,39 + ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 279, 136 +STYLE WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + CONTROL "Ϊ·þÎñÆ÷ÏÔʾȫÏÞ¶¨ÓòÃû(ÀýÈ磬""machine.company.com"")", + IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,5,269,10 + CONTROL "Èç¹û²»ÓùÜÀíÁîÅÆ¹¤×÷£¬ÏÔʾ¾¯¸æ(&W)", + IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,19,269,10 + CONTROL "...×ÜÊÇÏÔʾ·þÎñÆ÷µÄÌØÐÔ",IDC_OPT_SVR_DBL_PROP,"Button", + BS_AUTORADIOBUTTON,21,50,253,10 + CONTROL "...½öµ±¿ìËٲ鿴ÏÔʾ´°¿Ú´ò¿ªÊ±£¬ÏÔʾ·þÎñÆ÷ÌØÐÔ", + IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON,21, + 63,253,10 + CONTROL "...×ÜÊÇΪ·þÎñÆ÷´ò¿ªÒ»¸ö´°¿Ú",IDC_OPT_SVR_DBL_OPEN, + "Button",BS_AUTORADIOBUTTON,21,75,253,10 + CONTROL "...´ò¿ªÒ»¸ö·þÎñÆ÷´°¿Ú»áʹ¸Ã·þÎñÆ÷´¦ÓÚ±»¼àÊÓ״̬", + IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,21,107,253,10 + CONTROL "...¹Ø±ÕÒ»¸ö·þÎñÆ÷´°¿Ú»áʹ¸Ã·þÎñÆ÷½áÊø±»¼àÊÓ״̬", + IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,21,121,253,10 + LTEXT "Ë«»÷·þÎñÆ÷ͼ±ê...",IDC_STATIC,5,38,269,8 + LTEXT "Èç¹û·þÎñÆ÷×Ó¼¯ÕýÔÚʹÓÃÇÒ¿ìËٲ鿴ÏÔʾ´°¿ÚÊǹرյÄ...", + IDC_STATIC,5,95,269,8 +END + +IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,22,216, + 135,WS_EX_CLIENTEDGE + PUSHBUTTON "Ìí¼Ó·þÎñÆ÷ÃÜÔ¿(&A)",IDC_KEY_ADD,58,160,80,14 + PUSHBUTTON "³ýÈ¥·þÎñÆ÷ÃÜÔ¿(&R)",IDC_KEY_REMOVE,141,160,80,14 + LTEXT "·þÎñÆ÷ÃÜÔ¿£º",IDC_KEY_NAME,5,7,216,8 +END + +IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ìí¼Ó·þÎñÆ÷ÃÜÔ¿" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "°æ±¾£º",IDC_STATIC,7,37,26,8 + EDITTEXT IDC_KEY_VERSION,43,35,43,14,ES_AUTOHSCROLL + LTEXT "Öµ£º",IDC_STATIC,7,58,21,8 + CONTROL "¼ÓÃܸÃ×Ö·û´®£º",IDC_KEY_BYSTRING,"Button", + BS_AUTORADIOBUTTON,43,58,73,10 + CONTROL "ʹÓøÃÃÜÔ¿£º",IDC_KEY_BYDATA,"Button", + BS_AUTORADIOBUTTON,43,76,57,10 + EDITTEXT IDC_KEY_STRING,119,56,155,14,ES_PASSWORD | + ES_AUTOHSCROLL + EDITTEXT IDC_KEY_DATA,119,75,103,14,ES_AUTOHSCROLL + PUSHBUTTON "Ëæ»ú(&R)",IDC_KEY_RANDOM,226,75,48,14 + LTEXT "×¢Ò⣺ÔÚ¶Ô·þÎñÆ÷Ìí¼ÓÐÂÃÜÔ¿ºó£¬Äú±ØÐëÐÞ¸Ä AFS ÕÊ»§ÒÔʹÓÃÐÂÃÜÔ¿¡£¼¸Ììºó£¬Äú¿ÉÒÔ³ýÈ¥ÈκξɵķþÎñÆ÷ÃÜÔ¿¡£", + IDC_STATIC,7,99,267,18 + DEFPUSHBUTTON "È·¶¨",IDOK,116,129,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,170,129,50,14 + PUSHBUTTON "°ïÖú",9,224,129,50,14 + LTEXT "Ϊ·þÎñÆ÷ %1 н¨ÃÜÔ¿",IDC_KEY_TITLE,43,14,181,8 + ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 +END + +IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 277, 132 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Æô¶¯£¯Í£Ö¹·þÎñ" +FONT 9, "ËÎÌå" +BEGIN + DEFPUSHBUTTON "È·¶¨",IDOK,115,114,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,169,114,50,14 + PUSHBUTTON "°ïÖú(&H)",9,223,114,50,14 + ICON IDI_SERVICE,IDC_STATIC,4,7,21,20 + LTEXT "µ¥»÷È·¶¨Æô¶¯£¯Í£Ö¹·þÎñÆ÷ %1 µÄ·þÎñ %2¡£", + IDC_STARTSTOP_TEXT,31,12,242,9 + CONTROL "ÓÀ¾Ã(&P) (IDS_START/STOPSERVICE_PERMANENT)", + IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON,37, + 68,226,10 + CONTROL "ÁÙʱ(&T) (IDS_START/STOPSERVICE_TEMPORARY)", + IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON,37, + 83,226,10 + GROUPBOX "·þÎñÆô¶¯",IDC_STATIC,31,31,242,70 + LTEXT "Äú¿ÉÒÔÓÀ¾Ã±£³Ö¸Ã¸ü¸Ä£¬ÒÔ±ã·þÎñÆ÷ %1 ÖØÐÂÆô¶¯Ê±£¬·þÎñ %2 »á(²»»á)×Ô¶¯Æô¶¯¡£", + IDC_STARTSTOP_STARTUP,38,45,223,16 +END + +IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 248, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Ö´ÐÐÃüÁî" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,4,56,46,8 + COMBOBOX IDC_SERVER,56,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ÃüÁî(&C)£º",IDC_STATIC,4,75,46,8 + EDITTEXT IDC_COMMAND,56,73,188,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È·¶¨",IDOK,86,107,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,140,107,50,14 + PUSHBUTTON "°ïÖú(&H)",9,194,107,50,14 + ICON IDI_SERVER,IDC_STATIC,4,4,20,20 + LTEXT "ÔÚ·þÎñÆ÷ÉÏÖ´ÐÐÃüÁî",IDC_STATIC,32,12,185,8 + LTEXT "¸Ã²Ù×÷ÔÊÐíÄúÔÚÒ»¸öÔ¶³Ì·þÎñÆ÷ÉÏ·¢³öÃüÁî¡£\n Ëü±»µäÐ͵ØÓÃÓÚÖ´ÐÐ /etc/reboot ½Å±¾À´ÖØÐÂÆô¶¯·þÎñÆ÷¡£", + IDC_STATIC,4,29,240,16 +END + +IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 248, 254 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Íì¾È¾í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,30,50,44,8 + COMBOBOX IDC_SERVER,78,48,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "·ÖÇø(&P)£º",IDC_STATIC,30,67,44,8 + COMBOBOX IDC_AGGREGATE,78,65,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Íì¾ÈËùÓзÖÇø(&A)",IDC_AGGREGATE_ALL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,170,67,73,10 + LTEXT "¾í(&O)£º",IDC_STATIC,29,85,44,8 + COMBOBOX IDC_FILESET,78,83,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Íì¾ÈËùÓоí(&L)",IDC_FILESET_ALL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,170,85,73,10 + DEFPUSHBUTTON "È·¶¨",IDOK,85,108,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,139,108,50,14 + PUSHBUTTON "°ïÖú(&H)",9,194,108,50,14 + PUSHBUTTON "¸ß¼¶(&V) >>",IDC_ADVANCED,4,108,53,14 + LTEXT "ÁÙʱÎļþµÄ·¾¶(&T)£º",IDC_STATIC,10,142,76,8 + EDITTEXT IDC_SALVAGE_TEMPDIR,92,141,144,13,ES_AUTOHSCROLL + CONTROL "²¢ÐÐÍì¾È²Ù×÷£»½ø³ÌÊý(&R)£º",IDC_SALVAGE_SIMUL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,29,157,171,10 + EDITTEXT IDC_SALVAGE_NUM,202,156,25,13,ES_AUTOHSCROLL + CONTROL "²»ÒªÍì¾ÈÒÑË𻵵ľí(&N)",IDC_SALVAGE_READONLY,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,29,167,123,10 + CONTROL "½«¶ÁÈ¡²Ù×÷·Ö³ÉС¿é",IDC_SALVAGE_BLOCK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,29,177,139,10 + CONTROL "Ç¿ÖÆÍì¾ÈËùÓÐָʾµÄ¾í(&F)",IDC_SALVAGE_FORCE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,29,187,136,10 + CONTROL "Ç¿ÖÆÖØ½¨Ä¿Â¼½á¹¹(&E)",IDC_SALVAGE_FIXDIRS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,29,197,123,10 + LTEXT "½á¹ûÈÕÖ¾µÄÎļþÃû(&U)£º",IDC_STATIC,10,211,85,8 + EDITTEXT IDC_SALVAGE_LOG_FILE,98,210,144,13,ES_AUTOHSCROLL + CONTROL "½á¹ûÈÕÖ¾ÖаüÀ¨Ë𻵵ÄÄÚ½áµãÁбí(&I)", + IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,30,224,203,10 + CONTROL "½á¹ûÈÕÖ¾ÖаüÀ¨ AFS ÓµÓеĸùÄÚ½áµãÁбí(&W)", + IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,30,235,203,10 + ICON IDI_SERVER,IDC_STATIC,4,7,20,20 + LTEXT "¸Ã²Ù×÷ÔÊÐíÄúÔÚÒ»¸ö»ò¶à¸ö¾íÉÏÐÞÕýÎÊÌâ¡£\n\n×¢Ò⣺Èç¹ûÄúÁ¢¼´Íì¾ÈÕû¸ö·ÖÇø»ò·þÎñÆ÷£¬·þÎñÆ÷»áÁÙʱÍÑ»ú¡£", + IDC_STATIC,30,7,214,32 + GROUPBOX "¸ß¼¶Íì¾ÈÑ¡Ïî",IDC_ADVANCED_GROUP,4,128,240,122 +END + +IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Íì¾È¾í - ½á¹û" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå" +BEGIN + DEFPUSHBUTTON "¹Ø±Õ(&C)",IDOK,232,160,50,14 + LTEXT "Íì¾È²Ù×÷½á¹û£º",IDC_STATIC,4,33,277,8 + EDITTEXT IDC_SALVAGE_DETAILS,4,43,277,113,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP + ICON IDI_SERVER,IDC_STATIC,4,7,21,20 + LTEXT "Íì¾È·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ¾í %3",IDC_SALVAGE_TITLE,33, + 15,248,8 +END + +IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 277, 102 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Êͷží" +FONT 9, "ËÎÌå" +BEGIN + DEFPUSHBUTTON "È·¶¨",IDOK,115,84,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,169,84,50,14 + PUSHBUTTON "°ïÖú(&H)",9,223,84,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "¸Ã²Ù×÷ÔÊÐíÄú¸üоí %3 µÄ¸±±¾¡£Äú¿ÉÒÔÑ¡Ôñ½ö¸üйýʱµÄ¸±±¾£¬»ò¸üÐÂËùÓи±±¾¡£", + IDC_RELSET_DESC,31,7,242,26 + CONTROL "½ö¸üйýʱµÄ¸±±¾(&U)",IDC_RELSET_NORMAL,"Button", + BS_AUTORADIOBUTTON,46,41,173,10 + CONTROL "¼´Ê¹ÓÐδ¹ýʱ¸±±¾£¬Ò²¸üÐÂËùÓоí(&A)",IDC_RELSET_FORCE, + "Button",BS_AUTORADIOBUTTON,46,56,172,10 +END + +IDD_SVR_HOSTS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + PUSHBUTTON "Ìí¼ÓÖ÷»ú·þÎñÆ÷(&A)",IDC_HOST_ADD,59,160,80,14 + PUSHBUTTON "³ýÈ¥Ö÷»ú·þÎñÆ÷(&R)",IDC_HOST_REMOVE,141,160,80,14 + LTEXT "·þÎñÆ÷ʶ±ðµÄÊý¾Ý¿âÖ÷»ú·þÎñÆ÷£º",IDC_HOST_TITLE,5,7,216, + 8 + CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, + 135,WS_EX_CLIENTEDGE +END + +IDD_SVR_ADDHOST DIALOGEX 0, 0, 225, 106 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Ìí¼ÓÖ÷»ú·þÎñÆ÷" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "Ö÷»ú(&H)£º",-1,31,55,38,8 + EDITTEXT IDC_ADDHOST_HOST,71,53,103,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "È·¶¨",IDOK,63,88,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,117,88,50,14 + ICON IDI_SERVER,-1,4,4,20,20 + LTEXT "ÄúÒÑÑ¡ÔñÌí¼ÓÒ»¸öÊý¾Ý¿âÖ÷»ú·þÎñÆ÷µ½´æ´¢ÔÚ·þÎñÆ÷ %1 ÉϵÄÁбíÖС£\n\nÔÚÏÂÃæÊäÈëÐÂÊý¾Ý¿âÖ÷»úÃû¡£", + IDC_ADDHOST_DESC,31,10,190,34 + PUSHBUTTON "°ïÖú",9,171,88,50,14 +END + +IDD_SVR_ADDRESS DIALOGEX 0, 0, 208, 115 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "¸ü¸Ä·þÎñÆ÷µØÖ·" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + LTEXT "Ϊ·þÎñÆ÷ %1 ¼Ç¼ÔÚ VLDB ÖÐµÄ IP µØÖ·£º",IDC_TITLE,4,4, + 200,8 + LISTBOX IDC_SVR_ADDRESSES,4,14,147,40,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "¸ü¸Ä(&C)...",IDC_ADDR_CHANGE,154,24,50,14 + PUSHBUTTON "³ýÈ¥(&R)",IDC_ADDR_REMOVE,154,40,50,14 + DEFPUSHBUTTON "È·¶¨",IDOK,46,97,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,100,97,50,14 + PUSHBUTTON "°ïÖú",9,154,97,50,14 + LTEXT "×¢£ºµ±Îļþ·þÎñÆ÷Æô¶¯Ê±£¬ËüÓà VLDB ×Ô¶¯×¢²áÆäµ±Ç°µÄ IP µØÖ·¡£", + IDC_STATIC,4,64,200,18 +END + +IDD_SVR_NEWADDR DIALOGEX 0, 0, 223, 69 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "¸ü¸Ä IP µØÖ·" +CLASS "AFSManagerClass" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "È·¶¨",IDOK,61,51,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,115,51,50,14 + PUSHBUTTON "°ïÖú",9,169,51,50,14 + LTEXT "ÊäÈëÐ嵀 IP µØÖ·ÒÔÌæ»» VLDB ÖÐµÄ %1£º",IDC_TITLE,4,4, + 215,8 + CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,42,23, + 90,14 + LTEXT "µØÖ·£º",IDC_STATIC,4,26,28,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" +32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" +32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" +IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" +IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" +IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" +IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" +IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" +IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" +IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" +IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" +IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" +IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" +IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" +IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" +IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" +IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" +IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +ACCEL_MAIN ACCELERATORS DISCARDABLE +BEGIN + VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT + VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT + VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT + VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT + VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT + VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT + VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT + VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, + NOINVERT + VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_LISTS_TITLE "·þÎñÆ÷ %1 - ¹ÜÀíÔ±Áбí" + IDS_TAB_SERVICES "·þÎñ" + IDS_TAB_AGGREGATES "·ÖÇø" + IDS_TAB_FILESETS "¾í" + IDS_SERVICE_NONESELECTED "Ñ¡ÔñÒª²é¿´µÄ·þÎñÆ÷¡£" + IDS_SERVICE_GOTSELECTED "ÔÚ·þÎñÆ÷ %1 ÉϽøÐеķþÎñ£º" + IDS_AGGREGATE_ALL "ËùÓзþÎñÆ÷ÉϵķÖÇø£º" + IDS_AGGREGATE_ONE "·þÎñÆ÷ %1 ÉϵķÖÇø£º" + IDS_FILESET_ALL "µ¥Ôª %1 ÖеÄËùÓÐ¾í£º" + IDS_FILESET_ONE "·þÎñÆ÷ %1 ÉϵÄËùÓÐ¾í£º" + IDS_SVR_LISTS_TAB "¹ÜÀíÔ±Áбí" + IDS_SVR_PROP_TITLE "·þÎñÆ÷ %1 - ÌØÐÔ" + IDS_SVR_GENERAL_TAB "Ò»°ã" + IDS_SVR_SCOUT_TAB "ÉèÖÃ" + IDS_SERVER_TITLE "·þÎñÆ÷ %1 - AFS ·þÎñÆ÷¹ÜÀíÆ÷" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_DESC "µ¥Ôª %2 ÖеķþÎñÆ÷ %1£º" + IDS_SVC_PROP_TITLE "·þÎñÆ÷ %1 ÉϵķþÎñ %2 - ÌØÐÔ" + IDS_SVC_GENERAL_TAB "Ò»°ã" + IDS_SVC_ADD_TITLE "´´½¨·þÎñ" + IDS_SVC_ADD_TAB "´´½¨·þÎñ" + IDS_AGG_PROP_TITLE "·þÎñÆ÷ %1 ÉϵķÖÇø %2 - ÌØÐÔ" + IDS_AGG_GENERAL_TAB "Ò»°ã" + IDS_SET_REP_TITLE "¾í %1 - ¸´ÖÆ" + IDS_SET_REPSITES_TAB "¸´ÖÆÕ¾µã" + IDS_SET_PROP_TITLE "¾í %1 - ÌØÐÔ" + IDS_SET_GENERAL_TAB "Ò»°ã" + IDS_SET_UNLOCKBTN "ÏÖÔÚ½âËø(&L)" + IDS_SET_LOCKBTN "ÏÖÔÚËø¶¨(&L)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_USAGE_FILESET "ʹÓÃÁË %1£¬ÏÞ¶îΪ %2 (%3%%)" + IDS_USAGE_AGGREGATE "ʹÓÃÁË %1£¬ÈÝÁ¿Îª %2 (%3%%)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGCOL_ALLOCATED "×éºÏµÄÏÞ¶î" + IDS_SVRCOL_NAME "·þÎñÆ÷" + IDS_SVRCOL_STATUS "״̬" + IDS_SETCOL_DATE_ACCESS "×î½üÒ»´Î´æÈ¡" + IDS_SETCOL_DATE_BACKUP "×î½üÒ»´Î±¸·Ý" + IDS_SVCCOL_NAME "·þÎñ" + IDS_SVCCOL_TYPE "ÀàÐÍ" + IDS_SVCCOL_PARAMS "²ÎÊý" + IDS_SVCCOL_STATUS "״̬" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_DATE_START "×î½üÒ»´ÎÆô¶¯" + IDS_SVCCOL_DATE_STOP "×î½üÒ»´ÎÍ£Ö¹" + IDS_SVCCOL_DATE_STARTSTOP "×î½üÒ»´ÎÆô¶¯£¯Í£Ö¹" + IDS_SVCCOL_DATE_FAILED "×î½üÒ»´Îʧ°Ü" + IDS_SVCCOL_LASTERROR "×î½üÒ»´ÎµÄÍ˳öÂë" + IDS_AGGCOL_NAME "·ÖÇø" + IDS_AGGCOL_ID "±êʶ·û" + IDS_AGGCOL_DEVICE "É豸" + IDS_AGGCOL_USED "ÒÑʹÓÃ" + IDS_AGGCOL_USED_PER "ÒÑʹÓà %" + IDS_AGGCOL_FREE "×ÔÓÉ" + IDS_AGGCOL_TOTAL "ÈÝÁ¿" + IDS_AGGCOL_STATUS "״̬" + IDS_SETCOL_NAME "¾í" + IDS_SETCOL_TYPE "ÀàÐÍ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETCOL_DATE_CREATE "ÒÑ´´½¨" + IDS_SETCOL_DATE_UPDATE "×î½üÒ»´Î¸üÐÂ" + IDS_SETCOL_STATUS "״̬" + IDS_SETCOL_QUOTA_USED "ÒÑʹÓÃ" + IDS_SETCOL_QUOTA_USED_PER "ÒÑʹÓà %" + IDS_SETCOL_QUOTA_FREE "×ÔÓÉ" + IDS_SETCOL_QUOTA_TOTAL "ÏÞ¶î" + IDS_TRYAGAINBTN "ÔÙÊÔÒ»´Î(&A)" + IDS_NO_CELL_SELECTED "(δָ¶¨µ¥Ôª)" + IDS_NO_AFS_ID "(ÎÞÁîÅÆ¿ÉÓÃ)" + IDS_AFS_ID_WILLEXP "%1(ÁîÅÆ½«ÔÚ %2 µ½ÆÚ)" + IDS_ELAPSED_TIME "%1" + IDS_SEARCHING_FOR_SERVERS "ÇëµÈ´ý£»ÕýÔÚ»ñÈ¡¹ØÓÚµ¥Ôª %1 µÄÐÅÏ¢..." + IDS_STATUS_NOALERTS "Õý³£" + IDS_TITLE_BROWSE_USER "Ñ¡ÔñÓû§" + IDS_AGGTYPE_OTHER "δ֪ (%1)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATEFILESET "ÔÚ·ÖÇø %1:%2 ÉÏ´´½¨¾í %3" + IDS_ACTION_DELETEFILESET "´Ó·ÖÇø %1:%2 ÉÏɾ³ý¾í %3" + IDS_ACTION_MOVEFILESET "ÒÆ¶¯¾í %3 µ½·ÖÇø %1:%2" + IDS_ACTION_SETFILESETQUOTA "Ϊ¾í %3 ¸ü¸ÄÏÞ¶î" + IDS_SVCSTOP_DESC2 "µ¥»÷È·¶¨Í£Ö¹¸Ã·þÎñ¡£" + IDS_SVCSTART_DESC2 "µ¥»÷È·¶¨Æô¶¯¸Ã·þÎñ¡£" + IDS_SYNCVLDB_SVR_DESC "×¢Ò⣡\n\nÈç¹ûÄú¼ÌÐø£¬AFS ·þÎñÆ÷¹ÜÀíÆ÷½«ÐÞ¸Ä VLDB ÒÔÆ¥Åä·þÎñÆ÷ %1 ÉÏËùÓзÖÇøµÄÄÚÈÝ¡£" + IDS_SYNCVLDB_SVR_DESC2 "Èç¹û VLDB Ìá¼°Ò»¸ö¾í£¬µ«¸Ã¾íÏÖÔÚÎÞ·¨ÔÚ·þÎñÆ÷ %1 µÄÈκηÖÇøÉÏÕÒµ½£¬½«É¾³ý¸Ã¾íµÄ VLDB ÌõÄ¿£¡" + IDS_SYNCVLDB_AGG_DESC "×¢Ò⣡\n\nÈç¹ûÄú¼ÌÐø£¬AFS ·þÎñÆ÷¹ÜÀíÆ÷½«ÐÞ¸Ä VLDB ÒÔÆ¥Åä·þÎñÆ÷ %1 ÉÏ·ÖÇø %2 µÄÄÚÈÝ¡£" + IDS_SYNCVLDB_AGG_DESC2 "Èç¹û VLDB Ìá¼°Ò»¸ö¾í£¬µ«¸Ã¾íÏÖÔÚÎÞ·¨Ôڸ÷ÖÇøÉÏÕÒµ½£¬½«É¾³ý¸Ã¾íµÄ VLDB ÌõÄ¿£¡" + IDS_PROMPT_BROWSE_USER "Óû§£º" + IDS_PREVIEWIN_BUTTON "<< Ô¤ÀÀ(&P)" + IDS_PREVIEWOUT_BUTTON "Ô¤ÀÀ(&P) >>" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ADMCOL_TYPE_USER "Óû§" + IDS_TITLE_BROWSE_PRINCIPAL "Ñ¡ÔñίÍÐÈË" + IDS_TITLE_BROWSE_OWNGROUP "Ñ¡ÔñÓµÓÐ×é" + IDS_PROMPT_BROWSE_PRINCIPAL "ίÍÐÈË£º" + IDS_PROMPT_BROWSE_OWNGROUP "ÓµÓÐ×飺" + IDS_ACTION_CLONE "´´½¨¾í %3 µÄ±¸·Ý°æ±¾" + IDS_ACTION_CLONESYS "´´½¨¶à¸ö¾í±¸·Ý" + IDS_CLONESYS_FAILED "¾í %1 µÄ±¸·ÝÎÞ·¨´´½¨£¬Ô­ÒòÊÇ´íÎó 0x%2 (%3)¡£" + IDS_SET_UNSPECIFIED "(δָ¶¨µÄ)" + IDS_SETCOL_ID "±êʶ·û" + IDS_SETCOL_FILES "Îļþ¼ÆÊý" + IDS_SET_DUMP_NAME "%1.DMP µÄת´¢" + IDS_ACTION_DUMP "ת´¢¾í %3(·ÖÇø %1:%2)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FILESETNAME_ERROR "%1 - %2" + IDS_SETCOL_AGGREGATE "·ÖÇø" + IDS_REFRESH_DESC_CELL "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÕýÔÚÈ·¶¨µ¥Ôª %1 ÖзþÎñÆ÷µÄ״̬¡£Õâ¿ÉÄÜÐèÒª¼¸·ÖÖÓ..." + IDS_REFRESH_DESC_SERVER "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÕýÔÚÈ·¶¨·þÎñÆ÷ %1 µÄ״̬¡£Õâ¿ÉÄÜÐèÒª¼¸·ÖÖÓ..." + IDS_REFRESH_CURRENT_CELL "ÕýÔÚ¼ì²é£ºµ¥Ôª %1" + IDS_REFRESH_CURRENT_SERVER "ÕýÔÚ¼ì²é£º·þÎñÆ÷ %2" + IDS_REFRESH_CURRENT_AGGREGATE "ÕýÔÚ¼ì²é£º·þÎñÆ÷ %2 µÄ·ÖÇø %3" + IDS_REFRESH_CURRENT_FILESET "ÕýÔÚ¼ì²é£º·þÎñÆ÷ %2£¬·ÖÇø %3 µÄ¾í %4" + IDS_REFRESH_CURRENT_SERVICE "ÕýÔÚ¼ì²é£º·þÎñÆ÷ %2 ÉϵķþÎñ %3" + IDS_REFRESH_PERCENT "%1%% Íê³É" + IDS_PROBLEMS "ÎÊÌâ" + IDS_SERVER_NO_PROBLEMS "¸Ã·þÎñÆ÷ÎÞÒÑÖªÎÊÌâ¡£" + IDS_SERVICE_NO_PROBLEMS "¸Ã·þÎñÎÞÒÑÖªÎÊÌâ¡£" + IDS_AGGREGATE_NO_PROBLEMS "¸Ã·ÖÇøÎÞÒÑÖªÎÊÌâ¡£" + IDS_FILESET_NO_PROBLEMS "¸Ã¾íÎÞÒÑÖªÎÊÌâ¡£" + IDS_AGGTYPE_TYPE1 "UFS" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGTYPE_TYPE2 "LFS" + IDS_AGGTYPE_TYPE3 "AIX" + IDS_AGGTYPE_TYPE4 "VXFS" + IDS_AGGTYPE_TYPE5 "DMEPI" + IDS_REFRESH_CURRENT_VLDB "ÕýÔÚ¼ì²é£º¾íλÖÃÊý¾Ý¿â (VLDB)" + IDS_FILESETTYPE_RW "¶ÁÈ¡£¯Ð´Èë" + IDS_FILESETTYPE_RO "¸±±¾" + IDS_FILESETTYPE_CLONE "±¸·Ý" + IDS_MOVESET_READWRITE "¼ÌÐø½«µ¼Ö¾í %3 ´Ó·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏÒÆ¶¯µ½ÁíÒ»¸öλÖá£" + IDS_MOVESET_READONLY "¼ÌÐø½«µ¼ÖÂ¾í¸±±¾ %3 ´Ó·þÎñÆ÷ %1 µÄ·ÖÇø %2 Éϱ»É¾³ý£¬²¢ÔÚÄúÔÚÏÂÃæÖ¸¶¨µÄ·ÖÇøÉÏ´´½¨ÁíÒ»¸ö¾í¸±±¾¡£" + IDS_SVC_START_TITLE "Æô¶¯·þÎñ" + IDS_SVC_STOP_TITLE "Í£Ö¹·þÎñ" + IDS_SERVICESTATUS_STARTING "¸Ã·þÎñµ±Ç°ÕýÔÚÆô¶¯¡£" + IDS_SERVICESTATUS_RUNNING "¸Ã·þÎñµ±Ç°ÕýÔÚÔËÐС£" + IDS_SERVICESTATUS_STOPPED "¸Ã·þÎñµ±Ç°Í£Ö¹¡£" + IDS_SERVICESTATUS_STOPPING "¸Ã·þÎñµ±Ç°ÕýÔÚÍ£Ö¹¡£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICESTATUS_UNKNOWN "¸Ã·þÎñ״̬δ֪¡£" + IDS_SVC_RESTART_BUTTON "ÏÖÔÚÍ£Ö¹²¢ÖØÐÂÆô¶¯(&R)" + IDS_PROBLEM_BOX "ÒÑÖªÎÊÌâ (%1)" + IDS_VIEWLOG_DESC_NOFILE "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÕÒµ½·þÎñÆ÷ %1 ÉϵķþÎñ %2 µÄÈÕÖ¾Îļþ¡£ÇëÔÚÏÂÃæÊäÈë·þÎñÈÕÖ¾ÎļþµÄ¾ø¶Ô·¾¶¡£" + IDS_NO_GROUP "(ÎÞÓµÓÐ×é)" + IDS_VIEWLOG_FROMSERVER "·þÎñÆ÷ %1 ÉϵÄÈÕÖ¾Îļþ" + IDS_VIEWLOG_FROMSERVICE "·þÎñÆ÷ %1 ÉÏ·þÎñ %2 µÄÈÕÖ¾Îļþ" + IDS_VIEWLOG_TRUNCATED "ÎļþĿ¼(½öÏÔʾ×îºó %1 ÐÐ)£º" + IDS_SAVELOG_FILTER "Îı¾Îļþ|*.TXT|" + IDS_ADVANCEDIN_BUTTON "<< ¸ß¼¶(&A)" + IDS_ADVANCEDOUT_BUTTON "¸ß¼¶(&A) >>" + IDS_REPTYPE_RELEASE "ÊͷŸ´ÖÆ" + IDS_REPTYPE_SCHEDULED "¶¨ÆÚ¸´ÖÆ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_UPDATEALL_BUTTON "¸üÐÂËùÓÐ(&U)" + IDS_UPDATETHIS_BUTTON "¸üÐÂ(&U)" + IDS_SERVER_MULTIPLE_PROBLEMS "¸Ã·þÎñÆ÷ÓÐ %1 ¸öÒÑÖªÎÊÌâ¡£" + IDS_SERVICE_MULTIPLE_PROBLEMS "¸Ã·þÎñÓÐ %1 ¸öÒÑÖªÎÊÌâ¡£" + IDS_AGGREGATE_MULTIPLE_PROBLEMS "¸Ã·ÖÇøÓÐ %1 ¸öÒÑÖªÎÊÌâ¡£" + IDS_FILESET_MULTIPLE_PROBLEMS "¸Ã¾íÓÐ %1 ¸öÒÑÖªÎÊÌâ¡£" + IDS_FILESETTYPE_RO_STAGE "¸±±¾" + IDS_SERVICETYPE_SIMPLE_LONG "¼òµ¥£¨²»¼ä¶ÏÔËÐУ©" + IDS_SERVICETYPE_CRON_LONG "Cron £¨ÔÚÖ¸¶¨¼ä¸ôÔËÐУ©" + IDS_QUOTAUNITS_KB "KB" + IDS_QUOTAUNITS_MB "MB" + IDS_NO_QUOTA_REPLICA "(¸Ã¾íÊǸ±±¾£¬Òò¶øÎÞÏÞ¶î)" + IDS_NO_QUOTA_CLONE "(¸Ã¾íÊDZ¸·Ý£¬Òò¶øÎÞÏÞ¶î)" + IDS_USAGE_REPLICA "ÒÑʹÓà %1" + IDS_USAGE_CLONE "ÒÑʹÓà %1" + IDS_COL_AGGS_MOVE "µ±´´½¨¾íʱµÄ·ÖÇø" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PERCENTAGE "%1 %%" + IDS_AGGREGATES_IN_SERVER "·þÎñÆ÷ %1 ÉϵķÖÇø£º" + IDS_AGGREGATES_IN_CELL "µ¥Ôª %1 ÖÐËùÓзÖÇø£º" + IDS_AGGREGATES_IN_NOTHING "·ÖÇø£º" + IDS_FILESETS_IN_SERVER "·þÎñÆ÷ %1 ÉϵÄËùÓÐ¾í£º" + IDS_FILESETS_IN_CELL "µ¥Ôª %1 ÖеÄËùÓÐ¾í£º" + IDS_FILESETS_IN_NOTHING "¾í£º" + IDS_SERVICES_IN_SERVER "·þÎñÆ÷ %1 ÉÏËùÓзþÎñ£º" + IDS_SERVICES_IN_NOTHING "·þÎñ£º" + IDS_UNKNOWN "(δ֪)" + IDS_UNKNOWN_GROUP "×é #%1 (Ãû³ÆÎ´Öª)" + IDS_AGGFULL_WARN_OFF "ȱʡãÐÖµ(·þÎñÆ÷ÉϽûÓþ¯¸æ)" + IDS_SERVER_AGGREGATE "%1:%2" + IDS_SERVERNAME_ERROR "%1 - %2" + IDS_AGGREGATENAME_ERROR "%1 - %2" + IDS_SETFULL_WARN_OFF "ȱʡãÐÖµ(·þÎñÆ÷ÉϽûÓþ¯¸æ)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_LASTERRORDATE "%1 - Í˳öÂë %2" + IDS_COL_SERVERS "µ¥ÔªÖеķþÎñÆ÷" + IDS_COL_FILESETS "·þÎñÆ÷Éϵľí" + IDS_COL_AGGREGATES "·þÎñÆ÷ÉϵķÖÇø" + IDS_COL_SERVICES "·þÎñÆ÷ÉϵķþÎñ" + IDS_COL_REPLICAS "¾í¸±±¾" + IDS_COLUMNS_TITLE "Ñ¡ÔñÏÔʾÁÐ - AFS ·þÎñÆ÷¹ÜÀíÆ÷" + IDS_REPCOL_SERVER "·þÎñÆ÷" + IDS_REPCOL_AGGREGATE "·ÖÇø" + IDS_REPCOL_DATE_UPDATE "×î½ü¸üÐÂ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COL_AGGS_CREATE "ÒÆ¶¯¾íʱµÄ·ÖÇø" + IDS_WARN_TITLE "×¢Òâ" + IDS_WARN_DISABLE_AUTH "ͨ¹ýµ¥»÷""ÔÊÐí²»ÑéÖ¤""°´Å¥£¬Äú¿ÉÔÊÐíδ¾­ÑéÖ¤µÄίÍÐÈËÀ´²Ù×÷¸Ã·þÎñÆ÷ÉϵķþÎñ¡£ÓÉÓÚÐí¶à·þÎñÒÔ root Éí·ÝÔËÐУ¬¸Ã²Ù×÷´ú±í +" + IDS_WARN_DISABLE_AUTH2 "·þÎñÆ÷°²È«ÐÔµÄÒ»¸öÑÏÖØÈ±ÏÝ¡£\n\nÄúÈ·ÈÏÒª¸ü¸ÄÂð?" + IDS_SVR_NO_ADDR "(δָ¶¨µÄ)" + IDS_TITLE_BAD_CELL "ÎÞ·¨Ê¶±ðµÄµ¥ÔªÃû" + IDS_DESC_BAD_CELL "ÍøÂçÉÏÕÒ²»µ½ÄúÊäÈëµÄµ¥ÔªÃû¡£\n\n ÇëÔٴμì²éÄúµÄÌõÄ¿£¬ÒÔÈ·ÈÏÊÇÕýÈ·µÄ¡£" + IDS_AGGFULL_WARN_ON "¸Ã·þÎñÆ÷µÄȱʡãÐÖµ(&D) (Æä´óСµÄ %1%%)" + IDS_SETFULL_WARN_ON "¸Ã·þÎñÆ÷µÄȱʡãÐÖµ(&D) (Æä´óСµÄ %1%%)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_ERROR_BAD_CREDENTIALS + "ÎÞ·¨Ê¶±ðÄúÊäÈëµÄ AFS Éí·Ý£¬»òÄúÖ¸¶¨µÄ¿ÚÁî²»ÕýÈ·¡£" + IDS_SVR_CREDS_NONE "(ûÓÐÁîÅÆ)" + IDS_SVR_CREDS_VALID "%2£¬ÔÚ %3 µ½ÆÚ" + IDS_SVR_CREDS_EXPIRED "(ÁîÅÆÒÑÔÚ %3 µ½ÆÚ)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGG_FILESETS "%1 (×éºÏµÄÏ޶%2)" + IDS_ACTION_DESC_NONE "ûÓÐÕýÔÚ½øÐеIJÙ×÷¡£" + IDS_ACTION_DESC_ONE "´Ë²Ù×÷ÕýÔÚ½øÐУº" + IDS_ACTION_DESC_MULT "ÏÂÁвÙ×÷ÕýÔÚ½øÐУº" + IDS_ACTCOL_OPERATION "²Ù×÷" + IDS_ACTCOL_ELAPSED "Òѹýʱ¼ä" + IDS_ACTION_REFRESH "ÕýÔÚˢе¥ÔªÐÅÏ¢" + IDS_ACTION_CREATESERVER "ÕýÔÚ´´½¨·þÎñÆ÷ %1" + IDS_ACTION_DELETESERVER "ÕýÔÚɾ³ý·þÎñÆ÷ %1" + IDS_ACTION_GETSERVERLOGFILE "ÕýÔÚ´Ó·þÎñÆ÷ %1 »ñÈ¡ÈÕÖ¾Îļþ %2" + IDS_ACTION_SETSERVERAUTH "ÕýÔÚΪ·þÎñÆ÷ %1 ¸ü¸Ä´æÈ¡ÏÞÖÆ" + IDS_ACTION_CHANGESERVERSTATUS "ÕýÔÚ¸ü¸Ä·þÎñÆ÷ %1 µÄÌØÐÔ" + IDS_ACTION_STARTSERVICE "ÕýÔÚÆô¶¯·þÎñÆ÷ %1 µÄ·þÎñ %2" + IDS_ACTION_STOPSERVICE "ÕýÔÚÍ£Ö¹·þÎñÆ÷ %1 µÄ·þÎñ %2" + IDS_ACTION_RESTARTSERVICE "ÕýÔÚÖØÐÂÆô¶¯·þÎñÆ÷ %1 µÄ·þÎñ %2" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SYNCVLDB_SVR "ÕýÔÚʹ VLDB Óë·þÎñÆ÷ %1 ͬ²½" + IDS_ACTION_SYNCVLDB_AGG "ÕýÔÚʹ VLDB Óë·ÖÇø %1:%2 ͬ²½" + IDS_ACTION_SCOUT "ÕýÔÚ¼ì²é·þÎñÆ÷ %1 µÄÎÊÌâ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SETREPPARAMS "ÕýÔÚ¸ü¸Ä¾í %3 µÄ¸´ÖÆÌØÐÔ" + IDS_ACTION_CREATEREPLICA "ÕýÔÚ·ÖÇø %1:%2 ÉÏ´´½¨¾í %3 µÄ¸±±¾" + IDS_DELSET_REPLICA_DESC "×¢Ò⣡\n\n¼ÌÐø½«É¾³ý·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ¾í %3 µÄ¸±±¾¡£" + IDS_DELSET_CLONE_DESC "×¢Ò⣡\n\n¼ÌÐø½«É¾³ý·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ¾í±¸·Ý %3 ¡£" + IDS_INSTALL_DESC1 "¸Ã²Ù×÷¸´ÖÆÎļþµ½Áíһ̨¼ÆËã»ú¡£+" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_INSTALL_DESC2 "Èç¹ûÎļþÒÑ´æÔÚÓÚÄ¿±ê¼ÆËã»ú£¬»á½«Ëü×ö±¸·Ý²¢ÒÔ .BAK ×÷ΪÀ©Õ¹Ãû£»ÈκÎÏÖÓеı¸·ÝÎļþÀ©Õ¹Ãû»áת»»Îª .OLD£¬ÈκÎÏÖÓеÄÀ©Õ¹ÃûΪ .OLD µÄÎļþ½«±»É¾³ý¡£" + IDS_ACTION_INSTALLFILE "ÕýÔÚ·þÎñÆ÷ %1 Éϰ²×°Îļþ %2" + IDS_ACTION_UNINSTALLFILE "ÕýÔÚ´Ó·þÎñÆ÷ %1 ÉÏжװÎļþ %2" + IDS_ACTION_PRUNEFILES "ÕýÔÚ´Ó·þÎñÆ÷ %1 ÉÏɾ³ýÎļþ" + IDS_FILTER_ALLFILES "ËùÓÐÎļþ|*.*|" + IDS_ACTION_RENAMEFILESET "ÕýÔÚÖØÃüÃû¾í %1 Ϊ %2" + IDS_RECUR_DAILY "ÿÌì" + IDS_RECUR_SUNDAY "ÿÖÜÈÕ" + IDS_RECUR_MONDAY "ÿÖÜÒ»" + IDS_RECUR_TUESDAY "ÿÖܶþ" + IDS_RECUR_WEDNESDAY "ÿÖÜÈý" + IDS_RECUR_THURSDAY "ÿÖÜËÄ" + IDS_RECUR_FRIDAY "ÿÖÜÎå" + IDS_RECUR_SATURDAY "ÿÖÜÁù" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATESERVICE "ÕýÔÚ·þÎñÆ÷ %1 ÉÏ´´½¨·þÎñ %2" + IDS_ACTION_DELETESERVICE "ÕýÔÚ´Ó·þÎñÆ÷ %1 ÉÏɾ³ýÎļþ %2" + IDS_ACTION_RELEASEFILESET "ÕýÔÚÊͷží %3" + IDS_ACTION_GETDATES "ÕýÔÚ»ñÈ¡·þÎñÆ÷ %1 ÉϵÄÎļþ %2 µÄÈÕÆÚ" + IDS_LASTMODIFIED "×î½üÒ»´ÎÐÞ¸Ä %1" + IDS_SVR_SECURITY_TITLE "·þÎñÆ÷°²È«ÐÔ - %1" + IDS_SVR_LIST_TAB "¹ÜÀíÔ±" + IDS_ACTION_ADMINLIST_LOAD "ÕýÔÚ»ñÈ¡·þÎñÆ÷ %1 µÄ¹ÜÀíÔ±" + IDS_ACTION_ADMINLIST_SAVE "ÕýÔÚдÈë·þÎñÆ÷ %1 µÄ¹ÜÀíÔ±" + IDS_ADMCOL_PRINCIPAL "³ÉÔ±" + IDS_ADMCOL_TYPE "ÀàÐÍ" + IDS_ADMCOL_TYPE_GROUP "×é" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_RESTORE "ÕýÔÚ»Ö¸´¾í %1" + IDS_COL_AGGS_RESTORE "»Ö¸´¾íʱµÄ·ÖÇø" + IDS_RESTORE_FILTER "¾íת´¢Îļþ |*.DMP|ËùÓÐÎļþ|*.*|" + IDS_SVC_BOS_TAB "BOS" + IDS_ACTION_SETRESTART "ÕýÔÚ¸ü¸Ä·þÎñÆ÷ %1 µÄ·þÎñÖØÐÂÆô¶¯Ê±¼ä" + IDS_RESTORE_CREATESET "¾í %1 ½«´´½¨ÔÚÄúÔÚÏÂÃæÖ¸¶¨µÄ·þÎñÆ÷µÄ·ÖÇøÉÏ¡£" + IDS_RESTORE_OVERWRITESET + "×¢Ò⣡¾í %3 ´æÔÚÓÚ·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏ£¬Èç¹ûÄú¼ÌÐø£¬½«¸²¸ÇËü£¡" + IDS_SUBSET_TITLE_LOAD "´ò¿ª·þÎñÆ÷×Ó¼¯" + IDS_SUBSET_TITLE_SAVE "±£´æ·þÎñÆ÷×Ó¼¯" + IDS_BUTTON_OPEN "´ò¿ª(&O)" + IDS_BUTTON_SAVE "±£´æ(&S)" + IDS_SUBSET_SAVE_TITLE "×¢Òâ" + IDS_SUBSET_SAVE_DESC "ÃûΪ %1 µÄ·þÎñÆ÷×Ó¼¯ÒÑ´æÔÚ¡£\n\nÄúÏ븲¸Ç¸Ã×Ó¼¯Âð£¿" + IDS_SUBSET_CHANGED "%1 [ÒÑÐ޸ĵÄ]" + IDS_SUBSET_TAB "±»¼àÊӵķþÎñÆ÷" + IDS_SUBSET_DISCARD_TITLE "±£´æ×Ó¼¯£¿" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SUBSET_DISCARD_DESC "Äú»¹Î´½«µ±Ç°¼àÊӵķþÎñÆ÷ÁÐ±í±£´æÎª×Ó¼¯¡£Èç¹û±£´æ¸ÃÁÐ±í£¬ÒÔºóÄú¿ÉÒÔ¼ÌÐø¼àÊÓÕâЩ·þÎñÆ÷¡£\n\n+" + IDS_SUBSET_DISCARD_DESC2 + "ÄúÊÇ·ñÒª´´½¨Ò»¸ö×Ó¼¯À´°üº¬µ±Ç°¼àÊӵķþÎñÆ÷µÄÁÐ±í£¿" + IDS_SUBSET_NONAME "(δÃüÃûµÄ)" + IDS_SUBSET_NOSUBSET "(ËùÓзþÎñÆ÷Õý±»¼àÊÓ)" + IDS_SUBSET_SERVERSUBSET "·þÎñÆ÷ %1" + IDS_FILESET_SOME "µ¥Ôª %1 ÖÐËùÓб»¼àÊÓ·þÎñÆ÷µÄ¾í£º" + IDS_AGGREGATE_SOME "µ¥Ôª %1 ÖÐËùÓб»¼àÊÓ·þÎñÆ÷µÄ·ÖÇø£º" + IDS_SERVICE_SOME "µ¥Ôª %1 ÖÐËùÓб»¼àÊÓ·þÎñÆ÷µÄ·þÎñ£º" + IDS_FILESET_UNMON "·þÎñÆ÷ %1 δ±»¼àÊÓ" + IDS_AGGREGATE_UNMON "·þÎñÆ÷ %1 δ±»¼àÊÓ" + IDS_SERVICE_UNMON "·þÎñÆ÷ %1 δ±»¼àÊÓ" + IDS_SUBSET_DELETE_TITLE "ɾ³ý×Ó¼¯£¿" + IDS_SUBSET_DELETE_DESC "ÄúÈ·¶¨ÒªÉ¾³ý·þÎñÆ÷×Ó¼¯ %1£¿" + IDS_ERROR_TRANSLATED "´íÎóºÅ 0x%1 (%2):\n\n%3" + IDS_ERROR_NOTTRANSLATED "ÎÞ·¨±æÈÏ´íÎóºÅ 0x%1 (%2)¡£" + IDS_FIND_NOTHING_TITLE "δѡÔñÃüÁî" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FIND_NOTHING_DESC "Òª²éÕÒÈçºÎÖ´ÐÐÒ»¸ö²Ù×÷£¬Ê×ÏÈ´ÓÁбíÑ¡ÔñÒ»¸öÃüÁîÐлòÊäÈëÒ»¸ö¹Ø¼ü×Ö¡£" + IDS_FIND_UNKNOWN_TITLE "δ֪ÃüÁî" + IDS_FIND_UNKNOWN_DESC "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÕÒµ½ÃüÁî""%1"" µÄÈκΰïÖúÖ÷Ìâ¡£" + IDS_HELPABOUT_DESC1 "¾¯¸æ£º¸Ã¼ÆËã»ú³ÌÐòÊܵ½°æÈ¨¼°¹ú¼ÊÌõÔ¼µÄ±£»¤¡£+" + IDS_HELPABOUT_DESC2 "δ¾­ÊÚȨ¸´ÖÆ»ò·Ö·¢¸ÃÈí¼þ»áÊܵ½ÑÏÀ÷µÄÃñÊ»òÐÌÊ´¦·££¬²¢½«Êܵ½·¨ÂÉÑϳ͡£\n\n+" + IDS_HELPABOUT_DESC3 "AFS ÊÇ Transarc ¹«Ë¾(IBM ¹«Ë¾)µÄÉ̱ꡣ" + IDS_CANT_QUIT_TITLE "AFS ·þÎñÆ÷¹ÜÀíÆ÷" + IDS_CANT_QUIT_REBOOT "×¢Ò⣡\n\n AFS ·þÎñÆ÷¹ÜÀíÆ÷ÕýÔÚÖ´ÐÐÒ»¸ö»ò¸ü¶à²Ù×÷¡£Èç¹ûÄúÏÖÔÚ¹Ø±Õ Windows£¬½«ÎÞ·¨³É¹¦Íê³ÉÄÇЩ²Ù×÷¡£\n\n ÄúÈ·¶¨ÒªÖØÐÂÆô¶¯ Windows Âð£¿" + IDS_APP_TITLE "AFS ·þÎñÆ÷¹ÜÀíÆ÷" + IDS_ACTION_OPENCELL "ÔÚµ¥Ôª %1 ÖвéÕÒ·þÎñÆ÷" + IDS_OPTIONS_TITLE "Ñ¡Ïî - AFS ·þÎñÆ÷¹ÜÀíÆ÷" + IDS_OPTIONS_GENERAL_TAB "Ò»°ã" + IDS_BADCREDS_DESC "³ý·Ç×÷Ϊ¹ÜÀíÔ±µÇ¼£¬·ñÔòÄú¿ÉÄÜ»áûÓгä×ãµÄÌØÈ¨³É¹¦¹ÜÀí %1 µ¥Ôª¡£Ã»Óгä×ãµÄ´æÈ¡ÌØÈ¨¿ÉÄܻᵼÖÂÕý³£Çé¿öÏ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ò²»áÔÚµ¥ÔªÖÐÕÒµ½ÎÊÌâ¡£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CONFIRMATION_TITLE "È·ÈÏ - AFS ·þÎñÆ÷¹ÜÀíÆ÷" + IDS_NO_GROUP_CHECKBOX "ÎÞÓµÓÐ×é" + IDS_AFS_ID_DIDEXP "%1(ÁîÅÆÒÑÔÚ %2 µ½ÆÚ)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_QUERYING "(ÕýÔÚ²éѯ)" + IDS_ADMCOL_TYPE_FOREIGN_GROUP "Íⲿ×é" + IDS_ADMCOL_TYPE_FOREIGN_USER "ÍⲿÓû§" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_NOTIFIER "֪ͨÆ÷" + IDS_SVC_NONOTIFIER "(ÎÞ)" + IDS_SVR_KEY_TAB "·þÎñÆ÷ÃÜÔ¿" + IDS_KEYNAME_NOTIME "·þÎñÆ÷ %1 µÄÃÜÔ¿£º" + IDS_KEYNAME_WITHTIME "·þÎñÆ÷ %1 µÄÃÜÔ¿(ÒÑÐÞ¸ÄµÄ %2)£º" + IDS_SVRKEY_VERSION "°æ±¾" + IDS_SVRKEY_DATA "Öµ" + IDS_SVRKEY_CHECKSUM "УÑéºÍ" + IDS_SVRKEY_DATA_UNKNOWN "(Òþ²ØµÄ)" + IDS_STARTSERVICE_TITLE "Æô¶¯·þÎñ" + IDS_STOPSERVICE_TITLE "Í£Ö¹·þÎñ" + IDS_STARTSERVICE_TEXT "µ¥»÷¡°È·¶¨¡±ÒÔÆô¶¯·þÎñÆ÷ %1 ÉϵķþÎñ %2¡£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_STOPSERVICE_TEXT "µ¥»÷¡°È·¶¨¡±ÒÔÍ£Ö¹·þÎñÆ÷ %1 ÉϵķþÎñ %2¡£" + IDS_STARTSERVICE_STARTUP + "Äú¿ÉÒÔÓÀ¾Ã±£³Ö¸Ã¸ü¸Ä£¬ÒÔ±ã·þÎñÆ÷ %1 ÖØÐÂÆô¶¯Ê±£¬·þÎñ %2 »á×Ô¶¯Æô¶¯¡£" + IDS_STOPSERVICE_STARTUP "Äú¿ÉÒÔÓÀ¾Ã±£³Ö¸Ã¸ü¸Ä£¬ÒÔ±ã·þÎñÆ÷ %1 ÖØÐÂÆô¶¯Ê±£¬·þÎñ %2 ²»»á×Ô¶¯Æô¶¯¡£" + IDS_STARTSERVICE_PERMANENT "ÓÀ¾Ã(Èç¹û·þÎñÆ÷ %1 ÖØÐÂÆô¶¯£¬Æô¶¯·þÎñ %2)(&P)" + IDS_STARTSERVICE_TEMPORARY + "ÁÙʱ(Èç¹û·þÎñÆ÷ %1 ÖØÐÂÆô¶¯£¬²»Æô¶¯·þÎñ %2)(&T)" + IDS_STOPSERVICE_PERMANENT + "ÓÀ¾Ã(Èç¹û·þÎñÆ÷ %1 ÖØÐÂÆô¶¯£¬²»Æô¶¯·þÎñ %2)(&P)" + IDS_STOPSERVICE_TEMPORARY "ÁÙʱ(Èç¹û·þÎñÆ÷ %1 ÖØÐÂÆô¶¯£¬Æô¶¯·þÎñ %2)(&T)" + IDS_ACTION_EXECUTE "Ö´ÐзþÎñÆ÷ %1 µÄ %2" + IDS_ACTION_SALVAGE_SVR "Íì¾È·þÎñÆ÷ %1 ÉϵÄËùÓÐ¾í£º" + IDS_ACTION_SALVAGE_AGG "Íì¾È·ÖÇø %1:2 ÉϵÄËùÓÐ¾í£º" + IDS_ACTION_SALVAGE_VOL "Íì¾È·ÖÇø %1:2 Éϵľí %3" + IDS_SALVAGE_SVR "Íì¾È·þÎñÆ÷ %1 ÉϵÄËùÓоí" + IDS_SALVAGE_AGG "Íì¾È·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄËùÓоí" + IDS_SALVAGE_SET "Íì¾È·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ¾í %3" + IDS_SETSTATUS_SALVAGE "Íì¾È¾í" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETSTATUS_LOCKED "¾í±»Ëø¶¨" + IDS_SETSTATUS_NO_VOL "¾í¶ªÊ§" + IDS_SETSTATUS_BUSY "¾íµ±Ç°½Ïæ" + IDS_SETSTATUS_MOVED "ÒÑÒÆ¶¯µÄ¾í" + IDS_SVR_CAPACITY "%1" + IDS_SVR_ALLOCATION "%1 (%2%%)" + IDS_SVRCOL_ADDRESS "µØÖ·" + IDS_HOST_TITLE "·þÎñÆ÷ %1 ʶ±ðµÄÊý¾Ý¿âÖ÷»ú·þÎñÆ÷£º" + IDS_SVR_HOSTS_TITLE "·þÎñÆ÷ %1 - Êý¾Ý¿âÖ÷»ú" + IDS_SVR_HOST_TAB "Êý¾Ý¿âÖ÷»ú" + IDS_ACTION_HOSTLIST_LOAD "ÕýÔÚ´Ó·þÎñÆ÷ %1 »ñÈ¡Ö÷»úÁбí" + IDS_ACTION_HOSTLIST_SAVE "дÖ÷»úÁÐ±íµ½·þÎñÆ÷ %1" + IDS_SETSTATUS_1ALERT "¾íÓÐÒ»¸öÎÊÌâ" + IDS_SETSTATUS_2ALERT "¾íÓÐ %1 ¸öÎÊÌâ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CHANGEADDR "Ϊ·þÎñÆ÷ %1 ¸ü¸Ä IP µØÖ·" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_ADDSITE "vos addsite" + IDS_COMMAND_VOS_BACKUP "vos backup" + IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" + IDS_COMMAND_VOS_CREATE "vos create" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_DELENTRY "vos delentry" + IDS_COMMAND_VOS_DUMP "vos dump" + IDS_COMMAND_VOS_EXAMINE "vos examine" + IDS_COMMAND_VOS_LISTPART "vos listpart" + IDS_COMMAND_VOS_LISTVLDB "vos listvldb" + IDS_COMMAND_VOS_LISTVOL "vos listvol" + IDS_COMMAND_VOS_LOCK "vos lock" + IDS_COMMAND_VOS_MOVE "vos move" + IDS_COMMAND_VOS_PARTINFO "vos partinfo" + IDS_COMMAND_VOS_RELEASE "vos release" + IDS_COMMAND_VOS_REMOVE "vos remove" + IDS_COMMAND_VOS_REMSITE "vos remsite" + IDS_COMMAND_VOS_RENAME "vos rename" + IDS_COMMAND_VOS_RESTORE "vos restore" + IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" + IDS_COMMAND_VOS_UNLOCK "vos unlock" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" + IDS_COMMAND_VOS_ZAP "vos zap" + IDS_COMMAND_BOS_ADDHOST "bos addhost" + IDS_COMMAND_BOS_ADDKEY "bos addkey" + IDS_COMMAND_BOS_ADDUSER "bos adduser" + IDS_COMMAND_BOS_CREATE "bos create" + IDS_COMMAND_BOS_DELETE "bos delete" + IDS_COMMAND_BOS_EXEC "bos exec" + IDS_COMMAND_BOS_GETDATE "bos getdate" + IDS_COMMAND_BOS_GETLOG "bos getlog" + IDS_COMMAND_BOS_GETRESTART "bos getrestart" + IDS_COMMAND_BOS_INSTALL "bos install" + IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" + IDS_COMMAND_BOS_LISTKEYS "bos listkeys" + IDS_COMMAND_BOS_LISTUSERS "bos listusers" + IDS_COMMAND_BOS_PRUNE "bos prune" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_BOS_REMOVEHOST "bos removehost" + IDS_COMMAND_BOS_REMOVEKEY "bos removekey" + IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" + IDS_COMMAND_BOS_RESTART "bos restart" + IDS_COMMAND_BOS_SALVAGE "bos salvage" + IDS_COMMAND_BOS_SETAUTH "bos setauth" + IDS_COMMAND_BOS_SETRESTART "bos setrestart" + IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" + IDS_COMMAND_BOS_START "bos start" + IDS_COMMAND_BOS_STARTUP "bos startup" + IDS_COMMAND_BOS_STATUS "bos status" + IDS_COMMAND_BOS_STOP "bos stop" + IDS_COMMAND_BOS_UNINSTALL "bos uninstall" + IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" + IDS_COMMAND_FS_LISTQUOTA "fs listquota" + IDS_COMMAND_FS_QUOTA "fs quota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_FS_SETQUOTA "fs setquota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCSHORT_UNMONITORED "·þÎñÆ÷ %1 δ±»¼àÊÓ" + IDS_ALERT_DESCSHORT_TIMEOUT "ÎÞ·¨ÁªÏµ·þÎñÆ÷ %1£»×î½üÒ»´Î´íÎó£º%3" + IDS_ALERT_DESCSHORT_AGG_FULL "%2 ʹÓõķÖÇø³¬³ö¾¯¸æãÐÖµ %3%% (%4)" + IDS_ALERT_DESCSHORT_SET_FULL "%3 ʹÓÃµÄ¾í³¬³ö¾¯¸æãÐÖµ %4%% (%5)" + IDS_ALERT_DESCSHORT_NO_VLDBENT "¾í %3 ÎÞ VLDB ÌõÄ¿" + IDS_ALERT_DESCSHORT_NO_SVRENT_SET + "¾í %3 ÓÐ VLDB ÌõÄ¿µ«ÔÚ·þÎñÆ÷ %1 µÄ·ÖÇø %1 ÉÏÕÒ²»µ½" + IDS_ALERT_DESCSHORT_STOPPED "·þÎñ %2 Í£Ö¹ÓÚ %3" + IDS_ALERT_DESCSHORT_NO_SVRENT_AGG + "·ÖÇø %2 ±» VLDB ÒýÓõ«ÎÞ·¨ÔÚ·þÎñÆ÷ %1 ÉÏÕÒµ½" + IDS_ALERT_DESCSHORT_BADCREDS "Äú¿ÉÄÜûÓÐ×ã¹»µÄÌØÈ¨¹ÜÀí·þÎñÆ÷ %1" + IDS_ALERT_DESCSHORT_AGG_ALLOC "·ÖÇø %2 ÉÏ×éºÏµÄ¾íÏ޶³öÆäÈÝÁ¿" + IDS_ALERT_DESCSHORT_STATE_NO_VNODE "¾í %3 Ë𻵣¬ÎÞ·¨Ê¹Óá£" + IDS_ALERT_DESCSHORT_STATE_NO_SERVICE "ÎÞÔËÐеķþÎñ¿É¹©¾í %3 ʹÓá£" + IDS_ALERT_DESCSHORT_STATE_OFFLINE "¾í %3 ÍÑ»ú£¬ÎÞ·¨Ê¹Óá£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_TIMEOUT + "ÎÞ·¨ÁªÏµ·þÎñÆ÷ %1¡£×î½üÒ»´Î³¢ÊÔ£¬·¢ÉúÓÚ %2£¬²úÉú´íÎó""%3""¡£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_AGG_FULL + "·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄʹÓó¬³öÆä¾¯¸æãÐÖµ %3%% (%4)¡£" + IDS_ALERT_DESCFULL_SET_FULL + "¾í %3 (·þÎñÆ÷ %1£¬·ÖÇø %2)µÄʹÓó¬³öÆä¾¯¸æãÐÖµ %4%%(%5)¡£" + IDS_ALERT_DESCFULL_NO_VLDBENT + "¾í %3 ´æÔÚÓÚ·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏ£¬µ«Ã»ÓÐÏàÓ¦µÄ VLDB ÌõÄ¿¡£" + IDS_ALERT_DESCFULL_NO_SVRENT_SET + "¾í %3 ÓÐ VLDB ÌõÄ¿£¬µ«ÔÚ·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏÕÒ²»µ½¡£" + IDS_ALERT_DESCFULL_STOPPED "·þÎñÆ÷ %1 µÄ·þÎñ %2 Í£Ö¹ÓÚ %3£¬Í˳öÂëΪ %5¡£" + IDS_ALERT_DESCFULL_NO_SVRENT_AGG + "VLDB Ö¸·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ¾í£¬µ«ÕÒ²»µ½¸Ã·ÖÇø¡£" + IDS_ALERT_DESCFULL_BADCREDS + "AFS ·þÎñÆ÷¹ÜÀíÆ÷¿ÉÄܼì²âµ½·þÎñÆ÷ %1 Éϲ»´æÔڵĴíÎó£¬ÕâÊÇÒòΪÄúûÓиõ¥Ôª¹ÜÀíÔ±µÄ AFS ÁîÅÆ¡£ " + IDS_ALERT_DESCFULL_AGG_ALLOC + "·þÎñÆ÷ %1 µÄ·ÖÇøµÄ %2 ÉÏ×éºÏµÄ¾íÏ޶×ܹ² %4£¬³¬³ö·ÖÇøÈÝÁ¿ %3¡£" + IDS_ALERT_DESCFULL_STATE_NO_VNODE + "·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ %3 ¾íûÓÐ Vnode ÓëÖ®¹ØÁª¡£(¾í״̬Ϊ 0x%4¡£)" + IDS_ALERT_DESCFULL_STATE_NO_SERVICE + "·þÎñÆ÷ %1 ÉÏûÓÐÎļþµ÷³öÆ÷·þÎñÔËÐУ¬ÎÞ·¨Ê¹Ó÷ÖÇø %2 µÄ¾í %3¡£(¾í״̬Ϊ 0x%4¡£)" + IDS_ALERT_DESCFULL_STATE_OFFLINE + "·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ %3 ¾íÍÑ»ú£¬ÎÞ·¨Ê¹Óá£(¾í״̬Ϊ 0x%4¡£)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_TIMEOUT "µ¥»÷¡°ÔÙÊÔÒ»´Î¡±°´Å¥£¬³¢ÊÔÖØÐÂÁ¬½Ó¸Ã·þÎñÆ÷¡£" + IDS_ALERT_FIX_AGG_FULL "µ¥»÷¡°¾¯¸æ¡±°´Å¥Îª¸Ã·ÖÇøµÄʹÓøü¸Ä¾¯¸æãÐÖµ¡£" + IDS_ALERT_FIX_SET_FULL "µ¥»÷¡°¾¯¸æ¡±°´Å¥Îª¸Ã¾íµÄʹÓøü¸Ä¾¯¸æãÐÖµ¡£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_NO_VLDBENT + "VLDB ¿ÉÄܹýʱ£»Èç¹ûÕâÑù£¬Ê¹Óá°Í¬²½ VLDB¡±ÃüÁî½øÐиüС£" + IDS_ALERT_FIX_NO_SVRENT_SET "¼ì²é·þÎñÆ÷ºÍ·ÖÇøÒÔÈ·±£ËüÃǹ¤×÷Õý³£¡£" + IDS_ALERT_FIX_STOPPED "µ¥»÷¡°²é¿´ÈÕÖ¾¡±°´Å¥Îª¸Ã·þÎñ²é¿´·þÎñÈÕÖ¾¡£" + IDS_ALERT_FIX_NO_SVRENT_AGG "¼ì²é·þÎñÆ÷ÒÔÈ·±£·ÖÇøÒѵ¼³öÇÒ¹¤×÷Õý³£¡£" + IDS_ALERT_FIX_BADCREDS "µ¥»÷¡°ÈÏÖ¤¡±°´Å¥ÒÔ»ñµÃÐ嵀 AFS ÁîÅÆ¡£" + IDS_ALERT_FIX_AGG_ALLOC "¼õÉٸ÷ÖÇøµÄ¾íÏ޶»òÕßÒÆ¶¯Ò»¸ö»ò¶à¸ö¾íµ½ÁíÒ»·ÖÇø¡£" + IDS_ALERT_FIX_STATE_NO_VNODE " " + IDS_ALERT_FIX_STATE_NO_SERVICE " " + IDS_ALERT_FIX_STATE_OFFLINE " " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_BUTTON_TRYAGAIN "ÔÙÊÔÒ»´Î(&A)" + IDS_ALERT_BUTTON_WARNINGS "¾¯¸æ(&W)..." + IDS_ALERT_BUTTON_VIEWLOG "²é¿´ÈÕÖ¾(&V)" + IDS_ALERT_BUTTON_SHOWME "ÏÔʾ(&S)" + IDS_ALERT_BUTTON_GETCREDS "ÈÏÖ¤(&A)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_CELLSERVERS_NOCELL + "δָ¶¨µ¥Ôª¡£ÒªÊ¹Óà AFS ·þÎñÆ÷¹ÜÀíÆ÷£¬Äú±ØÐëÖ¸¶¨ÒªÊ¹ÓÃµÄ AFS µ¥Ôª¡£Í¨¹ýÑ¡Ôñ""´ò¿ª..."" ²Ëµ¥Ïî(ÔÚÉÏÃæµÄ""µ¥Ôª "" ²Ëµ¥ÖÐ)À´Ñ¡Ôñµ¥Ôª¡£" + IDS_ERROR_REFRESH_CELLSERVERS + "ÎÞ·¨»ñµÃµ¥Ôª %1 µÄ·þÎñÆ÷ÁÐ±í¡£\n\n´íÎó£º %2" + IDS_ERROR_CANT_OPEN_CELL + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÁªÏµµ¥Ôª %1 ÖеÄÈκηþÎñÆ÷¡£\n\nÇëÖØÐ¼ì²éÒÔÈ·ÈÏÒÑÕýÈ·ÊäÈëµ¥ÔªÃû¡£" + IDS_ERROR_REFRESH_AGGREGATES "ÎÞ·¨»ñµÃ·þÎñÆ÷ %1 µÄ·ÖÇøÁÐ±í¡£\n\n´íÎó£º%2" + IDS_ERROR_REFRESH_SERVER_STATUS "ÎÞ·¨»ñµÃ·þÎñÆ÷ %1 µÄµ±Ç°×´Ì¬¡£" + IDS_ERROR_CHANGE_SERVER_STATUS + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 ¸ü¸ÄÌØÐÔ¡£" + IDS_ERROR_REFRESH_AGGREGATE_STATUS + "ÎÞ·¨»ñµÃ·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄµ±Ç°×´Ì¬¡£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_FILESET_STATUS + "ÎÞ·¨»ñµÃ¾í %3 (·þÎñÆ÷¡¡%1£¬·ÖÇø %2)µÄµ±Ç°×´Ì¬¡£" + IDS_ERROR_REFRESH_SERVICE_STATUS + "ÎÞ·¨È·¶¨·þÎñÆ÷ %1 µÄ·þÎñ %2 µÄµ±Ç°×´Ì¬¡£" + IDS_ERROR_MOVE_FILESET "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´Ó·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏÒÆ¶¯¾í %3 µ½·þÎñÆ÷ %4 µÄ·ÖÇø %5¡£" + IDS_ERROR_VIEW_LOGFILE "ÎÞ·¨´Ó·þÎñÆ÷ %1 ¶ÁÈ¡Îļþ %2¡£\n\n¼ì²éÒÔÈ·ÈÏÄúÒÑÕýÈ·ÊäÈëÎļþÃû£¬²¢ÇÒÓÐ×ã¹»µÄȨÏ޲鿴Îļþ¡£" + IDS_ERROR_NOT_REPLICATED "ÎÞ·¨È·¶¨¾í %1 µÄ¸´ÖÆ×´Ì¬¡£" + IDS_ERROR_CANT_CREATE_FILESET + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚ·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏ´´½¨¾í %3¡£" + IDS_ERROR_CANT_DELETE_FILESET + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨É¾³ý¾í %3 (·þÎñÆ÷ %1 µÄ·ÖÇø %2)¡£" + IDS_ERROR_CANT_CREATE_VLDB_ENTRY + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚ·þÎñÆ÷ %1 µÄ·ÖÇø %2 ÉÏΪ¾í %3 ´´½¨ VLDB ÌõÄ¿¡£" + IDS_ERROR_CANT_SET_FILESET_QUOTA + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 µÄ·ÖÇø %2 Éϵľí %3 ¸ü¸ÄÏÞ¶î¡£" + IDS_ERROR_CANT_CREATE_SERVER + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚµ¥Ôª %1 Öд´½¨ÇëÇóµÄ·þÎñÆ÷ÌõÄ¿¡£" + IDS_ERROR_CANT_PING_SERVER + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨È·¶¨·þÎñÆ÷ %1 µÄ IP µØÖ·¡£" + IDS_ERROR_CANT_DELETE_SERVER "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨É¾³ý·þÎñÆ÷ %1¡£" + IDS_ERROR_CANT_DELETE_SERVER_FILESETS + "ÎÞ·¨É¾³ý·þÎñÆ÷ %1£¬ÒòΪËüÈÔÓµÓÐÒ»¸ö»ò¶à¸ö¾í¡£³ý·Ç·þÎñÆ÷²»°üº¬¾í£¬·ñÔò²»ÄÜɾ³ý¡£" + IDS_ERROR_CHANGE_AGGREGATE_STATUS + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸ü¸Ä·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄÌØÐÔ¡£" + IDS_ERROR_CHANGE_SERVICE_STATUS + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸ü¸Ä·þÎñÆ÷ %1 µÄ·þÎñ %2 µÄÌØÐÔ¡£" + IDS_ERROR_CANT_START_SERVICE + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Æô¶¯·þÎñÆ÷ %1 µÄ·þÎñ %2¡£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_STOP_SERVICE + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Í£Ö¹·þÎñÆ÷ %1 µÄ·þÎñ %2¡£" + IDS_ERROR_CANT_RESTART_SERVICE + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Í£Ö¹²¢ÖØÐÂÆô¶¯·þÎñÆ÷ %1 µÄ·þÎñ %2¡£" + IDS_ERROR_CHANGE_REPLICA_STATUS + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 µÄ·ÖÇø %2 Éϵľí %3 ¸ü¸Ä¸´ÖÆÌØÐÔ¡£" + IDS_ERROR_CANT_SYNCVLDB "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸üРVLDB¡£" + IDS_ERROR_CANT_CREATE_REPLICA + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´´½¨·þÎñÆ÷ %1 µÄ·ÖÇø %2 Éϵľí %3 µÄ¸±±¾¡£" + IDS_ERROR_CANT_INSTALL_FILE + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚ·þÎñÆ÷ %1 Éϰ²×°Îļþ %2¡£" + IDS_ERROR_CANT_UNINSTALL_FILE + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚ·þÎñÆ÷ %1 ÉÏжװÎļþ %2¡£" + IDS_ERROR_CANT_PRUNE_FILES + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´Ó·þÎñÆ÷ %1 ÉϳýÈ¥ÇëÇóµÄÎļþ¡£" + IDS_ERROR_CANT_RENAME_FILESET "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÖØÃüÃû¾í %1 Ϊ""%2""¡£" + IDS_ERROR_CANT_CREATE_SERVICE + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚ·þÎñÆ÷ %1 ÉÏ´´½¨·þÎñ %2¡£" + IDS_ERROR_CANT_DELETE_SERVICE + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´Ó·þÎñÆ÷ %1 ÉÏɾ³ý·þÎñ %2¡£" + IDS_ERROR_CANT_RELEASE_FILESET "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÊͷŸ´ÖƵľí %3¡£" + IDS_ERROR_CANT_UPDATE_FILESET + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸üзþÎñÆ÷ %2 µÄ·ÖÇø %1 µÄ¾í¸±±¾ %3¡£" + IDS_ERROR_CANT_UPDATE_ALL "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸üоí %3 µÄÈκθ±±¾¡£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_LOAD_ADMLIST + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¶ÁÈ¡·þÎñÆ÷ %1 µÄ¹ÜÀíÔ±ÁÐ±í¡£" + IDS_ERROR_CANT_LOAD_KEYLIST + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¶ÁÈ¡·þÎñÆ÷ %1 µÄ·þÎñÆ÷ÃÜÔ¿ÁÐ±í¡£" + IDS_ERROR_CANT_CREATE_KEY + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 н¨·þÎñÆ÷ÃÜÔ¿¡£" + IDS_ERROR_CANT_SAVE_ADMLIST + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸ü¸Ä·þÎñÆ÷ %1 µÄ¹ÜÀíÔ±ÁÐ±í¡£" + IDS_ERROR_CANT_CLONE "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´´½¨·þÎñÆ÷ %1 µÄ·ÖÇø %2 Éϵľí %3 µÄ±¸·Ý°æ±¾¡£" + IDS_ERROR_CANT_CLONESYS "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´´½¨ÈκÎÇëÇóµÄ±¸·Ý¾í¡£" + IDS_ERROR_CANT_DUMP_FILESET + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨×ª´¢¾í %3 (·þÎñÆ÷ %1£¬·ÖÇø %2)µÄÄÚÈݵ½Îļþ %4¡£" + IDS_ERROR_CANT_RESTORE_FILESET + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨»Ö¸´Îļþ %4 µ½¾í %3(·þÎñÆ÷ %1£¬·ÖÇø %2)¡£" + IDS_ERROR_CANT_SET_RESTART_TIMES + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸ü¸Ä·þÎñÆ÷ %1 ·þÎñµÄÖØÐÂÆô¶¯Ê±¼ä¡£" + IDS_ERROR_CANT_DELETE_REPLICATED_FILESET + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨É¾³ý·þÎñÆ÷ %1 µÄ·ÖÇø %2 µÄ¾í %3¡£\n\nÎÞ·¨É¾³ý¾í %3£¬³ý·ÇÊ×ÏÈɾ³ýÆäËùÓи±±¾¡£" + IDS_CMDLINE_TITLE "³ö´í - AFS ·þÎñÆ÷¹ÜÀíÆ÷" + IDS_CMDLINE_SYNTAX "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£" + IDS_CMDLINE_UNRECOGNIZED + "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\n ÎÞ·¨Ê¶±ð²ÎÊý ""%1""¡£" + IDS_CMDLINE_DUPLICATE "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\n ²ÎÊý""%1""±»Ö¸¶¨¶à´Î¡£" + IDS_CMDLINE_UNEXPECTVALUE + "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\n ²ÎÊý ""%1"" ²»Ó¦¸³ÓèÖµ¡£" + IDS_CMDLINE_MISSINGVAL "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\n ²ÎÊý ""%1"" ±ØÐë´øÓÐÖµ¡£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CMDLINE_SUBSETNOTCELL + "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\n²ÎÊý""/SUBSET""½öµ±²ÎÊý""/CELL""Ö¸¶¨Ê±²ÅÖ¸¶¨¡£" + IDS_CMDLINE_INVALIDSUBSET + "ÄúÖ¸¶¨µÄ·þÎñÆ÷×Ó¼¯£¬""%2""£¬Ã»ÓÐΪµ¥Ôª %1 ¶¨Òå¡£" + IDS_CMDLINE_SERVERNOTCELL + "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\n²ÎÊý""/SERVER""½öµ±Ö¸¶¨²ÎÊý""/CELL""ʱ²ÅÖ¸¶¨¡£" + IDS_CMDLINE_RESET_TITLE "AFS ·þÎñÆ÷¹ÜÀíÆ÷" + IDS_CMDLINE_RESET_DESC "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÒÑÇå³ýÖ¸¶¨µÄÉèÖá£" + IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Ê¹·þÎñÆ÷ %1 µÄ·ÖÇø %2 Óë VLDB ͬ²½£¬ÒòΪ¸Ã·ÖÇø²»´æÔÚ»òδµ¼³ö¡£\n\nÒª´Ó·þÎñÆ÷ %1 ÉϳýÈ¥¸Ã·ÖÇø£¬Äú±ØÐëɾ³ýÏàÓ¦µÄ¾í VLDB ÌõÄ¿¡£" + IDS_CMDLINE_USERPASSWORD + "ÄúΪ AFS ·þÎñÆ÷¹ÜÀíÆ÷Ö¸¶¨µÄÃüÁîÐÐÎÞЧ¡£\n\nÒª»ñµÃÐ嵀 AFS ÁîÅÆ£¬±ØÐëͬʱָ¶¨²ÎÊý""/USER"" ¼° ""/PASSWORD""¡£" + IDS_ERROR_CANT_DELETE_KEY + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´Ó·þÎñÆ÷ %1 ÉÏɾ³ý·þÎñÆ÷ÃÜÔ¿ %2¡£" + IDS_ERROR_CANT_GETRANDOMKEY + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 Éú³ÉÒ»¸öËæ»úÃÜÔ¿¡£" + IDS_ERROR_CANT_EXECUTE_COMMAND + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨ÔÚ·þÎñÆ÷ %1 ÉÏÖ´ÐÐÏÂÁÐÃüÁ\n\n ""%2""" + IDS_ERROR_CANT_READ_SALVAGE_LOG + "AFS ·þÎñÆ÷¹ÜÀíÆ÷³É¹¦Íê³ÉÍì¾È²Ù×÷£¬µ«ÎÞ·¨¼ìË÷ÃèÊöÍì¾È²Ù×÷ÌØ¶¨½á¹ûµÄÈÕÖ¾Îļþ¡£" + IDS_ERROR_CANT_SALVAGE "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Ö´ÐÐÇëÇóµÄÍì¾È²Ù×÷¡£" + IDS_ERROR_CANT_AUTH_ON "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 ÆôÓÃÈÏÖ¤¼ì²é¡£" + IDS_ERROR_CANT_AUTH_OFF "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 ½ûÓÃÈÏÖ¤¼ì²é¡£" + IDS_ERROR_CANT_LOAD_HOSTLIST + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨´Ó·þÎñÆ÷ %1 É϶ÁÈ¡Êý¾Ý¿âÖ÷»ú·þÎñÆ÷ÁÐ±í¡£" + IDS_ERROR_CANT_SAVE_HOSTLIST + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨¸ü¸Ä·þÎñÆ÷ %1 ÉϵÄÊý¾Ý¿âÖ÷»ú·þÎñÆ÷ÁÐ±í¡£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Æô¶¯£¬ÒòΪ¸Ã¼ÆËã»úÉÏδÕýÈ·°²×° AFS ¿ØÖÆÖÐÐÄ¡£\n\nÄú¿ÉÄÜÐèÒªÖØÐ°²×° AFS ¿ØÖÆÖÐÐÄ¡£" + IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN + "ÓÉÓÚÒ»¸öδ֪ÎÊÌ⣬AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Æô¶¯¡£\n\nÄú¿ÉÄÜÐèÒªÖØÐ°²×° AFS ¿ØÖÆÖÐÐÄ¡£" + IDS_ERROR_CANT_CHANGEADDR + "AFS ·þÎñÆ÷¹ÜÀíÆ÷ÎÞ·¨Îª·þÎñÆ÷ %1 ¸ü¸Ä VLDB ÖÐµÄ IP µØÖ·¡£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_SERVICE "%1:%2" + IDS_SERVICETYPE_SIMPLE "¼òµ¥" + IDS_SERVICETYPE_CRON "Cron" + IDS_SERVICESTATE_STOPPED "ÒÑÍ£Ö¹" + IDS_SERVICESTATE_STOPPING "ÕýÔÚÍ£Ö¹" + IDS_SERVICESTATE_STARTING "ÕýÔÚÆô¶¯" + IDS_SERVICESTATE_RUNNING "ÕýÔÚÔËÐÐ" + IDS_SERVICETYPE_FS_LONG "FS (Îļþϵͳ)" + IDS_SERVICETYPE_FS "FS" + IDS_SERVICE_LASTERROR "%1" + IDS_SERVICES_IN_CELL "µ¥Ôª %1 ÖÐËùÓзþÎñ£º" + IDS_SERVICE_STARTDATE "ÒÑÆô¶¯ %1" + IDS_SERVICE_STOPDATE "ÒÑÍ£Ö¹ %1" +END + +#endif // Chinese (P.R.C.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afssvrmgr/lang/zh_TW/svrmgr.rc b/src/WINNT/afssvrmgr/lang/zh_TW/svrmgr.rc index febb014a1..357484d49 100644 --- a/src/WINNT/afssvrmgr/lang/zh_TW/svrmgr.rc +++ b/src/WINNT/afssvrmgr/lang/zh_TW/svrmgr.rc @@ -7,2959 +7,2959 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#include -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "AFS Server Manager" +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "AFS Server Manager" #define AFS_VERINFO_NAME "svrmgr" #define AFS_VERINFO_FILENAME "svrmgr.exe" #define AFS_VERINFO_LANG_CODE 0x404 #define AFS_VERINFO_CHARSET 950 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Chinese (Taiwan) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHT) -#ifdef _WIN32 -LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_SERVICES, DIALOG - BEGIN - LEFTMARGIN, 3 - RIGHTMARGIN, 162 - END - - IDD_AGGREGATES, DIALOG - BEGIN - RIGHTMARGIN, 121 - END - - IDD_FILESETS, DIALOG - BEGIN - RIGHTMARGIN, 163 - VERTGUIDE, 188 - VERTGUIDE, 189 - END - - IDD_SVR_LISTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_AGG_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 262 - TOPMARGIN, 5 - BOTTOMMARGIN, 155 - END - - IDD_SVR_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 183 - END - - IDD_SVR_SCOUT, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 216 - TOPMARGIN, 5 - BOTTOMMARGIN, 153 - END - - IDD_SVC_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 268 - TOPMARGIN, 5 - BOTTOMMARGIN, 209 - END - - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 315 - TOPMARGIN, 2 - BOTTOMMARGIN, 224 - END - - IDD_SERVER, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 207 - TOPMARGIN, 2 - BOTTOMMARGIN, 135 - END - - IDD_SVC_CREATE, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 228 - END - - IDD_SET_REPSITES, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 216 - TOPMARGIN, 5 - BOTTOMMARGIN, 163 - END - - IDD_OPENCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 7 - BOTTOMMARGIN, 253 - HORZGUIDE, 160 - END - - IDD_TIMEOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 232 - TOPMARGIN, 7 - BOTTOMMARGIN, 153 - END - - IDD_COLUMNS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 281 - TOPMARGIN, 5 - BOTTOMMARGIN, 143 - END - - IDD_REFRESHALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 260 - TOPMARGIN, 7 - BOTTOMMARGIN, 68 - END - - IDD_SET_CREATE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 317 - TOPMARGIN, 4 - BOTTOMMARGIN, 205 - END - - IDD_SET_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 98 - END - - IDD_SET_CLONE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 341 - TOPMARGIN, 7 - BOTTOMMARGIN, 81 - END - - IDD_SVC_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 189 - END - - IDD_SVR_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 152 - END - - IDD_AGG_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 252 - TOPMARGIN, 5 - BOTTOMMARGIN, 146 - END - - IDD_SET_PROBLEMS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 268 - TOPMARGIN, 5 - BOTTOMMARGIN, 177 - END - - IDD_SET_MOVETO, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 170 - END - - IDD_SET_MOVING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SVC_LOGNAME, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 102 - END - - IDD_SVC_VIEWLOG, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 181 - END - - IDD_SET_SETQUOTA, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 267 - TOPMARGIN, 4 - BOTTOMMARGIN, 126 - END - - IDD_ACTIONS, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 234 - TOPMARGIN, 2 - BOTTOMMARGIN, 56 - END - - IDD_SVR_SYNCVLDB, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 265 - TOPMARGIN, 4 - BOTTOMMARGIN, 95 - END - - IDD_SET_CREATEREP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 4 - BOTTOMMARGIN, 167 - END - - IDD_SVR_INSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 152 - END - - IDD_SVR_UNINSTALL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 135 - END - - IDD_SVR_PRUNE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 220 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_SET_RENAME, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 129 - END - - IDD_SVC_DELETE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 64 - END - - IDD_SVR_GETDATES, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_GETDATES_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 128 - END - - IDD_SET_DUMP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 291 - TOPMARGIN, 7 - BOTTOMMARGIN, 140 - END - - IDD_SET_RESTORE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 288 - TOPMARGIN, 4 - BOTTOMMARGIN, 244 - END - - IDD_SVC_BOS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 220 - TOPMARGIN, 5 - BOTTOMMARGIN, 202 - END - - IDD_SET_DUMPING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SET_RESTORING, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 233 - TOPMARGIN, 2 - BOTTOMMARGIN, 60 - END - - IDD_SET_CLONESYS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 254 - TOPMARGIN, 7 - BOTTOMMARGIN, 159 - END - - IDD_SUBSETS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 276 - TOPMARGIN, 5 - BOTTOMMARGIN, 177 - END - - IDD_SUBSET_LOADSAVE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 276 - TOPMARGIN, 4 - BOTTOMMARGIN, 141 - END - - IDD_HELP_FIND, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 214 - TOPMARGIN, 4 - BOTTOMMARGIN, 69 - END - - IDD_HELP_ERROR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 4 - BOTTOMMARGIN, 131 - END - - IDD_HELP_ABOUT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 226 - TOPMARGIN, 4 - BOTTOMMARGIN, 137 - END - - IDD_OPENINGCELL, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 236 - TOPMARGIN, 2 - BOTTOMMARGIN, 41 - END - - IDD_OPTIONS_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 274 - TOPMARGIN, 5 - BOTTOMMARGIN, 134 - END - - IDD_SVR_KEYS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_CREATEKEY, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 274 - TOPMARGIN, 7 - BOTTOMMARGIN, 143 - END - - IDD_SVC_STARTSTOP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 128 - END - - IDD_SVR_EXECUTE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 244 - TOPMARGIN, 4 - BOTTOMMARGIN, 121 - END - - IDD_SVR_SALVAGE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 258 - TOPMARGIN, 7 - BOTTOMMARGIN, 251 - END - - IDD_SVR_SALVAGE_RESULTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 174 - END - - IDD_SET_RELEASE, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 273 - TOPMARGIN, 7 - BOTTOMMARGIN, 98 - END - - IDD_SVR_HOSTS, DIALOG - BEGIN - LEFTMARGIN, 5 - RIGHTMARGIN, 221 - TOPMARGIN, 5 - BOTTOMMARGIN, 174 - END - - IDD_SVR_ADDHOST, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 221 - TOPMARGIN, 4 - BOTTOMMARGIN, 102 - END - - IDD_SVR_ADDRESS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 204 - TOPMARGIN, 4 - BOTTOMMARGIN, 111 - END - - IDD_SVR_NEWADDR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 219 - TOPMARGIN, 4 - BOTTOMMARGIN, 65 - END -END -#endif // APSTUDIO_INVOKED - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Server Manager""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_MAIN MENU DISCARDABLE -BEGIN - POPUP "Cell (&C)" - BEGIN - MENUITEM "¿ï¨ú(&S)...", M_CELL_OPEN - MENUITEM "Ų§O(&A)...", M_CREDENTIALS - MENUITEM SEPARATOR - MENUITEM "µ²§ô(&X)", M_EXIT - END - POPUP "À˵ø(&V)" - BEGIN - POPUP "¦øªA¾¹(&S)" - BEGIN - MENUITEM "¤j¹Ï¥Ü(&G)", M_SVR_VIEW_LARGE - , CHECKED - MENUITEM "¤p¹Ï¥Ü(&M)", M_SVR_VIEW_SMALL - , CHECKED - MENUITEM "©ú²Ó(&D)", M_SVR_VIEW_REPORT - , CHECKED - MENUITEM SEPARATOR - MENUITEM "¤@¯ë(&N)", M_SVR_VIEW_ONEICON - , CHECKED - MENUITEM "©Ò¦³¹Ï¥Ü(&A)", M_SVR_VIEW_TWOICONS - , CHECKED - MENUITEM "¥u¦³ª¬ºA(&S)", M_SVR_VIEW_STATUS - , CHECKED - END - POPUP "§Ö³tÀ˵øµ¡®æ(&Q)" - BEGIN - MENUITEM "¤£Åã¥Ü(&N)", M_DIVIDE_NONE, CHECKED - MENUITEM "««ª½¤À³Î(&V)", M_DIVIDE_H, CHECKED - MENUITEM "¤ô¥­¤À³Î(&H)", M_DIVIDE_V, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "§@·~¶i¦æ¤¤(&P)", M_ACTIONS, CHECKED - MENUITEM SEPARATOR - MENUITEM "ºÊµø¤Uªº¦øªA¾¹(&M)...", M_SUBSET - MENUITEM "ª½Äæ(&C)...", M_COLUMNS - MENUITEM "¿ï¶µ(&O)...", M_OPTIONS - MENUITEM SEPARATOR - MENUITEM "¥þ³¡­«·s¾ã²z(&F)", M_REFRESHALL - END - POPUP "»¡©ú(&H)" - BEGIN - MENUITEM "¤º®e(&C)", M_HELP - MENUITEM "·j´M«ü¥O(&F)...", M_HELP_FIND - MENUITEM "¬d¾\¿ù»~½X(&L)...", M_HELP_XLATE - MENUITEM SEPARATOR - MENUITEM "Ãö©ó AFS ¦øªA¾¹ºÞ²zµ{¦¡(&A)...", M_ABOUT - END -END - -MENU_AGG MENU DISCARDABLE -BEGIN - MENUITEM "«Ø¥ß®eÅé(&C)...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "³Æ¥÷®eÅé(&B)...", M_SET_CLONE - MENUITEM "¸Ñ°£©Ò¦³®eÅ骺Âê©w(&U)", M_SET_UNLOCK - MENUITEM "¦P¨B¤Æ VLDB(&Y)...", M_SYNCVLDB - MENUITEM "´©±Ï®eÅé(&G)...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "­«·s¾ã²z(&F)", M_REFRESH - MENUITEM "¤º®e(&R)", M_PROPERTIES -END - -MENU_SVC MENU DISCARDABLE -BEGIN - MENUITEM "±Ò°Ê(&S)", M_SVC_START - MENUITEM "°±¤î(&S)", M_SVC_STOP - MENUITEM "­«·s±Ò°Ê(&R)", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "À˵ø¤é»xÀÉ(&V)", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "§R°£(&L)", M_SVC_DELETE - MENUITEM SEPARATOR - MENUITEM "­«·s¾ã²z(&F)", M_REFRESH - MENUITEM "¤º®e(&R)", M_PROPERTIES -END - -MENU_AGG_NONE MENU DISCARDABLE -BEGIN - POPUP "À˵ø(&V)" - BEGIN - MENUITEM "¤@¯ë(&N)", M_VIEW_ONEICON, CHECKED - MENUITEM "©Ò¦³¹Ï¥Ü(&A)", M_VIEW_TWOICONS, CHECKED - MENUITEM "¥u¦³ª¬ºA(&S)", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "«Ø¥ß®eÅé(&C)...", M_SET_CREATE - MENUITEM SEPARATOR - MENUITEM "¥þ³¡­«·s¾ã²z(&F)", M_REFRESHALL -END - -MENU_SVC_NONE MENU DISCARDABLE -BEGIN - POPUP "À˵ø(&V)" - BEGIN - MENUITEM "¤@¯ë(&N)", M_VIEW_ONEICON, CHECKED - MENUITEM "©Ò¦³¹Ï¥Ü(&A)", M_VIEW_TWOICONS, CHECKED - MENUITEM "¥u¦³ª¬ºA(&S)", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "«Ø¥ßªA°È(&C)...", M_SVC_CREATE - MENUITEM SEPARATOR - MENUITEM "¥þ³¡­«·s¾ã²z(&F)", M_REFRESHALL -END - -MENU_SET MENU DISCARDABLE -BEGIN - MENUITEM "½Æ»s(&P)...", M_SET_REPLICATION - MENUITEM "¥ß§YÄÀ©ñ(&S)", M_SET_RELEASE - MENUITEM SEPARATOR - MENUITEM "³Æ¥÷(&B)...", M_SET_CLONE - MENUITEM "¶É¥X¦ÜÀÉ®×(&D)...", M_SET_DUMP - MENUITEM "¦ÛÀÉ®×´_­ì(&R)...", M_SET_RESTORE - MENUITEM "³]©w°tÃB(&Q)...", M_SET_SETQUOTA - MENUITEM "´©±Ï(&G)...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "²¾°Ê¦Ü(&M)...", M_SET_MOVETO - MENUITEM "­«·s©R¦W(&N)...", M_SET_RENAME - MENUITEM "§R°£(&L)", M_SET_DELETE - MENUITEM SEPARATOR - MENUITEM "Âê©w(&K)", M_SET_LOCK - MENUITEM "¸Ñ°£Âê©w(&U)", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "­«·s¾ã²z(&F)", M_REFRESH - MENUITEM "¤º®e(&R)", M_PROPERTIES -END - -MENU_SVR MENU DISCARDABLE -BEGIN - MENUITEM "¶}±Ò¦øªA¾¹µøµ¡(&O)", M_SVR_OPEN - MENUITEM "Ãö³¬¦øªA¾¹µøµ¡(&C)", M_SVR_CLOSE - MENUITEM "ºÊµø³o­Ó¦øªA¾¹(&M)", M_SVR_MONITOR, CHECKED - MENUITEM SEPARATOR - MENUITEM "½s¿è¦øªA¾¹¦w¥þ(&S)...", M_SVR_SECURITY - MENUITEM "ºÞ²z¸ê®Æ®w¥D¹q¸£(&H)...", M_SVR_HOSTS - MENUITEM "³Æ¥÷®eÅé(&B)...", M_SET_CLONE - MENUITEM "¸Ñ°£©Ò¦³®eÅ骺Âê©w(&U)", M_SET_UNLOCK - MENUITEM "¦P¨B¤Æ VLDB (&Y)...", M_SYNCVLDB - MENUITEM "´©±Ï®eÅé(&G)...", M_SALVAGE - MENUITEM SEPARATOR - MENUITEM "¦w¸ËÀÉ®×(&I)...", M_SVR_INSTALL - MENUITEM "¸Ñ°£¦w¸ËÀÉ®×(&U)...", M_SVR_UNINSTALL - MENUITEM "§R°£ÂÂÀÉ®×(&P)...", M_SVR_PRUNE - MENUITEM SEPARATOR - MENUITEM "¨ú±oÀɮפé´Á(&T)...", M_SVR_GETDATES - MENUITEM "À˵ø¤é»xÀÉ(&V)...", M_VIEWLOG - MENUITEM "°õ¦æ«ü¥O(&X)...", M_EXECUTE - MENUITEM SEPARATOR - MENUITEM "­«·s¾ã²z(&F)", M_REFRESH - MENUITEM "¤º®e(&R)", M_PROPERTIES -END - -MENU_SVR_NONE MENU DISCARDABLE -BEGIN - POPUP "À˵ø(&V)" - BEGIN - MENUITEM "¤j¹Ï¥Ü(&G)", M_SVR_VIEW_LARGE, CHECKED - MENUITEM "¤p¹Ï¥Ü(&M)", M_SVR_VIEW_SMALL, CHECKED - MENUITEM "©ú²Ó(&D)", M_SVR_VIEW_REPORT, CHECKED - MENUITEM SEPARATOR - MENUITEM "¤@¯ë(&N)", M_SVR_VIEW_ONEICON, CHECKED - MENUITEM "©Ò¦³¹Ï¥Ü(&A)", M_SVR_VIEW_TWOICONS, CHECKED - MENUITEM "¥u¦³ª¬ºA(&S)", M_SVR_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "ºÊµø¤Uªº¦øªA¾¹(&M)...", M_SUBSET - MENUITEM SEPARATOR - MENUITEM "¸Ñ°£©Ò¦³®eÅ骺Âê©w(&U)", M_SET_UNLOCK - MENUITEM SEPARATOR - MENUITEM "¥þ³¡Ãö³¬(&C)", M_SVR_CLOSEALL - MENUITEM "¥þ³¡­«·s¾ã²z(&F)", M_REFRESHALL -END - -MENU_SET_NONE MENU DISCARDABLE -BEGIN - POPUP "À˵ø(&V)" - BEGIN - MENUITEM "¨Ì®eÅé(&V)", M_SET_VIEW_REPORT, CHECKED - MENUITEM "¨Ì¤À³Î°Ï(&P)", M_SET_VIEW_TREELIST, CHECKED - MENUITEM "¨S¦³©ú²Ó(&D)", M_SET_VIEW_TREE, CHECKED - MENUITEM SEPARATOR - MENUITEM "¤@¯ë(&N)", M_VIEW_ONEICON, CHECKED - MENUITEM "©Ò¦³¹Ï¥Ü(&A)", M_VIEW_TWOICONS, CHECKED - MENUITEM "¥u¦³ª¬ºA(&S)", M_VIEW_STATUS, CHECKED - END - MENUITEM SEPARATOR - MENUITEM "«Ø¥ß®eÅé(&C)...", M_SET_CREATE - MENUITEM "¦ÛÀÉ®×´_­ì(&R)...", M_SET_RESTORE - MENUITEM SEPARATOR - MENUITEM "³Æ¥÷®eÅé(&B)...", M_SET_CLONE - MENUITEM SEPARATOR - MENUITEM "¥þ³¡¸Ñ°£Âê©w(&U)", M_SET_UNLOCK - MENUITEM "¥þ³¡­«·s¾ã²z(&F)", M_REFRESHALL -END - -MENU_COLUMNS MENU DISCARDABLE -BEGIN - MENUITEM "ª½Äæ(&C)...", M_COLUMNS -END - -MENU_SVC_BOS MENU DISCARDABLE -BEGIN - MENUITEM "­«·s±Ò°Ê(&R)", M_SVC_RESTART - MENUITEM SEPARATOR - MENUITEM "À˵ø¤é»xÀÉ(&V)", M_VIEWLOG - MENUITEM SEPARATOR - MENUITEM "­«·s¾ã²z(&F)", M_REFRESH - MENUITEM "¤º®e(&R)", M_PROPERTIES -END - -MENU_SET_DRAGDROP MENU DISCARDABLE -BEGIN - MENUITEM "²¾¨ì¦¹³B(&M)...", M_SET_MOVEHERE - MENUITEM "½Æ»s¦¹³B(&R)...", M_SET_REPHERE - MENUITEM SEPARATOR - MENUITEM "¨ú®ø(&C)", IDC_STATIC -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SERVICES DIALOGEX 0, 0, 176, 98 -STYLE DS_CENTER | WS_CHILD -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "ªA°È¡G",IDC_SVC_DESC,6,5,150,8 - CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,3,17,169, - 61,WS_EX_STATICEDGE - PUSHBUTTON "«Ø¥ß(&C)...",IDC_SVC_CREATE,20,83,47,12 - PUSHBUTTON "§R°£(&L)",IDC_SVC_DELETE,72,83,47,12 - PUSHBUTTON "­«·s±Ò°Ê(&R)",IDC_SVC_RESTART,125,83,47,12 -END - -IDD_AGGREGATES DIALOGEX 0, 0, 168, 87 -STYLE DS_CENTER | WS_CHILD -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "¤À³Î°Ï¡G",IDC_AGG_DESC,2,5,154,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,1,17,164, - 53,WS_EX_STATICEDGE - PUSHBUTTON "«Ø¥ß®eÅé(&C)...",IDC_AGG_CREATESET,102,75,63,12 -END - -IDD_FILESETS DIALOGEX 0, 0, 195, 96 -STYLE DS_CENTER | WS_CHILD -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "®eÅé¡G",IDC_SET_DESC,6,5,166,8 - CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,5,17,184, - 61,WS_EX_STATICEDGE - PUSHBUTTON "«Ø¥ß(&C)...",IDC_SET_CREATE,4,82,39,12 - PUSHBUTTON "§R°£(&L)",IDC_SET_DELETE,47,82,39,12 - PUSHBUTTON "½Æ»s(&R)...",IDC_SET_REP,90,82,39,12 - PUSHBUTTON "³]©w°tÃB(&Q)...",IDC_SET_SETQUOTA,134,82,55,12 -END - -IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, - 135,WS_EX_CLIENTEDGE - PUSHBUTTON "·s¼WºÞ²z­û(&A)",IDC_LIST_ADD,55,160,80,14 - PUSHBUTTON "²¾°£ºÞ²z­û(&R)",IDC_LIST_REMOVE,141,160,80,14 - LTEXT "¦øªA¾¹ %1 ªººÞ²z­û¡G",IDC_LIST_NAME,5,7,216,8 -END - -IDD_AGG_GENERAL DIALOGEX 0, 0, 267, 160 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "ID:",IDC_STATIC,5,30,31,8 - LTEXT "¡]¬d¸ß¡^",IDC_AGG_ID,38,30,214,8 - LTEXT "¸Ë¸m¡G",IDC_STATIC,5,46,31,8 - LTEXT "¡]¬d¸ß¡^",IDC_AGG_DEVICE,38,46,214,8 - LTEXT "®eÅé¡G",IDC_STATIC,5,62,31,8 - LTEXT "¡]¬d¸ß¡^",IDC_AGG_FILESETS,38,62,214,8 - CONTROL "­Y¥[Á`ªº®eÅé°tÃB¶W¹L®e¶q¡A«hÅã¥Üĵ§i(&V)", - IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 38,76,224,10 - LTEXT "¥Î¶q¡G",IDC_STATIC,5,90,31,8 - LTEXT "¡]¬d¸ß¡^",IDC_AGG_USAGE,38,90,214,8 - CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,38,103,224,8, - WS_EX_STATICEDGE - CONTROL "­Y¤À³Î°Ïªº¨Ï¥Î¹L¶q¡A«hÅã¥Üĵ§i(&W)",IDC_AGG_WARN,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,38,116,214,10 - CONTROL "¥»¦øªA¾¹ªº¹w³]Á{¬É­È",IDC_AGG_WARN_AGGFULL_DEF,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,49,131,203,9 - CONTROL "Á{¬É­È(&T)",IDC_AGG_WARN_AGGFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,49,145,62,9 - EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,112,143,29,12, - ES_AUTOHSCROLL - LTEXT "¦û¨ä¤j¤pªº¦Ê¤À¤ñ",IDC_AGG_WARN_AGGFULL_DESC,152,145,100, - 8 - ICON IDI_AGGREGATE,IDC_STATIC,5,5,20,20 - LTEXT "¤À³Î°Ï %2¡]¦øªA¾¹ %1¡^",IDC_AGG_NAME,38,14,214,8 -END - -IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "IP ¦ì§} ¡G",IDC_STATIC,5,29,36,8 - LISTBOX IDC_SVR_ADDRESSES,42,29,82,14,LBS_NOSEL | NOT WS_BORDER | - WS_VSCROLL - PUSHBUTTON "Åܧó¦ì§}(&A)...",IDC_SVR_CHANGEADDR,144,27,77,12 - PUSHBUTTON "»Ý­nŲ§O(&R)",IDC_SVR_AUTH_YES,41,88,84,12 - PUSHBUTTON "¤¹³\¤£°µÅ²§O(&U)",IDC_SVR_AUTH_NO,129,88,80,12 - LTEXT "¤À³Î°Ï¼Æ¥Ø¡G",IDC_STATIC,11,131,90,8 - LTEXT "¡]¬d¸ß¡^",IDC_SVR_NUMAGGREGATES,108,131,99,8 - LTEXT "Á`®e¶q¡G",IDC_STATIC,11,148,48,8 - LTEXT "¡]¬d¸ß¡^",IDC_SVR_CAPACITY,108,148,99,8 - LTEXT "¥[Á`ªº®eÅé°tÃB¡G",IDC_STATIC,11,165,79,8 - LTEXT "¡]¬d¸ß¡^",IDC_SVR_ALLOCATION,108,165,99,8 - ICON IDI_SERVER,IDC_STATIC,5,5,20,20 - LTEXT "¡]¦øªA¾¹¦WºÙ¡^",IDC_SVR_NAME,55,13,93,8 - GROUPBOX "¦w¥þ©Ê",IDC_STATIC,5,52,216,52 - GROUPBOX "Àx¦sÅé",IDC_STATIC,5,115,216,68 - LTEXT "±z¥i¥H­n¨D©Ò¦³¹ï¥»¦øªA¾¹©Ò°µªº¦s¨ú³£¥²¶·¶i¦æÅ²§O¡C", - IDC_STATIC,11,67,194,17 -END - -IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 221, 158 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - CONTROL "¥»¦øªA¾¹¤Wªº¥ô¦ó¤À³Î°Ï¹F¨ì",IDC_SVR_WARN_AGGFULL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,12,18,128,9 - EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,141,16,30,12,ES_AUTOHSCROLL - LTEXT "% º¡",IDC_STATIC,190,18,21,8 - CONTROL "¥»¦øªA¾¹¤Wªº¥ô¦ó®eÅé¹F¨ì",IDC_SVR_WARN_SETFULL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,12,32,125,9 - EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,141,30,31,12,ES_AUTOHSCROLL - LTEXT "% º¡",IDC_STATIC,190,32,21,8 - CONTROL "¥ô¦ó¤À³Î°Ï¤Wªº¥[Á`°tÃB¶W¹L¨ä®e¶q",IDC_SVR_WARN_AGGALLOC, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,46,200,9 - CONTROL "°±¤î°õ¦æ¥»¦øªA¾¹¤Wªº¥ô¦óªA°È",IDC_SVR_WARN_SVCSTOP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,60,195,9 - CONTROL "¥»¦øªA¾¹ªº¥ô¦ó®eÅé³£¨S¦³ VLDB ¶µ¥Ø", - IDC_SVR_WARN_SETNOVLDB,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,74,195,9 - CONTROL "VLDB °Ñ·Ó¥»¦øªA¾¹¤Wªº¥ô¦óÂ÷½u¤À³Î°Ï", - IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,88,195,9 - CONTROL "VLDB °Ñ·Ó¥»¦øªA¾¹¤Wªº¥ô¦óÂ÷½u®eÅé", - IDC_SVR_WARN_SETNOSERV,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,12,103,195,9 - CONTROL "­«·s¾ã²z¦øªA¾¹¸ê°T¡A¨C¹j",IDC_SVR_AUTOREFRESH,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,5,142,111,9 - EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,124,140,27,13,ES_AUTOHSCROLL - LTEXT "¤ÀÄÁ",IDC_STATIC,178,142,25,8 - LTEXT "·í¦³¤U¦C±¡ªp®É¡A·|Åã¥Üĵ§i",IDC_STATIC,5,5,195,8 -END - -IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 225, 207 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - PUSHBUTTON "À˵øªA°È¤é»x(&V)",IDC_SVC_VIEWLOG,43,182,66,14 - PUSHBUTTON "¥ß§Y±Ò°Ê(&S)",IDC_SVC_START,113,182,49,14 - PUSHBUTTON "¥ß§Y°±¤î(&P)",IDC_SVC_STOP,166,182,49,14 - CONTROL "¥»ªA°È¦p°±¤î¤U¨Ó¡A«hÅã¥Üĵ§i(&W)",IDC_SVC_WARNSTOP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,159,200,10 - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "ªA°È %2¡]¦øªA¾¹ %1¡^",IDC_SVC_NAME,52,13,168,8 - LTEXT "Ãþ«¬¡G",IDC_STATIC,5,29,44,8 - LTEXT "¡]¬d¸ß¡^",IDC_SVC_TYPE,52,29,168,8 - LTEXT "°Ñ¼Æ¡G",IDC_STATIC,5,45,44,8 - EDITTEXT IDC_SVC_PARAMS,52,45,168,13,ES_AUTOHSCROLL | ES_READONLY | - NOT WS_BORDER | NOT WS_TABSTOP - LTEXT "³qª¾ªÌ¡G",IDC_STATIC,5,61,44,8 - LTEXT "¡]¬d¸ß¡^",IDC_SVC_NOTIFIER,52,61,168,8 - LTEXT "¤W¦¸±Ò°Ê¡G",IDC_STATIC,5,77,44,8 - LTEXT "¡]¬d¸ß¡^",IDC_SVC_STARTDATE,52,77,168,8 - LTEXT "¤W¦¸°±¤î¡G",IDC_STATIC,5,93,44,8 - LTEXT "¡]¬d¸ß¡^",IDC_SVC_STOPDATE,52,93,168,8 - LTEXT "¤W¦¸¥¢®Ä¡G",IDC_STATIC,5,109,44,8 - EDITTEXT IDC_SVC_LASTERROR,52,109,168,13,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - GROUPBOX "ªA°Èª¬ºA",IDC_STATIC,5,127,215,75 - LTEXT "¥¿¦b§PÂ_¥»ªA°È¥Ø«eªºª¬ªp...",IDC_SVC_STATUS,11,142,200, - 8 -END - -IDD_SET_GENERAL DIALOGEX 0, 0, 273, 214 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "®eÅé ID¡G",IDC_STATIC,5,30,39,8 - LTEXT "¡]¤£©ú¡^",IDC_SET_ID,48,30,168,8 - LTEXT "«Ø¥ß¤é´Á¡G",IDC_STATIC,5,46,42,8 - LTEXT "¡]¬d¸ß¡^",IDC_SET_CREATEDATE,48,46,167,8 - LTEXT "§ó·s¤é´Á¡G",IDC_STATIC,5,62,41,8 - LTEXT "¡]¬d¸ß¡^",IDC_SET_UPDATEDATE,48,62,112,8 - LTEXT "¦s¨ú¤é´Á¡G",IDC_STATIC,5,78,41,8 - LTEXT "¡]¬d¸ß¡^",IDC_SET_ACCESSDATE,48,78,167,8 - LTEXT "³Æ¥÷¤é´Á¡G",IDC_STATIC,5,94,40,8 - LTEXT "¡]¬d¸ß¡^",IDC_SET_BACKUPDATE,48,94,181,8 - LTEXT "Àɮ׭ӼơG",IDC_STATIC,5,110,42,8 - LTEXT "¡]¬d¸ß¡^",IDC_SET_FILES,48,110,179,8 - LTEXT "ª¬ºA¡G",IDC_STATIC,5,126,32,8 - LTEXT "¡]¬d¸ß¡^",IDC_SET_STATUS,48,126,62,8 - PUSHBUTTON "Âê©w(&L)",IDC_SET_LOCK,150,124,55,12 - PUSHBUTTON "¸Ñ°£Âê©w(&U)",IDC_SET_UNLOCK,213,124,55,12 - LTEXT "¥Î¶q¡G",IDC_STATIC,5,142,31,8 - LTEXT "¡]¬d¸ß¡^",IDC_SET_USAGE,48,142,109,8 - PUSHBUTTON "³]©w°tÃB(&Q)...",IDC_SET_QUOTA,213,140,55,12 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,49,156,219,8, - WS_EX_STATICEDGE - CONTROL "¦pªG¦¹®eÅ骺¥Î¶q¶W¹L¤U¦C±¡§Î¡A«h·|Åã¥Üĵ§i(&W)", - IDC_SET_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,49, - 170,219,10 - CONTROL "¥»¦øªA¾¹ªº¹w³]Á{¬É­È¡]¨ä¤j¤pªº %1%%¡^(&D)", - IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | - BS_MULTILINE,61,185,207,9 - CONTROL "¨ä¤j¤pªº",IDC_SET_WARN_SETFULL,"Button", - BS_AUTORADIOBUTTON | BS_MULTILINE,61,199,62,9 - EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,123,197,29,12, - ES_AUTOHSCROLL - LTEXT " % Á{¬É­È(&T)",IDC_SET_WARN_SETFULL_DESC,163,199,105,8 - ICON IDI_FILESET,IDC_STATIC,5,5,20,20 - LTEXT "®eÅé %3¡]¦øªA¾¹ %1¡A¤À³Î°Ï %2¡^",IDC_SET_NAME,49,14,219, - 8 -END - -IDD_MAIN DIALOGEX 0, 0, 317, 226 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | - WS_SYSMENU | WS_THICKFRAME -CAPTION "AFS ¦øªA¾¹ºÞ²zµ{¦¡" -MENU MENU_MAIN -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "¤w¿ï¨úªº Cell¡G",IDC_STATIC,2,8,67,8 - LTEXT "¡]±N·|§â Cell ¦WºÙ©ñ¦b¦¹³B¡^",IDC_CELL,62,8,208,9 - LTEXT "AFS °O¸¹¡G",IDC_STATIC,2,19,55,8 - LTEXT "%2:%1¡]°O¸¹±N¹L´Á %3¡^",IDC_AFS_ID,62,19,208,9 - CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,31,313, - 193,WS_EX_CLIENTEDGE - CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 - ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 -STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "¦øªA¾¹" -CLASS "ServerWindowClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - CONTROL "",IDC_TABS,"SysTabControl32",0x0,2,2,205,133 -END - -IDD_SVC_CREATE DIALOGEX 0, 0, 225, 233 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¦øªA¾¹(&S)¡G",IDC_STATIC,5,36,44,8 - COMBOBOX IDC_SVC_SERVER,52,33,116,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "ªA°È(&V)¡G",IDC_STATIC,5,52,44,8 - COMBOBOX IDC_SVC_NAME,52,50,116,104,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "«ü¥O(&C)¡G",IDC_STATIC,5,70,44,8 - EDITTEXT IDC_SVC_COMMAND,52,68,168,13,ES_AUTOHSCROLL - LTEXT "°Ñ¼Æ(&P)¡G",IDC_STATIC,5,88,44,8 - EDITTEXT IDC_SVC_PARAMS,52,86,168,13,ES_AUTOHSCROLL - LTEXT "³qª¾ªÌ(&N)¡G",IDC_STATIC,5,105,44,8 - EDITTEXT IDC_SVC_NOTIFIER,52,103,168,13,ES_AUTOHSCROLL - LTEXT "¤é»xÀÉ(&L)¡G",IDC_STATIC,5,122,44,8 - EDITTEXT IDC_SVC_LOGFILE,52,120,168,13,ES_AUTOHSCROLL - CONTROL "²¦¡¡]«ùÄò°õ¦æ¡^(&I) ",IDC_SVC_TYPE_SIMPLE,"Button", - BS_AUTORADIOBUTTON,11,154,201,10 - CONTROL "¥ß§Y±Ò°Ê¥»ªA°È(&T)",IDC_SVC_RUNNOW,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 - CONTROL "FS¡]Àɮרt²Î¡^(&F) ",IDC_SVC_TYPE_FS,"Button", - BS_AUTORADIOBUTTON,11,180,201,10 - CONTROL "Cron¡]¦b«ü©w¶¡¹j°õ¦æ¡^(&R) ",IDC_SVC_TYPE_CRON,"Button", - BS_AUTORADIOBUTTON,11,195,201,10 - LTEXT "°õ¦æ¤é´Á(&W)¡G",IDC_STATIC,12,209,54,8 - COMBOBOX IDC_SVC_RUNDAY,70,207,69,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "®É¶¡",IDC_STATIC,143,209,8,8 - CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,154,207, - 53,13,WS_EX_CLIENTEDGE - ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 - LTEXT "·sªºªA°È",IDC_SVC_DESC,52,13,168,8 - GROUPBOX "ªA°ÈÃþ«¬",IDC_STATIC,5,141,215,87 -END - -IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, - 199,58,WS_EX_CLIENTEDGE - PUSHBUTTON "¥ß§YÄÀ©ñ(&R)",IDC_SET_RELEASE,11,143,52,14 - PUSHBUTTON "«Ø¥ß(&C)...",IDC_SET_REPSITE_ADD,129,143,38,14 - PUSHBUTTON "§R°£(&L)",IDC_SET_REPSITE_DELETE,172,143,38,14 - LTEXT "¦øªA¾¹¡G",-1,11,31,37,8 - LTEXT "¡]¦øªA¾¹¦WºÙ¡^",IDC_SET_SERVER,55,31,147,8 - LTEXT "¤À³Î°Ï¡G",-1,11,44,37,8 - LTEXT "¡]¤À³Î°Ï¦WºÙ¡^",IDC_SET_AGGREGATE,55,44,147,8 - LTEXT "®eÅé¡G",-1,11,18,37,8 - LTEXT "¡]®eÅé¦WºÙ¡^",IDC_SET_NAME,55,18,147,8 - GROUPBOX "Ū¨ú / ¼g¤J®eÅé",-1,5,5,211,56 - GROUPBOX "®eÅ齯¥»",-1,5,67,211,96 -END - -IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 257 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "¿ï¨ú Cell - AFS ¦øªA¾¹ºÞ²zµ{¦¡" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "Cell (&C)¡G",IDC_STATIC,4,24,43,8 - COMBOBOX IDC_OPENCELL_CELL,53,22,162,143,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - GROUPBOX "AFS Ų§O",IDC_STATIC,4,44,211,92 - LTEXT "AFS ¨­¥÷(&I)¡G",IDC_STATIC,22,100,64,8 - EDITTEXT IDC_OPENCELL_ID,88,98,121,14,ES_AUTOHSCROLL - LTEXT "AFS ±K½X(&P)¡G",IDC_STATIC,22,116,55,8 - EDITTEXT IDC_OPENCELL_PASSWORD,88,114,121,14,ES_PASSWORD | - ES_AUTOHSCROLL - PUSHBUTTON "¶i¶¥(&V) >>",IDC_ADVANCED,4,146,53,14 - DEFPUSHBUTTON "½T©w",IDOK,68,146,41,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,120,146,41,14 - PUSHBUTTON "»¡©ú(&H)",9,172,146,41,14 - CONTROL "ºÊµø³o­Ó Cell ¤¤ªº©Ò¦³¦øªA¾¹(&L)",IDC_MON_ALL,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,10,204,185,9 - CONTROL "¥uºÊµø¤@­Ó¦øªA¾¹(&M)¡G",IDC_MON_ONE,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,10,219,110,10 - EDITTEXT IDC_MON_SERVER,125,218,83,13,ES_AUTOHSCROLL - CONTROL "¥uºÊµø¤l¶°¤¤ªº¦øªA¾¹(&S)¡G",IDC_MON_SOME,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,10,235,110,10 - COMBOBOX IDC_MON_SUBSET,125,233,83,93,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "¿ï¨ú±z­n§@·~ªº AFS Cell",IDC_STATIC,4,7,200,8 - GROUPBOX "ºÊµø¦øªA¾¹",IDC_ADVANCED_GROUP,4,169,211,84 - LTEXT "¦p­n´£°ª°õ¦æ®Ä¯à¡A±z¥i¥H¿ï¾Ü¥uºÊµø³o­Ó Cell ¤§¦øªA¾¹¤l¶°¡C", - IDC_STATIC,10,182,199,17 - LTEXT "¡]¬d¸ß...¡^",IDC_OPENCELL_OLDCREDS,22,70,185,8 - LTEXT "¦p­nºÞ²z Cell¡A±z¥²¶·­«·s¿é¤J±zªº AFS ±K½X¡G", - IDC_STATIC,10,85,196,8 - LTEXT "±z¥Ø«e¦b©Ò¿ï¨ú¤§ Cell ¤¤ªº AFS °O¸¹¡G",IDC_STATIC,10,57, - 196,8 -END - -IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "ĵ§i - AFS ¦øªA¾¹ºÞ²zµ{¦¡" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - CONTROL "Ä~Äòµ¥­Ô¡Aª½¨ì§@·~¥¿±`§¹¦¨¬°¤î(&C)",IDC_TIMEOUT_WAIT, - "Button",BS_AUTORADIOBUTTON,24,87,208,10 - CONTROL "²×¤î§@·~(&T)",IDC_TIMEOUT_KILL,"Button", - BS_AUTORADIOBUTTON,24,101,208,10 - DEFPUSHBUTTON "½T©w",IDOK,93,139,50,14 - LTEXT "°õ¦æ§@·~©Ò¸g¾úªº®É¶¡¡G",IDC_STATIC,4,119,89,8 - LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,95,119,40,8 - LTEXT "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµ¥­Ôºô¸ô§@·~§¹¦¨ªº®É¶¡¹Lªø¡C", - IDC_STATIC,4,7,228,18 - LTEXT "±z¥i¥HÅý§@·~Ä~Äò°õ¦æ¡]«ØÄ³¡^¡A©ÎªÌ¦pªG§A½T©w§@·~¥Ã»·³£¤£·|§¹¦¨¡A«h¥i¥HÅý¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v²×¤î§@·~¡C", - IDC_STATIC,4,30,228,26 - LTEXT "½Ðª`·N¡A§Y¨Ï³o­Óµøµ¡Åã¥Ü¥X¨Ó¡A§@·~¤´Ä~Äò¶i¦æ¡F§@·~§¹¦¨®É¡A³o­Óµøµ¡·|¦Û°ÊÃö³¬¡C", - IDC_STATIC,4,63,228,17 -END - -IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 -STYLE WS_POPUP | WS_CAPTION -CAPTION "ª½Äæ" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¿ï¨ú¦C¥Ü®É©Ò­nÅã¥Üªºª½Äæ(&S)¡G",IDC_STATIC,5,7,126,8 - COMBOBOX IDC_COLUMNS,134,5,147,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "¥i¥Îªºª½Äæ(&C)¡G",IDC_STATIC,12,40,100,8 - LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "Åã¥Üªºª½Äæ(&I)¡G",IDC_STATIC,173,41,100,8 - LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "·s¼W(&A) >>",IDC_COL_INSERT,119,68,46,14 - PUSHBUTTON "<< ²¾°£(&R)",IDC_COL_DELETE,119,88,46,14 - PUSHBUTTON "¦V¤W²¾°Ê(&U)",IDC_COL_UP,173,122,48,14 - PUSHBUTTON "¦V¤U²¾°Ê(&D)",IDC_COL_DOWN,224,122,48,14 - GROUPBOX "¦C¥Xª½Äæ",IDC_STATIC,5,25,276,118 -END - -IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 264, 72 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "­«·s¾ã²z - AFS ¦øªA¾¹ºÞ²zµ{¦¡" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, - 256,8 - LTEXT "§¹¦¨ 0%%",IDC_REFRESH_PERCENT,4,49,216,8 - LTEXT "",IDC_REFRESH_CURRENT,4,60,216,8 - LTEXT "½Ðµy­Ô...",IDC_REFRESH_DESC,4,7,256,25 - PUSHBUTTON "²¤¹L(&S)",IDC_REFRESH_SKIP,222,58,38,12,NOT WS_TABSTOP -END - -IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "«Ø¥ß®eÅé" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "¦WºÙ(&N)¡G",IDC_STATIC,4,30,39,8 - EDITTEXT IDC_SET_NAME,51,28,116,14,ES_AUTOHSCROLL - LTEXT "°tÃB(&Q)¡G",IDC_STATIC,4,48,39,8 - EDITTEXT IDC_SET_QUOTA,51,46,32,14,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,95,47,30,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "³Æ¥÷(&B)¡G",IDC_STATIC,4,66,39,8 - CONTROL "¦P®É«Ø¥ß¥»®eÅ骺³Æ¥÷ª©¥»(&R)",IDC_SET_CLONE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,51,66,162,8 - LTEXT "¦øªA¾¹(&S)¡G",IDC_STATIC,4,84,45,8 - COMBOBOX IDC_SET_SERVER,52,82,115,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "¤À³Î°Ï(&P)¡G",IDC_STATIC,4,102,45,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,51,102,266, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "½T©w",IDOK,156,191,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,211,191,50,14 - PUSHBUTTON "»¡©ú(&H)",9,267,191,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "·sªº®eÅé",IDC_STATIC,46,12,170,8 -END - -IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 277, 102 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "§R°£®eÅé" -FONT 9, "·s²Ó©úÅé" -BEGIN - DEFPUSHBUTTON "¨ú®ø",IDCANCEL,169,84,50,14 - PUSHBUTTON "½T©w",IDOK,115,84,50,14 - PUSHBUTTON "»¡©ú(&H)",9,223,84,50,14 - CONTROL "±N®eÅé %3 ±q¦øªA¾¹ %1¡A¤À³Î°Ï %2 §R°£(&D)", - IDC_DELSET_SERVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 46,45,227,10 - CONTROL "§R°£®eÅé %3 ªº &VLDB ¶µ (&V)",IDC_DELSET_VLDB,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,46,60,227,10 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "ĵ§i¡I\n\n³o¶µ§@·~±N³y¦¨®eÅé %3 ¥Ã¤[³Q§R°£¡C", - IDC_DELSET_DESC,31,7,242,33 -END - -IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "³Æ¥÷®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - DEFPUSHBUTTON "½T©w",IDOK,183,67,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,237,67,50,14 - PUSHBUTTON "»¡©ú(&H)",9,291,67,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "®eÅ鳯¥÷¬O¸Ó®eÅ骺°ßŪ°Æ¥»¡F¤@­ÓŪ¨ú / ¼g¤J®eÅé¥u¯à¾Ö¦³¤@­Ó³Æ¥÷ª©¥»¡C", - IDC_STATIC,34,9,307,17 - LTEXT "«ö¤@¤U¡u½T©w¡v¥H¦b¦øªA¾¹ %1¡A¤À³Î°Ï %2 ¤W«Ø¥ß %3 ®eÅ鳯¥÷¡C­Y¬O¥»®eÅ骺³Æ¥÷¤w¸g¦s¦b¡A«h·|§ó·s³Æ¥÷¡C", - IDC_CLONE_DESC,34,32,307,24 -END - -IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - GROUPBOX "¤wª¾ªº°ÝÃD",IDC_PROBLEM_BOX,5,36,215,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,138,120,61,12 - ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "ªA°È %2¡]¦øªA¾¹ %1¡^",IDC_PROBLEM_TITLE,52,13,168,8 -END - -IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - GROUPBOX "¤wª¾ªº°ÝÃD",IDC_PROBLEM_BOX,5,36,216,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,172,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,201,49,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,136,120,61,12 - ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "%1",IDC_PROBLEM_TITLE,42,13,179,8 -END - -IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - GROUPBOX "¤wª¾ªº°ÝÃD",IDC_PROBLEM_BOX,5,35,247,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,170,119,61,12 - ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "¤À³Î°Ï %2¡]¦øªA¾¹ %1¡^",IDC_PROBLEM_TITLE,38,14,214,8 -END - -IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - GROUPBOX "¤wª¾ªº°ÝÃD",IDC_PROBLEM_BOX,5,35,263,102 - LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 - LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, - SS_SUNKEN - SCROLLBAR IDC_PROBLEM_SCROLL,249,48,10,83,SBS_VERT - PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 - ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 - LTEXT "®eÅé %3¡]¦øªA¾¹ %1¡A¤À³Î°Ï %2¡^",IDC_PROBLEM_TITLE,49, - 14,219,8 -END - -IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "²¾°Ê®eÅé" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,70,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "½T©w",IDOK,115,156,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,169,156,50,14 - PUSHBUTTON "»¡©ú(&H)",9,223,156,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,21,20 - LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,242,24 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 - LTEXT "²¾°Ê®eÅé¦Ü(&M)¡G",IDC_STATIC,4,43,116,8 -END - -IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "²¾°Ê®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "±N®eÅé %3 ±q¦øªA¾¹ %1 ¤W¤À³Î°Ï %2 ²¾°Ê¦Ü¦øªA¾¹ %4 ¤W¤À³Î°Ï %5...", - IDC_MOVESET_DESC,4,41,229,19 -END - -IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 277, 106 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "À˵ø¤é»xÀÉ" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "À˵ø¦øªA¾¹¤Wªº¤é»xÀÉ(&S)¡G",IDC_STATIC,4,45,103,8 - COMBOBOX IDC_VIEWLOG_SERVER,111,43,126,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "¦øªA¾¹¤W©Ò­nÀ˵øªºÀÉ®×(&F)¡G",IDC_STATIC,4,64,107,8 - EDITTEXT IDC_VIEWLOG_FILENAME,111,62,158,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "½T©w",IDOK,169,88,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,223,88,50,14 - ICON IDI_SERVICE,IDC_STATIC,4,4,20,20 - LTEXT "½Ð¿é¤J±z­nÀ˵ø¤§¤é»xÀɪº§¹¾ã¸ô®|¦WºÙ¡C", - IDC_VIEWLOG_DESC,31,10,242,21 -END - -IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 286, 185 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "À˵ø¤é»xÀÉ" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "Àɮפº®e¡G",IDC_SVC_VIEWLOG_CONTENTS,4,41,277,8 - EDITTEXT IDC_VIEWLOG_TEXT,4,51,277,113,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL - PUSHBUTTON "¥t¦s·sÀÉ(&A)...",IDC_VIEWLOG_SAVEAS,173,167,53,14 - DEFPUSHBUTTON "Ãö³¬(&C)",IDOK,231,167,50,14 - ICON IDI_SERVICE,-1,4,7,20,20 - LTEXT "¦øªA¾¹ %1 ¤Wªº¤é»xÀÉ [ªA°È %2]",IDC_SVC_VIEWLOG_DESC,33, - 7,248,8 - LTEXT "¦øªA¾¹¤WªºÀɮצWºÙ¡G %1",IDC_SVC_VIEWLOG_FILENAME,33,23, - 248,8 -END - -IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "³]©w®eÅé°tÃB" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "¥Ø«eªº°tÃB¡G",IDC_STATIC,4,49,57,8 - LTEXT "¡]¤£©ú¡^",IDC_SET_USAGE,59,49,208,8 - CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,59,60,208,8, - WS_EX_STATICEDGE - LTEXT "·sªº°tÃB(&Q)¡G",IDC_STATIC,4,81,52,8 - EDITTEXT IDC_SET_QUOTA,59,79,32,13,ES_AUTOHSCROLL - COMBOBOX IDC_SET_QUOTA_UNITS,103,79,30,44,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "½T©w",IDOK,109,112,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,163,112,50,14 - PUSHBUTTON "»¡©ú(&H)",9,217,112,50,14 - PUSHBUTTON "¤º®e(&P)...",IDC_AGG_PROPERTIES,212,28,55,12 - LTEXT "¤À³Î°Ï¡G",IDC_STATIC,4,30,47,8 - LTEXT "¦øªA¾¹ %1 ªº¤À³Î°Ï %2",IDC_SET_AGGREGATE,59,30,141,8 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "®eÅé %1",IDC_SET_NAME,59,11,208,8 -END - -IDD_ACTIONS DIALOGEX 0, 0, 236, 58 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "¶i¦æ¤¤ªº§@·~ - AFS ¦øªA¾¹ºÞ²zµ{¦¡" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "¥Ø«e¥¿¦b¶i¦æ¥H¤Uªº§@·~¡G",IDC_ACTION_DESC,2,2,232,8 - CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | - 0x3,2,14,232,43 -END - -IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "¦P¨B VLDB" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - DEFPUSHBUTTON "½T©w",IDOK,107,81,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,161,81,50,14 - PUSHBUTTON "»¡©ú(&H)",9,215,81,50,14 - ICON 32515,IDC_STATIC,4,4,21,20 - LTEXT "¡]©ó°õ¦æ´Á¶¡®É³]©w¡^",IDC_SYNC_DESC,37,4,228,32 - LTEXT "¡]©ó°õ¦æ´Á¶¡®É³]©w¡^",IDC_SYNC_DESC2,37,44,228,24 -END - -IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "½Æ»s®eÅé" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,62,269, - 75,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "½T©w",IDOK,115,153,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,169,153,50,14 - PUSHBUTTON "»¡©ú(&H)",9,223,153,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,21,20 - LTEXT "®eÅé %3 ·sªº½Æ¥»",IDC_SET_NAME,31,12,242,8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 - LTEXT "«Ø¥ß¦¹®eÅ骺·s½Æ¥»©ó(&C)¡G",IDC_STATIC,4,35,125,8 -END - -IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 248, 156 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "¦w¸ËÀÉ®×" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¨Ó·½ÀÉ(&F)¡G",IDC_STATIC,4,74,49,8 - EDITTEXT IDC_FILENAME,64,72,127,14,ES_AUTOHSCROLL - PUSHBUTTON "ÂsÄý(&B)...",IDC_BROWSE,194,72,50,14 - LTEXT "¥Ø¼Ð¦øªA¾¹(&S)¡G",IDC_STATIC,4,94,59,8 - COMBOBOX IDC_SERVER,64,92,83,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "¥Ø¼Ð¦WºÙ(&N)¡G",IDC_STATIC,4,114,55,8 - EDITTEXT IDC_DIRECTORY,64,112,127,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "½T©w",IDOK,86,138,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,140,138,50,14 - PUSHBUTTON "»¡©ú(&H)",9,194,138,50,14 - ICON IDI_INSTALL,IDC_STATIC,4,4,20,20 - LTEXT "¦b¦øªA¾¹¤W¦w¸ËÀÉ®×",IDC_STATIC,32,12,127,8 - LTEXT "¡]°õ¦æ´Á¶¡³]©wªº¤å¦r¡^\n¡]°õ¦æ´Á¶¡³]©wªº¤å¦r¡^\n¡]°õ¦æ´Á¶¡³]©wªº¤å¦r¡^\n¡]°õ¦æ´Á¶¡³]©wªº¤å¦r¡^", - IDC_INSTALL_DESC,4,29,240,33 -END - -IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "¸Ñ°£¦w¸ËÀÉ®×" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¦øªA¾¹(&S)¡G",IDC_STATIC,4,66,46,8 - COMBOBOX IDC_SERVER,55,64,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "¥Ø¼ÐÀÉ®×(&F)¡G",IDC_STATIC,4,85,50,8 - EDITTEXT IDC_FILENAME,55,83,161,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "½T©w",IDOK,88,121,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,141,121,50,14 - PUSHBUTTON "»¡©ú(&H)",9,194,121,50,14 - ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 - LTEXT "±q¦øªA¾¹¸Ñ°£¦w¸ËÀÉ®×",IDC_STATIC,32,12,127,8 - LTEXT "³o¶µ§@·~Åý±z±N¥ý«e¤w¦w¸ËªºÀÉ®×°Æ¥»¡A´_­ì¨ì¯S©wªº¦øªA¾¹¡C¦pªG¿ï©wªºÀɮפ£¨ã¦³¥ý«e¦w¸ËªºÀÉ®×°Æ¥»¡A«hÀÉ®×·|³Q²¾°£¡C", - IDC_STATIC,4,29,240,26 -END - -IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 224, 141 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "§R°£ÂÂÀÉ®×" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¦øªA¾¹¡G",-1,4,56,44,8 - COMBOBOX IDC_SERVER,53,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "§R°£©Ò¦³®Ö¤ßÀÉ(&C)",IDC_OP_DELETE_CORE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,67,73,134,10 - CONTROL "§R°£©Ò¦³ .&BAK ÀÉ¡]Àɮ׳ƥ÷¡^",IDC_OP_DELETE_BAK,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,67,84,137,10 - CONTROL "§R°£©Ò¦³ .&OLD ÀÉ¡]ÂÂÀɮ׳ƥ÷¡^",IDC_OP_DELETE_OLD, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,67,95,143,10 - DEFPUSHBUTTON "½T©w",IDOK,48,123,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,109,123,50,14 - PUSHBUTTON "»¡©ú(&H)",9,170,123,50,14 - ICON IDI_PRUNE,-1,4,4,21,21 - LTEXT "±NÂÂÀÉ®×±q¦øªA¾¹¤W§R°£",-1,32,12,101,8 - LTEXT "³o¶µ§@·~·|§R°£¦w¸Ë©ó¯S©w¦øªA¾¹ªºÀɮ׳ƥ÷°Æ¥»¡C",-1,4,29, - 216,16 - LTEXT "­n§R°£ªºÀɮסG",-1,4,73,60,8 -END - -IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "Åܧó®eÅé¦WºÙ" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "ªº¦WºÙ(&O)¡G",IDC_STATIC,31,67,55,8 - EDITTEXT IDC_RENSET_OLD,86,65,122,14,ES_AUTOHSCROLL | ES_READONLY - LTEXT "·sªº¦WºÙ(&N)¡G",IDC_STATIC,31,85,51,8 - EDITTEXT IDC_RENSET_NEW,86,83,122,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "½T©w",IDOK,108,115,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,162,115,50,14 - PUSHBUTTON "»¡©ú",9,216,115,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "¦p­n­«·s©R¦W®eÅé %3 ¡A½Ð¦b¤U¤è¿é¤J·sªº¦WºÙ¡C­«·s©R¦W«á¡A®eÅ骺³Æ¥÷¤Î¨ä©Ò¦³½Æ¥»·|¦Û°Ê§ïÅܦWºÙ¡C\n\nĵ§i¡G¦pªG±z¬°¤w¸Ë¸üªº®eÅé­«·s©R¦W¡A±z¥²¶·§R°£¨Ã­«·s«Ø¥ß¨ä¸Ë¸üÂI¡C", - IDC_RENSET_DESC,31,7,235,48 -END - -IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 277, 68 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "§R°£ªA°È" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - DEFPUSHBUTTON "¨ú®ø",IDCANCEL,169,50,50,14 - PUSHBUTTON "½T©w",IDOK,115,50,50,14 - PUSHBUTTON "»¡©ú",9,223,50,50,14 - ICON 32515,IDC_STATIC,4,7,20,20 - LTEXT "ĵ§i¡I\n\n³o¶µ§@·~·|¾É­PªA°È %2 °±¤î¡A¨Ã±q¦øªA¾¹ %1 ¥[¥H§R°£¡C", - IDC_DELSVC_DESC,31,7,242,33 -END - -IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "¨ú±oÀɮפé´Á" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¦øªA¾¹(&S)¡G",-1,4,56,42,8 - COMBOBOX IDC_SERVER,70,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "­n¬d¸ßªºÀÉ®×(&F)¡G",-1,4,75,66,8 - EDITTEXT IDC_FILENAME,70,73,132,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "½T©w",IDOK,86,107,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,140,107,50,14 - PUSHBUTTON "»¡©ú(&H)",9,194,107,50,14 - ICON IDI_GETDATES,-1,4,4,20,20 - LTEXT "¨ú±o¦b¦øªA¾¹¤WªºÀɮפé´Á",-1,32,12,127,8 - LTEXT "³o¶µ§@·~·|¨ú±oÀÉ®×¤Î¨ä³Æ¥÷¡]¦pªG¦³ªº¸Ü¡^¤W¦¸­×§ïªº¤é´Á¡C", - -1,4,29,240,16 -END - -IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "¨ú±oÀɮפé´Á - µ²ªG" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¦øªA¾¹¡G",IDC_STATIC,4,30,39,8 - LTEXT "¡]©ó°õ¦æ´Á¶¡®É³]©w¡^",IDC_SERVER,48,30,137,8 - LTEXT "ÀɮצWºÙ¡G",IDC_STATIC,4,45,43,8 - LTEXT "¡]©ó°õ¦æ´Á¶¡®É³]©w¡^",IDC_FILENAME,48,45,137,8 - LTEXT "Àɮפé´Á¡G",IDC_STATIC,4,60,44,8 - LTEXT "¡]¤£©ú¡F§ä¤£¨ìÀɮס^",IDC_DATE_FILE,48,60,174,8 - LTEXT ".BAK ¤é´Á¡G",IDC_STATIC,4,75,45,8 - LTEXT "¡]¤£©ú¡F§ä¤£¨ìÀɮס^",IDC_DATE_BAK,48,75,167,8 - LTEXT ".OLD ¤é´Á¡G",IDC_STATIC,4,90,45,8 - LTEXT "¡]¤£©ú¡F§ä¤£¨ìÀɮס^",IDC_DATE_OLD,48,90,164,8 - DEFPUSHBUTTON "Ãö³¬(&C)",IDOK,99,114,50,14 - ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 - LTEXT "¨ú±o¦b¦øªA¾¹¤WÀɮתº¤é´Á",IDC_STATIC,32,12,127,8 -END - -IDD_SET_DUMP DIALOGEX 0, 0, 295, 144 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "¶É¥X®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "«Ø¥ß¶É¥XÀɮצW¬°(&N)¡G",IDC_STATIC,4,42,86,8 - EDITTEXT IDC_DUMP_FILENAME,96,40,141,14,ES_AUTOHSCROLL - PUSHBUTTON "ÂsÄý(&B)...",IDC_DUMP_BROWSE,241,40,50,14 - CONTROL "¶É¥X®eÅé %3 ªº¾ã­Ó¤º®e(&E)¡]¤À³Î°Ï %1:%2¡^", - IDC_DUMP_FULL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10, - 78,274,10 - CONTROL "¥u¶É¥X¤wÅܧóªºÀɮסAÅܧó®É¶¡¬°(&S)",IDC_DUMP_LIMIT_TIME, - "Button",BS_AUTORADIOBUTTON,10,94,144,10 - CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,160,93,51, - 13,WS_EX_CLIENTEDGE - CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,218,93,56, - 13,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "½T©w",IDOK,131,126,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,185,126,50,14 - PUSHBUTTON "»¡©ú(&H)",9,241,126,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "³o¶µ§@·~±N®eÅ餺®e½Æ»s¨ì³æ¤@ÀɮפW¡A³o»ò¤@¨Ó¡A®eÅé´N¯à»´ÃP³Æ¥÷¡C¥H³oºØ¤è¦¡¶É¥Xªº®eÅ餺®e¥i¥H¦bµy«á¥[¥H´_­ì¡C", - IDC_STATIC,30,7,261,24 - GROUPBOX "¶É¥X°Ñ¼Æ",IDC_STATIC,4,62,287,53 -END - -IDD_SET_RESTORE DIALOGEX 0, 0, 292, 248 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "´_­ì®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "­n´_­ìªºÀÉ®×(&R)¡G",IDC_STATIC,4,33,68,8 - EDITTEXT IDC_RESTORE_FILENAME,74,30,158,14,ES_AUTOHSCROLL - PUSHBUTTON "ÂsÄý(&B)...",IDC_RESTORE_BROWSE,238,30,50,14 - CONTROL "³o¬O»¼¼W¦¡¶É¥XÀÉ®×(&I)",IDC_RESTORE_INCREMENTAL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,74,46,114,10 - LTEXT "®eÅé(&V)¡G",IDC_STATIC,11,102,41,8 - EDITTEXT IDC_RESTORE_SETNAME,54,100,115,14,ES_AUTOHSCROLL - LTEXT "¦øªA¾¹(&S)¡G",IDC_STATIC,11,145,43,8 - COMBOBOX IDC_RESTORE_SERVER,55,143,116,104,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "¤À³Î°Ï(&P)¡G",IDC_STATIC,11,162,44,8 - CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,56,161,225, - 55,WS_EX_CLIENTEDGE - DEFPUSHBUTTON "½T©w",IDOK,128,230,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,183,230,50,14 - PUSHBUTTON "»¡©ú(&H)",9,238,230,50,14 - ICON IDI_FILESET,IDC_STATIC,4,4,20,20 - LTEXT "±q¶É¥XÀÉ®×´_­ì®eÅé",IDC_STATIC,33,11,224,8 - GROUPBOX "¥Ø¼Ð®eÅé",IDC_STATIC,4,63,284,160 - LTEXT "·í±z±q¶É¥XÀÉ®×´_­ì®eÅé®É¡A±z¥i¥H«Ø¥ß·sªº®eÅé©Î¬O§ï¼g²{¦³ªºÅª¨ú / ¼g¤J®eÅé¡C", - IDC_STATIC,11,78,259,16 - LTEXT "¡]©ó°õ¦æ´Á¶¡³]©w¡^\n¡]©ó°õ¦æ´Á¶¡³]©w¡^", - IDC_RESTORE_CREATE,51,119,229,17 -END - -IDD_SVC_BOS DIALOGEX 0, 0, 225, 207 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - CONTROL "©w´Á°±¤î¨Ã­«·s±Ò°Ê¦¹¦øªA¾¹¤Wªº©Ò¦³ªA°È(&P)", - IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, - 71,193,10 - LTEXT "­«·s±Ò°Ê(&R)",IDC_BOS_GENRES_DESC1,12,87,45,8 - COMBOBOX IDC_BOS_GENRES_DATE,58,84,65,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "¦b(&A)",IDC_BOS_GENRES_DESC2,127,87,8,8 - CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,138, - 84,53,13,WS_EX_CLIENTEDGE - CONTROL "©w´Á´ú¸Õ¥»¦øªA¾¹¤W·s¤G¶i¦ìÀɪº©Ò¦³ªA°È (&B)", - IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, - 151,201,10 - LTEXT "´ú¸Õ(&S)",IDC_BOS_BINRES_DESC1,23,167,25,8 - COMBOBOX IDC_BOS_BINRES_DATE,58,164,65,131,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "¦b(&T)",IDC_BOS_BINRES_DESC2,127,167,8,8 - CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,138, - 164,53,13,WS_EX_CLIENTEDGE - ICON IDI_BOSSERVICE,IDC_STATIC,5,5,20,20 - LTEXT "ªA°È %2¡]¦øªA¾¹ %1¡^",IDC_SVC_NAME,52,13,168,8 - GROUPBOX "BOS ªA°È",IDC_STATIC,5,27,215,175 - LTEXT "BOS ªA°È¥i¥Î¨Ó©w´Á°±¤î¨Ã­«·s±Ò°Ê¦¹¦øªA¾¹¤W©Ò¦³ªºªA°È¡]¥]¬A BOSªA°È¥»¨­¡^¡C", - IDC_STATIC,11,45,199,18 - LTEXT "BOS ªA°È¤]¥i¥H¥Î¨Ó©w´Á´ú¸Õ¦øªA¾¹¤W©Ò¦³ªºªA°È¡A¥u°±¤î¨Ã­«·s±Ò°Ê¤G¶i¦ìÀɦ³Åܧ󤧪A°È¡C", - IDC_STATIC,11,118,199,25 -END - -IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "¶É¥X®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "±q®eÅé %3 «Ø¥ß¶É¥XÀÉ®× %4...",IDC_DUMPSET_DESC,4,41,229, - 19 -END - -IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 238, 65 -STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU -CAPTION "´_­ì®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | - ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 - LTEXT "±q¶É¥XÀÉ®× %2 ´_­ì®eÅé %1...",IDC_RESTORESET_DESC,5,41, - 202,19 -END - -IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 258, 163 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "³Æ¥÷®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - CONTROL "«Ø¥ß Cell ©Ò¦³®eÅ骺³Æ¥÷ª©¥»(&A)",IDC_CLONE_ALL,"Button", - BS_AUTORADIOBUTTON,30,45,214,10 - GROUPBOX " ",IDC_STATIC,23,70,231,65 - CONTROL "¥u¬°²Å¦X¤U¦C·Ç«hªº®eÅ髨¥ß³Æ¥÷(&O)¡G",IDC_CLONE_SOME, - "Button",BS_AUTORADIOBUTTON,30,60,155,11 - CONTROL "¥u¦³¦b¦øªA¾¹¤Wªº®eÅé(&S)¡G",IDC_CLONE_SVR_LIMIT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,34,83,114,10 - COMBOBOX IDC_CLONE_SVR,169,82,68,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "¥u¦³¦b¤À³Î°Ï¤Wªº®eÅé(&P)¡G",IDC_CLONE_AGG_LIMIT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,34,99,110,10 - COMBOBOX IDC_CLONE_AGG,169,98,68,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "¥u¦³¥H¯S©w¦r¤¸¬°¶}ÀYªº®eÅé(&B)¡G", - IDC_CLONE_PREFIX_LIMIT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,34,116,135,10 - EDITTEXT IDC_CLONE_PREFIX,169,115,68,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "½T©w",IDOK,95,145,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,149,145,50,14 - PUSHBUTTON "»¡©ú(&H)",9,204,145,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "®eÅ鳯¥÷¬O¸Ó®eÅ骺°ßŪ³Æ¥÷¡F¤@­ÓŪ¨ú / ¼g¤J®eÅé¥u¦³¤@­Ó³Æ¥÷ª©¥»¡C\n\n±z¥i¥H¦P®É¬°¤@­Ó¥H¤Wªº®eÅ髨¥ß³Æ¥÷ª©¥»¡C", - IDC_STATIC,30,7,214,40 -END - -IDD_SUBSETS DIALOGEX 0, 0, 281, 182 -STYLE WS_POPUP | WS_CAPTION -CAPTION "ºÊµø¦øªA¾¹" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "¤l¶°¦WºÙ¡G",IDC_STATIC,12,77,44,8 - EDITTEXT IDC_SUBSET_NAME,64,75,109,14,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_TABSTOP - PUSHBUTTON "¶}±Ò(&O)...",IDC_SUBSET_LOAD,188,75,39,14 - PUSHBUTTON "Àx¦s(&S)...",IDC_SUBSET_SAVE,233,75,39,14 - CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x153,12,111,193,58,WS_EX_CLIENTEDGE - PUSHBUTTON "¥þ³¡ºÊµø(&A)",IDC_SUBSET_ALL,211,122,57,14 - PUSHBUTTON "¤£ºÊµø(&N)",IDC_SUBSET_NONE,211,140,57,14 - LTEXT "¦p­n§ïµ½¦b¤j«¬ Cell ¤¤ªº§@·~®Ä¯à¡A±z¥i¥H¿ï¾Ü¤£ºÊµø¯S©w¦øªA¾¹¡C¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v±N¤£·|Åã¥Ü¥¼ºÊµø¤§¦øªA¾¹¤Wªº®eÅé¡B¤À³Î°Ï©ÎªA°È¡C", - IDC_STATIC,5,5,271,24 - LTEXT "±z¥i¥HÀH®É¿ï¾ÜºÊµø¡]©Î¤£ºÊµø¡^¦øªA¾¹¡C±z¥i¥H«Ø¥ß¦øªA¾¹¤l¶°¡A¥H«ü©w¸ÓºÊµø¤§¦øªA¾¹²M³æ¡C", - IDC_STATIC,5,37,271,18 - GROUPBOX "¥Ø«eªº¤l¶°",IDC_STATIC,5,63,271,114 - LTEXT "­nºÊµøªº¦øªA¾¹¡G",IDC_STATIC,12,95,92,8 -END - -IDD_SUBSET_LOADSAVE DIALOGEX 0, 0, 280, 145 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | - WS_CAPTION | WS_SYSMENU -CAPTION "¡]°õ¦æ´Á¶¡³]©wªº¼ÐÃD¡^" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "¤l¶°¦WºÙ(&N)¡G",1090,5,112,51,8,SS_NOTIFY - EDITTEXT IDC_SUBSET_NAME,60,110,159,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "¶}±Ò(&O)",IDOK,226,110,50,14 - PUSHBUTTON "¨ú®ø(&L)",IDCANCEL,226,127,50,14 - CONTROL "List1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | - LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | - LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,272,82, - WS_EX_CLIENTEDGE - PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT - WS_TABSTOP - PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT - WS_TABSTOP - LTEXT "¥» Cell ªº¤l¶°¤w©w¸q¡G",IDC_STATIC,4,6,114,8 -END - -IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "·j´M«ü¥O" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - COMBOBOX IDC_FIND_COMMAND,4,38,137,170,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "Åã¥Ü»¡©ú(&H)",IDOK,147,38,67,14 - PUSHBUTTON "¨ú®ø(&C)",IDCANCEL,147,55,67,14 - LTEXT "¦p­n§ä¥X¨Ï¥Î¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¥H°õ¦æ§@·~ªº¤èªk¡A½Ð¿ï¨ú¥H¤Uªº«ü¥O¦æ¡A¨Ã«ö¡uÅã¥Ü»¡©ú¡v«ö¶s¡C", - IDC_STATIC,4,4,210,25 -END - -IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 137 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "¬d¾\¿ù»~½X" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¿ù»~½X(&E)¡G",IDC_STATIC,4,41,45,8 - EDITTEXT IDC_ERROR_NUMBER,59,39,78,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "Âà´«(&T)",IDC_ERROR_TRANSLATE,144,39,47,14 - PUSHBUTTON "Ãö³¬(&C)",IDCANCEL,85,117,48,14 - LTEXT "¡]°õ¦æ´Á¶¡³]©w¤å¦r¡^",IDC_ERROR_DESC,4,71,211,42 - LTEXT "¦p­n§ä¥X¿ù»~½Xªº²[·N¡A½ÐÁä¤J¥H¤Uªº¥N½X¡A¨Ã«ö¤@¤U¡uÂà´«¡v«ö¶s¡C", - IDC_STATIC,4,4,192,25 - CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 -END - -IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 -STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "¦³Ãö AFS ¦øªA¾¹ºÞ²zµ{¦¡" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 - LTEXT "AFS ¦øªA¾¹ºÞ²zµ{¦¡ 3.5 ª©",IDC_STATIC,33,8,163,8 - LTEXT "Copyright (C) IBM Corporation 1989, 1999",IDC_STATIC,33, - 20,183,8 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 - CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 - PUSHBUTTON "Ãö³¬(&C)",IDOK,89,123,50,14 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 -END - -IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¥¿¦b·j´M %1 Cell ¤ºªº¦øªA¾¹ ...", - IDC_OPENCELL_DESC,41,15,183,16 - GROUPBOX "",IDC_STATIC,4,2,231,39 - ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | - WS_BORDER -END - -IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 279, 139 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - CONTROL "Åã¥Ü¦øªA¾¹ªº§¹¾ã»â°ì¦WºÙ¡]¨Ò¦p""machine.company.com""¡^", - IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,5,269,10 - CONTROL "§@·~®É¦pªG¨S¦³ºÞ²z°O¸¹¡A´N·|Åã¥Üĵ§i(&W)", - IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,5,19,269,10 - CONTROL "...Á`¬OÅã¥Ü¦øªA¾¹ªº¤º®e",IDC_OPT_SVR_DBL_PROP,"Button", - BS_AUTORADIOBUTTON,21,50,253,10 - CONTROL "... ¥u¦b¡u§Ö³tÀ˵øµ¡®æ¡v¬°¶}±Òª¬ºA®É¡A¤~Åã¥Ü¦øªA¾¹ªº¤º®e", - IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON,21, - 63,253,10 - CONTROL "...Á`¬O¶}±Ò¸Ó¦øªA¾¹ªºµøµ¡",IDC_OPT_SVR_DBL_OPEN,"Button", - BS_AUTORADIOBUTTON,21,75,253,10 - CONTROL "...¶}±Ò¦øªA¾¹µøµ¡¡A«h¦øªA¾¹·|¨ü¨ìºÊµø", - IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,21,107,253,10 - CONTROL "...Ãö³¬¦øªA¾¹µøµ¡¡A«h¦øªA¾¹¤£·|¨ü¨ìºÊµø", - IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,21,124,253,10 - LTEXT "¦b¦øªA¾¹¹Ï¥Ü¤W«ö¨â¤U...",IDC_STATIC,5,38,269,8 - LTEXT "­Y¦øªA¾¹¤l¶°¦b¨Ï¥Îª¬ºA¤U¡A¦Ó¡u§Ö³tÀ˵ø¡vµ¡®æ¬°Ãö³¬ª¬ºA ...", - IDC_STATIC,5,95,269,8 -END - -IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,22,216, - 135,WS_EX_CLIENTEDGE - PUSHBUTTON "·s¼W¦øªA¾¹ª÷Æ_(&A)",IDC_KEY_ADD,58,160,79,14 - PUSHBUTTON "²¾°£¦øªA¾¹ª÷Æ_(&R)",IDC_KEY_REMOVE,141,160,79,14 - LTEXT "¦øªA¾¹ª÷Æ_¡G",IDC_KEY_NAME,5,7,216,8 -END - -IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "·s¼W¦øªA¾¹ª÷Æ_" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "ª©¥»¡G",IDC_STATIC,7,37,26,8 - EDITTEXT IDC_KEY_VERSION,43,35,43,14,ES_AUTOHSCROLL - LTEXT "­È¡G",IDC_STATIC,7,58,21,8 - CONTROL "¬°³o­Ó¦r¦ê¥[±K¡G",IDC_KEY_BYSTRING,"Button", - BS_AUTORADIOBUTTON,43,58,73,10 - CONTROL "¨Ï¥Î³o­Óª÷Æ_¡G",IDC_KEY_BYDATA,"Button", - BS_AUTORADIOBUTTON,43,76,71,10 - EDITTEXT IDC_KEY_STRING,119,56,155,14,ES_PASSWORD | - ES_AUTOHSCROLL - EDITTEXT IDC_KEY_DATA,119,75,103,14,ES_AUTOHSCROLL - PUSHBUTTON "ÀH¾÷(&R)",IDC_KEY_RANDOM,226,75,48,14 - LTEXT "´£¥Ü¡G±N·sªºª÷Æ_·s¼W¨ì¦øªA¾¹¤§«á¡AÀ³­×§ï AFS ±b¤á¥H¨Ï¥Î·sªºª÷Æ_¡C´X¤Ñ¤§«á¡A´N¥i¥H²¾°£Âªº¦øªA¾¹ª÷Æ_¡C", - IDC_STATIC,7,99,267,18 - DEFPUSHBUTTON "½T©w",IDOK,116,129,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,170,129,50,14 - PUSHBUTTON "»¡©ú",9,224,129,50,14 - LTEXT "¦øªA¾¹ %1 ªº·sª÷Æ_",IDC_KEY_TITLE,43,14,181,8 - ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 -END - -IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 277, 132 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "¶}©l / °±¤îªA°È" -FONT 9, "·s²Ó©úÅé" -BEGIN - DEFPUSHBUTTON "½T©w",IDOK,115,114,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,169,114,50,14 - PUSHBUTTON "»¡©ú(&H)",9,223,114,50,14 - ICON IDI_SERVICE,IDC_STATIC,4,7,20,20 - LTEXT "«ö¤@¤U¡u½T©w¡v¥H¶}©l/°±¤î¦øªA¾¹ %1 ¤WªºªA°È %2¡C", - IDC_STARTSTOP_TEXT,31,12,242,9 - CONTROL "¥Ã¤[(&P) (IDS_START/STOPSERVICE_PERMANENT)", - IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON,37, - 68,226,10 - CONTROL "¼È®É(&T) (IDS_START/STOPSERVICE_TEMPORARY)", - IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON,37, - 83,226,10 - GROUPBOX "ªA°È±Ò°Ê³]©w",IDC_STATIC,31,31,242,70 - LTEXT "±z¥i¥H§â¥¦Åܦ¨¥Ã¤[Åܧó¡A³o¼ËªA°È %2 ´N·|¡]¤£·|¡^¦b¦øªA¾¹ %1 ­«·s±Ò°Ê®É¦Û°Ê±Ò°Ê¡C", - IDC_STARTSTOP_STARTUP,38,45,223,16 -END - -IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 248, 125 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "°õ¦æ«ü¥O" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¦øªA¾¹(&S)¡G",IDC_STATIC,4,56,42,8 - COMBOBOX IDC_SERVER,50,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "«ü¥O(&C)¡G",IDC_STATIC,4,75,42,8 - EDITTEXT IDC_COMMAND,50,73,194,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "½T©w",IDOK,86,107,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,140,107,50,14 - PUSHBUTTON "»¡©ú(&H)",9,194,107,50,14 - ICON IDI_SERVER,IDC_STATIC,4,4,20,20 - LTEXT "¦b¦øªA¾¹¤W°õ¦æ«ü¥O",IDC_STATIC,32,12,185,8 - LTEXT "³o¶µ§@·~Åý±z¦b»·ºÝ¦øªA¾¹¤Wµo¥X«ü¥O¡C\n³o¶µ§@·~³q±`ÂǥѰõ¦æ /etc/reboot script¡A­«·s±Ò°Ê¦øªA¾¹¡C", - IDC_STATIC,4,29,240,16 -END - -IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 262, 255 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "§Q¥Î®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¦øªA¾¹(&S)¡G",IDC_STATIC,23,50,42,8 - COMBOBOX IDC_SERVER,67,48,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "¤À³Î°Ï(&P)¡G",IDC_STATIC,23,67,41,8 - COMBOBOX IDC_AGGREGATE,67,65,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "´©±Ï©Ò¦³ªº¤À³Î°Ï(&A)",IDC_AGGREGATE_ALL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,164,67,94,10 - LTEXT "®eÅé(&O)¡G",IDC_STATIC,23,85,35,8 - COMBOBOX IDC_FILESET,67,83,88,104,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "´©±Ï©Ò¦³ªº®eÅé(&L)",IDC_FILESET_ALL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,163,85,79,10 - DEFPUSHBUTTON "½T©w",IDOK,85,107,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,145,107,50,14 - PUSHBUTTON "»¡©ú(&H)",9,208,108,50,14 - PUSHBUTTON "¶i¶¥(&V) >>",IDC_ADVANCED,23,108,53,14 - LTEXT "¼È¦sÀɸô®|(&T)¡G",IDC_STATIC,10,142,74,8 - EDITTEXT IDC_SALVAGE_TEMPDIR,103,141,133,13,ES_AUTOHSCROLL - CONTROL "¨Ã¦æ´©±Ï§@·~(&R)¡F³B²z¼Æ¥Ø¡G",IDC_SALVAGE_SIMUL,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,29,157,123,10 - EDITTEXT IDC_SALVAGE_NUM,157,156,39,13,ES_AUTOHSCROLL - CONTROL "¤£­n´©±Ï·lÃaªº®eÅé(&N)",IDC_SALVAGE_READONLY,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,29,167,123,10 - CONTROL "±NŪ¨ú§@·~¤À¦¨¤p°Ï¶ô(&B)",IDC_SALVAGE_BLOCK,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,29,177,139,10 - CONTROL "±j¨î´©±Ï©Ò¦³«ü¥Xªº®eÅé(&F)",IDC_SALVAGE_FORCE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,29,187,136,10 - CONTROL "±j¨î­««Ø¥Ø¿ýµ²ºc(&E)",IDC_SALVAGE_FIXDIRS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,29,197,123,10 - LTEXT "µ²ªG¤é»xªºÀɮצWºÙ(&L)¡G",IDC_STATIC,10,211,91,8 - EDITTEXT IDC_SALVAGE_LOG_FILE,103,210,133,13,ES_AUTOHSCROLL - CONTROL "±N·lÃaªº¤º¸`ÂI²M³æ¥]§t¦bµ²ªG¤é»x¤¤(&I)", - IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,30,226,203,10 - CONTROL "±N AFS ©Ò¾Ö¦³ªº®Ú¤º¸`ÂI²M³æ¥]§t¦bµ²ªG¤é»x¤¤(&W)", - IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,30,237,203,10 - ICON IDI_SERVER,IDC_STATIC,4,7,20,20 - LTEXT "³o¶µ§@·~Åý±z­×´_¤@©Î¼Æ­Ó®eÅ骺°ÝÃD¡C\n\n½Ðª`·N¡G­Y±z¦P®É´©±Ï¾ã­Ó¤À³Î°Ï©Î¦øªA¾¹¡A¦øªA¾¹·|¼È®ÉÂ÷½u¡C", - IDC_STATIC,44,7,214,32 - GROUPBOX "¶i¶¥´©±Ï¿ï¶µ",IDC_ADVANCED_GROUP,4,129,254,122 -END - -IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "§Q¥Î®eÅé - µ²ªG" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé" -BEGIN - DEFPUSHBUTTON "Ãö³¬(&C)",IDOK,232,160,50,14 - LTEXT "´©±Ï§@·~µ²ªG¡G",IDC_STATIC,4,33,277,8 - EDITTEXT IDC_SALVAGE_DETAILS,4,43,277,113,ES_MULTILINE | - ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | - WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP - ICON IDI_SERVER,IDC_STATIC,4,7,21,20 - LTEXT "¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº±Ï´©®eÅé %3",IDC_SALVAGE_TITLE, - 33,15,248,8 -END - -IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 277, 102 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -CAPTION "ÄÀ©ñ®eÅé" -FONT 9, "·s²Ó©úÅé" -BEGIN - DEFPUSHBUTTON "½T©w",IDOK,115,84,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,169,84,50,14 - PUSHBUTTON "»¡©ú(&H)",9,223,84,50,14 - ICON IDI_FILESET,IDC_STATIC,4,7,20,20 - LTEXT "³o¶µ§@·~Åý±z§ó·s %3 ®eÅ骺½Æ¥»¡C±z¥i¥H¿ï¾Ü¥u§ó·s¹L´Áªº½Æ¥»¡A©Î¬O§ó·s©Ò¦³ªº½Æ¥»¡C", - IDC_RELSET_DESC,31,7,242,26 - CONTROL "¥u§ó·s¹L´Áªº®eÅ齯¥»(&U)",IDC_RELSET_NORMAL,"Button", - BS_AUTORADIOBUTTON,46,41,173,10 - CONTROL "§ó·s©Ò¦³®eÅ齯¥»¡A¥]¬A¥¼¹L´Áªº½Æ¥»(&A)", - IDC_RELSET_FORCE,"Button",BS_AUTORADIOBUTTON,46,56,172, - 10 -END - -IDD_SVR_HOSTS DIALOGEX 0, 0, 226, 179 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - PUSHBUTTON "·s¼W¥D¹q¸£¦øªA¾¹(&A)",IDC_HOST_ADD,52,160,83,14 - PUSHBUTTON "²¾°£¥D¹q¸£¦øªA¾¹(&R)",IDC_HOST_REMOVE,138,160,80,14 - LTEXT "¦øªA¾¹©Ò¿ëÃѪº¸ê®Æ®w¥D¹q¸£¦øªA¾¹",IDC_HOST_TITLE,5,7, - 216,8 - CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, - 135,WS_EX_CLIENTEDGE -END - -IDD_SVR_ADDHOST DIALOGEX 0, 0, 225, 106 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "·s¼W¥D¹q¸£¦øªA¾¹" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "¥D¹q¸£(&H)¡G",-1,32,55,43,8 - EDITTEXT IDC_ADDHOST_HOST,79,53,103,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "½T©w",IDOK,63,88,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,117,88,50,14 - ICON IDI_SERVER,-1,4,4,20,20 - LTEXT "±z¿ï¾Ü·s¼W¸ê®Æ®w¥D¹q¸£¦øªA¾¹¨ìÀx¦s©ó¦øªA¾¹ %1 ªº²M³æ¡C\n\n½Ð¦b¤U¤è¿é¤J·sªº¸ê®Æ®w¥D¹q¸£¦WºÙ¡C", - IDC_ADDHOST_DESC,31,10,177,34 - PUSHBUTTON "»¡©ú",9,171,88,50,14 -END - -IDD_SVR_ADDRESS DIALOGEX 0, 0, 208, 115 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "ÅÜ§ó¦øªA¾¹¦ì§}" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - LTEXT "°O¿ý©ó VLDB ªº¦øªA¾¹ %1 ªº IP ¦ì§}¡G",IDC_TITLE,4,4,200, - 8 - LISTBOX IDC_SVR_ADDRESSES,4,14,147,40,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Åܧó(&C)...",IDC_ADDR_CHANGE,154,24,50,14 - PUSHBUTTON "²¾°£(&R)",IDC_ADDR_REMOVE,154,40,50,14 - DEFPUSHBUTTON "½T©w",IDOK,46,97,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,100,97,50,14 - PUSHBUTTON "»¡©ú",9,154,97,50,14 - LTEXT "ªþµù¡GÀɮצøªA¾¹·|¦b±Ò°Ê®É¡A¦Û°Ê¦V VLDB µn¿ý¨ä¥Ø«eªº IP ¦ì§}¡C", - IDC_STATIC,4,64,200,18 -END - -IDD_SVR_NEWADDR DIALOGEX 0, 0, 223, 69 -STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTEXTHELP -CAPTION "Åܧó IP ¦ì§}" -CLASS "AFSManagerClass" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "½T©w",IDOK,61,51,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,115,51,50,14 - PUSHBUTTON "»¡©ú",9,169,51,50,14 - LTEXT "¿é¤J·sªº IP ¦ì§} ¥H¨ú¥N VLDB ªº %1¡G",IDC_TITLE,4,4,215, - 8 - CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,32,23, - 100,14 - LTEXT "¦ì§}¡G",IDC_STATIC,4,26,28,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" -32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" -32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" -IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" -IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" -IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" -IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" -IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" -IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" -IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" -IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" -IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" -IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" -IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" -IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" -IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" -IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" -IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" -IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" -IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" -IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" -IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -ACCEL_MAIN ACCELERATORS DISCARDABLE -BEGIN - VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT - VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT - VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT - VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT - VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT - VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT - VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT - VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, - NOINVERT - VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT -END - - -///////////////////////////////////////////////////////////////////////////// -// -// AVI -// - -AVI_SETMOVE AVI DISCARDABLE "Resource\\setmove.avi" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVR_LISTS_TITLE "¦øªA¾¹ %1 - ºÞ²z­û²M³æ" - IDS_TAB_SERVICES "ªA°È" - IDS_TAB_AGGREGATES "¤À³Î°Ï" - IDS_TAB_FILESETS "®eÅé" - IDS_SERVICE_NONESELECTED "¿ï¨ú±z­nÀ˵øªº¦øªA¾¹¡C" - IDS_SERVICE_GOTSELECTED "¦øªA¾¹ %1 ¤WªºªA°È³B²z¡G" - IDS_AGGREGATE_ALL "©Ò¦³¦øªA¾¹¤Wªº¤À³Î°Ï¡G" - IDS_AGGREGATE_ONE "¦øªA¾¹ %1 ¤Wªº¤À³Î°Ï¡G " - IDS_FILESET_ALL "Cell %1 ¤¤ªº©Ò¦³®eÅé¡G" - IDS_FILESET_ONE "¦øªA¾¹ %1 ¤Wªº®eÅé¡G" - IDS_SVR_LISTS_TAB "ºÞ²z­û²M³æ" - IDS_SVR_PROP_TITLE "¦øªA¾¹ %1 - ¤º®e" - IDS_SVR_GENERAL_TAB "¤@¯ë¨Æ¶µ" - IDS_SVR_SCOUT_TAB "³]©w" - IDS_SERVER_TITLE "¦øªA¾¹ %1 - AFS ¦øªA¾¹ºÞ²zµ{¦¡" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_DESC "Cell %2 ¤¤ªº¦øªA¾¹ %1¡G" - IDS_SVC_PROP_TITLE "¦øªA¾¹ %1 ¤¤ªºªA°È %2 - ¤º®e" - IDS_SVC_GENERAL_TAB "¤@¯ë¨Æ¶µ" - IDS_SVC_ADD_TITLE "«Ø¥ßªA°È" - IDS_SVC_ADD_TAB "«Ø¥ßªA°È" - IDS_AGG_PROP_TITLE "¦øªA¾¹ %1 ¤Wªº¤À³Î°Ï %2 - ¤º®e" - IDS_AGG_GENERAL_TAB "¤@¯ë¨Æ¶µ" - IDS_SET_REP_TITLE "®eÅé %1 - ½Æ»s" - IDS_SET_REPSITES_TAB "½Æ»sºô¯¸" - IDS_SET_PROP_TITLE "®eÅé %1 - ¤º®e" - IDS_SET_GENERAL_TAB "¤@¯ë¨Æ¶µ" - IDS_SET_UNLOCKBTN "¥ß§Y¸Ñ°£Âê©w(&L)" - IDS_SET_LOCKBTN "¥ß§YÂê©w(&L)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_USAGE_FILESET "%2 °tÃB¤w¨Ï¥Îªº %1 (%3%%)" - IDS_USAGE_AGGREGATE "%2 ®e¶q¤w¨Ï¥Îªº %1 (%3%%)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGCOL_ALLOCATED "¥[Á`ªº°tÃB" - IDS_SVRCOL_NAME "¦øªA¾¹" - IDS_SVRCOL_STATUS "ª¬ºA" - IDS_SETCOL_DATE_ACCESS "¤W¦¸¦s¨ú¤é´Á" - IDS_SETCOL_DATE_BACKUP "¤W¦¸³Æ¥÷¤é´Á" - IDS_SVCCOL_NAME "ªA°È" - IDS_SVCCOL_TYPE "Ãþ«¬" - IDS_SVCCOL_PARAMS "°Ñ¼Æ" - IDS_SVCCOL_STATUS "ª¬ºA" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_DATE_START "¤W¦¸±Ò°Ê" - IDS_SVCCOL_DATE_STOP "¤W¦¸°±¤î" - IDS_SVCCOL_DATE_STARTSTOP "¤W¦¸±Ò°Ê / °±¤î" - IDS_SVCCOL_DATE_FAILED "¤W¦¸¥¢±Ñ" - IDS_SVCCOL_LASTERROR "¤W¦¸ªº¥X¤f½X" - IDS_AGGCOL_NAME "¤À³Î°Ï" - IDS_AGGCOL_ID "ID" - IDS_AGGCOL_DEVICE "¸Ë¸m" - IDS_AGGCOL_USED "¤w¨Ï¥Îªº" - IDS_AGGCOL_USED_PER "% ¤w¨Ï¥Î" - IDS_AGGCOL_FREE "ÄÀ©ñ" - IDS_AGGCOL_TOTAL "®e¶q" - IDS_AGGCOL_STATUS "ª¬ºA" - IDS_SETCOL_NAME "®eÅé" - IDS_SETCOL_TYPE "Ãþ«¬" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETCOL_DATE_CREATE "«Ø¥ß¤é´Á" - IDS_SETCOL_DATE_UPDATE "«e¦¸§ó·s" - IDS_SETCOL_STATUS "ª¬ºA" - IDS_SETCOL_QUOTA_USED "¤w¨Ï¥Îªº" - IDS_SETCOL_QUOTA_USED_PER "% ¤w¨Ï¥Îªº" - IDS_SETCOL_QUOTA_FREE "ÄÀ©ñ" - IDS_SETCOL_QUOTA_TOTAL "°tÃB" - IDS_TRYAGAINBTN "­«·s¹Á¸Õ(&A)" - IDS_NO_CELL_SELECTED "¡]©|¥¼«ü©w Cell¡^" - IDS_NO_AFS_ID "¡]¨S¦³¥i¥Îªº°O¸¹¡^" - IDS_AFS_ID_WILLEXP "%1¡]°O¸¹±N¨ì´Á %2¡^" - IDS_ELAPSED_TIME "%1" - IDS_SEARCHING_FOR_SERVERS "½Ðµy­Ô¡F¥¿¦b¨ú±o¦³Ãö %1 Cell ªº¸ê°T ..." - IDS_STATUS_NOALERTS "¤@¯ë" - IDS_TITLE_BROWSE_USER "¿ï¾Ü¨Ï¥ÎªÌ" - IDS_AGGTYPE_OTHER "¤£©ú (%1)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATEFILESET "¦b¤À³Î°Ï %1:%2 «Ø¥ß®eÅé %3" - IDS_ACTION_DELETEFILESET "±q¤À³Î°Ï %1:%2 §R°£®eÅé %3" - IDS_ACTION_MOVEFILESET "±N®eÅé %3 ²¾¦Ü¤À³Î°Ï %1:%2" - IDS_ACTION_SETFILESETQUOTA "Åܧó®eÅé %3 ªº°tÃB" - IDS_SVCSTOP_DESC2 "«ö¡u½T©w¡v¥H°±¤î³o¶µªA°È¡C" - IDS_SVCSTART_DESC2 "½Ð«ö¡u½T©w¡v¥H±Ò°Ê¥»ªA°È¡C" - IDS_SYNCVLDB_SVR_DESC "ĵ§i¡I\n\n¦pªG±zÄ~Äò¡A¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v·|­×§ï VLDB ¥H²Å¦X¦øªA¾¹ %1 ¤Wªº©Ò¦³¤À³Î°Ï¤º®e¡C" - IDS_SYNCVLDB_SVR_DESC2 "­Y VLDB ©Ò´£¨ìªº®eÅ饨«e°ò©ó¥ô¦ó¦]¯À¡AµLªk¦b¦øªA¾¹ %1 ¤Wªº¤À³Î°Ï§ä¨ì¡A¸Ó®eÅ骺 VLDB ¶µ¥Ø´N·|³Q§R°£¡I" - IDS_SYNCVLDB_AGG_DESC "ĵ§i¡I\n\n¦pªG±zÄ~Äò¡A¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v´N·|­×§ï VLDB ¥H²Å¦X¦øªA¾¹ %1 ¤§¤À³Î°Ï %2 ªº¤º®e¡C" - IDS_SYNCVLDB_AGG_DESC2 "­Y VLDB ©Ò´£¨ìªº®eÅ饨«e°ò©ó¥ô¦ó¦]¯À¡AµLªk¦b¥»¤À³Î°Ï¤W§ä¨ì¡A¸Ó®eÅ骺 VLDB ¶µ¥Ø´N·|³Q§R°£¡I" - IDS_PROMPT_BROWSE_USER "¨Ï¥ÎªÌ¡G" - IDS_PREVIEWIN_BUTTON "<< ¹wÄý(&P)" - IDS_PREVIEWOUT_BUTTON "¹wÄý(&P) >>" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ADMCOL_TYPE_USER "¨Ï¥ÎªÌ" - IDS_TITLE_BROWSE_PRINCIPAL "¿ï¨ú¥DÅé" - IDS_TITLE_BROWSE_OWNGROUP "¿ï¨ú¾Ö¦³ªº¸s²Õ" - IDS_PROMPT_BROWSE_PRINCIPAL "¥DÅé¡G" - IDS_PROMPT_BROWSE_OWNGROUP "¾Ö¦³¸s²Õ¡G" - IDS_ACTION_CLONE "«Ø¥ß®eÅé %3 ªº³Æ¥÷ª©¥»" - IDS_ACTION_CLONESYS "«Ø¥ß¦h­«ªº®eÅ鳯¥÷" - IDS_CLONESYS_FAILED "¦]µo¥Í¿ù»~ 0x%2 (%3) ¦ÓµLªk«Ø¥ß®eÅé %1 ªº³Æ¥÷¡C" - IDS_SET_UNSPECIFIED "¡]¥¼¸ü©úªº¡^" - IDS_SETCOL_ID "ID" - IDS_SETCOL_FILES "ÀÉ®×­p¼Æ" - IDS_SET_DUMP_NAME "%1.DMP ªº¶É¥X" - IDS_ACTION_DUMP "¶É¥X®eÅé %3¡]¤À³Î°Ï %1:%¡^" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FILESETNAME_ERROR "%1 - %2" - IDS_SETCOL_AGGREGATE "¤À³Î°Ï" - IDS_REFRESH_DESC_CELL "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¥¿¦b¨M©w %1 Cell ¤¤¤§¦øªA¾¹ªºª¬ºA¡C³o¥i¯à­nªá´X¤ÀÄÁ®É¶¡..." - IDS_REFRESH_DESC_SERVER "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¥¿¦b¨M©w¦øªA¾¹ %1 ªºª¬ºA¡C³o¥i¯à­nªá´X¤ÀÄÁ®É¶¡ ..." - IDS_REFRESH_CURRENT_CELL "¥Ø«e¥¿¦bÀˬd¡GCell %1" - IDS_REFRESH_CURRENT_SERVER "¥Ø«e¥¿¦bÀˬd¡G¦øªA¾¹ %2" - IDS_REFRESH_CURRENT_AGGREGATE "¥Ø«e¥¿¦bÀˬd¡G¦øªA¾¹ %2 ¤Wªº¤À³Î°Ï %3" - IDS_REFRESH_CURRENT_FILESET - "¥Ø«e¥¿¦bÀˬd¡G¦øªA¾¹ %2 ¤Wªº®eÅé %4¡A¤À³Î°Ï %3" - IDS_REFRESH_CURRENT_SERVICE "¥Ø«e¥¿¦bÀˬd¡G¦øªA¾¹ %2 ¤WªºªA°È %3" - IDS_REFRESH_PERCENT "%1%% ¤w§¹¦¨" - IDS_PROBLEMS "°ÝÃD" - IDS_SERVER_NO_PROBLEMS "³o­Ó¦øªA¾¹¨S¦³¤wª¾ªº°ÝÃD¡C" - IDS_SERVICE_NO_PROBLEMS "³o¶µªA°È¨S¦³¤wª¾ªº°ÝÃD¡C" - IDS_AGGREGATE_NO_PROBLEMS "³o­Ó¤À³Î°Ï¨S¦³¤wª¾ªº°ÝÃD¡C" - IDS_FILESET_NO_PROBLEMS "³o­Ó®eÅé¨S¦³¤wª¾ªº°ÝÃD¡C" - IDS_AGGTYPE_TYPE1 "UFS" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGGTYPE_TYPE2 "LFS" - IDS_AGGTYPE_TYPE3 "AIX" - IDS_AGGTYPE_TYPE4 "VXFS" - IDS_AGGTYPE_TYPE5 "DMEPI" - IDS_REFRESH_CURRENT_VLDB "¥Ø«e¥¿¦bÀˬd¡G®eÅé¦ì¸m¸ê®Æ®w (VLDB)" - IDS_FILESETTYPE_RW "Ū¨ú/¼g¤J" - IDS_FILESETTYPE_RO "½Æ¥»" - IDS_FILESETTYPE_CLONE "³Æ¥÷" - IDS_MOVESET_READWRITE "¦pªGÄ~Äò¡A®eÅé %3 ·|±q¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ²¾°Ê¨ì¥t¤@­Ó¦ì¸m¡C" - IDS_MOVESET_READONLY "¦pªGÄ~Äò¡A®eÅ齯¥» %3 ±N·|±q¦øªA¾¹ %1 ¤À³Î°Ï %2 ²¾°£¡A¦Ó¥t¤@­Ó¦b±z©ó¥H¤U©Ò«ü©w¤§¤À³Î°Ï¤W©Ò«Ø¥ßªº®eÅ齯¥»¤]·|³Q²¾°£¡C" - IDS_SVC_START_TITLE "±Ò°ÊªA°È" - IDS_SVC_STOP_TITLE "°±¤îªA°È" - IDS_SERVICESTATUS_STARTING "¥Ø«e¥¿¦b±Ò°Ê¦¹ªA°È¡C" - IDS_SERVICESTATUS_RUNNING "¥Ø«e¥¿¦b°õ¦æ¦¹ªA°È¡C" - IDS_SERVICESTATUS_STOPPED "¥Ø«e¤w°±¤î¦¹ªA°È¡C" - IDS_SERVICESTATUS_STOPPING "¥Ø«e¥¿¦b°±¤î¦¹ªA°È¡C" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICESTATUS_UNKNOWN "¦¹ªA°Èªºª¬ºA¤£©ú¡C" - IDS_SVC_RESTART_BUTTON "¥ß§Y°±¤î¨Ã­«·s±Ò°Ê(&R)" - IDS_PROBLEM_BOX "¤wª¾ªº°ÝÃD (%1)" - IDS_VIEWLOG_DESC_NOFILE "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v§ä¤£¨ì¦øªA¾¹ %1 ¤§ªA°È %2 ªº¤é»xÀÉ¡C½Ð¦b¤U¤è¿é¤JªA°È¤§¤é»xÀɪº§¹¾ã¸ô®|¡C" - IDS_NO_GROUP "¡]¨S¦³¾Ö¦³ªº¸s²Õ¡^" - IDS_VIEWLOG_FROMSERVER "¦øªA¾¹ %1 ¤Wªº¤é»xÀÉ" - IDS_VIEWLOG_FROMSERVICE "¦øªA¾¹ %1 ¤§ªA°È %2 ªº¤é»xÀÉ" - IDS_VIEWLOG_TRUNCATED "Àɮפº®e¡]¥uÅã¥Ü³Ì«á %1 ¦æ¡^¡G" - IDS_SAVELOG_FILTER "Text File|*.TXT|" - IDS_ADVANCEDIN_BUTTON "<< ¶i¶¥(&A)" - IDS_ADVANCEDOUT_BUTTON "¶i¶¥(&A) >>" - IDS_REPTYPE_RELEASE "ÄÀ©ñ½Æ»s" - IDS_REPTYPE_SCHEDULED "¤w±Æ©wªº½Æ»s" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_UPDATEALL_BUTTON "¥þ³¡§ó·s(&U)" - IDS_UPDATETHIS_BUTTON "§ó·s(&U)" - IDS_SERVER_MULTIPLE_PROBLEMS "¦¹¦øªA¾¹¦³ %1 ªº¤wª¾°ÝÃD¡C" - IDS_SERVICE_MULTIPLE_PROBLEMS "¦¹ªA°È¦³ %1 ªº¤wª¾°ÝÃD¡C" - IDS_AGGREGATE_MULTIPLE_PROBLEMS "¦¹¤À³Î°Ï¦³ %1 ªº¤wª¾°ÝÃD¡C" - IDS_FILESET_MULTIPLE_PROBLEMS "¦¹®eÅ馳 %1 ¤wª¾ªº°ÝÃD¡C" - IDS_FILESETTYPE_RO_STAGE "½Æ¥»" - IDS_SERVICETYPE_SIMPLE_LONG "²¦¡¡]«ùÄò°õ¦æ¡^" - IDS_SERVICETYPE_CRON_LONG "Cron¡]¥H«ü©w¶¡¹j°õ¦æ¡^" - IDS_QUOTAUNITS_KB "kb" - IDS_QUOTAUNITS_MB "MB" - IDS_NO_QUOTA_REPLICA "¡]¦¹®eÅ鬰½Æ¥»¡A¦]¦¹¨S¦³°tÃB¡^" - IDS_NO_QUOTA_CLONE "¡]¦¹®eÅ鬰³Æ¥÷¡A¦]¦¹¨S¦³°tÃB¡^" - IDS_USAGE_REPLICA "%1 ¤w¨Ï¥Î" - IDS_USAGE_CLONE "%1 ¤w¨Ï¥Î" - IDS_COL_AGGS_MOVE "«Ø¥ß®eÅé®Éªº¤À³Î°Ï" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVER_SERVICE "%1:%2" - IDS_SERVICETYPE_SIMPLE "²¦¡" - IDS_SERVICETYPE_CRON "Cron" - IDS_SERVICESTATE_STOPPED "¤w°±¤î" - IDS_SERVICESTATE_STOPPING "¥¿¦b°±¤î" - IDS_SERVICESTATE_STARTING "¥¿¦b±Ò°Ê" - IDS_SERVICESTATE_RUNNING "¥¿¦b°õ¦æ" - IDS_SERVICETYPE_FS_LONG "FS¡]Àɮרt²Î¡^" - IDS_SERVICETYPE_FS "FS" - IDS_SERVICE_LASTERROR "%1" - IDS_SERVICES_IN_CELL "Cell %1 ¤¤ªº©Ò¦³ªA°È¡G" - IDS_SERVICE_STARTDATE "¤w±Ò°Ê %1" - IDS_SERVICE_STOPDATE "¤w°±¤î %1" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_PERCENTAGE "%1 %%" - IDS_AGGREGATES_IN_SERVER "¦øªA¾¹ %1 ¤Wªº¤À³Î°Ï¡G " - IDS_AGGREGATES_IN_CELL "Cell %1 ¤¤ªº©Ò¦³¤À³Î°Ï¡G" - IDS_AGGREGATES_IN_NOTHING "¤À³Î°Ï¡G" - IDS_FILESETS_IN_SERVER "¦øªA¾¹ %1 ¤Wªº®eÅé¡G" - IDS_FILESETS_IN_CELL "Cell %1 ¤¤ªº©Ò¦³®eÅé¡G" - IDS_FILESETS_IN_NOTHING "®eÅé¡G" - IDS_SERVICES_IN_SERVER "¦øªA¾¹ %1 ¤WªºªA°È¡G" - IDS_SERVICES_IN_NOTHING "ªA°È¡G" - IDS_UNKNOWN "¡]¤£©ú¡^" - IDS_UNKNOWN_GROUP "¸s²Õ¸¹½X %1¡]¦WºÙ¤£©ú¡^" - IDS_AGGFULL_WARN_OFF "¹w³]Á{¬É­È¡]¦øªA¾¹ªºÄµ§i¤w°±¥Î¡^" - IDS_SERVER_AGGREGATE "%1:%2" - IDS_SERVERNAME_ERROR "%1 - %2" - IDS_AGGREGATENAME_ERROR "%1 - %2" - IDS_SETFULL_WARN_OFF "¹w³]Á{¬É­È¡]¦øªA¾¹¤WªºÄµ§i¤w°±¥Î¡^" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_LASTERRORDATE "%1 - ¥X¤f½X %2" - IDS_COL_SERVERS "Cell ¤Wªº¦øªA¾¹" - IDS_COL_FILESETS "¦øªA¾¹¤Wªº®eÅé" - IDS_COL_AGGREGATES "¦øªA¾¹¤Wªº¤À³Î°Ï" - IDS_COL_SERVICES "¦øªA¾¹¤WªºªA°È" - IDS_COL_REPLICAS "®eÅ骺½Æ¥»" - IDS_COLUMNS_TITLE "¿ï¨úÅã¥Üª½Äæ - AFS ¦øªA¾¹ºÞ²zµ{¦¡" - IDS_REPCOL_SERVER "¦øªA¾¹" - IDS_REPCOL_AGGREGATE "¤À³Î°Ï" - IDS_REPCOL_DATE_UPDATE "¤W¦¸§ó·s" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COL_AGGS_CREATE "²¾°Ê®eÅé®Éªº¤À³Î°Ï" - IDS_WARN_TITLE "ĵ§i" - IDS_WARN_DISABLE_AUTH "±z­Y«ö¤@¤U""¤¹³\¤£°µÅ²§O""«ö¶s¡A¥¼Å²§Oªº¥DÅé´N·|Àò±o¤¹³\¾Þ§@¦¹¦øªA¾¹¤WªºªA°È¡C¥Ñ©ó«Ü¦hªA°È¦b root ¨­¥÷¤§¤U°õ¦æ¡A¦]¦¹³o­Ó°Ê§@ªí¥Ü +" - IDS_WARN_DISABLE_AUTH2 "¦øªA¾¹ªº¦w¥þ©Ê¦³©úÅ㪺·å²«¡C\n\n±z½T©w­n°µ¦¹Åܧó¶Ü¡H" - IDS_SVR_NO_ADDR "¡]¥¼¸ü©úªº¡^" - IDS_TITLE_BAD_CELL "µLªkÃѧOªº Cell ¦WºÙ" - IDS_DESC_BAD_CELL "±z©Ò¿é¤Jªº Cell ¦WºÙµLªk¦bºô¸ô¤W§ä¨ì¡C\n\n½Ð½T©w±z©Ò¿é¤Jªº¶µ¥Ø¬O§_¥¿½T¡C" - IDS_AGGFULL_WARN_ON "¥»¦øªA¾¹ªº¹w³]Á{¬É­È(&D) ¡]¨ä¤j¤pªº %1%%¡^" - IDS_SETFULL_WARN_ON "¥»¦øªA¾¹ªº¹w³]Á{¬É­È(&D) ¡]¨ä¤j¤pªº %1%%¡^" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_BAD_CREDENTIALS - "µLªkÃѧO±z©Ò¿é¤Jªº AFS ¨­¥÷¡A©Î¬O±z©Ò«ü©wªº±K½X¦³»~¡C" - IDS_CREDS_NONE "¡]¨S¦³°O¸¹¡^" - IDS_CREDS_VALID "%2, ¹L´Á %3" - IDS_CREDS_EXPIRED "¡]°O¸¹¤w¹L´Á %3¡^" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_AGG_FILESETS "%1 ¡]¥[Á`ªº°tÃB¡G %2¡^" - IDS_ACTION_DESC_NONE "¨S¦³¥¿¦b¶i¦æªº§@·~¡C" - IDS_ACTION_DESC_ONE "¤U¦Cªº§@·~¥Ø«e¥¿¦b¶i¦æ¡G" - IDS_ACTION_DESC_MULT "¥Ø«e¥¿¦b¶i¦æ¥H¤Uªº§@·~¡G" - IDS_ACTCOL_OPERATION "§@·~" - IDS_ACTCOL_ELAPSED "¸g¾ú®É¶¡" - IDS_ACTION_REFRESH "­«·s¾ã²z Cell ¸ê°T" - IDS_ACTION_CREATESERVER "«Ø¥ß¦øªA¾¹ %1" - IDS_ACTION_DELETESERVER "¥¿¦b§R°£¦øªA¾¹ %1" - IDS_ACTION_GETSERVERLOGFILE "¥¿¦V¦øªA¾¹ %1 ¨ú±o¤é»xÀÉ %2" - IDS_ACTION_SETSERVERAUTH "¥¿¦bÅÜ§ó¦øªA¾¹ %1 ªº¦s¨ú­­¨î" - IDS_ACTION_CHANGESERVERSTATUS "ÅÜ§ó¦øªA¾¹ %1 ªº¤º®e" - IDS_ACTION_STARTSERVICE "¥¿¦b±Ò°Ê¦øªA¾¹ %1 ªºªA°È %2" - IDS_ACTION_STOPSERVICE "¥¿¦b°±¤î¦øªA¾¹ %1 ¤WªºªA°È %2" - IDS_ACTION_RESTARTSERVICE "­«·s±Ò°Ê¦øªA¾¹ %1 ¤WªºªA°È %2" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SYNCVLDB_SVR "±N VLDB »P¦øªA¾¹ %1 ¶i¦æ¦P¨B" - IDS_ACTION_SYNCVLDB_AGG "±N VLDB »P¤À³Î°Ï %1:%2 ¶i¦æ¦P¨B" - IDS_ACTION_SCOUT "Àˬd¦øªA¾¹ %1 ªº°ÝÃD" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_SETREPPARAMS "Åܧó®eÅé %3 ªº½Æ»s¤º®e" - IDS_ACTION_CREATEREPLICA "¦b¤À³Î°Ï %1:%2 «Ø¥ß®eÅé %3 ªº½Æ¥»" - IDS_DELSET_REPLICA_DESC "ĵ§i¡I\n\n¦pªGÄ~Äò¡A±N¾É¦Ü¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº®eÅé %3 ½Æ¥»³Q²¾°£¡C" - IDS_DELSET_CLONE_DESC "ĵ§i¡I\n\n¦pªGÄ~Äò¡A±N¾É¦Ü®eÅ鳯¥÷ %3 ±q¦øªA¾¹ %1 ¤À³Î°Ï %2 ³Q²¾°£¡C" - IDS_INSTALL_DESC1 "¥»§@·~±NÀÉ®×±q¦¹¹q¸£½Æ»s¨ì¥t¤@¥x¹q¸£¤W¡C +" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_INSTALL_DESC2 "¦pªGÀɮפw¦s©ó¥Ø¼Ð¹q¸£¡A´N·|²£¥Í¤@­Ó°ÆÀɦW¬° .BAK ªº³Æ¥÷¡F¦Ó²{¦³ªº³Æ¥÷·|µ¹»P .OLD °ÆÀɦW¡A¨Ã±N¥ô¦ó°ÆÀɦW¬° .OLD ªº²{¦sÀÉ®×§R°£¡C" - IDS_ACTION_INSTALLFILE "±NÀÉ®× %2 ¦w¸Ë©ó¦øªA¾¹ %1" - IDS_ACTION_UNINSTALLFILE "±NÀÉ®× %2 ±q¦øªA¾¹ %1 ¤W¸Ñ°£¦w¸Ë" - IDS_ACTION_PRUNEFILES "±NÀÉ®×±q¦øªA¾¹ %1 §R°£" - IDS_FILTER_ALLFILES "©Ò¦³ÀÉ®×|*.*|" - IDS_ACTION_RENAMEFILESET "±N®eÅé %1 ­«·s©R¦W¬° %2" - IDS_RECUR_DAILY "¨C¤Ñ" - IDS_RECUR_SUNDAY "¨C¬P´Á¤Ñ" - IDS_RECUR_MONDAY "¨C¬P´Á¤@" - IDS_RECUR_TUESDAY "¨C¬P´Á¤G" - IDS_RECUR_WEDNESDAY "¨C¬P´Á¤T" - IDS_RECUR_THURSDAY "¨C¬P´Á¥|" - IDS_RECUR_FRIDAY "¨C¬P´Á¤­" - IDS_RECUR_SATURDAY "¨C¬P´Á¤»" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CREATESERVICE "¦b¦øªA¾¹ %1 ¤W«Ø¥ßªA°È %2" - IDS_ACTION_DELETESERVICE "±NªA°È %2 ±q¦øªA¾¹ %1 ¤W§R°£" - IDS_ACTION_RELEASEFILESET "ÄÀ©ñ®eÅé %3" - IDS_ACTION_GETDATES "±q¦øªA¾¹ %1 ¤W¨ú±oÀÉ®× %2 ªº¤é´Á" - IDS_LASTMODIFIED "¤W¦¸­×§ï %1" - IDS_SVR_SECURITY_TITLE "¦øªA¾¹¦w¥þ©Ê - %1" - IDS_SVR_LIST_TAB "ºÞ²z­û" - IDS_ACTION_ADMINLIST_LOAD "¨ú±o¦øªA¾¹ %1 ªººÞ²z­û" - IDS_ACTION_ADMINLIST_SAVE "¼g¤J¦øªA¾¹ %1 ªººÞ²z­û" - IDS_ADMCOL_PRINCIPAL "¦¨­û" - IDS_ADMCOL_TYPE "Ãþ«¬" - IDS_ADMCOL_TYPE_GROUP "¸s²Õ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_RESTORE "´_­ì®eÅé %1" - IDS_COL_AGGS_RESTORE "´_­ì®eÅé®Éªº¤À³Î°Ï" - IDS_RESTORE_FILTER "®eÅé¶É¥XÀÉ®×|*.DMP|©Ò¦³ÀÉ®×|*.*|" - IDS_SVC_BOS_TAB "BOS" - IDS_ACTION_SETRESTART "ÅÜ§ó¦øªA¾¹ %1 ªºªA°È±Ò°Ê®É¶¡" - IDS_RESTORE_CREATESET "®eÅé %1 ±N©ó±z¦b¤U¤è©Ò«ü©w¤§¦øªA¾¹»P¤À³Î°Ï¤W«Ø¥ß¡C" - IDS_RESTORE_OVERWRITESET - "ĵ§i¡I ®eÅé %3 ¦s¦b©ó¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W¡A¦pªG±zÄ~Äòªº¸Ü¡A¸Ó®eÅé±N·|³Q§ï¼g¡I" - IDS_SUBSET_TITLE_LOAD "¶}±Ò¦øªA¾¹¤l¶°" - IDS_SUBSET_TITLE_SAVE "Àx¦s¦øªA¾¹¤l¶°" - IDS_BUTTON_OPEN "¶}±ÒÂÂÀÉ(&O)" - IDS_BUTTON_SAVE "Àx¦s(&S)" - IDS_SUBSET_SAVE_TITLE "ĵ§i" - IDS_SUBSET_SAVE_DESC "¦W¬° %1 ªº¦øªA¾¹¤l¶°¤w¸g¦s¦b¡C\n\n±z­n§ï¼g³o­Ó¤l¶°¶Ü¡H" - IDS_SUBSET_CHANGED "%1 [­×§ï]" - IDS_SUBSET_TAB "ºÊµø¦øªA¾¹" - IDS_SUBSET_DISCARD_TITLE "Àx¦s¤l¶°¶Ü¡H" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SUBSET_DISCARD_DESC "±z©|¥¼±N¥Ø«e©ÒºÊµøªº¦øªA¾¹²M³æÀx¦s¬°¤l¶°¡C­Y±zÀx¦s¦¹²M³æ¡A§Y¥i¦bµy«áÄ~ÄòºÊµø³o¨Ç¦øªA¾¹¡C\n\n+" - IDS_SUBSET_DISCARD_DESC2 - "±z­n«Ø¥ß¤@­Ó¥]§t¥Ø«e¥¿ºÊµø¤§¦øªA¾¹²M³æªº¤l¶°¶Ü¡H" - IDS_SUBSET_NONAME "¡]¥¼©R¦W¡^" - IDS_SUBSET_NOSUBSET "¡]©Ò¦³ªº¦øªA¾¹³£¦bºÊµøª¬ºA¤U¡^" - IDS_SUBSET_SERVERSUBSET "¦øªA¾¹ %1" - IDS_FILESET_SOME "Cell %1 ¤¤©Ò¦³³QºÊµøªº¦øªA¾¹®eÅé¡G" - IDS_AGGREGATE_SOME "Cell %1 ¤¤©Ò¦³³QºÊµøªº¦øªA¾¹¤À³Î°Ï¡G" - IDS_SERVICE_SOME "Cell %1 ¤¤©Ò¦³³QºÊµøªº¦øªA¾¹ªA°È¡G" - IDS_FILESET_UNMON "¥¼ºÊµø¦øªA¾¹ %1 " - IDS_AGGREGATE_UNMON "¥¼ºÊµø¦øªA¾¹ %1 " - IDS_SERVICE_UNMON "¥¼ºÊµø¦øªA¾¹ %1 " - IDS_SUBSET_DELETE_TITLE "§R°£¤l¶°¶Ü¡H" - IDS_SUBSET_DELETE_DESC "±z½T©w­n§R°£¦øªA¾¹¤l¶° %1¡H" - IDS_ERROR_TRANSLATED "¿ù»~½X 0x%1 (%2)¡G\n\n%3" - IDS_ERROR_NOTTRANSLATED "¿ù»~½X 0x%1 (%2) µLªkÃѧO¡C" - IDS_FIND_NOTHING_TITLE "¥¼¿ï¨ú«ü¥O" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FIND_NOTHING_DESC "¦p­n§ä¥X°õ¦æ§@·~ªº¤èªk¡A­º¥ý½Ð±q²M³æ¤¤¿ï¨ú¤@­Ó«ü¥O¦æ¡A©Î¬OÁä¤JÃöÁä¦r¡C" - IDS_FIND_UNKNOWN_TITLE "¤£©ú«ü¥O" - IDS_FIND_UNKNOWN_DESC "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v§ä¤£¨ì ""%1"" «ü¥Oªº»¡©ú¥DÃD¡C" - IDS_HELPABOUT_DESC1 "ĵ§i¡G¦¹¹q¸£µ{¦¡¨üµÛ§@Åv»P°ê»Úªk³Wªº«OÅ@¡C +" - IDS_HELPABOUT_DESC2 "¥¼¸g±ÂÅv¦Ó½Æ»s©Î¤À°e¦¹³nÅé±N¾É­PÄY­«ªº¥Á¨Æ»P¦D¨Æ³B¤À¡A¨Ã±N¨Ìªk§@³ÌÄY¼Fªº³B¤À¡C\n\n+" - IDS_HELPABOUT_DESC3 "AFS ¬O¤@®a IBM ¤½¥q¡ATransarc Corporation ªº°Ó¼Ð¡C" - IDS_CANT_QUIT_TITLE "AFS ¦øªA¾¹ºÞ²zµ{¦¡" - IDS_CANT_QUIT_REBOOT "ĵ§i¡I\n\n¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¥Ø«e¥¿¦b°õ¦æ¤@©Î¼Æ¶µ§@·~¡C¦pªG±z²{¦bÃö³¬ Windows¡A³o¨Ç§@·~±NµLªk¶¶§Q§¹¦¨¡C\n\n±z½T©w­n­«·s±Ò°Ê Windows ¶Ü¡H" - IDS_APP_TITLE "AFS ¦øªA¾¹ºÞ²zµ{¦¡" - IDS_ACTION_OPENCELL "¦b %1 Cell ¤W´M§ä¦øªA¾¹" - IDS_OPTIONS_TITLE "¿ï¶µ - AFS ¦øªA¾¹ºÞ²zµ{¦¡" - IDS_OPTIONS_GENERAL_TAB "¤@¯ë¨Æ¶µ" - IDS_BADCREDS_DESC "°£«D±z¥HºÞ²z­ûªº¨­¥÷µn¤J¡A§_«h±zªºÅv­­±N¤£¨¬¥H¶¶§QºÞ²z %1 Cell¡C¦s¨úÅv¦pªG¤£¨¬¡A¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v·|¦b Cell ¨S¦³°ÝÃDªº±¡ªp¤U¡A¨ÌµMµo²{°ÝÃD¡C" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CONFIRMATION_TITLE "½T»{ - AFS ¦øªA¾¹ºÞ²zµ{¦¡" - IDS_NO_GROUP_CHECKBOX "¨S¦³¾Ö¦³ªº¸s²Õ" - IDS_AFS_ID_DIDEXP "%1 ¡]°O¸¹¹L´Á %2¡^" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_QUERYING "¡]¬d¸ß¡^" - IDS_ADMCOL_TYPE_FOREIGN_GROUP "¥~³¡¸s²Õ" - IDS_ADMCOL_TYPE_FOREIGN_USER "¥~³¡¨Ï¥ÎªÌ" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SVCCOL_NOTIFIER "³qª¾ªÌ" - IDS_SVC_NONOTIFIER "¡]µL¡^" - IDS_SVR_KEY_TAB "¦øªA¾¹ª÷Æ_" - IDS_KEYNAME_NOTIME "¦øªA¾¹ %1 ªº«öÁä¡G" - IDS_KEYNAME_WITHTIME "¦øªA¾¹ %1 ªº«öÁä¡]¤w­×§ï %2¡^¡G" - IDS_SVRKEY_VERSION "ª©¥»" - IDS_SVRKEY_DATA "­È" - IDS_SVRKEY_CHECKSUM "Àˬd¶q" - IDS_SVRKEY_DATA_UNKNOWN "¡]ÁôÂá^" - IDS_STARTSERVICE_TITLE "±Ò°ÊªA°È" - IDS_STOPSERVICE_TITLE "°±¤îªA°È" - IDS_STARTSERVICE_TEXT "«ö¤@¤U¡u½T©w¡v¥H±Ò°Ê¦øªA¾¹ %1 ¤WªºªA°È %2¡C" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STOPSERVICE_TEXT "«ö¤@¤U¡u½T©w¡v¥H°±¤î¦øªA¾¹ %1 ¤WªºªA°È %2¡C" - IDS_STARTSERVICE_STARTUP - "±z¥i¥H§â¥¦Åܦ¨¥Ã¤[Åܧó¡A³o¼Ë¦øªA¾¹ %2 ´N·|¦b¦øªA¾¹ %1 ­«·s±Ò°Ê®É¦Û°Ê±Ò°Ê¡C" - IDS_STOPSERVICE_STARTUP "±z¥i¥H§â¥¦Åܦ¨¥Ã¤[Åܧó¡A³o¼ËªA°È %2 ´N¤£·|¦b¦øªA¾¹ %1 ­«·s±Ò°Ê®É¦Û°Ê±Ò°Ê¡C" - IDS_STARTSERVICE_PERMANENT - "¥Ã¤[(&P)¡]¦øªA¾¹ %1 ­«·s±Ò°Ê®É¡A§Y±Ò°ÊªA°È %2¡^" - IDS_STARTSERVICE_TEMPORARY - "¼È®É(&T)¡]¦øªA¾¹ %1 ­«·s±Ò°Ê®É¡A¤£­n±Ò°ÊªA°È %2¡^" - IDS_STOPSERVICE_PERMANENT - "¥Ã¤[(&P)¡]¦øªA¾¹ %1 ­«·s±Ò°Ê®É¡A¤£­n±Ò°ÊªA°È %2¡^" - IDS_STOPSERVICE_TEMPORARY - "¼È®É(&T)¡]¦øªA¾¹ %1 ­«·s±Ò°Ê®É¡A§Y±Ò°ÊªA°È %2¡^" - IDS_ACTION_EXECUTE "°õ¦æ¦øªA¾¹ %1 ¤Wªº %2" - IDS_ACTION_SALVAGE_SVR "´©±Ï¦øªA¾¹ %1 ¤Wªº©Ò¦³®eÅé" - IDS_ACTION_SALVAGE_AGG "´©±Ï¤À³Î°Ï %1:2 ¤Wªº©Ò¦³®eÅé" - IDS_ACTION_SALVAGE_VOL "´©±Ï¤À³Î°Ï %1:2 ¤Wªº®eÅé %3" - IDS_SALVAGE_SVR "´©±Ï¦øªA¾¹ %1 ¤Wªº©Ò¦³®eÅé" - IDS_SALVAGE_AGG "´©±Ï¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº©Ò¦³®eÅé" - IDS_SALVAGE_SET "´©±Ï¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº®eÅé %3" - IDS_SETSTATUS_SALVAGE "§Q¥Î®eÅé" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SETSTATUS_LOCKED "®eÅé¤wÂê©w" - IDS_SETSTATUS_NO_VOL "®eÅé¿òº|" - IDS_SETSTATUS_BUSY "®eÅ饨«e¦£¸L¤¤" - IDS_SETSTATUS_MOVED "®eÅé¤w²¾°Ê" - IDS_SVR_CAPACITY "%1" - IDS_SVR_ALLOCATION "%1 (%2%%)" - IDS_SVRCOL_ADDRESS "¦ì§}" - IDS_HOST_TITLE "¦øªA¾¹ %1 ©Ò¿ëÃѪº¸ê®Æ®w¥D¹q¸£¦øªA¾¹¡G" - IDS_SVR_HOSTS_TITLE "¦øªA¾¹ %1 - ¸ê®Æ®w¥D¹q¸£" - IDS_SVR_HOST_TAB "¸ê®Æ®w¥D¹q¸£" - IDS_ACTION_HOSTLIST_LOAD "±q¦øªA¾¹ %1 ¨ú±o¥D¹q¸£²M³æ" - IDS_ACTION_HOSTLIST_SAVE "±N¥D¹q¸£²M³æ¼g¤J¦øªA¾¹ %1" - IDS_SETSTATUS_1ALERT "®eÅ馳¤@­Ó°ÝÃD" - IDS_SETSTATUS_2ALERT "®eÅ馳 %1 °ÝÃD" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACTION_CHANGEADDR "ÅÜ§ó¦øªA¾¹ %1 ªº IP ¦ì§}" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_ADDSITE "vos addsite" - IDS_COMMAND_VOS_BACKUP "vos backup" - IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" - IDS_COMMAND_VOS_CREATE "vos create" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_DELENTRY "vos delentry" - IDS_COMMAND_VOS_DUMP "vos dump" - IDS_COMMAND_VOS_EXAMINE "vos examine" - IDS_COMMAND_VOS_LISTPART "vos listpart" - IDS_COMMAND_VOS_LISTVLDB "vos listvldb" - IDS_COMMAND_VOS_LISTVOL "vos listvol" - IDS_COMMAND_VOS_LOCK "vos lock" - IDS_COMMAND_VOS_MOVE "vos move" - IDS_COMMAND_VOS_PARTINFO "vos partinfo" - IDS_COMMAND_VOS_RELEASE "vos release" - IDS_COMMAND_VOS_REMOVE "vos remove" - IDS_COMMAND_VOS_REMSITE "vos remsite" - IDS_COMMAND_VOS_RENAME "vos rename" - IDS_COMMAND_VOS_RESTORE "vos restore" - IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" - IDS_COMMAND_VOS_UNLOCK "vos unlock" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" - IDS_COMMAND_VOS_ZAP "vos zap" - IDS_COMMAND_BOS_ADDHOST "bos addhost" - IDS_COMMAND_BOS_ADDKEY "bos addkey" - IDS_COMMAND_BOS_ADDUSER "bos adduser" - IDS_COMMAND_BOS_CREATE "bos create" - IDS_COMMAND_BOS_DELETE "bos delete" - IDS_COMMAND_BOS_EXEC "bos exec" - IDS_COMMAND_BOS_GETDATE "bos getdate" - IDS_COMMAND_BOS_GETLOG "bos getlog" - IDS_COMMAND_BOS_GETRESTART "bos getrestart" - IDS_COMMAND_BOS_INSTALL "bos install" - IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" - IDS_COMMAND_BOS_LISTKEYS "bos listkeys" - IDS_COMMAND_BOS_LISTUSERS "bos listusers" - IDS_COMMAND_BOS_PRUNE "bos prune" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_BOS_REMOVEHOST "bos removehost" - IDS_COMMAND_BOS_REMOVEKEY "bos removekey" - IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" - IDS_COMMAND_BOS_RESTART "bos restart" - IDS_COMMAND_BOS_SALVAGE "bos salvage" - IDS_COMMAND_BOS_SETAUTH "bos setauth" - IDS_COMMAND_BOS_SETRESTART "bos setrestart" - IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" - IDS_COMMAND_BOS_START "bos start" - IDS_COMMAND_BOS_STARTUP "bos startup" - IDS_COMMAND_BOS_STATUS "bos status" - IDS_COMMAND_BOS_STOP "bos stop" - IDS_COMMAND_BOS_UNINSTALL "bos uninstall" - IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" - IDS_COMMAND_FS_LISTQUOTA "fs listquota" - IDS_COMMAND_FS_QUOTA "fs quota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_COMMAND_FS_SETQUOTA "fs setquota" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCSHORT_UNMONITORED "¥¼ºÊµø¦øªA¾¹ %1 ¬O§_¦³°ÝÃD" - IDS_ALERT_DESCSHORT_TIMEOUT "µLªk»P¦øªA¾¹ %1 ¨ú±oÁpô¡F¤W­Ó¿ù»~¡G%3" - IDS_ALERT_DESCSHORT_AGG_FULL "%2 ¤À³Î°Ïªº¨Ï¥Î¶W¹Lĵ§iªºÁ{¬É­È %3%% (%4)" - IDS_ALERT_DESCSHORT_SET_FULL "%3 ®eÅ骺¨Ï¥Î¶W¹Lĵ§iªºÁ{¬É­È %4%% (%5)" - IDS_ALERT_DESCSHORT_NO_VLDBENT "®eÅé %3 ¨S¦³ VLDB ¶µ¥Ø" - IDS_ALERT_DESCSHORT_NO_SVRENT_SET - "®eÅé %3 ¨ã¦³ VLDB ¶µ¥Ø¡A¦ý¬O¦b¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W§ä¤£¨ì" - IDS_ALERT_DESCSHORT_STOPPED "ªA°È %2 ¤w¦b %3 °±¤î" - IDS_ALERT_DESCSHORT_NO_SVRENT_AGG - "VLDB »P¤À³Î°Ï %2 ¬ÛÃö¡A¦ý«o¥¼¦b¦øªA¾¹ %1 ¤W§ä¨ì" - IDS_ALERT_DESCSHORT_BADCREDS "±zªºÅv­­¤£¨¬¥HºÞ²z¦øªA¾¹ %1" - IDS_ALERT_DESCSHORT_AGG_ALLOC "¤À³Î°Ï %2 ¤Wªº¥[Á`®eÅé°tÃB¶W¹L¨ä®e¶q" - IDS_ALERT_DESCSHORT_STATE_NO_VNODE "%3 ®eÅé¦]¨ü·l¦ÓµLªk¨Ï¥Î¡C" - IDS_ALERT_DESCSHORT_STATE_NO_SERVICE - "¦øªA¾¹®eÅé %3 ¤W¨S¦³¥¿¦b°õ¦æªºªA°È¡C" - IDS_ALERT_DESCSHORT_STATE_OFFLINE "%3 ®eÅé¤wÂ÷½u¡A¦]¦¹µLªk¨Ï¥Î¡C" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_TIMEOUT - "µLªk»P¦øªA¾¹ %1 ¨ú±oÁpô¡C¤W¤@¦¸¦b %2 ©Ò¶i¦æªºÀ|¸Õ¾É¦Ü¿ù»~ ""%3"" ªºµo¥Í¡C" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_DESCFULL_AGG_FULL - "¦øªA¾¹ %1 ¤§¤À³Î°Ï %2 ªº¨Ï¥Î¶W¹L¨äĵ§iÁ{¬É­È %3%% (%4)¡C" - IDS_ALERT_DESCFULL_SET_FULL - "®eÅé %3 ªº¨Ï¥Î¡]¦øªA¾¹ %1¡A¤À³Î°Ï %2¡^¶W¹L¨äĵ§iÁ{¬É­È %4%% (%5)¡C" - IDS_ALERT_DESCFULL_NO_VLDBENT - "®eÅé %3 ¦s¦b©ó¦øªA¾¹ %1 ªº¤À³Î°Ï %2¡A¦ý¬O¨S¦³¹ïÀ³ªº VLDB ¶µ¥Ø¡C" - IDS_ALERT_DESCFULL_NO_SVRENT_SET - "®eÅé %3 ¨ã¦³ VLDB ¶µ¥Ø¡A¦ý¬O¸Ó®eÅé¨Ã¥¼¦b¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W§ä¨ì¡C" - IDS_ALERT_DESCFULL_STOPPED - "¦øªA¾¹ %1 ¤Wªº %2 ªA°È©ó %3 °±¤î¡A¦Ó¥X¤f½X¬° %5¡C" - IDS_ALERT_DESCFULL_NO_SVRENT_AGG - "VLDB »P¦øªA¾¹ %1 ¤§¤À³Î°Ï %2 ªº®eÅé¬ÛÃö¡A¦ý¬O«o¤£¨ì¦¹¤À³Î°Ï¡C" - IDS_ALERT_DESCFULL_BADCREDS - "¥Ñ©ó±z¨S¦³¦¹ Cell ºÞ²z­ûªº AFS °O¸¹¡A¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¥i¯à¥¿¦b°»´ú¦øªA¾¹ %1 ¤W©Ò¨S¦³ªº¿ù»~¡C" - IDS_ALERT_DESCFULL_AGG_ALLOC - "¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤W¥[Á`ªº®eÅé°tÃBÁ`­p¬O %4¡A¶W¹L¤À³Î°Ïªº®e¶q %3¡C" - IDS_ALERT_DESCFULL_STATE_NO_VNODE - "¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº %3 ®eÅé¨Ã¨S¦³»P¤§³sµ²ªº Vnode¡C¡]®eÅ骬ºA¬° 0x%4¡C¡^" - IDS_ALERT_DESCFULL_STATE_NO_SERVICE - "¦øªA¾¹ %1 ¤W¨Ã¨S¦³ÀÉ®×¶×¥X¾¹ªA°È¦b°õ¦æ¡A¦]¦¹¤À³Î°Ï %2 ¤Wªº %3 ®eÅéµLªk¨Ï¥Î¡C¡]®eÅ骬ºA¬° 0x%4¡C¡^" - IDS_ALERT_DESCFULL_STATE_OFFLINE - "¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº %3 ®eÅ鬰Â÷½uª¬ºA¡A¦]¦ÓµLªk¨Ï¥Î¡C¡]®eÅ骬ºA¬° 0x%4¡C¡^" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_TIMEOUT "«ö¤@¤U¡u­«¸Õ¡v«ö¶s¡A¸ÕµÛ»P¦¹¦øªA¾¹¨ú±o³sµ²¡C" - IDS_ALERT_FIX_AGG_FULL "«ö¤@¤U¡uĵ§i¡v«ö¶s¡AÅܧ󦹤À³Î°Ï¥Î¶qªºÄµ§iÁ{¬É­È¡C" - IDS_ALERT_FIX_SET_FULL "«ö¤@¤U¡uĵ§i¡v«ö¶s¡AÅܧ󦹮eÅé¥Î¶qªºÄµ§iÁ{¬É­È¡C" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_FIX_NO_VLDBENT - "VLDB ¥i¯à¤w¹L´Á¡FªG¯u¦p¦¹¡A½Ð¨Ï¥Î¡u¦P¨B VLDB¡v«ü¥O¨Ó¥[¥H§ó·s¡C" - IDS_ALERT_FIX_NO_SVRENT_SET "½ÐÀˬd¦øªA¾¹»P¤À³Î°Ï¬O§_¥¿±`¹B§@¡C" - IDS_ALERT_FIX_STOPPED "«ö¤@¤U¡uÀ˵ø¤é»x¡v«ö¶s¡AÀ˵ø¦¹ªA°È¤§ªA°È¤é»x¡C" - IDS_ALERT_FIX_NO_SVRENT_AGG - "½ÐÀˬd¦øªA¾¹¡A¬Ý¬Ý¤À³Î°Ï¬O§_¤w¶×¥X¥B¥¿±`¹B§@¡C" - IDS_ALERT_FIX_BADCREDS "½ÐÀˬd¡uŲ§O¡v«ö¶s¥H¨ú±o·sªº AFS °O¸¹¡C" - IDS_ALERT_FIX_AGG_ALLOC "½Ð´î¤Ö¦¹¤À³Î°Ïªº®eÅé°tÃB¡A©Î¬O±N¤@©Î¦h­Ó®eÅé²¾°Ê¨ì¨ä¥L¤À³Î°Ï¡C" - IDS_ALERT_FIX_STATE_NO_VNODE " " - IDS_ALERT_FIX_STATE_NO_SERVICE " " - IDS_ALERT_FIX_STATE_OFFLINE " " -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ALERT_BUTTON_TRYAGAIN "­«·s¹Á¸Õ(&A)" - IDS_ALERT_BUTTON_WARNINGS "ĵ§i(&W)..." - IDS_ALERT_BUTTON_VIEWLOG "À˵ø¤é»x(&V)" - IDS_ALERT_BUTTON_SHOWME "Åã¥Ü(&S)" - IDS_ALERT_BUTTON_GETCREDS "Ų§O(&A)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_CELLSERVERS_NOCELL - "¥¼«ü©w Cell¡C¦p­n¨Ï¥Î¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¡A±z¥²¶·«ü©w±z­n³B²zªº AFS Cell¡C½Ð¦b¤W¤èªº""Cell"" ¥\¯àªí¶µ¥Ø¤¤¿ï¨ú""¶}±Ò...""¥\¯àªí¶µ¥Ø¡A¥H¿ï¾Ü Cell¡C" - IDS_ERROR_REFRESH_CELLSERVERS - "µLªk¨ú±o %1 Cell ªº¦øªA¾¹²M³æ¡C\n\n¿ù»~¡G %2" - IDS_ERROR_CANT_OPEN_CELL - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk©M %1 Cell ¤¤¥ô¦ó¦øªA¾¹¨ú±oÁpô¡C \n\n½Ð­«·sÀˬd±z©ÒÁä¤Jªº Cell ¦WºÙ¬O§_¥¿½T¡C" - IDS_ERROR_REFRESH_AGGREGATES - "µLªk¨ú±o¦øªA¾¹ %1 ªº¤À³Î°Ï²M³æ¡C\n\n¿ù»~¡G %2" - IDS_ERROR_REFRESH_SERVER_STATUS "µLªk¨ú±o¦øªA¾¹ %1 ¥Ø«eªºª¬ºA¡C" - IDS_ERROR_CHANGE_SERVER_STATUS - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅÜ§ó¦øªA¾¹ %1 ªº¤º®e¡C" - IDS_ERROR_REFRESH_AGGREGATE_STATUS - "µLªk¨ú±o¦øªA¾¹ %1 ¤À³Î°Ï %2 ¥Ø«eªºª¬ºA¡C" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_REFRESH_FILESET_STATUS - "µLªk¨ú±o®eÅé %3¡]¦øªA¾¹ %1¡A¤À³Î°Ï %2¡^¥Ø«eªºª¬ºA¡C" - IDS_ERROR_REFRESH_SERVICE_STATUS - "µLªk¨M©w¦øªA¾¹ %1 ¤WªA°È %2 ¥Ø«eªºª¬ºA¡C" - IDS_ERROR_MOVE_FILESET "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N %3 ®eÅé±q¦øªA¾¹ %1 ¤Wªº¤À³Î°Ï %2¡A²¾°Ê¦Ü¦øªA¾¹ %4 ¤Wªº¤À³Î°Ï %5¡C" - IDS_ERROR_VIEW_LOGFILE "µLªk±q¦øªA¾¹ %1 ¤WŪ¨ú %2 ÀɮסC\n\n½ÐÀˬd±z©Ò¿é¤JªºÀɮצWºÙ¬O§_¥¿½T¡A¦P®É±z¾Ö¦³À˵ø¸ÓÀɮתº³\\\¥iÅv¡C" - IDS_ERROR_NOT_REPLICATED "µLªk¨M©w®eÅé %1 ªº½Æ»sª¬ºA¡C" - IDS_ERROR_CANT_CREATE_FILESET - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %3 ªº¤À³Î°Ï %2 «Ø¥ß®eÅé %3¡C" - IDS_ERROR_CANT_DELETE_FILESET - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk§R°£®eÅé %3¡]¦øªA¾¹ %1 ¤§¤À³Î°Ï %2¡^¡C" - IDS_ERROR_CANT_CREATE_VLDB_ENTRY - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W¡A¬°®eÅé %3 «Ø¥ß VLDB ¶µ¥Ø¡C" - IDS_ERROR_CANT_SET_FILESET_QUOTA - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W¡AÅܧó®eÅé %3 ªº°tÃB¡C" - IDS_ERROR_CANT_CREATE_SERVER - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b Cell %1 ¤W«Ø¥ß©Ò­n¨Dªº¦øªA¾¹¶µ¥Ø¡C" - IDS_ERROR_CANT_PING_SERVER - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk§PÂ_¦øªA¾¹ %1 ªº IP ¦ì§}¡C" - IDS_ERROR_CANT_DELETE_SERVER "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk§R°£¦øªA¾¹ %1¡C" - IDS_ERROR_CANT_DELETE_SERVER_FILESETS - "¦øªA¾¹ %1 ¤´¬O¤@©Î¼Æ­Ó®eÅ骺¥D¹q¸£¡A¦]¦¹µLªk§R°£¡C¦øªA¾¹¦pªGÁÙ¦³®eÅé¡A´NµLªk§R°£¡C" - IDS_ERROR_CHANGE_AGGREGATE_STATUS - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅܧó¤À³Î°Ï %2 ¦b¦øªA¾¹ %1 ¤Wªº¤º®e¡C" - IDS_ERROR_CHANGE_SERVICE_STATUS - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅܧóªA°È %2 ¦b¦øªA¾¹ %1 ¤Wªº¤º®e¡C" - IDS_ERROR_CANT_START_SERVICE - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W±Ò°ÊªA°È %2¡C" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_STOP_SERVICE - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W°±¤îªA°È %2¡C" - IDS_ERROR_CANT_RESTART_SERVICE - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W°±¤î¨Ã­«·s±Ò°ÊªA°È %2¡C" - IDS_ERROR_CHANGE_REPLICA_STATUS - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅܧó®eÅé %3 ¦b¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº½Æ»s¤º®e¡C" - IDS_ERROR_CANT_SYNCVLDB "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk§ó·s VLDB¡C" - IDS_ERROR_CANT_CREATE_REPLICA - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W¡A¬°®eÅé %3 «Ø¥ß½Æ¥»¡C" - IDS_ERROR_CANT_INSTALL_FILE - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W¦w¸Ë %2 ÀɮסC" - IDS_ERROR_CANT_UNINSTALL_FILE - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W¸Ñ°£¦w¸Ë %2 ÀɮסC" - IDS_ERROR_CANT_PRUNE_FILES - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±q¦øªA¾¹ %1 ¤W²¾°£©Ò­n¨DªºÀɮסC" - IDS_ERROR_CANT_RENAME_FILESET - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N®eÅé %1 ­«·s©R¦W¬°""%2""¡C" - IDS_ERROR_CANT_CREATE_SERVICE - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W«Ø¥ßªA°È %2¡C" - IDS_ERROR_CANT_DELETE_SERVICE - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W§R°£ªA°È %2¡C" - IDS_ERROR_CANT_RELEASE_FILESET - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÄÀ©ñ½Æ»sªº®eÅé %3¡C" - IDS_ERROR_CANT_UPDATE_FILESET - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %2 ªº¤À³Î°Ï %1 ¤W§ó·s®eÅ齯¥» %3¡C" - IDS_ERROR_CANT_UPDATE_ALL - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk§ó·s®eÅé %3 ªº¥ô¦ó½Æ¥»¡C" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_LOAD_ADMLIST - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkŪ¨ú¦øªA¾¹ %1 ªººÞ²z­û²M³æ¡C" - IDS_ERROR_CANT_LOAD_KEYLIST - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkŪ¨ú¦øªA¾¹ %1 ªº¦øªA¾¹ª÷Æ_²M³æ¡C" - IDS_ERROR_CANT_CREATE_KEY - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¬°¦øªA¾¹ %1 «Ø¥ß·sªº¦øªA¾¹ª÷Æ_¡C" - IDS_ERROR_CANT_SAVE_ADMLIST - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅÜ§ó¦øªA¾¹ %1 ªººÞ²z­û²M³æ¡C" - IDS_ERROR_CANT_CLONE "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W¡A¬°®eÅé %3 «Ø¥ß³Æ¥÷ª©¥»¡C" - IDS_ERROR_CANT_CLONESYS "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk«Ø¥ß©Ò­n¨Dªº³Æ¥÷®eÅé¡C" - IDS_ERROR_CANT_DUMP_FILESET - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N®eÅé %3 ªº¤º®e¡]¦øªA¾¹ %1¡A¤À³Î°Ï %2¡^¡A¶É¥X¦Ü %4 ÀɮסC" - IDS_ERROR_CANT_RESTORE_FILESET - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N %4 ÀÉ®×´_­ì¨ì®eÅé %3¡]¦øªA¾¹ %1¡A¤À³Î°Ï %2¡^¡C" - IDS_ERROR_CANT_SET_RESTART_TIMES - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅÜ§ó¦øªA¾¹ %1 ¤WªºªA°È­«·s±Ò°Ê®É¶¡¡C" - IDS_ERROR_CANT_DELETE_REPLICATED_FILESET - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N®eÅé %3 ±q¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W§R°£¡C\n\nVolume %3 ¥²¶·¦b¨ä½Æ¥»³£§R°£¤F¤§«á¡A¤~¯à³Q§R°£¡C" - IDS_CMDLINE_TITLE "¿ù»~ - AFS ¦øªA¾¹ºÞ²zµ{¦¡" - IDS_CMDLINE_SYNTAX "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C" - IDS_CMDLINE_UNRECOGNIZED - "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n ""%1""°Ñ¼Æ¬OµLªkªº¿ëÃѪº¡C" - IDS_CMDLINE_DUPLICATE "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n ""%1""°Ñ¼Æªº«ü©w¦¸¼Æ¶W¹L¤@¦¸¡C" - IDS_CMDLINE_UNEXPECTVALUE - "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n ""%1"" °Ñ¼Æ¤£±o³Q½á¤©¤@­Ó­È¡C" - IDS_CMDLINE_MISSINGVAL "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n ""%1"" °Ñ¼Æ¤§«á¥²¶·¬O¤@­Ó­È¡C" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CMDLINE_SUBSETNOTCELL - "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n ""/SUBSET""°Ñ¼Æ¥²¶·¦b ""/CELL"" °Ñ¼Æ¦P®É³Q«ü©wªº±¡ªp¤U¤~¯à¥[¥H«ü©w¡C" - IDS_CMDLINE_INVALIDSUBSET - "±z©Ò«ü©wªº¦øªA¾¹¤l¶°¡A""%2""¡A©|¥¼¦b %1 Cell ¤¤¥[¥H©w¸q¡C" - IDS_CMDLINE_SERVERNOTCELL - "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n ""/SERVER""°Ñ¼Æ¥²¶·¦b ""/CELL"" °Ñ¼Æ¦P®É³Q«ü©wªº±¡ªp¤U¤~¯à¥[¥H«ü©w¡C" - IDS_CMDLINE_RESET_TITLE "AFS ¦øªA¾¹ºÞ²zµ{¦¡" - IDS_CMDLINE_RESET_DESC "¡uAFS ¦øªA¾¹ºÞ²zµ{¡v¤w²M°£«ü©wªº³]©w¡C" - IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE - "¥Ñ©ó¤À³Î°Ï¤£¬O¤£¦s¦b¡A´N¬O©|¥¼¶×¤J¡A©Ò¥H¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N VLDB »P¦øªA¾¹ %1 ¤§¤À³Î°Ï %2 ¦P¨B¤Æ¡C\n\n¦p­n±N¦¹¤@¤À³Î°Ï±q¦øªA¾¹ %1 ²¾°£¡A±z¥²¶·§R°£»P¸Ó¤À³Î°Ï¬ÛÃöªº®eÅé VLDB ¶µ¥Ø¡C" - IDS_CMDLINE_USERPASSWORD - "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n¦p­n¨ú±o·sªº AFS °O¸¹¡A""/USER"" »P ""/PASSWORD"" °Ñ¼Æ¥²¶·¦P®É«ü©w¡C" - IDS_ERROR_CANT_DELETE_KEY - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N¦øªA¾¹ª÷Æ_ %2 ±q¦øªA¾¹ %1 ¤W²¾°£¡C" - IDS_ERROR_CANT_GETRANDOMKEY - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¬°¦øªA¾¹ %1 «Ø¥ßÀH¾÷«öÁä¡C" - IDS_ERROR_CANT_EXECUTE_COMMAND - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W°õ¦æ¥H¤Uªº«ü¥O¡G\n\n ""%2""" - IDS_ERROR_CANT_READ_SALVAGE_LOG - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¶¶§Q§¹¦¨´©±Ï§@·~¡A¦ý¬OµLªk¨ú±o´y±Ô´©±Ï§@·~¤§¯S©wµ²ªGªº¤é»xÀÉ¡C" - IDS_ERROR_CANT_SALVAGE "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk°õ¦æ©Ò­n¨Dªº´©±Ï§@·~¡C" - IDS_ERROR_CANT_AUTH_ON "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¬°¦øªA¾¹ %1 ±Ò¥ÎŲ§OÀˬd¡C" - IDS_ERROR_CANT_AUTH_OFF "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¬°¦øªA¾¹ %1 °±¥ÎŲ§OÀˬd¡C" - IDS_ERROR_CANT_LOAD_HOSTLIST - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±q¦øªA¾¹ %1 Ū¨ú¸ê®Æ®w¥D¹q¸£¦øªA¾¹ªº²M³æ¡C" - IDS_ERROR_CANT_SAVE_HOSTLIST - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅÜ§ó¦øªA¾¹ %1 ¤Wªº¸ê®Æ®w¥D¹q¸£¦øªA¾¹²M³æ¡C" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL - "¥Ñ©ó¦¹¹q¸£¨S¦³¥¿½T¦w¸Ë¡uAFS ±±¨î¤¤¤ß¡v¡A¦]¦¹µLªk±Ò°Ê¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¡C\n\n±z¥²¶·­«·s¦w¸Ë¡uAFS ±±¨î¤¤¤ß¡v¡C" - IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN - "¥Ñ©ó²£¥Í¤£©ú­ì¦]ªº°ÝÃD¡A¦]¦¹µLªk±Ò°Ê¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¡C\n\n±z¥²¶·­«·s¦w¸Ë¡uAFS ±±¨î¤¤¤ß¡v¡C" - IDS_ERROR_CANT_CHANGEADDR - "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¬°¦øªA¾¹ %1 Åܧó VLDB ªº IP ¦ì§}¡C" -END - -#endif // Chinese (Taiwan) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Chinese (Taiwan) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHT) +#ifdef _WIN32 +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_SERVICES, DIALOG + BEGIN + LEFTMARGIN, 3 + RIGHTMARGIN, 162 + END + + IDD_AGGREGATES, DIALOG + BEGIN + RIGHTMARGIN, 121 + END + + IDD_FILESETS, DIALOG + BEGIN + RIGHTMARGIN, 163 + VERTGUIDE, 188 + VERTGUIDE, 189 + END + + IDD_SVR_LISTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_AGG_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 262 + TOPMARGIN, 5 + BOTTOMMARGIN, 155 + END + + IDD_SVR_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 183 + END + + IDD_SVR_SCOUT, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 216 + TOPMARGIN, 5 + BOTTOMMARGIN, 153 + END + + IDD_SVC_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 268 + TOPMARGIN, 5 + BOTTOMMARGIN, 209 + END + + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 315 + TOPMARGIN, 2 + BOTTOMMARGIN, 224 + END + + IDD_SERVER, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 207 + TOPMARGIN, 2 + BOTTOMMARGIN, 135 + END + + IDD_SVC_CREATE, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 228 + END + + IDD_SET_REPSITES, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 216 + TOPMARGIN, 5 + BOTTOMMARGIN, 163 + END + + IDD_OPENCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 7 + BOTTOMMARGIN, 253 + HORZGUIDE, 160 + END + + IDD_TIMEOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 232 + TOPMARGIN, 7 + BOTTOMMARGIN, 153 + END + + IDD_COLUMNS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 281 + TOPMARGIN, 5 + BOTTOMMARGIN, 143 + END + + IDD_REFRESHALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 260 + TOPMARGIN, 7 + BOTTOMMARGIN, 68 + END + + IDD_SET_CREATE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 317 + TOPMARGIN, 4 + BOTTOMMARGIN, 205 + END + + IDD_SET_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 98 + END + + IDD_SET_CLONE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 341 + TOPMARGIN, 7 + BOTTOMMARGIN, 81 + END + + IDD_SVC_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 189 + END + + IDD_SVR_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 152 + END + + IDD_AGG_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 252 + TOPMARGIN, 5 + BOTTOMMARGIN, 146 + END + + IDD_SET_PROBLEMS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 268 + TOPMARGIN, 5 + BOTTOMMARGIN, 177 + END + + IDD_SET_MOVETO, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 170 + END + + IDD_SET_MOVING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SVC_LOGNAME, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 102 + END + + IDD_SVC_VIEWLOG, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 181 + END + + IDD_SET_SETQUOTA, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 267 + TOPMARGIN, 4 + BOTTOMMARGIN, 126 + END + + IDD_ACTIONS, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 234 + TOPMARGIN, 2 + BOTTOMMARGIN, 56 + END + + IDD_SVR_SYNCVLDB, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 265 + TOPMARGIN, 4 + BOTTOMMARGIN, 95 + END + + IDD_SET_CREATEREP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 4 + BOTTOMMARGIN, 167 + END + + IDD_SVR_INSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 152 + END + + IDD_SVR_UNINSTALL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 135 + END + + IDD_SVR_PRUNE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 220 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_SET_RENAME, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 129 + END + + IDD_SVC_DELETE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 64 + END + + IDD_SVR_GETDATES, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_GETDATES_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 128 + END + + IDD_SET_DUMP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 291 + TOPMARGIN, 7 + BOTTOMMARGIN, 140 + END + + IDD_SET_RESTORE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 288 + TOPMARGIN, 4 + BOTTOMMARGIN, 244 + END + + IDD_SVC_BOS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 220 + TOPMARGIN, 5 + BOTTOMMARGIN, 202 + END + + IDD_SET_DUMPING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SET_RESTORING, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 233 + TOPMARGIN, 2 + BOTTOMMARGIN, 60 + END + + IDD_SET_CLONESYS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 159 + END + + IDD_SUBSETS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 276 + TOPMARGIN, 5 + BOTTOMMARGIN, 177 + END + + IDD_SUBSET_LOADSAVE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 276 + TOPMARGIN, 4 + BOTTOMMARGIN, 141 + END + + IDD_HELP_FIND, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 214 + TOPMARGIN, 4 + BOTTOMMARGIN, 69 + END + + IDD_HELP_ERROR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 4 + BOTTOMMARGIN, 131 + END + + IDD_HELP_ABOUT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 226 + TOPMARGIN, 4 + BOTTOMMARGIN, 137 + END + + IDD_OPENINGCELL, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 236 + TOPMARGIN, 2 + BOTTOMMARGIN, 41 + END + + IDD_OPTIONS_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 274 + TOPMARGIN, 5 + BOTTOMMARGIN, 134 + END + + IDD_SVR_KEYS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_CREATEKEY, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 274 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + END + + IDD_SVC_STARTSTOP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END + + IDD_SVR_EXECUTE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 244 + TOPMARGIN, 4 + BOTTOMMARGIN, 121 + END + + IDD_SVR_SALVAGE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 258 + TOPMARGIN, 7 + BOTTOMMARGIN, 251 + END + + IDD_SVR_SALVAGE_RESULTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 174 + END + + IDD_SET_RELEASE, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 273 + TOPMARGIN, 7 + BOTTOMMARGIN, 98 + END + + IDD_SVR_HOSTS, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 221 + TOPMARGIN, 5 + BOTTOMMARGIN, 174 + END + + IDD_SVR_ADDHOST, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 221 + TOPMARGIN, 4 + BOTTOMMARGIN, 102 + END + + IDD_SVR_ADDRESS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 204 + TOPMARGIN, 4 + BOTTOMMARGIN, 111 + END + + IDD_SVR_NEWADDR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 219 + TOPMARGIN, 4 + BOTTOMMARGIN, 65 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#include \r\n" + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS Server Manager""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_MAIN MENU DISCARDABLE +BEGIN + POPUP "Cell (&C)" + BEGIN + MENUITEM "¿ï¨ú(&S)...", M_CELL_OPEN + MENUITEM "Ų§O(&A)...", M_CREDENTIALS + MENUITEM SEPARATOR + MENUITEM "µ²§ô(&X)", M_EXIT + END + POPUP "À˵ø(&V)" + BEGIN + POPUP "¦øªA¾¹(&S)" + BEGIN + MENUITEM "¤j¹Ï¥Ü(&G)", M_SVR_VIEW_LARGE + , CHECKED + MENUITEM "¤p¹Ï¥Ü(&M)", M_SVR_VIEW_SMALL + , CHECKED + MENUITEM "©ú²Ó(&D)", M_SVR_VIEW_REPORT + , CHECKED + MENUITEM SEPARATOR + MENUITEM "¤@¯ë(&N)", M_SVR_VIEW_ONEICON + , CHECKED + MENUITEM "©Ò¦³¹Ï¥Ü(&A)", M_SVR_VIEW_TWOICONS + , CHECKED + MENUITEM "¥u¦³ª¬ºA(&S)", M_SVR_VIEW_STATUS + , CHECKED + END + POPUP "§Ö³tÀ˵øµ¡®æ(&Q)" + BEGIN + MENUITEM "¤£Åã¥Ü(&N)", M_DIVIDE_NONE, CHECKED + MENUITEM "««ª½¤À³Î(&V)", M_DIVIDE_H, CHECKED + MENUITEM "¤ô¥­¤À³Î(&H)", M_DIVIDE_V, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "§@·~¶i¦æ¤¤(&P)", M_ACTIONS, CHECKED + MENUITEM SEPARATOR + MENUITEM "ºÊµø¤Uªº¦øªA¾¹(&M)...", M_SUBSET + MENUITEM "ª½Äæ(&C)...", M_COLUMNS + MENUITEM "¿ï¶µ(&O)...", M_OPTIONS + MENUITEM SEPARATOR + MENUITEM "¥þ³¡­«·s¾ã²z(&F)", M_REFRESHALL + END + POPUP "»¡©ú(&H)" + BEGIN + MENUITEM "¤º®e(&C)", M_HELP + MENUITEM "·j´M«ü¥O(&F)...", M_HELP_FIND + MENUITEM "¬d¾\¿ù»~½X(&L)...", M_HELP_XLATE + MENUITEM SEPARATOR + MENUITEM "Ãö©ó AFS ¦øªA¾¹ºÞ²zµ{¦¡(&A)...", M_ABOUT + END +END + +MENU_AGG MENU DISCARDABLE +BEGIN + MENUITEM "«Ø¥ß®eÅé(&C)...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "³Æ¥÷®eÅé(&B)...", M_SET_CLONE + MENUITEM "¸Ñ°£©Ò¦³®eÅ骺Âê©w(&U)", M_SET_UNLOCK + MENUITEM "¦P¨B¤Æ VLDB(&Y)...", M_SYNCVLDB + MENUITEM "´©±Ï®eÅé(&G)...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "­«·s¾ã²z(&F)", M_REFRESH + MENUITEM "¤º®e(&R)", M_PROPERTIES +END + +MENU_SVC MENU DISCARDABLE +BEGIN + MENUITEM "±Ò°Ê(&S)", M_SVC_START + MENUITEM "°±¤î(&S)", M_SVC_STOP + MENUITEM "­«·s±Ò°Ê(&R)", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "À˵ø¤é»xÀÉ(&V)", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "§R°£(&L)", M_SVC_DELETE + MENUITEM SEPARATOR + MENUITEM "­«·s¾ã²z(&F)", M_REFRESH + MENUITEM "¤º®e(&R)", M_PROPERTIES +END + +MENU_AGG_NONE MENU DISCARDABLE +BEGIN + POPUP "À˵ø(&V)" + BEGIN + MENUITEM "¤@¯ë(&N)", M_VIEW_ONEICON, CHECKED + MENUITEM "©Ò¦³¹Ï¥Ü(&A)", M_VIEW_TWOICONS, CHECKED + MENUITEM "¥u¦³ª¬ºA(&S)", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "«Ø¥ß®eÅé(&C)...", M_SET_CREATE + MENUITEM SEPARATOR + MENUITEM "¥þ³¡­«·s¾ã²z(&F)", M_REFRESHALL +END + +MENU_SVC_NONE MENU DISCARDABLE +BEGIN + POPUP "À˵ø(&V)" + BEGIN + MENUITEM "¤@¯ë(&N)", M_VIEW_ONEICON, CHECKED + MENUITEM "©Ò¦³¹Ï¥Ü(&A)", M_VIEW_TWOICONS, CHECKED + MENUITEM "¥u¦³ª¬ºA(&S)", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "«Ø¥ßªA°È(&C)...", M_SVC_CREATE + MENUITEM SEPARATOR + MENUITEM "¥þ³¡­«·s¾ã²z(&F)", M_REFRESHALL +END + +MENU_SET MENU DISCARDABLE +BEGIN + MENUITEM "½Æ»s(&P)...", M_SET_REPLICATION + MENUITEM "¥ß§YÄÀ©ñ(&S)", M_SET_RELEASE + MENUITEM SEPARATOR + MENUITEM "³Æ¥÷(&B)...", M_SET_CLONE + MENUITEM "¶É¥X¦ÜÀÉ®×(&D)...", M_SET_DUMP + MENUITEM "¦ÛÀÉ®×´_­ì(&R)...", M_SET_RESTORE + MENUITEM "³]©w°tÃB(&Q)...", M_SET_SETQUOTA + MENUITEM "´©±Ï(&G)...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "²¾°Ê¦Ü(&M)...", M_SET_MOVETO + MENUITEM "­«·s©R¦W(&N)...", M_SET_RENAME + MENUITEM "§R°£(&L)", M_SET_DELETE + MENUITEM SEPARATOR + MENUITEM "Âê©w(&K)", M_SET_LOCK + MENUITEM "¸Ñ°£Âê©w(&U)", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "­«·s¾ã²z(&F)", M_REFRESH + MENUITEM "¤º®e(&R)", M_PROPERTIES +END + +MENU_SVR MENU DISCARDABLE +BEGIN + MENUITEM "¶}±Ò¦øªA¾¹µøµ¡(&O)", M_SVR_OPEN + MENUITEM "Ãö³¬¦øªA¾¹µøµ¡(&C)", M_SVR_CLOSE + MENUITEM "ºÊµø³o­Ó¦øªA¾¹(&M)", M_SVR_MONITOR, CHECKED + MENUITEM SEPARATOR + MENUITEM "½s¿è¦øªA¾¹¦w¥þ(&S)...", M_SVR_SECURITY + MENUITEM "ºÞ²z¸ê®Æ®w¥D¹q¸£(&H)...", M_SVR_HOSTS + MENUITEM "³Æ¥÷®eÅé(&B)...", M_SET_CLONE + MENUITEM "¸Ñ°£©Ò¦³®eÅ骺Âê©w(&U)", M_SET_UNLOCK + MENUITEM "¦P¨B¤Æ VLDB (&Y)...", M_SYNCVLDB + MENUITEM "´©±Ï®eÅé(&G)...", M_SALVAGE + MENUITEM SEPARATOR + MENUITEM "¦w¸ËÀÉ®×(&I)...", M_SVR_INSTALL + MENUITEM "¸Ñ°£¦w¸ËÀÉ®×(&U)...", M_SVR_UNINSTALL + MENUITEM "§R°£ÂÂÀÉ®×(&P)...", M_SVR_PRUNE + MENUITEM SEPARATOR + MENUITEM "¨ú±oÀɮפé´Á(&T)...", M_SVR_GETDATES + MENUITEM "À˵ø¤é»xÀÉ(&V)...", M_VIEWLOG + MENUITEM "°õ¦æ«ü¥O(&X)...", M_EXECUTE + MENUITEM SEPARATOR + MENUITEM "­«·s¾ã²z(&F)", M_REFRESH + MENUITEM "¤º®e(&R)", M_PROPERTIES +END + +MENU_SVR_NONE MENU DISCARDABLE +BEGIN + POPUP "À˵ø(&V)" + BEGIN + MENUITEM "¤j¹Ï¥Ü(&G)", M_SVR_VIEW_LARGE, CHECKED + MENUITEM "¤p¹Ï¥Ü(&M)", M_SVR_VIEW_SMALL, CHECKED + MENUITEM "©ú²Ó(&D)", M_SVR_VIEW_REPORT, CHECKED + MENUITEM SEPARATOR + MENUITEM "¤@¯ë(&N)", M_SVR_VIEW_ONEICON, CHECKED + MENUITEM "©Ò¦³¹Ï¥Ü(&A)", M_SVR_VIEW_TWOICONS, CHECKED + MENUITEM "¥u¦³ª¬ºA(&S)", M_SVR_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "ºÊµø¤Uªº¦øªA¾¹(&M)...", M_SUBSET + MENUITEM SEPARATOR + MENUITEM "¸Ñ°£©Ò¦³®eÅ骺Âê©w(&U)", M_SET_UNLOCK + MENUITEM SEPARATOR + MENUITEM "¥þ³¡Ãö³¬(&C)", M_SVR_CLOSEALL + MENUITEM "¥þ³¡­«·s¾ã²z(&F)", M_REFRESHALL +END + +MENU_SET_NONE MENU DISCARDABLE +BEGIN + POPUP "À˵ø(&V)" + BEGIN + MENUITEM "¨Ì®eÅé(&V)", M_SET_VIEW_REPORT, CHECKED + MENUITEM "¨Ì¤À³Î°Ï(&P)", M_SET_VIEW_TREELIST, CHECKED + MENUITEM "¨S¦³©ú²Ó(&D)", M_SET_VIEW_TREE, CHECKED + MENUITEM SEPARATOR + MENUITEM "¤@¯ë(&N)", M_VIEW_ONEICON, CHECKED + MENUITEM "©Ò¦³¹Ï¥Ü(&A)", M_VIEW_TWOICONS, CHECKED + MENUITEM "¥u¦³ª¬ºA(&S)", M_VIEW_STATUS, CHECKED + END + MENUITEM SEPARATOR + MENUITEM "«Ø¥ß®eÅé(&C)...", M_SET_CREATE + MENUITEM "¦ÛÀÉ®×´_­ì(&R)...", M_SET_RESTORE + MENUITEM SEPARATOR + MENUITEM "³Æ¥÷®eÅé(&B)...", M_SET_CLONE + MENUITEM SEPARATOR + MENUITEM "¥þ³¡¸Ñ°£Âê©w(&U)", M_SET_UNLOCK + MENUITEM "¥þ³¡­«·s¾ã²z(&F)", M_REFRESHALL +END + +MENU_COLUMNS MENU DISCARDABLE +BEGIN + MENUITEM "ª½Äæ(&C)...", M_COLUMNS +END + +MENU_SVC_BOS MENU DISCARDABLE +BEGIN + MENUITEM "­«·s±Ò°Ê(&R)", M_SVC_RESTART + MENUITEM SEPARATOR + MENUITEM "À˵ø¤é»xÀÉ(&V)", M_VIEWLOG + MENUITEM SEPARATOR + MENUITEM "­«·s¾ã²z(&F)", M_REFRESH + MENUITEM "¤º®e(&R)", M_PROPERTIES +END + +MENU_SET_DRAGDROP MENU DISCARDABLE +BEGIN + MENUITEM "²¾¨ì¦¹³B(&M)...", M_SET_MOVEHERE + MENUITEM "½Æ»s¦¹³B(&R)...", M_SET_REPHERE + MENUITEM SEPARATOR + MENUITEM "¨ú®ø(&C)", IDC_STATIC +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SERVICES DIALOGEX 0, 0, 176, 98 +STYLE DS_CENTER | WS_CHILD +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "ªA°È¡G",IDC_SVC_DESC,6,5,150,8 + CONTROL "",IDC_SVC_LIST,"FastList",WS_TABSTOP | 0x303,3,17,169, + 61,WS_EX_STATICEDGE + PUSHBUTTON "«Ø¥ß(&C)...",IDC_SVC_CREATE,20,83,47,12 + PUSHBUTTON "§R°£(&L)",IDC_SVC_DELETE,72,83,47,12 + PUSHBUTTON "­«·s±Ò°Ê(&R)",IDC_SVC_RESTART,125,83,47,12 +END + +IDD_AGGREGATES DIALOGEX 0, 0, 168, 87 +STYLE DS_CENTER | WS_CHILD +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "¤À³Î°Ï¡G",IDC_AGG_DESC,2,5,154,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,1,17,164, + 53,WS_EX_STATICEDGE + PUSHBUTTON "«Ø¥ß®eÅé(&C)...",IDC_AGG_CREATESET,102,75,63,12 +END + +IDD_FILESETS DIALOGEX 0, 0, 195, 96 +STYLE DS_CENTER | WS_CHILD +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "®eÅé¡G",IDC_SET_DESC,6,5,166,8 + CONTROL "",IDC_SET_LIST,"FastList",WS_TABSTOP | 0x303,5,17,184, + 61,WS_EX_STATICEDGE + PUSHBUTTON "«Ø¥ß(&C)...",IDC_SET_CREATE,4,82,39,12 + PUSHBUTTON "§R°£(&L)",IDC_SET_DELETE,47,82,39,12 + PUSHBUTTON "½Æ»s(&R)...",IDC_SET_REP,90,82,39,12 + PUSHBUTTON "³]©w°tÃB(&Q)...",IDC_SET_SETQUOTA,134,82,55,12 +END + +IDD_SVR_LISTS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_LIST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, + 135,WS_EX_CLIENTEDGE + PUSHBUTTON "·s¼WºÞ²z­û(&A)",IDC_LIST_ADD,55,160,80,14 + PUSHBUTTON "²¾°£ºÞ²z­û(&R)",IDC_LIST_REMOVE,141,160,80,14 + LTEXT "¦øªA¾¹ %1 ªººÞ²z­û¡G",IDC_LIST_NAME,5,7,216,8 +END + +IDD_AGG_GENERAL DIALOGEX 0, 0, 267, 160 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "ID:",IDC_STATIC,5,30,31,8 + LTEXT "¡]¬d¸ß¡^",IDC_AGG_ID,38,30,214,8 + LTEXT "¸Ë¸m¡G",IDC_STATIC,5,46,31,8 + LTEXT "¡]¬d¸ß¡^",IDC_AGG_DEVICE,38,46,214,8 + LTEXT "®eÅé¡G",IDC_STATIC,5,62,31,8 + LTEXT "¡]¬d¸ß¡^",IDC_AGG_FILESETS,38,62,214,8 + CONTROL "­Y¥[Á`ªº®eÅé°tÃB¶W¹L®e¶q¡A«hÅã¥Üĵ§i(&V)", + IDC_AGG_WARNALLOC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 38,76,224,10 + LTEXT "¥Î¶q¡G",IDC_STATIC,5,90,31,8 + LTEXT "¡]¬d¸ß¡^",IDC_AGG_USAGE,38,90,214,8 + CONTROL "",IDC_AGG_USAGEBAR,"msctls_progress32",0x0,38,103,224,8, + WS_EX_STATICEDGE + CONTROL "­Y¤À³Î°Ïªº¨Ï¥Î¹L¶q¡A«hÅã¥Üĵ§i(&W)",IDC_AGG_WARN,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,38,116,214,10 + CONTROL "¥»¦øªA¾¹ªº¹w³]Á{¬É­È",IDC_AGG_WARN_AGGFULL_DEF,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,49,131,203,9 + CONTROL "Á{¬É­È(&T)",IDC_AGG_WARN_AGGFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,49,145,62,9 + EDITTEXT IDC_AGG_WARN_AGGFULL_PERCENT,112,143,29,12, + ES_AUTOHSCROLL + LTEXT "¦û¨ä¤j¤pªº¦Ê¤À¤ñ",IDC_AGG_WARN_AGGFULL_DESC,152,145,100, + 8 + ICON IDI_AGGREGATE,IDC_STATIC,5,5,20,20 + LTEXT "¤À³Î°Ï %2¡]¦øªA¾¹ %1¡^",IDC_AGG_NAME,38,14,214,8 +END + +IDD_SVR_GENERAL DIALOG DISCARDABLE 0, 0, 226, 188 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "IP ¦ì§} ¡G",IDC_STATIC,5,29,36,8 + LISTBOX IDC_SVR_ADDRESSES,42,29,82,14,LBS_NOSEL | NOT WS_BORDER | + WS_VSCROLL + PUSHBUTTON "Åܧó¦ì§}(&A)...",IDC_SVR_CHANGEADDR,144,27,77,12 + PUSHBUTTON "»Ý­nŲ§O(&R)",IDC_SVR_AUTH_YES,41,88,84,12 + PUSHBUTTON "¤¹³\¤£°µÅ²§O(&U)",IDC_SVR_AUTH_NO,129,88,80,12 + LTEXT "¤À³Î°Ï¼Æ¥Ø¡G",IDC_STATIC,11,131,90,8 + LTEXT "¡]¬d¸ß¡^",IDC_SVR_NUMAGGREGATES,108,131,99,8 + LTEXT "Á`®e¶q¡G",IDC_STATIC,11,148,48,8 + LTEXT "¡]¬d¸ß¡^",IDC_SVR_CAPACITY,108,148,99,8 + LTEXT "¥[Á`ªº®eÅé°tÃB¡G",IDC_STATIC,11,165,79,8 + LTEXT "¡]¬d¸ß¡^",IDC_SVR_ALLOCATION,108,165,99,8 + ICON IDI_SERVER,IDC_STATIC,5,5,20,20 + LTEXT "¡]¦øªA¾¹¦WºÙ¡^",IDC_SVR_NAME,55,13,93,8 + GROUPBOX "¦w¥þ©Ê",IDC_STATIC,5,52,216,52 + GROUPBOX "Àx¦sÅé",IDC_STATIC,5,115,216,68 + LTEXT "±z¥i¥H­n¨D©Ò¦³¹ï¥»¦øªA¾¹©Ò°µªº¦s¨ú³£¥²¶·¶i¦æÅ²§O¡C", + IDC_STATIC,11,67,194,17 +END + +IDD_SVR_SCOUT DIALOG DISCARDABLE 0, 0, 221, 158 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + CONTROL "¥»¦øªA¾¹¤Wªº¥ô¦ó¤À³Î°Ï¹F¨ì",IDC_SVR_WARN_AGGFULL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,12,18,128,9 + EDITTEXT IDC_SVR_WARN_AGGFULL_PERCENT,141,16,30,12,ES_AUTOHSCROLL + LTEXT "% º¡",IDC_STATIC,190,18,21,8 + CONTROL "¥»¦øªA¾¹¤Wªº¥ô¦ó®eÅé¹F¨ì",IDC_SVR_WARN_SETFULL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,12,32,125,9 + EDITTEXT IDC_SVR_WARN_SETFULL_PERCENT,141,30,31,12,ES_AUTOHSCROLL + LTEXT "% º¡",IDC_STATIC,190,32,21,8 + CONTROL "¥ô¦ó¤À³Î°Ï¤Wªº¥[Á`°tÃB¶W¹L¨ä®e¶q",IDC_SVR_WARN_AGGALLOC, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,46,200,9 + CONTROL "°±¤î°õ¦æ¥»¦øªA¾¹¤Wªº¥ô¦óªA°È",IDC_SVR_WARN_SVCSTOP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,60,195,9 + CONTROL "¥»¦øªA¾¹ªº¥ô¦ó®eÅé³£¨S¦³ VLDB ¶µ¥Ø", + IDC_SVR_WARN_SETNOVLDB,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,74,195,9 + CONTROL "VLDB °Ñ·Ó¥»¦øªA¾¹¤Wªº¥ô¦óÂ÷½u¤À³Î°Ï", + IDC_SVR_WARN_AGGNOSERV,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,88,195,9 + CONTROL "VLDB °Ñ·Ó¥»¦øªA¾¹¤Wªº¥ô¦óÂ÷½u®eÅé", + IDC_SVR_WARN_SETNOSERV,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,12,103,195,9 + CONTROL "­«·s¾ã²z¦øªA¾¹¸ê°T¡A¨C¹j",IDC_SVR_AUTOREFRESH,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,5,142,111,9 + EDITTEXT IDC_SVR_AUTOREFRESH_MINUTES,124,140,27,13,ES_AUTOHSCROLL + LTEXT "¤ÀÄÁ",IDC_STATIC,178,142,25,8 + LTEXT "·í¦³¤U¦C±¡ªp®É¡A·|Åã¥Üĵ§i",IDC_STATIC,5,5,195,8 +END + +IDD_SVC_GENERAL DIALOG DISCARDABLE 0, 0, 225, 207 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + PUSHBUTTON "À˵øªA°È¤é»x(&V)",IDC_SVC_VIEWLOG,43,182,66,14 + PUSHBUTTON "¥ß§Y±Ò°Ê(&S)",IDC_SVC_START,113,182,49,14 + PUSHBUTTON "¥ß§Y°±¤î(&P)",IDC_SVC_STOP,166,182,49,14 + CONTROL "¥»ªA°È¦p°±¤î¤U¨Ó¡A«hÅã¥Üĵ§i(&W)",IDC_SVC_WARNSTOP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,159,200,10 + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "ªA°È %2¡]¦øªA¾¹ %1¡^",IDC_SVC_NAME,52,13,168,8 + LTEXT "Ãþ«¬¡G",IDC_STATIC,5,29,44,8 + LTEXT "¡]¬d¸ß¡^",IDC_SVC_TYPE,52,29,168,8 + LTEXT "°Ñ¼Æ¡G",IDC_STATIC,5,45,44,8 + EDITTEXT IDC_SVC_PARAMS,52,45,168,13,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_BORDER | NOT WS_TABSTOP + LTEXT "³qª¾ªÌ¡G",IDC_STATIC,5,61,44,8 + LTEXT "¡]¬d¸ß¡^",IDC_SVC_NOTIFIER,52,61,168,8 + LTEXT "¤W¦¸±Ò°Ê¡G",IDC_STATIC,5,77,44,8 + LTEXT "¡]¬d¸ß¡^",IDC_SVC_STARTDATE,52,77,168,8 + LTEXT "¤W¦¸°±¤î¡G",IDC_STATIC,5,93,44,8 + LTEXT "¡]¬d¸ß¡^",IDC_SVC_STOPDATE,52,93,168,8 + LTEXT "¤W¦¸¥¢®Ä¡G",IDC_STATIC,5,109,44,8 + EDITTEXT IDC_SVC_LASTERROR,52,109,168,13,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + GROUPBOX "ªA°Èª¬ºA",IDC_STATIC,5,127,215,75 + LTEXT "¥¿¦b§PÂ_¥»ªA°È¥Ø«eªºª¬ªp...",IDC_SVC_STATUS,11,142,200, + 8 +END + +IDD_SET_GENERAL DIALOGEX 0, 0, 273, 214 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "®eÅé ID¡G",IDC_STATIC,5,30,39,8 + LTEXT "¡]¤£©ú¡^",IDC_SET_ID,48,30,168,8 + LTEXT "«Ø¥ß¤é´Á¡G",IDC_STATIC,5,46,42,8 + LTEXT "¡]¬d¸ß¡^",IDC_SET_CREATEDATE,48,46,167,8 + LTEXT "§ó·s¤é´Á¡G",IDC_STATIC,5,62,41,8 + LTEXT "¡]¬d¸ß¡^",IDC_SET_UPDATEDATE,48,62,112,8 + LTEXT "¦s¨ú¤é´Á¡G",IDC_STATIC,5,78,41,8 + LTEXT "¡]¬d¸ß¡^",IDC_SET_ACCESSDATE,48,78,167,8 + LTEXT "³Æ¥÷¤é´Á¡G",IDC_STATIC,5,94,40,8 + LTEXT "¡]¬d¸ß¡^",IDC_SET_BACKUPDATE,48,94,181,8 + LTEXT "Àɮ׭ӼơG",IDC_STATIC,5,110,42,8 + LTEXT "¡]¬d¸ß¡^",IDC_SET_FILES,48,110,179,8 + LTEXT "ª¬ºA¡G",IDC_STATIC,5,126,32,8 + LTEXT "¡]¬d¸ß¡^",IDC_SET_STATUS,48,126,62,8 + PUSHBUTTON "Âê©w(&L)",IDC_SET_LOCK,150,124,55,12 + PUSHBUTTON "¸Ñ°£Âê©w(&U)",IDC_SET_UNLOCK,213,124,55,12 + LTEXT "¥Î¶q¡G",IDC_STATIC,5,142,31,8 + LTEXT "¡]¬d¸ß¡^",IDC_SET_USAGE,48,142,109,8 + PUSHBUTTON "³]©w°tÃB(&Q)...",IDC_SET_QUOTA,213,140,55,12 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,49,156,219,8, + WS_EX_STATICEDGE + CONTROL "¦pªG¦¹®eÅ骺¥Î¶q¶W¹L¤U¦C±¡§Î¡A«h·|Åã¥Üĵ§i(&W)", + IDC_SET_WARN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,49, + 170,219,10 + CONTROL "¥»¦øªA¾¹ªº¹w³]Á{¬É­È¡]¨ä¤j¤pªº %1%%¡^(&D)", + IDC_SET_WARN_SETFULL_DEF,"Button",BS_AUTORADIOBUTTON | + BS_MULTILINE,61,185,207,9 + CONTROL "¨ä¤j¤pªº",IDC_SET_WARN_SETFULL,"Button", + BS_AUTORADIOBUTTON | BS_MULTILINE,61,199,62,9 + EDITTEXT IDC_SET_WARN_SETFULL_PERCENT,123,197,29,12, + ES_AUTOHSCROLL + LTEXT " % Á{¬É­È(&T)",IDC_SET_WARN_SETFULL_DESC,163,199,105,8 + ICON IDI_FILESET,IDC_STATIC,5,5,20,20 + LTEXT "®eÅé %3¡]¦øªA¾¹ %1¡A¤À³Î°Ï %2¡^",IDC_SET_NAME,49,14,219, + 8 +END + +IDD_MAIN DIALOGEX 0, 0, 317, 226 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | + WS_SYSMENU | WS_THICKFRAME +CAPTION "AFS ¦øªA¾¹ºÞ²zµ{¦¡" +MENU MENU_MAIN +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "¤w¿ï¨úªº Cell¡G",IDC_STATIC,2,8,67,8 + LTEXT "¡]±N·|§â Cell ¦WºÙ©ñ¦b¦¹³B¡^",IDC_CELL,62,8,208,9 + LTEXT "AFS °O¸¹¡G",IDC_STATIC,2,19,55,8 + LTEXT "%2:%1¡]°O¸¹±N¹L´Á %3¡^",IDC_AFS_ID,62,19,208,9 + CONTROL "",IDC_SERVERS,"FastList",WS_TABSTOP | 0x301,2,31,313, + 193,WS_EX_CLIENTEDGE + CONTROL "",IDC_CELL_BORDER,"Static",SS_ETCHEDHORZ,1,2,315,1 + ICON IDI_MAIN,IDC_ANIMATE,292,7,20,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_SERVER DIALOG DISCARDABLE 0, 0, 209, 137 +STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "¦øªA¾¹" +CLASS "ServerWindowClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + CONTROL "",IDC_TABS,"SysTabControl32",0x0,2,2,205,133 +END + +IDD_SVC_CREATE DIALOGEX 0, 0, 225, 233 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¦øªA¾¹(&S)¡G",IDC_STATIC,5,36,44,8 + COMBOBOX IDC_SVC_SERVER,52,33,116,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "ªA°È(&V)¡G",IDC_STATIC,5,52,44,8 + COMBOBOX IDC_SVC_NAME,52,50,116,104,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "«ü¥O(&C)¡G",IDC_STATIC,5,70,44,8 + EDITTEXT IDC_SVC_COMMAND,52,68,168,13,ES_AUTOHSCROLL + LTEXT "°Ñ¼Æ(&P)¡G",IDC_STATIC,5,88,44,8 + EDITTEXT IDC_SVC_PARAMS,52,86,168,13,ES_AUTOHSCROLL + LTEXT "³qª¾ªÌ(&N)¡G",IDC_STATIC,5,105,44,8 + EDITTEXT IDC_SVC_NOTIFIER,52,103,168,13,ES_AUTOHSCROLL + LTEXT "¤é»xÀÉ(&L)¡G",IDC_STATIC,5,122,44,8 + EDITTEXT IDC_SVC_LOGFILE,52,120,168,13,ES_AUTOHSCROLL + CONTROL "²¦¡¡]«ùÄò°õ¦æ¡^(&I) ",IDC_SVC_TYPE_SIMPLE,"Button", + BS_AUTORADIOBUTTON,11,154,201,10 + CONTROL "¥ß§Y±Ò°Ê¥»ªA°È(&T)",IDC_SVC_RUNNOW,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,23,166,183,10 + CONTROL "FS¡]Àɮרt²Î¡^(&F) ",IDC_SVC_TYPE_FS,"Button", + BS_AUTORADIOBUTTON,11,180,201,10 + CONTROL "Cron¡]¦b«ü©w¶¡¹j°õ¦æ¡^(&R) ",IDC_SVC_TYPE_CRON,"Button", + BS_AUTORADIOBUTTON,11,195,201,10 + LTEXT "°õ¦æ¤é´Á(&W)¡G",IDC_STATIC,12,209,54,8 + COMBOBOX IDC_SVC_RUNDAY,70,207,69,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "®É¶¡",IDC_STATIC,143,209,8,8 + CONTROL "",IDC_SVC_RUNTIME,"Time",WS_BORDER | WS_TABSTOP,154,207, + 53,13,WS_EX_CLIENTEDGE + ICON IDI_SERVICE,IDC_STATIC,5,5,20,20 + LTEXT "·sªºªA°È",IDC_SVC_DESC,52,13,168,8 + GROUPBOX "ªA°ÈÃþ«¬",IDC_STATIC,5,141,215,87 +END + +IDD_SET_REPSITES DIALOGEX 0, 0, 221, 168 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_SET_REP_LIST,"FastList",WS_TABSTOP | 0x303,11,80, + 199,58,WS_EX_CLIENTEDGE + PUSHBUTTON "¥ß§YÄÀ©ñ(&R)",IDC_SET_RELEASE,11,143,52,14 + PUSHBUTTON "«Ø¥ß(&C)...",IDC_SET_REPSITE_ADD,129,143,38,14 + PUSHBUTTON "§R°£(&L)",IDC_SET_REPSITE_DELETE,172,143,38,14 + LTEXT "¦øªA¾¹¡G",-1,11,31,37,8 + LTEXT "¡]¦øªA¾¹¦WºÙ¡^",IDC_SET_SERVER,55,31,147,8 + LTEXT "¤À³Î°Ï¡G",-1,11,44,37,8 + LTEXT "¡]¤À³Î°Ï¦WºÙ¡^",IDC_SET_AGGREGATE,55,44,147,8 + LTEXT "®eÅé¡G",-1,11,18,37,8 + LTEXT "¡]®eÅé¦WºÙ¡^",IDC_SET_NAME,55,18,147,8 + GROUPBOX "Ū¨ú / ¼g¤J®eÅé",-1,5,5,211,56 + GROUPBOX "®eÅ齯¥»",-1,5,67,211,96 +END + +IDD_OPENCELL DIALOG DISCARDABLE 0, 0, 219, 257 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "¿ï¨ú Cell - AFS ¦øªA¾¹ºÞ²zµ{¦¡" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "Cell (&C)¡G",IDC_STATIC,4,24,43,8 + COMBOBOX IDC_OPENCELL_CELL,53,22,162,143,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + GROUPBOX "AFS Ų§O",IDC_STATIC,4,44,211,92 + LTEXT "AFS ¨­¥÷(&I)¡G",IDC_STATIC,22,100,64,8 + EDITTEXT IDC_OPENCELL_ID,88,98,121,14,ES_AUTOHSCROLL + LTEXT "AFS ±K½X(&P)¡G",IDC_STATIC,22,116,55,8 + EDITTEXT IDC_OPENCELL_PASSWORD,88,114,121,14,ES_PASSWORD | + ES_AUTOHSCROLL + PUSHBUTTON "¶i¶¥(&V) >>",IDC_ADVANCED,4,146,53,14 + DEFPUSHBUTTON "½T©w",IDOK,68,146,41,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,120,146,41,14 + PUSHBUTTON "»¡©ú(&H)",9,172,146,41,14 + CONTROL "ºÊµø³o­Ó Cell ¤¤ªº©Ò¦³¦øªA¾¹(&L)",IDC_MON_ALL,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,10,204,185,9 + CONTROL "¥uºÊµø¤@­Ó¦øªA¾¹(&M)¡G",IDC_MON_ONE,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,10,219,110,10 + EDITTEXT IDC_MON_SERVER,125,218,83,13,ES_AUTOHSCROLL + CONTROL "¥uºÊµø¤l¶°¤¤ªº¦øªA¾¹(&S)¡G",IDC_MON_SOME,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,10,235,110,10 + COMBOBOX IDC_MON_SUBSET,125,233,83,93,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "¿ï¨ú±z­n§@·~ªº AFS Cell",IDC_STATIC,4,7,200,8 + GROUPBOX "ºÊµø¦øªA¾¹",IDC_ADVANCED_GROUP,4,169,211,84 + LTEXT "¦p­n´£°ª°õ¦æ®Ä¯à¡A±z¥i¥H¿ï¾Ü¥uºÊµø³o­Ó Cell ¤§¦øªA¾¹¤l¶°¡C", + IDC_STATIC,10,182,199,17 + LTEXT "¡]¬d¸ß...¡^",IDC_OPENCELL_OLDCREDS,22,70,185,8 + LTEXT "¦p­nºÞ²z Cell¡A±z¥²¶·­«·s¿é¤J±zªº AFS ±K½X¡G", + IDC_STATIC,10,85,196,8 + LTEXT "±z¥Ø«e¦b©Ò¿ï¨ú¤§ Cell ¤¤ªº AFS °O¸¹¡G",IDC_STATIC,10,57, + 196,8 +END + +IDD_TIMEOUT DIALOG DISCARDABLE 0, 0, 236, 157 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "ĵ§i - AFS ¦øªA¾¹ºÞ²zµ{¦¡" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + CONTROL "Ä~Äòµ¥­Ô¡Aª½¨ì§@·~¥¿±`§¹¦¨¬°¤î(&C)",IDC_TIMEOUT_WAIT, + "Button",BS_AUTORADIOBUTTON,24,87,208,10 + CONTROL "²×¤î§@·~(&T)",IDC_TIMEOUT_KILL,"Button", + BS_AUTORADIOBUTTON,24,101,208,10 + DEFPUSHBUTTON "½T©w",IDOK,93,139,50,14 + LTEXT "°õ¦æ§@·~©Ò¸g¾úªº®É¶¡¡G",IDC_STATIC,4,119,89,8 + LTEXT "88:88:88",IDC_TIMEOUT_ELAPSED,95,119,40,8 + LTEXT "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµ¥­Ôºô¸ô§@·~§¹¦¨ªº®É¶¡¹Lªø¡C", + IDC_STATIC,4,7,228,18 + LTEXT "±z¥i¥HÅý§@·~Ä~Äò°õ¦æ¡]«ØÄ³¡^¡A©ÎªÌ¦pªG§A½T©w§@·~¥Ã»·³£¤£·|§¹¦¨¡A«h¥i¥HÅý¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v²×¤î§@·~¡C", + IDC_STATIC,4,30,228,26 + LTEXT "½Ðª`·N¡A§Y¨Ï³o­Óµøµ¡Åã¥Ü¥X¨Ó¡A§@·~¤´Ä~Äò¶i¦æ¡F§@·~§¹¦¨®É¡A³o­Óµøµ¡·|¦Û°ÊÃö³¬¡C", + IDC_STATIC,4,63,228,17 +END + +IDD_COLUMNS DIALOG DISCARDABLE 0, 0, 286, 148 +STYLE WS_POPUP | WS_CAPTION +CAPTION "ª½Äæ" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¿ï¨ú¦C¥Ü®É©Ò­nÅã¥Üªºª½Äæ(&S)¡G",IDC_STATIC,5,7,126,8 + COMBOBOX IDC_COLUMNS,134,5,147,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "¥i¥Îªºª½Äæ(&C)¡G",IDC_STATIC,12,40,100,8 + LISTBOX IDC_COL_AVAIL,12,49,100,71,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LTEXT "Åã¥Üªºª½Äæ(&I)¡G",IDC_STATIC,173,41,100,8 + LISTBOX IDC_COL_SHOWN,173,50,100,71,LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "·s¼W(&A) >>",IDC_COL_INSERT,119,68,46,14 + PUSHBUTTON "<< ²¾°£(&R)",IDC_COL_DELETE,119,88,46,14 + PUSHBUTTON "¦V¤W²¾°Ê(&U)",IDC_COL_UP,173,122,48,14 + PUSHBUTTON "¦V¤U²¾°Ê(&D)",IDC_COL_DOWN,224,122,48,14 + GROUPBOX "¦C¥Xª½Äæ",IDC_STATIC,5,25,276,118 +END + +IDD_REFRESHALL DIALOG DISCARDABLE 0, 0, 264, 72 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "­«·s¾ã²z - AFS ¦øªA¾¹ºÞ²zµ{¦¡" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + CONTROL "",IDC_REFRESH_PERCENTBAR,"msctls_progress32",0x0,4,37, + 256,8 + LTEXT "§¹¦¨ 0%%",IDC_REFRESH_PERCENT,4,49,216,8 + LTEXT "",IDC_REFRESH_CURRENT,4,60,216,8 + LTEXT "½Ðµy­Ô...",IDC_REFRESH_DESC,4,7,256,25 + PUSHBUTTON "²¤¹L(&S)",IDC_REFRESH_SKIP,222,58,38,12,NOT WS_TABSTOP +END + +IDD_SET_CREATE DIALOGEX 0, 0, 321, 209 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "«Ø¥ß®eÅé" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "¦WºÙ(&N)¡G",IDC_STATIC,4,30,39,8 + EDITTEXT IDC_SET_NAME,51,28,116,14,ES_AUTOHSCROLL + LTEXT "°tÃB(&Q)¡G",IDC_STATIC,4,48,39,8 + EDITTEXT IDC_SET_QUOTA,51,46,32,14,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,95,47,30,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "³Æ¥÷(&B)¡G",IDC_STATIC,4,66,39,8 + CONTROL "¦P®É«Ø¥ß¥»®eÅ骺³Æ¥÷ª©¥»(&R)",IDC_SET_CLONE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,51,66,162,8 + LTEXT "¦øªA¾¹(&S)¡G",IDC_STATIC,4,84,45,8 + COMBOBOX IDC_SET_SERVER,52,82,115,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "¤À³Î°Ï(&P)¡G",IDC_STATIC,4,102,45,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,51,102,266, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "½T©w",IDOK,156,191,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,211,191,50,14 + PUSHBUTTON "»¡©ú(&H)",9,267,191,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "·sªº®eÅé",IDC_STATIC,46,12,170,8 +END + +IDD_SET_DELETE DIALOG DISCARDABLE 0, 0, 277, 102 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "§R°£®eÅé" +FONT 9, "·s²Ó©úÅé" +BEGIN + DEFPUSHBUTTON "¨ú®ø",IDCANCEL,169,84,50,14 + PUSHBUTTON "½T©w",IDOK,115,84,50,14 + PUSHBUTTON "»¡©ú(&H)",9,223,84,50,14 + CONTROL "±N®eÅé %3 ±q¦øªA¾¹ %1¡A¤À³Î°Ï %2 §R°£(&D)", + IDC_DELSET_SERVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 46,45,227,10 + CONTROL "§R°£®eÅé %3 ªº &VLDB ¶µ (&V)",IDC_DELSET_VLDB,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,46,60,227,10 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "ĵ§i¡I\n\n³o¶µ§@·~±N³y¦¨®eÅé %3 ¥Ã¤[³Q§R°£¡C", + IDC_DELSET_DESC,31,7,242,33 +END + +IDD_SET_CLONE DIALOG DISCARDABLE 0, 0, 345, 85 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "³Æ¥÷®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + DEFPUSHBUTTON "½T©w",IDOK,183,67,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,237,67,50,14 + PUSHBUTTON "»¡©ú(&H)",9,291,67,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "®eÅ鳯¥÷¬O¸Ó®eÅ骺°ßŪ°Æ¥»¡F¤@­ÓŪ¨ú / ¼g¤J®eÅé¥u¯à¾Ö¦³¤@­Ó³Æ¥÷ª©¥»¡C", + IDC_STATIC,34,9,307,17 + LTEXT "«ö¤@¤U¡u½T©w¡v¥H¦b¦øªA¾¹ %1¡A¤À³Î°Ï %2 ¤W«Ø¥ß %3 ®eÅ鳯¥÷¡C­Y¬O¥»®eÅ骺³Æ¥÷¤w¸g¦s¦b¡A«h·|§ó·s³Æ¥÷¡C", + IDC_CLONE_DESC,34,32,307,24 +END + +IDD_SVC_PROBLEMS DIALOG DISCARDABLE 0, 0, 225, 194 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + GROUPBOX "¤wª¾ªº°ÝÃD",IDC_PROBLEM_BOX,5,36,215,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,174,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,203,49,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,138,120,61,12 + ICON IDI_SERVICE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "ªA°È %2¡]¦øªA¾¹ %1¡^",IDC_PROBLEM_TITLE,52,13,168,8 +END + +IDD_SVR_PROBLEMS DIALOG DISCARDABLE 0, 0, 226, 157 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + GROUPBOX "¤wª¾ªº°ÝÃD",IDC_PROBLEM_BOX,5,36,216,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,49,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,49,172,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,201,49,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,136,120,61,12 + ICON IDI_SERVER_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "%1",IDC_PROBLEM_TITLE,42,13,179,8 +END + +IDD_AGG_PROBLEMS DIALOG DISCARDABLE 0, 0, 257, 151 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + GROUPBOX "¤wª¾ªº°ÝÃD",IDC_PROBLEM_BOX,5,35,247,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,206,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,235,48,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,170,119,61,12 + ICON IDI_AGGREGATE_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "¤À³Î°Ï %2¡]¦øªA¾¹ %1¡^",IDC_PROBLEM_TITLE,38,14,214,8 +END + +IDD_SET_PROBLEMS DIALOG DISCARDABLE 0, 0, 273, 182 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + GROUPBOX "¤wª¾ªº°ÝÃD",IDC_PROBLEM_BOX,5,35,263,102 + LTEXT "99:",IDC_PROBLEM_HEADER,11,48,11,8 + LTEXT "A\nB\nC\nD\nA\nB\nC\nD",IDC_PROBLEM_TEXT,25,48,220,66, + SS_SUNKEN + SCROLLBAR IDC_PROBLEM_SCROLL,249,48,10,83,SBS_VERT + PUSHBUTTON "Button1",IDC_PROBLEM_REMEDY,184,119,61,12 + ICON IDI_FILESET_ALERT,IDC_STATIC,5,5,20,20 + LTEXT "®eÅé %3¡]¦øªA¾¹ %1¡A¤À³Î°Ï %2¡^",IDC_PROBLEM_TITLE,49, + 14,219,8 +END + +IDD_SET_MOVETO DIALOGEX 0, 0, 277, 174 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "²¾°Ê®eÅé" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_MOVESET_SERVER,4,54,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,70,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "½T©w",IDOK,115,156,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,169,156,50,14 + PUSHBUTTON "»¡©ú(&H)",9,223,156,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,21,20 + LTEXT "A\nB\nC",IDC_MOVESET_DESC,31,4,242,24 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,35,269,1 + LTEXT "²¾°Ê®eÅé¦Ü(&M)¡G",IDC_STATIC,4,43,116,8 +END + +IDD_SET_MOVING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "²¾°Ê®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "±N®eÅé %3 ±q¦øªA¾¹ %1 ¤W¤À³Î°Ï %2 ²¾°Ê¦Ü¦øªA¾¹ %4 ¤W¤À³Î°Ï %5...", + IDC_MOVESET_DESC,4,41,229,19 +END + +IDD_SVC_LOGNAME DIALOG DISCARDABLE 0, 0, 277, 106 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "À˵ø¤é»xÀÉ" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "À˵ø¦øªA¾¹¤Wªº¤é»xÀÉ(&S)¡G",IDC_STATIC,4,45,103,8 + COMBOBOX IDC_VIEWLOG_SERVER,111,43,126,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "¦øªA¾¹¤W©Ò­nÀ˵øªºÀÉ®×(&F)¡G",IDC_STATIC,4,64,107,8 + EDITTEXT IDC_VIEWLOG_FILENAME,111,62,158,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "½T©w",IDOK,169,88,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,223,88,50,14 + ICON IDI_SERVICE,IDC_STATIC,4,4,20,20 + LTEXT "½Ð¿é¤J±z­nÀ˵ø¤§¤é»xÀɪº§¹¾ã¸ô®|¦WºÙ¡C", + IDC_VIEWLOG_DESC,31,10,242,21 +END + +IDD_SVC_VIEWLOG DIALOG DISCARDABLE 0, 0, 286, 185 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "À˵ø¤é»xÀÉ" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "Àɮפº®e¡G",IDC_SVC_VIEWLOG_CONTENTS,4,41,277,8 + EDITTEXT IDC_VIEWLOG_TEXT,4,51,277,113,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL + PUSHBUTTON "¥t¦s·sÀÉ(&A)...",IDC_VIEWLOG_SAVEAS,173,167,53,14 + DEFPUSHBUTTON "Ãö³¬(&C)",IDOK,231,167,50,14 + ICON IDI_SERVICE,-1,4,7,20,20 + LTEXT "¦øªA¾¹ %1 ¤Wªº¤é»xÀÉ [ªA°È %2]",IDC_SVC_VIEWLOG_DESC,33, + 7,248,8 + LTEXT "¦øªA¾¹¤WªºÀɮצWºÙ¡G %1",IDC_SVC_VIEWLOG_FILENAME,33,23, + 248,8 +END + +IDD_SET_SETQUOTA DIALOGEX 0, 0, 271, 130 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "³]©w®eÅé°tÃB" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "¥Ø«eªº°tÃB¡G",IDC_STATIC,4,49,57,8 + LTEXT "¡]¤£©ú¡^",IDC_SET_USAGE,59,49,208,8 + CONTROL "",IDC_SET_USAGEBAR,"msctls_progress32",0x0,59,60,208,8, + WS_EX_STATICEDGE + LTEXT "·sªº°tÃB(&Q)¡G",IDC_STATIC,4,81,52,8 + EDITTEXT IDC_SET_QUOTA,59,79,32,13,ES_AUTOHSCROLL + COMBOBOX IDC_SET_QUOTA_UNITS,103,79,30,44,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "½T©w",IDOK,109,112,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,163,112,50,14 + PUSHBUTTON "»¡©ú(&H)",9,217,112,50,14 + PUSHBUTTON "¤º®e(&P)...",IDC_AGG_PROPERTIES,212,28,55,12 + LTEXT "¤À³Î°Ï¡G",IDC_STATIC,4,30,47,8 + LTEXT "¦øªA¾¹ %1 ªº¤À³Î°Ï %2",IDC_SET_AGGREGATE,59,30,141,8 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "®eÅé %1",IDC_SET_NAME,59,11,208,8 +END + +IDD_ACTIONS DIALOGEX 0, 0, 236, 58 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_TOOLWINDOW +CAPTION "¶i¦æ¤¤ªº§@·~ - AFS ¦øªA¾¹ºÞ²zµ{¦¡" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "¥Ø«e¥¿¦b¶i¦æ¥H¤Uªº§@·~¡G",IDC_ACTION_DESC,2,2,232,8 + CONTROL "",IDC_ACTION_LIST,"FastList",WS_BORDER | WS_TABSTOP | + 0x3,2,14,232,43 +END + +IDD_SVR_SYNCVLDB DIALOG DISCARDABLE 0, 0, 269, 99 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "¦P¨B VLDB" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + DEFPUSHBUTTON "½T©w",IDOK,107,81,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,161,81,50,14 + PUSHBUTTON "»¡©ú(&H)",9,215,81,50,14 + ICON 32515,IDC_STATIC,4,4,21,20 + LTEXT "¡]©ó°õ¦æ´Á¶¡®É³]©w¡^",IDC_SYNC_DESC,37,4,228,32 + LTEXT "¡]©ó°õ¦æ´Á¶¡®É³]©w¡^",IDC_SYNC_DESC2,37,44,228,24 +END + +IDD_SET_CREATEREP DIALOGEX 0, 0, 277, 171 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "½Æ»s®eÅé" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_SET_SERVER,4,46,116,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,4,62,269, + 75,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "½T©w",IDOK,115,153,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,169,153,50,14 + PUSHBUTTON "»¡©ú(&H)",9,223,153,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,21,20 + LTEXT "®eÅé %3 ·sªº½Æ¥»",IDC_SET_NAME,31,12,242,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,27,268,1 + LTEXT "«Ø¥ß¦¹®eÅ骺·s½Æ¥»©ó(&C)¡G",IDC_STATIC,4,35,125,8 +END + +IDD_SVR_INSTALL DIALOG DISCARDABLE 0, 0, 248, 156 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "¦w¸ËÀÉ®×" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¨Ó·½ÀÉ(&F)¡G",IDC_STATIC,4,74,49,8 + EDITTEXT IDC_FILENAME,64,72,127,14,ES_AUTOHSCROLL + PUSHBUTTON "ÂsÄý(&B)...",IDC_BROWSE,194,72,50,14 + LTEXT "¥Ø¼Ð¦øªA¾¹(&S)¡G",IDC_STATIC,4,94,59,8 + COMBOBOX IDC_SERVER,64,92,83,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "¥Ø¼Ð¦WºÙ(&N)¡G",IDC_STATIC,4,114,55,8 + EDITTEXT IDC_DIRECTORY,64,112,127,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "½T©w",IDOK,86,138,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,140,138,50,14 + PUSHBUTTON "»¡©ú(&H)",9,194,138,50,14 + ICON IDI_INSTALL,IDC_STATIC,4,4,20,20 + LTEXT "¦b¦øªA¾¹¤W¦w¸ËÀÉ®×",IDC_STATIC,32,12,127,8 + LTEXT "¡]°õ¦æ´Á¶¡³]©wªº¤å¦r¡^\n¡]°õ¦æ´Á¶¡³]©wªº¤å¦r¡^\n¡]°õ¦æ´Á¶¡³]©wªº¤å¦r¡^\n¡]°õ¦æ´Á¶¡³]©wªº¤å¦r¡^", + IDC_INSTALL_DESC,4,29,240,33 +END + +IDD_SVR_UNINSTALL DIALOG DISCARDABLE 0, 0, 248, 139 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "¸Ñ°£¦w¸ËÀÉ®×" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¦øªA¾¹(&S)¡G",IDC_STATIC,4,66,46,8 + COMBOBOX IDC_SERVER,55,64,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "¥Ø¼ÐÀÉ®×(&F)¡G",IDC_STATIC,4,85,50,8 + EDITTEXT IDC_FILENAME,55,83,161,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "½T©w",IDOK,88,121,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,141,121,50,14 + PUSHBUTTON "»¡©ú(&H)",9,194,121,50,14 + ICON IDI_UNINSTALL,IDC_STATIC,4,4,20,20 + LTEXT "±q¦øªA¾¹¸Ñ°£¦w¸ËÀÉ®×",IDC_STATIC,32,12,127,8 + LTEXT "³o¶µ§@·~Åý±z±N¥ý«e¤w¦w¸ËªºÀÉ®×°Æ¥»¡A´_­ì¨ì¯S©wªº¦øªA¾¹¡C¦pªG¿ï©wªºÀɮפ£¨ã¦³¥ý«e¦w¸ËªºÀÉ®×°Æ¥»¡A«hÀÉ®×·|³Q²¾°£¡C", + IDC_STATIC,4,29,240,26 +END + +IDD_SVR_PRUNE DIALOG DISCARDABLE 0, 0, 224, 141 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "§R°£ÂÂÀÉ®×" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¦øªA¾¹¡G",-1,4,56,44,8 + COMBOBOX IDC_SERVER,53,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "§R°£©Ò¦³®Ö¤ßÀÉ(&C)",IDC_OP_DELETE_CORE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,67,73,134,10 + CONTROL "§R°£©Ò¦³ .&BAK ÀÉ¡]Àɮ׳ƥ÷¡^",IDC_OP_DELETE_BAK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,67,84,137,10 + CONTROL "§R°£©Ò¦³ .&OLD ÀÉ¡]ÂÂÀɮ׳ƥ÷¡^",IDC_OP_DELETE_OLD, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,67,95,143,10 + DEFPUSHBUTTON "½T©w",IDOK,48,123,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,109,123,50,14 + PUSHBUTTON "»¡©ú(&H)",9,170,123,50,14 + ICON IDI_PRUNE,-1,4,4,21,21 + LTEXT "±NÂÂÀÉ®×±q¦øªA¾¹¤W§R°£",-1,32,12,101,8 + LTEXT "³o¶µ§@·~·|§R°£¦w¸Ë©ó¯S©w¦øªA¾¹ªºÀɮ׳ƥ÷°Æ¥»¡C",-1,4,29, + 216,16 + LTEXT "­n§R°£ªºÀɮסG",-1,4,73,60,8 +END + +IDD_SET_RENAME DIALOG DISCARDABLE 0, 0, 277, 133 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "Åܧó®eÅé¦WºÙ" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "ªº¦WºÙ(&O)¡G",IDC_STATIC,31,67,55,8 + EDITTEXT IDC_RENSET_OLD,86,65,122,14,ES_AUTOHSCROLL | ES_READONLY + LTEXT "·sªº¦WºÙ(&N)¡G",IDC_STATIC,31,85,51,8 + EDITTEXT IDC_RENSET_NEW,86,83,122,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "½T©w",IDOK,108,115,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,162,115,50,14 + PUSHBUTTON "»¡©ú",9,216,115,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "¦p­n­«·s©R¦W®eÅé %3 ¡A½Ð¦b¤U¤è¿é¤J·sªº¦WºÙ¡C­«·s©R¦W«á¡A®eÅ骺³Æ¥÷¤Î¨ä©Ò¦³½Æ¥»·|¦Û°Ê§ïÅܦWºÙ¡C\n\nĵ§i¡G¦pªG±z¬°¤w¸Ë¸üªº®eÅé­«·s©R¦W¡A±z¥²¶·§R°£¨Ã­«·s«Ø¥ß¨ä¸Ë¸üÂI¡C", + IDC_RENSET_DESC,31,7,235,48 +END + +IDD_SVC_DELETE DIALOG DISCARDABLE 0, 0, 277, 68 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "§R°£ªA°È" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + DEFPUSHBUTTON "¨ú®ø",IDCANCEL,169,50,50,14 + PUSHBUTTON "½T©w",IDOK,115,50,50,14 + PUSHBUTTON "»¡©ú",9,223,50,50,14 + ICON 32515,IDC_STATIC,4,7,20,20 + LTEXT "ĵ§i¡I\n\n³o¶µ§@·~·|¾É­PªA°È %2 °±¤î¡A¨Ã±q¦øªA¾¹ %1 ¥[¥H§R°£¡C", + IDC_DELSVC_DESC,31,7,242,33 +END + +IDD_SVR_GETDATES DIALOG DISCARDABLE 0, 0, 248, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "¨ú±oÀɮפé´Á" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¦øªA¾¹(&S)¡G",-1,4,56,42,8 + COMBOBOX IDC_SERVER,70,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "­n¬d¸ßªºÀÉ®×(&F)¡G",-1,4,75,66,8 + EDITTEXT IDC_FILENAME,70,73,132,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "½T©w",IDOK,86,107,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,140,107,50,14 + PUSHBUTTON "»¡©ú(&H)",9,194,107,50,14 + ICON IDI_GETDATES,-1,4,4,20,20 + LTEXT "¨ú±o¦b¦øªA¾¹¤WªºÀɮפé´Á",-1,32,12,127,8 + LTEXT "³o¶µ§@·~·|¨ú±oÀÉ®×¤Î¨ä³Æ¥÷¡]¦pªG¦³ªº¸Ü¡^¤W¦¸­×§ïªº¤é´Á¡C", + -1,4,29,240,16 +END + +IDD_SVR_GETDATES_RESULTS DIALOG DISCARDABLE 0, 0, 248, 132 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "¨ú±oÀɮפé´Á - µ²ªG" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¦øªA¾¹¡G",IDC_STATIC,4,30,39,8 + LTEXT "¡]©ó°õ¦æ´Á¶¡®É³]©w¡^",IDC_SERVER,48,30,137,8 + LTEXT "ÀɮצWºÙ¡G",IDC_STATIC,4,45,43,8 + LTEXT "¡]©ó°õ¦æ´Á¶¡®É³]©w¡^",IDC_FILENAME,48,45,137,8 + LTEXT "Àɮפé´Á¡G",IDC_STATIC,4,60,44,8 + LTEXT "¡]¤£©ú¡F§ä¤£¨ìÀɮס^",IDC_DATE_FILE,48,60,174,8 + LTEXT ".BAK ¤é´Á¡G",IDC_STATIC,4,75,45,8 + LTEXT "¡]¤£©ú¡F§ä¤£¨ìÀɮס^",IDC_DATE_BAK,48,75,167,8 + LTEXT ".OLD ¤é´Á¡G",IDC_STATIC,4,90,45,8 + LTEXT "¡]¤£©ú¡F§ä¤£¨ìÀɮס^",IDC_DATE_OLD,48,90,164,8 + DEFPUSHBUTTON "Ãö³¬(&C)",IDOK,99,114,50,14 + ICON IDI_GETDATES,IDC_STATIC,4,4,20,20 + LTEXT "¨ú±o¦b¦øªA¾¹¤WÀɮתº¤é´Á",IDC_STATIC,32,12,127,8 +END + +IDD_SET_DUMP DIALOGEX 0, 0, 295, 144 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "¶É¥X®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "«Ø¥ß¶É¥XÀɮצW¬°(&N)¡G",IDC_STATIC,4,42,86,8 + EDITTEXT IDC_DUMP_FILENAME,96,40,141,14,ES_AUTOHSCROLL + PUSHBUTTON "ÂsÄý(&B)...",IDC_DUMP_BROWSE,241,40,50,14 + CONTROL "¶É¥X®eÅé %3 ªº¾ã­Ó¤º®e(&E)¡]¤À³Î°Ï %1:%2¡^", + IDC_DUMP_FULL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10, + 78,274,10 + CONTROL "¥u¶É¥X¤wÅܧóªºÀɮסAÅܧó®É¶¡¬°(&S)",IDC_DUMP_LIMIT_TIME, + "Button",BS_AUTORADIOBUTTON,10,94,144,10 + CONTROL "",IDC_DUMP_TIME,"Time",WS_BORDER | WS_TABSTOP,160,93,51, + 13,WS_EX_CLIENTEDGE + CONTROL "",IDC_DUMP_DATE,"Date",WS_BORDER | WS_TABSTOP,218,93,56, + 13,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "½T©w",IDOK,131,126,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,185,126,50,14 + PUSHBUTTON "»¡©ú(&H)",9,241,126,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "³o¶µ§@·~±N®eÅ餺®e½Æ»s¨ì³æ¤@ÀɮפW¡A³o»ò¤@¨Ó¡A®eÅé´N¯à»´ÃP³Æ¥÷¡C¥H³oºØ¤è¦¡¶É¥Xªº®eÅ餺®e¥i¥H¦bµy«á¥[¥H´_­ì¡C", + IDC_STATIC,30,7,261,24 + GROUPBOX "¶É¥X°Ñ¼Æ",IDC_STATIC,4,62,287,53 +END + +IDD_SET_RESTORE DIALOGEX 0, 0, 292, 248 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "´_­ì®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "­n´_­ìªºÀÉ®×(&R)¡G",IDC_STATIC,4,33,68,8 + EDITTEXT IDC_RESTORE_FILENAME,74,30,158,14,ES_AUTOHSCROLL + PUSHBUTTON "ÂsÄý(&B)...",IDC_RESTORE_BROWSE,238,30,50,14 + CONTROL "³o¬O»¼¼W¦¡¶É¥XÀÉ®×(&I)",IDC_RESTORE_INCREMENTAL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,74,46,114,10 + LTEXT "®eÅé(&V)¡G",IDC_STATIC,11,102,41,8 + EDITTEXT IDC_RESTORE_SETNAME,54,100,115,14,ES_AUTOHSCROLL + LTEXT "¦øªA¾¹(&S)¡G",IDC_STATIC,11,145,43,8 + COMBOBOX IDC_RESTORE_SERVER,55,143,116,104,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "¤À³Î°Ï(&P)¡G",IDC_STATIC,11,162,44,8 + CONTROL "",IDC_AGG_LIST,"FastList",WS_TABSTOP | 0x303,56,161,225, + 55,WS_EX_CLIENTEDGE + DEFPUSHBUTTON "½T©w",IDOK,128,230,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,183,230,50,14 + PUSHBUTTON "»¡©ú(&H)",9,238,230,50,14 + ICON IDI_FILESET,IDC_STATIC,4,4,20,20 + LTEXT "±q¶É¥XÀÉ®×´_­ì®eÅé",IDC_STATIC,33,11,224,8 + GROUPBOX "¥Ø¼Ð®eÅé",IDC_STATIC,4,63,284,160 + LTEXT "·í±z±q¶É¥XÀÉ®×´_­ì®eÅé®É¡A±z¥i¥H«Ø¥ß·sªº®eÅé©Î¬O§ï¼g²{¦³ªºÅª¨ú / ¼g¤J®eÅé¡C", + IDC_STATIC,11,78,259,16 + LTEXT "¡]©ó°õ¦æ´Á¶¡³]©w¡^\n¡]©ó°õ¦æ´Á¶¡³]©w¡^", + IDC_RESTORE_CREATE,51,119,229,17 +END + +IDD_SVC_BOS DIALOGEX 0, 0, 225, 207 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + CONTROL "©w´Á°±¤î¨Ã­«·s±Ò°Ê¦¹¦øªA¾¹¤Wªº©Ò¦³ªA°È(&P)", + IDC_BOS_GENRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, + 71,193,10 + LTEXT "­«·s±Ò°Ê(&R)",IDC_BOS_GENRES_DESC1,12,87,45,8 + COMBOBOX IDC_BOS_GENRES_DATE,58,84,65,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "¦b(&A)",IDC_BOS_GENRES_DESC2,127,87,8,8 + CONTROL "",IDC_BOS_GENRES_TIME,"Time",WS_BORDER | WS_TABSTOP,138, + 84,53,13,WS_EX_CLIENTEDGE + CONTROL "©w´Á´ú¸Õ¥»¦øªA¾¹¤W·s¤G¶i¦ìÀɪº©Ò¦³ªA°È (&B)", + IDC_BOS_BINRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11, + 151,201,10 + LTEXT "´ú¸Õ(&S)",IDC_BOS_BINRES_DESC1,23,167,25,8 + COMBOBOX IDC_BOS_BINRES_DATE,58,164,65,131,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "¦b(&T)",IDC_BOS_BINRES_DESC2,127,167,8,8 + CONTROL "",IDC_BOS_BINRES_TIME,"Time",WS_BORDER | WS_TABSTOP,138, + 164,53,13,WS_EX_CLIENTEDGE + ICON IDI_BOSSERVICE,IDC_STATIC,5,5,20,20 + LTEXT "ªA°È %2¡]¦øªA¾¹ %1¡^",IDC_SVC_NAME,52,13,168,8 + GROUPBOX "BOS ªA°È",IDC_STATIC,5,27,215,175 + LTEXT "BOS ªA°È¥i¥Î¨Ó©w´Á°±¤î¨Ã­«·s±Ò°Ê¦¹¦øªA¾¹¤W©Ò¦³ªºªA°È¡]¥]¬A BOSªA°È¥»¨­¡^¡C", + IDC_STATIC,11,45,199,18 + LTEXT "BOS ªA°È¤]¥i¥H¥Î¨Ó©w´Á´ú¸Õ¦øªA¾¹¤W©Ò¦³ªºªA°È¡A¥u°±¤î¨Ã­«·s±Ò°Ê¤G¶i¦ìÀɦ³Åܧ󤧪A°È¡C", + IDC_STATIC,11,118,199,25 +END + +IDD_SET_DUMPING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "¶É¥X®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "±q®eÅé %3 «Ø¥ß¶É¥XÀÉ®× %4...",IDC_DUMPSET_DESC,4,41,229, + 19 +END + +IDD_SET_RESTORING DIALOG DISCARDABLE 0, 0, 238, 65 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_CAPTION | WS_SYSMENU +CAPTION "´_­ì®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + CONTROL "",IDC_ANIMATE,"SysAnimate32",ACS_TRANSPARENT | + ACS_AUTOPLAY | WS_TABSTOP,0,0,229,33 + LTEXT "±q¶É¥XÀÉ®× %2 ´_­ì®eÅé %1...",IDC_RESTORESET_DESC,5,41, + 202,19 +END + +IDD_SET_CLONESYS DIALOG DISCARDABLE 0, 0, 258, 163 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "³Æ¥÷®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + CONTROL "«Ø¥ß Cell ©Ò¦³®eÅ骺³Æ¥÷ª©¥»(&A)",IDC_CLONE_ALL,"Button", + BS_AUTORADIOBUTTON,30,45,214,10 + GROUPBOX " ",IDC_STATIC,23,70,231,65 + CONTROL "¥u¬°²Å¦X¤U¦C·Ç«hªº®eÅ髨¥ß³Æ¥÷(&O)¡G",IDC_CLONE_SOME, + "Button",BS_AUTORADIOBUTTON,30,60,155,11 + CONTROL "¥u¦³¦b¦øªA¾¹¤Wªº®eÅé(&S)¡G",IDC_CLONE_SVR_LIMIT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,34,83,114,10 + COMBOBOX IDC_CLONE_SVR,169,82,68,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "¥u¦³¦b¤À³Î°Ï¤Wªº®eÅé(&P)¡G",IDC_CLONE_AGG_LIMIT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,34,99,110,10 + COMBOBOX IDC_CLONE_AGG,169,98,68,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "¥u¦³¥H¯S©w¦r¤¸¬°¶}ÀYªº®eÅé(&B)¡G", + IDC_CLONE_PREFIX_LIMIT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,34,116,135,10 + EDITTEXT IDC_CLONE_PREFIX,169,115,68,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "½T©w",IDOK,95,145,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,149,145,50,14 + PUSHBUTTON "»¡©ú(&H)",9,204,145,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "®eÅ鳯¥÷¬O¸Ó®eÅ骺°ßŪ³Æ¥÷¡F¤@­ÓŪ¨ú / ¼g¤J®eÅé¥u¦³¤@­Ó³Æ¥÷ª©¥»¡C\n\n±z¥i¥H¦P®É¬°¤@­Ó¥H¤Wªº®eÅ髨¥ß³Æ¥÷ª©¥»¡C", + IDC_STATIC,30,7,214,40 +END + +IDD_SUBSETS DIALOGEX 0, 0, 281, 182 +STYLE WS_POPUP | WS_CAPTION +CAPTION "ºÊµø¦øªA¾¹" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "¤l¶°¦WºÙ¡G",IDC_STATIC,12,77,44,8 + EDITTEXT IDC_SUBSET_NAME,64,75,109,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_TABSTOP + PUSHBUTTON "¶}±Ò(&O)...",IDC_SUBSET_LOAD,188,75,39,14 + PUSHBUTTON "Àx¦s(&S)...",IDC_SUBSET_SAVE,233,75,39,14 + CONTROL "",IDC_SUBSET_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x153,12,111,193,58,WS_EX_CLIENTEDGE + PUSHBUTTON "¥þ³¡ºÊµø(&A)",IDC_SUBSET_ALL,211,122,57,14 + PUSHBUTTON "¤£ºÊµø(&N)",IDC_SUBSET_NONE,211,140,57,14 + LTEXT "¦p­n§ïµ½¦b¤j«¬ Cell ¤¤ªº§@·~®Ä¯à¡A±z¥i¥H¿ï¾Ü¤£ºÊµø¯S©w¦øªA¾¹¡C¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v±N¤£·|Åã¥Ü¥¼ºÊµø¤§¦øªA¾¹¤Wªº®eÅé¡B¤À³Î°Ï©ÎªA°È¡C", + IDC_STATIC,5,5,271,24 + LTEXT "±z¥i¥HÀH®É¿ï¾ÜºÊµø¡]©Î¤£ºÊµø¡^¦øªA¾¹¡C±z¥i¥H«Ø¥ß¦øªA¾¹¤l¶°¡A¥H«ü©w¸ÓºÊµø¤§¦øªA¾¹²M³æ¡C", + IDC_STATIC,5,37,271,18 + GROUPBOX "¥Ø«eªº¤l¶°",IDC_STATIC,5,63,271,114 + LTEXT "­nºÊµøªº¦øªA¾¹¡G",IDC_STATIC,12,95,92,8 +END + +IDD_SUBSET_LOADSAVE DIALOGEX 0, 0, 280, 145 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | + WS_CAPTION | WS_SYSMENU +CAPTION "¡]°õ¦æ´Á¶¡³]©wªº¼ÐÃD¡^" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "¤l¶°¦WºÙ(&N)¡G",1090,5,112,51,8,SS_NOTIFY + EDITTEXT IDC_SUBSET_NAME,60,110,159,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "¶}±Ò(&O)",IDOK,226,110,50,14 + PUSHBUTTON "¨ú®ø(&L)",IDCANCEL,226,127,50,14 + CONTROL "List1",IDC_SUBSET_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_SORTASCENDING | LVS_EDITLABELS | + LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,4,20,272,82, + WS_EX_CLIENTEDGE + PUSHBUTTON "",IDC_SUBSET_RENAME,187,4,14,13,BS_ICON | NOT + WS_TABSTOP + PUSHBUTTON "",IDC_SUBSET_DELETE,203,4,14,13,BS_ICON | NOT + WS_TABSTOP + LTEXT "¥» Cell ªº¤l¶°¤w©w¸q¡G",IDC_STATIC,4,6,114,8 +END + +IDD_HELP_FIND DIALOG DISCARDABLE 0, 0, 218, 73 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "·j´M«ü¥O" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + COMBOBOX IDC_FIND_COMMAND,4,38,137,170,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Åã¥Ü»¡©ú(&H)",IDOK,147,38,67,14 + PUSHBUTTON "¨ú®ø(&C)",IDCANCEL,147,55,67,14 + LTEXT "¦p­n§ä¥X¨Ï¥Î¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¥H°õ¦æ§@·~ªº¤èªk¡A½Ð¿ï¨ú¥H¤Uªº«ü¥O¦æ¡A¨Ã«ö¡uÅã¥Ü»¡©ú¡v«ö¶s¡C", + IDC_STATIC,4,4,210,25 +END + +IDD_HELP_ERROR DIALOG DISCARDABLE 0, 0, 218, 137 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "¬d¾\¿ù»~½X" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¿ù»~½X(&E)¡G",IDC_STATIC,4,41,45,8 + EDITTEXT IDC_ERROR_NUMBER,59,39,78,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "Âà´«(&T)",IDC_ERROR_TRANSLATE,144,39,47,14 + PUSHBUTTON "Ãö³¬(&C)",IDCANCEL,85,117,48,14 + LTEXT "¡]°õ¦æ´Á¶¡³]©w¤å¦r¡^",IDC_ERROR_DESC,4,71,211,42 + LTEXT "¦p­n§ä¥X¿ù»~½Xªº²[·N¡A½ÐÁä¤J¥H¤Uªº¥N½X¡A¨Ã«ö¤@¤U¡uÂà´«¡v«ö¶s¡C", + IDC_STATIC,4,4,192,25 + CONTROL "",IDC_ADVANCED_BOX,"Static",SS_ETCHEDHORZ,4,60,211,1 +END + +IDD_HELP_ABOUT DIALOG DISCARDABLE 0, 0, 230, 141 +STYLE DS_CENTER | WS_CAPTION | WS_SYSMENU +CAPTION "¦³Ãö AFS ¦øªA¾¹ºÞ²zµ{¦¡" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + ICON IDI_MAIN,IDC_HELPABOUT_ICON,4,8,20,20 + LTEXT "AFS ¦øªA¾¹ºÞ²zµ{¦¡ 3.5 ª©",IDC_STATIC,33,8,163,8 + LTEXT "Copyright (C) IBM Corporation 1989, 1999",IDC_STATIC,33, + 20,183,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,37,222,1 + CTEXT "",IDC_HELPABOUT_DESC,4,48,222,56 + PUSHBUTTON "Ãö³¬(&C)",IDOK,89,123,50,14 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,4,114,222,1 +END + +IDD_OPENINGCELL DIALOG DISCARDABLE 0, 0, 241, 46 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¥¿¦b·j´M %1 Cell ¤ºªº¦øªA¾¹ ...", + IDC_OPENCELL_DESC,41,15,183,16 + GROUPBOX "",IDC_STATIC,4,2,231,39 + ICON IDI_MAIN,IDC_ANIMATE,12,12,18,20,SS_REALSIZEIMAGE | + WS_BORDER +END + +IDD_OPTIONS_GENERAL DIALOG DISCARDABLE 0, 0, 279, 139 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + CONTROL "Åã¥Ü¦øªA¾¹ªº§¹¾ã»â°ì¦WºÙ¡]¨Ò¦p""machine.company.com""¡^", + IDC_OPT_SVR_LONGNAMES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,5,269,10 + CONTROL "§@·~®É¦pªG¨S¦³ºÞ²z°O¸¹¡A´N·|Åã¥Üĵ§i(&W)", + IDC_OPT_WARN_BADCREDS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,19,269,10 + CONTROL "...Á`¬OÅã¥Ü¦øªA¾¹ªº¤º®e",IDC_OPT_SVR_DBL_PROP,"Button", + BS_AUTORADIOBUTTON,21,50,253,10 + CONTROL "... ¥u¦b¡u§Ö³tÀ˵øµ¡®æ¡v¬°¶}±Òª¬ºA®É¡A¤~Åã¥Ü¦øªA¾¹ªº¤º®e", + IDC_OPT_SVR_DBL_DEPENDS,"Button",BS_AUTORADIOBUTTON,21, + 63,253,10 + CONTROL "...Á`¬O¶}±Ò¸Ó¦øªA¾¹ªºµøµ¡",IDC_OPT_SVR_DBL_OPEN,"Button", + BS_AUTORADIOBUTTON,21,75,253,10 + CONTROL "...¶}±Ò¦øªA¾¹µøµ¡¡A«h¦øªA¾¹·|¨ü¨ìºÊµø", + IDC_OPT_SVR_OPENMON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,21,107,253,10 + CONTROL "...Ãö³¬¦øªA¾¹µøµ¡¡A«h¦øªA¾¹¤£·|¨ü¨ìºÊµø", + IDC_OPT_SVR_CLOSEUNMON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,21,124,253,10 + LTEXT "¦b¦øªA¾¹¹Ï¥Ü¤W«ö¨â¤U...",IDC_STATIC,5,38,269,8 + LTEXT "­Y¦øªA¾¹¤l¶°¦b¨Ï¥Îª¬ºA¤U¡A¦Ó¡u§Ö³tÀ˵ø¡vµ¡®æ¬°Ãö³¬ª¬ºA ...", + IDC_STATIC,5,95,269,8 +END + +IDD_SVR_KEYS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_KEY_LIST,"FastList",WS_TABSTOP | 0x30b,5,22,216, + 135,WS_EX_CLIENTEDGE + PUSHBUTTON "·s¼W¦øªA¾¹ª÷Æ_(&A)",IDC_KEY_ADD,58,160,79,14 + PUSHBUTTON "²¾°£¦øªA¾¹ª÷Æ_(&R)",IDC_KEY_REMOVE,141,160,79,14 + LTEXT "¦øªA¾¹ª÷Æ_¡G",IDC_KEY_NAME,5,7,216,8 +END + +IDD_SVR_CREATEKEY DIALOG DISCARDABLE 0, 0, 281, 150 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "·s¼W¦øªA¾¹ª÷Æ_" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "ª©¥»¡G",IDC_STATIC,7,37,26,8 + EDITTEXT IDC_KEY_VERSION,43,35,43,14,ES_AUTOHSCROLL + LTEXT "­È¡G",IDC_STATIC,7,58,21,8 + CONTROL "¬°³o­Ó¦r¦ê¥[±K¡G",IDC_KEY_BYSTRING,"Button", + BS_AUTORADIOBUTTON,43,58,73,10 + CONTROL "¨Ï¥Î³o­Óª÷Æ_¡G",IDC_KEY_BYDATA,"Button", + BS_AUTORADIOBUTTON,43,76,71,10 + EDITTEXT IDC_KEY_STRING,119,56,155,14,ES_PASSWORD | + ES_AUTOHSCROLL + EDITTEXT IDC_KEY_DATA,119,75,103,14,ES_AUTOHSCROLL + PUSHBUTTON "ÀH¾÷(&R)",IDC_KEY_RANDOM,226,75,48,14 + LTEXT "´£¥Ü¡G±N·sªºª÷Æ_·s¼W¨ì¦øªA¾¹¤§«á¡AÀ³­×§ï AFS ±b¤á¥H¨Ï¥Î·sªºª÷Æ_¡C´X¤Ñ¤§«á¡A´N¥i¥H²¾°£Âªº¦øªA¾¹ª÷Æ_¡C", + IDC_STATIC,7,99,267,18 + DEFPUSHBUTTON "½T©w",IDOK,116,129,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,170,129,50,14 + PUSHBUTTON "»¡©ú",9,224,129,50,14 + LTEXT "¦øªA¾¹ %1 ªº·sª÷Æ_",IDC_KEY_TITLE,43,14,181,8 + ICON IDI_SERVER_KEY,IDC_STATIC,7,7,20,20 +END + +IDD_SVC_STARTSTOP DIALOG DISCARDABLE 0, 0, 277, 132 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "¶}©l / °±¤îªA°È" +FONT 9, "·s²Ó©úÅé" +BEGIN + DEFPUSHBUTTON "½T©w",IDOK,115,114,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,169,114,50,14 + PUSHBUTTON "»¡©ú(&H)",9,223,114,50,14 + ICON IDI_SERVICE,IDC_STATIC,4,7,20,20 + LTEXT "«ö¤@¤U¡u½T©w¡v¥H¶}©l/°±¤î¦øªA¾¹ %1 ¤WªºªA°È %2¡C", + IDC_STARTSTOP_TEXT,31,12,242,9 + CONTROL "¥Ã¤[(&P) (IDS_START/STOPSERVICE_PERMANENT)", + IDC_STARTSTOP_PERMANENT,"Button",BS_AUTORADIOBUTTON,37, + 68,226,10 + CONTROL "¼È®É(&T) (IDS_START/STOPSERVICE_TEMPORARY)", + IDC_STARTSTOP_TEMPORARY,"Button",BS_AUTORADIOBUTTON,37, + 83,226,10 + GROUPBOX "ªA°È±Ò°Ê³]©w",IDC_STATIC,31,31,242,70 + LTEXT "±z¥i¥H§â¥¦Åܦ¨¥Ã¤[Åܧó¡A³o¼ËªA°È %2 ´N·|¡]¤£·|¡^¦b¦øªA¾¹ %1 ­«·s±Ò°Ê®É¦Û°Ê±Ò°Ê¡C", + IDC_STARTSTOP_STARTUP,38,45,223,16 +END + +IDD_SVR_EXECUTE DIALOG DISCARDABLE 0, 0, 248, 125 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "°õ¦æ«ü¥O" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¦øªA¾¹(&S)¡G",IDC_STATIC,4,56,42,8 + COMBOBOX IDC_SERVER,50,54,90,107,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "«ü¥O(&C)¡G",IDC_STATIC,4,75,42,8 + EDITTEXT IDC_COMMAND,50,73,194,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "½T©w",IDOK,86,107,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,140,107,50,14 + PUSHBUTTON "»¡©ú(&H)",9,194,107,50,14 + ICON IDI_SERVER,IDC_STATIC,4,4,20,20 + LTEXT "¦b¦øªA¾¹¤W°õ¦æ«ü¥O",IDC_STATIC,32,12,185,8 + LTEXT "³o¶µ§@·~Åý±z¦b»·ºÝ¦øªA¾¹¤Wµo¥X«ü¥O¡C\n³o¶µ§@·~³q±`ÂǥѰõ¦æ /etc/reboot script¡A­«·s±Ò°Ê¦øªA¾¹¡C", + IDC_STATIC,4,29,240,16 +END + +IDD_SVR_SALVAGE DIALOG DISCARDABLE 0, 0, 262, 255 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "§Q¥Î®eÅé - AFS ¦øªA¾¹ºÞ²zµ{¦¡" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¦øªA¾¹(&S)¡G",IDC_STATIC,23,50,42,8 + COMBOBOX IDC_SERVER,67,48,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "¤À³Î°Ï(&P)¡G",IDC_STATIC,23,67,41,8 + COMBOBOX IDC_AGGREGATE,67,65,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "´©±Ï©Ò¦³ªº¤À³Î°Ï(&A)",IDC_AGGREGATE_ALL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,164,67,94,10 + LTEXT "®eÅé(&O)¡G",IDC_STATIC,23,85,35,8 + COMBOBOX IDC_FILESET,67,83,88,104,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "´©±Ï©Ò¦³ªº®eÅé(&L)",IDC_FILESET_ALL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,163,85,79,10 + DEFPUSHBUTTON "½T©w",IDOK,85,107,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,145,107,50,14 + PUSHBUTTON "»¡©ú(&H)",9,208,108,50,14 + PUSHBUTTON "¶i¶¥(&V) >>",IDC_ADVANCED,23,108,53,14 + LTEXT "¼È¦sÀɸô®|(&T)¡G",IDC_STATIC,10,142,74,8 + EDITTEXT IDC_SALVAGE_TEMPDIR,103,141,133,13,ES_AUTOHSCROLL + CONTROL "¨Ã¦æ´©±Ï§@·~(&R)¡F³B²z¼Æ¥Ø¡G",IDC_SALVAGE_SIMUL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,29,157,123,10 + EDITTEXT IDC_SALVAGE_NUM,157,156,39,13,ES_AUTOHSCROLL + CONTROL "¤£­n´©±Ï·lÃaªº®eÅé(&N)",IDC_SALVAGE_READONLY,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,29,167,123,10 + CONTROL "±NŪ¨ú§@·~¤À¦¨¤p°Ï¶ô(&B)",IDC_SALVAGE_BLOCK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,29,177,139,10 + CONTROL "±j¨î´©±Ï©Ò¦³«ü¥Xªº®eÅé(&F)",IDC_SALVAGE_FORCE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,29,187,136,10 + CONTROL "±j¨î­««Ø¥Ø¿ýµ²ºc(&E)",IDC_SALVAGE_FIXDIRS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,29,197,123,10 + LTEXT "µ²ªG¤é»xªºÀɮצWºÙ(&L)¡G",IDC_STATIC,10,211,91,8 + EDITTEXT IDC_SALVAGE_LOG_FILE,103,210,133,13,ES_AUTOHSCROLL + CONTROL "±N·lÃaªº¤º¸`ÂI²M³æ¥]§t¦bµ²ªG¤é»x¤¤(&I)", + IDC_SALVAGE_LOG_INODES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,30,226,203,10 + CONTROL "±N AFS ©Ò¾Ö¦³ªº®Ú¤º¸`ÂI²M³æ¥]§t¦bµ²ªG¤é»x¤¤(&W)", + IDC_SALVAGE_LOG_ROOT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,30,237,203,10 + ICON IDI_SERVER,IDC_STATIC,4,7,20,20 + LTEXT "³o¶µ§@·~Åý±z­×´_¤@©Î¼Æ­Ó®eÅ骺°ÝÃD¡C\n\n½Ðª`·N¡G­Y±z¦P®É´©±Ï¾ã­Ó¤À³Î°Ï©Î¦øªA¾¹¡A¦øªA¾¹·|¼È®ÉÂ÷½u¡C", + IDC_STATIC,44,7,214,32 + GROUPBOX "¶i¶¥´©±Ï¿ï¶µ",IDC_ADVANCED_GROUP,4,129,254,122 +END + +IDD_SVR_SALVAGE_RESULTS DIALOG DISCARDABLE 0, 0, 286, 178 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "§Q¥Î®eÅé - µ²ªG" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé" +BEGIN + DEFPUSHBUTTON "Ãö³¬(&C)",IDOK,232,160,50,14 + LTEXT "´©±Ï§@·~µ²ªG¡G",IDC_STATIC,4,33,277,8 + EDITTEXT IDC_SALVAGE_DETAILS,4,43,277,113,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | + WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP + ICON IDI_SERVER,IDC_STATIC,4,7,21,20 + LTEXT "¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº±Ï´©®eÅé %3",IDC_SALVAGE_TITLE, + 33,15,248,8 +END + +IDD_SET_RELEASE DIALOG DISCARDABLE 0, 0, 277, 102 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +CAPTION "ÄÀ©ñ®eÅé" +FONT 9, "·s²Ó©úÅé" +BEGIN + DEFPUSHBUTTON "½T©w",IDOK,115,84,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,169,84,50,14 + PUSHBUTTON "»¡©ú(&H)",9,223,84,50,14 + ICON IDI_FILESET,IDC_STATIC,4,7,20,20 + LTEXT "³o¶µ§@·~Åý±z§ó·s %3 ®eÅ骺½Æ¥»¡C±z¥i¥H¿ï¾Ü¥u§ó·s¹L´Áªº½Æ¥»¡A©Î¬O§ó·s©Ò¦³ªº½Æ¥»¡C", + IDC_RELSET_DESC,31,7,242,26 + CONTROL "¥u§ó·s¹L´Áªº®eÅ齯¥»(&U)",IDC_RELSET_NORMAL,"Button", + BS_AUTORADIOBUTTON,46,41,173,10 + CONTROL "§ó·s©Ò¦³®eÅ齯¥»¡A¥]¬A¥¼¹L´Áªº½Æ¥»(&A)", + IDC_RELSET_FORCE,"Button",BS_AUTORADIOBUTTON,46,56,172, + 10 +END + +IDD_SVR_HOSTS DIALOGEX 0, 0, 226, 179 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + PUSHBUTTON "·s¼W¥D¹q¸£¦øªA¾¹(&A)",IDC_HOST_ADD,52,160,83,14 + PUSHBUTTON "²¾°£¥D¹q¸£¦øªA¾¹(&R)",IDC_HOST_REMOVE,138,160,80,14 + LTEXT "¦øªA¾¹©Ò¿ëÃѪº¸ê®Æ®w¥D¹q¸£¦øªA¾¹",IDC_HOST_TITLE,5,7, + 216,8 + CONTROL "",IDC_HOST_LIST,"FastList",WS_TABSTOP | 0x11,5,22,216, + 135,WS_EX_CLIENTEDGE +END + +IDD_SVR_ADDHOST DIALOGEX 0, 0, 225, 106 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "·s¼W¥D¹q¸£¦øªA¾¹" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "¥D¹q¸£(&H)¡G",-1,32,55,43,8 + EDITTEXT IDC_ADDHOST_HOST,79,53,103,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "½T©w",IDOK,63,88,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,117,88,50,14 + ICON IDI_SERVER,-1,4,4,20,20 + LTEXT "±z¿ï¾Ü·s¼W¸ê®Æ®w¥D¹q¸£¦øªA¾¹¨ìÀx¦s©ó¦øªA¾¹ %1 ªº²M³æ¡C\n\n½Ð¦b¤U¤è¿é¤J·sªº¸ê®Æ®w¥D¹q¸£¦WºÙ¡C", + IDC_ADDHOST_DESC,31,10,177,34 + PUSHBUTTON "»¡©ú",9,171,88,50,14 +END + +IDD_SVR_ADDRESS DIALOGEX 0, 0, 208, 115 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "ÅÜ§ó¦øªA¾¹¦ì§}" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + LTEXT "°O¿ý©ó VLDB ªº¦øªA¾¹ %1 ªº IP ¦ì§}¡G",IDC_TITLE,4,4,200, + 8 + LISTBOX IDC_SVR_ADDRESSES,4,14,147,40,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Åܧó(&C)...",IDC_ADDR_CHANGE,154,24,50,14 + PUSHBUTTON "²¾°£(&R)",IDC_ADDR_REMOVE,154,40,50,14 + DEFPUSHBUTTON "½T©w",IDOK,46,97,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,100,97,50,14 + PUSHBUTTON "»¡©ú",9,154,97,50,14 + LTEXT "ªþµù¡GÀɮצøªA¾¹·|¦b±Ò°Ê®É¡A¦Û°Ê¦V VLDB µn¿ý¨ä¥Ø«eªº IP ¦ì§}¡C", + IDC_STATIC,4,64,200,18 +END + +IDD_SVR_NEWADDR DIALOGEX 0, 0, 223, 69 +STYLE DS_CENTER | DS_CONTEXTHELP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTEXTHELP +CAPTION "Åܧó IP ¦ì§}" +CLASS "AFSManagerClass" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "½T©w",IDOK,61,51,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,115,51,50,14 + PUSHBUTTON "»¡©ú",9,169,51,50,14 + LTEXT "¿é¤J·sªº IP ¦ì§} ¥H¨ú¥N VLDB ªº %1¡G",IDC_TITLE,4,4,215, + 8 + CONTROL "",IDC_ADDRESS,"SockAddr",WS_BORDER | WS_TABSTOP,32,23, + 100,14 + LTEXT "¦ì§}¡G",IDC_STATIC,4,26,28,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "resource\\afssvrmgr.ico" +32513 ICON DISCARDABLE "..\\afsapplib\\resource\\error.ico" +32515 ICON DISCARDABLE "..\\afsapplib\\resource\\warning.ico" +IDI_INSTALL ICON DISCARDABLE "resource\\install.ico" +IDI_UNINSTALL ICON DISCARDABLE "resource\\uninstal.ico" +IDI_PRUNE ICON DISCARDABLE "resource\\prune.ico" +IDI_GETDATES ICON DISCARDABLE "resource\\getdates.ico" +IDI_SUBSET ICON DISCARDABLE "resource\\subset.ico" +IDI_ADMINLIST ICON DISCARDABLE "resource\\admlist.ico" +IDI_BTN_DELETE ICON DISCARDABLE "resource\\btn_delete.ico" +IDI_BTN_RENAME ICON DISCARDABLE "resource\\btn_rename.ico" +IDI_SERVER ICON DISCARDABLE "..\\afsapplib\\resource\\server.ico" +IDI_SERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\service.ico" +IDI_AGGREGATE ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg.ico" +IDI_FILESET ICON DISCARDABLE "..\\afsapplib\\resource\\fileset.ico" +IDI_SERVER_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\server1.ico" +IDI_SERVICE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\service1.ico" +IDI_AGGREGATE_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\aggreg1.ico" +IDI_FILESET_ALERT ICON DISCARDABLE "..\\afsapplib\\resource\\fileset1.ico" +IDI_BOSSERVICE ICON DISCARDABLE "..\\afsapplib\\resource\\bos.ico" +IDI_USER ICON DISCARDABLE "..\\afsapplib\\resource\\user.ico" +IDI_SERVER_KEY ICON DISCARDABLE "..\\afsapplib\\resource\\key.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +ACCEL_MAIN ACCELERATORS DISCARDABLE +BEGIN + VK_APPS, M_KEY_MENU, VIRTKEY, NOINVERT + VK_ESCAPE, M_KEY_ESC, VIRTKEY, NOINVERT + VK_F10, M_KEY_MENU, VIRTKEY, SHIFT, NOINVERT + VK_RETURN, M_KEY_RETURN, VIRTKEY, NOINVERT + VK_TAB, M_KEY_TAB, VIRTKEY, NOINVERT + VK_TAB, M_KEY_BACKTAB, VIRTKEY, SHIFT, NOINVERT + VK_TAB, M_KEY_CTRLTAB, VIRTKEY, CONTROL, NOINVERT + VK_TAB, M_KEY_CTRLBACKTAB, VIRTKEY, SHIFT, CONTROL, + NOINVERT + VK_RETURN, M_KEY_PROPERTIES, VIRTKEY, ALT, NOINVERT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// AVI +// + +AVI_SETMOVE AVI DISCARDABLE "Resource\\setmove.avi" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_LISTS_TITLE "¦øªA¾¹ %1 - ºÞ²z­û²M³æ" + IDS_TAB_SERVICES "ªA°È" + IDS_TAB_AGGREGATES "¤À³Î°Ï" + IDS_TAB_FILESETS "®eÅé" + IDS_SERVICE_NONESELECTED "¿ï¨ú±z­nÀ˵øªº¦øªA¾¹¡C" + IDS_SERVICE_GOTSELECTED "¦øªA¾¹ %1 ¤WªºªA°È³B²z¡G" + IDS_AGGREGATE_ALL "©Ò¦³¦øªA¾¹¤Wªº¤À³Î°Ï¡G" + IDS_AGGREGATE_ONE "¦øªA¾¹ %1 ¤Wªº¤À³Î°Ï¡G " + IDS_FILESET_ALL "Cell %1 ¤¤ªº©Ò¦³®eÅé¡G" + IDS_FILESET_ONE "¦øªA¾¹ %1 ¤Wªº®eÅé¡G" + IDS_SVR_LISTS_TAB "ºÞ²z­û²M³æ" + IDS_SVR_PROP_TITLE "¦øªA¾¹ %1 - ¤º®e" + IDS_SVR_GENERAL_TAB "¤@¯ë¨Æ¶µ" + IDS_SVR_SCOUT_TAB "³]©w" + IDS_SERVER_TITLE "¦øªA¾¹ %1 - AFS ¦øªA¾¹ºÞ²zµ{¦¡" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_DESC "Cell %2 ¤¤ªº¦øªA¾¹ %1¡G" + IDS_SVC_PROP_TITLE "¦øªA¾¹ %1 ¤¤ªºªA°È %2 - ¤º®e" + IDS_SVC_GENERAL_TAB "¤@¯ë¨Æ¶µ" + IDS_SVC_ADD_TITLE "«Ø¥ßªA°È" + IDS_SVC_ADD_TAB "«Ø¥ßªA°È" + IDS_AGG_PROP_TITLE "¦øªA¾¹ %1 ¤Wªº¤À³Î°Ï %2 - ¤º®e" + IDS_AGG_GENERAL_TAB "¤@¯ë¨Æ¶µ" + IDS_SET_REP_TITLE "®eÅé %1 - ½Æ»s" + IDS_SET_REPSITES_TAB "½Æ»sºô¯¸" + IDS_SET_PROP_TITLE "®eÅé %1 - ¤º®e" + IDS_SET_GENERAL_TAB "¤@¯ë¨Æ¶µ" + IDS_SET_UNLOCKBTN "¥ß§Y¸Ñ°£Âê©w(&L)" + IDS_SET_LOCKBTN "¥ß§YÂê©w(&L)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_USAGE_FILESET "%2 °tÃB¤w¨Ï¥Îªº %1 (%3%%)" + IDS_USAGE_AGGREGATE "%2 ®e¶q¤w¨Ï¥Îªº %1 (%3%%)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGCOL_ALLOCATED "¥[Á`ªº°tÃB" + IDS_SVRCOL_NAME "¦øªA¾¹" + IDS_SVRCOL_STATUS "ª¬ºA" + IDS_SETCOL_DATE_ACCESS "¤W¦¸¦s¨ú¤é´Á" + IDS_SETCOL_DATE_BACKUP "¤W¦¸³Æ¥÷¤é´Á" + IDS_SVCCOL_NAME "ªA°È" + IDS_SVCCOL_TYPE "Ãþ«¬" + IDS_SVCCOL_PARAMS "°Ñ¼Æ" + IDS_SVCCOL_STATUS "ª¬ºA" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_DATE_START "¤W¦¸±Ò°Ê" + IDS_SVCCOL_DATE_STOP "¤W¦¸°±¤î" + IDS_SVCCOL_DATE_STARTSTOP "¤W¦¸±Ò°Ê / °±¤î" + IDS_SVCCOL_DATE_FAILED "¤W¦¸¥¢±Ñ" + IDS_SVCCOL_LASTERROR "¤W¦¸ªº¥X¤f½X" + IDS_AGGCOL_NAME "¤À³Î°Ï" + IDS_AGGCOL_ID "ID" + IDS_AGGCOL_DEVICE "¸Ë¸m" + IDS_AGGCOL_USED "¤w¨Ï¥Îªº" + IDS_AGGCOL_USED_PER "% ¤w¨Ï¥Î" + IDS_AGGCOL_FREE "ÄÀ©ñ" + IDS_AGGCOL_TOTAL "®e¶q" + IDS_AGGCOL_STATUS "ª¬ºA" + IDS_SETCOL_NAME "®eÅé" + IDS_SETCOL_TYPE "Ãþ«¬" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETCOL_DATE_CREATE "«Ø¥ß¤é´Á" + IDS_SETCOL_DATE_UPDATE "«e¦¸§ó·s" + IDS_SETCOL_STATUS "ª¬ºA" + IDS_SETCOL_QUOTA_USED "¤w¨Ï¥Îªº" + IDS_SETCOL_QUOTA_USED_PER "% ¤w¨Ï¥Îªº" + IDS_SETCOL_QUOTA_FREE "ÄÀ©ñ" + IDS_SETCOL_QUOTA_TOTAL "°tÃB" + IDS_TRYAGAINBTN "­«·s¹Á¸Õ(&A)" + IDS_NO_CELL_SELECTED "¡]©|¥¼«ü©w Cell¡^" + IDS_NO_AFS_ID "¡]¨S¦³¥i¥Îªº°O¸¹¡^" + IDS_AFS_ID_WILLEXP "%1¡]°O¸¹±N¨ì´Á %2¡^" + IDS_ELAPSED_TIME "%1" + IDS_SEARCHING_FOR_SERVERS "½Ðµy­Ô¡F¥¿¦b¨ú±o¦³Ãö %1 Cell ªº¸ê°T ..." + IDS_STATUS_NOALERTS "¤@¯ë" + IDS_TITLE_BROWSE_USER "¿ï¾Ü¨Ï¥ÎªÌ" + IDS_AGGTYPE_OTHER "¤£©ú (%1)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATEFILESET "¦b¤À³Î°Ï %1:%2 «Ø¥ß®eÅé %3" + IDS_ACTION_DELETEFILESET "±q¤À³Î°Ï %1:%2 §R°£®eÅé %3" + IDS_ACTION_MOVEFILESET "±N®eÅé %3 ²¾¦Ü¤À³Î°Ï %1:%2" + IDS_ACTION_SETFILESETQUOTA "Åܧó®eÅé %3 ªº°tÃB" + IDS_SVCSTOP_DESC2 "«ö¡u½T©w¡v¥H°±¤î³o¶µªA°È¡C" + IDS_SVCSTART_DESC2 "½Ð«ö¡u½T©w¡v¥H±Ò°Ê¥»ªA°È¡C" + IDS_SYNCVLDB_SVR_DESC "ĵ§i¡I\n\n¦pªG±zÄ~Äò¡A¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v·|­×§ï VLDB ¥H²Å¦X¦øªA¾¹ %1 ¤Wªº©Ò¦³¤À³Î°Ï¤º®e¡C" + IDS_SYNCVLDB_SVR_DESC2 "­Y VLDB ©Ò´£¨ìªº®eÅ饨«e°ò©ó¥ô¦ó¦]¯À¡AµLªk¦b¦øªA¾¹ %1 ¤Wªº¤À³Î°Ï§ä¨ì¡A¸Ó®eÅ骺 VLDB ¶µ¥Ø´N·|³Q§R°£¡I" + IDS_SYNCVLDB_AGG_DESC "ĵ§i¡I\n\n¦pªG±zÄ~Äò¡A¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v´N·|­×§ï VLDB ¥H²Å¦X¦øªA¾¹ %1 ¤§¤À³Î°Ï %2 ªº¤º®e¡C" + IDS_SYNCVLDB_AGG_DESC2 "­Y VLDB ©Ò´£¨ìªº®eÅ饨«e°ò©ó¥ô¦ó¦]¯À¡AµLªk¦b¥»¤À³Î°Ï¤W§ä¨ì¡A¸Ó®eÅ骺 VLDB ¶µ¥Ø´N·|³Q§R°£¡I" + IDS_PROMPT_BROWSE_USER "¨Ï¥ÎªÌ¡G" + IDS_PREVIEWIN_BUTTON "<< ¹wÄý(&P)" + IDS_PREVIEWOUT_BUTTON "¹wÄý(&P) >>" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ADMCOL_TYPE_USER "¨Ï¥ÎªÌ" + IDS_TITLE_BROWSE_PRINCIPAL "¿ï¨ú¥DÅé" + IDS_TITLE_BROWSE_OWNGROUP "¿ï¨ú¾Ö¦³ªº¸s²Õ" + IDS_PROMPT_BROWSE_PRINCIPAL "¥DÅé¡G" + IDS_PROMPT_BROWSE_OWNGROUP "¾Ö¦³¸s²Õ¡G" + IDS_ACTION_CLONE "«Ø¥ß®eÅé %3 ªº³Æ¥÷ª©¥»" + IDS_ACTION_CLONESYS "«Ø¥ß¦h­«ªº®eÅ鳯¥÷" + IDS_CLONESYS_FAILED "¦]µo¥Í¿ù»~ 0x%2 (%3) ¦ÓµLªk«Ø¥ß®eÅé %1 ªº³Æ¥÷¡C" + IDS_SET_UNSPECIFIED "¡]¥¼¸ü©úªº¡^" + IDS_SETCOL_ID "ID" + IDS_SETCOL_FILES "ÀÉ®×­p¼Æ" + IDS_SET_DUMP_NAME "%1.DMP ªº¶É¥X" + IDS_ACTION_DUMP "¶É¥X®eÅé %3¡]¤À³Î°Ï %1:%¡^" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FILESETNAME_ERROR "%1 - %2" + IDS_SETCOL_AGGREGATE "¤À³Î°Ï" + IDS_REFRESH_DESC_CELL "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¥¿¦b¨M©w %1 Cell ¤¤¤§¦øªA¾¹ªºª¬ºA¡C³o¥i¯à­nªá´X¤ÀÄÁ®É¶¡..." + IDS_REFRESH_DESC_SERVER "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¥¿¦b¨M©w¦øªA¾¹ %1 ªºª¬ºA¡C³o¥i¯à­nªá´X¤ÀÄÁ®É¶¡ ..." + IDS_REFRESH_CURRENT_CELL "¥Ø«e¥¿¦bÀˬd¡GCell %1" + IDS_REFRESH_CURRENT_SERVER "¥Ø«e¥¿¦bÀˬd¡G¦øªA¾¹ %2" + IDS_REFRESH_CURRENT_AGGREGATE "¥Ø«e¥¿¦bÀˬd¡G¦øªA¾¹ %2 ¤Wªº¤À³Î°Ï %3" + IDS_REFRESH_CURRENT_FILESET + "¥Ø«e¥¿¦bÀˬd¡G¦øªA¾¹ %2 ¤Wªº®eÅé %4¡A¤À³Î°Ï %3" + IDS_REFRESH_CURRENT_SERVICE "¥Ø«e¥¿¦bÀˬd¡G¦øªA¾¹ %2 ¤WªºªA°È %3" + IDS_REFRESH_PERCENT "%1%% ¤w§¹¦¨" + IDS_PROBLEMS "°ÝÃD" + IDS_SERVER_NO_PROBLEMS "³o­Ó¦øªA¾¹¨S¦³¤wª¾ªº°ÝÃD¡C" + IDS_SERVICE_NO_PROBLEMS "³o¶µªA°È¨S¦³¤wª¾ªº°ÝÃD¡C" + IDS_AGGREGATE_NO_PROBLEMS "³o­Ó¤À³Î°Ï¨S¦³¤wª¾ªº°ÝÃD¡C" + IDS_FILESET_NO_PROBLEMS "³o­Ó®eÅé¨S¦³¤wª¾ªº°ÝÃD¡C" + IDS_AGGTYPE_TYPE1 "UFS" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGGTYPE_TYPE2 "LFS" + IDS_AGGTYPE_TYPE3 "AIX" + IDS_AGGTYPE_TYPE4 "VXFS" + IDS_AGGTYPE_TYPE5 "DMEPI" + IDS_REFRESH_CURRENT_VLDB "¥Ø«e¥¿¦bÀˬd¡G®eÅé¦ì¸m¸ê®Æ®w (VLDB)" + IDS_FILESETTYPE_RW "Ū¨ú/¼g¤J" + IDS_FILESETTYPE_RO "½Æ¥»" + IDS_FILESETTYPE_CLONE "³Æ¥÷" + IDS_MOVESET_READWRITE "¦pªGÄ~Äò¡A®eÅé %3 ·|±q¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ²¾°Ê¨ì¥t¤@­Ó¦ì¸m¡C" + IDS_MOVESET_READONLY "¦pªGÄ~Äò¡A®eÅ齯¥» %3 ±N·|±q¦øªA¾¹ %1 ¤À³Î°Ï %2 ²¾°£¡A¦Ó¥t¤@­Ó¦b±z©ó¥H¤U©Ò«ü©w¤§¤À³Î°Ï¤W©Ò«Ø¥ßªº®eÅ齯¥»¤]·|³Q²¾°£¡C" + IDS_SVC_START_TITLE "±Ò°ÊªA°È" + IDS_SVC_STOP_TITLE "°±¤îªA°È" + IDS_SERVICESTATUS_STARTING "¥Ø«e¥¿¦b±Ò°Ê¦¹ªA°È¡C" + IDS_SERVICESTATUS_RUNNING "¥Ø«e¥¿¦b°õ¦æ¦¹ªA°È¡C" + IDS_SERVICESTATUS_STOPPED "¥Ø«e¤w°±¤î¦¹ªA°È¡C" + IDS_SERVICESTATUS_STOPPING "¥Ø«e¥¿¦b°±¤î¦¹ªA°È¡C" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICESTATUS_UNKNOWN "¦¹ªA°Èªºª¬ºA¤£©ú¡C" + IDS_SVC_RESTART_BUTTON "¥ß§Y°±¤î¨Ã­«·s±Ò°Ê(&R)" + IDS_PROBLEM_BOX "¤wª¾ªº°ÝÃD (%1)" + IDS_VIEWLOG_DESC_NOFILE "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v§ä¤£¨ì¦øªA¾¹ %1 ¤§ªA°È %2 ªº¤é»xÀÉ¡C½Ð¦b¤U¤è¿é¤JªA°È¤§¤é»xÀɪº§¹¾ã¸ô®|¡C" + IDS_NO_GROUP "¡]¨S¦³¾Ö¦³ªº¸s²Õ¡^" + IDS_VIEWLOG_FROMSERVER "¦øªA¾¹ %1 ¤Wªº¤é»xÀÉ" + IDS_VIEWLOG_FROMSERVICE "¦øªA¾¹ %1 ¤§ªA°È %2 ªº¤é»xÀÉ" + IDS_VIEWLOG_TRUNCATED "Àɮפº®e¡]¥uÅã¥Ü³Ì«á %1 ¦æ¡^¡G" + IDS_SAVELOG_FILTER "Text File|*.TXT|" + IDS_ADVANCEDIN_BUTTON "<< ¶i¶¥(&A)" + IDS_ADVANCEDOUT_BUTTON "¶i¶¥(&A) >>" + IDS_REPTYPE_RELEASE "ÄÀ©ñ½Æ»s" + IDS_REPTYPE_SCHEDULED "¤w±Æ©wªº½Æ»s" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_UPDATEALL_BUTTON "¥þ³¡§ó·s(&U)" + IDS_UPDATETHIS_BUTTON "§ó·s(&U)" + IDS_SERVER_MULTIPLE_PROBLEMS "¦¹¦øªA¾¹¦³ %1 ªº¤wª¾°ÝÃD¡C" + IDS_SERVICE_MULTIPLE_PROBLEMS "¦¹ªA°È¦³ %1 ªº¤wª¾°ÝÃD¡C" + IDS_AGGREGATE_MULTIPLE_PROBLEMS "¦¹¤À³Î°Ï¦³ %1 ªº¤wª¾°ÝÃD¡C" + IDS_FILESET_MULTIPLE_PROBLEMS "¦¹®eÅ馳 %1 ¤wª¾ªº°ÝÃD¡C" + IDS_FILESETTYPE_RO_STAGE "½Æ¥»" + IDS_SERVICETYPE_SIMPLE_LONG "²¦¡¡]«ùÄò°õ¦æ¡^" + IDS_SERVICETYPE_CRON_LONG "Cron¡]¥H«ü©w¶¡¹j°õ¦æ¡^" + IDS_QUOTAUNITS_KB "kb" + IDS_QUOTAUNITS_MB "MB" + IDS_NO_QUOTA_REPLICA "¡]¦¹®eÅ鬰½Æ¥»¡A¦]¦¹¨S¦³°tÃB¡^" + IDS_NO_QUOTA_CLONE "¡]¦¹®eÅ鬰³Æ¥÷¡A¦]¦¹¨S¦³°tÃB¡^" + IDS_USAGE_REPLICA "%1 ¤w¨Ï¥Î" + IDS_USAGE_CLONE "%1 ¤w¨Ï¥Î" + IDS_COL_AGGS_MOVE "«Ø¥ß®eÅé®Éªº¤À³Î°Ï" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PERCENTAGE "%1 %%" + IDS_AGGREGATES_IN_SERVER "¦øªA¾¹ %1 ¤Wªº¤À³Î°Ï¡G " + IDS_AGGREGATES_IN_CELL "Cell %1 ¤¤ªº©Ò¦³¤À³Î°Ï¡G" + IDS_AGGREGATES_IN_NOTHING "¤À³Î°Ï¡G" + IDS_FILESETS_IN_SERVER "¦øªA¾¹ %1 ¤Wªº®eÅé¡G" + IDS_FILESETS_IN_CELL "Cell %1 ¤¤ªº©Ò¦³®eÅé¡G" + IDS_FILESETS_IN_NOTHING "®eÅé¡G" + IDS_SERVICES_IN_SERVER "¦øªA¾¹ %1 ¤WªºªA°È¡G" + IDS_SERVICES_IN_NOTHING "ªA°È¡G" + IDS_UNKNOWN "¡]¤£©ú¡^" + IDS_UNKNOWN_GROUP "¸s²Õ¸¹½X %1¡]¦WºÙ¤£©ú¡^" + IDS_AGGFULL_WARN_OFF "¹w³]Á{¬É­È¡]¦øªA¾¹ªºÄµ§i¤w°±¥Î¡^" + IDS_SERVER_AGGREGATE "%1:%2" + IDS_SERVERNAME_ERROR "%1 - %2" + IDS_AGGREGATENAME_ERROR "%1 - %2" + IDS_SETFULL_WARN_OFF "¹w³]Á{¬É­È¡]¦øªA¾¹¤WªºÄµ§i¤w°±¥Î¡^" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_LASTERRORDATE "%1 - ¥X¤f½X %2" + IDS_COL_SERVERS "Cell ¤Wªº¦øªA¾¹" + IDS_COL_FILESETS "¦øªA¾¹¤Wªº®eÅé" + IDS_COL_AGGREGATES "¦øªA¾¹¤Wªº¤À³Î°Ï" + IDS_COL_SERVICES "¦øªA¾¹¤WªºªA°È" + IDS_COL_REPLICAS "®eÅ骺½Æ¥»" + IDS_COLUMNS_TITLE "¿ï¨úÅã¥Üª½Äæ - AFS ¦øªA¾¹ºÞ²zµ{¦¡" + IDS_REPCOL_SERVER "¦øªA¾¹" + IDS_REPCOL_AGGREGATE "¤À³Î°Ï" + IDS_REPCOL_DATE_UPDATE "¤W¦¸§ó·s" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COL_AGGS_CREATE "²¾°Ê®eÅé®Éªº¤À³Î°Ï" + IDS_WARN_TITLE "ĵ§i" + IDS_WARN_DISABLE_AUTH "±z­Y«ö¤@¤U""¤¹³\¤£°µÅ²§O""«ö¶s¡A¥¼Å²§Oªº¥DÅé´N·|Àò±o¤¹³\¾Þ§@¦¹¦øªA¾¹¤WªºªA°È¡C¥Ñ©ó«Ü¦hªA°È¦b root ¨­¥÷¤§¤U°õ¦æ¡A¦]¦¹³o­Ó°Ê§@ªí¥Ü +" + IDS_WARN_DISABLE_AUTH2 "¦øªA¾¹ªº¦w¥þ©Ê¦³©úÅ㪺·å²«¡C\n\n±z½T©w­n°µ¦¹Åܧó¶Ü¡H" + IDS_SVR_NO_ADDR "¡]¥¼¸ü©úªº¡^" + IDS_TITLE_BAD_CELL "µLªkÃѧOªº Cell ¦WºÙ" + IDS_DESC_BAD_CELL "±z©Ò¿é¤Jªº Cell ¦WºÙµLªk¦bºô¸ô¤W§ä¨ì¡C\n\n½Ð½T©w±z©Ò¿é¤Jªº¶µ¥Ø¬O§_¥¿½T¡C" + IDS_AGGFULL_WARN_ON "¥»¦øªA¾¹ªº¹w³]Á{¬É­È(&D) ¡]¨ä¤j¤pªº %1%%¡^" + IDS_SETFULL_WARN_ON "¥»¦øªA¾¹ªº¹w³]Á{¬É­È(&D) ¡]¨ä¤j¤pªº %1%%¡^" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVR_ERROR_BAD_CREDENTIALS + "µLªkÃѧO±z©Ò¿é¤Jªº AFS ¨­¥÷¡A©Î¬O±z©Ò«ü©wªº±K½X¦³»~¡C" + IDS_SVR_CREDS_NONE "¡]¨S¦³°O¸¹¡^" + IDS_SVR_CREDS_VALID "%2, ¹L´Á %3" + IDS_SVR_CREDS_EXPIRED "¡]°O¸¹¤w¹L´Á %3¡^" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AGG_FILESETS "%1 ¡]¥[Á`ªº°tÃB¡G %2¡^" + IDS_ACTION_DESC_NONE "¨S¦³¥¿¦b¶i¦æªº§@·~¡C" + IDS_ACTION_DESC_ONE "¤U¦Cªº§@·~¥Ø«e¥¿¦b¶i¦æ¡G" + IDS_ACTION_DESC_MULT "¥Ø«e¥¿¦b¶i¦æ¥H¤Uªº§@·~¡G" + IDS_ACTCOL_OPERATION "§@·~" + IDS_ACTCOL_ELAPSED "¸g¾ú®É¶¡" + IDS_ACTION_REFRESH "­«·s¾ã²z Cell ¸ê°T" + IDS_ACTION_CREATESERVER "«Ø¥ß¦øªA¾¹ %1" + IDS_ACTION_DELETESERVER "¥¿¦b§R°£¦øªA¾¹ %1" + IDS_ACTION_GETSERVERLOGFILE "¥¿¦V¦øªA¾¹ %1 ¨ú±o¤é»xÀÉ %2" + IDS_ACTION_SETSERVERAUTH "¥¿¦bÅÜ§ó¦øªA¾¹ %1 ªº¦s¨ú­­¨î" + IDS_ACTION_CHANGESERVERSTATUS "ÅÜ§ó¦øªA¾¹ %1 ªº¤º®e" + IDS_ACTION_STARTSERVICE "¥¿¦b±Ò°Ê¦øªA¾¹ %1 ªºªA°È %2" + IDS_ACTION_STOPSERVICE "¥¿¦b°±¤î¦øªA¾¹ %1 ¤WªºªA°È %2" + IDS_ACTION_RESTARTSERVICE "­«·s±Ò°Ê¦øªA¾¹ %1 ¤WªºªA°È %2" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SYNCVLDB_SVR "±N VLDB »P¦øªA¾¹ %1 ¶i¦æ¦P¨B" + IDS_ACTION_SYNCVLDB_AGG "±N VLDB »P¤À³Î°Ï %1:%2 ¶i¦æ¦P¨B" + IDS_ACTION_SCOUT "Àˬd¦øªA¾¹ %1 ªº°ÝÃD" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_SETREPPARAMS "Åܧó®eÅé %3 ªº½Æ»s¤º®e" + IDS_ACTION_CREATEREPLICA "¦b¤À³Î°Ï %1:%2 «Ø¥ß®eÅé %3 ªº½Æ¥»" + IDS_DELSET_REPLICA_DESC "ĵ§i¡I\n\n¦pªGÄ~Äò¡A±N¾É¦Ü¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº®eÅé %3 ½Æ¥»³Q²¾°£¡C" + IDS_DELSET_CLONE_DESC "ĵ§i¡I\n\n¦pªGÄ~Äò¡A±N¾É¦Ü®eÅ鳯¥÷ %3 ±q¦øªA¾¹ %1 ¤À³Î°Ï %2 ³Q²¾°£¡C" + IDS_INSTALL_DESC1 "¥»§@·~±NÀÉ®×±q¦¹¹q¸£½Æ»s¨ì¥t¤@¥x¹q¸£¤W¡C +" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_INSTALL_DESC2 "¦pªGÀɮפw¦s©ó¥Ø¼Ð¹q¸£¡A´N·|²£¥Í¤@­Ó°ÆÀɦW¬° .BAK ªº³Æ¥÷¡F¦Ó²{¦³ªº³Æ¥÷·|µ¹»P .OLD °ÆÀɦW¡A¨Ã±N¥ô¦ó°ÆÀɦW¬° .OLD ªº²{¦sÀÉ®×§R°£¡C" + IDS_ACTION_INSTALLFILE "±NÀÉ®× %2 ¦w¸Ë©ó¦øªA¾¹ %1" + IDS_ACTION_UNINSTALLFILE "±NÀÉ®× %2 ±q¦øªA¾¹ %1 ¤W¸Ñ°£¦w¸Ë" + IDS_ACTION_PRUNEFILES "±NÀÉ®×±q¦øªA¾¹ %1 §R°£" + IDS_FILTER_ALLFILES "©Ò¦³ÀÉ®×|*.*|" + IDS_ACTION_RENAMEFILESET "±N®eÅé %1 ­«·s©R¦W¬° %2" + IDS_RECUR_DAILY "¨C¤Ñ" + IDS_RECUR_SUNDAY "¨C¬P´Á¤Ñ" + IDS_RECUR_MONDAY "¨C¬P´Á¤@" + IDS_RECUR_TUESDAY "¨C¬P´Á¤G" + IDS_RECUR_WEDNESDAY "¨C¬P´Á¤T" + IDS_RECUR_THURSDAY "¨C¬P´Á¥|" + IDS_RECUR_FRIDAY "¨C¬P´Á¤­" + IDS_RECUR_SATURDAY "¨C¬P´Á¤»" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CREATESERVICE "¦b¦øªA¾¹ %1 ¤W«Ø¥ßªA°È %2" + IDS_ACTION_DELETESERVICE "±NªA°È %2 ±q¦øªA¾¹ %1 ¤W§R°£" + IDS_ACTION_RELEASEFILESET "ÄÀ©ñ®eÅé %3" + IDS_ACTION_GETDATES "±q¦øªA¾¹ %1 ¤W¨ú±oÀÉ®× %2 ªº¤é´Á" + IDS_LASTMODIFIED "¤W¦¸­×§ï %1" + IDS_SVR_SECURITY_TITLE "¦øªA¾¹¦w¥þ©Ê - %1" + IDS_SVR_LIST_TAB "ºÞ²z­û" + IDS_ACTION_ADMINLIST_LOAD "¨ú±o¦øªA¾¹ %1 ªººÞ²z­û" + IDS_ACTION_ADMINLIST_SAVE "¼g¤J¦øªA¾¹ %1 ªººÞ²z­û" + IDS_ADMCOL_PRINCIPAL "¦¨­û" + IDS_ADMCOL_TYPE "Ãþ«¬" + IDS_ADMCOL_TYPE_GROUP "¸s²Õ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_RESTORE "´_­ì®eÅé %1" + IDS_COL_AGGS_RESTORE "´_­ì®eÅé®Éªº¤À³Î°Ï" + IDS_RESTORE_FILTER "®eÅé¶É¥XÀÉ®×|*.DMP|©Ò¦³ÀÉ®×|*.*|" + IDS_SVC_BOS_TAB "BOS" + IDS_ACTION_SETRESTART "ÅÜ§ó¦øªA¾¹ %1 ªºªA°È±Ò°Ê®É¶¡" + IDS_RESTORE_CREATESET "®eÅé %1 ±N©ó±z¦b¤U¤è©Ò«ü©w¤§¦øªA¾¹»P¤À³Î°Ï¤W«Ø¥ß¡C" + IDS_RESTORE_OVERWRITESET + "ĵ§i¡I ®eÅé %3 ¦s¦b©ó¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W¡A¦pªG±zÄ~Äòªº¸Ü¡A¸Ó®eÅé±N·|³Q§ï¼g¡I" + IDS_SUBSET_TITLE_LOAD "¶}±Ò¦øªA¾¹¤l¶°" + IDS_SUBSET_TITLE_SAVE "Àx¦s¦øªA¾¹¤l¶°" + IDS_BUTTON_OPEN "¶}±ÒÂÂÀÉ(&O)" + IDS_BUTTON_SAVE "Àx¦s(&S)" + IDS_SUBSET_SAVE_TITLE "ĵ§i" + IDS_SUBSET_SAVE_DESC "¦W¬° %1 ªº¦øªA¾¹¤l¶°¤w¸g¦s¦b¡C\n\n±z­n§ï¼g³o­Ó¤l¶°¶Ü¡H" + IDS_SUBSET_CHANGED "%1 [­×§ï]" + IDS_SUBSET_TAB "ºÊµø¦øªA¾¹" + IDS_SUBSET_DISCARD_TITLE "Àx¦s¤l¶°¶Ü¡H" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SUBSET_DISCARD_DESC "±z©|¥¼±N¥Ø«e©ÒºÊµøªº¦øªA¾¹²M³æÀx¦s¬°¤l¶°¡C­Y±zÀx¦s¦¹²M³æ¡A§Y¥i¦bµy«áÄ~ÄòºÊµø³o¨Ç¦øªA¾¹¡C\n\n+" + IDS_SUBSET_DISCARD_DESC2 + "±z­n«Ø¥ß¤@­Ó¥]§t¥Ø«e¥¿ºÊµø¤§¦øªA¾¹²M³æªº¤l¶°¶Ü¡H" + IDS_SUBSET_NONAME "¡]¥¼©R¦W¡^" + IDS_SUBSET_NOSUBSET "¡]©Ò¦³ªº¦øªA¾¹³£¦bºÊµøª¬ºA¤U¡^" + IDS_SUBSET_SERVERSUBSET "¦øªA¾¹ %1" + IDS_FILESET_SOME "Cell %1 ¤¤©Ò¦³³QºÊµøªº¦øªA¾¹®eÅé¡G" + IDS_AGGREGATE_SOME "Cell %1 ¤¤©Ò¦³³QºÊµøªº¦øªA¾¹¤À³Î°Ï¡G" + IDS_SERVICE_SOME "Cell %1 ¤¤©Ò¦³³QºÊµøªº¦øªA¾¹ªA°È¡G" + IDS_FILESET_UNMON "¥¼ºÊµø¦øªA¾¹ %1 " + IDS_AGGREGATE_UNMON "¥¼ºÊµø¦øªA¾¹ %1 " + IDS_SERVICE_UNMON "¥¼ºÊµø¦øªA¾¹ %1 " + IDS_SUBSET_DELETE_TITLE "§R°£¤l¶°¶Ü¡H" + IDS_SUBSET_DELETE_DESC "±z½T©w­n§R°£¦øªA¾¹¤l¶° %1¡H" + IDS_ERROR_TRANSLATED "¿ù»~½X 0x%1 (%2)¡G\n\n%3" + IDS_ERROR_NOTTRANSLATED "¿ù»~½X 0x%1 (%2) µLªkÃѧO¡C" + IDS_FIND_NOTHING_TITLE "¥¼¿ï¨ú«ü¥O" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FIND_NOTHING_DESC "¦p­n§ä¥X°õ¦æ§@·~ªº¤èªk¡A­º¥ý½Ð±q²M³æ¤¤¿ï¨ú¤@­Ó«ü¥O¦æ¡A©Î¬OÁä¤JÃöÁä¦r¡C" + IDS_FIND_UNKNOWN_TITLE "¤£©ú«ü¥O" + IDS_FIND_UNKNOWN_DESC "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v§ä¤£¨ì ""%1"" «ü¥Oªº»¡©ú¥DÃD¡C" + IDS_HELPABOUT_DESC1 "ĵ§i¡G¦¹¹q¸£µ{¦¡¨üµÛ§@Åv»P°ê»Úªk³Wªº«OÅ@¡C +" + IDS_HELPABOUT_DESC2 "¥¼¸g±ÂÅv¦Ó½Æ»s©Î¤À°e¦¹³nÅé±N¾É­PÄY­«ªº¥Á¨Æ»P¦D¨Æ³B¤À¡A¨Ã±N¨Ìªk§@³ÌÄY¼Fªº³B¤À¡C\n\n+" + IDS_HELPABOUT_DESC3 "AFS ¬O¤@®a IBM ¤½¥q¡ATransarc Corporation ªº°Ó¼Ð¡C" + IDS_CANT_QUIT_TITLE "AFS ¦øªA¾¹ºÞ²zµ{¦¡" + IDS_CANT_QUIT_REBOOT "ĵ§i¡I\n\n¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¥Ø«e¥¿¦b°õ¦æ¤@©Î¼Æ¶µ§@·~¡C¦pªG±z²{¦bÃö³¬ Windows¡A³o¨Ç§@·~±NµLªk¶¶§Q§¹¦¨¡C\n\n±z½T©w­n­«·s±Ò°Ê Windows ¶Ü¡H" + IDS_APP_TITLE "AFS ¦øªA¾¹ºÞ²zµ{¦¡" + IDS_ACTION_OPENCELL "¦b %1 Cell ¤W´M§ä¦øªA¾¹" + IDS_OPTIONS_TITLE "¿ï¶µ - AFS ¦øªA¾¹ºÞ²zµ{¦¡" + IDS_OPTIONS_GENERAL_TAB "¤@¯ë¨Æ¶µ" + IDS_BADCREDS_DESC "°£«D±z¥HºÞ²z­ûªº¨­¥÷µn¤J¡A§_«h±zªºÅv­­±N¤£¨¬¥H¶¶§QºÞ²z %1 Cell¡C¦s¨úÅv¦pªG¤£¨¬¡A¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v·|¦b Cell ¨S¦³°ÝÃDªº±¡ªp¤U¡A¨ÌµMµo²{°ÝÃD¡C" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CONFIRMATION_TITLE "½T»{ - AFS ¦øªA¾¹ºÞ²zµ{¦¡" + IDS_NO_GROUP_CHECKBOX "¨S¦³¾Ö¦³ªº¸s²Õ" + IDS_AFS_ID_DIDEXP "%1 ¡]°O¸¹¹L´Á %2¡^" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_QUERYING "¡]¬d¸ß¡^" + IDS_ADMCOL_TYPE_FOREIGN_GROUP "¥~³¡¸s²Õ" + IDS_ADMCOL_TYPE_FOREIGN_USER "¥~³¡¨Ï¥ÎªÌ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SVCCOL_NOTIFIER "³qª¾ªÌ" + IDS_SVC_NONOTIFIER "¡]µL¡^" + IDS_SVR_KEY_TAB "¦øªA¾¹ª÷Æ_" + IDS_KEYNAME_NOTIME "¦øªA¾¹ %1 ªº«öÁä¡G" + IDS_KEYNAME_WITHTIME "¦øªA¾¹ %1 ªº«öÁä¡]¤w­×§ï %2¡^¡G" + IDS_SVRKEY_VERSION "ª©¥»" + IDS_SVRKEY_DATA "­È" + IDS_SVRKEY_CHECKSUM "Àˬd¶q" + IDS_SVRKEY_DATA_UNKNOWN "¡]ÁôÂá^" + IDS_STARTSERVICE_TITLE "±Ò°ÊªA°È" + IDS_STOPSERVICE_TITLE "°±¤îªA°È" + IDS_STARTSERVICE_TEXT "«ö¤@¤U¡u½T©w¡v¥H±Ò°Ê¦øªA¾¹ %1 ¤WªºªA°È %2¡C" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_STOPSERVICE_TEXT "«ö¤@¤U¡u½T©w¡v¥H°±¤î¦øªA¾¹ %1 ¤WªºªA°È %2¡C" + IDS_STARTSERVICE_STARTUP + "±z¥i¥H§â¥¦Åܦ¨¥Ã¤[Åܧó¡A³o¼Ë¦øªA¾¹ %2 ´N·|¦b¦øªA¾¹ %1 ­«·s±Ò°Ê®É¦Û°Ê±Ò°Ê¡C" + IDS_STOPSERVICE_STARTUP "±z¥i¥H§â¥¦Åܦ¨¥Ã¤[Åܧó¡A³o¼ËªA°È %2 ´N¤£·|¦b¦øªA¾¹ %1 ­«·s±Ò°Ê®É¦Û°Ê±Ò°Ê¡C" + IDS_STARTSERVICE_PERMANENT + "¥Ã¤[(&P)¡]¦øªA¾¹ %1 ­«·s±Ò°Ê®É¡A§Y±Ò°ÊªA°È %2¡^" + IDS_STARTSERVICE_TEMPORARY + "¼È®É(&T)¡]¦øªA¾¹ %1 ­«·s±Ò°Ê®É¡A¤£­n±Ò°ÊªA°È %2¡^" + IDS_STOPSERVICE_PERMANENT + "¥Ã¤[(&P)¡]¦øªA¾¹ %1 ­«·s±Ò°Ê®É¡A¤£­n±Ò°ÊªA°È %2¡^" + IDS_STOPSERVICE_TEMPORARY + "¼È®É(&T)¡]¦øªA¾¹ %1 ­«·s±Ò°Ê®É¡A§Y±Ò°ÊªA°È %2¡^" + IDS_ACTION_EXECUTE "°õ¦æ¦øªA¾¹ %1 ¤Wªº %2" + IDS_ACTION_SALVAGE_SVR "´©±Ï¦øªA¾¹ %1 ¤Wªº©Ò¦³®eÅé" + IDS_ACTION_SALVAGE_AGG "´©±Ï¤À³Î°Ï %1:2 ¤Wªº©Ò¦³®eÅé" + IDS_ACTION_SALVAGE_VOL "´©±Ï¤À³Î°Ï %1:2 ¤Wªº®eÅé %3" + IDS_SALVAGE_SVR "´©±Ï¦øªA¾¹ %1 ¤Wªº©Ò¦³®eÅé" + IDS_SALVAGE_AGG "´©±Ï¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº©Ò¦³®eÅé" + IDS_SALVAGE_SET "´©±Ï¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº®eÅé %3" + IDS_SETSTATUS_SALVAGE "§Q¥Î®eÅé" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SETSTATUS_LOCKED "®eÅé¤wÂê©w" + IDS_SETSTATUS_NO_VOL "®eÅé¿òº|" + IDS_SETSTATUS_BUSY "®eÅ饨«e¦£¸L¤¤" + IDS_SETSTATUS_MOVED "®eÅé¤w²¾°Ê" + IDS_SVR_CAPACITY "%1" + IDS_SVR_ALLOCATION "%1 (%2%%)" + IDS_SVRCOL_ADDRESS "¦ì§}" + IDS_HOST_TITLE "¦øªA¾¹ %1 ©Ò¿ëÃѪº¸ê®Æ®w¥D¹q¸£¦øªA¾¹¡G" + IDS_SVR_HOSTS_TITLE "¦øªA¾¹ %1 - ¸ê®Æ®w¥D¹q¸£" + IDS_SVR_HOST_TAB "¸ê®Æ®w¥D¹q¸£" + IDS_ACTION_HOSTLIST_LOAD "±q¦øªA¾¹ %1 ¨ú±o¥D¹q¸£²M³æ" + IDS_ACTION_HOSTLIST_SAVE "±N¥D¹q¸£²M³æ¼g¤J¦øªA¾¹ %1" + IDS_SETSTATUS_1ALERT "®eÅ馳¤@­Ó°ÝÃD" + IDS_SETSTATUS_2ALERT "®eÅ馳 %1 °ÝÃD" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACTION_CHANGEADDR "ÅÜ§ó¦øªA¾¹ %1 ªº IP ¦ì§}" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_ADDSITE "vos addsite" + IDS_COMMAND_VOS_BACKUP "vos backup" + IDS_COMMAND_VOS_BACKUPSYS "vos backupsys" + IDS_COMMAND_VOS_CREATE "vos create" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_DELENTRY "vos delentry" + IDS_COMMAND_VOS_DUMP "vos dump" + IDS_COMMAND_VOS_EXAMINE "vos examine" + IDS_COMMAND_VOS_LISTPART "vos listpart" + IDS_COMMAND_VOS_LISTVLDB "vos listvldb" + IDS_COMMAND_VOS_LISTVOL "vos listvol" + IDS_COMMAND_VOS_LOCK "vos lock" + IDS_COMMAND_VOS_MOVE "vos move" + IDS_COMMAND_VOS_PARTINFO "vos partinfo" + IDS_COMMAND_VOS_RELEASE "vos release" + IDS_COMMAND_VOS_REMOVE "vos remove" + IDS_COMMAND_VOS_REMSITE "vos remsite" + IDS_COMMAND_VOS_RENAME "vos rename" + IDS_COMMAND_VOS_RESTORE "vos restore" + IDS_COMMAND_VOS_SYNCVLDB "vos syncvldb" + IDS_COMMAND_VOS_UNLOCK "vos unlock" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_VOS_UNLOCKVLDB "vos unlockvldb" + IDS_COMMAND_VOS_ZAP "vos zap" + IDS_COMMAND_BOS_ADDHOST "bos addhost" + IDS_COMMAND_BOS_ADDKEY "bos addkey" + IDS_COMMAND_BOS_ADDUSER "bos adduser" + IDS_COMMAND_BOS_CREATE "bos create" + IDS_COMMAND_BOS_DELETE "bos delete" + IDS_COMMAND_BOS_EXEC "bos exec" + IDS_COMMAND_BOS_GETDATE "bos getdate" + IDS_COMMAND_BOS_GETLOG "bos getlog" + IDS_COMMAND_BOS_GETRESTART "bos getrestart" + IDS_COMMAND_BOS_INSTALL "bos install" + IDS_COMMAND_BOS_LISTHOSTS "bos listhosts" + IDS_COMMAND_BOS_LISTKEYS "bos listkeys" + IDS_COMMAND_BOS_LISTUSERS "bos listusers" + IDS_COMMAND_BOS_PRUNE "bos prune" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_BOS_REMOVEHOST "bos removehost" + IDS_COMMAND_BOS_REMOVEKEY "bos removekey" + IDS_COMMAND_BOS_REMOVEUSER "bos removeuser" + IDS_COMMAND_BOS_RESTART "bos restart" + IDS_COMMAND_BOS_SALVAGE "bos salvage" + IDS_COMMAND_BOS_SETAUTH "bos setauth" + IDS_COMMAND_BOS_SETRESTART "bos setrestart" + IDS_COMMAND_BOS_SHUTDOWN "bos shutdown" + IDS_COMMAND_BOS_START "bos start" + IDS_COMMAND_BOS_STARTUP "bos startup" + IDS_COMMAND_BOS_STATUS "bos status" + IDS_COMMAND_BOS_STOP "bos stop" + IDS_COMMAND_BOS_UNINSTALL "bos uninstall" + IDS_COMMAND_KAS_GETRANDOMKEY "kas getrandomkey" + IDS_COMMAND_FS_LISTQUOTA "fs listquota" + IDS_COMMAND_FS_QUOTA "fs quota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COMMAND_FS_SETQUOTA "fs setquota" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCSHORT_UNMONITORED "¥¼ºÊµø¦øªA¾¹ %1 ¬O§_¦³°ÝÃD" + IDS_ALERT_DESCSHORT_TIMEOUT "µLªk»P¦øªA¾¹ %1 ¨ú±oÁpô¡F¤W­Ó¿ù»~¡G%3" + IDS_ALERT_DESCSHORT_AGG_FULL "%2 ¤À³Î°Ïªº¨Ï¥Î¶W¹Lĵ§iªºÁ{¬É­È %3%% (%4)" + IDS_ALERT_DESCSHORT_SET_FULL "%3 ®eÅ骺¨Ï¥Î¶W¹Lĵ§iªºÁ{¬É­È %4%% (%5)" + IDS_ALERT_DESCSHORT_NO_VLDBENT "®eÅé %3 ¨S¦³ VLDB ¶µ¥Ø" + IDS_ALERT_DESCSHORT_NO_SVRENT_SET + "®eÅé %3 ¨ã¦³ VLDB ¶µ¥Ø¡A¦ý¬O¦b¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W§ä¤£¨ì" + IDS_ALERT_DESCSHORT_STOPPED "ªA°È %2 ¤w¦b %3 °±¤î" + IDS_ALERT_DESCSHORT_NO_SVRENT_AGG + "VLDB »P¤À³Î°Ï %2 ¬ÛÃö¡A¦ý«o¥¼¦b¦øªA¾¹ %1 ¤W§ä¨ì" + IDS_ALERT_DESCSHORT_BADCREDS "±zªºÅv­­¤£¨¬¥HºÞ²z¦øªA¾¹ %1" + IDS_ALERT_DESCSHORT_AGG_ALLOC "¤À³Î°Ï %2 ¤Wªº¥[Á`®eÅé°tÃB¶W¹L¨ä®e¶q" + IDS_ALERT_DESCSHORT_STATE_NO_VNODE "%3 ®eÅé¦]¨ü·l¦ÓµLªk¨Ï¥Î¡C" + IDS_ALERT_DESCSHORT_STATE_NO_SERVICE + "¦øªA¾¹®eÅé %3 ¤W¨S¦³¥¿¦b°õ¦æªºªA°È¡C" + IDS_ALERT_DESCSHORT_STATE_OFFLINE "%3 ®eÅé¤wÂ÷½u¡A¦]¦¹µLªk¨Ï¥Î¡C" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_TIMEOUT + "µLªk»P¦øªA¾¹ %1 ¨ú±oÁpô¡C¤W¤@¦¸¦b %2 ©Ò¶i¦æªºÀ|¸Õ¾É¦Ü¿ù»~ ""%3"" ªºµo¥Í¡C" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_DESCFULL_AGG_FULL + "¦øªA¾¹ %1 ¤§¤À³Î°Ï %2 ªº¨Ï¥Î¶W¹L¨äĵ§iÁ{¬É­È %3%% (%4)¡C" + IDS_ALERT_DESCFULL_SET_FULL + "®eÅé %3 ªº¨Ï¥Î¡]¦øªA¾¹ %1¡A¤À³Î°Ï %2¡^¶W¹L¨äĵ§iÁ{¬É­È %4%% (%5)¡C" + IDS_ALERT_DESCFULL_NO_VLDBENT + "®eÅé %3 ¦s¦b©ó¦øªA¾¹ %1 ªº¤À³Î°Ï %2¡A¦ý¬O¨S¦³¹ïÀ³ªº VLDB ¶µ¥Ø¡C" + IDS_ALERT_DESCFULL_NO_SVRENT_SET + "®eÅé %3 ¨ã¦³ VLDB ¶µ¥Ø¡A¦ý¬O¸Ó®eÅé¨Ã¥¼¦b¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W§ä¨ì¡C" + IDS_ALERT_DESCFULL_STOPPED + "¦øªA¾¹ %1 ¤Wªº %2 ªA°È©ó %3 °±¤î¡A¦Ó¥X¤f½X¬° %5¡C" + IDS_ALERT_DESCFULL_NO_SVRENT_AGG + "VLDB »P¦øªA¾¹ %1 ¤§¤À³Î°Ï %2 ªº®eÅé¬ÛÃö¡A¦ý¬O«o¤£¨ì¦¹¤À³Î°Ï¡C" + IDS_ALERT_DESCFULL_BADCREDS + "¥Ñ©ó±z¨S¦³¦¹ Cell ºÞ²z­ûªº AFS °O¸¹¡A¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¥i¯à¥¿¦b°»´ú¦øªA¾¹ %1 ¤W©Ò¨S¦³ªº¿ù»~¡C" + IDS_ALERT_DESCFULL_AGG_ALLOC + "¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤W¥[Á`ªº®eÅé°tÃBÁ`­p¬O %4¡A¶W¹L¤À³Î°Ïªº®e¶q %3¡C" + IDS_ALERT_DESCFULL_STATE_NO_VNODE + "¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº %3 ®eÅé¨Ã¨S¦³»P¤§³sµ²ªº Vnode¡C¡]®eÅ骬ºA¬° 0x%4¡C¡^" + IDS_ALERT_DESCFULL_STATE_NO_SERVICE + "¦øªA¾¹ %1 ¤W¨Ã¨S¦³ÀÉ®×¶×¥X¾¹ªA°È¦b°õ¦æ¡A¦]¦¹¤À³Î°Ï %2 ¤Wªº %3 ®eÅéµLªk¨Ï¥Î¡C¡]®eÅ骬ºA¬° 0x%4¡C¡^" + IDS_ALERT_DESCFULL_STATE_OFFLINE + "¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº %3 ®eÅ鬰Â÷½uª¬ºA¡A¦]¦ÓµLªk¨Ï¥Î¡C¡]®eÅ骬ºA¬° 0x%4¡C¡^" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_TIMEOUT "«ö¤@¤U¡u­«¸Õ¡v«ö¶s¡A¸ÕµÛ»P¦¹¦øªA¾¹¨ú±o³sµ²¡C" + IDS_ALERT_FIX_AGG_FULL "«ö¤@¤U¡uĵ§i¡v«ö¶s¡AÅܧ󦹤À³Î°Ï¥Î¶qªºÄµ§iÁ{¬É­È¡C" + IDS_ALERT_FIX_SET_FULL "«ö¤@¤U¡uĵ§i¡v«ö¶s¡AÅܧ󦹮eÅé¥Î¶qªºÄµ§iÁ{¬É­È¡C" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_FIX_NO_VLDBENT + "VLDB ¥i¯à¤w¹L´Á¡FªG¯u¦p¦¹¡A½Ð¨Ï¥Î¡u¦P¨B VLDB¡v«ü¥O¨Ó¥[¥H§ó·s¡C" + IDS_ALERT_FIX_NO_SVRENT_SET "½ÐÀˬd¦øªA¾¹»P¤À³Î°Ï¬O§_¥¿±`¹B§@¡C" + IDS_ALERT_FIX_STOPPED "«ö¤@¤U¡uÀ˵ø¤é»x¡v«ö¶s¡AÀ˵ø¦¹ªA°È¤§ªA°È¤é»x¡C" + IDS_ALERT_FIX_NO_SVRENT_AGG + "½ÐÀˬd¦øªA¾¹¡A¬Ý¬Ý¤À³Î°Ï¬O§_¤w¶×¥X¥B¥¿±`¹B§@¡C" + IDS_ALERT_FIX_BADCREDS "½ÐÀˬd¡uŲ§O¡v«ö¶s¥H¨ú±o·sªº AFS °O¸¹¡C" + IDS_ALERT_FIX_AGG_ALLOC "½Ð´î¤Ö¦¹¤À³Î°Ïªº®eÅé°tÃB¡A©Î¬O±N¤@©Î¦h­Ó®eÅé²¾°Ê¨ì¨ä¥L¤À³Î°Ï¡C" + IDS_ALERT_FIX_STATE_NO_VNODE " " + IDS_ALERT_FIX_STATE_NO_SERVICE " " + IDS_ALERT_FIX_STATE_OFFLINE " " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ALERT_BUTTON_TRYAGAIN "­«·s¹Á¸Õ(&A)" + IDS_ALERT_BUTTON_WARNINGS "ĵ§i(&W)..." + IDS_ALERT_BUTTON_VIEWLOG "À˵ø¤é»x(&V)" + IDS_ALERT_BUTTON_SHOWME "Åã¥Ü(&S)" + IDS_ALERT_BUTTON_GETCREDS "Ų§O(&A)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_CELLSERVERS_NOCELL + "¥¼«ü©w Cell¡C¦p­n¨Ï¥Î¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¡A±z¥²¶·«ü©w±z­n³B²zªº AFS Cell¡C½Ð¦b¤W¤èªº""Cell"" ¥\¯àªí¶µ¥Ø¤¤¿ï¨ú""¶}±Ò...""¥\¯àªí¶µ¥Ø¡A¥H¿ï¾Ü Cell¡C" + IDS_ERROR_REFRESH_CELLSERVERS + "µLªk¨ú±o %1 Cell ªº¦øªA¾¹²M³æ¡C\n\n¿ù»~¡G %2" + IDS_ERROR_CANT_OPEN_CELL + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk©M %1 Cell ¤¤¥ô¦ó¦øªA¾¹¨ú±oÁpô¡C \n\n½Ð­«·sÀˬd±z©ÒÁä¤Jªº Cell ¦WºÙ¬O§_¥¿½T¡C" + IDS_ERROR_REFRESH_AGGREGATES + "µLªk¨ú±o¦øªA¾¹ %1 ªº¤À³Î°Ï²M³æ¡C\n\n¿ù»~¡G %2" + IDS_ERROR_REFRESH_SERVER_STATUS "µLªk¨ú±o¦øªA¾¹ %1 ¥Ø«eªºª¬ºA¡C" + IDS_ERROR_CHANGE_SERVER_STATUS + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅÜ§ó¦øªA¾¹ %1 ªº¤º®e¡C" + IDS_ERROR_REFRESH_AGGREGATE_STATUS + "µLªk¨ú±o¦øªA¾¹ %1 ¤À³Î°Ï %2 ¥Ø«eªºª¬ºA¡C" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_REFRESH_FILESET_STATUS + "µLªk¨ú±o®eÅé %3¡]¦øªA¾¹ %1¡A¤À³Î°Ï %2¡^¥Ø«eªºª¬ºA¡C" + IDS_ERROR_REFRESH_SERVICE_STATUS + "µLªk¨M©w¦øªA¾¹ %1 ¤WªA°È %2 ¥Ø«eªºª¬ºA¡C" + IDS_ERROR_MOVE_FILESET "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N %3 ®eÅé±q¦øªA¾¹ %1 ¤Wªº¤À³Î°Ï %2¡A²¾°Ê¦Ü¦øªA¾¹ %4 ¤Wªº¤À³Î°Ï %5¡C" + IDS_ERROR_VIEW_LOGFILE "µLªk±q¦øªA¾¹ %1 ¤WŪ¨ú %2 ÀɮסC\n\n½ÐÀˬd±z©Ò¿é¤JªºÀɮצWºÙ¬O§_¥¿½T¡A¦P®É±z¾Ö¦³À˵ø¸ÓÀɮתº³\\\¥iÅv¡C" + IDS_ERROR_NOT_REPLICATED "µLªk¨M©w®eÅé %1 ªº½Æ»sª¬ºA¡C" + IDS_ERROR_CANT_CREATE_FILESET + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %3 ªº¤À³Î°Ï %2 «Ø¥ß®eÅé %3¡C" + IDS_ERROR_CANT_DELETE_FILESET + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk§R°£®eÅé %3¡]¦øªA¾¹ %1 ¤§¤À³Î°Ï %2¡^¡C" + IDS_ERROR_CANT_CREATE_VLDB_ENTRY + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W¡A¬°®eÅé %3 «Ø¥ß VLDB ¶µ¥Ø¡C" + IDS_ERROR_CANT_SET_FILESET_QUOTA + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W¡AÅܧó®eÅé %3 ªº°tÃB¡C" + IDS_ERROR_CANT_CREATE_SERVER + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b Cell %1 ¤W«Ø¥ß©Ò­n¨Dªº¦øªA¾¹¶µ¥Ø¡C" + IDS_ERROR_CANT_PING_SERVER + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk§PÂ_¦øªA¾¹ %1 ªº IP ¦ì§}¡C" + IDS_ERROR_CANT_DELETE_SERVER "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk§R°£¦øªA¾¹ %1¡C" + IDS_ERROR_CANT_DELETE_SERVER_FILESETS + "¦øªA¾¹ %1 ¤´¬O¤@©Î¼Æ­Ó®eÅ骺¥D¹q¸£¡A¦]¦¹µLªk§R°£¡C¦øªA¾¹¦pªGÁÙ¦³®eÅé¡A´NµLªk§R°£¡C" + IDS_ERROR_CHANGE_AGGREGATE_STATUS + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅܧó¤À³Î°Ï %2 ¦b¦øªA¾¹ %1 ¤Wªº¤º®e¡C" + IDS_ERROR_CHANGE_SERVICE_STATUS + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅܧóªA°È %2 ¦b¦øªA¾¹ %1 ¤Wªº¤º®e¡C" + IDS_ERROR_CANT_START_SERVICE + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W±Ò°ÊªA°È %2¡C" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_STOP_SERVICE + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W°±¤îªA°È %2¡C" + IDS_ERROR_CANT_RESTART_SERVICE + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W°±¤î¨Ã­«·s±Ò°ÊªA°È %2¡C" + IDS_ERROR_CHANGE_REPLICA_STATUS + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅܧó®eÅé %3 ¦b¦øªA¾¹ %1 ¤À³Î°Ï %2 ¤Wªº½Æ»s¤º®e¡C" + IDS_ERROR_CANT_SYNCVLDB "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk§ó·s VLDB¡C" + IDS_ERROR_CANT_CREATE_REPLICA + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W¡A¬°®eÅé %3 «Ø¥ß½Æ¥»¡C" + IDS_ERROR_CANT_INSTALL_FILE + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W¦w¸Ë %2 ÀɮסC" + IDS_ERROR_CANT_UNINSTALL_FILE + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W¸Ñ°£¦w¸Ë %2 ÀɮסC" + IDS_ERROR_CANT_PRUNE_FILES + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±q¦øªA¾¹ %1 ¤W²¾°£©Ò­n¨DªºÀɮסC" + IDS_ERROR_CANT_RENAME_FILESET + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N®eÅé %1 ­«·s©R¦W¬°""%2""¡C" + IDS_ERROR_CANT_CREATE_SERVICE + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W«Ø¥ßªA°È %2¡C" + IDS_ERROR_CANT_DELETE_SERVICE + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W§R°£ªA°È %2¡C" + IDS_ERROR_CANT_RELEASE_FILESET + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÄÀ©ñ½Æ»sªº®eÅé %3¡C" + IDS_ERROR_CANT_UPDATE_FILESET + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %2 ªº¤À³Î°Ï %1 ¤W§ó·s®eÅ齯¥» %3¡C" + IDS_ERROR_CANT_UPDATE_ALL + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk§ó·s®eÅé %3 ªº¥ô¦ó½Æ¥»¡C" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_LOAD_ADMLIST + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkŪ¨ú¦øªA¾¹ %1 ªººÞ²z­û²M³æ¡C" + IDS_ERROR_CANT_LOAD_KEYLIST + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkŪ¨ú¦øªA¾¹ %1 ªº¦øªA¾¹ª÷Æ_²M³æ¡C" + IDS_ERROR_CANT_CREATE_KEY + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¬°¦øªA¾¹ %1 «Ø¥ß·sªº¦øªA¾¹ª÷Æ_¡C" + IDS_ERROR_CANT_SAVE_ADMLIST + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅÜ§ó¦øªA¾¹ %1 ªººÞ²z­û²M³æ¡C" + IDS_ERROR_CANT_CLONE "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W¡A¬°®eÅé %3 «Ø¥ß³Æ¥÷ª©¥»¡C" + IDS_ERROR_CANT_CLONESYS "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk«Ø¥ß©Ò­n¨Dªº³Æ¥÷®eÅé¡C" + IDS_ERROR_CANT_DUMP_FILESET + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N®eÅé %3 ªº¤º®e¡]¦øªA¾¹ %1¡A¤À³Î°Ï %2¡^¡A¶É¥X¦Ü %4 ÀɮסC" + IDS_ERROR_CANT_RESTORE_FILESET + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N %4 ÀÉ®×´_­ì¨ì®eÅé %3¡]¦øªA¾¹ %1¡A¤À³Î°Ï %2¡^¡C" + IDS_ERROR_CANT_SET_RESTART_TIMES + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅÜ§ó¦øªA¾¹ %1 ¤WªºªA°È­«·s±Ò°Ê®É¶¡¡C" + IDS_ERROR_CANT_DELETE_REPLICATED_FILESET + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N®eÅé %3 ±q¦øªA¾¹ %1 ªº¤À³Î°Ï %2 ¤W§R°£¡C\n\nVolume %3 ¥²¶·¦b¨ä½Æ¥»³£§R°£¤F¤§«á¡A¤~¯à³Q§R°£¡C" + IDS_CMDLINE_TITLE "¿ù»~ - AFS ¦øªA¾¹ºÞ²zµ{¦¡" + IDS_CMDLINE_SYNTAX "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C" + IDS_CMDLINE_UNRECOGNIZED + "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n ""%1""°Ñ¼Æ¬OµLªkªº¿ëÃѪº¡C" + IDS_CMDLINE_DUPLICATE "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n ""%1""°Ñ¼Æªº«ü©w¦¸¼Æ¶W¹L¤@¦¸¡C" + IDS_CMDLINE_UNEXPECTVALUE + "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n ""%1"" °Ñ¼Æ¤£±o³Q½á¤©¤@­Ó­È¡C" + IDS_CMDLINE_MISSINGVAL "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n ""%1"" °Ñ¼Æ¤§«á¥²¶·¬O¤@­Ó­È¡C" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CMDLINE_SUBSETNOTCELL + "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n ""/SUBSET""°Ñ¼Æ¥²¶·¦b ""/CELL"" °Ñ¼Æ¦P®É³Q«ü©wªº±¡ªp¤U¤~¯à¥[¥H«ü©w¡C" + IDS_CMDLINE_INVALIDSUBSET + "±z©Ò«ü©wªº¦øªA¾¹¤l¶°¡A""%2""¡A©|¥¼¦b %1 Cell ¤¤¥[¥H©w¸q¡C" + IDS_CMDLINE_SERVERNOTCELL + "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n ""/SERVER""°Ñ¼Æ¥²¶·¦b ""/CELL"" °Ñ¼Æ¦P®É³Q«ü©wªº±¡ªp¤U¤~¯à¥[¥H«ü©w¡C" + IDS_CMDLINE_RESET_TITLE "AFS ¦øªA¾¹ºÞ²zµ{¦¡" + IDS_CMDLINE_RESET_DESC "¡uAFS ¦øªA¾¹ºÞ²zµ{¡v¤w²M°£«ü©wªº³]©w¡C" + IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE + "¥Ñ©ó¤À³Î°Ï¤£¬O¤£¦s¦b¡A´N¬O©|¥¼¶×¤J¡A©Ò¥H¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N VLDB »P¦øªA¾¹ %1 ¤§¤À³Î°Ï %2 ¦P¨B¤Æ¡C\n\n¦p­n±N¦¹¤@¤À³Î°Ï±q¦øªA¾¹ %1 ²¾°£¡A±z¥²¶·§R°£»P¸Ó¤À³Î°Ï¬ÛÃöªº®eÅé VLDB ¶µ¥Ø¡C" + IDS_CMDLINE_USERPASSWORD + "±z¬°¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v©Ò«ü©wªº«ü¥O¦æµL®Ä¡C\n\n¦p­n¨ú±o·sªº AFS °O¸¹¡A""/USER"" »P ""/PASSWORD"" °Ñ¼Æ¥²¶·¦P®É«ü©w¡C" + IDS_ERROR_CANT_DELETE_KEY + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±N¦øªA¾¹ª÷Æ_ %2 ±q¦øªA¾¹ %1 ¤W²¾°£¡C" + IDS_ERROR_CANT_GETRANDOMKEY + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¬°¦øªA¾¹ %1 «Ø¥ßÀH¾÷«öÁä¡C" + IDS_ERROR_CANT_EXECUTE_COMMAND + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¦b¦øªA¾¹ %1 ¤W°õ¦æ¥H¤Uªº«ü¥O¡G\n\n ""%2""" + IDS_ERROR_CANT_READ_SALVAGE_LOG + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¶¶§Q§¹¦¨´©±Ï§@·~¡A¦ý¬OµLªk¨ú±o´y±Ô´©±Ï§@·~¤§¯S©wµ²ªGªº¤é»xÀÉ¡C" + IDS_ERROR_CANT_SALVAGE "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk°õ¦æ©Ò­n¨Dªº´©±Ï§@·~¡C" + IDS_ERROR_CANT_AUTH_ON "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¬°¦øªA¾¹ %1 ±Ò¥ÎŲ§OÀˬd¡C" + IDS_ERROR_CANT_AUTH_OFF "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¬°¦øªA¾¹ %1 °±¥ÎŲ§OÀˬd¡C" + IDS_ERROR_CANT_LOAD_HOSTLIST + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk±q¦øªA¾¹ %1 Ū¨ú¸ê®Æ®w¥D¹q¸£¦øªA¾¹ªº²M³æ¡C" + IDS_ERROR_CANT_SAVE_HOSTLIST + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªkÅÜ§ó¦øªA¾¹ %1 ¤Wªº¸ê®Æ®w¥D¹q¸£¦øªA¾¹²M³æ¡C" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL + "¥Ñ©ó¦¹¹q¸£¨S¦³¥¿½T¦w¸Ë¡uAFS ±±¨î¤¤¤ß¡v¡A¦]¦¹µLªk±Ò°Ê¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¡C\n\n±z¥²¶·­«·s¦w¸Ë¡uAFS ±±¨î¤¤¤ß¡v¡C" + IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN + "¥Ñ©ó²£¥Í¤£©ú­ì¦]ªº°ÝÃD¡A¦]¦¹µLªk±Ò°Ê¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡v¡C\n\n±z¥²¶·­«·s¦w¸Ë¡uAFS ±±¨î¤¤¤ß¡v¡C" + IDS_ERROR_CANT_CHANGEADDR + "¡uAFS ¦øªA¾¹ºÞ²zµ{¦¡¡vµLªk¬°¦øªA¾¹ %1 Åܧó VLDB ªº IP ¦ì§}¡C" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVER_SERVICE "%1:%2" + IDS_SERVICETYPE_SIMPLE "²¦¡" + IDS_SERVICETYPE_CRON "Cron" + IDS_SERVICESTATE_STOPPED "¤w°±¤î" + IDS_SERVICESTATE_STOPPING "¥¿¦b°±¤î" + IDS_SERVICESTATE_STARTING "¥¿¦b±Ò°Ê" + IDS_SERVICESTATE_RUNNING "¥¿¦b°õ¦æ" + IDS_SERVICETYPE_FS_LONG "FS¡]Àɮרt²Î¡^" + IDS_SERVICETYPE_FS "FS" + IDS_SERVICE_LASTERROR "%1" + IDS_SERVICES_IN_CELL "Cell %1 ¤¤ªº©Ò¦³ªA°È¡G" + IDS_SERVICE_STARTDATE "¤w±Ò°Ê %1" + IDS_SERVICE_STOPDATE "¤w°±¤î %1" +END + +#endif // Chinese (Taiwan) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/afssvrmgr/problems.cpp b/src/WINNT/afssvrmgr/problems.cpp index 8249da398..59151b82a 100644 --- a/src/WINNT/afssvrmgr/problems.cpp +++ b/src/WINNT/afssvrmgr/problems.cpp @@ -210,6 +210,8 @@ void Problems_OnRefresh (HWND hDlg, LPIDENT lpi) GetString (szText, IDS_AGGREGATE_NO_PROBLEMS); else if (lpi->fIsFileset()) GetString (szText, IDS_FILESET_NO_PROBLEMS); + else + wsprintf (szText, TEXT("UNEXPECTED CONDITION in problems.cpp")); SetDlgItemText (hDlg, IDC_PROBLEM_TEXT, szText); break; diff --git a/src/WINNT/afssvrmgr/resource.h b/src/WINNT/afssvrmgr/resource.h index ad832b38a..d0cd1c2b6 100644 --- a/src/WINNT/afssvrmgr/resource.h +++ b/src/WINNT/afssvrmgr/resource.h @@ -17,244 +17,249 @@ #define IDS_AGGREGATE_ONE 7 #define IDS_FILESET_ALL 8 #define IDS_FILESET_ONE 9 -#define IDS_SVR_LISTS_TAB 11 -#define IDS_SVR_PROP_TITLE 12 -#define IDS_SVR_GENERAL_TAB 13 -#define IDS_SVR_SCOUT_TAB 14 -#define IDS_SERVER_TITLE 15 +#define IDS_SVR_LISTS_TAB 10 +#define IDS_SVR_PROP_TITLE 11 +#define IDS_SVR_GENERAL_TAB 12 +#define IDS_SVR_SCOUT_TAB 13 +#define IDS_SERVER_TITLE 14 + #define IDS_SERVER_DESC 16 #define IDS_SVC_PROP_TITLE 17 #define IDS_SVC_GENERAL_TAB 18 #define IDS_SVC_ADD_TITLE 19 #define IDS_SVC_ADD_TAB 20 -#define IDS_AGG_PROP_TITLE 23 -#define IDS_AGG_GENERAL_TAB 24 -#define IDS_SET_REP_TITLE 25 -#define IDS_SET_REPSITES_TAB 27 -#define IDS_SET_PROP_TITLE 28 -#define IDS_SET_GENERAL_TAB 29 -#define IDS_SET_UNLOCKBTN 30 -#define IDS_SET_LOCKBTN 31 +#define IDS_AGG_PROP_TITLE 21 +#define IDS_AGG_GENERAL_TAB 22 +#define IDS_SET_REP_TITLE 23 +#define IDS_SET_REPSITES_TAB 24 +#define IDS_SET_PROP_TITLE 25 +#define IDS_SET_GENERAL_TAB 26 +#define IDS_SET_UNLOCKBTN 27 +#define IDS_SET_LOCKBTN 28 + #define IDS_USAGE_FILESET 32 #define IDS_USAGE_AGGREGATE 33 -#define IDS_AGGCOL_ALLOCATED 70 -#define IDS_SVRCOL_NAME 71 -#define IDS_SVRCOL_STATUS 72 -#define IDS_SETCOL_DATE_ACCESS 73 -#define IDS_SETCOL_DATE_BACKUP 74 -#define IDS_SVCCOL_NAME 75 -#define IDS_SVCCOL_TYPE 76 -#define IDS_SVCCOL_PARAMS 77 -#define IDS_SVCCOL_STATUS 78 -#define IDS_SVCCOL_DATE_START 80 -#define IDS_SVCCOL_DATE_STOP 81 -#define IDS_SVCCOL_DATE_STARTSTOP 82 -#define IDS_SVCCOL_DATE_FAILED 83 -#define IDS_SVCCOL_LASTERROR 84 -#define IDS_AGGCOL_NAME 85 -#define IDS_AGGCOL_ID 86 -#define IDS_AGGCOL_DEVICE 87 -#define IDS_AGGCOL_USED 89 -#define IDS_AGGCOL_USED_PER 90 -#define IDS_AGGCOL_FREE 91 -#define IDS_AGGCOL_TOTAL 92 -#define IDS_AGGCOL_STATUS 93 -#define IDS_SETCOL_NAME 94 -#define IDS_SETCOL_TYPE 95 -#define IDS_SETCOL_DATE_CREATE 96 -#define IDS_SETCOL_DATE_UPDATE 97 -#define IDS_SETCOL_STATUS 98 -#define IDS_SETCOL_QUOTA_USED 99 -#define IDS_SETCOL_QUOTA_USED_PER 100 -#define IDS_SETCOL_QUOTA_FREE 101 -#define IDS_SETCOL_QUOTA_TOTAL 102 -#define IDS_TRYAGAINBTN 103 -#define IDS_NO_CELL_SELECTED 104 -#define IDS_NO_AFS_ID 105 -#define IDS_AFS_ID_WILLEXP 106 -#define IDS_ELAPSED_TIME 107 -#define IDS_SEARCHING_FOR_SERVERS 108 -#define IDS_STATUS_NOALERTS 109 -#define IDS_TITLE_BROWSE_USER 110 -#define IDS_AGGTYPE_OTHER 111 -#define IDS_PERCENTAGE 112 -#define IDS_AGGREGATES_IN_SERVER 113 -#define IDS_AGGREGATES_IN_CELL 114 -#define IDS_AGGREGATES_IN_NOTHING 115 -#define IDS_FILESETS_IN_SERVER 116 -#define IDS_FILESETS_IN_CELL 117 -#define IDS_FILESETS_IN_NOTHING 118 -#define IDS_SERVICES_IN_SERVER 119 -#define IDS_SERVICES_IN_NOTHING 120 -#define IDS_UNKNOWN 121 -#define IDS_UNKNOWN_GROUP 122 -#define IDS_AGGFULL_WARN_OFF 123 -#define IDS_SERVER_AGGREGATE 124 -#define IDS_SERVERNAME_ERROR 125 -#define IDS_AGGREGATENAME_ERROR 126 -#define IDS_SETFULL_WARN_OFF 127 -#define IDS_SERVER_SERVICE 128 -#define IDS_SERVICETYPE_SIMPLE 129 -#define IDS_SERVICETYPE_CRON 130 -#define IDS_SERVICESTATE_STOPPED 131 -#define IDS_SERVICESTATE_STOPPING 132 -#define IDS_SERVICESTATE_STARTING 133 -#define IDS_SERVICESTATE_RUNNING 134 -#define IDS_SERVICETYPE_FS_LONG 135 -#define IDS_SERVICETYPE_FS 136 -#define IDS_SERVICE_LASTERROR 137 -#define IDS_SERVICES_IN_CELL 138 -#define IDS_SERVICE_STARTDATE 139 -#define IDS_SERVICE_STOPDATE 140 -#define IDS_SERVICE_LASTERRORDATE 149 -#define IDS_COL_SERVERS 150 -#define IDS_COL_FILESETS 151 -#define IDS_COL_AGGREGATES 152 -#define IDS_COL_SERVICES 153 -#define IDS_COL_REPLICAS 154 -#define IDS_COLUMNS_TITLE 155 -#define IDS_REPCOL_SERVER 156 -#define IDS_REPCOL_AGGREGATE 157 -#define IDS_REPCOL_DATE_UPDATE 158 -#define IDS_FILESETNAME_ERROR 160 -#define IDS_SETCOL_AGGREGATE 161 -#define IDS_REFRESH_DESC_CELL 162 -#define IDS_REFRESH_DESC_SERVER 163 -#define IDS_REFRESH_CURRENT_CELL 164 -#define IDS_REFRESH_CURRENT_SERVER 165 -#define IDS_REFRESH_CURRENT_AGGREGATE 166 -#define IDS_REFRESH_CURRENT_FILESET 167 -#define IDS_REFRESH_CURRENT_SERVICE 168 -#define IDS_REFRESH_PERCENT 169 -#define IDS_PROBLEMS 170 -#define IDS_SERVER_NO_PROBLEMS 171 -#define IDS_SERVICE_NO_PROBLEMS 172 -#define IDS_AGGREGATE_NO_PROBLEMS 173 -#define IDS_FILESET_NO_PROBLEMS 174 -#define IDS_AGGTYPE_TYPE1 175 -#define IDS_AGGTYPE_TYPE2 176 -#define IDS_AGGTYPE_TYPE3 177 -#define IDS_AGGTYPE_TYPE4 178 -#define IDS_AGGTYPE_TYPE5 179 -#define IDS_REFRESH_CURRENT_VLDB 180 -#define IDS_FILESETTYPE_RW 181 -#define IDS_FILESETTYPE_RO 182 -#define IDS_FILESETTYPE_CLONE 183 -#define IDS_MOVESET_READWRITE 184 -#define IDS_MOVESET_READONLY 185 -#define IDS_SVC_START_TITLE 186 -#define IDS_SVC_STOP_TITLE 187 -#define IDS_SERVICESTATUS_STARTING 188 -#define IDS_SERVICESTATUS_RUNNING 189 -#define IDS_SERVICESTATUS_STOPPED 190 -#define IDS_SERVICESTATUS_STOPPING 191 -#define IDS_SERVICESTATUS_UNKNOWN 192 -#define IDS_SVC_RESTART_BUTTON 196 -#define IDS_PROBLEM_BOX 197 -#define IDS_VIEWLOG_DESC_NOFILE 198 -#define IDS_NO_GROUP 199 -#define IDS_VIEWLOG_FROMSERVER 200 -#define IDS_VIEWLOG_FROMSERVICE 201 -#define IDS_VIEWLOG_TRUNCATED 202 -#define IDS_SAVELOG_FILTER 203 -#define IDS_ADVANCEDIN_BUTTON 204 -#define IDS_ADVANCEDOUT_BUTTON 205 -#define IDS_REPTYPE_RELEASE 206 -#define IDS_REPTYPE_SCHEDULED 207 -#define IDS_UPDATEALL_BUTTON 208 -#define IDS_UPDATETHIS_BUTTON 209 -#define IDS_SERVER_MULTIPLE_PROBLEMS 210 -#define IDS_SERVICE_MULTIPLE_PROBLEMS 211 -#define IDS_AGGREGATE_MULTIPLE_PROBLEMS 212 -#define IDS_FILESET_MULTIPLE_PROBLEMS 213 -#define IDS_FILESETTYPE_RO_STAGE 214 -#define IDS_SERVICETYPE_SIMPLE_LONG 215 -#define IDS_SERVICETYPE_CRON_LONG 216 -#define IDS_QUOTAUNITS_KB 217 -#define IDS_QUOTAUNITS_MB 218 -#define IDS_NO_QUOTA_REPLICA 219 -#define IDS_NO_QUOTA_CLONE 220 -#define IDS_USAGE_REPLICA 221 -#define IDS_USAGE_CLONE 222 -#define IDS_COL_AGGS_MOVE 223 + +#define IDS_AGGCOL_ALLOCATED 48 +#define IDS_SVRCOL_NAME 49 +#define IDS_SVRCOL_STATUS 50 +#define IDS_SETCOL_DATE_ACCESS 51 +#define IDS_SETCOL_DATE_BACKUP 52 +#define IDS_SVCCOL_NAME 53 +#define IDS_SVCCOL_TYPE 54 +#define IDS_SVCCOL_PARAMS 55 +#define IDS_SVCCOL_STATUS 56 + +#define IDS_SVCCOL_DATE_START 64 +#define IDS_SVCCOL_DATE_STOP 65 +#define IDS_SVCCOL_DATE_STARTSTOP 66 +#define IDS_SVCCOL_DATE_FAILED 67 +#define IDS_SVCCOL_LASTERROR 68 +#define IDS_AGGCOL_NAME 69 +#define IDS_AGGCOL_ID 70 +#define IDS_AGGCOL_DEVICE 71 +#define IDS_AGGCOL_USED 72 +#define IDS_AGGCOL_USED_PER 73 +#define IDS_AGGCOL_FREE 74 +#define IDS_AGGCOL_TOTAL 75 +#define IDS_AGGCOL_STATUS 76 +#define IDS_SETCOL_NAME 77 +#define IDS_SETCOL_TYPE 78 + +#define IDS_SETCOL_DATE_CREATE 80 +#define IDS_SETCOL_DATE_UPDATE 81 +#define IDS_SETCOL_STATUS 82 +#define IDS_SETCOL_QUOTA_USED 83 +#define IDS_SETCOL_QUOTA_USED_PER 84 +#define IDS_SETCOL_QUOTA_FREE 85 +#define IDS_SETCOL_QUOTA_TOTAL 86 +#define IDS_TRYAGAINBTN 87 +#define IDS_NO_CELL_SELECTED 88 +#define IDS_NO_AFS_ID 89 +#define IDS_AFS_ID_WILLEXP 90 +#define IDS_ELAPSED_TIME 91 +#define IDS_SEARCHING_FOR_SERVERS 92 +#define IDS_STATUS_NOALERTS 93 +#define IDS_TITLE_BROWSE_USER 94 +#define IDS_AGGTYPE_OTHER 95 + +#define IDS_ACTION_CREATEFILESET 96 +#define IDS_ACTION_DELETEFILESET 97 +#define IDS_ACTION_MOVEFILESET 98 +#define IDS_ACTION_SETFILESETQUOTA 99 +#define IDS_SVCSTOP_DESC2 101 +#define IDS_SVCSTART_DESC2 102 +#define IDS_SYNCVLDB_SVR_DESC 103 +#define IDS_SYNCVLDB_SVR_DESC2 104 +#define IDS_SYNCVLDB_AGG_DESC 105 +#define IDS_SYNCVLDB_AGG_DESC2 106 +#define IDS_PROMPT_BROWSE_USER 107 +#define IDS_PREVIEWIN_BUTTON 108 +#define IDS_PREVIEWOUT_BUTTON 109 + +#define IDS_ADMCOL_TYPE_USER 112 +#define IDS_TITLE_BROWSE_PRINCIPAL 113 +#define IDS_TITLE_BROWSE_OWNGROUP 114 +#define IDS_PROMPT_BROWSE_PRINCIPAL 115 +#define IDS_PROMPT_BROWSE_OWNGROUP 116 +#define IDS_ACTION_CLONE 117 +#define IDS_ACTION_CLONESYS 118 +#define IDS_CLONESYS_FAILED 119 +#define IDS_SET_UNSPECIFIED 120 +#define IDS_SETCOL_ID 121 +#define IDS_SETCOL_FILES 122 +#define IDS_SET_DUMP_NAME 123 +#define IDS_ACTION_DUMP 124 + +#define IDS_FILESETNAME_ERROR 128 +#define IDS_SETCOL_AGGREGATE 129 +#define IDS_REFRESH_DESC_CELL 130 +#define IDS_REFRESH_DESC_SERVER 131 +#define IDS_REFRESH_CURRENT_CELL 132 +#define IDS_REFRESH_CURRENT_SERVER 133 +#define IDS_REFRESH_CURRENT_AGGREGATE 134 +#define IDS_REFRESH_CURRENT_FILESET 135 +#define IDS_REFRESH_CURRENT_SERVICE 136 +#define IDS_REFRESH_PERCENT 137 +#define IDS_PROBLEMS 138 +#define IDS_SERVER_NO_PROBLEMS 139 +#define IDS_SERVICE_NO_PROBLEMS 140 +#define IDS_AGGREGATE_NO_PROBLEMS 141 +#define IDS_FILESET_NO_PROBLEMS 142 +#define IDS_AGGTYPE_TYPE1 143 + +#define IDS_AGGTYPE_TYPE2 144 +#define IDS_AGGTYPE_TYPE3 145 +#define IDS_AGGTYPE_TYPE4 146 +#define IDS_AGGTYPE_TYPE5 147 +#define IDS_REFRESH_CURRENT_VLDB 148 +#define IDS_FILESETTYPE_RW 149 +#define IDS_FILESETTYPE_RO 150 +#define IDS_FILESETTYPE_CLONE 151 +#define IDS_MOVESET_READWRITE 152 +#define IDS_MOVESET_READONLY 153 +#define IDS_SVC_START_TITLE 154 +#define IDS_SVC_STOP_TITLE 155 +#define IDS_SERVICESTATUS_STARTING 156 +#define IDS_SERVICESTATUS_RUNNING 157 +#define IDS_SERVICESTATUS_STOPPED 158 +#define IDS_SERVICESTATUS_STOPPING 159 + +#define IDS_SERVICESTATUS_UNKNOWN 160 +#define IDS_SVC_RESTART_BUTTON 161 +#define IDS_PROBLEM_BOX 162 +#define IDS_VIEWLOG_DESC_NOFILE 163 +#define IDS_NO_GROUP 164 +#define IDS_VIEWLOG_FROMSERVER 165 +#define IDS_VIEWLOG_FROMSERVICE 166 +#define IDS_VIEWLOG_TRUNCATED 167 +#define IDS_SAVELOG_FILTER 168 +#define IDS_ADVANCEDIN_BUTTON 169 +#define IDS_ADVANCEDOUT_BUTTON 170 +#define IDS_REPTYPE_RELEASE 171 +#define IDS_REPTYPE_SCHEDULED 172 + +#define IDS_UPDATEALL_BUTTON 178 +#define IDS_UPDATETHIS_BUTTON 179 +#define IDS_SERVER_MULTIPLE_PROBLEMS 180 +#define IDS_SERVICE_MULTIPLE_PROBLEMS 181 +#define IDS_AGGREGATE_MULTIPLE_PROBLEMS 182 +#define IDS_FILESET_MULTIPLE_PROBLEMS 183 +#define IDS_FILESETTYPE_RO_STAGE 184 +#define IDS_SERVICETYPE_SIMPLE_LONG 185 +#define IDS_SERVICETYPE_CRON_LONG 186 +#define IDS_QUOTAUNITS_KB 187 +#define IDS_QUOTAUNITS_MB 188 +#define IDS_NO_QUOTA_REPLICA 189 +#define IDS_NO_QUOTA_CLONE 190 +#define IDS_USAGE_REPLICA 191 +#define IDS_USAGE_CLONE 192 +#define IDS_COL_AGGS_MOVE 193 + +#define IDS_PERCENTAGE 194 +#define IDS_AGGREGATES_IN_SERVER 195 +#define IDS_AGGREGATES_IN_CELL 196 +#define IDS_AGGREGATES_IN_NOTHING 197 +#define IDS_FILESETS_IN_SERVER 198 +#define IDS_FILESETS_IN_CELL 199 +#define IDS_FILESETS_IN_NOTHING 200 +#define IDS_SERVICES_IN_SERVER 201 +#define IDS_SERVICES_IN_NOTHING 202 +#define IDS_UNKNOWN 203 +#define IDS_UNKNOWN_GROUP 204 +#define IDS_AGGFULL_WARN_OFF 205 +#define IDS_SERVER_AGGREGATE 206 +#define IDS_SERVERNAME_ERROR 207 +#define IDS_AGGREGATENAME_ERROR 208 +#define IDS_SETFULL_WARN_OFF 209 + +#define IDS_SERVICE_LASTERRORDATE 210 +#define IDS_COL_SERVERS 211 +#define IDS_COL_FILESETS 212 +#define IDS_COL_AGGREGATES 213 +#define IDS_COL_SERVICES 214 +#define IDS_COL_REPLICAS 215 +#define IDS_COLUMNS_TITLE 216 +#define IDS_REPCOL_SERVER 217 +#define IDS_REPCOL_AGGREGATE 218 +#define IDS_REPCOL_DATE_UPDATE 219 + #define IDS_COL_AGGS_CREATE 224 #define IDS_WARN_TITLE 225 #define IDS_WARN_DISABLE_AUTH 226 #define IDS_WARN_DISABLE_AUTH2 227 -#define IDS_SVR_NO_ADDR 230 -#define IDS_SVR_ADDR_DESC_NONAME 231 -#define IDS_TITLE_BAD_CELL 236 -#define IDS_DESC_BAD_CELL 237 -#define IDS_AGGFULL_WARN_ON 238 -#define IDS_SETFULL_WARN_ON 239 -#define IDS_AGG_FILESETS 241 -#define IDS_ACTION_DESC_NONE 242 -#define IDS_ACTION_DESC_ONE 243 -#define IDS_ACTION_DESC_MULT 244 -#define IDS_ACTCOL_OPERATION 245 -#define IDS_ACTCOL_ELAPSED 246 -#define IDS_ACTION_REFRESH 247 -#define IDS_ACTION_CREATESERVER 248 -#define IDS_ACTION_DELETESERVER 249 -#define IDS_ACTION_GETSERVERLOGFILE 250 -#define IDS_ACTION_SETSERVERAUTH 251 -#define IDS_ACTION_CHANGESERVERSTATUS 252 -#define IDS_ACTION_STARTSERVICE 253 -#define IDS_ACTION_STOPSERVICE 254 -#define IDS_ACTION_RESTARTSERVICE 255 -#define IDS_ACTION_CREATEFILESET 256 -#define IDS_ACTION_DELETEFILESET 257 -#define IDS_ACTION_MOVEFILESET 258 -#define IDS_ACTION_SETFILESETQUOTA 259 -#define IDS_SVCSTOP_DESC2 261 -#define IDS_SVCSTART_DESC2 262 -#define IDS_SYNCVLDB_SVR_DESC 263 -#define IDS_SYNCVLDB_SVR_DESC2 264 -#define IDS_SYNCVLDB_AGG_DESC 265 -#define IDS_SYNCVLDB_AGG_DESC2 266 -#define IDS_PROMPT_BROWSE_USER 267 -#define IDS_PREVIEWIN_BUTTON 270 -#define IDS_PREVIEWOUT_BUTTON 271 +#define IDS_SVR_NO_ADDR 228 +#define IDS_TITLE_BAD_CELL 229 +#define IDS_DESC_BAD_CELL 230 +#define IDS_AGGFULL_WARN_ON 231 +#define IDS_SETFULL_WARN_ON 232 + +#define IDS_SVR_ERROR_BAD_CREDENTIALS 240 +#define IDS_SVR_CREDS_NONE 241 +#define IDS_SVR_CREDS_VALID 242 +#define IDS_SVR_CREDS_EXPIRED 243 + +#define IDS_AGG_FILESETS 256 +#define IDS_ACTION_DESC_NONE 257 +#define IDS_ACTION_DESC_ONE 258 +#define IDS_ACTION_DESC_MULT 259 +#define IDS_ACTCOL_OPERATION 260 +#define IDS_ACTCOL_ELAPSED 261 +#define IDS_ACTION_REFRESH 262 +#define IDS_ACTION_CREATESERVER 263 +#define IDS_ACTION_DELETESERVER 264 +#define IDS_ACTION_GETSERVERLOGFILE 265 +#define IDS_ACTION_SETSERVERAUTH 266 +#define IDS_ACTION_CHANGESERVERSTATUS 267 +#define IDS_ACTION_STARTSERVICE 268 +#define IDS_ACTION_STOPSERVICE 269 +#define IDS_ACTION_RESTARTSERVICE 270 + #define IDS_ACTION_SYNCVLDB_SVR 272 #define IDS_ACTION_SYNCVLDB_AGG 273 -#define IDS_ACTION_SCOUT 276 -#define IDS_SYNC_NONE 277 -#define IDS_SYNC_ERRORS 278 -#define IDS_SYNC_DETAILS 279 -#define IDS_SYNC_P_NEWMAXID 280 -#define IDS_SYNC_R_NEWMAXID 281 -#define IDS_SYNC_P_AGGBUSY 282 -#define IDS_SYNC_R_AGGBUSY 283 -#define IDS_SYNC_X_MULTIPLE 284 -#define IDS_SYNC_R_REINSTATE_FAILED 285 -#define IDS_SYNC_R_REP_NO_VLDB 286 -#define IDS_SYNC_R_REINSTATE 287 -#define IDS_SYNC_P_CREATEVLDB 288 -#define IDS_SYNC_R_CREATEVLDB 289 -#define IDS_SYNC_P_DELETEVLDB 290 -#define IDS_SYNC_R_DELETEVLDB 291 -#define IDS_SYNC_P_CLONEID 292 -#define IDS_SYNC_R_CLONEID 293 -#define IDS_SYNC_X_CLONEORPHAN 294 -#define IDS_ACTION_SETREPPARAMS 297 -#define IDS_ACTION_CREATEREPLICA 298 -#define IDS_DELSET_REPLICA_DESC 300 -#define IDS_DELSET_CLONE_DESC 302 -#define IDS_INSTALL_DESC1 303 +#define IDS_ACTION_SCOUT 274 + +#define IDS_ACTION_SETREPPARAMS 288 +#define IDS_ACTION_CREATEREPLICA 289 +#define IDS_DELSET_REPLICA_DESC 290 +#define IDS_DELSET_CLONE_DESC 291 +#define IDS_INSTALL_DESC1 292 + #define IDS_INSTALL_DESC2 304 #define IDS_ACTION_INSTALLFILE 305 #define IDS_ACTION_UNINSTALLFILE 306 #define IDS_ACTION_PRUNEFILES 307 #define IDS_FILTER_ALLFILES 308 -#define IDS_ACTION_RENAMEFILESET 311 -#define IDS_RECUR_DAILY 312 -#define IDS_RECUR_SUNDAY 313 -#define IDS_RECUR_MONDAY 314 -#define IDS_RECUR_TUESDAY 315 -#define IDS_RECUR_WEDNESDAY 316 -#define IDS_RECUR_THURSDAY 317 -#define IDS_RECUR_FRIDAY 318 -#define IDS_RECUR_SATURDAY 319 +#define IDS_ACTION_RENAMEFILESET 309 +#define IDS_RECUR_DAILY 310 +#define IDS_RECUR_SUNDAY 311 +#define IDS_RECUR_MONDAY 312 +#define IDS_RECUR_TUESDAY 313 +#define IDS_RECUR_WEDNESDAY 314 +#define IDS_RECUR_THURSDAY 315 +#define IDS_RECUR_FRIDAY 316 +#define IDS_RECUR_SATURDAY 317 + #define IDS_ACTION_CREATESERVICE 320 #define IDS_ACTION_DELETESERVICE 321 #define IDS_ACTION_RELEASEFILESET 322 @@ -267,284 +272,310 @@ #define IDS_SVR_LIST_TAB 329 #define IDS_ACTION_ADMINLIST_LOAD 330 #define IDS_ACTION_ADMINLIST_SAVE 331 -#define IDS_ADMCOL_PRINCIPAL 333 -#define IDS_ADMCOL_TYPE 334 -#define IDS_ADMCOL_TYPE_GROUP 335 -#define IDS_ADMCOL_TYPE_USER 336 -#define IDS_TITLE_BROWSE_PRINCIPAL 337 -#define IDS_TITLE_BROWSE_OWNGROUP 338 -#define IDS_PROMPT_BROWSE_PRINCIPAL 339 -#define IDS_PROMPT_BROWSE_OWNGROUP 340 -#define IDS_ACTION_CLONE 344 -#define IDS_ACTION_CLONESYS 345 -#define IDS_CLONESYS_FAILED 346 -#define IDS_SET_UNSPECIFIED 347 -#define IDS_SETCOL_ID 348 -#define IDS_SETCOL_FILES 349 -#define IDS_SET_DUMP_NAME 350 -#define IDS_ACTION_DUMP 351 -#define IDS_ACTION_RESTORE 352 -#define IDS_COL_AGGS_RESTORE 353 -#define IDS_RESTORE_FILTER 354 -#define IDS_SVC_BOS_TAB 355 -#define IDS_ACTION_SETRESTART 356 -#define IDS_RESTORE_CREATESET 357 -#define IDS_RESTORE_OVERWRITESET 358 -#define IDS_SUBSET_TITLE_LOAD 359 -#define IDS_SUBSET_TITLE_SAVE 360 -#define IDS_BUTTON_OPEN 361 -#define IDS_BUTTON_SAVE 362 -#define IDS_SUBSET_SAVE_TITLE 363 -#define IDS_SUBSET_SAVE_DESC 364 -#define IDS_SUBSET_CHANGED 365 -#define IDS_SUBSET_TAB 366 -#define IDS_SUBSET_DISCARD_TITLE 367 -#define IDS_SUBSET_DISCARD_DESC 368 -#define IDS_SUBSET_DISCARD_DESC2 369 -#define IDS_SUBSET_NONAME 370 -#define IDS_SUBSET_NOSUBSET 371 -#define IDS_SUBSET_SERVERSUBSET 372 -#define IDS_FILESET_SOME 373 -#define IDS_AGGREGATE_SOME 374 -#define IDS_SERVICE_SOME 375 -#define IDS_FILESET_UNMON 376 -#define IDS_AGGREGATE_UNMON 377 -#define IDS_SERVICE_UNMON 378 -#define IDS_SUBSET_DELETE_TITLE 379 -#define IDS_SUBSET_DELETE_DESC 380 -#define IDS_ERROR_TRANSLATED 381 -#define IDS_ERROR_NOTTRANSLATED 382 -#define IDS_FIND_NOTHING_TITLE 383 -#define IDS_FIND_NOTHING_DESC 384 -#define IDS_FIND_UNKNOWN_TITLE 385 -#define IDS_FIND_UNKNOWN_DESC 386 -#define IDS_HELPABOUT_DESC1 387 -#define IDS_HELPABOUT_DESC2 388 -#define IDS_HELPABOUT_DESC3 389 -#define IDS_CANT_QUIT_TITLE 390 -#define IDS_CANT_QUIT_REBOOT 391 -#define IDS_APP_TITLE 392 -#define IDS_ACTION_OPENCELL 393 -#define IDS_OPTIONS_TITLE 394 -#define IDS_OPTIONS_GENERAL_TAB 395 -#define IDS_BADCREDS_DESC 399 -#define IDS_CONFIRMATION_TITLE 402 -#define IDS_NO_GROUP_CHECKBOX 403 -#define IDS_AFS_ID_DIDEXP 405 -#define IDS_QUERYING 417 -#define IDS_QUERYING_ACL 418 -#define IDS_UNKNOWN_ACL 419 -#define IDS_ADMCOL_TYPE_FOREIGN_GROUP 424 -#define IDS_ADMCOL_TYPE_FOREIGN_USER 425 -#define IDS_SVCCOL_NOTIFIER 436 -#define IDS_SVC_NONOTIFIER 437 -#define IDS_SVR_KEY_TAB 438 -#define IDS_KEYNAME_NOTIME 439 -#define IDS_KEYNAME_WITHTIME 440 -#define IDS_SVRKEY_VERSION 441 -#define IDS_SVRKEY_DATA 442 -#define IDS_SVRKEY_CHECKSUM 443 -#define IDS_SVRKEY_DATA_UNKNOWN 444 -#define IDS_STARTSERVICE_TITLE 445 -#define IDS_STOPSERVICE_TITLE 446 -#define IDS_STARTSERVICE_TEXT 447 -#define IDS_STOPSERVICE_TEXT 448 -#define IDS_STARTSERVICE_STARTUP 449 -#define IDS_STOPSERVICE_STARTUP 450 -#define IDS_STARTSERVICE_PERMANENT 451 -#define IDS_STARTSERVICE_TEMPORARY 452 -#define IDS_STOPSERVICE_PERMANENT 453 -#define IDS_STOPSERVICE_TEMPORARY 454 -#define IDS_ACTION_EXECUTE 456 -#define IDS_ACTION_SALVAGE_SVR 457 -#define IDS_ACTION_SALVAGE_AGG 458 -#define IDS_ACTION_SALVAGE_VOL 459 -#define IDS_SALVAGE_SVR 460 -#define IDS_SALVAGE_AGG 461 -#define IDS_SALVAGE_SET 462 -#define IDS_SETSTATUS_SALVAGE 463 -#define IDS_SETSTATUS_LOCKED 464 -#define IDS_SETSTATUS_NO_VOL 465 -#define IDS_SETSTATUS_BUSY 468 -#define IDS_SETSTATUS_MOVED 469 -#define IDS_SVR_CAPACITY 470 -#define IDS_SVR_ALLOCATION 471 -#define IDS_SVRCOL_ADDRESS 472 -#define IDS_HOST_TITLE 473 -#define IDS_SVR_HOSTS_TITLE 474 -#define IDS_SVR_HOST_TAB 475 -#define IDS_ACTION_HOSTLIST_LOAD 476 -#define IDS_ACTION_HOSTLIST_SAVE 477 -#define IDS_SETSTATUS_1ALERT 478 -#define IDS_SETSTATUS_2ALERT 479 -#define IDS_ACTION_CHANGEADDR 480 -#define IDS_COMMAND_VOS_ADDSITE 700 -#define IDS_COMMAND_VOS_BACKUP 701 -#define IDS_COMMAND_VOS_BACKUPSYS 702 -#define IDS_COMMAND_VOS_CREATE 703 -#define IDS_COMMAND_VOS_DELENTRY 704 -#define IDS_COMMAND_VOS_DUMP 705 -#define IDS_COMMAND_VOS_EXAMINE 706 -#define IDS_COMMAND_VOS_LISTPART 707 -#define IDS_COMMAND_VOS_LISTVLDB 708 -#define IDS_COMMAND_VOS_LISTVOL 709 -#define IDS_COMMAND_VOS_LOCK 710 -#define IDS_COMMAND_VOS_MOVE 711 -#define IDS_COMMAND_VOS_PARTINFO 712 -#define IDS_COMMAND_VOS_RELEASE 713 -#define IDS_COMMAND_VOS_REMOVE 714 -#define IDS_COMMAND_VOS_REMSITE 715 -#define IDS_COMMAND_VOS_RENAME 716 -#define IDS_COMMAND_VOS_RESTORE 717 -#define IDS_COMMAND_VOS_SYNCVLDB 718 -#define IDS_COMMAND_VOS_UNLOCK 719 -#define IDS_COMMAND_VOS_UNLOCKVLDB 720 -#define IDS_COMMAND_VOS_ZAP 721 -#define IDS_COMMAND_BOS_ADDHOST 722 -#define IDS_COMMAND_BOS_ADDKEY 723 -#define IDS_COMMAND_BOS_ADDUSER 724 -#define IDS_COMMAND_BOS_CREATE 725 -#define IDS_COMMAND_BOS_DELETE 726 -#define IDS_COMMAND_BOS_EXEC 727 -#define IDS_COMMAND_BOS_GETDATE 728 -#define IDS_COMMAND_BOS_GETLOG 729 -#define IDS_COMMAND_BOS_GETRESTART 730 -#define IDS_COMMAND_BOS_INSTALL 731 -#define IDS_COMMAND_BOS_LISTHOSTS 732 -#define IDS_COMMAND_BOS_LISTKEYS 733 -#define IDS_COMMAND_BOS_LISTUSERS 734 -#define IDS_COMMAND_BOS_PRUNE 735 -#define IDS_COMMAND_BOS_REMOVEHOST 736 -#define IDS_COMMAND_BOS_REMOVEKEY 737 -#define IDS_COMMAND_BOS_REMOVEUSER 738 -#define IDS_COMMAND_BOS_RESTART 739 -#define IDS_COMMAND_BOS_SALVAGE 740 -#define IDS_COMMAND_BOS_SETAUTH 741 -#define IDS_COMMAND_BOS_SETRESTART 742 -#define IDS_COMMAND_BOS_SHUTDOWN 743 -#define IDS_COMMAND_BOS_START 744 -#define IDS_COMMAND_BOS_STARTUP 745 -#define IDS_COMMAND_BOS_STATUS 746 -#define IDS_COMMAND_BOS_STOP 747 -#define IDS_COMMAND_BOS_UNINSTALL 748 -#define IDS_COMMAND_KAS_GETRANDOMKEY 749 -#define IDS_COMMAND_FS_LISTQUOTA 750 -#define IDS_COMMAND_FS_QUOTA 751 -#define IDS_COMMAND_FS_SETQUOTA 752 -#define IDS_ALERT_DESCSHORT_UNMONITORED 800 -#define IDS_ALERT_DESCSHORT_TIMEOUT 801 -#define IDS_ALERT_DESCSHORT_AGG_FULL 802 -#define IDS_ALERT_DESCSHORT_SET_FULL 803 -#define IDS_ALERT_DESCSHORT_NO_VLDBENT 804 -#define IDS_ALERT_DESCSHORT_NO_SVRENT_SET 805 -#define IDS_ALERT_DESCSHORT_STOPPED 806 -#define IDS_ALERT_DESCSHORT_NO_SVRENT_AGG 808 -#define IDS_ALERT_DESCSHORT_BADCREDS 809 -#define IDS_ALERT_DESCSHORT_AGG_ALLOC 810 -#define IDS_ALERT_DESCSHORT_STATE_NO_VNODE 811 -#define IDS_ALERT_DESCSHORT_STATE_NO_SERVICE 812 -#define IDS_ALERT_DESCSHORT_STATE_OFFLINE 813 -#define IDS_ALERT_DESCFULL_TIMEOUT 831 -#define IDS_ALERT_DESCFULL_AGG_FULL 832 -#define IDS_ALERT_DESCFULL_SET_FULL 833 -#define IDS_ALERT_DESCFULL_NO_VLDBENT 834 -#define IDS_ALERT_DESCFULL_NO_SVRENT_SET 835 -#define IDS_ALERT_DESCFULL_STOPPED 836 -#define IDS_ALERT_DESCFULL_NO_SVRENT_AGG 838 -#define IDS_ALERT_DESCFULL_BADCREDS 839 -#define IDS_ALERT_DESCFULL_AGG_ALLOC 840 -#define IDS_ALERT_DESCFULL_STATE_NO_VNODE 841 -#define IDS_ALERT_DESCFULL_STATE_NO_SERVICE 842 -#define IDS_ALERT_DESCFULL_STATE_OFFLINE 843 -#define IDS_ALERT_FIX_TIMEOUT 861 -#define IDS_ALERT_FIX_AGG_FULL 862 -#define IDS_ALERT_FIX_SET_FULL 863 -#define IDS_ALERT_FIX_NO_VLDBENT 864 -#define IDS_ALERT_FIX_NO_SVRENT_SET 865 -#define IDS_ALERT_FIX_STOPPED 866 -#define IDS_ALERT_FIX_NO_SVRENT_AGG 868 -#define IDS_ALERT_FIX_BADCREDS 869 -#define IDS_ALERT_FIX_AGG_ALLOC 870 -#define IDS_ALERT_FIX_STATE_NO_VNODE 871 -#define IDS_ALERT_FIX_STATE_NO_SERVICE 872 -#define IDS_ALERT_FIX_STATE_OFFLINE 873 -#define IDS_ALERT_BUTTON_TRYAGAIN 900 -#define IDS_ALERT_BUTTON_WARNINGS 901 -#define IDS_ALERT_BUTTON_VIEWLOG 902 -#define IDS_ALERT_BUTTON_SHOWME 903 -#define IDS_ALERT_BUTTON_GETCREDS 904 -#define IDS_ERROR_REFRESH_CELLSERVERS_NOCELL 920 -#define IDS_ERROR_REFRESH_CELLSERVERS 921 -#define IDS_ERROR_CANT_OPEN_CELL 922 -#define IDS_ERROR_REFRESH_AGGREGATES 924 -#define IDS_ERROR_REFRESH_SERVER_STATUS 925 -#define IDS_ERROR_CHANGE_SERVER_STATUS 926 -#define IDS_ERROR_REFRESH_AGGREGATE_STATUS 927 -#define IDS_ERROR_REFRESH_FILESET_STATUS 928 -#define IDS_ERROR_REFRESH_SERVICE_STATUS 929 -#define IDS_ERROR_MOVE_FILESET 930 -#define IDS_ERROR_VIEW_LOGFILE 931 -#define IDS_ERROR_NOT_REPLICATED 932 -#define IDS_ERROR_CANT_CREATE_FILESET 933 -#define IDS_ERROR_CANT_DELETE_FILESET 934 -#define IDS_ERROR_CANT_CREATE_VLDB_ENTRY 935 -#define IDS_ERROR_CANT_SET_FILESET_QUOTA 936 -#define IDS_ERROR_CANT_CREATE_SERVER 937 -#define IDS_ERROR_CANT_PING_SERVER 938 -#define IDS_ERROR_CANT_DELETE_SERVER 939 -#define IDS_ERROR_CANT_DELETE_SERVER_FILESETS 940 -#define IDS_ERROR_CHANGE_AGGREGATE_STATUS 941 -#define IDS_ERROR_CHANGE_SERVICE_STATUS 942 -#define IDS_ERROR_CANT_START_SERVICE 943 -#define IDS_ERROR_CANT_STOP_SERVICE 944 -#define IDS_ERROR_CANT_RESTART_SERVICE 946 -#define IDS_ERROR_CHANGE_REPLICA_STATUS 947 -#define IDS_ERROR_CANT_SYNCVLDB 949 -#define IDS_ERROR_CANT_CREATE_REPLICA 950 -#define IDS_ERROR_CANT_INSTALL_FILE 951 -#define IDS_ERROR_CANT_UNINSTALL_FILE 952 -#define IDS_ERROR_CANT_PRUNE_FILES 953 -#define IDS_ERROR_CANT_RENAME_FILESET 954 -#define IDS_ERROR_CANT_CREATE_SERVICE 955 -#define IDS_ERROR_CANT_DELETE_SERVICE 956 -#define IDS_ERROR_CANT_RELEASE_FILESET 957 -#define IDS_ERROR_CANT_UPDATE_FILESET 958 -#define IDS_ERROR_CANT_UPDATE_ALL 959 -#define IDS_ERROR_CANT_LOAD_ADMLIST 960 -#define IDS_ERROR_CANT_LOAD_KEYLIST 961 -#define IDS_ERROR_CANT_CREATE_KEY 962 -#define IDS_ERROR_CANT_SAVE_ADMLIST 963 -#define IDS_ERROR_CANT_CLONE 964 -#define IDS_ERROR_CANT_CLONESYS 965 -#define IDS_ERROR_CANT_DUMP_FILESET 966 -#define IDS_ERROR_CANT_RESTORE_FILESET 967 -#define IDS_ERROR_CANT_SET_RESTART_TIMES 968 -#define IDS_ERROR_CANT_DELETE_REPLICATED_FILESET 969 -#define IDS_CMDLINE_TITLE 970 -#define IDS_CMDLINE_SYNTAX 971 -#define IDS_CMDLINE_UNRECOGNIZED 972 -#define IDS_CMDLINE_DUPLICATE 973 -#define IDS_CMDLINE_UNEXPECTVALUE 974 -#define IDS_CMDLINE_MISSINGVAL 975 -#define IDS_CMDLINE_SUBSETNOTCELL 976 -#define IDS_CMDLINE_INVALIDSUBSET 977 -#define IDS_CMDLINE_SERVERNOTCELL 978 -#define IDS_CMDLINE_RESET_TITLE 979 -#define IDS_CMDLINE_RESET_DESC 980 -#define IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE 981 -#define IDS_CMDLINE_USERPASSWORD 982 -#define IDS_ERROR_CANT_DELETE_KEY 983 -#define IDS_ERROR_CANT_GETRANDOMKEY 984 -#define IDS_ERROR_CANT_EXECUTE_COMMAND 985 -#define IDS_ERROR_CANT_READ_SALVAGE_LOG 986 -#define IDS_ERROR_CANT_SALVAGE 987 -#define IDS_ERROR_CANT_AUTH_ON 988 -#define IDS_ERROR_CANT_AUTH_OFF 989 -#define IDS_ERROR_CANT_LOAD_HOSTLIST 990 -#define IDS_ERROR_CANT_SAVE_HOSTLIST 991 -#define IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL 992 -#define IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN 993 -#define IDS_ERROR_CANT_CHANGEADDR 994 +#define IDS_ADMCOL_PRINCIPAL 332 +#define IDS_ADMCOL_TYPE 333 +#define IDS_ADMCOL_TYPE_GROUP 334 + +#define IDS_ACTION_RESTORE 336 +#define IDS_COL_AGGS_RESTORE 337 +#define IDS_RESTORE_FILTER 338 +#define IDS_SVC_BOS_TAB 339 +#define IDS_ACTION_SETRESTART 340 +#define IDS_RESTORE_CREATESET 341 +#define IDS_RESTORE_OVERWRITESET 342 +#define IDS_SUBSET_TITLE_LOAD 343 +#define IDS_SUBSET_TITLE_SAVE 344 +#define IDS_BUTTON_OPEN 345 +#define IDS_BUTTON_SAVE 346 +#define IDS_SUBSET_SAVE_TITLE 347 +#define IDS_SUBSET_SAVE_DESC 348 +#define IDS_SUBSET_CHANGED 349 +#define IDS_SUBSET_TAB 350 +#define IDS_SUBSET_DISCARD_TITLE 351 + +#define IDS_SUBSET_DISCARD_DESC 352 +#define IDS_SUBSET_DISCARD_DESC2 353 +#define IDS_SUBSET_NONAME 354 +#define IDS_SUBSET_NOSUBSET 355 +#define IDS_SUBSET_SERVERSUBSET 356 +#define IDS_FILESET_SOME 357 +#define IDS_AGGREGATE_SOME 358 +#define IDS_SERVICE_SOME 359 +#define IDS_FILESET_UNMON 360 +#define IDS_AGGREGATE_UNMON 361 +#define IDS_SERVICE_UNMON 362 +#define IDS_SUBSET_DELETE_TITLE 363 +#define IDS_SUBSET_DELETE_DESC 364 +#define IDS_ERROR_TRANSLATED 365 +#define IDS_ERROR_NOTTRANSLATED 366 +#define IDS_FIND_NOTHING_TITLE 367 + +#define IDS_FIND_NOTHING_DESC 368 +#define IDS_FIND_UNKNOWN_TITLE 369 +#define IDS_FIND_UNKNOWN_DESC 370 +#define IDS_HELPABOUT_DESC1 371 +#define IDS_HELPABOUT_DESC2 372 +#define IDS_HELPABOUT_DESC3 373 +#define IDS_CANT_QUIT_TITLE 374 +#define IDS_CANT_QUIT_REBOOT 375 +#define IDS_APP_TITLE 376 +#define IDS_ACTION_OPENCELL 377 +#define IDS_OPTIONS_TITLE 378 +#define IDS_OPTIONS_GENERAL_TAB 379 +#define IDS_BADCREDS_DESC 380 + +#define IDS_CONFIRMATION_TITLE 384 +#define IDS_NO_GROUP_CHECKBOX 385 +#define IDS_AFS_ID_DIDEXP 386 + +#define IDS_QUERYING 400 +#define IDS_ADMCOL_TYPE_FOREIGN_GROUP 401 +#define IDS_ADMCOL_TYPE_FOREIGN_USER 402 + +#define IDS_SVCCOL_NOTIFIER 416 +#define IDS_SVC_NONOTIFIER 417 +#define IDS_SVR_KEY_TAB 418 +#define IDS_KEYNAME_NOTIME 419 +#define IDS_KEYNAME_WITHTIME 420 +#define IDS_SVRKEY_VERSION 421 +#define IDS_SVRKEY_DATA 422 +#define IDS_SVRKEY_CHECKSUM 423 +#define IDS_SVRKEY_DATA_UNKNOWN 424 +#define IDS_STARTSERVICE_TITLE 425 +#define IDS_STOPSERVICE_TITLE 426 +#define IDS_STARTSERVICE_TEXT 427 + +#define IDS_STOPSERVICE_TEXT 432 +#define IDS_STARTSERVICE_STARTUP 433 +#define IDS_STOPSERVICE_STARTUP 434 +#define IDS_STARTSERVICE_PERMANENT 435 +#define IDS_STARTSERVICE_TEMPORARY 436 +#define IDS_STOPSERVICE_PERMANENT 437 +#define IDS_STOPSERVICE_TEMPORARY 438 +#define IDS_ACTION_EXECUTE 439 +#define IDS_ACTION_SALVAGE_SVR 440 +#define IDS_ACTION_SALVAGE_AGG 441 +#define IDS_ACTION_SALVAGE_VOL 442 +#define IDS_SALVAGE_SVR 443 +#define IDS_SALVAGE_AGG 444 +#define IDS_SALVAGE_SET 445 +#define IDS_SETSTATUS_SALVAGE 446 + +#define IDS_SETSTATUS_LOCKED 448 +#define IDS_SETSTATUS_NO_VOL 449 +#define IDS_SETSTATUS_BUSY 450 +#define IDS_SETSTATUS_MOVED 451 +#define IDS_SVR_CAPACITY 452 +#define IDS_SVR_ALLOCATION 453 +#define IDS_SVRCOL_ADDRESS 454 +#define IDS_HOST_TITLE 456 +#define IDS_SVR_HOSTS_TITLE 457 +#define IDS_SVR_HOST_TAB 458 +#define IDS_ACTION_HOSTLIST_LOAD 459 +#define IDS_ACTION_HOSTLIST_SAVE 460 +#define IDS_SETSTATUS_1ALERT 461 +#define IDS_SETSTATUS_2ALERT 462 + +#define IDS_ACTION_CHANGEADDR 464 + +#define IDS_COMMAND_VOS_ADDSITE 480 +#define IDS_COMMAND_VOS_BACKUP 481 +#define IDS_COMMAND_VOS_BACKUPSYS 482 +#define IDS_COMMAND_VOS_CREATE 483 + +#define IDS_COMMAND_VOS_DELENTRY 496 +#define IDS_COMMAND_VOS_DUMP 497 +#define IDS_COMMAND_VOS_EXAMINE 498 +#define IDS_COMMAND_VOS_LISTPART 499 +#define IDS_COMMAND_VOS_LISTVLDB 500 +#define IDS_COMMAND_VOS_LISTVOL 501 +#define IDS_COMMAND_VOS_LOCK 502 +#define IDS_COMMAND_VOS_MOVE 503 +#define IDS_COMMAND_VOS_PARTINFO 504 +#define IDS_COMMAND_VOS_RELEASE 505 +#define IDS_COMMAND_VOS_REMOVE 506 +#define IDS_COMMAND_VOS_REMSITE 507 +#define IDS_COMMAND_VOS_RENAME 508 +#define IDS_COMMAND_VOS_RESTORE 509 +#define IDS_COMMAND_VOS_SYNCVLDB 510 +#define IDS_COMMAND_VOS_UNLOCK 511 + +#define IDS_COMMAND_VOS_UNLOCKVLDB 512 +#define IDS_COMMAND_VOS_ZAP 513 +#define IDS_COMMAND_BOS_ADDHOST 514 +#define IDS_COMMAND_BOS_ADDKEY 515 +#define IDS_COMMAND_BOS_ADDUSER 516 +#define IDS_COMMAND_BOS_CREATE 517 +#define IDS_COMMAND_BOS_DELETE 518 +#define IDS_COMMAND_BOS_EXEC 519 +#define IDS_COMMAND_BOS_GETDATE 520 +#define IDS_COMMAND_BOS_GETLOG 521 +#define IDS_COMMAND_BOS_GETRESTART 522 +#define IDS_COMMAND_BOS_INSTALL 523 +#define IDS_COMMAND_BOS_LISTHOSTS 524 +#define IDS_COMMAND_BOS_LISTKEYS 525 +#define IDS_COMMAND_BOS_LISTUSERS 526 +#define IDS_COMMAND_BOS_PRUNE 527 + +#define IDS_COMMAND_BOS_REMOVEHOST 528 +#define IDS_COMMAND_BOS_REMOVEKEY 529 +#define IDS_COMMAND_BOS_REMOVEUSER 530 +#define IDS_COMMAND_BOS_RESTART 531 +#define IDS_COMMAND_BOS_SALVAGE 532 +#define IDS_COMMAND_BOS_SETAUTH 533 +#define IDS_COMMAND_BOS_SETRESTART 534 +#define IDS_COMMAND_BOS_SHUTDOWN 535 +#define IDS_COMMAND_BOS_START 536 +#define IDS_COMMAND_BOS_STARTUP 537 +#define IDS_COMMAND_BOS_STATUS 538 +#define IDS_COMMAND_BOS_STOP 539 +#define IDS_COMMAND_BOS_UNINSTALL 540 +#define IDS_COMMAND_KAS_GETRANDOMKEY 541 +#define IDS_COMMAND_FS_LISTQUOTA 542 +#define IDS_COMMAND_FS_QUOTA 543 + +#define IDS_COMMAND_FS_SETQUOTA 544 + +#define IDS_ALERT_DESCSHORT_UNMONITORED 560 +#define IDS_ALERT_DESCSHORT_TIMEOUT 561 +#define IDS_ALERT_DESCSHORT_AGG_FULL 562 +#define IDS_ALERT_DESCSHORT_SET_FULL 563 +#define IDS_ALERT_DESCSHORT_NO_VLDBENT 564 +#define IDS_ALERT_DESCSHORT_NO_SVRENT_SET 565 +#define IDS_ALERT_DESCSHORT_STOPPED 566 +#define IDS_ALERT_DESCSHORT_NO_SVRENT_AGG 567 +#define IDS_ALERT_DESCSHORT_BADCREDS 568 +#define IDS_ALERT_DESCSHORT_AGG_ALLOC 569 +#define IDS_ALERT_DESCSHORT_STATE_NO_VNODE 570 +#define IDS_ALERT_DESCSHORT_STATE_NO_SERVICE 571 +#define IDS_ALERT_DESCSHORT_STATE_OFFLINE 572 + +#define IDS_ALERT_DESCFULL_TIMEOUT 576 + +#define IDS_ALERT_DESCFULL_AGG_FULL 592 +#define IDS_ALERT_DESCFULL_SET_FULL 593 +#define IDS_ALERT_DESCFULL_NO_VLDBENT 594 +#define IDS_ALERT_DESCFULL_NO_SVRENT_SET 595 +#define IDS_ALERT_DESCFULL_STOPPED 596 +#define IDS_ALERT_DESCFULL_NO_SVRENT_AGG 597 +#define IDS_ALERT_DESCFULL_BADCREDS 598 +#define IDS_ALERT_DESCFULL_AGG_ALLOC 599 +#define IDS_ALERT_DESCFULL_STATE_NO_VNODE 600 +#define IDS_ALERT_DESCFULL_STATE_NO_SERVICE 601 +#define IDS_ALERT_DESCFULL_STATE_OFFLINE 602 + +#define IDS_ALERT_FIX_TIMEOUT 608 +#define IDS_ALERT_FIX_AGG_FULL 609 +#define IDS_ALERT_FIX_SET_FULL 610 + +#define IDS_ALERT_FIX_NO_VLDBENT 624 +#define IDS_ALERT_FIX_NO_SVRENT_SET 625 +#define IDS_ALERT_FIX_STOPPED 626 +#define IDS_ALERT_FIX_NO_SVRENT_AGG 627 +#define IDS_ALERT_FIX_BADCREDS 628 +#define IDS_ALERT_FIX_AGG_ALLOC 629 +#define IDS_ALERT_FIX_STATE_NO_VNODE 630 +#define IDS_ALERT_FIX_STATE_NO_SERVICE 631 +#define IDS_ALERT_FIX_STATE_OFFLINE 632 + +#define IDS_ALERT_BUTTON_TRYAGAIN 640 +#define IDS_ALERT_BUTTON_WARNINGS 641 +#define IDS_ALERT_BUTTON_VIEWLOG 642 +#define IDS_ALERT_BUTTON_SHOWME 643 +#define IDS_ALERT_BUTTON_GETCREDS 644 + +#define IDS_ERROR_REFRESH_CELLSERVERS_NOCELL 656 +#define IDS_ERROR_REFRESH_CELLSERVERS 657 +#define IDS_ERROR_CANT_OPEN_CELL 658 +#define IDS_ERROR_REFRESH_AGGREGATES 659 +#define IDS_ERROR_REFRESH_SERVER_STATUS 660 +#define IDS_ERROR_CHANGE_SERVER_STATUS 661 +#define IDS_ERROR_REFRESH_AGGREGATE_STATUS 662 + +#define IDS_ERROR_REFRESH_FILESET_STATUS 672 +#define IDS_ERROR_REFRESH_SERVICE_STATUS 673 +#define IDS_ERROR_MOVE_FILESET 674 +#define IDS_ERROR_VIEW_LOGFILE 675 +#define IDS_ERROR_NOT_REPLICATED 676 +#define IDS_ERROR_CANT_CREATE_FILESET 677 +#define IDS_ERROR_CANT_DELETE_FILESET 678 +#define IDS_ERROR_CANT_CREATE_VLDB_ENTRY 679 +#define IDS_ERROR_CANT_SET_FILESET_QUOTA 680 +#define IDS_ERROR_CANT_CREATE_SERVER 681 +#define IDS_ERROR_CANT_PING_SERVER 682 +#define IDS_ERROR_CANT_DELETE_SERVER 683 +#define IDS_ERROR_CANT_DELETE_SERVER_FILESETS 684 +#define IDS_ERROR_CHANGE_AGGREGATE_STATUS 685 +#define IDS_ERROR_CHANGE_SERVICE_STATUS 686 +#define IDS_ERROR_CANT_START_SERVICE 687 + +#define IDS_ERROR_CANT_STOP_SERVICE 688 +#define IDS_ERROR_CANT_RESTART_SERVICE 689 +#define IDS_ERROR_CHANGE_REPLICA_STATUS 690 +#define IDS_ERROR_CANT_SYNCVLDB 691 +#define IDS_ERROR_CANT_CREATE_REPLICA 692 +#define IDS_ERROR_CANT_INSTALL_FILE 693 +#define IDS_ERROR_CANT_UNINSTALL_FILE 694 +#define IDS_ERROR_CANT_PRUNE_FILES 695 +#define IDS_ERROR_CANT_RENAME_FILESET 696 +#define IDS_ERROR_CANT_CREATE_SERVICE 697 +#define IDS_ERROR_CANT_DELETE_SERVICE 698 +#define IDS_ERROR_CANT_RELEASE_FILESET 699 +#define IDS_ERROR_CANT_UPDATE_FILESET 700 +#define IDS_ERROR_CANT_UPDATE_ALL 701 + +#define IDS_ERROR_CANT_LOAD_ADMLIST 704 +#define IDS_ERROR_CANT_LOAD_KEYLIST 705 +#define IDS_ERROR_CANT_CREATE_KEY 706 +#define IDS_ERROR_CANT_SAVE_ADMLIST 707 +#define IDS_ERROR_CANT_CLONE 708 +#define IDS_ERROR_CANT_CLONESYS 709 +#define IDS_ERROR_CANT_DUMP_FILESET 710 +#define IDS_ERROR_CANT_RESTORE_FILESET 711 +#define IDS_ERROR_CANT_SET_RESTART_TIMES 712 +#define IDS_ERROR_CANT_DELETE_REPLICATED_FILESET 713 +#define IDS_CMDLINE_TITLE 714 +#define IDS_CMDLINE_SYNTAX 715 +#define IDS_CMDLINE_UNRECOGNIZED 716 +#define IDS_CMDLINE_DUPLICATE 717 +#define IDS_CMDLINE_UNEXPECTVALUE 718 +#define IDS_CMDLINE_MISSINGVAL 719 + +#define IDS_CMDLINE_SUBSETNOTCELL 720 +#define IDS_CMDLINE_INVALIDSUBSET 721 +#define IDS_CMDLINE_SERVERNOTCELL 722 +#define IDS_CMDLINE_RESET_TITLE 723 +#define IDS_CMDLINE_RESET_DESC 724 +#define IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE 725 +#define IDS_CMDLINE_USERPASSWORD 726 +#define IDS_ERROR_CANT_DELETE_KEY 727 +#define IDS_ERROR_CANT_GETRANDOMKEY 728 +#define IDS_ERROR_CANT_EXECUTE_COMMAND 729 +#define IDS_ERROR_CANT_READ_SALVAGE_LOG 730 +#define IDS_ERROR_CANT_SALVAGE 731 +#define IDS_ERROR_CANT_AUTH_ON 732 +#define IDS_ERROR_CANT_AUTH_OFF 733 +#define IDS_ERROR_CANT_LOAD_HOSTLIST 734 +#define IDS_ERROR_CANT_SAVE_HOSTLIST 735 + +#define IDS_ERROR_CANT_INIT_AFSCLASS_INSTALL 736 +#define IDS_ERROR_CANT_INIT_AFSCLASS_UNKNOWN 737 +#define IDS_ERROR_CANT_CHANGEADDR 738 + +#define IDS_SERVER_SERVICE 752 +#define IDS_SERVICETYPE_SIMPLE 753 +#define IDS_SERVICETYPE_CRON 754 +#define IDS_SERVICESTATE_STOPPED 755 +#define IDS_SERVICESTATE_STOPPING 756 +#define IDS_SERVICESTATE_STARTING 757 +#define IDS_SERVICESTATE_RUNNING 758 +#define IDS_SERVICETYPE_FS_LONG 759 +#define IDS_SERVICETYPE_FS 760 +#define IDS_SERVICE_LASTERROR 761 +#define IDS_SERVICES_IN_CELL 762 +#define IDS_SERVICE_STARTDATE 763 +#define IDS_SERVICE_STOPDATE 764 + #define IDC_CELL 1000 #define IDC_SERVERS 1001 #define IDC_TABS 1002 diff --git a/src/WINNT/afssvrmgr/set_clone.cpp b/src/WINNT/afssvrmgr/set_clone.cpp index 6bfdcab80..b0dbc3fe6 100644 --- a/src/WINNT/afssvrmgr/set_clone.cpp +++ b/src/WINNT/afssvrmgr/set_clone.cpp @@ -280,7 +280,7 @@ void Filesets_Clonesys_OnSelect (HWND hDlg, LPSET_CLONESYS_PARAMS pcsp) if (!fEnable) CheckDlgButton (hDlg, IDC_CLONE_AGG_LIMIT, FALSE); - fEnable &= IsDlgButtonChecked (hDlg, IDC_CLONE_AGG_LIMIT) && pcsp->fEnumedAggregs; + fEnable = fEnable && IsDlgButtonChecked (hDlg, IDC_CLONE_AGG_LIMIT) && pcsp->fEnumedAggregs; EnableWindow (GetDlgItem (hDlg, IDC_CLONE_AGG), fEnable); fEnable = IsDlgButtonChecked (hDlg, IDC_CLONE_PREFIX_LIMIT); diff --git a/src/WINNT/afssvrmgr/set_tab.cpp b/src/WINNT/afssvrmgr/set_tab.cpp index 7ce28ef8e..9d6cab3cb 100644 --- a/src/WINNT/afssvrmgr/set_tab.cpp +++ b/src/WINNT/afssvrmgr/set_tab.cpp @@ -34,13 +34,13 @@ extern "C" { */ rwWindowData awdFilesets[] = { - { IDC_SET_DESC, raSizeX }, - { IDC_SET_LIST, raSizeX | raSizeY }, - { IDC_SET_CREATE, raMoveX | raMoveY }, - { IDC_SET_DELETE, raMoveX | raMoveY }, - { IDC_SET_REP, raMoveX | raMoveY }, - { IDC_SET_SETQUOTA, raMoveX | raMoveY }, - { idENDLIST, 0 } + { IDC_SET_DESC, raSizeX, 0, 0 }, + { IDC_SET_LIST, raSizeX | raSizeY, 0, 0 }, + { IDC_SET_CREATE, raMoveX | raMoveY, 0, 0 }, + { IDC_SET_DELETE, raMoveX | raMoveY, 0, 0 }, + { IDC_SET_REP, raMoveX | raMoveY, 0, 0 }, + { IDC_SET_SETQUOTA, raMoveX | raMoveY, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/afssvrmgr/svc_tab.cpp b/src/WINNT/afssvrmgr/svc_tab.cpp index 0227dcc27..4dfc9748a 100644 --- a/src/WINNT/afssvrmgr/svc_tab.cpp +++ b/src/WINNT/afssvrmgr/svc_tab.cpp @@ -26,12 +26,12 @@ extern "C" { */ rwWindowData awdServices[] = { - { IDC_SVC_DESC, raSizeX }, - { IDC_SVC_LIST, raSizeX | raSizeY }, - { IDC_SVC_CREATE, raMoveX | raMoveY }, - { IDC_SVC_DELETE, raMoveX | raMoveY }, - { IDC_SVC_RESTART, raMoveX | raMoveY }, - { idENDLIST, 0 } + { IDC_SVC_DESC, raSizeX, 0, 0 }, + { IDC_SVC_LIST, raSizeX | raSizeY, 0, 0 }, + { IDC_SVC_CREATE, raMoveX | raMoveY, 0, 0 }, + { IDC_SVC_DELETE, raMoveX | raMoveY, 0, 0 }, + { IDC_SVC_RESTART, raMoveX | raMoveY, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/afssvrmgr/svc_viewlog.cpp b/src/WINNT/afssvrmgr/svc_viewlog.cpp index a73689fed..7cbc57d13 100644 --- a/src/WINNT/afssvrmgr/svc_viewlog.cpp +++ b/src/WINNT/afssvrmgr/svc_viewlog.cpp @@ -30,13 +30,13 @@ extern "C" { */ rwWindowData awdShowLog[] = { - { IDC_SVC_VIEWLOG_DESC, raSizeX | raRepaint }, - { IDC_SVC_VIEWLOG_FILENAME, raSizeX | raRepaint }, - { IDC_VIEWLOG_TEXT, raSizeX | raSizeY | raRepaint, MAKELONG(cxMIN_VIEWLOG,cyMIN_VIEWLOG) }, - { IDC_SVC_VIEWLOG_CONTENTS, raSizeX }, - { IDOK, raMoveX | raMoveY }, - { IDC_VIEWLOG_SAVEAS, raMoveX | raMoveY }, - { idENDLIST, 0 } + { IDC_SVC_VIEWLOG_DESC, raSizeX | raRepaint, 0, 0 }, + { IDC_SVC_VIEWLOG_FILENAME, raSizeX | raRepaint, 0, 0 }, + { IDC_VIEWLOG_TEXT, raSizeX | raSizeY | raRepaint, MAKELONG(cxMIN_VIEWLOG,cyMIN_VIEWLOG), 0 }, + { IDC_SVC_VIEWLOG_CONTENTS, raSizeX, 0, 0 }, + { IDOK, raMoveX | raMoveY, 0, 0 }, + { IDC_VIEWLOG_SAVEAS, raMoveX | raMoveY, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/afssvrmgr/svr_col.cpp b/src/WINNT/afssvrmgr/svr_col.cpp index 15b39dc26..40d0fb091 100644 --- a/src/WINNT/afssvrmgr/svr_col.cpp +++ b/src/WINNT/afssvrmgr/svr_col.cpp @@ -95,7 +95,7 @@ LPTSTR Server_GetColumnText (LPIDENT lpi, SERVERCOLUMN svrcol) break; case svrcolADDRESS: - if (lpss) + if (lpss) FormatSockAddr (pszBuffer, TEXT("%a"), &lpss->aAddresses[0]); break; diff --git a/src/WINNT/afssvrmgr/svr_salvage.cpp b/src/WINNT/afssvrmgr/svr_salvage.cpp index c08ae7a5b..2cc46ba14 100644 --- a/src/WINNT/afssvrmgr/svr_salvage.cpp +++ b/src/WINNT/afssvrmgr/svr_salvage.cpp @@ -32,10 +32,10 @@ extern "C" { */ rwWindowData awdSalvageResults[] = { - { IDC_SALVAGE_TITLE, raSizeX | raRepaint }, - { IDC_SALVAGE_DETAILS, raSizeX | raSizeY | raRepaint, MAKELONG(cxMIN_SALVAGE_R,cyMIN_SALVAGE_R) }, - { IDOK, raMoveX | raMoveY }, - { idENDLIST, 0 } + { IDC_SALVAGE_TITLE, raSizeX | raRepaint, 0, 0 }, + { IDC_SALVAGE_DETAILS, raSizeX | raSizeY | raRepaint, MAKELONG(cxMIN_SALVAGE_R,cyMIN_SALVAGE_R), 0 }, + { IDOK, raMoveX | raMoveY, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/afssvrmgr/svr_window.cpp b/src/WINNT/afssvrmgr/svr_window.cpp index 0cd18811f..d57f07008 100644 --- a/src/WINNT/afssvrmgr/svr_window.cpp +++ b/src/WINNT/afssvrmgr/svr_window.cpp @@ -31,13 +31,13 @@ extern "C" { #define cyMIN_SERVER 100 static rwWindowData awdServer[] = { - { IDC_TABS, raSizeX | raSizeY, MAKELONG(cxMIN_SERVER,cyMIN_SERVER) }, - { idENDLIST, 0 } + { IDC_TABS, raSizeX | raSizeY, MAKELONG(cxMIN_SERVER,cyMIN_SERVER), 0 }, + { idENDLIST, 0, 0, 0 } }; static rwWindowData awdTabChild[] = { - { 0, raSizeX | raSizeY }, - { idENDLIST, 0 } + { 0, raSizeX | raSizeY, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/afssvrmgr/svrmgr.cpp b/src/WINNT/afssvrmgr/svrmgr.cpp index d25336279..eb1aec257 100644 --- a/src/WINNT/afssvrmgr/svrmgr.cpp +++ b/src/WINNT/afssvrmgr/svrmgr.cpp @@ -59,7 +59,7 @@ void ExitApplication (void); * */ -int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR pszCmdLineA, int nCmdShow) +extern "C" int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR pszCmdLineA, int nCmdShow) { LPTSTR pszCmdLine = AnsiToString (pszCmdLineA); diff --git a/src/WINNT/afssvrmgr/task.cpp b/src/WINNT/afssvrmgr/task.cpp index 9011f948e..775d2675e 100644 --- a/src/WINNT/afssvrmgr/task.cpp +++ b/src/WINNT/afssvrmgr/task.cpp @@ -81,10 +81,6 @@ extern "C" { * */ -DWORD WINAPI Task_ThreadProc (PVOID lp); - -void Task_Perform (LPTASKPACKET ptp); - #ifdef DEBUG void Task_ExportCell (LPTASKPACKET ptp); #endif diff --git a/src/WINNT/afssvrmgr/window.cpp b/src/WINNT/afssvrmgr/window.cpp index dc129b5b8..4b830b1b7 100644 --- a/src/WINNT/afssvrmgr/window.cpp +++ b/src/WINNT/afssvrmgr/window.cpp @@ -47,48 +47,48 @@ extern "C" { #define cyMIN_WINDOW 120 rwWindowData awdMain[] = { - { IDC_CELL_BORDER, raSizeX }, - { IDC_CELL, raSizeX | raRepaint }, - { IDC_AFS_ID, raSizeX | raRepaint }, - { IDC_SERVERS, raSizeX | raSizeY, MAKELONG(cxMIN_SERVER,cyMIN_SERVER) }, - { IDC_COVERDLG, raSizeX | raSizeY }, - { IDC_ANIMATE, raMoveX }, - { idENDLIST, 0 } + { IDC_CELL_BORDER, raSizeX, 0, 0 }, + { IDC_CELL, raSizeX | raRepaint, 0, 0 }, + { IDC_AFS_ID, raSizeX | raRepaint, 0, 0 }, + { IDC_SERVERS, raSizeX | raSizeY, MAKELONG(cxMIN_SERVER,cyMIN_SERVER), 0 }, + { IDC_COVERDLG, raSizeX | raSizeY, 0, 0 }, + { IDC_ANIMATE, raMoveX, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; rwWindowData awdMainVert[] = { - { IDC_CELL_BORDER, raSizeX }, - { IDC_CELL, raSizeX | raRepaint }, - { IDC_AFS_ID, raSizeX | raRepaint }, - { IDC_SERVERS, raSizeX, MAKELONG(cxMIN_SERVER,cyMIN_SERVER) }, - { IDC_SPLITTER_SERVER, raSizeX }, - { IDC_TABS, raSizeX | raSizeY, MAKELONG(cxMIN_TABS,cyMIN_TABS) }, - { IDC_COVERDLG, raSizeX }, - { IDC_ANIMATE, raMoveX }, - { idENDLIST, 0 } + { IDC_CELL_BORDER, raSizeX, 0, 0 }, + { IDC_CELL, raSizeX | raRepaint, 0, 0 }, + { IDC_AFS_ID, raSizeX | raRepaint, 0, 0 }, + { IDC_SERVERS, raSizeX, MAKELONG(cxMIN_SERVER,cyMIN_SERVER), 0 }, + { IDC_SPLITTER_SERVER, raSizeX, 0, 0 }, + { IDC_TABS, raSizeX | raSizeY, MAKELONG(cxMIN_TABS,cyMIN_TABS), 0 }, + { IDC_COVERDLG, raSizeX, 0, 0 }, + { IDC_ANIMATE, raMoveX, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; rwWindowData awdMainHorz[] = { - { IDC_CELL_BORDER, raSizeX }, - { IDC_CELL, raSizeX | raRepaint }, - { IDC_AFS_ID, raSizeX | raRepaint }, - { IDC_SERVERS, raSizeY, MAKELONG(cxMIN_SERVER,cyMIN_SERVER) }, - { IDC_SPLITTER_SERVER, raSizeY }, - { IDC_TABS, raSizeX | raSizeY, MAKELONG(cxMIN_TABS,cyMIN_TABS) }, - { IDC_COVERDLG, raSizeY }, - { IDC_ANIMATE, raMoveX }, - { idENDLIST, 0 } + { IDC_CELL_BORDER, raSizeX, 0, 0 }, + { IDC_CELL, raSizeX | raRepaint, 0, 0 }, + { IDC_AFS_ID, raSizeX | raRepaint, 0, 0 }, + { IDC_SERVERS, raSizeY, MAKELONG(cxMIN_SERVER,cyMIN_SERVER), 0 }, + { IDC_SPLITTER_SERVER, raSizeY, 0, 0 }, + { IDC_TABS, raSizeX | raSizeY, MAKELONG(cxMIN_TABS,cyMIN_TABS), 0 }, + { IDC_COVERDLG, raSizeY, 0, 0 }, + { IDC_ANIMATE, raMoveX, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; rwWindowData awdSplitServer[] = { - { IDC_CELL, raRepaint }, - { IDC_AFS_ID, raRepaint }, - { IDC_SERVERS, raSizeX | raSizeY, MAKELONG(cxMIN_SERVER,cyMIN_SERVER) }, - { IDC_SPLITTER_SERVER, raMoveX | raMoveY }, - { IDC_TABS, raMoveX | raMoveY | raSizeXB | raSizeYB, MAKELONG(cxMIN_TABS,cyMIN_TABS) }, - { IDC_COVERDLG, raSizeX | raSizeY }, - { IDC_ANIMATE, 0 }, - { idENDLIST, 0 } + { IDC_CELL, raRepaint, 0, 0 }, + { IDC_AFS_ID, raRepaint, 0, 0 }, + { IDC_SERVERS, raSizeX | raSizeY, MAKELONG(cxMIN_SERVER,cyMIN_SERVER), 0 }, + { IDC_SPLITTER_SERVER, raMoveX | raMoveY, 0, 0 }, + { IDC_TABS, raMoveX | raMoveY | raSizeXB | raSizeYB, MAKELONG(cxMIN_TABS,cyMIN_TABS), 0 }, + { IDC_COVERDLG, raSizeX | raSizeY, 0, 0 }, + { IDC_ANIMATE, 0, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; @@ -100,9 +100,7 @@ rwWindowData awdSplitServer[] = { void Main_OnNotifyFromDispatch (LPNOTIFYSTRUCT lpns); void Main_OnPreviewPane (BOOL fPreviewNew, BOOL fVertNew, BOOL fStoreView); -void Main_OnServerView (int lvsNew); DWORD WINAPI Main_OnOpenServers_ThreadProc (PVOID lp); -void Main_OnEndTask_Properties (LPTASKPACKET ptp); void Main_SubclassServers (HWND hDlg); diff --git a/src/WINNT/afsusrmgr/NTMakefile b/src/WINNT/afsusrmgr/NTMakefile index 12b25885f..422c47816 100644 --- a/src/WINNT/afsusrmgr/NTMakefile +++ b/src/WINNT/afsusrmgr/NTMakefile @@ -18,7 +18,7 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -DIGNORE_STDS_H AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include # include the primary makefile - +RELDIR=WINNT\afsusrmgr !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version @@ -30,40 +30,40 @@ AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include EXEFILE = $(DESTDIR)\root.server\usr\afs\bin\TaAfsAccountManager.exe EXEOBJS = \ - AfsUsrMgr_stub.res \ - action.obj \ - browse.obj \ - cell_prop.obj \ - cmdline.obj \ - columns.obj \ - command.obj \ - creds.obj \ - display.obj \ - errdata.obj \ - general.obj \ - grp_col.obj \ - grp_create.obj \ - grp_delete.obj \ - grp_prop.obj \ - grp_rename.obj \ - grp_tab.obj \ - helpfunc.obj \ - main.obj \ - mch_col.obj \ - mch_create.obj \ - mch_delete.obj \ - mch_tab.obj \ - options.obj \ - task.obj \ - usr_col.obj \ - usr_cpw.obj \ - usr_create.obj \ - usr_delete.obj \ - usr_prop.obj \ - usr_search.obj \ - usr_tab.obj \ - window.obj \ - winlist.obj + $(OUT)\AfsUsrMgr_stub.res \ + $(OUT)\action.obj \ + $(OUT)\browse.obj \ + $(OUT)\cell_prop.obj \ + $(OUT)\cmdline.obj \ + $(OUT)\columns.obj \ + $(OUT)\command.obj \ + $(OUT)\creds.obj \ + $(OUT)\display.obj \ + $(OUT)\errdata.obj \ + $(OUT)\general.obj \ + $(OUT)\grp_col.obj \ + $(OUT)\grp_create.obj \ + $(OUT)\grp_delete.obj \ + $(OUT)\grp_prop.obj \ + $(OUT)\grp_rename.obj \ + $(OUT)\grp_tab.obj \ + $(OUT)\helpfunc.obj \ + $(OUT)\main.obj \ + $(OUT)\mch_col.obj \ + $(OUT)\mch_create.obj \ + $(OUT)\mch_delete.obj \ + $(OUT)\mch_tab.obj \ + $(OUT)\options.obj \ + $(OUT)\task.obj \ + $(OUT)\usr_col.obj \ + $(OUT)\usr_cpw.obj \ + $(OUT)\usr_create.obj \ + $(OUT)\usr_delete.obj \ + $(OUT)\usr_prop.obj \ + $(OUT)\usr_search.obj \ + $(OUT)\usr_tab.obj \ + $(OUT)\window.obj \ + $(OUT)\winlist.obj VCLIBS =\ comctl32.lib \ @@ -91,5 +91,11 @@ install : $(EXEFILE) lang # Dependencies # -AfsUsrMgr_stub.res : AfsUsrMgr_stub.rc AFS_component_version_number.h +$(OUT)\AfsUsrMgr_stub.res : AFS_component_version_number.h +mkdir: + -mkdir $(OUT)\lang + cd lang + nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir + cd .. + diff --git a/src/WINNT/afsusrmgr/action.cpp b/src/WINNT/afsusrmgr/action.cpp index 48d48970b..22bfb76b7 100644 --- a/src/WINNT/afsusrmgr/action.cpp +++ b/src/WINNT/afsusrmgr/action.cpp @@ -59,9 +59,9 @@ static struct } l; rwWindowData awdActions[] = { - { IDC_ACTION_DESC, raSizeX | raRepaint }, - { IDC_ACTION_LIST, raSizeX | raSizeY, MAKELONG(cxMIN_ACTION,cyMIN_ACTION) }, - { idENDLIST, 0 } + { IDC_ACTION_DESC, raSizeX | raRepaint, 0, 0 }, + { IDC_ACTION_LIST, raSizeX | raSizeY, MAKELONG(cxMIN_ACTION,cyMIN_ACTION), 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/afsusrmgr/cmdline.cpp b/src/WINNT/afsusrmgr/cmdline.cpp index cd3d950d0..36abdb6e4 100644 --- a/src/WINNT/afsusrmgr/cmdline.cpp +++ b/src/WINNT/afsusrmgr/cmdline.cpp @@ -38,10 +38,10 @@ static struct { BOOL fPresent; TCHAR szValue[ cchRESOURCE ]; } aSWITCHES[] = { - { TEXT("cell"), TRUE }, - { TEXT("remote"), TRUE }, - { TEXT("user"), TRUE }, - { TEXT("password"), TRUE } + { TEXT("cell"), TRUE, FALSE, TEXT("") }, + { TEXT("remote"), TRUE, FALSE, TEXT("") }, + { TEXT("user"), TRUE, FALSE, TEXT("") }, + { TEXT("password"), TRUE, FALSE, TEXT("") } }; #define nSWITCHES (sizeof(aSWITCHES) / sizeof(aSWITCHES[0])) diff --git a/src/WINNT/afsusrmgr/columns.cpp b/src/WINNT/afsusrmgr/columns.cpp index fb3e8fef6..16eeefea3 100644 --- a/src/WINNT/afsusrmgr/columns.cpp +++ b/src/WINNT/afsusrmgr/columns.cpp @@ -55,9 +55,9 @@ static struct } COLUMNS[] = { - { IDS_COL_USERS, FALSE }, // ceUSERS - { IDS_COL_GROUPS, FALSE }, // ceGROUPS - { IDS_COL_MACHINES, FALSE }, // ceMACHINES + { IDS_COL_USERS, FALSE, {0}, FALSE }, // ceUSERS + { IDS_COL_GROUPS, FALSE, {0}, FALSE }, // ceGROUPS + { IDS_COL_MACHINES, FALSE, {0}, FALSE }, // ceMACHINES }; #define nCOLUMNS (sizeof(COLUMNS)/sizeof(COLUMNS[0])) diff --git a/src/WINNT/afsusrmgr/grp_tab.cpp b/src/WINNT/afsusrmgr/grp_tab.cpp index 8c503da52..024f234ce 100644 --- a/src/WINNT/afsusrmgr/grp_tab.cpp +++ b/src/WINNT/afsusrmgr/grp_tab.cpp @@ -25,16 +25,16 @@ extern "C" { */ rwWindowData awdGroupsTab[] = { - { IDC_GROUPS_TITLE, raRepaint | raSizeX }, - { IDC_ADVANCED, raMoveX }, - { IDC_GROUPS_PATTERN, raMoveX }, - { IDC_GROUPS_PATTERN_PROMPT, raRepaint | raMoveX }, - { IDC_GROUPS_LIST, raSizeX | raSizeY }, - { M_GROUP_CREATE, raMoveX | raMoveY }, - { M_MEMBERSHIP, raMoveX | raMoveY }, - { M_PROPERTIES, raMoveX | raMoveY }, - { IDC_STATIC, raRepaint }, - { idENDLIST, 0 } + { IDC_GROUPS_TITLE, raRepaint | raSizeX, 0, 0 }, + { IDC_ADVANCED, raMoveX, 0, 0 }, + { IDC_GROUPS_PATTERN, raMoveX, 0, 0 }, + { IDC_GROUPS_PATTERN_PROMPT, raRepaint | raMoveX, 0, 0 }, + { IDC_GROUPS_LIST, raSizeX | raSizeY, 0, 0 }, + { M_GROUP_CREATE, raMoveX | raMoveY, 0, 0 }, + { M_MEMBERSHIP, raMoveX | raMoveY, 0, 0 }, + { M_PROPERTIES, raMoveX | raMoveY, 0, 0 }, + { IDC_STATIC, raRepaint, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/afsusrmgr/lang/NTMakefile b/src/WINNT/afsusrmgr/lang/NTMakefile index 6d8a17c55..b82b55a94 100644 --- a/src/WINNT/afsusrmgr/lang/NTMakefile +++ b/src/WINNT/afsusrmgr/lang/NTMakefile @@ -10,7 +10,7 @@ AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include -I.. # include the primary makefile - +RELDIR=WINNT\afsusrmgr\lang !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\..\config\NTMakefile.version @@ -35,7 +35,7 @@ DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\TaAfsAccountManager_$(LANGID).dll RCFILE = $(LANGNAME)\AfsUsrMgr.rc -RESFILE = AfsUsrMgr_$(LANGID).res +RESFILE = $(OUT)\AfsUsrMgr_$(LANGID).res DLLOBJS = $(RESFILE) @@ -48,7 +48,8 @@ $(DLLFILE) : $(DLLOBJS) install : $(DLLFILE) clean :: - @if exist *.res del *.res + @if exist $(OUT)\*.res del $(OUT)\*.res + @if exist AFS_component_version_number.h del AFS_component_version_number.h @if exist RC*. del RC*. @if exist RD*. del RD*. @@ -60,3 +61,6 @@ clean :: $(RESFILE) : $(RCFILE) AFS_component_version_number.h $(RC) /fo$(RESFILE) /c$(LANGCP) $(RCFILE) + +mkdir: + diff --git a/src/WINNT/afsusrmgr/main.cpp b/src/WINNT/afsusrmgr/main.cpp index 79e4b30fd..50952302c 100644 --- a/src/WINNT/afsusrmgr/main.cpp +++ b/src/WINNT/afsusrmgr/main.cpp @@ -56,7 +56,7 @@ void ExitApplication (void); * */ -int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR pszCmdLineA, int nCmdShow) +extern "C" int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR pszCmdLineA, int nCmdShow) { LPTSTR pszCmdLine = AnsiToString (pszCmdLineA); diff --git a/src/WINNT/afsusrmgr/mch_delete.cpp b/src/WINNT/afsusrmgr/mch_delete.cpp index 74eda42ff..dfdb722c4 100644 --- a/src/WINNT/afsusrmgr/mch_delete.cpp +++ b/src/WINNT/afsusrmgr/mch_delete.cpp @@ -30,7 +30,6 @@ extern "C" { BOOL CALLBACK Machine_Delete_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp); void Machine_Delete_OnInitDialog (HWND hDlg); void Machine_Delete_OnDestroy (HWND hDlg); -void Machine_Delete_OnCheck (HWND hDlg); void Machine_Delete_OnOK (HWND hDlg); diff --git a/src/WINNT/afsusrmgr/mch_tab.cpp b/src/WINNT/afsusrmgr/mch_tab.cpp index ba031e291..116117a03 100644 --- a/src/WINNT/afsusrmgr/mch_tab.cpp +++ b/src/WINNT/afsusrmgr/mch_tab.cpp @@ -25,16 +25,16 @@ extern "C" { */ rwWindowData awdMachinesTab[] = { - { IDC_MACHINES_TITLE, raRepaint | raSizeX }, - { IDC_ADVANCED, raMoveX }, - { IDC_MACHINES_PATTERN, raMoveX }, - { IDC_MACHINES_PATTERN_PROMPT, raRepaint | raMoveX }, - { IDC_MACHINES_LIST, raSizeX | raSizeY }, - { M_MACHINE_CREATE, raMoveX | raMoveY }, - { M_MEMBERSHIP, raMoveX | raMoveY }, - { M_PROPERTIES, raMoveX | raMoveY }, - { IDC_STATIC, raRepaint }, - { idENDLIST, 0 } + { IDC_MACHINES_TITLE, raRepaint | raSizeX, 0, 0 }, + { IDC_ADVANCED, raMoveX, 0, 0 }, + { IDC_MACHINES_PATTERN, raMoveX, 0, 0 }, + { IDC_MACHINES_PATTERN_PROMPT, raRepaint | raMoveX, 0, 0 }, + { IDC_MACHINES_LIST, raSizeX | raSizeY, 0, 0 }, + { M_MACHINE_CREATE, raMoveX | raMoveY, 0, 0 }, + { M_MEMBERSHIP, raMoveX | raMoveY, 0, 0 }, + { M_PROPERTIES, raMoveX | raMoveY, 0, 0 }, + { IDC_STATIC, raRepaint, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/afsusrmgr/resource.h b/src/WINNT/afsusrmgr/resource.h index aff1a8394..40049b1fd 100644 --- a/src/WINNT/afsusrmgr/resource.h +++ b/src/WINNT/afsusrmgr/resource.h @@ -7,21 +7,22 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#define IDS_APP_TITLE 1 -#define IDS_USRCOL_NAME 2 -#define IDS_GRPCOL_NAME 3 -#define IDS_BADCREDS_DESC 4 -#define IDS_TAB_USERS 5 -#define IDS_TAB_GROUPS 6 -#define IDS_CELL_NONE 7 -#define IDS_CRED_NONE 8 -#define IDS_CRED_EXP 9 -#define IDS_CRED_OK 10 -#define IDS_USERS_ALL 11 -#define IDS_USERS_PATTERN 12 -#define IDS_GROUPS_ALL 13 -#define IDS_GROUPS_PATTERN 14 -#define IDS_QUERYING_LONG 15 +#define IDS_APP_TITLE 0 +#define IDS_USRCOL_NAME 1 +#define IDS_GRPCOL_NAME 2 +#define IDS_BADCREDS_DESC 3 +#define IDS_TAB_USERS 4 +#define IDS_TAB_GROUPS 5 +#define IDS_CELL_NONE 6 +#define IDS_CRED_NONE 7 +#define IDS_CRED_EXP 8 +#define IDS_CRED_OK 9 +#define IDS_USERS_ALL 10 +#define IDS_USERS_PATTERN 11 +#define IDS_GROUPS_ALL 12 +#define IDS_GROUPS_PATTERN 13 +#define IDS_QUERYING_LONG 14 + #define IDS_ACTION_DESC_NONE 16 #define IDS_ACTION_DESC_ONE 17 #define IDS_ACTION_DESC_MULT 18 @@ -38,136 +39,170 @@ #define IDS_HELPABOUT_DESC1 29 #define IDS_HELPABOUT_DESC2 30 #define IDS_HELPABOUT_DESC3 31 -#define IDS_USRCOL_FLAGS 32 -#define IDS_USRCOL_ADMIN 33 -#define IDS_USRCOL_TICKET 34 -#define IDS_USRCOL_SYSTEM 35 -#define IDS_USRCOL_CHANGEPW 36 -#define IDS_USRCOL_REUSEPW 37 -#define IDS_USRCOL_EXPIRES 38 -#define IDS_USRCOL_LASTPW 39 -#define IDS_USRCOL_LASTMOD 40 -#define IDS_USRCOL_LASTMODBY 41 -#define IDS_USRCOL_LIFETIME 42 -#define IDS_USRCOL_CDAYPW 43 -#define IDS_USRCOL_CFAILLOGIN 44 -#define IDS_USRCOL_CSECLOCK 45 -#define IDS_USRCOL_CGROUPMAX 46 -#define IDS_USRCOL_UID 47 -#define IDS_USRCOL_OWNER 48 -#define IDS_USRCOL_CREATOR 49 -#define IDS_USRCOL_STATUS 50 -#define IDS_USRFLAG_ADMIN 51 -#define IDS_USRFLAG_TICKET 52 -#define IDS_USRFLAG_ENCRYPT 53 -#define IDS_USRFLAG_CHANGEPW 54 -#define IDS_USRFLAG_REUSEPW 55 -#define IDS_YES 56 -#define IDS_NO 57 -#define IDS_GRPCOL_CMEMBERS 58 -#define IDS_GRPCOL_UID 59 -#define IDS_GRPCOL_OWNER 60 -#define IDS_GRPCOL_CREATOR 61 -#define IDS_COL_USERS 62 -#define IDS_COL_GROUPS 63 -#define IDS_COLUMNS_TITLE 64 -#define IDS_USER_PROPERTIES_TITLE_MULTIPLE 65 -#define IDS_USER_PROPERTIES_TITLE 66 -#define IDS_USER_NAME_MULTIPLE 67 -#define IDS_ACCOUNTACCESS_OWNER 68 -#define IDS_ACCOUNTACCESS_GROUP 69 -#define IDS_ACCOUNTACCESS_ANYONE 70 -#define IDS_ACCOUNTACCESS_MIXED 71 -#define IDS_USER_KEY 72 -#define IDS_USER_KEY_HIDDEN 73 -#define IDS_USER_KEY_UNKNOWN 74 -#define IDS_USER_KEY_MULTIPLE 75 -#define IDS_ACTION_USER_CHANGE 76 -#define IDS_COUNT_WEEKS 77 -#define IDS_COUNT_DAYS 78 -#define IDS_COUNT_HOURS 79 -#define IDS_COUNT_MINUTES 80 -#define IDS_COUNT_SECONDS 81 -#define IDS_GROUP_PROPERTIES_TITLE_MULTIPLE 82 -#define IDS_GROUP_PROPERTIES_TITLE 83 -#define IDS_GROUP_NAME_MULTIPLE 84 -#define IDS_ACCOUNTACCESS_OWNGROUP 85 -#define IDS_OWNER_MIXED 86 -#define IDS_CREATOR_MIXED 87 -#define IDS_GROUP_CHANGEOWNER_TITLE 88 -#define IDS_GROUP_CHANGEOWNER_PROMPT 89 -#define IDS_MEMBER_MIXED 90 -#define IDS_USER_SHOW_MEMBER_TITLE 91 -#define IDS_USER_SHOW_OWNER_TITLE 92 -#define IDS_GROUP_SHOW_MEMBER_TITLE 93 -#define IDS_USER_SHOW_MEMBER_TITLE_MULTIPLE 94 -#define IDS_GROUP_SHOW_MEMBER_TITLE_MULTIPLE 95 -#define IDS_BROWSE_TITLE_JOIN 96 -#define IDS_BROWSE_PROMPT_JOIN 97 -#define IDS_BROWSE_CHECK_JOIN 98 -#define IDS_BROWSE_TITLE_OWN 99 -#define IDS_BROWSE_PROMPT_OWN 100 -#define IDS_BROWSE_CHECK_OWN 101 -#define IDS_BROWSE_TITLE_MEMBER 102 -#define IDS_BROWSE_PROMPT_MEMBER 103 -#define IDS_BROWSE_CHECK_MEMBER 104 -#define IDS_SEPARATORS 105 -#define IDS_ACTION_GROUP_CHANGE 106 -#define IDS_ACTION_GROUP_MEMBER_ADD 107 -#define IDS_ACTION_GROUP_MEMBER_REMOVE 108 -#define IDS_ACTION_USER_PW_CHANGE 109 -#define IDS_UNKNOWN_NAME 110 -#define IDS_ACTION_USER_UNLOCK 111 -#define IDS_ACTION_GROUP_RENAME 112 -#define IDS_RENAME_TITLE 113 -#define IDS_GROUP_TITLE 114 -#define IDS_SHOW_USERS 115 -#define IDS_SHOW_GROUPS 116 -#define IDS_GROUP_SHOW_OWNED_TITLE 117 -#define IDS_BROWSE_TITLE_OWNED 118 -#define IDS_BROWSE_PROMPT_OWNED 119 -#define IDS_BROWSE_CHECK_OWNED 120 -#define IDS_NEWUSER_PROPERTIES_TITLE 121 -#define IDS_NEWUSER_SHOW_MEMBER_TITLE 122 -#define IDS_NEWUSER_SHOW_OWNER_TITLE 123 -#define IDS_ACTION_CELL_CHANGE 124 -#define IDS_ACTION_USER_CREATE 125 -#define IDS_NEWGROUP_PROPERTIES_TITLE 126 -#define IDS_NEWGROUP_SHOW_MEMBER_TITLE 127 -#define IDS_NEWGROUP_SHOW_OWNED_TITLE 128 -#define IDS_USER_DELETE_MULTIPLE 129 -#define IDS_GROUP_DELETE_MULTIPLE 130 -#define IDS_ACTION_GROUP_CREATE 131 -#define IDS_ACTION_USER_DELETE 132 -#define IDS_ACTION_GROUP_DELETE 133 -#define IDS_CELL_PROPERTIES_TITLE 134 -#define IDS_MACHINES_ALL 135 -#define IDS_MACHINES_PATTERN 136 -#define IDS_TAB_MACHINES 137 -#define IDS_MACHINE_DELETE_MULTIPLE 138 -#define IDS_NEWMACHINE_PROPERTIES_TITLE 139 -#define IDS_MACHINE_PROPERTIES_TITLE_MULTIPLE 140 -#define IDS_MACHINE_PROPERTIES_TITLE 141 -#define IDS_COL_MACHINES 142 -#define IDS_MCHCOL_NAME 143 + +#define IDS_COLUMNS_TITLE 32 +#define IDS_USER_PROPERTIES_TITLE_MULTIPLE 33 +#define IDS_USER_PROPERTIES_TITLE 34 +#define IDS_USER_NAME_MULTIPLE 35 +#define IDS_ACCOUNTACCESS_OWNER 36 +#define IDS_ACCOUNTACCESS_GROUP 37 +#define IDS_ACCOUNTACCESS_ANYONE 38 +#define IDS_ACCOUNTACCESS_MIXED 39 +#define IDS_USER_KEY 40 +#define IDS_USER_KEY_HIDDEN 41 +#define IDS_USER_KEY_UNKNOWN 42 +#define IDS_USER_KEY_MULTIPLE 43 +#define IDS_ACTION_USER_CHANGE 44 +#define IDS_COUNT_WEEKS 45 +#define IDS_COUNT_DAYS 46 +#define IDS_COUNT_HOURS 47 + +#define IDS_COUNT_MINUTES 48 +#define IDS_COUNT_SECONDS 49 +#define IDS_GROUP_PROPERTIES_TITLE_MULTIPLE 50 +#define IDS_GROUP_PROPERTIES_TITLE 51 +#define IDS_GROUP_NAME_MULTIPLE 52 +#define IDS_ACCOUNTACCESS_OWNGROUP 53 +#define IDS_OWNER_MIXED 54 +#define IDS_CREATOR_MIXED 55 +#define IDS_GROUP_CHANGEOWNER_TITLE 56 +#define IDS_GROUP_CHANGEOWNER_PROMPT 57 +#define IDS_MEMBER_MIXED 58 +#define IDS_USER_SHOW_MEMBER_TITLE 59 +#define IDS_USER_SHOW_OWNER_TITLE 60 +#define IDS_GROUP_SHOW_MEMBER_TITLE 61 +#define IDS_USER_SHOW_MEMBER_TITLE_MULTIPLE 62 +#define IDS_GROUP_SHOW_MEMBER_TITLE_MULTIPLE 63 + +#define IDS_ACTION_GROUP_RENAME 64 +#define IDS_RENAME_TITLE 65 +#define IDS_GROUP_TITLE 66 +#define IDS_SHOW_USERS 67 +#define IDS_SHOW_GROUPS 68 +#define IDS_GROUP_SHOW_OWNED_TITLE 69 +#define IDS_BROWSE_TITLE_OWNED 70 +#define IDS_BROWSE_PROMPT_OWNED 71 +#define IDS_BROWSE_CHECK_OWNED 72 +#define IDS_NEWUSER_PROPERTIES_TITLE 73 +#define IDS_NEWUSER_SHOW_MEMBER_TITLE 74 +#define IDS_NEWUSER_SHOW_OWNER_TITLE 75 +#define IDS_ACTION_CELL_CHANGE 76 +#define IDS_ACTION_USER_CREATE 77 +#define IDS_NEWGROUP_PROPERTIES_TITLE 78 +#define IDS_NEWGROUP_SHOW_MEMBER_TITLE 79 + +#define IDS_USRCOL_FLAGS 80 +#define IDS_USRCOL_ADMIN 81 +#define IDS_USRCOL_TICKET 82 +#define IDS_USRCOL_SYSTEM 83 +#define IDS_USRCOL_CHANGEPW 84 +#define IDS_USRCOL_REUSEPW 85 +#define IDS_USRCOL_EXPIRES 86 +#define IDS_USRCOL_LASTPW 87 +#define IDS_USRCOL_LASTMOD 88 +#define IDS_USRCOL_LASTMODBY 89 +#define IDS_USRCOL_LIFETIME 90 +#define IDS_USRCOL_CDAYPW 91 +#define IDS_USRCOL_CFAILLOGIN 92 +#define IDS_USRCOL_CSECLOCK 93 +#define IDS_USRCOL_CGROUPMAX 94 +#define IDS_USRCOL_UID 95 + +#define IDS_USRCOL_OWNER 96 +#define IDS_USRCOL_CREATOR 97 +#define IDS_USRCOL_STATUS 98 +#define IDS_USRFLAG_ADMIN 99 +#define IDS_USRFLAG_TICKET 100 +#define IDS_USRFLAG_ENCRYPT 101 +#define IDS_USRFLAG_CHANGEPW 102 +#define IDS_USRFLAG_REUSEPW 103 +#define IDS_YES 104 +#define IDS_NO 105 +#define IDS_GRPCOL_CMEMBERS 106 +#define IDS_GRPCOL_UID 107 +#define IDS_GRPCOL_OWNER 108 +#define IDS_GRPCOL_CREATOR 109 +#define IDS_COL_USERS 110 +#define IDS_COL_GROUPS 111 + +#define IDS_NEWGROUP_SHOW_OWNED_TITLE 112 +#define IDS_USER_DELETE_MULTIPLE 113 +#define IDS_GROUP_DELETE_MULTIPLE 114 +#define IDS_ACTION_GROUP_CREATE 115 +#define IDS_ACTION_USER_DELETE 116 +#define IDS_ACTION_GROUP_DELETE 117 +#define IDS_CELL_PROPERTIES_TITLE 118 +#define IDS_MACHINES_ALL 119 +#define IDS_MACHINES_PATTERN 120 +#define IDS_TAB_MACHINES 121 +#define IDS_MACHINE_DELETE_MULTIPLE 122 +#define IDS_NEWMACHINE_PROPERTIES_TITLE 123 +#define IDS_MACHINE_PROPERTIES_TITLE_MULTIPLE 124 +#define IDS_MACHINE_PROPERTIES_TITLE 125 +#define IDS_COL_MACHINES 126 +#define IDS_MCHCOL_NAME 127 + +#define IDS_BROWSE_TITLE_JOIN 128 +#define IDS_BROWSE_PROMPT_JOIN 129 +#define IDS_BROWSE_CHECK_JOIN 130 +#define IDS_BROWSE_TITLE_OWN 131 +#define IDS_BROWSE_PROMPT_OWN 132 +#define IDS_BROWSE_CHECK_OWN 133 +#define IDS_BROWSE_TITLE_MEMBER 134 +#define IDS_BROWSE_PROMPT_MEMBER 135 +#define IDS_BROWSE_CHECK_MEMBER 136 +#define IDS_SEPARATORS 137 +#define IDS_ACTION_GROUP_CHANGE 138 +#define IDS_ACTION_GROUP_MEMBER_ADD 139 +#define IDS_ACTION_GROUP_MEMBER_REMOVE 140 +#define IDS_ACTION_USER_PW_CHANGE 141 +#define IDS_UNKNOWN_NAME 142 +#define IDS_ACTION_USER_UNLOCK 143 + #define IDS_MCHCOL_CGROUPMAX 144 #define IDS_MCHCOL_UID 145 #define IDS_MCHCOL_OWNER 146 #define IDS_MCHCOL_CREATOR 147 #define IDS_OPTIONS_TITLE 148 -#define IDS_WARNING_TITLE 149 -#define IDS_WARNING_SYSTEM_ACCOUNT 150 -#define IDS_CMDLINE_TITLE 200 -#define IDS_CMDLINE_SYNTAX 201 -#define IDS_CMDLINE_UNRECOGNIZED 202 -#define IDS_CMDLINE_DUPLICATE 203 -#define IDS_CMDLINE_UNEXPECTVALUE 204 -#define IDS_CMDLINE_MISSINGVAL 205 -#define IDS_CMDLINE_USERPASSWORD 206 -#define IDS_ERROR_BAD_REMOTE_SERVER 220 -#define IDS_ERROR_BAD_LOCAL_SERVER 221 -#define IDS_ERROR_CANT_OPEN_CELL 222 -#define IDS_ERROR_BADCREDENTIALS 223 + +#define IDS_COMMAND_PTS_ADDUSER 160 +#define IDS_COMMAND_PTS_CHOWN 161 +#define IDS_COMMAND_PTS_CREATEGROUP 162 +#define IDS_COMMAND_PTS_CREATEUSER 163 + +#define IDS_COMMAND_PTS_DELETE 176 +#define IDS_COMMAND_PTS_EXAMINE 177 +#define IDS_COMMAND_PTS_LISTMAX 178 +#define IDS_COMMAND_PTS_LISTOWNED 179 +#define IDS_COMMAND_PTS_MEMBERSHIP 180 +#define IDS_COMMAND_PTS_REMOVEUSER 181 +#define IDS_COMMAND_PTS_RENAME 182 +#define IDS_COMMAND_PTS_SETFIELDS 183 +#define IDS_COMMAND_PTS_SETMAX 184 +#define IDS_COMMAND_KAS_CREATE 185 +#define IDS_COMMAND_KAS_DELETE 186 +#define IDS_COMMAND_KAS_EXAMINE 187 +#define IDS_COMMAND_KAS_GETRANDOMKEY 188 +#define IDS_COMMAND_KAS_LIST 189 +#define IDS_COMMAND_KAS_SETFIELDS 190 +#define IDS_COMMAND_KAS_SETKEY 191 + +#define IDS_COMMAND_KAS_SETPASSWORD 192 +#define IDS_COMMAND_KAS_STRINGTOKEY 193 +#define IDS_COMMAND_KAS_UNLOCK 194 +#define IDS_MACHINE_SHOW_MEMBER_TITLE 195 +#define IDS_MACHINE_SHOW_OWNER_TITLE 196 +#define IDS_MACHINE_SHOW_MEMBER_TITLE_MULTIPLE 197 +#define IDS_NEWMACHINE_SHOW_MEMBER_TITLE 198 +#define IDS_NEWMACHINE_SHOW_OWNER_TITLE 199 +#define IDS_WARNING_TITLE 200 +#define IDS_WARNING_SYSTEM_ACCOUNT 201 + +#define IDS_ERROR_BAD_REMOTE_SERVER 208 +#define IDS_ERROR_BAD_LOCAL_SERVER 209 +#define IDS_ERROR_CANT_OPEN_CELL 210 +#define IDS_ERROR_BADCREDENTIALS 211 + #define IDS_ERROR_TRANSLATED 224 #define IDS_ERROR_NOTTRANSLATED 225 #define IDS_ERROR_USER_MULTIPROP 226 @@ -184,6 +219,7 @@ #define IDS_ERROR_CANT_UNLOCK 237 #define IDS_ERROR_CANT_UNLOCK_MULTIPLE 238 #define IDS_ERROR_CANT_SET_MEMBERS 239 + #define IDS_ERROR_CANT_SET_MEMBERS_MULTIPLE 240 #define IDS_ERROR_CANT_RENAME_GROUP 241 #define IDS_ERROR_CANT_CHANGE_OWNER 242 @@ -198,34 +234,17 @@ #define IDS_ERROR_CANT_DELETE_GROUP 251 #define IDS_ERROR_CANT_DELETE_GROUP_MULTIPLE 252 #define IDS_ERROR_BAD_REMOTE_SERVER_INSTALL 253 -#define IDS_COMMAND_PTS_ADDUSER 300 -#define IDS_COMMAND_PTS_CHOWN 301 -#define IDS_COMMAND_PTS_CREATEGROUP 302 -#define IDS_COMMAND_PTS_CREATEUSER 303 -#define IDS_COMMAND_PTS_DELETE 304 -#define IDS_COMMAND_PTS_EXAMINE 305 -#define IDS_COMMAND_PTS_LISTMAX 306 -#define IDS_COMMAND_PTS_LISTOWNED 307 -#define IDS_COMMAND_PTS_MEMBERSHIP 308 -#define IDS_COMMAND_PTS_REMOVEUSER 309 -#define IDS_COMMAND_PTS_RENAME 310 -#define IDS_COMMAND_PTS_SETFIELDS 311 -#define IDS_COMMAND_PTS_SETMAX 312 -#define IDS_COMMAND_KAS_CREATE 313 -#define IDS_COMMAND_KAS_DELETE 314 -#define IDS_COMMAND_KAS_EXAMINE 315 -#define IDS_COMMAND_KAS_GETRANDOMKEY 316 -#define IDS_COMMAND_KAS_LIST 317 -#define IDS_COMMAND_KAS_SETFIELDS 318 -#define IDS_COMMAND_KAS_SETKEY 319 -#define IDS_COMMAND_KAS_SETPASSWORD 320 -#define IDS_COMMAND_KAS_STRINGTOKEY 321 -#define IDS_COMMAND_KAS_UNLOCK 322 -#define IDS_MACHINE_SHOW_MEMBER_TITLE 323 -#define IDS_MACHINE_SHOW_OWNER_TITLE 324 -#define IDS_MACHINE_SHOW_MEMBER_TITLE_MULTIPLE 325 -#define IDS_NEWMACHINE_SHOW_MEMBER_TITLE 326 -#define IDS_NEWMACHINE_SHOW_OWNER_TITLE 327 + +#define IDS_CMDLINE_TITLE 256 +#define IDS_CMDLINE_SYNTAX 257 +#define IDS_CMDLINE_UNRECOGNIZED 258 +#define IDS_CMDLINE_DUPLICATE 259 +#define IDS_CMDLINE_UNEXPECTVALUE 260 +#define IDS_CMDLINE_MISSINGVAL 261 +#define IDS_CMDLINE_USERPASSWORD 262 + + + #define IDD_MAIN 1001 #define ACCEL_MAIN 1002 #define MENU_MAIN 1003 diff --git a/src/WINNT/afsusrmgr/task.cpp b/src/WINNT/afsusrmgr/task.cpp index 91c352412..4923ca5ef 100644 --- a/src/WINNT/afsusrmgr/task.cpp +++ b/src/WINNT/afsusrmgr/task.cpp @@ -33,10 +33,6 @@ extern "C" { * */ -DWORD WINAPI Task_ThreadProc (PVOID lp); - -void Task_Perform (LPTASKPACKET ptp); - void Task_OpenCell (LPTASKPACKET ptp); void Task_UpdCreds (LPTASKPACKET ptp); void Task_UpdUsers (LPTASKPACKET ptp); diff --git a/src/WINNT/afsusrmgr/usr_tab.cpp b/src/WINNT/afsusrmgr/usr_tab.cpp index fde6316ad..d8541bd3d 100644 --- a/src/WINNT/afsusrmgr/usr_tab.cpp +++ b/src/WINNT/afsusrmgr/usr_tab.cpp @@ -26,16 +26,16 @@ extern "C" { */ rwWindowData awdUsersTab[] = { - { IDC_USERS_TITLE, raRepaint | raSizeX }, - { IDC_ADVANCED, raMoveX }, - { IDC_USERS_PATTERN, raMoveX }, - { IDC_USERS_PATTERN_PROMPT, raRepaint | raMoveX }, - { IDC_USERS_LIST, raSizeX | raSizeY }, - { M_USER_CREATE, raMoveX | raMoveY }, - { M_MEMBERSHIP, raMoveX | raMoveY }, - { M_PROPERTIES, raMoveX | raMoveY }, - { IDC_STATIC, raRepaint }, - { idENDLIST, 0 } + { IDC_USERS_TITLE, raRepaint | raSizeX, 0, 0 }, + { IDC_ADVANCED, raMoveX, 0, 0 }, + { IDC_USERS_PATTERN, raMoveX, 0, 0 }, + { IDC_USERS_PATTERN_PROMPT, raRepaint | raMoveX, 0, 0 }, + { IDC_USERS_LIST, raSizeX | raSizeY, 0, 0 }, + { M_USER_CREATE, raMoveX | raMoveY, 0, 0 }, + { M_MEMBERSHIP, raMoveX | raMoveY, 0, 0 }, + { M_PROPERTIES, raMoveX | raMoveY, 0, 0 }, + { IDC_STATIC, raRepaint, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/afsusrmgr/window.cpp b/src/WINNT/afsusrmgr/window.cpp index db5638493..f6e6f8d8e 100644 --- a/src/WINNT/afsusrmgr/window.cpp +++ b/src/WINNT/afsusrmgr/window.cpp @@ -52,18 +52,18 @@ static size_t cTABS = sizeof(aTABS) / sizeof(aTABS[0]); #define cyMIN_TABS 100 rwWindowData awdMain[] = { - { IDC_TAB, raSizeX | raSizeY, MAKELONG(cxMIN_TABS,cyMIN_TABS) }, - { IDC_CELL, raSizeX | raRepaint }, - { IDC_CREDS, raSizeX | raRepaint }, - { IDC_ANIM, raMoveX }, - { IDC_BAR, raSizeX }, - { IDC_STATIC, raRepaint }, - { idENDLIST, 0 } + { IDC_TAB, raSizeX | raSizeY, MAKELONG(cxMIN_TABS,cyMIN_TABS), 0 }, + { IDC_CELL, raSizeX | raRepaint, 0, 0 }, + { IDC_CREDS, raSizeX | raRepaint, 0, 0 }, + { IDC_ANIM, raMoveX, 0, 0 }, + { IDC_BAR, raSizeX, 0, 0 }, + { IDC_STATIC, raRepaint, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; rwWindowData awdTabChild[] = { - { 0, raSizeX | raSizeY }, - { idENDLIST, 0 } + { 0, raSizeX | raSizeY, 0, 0 }, + { idENDLIST, 0, 0, 0 } }; diff --git a/src/WINNT/aklog/NTMakefile b/src/WINNT/aklog/NTMakefile new file mode 100644 index 000000000..8bb646214 --- /dev/null +++ b/src/WINNT/aklog/NTMakefile @@ -0,0 +1,59 @@ +# Copyright 2004, OpenAFS.ORG and others. +# All Rights Reserved. +# +# This software has been released under the terms of the IBM Public +# License. For details, see the LICENSE file in the top-level source +# directory or online at http://www.openafs.org/dl/license10.html + +# include the primary makefile +RELDIR=WINNT\aklog +!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) +!INCLUDE ..\..\config\NTMakefile.version + +############################################################################ +# +# BUILD TARGETS +# + +EXEFILE = $(DESTDIR)\root.client\usr\vice\etc\aklog.exe + +EXEOBJS = \ + $(OUT)\aklog.obj \ + $(OUT)\linked_list.obj + +EXELIBS = \ + $(DESTDIR)\lib\afs\afspioctl.lib \ + $(DESTDIR)\lib\afsauthent.lib \ + $(DESTDIR)\lib\afs\afskauth.lib + +OTHERLIBS = \ + ..\kfw\lib\i386\krbv4w32.lib \ + ..\kfw\lib\i386\krb5_32.lib \ + dnsapi.lib + +afscflags = -I..\kfw\inc\krb5 -I..\kfw\inc\krb4 $(afscflags) + +$(EXEOBJS): $$(@B).c + $(C2OBJ) $** + +############################################################################ + +$(EXEFILE) : $(EXEOBJS) $(OUT)\aklog.res $(EXELIBS) + $(EXECONLINK) $(OTHERLIBS) + $(EXEPREP) + +install : $(COPYHEADERS) $(EXEFILE) + +############################################################################ +# +# Dependencies +# + +$(OUT)\aklog.res : aklog.rc AFS_component_version_number.h + +mkdir: + -mkdir $(OUT)\lang + cd lang + nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir + cd .. + diff --git a/src/WINNT/aklog/aklog.c b/src/WINNT/aklog/aklog.c new file mode 100644 index 000000000..00a5cdb3a --- /dev/null +++ b/src/WINNT/aklog/aklog.c @@ -0,0 +1,1168 @@ +/* + * Copyright (C) 1989,2004 by the Massachusetts Institute of Technology + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef WIN32 +#include + +#include +#include +#include +#include +#include + +#define stat _stat +#define lstat stat +#define __S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask)) +#define S_ISDIR(mode) __S_ISTYPE((mode), _S_IFDIR) + +#define DONT_HAVE_GET_AD_TKT +#define MAXSYMLINKS 255 + +/* Win32 uses get_krb_err_txt_entry(status) instead of krb_err_txt[status], +* so we use a bit of indirection like the GNU CVS sources. +*/ +#define krb_err_text(status) get_krb_err_txt_entry(status) + +#define DRIVECOLON ':' /* Drive letter separator */ +#define BDIR '\\' /* Other character that divides directories */ + +static int +readlink(char *path, char *buf, int buffers) +{ + return -1; +} + +char * getcwd(char*, size_t); + +static long +get_cellconfig_callback(void *cellconfig, struct sockaddr_in *addrp, char *namep) +{ + struct afsconf_cell *cc = (struct afsconf_cell *) cellconfig; + + cc->hostAddr[cc->numServers] = *addrp; + strcpy(cc->hostName[cc->numServers], namep); + cc->numServers++; + return 0; +} + +#else /* WIN32 */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#define krb_err_text(status) krb_err_txt[status] + +/* Cheesy test for determining AFS 3.5. */ +#ifndef AFSCONF_CLIENTNAME +#define AFS35 +#endif + +#ifdef AFS35 +#include +#else +#define AFSDIR_CLIENT_ETC_DIRPATH AFSCONF_CLIENTNAME +#endif + +#endif /* WIN32 */ + +#include "linked_list.h" + +#define AFSKEY "afs" +#define AFSINST "" + +#define AKLOG_SUCCESS 0 +#define AKLOG_USAGE 1 +#define AKLOG_SOMETHINGSWRONG 2 +#define AKLOG_AFS 3 +#define AKLOG_KERBEROS 4 +#define AKLOG_TOKEN 5 +#define AKLOG_BADPATH 6 +#define AKLOG_MISC 7 + +#ifndef NULL +#define NULL 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef MAXSYMLINKS +#define MAXSYMLINKS 15 +#endif + +#define DIR '/' /* Character that divides directories */ +#define DIRSTRING "/" /* String form of above */ +#define VOLMARKER ':' /* Character separating cellname from mntpt */ +#define VOLMARKERSTRING ":" /* String form of above */ + +typedef struct { + char cell[BUFSIZ]; + char realm[REALM_SZ]; +} cellinfo_t; + + +struct afsconf_cell ak_cellconfig; /* General information about the cell */ + +static char *progname = NULL; /* Name of this program */ +static int dflag = FALSE; /* Give debugging information */ +static int noprdb = FALSE; /* Skip resolving name to id? */ +static int force = FALSE; /* Bash identical tokens? */ +static linked_list authedcells; /* List of cells already logged to */ + +static int usev5 = TRUE; /* use kerberos 5? */ +static krb5_ccache _krb425_ccache; + +long GetLocalCell(struct afsconf_dir **pconfigdir, char *local_cell) +{ + if (!(*pconfigdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH))) + { + fprintf(stderr, "%s: can't get afs configuration (afsconf_Open(%s))\n", + progname, AFSDIR_CLIENT_ETC_DIRPATH); + exit(AKLOG_AFS); + } + + return afsconf_GetLocalCell(*pconfigdir, local_cell, MAXCELLCHARS); +} + +long GetCellInfo(struct afsconf_dir **pconfigdir, char* cell, +struct afsconf_cell **pcellconfig) +{ + return afsconf_GetCellInfo(*pconfigdir, cell, NULL, *pcellconfig); +} + +void CloseConf(struct afsconf_dir **pconfigdir) +{ + (void) afsconf_Close(*pconfigdir); +} + +void ViceIDToUsername(char *username, int *status, +struct ktc_principal *aserver) +{ +#ifndef WIN32 + long viceId; /* AFS uid of user */ + + if (dflag) + printf("About to resolve name %s to id\n", username); + + if (!pr_Initialize (0, AFSDIR_CLIENT_ETC_DIRPATH, aserver->cell)) + *status = pr_SNameToId (username, &viceId); + + if (dflag) + { + if (*status) + printf("Error %d\n", *status); + else + printf("Id %d\n", viceId); + } + + /* + * This is a crock, but it is Transarc's crock, so + * we have to play along in order to get the + * functionality. The way the afs id is stored is + * as a string in the username field of the token. + * Contrary to what you may think by looking at + * the code for tokens, this hack (AFS ID %d) will + * not work if you change %d to something else. + */ + if ((*status == 0) && (viceId != ANONYMOUSID)) + sprintf (username, "AFS ID %d", viceId); +#endif +} + +char *LastComponent(char *str) +{ + char *ret = strrchr(str, DIR); + +#ifdef WIN32 + if (!ret) + ret = strrchr(str, BDIR); +#endif + return ret; +} + +int FirstComponent(char *str) +{ + return (int)( +#ifdef WIN32 + strchr(str, BDIR) || +#endif + strchr(str, DIR)); +} + +void CopyPathColon(char *origpath, char *path, char *pathtocheck) +{ +#ifdef WIN32 + if (origpath[1] == DRIVECOLON) + { + strncpy(pathtocheck, origpath, 2); + strcpy(path, origpath+2); + } + else +#endif + strcpy(path, origpath); +} + +int BeginsWithDir(char *str, int colon) +{ + return (str[0] == DIR) || +#ifdef WIN32 + ((str[0] == BDIR) || (colon && str[1] == DRIVECOLON)); +#else + FALSE; +#endif +} + + +/* This is a pretty gross hack. Linking against the Transarc +* libraries pulls in some rxkad functions which use des. (I don't +* think they ever get called.) With Transarc-supplied libraries this +* creates a reliance on the symbol des_pcbc_init() which is only in +* Transarc's DES libraries (it's an exportability symbol-hiding +* thing), which we don't want to use because they don't work with +* MIT's krb4 routines. So export a des_pcbc_init() symbol here so we +* don't have to link against Transarc's des library. +*/ +int des_pcbc_init() +{ + abort(); +} + +static int get_cred(char *name, char *inst, char *realm, CREDENTIALS *c) +{ + int status; + + status = krb_get_cred(name, inst, realm, c); + if (status != KSUCCESS) + { +#ifdef DONT_HAVE_GET_AD_TKT + KTEXT_ST ticket; + status = krb_mk_req(&ticket, name, inst, realm, 0); +#else + status = get_ad_tkt(name, inst, realm, 255); +#endif + if (status == KSUCCESS) + status = krb_get_cred(name, inst, realm, c); + } + + return (status); +} + +static int get_v5cred(krb5_context context, + char *name, char *inst, char *realm, CREDENTIALS *c, + krb5_creds **creds) +{ + krb5_creds increds; + krb5_error_code r; + static krb5_principal client_principal = 0; + + memset((char *)&increds, 0, sizeof(increds)); + + if ((r = krb5_build_principal(context, &increds.server, + strlen(realm), realm, + name, + (inst && strlen(inst)) ? inst : 0, + 0))) { + return((int)r); + } + + if (!_krb425_ccache) + krb5_cc_default(context, &_krb425_ccache); + if (!client_principal) + krb5_cc_get_principal(context, _krb425_ccache, &client_principal); + + increds.client = client_principal; + increds.times.endtime = 0; + /* Ask for DES since that is what V4 understands */ + increds.keyblock.enctype = ENCTYPE_DES_CBC_CRC; + + r = krb5_get_credentials(context, 0, _krb425_ccache, &increds, creds); + if (r) + return((int)r); + + /* This requires krb524d to be running with the KDC */ + if (c != NULL) + r = krb5_524_convert_creds(context, *creds, c); + return((int)r); +} + +/* There is no header for this function. It is supposed to be private */ +int krb_get_admhst(char *h,char *r, int n); + +static char *afs_realm_of_cell(struct afsconf_cell *cellconfig) +{ + char krbhst[MAX_HSTNM]; + static char krbrlm[REALM_SZ+1]; + + if (!cellconfig) + return 0; + + strcpy(krbrlm, (char *) krb_realmofhost(cellconfig->hostName[0])); + + if (krb_get_admhst(krbhst, krbrlm, 1) != KSUCCESS) + { + char *s = krbrlm; + char *t = cellconfig->name; + int c; + + while (c = *t++) + { + if (islower(c)) + c = toupper(c); + *s++ = c; + } + *s++ = 0; + + } + return krbrlm; +} + +static char *afs_realm_of_cell5(krb5_context context, struct afsconf_cell *cellconfig) +{ + char ** krbrlms; + static char krbrlm[REALM_SZ+1]; + krb5_error_code status; + + if (!cellconfig) + return 0; + + status = krb5_get_host_realm( context, cellconfig->hostName[0], &krbrlms ); + + if(krbrlms && krbrlms[0]) + strcpy(krbrlm, krbrlms[0]); + else { + strcpy(krbrlm, cellconfig->name); + strupr(krbrlm); + } + + if(krbrlms) + krb5_free_host_realm( context, krbrlms ); + + return krbrlm; +} + +static char *copy_cellinfo(cellinfo_t *cellinfo) +{ + cellinfo_t *new_cellinfo; + + if (new_cellinfo = (cellinfo_t *)malloc(sizeof(cellinfo_t))) + memcpy(new_cellinfo, cellinfo, sizeof(cellinfo_t)); + + return ((char *)new_cellinfo); +} + + +static char *copy_string(char *string) +{ + char *new_string; + + if (new_string = (char *)calloc(strlen(string) + 1, sizeof(char))) + (void) strcpy(new_string, string); + + return (new_string); +} + + +static int get_cellconfig(char *cell, struct afsconf_cell *cellconfig, + char *local_cell) +{ + int status = AKLOG_SUCCESS; + struct afsconf_dir *configdir = 0; + + memset(local_cell, 0, sizeof(local_cell)); + memset(cellconfig, 0, sizeof(*cellconfig)); + + if (GetLocalCell(&configdir, local_cell)) + { + fprintf(stderr, "%s: can't determine local cell.\n", progname); + exit(AKLOG_AFS); + } + + if ((cell == NULL) || (cell[0] == 0)) + cell = local_cell; + + if (GetCellInfo(&configdir, cell, &cellconfig)) + { + fprintf(stderr, "%s: Can't get information about cell %s.\n", + progname, cell); + status = AKLOG_AFS; + } + + + CloseConf(&configdir); + + return(status); +} + +static int get_v5_user_realm(krb5_context context,char *realm) +{ + static krb5_principal client_principal = 0; + int i; + + if (!_krb425_ccache) + krb5_cc_default(context, &_krb425_ccache); + if (!client_principal) + krb5_cc_get_principal(context, _krb425_ccache, &client_principal); + + i = krb5_princ_realm(context, client_principal)->length; + if (i < REALM_SZ-1) i = REALM_SZ-1; + strncpy(realm,krb5_princ_realm(context, client_principal)->data,i); + realm[i] = 0; + return(KSUCCESS); +} + +/* +* Log to a cell. If the cell has already been logged to, return without +* doing anything. Otherwise, log to it and mark that it has been logged +* to. */ +static int auth_to_cell(krb5_context context, char *cell, char *realm) +{ + int status = AKLOG_SUCCESS; + char username[BUFSIZ]; /* To hold client username structure */ + + char name[ANAME_SZ]; /* Name of afs key */ + char instance[INST_SZ]; /* Instance of afs key */ + char realm_of_user[REALM_SZ]; /* Kerberos realm of user */ + char realm_of_cell[REALM_SZ]; /* Kerberos realm of cell */ + char local_cell[MAXCELLCHARS+1]; + char cell_to_use[MAXCELLCHARS+1]; /* Cell to authenticate to */ + + krb5_creds *v5cred = NULL; + CREDENTIALS c; + struct ktc_principal aserver; + struct ktc_principal aclient; + struct ktc_token atoken, btoken; + + /* try to avoid an expensive call to get_cellconfig */ + if (cell && ll_string_check(&authedcells, cell)) + { + if (dflag) + printf("Already authenticated to %s (or tried to)\n", cell); + return(AKLOG_SUCCESS); + } + + memset(name, 0, sizeof(name)); + memset(instance, 0, sizeof(instance)); + memset(realm_of_user, 0, sizeof(realm_of_user)); + memset(realm_of_cell, 0, sizeof(realm_of_cell)); + + /* NULL or empty cell returns information on local cell */ + if (status = get_cellconfig(cell, &ak_cellconfig, local_cell)) + return(status); + + strncpy(cell_to_use, ak_cellconfig.name, MAXCELLCHARS); + cell_to_use[MAXCELLCHARS] = 0; + + if (ll_string_check(&authedcells, cell_to_use)) + { + if (dflag) + printf("Already authenticated to %s (or tried to)\n", cell_to_use); + return(AKLOG_SUCCESS); + } + + /* + * Record that we have attempted to log to this cell. We do this + * before we try rather than after so that we will not try + * and fail repeatedly for one cell. + */ + (void)ll_add_string(&authedcells, cell_to_use); + + if (dflag) + printf("Authenticating to cell %s.\n", cell_to_use); + + if (realm && realm[0]) + strcpy(realm_of_cell, realm); + else + strcpy(realm_of_cell, + (usev5)? + afs_realm_of_cell5(context, &ak_cellconfig) : + afs_realm_of_cell(&ak_cellconfig)); + + /* We use the afs. convention here... */ + strcpy(name, AFSKEY); + strncpy(instance, cell_to_use, sizeof(instance)); + instance[sizeof(instance)-1] = '\0'; + + /* + * Extract the session key from the ticket file and hand-frob an + * afs style authenticator. + */ + + if (usev5) + { /* using krb5 */ + int retry = 1; + + try_v5: + if (dflag) + printf("Getting v5 tickets: %s/%s@%s\n", name, instance, realm_of_cell); + status = get_v5cred(context, name, instance, realm_of_cell, NULL, &v5cred); + if (status == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN) { + if (dflag) + printf("Getting v5 tickets: %s@%s\n", name, realm_of_cell); + status = get_v5cred(context, name, "", realm_of_cell, NULL, &v5cred); + } + if ( status == KRB5KRB_AP_ERR_MSG_TYPE && retry ) { + retry = 0; + goto try_v5; + } + } + else + { + /* + * Try to obtain AFS tickets. Because there are two valid service + * names, we will try both, but trying the more specific first. + * + * afs.@ + * afs@ + */ + if (dflag) + printf("Getting tickets: %s.%s@%s\n", name, instance, realm_of_cell); + status = get_cred(name, instance, realm_of_cell, &c); + if (status == KDC_PR_UNKNOWN) + { + if (dflag) + printf("Getting tickets: %s@%s\n", name, realm_of_cell); + status = get_cred(name, "", realm_of_cell, &c); + } + } + + /* TODO: get k5 error text */ + if (status != KSUCCESS) + { + if (dflag) + printf("Kerberos error code returned by get_cred: %d\n", status); + fprintf(stderr, "%s: Couldn't get %s AFS tickets: %s\n", + progname, cell_to_use, + (usev5)?"": + krb_err_text(status)); + return(AKLOG_KERBEROS); + } + + strncpy(aserver.name, AFSKEY, MAXKTCNAMELEN - 1); + strncpy(aserver.instance, AFSINST, MAXKTCNAMELEN - 1); + strncpy(aserver.cell, cell_to_use, MAXKTCREALMLEN - 1); + + if (usev5) { + /* This code inserts the entire K5 ticket into the token + * No need to perform a krb524 translation which is + * commented out in the code below + */ + char * p; + int len; + + len = min(v5cred->client->data[0].length,MAXKTCNAMELEN - 1); + strncpy(username, v5cred->client->data[0].data, len); + username[len] = '\0'; + + if ( v5cred->client->length > 1 ) { + strcat(username, "."); + p = username + strlen(username); + len = min(v5cred->client->data[1].length,MAXKTCNAMELEN - strlen(username) - 1); + strncpy(p, v5cred->client->data[1].data, len); + p[len] = '\0'; + } + + memset(&atoken, '\0', sizeof(atoken)); + atoken.kvno = RXKAD_TKT_TYPE_KERBEROS_V5; + atoken.startTime = v5cred->times.starttime; + atoken.endTime = v5cred->times.endtime; + memcpy(&atoken.sessionKey, v5cred->keyblock.contents, v5cred->keyblock.length); + atoken.ticketLen = v5cred->ticket.length; + memcpy(atoken.ticket, v5cred->ticket.data, atoken.ticketLen); + } else + { + strcpy (username, c.pname); + if (c.pinst[0]) + { + strcat(username, "."); + strcat(username, c.pinst); + } + + atoken.kvno = c.kvno; + atoken.startTime = c.issue_date; + /* ticket lifetime is in five-minutes blocks. */ + atoken.endTime = c.issue_date + ((unsigned char)c.lifetime * 5 * 60); + + memcpy(&atoken.sessionKey, c.session, 8); + atoken.ticketLen = c.ticket_st.length; + memcpy(atoken.ticket, c.ticket_st.dat, atoken.ticketLen); + } + + if (!force && + !ktc_GetToken(&aserver, &btoken, sizeof(btoken), &aclient) && + atoken.kvno == btoken.kvno && + atoken.ticketLen == btoken.ticketLen && + !memcmp(&atoken.sessionKey, &btoken.sessionKey, sizeof(atoken.sessionKey)) && + !memcmp(atoken.ticket, btoken.ticket, atoken.ticketLen)) + { + if (dflag) + printf("Identical tokens already exist; skipping.\n"); + return 0; + } + + if (noprdb) + { + if (dflag) + printf("Not resolving name %s to id (-noprdb set)\n", username); + } + else + { + if(usev5) { + if((status = get_v5_user_realm(context, realm_of_user)) != KSUCCESS) { + fprintf(stderr, "%s: Couldn't determine realm of user: %d\n", + progname, status); + return(AKLOG_KERBEROS); + } + } else + { + if ((status = krb_get_tf_realm(TKT_FILE, realm_of_user)) != KSUCCESS) + { + fprintf(stderr, "%s: Couldn't determine realm of user: %s)", + progname, krb_err_text(status)); + return(AKLOG_KERBEROS); + } + } + + if (strcmp(realm_of_user, realm_of_cell)) + { + strcat(username, "@"); + strcat(username, realm_of_user); + } + + ViceIDToUsername(username, &status, &aserver); + } + + if (dflag) + printf("Set username to %s\n", username); + + /* Reset the "aclient" structure before we call ktc_SetToken. + * This structure was first set by the ktc_GetToken call when + * we were comparing whether identical tokens already existed. + */ + strncpy(aclient.name, username, MAXKTCNAMELEN - 1); + strcpy(aclient.instance, ""); + if (usev5) { + int len = min(v5cred->client->realm.length,MAXKTCNAMELEN - 1); + strncpy(aclient.cell, v5cred->client->realm.data, len); + aclient.cell[len] = '\0'; + } else + strncpy(aclient.cell, c.realm, MAXKTCREALMLEN - 1); + + if (dflag) + printf("Getting tokens.\n"); + if (status = ktc_SetToken(&aserver, &atoken, &aclient, 0)) + { + fprintf(stderr, + "%s: unable to obtain tokens for cell %s (status: %d).\n", + progname, cell_to_use, status); + status = AKLOG_TOKEN; + } + + return(status); +} + +static int get_afs_mountpoint(char *file, char *mountpoint, int size) +{ + char our_file[MAXPATHLEN + 1]; + char *parent_dir; + char *last_component; + struct ViceIoctl vio; + char cellname[BUFSIZ]; + + memset(our_file, 0, sizeof(our_file)); + strcpy(our_file, file); + + if (last_component = LastComponent(our_file)) + { + *last_component++ = 0; + parent_dir = our_file; + } + else + { + last_component = our_file; + parent_dir = "."; + } + + memset(cellname, 0, sizeof(cellname)); + + vio.in = last_component; + vio.in_size = strlen(last_component)+1; + vio.out_size = size; + vio.out = mountpoint; + + if (!pioctl(parent_dir, VIOC_AFS_STAT_MT_PT, &vio, 0)) + { + if (strchr(mountpoint, VOLMARKER) == NULL) + { + vio.in = file; + vio.in_size = strlen(file) + 1; + vio.out_size = sizeof(cellname); + vio.out = cellname; + + if (!pioctl(file, VIOC_FILE_CELL_NAME, &vio, 1)) + { + strcat(cellname, VOLMARKERSTRING); + strcat(cellname, mountpoint + 1); + memset(mountpoint + 1, 0, size - 1); + strcpy(mountpoint + 1, cellname); + } + } + return(TRUE); + } + else { + return(FALSE); + } +} + +/* +* This routine each time it is called returns the next directory +* down a pathname. It resolves all symbolic links. The first time +* it is called, it should be called with the name of the path +* to be descended. After that, it should be called with the arguemnt +* NULL. +*/ +static char *next_path(char *origpath) +{ + static char path[MAXPATHLEN + 1]; + static char pathtocheck[MAXPATHLEN + 1]; + + int link = FALSE; /* Is this a symbolic link? */ + char linkbuf[MAXPATHLEN + 1]; + char tmpbuf[MAXPATHLEN + 1]; + + static char *last_comp; /* last component of directory name */ + static char *elast_comp; /* End of last component */ + char *t; + int len; + + static int symlinkcount = 0; /* We can't exceed MAXSYMLINKS */ + + /* If we are given something for origpath, we are initializing only. */ + if (origpath) + { + memset(path, 0, sizeof(path)); + memset(pathtocheck, 0, sizeof(pathtocheck)); + CopyPathColon(origpath, path, pathtocheck); + last_comp = path; + symlinkcount = 0; + return(NULL); + } + + /* We were not given origpath; find then next path to check */ + + /* If we've gotten all the way through already, return NULL */ + if (last_comp == NULL) + return(NULL); + + do + { + while (BeginsWithDir(last_comp, FALSE)) + strncat(pathtocheck, last_comp++, 1); + len = (elast_comp = LastComponent(last_comp)) + ? elast_comp - last_comp : strlen(last_comp); + strncat(pathtocheck, last_comp, len); + memset(linkbuf, 0, sizeof(linkbuf)); + if (link = (readlink(pathtocheck, linkbuf, sizeof(linkbuf)) > 0)) + { + if (++symlinkcount > MAXSYMLINKS) + { + fprintf(stderr, "%s: %s\n", progname, strerror(ELOOP)); + exit(AKLOG_BADPATH); + } + memset(tmpbuf, 0, sizeof(tmpbuf)); + if (elast_comp) + strcpy(tmpbuf, elast_comp); + if (BeginsWithDir(linkbuf, FALSE)) + { + /* + * If this is a symbolic link to an absolute path, + * replace what we have by the absolute path. + */ + memset(path, 0, strlen(path)); + memcpy(path, linkbuf, sizeof(linkbuf)); + strcat(path, tmpbuf); + last_comp = path; + elast_comp = NULL; + memset(pathtocheck, 0, sizeof(pathtocheck)); + } + else + { + /* + * If this is a symbolic link to a relative path, + * replace only the last component with the link name. + */ + strncpy(last_comp, linkbuf, strlen(linkbuf) + 1); + strcat(path, tmpbuf); + elast_comp = NULL; + if (t = LastComponent(pathtocheck)) + { + t++; + memset(t, 0, strlen(t)); + } + else + memset(pathtocheck, 0, sizeof(pathtocheck)); + } + } + else + last_comp = elast_comp; + } + while(link); + + return(pathtocheck); +} + +/* +* This routine descends through a path to a directory, logging to +* every cell it encounters along the way. +*/ +static int auth_to_path(krb5_context context, char *path) +{ + int status = AKLOG_SUCCESS; + int auth_to_cell_status = AKLOG_SUCCESS; + + char *nextpath; + char pathtocheck[MAXPATHLEN + 1]; + char mountpoint[MAXPATHLEN + 1]; + + char *cell; + char *endofcell; + + /* Initialize */ + if (BeginsWithDir(path, TRUE)) + strcpy(pathtocheck, path); + else + { + if (getcwd(pathtocheck, sizeof(pathtocheck)) == NULL) + { + fprintf(stderr, "Unable to find current working directory:\n"); + fprintf(stderr, "%s\n", pathtocheck); + fprintf(stderr, "Try an absolute pathname.\n"); + exit(AKLOG_BADPATH); + } + else + { + /* in WIN32, if getcwd returns a root dir (eg: c:\), the returned string + * will already have a trailing slash ('\'). Otherwise, the string will + * end in the last directory name */ +#ifdef WIN32 + if(pathtocheck[strlen(pathtocheck) - 1] != BDIR) +#endif + strcat(pathtocheck, DIRSTRING); + strcat(pathtocheck, path); + } + } + next_path(pathtocheck); + + /* Go on to the next level down the path */ + while (nextpath = next_path(NULL)) + { + strcpy(pathtocheck, nextpath); + if (dflag) + printf("Checking directory [%s]\n", pathtocheck); + /* + * If this is an afs mountpoint, determine what cell from + * the mountpoint name which is of the form + * #cellname:volumename or %cellname:volumename. + */ + if (get_afs_mountpoint(pathtocheck, mountpoint, sizeof(mountpoint))) + { + if(dflag) + printf("Found mount point [%s]\n", mountpoint); + /* skip over the '#' or '%' */ + cell = mountpoint + 1; + if (endofcell = strchr(mountpoint, VOLMARKER)) + { + *endofcell = '\0'; + if (auth_to_cell_status = auth_to_cell(context, cell, NULL)) + { + if (status == AKLOG_SUCCESS) + status = auth_to_cell_status; + else if (status != auth_to_cell_status) + status = AKLOG_SOMETHINGSWRONG; + } + } + } + else + { + struct stat st; + + if (lstat(pathtocheck, &st) < 0) + { + /* + * If we've logged and still can't stat, there's + * a problem... + */ + fprintf(stderr, "%s: stat(%s): %s\n", progname, + pathtocheck, strerror(errno)); + return(AKLOG_BADPATH); + } + else if (!S_ISDIR(st.st_mode)) + { + /* Allow only directories */ + fprintf(stderr, "%s: %s: %s\n", progname, pathtocheck, + strerror(ENOTDIR)); + return(AKLOG_BADPATH); + } + } + } + + return(status); +} + +/* Print usage message and exit */ +static void usage(void) +{ + fprintf(stderr, "\nUsage: %s %s%s%s%s\n", progname, + "[-d] [[-cell | -c] cell [-k krb_realm]] ", + "[[-p | -path] pathname]\n", + " [-noprdb] [-force]\n", + " [-5 | -4]\n" + ); + fprintf(stderr, " -d gives debugging information.\n"); + fprintf(stderr, " krb_realm is the kerberos realm of a cell.\n"); + fprintf(stderr, " pathname is the name of a directory to which "); + fprintf(stderr, "you wish to authenticate.\n"); + fprintf(stderr, " -noprdb means don't try to determine AFS ID.\n"); + fprintf(stderr, " -5 or -4 selects whether to use Kerberos V or Kerberos IV.\n" + " (default is Kerberos V)\n"); + fprintf(stderr, " No commandline arguments means "); + fprintf(stderr, "authenticate to the local cell.\n"); + fprintf(stderr, "\n"); + exit(AKLOG_USAGE); +} + +int main(int argc, char *argv[]) +{ + int status = AKLOG_SUCCESS; + int i; + int somethingswrong = FALSE; + + cellinfo_t cellinfo; + + extern char *progname; /* Name of this program */ + + extern int dflag; /* Debug mode */ + + int cmode = FALSE; /* Cellname mode */ + int pmode = FALSE; /* Path name mode */ + + char realm[REALM_SZ]; /* Kerberos realm of afs server */ + char cell[BUFSIZ]; /* Cell to which we are authenticating */ + char path[MAXPATHLEN + 1]; /* Path length for path mode */ + + linked_list cells; /* List of cells to log to */ + linked_list paths; /* List of paths to log to */ + ll_node *cur_node; + + krb5_context context; + + memset(&cellinfo, 0, sizeof(cellinfo)); + + memset(realm, 0, sizeof(realm)); + memset(cell, 0, sizeof(cell)); + memset(path, 0, sizeof(path)); + + ll_init(&cells); + ll_init(&paths); + + /* Store the program name here for error messages */ + if (progname = LastComponent(argv[0])) + progname++; + else + progname = argv[0]; + + /* Initialize list of cells to which we have authenticated */ + (void)ll_init(&authedcells); + + /* Parse commandline arguments and make list of what to do. */ + for (i = 1; i < argc; i++) + { + if (strcmp(argv[i], "-d") == 0) + dflag++; + else if (strcmp(argv[i], "-5") == 0) + usev5++; + else if (strcmp(argv[i], "-4") == 0) + usev5 = 0; + else if (strcmp(argv[i], "-noprdb") == 0) + noprdb++; + else if (strcmp(argv[i], "-force") == 0) + force++; + else if (((strcmp(argv[i], "-cell") == 0) || + (strcmp(argv[i], "-c") == 0)) && !pmode) + { + if (++i < argc) + { + cmode++; + strcpy(cell, argv[i]); + } + else + usage(); + } + else if (((strcmp(argv[i], "-path") == 0) || + (strcmp(argv[i], "-p") == 0)) && !cmode) + { + if (++i < argc) + { + pmode++; + strcpy(path, argv[i]); + } + else + usage(); + } + else if (argv[i][0] == '-') + usage(); + else if (!pmode && !cmode) + { + if (FirstComponent(argv[i]) || (strcmp(argv[i], ".") == 0) || + (strcmp(argv[i], "..") == 0)) + { + pmode++; + strcpy(path, argv[i]); + } + else + { + cmode++; + strcpy(cell, argv[i]); + } + } + else + usage(); + + if (cmode) + { + if (((i + 1) < argc) && (strcmp(argv[i + 1], "-k") == 0)) + { + i += 2; + if (i < argc) + strcpy(realm, argv[i]); + else + usage(); + } + /* Add this cell to list of cells */ + strcpy(cellinfo.cell, cell); + strcpy(cellinfo.realm, realm); + if (cur_node = ll_add_node(&cells, ll_tail)) + { + char *new_cellinfo; + if (new_cellinfo = copy_cellinfo(&cellinfo)) + ll_add_data(cur_node, new_cellinfo); + else + { + fprintf(stderr, "%s: failure copying cellinfo.\n", progname); + exit(AKLOG_MISC); + } + } + else + { + fprintf(stderr, "%s: failure adding cell to cells list.\n", + progname); + exit(AKLOG_MISC); + } + memset(&cellinfo, 0, sizeof(cellinfo)); + cmode = FALSE; + memset(cell, 0, sizeof(cell)); + memset(realm, 0, sizeof(realm)); + } + else if (pmode) + { + /* Add this path to list of paths */ + if (cur_node = ll_add_node(&paths, ll_tail)) + { + char *new_path; + if (new_path = copy_string(path)) + ll_add_data(cur_node, new_path); + else + { + fprintf(stderr, "%s: failure copying path name.\n", + progname); + exit(AKLOG_MISC); + } + } + else + { + fprintf(stderr, "%s: failure adding path to paths list.\n", + progname); + exit(AKLOG_MISC); + } + pmode = FALSE; + memset(path, 0, sizeof(path)); + } + } + + if(usev5) + krb5_init_context(&context); + + /* If nothing was given, log to the local cell. */ + if ((cells.nelements + paths.nelements) == 0) + status = auth_to_cell(context, NULL, NULL); + else + { + /* Log to all cells in the cells list first */ + for (cur_node = cells.first; cur_node; cur_node = cur_node->next) + { + memcpy(&cellinfo, cur_node->data, sizeof(cellinfo)); + if (status = auth_to_cell( + context, + cellinfo.cell, cellinfo.realm)) + somethingswrong++; + } + + /* Then, log to all paths in the paths list */ + for (cur_node = paths.first; cur_node; cur_node = cur_node->next) + { + if (status = auth_to_path( + context, + cur_node->data)) + somethingswrong++; + } + + /* + * If only one thing was logged to, we'll return the status + * of the single call. Otherwise, we'll return a generic + * something failed status. + */ + if (somethingswrong && ((cells.nelements + paths.nelements) > 1)) + status = AKLOG_SOMETHINGSWRONG; + } + + if(usev5) + krb5_free_context(context); + + exit(status); +} diff --git a/src/WINNT/aklog/aklog.h b/src/WINNT/aklog/aklog.h new file mode 100644 index 000000000..349991291 --- /dev/null +++ b/src/WINNT/aklog/aklog.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 1989,2004 by the Massachusetts Institute of Technology + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + */ + +#ifndef __AKLOG_H__ +#define __AKLOG_H__ + +#if !defined(lint) && !defined(SABER) +static char *rcsid_aklog_h = "$Id: aklog.h,v 1.1 2004/04/13 03:05:31 jaltman Exp $"; +#endif /* lint || SABER */ + +#ifndef WIN32 +#include +#endif + +#if !defined(vax) +#ifndef WIN32 +#include +#endif +#include +#include +#endif + +#ifndef WIN32 +#include +#endif +#include +#include "linked_list.h" + +#ifdef __STDC__ +#define ARGS(x) x +#else +#define ARGS(x) () +#endif /* __STDC__ */ + +#include + +typedef struct { + int (*readlink)ARGS((char *, char *, int)); + int (*isdir)ARGS((char *, unsigned char *)); + char *(*getcwd)ARGS((char *, size_t)); + int (*get_cred)ARGS((char *, char *, char *, CREDENTIALS *)); + int (*get_user_realm)ARGS((char *)); + void (*pstderr)ARGS((char *)); + void (*pstdout)ARGS((char *)); + void (*exitprog)ARGS((char)); +} aklog_params; + +void aklog ARGS((int, char *[], aklog_params *)); +void aklog_init_params ARGS((aklog_params *)); + +#endif /* __AKLOG_H__ */ diff --git a/src/WINNT/aklog/aklog.rc b/src/WINNT/aklog/aklog.rc new file mode 100644 index 000000000..720ed3b31 --- /dev/null +++ b/src/WINNT/aklog/aklog.rc @@ -0,0 +1,17 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* Define VERSIONINFO resource */ + +#define AFS_VERINFO_FILE_DESCRIPTION "AFS File Server Command" +#define AFS_VERINFO_NAME "aklog" +#define AFS_VERINFO_FILENAME "aklog.exe" + +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" diff --git a/src/WINNT/aklog/linked_list.c b/src/WINNT/aklog/linked_list.c new file mode 100644 index 000000000..401834fe9 --- /dev/null +++ b/src/WINNT/aklog/linked_list.c @@ -0,0 +1,173 @@ +/* Copyright 1999, 1991, 1999 by the Massachusetts Institute of Technology. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of M.I.T. not be used in + * advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" + * without express or implied warranty. + */ + +/* This file contains general linked list routines. */ + +static const char rcsid[] = "$Id: linked_list.c,v 1.1 2004/04/13 03:05:31 jaltman Exp $"; + +#include +#include +#include + +#include "linked_list.h" + +/* + * Requires: + * List must point to a linked list structure. It is not acceptable + * to pass a null pointer to this routine. + * Modifies: + * list + * Effects: + * Initializes the list to be one with no elements. If list is + * NULL, prints an error message and causes the program to crash. + */ +void ll_init(linked_list *list) +{ + if (list == NULL) + { + fprintf(stderr, "Error: calling ll_init with null pointer.\n"); + abort(); + } + + list->first = list->last = NULL; + list->nelements = 0; +} + +/* + * Modifies: + * list + * Effects: + * Adds a node to one end of the list (as specified by which_end) + * and returns a pointer to the node added. which_end is of type + * ll_end and should be either ll_head or ll_tail as specified in + * list.h. If there is not enough memory to allocate a node, + * the program returns NULL. + */ +ll_node *ll_add_node(linked_list *list, ll_end which_end) +{ + ll_node *node = NULL; + + node = malloc(sizeof(ll_node)); + if (node) + { + node->data = NULL; + if (list->nelements == 0) + { + list->first = node; + list->last = node; + list->nelements = 1; + node->prev = node->next = NULL; + } + else + { + switch (which_end) + { + case ll_head: + list->first->prev = node; + node->next = list->first; + list->first = node; + node->prev = NULL; + break; + case ll_tail: + list->last->next = node; + node->prev = list->last; + list->last = node; + node->next = NULL; + break; + default: + fprintf(stderr, "ll_add_node got a which_end parameter that " + "it can't handle.\n"); + abort(); + } + list->nelements++; + } + } + + return node; +} + + +/* + * Modifies: + * list + * Effects: + * If node is in list, deletes node and returns LL_SUCCESS. + * Otherwise, returns LL_FAILURE. If node contains other data, + * it is the responsibility of the caller to free it. Also, since + * this routine frees node, after the routine is called, "node" + * won't point to valid data. + */ +int ll_delete_node(linked_list *list, ll_node *node) +{ + ll_node *cur_node; + + for (cur_node = list->first; cur_node; cur_node = cur_node->next) + { + if (cur_node == node) + { + if (cur_node->prev) + cur_node->prev->next = cur_node->next; + else + list->first = cur_node->next; + + if (cur_node->next) + cur_node->next->prev = cur_node->prev; + else + list->last = cur_node->prev; + + free(cur_node); + list->nelements--; + return LL_SUCCESS; + } + } + + return LL_FAILURE; +} + +int ll_string_check(linked_list *list, char *string) +{ + ll_node *cur_node; + + /* Scan the list until we find the string in question */ + for (cur_node = list->first; cur_node; cur_node = cur_node->next) + { + if (strcmp(string, cur_node->data) == 0) + return 1; + } + return 0; +} + +/* This routine maintains a list of strings preventing duplication. */ +int ll_add_string(linked_list *list, char *string) +{ + ll_node *node; + char *new_string; + + if (!ll_string_check(list, string)) + { + node = ll_add_node(list, ll_tail); + if (node) + { + new_string = strdup(string); + if (new_string) + ll_add_data(node, new_string); + else + return LL_FAILURE; + } + else + return LL_FAILURE; + } + return LL_SUCCESS; +} diff --git a/src/WINNT/aklog/linked_list.h b/src/WINNT/aklog/linked_list.h new file mode 100644 index 000000000..15baa7b26 --- /dev/null +++ b/src/WINNT/aklog/linked_list.h @@ -0,0 +1,49 @@ +/* $Id: linked_list.h,v 1.1 2004/04/13 03:05:31 jaltman Exp $ */ + +/* Copyright 1990, 1991, 1999 by the Massachusetts Institute of + * Technology. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting + * documentation, and that the name of M.I.T. not be used in + * advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" + * without express or implied warranty. + */ + +#ifndef AKLOG__LINKED_LIST_H +#define AKLOG__LINKED_LIST_H + +#define LL_SUCCESS 0 +#define LL_FAILURE -1 + +typedef struct _ll_node { + struct _ll_node *prev; + struct _ll_node *next; + void *data; +} ll_node; + +typedef struct { + ll_node *first; + ll_node *last; + int nelements; +} linked_list; + +typedef enum {ll_head, ll_tail} ll_end; + + +/* ll_add_data just assigns the data field of node to be d. */ +#define ll_add_data(n,d) (((n)->data)=(d)) + +void ll_init(linked_list *list); +ll_node *ll_add_node(linked_list *list, ll_end which_end); +int ll_delete_node(linked_list *list, ll_node *node); +int ll_string_check(linked_list *, char *); +int ll_add_string(linked_list *, char *); + +#endif /* AKLOG__LINKED_LIST_H */ diff --git a/src/WINNT/bosctlsvc/NTMakefile b/src/WINNT/bosctlsvc/NTMakefile index 2b8089073..fa75d211e 100644 --- a/src/WINNT/bosctlsvc/NTMakefile +++ b/src/WINNT/bosctlsvc/NTMakefile @@ -5,6 +5,7 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=WINNT\bosctlsvc !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version @@ -14,8 +15,8 @@ EXEFILE = $(DESTDIR)\root.server\usr\afs\bin\bosctlsvc.exe EXEOBJS =\ - bosctlsvc.obj \ - bosctlsvc.res + $(OUT)\bosctlsvc.obj \ + $(OUT)\bosctlsvc.res EXELIBS =\ $(DESTDIR)\lib\afs\afsutil.lib \ @@ -30,8 +31,7 @@ $(EXEFILE): $(EXEOBJS) $(EXELIBS) ############################################################################ # Definitions for generating versioninfo resource via RC -bosctlsvc.res: bosctlsvc.rc AFS_component_version_number.h -# $(RC) $*.rc +$(OUT)\bosctlsvc.res: AFS_component_version_number.h ############################################################################ @@ -44,3 +44,5 @@ install: $(LIBFILE) $(DLLFILE) $(EXEFILE) $(INCFILES) # Local clean target; augments predefined clean target clean:: + +mkdir: diff --git a/src/WINNT/bosctlsvc/bosctlsvc.c b/src/WINNT/bosctlsvc/bosctlsvc.c index 6188cbc4f..d2fd605e5 100644 --- a/src/WINNT/bosctlsvc/bosctlsvc.c +++ b/src/WINNT/bosctlsvc/bosctlsvc.c @@ -233,14 +233,14 @@ BosCtlMain(DWORD argc, LPTSTR *argv) if ((bosCtlEvent[BOS_STOP_EVENT] = CreateEvent(NULL, FALSE /* manual reset */, FALSE /* initial state */, - NULL)) == NULL) { + TEXT("BosCtlSvc Stop Event"))) == NULL) { status = GetLastError(); } if ((bosCtlEvent[BOS_EXIT_EVENT] = CreateEvent(NULL, FALSE /* manual reset */, FALSE /* initial state */, - NULL)) == NULL) { + TEXT("BosCtlSvc Exit Event"))) == NULL) { status = GetLastError(); } @@ -452,7 +452,7 @@ BosserverRun(DWORD argc, char **spawn_argv; /* Display bosserver startup (legal) message; first start only */ - BosserverStartupMsgDisplay(); + /* BosserverStartupMsgDisplay(); */ /* Set env variable forcing process mgmt lib to spawn processes detached */ (void)putenv(PMGT_SPAWN_DETACHED_ENV_NAME "=1"); diff --git a/src/WINNT/client_config/NTMakefile b/src/WINNT/client_config/NTMakefile index 0d1d17610..08051d79d 100644 --- a/src/WINNT/client_config/NTMakefile +++ b/src/WINNT/client_config/NTMakefile @@ -7,10 +7,10 @@ # include the AFSD source tree on our inclusion path -AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I ..\afsd +AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) /D"_AFXDLL" -I..\afsd # include the primary makefile - +RELDIR=WINNT\client_config !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !include ..\..\config\NTMakefile.version @@ -22,43 +22,48 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I ..\afsd EXEFILE = $(DESTDIR)\root.client\usr\vice\etc\afs_config.exe EXEOBJS = \ - afs_config_stub.res \ - cellservdb.obj \ - checklist.obj \ - config.obj \ - ctl_sockaddr.obj \ - ctl_spinner.obj \ - dialog.obj \ - drivemap.obj \ - fastlist.obj \ - fs_utils.obj \ - hashlist.obj \ - isadmin.obj \ - main.obj \ - misc.obj \ - pagesize.obj \ - resize.obj \ - subclass.obj \ - tab_advanced.obj \ - tab_drives.obj \ - tab_hosts.obj \ - tab_general.obj \ - tab_prefs.obj \ - dlg_misc.obj \ - dlg_logon.obj \ - dlg_diag.obj \ - dlg_automap.obj + $(OUT)\config.obj \ + $(OUT)\drivemap.obj \ + $(OUT)\main.obj \ + $(OUT)\misc.obj \ + $(OUT)\pagesize.obj \ + $(OUT)\tab_advanced.obj \ + $(OUT)\tab_drives.obj \ + $(OUT)\tab_hosts.obj \ + $(OUT)\tab_general.obj \ + $(OUT)\tab_prefs.obj \ + $(OUT)\dlg_logon.obj \ + $(OUT)\dlg_diag.obj \ + $(OUT)\dlg_misc.obj \ + $(OUT)\isadmin.obj \ + $(OUT)\dlg_automap.obj \ + $(OUT)\dlg_binding.obj \ + $(OUT)\RegistrySupport.obj + +EXEOBJSc = \ + $(OUT)\cellservdb.obj + +EXERES = \ + $(OUT)\afs_config_stub.res + +AFSDOBJS = \ + $(OUT)\fs_utils.obj + +AFSD= ..\afsd VCLIBS =\ comctl32.lib \ shell32.lib \ - mpr.lib + mpr.lib \ + netapi32.lib EXELIBS = \ $(DESTDIR)\lib\afs\TaLocale.lib \ $(DESTDIR)\lib\afsrpc.lib \ $(DESTDIR)\lib\afsauthent.lib \ - $(DESTDIR)\lib\libafsconf.lib + $(DESTDIR)\lib\libosi.lib \ + $(DESTDIR)\lib\libafsconf.lib \ + $(DESTDIR)\lib\lanahelper.lib ############################################################################ # @@ -80,46 +85,43 @@ COPYHEADERS = \ $(DESTDIR)\include\WINNT\resize.h \ $(DESTDIR)\include\WINNT\subclass.h -COPYSOURCES = \ - .\checklist.cpp \ - .\checklist.h \ - .\ctl_sockaddr.cpp \ - .\ctl_sockaddr.h \ - .\ctl_spinner.cpp \ - .\ctl_spinner.h \ - .\dialog.cpp \ - .\dialog.h \ - .\fastlist.cpp \ - .\fastlist.h \ - .\fs_utils.c \ - .\hashlist.cpp \ - .\hashlist.h \ - .\resize.cpp \ - .\resize.h \ - .\subclass.cpp \ - .\subclass.h +AFSAPPLIBOBJS= \ + $(OUT)\hashlist.obj \ + $(OUT)\resize.obj \ + $(OUT)\subclass.obj \ + $(OUT)\fastlist.obj \ + $(OUT)\dialog.obj \ + $(OUT)\ctl_sockaddr.obj \ + $(OUT)\ctl_spinner.obj \ + $(OUT)\checklist.obj + +AFSAPPLIB=..\afsapplib + +$(AFSAPPLIBOBJS): $(AFSAPPLIB)\$$(@B).cpp + $(C2OBJ) -I$(AFSAPPLIB) $** + +$(AFSDOBJS): $(AFSD)\$$(@B).c + $(C2OBJ) -I$(AFSD) $** + +$(EXEOBJS): $$(@B).cpp + $(C2OBJ) -I$(AFSAPPLIB) $** + +$(EXEOBJSc): $$(@B).c + $(CPP2OBJ) -I$(AFSAPPLIB) $** ############################################################################ {..\afsapplib}.h{$(DESTDIR)\include\WINNT}.h: $(COPY) ..\afsapplib\$(*B).h $(DESTDIR)\include\WINNT -{..\afsapplib}.h{.\}.h: - $(COPY) ..\afsapplib\$(*B).h . - -{..\afsapplib}.cpp{.\}.cpp: - $(COPY) ..\afsapplib\$(*B).cpp . - -{..\afsd}.c{.\}.c: - $(COPY) ..\afsd\$(*B).c . ############################################################################ -$(EXEFILE) : $(EXEOBJS) $(EXELIBS) +$(EXEFILE) : $(EXEOBJS) $(EXEOBJSc) $(EXERES) $(AFSAPPLIBOBJS) $(AFSDOBJS) $(EXELIBS) $(EXEGUILINK) $(VCLIBS) $(EXEPREP) -install : $(COPYSOURCES) $(COPYHEADERS) $(EXEFILE) lang +install : $(COPYHEADERS) $(EXEFILE) lang install9x: install @@ -133,54 +135,61 @@ lang:: en_US ja_JP ko_KR zh_TW zh_CN pt_BR es_ES de_DE en_US: $(CD) lang - $(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install + $(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install $(CD) .. ja_JP: $(CD) lang - @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install + @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install $(CD) .. ko_KR: $(CD) lang - @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install + @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install $(CD) .. zh_CN: $(CD) lang - @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install + @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install $(CD) .. zh_TW: $(CD) lang - @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install + @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install $(CD) .. pt_BR: $(CD) lang - @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install + @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install $(CD) .. es_ES: $(CD) lang - @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install + @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install $(CD) .. de_DE: $(CD) lang - @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install + @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install $(CD) .. -afs_config_stub.res : afs_config_stub.rc AFS_component_version_number.h +$(OUT)\afs_config_stub.res : afs_config_stub.rc AFS_component_version_number.h clean:: + $(DEL) $(COPYHEADERS) $(CD) lang - if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /f NTMakefile clean - if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /f NTMakefile clean - if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /f NTMakefile clean - if exist $(NTLANG) $(NTLANG) zh_CN $(MAKECMD) /nologo /f NTMakefile clean - if exist $(NTLANG) $(NTLANG) zh_TW $(MAKECMD) /nologo /f NTMakefile clean - if exist $(NTLANG) $(NTLANG) pt_BR $(MAKECMD) /nologo /f NTMakefile clean - if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /f NTMakefile clean - if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /f NTMakefile clean + if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /e /f NTMakefile clean + if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /e /f NTMakefile clean + if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /e /f NTMakefile clean + if exist $(NTLANG) $(NTLANG) zh_CN $(MAKECMD) /nologo /e /f NTMakefile clean + if exist $(NTLANG) $(NTLANG) zh_TW $(MAKECMD) /nologo /e /f NTMakefile clean + if exist $(NTLANG) $(NTLANG) pt_BR $(MAKECMD) /nologo /e /f NTMakefile clean + if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /e /f NTMakefile clean + if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /e /f NTMakefile clean $(CD) .. + +mkdir: + -mkdir $(OUT)\lang + cd lang + nmake /nologo /e /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir + cd .. diff --git a/src/WINNT/client_config/RegistrySupport.cpp b/src/WINNT/client_config/RegistrySupport.cpp new file mode 100644 index 000000000..50d26f0b6 --- /dev/null +++ b/src/WINNT/client_config/RegistrySupport.cpp @@ -0,0 +1,201 @@ +/*det + * Configuration Read/Modify Functions ________________________________________ + * + * Temporarily these just modify the local Registry. + * In the near future, they will modify the Registry on the + * gateway, if a gateway is being used. + * + */ + +#include +#include +//#include +#include +#include + +BOOL Config_ReadString (LPCTSTR pszLHS, LPTSTR pszRHS, size_t cchMax); + +/* + * REGISTRY ___________________________________________________________________ + * + */ + +extern const TCHAR AFSDConfigKeyName[] = TEXT("SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"); +extern const TCHAR AFSClientKeyName[] = TEXT("SOFTWARE\\OpenAFS\\Client"); + +void Config_GetGlobalDriveList (DRIVEMAPLIST *pDriveList) +{ + // Read the GlobalAutoMapper registry key + TCHAR szDriveToMapTo[5]; + DWORD dwResult; + TCHAR szKeyName[256]; + HKEY hKey; + DWORD dwIndex = 0; + DWORD dwDriveSize; + DWORD dwSubMountSize; + TCHAR szSubMount[256]; + DWORD dwType; + + if (!pDriveList) + return; + + memset(pDriveList, 0, sizeof(DRIVEMAPLIST)); + + lstrcpy(szKeyName, AFSDConfigKeyName); + lstrcat(szKeyName, TEXT("\\GlobalAutoMapper")); + + dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_QUERY_VALUE, &hKey); + if (dwResult != ERROR_SUCCESS) + return; + + // Get the drive map list so we can lookup the paths that go with our submounts + DRIVEMAPLIST DriveMapList; + memset(&DriveMapList, 0, sizeof(DRIVEMAPLIST)); + QueryDriveMapList (&DriveMapList); + + while (1) { + dwDriveSize = sizeof(szDriveToMapTo); + dwSubMountSize = sizeof(szSubMount); + + dwResult = RegEnumValue(hKey, dwIndex++, szDriveToMapTo, &dwDriveSize, 0, &dwType, (BYTE*)szSubMount, &dwSubMountSize); + if (dwResult != ERROR_SUCCESS) + break; + + szDriveToMapTo[0] = _totupper(szDriveToMapTo[0]); + + int nCurDrive = szDriveToMapTo[0] - TEXT('A'); + + pDriveList->aDriveMap[nCurDrive].chDrive = szDriveToMapTo[0]; + lstrcpy(pDriveList->aDriveMap[nCurDrive].szSubmount, szSubMount); + + // Find the path that goes with this submount + SubmountToPath (&DriveMapList, pDriveList->aDriveMap[nCurDrive].szMapping, szSubMount, FALSE); + } + + FreeDriveMapList(&DriveMapList); + + RegCloseKey(hKey); +} + +BOOL Config_ReadGlobalNum (LPCTSTR pszLHS, DWORD *pdwRHS) +{ + HKEY hk; + if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSDConfigKeyName, 0, KEY_QUERY_VALUE, &hk) != ERROR_SUCCESS) + return FALSE; + + DWORD dwSize = sizeof(*pdwRHS); + if (RegQueryValueEx (hk, pszLHS, NULL, NULL, (PBYTE)pdwRHS, &dwSize) != ERROR_SUCCESS) + { + RegCloseKey (hk); + return FALSE; + } + + RegCloseKey (hk); + return TRUE; +} + + +BOOL Config_ReadGlobalString (LPCTSTR pszLHS, LPTSTR pszRHS, size_t cchMax) +{ + HKEY hk; + if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSDConfigKeyName, 0, KEY_QUERY_VALUE, &hk) != ERROR_SUCCESS) + return FALSE; + + DWORD dwSize = sizeof(TCHAR) * cchMax; + if (RegQueryValueEx (hk, pszLHS, NULL, NULL, (PBYTE)pszRHS, &dwSize) != ERROR_SUCCESS) + { + RegCloseKey (hk); + return FALSE; + } + + RegCloseKey (hk); + return TRUE; +} + + +void Config_WriteGlobalNum (LPCTSTR pszLHS, DWORD dwRHS) +{ + HKEY hk; + DWORD dwDisp; + if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, AFSDConfigKeyName, 0, TEXT("container"), 0, KEY_SET_VALUE, NULL, &hk, &dwDisp) == ERROR_SUCCESS) + { + RegSetValueEx (hk, pszLHS, NULL, REG_DWORD, (PBYTE)&dwRHS, sizeof(dwRHS)); + RegCloseKey (hk); + } +} + + +void Config_WriteGlobalString (LPCTSTR pszLHS, LPCTSTR pszRHS) +{ + HKEY hk; + DWORD dwDisp; + if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, AFSDConfigKeyName, 0, TEXT("container"), 0, KEY_SET_VALUE, NULL, &hk, &dwDisp) == ERROR_SUCCESS) + { + RegSetValueEx (hk, pszLHS, NULL, REG_SZ, (PBYTE)pszRHS, sizeof(TCHAR) * (1+lstrlen(pszRHS))); + RegCloseKey (hk); + } +} + + +BOOL Config_ReadUserNum (LPCTSTR pszLHS, DWORD *pdwRHS) +{ + HKEY hk; + if (RegOpenKeyEx (HKEY_CURRENT_USER, AFSClientKeyName, 0, KEY_QUERY_VALUE, &hk) != ERROR_SUCCESS) + if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSClientKeyName, 0, KEY_QUERY_VALUE, &hk) != ERROR_SUCCESS) + return FALSE; + + DWORD dwSize = sizeof(*pdwRHS); + if (RegQueryValueEx (hk, pszLHS, NULL, NULL, (PBYTE)pdwRHS, &dwSize) != ERROR_SUCCESS) + { + RegCloseKey (hk); + return FALSE; + } + + RegCloseKey (hk); + return TRUE; +} + + +BOOL Config_ReadUserString (LPCTSTR pszLHS, LPTSTR pszRHS, size_t cchMax) +{ + HKEY hk; + if (RegOpenKeyEx (HKEY_CURRENT_USER, AFSClientKeyName, 0, KEY_QUERY_VALUE, &hk) != ERROR_SUCCESS) + if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSClientKeyName, 0, KEY_QUERY_VALUE, &hk) != ERROR_SUCCESS) + return FALSE; + + DWORD dwSize = sizeof(TCHAR) * cchMax; + if (RegQueryValueEx (hk, pszLHS, NULL, NULL, (PBYTE)pszRHS, &dwSize) != ERROR_SUCCESS) + { + RegCloseKey (hk); + return FALSE; + } + + RegCloseKey (hk); + return TRUE; +} + + +void Config_WriteUserNum (LPCTSTR pszLHS, DWORD dwRHS) +{ + HKEY hk; + DWORD dwDisp; + if (RegCreateKeyEx (HKEY_CURRENT_USER, AFSClientKeyName, 0, TEXT("container"), 0, KEY_SET_VALUE, NULL, &hk, &dwDisp) == ERROR_SUCCESS) + { + RegSetValueEx (hk, pszLHS, NULL, REG_DWORD, (PBYTE)&dwRHS, sizeof(dwRHS)); + RegCloseKey (hk); + } +} + + +void Config_WriteUserString (LPCTSTR pszLHS, LPCTSTR pszRHS) +{ + HKEY hk; + DWORD dwDisp; + if (RegCreateKeyEx (HKEY_CURRENT_USER, AFSClientKeyName, 0, TEXT("container"), 0, KEY_SET_VALUE, NULL, &hk, &dwDisp) == ERROR_SUCCESS) + { + RegSetValueEx (hk, pszLHS, NULL, REG_SZ, (PBYTE)pszRHS, sizeof(TCHAR) * (1+lstrlen(pszRHS))); + RegCloseKey (hk); + } +} + + diff --git a/src/WINNT/client_config/afs_config.h b/src/WINNT/client_config/afs_config.h index b439d9553..a9f34f405 100644 --- a/src/WINNT/client_config/afs_config.h +++ b/src/WINNT/client_config/afs_config.h @@ -83,8 +83,8 @@ typedef struct extern GLOBALS g; -extern const TCHAR AFSConfigKeyName[]; - +extern const TCHAR AFSDConfigKeyName[]; +extern const TCHAR AFSClientKeyName[]; /* * MACROS _____________________________________________________________________ diff --git a/src/WINNT/client_config/config.cpp b/src/WINNT/client_config/config.cpp index 69b40c3f1..d39f24fc3 100644 --- a/src/WINNT/client_config/config.cpp +++ b/src/WINNT/client_config/config.cpp @@ -34,14 +34,6 @@ extern "C" { #define PIOCTL_MAXSIZE 2048 -/* - * REGISTRY ___________________________________________________________________ - * - */ - -static TCHAR cszLANMANDEVICE[] = TEXT("\\Device\\LanmanRedirector\\"); -const TCHAR AFSConfigKeyName[] = TEXT("SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"); - /* * ROUTINES ___________________________________________________________________ @@ -91,14 +83,14 @@ DWORD Config_GetServiceState (void) void Config_GetGatewayFlag (BOOL *pfFlag) { - if (!Config_ReadNum (TEXT("IsGateway"), (DWORD*)pfFlag)) + if (!Config_ReadGlobalNum (TEXT("IsGateway"), (DWORD*)pfFlag)) *pfFlag = FALSE; } BOOL Config_SetGatewayFlag (BOOL fFlag, ULONG *pStatus) { - Config_WriteNum (TEXT("IsGateway"), fFlag); + Config_WriteGlobalNum (TEXT("IsGateway"), fFlag); g.fNeedRestart = TRUE; return TRUE; } @@ -106,7 +98,7 @@ BOOL Config_SetGatewayFlag (BOOL fFlag, ULONG *pStatus) void Config_GetGatewayName (LPTSTR pszName) { - if (!Config_ReadString (TEXT("Gateway"), pszName, MAX_PATH)) + if (!Config_ReadGlobalString (TEXT("Gateway"), pszName, MAX_PATH)) GetString (pszName, IDS_GATEWAY_UNKNOWN); else if (!*pszName) GetString (pszName, IDS_GATEWAY_UNKNOWN); @@ -119,11 +111,11 @@ BOOL Config_SetGatewayName (LPCTSTR pszName, ULONG *pStatus) GetString (szBogus, IDS_GATEWAY_UNKNOWN); if (!lstrcmpi (szBogus, pszName)) { - Config_WriteString (TEXT("Gateway"), TEXT("")); + Config_WriteGlobalString (TEXT("Gateway"), TEXT("")); } else { - Config_WriteString (TEXT("Gateway"), pszName); + Config_WriteGlobalString (TEXT("Gateway"), pszName); } return TRUE; @@ -165,7 +157,7 @@ void Config_FixGatewayDrives (void) void Config_GetCellName (LPTSTR pszName) { - if (!Config_ReadString (TEXT("Cell"), pszName, MAX_PATH)) + if (!Config_ReadGlobalString (TEXT("Cell"), pszName, MAX_PATH)) GetString (pszName, IDS_CELL_UNKNOWN); else if (!*pszName) GetString (pszName, IDS_CELL_UNKNOWN); @@ -211,7 +203,7 @@ BOOL Config_SetCellName (LPCTSTR pszName, ULONG *pStatus) GetString (szBogus, IDS_CELL_UNKNOWN); if (lstrcmpi (szBogus, pszName)) { - Config_WriteString (TEXT("Cell"), pszName); + Config_WriteGlobalString (TEXT("Cell"), pszName); g.fNeedRestart = TRUE; } return TRUE; @@ -347,14 +339,14 @@ BOOL Config_SetAuthentFlag (BOOL fFlag, ULONG *pStatus) void Config_GetTrayIconFlag (BOOL *pfFlag) { - if (!Config_ReadNum (TEXT("ShowTrayIcon"), (DWORD*)pfFlag)) + if (!Config_ReadUserNum (TEXT("ShowTrayIcon"), (DWORD*)pfFlag)) *pfFlag = FALSE; } BOOL Config_SetTrayIconFlag (BOOL fFlag, ULONG *pStatus) { - Config_WriteNum (TEXT("ShowTrayIcon"), fFlag); + Config_WriteUserNum (TEXT("ShowTrayIcon"), fFlag); for (HWND hSearch = GetWindow (GetDesktopWindow(), GW_CHILD); hSearch && IsWindow(hSearch); @@ -521,7 +513,7 @@ void Config_FreeServerPrefs (PSERVERPREFS pPrefs) void Config_GetCacheSize (ULONG *pckCache) { - if (!Config_ReadNum (TEXT("CacheSize"), (DWORD*)pckCache)) + if (!Config_ReadGlobalNum (TEXT("CacheSize"), (DWORD*)pckCache)) *pckCache = CM_CONFIGDEFAULT_CACHESIZE; } @@ -555,7 +547,7 @@ BOOL Config_SetCacheSize (ULONG ckCache, ULONG *pStatus) if (rc) { - Config_WriteNum (TEXT("CacheSize"), ckCache); + Config_WriteGlobalNum (TEXT("CacheSize"), ckCache); } if (pStatus && !rc) @@ -569,7 +561,7 @@ BOOL Config_SetCacheSize (ULONG ckCache, ULONG *pStatus) void Config_GetChunkSize (ULONG *pckChunk) { - if (!Config_ReadNum (TEXT("ChunkSize"), (DWORD*)pckChunk)) + if (!Config_ReadGlobalNum (TEXT("ChunkSize"), (DWORD*)pckChunk)) *pckChunk = CM_CONFIGDEFAULT_CHUNKSIZE; *pckChunk = max (*pckChunk, 10); *pckChunk = (1 << ((*pckChunk)-10)); @@ -578,7 +570,7 @@ void Config_GetChunkSize (ULONG *pckChunk) BOOL Config_SetChunkSize (ULONG ckChunk, ULONG *pStatus) { - Config_WriteNum (TEXT("ChunkSize"), log2(ckChunk * 1024)); + Config_WriteGlobalNum (TEXT("ChunkSize"), log2(ckChunk * 1024)); g.fNeedRestart = TRUE; return TRUE; } @@ -587,14 +579,14 @@ BOOL Config_SetChunkSize (ULONG ckChunk, ULONG *pStatus) void Config_GetStatEntries (ULONG *pcEntries) { - if (!Config_ReadNum (TEXT("Stats"), (DWORD*)pcEntries)) + if (!Config_ReadGlobalNum (TEXT("Stats"), (DWORD*)pcEntries)) *pcEntries = CM_CONFIGDEFAULT_STATS; } BOOL Config_SetStatEntries (ULONG cEntries, ULONG *pStatus) { - Config_WriteNum (TEXT("Stats"), cEntries); + Config_WriteGlobalNum (TEXT("Stats"), cEntries); g.fNeedRestart = TRUE; return TRUE; } @@ -647,14 +639,14 @@ BOOL Config_SetProbeInt (ULONG csecProbe, ULONG *pStatus) void Config_GetNumThreads (ULONG *pcThreads) { - if (!Config_ReadNum (TEXT("ServerThreads"), (DWORD*)pcThreads)) + if (!Config_ReadGlobalNum (TEXT("ServerThreads"), (DWORD*)pcThreads)) *pcThreads = CM_CONFIGDEFAULT_SVTHREADS; } BOOL Config_SetNumThreads (ULONG cThreads, ULONG *pStatus) { - Config_WriteNum (TEXT("ServerThreads"), cThreads); + Config_WriteGlobalNum (TEXT("ServerThreads"), cThreads); g.fNeedRestart = TRUE; return TRUE; } @@ -663,14 +655,14 @@ BOOL Config_SetNumThreads (ULONG cThreads, ULONG *pStatus) void Config_GetNumDaemons (ULONG *pcDaemons) { - if (!Config_ReadNum (TEXT("Daemons"), (DWORD*)pcDaemons)) + if (!Config_ReadGlobalNum (TEXT("Daemons"), (DWORD*)pcDaemons)) *pcDaemons = CM_CONFIGDEFAULT_DAEMONS; } BOOL Config_SetNumDaemons (ULONG cDaemons, ULONG *pStatus) { - Config_WriteNum (TEXT("Daemons"), cDaemons); + Config_WriteGlobalNum (TEXT("Daemons"), cDaemons); g.fNeedRestart = TRUE; return TRUE; } @@ -679,7 +671,7 @@ BOOL Config_SetNumDaemons (ULONG cDaemons, ULONG *pStatus) void Config_GetSysName (LPTSTR pszName) { - if (!Config_ReadString (TEXT("SysName"), pszName, MAX_PATH)) + if (!Config_ReadGlobalString (TEXT("SysName"), pszName, MAX_PATH)) lstrcpy (pszName, TEXT("i386_nt40")); } @@ -716,7 +708,7 @@ BOOL Config_SetSysName (LPCTSTR pszName, ULONG *pStatus) if (rc) { - Config_WriteString (TEXT("SysName"), pszName); + Config_WriteGlobalString (TEXT("SysName"), pszName); } if (pStatus && !rc) @@ -730,14 +722,14 @@ BOOL Config_SetSysName (LPCTSTR pszName, ULONG *pStatus) void Config_GetRootVolume (LPTSTR pszName) { - if (!Config_ReadString (TEXT("RootVolume"), pszName, MAX_PATH)) + if (!Config_ReadGlobalString (TEXT("RootVolume"), pszName, MAX_PATH)) lstrcpy (pszName, TEXT("root.afs")); } BOOL Config_SetRootVolume (LPCTSTR pszName, ULONG *pStatus) { - Config_WriteString (TEXT("RootVolume"), pszName); + Config_WriteGlobalString (TEXT("RootVolume"), pszName); g.fNeedRestart = TRUE; return TRUE; } @@ -746,14 +738,14 @@ BOOL Config_SetRootVolume (LPCTSTR pszName, ULONG *pStatus) void Config_GetMountRoot (LPTSTR pszPath) { - if (!Config_ReadString (TEXT("MountRoot"), pszPath, MAX_PATH)) + if (!Config_ReadGlobalString (TEXT("MountRoot"), pszPath, MAX_PATH)) lstrcpy (pszPath, TEXT("/afs")); } BOOL Config_SetMountRoot (LPCTSTR pszPath, ULONG *pStatus) { - Config_WriteString (TEXT("MountRoot"), pszPath); + Config_WriteGlobalString (TEXT("MountRoot"), pszPath); g.fNeedRestart = TRUE; return TRUE; } @@ -799,7 +791,7 @@ BOOL Config_GetCacheInUse (ULONG *pckCacheInUse, ULONG *pStatus) void Config_GetCachePath (LPTSTR pszCachePath) { - if (!Config_ReadString (TEXT("CachePath"), pszCachePath, MAX_PATH)) { + if (!Config_ReadGlobalString (TEXT("CachePath"), pszCachePath, MAX_PATH)) { TCHAR szPath[MAX_PATH]; GetWindowsDirectory(szPath, sizeof(szPath)); szPath[2] = 0; /* get drive letter only */ @@ -811,206 +803,83 @@ void Config_GetCachePath (LPTSTR pszCachePath) BOOL Config_SetCachePath(LPCTSTR pszPath, ULONG *pStatus) { - Config_WriteString (TEXT("CachePath"), pszPath); + Config_WriteGlobalString (TEXT("CachePath"), pszPath); g.fNeedRestart = TRUE; return TRUE; } void Config_GetLanAdapter (ULONG *pnLanAdapter) { - if (!Config_ReadNum (TEXT("LANadapter"), (DWORD*)pnLanAdapter)) + if (!Config_ReadGlobalNum (TEXT("LANadapter"), (DWORD*)pnLanAdapter)) *pnLanAdapter = -1; } BOOL Config_SetLanAdapter (ULONG nLanAdapter, ULONG *pStatus) { - Config_WriteNum (TEXT("LANadapter"), nLanAdapter); + Config_WriteGlobalNum (TEXT("LANadapter"), nLanAdapter); g.fNeedRestart = TRUE; return TRUE; } void Config_GetTrapOnPanic (BOOL *pfFlag) { - if (!Config_ReadNum (TEXT("TrapOnPanic"), (DWORD*)pfFlag)) + if (!Config_ReadGlobalNum (TEXT("TrapOnPanic"), (DWORD*)pfFlag)) *pfFlag = TRUE; } BOOL Config_SetTrapOnPanic (BOOL fFlag, ULONG *pStatus) { - Config_WriteNum (TEXT("TrapOnPanic"), fFlag); + Config_WriteGlobalNum (TEXT("TrapOnPanic"), fFlag); g.fNeedRestart = TRUE; return TRUE; } void Config_GetTraceBufferSize (ULONG *pnBufSize) { - if (!Config_ReadNum (TEXT("TraceBufferSize"), (DWORD*)pnBufSize)) + if (!Config_ReadGlobalNum (TEXT("TraceBufferSize"), (DWORD*)pnBufSize)) *pnBufSize = 5000; } BOOL Config_SetTraceBufferSize (ULONG nBufSize, ULONG *pStatus) { - Config_WriteNum (TEXT("TraceBufferSize"), nBufSize); + Config_WriteGlobalNum (TEXT("TraceBufferSize"), nBufSize); g.fNeedRestart = TRUE; return TRUE; } void Config_GetLoginRetryInterval (ULONG *pnInterval) { - if (!Config_ReadNum (TEXT("LoginRetryInterval"), (DWORD*)pnInterval)) + if (!Config_ReadGlobalNum (TEXT("LoginRetryInterval"), (DWORD*)pnInterval)) *pnInterval = 30; } BOOL Config_SetLoginRetryInterval (ULONG nInterval, ULONG *pStatus) { - Config_WriteNum (TEXT("LoginRetryInterval"), nInterval); + Config_WriteGlobalNum (TEXT("LoginRetryInterval"), nInterval); return TRUE; } void Config_GetFailLoginsSilently (BOOL *pfFlag) { - if (!Config_ReadNum (TEXT("FailLoginsSilently"), (DWORD*)pfFlag)) + if (!Config_ReadGlobalNum (TEXT("FailLoginsSilently"), (DWORD*)pfFlag)) *pfFlag = FALSE; } BOOL Config_SetFailLoginsSilently (BOOL fFlag, ULONG *pStatus) { - Config_WriteNum (TEXT("FailLoginsSilently"), fFlag); + Config_WriteGlobalNum (TEXT("FailLoginsSilently"), fFlag); return TRUE; } void Config_GetReportSessionStartups (BOOL *pfFlag) { - if (!Config_ReadNum (TEXT("ReportSessionStartups"), (DWORD*)pfFlag)) + if (!Config_ReadGlobalNum (TEXT("ReportSessionStartups"), (DWORD*)pfFlag)) *pfFlag = FALSE; } BOOL Config_SetReportSessionStartups (BOOL fFlag, ULONG *pStatus) { - Config_WriteNum (TEXT("ReportSessionStartups"), fFlag); - return TRUE; -} - -void Config_GetGlobalDriveList (DRIVEMAPLIST *pDriveList) -{ - // Read the GlobalAutoMapper registry key - TCHAR szDriveToMapTo[5]; - DWORD dwResult; - TCHAR szKeyName[256]; - HKEY hKey; - DWORD dwIndex = 0; - DWORD dwDriveSize; - DWORD dwSubMountSize; - TCHAR szSubMount[256]; - DWORD dwType; - - if (!pDriveList) - return; - - memset(pDriveList, 0, sizeof(DRIVEMAPLIST)); - - lstrcpy(szKeyName, AFSConfigKeyName); - lstrcat(szKeyName, TEXT("\\GlobalAutoMapper")); - - dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_QUERY_VALUE, &hKey); - if (dwResult != ERROR_SUCCESS) - return; - - // Get the drive map list so we can lookup the paths that go with our submounts - DRIVEMAPLIST DriveMapList; - memset(&DriveMapList, 0, sizeof(DRIVEMAPLIST)); - QueryDriveMapList (&DriveMapList); - - while (1) { - dwDriveSize = sizeof(szDriveToMapTo); - dwSubMountSize = sizeof(szSubMount); - - dwResult = RegEnumValue(hKey, dwIndex++, szDriveToMapTo, &dwDriveSize, 0, &dwType, (BYTE*)szSubMount, &dwSubMountSize); - if (dwResult != ERROR_SUCCESS) - break; - - szDriveToMapTo[0] = _totupper(szDriveToMapTo[0]); - - int nCurDrive = szDriveToMapTo[0] - TEXT('A'); - - pDriveList->aDriveMap[nCurDrive].chDrive = szDriveToMapTo[0]; - lstrcpy(pDriveList->aDriveMap[nCurDrive].szSubmount, szSubMount); - - // Find the path that goes with this submount - SubmountToPath (&DriveMapList, pDriveList->aDriveMap[nCurDrive].szMapping, szSubMount, FALSE); - } - - FreeDriveMapList(&DriveMapList); - - RegCloseKey(hKey); -} - - -/* - * Configuration Read/Modify Functions ________________________________________ - * - * Temporarily these just modify the local Registry. - * In the near future, they will modify the Registry on the - * gateway, if a gateway is being used. - * - */ - -BOOL Config_ReadNum (LPCTSTR pszLHS, DWORD *pdwRHS) -{ - HKEY hk; - if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, KEY_QUERY_VALUE, &hk) != ERROR_SUCCESS) - return FALSE; - - DWORD dwSize = sizeof(*pdwRHS); - if (RegQueryValueEx (hk, pszLHS, NULL, NULL, (PBYTE)pdwRHS, &dwSize) != ERROR_SUCCESS) - { - RegCloseKey (hk); - return FALSE; - } - - RegCloseKey (hk); - return TRUE; -} - - -BOOL Config_ReadString (LPCTSTR pszLHS, LPTSTR pszRHS, size_t cchMax) -{ - HKEY hk; - if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, KEY_QUERY_VALUE, &hk) != ERROR_SUCCESS) - return FALSE; - - DWORD dwSize = sizeof(TCHAR) * cchMax; - if (RegQueryValueEx (hk, pszLHS, NULL, NULL, (PBYTE)pszRHS, &dwSize) != ERROR_SUCCESS) - { - RegCloseKey (hk); - return FALSE; - } - - RegCloseKey (hk); + Config_WriteGlobalNum (TEXT("ReportSessionStartups"), fFlag); return TRUE; } - -void Config_WriteNum (LPCTSTR pszLHS, DWORD dwRHS) -{ - HKEY hk; - DWORD dwDisp; - if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, TEXT("container"), 0, KEY_SET_VALUE, NULL, &hk, &dwDisp) == ERROR_SUCCESS) - { - RegSetValueEx (hk, pszLHS, NULL, REG_DWORD, (PBYTE)&dwRHS, sizeof(dwRHS)); - RegCloseKey (hk); - } -} - - -void Config_WriteString (LPCTSTR pszLHS, LPCTSTR pszRHS) -{ - HKEY hk; - DWORD dwDisp; - if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, TEXT("container"), 0, KEY_SET_VALUE, NULL, &hk, &dwDisp) == ERROR_SUCCESS) - { - RegSetValueEx (hk, pszLHS, NULL, REG_SZ, (PBYTE)pszRHS, sizeof(TCHAR) * (1+lstrlen(pszRHS))); - RegCloseKey (hk); - } -} - diff --git a/src/WINNT/client_config/config.h b/src/WINNT/client_config/config.h index 712ff7454..a838f23da 100644 --- a/src/WINNT/client_config/config.h +++ b/src/WINNT/client_config/config.h @@ -115,10 +115,15 @@ BOOL Config_SetReportSessionStartups (BOOL fFlag, ULONG *pStatus = NULL); void Config_GetGlobalDriveList (DRIVEMAPLIST *pDriveList); -BOOL Config_ReadNum (LPCTSTR pszLHS, DWORD *pdwRHS); -BOOL Config_ReadString (LPCTSTR pszLHS, LPTSTR pszRHS, size_t cchMax); -void Config_WriteNum (LPCTSTR pszLHS, DWORD dwRHS); -void Config_WriteString (LPCTSTR pszLHS, LPCTSTR pszRHS); +BOOL Config_ReadGlobalNum (LPCTSTR pszLHS, DWORD *pdwRHS); +BOOL Config_ReadGlobalString (LPCTSTR pszLHS, LPTSTR pszRHS, size_t cchMax); +void Config_WriteGlobalNum (LPCTSTR pszLHS, DWORD dwRHS); +void Config_WriteGlobalString (LPCTSTR pszLHS, LPCTSTR pszRHS); + +BOOL Config_ReadUserNum (LPCTSTR pszLHS, DWORD *pdwRHS); +BOOL Config_ReadUserString (LPCTSTR pszLHS, LPTSTR pszRHS, size_t cchMax); +void Config_WriteUserNum (LPCTSTR pszLHS, DWORD dwRHS); +void Config_WriteUserString (LPCTSTR pszLHS, LPCTSTR pszRHS); #endif diff --git a/src/WINNT/client_config/dlg_automap.cpp b/src/WINNT/client_config/dlg_automap.cpp index 096b32412..609f169c7 100644 --- a/src/WINNT/client_config/dlg_automap.cpp +++ b/src/WINNT/client_config/dlg_automap.cpp @@ -10,10 +10,12 @@ extern "C" { #include #include +#include } #include "afs_config.h" #include +#include /* * DEFINITIONS ________________________________________________________________ @@ -32,7 +34,6 @@ enum DDDACTION { DDD_ADD, DDD_REMOVE }; * PROTOTYPES _________________________________________________________________ * */ - void AutoMap_OnInitDialog (HWND hDlg); void AutoMap_OnAdd (HWND hDlg); void AutoMap_OnSelect (HWND hDlg); @@ -217,7 +218,7 @@ BOOL UpdateRegistry(DRIVEMAP *pDrive, BOOL bRemove) if (!pDrive) return FALSE; - _stprintf(szKeyName, TEXT("%s\\GlobalAutoMapper"), AFSConfigKeyName); + _stprintf(szKeyName, TEXT("%s\\GlobalAutoMapper"), AFSDConfigKeyName); if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hKey, &dwDispo) != ERROR_SUCCESS) return FALSE; @@ -448,7 +449,7 @@ void AutoMapEdit_OnInitDialog (HWND hDlg) SendMessage (hCombo, CB_SETCURSEL, iItemSel, 0); TCHAR szMapping[ MAX_PATH ]; - AdjustAfsPath (szMapping, ((pMap->szMapping[0]) ? pMap->szMapping : TEXT("/afs")), TRUE, FALSE); + AdjustAfsPath (szMapping, ((pMap->szMapping[0]) ? pMap->szMapping : cm_slash_mount_root), TRUE, FALSE); SetDlgItemText (hDlg, IDC_PATH, szMapping); SetDlgItemText (hDlg, IDC_DESC, pMap->szSubmount); @@ -476,12 +477,12 @@ void AutoMapEdit_OnOK (HWND hDlg) return; } - if ( (lstrncmpi (pMap->szMapping, TEXT("/afs"), lstrlen(TEXT("/afs")))) && - (lstrncmpi (pMap->szMapping, TEXT("\\afs"), lstrlen(TEXT("\\afs")))) ) - { - Message (MB_ICONHAND, GetErrorTitle(), IDS_BADMAP_DESC); - return; - } + if ( (lstrncmpi (pMap->szMapping, cm_slash_mount_root, lstrlen(cm_slash_mount_root))) && + (lstrncmpi (pMap->szMapping, cm_back_slash_mount_root, lstrlen(cm_back_slash_mount_root))) ) + { + Message (MB_ICONHAND, GetErrorTitle(), IDS_BADMAP_DESC); + return; + } // First get a proper submount if (pMap->szSubmount[0]) { diff --git a/src/WINNT/client_config/dlg_binding.cpp b/src/WINNT/client_config/dlg_binding.cpp new file mode 100644 index 000000000..5ccfcdbaa --- /dev/null +++ b/src/WINNT/client_config/dlg_binding.cpp @@ -0,0 +1,263 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +extern "C" { +#include +#include +} +#include +#include "afs_config.h" +#include + +/* + * DEFINITIONS ________________________________________________________________ + * + */ + + +// Our dialog data +static BOOL fFirstTime = TRUE; +int nLanAdapter; +LANAINFO* lanainfo = NULL; + +int GetAdapterNumber(TCHAR*); + +/* + * PROTOTYPES _________________________________________________________________ + * + */ + +void Binding_OnInitDialog (HWND hDlg); +void Binding_OnOK(HWND hDlg); +void Binding_OnCancel(HWND hDlg); +BOOL Binding_OnApply(); + +BOOL isGateway = FALSE; +/* + * ROUTINES ___________________________________________________________________ + * + */ + +BOOL CALLBACK Binding_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) +{ + switch (msg) + { + case WM_INITDIALOG: + Binding_OnInitDialog (hDlg); + break; + + case WM_CTLCOLORSTATIC: + if ((HWND)lp == GetDlgItem (hDlg, IDC_CHUNK_SIZE)) + { + if (IsWindowEnabled ((HWND)lp)) + { + static HBRUSH hbrStatic = CreateSolidBrush (GetSysColor (COLOR_WINDOW)); + SetTextColor ((HDC)wp, GetSysColor (COLOR_WINDOWTEXT)); + SetBkColor ((HDC)wp, GetSysColor (COLOR_WINDOW)); + return (BOOL)hbrStatic; + } + } + break; + + case WM_COMMAND: + switch (LOWORD(wp)) + { + case IDHELP: + Binding_DlgProc (hDlg, WM_HELP, 0, 0); + break; + + case IDOK: + Binding_OnOK(hDlg); + break; + + case IDCANCEL: + Binding_OnCancel(hDlg); + break; + case IDC_DEFAULTNIC: + if (HIWORD(wp) == BN_CLICKED) + { + TCHAR name[MAX_PATH]; + memset(name, 0, sizeof(name)); + if (IsDlgButtonChecked(hDlg,IDC_DEFAULTNIC)) + nLanAdapter=-1; + else + { + HWND hwndCombo = GetDlgItem(hDlg, IDC_NICSELECTION); + if (SendMessage(hwndCombo, CB_GETCURSEL, 0, 0) == CB_ERR) + SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM)0, (LPARAM)0); + + TCHAR selected[MAX_PATH]; + memset(selected, 0, sizeof(selected)); + SendDlgItemMessage(hDlg, IDC_NICSELECTION, + WM_GETTEXT, sizeof(selected), + (LPARAM) selected); + + if (_tcslen(selected) <= 0) + + nLanAdapter = -1; + else + nLanAdapter = GetAdapterNumber(selected); + } + + lana_GetAfsNameString(nLanAdapter, isGateway, name); + SetDlgItemText (hDlg, IDC_BINDING_MESSAGE, name); + EnableWindow(GetDlgItem(hDlg,IDC_NICSELECTION),(nLanAdapter!=-1)); + break; + } + case IDC_NICSELECTION: + if (HIWORD(wp) == CBN_SELCHANGE) + { + TCHAR name[MAX_PATH]; + TCHAR selected[MAX_PATH]; + memset(name, 0, sizeof(name)); + memset(selected, 0, sizeof(selected)); + HWND hwndCombo = GetDlgItem(hDlg, IDC_NICSELECTION); + int i = SendMessage(hwndCombo, CB_GETCURSEL, 0, 0); + if (i != CB_ERR) + SendMessage(hwndCombo, CB_GETLBTEXT, (WPARAM)i, + (LPARAM) selected); + + if (_tcslen(selected) <= 0) + nLanAdapter = -1; + else + nLanAdapter = GetAdapterNumber(selected); + + + lana_GetAfsNameString(nLanAdapter, isGateway, name); + SetDlgItemText (hDlg, IDC_BINDING_MESSAGE, name); + break; + } + + } + break; + + case WM_HELP: + WinHelp (hDlg, g.szHelpFile, HELP_CONTEXT, IDH_AFSCONFIG_ADVANCED_MISC); + break; + } + + return FALSE; +} + + +void Binding_OnInitDialog (HWND hDlg) +{ + TCHAR name[MAX_PATH]; + memset(name, 0, sizeof(name)); + + if (fFirstTime) { + Config_GetLanAdapter(&g.Configuration.nLanAdapter); + nLanAdapter = g.Configuration.nLanAdapter; + isGateway = g.Configuration.fBeGateway; + fFirstTime = FALSE; + } + + lanainfo = lana_FindLanaByName(NULL); + + // TODO: Show more useful error message. + if (!lanainfo) { + MessageBox(hDlg, "Unable to obtain LANA list", "LANA ERROR", MB_ICONERROR); + } + else + { + HWND hwndCombo = GetDlgItem(hDlg, IDC_NICSELECTION); + int index = 0; + TCHAR tmp[MAX_PATH]; + while (_tcslen(lanainfo[index].lana_name) > 0) + { + _stprintf(tmp, "%s (lana number = %d)", lanainfo[index].lana_name, + lanainfo[index].lana_number); + SendMessage(hwndCombo, CB_ADDSTRING, + 0, (LPARAM) tmp); + if (nLanAdapter == lanainfo[index].lana_number) + SendMessage(hwndCombo, CB_SELECTSTRING, (WPARAM)-1, + (LPARAM)tmp); + index++; + } + } + + lana_GetAfsNameString(nLanAdapter, isGateway, name); + SetDlgItemText (hDlg, IDC_BINDING_MESSAGE, name); + + CheckDlgButton (hDlg, IDC_DEFAULTNIC, (nLanAdapter==-1)); + + EnableWindow(GetDlgItem(hDlg,IDC_NICSELECTION),(nLanAdapter!=-1)); +} + +void Binding_OnOK (HWND hDlg) +{ + if (IsDlgButtonChecked(hDlg,IDC_DEFAULTNIC)) + nLanAdapter = -1; + else + { + TCHAR selected[MAX_PATH]; + memset(selected, 0, sizeof(selected)); + SendDlgItemMessage(hDlg, IDC_NICSELECTION, + WM_GETTEXT, sizeof(selected), + (LPARAM) selected); + + if (_tcslen(selected) <= 0) + { + MessageBox(hDlg, "Please select the NIC to bind to", "Error", MB_ICONERROR); + return; + } + + nLanAdapter = GetAdapterNumber(selected); + + } + + EndDialog(hDlg, IDOK); +} + + +BOOL Binding_OnApply() +{ + if (fFirstTime) + return TRUE; + + if (nLanAdapter != g.Configuration.nLanAdapter) { + if (!Config_SetLanAdapter (nLanAdapter)) + return FALSE; + g.Configuration.nLanAdapter = nLanAdapter; + } + + return TRUE; + + +} + +void Binding_OnCancel(HWND hDlg) +{ + fFirstTime = TRUE; + + if (lanainfo) + { + delete lanainfo; + lanainfo = NULL; + } + + EndDialog(hDlg, IDCANCEL); +} + + +int GetAdapterNumber(TCHAR* n) +{ + int index = 0; + while (_tcslen(lanainfo[index].lana_name) > 0) + { + if (_tcsncmp(lanainfo[index].lana_name, n, _tcslen(lanainfo[index].lana_name)) == 0) + { + return lanainfo[index].lana_number; + } + index++; + } + + return -1; + +} diff --git a/src/WINNT/client_config/dlg_misc.cpp b/src/WINNT/client_config/dlg_misc.cpp index a1d87595d..9fafc0f82 100644 --- a/src/WINNT/client_config/dlg_misc.cpp +++ b/src/WINNT/client_config/dlg_misc.cpp @@ -35,7 +35,9 @@ extern "C" { // Our dialog data BOOL fFirstTime = TRUE; +#if undef DWORD nLanAdapter; +#endif DWORD csecProbe; DWORD nThreads; DWORD nDaemons; @@ -95,6 +97,7 @@ BOOL CALLBACK Misc_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) case IDCANCEL: Misc_OnCancel(hDlg); break; +#if undef case IDC_AUTOLANA: if (IsDlgButtonChecked(hDlg,IDC_AUTOLANA)) nLanAdapter=-1; @@ -102,6 +105,7 @@ BOOL CALLBACK Misc_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) nLanAdapter=0; SP_SetPos (GetDlgItem (hDlg, IDC_LAN_ADAPTER),nLanAdapter); EnableWindow(GetDlgItem(hDlg,IDC_LAN_ADAPTER),(nLanAdapter!=-1)); +#endif } break; @@ -117,7 +121,9 @@ BOOL CALLBACK Misc_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) void Misc_OnInitDialog (HWND hDlg) { if (fFirstTime) { +#if undef Config_GetLanAdapter(&g.Configuration.nLanAdapter); +#endif Config_GetProbeInt (&g.Configuration.csecProbe); Config_GetNumThreads (&g.Configuration.nThreads); Config_GetNumDaemons (&g.Configuration.nDaemons); @@ -125,7 +131,9 @@ void Misc_OnInitDialog (HWND hDlg) Config_GetRootVolume (g.Configuration.szRootVolume); Config_GetMountRoot (g.Configuration.szMountDir); +#if undef nLanAdapter = g.Configuration.nLanAdapter; +#endif csecProbe = g.Configuration.csecProbe; nThreads = g.Configuration.nThreads; nDaemons = g.Configuration.nDaemons; @@ -136,7 +144,9 @@ void Misc_OnInitDialog (HWND hDlg) fFirstTime = FALSE; } +#if undef CreateSpinner (GetDlgItem (hDlg, IDC_LAN_ADAPTER), 99, FALSE, nLANA_MIN, nLanAdapter, nLANA_MAX); +#endif CreateSpinner (GetDlgItem (hDlg, IDC_PROBE), 10, FALSE, csecPROBE_MIN, csecProbe, csecPROBE_MAX); CreateSpinner (GetDlgItem (hDlg, IDC_THREADS), 10, FALSE, cTHREADS_MIN, nThreads, cTHREADS_MAX); CreateSpinner (GetDlgItem (hDlg, IDC_DAEMONS), 10, FALSE, cDAEMONS_MIN, nDaemons, cDAEMONS_MAX); @@ -144,15 +154,18 @@ void Misc_OnInitDialog (HWND hDlg) SetDlgItemText (hDlg, IDC_SYSNAME, szSysName); SetDlgItemText (hDlg, IDC_ROOTVOLUME, szRootVolume); SetDlgItemText (hDlg, IDC_MOUNTDIR, szMountDir); +#if undef CheckDlgButton (hDlg, IDC_AUTOLANA, (nLanAdapter==-1)); EnableWindow(GetDlgItem(hDlg,IDC_LAN_ADAPTER),(nLanAdapter!=-1)); +#endif } void Misc_OnOK (HWND hDlg) { +#if undef nLanAdapter = (IsDlgButtonChecked(hDlg,IDC_AUTOLANA))?-1 :SP_GetPos (GetDlgItem (hDlg, IDC_LAN_ADAPTER)); - +#endif csecProbe = SP_GetPos (GetDlgItem (hDlg, IDC_PROBE)); nThreads = SP_GetPos (GetDlgItem (hDlg, IDC_THREADS)); @@ -172,11 +185,13 @@ BOOL Misc_OnApply() if (fFirstTime) return TRUE; +#if undef if (nLanAdapter != g.Configuration.nLanAdapter) { if (!Config_SetLanAdapter (nLanAdapter)) return FALSE; g.Configuration.nLanAdapter = nLanAdapter; } +#endif if (csecProbe != g.Configuration.csecProbe) { if (!Config_SetProbeInt (csecProbe)) diff --git a/src/WINNT/client_config/drivemap.cpp b/src/WINNT/client_config/drivemap.cpp index db61e2731..e5afd9ed2 100644 --- a/src/WINNT/client_config/drivemap.cpp +++ b/src/WINNT/client_config/drivemap.cpp @@ -11,15 +11,21 @@ extern "C" { #include #include #include +#include } #include #include #include #include +#undef REALLOC #include "drivemap.h" #include #include +#define DEBUG_VERBOSE #include +#include + +extern void Config_GetLanAdapter (ULONG *pnLanAdapter); /* * REGISTRY ___________________________________________________________________ @@ -40,6 +46,7 @@ const TCHAR sAFSConfigKeyName[] = TEXT("SYSTEM\\CurrentControlSet\\Services\\Tra static TCHAR cszINIFILE[] = TEXT("afsdsbmt.ini"); static TCHAR cszSECTION_SUBMOUNTS[] = TEXT("AFS Submounts"); static TCHAR cszSECTION_MAPPINGS[] = TEXT("AFS Mappings"); +static TCHAR cszSECTION_ACTIVE[] = TEXT("AFS Active"); static TCHAR cszAUTOSUBMOUNT[] = TEXT("Auto"); static TCHAR cszLANMANDEVICE[] = TEXT("\\Device\\LanmanRedirector\\"); @@ -148,7 +155,8 @@ static BOOL IsWindowsNT (void) return fIsWinNT; } - +/* Check if the OS is Windows 2000 or higher. +*/ BOOL IsWindows2000 (void) { static BOOL fChecked = FALSE; @@ -180,45 +188,12 @@ BOOL IsWindows2000 (void) void GetClientNetbiosName (LPTSTR pszName) { - *pszName = TEXT('\0'); - - if (IsWindowsNT()) - { - HKEY hk; - if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("System\\CurrentControlSet\\Control\\ComputerName\\ComputerName"), &hk) == 0) - { - DWORD dwSize = MAX_PATH; - DWORD dwType = REG_SZ; - RegQueryValueEx (hk, TEXT("ComputerName"), NULL, &dwType, (PBYTE)pszName, &dwSize); - } - } - else // (!IsWindowsNT()) - { - HKEY hk; - if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("System\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"), &hk) == 0) - { - DWORD dwSize = MAX_PATH; - DWORD dwType = REG_SZ; - RegQueryValueEx (hk, TEXT("Gateway"), NULL, &dwType, (PBYTE)pszName, &dwSize); - } - } - - // Shorten the server name from its FQDN - // - for (LPTSTR pch = pszName; *pch; ++pch) - { - if (*pch == TEXT('.')) - { - *(LPTSTR)pch = TEXT('\0'); - break; - } - } + static TCHAR szNetbiosName[32] = ""; - // Form NetBIOS name from client's (possibly truncated) simple host name. - if (*pszName != TEXT('\0')) { - pszName[11] = TEXT('\0'); - lstrcat(pszName, TEXT("-AFS")); - } + if ( szNetbiosName[0] == 0 ) { + lana_GetNetbiosName(szNetbiosName, LANA_NETBIOS_NAME_FULL); + } + _tcscpy(pszName, szNetbiosName); } @@ -233,7 +208,7 @@ BOOL SubmountToPath (PDRIVEMAPLIST pList, LPTSTR pszPath, LPTSTR pszSubmount, BO // if (!lstrcmpi (pszSubmount, TEXT("all"))) { - lstrcpy (pszPath, TEXT("/afs")); + lstrcpy (pszPath, cm_slash_mount_root); return TRUE; } @@ -420,6 +395,31 @@ void QueryDriveMapList_ReadMappings (PDRIVEMAPLIST pList) FreeStringMemory (mszLHS); } +BOOL ForceMapActive (TCHAR chDrive) +{ + TCHAR szDrive[2]; + TCHAR szActive[32]; + + szDrive[0] = chDrive; + szDrive[1] = 0; + + GetPrivateProfileString (cszSECTION_ACTIVE, szDrive, TEXT("0"), szActive, sizeof(szActive), cszINIFILE); + + if ( !lstrcmp(szActive,"1") || !lstrcmpi(szActive,"true") || !lstrcmpi(szActive,"on") || !lstrcmpi(szActive,"yes") ) + return TRUE; + return FALSE; +} + + +void WriteActiveMap (TCHAR chDrive, BOOL on) +{ + TCHAR szDrive[2]; + + szDrive[0] = chDrive; + szDrive[1] = 0; + + WritePrivateProfileString (cszSECTION_ACTIVE, szDrive, on ? "1" : "0", cszINIFILE); +} void QueryDriveMapList_WriteMappings (PDRIVEMAPLIST pList) { @@ -587,8 +587,11 @@ BOOL PathToSubmount (LPTSTR pszSubmount, LPTSTR pszMapping, LPTSTR pszSubmountRe IOInfo.out = (char *)OutData; IOInfo.out_size = PIOCTL_MAXSIZE; - ULONG status; - if ((status = pioctl (0, VIOC_MAKESUBMOUNT, &IOInfo, 1)) != 0) + ULONG status = pioctl (0, VIOC_MAKESUBMOUNT, &IOInfo, 1); + if (pStatus) + *pStatus = status; + + if (status) return FALSE; lstrcpy (pszSubmount, (LPCTSTR)OutData); @@ -600,8 +603,8 @@ BOOL ActivateDriveMap (TCHAR chDrive, LPTSTR pszMapping, LPTSTR pszSubmountReq, { // We can only map drives to places in AFS using this function. // - if ( (lstrncmpi (pszMapping, TEXT("/afs"), lstrlen(TEXT("/afs")))) && - (lstrncmpi (pszMapping, TEXT("\\afs"), lstrlen(TEXT("\\afs")))) ) + if ( (lstrncmpi (pszMapping, cm_slash_mount_root, lstrlen(cm_slash_mount_root))) && + (lstrncmpi (pszMapping, cm_back_slash_mount_root, lstrlen(cm_back_slash_mount_root))) ) { if (pdwStatus) *pdwStatus = ERROR_BAD_NETPATH; @@ -621,27 +624,7 @@ BOOL ActivateDriveMap (TCHAR chDrive, LPTSTR pszMapping, LPTSTR pszSubmountReq, } // We now have a submount name and drive letter--map the network drive. - // - TCHAR szClient[ MAX_PATH ]; - GetClientNetbiosName (szClient); - - TCHAR szLocal[ MAX_PATH ] = TEXT("*:"); - szLocal[0] = chDrive; - - TCHAR szRemote[ MAX_PATH ]; - wsprintf (szRemote, TEXT("\\\\%s\\%s"), szClient, szSubmount); - - NETRESOURCE Resource; - memset (&Resource, 0x00, sizeof(NETRESOURCE)); - Resource.dwScope = RESOURCE_GLOBALNET; - Resource.dwType = RESOURCETYPE_DISK; - Resource.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE; - Resource.dwUsage = RESOURCEUSAGE_CONNECTABLE; - Resource.lpLocalName = szLocal; - Resource.lpRemoteName = szRemote; - - // DWORD rc = WNetAddConnection2 (&Resource, NULL, NULL, ((fPersistent) ? CONNECT_UPDATE_PROFILE : 0)); - DWORD rc=MountDOSDrive(chDrive,szSubmount,fPersistent); + DWORD rc=MountDOSDrive(chDrive,szSubmount,fPersistent,NULL); if (rc == NO_ERROR) return TRUE; @@ -681,21 +664,21 @@ void RemoveSubMount (LPTSTR pszSubmount) void AdjustAfsPath (LPTSTR pszTarget, LPCTSTR pszSource, BOOL fWantAFS, BOOL fWantForwardSlashes) { - if (!*pszSource) - lstrcpy (pszTarget, (fWantAFS) ? TEXT("/afs") : TEXT("")); - else if ((*pszSource != TEXT('/')) && (*pszSource != TEXT('\\'))) - wsprintf (pszTarget, TEXT("/afs/%s"), pszSource); - // We don't want to strip afs off the start if it is part of something for example afscell.company.com - else if (fWantAFS && (lstrncmpi (&pszSource[1], TEXT("afs"), 3)) || !((pszSource[4] == TEXT('/')) || - (pszSource[4] == TEXT('\\')) || - (lstrlen(pszSource) == 4))) - wsprintf (pszTarget, TEXT("/afs%s"), pszSource); - else if (!fWantAFS && (!lstrncmpi (&pszSource[1], TEXT("afs"), 3) && ((pszSource[4] == TEXT('/')) || - (pszSource[4] == TEXT('\\')) || - (lstrlen(pszSource) == 4)))) - lstrcpy (pszTarget, &pszSource[4]); - else - lstrcpy (pszTarget, pszSource); + if (!*pszSource) + lstrcpy (pszTarget, (fWantAFS) ? cm_slash_mount_root : TEXT("")); + else if ((*pszSource != TEXT('/')) && (*pszSource != TEXT('\\'))) + wsprintf (pszTarget, TEXT("%s/%s"),cm_slash_mount_root, pszSource); + // We don't want to strip afs off the start if it is part of something for example afscell.company.com + else if (fWantAFS && (lstrncmpi (&pszSource[1], cm_mount_root, strlen(cm_mount_root))) || !((pszSource[strlen(cm_slash_mount_root)] == TEXT('/')) || + (pszSource[strlen(cm_slash_mount_root)] == TEXT('\\')) || + (lstrlen(pszSource) == strlen(cm_slash_mount_root)))) + wsprintf (pszTarget, TEXT("%s%s"),cm_slash_mount_root, pszSource); + else if (!fWantAFS && (!lstrncmpi (&pszSource[1], cm_mount_root, strlen(cm_mount_root)) && ((pszSource[strlen(cm_slash_mount_root)] == TEXT('/')) || + (pszSource[strlen(cm_slash_mount_root)] == TEXT('\\')) || + (lstrlen(pszSource) == strlen(cm_slash_mount_root))))) + lstrcpy (pszTarget, &pszSource[strlen(cm_slash_mount_root)]); + else + lstrcpy (pszTarget, pszSource); for (LPTSTR pch = pszTarget; *pch; ++pch) { @@ -717,33 +700,48 @@ void AdjustAfsPath (LPTSTR pszTarget, LPCTSTR pszSource, BOOL fWantAFS, BOOL fWa } } - BOOL GetDriveSubmount (TCHAR chDrive, LPTSTR pszSubmountNow) { - TCHAR szDrive[] = TEXT("*:"); - szDrive[0] = chDrive; + BOOL isWinNT = IsWindowsNT(); - TCHAR szMapping[ MAX_PATH ] = TEXT(""); - LPTSTR pszSubmount = szMapping; + TCHAR szDrive[] = TEXT("*:"); + szDrive[0] = chDrive; - if (IsWindowsNT()) - { - QueryDosDevice (szDrive, szMapping, MAX_PATH); + TCHAR szMapping[ _MAX_PATH ] = TEXT(""); + if (isWinNT && !QueryDosDevice (szDrive, szMapping, MAX_PATH)) + return FALSE; + + LPTSTR pszSubmount = szMapping; + + TCHAR szNetBiosName[32]; + memset(szNetBiosName, '\0', sizeof(szNetBiosName)); + GetClientNetbiosName(szNetBiosName); + _tcscat(szNetBiosName, TEXT("\\")); + + if (isWinNT) + { // Now if this is an AFS network drive mapping, {szMapping} will be: // - // \Device\LanmanRedirector\Q:\machine-afs\submount + // \Device\LanmanRedirector\:\\submount // // on Windows NT. On Windows 2000, it will be: // - // \Device\LanmanRedirector\;Q:0\machine-afs\submount + // \Device\LanmanRedirector\;:0\\submount // // (This is presumably to support multiple drive mappings with // Terminal Server). // - if (lstrncmpi (szMapping, cszLANMANDEVICE, lstrlen(cszLANMANDEVICE))) + // on Windows XP and 2003, it will be : + // \Device\LanmanRedirector\;:\\submount + // + // where : : DOS drive letter + // : Authentication ID, 16 char hex. + // : Netbios name of server + // + if (_tcsnicmp(szMapping, cszLANMANDEVICE, _tcslen(cszLANMANDEVICE))) return FALSE; - pszSubmount = &szMapping[ lstrlen(cszLANMANDEVICE) ]; + pszSubmount = &szMapping[ _tcslen(cszLANMANDEVICE) ]; if (IsWindows2000()) { @@ -758,9 +756,12 @@ BOOL GetDriveSubmount (TCHAR chDrive, LPTSTR pszSubmountNow) if (*(++pszSubmount) != TEXT(':')) return FALSE; +#ifdef COMMENT + // No longer a safe assumption on XP if (IsWindows2000()) if (*(++pszSubmount) != TEXT('0')) return FALSE; +#endif // scan for next "\" while (*(++pszSubmount) != TEXT('\\')) @@ -768,12 +769,15 @@ BOOL GetDriveSubmount (TCHAR chDrive, LPTSTR pszSubmountNow) if (*pszSubmount==0) return FALSE; } + + // note that szNetBiosName has a '\\' tagged in the end earlier for (++pszSubmount; *pszSubmount && (*pszSubmount != TEXT('\\')); ++pszSubmount) - if (!lstrncmpi (pszSubmount, TEXT("-afs\\"), lstrlen(TEXT("-afs\\")))) + if (!_tcsncicmp(pszSubmount, szNetBiosName, _tcslen(szNetBiosName))) break; if ((!*pszSubmount) || (*pszSubmount == TEXT('\\'))) return FALSE; - pszSubmount += lstrlen("-afs\\"); + + pszSubmount += _tcslen(szNetBiosName); } else // (!IsWindowsNT()) { @@ -785,11 +789,11 @@ BOOL GetDriveSubmount (TCHAR chDrive, LPTSTR pszSubmountNow) if (*(pszSubmount++) != TEXT('\\')) return FALSE; for ( ; *pszSubmount && (*pszSubmount != TEXT('\\')); ++pszSubmount) - if (!lstrncmpi (pszSubmount, TEXT("-afs\\"), lstrlen(TEXT("-afs\\")))) + if (!lstrncmpi (pszSubmount, szNetBiosName, lstrlen(szNetBiosName))) break; if ((!*pszSubmount) || (*pszSubmount == TEXT('\\'))) return FALSE; - pszSubmount += lstrlen("-afs\\"); + pszSubmount += lstrlen(szNetBiosName); } if (!pszSubmount || !*pszSubmount) @@ -801,7 +805,7 @@ BOOL GetDriveSubmount (TCHAR chDrive, LPTSTR pszSubmountNow) /* Generate Random User name random acording to time*/ DWORD dwOldState=0; -TCHAR pUserName[MAXRANDOMNAMELEN]; +TCHAR pUserName[MAXRANDOMNAMELEN]=TEXT(""); BOOL fUserName=FALSE; #define AFSLogonOptionName TEXT("System\\CurrentControlSet\\Services\\TransarcAFSDaemon\\NetworkProvider") @@ -912,19 +916,22 @@ void TestAndDoUnMapShare() void DoUnMapShare(BOOL drivemap) //disconnect drivemap { - TCHAR szMachine[ MAX_PATH],szPath[MAX_PATH]; + TCHAR szMachine[MAX_PATH],szPath[MAX_PATH]; DWORD rc=28; HANDLE hEnum; LPNETRESOURCE lpnrLocal,lpnr=NULL; DWORD res; DWORD cbBuffer=16384; DWORD cEntries=-1; - GetComputerName(szMachine,&rc); CHAR *pSubmount=""; + + memset(szMachine, '\0', sizeof(szMachine)); + GetClientNetbiosName(szMachine); + // Initialize the data structure if ((res=WNetOpenEnum(RESOURCE_CONNECTED,RESOURCETYPE_DISK,RESOURCEUSAGE_CONNECTABLE,lpnr,&hEnum))!=NO_ERROR) return; - sprintf(szPath,"\\\\%s-afs\\",szMachine); + sprintf(szPath,"\\\\%s\\",szMachine); _strlwr(szPath); lpnrLocal=(LPNETRESOURCE) GlobalAlloc(GPTR,cbBuffer); do { @@ -937,13 +944,14 @@ void DoUnMapShare(BOOL drivemap) //disconnect drivemap { if ((lpnrLocal[i].lpLocalName) && (strlen(lpnrLocal[i].lpLocalName)>0)) { - if (drivemap) + if (drivemap) { DisMountDOSDrive(*lpnrLocal[i].lpLocalName); - //WNetCancelConnection(lpnrLocal[i].lpLocalName,TRUE); - } else + DEBUG_EVENT1("AFS DriveUnMap","UnMap-Local=%x",res); + } + } else { DisMountDOSDriveFull(lpnrLocal[i].lpRemoteName); - //WNetCancelConnection(lpnrLocal[i].lpRemoteName,TRUE); - DEBUG_EVENT1("AFS DriveUnMap","UnMap-Remote=%x",res); + DEBUG_EVENT1("AFS DriveUnMap","UnMap-Remote=%x",res); + } } } } @@ -960,11 +968,13 @@ BOOL DoMapShareChange() HANDLE hEnum; LPNETRESOURCE lpnrLocal,lpnr=NULL; DWORD res; - DWORD cbBuffer=16384; DWORD cEntries=-1; - GetComputerName(szMachine,&rc); - CHAR szUser[MAXRANDOMNAMELEN]; - // Initialize the data structure + DWORD cbBuffer=16384; + + memset(szMachine, '\0', sizeof(szMachine)); + GetClientNetbiosName(szMachine); + + // Initialize the data structure if (!IsServiceActive()) return TRUE; memset (&List, 0x00, sizeof(DRIVEMAPLIST)); @@ -974,7 +984,7 @@ BOOL DoMapShareChange() if ((res=WNetOpenEnum(RESOURCE_CONNECTED,RESOURCETYPE_DISK,RESOURCEUSAGE_CONNECTABLE,lpnr,&hEnum))!=NO_ERROR) return FALSE; lpnrLocal=(LPNETRESOURCE) GlobalAlloc(GPTR,cbBuffer); - sprintf(szPath,"\\\\%s-afs\\",szMachine); + sprintf(szPath,"\\\\%s\\",szMachine); _strlwr(szPath); do { memset(lpnrLocal,0,cbBuffer); @@ -985,13 +995,13 @@ BOOL DoMapShareChange() if (strstr(_strlwr(lpnrLocal[i].lpRemoteName),szPath)==NULL) continue; //only look at real afs mappings CHAR * pSubmount=strrchr(lpnrLocal[i].lpRemoteName,'\\')+1; - if (strcmpi(pSubmount,"all")==0) + if (lstrcmpi(pSubmount,"all")==0) continue; // do not remove 'all' for (DWORD j=0;j -#ifndef APSTUDIO_INVOKED -#define AFS_VERINFO_FILE_DESCRIPTION "AFS ¿Í»§»úÅäÖÃ" +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#ifndef APSTUDIO_INVOKED +#define AFS_VERINFO_FILE_DESCRIPTION "AFS ¿Í»§»úÅäÖÃ" #define AFS_VERINFO_NAME "afs_config" #define AFS_VERINFO_FILENAME "afs_config.exe" #define AFS_VERINFO_LANG_CODE 0x804 #define AFS_VERINFO_CHARSET 936 -#include "AFS_component_version_number.h" -#include "..\..\config\NTVersioninfo.rc" -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Chinese (P.R.C.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) -#ifdef _WIN32 -LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_GENERAL_NT DIALOG DISCARDABLE 0, 0, 220, 225 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ò»°ã" -FONT 9, "ËÎÌå" -BEGIN - GROUPBOX "¿Í»§»úÅäÖÃ",IDC_STATIC,7,7,206,142 - LTEXT "µ¥ÔªÃû(&C)£º",IDC_STATIC,13,23,44,8 - EDITTEXT IDC_CELL,62,22,114,13,ES_LOWERCASE | ES_AUTOHSCROLL - CONTROL "µÇ¼µ½ Windows ʱ»ñµÃ AFS ÁîÅÆ",IDC_LOGON,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,13,50,193,10 - CONTROL "Ìṩ AFS Light Íø¹Ø(&P)",IDC_GATEWAY,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,13,72,193,10 - CONTROL "ÔÚÈÎÎñÀ¸ÖÐÏÔʾ AFS ¿Í»§»úͼ±ê(&I)",IDC_TRAYICON,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,13,95,193,10 - LTEXT "×¢Ò⣺ÓÉÓÚûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£", - IDC_WARN,13,124,193,17 - GROUPBOX "¿Í»§»ú״̬",IDC_STATIC,7,157,206,61 - LTEXT "(²éѯµ±Ç°×´Ì¬)",IDC_STATUS,13,172,193,17 - PUSHBUTTON "Æô¶¯·þÎñ(&S)",IDC_SERVICE_START,88,195,57,14 - PUSHBUTTON "Í£Ö¹·þÎñ(&T)",IDC_SERVICE_STOP,149,195,57,14 -END - -IDD_GENERAL_95 DIALOG DISCARDABLE 0, 0, 245, 145 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ò»°ã" -FONT 9, "ËÎÌå" -BEGIN - GROUPBOX "¿Í»§»úÅäÖÃ",IDC_STATIC,7,7,231,131 - LTEXT "Íø¹Ø(&G)£º",IDC_STATIC,13,28,45,8 - EDITTEXT IDC_GATEWAY,63,27,104,13,ES_AUTOHSCROLL - PUSHBUTTON "ÏÖÔÚÁ¬½Ó(&N)",IDC_GATEWAY_CONN,172,27,57,14 - LTEXT "µ¥ÔªÃû(&C)£º",IDC_STATIC,13,51,45,8 - EDITTEXT IDC_CELL,63,49,104,13,ES_LOWERCASE | ES_AUTOHSCROLL | - WS_DISABLED | NOT WS_TABSTOP - CONTROL "µÇ¼µ½ Windows ʱ»ñµÃ AFS ÁîÅÆ",IDC_LOGON,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,13,73,193,10 - CONTROL "ÔÚÈÎÎñÀ¸ÖÐÏÔʾ AFS Light ͼ±ê(&H)",IDC_TRAYICON,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,13,93,193,10 - LTEXT "×¢Ò⣺ÓÉÓÚ AFS ¿Í»§»úûÓÐÁ¬½ÓÖÁ AFS Íø¹Ø£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£", - IDC_WARN,13,114,219,17 -END - -IDD_PREFS_NT DIALOG DISCARDABLE 0, 0, 220, 225 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ê×Ñ¡Ïî" -FONT 9, "ËÎÌå" -BEGIN - GROUPBOX "·þÎñÆ÷Ê×Ñ¡Ïî",-1,7,7,206,211 - CONTROL "ÏÔʾÎļþ·þÎñÆ÷Ê×Ñ¡Ïî(&F)",IDC_SHOW_FS,"Button", - BS_AUTORADIOBUTTON,13,21,193,10 - CONTROL "ÏÔʾ¾íλÖ÷þÎñÆ÷Ê×Ñ¡Ïî(&V)",IDC_SHOW_VLS,"Button", - BS_AUTORADIOBUTTON,13,34,193,10 - CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0xb,13, - 49,173,120 - PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,84,172,50,14 - PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,137,172,50,14 - PUSHBUTTON "^",IDC_UP,191,97,15,14,BS_ICON - PUSHBUTTON "v",IDC_DOWN,191,117,15,14,BS_ICON - PUSHBUTTON "µ¼Èë(&I)...",IDC_IMPORT,13,172,50,14 - LTEXT "×¢Ò⣺ÓÉÓÚûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£", - IDC_WARN,13,193,193,17 -END - -IDD_HOSTS_NT DIALOG DISCARDABLE 0, 0, 220, 225 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS µ¥Ôª" -FONT 9, "ËÎÌå" -BEGIN - GROUPBOX "AFS µ¥Ôª",IDC_STATIC,7,7,206,211 - CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x11b,13, - 21,193,168 - PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,51,195,50,14 - PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,104,195,50,14 - PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,157,195,50,14 -END - -IDD_DRIVES_NT DIALOG DISCARDABLE 0, 0, 220, 225 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "ÅÌ·û" -FONT 9, "ËÎÌå" -BEGIN - GROUPBOX "ÅÌ·û",IDC_STATIC,7,7,206,211 - CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_TABSTOP | 0x153, - 13,32,193,135 - PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,69,171,48,14 - PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,120,171,42,14 - PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,165,171,42,14 - LTEXT "½«ÅÌ·ûÓ³ÉäÖÁ AFS ÖеÄ·¾¶£º",IDC_STATIC,13,21,193,8 - PUSHBUTTON "¸ß¼¶(&V)...",IDC_ADVANCED,13,171,53,14 - LTEXT "×¢Ò⣺ÓÉÓÚûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£", - IDC_WARN,13,193,193,17 -END - -IDD_ADVANCED_NT DIALOG DISCARDABLE 0, 0, 220, 225 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "¸ß¼¶" -FONT 9, "ËÎÌå" -BEGIN - EDITTEXT IDC_CACHE_SIZE,88,21,32,13,ES_AUTOHSCROLL - EDITTEXT IDC_CACHE_PATH,88,41,83,13,ES_AUTOHSCROLL - EDITTEXT IDC_CHUNK_SIZE,88,62,32,13,ES_AUTOHSCROLL | ES_READONLY - EDITTEXT IDC_STAT_ENTRIES,88,83,32,13,ES_AUTOHSCROLL - PUSHBUTTON "µÇ¼(&L)...",IDC_LOGON_PARMS,13,128,68,14 - PUSHBUTTON "È«¾ÖÇý¶¯Æ÷(&G)...",IDC_AUTOMAP_PARMS,13,173,68,14 - PUSHBUTTON "ÔÓÏî(&M)...",IDC_MISC_PARMS,13,195,68,14 - GROUPBOX "¸ßËÙ»º´æÅäÖÃ",IDC_STATIC,7,7,206,100 - LTEXT "¸ßËÙ»º´æ´óС(&C)£º",IDC_STATIC,13,23,71,8 - LTEXT "KB",IDC_INUSE,136,23,68,8 - LTEXT "¿é´óС(&H)£º",IDC_STATIC,13,64,71,8 - LTEXT "KB",IDC_STATIC,136,64,68,8 - LTEXT "״̬¸ßËÙ»º´æ(&S)£º",IDC_STATIC,13,85,71,8 - LTEXT "ÌõÄ¿",IDC_STATIC,136,85,68,8 - LTEXT "¸ßËÙ»º´æÂ·¾¶(&P)£º",IDC_STATIC,13,44,71,8 - GROUPBOX "¸½¼Ó¸ß¼¶²ÎÊý",IDC_STATIC,7,114,206,104 - LTEXT "´´½¨È«¾Ö AFS Çý¶¯Æ÷Ó³Éä¡£",IDC_STATIC,86,176,120,10 - LTEXT "µ÷Õû¼¯³ÉµÇ¼ÉèÖá£",IDC_STATIC,86,132,120,10 - LTEXT "ÉèÖÃÆäËü¸ß¼¶²ÎÊý¡£",IDC_STATIC,86,199,120,10 - PUSHBUTTON "Õï¶Ï(&D)...",IDC_DIAG_PARMS,13,150,68,14 - LTEXT "ÆôÓÃÎÊÌâµ÷ÊÔÉèÖá£",IDC_STATIC,86,153,120,10 -END - -IDD_PREFS_EDIT DIALOG DISCARDABLE 0, 0, 251, 123 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ö¸¶¨·þÎñÆ÷µÄÓÅÏȼ¶" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "¿ÉΪ´Ë AFS µ¥ÔªÖеķþÎñÆ÷Ö¸¶¨ÓÅÏȼ¶ÅÅÐò¡£µ±²éÕÒ AFS ÖеÄÊý¾Ýʱ£¬½«Ê×ÏȲéѯÓÅÏȼ¶½Ï¸ßµÄ·þÎñÆ÷¡£", - IDC_STATIC,7,7,237,17 - LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,7,38,51,8 - LTEXT "ÅÅÐò(&R)£º",IDC_STATIC,7,54,51,8 - EDITTEXT IDC_SERVER,63,36,80,13,ES_AUTOHSCROLL - EDITTEXT IDC_RANK,63,52,36,13,ES_AUTOHSCROLL - LTEXT "ÇÏÃÅ£ºÔÚʹÓá°µ¼È롱°´Å¥ÒÔ¶ÁÈ¡Îı¾ÎļþÖ¸¶¨µÄ·þÎñÆ÷ºÍËüÃǵÄÅÅÐòʱ£¬¿Éͬʱָ¶¨¼¸¸ö·þÎñÆ÷µÄÅÅÐò¡£", - IDC_STATIC,7,76,237,18 - PUSHBUTTON "È¡Ïû",IDCANCEL,140,102,50,14 - PUSHBUTTON "È·¶¨",IDOK,86,102,50,14 - PUSHBUTTON "°ïÖú",9,194,102,50,14 -END - -IDD_CELL_EDIT DIALOG DISCARDABLE 0, 0, 244, 223 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "µ¥ÔªÌØÐÔ" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "´ËÒ³ÃæÉϵÄÐÅÏ¢½«¸æËß AFS ÈçºÎÁªÏµÖ¸¶¨µÄµ¥Ôª¡£", - IDC_STATIC,4,4,226,8 - LTEXT "AFS µ¥Ôª(&A)£º",IDC_STATIC,4,24,58,8 - EDITTEXT IDC_CELL,62,22,105,13,ES_LOWERCASE | ES_AUTOHSCROLL - LTEXT "ÃèÊö(&D)£º",IDC_STATIC,4,41,38,8 - EDITTEXT IDC_COMMENT,62,39,171,13,ES_AUTOHSCROLL - GROUPBOX "·þÎñÆ÷",IDC_STATIC,4,61,236,158 - CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x1b,13, - 76,217,117 - PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,75,198,50,14 - PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,128,198,50,14 - PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,181,198,50,14 -END - -IDD_SERVER_EDIT DIALOG DISCARDABLE 0, 0, 251, 112 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ìí¼Ó£¯±à¼­·þÎñÆ÷" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "ÔÚÖ¸¶¨µ¥ÔªÖÐÊäÈë¾íλÖ÷þÎñÆ÷µÄÃû³Æ¡£",IDC_STATIC,7,7, - 237,8 - LTEXT "·þÎñÆ÷Ãû(&N)£º",IDC_STATIC,7,31,53,8 - EDITTEXT IDC_COMMENT,75,29,156,13,ES_AUTOHSCROLL - LTEXT "·þÎñÆ÷µØÖ·(&A)£º",IDC_STATIC,7,52,64,8 - CONTROL "ʹÓÃÌØ¶¨µØÖ·(&U)£º",IDC_ADDR_SPECIFIC,"Button", - BS_AUTORADIOBUTTON,75,52,83,10 - CONTROL "×Ô¶¯²éÕÒµØÖ·(&L)",IDC_ADDR_LOOKUP,"Button", - BS_AUTORADIOBUTTON,75,66,111,10 - CONTROL "",IDC_SERVER,"SockAddr",WS_BORDER | WS_TABSTOP,163,51, - 65,13 - PUSHBUTTON "È¡Ïû",IDCANCEL,140,91,50,14 - PUSHBUTTON "È·¶¨",IDOK,86,91,50,14 - PUSHBUTTON "°ïÖú",9,194,91,50,14 -END - -IDD_DRIVE_EDIT DIALOG DISCARDABLE 0, 0, 297, 156 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ó³ÉäÅÌ·û" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "¿ÉÓ³É伯Ëã»úÉϵÄÅÌ·ûÖÁ AFS ÖеÄ·¾¶¡£",IDC_STATIC,7,7, - 283,8 - LTEXT "ÀýÈ磬Èç¹ûÓ³ÉäÇý¶¯Æ÷ Q ÖÁ /afs/acme.com/usr/bob£¬Ôò AFS µÄ /afs/acme.com/usr/bob/* ÖеĿÉÓÃÎļþ½«ÔÚÄú¼ÆËã»úµÄ Q:\\ Ŀ¼Ï¿ɼû¡£", - IDC_STATIC,7,26,283,16 - LTEXT "ÅÌ·û(&D)£º",IDC_STATIC,14,59,58,8 - COMBOBOX IDC_DRIVE,77,57,63,206,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,14,77,58,8 - EDITTEXT IDC_PATH,77,75,168,13,ES_AUTOHSCROLL - LTEXT "ÃèÊö(&E)£º",IDC_STATIC,14,96,58,8 - EDITTEXT IDC_DESC,77,94,72,13,ES_AUTOHSCROLL - CONTROL "µÇ¼ʱ»Ö¸´Ó³Éä(&R)",IDC_PERSISTENT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,77,112,188,10 - PUSHBUTTON "È¡Ïû",IDCANCEL,186,135,50,14 - PUSHBUTTON "È·¶¨",IDOK,132,135,50,14 - PUSHBUTTON "°ïÖú",9,240,135,50,14 -END - -IDD_SUBMOUNTS DIALOG DISCARDABLE 0, 0, 244, 198 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "×Ó°²×°" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "ÄúµÄ¼ÆËã»ú¿ÉÌṩ AFS ÖеÄ×Ó°²×°--ÍøÂç¹²Ïí¡£",IDC_STATIC, - 4,4,196,8 - GROUPBOX "×Ó°²×°",IDC_STATIC,4,26,236,168 - LTEXT "ÏÂÁÐ×Ó°²×°´Ó´Ë¼ÆËã»úÉϹ²Ïí£º",IDC_STATIC,10,42,176,8 - CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x413,10, - 54,223,115 - PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,78,173,50,14 - PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,131,173,50,14 - PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,184,173,50,14 -END - -IDD_SUBMOUNT_EDIT DIALOG DISCARDABLE 0, 0, 270, 112 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ö¸¶¨×Ó°²×°" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "ʹÓà Windows ÍøÂ磬×Ó°²×°ÈÃÄú¹²ÏíÒ»¸ö×ÓĿ¼Ê÷¡£", - IDC_STATIC,7,7,256,8 - LTEXT "×Ó°²×°(&S)£º",IDC_STATIC,7,27,53,8 - LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,7,43,53,8 - EDITTEXT IDC_SUBMOUNT,63,25,80,13,ES_AUTOHSCROLL - EDITTEXT IDC_MAPPING,63,41,181,13,ES_AUTOHSCROLL - LTEXT "Ϊ×Ó°²×°ÊäÈë¶ÌÃû£¬²¢ÇÒµ±³öÏÖÌáʾʱÊäÈëÒ»¸öÈ« AFS ·¾¶¡£AFS ·¾¶¿ÉÒÔ""\\afs""¿ªÊ¼(Èç¹û²»ÊÇ£¬""\\afs""½«×Ô¶¯Ìí¼Ó)¡£", - IDC_STATIC,7,64,256,18 - PUSHBUTTON "È¡Ïû",IDCANCEL,159,91,50,14 - PUSHBUTTON "È·¶¨",IDOK,105,91,50,14 - PUSHBUTTON "°ïÖú",9,213,91,50,14 -END - -IDD_DRIVES_95 DIALOG DISCARDABLE 0, 0, 245, 145 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "ÅÌ·û" -FONT 9, "ËÎÌå" -BEGIN - GROUPBOX "ÅÌ·û",IDC_STATIC,7,7,231,131 - CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_TABSTOP | 0x153, - 13,32,219,60 - PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,83,95,48,14 - PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,134,95,48,14 - PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,184,95,48,14 - LTEXT "½«ÅÌ·ûÓ³ÉäÖÁ AFS ÖеÄ·¾¶£º",IDC_STATIC,13,21,193,8 - LTEXT "×¢Ò⣺ÓÉÓÚ AFS ¿Í»§»úûÓÐÁ¬½ÓÖÁ AFS Íø¹Ø£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£", - IDC_WARN,13,116,219,17 -END - -IDD_HOSTS_95 DIALOG DISCARDABLE 0, 0, 245, 145 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS µ¥Ôª" -FONT 9, "ËÎÌå" -BEGIN - GROUPBOX "AFS µ¥Ôª",IDC_STATIC,7,7,231,131 - CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x11b,13, - 19,218,94 - PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,75,116,50,14 - PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,128,116,50,14 - PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,181,116,50,14 -END - -IDD_STARTSTOP DIALOGEX 0, 0, 219, 48 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "AFS ¿Í»§»ú·þÎñ" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - GROUPBOX "",IDC_STATIC,4,0,211,44 - ICON IDI_MAIN,IDC_STATIC,14,15,20,20 - LTEXT "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÆô¶¯...",IDC_STARTING,46,20, - 157,8 - LTEXT "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÍ£Ö¹...",IDC_STOPPING,46,20, - 157,8 -END - -IDD_HOSTS_CCENTER DIALOG DISCARDABLE 0, 0, 220, 256 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ò»°ã" -FONT 9, "ËÎÌå" -BEGIN - GROUPBOX "ȱʡµ¥Ôª",IDC_STATIC,7,7,206,54 - LTEXT "ÊäÈëÒª¹ÜÀíµÄȱʡ AFS µ¥ÔªÃû£º",IDC_STATIC,14,19,164,8 - LTEXT "ȱʡµ¥Ôª£º",IDC_STATIC,14,37,44,8 - EDITTEXT IDC_CELL,65,35,141,14,ES_LOWERCASE | ES_AUTOHSCROLL - GROUPBOX "AFS µ¥Ôª",IDC_STATIC,7,69,206,180 - CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x11b,13, - 84,193,137 - PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,51,227,50,14 - PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,104,227,50,14 - PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,157,227,50,14 -END - -IDD_MISC_CONFIG_PARMS DIALOG DISCARDABLE 0, 0, 220, 193 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "ÔÓÏîÅäÖÃ" -FONT 8, "System" -BEGIN - EDITTEXT IDC_LAN_ADAPTER,90,20,32,13,ES_AUTOHSCROLL - EDITTEXT IDC_PROBE,90,40,32,13,ES_AUTOHSCROLL - EDITTEXT IDC_THREADS,90,60,32,13,ES_AUTOHSCROLL - EDITTEXT IDC_DAEMONS,90,80,32,13,ES_AUTOHSCROLL - EDITTEXT IDC_SYSNAME,90,100,83,13,ES_AUTOHSCROLL - EDITTEXT IDC_MOUNTDIR,90,120,83,13,ES_AUTOHSCROLL - EDITTEXT IDC_ROOTVOLUME,90,140,83,13,ES_AUTOHSCROLL - DEFPUSHBUTTON "È·¶¨",IDOK,55,172,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,109,172,50,14 - PUSHBUTTON "°ïÖú",9,163,172,50,14 - GROUPBOX "²ÎÊý",IDC_STATIC,7,7,206,156 - LTEXT "¼ì²â¼ä¸ô(&P)£º",IDC_STATIC,15,42,71,8 - LTEXT "Ãë",IDC_STATIC,138,42,68,8 - LTEXT "ºǫ́Ïß³Ì(&B)£º",IDC_STATIC,15,62,71,8 - LTEXT "Ïß³Ì",IDC_STATIC,138,62,68,8 - LTEXT "·þÎñÏß³Ì(&E)£º",IDC_STATIC,15,82,71,8 - LTEXT "Ïß³Ì",IDC_STATIC,138,82,68,8 - LTEXT "ϵͳÃû³Æ(&Y)£º",IDC_STATIC,15,102,71,8 - LTEXT "°²×°Ä¿Â¼(&M)£º",IDC_STATIC,15,122,71,8 - LTEXT "LAN ÊÊÅäÆ÷ºÅ(&L)£º",IDC_STATIC,15,22,71,8 - LTEXT "¸ù¾í(&R)£º",IDC_STATIC,15,141,71,8 -END - -IDD_DIAG_PARMS DIALOG DISCARDABLE 0, 0, 217, 135 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Õï¶ÏÅäÖÃ" -FONT 8, "System" -BEGIN - EDITTEXT IDC_TRACE_LOG_BUF_SIZE,112,20,32,13,ES_AUTOHSCROLL - DEFPUSHBUTTON "È·¶¨",IDOK,52,114,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,106,114,50,14 - PUSHBUTTON "°ïÖú",9,160,114,50,14 - GROUPBOX "¸ú×ÙÈÕÖ¾²ÎÊý",IDC_STATIC,7,7,203,54 - LTEXT "»º³åÇø´óС(&B)£º",IDC_STATIC,13,22,73,8 - LTEXT "KB",IDC_STATIC,155,24,9,8 - GROUPBOX "ʼþÈÕÖ¾²ÎÊý",IDC_STATIC,7,69,203,35 - COMBOBOX IDC_TRAP_ON_PANIC,112,40,32,61,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "½ô¼±Çé¿öϵ÷ÓÃÏÝÚå(&T)£º",IDC_STATIC,13,42,93,8 - LTEXT "±¨¸æ»á»°Æô¶¯£º",IDC_STATIC,13,86,79,8 - COMBOBOX IDC_REPORT_SESSION_STARTUPS,112,84,32,64, - CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP -END - -IDD_LOGIN_CONFIG_PARMS DIALOG DISCARDABLE 0, 0, 186, 92 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "µÇ¼ÅäÖÃ" -FONT 8, "System" -BEGIN - EDITTEXT IDC_LOGIN_RETRY_INTERVAL,117,18,32,13,ES_AUTOHSCROLL - COMBOBOX IDC_FAIL_SILENTLY,117,39,32,40,CBS_DROPDOWNLIST | - CBS_SORT | WS_VSCROLL | WS_TABSTOP - DEFPUSHBUTTON "È·¶¨",IDOK,21,71,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,75,71,50,14 - PUSHBUTTON "°ïÖú",9,129,71,50,14 - LTEXT "µÇÂ¼ÖØÊÔ¼ä¸ô(&L)£º",IDC_STATIC,13,20,98,8 - GROUPBOX "²ÎÊý",IDC_STATIC,7,7,172,54 - LTEXT "µÇ¼ʧ°Ü£¬ÎÞÈκÎÌáʾ(&F)£º",IDC_STATIC,13,41,98,8 -END - -IDD_GLOBAL_DRIVES DIALOG DISCARDABLE 0, 0, 253, 169 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "È«¾ÖÇý¶¯Æ÷" -FONT 8, "System" -BEGIN - DEFPUSHBUTTON "¹Ø±Õ",IDOK,141,148,50,14 - PUSHBUTTON "°ïÖú",9,196,148,50,14 - PUSHBUTTON "Ìí¼Ó(&A)",IDC_ADD,108,117,42,14 - GROUPBOX "È«¾ÖÓ³Éä AFS Çý¶¯Æ÷",IDC_STATIC,7,7,239,133 - CONTROL "",IDC_GLOBAL_DRIVE_LIST,"FastList",WS_BORDER | - WS_TABSTOP | 0x1b,14,20,226,89 - PUSHBUTTON "¸ü¸Ä(&C)",IDC_CHANGE,153,117,42,14 - PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,198,117,42,14 -END - -IDD_GLOBAL_DRIVES_ADDEDIT DIALOG DISCARDABLE 0, 0, 247, 118 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ó³ÉäÈ«¾ÖÇý¶¯Æ÷" -FONT 8, "System" -BEGIN - COMBOBOX IDC_DRIVE,63,23,63,206,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - EDITTEXT IDC_PATH,63,42,168,13,ES_AUTOHSCROLL - EDITTEXT IDC_DESC,63,62,72,13,ES_AUTOHSCROLL - DEFPUSHBUTTON "È·¶¨",IDOK,82,96,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,136,96,50,14 - PUSHBUTTON "°ïÖú",9,190,96,50,14 - LTEXT "ÅÌ·û(&D)£º",IDC_STATIC,12,25,48,8 - LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,12,44,48,8 - LTEXT "ÃèÊö(&E)£º",IDC_STATIC,12,64,48,8 - GROUPBOX "È«¾Ö AFS Çý¶¯Æ÷",IDC_STATIC,7,7,232,80 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_GENERAL_NT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 213 - TOPMARGIN, 7 - BOTTOMMARGIN, 218 - END - - IDD_GENERAL_95, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 238 - TOPMARGIN, 7 - BOTTOMMARGIN, 138 - END - - IDD_PREFS_NT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 213 - TOPMARGIN, 7 - BOTTOMMARGIN, 218 - END - - IDD_HOSTS_NT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 213 - TOPMARGIN, 7 - BOTTOMMARGIN, 218 - END - - IDD_DRIVES_NT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 213 - TOPMARGIN, 7 - BOTTOMMARGIN, 218 - END - - IDD_ADVANCED_NT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 213 - TOPMARGIN, 7 - BOTTOMMARGIN, 218 - END - - IDD_PREFS_EDIT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 244 - TOPMARGIN, 7 - BOTTOMMARGIN, 116 - END - - IDD_CELL_EDIT, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 240 - TOPMARGIN, 4 - BOTTOMMARGIN, 219 - END - - IDD_SERVER_EDIT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 244 - TOPMARGIN, 7 - BOTTOMMARGIN, 105 - END - - IDD_DRIVE_EDIT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 290 - TOPMARGIN, 7 - BOTTOMMARGIN, 149 - END - - IDD_SUBMOUNTS, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 240 - TOPMARGIN, 4 - BOTTOMMARGIN, 194 - END - - IDD_SUBMOUNT_EDIT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 263 - TOPMARGIN, 7 - BOTTOMMARGIN, 105 - END - - IDD_DRIVES_95, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 238 - TOPMARGIN, 7 - BOTTOMMARGIN, 138 - END - - IDD_HOSTS_95, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 238 - TOPMARGIN, 7 - BOTTOMMARGIN, 138 - END - - IDD_STARTSTOP, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 215 - TOPMARGIN, 4 - BOTTOMMARGIN, 44 - END - - IDD_HOSTS_CCENTER, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 213 - TOPMARGIN, 7 - BOTTOMMARGIN, 249 - END - - IDD_MISC_CONFIG_PARMS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 213 - TOPMARGIN, 7 - BOTTOMMARGIN, 186 - END - - IDD_DIAG_PARMS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 210 - TOPMARGIN, 7 - BOTTOMMARGIN, 128 - END - - IDD_LOGIN_CONFIG_PARMS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 179 - TOPMARGIN, 7 - BOTTOMMARGIN, 85 - END - - IDD_GLOBAL_DRIVES, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 246 - TOPMARGIN, 7 - BOTTOMMARGIN, 162 - END -END -#endif // APSTUDIO_INVOKED - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#ifndef APSTUDIO_INVOKED\r\n" - "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ¿Í»§»úÅäÖÃ""\r\n" - "#include ""AFS_component_version_number.h""\r\n" - "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" - "#endif // APSTUDIO_INVOKED\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "afs_config.ico" -IDI_UP ICON DISCARDABLE "up.ico" -IDI_DOWN ICON DISCARDABLE "down.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_TITLE_NT "AFS ¿Í»§»úÅäÖÃ" - IDS_TITLE_95 "AFS Light ÅäÖÃ" - IDS_STATE_STOPPED "AFS ¿Í»§»ú·þÎñµ±Ç°ÎªÍ£Ö¹×´Ì¬¡£" - IDS_STATE_RUNNING "AFS ¿Í»§»ú·þÎñÕýÔÚÕý³£ÔËÐС£" - IDS_STATE_STARTING "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÆô¶¯..." - IDS_STATE_STOPPING "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÍ£Ö¹..." - IDS_STATE_UNKNOWN "AFS ¿Í»§»ú·þÎñûÓÐÊʵ±ÅäÖá£" - IDS_SERVICE_FAIL_START "AFS ¿Í»§»ú·þÎñ²»Äܳɹ¦Æô¶¯¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£" - IDS_SERVICE_FAIL_STOP "AFS ¿Í»§»ú·þÎñ²»Äܳɹ¦Í£Ö¹¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£" - IDS_WARN_STOPPED "ÓÉÓÚ AFS ¿Í»§»ú·þÎñûÓÐÔËÐУ¬²»Äܸü¸Ä½ûÓõĿØÖÆ¡£" - IDS_WARN_ADMIN "ÓÉÓÚÄúûÓÐÒÔ¹ÜÀíÔ±Éí·ÝµÇ¼ÖÁ Windows£¬²»Äܸü¸Ä½ûÓõĿØÖÆ¡£" - IDS_CELL_UNKNOWN "(δ֪)" - IDS_GATEWAY_UNKNOWN "(δ֪)" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_BADLOOKUP_DESC "Windows ÕÒ²»µ½ %1 µÄÍøÂçµØÖ·¡£¼ì²éÒÔÈ·±£ÊäÈëÁËÕýÈ·µÄ»úÆ÷Ãû¡£" - IDS_NEWSUB_DESC "µ±Á¬½ÓÍøÂçÇý¶¯Æ÷ʱ£¬AFS ÎÞ·¨Ê¹ÓÃÖ¸¶¨µÄÃèÊö¡£\n\nÖ¸¶¨µÄÃèÊöÒÑʹÓÃÔÚ²»Í¬µÄ AFS ·¾¶ÖС£" - IDS_BADSUB_DESC "²»ÄÜʹÓÃÄúÊäÈëµÄÅÌ·ûÃèÊö¡£\n\nÅÌ·ûÃèÊö²»Äܳ¬¹ý 12 ¸ö×Ö·û£¬²¢ÇÒ²»Äܰüº¬¿Õ¸ñ»òÖÆ±í·û¡£" - IDS_BADGATEWAY_DESC "AFS ÎÞ·¨Á¬½ÓÖÁÄúÖ¸¶¨µÄÍø¹Ø»úÆ÷¡£\n\n¼ì²éÒÔÈ·±£ÊäÈëÁíÍâÕýÈ·µÄÍø¹ØÉ豸Ãû³Æ¡£" - IDS_BADGWCELL_DESC "ÕÒ²»µ½Ö¸¶¨µÄÍø¹Ø»úÆ÷ʹÓÃµÄ AFS µ¥ÔªµÄÅäÖÃÐÅÏ¢¡£\n\nÈç¹ûÄúÒªÔÚеĵ¥ÔªÖÐÅäÖà AFS ¿Í»§»ú£¬±ØÐëʹÓá°AFS µ¥Ôª¡±±êÇ©ÒÔÌí¼Ó¸Ãе¥ÔªµÄÅäÖÃÐÅÏ¢¡£\n\nµ¥Ôª£º%1" - IDS_TITLE_CAUTION_NT "×¢Òâ - AFS ¿Í»§»úÅäÖÃ" - IDS_TITLE_CAUTION_95 "×¢Òâ - AFS Light" - IDS_TITLE_ERROR_NT "³ö´í - AFS ¿Í»§»úÅäÖÃ" - IDS_TITLE_ERROR_95 "³ö´í - AFS Light ÅäÖÃ" - IDS_SHRINKCACHE "µ± AFS ¿Í»§»ú·þÎñÕýÔÚÔËÐÐʱ²»ÄܼõÉÙ AFS ¿Í»§»ú¸ßËÙ»º´æµÄ´óС¡£\n\nÒª¼õÉÙ¸ßËÙ»º´æµÄ´óС£¬Ê×ÏÈÔÚ¡°Ò»°ã¡±±êÇ©ÉÏʹÓá°Í£Ö¹·þÎñ¡±°´Å¥Í£Ö¹ AFS ¿Í»§»ú·þÎñ¡£" - IDS_BADCELL_DESC_CC "ÔÚÄúÊäÈëµÄ AFS µ¥ÔªÖÐÕÒ²»µ½ÅäÖÃÐÅÏ¢¡£\n\n+" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_STOP_DESC "Èç¹ûÍ£Ö¹ AFS ¿Í»§»ú·þÎñ£¬´æ´¢ÔÚ AFS ÖеÄÎļþ½«²»¿É´Ó´Ë¼ÆËã»úÖдæÈ¡¡£\n\nÈ·ÈÏҪֹͣ·þÎñÂð?" - IDS_PREFCOL_SERVER "·þÎñÆ÷" - IDS_PREFCOL_RANK "ÅÅÐò" - IDS_TIP_PREFS "ÇÏÃÅ£ºµ±´Ó AFS ¶ÁÈ¡Îļþʱ£¬µÍÅÅÐòÊýµÄ·þÎñÆ÷½«»ñµÃ¸ßÓÅÏȼ¶¡£" - IDS_PREFERROR_RESOLVE "AFS ÕÒ²»µ½ÃûΪ %1 µÄ·þÎñÆ÷¡£Çë¼ì²éÒÔÈ·±£ÊäÈëÕýÈ·µÄ·þÎñÆ÷¡£" - IDS_FILTER_TXT "Îı¾Îļþ(*.TXT)£»*.TXT£»" - IDS_HOSTREM_MANY "ÄúÒÑÑ¡Ôñ³ýÈ¥ÓйØÑ¡¶¨µÄ AFS µ¥ÔªµÄËùÓÐÁ¬½ÓÐÅÏ¢¡£\n\nÈ·ÈÏÒª³ýÈ¥ÕâЩÌõÄ¿Âð?" - IDS_HOSTREM_ONE "ÄúÒÑÑ¡Ôñ³ýÈ¥ÓÐ¹Ø AFS µ¥Ôª %1 µÄËùÓÐÁ¬½ÓÐÅÏ¢¡£\n\nÈ·ÈÏÒª³ýÈ¥ÕâЩÌõÄ¿Âð?" - IDS_CELLEDIT_TITLE "%1 - ÌØÐÔ" - IDS_CELLADD_TITLE "н¨µ¥Ôª" - IDS_SVRCOL_SERVER "µØÖ·" - IDS_SVRCOL_COMMENT "·þÎñÆ÷Ãû" - IDS_TIP_DRIVES "ÇÏÃÅ£ºÑ¡ÖÐÓ³ÉäÅÌ·ûÅԵĸ´Ñ¡¿ò£¬Á¬½ÓÍøÂçÇý¶¯Æ÷Ó³Éä¡£" - IDS_MAP_LETTER "Çý¶¯Æ÷ *:" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_DRIVE_MAP "Çý¶¯Æ÷ %1: \t%2" - IDS_ERROR_MAP "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í" - IDS_ERROR_MAP_DESC "AFS ÎÞ·¨Ó³ÉäÍøÂçÇý¶¯Æ÷ÖÁ AFS ÖеÄ·¾¶¡£¼ì²éÒÔÈ·±£ÅÌ·ûµ±Ç°Ã»ÓÐʹÓá£\n\n´íÎó£º0x%1¡£" - IDS_ERROR_UNMAP "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í" - IDS_ERROR_UNMAP_DESC "AFS ÎÞ·¨¶Ï¿ªÓëÖ¸¶¨ÍøÂçÇý¶¯Æ÷µÄÓ³Éä¡£¼ì²éÒÔÈ·±£ÅÌ·ûµ±Ç°Ã»ÓÐʹÓá£\n\n´íÎó£º0x%1¡£" - IDS_ADDSERVER_TITLE "Ìí¼Ó·þÎñÆ÷" - IDS_EDITSERVER_TITLE "±à¼­·þÎñÆ÷" - IDS_SUBCOL_SHARE "×Ó°²×°" - IDS_SUBCOL_PATH "AFS ·¾¶" - IDS_SUBMOUNTS_TITLE "×Ó°²×°" - IDS_BADCELL_DESC "ÔÚÄúÊäÈëµÄ AFS µ¥ÔªÖÐÕÒ²»µ½ÅäÖÃÐÅÏ¢¡£\n\n+" - IDS_BADCELL_DESC2 "¼ì²éÒÔÈ·±£ÄúÕýÈ·ÊäÈëÁ˵¥ÔªµÄÃû³Æ¡£Èç¹ûÄúÒªÔÚеĵ¥ÔªÖÐÅäÖà AFS ¿Í»§»ú£¬Äú±ØÐëʹÓá°AFS µ¥Ôª¡±±êÇ©ÒÔÌí¼Ó¸Ãе¥ÔªµÄÅäÖÃÐÅÏ¢¡£" - IDS_KB_IN_USE "KB (%1 KB ÕýÔÚʹÓÃ)" - IDS_NOGATEWAY_TITLE "ÎÞЧ AFS Íø¹Ø" - IDS_NOGATEWAY_DESC "ÓÉÓÚÄúûÓÐÖ¸¶¨ AFS Íø¹Ø£¬²»ÄÜÅäÖà AFS Light¡£\n\nÇëÔÚÌṩµÄÇøÓòÖÐÊäÈë AFS Íø¹ØµÄÃû³Æ»ò IP µØÖ·¡£" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_NOCELL_DESC "ÓÉÓÚÄúûÓÐÖ¸¶¨ AFS µ¥Ôª£¬²»ÄÜÅäÖà AFS ¿Í»§»ú¡£\n\nÇëÔÚÌṩµÄÇøÓòÖÐÊäÈë AFS µ¥ÔªµÄÃû³Æ¡£" - IDS_STOPPED_NOCELL "ÔÚÆô¶¯ AFS ¿Í»§»ú·þÎñ֮ǰ£¬±ØÐëÖ¸¶¨ AFS µ¥Ôª¡£" - IDS_OKSTOP_DESC "ûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ¡£ÔÚûÓÐÆô¶¯ AFS ¿Í»§»ú·þÎñ֮ǰ£¬´æ´¢ÔÚ AFS ÖеÄÎļþ½«²»¿É´æÈ¡¡£\n\nÏÖÔÚÆô¶¯·þÎñÂð? " - IDS_BADMAP_DESC "ÓÉÓÚ·¾¶Ã»ÓÐÒÔ""\\afs""¿ªÊ¼£¬AFS ²»ÄÜÓ³ÉäÅÌ·ûÖÁÖ¸¶¨µÄ·¾¶¡£\n\nÈ·±£ÄúËùÊäÈëµÄ·¾¶ÊÇÒÔ""\\afs""¿ªÊ¼µÄ£¬²¢ÖØÊÔÒ»´Î¡£" - IDS_RESTART_TITLE "AFS ¿Í»§»úÅäÖÃ" - IDS_RESTART_DESC "ÔÚ AFS ¿Í»§»ú·þÎñÍ£Ö¹²¢ÖØÐÂÆô¶¯Ö®Ç°£¬ÄúËù×öµÄһЩ¸ü¸Ä½«²»»áÉúЧ¡£\n\nÏÖÔÚÍ£Ö¹²¢ÖØÐÂÆô¶¯·þÎñÂð? " - IDS_KB_ONLY "KB" - IDS_FAILCONFIG_AUTHENT "µ±ÔڵǼʱ³¢ÊÔÆôÓûò½ûÓÃÈÏ֤ʱ³ö´í¡£\n\n´íÎó %1" - IDS_FAILCONFIG_PREFS "ÄúÖ¸¶¨µÄһЩ·þÎñÆ÷ÅÅÐòÓÅÏȼ¶²»ÄÜʹÓá£\n\n´íÎó %1" - IDS_FAILCONFIG_CACHE "²»ÄÜʹÓÃÄúÊäÈëµÄ AFS ¿Í»§»ú¸ßËÙ»º´æ´óС¡£\n\n´íÎó %1" - IDS_FAILCONFIG_PROBE "²»ÄÜʹÓÃÄúÊäÈëµÄ AFS ¿Í»§»ú¼ì²â¼ä¸ô¡£\n\n´íÎó %1" - IDS_FAILCONFIG_SYSNAME "²»ÄÜʹÓÃÄúÊäÈëµÄ AFS ¿Í»§»úϵͳÃû¡£\n\n´íÎó %1" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_BADCELL_DESC_CC2 "Çë¼ì²éµ¥ÔªÃûÈ·±£ÄúÒÑÊäÈëÕýÈ·¡£Èç¹ûÔÚ AFS µ¥ÔªÁбíÖÐûÓгöÏÖÕýÈ·µÄµ¥ÔªÃû£¬ÇëʹÓá°Ìí¼Ó¡±°´Å¥Îª¸Ãµ¥Ôª´´½¨Ò»¸öÌõÄ¿¡£" - IDS_NOCELL_DESC_CC "²»ÄÜÅäÖà AFS ¿ØÖÆÖÐÐÄ£¬ÒòΪÄú»¹Ã»ÓÐÖ¸¶¨È±Ê¡µÄ AFS µ¥Ôª¡£\n\nÇëÔÚÌṩµÄÇøÓòÖÐÊäÈë AFS µ¥ÔªÃû¡£" - IDS_TITLE_CAUTION_CCENTER "×¢Òâ - AFS ¿ØÖÆÖÐÐÄÌØÐÔ" - IDS_TITLE_ERROR_CCENTER "³ö´í - AFS ¿ØÖÆÖÐÐÄÌØÐÔ" - IDS_TITLE_CCENTER "AFS ¿ØÖÆÖÐÐÄÌØÐÔ" - IDS_YES "ÊÇ" - IDS_NO "·ñ" - IDS_DRIVE "Çý¶¯Æ÷" -END - -#endif // Chinese (P.R.C.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +#include "AFS_component_version_number.h" +#include "..\..\config\NTVersioninfo.rc" +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Chinese (P.R.C.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +#ifdef _WIN32 +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_GENERAL_NT DIALOG DISCARDABLE 0, 0, 220, 225 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ò»°ã" +FONT 9, "ËÎÌå" +BEGIN + GROUPBOX "¿Í»§»úÅäÖÃ",IDC_STATIC,7,7,206,142 + LTEXT "µ¥ÔªÃû(&C)£º",IDC_STATIC,13,23,44,8 + EDITTEXT IDC_CELL,62,22,114,13,ES_LOWERCASE | ES_AUTOHSCROLL + CONTROL "µÇ¼µ½ Windows ʱ»ñµÃ AFS ÁîÅÆ",IDC_LOGON,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,50,193,10 + CONTROL "Ìṩ AFS Light Íø¹Ø(&P)",IDC_GATEWAY,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,72,193,10 + CONTROL "ÔÚÈÎÎñÀ¸ÖÐÏÔʾ AFS ¿Í»§»úͼ±ê(&I)",IDC_TRAYICON,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,95,193,10 + LTEXT "×¢Ò⣺ÓÉÓÚûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£", + IDC_WARN,13,124,193,17 + GROUPBOX "¿Í»§»ú״̬",IDC_STATIC,7,157,206,61 + LTEXT "(²éѯµ±Ç°×´Ì¬)",IDC_STATUS,13,172,193,17 + PUSHBUTTON "Æô¶¯·þÎñ(&S)",IDC_SERVICE_START,88,195,57,14 + PUSHBUTTON "Í£Ö¹·þÎñ(&T)",IDC_SERVICE_STOP,149,195,57,14 +END + +IDD_GENERAL_95 DIALOG DISCARDABLE 0, 0, 245, 145 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ò»°ã" +FONT 9, "ËÎÌå" +BEGIN + GROUPBOX "¿Í»§»úÅäÖÃ",IDC_STATIC,7,7,231,131 + LTEXT "Íø¹Ø(&G)£º",IDC_STATIC,13,28,45,8 + EDITTEXT IDC_GATEWAY,63,27,104,13,ES_AUTOHSCROLL + PUSHBUTTON "ÏÖÔÚÁ¬½Ó(&N)",IDC_GATEWAY_CONN,172,27,57,14 + LTEXT "µ¥ÔªÃû(&C)£º",IDC_STATIC,13,51,45,8 + EDITTEXT IDC_CELL,63,49,104,13,ES_LOWERCASE | ES_AUTOHSCROLL | + WS_DISABLED | NOT WS_TABSTOP + CONTROL "µÇ¼µ½ Windows ʱ»ñµÃ AFS ÁîÅÆ",IDC_LOGON,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,73,193,10 + CONTROL "ÔÚÈÎÎñÀ¸ÖÐÏÔʾ AFS Light ͼ±ê(&H)",IDC_TRAYICON,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,93,193,10 + LTEXT "×¢Ò⣺ÓÉÓÚ AFS ¿Í»§»úûÓÐÁ¬½ÓÖÁ AFS Íø¹Ø£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£", + IDC_WARN,13,114,219,17 +END + +IDD_PREFS_NT DIALOG DISCARDABLE 0, 0, 220, 225 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ê×Ñ¡Ïî" +FONT 9, "ËÎÌå" +BEGIN + GROUPBOX "·þÎñÆ÷Ê×Ñ¡Ïî",-1,7,7,206,211 + CONTROL "ÏÔʾÎļþ·þÎñÆ÷Ê×Ñ¡Ïî(&F)",IDC_SHOW_FS,"Button", + BS_AUTORADIOBUTTON,13,21,193,10 + CONTROL "ÏÔʾ¾íλÖ÷þÎñÆ÷Ê×Ñ¡Ïî(&V)",IDC_SHOW_VLS,"Button", + BS_AUTORADIOBUTTON,13,34,193,10 + CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0xb,13, + 49,173,120 + PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,84,172,50,14 + PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,137,172,50,14 + PUSHBUTTON "^",IDC_UP,191,97,15,14,BS_ICON + PUSHBUTTON "v",IDC_DOWN,191,117,15,14,BS_ICON + PUSHBUTTON "µ¼Èë(&I)...",IDC_IMPORT,13,172,50,14 + LTEXT "×¢Ò⣺ÓÉÓÚûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£", + IDC_WARN,13,193,193,17 +END + +IDD_HOSTS_NT DIALOG DISCARDABLE 0, 0, 220, 225 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS µ¥Ôª" +FONT 9, "ËÎÌå" +BEGIN + GROUPBOX "AFS µ¥Ôª",IDC_STATIC,7,7,206,211 + CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x11b,13, + 21,193,168 + PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,51,195,50,14 + PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,104,195,50,14 + PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,157,195,50,14 +END + +IDD_DRIVES_NT DIALOG DISCARDABLE 0, 0, 220, 225 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ÅÌ·û" +FONT 9, "ËÎÌå" +BEGIN + GROUPBOX "ÅÌ·û",IDC_STATIC,7,7,206,211 + CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_TABSTOP | 0x153, + 13,32,193,135 + PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,69,171,48,14 + PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,120,171,42,14 + PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,165,171,42,14 + LTEXT "½«ÅÌ·ûÓ³ÉäÖÁ AFS ÖеÄ·¾¶£º",IDC_STATIC,13,21,193,8 + PUSHBUTTON "¸ß¼¶(&V)...",IDC_ADVANCED,13,171,53,14 + LTEXT "×¢Ò⣺ÓÉÓÚûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£", + IDC_WARN,13,193,193,17 +END + +IDD_ADVANCED_NT DIALOG DISCARDABLE 0, 0, 220, 225 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "¸ß¼¶" +FONT 9, "ËÎÌå" +BEGIN + EDITTEXT IDC_CACHE_SIZE,88,21,32,13,ES_AUTOHSCROLL + EDITTEXT IDC_CACHE_PATH,88,41,83,13,ES_AUTOHSCROLL + EDITTEXT IDC_CHUNK_SIZE,88,62,32,13,ES_AUTOHSCROLL | ES_READONLY + EDITTEXT IDC_STAT_ENTRIES,88,83,32,13,ES_AUTOHSCROLL + PUSHBUTTON "µÇ¼(&L)...",IDC_LOGON_PARMS,13,128,68,14 + PUSHBUTTON "È«¾ÖÇý¶¯Æ÷(&G)...",IDC_AUTOMAP_PARMS,13,173,68,14 + PUSHBUTTON "ÔÓÏî(&M)...",IDC_MISC_PARMS,13,195,68,14 + GROUPBOX "¸ßËÙ»º´æÅäÖÃ",IDC_STATIC,7,7,206,100 + LTEXT "¸ßËÙ»º´æ´óС(&C)£º",IDC_STATIC,13,23,71,8 + LTEXT "KB",IDC_INUSE,136,23,68,8 + LTEXT "¿é´óС(&H)£º",IDC_STATIC,13,64,71,8 + LTEXT "KB",IDC_STATIC,136,64,68,8 + LTEXT "״̬¸ßËÙ»º´æ(&S)£º",IDC_STATIC,13,85,71,8 + LTEXT "ÌõÄ¿",IDC_STATIC,136,85,68,8 + LTEXT "¸ßËÙ»º´æÂ·¾¶(&P)£º",IDC_STATIC,13,44,71,8 + GROUPBOX "¸½¼Ó¸ß¼¶²ÎÊý",IDC_STATIC,7,114,206,104 + LTEXT "´´½¨È«¾Ö AFS Çý¶¯Æ÷Ó³Éä¡£",IDC_STATIC,86,176,120,10 + LTEXT "µ÷Õû¼¯³ÉµÇ¼ÉèÖá£",IDC_STATIC,86,132,120,10 + LTEXT "ÉèÖÃÆäËü¸ß¼¶²ÎÊý¡£",IDC_STATIC,86,199,120,10 + PUSHBUTTON "Õï¶Ï(&D)...",IDC_DIAG_PARMS,13,150,68,14 + LTEXT "ÆôÓÃÎÊÌâµ÷ÊÔÉèÖá£",IDC_STATIC,86,153,120,10 +END + +IDD_PREFS_EDIT DIALOG DISCARDABLE 0, 0, 251, 123 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ö¸¶¨·þÎñÆ÷µÄÓÅÏȼ¶" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "¿ÉΪ´Ë AFS µ¥ÔªÖеķþÎñÆ÷Ö¸¶¨ÓÅÏȼ¶ÅÅÐò¡£µ±²éÕÒ AFS ÖеÄÊý¾Ýʱ£¬½«Ê×ÏȲéѯÓÅÏȼ¶½Ï¸ßµÄ·þÎñÆ÷¡£", + IDC_STATIC,7,7,237,17 + LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,7,38,51,8 + LTEXT "ÅÅÐò(&R)£º",IDC_STATIC,7,54,51,8 + EDITTEXT IDC_SERVER,63,36,80,13,ES_AUTOHSCROLL + EDITTEXT IDC_RANK,63,52,36,13,ES_AUTOHSCROLL + LTEXT "ÇÏÃÅ£ºÔÚʹÓá°µ¼È롱°´Å¥ÒÔ¶ÁÈ¡Îı¾ÎļþÖ¸¶¨µÄ·þÎñÆ÷ºÍËüÃǵÄÅÅÐòʱ£¬¿Éͬʱָ¶¨¼¸¸ö·þÎñÆ÷µÄÅÅÐò¡£", + IDC_STATIC,7,76,237,18 + PUSHBUTTON "È¡Ïû",IDCANCEL,140,102,50,14 + PUSHBUTTON "È·¶¨",IDOK,86,102,50,14 + PUSHBUTTON "°ïÖú",9,194,102,50,14 +END + +IDD_CELL_EDIT DIALOG DISCARDABLE 0, 0, 244, 223 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "µ¥ÔªÌØÐÔ" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "´ËÒ³ÃæÉϵÄÐÅÏ¢½«¸æËß AFS ÈçºÎÁªÏµÖ¸¶¨µÄµ¥Ôª¡£", + IDC_STATIC,4,4,226,8 + LTEXT "AFS µ¥Ôª(&A)£º",IDC_STATIC,4,24,58,8 + EDITTEXT IDC_CELL,62,22,105,13,ES_LOWERCASE | ES_AUTOHSCROLL + LTEXT "ÃèÊö(&D)£º",IDC_STATIC,4,41,38,8 + EDITTEXT IDC_COMMENT,62,39,171,13,ES_AUTOHSCROLL + GROUPBOX "·þÎñÆ÷",IDC_STATIC,4,61,236,158 + CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x1b,13, + 76,217,117 + PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,75,198,50,14 + PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,128,198,50,14 + PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,181,198,50,14 +END + +IDD_SERVER_EDIT DIALOG DISCARDABLE 0, 0, 251, 112 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ìí¼Ó£¯±à¼­·þÎñÆ÷" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "ÔÚÖ¸¶¨µ¥ÔªÖÐÊäÈë¾íλÖ÷þÎñÆ÷µÄÃû³Æ¡£",IDC_STATIC,7,7, + 237,8 + LTEXT "·þÎñÆ÷Ãû(&N)£º",IDC_STATIC,7,31,53,8 + EDITTEXT IDC_COMMENT,75,29,156,13,ES_AUTOHSCROLL + LTEXT "·þÎñÆ÷µØÖ·(&A)£º",IDC_STATIC,7,52,64,8 + CONTROL "ʹÓÃÌØ¶¨µØÖ·(&U)£º",IDC_ADDR_SPECIFIC,"Button", + BS_AUTORADIOBUTTON,75,52,83,10 + CONTROL "×Ô¶¯²éÕÒµØÖ·(&L)",IDC_ADDR_LOOKUP,"Button", + BS_AUTORADIOBUTTON,75,66,111,10 + CONTROL "",IDC_SERVER,"SockAddr",WS_BORDER | WS_TABSTOP,163,51, + 65,13 + PUSHBUTTON "È¡Ïû",IDCANCEL,140,91,50,14 + PUSHBUTTON "È·¶¨",IDOK,86,91,50,14 + PUSHBUTTON "°ïÖú",9,194,91,50,14 +END + +IDD_DRIVE_EDIT DIALOG DISCARDABLE 0, 0, 297, 156 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ó³ÉäÅÌ·û" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "¿ÉÓ³É伯Ëã»úÉϵÄÅÌ·ûÖÁ AFS ÖеÄ·¾¶¡£",IDC_STATIC,7,7, + 283,8 + LTEXT "ÀýÈ磬Èç¹ûÓ³ÉäÇý¶¯Æ÷ Q ÖÁ /afs/acme.com/usr/bob£¬Ôò AFS µÄ /afs/acme.com/usr/bob/* ÖеĿÉÓÃÎļþ½«ÔÚÄú¼ÆËã»úµÄ Q:\\ Ŀ¼Ï¿ɼû¡£", + IDC_STATIC,7,26,283,16 + LTEXT "ÅÌ·û(&D)£º",IDC_STATIC,14,59,58,8 + COMBOBOX IDC_DRIVE,77,57,63,206,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,14,77,58,8 + EDITTEXT IDC_PATH,77,75,168,13,ES_AUTOHSCROLL + LTEXT "ÃèÊö(&E)£º",IDC_STATIC,14,96,58,8 + EDITTEXT IDC_DESC,77,94,72,13,ES_AUTOHSCROLL + CONTROL "µÇ¼ʱ»Ö¸´Ó³Éä(&R)",IDC_PERSISTENT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,77,112,188,10 + PUSHBUTTON "È¡Ïû",IDCANCEL,186,135,50,14 + PUSHBUTTON "È·¶¨",IDOK,132,135,50,14 + PUSHBUTTON "°ïÖú",9,240,135,50,14 +END + +IDD_SUBMOUNTS DIALOG DISCARDABLE 0, 0, 244, 198 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "×Ó°²×°" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "ÄúµÄ¼ÆËã»ú¿ÉÌṩ AFS ÖеÄ×Ó°²×°--ÍøÂç¹²Ïí¡£",IDC_STATIC, + 4,4,196,8 + GROUPBOX "×Ó°²×°",IDC_STATIC,4,26,236,168 + LTEXT "ÏÂÁÐ×Ó°²×°´Ó´Ë¼ÆËã»úÉϹ²Ïí£º",IDC_STATIC,10,42,176,8 + CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x413,10, + 54,223,115 + PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,78,173,50,14 + PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,131,173,50,14 + PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,184,173,50,14 +END + +IDD_SUBMOUNT_EDIT DIALOG DISCARDABLE 0, 0, 270, 112 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ö¸¶¨×Ó°²×°" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "ʹÓà Windows ÍøÂ磬×Ó°²×°ÈÃÄú¹²ÏíÒ»¸ö×ÓĿ¼Ê÷¡£", + IDC_STATIC,7,7,256,8 + LTEXT "×Ó°²×°(&S)£º",IDC_STATIC,7,27,53,8 + LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,7,43,53,8 + EDITTEXT IDC_SUBMOUNT,63,25,80,13,ES_AUTOHSCROLL + EDITTEXT IDC_MAPPING,63,41,181,13,ES_AUTOHSCROLL + LTEXT "Ϊ×Ó°²×°ÊäÈë¶ÌÃû£¬²¢ÇÒµ±³öÏÖÌáʾʱÊäÈëÒ»¸öÈ« AFS ·¾¶¡£AFS ·¾¶¿ÉÒÔ""\\afs""¿ªÊ¼(Èç¹û²»ÊÇ£¬""\\afs""½«×Ô¶¯Ìí¼Ó)¡£", + IDC_STATIC,7,64,256,18 + PUSHBUTTON "È¡Ïû",IDCANCEL,159,91,50,14 + PUSHBUTTON "È·¶¨",IDOK,105,91,50,14 + PUSHBUTTON "°ïÖú",9,213,91,50,14 +END + +IDD_DRIVES_95 DIALOG DISCARDABLE 0, 0, 245, 145 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ÅÌ·û" +FONT 9, "ËÎÌå" +BEGIN + GROUPBOX "ÅÌ·û",IDC_STATIC,7,7,231,131 + CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_TABSTOP | 0x153, + 13,32,219,60 + PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,83,95,48,14 + PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,134,95,48,14 + PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,184,95,48,14 + LTEXT "½«ÅÌ·ûÓ³ÉäÖÁ AFS ÖеÄ·¾¶£º",IDC_STATIC,13,21,193,8 + LTEXT "×¢Ò⣺ÓÉÓÚ AFS ¿Í»§»úûÓÐÁ¬½ÓÖÁ AFS Íø¹Ø£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£", + IDC_WARN,13,116,219,17 +END + +IDD_HOSTS_95 DIALOG DISCARDABLE 0, 0, 245, 145 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS µ¥Ôª" +FONT 9, "ËÎÌå" +BEGIN + GROUPBOX "AFS µ¥Ôª",IDC_STATIC,7,7,231,131 + CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x11b,13, + 19,218,94 + PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,75,116,50,14 + PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,128,116,50,14 + PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,181,116,50,14 +END + +IDD_STARTSTOP DIALOGEX 0, 0, 219, 48 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION +EXSTYLE WS_EX_TOOLWINDOW +CAPTION "AFS ¿Í»§»ú·þÎñ" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + GROUPBOX "",IDC_STATIC,4,0,211,44 + ICON IDI_MAIN,IDC_STATIC,14,15,20,20 + LTEXT "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÆô¶¯...",IDC_STARTING,46,20, + 157,8 + LTEXT "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÍ£Ö¹...",IDC_STOPPING,46,20, + 157,8 +END + +IDD_HOSTS_CCENTER DIALOG DISCARDABLE 0, 0, 220, 256 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ò»°ã" +FONT 9, "ËÎÌå" +BEGIN + GROUPBOX "ȱʡµ¥Ôª",IDC_STATIC,7,7,206,54 + LTEXT "ÊäÈëÒª¹ÜÀíµÄȱʡ AFS µ¥ÔªÃû£º",IDC_STATIC,14,19,164,8 + LTEXT "ȱʡµ¥Ôª£º",IDC_STATIC,14,37,44,8 + EDITTEXT IDC_CELL,65,35,141,14,ES_LOWERCASE | ES_AUTOHSCROLL + GROUPBOX "AFS µ¥Ôª",IDC_STATIC,7,69,206,180 + CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x11b,13, + 84,193,137 + PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,51,227,50,14 + PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,104,227,50,14 + PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,157,227,50,14 +END + +IDD_MISC_CONFIG_PARMS DIALOG DISCARDABLE 0, 0, 220, 193 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ÔÓÏîÅäÖÃ" +FONT 8, "System" +BEGIN + EDITTEXT IDC_LAN_ADAPTER,90,20,32,13,ES_AUTOHSCROLL + EDITTEXT IDC_PROBE,90,40,32,13,ES_AUTOHSCROLL + EDITTEXT IDC_THREADS,90,60,32,13,ES_AUTOHSCROLL + EDITTEXT IDC_DAEMONS,90,80,32,13,ES_AUTOHSCROLL + EDITTEXT IDC_SYSNAME,90,100,83,13,ES_AUTOHSCROLL + EDITTEXT IDC_MOUNTDIR,90,120,83,13,ES_AUTOHSCROLL + EDITTEXT IDC_ROOTVOLUME,90,140,83,13,ES_AUTOHSCROLL + DEFPUSHBUTTON "È·¶¨",IDOK,55,172,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,109,172,50,14 + PUSHBUTTON "°ïÖú",9,163,172,50,14 + GROUPBOX "²ÎÊý",IDC_STATIC,7,7,206,156 + LTEXT "¼ì²â¼ä¸ô(&P)£º",IDC_STATIC,15,42,71,8 + LTEXT "Ãë",IDC_STATIC,138,42,68,8 + LTEXT "ºǫ́Ïß³Ì(&B)£º",IDC_STATIC,15,62,71,8 + LTEXT "Ïß³Ì",IDC_STATIC,138,62,68,8 + LTEXT "·þÎñÏß³Ì(&E)£º",IDC_STATIC,15,82,71,8 + LTEXT "Ïß³Ì",IDC_STATIC,138,82,68,8 + LTEXT "ϵͳÃû³Æ(&Y)£º",IDC_STATIC,15,102,71,8 + LTEXT "°²×°Ä¿Â¼(&M)£º",IDC_STATIC,15,122,71,8 + LTEXT "LAN ÊÊÅäÆ÷ºÅ(&L)£º",IDC_STATIC,15,22,71,8 + LTEXT "¸ù¾í(&R)£º",IDC_STATIC,15,141,71,8 +END + +IDD_DIAG_PARMS DIALOG DISCARDABLE 0, 0, 217, 135 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Õï¶ÏÅäÖÃ" +FONT 8, "System" +BEGIN + EDITTEXT IDC_TRACE_LOG_BUF_SIZE,112,20,32,13,ES_AUTOHSCROLL + DEFPUSHBUTTON "È·¶¨",IDOK,52,114,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,106,114,50,14 + PUSHBUTTON "°ïÖú",9,160,114,50,14 + GROUPBOX "¸ú×ÙÈÕÖ¾²ÎÊý",IDC_STATIC,7,7,203,54 + LTEXT "»º³åÇø´óС(&B)£º",IDC_STATIC,13,22,73,8 + LTEXT "KB",IDC_STATIC,155,24,9,8 + GROUPBOX "ʼþÈÕÖ¾²ÎÊý",IDC_STATIC,7,69,203,35 + COMBOBOX IDC_TRAP_ON_PANIC,112,40,32,61,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "½ô¼±Çé¿öϵ÷ÓÃÏÝÚå(&T)£º",IDC_STATIC,13,42,93,8 + LTEXT "±¨¸æ»á»°Æô¶¯£º",IDC_STATIC,13,86,79,8 + COMBOBOX IDC_REPORT_SESSION_STARTUPS,112,84,32,64, + CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP +END + +IDD_LOGIN_CONFIG_PARMS DIALOG DISCARDABLE 0, 0, 186, 92 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "µÇ¼ÅäÖÃ" +FONT 8, "System" +BEGIN + EDITTEXT IDC_LOGIN_RETRY_INTERVAL,117,18,32,13,ES_AUTOHSCROLL + COMBOBOX IDC_FAIL_SILENTLY,117,39,32,40,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "È·¶¨",IDOK,21,71,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,75,71,50,14 + PUSHBUTTON "°ïÖú",9,129,71,50,14 + LTEXT "µÇÂ¼ÖØÊÔ¼ä¸ô(&L)£º",IDC_STATIC,13,20,98,8 + GROUPBOX "²ÎÊý",IDC_STATIC,7,7,172,54 + LTEXT "µÇ¼ʧ°Ü£¬ÎÞÈκÎÌáʾ(&F)£º",IDC_STATIC,13,41,98,8 +END + +IDD_GLOBAL_DRIVES DIALOG DISCARDABLE 0, 0, 253, 169 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "È«¾ÖÇý¶¯Æ÷" +FONT 8, "System" +BEGIN + DEFPUSHBUTTON "¹Ø±Õ",IDOK,141,148,50,14 + PUSHBUTTON "°ïÖú",9,196,148,50,14 + PUSHBUTTON "Ìí¼Ó(&A)",IDC_ADD,108,117,42,14 + GROUPBOX "È«¾ÖÓ³Éä AFS Çý¶¯Æ÷",IDC_STATIC,7,7,239,133 + CONTROL "",IDC_GLOBAL_DRIVE_LIST,"FastList",WS_BORDER | + WS_TABSTOP | 0x1b,14,20,226,89 + PUSHBUTTON "¸ü¸Ä(&C)",IDC_CHANGE,153,117,42,14 + PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,198,117,42,14 +END + +IDD_GLOBAL_DRIVES_ADDEDIT DIALOG DISCARDABLE 0, 0, 247, 118 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ó³ÉäÈ«¾ÖÇý¶¯Æ÷" +FONT 8, "System" +BEGIN + COMBOBOX IDC_DRIVE,63,23,63,206,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + EDITTEXT IDC_PATH,63,42,168,13,ES_AUTOHSCROLL + EDITTEXT IDC_DESC,63,62,72,13,ES_AUTOHSCROLL + DEFPUSHBUTTON "È·¶¨",IDOK,82,96,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,136,96,50,14 + PUSHBUTTON "°ïÖú",9,190,96,50,14 + LTEXT "ÅÌ·û(&D)£º",IDC_STATIC,12,25,48,8 + LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,12,44,48,8 + LTEXT "ÃèÊö(&E)£º",IDC_STATIC,12,64,48,8 + GROUPBOX "È«¾Ö AFS Çý¶¯Æ÷",IDC_STATIC,7,7,232,80 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_GENERAL_NT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 213 + TOPMARGIN, 7 + BOTTOMMARGIN, 218 + END + + IDD_GENERAL_95, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 238 + TOPMARGIN, 7 + BOTTOMMARGIN, 138 + END + + IDD_PREFS_NT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 213 + TOPMARGIN, 7 + BOTTOMMARGIN, 218 + END + + IDD_HOSTS_NT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 213 + TOPMARGIN, 7 + BOTTOMMARGIN, 218 + END + + IDD_DRIVES_NT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 213 + TOPMARGIN, 7 + BOTTOMMARGIN, 218 + END + + IDD_ADVANCED_NT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 213 + TOPMARGIN, 7 + BOTTOMMARGIN, 218 + END + + IDD_PREFS_EDIT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 244 + TOPMARGIN, 7 + BOTTOMMARGIN, 116 + END + + IDD_CELL_EDIT, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 240 + TOPMARGIN, 4 + BOTTOMMARGIN, 219 + END + + IDD_SERVER_EDIT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 244 + TOPMARGIN, 7 + BOTTOMMARGIN, 105 + END + + IDD_DRIVE_EDIT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 290 + TOPMARGIN, 7 + BOTTOMMARGIN, 149 + END + + IDD_SUBMOUNTS, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 240 + TOPMARGIN, 4 + BOTTOMMARGIN, 194 + END + + IDD_SUBMOUNT_EDIT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 263 + TOPMARGIN, 7 + BOTTOMMARGIN, 105 + END + + IDD_DRIVES_95, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 238 + TOPMARGIN, 7 + BOTTOMMARGIN, 138 + END + + IDD_HOSTS_95, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 238 + TOPMARGIN, 7 + BOTTOMMARGIN, 138 + END + + IDD_STARTSTOP, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 215 + TOPMARGIN, 4 + BOTTOMMARGIN, 44 + END + + IDD_HOSTS_CCENTER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 213 + TOPMARGIN, 7 + BOTTOMMARGIN, 249 + END + + IDD_MISC_CONFIG_PARMS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 213 + TOPMARGIN, 7 + BOTTOMMARGIN, 186 + END + + IDD_DIAG_PARMS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 210 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END + + IDD_LOGIN_CONFIG_PARMS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + TOPMARGIN, 7 + BOTTOMMARGIN, 85 + END + + IDD_GLOBAL_DRIVES, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 246 + TOPMARGIN, 7 + BOTTOMMARGIN, 162 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "#ifndef APSTUDIO_INVOKED\r\n" + "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ¿Í»§»úÅäÖÃ""\r\n" + "#include ""AFS_component_version_number.h""\r\n" + "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n" + "#endif // APSTUDIO_INVOKED\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "afs_config.ico" +IDI_UP ICON DISCARDABLE "up.ico" +IDI_DOWN ICON DISCARDABLE "down.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TITLE_NT "AFS ¿Í»§»úÅäÖÃ" + IDS_TITLE_95 "AFS Light ÅäÖÃ" + IDS_STATE_STOPPED "AFS ¿Í»§»ú·þÎñµ±Ç°ÎªÍ£Ö¹×´Ì¬¡£" + IDS_STATE_RUNNING "AFS ¿Í»§»ú·þÎñÕýÔÚÕý³£ÔËÐС£" + IDS_STATE_STARTING "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÆô¶¯..." + IDS_STATE_STOPPING "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÍ£Ö¹..." + IDS_STATE_UNKNOWN "AFS ¿Í»§»ú·þÎñûÓÐÊʵ±ÅäÖá£" + IDS_SERVICE_FAIL_START "AFS ¿Í»§»ú·þÎñ²»Äܳɹ¦Æô¶¯¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£" + IDS_SERVICE_FAIL_STOP "AFS ¿Í»§»ú·þÎñ²»Äܳɹ¦Í£Ö¹¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£" + IDS_WARN_STOPPED "ÓÉÓÚ AFS ¿Í»§»ú·þÎñûÓÐÔËÐУ¬²»Äܸü¸Ä½ûÓõĿØÖÆ¡£" + IDS_WARN_ADMIN "ÓÉÓÚÄúûÓÐÒÔ¹ÜÀíÔ±Éí·ÝµÇ¼ÖÁ Windows£¬²»Äܸü¸Ä½ûÓõĿØÖÆ¡£" + IDS_CELL_UNKNOWN "(δ֪)" + IDS_GATEWAY_UNKNOWN "(δ֪)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADLOOKUP_DESC "Windows ÕÒ²»µ½ %1 µÄÍøÂçµØÖ·¡£¼ì²éÒÔÈ·±£ÊäÈëÁËÕýÈ·µÄ»úÆ÷Ãû¡£" + IDS_NEWSUB_DESC "µ±Á¬½ÓÍøÂçÇý¶¯Æ÷ʱ£¬AFS ÎÞ·¨Ê¹ÓÃÖ¸¶¨µÄÃèÊö¡£\n\nÖ¸¶¨µÄÃèÊöÒÑʹÓÃÔÚ²»Í¬µÄ AFS ·¾¶ÖС£" + IDS_BADSUB_DESC "²»ÄÜʹÓÃÄúÊäÈëµÄÅÌ·ûÃèÊö¡£\n\nÅÌ·ûÃèÊö²»Äܳ¬¹ý 12 ¸ö×Ö·û£¬²¢ÇÒ²»Äܰüº¬¿Õ¸ñ»òÖÆ±í·û¡£" + IDS_BADGATEWAY_DESC "AFS ÎÞ·¨Á¬½ÓÖÁÄúÖ¸¶¨µÄÍø¹Ø»úÆ÷¡£\n\n¼ì²éÒÔÈ·±£ÊäÈëÁíÍâÕýÈ·µÄÍø¹ØÉ豸Ãû³Æ¡£" + IDS_BADGWCELL_DESC "ÕÒ²»µ½Ö¸¶¨µÄÍø¹Ø»úÆ÷ʹÓÃµÄ AFS µ¥ÔªµÄÅäÖÃÐÅÏ¢¡£\n\nÈç¹ûÄúÒªÔÚеĵ¥ÔªÖÐÅäÖà AFS ¿Í»§»ú£¬±ØÐëʹÓá°AFS µ¥Ôª¡±±êÇ©ÒÔÌí¼Ó¸Ãе¥ÔªµÄÅäÖÃÐÅÏ¢¡£\n\nµ¥Ôª£º%1" + IDS_TITLE_CAUTION_NT "×¢Òâ - AFS ¿Í»§»úÅäÖÃ" + IDS_TITLE_CAUTION_95 "×¢Òâ - AFS Light" + IDS_TITLE_ERROR_NT "³ö´í - AFS ¿Í»§»úÅäÖÃ" + IDS_TITLE_ERROR_95 "³ö´í - AFS Light ÅäÖÃ" + IDS_SHRINKCACHE "µ± AFS ¿Í»§»ú·þÎñÕýÔÚÔËÐÐʱ²»ÄܼõÉÙ AFS ¿Í»§»ú¸ßËÙ»º´æµÄ´óС¡£\n\nÒª¼õÉÙ¸ßËÙ»º´æµÄ´óС£¬Ê×ÏÈÔÚ¡°Ò»°ã¡±±êÇ©ÉÏʹÓá°Í£Ö¹·þÎñ¡±°´Å¥Í£Ö¹ AFS ¿Í»§»ú·þÎñ¡£" + IDS_BADCELL_DESC_CC "ÔÚÄúÊäÈëµÄ AFS µ¥ÔªÖÐÕÒ²»µ½ÅäÖÃÐÅÏ¢¡£\n\n+" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_STOP_DESC "Èç¹ûÍ£Ö¹ AFS ¿Í»§»ú·þÎñ£¬´æ´¢ÔÚ AFS ÖеÄÎļþ½«²»¿É´Ó´Ë¼ÆËã»úÖдæÈ¡¡£\n\nÈ·ÈÏҪֹͣ·þÎñÂð?" + IDS_PREFCOL_SERVER "·þÎñÆ÷" + IDS_PREFCOL_RANK "ÅÅÐò" + IDS_TIP_PREFS "ÇÏÃÅ£ºµ±´Ó AFS ¶ÁÈ¡Îļþʱ£¬µÍÅÅÐòÊýµÄ·þÎñÆ÷½«»ñµÃ¸ßÓÅÏȼ¶¡£" + IDS_PREFERROR_RESOLVE "AFS ÕÒ²»µ½ÃûΪ %1 µÄ·þÎñÆ÷¡£Çë¼ì²éÒÔÈ·±£ÊäÈëÕýÈ·µÄ·þÎñÆ÷¡£" + IDS_FILTER_TXT "Îı¾Îļþ(*.TXT)£»*.TXT£»" + IDS_HOSTREM_MANY "ÄúÒÑÑ¡Ôñ³ýÈ¥ÓйØÑ¡¶¨µÄ AFS µ¥ÔªµÄËùÓÐÁ¬½ÓÐÅÏ¢¡£\n\nÈ·ÈÏÒª³ýÈ¥ÕâЩÌõÄ¿Âð?" + IDS_HOSTREM_ONE "ÄúÒÑÑ¡Ôñ³ýÈ¥ÓÐ¹Ø AFS µ¥Ôª %1 µÄËùÓÐÁ¬½ÓÐÅÏ¢¡£\n\nÈ·ÈÏÒª³ýÈ¥ÕâЩÌõÄ¿Âð?" + IDS_CELLEDIT_TITLE "%1 - ÌØÐÔ" + IDS_CELLADD_TITLE "н¨µ¥Ôª" + IDS_SVRCOL_SERVER "µØÖ·" + IDS_SVRCOL_COMMENT "·þÎñÆ÷Ãû" + IDS_TIP_DRIVES "ÇÏÃÅ£ºÑ¡ÖÐÓ³ÉäÅÌ·ûÅԵĸ´Ñ¡¿ò£¬Á¬½ÓÍøÂçÇý¶¯Æ÷Ó³Éä¡£" + IDS_MAP_LETTER "Çý¶¯Æ÷ *:" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DRIVE_MAP "Çý¶¯Æ÷ %1: \t%2" + IDS_ERROR_MAP "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í" + IDS_ERROR_MAP_DESC "AFS ÎÞ·¨Ó³ÉäÍøÂçÇý¶¯Æ÷ÖÁ AFS ÖеÄ·¾¶¡£¼ì²éÒÔÈ·±£ÅÌ·ûµ±Ç°Ã»ÓÐʹÓá£\n\n´íÎó£º0x%1¡£" + IDS_ERROR_UNMAP "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í" + IDS_ERROR_UNMAP_DESC "AFS ÎÞ·¨¶Ï¿ªÓëÖ¸¶¨ÍøÂçÇý¶¯Æ÷µÄÓ³Éä¡£¼ì²éÒÔÈ·±£ÅÌ·ûµ±Ç°Ã»ÓÐʹÓá£\n\n´íÎó£º0x%1¡£" + IDS_ADDSERVER_TITLE "Ìí¼Ó·þÎñÆ÷" + IDS_EDITSERVER_TITLE "±à¼­·þÎñÆ÷" + IDS_SUBCOL_SHARE "×Ó°²×°" + IDS_SUBCOL_PATH "AFS ·¾¶" + IDS_SUBMOUNTS_TITLE "×Ó°²×°" + IDS_BADCELL_DESC "ÔÚÄúÊäÈëµÄ AFS µ¥ÔªÖÐÕÒ²»µ½ÅäÖÃÐÅÏ¢¡£\n\n+" + IDS_BADCELL_DESC2 "¼ì²éÒÔÈ·±£ÄúÕýÈ·ÊäÈëÁ˵¥ÔªµÄÃû³Æ¡£Èç¹ûÄúÒªÔÚеĵ¥ÔªÖÐÅäÖà AFS ¿Í»§»ú£¬Äú±ØÐëʹÓá°AFS µ¥Ôª¡±±êÇ©ÒÔÌí¼Ó¸Ãе¥ÔªµÄÅäÖÃÐÅÏ¢¡£" + IDS_KB_IN_USE "KB (%1 KB ÕýÔÚʹÓÃ)" + IDS_NOGATEWAY_TITLE "ÎÞЧ AFS Íø¹Ø" + IDS_NOGATEWAY_DESC "ÓÉÓÚÄúûÓÐÖ¸¶¨ AFS Íø¹Ø£¬²»ÄÜÅäÖà AFS Light¡£\n\nÇëÔÚÌṩµÄÇøÓòÖÐÊäÈë AFS Íø¹ØµÄÃû³Æ»ò IP µØÖ·¡£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_NOCELL_DESC "ÓÉÓÚÄúûÓÐÖ¸¶¨ AFS µ¥Ôª£¬²»ÄÜÅäÖà AFS ¿Í»§»ú¡£\n\nÇëÔÚÌṩµÄÇøÓòÖÐÊäÈë AFS µ¥ÔªµÄÃû³Æ¡£" + IDS_STOPPED_NOCELL "ÔÚÆô¶¯ AFS ¿Í»§»ú·þÎñ֮ǰ£¬±ØÐëÖ¸¶¨ AFS µ¥Ôª¡£" + IDS_OKSTOP_DESC "ûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ¡£ÔÚûÓÐÆô¶¯ AFS ¿Í»§»ú·þÎñ֮ǰ£¬´æ´¢ÔÚ AFS ÖеÄÎļþ½«²»¿É´æÈ¡¡£\n\nÏÖÔÚÆô¶¯·þÎñÂð? " + IDS_BADMAP_DESC "ÓÉÓÚ·¾¶Ã»ÓÐÒÔ""\\afs""¿ªÊ¼£¬AFS ²»ÄÜÓ³ÉäÅÌ·ûÖÁÖ¸¶¨µÄ·¾¶¡£\n\nÈ·±£ÄúËùÊäÈëµÄ·¾¶ÊÇÒÔ""\\afs""¿ªÊ¼µÄ£¬²¢ÖØÊÔÒ»´Î¡£" + IDS_RESTART_TITLE "AFS ¿Í»§»úÅäÖÃ" + IDS_RESTART_DESC "ÔÚ AFS ¿Í»§»ú·þÎñÍ£Ö¹²¢ÖØÐÂÆô¶¯Ö®Ç°£¬ÄúËù×öµÄһЩ¸ü¸Ä½«²»»áÉúЧ¡£\n\nÏÖÔÚÍ£Ö¹²¢ÖØÐÂÆô¶¯·þÎñÂð? " + IDS_KB_ONLY "KB" + IDS_FAILCONFIG_AUTHENT "µ±ÔڵǼʱ³¢ÊÔÆôÓûò½ûÓÃÈÏ֤ʱ³ö´í¡£\n\n´íÎó %1" + IDS_FAILCONFIG_PREFS "ÄúÖ¸¶¨µÄһЩ·þÎñÆ÷ÅÅÐòÓÅÏȼ¶²»ÄÜʹÓá£\n\n´íÎó %1" + IDS_FAILCONFIG_CACHE "²»ÄÜʹÓÃÄúÊäÈëµÄ AFS ¿Í»§»ú¸ßËÙ»º´æ´óС¡£\n\n´íÎó %1" + IDS_FAILCONFIG_PROBE "²»ÄÜʹÓÃÄúÊäÈëµÄ AFS ¿Í»§»ú¼ì²â¼ä¸ô¡£\n\n´íÎó %1" + IDS_FAILCONFIG_SYSNAME "²»ÄÜʹÓÃÄúÊäÈëµÄ AFS ¿Í»§»úϵͳÃû¡£\n\n´íÎó %1" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADCELL_DESC_CC2 "Çë¼ì²éµ¥ÔªÃûÈ·±£ÄúÒÑÊäÈëÕýÈ·¡£Èç¹ûÔÚ AFS µ¥ÔªÁбíÖÐûÓгöÏÖÕýÈ·µÄµ¥ÔªÃû£¬ÇëʹÓá°Ìí¼Ó¡±°´Å¥Îª¸Ãµ¥Ôª´´½¨Ò»¸öÌõÄ¿¡£" + IDS_NOCELL_DESC_CC "²»ÄÜÅäÖà AFS ¿ØÖÆÖÐÐÄ£¬ÒòΪÄú»¹Ã»ÓÐÖ¸¶¨È±Ê¡µÄ AFS µ¥Ôª¡£\n\nÇëÔÚÌṩµÄÇøÓòÖÐÊäÈë AFS µ¥ÔªÃû¡£" + IDS_TITLE_CAUTION_CCENTER "×¢Òâ - AFS ¿ØÖÆÖÐÐÄÌØÐÔ" + IDS_TITLE_ERROR_CCENTER "³ö´í - AFS ¿ØÖÆÖÐÐÄÌØÐÔ" + IDS_TITLE_CCENTER "AFS ¿ØÖÆÖÐÐÄÌØÐÔ" + IDS_YES "ÊÇ" + IDS_NO "·ñ" + IDS_DRIVE "Çý¶¯Æ÷" +END + +#endif // Chinese (P.R.C.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/client_config/main.cpp b/src/WINNT/client_config/main.cpp index 8ec590572..ad4255f43 100644 --- a/src/WINNT/client_config/main.cpp +++ b/src/WINNT/client_config/main.cpp @@ -10,6 +10,7 @@ extern "C" { #include #include +#include } #include "afs_config.h" @@ -20,7 +21,6 @@ extern "C" { #include "tab_drives.h" #include "tab_advanced.h" - /* * DEFINITIONS ________________________________________________________________ * @@ -34,21 +34,12 @@ extern "C" { GLOBALS g; - -/* - * PROTOTYPES _________________________________________________________________ - * - */ - -void Quit (void); - - /* * ROUTINES ___________________________________________________________________ * */ -int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR pCmdLine, int nCmdShow) +extern "C" int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR pCmdLine, int nCmdShow) { TaLocale_LoadCorrespondingModule (hInst); @@ -62,6 +53,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR pCmdLine, int nCmdSh RegisterFastListClass(); RegisterSockAddrClass(); RegisterSpinnerClass(); + fs_utils_InitMountRoot(); // Initialize our global variables and window classes // diff --git a/src/WINNT/client_config/resource.h b/src/WINNT/client_config/resource.h index ccdaf504c..0b32420d0 100644 --- a/src/WINNT/client_config/resource.h +++ b/src/WINNT/client_config/resource.h @@ -7,71 +7,76 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#define IDS_TITLE_NT 1 -#define IDS_TITLE_95 2 -#define IDS_STATE_STOPPED 3 -#define IDS_STATE_RUNNING 4 -#define IDS_STATE_STARTING 5 -#define IDS_STATE_STOPPING 6 -#define IDS_STATE_UNKNOWN 7 -#define IDS_SERVICE_FAIL_START 9 -#define IDS_SERVICE_FAIL_STOP 10 -#define IDS_WARN_STOPPED 11 -#define IDS_WARN_ADMIN 12 -#define IDS_CELL_UNKNOWN 13 -#define IDS_GATEWAY_UNKNOWN 14 -#define IDS_STOP_DESC 16 -#define IDS_PREFCOL_SERVER 17 -#define IDS_PREFCOL_RANK 18 -#define IDS_TIP_PREFS 19 -#define IDS_PREFERROR_RESOLVE 21 -#define IDS_FILTER_TXT 22 -#define IDS_HOSTREM_MANY 24 -#define IDS_HOSTREM_ONE 25 -#define IDS_CELLEDIT_TITLE 26 -#define IDS_CELLADD_TITLE 27 -#define IDS_SVRCOL_SERVER 28 -#define IDS_SVRCOL_COMMENT 29 -#define IDS_TIP_DRIVES 30 -#define IDS_MAP_LETTER 31 -#define IDS_DRIVE_MAP 32 -#define IDS_ERROR_MAP 33 -#define IDS_ERROR_MAP_DESC 34 -#define IDS_ERROR_UNMAP 35 -#define IDS_ERROR_UNMAP_DESC 36 -#define IDS_ADDSERVER_TITLE 37 -#define IDS_EDITSERVER_TITLE 38 -#define IDS_SUBCOL_SHARE 39 -#define IDS_SUBCOL_PATH 40 -#define IDS_SUBMOUNTS_TITLE 41 -#define IDS_BADCELL_DESC 43 -#define IDS_BADCELL_DESC2 44 -#define IDS_KB_IN_USE 45 -#define IDS_NOGATEWAY_TITLE 46 -#define IDS_NOGATEWAY_DESC 47 -#define IDS_NOCELL_DESC 49 -#define IDS_STOPPED_NOCELL 50 -#define IDS_OKSTOP_DESC 52 -#define IDS_BADMAP_DESC 54 -#define IDS_RESTART_TITLE 55 -#define IDS_RESTART_DESC 56 -#define IDS_KB_ONLY 57 -#define IDS_FAILCONFIG_AUTHENT 59 -#define IDS_FAILCONFIG_PREFS 60 -#define IDS_FAILCONFIG_CACHE 61 -#define IDS_FAILCONFIG_PROBE 62 -#define IDS_FAILCONFIG_SYSNAME 63 -#define IDS_BADLOOKUP_DESC 65 -#define IDS_NEWSUB_DESC 67 -#define IDS_BADSUB_DESC 69 -#define IDS_BADGATEWAY_DESC 71 -#define IDS_BADGWCELL_DESC 73 -#define IDS_TITLE_CAUTION_NT 74 -#define IDS_TITLE_CAUTION_95 75 -#define IDS_TITLE_ERROR_NT 76 -#define IDS_TITLE_ERROR_95 77 -#define IDS_SHRINKCACHE 78 -#define IDS_BADCELL_DESC_CC 79 +#define IDS_TITLE_NT 0 +#define IDS_TITLE_95 1 +#define IDS_STATE_STOPPED 2 +#define IDS_STATE_RUNNING 3 +#define IDS_STATE_STARTING 4 +#define IDS_STATE_STOPPING 5 +#define IDS_STATE_UNKNOWN 6 +#define IDS_SERVICE_FAIL_START 7 +#define IDS_SERVICE_FAIL_STOP 8 +#define IDS_WARN_STOPPED 9 +#define IDS_WARN_ADMIN 10 +#define IDS_CELL_UNKNOWN 11 +#define IDS_GATEWAY_UNKNOWN 12 + +#define IDS_BADLOOKUP_DESC 16 +#define IDS_NEWSUB_DESC 17 +#define IDS_BADSUB_DESC 18 +#define IDS_BADGATEWAY_DESC 19 +#define IDS_BADGWCELL_DESC 20 +#define IDS_TITLE_CAUTION_NT 21 +#define IDS_TITLE_CAUTION_95 22 +#define IDS_TITLE_ERROR_NT 23 +#define IDS_TITLE_ERROR_95 24 +#define IDS_SHRINKCACHE 25 +#define IDS_BADCELL_DESC_CC 26 + +#define IDS_STOP_DESC 32 +#define IDS_PREFCOL_SERVER 33 +#define IDS_PREFCOL_RANK 34 +#define IDS_TIP_PREFS 35 +#define IDS_PREFERROR_RESOLVE 36 +#define IDS_FILTER_TXT 37 +#define IDS_HOSTREM_MANY 38 +#define IDS_HOSTREM_ONE 39 +#define IDS_CELLEDIT_TITLE 40 +#define IDS_CELLADD_TITLE 41 +#define IDS_SVRCOL_SERVER 42 +#define IDS_SVRCOL_COMMENT 43 +#define IDS_TIP_DRIVES 44 +#define IDS_MAP_LETTER 45 + +#define IDS_DRIVE_MAP 48 +#define IDS_ERROR_MAP 49 +#define IDS_ERROR_MAP_DESC 50 +#define IDS_ERROR_UNMAP 51 +#define IDS_ERROR_UNMAP_DESC 52 +#define IDS_ADDSERVER_TITLE 53 +#define IDS_EDITSERVER_TITLE 54 +#define IDS_SUBCOL_SHARE 55 +#define IDS_SUBCOL_PATH 56 +#define IDS_SUBMOUNTS_TITLE 57 +#define IDS_BADCELL_DESC 58 +#define IDS_BADCELL_DESC2 59 +#define IDS_KB_IN_USE 60 +#define IDS_NOGATEWAY_TITLE 61 +#define IDS_NOGATEWAY_DESC 62 + +#define IDS_NOCELL_DESC 64 +#define IDS_STOPPED_NOCELL 65 +#define IDS_OKSTOP_DESC 66 +#define IDS_BADMAP_DESC 67 +#define IDS_RESTART_TITLE 68 +#define IDS_RESTART_DESC 69 +#define IDS_KB_ONLY 70 +#define IDS_FAILCONFIG_AUTHENT 71 +#define IDS_FAILCONFIG_PREFS 72 +#define IDS_FAILCONFIG_CACHE 73 +#define IDS_FAILCONFIG_PROBE 74 +#define IDS_FAILCONFIG_SYSNAME 75 + #define IDS_BADCELL_DESC_CC2 80 #define IDS_NOCELL_DESC_CC 81 #define IDS_TITLE_CAUTION_CCENTER 82 @@ -80,6 +85,7 @@ #define IDS_YES 85 #define IDS_NO 86 #define IDS_DRIVE 87 + #define IDD_GENERAL_NT 101 #define IDI_MAIN 101 #define IDD_GENERAL_95 102 @@ -105,6 +111,7 @@ #define IDD_LOGIN_CONFIG_PARMS 119 #define IDD_GLOBAL_DRIVES 120 #define IDD_GLOBAL_DRIVES_ADDEDIT 121 +#define IDD_BINDING_CONFIG_PARAMS 122 #define IDC_STATUS 1000 #define IDC_SERVICE_STOP 1001 #define IDC_SERVICE_START 1002 @@ -154,8 +161,9 @@ #define IDC_ADDR_LOOKUP 1049 #define IDC_LOGON_PARMS 1049 #define IDC_TRACE_LOG_BUF_SIZE 1050 -#define IDC_AUTOMAP_PARMS 1050 +#define IDC_AUTOMAP_PARMS 1051 #define IDC_LOGIN_RETRY_INTERVAL 1052 +#define IDC_BINDING_PARMS 1053 #define IDC_TRAP_ON_PANIC 1054 #define IDC_REPORT_SESSION_STARTUPS 1055 #define IDC_FAIL_SILENTLY 1056 @@ -164,7 +172,11 @@ #define IDC_DIAG_PARMS 1060 #define IDC_ROOTVOLUME 1061 #define IDC_AUTOLANA 1062 +#define IDC_DEFAULTNIC 1062 #define IDC_STATICLANA 1063 +#define IDC_STATICSUBMOUNT 1064 +#define IDC_NICSELECTION 1065 +#define IDC_BINDING_MESSAGE 1066 #define IDC_STATIC -1 // Next default values for new objects @@ -173,9 +185,9 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 122 +#define _APS_NEXT_RESOURCE_VALUE 123 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1064 +#define _APS_NEXT_CONTROL_VALUE 1067 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/src/WINNT/client_config/tab_advanced.cpp b/src/WINNT/client_config/tab_advanced.cpp index e1530ebfb..4bd024529 100644 --- a/src/WINNT/client_config/tab_advanced.cpp +++ b/src/WINNT/client_config/tab_advanced.cpp @@ -58,6 +58,9 @@ extern BOOL Logon_OnApply(); extern BOOL CALLBACK Diag_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp); extern BOOL Diag_OnApply(); +// From binding_misc.cpp +extern BOOL Binding_OnApply(); +extern BOOL CALLBACK Binding_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp); /* * ROUTINES ___________________________________________________________________ @@ -109,6 +112,10 @@ BOOL CALLBACK AdvancedTab_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) ModalDialog(IDD_MISC_CONFIG_PARMS, hDlg, (DLGPROC)Misc_DlgProc); break; + case IDC_BINDING_PARMS: + ModalDialog(IDD_BINDING_CONFIG_PARAMS, hDlg, (DLGPROC)Binding_DlgProc); + break; + case IDC_LOGON_PARMS: ModalDialog(IDD_LOGIN_CONFIG_PARMS, hDlg, (DLGPROC)Logon_DlgProc); break; @@ -229,6 +236,9 @@ BOOL AdvancedTab_OnApply (HWND hDlg) if (!Misc_OnApply()) return FALSE; + if (!Binding_OnApply()) + return FALSE; + if (!Logon_OnApply()) return FALSE; diff --git a/src/WINNT/client_config/tab_drives.cpp b/src/WINNT/client_config/tab_drives.cpp index 565e660a1..3ec357f21 100644 --- a/src/WINNT/client_config/tab_drives.cpp +++ b/src/WINNT/client_config/tab_drives.cpp @@ -10,11 +10,12 @@ extern "C" { #include #include +#include } #include "afs_config.h" #include "tab_drives.h" - +#include /* * PROTOTYPES _________________________________________________________________ @@ -154,6 +155,9 @@ void DrivesTab_OnCheck (HWND hDlg) Message (MB_OK | MB_ICONHAND, IDS_ERROR_UNMAP, IDS_ERROR_UNMAP_DESC, TEXT("%08lX"), dwStatus); DrivesTab_FillList (hDlg); } + WriteActiveMap(g.Configuration.NetDrives.aDriveMap[ iDriveSel ].chDrive, fChecked && + g.Configuration.NetDrives.aDriveMap[ iDriveSel ].fPersistent ); + } } @@ -198,6 +202,7 @@ void DrivesTab_OnRemove (HWND hDlg) DrivesTab_FillList (hDlg); } + WriteActiveMap(g.Configuration.NetDrives.aDriveMap[ iDriveSel ].chDrive, FALSE ); } } @@ -350,6 +355,13 @@ void DrivesTab_EditMapping (HWND hDlg, int iDrive) lstrcpy (g.Configuration.NetDrives.aDriveMap[ DriveMap.chDrive-chDRIVE_A ].szMapping, szAfsPathNew); WriteDriveMappings (&g.Configuration.NetDrives); + if (iDrive == -1) { + WriteActiveMap(DriveMap.chDrive, DriveMap.fPersistent); + } else if ( (chDRIVE_A + iDrive) != DriveMap.chDrive ) { + WriteActiveMap(chDRIVE_A+iDrive, FALSE); + WriteActiveMap(DriveMap.chDrive, DriveMap.fPersistent); + } + DrivesTab_FillList (hDlg); } } @@ -393,7 +405,6 @@ BOOL CALLBACK DriveEdit_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) return FALSE; } - void DriveEdit_OnInitDialog (HWND hDlg) { PDRIVEMAP pMap = (PDRIVEMAP)GetWindowLong (hDlg, DWL_USER); @@ -433,7 +444,14 @@ void DriveEdit_OnInitDialog (HWND hDlg) SendMessage (hCombo, CB_SETCURSEL, iItemSel, 0); TCHAR szMapping[ MAX_PATH ]; - AdjustAfsPath (szMapping, ((pMap->szMapping[0]) ? pMap->szMapping : TEXT("/afs")), TRUE, FALSE); + AdjustAfsPath (szMapping, ((pMap->szMapping[0]) ? pMap->szMapping : cm_slash_mount_root), TRUE, FALSE); + + CHAR msg[256], msgf[256]; + if (GetDlgItemText(hDlg,IDC_STATICSUBMOUNT,(LPSTR)msg,sizeof(msg)-1)>0) + { + wsprintf(msgf,msg,cm_back_slash_mount_root,cm_back_slash_mount_root); + SetDlgItemText (hDlg, IDC_STATICSUBMOUNT, msgf); + } SetDlgItemText (hDlg, IDC_PATH, szMapping); SetDlgItemText (hDlg, IDC_DESC, pMap->szSubmount); @@ -461,9 +479,9 @@ void DriveEdit_OnOK (HWND hDlg) return; } - if ( (lstrncmpi (pMap->szMapping, TEXT("/afs"), lstrlen(TEXT("/afs")))) && - (lstrncmpi (pMap->szMapping, TEXT("\\afs"), lstrlen(TEXT("\\afs")))) ) - { + if ( (lstrncmpi (pMap->szMapping, cm_slash_mount_root, lstrlen(cm_slash_mount_root))) && + (lstrncmpi (pMap->szMapping, cm_back_slash_mount_root, lstrlen(cm_back_slash_mount_root))) ) + { Message (MB_ICONHAND, GetErrorTitle(), IDS_BADMAP_DESC); return; } @@ -781,9 +799,16 @@ BOOL CALLBACK SubEdit_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) void SubEdit_OnInitDialog (HWND hDlg) { - PSUBMOUNT pSubmount = (PSUBMOUNT)GetWindowLong (hDlg, DWL_USER); + CHAR msg[256], msgf[256]; + PSUBMOUNT pSubmount = (PSUBMOUNT)GetWindowLong (hDlg, DWL_USER); + if (GetDlgItemText(hDlg,IDC_STATICSUBMOUNT,(LPSTR)msg,sizeof(msg)-1)>0) + { + wsprintf(msgf,msg,cm_back_slash_mount_root,cm_back_slash_mount_root); + SetDlgItemText (hDlg, IDC_STATICSUBMOUNT, msgf); + } SetDlgItemText (hDlg, IDC_SUBMOUNT, pSubmount->szSubmount); + SetDlgItemText (hDlg, IDC_MAPPING, pSubmount->szMapping); } diff --git a/src/WINNT/client_cpa/NTMakefile b/src/WINNT/client_cpa/NTMakefile index e71501c6f..d4c18936e 100644 --- a/src/WINNT/client_cpa/NTMakefile +++ b/src/WINNT/client_cpa/NTMakefile @@ -5,22 +5,23 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=WINNT\client_cpa !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !include ..\..\config\NTMakefile.version - ############################################################################ # Definitions for building afs_cpa.cpl DLLFILE = $(DESTDIR)\root.client\usr\vice\etc\afs_cpa.cpl DLLOBJS =\ - afs_cpa_stub.res \ - cpl_interface.obj \ - AFS_component_version_number.obj + $(OUT)\cpl_interface.obj \ + $(OUT)\AFS_component_version_number.obj \ + $(OUT)\afs_cpa_stub.res DLLLIBS =\ $(DESTDIR)\lib\afs\TaLocale.lib \ + $(DESTDIR)\lib\libosi.lib \ comctl32.lib DEFFILE = afs_cpa.def @@ -61,7 +62,7 @@ clean:: ############################################################################ # Dependencies -afs_cpa_stub.res : afs_cpa_stub.rc AFS_component_version_number.h +$(OUT)\afs_cpa_stub.res : AFS_component_version_number.h en_US: $(CD) lang @@ -103,3 +104,8 @@ de_DE: @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install $(CD) .. +mkdir: + -mkdir $(OUT)\lang + cd lang + nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir + cd .. diff --git a/src/WINNT/client_cpa/lang/NTMakefile b/src/WINNT/client_cpa/lang/NTMakefile index 5dd165dbc..ff6e80e41 100644 --- a/src/WINNT/client_cpa/lang/NTMakefile +++ b/src/WINNT/client_cpa/lang/NTMakefile @@ -10,7 +10,7 @@ AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include -I.. # include the primary makefile - +RELDIR=WINNT\client_cpa\lang !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) !include ..\..\..\config\NTMakefile.version @@ -35,7 +35,7 @@ DLLFILE = $(DESTDIR)\root.client\usr\vice\etc\afs_cpa_$(LANGID).dll RCFILE = $(LANGNAME)\afs_cpa.rc -RESFILE = afs_cpa_$(LANGID).res +RESFILE = $(OUT)\afs_cpa_$(LANGID).res DLLOBJS = $(RESFILE) @@ -48,7 +48,7 @@ $(DLLFILE) : $(DLLOBJS) install : $(DLLFILE) clean :: - $(DEL) *.res RC* RD* $(DLLFILE) $(DEL) $(DLLFILE) + $(DEL) *.res RC* RD* $(DLLFILE) ############################################################################ # @@ -58,3 +58,6 @@ clean :: $(RESFILE) : $(RCFILE) AFS_component_version_number.h $(RC) /fo$(RESFILE) /c$(LANGCP) $(RCFILE) + +mkdir: + diff --git a/src/WINNT/client_cpa/resource.h b/src/WINNT/client_cpa/resource.h index e21b84968..f8af408cf 100644 --- a/src/WINNT/client_cpa/resource.h +++ b/src/WINNT/client_cpa/resource.h @@ -7,12 +7,13 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#define IDS_CPL_NAME_NT 1 -#define IDS_CPL_DESC_NT 2 -#define IDS_CPL_NAME_95 3 -#define IDS_CPL_DESC_95 4 -#define IDS_CPL_NAME_CCENTER 5 -#define IDS_CPL_DESC_CCENTER 6 +#define IDS_CPL_NAME_NT 0 +#define IDS_CPL_DESC_NT 1 +#define IDS_CPL_NAME_95 2 +#define IDS_CPL_DESC_95 3 +#define IDS_CPL_NAME_CCENTER 4 +#define IDS_CPL_DESC_CCENTER 5 + #define IDI_AFSD 103 #define IDI_CCENTER 104 diff --git a/src/WINNT/client_creds/Makefile b/src/WINNT/client_creds/Makefile index 1b213b072..36cfec813 100644 --- a/src/WINNT/client_creds/Makefile +++ b/src/WINNT/client_creds/Makefile @@ -55,7 +55,7 @@ cflags = $(cflags) -DSTRICT guilflags = $(guilflags) -MACHINE:$(CPU) cflags = $(cflags) -Zi -Od -DDEBUG -D_DEBUG -DDBG -lflags = $(lflags) -debug:full -debugtype:both +lflags = $(lflags) -debug:full .rc.res : $(rc) $(rcflags) $(rcvars) $*.rc diff --git a/src/WINNT/client_creds/NTMakefile b/src/WINNT/client_creds/NTMakefile index 98b1f4dad..f577152aa 100644 --- a/src/WINNT/client_creds/NTMakefile +++ b/src/WINNT/client_creds/NTMakefile @@ -5,9 +5,12 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html -AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I ..\afsd +# include the AFSD source tree on our inclusion path + +AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) /D"_AFXDLL" -I..\afsd -I..\client_config -I..\kfw\inc\krb5 # include the primary makefile +RELDIR=WINNT\client_creds !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version @@ -19,34 +22,55 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I ..\afsd EXEFILE = $(DESTDIR)\root.client\usr\vice\etc\afscreds.exe EXEOBJS = \ - afscreds_stub.res \ - advtab.obj \ - afswiz.obj \ - al_wizard.obj \ - checklist.obj \ - creds.obj \ - credstab.obj \ - drivemap.obj \ - fs_utils.obj \ - main.obj \ - misc.obj \ - mounttab.obj \ - settings.obj \ - shortcut.obj \ - subclass.obj \ - trayicon.obj \ - window.obj + $(OUT)\advtab.obj \ + $(OUT)\afswiz.obj \ + $(OUT)\creds.obj \ + $(OUT)\main.obj \ + $(OUT)\misc.obj \ + $(OUT)\credstab.obj \ + $(OUT)\mounttab.obj \ + $(OUT)\settings.obj \ + $(OUT)\shortcut.obj \ + $(OUT)\trayicon.obj \ + $(OUT)\window.obj + +EXECOBJS = \ + $(OUT)\ipaddrchg.obj + +EXERES = \ + $(OUT)\afscreds_stub.res + +AFSDOBJS = \ + $(OUT)\fs_utils.obj + +AFSAPPLIBOBJS= \ + $(OUT)\checklist.obj \ + $(OUT)\al_wizard.obj \ + $(OUT)\subclass.obj + +CLIENTOBJS = \ + $(OUT)\drivemap.obj \ + $(OUT)\RegistrySupport.obj VCLIBS =\ + iphlpapi.lib \ comctl32.lib \ shell32.lib \ uuid.lib \ ole32.lib \ - mpr.lib + mpr.lib \ + netapi32.lib EXELIBS = \ $(DESTDIR)\lib\afs\afspioctl.lib \ - $(DESTDIR)\lib\afs\TaLocale.lib + $(DESTDIR)\lib\libosi.lib \ + $(DESTDIR)\lib\afs\TaLocale.lib \ + $(DESTDIR)\lib\lanahelper.lib \ + $(DESTDIR)\lib\afsrxkad.lib \ + $(DESTDIR)\lib\afsdes.lib \ + $(DESTDIR)\lib\afsauthent.lib \ + $(DESTDIR)\lib\libafsconf.lib \ + $(DESTDIR)\lib\afskfw.lib ############################################################################ # @@ -62,42 +86,34 @@ COPYHEADERS = \ $(DESTDIR)\include\WINNT\checklist.h \ $(DESTDIR)\include\WINNT\subclass.h -COPYSOURCES = \ - .\al_wizard.cpp \ - .\al_wizard.h \ - .\checklist.cpp \ - .\checklist.h \ - .\drivemap.cpp \ - .\drivemap.h \ - .\fs_utils.c \ - .\subclass.cpp \ - .\subclass.h - ############################################################################ -{..\afsd}.c{.\}.c: - $(COPY) ..\afsd\$(*B).c . +AFSD = ..\afsd +AFSAPPLIB=..\afsapplib +CLIENT= ..\client_config -{..\afsapplib}.h{.\}.h: - $(COPY) ..\afsapplib\$(*B).h . +$(CLIENTOBJS): $(CLIENT)\$$(@B).cpp + $(C2OBJ) -I$(*D) $** -{..\afsapplib}.cpp{.\}.cpp: - $(COPY) ..\afsapplib\$(*B).cpp . +$(AFSAPPLIBOBJS): $(AFSAPPLIB)\$$(@B).cpp + $(C2OBJ) -I$(*D) $** -{..\client_config}.h{.\}.h: - $(COPY) ..\client_config\$(*B).h . +$(AFSDOBJS): $(AFSD)\$$(@B).c + $(C2OBJ) -I$(*D) $** -{..\client_config}.cpp{.\}.cpp: - $(COPY) ..\client_config\$(*B).cpp . +$(EXEOBJS): $$(@B).cpp + $(C2OBJ) -I$(*D) -I$(AFSAPPLIB) $** +$(EXECOBJS): $$(@B).c + $(C2OBJ) -I$(*D) -I$(AFSAPPLIB) $** ############################################################################ -$(EXEFILE) : $(EXEOBJS) $(EXELIBS) - $(EXEMFCLINK) $(VCLIBS) +$(EXEFILE) : $(EXEOBJS) $(EXECOBJS) $(EXERES) $(AFSAPPLIBOBJS) $(AFSDOBJS) $(CLIENTOBJS) $(EXELIBS) + $(EXEGUILINK) $(VCLIBS) $(EXEPREP) -install : $(COPYSOURCES) $(COPYHEADERS) $(EXEFILE) lang +install : $(COPYHEADERS) $(EXEFILE) lang lang :: $(CD) lang @@ -109,5 +125,11 @@ lang :: # Dependencies # -afscreds_stub.res : afscreds_stub.rc AFS_component_version_number.h +$(OUT)\afscreds_stub.res : afscreds_stub.rc AFS_component_version_number.h + +mkdir: + -mkdir $(OUT)\lang + cd lang + nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir + cd .. diff --git a/src/WINNT/client_creds/advtab.cpp b/src/WINNT/client_creds/advtab.cpp index 760fc1d32..108972b20 100644 --- a/src/WINNT/client_creds/advtab.cpp +++ b/src/WINNT/client_creds/advtab.cpp @@ -13,7 +13,9 @@ extern "C" { } #include "afscreds.h" - +#ifdef USE_KFW +#include "afskrb5.h" +#endif /* * PROTOTYPES _________________________________________________________________ @@ -177,44 +179,67 @@ void Advanced_OnChangeService (HWND hDlg, WORD wCmd) { BOOL fSuccess = FALSE; ULONG error = 0; - - SC_HANDLE hManager; - if ((hManager = OpenSCManager (NULL, NULL, SC_MANAGER_ALL_ACCESS)) != NULL) - { - SC_HANDLE hService; - if ((hService = OpenService (hManager, TEXT("TransarcAFSDaemon"), SERVICE_ALL_ACCESS)) != NULL) - { - switch (wCmd) + SC_HANDLE hManager, hService; + + switch (wCmd) + { + case IDC_SERVICE_AUTO: + DWORD StartType; + if ((hManager = OpenSCManager (NULL, NULL, SC_MANAGER_CONNECT | + SC_MANAGER_ENUMERATE_SERVICE | + SC_MANAGER_QUERY_LOCK_STATUS)) != NULL) + { + if ((hService = OpenService (hManager, TEXT("TransarcAFSDaemon"), + SERVICE_CHANGE_CONFIG | SERVICE_QUERY_CONFIG | + SERVICE_QUERY_STATUS)) != NULL) { - case IDC_SERVICE_AUTO: - DWORD StartType; - StartType = (IsDlgButtonChecked (hDlg, wCmd)) ? SERVICE_AUTO_START : SERVICE_DEMAND_START; - - if (ChangeServiceConfig (hService, SERVICE_NO_CHANGE, StartType, SERVICE_NO_CHANGE, 0, 0, 0, 0, 0, 0, 0)) - fSuccess = TRUE; - break; - - case IDC_SERVICE_START: - if (StartService (hService, 0, 0)) - { - TestAndDoMapShare(SERVICE_START_PENDING); - fSuccess = TRUE; - } - break; - - case IDC_SERVICE_STOP: - SERVICE_STATUS Status; - TestAndDoUnMapShare(); - ControlService (hService, SERVICE_CONTROL_STOP, &Status); - fSuccess = TRUE; - break; + StartType = (IsDlgButtonChecked (hDlg, wCmd)) ? SERVICE_AUTO_START : SERVICE_DEMAND_START; + if (ChangeServiceConfig (hService, SERVICE_NO_CHANGE, StartType, + SERVICE_NO_CHANGE, 0, 0, 0, 0, 0, 0, 0)) + fSuccess = TRUE; + CloseServiceHandle (hService); } - - CloseServiceHandle (hService); - } - - CloseServiceHandle (hManager); - } + CloseServiceHandle (hManager); + } + break; + + case IDC_SERVICE_START: + if ((hManager = OpenSCManager (NULL, NULL, SC_MANAGER_CONNECT | + SC_MANAGER_ENUMERATE_SERVICE | + SC_MANAGER_QUERY_LOCK_STATUS )) != NULL) + { + if ((hService = OpenService (hManager, TEXT("TransarcAFSDaemon"), + SERVICE_QUERY_STATUS | SERVICE_START)) != NULL) + { + if (StartService (hService, 0, 0)) + { + TestAndDoMapShare(SERVICE_START_PENDING); + fSuccess = TRUE; + } + CloseServiceHandle (hService); + } + CloseServiceHandle (hManager); + } + break; + + case IDC_SERVICE_STOP: + if ((hManager = OpenSCManager (NULL, NULL, SC_MANAGER_CONNECT | + SC_MANAGER_ENUMERATE_SERVICE | + SC_MANAGER_QUERY_LOCK_STATUS )) != NULL) + { + if ((hService = OpenService (hManager, TEXT("TransarcAFSDaemon"), + SERVICE_QUERY_STATUS | SERVICE_STOP)) != NULL) + { + SERVICE_STATUS Status; + TestAndDoUnMapShare(); + ControlService (hService, SERVICE_CONTROL_STOP, &Status); + fSuccess = TRUE; + } + CloseServiceHandle (hService); + } + CloseServiceHandle (hManager); + break; + } if (fSuccess) { @@ -222,6 +247,10 @@ void Advanced_OnChangeService (HWND hDlg, WORD wCmd) SetWindowLong (hDlg, DWL_USER, TRUE); Advanced_OnServiceTimer (hDlg); Advanced_StartTimer (hDlg); +#ifdef USE_KFW + if ( wCmd == IDC_SERVICE_START && KRB5_is_available() && KRB5_wait_for_service_start() ) + KRB5_AFS_renew_tokens_for_all_cells(); +#endif /* USE_KFW */ } else { diff --git a/src/WINNT/client_creds/afscreds.h b/src/WINNT/client_creds/afscreds.h index 14e51a8c7..524457e40 100644 --- a/src/WINNT/client_creds/afscreds.h +++ b/src/WINNT/client_creds/afscreds.h @@ -17,12 +17,23 @@ */ #include +#undef REALLOC /* RT ticket 2120; So we can redefine it later */ #include #include #include #include #include #include +#ifdef __cplusplus +extern "C" { +#endif +#include +#include +#include +#include +#ifdef __cplusplus +} +#endif #include "resource.h" #include "checklist.h" #include "window.h" @@ -42,9 +53,10 @@ * */ -#define REGSTR_BASE HKEY_LOCAL_MACHINE #define REGSTR_PATH_AFS TEXT("Software\\TransarcCorporation\\AFS Client\\CurrentVersion") #define REGSTR_PATH_AFSCREDS TEXT("Software\\TransarcCorporation\\AFS Client\\AfsCreds") +#define REGSTR_PATH_OPENAFS_CLIENT TEXT("SOFTWARE\\OpenAFS\\Client") +#define REGSTR_PATH_OPENAFS_CLIENT_REMIND TEXT("SOFTWARE\\OpenAFS\\Client\\Reminders") #define REGVAL_AFS_TITLE TEXT("Title") #define REGVAL_AFS_VERSION TEXT("VersionString") @@ -53,6 +65,7 @@ #define cszSHORTCUT_NAME TEXT("AFS Credentials.lnk") +#define AFSCREDS_SHORTCUT_OPTIONS TEXT("-A -M -N -Q") /* * VARIABLES __________________________________________________________________ @@ -78,6 +91,9 @@ typedef struct BOOL fStartup; BOOL fIsWinNT; TCHAR szHelpFile[ MAX_PATH ]; + osi_mutex_t expirationCheckLock; + osi_mutex_t credsLock; + TCHAR SmbName[ MAXRANDOMNAMELEN ]; } GLOBALS; extern GLOBALS g; @@ -88,8 +104,10 @@ extern GLOBALS g; * */ -#define cminREMIND_TEST 3 // test every minute for expired creds +#define cminREMIND_TEST 1 // test every minute for expired creds #define cminREMIND_WARN 15 // warn if creds expire in 15 minutes +#define cminRENEW 20 // renew creds when there are 20 minutes remaining +#define cminMINLIFE 30 // minimum life of Kerberos creds #define cmsecMOUSEOVER 1000 // retest freq when mouse is over tray icon #define cmsecSERVICE 2000 // retest freq when starting/stopping service diff --git a/src/WINNT/client_creds/afswiz.cpp b/src/WINNT/client_creds/afswiz.cpp index b3d7fce4a..43390d591 100644 --- a/src/WINNT/client_creds/afswiz.cpp +++ b/src/WINNT/client_creds/afswiz.cpp @@ -10,6 +10,7 @@ extern "C" { #include #include +#include } #include "afscreds.h" @@ -74,12 +75,12 @@ typedef enum } WIZSTEP; static WIZARD_STATE aStates[] = { - { STEP_START, IDD_WIZ_START, WizStart_DlgProc }, - { STEP_STARTING, IDD_WIZ_STARTING, WizStarting_DlgProc }, - { STEP_CREDS, IDD_WIZ_CREDS, WizCreds_DlgProc }, - { STEP_MOUNT, IDD_WIZ_MOUNT, WizMount_DlgProc }, - { STEP_MOUNTING, IDD_WIZ_MOUNTING, WizMounting_DlgProc }, - { STEP_FINISH, IDD_WIZ_FINISH, WizFinish_DlgProc }, + { STEP_START, IDD_WIZ_START, WizStart_DlgProc, 0 }, + { STEP_STARTING, IDD_WIZ_STARTING, WizStarting_DlgProc, 0 }, + { STEP_CREDS, IDD_WIZ_CREDS, WizCreds_DlgProc, 0 }, + { STEP_MOUNT, IDD_WIZ_MOUNT, WizMount_DlgProc, 0 }, + { STEP_MOUNTING, IDD_WIZ_MOUNTING, WizMounting_DlgProc, 0 }, + { STEP_FINISH, IDD_WIZ_FINISH, WizFinish_DlgProc, 0 } }; static const int cStates = sizeof(aStates) / sizeof(aStates[0]); @@ -220,10 +221,14 @@ void WizStarting_OnInitDialog (HWND hDlg) ShowWindow (GetDlgItem (hDlg, IDC_START_TRY), SW_SHOW); SC_HANDLE hManager; - if ((hManager = OpenSCManager (NULL, NULL, SC_MANAGER_ALL_ACCESS)) != NULL) + if ((hManager = OpenSCManager (NULL, NULL, + SC_MANAGER_CONNECT | + SC_MANAGER_ENUMERATE_SERVICE | + SC_MANAGER_QUERY_LOCK_STATUS)) != NULL) { SC_HANDLE hService; - if ((hService = OpenService (hManager, TEXT("TransarcAFSDaemon"), SERVICE_ALL_ACCESS)) != NULL) + if ((hService = OpenService (hManager, TEXT("TransarcAFSDaemon"), + SERVICE_QUERY_STATUS | SERVICE_START)) != NULL) { if (StartService (hService, 0, 0)) TestAndDoMapShare(SERVICE_START_PENDING); @@ -308,7 +313,7 @@ BOOL CALLBACK WizCreds_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) WizCreds_OnEnable (hDlg, FALSE); - if (ObtainNewCredentials (szCell, szUser, szPassword) == 0) + if (ObtainNewCredentials (szCell, szUser, szPassword, FALSE) == 0) { g.pWizard->SetState (STEP_MOUNT); } @@ -495,7 +500,7 @@ void WizMount_OnInitDialog (HWND hDlg) SendMessage (hCombo, WM_SETREDRAW, TRUE, 0); SendMessage (hCombo, CB_SETCURSEL, iItemSel, 0); - SetDlgItemText (hDlg, IDC_MAP_PATH, TEXT("/afs")); + SetDlgItemText (hDlg, IDC_MAP_PATH, cm_slash_mount_root); CheckDlgButton (hDlg, IDC_NOMAP, FALSE); CheckDlgButton (hDlg, IDC_YESMAP, TRUE); diff --git a/src/WINNT/client_creds/creds.cpp b/src/WINNT/client_creds/creds.cpp index 0f3956c35..59cca63b1 100644 --- a/src/WINNT/client_creds/creds.cpp +++ b/src/WINNT/client_creds/creds.cpp @@ -7,16 +7,19 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "afscreds.h" - extern "C" { #include #include #include #include +#include #include +#include +#include "ipaddrchg.h" } +#include "afscreds.h" + /* * DEFINITIONS ________________________________________________________________ @@ -43,6 +46,7 @@ extern "C" { typedef int (*ktc_ForgetToken_t)(struct ktc_principal *server); typedef int (*ka_UserAuthenticateGeneral_t)(int flags, char *name, char *instance, char *realm, char *password, int lifetime, int *password_expiresP, int spare, char **reasonP); typedef long (*cm_GetRootCellName_t)(char *namep); + typedef int (*ka_ParseLoginName_t)(char *login, char *name, char *inst, char *cell); } static struct l @@ -57,6 +61,7 @@ static struct l ktc_ListTokens_t ktc_ListTokensP; ktc_ForgetToken_t ktc_ForgetTokenP; ka_UserAuthenticateGeneral_t ka_UserAuthenticateGeneralP; + ka_ParseLoginName_t ka_ParseLoginNameP; cm_GetRootCellName_t cm_GetRootCellNameP; } l; @@ -82,6 +87,7 @@ BOOL Creds_OpenLibraries (void) l.ktc_GetTokenP = (ktc_GetToken_t)GetProcAddress (l.hInstLibTokens, "ktc_GetToken"); l.ktc_ListTokensP = (ktc_ListTokens_t)GetProcAddress (l.hInstLibTokens, "ktc_ListTokens"); l.ktc_ForgetTokenP = (ktc_ForgetToken_t)GetProcAddress (l.hInstLibTokens, "ktc_ForgetToken"); + l.ka_ParseLoginNameP = (ka_ParseLoginName_t)GetProcAddress (l.hInstLibTokens, "ka_ParseLoginName"); l.ka_UserAuthenticateGeneralP = (ka_UserAuthenticateGeneral_t)GetProcAddress (l.hInstLibTokens, "ka_UserAuthenticateGeneral"); if (!l.initAFSDirPathP || @@ -90,6 +96,7 @@ BOOL Creds_OpenLibraries (void) !l.ktc_GetTokenP || !l.ktc_ListTokensP || !l.ktc_ForgetTokenP || + !l.ka_ParseLoginNameP || !l.ka_UserAuthenticateGeneralP) { FreeLibrary (l.hInstLibTokens); @@ -177,10 +184,12 @@ BOOL IsServiceRunning (void) { QueryServiceStatus (hService, &Status); CloseServiceHandle (hService); - } + } else if ( IsDebuggerPresent() ) + OutputDebugString("Unable to open Transarc AFS Daemon Service\n"); CloseServiceHandle (hManager); - } + } else if ( IsDebuggerPresent() ) + OutputDebugString("Unable to open SC Manager\n"); return (Status.dwCurrentState == SERVICE_RUNNING); } @@ -251,6 +260,8 @@ int GetCurrentCredentials (void) { int rc = KTC_NOCM; + lock_ObtainMutex(&g.credsLock); + // Free any knowledge we currently have about the user's credentials // if (g.aCreds) @@ -324,6 +335,8 @@ int GetCurrentCredentials (void) } } + lock_ReleaseMutex(&g.credsLock); + // We've finished updating g.aCreds. Update the tray icon to reflect // whether the user currently has any credentials at all, and // re-enable the Remind timer. @@ -348,6 +361,8 @@ int DestroyCurrentCredentials (LPCTSTR pszCell) CopyStringToAnsi (Principal.cell, pszCell); CopyStringToAnsi (Principal.name, TEXT("afs")); rc = ktc_ForgetToken (&Principal); + if ( KFW_is_available() ) + KFW_AFS_destroy_tickets_for_cell(Principal.cell); } if (rc != 0) @@ -361,7 +376,7 @@ int DestroyCurrentCredentials (LPCTSTR pszCell) } -int ObtainNewCredentials (LPCTSTR pszCell, LPCTSTR pszUser, LPCTSTR pszPassword) +int ObtainNewCredentials (LPCTSTR pszCell, LPCTSTR pszUser, LPCTSTR pszPassword, BOOL Silent) { int rc = KTC_NOCM; char *Result = NULL; @@ -381,12 +396,35 @@ int ObtainNewCredentials (LPCTSTR pszCell, LPCTSTR pszUser, LPCTSTR pszPassword) char szPasswordA[ 256 ]; CopyStringToAnsi (szPasswordA, pszPassword); - int Expiration = 0; + char szSmbNameA[ MAXRANDOMNAMELEN ]; + CopyStringToAnsi (szSmbNameA, g.SmbName); - rc = ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION, szNameA, "", szCellA, szPasswordA, 0, &Expiration, 0, &Result); - } + int Expiration = 0; - if (rc != 0) + if ( KFW_is_available() ) { + // KFW_AFS_get_cred() parses the szNameA field as complete princial including potentially + // a different realm then the specified cell name. + rc = KFW_AFS_get_cred(szNameA, szCellA, szPasswordA, 0, szSmbNameA[0] ? szSmbNameA : NULL, &Result); + } else { + char name[sizeof(szNameA)]; + char instance[sizeof(szNameA)]; + char cell[sizeof(szNameA)]; + + name[0] = '\0'; + instance[0] = '\0'; + cell[0] = '\0'; + ka_ParseLoginName(szNameA, name, instance, cell); + + if ( szSmbNameA[0] ) { + rc = ka_UserAuthenticateGeneral2(KA_USERAUTH_VERSION+KA_USERAUTH_AUTHENT_LOGON, + name, instance, szCellA, szPasswordA, szSmbNameA, 0, &Expiration, 0, &Result); + } else { + rc = ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION, name, instance, szCellA, szPasswordA, 0, &Expiration, 0, &Result); + } + } + } + + if (!Silent && rc != 0) { int idsTitle = (g.fIsWinNT) ? IDS_ERROR_TITLE : IDS_ERROR_TITLE_95; int idsDesc = (g.fIsWinNT) ? IDS_ERROR_OBTAIN : IDS_ERROR_OBTAIN_95; diff --git a/src/WINNT/client_creds/creds.h b/src/WINNT/client_creds/creds.h index 5d42ad7e1..f1ea6aeb3 100644 --- a/src/WINNT/client_creds/creds.h +++ b/src/WINNT/client_creds/creds.h @@ -10,6 +10,9 @@ #ifndef CREDS_H #define CREDS_H +#ifdef __cplusplus +extern "C" { +#endif /* * PROTOTYPES _________________________________________________________________ @@ -24,7 +27,7 @@ int GetCurrentCredentials (void); int DestroyCurrentCredentials (LPCTSTR pszCell); -int ObtainNewCredentials (LPCTSTR pszCell, LPCTSTR pszUser, LPCTSTR pszPassword); +int ObtainNewCredentials (LPCTSTR pszCell, LPCTSTR pszUser, LPCTSTR pszPassword, BOOL Silent); int GetDefaultCell (LPTSTR pszCell); @@ -33,6 +36,8 @@ void GetGatewayName (LPTSTR pszGateway); BOOL Creds_OpenLibraries (void); void Creds_CloseLibraries (void); - +#ifdef __cplusplus +} +#endif #endif diff --git a/src/WINNT/client_creds/credstab.cpp b/src/WINNT/client_creds/credstab.cpp index dbcfe8241..f6bfc444c 100644 --- a/src/WINNT/client_creds/credstab.cpp +++ b/src/WINNT/client_creds/credstab.cpp @@ -89,6 +89,7 @@ BOOL CALLBACK Creds_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) void Creds_OnCheckRemind (HWND hDlg) { LPTSTR pszCell = (LPTSTR)GetWindowLong (hDlg, DWL_USER); + lock_ObtainMutex(&g.credsLock); for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds) { if (!lstrcmpi (g.aCreds[ iCreds ].szCell, pszCell)) @@ -100,6 +101,7 @@ void Creds_OnCheckRemind (HWND hDlg) g.aCreds[ iCreds ].fRemind = IsDlgButtonChecked (hDlg, IDC_CREDS_REMIND); SaveRemind (iCreds); } + lock_ReleaseMutex(&g.credsLock); } @@ -115,6 +117,7 @@ void Creds_OnUpdate (HWND hDlg) return; } + lock_ObtainMutex(&g.credsLock); for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds) { if (!lstrcmpi (g.aCreds[ iCreds ].szCell, pszCell)) @@ -162,6 +165,7 @@ void Creds_OnUpdate (HWND hDlg) FreeString (pszCreds); } + lock_ReleaseMutex(&g.credsLock); CheckDlgButton (hDlg, IDC_CREDS_REMIND, (iCreds == g.cCreds) ? FALSE : g.aCreds[iCreds].fRemind); EnableWindow (GetDlgItem (hDlg, IDC_CREDS_OBTAIN), IsServiceRunning()); @@ -191,18 +195,41 @@ void Creds_OnClickDestroy (HWND hDlg) } -void ShowObtainCreds (BOOL fExpiring, LPTSTR pszCell) +struct _obtaincreds { + DWORD type; + HWND parent; + char * cell; +}; + +void ObtainCredsThread(void * data) { - HWND hParent = (IsWindowVisible (g.hMain)) ? g.hMain : NULL; + struct _obtaincreds * oc = (struct _obtaincreds *)data; - if (fExpiring) - { - ModalDialogParam (IDD_NEWCREDS_EXPIRE, hParent, (DLGPROC)NewCreds_DlgProc, (LPARAM)pszCell); - } - else // (!fExpiring) - { - ModalDialogParam (IDD_NEWCREDS, hParent, (DLGPROC)NewCreds_DlgProc, (LPARAM)pszCell); - } + ModalDialogParam (oc->type, oc->parent, (DLGPROC)NewCreds_DlgProc, (LPARAM)oc->cell); + free(oc->cell); + free(oc); +} + +void ShowObtainCreds (BOOL fExpiring, LPTSTR pszCell) +{ + struct _obtaincreds * oc = (struct _obtaincreds *)malloc(sizeof(struct _obtaincreds)); + if ( !oc ) + return; + oc->parent = (IsWindowVisible (g.hMain)) ? g.hMain : NULL; + oc->type = fExpiring ? IDD_NEWCREDS_EXPIRE : IDD_NEWCREDS; + oc->cell = _strdup(pszCell); + + HANDLE thread = 0; + ULONG threadID = 123; + + thread = CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)ObtainCredsThread, + oc, 0, &threadID); + if (thread != NULL) + CloseHandle(thread); + else { + free(oc->cell); + free(oc); + } } @@ -217,7 +244,6 @@ BOOL CALLBACK NewCreds_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) case WM_DESTROY: InterlockedDecrement (&g.fShowingMessage); - Main_EnableRemindTimer (TRUE); break; case WM_COMMAND: @@ -278,6 +304,7 @@ void NewCreds_OnInitDialog (HWND hDlg) SetDlgItemText (hDlg, IDC_NEWCREDS_CELL, szCell); } + lock_ObtainMutex(&g.credsLock); for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds) { if (*pszCell && !lstrcmpi (g.aCreds[ iCreds ].szCell, pszCell)) @@ -292,8 +319,10 @@ void NewCreds_OnInitDialog (HWND hDlg) SetDlgItemText (hDlg, IDC_NEWCREDS_USER, g.aCreds[ iCreds ].szUser); PostMessage (hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem (hDlg, IDC_NEWCREDS_PASSWORD), TRUE); } + lock_ReleaseMutex(&g.credsLock); NewCreds_OnEnable (hDlg); + SetForegroundWindow(hDlg); KillTimer (g.hMain, ID_SERVICE_TIMER); } @@ -328,7 +357,7 @@ BOOL NewCreds_OnOK (HWND hDlg) GetDlgItemText (hDlg, IDC_NEWCREDS_PASSWORD, szPassword, cchRESOURCE); int rc; - if ((rc = ObtainNewCredentials (szCell, szUser, szPassword)) != 0) + if ((rc = ObtainNewCredentials (szCell, szUser, szPassword, FALSE)) != 0) { EnableWindow (GetDlgItem (hDlg, IDOK), TRUE); EnableWindow (GetDlgItem (hDlg, IDCANCEL), TRUE); @@ -345,9 +374,21 @@ BOOL NewCreds_OnOK (HWND hDlg) void NewCreds_OnCancel (HWND hDlg) { - LPTSTR pszCell = (LPTSTR)GetWindowLong (hDlg, DWL_USER); + TCHAR szText[ cchRESOURCE ] = ""; + LPTSTR pszCell = NULL; + + if (GetDlgItem (hDlg, IDC_NEWCREDS_CELL)) + { + GetDlgItemText (hDlg, IDC_NEWCREDS_CELL, szText, cchRESOURCE); + if ( szText[0] ) + pszCell = szText; + } + + if ( !pszCell ) + pszCell = (LPTSTR)GetWindowLong (hDlg, DWL_USER); if (pszCell) { + lock_ObtainMutex(&g.credsLock); for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds) { if (!lstrcmpi (g.aCreds[ iCreds ].szCell, pszCell)) @@ -367,6 +408,7 @@ void NewCreds_OnCancel (HWND hDlg) } } } + lock_ReleaseMutex(&g.credsLock); } } diff --git a/src/WINNT/client_creds/ipaddrchg.c b/src/WINNT/client_creds/ipaddrchg.c new file mode 100644 index 000000000..d1a45a723 --- /dev/null +++ b/src/WINNT/client_creds/ipaddrchg.c @@ -0,0 +1,515 @@ +/* + * Copyright (c) 2003 SkyRope, LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - 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. + * - Neither the name of Skyrope, LLC nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission from Skyrope, LLC. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER + * 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. + * + * Portions of this code are derived from portions of the MIT + * Leash Ticket Manager and LoadFuncs utilities. For these portions the + * following copyright applies. + * + * Copyright (c) 2003,2004 by the Massachusetts Institute of Technology. + * All rights reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + */ + +// IP Change Monitoring Functions + +#include +#include +#include +#include +#include + +#define USE_MS2MIT +#define USE_KRB4 +#include +#include +#include +#include +#include "ipaddrchg.h" +#include "creds.h" +#include +#include + +#define MAXCELLCHARS 64 + +#ifdef USE_FSPROBE +// Cell Accessibility Functions +// based on work originally submitted to the CMU Computer Club +// by Jeffrey Hutzelman +// +// These would work great if the fsProbe interface had been +// ported to Windows + +static +void probeComplete() +{ + fsprobe_Cleanup(1); + rx_Finalize(); +} + +struct ping_params { + unsigned short port; // in + int retry_delay; // in seconds + int verbose; // in + struct { + int wait; // in seconds + int retry; // in attempts + } host; + int max_hosts; // in + int hosts_attempted; // out +} + +// the fsHandler is where we receive the answer to the probe +static +int fsHandler(void) +{ + ping_count = fsprobe_Results.probeNum; + if (!*fsprobe_Results.probeOK) + { + ok_count++; + if (waiting) complete(); + } + if (ping_count == retry) + complete(); + return 0; +} + +// ping_fs is a callback routine meant to be called from within +// cm_SearchCellFile() or cm_SearchCellDNS() +static long +pingFS(void *ping_params, struct sockaddr_in *addrp, char *namep) +{ + int rc; + struct ping_params * pp = (struct ping_params *) ping_params; + + if ( pp->max_hosts && pp->hosts_attempted >= pp->max_hosts ) + return 0; + + pp->hosts_attempted++; + + if (pp->port && addrp->sin_port != htons(pp->port)) + addrp->sin_port = htons(pp->port); + + rc = fsprobe_Init(1, addrp, pp->retry_delay, fsHandler, pp->verbose); + if (rc) + { + fprintf(stderr, "fsprobe_Init failed (%d)\n", rc); + fsprobe_Cleanup(1); + return 0; + } + + for (;;) + { + tv.tv_sec = pp->host.wait; + tv.tv_usec = 0; + if (IOMGR_Select(0, 0, 0, 0, &tv)) + break; + } + probeComplete(); + return(0); +} + + +static BOOL +pingCell(char *cell) +{ + int rc; + char rootcell[MAXCELLCHARS+1]; + char newcell[MAXCELLCHARS+1]; + struct ping_params pp; + + memset(&pp, 0, sizeof(struct ping_params)); + + if (!cell || strlen(cell) == 0) { + /* WIN32 NOTE: no way to get max chars */ + if (rc = pcm_GetRootCellName(rootcell)) + return(FALSE); + cell = rootcell; + } + + pp.port = 7000; // AFS FileServer + pp.retry_delay = 10; + pp.max_hosts = 3; + pp.host.wait = 30; + pp.host.retry = 0; + pp.verbose = 1; + + /* WIN32: cm_SearchCellFile(cell, pcallback, pdata) */ + rc = pcm_SearchCellFile(cell, newcell, pingFS, (void *)&pp); +} +#endif /* USE_FSPROBE */ + +// These two items are imported from afscreds.h +// but it cannot be included without causing conflicts +#define c100ns1SECOND (LONGLONG)10000000 +static void +TimeToSystemTime (SYSTEMTIME *pst, time_t TimeT) +{ + struct tm *pTime; + memset (pst, 0x00, sizeof(SYSTEMTIME)); + + if ((pTime = localtime (&TimeT)) != NULL) + { + pst->wYear = pTime->tm_year + 1900; + pst->wMonth = pTime->tm_mon + 1; + pst->wDayOfWeek = pTime->tm_wday; + pst->wDay = pTime->tm_mday; + pst->wHour = pTime->tm_hour; + pst->wMinute = pTime->tm_min; + pst->wSecond = pTime->tm_sec; + pst->wMilliseconds = 0; + } +} + +static DWORD +GetServiceStatus( + LPSTR lpszMachineName, + LPSTR lpszServiceName, + DWORD *lpdwCurrentState) +{ + DWORD hr = NOERROR; + SC_HANDLE schSCManager = NULL; + SC_HANDLE schService = NULL; + DWORD fdwDesiredAccess = 0; + SERVICE_STATUS ssServiceStatus = {0}; + BOOL fRet = FALSE; + + *lpdwCurrentState = 0; + + fdwDesiredAccess = GENERIC_READ; + + schSCManager = OpenSCManager(lpszMachineName, + NULL, + fdwDesiredAccess); + + if(schSCManager == NULL) + { + hr = GetLastError(); + goto cleanup; + } + + schService = OpenService(schSCManager, + lpszServiceName, + fdwDesiredAccess); + + if(schService == NULL) + { + hr = GetLastError(); + goto cleanup; + } + + fRet = QueryServiceStatus(schService, + &ssServiceStatus); + + if(fRet == FALSE) + { + hr = GetLastError(); + goto cleanup; + } + + *lpdwCurrentState = ssServiceStatus.dwCurrentState; + +cleanup: + + CloseServiceHandle(schService); + CloseServiceHandle(schSCManager); + + return(hr); +} + +void +ObtainTokensFromUserIfNeeded(HWND hWnd) +{ + char * rootcell = NULL; + char cell[MAXCELLCHARS+1] = ""; + char password[PROBE_PASSWORD_LEN+1]; + struct afsconf_cell cellconfig; + struct ktc_principal aserver; + struct ktc_principal aclient; + struct ktc_token atoken; + krb5_timestamp now = 0; + BOOL serverReachable = 0; + int rc; + DWORD CurrentState, code; + char HostName[64]; + int use_kfw = KFW_is_available(); + + SYSTEMTIME stNow; + FILETIME ftNow; + LONGLONG llNow; + FILETIME ftExpires; + LONGLONG llExpires; + SYSTEMTIME stExpires; + + CurrentState = 0; + memset(HostName, '\0', sizeof(HostName)); + gethostname(HostName, sizeof(HostName)); + if (GetServiceStatus(HostName, TRANSARCAFSDAEMON, &CurrentState) != NOERROR) + return; + if (CurrentState != SERVICE_RUNNING) { + SendMessage(hWnd, WM_START_SERVICE, FALSE, 0L); + return; + } + + rootcell = (char *)GlobalAlloc(GPTR,MAXCELLCHARS+1); + if ( !rootcell ) goto cleanup; + + code = KFW_AFS_get_cellconfig(cell, (void*)&cellconfig, rootcell); + if ( code ) goto cleanup; + + memset(&aserver, '\0', sizeof(aserver)); + strcpy(aserver.name, "afs"); + strcpy(aserver.cell, rootcell); + + rc = ktc_GetToken(&aserver, &atoken, sizeof(atoken), &aclient); + + GetLocalTime (&stNow); + SystemTimeToFileTime (&stNow, &ftNow); + llNow = (((LONGLONG)ftNow.dwHighDateTime) << 32) + (LONGLONG)(ftNow.dwLowDateTime); + llNow /= c100ns1SECOND; + + TimeToSystemTime (&stExpires, atoken.endTime); + SystemTimeToFileTime (&stExpires, &ftExpires); + llExpires = (((LONGLONG)ftExpires.dwHighDateTime) << 32) + (LONGLONG)(ftExpires.dwLowDateTime); + llExpires /= c100ns1SECOND; + + if (!rc && (llNow < llExpires)) + goto cleanup; + + if ( IsDebuggerPresent() ) { + char message[256]; + sprintf(message,"ObtainTokensFromUserIfNeeded: %d now = %ul endTime = %ul\n", + rc, llNow, llExpires); + OutputDebugString(message); + } + +#ifdef USE_FSPROBE + serverReachable = cellPing(NULL); +#else + if ( use_kfw ) { + // If we can't use the FSProbe interface we can attempt to forge + // a kinit and if we can back an invalid user error we know the + // kdc is at least reachable + serverReachable = KFW_probe_kdc(&cellconfig); + } else { + int i; + + for ( i=0 ; idwNumEntries; index++ ) { + if (pIpAddrTable->table[index].dwAddr != 0) + validAddrs++; + } + } + free(pIpAddrTable); + } + return validAddrs; +} + +void +IpAddrChangeMonitor(void * hWnd) +{ +#ifdef USE_OVERLAPPED + HANDLE Handle = INVALID_HANDLE_VALUE; /* Do Not Close This Handle */ + OVERLAPPED Ovlap; +#endif /* USE_OVERLAPPED */ + DWORD Result; + DWORD prevNumOfAddrs = GetNumOfIpAddrs(); + DWORD NumOfAddrs; + char message[256]; + + if ( !hWnd ) + return; + + while ( TRUE ) { +#ifdef USE_OVERLAPPED + ZeroMemory(&Ovlap, sizeof(OVERLAPPED)); + + Result = NotifyAddrChange(&Handle,&Ovlap); + if (Result != ERROR_IO_PENDING) + { + if ( IsDebuggerPresent() ) { + sprintf(message, "NotifyAddrChange() failed with error %d \n", Result); + OutputDebugString(message); + } + break; + } + + if ((Result = WaitForSingleObject(Handle,INFINITE)) != WAIT_OBJECT_0) + { + if ( IsDebuggerPresent() ) { + sprintf(message, "WaitForSingleObject() failed with error %d\n", + GetLastError()); + OutputDebugString(message); + } + continue; + } + + if (GetOverlappedResult(Handle, &Ovlap, + &DataTransfered, TRUE) == 0) + { + if ( IsDebuggerPresent() ) { + sprintf(message, "GetOverlapped result failed %d \n", + GetLastError()); + OutputDebugString(message); + } + break; + } +#else + Result = NotifyAddrChange(NULL,NULL); + if (Result != NO_ERROR) + { + if ( IsDebuggerPresent() ) { + sprintf(message, "NotifyAddrChange() failed with error %d \n", Result); + OutputDebugString(message); + } + break; + } +#endif + + NumOfAddrs = GetNumOfIpAddrs(); + + if ( IsDebuggerPresent() ) { + sprintf(message,"IPAddrChangeMonitor() NumOfAddrs: now %d was %d\n", + NumOfAddrs, prevNumOfAddrs); + OutputDebugString(message); + } + + if ( NumOfAddrs != prevNumOfAddrs ) { + // Give AFS Client Service a chance to notice and die + // Or for network services to startup + Sleep(2000); + // this call should probably be mutex protected + ObtainTokensFromUserIfNeeded(hWnd); + } + prevNumOfAddrs = NumOfAddrs; + } +} + + +DWORD +IpAddrChangeMonitorInit(HWND hWnd) +{ + DWORD status = ERROR_SUCCESS; + HANDLE thread; + ULONG threadID = 0; + + thread = CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)IpAddrChangeMonitor, + hWnd, 0, &threadID); + + if (thread == NULL) { + status = GetLastError(); + } + CloseHandle(thread); + return status; +} + diff --git a/src/WINNT/client_creds/ipaddrchg.h b/src/WINNT/client_creds/ipaddrchg.h new file mode 100644 index 000000000..09e506b54 --- /dev/null +++ b/src/WINNT/client_creds/ipaddrchg.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2003 SkyRope, LLC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - 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. + * - Neither the name of Skyrope, LLC nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission from Skyrope, LLC. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER + * 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. + * + */ + +#ifndef IPADDRCHG_H +#define IPADDRCHG_H +#ifdef __cplusplus +extern "C" { +#endif +#define WM_OBTAIN_TOKENS (WM_USER+77) +#define WM_START_SERVICE (WM_USER+78) +void ObtainTokensFromUserIfNeeded(HWND hWnd); +DWORD IpAddrChangeMonitorInit(HWND hWnd); + +#ifdef __cplusplus +} +#endif +#endif /* IPADDRCHG_H */ diff --git a/src/WINNT/client_creds/lang/NTMakefile b/src/WINNT/client_creds/lang/NTMakefile index 3ca6cbe18..7f7259185 100644 --- a/src/WINNT/client_creds/lang/NTMakefile +++ b/src/WINNT/client_creds/lang/NTMakefile @@ -10,7 +10,7 @@ AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include -I.. # include the primary makefile - +RELDIR=WINNT\client_creds\lang !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\..\config\NTMakefile.version @@ -35,7 +35,7 @@ DLLFILE = $(DESTDIR)\root.client\usr\vice\etc\afscreds_$(LANGID).dll RCFILE = $(LANGNAME)\afscreds.rc -RESFILE = afscreds_$(LANGID).res +RESFILE = $(OUT)\afscreds_$(LANGID).res DLLOBJS = $(RESFILE) @@ -48,7 +48,8 @@ $(DLLFILE) : $(DLLOBJS) install : $(DLLFILE) clean :: - $(DEL) *.res RC* RD* $(DLLFILE) $(DEL) $(DLLFILE) + @if exist AFS_component_version_number.h del AFS_component_version_number.h + $(DEL) $(OUT)\*.res RC* RD* $(DLLFILE) ############################################################################ # @@ -58,3 +59,6 @@ clean :: $(RESFILE) : $(RCFILE) AFS_component_version_number.h $(RC) /fo$(RESFILE) /c$(LANGCP) $(RCFILE) + +mkdir: + diff --git a/src/WINNT/client_creds/lang/de_DE/afscreds.rc b/src/WINNT/client_creds/lang/de_DE/afscreds.rc index 6ad916cdd..517e42480 100644 --- a/src/WINNT/client_creds/lang/de_DE/afscreds.rc +++ b/src/WINNT/client_creds/lang/de_DE/afscreds.rc @@ -7,28 +7,28 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// // Version // @@ -42,540 +42,540 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #include "..\..\config\NTVersioninfo.rc" ///////////////////////////////////////////////////////////////////////////// // -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "afscreds.ico" -IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" -IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" -IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_MAIN DIALOG DISCARDABLE 0, 0, 307, 131 -STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS Client" -CLASS "AfsCreds" -FONT 9, "MS Shell Dlg" -BEGIN - RTEXT "AFS, Version %s (Programmkorrektur %lu)", - IDC_TITLE_VERSION,210,8,90,8 - LTEXT "Aktuelle Anmeldung beim Windows-Netzwerk als ""%s""", - IDC_TITLE_NT,7,8,203,8 - CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,27,293,97 -END - -IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Zelle: ",IDC_STATIC,7,9,24,8 - LTEXT "(kein)",IDC_CREDS_CELL,51,9,193,8 - LTEXT "Token: ",IDC_STATIC,7,26,27,8 - LTEXT "(kein)",IDC_CREDS_INFO,51,26,193,8 - CONTROL "Vor Ablauf die&ser Token eine Warnung anzeigen", - IDC_CREDS_REMIND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 51,43,193,10 - PUSHBUTTON "Neue Token &erhalten...",IDC_CREDS_OBTAIN,51,63,88,14 - PUSHBUTTON "&Diese Token löschen",IDC_CREDS_DESTROY,142,63,92,14 - PUSHBUTTON "Hilfe",9,237,63,45,14 -END - -IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "In keiner AFS-Zelle sind Token vorhanden.",IDC_RUNNING, - 7,9,275,8 - LTEXT "Der AFS Client ist nicht einwandfrei konfiguriert, oder der AFS Client-Service ist nicht aktiv.\n\nStarten die den AFS Client-Service mit Hilfe des Registers Erweitert.", - IDC_STOPPED,7,9,275,25 - PUSHBUTTON "Hilfe",9,237,63,45,14 - PUSHBUTTON "Neue Token &erhalten...",IDC_CREDS_OBTAIN,51,63,88,14 -END - -IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "(Abfrage läuft...)",IDC_SERVICE_STATUS,7,9,275,8 - PUSHBUTTON "Service &starten",IDC_SERVICE_START,51,28,63,14 - PUSHBUTTON "Service &beenden",IDC_SERVICE_STOP,118,28,63,14 - PUSHBUTTON "AFS Client &konfigurieren",IDC_OPEN_CPL,185,28,97,14 - CONTROL "AFS Client-Service bei jedem Neustart dieses Computers st&arten", - IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, - 51,215,10 - CONTROL "AFS Client-Symbol immer in der Task-Leiste an&zeigen", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65, - 204,10 - PUSHBUTTON "Hilfe",9,237,63,45,14 -END - -IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 232, 127 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Neue AFS-Token erhalten" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Um neue AFS-Token zu erhalten, geben Sie Ihren AFS-Benutzernamen und das Kennwort für Ihr AFS-Konto ein. Sie können gleichzeitig Token in mehreren AFS-Zellen besitzen.", - IDC_STATIC,7,7,218,24 - LTEXT "AFS-&Zelle:",IDC_STATIC,16,42,33,8 - EDITTEXT IDC_NEWCREDS_CELL,67,40,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "Benutzer&name:",IDC_STATIC,16,60,48,8 - EDITTEXT IDC_NEWCREDS_USER,67,58,97,14,ES_AUTOHSCROLL - LTEXT "&Kennwort:",IDC_STATIC,15,78,34,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,67,76,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,69,106,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,122,106,50,14 - PUSHBUTTON "Hilfe",9,175,106,50,14 -END - -IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Neue AFS-Token erhalten" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Um neue AFS-Token zu erhalten, geben Sie Ihren AFS-Benutzernamen und das Kennwort für Ihr AFS-Konto ein. Sie können gleichzeitig Token in mehreren AFS-Zellen besitzen.", - IDC_STATIC,7,29,218,24 - LTEXT "AFS-&Zelle:",IDC_STATIC,18,70,33,8 - EDITTEXT IDC_NEWCREDS_CELL,73,68,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "Benutzer&name:",IDC_STATIC,18,88,48,8 - EDITTEXT IDC_NEWCREDS_USER,73,86,97,14,ES_AUTOHSCROLL - LTEXT "&Kennwort:",IDC_STATIC,17,106,34,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,73,104,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "Ihre Token in der Zelle %1 laufen in Kürze ab.", - IDC_NEWCREDS_TITLE,7,7,218,16 - DEFPUSHBUTTON "OK",IDOK,69,134,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,122,134,50,14 - PUSHBUTTON "Hilfe",9,175,134,50,14 -END - -IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Sie haben gewählt, die folgenden Laufwerkbuchstaben Pfaden in AFS zuzuordnen:", - IDC_TITLE,7,8,275,8 - PUSHBUTTON "&Hinzufügen...",IDC_ADD,51,63,45,14 - PUSHBUTTON "Ä&ndern ...",IDC_EDIT,99,63,45,14 - PUSHBUTTON "&Entfernen",IDC_REMOVE,147,63,45,14 - CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x1d3,51,21,231,37 - PUSHBUTTON "Hilfe",9,237,63,45,14 -END - -IDD_WIZARD DIALOGEX 0, 0, 272, 152 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Client-Assistent" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON " &Weiter >",IDNEXT,162,131,50,14 - PUSHBUTTON "&Abbrechen",IDCANCEL,215,131,50,14 - CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,112 - CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,91,7,174,112 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,125,258,1 - PUSHBUTTON "&Hilfe",9,59,131,50,14 - PUSHBUTTON " < &Zurück",IDBACK,112,131,50,14 -END - -IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Der AFS Client-Service wurde noch nicht gestartet.", - IDC_STATIC,0,0,173,8 - LTEXT "Um den AFS Client-Service zu starten, klicken Sie auf Weiter.", - IDC_STATIC,0,73,173,16 - LTEXT "Solange der AFS Client-Service nicht aktiv ist, können Sie keine in AFS gespeicherten Dateien verwenden.", - IDC_STATIC,0,17,173,17 - LTEXT "Wenn der AFS Client-Service weiterhin nicht ausgeführt werden soll, klicken Sie auf Abbrechen.", - IDC_STATIC,0,91,173,17 -END - -IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Der AFS Client-Service wird jetzt ausgeführt, Sie haben jedoch noch keine Token erhalten, um AFS zu verwenden.", - IDC_STATIC,0,0,173,24 - CONTROL "Für alle Zellen keine Token erhalten",IDC_NOCREDS, - "Button",BS_AUTORADIOBUTTON,10,28,141,10 - CONTROL "In der folgenden Zelle Token erhalten:",IDC_YESCREDS, - "Button",BS_AUTORADIOBUTTON,10,44,141,10 - LTEXT "AFS-&Zelle:",IDC_STATIC,25,64,34,8 - EDITTEXT IDC_NEWCREDS_CELL,77,62,96,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "Benutzer&name:",IDC_STATIC,25,82,48,8 - EDITTEXT IDC_NEWCREDS_USER,77,80,96,14,ES_AUTOHSCROLL - LTEXT "&Kennwort:",IDC_STATIC,25,100,34,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,77,97,96,14,ES_PASSWORD | - ES_AUTOHSCROLL -END - -IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Bitte warten; der AFS Client-Service wird gestartet...", - IDC_START_TRY,0,33,173,8 - LTEXT "Der AFS Client-Service konnte nicht gestartet werden.\n\nÜberprüfen Sie Ihre Netzwerkeinstellungen, und überprüfen Sie in der Systemsteuerung über das Symbol AFS die Konfiguration des AFS Clients auf diesem Computer.", - IDC_START_FAIL,0,25,173,49 -END - -IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Um auf in AFS gespeicherte Dateien zuzugreifen, müssen Sie den Pfaden in AFS Laufwerkbuchstaben zuordnen.", - IDC_STATIC,0,0,173,23 - CONTROL "Pfaden in AFS &keine Laufwerkbuchstaben zuordnen", - IDC_NOMAP,"Button",BS_AUTORADIOBUTTON | BS_MULTILINE,4, - 27,165,15 - CONTROL "&Mindestens einen Laufwerkbuchstaben einem Pfad in AFS zuordnen:", - IDC_YESMAP,"Button",BS_AUTORADIOBUTTON | BS_MULTILINE,4, - 45,156,14 - LTEXT "&Laufwerkbuchstabe:",IDC_STATIC,5,65,65,8 - COMBOBOX IDC_MAP_LETTER,77,62,48,125,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS-&Pfad:",IDC_STATIC,5,83,33,8 - EDITTEXT IDC_MAP_PATH,77,79,96,14,ES_AUTOHSCROLL - LTEXT "B&eschreibung:",IDC_STATIC,5,99,48,8 - EDITTEXT IDC_MAP_DESC,77,96,60,14,ES_AUTOHSCROLL -END - -IDD_TERMINATE DIALOGEX 0, 0, 291, 141 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Client" -FONT 9, "MS Shell Dlg" -BEGIN - PUSHBUTTON "Symbol entfe&rnen",IDOK,167,120,63,14 - PUSHBUTTON "&Abbrechen",IDCANCEL,234,120,50,14 - LTEXT "Sie haben gewählt, das AFS Client-Symbol aus der Task-Leiste Ihres Computers zu entfernen. Nur wenn das AFS Client-Symbol auf der Task-Leiste Ihres Computers angezeigt wird, kann AFS keine Warnung vornehmen, wenn Ihre AFS-Token in Kürze ablaufen.", - IDC_STATIC,7,7,277,32 - LTEXT "Der AFS Client-Service ist momentan aktiv. Wenn Sie möchten, können Sie ihn jetzt beenden.", - IDC_STATIC,7,41,277,16 - CONTROL "AFS Client-Service &nicht beenden",IDC_LEAVE,"Button", - BS_AUTORADIOBUTTON,25,66,228,10 - CONTROL "AFS Client-Service &beenden",IDC_STOP,"Button", - BS_AUTORADIOBUTTON,25,80,228,10 - CONTROL "Symbol beim Neustart des Computers an&zeigen", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,104, - 160,10 -END - -IDD_TERMINATE_SMALL DIALOGEX 0, 0, 291, 82 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Client" -FONT 9, "MS Shell Dlg" -BEGIN - PUSHBUTTON "Symbol entfe&rnen",IDOK,167,61,63,14 - PUSHBUTTON "&Abbrechen",IDCANCEL,234,61,50,14 - LTEXT "Sie haben gewählt, das AFS Client-Symbol aus der Task-Leiste Ihres Computers zu entfernen. Nur wenn das AFS Client-Symbol auf der Task-Leiste Ihres Computers angezeigt wird, kann AFS Sie warnen, wenn Ihre AFS-Token in Kürze ablaufen.", - -1,7,7,277,25 - CONTROL "Symbol beim Neustart des Computers an&zeigen", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,42, - 161,10 -END - -IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 291, 89 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Light" -FONT 9, "MS Shell Dlg" -BEGIN - PUSHBUTTON "Symbol entfe&rnen",IDOK,171,69,63,14 - PUSHBUTTON "&Abbrechen",IDCANCEL,238,68,50,14 - LTEXT "Sie haben gewählt, das AFS Client-Symbol aus der Task-Leiste Ihres Computers zu entfernen. Nur wenn das AFS Light-Symbol auf der Task-Leiste Ihres Computers angezeigt wird, kann AFS Sie warnen, wenn Ihre AFS-Token in Kürze ablaufen.", - -1,7,7,277,25 - CONTROL "Symbol beim Neustart des Computers an&zeigen", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,46, - 161,10 -END - -IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Mindestens einer der ausgewählten Laufwerkbuchstaben konnten nicht den entsprechenden Pfaden in AFS zugeordnet werden.\n\nSie müssen möglicherweise alle Anwendungen schließen, die bereits versuchen, Pfade in AFS zu verwenden.", - IDC_MAP_FAIL,1,26,173,57 - LTEXT "Bitte warten; Laufwerkbuchstaben werden Pfaden in AFS zugeordnet...", - IDC_MAP_TRY,0,33,173,8 -END - -IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Der AFS Client ist einsatzbereit.",IDC_STATIC,0,0,173,8 - LTEXT "Um diesen Assistenten zu beenden, klicken Sie auf Fertigstellen.", - IDC_STATIC,0,73,173,20 -END - -IDD_MAPPING DIALOG DISCARDABLE 0, 0, 275, 152 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Laufwerkbuchstabe zuordnen" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Sie können Laufwerkbuchstaben auf Ihrem Computer Pfaden in AFS zuordnen.\n\nWenn Sie beispielsweise Q: zu \\afs\\acme.com\\usr\\bob zuordnen, sind die in AFS unter \\afs\\acme.com\\usr\\bob\\* verfügbaren Dateien im Laufwerk Q:\\ sichtbar.", - IDC_STATIC,7,7,260,32 - LTEXT "&Laufwerkbuchstabe:",IDC_STATIC,18,53,65,8 - COMBOBOX IDC_MAP_LETTER,88,51,56,162,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS-&Pfad:",IDC_STATIC,18,71,33,8 - EDITTEXT IDC_MAP_PATH,88,69,174,13,ES_AUTOHSCROLL - LTEXT "B&eschreibung:",IDC_STATIC,18,88,46,8 - EDITTEXT IDC_MAP_DESC,88,86,60,13,ES_AUTOHSCROLL - CONTROL "Diese Zuordnung bei jeder Anmeldung &wiederherstellen", - IDC_MAP_PERSISTENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 73,105,185,10 - DEFPUSHBUTTON "OK",IDOK,112,131,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,165,131,50,14 - PUSHBUTTON "Hilfe",9,217,131,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 300 - TOPMARGIN, 8 - BOTTOMMARGIN, 124 - END - - IDD_TAB_CREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_NOCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_ADVANCED, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_NEWCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 120 - END - - IDD_NEWCREDS_EXPIRE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 148 - END - - IDD_TAB_MOUNT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_WIZARD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 265 - TOPMARGIN, 7 - BOTTOMMARGIN, 145 - END - - IDD_TERMINATE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 284 - TOPMARGIN, 7 - BOTTOMMARGIN, 134 - END - - IDD_TERMINATE_SMALL, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 284 - TOPMARGIN, 7 - BOTTOMMARGIN, 75 - END - - IDD_MAPPING, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 267 - TOPMARGIN, 7 - BOTTOMMARGIN, 145 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_TRAYICON MENU DISCARDABLE -BEGIN - MENUITEM "Token an&zeigen...", M_ACTIVATE - MENUITEM "Vor Ablauf &warnen", M_REMIND, CHECKED - MENUITEM SEPARATOR - MENUITEM "Symbol entfe&rnen", M_TERMINATE -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" -IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_TOOLTIP "AFS Client" - IDS_CREDENTIALS "Token" - IDS_UNKNOWN "(unbekannt)" - IDS_ADVANCED "Erweitert" - IDS_CREDS "%1 (Token laufen ab %2)" - IDS_NO_CREDS "(Sie besitzen keine Token in dieser Zelle)" - IDS_SERVICE_BROKEN "Der AFS Client-Service wurde nicht ordnungsgemäß installiert, oder Sie sind nicht berechtigt, dessen Status abzufragen." - IDS_SERVICE_RUNNING "Der AFS Client-Service wird normal ausgeführt." - IDS_SERVICE_STOPPED "Der AFS Client-Service wird momentan nicht ausgeführt." - IDS_SERVICE_STOPPING "Bitte warten; der AFS Client-Service wird beendet..." - IDS_SERVICE_STARTING "Bitte warten; der AFS Client-Service wird gestartet..." - IDS_SERVICE_UNKNOWN "Der Status des AFS Client-Service konnte nicht bestimmt werden." - IDS_SERVICE_FAIL_STOP "Der AFS Client-Service konnte nicht ordnungsgemäß beendet werden. Sie besitzen möglicherweise nicht das Recht, diese Operation durchzuführen.\n\nFehler 0x%1." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_MAP "Fehler beim Zuordnen des Netzlaufwerks" - IDS_ERROR_MAP_DESC "AFS konnte das Netzlaufwerk nicht dem angegebenen Pfad in AFS zuordnen. Überprüfen Sie, ob der Laufwerkbuchstabe momentan nicht verwendet wird.\n\nFehler: 0x%1." - IDS_ERROR_UNMAP "Fehler beim Zuordnen des Netzlaufwerks" - IDS_ERROR_UNMAP_DESC "AFS konnte die Zuordnung des angegebenen Netzlaufwerk nicht aufheben. Überprüfen Sie, ob der Laufwerkbuchstabe momentan nicht verwendet wird.\n\nFehler: 0x%1." - IDS_CELL_GATEWAY "%s (über Gateway %s)" - IDS_BADMAP_TITLE "Fehler beim Zuordnen des Netzlaufwerks" - IDS_BADMAP_DESC "AFS kann dem angegebenen Pfad keinen Laufwerkbuchstabe zuordnen, da der Pfad nicht mit ""\\afs"" beginnt.\n\nStellen Sie sicher, daß der eingegebene Pfad mit ""\\afs"" beginnt, und versuchen Sie es erneut." - IDS_UNCONFIG_TITLE "Fehler - AFS Client" - IDS_UNCONFIG_DESC "Der AFS Client kann nicht verwendet werden, da er noch konfiguriert wurde.\n\nUm den AFS Client zu konfigurieren, öffnen Sie die Systemsteuerung und doppelklicken Sie auf das Symbol AFS Client." - IDS_NEWSUB_TITLE "Achtung - AFS Client" - IDS_NEWSUB_DESC "AFS konnte die beim Verbinden des Netzlaufwerks angegebene Beschreibung nicht verwenden.\n\nDie angegebene Beschreibung wird bereits für einen anderen AFS-Pfad verwendet." - IDS_BADSUB_TITLE "Fehler - AFS Client" - IDS_BADSUB_DESC "Die eingegebene Beschreibung für den Laufwerkbuchstaben kann nicht verwendet werden.\n\nDie Beschreibung für den Laufwerkbuchstaben darf nicht mehr als 12 Zeichen umfassen und keine Leerzeichen oder Tabulatoren enthalten." - IDS_TITLE_95 "AFS Light" - IDS_TOOLTIP_95 "AFS Light" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_FAIL_START "Der AFS Client-Service konnte nicht ordnungsgemäß gestartet werden. Sie besitzen möglicherweise nicht das Recht, diese Operation durchzuführen.\n\nFehler 0x%1." - IDS_SERVICE_FAIL_CONFIG "Die Startparameter des AFS Client-Service konnten nicht geändert werden. Sie besitzen möglicherweise nicht das Recht, diese Operation durchzuführen.\n\nFehler 0x%1." - IDS_SERVICE_ERROR "Fehler beim Konfigurieren des Service" - IDS_ERROR_TITLE "Fehler - AFS Client" - IDS_ERROR_DESTROY_NOCM "Ihre Token in der Zelle %1 konnten nicht gelöscht werden, da der AFS Client-Service nicht reagiert.\n\nÜberprüfen Sie das Register Erweitert, ob der AFS Client ordnungsgemäß ausgeführt wird.\n\nFehler: %2" - IDS_ERROR_DESTROY_UNKNOWN - "Ihre Token in der Zelle %1 konnten nicht gelöscht werden.\n\nÜberprüfen Sie das Register Erweitert, ob der AFS Client ordnungsgemäß ausgeführt wird.\n\nFehler: %2" - IDS_ERROR_OBTAIN "Der AFS Client konnte in der Zelle %1 keine Token als %2 erhalten.\n\nFehler: %4 (%3)" - IDS_TITLE_VERSION "AFS-Version %s" - IDS_TITLE_VERSION_NOPATCH "AFS-Version %s" - IDS_MOUNT_SOME "Sie haben gewählt, die folgenden Laufwerkbuchstaben Pfaden in AFS zuzuordnen:" - IDS_MOUNT_NONE "Sie haben noch keine Laufwerkbuchstaben den Pfaden in AFS zugeordnet." - IDS_MOUNT "Laufwerkbuchstaben" - IDS_WIZ_NEXT " &Weiter >" - IDS_WIZ_FINISH "&Fertigstellen" - IDS_MAP_LETTER "Laufwerk *:" - IDS_DRIVE_MAP "Laufwerk %1: \t%2" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_TITLE_95 "Fehler - AFS Light" - IDS_ERROR_DESTROY_95 "Ihre Token in der Zelle %1 konnten nicht gelöscht werden.\n\nFehler: %2" - IDS_ERROR_OBTAIN_95 "AFS Light konnte in der Zelle %1 keine Token als %2 erhalten.\n\nFehler: %4 (%3)" - IDS_UNCONFIG_TITLE_95 "Fehler - AFS Light" - IDS_UNCONFIG_DESC_95 "AFS Light kann nicht verwendet werden, da es noch nicht konfiguriert wurde.\n\nUm AFS Light zu konfigurieren, öffnen Sie die Systemsteuerung und doppelklicken auf das Symbol für die Konfiguration von AFS Light." - IDS_NEWSUB_TITLE_95 "Achtung - AFS Light" - IDS_BADSUB_TITLE_95 "Fehler - AFS Light" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "afscreds.ico" +IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" +IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" +IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_MAIN DIALOG DISCARDABLE 0, 0, 307, 131 +STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS Client" +CLASS "AfsCreds" +FONT 9, "MS Shell Dlg" +BEGIN + RTEXT "AFS, Version %s (Programmkorrektur %lu)", + IDC_TITLE_VERSION,210,8,90,8 + LTEXT "Aktuelle Anmeldung beim Windows-Netzwerk als ""%s""", + IDC_TITLE_NT,7,8,203,8 + CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,27,293,97 +END + +IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Zelle: ",IDC_STATIC,7,9,24,8 + LTEXT "(kein)",IDC_CREDS_CELL,51,9,193,8 + LTEXT "Token: ",IDC_STATIC,7,26,27,8 + LTEXT "(kein)",IDC_CREDS_INFO,51,26,193,8 + CONTROL "Vor Ablauf die&ser Token eine Warnung anzeigen", + IDC_CREDS_REMIND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 51,43,193,10 + PUSHBUTTON "Neue Token &erhalten...",IDC_CREDS_OBTAIN,51,63,88,14 + PUSHBUTTON "&Diese Token löschen",IDC_CREDS_DESTROY,142,63,92,14 + PUSHBUTTON "Hilfe",9,237,63,45,14 +END + +IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "In keiner AFS-Zelle sind Token vorhanden.",IDC_RUNNING, + 7,9,275,8 + LTEXT "Der AFS Client ist nicht einwandfrei konfiguriert, oder der AFS Client-Service ist nicht aktiv.\n\nStarten die den AFS Client-Service mit Hilfe des Registers Erweitert.", + IDC_STOPPED,7,9,275,25 + PUSHBUTTON "Hilfe",9,237,63,45,14 + PUSHBUTTON "Neue Token &erhalten...",IDC_CREDS_OBTAIN,51,63,88,14 +END + +IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "(Abfrage läuft...)",IDC_SERVICE_STATUS,7,9,275,8 + PUSHBUTTON "Service &starten",IDC_SERVICE_START,51,28,63,14 + PUSHBUTTON "Service &beenden",IDC_SERVICE_STOP,118,28,63,14 + PUSHBUTTON "AFS Client &konfigurieren",IDC_OPEN_CPL,185,28,97,14 + CONTROL "AFS Client-Service bei jedem Neustart dieses Computers st&arten", + IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, + 51,215,10 + CONTROL "AFS Client-Symbol immer in der Task-Leiste an&zeigen", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65, + 204,10 + PUSHBUTTON "Hilfe",9,237,63,45,14 +END + +IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 232, 127 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Neue AFS-Token erhalten" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Um neue AFS-Token zu erhalten, geben Sie Ihren AFS-Benutzernamen und das Kennwort für Ihr AFS-Konto ein. Sie können gleichzeitig Token in mehreren AFS-Zellen besitzen.", + IDC_STATIC,7,7,218,24 + LTEXT "AFS-&Zelle:",IDC_STATIC,16,42,33,8 + EDITTEXT IDC_NEWCREDS_CELL,67,40,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "Benutzer&name:",IDC_STATIC,16,60,48,8 + EDITTEXT IDC_NEWCREDS_USER,67,58,97,14,ES_AUTOHSCROLL + LTEXT "&Kennwort:",IDC_STATIC,15,78,34,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,67,76,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,69,106,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,122,106,50,14 + PUSHBUTTON "Hilfe",9,175,106,50,14 +END + +IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Neue AFS-Token erhalten" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Um neue AFS-Token zu erhalten, geben Sie Ihren AFS-Benutzernamen und das Kennwort für Ihr AFS-Konto ein. Sie können gleichzeitig Token in mehreren AFS-Zellen besitzen.", + IDC_STATIC,7,29,218,24 + LTEXT "AFS-&Zelle:",IDC_STATIC,18,70,33,8 + EDITTEXT IDC_NEWCREDS_CELL,73,68,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "Benutzer&name:",IDC_STATIC,18,88,48,8 + EDITTEXT IDC_NEWCREDS_USER,73,86,97,14,ES_AUTOHSCROLL + LTEXT "&Kennwort:",IDC_STATIC,17,106,34,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,73,104,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "Ihre Token in der Zelle %1 laufen in Kürze ab.", + IDC_NEWCREDS_TITLE,7,7,218,16 + DEFPUSHBUTTON "OK",IDOK,69,134,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,122,134,50,14 + PUSHBUTTON "Hilfe",9,175,134,50,14 +END + +IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Sie haben gewählt, die folgenden Laufwerkbuchstaben Pfaden in AFS zuzuordnen:", + IDC_TITLE,7,8,275,8 + PUSHBUTTON "&Hinzufügen...",IDC_ADD,51,63,45,14 + PUSHBUTTON "Ä&ndern ...",IDC_EDIT,99,63,45,14 + PUSHBUTTON "&Entfernen",IDC_REMOVE,147,63,45,14 + CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x1d3,51,21,231,37 + PUSHBUTTON "Hilfe",9,237,63,45,14 +END + +IDD_WIZARD DIALOGEX 0, 0, 272, 152 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Client-Assistent" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON " &Weiter >",IDNEXT,162,131,50,14 + PUSHBUTTON "&Abbrechen",IDCANCEL,215,131,50,14 + CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,112 + CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,91,7,174,112 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,125,258,1 + PUSHBUTTON "&Hilfe",9,59,131,50,14 + PUSHBUTTON " < &Zurück",IDBACK,112,131,50,14 +END + +IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Der AFS Client-Service wurde noch nicht gestartet.", + IDC_STATIC,0,0,173,8 + LTEXT "Um den AFS Client-Service zu starten, klicken Sie auf Weiter.", + IDC_STATIC,0,73,173,16 + LTEXT "Solange der AFS Client-Service nicht aktiv ist, können Sie keine in AFS gespeicherten Dateien verwenden.", + IDC_STATIC,0,17,173,17 + LTEXT "Wenn der AFS Client-Service weiterhin nicht ausgeführt werden soll, klicken Sie auf Abbrechen.", + IDC_STATIC,0,91,173,17 +END + +IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Der AFS Client-Service wird jetzt ausgeführt, Sie haben jedoch noch keine Token erhalten, um AFS zu verwenden.", + IDC_STATIC,0,0,173,24 + CONTROL "Für alle Zellen keine Token erhalten",IDC_NOCREDS, + "Button",BS_AUTORADIOBUTTON,10,28,141,10 + CONTROL "In der folgenden Zelle Token erhalten:",IDC_YESCREDS, + "Button",BS_AUTORADIOBUTTON,10,44,141,10 + LTEXT "AFS-&Zelle:",IDC_STATIC,25,64,34,8 + EDITTEXT IDC_NEWCREDS_CELL,77,62,96,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "Benutzer&name:",IDC_STATIC,25,82,48,8 + EDITTEXT IDC_NEWCREDS_USER,77,80,96,14,ES_AUTOHSCROLL + LTEXT "&Kennwort:",IDC_STATIC,25,100,34,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,77,97,96,14,ES_PASSWORD | + ES_AUTOHSCROLL +END + +IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Bitte warten; der AFS Client-Service wird gestartet...", + IDC_START_TRY,0,33,173,8 + LTEXT "Der AFS Client-Service konnte nicht gestartet werden.\n\nÜberprüfen Sie Ihre Netzwerkeinstellungen, und überprüfen Sie in der Systemsteuerung über das Symbol AFS die Konfiguration des AFS Clients auf diesem Computer.", + IDC_START_FAIL,0,25,173,49 +END + +IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Um auf in AFS gespeicherte Dateien zuzugreifen, müssen Sie den Pfaden in AFS Laufwerkbuchstaben zuordnen.", + IDC_STATIC,0,0,173,23 + CONTROL "Pfaden in AFS &keine Laufwerkbuchstaben zuordnen", + IDC_NOMAP,"Button",BS_AUTORADIOBUTTON | BS_MULTILINE,4, + 27,165,15 + CONTROL "&Mindestens einen Laufwerkbuchstaben einem Pfad in AFS zuordnen:", + IDC_YESMAP,"Button",BS_AUTORADIOBUTTON | BS_MULTILINE,4, + 45,156,14 + LTEXT "&Laufwerkbuchstabe:",IDC_STATIC,5,65,65,8 + COMBOBOX IDC_MAP_LETTER,77,62,48,125,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS-&Pfad:",IDC_STATIC,5,83,33,8 + EDITTEXT IDC_MAP_PATH,77,79,96,14,ES_AUTOHSCROLL + LTEXT "B&eschreibung:",IDC_STATIC,5,99,48,8 + EDITTEXT IDC_MAP_DESC,77,96,60,14,ES_AUTOHSCROLL +END + +IDD_TERMINATE DIALOGEX 0, 0, 291, 141 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Client" +FONT 9, "MS Shell Dlg" +BEGIN + PUSHBUTTON "Symbol entfe&rnen",IDOK,167,120,63,14 + PUSHBUTTON "&Abbrechen",IDCANCEL,234,120,50,14 + LTEXT "Sie haben gewählt, das AFS Client-Symbol aus der Task-Leiste Ihres Computers zu entfernen. Nur wenn das AFS Client-Symbol auf der Task-Leiste Ihres Computers angezeigt wird, kann AFS keine Warnung vornehmen, wenn Ihre AFS-Token in Kürze ablaufen.", + IDC_STATIC,7,7,277,32 + LTEXT "Der AFS Client-Service ist momentan aktiv. Wenn Sie möchten, können Sie ihn jetzt beenden.", + IDC_STATIC,7,41,277,16 + CONTROL "AFS Client-Service &nicht beenden",IDC_LEAVE,"Button", + BS_AUTORADIOBUTTON,25,66,228,10 + CONTROL "AFS Client-Service &beenden",IDC_STOP,"Button", + BS_AUTORADIOBUTTON,25,80,228,10 + CONTROL "Symbol beim Neustart des Computers an&zeigen", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,104, + 160,10 +END + +IDD_TERMINATE_SMALL DIALOGEX 0, 0, 291, 82 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Client" +FONT 9, "MS Shell Dlg" +BEGIN + PUSHBUTTON "Symbol entfe&rnen",IDOK,167,61,63,14 + PUSHBUTTON "&Abbrechen",IDCANCEL,234,61,50,14 + LTEXT "Sie haben gewählt, das AFS Client-Symbol aus der Task-Leiste Ihres Computers zu entfernen. Nur wenn das AFS Client-Symbol auf der Task-Leiste Ihres Computers angezeigt wird, kann AFS Sie warnen, wenn Ihre AFS-Token in Kürze ablaufen.", + -1,7,7,277,25 + CONTROL "Symbol beim Neustart des Computers an&zeigen", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,42, + 161,10 +END + +IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 291, 89 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Light" +FONT 9, "MS Shell Dlg" +BEGIN + PUSHBUTTON "Symbol entfe&rnen",IDOK,171,69,63,14 + PUSHBUTTON "&Abbrechen",IDCANCEL,238,68,50,14 + LTEXT "Sie haben gewählt, das AFS Client-Symbol aus der Task-Leiste Ihres Computers zu entfernen. Nur wenn das AFS Light-Symbol auf der Task-Leiste Ihres Computers angezeigt wird, kann AFS Sie warnen, wenn Ihre AFS-Token in Kürze ablaufen.", + -1,7,7,277,25 + CONTROL "Symbol beim Neustart des Computers an&zeigen", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,46, + 161,10 +END + +IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Mindestens einer der ausgewählten Laufwerkbuchstaben konnten nicht den entsprechenden Pfaden in AFS zugeordnet werden.\n\nSie müssen möglicherweise alle Anwendungen schließen, die bereits versuchen, Pfade in AFS zu verwenden.", + IDC_MAP_FAIL,1,26,173,57 + LTEXT "Bitte warten; Laufwerkbuchstaben werden Pfaden in AFS zugeordnet...", + IDC_MAP_TRY,0,33,173,8 +END + +IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Der AFS Client ist einsatzbereit.",IDC_STATIC,0,0,173,8 + LTEXT "Um diesen Assistenten zu beenden, klicken Sie auf Fertigstellen.", + IDC_STATIC,0,73,173,20 +END + +IDD_MAPPING DIALOG DISCARDABLE 0, 0, 275, 152 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Laufwerkbuchstabe zuordnen" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Sie können Laufwerkbuchstaben auf Ihrem Computer Pfaden in AFS zuordnen.\n\nWenn Sie beispielsweise Q: zu \\afs\\acme.com\\usr\\bob zuordnen, sind die in AFS unter \\afs\\acme.com\\usr\\bob\\* verfügbaren Dateien im Laufwerk Q:\\ sichtbar.", + IDC_STATIC,7,7,260,32 + LTEXT "&Laufwerkbuchstabe:",IDC_STATIC,18,53,65,8 + COMBOBOX IDC_MAP_LETTER,88,51,56,162,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS-&Pfad:",IDC_STATIC,18,71,33,8 + EDITTEXT IDC_MAP_PATH,88,69,174,13,ES_AUTOHSCROLL + LTEXT "B&eschreibung:",IDC_STATIC,18,88,46,8 + EDITTEXT IDC_MAP_DESC,88,86,60,13,ES_AUTOHSCROLL + CONTROL "Diese Zuordnung bei jeder Anmeldung &wiederherstellen", + IDC_MAP_PERSISTENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 73,105,185,10 + DEFPUSHBUTTON "OK",IDOK,112,131,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,165,131,50,14 + PUSHBUTTON "Hilfe",9,217,131,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 300 + TOPMARGIN, 8 + BOTTOMMARGIN, 124 + END + + IDD_TAB_CREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_NOCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_ADVANCED, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_NEWCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 120 + END + + IDD_NEWCREDS_EXPIRE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 148 + END + + IDD_TAB_MOUNT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_WIZARD, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 265 + TOPMARGIN, 7 + BOTTOMMARGIN, 145 + END + + IDD_TERMINATE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 134 + END + + IDD_TERMINATE_SMALL, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 75 + END + + IDD_MAPPING, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 267 + TOPMARGIN, 7 + BOTTOMMARGIN, 145 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_TRAYICON MENU DISCARDABLE +BEGIN + MENUITEM "Token an&zeigen...", M_ACTIVATE + MENUITEM "Vor Ablauf &warnen", M_REMIND, CHECKED + MENUITEM SEPARATOR + MENUITEM "Symbol entfe&rnen", M_TERMINATE +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" +IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP "AFS Client" + IDS_TOOLTIP_95 "AFS Light" + IDS_CREDENTIALS "Token" + IDS_UNKNOWN "(unbekannt)" + IDS_ADVANCED "Erweitert" + IDS_CREDS "%1 (Token laufen ab %2)" + IDS_NO_CREDS "(Sie besitzen keine Token in dieser Zelle)" + IDS_SERVICE_BROKEN "Der AFS Client-Service wurde nicht ordnungsgemäß installiert, oder Sie sind nicht berechtigt, dessen Status abzufragen." + IDS_SERVICE_RUNNING "Der AFS Client-Service wird normal ausgeführt." + IDS_SERVICE_STOPPED "Der AFS Client-Service wird momentan nicht ausgeführt." + IDS_SERVICE_STOPPING "Bitte warten; der AFS Client-Service wird beendet..." + IDS_SERVICE_STARTING "Bitte warten; der AFS Client-Service wird gestartet..." + IDS_SERVICE_UNKNOWN "Der Status des AFS Client-Service konnte nicht bestimmt werden." + IDS_SERVICE_FAIL_STOP "Der AFS Client-Service konnte nicht ordnungsgemäß beendet werden. Sie besitzen möglicherweise nicht das Recht, diese Operation durchzuführen.\n\nFehler 0x%1." + IDS_SERVICE_FAIL_START "Der AFS Client-Service konnte nicht ordnungsgemäß gestartet werden. Sie besitzen möglicherweise nicht das Recht, diese Operation durchzuführen.\n\nFehler 0x%1." + IDS_SERVICE_FAIL_CONFIG "Die Startparameter des AFS Client-Service konnten nicht geändert werden. Sie besitzen möglicherweise nicht das Recht, diese Operation durchzuführen.\n\nFehler 0x%1." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_ERROR "Fehler beim Konfigurieren des Service" + IDS_ERROR_TITLE "Fehler - AFS Client" + IDS_ERROR_TITLE_95 "Fehler - AFS Light" + IDS_ERROR_DESTROY_95 "Ihre Token in der Zelle %1 konnten nicht gelöscht werden.\n\nFehler: %2" + IDS_ERROR_DESTROY_NOCM "Ihre Token in der Zelle %1 konnten nicht gelöscht werden, da der AFS Client-Service nicht reagiert.\n\nÜberprüfen Sie das Register Erweitert, ob der AFS Client ordnungsgemäß ausgeführt wird.\n\nFehler: %2" + IDS_ERROR_DESTROY_UNKNOWN + "Ihre Token in der Zelle %1 konnten nicht gelöscht werden.\n\nÜberprüfen Sie das Register Erweitert, ob der AFS Client ordnungsgemäß ausgeführt wird.\n\nFehler: %2" + IDS_ERROR_OBTAIN "Der AFS Client konnte in der Zelle %1 keine Token als %2 erhalten.\n\nFehler: %4 (%3)" + IDS_ERROR_OBTAIN_95 "AFS Light konnte in der Zelle %1 keine Token als %2 erhalten.\n\nFehler: %4 (%3)" + IDS_TITLE_VERSION "AFS-Version %s" + IDS_TITLE_VERSION_NOPATCH "AFS-Version %s" + IDS_MOUNT_SOME "Sie haben gewählt, die folgenden Laufwerkbuchstaben Pfaden in AFS zuzuordnen:" + IDS_MOUNT_NONE "Sie haben noch keine Laufwerkbuchstaben den Pfaden in AFS zugeordnet." + IDS_MOUNT "Laufwerkbuchstaben" + IDS_WIZ_NEXT " &Weiter >" + IDS_WIZ_FINISH "&Fertigstellen" + IDS_MAP_LETTER "Laufwerk *:" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DRIVE_MAP "Laufwerk %1: \t%2" + IDS_ERROR_MAP "Fehler beim Zuordnen des Netzlaufwerks" + IDS_ERROR_MAP_DESC "AFS konnte das Netzlaufwerk nicht dem angegebenen Pfad in AFS zuordnen. Überprüfen Sie, ob der Laufwerkbuchstabe momentan nicht verwendet wird.\n\nFehler: 0x%1." + IDS_ERROR_UNMAP "Fehler beim Zuordnen des Netzlaufwerks" + IDS_ERROR_UNMAP_DESC "AFS konnte die Zuordnung des angegebenen Netzlaufwerk nicht aufheben. Überprüfen Sie, ob der Laufwerkbuchstabe momentan nicht verwendet wird.\n\nFehler: 0x%1." + IDS_CELL_GATEWAY "%s (über Gateway %s)" + IDS_BADMAP_TITLE "Fehler beim Zuordnen des Netzlaufwerks" + IDS_BADMAP_DESC "AFS kann dem angegebenen Pfad keinen Laufwerkbuchstabe zuordnen, da der Pfad nicht mit ""\\afs"" beginnt.\n\nStellen Sie sicher, daß der eingegebene Pfad mit ""\\afs"" beginnt, und versuchen Sie es erneut." + IDS_UNCONFIG_TITLE_95 "Fehler - AFS Light" + IDS_UNCONFIG_DESC_95 "AFS Light kann nicht verwendet werden, da es noch nicht konfiguriert wurde.\n\nUm AFS Light zu konfigurieren, öffnen Sie die Systemsteuerung und doppelklicken auf das Symbol für die Konfiguration von AFS Light." + IDS_UNCONFIG_TITLE "Fehler - AFS Client" + IDS_UNCONFIG_DESC "Der AFS Client kann nicht verwendet werden, da er noch konfiguriert wurde.\n\nUm den AFS Client zu konfigurieren, öffnen Sie die Systemsteuerung und doppelklicken Sie auf das Symbol AFS Client." + IDS_NEWSUB_TITLE "Achtung - AFS Client" + IDS_NEWSUB_TITLE_95 "Achtung - AFS Light" + IDS_NEWSUB_DESC "AFS konnte die beim Verbinden des Netzlaufwerks angegebene Beschreibung nicht verwenden.\n\nDie angegebene Beschreibung wird bereits für einen anderen AFS-Pfad verwendet." + IDS_BADSUB_TITLE "Fehler - AFS Client" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADSUB_TITLE_95 "Fehler - AFS Light" + IDS_BADSUB_DESC "Die eingegebene Beschreibung für den Laufwerkbuchstaben kann nicht verwendet werden.\n\nDie Beschreibung für den Laufwerkbuchstaben darf nicht mehr als 12 Zeichen umfassen und keine Leerzeichen oder Tabulatoren enthalten." + IDS_TITLE_95 "AFS Light" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/client_creds/lang/en_US/afscreds.rc b/src/WINNT/client_creds/lang/en_US/afscreds.rc index 96ec62358..271da75b4 100644 --- a/src/WINNT/client_creds/lang/en_US/afscreds.rc +++ b/src/WINNT/client_creds/lang/en_US/afscreds.rc @@ -146,7 +146,7 @@ BEGIN END IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 232, 127 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Obtain New AFS Tokens" FONT 9, "MS Shell Dlg" BEGIN @@ -508,12 +508,12 @@ BEGIN IDS_SERVICE_STARTING "Please wait; the AFS Client Service is starting..." IDS_SERVICE_UNKNOWN "The status of the AFS Client Service could not be determined." IDS_SERVICE_FAIL_STOP "The AFS Client Service could not be stopped successfully. You might not have authorization to perform this operation.\n\nError 0x%1." + IDS_SERVICE_FAIL_START "The AFS Client Service could not be started successfully. You might not have authorization to perform this operation.\n\nError 0x%1." + IDS_SERVICE_FAIL_CONFIG "The AFS Client Service's startup parameters could not be changed. You might not have authorization to perform this operation.\n\nError 0x%1." END STRINGTABLE DISCARDABLE BEGIN - IDS_SERVICE_FAIL_START "The AFS Client Service could not be started successfully. You might not have authorization to perform this operation.\n\nError 0x%1." - IDS_SERVICE_FAIL_CONFIG "The AFS Client Service's startup parameters could not be changed. You might not have authorization to perform this operation.\n\nError 0x%1." IDS_SERVICE_ERROR "Error Configuring Service" IDS_ERROR_TITLE "Error - AFS Client" IDS_ERROR_TITLE_95 "Error - AFS Light" @@ -531,11 +531,11 @@ BEGIN IDS_WIZ_NEXT "&Next >" IDS_WIZ_FINISH "&Finish" IDS_MAP_LETTER "Drive *:" - IDS_DRIVE_MAP "Drive %1: \t%2" END STRINGTABLE DISCARDABLE BEGIN + IDS_DRIVE_MAP "Drive %1: \t%2" IDS_ERROR_MAP "Error Mapping Network Drive" IDS_ERROR_MAP_DESC "AFS was unable to map the network drive to the specified path in AFS. Check to make sure the drive letter is not currently in use.\n\nError: 0x%1." IDS_ERROR_UNMAP "Error Mapping Network Drive" @@ -551,11 +551,14 @@ BEGIN IDS_NEWSUB_TITLE_95 "Caution - AFS Light" IDS_NEWSUB_DESC "AFS was unable to use the description you specified when connecting the network drive.\n\nThe specified description is already used for a different AFS path." IDS_BADSUB_TITLE "Error - AFS Client" +END + +STRINGTABLE DISCARDABLE +BEGIN IDS_BADSUB_TITLE_95 "Error - AFS Light" IDS_BADSUB_DESC "The drive letter description you entered cannot be used.\n\nA drive letter description may have no more than 12 characters, and may not contain spaces or tabs." IDS_TITLE_95 "AFS Light" END - #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/WINNT/client_creds/lang/es_ES/afscreds.rc b/src/WINNT/client_creds/lang/es_ES/afscreds.rc index d9e8f2842..61e762ca9 100644 --- a/src/WINNT/client_creds/lang/es_ES/afscreds.rc +++ b/src/WINNT/client_creds/lang/es_ES/afscreds.rc @@ -7,25 +7,25 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#endif //_WIN32 +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Version @@ -39,567 +39,567 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #define AFS_VERINFO_CHARSET 1252 #include "AFS_component_version_number.h" #include "..\..\config\NTVersioninfo.rc" - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "afscreds.ico" -IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" -IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" -IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_MAIN DIALOG DISCARDABLE 0, 0, 310, 130 -STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS Client" -CLASS "AfsCreds" -FONT 9, "MS Shell Dlg" -BEGIN - RTEXT "AFS Versión %s (parche %lu)",IDC_TITLE_VERSION,213,8,90, - 8 - LTEXT "Registrado actualmente en Redes de Windows como ""%s""", - IDC_TITLE_NT,7,8,203,8 - CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,26,296,97 -END - -IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Célula: ",IDC_STATIC,7,9,24,8 - LTEXT "(ninguna)",IDC_CREDS_CELL,51,9,193,8 - LTEXT "Señales:",IDC_STATIC,7,26,27,8 - LTEXT "(ninguna)",IDC_CREDS_INFO,51,26,193,8 - CONTROL "&Mostrar un aviso antes de que caduquen estas señales", - IDC_CREDS_REMIND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 51,43,193,10 - PUSHBUTTON "&Obtener señales nuevas...",IDC_CREDS_OBTAIN,51,63,88, - 14 - PUSHBUTTON "&Descartar estas señales",IDC_CREDS_DESTROY,142,63,92, - 14 - PUSHBUTTON "Ayuda",9,237,63,45,14 -END - -IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "No dispone de señales dentro de ninguna célula de AFS.", - IDC_RUNNING,7,9,275,8 - LTEXT "El AFS Client no se ha configurado debidamente o el servicio de AFS Client no se está ejecutando.\n\nUtilice el tabulador Avanzado para iniciar el servicio de AFS Client.", - IDC_STOPPED,7,9,275,25 - PUSHBUTTON "Ayuda",9,237,63,45,14 - PUSHBUTTON "&Obtener señales nuevas...",IDC_CREDS_OBTAIN,51,63,88, - 14 -END - -IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "(consultando...)",IDC_SERVICE_STATUS,7,9,275,8 - PUSHBUTTON "&Iniciar servicio",IDC_SERVICE_START,51,28,63,14 - PUSHBUTTON "De&tener servicio",IDC_SERVICE_STOP,118,28,63,14 - PUSHBUTTON "&Configurar AFS Client",IDC_OPEN_CPL,185,28,97,14 - CONTROL "Inici&ar el Servicio de AFS Client cada vez que se reinicia este sistema", - IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, - 51,275,10 - CONTROL "&Mostrar siempre el icono AFS Client en la barra de tareas", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65, - 214,10 - PUSHBUTTON "Ayuda",9,237,63,45,14 -END - -IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 261, 127 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Obtener señales nuevas de AFS" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Para obtener señales nuevas de AFS, entre el nombre de usuario de AFS y la contraseña de la cuenta de AFS. Puede disponer de señales en múltiples células de AFS al mismo tiempo.", - IDC_STATIC,7,7,247,24 - LTEXT "&Célula de AFS:",IDC_STATIC,24,42,68,8 - EDITTEXT IDC_NEWCREDS_CELL,93,40,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "&Nombre de usuario:",IDC_STATIC,24,60,68,8 - EDITTEXT IDC_NEWCREDS_USER,93,58,97,14,ES_AUTOHSCROLL - LTEXT "C&ontraseña:",IDC_STATIC,23,78,56,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,93,76,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "Aceptar",IDOK,76,106,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,140,106,50,14 - PUSHBUTTON "Ayuda",9,204,106,50,14 -END - -IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Obtener señales nuevas de AFS" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Para obtener señales nuevas de AFS, entre el nombre de usuario de AFS y la contraseña de la cuenta de AFS. Puede disponer de señales en múltiples células de AFS al mismo tiempo.", - IDC_STATIC,7,29,218,24 - LTEXT "&Célula de AFS:",IDC_STATIC,24,70,52,8 - EDITTEXT IDC_NEWCREDS_CELL,89,68,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "&Nombre de usuario:",IDC_STATIC,24,88,64,8 - EDITTEXT IDC_NEWCREDS_USER,89,86,97,14,ES_AUTOHSCROLL - LTEXT "C&ontraseña:",IDC_STATIC,23,106,58,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,89,104,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "Las señales de la célula %1 están a punto de caducar.", - IDC_NEWCREDS_TITLE,7,7,218,16 - DEFPUSHBUTTON "Aceptar",IDOK,69,134,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,122,134,50,14 - PUSHBUTTON "Ayuda",9,175,134,50,14 -END - -IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 305, 81 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Ha optado por correlacionar las siguientes letras de unidad con vías de acceso de AFS:", - IDC_TITLE,7,8,278,8 - PUSHBUTTON "&Añadir...",IDC_ADD,51,63,45,14 - PUSHBUTTON "&Cambiar...",IDC_EDIT,99,63,45,14 - PUSHBUTTON "&Eliminar",IDC_REMOVE,147,63,45,14 - CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x1d3,59,21,231,37 - PUSHBUTTON "Ayuda",9,246,63,45,14 -END - -IDD_WIZARD DIALOGEX 0, 0, 272, 152 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "Asistente de AFS Client" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "&Siguiente >",IDNEXT,162,131,50,14 - PUSHBUTTON "Cance&lar",IDCANCEL,215,131,50,14 - CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,112 - CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,91,7,174,112 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,125,258,1 - PUSHBUTTON "A&yuda",9,59,131,50,14 - PUSHBUTTON "< &Anterior",IDBACK,112,131,50,14 -END - -IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 174, 125 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "El Servicio de AFS Client no se ha iniciado todavía.", - IDC_STATIC,0,0,173,8 - LTEXT "Para iniciar el Servicio de AFS Client, pulse en Siguiente.", - IDC_STATIC,0,65,173,17 - LTEXT "Hasta que se esté ejecutando el Servicio de AFS Client, no podrá utilizar archivos almacenados en AFS. ", - IDC_STATIC,0,17,173,17 - LTEXT "Para dejar detenido el Servicio de AFS Client, pulse en Cancelar.", - IDC_STATIC,0,88,173,19 -END - -IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 215, 117 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "El Servicio de AFS Client está ejecutándose en este momento, pero todavía no ha obtenido ninguna señal para utilizar AFS. ", - IDC_STATIC,0,0,203,18 - CONTROL "No obtener señales para ninguna célula",IDC_NOCREDS, - "Button",BS_AUTORADIOBUTTON,10,28,146,10 - CONTROL "Obtener señales en la siguiente célula:",IDC_YESCREDS, - "Button",BS_AUTORADIOBUTTON,10,44,147,10 - LTEXT "&Célula de AFS:",IDC_STATIC,34,65,58,8 - EDITTEXT IDC_NEWCREDS_CELL,99,63,96,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "&Nombre de usuario:",IDC_STATIC,34,82,62,8 - EDITTEXT IDC_NEWCREDS_USER,99,80,96,14,ES_AUTOHSCROLL - LTEXT "C&ontraseña:",IDC_STATIC,33,100,61,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,99,97,96,14,ES_PASSWORD | - ES_AUTOHSCROLL -END - -IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Espere por favor; el Servicio de AFS Client se está iniciando...", - IDC_START_TRY,0,33,173,8 - LTEXT "No ha podido iniciarse el Servicio de AFS Client.\n\nCompruebe la configuración de red y utilice el icono de AFS del Panel de control para comprobar la configuración del AFS Client en este sistema.", - IDC_START_FAIL,0,25,173,45 -END - -IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 270, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Para acceder a los archivos almacenados en AFS, debe correlacionar letras de unidad con las vías de acceso de AFS.", - IDC_STATIC,0,0,255,16 - CONTROL "&No correlacionar ninguna letra de unidad con las vías de acceso de AFS", - IDC_NOMAP,"Button",BS_AUTORADIOBUTTON,10,23,245,10 - CONTROL "C&orrelacionar al menos una letra de unidad con una vía de acceso de AFS:", - IDC_YESMAP,"Button",BS_AUTORADIOBUTTON,10,40,253,10 - LTEXT "&Letra de unidad:",IDC_STATIC,34,58,72,8 - COMBOBOX IDC_MAP_LETTER,112,56,48,125,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Vía de acceso de AFS:",IDC_STATIC,34,76,78,8 - EDITTEXT IDC_MAP_PATH,112,74,96,14,ES_AUTOHSCROLL - LTEXT "D&escripción:",IDC_STATIC,34,94,71,8 - EDITTEXT IDC_MAP_DESC,112,92,60,14,ES_AUTOHSCROLL -END - -IDD_TERMINATE DIALOGEX 0, 0, 305, 117 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Client" -FONT 9, "MS Shell Dlg" -BEGIN - PUSHBUTTON "&Eliminar icono",IDOK,180,96,63,14 - PUSHBUTTON "Cance&lar",IDCANCEL,248,96,50,14 - LTEXT "Ha optado por eliminar el icono AFS Client de la barra de tareas del sistema. A menos que el icono AFS Client esté en la barra de tareas del sistema, AFS no podrá advertirle del momento en que las señales de AFS estén a punto de caducar.", - IDC_STATIC,7,7,291,25 - LTEXT "El Servicio de AFS Client se está ejecutando en la actualidad. Si lo desea, puede detenerlo en este momento.", - IDC_STATIC,7,41,291,8 - CONTROL "&Dejar el Servicio de AFS Client en ejecución", - IDC_LEAVE,"Button",BS_AUTORADIOBUTTON,26,55,228,10 - CONTROL "De&tener el Servicio de AFS Client",IDC_STOP,"Button", - BS_AUTORADIOBUTTON,26,69,228,10 - CONTROL "M&ostrar el icono cuando se reinicie el sistema", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,98, - 156,10 -END - -IDD_TERMINATE_SMALL DIALOGEX 0, 0, 299, 69 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Client" -FONT 9, "MS Shell Dlg" -BEGIN - PUSHBUTTON "&Eliminar icono",IDOK,175,48,63,14 - PUSHBUTTON "Cance&lar",IDCANCEL,242,48,50,14 - LTEXT "Ha optado por eliminar el icono AFS Client de la barra de tareas del sistema. A menos que el icono AFS Client esté en la barra de tareas del sistema, AFS no podrá advertirle del momento en que las señales de AFS estén a punto de caducar.", - -1,7,7,285,25 - CONTROL "M&ostrar el icono cuando se reinicie el sistema", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49, - 158,10 -END - -IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 301, 69 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Light" -FONT 9, "MS Shell Dlg" -BEGIN - PUSHBUTTON "&Eliminar icono",IDOK,176,47,63,14 - PUSHBUTTON "Cance&lar",IDCANCEL,243,47,50,14 - LTEXT "Ha optado por eliminar el icono AFS Light de la barra de tareas del sistema. A menos que el icono AFS Light esté en la barra de tareas del sistema, AFS no podrá advertirle del momento en que las señales de AFS estén a punto de caducar.", - -1,7,7,277,25 - CONTROL "M&ostrar el icono cuando se reinicie el sistema", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49, - 161,10 -END - -IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Una o más de las letras de unidad elegidas no ha podido correlacionarse con las vías de acceso apropiadas de AFS.\n\nEs posible que necesite cerrar algunas aplicaciones que ya están intentando utilizar vías de acceso de AFS.", - IDC_MAP_FAIL,1,26,173,58 - LTEXT "Espere por favor; correlacionando letras de unidad con las vías de acceso de AFS...", - IDC_MAP_TRY,0,33,173,8 -END - -IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "El AFS Client ya está preparado para su utilización.", - IDC_STATIC,0,0,173,8 - LTEXT "Para cerrar este asistente, pulse en Finalizar.", - IDC_STATIC,0,73,173,8 -END - -IDD_MAPPING DIALOG DISCARDABLE 0, 0, 292, 151 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Correlacionar letra de unidad" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Puede correlacionar letras de unidad en el sistema con vías de acceso de AFS.\n\nPor ejemplo, si correlaciona Q: como \\afs\\acme.com\\usr\\bob, los archivos disponibles en AFS como \\afs\\acme.com\\usr\\bob\\* resultarán visibles en Q:\\", - IDC_STATIC,7,7,278,38 - LTEXT "&Letra de unidad:",IDC_STATIC,23,53,77,8 - COMBOBOX IDC_MAP_LETTER,102,51,56,162,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Vía de acceso de AFS:",IDC_STATIC,23,71,74,8 - EDITTEXT IDC_MAP_PATH,102,68,178,13,ES_AUTOHSCROLL - LTEXT "D&escripción:",IDC_STATIC,23,88,76,8 - EDITTEXT IDC_MAP_DESC,102,86,60,13,ES_AUTOHSCROLL - CONTROL "&Restaurar esta correlación cada vez que se inicie la sesión", - IDC_MAP_PERSISTENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 73,105,205,10 - DEFPUSHBUTTON "Aceptar",IDOK,118,130,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,177,130,50,14 - PUSHBUTTON "Ayuda",9,235,130,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 303 - TOPMARGIN, 8 - BOTTOMMARGIN, 123 - END - - IDD_TAB_CREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_NOCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_ADVANCED, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_NEWCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 254 - TOPMARGIN, 7 - BOTTOMMARGIN, 120 - END - - IDD_NEWCREDS_EXPIRE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 148 - END - - IDD_TAB_MOUNT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 298 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_WIZARD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 265 - TOPMARGIN, 7 - BOTTOMMARGIN, 145 - END - - IDD_WIZ_START, DIALOG - BEGIN - BOTTOMMARGIN, 112 - END - - IDD_WIZ_CREDS, DIALOG - BEGIN - RIGHTMARGIN, 174 - BOTTOMMARGIN, 112 - END - - IDD_WIZ_MOUNT, DIALOG - BEGIN - RIGHTMARGIN, 174 - END - - IDD_TERMINATE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 298 - TOPMARGIN, 7 - BOTTOMMARGIN, 110 - END - - IDD_TERMINATE_SMALL, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 292 - TOPMARGIN, 7 - BOTTOMMARGIN, 62 - END - - IDD_TERMINATE_SMALL_95, DIALOG - BEGIN - RIGHTMARGIN, 291 - BOTTOMMARGIN, 68 - END - - IDD_MAPPING, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 285 - TOPMARGIN, 7 - BOTTOMMARGIN, 144 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_TRAYICON MENU DISCARDABLE -BEGIN - MENUITEM "&Mostrar señales...", M_ACTIVATE - MENUITEM "A&visar antes de la caducidad", M_REMIND, CHECKED - MENUITEM SEPARATOR - MENUITEM "&Eliminar icono", M_TERMINATE -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" -IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_TOOLTIP "AFS Client" - IDS_CREDENTIALS "Señales" - IDS_UNKNOWN "(desconocido)" - IDS_ADVANCED "Avanzado" - IDS_CREDS "%1 (caducan las señales %2)" - IDS_NO_CREDS "(no tiene señales en esta célula)" - IDS_SERVICE_BROKEN "El Servicio de AFS Client no está debidamente instalado, o no se tiene autorización para consultar su estado." - IDS_SERVICE_RUNNING "El Servicio de AFS Client se está ejecutando normalmente." - IDS_SERVICE_STOPPED "El Servicio de AFS Client está detenido en la actualidad." - IDS_SERVICE_STOPPING "Espere por favor; el Servicio de AFS Client se está deteniendo..." - IDS_SERVICE_STARTING "Espere por favor; el Servicio de AFS Client se está iniciando..." - IDS_SERVICE_UNKNOWN "No ha podido determinarse el estado del Servicio de AFS Client." - IDS_SERVICE_FAIL_STOP "No ha podido detenerse satisfactoriamente el Servicio de AFS Client. Es posible que no disponga de autorización para efectuar esta operación.\n\nError 0x%1." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_MAP "Error al correlacionar unidad de red" - IDS_ERROR_MAP_DESC "AFS no ha podido correlacionar unidad de red con la vía de acceso especificada en AFS. Asegúrese de que la letra de unidad no se está utilizando en la actualidad.\n\nError: 0x%1." - IDS_ERROR_UNMAP "Error al correlacionar unidad de red" - IDS_ERROR_UNMAP_DESC "AFS no ha podido descorrelacionar unidad de red especificada. Asegúrese de que la letra de unidad no se está utilizando en la actualidad.\n\nError: 0x%1." - IDS_CELL_GATEWAY "%s (por medio de pasarela %s)" - IDS_BADMAP_TITLE "Error al correlacionar unidad de red" - IDS_BADMAP_DESC "AFS no ha podido correlacionar una letra de unidad con la vía de acceso especificada debido a que la vía de acceso no comienza por ""\\afs"".\n\nAsegúrese de que la vía de acceso entrada comienza por ""\\afs"" y vuélvalo a intentar." - IDS_UNCONFIG_TITLE "Error - AFS Client" - IDS_UNCONFIG_DESC "El AFS Client no puede utilizarse porque todavía no se ha configurado.\n\nPara configurar el AFS Client, abra el Panel de control y efectúe una doble pulsación en el icono AFS Client." - IDS_NEWSUB_TITLE "Precaución - AFS Client" - IDS_NEWSUB_DESC "AFS no ha podido utilizar la descripción especificada al conectar la unidad de red.\n\nLa descripción especificada ya se ha utilizado para otra vía de acceso de AFS diferente. " - IDS_BADSUB_TITLE "Error - AFS Client" - IDS_BADSUB_DESC "No puede utilizarse la descripción de la letra de unidad entrada.\n\nUna descripción de letra de unidad no puede tener más de 12 caracteres y no puede contener ni espacios ni tabuladores. " - IDS_TITLE_95 "AFS Light" - IDS_TOOLTIP_95 "AFS Light" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_FAIL_START "No ha podido iniciarse satisfactoriamente el Servicio de AFS Client. Es posible que no disponga de autorización para efectuar esta operación.\n\nError 0x%1." - IDS_SERVICE_FAIL_CONFIG "No han podido cambiarse los parámetros de arranque del Servicio de AFS Client. Es posible que no disponga de autorización para efectuar esta operación.\n\nError 0x%1." - IDS_SERVICE_ERROR "Error al configurar el servicio" - IDS_ERROR_TITLE "Error - AFS Client" - IDS_ERROR_DESTROY_NOCM "Las señales de la célula %1 no han podido destruirse debido a que el Servicio de AFS Client no está respondiendo.\n\nCompruebe el tabulador Avanzado para ver si el AFS Client se está ejecutando debidamente.\n\nError: %2" - IDS_ERROR_DESTROY_UNKNOWN - "Las señales de la célula %1 no han podido destruirse.\n\nCompruebe el tabulador Avanzado para ver si el AFS Client se está ejecutando debidamente.\n\nError: %2" - IDS_ERROR_OBTAIN "El AFS Client no ha podido obtener señales como %2 en la célula %1.\n\nError: %4 (%3)" - IDS_TITLE_VERSION "AFS Versión %s" - IDS_TITLE_VERSION_NOPATCH "AFS Versión %s" - IDS_MOUNT_SOME "Ha optado por correlacionar las siguientes letras de unidad con las vías de acceso de AFS:" - IDS_MOUNT_NONE "Sigue sin optar por correlacionar ninguna letra de unidad con las vías de acceso de AFS." - IDS_MOUNT "Letras de unidad" - IDS_WIZ_NEXT "&Siguiente >" - IDS_WIZ_FINISH "&Finalizar" - IDS_MAP_LETTER "Unidad *:" - IDS_DRIVE_MAP "Unidad %1: \t%2" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_TITLE_95 "Error - AFS Light" - IDS_ERROR_DESTROY_95 "Las señales de la célula %1 no han podido destruirse.\n\nError: %2" - IDS_ERROR_OBTAIN_95 "AFS Light no ha podido obtener señales como %2 en la célula %1.\n\nError: %4 (%3)" - IDS_UNCONFIG_TITLE_95 "Error - AFS Light" - IDS_UNCONFIG_DESC_95 "AFS Light no puede utilizarse porque todavía no se ha configurado.\n\nPara configurar AFS Light, abra el Panel de control y efectúe una doble pulsación en el icono Configuración de AFS Light." - IDS_NEWSUB_TITLE_95 "Precaución - AFS Light" - IDS_BADSUB_TITLE_95 "Error - AFS Light" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "afscreds.ico" +IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" +IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" +IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_MAIN DIALOG DISCARDABLE 0, 0, 310, 130 +STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS Client" +CLASS "AfsCreds" +FONT 9, "MS Shell Dlg" +BEGIN + RTEXT "AFS Versión %s (parche %lu)",IDC_TITLE_VERSION,213,8,90, + 8 + LTEXT "Registrado actualmente en Redes de Windows como ""%s""", + IDC_TITLE_NT,7,8,203,8 + CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,26,296,97 +END + +IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Célula: ",IDC_STATIC,7,9,24,8 + LTEXT "(ninguna)",IDC_CREDS_CELL,51,9,193,8 + LTEXT "Señales:",IDC_STATIC,7,26,27,8 + LTEXT "(ninguna)",IDC_CREDS_INFO,51,26,193,8 + CONTROL "&Mostrar un aviso antes de que caduquen estas señales", + IDC_CREDS_REMIND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 51,43,193,10 + PUSHBUTTON "&Obtener señales nuevas...",IDC_CREDS_OBTAIN,51,63,88, + 14 + PUSHBUTTON "&Descartar estas señales",IDC_CREDS_DESTROY,142,63,92, + 14 + PUSHBUTTON "Ayuda",9,237,63,45,14 +END + +IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "No dispone de señales dentro de ninguna célula de AFS.", + IDC_RUNNING,7,9,275,8 + LTEXT "El AFS Client no se ha configurado debidamente o el servicio de AFS Client no se está ejecutando.\n\nUtilice el tabulador Avanzado para iniciar el servicio de AFS Client.", + IDC_STOPPED,7,9,275,25 + PUSHBUTTON "Ayuda",9,237,63,45,14 + PUSHBUTTON "&Obtener señales nuevas...",IDC_CREDS_OBTAIN,51,63,88, + 14 +END + +IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "(consultando...)",IDC_SERVICE_STATUS,7,9,275,8 + PUSHBUTTON "&Iniciar servicio",IDC_SERVICE_START,51,28,63,14 + PUSHBUTTON "De&tener servicio",IDC_SERVICE_STOP,118,28,63,14 + PUSHBUTTON "&Configurar AFS Client",IDC_OPEN_CPL,185,28,97,14 + CONTROL "Inici&ar el Servicio de AFS Client cada vez que se reinicia este sistema", + IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, + 51,275,10 + CONTROL "&Mostrar siempre el icono AFS Client en la barra de tareas", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65, + 214,10 + PUSHBUTTON "Ayuda",9,237,63,45,14 +END + +IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 261, 127 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Obtener señales nuevas de AFS" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Para obtener señales nuevas de AFS, entre el nombre de usuario de AFS y la contraseña de la cuenta de AFS. Puede disponer de señales en múltiples células de AFS al mismo tiempo.", + IDC_STATIC,7,7,247,24 + LTEXT "&Célula de AFS:",IDC_STATIC,24,42,68,8 + EDITTEXT IDC_NEWCREDS_CELL,93,40,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "&Nombre de usuario:",IDC_STATIC,24,60,68,8 + EDITTEXT IDC_NEWCREDS_USER,93,58,97,14,ES_AUTOHSCROLL + LTEXT "C&ontraseña:",IDC_STATIC,23,78,56,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,93,76,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "Aceptar",IDOK,76,106,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,140,106,50,14 + PUSHBUTTON "Ayuda",9,204,106,50,14 +END + +IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Obtener señales nuevas de AFS" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Para obtener señales nuevas de AFS, entre el nombre de usuario de AFS y la contraseña de la cuenta de AFS. Puede disponer de señales en múltiples células de AFS al mismo tiempo.", + IDC_STATIC,7,29,218,24 + LTEXT "&Célula de AFS:",IDC_STATIC,24,70,52,8 + EDITTEXT IDC_NEWCREDS_CELL,89,68,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "&Nombre de usuario:",IDC_STATIC,24,88,64,8 + EDITTEXT IDC_NEWCREDS_USER,89,86,97,14,ES_AUTOHSCROLL + LTEXT "C&ontraseña:",IDC_STATIC,23,106,58,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,89,104,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "Las señales de la célula %1 están a punto de caducar.", + IDC_NEWCREDS_TITLE,7,7,218,16 + DEFPUSHBUTTON "Aceptar",IDOK,69,134,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,122,134,50,14 + PUSHBUTTON "Ayuda",9,175,134,50,14 +END + +IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 305, 81 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Ha optado por correlacionar las siguientes letras de unidad con vías de acceso de AFS:", + IDC_TITLE,7,8,278,8 + PUSHBUTTON "&Añadir...",IDC_ADD,51,63,45,14 + PUSHBUTTON "&Cambiar...",IDC_EDIT,99,63,45,14 + PUSHBUTTON "&Eliminar",IDC_REMOVE,147,63,45,14 + CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x1d3,59,21,231,37 + PUSHBUTTON "Ayuda",9,246,63,45,14 +END + +IDD_WIZARD DIALOGEX 0, 0, 272, 152 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "Asistente de AFS Client" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "&Siguiente >",IDNEXT,162,131,50,14 + PUSHBUTTON "Cance&lar",IDCANCEL,215,131,50,14 + CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,112 + CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,91,7,174,112 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,125,258,1 + PUSHBUTTON "A&yuda",9,59,131,50,14 + PUSHBUTTON "< &Anterior",IDBACK,112,131,50,14 +END + +IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 174, 125 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "El Servicio de AFS Client no se ha iniciado todavía.", + IDC_STATIC,0,0,173,8 + LTEXT "Para iniciar el Servicio de AFS Client, pulse en Siguiente.", + IDC_STATIC,0,65,173,17 + LTEXT "Hasta que se esté ejecutando el Servicio de AFS Client, no podrá utilizar archivos almacenados en AFS. ", + IDC_STATIC,0,17,173,17 + LTEXT "Para dejar detenido el Servicio de AFS Client, pulse en Cancelar.", + IDC_STATIC,0,88,173,19 +END + +IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 215, 117 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "El Servicio de AFS Client está ejecutándose en este momento, pero todavía no ha obtenido ninguna señal para utilizar AFS. ", + IDC_STATIC,0,0,203,18 + CONTROL "No obtener señales para ninguna célula",IDC_NOCREDS, + "Button",BS_AUTORADIOBUTTON,10,28,146,10 + CONTROL "Obtener señales en la siguiente célula:",IDC_YESCREDS, + "Button",BS_AUTORADIOBUTTON,10,44,147,10 + LTEXT "&Célula de AFS:",IDC_STATIC,34,65,58,8 + EDITTEXT IDC_NEWCREDS_CELL,99,63,96,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "&Nombre de usuario:",IDC_STATIC,34,82,62,8 + EDITTEXT IDC_NEWCREDS_USER,99,80,96,14,ES_AUTOHSCROLL + LTEXT "C&ontraseña:",IDC_STATIC,33,100,61,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,99,97,96,14,ES_PASSWORD | + ES_AUTOHSCROLL +END + +IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Espere por favor; el Servicio de AFS Client se está iniciando...", + IDC_START_TRY,0,33,173,8 + LTEXT "No ha podido iniciarse el Servicio de AFS Client.\n\nCompruebe la configuración de red y utilice el icono de AFS del Panel de control para comprobar la configuración del AFS Client en este sistema.", + IDC_START_FAIL,0,25,173,45 +END + +IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 270, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Para acceder a los archivos almacenados en AFS, debe correlacionar letras de unidad con las vías de acceso de AFS.", + IDC_STATIC,0,0,255,16 + CONTROL "&No correlacionar ninguna letra de unidad con las vías de acceso de AFS", + IDC_NOMAP,"Button",BS_AUTORADIOBUTTON,10,23,245,10 + CONTROL "C&orrelacionar al menos una letra de unidad con una vía de acceso de AFS:", + IDC_YESMAP,"Button",BS_AUTORADIOBUTTON,10,40,253,10 + LTEXT "&Letra de unidad:",IDC_STATIC,34,58,72,8 + COMBOBOX IDC_MAP_LETTER,112,56,48,125,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Vía de acceso de AFS:",IDC_STATIC,34,76,78,8 + EDITTEXT IDC_MAP_PATH,112,74,96,14,ES_AUTOHSCROLL + LTEXT "D&escripción:",IDC_STATIC,34,94,71,8 + EDITTEXT IDC_MAP_DESC,112,92,60,14,ES_AUTOHSCROLL +END + +IDD_TERMINATE DIALOGEX 0, 0, 305, 117 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Client" +FONT 9, "MS Shell Dlg" +BEGIN + PUSHBUTTON "&Eliminar icono",IDOK,180,96,63,14 + PUSHBUTTON "Cance&lar",IDCANCEL,248,96,50,14 + LTEXT "Ha optado por eliminar el icono AFS Client de la barra de tareas del sistema. A menos que el icono AFS Client esté en la barra de tareas del sistema, AFS no podrá advertirle del momento en que las señales de AFS estén a punto de caducar.", + IDC_STATIC,7,7,291,25 + LTEXT "El Servicio de AFS Client se está ejecutando en la actualidad. Si lo desea, puede detenerlo en este momento.", + IDC_STATIC,7,41,291,8 + CONTROL "&Dejar el Servicio de AFS Client en ejecución", + IDC_LEAVE,"Button",BS_AUTORADIOBUTTON,26,55,228,10 + CONTROL "De&tener el Servicio de AFS Client",IDC_STOP,"Button", + BS_AUTORADIOBUTTON,26,69,228,10 + CONTROL "M&ostrar el icono cuando se reinicie el sistema", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,98, + 156,10 +END + +IDD_TERMINATE_SMALL DIALOGEX 0, 0, 299, 69 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Client" +FONT 9, "MS Shell Dlg" +BEGIN + PUSHBUTTON "&Eliminar icono",IDOK,175,48,63,14 + PUSHBUTTON "Cance&lar",IDCANCEL,242,48,50,14 + LTEXT "Ha optado por eliminar el icono AFS Client de la barra de tareas del sistema. A menos que el icono AFS Client esté en la barra de tareas del sistema, AFS no podrá advertirle del momento en que las señales de AFS estén a punto de caducar.", + -1,7,7,285,25 + CONTROL "M&ostrar el icono cuando se reinicie el sistema", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49, + 158,10 +END + +IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 301, 69 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Light" +FONT 9, "MS Shell Dlg" +BEGIN + PUSHBUTTON "&Eliminar icono",IDOK,176,47,63,14 + PUSHBUTTON "Cance&lar",IDCANCEL,243,47,50,14 + LTEXT "Ha optado por eliminar el icono AFS Light de la barra de tareas del sistema. A menos que el icono AFS Light esté en la barra de tareas del sistema, AFS no podrá advertirle del momento en que las señales de AFS estén a punto de caducar.", + -1,7,7,277,25 + CONTROL "M&ostrar el icono cuando se reinicie el sistema", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49, + 161,10 +END + +IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Una o más de las letras de unidad elegidas no ha podido correlacionarse con las vías de acceso apropiadas de AFS.\n\nEs posible que necesite cerrar algunas aplicaciones que ya están intentando utilizar vías de acceso de AFS.", + IDC_MAP_FAIL,1,26,173,58 + LTEXT "Espere por favor; correlacionando letras de unidad con las vías de acceso de AFS...", + IDC_MAP_TRY,0,33,173,8 +END + +IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "El AFS Client ya está preparado para su utilización.", + IDC_STATIC,0,0,173,8 + LTEXT "Para cerrar este asistente, pulse en Finalizar.", + IDC_STATIC,0,73,173,8 +END + +IDD_MAPPING DIALOG DISCARDABLE 0, 0, 292, 151 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Correlacionar letra de unidad" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Puede correlacionar letras de unidad en el sistema con vías de acceso de AFS.\n\nPor ejemplo, si correlaciona Q: como \\afs\\acme.com\\usr\\bob, los archivos disponibles en AFS como \\afs\\acme.com\\usr\\bob\\* resultarán visibles en Q:\\", + IDC_STATIC,7,7,278,38 + LTEXT "&Letra de unidad:",IDC_STATIC,23,53,77,8 + COMBOBOX IDC_MAP_LETTER,102,51,56,162,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Vía de acceso de AFS:",IDC_STATIC,23,71,74,8 + EDITTEXT IDC_MAP_PATH,102,68,178,13,ES_AUTOHSCROLL + LTEXT "D&escripción:",IDC_STATIC,23,88,76,8 + EDITTEXT IDC_MAP_DESC,102,86,60,13,ES_AUTOHSCROLL + CONTROL "&Restaurar esta correlación cada vez que se inicie la sesión", + IDC_MAP_PERSISTENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 73,105,205,10 + DEFPUSHBUTTON "Aceptar",IDOK,118,130,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,177,130,50,14 + PUSHBUTTON "Ayuda",9,235,130,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 303 + TOPMARGIN, 8 + BOTTOMMARGIN, 123 + END + + IDD_TAB_CREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_NOCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_ADVANCED, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_NEWCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 120 + END + + IDD_NEWCREDS_EXPIRE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 148 + END + + IDD_TAB_MOUNT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 298 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_WIZARD, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 265 + TOPMARGIN, 7 + BOTTOMMARGIN, 145 + END + + IDD_WIZ_START, DIALOG + BEGIN + BOTTOMMARGIN, 112 + END + + IDD_WIZ_CREDS, DIALOG + BEGIN + RIGHTMARGIN, 174 + BOTTOMMARGIN, 112 + END + + IDD_WIZ_MOUNT, DIALOG + BEGIN + RIGHTMARGIN, 174 + END + + IDD_TERMINATE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 298 + TOPMARGIN, 7 + BOTTOMMARGIN, 110 + END + + IDD_TERMINATE_SMALL, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 292 + TOPMARGIN, 7 + BOTTOMMARGIN, 62 + END + + IDD_TERMINATE_SMALL_95, DIALOG + BEGIN + RIGHTMARGIN, 291 + BOTTOMMARGIN, 68 + END + + IDD_MAPPING, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 285 + TOPMARGIN, 7 + BOTTOMMARGIN, 144 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_TRAYICON MENU DISCARDABLE +BEGIN + MENUITEM "&Mostrar señales...", M_ACTIVATE + MENUITEM "A&visar antes de la caducidad", M_REMIND, CHECKED + MENUITEM SEPARATOR + MENUITEM "&Eliminar icono", M_TERMINATE +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" +IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP "AFS Client" + IDS_TOOLTIP_95 "AFS Light" + IDS_CREDENTIALS "Señales" + IDS_UNKNOWN "(desconocido)" + IDS_ADVANCED "Avanzado" + IDS_CREDS "%1 (caducan las señales %2)" + IDS_NO_CREDS "(no tiene señales en esta célula)" + IDS_SERVICE_BROKEN "El Servicio de AFS Client no está debidamente instalado, o no se tiene autorización para consultar su estado." + IDS_SERVICE_RUNNING "El Servicio de AFS Client se está ejecutando normalmente." + IDS_SERVICE_STOPPED "El Servicio de AFS Client está detenido en la actualidad." + IDS_SERVICE_STOPPING "Espere por favor; el Servicio de AFS Client se está deteniendo..." + IDS_SERVICE_STARTING "Espere por favor; el Servicio de AFS Client se está iniciando..." + IDS_SERVICE_UNKNOWN "No ha podido determinarse el estado del Servicio de AFS Client." + IDS_SERVICE_FAIL_STOP "No ha podido detenerse satisfactoriamente el Servicio de AFS Client. Es posible que no disponga de autorización para efectuar esta operación.\n\nError 0x%1." + IDS_SERVICE_FAIL_START "No ha podido iniciarse satisfactoriamente el Servicio de AFS Client. Es posible que no disponga de autorización para efectuar esta operación.\n\nError 0x%1." + IDS_SERVICE_FAIL_CONFIG "No han podido cambiarse los parámetros de arranque del Servicio de AFS Client. Es posible que no disponga de autorización para efectuar esta operación.\n\nError 0x%1." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_ERROR "Error al configurar el servicio" + IDS_ERROR_TITLE "Error - AFS Client" + IDS_ERROR_TITLE_95 "Error - AFS Light" + IDS_ERROR_DESTROY_95 "Las señales de la célula %1 no han podido destruirse.\n\nError: %2" + IDS_ERROR_DESTROY_NOCM "Las señales de la célula %1 no han podido destruirse debido a que el Servicio de AFS Client no está respondiendo.\n\nCompruebe el tabulador Avanzado para ver si el AFS Client se está ejecutando debidamente.\n\nError: %2" + IDS_ERROR_DESTROY_UNKNOWN + "Las señales de la célula %1 no han podido destruirse.\n\nCompruebe el tabulador Avanzado para ver si el AFS Client se está ejecutando debidamente.\n\nError: %2" + IDS_ERROR_OBTAIN "El AFS Client no ha podido obtener señales como %2 en la célula %1.\n\nError: %4 (%3)" + IDS_ERROR_OBTAIN_95 "AFS Light no ha podido obtener señales como %2 en la célula %1.\n\nError: %4 (%3)" + IDS_TITLE_VERSION "AFS Versión %s" + IDS_TITLE_VERSION_NOPATCH "AFS Versión %s" + IDS_MOUNT_SOME "Ha optado por correlacionar las siguientes letras de unidad con las vías de acceso de AFS:" + IDS_MOUNT_NONE "Sigue sin optar por correlacionar ninguna letra de unidad con las vías de acceso de AFS." + IDS_MOUNT "Letras de unidad" + IDS_WIZ_NEXT "&Siguiente >" + IDS_WIZ_FINISH "&Finalizar" + IDS_MAP_LETTER "Unidad *:" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DRIVE_MAP "Unidad %1: \t%2" + IDS_ERROR_MAP "Error al correlacionar unidad de red" + IDS_ERROR_MAP_DESC "AFS no ha podido correlacionar unidad de red con la vía de acceso especificada en AFS. Asegúrese de que la letra de unidad no se está utilizando en la actualidad.\n\nError: 0x%1." + IDS_ERROR_UNMAP "Error al correlacionar unidad de red" + IDS_ERROR_UNMAP_DESC "AFS no ha podido descorrelacionar unidad de red especificada. Asegúrese de que la letra de unidad no se está utilizando en la actualidad.\n\nError: 0x%1." + IDS_CELL_GATEWAY "%s (por medio de pasarela %s)" + IDS_BADMAP_TITLE "Error al correlacionar unidad de red" + IDS_BADMAP_DESC "AFS no ha podido correlacionar una letra de unidad con la vía de acceso especificada debido a que la vía de acceso no comienza por ""\\afs"".\n\nAsegúrese de que la vía de acceso entrada comienza por ""\\afs"" y vuélvalo a intentar." + IDS_UNCONFIG_TITLE_95 "Error - AFS Light" + IDS_UNCONFIG_DESC_95 "AFS Light no puede utilizarse porque todavía no se ha configurado.\n\nPara configurar AFS Light, abra el Panel de control y efectúe una doble pulsación en el icono Configuración de AFS Light." + IDS_UNCONFIG_TITLE "Error - AFS Client" + IDS_UNCONFIG_DESC "El AFS Client no puede utilizarse porque todavía no se ha configurado.\n\nPara configurar el AFS Client, abra el Panel de control y efectúe una doble pulsación en el icono AFS Client." + IDS_NEWSUB_TITLE "Precaución - AFS Client" + IDS_NEWSUB_TITLE_95 "Precaución - AFS Light" + IDS_NEWSUB_DESC "AFS no ha podido utilizar la descripción especificada al conectar la unidad de red.\n\nLa descripción especificada ya se ha utilizado para otra vía de acceso de AFS diferente. " + IDS_BADSUB_TITLE "Error - AFS Client" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADSUB_TITLE_95 "Error - AFS Light" + IDS_BADSUB_DESC "No puede utilizarse la descripción de la letra de unidad entrada.\n\nUna descripción de letra de unidad no puede tener más de 12 caracteres y no puede contener ni espacios ni tabuladores. " + IDS_TITLE_95 "AFS Light" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/client_creds/lang/ja_JP/afscreds.rc b/src/WINNT/client_creds/lang/ja_JP/afscreds.rc index 3e92ac7f9..878b985ba 100644 --- a/src/WINNT/client_creds/lang/ja_JP/afscreds.rc +++ b/src/WINNT/client_creds/lang/ja_JP/afscreds.rc @@ -7,28 +7,28 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Japanese resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) -#ifdef _WIN32 -LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Japanese resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) +#ifdef _WIN32 +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// // Version // @@ -42,550 +42,550 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT #include "..\..\config\NTVersioninfo.rc" ///////////////////////////////////////////////////////////////////////////// // -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "afscreds.ico" -IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" -IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" -IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_MAIN DIALOG DISCARDABLE 0, 0, 307, 131 -STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS ƒNƒ‰ƒCƒAƒ“ƒg" -CLASS "AfsCreds" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - RTEXT "AFS ƒo[ƒWƒ‡ƒ“ %s (ƒpƒbƒ` %lu)",IDC_TITLE_VERSION,152, - 19,146,8 - LTEXT "Œ»ÝAŽŸ‚Ì–¼‘O‚Å Windows Networking ‚É ƒƒOƒIƒ“‚µ‚Ä‚¢‚Ü‚·B""%s""", - IDC_TITLE_NT,7,5,293,8 - CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,29,293,97 -END - -IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒZƒ‹: ",IDC_STATIC,7,9,24,8 - LTEXT "(‚È‚µ)",IDC_CREDS_CELL,51,9,231,8 - LTEXT "ƒg[ƒNƒ“:",IDC_STATIC,7,26,34,8 - LTEXT "(‚È‚µ)",IDC_CREDS_INFO,51,26,231,8 - CONTROL "‚±‚ê‚ç‚̃g[ƒNƒ“‚ÌŠúŒÀØ‚ê‘O‚ÉŒx‚ð•\ަ(&S)", - IDC_CREDS_REMIND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 51,43,193,10 - PUSHBUTTON "V‹Kƒg[ƒNƒ“‚̎擾(&O)...",IDC_CREDS_OBTAIN,21,63,98,14 - PUSHBUTTON "‚±‚ê‚ç‚̃g[ƒNƒ“‚ð”jŠü(&D)",IDC_CREDS_DESTROY,122,63, - 109,14 - PUSHBUTTON "ƒwƒ‹ƒv",9,237,63,45,14 -END - -IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "‚Ç‚Ì AFS ƒZƒ‹“à‚É‚àƒg[ƒNƒ“‚ª‚ ‚è‚Ü‚¹‚ñB",IDC_RUNNING, - 7,9,155,8 - LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒg‚ª³‚µ‚­\¬‚³‚ê‚Ä‚¢‚È‚¢‚©A‚Ü‚½‚Í AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ªŽÀs‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB\n\nuŠg’£vƒ^ƒu‚ðŽg—p‚µ‚Ä AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŠJŽn‚µ‚Ä‚­‚¾‚³‚¢B", - IDC_STOPPED,7,23,275,34 - PUSHBUTTON "ƒwƒ‹ƒv",9,237,63,45,14 - PUSHBUTTON "V‹Kƒg[ƒNƒ“‚̎擾(&O)...",IDC_CREDS_OBTAIN,51,63,98,14 -END - -IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "(Æ‰ï’†...)",IDC_SERVICE_STATUS,7,7,275,14 - PUSHBUTTON "ƒT[ƒrƒX‚ÌŠJŽn(&S)",IDC_SERVICE_START,13,28,77,14 - PUSHBUTTON "ƒT[ƒrƒX‚Ì’âŽ~(&T)",IDC_SERVICE_STOP,91,28,77,14 - PUSHBUTTON "AFS ƒNƒ‰ƒCƒAƒ“ƒg‚̍\¬(&C)",IDC_OPEN_CPL,169,28,109,14 - CONTROL "‚±‚̃Rƒ“ƒsƒ…[ƒ^[‚̍Ďn“®Žž‚É AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŠJŽn(&R)", - IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, - 51,268,10 - CONTROL "í‚Ƀ^ƒXƒNƒo[‚É AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒAƒCƒRƒ“‚ð•\ަ(&A)", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65, - 220,10 - PUSHBUTTON "ƒwƒ‹ƒv",9,237,63,45,14 -END - -IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 232, 127 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "V‹K AFS ƒg[ƒNƒ“‚̎擾" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "V‹K AFS ƒg[ƒNƒ“‚ðŽæ“¾‚·‚é‚ɂ́AAFS ƒAƒJƒEƒ“ƒg‚Ì AFS ƒ†[ƒU[–¼‚ƃpƒXƒ[ƒh‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B•¡” AFS ƒZƒ‹‚Ƀg[ƒNƒ“‚𓯎ž‚ÉŽ‚‚±‚Æ‚ª‚Å‚«‚Ü‚·B", - IDC_STATIC,7,7,218,24 - LTEXT "AFS ƒZƒ‹(&C):",IDC_STATIC,23,42,53,8 - EDITTEXT IDC_NEWCREDS_CELL,87,40,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "ƒ†[ƒU[–¼(&N):",IDC_STATIC,23,60,53,8 - EDITTEXT IDC_NEWCREDS_USER,87,58,97,14,ES_AUTOHSCROLL - LTEXT "ƒpƒXƒ[ƒh(&P):",IDC_STATIC,23,78,53,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,87,76,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "—¹‰ð",IDOK,69,106,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,122,106,50,14 - PUSHBUTTON "ƒwƒ‹ƒv",9,175,106,50,14 -END - -IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "V‹K AFS ƒg[ƒNƒ“‚̎擾" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "V‹K AFS ƒg[ƒNƒ“‚ðŽæ“¾‚·‚é‚ɂ́AAFS ƒAƒJƒEƒ“ƒg‚Ì AFS ƒ†[ƒU[–¼‚ƃpƒXƒ[ƒh‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B•¡” AFS ƒZƒ‹‚Ƀg[ƒNƒ“‚𓯎ž‚ÉŽ‚‚±‚Æ‚ª‚Å‚«‚Ü‚·B", - IDC_STATIC,7,32,218,24 - LTEXT "AFS ƒZƒ‹(&C):",IDC_STATIC,23,70,57,8 - EDITTEXT IDC_NEWCREDS_CELL,87,68,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "ƒ†[ƒU[–¼(&N):",IDC_STATIC,23,88,57,8 - EDITTEXT IDC_NEWCREDS_USER,87,86,97,14,ES_AUTOHSCROLL - LTEXT "ƒpƒXƒ[ƒh(&P):",IDC_STATIC,23,106,57,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,87,104,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "%1 ƒZƒ‹“à‚̃g[ƒNƒ“‚Ì—LŒøŠúŒÀ‚ª‚Ü‚à‚È‚­Ø‚ê‚Ü‚·B", - IDC_NEWCREDS_TITLE,7,7,218,18 - DEFPUSHBUTTON "—¹‰ð",IDOK,69,134,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,122,134,50,14 - PUSHBUTTON "ƒwƒ‹ƒv",9,175,134,50,14 -END - -IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ˆÈ‰º‚̃hƒ‰ƒCƒu–¼‚Ì AFS “à‚̃pƒX‚ւ̃}ƒbƒsƒ“ƒO‚ð‘I‘ð‚µ‚Ü‚µ‚½:", - IDC_TITLE,7,8,275,8 - PUSHBUTTON "’ljÁ(&A)...",IDC_ADD,51,63,45,14 - PUSHBUTTON "•ύX(&C)...",IDC_EDIT,99,63,45,14 - PUSHBUTTON "íœ(&R)",IDC_REMOVE,147,63,45,14 - CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x1d3,51,21,231,37 - PUSHBUTTON "ƒwƒ‹ƒv",9,237,63,45,14 -END - -IDD_WIZARD DIALOGEX 0, 0, 346, 153 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒEƒBƒU[ƒh" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "ŽŸ‚Ö(&N) >",IDNEXT,229,132,50,14 - PUSHBUTTON "ŽæÁ‚µ(&L)",IDCANCEL,281,132,50,14 - CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,112 - CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,91,7,240,112 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,125,324,1 - PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,125,132,50,14 - PUSHBUTTON "< –ß‚é(&B)",IDBACK,177,132,50,14 -END - -IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 240, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ª‚Ü‚¾ŠJŽn‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB", - IDC_STATIC,0,5,209,8 - LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŠJŽn‚·‚é‚ɂ́AuŽŸ‚ցv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B", - IDC_STATIC,0,73,233,8 - LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ªŽÀs‚³‚ê‚é‚܂ŁAAFS ‚ɕۊǂ³‚ê‚Ä‚¢‚éƒtƒ@ƒCƒ‹‚ÍŽg—p‚Å‚«‚Ü‚¹‚ñB", - IDC_STATIC,0,17,233,17 - LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ð’âŽ~‚µ‚½‚܂܂ɂ·‚é‚ɂ́AuŽæÁ‚µv‚ðƒNƒŠƒbƒNB", - IDC_STATIC,0,86,233,10 -END - -IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 240, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ÍŽÀs‚³‚ê‚Ä‚¢‚Ü‚·‚ªAAFS ‚ðŽg—p‚·‚邽‚߂̃g[ƒNƒ“‚ð‚Ü‚¾Žæ“¾‚µ‚Ä‚¢‚Ü‚¹‚ñB", - IDC_STATIC,0,3,173,20 - CONTROL "‚¢‚¸‚ê‚̃Zƒ‹‚É‚àƒg[ƒNƒ“‚ðŽæ“¾‚µ‚È‚¢",IDC_NOCREDS, - "Button",BS_AUTORADIOBUTTON,10,27,155,10 - CONTROL "ŽŸ‚̃Zƒ‹‚̃g[ƒNƒ“‚ðŽæ“¾:",IDC_YESCREDS,"Button", - BS_AUTORADIOBUTTON,10,41,141,10 - LTEXT "AFS ƒZƒ‹(&C):",IDC_STATIC,14,60,57,8 - EDITTEXT IDC_NEWCREDS_CELL,77,58,96,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "ƒ†[ƒU[–¼(&N):",IDC_STATIC,14,78,57,8 - EDITTEXT IDC_NEWCREDS_USER,77,76,96,14,ES_AUTOHSCROLL - LTEXT "ƒpƒXƒ[ƒh(&P):",IDC_STATIC,13,96,57,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,77,93,96,14,ES_PASSWORD | - ES_AUTOHSCROLL -END - -IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 240, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "‚¨‘Ò‚¿‚­‚¾‚³‚¢BAFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŠJŽn’†‚Å‚·...", - IDC_START_TRY,0,25,240,8 - LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŠJŽn‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒlƒbƒgƒ[ƒNÝ’è‚ðŠm”F‚µA‚Ü‚½ƒRƒ“ƒgƒ[ƒ‹Eƒpƒlƒ‹‚Ì AFS ƒAƒCƒRƒ“‚ðŽg—p‚µ‚āA‚±‚̃Rƒ“ƒsƒ…[ƒ^[ã‚Ì AFS ƒNƒ‰ƒCƒAƒ“ƒg‚̍\¬‚ðŠm”F‚µ‚Ä‚­‚¾‚³‚¢B", - IDC_START_FAIL,0,25,240,51 -END - -IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 240, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "AFS ‚ɕۊǂ³‚ꂽƒtƒ@ƒCƒ‹‚ɃAƒNƒZƒX‚·‚é‚ɂ́AAFS “à‚̃pƒX‚Ƀhƒ‰ƒCƒu–¼‚ðƒ}ƒbƒsƒ“ƒO‚·‚é•K—v‚ª‚ ‚è‚Ü‚·B", - IDC_STATIC,3,4,223,16 - CONTROL "ƒhƒ‰ƒCƒu–¼‚ð AFS ‚̃pƒX‚Ƀ}ƒbƒsƒ“ƒO‚µ‚È‚¢(&D)", - IDC_NOMAP,"Button",BS_AUTORADIOBUTTON,10,25,189,10 - CONTROL "­‚È‚­‚Æ‚à 1 ‚‚̃hƒ‰ƒCƒu–¼‚ð AFS ‚̃pƒX‚Ƀ}ƒbƒsƒ“ƒO(&M):", - IDC_YESMAP,"Button",BS_AUTORADIOBUTTON,9,40,230,10 - LTEXT "ƒhƒ‰ƒCƒu–¼(&L):",IDC_STATIC,34,58,56,8 - COMBOBOX IDC_MAP_LETTER,97,56,48,125,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS ƒpƒX(&P):",IDC_STATIC,34,76,50,8 - EDITTEXT IDC_MAP_PATH,97,74,96,14,ES_AUTOHSCROLL - LTEXT "‹Lq(&E):",IDC_STATIC,34,94,33,8 - EDITTEXT IDC_MAP_DESC,97,92,60,14,ES_AUTOHSCROLL -END - -IDD_TERMINATE DIALOGEX 0, 0, 291, 117 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS ƒNƒ‰ƒCƒAƒ“ƒg" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 -BEGIN - PUSHBUTTON "ƒAƒCƒRƒ“‚̍폜(&R)",IDOK,147,95,77,14 - PUSHBUTTON "ŽæÁ‚µ(&L)",IDCANCEL,234,95,50,14 - LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒAƒCƒRƒ“‚ðƒRƒ“ƒsƒ…[ƒ^[‚̃^ƒXƒNƒo[‚©‚çíœ‚·‚邿‚¤‘I‘ð‚µ‚Ü‚µ‚½BAFS ƒNƒ‰ƒCƒAƒ“ƒgEƒAƒCƒRƒ“‚ªƒRƒ“ƒsƒ…[ƒ^[‚̃^ƒXƒNƒo[‚ɂȂ¢ê‡AAFS ‚Í AFS ƒg[ƒNƒ“‚ÌŠúŒÀØ‚ꂪ‹ß‚¢‚Ä‚àŒx‚ðo‚¹‚Ü‚¹‚ñB", - IDC_STATIC,7,4,277,26 - LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ÍŒ»ÝŽÀs’†‚Å‚·B•K—v‚Ȃ炢‚Ü’âŽ~‚Å‚«‚Ü‚·B", - IDC_STATIC,7,38,279,12 - CONTROL "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŽÀs‚³‚¹‚Ä‚¨‚­(&L)", - IDC_LEAVE,"Button",BS_AUTORADIOBUTTON,26,53,193,10 - CONTROL "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ð’âŽ~‚·‚é(&S)",IDC_STOP, - "Button",BS_AUTORADIOBUTTON,26,67,170,10 - CONTROL "ƒRƒ“ƒsƒ…[ƒ^[‚̍Ďn“®Žž‚ɃAƒCƒRƒ“‚ð•\ަ(&H)", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,83, - 186,10 -END - -IDD_TERMINATE_SMALL DIALOGEX 0, 0, 291, 68 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS ƒNƒ‰ƒCƒAƒ“ƒg" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 -BEGIN - PUSHBUTTON "ƒAƒCƒRƒ“‚̍폜(&R)",IDOK,153,46,77,14 - PUSHBUTTON "ŽæÁ‚µ(&L)",IDCANCEL,234,46,50,14 - LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒAƒCƒRƒ“‚ðƒRƒ“ƒsƒ…[ƒ^[‚̃^ƒXƒNƒo[‚©‚çíœ‚·‚邿‚¤‘I‘ð‚µ‚Ü‚µ‚½BAFS ƒNƒ‰ƒCƒAƒ“ƒgEƒAƒCƒRƒ“‚ªƒRƒ“ƒsƒ…[ƒ^[‚̃^ƒXƒNƒo[‚ɂȂ¢ê‡AAFS ‚Í AFS ƒg[ƒNƒ“‚ÌŠúŒÀØ‚ꂪ‹ß‚¢‚Ä‚àŒx‚ðo‚¹‚Ü‚¹‚ñB", - -1,7,5,277,26 - CONTROL "ƒRƒ“ƒsƒ…[ƒ^[‚̍Ďn“®Žž‚ɃAƒCƒRƒ“‚ð•\ަ(&H)", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,35, - 160,10 -END - -IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 291, 68 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Light" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 -BEGIN - PUSHBUTTON "ƒAƒCƒRƒ“‚̍폜(&R)",IDOK,154,53,77,14 - PUSHBUTTON "ŽæÁ‚µ(&L)",IDCANCEL,234,53,50,14 - LTEXT "AFS Light ƒAƒCƒRƒ“‚ðƒRƒ“ƒsƒ…[ƒ^[‚̃^ƒXƒNƒo[‚©‚çíœ‚·‚邱‚Æ‚ð‘I‘ð‚µ‚Ü‚µ‚½BAFS Light ƒAƒCƒRƒ“‚ªƒRƒ“ƒsƒ…[ƒ^[‚̃^ƒXƒNƒo[‚ɂȂ¢ê‡AAFS ‚Í AFS ƒg[ƒNƒ“‚ÌŠúŒÀØ‚ꂪ‹ß‚¢‚Ä‚àŒx‚ðo‚¹‚Ü‚¹‚ñB", - -1,7,7,277,25 - CONTROL "ƒRƒ“ƒsƒ…[ƒ^[‚̍Ďn“®Žž‚ɃAƒCƒRƒ“‚ð•\ަ(&H)", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,41, - 186,10 -END - -IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 240, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "‘I‘ð‚µ‚½ 1 ‚‚܂½‚Í•¡”‚̃hƒ‰ƒCƒu–¼‚ð AFS “à‚Ì“KØ‚ȃpƒX‚Ƀ}ƒbƒsƒ“ƒO‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\n‚·‚Å‚É AFS “à‚̃pƒX‚ÌŽg—p‚µ‚悤‚Æ‚µ‚Ä‚¢‚éƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚ðƒNƒ[ƒY‚·‚é•K—v‚ª‚ ‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B", - IDC_MAP_FAIL,0,26,240,41 - LTEXT "‚¨‘Ò‚¿‚­‚¾‚³‚¢Bƒhƒ‰ƒCƒu–¼‚ð AFS “à‚̃pƒX‚Ƀ}ƒbƒsƒ“ƒO’†‚Å‚·...", - IDC_MAP_TRY,0,33,240,8 -END - -IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 240, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒg‚ÍŽg—p‚̏€”õ‚ª‚Å‚«‚Ü‚µ‚½B",IDC_STATIC, - 0,0,173,8 - LTEXT "‚±‚̃EƒBƒU[ƒh‚̃Nƒ[ƒY‚ɂ́AuI—¹v‚ðƒNƒŠƒbƒNB", - IDC_STATIC,0,73,200,8 -END - -IDD_MAPPING DIALOG DISCARDABLE 0, 0, 275, 152 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "ƒhƒ‰ƒCƒu–¼‚̃}ƒbƒsƒ“ƒO" -FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" -BEGIN - LTEXT "ƒRƒ“ƒsƒ…[ƒ^[‚̃hƒ‰ƒCƒu–¼‚ð AFS “à‚̃pƒX‚Ƀ}ƒbƒsƒ“ƒO‚Å‚«‚Ü‚·B\n\n‚½‚Æ‚¦‚΁AQ: ‚ð \\afs\\acme.com\\usr\\bob ‚Æ‚µ‚ă}ƒbƒsƒ“ƒO‚·‚邯AAFS ‚Å \\afs\\acme.com\\usr\\bob\\* ‚Æ‚µ‚ÄŽg—p‰Â”\‚ȃtƒ@ƒCƒ‹‚Í Q:\\ ‚ʼnŽ‹‚ɂȂè‚Ü‚·B", - IDC_STATIC,7,7,261,36 - LTEXT "ƒhƒ‰ƒCƒu–¼(&L):",IDC_STATIC,23,53,49,8 - COMBOBOX IDC_MAP_LETTER,83,51,56,162,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS ƒpƒX(&P):",IDC_STATIC,23,70,49,8 - EDITTEXT IDC_MAP_PATH,83,68,178,13,ES_AUTOHSCROLL - LTEXT "‹Lq(&E):",IDC_STATIC,23,88,49,8 - EDITTEXT IDC_MAP_DESC,83,86,60,13,ES_AUTOHSCROLL - CONTROL "ƒƒOƒIƒ“Žž‚É‚±‚̃}ƒbƒsƒ“ƒO‚𕜌³(&R)", - IDC_MAP_PERSISTENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 73,109,154,10 - DEFPUSHBUTTON "—¹‰ð",IDOK,112,131,50,14 - PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,165,131,50,14 - PUSHBUTTON "ƒwƒ‹ƒv",9,218,131,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 300 - TOPMARGIN, 5 - BOTTOMMARGIN, 126 - END - - IDD_TAB_CREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_NOCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_ADVANCED, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 7 - BOTTOMMARGIN, 77 - END - - IDD_NEWCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 120 - END - - IDD_NEWCREDS_EXPIRE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 148 - END - - IDD_TAB_MOUNT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_WIZARD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 331 - TOPMARGIN, 7 - BOTTOMMARGIN, 146 - END - - IDD_WIZ_START, DIALOG - BEGIN - RIGHTMARGIN, 233 - END - - IDD_WIZ_MOUNT, DIALOG - BEGIN - RIGHTMARGIN, 239 - END - - IDD_TERMINATE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 284 - TOPMARGIN, 7 - BOTTOMMARGIN, 110 - END - - IDD_TERMINATE_SMALL, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 284 - TOPMARGIN, 7 - BOTTOMMARGIN, 61 - END - - IDD_MAPPING, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 268 - TOPMARGIN, 7 - BOTTOMMARGIN, 145 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_TRAYICON MENU DISCARDABLE -BEGIN - MENUITEM "ƒg[ƒNƒ“‚Ì•\ަ(&S)...", M_ACTIVATE - MENUITEM "ŠúŒÀØ‚ê‘O‚ÉŒx(&W)", M_REMIND, CHECKED - MENUITEM SEPARATOR - MENUITEM "ƒAƒCƒRƒ“‚̍폜(&R)", M_TERMINATE -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" -IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_TOOLTIP "AFS ƒNƒ‰ƒCƒAƒ“ƒg" - IDS_CREDENTIALS "ƒg[ƒNƒ“" - IDS_UNKNOWN "(•s–¾)" - IDS_ADVANCED "Šg’£" - IDS_CREDS "%1 (ƒg[ƒNƒ“‚ÌŠúŒÀØ‚ê %2)" - IDS_NO_CREDS "(‚±‚̃Zƒ‹‚Ƀg[ƒNƒ“‚ª‚ ‚è‚Ü‚¹‚ñ)" - IDS_SERVICE_BROKEN "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ª³‚µ‚­ƒCƒ“ƒXƒg[ƒ‹‚³‚ê‚Ä‚¢‚È‚¢‚©A‚Ü‚½‚Í‚»‚Ìó‹µ‚ðÆ‰ï‚·‚錠ŒÀ‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñB" - IDS_SERVICE_RUNNING "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚͐³í‚ÉŽÀs‚³‚ê‚Ä‚¢‚Ü‚·B" - IDS_SERVICE_STOPPED "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ÍŒ»Ý’âŽ~‚³‚ê‚Ä‚¢‚Ü‚·B" - IDS_SERVICE_STOPPING "‚¨‘Ò‚¿‚­‚¾‚³‚¢BAFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ð’âŽ~’†‚Å‚·..." - IDS_SERVICE_STARTING "‚¨‘Ò‚¿‚­‚¾‚³‚¢BAFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŠJŽn’†‚Å‚·..." - IDS_SERVICE_UNKNOWN "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚̏󋵂𔻕ʂł«‚Ü‚¹‚ñ‚Å‚µ‚½B" - IDS_SERVICE_FAIL_STOP "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚𐳏í‚É’âŽ~‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B‚±‚Ì‘€ì‚ðŽÀs‚·‚錠ŒÀ‚ðŽ‚Á‚Ä‚¢‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·B\n\nƒGƒ‰[ 0x%1 " -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_MAP "ƒlƒbƒgƒ[ƒNEƒhƒ‰ƒCƒu‚̃}ƒbƒsƒ“ƒOEƒGƒ‰[" - IDS_ERROR_MAP_DESC "AFS ‚Í AFS “à‚ÌŽw’肳‚ꂽƒpƒX‚Ƀlƒbƒgƒ[ƒNEƒhƒ‰ƒCƒu‚ðƒ}ƒbƒsƒ“ƒO‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½Bƒhƒ‰ƒCƒu–¼‚ªŒ»ÝŽg—p’†‚łȂ¢‚©‚ðŠm‚©‚߂Ă­‚¾‚³‚¢B\n\nƒGƒ‰[: 0x%1 " - IDS_ERROR_UNMAP "ƒlƒbƒgƒ[ƒNEƒhƒ‰ƒCƒu‚̃}ƒbƒsƒ“ƒOEƒGƒ‰[" - IDS_ERROR_UNMAP_DESC "AFS ‚ÍŽw’肳‚ꂽƒlƒbƒgƒ[ƒNEƒhƒ‰ƒCƒu‚ðƒ}ƒbƒsƒ“ƒO‰ðœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½Bƒhƒ‰ƒCƒu–¼‚ªŒ»ÝŽg—p’†‚łȂ¢‚©‚ðŠm‚©‚߂Ă­‚¾‚³‚¢B\n\nƒGƒ‰[: 0x%1" - IDS_CELL_GATEWAY "%s (ƒQ[ƒgƒEƒFƒC %s Œo—R)" - IDS_BADMAP_TITLE "ƒlƒbƒgƒ[ƒNEƒhƒ‰ƒCƒu‚̃}ƒbƒsƒ“ƒOEƒGƒ‰[" - IDS_BADMAP_DESC "ƒpƒX‚ª ""\\afs"" ‚ÅŽn‚Ü‚Á‚Ä‚¢‚È‚¢‚½‚߁AAFS ‚̓hƒ‰ƒCƒu–¼‚ðŽw’肳‚ꂽƒpƒX‚Ƀ}ƒbƒsƒ“ƒO‚Å‚«‚Ü‚¹‚ñB\n\n“ü—Í‚µ‚½ƒpƒX‚ª ""\\afs"" ‚ÅŽn‚Ü‚Á‚Ä‚¢‚é‚©‚ðŠm‚©‚߂Ă©‚çA‚â‚è’¼‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_UNCONFIG_TITLE "ƒGƒ‰[ - AFS ƒNƒ‰ƒCƒAƒ“ƒg" - IDS_UNCONFIG_DESC "AFS ƒNƒ‰ƒCƒAƒ“ƒg‚ª\¬‚³‚ê‚Ä‚¢‚È‚¢‚½‚ߎg—p‚Å‚«‚Ü‚¹‚ñB\n\nAFS ƒNƒ‰ƒCƒAƒ“ƒg‚ð\¬‚·‚é‚ɂ́AƒRƒ“ƒgƒ[ƒ‹Eƒpƒlƒ‹‚ðŠJ‚¢‚āuAFS ƒNƒ‰ƒCƒAƒ“ƒgvƒAƒCƒRƒ“‚ðƒ_ƒuƒ‹ƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_NEWSUB_TITLE "’ˆÓ - AFS ƒNƒ‰ƒCƒAƒ“ƒg" - IDS_NEWSUB_DESC "AFS ‚̓lƒbƒgƒ[ƒNEƒhƒ‰ƒCƒu‚̐ڑ±Žž‚ÉŽw’肳‚ꂽ‹Lq‚ðŽg—p‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nŽw’肳‚ꂽ‹Lq‚Í‚·‚łɑ¼‚Ì AFS ƒpƒX‚ÉŽg—p‚³‚ê‚Ä‚¢‚Ü‚·B" - IDS_BADSUB_TITLE "ƒGƒ‰[ - AFS ƒNƒ‰ƒCƒAƒ“ƒg" - IDS_BADSUB_DESC "“ü—Í‚µ‚½ƒhƒ‰ƒCƒu–¼‹Lq‚ðŽg—p‚Å‚«‚Ü‚¹‚ñB\n\nƒhƒ‰ƒCƒu–¼‚Ì‹Lq‚Í 12 •¶Žš‚ð’´‚¦‚Ă͂Ȃ炸AƒXƒy[ƒX‚Ü‚½‚̓^ƒu‚ðŠÜ‚ñ‚Å‚¢‚Ă͂¢‚¯‚Ü‚¹‚ñB" - IDS_TITLE_95 "AFS Light" - IDS_TOOLTIP_95 "AFS Light" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_FAIL_START "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚𐳏í‚ÉŠJŽn‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B‚±‚Ì‘€ì‚ðŽÀs‚·‚錠ŒÀ‚ðŽ‚Á‚Ä‚¢‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·B\n\nƒGƒ‰[ 0x%1" - IDS_SERVICE_FAIL_CONFIG "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ÌŽn“®ƒpƒ‰ƒ[ƒ^[‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B‚±‚Ì‘€ì‚ðŽÀs‚·‚錠ŒÀ‚ðŽ‚Á‚Ä‚¢‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·B\n\nƒGƒ‰[ 0x%1" - IDS_SERVICE_ERROR "ƒT[ƒrƒX‚̍\¬ƒGƒ‰[" - IDS_ERROR_TITLE "ƒGƒ‰[ - AFS ƒNƒ‰ƒCƒAƒ“ƒg" - IDS_ERROR_DESTROY_NOCM "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ª‰ž“š‚µ‚Ä‚¢‚È‚¢‚½‚߁A%1 ƒZƒ‹‚̃g[ƒNƒ“‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nAFS ƒNƒ‰ƒCƒAƒ“ƒg‚ª³í‚ÉŽÀs‚³‚ê‚Ä‚¢‚é‚©‚ðuŠg’£vƒ^ƒu‚Å’²‚ׂĂ­‚¾‚³‚¢B\n\nƒGƒ‰[: %2" - IDS_ERROR_DESTROY_UNKNOWN - "%1 ƒZƒ‹‚̃g[ƒNƒ“‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nAFS ƒNƒ‰ƒCƒAƒ“ƒg‚ª³í‚ÉŽÀs‚³‚ê‚Ä‚¢‚é‚©‚ðuŠg’£vƒ^ƒu‚Å’²‚ׂĂ­‚¾‚³‚¢B\n\nƒGƒ‰[: %2" - IDS_ERROR_OBTAIN "AFS ƒNƒ‰ƒCƒAƒ“ƒg‚ªƒZƒ‹ %1 ‚Å %2 ‚Æ‚µ‚ăg[ƒNƒ“‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒGƒ‰[: %4 (%3)" - IDS_TITLE_VERSION "AFS ƒo[ƒWƒ‡ƒ“ %s" - IDS_TITLE_VERSION_NOPATCH "AFS ƒo[ƒWƒ‡ƒ“ %s" - IDS_MOUNT_SOME "ˆÈ‰º‚̃hƒ‰ƒCƒu–¼‚Ì AFS “à‚̃pƒX‚ւ̃}ƒbƒsƒ“ƒO‚ð‘I‘ð‚µ‚Ü‚µ‚½:" - IDS_MOUNT_NONE "ƒhƒ‰ƒCƒu–¼‚Ì AFS “à‚̃pƒX‚ւ̃}ƒbƒsƒ“ƒO‚ð‘I‘ð‚µ‚Ä‚¢‚Ü‚¹‚ñB" - IDS_MOUNT "ƒhƒ‰ƒCƒu–¼" - IDS_WIZ_NEXT "ŽŸ‚Ö(&N) >" - IDS_WIZ_FINISH "I—¹(&F)" - IDS_MAP_LETTER "ƒhƒ‰ƒCƒu *:" - IDS_DRIVE_MAP "ƒhƒ‰ƒCƒu %1: \t%2" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_TITLE_95 "ƒGƒ‰[ - AFS Light " - IDS_ERROR_DESTROY_95 "%1 ƒZƒ‹‚̃g[ƒNƒ“‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒGƒ‰[: %2" - IDS_ERROR_OBTAIN_95 "AFS Light ‚ªƒZƒ‹ %1 ‚Å %2 ‚Æ‚µ‚ăg[ƒNƒ“‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒGƒ‰[: %4 (%3)" - IDS_UNCONFIG_TITLE_95 "ƒGƒ‰[ - AFS Light " - IDS_UNCONFIG_DESC_95 "AFS Light ‚ª\¬‚³‚ê‚Ä‚¢‚È‚¢‚½‚ߎg—p‚Å‚«‚Ü‚¹‚ñB\n\nAFS Light ‚ð\¬‚·‚é‚ɂ́AƒRƒ“ƒgƒ[ƒ‹Eƒpƒlƒ‹‚ðŠJ‚¢‚āuAFS Light \¬vƒAƒCƒRƒ“‚ðƒ_ƒuƒ‹ƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" - IDS_NEWSUB_TITLE_95 "’ˆÓ - AFS Light " - IDS_BADSUB_TITLE_95 "ƒGƒ‰[ - AFS Light " -END - -#endif // Japanese resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "afscreds.ico" +IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" +IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" +IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_MAIN DIALOG DISCARDABLE 0, 0, 307, 131 +STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS ƒNƒ‰ƒCƒAƒ“ƒg" +CLASS "AfsCreds" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + RTEXT "AFS ƒo[ƒWƒ‡ƒ“ %s (ƒpƒbƒ` %lu)",IDC_TITLE_VERSION,152, + 19,146,8 + LTEXT "Œ»ÝAŽŸ‚Ì–¼‘O‚Å Windows Networking ‚É ƒƒOƒIƒ“‚µ‚Ä‚¢‚Ü‚·B""%s""", + IDC_TITLE_NT,7,5,293,8 + CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,29,293,97 +END + +IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒZƒ‹: ",IDC_STATIC,7,9,24,8 + LTEXT "(‚È‚µ)",IDC_CREDS_CELL,51,9,231,8 + LTEXT "ƒg[ƒNƒ“:",IDC_STATIC,7,26,34,8 + LTEXT "(‚È‚µ)",IDC_CREDS_INFO,51,26,231,8 + CONTROL "‚±‚ê‚ç‚̃g[ƒNƒ“‚ÌŠúŒÀØ‚ê‘O‚ÉŒx‚ð•\ަ(&S)", + IDC_CREDS_REMIND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 51,43,193,10 + PUSHBUTTON "V‹Kƒg[ƒNƒ“‚̎擾(&O)...",IDC_CREDS_OBTAIN,21,63,98,14 + PUSHBUTTON "‚±‚ê‚ç‚̃g[ƒNƒ“‚ð”jŠü(&D)",IDC_CREDS_DESTROY,122,63, + 109,14 + PUSHBUTTON "ƒwƒ‹ƒv",9,237,63,45,14 +END + +IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "‚Ç‚Ì AFS ƒZƒ‹“à‚É‚àƒg[ƒNƒ“‚ª‚ ‚è‚Ü‚¹‚ñB",IDC_RUNNING, + 7,9,155,8 + LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒg‚ª³‚µ‚­\¬‚³‚ê‚Ä‚¢‚È‚¢‚©A‚Ü‚½‚Í AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ªŽÀs‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB\n\nuŠg’£vƒ^ƒu‚ðŽg—p‚µ‚Ä AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŠJŽn‚µ‚Ä‚­‚¾‚³‚¢B", + IDC_STOPPED,7,23,275,34 + PUSHBUTTON "ƒwƒ‹ƒv",9,237,63,45,14 + PUSHBUTTON "V‹Kƒg[ƒNƒ“‚̎擾(&O)...",IDC_CREDS_OBTAIN,51,63,98,14 +END + +IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "(Æ‰ï’†...)",IDC_SERVICE_STATUS,7,7,275,14 + PUSHBUTTON "ƒT[ƒrƒX‚ÌŠJŽn(&S)",IDC_SERVICE_START,13,28,77,14 + PUSHBUTTON "ƒT[ƒrƒX‚Ì’âŽ~(&T)",IDC_SERVICE_STOP,91,28,77,14 + PUSHBUTTON "AFS ƒNƒ‰ƒCƒAƒ“ƒg‚̍\¬(&C)",IDC_OPEN_CPL,169,28,109,14 + CONTROL "‚±‚̃Rƒ“ƒsƒ…[ƒ^[‚̍Ďn“®Žž‚É AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŠJŽn(&R)", + IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, + 51,268,10 + CONTROL "í‚Ƀ^ƒXƒNƒo[‚É AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒAƒCƒRƒ“‚ð•\ަ(&A)", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65, + 220,10 + PUSHBUTTON "ƒwƒ‹ƒv",9,237,63,45,14 +END + +IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 232, 127 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "V‹K AFS ƒg[ƒNƒ“‚̎擾" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "V‹K AFS ƒg[ƒNƒ“‚ðŽæ“¾‚·‚é‚ɂ́AAFS ƒAƒJƒEƒ“ƒg‚Ì AFS ƒ†[ƒU[–¼‚ƃpƒXƒ[ƒh‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B•¡” AFS ƒZƒ‹‚Ƀg[ƒNƒ“‚𓯎ž‚ÉŽ‚‚±‚Æ‚ª‚Å‚«‚Ü‚·B", + IDC_STATIC,7,7,218,24 + LTEXT "AFS ƒZƒ‹(&C):",IDC_STATIC,23,42,53,8 + EDITTEXT IDC_NEWCREDS_CELL,87,40,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "ƒ†[ƒU[–¼(&N):",IDC_STATIC,23,60,53,8 + EDITTEXT IDC_NEWCREDS_USER,87,58,97,14,ES_AUTOHSCROLL + LTEXT "ƒpƒXƒ[ƒh(&P):",IDC_STATIC,23,78,53,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,87,76,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "—¹‰ð",IDOK,69,106,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,122,106,50,14 + PUSHBUTTON "ƒwƒ‹ƒv",9,175,106,50,14 +END + +IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "V‹K AFS ƒg[ƒNƒ“‚̎擾" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "V‹K AFS ƒg[ƒNƒ“‚ðŽæ“¾‚·‚é‚ɂ́AAFS ƒAƒJƒEƒ“ƒg‚Ì AFS ƒ†[ƒU[–¼‚ƃpƒXƒ[ƒh‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B•¡” AFS ƒZƒ‹‚Ƀg[ƒNƒ“‚𓯎ž‚ÉŽ‚‚±‚Æ‚ª‚Å‚«‚Ü‚·B", + IDC_STATIC,7,32,218,24 + LTEXT "AFS ƒZƒ‹(&C):",IDC_STATIC,23,70,57,8 + EDITTEXT IDC_NEWCREDS_CELL,87,68,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "ƒ†[ƒU[–¼(&N):",IDC_STATIC,23,88,57,8 + EDITTEXT IDC_NEWCREDS_USER,87,86,97,14,ES_AUTOHSCROLL + LTEXT "ƒpƒXƒ[ƒh(&P):",IDC_STATIC,23,106,57,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,87,104,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "%1 ƒZƒ‹“à‚̃g[ƒNƒ“‚Ì—LŒøŠúŒÀ‚ª‚Ü‚à‚È‚­Ø‚ê‚Ü‚·B", + IDC_NEWCREDS_TITLE,7,7,218,18 + DEFPUSHBUTTON "—¹‰ð",IDOK,69,134,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,122,134,50,14 + PUSHBUTTON "ƒwƒ‹ƒv",9,175,134,50,14 +END + +IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ˆÈ‰º‚̃hƒ‰ƒCƒu–¼‚Ì AFS “à‚̃pƒX‚ւ̃}ƒbƒsƒ“ƒO‚ð‘I‘ð‚µ‚Ü‚µ‚½:", + IDC_TITLE,7,8,275,8 + PUSHBUTTON "’ljÁ(&A)...",IDC_ADD,51,63,45,14 + PUSHBUTTON "•ύX(&C)...",IDC_EDIT,99,63,45,14 + PUSHBUTTON "íœ(&R)",IDC_REMOVE,147,63,45,14 + CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x1d3,51,21,231,37 + PUSHBUTTON "ƒwƒ‹ƒv",9,237,63,45,14 +END + +IDD_WIZARD DIALOGEX 0, 0, 346, 153 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒEƒBƒU[ƒh" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "ŽŸ‚Ö(&N) >",IDNEXT,229,132,50,14 + PUSHBUTTON "ŽæÁ‚µ(&L)",IDCANCEL,281,132,50,14 + CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,112 + CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,91,7,240,112 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,125,324,1 + PUSHBUTTON "ƒwƒ‹ƒv(&H)",9,125,132,50,14 + PUSHBUTTON "< –ß‚é(&B)",IDBACK,177,132,50,14 +END + +IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 240, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ª‚Ü‚¾ŠJŽn‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB", + IDC_STATIC,0,5,209,8 + LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŠJŽn‚·‚é‚ɂ́AuŽŸ‚ցv‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B", + IDC_STATIC,0,73,233,8 + LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ªŽÀs‚³‚ê‚é‚܂ŁAAFS ‚ɕۊǂ³‚ê‚Ä‚¢‚éƒtƒ@ƒCƒ‹‚ÍŽg—p‚Å‚«‚Ü‚¹‚ñB", + IDC_STATIC,0,17,233,17 + LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ð’âŽ~‚µ‚½‚܂܂ɂ·‚é‚ɂ́AuŽæÁ‚µv‚ðƒNƒŠƒbƒNB", + IDC_STATIC,0,86,233,10 +END + +IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 240, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ÍŽÀs‚³‚ê‚Ä‚¢‚Ü‚·‚ªAAFS ‚ðŽg—p‚·‚邽‚߂̃g[ƒNƒ“‚ð‚Ü‚¾Žæ“¾‚µ‚Ä‚¢‚Ü‚¹‚ñB", + IDC_STATIC,0,3,173,20 + CONTROL "‚¢‚¸‚ê‚̃Zƒ‹‚É‚àƒg[ƒNƒ“‚ðŽæ“¾‚µ‚È‚¢",IDC_NOCREDS, + "Button",BS_AUTORADIOBUTTON,10,27,155,10 + CONTROL "ŽŸ‚̃Zƒ‹‚̃g[ƒNƒ“‚ðŽæ“¾:",IDC_YESCREDS,"Button", + BS_AUTORADIOBUTTON,10,41,141,10 + LTEXT "AFS ƒZƒ‹(&C):",IDC_STATIC,14,60,57,8 + EDITTEXT IDC_NEWCREDS_CELL,77,58,96,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "ƒ†[ƒU[–¼(&N):",IDC_STATIC,14,78,57,8 + EDITTEXT IDC_NEWCREDS_USER,77,76,96,14,ES_AUTOHSCROLL + LTEXT "ƒpƒXƒ[ƒh(&P):",IDC_STATIC,13,96,57,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,77,93,96,14,ES_PASSWORD | + ES_AUTOHSCROLL +END + +IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 240, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "‚¨‘Ò‚¿‚­‚¾‚³‚¢BAFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŠJŽn’†‚Å‚·...", + IDC_START_TRY,0,25,240,8 + LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŠJŽn‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒlƒbƒgƒ[ƒNÝ’è‚ðŠm”F‚µA‚Ü‚½ƒRƒ“ƒgƒ[ƒ‹Eƒpƒlƒ‹‚Ì AFS ƒAƒCƒRƒ“‚ðŽg—p‚µ‚āA‚±‚̃Rƒ“ƒsƒ…[ƒ^[ã‚Ì AFS ƒNƒ‰ƒCƒAƒ“ƒg‚̍\¬‚ðŠm”F‚µ‚Ä‚­‚¾‚³‚¢B", + IDC_START_FAIL,0,25,240,51 +END + +IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 240, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "AFS ‚ɕۊǂ³‚ꂽƒtƒ@ƒCƒ‹‚ɃAƒNƒZƒX‚·‚é‚ɂ́AAFS “à‚̃pƒX‚Ƀhƒ‰ƒCƒu–¼‚ðƒ}ƒbƒsƒ“ƒO‚·‚é•K—v‚ª‚ ‚è‚Ü‚·B", + IDC_STATIC,3,4,223,16 + CONTROL "ƒhƒ‰ƒCƒu–¼‚ð AFS ‚̃pƒX‚Ƀ}ƒbƒsƒ“ƒO‚µ‚È‚¢(&D)", + IDC_NOMAP,"Button",BS_AUTORADIOBUTTON,10,25,189,10 + CONTROL "­‚È‚­‚Æ‚à 1 ‚‚̃hƒ‰ƒCƒu–¼‚ð AFS ‚̃pƒX‚Ƀ}ƒbƒsƒ“ƒO(&M):", + IDC_YESMAP,"Button",BS_AUTORADIOBUTTON,9,40,230,10 + LTEXT "ƒhƒ‰ƒCƒu–¼(&L):",IDC_STATIC,34,58,56,8 + COMBOBOX IDC_MAP_LETTER,97,56,48,125,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS ƒpƒX(&P):",IDC_STATIC,34,76,50,8 + EDITTEXT IDC_MAP_PATH,97,74,96,14,ES_AUTOHSCROLL + LTEXT "‹Lq(&E):",IDC_STATIC,34,94,33,8 + EDITTEXT IDC_MAP_DESC,97,92,60,14,ES_AUTOHSCROLL +END + +IDD_TERMINATE DIALOGEX 0, 0, 291, 117 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS ƒNƒ‰ƒCƒAƒ“ƒg" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 +BEGIN + PUSHBUTTON "ƒAƒCƒRƒ“‚̍폜(&R)",IDOK,147,95,77,14 + PUSHBUTTON "ŽæÁ‚µ(&L)",IDCANCEL,234,95,50,14 + LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒAƒCƒRƒ“‚ðƒRƒ“ƒsƒ…[ƒ^[‚̃^ƒXƒNƒo[‚©‚çíœ‚·‚邿‚¤‘I‘ð‚µ‚Ü‚µ‚½BAFS ƒNƒ‰ƒCƒAƒ“ƒgEƒAƒCƒRƒ“‚ªƒRƒ“ƒsƒ…[ƒ^[‚̃^ƒXƒNƒo[‚ɂȂ¢ê‡AAFS ‚Í AFS ƒg[ƒNƒ“‚ÌŠúŒÀØ‚ꂪ‹ß‚¢‚Ä‚àŒx‚ðo‚¹‚Ü‚¹‚ñB", + IDC_STATIC,7,4,277,26 + LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ÍŒ»ÝŽÀs’†‚Å‚·B•K—v‚Ȃ炢‚Ü’âŽ~‚Å‚«‚Ü‚·B", + IDC_STATIC,7,38,279,12 + CONTROL "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŽÀs‚³‚¹‚Ä‚¨‚­(&L)", + IDC_LEAVE,"Button",BS_AUTORADIOBUTTON,26,53,193,10 + CONTROL "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ð’âŽ~‚·‚é(&S)",IDC_STOP, + "Button",BS_AUTORADIOBUTTON,26,67,170,10 + CONTROL "ƒRƒ“ƒsƒ…[ƒ^[‚̍Ďn“®Žž‚ɃAƒCƒRƒ“‚ð•\ަ(&H)", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,83, + 186,10 +END + +IDD_TERMINATE_SMALL DIALOGEX 0, 0, 291, 68 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS ƒNƒ‰ƒCƒAƒ“ƒg" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 +BEGIN + PUSHBUTTON "ƒAƒCƒRƒ“‚̍폜(&R)",IDOK,153,46,77,14 + PUSHBUTTON "ŽæÁ‚µ(&L)",IDCANCEL,234,46,50,14 + LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒAƒCƒRƒ“‚ðƒRƒ“ƒsƒ…[ƒ^[‚̃^ƒXƒNƒo[‚©‚çíœ‚·‚邿‚¤‘I‘ð‚µ‚Ü‚µ‚½BAFS ƒNƒ‰ƒCƒAƒ“ƒgEƒAƒCƒRƒ“‚ªƒRƒ“ƒsƒ…[ƒ^[‚̃^ƒXƒNƒo[‚ɂȂ¢ê‡AAFS ‚Í AFS ƒg[ƒNƒ“‚ÌŠúŒÀØ‚ꂪ‹ß‚¢‚Ä‚àŒx‚ðo‚¹‚Ü‚¹‚ñB", + -1,7,5,277,26 + CONTROL "ƒRƒ“ƒsƒ…[ƒ^[‚̍Ďn“®Žž‚ɃAƒCƒRƒ“‚ð•\ަ(&H)", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,35, + 160,10 +END + +IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 291, 68 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Light" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN", 0, 0, 0x1 +BEGIN + PUSHBUTTON "ƒAƒCƒRƒ“‚̍폜(&R)",IDOK,154,53,77,14 + PUSHBUTTON "ŽæÁ‚µ(&L)",IDCANCEL,234,53,50,14 + LTEXT "AFS Light ƒAƒCƒRƒ“‚ðƒRƒ“ƒsƒ…[ƒ^[‚̃^ƒXƒNƒo[‚©‚çíœ‚·‚邱‚Æ‚ð‘I‘ð‚µ‚Ü‚µ‚½BAFS Light ƒAƒCƒRƒ“‚ªƒRƒ“ƒsƒ…[ƒ^[‚̃^ƒXƒNƒo[‚ɂȂ¢ê‡AAFS ‚Í AFS ƒg[ƒNƒ“‚ÌŠúŒÀØ‚ꂪ‹ß‚¢‚Ä‚àŒx‚ðo‚¹‚Ü‚¹‚ñB", + -1,7,7,277,25 + CONTROL "ƒRƒ“ƒsƒ…[ƒ^[‚̍Ďn“®Žž‚ɃAƒCƒRƒ“‚ð•\ަ(&H)", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,41, + 186,10 +END + +IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 240, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "‘I‘ð‚µ‚½ 1 ‚‚܂½‚Í•¡”‚̃hƒ‰ƒCƒu–¼‚ð AFS “à‚Ì“KØ‚ȃpƒX‚Ƀ}ƒbƒsƒ“ƒO‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\n‚·‚Å‚É AFS “à‚̃pƒX‚ÌŽg—p‚µ‚悤‚Æ‚µ‚Ä‚¢‚éƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚ðƒNƒ[ƒY‚·‚é•K—v‚ª‚ ‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B", + IDC_MAP_FAIL,0,26,240,41 + LTEXT "‚¨‘Ò‚¿‚­‚¾‚³‚¢Bƒhƒ‰ƒCƒu–¼‚ð AFS “à‚̃pƒX‚Ƀ}ƒbƒsƒ“ƒO’†‚Å‚·...", + IDC_MAP_TRY,0,33,240,8 +END + +IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 240, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "AFS ƒNƒ‰ƒCƒAƒ“ƒg‚ÍŽg—p‚̏€”õ‚ª‚Å‚«‚Ü‚µ‚½B",IDC_STATIC, + 0,0,173,8 + LTEXT "‚±‚̃EƒBƒU[ƒh‚̃Nƒ[ƒY‚ɂ́AuI—¹v‚ðƒNƒŠƒbƒNB", + IDC_STATIC,0,73,200,8 +END + +IDD_MAPPING DIALOG DISCARDABLE 0, 0, 275, 152 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒhƒ‰ƒCƒu–¼‚̃}ƒbƒsƒ“ƒO" +FONT 9, "‚l‚r ‚oƒSƒVƒbƒN" +BEGIN + LTEXT "ƒRƒ“ƒsƒ…[ƒ^[‚̃hƒ‰ƒCƒu–¼‚ð AFS “à‚̃pƒX‚Ƀ}ƒbƒsƒ“ƒO‚Å‚«‚Ü‚·B\n\n‚½‚Æ‚¦‚΁AQ: ‚ð \\afs\\acme.com\\usr\\bob ‚Æ‚µ‚ă}ƒbƒsƒ“ƒO‚·‚邯AAFS ‚Å \\afs\\acme.com\\usr\\bob\\* ‚Æ‚µ‚ÄŽg—p‰Â”\‚ȃtƒ@ƒCƒ‹‚Í Q:\\ ‚ʼnŽ‹‚ɂȂè‚Ü‚·B", + IDC_STATIC,7,7,261,36 + LTEXT "ƒhƒ‰ƒCƒu–¼(&L):",IDC_STATIC,23,53,49,8 + COMBOBOX IDC_MAP_LETTER,83,51,56,162,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS ƒpƒX(&P):",IDC_STATIC,23,70,49,8 + EDITTEXT IDC_MAP_PATH,83,68,178,13,ES_AUTOHSCROLL + LTEXT "‹Lq(&E):",IDC_STATIC,23,88,49,8 + EDITTEXT IDC_MAP_DESC,83,86,60,13,ES_AUTOHSCROLL + CONTROL "ƒƒOƒIƒ“Žž‚É‚±‚̃}ƒbƒsƒ“ƒO‚𕜌³(&R)", + IDC_MAP_PERSISTENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 73,109,154,10 + DEFPUSHBUTTON "—¹‰ð",IDOK,112,131,50,14 + PUSHBUTTON "ŽæÁ‚µ",IDCANCEL,165,131,50,14 + PUSHBUTTON "ƒwƒ‹ƒv",9,218,131,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 300 + TOPMARGIN, 5 + BOTTOMMARGIN, 126 + END + + IDD_TAB_CREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_NOCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_ADVANCED, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 7 + BOTTOMMARGIN, 77 + END + + IDD_NEWCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 120 + END + + IDD_NEWCREDS_EXPIRE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 148 + END + + IDD_TAB_MOUNT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_WIZARD, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 331 + TOPMARGIN, 7 + BOTTOMMARGIN, 146 + END + + IDD_WIZ_START, DIALOG + BEGIN + RIGHTMARGIN, 233 + END + + IDD_WIZ_MOUNT, DIALOG + BEGIN + RIGHTMARGIN, 239 + END + + IDD_TERMINATE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 110 + END + + IDD_TERMINATE_SMALL, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 61 + END + + IDD_MAPPING, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 268 + TOPMARGIN, 7 + BOTTOMMARGIN, 145 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_TRAYICON MENU DISCARDABLE +BEGIN + MENUITEM "ƒg[ƒNƒ“‚Ì•\ަ(&S)...", M_ACTIVATE + MENUITEM "ŠúŒÀØ‚ê‘O‚ÉŒx(&W)", M_REMIND, CHECKED + MENUITEM SEPARATOR + MENUITEM "ƒAƒCƒRƒ“‚̍폜(&R)", M_TERMINATE +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" +IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP "AFS ƒNƒ‰ƒCƒAƒ“ƒg" + IDS_TOOLTIP_95 "AFS Light" + IDS_CREDENTIALS "ƒg[ƒNƒ“" + IDS_UNKNOWN "(•s–¾)" + IDS_ADVANCED "Šg’£" + IDS_CREDS "%1 (ƒg[ƒNƒ“‚ÌŠúŒÀØ‚ê %2)" + IDS_NO_CREDS "(‚±‚̃Zƒ‹‚Ƀg[ƒNƒ“‚ª‚ ‚è‚Ü‚¹‚ñ)" + IDS_SERVICE_BROKEN "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ª³‚µ‚­ƒCƒ“ƒXƒg[ƒ‹‚³‚ê‚Ä‚¢‚È‚¢‚©A‚Ü‚½‚Í‚»‚Ìó‹µ‚ðÆ‰ï‚·‚錠ŒÀ‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñB" + IDS_SERVICE_RUNNING "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚͐³í‚ÉŽÀs‚³‚ê‚Ä‚¢‚Ü‚·B" + IDS_SERVICE_STOPPED "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ÍŒ»Ý’âŽ~‚³‚ê‚Ä‚¢‚Ü‚·B" + IDS_SERVICE_STOPPING "‚¨‘Ò‚¿‚­‚¾‚³‚¢BAFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ð’âŽ~’†‚Å‚·..." + IDS_SERVICE_STARTING "‚¨‘Ò‚¿‚­‚¾‚³‚¢BAFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ðŠJŽn’†‚Å‚·..." + IDS_SERVICE_UNKNOWN "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚̏󋵂𔻕ʂł«‚Ü‚¹‚ñ‚Å‚µ‚½B" + IDS_SERVICE_FAIL_STOP "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚𐳏í‚É’âŽ~‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B‚±‚Ì‘€ì‚ðŽÀs‚·‚錠ŒÀ‚ðŽ‚Á‚Ä‚¢‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·B\n\nƒGƒ‰[ 0x%1 " + IDS_SERVICE_FAIL_START "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚𐳏í‚ÉŠJŽn‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B‚±‚Ì‘€ì‚ðŽÀs‚·‚錠ŒÀ‚ðŽ‚Á‚Ä‚¢‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·B\n\nƒGƒ‰[ 0x%1" + IDS_SERVICE_FAIL_CONFIG "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ÌŽn“®ƒpƒ‰ƒ[ƒ^[‚ð•ύX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B‚±‚Ì‘€ì‚ðŽÀs‚·‚錠ŒÀ‚ðŽ‚Á‚Ä‚¢‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·B\n\nƒGƒ‰[ 0x%1" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_ERROR "ƒT[ƒrƒX‚̍\¬ƒGƒ‰[" + IDS_ERROR_TITLE "ƒGƒ‰[ - AFS ƒNƒ‰ƒCƒAƒ“ƒg" + IDS_ERROR_TITLE_95 "ƒGƒ‰[ - AFS Light " + IDS_ERROR_DESTROY_95 "%1 ƒZƒ‹‚̃g[ƒNƒ“‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒGƒ‰[: %2" + IDS_ERROR_DESTROY_NOCM "AFS ƒNƒ‰ƒCƒAƒ“ƒgEƒT[ƒrƒX‚ª‰ž“š‚µ‚Ä‚¢‚È‚¢‚½‚߁A%1 ƒZƒ‹‚̃g[ƒNƒ“‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nAFS ƒNƒ‰ƒCƒAƒ“ƒg‚ª³í‚ÉŽÀs‚³‚ê‚Ä‚¢‚é‚©‚ðuŠg’£vƒ^ƒu‚Å’²‚ׂĂ­‚¾‚³‚¢B\n\nƒGƒ‰[: %2" + IDS_ERROR_DESTROY_UNKNOWN + "%1 ƒZƒ‹‚̃g[ƒNƒ“‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nAFS ƒNƒ‰ƒCƒAƒ“ƒg‚ª³í‚ÉŽÀs‚³‚ê‚Ä‚¢‚é‚©‚ðuŠg’£vƒ^ƒu‚Å’²‚ׂĂ­‚¾‚³‚¢B\n\nƒGƒ‰[: %2" + IDS_ERROR_OBTAIN "AFS ƒNƒ‰ƒCƒAƒ“ƒg‚ªƒZƒ‹ %1 ‚Å %2 ‚Æ‚µ‚ăg[ƒNƒ“‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒGƒ‰[: %4 (%3)" + IDS_ERROR_OBTAIN_95 "AFS Light ‚ªƒZƒ‹ %1 ‚Å %2 ‚Æ‚µ‚ăg[ƒNƒ“‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nƒGƒ‰[: %4 (%3)" + IDS_TITLE_VERSION "AFS ƒo[ƒWƒ‡ƒ“ %s" + IDS_TITLE_VERSION_NOPATCH "AFS ƒo[ƒWƒ‡ƒ“ %s" + IDS_MOUNT_SOME "ˆÈ‰º‚̃hƒ‰ƒCƒu–¼‚Ì AFS “à‚̃pƒX‚ւ̃}ƒbƒsƒ“ƒO‚ð‘I‘ð‚µ‚Ü‚µ‚½:" + IDS_MOUNT_NONE "ƒhƒ‰ƒCƒu–¼‚Ì AFS “à‚̃pƒX‚ւ̃}ƒbƒsƒ“ƒO‚ð‘I‘ð‚µ‚Ä‚¢‚Ü‚¹‚ñB" + IDS_MOUNT "ƒhƒ‰ƒCƒu–¼" + IDS_WIZ_NEXT "ŽŸ‚Ö(&N) >" + IDS_WIZ_FINISH "I—¹(&F)" + IDS_MAP_LETTER "ƒhƒ‰ƒCƒu *:" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DRIVE_MAP "ƒhƒ‰ƒCƒu %1: \t%2" + IDS_ERROR_MAP "ƒlƒbƒgƒ[ƒNEƒhƒ‰ƒCƒu‚̃}ƒbƒsƒ“ƒOEƒGƒ‰[" + IDS_ERROR_MAP_DESC "AFS ‚Í AFS “à‚ÌŽw’肳‚ꂽƒpƒX‚Ƀlƒbƒgƒ[ƒNEƒhƒ‰ƒCƒu‚ðƒ}ƒbƒsƒ“ƒO‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½Bƒhƒ‰ƒCƒu–¼‚ªŒ»ÝŽg—p’†‚łȂ¢‚©‚ðŠm‚©‚߂Ă­‚¾‚³‚¢B\n\nƒGƒ‰[: 0x%1 " + IDS_ERROR_UNMAP "ƒlƒbƒgƒ[ƒNEƒhƒ‰ƒCƒu‚̃}ƒbƒsƒ“ƒOEƒGƒ‰[" + IDS_ERROR_UNMAP_DESC "AFS ‚ÍŽw’肳‚ꂽƒlƒbƒgƒ[ƒNEƒhƒ‰ƒCƒu‚ðƒ}ƒbƒsƒ“ƒO‰ðœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½Bƒhƒ‰ƒCƒu–¼‚ªŒ»ÝŽg—p’†‚łȂ¢‚©‚ðŠm‚©‚߂Ă­‚¾‚³‚¢B\n\nƒGƒ‰[: 0x%1" + IDS_CELL_GATEWAY "%s (ƒQ[ƒgƒEƒFƒC %s Œo—R)" + IDS_BADMAP_TITLE "ƒlƒbƒgƒ[ƒNEƒhƒ‰ƒCƒu‚̃}ƒbƒsƒ“ƒOEƒGƒ‰[" + IDS_BADMAP_DESC "ƒpƒX‚ª ""\\afs"" ‚ÅŽn‚Ü‚Á‚Ä‚¢‚È‚¢‚½‚߁AAFS ‚̓hƒ‰ƒCƒu–¼‚ðŽw’肳‚ꂽƒpƒX‚Ƀ}ƒbƒsƒ“ƒO‚Å‚«‚Ü‚¹‚ñB\n\n“ü—Í‚µ‚½ƒpƒX‚ª ""\\afs"" ‚ÅŽn‚Ü‚Á‚Ä‚¢‚é‚©‚ðŠm‚©‚߂Ă©‚çA‚â‚è’¼‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_UNCONFIG_TITLE_95 "ƒGƒ‰[ - AFS Light " + IDS_UNCONFIG_DESC_95 "AFS Light ‚ª\¬‚³‚ê‚Ä‚¢‚È‚¢‚½‚ߎg—p‚Å‚«‚Ü‚¹‚ñB\n\nAFS Light ‚ð\¬‚·‚é‚ɂ́AƒRƒ“ƒgƒ[ƒ‹Eƒpƒlƒ‹‚ðŠJ‚¢‚āuAFS Light \¬vƒAƒCƒRƒ“‚ðƒ_ƒuƒ‹ƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_UNCONFIG_TITLE "ƒGƒ‰[ - AFS ƒNƒ‰ƒCƒAƒ“ƒg" + IDS_UNCONFIG_DESC "AFS ƒNƒ‰ƒCƒAƒ“ƒg‚ª\¬‚³‚ê‚Ä‚¢‚È‚¢‚½‚ߎg—p‚Å‚«‚Ü‚¹‚ñB\n\nAFS ƒNƒ‰ƒCƒAƒ“ƒg‚ð\¬‚·‚é‚ɂ́AƒRƒ“ƒgƒ[ƒ‹Eƒpƒlƒ‹‚ðŠJ‚¢‚āuAFS ƒNƒ‰ƒCƒAƒ“ƒgvƒAƒCƒRƒ“‚ðƒ_ƒuƒ‹ƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢B" + IDS_NEWSUB_TITLE "’ˆÓ - AFS ƒNƒ‰ƒCƒAƒ“ƒg" + IDS_NEWSUB_TITLE_95 "’ˆÓ - AFS Light " + IDS_NEWSUB_DESC "AFS ‚̓lƒbƒgƒ[ƒNEƒhƒ‰ƒCƒu‚̐ڑ±Žž‚ÉŽw’肳‚ꂽ‹Lq‚ðŽg—p‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n\nŽw’肳‚ꂽ‹Lq‚Í‚·‚łɑ¼‚Ì AFS ƒpƒX‚ÉŽg—p‚³‚ê‚Ä‚¢‚Ü‚·B" + IDS_BADSUB_TITLE "ƒGƒ‰[ - AFS ƒNƒ‰ƒCƒAƒ“ƒg" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADSUB_TITLE_95 "ƒGƒ‰[ - AFS Light " + IDS_BADSUB_DESC "“ü—Í‚µ‚½ƒhƒ‰ƒCƒu–¼‹Lq‚ðŽg—p‚Å‚«‚Ü‚¹‚ñB\n\nƒhƒ‰ƒCƒu–¼‚Ì‹Lq‚Í 12 •¶Žš‚ð’´‚¦‚Ă͂Ȃ炸AƒXƒy[ƒX‚Ü‚½‚̓^ƒu‚ðŠÜ‚ñ‚Å‚¢‚Ă͂¢‚¯‚Ü‚¹‚ñB" + IDS_TITLE_95 "AFS Light" +END + +#endif // Japanese resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/client_creds/lang/ko_KR/afscreds.rc b/src/WINNT/client_creds/lang/ko_KR/afscreds.rc index d6c5d5f7c..76426c871 100644 --- a/src/WINNT/client_creds/lang/ko_KR/afscreds.rc +++ b/src/WINNT/client_creds/lang/ko_KR/afscreds.rc @@ -7,25 +7,25 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Korean resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR) -#ifdef _WIN32 -LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT -#endif //_WIN32 +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Korean resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR) +#ifdef _WIN32 +LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT +#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Version @@ -39,535 +39,535 @@ LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT #define AFS_VERINFO_CHARSET 949 #include "AFS_component_version_number.h" #include "..\..\config\NTVersioninfo.rc" - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "afscreds.ico" -IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" -IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" -IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_MAIN DIALOG DISCARDABLE 0, 0, 322, 129 -STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS Ŭ¶óÀ̾ðÆ®" -CLASS "AfsCreds" -FONT 9, "±¼¸²" -BEGIN - RTEXT "AFS %s ¹öÀü(ÆÐÄ¡ %lu)",IDC_TITLE_VERSION,224,8,90,8 - LTEXT "ÇöÀç Windows ³×Æ®¿öÅ©¿¡ ""%s""(À¸)·Î ·Î±×¿ÂµÇ¾ú½À´Ï´Ù.", - IDC_TITLE_NT,14,8,218,8 - CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,25,307,97 -END - -IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - LTEXT "¼¿: ",IDC_STATIC,7,9,24,8 - LTEXT "(¾øÀ½)",IDC_CREDS_CELL,51,9,193,8 - LTEXT "ÅäÅ«:",IDC_STATIC,7,26,27,8 - LTEXT "(¾øÀ½)",IDC_CREDS_INFO,51,26,193,8 - CONTROL "ÀÌ ÅäÅ«ÀÌ ¸¸±âµÇ±â Àü¿¡ °æ°í Ç¥½Ã(&S)",IDC_CREDS_REMIND, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,51,43,193,10 - PUSHBUTTON "»õ ÅäÅ« È®º¸(&O)...",IDC_CREDS_OBTAIN,51,63,88,14 - PUSHBUTTON "ÀÌ ÅäÅ«À» ¹ö¸²(&D)",IDC_CREDS_DESTROY,142,63,92,14 - PUSHBUTTON "µµ¿ò¸»",9,237,63,45,14 -END - -IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - LTEXT "¸ðµç AFS ¼¿¿¡ ÅäÅ«ÀÌ ¾ø½À´Ï´Ù.",IDC_RUNNING,7,9,275,8 - LTEXT "AFS Ŭ¶óÀÌ¾ðÆ®°¡ Á¦´ë·Î ±¸¼ºµÇÁö ¾Ê¾Ò°Å³ª AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ½ÇÇà ÁßÀÌ ¾Æ´Õ´Ï´Ù.\n\n°í±Þ ÅÇÀ» »ç¿ëÇÏ¿© AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ ½ÃÀÛÇϽʽÿÀ.", - IDC_STOPPED,7,23,275,36 - PUSHBUTTON "µµ¿ò¸»",9,237,63,45,14 - PUSHBUTTON "»õ ÅäÅ« È®º¸(&O)...",IDC_CREDS_OBTAIN,51,63,88,14 -END - -IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - LTEXT "(Á¶È¸ Áß...)",IDC_SERVICE_STATUS,7,9,275,8 - PUSHBUTTON "¼­ºñ½º ½ÃÀÛ(&S)",IDC_SERVICE_START,51,28,63,14 - PUSHBUTTON "¼­ºñ½º Á¤Áö(&T)",IDC_SERVICE_STOP,118,28,63,14 - PUSHBUTTON "AFS Ŭ¶óÀÌ¾ðÆ® ±¸¼º(&C)",IDC_OPEN_CPL,185,28,97,14 - CONTROL "ÀÌ ÄÄÇ»ÅͰ¡ Àç½ÃÀÛµÉ ¶§¸¶´Ù AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º ½ÃÀÛ(&a)", - IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, - 51,204,10 - CONTROL "ÀÛ¾÷ Ç¥½ÃÁÙ¿¡ AFS Ŭ¶óÀÌ¾ðÆ® ¾ÆÀÌÄÜÀ» Ç×»ó Ç¥½Ã(&A)", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65, - 204,10 - PUSHBUTTON "µµ¿ò¸»",9,237,63,45,14 -END - -IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 232, 127 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "»õ AFS ÅäÅ« È®º¸" -FONT 9, "±¼¸²" -BEGIN - LTEXT "»õ AFS ÅäÅ«À» È®º¸ÇÏ·Á¸é, AFS °èÁ¤¿¡ ´ëÇÑ AFS »ç¿ëÀÚ À̸§ ¹× ¾ÏÈ£¸¦ ÀÔ·ÂÇϽʽÿÀ. ÅäÅ«Àº µ¿½Ã¿¡ ¿©·¯ AFS ¼¿¿¡ ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù.", - IDC_STATIC,7,7,218,24 - LTEXT "AFS ¼¿(&C):",IDC_STATIC,24,42,30,8 - EDITTEXT IDC_NEWCREDS_CELL,67,40,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "»ç¿ëÀÚ À̸§(&N):",IDC_STATIC,24,60,38,8 - EDITTEXT IDC_NEWCREDS_USER,67,58,97,14,ES_AUTOHSCROLL - LTEXT "¾ÏÈ£(&P):",IDC_STATIC,23,78,34,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,67,76,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "È®ÀÎ",IDOK,69,106,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,122,106,50,14 - PUSHBUTTON "µµ¿ò¸»",9,175,106,50,14 -END - -IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "»õ AFS ÅäÅ« È®º¸" -FONT 9, "±¼¸²" -BEGIN - LTEXT "»õ AFS ÅäÅ«À» È®º¸ÇÏ·Á¸é, AFS °èÁ¤¿¡ ´ëÇÑ AFS »ç¿ëÀÚ À̸§ ¹× ¾ÏÈ£¸¦ ÀÔ·ÂÇϽʽÿÀ. ÅäÅ«Àº µ¿½Ã¿¡ ¿©·¯ AFS ¼¿¿¡ ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù.", - IDC_STATIC,7,29,218,24 - LTEXT "AFS ¼¿(&C):",IDC_STATIC,24,70,30,8 - EDITTEXT IDC_NEWCREDS_CELL,67,68,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "»ç¿ëÀÚ À̸§(&N):",IDC_STATIC,24,88,38,8 - EDITTEXT IDC_NEWCREDS_USER,67,86,97,14,ES_AUTOHSCROLL - LTEXT "¾ÏÈ£(&P):",IDC_STATIC,23,106,34,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,67,104,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "%1 ¼¿¿¡ ÀÖ´Â ÅäÅ«ÀÌ °ð ¸¸±âµË´Ï´Ù.",IDC_NEWCREDS_TITLE, - 7,7,218,16 - DEFPUSHBUTTON "È®ÀÎ",IDOK,69,134,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,122,134,50,14 - PUSHBUTTON "µµ¿ò¸»",9,175,134,50,14 -END - -IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "±¼¸²" -BEGIN - LTEXT "´ÙÀ½ µå¶óÀ̺ê À̸§À» AFSÀÇ °æ·Î¿¡ ¸ÊÇÎÇϵµ·Ï ¼±ÅÃÇß½À´Ï´Ù.", - IDC_TITLE,7,8,275,8 - PUSHBUTTON "Ãß°¡(&A)...",IDC_ADD,51,63,45,14 - PUSHBUTTON "º¯°æ(&C)...",IDC_EDIT,99,63,45,14 - PUSHBUTTON "Á¦°Å(&R)",IDC_REMOVE,147,63,45,14 - CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x1d3,51,21,231,37 - PUSHBUTTON "µµ¿ò¸»",9,237,63,45,14 -END - -IDD_WIZARD DIALOGEX 0, 0, 272, 152 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Ŭ¶óÀÌ¾ðÆ® ¸¶¹ý»ç" -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "´ÙÀ½(&N) >",IDNEXT,162,131,50,14 - PUSHBUTTON "Ãë¼Ò(&L)",IDCANCEL,215,131,50,14 - CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,112 - CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,91,7,174,112 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,125,258,1 - PUSHBUTTON "µµ¿ò¸»(&H)",9,59,131,50,14 - PUSHBUTTON "< µÚ·Î(&B)",IDBACK,112,131,50,14 -END - -IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "±¼¸²" -BEGIN - LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ¾ÆÁ÷ ½ÃÀÛµÇÁö ¾Ê¾Ò½À´Ï´Ù.", - IDC_STATIC,0,0,173,8 - LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ ½ÃÀÛÇÏ·Á¸é, ´ÙÀ½À» ´©¸£½Ê½Ã¿À.", - IDC_STATIC,0,59,173,22 - LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ½ÇÇàµÉ ¶§±îÁö AFS¿¡ ÀúÀåµÈ ÆÄÀÏÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.", - IDC_STATIC,0,17,173,17 - LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ Á¤ÁöµÈ »óÅ·ΠµÎ·Á¸é, Ãë¼Ò¸¦ ´©¸£½Ê½Ã¿À.", - IDC_STATIC,0,88,174,21 -END - -IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "±¼¸²" -BEGIN - LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º´Â ½ÇÇà ÁßÀÌÁö¸¸, AFS »ç¿ë¿¡ ÇÊ¿äÇÑ ÅäÅ«À» ¾ÆÁ÷ È®º¸ÇÏÁö ¸øÇß½À´Ï´Ù.", - IDC_STATIC,0,0,173,16 - CONTROL "ÀÓÀÇÀÇ ¼¿¿¡ ´ëÇÑ ÅäÅ«À» È®º¸ÇÏÁö ¾ÊÀ½",IDC_NOCREDS, - "Button",BS_AUTORADIOBUTTON,10,28,141,10 - CONTROL "´ÙÀ½ ¼¿¿¡¼­ ÅäÅ« È®º¸",IDC_YESCREDS,"Button", - BS_AUTORADIOBUTTON,10,44,141,10 - LTEXT "AFS ¼¿(&C):",IDC_STATIC,34,64,30,8 - EDITTEXT IDC_NEWCREDS_CELL,77,62,96,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "»ç¿ëÀÚ À̸§(&N):",IDC_STATIC,34,82,38,8 - EDITTEXT IDC_NEWCREDS_USER,77,80,96,14,ES_AUTOHSCROLL - LTEXT "¾ÏÈ£(&P):",IDC_STATIC,33,100,34,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,77,97,96,14,ES_PASSWORD | - ES_AUTOHSCROLL -END - -IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "±¼¸²" -BEGIN - LTEXT "±â´Ù¸®½Ê½Ã¿À. AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ½ÃÀÛ ÁßÀÔ´Ï´Ù...", - IDC_START_TRY,0,33,173,8 - LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n³×Æ®¿öÅ© ¼³Á¤À» Á¡°ËÇϰí Á¦¾îÆÇÀÇ AFS ¾ÆÀÌÄÜÀ» »ç¿ëÇÏ¿© ÀÌ ÄÄÇ»ÅÍ¿¡¼­ÀÇ AFS Ŭ¶óÀ̾ðÆ®ÀÇ ±¸¼ºÀ» È®ÀÎÇϽʽÿÀ.", - IDC_START_FAIL,0,25,173,41 -END - -IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "±¼¸²" -BEGIN - LTEXT "AFS¿¡ ÀúÀåµÈ ÆÄÀÏ¿¡ ¾×¼¼½ºÇÏ·Á¸é, µå¶óÀ̺ê À̸§À» AFSÀÇ °æ·Î¿¡ ¸ÊÇνÃÄÑ¾ß ÇÕ´Ï´Ù.", - IDC_STATIC,0,0,173,16 - CONTROL "AFS¿¡¼­ °æ·Î¿¡ µå¶óÀ̺ê À̸§À» ¸ÊÇÎ ¾ÈÇÔ(&D)",IDC_NOMAP, - "Button",BS_AUTORADIOBUTTON,10,23,157,10 - CONTROL "AFS¿¡¼­ °æ·Î¿¡ µå¶óÀ̺ê À̸§À» ¸ÊÇÎÇÔ(&M)",IDC_YESMAP, - "Button",BS_AUTORADIOBUTTON,10,40,156,10 - LTEXT "µå¶óÀ̺ê À̸§(&L):",IDC_STATIC,30,58,44,8 - COMBOBOX IDC_MAP_LETTER,77,56,48,125,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS °æ·Î(&P):",IDC_STATIC,34,76,33,8 - EDITTEXT IDC_MAP_PATH,77,74,96,14,ES_AUTOHSCROLL - LTEXT "¼³¸í(&E):",IDC_STATIC,34,94,38,8 - EDITTEXT IDC_MAP_DESC,77,92,60,14,ES_AUTOHSCROLL -END - -IDD_TERMINATE DIALOGEX 0, 0, 291, 117 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Ŭ¶óÀ̾ðÆ®" -FONT 9, "±¼¸²" -BEGIN - PUSHBUTTON "¾ÆÀÌÄÜ Á¦°Å(&R)",IDOK,167,96,63,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,234,96,50,14 - LTEXT "ÄÄÇ»ÅÍÀÇ ÀÛ¾÷ Ç¥½ÃÁÙ¿¡¼­ AFS Ŭ¶óÀÌ¾ðÆ® ¾ÆÀÌÄÜÀ» Á¦°ÅÇϵµ·Ï ¼±ÅÃÇß½À´Ï´Ù. AFS Ŭ¶óÀÌ¾ðÆ® ¾ÆÀÌÄÜÀÌ ÄÄÇ»ÅÍÀÇ ÀÛ¾÷ Ç¥½ÃÁÙ¿¡ ¾øÀ¸¸é, AFS´Â AFS ÅäÅ«ÀÌ ¸¸±âµÉ ¶§ À̸¦ °æ°íÇÒ ¼ö ¾ø½À´Ï´Ù.", - IDC_STATIC,7,7,277,25 - LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ÇöÀç ½ÇÇà ÁßÀÔ´Ï´Ù. ÇÊ¿äÇÑ °æ¿ì, Áö±Ý Á¤Áö½Ãų ¼ö ÀÖ½À´Ï´Ù.", - IDC_STATIC,7,41,277,8 - CONTROL "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ ½ÇÇà »óÅ·ΠµÒ(&L)",IDC_LEAVE, - "Button",BS_AUTORADIOBUTTON,26,55,228,10 - CONTROL "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º Á¤Áö(&S)",IDC_STOP,"Button", - BS_AUTORADIOBUTTON,26,69,228,10 - CONTROL "ÄÄÇ»ÅͰ¡ ´Ù½Ã ½ÃÀÛÇÒ ¶§ ¾ÆÀÌÄÜ Ç¥½Ã(&H)",IDC_STARTUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,98,148,10 -END - -IDD_TERMINATE_SMALL DIALOGEX 0, 0, 291, 68 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Ŭ¶óÀ̾ðÆ®" -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - PUSHBUTTON "¾ÆÀÌÄÜ Á¦°Å(&R)",IDOK,167,47,63,14 - PUSHBUTTON "Ãë¼Ò(&L)",IDCANCEL,234,47,50,14 - LTEXT "ÄÄÇ»ÅÍÀÇ ÀÛ¾÷ Ç¥½ÃÁÙ¿¡¼­ AFS Ŭ¶óÀÌ¾ðÆ® ¾ÆÀÌÄÜÀ» Á¦°ÅÇϵµ·Ï ¼±ÅÃÇß½À´Ï´Ù. AFS Ŭ¶óÀÌ¾ðÆ® ¾ÆÀÌÄÜÀÌ ÄÄÇ»ÅÍÀÇ ÀÛ¾÷ Ç¥½ÃÁÙ¿¡ ¾øÀ¸¸é, AFS´Â AFS ÅäÅ«ÀÌ ¸¸±âµÉ ¶§ À̸¦ °æ°íÇÒ ¼ö ¾ø½À´Ï´Ù.", - -1,7,7,277,25 - CONTROL "ÄÄÇ»ÅͰ¡ ´Ù½Ã ½ÃÀÛÇÒ ¶§ ¾ÆÀÌÄÜ Ç¥½Ã(&H)",IDC_STARTUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49,148,10 -END - -IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 291, 68 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS ¶óÀÌÆ®" -FONT 9, "±¼¸²", 0, 0, 0x1 -BEGIN - PUSHBUTTON "¾ÆÀÌÄÜ Á¦°Å(&R)",IDOK,167,47,63,14 - PUSHBUTTON "Ãë¼Ò(&L)",IDCANCEL,234,47,50,14 - LTEXT "ÄÄÇ»ÅÍÀÇ ÀÛ¾÷ Ç¥½ÃÁÙ¿¡¼­ AFS ¶óÀÌÆ® ¾ÆÀÌÄÜÀ» Á¦°ÅÇϵµ·Ï ¼±ÅÃÇß½À´Ï´Ù. AFS ¶óÀÌÆ® ¾ÆÀÌÄÜÀÌ ÄÄÇ»ÅÍÀÇ ÀÛ¾÷ Ç¥½ÃÁÙ¿¡ ¾øÀ¸¸é, AFS´Â AFS ÅäÅ«ÀÌ ¸¸±âµÉ ¶§ À̸¦ °æ°íÇÒ ¼ö ¾ø½À´Ï´Ù.", - -1,7,7,277,25 - CONTROL "ÄÄÇ»ÅͰ¡ ´Ù½Ã ½ÃÀÛÇÒ ¶§ ¾ÆÀÌÄÜ Ç¥½Ã(&H)",IDC_STARTUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49,148,10 -END - -IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "±¼¸²" -BEGIN - LTEXT "¼±ÅÃÇÑ Çϳª ÀÌ»óÀÇ µå¶óÀ̺ê À̸§À» AFSÀÇ ÇØ´ç °æ·Î¿¡ ¸ÊÇνÃų ¼ö ¾ø½À´Ï´Ù.\n\nAFSÀÇ °æ·Î¸¦ »ç¿ëÇÏ·Á°í ½Ãµµ ÁßÀÎ ¸ðµç ÀÀ¿ëÇÁ·Î±×·¥À» ´Ý¾Æ¾ß ÇÕ´Ï´Ù.", - IDC_MAP_FAIL,1,26,173,41 - LTEXT "±â´Ù¸®½Ê½Ã¿À. AFSÀÇ °æ·Î¿¡ µå¶óÀ̺ê À̸§À» ¸ÊÇÎÇÏ´Â ÁßÀÔ´Ï´Ù...", - IDC_MAP_TRY,0,33,173,8 -END - -IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "±¼¸²" -BEGIN - LTEXT "ÀÌÁ¦ AFS Ŭ¶óÀÌ¾ðÆ®¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.",IDC_STATIC,0, - 0,173,8 - LTEXT "¸¶¹ý»ç¸¦ ³¡³»½Ã·Á¸é Á¾·á¸¦ ´©¸£½Ê½Ã¿À.",IDC_STATIC,0,73, - 173,8 -END - -IDD_MAPPING DIALOG DISCARDABLE 0, 0, 275, 152 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "µå¶óÀ̺ê À̸§ ¸ÊÇÎ" -FONT 9, "±¼¸²" -BEGIN - LTEXT "ÄÄÇ»ÅÍÀÇ µå¶óÀ̺ê À̸§À» AFSÀÇ °æ·Î¿¡ ¸ÊÇÎÇÒ ¼ö ÀÖ½À´Ï´Ù.\n\n¿¹¸¦ µé¾î, Q:¸¦ \\afs\\acme.com\\usr\\bob·Î ¸ÊÇÎÇϸé, AFS¿¡¼­ \\afs\\acme.com\\usr\\bob\\*·Î¼­ »ç¿ë°¡´ÉÇÑ ÆÄÀÏÀ» Q:¿¡¼­ º¼ ¼ö ÀÖ°Ô µË´Ï´Ù.\\", - IDC_STATIC,7,7,261,32 - LTEXT "µå¶óÀ̺ê À̸§(&L):",IDC_STATIC,23,53,45,8 - COMBOBOX IDC_MAP_LETTER,73,51,56,162,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS °æ·Î(&P):",IDC_STATIC,23,70,33,8 - EDITTEXT IDC_MAP_PATH,73,68,178,13,ES_AUTOHSCROLL - LTEXT "¼³¸í(&E):",IDC_STATIC,23,88,38,8 - EDITTEXT IDC_MAP_DESC,73,86,60,13,ES_AUTOHSCROLL - CONTROL "·Î±×¿ÂÇÒ ¶§¸¶´Ù ÀÌ ¸ÊÇÎ º¹¿ø(&R)",IDC_MAP_PERSISTENT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,73,105,185,10 - DEFPUSHBUTTON "È®ÀÎ",IDOK,112,131,50,14 - PUSHBUTTON "Ãë¼Ò",IDCANCEL,165,131,50,14 - PUSHBUTTON "µµ¿ò¸»",9,218,131,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 314 - TOPMARGIN, 8 - BOTTOMMARGIN, 122 - END - - IDD_TAB_CREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_NOCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_ADVANCED, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_NEWCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 120 - END - - IDD_NEWCREDS_EXPIRE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 148 - END - - IDD_TAB_MOUNT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_WIZARD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 265 - TOPMARGIN, 7 - BOTTOMMARGIN, 145 - END - - IDD_TERMINATE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 284 - TOPMARGIN, 7 - BOTTOMMARGIN, 110 - END - - IDD_TERMINATE_SMALL, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 284 - TOPMARGIN, 7 - BOTTOMMARGIN, 61 - END - - IDD_MAPPING, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 268 - TOPMARGIN, 7 - BOTTOMMARGIN, 145 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_TRAYICON MENU DISCARDABLE -BEGIN - MENUITEM "ÅäÅ« Ç¥½Ã(&S)...", M_ACTIVATE - MENUITEM "¸¸±â Àü °æ°í(&W)", M_REMIND, CHECKED - MENUITEM SEPARATOR - MENUITEM "¾ÆÀÌÄÜ Á¦°Å(&R)", M_TERMINATE -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" -IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_TOOLTIP "AFS Ŭ¶óÀ̾ðÆ®" - IDS_CREDENTIALS "ÅäÅ«" - IDS_UNKNOWN "(¾Ë ¼ö ¾øÀ½)" - IDS_ADVANCED "°í±Þ" - IDS_CREDS "%1(ÅäÅ«Àº %2¿¡ ¸¸±â)" - IDS_NO_CREDS "(ÀÌ ¼¿¿¡ ÅäÅ«ÀÌ ¾ø½À´Ï´Ù)" - IDS_SERVICE_BROKEN "AFS Ŭ¶óÀÌ¾ðÆ®°¡ Á¦´ë·Î ¼³Ä¡µÇÁö ¾Ê¾Ò°Å³ª ±× »óŸ¦ Á¶È¸ÇÒ ±ÇÇÑÀÌ ¾ø½À´Ï´Ù." - IDS_SERVICE_RUNNING "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ Á¤»óÀûÀ¸·Î ½ÇÇà ÁßÀÔ´Ï´Ù." - IDS_SERVICE_STOPPED "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ÇöÀç Á¤ÁöµÇ¾ú½À´Ï´Ù." - IDS_SERVICE_STOPPING "±â´Ù¸®½Ê½Ã¿À. AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ Á¤Áö ÁßÀÔ´Ï´Ù..." - IDS_SERVICE_STARTING "±â´Ù¸®½Ê½Ã¿À. AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ½ÃÀÛ ÁßÀÔ´Ï´Ù..." - IDS_SERVICE_UNKNOWN "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½ºÀÇ »óŸ¦ ÆÇº°ÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_SERVICE_FAIL_STOP "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ Á¤ÁöÇÒ ¼ö ¾ø½À´Ï´Ù. ÀÌ Á¶ÀÛÀ» ¼öÇàÇÒ ¼ö ÀÖ´Â ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.\n\n¿À·ù 0x%1." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_MAP "³×Æ®¿öÅ© µå¶óÀÌºê ¸ÊÇÎ ¿À·ù" - IDS_ERROR_MAP_DESC "AFS´Â ³×Æ®¿öÅ© µå¶óÀ̺긦 AFS¿¡¼­ ÁöÁ¤µÈ °æ·Î¿¡ ¸ÊÇÎÇÒ ¼ö ¾ø½À´Ï´Ù. ÇöÀç µå¶óÀ̺ê À̸§ÀÌ »ç¿ë ÁßÀ̾´Â ¾ÈµË´Ï´Ù.\n\n¿À·ù: 0x%1." - IDS_ERROR_UNMAP "³×Æ®¿öÅ© µå¶óÀÌºê ¸ÊÇÎ ¿À·ù" - IDS_ERROR_UNMAP_DESC "AFS´Â ÁöÁ¤µÈ ³×Æ®¿öÅ© µå¶óÀ̺긦 ¾ð¸ÊÇÒ ¼ö ¾ø½À´Ï´Ù. ÇöÀç µå¶óÀ̺ê À̸§ÀÌ »ç¿ë ÁßÀ̾´Â ¾ÈµË´Ï´Ù.\n\n¿À·ù: 0x%1." - IDS_CELL_GATEWAY "%s(%s °ÔÀÌÆ®¿þÀ̸¦ ÅëÇØ)" - IDS_BADMAP_TITLE "³×Æ®¿öÅ© µå¶óÀÌºê ¸ÊÇÎ ¿À·ù" - IDS_BADMAP_DESC "AFS´Â °æ·Î°¡ \\afs""·Î ½ÃÀÛÇÏÁö ¾ÊÀ¸¹Ç·Î µå¶óÀ̺ê À̸§À» ÁöÁ¤µÈ °æ·Î¿¡ ¸ÊÇÎÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nÀÔ·ÂÇÑ °æ·Î°¡ \\afs""·Î ½ÃÀÛÇÏ´ÂÁö È®ÀÎÇÏ°í ´Ù½Ã ½ÃµµÇϽʽÿÀ." - IDS_UNCONFIG_TITLE "¿À·ù - AFS Ŭ¶óÀ̾ðÆ®" - IDS_UNCONFIG_DESC "AFS Ŭ¶óÀÌ¾ðÆ®°¡ ¾ÆÁ÷ ±¸¼ºµÇÁö ¾Ê¾ÒÀ¸¹Ç·Î »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nAFS Ŭ¶óÀÌ¾ðÆ®¸¦ ±¸¼ºÇÏ·Á¸é, Á¦¾îÆÇÀ» ¿­°í AFS Ŭ¶óÀÌ¾ðÆ® ¾ÆÀÌÄÜÀ» µÎ ¹ø ´©¸£½Ê½Ã¿À." - IDS_NEWSUB_TITLE "ÁÖÀÇ - AFS Ŭ¶óÀ̾ðÆ®" - IDS_NEWSUB_DESC "AFS´Â ³×Æ®¿öÅ© µå¶óÀ̺꿡 ¿¬°áÇÒ ¶§ ÁöÁ¤µÈ ¼³¸íÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nÁöÁ¤µÈ ¼³¸íÀº ÀÌ¹Ì ´Ù¸¥ AFS °æ·Î¿¡¼­ »ç¿ëµÇ¾ú½À´Ï´Ù." - IDS_BADSUB_TITLE "¿À·ù - AFS Ŭ¶óÀ̾ðÆ®" - IDS_BADSUB_DESC "ÀÔ·ÂÇÑ µå¶óÀ̺ê À̸§ ¼³¸íÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nµå¶óÀ̺ê À̸§ ¼³¸í¿¡´Â 12 ¹®ÀÚ ÀÌ»óÀ» »ç¿ëÇÒ ¼ö ¾øÀ¸¸ç °ø¹é ¶Ç´Â ÅÇÀ» Æ÷ÇÔÇÒ ¼ö ¾ø½À´Ï´Ù." - IDS_TITLE_95 "AFS ¶óÀÌÆ®" - IDS_TOOLTIP_95 "AFS ¶óÀÌÆ®" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_FAIL_START "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù. ÀÌ Á¶ÀÛÀ» ¼öÇàÇÒ ¼ö ÀÖ´Â ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.\n\n¿À·ù 0x%1." - IDS_SERVICE_FAIL_CONFIG "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½ºÀÇ ½Ãµ¿ ¸Å°³º¯¼ö¸¦ º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù. ÀÌ Á¶ÀÛÀ» ¼öÇàÇÒ ¼ö ÀÖ´Â ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.\n\n¿À·ù 0x%1." - IDS_SERVICE_ERROR "¼­ºñ½º ±¸¼º ¿À·ù" - IDS_ERROR_TITLE "¿À·ù - AFS Ŭ¶óÀ̾ðÆ®" - IDS_ERROR_DESTROY_NOCM "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ÀÀ´äÇÏÁö ¾Ê¾ÒÀ¸¹Ç·Î %1 ¼¿¿¡ ÀÖ´Â ÅäÅ«À» ÆÄ±«ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n°í±Þ ÅÇÀ» È®ÀÎÇÏ¿© AFS Ŭ¶óÀÌ¾ðÆ®°¡ Á¦´ë·Î ½ÇÇà ÁßÀÎÁö º¸½Ê½Ã¿À.\n\n¿À·ù: %2" - IDS_ERROR_DESTROY_UNKNOWN - "%1 ¼¿¿¡ ÀÖ´Â ÅäÅ«À» ÆÄ±«ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nÈ®Àå ÅÇÀ» È®ÀÎÇÏ¿© AFS Ŭ¶óÀÌ¾ðÆ®°¡ Á¦´ë·Î ½ÇÇà ÁßÀÎÁö º¸½Ê½Ã¿À.\n\n¿À·ù: %2" - IDS_ERROR_OBTAIN "AFS Ŭ¶óÀÌ¾ðÆ®´Â ÅäÅ«À» %1 ¼¿ÀÇ %2(À¸)·Î È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n¿À·ù: %4(%3)" - IDS_TITLE_VERSION "%s AFS ¹öÀü" - IDS_TITLE_VERSION_NOPATCH "%s AFS ¹öÀü" - IDS_MOUNT_SOME "´ÙÀ½ µå¶óÀ̺ê À̸§À» AFSÀÇ °æ·Î¿¡ ¸ÊÇÎÇϵµ·Ï ¼±ÅÃÇß½À´Ï´Ù." - IDS_MOUNT_NONE "¾ÆÁ÷ AFS °æ·Î¿¡ µå¶óÀ̺ê À̸§À» ¸ÊÇÎÇϵµ·Ï ¼±ÅÃÇÏÁö ¾Ê¾Ò½À´Ï´Ù." - IDS_MOUNT "µå¶óÀ̺ê À̸§" - IDS_WIZ_NEXT "´ÙÀ½(&N) >" - IDS_WIZ_FINISH "Á¾·á(&F)" - IDS_MAP_LETTER "µå¶óÀ̺ê *:" - IDS_DRIVE_MAP "%1: µå¶óÀ̺ê \t%2" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_TITLE_95 "¿À·ù - AFS ¶óÀÌÆ®" - IDS_ERROR_DESTROY_95 "%1 ¼¿¿¡ ÀÖ´Â ÅäÅ«À» ÆÄ±«ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n¿À·ù: %2" - IDS_ERROR_OBTAIN_95 "AFS ¶óÀÌÆ®´Â ÅäÅ«À» %1 ¼¿ÀÇ %2(À¸)·Î¼­ È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n¿À·ù: %4(%3)" - IDS_UNCONFIG_TITLE_95 "¿À·ù - AFS ¶óÀÌÆ®" - IDS_UNCONFIG_DESC_95 "AFS ¶óÀÌÆ®°¡ ¾ÆÁ÷ ±¸¼ºµÇÁö ¾Ê¾ÒÀ¸¹Ç·Î »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nAFS ¶óÀÌÆ®¸¦ ±¸¼ºÇÏ·Á¸é, Á¦¾îÆÇÀ» ¿­°í AFS ¶óÀÌÆ® ±¸¼º ¾ÆÀÌÄÜÀ» µÎ ¹ø ´©¸£½Ê½Ã¿À." - IDS_NEWSUB_TITLE_95 "ÁÖÀÇ - AFS ¶óÀÌÆ®" - IDS_BADSUB_TITLE_95 "¿À·ù - AFS ¶óÀÌÆ®" -END - -#endif // Korean resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "afscreds.ico" +IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" +IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" +IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_MAIN DIALOG DISCARDABLE 0, 0, 322, 129 +STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS Ŭ¶óÀ̾ðÆ®" +CLASS "AfsCreds" +FONT 9, "±¼¸²" +BEGIN + RTEXT "AFS %s ¹öÀü(ÆÐÄ¡ %lu)",IDC_TITLE_VERSION,224,8,90,8 + LTEXT "ÇöÀç Windows ³×Æ®¿öÅ©¿¡ ""%s""(À¸)·Î ·Î±×¿ÂµÇ¾ú½À´Ï´Ù.", + IDC_TITLE_NT,14,8,218,8 + CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,25,307,97 +END + +IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + LTEXT "¼¿: ",IDC_STATIC,7,9,24,8 + LTEXT "(¾øÀ½)",IDC_CREDS_CELL,51,9,193,8 + LTEXT "ÅäÅ«:",IDC_STATIC,7,26,27,8 + LTEXT "(¾øÀ½)",IDC_CREDS_INFO,51,26,193,8 + CONTROL "ÀÌ ÅäÅ«ÀÌ ¸¸±âµÇ±â Àü¿¡ °æ°í Ç¥½Ã(&S)",IDC_CREDS_REMIND, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,51,43,193,10 + PUSHBUTTON "»õ ÅäÅ« È®º¸(&O)...",IDC_CREDS_OBTAIN,51,63,88,14 + PUSHBUTTON "ÀÌ ÅäÅ«À» ¹ö¸²(&D)",IDC_CREDS_DESTROY,142,63,92,14 + PUSHBUTTON "µµ¿ò¸»",9,237,63,45,14 +END + +IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + LTEXT "¸ðµç AFS ¼¿¿¡ ÅäÅ«ÀÌ ¾ø½À´Ï´Ù.",IDC_RUNNING,7,9,275,8 + LTEXT "AFS Ŭ¶óÀÌ¾ðÆ®°¡ Á¦´ë·Î ±¸¼ºµÇÁö ¾Ê¾Ò°Å³ª AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ½ÇÇà ÁßÀÌ ¾Æ´Õ´Ï´Ù.\n\n°í±Þ ÅÇÀ» »ç¿ëÇÏ¿© AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ ½ÃÀÛÇϽʽÿÀ.", + IDC_STOPPED,7,23,275,36 + PUSHBUTTON "µµ¿ò¸»",9,237,63,45,14 + PUSHBUTTON "»õ ÅäÅ« È®º¸(&O)...",IDC_CREDS_OBTAIN,51,63,88,14 +END + +IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + LTEXT "(Á¶È¸ Áß...)",IDC_SERVICE_STATUS,7,9,275,8 + PUSHBUTTON "¼­ºñ½º ½ÃÀÛ(&S)",IDC_SERVICE_START,51,28,63,14 + PUSHBUTTON "¼­ºñ½º Á¤Áö(&T)",IDC_SERVICE_STOP,118,28,63,14 + PUSHBUTTON "AFS Ŭ¶óÀÌ¾ðÆ® ±¸¼º(&C)",IDC_OPEN_CPL,185,28,97,14 + CONTROL "ÀÌ ÄÄÇ»ÅͰ¡ Àç½ÃÀÛµÉ ¶§¸¶´Ù AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º ½ÃÀÛ(&a)", + IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, + 51,204,10 + CONTROL "ÀÛ¾÷ Ç¥½ÃÁÙ¿¡ AFS Ŭ¶óÀÌ¾ðÆ® ¾ÆÀÌÄÜÀ» Ç×»ó Ç¥½Ã(&A)", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65, + 204,10 + PUSHBUTTON "µµ¿ò¸»",9,237,63,45,14 +END + +IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 232, 127 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "»õ AFS ÅäÅ« È®º¸" +FONT 9, "±¼¸²" +BEGIN + LTEXT "»õ AFS ÅäÅ«À» È®º¸ÇÏ·Á¸é, AFS °èÁ¤¿¡ ´ëÇÑ AFS »ç¿ëÀÚ À̸§ ¹× ¾ÏÈ£¸¦ ÀÔ·ÂÇϽʽÿÀ. ÅäÅ«Àº µ¿½Ã¿¡ ¿©·¯ AFS ¼¿¿¡ ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù.", + IDC_STATIC,7,7,218,24 + LTEXT "AFS ¼¿(&C):",IDC_STATIC,24,42,30,8 + EDITTEXT IDC_NEWCREDS_CELL,67,40,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "»ç¿ëÀÚ À̸§(&N):",IDC_STATIC,24,60,38,8 + EDITTEXT IDC_NEWCREDS_USER,67,58,97,14,ES_AUTOHSCROLL + LTEXT "¾ÏÈ£(&P):",IDC_STATIC,23,78,34,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,67,76,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "È®ÀÎ",IDOK,69,106,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,122,106,50,14 + PUSHBUTTON "µµ¿ò¸»",9,175,106,50,14 +END + +IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "»õ AFS ÅäÅ« È®º¸" +FONT 9, "±¼¸²" +BEGIN + LTEXT "»õ AFS ÅäÅ«À» È®º¸ÇÏ·Á¸é, AFS °èÁ¤¿¡ ´ëÇÑ AFS »ç¿ëÀÚ À̸§ ¹× ¾ÏÈ£¸¦ ÀÔ·ÂÇϽʽÿÀ. ÅäÅ«Àº µ¿½Ã¿¡ ¿©·¯ AFS ¼¿¿¡ ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù.", + IDC_STATIC,7,29,218,24 + LTEXT "AFS ¼¿(&C):",IDC_STATIC,24,70,30,8 + EDITTEXT IDC_NEWCREDS_CELL,67,68,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "»ç¿ëÀÚ À̸§(&N):",IDC_STATIC,24,88,38,8 + EDITTEXT IDC_NEWCREDS_USER,67,86,97,14,ES_AUTOHSCROLL + LTEXT "¾ÏÈ£(&P):",IDC_STATIC,23,106,34,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,67,104,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "%1 ¼¿¿¡ ÀÖ´Â ÅäÅ«ÀÌ °ð ¸¸±âµË´Ï´Ù.",IDC_NEWCREDS_TITLE, + 7,7,218,16 + DEFPUSHBUTTON "È®ÀÎ",IDOK,69,134,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,122,134,50,14 + PUSHBUTTON "µµ¿ò¸»",9,175,134,50,14 +END + +IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "±¼¸²" +BEGIN + LTEXT "´ÙÀ½ µå¶óÀ̺ê À̸§À» AFSÀÇ °æ·Î¿¡ ¸ÊÇÎÇϵµ·Ï ¼±ÅÃÇß½À´Ï´Ù.", + IDC_TITLE,7,8,275,8 + PUSHBUTTON "Ãß°¡(&A)...",IDC_ADD,51,63,45,14 + PUSHBUTTON "º¯°æ(&C)...",IDC_EDIT,99,63,45,14 + PUSHBUTTON "Á¦°Å(&R)",IDC_REMOVE,147,63,45,14 + CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x1d3,51,21,231,37 + PUSHBUTTON "µµ¿ò¸»",9,237,63,45,14 +END + +IDD_WIZARD DIALOGEX 0, 0, 272, 152 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Ŭ¶óÀÌ¾ðÆ® ¸¶¹ý»ç" +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "´ÙÀ½(&N) >",IDNEXT,162,131,50,14 + PUSHBUTTON "Ãë¼Ò(&L)",IDCANCEL,215,131,50,14 + CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,112 + CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,91,7,174,112 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,125,258,1 + PUSHBUTTON "µµ¿ò¸»(&H)",9,59,131,50,14 + PUSHBUTTON "< µÚ·Î(&B)",IDBACK,112,131,50,14 +END + +IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "±¼¸²" +BEGIN + LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ¾ÆÁ÷ ½ÃÀÛµÇÁö ¾Ê¾Ò½À´Ï´Ù.", + IDC_STATIC,0,0,173,8 + LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ ½ÃÀÛÇÏ·Á¸é, ´ÙÀ½À» ´©¸£½Ê½Ã¿À.", + IDC_STATIC,0,59,173,22 + LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ½ÇÇàµÉ ¶§±îÁö AFS¿¡ ÀúÀåµÈ ÆÄÀÏÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.", + IDC_STATIC,0,17,173,17 + LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ Á¤ÁöµÈ »óÅ·ΠµÎ·Á¸é, Ãë¼Ò¸¦ ´©¸£½Ê½Ã¿À.", + IDC_STATIC,0,88,174,21 +END + +IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "±¼¸²" +BEGIN + LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º´Â ½ÇÇà ÁßÀÌÁö¸¸, AFS »ç¿ë¿¡ ÇÊ¿äÇÑ ÅäÅ«À» ¾ÆÁ÷ È®º¸ÇÏÁö ¸øÇß½À´Ï´Ù.", + IDC_STATIC,0,0,173,16 + CONTROL "ÀÓÀÇÀÇ ¼¿¿¡ ´ëÇÑ ÅäÅ«À» È®º¸ÇÏÁö ¾ÊÀ½",IDC_NOCREDS, + "Button",BS_AUTORADIOBUTTON,10,28,141,10 + CONTROL "´ÙÀ½ ¼¿¿¡¼­ ÅäÅ« È®º¸",IDC_YESCREDS,"Button", + BS_AUTORADIOBUTTON,10,44,141,10 + LTEXT "AFS ¼¿(&C):",IDC_STATIC,34,64,30,8 + EDITTEXT IDC_NEWCREDS_CELL,77,62,96,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "»ç¿ëÀÚ À̸§(&N):",IDC_STATIC,34,82,38,8 + EDITTEXT IDC_NEWCREDS_USER,77,80,96,14,ES_AUTOHSCROLL + LTEXT "¾ÏÈ£(&P):",IDC_STATIC,33,100,34,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,77,97,96,14,ES_PASSWORD | + ES_AUTOHSCROLL +END + +IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "±¼¸²" +BEGIN + LTEXT "±â´Ù¸®½Ê½Ã¿À. AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ½ÃÀÛ ÁßÀÔ´Ï´Ù...", + IDC_START_TRY,0,33,173,8 + LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n³×Æ®¿öÅ© ¼³Á¤À» Á¡°ËÇϰí Á¦¾îÆÇÀÇ AFS ¾ÆÀÌÄÜÀ» »ç¿ëÇÏ¿© ÀÌ ÄÄÇ»ÅÍ¿¡¼­ÀÇ AFS Ŭ¶óÀ̾ðÆ®ÀÇ ±¸¼ºÀ» È®ÀÎÇϽʽÿÀ.", + IDC_START_FAIL,0,25,173,41 +END + +IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "±¼¸²" +BEGIN + LTEXT "AFS¿¡ ÀúÀåµÈ ÆÄÀÏ¿¡ ¾×¼¼½ºÇÏ·Á¸é, µå¶óÀ̺ê À̸§À» AFSÀÇ °æ·Î¿¡ ¸ÊÇνÃÄÑ¾ß ÇÕ´Ï´Ù.", + IDC_STATIC,0,0,173,16 + CONTROL "AFS¿¡¼­ °æ·Î¿¡ µå¶óÀ̺ê À̸§À» ¸ÊÇÎ ¾ÈÇÔ(&D)",IDC_NOMAP, + "Button",BS_AUTORADIOBUTTON,10,23,157,10 + CONTROL "AFS¿¡¼­ °æ·Î¿¡ µå¶óÀ̺ê À̸§À» ¸ÊÇÎÇÔ(&M)",IDC_YESMAP, + "Button",BS_AUTORADIOBUTTON,10,40,156,10 + LTEXT "µå¶óÀ̺ê À̸§(&L):",IDC_STATIC,30,58,44,8 + COMBOBOX IDC_MAP_LETTER,77,56,48,125,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS °æ·Î(&P):",IDC_STATIC,34,76,33,8 + EDITTEXT IDC_MAP_PATH,77,74,96,14,ES_AUTOHSCROLL + LTEXT "¼³¸í(&E):",IDC_STATIC,34,94,38,8 + EDITTEXT IDC_MAP_DESC,77,92,60,14,ES_AUTOHSCROLL +END + +IDD_TERMINATE DIALOGEX 0, 0, 291, 117 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Ŭ¶óÀ̾ðÆ®" +FONT 9, "±¼¸²" +BEGIN + PUSHBUTTON "¾ÆÀÌÄÜ Á¦°Å(&R)",IDOK,167,96,63,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,234,96,50,14 + LTEXT "ÄÄÇ»ÅÍÀÇ ÀÛ¾÷ Ç¥½ÃÁÙ¿¡¼­ AFS Ŭ¶óÀÌ¾ðÆ® ¾ÆÀÌÄÜÀ» Á¦°ÅÇϵµ·Ï ¼±ÅÃÇß½À´Ï´Ù. AFS Ŭ¶óÀÌ¾ðÆ® ¾ÆÀÌÄÜÀÌ ÄÄÇ»ÅÍÀÇ ÀÛ¾÷ Ç¥½ÃÁÙ¿¡ ¾øÀ¸¸é, AFS´Â AFS ÅäÅ«ÀÌ ¸¸±âµÉ ¶§ À̸¦ °æ°íÇÒ ¼ö ¾ø½À´Ï´Ù.", + IDC_STATIC,7,7,277,25 + LTEXT "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ÇöÀç ½ÇÇà ÁßÀÔ´Ï´Ù. ÇÊ¿äÇÑ °æ¿ì, Áö±Ý Á¤Áö½Ãų ¼ö ÀÖ½À´Ï´Ù.", + IDC_STATIC,7,41,277,8 + CONTROL "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ ½ÇÇà »óÅ·ΠµÒ(&L)",IDC_LEAVE, + "Button",BS_AUTORADIOBUTTON,26,55,228,10 + CONTROL "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º Á¤Áö(&S)",IDC_STOP,"Button", + BS_AUTORADIOBUTTON,26,69,228,10 + CONTROL "ÄÄÇ»ÅͰ¡ ´Ù½Ã ½ÃÀÛÇÒ ¶§ ¾ÆÀÌÄÜ Ç¥½Ã(&H)",IDC_STARTUP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,98,148,10 +END + +IDD_TERMINATE_SMALL DIALOGEX 0, 0, 291, 68 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Ŭ¶óÀ̾ðÆ®" +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + PUSHBUTTON "¾ÆÀÌÄÜ Á¦°Å(&R)",IDOK,167,47,63,14 + PUSHBUTTON "Ãë¼Ò(&L)",IDCANCEL,234,47,50,14 + LTEXT "ÄÄÇ»ÅÍÀÇ ÀÛ¾÷ Ç¥½ÃÁÙ¿¡¼­ AFS Ŭ¶óÀÌ¾ðÆ® ¾ÆÀÌÄÜÀ» Á¦°ÅÇϵµ·Ï ¼±ÅÃÇß½À´Ï´Ù. AFS Ŭ¶óÀÌ¾ðÆ® ¾ÆÀÌÄÜÀÌ ÄÄÇ»ÅÍÀÇ ÀÛ¾÷ Ç¥½ÃÁÙ¿¡ ¾øÀ¸¸é, AFS´Â AFS ÅäÅ«ÀÌ ¸¸±âµÉ ¶§ À̸¦ °æ°íÇÒ ¼ö ¾ø½À´Ï´Ù.", + -1,7,7,277,25 + CONTROL "ÄÄÇ»ÅͰ¡ ´Ù½Ã ½ÃÀÛÇÒ ¶§ ¾ÆÀÌÄÜ Ç¥½Ã(&H)",IDC_STARTUP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49,148,10 +END + +IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 291, 68 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS ¶óÀÌÆ®" +FONT 9, "±¼¸²", 0, 0, 0x1 +BEGIN + PUSHBUTTON "¾ÆÀÌÄÜ Á¦°Å(&R)",IDOK,167,47,63,14 + PUSHBUTTON "Ãë¼Ò(&L)",IDCANCEL,234,47,50,14 + LTEXT "ÄÄÇ»ÅÍÀÇ ÀÛ¾÷ Ç¥½ÃÁÙ¿¡¼­ AFS ¶óÀÌÆ® ¾ÆÀÌÄÜÀ» Á¦°ÅÇϵµ·Ï ¼±ÅÃÇß½À´Ï´Ù. AFS ¶óÀÌÆ® ¾ÆÀÌÄÜÀÌ ÄÄÇ»ÅÍÀÇ ÀÛ¾÷ Ç¥½ÃÁÙ¿¡ ¾øÀ¸¸é, AFS´Â AFS ÅäÅ«ÀÌ ¸¸±âµÉ ¶§ À̸¦ °æ°íÇÒ ¼ö ¾ø½À´Ï´Ù.", + -1,7,7,277,25 + CONTROL "ÄÄÇ»ÅͰ¡ ´Ù½Ã ½ÃÀÛÇÒ ¶§ ¾ÆÀÌÄÜ Ç¥½Ã(&H)",IDC_STARTUP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49,148,10 +END + +IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "±¼¸²" +BEGIN + LTEXT "¼±ÅÃÇÑ Çϳª ÀÌ»óÀÇ µå¶óÀ̺ê À̸§À» AFSÀÇ ÇØ´ç °æ·Î¿¡ ¸ÊÇνÃų ¼ö ¾ø½À´Ï´Ù.\n\nAFSÀÇ °æ·Î¸¦ »ç¿ëÇÏ·Á°í ½Ãµµ ÁßÀÎ ¸ðµç ÀÀ¿ëÇÁ·Î±×·¥À» ´Ý¾Æ¾ß ÇÕ´Ï´Ù.", + IDC_MAP_FAIL,1,26,173,41 + LTEXT "±â´Ù¸®½Ê½Ã¿À. AFSÀÇ °æ·Î¿¡ µå¶óÀ̺ê À̸§À» ¸ÊÇÎÇÏ´Â ÁßÀÔ´Ï´Ù...", + IDC_MAP_TRY,0,33,173,8 +END + +IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "±¼¸²" +BEGIN + LTEXT "ÀÌÁ¦ AFS Ŭ¶óÀÌ¾ðÆ®¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.",IDC_STATIC,0, + 0,173,8 + LTEXT "¸¶¹ý»ç¸¦ ³¡³»½Ã·Á¸é Á¾·á¸¦ ´©¸£½Ê½Ã¿À.",IDC_STATIC,0,73, + 173,8 +END + +IDD_MAPPING DIALOG DISCARDABLE 0, 0, 275, 152 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "µå¶óÀ̺ê À̸§ ¸ÊÇÎ" +FONT 9, "±¼¸²" +BEGIN + LTEXT "ÄÄÇ»ÅÍÀÇ µå¶óÀ̺ê À̸§À» AFSÀÇ °æ·Î¿¡ ¸ÊÇÎÇÒ ¼ö ÀÖ½À´Ï´Ù.\n\n¿¹¸¦ µé¾î, Q:¸¦ \\afs\\acme.com\\usr\\bob·Î ¸ÊÇÎÇϸé, AFS¿¡¼­ \\afs\\acme.com\\usr\\bob\\*·Î¼­ »ç¿ë°¡´ÉÇÑ ÆÄÀÏÀ» Q:¿¡¼­ º¼ ¼ö ÀÖ°Ô µË´Ï´Ù.\\", + IDC_STATIC,7,7,261,32 + LTEXT "µå¶óÀ̺ê À̸§(&L):",IDC_STATIC,23,53,45,8 + COMBOBOX IDC_MAP_LETTER,73,51,56,162,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS °æ·Î(&P):",IDC_STATIC,23,70,33,8 + EDITTEXT IDC_MAP_PATH,73,68,178,13,ES_AUTOHSCROLL + LTEXT "¼³¸í(&E):",IDC_STATIC,23,88,38,8 + EDITTEXT IDC_MAP_DESC,73,86,60,13,ES_AUTOHSCROLL + CONTROL "·Î±×¿ÂÇÒ ¶§¸¶´Ù ÀÌ ¸ÊÇÎ º¹¿ø(&R)",IDC_MAP_PERSISTENT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,73,105,185,10 + DEFPUSHBUTTON "È®ÀÎ",IDOK,112,131,50,14 + PUSHBUTTON "Ãë¼Ò",IDCANCEL,165,131,50,14 + PUSHBUTTON "µµ¿ò¸»",9,218,131,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 314 + TOPMARGIN, 8 + BOTTOMMARGIN, 122 + END + + IDD_TAB_CREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_NOCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_ADVANCED, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_NEWCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 120 + END + + IDD_NEWCREDS_EXPIRE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 148 + END + + IDD_TAB_MOUNT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_WIZARD, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 265 + TOPMARGIN, 7 + BOTTOMMARGIN, 145 + END + + IDD_TERMINATE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 110 + END + + IDD_TERMINATE_SMALL, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 61 + END + + IDD_MAPPING, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 268 + TOPMARGIN, 7 + BOTTOMMARGIN, 145 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_TRAYICON MENU DISCARDABLE +BEGIN + MENUITEM "ÅäÅ« Ç¥½Ã(&S)...", M_ACTIVATE + MENUITEM "¸¸±â Àü °æ°í(&W)", M_REMIND, CHECKED + MENUITEM SEPARATOR + MENUITEM "¾ÆÀÌÄÜ Á¦°Å(&R)", M_TERMINATE +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" +IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP "AFS Ŭ¶óÀ̾ðÆ®" + IDS_TOOLTIP_95 "AFS ¶óÀÌÆ®" + IDS_CREDENTIALS "ÅäÅ«" + IDS_UNKNOWN "(¾Ë ¼ö ¾øÀ½)" + IDS_ADVANCED "°í±Þ" + IDS_CREDS "%1(ÅäÅ«Àº %2¿¡ ¸¸±â)" + IDS_NO_CREDS "(ÀÌ ¼¿¿¡ ÅäÅ«ÀÌ ¾ø½À´Ï´Ù)" + IDS_SERVICE_BROKEN "AFS Ŭ¶óÀÌ¾ðÆ®°¡ Á¦´ë·Î ¼³Ä¡µÇÁö ¾Ê¾Ò°Å³ª ±× »óŸ¦ Á¶È¸ÇÒ ±ÇÇÑÀÌ ¾ø½À´Ï´Ù." + IDS_SERVICE_RUNNING "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ Á¤»óÀûÀ¸·Î ½ÇÇà ÁßÀÔ´Ï´Ù." + IDS_SERVICE_STOPPED "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ÇöÀç Á¤ÁöµÇ¾ú½À´Ï´Ù." + IDS_SERVICE_STOPPING "±â´Ù¸®½Ê½Ã¿À. AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ Á¤Áö ÁßÀÔ´Ï´Ù..." + IDS_SERVICE_STARTING "±â´Ù¸®½Ê½Ã¿À. AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ½ÃÀÛ ÁßÀÔ´Ï´Ù..." + IDS_SERVICE_UNKNOWN "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½ºÀÇ »óŸ¦ ÆÇº°ÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_SERVICE_FAIL_STOP "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ Á¤ÁöÇÒ ¼ö ¾ø½À´Ï´Ù. ÀÌ Á¶ÀÛÀ» ¼öÇàÇÒ ¼ö ÀÖ´Â ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.\n\n¿À·ù 0x%1." + IDS_SERVICE_FAIL_START "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º¸¦ ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù. ÀÌ Á¶ÀÛÀ» ¼öÇàÇÒ ¼ö ÀÖ´Â ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.\n\n¿À·ù 0x%1." + IDS_SERVICE_FAIL_CONFIG "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½ºÀÇ ½Ãµ¿ ¸Å°³º¯¼ö¸¦ º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù. ÀÌ Á¶ÀÛÀ» ¼öÇàÇÒ ¼ö ÀÖ´Â ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.\n\n¿À·ù 0x%1." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_ERROR "¼­ºñ½º ±¸¼º ¿À·ù" + IDS_ERROR_TITLE "¿À·ù - AFS Ŭ¶óÀ̾ðÆ®" + IDS_ERROR_TITLE_95 "¿À·ù - AFS ¶óÀÌÆ®" + IDS_ERROR_DESTROY_95 "%1 ¼¿¿¡ ÀÖ´Â ÅäÅ«À» ÆÄ±«ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n¿À·ù: %2" + IDS_ERROR_DESTROY_NOCM "AFS Ŭ¶óÀÌ¾ðÆ® ¼­ºñ½º°¡ ÀÀ´äÇÏÁö ¾Ê¾ÒÀ¸¹Ç·Î %1 ¼¿¿¡ ÀÖ´Â ÅäÅ«À» ÆÄ±«ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n°í±Þ ÅÇÀ» È®ÀÎÇÏ¿© AFS Ŭ¶óÀÌ¾ðÆ®°¡ Á¦´ë·Î ½ÇÇà ÁßÀÎÁö º¸½Ê½Ã¿À.\n\n¿À·ù: %2" + IDS_ERROR_DESTROY_UNKNOWN + "%1 ¼¿¿¡ ÀÖ´Â ÅäÅ«À» ÆÄ±«ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nÈ®Àå ÅÇÀ» È®ÀÎÇÏ¿© AFS Ŭ¶óÀÌ¾ðÆ®°¡ Á¦´ë·Î ½ÇÇà ÁßÀÎÁö º¸½Ê½Ã¿À.\n\n¿À·ù: %2" + IDS_ERROR_OBTAIN "AFS Ŭ¶óÀÌ¾ðÆ®´Â ÅäÅ«À» %1 ¼¿ÀÇ %2(À¸)·Î È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n¿À·ù: %4(%3)" + IDS_ERROR_OBTAIN_95 "AFS ¶óÀÌÆ®´Â ÅäÅ«À» %1 ¼¿ÀÇ %2(À¸)·Î¼­ È®º¸ÇÒ ¼ö ¾ø½À´Ï´Ù.\n\n¿À·ù: %4(%3)" + IDS_TITLE_VERSION "%s AFS ¹öÀü" + IDS_TITLE_VERSION_NOPATCH "%s AFS ¹öÀü" + IDS_MOUNT_SOME "´ÙÀ½ µå¶óÀ̺ê À̸§À» AFSÀÇ °æ·Î¿¡ ¸ÊÇÎÇϵµ·Ï ¼±ÅÃÇß½À´Ï´Ù." + IDS_MOUNT_NONE "¾ÆÁ÷ AFS °æ·Î¿¡ µå¶óÀ̺ê À̸§À» ¸ÊÇÎÇϵµ·Ï ¼±ÅÃÇÏÁö ¾Ê¾Ò½À´Ï´Ù." + IDS_MOUNT "µå¶óÀ̺ê À̸§" + IDS_WIZ_NEXT "´ÙÀ½(&N) >" + IDS_WIZ_FINISH "Á¾·á(&F)" + IDS_MAP_LETTER "µå¶óÀ̺ê *:" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DRIVE_MAP "%1: µå¶óÀ̺ê \t%2" + IDS_ERROR_MAP "³×Æ®¿öÅ© µå¶óÀÌºê ¸ÊÇÎ ¿À·ù" + IDS_ERROR_MAP_DESC "AFS´Â ³×Æ®¿öÅ© µå¶óÀ̺긦 AFS¿¡¼­ ÁöÁ¤µÈ °æ·Î¿¡ ¸ÊÇÎÇÒ ¼ö ¾ø½À´Ï´Ù. ÇöÀç µå¶óÀ̺ê À̸§ÀÌ »ç¿ë ÁßÀ̾´Â ¾ÈµË´Ï´Ù.\n\n¿À·ù: 0x%1." + IDS_ERROR_UNMAP "³×Æ®¿öÅ© µå¶óÀÌºê ¸ÊÇÎ ¿À·ù" + IDS_ERROR_UNMAP_DESC "AFS´Â ÁöÁ¤µÈ ³×Æ®¿öÅ© µå¶óÀ̺긦 ¾ð¸ÊÇÒ ¼ö ¾ø½À´Ï´Ù. ÇöÀç µå¶óÀ̺ê À̸§ÀÌ »ç¿ë ÁßÀ̾´Â ¾ÈµË´Ï´Ù.\n\n¿À·ù: 0x%1." + IDS_CELL_GATEWAY "%s(%s °ÔÀÌÆ®¿þÀ̸¦ ÅëÇØ)" + IDS_BADMAP_TITLE "³×Æ®¿öÅ© µå¶óÀÌºê ¸ÊÇÎ ¿À·ù" + IDS_BADMAP_DESC "AFS´Â °æ·Î°¡ \\afs""·Î ½ÃÀÛÇÏÁö ¾ÊÀ¸¹Ç·Î µå¶óÀ̺ê À̸§À» ÁöÁ¤µÈ °æ·Î¿¡ ¸ÊÇÎÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nÀÔ·ÂÇÑ °æ·Î°¡ \\afs""·Î ½ÃÀÛÇÏ´ÂÁö È®ÀÎÇÏ°í ´Ù½Ã ½ÃµµÇϽʽÿÀ." + IDS_UNCONFIG_TITLE_95 "¿À·ù - AFS ¶óÀÌÆ®" + IDS_UNCONFIG_DESC_95 "AFS ¶óÀÌÆ®°¡ ¾ÆÁ÷ ±¸¼ºµÇÁö ¾Ê¾ÒÀ¸¹Ç·Î »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nAFS ¶óÀÌÆ®¸¦ ±¸¼ºÇÏ·Á¸é, Á¦¾îÆÇÀ» ¿­°í AFS ¶óÀÌÆ® ±¸¼º ¾ÆÀÌÄÜÀ» µÎ ¹ø ´©¸£½Ê½Ã¿À." + IDS_UNCONFIG_TITLE "¿À·ù - AFS Ŭ¶óÀ̾ðÆ®" + IDS_UNCONFIG_DESC "AFS Ŭ¶óÀÌ¾ðÆ®°¡ ¾ÆÁ÷ ±¸¼ºµÇÁö ¾Ê¾ÒÀ¸¹Ç·Î »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nAFS Ŭ¶óÀÌ¾ðÆ®¸¦ ±¸¼ºÇÏ·Á¸é, Á¦¾îÆÇÀ» ¿­°í AFS Ŭ¶óÀÌ¾ðÆ® ¾ÆÀÌÄÜÀ» µÎ ¹ø ´©¸£½Ê½Ã¿À." + IDS_NEWSUB_TITLE "ÁÖÀÇ - AFS Ŭ¶óÀ̾ðÆ®" + IDS_NEWSUB_TITLE_95 "ÁÖÀÇ - AFS ¶óÀÌÆ®" + IDS_NEWSUB_DESC "AFS´Â ³×Æ®¿öÅ© µå¶óÀ̺꿡 ¿¬°áÇÒ ¶§ ÁöÁ¤µÈ ¼³¸íÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nÁöÁ¤µÈ ¼³¸íÀº ÀÌ¹Ì ´Ù¸¥ AFS °æ·Î¿¡¼­ »ç¿ëµÇ¾ú½À´Ï´Ù." + IDS_BADSUB_TITLE "¿À·ù - AFS Ŭ¶óÀ̾ðÆ®" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADSUB_TITLE_95 "¿À·ù - AFS ¶óÀÌÆ®" + IDS_BADSUB_DESC "ÀÔ·ÂÇÑ µå¶óÀ̺ê À̸§ ¼³¸íÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.\n\nµå¶óÀ̺ê À̸§ ¼³¸í¿¡´Â 12 ¹®ÀÚ ÀÌ»óÀ» »ç¿ëÇÒ ¼ö ¾øÀ¸¸ç °ø¹é ¶Ç´Â ÅÇÀ» Æ÷ÇÔÇÒ ¼ö ¾ø½À´Ï´Ù." + IDS_TITLE_95 "AFS ¶óÀÌÆ®" +END + +#endif // Korean resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/client_creds/lang/pt_BR/afscreds.rc b/src/WINNT/client_creds/lang/pt_BR/afscreds.rc index ae3bb7809..586ea2a66 100644 --- a/src/WINNT/client_creds/lang/pt_BR/afscreds.rc +++ b/src/WINNT/client_creds/lang/pt_BR/afscreds.rc @@ -7,25 +7,25 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#endif //_WIN32 +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Version @@ -39,542 +39,542 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #define AFS_VERINFO_CHARSET 1252 #include "AFS_component_version_number.h" #include "..\..\config\NTVersioninfo.rc" - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "afscreds.ico" -IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" -IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" -IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_MAIN DIALOG DISCARDABLE 0, 0, 361, 130 -STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS Client" -CLASS "AfsCreds" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "AFS Versão %s (correção %lu)",IDC_TITLE_VERSION,244,8, - 111,8 - LTEXT "Atualmente com logon no Windows Networking como ""%s""", - IDC_TITLE_NT,7,8,231,8 - CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,26,347,97 -END - -IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Célula: ",IDC_STATIC,7,9,24,8 - LTEXT "(nenhuma)",IDC_CREDS_CELL,51,9,193,8 - LTEXT "Tokens:",IDC_STATIC,7,26,27,8 - LTEXT "(nenhum)",IDC_CREDS_INFO,51,26,193,8 - CONTROL "&Mostrar um aviso antes que estes tokens vençam", - IDC_CREDS_REMIND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 51,43,193,10 - PUSHBUTTON "&Obter Novos Tokens...",IDC_CREDS_OBTAIN,51,63,88,14 - PUSHBUTTON "&Descartar Estes Tokens",IDC_CREDS_DESTROY,142,63,92,14 - PUSHBUTTON "Ajuda",9,237,63,45,14 -END - -IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Você não possui tokens em nenhuma célula do AFS.", - IDC_RUNNING,7,9,275,8 - LTEXT "O AFS Client não está configurado corretamente, ou o serviço do AFS Client não está em execução.\n\nUse a guia Avançado para iniciar o serviço do AFS Client.", - IDC_STOPPED,7,9,275,40 - PUSHBUTTON "Ajuda",9,237,63,45,14 - PUSHBUTTON "&Obter Novos Tokens...",IDC_CREDS_OBTAIN,51,63,88,14 -END - -IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "(consultando...)",IDC_SERVICE_STATUS,7,9,275,8 - PUSHBUTTON "&Iniciar Serviço",IDC_SERVICE_START,51,28,65,14 - PUSHBUTTON "&Parar Serviço",IDC_SERVICE_STOP,128,28,65,14 - PUSHBUTTON "&Configurar AFS Client",IDC_OPEN_CPL,205,28,78,14 - CONTROL "I&niciar o Serviço do AFS Client sempre que este computador for reiniciado", - IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, - 51,262,10 - CONTROL "&Sempre mostrar o ícone do AFS Client na barra de tarefas", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65, - 204,10 - PUSHBUTTON "Ajuda",9,237,63,45,14 -END - -IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 232, 127 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Obter Novos Tokens do AFS" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Para obter novos tokens do AFS, digite seu nome de usuário do AFS e a senha para sua conta do AFS. Você pode ter tokens em várias células do AFS simultaneamente.", - IDC_STATIC,7,7,218,24 - LTEXT "&Célula do AFS:",IDC_STATIC,16,42,49,8 - EDITTEXT IDC_NEWCREDS_CELL,78,40,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "&Nome do Usuário:",IDC_STATIC,16,60,60,8 - EDITTEXT IDC_NEWCREDS_USER,78,58,97,14,ES_AUTOHSCROLL - LTEXT "&Senha:",IDC_STATIC,15,78,34,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,78,76,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,69,106,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,122,106,50,14 - PUSHBUTTON "Ajuda",9,175,106,50,14 -END - -IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Obter Novos Tokens do AFS" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Para obter novos tokens do AFS, digite seu nome de usuário do AFS e a senha para sua conta do AFS. Você pode ter tokens em várias células do AFS simultaneamente.", - IDC_STATIC,7,29,218,24 - LTEXT "&Célula do AFS:",IDC_STATIC,17,70,51,8 - EDITTEXT IDC_NEWCREDS_CELL,78,68,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "&Nome do Usuário:",IDC_STATIC,17,88,59,8 - EDITTEXT IDC_NEWCREDS_USER,78,86,97,14,ES_AUTOHSCROLL - LTEXT "&Senha:",IDC_STATIC,16,106,34,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,78,104,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "Seus tokens na célula %1 estão prestes a vencer.", - IDC_NEWCREDS_TITLE,7,7,218,16 - DEFPUSHBUTTON "OK",IDOK,69,134,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,122,134,50,14 - PUSHBUTTON "Ajuda",9,175,134,50,14 -END - -IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Você escolheu mapear as seguintes letras de unidades para caminhos no AFS:", - IDC_TITLE,7,8,275,8 - PUSHBUTTON "&Incluir...",IDC_ADD,51,63,45,14 - PUSHBUTTON "Al&terar...",IDC_EDIT,99,63,45,14 - PUSHBUTTON "&Remover",IDC_REMOVE,147,63,45,14 - CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x1d3,51,21,231,37 - PUSHBUTTON "Ajuda",9,237,63,45,14 -END - -IDD_WIZARD DIALOGEX 0, 0, 272, 152 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "Assistente do AFS Client" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "A&vançar >",IDNEXT,162,131,50,14 - PUSHBUTTON "Cance&lar",IDCANCEL,215,131,50,14 - CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,112 - CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,91,7,174,112 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,125,258,1 - PUSHBUTTON "&Ajuda",9,59,131,50,14 - PUSHBUTTON "< Vol&tar",IDBACK,112,131,50,14 -END - -IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "O Serviço do AFS Client ainda não iniciou.",IDC_STATIC, - 0,0,173,8 - LTEXT "Para iniciar o Serviço do AFS Client, clique em Avançar.", - IDC_STATIC,0,72,173,18 - LTEXT "Enquanto o Serviço do AFS Client não estiver em execução, não será possível usar arquivos armazenados no AFS.", - IDC_STATIC,0,17,173,28 - LTEXT "Para deixar o Serviço do AFS Client parado, clique em Cancelar.", - IDC_STATIC,0,90,173,19 -END - -IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "O Serviço do AFS Client está agora em execução, mas você ainda não obteve nenhum token para usar o AFS.", - IDC_STATIC,0,0,173,26 - CONTROL "Não obter tokens para nenhuma célula",IDC_NOCREDS, - "Button",BS_AUTORADIOBUTTON,10,28,141,10 - CONTROL "Obter tokens na seguinte célula:",IDC_YESCREDS,"Button", - BS_AUTORADIOBUTTON,10,44,141,10 - LTEXT "&Célula do AFS:",IDC_STATIC,13,64,53,8 - EDITTEXT IDC_NEWCREDS_CELL,77,62,96,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "&Nome do Usuário:",IDC_STATIC,13,82,61,8 - EDITTEXT IDC_NEWCREDS_USER,77,80,96,14,ES_AUTOHSCROLL - LTEXT "&Senha:",IDC_STATIC,12,100,34,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,77,97,96,14,ES_PASSWORD | - ES_AUTOHSCROLL -END - -IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Aguarde; o Serviço do AFS Client está iniciando...", - IDC_START_TRY,0,33,173,8 - LTEXT "O Serviço do AFS Client não pôde ser iniciado.\n\nVerifique as definições da rede, e use o ícone do AFS no Painel de Controle para verificar a configuração do AFS Client neste computador.", - IDC_START_FAIL,0,25,173,41 -END - -IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Para acessar arquivos armazenados no AFS, é preciso mapear letras de unidades para caminhos no AFS.", - IDC_STATIC,0,0,173,16 - CONTROL "&Não mapear nenhuma letra de unidade ",IDC_NOMAP,"Button", - BS_AUTORADIOBUTTON,9,20,151,13 - CONTROL "&Mapear ao menos uma letra de unidade:",IDC_YESMAP, - "Button",BS_AUTORADIOBUTTON,9,35,156,12 - LTEXT "&Letra da Unidade:",IDC_STATIC,10,58,62,8 - COMBOBOX IDC_MAP_LETTER,77,56,48,125,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Caminho do AFS:",IDC_STATIC,10,76,58,8 - EDITTEXT IDC_MAP_PATH,77,74,96,14,ES_AUTOHSCROLL - LTEXT "D&escrição:",IDC_STATIC,10,94,38,8 - EDITTEXT IDC_MAP_DESC,77,92,60,14,ES_AUTOHSCROLL -END - -IDD_TERMINATE DIALOGEX 0, 0, 305, 117 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Client" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - PUSHBUTTON "&Remover Ícone",IDOK,176,96,63,14 - PUSHBUTTON "Cance&lar",IDCANCEL,248,96,50,14 - LTEXT "Você escolheu remover o ícone do AFS Client da barra de tarefas de seu computador. A menos que o ícone do AFS Client esteja na barra de tarefas, o AFS não poderá avisá-lo quando seus tokens do AFS estiverem vencendo.", - IDC_STATIC,7,7,291,25 - LTEXT "O Serviço do AFS Client está em execução. Se desejar, pode pará-lo agora.", - IDC_STATIC,7,41,291,8 - CONTROL "&Deixar o Serviço do AFS Client executando",IDC_LEAVE, - "Button",BS_AUTORADIOBUTTON,26,55,228,10 - CONTROL "&Parar o Serviço do AFS Client",IDC_STOP,"Button", - BS_AUTORADIOBUTTON,26,69,228,10 - CONTROL "&Mostrar o ícone quando o computador reiniciar", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,98, - 165,10 -END - -IDD_TERMINATE_SMALL DIALOGEX 0, 0, 306, 69 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Client" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - PUSHBUTTON "&Remover Ícone",IDOK,178,48,63,14 - PUSHBUTTON "Cance&lar",IDCANCEL,249,48,50,14 - LTEXT "Você escolheu remover o ícone do AFS Client da barra de tarefas de seu computador. A menos que o ícone do AFS Client esteja na barra de tarefas, o AFS não poderá avisá-lo quando seus tokens do AFS estiverem vencendo.", - -1,7,7,292,25 - CONTROL "&Mostrar o ícone quando o computador reiniciar", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49, - 166,10 -END - -IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 299, 69 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Básico" -FONT 9, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - PUSHBUTTON "&Remover Ícone",IDOK,175,47,63,14 - PUSHBUTTON "Cance&lar",IDCANCEL,242,47,50,14 - LTEXT "Você escolheu remover o ícone do AFS Básico da barra de tarefas de seu computador. A menos que o ícone do AFS Básico esteja na barra de tarefas, o AFS não poderá avisar quando seus tokens do AFS estiverem vencendo.", - -1,7,7,277,25 - CONTROL "&Mostrar o ícone quando o computador reiniciar", - IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49, - 162,10 -END - -IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Uma ou mais letras de unidades que você escolheu não puderam ser mapeadas para os caminhos apropriados no AFS.\n\nPode ser preciso fechar aplicações que já estejam tentando usar caminhos no AFS.", - IDC_MAP_FAIL,1,26,173,53 - LTEXT "Aguarde; mapeando letras de unidades para caminhos no AFS...", - IDC_MAP_TRY,0,33,173,8 -END - -IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "O AFS Client está pronto para uso.",IDC_STATIC,0,0,173, - 8 - LTEXT "Para fechar este assistente, clique em Finalizar.", - IDC_STATIC,0,73,173,8 -END - -IDD_MAPPING DIALOG DISCARDABLE 0, 0, 275, 152 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Mapear Letra de Unidade" -FONT 9, "MS Shell Dlg" -BEGIN - LTEXT "Você pode mapear letras de unidades em seu computador para caminhos no AFS.\n\nPor exemplo, se você mapear Q: como \\afs\\acme.com\\usr\\bob, os arquivos disponíveis no AFS como \\afs\\acme.com\\usr\\bob\\* estarão visíveis em Q:\\", - IDC_STATIC,7,7,261,34 - LTEXT "&Letra da Unidade:",IDC_STATIC,15,53,61,8 - COMBOBOX IDC_MAP_LETTER,82,51,56,162,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Caminho do AFS:",IDC_STATIC,15,70,64,8 - EDITTEXT IDC_MAP_PATH,82,68,178,13,ES_AUTOHSCROLL - LTEXT "D&escrição:",IDC_STATIC,15,88,38,8 - EDITTEXT IDC_MAP_DESC,82,86,60,13,ES_AUTOHSCROLL - CONTROL "&Restaurar este mapeamento sempre que eu efetuar logon", - IDC_MAP_PERSISTENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 66,105,199,10 - DEFPUSHBUTTON "OK",IDOK,112,131,50,14 - PUSHBUTTON "Cancelar",IDCANCEL,165,131,50,14 - PUSHBUTTON "Ajuda",9,218,131,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 354 - TOPMARGIN, 8 - BOTTOMMARGIN, 123 - END - - IDD_TAB_CREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_NOCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_ADVANCED, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_NEWCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 120 - END - - IDD_NEWCREDS_EXPIRE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 148 - END - - IDD_TAB_MOUNT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_WIZARD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 265 - TOPMARGIN, 7 - BOTTOMMARGIN, 145 - END - - IDD_TERMINATE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 298 - TOPMARGIN, 7 - BOTTOMMARGIN, 110 - END - - IDD_TERMINATE_SMALL, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 299 - TOPMARGIN, 7 - BOTTOMMARGIN, 62 - END - - IDD_MAPPING, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 268 - TOPMARGIN, 7 - BOTTOMMARGIN, 145 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_TRAYICON MENU DISCARDABLE -BEGIN - MENUITEM "&Mostrar Tokens...", M_ACTIVATE - MENUITEM "&Avisar Antes do Vencimento", M_REMIND, CHECKED - MENUITEM SEPARATOR - MENUITEM "&Remover Ícone", M_TERMINATE -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" -IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_TOOLTIP "AFS Client" - IDS_CREDENTIALS "Tokens" - IDS_UNKNOWN "(desconhecido)" - IDS_ADVANCED "Avançado" - IDS_CREDS "%1 (tokens vencem em %2)" - IDS_NO_CREDS "(você não possui tokens nesta célula)" - IDS_SERVICE_BROKEN "O Serviço do AFS Client não está corretamente instalado, ou você não possui autorização para consultar seu status." - IDS_SERVICE_RUNNING "O Serviço do AFS Client está sendo executado normalmente." - IDS_SERVICE_STOPPED "O Serviço do AFS Client está parado." - IDS_SERVICE_STOPPING "Aguarde; o Serviço do AFS Client está parando..." - IDS_SERVICE_STARTING "Aguarde; o Serviço do AFS Client está iniciando..." - IDS_SERVICE_UNKNOWN "O status do Serviço do AFS Client não pôde ser determinado." - IDS_SERVICE_FAIL_STOP "O Serviço do AFS Client não pôde ser parado com êxito. Você pode não ter autorização para realizar esta operação.\n\nErro 0x%1." -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_MAP "Erro Mapeando Unidade de Rede" - IDS_ERROR_MAP_DESC "O AFS foi incapaz de mapear a unidade de rede para o caminho especificado no AFS. Certifique-se de que a letra da unidade não esteja sendo utilizada.\n\nErro: 0x%1." - IDS_ERROR_UNMAP "Erro Mapeando Unidade de Rede" - IDS_ERROR_UNMAP_DESC "O AFS foi incapaz de remover o mapeamento da unidade de rede especificada. Certifique-se de que a letra da unidade não esteja sendo utilizada.\n\nErro: 0x%1." - IDS_CELL_GATEWAY "%s (via gateway %s)" - IDS_BADMAP_TITLE "Erro Mapeando Unidade de Rede" - IDS_BADMAP_DESC "O AFS não pode mapear uma letra de unidade para o caminho especificado porque o caminho não começa com ""\\afs"".\n\nDigite um caminho que comece com ""\\afs"", e tente novamente." - IDS_UNCONFIG_TITLE "Erro - AFS Client" - IDS_UNCONFIG_DESC "O AFS Client não pode ser usado porque ainda não está configurado.\n\nPara configurar o AFS Client, abra o Painel de Controle e dê um clique duplo no ícone de Configuração de AFS Client." - IDS_NEWSUB_TITLE "Atenção - AFS Client" - IDS_NEWSUB_DESC "O AFS não pôde usar a descrição especificada ao conectar-se à unidade de rede.\n\nA descrição especificada já é usada por um outro caminho do AFS." - IDS_BADSUB_TITLE "Erro - AFS Client" - IDS_BADSUB_DESC "A descrição da letra de unidade informada não pode ser usada.\n\nUma descrição de letra de unidade não pode ter mais de 12 caracteres, e não pode conter espaços ou tabulações." - IDS_TITLE_95 "AFS Básico" - IDS_TOOLTIP_95 "AFS Básico" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_FAIL_START "O Serviço do AFS Client não pôde ser iniciado com êxito. Você pode não ter autorização para realizar esta operação.\n\nErro 0x%1." - IDS_SERVICE_FAIL_CONFIG "Os parâmetros de inicialização do Serviço do AFS Client não puderam ser alterados. Você pode não ter autorização para realizar esta operação.\n\nErro 0x%1." - IDS_SERVICE_ERROR "Erro ao Configurar Serviço" - IDS_ERROR_TITLE "Erro - AFS Client" - IDS_ERROR_DESTROY_NOCM "Seus tokens na célula %1 não puderam ser eliminados porque o Serviço do AFS Client não está respondendo.\n\nVerifique a guia Avançado para ver se o AFS Client está executando corretamente.\n\nErro: %2" - IDS_ERROR_DESTROY_UNKNOWN - "Seus tokens na célula %1 não puderam ser eliminados.\n\nVerifique a guia Avançado para ver se o AFS Client está sendo executado corretamente.\n\nErro: %2" - IDS_ERROR_OBTAIN "O AFS Client não conseguiu obter tokens como %2 na célula %1.\n\nErro: %4 (%3)" - IDS_TITLE_VERSION "AFS Versão %s" - IDS_TITLE_VERSION_NOPATCH "AFS Versão %s" - IDS_MOUNT_SOME "Você escolheu mapear as seguintes letras de unidades para caminhos no AFS:" - IDS_MOUNT_NONE "Você ainda não escolheu mapear nenhuma letra de unidade para caminhos no AFS." - IDS_MOUNT "Letras de Unidades" - IDS_WIZ_NEXT "A&vançar >" - IDS_WIZ_FINISH "&Finalizar" - IDS_MAP_LETTER "Unidade *:" - IDS_DRIVE_MAP "Unidade %1: \t%2" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_TITLE_95 "Erro - AFS Básico" - IDS_ERROR_DESTROY_95 "Seus tokens na célula %1 não puderam ser eliminados.\n\nErro: %2" - IDS_ERROR_OBTAIN_95 "O AFS Básico não conseguiu obter tokens como %2 na célula %1.\n\nErro: %4 (%3)" - IDS_UNCONFIG_TITLE_95 "Erro - AFS Básico" - IDS_UNCONFIG_DESC_95 "O AFS Básico não pode ser usado porque ainda não está configurado.\n\nPara configurar o AFS Básico, abra o Painel de Controle e dê um clique duplo no ícone de Configuração do AFS Básico." - IDS_NEWSUB_TITLE_95 "Atenção - AFS Básico" - IDS_BADSUB_TITLE_95 "Erro - AFS Básico" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "afscreds.ico" +IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" +IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" +IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_MAIN DIALOG DISCARDABLE 0, 0, 361, 130 +STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS Client" +CLASS "AfsCreds" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "AFS Versão %s (correção %lu)",IDC_TITLE_VERSION,244,8, + 111,8 + LTEXT "Atualmente com logon no Windows Networking como ""%s""", + IDC_TITLE_NT,7,8,231,8 + CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,26,347,97 +END + +IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Célula: ",IDC_STATIC,7,9,24,8 + LTEXT "(nenhuma)",IDC_CREDS_CELL,51,9,193,8 + LTEXT "Tokens:",IDC_STATIC,7,26,27,8 + LTEXT "(nenhum)",IDC_CREDS_INFO,51,26,193,8 + CONTROL "&Mostrar um aviso antes que estes tokens vençam", + IDC_CREDS_REMIND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 51,43,193,10 + PUSHBUTTON "&Obter Novos Tokens...",IDC_CREDS_OBTAIN,51,63,88,14 + PUSHBUTTON "&Descartar Estes Tokens",IDC_CREDS_DESTROY,142,63,92,14 + PUSHBUTTON "Ajuda",9,237,63,45,14 +END + +IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Você não possui tokens em nenhuma célula do AFS.", + IDC_RUNNING,7,9,275,8 + LTEXT "O AFS Client não está configurado corretamente, ou o serviço do AFS Client não está em execução.\n\nUse a guia Avançado para iniciar o serviço do AFS Client.", + IDC_STOPPED,7,9,275,40 + PUSHBUTTON "Ajuda",9,237,63,45,14 + PUSHBUTTON "&Obter Novos Tokens...",IDC_CREDS_OBTAIN,51,63,88,14 +END + +IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "(consultando...)",IDC_SERVICE_STATUS,7,9,275,8 + PUSHBUTTON "&Iniciar Serviço",IDC_SERVICE_START,51,28,65,14 + PUSHBUTTON "&Parar Serviço",IDC_SERVICE_STOP,128,28,65,14 + PUSHBUTTON "&Configurar AFS Client",IDC_OPEN_CPL,205,28,78,14 + CONTROL "I&niciar o Serviço do AFS Client sempre que este computador for reiniciado", + IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, + 51,262,10 + CONTROL "&Sempre mostrar o ícone do AFS Client na barra de tarefas", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65, + 204,10 + PUSHBUTTON "Ajuda",9,237,63,45,14 +END + +IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 232, 127 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Obter Novos Tokens do AFS" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Para obter novos tokens do AFS, digite seu nome de usuário do AFS e a senha para sua conta do AFS. Você pode ter tokens em várias células do AFS simultaneamente.", + IDC_STATIC,7,7,218,24 + LTEXT "&Célula do AFS:",IDC_STATIC,16,42,49,8 + EDITTEXT IDC_NEWCREDS_CELL,78,40,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "&Nome do Usuário:",IDC_STATIC,16,60,60,8 + EDITTEXT IDC_NEWCREDS_USER,78,58,97,14,ES_AUTOHSCROLL + LTEXT "&Senha:",IDC_STATIC,15,78,34,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,78,76,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,69,106,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,122,106,50,14 + PUSHBUTTON "Ajuda",9,175,106,50,14 +END + +IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Obter Novos Tokens do AFS" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Para obter novos tokens do AFS, digite seu nome de usuário do AFS e a senha para sua conta do AFS. Você pode ter tokens em várias células do AFS simultaneamente.", + IDC_STATIC,7,29,218,24 + LTEXT "&Célula do AFS:",IDC_STATIC,17,70,51,8 + EDITTEXT IDC_NEWCREDS_CELL,78,68,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "&Nome do Usuário:",IDC_STATIC,17,88,59,8 + EDITTEXT IDC_NEWCREDS_USER,78,86,97,14,ES_AUTOHSCROLL + LTEXT "&Senha:",IDC_STATIC,16,106,34,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,78,104,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "Seus tokens na célula %1 estão prestes a vencer.", + IDC_NEWCREDS_TITLE,7,7,218,16 + DEFPUSHBUTTON "OK",IDOK,69,134,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,122,134,50,14 + PUSHBUTTON "Ajuda",9,175,134,50,14 +END + +IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Você escolheu mapear as seguintes letras de unidades para caminhos no AFS:", + IDC_TITLE,7,8,275,8 + PUSHBUTTON "&Incluir...",IDC_ADD,51,63,45,14 + PUSHBUTTON "Al&terar...",IDC_EDIT,99,63,45,14 + PUSHBUTTON "&Remover",IDC_REMOVE,147,63,45,14 + CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x1d3,51,21,231,37 + PUSHBUTTON "Ajuda",9,237,63,45,14 +END + +IDD_WIZARD DIALOGEX 0, 0, 272, 152 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "Assistente do AFS Client" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "A&vançar >",IDNEXT,162,131,50,14 + PUSHBUTTON "Cance&lar",IDCANCEL,215,131,50,14 + CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,112 + CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,91,7,174,112 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,125,258,1 + PUSHBUTTON "&Ajuda",9,59,131,50,14 + PUSHBUTTON "< Vol&tar",IDBACK,112,131,50,14 +END + +IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "O Serviço do AFS Client ainda não iniciou.",IDC_STATIC, + 0,0,173,8 + LTEXT "Para iniciar o Serviço do AFS Client, clique em Avançar.", + IDC_STATIC,0,72,173,18 + LTEXT "Enquanto o Serviço do AFS Client não estiver em execução, não será possível usar arquivos armazenados no AFS.", + IDC_STATIC,0,17,173,28 + LTEXT "Para deixar o Serviço do AFS Client parado, clique em Cancelar.", + IDC_STATIC,0,90,173,19 +END + +IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "O Serviço do AFS Client está agora em execução, mas você ainda não obteve nenhum token para usar o AFS.", + IDC_STATIC,0,0,173,26 + CONTROL "Não obter tokens para nenhuma célula",IDC_NOCREDS, + "Button",BS_AUTORADIOBUTTON,10,28,141,10 + CONTROL "Obter tokens na seguinte célula:",IDC_YESCREDS,"Button", + BS_AUTORADIOBUTTON,10,44,141,10 + LTEXT "&Célula do AFS:",IDC_STATIC,13,64,53,8 + EDITTEXT IDC_NEWCREDS_CELL,77,62,96,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "&Nome do Usuário:",IDC_STATIC,13,82,61,8 + EDITTEXT IDC_NEWCREDS_USER,77,80,96,14,ES_AUTOHSCROLL + LTEXT "&Senha:",IDC_STATIC,12,100,34,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,77,97,96,14,ES_PASSWORD | + ES_AUTOHSCROLL +END + +IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Aguarde; o Serviço do AFS Client está iniciando...", + IDC_START_TRY,0,33,173,8 + LTEXT "O Serviço do AFS Client não pôde ser iniciado.\n\nVerifique as definições da rede, e use o ícone do AFS no Painel de Controle para verificar a configuração do AFS Client neste computador.", + IDC_START_FAIL,0,25,173,41 +END + +IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Para acessar arquivos armazenados no AFS, é preciso mapear letras de unidades para caminhos no AFS.", + IDC_STATIC,0,0,173,16 + CONTROL "&Não mapear nenhuma letra de unidade ",IDC_NOMAP,"Button", + BS_AUTORADIOBUTTON,9,20,151,13 + CONTROL "&Mapear ao menos uma letra de unidade:",IDC_YESMAP, + "Button",BS_AUTORADIOBUTTON,9,35,156,12 + LTEXT "&Letra da Unidade:",IDC_STATIC,10,58,62,8 + COMBOBOX IDC_MAP_LETTER,77,56,48,125,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Caminho do AFS:",IDC_STATIC,10,76,58,8 + EDITTEXT IDC_MAP_PATH,77,74,96,14,ES_AUTOHSCROLL + LTEXT "D&escrição:",IDC_STATIC,10,94,38,8 + EDITTEXT IDC_MAP_DESC,77,92,60,14,ES_AUTOHSCROLL +END + +IDD_TERMINATE DIALOGEX 0, 0, 305, 117 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Client" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + PUSHBUTTON "&Remover Ícone",IDOK,176,96,63,14 + PUSHBUTTON "Cance&lar",IDCANCEL,248,96,50,14 + LTEXT "Você escolheu remover o ícone do AFS Client da barra de tarefas de seu computador. A menos que o ícone do AFS Client esteja na barra de tarefas, o AFS não poderá avisá-lo quando seus tokens do AFS estiverem vencendo.", + IDC_STATIC,7,7,291,25 + LTEXT "O Serviço do AFS Client está em execução. Se desejar, pode pará-lo agora.", + IDC_STATIC,7,41,291,8 + CONTROL "&Deixar o Serviço do AFS Client executando",IDC_LEAVE, + "Button",BS_AUTORADIOBUTTON,26,55,228,10 + CONTROL "&Parar o Serviço do AFS Client",IDC_STOP,"Button", + BS_AUTORADIOBUTTON,26,69,228,10 + CONTROL "&Mostrar o ícone quando o computador reiniciar", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,98, + 165,10 +END + +IDD_TERMINATE_SMALL DIALOGEX 0, 0, 306, 69 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Client" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + PUSHBUTTON "&Remover Ícone",IDOK,178,48,63,14 + PUSHBUTTON "Cance&lar",IDCANCEL,249,48,50,14 + LTEXT "Você escolheu remover o ícone do AFS Client da barra de tarefas de seu computador. A menos que o ícone do AFS Client esteja na barra de tarefas, o AFS não poderá avisá-lo quando seus tokens do AFS estiverem vencendo.", + -1,7,7,292,25 + CONTROL "&Mostrar o ícone quando o computador reiniciar", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49, + 166,10 +END + +IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 299, 69 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Básico" +FONT 9, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + PUSHBUTTON "&Remover Ícone",IDOK,175,47,63,14 + PUSHBUTTON "Cance&lar",IDCANCEL,242,47,50,14 + LTEXT "Você escolheu remover o ícone do AFS Básico da barra de tarefas de seu computador. A menos que o ícone do AFS Básico esteja na barra de tarefas, o AFS não poderá avisar quando seus tokens do AFS estiverem vencendo.", + -1,7,7,277,25 + CONTROL "&Mostrar o ícone quando o computador reiniciar", + IDC_STARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49, + 162,10 +END + +IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Uma ou mais letras de unidades que você escolheu não puderam ser mapeadas para os caminhos apropriados no AFS.\n\nPode ser preciso fechar aplicações que já estejam tentando usar caminhos no AFS.", + IDC_MAP_FAIL,1,26,173,53 + LTEXT "Aguarde; mapeando letras de unidades para caminhos no AFS...", + IDC_MAP_TRY,0,33,173,8 +END + +IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "O AFS Client está pronto para uso.",IDC_STATIC,0,0,173, + 8 + LTEXT "Para fechar este assistente, clique em Finalizar.", + IDC_STATIC,0,73,173,8 +END + +IDD_MAPPING DIALOG DISCARDABLE 0, 0, 275, 152 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Mapear Letra de Unidade" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "Você pode mapear letras de unidades em seu computador para caminhos no AFS.\n\nPor exemplo, se você mapear Q: como \\afs\\acme.com\\usr\\bob, os arquivos disponíveis no AFS como \\afs\\acme.com\\usr\\bob\\* estarão visíveis em Q:\\", + IDC_STATIC,7,7,261,34 + LTEXT "&Letra da Unidade:",IDC_STATIC,15,53,61,8 + COMBOBOX IDC_MAP_LETTER,82,51,56,162,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Caminho do AFS:",IDC_STATIC,15,70,64,8 + EDITTEXT IDC_MAP_PATH,82,68,178,13,ES_AUTOHSCROLL + LTEXT "D&escrição:",IDC_STATIC,15,88,38,8 + EDITTEXT IDC_MAP_DESC,82,86,60,13,ES_AUTOHSCROLL + CONTROL "&Restaurar este mapeamento sempre que eu efetuar logon", + IDC_MAP_PERSISTENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 66,105,199,10 + DEFPUSHBUTTON "OK",IDOK,112,131,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,165,131,50,14 + PUSHBUTTON "Ajuda",9,218,131,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 354 + TOPMARGIN, 8 + BOTTOMMARGIN, 123 + END + + IDD_TAB_CREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_NOCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_ADVANCED, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_NEWCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 120 + END + + IDD_NEWCREDS_EXPIRE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 148 + END + + IDD_TAB_MOUNT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_WIZARD, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 265 + TOPMARGIN, 7 + BOTTOMMARGIN, 145 + END + + IDD_TERMINATE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 298 + TOPMARGIN, 7 + BOTTOMMARGIN, 110 + END + + IDD_TERMINATE_SMALL, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 299 + TOPMARGIN, 7 + BOTTOMMARGIN, 62 + END + + IDD_MAPPING, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 268 + TOPMARGIN, 7 + BOTTOMMARGIN, 145 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_TRAYICON MENU DISCARDABLE +BEGIN + MENUITEM "&Mostrar Tokens...", M_ACTIVATE + MENUITEM "&Avisar Antes do Vencimento", M_REMIND, CHECKED + MENUITEM SEPARATOR + MENUITEM "&Remover Ícone", M_TERMINATE +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" +IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP "AFS Client" + IDS_TOOLTIP_95 "AFS Básico" + IDS_CREDENTIALS "Tokens" + IDS_UNKNOWN "(desconhecido)" + IDS_ADVANCED "Avançado" + IDS_CREDS "%1 (tokens vencem em %2)" + IDS_NO_CREDS "(você não possui tokens nesta célula)" + IDS_SERVICE_BROKEN "O Serviço do AFS Client não está corretamente instalado, ou você não possui autorização para consultar seu status." + IDS_SERVICE_RUNNING "O Serviço do AFS Client está sendo executado normalmente." + IDS_SERVICE_STOPPED "O Serviço do AFS Client está parado." + IDS_SERVICE_STOPPING "Aguarde; o Serviço do AFS Client está parando..." + IDS_SERVICE_STARTING "Aguarde; o Serviço do AFS Client está iniciando..." + IDS_SERVICE_UNKNOWN "O status do Serviço do AFS Client não pôde ser determinado." + IDS_SERVICE_FAIL_STOP "O Serviço do AFS Client não pôde ser parado com êxito. Você pode não ter autorização para realizar esta operação.\n\nErro 0x%1." + IDS_SERVICE_FAIL_START "O Serviço do AFS Client não pôde ser iniciado com êxito. Você pode não ter autorização para realizar esta operação.\n\nErro 0x%1." + IDS_SERVICE_FAIL_CONFIG "Os parâmetros de inicialização do Serviço do AFS Client não puderam ser alterados. Você pode não ter autorização para realizar esta operação.\n\nErro 0x%1." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_ERROR "Erro ao Configurar Serviço" + IDS_ERROR_TITLE "Erro - AFS Client" + IDS_ERROR_TITLE_95 "Erro - AFS Básico" + IDS_ERROR_DESTROY_95 "Seus tokens na célula %1 não puderam ser eliminados.\n\nErro: %2" + IDS_ERROR_DESTROY_NOCM "Seus tokens na célula %1 não puderam ser eliminados porque o Serviço do AFS Client não está respondendo.\n\nVerifique a guia Avançado para ver se o AFS Client está executando corretamente.\n\nErro: %2" + IDS_ERROR_DESTROY_UNKNOWN + "Seus tokens na célula %1 não puderam ser eliminados.\n\nVerifique a guia Avançado para ver se o AFS Client está sendo executado corretamente.\n\nErro: %2" + IDS_ERROR_OBTAIN "O AFS Client não conseguiu obter tokens como %2 na célula %1.\n\nErro: %4 (%3)" + IDS_ERROR_OBTAIN_95 "O AFS Básico não conseguiu obter tokens como %2 na célula %1.\n\nErro: %4 (%3)" + IDS_TITLE_VERSION "AFS Versão %s" + IDS_TITLE_VERSION_NOPATCH "AFS Versão %s" + IDS_MOUNT_SOME "Você escolheu mapear as seguintes letras de unidades para caminhos no AFS:" + IDS_MOUNT_NONE "Você ainda não escolheu mapear nenhuma letra de unidade para caminhos no AFS." + IDS_MOUNT "Letras de Unidades" + IDS_WIZ_NEXT "A&vançar >" + IDS_WIZ_FINISH "&Finalizar" + IDS_MAP_LETTER "Unidade *:" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DRIVE_MAP "Unidade %1: \t%2" + IDS_ERROR_MAP "Erro Mapeando Unidade de Rede" + IDS_ERROR_MAP_DESC "O AFS foi incapaz de mapear a unidade de rede para o caminho especificado no AFS. Certifique-se de que a letra da unidade não esteja sendo utilizada.\n\nErro: 0x%1." + IDS_ERROR_UNMAP "Erro Mapeando Unidade de Rede" + IDS_ERROR_UNMAP_DESC "O AFS foi incapaz de remover o mapeamento da unidade de rede especificada. Certifique-se de que a letra da unidade não esteja sendo utilizada.\n\nErro: 0x%1." + IDS_CELL_GATEWAY "%s (via gateway %s)" + IDS_BADMAP_TITLE "Erro Mapeando Unidade de Rede" + IDS_BADMAP_DESC "O AFS não pode mapear uma letra de unidade para o caminho especificado porque o caminho não começa com ""\\afs"".\n\nDigite um caminho que comece com ""\\afs"", e tente novamente." + IDS_UNCONFIG_TITLE_95 "Erro - AFS Básico" + IDS_UNCONFIG_DESC_95 "O AFS Básico não pode ser usado porque ainda não está configurado.\n\nPara configurar o AFS Básico, abra o Painel de Controle e dê um clique duplo no ícone de Configuração do AFS Básico." + IDS_UNCONFIG_TITLE "Erro - AFS Client" + IDS_UNCONFIG_DESC "O AFS Client não pode ser usado porque ainda não está configurado.\n\nPara configurar o AFS Client, abra o Painel de Controle e dê um clique duplo no ícone de Configuração de AFS Client." + IDS_NEWSUB_TITLE "Atenção - AFS Client" + IDS_NEWSUB_TITLE_95 "Atenção - AFS Básico" + IDS_NEWSUB_DESC "O AFS não pôde usar a descrição especificada ao conectar-se à unidade de rede.\n\nA descrição especificada já é usada por um outro caminho do AFS." + IDS_BADSUB_TITLE "Erro - AFS Client" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADSUB_TITLE_95 "Erro - AFS Básico" + IDS_BADSUB_DESC "A descrição da letra de unidade informada não pode ser usada.\n\nUma descrição de letra de unidade não pode ter mais de 12 caracteres, e não pode conter espaços ou tabulações." + IDS_TITLE_95 "AFS Básico" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/client_creds/lang/zh_CN/afscreds.rc b/src/WINNT/client_creds/lang/zh_CN/afscreds.rc index 993fd25b3..c88bf0c5c 100644 --- a/src/WINNT/client_creds/lang/zh_CN/afscreds.rc +++ b/src/WINNT/client_creds/lang/zh_CN/afscreds.rc @@ -7,25 +7,25 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Chinese (P.R.C.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) -#ifdef _WIN32 -LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED -#endif //_WIN32 +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Chinese (P.R.C.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +#ifdef _WIN32 +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Version @@ -39,532 +39,532 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED #define AFS_VERINFO_CHARSET 936 #include "AFS_component_version_number.h" #include "..\..\config\NTVersioninfo.rc" - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "afscreds.ico" -IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" -IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" -IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_MAIN DIALOG DISCARDABLE 0, 0, 307, 131 -STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS ¿Í»§»ú" -CLASS "AfsCreds" -FONT 9, "ËÎÌå" -BEGIN - RTEXT "AFS °æ±¾ %s(²¹¶¡³ÌÐò %lu)",IDC_TITLE_VERSION,198,8,102, - 8 - LTEXT "µ±Ç°×÷Ϊ ""%s"" ×¢²áµ½ Windows ÍøÂç",IDC_TITLE_NT,7,8, - 185,8 - CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,27,293,97 -END - -IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - LTEXT "µ¥Ôª£º",IDC_STATIC,7,9,24,8 - LTEXT "(ÎÞ)",IDC_CREDS_CELL,51,9,193,8 - LTEXT "ÁîÅÆ£º",IDC_STATIC,7,26,27,8 - LTEXT "(ÎÞ)",IDC_CREDS_INFO,51,26,193,8 - CONTROL "ÁîÅÆµ½ÆÚǰÏÔʾ¾¯¸æ(&S)",IDC_CREDS_REMIND,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,51,43,193,10 - PUSHBUTTON "»ñµÃÐÂÁîÅÆ(&O)...",IDC_CREDS_OBTAIN,51,63,88,14 - PUSHBUTTON "¶ªÆúÕâЩÁîÅÆ(&D)",IDC_CREDS_DESTROY,142,63,92,14 - PUSHBUTTON "°ïÖú",9,237,63,45,14 -END - -IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - LTEXT "ÄúÔÚËùÓÐ AFS µ¥ÔªÄÚ¾ùÎÞÁîÅÆ¡£",IDC_RUNNING,7,9,275,8 - LTEXT "ûÓÐÕýÈ·µØÅäÖà AFS ¿Í»§»ú£¬»òûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ¡£\n\nÇëʹÓ᰸߼¶¡±±êÇ©ÒÔÆô¶¯ AFS ¿Í»§»ú·þÎñ¡£", - IDC_STOPPED,7,9,275,25 - PUSHBUTTON "°ïÖú",9,237,63,45,14 - PUSHBUTTON "»ñµÃÐÂÁîÅÆ(&O)...",IDC_CREDS_OBTAIN,51,63,88,14 -END - -IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - LTEXT "(ÕýÔÚ²éѯ...)",IDC_SERVICE_STATUS,7,9,275,8 - PUSHBUTTON "Æô¶¯·þÎñ(&S)",IDC_SERVICE_START,51,28,63,14 - PUSHBUTTON "Í£Ö¹·þÎñ(&T)",IDC_SERVICE_STOP,118,28,63,14 - PUSHBUTTON "ÅäÖà AFS ¿Í»§»ú(&C)",IDC_OPEN_CPL,185,28,97,14 - CONTROL "ÿµ±¼ÆËã»úÖØÐÂÆô¶¯Ê±Æô¶¯ AFS ¿Í»§»ú·þÎñ(&A)", - IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, - 51,204,10 - CONTROL "×ÜÊÇÔÚÈÎÎñÀ¸ÖÐÏÔʾ AFS ¿Í»§»úͼ±ê(&I)",IDC_STARTUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65,204,10 - PUSHBUTTON "°ïÖú",9,237,63,45,14 -END - -IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 232, 127 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "»ñµÃÐ嵀 AFS ÁîÅÆ" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "Òª»ñµÃÐ嵀 AFS ÁîÅÆ£¬ÇëÊäÈëÄúµÄ AFS ÕÊ»§µÄÓû§ÃûºÍ¿ÚÁî¡£Äú¿ÉͬʱÔÚ¶à¸ö AFS µ¥ÔªÖÐÓµÓÐÁîÅÆ¡£", - IDC_STATIC,7,7,218,24 - LTEXT "AFS µ¥Ôª(&C)£º",IDC_STATIC,7,42,53,8 - EDITTEXT IDC_NEWCREDS_CELL,67,40,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "Óû§Ãû(&N)£º",IDC_STATIC,7,60,53,8 - EDITTEXT IDC_NEWCREDS_USER,67,58,97,14,ES_AUTOHSCROLL - LTEXT "¿ÚÁî(&P)£º",IDC_STATIC,7,78,53,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,67,76,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "È·¶¨",IDOK,69,106,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,122,106,50,14 - PUSHBUTTON "°ïÖú",9,175,106,50,14 -END - -IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "»ñµÃÐ嵀 AFS ÁîÅÆ" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "Òª»ñµÃÐ嵀 AFS ÁîÅÆ£¬ÇëÊäÈëÄúµÄ AFS ÕÊ»§µÄÓû§ÃûºÍ¿ÚÁî¡£Äú¿ÉͬʱÔÚ¶à¸ö AFS µ¥ÔªÖÐÓµÓÐÁîÅÆ¡£", - IDC_STATIC,7,29,218,24 - LTEXT "AFS µ¥Ôª(&C)£º",IDC_STATIC,7,70,55,8 - EDITTEXT IDC_NEWCREDS_CELL,67,68,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "Óû§Ãû(&N)£º",IDC_STATIC,7,88,55,8 - EDITTEXT IDC_NEWCREDS_USER,67,86,97,14,ES_AUTOHSCROLL - LTEXT "¿ÚÁî(&P)£º",IDC_STATIC,7,106,55,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,67,104,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "ÄúÔÚ %1 µ¥ÔªÄÚµÄÁîÅÆ½«Òªµ½ÆÚ¡£",IDC_NEWCREDS_TITLE,7,7, - 218,16 - DEFPUSHBUTTON "È·¶¨",IDOK,69,134,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,122,134,50,14 - PUSHBUTTON "°ïÖú",9,175,134,50,14 -END - -IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - LTEXT "ÄúÒÑÑ¡Ôñ½«ÏÂÁÐÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶£º",IDC_TITLE,7,8, - 275,8 - PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,51,63,45,14 - PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,99,63,45,14 - PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,147,63,45,14 - CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x1d3,51,21,231,37 - PUSHBUTTON "°ïÖú",9,237,63,45,14 -END - -IDD_WIZARD DIALOGEX 0, 0, 272, 152 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS ¿Í»§»úÏòµ¼" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "ÏÂÒ»²½(&N) >",IDNEXT,162,131,50,14 - PUSHBUTTON "È¡Ïû(&L)",IDCANCEL,215,131,50,14 - CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,112 - CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,91,7,174,112 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,125,258,1 - PUSHBUTTON "°ïÖú(&H)",9,59,131,50,14 - PUSHBUTTON "< ÉÏÒ»²½(&B)",IDBACK,112,131,50,14 -END - -IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - LTEXT "»¹Ã»ÓÐÆô¶¯ AFS ¿Í»§»ú·þÎñ¡£",IDC_STATIC,0,0,173,8 - LTEXT "ÒªÆô¶¯ AFS ¿Í»§»ú·þÎñ£¬Çëµ¥»÷¡°ÏÂÒ»²½¡±¡£",IDC_STATIC,0, - 73,173,8 - LTEXT "Äú½«ÎÞ·¨Ê¹Óô洢ÔÚ AFS ÖеÄÎļþ£¬Ö±ÖÁÔËÐÐ AFS ¿Í»§»ú·þÎñ¡£", - IDC_STATIC,0,17,173,17 - LTEXT "Ҫʹ AFS ¿Í»§»ú·þÎñ±£³Öֹͣ״̬£¬Çëµ¥»÷¡°È¡Ïû¡±¡£", - IDC_STATIC,0,88,173,19 -END - -IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - LTEXT "AFS ¿Í»§»ú·þÎñÏÖÔÚÕýÔÚÔËÐУ¬µ«ÊÇÄúÉÐδ»ñµÃÈκοÉʹÓà AFS µÄÁîÅÆ¡£", - IDC_STATIC,0,0,173,16 - CONTROL "²»»ñµÃÈκε¥ÔªµÄÁîÅÆ",IDC_NOCREDS,"Button", - BS_AUTORADIOBUTTON,10,28,141,10 - CONTROL "»ñµÃÏÂÁе¥ÔªÖеÄÁîÅÆ£º",IDC_YESCREDS,"Button", - BS_AUTORADIOBUTTON,10,44,141,10 - LTEXT "AFS µ¥Ôª(&C)£º",IDC_STATIC,11,64,53,8 - EDITTEXT IDC_NEWCREDS_CELL,77,62,96,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "Óû§Ãû(&N)£º",IDC_STATIC,11,82,53,8 - EDITTEXT IDC_NEWCREDS_USER,77,80,96,14,ES_AUTOHSCROLL - LTEXT "¿ÚÁî(&P)£º",IDC_STATIC,11,100,53,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,77,97,96,14,ES_PASSWORD | - ES_AUTOHSCROLL -END - -IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - LTEXT "ÇëÉÔºò£»ÕýÔÚÆô¶¯ AFS ¿Í»§»ú·þÎñ...",IDC_START_TRY,0,33, - 173,8 - LTEXT "ÎÞ·¨Æô¶¯ AFS ¿Í»§»ú·þÎñ¡£\n\nÇë¼ì²éÄúµÄÍøÂçÉèÖ㬲¢Ê¹ÓÿØÖÆÃæ°åÖÐµÄ AFS ͼ±ê¼ì²é¸Ã¼ÆËã»úÉ쵀 AFS ¿Í»§»úµÄÅäÖá£", - IDC_START_FAIL,0,25,173,41 -END - -IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - LTEXT "Òª´æÈ¡´æ´¢ÔÚ AFS ÖеÄÎļþ£¬Äú±ØÐ뽫ÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶¡£", - IDC_STATIC,0,0,173,16 - CONTROL "²»Òª½«ÈκÎÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶(&D)",IDC_NOMAP,"Button", - BS_AUTORADIOBUTTON,2,23,168,10 - CONTROL "ÖÁÉÙ½«Ò»¸öÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶(&M)£º",IDC_YESMAP, - "Button",BS_AUTORADIOBUTTON,2,40,168,10 - LTEXT "ÅÌ·û(&L)£º",IDC_STATIC,9,58,58,8 - COMBOBOX IDC_MAP_LETTER,77,56,60,125,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,9,76,58,8 - EDITTEXT IDC_MAP_PATH,77,74,96,14,ES_AUTOHSCROLL - LTEXT "ÃèÊö(&E)£º",IDC_STATIC,9,94,58,8 - EDITTEXT IDC_MAP_DESC,77,92,60,14,ES_AUTOHSCROLL -END - -IDD_TERMINATE DIALOGEX 0, 0, 291, 117 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS ¿Í»§»ú" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - PUSHBUTTON "³ýȥͼ±ê(&R)",IDOK,167,96,63,14 - PUSHBUTTON "È¡Ïû(&L)",IDCANCEL,234,96,50,14 - LTEXT "ÄúÒÑÑ¡Ôñ´Ó¼ÆËã»úµÄÈÎÎñÀ¸ÖгýÈ¥¡°AFS ¿Í»§»ú¡±Í¼±ê¡£³ý·Ç¡°AFS ¿Í»§»ú¡±Í¼±êÔÚ¼ÆËã»úµÄÈÎÎñÀ¸ÖУ¬·ñÔòµ±ÄúµÄ AFS ÁîÅÆ½«Òªµ½ÆÚʱ£¬AFS ½«ÎÞ·¨·¢³ö¾¯¸æ¡£", - IDC_STATIC,7,7,277,25 - LTEXT "µ±Ç°ÕýÔÚÔËÐÐ AFS ¿Í»§»ú·þÎñ¡£Èç¹ûÐèÒª£¬Äú¿ÉÔÚ´ËʱֹͣÔËÐС£", - IDC_STATIC,7,41,277,8 - CONTROL "±£³Ö AFS ¿Í»§»ú·þÎñΪÔËÐÐ״̬(&U)",IDC_LEAVE,"Button", - BS_AUTORADIOBUTTON,26,55,228,10 - CONTROL "Í£Ö¹ AFS ¿Í»§»ú·þÎñ(&S)",IDC_STOP,"Button", - BS_AUTORADIOBUTTON,26,69,228,10 - CONTROL "µ±¼ÆËã»úÖØÐÂÆô¶¯Ê±ÏÔʾͼ±ê(&H)",IDC_STARTUP,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,98,148,10 -END - -IDD_TERMINATE_SMALL DIALOGEX 0, 0, 291, 68 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS ¿Í»§»ú" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - PUSHBUTTON "³ýȥͼ±ê(&R)",IDOK,167,47,63,14 - PUSHBUTTON "È¡Ïû(&L)",IDCANCEL,234,47,50,14 - LTEXT "ÄúÒÑÑ¡Ôñ´Ó¼ÆËã»úµÄÈÎÎñÀ¸ÖгýÈ¥¡°AFS ¿Í»§»ú¡±Í¼±ê¡£³ý·Ç¡°AFS ¿Í»§»ú¡±Í¼±êÔÚ¼ÆËã»úµÄÈÎÎñÀ¸ÖУ¬·ñÔòµ±ÄúµÄ AFS ÁîÅÆ½«Òªµ½ÆÚʱ£¬AFS ½«ÎÞ·¨·¢³ö¾¯¸æ¡£", - -1,7,7,277,25 - CONTROL "µ±¼ÆËã»úÖØÐÂÆô¶¯Ê±ÏÔʾͼ±ê(&H)",IDC_STARTUP,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,49,148,10 -END - -IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 291, 68 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Light" -FONT 9, "ËÎÌå", 0, 0, 0x1 -BEGIN - PUSHBUTTON "³ýȥͼ±ê(&R)",IDOK,167,47,63,14 - PUSHBUTTON "È¡Ïû(&L)",IDCANCEL,234,47,50,14 - LTEXT "ÄúÒÑÑ¡Ôñ´Ó¼ÆËã»úµÄÈÎÎñÀ¸ÖгýÈ¥¡°AFS Light¡±Í¼±ê¡£³ý·Ç¡°AFS Light¡±Í¼±êÔÚ¼ÆËã»úµÄÈÎÎñÀ¸ÖУ¬·ñÔòµ±ÄúµÄ AFS ÁîÅÆ½«Òªµ½ÆÚʱ£¬AFS ½«ÎÞ·¨·¢³ö¾¯¸æ¡£", - -1,7,7,277,25 - CONTROL "µ±¼ÆËã»úÖØÐÂÆô¶¯Ê±ÏÔʾͼ±ê(&H)",IDC_STARTUP,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,49,148,10 -END - -IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - LTEXT "ÄúËùÑ¡µÄÒ»¸ö»ò¶à¸öÅÌ·ûÎÞ·¨Ó³Éäµ½ÕýÈ·µÄ AFS ÖеÄ·¾¶¡£\n\nÄú¿ÉÄÜÒª¹Ø±ÕËùÓÐÊÔͼʹÓøÃ·¾¶µÄÓ¦ÓóÌÐò¡£", - IDC_MAP_FAIL,1,26,173,41 - LTEXT "ÇëÉÔºò£»ÕýÔÚ½«ÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶...",IDC_MAP_TRY,0, - 33,173,8 -END - -IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 174, 112 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "ËÎÌå" -BEGIN - LTEXT "AFS ¿Í»§»ú¾ÍÐ÷¡£",IDC_STATIC,0,0,173,8 - LTEXT "Òª¹Ø±Õ¸ÃÏòµ¼£¬Çëµ¥»÷¡°Íê³É¡±¡£",IDC_STATIC,0,73,173,8 -END - -IDD_MAPPING DIALOG DISCARDABLE 0, 0, 275, 152 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ó³ÉäÅÌ·û" -FONT 9, "ËÎÌå" -BEGIN - LTEXT "Äú¿É½«¼ÆËã»úÉϵÄÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶¡£\n\nÀýÈ磬Èç¹ûÄú½« Q: Ó³Éäµ½ \\afs\\acme.com\\usr\\bob£¬ÔòÔÚ Q:\\ Öн«¿É¿´¼ûÔÚ AFS ÖпÉÓõÄÎļþ \\afs\\acme.com\\usr\\bob\\* ¡£", - IDC_STATIC,7,7,261,32 - LTEXT "ÅÌ·û(&L)£º",IDC_STATIC,13,53,55,8 - COMBOBOX IDC_MAP_LETTER,73,51,60,162,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,13,70,55,8 - EDITTEXT IDC_MAP_PATH,73,68,178,13,ES_AUTOHSCROLL - LTEXT "ÃèÊö(&E)£º",IDC_STATIC,13,88,55,8 - EDITTEXT IDC_MAP_DESC,73,86,60,13,ES_AUTOHSCROLL - CONTROL "µÇ¼ʱ»Ö¸´Ó³Éä(&R)",IDC_MAP_PERSISTENT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,73,105,185,10 - DEFPUSHBUTTON "È·¶¨",IDOK,112,131,50,14 - PUSHBUTTON "È¡Ïû",IDCANCEL,165,131,50,14 - PUSHBUTTON "°ïÖú",9,218,131,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 300 - TOPMARGIN, 8 - BOTTOMMARGIN, 124 - END - - IDD_TAB_CREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_NOCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_ADVANCED, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_NEWCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 120 - END - - IDD_NEWCREDS_EXPIRE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 148 - END - - IDD_TAB_MOUNT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_WIZARD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 265 - TOPMARGIN, 7 - BOTTOMMARGIN, 145 - END - - IDD_TERMINATE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 284 - TOPMARGIN, 7 - BOTTOMMARGIN, 110 - END - - IDD_TERMINATE_SMALL, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 284 - TOPMARGIN, 7 - BOTTOMMARGIN, 61 - END - - IDD_MAPPING, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 268 - TOPMARGIN, 7 - BOTTOMMARGIN, 145 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_TRAYICON MENU DISCARDABLE -BEGIN - MENUITEM "ÏÔʾÁîÅÆ(&S)...", M_ACTIVATE - MENUITEM "µ½ÆÚǰ¾¯¸æ(&W)", M_REMIND, CHECKED - MENUITEM SEPARATOR - MENUITEM "³ýȥͼ±ê(&R)", M_TERMINATE -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" -IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_TOOLTIP "AFS ¿Í»§»ú" - IDS_CREDENTIALS "ÁîÅÆ" - IDS_UNKNOWN "(δ֪)" - IDS_ADVANCED "¸ß¼¶" - IDS_CREDS "%1 (ÁîÅÆµ½ÆÚ %2)" - IDS_NO_CREDS "(Ôڸõ¥ÔªÖÐÄúûÓÐÁîÅÆ)" - IDS_SERVICE_BROKEN "ûÓÐÕýÈ·µØ°²×° AFS ¿Í»§»ú·þÎñ£¬»òÕßÄúûÓвéѯ״̬µÄȨÏÞ¡£" - IDS_SERVICE_RUNNING "AFS ¿Í»§»ú·þÎñÕýÔÚÕý³£ÔËÐС£" - IDS_SERVICE_STOPPED "AFS ¿Í»§»ú·þÎñµ±Ç°ÎªÍ£Ö¹×´Ì¬¡£" - IDS_SERVICE_STOPPING "ÇëÉÔºò£»AFS ¿Í»§»ú·þÎñÕýÔÚÍ£Ö¹..." - IDS_SERVICE_STARTING "ÇëÉÔºò£»AFS ¿Í»§»ú·þÎñÕýÔÚÆô¶¯..." - IDS_SERVICE_UNKNOWN "ÎÞ·¨È·¶¨ AFS ¿Í»§»ú·þÎñµÄ״̬¡£" - IDS_SERVICE_FAIL_STOP "AFS ¿Í»§»ú·þÎñ²»Äܳɹ¦Í£Ö¹¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_MAP "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í" - IDS_ERROR_MAP_DESC "AFS ÎÞ·¨Ó³ÉäÍøÂçÇý¶¯Æ÷ÖÁ AFS ÖеÄ·¾¶¡£¼ì²éÒÔÈ·±£ÅÌ·ûµ±Ç°Ã»ÓÐʹÓá£\n\n´íÎó£º0x%1¡£" - IDS_ERROR_UNMAP "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í" - IDS_ERROR_UNMAP_DESC "AFS ÎÞ·¨¶Ï¿ªÓëÖ¸¶¨ÍøÂçÇý¶¯Æ÷µÄÓ³Éä¡£¼ì²éÒÔÈ·±£ÅÌ·ûµ±Ç°Ã»ÓÐʹÓá£\n\n´íÎó£º0x%1¡£" - IDS_CELL_GATEWAY "%s (ͨ¹ýÍø¹Ø %s)" - IDS_BADMAP_TITLE "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í" - IDS_BADMAP_DESC "ÓÉÓÚ·¾¶Ã»ÓÐÒÔ""\\afs""¿ªÊ¼£¬AFS ²»ÄÜÓ³ÉäÅÌ·ûÖÁÖ¸¶¨µÄ·¾¶¡£\n\nÈ·±£ÄúËùÊäÈëµÄ·¾¶ÊÇÒÔ""\\afs""¿ªÊ¼µÄ£¬²¢ÖØÊÔÒ»´Î¡£" - IDS_UNCONFIG_TITLE "³ö´í - AFS ¿Í»§»ú" - IDS_UNCONFIG_DESC "ÒòΪÉÐδÅäÖà AFS ¿Í»§»ú£¬ËùÒÔÎÞ·¨Ê¹ÓÃËü¡£\n\nÒªÅäÖà AFS ¿Í»§»ú£¬Çë´ò¿ª¿ØÖÆÃæ°å²¢Ë«»÷¡°AFS ¿Í»§»ú¡±Í¼±ê¡£" - IDS_NEWSUB_TITLE "×¢Òâ - AFS ¿Í»§»ú" - IDS_NEWSUB_DESC "µ±Á¬½ÓÍøÂçÇý¶¯Æ÷ʱ£¬AFS ÎÞ·¨Ê¹ÓÃÖ¸¶¨µÄÃèÊö¡£\n\nÖ¸¶¨µÄÃèÊöÒÑʹÓÃÔÚ²»Í¬µÄ AFS ·¾¶ÖС£" - IDS_BADSUB_TITLE "³ö´í - AFS ¿Í»§»ú" - IDS_BADSUB_DESC "²»ÄÜʹÓÃÄúÊäÈëµÄÅÌ·ûÃèÊö¡£\n\nÅÌ·ûÃèÊö²»Äܳ¬¹ý 12 ¸ö×Ö·û£¬²¢ÇÒ²»Äܰüº¬¿Õ¸ñ»òÖÆ±í·û¡£" - IDS_TITLE_95 "AFS Light" - IDS_TOOLTIP_95 "AFS Light" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_FAIL_START "AFS ¿Í»§»ú·þÎñ²»Äܳɹ¦Æô¶¯¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£" - IDS_SERVICE_FAIL_CONFIG "ÎÞ·¨¸ü¸Ä AFS ¿Í»§»ú·þÎñµÄÆô¶¯²ÎÊý¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£" - IDS_SERVICE_ERROR "ÅäÖ÷þÎñ³ö´í" - IDS_ERROR_TITLE "³ö´í - AFS ¿Í»§»ú" - IDS_ERROR_DESTROY_NOCM "ÎÞ·¨ÆÆ»µÄúÔÚ %1 µ¥ÔªÖеÄÁîÅÆ£¬ÒòΪ AFS ¿Í»§»ú·þÎñûÓÐÏìÓ¦¡£\n\nÇë¼ì²é¡°¸ß¼¶¡±±êÇ©ÒԲ鿴 AFS ¿Í»§»úÊÇ·ñÕýÈ·ÔËÐС£\n\n´íÎó£º%2" - IDS_ERROR_DESTROY_UNKNOWN - "ÎÞ·¨ÆÆ»µÄúÔÚ %1 µ¥ÔªÖеÄÁîÅÆ¡£\n\nÇë¼ì²é¡°¸ß¼¶¡±±êÇ©ÒԲ鿴 AFS ¿Í»§»úÊÇ·ñÕýÈ·ÔËÐС£\n\n´íÎó£º%2" - IDS_ERROR_OBTAIN "AFS ¿Í»§»úÎÞ·¨ÔÚ µ¥Ôª %1 ÖлñµÃÁîÅÆ %2 ¡£\n\n´íÎó£º%4 (%3)" - IDS_TITLE_VERSION "AFS °æ±¾ %s" - IDS_TITLE_VERSION_NOPATCH "AFS °æ±¾ %s" - IDS_MOUNT_SOME "ÄúÒÑÑ¡Ôñ½«ÏÂÁÐÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶£º" - IDS_MOUNT_NONE "ÄúÉÐδѡÔñ½«ÈκÎÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶¡£" - IDS_MOUNT "ÅÌ·û" - IDS_WIZ_NEXT "ÏÂÒ»²½(&N) >" - IDS_WIZ_FINISH "Íê³É(&F)" - IDS_MAP_LETTER "Çý¶¯Æ÷ *:" - IDS_DRIVE_MAP "Çý¶¯Æ÷ %1: \t%2" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_TITLE_95 "³ö´í - AFS Light" - IDS_ERROR_DESTROY_95 "ÎÞ·¨ÆÆ»µÄúÔÚ %1 µ¥ÔªÖеÄÁîÅÆ¡£\n\n´íÎó£º%2" - IDS_ERROR_OBTAIN_95 "AFS Light ÎÞ·¨ÔÚ µ¥Ôª %1 ÖлñµÃÁîÅÆ %2 ¡£\n\n´íÎó£º%4 (%3)" - IDS_UNCONFIG_TITLE_95 "³ö´í - AFS Light" - IDS_UNCONFIG_DESC_95 "ÒòΪÉÐδÅäÖà AFS Light£¬ËùÒÔÎÞ·¨Ê¹ÓÃËü¡£\n\nÒªÅäÖà AFS Light£¬Çë´ò¿ª¿ØÖÆÃæ°å²¢Ë«»÷¡°AFS Light¡±Í¼±ê¡£" - IDS_NEWSUB_TITLE_95 "×¢Òâ - AFS Light" - IDS_BADSUB_TITLE_95 "³ö´í - AFS Light" -END - -#endif // Chinese (P.R.C.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "afscreds.ico" +IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" +IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" +IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_MAIN DIALOG DISCARDABLE 0, 0, 307, 131 +STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS ¿Í»§»ú" +CLASS "AfsCreds" +FONT 9, "ËÎÌå" +BEGIN + RTEXT "AFS °æ±¾ %s(²¹¶¡³ÌÐò %lu)",IDC_TITLE_VERSION,198,8,102, + 8 + LTEXT "µ±Ç°×÷Ϊ ""%s"" ×¢²áµ½ Windows ÍøÂç",IDC_TITLE_NT,7,8, + 185,8 + CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,27,293,97 +END + +IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + LTEXT "µ¥Ôª£º",IDC_STATIC,7,9,24,8 + LTEXT "(ÎÞ)",IDC_CREDS_CELL,51,9,193,8 + LTEXT "ÁîÅÆ£º",IDC_STATIC,7,26,27,8 + LTEXT "(ÎÞ)",IDC_CREDS_INFO,51,26,193,8 + CONTROL "ÁîÅÆµ½ÆÚǰÏÔʾ¾¯¸æ(&S)",IDC_CREDS_REMIND,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,51,43,193,10 + PUSHBUTTON "»ñµÃÐÂÁîÅÆ(&O)...",IDC_CREDS_OBTAIN,51,63,88,14 + PUSHBUTTON "¶ªÆúÕâЩÁîÅÆ(&D)",IDC_CREDS_DESTROY,142,63,92,14 + PUSHBUTTON "°ïÖú",9,237,63,45,14 +END + +IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + LTEXT "ÄúÔÚËùÓÐ AFS µ¥ÔªÄÚ¾ùÎÞÁîÅÆ¡£",IDC_RUNNING,7,9,275,8 + LTEXT "ûÓÐÕýÈ·µØÅäÖà AFS ¿Í»§»ú£¬»òûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ¡£\n\nÇëʹÓ᰸߼¶¡±±êÇ©ÒÔÆô¶¯ AFS ¿Í»§»ú·þÎñ¡£", + IDC_STOPPED,7,9,275,25 + PUSHBUTTON "°ïÖú",9,237,63,45,14 + PUSHBUTTON "»ñµÃÐÂÁîÅÆ(&O)...",IDC_CREDS_OBTAIN,51,63,88,14 +END + +IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + LTEXT "(ÕýÔÚ²éѯ...)",IDC_SERVICE_STATUS,7,9,275,8 + PUSHBUTTON "Æô¶¯·þÎñ(&S)",IDC_SERVICE_START,51,28,63,14 + PUSHBUTTON "Í£Ö¹·þÎñ(&T)",IDC_SERVICE_STOP,118,28,63,14 + PUSHBUTTON "ÅäÖà AFS ¿Í»§»ú(&C)",IDC_OPEN_CPL,185,28,97,14 + CONTROL "ÿµ±¼ÆËã»úÖØÐÂÆô¶¯Ê±Æô¶¯ AFS ¿Í»§»ú·þÎñ(&A)", + IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, + 51,204,10 + CONTROL "×ÜÊÇÔÚÈÎÎñÀ¸ÖÐÏÔʾ AFS ¿Í»§»úͼ±ê(&I)",IDC_STARTUP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65,204,10 + PUSHBUTTON "°ïÖú",9,237,63,45,14 +END + +IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 232, 127 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "»ñµÃÐ嵀 AFS ÁîÅÆ" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "Òª»ñµÃÐ嵀 AFS ÁîÅÆ£¬ÇëÊäÈëÄúµÄ AFS ÕÊ»§µÄÓû§ÃûºÍ¿ÚÁî¡£Äú¿ÉͬʱÔÚ¶à¸ö AFS µ¥ÔªÖÐÓµÓÐÁîÅÆ¡£", + IDC_STATIC,7,7,218,24 + LTEXT "AFS µ¥Ôª(&C)£º",IDC_STATIC,7,42,53,8 + EDITTEXT IDC_NEWCREDS_CELL,67,40,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "Óû§Ãû(&N)£º",IDC_STATIC,7,60,53,8 + EDITTEXT IDC_NEWCREDS_USER,67,58,97,14,ES_AUTOHSCROLL + LTEXT "¿ÚÁî(&P)£º",IDC_STATIC,7,78,53,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,67,76,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "È·¶¨",IDOK,69,106,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,122,106,50,14 + PUSHBUTTON "°ïÖú",9,175,106,50,14 +END + +IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "»ñµÃÐ嵀 AFS ÁîÅÆ" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "Òª»ñµÃÐ嵀 AFS ÁîÅÆ£¬ÇëÊäÈëÄúµÄ AFS ÕÊ»§µÄÓû§ÃûºÍ¿ÚÁî¡£Äú¿ÉͬʱÔÚ¶à¸ö AFS µ¥ÔªÖÐÓµÓÐÁîÅÆ¡£", + IDC_STATIC,7,29,218,24 + LTEXT "AFS µ¥Ôª(&C)£º",IDC_STATIC,7,70,55,8 + EDITTEXT IDC_NEWCREDS_CELL,67,68,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "Óû§Ãû(&N)£º",IDC_STATIC,7,88,55,8 + EDITTEXT IDC_NEWCREDS_USER,67,86,97,14,ES_AUTOHSCROLL + LTEXT "¿ÚÁî(&P)£º",IDC_STATIC,7,106,55,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,67,104,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "ÄúÔÚ %1 µ¥ÔªÄÚµÄÁîÅÆ½«Òªµ½ÆÚ¡£",IDC_NEWCREDS_TITLE,7,7, + 218,16 + DEFPUSHBUTTON "È·¶¨",IDOK,69,134,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,122,134,50,14 + PUSHBUTTON "°ïÖú",9,175,134,50,14 +END + +IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + LTEXT "ÄúÒÑÑ¡Ôñ½«ÏÂÁÐÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶£º",IDC_TITLE,7,8, + 275,8 + PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,51,63,45,14 + PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,99,63,45,14 + PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,147,63,45,14 + CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x1d3,51,21,231,37 + PUSHBUTTON "°ïÖú",9,237,63,45,14 +END + +IDD_WIZARD DIALOGEX 0, 0, 272, 152 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS ¿Í»§»úÏòµ¼" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "ÏÂÒ»²½(&N) >",IDNEXT,162,131,50,14 + PUSHBUTTON "È¡Ïû(&L)",IDCANCEL,215,131,50,14 + CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,112 + CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,91,7,174,112 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,125,258,1 + PUSHBUTTON "°ïÖú(&H)",9,59,131,50,14 + PUSHBUTTON "< ÉÏÒ»²½(&B)",IDBACK,112,131,50,14 +END + +IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + LTEXT "»¹Ã»ÓÐÆô¶¯ AFS ¿Í»§»ú·þÎñ¡£",IDC_STATIC,0,0,173,8 + LTEXT "ÒªÆô¶¯ AFS ¿Í»§»ú·þÎñ£¬Çëµ¥»÷¡°ÏÂÒ»²½¡±¡£",IDC_STATIC,0, + 73,173,8 + LTEXT "Äú½«ÎÞ·¨Ê¹Óô洢ÔÚ AFS ÖеÄÎļþ£¬Ö±ÖÁÔËÐÐ AFS ¿Í»§»ú·þÎñ¡£", + IDC_STATIC,0,17,173,17 + LTEXT "Ҫʹ AFS ¿Í»§»ú·þÎñ±£³Öֹͣ״̬£¬Çëµ¥»÷¡°È¡Ïû¡±¡£", + IDC_STATIC,0,88,173,19 +END + +IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + LTEXT "AFS ¿Í»§»ú·þÎñÏÖÔÚÕýÔÚÔËÐУ¬µ«ÊÇÄúÉÐδ»ñµÃÈκοÉʹÓà AFS µÄÁîÅÆ¡£", + IDC_STATIC,0,0,173,16 + CONTROL "²»»ñµÃÈκε¥ÔªµÄÁîÅÆ",IDC_NOCREDS,"Button", + BS_AUTORADIOBUTTON,10,28,141,10 + CONTROL "»ñµÃÏÂÁе¥ÔªÖеÄÁîÅÆ£º",IDC_YESCREDS,"Button", + BS_AUTORADIOBUTTON,10,44,141,10 + LTEXT "AFS µ¥Ôª(&C)£º",IDC_STATIC,11,64,53,8 + EDITTEXT IDC_NEWCREDS_CELL,77,62,96,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "Óû§Ãû(&N)£º",IDC_STATIC,11,82,53,8 + EDITTEXT IDC_NEWCREDS_USER,77,80,96,14,ES_AUTOHSCROLL + LTEXT "¿ÚÁî(&P)£º",IDC_STATIC,11,100,53,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,77,97,96,14,ES_PASSWORD | + ES_AUTOHSCROLL +END + +IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + LTEXT "ÇëÉÔºò£»ÕýÔÚÆô¶¯ AFS ¿Í»§»ú·þÎñ...",IDC_START_TRY,0,33, + 173,8 + LTEXT "ÎÞ·¨Æô¶¯ AFS ¿Í»§»ú·þÎñ¡£\n\nÇë¼ì²éÄúµÄÍøÂçÉèÖ㬲¢Ê¹ÓÿØÖÆÃæ°åÖÐµÄ AFS ͼ±ê¼ì²é¸Ã¼ÆËã»úÉ쵀 AFS ¿Í»§»úµÄÅäÖá£", + IDC_START_FAIL,0,25,173,41 +END + +IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + LTEXT "Òª´æÈ¡´æ´¢ÔÚ AFS ÖеÄÎļþ£¬Äú±ØÐ뽫ÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶¡£", + IDC_STATIC,0,0,173,16 + CONTROL "²»Òª½«ÈκÎÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶(&D)",IDC_NOMAP,"Button", + BS_AUTORADIOBUTTON,2,23,168,10 + CONTROL "ÖÁÉÙ½«Ò»¸öÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶(&M)£º",IDC_YESMAP, + "Button",BS_AUTORADIOBUTTON,2,40,168,10 + LTEXT "ÅÌ·û(&L)£º",IDC_STATIC,9,58,58,8 + COMBOBOX IDC_MAP_LETTER,77,56,60,125,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,9,76,58,8 + EDITTEXT IDC_MAP_PATH,77,74,96,14,ES_AUTOHSCROLL + LTEXT "ÃèÊö(&E)£º",IDC_STATIC,9,94,58,8 + EDITTEXT IDC_MAP_DESC,77,92,60,14,ES_AUTOHSCROLL +END + +IDD_TERMINATE DIALOGEX 0, 0, 291, 117 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS ¿Í»§»ú" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + PUSHBUTTON "³ýȥͼ±ê(&R)",IDOK,167,96,63,14 + PUSHBUTTON "È¡Ïû(&L)",IDCANCEL,234,96,50,14 + LTEXT "ÄúÒÑÑ¡Ôñ´Ó¼ÆËã»úµÄÈÎÎñÀ¸ÖгýÈ¥¡°AFS ¿Í»§»ú¡±Í¼±ê¡£³ý·Ç¡°AFS ¿Í»§»ú¡±Í¼±êÔÚ¼ÆËã»úµÄÈÎÎñÀ¸ÖУ¬·ñÔòµ±ÄúµÄ AFS ÁîÅÆ½«Òªµ½ÆÚʱ£¬AFS ½«ÎÞ·¨·¢³ö¾¯¸æ¡£", + IDC_STATIC,7,7,277,25 + LTEXT "µ±Ç°ÕýÔÚÔËÐÐ AFS ¿Í»§»ú·þÎñ¡£Èç¹ûÐèÒª£¬Äú¿ÉÔÚ´ËʱֹͣÔËÐС£", + IDC_STATIC,7,41,277,8 + CONTROL "±£³Ö AFS ¿Í»§»ú·þÎñΪÔËÐÐ״̬(&U)",IDC_LEAVE,"Button", + BS_AUTORADIOBUTTON,26,55,228,10 + CONTROL "Í£Ö¹ AFS ¿Í»§»ú·þÎñ(&S)",IDC_STOP,"Button", + BS_AUTORADIOBUTTON,26,69,228,10 + CONTROL "µ±¼ÆËã»úÖØÐÂÆô¶¯Ê±ÏÔʾͼ±ê(&H)",IDC_STARTUP,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,98,148,10 +END + +IDD_TERMINATE_SMALL DIALOGEX 0, 0, 291, 68 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS ¿Í»§»ú" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + PUSHBUTTON "³ýȥͼ±ê(&R)",IDOK,167,47,63,14 + PUSHBUTTON "È¡Ïû(&L)",IDCANCEL,234,47,50,14 + LTEXT "ÄúÒÑÑ¡Ôñ´Ó¼ÆËã»úµÄÈÎÎñÀ¸ÖгýÈ¥¡°AFS ¿Í»§»ú¡±Í¼±ê¡£³ý·Ç¡°AFS ¿Í»§»ú¡±Í¼±êÔÚ¼ÆËã»úµÄÈÎÎñÀ¸ÖУ¬·ñÔòµ±ÄúµÄ AFS ÁîÅÆ½«Òªµ½ÆÚʱ£¬AFS ½«ÎÞ·¨·¢³ö¾¯¸æ¡£", + -1,7,7,277,25 + CONTROL "µ±¼ÆËã»úÖØÐÂÆô¶¯Ê±ÏÔʾͼ±ê(&H)",IDC_STARTUP,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,49,148,10 +END + +IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 291, 68 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Light" +FONT 9, "ËÎÌå", 0, 0, 0x1 +BEGIN + PUSHBUTTON "³ýȥͼ±ê(&R)",IDOK,167,47,63,14 + PUSHBUTTON "È¡Ïû(&L)",IDCANCEL,234,47,50,14 + LTEXT "ÄúÒÑÑ¡Ôñ´Ó¼ÆËã»úµÄÈÎÎñÀ¸ÖгýÈ¥¡°AFS Light¡±Í¼±ê¡£³ý·Ç¡°AFS Light¡±Í¼±êÔÚ¼ÆËã»úµÄÈÎÎñÀ¸ÖУ¬·ñÔòµ±ÄúµÄ AFS ÁîÅÆ½«Òªµ½ÆÚʱ£¬AFS ½«ÎÞ·¨·¢³ö¾¯¸æ¡£", + -1,7,7,277,25 + CONTROL "µ±¼ÆËã»úÖØÐÂÆô¶¯Ê±ÏÔʾͼ±ê(&H)",IDC_STARTUP,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,49,148,10 +END + +IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + LTEXT "ÄúËùÑ¡µÄÒ»¸ö»ò¶à¸öÅÌ·ûÎÞ·¨Ó³Éäµ½ÕýÈ·µÄ AFS ÖеÄ·¾¶¡£\n\nÄú¿ÉÄÜÒª¹Ø±ÕËùÓÐÊÔͼʹÓøÃ·¾¶µÄÓ¦ÓóÌÐò¡£", + IDC_MAP_FAIL,1,26,173,41 + LTEXT "ÇëÉÔºò£»ÕýÔÚ½«ÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶...",IDC_MAP_TRY,0, + 33,173,8 +END + +IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 174, 112 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "ËÎÌå" +BEGIN + LTEXT "AFS ¿Í»§»ú¾ÍÐ÷¡£",IDC_STATIC,0,0,173,8 + LTEXT "Òª¹Ø±Õ¸ÃÏòµ¼£¬Çëµ¥»÷¡°Íê³É¡±¡£",IDC_STATIC,0,73,173,8 +END + +IDD_MAPPING DIALOG DISCARDABLE 0, 0, 275, 152 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ó³ÉäÅÌ·û" +FONT 9, "ËÎÌå" +BEGIN + LTEXT "Äú¿É½«¼ÆËã»úÉϵÄÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶¡£\n\nÀýÈ磬Èç¹ûÄú½« Q: Ó³Éäµ½ \\afs\\acme.com\\usr\\bob£¬ÔòÔÚ Q:\\ Öн«¿É¿´¼ûÔÚ AFS ÖпÉÓõÄÎļþ \\afs\\acme.com\\usr\\bob\\* ¡£", + IDC_STATIC,7,7,261,32 + LTEXT "ÅÌ·û(&L)£º",IDC_STATIC,13,53,55,8 + COMBOBOX IDC_MAP_LETTER,73,51,60,162,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,13,70,55,8 + EDITTEXT IDC_MAP_PATH,73,68,178,13,ES_AUTOHSCROLL + LTEXT "ÃèÊö(&E)£º",IDC_STATIC,13,88,55,8 + EDITTEXT IDC_MAP_DESC,73,86,60,13,ES_AUTOHSCROLL + CONTROL "µÇ¼ʱ»Ö¸´Ó³Éä(&R)",IDC_MAP_PERSISTENT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,73,105,185,10 + DEFPUSHBUTTON "È·¶¨",IDOK,112,131,50,14 + PUSHBUTTON "È¡Ïû",IDCANCEL,165,131,50,14 + PUSHBUTTON "°ïÖú",9,218,131,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 300 + TOPMARGIN, 8 + BOTTOMMARGIN, 124 + END + + IDD_TAB_CREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_NOCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_ADVANCED, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_NEWCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 120 + END + + IDD_NEWCREDS_EXPIRE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 148 + END + + IDD_TAB_MOUNT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_WIZARD, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 265 + TOPMARGIN, 7 + BOTTOMMARGIN, 145 + END + + IDD_TERMINATE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 110 + END + + IDD_TERMINATE_SMALL, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 61 + END + + IDD_MAPPING, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 268 + TOPMARGIN, 7 + BOTTOMMARGIN, 145 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_TRAYICON MENU DISCARDABLE +BEGIN + MENUITEM "ÏÔʾÁîÅÆ(&S)...", M_ACTIVATE + MENUITEM "µ½ÆÚǰ¾¯¸æ(&W)", M_REMIND, CHECKED + MENUITEM SEPARATOR + MENUITEM "³ýȥͼ±ê(&R)", M_TERMINATE +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" +IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP "AFS ¿Í»§»ú" + IDS_TOOLTIP_95 "AFS Light" + IDS_CREDENTIALS "ÁîÅÆ" + IDS_UNKNOWN "(δ֪)" + IDS_ADVANCED "¸ß¼¶" + IDS_CREDS "%1 (ÁîÅÆµ½ÆÚ %2)" + IDS_NO_CREDS "(Ôڸõ¥ÔªÖÐÄúûÓÐÁîÅÆ)" + IDS_SERVICE_BROKEN "ûÓÐÕýÈ·µØ°²×° AFS ¿Í»§»ú·þÎñ£¬»òÕßÄúûÓвéѯ״̬µÄȨÏÞ¡£" + IDS_SERVICE_RUNNING "AFS ¿Í»§»ú·þÎñÕýÔÚÕý³£ÔËÐС£" + IDS_SERVICE_STOPPED "AFS ¿Í»§»ú·þÎñµ±Ç°ÎªÍ£Ö¹×´Ì¬¡£" + IDS_SERVICE_STOPPING "ÇëÉÔºò£»AFS ¿Í»§»ú·þÎñÕýÔÚÍ£Ö¹..." + IDS_SERVICE_STARTING "ÇëÉÔºò£»AFS ¿Í»§»ú·þÎñÕýÔÚÆô¶¯..." + IDS_SERVICE_UNKNOWN "ÎÞ·¨È·¶¨ AFS ¿Í»§»ú·þÎñµÄ״̬¡£" + IDS_SERVICE_FAIL_STOP "AFS ¿Í»§»ú·þÎñ²»Äܳɹ¦Í£Ö¹¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£" + IDS_SERVICE_FAIL_START "AFS ¿Í»§»ú·þÎñ²»Äܳɹ¦Æô¶¯¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£" + IDS_SERVICE_FAIL_CONFIG "ÎÞ·¨¸ü¸Ä AFS ¿Í»§»ú·þÎñµÄÆô¶¯²ÎÊý¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_ERROR "ÅäÖ÷þÎñ³ö´í" + IDS_ERROR_TITLE "³ö´í - AFS ¿Í»§»ú" + IDS_ERROR_TITLE_95 "³ö´í - AFS Light" + IDS_ERROR_DESTROY_95 "ÎÞ·¨ÆÆ»µÄúÔÚ %1 µ¥ÔªÖеÄÁîÅÆ¡£\n\n´íÎó£º%2" + IDS_ERROR_DESTROY_NOCM "ÎÞ·¨ÆÆ»µÄúÔÚ %1 µ¥ÔªÖеÄÁîÅÆ£¬ÒòΪ AFS ¿Í»§»ú·þÎñûÓÐÏìÓ¦¡£\n\nÇë¼ì²é¡°¸ß¼¶¡±±êÇ©ÒԲ鿴 AFS ¿Í»§»úÊÇ·ñÕýÈ·ÔËÐС£\n\n´íÎó£º%2" + IDS_ERROR_DESTROY_UNKNOWN + "ÎÞ·¨ÆÆ»µÄúÔÚ %1 µ¥ÔªÖеÄÁîÅÆ¡£\n\nÇë¼ì²é¡°¸ß¼¶¡±±êÇ©ÒԲ鿴 AFS ¿Í»§»úÊÇ·ñÕýÈ·ÔËÐС£\n\n´íÎó£º%2" + IDS_ERROR_OBTAIN "AFS ¿Í»§»úÎÞ·¨ÔÚ µ¥Ôª %1 ÖлñµÃÁîÅÆ %2 ¡£\n\n´íÎó£º%4 (%3)" + IDS_ERROR_OBTAIN_95 "AFS Light ÎÞ·¨ÔÚ µ¥Ôª %1 ÖлñµÃÁîÅÆ %2 ¡£\n\n´íÎó£º%4 (%3)" + IDS_TITLE_VERSION "AFS °æ±¾ %s" + IDS_TITLE_VERSION_NOPATCH "AFS °æ±¾ %s" + IDS_MOUNT_SOME "ÄúÒÑÑ¡Ôñ½«ÏÂÁÐÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶£º" + IDS_MOUNT_NONE "ÄúÉÐδѡÔñ½«ÈκÎÅÌ·ûÓ³Éäµ½ AFS ÖеÄ·¾¶¡£" + IDS_MOUNT "ÅÌ·û" + IDS_WIZ_NEXT "ÏÂÒ»²½(&N) >" + IDS_WIZ_FINISH "Íê³É(&F)" + IDS_MAP_LETTER "Çý¶¯Æ÷ *:" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DRIVE_MAP "Çý¶¯Æ÷ %1: \t%2" + IDS_ERROR_MAP "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í" + IDS_ERROR_MAP_DESC "AFS ÎÞ·¨Ó³ÉäÍøÂçÇý¶¯Æ÷ÖÁ AFS ÖеÄ·¾¶¡£¼ì²éÒÔÈ·±£ÅÌ·ûµ±Ç°Ã»ÓÐʹÓá£\n\n´íÎó£º0x%1¡£" + IDS_ERROR_UNMAP "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í" + IDS_ERROR_UNMAP_DESC "AFS ÎÞ·¨¶Ï¿ªÓëÖ¸¶¨ÍøÂçÇý¶¯Æ÷µÄÓ³Éä¡£¼ì²éÒÔÈ·±£ÅÌ·ûµ±Ç°Ã»ÓÐʹÓá£\n\n´íÎó£º0x%1¡£" + IDS_CELL_GATEWAY "%s (ͨ¹ýÍø¹Ø %s)" + IDS_BADMAP_TITLE "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í" + IDS_BADMAP_DESC "ÓÉÓÚ·¾¶Ã»ÓÐÒÔ""\\afs""¿ªÊ¼£¬AFS ²»ÄÜÓ³ÉäÅÌ·ûÖÁÖ¸¶¨µÄ·¾¶¡£\n\nÈ·±£ÄúËùÊäÈëµÄ·¾¶ÊÇÒÔ""\\afs""¿ªÊ¼µÄ£¬²¢ÖØÊÔÒ»´Î¡£" + IDS_UNCONFIG_TITLE_95 "³ö´í - AFS Light" + IDS_UNCONFIG_DESC_95 "ÒòΪÉÐδÅäÖà AFS Light£¬ËùÒÔÎÞ·¨Ê¹ÓÃËü¡£\n\nÒªÅäÖà AFS Light£¬Çë´ò¿ª¿ØÖÆÃæ°å²¢Ë«»÷¡°AFS Light¡±Í¼±ê¡£" + IDS_UNCONFIG_TITLE "³ö´í - AFS ¿Í»§»ú" + IDS_UNCONFIG_DESC "ÒòΪÉÐδÅäÖà AFS ¿Í»§»ú£¬ËùÒÔÎÞ·¨Ê¹ÓÃËü¡£\n\nÒªÅäÖà AFS ¿Í»§»ú£¬Çë´ò¿ª¿ØÖÆÃæ°å²¢Ë«»÷¡°AFS ¿Í»§»ú¡±Í¼±ê¡£" + IDS_NEWSUB_TITLE "×¢Òâ - AFS ¿Í»§»ú" + IDS_NEWSUB_TITLE_95 "×¢Òâ - AFS Light" + IDS_NEWSUB_DESC "µ±Á¬½ÓÍøÂçÇý¶¯Æ÷ʱ£¬AFS ÎÞ·¨Ê¹ÓÃÖ¸¶¨µÄÃèÊö¡£\n\nÖ¸¶¨µÄÃèÊöÒÑʹÓÃÔÚ²»Í¬µÄ AFS ·¾¶ÖС£" + IDS_BADSUB_TITLE "³ö´í - AFS ¿Í»§»ú" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADSUB_TITLE_95 "³ö´í - AFS Light" + IDS_BADSUB_DESC "²»ÄÜʹÓÃÄúÊäÈëµÄÅÌ·ûÃèÊö¡£\n\nÅÌ·ûÃèÊö²»Äܳ¬¹ý 12 ¸ö×Ö·û£¬²¢ÇÒ²»Äܰüº¬¿Õ¸ñ»òÖÆ±í·û¡£" + IDS_TITLE_95 "AFS Light" +END + +#endif // Chinese (P.R.C.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/client_creds/lang/zh_TW/afscreds.rc b/src/WINNT/client_creds/lang/zh_TW/afscreds.rc index 47b06a338..ce94ea11b 100644 --- a/src/WINNT/client_creds/lang/zh_TW/afscreds.rc +++ b/src/WINNT/client_creds/lang/zh_TW/afscreds.rc @@ -7,25 +7,25 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Chinese (Taiwan) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHT) -#ifdef _WIN32 -LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL -#endif //_WIN32 +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Chinese (Taiwan) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHT) +#ifdef _WIN32 +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL +#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Version @@ -39,546 +39,546 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL #define AFS_VERINFO_CHARSET 950 #include "AFS_component_version_number.h" #include "..\..\config\NTVersioninfo.rc" - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAIN ICON DISCARDABLE "afscreds.ico" -IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" -IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" -IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_MAIN DIALOG DISCARDABLE 0, 0, 306, 131 -STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "AFS ¥Î¤áºÝ" -CLASS "AfsCreds" -FONT 9, "·s²Ó©úÅé" -BEGIN - RTEXT "AFS %s ª©¡]­×¥¿ÀÉ %lu¡^",IDC_TITLE_VERSION,197,10, - 101,8 - LTEXT "¥Ø«e¥H ""%s"" µn¤J¦Ü Windows ºô¸ô ",IDC_TITLE_NT,7,8, - 171,8 - CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,27,292,97 -END - -IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "Cell¡G ",IDC_STATIC,7,9,24,8 - LTEXT "¡]µL¡^",IDC_CREDS_CELL,51,9,193,8 - LTEXT "°O¸¹¡G",IDC_STATIC,7,26,27,8 - LTEXT "¡]µL¡^",IDC_CREDS_INFO,51,26,193,8 - CONTROL "¦b³o¨Ç°O¸¹¨ì´Á¤§«eÅã¥Üĵ§i(&S)",IDC_CREDS_REMIND,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,51,43,193,10 - PUSHBUTTON "¨ú±o·sªº°O¸¹(&O)...",IDC_CREDS_OBTAIN,51,63,88,14 - PUSHBUTTON "±Ë±ó³o¨Ç°O¸¹(&D)",IDC_CREDS_DESTROY,142,63,92,14 - PUSHBUTTON "»¡©ú",9,237,63,45,14 -END - -IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "±z©|¥¼¦b©Ò¦³ªº AFS Cell ¤¤¨ú±o°O¸¹¡C",IDC_RUNNING,7,9, - 275,8 - LTEXT "¨Ã¥¼¥¿½T¬[ºc AFS ¥Î¤áºÝ¡A©ÎªÌ¥Ø«e¨Ã¥¼°õ¦æ AFS ¥Î¤áºÝªA°È¡C\n\n½Ð¨Ï¥Î¡u¶i¶¥¡v¼ÐÅÒ¨Ó±Ò°Ê¡uAFS ¥Î¤áºÝ¡vªA°È¡C", - IDC_STOPPED,7,9,275,25 - PUSHBUTTON "»¡©ú",9,237,63,45,14 - PUSHBUTTON "¨ú±o·sªº°O¸¹(&O)...",IDC_CREDS_OBTAIN,51,63,88,14 -END - -IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¡]¬d¸ß...¡^",IDC_SERVICE_STATUS,7,9,275,8 - PUSHBUTTON "±Ò°ÊªA°È(&S)",IDC_SERVICE_START,53,34,73,14 - PUSHBUTTON "°±¤îªA°È(&T)",IDC_SERVICE_STOP,131,34,73,14 - PUSHBUTTON "¬[ºc AFS ¥Î¤áºÝ(&C)",IDC_OPEN_CPL,209,34,73,14 - CONTROL "·í¹q¸£­«·s±Ò°Ê®É¡A§Y±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v(&R)", - IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, - 51,204,10 - CONTROL "Á`¬O¦b¤u§@¦CÅã¥Ü¡uAFS ¥Î¤áºÝ¡v¹Ï¥Ü(&A) ",IDC_STARTUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65,204,10 - PUSHBUTTON "»¡©ú",9,237,63,45,14 -END - -IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 232, 127 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "¨ú±o·sªº AFS °O¸¹" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¦p­n¨ú±o·sªº AFS °O¸¹¡A½Ð¿é¤J±z AFS ±b¤áªº¨Ï¥ÎªÌ¦WºÙ»P±K½X¡C±z¥i¥H¦P®É¦b¦h­« AFS Cell ¤º¨ã¦³°O¸¹¡C", - IDC_STATIC,7,7,218,24 - LTEXT "AFS Cell (&C)¡G",IDC_STATIC,24,42,49,8 - EDITTEXT IDC_NEWCREDS_CELL,83,40,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "¨Ï¥ÎªÌ¦WºÙ(&N)¡G",IDC_STATIC,24,60,59,8 - EDITTEXT IDC_NEWCREDS_USER,83,58,97,14,ES_AUTOHSCROLL - LTEXT "±K½X(&P)¡G",IDC_STATIC,23,78,34,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,83,76,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - DEFPUSHBUTTON "½T©w",IDOK,69,106,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,122,106,50,14 - PUSHBUTTON "»¡©ú",9,175,106,50,14 -END - -IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "¨ú±o·sªº AFS °O¸¹" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¦p­n¨ú±o·sªº AFS °O¸¹¡A½Ð¿é¤J±z AFS ±b¤áªº¨Ï¥ÎªÌ¦WºÙ»P±K½X¡C±z¥i¥H¦P®É¦b¦h­« AFS Cell ¤º¨ã¦³°O¸¹¡C", - IDC_STATIC,7,29,218,24 - LTEXT "AFS Cell (&C)¡G",IDC_STATIC,10,64,56,8 - EDITTEXT IDC_NEWCREDS_CELL,74,62,132,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "¨Ï¥ÎªÌ¦WºÙ(&N)¡G",IDC_STATIC,10,82,59,8 - EDITTEXT IDC_NEWCREDS_USER,74,80,97,14,ES_AUTOHSCROLL - LTEXT "±K½X(&P)¡G",IDC_STATIC,10,100,34,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,74,98,97,14,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "±z¦b %1 Cell ªº°O¸¹§Y±N¹L´Á¡C",IDC_NEWCREDS_TITLE,7,7, - 218,16 - DEFPUSHBUTTON "½T©w",IDOK,69,134,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,122,134,50,14 - PUSHBUTTON "»¡©ú",9,175,134,50,14 -END - -IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 289, 81 -STYLE WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "±z¤w¿ï¾Ü±N¥H¤UªººÏºÐ¾÷¥N¸¹¹ïÀ³¦Ü AFS ¸ô®|¡G",IDC_TITLE, - 7,8,275,8 - PUSHBUTTON "·s¼W(&A)...",IDC_ADD,51,63,45,14 - PUSHBUTTON "Åܧó(&C)...",IDC_EDIT,99,63,45,14 - PUSHBUTTON "²¾°£(&R)",IDC_REMOVE,147,63,45,14 - CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | - WS_TABSTOP | 0x1d3,51,21,231,37 - PUSHBUTTON "»¡©ú",9,237,63,45,14 -END - -IDD_WIZARD DIALOGEX 0, 0, 299, 177 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS ¥Î¤áºÝºëÆF" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "¤U¤@¨B(&N) >",IDNEXT,187,150,50,14 - PUSHBUTTON "¨ú®ø(&L)",IDCANCEL,242,150,50,14 - CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,119 - CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,97,7,195,119 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,138,285,1 - PUSHBUTTON "»¡©ú(&H)",9,79,150,50,14 - PUSHBUTTON "< ¤W¤@¨B(&B)",IDBACK,133,150,50,14 -END - -IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 195, 119 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "©|¥¼±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v¡C",IDC_STATIC,4,6,173,8 - LTEXT "¦p­n±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v¡A½Ð«ö¡u¤U¤@¨B¡v¡C", - IDC_STATIC,4,79,185,8 - LTEXT "¦b°õ¦æ¡uAFS ¥Î¤áºÝªA°È¡v¤§«e¡A±z±NµLªk¨Ï¥ÎÀx¦s©ó AFS ¤ºªºÀɮסC", - IDC_STATIC,4,23,173,17 - LTEXT "¦p­n°±¤î°õ¦æ¡uAFS ¥Î¤áºÝªA°È¡v¡A½Ð«ö¡u¨ú®ø¡v¡C", - IDC_STATIC,4,94,186,17 -END - -IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 195, 119 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¥Ø«e¥¿¦b°õ¦æ¡uAFS ¥Î¤áºÝªA°È¡v¡A¦ý¬O±z©|¥¼¨ú±o¥ô¦ó¨Ï¥Î AFS ªº°O¸¹¡C", - IDC_STATIC,8,5,173,16 - CONTROL "¤£­n¨ú±o¥ô¦ó Cell ªº°O¸¹",IDC_NOCREDS,"Button", - BS_AUTORADIOBUTTON,8,28,141,10 - CONTROL "¨ú±o¥H¤U Cell ªº°O¸¹¡G",IDC_YESCREDS,"Button", - BS_AUTORADIOBUTTON,8,44,141,10 - LTEXT "AFS Cell (&C)¡G",IDC_STATIC,11,64,54,8 - EDITTEXT IDC_NEWCREDS_CELL,77,62,96,14,ES_LOWERCASE | - ES_AUTOHSCROLL - LTEXT "¨Ï¥ÎªÌ¦WºÙ(&N)¡G",IDC_STATIC,11,82,61,8 - EDITTEXT IDC_NEWCREDS_USER,77,80,96,14,ES_AUTOHSCROLL - LTEXT "±K½X(&P)¡G",IDC_STATIC,11,100,34,8 - EDITTEXT IDC_NEWCREDS_PASSWORD,77,97,96,14,ES_PASSWORD | - ES_AUTOHSCROLL -END - -IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 195, 119 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "½Ðµy­Ô¡F¥¿¦b±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v...",IDC_START_TRY,10, - 33,173,8 - LTEXT "µLªk±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v¡C\n\n\n½ÐÀˬd±zªººô¸ô³]©w¡A¨Ã¨Ï¥Î¡u±±¨î¥x¡vªº AFS ¹Ï¥Ü¨ÓÀˬd¦¹¹q¸£¡uAFS ¥Î¤áºÝ¡vªº¬[ºc¡C", - IDC_START_FAIL,9,21,164,55 -END - -IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 195, 119 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¦p­n¦s¨úÀx¦s©ó AFS ¤ºªºÀɮסA±z¥²¶·±NºÏºÐ¾÷¥N¸¹¹ïÀ³¦Ü AFS ªº¸ô®|¤W¡C", - IDC_STATIC,6,4,173,16 - CONTROL "¤£­n±N¥ô¦óºÏºÐ¾÷¥N¸¹¹ïÀ³¨ì AFS ªº¸ô®|¤W(&D)",IDC_NOMAP, - "Button",BS_AUTORADIOBUTTON,5,23,179,10 - CONTROL "¦Ü¤Ö±N¤@­ÓºÏºÐ¾÷¥N¸¹¹ïÀ³¨ì AFS ªº¸ô®|¤W(&M)¡G", - IDC_YESMAP,"Button",BS_AUTORADIOBUTTON,6,40,178,10 - LTEXT "ºÏºÐ¾÷¥N¸¹(&L)¡G",IDC_STATIC,24,58,61,8 - COMBOBOX IDC_MAP_LETTER,85,56,48,125,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS ¸ô®|(&P)¡G",IDC_STATIC,24,76,58,8 - EDITTEXT IDC_MAP_PATH,85,74,96,14,ES_AUTOHSCROLL - LTEXT "µu¦WºÙ(&E)¡G",IDC_STATIC,24,94,38,8 - EDITTEXT IDC_MAP_DESC,85,92,60,14,ES_AUTOHSCROLL -END - -IDD_TERMINATE DIALOGEX 0, 0, 291, 117 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS ¥Î¤áºÝ" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - PUSHBUTTON "²¾°£¹Ï¥Ü(&R)",IDOK,167,96,63,14 - PUSHBUTTON "¨ú®ø(&L)",IDCANCEL,234,96,50,14 - LTEXT "±z¿ï¾Ü²¾°£¹q¸£¤u§@¦C¤Wªº¡uAFS ¥Î¤áºÝ¡v¹Ï¥Ü¡C°£«D¡uAFS ¥Î¤áºÝ¡v¹Ï¥Ü¥X²{¦b¹q¸£ªº¤u§@¦C¤W¡A§_«h·í AFS °O¸¹§Y±N¹L´Áªº®É­Ô¡AAFS µLªkĵ§i±z¡C", - IDC_STATIC,7,7,277,25 - LTEXT "¥Ø«e¥¿¦b°õ¦æ¡uAFS ¥Î¤áºÝªA°È¡v¡A±z¥i¥HÀH®É°±¤î³o­Óµ{¦¡¡C", - IDC_STATIC,7,41,277,8 - CONTROL "Ä~Äò°õ¦æ¡uAFS ¥Î¤áºÝªA°È¡v(&L)",IDC_LEAVE,"Button", - BS_AUTORADIOBUTTON,12,55,228,10 - CONTROL "°±¤î¡uAFS ¥Î¤áºÝªA°È¡v(&S)",IDC_STOP,"Button", - BS_AUTORADIOBUTTON,12,69,228,10 - CONTROL "¹q¸£­«·s±Ò°Ê®ÉÅã¥Ü¹Ï¥Ü(&H)",IDC_STARTUP,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,98,148,10 -END - -IDD_TERMINATE_SMALL DIALOGEX 0, 0, 291, 68 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS ¥Î¤áºÝ" -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - PUSHBUTTON "²¾°£¹Ï¥Ü(&R)",IDOK,167,47,63,14 - PUSHBUTTON "¨ú®ø(&L)",IDCANCEL,234,47,50,14 - LTEXT "±z¿ï¾Ü²¾°£¹q¸£¤u§@¦C¤Wªº¡uAFS ¥Î¤áºÝ¡v¹Ï¥Ü¡C°£«D¡uAFS ¥Î¤áºÝ¡v¹Ï¥Ü¥X²{¦b¹q¸£ªº¤u§@¦C¤W¡A§_«h·í AFS °O¸¹§Y±N¹L´Áªº®É­Ô¡AAFS ´NµLªkĵ§i±z¡C", - -1,7,7,277,25 - CONTROL "¹q¸£­«·s±Ò°Ê®ÉÅã¥Ü¹Ï¥Ü(&H)",IDC_STARTUP,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,49,148,10 -END - -IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 291, 68 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "AFS Light " -FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 -BEGIN - PUSHBUTTON "²¾°£¹Ï¥Ü(&R)",IDOK,167,47,63,14 - PUSHBUTTON "¨ú®ø(&L)",IDCANCEL,234,47,50,14 - LTEXT "±z¿ï¾Ü²¾°£¹q¸£¤u§@¦C¤Wªº¡uAFS Light ¡v¹Ï¥Ü¡C°£«D¡uAFS Light ¡v¹Ï¥Ü¥X²{¦b¹q¸£ªº¤u§@¦C¤W¡A§_«h·í AFS °O¸¹§Y±N¹L´Áªº®É­Ô¡AAFS ´NµLªkĵ§i±z¡C", - -1,7,7,277,25 - CONTROL "¹q¸£­«·s±Ò°Ê®ÉÅã¥Ü¹Ï¥Ü(&H)",IDC_STARTUP,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,49,148,10 -END - -IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 195, 119 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "±z©Ò¿ï¾Üªº¤@©Î¦h­ÓºÏºÐ¾÷¥N¸¹µLªk¹ïÀ³¦Ü AFS ¾A·íªº¸ô®|¤W¡C\n\n\n±z¥²¶·Ãö³¬¥Ø«e¥¿¸Õ¹Ï¨Ï¥Î AFS ¸ô®|ªºÀ³¥Îµ{¦¡¡C", - IDC_MAP_FAIL,10,23,177,50 - LTEXT "½Ðµy­Ô¡F¥¿¦b±NºÏºÐ¾÷¥N¸¹¹ïÀ³¨ì AFS ªº¸ô®|¤W...", - IDC_MAP_TRY,9,43,173,8 -END - -IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 195, 119 -STYLE DS_CONTROL | WS_CHILD -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "¡uAFS ¥Î¤áºÝ¡v¤w·Ç³Æ´Nºü¡C",IDC_STATIC,7,6,173,8 - LTEXT "¦p­nÃö³¬¦¹ºëÆF¡A½Ð«ö¤@¤U¡u§¹¦¨¡v¡C",IDC_STATIC,7,76,173, - 8 -END - -IDD_MAPPING DIALOG DISCARDABLE 0, 0, 275, 152 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "¹ïÀ³ºÏºÐ¾÷¥N¸¹" -FONT 9, "·s²Ó©úÅé" -BEGIN - LTEXT "±z¥i¥H±N¹q¸£¤WªººÏºÐ¾÷¥N¸¹¹ïÀ³¦Ü AFS ªº¸ô®|¤W¡C\n\n¨Ò¦p¡A¦pªG±z§â Q: ¹ïÀ³¬° \\afs\\acme.com\\usr\\bob¡A«h AFS \\afs\\acme.com\\usr\\bob\\* ¤WªºÀÉ®×´N·|¥X²{¦b Q¡G\\ ¤W ", - IDC_STATIC,7,7,261,32 - LTEXT "ºÏºÐ¾÷¥N¸¹(&L)¡G",IDC_STATIC,11,53,58,8 - COMBOBOX IDC_MAP_LETTER,69,51,56,162,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "AFS ¸ô®|(&P)¡G",IDC_STATIC,11,70,50,8 - EDITTEXT IDC_MAP_PATH,69,68,166,13,ES_AUTOHSCROLL - LTEXT "µu¦WºÙ(&E)¡G",IDC_STATIC,11,88,49,8 - EDITTEXT IDC_MAP_DESC,69,86,60,13,ES_AUTOHSCROLL - CONTROL "¨C¦¸µn¤J®É§Y«ì´_¦¹¤@¹ïÀ³(&R)",IDC_MAP_PERSISTENT,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,69,105,185,10 - DEFPUSHBUTTON "½T©w",IDOK,112,131,50,14 - PUSHBUTTON "¨ú®ø",IDCANCEL,165,131,50,14 - PUSHBUTTON "»¡©ú",9,218,131,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_MAIN, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 299 - TOPMARGIN, 8 - BOTTOMMARGIN, 124 - END - - IDD_TAB_CREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_NOCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_TAB_ADVANCED, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_NEWCREDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 120 - END - - IDD_NEWCREDS_EXPIRE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 225 - TOPMARGIN, 7 - BOTTOMMARGIN, 148 - END - - IDD_TAB_MOUNT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 282 - TOPMARGIN, 9 - BOTTOMMARGIN, 77 - END - - IDD_WIZARD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 292 - TOPMARGIN, 7 - BOTTOMMARGIN, 170 - END - - IDD_WIZ_CREDS, DIALOG - BEGIN - RIGHTMARGIN, 174 - BOTTOMMARGIN, 111 - END - - IDD_WIZ_MOUNT, DIALOG - BEGIN - RIGHTMARGIN, 191 - BOTTOMMARGIN, 111 - END - - IDD_TERMINATE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 284 - TOPMARGIN, 7 - BOTTOMMARGIN, 110 - END - - IDD_TERMINATE_SMALL, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 284 - TOPMARGIN, 7 - BOTTOMMARGIN, 61 - END - - IDD_MAPPING, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 268 - TOPMARGIN, 7 - BOTTOMMARGIN, 145 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -MENU_TRAYICON MENU DISCARDABLE -BEGIN - MENUITEM "Åã¥Ü°O¸¹(&S)...", M_ACTIVATE - MENUITEM "¹L´Á«e¥ýĵ§i(&W)", M_REMIND, CHECKED - MENUITEM SEPARATOR - MENUITEM "²¾°£¹Ï¥Ü(&R)", M_TERMINATE -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" -IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_TOOLTIP "AFS ¥Î¤áºÝ" - IDS_CREDENTIALS "°O¸¹" - IDS_UNKNOWN "¡]¤£©ú¡^" - IDS_ADVANCED "¶i¶¥" - IDS_CREDS "%1 ¡]°O¸¹¹L´Á %2¡^" - IDS_NO_CREDS "¡]±z¦b¦¹ Cell ¤¤¨S¦³°O¸¹¡^" - IDS_SERVICE_BROKEN "¡uAFS ¥Î¤áºÝªA°È¡v¦w¸Ë¤£·í¡A©ÎªÌ±z¨S¦³¬d¸ß¨äª¬ºAªºÅv­­¡C" - IDS_SERVICE_RUNNING "¡uAFS ¥Î¤áºÝªA°È¡v¥Ø«e°õ¦æ¥¿±`¡C" - IDS_SERVICE_STOPPED "¥Ø«e¤w°±¤î¡uAFS ¥Î¤áºÝªA°È¡v¡C" - IDS_SERVICE_STOPPING "½Ðµy­Ô¡F¥¿¦b°±¤î¡uAFS ¥Î¤áºÝªA°È¡v..." - IDS_SERVICE_STARTING "½Ðµy­Ô¡F¥¿¦b±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v..." - IDS_SERVICE_UNKNOWN "µLªk§PÂ_¡uAFS ¥Î¤áºÝªA°È¡vªºª¬ºA¡C" - IDS_SERVICE_FAIL_STOP "µLªk¶¶§Q°±¤î¡uAFS ¥Î¤áºÝªA°È¡v¡C±z¥i¯à¥¼Àò±o°õ¦æ¦¹¤@§@·~ªºÅv­­¡C\n\n¿ù»~ 0x%1¡C" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_MAP "¹ïÀ³ºô¸ôºÏºÐ¾÷®Éµo¥Í¿ù»~" - IDS_ERROR_MAP_DESC "AFS µLªk¹ïÀ³ºô¸ôºÏºÐ¾÷¨ì AFS ¤Wªº«ü©w¸ô®|¡C½Ð½T©w¥Ø«e¨Ã¥¼¨Ï¥Î¸ÓºÏºÐ¾÷¥N¸¹¡C\n\n¿ù»~¡G 0x%1¡C" - IDS_ERROR_UNMAP "¹ïÀ³ºô¸ôºÏºÐ¾÷®Éµo¥Í¿ù»~" - IDS_ERROR_UNMAP_DESC "AFS µLªk¨ú®ø¹ïÀ³«ü©wªººô¸ôºÏºÐ¾÷¡C½Ð½T©w¥Ø«e¨Ã¥¼¨Ï¥Î¸ÓºÏºÐ¾÷¥N¸¹¡C\n\n¿ù»~¡G 0x%1¡C" - IDS_CELL_GATEWAY "%s ¡]³z¹L¹h¹D %s¡^" - IDS_BADMAP_TITLE "¹ïÀ³ºô¸ôºÏºÐ¾÷®Éµo¥Í¿ù»~" - IDS_BADMAP_DESC "AFS µLªk¹ïÀ³ºÏºÐ¾÷¥N¸¹¨ì«ü©w¸ô®|¡A¦]¬°¸ô®|¨Ã«D¥H ""\\afs"" ¬°¶}ÀY¡C\n\n½Ð½T©w±z©Ò¿é¤Jªº¸ô®|¶}ÀY¬° ""\\afs""¡AµM«á¦A¸Õ¤@¦¸¡C" - IDS_UNCONFIG_TITLE "¿ù»~ - AFS ¥Î¤áºÝ" - IDS_UNCONFIG_DESC "©|¥¼¬[ºc¡uAFS ¥Î¤áºÝ¡v¡A¦]¦¹µLªk¨Ï¥Î¡C\n\n¦p­n¬[ºc¡uAFS ¥Î¤áºÝ¡v¡A½Ð¶}±Ò¡u¥D±±¥x¡v¨Ã¦b¡uAFS ¥Î¤áºÝ¡v¹Ï¥Ü¤W«ö¨â¤U¡C" - IDS_NEWSUB_TITLE "ĵ§i - AFS ¥Î¤áºÝ" - IDS_NEWSUB_DESC "AFS ¦b³s±µºô¸ôºÏºÐ¾÷®É¡AµLªk¨Ï¥Î±z©Ò«ü©wªº»¡©ú¡C \n\n\n©Ò«ü©wªº»¡©ú¤w¥Î©ó¤£¦Pªº AFS ¸ô®|¡C" - IDS_BADSUB_TITLE "¿ù»~ - AFS ¥Î¤áºÝ" - IDS_BADSUB_DESC "±z©Ò¿é¤JªººÏºÐ¾÷¥N¸¹»¡©úµLªk¨Ï¥Î¡C\n\nºÏºÐ¾÷¥N¸¹»¡©ú³Ì¦h¤£¯à¶W¹L 12 ­Ó¦r¤¸¡A¦Ó¥B¤£¥i¥]§tªÅ®æ©Î¼ÐÄæ¡C" - IDS_TITLE_95 "AFS Light " - IDS_TOOLTIP_95 "AFS Light " -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SERVICE_FAIL_START "µLªk¶¶§Q±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v¡C±z¥i¯à¥¼Àò±o°õ¦æ¦¹¤@§@·~ªºÅv­­¡C\n\n¿ù»~ 0x%1¡C" - IDS_SERVICE_FAIL_CONFIG "µLªkÅܧó¡uAFS ¥Î¤áºÝªA°È¡vªº±Ò°Ê°Ñ¼Æ¡C±zªºÅv­­¤£¨¬¥H°õ¦æ¦¹¶µ§@·~¡C\n\n¿ù»~ 0x%1¡C" - IDS_SERVICE_ERROR "¬[ºcªA°È®Éµo¥Í¿ù»~" - IDS_ERROR_TITLE "¿ù»~ - AFS ¥Î¤áºÝ" - IDS_ERROR_DESTROY_NOCM "±z¦b %1 Cell ¤¤ªº°O¸¹µLªk¾P·´¡A¦]¬°¡uAFS ¥Î¤áºÝªA°È¡v¨S¦³¦^À³¡C\n\n½ÐÀˬd¡u¶i¶¥¡v¼ÐÅÒ¡A¬d¬Ý¡uAFS ¥Î¤áºÝ¡v¬O§_¥¿±`°õ¦æ¡C\n\n¿ù»~¡G %2" - IDS_ERROR_DESTROY_UNKNOWN - "±z¦b %1 Cell ¤¤ªº°O¸¹µLªk¾P·´¡C\n\n½ÐÀˬd¡u¶i¶¥¡v¼ÐÅÒ¡A¬d¬Ý¡u AFS ¥Î¤áºÝ¡v¬O§_¥¿±`°õ¦æ¡C\n\n¿ù»~¡G %2" - IDS_ERROR_OBTAIN "¡uAFS ¥Î¤áºÝ¡vµLªk¦b Cell %1 ¤¤¨ú±o %2 ªº°O¸¹¡C\n\n¿ù»~¡G %4 (%3)" - IDS_TITLE_VERSION "AFS ª©¥» %s" - IDS_TITLE_VERSION_NOPATCH "AFS ª©¥» %s" - IDS_MOUNT_SOME "±z¤w¿ï¾Ü±N¥H¤UªººÏºÐ¾÷¥N¸¹¹ïÀ³¦Ü AFS ¸ô®|¡G" - IDS_MOUNT_NONE "±z©|¥¼¿ï¾Ü¹ïÀ³ºÏºÐ¾÷¥N¸¹¦Ü AFS ªº¸ô®|¤W¡C" - IDS_MOUNT "ºÏºÐ¾÷¥N¸¹" - IDS_WIZ_NEXT "¤U¤@¨B(&N) >" - IDS_WIZ_FINISH "§¹¦¨(&F)" - IDS_MAP_LETTER "ºÏºÐ¾÷ *:" - IDS_DRIVE_MAP "ºÏºÐ¾÷ %1: \t%2" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ERROR_TITLE_95 "¿ù»~ - AFS Light " - IDS_ERROR_DESTROY_95 "µLªk¾P·´±z¦b %1 Cell ¤¤ªº°O¸¹¡C\n\n¿ù»~¡G %2 " - IDS_ERROR_OBTAIN_95 "¡uAFS Light ¡vµLªk¦b Cell %1 ¤¤¨ú±o %2 ªº°O¸¹¡C\n\n¿ù»~¡G %4 (%3)" - IDS_UNCONFIG_TITLE_95 "¿ù»~ - AFS Light " - IDS_UNCONFIG_DESC_95 "©|¥¼¬[ºc¡uAFS Light ¡v¡A¦]¦¹µLªk¨Ï¥Î¡C\n\n¦p­n¬[ºc¡uAFS Light ¡v¡A½Ð¶}±Ò¡u±±¨î¥x¡v¡A¨Ã¦b¡uAFS Light ¬[ºc¡v¹Ï¥Ü¤W«ö¨â¤U¡C" - IDS_NEWSUB_TITLE_95 "ĵ§i - AFS Light " - IDS_BADSUB_TITLE_95 "¿ù»~ - AFS Light " -END - -#endif // Chinese (Taiwan) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON DISCARDABLE "afscreds.ico" +IDI_CREDS_NO ICON DISCARDABLE "creds_3.ico" +IDI_CREDS_SOME ICON DISCARDABLE "creds_2.ico" +IDI_CREDS_YES ICON DISCARDABLE "creds_1.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include \r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_MAIN DIALOG DISCARDABLE 0, 0, 306, 131 +STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "AFS ¥Î¤áºÝ" +CLASS "AfsCreds" +FONT 9, "·s²Ó©úÅé" +BEGIN + RTEXT "AFS %s ª©¡]­×¥¿ÀÉ %lu¡^",IDC_TITLE_VERSION,197,10, + 101,8 + LTEXT "¥Ø«e¥H ""%s"" µn¤J¦Ü Windows ºô¸ô ",IDC_TITLE_NT,7,8, + 171,8 + CONTROL "",IDC_TABS,"SysTabControl32",0x0,7,27,292,97 +END + +IDD_TAB_CREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "Cell¡G ",IDC_STATIC,7,9,24,8 + LTEXT "¡]µL¡^",IDC_CREDS_CELL,51,9,193,8 + LTEXT "°O¸¹¡G",IDC_STATIC,7,26,27,8 + LTEXT "¡]µL¡^",IDC_CREDS_INFO,51,26,193,8 + CONTROL "¦b³o¨Ç°O¸¹¨ì´Á¤§«eÅã¥Üĵ§i(&S)",IDC_CREDS_REMIND,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,51,43,193,10 + PUSHBUTTON "¨ú±o·sªº°O¸¹(&O)...",IDC_CREDS_OBTAIN,51,63,88,14 + PUSHBUTTON "±Ë±ó³o¨Ç°O¸¹(&D)",IDC_CREDS_DESTROY,142,63,92,14 + PUSHBUTTON "»¡©ú",9,237,63,45,14 +END + +IDD_TAB_NOCREDS DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "±z©|¥¼¦b©Ò¦³ªº AFS Cell ¤¤¨ú±o°O¸¹¡C",IDC_RUNNING,7,9, + 275,8 + LTEXT "¨Ã¥¼¥¿½T¬[ºc AFS ¥Î¤áºÝ¡A©ÎªÌ¥Ø«e¨Ã¥¼°õ¦æ AFS ¥Î¤áºÝªA°È¡C\n\n½Ð¨Ï¥Î¡u¶i¶¥¡v¼ÐÅÒ¨Ó±Ò°Ê¡uAFS ¥Î¤áºÝ¡vªA°È¡C", + IDC_STOPPED,7,9,275,25 + PUSHBUTTON "»¡©ú",9,237,63,45,14 + PUSHBUTTON "¨ú±o·sªº°O¸¹(&O)...",IDC_CREDS_OBTAIN,51,63,88,14 +END + +IDD_TAB_ADVANCED DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¡]¬d¸ß...¡^",IDC_SERVICE_STATUS,7,9,275,8 + PUSHBUTTON "±Ò°ÊªA°È(&S)",IDC_SERVICE_START,53,34,73,14 + PUSHBUTTON "°±¤îªA°È(&T)",IDC_SERVICE_STOP,131,34,73,14 + PUSHBUTTON "¬[ºc AFS ¥Î¤áºÝ(&C)",IDC_OPEN_CPL,209,34,73,14 + CONTROL "·í¹q¸£­«·s±Ò°Ê®É¡A§Y±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v(&R)", + IDC_SERVICE_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, + 51,204,10 + CONTROL "Á`¬O¦b¤u§@¦CÅã¥Ü¡uAFS ¥Î¤áºÝ¡v¹Ï¥Ü(&A) ",IDC_STARTUP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65,204,10 + PUSHBUTTON "»¡©ú",9,237,63,45,14 +END + +IDD_NEWCREDS DIALOG DISCARDABLE 0, 0, 232, 127 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "¨ú±o·sªº AFS °O¸¹" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¦p­n¨ú±o·sªº AFS °O¸¹¡A½Ð¿é¤J±z AFS ±b¤áªº¨Ï¥ÎªÌ¦WºÙ»P±K½X¡C±z¥i¥H¦P®É¦b¦h­« AFS Cell ¤º¨ã¦³°O¸¹¡C", + IDC_STATIC,7,7,218,24 + LTEXT "AFS Cell (&C)¡G",IDC_STATIC,24,42,49,8 + EDITTEXT IDC_NEWCREDS_CELL,83,40,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "¨Ï¥ÎªÌ¦WºÙ(&N)¡G",IDC_STATIC,24,60,59,8 + EDITTEXT IDC_NEWCREDS_USER,83,58,97,14,ES_AUTOHSCROLL + LTEXT "±K½X(&P)¡G",IDC_STATIC,23,78,34,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,83,76,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + DEFPUSHBUTTON "½T©w",IDOK,69,106,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,122,106,50,14 + PUSHBUTTON "»¡©ú",9,175,106,50,14 +END + +IDD_NEWCREDS_EXPIRE DIALOG DISCARDABLE 0, 0, 232, 155 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "¨ú±o·sªº AFS °O¸¹" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¦p­n¨ú±o·sªº AFS °O¸¹¡A½Ð¿é¤J±z AFS ±b¤áªº¨Ï¥ÎªÌ¦WºÙ»P±K½X¡C±z¥i¥H¦P®É¦b¦h­« AFS Cell ¤º¨ã¦³°O¸¹¡C", + IDC_STATIC,7,29,218,24 + LTEXT "AFS Cell (&C)¡G",IDC_STATIC,10,64,56,8 + EDITTEXT IDC_NEWCREDS_CELL,74,62,132,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "¨Ï¥ÎªÌ¦WºÙ(&N)¡G",IDC_STATIC,10,82,59,8 + EDITTEXT IDC_NEWCREDS_USER,74,80,97,14,ES_AUTOHSCROLL + LTEXT "±K½X(&P)¡G",IDC_STATIC,10,100,34,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,74,98,97,14,ES_PASSWORD | + ES_AUTOHSCROLL + LTEXT "±z¦b %1 Cell ªº°O¸¹§Y±N¹L´Á¡C",IDC_NEWCREDS_TITLE,7,7, + 218,16 + DEFPUSHBUTTON "½T©w",IDOK,69,134,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,122,134,50,14 + PUSHBUTTON "»¡©ú",9,175,134,50,14 +END + +IDD_TAB_MOUNT DIALOG DISCARDABLE 0, 0, 289, 81 +STYLE WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "±z¤w¿ï¾Ü±N¥H¤UªººÏºÐ¾÷¥N¸¹¹ïÀ³¦Ü AFS ¸ô®|¡G",IDC_TITLE, + 7,8,275,8 + PUSHBUTTON "·s¼W(&A)...",IDC_ADD,51,63,45,14 + PUSHBUTTON "Åܧó(&C)...",IDC_EDIT,99,63,45,14 + PUSHBUTTON "²¾°£(&R)",IDC_REMOVE,147,63,45,14 + CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_VSCROLL | + WS_TABSTOP | 0x1d3,51,21,231,37 + PUSHBUTTON "»¡©ú",9,237,63,45,14 +END + +IDD_WIZARD DIALOGEX 0, 0, 299, 177 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS ¥Î¤áºÝºëÆF" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "¤U¤@¨B(&N) >",IDNEXT,187,150,50,14 + PUSHBUTTON "¨ú®ø(&L)",IDCANCEL,242,150,50,14 + CONTROL "",IDC_LHS,"Static",SS_BLACKFRAME,7,7,76,119 + CONTROL "",IDC_RHS,"Static",SS_BLACKFRAME,97,7,195,119 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,138,285,1 + PUSHBUTTON "»¡©ú(&H)",9,79,150,50,14 + PUSHBUTTON "< ¤W¤@¨B(&B)",IDBACK,133,150,50,14 +END + +IDD_WIZ_START DIALOG DISCARDABLE 0, 0, 195, 119 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "©|¥¼±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v¡C",IDC_STATIC,4,6,173,8 + LTEXT "¦p­n±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v¡A½Ð«ö¡u¤U¤@¨B¡v¡C", + IDC_STATIC,4,79,185,8 + LTEXT "¦b°õ¦æ¡uAFS ¥Î¤áºÝªA°È¡v¤§«e¡A±z±NµLªk¨Ï¥ÎÀx¦s©ó AFS ¤ºªºÀɮסC", + IDC_STATIC,4,23,173,17 + LTEXT "¦p­n°±¤î°õ¦æ¡uAFS ¥Î¤áºÝªA°È¡v¡A½Ð«ö¡u¨ú®ø¡v¡C", + IDC_STATIC,4,94,186,17 +END + +IDD_WIZ_CREDS DIALOG DISCARDABLE 0, 0, 195, 119 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¥Ø«e¥¿¦b°õ¦æ¡uAFS ¥Î¤áºÝªA°È¡v¡A¦ý¬O±z©|¥¼¨ú±o¥ô¦ó¨Ï¥Î AFS ªº°O¸¹¡C", + IDC_STATIC,8,5,173,16 + CONTROL "¤£­n¨ú±o¥ô¦ó Cell ªº°O¸¹",IDC_NOCREDS,"Button", + BS_AUTORADIOBUTTON,8,28,141,10 + CONTROL "¨ú±o¥H¤U Cell ªº°O¸¹¡G",IDC_YESCREDS,"Button", + BS_AUTORADIOBUTTON,8,44,141,10 + LTEXT "AFS Cell (&C)¡G",IDC_STATIC,11,64,54,8 + EDITTEXT IDC_NEWCREDS_CELL,77,62,96,14,ES_LOWERCASE | + ES_AUTOHSCROLL + LTEXT "¨Ï¥ÎªÌ¦WºÙ(&N)¡G",IDC_STATIC,11,82,61,8 + EDITTEXT IDC_NEWCREDS_USER,77,80,96,14,ES_AUTOHSCROLL + LTEXT "±K½X(&P)¡G",IDC_STATIC,11,100,34,8 + EDITTEXT IDC_NEWCREDS_PASSWORD,77,97,96,14,ES_PASSWORD | + ES_AUTOHSCROLL +END + +IDD_WIZ_STARTING DIALOG DISCARDABLE 0, 0, 195, 119 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "½Ðµy­Ô¡F¥¿¦b±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v...",IDC_START_TRY,10, + 33,173,8 + LTEXT "µLªk±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v¡C\n\n\n½ÐÀˬd±zªººô¸ô³]©w¡A¨Ã¨Ï¥Î¡u±±¨î¥x¡vªº AFS ¹Ï¥Ü¨ÓÀˬd¦¹¹q¸£¡uAFS ¥Î¤áºÝ¡vªº¬[ºc¡C", + IDC_START_FAIL,9,21,164,55 +END + +IDD_WIZ_MOUNT DIALOG DISCARDABLE 0, 0, 195, 119 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¦p­n¦s¨úÀx¦s©ó AFS ¤ºªºÀɮסA±z¥²¶·±NºÏºÐ¾÷¥N¸¹¹ïÀ³¦Ü AFS ªº¸ô®|¤W¡C", + IDC_STATIC,6,4,173,16 + CONTROL "¤£­n±N¥ô¦óºÏºÐ¾÷¥N¸¹¹ïÀ³¨ì AFS ªº¸ô®|¤W(&D)",IDC_NOMAP, + "Button",BS_AUTORADIOBUTTON,5,23,179,10 + CONTROL "¦Ü¤Ö±N¤@­ÓºÏºÐ¾÷¥N¸¹¹ïÀ³¨ì AFS ªº¸ô®|¤W(&M)¡G", + IDC_YESMAP,"Button",BS_AUTORADIOBUTTON,6,40,178,10 + LTEXT "ºÏºÐ¾÷¥N¸¹(&L)¡G",IDC_STATIC,24,58,61,8 + COMBOBOX IDC_MAP_LETTER,85,56,48,125,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS ¸ô®|(&P)¡G",IDC_STATIC,24,76,58,8 + EDITTEXT IDC_MAP_PATH,85,74,96,14,ES_AUTOHSCROLL + LTEXT "µu¦WºÙ(&E)¡G",IDC_STATIC,24,94,38,8 + EDITTEXT IDC_MAP_DESC,85,92,60,14,ES_AUTOHSCROLL +END + +IDD_TERMINATE DIALOGEX 0, 0, 291, 117 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS ¥Î¤áºÝ" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + PUSHBUTTON "²¾°£¹Ï¥Ü(&R)",IDOK,167,96,63,14 + PUSHBUTTON "¨ú®ø(&L)",IDCANCEL,234,96,50,14 + LTEXT "±z¿ï¾Ü²¾°£¹q¸£¤u§@¦C¤Wªº¡uAFS ¥Î¤áºÝ¡v¹Ï¥Ü¡C°£«D¡uAFS ¥Î¤áºÝ¡v¹Ï¥Ü¥X²{¦b¹q¸£ªº¤u§@¦C¤W¡A§_«h·í AFS °O¸¹§Y±N¹L´Áªº®É­Ô¡AAFS µLªkĵ§i±z¡C", + IDC_STATIC,7,7,277,25 + LTEXT "¥Ø«e¥¿¦b°õ¦æ¡uAFS ¥Î¤áºÝªA°È¡v¡A±z¥i¥HÀH®É°±¤î³o­Óµ{¦¡¡C", + IDC_STATIC,7,41,277,8 + CONTROL "Ä~Äò°õ¦æ¡uAFS ¥Î¤áºÝªA°È¡v(&L)",IDC_LEAVE,"Button", + BS_AUTORADIOBUTTON,12,55,228,10 + CONTROL "°±¤î¡uAFS ¥Î¤áºÝªA°È¡v(&S)",IDC_STOP,"Button", + BS_AUTORADIOBUTTON,12,69,228,10 + CONTROL "¹q¸£­«·s±Ò°Ê®ÉÅã¥Ü¹Ï¥Ü(&H)",IDC_STARTUP,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,98,148,10 +END + +IDD_TERMINATE_SMALL DIALOGEX 0, 0, 291, 68 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS ¥Î¤áºÝ" +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + PUSHBUTTON "²¾°£¹Ï¥Ü(&R)",IDOK,167,47,63,14 + PUSHBUTTON "¨ú®ø(&L)",IDCANCEL,234,47,50,14 + LTEXT "±z¿ï¾Ü²¾°£¹q¸£¤u§@¦C¤Wªº¡uAFS ¥Î¤áºÝ¡v¹Ï¥Ü¡C°£«D¡uAFS ¥Î¤áºÝ¡v¹Ï¥Ü¥X²{¦b¹q¸£ªº¤u§@¦C¤W¡A§_«h·í AFS °O¸¹§Y±N¹L´Áªº®É­Ô¡AAFS ´NµLªkĵ§i±z¡C", + -1,7,7,277,25 + CONTROL "¹q¸£­«·s±Ò°Ê®ÉÅã¥Ü¹Ï¥Ü(&H)",IDC_STARTUP,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,49,148,10 +END + +IDD_TERMINATE_SMALL_95 DIALOGEX 0, 0, 291, 68 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "AFS Light " +FONT 9, "·s²Ó©úÅé", 0, 0, 0x1 +BEGIN + PUSHBUTTON "²¾°£¹Ï¥Ü(&R)",IDOK,167,47,63,14 + PUSHBUTTON "¨ú®ø(&L)",IDCANCEL,234,47,50,14 + LTEXT "±z¿ï¾Ü²¾°£¹q¸£¤u§@¦C¤Wªº¡uAFS Light ¡v¹Ï¥Ü¡C°£«D¡uAFS Light ¡v¹Ï¥Ü¥X²{¦b¹q¸£ªº¤u§@¦C¤W¡A§_«h·í AFS °O¸¹§Y±N¹L´Áªº®É­Ô¡AAFS ´NµLªkĵ§i±z¡C", + -1,7,7,277,25 + CONTROL "¹q¸£­«·s±Ò°Ê®ÉÅã¥Ü¹Ï¥Ü(&H)",IDC_STARTUP,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,49,148,10 +END + +IDD_WIZ_MOUNTING DIALOG DISCARDABLE 0, 0, 195, 119 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "±z©Ò¿ï¾Üªº¤@©Î¦h­ÓºÏºÐ¾÷¥N¸¹µLªk¹ïÀ³¦Ü AFS ¾A·íªº¸ô®|¤W¡C\n\n\n±z¥²¶·Ãö³¬¥Ø«e¥¿¸Õ¹Ï¨Ï¥Î AFS ¸ô®|ªºÀ³¥Îµ{¦¡¡C", + IDC_MAP_FAIL,10,23,177,50 + LTEXT "½Ðµy­Ô¡F¥¿¦b±NºÏºÐ¾÷¥N¸¹¹ïÀ³¨ì AFS ªº¸ô®|¤W...", + IDC_MAP_TRY,9,43,173,8 +END + +IDD_WIZ_FINISH DIALOG DISCARDABLE 0, 0, 195, 119 +STYLE DS_CONTROL | WS_CHILD +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "¡uAFS ¥Î¤áºÝ¡v¤w·Ç³Æ´Nºü¡C",IDC_STATIC,7,6,173,8 + LTEXT "¦p­nÃö³¬¦¹ºëÆF¡A½Ð«ö¤@¤U¡u§¹¦¨¡v¡C",IDC_STATIC,7,76,173, + 8 +END + +IDD_MAPPING DIALOG DISCARDABLE 0, 0, 275, 152 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "¹ïÀ³ºÏºÐ¾÷¥N¸¹" +FONT 9, "·s²Ó©úÅé" +BEGIN + LTEXT "±z¥i¥H±N¹q¸£¤WªººÏºÐ¾÷¥N¸¹¹ïÀ³¦Ü AFS ªº¸ô®|¤W¡C\n\n¨Ò¦p¡A¦pªG±z§â Q: ¹ïÀ³¬° \\afs\\acme.com\\usr\\bob¡A«h AFS \\afs\\acme.com\\usr\\bob\\* ¤WªºÀÉ®×´N·|¥X²{¦b Q¡G\\ ¤W ", + IDC_STATIC,7,7,261,32 + LTEXT "ºÏºÐ¾÷¥N¸¹(&L)¡G",IDC_STATIC,11,53,58,8 + COMBOBOX IDC_MAP_LETTER,69,51,56,162,CBS_DROPDOWNLIST | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "AFS ¸ô®|(&P)¡G",IDC_STATIC,11,70,50,8 + EDITTEXT IDC_MAP_PATH,69,68,166,13,ES_AUTOHSCROLL + LTEXT "µu¦WºÙ(&E)¡G",IDC_STATIC,11,88,49,8 + EDITTEXT IDC_MAP_DESC,69,86,60,13,ES_AUTOHSCROLL + CONTROL "¨C¦¸µn¤J®É§Y«ì´_¦¹¤@¹ïÀ³(&R)",IDC_MAP_PERSISTENT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,69,105,185,10 + DEFPUSHBUTTON "½T©w",IDOK,112,131,50,14 + PUSHBUTTON "¨ú®ø",IDCANCEL,165,131,50,14 + PUSHBUTTON "»¡©ú",9,218,131,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 299 + TOPMARGIN, 8 + BOTTOMMARGIN, 124 + END + + IDD_TAB_CREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_NOCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_TAB_ADVANCED, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_NEWCREDS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 120 + END + + IDD_NEWCREDS_EXPIRE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 225 + TOPMARGIN, 7 + BOTTOMMARGIN, 148 + END + + IDD_TAB_MOUNT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 282 + TOPMARGIN, 9 + BOTTOMMARGIN, 77 + END + + IDD_WIZARD, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 292 + TOPMARGIN, 7 + BOTTOMMARGIN, 170 + END + + IDD_WIZ_CREDS, DIALOG + BEGIN + RIGHTMARGIN, 174 + BOTTOMMARGIN, 111 + END + + IDD_WIZ_MOUNT, DIALOG + BEGIN + RIGHTMARGIN, 191 + BOTTOMMARGIN, 111 + END + + IDD_TERMINATE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 110 + END + + IDD_TERMINATE_SMALL, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 61 + END + + IDD_MAPPING, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 268 + TOPMARGIN, 7 + BOTTOMMARGIN, 145 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MENU_TRAYICON MENU DISCARDABLE +BEGIN + MENUITEM "Åã¥Ü°O¸¹(&S)...", M_ACTIVATE + MENUITEM "¹L´Á«e¥ýĵ§i(&W)", M_REMIND, CHECKED + MENUITEM SEPARATOR + MENUITEM "²¾°£¹Ï¥Ü(&R)", M_TERMINATE +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_WIZ16 BITMAP DISCARDABLE "wiz16.bmp" +IDB_WIZ256 BITMAP DISCARDABLE "wiz256.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP "AFS ¥Î¤áºÝ" + IDS_TOOLTIP_95 "AFS Light " + IDS_CREDENTIALS "°O¸¹" + IDS_UNKNOWN "¡]¤£©ú¡^" + IDS_ADVANCED "¶i¶¥" + IDS_CREDS "%1 ¡]°O¸¹¹L´Á %2¡^" + IDS_NO_CREDS "¡]±z¦b¦¹ Cell ¤¤¨S¦³°O¸¹¡^" + IDS_SERVICE_BROKEN "¡uAFS ¥Î¤áºÝªA°È¡v¦w¸Ë¤£·í¡A©ÎªÌ±z¨S¦³¬d¸ß¨äª¬ºAªºÅv­­¡C" + IDS_SERVICE_RUNNING "¡uAFS ¥Î¤áºÝªA°È¡v¥Ø«e°õ¦æ¥¿±`¡C" + IDS_SERVICE_STOPPED "¥Ø«e¤w°±¤î¡uAFS ¥Î¤áºÝªA°È¡v¡C" + IDS_SERVICE_STOPPING "½Ðµy­Ô¡F¥¿¦b°±¤î¡uAFS ¥Î¤áºÝªA°È¡v..." + IDS_SERVICE_STARTING "½Ðµy­Ô¡F¥¿¦b±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v..." + IDS_SERVICE_UNKNOWN "µLªk§PÂ_¡uAFS ¥Î¤áºÝªA°È¡vªºª¬ºA¡C" + IDS_SERVICE_FAIL_STOP "µLªk¶¶§Q°±¤î¡uAFS ¥Î¤áºÝªA°È¡v¡C±z¥i¯à¥¼Àò±o°õ¦æ¦¹¤@§@·~ªºÅv­­¡C\n\n¿ù»~ 0x%1¡C" + IDS_SERVICE_FAIL_START "µLªk¶¶§Q±Ò°Ê¡uAFS ¥Î¤áºÝªA°È¡v¡C±z¥i¯à¥¼Àò±o°õ¦æ¦¹¤@§@·~ªºÅv­­¡C\n\n¿ù»~ 0x%1¡C" + IDS_SERVICE_FAIL_CONFIG "µLªkÅܧó¡uAFS ¥Î¤áºÝªA°È¡vªº±Ò°Ê°Ñ¼Æ¡C±zªºÅv­­¤£¨¬¥H°õ¦æ¦¹¶µ§@·~¡C\n\n¿ù»~ 0x%1¡C" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SERVICE_ERROR "¬[ºcªA°È®Éµo¥Í¿ù»~" + IDS_ERROR_TITLE "¿ù»~ - AFS ¥Î¤áºÝ" + IDS_ERROR_TITLE_95 "¿ù»~ - AFS Light " + IDS_ERROR_DESTROY_95 "µLªk¾P·´±z¦b %1 Cell ¤¤ªº°O¸¹¡C\n\n¿ù»~¡G %2 " + IDS_ERROR_DESTROY_NOCM "±z¦b %1 Cell ¤¤ªº°O¸¹µLªk¾P·´¡A¦]¬°¡uAFS ¥Î¤áºÝªA°È¡v¨S¦³¦^À³¡C\n\n½ÐÀˬd¡u¶i¶¥¡v¼ÐÅÒ¡A¬d¬Ý¡uAFS ¥Î¤áºÝ¡v¬O§_¥¿±`°õ¦æ¡C\n\n¿ù»~¡G %2" + IDS_ERROR_DESTROY_UNKNOWN + "±z¦b %1 Cell ¤¤ªº°O¸¹µLªk¾P·´¡C\n\n½ÐÀˬd¡u¶i¶¥¡v¼ÐÅÒ¡A¬d¬Ý¡u AFS ¥Î¤áºÝ¡v¬O§_¥¿±`°õ¦æ¡C\n\n¿ù»~¡G %2" + IDS_ERROR_OBTAIN "¡uAFS ¥Î¤áºÝ¡vµLªk¦b Cell %1 ¤¤¨ú±o %2 ªº°O¸¹¡C\n\n¿ù»~¡G %4 (%3)" + IDS_ERROR_OBTAIN_95 "¡uAFS Light ¡vµLªk¦b Cell %1 ¤¤¨ú±o %2 ªº°O¸¹¡C\n\n¿ù»~¡G %4 (%3)" + IDS_TITLE_VERSION "AFS ª©¥» %s" + IDS_TITLE_VERSION_NOPATCH "AFS ª©¥» %s" + IDS_MOUNT_SOME "±z¤w¿ï¾Ü±N¥H¤UªººÏºÐ¾÷¥N¸¹¹ïÀ³¦Ü AFS ¸ô®|¡G" + IDS_MOUNT_NONE "±z©|¥¼¿ï¾Ü¹ïÀ³ºÏºÐ¾÷¥N¸¹¦Ü AFS ªº¸ô®|¤W¡C" + IDS_MOUNT "ºÏºÐ¾÷¥N¸¹" + IDS_WIZ_NEXT "¤U¤@¨B(&N) >" + IDS_WIZ_FINISH "§¹¦¨(&F)" + IDS_MAP_LETTER "ºÏºÐ¾÷ *:" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DRIVE_MAP "ºÏºÐ¾÷ %1: \t%2" + IDS_ERROR_MAP "¹ïÀ³ºô¸ôºÏºÐ¾÷®Éµo¥Í¿ù»~" + IDS_ERROR_MAP_DESC "AFS µLªk¹ïÀ³ºô¸ôºÏºÐ¾÷¨ì AFS ¤Wªº«ü©w¸ô®|¡C½Ð½T©w¥Ø«e¨Ã¥¼¨Ï¥Î¸ÓºÏºÐ¾÷¥N¸¹¡C\n\n¿ù»~¡G 0x%1¡C" + IDS_ERROR_UNMAP "¹ïÀ³ºô¸ôºÏºÐ¾÷®Éµo¥Í¿ù»~" + IDS_ERROR_UNMAP_DESC "AFS µLªk¨ú®ø¹ïÀ³«ü©wªººô¸ôºÏºÐ¾÷¡C½Ð½T©w¥Ø«e¨Ã¥¼¨Ï¥Î¸ÓºÏºÐ¾÷¥N¸¹¡C\n\n¿ù»~¡G 0x%1¡C" + IDS_CELL_GATEWAY "%s ¡]³z¹L¹h¹D %s¡^" + IDS_BADMAP_TITLE "¹ïÀ³ºô¸ôºÏºÐ¾÷®Éµo¥Í¿ù»~" + IDS_BADMAP_DESC "AFS µLªk¹ïÀ³ºÏºÐ¾÷¥N¸¹¨ì«ü©w¸ô®|¡A¦]¬°¸ô®|¨Ã«D¥H ""\\afs"" ¬°¶}ÀY¡C\n\n½Ð½T©w±z©Ò¿é¤Jªº¸ô®|¶}ÀY¬° ""\\afs""¡AµM«á¦A¸Õ¤@¦¸¡C" + IDS_UNCONFIG_TITLE_95 "¿ù»~ - AFS Light " + IDS_UNCONFIG_DESC_95 "©|¥¼¬[ºc¡uAFS Light ¡v¡A¦]¦¹µLªk¨Ï¥Î¡C\n\n¦p­n¬[ºc¡uAFS Light ¡v¡A½Ð¶}±Ò¡u±±¨î¥x¡v¡A¨Ã¦b¡uAFS Light ¬[ºc¡v¹Ï¥Ü¤W«ö¨â¤U¡C" + IDS_UNCONFIG_TITLE "¿ù»~ - AFS ¥Î¤áºÝ" + IDS_UNCONFIG_DESC "©|¥¼¬[ºc¡uAFS ¥Î¤áºÝ¡v¡A¦]¦¹µLªk¨Ï¥Î¡C\n\n¦p­n¬[ºc¡uAFS ¥Î¤áºÝ¡v¡A½Ð¶}±Ò¡u¥D±±¥x¡v¨Ã¦b¡uAFS ¥Î¤áºÝ¡v¹Ï¥Ü¤W«ö¨â¤U¡C" + IDS_NEWSUB_TITLE "ĵ§i - AFS ¥Î¤áºÝ" + IDS_NEWSUB_TITLE_95 "ĵ§i - AFS Light " + IDS_NEWSUB_DESC "AFS ¦b³s±µºô¸ôºÏºÐ¾÷®É¡AµLªk¨Ï¥Î±z©Ò«ü©wªº»¡©ú¡C \n\n\n©Ò«ü©wªº»¡©ú¤w¥Î©ó¤£¦Pªº AFS ¸ô®|¡C" + IDS_BADSUB_TITLE "¿ù»~ - AFS ¥Î¤áºÝ" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BADSUB_TITLE_95 "¿ù»~ - AFS Light " + IDS_BADSUB_DESC "±z©Ò¿é¤JªººÏºÐ¾÷¥N¸¹»¡©úµLªk¨Ï¥Î¡C\n\nºÏºÐ¾÷¥N¸¹»¡©ú³Ì¦h¤£¯à¶W¹L 12 ­Ó¦r¤¸¡A¦Ó¥B¤£¥i¥]§tªÅ®æ©Î¼ÐÄæ¡C" + IDS_TITLE_95 "AFS Light " +END + +#endif // Chinese (Taiwan) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/client_creds/main.cpp b/src/WINNT/client_creds/main.cpp index 747c32dd2..8c80613cd 100644 --- a/src/WINNT/client_creds/main.cpp +++ b/src/WINNT/client_creds/main.cpp @@ -10,6 +10,11 @@ extern "C" { #include #include +#include +#include +#include +#include +#include "ipaddrchg.h" } #include "afscreds.h" @@ -17,8 +22,6 @@ extern "C" { #include "drivemap.h" #include #include -#include -#include "rxkad.h" /* * DEFINITIONS ________________________________________________________________ @@ -53,11 +56,15 @@ BOOL IsServerInstalled (void); * */ -int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR pCmdLine, int nCmdShow) +extern "C" int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR pCmdLine, int nCmdShow) { Shortcut_Init(); TaLocale_LoadCorrespondingModule (hInst); + osi_InitTraceOption(); + osi_LogEvent0("AFSCreds Main command line",pCmdLine); + fs_utils_InitMountRoot(); + if (InitApp (pCmdLine)) { MSG msg; @@ -83,6 +90,14 @@ BOOL InitApp (LPSTR pszCmdLineA) BOOL fExit = FALSE; BOOL fInstall = FALSE; BOOL fUninstall = FALSE; + BOOL fAutoInit = FALSE; + BOOL fNetDetect = FALSE; + BOOL fRenewMaps = FALSE; + + // Initialize our global variables and window classes + // + memset (&g, 0x00, sizeof(g)); + g.fStartup = TRUE; // Parse the command-line // @@ -93,6 +108,21 @@ BOOL InitApp (LPSTR pszCmdLineA) switch (*(++pszCmdLineA)) { + case 'a': + case 'A': + fAutoInit = TRUE; + break; + + case 'm': + case 'M': + fRenewMaps = TRUE; + break; + + case 'n': + case 'N': + fNetDetect = TRUE; + break; + case 's': case 'S': fShow = TRUE; @@ -117,24 +147,22 @@ BOOL InitApp (LPSTR pszCmdLineA) case 'U': fUninstall = TRUE; break; + case ':': + CopyAnsiToString(g.SmbName,pszCmdLineA); MapShareName(pszCmdLineA); break; + + case 'z': + case 'Z': + DoUnMapShare(TRUE); + return(0); + case 'x': case 'X': - DWORD LogonOption; - DWORD LSPtype, LSPsize; - HKEY NPKey; - LSPsize=sizeof(LogonOption); - (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PROVIDER_KEY, - 0, KEY_QUERY_VALUE, &NPKey); - RegQueryValueEx(NPKey, "LogonOptions", NULL, - &LSPtype, (LPBYTE)&LogonOption, &LSPsize); - RegCloseKey (NPKey); - if (ISHIGHSECURITY(LogonOption)) - DoMapShare(); - GlobalMountDrive(); - return 0; + TestAndDoMapShare(SERVICE_START_PENDING); + TestAndDoMapShare(SERVICE_RUNNING); + return 0; } while (*pszCmdLineA && (*pszCmdLineA != ' ')) @@ -150,7 +178,7 @@ BOOL InitApp (LPSTR pszCmdLineA) if (fInstall) { HKEY hk; - if (RegCreateKey (HKEY_LOCAL_MACHINE, TEXT("System\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"), &hk) == 0) + if (RegCreateKey (HKEY_CURRENT_USER, REGSTR_PATH_OPENAFS_CLIENT, &hk) == 0) { DWORD dwSize = sizeof(g.fStartup); DWORD dwType = REG_DWORD; @@ -184,13 +212,15 @@ BOOL InitApp (LPSTR pszCmdLineA) if (fExit || fUninstall || fInstall) return FALSE; - // Initialize our global variables and window classes - // - memset (&g, 0x00, sizeof(g)); - g.fStartup = TRUE; - HKEY hk; - if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("System\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"), &hk) == 0) + if (RegOpenKey (HKEY_CURRENT_USER, REGSTR_PATH_OPENAFS_CLIENT, &hk) == 0) + { + DWORD dwSize = sizeof(g.fStartup); + DWORD dwType = REG_DWORD; + RegQueryValueEx (hk, TEXT("ShowTrayIcon"), NULL, &dwType, (PBYTE)&g.fStartup, &dwSize); + RegCloseKey (hk); + } + else if (RegOpenKey (HKEY_LOCAL_MACHINE, REGSTR_PATH_OPENAFS_CLIENT, &hk) == 0) { DWORD dwSize = sizeof(g.fStartup); DWORD dwType = REG_DWORD; @@ -220,6 +250,57 @@ BOOL InitApp (LPSTR pszCmdLineA) InitCommonControls(); RegisterCheckListClass(); + osi_Init(); + lock_InitializeMutex(&g.expirationCheckLock, "expiration check lock"); + lock_InitializeMutex(&g.credsLock, "global creds lock"); + + KFW_AFS_wait_for_service_start(); + + if ( IsDebuggerPresent() ) { + if ( !g.fIsWinNT ) + OutputDebugString("No Service Present on non-NT systems\n"); + else { + if ( IsServiceRunning() ) + OutputDebugString("AFSD Service started\n"); + else { + OutputDebugString("AFSD Service stopped\n"); + if ( !IsServiceConfigured() ) + OutputDebugString("AFSD Service not configured\n"); + else if ( fAutoInit ) + OutputDebugString("AFSD Service will be started\n"); + } + } + } + + // If the service isn't started yet, and autoInit start the service + if ( g.fIsWinNT && !IsServiceRunning() && IsServiceConfigured() && fAutoInit ) { + SC_HANDLE hManager; + + if ((hManager = OpenSCManager( NULL, NULL, + SC_MANAGER_CONNECT | + SC_MANAGER_ENUMERATE_SERVICE | + SC_MANAGER_QUERY_LOCK_STATUS)) != NULL ) + { + SC_HANDLE hService; + if ((hService = OpenService( hManager, TEXT("TransarcAFSDaemon"), + SERVICE_QUERY_STATUS | SERVICE_START) ) != NULL) + { + if (StartService(hService, 0, 0)) { + if ( IsDebuggerPresent() ) + OutputDebugString("AFSD Service start successful\n"); + fRenewMaps = TRUE; + } else if ( IsDebuggerPresent() ) + OutputDebugString("AFSD Service start failed\n"); + + CloseServiceHandle (hService); + } + + CloseServiceHandle (hManager); + } + KFW_AFS_wait_for_service_start(); + } + + KFW_initialize(); // Create a main window. All further initialization will be done during // processing of WM_INITDIALOG. @@ -248,17 +329,43 @@ BOOL InitApp (LPSTR pszCmdLineA) else if (!IsServerInstalled()) Message (MB_ICONHAND, IDS_UNCONFIG_TITLE, IDS_UNCONFIG_DESC); } - if (IsServiceRunning() && fShow) + if (IsServiceRunning()) { + if ( fRenewMaps ) { + if ( IsDebuggerPresent() ) + OutputDebugString("Renewing Drive Maps\n"); + DoMapShare(); + } + if (fShow) + { + if ( IsDebuggerPresent() ) + OutputDebugString("Displaying Main window\n"); Main_Show (TRUE); } - - return TRUE; + // If the root cell is reachable and we have no tokens + // display the Obtain Tokens dialog to the user + if ( fAutoInit ) { + if ( IsDebuggerPresent() ) + OutputDebugString("Obtaining Tokens (if needed)\n"); + ObtainTokensFromUserIfNeeded(g.hMain); + } + } else if ( IsDebuggerPresent() ) + OutputDebugString("AFSD Service Stopped\n"); + + if ( fNetDetect ) { + // Start IP Address Change Monitor + if ( IsDebuggerPresent() ) + OutputDebugString("Activating Network Change Monitor\n"); + IpAddrChangeMonitorInit(g.hMain); + } + Main_EnableRemindTimer(TRUE); + return TRUE; } void ExitApp (void) { + KFW_cleanup(); g.hMain = NULL; } diff --git a/src/WINNT/client_creds/misc.cpp b/src/WINNT/client_creds/misc.cpp index 5251e9b30..b06ece55e 100644 --- a/src/WINNT/client_creds/misc.cpp +++ b/src/WINNT/client_creds/misc.cpp @@ -57,7 +57,7 @@ void LoadRemind (size_t iCreds) g.aCreds[ iCreds ].fRemind = TRUE; HKEY hk; - if (RegOpenKey (REGSTR_BASE, REGSTR_PATH_AFSCREDS, &hk) == 0) + if (RegOpenKey (HKEY_CURRENT_USER, REGSTR_PATH_OPENAFS_CLIENT_REMIND, &hk) == 0) { DWORD dwValue = 1; DWORD dwSize = sizeof(dwValue); @@ -72,7 +72,7 @@ void LoadRemind (size_t iCreds) void SaveRemind (size_t iCreds) { HKEY hk; - if (RegCreateKey (REGSTR_BASE, REGSTR_PATH_AFSCREDS, &hk) == 0) + if (RegCreateKey (HKEY_CURRENT_USER, REGSTR_PATH_OPENAFS_CLIENT_REMIND, &hk) == 0) { DWORD dwValue = g.aCreds[ iCreds ].fRemind; RegSetValueEx (hk, g.aCreds[ iCreds ].szCell, NULL, REG_DWORD, (PBYTE)&dwValue, sizeof(DWORD)); diff --git a/src/WINNT/client_creds/mounttab.cpp b/src/WINNT/client_creds/mounttab.cpp index fafb15899..d82a81b7b 100644 --- a/src/WINNT/client_creds/mounttab.cpp +++ b/src/WINNT/client_creds/mounttab.cpp @@ -10,6 +10,7 @@ extern "C" { #include #include +#include } #include "afscreds.h" @@ -114,6 +115,7 @@ void Mount_OnInitDialog (HWND hDlg) void Mount_OnUpdate (HWND hDlg, BOOL fOnInitDialog) { DRIVEMAPLIST List; + memset(&List, 0, sizeof(DRIVEMAPLIST)); QueryDriveMapList (&List); HWND hList = GetDlgItem (hDlg, IDC_LIST); @@ -193,6 +195,7 @@ void Mount_OnCheck (HWND hDlg) Message (MB_OK | MB_ICONHAND, IDS_ERROR_UNMAP, IDS_ERROR_UNMAP_DESC, TEXT("%08lX"), dwStatus); Mount_OnUpdate (hDlg); } + WriteActiveMap(List.aDriveMap[ iDriveSel ].chDrive, fChecked && List.aDriveMap[ iDriveSel ].fPersistent ); } FreeDriveMapList (&List); @@ -226,7 +229,7 @@ void Mount_OnRemove (HWND hDlg) Mount_OnUpdate (hDlg); } - + WriteActiveMap(List.aDriveMap[ iDriveSel ].chDrive, FALSE ); FreeDriveMapList (&List); } } @@ -419,7 +422,13 @@ void Mapping_OnInitDialog (HWND hDlg) SendMessage (hCombo, CB_SETCURSEL, iItemSel, 0); TCHAR szMapping[ MAX_PATH ]; - AdjustAfsPath (szMapping, ((pMap->szMapping[0]) ? pMap->szMapping : TEXT("/afs")), TRUE, FALSE); + AdjustAfsPath (szMapping, ((pMap->szMapping[0]) ? pMap->szMapping : cm_slash_mount_root), TRUE, FALSE); + CHAR msg[256], msgf[256]; + if (GetDlgItemText(hDlg,IDC_STATICSUBMOUNT,(LPSTR)msg,sizeof(msg)-1)>0) + { + wsprintf(msgf,msg,cm_back_slash_mount_root,cm_back_slash_mount_root); + SetDlgItemText (hDlg, IDC_STATICSUBMOUNT, msgf); + } SetDlgItemText (hDlg, IDC_MAP_PATH, szMapping); SetDlgItemText (hDlg, IDC_MAP_DESC, pMap->szSubmount); @@ -448,13 +457,14 @@ void Mapping_OnOK (HWND hDlg) return; } - if ( (lstrncmpi (pMap->szMapping, TEXT("/afs"), lstrlen(TEXT("/afs")))) && - (lstrncmpi (pMap->szMapping, TEXT("\\afs"), lstrlen(TEXT("\\afs")))) ) - { - Message (MB_ICONHAND, IDS_BADMAP_TITLE, IDS_BADMAP_DESC); - return; - } + if ( (lstrncmpi (pMap->szMapping, cm_slash_mount_root, lstrlen(cm_slash_mount_root))) && /*TEXT("/afs")*/ + (lstrncmpi (pMap->szMapping, cm_back_slash_mount_root, lstrlen(cm_back_slash_mount_root))) ) /*TEXT("\\afs")*/ + { + Message (MB_ICONHAND, IDS_BADMAP_TITLE, IDS_BADMAP_DESC); + return; + } + WriteActiveMap(pMap->chDrive, pMap->fPersistent); EndDialog (hDlg, IDOK); } diff --git a/src/WINNT/client_creds/resource.h b/src/WINNT/client_creds/resource.h index e80c45668..3a1aeef63 100644 --- a/src/WINNT/client_creds/resource.h +++ b/src/WINNT/client_creds/resource.h @@ -7,57 +7,58 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#define IDS_TOOLTIP 1 -#define IDS_CREDENTIALS 2 -#define IDS_UNKNOWN 3 -#define IDS_ADVANCED 4 -#define IDS_CREDS 5 -#define IDS_NO_CREDS 6 -#define IDS_SERVICE_BROKEN 9 -#define IDS_SERVICE_RUNNING 10 -#define IDS_SERVICE_STOPPED 11 -#define IDS_SERVICE_STOPPING 12 -#define IDS_SERVICE_STARTING 13 -#define IDS_SERVICE_UNKNOWN 14 -#define IDS_SERVICE_FAIL_STOP 15 -#define IDS_SERVICE_FAIL_START 16 -#define IDS_SERVICE_FAIL_CONFIG 17 -#define IDS_SERVICE_ERROR 18 -#define IDS_ERROR_TITLE 19 -#define IDS_ERROR_DESTROY_NOCM 20 -#define IDS_ERROR_DESTROY_UNKNOWN 21 -#define IDS_ERROR_OBTAIN 22 -#define IDS_TITLE_VERSION 23 -#define IDS_TITLE_VERSION_NOPATCH 24 -#define IDS_MOUNT_SOME 25 -#define IDS_MOUNT_NONE 26 -#define IDS_MOUNT 27 -#define IDS_WIZ_NEXT 28 -#define IDS_WIZ_FINISH 29 -#define IDS_MAP_LETTER 30 -#define IDS_DRIVE_MAP 31 -#define IDS_ERROR_MAP 32 -#define IDS_ERROR_MAP_DESC 33 -#define IDS_ERROR_UNMAP 34 -#define IDS_ERROR_UNMAP_DESC 35 -#define IDS_CELL_GATEWAY 36 -#define IDS_BADMAP_TITLE 37 -#define IDS_BADMAP_DESC 38 -#define IDS_UNCONFIG_TITLE 39 -#define IDS_UNCONFIG_DESC 40 -#define IDS_NEWSUB_TITLE 41 -#define IDS_NEWSUB_DESC 42 -#define IDS_BADSUB_TITLE 43 -#define IDS_BADSUB_DESC 44 -#define IDS_TITLE_95 45 -#define IDS_TOOLTIP_95 46 -#define IDS_ERROR_TITLE_95 48 -#define IDS_ERROR_DESTROY_95 49 -#define IDS_ERROR_OBTAIN_95 50 -#define IDS_UNCONFIG_TITLE_95 51 -#define IDS_UNCONFIG_DESC_95 52 -#define IDS_NEWSUB_TITLE_95 53 -#define IDS_BADSUB_TITLE_95 54 +#define IDS_TOOLTIP 0 +#define IDS_TOOLTIP_95 1 +#define IDS_CREDENTIALS 2 +#define IDS_UNKNOWN 3 +#define IDS_ADVANCED 4 +#define IDS_CREDS 5 +#define IDS_NO_CREDS 6 +#define IDS_SERVICE_BROKEN 7 +#define IDS_SERVICE_RUNNING 8 +#define IDS_SERVICE_STOPPED 9 +#define IDS_SERVICE_STOPPING 10 +#define IDS_SERVICE_STARTING 11 +#define IDS_SERVICE_UNKNOWN 12 +#define IDS_SERVICE_FAIL_STOP 13 +#define IDS_SERVICE_FAIL_START 14 +#define IDS_SERVICE_FAIL_CONFIG 15 +#define IDS_SERVICE_ERROR 16 +#define IDS_ERROR_TITLE 17 +#define IDS_ERROR_TITLE_95 18 +#define IDS_ERROR_DESTROY_95 19 +#define IDS_ERROR_DESTROY_NOCM 20 +#define IDS_ERROR_DESTROY_UNKNOWN 21 +#define IDS_ERROR_OBTAIN 22 +#define IDS_ERROR_OBTAIN_95 23 +#define IDS_TITLE_VERSION 24 +#define IDS_TITLE_VERSION_NOPATCH 25 +#define IDS_MOUNT_SOME 26 +#define IDS_MOUNT_NONE 27 +#define IDS_MOUNT 28 +#define IDS_WIZ_NEXT 29 +#define IDS_WIZ_FINISH 30 +#define IDS_MAP_LETTER 31 +#define IDS_DRIVE_MAP 32 +#define IDS_ERROR_MAP 33 +#define IDS_ERROR_MAP_DESC 34 +#define IDS_ERROR_UNMAP 35 +#define IDS_ERROR_UNMAP_DESC 36 +#define IDS_CELL_GATEWAY 37 +#define IDS_BADMAP_TITLE 38 +#define IDS_BADMAP_DESC 39 +#define IDS_UNCONFIG_TITLE_95 40 +#define IDS_UNCONFIG_DESC_95 41 +#define IDS_UNCONFIG_TITLE 42 +#define IDS_UNCONFIG_DESC 43 +#define IDS_NEWSUB_TITLE 44 +#define IDS_NEWSUB_TITLE_95 45 +#define IDS_NEWSUB_DESC 46 +#define IDS_BADSUB_TITLE 47 +#define IDS_BADSUB_TITLE_95 48 +#define IDS_BADSUB_DESC 49 +#define IDS_TITLE_95 50 + #define IDI_MAIN 100 #define IDD_MAIN 101 #define IDD_TAB_CREDS 102 @@ -83,6 +84,7 @@ #define IDD_WIZ_FINISH 119 #define IDD_MAPPING 120 #define IDD_TERMINATE_SMALL_95 121 +#define IDD_AUTH 122 #define M_TERMINATE 3000 #define M_ACTIVATE 3001 #define M_REMIND 3002 @@ -133,6 +135,7 @@ #define IDC_MAP_PERSISTENT 5049 #define IDC_RUNNING 5050 #define IDC_STOPPED 5051 +#define IDC_STATICSUBMOUNT 5052 #define IDC_STATIC -1 // Next default values for new objects diff --git a/src/WINNT/client_creds/shortcut.cpp b/src/WINNT/client_creds/shortcut.cpp index 2b83e70cd..6bce0c72b 100644 --- a/src/WINNT/client_creds/shortcut.cpp +++ b/src/WINNT/client_creds/shortcut.cpp @@ -13,11 +13,15 @@ extern "C" { } #include +#include #include #include #undef INITGUID #include #include +#include +#include +#include "afscreds.h" #include "shortcut.h" @@ -37,8 +41,7 @@ void Shortcut_Exit (void) CoUninitialize(); } - -BOOL Shortcut_Create (LPTSTR pszTarget, LPCTSTR pszSource, LPTSTR pszDesc) +BOOL Shortcut_Create (LPTSTR pszTarget, LPCTSTR pszSource, LPTSTR pszDesc, LPTSTR pszArgs) { IShellLink *psl; HRESULT rc = CoCreateInstance (CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&psl); @@ -54,13 +57,18 @@ BOOL Shortcut_Create (LPTSTR pszTarget, LPCTSTR pszSource, LPTSTR pszDesc) rc = psl->SetDescription (pszDesc ? pszDesc : pszSource); if (SUCCEEDED (rc)) { + if ( pszArgs ) + rc = psl->SetArguments (pszArgs); + if (SUCCEEDED (rc)) + { #ifdef UNICODE - rc = ppf->Save (pszTarget, TRUE); + rc = ppf->Save (pszTarget, TRUE); #else - WORD wsz[ MAX_PATH ]; - MultiByteToWideChar (CP_ACP, 0, pszTarget, -1, wsz, MAX_PATH); - rc = ppf->Save (wsz, TRUE); + WORD wsz[ MAX_PATH ]; + MultiByteToWideChar (CP_ACP, 0, pszTarget, -1, wsz, MAX_PATH); + rc = ppf->Save (wsz, TRUE); #endif + } } } ppf->Release (); @@ -73,7 +81,7 @@ BOOL Shortcut_Create (LPTSTR pszTarget, LPCTSTR pszSource, LPTSTR pszDesc) void Shortcut_FixStartup (LPCTSTR pszLinkName, BOOL fAutoStart) { - TCHAR szShortcut[ MAX_PATH ] = TEXT(""); + TCHAR szShortcut[ MAX_PATH + 10 ] = TEXT(""); HKEY hk; if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"), &hk) == 0) @@ -101,12 +109,27 @@ void Shortcut_FixStartup (LPCTSTR pszLinkName, BOOL fAutoStart) GetModuleFileName (GetModuleHandle(NULL), szSource, MAX_PATH); if (fAutoStart) - { - Shortcut_Create (szShortcut, szSource); - } + { + DWORD code, len, type; + TCHAR szParams[ 64 ] = TEXT(AFSCREDS_SHORTCUT_OPTIONS); + + code = RegOpenKeyEx(HKEY_CURRENT_USER, REGSTR_PATH_OPENAFS_CLIENT, + 0, KEY_QUERY_VALUE, &hk); + if (code != ERROR_SUCCESS) + code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGSTR_PATH_OPENAFS_CLIENT, + 0, KEY_QUERY_VALUE, &hk); + if (code == ERROR_SUCCESS) { + len = sizeof(szParams); + type = REG_SZ; + code = RegQueryValueEx(hk, "AfscredsShortcutParams", NULL, &type, + (BYTE *) &szParams, &len); + RegCloseKey (hk); + } + Shortcut_Create (szShortcut, szSource, "Autostart Authentication Agent", szParams); + } else // (!g.fAutoStart) - { + { DeleteFile (szShortcut); - } + } } diff --git a/src/WINNT/client_creds/shortcut.h b/src/WINNT/client_creds/shortcut.h index 12d165e67..ae82d5de9 100644 --- a/src/WINNT/client_creds/shortcut.h +++ b/src/WINNT/client_creds/shortcut.h @@ -18,7 +18,7 @@ void Shortcut_Init (void); void Shortcut_Exit (void); -BOOL Shortcut_Create (LPTSTR pszTarget, LPCTSTR pszSource, LPTSTR pszDesc = NULL); +BOOL Shortcut_Create (LPTSTR pszTarget, LPCTSTR pszSource, LPTSTR pszDesc = NULL, LPTSTR pszArgs = NULL); void Shortcut_FixStartup (LPCTSTR pszLinkName, BOOL fAutoStart); diff --git a/src/WINNT/client_creds/trayicon.cpp b/src/WINNT/client_creds/trayicon.cpp index 10a4c53c1..c07a846c6 100644 --- a/src/WINNT/client_creds/trayicon.cpp +++ b/src/WINNT/client_creds/trayicon.cpp @@ -44,7 +44,9 @@ void ChangeTrayIcon (int nim) nid.uID = 0; nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; nid.uCallbackMessage = WM_TRAYICON; + lock_ObtainMutex(&g.credsLock); nid.hIcon = ((g.cCreds != 0) && (iExpired == (size_t)-1)) ? ICON_CREDS_YES : ICON_CREDS_NO; + lock_ReleaseMutex(&g.credsLock); GetString (nid.szTip, (g.fIsWinNT) ? IDS_TOOLTIP : IDS_TOOLTIP_95); Shell_NotifyIcon (nim, &nid); } diff --git a/src/WINNT/client_creds/window.cpp b/src/WINNT/client_creds/window.cpp index 35cf864d0..73ae6daaf 100644 --- a/src/WINNT/client_creds/window.cpp +++ b/src/WINNT/client_creds/window.cpp @@ -10,11 +10,12 @@ extern "C" { #include #include +#include +#include "ipaddrchg.h" } #include "afscreds.h" - /* * DEFINITIONS ________________________________________________________________ * @@ -162,11 +163,13 @@ BOOL CALLBACK Main_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) InsertMenu (hmDummy, 0, MF_POPUP, (UINT)hm, NULL); BOOL fRemind = FALSE; + lock_ObtainMutex(&g.credsLock); for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds) { if (g.aCreds[ iCreds ].fRemind) fRemind = TRUE; } + lock_ReleaseMutex(&g.credsLock); CheckMenuItem (hm, M_REMIND, MF_BYCOMMAND | ((fRemind) ? MF_CHECKED : MF_UNCHECKED)); TrackPopupMenu (GetSubMenu (hmDummy, 0), @@ -182,6 +185,41 @@ BOOL CALLBACK Main_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) break; } break; + case WM_OBTAIN_TOKENS: + if ( InterlockedIncrement (&g.fShowingMessage) != 1 ) + InterlockedDecrement (&g.fShowingMessage); + else + ShowObtainCreds (wp, (char *)lp); + GlobalFree((void *)lp); + break; + + case WM_START_SERVICE: + { + SC_HANDLE hManager; + if ((hManager = OpenSCManager ( NULL, NULL, + SC_MANAGER_CONNECT | + SC_MANAGER_ENUMERATE_SERVICE | + SC_MANAGER_QUERY_LOCK_STATUS)) != NULL) + { + SC_HANDLE hService; + if ((hService = OpenService ( hManager, TEXT("TransarcAFSDaemon"), + SERVICE_QUERY_STATUS | SERVICE_START)) != NULL) + { + if (StartService (hService, 0, 0)) + TestAndDoMapShare(SERVICE_START_PENDING); + if ( KFW_is_available() && KFW_AFS_wait_for_service_start() ) { + KFW_AFS_renew_tokens_for_all_cells(); + } + + CloseServiceHandle (hService); + } + + CloseServiceHandle (hManager); + } + KFW_AFS_wait_for_service_start(); + ObtainTokensFromUserIfNeeded(g.hMain); + } + break; } return FALSE; @@ -232,25 +270,36 @@ void Main_OnInitDialog (HWND hDlg) } BOOL fFoundUserName = FALSE; - if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"), &hk) == 0) - { - DWORD dwSize = sizeof(szUser); - DWORD dwType = REG_SZ; - if (RegQueryValueEx (hk, TEXT("DefaultUserName"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0) - fFoundUserName = TRUE; - RegCloseKey (hk); - } - if (!fFoundUserName) - { - if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Network\\Logon"), &hk) == 0) - { - DWORD dwSize = sizeof(szUser); - DWORD dwType = REG_SZ; - if (RegQueryValueEx (hk, TEXT("UserName"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0) + if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Explorer"), &hk) == 0) + { + DWORD dwSize = sizeof(szUser); + DWORD dwType = REG_SZ; + if (RegQueryValueEx (hk, TEXT("Logon User Name"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0) fFoundUserName = TRUE; - RegCloseKey (hk); - } - } + RegCloseKey (hk); + } + if (!fFoundUserName ) + { + if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"), &hk) == 0) + { + DWORD dwSize = sizeof(szUser); + DWORD dwType = REG_SZ; + if (RegQueryValueEx (hk, TEXT("DefaultUserName"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0) + fFoundUserName = TRUE; + RegCloseKey (hk); + } + } + if (!fFoundUserName) + { + if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("Network\\Logon"), &hk) == 0) + { + DWORD dwSize = sizeof(szUser); + DWORD dwType = REG_SZ; + if (RegQueryValueEx (hk, TEXT("UserName"), NULL, &dwType, (PBYTE)szUser, &dwSize) == 0) + fFoundUserName = TRUE; + RegCloseKey (hk); + } + } TCHAR szSource[ cchRESOURCE ]; TCHAR szTarget[ cchRESOURCE ]; @@ -268,6 +317,7 @@ void Main_OnInitDialog (HWND hDlg) void Main_OnCheckMenuRemind (void) { BOOL fRemind = FALSE; + lock_ObtainMutex(&g.credsLock); for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds) { if (g.aCreds[ iCreds ].fRemind) @@ -283,6 +333,7 @@ void Main_OnCheckMenuRemind (void) SaveRemind (iCreds); } } + lock_ReleaseMutex(&g.credsLock); // Check the active tab, and fix its checkbox if necessary // @@ -297,7 +348,7 @@ void Main_OnCheckMenuRemind (void) // Make sure the reminder timer is going // - Main_EnableRemindTimer (TRUE); + Main_EnableRemindTimer (fRemind); } @@ -346,19 +397,27 @@ void Main_OnSelectTab (void) void Main_OnCheckTerminate (void) { - HKEY hk; - if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("System\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"), &hk) == 0) - { + HKEY hk; + + if (RegOpenKey (HKEY_CURRENT_USER, REGSTR_PATH_OPENAFS_CLIENT, &hk) == 0) + { + DWORD dwSize = sizeof(g.fStartup); + DWORD dwType = REG_DWORD; + RegQueryValueEx (hk, TEXT("ShowTrayIcon"), NULL, &dwType, (PBYTE)&g.fStartup, &dwSize); + RegCloseKey (hk); + } + else if (RegOpenKey (HKEY_LOCAL_MACHINE, REGSTR_PATH_OPENAFS_CLIENT, &hk) == 0) + { DWORD dwSize = sizeof(g.fStartup); DWORD dwType = REG_DWORD; RegQueryValueEx (hk, TEXT("ShowTrayIcon"), NULL, &dwType, (PBYTE)&g.fStartup, &dwSize); RegCloseKey (hk); - } + } - Shortcut_FixStartup (cszSHORTCUT_NAME, g.fStartup); + Shortcut_FixStartup (cszSHORTCUT_NAME, g.fStartup); - if (!g.fStartup) - Quit(); + if (!g.fStartup) + Quit(); } @@ -405,7 +464,6 @@ void Main_RepopulateTabs (BOOL fDestroyInvalid) if (IsWindowVisible (g.hMain)) fDestroyInvalid = FALSE; - Main_EnableRemindTimer (FALSE); // First we'll have to look around and see what credentials we currently // have. This call just updates g.aCreds[]; it doesn't do anything else. @@ -424,6 +482,7 @@ void Main_RepopulateTabs (BOOL fDestroyInvalid) size_t iTabOut = 0; size_t nCreds = 0; + lock_ObtainMutex(&g.credsLock); for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds) { if (g.aCreds[ iCreds ].szCell[0]) @@ -471,6 +530,7 @@ void Main_RepopulateTabs (BOOL fDestroyInvalid) } } } + lock_ReleaseMutex(&g.credsLock); if (REALLOC (aTabs, cTabs, 1+iTabOut, cREALLOC_TABS)) aTabs[ iTabOut++ ] = dwTABPARAM_MOUNT; @@ -533,7 +593,6 @@ void Main_RepopulateTabs (BOOL fDestroyInvalid) TabCtrl_SetCurSel (hTab, iTabSel); Main_OnSelectTab (); - Main_EnableRemindTimer (TRUE); fInHere = FALSE; } @@ -542,15 +601,25 @@ void Main_RepopulateTabs (BOOL fDestroyInvalid) void Main_EnableRemindTimer (BOOL fEnable) { - KillTimer (g.hMain, ID_REMIND_TIMER); + static BOOL bEnabled = FALSE; - if (fEnable) + if ( fEnable == FALSE && bEnabled == TRUE ) { + KillTimer (g.hMain, ID_REMIND_TIMER); + bEnabled = FALSE; + } else if ( fEnable == TRUE && bEnabled == FALSE ) { SetTimer (g.hMain, ID_REMIND_TIMER, (ULONG)cmsec1MINUTE * cminREMIND_TEST, NULL); + bEnabled = TRUE; + } } size_t Main_FindExpiredCreds (void) { + size_t retval = (size_t) -1; + lock_ObtainMutex(&g.expirationCheckLock); + if ( KFW_is_available() ) + KFW_AFS_renew_expiring_tokens(); + lock_ObtainMutex(&g.credsLock); for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds) { if (!g.aCreds[ iCreds ].szCell[0]) @@ -574,10 +643,19 @@ size_t Main_FindExpiredCreds (void) llExpires /= c100ns1SECOND; if (llExpires <= (llNow + (LONGLONG)cminREMIND_WARN * csec1MINUTE)) - return iCreds; + { + if ( KFW_is_available() && + KFW_AFS_renew_token_for_cell(g.aCreds[ iCreds ].szCell) ) + continue; + retval = (size_t) iCreds; + break; + } } + + lock_ReleaseMutex(&g.credsLock); + lock_ReleaseMutex(&g.expirationCheckLock); - return (size_t)-1; + return retval; } @@ -624,10 +702,14 @@ void Terminate_OnOK (HWND hDlg) if (IsDlgButtonChecked (hDlg, IDC_STOP)) { SC_HANDLE hManager; - if ((hManager = OpenSCManager (NULL, NULL, SC_MANAGER_ALL_ACCESS)) != NULL) + if ((hManager = OpenSCManager (NULL, NULL, + SC_MANAGER_CONNECT | + SC_MANAGER_ENUMERATE_SERVICE | + SC_MANAGER_QUERY_LOCK_STATUS)) != NULL) { SC_HANDLE hService; - if ((hService = OpenService (hManager, TEXT("TransarcAFSDaemon"), SERVICE_ALL_ACCESS)) != NULL) + if ((hService = OpenService (hManager, TEXT("TransarcAFSDaemon"), + SERVICE_QUERY_STATUS | SERVICE_START)) != NULL) { SERVICE_STATUS Status; ControlService (hService, SERVICE_CONTROL_STOP, &Status); @@ -642,14 +724,14 @@ void Terminate_OnOK (HWND hDlg) g.fStartup = IsDlgButtonChecked (hDlg, IDC_STARTUP); - HKEY hk; - if (RegCreateKey (HKEY_LOCAL_MACHINE, TEXT("System\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"), &hk) == 0) - { - DWORD dwSize = sizeof(g.fStartup); - DWORD dwType = REG_DWORD; - RegSetValueEx (hk, TEXT("ShowTrayIcon"), NULL, dwType, (PBYTE)&g.fStartup, dwSize); - RegCloseKey (hk); - } + HKEY hk; + if (RegCreateKey (HKEY_CURRENT_USER, REGSTR_PATH_OPENAFS_CLIENT, &hk) == 0) + { + DWORD dwSize = sizeof(g.fStartup); + DWORD dwType = REG_DWORD; + RegSetValueEx (hk, TEXT("ShowTrayIcon"), NULL, dwType, (PBYTE)&g.fStartup, dwSize); + RegCloseKey (hk); + } Shortcut_FixStartup (cszSHORTCUT_NAME, g.fStartup); diff --git a/src/WINNT/client_exp/NTMakefile b/src/WINNT/client_exp/NTMakefile index 31bf42b00..61a7367e6 100644 --- a/src/WINNT/client_exp/NTMakefile +++ b/src/WINNT/client_exp/NTMakefile @@ -7,63 +7,68 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I..\afsd /D"_WINDOWS" /D"_WINDLL" /D"_AFXDLL" /D"_USRDLL" +NO_CRTDBG=1 #define this to disable any CRT_DBG flag +RELDIR=WINNT\client_exp !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !include ..\..\config\NTMakefile.version - ############################################################################ # afs_shl_ext.dll DLLFILE = $(DESTDIR)\root.client\usr\vice\etc\afs_shl_ext.dll DLLOBJS =\ - add_acl_entry_dlg.obj \ - add_submount_dlg.obj \ - afs_shl_ext.obj \ - afs_shl_ext_stub.res \ - auth_dlg.obj \ - clear_acl_dlg.obj \ - copy_acl_dlg.obj \ - down_servers_dlg.obj \ - fs_utils.obj \ - gui2fs.obj \ - help.obj \ - klog_dlg.obj \ - make_mount_point_dlg.obj \ - mount_points_dlg.obj \ - msgs.obj \ - partition_info_dlg.obj \ - results_dlg.obj \ - server_status_dlg.obj \ - set_afs_acl.obj \ - shell_ext.obj \ - stdafx.obj \ - submount_info.obj \ - submounts_dlg.obj \ - unlog_dlg.obj \ - volumeinfo.obj \ - AFS_component_version_number.obj + $(OUT)\add_acl_entry_dlg.obj \ + $(OUT)\add_submount_dlg.obj \ + $(OUT)\afs_shl_ext.obj \ + $(OUT)\afs_shl_ext_stub.res \ + $(OUT)\auth_dlg.obj \ + $(OUT)\clear_acl_dlg.obj \ + $(OUT)\copy_acl_dlg.obj \ + $(OUT)\down_servers_dlg.obj \ + $(OUT)\fs_utils.obj \ + $(OUT)\gui2fs.obj \ + $(OUT)\help.obj \ + $(OUT)\klog_dlg.obj \ + $(OUT)\make_mount_point_dlg.obj \ + $(OUT)\mount_points_dlg.obj \ + $(OUT)\msgs.obj \ + $(OUT)\partition_info_dlg.obj \ + $(OUT)\results_dlg.obj \ + $(OUT)\server_status_dlg.obj \ + $(OUT)\set_afs_acl.obj \ + $(OUT)\shell_ext.obj \ + $(OUT)\stdafx.obj \ + $(OUT)\submount_info.obj \ + $(OUT)\submounts_dlg.obj \ + $(OUT)\unlog_dlg.obj \ + $(OUT)\volumeinfo.obj \ + $(OUT)\make_symbolic_link_dlg.obj \ + $(OUT)\AFS_component_version_number.obj AFSD = ..\afsd -fs_utils.obj: $(AFSD)\fs_utils.c +$(OUT)\fs_utils.obj: $(AFSD)\fs_utils.c $(C2OBJ) $** +DLLSDKLIBS =\ + mpr.lib + DLLLIBS =\ - mpr.lib \ $(DESTDIR)\lib\afsrpc.lib \ $(DESTDIR)\lib\afsauthent.lib \ $(DESTDIR)\lib\libafsconf.lib \ + $(DESTDIR)\lib\libosi.lib \ $(DESTDIR)\lib\afs\TaLocale.lib -$(DLLFILE): $(DLLOBJS) - $(DLLMFCLINK) /def:afs_shl_ext.def $(DLLLIBS) +$(DLLFILE): $(DLLOBJS) $(DLLLIBS) + $(DLLCONLINK) /DEF:afs_shl_ext.def $(DLLSDKLIBS) $(DLLPREP) ############################################################################ # Definitions for generating versioninfo resources -afs_shl_ext_stub.res: afs_shl_ext_stub.rc AFS_component_version_number.h +$(OUT)\afs_shl_ext_stub.res: AFS_component_version_number.h ############################################################################ # Install target; primary makefile target @@ -132,3 +137,9 @@ clean:: if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /f NTMakefile clean if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /f NTMakefile clean $(CD) .. + +mkdir: + -mkdir $(OUT)\lang + cd lang + nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir + cd .. diff --git a/src/WINNT/client_exp/afs_shl_ext.cpp b/src/WINNT/client_exp/afs_shl_ext.cpp index d0917b201..6c4d9c811 100644 --- a/src/WINNT/client_exp/afs_shl_ext.cpp +++ b/src/WINNT/client_exp/afs_shl_ext.cpp @@ -17,6 +17,7 @@ extern "C" { #include #include "help.h" #include "shell_ext.h" +#include "winreg.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -24,6 +25,8 @@ extern "C" { static char THIS_FILE[] = __FILE__; #endif +static const IID IID_IShellExt = +{ 0xdc515c27, 0x6cac, 0x11d1, { 0xba, 0xe7, 0x0, 0xc0, 0x4f, 0xd1, 0x40, 0xd2 } }; ///////////////////////////////////////////////////////////////////////////// // CAfsShlExt @@ -52,6 +55,7 @@ CAfsShlExt theApp; ///////////////////////////////////////////////////////////////////////////// // CAfsShlExt initialization +HINSTANCE g_hInstance; BOOL CAfsShlExt::InitInstance() { @@ -86,20 +90,124 @@ STDAPI DllCanUnloadNow(void) return S_FALSE; } +int WideCharToLocal(LPTSTR pLocal, LPCWSTR pWide, DWORD dwChars) +{ + *pLocal = 0; + WideCharToMultiByte( CP_ACP, 0, pWide, -1, pLocal, dwChars, NULL, NULL); + return lstrlen(pLocal); +} + +LRESULT DoRegCLSID(HKEY hKey,PTCHAR szSubKey,PTCHAR szData,PTCHAR szValue=NULL) +{ + DWORD dwDisp; + LRESULT lResult; + HKEY thKey; + lResult = RegCreateKeyEx(hKey, szSubKey, 0, NULL, + REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, + &thKey, &dwDisp); + if(NOERROR == lResult) + { + lResult = RegSetValueEx(thKey, szValue, 0, REG_SZ, + (LPBYTE)szData, (lstrlen(szData) + 1) + * sizeof(TCHAR)); + RegCloseKey(thKey); + } + RegCloseKey(hKey); + return lResult; +} + // by exporting DllRegisterServer, you can use regsvr.exe STDAPI DllRegisterServer(void) { - int i; HKEY hKey; LRESULT lResult; DWORD dwDisp; TCHAR szSubKey[MAX_PATH]; TCHAR szCLSID[MAX_PATH]; - TCHAR szModule[MAX_PATH]; - LPWSTR pwsz; + TCHAR szModule[MAX_PATH]; + LPWSTR pwsz; AFX_MANAGE_STATE(AfxGetStaticModuleState()); COleObjectFactory::UpdateRegistryAll(); + + StringFromIID(IID_IShellExt, &pwsz); + if(pwsz) + { + WideCharToMultiByte( CP_ACP, 0,pwsz, -1, szCLSID, sizeof(szCLSID), NULL, NULL); + LPMALLOC pMalloc; + CoGetMalloc(1, &pMalloc); + if(pMalloc) + { + (pMalloc->Free)(pwsz); + (pMalloc->Release)(); + } + } else { + return E_FAIL; + } + + /* + [HKEY_CLASSES_ROOT\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32] + @="Y:\\DEST\\root.client\\usr\\vice\\etc\\afs_shl_ext.dll" + "ThreadingModel"="Apartment" + */ + HMODULE hModule=GetModuleHandle("afs_shl_ext.dll"); + DWORD z=GetModuleFileName(hModule,szModule,sizeof(szModule)); + wsprintf(szSubKey, TEXT("CLSID\\%s\\InprocServer32"),szCLSID); + if ((lResult=DoRegCLSID(HKEY_CLASSES_ROOT,szSubKey,szModule))!=NOERROR) + return lResult; + + wsprintf(szSubKey, TEXT("CLSID\\%s\\InprocServer32"),szCLSID); + if ((lResult=DoRegCLSID(HKEY_CLASSES_ROOT,szSubKey,"Apartment","ThreadingModel"))!=NOERROR) + return lResult; + + /* + [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\AFS Client Shell Extension] + @="{EA3775F2-28BE-11D3-9C8D-00105A24ED29}" + */ + wsprintf(szSubKey, TEXT("%s\\%s"), STR_REG_PATH, STR_EXT_TITLE); + if ((lResult=DoRegCLSID(HKEY_LOCAL_MACHINE,szSubKey,szCLSID))!=NOERROR) + return lResult; + + //If running on NT, register the extension as approved. + /* + [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved] + "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}"="AFS Client Shell Extension" + + [HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers\AFS Client Shell Extension] + @="{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" + */ + + OSVERSIONINFO osvi; + osvi.dwOSVersionInfoSize = sizeof(osvi); + GetVersionEx(&osvi); + if(VER_PLATFORM_WIN32_NT == osvi.dwPlatformId) + { + wsprintf(szSubKey, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved")); + if ((lResult=DoRegCLSID(HKEY_LOCAL_MACHINE,szSubKey,STR_EXT_TITLE,szCLSID))!=NOERROR) + return lResult; + } + wsprintf(szSubKey, TEXT("*\\shellex\\ContextMenuHandlers\\%s"),STR_EXT_TITLE); + if ((lResult=DoRegCLSID(HKEY_CLASSES_ROOT,szSubKey,szCLSID))!=NOERROR) + return lResult; + wsprintf(szSubKey, TEXT("Folder\\shellex\\ContextMenuHandlers\\%s"),STR_EXT_TITLE); + if ((lResult=DoRegCLSID(HKEY_CLASSES_ROOT,szSubKey,szCLSID))!=NOERROR) + return lResult; + + /* + Register InfoTip + + [HKEY_CLASSES_ROOT\Folder\shellex\{00021500-0000-0000-C000-000000000046}] + @="{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" + */ + + wsprintf(szSubKey, TEXT("Folder\\shellex\\{00021500-0000-0000-C000-000000000046}")); + if ((lResult=DoRegCLSID(HKEY_CLASSES_ROOT,szSubKey,szCLSID))!=NOERROR) + return lResult; + + + /* Below needs to be merged with above */ + + wsprintf(szSubKey, TEXT("%s\\%s"), STR_REG_PATH, STR_EXT_TITLE); lResult = RegCreateKeyEx( HKEY_LOCAL_MACHINE, szSubKey, 0, @@ -112,7 +220,7 @@ STDAPI DllRegisterServer(void) if(NOERROR == lResult) { - //Create the value string. + //Create the value string. lResult = RegSetValueEx( hKey, NULL, 0, @@ -125,7 +233,6 @@ STDAPI DllRegisterServer(void) return SELFREG_E_CLASS; //If running on NT, register the extension as approved. - OSVERSIONINFO osvi; osvi.dwOSVersionInfoSize = sizeof(osvi); GetVersionEx(&osvi); if(VER_PLATFORM_WIN32_NT == osvi.dwPlatformId) @@ -162,3 +269,61 @@ STDAPI DllRegisterServer(void) } return S_OK; } + +//returnValue = RegOpenKeyEx (HKEY_CLASSES_ROOT, keyName, 0, KEY_ALL_ACCESS, ®istryKey); + +LRESULT DoValueDelete(HKEY hKey,PTCHAR pszSubKey,PTCHAR szValue=NULL) +{ + LRESULT lResult; + HKEY thKey; + if (szValue==NULL) { + lResult=RegDeleteKey(hKey, pszSubKey); + return lResult; + } + lResult = RegOpenKeyEx( hKey, + pszSubKey, + 0, + KEY_ALL_ACCESS, + &thKey); + if(NOERROR == lResult) + { + lResult=RegDeleteValue(hKey, szValue); + RegCloseKey(thKey); + } + return lResult; +} + +STDAPI DllUnregisterServer(void) +{ + TCHAR szSubKey[MAX_PATH]; + TCHAR szCLSID[MAX_PATH]; + LPWSTR pwsz; + AFX_MANAGE_STATE(AfxGetStaticModuleState()); + COleObjectFactory::UpdateRegistryAll(FALSE); + StringFromIID(IID_IShellExt, &pwsz); + if(pwsz) + { + WideCharToMultiByte( CP_ACP, 0,pwsz, -1, szCLSID, sizeof(szCLSID), NULL, NULL); + LPMALLOC pMalloc; + CoGetMalloc(1, &pMalloc); + if(pMalloc) + { + (pMalloc->Free)(pwsz); + (pMalloc->Release)(); + } + } else { + return E_FAIL; + } + wsprintf(szSubKey, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved")); + DoValueDelete(HKEY_LOCAL_MACHINE,szSubKey,szCLSID); + wsprintf(szSubKey, TEXT("*\\shellex\\ContextMenuHandlers\\%s"),STR_EXT_TITLE); + DoValueDelete(HKEY_CLASSES_ROOT, szSubKey); + wsprintf(szSubKey, TEXT("Folder\\shellex\\{00021500-0000-0000-C000-000000000046}")); + DoValueDelete(HKEY_CLASSES_ROOT, szSubKey); + wsprintf(szSubKey, TEXT("Folder\\shellex\\ContextMenuHandlers\\%s"),STR_EXT_TITLE); + DoValueDelete(HKEY_CLASSES_ROOT, szSubKey); + wsprintf(szSubKey, TEXT("%s\\%s"), STR_REG_PATH, STR_EXT_TITLE); + DoValueDelete(HKEY_LOCAL_MACHINE, szSubKey); + return S_OK; +} + diff --git a/src/WINNT/client_exp/afs_shl_ext.def b/src/WINNT/client_exp/afs_shl_ext.def index 55d9061fe..8375b659d 100644 --- a/src/WINNT/client_exp/afs_shl_ext.def +++ b/src/WINNT/client_exp/afs_shl_ext.def @@ -1,5 +1,10 @@ -; Copyright (C) 1998 Transarc Corporation. -; All rights reserved. +; Copyright 2000, International Business Machines Corporation and others. +; All Rights Reserved. +; +; This software has been released under the terms of the IBM Public +; License. For details, see the LICENSE file in the top-level source +; directory or online at http://www.openafs.org/dl/license10.html +; ; AfsShlExt.def : Declares the module parameters for the DLL. diff --git a/src/WINNT/client_exp/gui2fs.cpp b/src/WINNT/client_exp/gui2fs.cpp index 4b5283bd0..f0b72680b 100644 --- a/src/WINNT/client_exp/gui2fs.cpp +++ b/src/WINNT/client_exp/gui2fs.cpp @@ -368,7 +368,7 @@ int foldcmp (register char *a, register char *b) } } -void ZapList(struct AclEntry *alist) +extern "C" void ZapList(struct AclEntry *alist) { register struct AclEntry *tp, *np; @@ -378,14 +378,14 @@ void ZapList(struct AclEntry *alist) } } -void ZapAcl (struct Acl *acl) +extern "C" void ZapAcl (struct Acl *acl) { ZapList(acl->pluslist); ZapList(acl->minuslist); free(acl); } -int PruneList (struct AclEntry **ae, int dfs) +extern "C" int PruneList (struct AclEntry **ae, int dfs) { struct AclEntry **lp = ae; struct AclEntry *te, *ne; @@ -554,7 +554,7 @@ struct Acl *ParseAcl(char *astr) /* clean up an access control list of its bad entries; return 1 if we made any changes to the list, and 0 otherwise */ -int CleanAcl(struct Acl *aa) +extern "C" int CleanAcl(struct Acl *aa) { register struct AclEntry *te, **le, *ne; int changes; @@ -1006,24 +1006,21 @@ BOOL ListMount(CStringArray& files) return !error; } -static BOOL InAFS(register char *apath) +BOOL IsPathInAfs(const CHAR *strPath) { struct ViceIoctl blob; - register LONG code; + int code; - HOURGLASS hourglass; + HOURGLASS hourglass; blob.in_size = 0; blob.out_size = MAXSIZE; blob.out = space; - code = pioctl(apath, VIOC_FILE_CELL_NAME, &blob, 1); - if (code) { - if ((errno == EINVAL) || (errno == ENOENT)) - return FALSE; - } - - return TRUE; + code = pioctl((LPTSTR)((LPCTSTR)strPath), VIOC_FILE_CELL_NAME, &blob, 1); + if (code) + return FALSE; + return TRUE; } /* return a static pointer to a buffer */ @@ -1070,7 +1067,7 @@ defect #3069 else cellName = (char *) 0; - if (!InAFS(Parent(PCCHAR(strDir)))) { + if (!IsPathInAfs(Parent(PCCHAR(strDir)))) { ShowMessageBox(IDS_MAKE_MP_NOT_AFS_ERROR, MB_ICONEXCLAMATION, IDS_MAKE_MP_NOT_AFS_ERROR); return FALSE; } @@ -1157,6 +1154,8 @@ BOOL RemoveSymlink(const char * linkName) char tpbuffer[1024]; char *tp; + HOURGLASS hourglass; + tp = (char *) strrchr(linkName, '\\'); if (!tp) tp = (char *) strrchr(linkName, '/'); @@ -1191,6 +1190,9 @@ BOOL IsSymlink(const char * true_name) struct ViceIoctl blob; char *last_component; int code; + + HOURGLASS hourglass; + last_component = (char *) strrchr(true_name, '\\'); if (!last_component) last_component = (char *) strrchr(true_name, '/'); @@ -1570,19 +1572,75 @@ BOOL GetTokenInfo(CStringArray& tokenInfo) return TRUE; } -BOOL IsPathInAfs(const CHAR *strPath) +UINT MakeSymbolicLink(const char *strName ,const char *strDir) { struct ViceIoctl blob; - int code; + char space[MAXSIZE]; + UINT code; - blob.in_size = 0; - blob.out_size = MAXSIZE; - blob.out = space; + HOURGLASS hourglass; - code = pioctl(PCCHAR(strPath), VIOC_FILE_CELL_NAME, &blob, 1); - if (code) { - if ((errno == EINVAL) || (errno == ENOENT)) return FALSE; - } - return TRUE; + /*lets confirm its a good symlink*/ + if (!IsPathInAfs(strDir)) + return 1; + LPTSTR lpsz = new TCHAR[strlen(strDir)+1]; + _tcscpy(lpsz, strName); + strcpy(space, strDir); + blob.out_size = 0; + blob.in_size = 1 + strlen(space); + blob.in = space; + blob.out = NULL; + if ((code=pioctl(lpsz, VIOC_SYMLINK, &blob, 0))!=0) + return code; + return 0; } +void ListSymbolicLinkPath(const char *strName,char *strPath,UINT nlenPath) +{ + ASSERT(nlenPath - -typedef class HOURGLASS -{ - protected: - HCURSOR m_OldCursor; - - public: - HOURGLASS (LPCSTR idCursor = IDC_WAIT) - { - m_OldCursor = GetCursor(); - SetCursor (LoadCursor (NULL, idCursor)); - } - - virtual ~HOURGLASS (void) - { - SetCursor (m_OldCursor); - } - -} HOURGLASS, *PHOURGLASS; - +#include + +typedef class HOURGLASS +{ + protected: + HCURSOR m_OldCursor; + + public: + HOURGLASS (LPCSTR idCursor = IDC_WAIT) + { + m_OldCursor = GetCursor(); + SetCursor (LoadCursor (NULL, idCursor)); + } + + virtual ~HOURGLASS (void) + { + SetCursor (m_OldCursor); + } + +} HOURGLASS, *PHOURGLASS; + diff --git a/src/WINNT/client_exp/lang/NTMakefile b/src/WINNT/client_exp/lang/NTMakefile index 132df5ed1..5e50b3493 100644 --- a/src/WINNT/client_exp/lang/NTMakefile +++ b/src/WINNT/client_exp/lang/NTMakefile @@ -10,7 +10,7 @@ AFSDEV_AUXRCFLAGS = $(AFSDEV_AUXRCFLAGS) -I$(DESTDIR)\include -I.. # include the primary makefile - +RELDIR=WINNT\client_exp\lang !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\..\config\NTMakefile.version @@ -35,7 +35,7 @@ DLLFILE = $(DESTDIR)\root.client\usr\vice\etc\afs_shl_ext_$(LANGID).dll RCFILE = $(LANGNAME)\afs_shl_ext.rc -RESFILE = afs_shl_ext_$(LANGID).res +RESFILE = $(OUT)\afs_shl_ext_$(LANGID).res DLLOBJS = $(RESFILE) @@ -48,7 +48,7 @@ $(DLLFILE) : $(DLLOBJS) install : $(DLLFILE) clean :: - $(DEL) *.res RC* RD* $(DLLFILE) $(DEL) $(DLLFILE) + $(DEL) $(OUT)\*.res RC* RD* $(DLLFILE) ############################################################################ # @@ -58,3 +58,7 @@ clean :: $(RESFILE) : $(RCFILE) AFS_component_version_number.h $(RC) /fo$(RESFILE) /c$(LANGCP) $(RCFILE) + +mkdir: + + diff --git a/src/WINNT/client_exp/lang/de_DE/afs_shl_ext.rc b/src/WINNT/client_exp/lang/de_DE/afs_shl_ext.rc index 9d746e43d..3801a6dcf 100644 --- a/src/WINNT/client_exp/lang/de_DE/afs_shl_ext.rc +++ b/src/WINNT/client_exp/lang/de_DE/afs_shl_ext.rc @@ -7,61 +7,61 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" - "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE 9, 1\r\n" - "#endif\r\n" - "#include ""afs_shl_ext.rc2"" // nicht mit Microsoft Visual C++ bearbeitete Ressourcen\r\n" - "#include ""afxres.rc"" // Standardkomponenten\r\n" - "#endif\0" -END - -#endif // APSTUDIO_INVOKED - +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "#ifdef _WIN32\r\n" + "LANGUAGE 9, 1\r\n" + "#endif\r\n" + "#include ""afs_shl_ext.rc2"" // nicht mit Microsoft Visual C++ bearbeitete Ressourcen\r\n" + "#include ""afxres.rc"" // Standardkomponenten\r\n" + "#endif\0" +END + +#endif // APSTUDIO_INVOKED + #ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // @@ -76,584 +76,584 @@ END #define AFS_VERINFO_CHARSET 1252 #include "AFS_component_version_number.h" #include "..\..\config\NTVersioninfo.rc" - + #endif // !_MAC -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MENU_FILE MENU DISCARDABLE -BEGIN - MENUITEM "Authentifizierung...", IDM_AUTHENTICATION - MENUITEM "Zugriffssteuerungslisten...", IDM_ACL_SET - POPUP "&Volume/Partition" - BEGIN - MENUITEM "&Merkmale...", IDM_VOLUME_PROPERTIES - MENUITEM "&Name/ID-Zuordnung aktualisieren", - IDM_VOLUMEPARTITION_UPDATENAMEIDTABLE - - END - POPUP "&Mount-Punkt" - BEGIN - MENUITEM "&Anzeigen...", IDM_MOUNTPOINT_SHOW - MENUITEM "&Entfernen...", IDM_MOUNTPOINT_REMOVE - MENUITEM "&Erstellen...", IDM_MOUNTPOINT_MAKE - END - MENUITEM "Datei/Verz &Flush", IDM_FLUSH - MENUITEM "Vol&ume leeren", IDM_FLUSH_VOLUME - MENUITEM "&Datei-Server anzeigen...", IDM_SHOW_SERVER - MENUITEM "&Zellen anzeigen...", IDM_SHOWCELL - MENUITEM "Server-Status anzeigen...", IDM_SERVER_STATUS -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_VOLUME_INFO DIALOG DISCARDABLE 0, 0, 349, 173 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU -CAPTION "Volume-Informationen" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,60,150,50,14,WS_DISABLED - PUSHBUTTON "Hilfe",9,240,150,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,150,150,50,14 - LISTBOX IDC_LIST,10,20,330,100,LBS_SORT | LBS_USETABSTOPS | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "Datei/Verzeichnis",IDC_STATIC,10,10,63,10 - LTEXT "Name",IDC_STATIC,90,10,20,8 - LTEXT "Quote",IDC_STATIC,225,10,19,8 - LTEXT "Benutzt",IDC_STATIC,270,10,27,8 - LTEXT "%Benutzt",IDC_STATIC,305,10,31,8 - LTEXT "ID",IDC_STATIC,175,10,10,8 - LTEXT "Neue Quote:",IDC_STATIC,10,127,41,10 - EDITTEXT IDC_NEW_QUOTA,55,126,50,12,ES_AUTOHSCROLL | WS_DISABLED - PUSHBUTTON "Informationen zur Partition anzeigen", - IDC_PARTITION_INFO,190,125,117,14,WS_DISABLED - LTEXT "KBytes",IDC_STATIC,118,127,25,10 - CONTROL "Spin1",IDC_QUOTA_SPIN,"msctls_updown32",UDS_WRAP | - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | - WS_DISABLED,106,125,10,14 -END - -IDD_SET_AFS_ACL DIALOG DISCARDABLE 0, 0, 325, 228 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "fAFS-ACL festlegen" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "",IDC_DIR_NAME,62,12,249,10 - LISTBOX IDC_NORMAL_RIGHTS,10,46,175,75,LBS_USETABSTOPS | - LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | - WS_HSCROLL | WS_TABSTOP - LISTBOX IDC_NEGATIVE_ENTRIES,10,141,175,75,LBS_USETABSTOPS | - LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | - WS_HSCROLL | WS_TABSTOP - CONTROL "r - Read",IDC_READ,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,200,52,55,10 - CONTROL "w - Write",IDC_WRITE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,200,111,55,10 - CONTROL "l - Lookup",IDC_LOOKUP,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,200,66,55,10 - CONTROL "d - Delete",IDC_DELETE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,200,96,55,10 - CONTROL "i - Insert",IDC_INSERT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,200,81,55,10 - CONTROL "k - Lock",IDC_LOCK,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,200,126,55,10 - CONTROL "a - Administer",IDC_ADMINISTER,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,200,141,55,10 - PUSHBUTTON "&Hinzufügen...",IDC_ADD,270,45,45,14 - PUSHBUTTON "&Entfernen",IDC_REMOVE,270,70,45,14,WS_DISABLED - PUSHBUTTON "&Bereinigen",IDC_CLEAN,270,95,45,14 - DEFPUSHBUTTON "&OK",IDOK,270,150,45,14 - PUSHBUTTON "&Abbrechen",IDCANCEL,270,175,45,14 - PUSHBUTTON "&Hilfe",9,270,201,45,14 - LTEXT "Verzeichnis:",IDC_STATIC,15,12,45,10 - GROUPBOX "Berechtigungen",IDC_STATIC,195,41,65,115 - LTEXT "Normale",IDC_STATIC,10,30,28,8 - LTEXT "Name",IDC_COLUMN_3,69,38,20,8 - LTEXT "Berechtigungen",IDC_STATIC,10,38,52,8 - LTEXT "Negative Zahlen",IDC_STATIC,10,125,30,8 - LTEXT "Berechtigungen",IDC_STATIC,10,133,52,8 - LTEXT "Name",IDC_COLUMN_4,69,133,31,8 - GROUPBOX "",IDC_STATIC,10,5,305,20 - PUSHBUTTON "Ko&pieren...",IDC_COPY,270,120,45,14 -END - -IDD_MAKE_MOUNT_POINT DIALOG DISCARDABLE 0, 0, 219, 103 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Mount-Punkt erstellen" -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_DIR,51,10,159,12,ES_AUTOHSCROLL - EDITTEXT IDC_VOLUME,51,25,159,12,ES_AUTOHSCROLL - EDITTEXT IDC_CELL,51,40,159,12,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,20,81,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,85,81,50,14 - PUSHBUTTON "Hilfe",9,150,81,50,14 - LTEXT "Verzeichnis:",IDC_STATIC,7,12,37,10 - LTEXT "Volume:",IDC_STATIC,7,28,25,10 - LTEXT "Zelle:",IDC_STATIC,7,42,22,10 - GROUPBOX "",IDC_STATIC,45,52,117,20 - LTEXT "Optionen:",IDC_STATIC,9,59,32,10 - CONTROL "Regulär",IDC_REGULAR,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,48,59,38,10 - CONTROL "Lesen/Schreiben",IDC_RW,"Button",BS_AUTORADIOBUTTON,90, - 59,71,10 -END - -IDD_ADD_ACL DIALOG DISCARDABLE 0, 0, 264, 114 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "ACL-Eintrag hinzufügen" -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_NAME,35,70,224,12,ES_AUTOHSCROLL - CONTROL "r - Read",IDC_READ,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,20,15,45,10 - CONTROL "l - Lookup",IDC_LOOKUP2,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,20,25,50,10 - CONTROL "i - Insert",IDC_INSERT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,20,35,50,10 - CONTROL "d - Delete",IDC_DELETE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,20,45,50,10 - CONTROL "w - Write",IDC_WRITE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,80,15,50,10 - CONTROL "k - Lock",IDC_LOCK2,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,80,25,55,10 - CONTROL "a - Administer",IDC_ADMINISTER,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,80,35,60,10 - CONTROL "Normaler Eintrag",IDC_ADD_NORMAL_ENTRY,"Button", - BS_AUTORADIOBUTTON | WS_GROUP,161,16,79,10 - CONTROL "Eingabe negativer Zahlen",IDC_ADD_NEGATIVE_ENTRY,"Button", - BS_AUTORADIOBUTTON,161,26,96,10 - PUSHBUTTON "OK",IDOK,101,90,50,14 - PUSHBUTTON "Abbrechen",IDCANCEL,155,90,50,14 - PUSHBUTTON "Hilfe",9,209,90,50,14 - LTEXT "Name:",IDC_STATIC,10,72,20,8 - GROUPBOX "Berechtigungen",IDC_STATIC,10,5,135,55 - GROUPBOX "Eintragungsart",IDC_STATIC,155,6,105,34 -END - -IDD_PARTITION_INFO DIALOG DISCARDABLE 0, 0, 139, 82 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Informationen zur Partition" -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_TOTAL_SIZE,63,10,40,12,ES_AUTOHSCROLL | WS_DISABLED | - NOT WS_TABSTOP - EDITTEXT IDC_BLOCKS_FREE,63,25,40,12,ES_AUTOHSCROLL | WS_DISABLED | - NOT WS_TABSTOP - EDITTEXT IDC_PERCENT_USED,63,40,40,12,ES_AUTOHSCROLL | - WS_DISABLED | NOT WS_TABSTOP - DEFPUSHBUTTON "Schließen",IDOK,18,62,40,14 - PUSHBUTTON "Hilfe",9,75,62,40,14 - LTEXT "% benutzt:",IDC_STATIC,6,42,41,8 - LTEXT "Blöcke frei:",IDC_STATIC,5,27,40,8 - LTEXT "Größe insgesamt:",IDC_STATIC,5,12,55,8 - LTEXT "KBytes",IDC_STATIC,105,12,25,8 - LTEXT "KBytes",IDC_STATIC,105,27,25,8 -END - -IDD_COPY_ACL DIALOG DISCARDABLE 0, 0, 239, 88 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "ACL kopieren" -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_FROM_DIR,55,10,181,12,ES_AUTOHSCROLL | ES_READONLY - EDITTEXT IDC_TO_DIR,55,26,130,12,ES_AUTOHSCROLL - PUSHBUTTON "Durchsuchen",IDC_BROWSE,188,25,49,14 - CONTROL "Aktuelle Einträge löschen:",IDC_CLEAR,"Button", - BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,5,46,102,10 - DEFPUSHBUTTON "OK",IDOK,20,65,50,14,WS_DISABLED - PUSHBUTTON "Abbrechen",IDCANCEL,95,65,50,14 - PUSHBUTTON "Hilfe",9,170,65,50,14 - LTEXT "Kopieren von:",IDC_STATIC,5,12,47,8 - LTEXT "Kopieren nach:",IDC_STATIC,5,29,49,8 -END - -IDD_WHERE_IS DIALOG DISCARDABLE 0, 0, 299, 168 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Wo befindet sich" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "Schließen",IDOK,65,145,50,14 - PUSHBUTTON "Hilfe",9,180,145,50,14 - LISTBOX IDC_LIST,10,20,280,115,LBS_SORT | LBS_USETABSTOPS | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | - WS_TABSTOP - LTEXT "Datei/Verzeichnis",IDC_STATIC,10,10,66,8 - LTEXT "Datei-Server",IDC_STATIC,128,10,56,8 -END - -IDD_RESULTS DIALOG DISCARDABLE 0, 0, 299, 168 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ergebnisse" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "Schließen",IDOK,65,145,50,14 - PUSHBUTTON "Hilfe",9,180,145,50,14 - LISTBOX IDC_LIST,10,20,280,115,LBS_USETABSTOPS | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | - WS_TABSTOP - LTEXT "Datei/Verzeichnis",-1,10,10,69,8 - LTEXT "Ergebnis",IDC_RESULTS_LABEL,128,10,44,8 -END - -IDD_MOUNT_POINTS DIALOG DISCARDABLE 0, 0, 299, 168 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Mount-Punkte" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "Schließen",IDOK,65,145,50,14 - PUSHBUTTON "Hilfe",9,180,145,50,14 - LISTBOX IDC_LIST,10,20,280,115,LBS_SORT | LBS_USETABSTOPS | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | - WS_TABSTOP - LTEXT "Datei",IDC_STATIC,10,11,26,8 - LTEXT "Volume",IDC_STATIC,75,11,29,8 - LTEXT "Zelle",IDC_STATIC,155,11,20,8 - LTEXT "Typ",IDC_STATIC,230,11,20,8 -END - -IDD_DOWN_SERVERS DIALOG DISCARDABLE 0, 0, 209, 163 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Inaktive Server" -FONT 8, "MS Sans Serif" -BEGIN - LISTBOX 1029,10,20,190,110,LBS_SORT | LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_HSCROLL - LTEXT "Diese Servers sind noch inaktiv:",IDC_STATIC,10,10,114, - 8 - DEFPUSHBUTTON "OK",IDOK,82,140,45,15 -END - -IDD_SERVERSTATUS DIALOG DISCARDABLE 0, 0, 179, 143 -STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU -CAPTION "Server-Status" -FONT 8, "MS Sans Serif" -BEGIN - CONTROL "Lokale Zelle",IDC_LOCALCELL,"Button",BS_AUTORADIOBUTTON | - WS_GROUP | WS_TABSTOP,20,20,92,8 - CONTROL "Angegebene Zelle:",IDC_SPECIFIEDCELL,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,20,36,89,10 - CONTROL "Alle Zellen",IDC_ALL_CELLS,"Button",BS_AUTORADIOBUTTON | - WS_TABSTOP,20,65,45,10 - CONTROL "Server nicht testen",IDC_DONTPROBESERVERS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,24,87,89,10 - PUSHBUTTON "Status anzeigen",IDC_SHOWSTATUS,5,120,58,14 - GROUPBOX "Zelle",IDC_STATIC,10,5,160,105,WS_GROUP - GROUPBOX "",IDC_STATIC,20,80,88,20,WS_GROUP - EDITTEXT IDC_CELL_NAME,30,47,130,12,ES_AUTOHSCROLL - PUSHBUTTON "Schließen",IDCANCEL,67,120,50,14 - PUSHBUTTON "Hilfe",9,120,120,50,14 -END - -IDD_AUTHENTICATION DIALOG DISCARDABLE 0, 0, 285, 158 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Authentifizierung" -FONT 8, "MS Sans Serif" -BEGIN - LISTBOX IDC_TOKEN_LIST,10,18,265,110,LBS_SORT | LBS_USETABSTOPS | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | - WS_TABSTOP - PUSHBUTTON "Token erhalten",ID_GET_TOKENS,15,137,55,14 - PUSHBUTTON "Token löschen",ID_DISCARD_TOKENS,80,137,55,14 - PUSHBUTTON "Schließen",IDCANCEL,145,137,55,14 - PUSHBUTTON "Hilfe",9,215,137,55,14 - LTEXT "Benutzername",IDC_STATIC,10,9,57,8 - LTEXT "Zellenname",IDC_STATIC,104,9,47,8 - LTEXT "Verfall",IDC_STATIC,222,9,50,8 -END - -IDD_KLOG_DIALOG DIALOGEX 0, 0, 169, 93 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_APPWINDOW -CAPTION "Token erhalten" -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_NAME,40,10,115,12,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,40,30,115,12,ES_PASSWORD | ES_AUTOHSCROLL - EDITTEXT IDC_CELL_NAME,40,50,115,12,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,20,70,35,14,WS_DISABLED - PUSHBUTTON "Abbrechen",IDCANCEL,67,70,43,14 - PUSHBUTTON "Hilfe",9,120,70,35,14 - LTEXT "Name:",IDC_STATIC,17,12,22,8 - LTEXT "Kennwort:",IDC_STATIC,5,32,34,8 - LTEXT "Zelle:",IDC_STATIC,17,52,19,8 -END - -IDD_UNLOG_DIALOG DIALOGEX 0, 0, 185, 63 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_APPWINDOW -CAPTION "Token löschen" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,25,40,35,14 - PUSHBUTTON "Abbrechen",IDCANCEL,72,40,44,14 - PUSHBUTTON "Hilfe",9,125,40,35,14 - LTEXT "Zelle:",IDC_STATIC,10,17,21,8 - EDITTEXT IDC_CELL_NAME,40,15,136,12,ES_AUTOHSCROLL -END - -IDD_SUBMTINFO DIALOG DISCARDABLE 0, 0, 257, 186 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Submounts" -FONT 8, "MS Sans Serif" -BEGIN - LISTBOX IDC_LIST,10,20,183,157,LBS_SORT | LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_HSCROLL | WS_TABSTOP - PUSHBUTTON "Hinzufügen ",IDC_ADD,202,20,45,14 - PUSHBUTTON "Löschen",IDC_DELETE,202,39,45,14,WS_DISABLED - PUSHBUTTON "Ändern",IDC_CHANGE,202,58,45,14,WS_DISABLED - LTEXT "Submounts:",IDC_STATIC,10,10,50,8 - PUSHBUTTON "OK",IDOK,202,145,45,14 - PUSHBUTTON "Abbrechen",IDCANCEL,202,163,45,14 -END - -IDD_ADD_SUBMOUNT DIALOG DISCARDABLE 0, 0, 229, 79 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Submount hinzufügen" -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_SHARE_NAME,77,8,141,12,ES_AUTOHSCROLL - EDITTEXT IDC_PATH_NAME,77,23,141,12,ES_AUTOHSCROLL - PUSHBUTTON "OK",IDOK,22,53,45,14 - PUSHBUTTON "Abbrechen",IDCANCEL,92,53,45,14 - PUSHBUTTON "Hilfe",9,167,53,45,14 - LTEXT "Gemeinsam benutzter Name:",IDC_STATIC,18,7,60,15 - LTEXT "Pfadname:",IDC_STATIC,18,25,41,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_SERVERSTATUS, DIALOG - BEGIN - RIGHTMARGIN, 171 - END - - IDD_AUTHENTICATION, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 278 - TOPMARGIN, 7 - BOTTOMMARGIN, 151 - END - - IDD_KLOG_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 162 - TOPMARGIN, 7 - BOTTOMMARGIN, 86 - END - - IDD_UNLOG_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 178 - TOPMARGIN, 7 - BOTTOMMARGIN, 56 - END - - IDD_SUBMTINFO, DIALOG - BEGIN - LEFTMARGIN, 10 - RIGHTMARGIN, 247 - BOTTOMMARGIN, 177 - END - - IDD_ADD_SUBMOUNT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 222 - TOPMARGIN, 7 - BOTTOMMARGIN, 25 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - ID_ACL_CLEAN "fs cleanacl" - ID_ACL_COPY "fs copyacl" - ID_ACL_LIST "fs listacl" - ID_ACL_SET "fs setacl" - ID_VOLUME_CHECK "fs checkvolumes" - ID_VOLUME_DISKFREE "fs diskfree" - ID_VOLUME_EXAMINE "fs examine" - ID_VOLUME_FLUSH "fs flushvolume" - ID_VOLUME_QUOTA_BRIEF "fs quota" - ID_VOLUME_QUOTA_FULL "fs listquota" - ID_VOLUME_QUOTA_SET "fs setvol" - ID_VOLUME_SET "fs setvol" -END - -STRINGTABLE DISCARDABLE -BEGIN - ID_FLUSH "fs flush" - ID_WHEREIS "fs whereis" - ID_SHOWCELL "fs whichcell" - ID_MOUNTPOINT_SHOW "fs lsmount" - ID_MOUNTPOINT_REMOVE "fs rmmount" - ID_SHOW_SERVER "fs whereis" - ID_AUTHENTICATE "Bei oder von AFS anmelden oder abmelden" - ID_SERVER_STATUS "Server überprüfen" - ID_VOLUME_PROPERTIES "fs listquota, diskfree, examine, quota, setquota, setvol" - ID_VOLUMEPARTITION_UPDATENAMEIDTABLE "fs checkvolumes" - ID_MOUNTPOINT_MAKE "fs mkmount" - IDS_FLUSH_FAILED "Leeren der aktiven Datei %o nicht möglich" - IDS_FLUSH_ERROR "Fehler beim Leeren von Datei %o: %s" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_FLUSH_OK "Ausgewählte Datei(en) erfolgreich geleert" - IDS_CANT_GET_CELL "Fehler beim Bestimmen der Zelle: " - IDS_FLUSH_VOLUME_ERROR "Fehler beim Leeren des Volume für %o: %s" - IDS_FLUSH_VOLUME_OK "Volume erfolgreich geleert" - IDS_WHERE_IS "Datei %o befindet sich auf Host %s" - IDS_CLEANACL_NOT_SUPPORTED - "ACL für Datei %o kann nicht bereinigt werden: Clean Acl wird für DFS-Zugriffslisten nicht unterstützt" - IDS_ACL_IS_FINE "Zugriffsliste für %o ist sauber" - IDS_CLEANACL_INVALID_ARG - "ACL für Datei %o kann nicht bereinigt werden: Ungültiges Argument; mögliche Gründe: Datei nicht stellvertretend oder zu viele Benutzer in der Zugriffssteuerungsliste" - IDS_ANY_STRING "%o" - IDS_CLEANACL_DONE "Veraltete ACL-Einträge sind gelöscht worden." - ID_SUBMOUNTS "AFS-Submount erstellen oder löschen" - IDS_GETRIGHTS_ERROR "Zugriffsliste für Verzeichnis %o konnte nicht gelesen werden: %o" - IDS_DFSACL_ERROR "Mit diesem Befehl können DFS-ACLs nicht editiert werden" - IDS_SAVE_ACL_ERROR "ACL für %o kann nicht gespeichert werden: %o" - IDS_SAVE_ACL_EINVAL_ERROR - "ACL für %o kann nicht gespeichert werden: Ungültiges Argument; mögliche Gründe: Datei nicht in AFS; zu viele Benutzer in der Zugriffssteuerungsliste; es wurde versucht, einen nicht vorhandenen Benutzer zur Zugriffssteuerungsliste hinzuzufügen" - IDS_ACL_READ_ERROR "ACL für %o kann nicht gelesen werden: %o" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_NO_DFS_COPY_ACL "ACL kann nicht in Verzeichnis %o kopiert werden: Copy ACL wird für DFS-Zugriffslisten nicht unterstützt" - IDS_COPY_ACL_EINVAL_ERROR - "ACL kann nicht in Verzeichnis %o kopiert werden: Ungültiges Argument; mögliche Gründe: Datei nicht in AFS." - IDS_COPY_ACL_ERROR "ACL kann nicht nach %o kopiert werden: %o" - IDS_NOT_MOUNT_POINT_ERROR "%o ist kein Mount-Punkt." - IDS_LIST_MOUNT_POINT_ERROR "Fehler: %o" - IDS_MAKE_MP_NOT_AFS_ERROR - "Mount-Punkte müssen innerhalb des AFS-Dateisystems erstellt werden" - IDS_MOUNT_POINT_ERROR "Fehler beim Erstellen des Mount-Punktes: %o" - IDS_ERROR "Fehler: %o" - IDS_DELETED "Erfolgreich gelöscht" - IDS_SET_QUOTA_ERROR "Quote für Fehlereinstellungen: %o" - ID_SUBMOUNTS_CREATE "Ein AFS-Submount erstellen" - ID_SUBMOUNTS_EDIT "AFS-Submounts hinzufügen, ändern oder löschen" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_CHECK_SERVERS_ERROR "Fehler beim Überprüfen des Status von Datei-Server-Maschinen: %o" - IDS_ALL_SERVERS_RUNNING "Alle Server sind aktiv." - IDS_CHECK_VOLUMES_OK "Alle VolumeID/Name-Zuordnungen überprüft." - IDS_CHECK_VOLUMES_ERROR "Fehler beim Überprüfen von VolumeID/Name-Zuordnungen: %o" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_ACL_ENTRY_NAME_IN_USE - "Der von Ihnen ausgewählte Name ist bereits in Gebrauch. Bitte geben Sie einen anderen Namen ein." - IDS_REALLY_DEL_MOUNT_POINTS - "Sind Sie sicher, daß Sie den (die) ausgewählten Mount-Punkt(e) entfernen möchten?" - IDS_DIR_DOES_NOT_EXIST_ERROR "Das Verzeichnis '%o' ist nicht vorhanden." - IDS_CLEANACL_MSG "Veraltete ACLs werden gelöscht!" - IDS_COPY_ACL_OK "ACL erfolgreich kopiert." - IDS_GET_TOKENS_NO_AFS_SERVICE - "Token-Informationen können nicht gelesen werden: AFS-Service wurde vieleicht noch nicht gestartet." - IDS_GET_TOKENS_UNEXPECTED_ERROR - "Token-Informationen können nicht gelesen werden: Unerwarteter Fehler, Code %d." - IDS_GET_TOKENS_UNEXPECTED_ERROR2 - "Token-Informationen können nicht gelesen werden: Unerwarteter Fehler, Service %s.%s.%s, Code %d." - IDS_ENTER_QUOTA "Bitte geben Sie eine gültige Quote ein." - IDS_AUTHENTICATION_ITEM "&Authentifizierung..." - IDS_ACLS_ITEM "&Zugriffssteuerungslisten..." - IDS_VOL_PART_ITEM "&Volume/Partition" - IDS_VOL_PART_PROPS_ITEM "&Merkmale" - IDS_VOL_PART_REFRESH_ITEM "&Name/ID-Zuordnung aktualisieren" - IDS_MOUNT_POINT_ITEM "&Mount-Punkt" - IDS_MP_SHOW_ITEM "&Anzeigen..." -END - -STRINGTABLE DISCARDABLE -BEGIN - AFX_IDS_APP_TITLE "AFS Client" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_MP_REMOVE_ITEM "&Entfernen..." - IDS_MP_MAKE_ITEM "&Erstellen..." - IDS_FLUSH_FILE_DIR_ITEM "Datei/Verz leeren" - IDS_FLUSH_VOLUME_ITEM "Vol&ume leeren" - IDS_SHOW_FILE_SERVERS_ITEM "&Datei-Server anzeigen..." - IDS_SHOW_CELL_ITEM "&Zellen anzeigen..." - IDS_SHOW_SERVER_STATUS_ITEM "Server-Status anzeigen..." - IDS_AFS_ITEM "&AFS" - IDS_SUBMOUNTS_ITEM "Su&bmounts" - IDS_GET_SUBMT_INFO_ERROR - "Submount-Informationen für gemeinsam benutzten Namen %o können nicht gelesen werden." - IDS_REALLY_DELETE_SUBMT "Gemeinsam benutzten Namen %o löschen?" - IDS_SUBMT_SAVE_FAILED "Ihre Änderungen der Submount-Datenbank sind fehlgeschlagen." - IDS_SUBMOUNTS_CREATE_ITEM "&Hinzufügen" - IDS_SUBMOUNTS_EDIT_ITEM "&Editieren..." - IDS_EDIT_PATH_NAME "Pfadname editieren" - IDS_SHOW_CELL "Zelle anzeigen" -END - -STRINGTABLE DISCARDABLE -BEGIN - IDS_SHOW_CELL_COLUMN "Zelle" - IDS_SHOW_FS "Datei-Server anzeigen" - IDS_SHOW_FS_COLUMN "Datei-Server" - IDS_REMOVE_MP "Mount-Punkte entfernen" - IDS_REMOVE_MP_COLUMN "Ergebnis" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#define _AFX_NO_SPLITTER_RESOURCES -#define _AFX_NO_OLE_RESOURCES -#define _AFX_NO_TRACKER_RESOURCES -#define _AFX_NO_PROPERTY_RESOURCES - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE 9, 1 -#endif -#include "afs_shl_ext.rc2" // nicht mit Microsoft Visual C++ bearbeitete Ressourcen -#include "afxres.rc" // Standardkomponenten -#endif -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MENU_FILE MENU DISCARDABLE +BEGIN + MENUITEM "Authentifizierung...", IDM_AUTHENTICATION + MENUITEM "Zugriffssteuerungslisten...", IDM_ACL_SET + POPUP "&Volume/Partition" + BEGIN + MENUITEM "&Merkmale...", IDM_VOLUME_PROPERTIES + MENUITEM "&Name/ID-Zuordnung aktualisieren", + IDM_VOLUMEPARTITION_UPDATENAMEIDTABLE + + END + POPUP "&Mount-Punkt" + BEGIN + MENUITEM "&Anzeigen...", IDM_MOUNTPOINT_SHOW + MENUITEM "&Entfernen...", IDM_MOUNTPOINT_REMOVE + MENUITEM "&Erstellen...", IDM_MOUNTPOINT_MAKE + END + MENUITEM "Datei/Verz &Flush", IDM_FLUSH + MENUITEM "Vol&ume leeren", IDM_FLUSH_VOLUME + MENUITEM "&Datei-Server anzeigen...", IDM_SHOW_SERVER + MENUITEM "&Zellen anzeigen...", IDM_SHOWCELL + MENUITEM "Server-Status anzeigen...", IDM_SERVER_STATUS +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_VOLUME_INFO DIALOG DISCARDABLE 0, 0, 349, 173 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +CAPTION "Volume-Informationen" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,60,150,50,14,WS_DISABLED + PUSHBUTTON "Hilfe",9,240,150,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,150,150,50,14 + LISTBOX IDC_LIST,10,20,330,100,LBS_SORT | LBS_USETABSTOPS | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LTEXT "Datei/Verzeichnis",IDC_STATIC,10,10,63,10 + LTEXT "Name",IDC_STATIC,90,10,20,8 + LTEXT "Quote",IDC_STATIC,225,10,19,8 + LTEXT "Benutzt",IDC_STATIC,270,10,27,8 + LTEXT "%Benutzt",IDC_STATIC,305,10,31,8 + LTEXT "ID",IDC_STATIC,175,10,10,8 + LTEXT "Neue Quote:",IDC_STATIC,10,127,41,10 + EDITTEXT IDC_NEW_QUOTA,55,126,50,12,ES_AUTOHSCROLL | WS_DISABLED + PUSHBUTTON "Informationen zur Partition anzeigen", + IDC_PARTITION_INFO,190,125,117,14,WS_DISABLED + LTEXT "KBytes",IDC_STATIC,118,127,25,10 + CONTROL "Spin1",IDC_QUOTA_SPIN,"msctls_updown32",UDS_WRAP | + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | + WS_DISABLED,106,125,10,14 +END + +IDD_SET_AFS_ACL DIALOG DISCARDABLE 0, 0, 325, 228 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "fAFS-ACL festlegen" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "",IDC_DIR_NAME,62,12,249,10 + LISTBOX IDC_NORMAL_RIGHTS,10,46,175,75,LBS_USETABSTOPS | + LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | + WS_HSCROLL | WS_TABSTOP + LISTBOX IDC_NEGATIVE_ENTRIES,10,141,175,75,LBS_USETABSTOPS | + LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | + WS_HSCROLL | WS_TABSTOP + CONTROL "r - Read",IDC_READ,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,200,52,55,10 + CONTROL "w - Write",IDC_WRITE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,200,111,55,10 + CONTROL "l - Lookup",IDC_LOOKUP,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,200,66,55,10 + CONTROL "d - Delete",IDC_DELETE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,200,96,55,10 + CONTROL "i - Insert",IDC_INSERT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,200,81,55,10 + CONTROL "k - Lock",IDC_LOCK,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,200,126,55,10 + CONTROL "a - Administer",IDC_ADMINISTER,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,200,141,55,10 + PUSHBUTTON "&Hinzufügen...",IDC_ADD,270,45,45,14 + PUSHBUTTON "&Entfernen",IDC_REMOVE,270,70,45,14,WS_DISABLED + PUSHBUTTON "&Bereinigen",IDC_CLEAN,270,95,45,14 + DEFPUSHBUTTON "&OK",IDOK,270,150,45,14 + PUSHBUTTON "&Abbrechen",IDCANCEL,270,175,45,14 + PUSHBUTTON "&Hilfe",9,270,201,45,14 + LTEXT "Verzeichnis:",IDC_STATIC,15,12,45,10 + GROUPBOX "Berechtigungen",IDC_STATIC,195,41,65,115 + LTEXT "Normale",IDC_STATIC,10,30,28,8 + LTEXT "Name",IDC_COLUMN_3,69,38,20,8 + LTEXT "Berechtigungen",IDC_STATIC,10,38,52,8 + LTEXT "Negative Zahlen",IDC_STATIC,10,125,30,8 + LTEXT "Berechtigungen",IDC_STATIC,10,133,52,8 + LTEXT "Name",IDC_COLUMN_4,69,133,31,8 + GROUPBOX "",IDC_STATIC,10,5,305,20 + PUSHBUTTON "Ko&pieren...",IDC_COPY,270,120,45,14 +END + +IDD_MAKE_MOUNT_POINT DIALOG DISCARDABLE 0, 0, 219, 103 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Mount-Punkt erstellen" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_DIR,51,10,159,12,ES_AUTOHSCROLL + EDITTEXT IDC_VOLUME,51,25,159,12,ES_AUTOHSCROLL + EDITTEXT IDC_CELL,51,40,159,12,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,20,81,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,85,81,50,14 + PUSHBUTTON "Hilfe",9,150,81,50,14 + LTEXT "Verzeichnis:",IDC_STATIC,7,12,37,10 + LTEXT "Volume:",IDC_STATIC,7,28,25,10 + LTEXT "Zelle:",IDC_STATIC,7,42,22,10 + GROUPBOX "",IDC_STATIC,45,52,117,20 + LTEXT "Optionen:",IDC_STATIC,9,59,32,10 + CONTROL "Regulär",IDC_REGULAR,"Button",BS_AUTORADIOBUTTON | + WS_GROUP,48,59,38,10 + CONTROL "Lesen/Schreiben",IDC_RW,"Button",BS_AUTORADIOBUTTON,90, + 59,71,10 +END + +IDD_ADD_ACL DIALOG DISCARDABLE 0, 0, 264, 114 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ACL-Eintrag hinzufügen" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_NAME,35,70,224,12,ES_AUTOHSCROLL + CONTROL "r - Read",IDC_READ,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,20,15,45,10 + CONTROL "l - Lookup",IDC_LOOKUP2,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,20,25,50,10 + CONTROL "i - Insert",IDC_INSERT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,20,35,50,10 + CONTROL "d - Delete",IDC_DELETE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,20,45,50,10 + CONTROL "w - Write",IDC_WRITE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,80,15,50,10 + CONTROL "k - Lock",IDC_LOCK2,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,80,25,55,10 + CONTROL "a - Administer",IDC_ADMINISTER,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,80,35,60,10 + CONTROL "Normaler Eintrag",IDC_ADD_NORMAL_ENTRY,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,161,16,79,10 + CONTROL "Eingabe negativer Zahlen",IDC_ADD_NEGATIVE_ENTRY,"Button", + BS_AUTORADIOBUTTON,161,26,96,10 + PUSHBUTTON "OK",IDOK,101,90,50,14 + PUSHBUTTON "Abbrechen",IDCANCEL,155,90,50,14 + PUSHBUTTON "Hilfe",9,209,90,50,14 + LTEXT "Name:",IDC_STATIC,10,72,20,8 + GROUPBOX "Berechtigungen",IDC_STATIC,10,5,135,55 + GROUPBOX "Eintragungsart",IDC_STATIC,155,6,105,34 +END + +IDD_PARTITION_INFO DIALOG DISCARDABLE 0, 0, 139, 82 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Informationen zur Partition" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_TOTAL_SIZE,63,10,40,12,ES_AUTOHSCROLL | WS_DISABLED | + NOT WS_TABSTOP + EDITTEXT IDC_BLOCKS_FREE,63,25,40,12,ES_AUTOHSCROLL | WS_DISABLED | + NOT WS_TABSTOP + EDITTEXT IDC_PERCENT_USED,63,40,40,12,ES_AUTOHSCROLL | + WS_DISABLED | NOT WS_TABSTOP + DEFPUSHBUTTON "Schließen",IDOK,18,62,40,14 + PUSHBUTTON "Hilfe",9,75,62,40,14 + LTEXT "% benutzt:",IDC_STATIC,6,42,41,8 + LTEXT "Blöcke frei:",IDC_STATIC,5,27,40,8 + LTEXT "Größe insgesamt:",IDC_STATIC,5,12,55,8 + LTEXT "KBytes",IDC_STATIC,105,12,25,8 + LTEXT "KBytes",IDC_STATIC,105,27,25,8 +END + +IDD_COPY_ACL DIALOG DISCARDABLE 0, 0, 239, 88 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ACL kopieren" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_FROM_DIR,55,10,181,12,ES_AUTOHSCROLL | ES_READONLY + EDITTEXT IDC_TO_DIR,55,26,130,12,ES_AUTOHSCROLL + PUSHBUTTON "Durchsuchen",IDC_BROWSE,188,25,49,14 + CONTROL "Aktuelle Einträge löschen:",IDC_CLEAR,"Button", + BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,5,46,102,10 + DEFPUSHBUTTON "OK",IDOK,20,65,50,14,WS_DISABLED + PUSHBUTTON "Abbrechen",IDCANCEL,95,65,50,14 + PUSHBUTTON "Hilfe",9,170,65,50,14 + LTEXT "Kopieren von:",IDC_STATIC,5,12,47,8 + LTEXT "Kopieren nach:",IDC_STATIC,5,29,49,8 +END + +IDD_WHERE_IS DIALOG DISCARDABLE 0, 0, 299, 168 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Wo befindet sich" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Schließen",IDOK,65,145,50,14 + PUSHBUTTON "Hilfe",9,180,145,50,14 + LISTBOX IDC_LIST,10,20,280,115,LBS_SORT | LBS_USETABSTOPS | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | + WS_TABSTOP + LTEXT "Datei/Verzeichnis",IDC_STATIC,10,10,66,8 + LTEXT "Datei-Server",IDC_STATIC,128,10,56,8 +END + +IDD_RESULTS DIALOG DISCARDABLE 0, 0, 299, 168 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Ergebnisse" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Schließen",IDOK,65,145,50,14 + PUSHBUTTON "Hilfe",9,180,145,50,14 + LISTBOX IDC_LIST,10,20,280,115,LBS_USETABSTOPS | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | + WS_TABSTOP + LTEXT "Datei/Verzeichnis",-1,10,10,69,8 + LTEXT "Ergebnis",IDC_RESULTS_LABEL,128,10,44,8 +END + +IDD_MOUNT_POINTS DIALOG DISCARDABLE 0, 0, 299, 168 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Mount-Punkte" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Schließen",IDOK,65,145,50,14 + PUSHBUTTON "Hilfe",9,180,145,50,14 + LISTBOX IDC_LIST,10,20,280,115,LBS_SORT | LBS_USETABSTOPS | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | + WS_TABSTOP + LTEXT "Datei",IDC_STATIC,10,11,26,8 + LTEXT "Volume",IDC_STATIC,75,11,29,8 + LTEXT "Zelle",IDC_STATIC,155,11,20,8 + LTEXT "Typ",IDC_STATIC,230,11,20,8 +END + +IDD_DOWN_SERVERS DIALOG DISCARDABLE 0, 0, 209, 163 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Inaktive Server" +FONT 8, "MS Sans Serif" +BEGIN + LISTBOX 1029,10,20,190,110,LBS_SORT | LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_HSCROLL + LTEXT "Diese Servers sind noch inaktiv:",IDC_STATIC,10,10,114, + 8 + DEFPUSHBUTTON "OK",IDOK,82,140,45,15 +END + +IDD_SERVERSTATUS DIALOG DISCARDABLE 0, 0, 179, 143 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +CAPTION "Server-Status" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Lokale Zelle",IDC_LOCALCELL,"Button",BS_AUTORADIOBUTTON | + WS_GROUP | WS_TABSTOP,20,20,92,8 + CONTROL "Angegebene Zelle:",IDC_SPECIFIEDCELL,"Button", + BS_AUTORADIOBUTTON | WS_TABSTOP,20,36,89,10 + CONTROL "Alle Zellen",IDC_ALL_CELLS,"Button",BS_AUTORADIOBUTTON | + WS_TABSTOP,20,65,45,10 + CONTROL "Server nicht testen",IDC_DONTPROBESERVERS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,24,87,89,10 + PUSHBUTTON "Status anzeigen",IDC_SHOWSTATUS,5,120,58,14 + GROUPBOX "Zelle",IDC_STATIC,10,5,160,105,WS_GROUP + GROUPBOX "",IDC_STATIC,20,80,88,20,WS_GROUP + EDITTEXT IDC_CELL_NAME,30,47,130,12,ES_AUTOHSCROLL + PUSHBUTTON "Schließen",IDCANCEL,67,120,50,14 + PUSHBUTTON "Hilfe",9,120,120,50,14 +END + +IDD_AUTHENTICATION DIALOG DISCARDABLE 0, 0, 285, 158 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Authentifizierung" +FONT 8, "MS Sans Serif" +BEGIN + LISTBOX IDC_TOKEN_LIST,10,18,265,110,LBS_SORT | LBS_USETABSTOPS | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | + WS_TABSTOP + PUSHBUTTON "Token erhalten",ID_GET_TOKENS,15,137,55,14 + PUSHBUTTON "Token löschen",ID_DISCARD_TOKENS,80,137,55,14 + PUSHBUTTON "Schließen",IDCANCEL,145,137,55,14 + PUSHBUTTON "Hilfe",9,215,137,55,14 + LTEXT "Benutzername",IDC_STATIC,10,9,57,8 + LTEXT "Zellenname",IDC_STATIC,104,9,47,8 + LTEXT "Verfall",IDC_STATIC,222,9,50,8 +END + +IDD_KLOG_DIALOG DIALOGEX 0, 0, 169, 93 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_APPWINDOW +CAPTION "Token erhalten" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_NAME,40,10,115,12,ES_AUTOHSCROLL + EDITTEXT IDC_PASSWORD,40,30,115,12,ES_PASSWORD | ES_AUTOHSCROLL + EDITTEXT IDC_CELL_NAME,40,50,115,12,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,20,70,35,14,WS_DISABLED + PUSHBUTTON "Abbrechen",IDCANCEL,67,70,43,14 + PUSHBUTTON "Hilfe",9,120,70,35,14 + LTEXT "Name:",IDC_STATIC,17,12,22,8 + LTEXT "Kennwort:",IDC_STATIC,5,32,34,8 + LTEXT "Zelle:",IDC_STATIC,17,52,19,8 +END + +IDD_UNLOG_DIALOG DIALOGEX 0, 0, 185, 63 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_APPWINDOW +CAPTION "Token löschen" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,25,40,35,14 + PUSHBUTTON "Abbrechen",IDCANCEL,72,40,44,14 + PUSHBUTTON "Hilfe",9,125,40,35,14 + LTEXT "Zelle:",IDC_STATIC,10,17,21,8 + EDITTEXT IDC_CELL_NAME,40,15,136,12,ES_AUTOHSCROLL +END + +IDD_SUBMTINFO DIALOG DISCARDABLE 0, 0, 257, 186 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Submounts" +FONT 8, "MS Sans Serif" +BEGIN + LISTBOX IDC_LIST,10,20,183,157,LBS_SORT | LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_HSCROLL | WS_TABSTOP + PUSHBUTTON "Hinzufügen ",IDC_ADD,202,20,45,14 + PUSHBUTTON "Löschen",IDC_DELETE,202,39,45,14,WS_DISABLED + PUSHBUTTON "Ändern",IDC_CHANGE,202,58,45,14,WS_DISABLED + LTEXT "Submounts:",IDC_STATIC,10,10,50,8 + PUSHBUTTON "OK",IDOK,202,145,45,14 + PUSHBUTTON "Abbrechen",IDCANCEL,202,163,45,14 +END + +IDD_ADD_SUBMOUNT DIALOG DISCARDABLE 0, 0, 229, 79 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Submount hinzufügen" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_SHARE_NAME,77,8,141,12,ES_AUTOHSCROLL + EDITTEXT IDC_PATH_NAME,77,23,141,12,ES_AUTOHSCROLL + PUSHBUTTON "OK",IDOK,22,53,45,14 + PUSHBUTTON "Abbrechen",IDCANCEL,92,53,45,14 + PUSHBUTTON "Hilfe",9,167,53,45,14 + LTEXT "Gemeinsam benutzter Name:",IDC_STATIC,18,7,60,15 + LTEXT "Pfadname:",IDC_STATIC,18,25,41,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_SERVERSTATUS, DIALOG + BEGIN + RIGHTMARGIN, 171 + END + + IDD_AUTHENTICATION, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 278 + TOPMARGIN, 7 + BOTTOMMARGIN, 151 + END + + IDD_KLOG_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 162 + TOPMARGIN, 7 + BOTTOMMARGIN, 86 + END + + IDD_UNLOG_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 178 + TOPMARGIN, 7 + BOTTOMMARGIN, 56 + END + + IDD_SUBMTINFO, DIALOG + BEGIN + LEFTMARGIN, 10 + RIGHTMARGIN, 247 + BOTTOMMARGIN, 177 + END + + IDD_ADD_SUBMOUNT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 222 + TOPMARGIN, 7 + BOTTOMMARGIN, 25 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + ID_ACL_CLEAN "fs cleanacl" + ID_ACL_COPY "fs copyacl" + ID_ACL_LIST "fs listacl" + ID_ACL_SET "fs setacl" + ID_VOLUME_CHECK "fs checkvolumes" + ID_VOLUME_DISKFREE "fs diskfree" + ID_VOLUME_EXAMINE "fs examine" + ID_VOLUME_FLUSH "fs flushvolume" + ID_VOLUME_QUOTA_BRIEF "fs quota" + ID_VOLUME_QUOTA_FULL "fs listquota" + ID_VOLUME_QUOTA_SET "fs setvol" + ID_VOLUME_SET "fs setvol" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_FLUSH "fs flush" + ID_WHEREIS "fs whereis" + ID_SHOWCELL "fs whichcell" + ID_MOUNTPOINT_SHOW "fs lsmount" + ID_MOUNTPOINT_REMOVE "fs rmmount" + ID_SHOW_SERVER "fs whereis" + ID_AUTHENTICATE "Bei oder von AFS anmelden oder abmelden" + ID_SERVER_STATUS "Server überprüfen" + ID_VOLUME_PROPERTIES "fs listquota, diskfree, examine, quota, setquota, setvol" + ID_VOLUMEPARTITION_UPDATENAMEIDTABLE "fs checkvolumes" + ID_MOUNTPOINT_MAKE "fs mkmount" + IDS_FLUSH_FAILED "Leeren der aktiven Datei %o nicht möglich" + IDS_FLUSH_ERROR "Fehler beim Leeren von Datei %o: %s" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FLUSH_OK "Ausgewählte Datei(en) erfolgreich geleert" + IDS_CANT_GET_CELL "Fehler beim Bestimmen der Zelle: " + IDS_FLUSH_VOLUME_ERROR "Fehler beim Leeren des Volume für %o: %s" + IDS_FLUSH_VOLUME_OK "Volume erfolgreich geleert" + IDS_WHERE_IS "Datei %o befindet sich auf Host %s" + IDS_CLEANACL_NOT_SUPPORTED + "ACL für Datei %o kann nicht bereinigt werden: Clean Acl wird für DFS-Zugriffslisten nicht unterstützt" + IDS_ACL_IS_FINE "Zugriffsliste für %o ist sauber" + IDS_CLEANACL_INVALID_ARG + "ACL für Datei %o kann nicht bereinigt werden: Ungültiges Argument; mögliche Gründe: Datei nicht stellvertretend oder zu viele Benutzer in der Zugriffssteuerungsliste" + IDS_ANY_STRING "%o" + IDS_CLEANACL_DONE "Veraltete ACL-Einträge sind gelöscht worden." + ID_SUBMOUNTS "AFS-Submount erstellen oder löschen" + IDS_GETRIGHTS_ERROR "Zugriffsliste für Verzeichnis %o konnte nicht gelesen werden: %o" + IDS_DFSACL_ERROR "Mit diesem Befehl können DFS-ACLs nicht editiert werden" + IDS_SAVE_ACL_ERROR "ACL für %o kann nicht gespeichert werden: %o" + IDS_SAVE_ACL_EINVAL_ERROR + "ACL für %o kann nicht gespeichert werden: Ungültiges Argument; mögliche Gründe: Datei nicht in AFS; zu viele Benutzer in der Zugriffssteuerungsliste; es wurde versucht, einen nicht vorhandenen Benutzer zur Zugriffssteuerungsliste hinzuzufügen" + IDS_ACL_READ_ERROR "ACL für %o kann nicht gelesen werden: %o" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_NO_DFS_COPY_ACL "ACL kann nicht in Verzeichnis %o kopiert werden: Copy ACL wird für DFS-Zugriffslisten nicht unterstützt" + IDS_COPY_ACL_EINVAL_ERROR + "ACL kann nicht in Verzeichnis %o kopiert werden: Ungültiges Argument; mögliche Gründe: Datei nicht in AFS." + IDS_COPY_ACL_ERROR "ACL kann nicht nach %o kopiert werden: %o" + IDS_NOT_MOUNT_POINT_ERROR "%o ist kein Mount-Punkt." + IDS_LIST_MOUNT_POINT_ERROR "Fehler: %o" + IDS_MAKE_MP_NOT_AFS_ERROR + "Mount-Punkte müssen innerhalb des AFS-Dateisystems erstellt werden" + IDS_MOUNT_POINT_ERROR "Fehler beim Erstellen des Mount-Punktes: %o" + IDS_ERROR "Fehler: %o" + IDS_DELETED "Erfolgreich gelöscht" + IDS_SET_QUOTA_ERROR "Quote für Fehlereinstellungen: %o" + ID_SUBMOUNTS_CREATE "Ein AFS-Submount erstellen" + ID_SUBMOUNTS_EDIT "AFS-Submounts hinzufügen, ändern oder löschen" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CHECK_SERVERS_ERROR "Fehler beim Überprüfen des Status von Datei-Server-Maschinen: %o" + IDS_ALL_SERVERS_RUNNING "Alle Server sind aktiv." + IDS_CHECK_VOLUMES_OK "Alle VolumeID/Name-Zuordnungen überprüft." + IDS_CHECK_VOLUMES_ERROR "Fehler beim Überprüfen von VolumeID/Name-Zuordnungen: %o" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ACL_ENTRY_NAME_IN_USE + "Der von Ihnen ausgewählte Name ist bereits in Gebrauch. Bitte geben Sie einen anderen Namen ein." + IDS_REALLY_DEL_MOUNT_POINTS + "Sind Sie sicher, daß Sie den (die) ausgewählten Mount-Punkt(e) entfernen möchten?" + IDS_DIR_DOES_NOT_EXIST_ERROR "Das Verzeichnis '%o' ist nicht vorhanden." + IDS_CLEANACL_MSG "Veraltete ACLs werden gelöscht!" + IDS_COPY_ACL_OK "ACL erfolgreich kopiert." + IDS_GET_TOKENS_NO_AFS_SERVICE + "Token-Informationen können nicht gelesen werden: AFS-Service wurde vieleicht noch nicht gestartet." + IDS_GET_TOKENS_UNEXPECTED_ERROR + "Token-Informationen können nicht gelesen werden: Unerwarteter Fehler, Code %d." + IDS_GET_TOKENS_UNEXPECTED_ERROR2 + "Token-Informationen können nicht gelesen werden: Unerwarteter Fehler, Service %s.%s.%s, Code %d." + IDS_ENTER_QUOTA "Bitte geben Sie eine gültige Quote ein." + IDS_AUTHENTICATION_ITEM "&Authentifizierung..." + IDS_ACLS_ITEM "&Zugriffssteuerungslisten..." + IDS_VOL_PART_ITEM "&Volume/Partition" + IDS_VOL_PART_PROPS_ITEM "&Merkmale" + IDS_VOL_PART_REFRESH_ITEM "&Name/ID-Zuordnung aktualisieren" + IDS_MOUNT_POINT_ITEM "&Mount-Punkt" + IDS_MP_SHOW_ITEM "&Anzeigen..." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_MP_REMOVE_ITEM "&Entfernen..." + IDS_MP_MAKE_ITEM "&Erstellen..." + IDS_FLUSH_FILE_DIR_ITEM "Datei/Verz leeren" + IDS_FLUSH_VOLUME_ITEM "Vol&ume leeren" + IDS_SHOW_FILE_SERVERS_ITEM "&Datei-Server anzeigen..." + IDS_SHOW_CELL_ITEM "&Zellen anzeigen..." + IDS_SHOW_SERVER_STATUS_ITEM "Server-Status anzeigen..." + IDS_AFS_ITEM "&AFS" + IDS_SUBMOUNTS_ITEM "Su&bmounts" + IDS_GET_SUBMT_INFO_ERROR + "Submount-Informationen für gemeinsam benutzten Namen %o können nicht gelesen werden." + IDS_REALLY_DELETE_SUBMT "Gemeinsam benutzten Namen %o löschen?" + IDS_SUBMT_SAVE_FAILED "Ihre Änderungen der Submount-Datenbank sind fehlgeschlagen." + IDS_SUBMOUNTS_CREATE_ITEM "&Hinzufügen" + IDS_SUBMOUNTS_EDIT_ITEM "&Editieren..." + IDS_EDIT_PATH_NAME "Pfadname editieren" + IDS_SHOW_CELL "Zelle anzeigen" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SHOW_CELL_COLUMN "Zelle" + IDS_SHOW_FS "Datei-Server anzeigen" + IDS_SHOW_FS_COLUMN "Datei-Server" + IDS_REMOVE_MP "Mount-Punkte entfernen" + IDS_REMOVE_MP_COLUMN "Ergebnis" +END + +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_APP_TITLE "AFS Client" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE 9, 1 +#endif +#include "afs_shl_ext.rc2" // nicht mit Microsoft Visual C++ bearbeitete Ressourcen +#include "afxres.rc" // Standardkomponenten +#endif +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc b/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc index 097b2d523..0933ba43a 100644 --- a/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc +++ b/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc @@ -601,11 +601,6 @@ BEGIN IDS_MP_SHOW_ITEM "&Show..." END -STRINGTABLE DISCARDABLE -BEGIN - AFX_IDS_APP_TITLE "AFS Client" -END - STRINGTABLE DISCARDABLE BEGIN IDS_MP_REMOVE_ITEM "&Remove..." @@ -638,6 +633,23 @@ BEGIN IDS_REALLY_REMOVE_SYMLINK "Are you sure you want to remove the selected Symbolic Link?" END +STRINGTABLE DISCARDABLE +BEGIN + IDS_SYMBOLICLINK_ADD "&Add" + IDS_SYMBOLICLINK_EDIT "&Edit..." + IDS_SYMBOLICLINK_REMOVE "&Remove" + IDS_SYMBOLIC_LINK_ITEM "Symbolic &Link" + IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK "Unable to create symbolic link: %o." + IDS_UNABLE_TO_SET_CURRENT_DIRECTORY "Unable to set current directory." + IDS_CURRENT_DIRECTORY_PATH_TOO_LONG "Current directory pathname is too long." + IDS_CLEANACL_ERROR "Error Cleaning ACL(s)" +END + +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_APP_TITLE "AFS Client" +END + #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/WINNT/client_exp/lang/es_ES/afs_shl_ext.rc b/src/WINNT/client_exp/lang/es_ES/afs_shl_ext.rc index c4207a813..871a9ae11 100644 --- a/src/WINNT/client_exp/lang/es_ES/afs_shl_ext.rc +++ b/src/WINNT/client_exp/lang/es_ES/afs_shl_ext.rc @@ -615,11 +615,6 @@ BEGIN IDS_MP_SHOW_ITEM "&Mostrar..." END -STRINGTABLE DISCARDABLE -BEGIN - AFX_IDS_APP_TITLE "AFS Client" -END - STRINGTABLE DISCARDABLE BEGIN IDS_MP_REMOVE_ITEM "&Eliminar..." @@ -650,6 +645,11 @@ BEGIN IDS_REMOVE_MP_COLUMN "Resultado" END +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_APP_TITLE "AFS Client" +END + #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/WINNT/client_exp/lang/ja_JP/afs_shl_ext.rc b/src/WINNT/client_exp/lang/ja_JP/afs_shl_ext.rc index 0741e5b3a..693eb018a 100644 --- a/src/WINNT/client_exp/lang/ja_JP/afs_shl_ext.rc +++ b/src/WINNT/client_exp/lang/ja_JP/afs_shl_ext.rc @@ -599,11 +599,6 @@ BEGIN IDS_MP_SHOW_ITEM "•\ަ(&S)..." END -STRINGTABLE DISCARDABLE -BEGIN - AFX_IDS_APP_TITLE "AFS ƒNƒ‰ƒCƒAƒ“ƒg" -END - STRINGTABLE DISCARDABLE BEGIN IDS_MP_REMOVE_ITEM "íœ(&R)..." @@ -633,6 +628,11 @@ BEGIN IDS_REMOVE_MP_COLUMN "Œ‹‰Ê" END +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_APP_TITLE "AFS ƒNƒ‰ƒCƒAƒ“ƒg" +END + #endif // Japanese resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/WINNT/client_exp/lang/ko_KR/afs_shl_ext.rc b/src/WINNT/client_exp/lang/ko_KR/afs_shl_ext.rc index 0c50e92ed..83b1d8c4f 100644 --- a/src/WINNT/client_exp/lang/ko_KR/afs_shl_ext.rc +++ b/src/WINNT/client_exp/lang/ko_KR/afs_shl_ext.rc @@ -597,11 +597,6 @@ BEGIN IDS_MP_SHOW_ITEM "Ç¥½Ã(&S)..." END -STRINGTABLE DISCARDABLE -BEGIN - AFX_IDS_APP_TITLE "AFS Ŭ¶óÀ̾ðÆ®" -END - STRINGTABLE DISCARDABLE BEGIN IDS_MP_REMOVE_ITEM "Á¦°Å(&R)..." @@ -632,6 +627,11 @@ BEGIN IDS_REMOVE_MP_COLUMN "°á°ú" END +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_APP_TITLE "AFS Ŭ¶óÀ̾ðÆ®" +END + #endif // Korean resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/WINNT/client_exp/lang/pt_BR/afs_shl_ext.rc b/src/WINNT/client_exp/lang/pt_BR/afs_shl_ext.rc index 4267e028c..93dcee68f 100644 --- a/src/WINNT/client_exp/lang/pt_BR/afs_shl_ext.rc +++ b/src/WINNT/client_exp/lang/pt_BR/afs_shl_ext.rc @@ -598,11 +598,6 @@ BEGIN IDS_MP_SHOW_ITEM "E&xibir..." END -STRINGTABLE DISCARDABLE -BEGIN - AFX_IDS_APP_TITLE "AFS Client" -END - STRINGTABLE DISCARDABLE BEGIN IDS_MP_REMOVE_ITEM "&Remover..." @@ -633,6 +628,11 @@ BEGIN IDS_REMOVE_MP_COLUMN "Resultado" END +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_APP_TITLE "AFS Client" +END + #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/WINNT/client_exp/lang/zh_CN/afs_shl_ext.rc b/src/WINNT/client_exp/lang/zh_CN/afs_shl_ext.rc index 6e4d7e184..920444e6a 100644 --- a/src/WINNT/client_exp/lang/zh_CN/afs_shl_ext.rc +++ b/src/WINNT/client_exp/lang/zh_CN/afs_shl_ext.rc @@ -593,11 +593,6 @@ BEGIN IDS_MP_SHOW_ITEM "ÏÔʾ(&S)..." END -STRINGTABLE DISCARDABLE -BEGIN - AFX_IDS_APP_TITLE "AFS ¿Í»§»ú" -END - STRINGTABLE DISCARDABLE BEGIN IDS_MP_REMOVE_ITEM "³ýÈ¥(&R)..." @@ -627,6 +622,11 @@ BEGIN IDS_REMOVE_MP_COLUMN "½á¹û" END +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_APP_TITLE "AFS ¿Í»§»ú" +END + #endif // Chinese (P.R.C.) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/WINNT/client_exp/lang/zh_TW/afs_shl_ext.rc b/src/WINNT/client_exp/lang/zh_TW/afs_shl_ext.rc index 3814833d3..a16ed9c4b 100644 --- a/src/WINNT/client_exp/lang/zh_TW/afs_shl_ext.rc +++ b/src/WINNT/client_exp/lang/zh_TW/afs_shl_ext.rc @@ -593,11 +593,6 @@ BEGIN IDS_MP_SHOW_ITEM "Åã¥Ü(&S)..." END -STRINGTABLE DISCARDABLE -BEGIN - AFX_IDS_APP_TITLE "AFS ¥Î¤áºÝ" -END - STRINGTABLE DISCARDABLE BEGIN IDS_MP_REMOVE_ITEM "²¾°£(&R)..." @@ -627,6 +622,11 @@ BEGIN IDS_REMOVE_MP_COLUMN "µ²ªG" END +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDS_APP_TITLE "AFS ¥Î¤áºÝ" +END + #endif // Chinese (Taiwan) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/src/WINNT/client_exp/make_symbolic_link_dlg.cpp b/src/WINNT/client_exp/make_symbolic_link_dlg.cpp new file mode 100644 index 000000000..d1889fbc1 --- /dev/null +++ b/src/WINNT/client_exp/make_symbolic_link_dlg.cpp @@ -0,0 +1,144 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +extern "C" { +#include +#include +} + +#include "stdafx.h" +#include "afs_shl_ext.h" +#include "make_symbolic_link_dlg.h" +#include "gui2fs.h" +#include "msgs.h" +#define MAXSIZE 2048 /* most I'll get back from PIOCTL */ + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CMakeMountPointDlg dialog + + +CMakeSymbolicLinkDlg::CMakeSymbolicLinkDlg(CWnd* pParent /*=NULL*/) + : CDialog() +{ + InitModalIndirect (TaLocale_GetDialogResource (CMakeSymbolicLinkDlg::IDD), pParent); + + //{{AFX_DATA_INIT(CMakeSymbolicLinkDlg) + m_strName = _T(""); + m_strDir = _T(""); + //}}AFX_DATA_INIT +} + + +void CMakeSymbolicLinkDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CMakeSymbolicLinkDlg) + DDX_Control(pDX, IDOK, m_OK); + DDX_Control(pDX, IDC_NAME, m_Name); + DDX_Control(pDX, IDC_DIR, m_Dir); + DDX_Text(pDX, IDC_NAME, m_strName); + DDV_MaxChars(pDX, m_strName, 63); + DDX_Text(pDX, IDC_DIR, m_strDir); + DDV_MaxChars(pDX, m_strDir, 63); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CMakeSymbolicLinkDlg, CDialog) + //{{AFX_MSG_MAP(CMakeSymbolicLinkDlg) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CMakeSymbolicLinkDlg message handlers + +void CMakeSymbolicLinkDlg::OnOK() +{ + char space[64]; + UINT code; + int i; + UpdateData(TRUE); + CString strName; + CString strDir; + m_Name.GetWindowText(strName); + m_Dir.GetWindowText(strDir); + if (!IsPathInAfs(m_sBase)) { + MessageBeep((UINT)-1); + strDir+=" - Path is not in AFS directory"; + AfxMessageBox(strDir,MB_OK); + return; + } + if (m_sBase.GetLength()>MAX_PATH-2) + { + MessageBeep((UINT)-1); + ShowMessageBox(IDS_CURRENT_DIRECTORY_PATH_TOO_LONG,MB_OK,IDS_CURRENT_DIRECTORY_PATH_TOO_LONG); + } + if (!SetCurrentDirectory(m_sBase)) + { + MessageBeep((UINT)-1); + ShowMessageBox(IDS_UNABLE_TO_SET_CURRENT_DIRECTORY,MB_OK,IDS_UNABLE_TO_SET_CURRENT_DIRECTORY); + return; + } + if ((code=MakeSymbolicLink(strName,strDir))!=0){ + MessageBeep((UINT)-1); + ShowMessageBox(IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK,MB_OK,IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK,code); + return; + } + CDialog::OnOK(); +} +/* +void CMakeSymbolicLinkDlg::OnChangeName() +{ + CString strName; + m_Name.GetWindowText(strName); + if (strName.GetLength() > 63) { + MessageBeep((UINT)-1); + m_Name.SetWindowText(m_strName); + } else + m_strName = strName; + CheckEnableOk(); +} + +void CMakeSymbolicLinkDlg::OnChangeDir() +{ + m_Dir.GetWindowText(m_strDir); + if (!IsPathInAfs(m_strDir)) { + MessageBeep((UINT)-1); + m_Dir.SetWindowText(m_strDir); + } + CheckEnableOk(); +} +*/ +void CMakeSymbolicLinkDlg::CheckEnableOk() +{ + BOOL bEnable = FALSE; + + if ((m_strName.GetLength() > 0) && (m_strDir.GetLength() > 0)) + bEnable = TRUE; + + m_OK.EnableWindow(bEnable); +} + +BOOL CMakeSymbolicLinkDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + +// m_Dir.SetWindowText(m_strDir); +// m_Name.SetWindowText(m_strName); + UpdateData(FALSE); + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} diff --git a/src/WINNT/client_exp/make_symbolic_link_dlg.h b/src/WINNT/client_exp/make_symbolic_link_dlg.h new file mode 100644 index 000000000..db3c86dde --- /dev/null +++ b/src/WINNT/client_exp/make_symbolic_link_dlg.h @@ -0,0 +1,47 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +class CMakeSymbolicLinkDlg : public CDialog +{ + void CheckEnableOk(); + +// Construction +public: + CMakeSymbolicLinkDlg(CWnd* pParent = NULL); // standard constructor + void Setbase(const char *msg){m_sBase=msg;} +// Dialog Data + //{{AFX_DATA(CMakeSymbolicLinkDlg) + enum { IDD = IDD_SYMBOLICLINK_ADD }; + CButton m_OK; + CEdit m_Name; + CEdit m_Dir; + CString m_strName; + CString m_strDir; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CMakeSymbolicLinkDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + CString m_sBase; //Base directory + // Generated message map functions + //{{AFX_MSG(CMakeSymbolicLinkDlg) + afx_msg void OnChangeDir(); + afx_msg void OnChangeName(); + virtual void OnOK(); + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; diff --git a/src/WINNT/client_exp/partition_info_dlg.cpp b/src/WINNT/client_exp/partition_info_dlg.cpp index 8b365e50e..839b3bd13 100644 --- a/src/WINNT/client_exp/partition_info_dlg.cpp +++ b/src/WINNT/client_exp/partition_info_dlg.cpp @@ -59,9 +59,11 @@ END_MESSAGE_MAP() BOOL CPartitionInfoDlg::OnInitDialog() { + double percentUsed; // because partition sizes are big + CDialog::OnInitDialog(); - ASSERT(m_nFree != 0); + ASSERT(m_nSize != 0); CString strSize; strSize.Format("%ld", m_nSize); @@ -74,7 +76,8 @@ BOOL CPartitionInfoDlg::OnInitDialog() m_Size.SetWindowText(strSize); m_Free.SetWindowText(strFree); - m_PercentUsed.SetWindowText(strPerUsed); + percentUsed = ( double(m_nSize - m_nFree) * 100.0l ) / double(m_nSize); + strPerUsed.Format("%2.2lf", percentUsed ); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE diff --git a/src/WINNT/client_exp/resource.h b/src/WINNT/client_exp/resource.h index 4550009c9..702eab935 100644 --- a/src/WINNT/client_exp/resource.h +++ b/src/WINNT/client_exp/resource.h @@ -9,47 +9,170 @@ // // Used by afs_shl_ext.rc // -#define IDM_AUTHENTICATION 1 -#define IDM_ACL_SET 2 -#define IDM_VOLUME_PROPERTIES 3 -#define IDM_VOLUMEPARTITION_UPDATENAMEIDTABLE 4 -#define IDM_MOUNTPOINT_SHOW 5 -#define IDM_MOUNTPOINT_REMOVE 6 -#define IDM_MOUNTPOINT_MAKE 7 -#define IDM_FLUSH 8 -#define IDM_FLUSH_VOLUME 9 -#define IDM_SHOW_SERVER 10 -#define IDM_SHOWCELL 11 -#define IDM_SERVER_STATUS 12 -#define IDM_REMOVE_SYMLINK 13 -#define IDM_SUBMOUNTS_EDIT 14 -#define IDM_SUBMOUNTS 15 -#define IDM_ACL_CLEAN 16 -#define ID_GET_TOKENS 17 -#define ID_DISCARD_TOKENS 18 -#define IDM_SUBMOUNTS_CREATE 19 -#define IDD_KLOG_DIALOG 102 -#define IDR_MENU_FILE 129 -#define IDD_VOLUME_INFO 130 -#define IDD_SET_AFS_ACL 131 -#define IDD_DIALOG_TEST 132 -#define IDD_MAKE_MOUNT_POINT 133 -#define IDD_CLEAR_ACL 134 -#define IDD_SUBMTINFO 135 -#define IDD_ADD_ACL 136 -#define IDD_PARTITION_INFO 137 -#define IDD_COPY_ACL 138 -#define IDD_MENU_TEST_DLG 140 -#define IDD_WHICH_CELL 141 -#define IDD_WHERE_IS 142 -#define IDD_RESULTS 143 -#define IDD_MOUNT_POINTS 145 -#define IDD_DOWN_SERVERS 146 -#define IDD_SHOWSERVERS 147 -#define IDD_SERVERSTATUS 148 -#define IDD_AUTHENTICATION 149 -#define IDD_UNLOG_DIALOG 150 -#define IDD_ADD_SUBMOUNT 154 + +#define ID_ACL_CLEAN 0 +#define ID_ACL_COPY 1 +#define ID_ACL_LIST 2 +#define ID_ACL_SET 3 +#define ID_VOLUME_CHECK 4 +#define ID_VOLUME_DISKFREE 5 +#define ID_VOLUME_EXAMINE 6 +#define ID_VOLUME_FLUSH 7 +#define ID_VOLUME_QUOTA_BRIEF 8 +#define ID_VOLUME_QUOTA_FULL 9 +#define ID_VOLUME_QUOTA_SET 10 +#define ID_VOLUME_SET 11 + +#define ID_FLUSH 16 +#define ID_WHEREIS 17 +#define ID_SHOWCELL 18 +#define ID_MOUNTPOINT_SHOW 19 +#define ID_MOUNTPOINT_REMOVE 20 +#define ID_SHOW_SERVER 21 +#define ID_AUTHENTICATE 22 +#define ID_SERVER_STATUS 23 +#define ID_VOLUME_PROPERTIES 24 +#define ID_VOLUME_REFRESH 25 +#define ID_VOLUMEPARTITION_UPDATENAMEIDTABLE 26 +#define ID_ACL_COPY_FROM 27 +#define ID_ACL_COPY_TO 28 +#define ID_MOUNTPOINT_MAKE 29 +#define IDS_FLUSH_FAILED 30 +#define IDS_FLUSH_ERROR 31 + +#define IDS_FLUSH_OK 32 +#define IDS_CANT_GET_CELL 33 +#define IDS_FLUSH_VOLUME_ERROR 34 +#define IDS_FLUSH_VOLUME_OK 35 +#define IDS_WHERE_IS 36 +#define IDS_CLEANACL_NOT_SUPPORTED 37 +#define IDS_ACL_IS_FINE 38 +#define IDS_CLEANACL_INVALID_ARG 39 +#define IDS_ANY_STRING 40 +#define IDS_CLEANACL_DONE 41 +#define ID_SUBMOUNTS 42 +#define IDS_GETRIGHTS_ERROR 43 +#define IDS_DFSACL_ERROR 44 +#define IDS_SAVE_ACL_ERROR 45 +#define IDS_SAVE_ACL_EINVAL_ERROR 46 +#define IDS_ACL_READ_ERROR 47 + +#define IDS_NO_DFS_COPY_ACL 48 +#define IDS_COPY_ACL_EINVAL_ERROR 49 +#define IDS_COPY_ACL_ERROR 50 +#define IDS_NOT_MOUNT_POINT_ERROR 51 +#define IDS_LIST_MOUNT_POINT_ERROR 52 +#define IDS_MAKE_MP_NOT_AFS_ERROR 53 +#define IDS_MOUNT_POINT_ERROR 54 +#define IDS_ERROR 55 +#define IDS_DELETED 56 +#define IDS_SET_QUOTA_ERROR 57 +#define ID_SUBMOUNTS_CREATE 58 +#define ID_SUBMOUNTS_EDIT 59 + +#define IDS_CHECK_SERVERS_ERROR 64 +#define IDS_ALL_SERVERS_RUNNING 65 +#define IDS_CHECK_VOLUMES_OK 66 +#define IDS_CHECK_VOLUMES_ERROR 67 + +#define IDS_ACL_ENTRY_NAME_IN_USE 80 +#define IDS_REALLY_DEL_MOUNT_POINTS 81 +#define IDS_DIR_DOES_NOT_EXIST_ERROR 82 +#define IDS_CLEANACL_MSG 83 +#define IDS_COPY_ACL_OK 84 +#define IDS_GET_TOKENS_NO_AFS_SERVICE 85 +#define IDS_GET_TOKENS_UNEXPECTED_ERROR 86 +#define IDS_GET_TOKENS_UNEXPECTED_ERROR2 87 +#define IDS_ENTER_QUOTA 88 +#define IDS_AUTHENTICATION_ITEM 89 +#define IDS_ACLS_ITEM 90 +#define IDS_VOL_PART_ITEM 91 +#define IDS_VOL_PART_PROPS_ITEM 92 +#define IDS_VOL_PART_REFRESH_ITEM 93 +#define IDS_MOUNT_POINT_ITEM 94 +#define IDS_MP_SHOW_ITEM 95 + +#define IDS_MP_REMOVE_ITEM 96 +#define IDS_MP_MAKE_ITEM 97 +#define IDS_FLUSH_FILE_DIR_ITEM 98 +#define IDS_FLUSH_VOLUME_ITEM 99 +#define IDS_SHOW_FILE_SERVERS_ITEM 100 +#define IDS_SHOW_CELL_ITEM 101 +#define IDS_SHOW_SERVER_STATUS_ITEM 102 +#define IDS_AFS_ITEM 103 +#define IDS_SUBMOUNTS_ITEM 104 +#define IDS_GET_SUBMT_INFO_ERROR 105 +#define IDS_REALLY_DELETE_SUBMT 106 +#define IDS_SUBMT_SAVE_FAILED 107 +#define IDS_SUBMOUNTS_CREATE_ITEM 108 +#define IDS_SUBMOUNTS_EDIT_ITEM 109 +#define IDS_EDIT_PATH_NAME 110 +#define IDS_SHOW_CELL 111 + +#define IDS_SHOW_CELL_COLUMN 112 +#define IDS_SHOW_FS 113 +#define IDS_SHOW_FS_COLUMN 114 +#define IDS_REMOVE_MP 115 +#define IDS_REMOVE_MP_COLUMN 116 +#define IDS_REMOVE_SYMLINK_ITEM 117 +#define IDS_REALLY_REMOVE_SYMLINK 118 + +#define IDS_SYMBOLICLINK_ADD 128 +#define IDS_SYMBOLICLINK_EDIT 129 +#define IDS_SYMBOLICLINK_REMOVE 130 +#define IDS_SYMBOLIC_LINK_ITEM 131 +#define IDS_UNABLE_TO_CREATE_SYMBOLIC_LINK 132 +#define IDS_UNABLE_TO_SET_CURRENT_DIRECTORY 133 +#define IDS_CURRENT_DIRECTORY_PATH_TOO_LONG 134 +#define IDS_CLEANACL_ERROR 135 + +#define IDM_AUTHENTICATION 0 +#define IDM_ACL_SET 1 +#define IDM_VOLUME_PROPERTIES 2 +#define IDM_VOLUMEPARTITION_UPDATENAMEIDTABLE 3 +#define IDM_MOUNTPOINT_SHOW 4 +#define IDM_MOUNTPOINT_REMOVE 5 +#define IDM_MOUNTPOINT_MAKE 6 +#define IDM_FLUSH 7 +#define IDM_FLUSH_VOLUME 8 +#define IDM_SHOW_SERVER 9 +#define IDM_SHOWCELL 10 +#define IDM_SERVER_STATUS 11 +#define IDM_SYMBOLICLINK_REMOVE 12 +#define IDM_SYMBOLICLINK_ADD 13 +#define IDM_SUBMOUNTS 14 +#define IDM_ACL_CLEAN 15 +#define IDM_SUBMOUNTS_EDIT 16 +#define IDM_REMOVE_SYMLINK 17 + +#define ID_GET_TOKENS 917 +#define ID_DISCARD_TOKENS 918 +#define IDD_KLOG_DIALOG 920 +#define IDR_MENU_FILE 930 +#define IDD_VOLUME_INFO 931 +#define IDD_SET_AFS_ACL 932 +#define IDD_DIALOG_TEST 933 +#define IDD_MAKE_MOUNT_POINT 934 +#define IDD_CLEAR_ACL 935 +#define IDD_SUBMTINFO 936 +#define IDD_ADD_ACL 937 +#define IDD_PARTITION_INFO 938 +#define IDD_COPY_ACL 940 +#define IDD_MENU_TEST_DLG 941 +#define IDD_WHICH_CELL 942 +#define IDD_WHERE_IS 943 +#define IDD_RESULTS 945 +#define IDD_MOUNT_POINTS 946 +#define IDD_DOWN_SERVERS 947 +#define IDD_SHOWSERVERS 948 +#define IDD_SERVERSTATUS 949 +#define IDD_AUTHENTICATION 950 +#define IDD_UNLOG_DIALOG 954 +#define IDD_ADD_SUBMOUNT 955 +#define IDD_SYMBOLICLINK_ADD 956 +#define ID_REMOVE_SYMLINK 957 +#define ID_SYMBOLICLINK_ADD 958 +#define ID_SYMBOLICLINK_REMOVE 959 #define IDC_LIST 1001 #define IDC_PASSWORD 1002 #define IDC_OFFLINE_MSG 1003 @@ -136,113 +259,13 @@ #define IDC_STATIC_CONTROL2 1084 #define IDC_SHARE_NAME 1085 #define IDC_PATH_NAME 1086 -#define ID_ACL_CLEAN 32772 -#define ID_ACL_COPY 32773 -#define ID_ACL_LIST 32774 -#define ID_ACL_SET 32775 -#define ID_VOLUME_CHECK 32776 -#define ID_VOLUME_DISKFREE 32777 -#define ID_VOLUME_EXAMINE 32778 -#define ID_VOLUME_FLUSH 32779 -#define ID_VOLUME_QUOTA_BRIEF 32780 -#define ID_VOLUME_QUOTA_FULL 32781 -#define ID_VOLUME_QUOTA_SET 32782 -#define ID_VOLUME_SET 32783 -#define ID_FLUSH 32784 -#define ID_WHEREIS 32785 -#define ID_SHOWCELL 32786 -#define ID_MOUNTPOINT_SHOW 32787 -#define ID_MOUNTPOINT_REMOVE 32788 -#define ID_SHOW_SERVER 32789 -#define ID_AUTHENTICATE 32790 -#define ID_SERVER_STATUS 32791 -#define ID_VOLUME_PROPERTIES 32792 -#define ID_VOLUME_REFRESH 32793 -#define ID_VOLUMEPARTITION_UPDATENAMEIDTABLE 32794 -#define ID_ACL_COPY_FROM 32795 -#define ID_ACL_COPY_TO 32796 -#define ID_MOUNTPOINT_MAKE 32797 -#define IDS_FLUSH_FAILED 32798 -#define IDS_FLUSH_ERROR 32799 -#define IDS_FLUSH_OK 32800 -#define IDS_CANT_GET_CELL 32801 -#define IDS_FLUSH_VOLUME_ERROR 32802 -#define IDS_FLUSH_VOLUME_OK 32803 -#define IDS_WHERE_IS 32804 -#define IDS_CLEANACL_NOT_SUPPORTED 32805 -#define IDS_ACL_IS_FINE 32806 -#define IDS_CLEANACL_INVALID_ARG 32807 -#define IDS_ANY_STRING 32808 -#define IDS_CLEANACL_DONE 32809 -#define IDS_CLEANACL_ERROR 32810 -#define ID_SUBMOUNTS 32810 -#define IDS_GETRIGHTS_ERROR 32811 -#define IDS_DFSACL_ERROR 32812 -#define IDS_SAVE_ACL_ERROR 32813 -#define IDS_SAVE_ACL_EINVAL_ERROR 32814 -#define IDS_ACL_READ_ERROR 32815 -#define IDS_NO_DFS_COPY_ACL 32816 -#define IDS_COPY_ACL_EINVAL_ERROR 32817 -#define IDS_COPY_ACL_ERROR 32818 -#define IDS_NOT_MOUNT_POINT_ERROR 32819 -#define IDS_LIST_MOUNT_POINT_ERROR 32820 -#define IDS_MAKE_MP_NOT_AFS_ERROR 32821 -#define IDS_MOUNT_POINT_ERROR 32822 -#define IDS_ERROR 32823 -#define IDS_DELETED 32824 -#define IDS_SET_QUOTA_ERROR 32825 -#define ID_SUBMOUNTS_CREATE 32826 -#define ID_SUBMOUNTS_EDIT 32827 -#define ID_REMOVE_SYMLINK 32828 -#define IDS_CHECK_SERVERS_ERROR 59146 -#define IDS_ALL_SERVERS_RUNNING 59147 -#define IDS_CHECK_VOLUMES_OK 59150 -#define IDS_CHECK_VOLUMES_ERROR 59151 -#define IDS_ACL_ENTRY_NAME_IN_USE 59152 -#define IDS_REALLY_DEL_MOUNT_POINTS 59153 -#define IDS_DIR_DOES_NOT_EXIST_ERROR 59154 -#define IDS_CLEANACL_MSG 59155 -#define IDS_COPY_ACL_OK 59156 -#define IDS_GET_TOKENS_NO_AFS_SERVICE 59157 -#define IDS_GET_TOKENS_UNEXPECTED_ERROR 59158 -#define IDS_GET_TOKENS_UNEXPECTED_ERROR2 59159 -#define IDS_ENTER_QUOTA 59160 -#define IDS_AUTHENTICATION_ITEM 59161 -#define IDS_ACLS_ITEM 59162 -#define IDS_VOL_PART_ITEM 59163 -#define IDS_VOL_PART_PROPS_ITEM 59164 -#define IDS_VOL_PART_REFRESH_ITEM 59165 -#define IDS_MOUNT_POINT_ITEM 59166 -#define IDS_MP_SHOW_ITEM 59167 -#define IDS_MP_REMOVE_ITEM 59168 -#define IDS_MP_MAKE_ITEM 59169 -#define IDS_FLUSH_FILE_DIR_ITEM 59170 -#define IDS_FLUSH_VOLUME_ITEM 59171 -#define IDS_SHOW_FILE_SERVERS_ITEM 59172 -#define IDS_SHOW_CELL_ITEM 59173 -#define IDS_SHOW_SERVER_STATUS_ITEM 59174 -#define IDS_AFS_ITEM 59175 -#define IDS_SUBMOUNTS_ITEM 59176 -#define IDS_GET_SUBMT_INFO_ERROR 59177 -#define IDS_REALLY_DELETE_SUBMT 59178 -#define IDS_SUBMT_SAVE_FAILED 59179 -#define IDS_SUBMOUNTS_CREATE_ITEM 59180 -#define IDS_SUBMOUNTS_EDIT_ITEM 59181 -#define IDS_EDIT_PATH_NAME 59182 -#define IDS_SHOW_CELL 59183 -#define IDS_SHOW_CELL_COLUMN 59184 -#define IDS_SHOW_FS 59185 -#define IDS_SHOW_FS_COLUMN 59186 -#define IDS_REMOVE_MP 59187 -#define IDS_REMOVE_MP_COLUMN 59188 -#define IDS_REMOVE_SYMLINK_ITEM 59189 -#define IDS_REALLY_REMOVE_SYMLINK 59190 + // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 155 +#define _APS_NEXT_RESOURCE_VALUE 163 #define _APS_NEXT_COMMAND_VALUE 32829 #define _APS_NEXT_CONTROL_VALUE 1087 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/src/WINNT/client_exp/shell_ext.cpp b/src/WINNT/client_exp/shell_ext.cpp index 304cd7796..afe332549 100644 --- a/src/WINNT/client_exp/shell_ext.cpp +++ b/src/WINNT/client_exp/shell_ext.cpp @@ -27,7 +27,7 @@ extern "C" { #include "server_status_dlg.h" #include "auth_dlg.h" #include "submounts_dlg.h" -#include "gui2fs.h" +#include "make_symbolic_link_dlg.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -60,21 +60,35 @@ static BOOL IsADir(const CString& strName) // CShellExt IMPLEMENT_DYNCREATE(CShellExt, CCmdTarget) +#define REG_CLIENT_PARMS_KEY "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters" +#define OVERLAYENABLED 1 CShellExt::CShellExt() { + HKEY NPKey; EnableAutomation(); nCMRefCount++; HRESULT hr; + UINT code; + DWORD ShellOption,LSPsize,LSPtype; hr = SHGetMalloc(&m_pAlloc); + m_bIsOverlayEnabled=FALSE; if (FAILED(hr)) m_pAlloc = NULL; + RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PARMS_KEY,0, KEY_QUERY_VALUE, &NPKey); + LSPsize=sizeof(ShellOption); + code=RegQueryValueEx(NPKey, "ShellOption", NULL, + &LSPtype, (LPBYTE)&ShellOption, &LSPsize); + RegCloseKey (NPKey); + m_bIsOverlayEnabled=((code==0) && (LSPtype==REG_DWORD) && ((ShellOption & OVERLAYENABLED)!=0)); + TRACE("Create CShellExt, Ref count %d/n",nCMRefCount); } CShellExt::~CShellExt() { if(m_pAlloc) m_pAlloc->Release(); nCMRefCount--; + TRACE("Destroy CShellExt, Ref count %d/n",nCMRefCount); } @@ -159,7 +173,7 @@ STDMETHODIMP CShellExt::XMenuExt::QueryContextMenu(HMENU hMenu,UINT indexMenu, // Don't add any menu items if we're being asked to deal with this file as a shortcut. if (uFlags & CMF_VERBSONLY) - return ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_NULL, (USHORT)0)); + return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, (USHORT)0); // Check to see if there's already an AFS menu here; if so, remove it int nItemsNow = GetMenuItemCount (hMenu); @@ -219,8 +233,15 @@ STDMETHODIMP CShellExt::XMenuExt::QueryContextMenu(HMENU hMenu,UINT indexMenu, ::InsertMenu(hAfsMenu, indexAfsMenu++, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_SHOW_SERVER, GetMessageString(IDS_SHOW_FILE_SERVERS_ITEM)); ::InsertMenu(hAfsMenu, indexAfsMenu++, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_SHOWCELL, GetMessageString(IDS_SHOW_CELL_ITEM)); ::InsertMenu(hAfsMenu, indexAfsMenu++, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_SERVER_STATUS, GetMessageString(IDS_SHOW_SERVER_STATUS_ITEM)); - if (pThis->m_bIsSymlink) - ::InsertMenu(hAfsMenu, indexAfsMenu++, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_REMOVE_SYMLINK, GetMessageString(IDS_REMOVE_SYMLINK_ITEM)); + + HMENU hSymbolicMenu = CreatePopupMenu(); + int indexSymbolicMenu = 0; + ::InsertMenu(hSymbolicMenu, indexSymbolicMenu++, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_SYMBOLICLINK_ADD, GetMessageString(IDS_SYMBOLICLINK_ADD)); + // ::InsertMenu(hSymbolicMenu, indexSymbolicMenu, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_SYMBOLICLINK_EDIT, GetMessageString(IDS_SYMBOLICLINK_EDIT)); + // ::EnableMenuItem(hSymbolicMenu,indexSymbolicMenu++,((pThis->m_bIsSymlink)?MF_ENABLED:MF_GRAYED)|MF_BYPOSITION); + ::InsertMenu(hSymbolicMenu, indexSymbolicMenu, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_SYMBOLICLINK_REMOVE, GetMessageString(IDS_SYMBOLICLINK_REMOVE)); + ::EnableMenuItem(hSymbolicMenu,indexSymbolicMenu++,((pThis->m_bIsSymlink)?MF_ENABLED:MF_GRAYED)|MF_BYPOSITION); + ::InsertMenu(hAfsMenu, indexAfsMenu++, MF_STRING | MF_BYPOSITION | MF_POPUP, (UINT)hSymbolicMenu, GetMessageString(IDS_SYMBOLIC_LINK_ITEM)); // The Submounts menu has been removed because the AFS tray icon // and control panel now support mapping drives directly to an AFS @@ -241,8 +262,8 @@ STDMETHODIMP CShellExt::XMenuExt::QueryContextMenu(HMENU hMenu,UINT indexMenu, // Add a separator after us ::InsertMenu (hMenu, indexMenu + indexShellMenu++, MF_STRING | MF_BYPOSITION | MF_SEPARATOR, 0, TEXT("")); - return ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_NULL, - (USHORT)indexAfsMenu + indexVolPartMenu + indexMountPointMenu + indexShellMenu)); + return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, + (USHORT)indexAfsMenu + indexVolPartMenu + indexMountPointMenu + indexShellMenu + indexSymbolicMenu); } STDMETHODIMP CShellExt::XMenuExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpici) @@ -318,7 +339,8 @@ STDMETHODIMP CShellExt::XMenuExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpici) dlg.DoModal(); } break; - + + /* case IDM_SUBMOUNTS_EDIT: { CSubmountsDlg dlg; dlg.DoModal(); @@ -332,18 +354,56 @@ STDMETHODIMP CShellExt::XMenuExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpici) dlg.DoModal(); } break; - case IDM_REMOVE_SYMLINK: { - if (files.GetSize()>1) - break; - int nChoice = ShowMessageBox(IDS_REALLY_REMOVE_SYMLINK, MB_ICONQUESTION | MB_YESNO, IDS_REALLY_REMOVE_SYMLINK); - if (nChoice == IDYES) - RemoveSymlink(files.GetAt(0)); - } - break; - default: - ASSERT(FALSE); - Release(); - return E_INVALIDARG; + */ + case IDM_SYMBOLICLINK_REMOVE: { + if (files.GetSize()>1) + break; + CString msg=files.GetAt(0); + int i; + if ((i=msg.ReverseFind('\\'))>0) + msg=msg.Left(i+1); + else if ((i=msg.ReverseFind(':'))>0) + msg=msg.Left(i+1)+"\\"; + if (!SetCurrentDirectory(msg)) + { + MessageBeep((UINT)-1); + ShowMessageBox(IDS_UNABLE_TO_SET_CURRENT_DIRECTORY,MB_OK,IDS_UNABLE_TO_SET_CURRENT_DIRECTORY); + break; + } + msg=files.GetAt(0); + if ((i=msg.ReverseFind('\\'))>0||((i=msg.ReverseFind(':'))>0)) + msg=msg.Right(msg.GetLength()-i-1); + int nChoice = ShowMessageBox(IDS_REALLY_REMOVE_SYMLINK, MB_ICONQUESTION | MB_YESNO, IDS_REALLY_REMOVE_SYMLINK,msg); + if (nChoice == IDYES) + RemoveSymlink(files.GetAt(0)); + } + break; + + case IDM_SYMBOLICLINK_ADD: { + CString msg=files.GetAt(0); + int i; + if ((i=msg.ReverseFind('\\'))>0) + msg=msg.Left(i+1); + else if ((i=msg.ReverseFind(':'))>0) + msg=msg.Left(i+1)+"\\"; + CMakeSymbolicLinkDlg dlg; + dlg.Setbase(msg); + dlg.DoModal(); + } + break; + + case IDM_REMOVE_SYMLINK: { + if (files.GetSize()>1) + break; + int nChoice = ShowMessageBox(IDS_REALLY_REMOVE_SYMLINK, MB_ICONQUESTION | MB_YESNO, IDS_REALLY_REMOVE_SYMLINK); + if (nChoice == IDYES) + RemoveSymlink(files.GetAt(0)); + } + break; + default: + ASSERT(FALSE); + Release(); + return E_INVALIDARG; } Release(); @@ -399,10 +459,10 @@ STDMETHODIMP CShellExt::XMenuExt::GetCommandString(UINT idCmd, UINT uType, case IDM_SERVER_STATUS: nCmdStrID = ID_SERVER_STATUS; break; - case IDM_SUBMOUNTS_CREATE: nCmdStrID = ID_SUBMOUNTS_CREATE; + case IDM_SYMBOLICLINK_ADD: nCmdStrID = ID_SYMBOLICLINK_ADD; break; - case IDM_SUBMOUNTS_EDIT: nCmdStrID = ID_SUBMOUNTS_EDIT; + case IDM_SYMBOLICLINK_REMOVE: nCmdStrID = ID_SYMBOLICLINK_REMOVE; break; case IDM_REMOVE_SYMLINK: nCmdStrID= ID_REMOVE_SYMLINK; @@ -462,8 +522,9 @@ STDMETHODIMP CShellExt::XShellInit::Initialize(LPCITEMIDLIST pidlFolder, IDataOb // Use the given IDataObject to get a list of filenames (CF_HDROP) hres = pdobj->GetData(&fmte, &medium); - if (FAILED(hres)) + if (FAILED(hres)) { return E_FAIL; + } int nNumFiles = DragQueryFile((HDROP)medium.hGlobal, 0xFFFFFFFF, NULL, 0); if (nNumFiles == 0) @@ -500,7 +561,7 @@ STDMETHODIMP CShellExt::XShellInit::Initialize(LPCITEMIDLIST pidlFolder, IDataOb } if (pThis->m_astrFileNames.GetSize() > 0) - hres = S_OK; + hres = NOERROR; else hres = E_FAIL; } diff --git a/src/WINNT/client_exp/shell_ext.h b/src/WINNT/client_exp/shell_ext.h index de826a2eb..9265644a7 100644 --- a/src/WINNT/client_exp/shell_ext.h +++ b/src/WINNT/client_exp/shell_ext.h @@ -37,6 +37,8 @@ class CShellExt : public CCmdTarget BOOL m_bDirSelected; BOOL m_bIsSymlink; // is symbolic link! TCHAR m_szFile[MAX_PATH]; + BOOL m_bIsOverlayEnabled; + BOOL IsOverlayEnabled(){return m_bIsOverlayEnabled;} CStringArray m_astrFileNames; @@ -85,7 +87,7 @@ protected: // IShellExtInit interface BEGIN_INTERFACE_PART(ShellInit, IShellExtInit) - STDMETHOD(Initialize)(LPCITEMIDLIST pidlFolder,LPDATAOBJECT lpdobj, HKEY hkeyProgID); + STDMETHOD(Initialize)(LPCITEMIDLIST pidlFolder,IDataObject *lpdobj, HKEY hkeyProgID); END_INTERFACE_PART(ShellInit) BEGIN_INTERFACE_PART(IconExt, IShellIconOverlayIdentifier) diff --git a/src/WINNT/client_exp/stdafx.h b/src/WINNT/client_exp/stdafx.h index 422384337..ea5853f1e 100644 --- a/src/WINNT/client_exp/stdafx.h +++ b/src/WINNT/client_exp/stdafx.h @@ -48,5 +48,8 @@ #include +#if defined (_DEBUG) && defined (AFS_CRTDBG_MAP_ALLOC) +#define new DEBUG_NEW +#endif #endif // !defined(AFX_STDAFX_H__601A9D0D_6CD3_11D1_BAE7_00C04FD140D2__INCLUDED_) diff --git a/src/WINNT/client_osi/NTMakefile b/src/WINNT/client_osi/NTMakefile index 6e503ff9b..631b00657 100644 --- a/src/WINNT/client_osi/NTMakefile +++ b/src/WINNT/client_osi/NTMakefile @@ -1,10 +1,14 @@ -# Copyright (C) 1998 Transarc Corporation. All rights reserved. +# Copyright 2000, International Business Machines Corporation and others. +# All Rights Reserved. +# +# This software has been released under the terms of the IBM Public +# License. For details, see the LICENSE file in the top-level source +# directory or online at http://www.openafs.org/dl/license10.html # - +RELDIR=WINNT\client_osi !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version - ############################################################################ # Definitions for installing header files @@ -27,11 +31,24 @@ INCFILES =\ $(INCFILEDIR)\osilog.h \ $(INCFILEDIR)\osisleep.h \ $(INCFILEDIR)\perf.h \ - $(INCFILEDIR)\osithrdnt.h - +!IFDEF OSIEVENT + $(INCFILEDIR)\osievent.h \ +!ENDIF + $(INCFILEDIR)\osithrdnt.h \ + $(INCFILEDIR)\largeint.h $(INCFILEDIR)\dbrpc.h: dbrpc.h +EXEFILE = $(DESTDIR)\bin\osidebug.exe + +EXEOBJS = \ + osidebug.obj + +EXELIBS = \ + rpcndr.lib rpcrt4.lib rpcns4.lib \ + Ws2_32.lib \ + $(DESTDIR)\lib\libosi.lib + ############################################################################ # Definitions for building a DLL. @@ -40,17 +57,17 @@ DLLFILE = $(DESTDIR)\root.client\usr\vice\etc\libosi.dll ILIBDIR = $(DESTDIR)\lib DLLOBJS =\ - dbrpc_s.obj \ - osistatl.obj \ - osibasel.obj \ - osisleep.obj \ - osiqueue.obj \ - osiltype.obj \ - osidb.obj \ - osifd.obj \ - osilog.obj \ - osiutils.obj \ - libosi.res + $(OUT)\dbrpc_s.obj \ + $(OUT)\osistatl.obj \ + $(OUT)\osibasel.obj \ + $(OUT)\osisleep.obj \ + $(OUT)\osiqueue.obj \ + $(OUT)\osiltype.obj \ + $(OUT)\osidb.obj \ + $(OUT)\osifd.obj \ + $(OUT)\osilog.obj \ + $(OUT)\osiutils.obj \ + $(OUT)\libosi.res DLLLIBS =\ rpcndr.lib \ @@ -65,23 +82,53 @@ $(DLLFILE): $(DLLOBJS) $(DEL) $*.lib $*.exp +############################################################################ +# build osievent.dll +OSIEVENTDLL = $(DESTDIR)\root.client\usr\vice\etc\osievent.dll + +osievent.rc: osievent.mc + mc $*.mc + +$(OUT)\osievent.res: osievent.rc + +$(OUT)\osievent.dll: $(OUT)\osievent.res + link -dll -noentry -out:$*.dll $*.res + +$(OSIEVENTDLL): $(OUT)\osievent.dll + $(COPY) osievent.dll $(DESTDIR)\root.client\usr\vice\etc\. + +############################################################################ +# build osidebug too + +$(OUT)\osidebug.res: osidebug.rc + +$(EXEOBJS) : osidebug.c + +$(EXEFILE) : $(EXEOBJS) + $(EXEGUILINK) $(EXELIBS) + ############################################################################ # midl on dbrpc.idl dbrpc.h dbrpc_c.c dbrpc_s.c: dbrpc.idl - $(MIDL) -Zp4 -cpp_cmd $(cc) -cpp_opt "-E" dbrpc.idl - + $(MIDL) $(AFSDEV_AUXMIDLFLAGS) -Zp4 -cpp_cmd $(cc) -cpp_opt "-E" /no_robust $** ############################################################################ # generate versioninfo resources -libosi.res: libosi.rc AFS_component_version_number.h +$(OUT)\libosi.res: libosi.rc AFS_component_version_number.h ############################################################################ # Install target; primary makefile target install_headers: $(INCFILES) +!IFDEF OSIEVENT +install: $(OSIEVENTDLL) install_headers $(DLLFILE) +!ELSE install: install_headers $(DLLFILE) +!ENDIF + +install_debug: $(OUT)\osidebug.res $(EXEFILE) install9x: install @@ -89,5 +136,8 @@ install9x: install # Local clean target; augments predefined clean target clean:: - $(DEL) dbrpc_s.c dbrpc_c.c dbrpc.h $(DLLFILE) $(INCFILES) + $(DEL) dbrpc_s.c dbrpc_c.c dbrpc.h $(DLLFILE) $(INCFILES) $(OSIEVENTDLL) + $(DEL) $(EXEOBJS) $(EXEFILE) $(OUT)\*.res $(OUT)\*.DLL + +mkdir: diff --git a/src/WINNT/client_osi/NTMakefile-TestOSI b/src/WINNT/client_osi/NTMakefile-TestOSI new file mode 100644 index 000000000..00025e132 --- /dev/null +++ b/src/WINNT/client_osi/NTMakefile-TestOSI @@ -0,0 +1,39 @@ +# Copyright (C) 1998 Transarc Corporation. All rights reserved. +# + +!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) +!INCLUDE ..\..\config\NTMakefile.version + + +EXEFILE = $(DESTDIR)\root.client\usr\vice\etc\osidebug.exe + +EXEOBJS = \ + osidebug.obj + +EXELIBS = \ + $(DESTDIR)\lib\libosi.lib + +VCLIBS =\ + $(DESTDIR)\lib\libosi.lib + + +$(EXEFILE) : $(EXEOBJS) + $(EXEGUILINK) $(VCLIBS) + +############################################################################ +# generate versioninfo resources + +osidebug.res: osidebug.rc + +############################################################################ +# Install target; primary makefile target + +install: $(EXEFILE) + +############################################################################ +# Local clean target; augments predefined clean target + +clean:: + $(DEL) osidebug.obj osidebug.exe osidebug.res + + diff --git a/src/WINNT/client_osi/basic.c b/src/WINNT/client_osi/basic.c index 116d83d58..fa3736f18 100644 --- a/src/WINNT/client_osi/basic.c +++ b/src/WINNT/client_osi/basic.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/largeint.h b/src/WINNT/client_osi/largeint.h new file mode 100644 index 000000000..393b69bcd --- /dev/null +++ b/src/WINNT/client_osi/largeint.h @@ -0,0 +1,257 @@ +/*-- + +Module Name: + + largeint.h + +Abstract: + + Include file for sample Large Integer Arithmetic routines. + This file includes all of the prototypes for the routines found in + largeint.lib. For complete descriptions of these functions, see the + largeint.s source file for MIPS, or the divlarge.c and largeint.asm + source files for x86. + +Revision History: + +--*/ + +#ifdef __cplusplus +extern "C" { +#endif + +// +//Large integer arithmetic routines. +// + +// +// Large integer add - 64-bits + 64-bits -> 64-bits +// + +LARGE_INTEGER +WINAPI +LargeIntegerAdd ( + LARGE_INTEGER Addend1, + LARGE_INTEGER Addend2 + ); + +// +// Enlarged integer multiply - 32-bits * 32-bits -> 64-bits +// + +LARGE_INTEGER +WINAPI +EnlargedIntegerMultiply ( + LONG Multiplicand, + LONG Multiplier + ); + +// +// Unsigned enlarged integer multiply - 32-bits * 32-bits -> 64-bits +// + +LARGE_INTEGER +WINAPI +EnlargedUnsignedMultiply ( + ULONG Multiplicand, + ULONG Multiplier + ); + +// +// Enlarged integer divide - 64-bits / 32-bits > 32-bits +// + +ULONG +WINAPI +EnlargedUnsignedDivide ( + IN ULARGE_INTEGER Dividend, + IN ULONG Divisor, + IN PULONG Remainder + ); + +// +// Extended large integer magic divide - 64-bits / 32-bits -> 64-bits +// + +LARGE_INTEGER +WINAPI +ExtendedMagicDivide ( + LARGE_INTEGER Dividend, + LARGE_INTEGER MagicDivisor, + CCHAR ShiftCount + ); + +// +// Large Integer divide - 64-bits / 32-bits -> 64-bits +// + +LARGE_INTEGER +WINAPI +ExtendedLargeIntegerDivide ( + LARGE_INTEGER Dividend, + ULONG Divisor, + PULONG Remainder + ); + +// +// Large Integer divide - 64-bits / 32-bits -> 64-bits +// + +LARGE_INTEGER +WINAPI +LargeIntegerDivide ( + LARGE_INTEGER Dividend, + LARGE_INTEGER Divisor, + PLARGE_INTEGER Remainder + ); + +// +// Extended integer multiply - 32-bits * 64-bits -> 64-bits +// + +LARGE_INTEGER +WINAPI +ExtendedIntegerMultiply ( + LARGE_INTEGER Multiplicand, + LONG Multiplier + ); + +// +// Large integer negation - -(64-bits) +// + +LARGE_INTEGER +WINAPI +LargeIntegerNegate ( + LARGE_INTEGER Subtrahend + ); + +// +// Large integer subtract - 64-bits - 64-bits -> 64-bits. +// + +LARGE_INTEGER +WINAPI +LargeIntegerSubtract ( + LARGE_INTEGER Minuend, + LARGE_INTEGER Subtrahend + ); + +// +// Large integer and - 64-bite & 64-bits -> 64-bits. +// + +#define LargeIntegerAnd(Result, Source, Mask) \ + { \ + Result.HighPart = Source.HighPart & Mask.HighPart; \ + Result.LowPart = Source.LowPart & Mask.LowPart; \ + } + + +// +// Large integer conversion routines. +// + +// +// Convert signed integer to large integer. +// + +LARGE_INTEGER +WINAPI +ConvertLongToLargeInteger ( + LONG SignedInteger + ); + +// +// Convert unsigned integer to large integer. +// + +LARGE_INTEGER +WINAPI +ConvertUlongToLargeInteger ( + ULONG UnsignedInteger + ); + + +// +// Large integer shift routines. +// + +LARGE_INTEGER +WINAPI +LargeIntegerShiftLeft ( + LARGE_INTEGER LargeInteger, + CCHAR ShiftCount + ); + +LARGE_INTEGER +WINAPI +LargeIntegerShiftRight ( + LARGE_INTEGER LargeInteger, + CCHAR ShiftCount + ); + +LARGE_INTEGER +WINAPI +LargeIntegerArithmeticShift ( + LARGE_INTEGER LargeInteger, + CCHAR ShiftCount + ); + +#define LargeIntegerGreaterThan(X,Y) ( \ + (((X).HighPart == (Y).HighPart) && ((X).LowPart > (Y).LowPart)) || \ + ((X).HighPart > (Y).HighPart) \ +) + +#define LargeIntegerGreaterThanOrEqualTo(X,Y) ( \ + (((X).HighPart == (Y).HighPart) && ((X).LowPart >= (Y).LowPart)) || \ + ((X).HighPart > (Y).HighPart) \ +) + +#define LargeIntegerEqualTo(X,Y) ( \ + !(((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart)) \ +) + +#define LargeIntegerNotEqualTo(X,Y) ( \ + (((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart)) \ +) + +#define LargeIntegerLessThan(X,Y) ( \ + (((X).HighPart == (Y).HighPart) && ((X).LowPart < (Y).LowPart)) || \ + ((X).HighPart < (Y).HighPart) \ +) + +#define LargeIntegerLessThanOrEqualTo(X,Y) ( \ + (((X).HighPart == (Y).HighPart) && ((X).LowPart <= (Y).LowPart)) || \ + ((X).HighPart < (Y).HighPart) \ +) + +#define LargeIntegerGreaterThanZero(X) ( \ + (((X).HighPart == 0) && ((X).LowPart > 0)) || \ + ((X).HighPart > 0 ) \ +) + +#define LargeIntegerGreaterOrEqualToZero(X) ( \ + (X).HighPart >= 0 \ +) + +#define LargeIntegerEqualToZero(X) ( \ + !((X).LowPart | (X).HighPart) \ +) + +#define LargeIntegerNotEqualToZero(X) ( \ + ((X).LowPart | (X).HighPart) \ +) + +#define LargeIntegerLessThanZero(X) ( \ + ((X).HighPart < 0) \ +) + +#define LargeIntegerLessOrEqualToZero(X) ( \ + ((X).HighPart < 0) || !((X).LowPart | (X).HighPart) \ +) + +#ifdef __cplusplus +} +#endif + diff --git a/src/WINNT/client_osi/libosi.def b/src/WINNT/client_osi/libosi.def index b60c39c92..d68cace82 100644 --- a/src/WINNT/client_osi/libosi.def +++ b/src/WINNT/client_osi/libosi.def @@ -68,3 +68,4 @@ EXPORTS osi_InitTraceOption @61 osi_LogEvent0 @62 osi_LogEvent @63 + osi_HexifyString @64 diff --git a/src/WINNT/client_osi/libosi.hpj b/src/WINNT/client_osi/libosi.hpj index e29b3e12c..bed2a42fc 100644 --- a/src/WINNT/client_osi/libosi.hpj +++ b/src/WINNT/client_osi/libosi.hpj @@ -1,6 +1,6 @@ -[OPTIONS] -COMPRESS=TRUE -TITLE=LibOSI Help - -[FILES] -libosi.rtf +[OPTIONS] +COMPRESS=TRUE +TITLE=LibOSI Help + +[FILES] +libosi.rtf diff --git a/src/WINNT/client_osi/libosi.rc b/src/WINNT/client_osi/libosi.rc index 7850e64c5..e2f0154d1 100644 --- a/src/WINNT/client_osi/libosi.rc +++ b/src/WINNT/client_osi/libosi.rc @@ -1,4 +1,10 @@ -/* Copyright (C) 1999 Transarc Corporation. All rights reserved. +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Define VERSIONINFO resource */ diff --git a/src/WINNT/client_osi/main.c b/src/WINNT/client_osi/main.c index 24c939653..4719958a3 100644 --- a/src/WINNT/client_osi/main.c +++ b/src/WINNT/client_osi/main.c @@ -1,10 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osi.h b/src/WINNT/client_osi/osi.h index 58922d9a0..071533e25 100644 --- a/src/WINNT/client_osi/osi.h +++ b/src/WINNT/client_osi/osi.h @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ @@ -19,7 +20,7 @@ #ifndef DJGPP #include #if !defined(_MSC_VER) || (_MSC_VER < 1300) -#include +#include "largeint.h" #endif #include "osithrdnt.h" #else /* DJGPP */ diff --git a/src/WINNT/client_osi/osibasel.c b/src/WINNT/client_osi/osibasel.c index 71f8c0fad..4b4dadd5c 100644 --- a/src/WINNT/client_osi/osibasel.c +++ b/src/WINNT/client_osi/osibasel.c @@ -1,10 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osibasel.h b/src/WINNT/client_osi/osibasel.h index 89a8b03d2..fc80df4c8 100644 --- a/src/WINNT/client_osi/osibasel.h +++ b/src/WINNT/client_osi/osibasel.h @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osidb.c b/src/WINNT/client_osi/osidb.c index 45d78a44d..54e4b8c38 100644 --- a/src/WINNT/client_osi/osidb.c +++ b/src/WINNT/client_osi/osidb.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osidb.h b/src/WINNT/client_osi/osidb.h index 534b6356c..c68dc46d9 100644 --- a/src/WINNT/client_osi/osidb.h +++ b/src/WINNT/client_osi/osidb.h @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osidebug.c b/src/WINNT/client_osi/osidebug.c index 3afbcc39a..4da2fe94a 100644 --- a/src/WINNT/client_osi/osidebug.c +++ b/src/WINNT/client_osi/osidebug.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osidebug.h b/src/WINNT/client_osi/osidebug.h index 1c70b6a19..ba628375e 100644 --- a/src/WINNT/client_osi/osidebug.h +++ b/src/WINNT/client_osi/osidebug.h @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osidebug.hpj b/src/WINNT/client_osi/osidebug.hpj index 1ba52d698..df3e91523 100644 --- a/src/WINNT/client_osi/osidebug.hpj +++ b/src/WINNT/client_osi/osidebug.hpj @@ -1,6 +1,6 @@ -[OPTIONS] -COMPRESS=TRUE -TITLE=OSIDebug Help - -[FILES] -osidebug.rtf +[OPTIONS] +COMPRESS=TRUE +TITLE=OSIDebug Help + +[FILES] +osidebug.rtf diff --git a/src/WINNT/client_osi/osievent.mc b/src/WINNT/client_osi/osievent.mc new file mode 100644 index 000000000..cba0d23d5 --- /dev/null +++ b/src/WINNT/client_osi/osievent.mc @@ -0,0 +1,393 @@ +;// * +;// * Copyright 2000, International Business Machines Corporation andothers. +;// * All Rights Reserved. +;// * +;// * This software has been released under the terms of the IBM Public +;// * License. For details, see the LICENSE file in the top-level source +;// * directory or online at http://www.openafs.org/dl/license10.html +;// * +;// To change the maximum size of the Windows NT or Windows 2000 Security event log file (in kilobytes) you can use the Event Viewer to indirectly modify the registry or to apply the registry hack directly: +;// +;// Hive: HKEY_LOCAL_MACHINE +;// Key: SYSTEM\CurrentControlSet\Services\EventLog\Security +;// Name: MaxSize +;// Type: REG_DWORD +;// Value: 512 default=512K + +;#ifndef _AFSDEVENT_H_ +;#define _AFSDEVENT_H_ +; +SeverityNames=(Success=0x0 + Informational=0x1 + Warning=0x2 + Error=0x3 + ) +FacilityNames=(Interface=0x04) + +MessageId=1 +SymbolicName=MSGID_WARNING_CAT +Language=English +Warning +. +MessageId= +SymbolicName=MSGID_INFO_CAT +Language=English +Info +. +MessageId= +SymbolicName=MSGID_ERROR_CAT +Language=English +Error +. +MessageId= +SymbolicName=SENDNOTDONE +Language=English +SENDNOTDONE +. +MessageId= +SymbolicName=SMBILLEGAL +Language=English +SMBILLEGAL +. +MessageId= +SymbolicName=SMB_COM_CREATE_DIRECTORY +Language=English +SMB_COM_CREATE_DIRECTORY +. +MessageId= +SymbolicName=SMB_COM_DELETE_DIRECTORY +Language=English +SMB_COM_DELETE_DIRECTORY +. +MessageId= +SymbolicName=SMB_COM_OPEN +Language=English +SMB_COM_OPEN +. +MessageId= +SymbolicName=SMB_COM_CREATE +Language=English +SMB_COM_CREATE +. +MessageId= +SymbolicName=SMB_COM_CLOSE +Language=English +SMB_COM_CLOSE +. +MessageId= +SymbolicName=SMB_COM_FLUSH +Language=English +SMB_COM_FLUSH +. +MessageId= +SymbolicName=SMB_COM_DELETE +Language=English +SMB_COM_DELETE +. +MessageId= +SymbolicName=SMB_COM_RENAME +Language=English +SMB_COM_RENAME +. +MessageId= +SymbolicName=SMB_COM_QUERY_INFORMATION +Language=English +SMB_COM_QUERY_INFORMATION +. +MessageId= +SymbolicName=SMB_COM_SET_INFORMATION +Language=English +SMB_COM_SET_INFORMATION +. +MessageId= +SymbolicName=SMB_COM_READ +Language=English +SMB_COM_READ +. +MessageId= +SymbolicName=SMB_COM_WRITE +Language=English +SMB_COM_WRITE +. +MessageId= +SymbolicName=SMB_COM_LOCK_BYTE_RANGE +Language=English +SMB_COM_LOCK_BYTE_RANGE +. +MessageId= +SymbolicName=SMB_COM_UNLOCK_BYTE_RANGE +Language=English +SMB_COM_UNLOCK_BYTE_RANGE +. +MessageId= +SymbolicName=SMB_COM_CREATE_TEMPORARY +Language=English +SMB_COM_CREATE_TEMPORARY +. +MessageId= +SymbolicName=SMB_COM_CREATE_NEW +Language=English +SMB_COM_CREATE_NEW +. +MessageId= +SymbolicName=SMB_COM_CHECK_DIRECTORY +Language=English +SMB_COM_CHECK_DIRECTORY +. +MessageId= +SymbolicName=SMB_COM_PROCESS_EXIT +Language=English +SMB_COM_PROCESS_EXIT +. +MessageId= +SymbolicName=SMB_COM_SEEK +Language=English +SMB_COM_SEEK +. +MessageId= +SymbolicName=SMB_COM_LOCK_AND_READ +Language=English +SMB_COM_LOCK_AND_READ +. +MessageId= +SymbolicName=SMB_COM_WRITE_AND_UNLOCK +Language=English +SMB_COM_WRITE_AND_UNLOCK +. +MessageId= +SymbolicName=MSGID_V3Tran2A +Language=English +V3Tran2A +. +MessageId= +SymbolicName=SMB_COM_READ_RAW +Language=English +SMB_COM_READ_RAW +. +MessageId= +SymbolicName=SMB_COM_WRITE_RAW +Language=English +SMB_COM_WRITE_RAW +. +MessageId= +SymbolicName=SMB_COM_SET_INFORMATION2 +Language=English +SMB_COM_SET_INFORMATION2 +. +MessageId= +SymbolicName=SMB_COM_QUERY_INFORMATION2 +Language=English +SMB_COM_QUERY_INFORMATION2 +. +MessageId= +SymbolicName=SMB_COM_LOCKING_ANDX +Language=English +SMB_COM_LOCKING_ANDX +. +MessageId= +SymbolicName=SMB_COM_COPY +Language=English +SMB_COM_COPY +. +MessageId= +SymbolicName=SMB_COM_ECHO +Language=English +SMB_COM_ECHO +. +MessageId= +SymbolicName=SMB_COM_OPEN_ANDX +Language=English +SMB_COM_OPEN_ANDX +. +MessageId= +SymbolicName=SMB_COM_READ_ANDX +Language=English +SMB_COM_READ_ANDX +. +MessageId= +SymbolicName=SMB_COM_TRANSACTION2 +Language=English +SMB_COM_TRANSACTION2 +. +MessageId= +SymbolicName=SMB_COM_TRANSACTION2_SECONDARY +Language=English +SMB_COM_TRANSACTION2_SECONDARY +. +MessageId= +SymbolicName=SMB_COM_FIND_CLOSE2 +Language=English +SMB_COM_FIND_CLOSE2 +. +MessageId= +SymbolicName=SMB_COM_FIND_NOTIFY_CLOSE +Language=English +SMB_COM_FIND_NOTIFY_CLOSE +. +MessageId= +SymbolicName=SMB_COM_TREE_CONNECT +Language=English +SMB_COM_TREE_CONNECT +. +MessageId= +SymbolicName=SMB_COM_TREE_DISCONNECT +Language=English +SMB_COM_TREE_DISCONNECT +. +MessageId= +SymbolicName=SMB_COM_NEGOTIATE +Language=English +SMB_COM_NEGOTIATE +. +MessageId= +SymbolicName=SMB_COM_SESSION_SETUP_ANDX +Language=English +SMB_COM_SESSION_SETUP_ANDX +. +MessageId= +SymbolicName=SMB_COM_LOGOFF_ANDX +Language=English +SMB_COM_LOGOFF_ANDX +. +MessageId= +SymbolicName=SMB_COM_TREE_CONNECT_ANDX +Language=English +SMB_COM_TREE_CONNECT_ANDX +. +MessageId= +SymbolicName=SMB_COM_QUERY_INFORMATION_DISK +Language=English +SMB_COM_QUERY_INFORMATION_DISK +. +MessageId= +SymbolicName=SMB_COM_SEARCH +Language=English +SMB_COM_SEARCH +. +MessageId= +SymbolicName=SMB_COM_NT_TRANSACT +Language=English +SMB_COM_NT_TRANSACT +. +MessageId= +SymbolicName=SMB_COM_NT_CREATE_ANDX +Language=English +SMB_COM_NT_CREATE_ANDX +. +MessageId= +SymbolicName=SMB_COM_NT_CANCEL +Language=English +SMB_COM_NT_CANCEL +. +MessageId= +SymbolicName=TRANS2_OPEN2 +Language=English +TRANS2_OPEN2 +. +MessageId= +SymbolicName=TRANS2_FIND_FIRST2 +Language=English +TRANS2_FIND_FIRST2 +. +MessageId= +SymbolicName=TRANS2_FIND_NEXT2 +Language=English +TRANS2_FIND_NEXT2 +. +MessageId= +SymbolicName=TRANS2_QUERY_FS_INFORMATION +Language=English +TRANS2_QUERY_FS_INFORMATION +. +MessageId= +SymbolicName=TRANS2_QUERY_PATH_INFORMATION +Language=English +TRANS2_QUERY_PATH_INFORMATION +. +MessageId= +SymbolicName=TRANS2_SET_PATH_INFORMATION +Language=English +TRANS2_SET_PATH_INFORMATION +. +MessageId= +SymbolicName=TRANS2_QUERY_FILE_INFORMATION +Language=English +TRANS2_QUERY_FILE_INFORMATION +. +MessageId= +SymbolicName=TRANS2_SET_FILE_INFORMATION +Language=English +TRANS2_SET_FILE_INFORMATION +. +MessageId= +SymbolicName=TRANS2_FSCTL +Language=English +TRANS2_FSCTL +. +MessageId= +SymbolicName=TRANS2_IOCTL2 +Language=English +TRANS2_IOCTL2 +. +MessageId= +SymbolicName=TRANS2_FIND_NOTIFY_FIRST +Language=English +TRANS2_FIND_NOTIFY_FIRST +. +MessageId= +SymbolicName=MSGID_Tran2SetFileInfo +Language=English +Tran2SetFileInfo +. +MessageId= +SymbolicName=TRANS2_FIND_NOTIFY_NEXT +Language=English +TRANS2_FIND_NOTIFY_NEXT +. +MessageId= +SymbolicName=TRANS2_CREATE_DIRECTORY +Language=English +TRANS2_CREATE_DIRECTORY +. +MessageId= +SymbolicName=TRANS2_SESSION_SETUP +Language=English +TRANS2_SESSION_SETUP +. +MessageId= +SymbolicName=TRANS2_GET_DFS_REFERRAL +Language=English +TRANS2_GET_DFS_REFERRAL +. +MessageId= +SymbolicName=TRANS2_REPORT_DFS_INCONSISTENCY +Language=English +TRANS2_REPORT_DFS_INCONSISTENCY +. +MessageId=126 +Severity=Error +SymbolicName=MSGID_ERROR +Language=English +Error: %1 +. +MessageId=127 +Severity=Warning +SymbolicName=MSGID_WARNING +Language=English +Warning: %1 +. +MessageId=128 +Severity=Informational +SymbolicName=MSGID_GENERAL +Language=English +%1 +. +MessageId=256 +Severity=Informational +SymbolicName=MSGID_SMB +Language=English +%1 +. +; +;#endif // _AFSDEVENT_H_ +; diff --git a/src/WINNT/client_osi/osifd.c b/src/WINNT/client_osi/osifd.c index 6f6e37c54..e5ab641ed 100644 --- a/src/WINNT/client_osi/osifd.c +++ b/src/WINNT/client_osi/osifd.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osifd.h b/src/WINNT/client_osi/osifd.h index 12d50c907..f2e84ca06 100644 --- a/src/WINNT/client_osi/osifd.h +++ b/src/WINNT/client_osi/osifd.h @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osilog.c b/src/WINNT/client_osi/osilog.c index 890745e1d..72fbecbd1 100644 --- a/src/WINNT/client_osi/osilog.c +++ b/src/WINNT/client_osi/osilog.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ @@ -23,6 +24,8 @@ #include #include +#define AFS_DAEMON_EVENT_NAME "TransarcAFSDaemon" + /* the size; overrideable */ long osi_logSize = OSI_LOG_DEFAULTSIZE; @@ -202,6 +205,13 @@ void osi_LogAdd(osi_log_t *logp, char *formatp, long p0, long p1, long p2, long lep->parms[1] = p1; lep->parms[2] = p2; lep->parms[3] = p3; + +#ifdef NOTSERVICE + printf( "%9ld:", lep->micros ); + printf( formatp, p0, p1, p2, p3); + printf( "\n" ); +#endif + thrd_LeaveCrit(&logp->cs); } @@ -345,17 +355,18 @@ void osi_InitTraceOption() 0, KEY_QUERY_VALUE, &NPKey); LSPsize=sizeof(osi_TraceOption); RegQueryValueEx(NPKey, "TraceOption", NULL, - &LSPtype, (LPBYTE)&osi_TraceOption, &LSPsize); + &LSPtype, (LPBYTE)&osi_TraceOption, &LSPsize); } #define MAXBUF_ 131 void osi_LogEvent0(char *a,char *b) { - HANDLE h; char *ptbuf[1],buf[MAXBUF_+1]; + HANDLE h; + char *ptbuf[1]; if (!ISLOGONTRACE(osi_TraceOption)) return; - h = RegisterEventSource(NULL, a); + h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); ptbuf[0] = b; ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL); DeregisterEventSource(h); @@ -368,13 +379,7 @@ void osi_LogEvent(char *a,char *b,char *c,...) va_list marker; if (!ISLOGONTRACE(osi_TraceOption)) return; - if (b) - { - wsprintf(buf,a,b); - h = RegisterEventSource(NULL, buf); - } - else - h = RegisterEventSource(NULL, a); + h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME); va_start(marker,c); _vsnprintf(buf,MAXBUF_,c,marker); ptbuf[0] = buf; @@ -382,3 +387,26 @@ void osi_LogEvent(char *a,char *b,char *c,...) DeregisterEventSource(h); va_end(marker); } + +char *osi_HexifyString(char *s) { + int len,c; + char *hex = "0123456789abcdef"; + char *buf, *counter, *bufp; + + len = strlen(s); + + bufp = buf = malloc( len * 3 ); /* [xx.xx.xx.xx\0] */ + + if(!buf) return NULL; + + for(counter = s; *counter; counter ++) { + if(counter != s) *bufp++ = '.'; + c = *counter; + *bufp++ = hex[(c>>4) & 0xf]; + *bufp++ = hex[c & 0xf]; + } + *bufp = 0; + + return buf; +} + diff --git a/src/WINNT/client_osi/osilog.h b/src/WINNT/client_osi/osilog.h index 9eb11ab9f..2a0183e76 100644 --- a/src/WINNT/client_osi/osilog.h +++ b/src/WINNT/client_osi/osilog.h @@ -83,6 +83,7 @@ extern char *osi_LogSaveString(osi_log_t *logp, char *s); extern void osi_InitTraceOption(); extern void osi_LogEvent0(char *a,char *b); extern void osi_LogEvent(char *a,char *b,char *c,...); +extern char *osi_HexifyString(char *s); /* define macros */ #define osi_Log0(l,f) osi_LogAdd((l), (f), 0, 0, 0, 0) diff --git a/src/WINNT/client_osi/osiltype.c b/src/WINNT/client_osi/osiltype.c index 546b643da..a37eecd1c 100644 --- a/src/WINNT/client_osi/osiltype.c +++ b/src/WINNT/client_osi/osiltype.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osiqueue.c b/src/WINNT/client_osi/osiqueue.c index 4e840d84a..8963d2e9c 100644 --- a/src/WINNT/client_osi/osiqueue.c +++ b/src/WINNT/client_osi/osiqueue.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osiqueue.h b/src/WINNT/client_osi/osiqueue.h index 9805da5ef..a6c3ea984 100644 --- a/src/WINNT/client_osi/osiqueue.h +++ b/src/WINNT/client_osi/osiqueue.h @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osisleep.c b/src/WINNT/client_osi/osisleep.c index fcb319780..1d9524491 100644 --- a/src/WINNT/client_osi/osisleep.c +++ b/src/WINNT/client_osi/osisleep.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osisleep.h b/src/WINNT/client_osi/osisleep.h index efeb5ebee..0fb873d00 100644 --- a/src/WINNT/client_osi/osisleep.h +++ b/src/WINNT/client_osi/osisleep.h @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osistatl.c b/src/WINNT/client_osi/osistatl.c index 46855470a..405acc315 100644 --- a/src/WINNT/client_osi/osistatl.c +++ b/src/WINNT/client_osi/osistatl.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osistatl.h b/src/WINNT/client_osi/osistatl.h index e881afb9c..0bcfa6da3 100644 --- a/src/WINNT/client_osi/osistatl.h +++ b/src/WINNT/client_osi/osistatl.h @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ @@ -13,7 +14,7 @@ #include "osibasel.h" #if !defined(_MSC_VER) || (_MSC_VER < 1300) -#include +#include "largeint.h" #endif #include "osiqueue.h" diff --git a/src/WINNT/client_osi/osithrd95.c b/src/WINNT/client_osi/osithrd95.c index 339a6bedd..6b95d5fc6 100644 --- a/src/WINNT/client_osi/osithrd95.c +++ b/src/WINNT/client_osi/osithrd95.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osiutils.c b/src/WINNT/client_osi/osiutils.c index 848fe61f4..c37b74839 100644 --- a/src/WINNT/client_osi/osiutils.c +++ b/src/WINNT/client_osi/osiutils.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/osiutils.h b/src/WINNT/client_osi/osiutils.h index 6c61c2a7e..a3c69267c 100644 --- a/src/WINNT/client_osi/osiutils.h +++ b/src/WINNT/client_osi/osiutils.h @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/perf.c b/src/WINNT/client_osi/perf.c index 32989ed5d..b01e74369 100644 --- a/src/WINNT/client_osi/perf.c +++ b/src/WINNT/client_osi/perf.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/perf.h b/src/WINNT/client_osi/perf.h index 05b1a0ab5..11294af46 100644 --- a/src/WINNT/client_osi/perf.h +++ b/src/WINNT/client_osi/perf.h @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/trylock.c b/src/WINNT/client_osi/trylock.c index 36242b5d4..dcf043c3d 100644 --- a/src/WINNT/client_osi/trylock.c +++ b/src/WINNT/client_osi/trylock.c @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/client_osi/trylock.h b/src/WINNT/client_osi/trylock.h index dcff71150..c69131db7 100644 --- a/src/WINNT/client_osi/trylock.h +++ b/src/WINNT/client_osi/trylock.h @@ -1,9 +1,10 @@ /* - * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved - * - * (C) COPYRIGHT IBM CORPORATION 1987, 1988 - * LICENSED MATERIALS - PROPERTY OF IBM - * + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html */ /* Copyright (C) 1994 Cazamar Systems, Inc. */ diff --git a/src/WINNT/doc/help/en_US/afs-cc.CNT b/src/WINNT/doc/help/en_US/afs-cc.CNT index d6ab42608..7d6b1b69c 100755 --- a/src/WINNT/doc/help/en_US/afs-cc.CNT +++ b/src/WINNT/doc/help/en_US/afs-cc.CNT @@ -1,10 +1,10 @@ -:Base AFS-CC.HLP -:Title IBM AFS Control Center -1 AFS Control Center Configuration -2 Default Cell -3 Setting a Default AFS Cell to Administer=Cell_Membership>main -2 Cell Database -3 Overview=Cell_Database_Overview>main -3 Adding Cells to Your Cell Database=Adding_Cells_to_Your_Cell_Database>main -3 Changing Cell Information=Changing_Cell_Information>main -3 Removing Cells From Your Cell Database=Removing_Cells_From_Your_Cell_Database>main +:Base AFS-CC.HLP +:Title IBM AFS Control Center +1 AFS Control Center Configuration +2 Default Cell +3 Setting a Default AFS Cell to Administer=Cell_Membership>main +2 Cell Database +3 Overview=Cell_Database_Overview>main +3 Adding Cells to Your Cell Database=Adding_Cells_to_Your_Cell_Database>main +3 Changing Cell Information=Changing_Cell_Information>main +3 Removing Cells From Your Cell Database=Removing_Cells_From_Your_Cell_Database>main diff --git a/src/WINNT/doc/help/en_US/afs-light.CNT b/src/WINNT/doc/help/en_US/afs-light.CNT index eae018514..1c2d27eeb 100755 --- a/src/WINNT/doc/help/en_US/afs-light.CNT +++ b/src/WINNT/doc/help/en_US/afs-light.CNT @@ -1,63 +1,63 @@ -:Base AFS-LIGHT.HLP -:Title IBM AFS Light -1 Overview -2 About AFS=Working_in_AFS>main -2 AFS Storage Concepts=AFSFileStorageConcepts>main -2 AFS Security Concepts=AFS_security_concepts>main -2 About AFS Light=AFS_Client>main -2 About Help=Audience_and_Purpose>main -1 Getting Started -2 Overview=Running_AFS>main -2 Identifying an AFS Light Gateway=Adding_your_Client_to_a_Cell>main -2 Mounting the AFS Filespace=Mapping_Drives_Overview>main -2 Authenticating to AFS=Authentication>main -2 Verifying Authentication=VerifyingAuthentication@AFS-LIGHT.HLP>main -2 Unauthenticating from AFS=UnauthenticatingfromAFS@AFS-LIGHT.HLP>main -1 Managing AFS -2 Overview=AccessingAFS@AFS-LIGHT.HLP>main -2 AFS Menu=FileManagerAFSMenu>main -2 AFS Light Configuration Utility=AFS_Client_Configuration_Utility>main -2 AFS Light Program Group=The_AFS_Client_Program_Group>main -2 AFS Light Property Box=AFS_Credentials_utility.>main -2 Command Prompt Commands=CommandPromptCommands@AFS-LIGHT.HLP>main -1 Using AFS -2 Access Control Lists -3 Overview -4 Access Control Lists=ProtectingFilesandDirectories>main -4 Directory-Level Access Control=Directory.LevelAccessControl>main -4 AFS Access Permissions=AFSAccessPermissions>main -4 Additional Access Permissions=OtherVariablePermissions>main -4 Normal and Negative Entries=NormalandNegativeEntries>main -3 Using Access Control Lists -4 Setting ACLs=AccessControlLists>main -4 Adding ACL Entries=AddACLEntry>main -4 Removing ACL Entries=Removing_ACL_Entries>main -4 Copying ACLs=CopyACL>main -2 Volumes and Partitions -3 Overview=Volumes_and_Partitions>main -3 Displaying Volume and Partition Information=Displaying_Volume_and_Partition_information>main -3 Refresh name/ID map=Refreshname.IDmap>main -2 Mount Points -3 Overview=Mount_Point_first_page>main -3 Displaying Mount Points=Displaying_Mount_Points>main -3 Removing Mount Points=Removing_Mount_Points>main -3 Making Mount Points=Making_Mount_Points>main -2 Cached Files -3 Overview=Cached_Files>main -3 Flushing Files and Directories=Flushing_files_or_directories>main -3 Flushing Volumes=Flushing_Volumes>main -2 Server Information -3 Overview=ListingFileServerInformation>main -3 Showing File Servers=Showing_File_Servers>main -3 Showing the Status of File Servers=Showing_the_Status_of_File_Servers>main -2 Cells -3 Listing Information -4 Showing Cells=Showing_Cell>main -3 Cell Database -4 Overview=Cells>main -4 Adding Cells=Adding_Cells_to_your_Cell_Database>main -4 Changing Cell Information=Changing_Cell_Information>main -4 Removing Cells=Deleting_Cell_Information>main -1 Reference -2 Glossary=Glossary>main -2 How To...=How_To...>main +:Base AFS-LIGHT.HLP +:Title IBM AFS Light +1 Overview +2 About AFS=Working_in_AFS>main +2 AFS Storage Concepts=AFSFileStorageConcepts>main +2 AFS Security Concepts=AFS_security_concepts>main +2 About AFS Light=AFS_Client>main +2 About Help=Audience_and_Purpose>main +1 Getting Started +2 Overview=Running_AFS>main +2 Identifying an AFS Light Gateway=Adding_your_Client_to_a_Cell>main +2 Mounting the AFS Filespace=Mapping_Drives_Overview>main +2 Authenticating to AFS=Authentication>main +2 Verifying Authentication=VerifyingAuthentication@AFS-LIGHT.HLP>main +2 Unauthenticating from AFS=UnauthenticatingfromAFS@AFS-LIGHT.HLP>main +1 Managing AFS +2 Overview=AccessingAFS@AFS-LIGHT.HLP>main +2 AFS Menu=FileManagerAFSMenu>main +2 AFS Light Configuration Utility=AFS_Client_Configuration_Utility>main +2 AFS Light Program Group=The_AFS_Client_Program_Group>main +2 AFS Light Property Box=AFS_Credentials_utility.>main +2 Command Prompt Commands=CommandPromptCommands@AFS-LIGHT.HLP>main +1 Using AFS +2 Access Control Lists +3 Overview +4 Access Control Lists=ProtectingFilesandDirectories>main +4 Directory-Level Access Control=Directory.LevelAccessControl>main +4 AFS Access Permissions=AFSAccessPermissions>main +4 Additional Access Permissions=OtherVariablePermissions>main +4 Normal and Negative Entries=NormalandNegativeEntries>main +3 Using Access Control Lists +4 Setting ACLs=AccessControlLists>main +4 Adding ACL Entries=AddACLEntry>main +4 Removing ACL Entries=Removing_ACL_Entries>main +4 Copying ACLs=CopyACL>main +2 Volumes and Partitions +3 Overview=Volumes_and_Partitions>main +3 Displaying Volume and Partition Information=Displaying_Volume_and_Partition_information>main +3 Refresh name/ID map=Refreshname.IDmap>main +2 Mount Points +3 Overview=Mount_Point_first_page>main +3 Displaying Mount Points=Displaying_Mount_Points>main +3 Removing Mount Points=Removing_Mount_Points>main +3 Making Mount Points=Making_Mount_Points>main +2 Cached Files +3 Overview=Cached_Files>main +3 Flushing Files and Directories=Flushing_files_or_directories>main +3 Flushing Volumes=Flushing_Volumes>main +2 Server Information +3 Overview=ListingFileServerInformation>main +3 Showing File Servers=Showing_File_Servers>main +3 Showing the Status of File Servers=Showing_the_Status_of_File_Servers>main +2 Cells +3 Listing Information +4 Showing Cells=Showing_Cell>main +3 Cell Database +4 Overview=Cells>main +4 Adding Cells=Adding_Cells_to_your_Cell_Database>main +4 Changing Cell Information=Changing_Cell_Information>main +4 Removing Cells=Deleting_Cell_Information>main +1 Reference +2 Glossary=Glossary>main +2 How To...=How_To...>main diff --git a/src/WINNT/doc/help/en_US/afs-nt.CNT b/src/WINNT/doc/help/en_US/afs-nt.CNT index d0314639c..27fd9ffc0 100755 --- a/src/WINNT/doc/help/en_US/afs-nt.CNT +++ b/src/WINNT/doc/help/en_US/afs-nt.CNT @@ -1,77 +1,77 @@ -:Base AFS-NT.HLP -:Title IBM AFS Client -1 Overview -2 About AFS=Working_in_AFS>main -2 AFS Storage Concepts=AFSFileStorageConcepts>main -2 AFS Security Concepts=AFS_security_concepts>main -2 About the AFS Client=AFS_Client>main -2 About Help=Audience_and_Purpose>main -1 Getting Started -2 Overview=Running_AFS>main -2 Making your AFS Client a Member of a Cell=Adding_your_Client_to_a_Cell>main -2 AFS Client Wizard=IDH_AFSCREDS_WIZ_START>main -2 Starting and Stopping the AFS Client=StartingandStoppingtheAFSClient@afs-nt.hlp>main -2 Changing the Startup Type of Your AFS Client=ChangingtheStartupTypeofYourAFSClient@afs-nt.hlp>main -2 Mounting the AFS Filespace=Mapping_Drives_Overview>main -2 Authenticating to AFS=Authentication>main -2 Verifying Authentication=VerifyingAuthentication@afs-nt.hlp>main -2 Unauthenticating from AFS=UnauthenticatingfromAFS@afs-nt.hlp>main -1 Managing AFS -2 Overview=AccessingAFS@afs-nt.hlp>main -2 AFS Menu=FileManagerAFSMenu>main -2 AFS Client Configuration Utility=AFS_Client_Configuration_Utility>main -2 AFS Client Program Group=The_AFS_Client_Program_Group>main -2 AFS Client Property Box=AFS_Credentials_utility.>main -2 Command Prompt Commands=CommandPromptCommands@afs-nt.hlp>main -1 Using AFS -2 Access Control Lists -3 Overview -4 Access Control Lists=ProtectingFilesandDirectories>main -4 Directory-Level Access Control=Directory.LevelAccessControl>main -4 AFS Access Permissions=AFSAccessPermissions>main -4 Additional Access Permissions=OtherVariablePermissions>main -4 Normal and Negative Entries=NormalandNegativeEntries>main -3 Using Access Control Lists -4 Setting ACLs=AccessControlLists>main -4 Adding ACL Entries=AddACLEntry>main -4 Removing ACL Entries=Removing_ACL_Entries>main -4 Copying ACLs=CopyACL>main -2 Volumes and Partitions -3 Overview=Volumes_and_Partitions>main -3 Displaying Volume and Partition Information=Displaying_Volume_and_Partition_information>main -3 Refreshing Name/Volume ID Mappings=Refreshname.IDmap>main -2 Mount Points -3 Overview=Mount_Point_first_page>main -3 Displaying Mount Point Information=Displaying_Mount_Points>main -3 Removing Mount Points=Removing_Mount_Points>main -3 Creating Mount Points=Making_Mount_Points>main -2 Cached Files -3 Overview=Cached_Files>main -3 Flushing Files and Directories=Flushing_files_or_directories>main -3 Flushing Volumes=Flushing_Volumes>main -2 Servers -3 Listing Information -4 Overview=ListingFileServerInformation>main -4 Showing File Servers=Showing_File_Servers>main -4 Showing the Status of File Servers=Showing_the_Status_of_File_Servers>main -3 Server Preferences -4 Overview=Server_Prefs_Overview>main -4 Viewing Server Preferences=Viewing_Server_Preferences>main -4 Adding Server Preferences=Adding_Server_Preferences>main -4 Modifying Server Preferences=Modifying_Server_Preferences>main -2 Cells -3 Listing Information -4 Showing Cells=Showing_Cell>main -3 Cell Database -4 Overview=Cells>main -4 Adding Cells=Adding_Cells_to_your_Cell_Database>main -4 Changing Cell Information=Changing_Cell_Information>main -4 Removing Cells=Deleting_Cell_Information>main -2 Submounts -3 Overview=Submounts_Overview>main -3 Creating Submounts=Creating_Submounts>main -3 Modifying Submounts=Change_or_Edit_Submounts>main -3 Removing Submounts=Delete_Submounts>main -1 Reference -2 Glossary=Glossary>main -2 How To...=How_To...>main +:Base AFS-NT.HLP +:Title IBM AFS Client +1 Overview +2 About AFS=Working_in_AFS>main +2 AFS Storage Concepts=AFSFileStorageConcepts>main +2 AFS Security Concepts=AFS_security_concepts>main +2 About the AFS Client=AFS_Client>main +2 About Help=Audience_and_Purpose>main +1 Getting Started +2 Overview=Running_AFS>main +2 Making your AFS Client a Member of a Cell=Adding_your_Client_to_a_Cell>main +2 AFS Client Wizard=IDH_AFSCREDS_WIZ_START>main +2 Starting and Stopping the AFS Client=StartingandStoppingtheAFSClient@afs-nt.hlp>main +2 Changing the Startup Type of Your AFS Client=ChangingtheStartupTypeofYourAFSClient@afs-nt.hlp>main +2 Mounting the AFS Filespace=Mapping_Drives_Overview>main +2 Authenticating to AFS=Authentication>main +2 Verifying Authentication=VerifyingAuthentication@afs-nt.hlp>main +2 Unauthenticating from AFS=UnauthenticatingfromAFS@afs-nt.hlp>main +1 Managing AFS +2 Overview=AccessingAFS@afs-nt.hlp>main +2 AFS Menu=FileManagerAFSMenu>main +2 AFS Client Configuration Utility=AFS_Client_Configuration_Utility>main +2 AFS Client Program Group=The_AFS_Client_Program_Group>main +2 AFS Client Property Box=AFS_Credentials_utility.>main +2 Command Prompt Commands=CommandPromptCommands@afs-nt.hlp>main +1 Using AFS +2 Access Control Lists +3 Overview +4 Access Control Lists=ProtectingFilesandDirectories>main +4 Directory-Level Access Control=Directory.LevelAccessControl>main +4 AFS Access Permissions=AFSAccessPermissions>main +4 Additional Access Permissions=OtherVariablePermissions>main +4 Normal and Negative Entries=NormalandNegativeEntries>main +3 Using Access Control Lists +4 Setting ACLs=AccessControlLists>main +4 Adding ACL Entries=AddACLEntry>main +4 Removing ACL Entries=Removing_ACL_Entries>main +4 Copying ACLs=CopyACL>main +2 Volumes and Partitions +3 Overview=Volumes_and_Partitions>main +3 Displaying Volume and Partition Information=Displaying_Volume_and_Partition_information>main +3 Refreshing Name/Volume ID Mappings=Refreshname.IDmap>main +2 Mount Points +3 Overview=Mount_Point_first_page>main +3 Displaying Mount Point Information=Displaying_Mount_Points>main +3 Removing Mount Points=Removing_Mount_Points>main +3 Creating Mount Points=Making_Mount_Points>main +2 Cached Files +3 Overview=Cached_Files>main +3 Flushing Files and Directories=Flushing_files_or_directories>main +3 Flushing Volumes=Flushing_Volumes>main +2 Servers +3 Listing Information +4 Overview=ListingFileServerInformation>main +4 Showing File Servers=Showing_File_Servers>main +4 Showing the Status of File Servers=Showing_the_Status_of_File_Servers>main +3 Server Preferences +4 Overview=Server_Prefs_Overview>main +4 Viewing Server Preferences=Viewing_Server_Preferences>main +4 Adding Server Preferences=Adding_Server_Preferences>main +4 Modifying Server Preferences=Modifying_Server_Preferences>main +2 Cells +3 Listing Information +4 Showing Cells=Showing_Cell>main +3 Cell Database +4 Overview=Cells>main +4 Adding Cells=Adding_Cells_to_your_Cell_Database>main +4 Changing Cell Information=Changing_Cell_Information>main +4 Removing Cells=Deleting_Cell_Information>main +2 Submounts +3 Overview=Submounts_Overview>main +3 Creating Submounts=Creating_Submounts>main +3 Modifying Submounts=Change_or_Edit_Submounts>main +3 Removing Submounts=Delete_Submounts>main +1 Reference +2 Glossary=Glossary>main +2 How To...=How_To...>main diff --git a/src/WINNT/doc/help/en_US/taafscfg.cnt b/src/WINNT/doc/help/en_US/taafscfg.cnt index 962742f24..587cea00d 100755 --- a/src/WINNT/doc/help/en_US/taafscfg.cnt +++ b/src/WINNT/doc/help/en_US/taafscfg.cnt @@ -1,32 +1,32 @@ -:Base TAAFSCFG.HLP -:Title IBM AFS Server Configuration -1 AFS Server Configuration Help -2 About AFS and the AFS Server and AFS Control Center=About_AFS_and_the_AFS_Server_and_AFS_Control_Center -2 Configuring the AFS Server -3 Overview=Configuring_the_AFS_Server -3 The AFS Server Configuration Wizard=The_AFS_Server_Configuration_Wizard -3 To Configure the AFS Server into an Existing Cell=Configuring_the_AFS_Server_into_an_Existing_Cell -3 To Configure the AFS Server as the First AFS Server in a Cell=Configuring_the_AFS_Server_as_the_First_AFS_Server_in_a_Cell -3 Accessing AFS Data=Accessing_AFS_Data -2 The AFS Server Configuration Dialog Box -3 Overview=The_AFS_Server_Configuration_Dialog_Box -3 To Access the AFS Server Configuration Dialog Box=To_Access_the_AFS_Server_Configuration_Dialog_Box -3 Partitions Tab -4 Overview=IDH_PARTITIONS_PAGE -4 Setting Up AFS Partitions -5 Overview=Setting_Up_AFS_Partitions -5 To Create an AFS Partition=To_Create_an_AFS_Partion -4 Administering AFS Partitions -5 Overview=Administering_AFS_Partitions -5 Salvaging an AFS Partition -6 Overview=Salvaging_an_AFS_Partition -6 To Salvage an AFS Partition=To_Salvage_an_AFS_Partition -5 Removing AFS Partitions -6 Overview=Removing_AFS_Partitions -6 To Remove an AFS Partition=To_Remove_an_AFS_Partition -3 Services Tab -4 Overview=IDH_SERVICES_PAGE -4 AFS Server Roles=AFS_Server_Roles -4 AFS Services=AFS_Services -4 To Configure and Start an AFS Service=To_Configure_and_Start_an_AFS_Service -4 To Stop and Unconfigure an AFS Service=To_Stop_and_Unconfigure_an_AFS_Service +:Base TAAFSCFG.HLP +:Title IBM AFS Server Configuration +1 AFS Server Configuration Help +2 About AFS and the AFS Server and AFS Control Center=About_AFS_and_the_AFS_Server_and_AFS_Control_Center +2 Configuring the AFS Server +3 Overview=Configuring_the_AFS_Server +3 The AFS Server Configuration Wizard=The_AFS_Server_Configuration_Wizard +3 To Configure the AFS Server into an Existing Cell=Configuring_the_AFS_Server_into_an_Existing_Cell +3 To Configure the AFS Server as the First AFS Server in a Cell=Configuring_the_AFS_Server_as_the_First_AFS_Server_in_a_Cell +3 Accessing AFS Data=Accessing_AFS_Data +2 The AFS Server Configuration Dialog Box +3 Overview=The_AFS_Server_Configuration_Dialog_Box +3 To Access the AFS Server Configuration Dialog Box=To_Access_the_AFS_Server_Configuration_Dialog_Box +3 Partitions Tab +4 Overview=IDH_PARTITIONS_PAGE +4 Setting Up AFS Partitions +5 Overview=Setting_Up_AFS_Partitions +5 To Create an AFS Partition=To_Create_an_AFS_Partion +4 Administering AFS Partitions +5 Overview=Administering_AFS_Partitions +5 Salvaging an AFS Partition +6 Overview=Salvaging_an_AFS_Partition +6 To Salvage an AFS Partition=To_Salvage_an_AFS_Partition +5 Removing AFS Partitions +6 Overview=Removing_AFS_Partitions +6 To Remove an AFS Partition=To_Remove_an_AFS_Partition +3 Services Tab +4 Overview=IDH_SERVICES_PAGE +4 AFS Server Roles=AFS_Server_Roles +4 AFS Services=AFS_Services +4 To Configure and Start an AFS Service=To_Configure_and_Start_an_AFS_Service +4 To Stop and Unconfigure an AFS Service=To_Stop_and_Unconfigure_an_AFS_Service diff --git a/src/WINNT/doc/help/en_US/taafssvrmgr.cnt b/src/WINNT/doc/help/en_US/taafssvrmgr.cnt index 11eebad35..289d6434e 100755 --- a/src/WINNT/doc/help/en_US/taafssvrmgr.cnt +++ b/src/WINNT/doc/help/en_US/taafssvrmgr.cnt @@ -1,89 +1,89 @@ -:Base TAAFSSVRMGR.HLP -:Title IBM AFS Server Manager -1 AFS Server Manager -2 Overview of AFS -3 AFS: Overview=AFS__Overview -3 AFS Cells=DCE_Cells -2 AFS Server Manager -3 AFS Server Manager: Overview=DFS_Server_Manager -2 Authenticating to AFS -3 To Authenticate to AFS=To_Obtain_DCE_Credentials -3 To Choose an AFS Cell to Administer=To_Choose_a_DCE_Cell_to_Administer -2 AFS Servers -3 Servers: Overview=Servers__An_Overview -3 Maintaining AFS Servers=Setting_Up_and_Maintaining_DFS_Servers -3 Monitoring Server Subsets=Monitoring_Server_Subsets -3 Server Properties=Server_Properties -3 Server Warnings=Server_Warnings -3 Administrators for a Server -4 Administrators for a Server: Overview=Administrators_for_a_Server -4 To Add or Remove a User from the Administrators List for a Server=To_Edit_an_Administrative_List -3 Server Encryption Keys -4 Server Encryption Keys: Overview=Server_Encryption_Keys -4 To Add a New Server Encryption Key=To_Add_a_New_Server_Key -4 To Remove a Server Encryption Key=To_Remove_a_Server_Encryption_Key -3 Server Files -4 To Install a New File on a Server=To_Install_New_Files_on_a_Server -4 To Install the Former Versions of Binary Files on a Server=To_Install_Former_Versions_of_Binary_Files_on_a_Server -4 To Prune Files from a Server=To_Prune_Files_from_a_Server -4 To Get File Dates=To_Get_File_Dates -3 Synchronizing the VLDB on a Server -4 Synchronizing the VLDB=Synchronizing_the_FLDB -4 To Synchronize the VLDB on a Server=To_Synchronize_the_FLDB -2 AFS Partitions -3 Partitions: Overview=Partitions__An_Overview -3 Partitions Properties=Partition_Properties -3 Partitions Warnings=Partition_Warnings -2 AFS Volumes -3 Volumes: Overview=Filesets__An_Overview -3 The Different Types of Volumes =Read__Write_and_Read_Only_Filesets -3 The Volume Location Database (VLDB)=FLDB__Fileset_Location_Database_ -3 Volume Properties=Fileset_Properties -3 To Create a Volume =To_Create_a_Fileset -3 To Rename a Volume =To_Rename_a_Fileset -3 To Delete a Volume =To_Delete_a_Fileset -3 Moving Volumes -4 Moving Volumes: Overview=Moving_Filesets -4 To Move a Volume =To_Move_a_Fileset -3 Creating Backup Versions of Volumes -4 To Create a Backup Version of a Volume=IDH_SVRMGR_CLONE_OVERVIEW -4 To Create Backup Versions of Multiple Volumes=To_Clone_Multiple_Filesets -3 Locking and Unlocking Volumes -4 Locking and Unlocking VLDB Entries=Locking_and_Unlocking_Filesets -4 To Determine if a Volume is Locked=To_Determine_Whether_a_Fileset_Entry_is_Locked -4 To Lock a Volume =To_Lock_a_Fileset -4 To Unlock a Volume =To_Unlock_a_Fileset -3 Dumping and Restoring Volumes -4 Dumping Volumes=Dumping_and_Restoring_Filesets -4 To Dump a Volume =To_Dump_a_Fileset -4 Restoring Volumes=Restoring_Filesets -4 Restoring Incremental Volume Dumps =Restoring_Multiple_Incremental_Dumps_of_a_Fileset -4 To Restore a Dump File=To_Restore_a_Dump_File_to_a_New_Fileset -3 Volume Warnings=Fileset_Warnings -2 AFS Volume Replication -3 Replicating Volumes=Replicating_Filesets -3 To Create a New Volume Replication Site=To_Create_a_New_Fileset_Replication_Site -3 To Replicate a Volume =To_Replicate_a_Fileset -3 Updating Volume Replicas=Updating_Replicas -2 AFS Services -3 Services: Overview=Services__An_Overview -3 Setting Up and Maintaining AFS Services=Setting_Up_and_Maintaining_DFS_Services -3 Service Properties=Service_Properties -3 To Create a Service=To_Create_a_Service -3 To Delete a Service=To_Delete_a_Service -3 To Start a Service=To_Start_a_Service -3 To Stop a Service=To_Stop_a_Service -3 To Restart a Service=To_Restart_a_Service -3 To Set BOS Service Restart Dates=To_Set_BOS_Service_Restart_Dates_and_Times -3 To View Service Status and Details=To_View_Service_Status_and_Details -3 Service Log Files -4 Log Files=Log_Files -4 To View a Service Log File=To_View_Service_Log -2 Salvaging Volumes -3 Salvaging Volumes: Overview=Salvaging_Volumes -3 To Salvage all Volumes on a File Server=To_Salvage_all_Volumes_on_a_File_Server -3 To Salvage all Volumes on a Partition=To_Salvage_all_Volumes_on_a_Partition -3 To Salvage a Volume=To_Salvage_a_Volume -2 AFS Command Reference -3 Reference for AFS UNIX Users=UNIX_Command_Reference -3 AFS Command Prompt Commands=AFS_Command_Prompt_Commands +:Base TAAFSSVRMGR.HLP +:Title IBM AFS Server Manager +1 AFS Server Manager +2 Overview of AFS +3 AFS: Overview=AFS__Overview +3 AFS Cells=DCE_Cells +2 AFS Server Manager +3 AFS Server Manager: Overview=DFS_Server_Manager +2 Authenticating to AFS +3 To Authenticate to AFS=To_Obtain_DCE_Credentials +3 To Choose an AFS Cell to Administer=To_Choose_a_DCE_Cell_to_Administer +2 AFS Servers +3 Servers: Overview=Servers__An_Overview +3 Maintaining AFS Servers=Setting_Up_and_Maintaining_DFS_Servers +3 Monitoring Server Subsets=Monitoring_Server_Subsets +3 Server Properties=Server_Properties +3 Server Warnings=Server_Warnings +3 Administrators for a Server +4 Administrators for a Server: Overview=Administrators_for_a_Server +4 To Add or Remove a User from the Administrators List for a Server=To_Edit_an_Administrative_List +3 Server Encryption Keys +4 Server Encryption Keys: Overview=Server_Encryption_Keys +4 To Add a New Server Encryption Key=To_Add_a_New_Server_Key +4 To Remove a Server Encryption Key=To_Remove_a_Server_Encryption_Key +3 Server Files +4 To Install a New File on a Server=To_Install_New_Files_on_a_Server +4 To Install the Former Versions of Binary Files on a Server=To_Install_Former_Versions_of_Binary_Files_on_a_Server +4 To Prune Files from a Server=To_Prune_Files_from_a_Server +4 To Get File Dates=To_Get_File_Dates +3 Synchronizing the VLDB on a Server +4 Synchronizing the VLDB=Synchronizing_the_FLDB +4 To Synchronize the VLDB on a Server=To_Synchronize_the_FLDB +2 AFS Partitions +3 Partitions: Overview=Partitions__An_Overview +3 Partitions Properties=Partition_Properties +3 Partitions Warnings=Partition_Warnings +2 AFS Volumes +3 Volumes: Overview=Filesets__An_Overview +3 The Different Types of Volumes =Read__Write_and_Read_Only_Filesets +3 The Volume Location Database (VLDB)=FLDB__Fileset_Location_Database_ +3 Volume Properties=Fileset_Properties +3 To Create a Volume =To_Create_a_Fileset +3 To Rename a Volume =To_Rename_a_Fileset +3 To Delete a Volume =To_Delete_a_Fileset +3 Moving Volumes +4 Moving Volumes: Overview=Moving_Filesets +4 To Move a Volume =To_Move_a_Fileset +3 Creating Backup Versions of Volumes +4 To Create a Backup Version of a Volume=IDH_SVRMGR_CLONE_OVERVIEW +4 To Create Backup Versions of Multiple Volumes=To_Clone_Multiple_Filesets +3 Locking and Unlocking Volumes +4 Locking and Unlocking VLDB Entries=Locking_and_Unlocking_Filesets +4 To Determine if a Volume is Locked=To_Determine_Whether_a_Fileset_Entry_is_Locked +4 To Lock a Volume =To_Lock_a_Fileset +4 To Unlock a Volume =To_Unlock_a_Fileset +3 Dumping and Restoring Volumes +4 Dumping Volumes=Dumping_and_Restoring_Filesets +4 To Dump a Volume =To_Dump_a_Fileset +4 Restoring Volumes=Restoring_Filesets +4 Restoring Incremental Volume Dumps =Restoring_Multiple_Incremental_Dumps_of_a_Fileset +4 To Restore a Dump File=To_Restore_a_Dump_File_to_a_New_Fileset +3 Volume Warnings=Fileset_Warnings +2 AFS Volume Replication +3 Replicating Volumes=Replicating_Filesets +3 To Create a New Volume Replication Site=To_Create_a_New_Fileset_Replication_Site +3 To Replicate a Volume =To_Replicate_a_Fileset +3 Updating Volume Replicas=Updating_Replicas +2 AFS Services +3 Services: Overview=Services__An_Overview +3 Setting Up and Maintaining AFS Services=Setting_Up_and_Maintaining_DFS_Services +3 Service Properties=Service_Properties +3 To Create a Service=To_Create_a_Service +3 To Delete a Service=To_Delete_a_Service +3 To Start a Service=To_Start_a_Service +3 To Stop a Service=To_Stop_a_Service +3 To Restart a Service=To_Restart_a_Service +3 To Set BOS Service Restart Dates=To_Set_BOS_Service_Restart_Dates_and_Times +3 To View Service Status and Details=To_View_Service_Status_and_Details +3 Service Log Files +4 Log Files=Log_Files +4 To View a Service Log File=To_View_Service_Log +2 Salvaging Volumes +3 Salvaging Volumes: Overview=Salvaging_Volumes +3 To Salvage all Volumes on a File Server=To_Salvage_all_Volumes_on_a_File_Server +3 To Salvage all Volumes on a Partition=To_Salvage_all_Volumes_on_a_Partition +3 To Salvage a Volume=To_Salvage_a_Volume +2 AFS Command Reference +3 Reference for AFS UNIX Users=UNIX_Command_Reference +3 AFS Command Prompt Commands=AFS_Command_Prompt_Commands diff --git a/src/WINNT/doc/help/en_US/taafsusrmgr.cnt b/src/WINNT/doc/help/en_US/taafsusrmgr.cnt index 6e79e17f1..a3631e830 100755 --- a/src/WINNT/doc/help/en_US/taafsusrmgr.cnt +++ b/src/WINNT/doc/help/en_US/taafsusrmgr.cnt @@ -1,66 +1,66 @@ -:Base TAAFSUSRMGR.HLP -:Title IBM AFS Account Manager -1 AFS Account Manager -2 AFS User Accounts -3 Creating AFS Accounts -4 Creating AFS User Accounts=Creating_User_Entries -4 To create a new AFS user account=To_create_a_single_user_account -3 Password Authentication and Security -4 Improving Password/Authentication Security=Improving_Password_Authentication_Security -4 To limit the number of consecutive failed login attempts by a user=To_limit_the_number_of_consecutive_failed_login_attempts -4 To unlock a locked user account=To_unlock_a_locked_user_account -4 To set the password lifetime for an AFS user account=To_set_password_lifetime -4 To restrict reuse of passwords by a user=To_restrict_reuse_of_passwords -3 Changing Passwords -4 Changing Passwords=Changing_Passwords -4 To change a user's AFS password=To_change_a_password_in_the_Authentication_Database -3 Removing User Accounts -4 Removing User Accounts=Removing_User_Accounts -4 To delete an AFS user account=To_remove_a_user_account -2 AFS Groups -3 About the Protection Database=AFS_Protection_Database -3 Protection Database Entries=Protection_Database_Entries -3 Using Groups -4 Using Groups Effectively=Using_Groups_Effectively -4 Using Prefix-Less AFS Groups=Using_Prefix_Less_Groups -4 Placing IP Addresses in Groups=Placing_Machines_in_Groups -4 The Standard System Groups=The_Standard_System_Groups -4 Listing Information about Groups -5 Listing Information about Groups=Listing_Information_about_Groups -5 To view a list of the members of an AFS group=To_list_the_members_of_a_group -5 To view information about an AFS group=To_examine_a_Protection_Database_group_entry -5 To view a list of the groups that an AFS group owns=To_list_the_groups_that_a_group_owns -4 Listing Group-Related Information about Users and Machine Entries -5 Listing Group-Related Information about Users and Machine Entries=Listing_Group_Related_Information_about_Users_and_Machine_Entries -5 To view a list of the groups to which an AFS user belongs=To_examine_a_Protection_Database_entry_for_a_user_or_machine -5 To view a list of the groups that an AFS user owns=To_view_a_list_of_the_groups_that_an_AFS_user_owns -5 To view a list of the groups that an IP address account owns=To_view_a_list_of_the_groups_that_an_IP_address_account_owns -5 To view a list of the groups to which an IP address account belongs=To_view_a_list_of_the_groups_to_which_an_IP_address_account_belongs -4 Creating User Entries -5 Creating AFS User Accounts=Creating_User_Entries -5 To create a new AFS user account=To_create_a_single_user_account -4 Creating Machine Entries -5 Creating IP Address Entries=Creating_Machine_Entries -5 To create an IP address account in the AFS Protection Database=To_create_a_single_machine_entry_in_the_Protection_Database -4 Creating Regular and Prefix-Less Groups -5 Creating Regular and Prefix-Less AFS Groups=Creating_Regular_and_Prefix_Less_Groups -5 To create a new regular AFS group=To_create_a_single_regular_group_entry -5 To create a new prefix-less AFS group=To_create_a_single_prefix_less_group_entry -4 Adding Members to Groups and Removing Them from Groups -5 Adding Members to Groups and Removing Them from Groups=Adding_Members_to_Groups_and_Removing_Them_from_Groups -5 To add a user or IP address account to a group=To_add_users_and_machines_to_groups -5 To remove a user, IP address account, or group from an AFS group=To_remove_users_and_machines_from_groups -3 Deleting Entries from the Protection Database -4 Deleting Entries from the Protection Database=Deleting_Entries_from_the_Protection_Database -4 To delete an AFS group=To_delete_user_and_group_entries -3 Changing the Owner of an Entry -4 Changing the Owner of an AFS Group=Changing_the_Owner_of_an_Entry -4 The Name-Changing Implications of Changing Ownership=The_Name_Changing_Implications_of_Changing_Ownership -4 To change the owner of an AFS group=To_change_the_owner_of_a_group_entry -3 Changing the Name of an Entry -4 Changing the Name of an AFS Group=Changing_the_Name_of_an_Entry -4 To change the name of an AFS group=To_change_the_name_of_a_group_entry -3 Changing Group Creation Quota -4 Changing Group Creation Quota=Changing_Group_Creation_Quota -4 To view the group creation quota of an AFS user=To_examine_group_creation_quota -4 To change the group creation quota of an AFS user=To_change_group_creation_quota +:Base TAAFSUSRMGR.HLP +:Title IBM AFS Account Manager +1 AFS Account Manager +2 AFS User Accounts +3 Creating AFS Accounts +4 Creating AFS User Accounts=Creating_User_Entries +4 To create a new AFS user account=To_create_a_single_user_account +3 Password Authentication and Security +4 Improving Password/Authentication Security=Improving_Password_Authentication_Security +4 To limit the number of consecutive failed login attempts by a user=To_limit_the_number_of_consecutive_failed_login_attempts +4 To unlock a locked user account=To_unlock_a_locked_user_account +4 To set the password lifetime for an AFS user account=To_set_password_lifetime +4 To restrict reuse of passwords by a user=To_restrict_reuse_of_passwords +3 Changing Passwords +4 Changing Passwords=Changing_Passwords +4 To change a user's AFS password=To_change_a_password_in_the_Authentication_Database +3 Removing User Accounts +4 Removing User Accounts=Removing_User_Accounts +4 To delete an AFS user account=To_remove_a_user_account +2 AFS Groups +3 About the Protection Database=AFS_Protection_Database +3 Protection Database Entries=Protection_Database_Entries +3 Using Groups +4 Using Groups Effectively=Using_Groups_Effectively +4 Using Prefix-Less AFS Groups=Using_Prefix_Less_Groups +4 Placing IP Addresses in Groups=Placing_Machines_in_Groups +4 The Standard System Groups=The_Standard_System_Groups +4 Listing Information about Groups +5 Listing Information about Groups=Listing_Information_about_Groups +5 To view a list of the members of an AFS group=To_list_the_members_of_a_group +5 To view information about an AFS group=To_examine_a_Protection_Database_group_entry +5 To view a list of the groups that an AFS group owns=To_list_the_groups_that_a_group_owns +4 Listing Group-Related Information about Users and Machine Entries +5 Listing Group-Related Information about Users and Machine Entries=Listing_Group_Related_Information_about_Users_and_Machine_Entries +5 To view a list of the groups to which an AFS user belongs=To_examine_a_Protection_Database_entry_for_a_user_or_machine +5 To view a list of the groups that an AFS user owns=To_view_a_list_of_the_groups_that_an_AFS_user_owns +5 To view a list of the groups that an IP address account owns=To_view_a_list_of_the_groups_that_an_IP_address_account_owns +5 To view a list of the groups to which an IP address account belongs=To_view_a_list_of_the_groups_to_which_an_IP_address_account_belongs +4 Creating User Entries +5 Creating AFS User Accounts=Creating_User_Entries +5 To create a new AFS user account=To_create_a_single_user_account +4 Creating Machine Entries +5 Creating IP Address Entries=Creating_Machine_Entries +5 To create an IP address account in the AFS Protection Database=To_create_a_single_machine_entry_in_the_Protection_Database +4 Creating Regular and Prefix-Less Groups +5 Creating Regular and Prefix-Less AFS Groups=Creating_Regular_and_Prefix_Less_Groups +5 To create a new regular AFS group=To_create_a_single_regular_group_entry +5 To create a new prefix-less AFS group=To_create_a_single_prefix_less_group_entry +4 Adding Members to Groups and Removing Them from Groups +5 Adding Members to Groups and Removing Them from Groups=Adding_Members_to_Groups_and_Removing_Them_from_Groups +5 To add a user or IP address account to a group=To_add_users_and_machines_to_groups +5 To remove a user, IP address account, or group from an AFS group=To_remove_users_and_machines_from_groups +3 Deleting Entries from the Protection Database +4 Deleting Entries from the Protection Database=Deleting_Entries_from_the_Protection_Database +4 To delete an AFS group=To_delete_user_and_group_entries +3 Changing the Owner of an Entry +4 Changing the Owner of an AFS Group=Changing_the_Owner_of_an_Entry +4 The Name-Changing Implications of Changing Ownership=The_Name_Changing_Implications_of_Changing_Ownership +4 To change the owner of an AFS group=To_change_the_owner_of_a_group_entry +3 Changing the Name of an Entry +4 Changing the Name of an AFS Group=Changing_the_Name_of_an_Entry +4 To change the name of an AFS group=To_change_the_name_of_a_group_entry +3 Changing Group Creation Quota +4 Changing Group Creation Quota=Changing_Group_Creation_Quota +4 To view the group creation quota of an AFS user=To_examine_group_creation_quota +4 To change the group creation quota of an AFS user=To_change_group_creation_quota diff --git a/src/WINNT/eventlog/NTMakefile b/src/WINNT/eventlog/NTMakefile index 2d2b450a4..87c81774e 100644 --- a/src/WINNT/eventlog/NTMakefile +++ b/src/WINNT/eventlog/NTMakefile @@ -5,6 +5,7 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=WINNT\eventlog !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version @@ -12,7 +13,10 @@ LIBFILE = $(DESTDIR)\lib\afs\afseventlog.lib LIBOBJS =\ - logevent.obj + $(OUT)\logevent.obj + +$(LIBOBJS): $$(@B).c + $(C2OBJ) $** $(LIBFILE): $(LIBOBJS) $(LIBARCH) @@ -78,4 +82,8 @@ clean:: if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /f NTMakefile clean $(CD) .. - +mkdir: + -mkdir $(OUT)\lang + cd lang + nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir + cd .. diff --git a/src/WINNT/eventlog/lang/NTMakefile b/src/WINNT/eventlog/lang/NTMakefile index 6b176a86b..98ea8ec7c 100644 --- a/src/WINNT/eventlog/lang/NTMakefile +++ b/src/WINNT/eventlog/lang/NTMakefile @@ -5,6 +5,7 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=WINNT\eventlog\lang !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\..\config\NTMakefile.version @@ -29,13 +30,13 @@ INCFILES =\ ############################################################################ DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\afseventmsg_$(LANGID).dll -DLLRESFILE = afseventmsg_$(LANGID).res +DLLRESFILE = $(OUT)\afseventmsg_$(LANGID).res DLLRCFILE = afseventmsg.rc EVENTRCFILE = $(LANGNAME)\event.rc -EVENTRESFILE = $(LANGNAME)\event.res +EVENTRESFILE = $(OUT)\$(LANGNAME)\event.res DLLOBJS = $(DLLRESFILE) diff --git a/src/WINNT/eventlog/lang/de_DE/event.mc b/src/WINNT/eventlog/lang/de_DE/event.mc index 21e0f5152..6cad92c2a 100644 --- a/src/WINNT/eventlog/lang/de_DE/event.mc +++ b/src/WINNT/eventlog/lang/de_DE/event.mc @@ -7,8 +7,8 @@ ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; -;#ifndef TRANSARC_AFSEVENT_H -;#define TRANSARC_AFSEVENT_H +;#ifndef OPENAFS_AFSEVENT_H +;#define OPENAFS_AFSEVENT_H ; ; ;/* AFS event.mc format. @@ -167,4 +167,4 @@ Der AFS BOS-Steuerungsservice hat festgestellt, da ; -;#endif /* TRANSARC_AFSEVENT_H */ +;#endif /* OPENAFS_AFSEVENT_H */ diff --git a/src/WINNT/eventlog/lang/en_US/event.mc b/src/WINNT/eventlog/lang/en_US/event.mc index 33e3e3b6d..e78f8acc8 100644 --- a/src/WINNT/eventlog/lang/en_US/event.mc +++ b/src/WINNT/eventlog/lang/en_US/event.mc @@ -7,8 +7,8 @@ ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; -;#ifndef TRANSARC_AFSEVENT_H -;#define TRANSARC_AFSEVENT_H +;#ifndef OPENAFS_AFSEVENT_H +;#define OPENAFS_AFSEVENT_H ; ; ;/* AFS event.mc format. @@ -167,4 +167,4 @@ The AFS BOS control service detected that the AFS bosserver exited without reque ; -;#endif /* TRANSARC_AFSEVENT_H */ +;#endif /* OPENAFS_AFSEVENT_H */ diff --git a/src/WINNT/eventlog/lang/es_ES/event.mc b/src/WINNT/eventlog/lang/es_ES/event.mc index 9f457ac8f..42b9298f0 100644 --- a/src/WINNT/eventlog/lang/es_ES/event.mc +++ b/src/WINNT/eventlog/lang/es_ES/event.mc @@ -7,8 +7,8 @@ ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; -;#ifndef TRANSARC_AFSEVENT_H -;#define TRANSARC_AFSEVENT_H +;#ifndef OPENAFS_AFSEVENT_H +;#define OPENAFS_AFSEVENT_H ; ; ;/* AFS event.mc format. @@ -175,4 +175,4 @@ bosserver de AFS ha salido sin solicitar un reinicio. ; -;#endif /* TRANSARC_AFSEVENT_H */ +;#endif /* OPENAFS_AFSEVENT_H */ diff --git a/src/WINNT/eventlog/lang/ja_JP/event.mc b/src/WINNT/eventlog/lang/ja_JP/event.mc index 4f33fc4e7..935c76cb0 100644 --- a/src/WINNT/eventlog/lang/ja_JP/event.mc +++ b/src/WINNT/eventlog/lang/ja_JP/event.mc @@ -7,8 +7,8 @@ ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; -;#ifndef TRANSARC_AFSEVENT_H -;#define TRANSARC_AFSEVENT_H +;#ifndef OPENAFS_AFSEVENT_H +;#define OPENAFS_AFSEVENT_H ; ; ;/* AFS event.mc format. @@ -168,4 +168,4 @@ AFS BOS ; -;#endif /* TRANSARC_AFSEVENT_H */ +;#endif /* OPENAFS_AFSEVENT_H */ diff --git a/src/WINNT/eventlog/lang/ko_KR/event.mc b/src/WINNT/eventlog/lang/ko_KR/event.mc index 1ba257b35..6856f354c 100644 --- a/src/WINNT/eventlog/lang/ko_KR/event.mc +++ b/src/WINNT/eventlog/lang/ko_KR/event.mc @@ -7,8 +7,8 @@ ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; -;#ifndef TRANSARC_AFSEVENT_H -;#define TRANSARC_AFSEVENT_H +;#ifndef OPENAFS_AFSEVENT_H +;#define OPENAFS_AFSEVENT_H ; ; ;/* AFS event.mc format. @@ -172,4 +172,4 @@ AFS BOS ; -;#endif /* TRANSARC_AFSEVENT_H */ +;#endif /* OPENAFS_AFSEVENT_H */ diff --git a/src/WINNT/eventlog/lang/pt_BR/event.mc b/src/WINNT/eventlog/lang/pt_BR/event.mc index 93ad68e0f..801dd6d9f 100644 --- a/src/WINNT/eventlog/lang/pt_BR/event.mc +++ b/src/WINNT/eventlog/lang/pt_BR/event.mc @@ -7,8 +7,8 @@ ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; -;#ifndef TRANSARC_AFSEVENT_H -;#define TRANSARC_AFSEVENT_H +;#ifndef OPENAFS_AFSEVENT_H +;#define OPENAFS_AFSEVENT_H ; ; ;/* AFS event.mc format. @@ -167,4 +167,4 @@ O servi ; -;#endif /* TRANSARC_AFSEVENT_H */ +;#endif /* OPENAFS_AFSEVENT_H */ diff --git a/src/WINNT/eventlog/lang/zh_CN/event.mc b/src/WINNT/eventlog/lang/zh_CN/event.mc index 447114f30..c7e331c1d 100644 --- a/src/WINNT/eventlog/lang/zh_CN/event.mc +++ b/src/WINNT/eventlog/lang/zh_CN/event.mc @@ -7,8 +7,8 @@ ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; -;#ifndef TRANSARC_AFSEVENT_H -;#define TRANSARC_AFSEVENT_H +;#ifndef OPENAFS_AFSEVENT_H +;#define OPENAFS_AFSEVENT_H ; ; ;/* AFS event.mc format. @@ -169,4 +169,4 @@ AFS BOS ; -;#endif /* TRANSARC_AFSEVENT_H */ +;#endif /* OPENAFS_AFSEVENT_H */ diff --git a/src/WINNT/eventlog/lang/zh_TW/event.mc b/src/WINNT/eventlog/lang/zh_TW/event.mc index 46bebd678..6412c8ca0 100644 --- a/src/WINNT/eventlog/lang/zh_TW/event.mc +++ b/src/WINNT/eventlog/lang/zh_TW/event.mc @@ -7,8 +7,8 @@ ; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h ; */ ; -;#ifndef TRANSARC_AFSEVENT_H -;#define TRANSARC_AFSEVENT_H +;#ifndef OPENAFS_AFSEVENT_H +;#define OPENAFS_AFSEVENT_H ; ; ;/* AFS event.mc format. @@ -169,4 +169,4 @@ AFS BOS ; -;#endif /* TRANSARC_AFSEVENT_H */ +;#endif /* OPENAFS_AFSEVENT_H */ diff --git a/src/WINNT/eventlog/logevent.h b/src/WINNT/eventlog/logevent.h index ba1281e87..903d616ff 100644 --- a/src/WINNT/eventlog/logevent.h +++ b/src/WINNT/eventlog/logevent.h @@ -7,8 +7,8 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#ifndef TRANSARC_LOGEVENT_H -#define TRANSARC_LOGEVENT_H +#ifndef OPENAFS_LOGEVENT_H +#define OPENAFS_LOGEVENT_H #define AFSEVT_MAXARGS 16 /* max number of text insertion strings */ @@ -21,4 +21,4 @@ ReportWarningEventAlt(unsigned int eventId, int status, char *str, ...); extern int ReportInformationEventAlt(unsigned int eventId, char *str, ...); -#endif /* TRANSARC_LOGEVENT_H */ +#endif /* OPENAFS_LOGEVENT_H */ diff --git a/src/WINNT/eventlog/test/NTMakefile b/src/WINNT/eventlog/test/NTMakefile index 09b169635..6408e9d9d 100644 --- a/src/WINNT/eventlog/test/NTMakefile +++ b/src/WINNT/eventlog/test/NTMakefile @@ -5,10 +5,14 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=WINNT\eventlog\test !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) test tests: elogtest.exe -elogtest.exe: elogtest.obj \ +$(OUT)\elogtest.exe: $(OUT)\elogtest.obj \ $(DESTDIR)\lib\afs\afseventlog.lib $(DESTDIR)\lib\afs\afsreg.lib $(EXECONLINK) + +mkdir: + diff --git a/src/WINNT/install/InstallShield5/BuildSetup.bat b/src/WINNT/install/InstallShield5/BuildSetup.bat index 546fac3aa..330df822e 100644 --- a/src/WINNT/install/InstallShield5/BuildSetup.bat +++ b/src/WINNT/install/InstallShield5/BuildSetup.bat @@ -6,7 +6,7 @@ rem This software has been released under the terms of the IBM Public rem License. For details, see the LICENSE file in the top-level source rem directory or online at http://www.openafs.org/dl/license10.html -rem This file runs the IS5 command line tools to create the Transarc AFS setup media. +rem This file runs the IS5 command line tools to create the OpenAFS setup media. echo Building the setup media... diff --git a/src/WINNT/install/InstallShield5/CreateISDirTree.bat b/src/WINNT/install/InstallShield5/CreateISDirTree.bat index 648a9e009..d5cbb7e63 100644 --- a/src/WINNT/install/InstallShield5/CreateISDirTree.bat +++ b/src/WINNT/install/InstallShield5/CreateISDirTree.bat @@ -18,43 +18,47 @@ if not exist "Media\OpenAFS" mkdir "Media\OpenAFS" if not exist "Registry Entries" mkdir "Registry Entries" if not exist "Script Files" mkdir "Script Files" if not exist "Setup Files" mkdir "Setup Files" - -set sub1=Uncompressed Files -call :gencomp -set sub1=Compressed Files -call :gencomp -goto shell - -:gencomp -if not exist "Setup Files\%sub1%" mkdir "Setup Files\%sub1%" -set sub2=Language Independent -call :gencomp2 -set sub2=0009-English -call :gencomp2 -set sub2=0007-German -call :gencomp2 -set sub2=0011-Japanese -call :gencomp2 -set sub2=0012-Korean -call :gencomp2 -set sub2=0416-Portuguese (Brazilian) -call :gencomp2 -set sub2=0404-Chinese (Taiwan) -call :gencomp2 -set sub2=000a-Spanish -call :gencomp2 -set sub2=0804-Chinese (PRC) -call :gencomp2 -goto :eof - -:gencomp2 -rem echo ]%sub1%] ]%sub2%] + +if not exist "Registry Entries" mkdir "Registry Entries" +if not exist "Script Files" mkdir "Script Files" +if not exist "Setup Files" mkdir "Setup Files" + +set sub1=Uncompressed Files +call :gencomp +set sub1=Compressed Files +call :gencomp +goto shell + +:gencomp +if not exist "Setup Files\%sub1%" mkdir "Setup Files\%sub1%" +set sub2=Language Independent +call :gencomp2 +set sub2=0009-English +call :gencomp2 +set sub2=0007-German +call :gencomp2 +set sub2=0011-Japanese +call :gencomp2 +set sub2=0012-Korean +call :gencomp2 +set sub2=0416-Portuguese (Brazilian) +call :gencomp2 +set sub2=0404-Chinese (Taiwan) +call :gencomp2 +set sub2=000a-Spanish +call :gencomp2 +set sub2=0804-Chinese (PRC) +call :gencomp2 +goto :eof + +:gencomp2 +rem echo ]%sub1%] ]%sub2%] if not exist "Setup Files\%sub1%\%sub2%" mkdir "Setup Files\%sub1%\%sub2%" if not exist "Setup Files\%sub1%\%sub2%\OS Independent" mkdir "Setup Files\%sub1%\%sub2%\OS Independent" if not exist "Setup Files\%sub1%\%sub2%\Intel 32" mkdir "Setup Files\%sub1%\%sub2%\Intel 32" -goto :eof - -:shell +goto :eof + +:shell if not exist "Shell Objects" mkdir "Shell Objects" if not exist "String Tables" mkdir "String Tables" if not exist "String Tables\0009-English" mkdir "String Tables\0009-English" diff --git a/src/WINNT/install/InstallShield5/NTMakefile b/src/WINNT/install/InstallShield5/NTMakefile index a792608c6..132379402 100644 --- a/src/WINNT/install/InstallShield5/NTMakefile +++ b/src/WINNT/install/InstallShield5/NTMakefile @@ -5,6 +5,7 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=WINNT\install\InstallShield5 !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\..\config\NTMakefile.version @@ -18,8 +19,6 @@ CELLSERVDB_CONFIGNAME=afsdcell.ini WELCOMEMESSAGE=Default Configuration Information:\nBuild:*DatE* *TimE* Ver:$(AFSPRODUCT_VERSION)\nCellname:$(CELLNAME_DEFAULT)\nCellSrvDB:$(CELLSERVDB_INSTALL) AFSBUILDCOMMENTS=Build:*DatE* *TimE* CellServDB:$(CELLSERVDB_INSTALL) -############################################################################ - #CHECK which OS we are using to avoid using the wrong options !IF (([$(DESTDIR)\bin\util_cr.exe _ xp w2])==1) XCOPY= xcopy /s/e/y @@ -27,44 +26,34 @@ XCOPY= xcopy /s/e/y XCOPY= xcopy /s/e !ENDIF -#check which version of the complier we are using +############################################################################ prep: AFS_component_version_number.txt -! IF (!EXIST($(DESTDIR)\WinInstall\Config\wininet.dll)) -! ERROR File Not found:$(DESTDIR)\WinInstall\Config\wininet.dll -! ENDIF -! IF (!EXIST($(DESTDIR)\WinInstall\Config\shlwapi.dll)) -! ERROR File Not found:$(DESTDIR)\WinInstall\Config\shlwapi.dll -! ENDIF -! IF (!EXIST($(DESTDIR)\WinInstall\Config\$(CELLSERVDB_INSTALL))) -! ERROR File Not found:$(DESTDIR)\WinInstall\Config\$(CELLSERVDB_INSTALL) -! ENDIF - $(DESTDIR)\bin\util_cr.exe } "$(AFSPRODUCT_VERSION)" ".\lang\en_US\value.txt" ".\lang\en_US\value.shl" + $(DESTDIR)\bin\util_cr.exe } "$(AFSPRODUCT_VERSION)" ".\lang\en_US\value.txt" "$(OUT)\lang\en_US\value.shl" $(DESTDIR)\bin\util_cr.exe } "$(AFSPRODUCT_VERSION)" "default.txt" "default.rge" - $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] CELLSERVDB_CONFIGNAME=$(CELLSERVDB_CONFIGNAME)" - $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] CELLNAME_DEFAULT=$(CELLNAME_DEFAULT)" - $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] CELLSERVDB_INSTALL=$(CELLSERVDB_INSTALL)" - $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] CELLSERVDB_WEB=$(CELLSERVDB_WEB)" + $(DESTDIR)\bin\util_cr.exe @ "$(OUT)\lang\en_US\value.shl" "[DATA] CELLSERVDB_CONFIGNAME=$(CELLSERVDB_CONFIGNAME)" + $(DESTDIR)\bin\util_cr.exe @ "$(OUT)\lang\en_US\value.shl" "[DATA] CELLNAME_DEFAULT=$(CELLNAME_DEFAULT)" + $(DESTDIR)\bin\util_cr.exe @ "$(OUT)\lang\en_US\value.shl" "[DATA] CELLSERVDB_INSTALL=$(CELLSERVDB_INSTALL)" + $(DESTDIR)\bin\util_cr.exe @ "$(OUT)\lang\en_US\value.shl" "[DATA] CELLSERVDB_WEB=$(CELLSERVDB_WEB)" !IF "$(WELCOMEMESSAGE)" != "" - $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\lang\en_US\value.shl" "[DATA] WELCOME_MESSAGE=$(WELCOMEMESSAGE)" + $(DESTDIR)\bin\util_cr.exe @ "$(OUT)\lang\en_US\value.shl" "[DATA] WELCOME_MESSAGE=$(WELCOMEMESSAGE)" !ENDIF ! IF ((EXIST("$(ISWEB)")) &&("$(ISWEB)"!="")) - $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] Version=$(AFSPRODUCT_VERSION)" - $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] Comments=$(AFSBUILDCOMMENTS)" - $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] ApplicationName=AFSforWindows" - $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] Company=Open AFS" - $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] Title=Open AFS for Windows" - $(DESTDIR)\bin\util_cr.exe @ "$(AFSROOT)\src\WINNT\install\InstallShield5\packageweb.pfw" "[Options] OutputSpec="$(DESTDIR)\WinInstall\PackageWeb\AFSforWindows.exe" + $(DESTDIR)\bin\util_cr.exe @ "$(OUT)\packageweb.pfw" "[Options] Version=$(AFSPRODUCT_VERSION)" + $(DESTDIR)\bin\util_cr.exe @ "$(OUT)\packageweb.pfw" "[Options] Comments=$(AFSBUILDCOMMENTS)" + $(DESTDIR)\bin\util_cr.exe @ "$(OUT)\packageweb.pfw" "[Options] ApplicationName=AFSforWindows" + $(DESTDIR)\bin\util_cr.exe @ "$(OUT)\packageweb.pfw" "[Options] Company=Open AFS" + $(DESTDIR)\bin\util_cr.exe @ "$(OUT)\packageweb.pfw" "[Options] Title=Open AFS for Windows" + $(DESTDIR)\bin\util_cr.exe @ "$(OUT)\packageweb.pfw" "[Options] OutputSpec="$(DESTDIR)\WinInstall\PackageWeb\AFSforWindows.exe" ! ENDIF CreateISDirTree.bat ScatterFiles.bat CreateGeneratedFiles.bat - pause -# CompileScript.bat - $(COPY) $(DESTDIR)\WinInstall\Config\wininet.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\." - $(COPY) $(DESTDIR)\WinInstall\Config\shlwapi.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\." - $(COPY) ..\..\afs_setup_utils\_isuser\_isuser.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\." - $(COPY) ..\..\afs_setup_utils\getwebdll\getwebdll.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\." + CompileScript.bat + $(COPY) $(SYSTEMROOT)\SYSTEM32\wininet.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\." + $(COPY) $(SYSTEMROOT)\SYSTEM32\shlwapi.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\." + $(COPY) $(DESTDIR)\WinInstall\Config\_isuser.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\." + $(COPY) $(DESTDIR)\WinInstall\Config\getwebdll.dll ".\Setup Files\Compressed Files\0009-English\Intel 32\." $(COPY) $(DESTDIR)\WinInstall\Config\$(CELLSERVDB_INSTALL) ".\Setup Files\Compressed Files\0009-English\Intel 32\$(CELLSERVDB_CONFIGNAME)" $(DESTDIR)\bin\util_cr.exe ~ ".\Setup Files\Compressed Files\0009-English\Intel 32\$(CELLSERVDB_CONFIGNAME)" $(DESTDIR)\bin\util_cr.exe ~ ".\Setup Files\Compressed Files\0009-English\Intel 32\_ISUSER.DLL" @@ -79,9 +68,11 @@ build: $(MKDIR) $(DESTDIR)\Wininstall\PackageWeb ! ENDIF $(DEL) /q $(DESTDIR)\Wininstall\PackageWeb\*.* - $(ISWEB)\Pftwwiz.exe $(AFSROOT)\src\winnt\install\InstallShield5\PackageWeb.pfw -s -a + $(ISWEB)\Pftwwiz.exe $(SRT)PackageWeb.pfw -s -a !ENDIF - $(XCOPY) Media\OpenAFS\DiskIm~1\disk1\*.* $(DESTDIR)\WinInstall + $(XCOPY) Media\OpenAFS\DiskIm~1\disk1\*.* $(DESTDIR)\WinInstall copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt $(DEL) /q "Media\OpenAFS\Disk Images\disk1\*.*" install: prep build + +mkdir: diff --git a/src/WINNT/install/InstallShield5/afsdcell.ini b/src/WINNT/install/InstallShield5/afsdcell.ini index 65364751d..6d43dc846 100644 --- a/src/WINNT/install/InstallShield5/afsdcell.ini +++ b/src/WINNT/install/InstallShield5/afsdcell.ini @@ -1,4 +1,483 @@ ->PutCellNameHere # CellName Comment -511.01.01.01 #DBServerMachineName1 -511.02.02.02 #DBServerMachineName2 -511.03.03.03 #DBServerMachineName3 +>grand.central.org #GCO Public CellServDB 11 May 2004 +18.7.14.88 #grand-opening.mit.edu +128.2.191.224 #penn.central.org +>wu-wien.ac.at #University of Economics, Vienna, Austria +137.208.3.33 #afsdb1.wu-wien.ac.at +137.208.7.4 #afsdb2.wu-wien.ac.at +137.208.7.7 #afsdb3.wu-wien.ac.at +>hephy.at #hephy-vienna +193.170.243.10 #mowgli.oeaw.ac.at +193.170.243.12 #baloo.oeaw.ac.at +193.170.243.14 #akela.oeaw.ac.at +>itp.tugraz.at #Institute for Theoretical Physics, TU Graz, Austria +129.27.157.6 #fubphsv2.tu-graz.ac.at +129.27.161.7 #faepsv01.tu-graz.ac.at +129.27.161.15 #faepsv02.tu-graz.ac.at +>cern.ch #European Laboratory for Particle Physics, Geneva +137.138.128.148 #afsdb1.cern.ch +137.138.246.50 #afsdb3.cern.ch +137.138.246.51 #afsdb2.cern.ch +>ams.cern.ch #AMS Experiment +137.138.206.77 #pcamsf2.cern.ch +137.138.206.123 #pcamsf4.cern.ch +>ethz.ch #Swiss Federal Inst. of Tech. - Zurich, Switzerland +129.132.97.19 #amalthea.ethz.ch +129.132.97.27 #nethzafs-001.ethz.ch +129.132.115.3 #himalia.ethz.ch +129.132.115.37 #nethzafs-005.ethz.ch +129.132.115.38 #nethzafs-006.ethz.ch +>psi.ch #Paul Scherrer Institut - Villigen, Switzerland +129.129.16.10 #afs1.psi.ch +129.129.16.11 #afs2.psi.ch +>extundo.com #Simon Josefsson's cell +195.42.214.241 #slipsten.extundo.com +>mekinok.com #Mekinok, Inc. +4.36.43.98 #loggerhead.mekinok.com +>membrain.com #membrain.com +66.93.118.125 #stormy +130.85.24.11 #weasel +130.85.24.13 #straykitten +>midnightlinux.com #Midnight Linux, Pittsburgh PA +66.93.62.18 #romulus.midnihtlinux.com +66.93.62.20 #yar.midnightlinux.com +>setfilepointer.com #SetFilePointer.com +63.224.10.2 #hamlet.SetFilePointer.com +63.224.10.4 #troilus.SetFilePointer.com +>sodre.cx #Sodre.cx +128.8.140.165 #greed.sodre.cx +>desy.de #Deutsches Elektronen-Synchrotron +131.169.40.62 #vayu.desy.de +131.169.244.60 #solar00.desy.de +>gppc.de #GPP Chemnitz mbH +213.187.92.33 #gpp1.gppc.de +213.187.92.34 #paulchen.gppc.de +213.187.92.35 #lotus.gppc.de +>ifh.de #DESY Zeuthen +141.34.22.10 #romulus.ifh.de +141.34.22.11 #remus.ifh.de +141.34.22.29 #hekate.ifh.de +>lrz-muenchen.de #Leibniz Computing Centre, Germany +129.187.10.36 #afs1.lrz-muenchen.de +129.187.10.56 #afs3.lrz-muenchen.de +129.187.10.57 #afs2.lrz-muenchen.de +>ipp-garching.mpg.de #Institut fuer Plasmaphysik +130.183.9.5 #afs-db1.rzg.mpg.de +130.183.100.10 #afs-db2.aug.ipp-garching.mpg.de +130.183.100.23 #afs-db3.aug.ipp-garching.mpg.de +>mpe.mpg.de #MPE cell +130.183.130.7 #irafs1.mpe-garching.mpg.de +130.183.134.20 #irafs2.mpe-garching.mpg.de +>i1.informatik.rwth-aachen.de #Informatik I, RWTH Aachen +137.226.244.79 #remus.informatik.rwth-aachen.de +>tu-chemnitz.de #Technische Universitaet Chemnitz, Germany +134.109.2.1 #zuse.hrz.tu-chemnitz.de +134.109.2.15 #phoenix.hrz.tu-chemnitz.de +134.109.200.7 #aetius.hrz.tu-chemnitz.de +>e18.ph.tum.de #Experimental Physics, TU Munich, Germany +129.187.154.223 #hamlet.e18.physik.tu-muenchen.de +>uni-bonn.de #Cell name +131.220.14.198 #work15-eth.rhrz.uni-bonn.de +131.220.14.203 #node03-en2.rhrz.uni-bonn.de +131.220.14.205 #node05.rhrz.uni-bonn.de +>uni-freiburg.de #Albert-Ludwigs-Universitat Freiburg +132.230.6.235 #sv6.ruf.uni-freiburg.de +132.230.6.236 #sv7.ruf.uni-freiburg.de +132.230.6.237 #sv8.ruf.uni-freiburg.de +>physik.uni-freiburg.de #institute of physics, university Freiburg, Germany +132.230.77.16 #hepafs.physik.uni-freiburg.de +>urz.uni-heidelberg.de #Uni Heidelberg (Rechenzentrum) +129.206.119.10 #afsdb.urz.uni-heidelberg.de +129.206.119.16 #afsdb1.urz.uni-heidelberg.de +129.206.119.17 #afsdb2.urz.uni-heidelberg.de +>uni-hohenheim.de #University of Hohenheim +144.41.2.2 #rs13.serv.uni-hohenheim.de +144.41.2.3 #rs14.serv.uni-hohenheim.de +144.41.2.4 #rs15.serv.uni-hohenheim.de +>rz.uni-jena.de #Rechenzentrum University of Jena, Germany +141.35.2.160 #lc00.rz.uni-jena.de +141.35.7.9 #fsuj01.rz.uni-jena.de +141.35.7.10 #zaphod.rz.uni-jena +>meteo.uni-koeln.de #Univ. of Cologne - Inst. for Geophysics & Meteorology +134.95.144.22 #afs1.meteo.uni-koeln.de +134.95.144.24 #afs2.meteo.uni-koeln.de +>rrz.uni-koeln.de #University of Cologne - Reg Comp Center +134.95.19.3 #afsdb1.rrz.uni-koeln.de +134.95.19.30 #fileserv3.rrz.uni-koeln.de +134.95.67.97 #afs.thp.uni-koeln.de +134.95.140.190 #rzkbserv.rrz.uni-koeln.de +>physik.uni-mainz.de #institute of physics, university Mainz, Germany +134.93.130.93 #hardy.physik.uni-mainz.de +>uni-mannheim.de #Uni Mannheim (Rechenzentrum) +134.155.50.165 #afsdbx.uni-mannheim.de +134.155.50.166 #afsdby.uni-mannheim.de +134.155.50.167 #afsdbz.uni-mannheim.de +>physik.uni-wuppertal.de #Physics department of Bergische Universität Wuppertal +132.195.104.3 #afs1.physik.uni-wuppertal.de +132.195.104.230 #afs2.physik.uni-wuppertal.de +>ies.auc.dk #Aalborg Univ., Inst. of Electronic Systems, Denmark +130.225.51.73 #afsdb1.kom.auc.dk +130.225.51.74 #afsdb2.kom.auc.dk +130.225.51.85 #afsdb3.kom.auc.dk +>hep.caltech.edu #CalTech High Energy Physics +131.215.126.150 #afs.hep.caltech.edu +>andrew.cmu.edu #Carnegie Mellon University - Computing Services Cell +128.2.10.2 #vice2.fs.andrew.cmu.edu +128.2.10.7 #vice7.fs.andrew.cmu.edu +128.2.10.11 #vice11.fs.andrew.cmu.edu +128.2.10.28 #vice28.fs.andrew.cmu.edu +128.2.32.44 #new-vice12.fs.andrew.cmu.edu +>club.cc.cmu.edu #Carnegie Mellon University Computer Club +128.2.4.131 #yttrium.club.cc.cmu.edu +128.2.4.132 #zirconium.club.cc.cmu.edu +>chem.cmu.edu #Carnegie Mellon University - Chemistry Dept. +128.2.40.134 #afs.chem.cmu.edu +128.2.40.140 #afs2.chem.cmu.edu +>cs.cmu.edu #Carnegie Mellon University - School of Comp. Sci. +128.2.194.178 #cherry.srv.cs.cmu.edu +128.2.194.179 #pumpkin.srv.cs.cmu.edu +128.2.194.180 #strawberry.srv.cs.cmu.edu +>ece.cmu.edu #Carnegie Mellon University - Elec. Comp. Eng. Dept. +128.2.129.7 #porok.ece.cmu.edu +128.2.129.8 #vicio.ece.cmu.edu +128.2.129.9 #e-xing.ece.cmu.edu +>scotch.ece.cmu.edu #CMU ECE CALCM research group +128.2.134.82 #lagavulin.ece.cmu.edu +>msc.cornell.edu #Cornell University Materials Science Center +128.84.231.242 #miranda.ccmr.cornell.edu +128.84.241.35 #co.ccmr.cornell.edu +128.84.249.78 #dax.ccmr.cornell.edu +>dbic.dartmouth.edu #Dartmouth Brain Imaging Center +129.170.30.143 #dbicafs1.dartmouth.edu +129.170.30.144 #dbicafs2.dartmouth.edu +129.170.30.145 #dbicafs3.dartmouth.edu +>northstar.dartmouth.edu #Dartmouth College Research Computing +129.170.16.22 #halley.dartmouth.edu +129.170.16.42 #oort.dartmouth.edu +129.170.16.43 #cygnusx1.dartmouth.edu +>iastate.edu #Iowa State University +129.186.1.243 #afsdb-1.iastate.edu +129.186.6.243 #afsdb-2.iastate.edu +129.186.142.243 #afsdb-3.iastate.edu +>athena.mit.edu #MIT/Athena cell +18.7.1.66 #paris.mit.edu. +18.7.1.74 #chimera.mit.edu. +18.158.0.37 #prill.mit.edu. +>dev.mit.edu #MIT/IS Development cell +18.7.1.70 #wham.mit.edu. +18.7.15.89 #rattle.mit.edu. +18.7.15.93 #hum.mit.edu. +>net.mit.edu #MIT/Network Group cell +18.7.7.73 #gracie.mit.edu +18.7.21.95 #george.mit.edu +>sipb.mit.edu #MIT/SIPB cell +18.181.0.19 #reynelda.mit.edu. +18.181.0.22 #rosebud.mit.edu. +18.181.0.23 #ronald-ann.mit.edu. +>msu.edu #Michigan State University Main Cell +35.9.7.10 #afsdb0.cl.msu.edu +>nd.edu #University of Notre Dame +129.74.223.17 #john.helios.nd.edu +129.74.223.33 #lizardo.helios.nd.edu +129.74.223.65 #buckaroo.helios.nd.edu +>pitt.edu #University of Pittsburgh +136.142.8.15 #afs09.srv.cis.pitt.edu +136.142.8.20 #afs10.srv.cis.pitt.edu +136.142.8.21 #afs11.srv.cis.pitt.edu +>cs.pitt.edu #University of Pittsburgh - Computer Science +130.49.220.11 #afs01.cs.pitt.edu +130.49.220.12 #afs02.cs.pitt.edu +130.49.220.13 #afs03.cs.pitt.edu +>psc.edu #PSC (Pittsburgh Supercomputing Center) +128.182.59.182 #shaggy.psc.edu +128.182.66.184 #velma.psc.edu +128.182.66.185 #daphne.psc.edu +>scoobydoo.psc.edu #PSC Test Cell +128.182.59.181 #scooby.psc.edu +>cede.psu.edu #Penn State - Center for Engr. Design & Entrepeneurship +146.186.218.10 #greenly.cede.psu.edu +146.186.218.60 #b50.cede.psu.edu +146.186.218.246 #stalin.cede.psu.edu +>rose-hulman.edu #Rose-Hulman Institute of Technology +137.112.7.11 #afs1.rose-hulman.edu +137.112.7.12 #afs2.rose-hulman.edu +137.112.7.13 #afs3.rose-hulman.edu +>cs.rose-hulman.edu #Rose-Hulman CS Department +137.112.40.10 #galaxy.cs.rose-hulman.edu +>rpi.edu #Rensselaer Polytechnic Institute +128.113.22.11 #saul.server.rpi.edu +128.113.22.12 #joab.server.rpi.edu +128.113.22.13 #korah.server.rpi.edu +128.113.22.14 #achan.server.rpi.edu +>hep.sc.edu #University of South Carolina, Dept. of Physics +129.252.78.77 #cpeven.physics.sc.edu +>cs.stanford.edu #Stanford University Computer Science Department +171.64.64.10 #cs-afs-1.Stanford.EDU +171.64.64.66 #cs-afs-2.stanford.edu +171.64.64.69 #cs-afs-3.stanford.edu +>ir.stanford.edu #Stanford University +171.64.7.222 #afsdb1.stanford.edu +171.64.7.234 #afsdb2.stanford.edu +171.64.7.246 #afsdb3.stanford.edu +>slac.stanford.edu #Stanford Linear Accelerator Center +134.79.18.25 #afsdb1.slac.stanford.edu +134.79.18.26 #afsdb2.slac.stanford.edu +134.79.18.27 #afsdb3.slac.stanford.edu +>cats.ucsc.edu #UC Santa Cruz, Comm. and Tech. Services, California U.S.A +128.114.129.14 #elan.ucsc.edu +128.114.129.15 #ichabod.ucsc.edu +128.114.129.18 #maneki.ucsc.edu +>acm.uiuc.edu #ACM at the University of Illinois +128.174.251.8 #alnitak.acm.uiuc.edu +128.174.251.9 #alnilam.acm.uiuc.edu +128.174.251.10 #mintaka.acm.uiuc.edu +>ncsa.uiuc.edu #University of Illinois +141.142.3.5 #congo.ncsa.uiuc.edu +141.142.3.8 #nile.ncsa.uiuc.edu +141.142.230.19 #jinx.ncsa.uiuc.edu +>umbc.edu #University of Maryland, Baltimore County +130.85.24.23 #db2.afs.umbc.edu +130.85.24.87 #db3.afs.umbc.edu +130.85.24.101 #db1.afs.umbc.edu +>glue.umd.edu #University of Maryland - Project Glue +128.8.70.11 #olmec.umd.edu +128.8.73.3 #babylon.umd.edu +129.2.128.53 #egypt.umd.edu +>wam.umd.edu #University of Maryland Network WAM Project +128.8.70.9 #csc-srv.wam.umd.edu +128.8.73.9 #pg2-srv.wam.umd.edu +129.2.128.54 #avw-srv.wam.umd.edu +>umich.edu #University of Michigan - Campus +141.211.1.32 #fear.ifs.umich.edu +141.211.1.33 #surprise.ifs.umich.edu +141.211.1.34 #ruthless.ifs.umich.edu +>atlas.umich.edu #ATLAS group cell in physics at University of Michigan +141.211.43.102 #linat02.grid.umich.edu +141.211.43.106 #linat06.grid.umich.edu +141.211.43.109 #atgrid.grid.umich.edu +>citi.umich.edu #Center for Information Technology Integration +141.211.133.5 #babylon.citi.umich.edu +>lsa.umich.edu #University of Michigan - College of LS&A +141.211.54.132 #curtis.admin.lsa.umich.edu +141.211.61.23 #zee.admin.lsa.umich.edu +141.211.68.15 #marshall.lsa.umich.edu +>math.lsa.umich.edu #University of Michigan - Math Department +141.211.61.40 #ike.math.lsa.umich.edu +141.211.61.41 #clark.math.lsa.umich.edu +141.211.61.42 #nimitz.math.lsa.umich.edu +>umr.edu #University of Missouri - Rolla +131.151.1.59 #afsdb1.umr.edu +131.151.1.70 #afsdb3.umr.edu +131.151.1.146 #afsdb2.umr.edu +>physics.unc.edu #Univ. of NC at Chapel Hill, Dept. of Physics +152.2.5.2 #valerian.physics.unc.edu +152.2.5.3 #augustus.physics.unc.edu +152.2.7.67 #nerva.astro.unc.edu +>uncc.edu #University of NC at Charlotte Mosaic AFS Cell +152.15.10.70 #as-sm1.uncc.edu +152.15.13.7 #as-sm2.uncc.edu +152.15.30.27 #fs-kenn3.uncc.edu +>eng.utah.edu #University of Utah - Engineering +155.99.222.9 #lenny.eng.utah.edu +155.99.222.10 #carl.eng.utah.edu +>cs.uwm.edu #University of Wisconsin--Milwaukee +129.89.38.124 #solomons.cs.uwm.edu +>cs.wisc.edu #Univ. of Wisconsin-Madison, Computer Sciences Dept. +128.105.132.14 #timon.cs.wisc.edu +128.105.132.15 #pumbaa.cs.wisc.edu +128.105.132.16 #zazu.cs.wisc.edu +>engr.wisc.edu #University of Wisconsin-Madison, College of Engineering +144.92.13.14 #larry.cae.wisc.edu +144.92.13.15 #curly.cae.wisc.edu +144.92.13.16 #moe.cae.wisc.edu +>hep.wisc.edu #University of Wisconsin -- High Energy Physics +128.104.28.219 #anise.physics.wisc.edu +>physics.wisc.edu #Univ. of Wisconsin-Madison, Physics Department +128.104.220.51 #bubbles.physics.wisc.edu +128.104.220.52 #buttercup.physics.wisc.edu +128.104.220.53 #blossom.physics.wisc.edu +>ifca.unican.es #Instituto de Fisica de Cantabria (IFCA), Santander, Spain +193.144.209.20 #gridwall.ifca.unican.es +>ific.uv.es #Instituto de Fisica Corpuscular, Valencia, Spain +147.156.163.11 #alpha.ific.uv.es +>biocenter.helsinki.fi #University of Helsinki, Institute of Biotechnology +128.214.58.174 #afsdb1.biocenter.helsinki.fi +128.214.88.114 #afsdb2.biocenter.helsinki.fi +>dapnia.saclay.cea.fr #CEA DAPNIA +132.166.32.7 #dphrsg.saclay.cea.fr +132.166.32.12 #dphrsl.saclay.cea.fr +>in2p3.fr #IN2P3 production cell +134.158.232.11 #ccafsdb1.in2p3.fr +134.158.232.12 #ccafsdb2.in2p3.fr +134.158.232.13 #ccafsdb3.in2p3.fr +>anl.gov #Argonne National Laboratory +146.137.96.33 #arteus.ctd.anl.gov +146.137.162.88 #agamemnon.ctd.anl.gov +146.137.194.80 #antenor.ctd.anl.gov +>rhic.bnl.gov #Relativistic Heavy Ion Collider +130.199.6.51 #rafs03.rcf.bnl.gov +130.199.6.52 #rafs02.rcf.bnl.gov +130.199.6.69 #rafs01.rcf.bnl.gov +>usatlas.bnl.gov #US Atlas Tier 1 Facility at BNL +130.199.48.32 #aafs01.usatlas.bnl.gov +130.199.48.33 #aafs02.usatlas.bnl.gov +130.199.48.34 #aafs03.usatlas.bnl.gov +>fnal.gov #Fermi National Acclerator Laboratory +131.225.68.1 #fsus01.fnal.gov +131.225.68.4 #fsus03.fnal.gov +131.225.68.14 #fsus04.fnal.gov +>ic-afs.arc.nasa.gov #Code IC, Ames Research Center +128.102.105.62 #udanax.arc.nasa.gov +>nersc.gov #National Energy Research Supercomputer Center +128.55.128.250 #mars.nersc.gov +128.55.128.252 #alfred.nersc.gov +128.55.128.254 #lurch.nersc.gov +>caspur.it #CASPUR Inter-University Computing Consortium, Rome +193.204.5.45 #pomodoro.caspur.it +193.204.5.46 #banana.caspur.it +193.204.5.50 #maslo.caspur.it +>fusione.it #Assoz. FUSIONE/Euratom, ENEA, Frascati-Italy +192.107.90.2 #fusafs1.frascati.enea.it +192.107.90.3 #fusafs2.frascati.enea.it +192.107.90.4 #fusafs3.frascati.enea.it +>icemb.it #ICEMB, Universita' La Sapienza - Rome - Italy +193.204.6.130 #icembfs.caspur.it +>infn.it #Istituto Nazionale di Fisica Nucleare (INFN), Italia +131.154.1.7 #afs3.infn.it +141.108.3.252 #afs1.infn.it +192.84.134.75 #afs2.infn.it +>kloe.infn.it #INFN, KLOE experiment at Laboratori di Frascati +192.135.25.111 #kloeafs1.lnf.infn.it +192.135.25.112 #kloeafs2.lnf.infn.it +>le.infn.it #INFN, Sezione di Lecce +192.84.152.40 #afs01.le.infn.it +192.84.152.148 #afs02.le.infn.it +>lnf.infn.it #INFN, Laboratori Nazionali di Frascati +193.206.84.121 #afs1.lnf.infn.it +193.206.84.122 #afs2.lnf.infn.it +193.206.84.123 #afs3.lnf.infn.it +>lngs.infn.it #INFN, Laboratori Nazionali di Gran Sasso +192.84.135.21 #rsgs05.lngs.infn.it +>pi.infn.it #INFN, Sezione di Pisa +131.114.134.26 #unknownhost.pi.infn.it +192.84.133.50 #aix1.pi.infn.it +>psm.it #Progetto San Marco, Universita' di Roma-1 +151.100.1.65 #atlante.psm.uniroma1.it +>tgrid.it #CASPUR-CILEA-CINECA Grid Cell +193.204.5.33 #cccgrid.caspur.it +>ictp.trieste.it #The Abdus Salam International Centre for Theoretical Physics (IC +140.105.16.8 #fs1.ictp.trieste.it +140.105.16.9 #fs2.ictp.trieste.it +>ing.uniroma1.it #Universita' La Sapienza, Fac. Ingeneria +151.100.85.253 #alfa.ing.uniroma1.it +>vn.uniroma3.it #University of Rome 3, Area Vasca Navale +193.204.161.136 #alfa.dia.uniroma3.it +193.204.161.137 #beta.dia.uniroma3.it +193.204.161.138 #gamma.dia.uniroma3.it +>italia #Italian public AFS cell +193.204.5.9 #afs.caspur.it +>cmf.nrl.navy.mil #Naval Research Lab - CCS +134.207.10.68 #picard.cmf.nrl.navy.mil +134.207.10.69 #riker.cmf.nrl.navy.mil +134.207.10.70 #kirk.cmf.nrl.navy.mil +>lcp.nrl.navy.mil #Naval Research Lab - Lab for Computational Physics +132.250.114.2 #afs1.lcp.nrl.navy.mil +132.250.114.4 #afs2.lcp.nrl.navy.mil +132.250.114.6 #afs3.lcp.nrl.navy.mil +>es.net #Energy Sciences Net +198.128.3.21 #fs1.es.net +198.128.3.22 #fs2.es.net +198.128.3.23 #fs3.es.net +>laroia.net #Laroia Networks +66.66.102.254 #supercore.laroia.net +>sinenomine.net #Sine Nomine Associates +66.92.236.139 #afs.sinenomine.net +>slackers.net #The Slackers' Network +63.201.48.27 #alexandria.slackers.net +>nikhef.nl #The Dutch National Institute for High Energy Physics +192.16.185.26 #afs1.nikhef.nl +192.16.185.27 #afs2.nikhef.nl +>1ts.org #KCR/private Karl Ramm, Cambridge, MA +4.36.43.102 #dol-guldur.1ts.org +>bazquux.org #Baz Quux Organization +66.207.142.196 #baxquux.org +>coed.org #Adam Pennington's Cell +66.93.61.184 #vice1.coed.org +128.2.4.163 #vice3.coed.org +>dementia.org #Dementia Unlimited +128.2.12.45 #alycia.dementia.org +128.2.120.216 #meredith.dementia.org +>idahofuturetruck.org #University of Idaho hybrid vehicle development +12.18.238.210 #dsle210.fsr.net +>nimlabs.org #Nimlabs, Ink. Cell. +18.238.1.103 #olfin.nimlabs.org +18.238.1.105 #caerbanog.nimlabs.org +>nomh.org #nomh.org +204.29.154.12 #iota.nomh.org +>oc7.org #The OC7 Project +128.2.6.107 #vice3.oc7.org +128.2.122.140 #vice2.oc7.org +>openafs.org #OpenAFS Project +128.2.13.199 #new-virtue.openafs.org +128.2.121.218 #virtue.openafs.org +130.237.48.87 #andrew.e.kth.se +130.237.48.107 #onyx.e.kth.se +>e.kth.se #Royal Institute of Technology, Elektro +130.237.32.145 #sonen.e.kth.se +130.237.48.7 #anden.e.kth.se +130.237.48.244 #fadern.e.kth.se +>hallf.kth.se #Royal Institute of Technology, HALLF +130.237.24.141 #rasmus13.hallf.kth.se +130.237.24.152 #rasmus3.hallf.kth.se +130.237.24.177 #rasmus29.hallf.kth.se +>isk.kth.se #Royal Institute of Technology, ISK +130.237.202.12 #afsdb2.isk.kth.se +130.237.206.13 #afsdb1.isk.kth.se +130.237.209.141 #afsdb3.isk.kth.se +>it.kth.se #Royal Institute of Technology, IT +130.237.212.15 #ptah.it.kth.se +130.237.212.16 #toth.it.kth.se +130.237.215.7 #isis.it.kth.se +>md.kth.se #Royal Institute of Technology, MMK +130.237.57.68 #trinity.md.kth.se +130.237.57.72 #morpheus.md.kth.se +130.237.67.230 #neo.speech.kth.se +>mech.kth.se #Royal Institute of Technology, MECH +130.237.233.142 #matterhorn.mech.kth.se +130.237.233.143 #castor.mech.kth.se +130.237.233.144 #pollux.mech.kth.se +>nada.kth.se #Royal Institute of Technology, NADA +130.237.222.20 #kosmos.nada.kth.se +130.237.223.12 #sputnik.nada.kth.se +130.237.224.78 #mir.nada.kth.se +130.237.227.23 #gagarin.nada.kth.se +130.237.228.28 #laika.nada.kth.se +>pdc.kth.se #Royal Institute of Technology, PDC +130.237.232.29 #crab.pdc.kth.se +130.237.232.112 #anna.pdc.kth.se +130.237.232.114 #hokkigai.pdc.kth.se +>stacken.kth.se #Stacken Computer Club +130.237.234.3 #milko.stacken.kth.se +130.237.234.43 #hot.stacken.kth.se +130.237.237.230 #fishburger.stacken.kth.se +>syd.kth.se #Royal Institute of Technology, KTH-Syd +130.237.83.23 #afs.haninge.kth.se +>physto.se #Physics department Stockholm University +130.237.205.36 #sysafs1.physto.se +130.237.205.72 #sysafs2.physto.se +>sanchin.se #Sanchin Consulting AB, Sweden +192.195.148.10 #sesan.sanchin.se +>su.se #Stockholm University +130.237.162.81 #afsdb1.su.se +130.237.162.82 #afsdb2.su.se +>f9.ijs.si #F9, Jozef Stefan Institue +194.249.156.1 #brenta.ijs.si +>p-ng.si #Nova Gorica Polytechnic +193.2.120.2 #solkan.p-ng.si +>phy.bris.ac.uk #Bristol University - phyics +137.222.58.9 #afs1.phy.bris.ac.uk +>hep.man.ac.uk #Manchester HEP +194.36.2.3 #afs1.hep.man.ac.uk +194.36.2.4 #afs2.hep.man.ac.uk +194.36.2.5 #afs3.hep.man.ac.uk +>rl.ac.uk #Rutherford Appleton Lab, England +130.246.183.164 #wallace.cc.rl.ac.uk diff --git a/src/WINNT/install/NSIS/AFSCell.ini b/src/WINNT/install/NSIS/AFSCell.ini new file mode 100644 index 000000000..e410d6f0a --- /dev/null +++ b/src/WINNT/install/NSIS/AFSCell.ini @@ -0,0 +1,107 @@ +[Settings] +NumFields=13 + +[Field 1] +Type=label +Text=Enter AFS cell name: +Left=0 +Right=40 +Top=0 +Bottom=20 + +[Field 2] +Type=Text +State=openafs.org +Left=50 +Right=-1 +Top=0 +Bottom=13 + +[Field 3] +Type=Checkbox +State=1 +Left=50 +Right=60 +Top=55 +Bottom=65 + +[Field 4] +Type=label +Text=Enable AFS crypt security (Recommended) +Left=65 +Right=-1 +Top=55 +Bottom=65 + +[Field 5] +Type=Checkbox +State=1 +Left=50 +Right=60 +Top=65 +Bottom=75 + +[Field 6] +Type=label +Text=Enable AFS Freelance client (Recommended) +Left=65 +Right=-1 +Top=65 +Bottom=75 + +[Field 11] +Type=Checkbox +State=0 +Left=50 +Right=60 +Top=75 +Bottom=85 + +[Field 12] +Type=label +Text=Use DNS to Search for Cell Servers +Left=65 +Right=-1 +Top=75 +Bottom=85 + +[Field 7] +Type=Checkbox +State=0 +Left=50 +Right=60 +Top=85 +Bottom=95 + +[Field 8] +Type=label +Text=Use Integrated Logon +Left=65 +Right=-1 +Top=85 +Bottom=95 + +[Field 9] +Type=Checkbox +State=0 +Left=50 +Right=60 +Top=95 +Bottom=105 + +[Field 10] +Type=label +Text=Enable Integrated Logon high security +Left=65 +Right=-1 +Top=95 +Bottom=105 + +[Field 13] +Type=label +Text=You may now configure some installation options that control how the AFS Client behaves. +Left=35 +Right=-1 +Top=30 +Bottom=50 + diff --git a/src/WINNT/install/NSIS/CellServPage.ini b/src/WINNT/install/NSIS/CellServPage.ini new file mode 100644 index 000000000..3d0feef2b --- /dev/null +++ b/src/WINNT/install/NSIS/CellServPage.ini @@ -0,0 +1,59 @@ +[Settings] +NumFields=7 + +[Field 1] +Type=label +Text=The AFS Client requires a CellServDB file in order to contact AFS file servers. Where do you want to get the CellServDB File? +Left=0 +Right=-1 +Top=0 +Bottom=20 + +[Field 2] +Type=RadioButton +Text=Use existing CellServDB from a previous installation. +Left=10 +Right=-1 +Top=25 +Bottom=35 + +[Field 3] +Type=RadioButton +Text=Use packaged CellServDB file. +Left=10 +Right=-1 +Top=40 +Bottom=50 + +[Field 4] +type=RadioButton +Text=Download from web address: +State=0 +Left=10 +Right=-1 +Top=55 +Bottom=65 + +[Field 5] +type=Text +State=http://grand.central.org/dl/cellservdb/CellServDB +Left=20 +Right=-1 +Top=70 +Bottom=80 + +[Field 6] +type=radioButton +text=Select a file +Left=10 +Right=-1 +Top=85 +Bottom=95 + +[Field 7] +type=FileRequest +Flags=FILE_MUST_EXIST +Left=20 +Right=-40 +Top=100 +Bottom=110 diff --git a/src/WINNT/install/NSIS/MakeCommon.bat b/src/WINNT/install/NSIS/MakeCommon.bat new file mode 100644 index 000000000..6ac81ebbb --- /dev/null +++ b/src/WINNT/install/NSIS/MakeCommon.bat @@ -0,0 +1,12 @@ +@echo off +@rem Create common include file for NSIS installer + +del nsi-includes.nsi +echo !define AFS_DESTDIR %AFSROOT%\DEST\%AFSDEV_BUILDTYPE% > nsi-includes.nsi +echo !define MUI_VERSION %1 >> nsi-includes.nsi + +echo !define MUI_MAJORVERSION 1 >>nsi-includes.nsi +echo !define MUI_MINORVERSION 2 >>nsi-includes.nsi +echo !define MUI_PATCHLEVEL 1100 >>nsi-includes.nsi +if "%AFSDEV_CL%" == "1310" echo !define CL1310 1 >> nsi-includes.nsi +if "%AFSDEV_BUILDTYPE%" == "CHECKED" echo !define DEBUG 1 >>nsi-includes.nsi diff --git a/src/WINNT/install/NSIS/NTMakefile b/src/WINNT/install/NSIS/NTMakefile new file mode 100644 index 000000000..25f5308ed --- /dev/null +++ b/src/WINNT/install/NSIS/NTMakefile @@ -0,0 +1,91 @@ +RELDIR=WINNT\install\NSIS +!INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) +!INCLUDE ..\..\..\config\NTMakefile.version + +EXEDIR = $(DESTDIR)\WinInstall\Config +NSISDIR = C:\Program Files\NSIS + +# Revise the rule for compiling sources to use static libraries +C2OBJ = $(cc) /Fo$@ /Fd$*.pdb $(cflags) $(cdebug) $(cvars) $(afscflags) $(afscdefs) /c + +$(OUT)\Service.obj: Service.cpp + $(C2OBJ) Service.cpp + +$(EXEDIR)\Service.exe: $(OUT)\Service.obj + $(EXECONLINK) $(OUT)\Service.obj + +$(OUT)\Killer.obj: Killer.cpp + $(C2OBJ) Killer.cpp + +$(EXEDIR)\Killer.exe: $(OUT)\Killer.obj + $(EXECONLINK) $(OUT)\Killer.obj + +prebuild: +!IF ("$(AFSDEV_BUILDTYPE)" == "FREE") +!IF ("$(AFSVER_CL)"=="1310") + $(COPY) %SystemRoot%\System32\Msvcr71.dll $(EXEDIR) + $(COPY) %SystemRoot%\System32\MSVCRT.DLL $(EXEDIR) + $(COPY) %SystemRoot%\System32\MFC71.DLL $(EXEDIR) +!ELSE IF ("$(AFSVER_CL)"=="1300") + $(COPY) %SystemRoot%\System32\Msvcp70.dll $(EXEDIR) + $(COPY) %SystemRoot%\System32\MSVCRT.DLL $(EXEDIR) + $(COPY) %SystemRoot%\System32\MFC70.DLL $(EXEDIR) +!ELSE IF ("$(AFSVER_CL)"=="1200") + $(COPY) %SystemRoot%\System32\MSVCRT.DLL $(EXEDIR) + $(COPY) %SystemRoot%\System32\MFC42.DLL $(EXEDIR) +!ELSE +!ERROR Unknown Compiler Version +!ENDIF +!ELSE # NOT FREE - CHECKED +!IF ("$(AFSVER_CL)"=="1310") + $(COPY) %SystemRoot%\System32\Msvcr71d.dll $(EXEDIR) + $(COPY) %SystemRoot%\System32\Msvcr71d.pdb $(EXEDIR) + $(COPY) %SystemRoot%\System32\MFC71D.DLL $(EXEDIR) + $(COPY) %SystemRoot%\System32\MFC71D.pdb $(EXEDIR) +!ELSE IF ("$(AFSVER_CL)"=="1300") + $(COPY) %SystemRoot%\System32\Msvcp70d.dll $(EXEDIR) + $(COPY) %SystemRoot%\System32\Msvcp70d.pdb $(EXEDIR) + $(COPY) %SystemRoot%\System32\MSVCRTD.DLL $(EXEDIR) + $(COPY) %SystemRoot%\System32\MSVCRTD.pdb $(EXEDIR) + $(COPY) %SystemRoot%\System32\MFC70D.DLL $(EXEDIR) + $(COPY) %SystemRoot%\System32\MFC70D.pdb $(EXEDIR) +!ELSE IF ("$(AFSVER_CL)"=="1200") + $(COPY) %SystemRoot%\System32\MSVCRTD.DLL $(EXEDIR) + $(COPY) %SystemRoot%\System32\MSVCRTD.pdb $(EXEDIR) + $(COPY) %SystemRoot%\System32\MFC42D.DLL $(EXEDIR) + $(COPY) %SystemRoot%\System32\MFC42D.pdb $(EXEDIR) +!ELSE +!ERROR Unknown Compiler Version +!ENDIF +!ENDIF + $(DEL) $(OUT)\nsi-includes.nsi + echo !define AFS_DESTDIR $(DESTDIR) > $(OUT)\nsi-includes.nsi + echo !define AFS_VERSION $(AFSPRODUCT_VERSION) >> $(OUT)\nsi-includes.nsi + echo !define AFS_MAJORVERSION $(AFSPRODUCT_VER_MAJOR) >>$(OUT)\nsi-includes.nsi + echo !define AFS_MINORVERSION $(AFSPRODUCT_VER_MINOR) >>$(OUT)\nsi-includes.nsi + echo !define AFS_PATCHLEVEL $(AFSPRODUCT_VER_PATCH) >>$(OUT)\nsi-includes.nsi + $(DESTDIR)\bin\util_cr.exe _echo "!define " >>$(OUT)\nsi-includes.nsi + "$(NSISDIR)\makensis.exe" /VERSION >>$(OUT)\nsi-includes.nsi + echo. >>$(OUT)\nsi-includes.nsi +!if ("$(AFSVER_CL)" == "1310") + echo !define CL_1310 1 >> $(OUT)\nsi-includes.nsi +!else if ("$(AFSVER_CL)" == "1300") + echo !define CL_1300 1 >> $(OUT)\nsi-includes.nsi +!endif +!if ("$(AFSDEV_BUILDTYPE)" == "CHECKED") + echo !define DEBUG 1 >>$(OUT)\nsi-includes.nsi +!endif + +build: prebuild + "C:\Program Files\NSIS\makensis.exe" /DINCLUDEDIR=$(OUT) OpenAFS.nsi + +install: $(OUT)\Service.obj $(EXEDIR)\Service.exe $(OUT)\Killer.obj $(EXEDIR)\Killer.exe build + +#clean: +# $(DEL) $(OUT)\Service.obj +# $(DEL) $(EXEDIR)\Service.exe +# $(DEL) $(EXEDIR)\Msvcr71.dll +# $(DEL) $(EXEDIR)\MFC42.DLL +# $(DEL) OpenAFSforWindows.exe +# $(DEL) nsi-include.nsi + diff --git a/src/WINNT/install/NSIS/OpenAFS.nsi b/src/WINNT/install/NSIS/OpenAFS.nsi new file mode 100644 index 000000000..231a76476 --- /dev/null +++ b/src/WINNT/install/NSIS/OpenAFS.nsi @@ -0,0 +1,3592 @@ +;OpenAFS Install Script for NSIS +; +; Written by Rob Murawski +; +;Based on: +;NSIS Modern User Interface version 1.63 +;MultiLanguage Example Script +;Written by Joost Verburg + +; Read in the environment information +!include ${INCLUDEDIR}\nsi-includes.nsi +; Define DEBUG if building a DEBUG installer + +; This version compiles with NSIS v2.0 + +!ifndef RELEASE +!ifndef DEBUG +Name "OpenAFS ${AFS_VERSION} ${__DATE__} ${__TIME__}" +!else +Name "OpenAFS ${AFS_VERSION} ${__DATE__} ${__TIME__} Checked/Debug" +!endif ; End DEBUG/!DEBUG +!else +!ifndef DEBUG +Name "OpenAFS ${AFS_VERSION}" +!else ; DEBUG +Name "OpenAFS ${AFS_VERSION} Checked/Debug" +!endif ; End DEBUG/!DEBUG +!endif +VIProductVersion "${AFS_VERSION}.00" +VIAddVersionKey "ProductName" "OpenAFS" +VIAddVersionKey "CompanyName" "OpenAFS.org" +VIAddVersionKey "ProductVersion" ${AFS_VERSION} +VIAddVersionKey "FileVersion" ${AFS_VERSION} +VIAddVersionKey "FileDescription" "OpenAFS for Windows Installer" +VIAddVersionKey "LegalCopyright" "(C)2000-2004" +!ifdef DEBUG +VIAddVersionKey "PrivateBuild" "Checked/Debug" +!endif ; End DEBUG + + +!include "MUI.nsh" +!include Sections.nsh + +;-------------------------------- +;Configuration + +!define REPLACEDLL_NOREGISTER + + ;General +!ifndef DEBUG + OutFile "${AFS_DESTDIR}\WinInstall\OpenAFSforWindows.exe" +!else + OutFile "${AFS_DESTDIR}\WinInstall\OpenAFSforWindows-DEBUG.exe" +!endif + SilentInstall normal + SetCompressor lzma + !define MUI_ICON "..\..\client_config\afs_config.ico" + !define MUI_UNICON "..\..\client_config\afs_config.ico" + !define AFS_COMPANY_NAME "OpenAFS" + !define AFS_PRODUCT_NAME "OpenAFS" + !define AFS_REGKEY_ROOT "Software\TransarcCorporation" + CRCCheck force + + ;Folder selection page + InstallDir "$PROGRAMFILES\OpenAFS" ; Install to shorter path + + ;Remember install folder + InstallDirRegKey HKCU ${AFS_REGKEY_ROOT} "" + + ;Remember the installer language + !define MUI_LANGDLL_REGISTRY_ROOT "HKCU" + !define MUI_LANGDLL_REGISTRY_KEY ${AFS_REGKEY_ROOT} + !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" + + ;Where are the files? + !define AFS_CLIENT_BUILDDIR "${AFS_DESTDIR}\root.client\usr\vice\etc" + !define AFS_WININSTALL_DIR "${AFS_DESTDIR}\WinInstall\Config" + !define AFS_BUILD_INCDIR "${AFS_DESTDIR}\include" + !define AFS_CLIENT_LIBDIR "${AFS_DESTDIR}\lib" + !define AFS_SERVER_BUILDDIR "${AFS_DESTDIR}\root.server\usr\afs\bin" + !define AFS_ETC_BUILDDIR "${AFS_DESTDIR}\etc" + !define SYSTEMDIR "$%SystemRoot%\System32" + +;-------------------------------- +;Modern UI Configuration + + ;!define MUI_LICENSEPAGE + !define MUI_CUSTOMPAGECOMMANDS + !define MUI_WELCOMEPAGE + !define MUI_COMPONENTSPAGE + !define MUI_COMPONENTSPAGE_SMALLDESC + !define MUI_DIRECTORYPAGE + + !define MUI_ABORTWARNING + !define MUI_FINISHPAGE + + !define MUI_UNINSTALLER + !define MUI_UNCONFIRMPAGE + + + !insertmacro MUI_PAGE_WELCOME + !insertmacro MUI_PAGE_COMPONENTS + !insertmacro MUI_PAGE_DIRECTORY + Page custom AFSPageGetCellServDB + Page custom AFSPageGetCellName + !insertmacro MUI_PAGE_INSTFILES + !insertmacro MUI_PAGE_FINISH + + ;LicenseData "Licenses.rtf" +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" + ;!insertmacro MUI_LANGUAGE "French" + !insertmacro MUI_LANGUAGE "German" + !insertmacro MUI_LANGUAGE "Spanish" + !insertmacro MUI_LANGUAGE "SimpChinese" + !insertmacro MUI_LANGUAGE "TradChinese" + !insertmacro MUI_LANGUAGE "Japanese" + !insertmacro MUI_LANGUAGE "Korean" + ;!insertmacro MUI_LANGUAGE "Italian" + ;!insertmacro MUI_LANGUAGE "Dutch" + ;!insertmacro MUI_LANGUAGE "Danish" + ;!insertmacro MUI_LANGUAGE "Greek" + ;!insertmacro MUI_LANGUAGE "Russian" + !insertmacro MUI_LANGUAGE "PortugueseBR" + ;!insertmacro MUI_LANGUAGE "Polish" + ;!insertmacro MUI_LANGUAGE "Ukrainian" + ;!insertmacro MUI_LANGUAGE "Czech" + ;!insertmacro MUI_LANGUAGE "Slovak" + ;!insertmacro MUI_LANGUAGE "Croatian" + ;!insertmacro MUI_LANGUAGE "Bulgarian" + ;!insertmacro MUI_LANGUAGE "Hungarian" + ;!insertmacro MUI_LANGUAGE "Thai" + ;!insertmacro MUI_LANGUAGE "Romanian" + ;!insertmacro MUI_LANGUAGE "Macedonian" + ;!insertmacro MUI_LANGUAGE "Turkish" + +;-------------------------------- +;Language Strings + + ;Descriptions + LangString DESC_SecCopyUI ${LANG_ENGLISH} "OpenAFS for Windows: English" + ;LangString DESC_SecCopyUI ${LANG_FRENCH} "OpenAFS for Windows: French" + LangString DESC_SecCopyUI ${LANG_GERMAN} "OpenAFS for Windows: German" + LangString DESC_SecCopyUI ${LANG_SPANISH} "OpenAFS for Windows: Spanish" + LangString DESC_SecCopyUI ${LANG_SIMPCHINESE} "OpenAFS for Windows: Simplified Chinese" + LangString DESC_SecCopyUI ${LANG_TRADCHINESE} "OpenAFS for Windows: Traditional Chinese description" + LangString DESC_SecCopyUI ${LANG_JAPANESE} "OpenAFS for Windows: Japanese description" + LangString DESC_SecCopyUI ${LANG_KOREAN} "OpenAFS for Windows: Korean description" + ;LangString DESC_SecCopyUI ${LANG_ITALIAN} "OpenAFS for Windows: Italian description" + ;LangString DESC_SecCopyUI ${LANG_DUTCH} "OpenAFS for Windows: Dutch description" + ;LangString DESC_SecCopyUI ${LANG_DANISH} "OpenAFS for Windows: Danish description" + ;LangString DESC_SecCopyUI ${LANG_GREEK} "OpenAFS for Windows: Greek description" + ;LangString DESC_SecCopyUI ${LANG_RUSSIAN} "OpenAFS for Windows: Russian description" + LangString DESC_SecCopyUI ${LANG_PORTUGUESEBR} "OpenAFS for Windows: Portuguese (Brasil) description" + ;LangString DESC_SecCopyUI ${LANG_POLISH} "OpenAFS for Windows: Polish description" + ;LangString DESC_SecCopyUI ${LANG_UKRAINIAN} "OpenAFS for Windows: Ukrainian description" + ;LangString DESC_SecCopyUI ${LANG_CZECH} "OpenAFS for Windows: Czechian description" + ;LangString DESC_SecCopyUI ${LANG_SLOVAK} "OpenAFS for Windows: Slovakian description" + ;LangString DESC_SecCopyUI ${LANG_CROATIAN} "OpenAFS for Windows: Slovakian description" + ;LangString DESC_SecCopyUI ${LANG_BULGARIAN} "OpenAFS for Windows: Bulgarian description" + ;LangString DESC_SecCopyUI ${LANG_HUNGARIAN} "OpenAFS for Windows: Hungarian description" + ;LangString DESC_SecCopyUI ${LANG_THAI} "OpenAFS for Windows: Thai description" + ;LangString DESC_SecCopyUI ${LANG_ROMANIAN} "OpenAFS for Windows: Romanian description" + ;LangString DESC_SecCopyUI ${LANG_MACEDONIAN} "OpenAFS for Windows: Macedonian description" + ;LangString DESC_SecCopyUI ${LANG_TURKISH} "OpenAFS for Windows: Turkish description" + + LangString DESC_secClient ${LANG_ENGLISH} "OpenAFS Client: Allows you to access AFS from your Windows PC." + LangString DESC_secClient ${LANG_GERMAN} "OpenAFS Client: Allows you to access AFS from your Windows PC." + LangString DESC_secClient ${LANG_SPANISH} "OpenAFS Client: Allows you to access AFS from your Windows PC." + LangString DESC_secClient ${LANG_SIMPCHINESE} "OpenAFS Client: Allows you to access AFS from your Windows PC." + LangString DESC_secClient ${LANG_TRADCHINESE} "OpenAFS Client: Allows you to access AFS from your Windows PC." + LangString DESC_secClient ${LANG_JAPANESE} "OpenAFS Client: Allows you to access AFS from your Windows PC." + LangString DESC_secClient ${LANG_KOREAN} "OpenAFS Client: Allows you to access AFS from your Windows PC." + LangString DESC_secClient ${LANG_PORTUGUESEBR} "OpenAFS Client: Allows you to access AFS from your Windows PC." + + LangString DESC_secServer ${LANG_ENGLISH} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client." + LangString DESC_secServer ${LANG_GERMAN} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client." + LangString DESC_secServer ${LANG_SPANISH} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client." + LangString DESC_secServer ${LANG_SIMPCHINESE} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client." + LangString DESC_secServer ${LANG_TRADCHINESE} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client." + LangString DESC_secServer ${LANG_JAPANESE} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client." + LangString DESC_secServer ${LANG_KOREAN} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client." + LangString DESC_secServer ${LANG_PORTUGUESEBR} "OpenAFS Server: Allows you to run an AFS file server. This option requires the AFS Client." + + LangString DESC_secControl ${LANG_ENGLISH} "Control Center: GUI utilities for managing and configuring AFS servers. This option requires the AFS Client." + LangString DESC_secControl ${LANG_GERMAN} "Control Center: GUI utilities for managing and configuring AFS servers. This option requires the AFS Client." + LangString DESC_secControl ${LANG_SPANISH} "Control Center: GUI utilities for managing and configuring AFS servers. This option requires the AFS Client." + LangString DESC_secControl ${LANG_SIMPCHINESE} "Control Center: GUI utilities for managing and configuring AFS servers. This option requires the AFS Client." + LangString DESC_secControl ${LANG_TRADCHINESE} "Control Center: GUI utilities for managing and configuring AFS servers. This option requires the AFS Client." + LangString DESC_secControl ${LANG_JAPANESE} "Control Center: GUI utilities for managing and configuring AFS servers. This option requires the AFS Client." + LangString DESC_secControl ${LANG_KOREAN} "Control Center: GUI utilities for managing and configuring AFS servers. This option requires the AFS Client." + LangString DESC_secControl ${LANG_PORTUGUESEBR} "Control Center: GUI utilities for managing and configuring AFS servers. This option requires the AFS Client." + + LangString DESC_secDocs ${LANG_ENGLISH} "Supplemental Documentation: Additional documentation for using OpenAFS." + LangString DESC_secDocs ${LANG_GERMAN} "Supplemental Documentation: Additional documentation for using OpenAFS." + LangString DESC_secDocs ${LANG_SPANISH} "Supplemental Documentation: Additional documentation for using OpenAFS." + LangString DESC_secDocs ${LANG_SIMPCHINESE} "Supplemental Documentation: Additional documentation for using OpenAFS." + LangString DESC_secDocs ${LANG_TRADCHINESE} "Supplemental Documentation: Additional documentation for using OpenAFS." + LangString DESC_secDocs ${LANG_JAPANESE} "Supplemental Documentation: Additional documentation for using OpenAFS." + LangString DESC_secDocs ${LANG_KOREAN} "Supplemental Documentation: Additional documentation for using OpenAFS." + LangString DESC_secDocs ${LANG_PORTUGUESEBR} "Supplemental Documentation: Additional documentation for using OpenAFS." + + LangString DESC_secSDK ${LANG_ENGLISH} "SDK: Header files and libraries for developing software with OpenAFS." + LangString DESC_secSDK ${LANG_GERMAN} "SDK: Header files and libraries for developing software with OpenAFS." + LangString DESC_secSDK ${LANG_SPANISH} "SDK: Header files and libraries for developing software with OpenAFS." + LangString DESC_secSDK ${LANG_SIMPCHINESE} "SDK: Header files and libraries for developing software with OpenAFS." + LangString DESC_secSDK ${LANG_TRADCHINESE} "SDK: Header files and libraries for developing software with OpenAFS." + LangString DESC_secSDK ${LANG_JAPANESE} "SDK: Header files and libraries for developing software with OpenAFS." + LangString DESC_secSDK ${LANG_KOREAN} "SDK: Header files and libraries for developing software with OpenAFS." + LangString DESC_secSDK ${LANG_PORTUGUESEBR} "SDK: Header files and libraries for developing software with OpenAFS." + +; Popup error messages + LangString CellError ${LANG_ENGLISH} "You must specify a valid CellServDB file to copy during install" + LangString CellError ${LANG_GERMAN} "You must specify a valid CellServDB file to copy during the install" + LangString CellError ${LANG_SPANISH} "You must specify a valid CellServDB file to copy during the install" + LangString CellError ${LANG_SIMPCHINESE} "You must specify a valid CellServDB file to copy during the install" + LangString CellError ${LANG_TRADCHINESE} "You must specify a valid CellServDB file to copy during the install" + LangString CellError ${LANG_JAPANESE} "You must specify a valid CellServDB file to copy during the install" + LangString CellError ${LANG_KOREAN} "You must specify a valid CellServDB file to copy during the install" + LangString CellError ${LANG_PORTUGUESEBR} "You must specify a valid CellServDB file to copy during the install" + + LangString CellNameError ${LANG_ENGLISH} "You must specify a cell name for your client to use." + LangString CellNameError ${LANG_GERMAN} "You must specify a cell name for your client to use." + LangString CellNameError ${LANG_SPANISH} "You must specify a cell name for your client to use." + LangString CellNameError ${LANG_SIMPCHINESE} "You must specify a cell name for your client to use." + LangString CellNameError ${LANG_TRADCHINESE} "You must specify a cell name for your client to use." + LangString CellNameError ${LANG_JAPANESE} "You must specify a cell name for your client to use." + LangString CellNameError ${LANG_KOREAN} "You must specify a cell name for your client to use." + LangString CellNameError ${LANG_PORTUGUESEBR} "You must specify a cell name for your client to use." + + LangString URLError ${LANG_ENGLISH} "You must specify a URL if you choose the option to download the CellServDB." + LangString URLError ${LANG_GERMAN} "You must specify a URL if you choose the option to download the CellServDB." + LangString URLError ${LANG_SPANISH} "You must specify a URL if you choose the option to download the CellServDB." + LangString URLError ${LANG_SIMPCHINESE} "You must specify a URL if you choose the option to download the CellServDB." + LangString URLError ${LANG_TRADCHINESE} "You must specify a URL if you choose the option to download the CellServDB." + LangString URLError ${LANG_JAPANESE} "You must specify a URL if you choose the option to download the CellServDB." + LangString URLError ${LANG_KOREAN} "You must specify a URL if you choose the option to download the CellServDB." + LangString URLError ${LANG_PORTUGUESEBR} "You must specify a URL if you choose the option to download the CellServDB." + + +; Upgrade/re-install strings + LangString UPGRADE_CLIENT ${LANG_ENGLISH} "Upgrade AFS Client" + LangString UPGRADE_CLIENT ${LANG_GERMAN} "Upgrade AFS Client" + LangString UPGRADE_CLIENT ${LANG_SPANISH} "Upgrade AFS Client" + LangString UPGRADE_CLIENT ${LANG_SIMPCHINESE} "Upgrade AFS Client" + LangString UPGRADE_CLIENT ${LANG_TRADCHINESE} "Upgrade AFS Client" + LangString UPGRADE_CLIENT ${LANG_JAPANESE} "Upgrade AFS Client" + LangString UPGRADE_CLIENT ${LANG_KOREAN} "Upgrade AFS Client" + LangString UPGRADE_CLIENT ${LANG_PORTUGUESEBR} "Upgrade AFS Client" + + LangString REINSTALL_CLIENT ${LANG_ENGLISH} "Re-install AFS Client" + LangString REINSTALL_CLIENT ${LANG_GERMAN} "Re-install AFS Client" + LangString REINSTALL_CLIENT ${LANG_SPANISH} "Re-install AFS Client" + LangString REINSTALL_CLIENT ${LANG_SIMPCHINESE} "Re-install AFS Client" + LangString REINSTALL_CLIENT ${LANG_TRADCHINESE} "Re-install AFS Client" + LangString REINSTALL_CLIENT ${LANG_JAPANESE} "Re-install AFS Client" + LangString REINSTALL_CLIENT ${LANG_KOREAN} "Re-install AFS Client" + LangString REINSTALL_CLIENT ${LANG_PORTUGUESEBR} "Re-install AFS Client" + + LangString UPGRADE_SERVER ${LANG_ENGLISH} "Upgrade AFS Server" + LangString UPGRADE_SERVER ${LANG_GERMAN} "Upgrade AFS Server" + LangString UPGRADE_SERVER ${LANG_SPANISH} "Upgrade AFS Server" + LangString UPGRADE_SERVER ${LANG_SIMPCHINESE} "Upgrade AFS Server" + LangString UPGRADE_SERVER ${LANG_TRADCHINESE} "Upgrade AFS Server" + LangString UPGRADE_SERVER ${LANG_JAPANESE} "Upgrade AFS Server" + LangString UPGRADE_SERVER ${LANG_KOREAN} "Upgrade AFS Server" + LangString UPGRADE_SERVER ${LANG_PORTUGUESEBR} "Upgrade AFS Server" + + LangString REINSTALL_SERVER ${LANG_ENGLISH} "Re-install AFS Server" + LangString REINSTALL_SERVER ${LANG_GERMAN} "Re-install AFS Server" + LangString REINSTALL_SERVER ${LANG_SPANISH} "Re-install AFS Server" + LangString REINSTALL_SERVER ${LANG_SIMPCHINESE} "Re-install AFS Server" + LangString REINSTALL_SERVER ${LANG_TRADCHINESE} "Re-install AFS Server" + LangString REINSTALL_SERVER ${LANG_JAPANESE} "Re-install AFS Server" + LangString REINSTALL_SERVER ${LANG_KOREAN} "Re-install AFS Server" + LangString REINSTALL_SERVER ${LANG_PORTUGUESEBR} "Re-install AFS Server" + + ReserveFile "CellServPage.ini" + ReserveFile "AFSCell.ini" + !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in + !insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog +;-------------------------------- +; Macros +; Macro - Upgrade DLL File +; Written by Joost Verburg +; ------------------------ +; +; Parameters: +; LOCALFILE - Location of the new DLL file (on the compiler system) +; DESTFILE - Location of the DLL file that should be upgraded +; (on the user's system) +; TEMPBASEDIR - Directory on the user's system to store a temporary file +; when the system has to be rebooted. +; For Win9x support, this should be on the same volume as the +; DESTFILE! +; The Windows temp directory could be located on any volume, +; so you cannot use this directory. +; +; Define REPLACEDLL_NOREGISTER if you want to upgrade a DLL that does not +; have to be registered. +; +; Note: If you want to support Win9x, you can only use +; short filenames (8.3). +; +; Example of usage: +; !insertmacro ReplaceDLL "dllname.dll" "$SYSDIR\dllname.dll" "$SYSDIR" +; + +!macro ReplaceDLL LOCALFILE DESTFILE TEMPBASEDIR + + Push $R0 + Push $R1 + Push $R2 + Push $R3 + Push $R4 + Push $R5 + + ;------------------------ + ;Unique number for labels + + !define REPLACEDLL_UNIQUE ${__LINE__} + + ;------------------------ + ;Copy the parameters used on run-time to a variable + ;This allows the usage of variables as paramter + + StrCpy $R4 "${DESTFILE}" + StrCpy $R5 "${TEMPBASEDIR}" + + ;------------------------ + ;Check file and version + ; + IfFileExists $R4 0 replacedll.copy_${REPLACEDLL_UNIQUE} + + ;ClearErrors + ; GetDLLVersionLocal "${LOCALFILE}" $R0 $R1 + ; GetDLLVersion $R4 $R2 $R3 + ;IfErrors replacedll.upgrade_${REPLACEDLL_UNIQUE} + ; + ;IntCmpU $R0 $R2 0 replacedll.done_${REPLACEDLL_UNIQUE} \ + ; replacedll.upgrade_${REPLACEDLL_UNIQUE} + ;IntCmpU $R1 $R3 replacedll.done_${REPLACEDLL_UNIQUE} \ + ; replacedll.done_${REPLACEDLL_UNIQUE} \ + ; replacedll.upgrade_${REPLACEDLL_UNIQUE} + + ;------------------------ + ;Let's replace the DLL! + + SetOverwrite try + + ;replacedll.upgrade_${REPLACEDLL_UNIQUE}: + !ifndef REPLACEDLL_NOREGISTER + ;Unregister the DLL + UnRegDLL $R4 + !endif + + ;------------------------ + ;Try to copy the DLL directly + + ClearErrors + StrCpy $R0 $R4 + Call :replacedll.file_${REPLACEDLL_UNIQUE} + IfErrors 0 replacedll.noreboot_${REPLACEDLL_UNIQUE} + + ;------------------------ + ;DLL is in use. Copy it to a temp file and Rename it on reboot. + + GetTempFileName $R0 $R5 + Call :replacedll.file_${REPLACEDLL_UNIQUE} + Rename /REBOOTOK $R0 $R4 + + ;------------------------ + ;Register the DLL on reboot + + !ifndef REPLACEDLL_NOREGISTER + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \ + "Register $R4" 'rundll32.exe "$R4",DllRegisterServer' + !endif + + Goto replacedll.done_${REPLACEDLL_UNIQUE} + + ;------------------------ + ;DLL does not exist - just extract + + replacedll.copy_${REPLACEDLL_UNIQUE}: + StrCpy $R0 $R4 + Call :replacedll.file_${REPLACEDLL_UNIQUE} + + ;------------------------ + ;Register the DLL + + replacedll.noreboot_${REPLACEDLL_UNIQUE}: + !ifndef REPLACEDLL_NOREGISTER + RegDLL $R4 + !endif + + ;------------------------ + ;Done + + replacedll.done_${REPLACEDLL_UNIQUE}: + + Pop $R5 + Pop $R4 + Pop $R3 + Pop $R2 + Pop $R1 + Pop $R0 + + ;------------------------ + ;End + + Goto replacedll.end_${REPLACEDLL_UNIQUE} + + ;------------------------ + ;Called to extract the DLL + + replacedll.file_${REPLACEDLL_UNIQUE}: + File /oname=$R0 "${LOCALFILE}" + Return + + replacedll.end_${REPLACEDLL_UNIQUE}: + + ;------------------------ + ;Restore settings + + SetOverwrite lastused + + !undef REPLACEDLL_UNIQUE + +!macroend + + +;-------------------------------- +;Reserve Files + + ;Things that need to be extracted on first (keep these lines before any File command!) + ;Only useful for BZIP2 compression + !insertmacro MUI_RESERVEFILE_LANGDLL + +;-------------------------------- +; User Variables + +var REG_SUB_KEY +var REG_VALUE +var REG_DATA_1 +var REG_DATA_2 +var REG_DATA_3 + + +;-------------------------------- +;Installer Sections + +;---------------------- +; OpenAFS CLIENT +Section "AFS Client" secClient + + SetShellVarContext all + + ; Check for bad previous installation (if we are doing a new install) + Call IsAnyAFSInstalled + Pop $R0 + StrCmp $R0 "0" +1 skipCheck + Call CheckPathForAFS + skipCheck: + + ; Stop any running services or we can't replace the files + ; Stop the running processes + GetTempFileName $R0 + File /oname=$R0 "${AFS_WININSTALL_DIR}\Killer.exe" ; Might not have the MSVCR71.DLL file to run + nsExec::Exec '$R0 afsd_service.exe' + nsExec::Exec '$R0 afscreds.exe' + Exec "afscreds.exe -z" + ; in case we are upgrading an old version that does not support -z + nsExec::Exec '$R0 afscreds.exe' +!IFDEF INSTALL_KFW + ;nsExec::Exec '$R0 krbcc32s.exe' +!ENDIF + + nsExec::Exec "net stop TransarcAFSDaemon" + nsExec::Exec "net stop TransarcAFSServer" + + ; Do client components + SetOutPath "$INSTDIR\Client\Program" + File "${AFS_CLIENT_BUILDDIR}\afsshare.exe" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\libosi.dll" "$INSTDIR\Client\Program\libosi.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\libafsconf.dll" "$INSTDIR\Client\Program\libafsconf.dll" "$INSTDIR" + File "${AFS_CLIENT_BUILDDIR}\klog.exe" + File "${AFS_CLIENT_BUILDDIR}\tokens.exe" + File "${AFS_CLIENT_BUILDDIR}\unlog.exe" + File "${AFS_CLIENT_BUILDDIR}\fs.exe" + File "${AFS_CLIENT_BUILDDIR}\aklog.exe" + File "${AFS_CLIENT_BUILDDIR}\afscreds.exe" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext.dll" "$INSTDIR\Client\Program\afs_shl_ext.dll" "$INSTDIR" + File "${AFS_CLIENT_BUILDDIR}\afsd_service.exe" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afslogon.dll" "$INSTDIR\Client\Program\afslogon.dll" "$INSTDIR" + File "${AFS_CLIENT_BUILDDIR}\symlink.exe" + File "${AFS_DESTDIR}\bin\kpasswd.exe" + File "${AFS_SERVER_BUILDDIR}\pts.exe" + File "${AFS_SERVER_BUILDDIR}\bos.exe" + File "${AFS_SERVER_BUILDDIR}\kas.exe" + File "${AFS_SERVER_BUILDDIR}\vos.exe" + File "${AFS_SERVER_BUILDDIR}\udebug.exe" + File "${AFS_DESTDIR}\bin\translate_et.exe" + File "${AFS_DESTDIR}\etc\rxdebug.exe" + File "${AFS_DESTDIR}\etc\backup.exe" + +!ifdef DEBUG + File "${AFS_CLIENT_BUILDDIR}\afsshare.pdb" + File "${AFS_CLIENT_BUILDDIR}\libosi.pdb" + File "${AFS_CLIENT_BUILDDIR}\libafsconf.pdb" + File "${AFS_CLIENT_BUILDDIR}\klog.pdb" + File "${AFS_CLIENT_BUILDDIR}\tokens.pdb" + File "${AFS_CLIENT_BUILDDIR}\unlog.pdb" + File "${AFS_CLIENT_BUILDDIR}\fs.pdb" + File "${AFS_CLIENT_BUILDDIR}\aklog.pdb" + File "${AFS_CLIENT_BUILDDIR}\afscreds.pdb" + File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext.pdb" + File "${AFS_CLIENT_BUILDDIR}\afsd_service.pdb" + File "${AFS_CLIENT_BUILDDIR}\afslogon.pdb" + File "${AFS_CLIENT_BUILDDIR}\symlink.pdb" + File "${AFS_DESTDIR}\bin\kpasswd.pdb" + File "${AFS_DESTDIR}\bin\pts.pdb" + File "${AFS_SERVER_BUILDDIR}\bos.pdb" + File "${AFS_SERVER_BUILDDIR}\kas.pdb" + File "${AFS_SERVER_BUILDDIR}\vos.pdb" + File "${AFS_SERVER_BUILDDIR}\udebug.pdb" + File "${AFS_DESTDIR}\bin\translate_et.pdb" + File "${AFS_DESTDIR}\etc\rxdebug.pdb" + File "${AFS_DESTDIR}\etc\backup.pdb" +!endif + + + Call AFSLangFiles + + + + ; Do WINDOWSDIR components + + ; Do Windows SYSDIR (Control panel) + SetOutPath "$SYSDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa.cpl" "$SYSDIR\afs_cpa.cpl" "$INSTDIR" +!ifdef DEBUG + File "${AFS_CLIENT_BUILDDIR}\afs_cpa.pdb" +!endif + + ; Get AFS CellServDB file + Call afs.GetCellServDB +!ifdef INSTALL_LOOPBACK + Call afs.InstallMSLoopback +!endif + +!ifdef INSTALL_KFW + ; Include Kerberos for Windows files in the installer... + SetOutPath "$INSTDIR\kfw\bin\" + File "${KFW_SOURCE}\bin\*" + SetOutPath "$INSTDIR\kfw\doc" + File "${KFW_SOURCE}\doc\*" +!endif + + ;Store install folder + WriteRegStr HKCU "${AFS_REGKEY_ROOT}\Client" "" $INSTDIR + Call AFSCommon.Install + + ; Write registry entries + WriteRegStr HKCR "*\shellex\ContextMenuHandlers\AFS Client Shell Extension" "" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" + WriteRegStr HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" "" "AFS Client Shell Extension" + WriteRegStr HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32" "" "$INSTDIR\Client\Program\afs_shl_ext.dll" + WriteRegStr HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32" "ThreadingModel" "Apartment" + WriteRegStr HKCR "FOLDER\shellex\ContextMenuHandlers\AFS Client Shell Extension" "" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" "AFS Client Shell Extension" + + ; AFS Reg entries + DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "VersionString" ${AFS_VERSION} + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Title" "AFS Client" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Description" "AFS Client" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PathName" "$INSTDIR\Client" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Software Type" "File System" + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL} + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "VersionString" ${AFS_VERSION} + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Title" "AFS Client" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Description" "AFS Client" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Software Type" "File System" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "PathName" "$INSTDIR\Client\Program" + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL} +!ifdef DEBUG + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Debug" 1 + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Debug" 1 +!else + ; Delete the DEBUG string + DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "Debug" + DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Client\${AFS_VERSION}" "Debug" +!endif + + ; On Windows 2000 work around KB301673. This is fixed in Windows XP and 2003 + Call GetWindowsVersion + Pop $R1 + StrCmp $R1 "2000" +1 +2 + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\NetBT\Parameters" "SmbDeviceEnabled" 0 + + ;Write start menu entries + CreateDirectory "$SMPROGRAMS\OpenAFS\Client" + CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe" + CreateShortCut "$SMPROGRAMS\OpenAFS\Client\Authentication.lnk" "$INSTDIR\Client\Program\afscreds.exe" "-A -M -N -Q" + CreateShortCut "$SMSTARTUP\AFS Credentials.lnk" "$INSTDIR\Client\Program\afscreds.exe" "-A -M -N -Q" + + Push "$INSTDIR\Client\Program" + Call AddToUniquePath + Push "$INSTDIR\Common" + Call AddToUniquePath + +!ifdef INSTALL_KFW + ; Add kfw to path too + Push "$INSTDIR\kfw\bin" + Call AddToUniquePath +!endif + + ; Create the AFS service + SetOutPath "$INSTDIR\Common" + File "${AFS_WININSTALL_DIR}\Service.exe" + nsExec::Exec "net stop TransarcAFSDaemon" + ;IMPORTANT! If we are not refreshing the config files, do NOT remove the service + ;Don't re-install because it must be present or we wouldn't have passed the Reg check + + ReadRegStr $R2 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "Cell" + StrCmp $R2 "" +1 skipremove + nsExec::Exec '$INSTDIR\Common\Service.exe u TransarcAFSDaemon' + nsExec::Exec '$INSTDIR\Common\Service.exe TransarcAFSDaemon "$INSTDIR\Client\Program\afsd_service.exe" "OpenAFS Client Service"' +skipremove: + Delete "$INSTDIR\Common\service.exe" + + ; Daemon entries + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" "" "" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "ProviderPath" "$INSTDIR\Client\Program\afslogon.dll" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "AuthentProviderPath" "$INSTDIR\Client\Program\afslogon.dll" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "AuthentProviderPath" "$INSTDIR\Client\Program\afslogon.dll" + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "Class" 2 + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "VerboseLogging" 10 + + ; Must also add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\HwOrder + ; and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order + ; to also include the service name. + Call AddProvider + ReadINIStr $R0 $1 "Field 7" "State" + ReadINIStr $R1 $1 "Field 9" "State" + ; Complicated way to do $R1 = ($R1 *2) + $R0 + IntOp $R2 $R1 * 2 + IntOp $R1 $R2 + $R0 + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "LogonOptions" $R1 + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "LogonScript" "$INSTDIR\Client\Program\afscreds.exe -:%s -x -a -m -n -q" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider" "Name" "OpenAFSDaemon" + + ;Write cell name + ReadINIStr $R0 $1 "Field 2" "State" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "Cell" $R0 + ReadINIStr $R0 $1 "Field 3" "State" + WriteRegDWORD HKLM "SOFTWARE\OpenAFS\Client" "ShowTrayIcon" 1 + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "SecurityLevel" $R0 + ReadINIStr $R0 $1 "Field 5" "State" + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "FreelanceClient" $R0 + ReadINIStr $R0 $1 "Field 11" "State" + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "UseDNS" $R0 + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "NetbiosName" "AFS" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "MountRoot" "/afs" + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "RxMaxMTU" 1260 + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "IsGateway" 0 + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "HideDotFiles" 1 + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "TruncateNetbios" "on" + + ; Find Lana By Name appears to be causing grief for many people + ; I do not have time to track this down so I am simply going to disable it + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "NoFindLanaByName" 1 + + strcpy $REG_SUB_KEY "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" + strcpy $REG_VALUE "DependOnGroup" + strcpy $REG_DATA_1 "PNP_TDI" + strcpy $REG_DATA_2 "" + strcpy $REG_DATA_3 "" + Call RegWriteMultiStr + strcpy $REG_SUB_KEY "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" + strcpy $REG_VALUE "DependOnService" + strcpy $REG_DATA_1 "Tcpip" + strcpy $REG_DATA_2 "NETBIOS" + strcpy $REG_DATA_3 "RpcSs" + Call RegWriteMultiStr + + SetRebootFlag true + + WriteUninstaller "$INSTDIR\Uninstall.exe" + +SectionEnd + +;------------------------ +; OpenAFS SERVER +Section "AFS Server" secServer + + SetShellVarContext all + + ; Check for bad previous installation (if we are doing a new install) + Call IsAnyAFSInstalled + Pop $R0 + StrCmp $R0 "0" +1 skipCheck + Call CheckPathForAFS +skipCheck: + + ; Stop any running services or we can't replace the files + ; Stop the running processes + GetTempFileName $R0 + File /oname=$R0 "${AFS_WININSTALL_DIR}\Killer.exe" + nsExec::Exec '$R0 afscreds.exe' + Exec "afscreds.exe -z" + ; in case we are upgrading an old version that does not support -z + Sleep 2000 + nsExec::Exec '$R0 afscreds.exe' +!IFDEF INSTALL_KFW + ;nsExec::Exec '$R0 krbcc32s.exe' +!ENDIF + + Delete $R0 + + nsExec::Exec "net stop TransarcAFSDaemon" + nsExec::Exec "net stop TransarcAFSServer" + + CreateDirectory "$INSTDIR\Server\usr\afs\etc" + CreateDirectory "$INSTDIR\Server\usr\afs\local" + CreateDirectory "$INSTDIR\Server\usr\afs\etc\logs" + + SetOutPath "$INSTDIR\Server\usr\afs\bin" + File "${AFS_SERVER_BUILDDIR}\afskill.exe" + File "${AFS_SERVER_BUILDDIR}\afssvrcfg.exe" + File "${AFS_SERVER_BUILDDIR}\bosctlsvc.exe" + File "${AFS_SERVER_BUILDDIR}\bosserver.exe" + File "${AFS_SERVER_BUILDDIR}\buserver.exe" + File "${AFS_ETC_BUILDDIR}\butc.exe" + File "${AFS_SERVER_BUILDDIR}\fileserver.exe" + File "${AFS_ETC_BUILDDIR}\fms.exe" + File "${AFS_SERVER_BUILDDIR}\kaserver.exe" + File "${AFS_SERVER_BUILDDIR}\ptserver.exe" + File "${AFS_SERVER_BUILDDIR}\salvager.exe" + File "${AFS_SERVER_BUILDDIR}\upclient.exe" + File "${AFS_SERVER_BUILDDIR}\upserver.exe" + File "${AFS_SERVER_BUILDDIR}\vlserver.exe" + File "${AFS_SERVER_BUILDDIR}\volinfo.exe" + File "${AFS_SERVER_BUILDDIR}\volserver.exe" + +!ifdef DEBUG + File "${AFS_SERVER_BUILDDIR}\afskill.pdb" + File "${AFS_SERVER_BUILDDIR}\afssvrcfg.pdb" + File "${AFS_SERVER_BUILDDIR}\bosctlsvc.pdb" + File "${AFS_SERVER_BUILDDIR}\bosserver.pdb" + File "${AFS_SERVER_BUILDDIR}\buserver.pdb" + File "${AFS_ETC_BUILDDIR}\butc.pdb" + File "${AFS_SERVER_BUILDDIR}\fileserver.pdb" + File "${AFS_ETC_BUILDDIR}\fms.pdb" + File "${AFS_SERVER_BUILDDIR}\kaserver.pdb" + File "${AFS_SERVER_BUILDDIR}\ptserver.pdb" + File "${AFS_SERVER_BUILDDIR}\salvager.pdb" + File "${AFS_SERVER_BUILDDIR}\upclient.pdb" + File "${AFS_SERVER_BUILDDIR}\upserver.pdb" + File "${AFS_SERVER_BUILDDIR}\vlserver.pdb" + File "${AFS_SERVER_BUILDDIR}\volinfo.pdb" + File "${AFS_SERVER_BUILDDIR}\volserver.pdb" +!endif + + ;AFS Server common files + SetOutPath "$INSTDIR\Common" + File "${AFS_SERVER_BUILDDIR}\afsvosadmin.dll" + File "${AFS_SERVER_BUILDDIR}\afsbosadmin.dll" + File "${AFS_SERVER_BUILDDIR}\afscfgadmin.dll" + File "${AFS_SERVER_BUILDDIR}\afskasadmin.dll" + File "${AFS_SERVER_BUILDDIR}\afsptsadmin.dll" + +!ifdef DEBUG + File "${AFS_SERVER_BUILDDIR}\afsvosadmin.pdb" + File "${AFS_SERVER_BUILDDIR}\afsbosadmin.pdb" + File "${AFS_SERVER_BUILDDIR}\afscfgadmin.pdb" + File "${AFS_SERVER_BUILDDIR}\afskasadmin.pdb" + File "${AFS_SERVER_BUILDDIR}\afsptsadmin.pdb" +!endif + SetOutPath "$INSTDIR\Common" + Call AFSLangFiles + + SetOutPath "$SYSDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver.cpl" "$SYSDIR\afsserver.cpl" "$INSTDIR" + +!ifdef DEBUG + File "${AFS_SERVER_BUILDDIR}\afsserver.pdb" +!endif + + ;Store install folder + WriteRegStr HKCU "${AFS_REGKEY_ROOT}\AFS Server" "" $INSTDIR + + DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "VersionString" ${AFS_VERSION} + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Title" "AFS Server" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Description" "AFS Server for Windows" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "PathName" "$INSTDIR\Server" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Software Type" "File System" + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL} + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "VersionString" ${AFS_VERSION} + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Title" "AFS Server" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Description" "AFS Server for Windows" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Software Type" "File System" + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "PathName" "$INSTDIR\Server" + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL} +!ifdef DEBUG + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Debug" 1 + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Debug" 1 +!else + ; Delete the DEBUG string + DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "Debug" + DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Server\${AFS_VERSION}" "Debug" +!endif + ; Install the service + SetOutPath "$INSTDIR\Common" + File "${AFS_WININSTALL_DIR}\Service.exe" +!ifdef DEBUG + File "${AFS_WININSTALL_DIR}\Service.pdb" +!endif + + ; Check if the service exists--if it does, this is an upgrade/re-install + ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSServer" "ImagePath" + StrCmp $R0 "$INSTDIR\Server\usr\afs\bin\bosctlsvc.exe" SkipStartup + + ; If an uninstall was done, but we kept the config files, also skip + IfFileExists "$INSTDIR\Server\usr\afs\etc\ThisCell" SkipStartup + + ; Make the server config wizard auto-start on bootup if this is an install (not an upgrade) + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "AFS Server Wizard" '"$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe" /wizard"' + + +SkipStartup: + ;Don't want to whack existing settings... Make users un-install and then re-install if they want that + ;nsExec::Exec '$INSTDIR\Common\service.exe u TransarcAFSServer' + nsExec::Exec '$INSTDIR\Common\service.exe TransarcAFSServer "$INSTDIR\Server\usr\afs\bin\bosctlsvc.exe" "OpenAFS AFS Server"' + Delete "$INSTDIR\Common\service.exe" + + CreateDirectory "$SMPROGRAMS\OpenAFS\Server" + CreateShortCut "$SMPROGRAMS\OpenAFS\Server\Server Configuration.lnk" "$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe" + + + WriteUninstaller "$INSTDIR\Uninstall.exe" + +SectionEnd + + +;---------------------------- +; OpenAFS Control Center +Section "AFS Control Center" secControl + + SetShellVarContext all + + SetOutPath "$INSTDIR\Control Center" + File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager.exe" + File "${AFS_SERVER_BUILDDIR}\TaAfsAdmSvr.exe" + File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager.exe" + +!ifdef DEBUG + File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager.pdb" + File "${AFS_SERVER_BUILDDIR}\TaAfsAdmSvr.pdb" + File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager.pdb" +!endif + + ;AFS Server common files + Call AFSCommon.Install + Call AFSLangFiles + SetOutPath "$INSTDIR\Common" + + SetOutPath "$INSTDIR\Common" +!IFDEF DEBUG +!IFDEF CL_1310 + File "${SYSTEMDIR}\msvcr71d.dll" + File "${SYSTEMDIR}\msvcr71d.pdb" + File "${SYSTEMDIR}\msvcp71d.dll" + File "${SYSTEMDIR}\msvcp71d.pdb" + File "${SYSTEMDIR}\mfc71d.dll" + File "${SYSTEMDIR}\mfc71d.pdb" + File "${SYSTEMDIR}\MFC71CHS.DLL" + File "${SYSTEMDIR}\MFC71CHT.DLL" + File "${SYSTEMDIR}\MFC71DEU.DLL" + File "${SYSTEMDIR}\MFC71ENU.DLL" + File "${SYSTEMDIR}\MFC71ESP.DLL" + File "${SYSTEMDIR}\MFC71FRA.DLL" + File "${SYSTEMDIR}\MFC71ITA.DLL" + File "${SYSTEMDIR}\MFC71JPN.DLL" + File "${SYSTEMDIR}\MFC71KOR.DLL" +!ELSE +!IFDEF CL_1300 + File "${SYSTEMDIR}\msvcr70d.dll" + File "${SYSTEMDIR}\msvcr70d.pdb" + File "${SYSTEMDIR}\msvcp70d.dll" + File "${SYSTEMDIR}\msvcp70d.pdb" + File "${SYSTEMDIR}\mfc70d.dll" + File "${SYSTEMDIR}\mfc70d.pdb" + File "${SYSTEMDIR}\MFC70CHS.DLL" + File "${SYSTEMDIR}\MFC70CHT.DLL" + File "${SYSTEMDIR}\MFC70DEU.DLL" + File "${SYSTEMDIR}\MFC70ENU.DLL" + File "${SYSTEMDIR}\MFC70ESP.DLL" + File "${SYSTEMDIR}\MFC70FRA.DLL" + File "${SYSTEMDIR}\MFC70ITA.DLL" + File "${SYSTEMDIR}\MFC70JPN.DLL" + File "${SYSTEMDIR}\MFC70KOR.DLL" +!ELSE + File "${SYSTEMDIR}\mfc42d.dll" + File "${SYSTEMDIR}\mfc42d.pdb" + File "${SYSTEMDIR}\msvcp60d.dll" + File "${SYSTEMDIR}\msvcp60d.pdb" + File "${SYSTEMDIR}\msvcrtd.dll" + File "${SYSTEMDIR}\msvcrtd.pdb" +!ENDIF +!ENDIF +!ELSE +!IFDEF CL_1310 + File "${SYSTEMDIR}\mfc71.dll" + File "${SYSTEMDIR}\msvcr71.dll" + File "${SYSTEMDIR}\msvcp71.dll" + File "${SYSTEMDIR}\MFC71CHS.DLL" + File "${SYSTEMDIR}\MFC71CHT.DLL" + File "${SYSTEMDIR}\MFC71DEU.DLL" + File "${SYSTEMDIR}\MFC71ENU.DLL" + File "${SYSTEMDIR}\MFC71ESP.DLL" + File "${SYSTEMDIR}\MFC71FRA.DLL" + File "${SYSTEMDIR}\MFC71ITA.DLL" + File "${SYSTEMDIR}\MFC71JPN.DLL" + File "${SYSTEMDIR}\MFC71KOR.DLL" +!ELSE +!IFDEF CL_1300 + File "${SYSTEMDIR}\mfc70.dll" + File "${SYSTEMDIR}\msvcr70.dll" + File "${SYSTEMDIR}\msvcp70.dll" + File "${SYSTEMDIR}\MFC70CHS.DLL" + File "${SYSTEMDIR}\MFC70CHT.DLL" + File "${SYSTEMDIR}\MFC70DEU.DLL" + File "${SYSTEMDIR}\MFC70ENU.DLL" + File "${SYSTEMDIR}\MFC70ESP.DLL" + File "${SYSTEMDIR}\MFC70FRA.DLL" + File "${SYSTEMDIR}\MFC70ITA.DLL" + File "${SYSTEMDIR}\MFC70JPN.DLL" + File "${SYSTEMDIR}\MFC70KOR.DLL" +!ELSE + File "${SYSTEMDIR}\mfc42.dll" + File "${SYSTEMDIR}\msvcp60.dll" + File "${SYSTEMDIR}\msvcrt.dll" +!ENDIF +!ENDIF +!ENDIF + ;Store install folder + WriteRegStr HKCU "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "PathName" $INSTDIR + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "VersionString" ${AFS_VERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL} + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "VersionString" ${AFS_VERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL} +!ifdef DEBUG + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "Debug" 1 + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "Debug" 1 +!else + ; Delete the DEBUG string + DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "Debug" + DeleteRegValue HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\${AFS_VERSION}" "Debug" +!endif + + ;Write start menu entries + CreateDirectory "$SMPROGRAMS\OpenAFS\Control Center" + CreateShortCut "$SMPROGRAMS\OpenAFS\Control Center\Account Manager.lnk" "$INSTDIR\Control Center\TaAfsAccountManager.exe" + CreateShortCut "$SMPROGRAMS\OpenAFS\Control Center\Server Manager.lnk" "$INSTDIR\Control Center\TaAfsServerManager.exe" + + WriteUninstaller "$INSTDIR\Uninstall.exe" + +SectionEnd + + +;---------------------------- +; OpenAFS Supplemental Documentation +Section "Supplemental Documentation" secDocs + SetShellVarContext all + + StrCmp $LANGUAGE ${LANG_ENGLISH} DoEnglish + StrCmp $LANGUAGE ${LANG_GERMAN} DoGerman + StrCmp $LANGUAGE ${LANG_SPANISH} DoSpanish + StrCmp $LANGUAGE ${LANG_JAPANESE} DoJapanese + StrCmp $LANGUAGE ${LANG_KOREAN} DoKorean + StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} DoPortugueseBR + StrCmp $LANGUAGE ${LANG_SIMPCHINESE} DoSimpChinese + StrCmp $LANGUAGE ${LANG_TRADCHINESE} DoTradChinese + + +DoEnglish: + SetOutPath "$INSTDIR\Documentation\html" + File "..\..\doc\install\Documentation\en_US\html\*" + SetOutPath "$INSTDIR\Documentation\html\CmdRef" + File "..\..\doc\install\Documentation\en_US\html\CmdRef\*" + SetOutPath "$INSTDIR\Documentation\html\InstallGd" + File "..\..\doc\install\Documentation\en_US\html\InstallGd\*" + SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes" + File "..\..\doc\install\Documentation\en_US\html\ReleaseNotes\*" + SetOutPath "$INSTDIR\Documentation\html\SysAdminGd" + File "..\..\doc\install\Documentation\en_US\html\SysAdminGd\*" + goto DoneLanguage + +DoGerman: + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\de_DE\README.TXT" + SetOutPath "$INSTDIR\Documentation\html" + File "..\..\doc\install\Documentation\de_DE\html\*" + SetOutPath "$INSTDIR\Documentation\html\CmdRef" + ;File "..\..\doc\install\Documentation\de_DE\html\CmdRef\*" + SetOutPath "$INSTDIR\Documentation\html\InstallGd" + File "..\..\doc\install\Documentation\de_DE\html\InstallGd\*" + ;SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes" + ;File "..\..\doc\install\Documentation\de_DE\html\ReleaseNotes\*" + ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd" + ;File "..\..\doc\install\Documentation\de_DE\html\SysAdminGd\*" + goto DoneLanguage + +DoSpanish: + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\es_ES\README.TXT" + SetOutPath "$INSTDIR\Documentation\html" + File "..\..\doc\install\Documentation\es_ES\html\*" + SetOutPath "$INSTDIR\Documentation\html\CmdRef" + ;File "..\..\doc\install\Documentation\es_ES\html\CmdRef\*" + SetOutPath "$INSTDIR\Documentation\html\InstallGd" + ;File "..\..\doc\install\Documentation\es_ES\html\InstallGd\*" + SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes" + ;File "..\..\doc\install\Documentation\es_ES\html\ReleaseNotes\*" + SetOutPath "$INSTDIR\Documentation\html\SysAdminGd" + ;File "..\..\doc\install\Documentation\es_ES\html\SysAdminGd\*" + goto DoneLanguage + +DoJapanese: + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\ja_JP\README.TXT" + SetOutPath "$INSTDIR\Documentation\html" + File "..\..\doc\install\Documentation\ja_JP\html\*" + SetOutPath "$INSTDIR\Documentation\html\CmdRef" + File "..\..\doc\install\Documentation\ja_JP\html\CmdRef\*" + SetOutPath "$INSTDIR\Documentation\html\InstallGd" + File "..\..\doc\install\Documentation\ja_JP\html\InstallGd\*" + SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes" + ;File "..\..\doc\install\Documentation\ja_JP\html\ReleaseNotes\*" + SetOutPath "$INSTDIR\Documentation\html\SysAdminGd" + ;File "..\..\doc\install\Documentation\ja_JP\html\SysAdminGd\*" + goto DoneLanguage + +DoKorean: + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\ko_KR\README.TXT" + SetOutPath "$INSTDIR\Documentation\html" + File "..\..\doc\install\Documentation\ko_KR\html\*" + ;SetOutPath "$INSTDIR\Documentation\html\CmdRef" + ;File "..\..\doc\install\Documentation\ko_KR\html\CmdRef\*" + SetOutPath "$INSTDIR\Documentation\html\InstallGd" + File "..\..\doc\install\Documentation\ko_KR\html\InstallGd\*" + SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes" + File "..\..\doc\install\Documentation\ko_KR\html\ReleaseNotes\*" + SetOutPath "$INSTDIR\Documentation\html\SysAdminGd" + File "..\..\doc\install\Documentation\ko_KR\html\SysAdminGd\*" + goto DoneLanguage + +DoPortugueseBR: + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\pt_BR\README.TXT" + SetOutPath "$INSTDIR\Documentation\html" + File "..\..\doc\install\Documentation\pt_BR\html\*" + ;SetOutPath "$INSTDIR\Documentation\html\CmdRef" + ;File "..\..\doc\install\Documentation\pt_BR\html\CmdRef\*" + SetOutPath "$INSTDIR\Documentation\html\InstallGd" + File "..\..\doc\install\Documentation\pt_BR\html\InstallGd\*" + SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes" + File "..\..\doc\install\Documentation\pt_BR\html\ReleaseNotes\*" + ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd" + ;File "..\..\doc\install\Documentation\pt_BR\html\SysAdminGd\*" + goto DoneLanguage + +DoSimpChinese: + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\zh_CN\README.TXT" + SetOutPath "$INSTDIR\Documentation\html" + File "..\..\doc\install\Documentation\zh_CN\html\*" + ;SetOutPath "$INSTDIR\Documentation\html\CmdRef" + ;File "..\..\doc\install\Documentation\zh_CN\html\CmdRef\*" + SetOutPath "$INSTDIR\Documentation\html\InstallGd" + File "..\..\doc\install\Documentation\zh_CN\html\InstallGd\*" + SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes" + File "..\..\doc\install\Documentation\zh_CN\html\ReleaseNotes\*" + ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd" + ;File "..\..\doc\install\Documentation\zh_CN\html\SysAdminGd\*" + goto DoneLanguage + +DoTradChinese: + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\zh_TW\README.TXT" + SetOutPath "$INSTDIR\Documentation\html" + File "..\..\doc\install\Documentation\zh_TW\html\*" + ;SetOutPath "$INSTDIR\Documentation\html\CmdRef" + ;File "..\..\doc\install\Documentation\zh_TW\html\CmdRef\*" + SetOutPath "$INSTDIR\Documentation\html\InstallGd" + File "..\..\doc\install\Documentation\zh_TW\html\InstallGd\*" + SetOutPath "$INSTDIR\Documentation\html\ReleaseNotes" + File "..\..\doc\install\Documentation\zh_TW\html\ReleaseNotes\*" + ;SetOutPath "$INSTDIR\Documentation\html\SysAdminGd" + ;File "..\..\doc\install\Documentation\zh_TW\html\SysAdminGd\*" + goto DoneLanguage + + +DoneLanguage: + ;Store install folder + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation" "" $INSTDIR + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "VersionString" ${AFS_VERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL} + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "VersionString" ${AFS_VERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL} + + ; Write start menu shortcut + SetOutPath "$SMPROGRAMS\OpenAFS" + CreateShortCut "$SMPROGRAMS\OpenAFS\Documentation.lnk" "$INSTDIR\Documentation\html\index.htm" + + + WriteUninstaller "$INSTDIR\Uninstall.exe" + CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe" + Call AFSCommon.Install +SectionEnd + + +Section "Software Development Kit (SDK)" secSDK + + SetOutPath "$INSTDIR\Client\Program\lib" + File /r "${AFS_CLIENT_LIBDIR}\*.*" + + SetOutPath "$INSTDIR\Client\Program\Include" + File /r "${AFS_BUILD_INCDIR}\*.*" + + ; Client Sample + SetOutPath "$INSTDIR\Client\Program\Sample" + File "..\..\afsd\sample\token.c" + + ;Store install folder + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS SDK" "" $INSTDIR + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "VersionString" ${AFS_VERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "MajorVersion" ${AFS_MAJORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "MinorVersion" ${AFS_MINORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\CurrentVersion" "PatchLevel" ${AFS_PATCHLEVEL} + WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "VersionString" ${AFS_VERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "MajorVersion" ${AFS_MAJORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "MinorVersion" ${AFS_MINORVERSION} + WriteRegDWORD HKLM "${AFS_REGKEY_ROOT}\AFS SDK\${AFS_VERSION}" "PatchLevel" ${AFS_PATCHLEVEL} + + WriteUninstaller "$INSTDIR\Uninstall.exe" + SetOutPath "$SMPROGRAMS\OpenAFS" + CreateShortCut "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" "$INSTDIR\Uninstall.exe" + + Call AFSCommon.Install +SectionEnd + +;Display the Finish header +;Insert this macro after the sections if you are not using a finish page +;!insertmacro MUI_SECTIONS_FINISHHEADER + +;-------------------------------- +;Installer Functions + +Function .onInit + + !insertmacro MUI_LANGDLL_DISPLAY + + ; Set the default install options + Push $0 + + Call IsUserAdmin + Pop $R0 + StrCmp $R0 "true" contInstall + + MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "You must be an administrator of this machine to install this software." + Abort + +contInstall: + + ; Check that RPC functions are installed (I believe any one of these can be present for + ; OpenAFS to work) + ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_np" + StrCmp $R0 "rpcrt4.dll" contInstall2 + ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_ip_tcp" + StrCmp $R0 "rpcrt4.dll" contInstall2 + ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncadg_ip_udp" + StrCmp $R0 "rpcrt4.dll" contInstall2 + + MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "An error was detected with your Windows RPC installation. Please make sure Windows RPC is installed before installing OpenAFS." + Abort + + +contInstall2: + ; Our logic should be like this. + ; 1) If no AFS components are installed, we do a clean install with default options. (Client/Docs) + ; 2) If existing modules are installed, we keep them selected + ; 3) If it is an upgrade, we set the text accordingly, else we mark it as a re-install + ; TODO: Downgrade? + Call IsAnyAFSInstalled + Pop $R0 + StrCmp $R0 "0" DefaultOptions + + Call ShouldClientInstall + Pop $R2 + + ; Check if it was an IBM/Transarc version + ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" "DisplayName" + StrCmp $R0 "IBM AFS Client" DoIBM + StrCmp $R0 "Transarc AFS Client" DoIBM +NotIBM: + StrCpy $R9 "" + StrCmp $R2 "0" NoClient + StrCmp $R2 "1" ReinstallClient + StrCmp $R2 "2" UpgradeClient + StrCmp $R2 "3" DowngradeClient + goto Continue +DoIBM: + ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\AFS Client\CurrentVersion" "MajorVersion" + StrCmp $R0 "3" +1 NotIBM + StrCpy $R9 "IBM" + goto UpgradeClient + +Continue: + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + ;# !insertmacro SelectSection ${secClient} + goto skipClient +NoClient: + ;StrCpy $1 ${secClient} ; Gotta remember which section we are at now... + SectionGetFlags ${secClient} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secClient} $0 + goto skipClient +UpgradeClient: + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + SectionSetText ${secClient} $(UPGRADE_CLIENT) + goto skipClient +ReinstallClient: + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + SectionSetText ${secClient} $(REINSTALL_CLIENT) + goto skipClient +DowngradeClient: + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + SectionSetText ${secClient} $(REINSTALL_CLIENT) + goto skipClient + + +skipClient: + + Call ShouldServerInstall + Pop $R2 + StrCmp $R2 "0" NoServer + StrCmp $R2 "1" ReinstallServer + StrCmp $R2 "2" UpgradeServer + StrCmp $R2 "3" DowngradeServer + + SectionGetFlags ${secServer} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secServer} $0 + ;# !insertmacro UnselectSection ${secServer} + goto skipServer + +UpgradeServer: + SectionGetFlags ${secServer} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secServer} $0 + SectionSetText ${secServer} $(UPGRADE_SERVER) + goto skipServer + +ReinstallServer: + SectionGetFlags ${secServer} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secServer} $0 + SectionSetText ${secServer} $(REINSTALL_SERVER) + goto skipServer + +DowngradeServer: + SectionGetFlags ${secServer} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secServer} $0 + SectionSetText ${secServer} $(REINSTALL_SERVER) + goto skipServer + +NoServer: + SectionGetFlags ${secServer} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secServer} $0 + ;# !insertmacro UnselectSection ${secServer} + goto skipServer + +skipServer: + ; Check control center + Call IsControlInstalled + Pop $R2 + StrCmp $R2 "0" NoControl + + SectionGetFlags ${secControl} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secControl} $0 + goto CheckDocs + +NoControl: + SectionGetFlags ${secControl} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secControl} $0 + ;# !insertmacro UnselectSection ${secControl} + +CheckDocs: + ; Check Documentation + Call IsDocumentationInstalled + Pop $R2 + StrCmp $R2 "0" NoDocs + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDocs} $0 + goto CheckSDK + +NoDocs: + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secDocs} $0 + goto CheckSDK + +; To check the SDK, we simply look to see if the files exist. If they do, +; the SDK is installed. If not, we don't need to push it on the user. +; If they are there, we want to make sure they match the installed version. +CheckSDK: + IfFileExists "$INSTDIR\Client\Program\Include\main.h" +1 NoSDK + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secSDK} $0 + goto end + +NoSDK: + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secSDK} $0 + goto end + +DefaultOptions: + ; Client Selected + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + + ; Server NOT selected + SectionGetFlags ${secServer} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secServer} $0 + + ; Control Center NOT selected + SectionGetFlags ${secControl} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secControl} $0 + ;# !insertmacro UnselectSection ${secControl} + + ; Documentation selected + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDocs} $0 + ;# !insertmacro UnselectSection ${secDocs} + + ; SDK not selected + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secSDK} $0 + ;# !insertmacro UnselectSection ${secSDK} + + goto end + +end: + Pop $0 + + Push $R0 + + ; See if we can set a default installation path... + ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PathName" + StrCmp $R0 "" TryServer + Push $R0 + Call GetParent + + ; Work around bug in 1.3.5000, 1.3.5100, 1.3.5200, 1.3.5201, 1.3.5299 installers... + ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MajorVersion" + StrCmp $R0 "1" +1 SkipParent + ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "MinorVersion" + StrCmp $R0 "3" +1 SkipParent + ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" "PatchLevel" + StrCmp $R0 "5000" UpParent + StrCmp $R0 "5100" UpParent + StrCmp $R0 "5200" UpParent + StrCmp $R0 "5201" UpParent + StrCmp $R0 "5299" UpParent + goto SkipParent + +UpParent: + Call GetParent + +SkipParent: + Pop $R0 + StrCpy $INSTDIR $R0 + goto Nope + +TryServer: + ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" "PathName" + StrCmp $R0 "" TryControl + Push $R0 + Call GetParent + Pop $R0 + StrCpy $INSTDIR $R0 + goto Nope + +TryControl: + ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "PathName" + StrCmp $R0 "" Nope + StrCpy $INSTDIR $R0 + +Nope: + Pop $R0 + + GetTempFilename $0 + File /oname=$0 CellServPage.ini + GetTempFilename $1 + File /oname=$1 AFSCell.ini + ;File /oname=$1 ConfigURL.ini + +FunctionEnd + + + + + +;-------------------------------- +; These are our cleanup functions +Function .onInstFailed +Delete $0 +Delete $1 +FunctionEnd + +Function .onInstSuccess +Delete $0 +Delete $1 +FunctionEnd + + +;-------------------------------- +;Descriptions + + !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${secServer} $(DESC_secServer) + !insertmacro MUI_DESCRIPTION_TEXT ${secClient} $(DESC_secClient) + !insertmacro MUI_DESCRIPTION_TEXT ${secControl} $(DESC_secControl) + !insertmacro MUI_DESCRIPTION_TEXT ${secDocs} $(DESC_secDocs) + !insertmacro MUI_DESCRIPTION_TEXT ${secSDK} $(DESC_secSDK) + !insertmacro MUI_FUNCTION_DESCRIPTION_END + +;-------------------------------- +;Uninstaller Section + +Section "Uninstall" + ; Make sure the user REALLY wants to do this, unless they did a silent uninstall, in which case...let them! + IfSilent StartRemove ; New in v2.0b4 + MessageBox MB_YESNO "Are you sure you want to remove OpenAFS from this machine?" IDYES StartRemove + abort + +StartRemove: + + SetShellVarContext all + ; Stop the running processes + GetTempFileName $R0 + File /oname=$R0 "${AFS_WININSTALL_DIR}\Killer.exe" + nsExec::Exec '$R0 afscreds.exe' + Exec "afscreds.exe -z" + ; in case we are upgrading an old version that does not support -z + Sleep 2000 + nsExec::Exec '$R0 afscreds.exe' +!IFDEF INSTALL_KFW + nsExec::Exec '$R0 krbcc32s.exe' +!ENDIF + + ; Delete the AFS service + GetTempFileName $R0 + File /oname=$R0 "${AFS_WININSTALL_DIR}\Service.exe" + nsExec::Exec "net stop TransarcAFSDaemon" + nsExec::Exec "net stop TransarcAFSServer" + nsExec::Exec '$R0 u TransarcAFSDaemon' + ; After we stop the service, but before we delete it, we have to remove the volume data + ; This is because the storage locations are in the registry under the service key. + ; Call un.RemoveAFSVolumes + nsExec::Exec '$R0 u TransarcAFSServer' + Delete $R0 + + Call un.RemoveProvider + + Push "$INSTDIR\Client\Program" + Call un.RemoveFromPath + Push "$INSTDIR\Common" + Call un.RemoveFromPath +!ifdef INSTALL_KFW + Push "$INSTDIR\kfw\bin" + Call un.RemoveFromPath +!endif + + ; Delete documentation + Delete "$INSTDIR\Documentation\README.TXT" + Delete "$INSTDIR\Documentation\html\*" + Delete "$INSTDIR\Documentation\html\CmdRef\*" + Delete "$INSTDIR\Documentation\html\InstallGd\*" + Delete "$INSTDIR\Documentation\html\ReleaseNotes\*" + Delete "$INSTDIR\Documentation\html\SysAdminGd\*" + + Delete /REBOOTOK "$INSTDIR\Common\afs_config.exe" + Delete /REBOOTOK "$INSTDIR\Common\afs_shl_ext.dll" + Delete /REBOOTOK "$INSTDIR\Common\afsadminutil.dll" + Delete /REBOOTOK "$INSTDIR\Common\lib\afsauthent.dll" + Delete /REBOOTOK "$INSTDIR\Common\lib\afspthread.dll" + Delete /REBOOTOK "$INSTDIR\Common\lib\afsrpc.dll" + Delete /REBOOTOK "$INSTDIR\Common\afsclientadmin.dll" + Delete /REBOOTOK "$INSTDIR\Common\afsprocmgmt.dll" + Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.dll" + Delete /REBOOTOK "$INSTDIR\Common\TaAfsAppLib.dll" + Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.dll" + Delete /REBOOTOK "$INSTDIR\Common\afsbosadmin.dll" + Delete /REBOOTOK "$INSTDIR\Common\afscfgadmin.dll" + Delete /REBOOTOK "$INSTDIR\Common\afskasadmin.dll" + Delete /REBOOTOK "$INSTDIR\Common\afsptsadmin.dll" + +!IFDEF DEBUG + Delete /REBOOTOK "$INSTDIR\Common\afs_config.pdb" + Delete /REBOOTOK "$INSTDIR\Common\afs_shl_ext.pdb" + Delete /REBOOTOK "$INSTDIR\Common\afsadminutil.pdb" + Delete /REBOOTOK "$INSTDIR\Common\lib\afsauthent.pdb" + Delete /REBOOTOK "$INSTDIR\Common\lib\afspthread.pdb" + Delete /REBOOTOK "$INSTDIR\Common\lib\afsrpc.pdb" + Delete /REBOOTOK "$INSTDIR\Common\afsclientadmin.pdb" + Delete /REBOOTOK "$INSTDIR\Common\afsprocmgmt.pdb" + Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.pdb" + Delete /REBOOTOK "$INSTDIR\Common\TaAfsAppLib.pdb" + Delete /REBOOTOK "$INSTDIR\Common\afsvosadmin.pdb" + Delete /REBOOTOK "$INSTDIR\Common\afsbosadmin.pdb" + Delete /REBOOTOK "$INSTDIR\Common\afscfgadmin.pdb" + Delete /REBOOTOK "$INSTDIR\Common\afskasadmin.pdb" + Delete /REBOOTOK "$INSTDIR\Common\afsptsadmin.pdb" + +!IFDEF CL_1310 + Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\mfc71d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc71d.pdb" +!ELSE +!IFDEF CL_1300 + Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\mfc70d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc70d.pdb" +!ELSE + Delete /REBOOTOK "$INSTDIR\bin\mfc42d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc42d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.pdb" +!ENDIF +!ENDIF +!ELSE +!IFDEF CL_1310 + Delete /REBOOTOK "$INSTDIR\bin\mfc71.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr71.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp71.dll" + Delete /REBOOTOK "$INSTDIR\bin\MFC71CHS.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71CHT.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71DEU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71ENU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71ESP.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71FRA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71ITA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71JPN.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71KOR.DLL" +!ELSE +!IFDEF CL_1300 + Delete /REBOOTOK "$INSTDIR\bin\mfc70.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr70.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp70.dll" + Delete /REBOOTOK "$INSTDIR\bin\MFC70CHS.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70CHT.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70DEU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70ENU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70ESP.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70FRA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70ITA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70JPN.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70KOR.DLL" +!ELSE + Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll" +!ENDIF +!ENDIF +!ENDIF + + IfSilent SkipAsk +; IfFileExists "$WINDIR\afsdcell.ini" CellExists SkipDelAsk +; CellExists: + MessageBox MB_YESNO "Would you like to keep your configuration files?" IDYES SkipDel + SkipAsk: + Delete "$WINDIR\afsdcell.ini" + + Delete "$WINDIR\afsdsbmt.ini" +; Only remove krb5.ini if KfW was installed +!IFDEF INSTALL_KFW + Delete "$WINDIR\krb5.ini" +!ENDIF + Delete "$WINDIR\afsdns.ini" + Delete "$WINDIR\afs_freelance.ini" + + SkipDel: + Delete "$WINDIR\afsd_init.log" + Delete "$INSTDIR\Uninstall.exe" + + ; Remove server + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afskill.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afssvrcfg.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosctlsvc.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosserver.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\buserver.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\butc.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fileserver.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fms.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\kaserver.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\ptserver.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\salvager.exe" + Delete "$INSTDIR\Server\usr\afs\bin\ServerUninst.dll" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\upclient.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\upserver.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\vlserver.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\volinfo.exe" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\volserver.exe" + +!ifdef DEBUG + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afskill.pdb" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\afssvrcfg.pdb" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosctlsvc.pdb" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\bosserver.pdb" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\buserver.pdb" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\butc.pdb" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fileserver.pdb" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\fms.pdb" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\kaserver.pdb" + Delete /REBOOTOK "$INSTDIR\Server\usr\afs\bin\ptserver.pdb" + Delete "$INSTDIR\Server\usr\afs\bin\salvager.pdb" + Delete "$INSTDIR\Server\usr\afs\bin\ServerUninst.pdb" + Delete "$INSTDIR\Server\usr\afs\bin\upclient.pdb" + Delete "$INSTDIR\Server\usr\afs\bin\upserver.pdb" + Delete "$INSTDIR\Server\usr\afs\bin\vlserver.pdb" + Delete "$INSTDIR\Server\usr\afs\bin\volinfo.pdb" + Delete "$INSTDIR\Server\usr\afs\bin\volserver.pdb" +!endif + + RMDir /r "$INSTDIR\Server\usr\afs\bin" + ; do not delete the server configuration files + ; or we will lose the volumes and authentication + ; databases + ;RmDir /r "$INSTDIR\Server\usr\afs\etc\logs" + ;RmDir /r "$INSTDIR\Server\usr\afs\etc" + ;RmDir /r "$INSTDIR\Server\usr\afs\local" + ;RMDIR /r "$INSTDIR\Server\usr\afs\logs" + + Delete /REBOOTOK "$SYSDIR\afsserver.cpl" + Delete /REBOOTOK "$SYSDIR\afs_cpa.cpl" + +!ifdef DEBUG + Delete /REBOOTOK "$SYSDIR\afsserver.pdb" + Delete /REBOOTOK "$SYSDIR\afs_cpa.pdb" +!endif + + RMDir /r "$INSTDIR\Documentation\html\CmdRef" + RMDir /r "$INSTDIR\Documentation\html\InstallGd" + RMDir /r "$INSTDIR\Documentation\html\ReleaseNotes" + RMDir /r "$INSTDIR\Documentation\html\SysAdminGd" + RMDIr /r "$INSTDIR\Documentation\html" + + RMDir "$INSTDIR\Documentation" + ; Delete DOC short cut + Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.exe" + +!ifdef DEBUG + Delete /REBOOTOK "$INSTDIR\Client\Program\afscreds.pdb" +!endif + + Delete /REBOOTOK "$INSTDIR\Client\Program\*" + Delete /REBOOTOK "$INSTDIR\Client\Program\Include\*" + Delete /REBOOTOK "$INSTDIR\Client\Program\Include\afs\*" + Delete /REBOOTOK "$INSTDIR\Client\Program\Include\rx\*" + Delete /REBOOTOK "$INSTDIR\Client\Program\Sample\*" + RMDir "$INSTDIR\Client\Program\Sample" + RMDir "$INSTDIR\Client\Program\Include\afs" + RMDir "$INSTDIR\Client\Program\Include\rx" + RMDir "$INSTDIR\Client\Program\Include" + RMDir "$INSTDIR\Client\Program" + RMDir "$INSTDIR\Client" + +!IFDEF DEBUG +!IFDEF CL_1310 + Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\mfc71d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc71d.pdb" +!ELSE +!IFDEF CL_1300 + Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\mfc70d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc70d.pdb" +!ELSE + Delete /REBOOTOK "$INSTDIR\bin\mfc42d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc42d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.pdb" +!ENDIF +!ENDIF +!ELSE +!IFDEF CL_1310 + Delete /REBOOTOK "$INSTDIR\bin\mfc71.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr71.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp71.dll" + Delete /REBOOTOK "$INSTDIR\bin\MFC71CHS.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71CHT.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71DEU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71ENU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71ESP.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71FRA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71ITA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71JPN.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71KOR.DLL" +!ELSE +!IFDEF CL_1300 + Delete /REBOOTOK "$INSTDIR\bin\mfc70.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr70.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp70.dll" + Delete /REBOOTOK "$INSTDIR\bin\MFC70CHS.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70CHT.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70DEU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70ENU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70ESP.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70FRA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70ITA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70JPN.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70KOR.DLL" +!ELSE + Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll" +!ENDIF +!ENDIF +!ENDIF + + Delete /REBOOTOK "$INSTDIR\Common\*" + RMDir "$INSTDIR\Common" + +!ifdef INSTALL_KFW + ;Remove KfW files + Delete /REBOOTOK "$INSTDIR\kfw\bin\*" + RMDIR /r "$INSTDIR\kfw\bin" + Delete /REBOOTOK "$INSTDIR\kfw\doc\*" + RMDIR /r "$INSTDIR\kfw\doc" + RMDIR /r "$INSTDIR\kfw" +!endif + + Delete "$SMPROGRAMS\OpenAFS\Documentation.lnk" + + ; Remove control center + Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAccountManager.exe" + Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAdmSvr.exe" + Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsServerManager.exe" + Delete /REBOOTOK "$INSTDIR\Control Center\CCUninst.dll" +!ifdef DEBUG + Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAccountManager.pdb" + Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsAdmSvr.pdb" + Delete /REBOOTOK "$INSTDIR\Control Center\TaAfsServerManager.pdb" +!endif + RMDir "$INSTDIR\Control Center" + + Delete "$SMPROGRAMS\OpenAFS\Uninstall OpenAFS.lnk" + Delete "$SMPROGRAMS\OpenAFS\Client\Authentication.lnk" + Delete "$SMPROGRAMS\OpenAFS\Control Center\Account Manager.lnk" + Delete "$SMPROGRAMS\OpenAFS\Control Center\Server Manager.lnk" + RMDIR "$SMPROGRAMS\OpenAFS\Control Center" + RMDir /r "$SMPROGRAMS\OpenAFS\Client" + RMDir /r "$SMPROGRAMS\OpenAFS" + Delete "$SMSTARTUP\AFS Credentials.lnk" + + ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon" "CachePath" + IfErrors +2 + Delete "$R0\AFSCache" + Delete "C:\AFSCache" + + DeleteRegKey HKCR "*\shellex\ContextMenuHandlers\AFS Client Shell Extension" + DeleteRegKey HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}\InprocServer32" + DeleteRegKey HKCR "CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" + DeleteRegKey HKCR "FOLDER\shellex\ContextMenuHandlers\AFS Client Shell Extension" + DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}" + + DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Client\CurrentVersion" + DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Client" + DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation\CurrentVersion" + DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Supplemental Documentation" + DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" + DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Control Center" + DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Server\CurrentVersion" + DeleteRegKey HKLM "${AFS_REGKEY_ROOT}\AFS Server" + DeleteRegKey /ifempty HKLM "${AFS_REGKEY_ROOT}" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" + DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Services\NetBT\Parameters" "SmbDeviceEnabled" + + RMDir "$INSTDIR" + +SectionEnd + +;-------------------------------- +;Uninstaller Functions + +Function un.onInit + + ;Get language from registry + ReadRegStr $LANGUAGE HKCU "Software\OpenAFS\AFS" "Installer Language" + +FunctionEnd + +Function un.onUninstSuccess + + MessageBox MB_OK "Please reboot your machine to complete uninstallation of the software" + +FunctionEnd + +;------------------------------ +; Get the CellServDB file from the Internet + +Function afs.GetCellServDB + +;Check if we should download CellServDB +ReadINIStr $R0 $0 "Field 4" "State" +StrCmp $R0 "1" DoDownload + +;Do nothing if we're keeping the existing file +ReadINIStr $R0 $0 "Field 2" "State" +StrCmp $R0 "1" done + +ReadINIStr $R0 $0 "Field 6" "State" +StrCmp $R0 "1" CheckOther + +ReadINIStr $R0 $0 "Field 3" "State" +StrCmp $R0 "1" UsePackaged + +; If none of these, grab file from other location +goto UsePackaged + +DoDownload: + ReadINIStr $R0 $0 "Field 5" "State" + NSISdl::download $R0 "$WINDIR\afsdcell.ini" + Pop $R0 ;Get the return value + StrCmp $R0 "success" +2 + MessageBox MB_OK|MB_ICONSTOP "Download failed: $R0" + goto done + +UsePackaged: + SetOutPath "$WINDIR" + File "afsdcell.ini" + goto done + +CheckOther: + ReadINIStr $R0 $0 "Field 7" "State" + StrCmp $R0 "" done + CopyFiles $R0 "$WINDIR\afsdcell.ini" + +done: + +FunctionEnd + +Function AddProvider + Push $R0 + Push $R1 + ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" + Push $R0 + StrCpy $R0 "TransarcAFSDaemon" + Push $R0 + Call StrStr + Pop $R0 + StrCmp $R0 "" +1 DoOther + ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" + StrCpy $R0 "$R1,TransarcAFSDaemon" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" $R0 +DoOther: + ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" + Push $R0 + StrCpy $R0 "TransarcAFSDaemon" + Push $R0 + Call StrStr + Pop $R0 + StrCmp $R0 "" +1 End + ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" + StrCpy $R0 "$R1,TransarcAFSDaemon" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" $R0 +End: + Pop $R1 + Pop $R0 +FunctionEnd + +Function un.RemoveProvider + Push $R0 + StrCpy $R0 "TransarcAFSDaemon" + Push $R0 + StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" + Call un.RemoveFromProvider + StrCpy $R0 "TransarcAFSDaemon" + Push $R0 + StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" + Call un.RemoveFromProvider + Pop $R0 +FunctionEnd + +Function un.RemoveFromProvider + Exch $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $5 + Push $6 + + ReadRegStr $1 HKLM "$R0" "ProviderOrder" + StrCpy $5 $1 1 -1 # copy last char + StrCmp $5 "," +2 # if last char != , + StrCpy $1 "$1," # append , + Push $1 + Push "$0," + Call un.StrStr ; Find `$0,` in $1 + Pop $2 ; pos of our dir + StrCmp $2 "" unRemoveFromPath_done + ; else, it is in path + # $0 - path to add + # $1 - path var + StrLen $3 "$0," + StrLen $4 $2 + StrCpy $5 $1 -$4 # $5 is now the part before the path to remove + StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove + StrCpy $3 $5$6 + + StrCpy $5 $3 1 -1 # copy last char + StrCmp $5 "," 0 +2 # if last char == , + StrCpy $3 $3 -1 # remove last char + + WriteRegStr HKLM "$R0" "ProviderOrder" $3 + + unRemoveFromPath_done: + Pop $6 + Pop $5 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 +FunctionEnd + +Function CheckPathForAFS + Push $0 + Push $1 + Push $2 + Push $3 + ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" + StrCpy $1 "$1;" +loop: + Push $1 + Push ";" + Call StrStr + Pop $0 + StrLen $2 $0 + StrCpy $3 $1 -$2 + IfFileExists "$3\afsd_service.exe" Error + StrCpy $1 $0 32768 1 + StrLen $2 $1 + IntCmp $2 0 Done Done loop + goto Done +Error: + MessageBox MB_ICONSTOP|MB_OK|MB_TOPMOST "This installer is unable to upgrade the previous version of AFS. Please uninstall the current AFS version before continuing." + Abort "Unable to install OpenAFS" +Done: + Pop $3 + Pop $2 + Pop $1 + Pop $0 +FunctionEnd + +Function AddToUniquePath + Pop $R0 + Push $R0 + Push "$R0;" + ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" + Push "$R0;" + Call StrStr + Pop $R0 + StrCmp $R0 "" +1 Done + Call AddToPath +Done: +FunctionEnd + + +;------------------------------- +;Do the page to get the CellServDB + +Function AFSPageGetCellServDB + ; Skip this page if we are not installing the client + SectionGetFlags ${secClient} $R0 + IntOp $R0 $R0 & ${SF_SELECTED} + StrCmp $R0 "0" Skip + + ; Set the install options here + +startOver: + WriteINIStr $0 "Field 2" "Flags" "DISABLED" + WriteINIStr $0 "Field 3" "State" "1" + WriteINISTR $0 "Field 4" "State" "0" + WriteINIStr $0 "Field 6" "State" "0" + + ; If there is an existing afsdcell.ini file, allow the user to choose it and make it default + IfFileExists "$WINDIR\afsdcell.ini" +1 notpresent + WriteINIStr $0 "Field 2" "Flags" "ENABLED" + WriteINIStr $0 "Field 2" "State" "1" + WriteINIStr $0 "Field 3" "State" "0" + + notpresent: + + !insertmacro MUI_HEADER_TEXT "CellServDB Configuration" "Please choose a method for installing the CellServDB file:" + InstallOptions::dialog $0 + Pop $R1 + StrCmp $R1 "cancel" exit + StrCmp $R1 "back" done + StrCmp $R1 "success" done +exit: Quit +done: + + ; Check that if a file is set, a valid filename is entered... + ReadINIStr $R0 $0 "Field 6" "State" + StrCmp $R0 "1" CheckFileName + + ;Check if a URL is specified, one *IS* specified + ReadINIStr $R0 $0 "Field 4" "State" + StrCmp $R0 "1" CheckURL Skip + + CheckURL: + ReadINIStr $R0 $0 "Field 5" "State" + StrCmp $R0 "" +1 Skip + MessageBox MB_OK|MB_ICONSTOP $(URLError) + WriteINIStr $0 "Field 4" "State" "0" + goto startOver + + CheckFileName: + ReadINIStr $R0 $0 "Field 7" "State" + IfFileExists $R0 Skip + + MessageBox MB_OK|MB_ICONSTOP $(CellError) + WriteINIStr $0 "Field 6" "State" "0" + goto startOver + + Skip: + +FunctionEnd + + +Function AFSPageGetCellName + IfSilent good + ; Skip this page if we are not installing the client + SectionGetFlags ${secClient} $R0 + IntOp $R0 $R0 & ${SF_SELECTED} + StrCmp $R0 "0" good + +startOver: + ; If this is a server install, we do NOT want to recommend the Freelance client + ; And we do not need to ask for the cell name. + SectionGetFlags ${secServer} $R1 + IntOp $R1 $R1 & ${SF_SELECTED} + StrCmp $R1 "1" +1 NotServer + WriteINIStr $1 "Field 6" "Text" "Enable AFS Freelance client (Not Recommended for servers)" + WriteINIStr $1 "Field 5" "State" "0" + WriteINIStr $1 "Field 1" "Flags" "DISABLED" + WriteINIStr $1 "Field 2" "Flags" "DISABLED" + goto SkipServerTest +NotServer: + WriteINIStr $1 "Field 6" "Text" "Enable AFS Freelance client (Recommended)" + WriteINIStr $1 "Field 5" "State" "1" + WriteINIStr $1 "Field 1" "Flags" "" + WriteINIStr $1 "Field 2" "Flags" "" +SkipServerTest: + ; Get the current cell name, if any + ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters" "Cell" + StrCmp $R1 "" +2 + WriteINIStr $1 "Field 2" "State" $R1 + !insertmacro MUI_HEADER_TEXT "Client Cell Name Configuration" "Please enter the name for your default cell:" + InstallOptions::dialog $1 + Pop $R1 + StrCmp $R1 "cancel" exit + StrCmp $R1 "back" done + StrCmp $R1 "success" done +exit: Quit +done: + ReadINIStr $R0 $1 "Field 2" "State" + StrCmp $R0 "" +1 good + + MessageBox MB_OK|MB_ICONSTOP $(CellNameError) + goto startOver +good: +FunctionEnd + +;------------- +; Common install routines for each module +Function AFSCommon.Install + +WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayName" "OpenAFS for Windows" +WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "UninstallString" "$INSTDIR\uninstall.exe" +!ifndef DEBUG +WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayVersion" "${AFS_VERSION}" +!else +WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "DisplayVersion" "${AFS_VERSION} Checked/Debug" +!endif +WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenAFS" "URLInfoAbout" "http://www.openafs.org/" + +FunctionEnd + + +;------------------- +; Get the currently installed version and place it on the stack +; Modifies: Nothing +Function GetInstalledVersion + Push $R0 + Push $R1 + Push $R4 + + ReadRegStr $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "VersionString" + StrCmp $R0 "" NotTransarc done + + +NotTransarc: + ReadRegStr $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "VersionString" + StrCmp $R0 "" done + +done: + Pop $R4 + Pop $R1 + Exch $R0 +FunctionEnd + +; Functions to get each component of the version number +Function GetInstalledVersionMajor + Push $R0 + Push $R1 + Push $R4 + + ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "MajorVersion" + StrCmp $R0 "" NotTransarc done + + +NotTransarc: + ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "MajorVersion" + StrCmp $R0 "" done + +done: + Pop $R4 + Pop $R1 + Exch $R0 +FunctionEnd + +Function GetInstalledVersionMinor + Push $R0 + Push $R1 + Push $R4 + + ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "MinorVersion" + StrCmp $R0 "" NotTransarc done + + +NotTransarc: + ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "MinorVersion" + StrCmp $R0 "" done + +done: + Pop $R4 + Pop $R1 + Exch $R0 +FunctionEnd + +Function GetInstalledVersionPatch + Push $R0 + Push $R1 + Push $R4 + + ReadRegDWORD $R0 HKLM "Software\TransarcCorporation\$R2\CurrentVersion" "PatchLevel" + StrCmp $R0 "" NotTransarc done + + +NotTransarc: + ReadRegDWORD $R0 HKLM "${AFS_REGKEY_ROOT}\$R2\CurrentVersion" "PatchLevel" + StrCmp $R0 "" done + +done: + Pop $R4 + Pop $R1 + Exch $R0 +FunctionEnd + + + +;------------------------------- +; Check if the client should be checked for default install +Function ShouldClientInstall + Push $R0 + StrCpy $R2 "AFS Client" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + ; Now we see if it's an older or newer version + + Call GetInstalledVersionMajor + Pop $R0 + IntCmpU $R0 ${AFS_MAJORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionMinor + Pop $R0 + IntCmpU $R0 ${AFS_MINORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionPatch + Pop $R0 + IntCmpU $R0 ${AFS_PATCHLEVEL} Reinstall Upgrade Downgrade + +Reinstall: + StrCpy $R0 "1" + Exch $R0 + goto end + +Upgrade: + StrCpy $R0 "2" + Exch $R0 + goto end + +Downgrade: + StrCpy $R0 "3" + Exch $R0 + goto end + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + +;------------------------------- +; Check how the server options should be set +Function ShouldServerInstall + Push $R0 + StrCpy $R2 "AFS Server" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + ; Now we see if it's an older or newer version + + Call GetInstalledVersionMajor + Pop $R0 + IntCmpU $R0 ${AFS_MAJORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionMinor + Pop $R0 + IntCmpU $R0 ${AFS_MINORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionPatch + Pop $R0 + IntCmpU $R0 ${AFS_PATCHLEVEL} Reinstall Upgrade Downgrade + +Reinstall: + StrCpy $R0 "1" + Exch $R0 + goto end + +Upgrade: + StrCpy $R0 "2" + Exch $R0 + goto end + +Downgrade: + StrCpy $R0 "3" + Exch $R0 + goto end + + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + + +; See if AFS Server is installed +; Returns: "1" if it is, 0 if it is not (on the stack) +Function IsServerInstalled + Push $R0 + StrCpy $R2 "AFS Server" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + + StrCpy $R0 "1" + Exch $R0 + goto end + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + + +; See if AFS Client is installed +; Returns: "1" if it is, 0 if it is not (on the stack) +Function IsClientInstalled + Push $R0 + StrCpy $R2 "AFS Client" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + + StrCpy $R0 "1" + Exch $R0 + goto end + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + + + +; See if AFS Documentation is installed +; Returns: "1" if it is, 0 if it is not (on the stack) +Function IsDocumentationInstalled + Push $R0 + StrCpy $R2 "AFS Supplemental Documentation" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + + StrCpy $R0 "1" + Exch $R0 + goto end + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + + +; See if Control Center is installed +; Returns: "1" if it is, 0 if it is not (on the stack) +Function IsControlInstalled + Push $R0 + StrCpy $R2 "AFS Control Center" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + + StrCpy $R0 "1" + Exch $R0 + goto end + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + + +; GetParameters +; input, none +; output, top of stack (replaces, with e.g. whatever) +; modifies no other variables. + +Function GetParameters + Push $R0 + Push $R1 + Push $R2 + StrCpy $R0 $CMDLINE 1 + StrCpy $R1 '"' + StrCpy $R2 1 + StrCmp $R0 '"' loop + StrCpy $R1 ' ' ; we're scanning for a space instead of a quote + loop: + StrCpy $R0 $CMDLINE 1 $R2 + StrCmp $R0 $R1 loop2 + StrCmp $R0 "" loop2 + IntOp $R2 $R2 + 1 + Goto loop + loop2: + IntOp $R2 $R2 + 1 + StrCpy $R0 $CMDLINE 1 $R2 + StrCmp $R0 " " loop2 + StrCpy $R0 $CMDLINE "" $R2 + Pop $R2 + Pop $R1 + Exch $R0 +FunctionEnd + + +;Check to see if any AFS component is installed +;Returns: Value on stack: "1" if it is, "0" if it is not +Function IsAnyAFSInstalled + Push $R0 + Push $R1 + Push $R2 + Push $R3 + Call IsClientInstalled + Pop $R0 + Call IsServerInstalled + Pop $R1 + Call IsControlInstalled + Pop $R2 + Call IsDocumentationInstalled + Pop $R3 + ; Now we must see if ANY of the $Rn values are 1 + StrCmp $R0 "1" SomethingInstalled + StrCmp $R1 "1" SomethingInstalled + StrCmp $R2 "1" SomethingInstalled + StrCmp $R3 "1" SomethingInstalled + ;Nothing installed + StrCpy $R0 "0" + goto end +SomethingInstalled: + StrCpy $R0 "1" +end: + Pop $R3 + Pop $R2 + Pop $R1 + Exch $R0 +FunctionEnd + + +;Install English Language Files +Function AFSLangFiles + ; Common files + SetOutPath "$INSTDIR\Common" + File "${AFS_CLIENT_BUILDDIR}\afs_config.exe" + File "${AFS_SERVER_BUILDDIR}\afsadminutil.dll" + !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afsauthent.dll" "$INSTDIR\Common\afsauthent.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afspthread.dll" "$INSTDIR\Common\afspthread.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_DESTDIR}\lib\afsrpc.dll" "$INSTDIR\Common\afsrpc.dll" "$INSTDIR" + File "${AFS_SERVER_BUILDDIR}\afsclientadmin.dll" + File "${AFS_SERVER_BUILDDIR}\afsprocmgmt.dll" + File "${AFS_SERVER_BUILDDIR}\afsvosadmin.dll" + File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib.dll" + File "${AFS_SERVER_BUILDDIR}\afsvosadmin.dll" + File "${AFS_SERVER_BUILDDIR}\afsbosadmin.dll" + File "${AFS_SERVER_BUILDDIR}\afscfgadmin.dll" + File "${AFS_SERVER_BUILDDIR}\afskasadmin.dll" + File "${AFS_SERVER_BUILDDIR}\afsptsadmin.dll" + +!IFDEF DEBUG +!IFDEF CL_1310 + File "${SYSTEMDIR}\msvcr71d.dll" + File "${SYSTEMDIR}\msvcr71d.pdb" + File "${SYSTEMDIR}\msvcp71d.dll" + File "${SYSTEMDIR}\msvcp71d.pdb" + File "${SYSTEMDIR}\mfc71d.dll" + File "${SYSTEMDIR}\mfc71d.pdb" + File "${SYSTEMDIR}\MFC71CHS.DLL" + File "${SYSTEMDIR}\MFC71CHT.DLL" + File "${SYSTEMDIR}\MFC71DEU.DLL" + File "${SYSTEMDIR}\MFC71ENU.DLL" + File "${SYSTEMDIR}\MFC71ESP.DLL" + File "${SYSTEMDIR}\MFC71FRA.DLL" + File "${SYSTEMDIR}\MFC71ITA.DLL" + File "${SYSTEMDIR}\MFC71JPN.DLL" + File "${SYSTEMDIR}\MFC71KOR.DLL" +!ELSE +!IFDEF CL_1300 + File "${SYSTEMDIR}\msvcr70d.dll" + File "${SYSTEMDIR}\msvcr70d.pdb" + File "${SYSTEMDIR}\msvcp70d.dll" + File "${SYSTEMDIR}\msvcp70d.pdb" + File "${SYSTEMDIR}\mfc70d.dll" + File "${SYSTEMDIR}\mfc70d.pdb" + File "${SYSTEMDIR}\MFC70CHS.DLL" + File "${SYSTEMDIR}\MFC70CHT.DLL" + File "${SYSTEMDIR}\MFC70DEU.DLL" + File "${SYSTEMDIR}\MFC70ENU.DLL" + File "${SYSTEMDIR}\MFC70ESP.DLL" + File "${SYSTEMDIR}\MFC70FRA.DLL" + File "${SYSTEMDIR}\MFC70ITA.DLL" + File "${SYSTEMDIR}\MFC70JPN.DLL" + File "${SYSTEMDIR}\MFC70KOR.DLL" +!ELSE + File "${SYSTEMDIR}\mfc42d.dll" + File "${SYSTEMDIR}\mfc42d.pdb" + File "${SYSTEMDIR}\msvcp60d.dll" + File "${SYSTEMDIR}\msvcp60d.pdb" + File "${SYSTEMDIR}\msvcrtd.dll" + File "${SYSTEMDIR}\msvcrtd.pdb" +!ENDIF +!ENDIF +!ELSE +!IFDEF CL_1310 + File "${SYSTEMDIR}\mfc71.dll" + File "${SYSTEMDIR}\msvcr71.dll" + File "${SYSTEMDIR}\msvcp71.dll" + File "${SYSTEMDIR}\MFC71CHS.DLL" + File "${SYSTEMDIR}\MFC71CHT.DLL" + File "${SYSTEMDIR}\MFC71DEU.DLL" + File "${SYSTEMDIR}\MFC71ENU.DLL" + File "${SYSTEMDIR}\MFC71ESP.DLL" + File "${SYSTEMDIR}\MFC71FRA.DLL" + File "${SYSTEMDIR}\MFC71ITA.DLL" + File "${SYSTEMDIR}\MFC71JPN.DLL" + File "${SYSTEMDIR}\MFC71KOR.DLL" +!ELSE +!IFDEF CL_1300 + File "${SYSTEMDIR}\mfc70.dll" + File "${SYSTEMDIR}\msvcr70.dll" + File "${SYSTEMDIR}\msvcp70.dll" + File "${SYSTEMDIR}\MFC70CHS.DLL" + File "${SYSTEMDIR}\MFC70CHT.DLL" + File "${SYSTEMDIR}\MFC70DEU.DLL" + File "${SYSTEMDIR}\MFC70ENU.DLL" + File "${SYSTEMDIR}\MFC70ESP.DLL" + File "${SYSTEMDIR}\MFC70FRA.DLL" + File "${SYSTEMDIR}\MFC70ITA.DLL" + File "${SYSTEMDIR}\MFC70JPN.DLL" + File "${SYSTEMDIR}\MFC70KOR.DLL" +!ELSE + File "${SYSTEMDIR}\mfc42.dll" + File "${SYSTEMDIR}\msvcp60.dll" + File "${SYSTEMDIR}\msvcrt.dll" +!ENDIF +!ENDIF +!ENDIF + +!ifdef DEBUG + File "${AFS_CLIENT_BUILDDIR}\afs_config.pdb" + File "${AFS_SERVER_BUILDDIR}\afsadminutil.pdb" + File "${AFS_DESTDIR}\lib\afsauthent.pdb" + File "${AFS_DESTDIR}\lib\afspthread.pdb" + File "${AFS_DESTDIR}\lib\afsrpc.pdb" + File "${AFS_SERVER_BUILDDIR}\afsclientadmin.pdb" + File "${AFS_SERVER_BUILDDIR}\afsprocmgmt.pdb" + File "${AFS_SERVER_BUILDDIR}\afsvosadmin.pdb" + File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib.pdb" + File "${AFS_SERVER_BUILDDIR}\afsvosadmin.pdb" + File "${AFS_SERVER_BUILDDIR}\afsbosadmin.pdb" + File "${AFS_SERVER_BUILDDIR}\afscfgadmin.pdb" + File "${AFS_SERVER_BUILDDIR}\afskasadmin.pdb" + File "${AFS_SERVER_BUILDDIR}\afsptsadmin.pdb" +!endif + + StrCmp $LANGUAGE ${LANG_ENGLISH} DoEnglish + StrCmp $LANGUAGE ${LANG_GERMAN} DoGerman + StrCmp $LANGUAGE ${LANG_SPANISH} DoSpanish + StrCmp $LANGUAGE ${LANG_JAPANESE} DoJapanese + StrCmp $LANGUAGE ${LANG_KOREAN} DoKorean + StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} DoPortugueseBR + StrCmp $LANGUAGE ${LANG_SIMPCHINESE} DoSimpChinese + StrCmp $LANGUAGE ${LANG_TRADCHINESE} DoTradChinese + +DoEnglish: + + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\en_US\README.TXT" + + SetOutPath "$INSTDIR\Client\Program" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1033.dll" "$INSTDIR\Client\Program\afscreds_1033.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1033.dll" "$INSTDIR\Client\Program\afs_shl_ext_1033.dll" "$INSTDIR" +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1033.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1033.pdb" +!endif + + SetOutPath "$INSTDIR\Common" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1033.dll" "$INSTDIR\Common\afs_config_1033.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1033.dll" "$INSTDIR\Common\afs_cpa_1033.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1033.dll" "$INSTDIR\Common\afseventmsg_1033.dll" "$INSTDIR" + ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1033.dll" "$INSTDIR\Common\afs_setup_utils_1033.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1033.dll" "$INSTDIR\Common\afsserver_1033.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1033.dll" "$INSTDIR\Common\afssvrcfg_1033.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1033.dll" "$INSTDIR\Common\TaAfsAccountManager_1033.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1033.dll" "$INSTDIR\Common\TaAfsAppLib_1033.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1033.dll" "$INSTDIR\Common\TaAfsServerManager_1033.dll" "$INSTDIR" + File "..\..\doc\help\en_US\afs-cc.CNT" + File "..\..\doc\help\en_US\afs-cc.hlp" + File "..\..\doc\help\en_US\afs-light.CNT" + File "..\..\doc\help\en_US\afs-light.hlp" + File "..\..\doc\help\en_US\afs-nt.CNT" + File "..\..\doc\help\en_US\afs-nt.HLP" + File "..\..\doc\help\en_US\taafscfg.CNT" + File "..\..\doc\help\en_US\taafscfg.hlp" + File "..\..\doc\help\en_US\taafssvrmgr.CNT" + File "..\..\doc\help\en_US\taafssvrmgr.hlp" + File "..\..\doc\help\en_US\taafsusrmgr.CNT" + File "..\..\doc\help\en_US\taafsusrmgr.hlp" + +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1033.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1033.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1033.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afsserver_1033.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1033.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1033.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1033.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1033.pdb" +!ENDIF + goto done + +DoGerman: + + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\de_DE\README.TXT" + + SetOutPath "$INSTDIR\Client\Program" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1032.dll" "$INSTDIR\Client\Program\afscreds_1032.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1032.dll" "$INSTDIR\Client\Program\afs_shl_ext_1032.dll" "$INSTDIR" +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1032.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1032.pdb" +!endif + + SetOutPath "$INSTDIR\Common" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1032.dll" "$INSTDIR\Common\afs_config_1032.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1032.dll" "$INSTDIR\Common\afs_cpa_1032.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1032.dll" "$INSTDIR\Common\afseventmsg_1032.dll" "$INSTDIR" + ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1032.dll" "$INSTDIR\Common\afs_setup_utils_1032.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1032.dll" "$INSTDIR\Common\afsserver_1032.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1032.dll" "$INSTDIR\Common\afssvrcfg_1032.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1032.dll" "$INSTDIR\Common\TaAfsAccountManager_1032.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1032.dll" "$INSTDIR\Common\TaAfsAppLib_1032.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1032.dll" "$INSTDIR\Common\TaAfsServerManager_1032.dll" "$INSTDIR" + File "..\..\doc\help\de_DE\afs-cc.CNT" + File "..\..\doc\help\de_DE\afs-cc.hlp" + File "..\..\doc\help\de_DE\afs-light.CNT" + File "..\..\doc\help\de_DE\afs-light.hlp" + File "..\..\doc\help\de_DE\afs-nt.CNT" + File "..\..\doc\help\de_DE\afs-nt.HLP" + File "..\..\doc\help\de_DE\taafscfg.CNT" + File "..\..\doc\help\de_DE\taafscfg.hlp" + File "..\..\doc\help\de_DE\taafssvrmgr.CNT" + File "..\..\doc\help\de_DE\taafssvrmgr.hlp" + File "..\..\doc\help\de_DE\taafsusrmgr.CNT" + File "..\..\doc\help\de_DE\taafsusrmgr.hlp" + +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1032.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1032.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1032.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afsserver_1032.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1032.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1032.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1032.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1032.pdb" +!ENDIF + goto done + +DoSpanish: + + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\es_ES\README.TXT" + + SetOutPath "$INSTDIR\Client\Program" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1034.dll" "$INSTDIR\Client\Program\afscreds_1034.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1034.dll" "$INSTDIR\Client\Program\afs_shl_ext_1034.dll" "$INSTDIR" +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1034.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1034.pdb" +!endif + + SetOutPath "$INSTDIR\Common" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1034.dll" "$INSTDIR\Common\afs_config_1034.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1034.dll" "$INSTDIR\Common\afs_cpa_1034.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1034.dll" "$INSTDIR\Common\afseventmsg_1034.dll" "$INSTDIR" + ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1034.dll" "$INSTDIR\Common\afs_setup_utils_1034.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1034.dll" "$INSTDIR\Common\afsserver_1034.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1034.dll" "$INSTDIR\Common\afssvrcfg_1034.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1034.dll" "$INSTDIR\Common\TaAfsAccountManager_1034.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1034.dll" "$INSTDIR\Common\TaAfsAppLib_1034.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1034.dll" "$INSTDIR\Common\TaAfsServerManager_1034.dll" "$INSTDIR" + File "..\..\doc\help\es_ES\afs-cc.CNT" + File "..\..\doc\help\es_ES\afs-cc.hlp" + File "..\..\doc\help\es_ES\afs-light.CNT" + File "..\..\doc\help\es_ES\afs-light.hlp" + File "..\..\doc\help\es_ES\afs-nt.CNT" + File "..\..\doc\help\es_ES\afs-nt.HLP" + File "..\..\doc\help\es_ES\taafscfg.CNT" + File "..\..\doc\help\es_ES\taafscfg.hlp" + File "..\..\doc\help\es_ES\taafssvrmgr.CNT" + File "..\..\doc\help\es_ES\taafssvrmgr.hlp" + File "..\..\doc\help\es_ES\taafsusrmgr.CNT" + File "..\..\doc\help\es_ES\taafsusrmgr.hlp" + +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1034.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1034.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1034.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afsserver_1034.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1034.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1034.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1034.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1034.pdb" +!ENDIF + goto done + +DoJapanese: + + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\ja_JP\README.TXT" + + SetOutPath "$INSTDIR\Client\Program" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1041.dll" "$INSTDIR\Client\Program\afscreds_1041.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1041.dll" "$INSTDIR\Client\Program\afs_shl_ext_1041.dll" "$INSTDIR" +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1041.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1041.pdb" +!endif + + SetOutPath "$INSTDIR\Common" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1041.dll" "$INSTDIR\Common\afs_config_1041.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1041.dll" "$INSTDIR\Common\afs_cpa_1041.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1041.dll" "$INSTDIR\Common\afseventmsg_1041.dll" "$INSTDIR" + ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1041.dll" "$INSTDIR\Common\afs_setup_utils_1041.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1041.dll" "$INSTDIR\Common\afsserver_1041.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1041.dll" "$INSTDIR\Common\afssvrcfg_1041.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1041.dll" "$INSTDIR\Common\TaAfsAccountManager_1041.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1041.dll" "$INSTDIR\Common\TaAfsAppLib_1041.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1041.dll" "$INSTDIR\Common\TaAfsServerManager_1041.dll" "$INSTDIR" + File "..\..\doc\help\ja_JP\afs-cc.CNT" + File "..\..\doc\help\ja_JP\afs-cc.hlp" + File "..\..\doc\help\ja_JP\afs-light.CNT" + File "..\..\doc\help\ja_JP\afs-light.hlp" + File "..\..\doc\help\ja_JP\afs-nt.CNT" + File "..\..\doc\help\ja_JP\afs-nt.HLP" + File "..\..\doc\help\ja_JP\taafscfg.CNT" + File "..\..\doc\help\ja_JP\taafscfg.hlp" + File "..\..\doc\help\ja_JP\taafssvrmgr.CNT" + File "..\..\doc\help\ja_JP\taafssvrmgr.hlp" + File "..\..\doc\help\ja_JP\taafsusrmgr.CNT" + File "..\..\doc\help\ja_JP\taafsusrmgr.hlp" + +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1041.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1041.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1041.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afsserver_1041.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1041.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1041.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1041.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1041.pdb" +!ENDIF + goto done + +DoKorean: + + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\ko_KR\README.TXT" + + SetOutPath "$INSTDIR\Client\Program" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1042.dll" "$INSTDIR\Client\Program\afscreds_1042.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1042.dll" "$INSTDIR\Client\Program\afs_shl_ext_1042.dll" "$INSTDIR" +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1042.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1042.pdb" +!endif + + SetOutPath "$INSTDIR\Common" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1042.dll" "$INSTDIR\Common\afs_config_1042.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1042.dll" "$INSTDIR\Common\afs_cpa_1042.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1042.dll" "$INSTDIR\Common\afseventmsg_1042.dll" "$INSTDIR" + ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1042.dll" "$INSTDIR\Common\afs_setup_utils_1042.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1042.dll" "$INSTDIR\Common\afsserver_1042.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1042.dll" "$INSTDIR\Common\afssvrcfg_1042.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1042.dll" "$INSTDIR\Common\TaAfsAccountManager_1042.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1042.dll" "$INSTDIR\Common\TaAfsAppLib_1042.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1042.dll" "$INSTDIR\Common\TaAfsServerManager_1042.dll" "$INSTDIR" + File "..\..\doc\help\ko_KR\afs-cc.CNT" + File "..\..\doc\help\ko_KR\afs-cc.hlp" + File "..\..\doc\help\ko_KR\afs-light.CNT" + File "..\..\doc\help\ko_KR\afs-light.hlp" + File "..\..\doc\help\ko_KR\afs-nt.CNT" + File "..\..\doc\help\ko_KR\afs-nt.HLP" + File "..\..\doc\help\ko_KR\taafscfg.CNT" + File "..\..\doc\help\ko_KR\taafscfg.hlp" + File "..\..\doc\help\ko_KR\taafssvrmgr.CNT" + File "..\..\doc\help\ko_KR\taafssvrmgr.hlp" + File "..\..\doc\help\ko_KR\taafsusrmgr.CNT" + File "..\..\doc\help\ko_KR\taafsusrmgr.hlp" + +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1042.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1042.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1042.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afsserver_1042.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1042.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1042.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1042.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1042.pdb" +!ENDIF + goto done + + +DoPortugueseBR: + + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\pt_BR\README.TXT" + + SetOutPath "$INSTDIR\Client\Program" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1046.dll" "$INSTDIR\Client\Program\afscreds_1046.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1046.dll" "$INSTDIR\Client\Program\afs_shl_ext_1046.dll" "$INSTDIR" +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1046.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1046.pdb" +!endif + + SetOutPath "$INSTDIR\Common" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1046.dll" "$INSTDIR\Common\afs_config_1046.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1046.dll" "$INSTDIR\Common\afs_cpa_1046.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1046.dll" "$INSTDIR\Common\afseventmsg_1046.dll" "$INSTDIR" + ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1046.dll" "$INSTDIR\Common\afs_setup_utils_1046.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1046.dll" "$INSTDIR\Common\afsserver_1046.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1046.dll" "$INSTDIR\Common\afssvrcfg_1046.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1046.dll" "$INSTDIR\Common\TaAfsAccountManager_1046.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1046.dll" "$INSTDIR\Common\TaAfsAppLib_1046.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1046.dll" "$INSTDIR\Common\TaAfsServerManager_1046.dll" "$INSTDIR" + File "..\..\doc\help\pt_BR\afs-cc.CNT" + File "..\..\doc\help\pt_BR\afs-cc.hlp" + File "..\..\doc\help\pt_BR\afs-light.CNT" + File "..\..\doc\help\pt_BR\afs-light.hlp" + File "..\..\doc\help\pt_BR\afs-nt.CNT" + File "..\..\doc\help\pt_BR\afs-nt.HLP" + File "..\..\doc\help\pt_BR\taafscfg.CNT" + File "..\..\doc\help\pt_BR\taafscfg.hlp" + File "..\..\doc\help\pt_BR\taafssvrmgr.CNT" + File "..\..\doc\help\pt_BR\taafssvrmgr.hlp" + File "..\..\doc\help\pt_BR\taafsusrmgr.CNT" + File "..\..\doc\help\pt_BR\taafsusrmgr.hlp" + +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1046.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1046.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1046.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afsserver_1046.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1046.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1046.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1046.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1046.pdb" +!ENDIF + goto done + +DoSimpChinese: + + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\zh_CN\README.TXT" + + SetOutPath "$INSTDIR\Client\Program" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_2052.dll" "$INSTDIR\Client\Program\afscreds_2052.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_2052.dll" "$INSTDIR\Client\Program\afs_shl_ext_2052.dll" "$INSTDIR" +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afscreds_2052.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_2052.pdb" +!endif + + SetOutPath "$INSTDIR\Common" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_2052.dll" "$INSTDIR\Common\afs_config_2052.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_2052.dll" "$INSTDIR\Common\afs_cpa_2052.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_2052.dll" "$INSTDIR\Common\afseventmsg_2052.dll" "$INSTDIR" + ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_2052.dll" "$INSTDIR\Common\afs_setup_utils_2052.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_2052.dll" "$INSTDIR\Common\afsserver_2052.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_2052.dll" "$INSTDIR\Common\afssvrcfg_2052.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_2052.dll" "$INSTDIR\Common\TaAfsAccountManager_2052.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_2052.dll" "$INSTDIR\Common\TaAfsAppLib_2052.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_2052.dll" "$INSTDIR\Common\TaAfsServerManager_2052.dll" "$INSTDIR" + File "..\..\doc\help\zh_CN\afs-cc.CNT" + File "..\..\doc\help\zh_CN\afs-cc.hlp" + File "..\..\doc\help\zh_CN\afs-light.CNT" + File "..\..\doc\help\zh_CN\afs-light.hlp" + File "..\..\doc\help\zh_CN\afs-nt.CNT" + File "..\..\doc\help\zh_CN\afs-nt.HLP" + File "..\..\doc\help\zh_CN\taafscfg.CNT" + File "..\..\doc\help\zh_CN\taafscfg.hlp" + File "..\..\doc\help\zh_CN\taafssvrmgr.CNT" + File "..\..\doc\help\zh_CN\taafssvrmgr.hlp" + File "..\..\doc\help\zh_CN\taafsusrmgr.CNT" + File "..\..\doc\help\zh_CN\taafsusrmgr.hlp" + +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afs_config_2052.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_2052.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_2052.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afsserver_2052.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_2052.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_2052.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_2052.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_2052.pdb" +!ENDIF + goto done + +DoTradChinese: + + SetOutPath "$INSTDIR\Documentation" + File "..\..\doc\install\Documentation\zh_TW\README.TXT" + + SetOutPath "$INSTDIR\Client\Program" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afscreds_1028.dll" "$INSTDIR\Client\Program\_1028.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1028.dll" "$INSTDIR\Client\Program\afs_shl_ext_1028.dll" "$INSTDIR" +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afscreds_1028.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_shl_ext_1028.pdb" +!endif + + SetOutPath "$INSTDIR\Common" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_config_1028.dll" "$INSTDIR\Common\afs_config_1028.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_CLIENT_BUILDDIR}\afs_cpa_1028.dll" "$INSTDIR\Common\afs_cpa_1028.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afseventmsg_1028.dll" "$INSTDIR\Common\afseventmsg_1028.dll" "$INSTDIR" + ;!insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afs_setup_utils_1028.dll" "$INSTDIR\Common\afs_setup_utils_1028.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afsserver_1028.dll" "$INSTDIR\Common\afsserver_1028.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\afssvrcfg_1028.dll" "$INSTDIR\Common\afssvrcfg_1028.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1028.dll" "$INSTDIR\Common\TaAfsAccountManager_1028.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1028.dll" "$INSTDIR\Common\TaAfsAppLib_1028.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1028.dll" "$INSTDIR\Common\TaAfsServerManager_1028.dll" "$INSTDIR" + File "..\..\doc\help\zh_TW\afs-cc.CNT" + File "..\..\doc\help\zh_TW\afs-cc.hlp" + File "..\..\doc\help\zh_TW\afs-light.CNT" + File "..\..\doc\help\zh_TW\afs-light.hlp" + File "..\..\doc\help\zh_TW\afs-nt.CNT" + File "..\..\doc\help\zh_TW\afs-nt.HLP" + File "..\..\doc\help\zh_TW\taafscfg.CNT" + File "..\..\doc\help\zh_TW\taafscfg.hlp" + File "..\..\doc\help\zh_TW\taafssvrmgr.CNT" + File "..\..\doc\help\zh_TW\taafssvrmgr.hlp" + File "..\..\doc\help\zh_TW\taafsusrmgr.CNT" + File "..\..\doc\help\zh_TW\taafsusrmgr.hlp" + +!ifdef DEBUG + ;File "${AFS_CLIENT_BUILDDIR}\afs_config_1028.pdb" + ;File "${AFS_CLIENT_BUILDDIR}\afs_cpa_1028.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afseventmsg_1028.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afsserver_1028.pdb" + ;File "${AFS_SERVER_BUILDDIR}\afssvrcfg_1028.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAccountManager_1028.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsAppLib_1028.pdb" + ;File "${AFS_SERVER_BUILDDIR}\TaAfsServerManager_1028.pdb" +!ENDIF + goto done + +done: +FunctionEnd + + + +;==================================================== +; AddToPath - Adds the given dir to the search path. +; Input - head of the stack +; Note - Win9x systems requires reboot +;==================================================== +Function AddToPath + Exch $0 + Push $1 + Push $2 + Push $3 + + # don't add if the path doesn't exist + IfFileExists $0 "" AddToPath_done + + ReadEnvStr $1 PATH + Push "$1;" + Push "$0;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + Push "$1;" + Push "$0\;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + GetFullPathName /SHORT $3 $0 + Push "$1;" + Push "$3;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + Push "$1;" + Push "$3\;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + + Call IsNT + Pop $1 + StrCmp $1 1 AddToPath_NT + ; Not on NT + StrCpy $1 $WINDIR 2 + FileOpen $1 "$1\autoexec.bat" a + FileSeek $1 -1 END + FileReadByte $1 $2 + IntCmp $2 26 0 +2 +2 # DOS EOF + FileSeek $1 -1 END # write over EOF + FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n" + FileClose $1 + SetRebootFlag true + Goto AddToPath_done + + AddToPath_NT: + ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" + StrCpy $2 $1 1 -1 # copy last char + StrCmp $2 ";" 0 +2 # if last char == ; + StrCpy $1 $1 -1 # remove last char + StrCmp $1 "" AddToPath_NTdoIt + StrCpy $0 "$1;$0" + AddToPath_NTdoIt: + WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $0 + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 + + AddToPath_done: + Pop $3 + Pop $2 + Pop $1 + Pop $0 +FunctionEnd + +;==================================================== +; RemoveFromPath - Remove a given dir from the path +; Input: head of the stack +;==================================================== +Function un.RemoveFromPath + Exch $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $5 + Push $6 + + IntFmt $6 "%c" 26 # DOS EOF + + Call un.IsNT + Pop $1 + StrCmp $1 1 unRemoveFromPath_NT + ; Not on NT + StrCpy $1 $WINDIR 2 + FileOpen $1 "$1\autoexec.bat" r + GetTempFileName $4 + FileOpen $2 $4 w + GetFullPathName /SHORT $0 $0 + StrCpy $0 "SET PATH=%PATH%;$0" + Goto unRemoveFromPath_dosLoop + + unRemoveFromPath_dosLoop: + FileRead $1 $3 + StrCpy $5 $3 1 -1 # read last char + StrCmp $5 $6 0 +2 # if DOS EOF + StrCpy $3 $3 -1 # remove DOS EOF so we can compare + StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine + StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine + StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine + StrCmp $3 "" unRemoveFromPath_dosLoopEnd + FileWrite $2 $3 + Goto unRemoveFromPath_dosLoop + unRemoveFromPath_dosLoopRemoveLine: + SetRebootFlag true + Goto unRemoveFromPath_dosLoop + + unRemoveFromPath_dosLoopEnd: + FileClose $2 + FileClose $1 + StrCpy $1 $WINDIR 2 + Delete "$1\autoexec.bat" + CopyFiles /SILENT $4 "$1\autoexec.bat" + Delete $4 + Goto unRemoveFromPath_done + + unRemoveFromPath_NT: + ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" + StrCpy $5 $1 1 -1 # copy last char + StrCmp $5 ";" +2 # if last char != ; + StrCpy $1 "$1;" # append ; + Push $1 + Push "$0;" + Call un.StrStr ; Find `$0;` in $1 + Pop $2 ; pos of our dir + StrCmp $2 "" unRemoveFromPath_done + ; else, it is in path + # $0 - path to add + # $1 - path var + StrLen $3 "$0;" + StrLen $4 $2 + StrCpy $5 $1 -$4 # $5 is now the part before the path to remove + StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove + StrCpy $3 $5$6 + + StrCpy $5 $3 1 -1 # copy last char + StrCmp $5 ";" 0 +2 # if last char == ; + StrCpy $3 $3 -1 # remove last char + + WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3 + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 + + unRemoveFromPath_done: + Pop $6 + Pop $5 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 +FunctionEnd + +;==================================================== +; IsNT - Returns 1 if the current system is NT, 0 +; otherwise. +; Output: head of the stack +;==================================================== +!macro IsNT un +Function ${un}IsNT + Push $0 + ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + StrCmp $0 "" 0 IsNT_yes + ; we are not NT. + Pop $0 + Push 0 + Return + + IsNT_yes: + ; NT!!! + Pop $0 + Push 1 +FunctionEnd +!macroend +!insertmacro IsNT "" +!insertmacro IsNT "un." + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Uninstall stuff +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;==================================================== +; StrStr - Finds a given string in another given string. +; Returns -1 if not found and the pos if found. +; Input: head of the stack - string to find +; second in the stack - string to find in +; Output: head of the stack +;==================================================== +!macro StrStr un +Function ${un}StrStr +Exch $R1 ; st=haystack,old$R1, $R1=needle + Exch ; st=old$R1,haystack + Exch $R2 ; st=old$R1,old$R2, $R2=haystack + Push $R3 + Push $R4 + Push $R5 + StrLen $R3 $R1 + StrCpy $R4 0 + ; $R1=needle + ; $R2=haystack + ; $R3=len(needle) + ; $R4=cnt + ; $R5=tmp + loop: + StrCpy $R5 $R2 $R3 $R4 + StrCmp $R5 $R1 done + StrCmp $R5 "" done + IntOp $R4 $R4 + 1 + Goto loop +done: + StrCpy $R1 $R2 "" $R4 + Pop $R5 + Pop $R4 + Pop $R3 + Pop $R2 + Exch $R1 +FunctionEnd +!macroend +!insertmacro StrStr "" +!insertmacro StrStr "un." + + +!ifdef ADDSHAREDDLLUSED +; AddSharedDLL + ; + ; Increments a shared DLLs reference count. + ; Use by passing one item on the stack (the full path of the DLL). + ; + ; Usage: + ; Push $SYSDIR\myDll.dll + ; Call AddSharedDLL + ; + + Function AddSharedDLL + Exch $R1 + Push $R0 + ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 + IntOp $R0 $R0 + 1 + WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0 + Pop $R0 + Pop $R1 + FunctionEnd + + +; un.RemoveSharedDLL + ; + ; Decrements a shared DLLs reference count, and removes if necessary. + ; Use by passing one item on the stack (the full path of the DLL). + ; Note: for use in the main installer (not the uninstaller), rename the + ; function to RemoveSharedDLL. + ; + ; Usage: + ; Push $SYSDIR\myDll.dll + ; Call un.RemoveSharedDLL + ; + + Function un.RemoveSharedDLL + Exch $R1 + Push $R0 + ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 + StrCmp $R0 "" remove + IntOp $R0 $R0 - 1 + IntCmp $R0 0 rk rk uk + rk: + DeleteRegValue HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 + goto Remove + uk: + WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0 + Goto noremove + remove: + Delete /REBOOTOK $R1 + noremove: + Pop $R0 + Pop $R1 + FunctionEnd +!endif + + + +!ifdef INSTALL_LOOPBACK +Function afs.InstallMSLoopback + GetTempFileName $R0 + File /oname=$R0 "loopback_install.dll" + nsExec::Exec "rundll32.exe $R0 doLoopBackEntry quiet" + Call GetWindowsVersion + Pop $R1 + StrCmp $R1 "2000" +1 +2 + nsExec::Exec "rundll32.exe $R0 disableLoopBackEntry" + Delete $R0 +FunctionEnd +!endif + + +; GetWindowsVersion +; +; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/ +; Updated by Joost Verburg +; +; Returns on top of stack +; +; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003) +; or +; '' (Unknown Windows Version) +; +; Usage: +; Call GetWindowsVersion +; Pop $R0 +; ; at this point $R0 is "NT 4.0" or whatnot + +Function GetWindowsVersion + + Push $R0 + Push $R1 + + ClearErrors + + ReadRegStr $R0 HKLM \ + "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + + IfErrors 0 lbl_winnt + + ; we are not NT + ReadRegStr $R0 HKLM \ + "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber + + StrCpy $R1 $R0 1 + StrCmp $R1 '4' 0 lbl_error + + StrCpy $R1 $R0 3 + + StrCmp $R1 '4.0' lbl_win32_95 + StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98 + + lbl_win32_95: + StrCpy $R0 '95' + Goto lbl_done + + lbl_win32_98: + StrCpy $R0 '98' + Goto lbl_done + + lbl_win32_ME: + StrCpy $R0 'ME' + Goto lbl_done + + lbl_winnt: + + StrCpy $R1 $R0 1 + + StrCmp $R1 '3' lbl_winnt_x + StrCmp $R1 '4' lbl_winnt_x + + StrCpy $R1 $R0 3 + + StrCmp $R1 '5.0' lbl_winnt_2000 + StrCmp $R1 '5.1' lbl_winnt_XP + StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error + + lbl_winnt_x: + StrCpy $R0 "NT $R0" 6 + Goto lbl_done + + lbl_winnt_2000: + Strcpy $R0 '2000' + Goto lbl_done + + lbl_winnt_XP: + Strcpy $R0 'XP' + Goto lbl_done + + lbl_winnt_2003: + Strcpy $R0 '2003' + Goto lbl_done + + lbl_error: + Strcpy $R0 '' + lbl_done: + + Pop $R1 + Exch $R0 + +FunctionEnd + + +; Author: Lilla (lilla@earthlink.net) 2003-06-13 +; function IsUserAdmin uses plugin \NSIS\PlusgIns\UserInfo.dll +; This function is based upon code in \NSIS\Contrib\UserInfo\UserInfo.nsi +; This function was tested under NSIS 2 beta 4 (latest CVS as of this writing). +; +; Usage: +; Call IsUserAdmin +; Pop $R0 ; at this point $R0 is "true" or "false" +; +Function IsUserAdmin +Push $R0 +Push $R1 +Push $R2 + +ClearErrors +UserInfo::GetName +IfErrors Win9x +Pop $R1 +UserInfo::GetAccountType +Pop $R2 + +StrCmp $R2 "Admin" 0 Continue +; Observation: I get here when running Win98SE. (Lilla) +; The functions UserInfo.dll looks for are there on Win98 too, +; but just don't work. So UserInfo.dll, knowing that admin isn't required +; on Win98, returns admin anyway. (per kichik) +; MessageBox MB_OK 'User "$R1" is in the Administrators group' +StrCpy $R0 "true" +Goto Done + +Continue: +; You should still check for an empty string because the functions +; UserInfo.dll looks for may not be present on Windows 95. (per kichik) +StrCmp $R2 "" Win9x +StrCpy $R0 "false" +;MessageBox MB_OK 'User "$R1" is in the "$R2" group' +Goto Done + +Win9x: +; comment/message below is by UserInfo.nsi author: +; This one means you don't need to care about admin or +; not admin because Windows 9x doesn't either +;MessageBox MB_OK "Error! This DLL can't run under Windows 9x!" +StrCpy $R0 "false" + +Done: +;MessageBox MB_OK 'User= "$R1" AccountType= "$R2" IsUserAdmin= "$R0"' + +Pop $R2 +Pop $R1 +Exch $R0 +FunctionEnd + +; GetParent + ; input, top of stack (e.g. C:\Program Files\Poop) + ; output, top of stack (replaces, with e.g. C:\Program Files) + ; modifies no other variables. + ; + ; Usage: + ; Push "C:\Program Files\Directory\Whatever" + ; Call GetParent + ; Pop $R0 + ; ; at this point $R0 will equal "C:\Program Files\Directory" + +Function GetParent + + Exch $R0 + Push $R1 + Push $R2 + Push $R3 + + StrCpy $R1 0 + StrLen $R2 $R0 + + loop: + IntOp $R1 $R1 + 1 + IntCmp $R1 $R2 get 0 get + StrCpy $R3 $R0 1 -$R1 + StrCmp $R3 "\" get + Goto loop + + get: + StrCpy $R0 $R0 -$R1 + + Pop $R3 + Pop $R2 + Pop $R1 + Exch $R0 + +FunctionEnd + + +;-------------------------------- +;Handle what must and what must not be installed +Function .onSelChange + ; If they install the server, they MUST install the client + SectionGetFlags ${secServer} $R0 + IntOp $R0 $R0 & ${SF_SELECTED} + StrCmp $R0 "1" MakeClientSelected + + ; If they install the control center, we'll give them the client. + ; It may not be required, but it's a bit more useful + SectionGetFlags ${secControl} $R0 + IntOp $R0 $R0 & ${SF_SELECTED} + StrCmp $R0 "1" MakeClientSelected + goto end + +MakeClientSelected: + SectionGetFlags ${secClient} $R0 + IntOp $R0 $R0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $R0 + +end: +FunctionEnd + +Function RegWriteMultiStr +!define HKEY_CLASSES_ROOT 0x80000000 +!define HKEY_CURRENT_USER 0x80000001 +!define HKEY_LOCAL_MACHINE 0x80000002 +!define HKEY_USERS 0x80000003 +!define HKEY_PERFORMANCE_DATA 0x80000004 +!define HKEY_PERFORMANCE_TEXT 0x80000050 +!define HKEY_PERFORMANCE_NLSTEXT 0x80000060 +!define HKEY_CURRENT_CONFIG 0x80000005 +!define HKEY_DYN_DATA 0x80000006 + +!define KEY_QUERY_VALUE 0x0001 +!define KEY_SET_VALUE 0x0002 +!define KEY_CREATE_SUB_KEY 0x0004 +!define KEY_ENUMERATE_SUB_KEYS 0x0008 +!define KEY_NOTIFY 0x0010 +!define KEY_CREATE_LINK 0x0020 + +!define REG_NONE 0 +!define REG_SZ 1 +!define REG_EXPAND_SZ 2 +!define REG_BINARY 3 +!define REG_DWORD 4 +!define REG_DWORD_LITTLE_ENDIAN 4 +!define REG_DWORD_BIG_ENDIAN 5 +!define REG_LINK 6 +!define REG_MULTI_SZ 7 + +!define RegCreateKey "Advapi32::RegCreateKeyA(i, t, *i) i" +!define RegSetValueEx "Advapi32::RegSetValueExA(i, t, i, i, i, i) i" +!define RegCloseKey "Advapi32::RegCloseKeyA(i) i" + + Exch $R0 + Push $1 + Push $2 + Push $9 + + SetPluginUnload alwaysoff + ; Create a buffer for the multi_sz value + System::Call "*(&t${NSIS_MAX_STRLEN}) i.r1" + ; Open/create the registry key + System::Call "${RegCreateKey}(${HKEY_LOCAL_MACHINE}, '$REG_SUB_KEY', .r0) .r9" + ; Failed? + IntCmp $9 0 write + MessageBox MB_OK|MB_ICONSTOP "Can't create registry key! ($9)" + Goto noClose + + write: + ; Fill in the buffer with our strings + StrCpy $2 $1 ; Initial position + + StrLen $9 '$REG_DATA_1' ; Length of first string + IntOp $9 $9 + 1 ; Plus null + System::Call "*$2(&t$9 '$REG_DATA_1')" ; Place the string + IntOp $2 $2 + $9 ; Advance to the next position + + StrCmp '$REG_DATA_2' "" terminate + StrLen $9 '$REG_DATA_2' ; Length of second string + IntOp $9 $9 + 1 ; Plus null + System::Call "*$2(&t$9 '$REG_DATA_2')" ; Place the string + IntOp $2 $2 + $9 ; Advance to the next position + + StrCmp '$REG_DATA_3' "" terminate + StrLen $9 '$REG_DATA_3' ; Length of third string + IntOp $9 $9 + 1 ; Plus null + System::Call "*$2(&t$9 '$REG_DATA_3')" ; Place the string + IntOp $2 $2 + $9 ; Advance to the next position + + terminate: + System::Call "*$2(&t1 '')" ; Place the terminating null + IntOp $2 $2 + 1 ; Advance to the next position + + ; Create/write the value + IntOp $2 $2 - $1 ; Total length + System::Call "${RegSetValueEx}(r0, '$REG_VALUE', 0, ${REG_MULTI_SZ}, r1, r2) .r9" + ; Failed? + IntCmp $9 0 done + MessageBox MB_OK|MB_ICONSTOP "Can't set key value! ($9)" + Goto done + + done: + ; Close the registry key + System::Call "${RegCloseKey}(r0)" + +noClose: + ; Clear the buffer + SetPluginUnload manual + System::Free $1 + + Pop $9 + Pop $2 + Pop $1 + Exch $R0 +FunctionEnd \ No newline at end of file diff --git a/src/WINNT/install/NSIS/Service.cpp b/src/WINNT/install/NSIS/Service.cpp new file mode 100644 index 000000000..4833fc783 --- /dev/null +++ b/src/WINNT/install/NSIS/Service.cpp @@ -0,0 +1,63 @@ +/* + Service Installer for NSIS script + + Rob Murawski + + Released under terms of IBM Open Source agreement for OpenAFS + + */ + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + if(argc<3) + { + printf("Insufficient arguments: Service ServiceName ServicePath DisplayName.\n"); + return 1; + } + + SC_HANDLE hSCM = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE); + SC_HANDLE hService; + + if(hSCM == NULL) + { + printf("Could not open Service Control Manager. Aborting.\n"); + return 1; + } + + + if(*argv[1]!='u' && *argv[1]!='U') + { + hService = CreateService(hSCM, argv[1], + _T(argv[3]), + SERVICE_ALL_ACCESS, + SERVICE_WIN32_OWN_PROCESS, + SERVICE_AUTO_START, + SERVICE_ERROR_IGNORE, + argv[2], + NULL,NULL,NULL, NULL, NULL ); + + if (hService == NULL) + { + printf("Create Service failed (%d)\n", GetLastError() ); + CloseServiceHandle(hSCM); + } + } + else + { + hService = OpenService( hSCM, argv[2], DELETE); + if(hService!=NULL) + DeleteService( hService ); + } + + CloseServiceHandle(hService); + + + CloseServiceHandle(hService); + CloseServiceHandle(hSCM); + + return 0; +} diff --git a/src/WINNT/install/NSIS/ServiceLib.nsh b/src/WINNT/install/NSIS/ServiceLib.nsh new file mode 100644 index 000000000..bf07a7fb6 --- /dev/null +++ b/src/WINNT/install/NSIS/ServiceLib.nsh @@ -0,0 +1,342 @@ + +; NSIS SERVICE LIBRARY - servicelib.nsh +; Version 1.2 - 02/29/2004 +; Questions/Comments - dselkirk@hotmail.com +; +; Description: +; Provides an interface to window services +; +; Inputs: +; action - systemlib action ie. create, delete, start, stop, pause, +; continue, installed, running, status +; name - name of service to manipulate +; param - action parameters; usage: var1=value1;var2=value2;...etc. +; +; Actions: +; create - creates a new windows service +; Parameters: +; path - path to service executable +; autostart - automatically start with system ie. 1|0 +; interact - interact with the desktop ie. 1|0 +; machine - machine name where to install service +; user - user that runs the service +; password - password of the above user +; +; delete - deletes a windows service +; start - start a stopped windows service +; stop - stops a running windows service +; pause - pauses a running windows service +; continue - continues a paused windows service +; installed - is the provided service installed +; Parameters: +; action - if true then invokes the specified action +; running - is the provided service running +; Parameters: +; action - if true then invokes the specified action +; status - check the status of the provided service +; +; If run from uninstall define "UN" as "un." gefore running. +; +; Usage: +; Method 1: +; Push "action" +; Push "name" +; Push "param" +; Call Service +; Pop $0 ;response +; +; Method 2: +; !insertmacro SERVICE "action" "name" "param" +; +; History: +; 1.0 - 09/15/2003 - Initial release +; 1.1 - 09/16/2003 - Changed &l to i, thx brainsucker +; 1.2 - 02/29/2004 - Fixed documentation. + +!ifndef SERVICELIB + !define SERVICELIB + + !define SC_MANAGER_ALL_ACCESS 0x3F + !define SERVICE_ALL_ACCESS 0xF01FF + + !define SERVICE_CONTROL_STOP 1 + !define SERVICE_CONTROL_PAUSE 2 + !define SERVICE_CONTROL_CONTINUE 3 + + !define SERVICE_STOPPED 0x1 + !define SERVICE_START_PENDING 0x2 + !define SERVICE_STOP_PENDING 0x3 + !define SERVICE_RUNNING 0x4 + !define SERVICE_CONTINUE_PENDING 0x5 + !define SERVICE_PAUSE_PENDING 0x6 + !define SERVICE_PAUSED 0x7 + + !ifndef UN + !define UN "" + !endif + + !macro SERVICE ACTION NAME PARAM + Push '${ACTION}' + Push '${NAME}' + Push '${PARAM}' + Call ${UN}Service + !macroend + + !macro FUNC_GETPARAM + Push $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $5 + Push $6 + Push $7 + Exch 8 + Pop $1 ;name + Exch 8 + Pop $2 ;source + StrCpy $0 "" + StrLen $7 $2 + StrCpy $3 0 + lbl_loop: + IntCmp $3 $7 0 0 lbl_done + StrLen $4 "$1=" + StrCpy $5 $2 $4 $3 + StrCmp $5 "$1=" 0 lbl_next + IntOp $5 $3 + $4 + StrCpy $3 $5 + lbl_loop2: + IntCmp $3 $7 0 0 lbl_done + StrCpy $6 $2 1 $3 + StrCmp $6 ";" 0 lbl_next2 + IntOp $6 $3 - $5 + StrCpy $0 $2 $6 $5 + Goto lbl_done + lbl_next2: + IntOp $3 $3 + 1 + Goto lbl_loop2 + lbl_next: + IntOp $3 $3 + 1 + Goto lbl_loop + lbl_done: + Pop $5 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Exch 2 + Pop $6 + Pop $7 + Exch $0 + !macroend + + !macro CALL_GETPARAM VAR NAME DEFAULT LABEL + Push $1 + Push ${NAME} + Call ${UN}GETPARAM + Pop $6 + StrCpy ${VAR} "${DEFAULT}" + StrCmp $6 "" "${LABEL}" 0 + StrCpy ${VAR} $6 + !macroend + + !macro FUNC_SERVICE UN + Push $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $5 + Push $6 + Push $7 + Exch 8 + Pop $1 ;param + Exch 8 + Pop $2 ;name + Exch 8 + Pop $3 ;action + ;$0 return + ;$4 OpenSCManager + ;$5 OpenService + + + StrCpy $0 "false" + System::Call 'advapi32::OpenSCManagerA(n, n, i ${SC_MANAGER_ALL_ACCESS}) i.r4' + IntCmp $4 0 lbl_done + StrCmp $3 "create" lbl_create + System::Call 'advapi32::OpenServiceA(i r4, t r2, i ${SERVICE_ALL_ACCESS}) i.r5' + IntCmp $5 0 lbl_done + + lbl_select: + StrCmp $3 "delete" lbl_delete + StrCmp $3 "start" lbl_start + StrCmp $3 "stop" lbl_stop + StrCmp $3 "pause" lbl_pause + StrCmp $3 "continue" lbl_continue + StrCmp $3 "installed" lbl_installed + StrCmp $3 "running" lbl_running + StrCmp $3 "status" lbl_status + Goto lbl_done + + ; create service + lbl_create: + Push $R1 ;machine + Push $R2 ;user + Push $R3 ;password + Push $R4 ;interact + Push $R5 ;autostart + Push $R6 ;path + + !insertmacro CALL_GETPARAM $R1 "machine" "n" "lbl_machine" + lbl_machine: + + !insertmacro CALL_GETPARAM $R2 "user" "n" "lbl_user" + lbl_user: + + !insertmacro CALL_GETPARAM $R3 "password" "n" "lbl_password" + lbl_password: + + !insertmacro CALL_GETPARAM $R4 "interact" "0x10" "lbl_interact" + StrCpy $6 0x10 + IntCmp $R4 0 +2 + IntOp $R4 $6 | 0x100 + StrCpy $R4 $6 + lbl_interact: + + !insertmacro CALL_GETPARAM $R5 "autostart" "0x3" "lbl_autostart" + StrCpy $6 0x3 + IntCmp $R5 0 +2 + StrCpy $6 0x2 + StrCpy $R5 $6 + lbl_autostart: + + !insertmacro CALL_GETPARAM $R6 "path" "n" "lbl_path" + lbl_path: + + System::Call 'advapi32::CreateServiceA(i r4, t r2, t r2, i ${SERVICE_ALL_ACCESS}, i R4, i R5, i 0, t R6, n, n, R1, R2, R3) i.r6' + Pop $R6 + Pop $R5 + Pop $R4 + Pop $R3 + Pop $R2 + Pop $R1 + StrCmp $6 0 lbl_done lbl_good + + ; delete service + lbl_delete: + System::Call 'advapi32::DeleteService(i r5) i.r6' + StrCmp $6 0 lbl_done lbl_good + + ; start service + lbl_start: + System::Call 'advapi32::StartServiceA(i r5, i 0, i 0) i.r6' + StrCmp $6 0 lbl_done lbl_good + + ; stop service + lbl_stop: + Push $R1 + System::Call '*(i,i,i,i,i,i,i) i.R1' + System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_STOP}, i $R1) i' + System::Free $R1 + Pop $R1 + StrCmp $6 0 lbl_done lbl_good + + ; pause service + lbl_pause: + Push $R1 + System::Call '*(i,i,i,i,i,i,i) i.R1' + System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_PAUSE}, i $R1) i' + System::Free $R1 + Pop $R1 + StrCmp $6 0 lbl_done lbl_good + + ; continue service + lbl_continue: + Push $R1 + System::Call '*(i,i,i,i,i,i,i) i.R1' + System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_CONTINUE}, i $R1) i' + System::Free $R1 + Pop $R1 + StrCmp $6 0 lbl_done lbl_good + + ; is installed + lbl_installed: + !insertmacro CALL_GETPARAM $7 "action" "" "lbl_good" + StrCpy $3 $7 + Goto lbl_select + + ; is service running + lbl_running: + Push $R1 + System::Call '*(i,i,i,i,i,i,i) i.R1' + System::Call 'advapi32::QueryServiceStatus(i r5, i $R1) i' + System::Call '*$R1(i, i.r6)' + System::Free $R1 + Pop $R1 + IntFmt $6 "0x%X" $6 + StrCmp $6 ${SERVICE_RUNNING} 0 lbl_done + !insertmacro CALL_GETPARAM $7 "action" "" "lbl_good" + StrCpy $3 $7 + Goto lbl_select + + lbl_status: + Push $R1 + System::Call '*(i,i,i,i,i,i,i) i.R1' + System::Call 'advapi32::QueryServiceStatus(i r5, i $R1) i' + System::Call '*$R1(i, i .r6)' + System::Free $R1 + Pop $R1 + IntFmt $6 "0x%X" $6 + StrCpy $0 "running" + IntCmp $6 ${SERVICE_RUNNING} lbl_done + StrCpy $0 "stopped" + IntCmp $6 ${SERVICE_STOPPED} lbl_done + StrCpy $0 "start_pending" + IntCmp $6 ${SERVICE_START_PENDING} lbl_done + StrCpy $0 "stop_pending" + IntCmp $6 ${SERVICE_STOP_PENDING} lbl_done + StrCpy $0 "running" + IntCmp $6 ${SERVICE_RUNNING} lbl_done + StrCpy $0 "continue_pending" + IntCmp $6 ${SERVICE_CONTINUE_PENDING} lbl_done + StrCpy $0 "pause_pending" + IntCmp $6 ${SERVICE_PAUSE_PENDING} lbl_done + StrCpy $0 "paused" + IntCmp $6 ${SERVICE_PAUSED} lbl_done + StrCpy $0 "unknown" + + lbl_good: + StrCpy $0 "true" + lbl_done: + IntCmp $5 0 +2 + System::Call 'advapi32::CloseServiceHandle(i r5) n' + IntCmp $4 0 +2 + System::Call 'advapi32::CloseServiceHandle(i r4) n' + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Exch 3 + Pop $5 + Pop $6 + Pop $7 + Exch $0 + !macroend + + Function Service + !insertmacro FUNC_SERVICE "" + FunctionEnd + + Function un.Service + !insertmacro FUNC_SERVICE "un." + FunctionEnd + + Function GetParam + !insertmacro FUNC_GETPARAM + FunctionEnd + + Function un.GetParam + !insertmacro FUNC_GETPARAM + FunctionEnd + +!endif diff --git a/src/WINNT/install/NSIS/afsdcell.ini b/src/WINNT/install/NSIS/afsdcell.ini new file mode 100644 index 000000000..6d43dc846 --- /dev/null +++ b/src/WINNT/install/NSIS/afsdcell.ini @@ -0,0 +1,483 @@ +>grand.central.org #GCO Public CellServDB 11 May 2004 +18.7.14.88 #grand-opening.mit.edu +128.2.191.224 #penn.central.org +>wu-wien.ac.at #University of Economics, Vienna, Austria +137.208.3.33 #afsdb1.wu-wien.ac.at +137.208.7.4 #afsdb2.wu-wien.ac.at +137.208.7.7 #afsdb3.wu-wien.ac.at +>hephy.at #hephy-vienna +193.170.243.10 #mowgli.oeaw.ac.at +193.170.243.12 #baloo.oeaw.ac.at +193.170.243.14 #akela.oeaw.ac.at +>itp.tugraz.at #Institute for Theoretical Physics, TU Graz, Austria +129.27.157.6 #fubphsv2.tu-graz.ac.at +129.27.161.7 #faepsv01.tu-graz.ac.at +129.27.161.15 #faepsv02.tu-graz.ac.at +>cern.ch #European Laboratory for Particle Physics, Geneva +137.138.128.148 #afsdb1.cern.ch +137.138.246.50 #afsdb3.cern.ch +137.138.246.51 #afsdb2.cern.ch +>ams.cern.ch #AMS Experiment +137.138.206.77 #pcamsf2.cern.ch +137.138.206.123 #pcamsf4.cern.ch +>ethz.ch #Swiss Federal Inst. of Tech. - Zurich, Switzerland +129.132.97.19 #amalthea.ethz.ch +129.132.97.27 #nethzafs-001.ethz.ch +129.132.115.3 #himalia.ethz.ch +129.132.115.37 #nethzafs-005.ethz.ch +129.132.115.38 #nethzafs-006.ethz.ch +>psi.ch #Paul Scherrer Institut - Villigen, Switzerland +129.129.16.10 #afs1.psi.ch +129.129.16.11 #afs2.psi.ch +>extundo.com #Simon Josefsson's cell +195.42.214.241 #slipsten.extundo.com +>mekinok.com #Mekinok, Inc. +4.36.43.98 #loggerhead.mekinok.com +>membrain.com #membrain.com +66.93.118.125 #stormy +130.85.24.11 #weasel +130.85.24.13 #straykitten +>midnightlinux.com #Midnight Linux, Pittsburgh PA +66.93.62.18 #romulus.midnihtlinux.com +66.93.62.20 #yar.midnightlinux.com +>setfilepointer.com #SetFilePointer.com +63.224.10.2 #hamlet.SetFilePointer.com +63.224.10.4 #troilus.SetFilePointer.com +>sodre.cx #Sodre.cx +128.8.140.165 #greed.sodre.cx +>desy.de #Deutsches Elektronen-Synchrotron +131.169.40.62 #vayu.desy.de +131.169.244.60 #solar00.desy.de +>gppc.de #GPP Chemnitz mbH +213.187.92.33 #gpp1.gppc.de +213.187.92.34 #paulchen.gppc.de +213.187.92.35 #lotus.gppc.de +>ifh.de #DESY Zeuthen +141.34.22.10 #romulus.ifh.de +141.34.22.11 #remus.ifh.de +141.34.22.29 #hekate.ifh.de +>lrz-muenchen.de #Leibniz Computing Centre, Germany +129.187.10.36 #afs1.lrz-muenchen.de +129.187.10.56 #afs3.lrz-muenchen.de +129.187.10.57 #afs2.lrz-muenchen.de +>ipp-garching.mpg.de #Institut fuer Plasmaphysik +130.183.9.5 #afs-db1.rzg.mpg.de +130.183.100.10 #afs-db2.aug.ipp-garching.mpg.de +130.183.100.23 #afs-db3.aug.ipp-garching.mpg.de +>mpe.mpg.de #MPE cell +130.183.130.7 #irafs1.mpe-garching.mpg.de +130.183.134.20 #irafs2.mpe-garching.mpg.de +>i1.informatik.rwth-aachen.de #Informatik I, RWTH Aachen +137.226.244.79 #remus.informatik.rwth-aachen.de +>tu-chemnitz.de #Technische Universitaet Chemnitz, Germany +134.109.2.1 #zuse.hrz.tu-chemnitz.de +134.109.2.15 #phoenix.hrz.tu-chemnitz.de +134.109.200.7 #aetius.hrz.tu-chemnitz.de +>e18.ph.tum.de #Experimental Physics, TU Munich, Germany +129.187.154.223 #hamlet.e18.physik.tu-muenchen.de +>uni-bonn.de #Cell name +131.220.14.198 #work15-eth.rhrz.uni-bonn.de +131.220.14.203 #node03-en2.rhrz.uni-bonn.de +131.220.14.205 #node05.rhrz.uni-bonn.de +>uni-freiburg.de #Albert-Ludwigs-Universitat Freiburg +132.230.6.235 #sv6.ruf.uni-freiburg.de +132.230.6.236 #sv7.ruf.uni-freiburg.de +132.230.6.237 #sv8.ruf.uni-freiburg.de +>physik.uni-freiburg.de #institute of physics, university Freiburg, Germany +132.230.77.16 #hepafs.physik.uni-freiburg.de +>urz.uni-heidelberg.de #Uni Heidelberg (Rechenzentrum) +129.206.119.10 #afsdb.urz.uni-heidelberg.de +129.206.119.16 #afsdb1.urz.uni-heidelberg.de +129.206.119.17 #afsdb2.urz.uni-heidelberg.de +>uni-hohenheim.de #University of Hohenheim +144.41.2.2 #rs13.serv.uni-hohenheim.de +144.41.2.3 #rs14.serv.uni-hohenheim.de +144.41.2.4 #rs15.serv.uni-hohenheim.de +>rz.uni-jena.de #Rechenzentrum University of Jena, Germany +141.35.2.160 #lc00.rz.uni-jena.de +141.35.7.9 #fsuj01.rz.uni-jena.de +141.35.7.10 #zaphod.rz.uni-jena +>meteo.uni-koeln.de #Univ. of Cologne - Inst. for Geophysics & Meteorology +134.95.144.22 #afs1.meteo.uni-koeln.de +134.95.144.24 #afs2.meteo.uni-koeln.de +>rrz.uni-koeln.de #University of Cologne - Reg Comp Center +134.95.19.3 #afsdb1.rrz.uni-koeln.de +134.95.19.30 #fileserv3.rrz.uni-koeln.de +134.95.67.97 #afs.thp.uni-koeln.de +134.95.140.190 #rzkbserv.rrz.uni-koeln.de +>physik.uni-mainz.de #institute of physics, university Mainz, Germany +134.93.130.93 #hardy.physik.uni-mainz.de +>uni-mannheim.de #Uni Mannheim (Rechenzentrum) +134.155.50.165 #afsdbx.uni-mannheim.de +134.155.50.166 #afsdby.uni-mannheim.de +134.155.50.167 #afsdbz.uni-mannheim.de +>physik.uni-wuppertal.de #Physics department of Bergische Universität Wuppertal +132.195.104.3 #afs1.physik.uni-wuppertal.de +132.195.104.230 #afs2.physik.uni-wuppertal.de +>ies.auc.dk #Aalborg Univ., Inst. of Electronic Systems, Denmark +130.225.51.73 #afsdb1.kom.auc.dk +130.225.51.74 #afsdb2.kom.auc.dk +130.225.51.85 #afsdb3.kom.auc.dk +>hep.caltech.edu #CalTech High Energy Physics +131.215.126.150 #afs.hep.caltech.edu +>andrew.cmu.edu #Carnegie Mellon University - Computing Services Cell +128.2.10.2 #vice2.fs.andrew.cmu.edu +128.2.10.7 #vice7.fs.andrew.cmu.edu +128.2.10.11 #vice11.fs.andrew.cmu.edu +128.2.10.28 #vice28.fs.andrew.cmu.edu +128.2.32.44 #new-vice12.fs.andrew.cmu.edu +>club.cc.cmu.edu #Carnegie Mellon University Computer Club +128.2.4.131 #yttrium.club.cc.cmu.edu +128.2.4.132 #zirconium.club.cc.cmu.edu +>chem.cmu.edu #Carnegie Mellon University - Chemistry Dept. +128.2.40.134 #afs.chem.cmu.edu +128.2.40.140 #afs2.chem.cmu.edu +>cs.cmu.edu #Carnegie Mellon University - School of Comp. Sci. +128.2.194.178 #cherry.srv.cs.cmu.edu +128.2.194.179 #pumpkin.srv.cs.cmu.edu +128.2.194.180 #strawberry.srv.cs.cmu.edu +>ece.cmu.edu #Carnegie Mellon University - Elec. Comp. Eng. Dept. +128.2.129.7 #porok.ece.cmu.edu +128.2.129.8 #vicio.ece.cmu.edu +128.2.129.9 #e-xing.ece.cmu.edu +>scotch.ece.cmu.edu #CMU ECE CALCM research group +128.2.134.82 #lagavulin.ece.cmu.edu +>msc.cornell.edu #Cornell University Materials Science Center +128.84.231.242 #miranda.ccmr.cornell.edu +128.84.241.35 #co.ccmr.cornell.edu +128.84.249.78 #dax.ccmr.cornell.edu +>dbic.dartmouth.edu #Dartmouth Brain Imaging Center +129.170.30.143 #dbicafs1.dartmouth.edu +129.170.30.144 #dbicafs2.dartmouth.edu +129.170.30.145 #dbicafs3.dartmouth.edu +>northstar.dartmouth.edu #Dartmouth College Research Computing +129.170.16.22 #halley.dartmouth.edu +129.170.16.42 #oort.dartmouth.edu +129.170.16.43 #cygnusx1.dartmouth.edu +>iastate.edu #Iowa State University +129.186.1.243 #afsdb-1.iastate.edu +129.186.6.243 #afsdb-2.iastate.edu +129.186.142.243 #afsdb-3.iastate.edu +>athena.mit.edu #MIT/Athena cell +18.7.1.66 #paris.mit.edu. +18.7.1.74 #chimera.mit.edu. +18.158.0.37 #prill.mit.edu. +>dev.mit.edu #MIT/IS Development cell +18.7.1.70 #wham.mit.edu. +18.7.15.89 #rattle.mit.edu. +18.7.15.93 #hum.mit.edu. +>net.mit.edu #MIT/Network Group cell +18.7.7.73 #gracie.mit.edu +18.7.21.95 #george.mit.edu +>sipb.mit.edu #MIT/SIPB cell +18.181.0.19 #reynelda.mit.edu. +18.181.0.22 #rosebud.mit.edu. +18.181.0.23 #ronald-ann.mit.edu. +>msu.edu #Michigan State University Main Cell +35.9.7.10 #afsdb0.cl.msu.edu +>nd.edu #University of Notre Dame +129.74.223.17 #john.helios.nd.edu +129.74.223.33 #lizardo.helios.nd.edu +129.74.223.65 #buckaroo.helios.nd.edu +>pitt.edu #University of Pittsburgh +136.142.8.15 #afs09.srv.cis.pitt.edu +136.142.8.20 #afs10.srv.cis.pitt.edu +136.142.8.21 #afs11.srv.cis.pitt.edu +>cs.pitt.edu #University of Pittsburgh - Computer Science +130.49.220.11 #afs01.cs.pitt.edu +130.49.220.12 #afs02.cs.pitt.edu +130.49.220.13 #afs03.cs.pitt.edu +>psc.edu #PSC (Pittsburgh Supercomputing Center) +128.182.59.182 #shaggy.psc.edu +128.182.66.184 #velma.psc.edu +128.182.66.185 #daphne.psc.edu +>scoobydoo.psc.edu #PSC Test Cell +128.182.59.181 #scooby.psc.edu +>cede.psu.edu #Penn State - Center for Engr. Design & Entrepeneurship +146.186.218.10 #greenly.cede.psu.edu +146.186.218.60 #b50.cede.psu.edu +146.186.218.246 #stalin.cede.psu.edu +>rose-hulman.edu #Rose-Hulman Institute of Technology +137.112.7.11 #afs1.rose-hulman.edu +137.112.7.12 #afs2.rose-hulman.edu +137.112.7.13 #afs3.rose-hulman.edu +>cs.rose-hulman.edu #Rose-Hulman CS Department +137.112.40.10 #galaxy.cs.rose-hulman.edu +>rpi.edu #Rensselaer Polytechnic Institute +128.113.22.11 #saul.server.rpi.edu +128.113.22.12 #joab.server.rpi.edu +128.113.22.13 #korah.server.rpi.edu +128.113.22.14 #achan.server.rpi.edu +>hep.sc.edu #University of South Carolina, Dept. of Physics +129.252.78.77 #cpeven.physics.sc.edu +>cs.stanford.edu #Stanford University Computer Science Department +171.64.64.10 #cs-afs-1.Stanford.EDU +171.64.64.66 #cs-afs-2.stanford.edu +171.64.64.69 #cs-afs-3.stanford.edu +>ir.stanford.edu #Stanford University +171.64.7.222 #afsdb1.stanford.edu +171.64.7.234 #afsdb2.stanford.edu +171.64.7.246 #afsdb3.stanford.edu +>slac.stanford.edu #Stanford Linear Accelerator Center +134.79.18.25 #afsdb1.slac.stanford.edu +134.79.18.26 #afsdb2.slac.stanford.edu +134.79.18.27 #afsdb3.slac.stanford.edu +>cats.ucsc.edu #UC Santa Cruz, Comm. and Tech. Services, California U.S.A +128.114.129.14 #elan.ucsc.edu +128.114.129.15 #ichabod.ucsc.edu +128.114.129.18 #maneki.ucsc.edu +>acm.uiuc.edu #ACM at the University of Illinois +128.174.251.8 #alnitak.acm.uiuc.edu +128.174.251.9 #alnilam.acm.uiuc.edu +128.174.251.10 #mintaka.acm.uiuc.edu +>ncsa.uiuc.edu #University of Illinois +141.142.3.5 #congo.ncsa.uiuc.edu +141.142.3.8 #nile.ncsa.uiuc.edu +141.142.230.19 #jinx.ncsa.uiuc.edu +>umbc.edu #University of Maryland, Baltimore County +130.85.24.23 #db2.afs.umbc.edu +130.85.24.87 #db3.afs.umbc.edu +130.85.24.101 #db1.afs.umbc.edu +>glue.umd.edu #University of Maryland - Project Glue +128.8.70.11 #olmec.umd.edu +128.8.73.3 #babylon.umd.edu +129.2.128.53 #egypt.umd.edu +>wam.umd.edu #University of Maryland Network WAM Project +128.8.70.9 #csc-srv.wam.umd.edu +128.8.73.9 #pg2-srv.wam.umd.edu +129.2.128.54 #avw-srv.wam.umd.edu +>umich.edu #University of Michigan - Campus +141.211.1.32 #fear.ifs.umich.edu +141.211.1.33 #surprise.ifs.umich.edu +141.211.1.34 #ruthless.ifs.umich.edu +>atlas.umich.edu #ATLAS group cell in physics at University of Michigan +141.211.43.102 #linat02.grid.umich.edu +141.211.43.106 #linat06.grid.umich.edu +141.211.43.109 #atgrid.grid.umich.edu +>citi.umich.edu #Center for Information Technology Integration +141.211.133.5 #babylon.citi.umich.edu +>lsa.umich.edu #University of Michigan - College of LS&A +141.211.54.132 #curtis.admin.lsa.umich.edu +141.211.61.23 #zee.admin.lsa.umich.edu +141.211.68.15 #marshall.lsa.umich.edu +>math.lsa.umich.edu #University of Michigan - Math Department +141.211.61.40 #ike.math.lsa.umich.edu +141.211.61.41 #clark.math.lsa.umich.edu +141.211.61.42 #nimitz.math.lsa.umich.edu +>umr.edu #University of Missouri - Rolla +131.151.1.59 #afsdb1.umr.edu +131.151.1.70 #afsdb3.umr.edu +131.151.1.146 #afsdb2.umr.edu +>physics.unc.edu #Univ. of NC at Chapel Hill, Dept. of Physics +152.2.5.2 #valerian.physics.unc.edu +152.2.5.3 #augustus.physics.unc.edu +152.2.7.67 #nerva.astro.unc.edu +>uncc.edu #University of NC at Charlotte Mosaic AFS Cell +152.15.10.70 #as-sm1.uncc.edu +152.15.13.7 #as-sm2.uncc.edu +152.15.30.27 #fs-kenn3.uncc.edu +>eng.utah.edu #University of Utah - Engineering +155.99.222.9 #lenny.eng.utah.edu +155.99.222.10 #carl.eng.utah.edu +>cs.uwm.edu #University of Wisconsin--Milwaukee +129.89.38.124 #solomons.cs.uwm.edu +>cs.wisc.edu #Univ. of Wisconsin-Madison, Computer Sciences Dept. +128.105.132.14 #timon.cs.wisc.edu +128.105.132.15 #pumbaa.cs.wisc.edu +128.105.132.16 #zazu.cs.wisc.edu +>engr.wisc.edu #University of Wisconsin-Madison, College of Engineering +144.92.13.14 #larry.cae.wisc.edu +144.92.13.15 #curly.cae.wisc.edu +144.92.13.16 #moe.cae.wisc.edu +>hep.wisc.edu #University of Wisconsin -- High Energy Physics +128.104.28.219 #anise.physics.wisc.edu +>physics.wisc.edu #Univ. of Wisconsin-Madison, Physics Department +128.104.220.51 #bubbles.physics.wisc.edu +128.104.220.52 #buttercup.physics.wisc.edu +128.104.220.53 #blossom.physics.wisc.edu +>ifca.unican.es #Instituto de Fisica de Cantabria (IFCA), Santander, Spain +193.144.209.20 #gridwall.ifca.unican.es +>ific.uv.es #Instituto de Fisica Corpuscular, Valencia, Spain +147.156.163.11 #alpha.ific.uv.es +>biocenter.helsinki.fi #University of Helsinki, Institute of Biotechnology +128.214.58.174 #afsdb1.biocenter.helsinki.fi +128.214.88.114 #afsdb2.biocenter.helsinki.fi +>dapnia.saclay.cea.fr #CEA DAPNIA +132.166.32.7 #dphrsg.saclay.cea.fr +132.166.32.12 #dphrsl.saclay.cea.fr +>in2p3.fr #IN2P3 production cell +134.158.232.11 #ccafsdb1.in2p3.fr +134.158.232.12 #ccafsdb2.in2p3.fr +134.158.232.13 #ccafsdb3.in2p3.fr +>anl.gov #Argonne National Laboratory +146.137.96.33 #arteus.ctd.anl.gov +146.137.162.88 #agamemnon.ctd.anl.gov +146.137.194.80 #antenor.ctd.anl.gov +>rhic.bnl.gov #Relativistic Heavy Ion Collider +130.199.6.51 #rafs03.rcf.bnl.gov +130.199.6.52 #rafs02.rcf.bnl.gov +130.199.6.69 #rafs01.rcf.bnl.gov +>usatlas.bnl.gov #US Atlas Tier 1 Facility at BNL +130.199.48.32 #aafs01.usatlas.bnl.gov +130.199.48.33 #aafs02.usatlas.bnl.gov +130.199.48.34 #aafs03.usatlas.bnl.gov +>fnal.gov #Fermi National Acclerator Laboratory +131.225.68.1 #fsus01.fnal.gov +131.225.68.4 #fsus03.fnal.gov +131.225.68.14 #fsus04.fnal.gov +>ic-afs.arc.nasa.gov #Code IC, Ames Research Center +128.102.105.62 #udanax.arc.nasa.gov +>nersc.gov #National Energy Research Supercomputer Center +128.55.128.250 #mars.nersc.gov +128.55.128.252 #alfred.nersc.gov +128.55.128.254 #lurch.nersc.gov +>caspur.it #CASPUR Inter-University Computing Consortium, Rome +193.204.5.45 #pomodoro.caspur.it +193.204.5.46 #banana.caspur.it +193.204.5.50 #maslo.caspur.it +>fusione.it #Assoz. FUSIONE/Euratom, ENEA, Frascati-Italy +192.107.90.2 #fusafs1.frascati.enea.it +192.107.90.3 #fusafs2.frascati.enea.it +192.107.90.4 #fusafs3.frascati.enea.it +>icemb.it #ICEMB, Universita' La Sapienza - Rome - Italy +193.204.6.130 #icembfs.caspur.it +>infn.it #Istituto Nazionale di Fisica Nucleare (INFN), Italia +131.154.1.7 #afs3.infn.it +141.108.3.252 #afs1.infn.it +192.84.134.75 #afs2.infn.it +>kloe.infn.it #INFN, KLOE experiment at Laboratori di Frascati +192.135.25.111 #kloeafs1.lnf.infn.it +192.135.25.112 #kloeafs2.lnf.infn.it +>le.infn.it #INFN, Sezione di Lecce +192.84.152.40 #afs01.le.infn.it +192.84.152.148 #afs02.le.infn.it +>lnf.infn.it #INFN, Laboratori Nazionali di Frascati +193.206.84.121 #afs1.lnf.infn.it +193.206.84.122 #afs2.lnf.infn.it +193.206.84.123 #afs3.lnf.infn.it +>lngs.infn.it #INFN, Laboratori Nazionali di Gran Sasso +192.84.135.21 #rsgs05.lngs.infn.it +>pi.infn.it #INFN, Sezione di Pisa +131.114.134.26 #unknownhost.pi.infn.it +192.84.133.50 #aix1.pi.infn.it +>psm.it #Progetto San Marco, Universita' di Roma-1 +151.100.1.65 #atlante.psm.uniroma1.it +>tgrid.it #CASPUR-CILEA-CINECA Grid Cell +193.204.5.33 #cccgrid.caspur.it +>ictp.trieste.it #The Abdus Salam International Centre for Theoretical Physics (IC +140.105.16.8 #fs1.ictp.trieste.it +140.105.16.9 #fs2.ictp.trieste.it +>ing.uniroma1.it #Universita' La Sapienza, Fac. Ingeneria +151.100.85.253 #alfa.ing.uniroma1.it +>vn.uniroma3.it #University of Rome 3, Area Vasca Navale +193.204.161.136 #alfa.dia.uniroma3.it +193.204.161.137 #beta.dia.uniroma3.it +193.204.161.138 #gamma.dia.uniroma3.it +>italia #Italian public AFS cell +193.204.5.9 #afs.caspur.it +>cmf.nrl.navy.mil #Naval Research Lab - CCS +134.207.10.68 #picard.cmf.nrl.navy.mil +134.207.10.69 #riker.cmf.nrl.navy.mil +134.207.10.70 #kirk.cmf.nrl.navy.mil +>lcp.nrl.navy.mil #Naval Research Lab - Lab for Computational Physics +132.250.114.2 #afs1.lcp.nrl.navy.mil +132.250.114.4 #afs2.lcp.nrl.navy.mil +132.250.114.6 #afs3.lcp.nrl.navy.mil +>es.net #Energy Sciences Net +198.128.3.21 #fs1.es.net +198.128.3.22 #fs2.es.net +198.128.3.23 #fs3.es.net +>laroia.net #Laroia Networks +66.66.102.254 #supercore.laroia.net +>sinenomine.net #Sine Nomine Associates +66.92.236.139 #afs.sinenomine.net +>slackers.net #The Slackers' Network +63.201.48.27 #alexandria.slackers.net +>nikhef.nl #The Dutch National Institute for High Energy Physics +192.16.185.26 #afs1.nikhef.nl +192.16.185.27 #afs2.nikhef.nl +>1ts.org #KCR/private Karl Ramm, Cambridge, MA +4.36.43.102 #dol-guldur.1ts.org +>bazquux.org #Baz Quux Organization +66.207.142.196 #baxquux.org +>coed.org #Adam Pennington's Cell +66.93.61.184 #vice1.coed.org +128.2.4.163 #vice3.coed.org +>dementia.org #Dementia Unlimited +128.2.12.45 #alycia.dementia.org +128.2.120.216 #meredith.dementia.org +>idahofuturetruck.org #University of Idaho hybrid vehicle development +12.18.238.210 #dsle210.fsr.net +>nimlabs.org #Nimlabs, Ink. Cell. +18.238.1.103 #olfin.nimlabs.org +18.238.1.105 #caerbanog.nimlabs.org +>nomh.org #nomh.org +204.29.154.12 #iota.nomh.org +>oc7.org #The OC7 Project +128.2.6.107 #vice3.oc7.org +128.2.122.140 #vice2.oc7.org +>openafs.org #OpenAFS Project +128.2.13.199 #new-virtue.openafs.org +128.2.121.218 #virtue.openafs.org +130.237.48.87 #andrew.e.kth.se +130.237.48.107 #onyx.e.kth.se +>e.kth.se #Royal Institute of Technology, Elektro +130.237.32.145 #sonen.e.kth.se +130.237.48.7 #anden.e.kth.se +130.237.48.244 #fadern.e.kth.se +>hallf.kth.se #Royal Institute of Technology, HALLF +130.237.24.141 #rasmus13.hallf.kth.se +130.237.24.152 #rasmus3.hallf.kth.se +130.237.24.177 #rasmus29.hallf.kth.se +>isk.kth.se #Royal Institute of Technology, ISK +130.237.202.12 #afsdb2.isk.kth.se +130.237.206.13 #afsdb1.isk.kth.se +130.237.209.141 #afsdb3.isk.kth.se +>it.kth.se #Royal Institute of Technology, IT +130.237.212.15 #ptah.it.kth.se +130.237.212.16 #toth.it.kth.se +130.237.215.7 #isis.it.kth.se +>md.kth.se #Royal Institute of Technology, MMK +130.237.57.68 #trinity.md.kth.se +130.237.57.72 #morpheus.md.kth.se +130.237.67.230 #neo.speech.kth.se +>mech.kth.se #Royal Institute of Technology, MECH +130.237.233.142 #matterhorn.mech.kth.se +130.237.233.143 #castor.mech.kth.se +130.237.233.144 #pollux.mech.kth.se +>nada.kth.se #Royal Institute of Technology, NADA +130.237.222.20 #kosmos.nada.kth.se +130.237.223.12 #sputnik.nada.kth.se +130.237.224.78 #mir.nada.kth.se +130.237.227.23 #gagarin.nada.kth.se +130.237.228.28 #laika.nada.kth.se +>pdc.kth.se #Royal Institute of Technology, PDC +130.237.232.29 #crab.pdc.kth.se +130.237.232.112 #anna.pdc.kth.se +130.237.232.114 #hokkigai.pdc.kth.se +>stacken.kth.se #Stacken Computer Club +130.237.234.3 #milko.stacken.kth.se +130.237.234.43 #hot.stacken.kth.se +130.237.237.230 #fishburger.stacken.kth.se +>syd.kth.se #Royal Institute of Technology, KTH-Syd +130.237.83.23 #afs.haninge.kth.se +>physto.se #Physics department Stockholm University +130.237.205.36 #sysafs1.physto.se +130.237.205.72 #sysafs2.physto.se +>sanchin.se #Sanchin Consulting AB, Sweden +192.195.148.10 #sesan.sanchin.se +>su.se #Stockholm University +130.237.162.81 #afsdb1.su.se +130.237.162.82 #afsdb2.su.se +>f9.ijs.si #F9, Jozef Stefan Institue +194.249.156.1 #brenta.ijs.si +>p-ng.si #Nova Gorica Polytechnic +193.2.120.2 #solkan.p-ng.si +>phy.bris.ac.uk #Bristol University - phyics +137.222.58.9 #afs1.phy.bris.ac.uk +>hep.man.ac.uk #Manchester HEP +194.36.2.3 #afs1.hep.man.ac.uk +194.36.2.4 #afs2.hep.man.ac.uk +194.36.2.5 #afs3.hep.man.ac.uk +>rl.ac.uk #Rutherford Appleton Lab, England +130.246.183.164 #wallace.cc.rl.ac.uk diff --git a/src/WINNT/install/NSIS/killer.cpp b/src/WINNT/install/NSIS/killer.cpp new file mode 100644 index 000000000..7ba27fc20 --- /dev/null +++ b/src/WINNT/install/NSIS/killer.cpp @@ -0,0 +1,380 @@ +/* + Process Killer for NSIS script + + Rob Murawski + + Released under terms of IBM Open Source agreement for OpenAFS + + */ + + +#include +#include +#include +#include + +char strProcessName[256]; + +typedef BOOL (CALLBACK *PROCENUMPROC)(DWORD, WORD, LPSTR, LPARAM); + +typedef struct { + DWORD dwPID; + PROCENUMPROC lpProc; + DWORD lParam; + BOOL bEnd; +} EnumInfoStruct; + +BOOL WINAPI EnumProcs(PROCENUMPROC lpProc, LPARAM lParam); + +BOOL WINAPI Enum16(DWORD dwThreadId, WORD hMod16, WORD hTask16, + PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined); + +// +// The EnumProcs function takes a pointer to a callback function +// that will be called once per process with the process filename +// and process ID. +// +// lpProc -- Address of callback routine. +// +// lParam -- A user-defined LPARAM value to be passed to +// the callback routine. +// +// Callback function definition: +// BOOL CALLBACK Proc(DWORD dw, WORD w, LPCSTR lpstr, LPARAM lParam); +// +BOOL WINAPI EnumProcs(PROCENUMPROC lpProc, LPARAM lParam) { + + OSVERSIONINFO osver; + HINSTANCE hInstLib = NULL; + HINSTANCE hInstLib2 = NULL; + HANDLE hSnapShot = NULL; + LPDWORD lpdwPIDs = NULL; + PROCESSENTRY32 procentry; + BOOL bFlag; + DWORD dwSize; + DWORD dwSize2; + DWORD dwIndex; + HMODULE hMod; + HANDLE hProcess; + char szFileName[MAX_PATH]; + EnumInfoStruct sInfo; + + // ToolHelp Function Pointers. + HANDLE (WINAPI *lpfCreateToolhelp32Snapshot)(DWORD, DWORD); + BOOL (WINAPI *lpfProcess32First)(HANDLE, LPPROCESSENTRY32); + BOOL (WINAPI *lpfProcess32Next)(HANDLE, LPPROCESSENTRY32); + + // PSAPI Function Pointers. + BOOL (WINAPI *lpfEnumProcesses)(DWORD *, DWORD, DWORD *); + BOOL (WINAPI *lpfEnumProcessModules)(HANDLE, HMODULE *, DWORD, + LPDWORD); + DWORD (WINAPI *lpfGetModuleBaseName)(HANDLE, HMODULE, LPTSTR, DWORD); + + // VDMDBG Function Pointers. + INT (WINAPI *lpfVDMEnumTaskWOWEx)(DWORD, TASKENUMPROCEX, LPARAM); + + // Retrieve the OS version + osver.dwOSVersionInfoSize = sizeof(osver); + if (!GetVersionEx(&osver)) + return FALSE; + + // If Windows NT 4.0 + if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT + && osver.dwMajorVersion == 4) { + + __try { + + // Get the procedure addresses explicitly. We do + // this so we don't have to worry about modules + // failing to load under OSes other than Windows NT 4.0 + // because references to PSAPI.DLL can't be resolved. + hInstLib = LoadLibraryA("PSAPI.DLL"); + if (hInstLib == NULL) + __leave; + + hInstLib2 = LoadLibraryA("VDMDBG.DLL"); + if (hInstLib2 == NULL) + __leave; + + // Get procedure addresses. + lpfEnumProcesses = (BOOL (WINAPI *)(DWORD *, DWORD, DWORD*)) + GetProcAddress(hInstLib, "EnumProcesses"); + + lpfEnumProcessModules = (BOOL (WINAPI *)(HANDLE, HMODULE *, + DWORD, LPDWORD)) GetProcAddress(hInstLib, + "EnumProcessModules"); + + lpfGetModuleBaseName = (DWORD (WINAPI *)(HANDLE, HMODULE, + LPTSTR, DWORD)) GetProcAddress(hInstLib, + "GetModuleBaseNameA"); + + lpfVDMEnumTaskWOWEx = (INT (WINAPI *)(DWORD, TASKENUMPROCEX, + LPARAM)) GetProcAddress(hInstLib2, "VDMEnumTaskWOWEx"); + + if (lpfEnumProcesses == NULL + || lpfEnumProcessModules == NULL + || lpfGetModuleBaseName == NULL + || lpfVDMEnumTaskWOWEx == NULL) + __leave; + + // + // Call the PSAPI function EnumProcesses to get all of the + // ProcID's currently in the system. + // + // NOTE: In the documentation, the third parameter of + // EnumProcesses is named cbNeeded, which implies that you + // can call the function once to find out how much space to + // allocate for a buffer and again to fill the buffer. + // This is not the case. The cbNeeded parameter returns + // the number of PIDs returned, so if your buffer size is + // zero cbNeeded returns zero. + // + // NOTE: The "HeapAlloc" loop here ensures that we + // actually allocate a buffer large enough for all the + // PIDs in the system. + // + dwSize2 = 256 * sizeof(DWORD); + do { + + if (lpdwPIDs) { + HeapFree(GetProcessHeap(), 0, lpdwPIDs); + dwSize2 *= 2; + } + + lpdwPIDs = (LPDWORD) HeapAlloc(GetProcessHeap(), 0, + dwSize2); + if (lpdwPIDs == NULL) + __leave; + + if (!lpfEnumProcesses(lpdwPIDs, dwSize2, &dwSize)) + __leave; + + } while (dwSize == dwSize2); + + // How many ProcID's did we get? + dwSize /= sizeof(DWORD); + + // Loop through each ProcID. + for (dwIndex = 0; dwIndex < dwSize; dwIndex++) { + + szFileName[0] = 0; + + // Open the process (if we can... security does not + // permit every process in the system to be opened). + hProcess = OpenProcess( + PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, + FALSE, lpdwPIDs[dwIndex]); + if (hProcess != NULL) { + + // Here we call EnumProcessModules to get only the + // first module in the process. This will be the + // EXE module for which we will retrieve the name. + if (lpfEnumProcessModules(hProcess, &hMod, + sizeof(hMod), &dwSize2)) { + + // Get the module name + if (!lpfGetModuleBaseName(hProcess, hMod, + szFileName, sizeof(szFileName))) + szFileName[0] = 0; + } + CloseHandle(hProcess); + } + // Regardless of OpenProcess success or failure, we + // still call the enum func with the ProcID. + if (!lpProc(lpdwPIDs[dwIndex], 0, szFileName, lParam)) + break; + + // Did we just bump into an NTVDM? + if (_stricmp(szFileName, "NTVDM.EXE") == 0) { + + // Fill in some info for the 16-bit enum proc. + sInfo.dwPID = lpdwPIDs[dwIndex]; + sInfo.lpProc = lpProc; + sInfo.lParam = (DWORD) lParam; + sInfo.bEnd = FALSE; + + // Enum the 16-bit stuff. + lpfVDMEnumTaskWOWEx(lpdwPIDs[dwIndex], + (TASKENUMPROCEX) Enum16, (LPARAM) &sInfo); + + // Did our main enum func say quit? + if (sInfo.bEnd) + break; + } + } + + } __finally { + + if (hInstLib) + FreeLibrary(hInstLib); + + if (hInstLib2) + FreeLibrary(hInstLib2); + + if (lpdwPIDs) + HeapFree(GetProcessHeap(), 0, lpdwPIDs); + } + + // If any OS other than Windows NT 4.0. + } else if (osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS + || (osver.dwPlatformId == VER_PLATFORM_WIN32_NT + && osver.dwMajorVersion > 4)) { + + __try { + + hInstLib = LoadLibraryA("Kernel32.DLL"); + if (hInstLib == NULL) + __leave; + + // If NT-based OS, load VDMDBG.DLL. + if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT) { + hInstLib2 = LoadLibraryA("VDMDBG.DLL"); + if (hInstLib2 == NULL) + __leave; + } + + // Get procedure addresses. We are linking to + // these functions explicitly, because a module using + // this code would fail to load under Windows NT, + // which does not have the Toolhelp32 + // functions in KERNEL32.DLL. + lpfCreateToolhelp32Snapshot = + (HANDLE (WINAPI *)(DWORD,DWORD)) + GetProcAddress(hInstLib, "CreateToolhelp32Snapshot"); + + lpfProcess32First = + (BOOL (WINAPI *)(HANDLE,LPPROCESSENTRY32)) + GetProcAddress(hInstLib, "Process32First"); + + lpfProcess32Next = + (BOOL (WINAPI *)(HANDLE,LPPROCESSENTRY32)) + GetProcAddress(hInstLib, "Process32Next"); + + if (lpfProcess32Next == NULL + || lpfProcess32First == NULL + || lpfCreateToolhelp32Snapshot == NULL) + __leave; + + if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT) { + lpfVDMEnumTaskWOWEx = (INT (WINAPI *)(DWORD, TASKENUMPROCEX, + LPARAM)) GetProcAddress(hInstLib2, "VDMEnumTaskWOWEx"); + if (lpfVDMEnumTaskWOWEx == NULL) + __leave; + } + + // Get a handle to a Toolhelp snapshot of all processes. + hSnapShot = lpfCreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); + if (hSnapShot == INVALID_HANDLE_VALUE) { + FreeLibrary(hInstLib); + return FALSE; + } + + // Get the first process' information. + procentry.dwSize = sizeof(PROCESSENTRY32); + bFlag = lpfProcess32First(hSnapShot, &procentry); + + // While there are processes, keep looping. + while (bFlag) { + + // Call the enum func with the filename and ProcID. + if (lpProc(procentry.th32ProcessID, 0, + procentry.szExeFile, lParam)) { + + // Did we just bump into an NTVDM? + if (_stricmp(procentry.szExeFile, "NTVDM.EXE") == 0) { + + // Fill in some info for the 16-bit enum proc. + sInfo.dwPID = procentry.th32ProcessID; + sInfo.lpProc = lpProc; + sInfo.lParam = (DWORD) lParam; + sInfo.bEnd = FALSE; + + // Enum the 16-bit stuff. + lpfVDMEnumTaskWOWEx(procentry.th32ProcessID, + (TASKENUMPROCEX) Enum16, (LPARAM) &sInfo); + + // Did our main enum func say quit? + if (sInfo.bEnd) + break; + } + + procentry.dwSize = sizeof(PROCESSENTRY32); + bFlag = lpfProcess32Next(hSnapShot, &procentry); + + } else + bFlag = FALSE; + } + + } __finally { + + if (hInstLib) + FreeLibrary(hInstLib); + + if (hInstLib2) + FreeLibrary(hInstLib2); + } + + } else + return FALSE; + + // Free the library. + FreeLibrary(hInstLib); + + return TRUE; +} + + +BOOL WINAPI Enum16(DWORD dwThreadId, WORD hMod16, WORD hTask16, + PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined) { + + BOOL bRet; + + EnumInfoStruct *psInfo = (EnumInfoStruct *)lpUserDefined; + + bRet = psInfo->lpProc(psInfo->dwPID, hTask16, pszFileName, + psInfo->lParam); + + if (!bRet) + psInfo->bEnd = TRUE; + + return !bRet; +} + + +BOOL CALLBACK MyProcessEnumerator(DWORD dwPID, WORD wTask, + LPCSTR szProcess, LPARAM lParam) { + + /*if (wTask == 0) + printf("%5u %s\n", dwPID, szProcess); + else + printf(" %5u %s\n", wTask, szProcess);*/ + + if(stricmp(szProcess,strProcessName)==0) + { + HANDLE hProcess=OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPID); + if(hProcess!=NULL) + TerminateProcess(hProcess,0); + CloseHandle(hProcess); + } + + return TRUE; +} + + +void main(int argc, char *argv[]) +{ + if(argc<2) + { + printf("Please specify the process name to kill\n"); + + return; + } + + if(strlen((argv[1]))<255) + strcpy(strProcessName,(argv[1])); + else + return; + + EnumProcs((PROCENUMPROC) MyProcessEnumerator, 0); + +} diff --git a/src/WINNT/install/Win9x/CellServDB b/src/WINNT/install/Win9x/CellServDB index ab3d37ba0..6d43dc846 100644 --- a/src/WINNT/install/Win9x/CellServDB +++ b/src/WINNT/install/Win9x/CellServDB @@ -1,40 +1,483 @@ ->andrew.cmu.edu #Carnegie Mellon University - Computing Services -128.2.10.11 #vice11.fs.andrew.cmu.edu -128.2.10.12 #vice12.fs.andrew.cmu.edu -128.2.10.2 #vice2.fs.andrew.cmu.edu -128.2.10.28 #vice28.fs.andrew.cmu.edu -128.2.10.7 #vice7.fs.andrew.cmu.edu ->cs.cmu.edu #Carnegie Mellon University - School of Comp. Sci. -128.2.206.130 #cucumber.srv.cs.cmu.edu -128.2.222.199 #papaya.srv.cs.cmu.edu -128.2.242.86 #lemon.srv.cs.cmu.edu ->ece.cmu.edu #Carnegie Mellon University - Elec. Comp. Eng. Dept. -128.2.129.7 #porok.ece.cmu.edu -128.2.129.8 #vicio.ece.cmu.edu -128.2.129.9 #e-xing.ece.cmu.edu ->athena.mit.edu #MIT/Athena cell -18.70.0.6 #prill.mit.edu. -18.145.0.25 #agamemnon.mit.edu. -18.159.0.34 #chimera.mit.edu. ->dev.mit.edu #MIT/IS Development cell -18.86.0.28 #wham.mit.edu. -18.86.0.50 #hum.mit.edu. -18.86.0.51 #rattle.mit.edu. ->net.mit.edu #MIT/Network Group cell -18.72.1.38 #gracie.mit.edu. -18.72.0.26 #cetus.mit.edu. ->sipb.mit.edu #MIT/SIPB cell -18.181.0.19 #reynelda.mit.edu. -18.181.0.23 #ronald-ann.mit.edu. -18.181.0.22 #rosebud.mit.edu. ->ir.stanford.edu #Stanford University -171.64.7.222 #afsdb1.stanford.edu -171.64.7.234 #afsdb2.stanford.edu -171.64.7.246 #afsdb3.stanford.edu ->umr.edu #University of Missouri - Rolla -131.151.1.59 #afs1.umr.edu -131.151.1.70 #afs6.umr.edu -131.151.1.146 #afs5.umr.edu ->dementia.org #Dementia Unlimited -128.2.35.149 #alycia.dementia.org -128.2.120.216 #meredith.dementia.org +>grand.central.org #GCO Public CellServDB 11 May 2004 +18.7.14.88 #grand-opening.mit.edu +128.2.191.224 #penn.central.org +>wu-wien.ac.at #University of Economics, Vienna, Austria +137.208.3.33 #afsdb1.wu-wien.ac.at +137.208.7.4 #afsdb2.wu-wien.ac.at +137.208.7.7 #afsdb3.wu-wien.ac.at +>hephy.at #hephy-vienna +193.170.243.10 #mowgli.oeaw.ac.at +193.170.243.12 #baloo.oeaw.ac.at +193.170.243.14 #akela.oeaw.ac.at +>itp.tugraz.at #Institute for Theoretical Physics, TU Graz, Austria +129.27.157.6 #fubphsv2.tu-graz.ac.at +129.27.161.7 #faepsv01.tu-graz.ac.at +129.27.161.15 #faepsv02.tu-graz.ac.at +>cern.ch #European Laboratory for Particle Physics, Geneva +137.138.128.148 #afsdb1.cern.ch +137.138.246.50 #afsdb3.cern.ch +137.138.246.51 #afsdb2.cern.ch +>ams.cern.ch #AMS Experiment +137.138.206.77 #pcamsf2.cern.ch +137.138.206.123 #pcamsf4.cern.ch +>ethz.ch #Swiss Federal Inst. of Tech. - Zurich, Switzerland +129.132.97.19 #amalthea.ethz.ch +129.132.97.27 #nethzafs-001.ethz.ch +129.132.115.3 #himalia.ethz.ch +129.132.115.37 #nethzafs-005.ethz.ch +129.132.115.38 #nethzafs-006.ethz.ch +>psi.ch #Paul Scherrer Institut - Villigen, Switzerland +129.129.16.10 #afs1.psi.ch +129.129.16.11 #afs2.psi.ch +>extundo.com #Simon Josefsson's cell +195.42.214.241 #slipsten.extundo.com +>mekinok.com #Mekinok, Inc. +4.36.43.98 #loggerhead.mekinok.com +>membrain.com #membrain.com +66.93.118.125 #stormy +130.85.24.11 #weasel +130.85.24.13 #straykitten +>midnightlinux.com #Midnight Linux, Pittsburgh PA +66.93.62.18 #romulus.midnihtlinux.com +66.93.62.20 #yar.midnightlinux.com +>setfilepointer.com #SetFilePointer.com +63.224.10.2 #hamlet.SetFilePointer.com +63.224.10.4 #troilus.SetFilePointer.com +>sodre.cx #Sodre.cx +128.8.140.165 #greed.sodre.cx +>desy.de #Deutsches Elektronen-Synchrotron +131.169.40.62 #vayu.desy.de +131.169.244.60 #solar00.desy.de +>gppc.de #GPP Chemnitz mbH +213.187.92.33 #gpp1.gppc.de +213.187.92.34 #paulchen.gppc.de +213.187.92.35 #lotus.gppc.de +>ifh.de #DESY Zeuthen +141.34.22.10 #romulus.ifh.de +141.34.22.11 #remus.ifh.de +141.34.22.29 #hekate.ifh.de +>lrz-muenchen.de #Leibniz Computing Centre, Germany +129.187.10.36 #afs1.lrz-muenchen.de +129.187.10.56 #afs3.lrz-muenchen.de +129.187.10.57 #afs2.lrz-muenchen.de +>ipp-garching.mpg.de #Institut fuer Plasmaphysik +130.183.9.5 #afs-db1.rzg.mpg.de +130.183.100.10 #afs-db2.aug.ipp-garching.mpg.de +130.183.100.23 #afs-db3.aug.ipp-garching.mpg.de +>mpe.mpg.de #MPE cell +130.183.130.7 #irafs1.mpe-garching.mpg.de +130.183.134.20 #irafs2.mpe-garching.mpg.de +>i1.informatik.rwth-aachen.de #Informatik I, RWTH Aachen +137.226.244.79 #remus.informatik.rwth-aachen.de +>tu-chemnitz.de #Technische Universitaet Chemnitz, Germany +134.109.2.1 #zuse.hrz.tu-chemnitz.de +134.109.2.15 #phoenix.hrz.tu-chemnitz.de +134.109.200.7 #aetius.hrz.tu-chemnitz.de +>e18.ph.tum.de #Experimental Physics, TU Munich, Germany +129.187.154.223 #hamlet.e18.physik.tu-muenchen.de +>uni-bonn.de #Cell name +131.220.14.198 #work15-eth.rhrz.uni-bonn.de +131.220.14.203 #node03-en2.rhrz.uni-bonn.de +131.220.14.205 #node05.rhrz.uni-bonn.de +>uni-freiburg.de #Albert-Ludwigs-Universitat Freiburg +132.230.6.235 #sv6.ruf.uni-freiburg.de +132.230.6.236 #sv7.ruf.uni-freiburg.de +132.230.6.237 #sv8.ruf.uni-freiburg.de +>physik.uni-freiburg.de #institute of physics, university Freiburg, Germany +132.230.77.16 #hepafs.physik.uni-freiburg.de +>urz.uni-heidelberg.de #Uni Heidelberg (Rechenzentrum) +129.206.119.10 #afsdb.urz.uni-heidelberg.de +129.206.119.16 #afsdb1.urz.uni-heidelberg.de +129.206.119.17 #afsdb2.urz.uni-heidelberg.de +>uni-hohenheim.de #University of Hohenheim +144.41.2.2 #rs13.serv.uni-hohenheim.de +144.41.2.3 #rs14.serv.uni-hohenheim.de +144.41.2.4 #rs15.serv.uni-hohenheim.de +>rz.uni-jena.de #Rechenzentrum University of Jena, Germany +141.35.2.160 #lc00.rz.uni-jena.de +141.35.7.9 #fsuj01.rz.uni-jena.de +141.35.7.10 #zaphod.rz.uni-jena +>meteo.uni-koeln.de #Univ. of Cologne - Inst. for Geophysics & Meteorology +134.95.144.22 #afs1.meteo.uni-koeln.de +134.95.144.24 #afs2.meteo.uni-koeln.de +>rrz.uni-koeln.de #University of Cologne - Reg Comp Center +134.95.19.3 #afsdb1.rrz.uni-koeln.de +134.95.19.30 #fileserv3.rrz.uni-koeln.de +134.95.67.97 #afs.thp.uni-koeln.de +134.95.140.190 #rzkbserv.rrz.uni-koeln.de +>physik.uni-mainz.de #institute of physics, university Mainz, Germany +134.93.130.93 #hardy.physik.uni-mainz.de +>uni-mannheim.de #Uni Mannheim (Rechenzentrum) +134.155.50.165 #afsdbx.uni-mannheim.de +134.155.50.166 #afsdby.uni-mannheim.de +134.155.50.167 #afsdbz.uni-mannheim.de +>physik.uni-wuppertal.de #Physics department of Bergische Universität Wuppertal +132.195.104.3 #afs1.physik.uni-wuppertal.de +132.195.104.230 #afs2.physik.uni-wuppertal.de +>ies.auc.dk #Aalborg Univ., Inst. of Electronic Systems, Denmark +130.225.51.73 #afsdb1.kom.auc.dk +130.225.51.74 #afsdb2.kom.auc.dk +130.225.51.85 #afsdb3.kom.auc.dk +>hep.caltech.edu #CalTech High Energy Physics +131.215.126.150 #afs.hep.caltech.edu +>andrew.cmu.edu #Carnegie Mellon University - Computing Services Cell +128.2.10.2 #vice2.fs.andrew.cmu.edu +128.2.10.7 #vice7.fs.andrew.cmu.edu +128.2.10.11 #vice11.fs.andrew.cmu.edu +128.2.10.28 #vice28.fs.andrew.cmu.edu +128.2.32.44 #new-vice12.fs.andrew.cmu.edu +>club.cc.cmu.edu #Carnegie Mellon University Computer Club +128.2.4.131 #yttrium.club.cc.cmu.edu +128.2.4.132 #zirconium.club.cc.cmu.edu +>chem.cmu.edu #Carnegie Mellon University - Chemistry Dept. +128.2.40.134 #afs.chem.cmu.edu +128.2.40.140 #afs2.chem.cmu.edu +>cs.cmu.edu #Carnegie Mellon University - School of Comp. Sci. +128.2.194.178 #cherry.srv.cs.cmu.edu +128.2.194.179 #pumpkin.srv.cs.cmu.edu +128.2.194.180 #strawberry.srv.cs.cmu.edu +>ece.cmu.edu #Carnegie Mellon University - Elec. Comp. Eng. Dept. +128.2.129.7 #porok.ece.cmu.edu +128.2.129.8 #vicio.ece.cmu.edu +128.2.129.9 #e-xing.ece.cmu.edu +>scotch.ece.cmu.edu #CMU ECE CALCM research group +128.2.134.82 #lagavulin.ece.cmu.edu +>msc.cornell.edu #Cornell University Materials Science Center +128.84.231.242 #miranda.ccmr.cornell.edu +128.84.241.35 #co.ccmr.cornell.edu +128.84.249.78 #dax.ccmr.cornell.edu +>dbic.dartmouth.edu #Dartmouth Brain Imaging Center +129.170.30.143 #dbicafs1.dartmouth.edu +129.170.30.144 #dbicafs2.dartmouth.edu +129.170.30.145 #dbicafs3.dartmouth.edu +>northstar.dartmouth.edu #Dartmouth College Research Computing +129.170.16.22 #halley.dartmouth.edu +129.170.16.42 #oort.dartmouth.edu +129.170.16.43 #cygnusx1.dartmouth.edu +>iastate.edu #Iowa State University +129.186.1.243 #afsdb-1.iastate.edu +129.186.6.243 #afsdb-2.iastate.edu +129.186.142.243 #afsdb-3.iastate.edu +>athena.mit.edu #MIT/Athena cell +18.7.1.66 #paris.mit.edu. +18.7.1.74 #chimera.mit.edu. +18.158.0.37 #prill.mit.edu. +>dev.mit.edu #MIT/IS Development cell +18.7.1.70 #wham.mit.edu. +18.7.15.89 #rattle.mit.edu. +18.7.15.93 #hum.mit.edu. +>net.mit.edu #MIT/Network Group cell +18.7.7.73 #gracie.mit.edu +18.7.21.95 #george.mit.edu +>sipb.mit.edu #MIT/SIPB cell +18.181.0.19 #reynelda.mit.edu. +18.181.0.22 #rosebud.mit.edu. +18.181.0.23 #ronald-ann.mit.edu. +>msu.edu #Michigan State University Main Cell +35.9.7.10 #afsdb0.cl.msu.edu +>nd.edu #University of Notre Dame +129.74.223.17 #john.helios.nd.edu +129.74.223.33 #lizardo.helios.nd.edu +129.74.223.65 #buckaroo.helios.nd.edu +>pitt.edu #University of Pittsburgh +136.142.8.15 #afs09.srv.cis.pitt.edu +136.142.8.20 #afs10.srv.cis.pitt.edu +136.142.8.21 #afs11.srv.cis.pitt.edu +>cs.pitt.edu #University of Pittsburgh - Computer Science +130.49.220.11 #afs01.cs.pitt.edu +130.49.220.12 #afs02.cs.pitt.edu +130.49.220.13 #afs03.cs.pitt.edu +>psc.edu #PSC (Pittsburgh Supercomputing Center) +128.182.59.182 #shaggy.psc.edu +128.182.66.184 #velma.psc.edu +128.182.66.185 #daphne.psc.edu +>scoobydoo.psc.edu #PSC Test Cell +128.182.59.181 #scooby.psc.edu +>cede.psu.edu #Penn State - Center for Engr. Design & Entrepeneurship +146.186.218.10 #greenly.cede.psu.edu +146.186.218.60 #b50.cede.psu.edu +146.186.218.246 #stalin.cede.psu.edu +>rose-hulman.edu #Rose-Hulman Institute of Technology +137.112.7.11 #afs1.rose-hulman.edu +137.112.7.12 #afs2.rose-hulman.edu +137.112.7.13 #afs3.rose-hulman.edu +>cs.rose-hulman.edu #Rose-Hulman CS Department +137.112.40.10 #galaxy.cs.rose-hulman.edu +>rpi.edu #Rensselaer Polytechnic Institute +128.113.22.11 #saul.server.rpi.edu +128.113.22.12 #joab.server.rpi.edu +128.113.22.13 #korah.server.rpi.edu +128.113.22.14 #achan.server.rpi.edu +>hep.sc.edu #University of South Carolina, Dept. of Physics +129.252.78.77 #cpeven.physics.sc.edu +>cs.stanford.edu #Stanford University Computer Science Department +171.64.64.10 #cs-afs-1.Stanford.EDU +171.64.64.66 #cs-afs-2.stanford.edu +171.64.64.69 #cs-afs-3.stanford.edu +>ir.stanford.edu #Stanford University +171.64.7.222 #afsdb1.stanford.edu +171.64.7.234 #afsdb2.stanford.edu +171.64.7.246 #afsdb3.stanford.edu +>slac.stanford.edu #Stanford Linear Accelerator Center +134.79.18.25 #afsdb1.slac.stanford.edu +134.79.18.26 #afsdb2.slac.stanford.edu +134.79.18.27 #afsdb3.slac.stanford.edu +>cats.ucsc.edu #UC Santa Cruz, Comm. and Tech. Services, California U.S.A +128.114.129.14 #elan.ucsc.edu +128.114.129.15 #ichabod.ucsc.edu +128.114.129.18 #maneki.ucsc.edu +>acm.uiuc.edu #ACM at the University of Illinois +128.174.251.8 #alnitak.acm.uiuc.edu +128.174.251.9 #alnilam.acm.uiuc.edu +128.174.251.10 #mintaka.acm.uiuc.edu +>ncsa.uiuc.edu #University of Illinois +141.142.3.5 #congo.ncsa.uiuc.edu +141.142.3.8 #nile.ncsa.uiuc.edu +141.142.230.19 #jinx.ncsa.uiuc.edu +>umbc.edu #University of Maryland, Baltimore County +130.85.24.23 #db2.afs.umbc.edu +130.85.24.87 #db3.afs.umbc.edu +130.85.24.101 #db1.afs.umbc.edu +>glue.umd.edu #University of Maryland - Project Glue +128.8.70.11 #olmec.umd.edu +128.8.73.3 #babylon.umd.edu +129.2.128.53 #egypt.umd.edu +>wam.umd.edu #University of Maryland Network WAM Project +128.8.70.9 #csc-srv.wam.umd.edu +128.8.73.9 #pg2-srv.wam.umd.edu +129.2.128.54 #avw-srv.wam.umd.edu +>umich.edu #University of Michigan - Campus +141.211.1.32 #fear.ifs.umich.edu +141.211.1.33 #surprise.ifs.umich.edu +141.211.1.34 #ruthless.ifs.umich.edu +>atlas.umich.edu #ATLAS group cell in physics at University of Michigan +141.211.43.102 #linat02.grid.umich.edu +141.211.43.106 #linat06.grid.umich.edu +141.211.43.109 #atgrid.grid.umich.edu +>citi.umich.edu #Center for Information Technology Integration +141.211.133.5 #babylon.citi.umich.edu +>lsa.umich.edu #University of Michigan - College of LS&A +141.211.54.132 #curtis.admin.lsa.umich.edu +141.211.61.23 #zee.admin.lsa.umich.edu +141.211.68.15 #marshall.lsa.umich.edu +>math.lsa.umich.edu #University of Michigan - Math Department +141.211.61.40 #ike.math.lsa.umich.edu +141.211.61.41 #clark.math.lsa.umich.edu +141.211.61.42 #nimitz.math.lsa.umich.edu +>umr.edu #University of Missouri - Rolla +131.151.1.59 #afsdb1.umr.edu +131.151.1.70 #afsdb3.umr.edu +131.151.1.146 #afsdb2.umr.edu +>physics.unc.edu #Univ. of NC at Chapel Hill, Dept. of Physics +152.2.5.2 #valerian.physics.unc.edu +152.2.5.3 #augustus.physics.unc.edu +152.2.7.67 #nerva.astro.unc.edu +>uncc.edu #University of NC at Charlotte Mosaic AFS Cell +152.15.10.70 #as-sm1.uncc.edu +152.15.13.7 #as-sm2.uncc.edu +152.15.30.27 #fs-kenn3.uncc.edu +>eng.utah.edu #University of Utah - Engineering +155.99.222.9 #lenny.eng.utah.edu +155.99.222.10 #carl.eng.utah.edu +>cs.uwm.edu #University of Wisconsin--Milwaukee +129.89.38.124 #solomons.cs.uwm.edu +>cs.wisc.edu #Univ. of Wisconsin-Madison, Computer Sciences Dept. +128.105.132.14 #timon.cs.wisc.edu +128.105.132.15 #pumbaa.cs.wisc.edu +128.105.132.16 #zazu.cs.wisc.edu +>engr.wisc.edu #University of Wisconsin-Madison, College of Engineering +144.92.13.14 #larry.cae.wisc.edu +144.92.13.15 #curly.cae.wisc.edu +144.92.13.16 #moe.cae.wisc.edu +>hep.wisc.edu #University of Wisconsin -- High Energy Physics +128.104.28.219 #anise.physics.wisc.edu +>physics.wisc.edu #Univ. of Wisconsin-Madison, Physics Department +128.104.220.51 #bubbles.physics.wisc.edu +128.104.220.52 #buttercup.physics.wisc.edu +128.104.220.53 #blossom.physics.wisc.edu +>ifca.unican.es #Instituto de Fisica de Cantabria (IFCA), Santander, Spain +193.144.209.20 #gridwall.ifca.unican.es +>ific.uv.es #Instituto de Fisica Corpuscular, Valencia, Spain +147.156.163.11 #alpha.ific.uv.es +>biocenter.helsinki.fi #University of Helsinki, Institute of Biotechnology +128.214.58.174 #afsdb1.biocenter.helsinki.fi +128.214.88.114 #afsdb2.biocenter.helsinki.fi +>dapnia.saclay.cea.fr #CEA DAPNIA +132.166.32.7 #dphrsg.saclay.cea.fr +132.166.32.12 #dphrsl.saclay.cea.fr +>in2p3.fr #IN2P3 production cell +134.158.232.11 #ccafsdb1.in2p3.fr +134.158.232.12 #ccafsdb2.in2p3.fr +134.158.232.13 #ccafsdb3.in2p3.fr +>anl.gov #Argonne National Laboratory +146.137.96.33 #arteus.ctd.anl.gov +146.137.162.88 #agamemnon.ctd.anl.gov +146.137.194.80 #antenor.ctd.anl.gov +>rhic.bnl.gov #Relativistic Heavy Ion Collider +130.199.6.51 #rafs03.rcf.bnl.gov +130.199.6.52 #rafs02.rcf.bnl.gov +130.199.6.69 #rafs01.rcf.bnl.gov +>usatlas.bnl.gov #US Atlas Tier 1 Facility at BNL +130.199.48.32 #aafs01.usatlas.bnl.gov +130.199.48.33 #aafs02.usatlas.bnl.gov +130.199.48.34 #aafs03.usatlas.bnl.gov +>fnal.gov #Fermi National Acclerator Laboratory +131.225.68.1 #fsus01.fnal.gov +131.225.68.4 #fsus03.fnal.gov +131.225.68.14 #fsus04.fnal.gov +>ic-afs.arc.nasa.gov #Code IC, Ames Research Center +128.102.105.62 #udanax.arc.nasa.gov +>nersc.gov #National Energy Research Supercomputer Center +128.55.128.250 #mars.nersc.gov +128.55.128.252 #alfred.nersc.gov +128.55.128.254 #lurch.nersc.gov +>caspur.it #CASPUR Inter-University Computing Consortium, Rome +193.204.5.45 #pomodoro.caspur.it +193.204.5.46 #banana.caspur.it +193.204.5.50 #maslo.caspur.it +>fusione.it #Assoz. FUSIONE/Euratom, ENEA, Frascati-Italy +192.107.90.2 #fusafs1.frascati.enea.it +192.107.90.3 #fusafs2.frascati.enea.it +192.107.90.4 #fusafs3.frascati.enea.it +>icemb.it #ICEMB, Universita' La Sapienza - Rome - Italy +193.204.6.130 #icembfs.caspur.it +>infn.it #Istituto Nazionale di Fisica Nucleare (INFN), Italia +131.154.1.7 #afs3.infn.it +141.108.3.252 #afs1.infn.it +192.84.134.75 #afs2.infn.it +>kloe.infn.it #INFN, KLOE experiment at Laboratori di Frascati +192.135.25.111 #kloeafs1.lnf.infn.it +192.135.25.112 #kloeafs2.lnf.infn.it +>le.infn.it #INFN, Sezione di Lecce +192.84.152.40 #afs01.le.infn.it +192.84.152.148 #afs02.le.infn.it +>lnf.infn.it #INFN, Laboratori Nazionali di Frascati +193.206.84.121 #afs1.lnf.infn.it +193.206.84.122 #afs2.lnf.infn.it +193.206.84.123 #afs3.lnf.infn.it +>lngs.infn.it #INFN, Laboratori Nazionali di Gran Sasso +192.84.135.21 #rsgs05.lngs.infn.it +>pi.infn.it #INFN, Sezione di Pisa +131.114.134.26 #unknownhost.pi.infn.it +192.84.133.50 #aix1.pi.infn.it +>psm.it #Progetto San Marco, Universita' di Roma-1 +151.100.1.65 #atlante.psm.uniroma1.it +>tgrid.it #CASPUR-CILEA-CINECA Grid Cell +193.204.5.33 #cccgrid.caspur.it +>ictp.trieste.it #The Abdus Salam International Centre for Theoretical Physics (IC +140.105.16.8 #fs1.ictp.trieste.it +140.105.16.9 #fs2.ictp.trieste.it +>ing.uniroma1.it #Universita' La Sapienza, Fac. Ingeneria +151.100.85.253 #alfa.ing.uniroma1.it +>vn.uniroma3.it #University of Rome 3, Area Vasca Navale +193.204.161.136 #alfa.dia.uniroma3.it +193.204.161.137 #beta.dia.uniroma3.it +193.204.161.138 #gamma.dia.uniroma3.it +>italia #Italian public AFS cell +193.204.5.9 #afs.caspur.it +>cmf.nrl.navy.mil #Naval Research Lab - CCS +134.207.10.68 #picard.cmf.nrl.navy.mil +134.207.10.69 #riker.cmf.nrl.navy.mil +134.207.10.70 #kirk.cmf.nrl.navy.mil +>lcp.nrl.navy.mil #Naval Research Lab - Lab for Computational Physics +132.250.114.2 #afs1.lcp.nrl.navy.mil +132.250.114.4 #afs2.lcp.nrl.navy.mil +132.250.114.6 #afs3.lcp.nrl.navy.mil +>es.net #Energy Sciences Net +198.128.3.21 #fs1.es.net +198.128.3.22 #fs2.es.net +198.128.3.23 #fs3.es.net +>laroia.net #Laroia Networks +66.66.102.254 #supercore.laroia.net +>sinenomine.net #Sine Nomine Associates +66.92.236.139 #afs.sinenomine.net +>slackers.net #The Slackers' Network +63.201.48.27 #alexandria.slackers.net +>nikhef.nl #The Dutch National Institute for High Energy Physics +192.16.185.26 #afs1.nikhef.nl +192.16.185.27 #afs2.nikhef.nl +>1ts.org #KCR/private Karl Ramm, Cambridge, MA +4.36.43.102 #dol-guldur.1ts.org +>bazquux.org #Baz Quux Organization +66.207.142.196 #baxquux.org +>coed.org #Adam Pennington's Cell +66.93.61.184 #vice1.coed.org +128.2.4.163 #vice3.coed.org +>dementia.org #Dementia Unlimited +128.2.12.45 #alycia.dementia.org +128.2.120.216 #meredith.dementia.org +>idahofuturetruck.org #University of Idaho hybrid vehicle development +12.18.238.210 #dsle210.fsr.net +>nimlabs.org #Nimlabs, Ink. Cell. +18.238.1.103 #olfin.nimlabs.org +18.238.1.105 #caerbanog.nimlabs.org +>nomh.org #nomh.org +204.29.154.12 #iota.nomh.org +>oc7.org #The OC7 Project +128.2.6.107 #vice3.oc7.org +128.2.122.140 #vice2.oc7.org +>openafs.org #OpenAFS Project +128.2.13.199 #new-virtue.openafs.org +128.2.121.218 #virtue.openafs.org +130.237.48.87 #andrew.e.kth.se +130.237.48.107 #onyx.e.kth.se +>e.kth.se #Royal Institute of Technology, Elektro +130.237.32.145 #sonen.e.kth.se +130.237.48.7 #anden.e.kth.se +130.237.48.244 #fadern.e.kth.se +>hallf.kth.se #Royal Institute of Technology, HALLF +130.237.24.141 #rasmus13.hallf.kth.se +130.237.24.152 #rasmus3.hallf.kth.se +130.237.24.177 #rasmus29.hallf.kth.se +>isk.kth.se #Royal Institute of Technology, ISK +130.237.202.12 #afsdb2.isk.kth.se +130.237.206.13 #afsdb1.isk.kth.se +130.237.209.141 #afsdb3.isk.kth.se +>it.kth.se #Royal Institute of Technology, IT +130.237.212.15 #ptah.it.kth.se +130.237.212.16 #toth.it.kth.se +130.237.215.7 #isis.it.kth.se +>md.kth.se #Royal Institute of Technology, MMK +130.237.57.68 #trinity.md.kth.se +130.237.57.72 #morpheus.md.kth.se +130.237.67.230 #neo.speech.kth.se +>mech.kth.se #Royal Institute of Technology, MECH +130.237.233.142 #matterhorn.mech.kth.se +130.237.233.143 #castor.mech.kth.se +130.237.233.144 #pollux.mech.kth.se +>nada.kth.se #Royal Institute of Technology, NADA +130.237.222.20 #kosmos.nada.kth.se +130.237.223.12 #sputnik.nada.kth.se +130.237.224.78 #mir.nada.kth.se +130.237.227.23 #gagarin.nada.kth.se +130.237.228.28 #laika.nada.kth.se +>pdc.kth.se #Royal Institute of Technology, PDC +130.237.232.29 #crab.pdc.kth.se +130.237.232.112 #anna.pdc.kth.se +130.237.232.114 #hokkigai.pdc.kth.se +>stacken.kth.se #Stacken Computer Club +130.237.234.3 #milko.stacken.kth.se +130.237.234.43 #hot.stacken.kth.se +130.237.237.230 #fishburger.stacken.kth.se +>syd.kth.se #Royal Institute of Technology, KTH-Syd +130.237.83.23 #afs.haninge.kth.se +>physto.se #Physics department Stockholm University +130.237.205.36 #sysafs1.physto.se +130.237.205.72 #sysafs2.physto.se +>sanchin.se #Sanchin Consulting AB, Sweden +192.195.148.10 #sesan.sanchin.se +>su.se #Stockholm University +130.237.162.81 #afsdb1.su.se +130.237.162.82 #afsdb2.su.se +>f9.ijs.si #F9, Jozef Stefan Institue +194.249.156.1 #brenta.ijs.si +>p-ng.si #Nova Gorica Polytechnic +193.2.120.2 #solkan.p-ng.si +>phy.bris.ac.uk #Bristol University - phyics +137.222.58.9 #afs1.phy.bris.ac.uk +>hep.man.ac.uk #Manchester HEP +194.36.2.3 #afs1.hep.man.ac.uk +194.36.2.4 #afs2.hep.man.ac.uk +194.36.2.5 #afs3.hep.man.ac.uk +>rl.ac.uk #Rutherford Appleton Lab, England +130.246.183.164 #wallace.cc.rl.ac.uk diff --git a/src/WINNT/install/Win9x/NTMakeFile b/src/WINNT/install/Win9x/NTMakeFile index d0bb112dc..368fbebfc 100644 --- a/src/WINNT/install/Win9x/NTMakeFile +++ b/src/WINNT/install/Win9x/NTMakeFile @@ -5,6 +5,7 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=WINNT\install\Win9x !INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\..\config\NTMakefile.version OUTDIR = $(DESTDIR)\WinInstall @@ -34,11 +35,11 @@ DLLCOMPONENTS = \ $(COMPONENTS):: $(DESTDIR)\bin\util_cr.exe ~ $@ - $(COPY) $@ $(DESTDIR)\WinInstall\. + $(COPY) $@ $(OUTDIR) $(DLLCOMPONENTS):: $(DESTDIR)\bin\util_cr.exe ~ $@ - $(COPY) $@ $(DESTDIR)\WinInstall\Dll\. + $(COPY) $@ $(OUTDIR)\Dll\. !IF (EXIST(ISBUILD.MAK)) !INCLUDE ISBUILD.MAK @@ -55,9 +56,12 @@ clean :: $(DEL) $(OUTDIR)\DiskIm~1\WebInstall\* prep : - $(COPY) "$(DESTDIR)\WinInstall\config\sock.vxd" "$(DESTDIR)\WinInstall\." - $(COPY) "$(DESTDIR)\WinInstall\config\MMAP.vxd" "$(DESTDIR)\WinInstall\." - $(COPY) "$(DESTDIR)\WinInstall\config\AFSD.EXE" "$(DESTDIR)\WinInstall\." - $(DESTDIR)\bin\util_cr.exe ~ "$(DESTDIR)\WinInstall\sock.vxd" - $(DESTDIR)\bin\util_cr.exe ~ "$(DESTDIR)\WinInstall\MMAP.vxd" - $(DESTDIR)\bin\util_cr.exe ~ "$(DESTDIR)\WinInstall\AFSD.EXE" + $(COPY) "$(OUTDIR)\config\sock.vxd" "$(OUTDIR)" + $(COPY) "$(OUTDIR)\config\MMAP.vxd" "$(OUTDIR)" + $(COPY) "$(OUTDIR)\config\AFSD.EXE" "$(OUTDIR)" + $(DESTDIR)\bin\util_cr.exe ~ "$(OUTDIR)\sock.vxd" + $(DESTDIR)\bin\util_cr.exe ~ "$(OUTDIR)\MMAP.vxd" + $(DESTDIR)\bin\util_cr.exe ~ "$(OUTDIR)\AFSD.EXE" + +mkdir: + diff --git a/src/WINNT/kfw/inc/kclient/kclient.h b/src/WINNT/kfw/inc/kclient/kclient.h new file mode 100644 index 000000000..13a960265 --- /dev/null +++ b/src/WINNT/kfw/inc/kclient/kclient.h @@ -0,0 +1,48 @@ +/* + +Copyright © 1996 by Project Mandarin, Inc. + +Error codes copyright 1996 by Massachusetts Institute of Technology + +*/ + +#include "kcmacerr.h" + +#if defined(_WIN32) +/* unfortunately the 32-bit compiler doesn't allow a function */ +/* to be declared as __stdcall AND __declspec(dllexport), so */ +/* I have to use a .def file for the export part */ +#define KC_CALLTYPE __stdcall +#define KC_EXPORT +#else +#define KC_CALLTYPE WINAPI +#define KC_EXPORT _export +#endif + +BOOL KC_CALLTYPE GetTicketForService (LPSTR, LPSTR, LPDWORD) ; +BOOL KC_CALLTYPE GetTicketGrantingTicket (void) ; +BOOL KC_CALLTYPE DeleteAllSessions (void) ; +BOOL KC_CALLTYPE SetUserName (LPSTR) ; +#if defined(_WIN32) +BOOL KC_CALLTYPE KCGetUserName (LPSTR) ; +#else +BOOL KC_CALLTYPE GetUserName (LPSTR) ; +#endif +BOOL KC_CALLTYPE ListTickets (HWND) ; +void KC_CALLTYPE SetTicketLifeTime (int) ; +void KC_CALLTYPE SetKrbdllMode (BOOL) ; +BOOL KC_CALLTYPE TgtExist (void) ; +#if !defined(KLITE) +BOOL KC_CALLTYPE ChangePassword (void) ; +#endif +// the following two functions will exist ONLY until the other functions +// are revised to return OSErr themselves. this minimizes the API +// change for this release. +OSErr KC_CALLTYPE KClientErrno(void) ; +signed long KC_CALLTYPE KClientKerberosErrno(void) ; + +BOOL KC_CALLTYPE SendTicketForService(LPSTR service, LPSTR version, int fd); + +#ifdef _WIN32 +DWORD KC_CALLTYPE _KCGetNumInUse(); +#endif diff --git a/src/WINNT/kfw/inc/kclient/kcmacerr.h b/src/WINNT/kfw/inc/kclient/kcmacerr.h new file mode 100644 index 000000000..c0cdf5912 --- /dev/null +++ b/src/WINNT/kfw/inc/kclient/kcmacerr.h @@ -0,0 +1,68 @@ + +/* Error codes from Mac version of Project Mandarin Kerberos Client */ +/* Copyright © 1995 Project Mandarin, Inc. */ + +typedef signed short OSErr; + +enum { + cKrbCorruptedFile = -1024, /* couldn't find a needed resource */ + cKrbNoKillIO, /* can't killIO because all calls sync */ + cKrbBadSelector, /* csCode passed doesn't select a recognized function */ + cKrbCantClose, /* we must always remain open */ + cKrbMapDoesntExist, /* tried to access a map that doesn't exist (index too large, + or criteria doesn't match anything) */ + cKrbSessDoesntExist, /* tried to access a session that doesn't exist */ + cKrbCredsDontExist, /* tried to access credentials that don't exist */ + cKrbTCPunavailable, /* couldn't open MacTCP driver */ + cKrbUserCancelled, /* user cancelled a log in operation */ + cKrbConfigurationErr, /* Kerberos Preference file is not configured properly */ + cKrbServerRejected, /* A server rejected our ticket */ + cKrbServerImposter, /* Server appears to be a phoney */ + cKrbServerRespIncomplete, /* Server response is not complete */ + cKrbNotLoggedIn, /* Returned by cKrbGetUserName if user is not logged in */ + cKrbOldDriver, /* old version of the driver */ + cKrbDriverInUse, /* driver is not reentrant */ + cKrbAppInBkgnd, /* driver won't put up password dialog when in background */ + cKrbInvalidSession, /* invalid structure passed to KClient/KServer routine */ + + cKrbKerberosErrBlock = -20000 /* start of block of 256 kerberos error numbers */ +}; + + +/* the following are borrowed from MacTCPCommonTypes.h */ +/* MacTCP return Codes in the range -23000 through -23049 */ +#define ipBadLapErr -23000 /* bad network configuration */ +#define ipBadCnfgErr -23001 /* bad IP configuration error */ +#define ipNoCnfgErr -23002 /* missing IP or LAP configuration error */ +#define ipLoadErr -23003 /* error in MacTCP load */ +#define ipBadAddr -23004 /* error in getting address */ +#define connectionClosing -23005 /* connection is closing */ +#define invalidLength -23006 +#define connectionExists -23007 /* request conflicts with existing connection */ +#define connectionDoesntExist -23008 /* connection does not exist */ +#define insufficientResources -23009 /* insufficient resources to perform request */ +#define invalidStreamPtr -23010 +#define streamAlreadyOpen -23011 +#define connectionTerminated -23012 +#define invalidBufPtr -23013 +#define invalidRDS -23014 +#define invalidWDS -23014 +#define openFailed -23015 +#define commandTimeout -23016 +#define duplicateSocket -23017 + +/* Error codes from internal IP functions */ +#define ipDontFragErr -23032 /* Packet too large to send w/o fragmenting */ +#define ipDestDeadErr -23033 /* destination not responding */ +#define ipNoFragMemErr -23036 /* no memory to send fragmented pkt */ +#define ipRouteErr -23037 /* can't route packet off-net */ + +#define nameSyntaxErr -23041 +#define cacheFault -23042 +#define noResultProc -23043 +#define noNameServer -23044 +#define authNameErr -23045 +#define noAnsErr -23046 +#define dnrErr -23047 +#define outOfMemory -23048 + diff --git a/src/WINNT/kfw/inc/krb4/com_err.h b/src/WINNT/kfw/inc/krb4/com_err.h new file mode 100644 index 000000000..1111d6348 --- /dev/null +++ b/src/WINNT/kfw/inc/krb4/com_err.h @@ -0,0 +1,56 @@ +/* + * HA HA HA HA!!!! THIS IS A COM_ERR SUBSTITUTE!!!! HA HA HA HA!!!! + */ + +#ifndef _DCNS_MIT_COM_ERR_H +#define _DCNS_MIT_COM_ERR_H + +#if defined(__cplusplus) +extern "C" +{ +#endif + +#include + +#if !defined(WINDOWS) && !defined(_WIN32) +#define FAR +#define LPSTR char * +#endif + +typedef LPSTR (*err_func)(int, long); + +#ifdef WIN16 +#define COMEXP __far __export +int COMEXP com_err_export (LPSTR, long, LPSTR, ...); +LPSTR COMEXP error_message_export (long); +LPSTR COMEXP error_table_name_export(long num); +extern int (*com_err) (LPSTR, long, LPSTR, ...); +int mbprintf (LPSTR, LPSTR, ...); +LPSTR (*error_message) (long); +int (*set_com_err_hook (int (*) (LPSTR, long, LPSTR, va_list))) + (LPSTR, long, LPSTR, va_list); +extern int (*reset_com_err_hook ()) (LPSTR, long, LPSTR, va_list); + +// extern LPSTR (*error_table_name)(long num); +LPSTR (*error_table_name)(long num); + +#else +#define COMEXP +int com_err (LPSTR, long, LPSTR, ...); +int mbprintf (LPSTR, LPSTR, ...); +LPSTR error_message (long); +int (*set_com_err_hook (int (*) (LPSTR, long, LPSTR, va_list))) + (LPSTR, long, LPSTR, va_list); +int (*reset_com_err_hook ()) (LPSTR, long, LPSTR, va_list); +LPSTR error_table_name(long num); + +#endif + + + +#if defined(__cplusplus) +} +#endif + +#endif // _DCNS_MIT_COM_ERR_H + diff --git a/src/WINNT/kfw/inc/krb4/conf-pc.h b/src/WINNT/kfw/inc/krb4/conf-pc.h new file mode 100644 index 000000000..043b6f859 --- /dev/null +++ b/src/WINNT/kfw/inc/krb4/conf-pc.h @@ -0,0 +1,108 @@ +/* + * Copyright 1988 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Machine-type definitions: IBM PC 8086 + */ + +#if defined(_WIN32) && !defined(WIN32) +#define WIN32 +#endif + +#if ( defined(WIN16) || defined(WIN32) || defined(_WINDOWS)) && !defined(WINDOWS) +#define WINDOWS +#endif + +#if defined(__OS2__) && !defined(OS2) +#define OS2 +#endif + +#ifdef WIN16 +#define BITS16 +#else +#ifdef MSDOS +#define BITS16 +#else +#define BITS32 +#endif +#endif +#define LSBFIRST + +#define index(s,c) strchr(s,c) /* PC version of index */ +#define rindex(s,c) strrchr(s,c) +#if !defined(OS2) && !defined(LWP) /* utils.h under OS/2 */ +#define bcmp(s1,s2,n) memcmp((s1),(s2),(n)) +#define bcopy(a,b,c) memcpy( (b), (a), (c) ) +#define bzero(a,b) memset( (a), 0, (b) ) +#endif + +typedef unsigned char u_char; +typedef unsigned long u_long; +typedef unsigned short u_short; +typedef unsigned int u_int; +#define NO_UIDGID_T + +#if !defined(WINDOWS) && !defined(DWORD) +typedef long DWORD; +#endif + +#if defined(PC)&&!defined(WINDOWS) +#ifndef LPSTR +typedef char *LPSTR; +typedef char *LPBYTE; +typedef char *CHARPTR; +typedef char *LPINT; +typedef unsigned int WORD; +#endif +#define LONG long +#define FAR +#define PASCAL +#define EXPORT +#endif + +#ifdef OS2 +#include +#define lstrcpy strcpy +#define lstrlen strlen +#define lstrcmp strcmp +#define lstrcpyn strncpy +#endif + +#ifdef WIN32 +#define _export +#endif + +#if defined(BITS32) +#define far +#define near +#endif + +#ifdef WINDOWS +#include +#endif + +#ifdef WIN32 +#include +#endif + +#ifdef WIN16 +#pragma message ( "WIN16 in " __FILE__ ) +#include +#include +#ifndef KRB_INT32 +#define KRB_INT32 long +#endif +#ifndef KRB_UINT32 +#define KRB_UINT32 unsigned KRB_INT32 +#endif +#endif + + +#define RANDOM_KRB_INT32_1 ((KRB_INT32) time(NULL)) +#define RANDOM_KRB_INT32_2 ((KRB_INT32) getpid()) +#define TIME_GMT_UNIXSEC unix_time_gmt_unixsec((unsigned KRB_INT32 *)0); +#ifndef MAXPATHLEN +#define MAXPATHLEN _MAX_PATH +#endif diff --git a/src/WINNT/kfw/inc/krb4/conf.h b/src/WINNT/kfw/inc/krb4/conf.h new file mode 100644 index 000000000..2e2a84cd6 --- /dev/null +++ b/src/WINNT/kfw/inc/krb4/conf.h @@ -0,0 +1,74 @@ +/* + * Copyright 1988 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Configuration info for operating system, hardware description, + * language implementation, C library, etc. + * + * This file should be included in (almost) every file in the Kerberos + * sources, and probably should *not* be needed outside of those + * sources. (How do we deal with /usr/include/des.h and + * /usr/include/krb.h?) + */ + +#ifndef _CONF_H_ +#define _CONF_H_ + +#include "osconf.h" + +#ifdef SHORTNAMES +#include "names.h" +#endif + +/* + * Language implementation-specific definitions + */ + +/* special cases */ +#ifdef __HIGHC__ +/* broken implementation of ANSI C */ +#undef __STDC__ +#endif + +#if !defined(__STDC__) && !defined(PC) +#define const +#define volatile +#define signed +typedef char *pointer; /* pointer to generic data */ +#ifndef PROTOTYPE +#define PROTOTYPE(p) () +#endif +#else +typedef void *pointer; +#ifndef PROTOTYPE +#define PROTOTYPE(p) p +#endif +#endif + +/* Does your compiler understand "void"? */ +#ifdef notdef +#define void int +#endif + +/* + * A few checks to see that necessary definitions are included. + */ + +#ifndef MSBFIRST +#ifndef LSBFIRST +#error byte order not defined +#endif +#endif + +/* machine size */ +#ifndef BITS16 +#ifndef BITS32 +#error number of bits? +#endif +#endif + +/* end of checks */ + +#endif /* _CONF_H_ */ diff --git a/src/WINNT/kfw/inc/krb4/des.h b/src/WINNT/kfw/inc/krb4/des.h new file mode 100644 index 000000000..2f30afa00 --- /dev/null +++ b/src/WINNT/kfw/inc/krb4/des.h @@ -0,0 +1,115 @@ +/* + * des.h + * + * Copyright 1987, 1988 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Include file for the Data Encryption Standard library. + */ + +/* only do the whole thing once */ +#ifndef DES_DEFS +#define DES_DEFS + +#include "mit_copy.h" +#include "conf.h" + +#ifndef KRB_INT32 +#define KRB_INT32 long +#endif +#ifndef KRB_UINT32 +#define KRB_UINT32 unsigned KRB_INT32 +#endif + +/* There are some declarations in the system-specific header files which + can't be done until KRB_INT32 is defined. So they are in a macro, + which we expand here if defined. */ + +#ifdef DECL_THAT_NEEDS_KRB_INT32 +DECL_THAT_NEEDS_KRB_INT32 +#endif + +typedef unsigned char des_cblock[8]; /* crypto-block size */ +/* Key schedule */ +typedef struct des_ks_struct { union { KRB_INT32 pad; des_cblock _;} __; } des_key_schedule[16]; + +#define DES_KEY_SZ (sizeof(des_cblock)) +#define DES_ENCRYPT 1 +#define DES_DECRYPT 0 + +#ifndef NCOMPAT +#define C_Block des_cblock +#define Key_schedule des_key_schedule +#define ENCRYPT DES_ENCRYPT +#define DECRYPT DES_DECRYPT +#define KEY_SZ DES_KEY_SZ +#define string_to_key des_string_to_key +#define read_pw_string des_read_pw_string +#define random_key des_random_key +#define pcbc_encrypt des_pcbc_encrypt +#define key_sched des_key_sched +#define cbc_encrypt des_cbc_encrypt +#define cbc_cksum des_cbc_cksum +#define C_Block_print des_cblock_print +#define quad_cksum des_quad_cksum +typedef struct des_ks_struct bit_64; +#endif + +#define des_cblock_print(x) des_cblock_print_file(x, stdout) + +/* Function declarations */ + +#define DES_CALLCONV_C + +extern unsigned long DES_CALLCONV_C +quad_cksum PROTOTYPE (( + unsigned char *in, /* input block */ + unsigned KRB_INT32 *out,/* optional longer output */ + long length, /* original length in bytes */ + int out_count, /* number of iterations */ + des_cblock *c_seed)); /* secret seed, 8 bytes */ + +int DES_CALLCONV_C +des_key_sched PROTOTYPE ((des_cblock FAR, des_key_schedule FAR)); + +int DES_CALLCONV_C +des_ecb_encrypt PROTOTYPE ((des_cblock FAR *, des_cblock FAR *, + des_key_schedule FAR, int)); + +int DES_CALLCONV_C +des_pcbc_encrypt PROTOTYPE ((des_cblock FAR *, des_cblock FAR *, long, + des_key_schedule FAR, des_cblock FAR *, int)); + +int DES_CALLCONV_C +des_is_weak_key PROTOTYPE ((des_cblock FAR)); + +void DES_CALLCONV_C +des_fixup_key_parity PROTOTYPE ((des_cblock FAR)); + +int DES_CALLCONV_C +des_check_key_parity PROTOTYPE ((des_cblock FAR)); + +/* + These random_key routines are made external here + for the Macintosh Driver which exports pointers to them + to applications via a driver level interface. + Preserved for KClient compatability. +*/ + +int DES_CALLCONV_C +des_new_random_key PROTOTYPE (( des_cblock )); + +void DES_CALLCONV_C +des_init_random_number_generator PROTOTYPE (( des_cblock )); + +void DES_CALLCONV_C +des_set_random_generator_seed PROTOTYPE (( des_cblock )); + +unsigned long DES_CALLCONV_C +des_cbc_cksum PROTOTYPE ((des_cblock *,des_cblock *,long,des_key_schedule,des_cblock)); + +/* FIXME, put the rest of the function declarations here */ + +#endif /* DES_DEFS */ diff --git a/src/WINNT/kfw/inc/krb4/kadm_err.h b/src/WINNT/kfw/inc/krb4/kadm_err.h new file mode 100644 index 000000000..8e65f9387 --- /dev/null +++ b/src/WINNT/kfw/inc/krb4/kadm_err.h @@ -0,0 +1,56 @@ +/* + * kadm_err.h + * This file is the #include file for kadm_err.et. + * Please do not edit it as it is automatically generated. + */ + +#define KADM_RCSID (-1783126272L) +#define KADM_NO_REALM (-1783126271L) +#define KADM_NO_CRED (-1783126270L) +#define KADM_BAD_KEY (-1783126269L) +#define KADM_NO_ENCRYPT (-1783126268L) +#define KADM_NO_AUTH (-1783126267L) +#define KADM_WRONG_REALM (-1783126266L) +#define KADM_NO_ROOM (-1783126265L) +#define KADM_BAD_VER (-1783126264L) +#define KADM_BAD_CHK (-1783126263L) +#define KADM_NO_READ (-1783126262L) +#define KADM_NO_OPCODE (-1783126261L) +#define KADM_NO_HOST (-1783126260L) +#define KADM_UNK_HOST (-1783126259L) +#define KADM_NO_SERV (-1783126258L) +#define KADM_NO_SOCK (-1783126257L) +#define KADM_NO_CONN (-1783126256L) +#define KADM_NO_HERE (-1783126255L) +#define KADM_NO_MAST (-1783126254L) +#define KADM_NO_VERI (-1783126253L) +#define KADM_INUSE (-1783126252L) +#define KADM_UK_SERROR (-1783126251L) +#define KADM_UK_RERROR (-1783126250L) +#define KADM_UNAUTH (-1783126249L) +#define KADM_DATA (-1783126248L) +#define KADM_NOENTRY (-1783126247L) +#define KADM_NOMEM (-1783126246L) +#define KADM_NO_HOSTNAME (-1783126245L) +#define KADM_NO_BIND (-1783126244L) +#define KADM_LENGTH_ERROR (-1783126243L) +#define KADM_ILL_WILDCARD (-1783126242L) +#define KADM_DB_INUSE (-1783126241L) +#define KADM_INSECURE_PW (-1783126240L) +#define KADM_PW_MISMATCH (-1783126239L) +#ifdef WINDOWS +extern void initialize_kadm_error_table(HANDLE *); +#else +extern void initialize_kadm_error_table(struct et_list **); +#endif +#define ERROR_TABLE_BASE_kadm (-1783126272L) + +/* for compatibility with older versions... */ +#define init_kadm_err_tbl() initialize_kadm_error_table(&_et_list) +#define kadm_err_base ERROR_TABLE_BASE_kadm + +#ifdef WINDOWS +extern HANDLE _et_list; +#else +extern struct et_list *_et_list; +#endif diff --git a/src/WINNT/kfw/inc/krb4/krb.h b/src/WINNT/kfw/inc/krb4/krb.h new file mode 100644 index 000000000..e1deac108 --- /dev/null +++ b/src/WINNT/kfw/inc/krb4/krb.h @@ -0,0 +1,455 @@ +/* + * Copyright 1987, 1988 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Include file for the Kerberos library. + */ + +/* Only one time, please */ +#ifndef KRB_DEFS +#define KRB_DEFS + +#include + +/* Need some defs from des.h */ +#include + +/* Text describing error codes */ +#define MAX_KRB_ERRORS 256 +extern char *krb_err_txt[MAX_KRB_ERRORS]; + +/* General definitions */ +#define KSUCCESS 0 +#define KFAILURE 255 + +#ifdef NO_UIDGID_T +typedef unsigned short uid_t; +typedef unsigned short gid_t; +#endif /* NO_UIDGID_T */ + +/* + * Kerberos specific definitions + * + * KRBLOG is the log file for the kerberos master server. KRB_CONF is + * the configuration file where different host machines running master + * and slave servers can be found. KRB_MASTER is the name of the + * machine with the master database. The admin_server runs on this + * machine, and all changes to the db (as opposed to read-only + * requests, which can go to slaves) must go to it. KRB_HOST is the + * default machine * when looking for a kerberos slave server. Other + * possibilities are * in the KRB_CONF file. KRB_REALM is the name of + * the realm. + */ + +#ifdef notdef +/* this is server - only, does not belong here; */ +#define KRBLOG "/kerberos/kerberos.log" +/* are these used anyplace? */ +#define VX_KRB_HSTFILE "/etc/krbhst" +#define PC_KRB_HSTFILE "\\kerberos\\krbhst" +#endif + +#ifdef PC + +#define KRB_CONF "krb.con" +#define KRB_RLM_TRANS "krbrealm.con" + +#else + +#define KRB_CONF "/etc/krb.conf" +#define KRB_RLM_TRANS "/etc/krb.realms" + +#endif /* PC */ + +/* Resources? XXX */ +#define KRB_MASTER "kerberos.mit.edu" +#define KRB_REALM "ATHENA.MIT.EDU" +#define KRB_HOST KRB_MASTER + +/* The maximum sizes for aname, realm, sname, and instance +1 */ +#define ANAME_SZ 40 +#define REALM_SZ 40 +#define SNAME_SZ 40 +#define INST_SZ 40 +#define ADDR_SZ 40 +/* include space for '.' and '@' */ +#define MAX_K_NAME_SZ (ANAME_SZ + INST_SZ + REALM_SZ + 2) +#define KKEY_SZ 100 +#define VERSION_SZ 1 +#define MSG_TYPE_SZ 1 +#define DATE_SZ 26 /* RTI date output */ + +#define MAX_HSTNM 100 + +#ifndef DEFAULT_TKT_LIFE /* allow compile-time override */ +#define DEFAULT_TKT_LIFE 120 /* default lifetime for krb_mk_req + & co., 10 hrs */ +#endif + +/* Definition of text structure used to pass text around */ +#define MAX_KTXT_LEN 1250 + +struct ktext { + int length; /* Length of the text */ + unsigned char dat[MAX_KTXT_LEN]; /* The data itself */ + unsigned long mbz; /* zero to catch runaway strings */ +}; + +typedef struct ktext far *KTEXT; +typedef struct ktext far *KTEXT_FP; +typedef struct ktext KTEXT_ST; + + +/* Definitions for send_to_kdc */ +#define CLIENT_KRB_TIMEOUT 10 /* time between retries */ /* changed from 4, 8-14-94 pbh */ +#define CLIENT_KRB_RETRY 5 /* retry this many times */ +#define CLIENT_KRB_BUFLEN 512 /* max unfragmented packet */ + +/* Definitions for ticket file utilities */ +#define R_TKT_FIL 0 +#define W_TKT_FIL 1 + +/* Definitions for cl_get_tgt */ +#ifdef PC +#define CL_GTGT_INIT_FILE "\\kerberos\\k_in_tkts" /* WTF??!? */ +#else +#define CL_GTGT_INIT_FILE "/etc/k_in_tkts" +#endif /* PC */ + +/* Parameters for rd_ap_req */ +/* Maximum alloable clock skew in seconds */ +#define CLOCK_SKEW 5*60 +/* Filename for readservkey */ +#define KEYFILE "/etc/srvtab" + +/* Structure definition for rd_ap_req */ + +struct auth_dat { + unsigned char k_flags; /* Flags from ticket */ + char pname[ANAME_SZ]; /* Principal's name */ + char pinst[INST_SZ]; /* His Instance */ + char prealm[REALM_SZ]; /* His Realm */ + unsigned long checksum; /* Data checksum (opt) */ + C_Block session; /* Session Key */ + int life; /* Life of ticket */ + unsigned long time_sec; /* Time ticket issued */ + unsigned long address; /* Address in ticket */ + KTEXT_ST reply; /* Auth reply (opt) */ +}; + +typedef struct auth_dat AUTH_DAT; + +/* Structure definition for credentials returned by get_cred */ + +struct credentials { + char service[ANAME_SZ]; /* Service name */ + char instance[INST_SZ]; /* Instance */ + char realm[REALM_SZ]; /* Auth domain */ + C_Block session; /* Session key */ + int lifetime; /* Lifetime */ + int kvno; /* Key version number */ + KTEXT_ST ticket_st; /* The ticket itself */ + long issue_date; /* The issue time */ + char pname[ANAME_SZ]; /* Principal's name */ + char pinst[INST_SZ]; /* Principal's instance */ + char address[ADDR_SZ]; /* IP Address in ticket */ +}; + +typedef struct credentials CREDENTIALS; + +/* Structure definition for rd_private_msg and rd_safe_msg */ + +struct msg_dat { + unsigned char far *app_data; /* pointer to appl data */ + unsigned long app_length; /* length of appl data */ + unsigned long hash; /* hash to lookup replay */ + int swap; /* swap bytes? */ + long time_sec; /* msg timestamp seconds */ + unsigned char time_5ms; /* msg timestamp 5ms units */ +}; + +typedef struct msg_dat MSG_DAT; + + +/* Location of ticket file for save_cred and get_cred */ +#define TKT_FILE tkt_string() + +#define TKT_ENV "KERBEROS_TICKETS" +typedef struct { + unsigned buf_size; + unsigned dummy; + unsigned eof_ptr; + int sema; /* semaphore 0 - OK, -1 - lock write, +ve lock read */ +} tkt_header; + +tkt_header far *tkt_ptr(void); + +#define KM_TKFILE 0 +#define KM_KRBMEM 1 + +#define TKT_ROOT "/tmp/tkt" + +/* Error codes returned from the KDC */ +#define KDC_OK 0 /* Request OK */ +#define KDC_NAME_EXP 1 /* Principal expired */ +#define KDC_SERVICE_EXP 2 /* Service expired */ +#define KDC_AUTH_EXP 3 /* Auth expired */ +#define KDC_PKT_VER 4 /* Protocol version unknown */ +#define KDC_P_MKEY_VER 5 /* Wrong master key version */ +#define KDC_S_MKEY_VER 6 /* Wrong master key version */ +#define KDC_BYTE_ORDER 7 /* Byte order unknown */ +#define KDC_PR_UNKNOWN 8 /* Principal unknown */ +#define KDC_PR_N_UNIQUE 9 /* Principal not unique */ +#define KDC_NULL_KEY 10 /* Principal has null key */ +#define KDC_GEN_ERR 20 /* Generic error from KDC */ + +/* Values returned by get_credentials */ +#define GC_OK 0 /* Retrieve OK */ +#define RET_OK 0 /* Retrieve OK */ +#define GC_TKFIL 21 /* Can't read ticket file */ +#define RET_TKFIL 21 /* Can't read ticket file */ +#define GC_NOTKT 22 /* Can't find ticket or TGT */ +#define RET_NOTKT 22 /* Can't find ticket or TGT */ + +/* Values returned by mk_ap_req */ +#define MK_AP_OK 0 /* Success */ +#define MK_AP_TGTEXP 26 /* TGT Expired */ + +/* Values returned by rd_ap_req */ +#define RD_AP_OK 0 /* Request authentic */ +#define RD_AP_UNDEC 31 /* Can't decode authenticator */ +#define RD_AP_EXP 32 /* Ticket expired */ +#define RD_AP_NYV 33 /* Ticket not yet valid */ +#define RD_AP_REPEAT 34 /* Repeated request */ +#define RD_AP_NOT_US 35 /* The ticket isn't for us */ +#define RD_AP_INCON 36 /* Request is inconsistent */ +#define RD_AP_TIME 37 /* delta_t too big */ +#define RD_AP_BADD 38 /* Incorrect net address */ +#define RD_AP_VERSION 39 /* protocol version mismatch */ +#define RD_AP_MSG_TYPE 40 /* invalid msg type */ +#define RD_AP_MODIFIED 41 /* message stream modified */ +#define RD_AP_ORDER 42 /* message out of order */ +#define RD_AP_UNAUTHOR 43 /* unauthorized request */ + +/* Values returned by get_pw_tkt */ +#define GT_PW_OK 0 /* Got password changing tkt */ +#define GT_PW_NULL 51 /* Current PW is null */ +#define GT_PW_BADPW 52 /* Incorrect current password */ +#define GT_PW_PROT 53 /* Protocol Error */ +#define GT_PW_KDCERR 54 /* Error returned by KDC */ +#define GT_PW_NULLTKT 55 /* Null tkt returned by KDC */ + +/* Values returned by send_to_kdc */ +#define SKDC_OK 0 /* Response received */ +#define SKDC_RETRY 56 /* Retry count exceeded */ +#define SKDC_CANT 57 /* Can't send request */ + +/* + * Values returned by get_intkt + * (can also return SKDC_* and KDC errors) + */ + +#define INTK_OK 0 /* Ticket obtained */ +#define INTK_PW_NULL 51 /* Current PW is null */ +#define INTK_W_NOTALL 61 /* Not ALL tickets returned */ +#define INTK_BADPW 62 /* Incorrect password */ +#define INTK_PROT 63 /* Protocol Error */ +#define INTK_ERR 70 /* Other error */ + +/* Values returned by get_adtkt */ +#define AD_OK 0 /* Ticket Obtained */ +#define AD_NOTGT 71 /* Don't have tgt */ + +/* Error codes returned by ticket file utilities */ +#define NO_TKT_FIL 76 /* No ticket file found */ +#define TKT_FIL_ACC 77 /* Couldn't access tkt file */ +#define TKT_FIL_LCK 78 /* Couldn't lock ticket file */ +#define TKT_FIL_FMT 79 /* Bad ticket file format */ +#define TKT_FIL_INI 80 /* tf_init not called first */ + +/* Error code returned by kparse_name */ +#define KNAME_FMT 81 /* Bad Kerberos name format */ + +/* Error code returned by krb_mk_safe */ +#define SAFE_PRIV_ERROR -1 /* syscall error */ + +/* + * macros for byte swapping; also scratch space + * u_quad 0-->7, 1-->6, 2-->5, 3-->4, 4-->3, 5-->2, 6-->1, 7-->0 + * u_long 0-->3, 1-->2, 2-->1, 3-->0 + * u_short 0-->1, 1-->0 + */ + +#define swap_u_16(x) {\ + unsigned long _krb_swap_tmp[4];\ + _swab(((char *) x) +0, ((char *) _krb_swap_tmp) +14 ,2); \ + _swab(((char *) x) +2, ((char *) _krb_swap_tmp) +12 ,2); \ + _swab(((char *) x) +4, ((char *) _krb_swap_tmp) +10 ,2); \ + _swab(((char *) x) +6, ((char *) _krb_swap_tmp) +8 ,2); \ + _swab(((char *) x) +8, ((char *) _krb_swap_tmp) +6 ,2); \ + _swab(((char *) x) +10,((char *) _krb_swap_tmp) +4 ,2); \ + _swab(((char *) x) +12,((char *) _krb_swap_tmp) +2 ,2); \ + _swab(((char *) x) +14,((char *) _krb_swap_tmp) +0 ,2); \ + bcopy((char *)_krb_swap_tmp,(char *)x,16);\ + } + +#define swap_u_12(x) {\ + unsigned long _krb_swap_tmp[4];\ + _swab(( char *) x, ((char *) _krb_swap_tmp) +10 ,2); \ + _swab(((char *) x) +2, ((char *) _krb_swap_tmp) +8 ,2); \ + _swab(((char *) x) +4, ((char *) _krb_swap_tmp) +6 ,2); \ + _swab(((char *) x) +6, ((char *) _krb_swap_tmp) +4 ,2); \ + _swab(((char *) x) +8, ((char *) _krb_swap_tmp) +2 ,2); \ + _swab(((char *) x) +10,((char *) _krb_swap_tmp) +0 ,2); \ + bcopy((char *)_krb_swap_tmp,(char *)x,12);\ + } + +#define swap_C_Block(x) {\ + unsigned long _krb_swap_tmp[4];\ + _swab(( char *) x, ((char *) _krb_swap_tmp) +6 ,2); \ + _swab(((char *) x) +2,((char *) _krb_swap_tmp) +4 ,2); \ + _swab(((char *) x) +4,((char *) _krb_swap_tmp) +2 ,2); \ + _swab(((char *) x) +6,((char *) _krb_swap_tmp) ,2); \ + bcopy((char *)_krb_swap_tmp,(char *)x,8);\ + } +#define swap_u_quad(x) {\ + unsigned long _krb_swap_tmp[4];\ + _swab(( char *) &x, ((char *) _krb_swap_tmp) +6 ,2); \ + _swab(((char *) &x) +2,((char *) _krb_swap_tmp) +4 ,2); \ + _swab(((char *) &x) +4,((char *) _krb_swap_tmp) +2 ,2); \ + _swab(((char *) &x) +6,((char *) _krb_swap_tmp) ,2); \ + bcopy((char *)_krb_swap_tmp,(char *)&x,8);\ + } + +#define swap_u_long(x) {\ + unsigned long _krb_swap_tmp[4];\ + _swab((char *) &x, ((char *) _krb_swap_tmp) +2 ,2); \ + _swab(((char *) &x) +2,((char *) _krb_swap_tmp),2); \ + x = _krb_swap_tmp[0]; \ + } + +#define swap_u_short(x) {\ + unsigned short _krb_swap_sh_tmp; \ + _swab((char *) &x, ( &_krb_swap_sh_tmp) ,2); \ + x = (unsigned short) _krb_swap_sh_tmp; \ + } + +/* Kerberos ticket flag field bit definitions */ +#define K_FLAG_ORDER 0 /* bit 0 --> lsb */ +#define K_FLAG_1 /* reserved */ +#define K_FLAG_2 /* reserved */ +#define K_FLAG_3 /* reserved */ +#define K_FLAG_4 /* reserved */ +#define K_FLAG_5 /* reserved */ +#define K_FLAG_6 /* reserved */ +#define K_FLAG_7 /* reserved, bit 7 --> msb */ + +#ifdef OLDNAMES +#define krb_mk_req mk_ap_req +#define krb_rd_req rd_ap_req +#define krb_kntoln an_to_ln +#define krb_set_key set_serv_key +#define krb_get_cred get_credentials +#define krb_mk_priv mk_private_msg +#define krb_rd_priv rd_private_msg +#define krb_mk_safe mk_safe_msg +#define krb_rd_safe rd_safe_msg +#define krb_mk_err mk_appl_err_msg +#define krb_rd_err rd_appl_err_msg +#define krb_ck_repl check_replay +#define krb_get_pw_in_tkt get_in_tkt +#define krb_get_svc_in_tkt get_svc_in_tkt +#define krb_get_pw_tkt get_pw_tkt +#define krb_realmofhost krb_getrealm +#define krb_get_phost get_phost +#define krb_get_krbhst get_krbhst +#define krb_get_lrealm get_krbrlm +#endif /* OLDNAMES */ + +#define decomp_ticket k_decomp_ticket +/* Defines for krb_sendauth and krb_recvauth */ + +#define KOPT_DONT_MK_REQ 0x00000001 /* don't call krb_mk_req */ +#define KOPT_DO_MUTUAL 0x00000002 /* do mutual auth */ + +#define KOPT_DONT_CANON 0x00000004 /* + * don't canonicalize inst as + * a hostname + */ + +#define KRB_SENDAUTH_VLEN 8 /* length for version strings */ + +#ifdef ATHENA_COMPAT +#define KOPT_DO_OLDSTYLE 0x00000008 /* use the old-style protocol */ +#endif /* ATHENA_COMPAT */ + +char *tkt_string(); + +int gettimeofday(struct timeval *tv, struct timezone *tz); + +int PASCAL krb_sendauth(long, int, KTEXT, char *, char *, char *, + unsigned long, MSG_DAT *, CREDENTIALS *, + Key_schedule *, struct sockaddr_in *, + struct sockaddr_in FAR *, char *); +int PASCAL krb_mk_req(KTEXT, char *, char *, char *, long); +char * PASCAL krb_getrealm(char *host); + +void tkt_free(tkt_header FAR* hdr); +int krb_get_tf_fullname(char FAR *, char FAR *, char FAR *, char FAR *); +int krb_get_tf_realm(char FAR *,char FAR *); +int tf_init(char FAR*,int); + +long LocalHostAddr(); +int tf_get_pname(char FAR*); +int tf_get_pinst(char FAR*); +int tf_get_cred(CREDENTIALS FAR*); +void tf_close(void); +int tf_save_cred(char FAR*,char FAR*,char FAR*,C_Block,int,int,KTEXT,long); +BOOL k_isinst(char FAR *s); +BOOL k_isrealm(char FAR *s); +BOOL k_isname(char FAR *s); + +char ** get_krb_err_txt(void); /* 2-22-93, pbh */ + +/* Warning, unique to Windows! */ +int set_krb_debug(int); +int set_krb_ap_req_debug(int); +char * PASCAL get_krb_err_txt_entry(int i); +char * krb_err_func(int offset, long code); +int PASCAL k_decomp_ticket(KTEXT, unsigned char *, char *, char *, char *, + unsigned long *, C_Block, int *, unsigned long *, + char *, char *, C_Block, Key_schedule); +int PASCAL krb_mk_req(KTEXT,char *,char *,char *,long); +char * PASCAL krb_getrealm(char *host); +char * PASCAL krb_realmofhost(char *host); +char * krb_get_phost(char *host); + +int kname_parse(char *, char *, char *, char *); +int krb_get_pw_in_tkt(char *, char *, char *, char *, char *, int, char *); +int dest_tkt(void); +int krb_get_lrealm(char *, int); + +int krb_use_kerbmem(); +int krb_check_tgt(); +int krb_check_serv(char *); + +int krb_get_cred(char *, char *, char *, CREDENTIALS *); +int send_to_kdc(KTEXT, KTEXT, char *); + +int create_ciph(KTEXT, C_Block, char *, char *, char *, unsigned long, int, + KTEXT, unsigned long, C_Block *); + +char *krb_get_krbconf2(char *, size_t *); +char *krb_get_krbrealm2(char *, size_t *); + +int krb_save_credentials(char *service, char *instance, char *realm, + C_Block session, int lifetime, int kvno, + KTEXT ticket, long issue_date); + +#define krb_get_err_text get_krb_err_txt_entry + +int krb_in_tkt(char *pname, char *pinst, char *prealm); + +#endif /* KRB_DEFS */ diff --git a/src/WINNT/kfw/inc/krb4/krberr.h b/src/WINNT/kfw/inc/krb4/krberr.h new file mode 100644 index 000000000..f946bb9b3 --- /dev/null +++ b/src/WINNT/kfw/inc/krb4/krberr.h @@ -0,0 +1,22 @@ +/* + * krberr.h + * This file is the #include file for krberr.et. + * Please do not edit it as it is automatically generated. + */ + +#ifdef WINDOWS +extern void initialize_krb_error_func(err_func func,HANDLE *); +#else +extern void initialize_krb_error_func(err_func func,struct et_list **); +#endif +#define ERROR_TABLE_BASE_krb (39525376L) + +/* for compatibility with older versions... */ +#define init_krb_err_func(erf) initialize_krb_error_func(erf,&_et_list) +#define krb_err_base ERROR_TABLE_BASE_krb + +#ifdef WINDOWS +extern HANDLE _et_list; +#else +extern struct et_list *_et_list; +#endif diff --git a/src/WINNT/kfw/inc/krb4/mit_copy.h b/src/WINNT/kfw/inc/krb4/mit_copy.h new file mode 100644 index 000000000..4fcb06b13 --- /dev/null +++ b/src/WINNT/kfw/inc/krb4/mit_copy.h @@ -0,0 +1,20 @@ +/* + Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 by the Massachusetts Institute of Technology + + Export of this software from the United States of America is assumed + to require a specific license from the United States Government. + It is the responsibility of any person or organization contemplating + export to obtain such a license before exporting. + +WITHIN THAT CONSTRAINT, permission to use, copy, modify, and +distribute this software and its documentation for any purpose and +without fee is hereby granted, provided that the above copyright +notice appear in all copies and that both that copyright notice and +this permission notice appear in supporting documentation, and that +the name of M.I.T. not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. M.I.T. makes no representations about the suitability of +this software for any purpose. It is provided "as is" without express +or implied warranty. + + */ diff --git a/src/WINNT/kfw/inc/krb4/osconf.h b/src/WINNT/kfw/inc/krb4/osconf.h new file mode 100644 index 000000000..340421e86 --- /dev/null +++ b/src/WINNT/kfw/inc/krb4/osconf.h @@ -0,0 +1,59 @@ +/* + * Copyright 1988 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Athena configuration. + */ + +#ifndef _OSCONF_H_ +#define _OSCONF_H_ + +#ifndef PC +#if defined(IBMPC) || defined(__MSDOS__) || defined(OS2) || defined(_MSDOS) || defined(_WIN32) +#define PC +#endif +#endif + +#ifdef tahoe +#include "conf-bsdtahoe.h" +#else /* !tahoe */ +#ifdef vax +#include "conf-bsdvax.h" +#else /* !vax */ +#if defined(mips) && defined(ultrix) +#include "conf-ultmips2.h" +#else /* !Ultrix MIPS-2 */ +#ifdef ibm032 +#include "conf-bsdibm032.h" +#else /* !ibm032 */ +#ifdef apollo +#include "conf-bsdapollo.h" +#else /* !apollo */ +#ifdef sun +#ifdef sparc +#include "conf-bsdsparc.h" +#else /* sun but not sparc */ +#ifdef i386 +#include "conf-bsd386i.h" +#else /* sun but not (sparc or 386i) */ +#include "conf-bsdm68k.h" +#endif /* i386 */ +#endif /* sparc */ +#else /* !sun */ +#ifdef pyr +#include "conf-pyr.h" +#else +#if defined(PC) || defined(__MSDOS__) || defined(OS2) || defined(_MSDOS) || defined(_WIN32) +#include "conf-pc.h" +#endif /* PC */ +#endif /* pyr */ +#endif /* sun */ +#endif /* apollo */ +#endif /* ibm032 */ +#endif /* mips */ +#endif /* vax */ +#endif /* tahoe */ + +#endif /* _OSCONF_H_ */ diff --git a/src/WINNT/kfw/inc/krb5/KerberosIV/des.h b/src/WINNT/kfw/inc/krb5/KerberosIV/des.h new file mode 100644 index 000000000..8655e1d8f --- /dev/null +++ b/src/WINNT/kfw/inc/krb5/KerberosIV/des.h @@ -0,0 +1,209 @@ +/* + * include/kerberosIV/des.h + * + * Copyright 1987, 1988, 1994, 2002 by the Massachusetts Institute of + * Technology. All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * Include file for the Data Encryption Standard library. + */ + +#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)) +# include +# if TARGET_RT_MAC_CFM +# error "Use KfM 4.0 SDK headers for CFM compilation." +# endif +#endif + +#ifdef __cplusplus +#ifndef KRBINT_BEGIN_DECLS +#define KRBINT_BEGIN_DECLS extern "C" { +#define KRBINT_END_DECLS } +#endif +#else +#define KRBINT_BEGIN_DECLS +#define KRBINT_END_DECLS +#endif + +#ifndef KRB5INT_DES_TYPES_DEFINED +#define KRB5INT_DES_TYPES_DEFINED + +#include + +KRBINT_BEGIN_DECLS + +#if TARGET_OS_MAC +# if defined(__MWERKS__) +# pragma import on +# endif +# pragma options align=mac68k +#endif + +#if UINT_MAX >= 0xFFFFFFFFUL +#define DES_INT32 int +#define DES_UINT32 unsigned int +#else +#define DES_INT32 long +#define DES_UINT32 unsigned long +#endif + +typedef unsigned char des_cblock[8]; /* crypto-block size */ +/* + * Key schedule. + * + * This used to be + * + * typedef struct des_ks_struct { + * union { DES_INT32 pad; des_cblock _;} __; + * } des_key_schedule[16]; + * + * but it would cause trouble if DES_INT32 were ever more than 4 + * bytes. The reason is that all the encryption functions cast it to + * (DES_INT32 *), and treat it as if it were DES_INT32[32]. If + * 2*sizeof(DES_INT32) is ever more than sizeof(des_cblock), the + * caller-allocated des_key_schedule will be overflowed by the key + * scheduling functions. We can't assume that every platform will + * have an exact 32-bit int, and nothing should be looking inside a + * des_key_schedule anyway. + */ +typedef struct des_ks_struct { DES_INT32 _[2]; } des_key_schedule[16]; + +#if TARGET_OS_MAC +# if defined(__MWERKS__) +# pragma enumsalwaysint reset +# pragma import reset +# endif +# pragma options align=reset +#endif + +KRBINT_END_DECLS + +#endif /* KRB5INT_DES_TYPES_DEFINED */ + +/* only do the whole thing once */ +#ifndef DES_DEFS +/* + * lib/crypto/des/des_int.h defines KRB5INT_CRYPTO_DES_INT temporarily + * to avoid including the defintions and declarations below. The + * reason that the crypto library needs to include this file is that + * it needs to have its types aligned with krb4's types. + */ +#ifndef KRB5INT_CRYPTO_DES_INT +#define DES_DEFS + +#if defined(_WIN32) +#ifndef KRB4 +#define KRB4 1 +#endif +#include +#endif +#include /* need FILE for des_cblock_print_file */ + +KRBINT_BEGIN_DECLS + +#if TARGET_OS_MAC +# if defined(__MWERKS__) +# pragma import on +# pragma enumsalwaysint on +# endif +# pragma options align=mac68k +#endif + +/* Windows declarations */ +#ifndef KRB5_CALLCONV +#define KRB5_CALLCONV +#define KRB5_CALLCONV_C +#endif + +#define DES_KEY_SZ (sizeof(des_cblock)) +#define DES_ENCRYPT 1 +#define DES_DECRYPT 0 + +#ifndef NCOMPAT +#define C_Block des_cblock +#define Key_schedule des_key_schedule +#define ENCRYPT DES_ENCRYPT +#define DECRYPT DES_DECRYPT +#define KEY_SZ DES_KEY_SZ +#define string_to_key des_string_to_key +#define read_pw_string des_read_pw_string +#define random_key des_random_key +#define pcbc_encrypt des_pcbc_encrypt +#define key_sched des_key_sched +#define cbc_encrypt des_cbc_encrypt +#define cbc_cksum des_cbc_cksum +#define C_Block_print des_cblock_print +#define quad_cksum des_quad_cksum +typedef struct des_ks_struct bit_64; +#endif + +#define des_cblock_print(x) des_cblock_print_file(x, stdout) + +/* + * Function Prototypes + */ + +int KRB5_CALLCONV des_key_sched (C_Block, Key_schedule); + +int KRB5_CALLCONV +des_pcbc_encrypt (C_Block *in, C_Block *out, long length, + const des_key_schedule schedule, C_Block *ivec, + int enc); + +unsigned long KRB5_CALLCONV +des_quad_cksum (const unsigned char *in, unsigned DES_INT32 *out, + long length, int out_count, C_Block *seed); +/* + * XXX ABI change: used to return void; also, cns/kfm have signed long + * instead of unsigned long length. + */ +unsigned long KRB5_CALLCONV +des_cbc_cksum(const des_cblock *, des_cblock *, unsigned long, + const des_key_schedule, const des_cblock *); +int KRB5_CALLCONV des_string_to_key (const char *, C_Block); +void afs_string_to_key(char *, char *, des_cblock); + +/* XXX ABI change: used to return krb5_error_code */ +int KRB5_CALLCONV des_read_password(des_cblock *, char *, int); +int KRB5_CALLCONV des_ecb_encrypt(des_cblock *, des_cblock *, + const des_key_schedule, int); +/* XXX kfm/cns have signed long length */ +int des_cbc_encrypt(des_cblock *, des_cblock *, unsigned long, + const des_key_schedule, const des_cblock *, int); +void des_fixup_key_parity(des_cblock); +int des_check_key_parity(des_cblock); +int KRB5_CALLCONV des_new_random_key(des_cblock); +void des_init_random_number_generator(des_cblock); +int des_random_key(des_cblock *); +int des_is_weak_key(des_cblock); +void des_cblock_print_file(des_cblock *, FILE *fp); + +#if TARGET_OS_MAC +# if defined(__MWERKS__) +# pragma import reset +# endif +# pragma options align=reset +#endif + +KRBINT_END_DECLS + +#endif /* KRB5INT_CRYPTO_DES_INT */ +#endif /* DES_DEFS */ diff --git a/src/WINNT/kfw/inc/krb5/KerberosIV/kadm_err.h b/src/WINNT/kfw/inc/krb5/KerberosIV/kadm_err.h new file mode 100644 index 000000000..8d10bf5e1 --- /dev/null +++ b/src/WINNT/kfw/inc/krb5/KerberosIV/kadm_err.h @@ -0,0 +1,58 @@ +/* + * include//kerberosIV/kadm_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define KADM_RCSID (-1783126272L) +#define KADM_NO_REALM (-1783126271L) +#define KADM_NO_CRED (-1783126270L) +#define KADM_BAD_KEY (-1783126269L) +#define KADM_NO_ENCRYPT (-1783126268L) +#define KADM_NO_AUTH (-1783126267L) +#define KADM_WRONG_REALM (-1783126266L) +#define KADM_NO_ROOM (-1783126265L) +#define KADM_BAD_VER (-1783126264L) +#define KADM_BAD_CHK (-1783126263L) +#define KADM_NO_READ (-1783126262L) +#define KADM_NO_OPCODE (-1783126261L) +#define KADM_NO_HOST (-1783126260L) +#define KADM_UNK_HOST (-1783126259L) +#define KADM_NO_SERV (-1783126258L) +#define KADM_NO_SOCK (-1783126257L) +#define KADM_NO_CONN (-1783126256L) +#define KADM_NO_HERE (-1783126255L) +#define KADM_NO_MAST (-1783126254L) +#define KADM_NO_VERI (-1783126253L) +#define KADM_INUSE (-1783126252L) +#define KADM_UK_SERROR (-1783126251L) +#define KADM_UK_RERROR (-1783126250L) +#define KADM_UNAUTH (-1783126249L) +#define KADM_DATA (-1783126248L) +#define KADM_NOENTRY (-1783126247L) +#define KADM_NOMEM (-1783126246L) +#define KADM_NO_HOSTNAME (-1783126245L) +#define KADM_NO_BIND (-1783126244L) +#define KADM_LENGTH_ERROR (-1783126243L) +#define KADM_ILL_WILDCARD (-1783126242L) +#define KADM_DB_INUSE (-1783126241L) +#define KADM_INSECURE_PW (-1783126240L) +#define KADM_PW_MISMATCH (-1783126239L) +#define KADM_NOT_SERV_PRINC (-1783126238L) +#define KADM_REALM_TOO_LONG (-1783126237L) +#define ERROR_TABLE_BASE_kadm (-1783126272L) + +extern const struct error_table et_kadm_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_kadm_error_table () /*@modifies internalState@*/; +#else +#define initialize_kadm_error_table() +#endif + +#if !defined(_WIN32) +#define init_kadm_err_tbl initialize_kadm_error_table +#define kadm_err_base ERROR_TABLE_BASE_kadm +#endif diff --git a/src/WINNT/kfw/inc/krb5/KerberosIV/krb.h b/src/WINNT/kfw/inc/krb5/KerberosIV/krb.h new file mode 100644 index 000000000..a79df13b6 --- /dev/null +++ b/src/WINNT/kfw/inc/krb5/KerberosIV/krb.h @@ -0,0 +1,794 @@ +/* + * include/kerberosIV/krb.h + * + * Copyright 1987, 1988, 1994, 2001, 2002 by the Massachusetts + * Institute of Technology. All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * Include file for the Kerberos V4 library. + */ + +/* Only one time, please */ +#ifndef KRB_DEFS +#define KRB_DEFS + +/* + * For MacOS, don't expose prototypes of various private functions. + * Unfortuantely, they've leaked out everywhere else. + */ +#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)) +# include +# if TARGET_RT_MAC_CFM +# error "Use KfM 4.0 SDK headers for CFM compilation." +# endif +# ifndef KRB_PRIVATE +# define KRB_PRIVATE 0 +# endif +#else +# ifndef KRB_PRIVATE +# define KRB_PRIVATE 1 +# endif +#endif + +/* Define u_char, u_short, u_int, and u_long. */ +/* XXX these typdef names are not standardized! */ +#include + +/* Need some defs from des.h */ +#include +#include +#include + +#ifdef _WIN32 +#include +#endif /* _WIN32 */ + +#ifdef __cplusplus +#ifndef KRBINT_BEGIN_DECLS +#define KRBINT_BEGIN_DECLS extern "C" { +#define KRBINT_END_DECLS } +#endif +#else +#define KRBINT_BEGIN_DECLS +#define KRBINT_END_DECLS +#endif +KRBINT_BEGIN_DECLS + +#if TARGET_OS_MAC +# if defined(__MWERKS__) +# pragma import on +# pragma enumsalwaysint on +# endif +# pragma options align=mac68k +#endif + +#define KRB4_32 DES_INT32 +#define KRB_INT32 DES_INT32 +#define KRB_UINT32 DES_UINT32 + +#define MAX_KRB_ERRORS 256 + +#if TARGET_OS_MAC +/* ABI divergence on Mac for backwards compatibility. */ +extern const char * const * const krb_err_txt; +#else +extern const char * const krb_err_txt[MAX_KRB_ERRORS]; +#endif + +/* General definitions */ +#define KSUCCESS 0 +#define KFAILURE 255 + +/* + * Kerberos specific definitions + * + * KRBLOG is the log file for the kerberos master server. KRB_CONF is + * the configuration file where different host machines running master + * and slave servers can be found. KRB_MASTER is the name of the + * machine with the master database. The admin_server runs on this + * machine, and all changes to the db (as opposed to read-only + * requests, which can go to slaves) must go to it. KRB_HOST is the + * default machine * when looking for a kerberos slave server. Other + * possibilities are * in the KRB_CONF file. KRB_REALM is the name of + * the realm. + */ + +#define KRB_CONF "/etc/krb.conf" +#define KRB_RLM_TRANS "/etc/krb.realms" +#define KRB_MASTER "kerberos" +#define KRB_HOST KRB_MASTER +#define KRB_REALM "ATHENA.MIT.EDU" + +/* The maximum sizes for aname, realm, sname, and instance +1 */ +#define ANAME_SZ 40 +#define REALM_SZ 40 +#define SNAME_SZ 40 +#define INST_SZ 40 +#define ADDR_SZ 40 +/* + * NB: This overcounts due to NULs. + */ +/* include space for '.' and '@' */ +#define MAX_K_NAME_SZ (ANAME_SZ + INST_SZ + REALM_SZ + 2) +#define KKEY_SZ 100 +#define VERSION_SZ 1 +#define MSG_TYPE_SZ 1 +#define DATE_SZ 26 /* RTI date output */ + +#define MAX_HSTNM 100 + +#ifndef DEFAULT_TKT_LIFE /* allow compile-time override */ +#define DEFAULT_TKT_LIFE 120 /* default lifetime for krb_mk_req */ +#endif + +#define KRB_TICKET_GRANTING_TICKET "krbtgt" + +/* Definition of text structure used to pass text around */ +#define MAX_KTXT_LEN 1250 + +struct ktext { + int length; /* Length of the text */ + unsigned char dat[MAX_KTXT_LEN]; /* The data itself */ + unsigned long mbz; /* zero to catch runaway strings */ +}; + +typedef struct ktext *KTEXT; +typedef struct ktext KTEXT_ST; + + +/* Definitions for send_to_kdc */ +#define CLIENT_KRB_TIMEOUT 4 /* time between retries */ +#define CLIENT_KRB_RETRY 5 /* retry this many times */ +#define CLIENT_KRB_BUFLEN 512 /* max unfragmented packet */ + +/* Definitions for ticket file utilities */ +#define R_TKT_FIL 0 +#define W_TKT_FIL 1 + +/* Definitions for cl_get_tgt */ +#ifdef PC +#define CL_GTGT_INIT_FILE "\\kerberos\\k_in_tkts" +#else +#define CL_GTGT_INIT_FILE "/etc/k_in_tkts" +#endif /* PC */ + +/* Parameters for rd_ap_req */ +/* Maximum allowable clock skew in seconds */ +#define CLOCK_SKEW 5*60 +/* Filename for readservkey */ +#define KEYFILE ((char*)krb__get_srvtabname("/etc/srvtab")) + +/* Structure definition for rd_ap_req */ + +struct auth_dat { + unsigned char k_flags; /* Flags from ticket */ + char pname[ANAME_SZ]; /* Principal's name */ + char pinst[INST_SZ]; /* His Instance */ + char prealm[REALM_SZ]; /* His Realm */ + unsigned KRB4_32 checksum; /* Data checksum (opt) */ + C_Block session; /* Session Key */ + int life; /* Life of ticket */ + unsigned KRB4_32 time_sec; /* Time ticket issued */ + unsigned KRB4_32 address; /* Address in ticket */ + KTEXT_ST reply; /* Auth reply (opt) */ +}; + +typedef struct auth_dat AUTH_DAT; + +/* Structure definition for credentials returned by get_cred */ + +struct credentials { + char service[ANAME_SZ]; /* Service name */ + char instance[INST_SZ]; /* Instance */ + char realm[REALM_SZ]; /* Auth domain */ + C_Block session; /* Session key */ + int lifetime; /* Lifetime */ + int kvno; /* Key version number */ + KTEXT_ST ticket_st; /* The ticket itself */ + KRB4_32 issue_date; /* The issue time */ + char pname[ANAME_SZ]; /* Principal's name */ + char pinst[INST_SZ]; /* Principal's instance */ +#if TARGET_OS_MAC + KRB_UINT32 address; /* Address in ticket */ + KRB_UINT32 stk_type; /* string_to_key function needed */ +#endif +#ifdef _WIN32 + char address[ADDR_SZ]; /* Address in ticket */ +#endif +}; + +typedef struct credentials CREDENTIALS; + +/* Structure definition for rd_private_msg and rd_safe_msg */ + +struct msg_dat { + unsigned char *app_data; /* pointer to appl data */ + unsigned KRB4_32 app_length; /* length of appl data */ + unsigned KRB4_32 hash; /* hash to lookup replay */ + int swap; /* swap bytes? */ + KRB4_32 time_sec; /* msg timestamp seconds */ + unsigned char time_5ms; /* msg timestamp 5ms units */ +}; + +typedef struct msg_dat MSG_DAT; + + +/* Location of ticket file for save_cred and get_cred */ +#ifdef _WIN32 +#define TKT_FILE "\\kerberos\\ticket.ses" +#else +#define TKT_FILE tkt_string() +#define TKT_ROOT "/tmp/tkt" +#endif /* _WIN32 */ + +/* + * Error codes are now defined as offsets from com_err (krb_err.et) + * values. + */ +#define KRB_ET(x) ((KRBET_ ## x) - ERROR_TABLE_BASE_krb) + +/* Error codes returned from the KDC */ +#define KDC_OK KRB_ET(KSUCCESS) /* 0 - Request OK */ +#define KDC_NAME_EXP KRB_ET(KDC_NAME_EXP) /* 1 - Principal expired */ +#define KDC_SERVICE_EXP KRB_ET(KDC_SERVICE_EXP) /* 2 - Service expired */ +#define KDC_AUTH_EXP KRB_ET(KDC_AUTH_EXP) /* 3 - Auth expired */ +#define KDC_PKT_VER KRB_ET(KDC_PKT_VER) /* 4 - Prot version unknown */ +#define KDC_P_MKEY_VER KRB_ET(KDC_P_MKEY_VER) /* 5 - Wrong mkey version */ +#define KDC_S_MKEY_VER KRB_ET(KDC_S_MKEY_VER) /* 6 - Wrong mkey version */ +#define KDC_BYTE_ORDER KRB_ET(KDC_BYTE_ORDER) /* 7 - Byte order unknown */ +#define KDC_PR_UNKNOWN KRB_ET(KDC_PR_UNKNOWN) /* 8 - Princ unknown */ +#define KDC_PR_N_UNIQUE KRB_ET(KDC_PR_N_UNIQUE) /* 9 - Princ not unique */ +#define KDC_NULL_KEY KRB_ET(KDC_NULL_KEY) /* 10 - Princ has null key */ +#define KDC_GEN_ERR KRB_ET(KDC_GEN_ERR) /* 20 - Generic err frm KDC */ + +/* Values returned by get_credentials */ +#define GC_OK KRB_ET(KSUCCESS) /* 0 - Retrieve OK */ +#define RET_OK KRB_ET(KSUCCESS) /* 0 - Retrieve OK */ +#define GC_TKFIL KRB_ET(GC_TKFIL) /* 21 - Can't rd tkt file */ +#define RET_TKFIL KRB_ET(GC_TKFIL) /* 21 - Can't rd tkt file */ +#define GC_NOTKT KRB_ET(GC_NOTKT) /* 22 - Can't find tkt|TGT */ +#define RET_NOTKT KRB_ET(GC_NOTKT) /* 22 - Can't find tkt|TGT */ + +/* Values returned by mk_ap_req */ +#define MK_AP_OK KRB_ET(KSUCCESS) /* 0 - Success */ +#define MK_AP_TGTEXP KRB_ET(MK_AP_TGTEXP) /* 26 - TGT Expired */ + +/* Values returned by rd_ap_req */ +#define RD_AP_OK KRB_ET(KSUCCESS) /* 0 - Request authentic */ +#define RD_AP_UNDEC KRB_ET(RD_AP_UNDEC) /* 31 - Can't decode authent */ +#define RD_AP_EXP KRB_ET(RD_AP_EXP) /* 32 - Ticket expired */ +#define RD_AP_NYV KRB_ET(RD_AP_NYV) /* 33 - Ticket not yet valid */ +#define RD_AP_REPEAT KRB_ET(RD_AP_REPEAT) /* 34 - Repeated request */ +#define RD_AP_NOT_US KRB_ET(RD_AP_NOT_US) /* 35 - Ticket isn't for us */ +#define RD_AP_INCON KRB_ET(RD_AP_INCON) /* 36 - Request inconsistent */ +#define RD_AP_TIME KRB_ET(RD_AP_TIME) /* 37 - delta_t too big */ +#define RD_AP_BADD KRB_ET(RD_AP_BADD) /* 38 - Incorrect net addr */ +#define RD_AP_VERSION KRB_ET(RD_AP_VERSION) /* 39 - prot vers mismatch */ +#define RD_AP_MSG_TYPE KRB_ET(RD_AP_MSG_TYPE) /* 40 - invalid msg type */ +#define RD_AP_MODIFIED KRB_ET(RD_AP_MODIFIED) /* 41 - msg stream modified */ +#define RD_AP_ORDER KRB_ET(RD_AP_ORDER) /* 42 - message out of order */ +#define RD_AP_UNAUTHOR KRB_ET(RD_AP_UNAUTHOR) /* 43 - unauthorized request */ + +/* Values returned by get_pw_tkt */ +#define GT_PW_OK KRB_ET(KSUCCESS) /* 0 - Got passwd chg tkt */ +#define GT_PW_NULL KRB_ET(GT_PW_NULL) /* 51 - Current PW is null */ +#define GT_PW_BADPW KRB_ET(GT_PW_BADPW) /* 52 - Wrong passwd */ +#define GT_PW_PROT KRB_ET(GT_PW_PROT) /* 53 - Protocol Error */ +#define GT_PW_KDCERR KRB_ET(GT_PW_KDCERR) /* 54 - Error ret by KDC */ +#define GT_PW_NULLTKT KRB_ET(GT_PW_NULLTKT) /* 55 - Null tkt ret by KDC */ + +/* Values returned by send_to_kdc */ +#define SKDC_OK KRB_ET(KSUCCESS) /* 0 - Response received */ +#define SKDC_RETRY KRB_ET(SKDC_RETRY) /* 56 - Retry count exceeded */ +#define SKDC_CANT KRB_ET(SKDC_CANT) /* 57 - Can't send request */ + +/* + * Values returned by get_intkt + * (can also return SKDC_* and KDC errors) + */ + +#define INTK_OK KRB_ET(KSUCCESS) /* 0 - Ticket obtained */ +#define INTK_PW_NULL KRB_ET(GT_PW_NULL) /* 51 - Current PW is null */ +#define INTK_W_NOTALL KRB_ET(INTK_W_NOTALL) /* 61 - Not ALL tkts retd */ +#define INTK_BADPW KRB_ET(INTK_BADPW) /* 62 - Incorrect password */ +#define INTK_PROT KRB_ET(INTK_PROT) /* 63 - Protocol Error */ +#define INTK_ERR KRB_ET(INTK_ERR) /* 70 - Other error */ + +/* Values returned by get_adtkt */ +#define AD_OK KRB_ET(KSUCCESS) /* 0 - Ticket Obtained */ +#define AD_NOTGT KRB_ET(AD_NOTGT) /* 71 - Don't have tgt */ + +/* Error codes returned by ticket file utilities */ +#define NO_TKT_FIL KRB_ET(NO_TKT_FIL) /* 76 - No ticket file found */ +#define TKT_FIL_ACC KRB_ET(TKT_FIL_ACC) /* 77 - Can't acc tktfile */ +#define TKT_FIL_LCK KRB_ET(TKT_FIL_LCK) /* 78 - Can't lck tkt file */ +#define TKT_FIL_FMT KRB_ET(TKT_FIL_FMT) /* 79 - Bad tkt file format */ +#define TKT_FIL_INI KRB_ET(TKT_FIL_INI) /* 80 - tf_init not called */ + +/* Error code returned by kparse_name */ +#define KNAME_FMT KRB_ET(KNAME_FMT) /* 81 - Bad krb name fmt */ + +/* Error code returned by krb_mk_safe */ +#define SAFE_PRIV_ERROR (-1) /* syscall error */ + +/* Kerberos ticket flag field bit definitions */ +#define K_FLAG_ORDER 0 /* bit 0 --> lsb */ +#define K_FLAG_1 /* reserved */ +#define K_FLAG_2 /* reserved */ +#define K_FLAG_3 /* reserved */ +#define K_FLAG_4 /* reserved */ +#define K_FLAG_5 /* reserved */ +#define K_FLAG_6 /* reserved */ +#define K_FLAG_7 /* reserved, bit 7 --> msb */ + +/* Are these needed anymore? */ +#ifdef OLDNAMES +#define krb_mk_req mk_ap_req +#define krb_rd_req rd_ap_req +#define krb_kntoln an_to_ln +#define krb_set_key set_serv_key +#define krb_get_cred get_credentials +#define krb_mk_priv mk_private_msg +#define krb_rd_priv rd_private_msg +#define krb_mk_safe mk_safe_msg +#define krb_rd_safe rd_safe_msg +#define krb_mk_err mk_appl_err_msg +#define krb_rd_err rd_appl_err_msg +#define krb_ck_repl check_replay +#define krb_get_pw_in_tkt get_in_tkt +#define krb_get_svc_in_tkt get_svc_in_tkt +#define krb_get_pw_tkt get_pw_tkt +#define krb_realmofhost krb_getrealm +#define krb_get_phost get_phost +#define krb_get_krbhst get_krbhst +#define krb_get_lrealm get_krbrlm +#endif /* OLDNAMES */ + +/* Defines for krb_sendauth and krb_recvauth */ + +#define KOPT_DONT_MK_REQ 0x00000001 /* don't call krb_mk_req */ +#define KOPT_DO_MUTUAL 0x00000002 /* do mutual auth */ +#define KOPT_DONT_CANON 0x00000004 /* don't canonicalize inst as a host */ + +#define KRB_SENDAUTH_VLEN 8 /* length for version strings */ + +#ifdef ATHENA_COMPAT +#define KOPT_DO_OLDSTYLE 0x00000008 /* use the old-style protocol */ +#endif /* ATHENA_COMPAT */ + + +#ifdef _WIN32 +#define TIME_GMT_UNIXSEC win_time_gmt_unixsec((unsigned KRB4_32 *)0) +#define TIME_GMT_UNIXSEC_US(us) win_time_gmt_unixsec((us)) +#define CONVERT_TIME_EPOCH win_time_get_epoch() +#else +/* until we do V4 compat under DOS, just turn this off */ +#define _fmemcpy memcpy +#define _fstrncpy strncpy +#define far_fputs fputs +/* and likewise, just drag in the unix time interface */ +#define TIME_GMT_UNIXSEC unix_time_gmt_unixsec((unsigned KRB4_32 *)0) +#define TIME_GMT_UNIXSEC_US(us) unix_time_gmt_unixsec((us)) +#define CONVERT_TIME_EPOCH ((long)0) /* Unix epoch is Krb epoch */ +#endif /* _WIN32 */ + +/* Constants for KerberosProfileLib */ +#define REALMS_V4_PROF_REALMS_SECTION "v4 realms" +#define REALMS_V4_PROF_KDC "kdc" +#define REALMS_V4_PROF_ADMIN_KDC "admin_server" +#define REALMS_V4_PROF_KPASSWD_KDC "kpasswd_server" +#define REALMS_V4_PROF_DOMAIN_SECTION "v4 domain_realm" +#define REALMS_V4_PROF_LIBDEFAULTS_SECTION "libdefaults" +#define REALMS_V4_PROF_LOCAL_REALM "default_realm" +#define REALMS_V4_PROF_STK "string_to_key_type" +#define REALMS_V4_MIT_STK "mit_string_to_key" +#define REALMS_V4_AFS_STK "afs_string_to_key" +#define REALMS_V4_COLUMBIA_STK "columbia_string_to_key" +#define REALMS_V4_DEFAULT_REALM "default_realm" +#define REALMS_V4_NO_ADDRESSES "noaddresses" + +/* ask to disable IP address checking in the library */ +extern int krb_ignore_ip_address; + +/* Debugging printfs shouldn't even be compiled on many systems that don't + support printf! Use it like DEB (("Oops - %s\n", string)); */ + +#ifdef DEBUG +#define DEB(x) if (krb_debug) printf x +extern int krb_debug; +#else +#define DEB(x) /* nothing */ +#endif + +/* Define a couple of function types including parameters. These + are needed on MS-Windows to convert arguments of the function pointers + to the proper types during calls. */ + +typedef int (KRB5_CALLCONV *key_proc_type) + (char *, char *, char *, + char *, C_Block); +#define KEY_PROC_TYPE_DEFINED + +typedef int (KRB5_CALLCONV *decrypt_tkt_type) + (char *, char *, char *, + char *, key_proc_type, KTEXT *); +#define DECRYPT_TKT_TYPE_DEFINED + +extern struct _krb5_context * krb5__krb4_context; + +/* + * Function Prototypes for Kerberos V4. + */ + +struct sockaddr_in; + +/* dest_tkt.c */ +int KRB5_CALLCONV dest_tkt + (void); +/* err_txt.c */ +const char * KRB5_CALLCONV krb_get_err_text + (int errnum); +/* g_ad_tkt.c */ +/* Previously not KRB5_CALLCONV */ +int KRB5_CALLCONV get_ad_tkt + (char *service, char *sinst, char *realm, int lifetime); +/* g_admhst.c */ +int KRB5_CALLCONV krb_get_admhst + (char *host, char *realm, int idx); +/* g_cred.c */ +int KRB5_CALLCONV krb_get_cred + (char *service, char *instance, char *realm, + CREDENTIALS *c); +/* g_in_tkt.c */ +/* Previously not KRB5_CALLCONV */ +int KRB5_CALLCONV krb_get_in_tkt + (char *k_user, char *instance, char *realm, + char *service, char *sinst, int life, + key_proc_type, decrypt_tkt_type, char *arg); +#if KRB_PRIVATE +/* Previously not KRB5_CALLCONV */ +int KRB5_CALLCONV krb_get_in_tkt_preauth + (char *k_user, char *instance, char *realm, + char *service, char *sinst, int life, + key_proc_type, decrypt_tkt_type, char *arg, + char *preauth_p, int preauth_len); +#endif +/* From KfM */ +int KRB5_CALLCONV krb_get_in_tkt_creds(char *, char *, char *, char *, char *, + int, key_proc_type, decrypt_tkt_type, char *, CREDENTIALS *); + +/* g_krbhst.c */ +int KRB5_CALLCONV krb_get_krbhst + (char *host, const char *realm, int idx); +/* g_krbrlm.c */ +int KRB5_CALLCONV krb_get_lrealm + (char *realm, int idx); +/* g_phost.c */ +char * KRB5_CALLCONV krb_get_phost + (char * alias); +/* get_pw_tkt */ +int KRB5_CALLCONV get_pw_tkt + (char *, char *, char *, char *); +/* g_pw_in_tkt.c */ +int KRB5_CALLCONV krb_get_pw_in_tkt + (char *k_user, char *instance, char *realm, + char *service, char *sinstance, + int life, char *password); +#if KRB_PRIVATE +int KRB5_CALLCONV krb_get_pw_in_tkt_preauth + (char *k_user, char *instance, char *realm, + char *service, char *sinstance, + int life, char *password); +#endif +int KRB5_CALLCONV +krb_get_pw_in_tkt_creds(char *, char *, char *, + char *, char *, int, char *, CREDENTIALS *); + +/* g_svc_in_tkt.c */ +int KRB5_CALLCONV krb_get_svc_in_tkt + (char *k_user, char *instance, char *realm, + char *service, char *sinstance, + int life, char *srvtab); + +/* g_tf_fname.c */ +int KRB5_CALLCONV krb_get_tf_fullname + (const char *ticket_file, char *name, char *inst, char *realm); +/* g_tf_realm.c */ +int KRB5_CALLCONV krb_get_tf_realm + (const char *ticket_file, char *realm); +/* g_tkt_svc.c */ +int KRB5_CALLCONV krb_get_ticket_for_service + (char *serviceName, + char *buf, unsigned KRB4_32 *buflen, + int checksum, des_cblock, Key_schedule, + char *version, int includeVersion); +#if KRB_PRIVATE +/* in_tkt.c */ +int KRB5_CALLCONV in_tkt + (char *name, char *inst); +int KRB5_CALLCONV krb_in_tkt + (char *pname, char *pinst, char *realm); +#endif + +/* kname_parse.c */ +int KRB5_CALLCONV kname_parse + (char *name, char *inst, char *realm, + char *fullname); +/* Merged from KfM */ +int KRB5_CALLCONV kname_unparse + (char *, const char *, const char *, const char *); + +int KRB5_CALLCONV k_isname + (char *); +int KRB5_CALLCONV k_isinst + (char *); +int KRB5_CALLCONV k_isrealm + (char *); + + +/* kuserok.c */ +int KRB5_CALLCONV kuserok + (AUTH_DAT *kdata, char *luser); + +/* lifetime.c */ +KRB4_32 KRB5_CALLCONV krb_life_to_time + (KRB4_32 start, int life); +int KRB5_CALLCONV krb_time_to_life + (KRB4_32 start, KRB4_32 end); + +/* mk_auth.c */ +int KRB5_CALLCONV krb_check_auth + (KTEXT, unsigned KRB4_32 cksum, MSG_DAT *, + C_Block, Key_schedule, + struct sockaddr_in * local_addr, + struct sockaddr_in * foreign_addr); +int KRB5_CALLCONV krb_mk_auth + (long k4_options, KTEXT ticket, + char *service, char *inst, char *realm, + unsigned KRB4_32 checksum, char *version, KTEXT buf); +/* mk_err.c */ +long KRB5_CALLCONV krb_mk_err + (u_char *out, KRB4_32 k4_code, char *text); +#if KRB_PRIVATE +/* mk_preauth.c */ +int krb_mk_preauth + (char **preauth_p, int *preauth_len, key_proc_type, + char *name, char *inst, char *realm, char *password, + C_Block); +void krb_free_preauth + (char * preauth_p, int len); +#endif +/* mk_priv.c */ +long KRB5_CALLCONV krb_mk_priv + (u_char *in, u_char *out, + unsigned KRB4_32 length, + Key_schedule, C_Block *, + struct sockaddr_in * sender, + struct sockaddr_in * receiver); +/* mk_req.c */ +int KRB5_CALLCONV krb_mk_req + (KTEXT authent, + char *service, char *instance, char *realm, + KRB4_32 checksum); +/* Merged from KfM */ +int KRB5_CALLCONV krb_mk_req_creds(KTEXT, CREDENTIALS *, KRB_INT32); + +/* Added CALLCONV (KfM exports w/o INTERFACE, but KfW doesn't export?) */ +int KRB5_CALLCONV krb_set_lifetime(int newval); + +/* mk_safe.c */ +long KRB5_CALLCONV krb_mk_safe + (u_char *in, u_char *out, unsigned KRB4_32 length, + C_Block *, + struct sockaddr_in *sender, + struct sockaddr_in *receiver); +#if KRB_PRIVATE +/* netread.c */ +int krb_net_read + (int fd, char *buf, int len); +/* netwrite.c */ +int krb_net_write + (int fd, char *buf, int len); +/* pkt_clen.c */ +int pkt_clen + (KTEXT); +#endif + +/* put_svc_key.c */ +int KRB5_CALLCONV put_svc_key + (char *sfile, + char *name, char *inst, char *realm, + int newvno, char *key); + +/* rd_err.c */ +int KRB5_CALLCONV krb_rd_err + (u_char *in, u_long in_length, + long *k4_code, MSG_DAT *m_data); +/* rd_priv.c */ +long KRB5_CALLCONV krb_rd_priv + (u_char *in,unsigned KRB4_32 in_length, + Key_schedule, C_Block *, + struct sockaddr_in *sender, + struct sockaddr_in *receiver, + MSG_DAT *m_data); +/* rd_req.c */ +int KRB5_CALLCONV krb_rd_req + (KTEXT, char *service, char *inst, + unsigned KRB4_32 from_addr, AUTH_DAT *, + char *srvtab); +/* Merged from KfM */ +int KRB5_CALLCONV +krb_rd_req_int(KTEXT, char *, char *, KRB_UINT32, AUTH_DAT *, C_Block); + +/* rd_safe.c */ +long KRB5_CALLCONV krb_rd_safe + (u_char *in, unsigned KRB4_32 in_length, + C_Block *, + struct sockaddr_in *sender, + struct sockaddr_in *receiver, + MSG_DAT *m_data); +/* rd_svc_key.c */ +int KRB5_CALLCONV read_service_key + (char *service, char *instance, char *realm, + int kvno, char *file, char *key); +int KRB5_CALLCONV get_service_key + (char *service, char *instance, char *realm, + int *kvno, char *file, char *key); + +/* realmofhost.c */ +char * KRB5_CALLCONV krb_realmofhost + (char *host); +/* recvauth.c */ +int KRB5_CALLCONV krb_recvauth + (long k4_options, int fd, KTEXT ticket, + char *service, char *instance, + struct sockaddr_in *foreign_addr, + struct sockaddr_in *local_addr, + AUTH_DAT *kdata, char *srvtab, + Key_schedule schedule, char *version); +/* sendauth.c */ +int KRB5_CALLCONV krb_sendauth + (long k4_options, int fd, KTEXT ticket, + char *service, char *inst, char *realm, + unsigned KRB4_32 checksum, MSG_DAT *msg_data, + CREDENTIALS *cred, Key_schedule schedule, + struct sockaddr_in *laddr, struct sockaddr_in *faddr, + char *version); + +#if KRB_PRIVATE +/* save_creds.c */ +int KRB5_CALLCONV krb_save_credentials + (char *service, char *instance, char *realm, + C_Block session, int lifetime, int kvno, + KTEXT ticket, long issue_date); +/* send_to_kdc.c */ +/* XXX PRIVATE? KfM doesn't export. */ +int send_to_kdc + (KTEXT pkt, KTEXT rpkt, char *realm); +#endif + +/* tkt_string.c */ +/* Used to return pointer to non-const char */ +const char * KRB5_CALLCONV tkt_string + (void); +/* Previously not KRB5_CALLCONV, and previously took pointer to non-const. */ +void KRB5_CALLCONV krb_set_tkt_string + (const char *); + +#if KRB_PRIVATE +/* tf_util.c */ +int KRB5_CALLCONV tf_init (const char *tf_name, int rw); + +int KRB5_CALLCONV tf_get_pname (char *p); + +int KRB5_CALLCONV tf_get_pinst (char *p); + +int KRB5_CALLCONV tf_get_cred (CREDENTIALS *c); + +void KRB5_CALLCONV tf_close (void); +#endif + +#if KRB_PRIVATE +/* unix_time.c */ +unsigned KRB4_32 KRB5_CALLCONV unix_time_gmt_unixsec + (unsigned KRB4_32 *); + +/* + * Internal prototypes + */ +extern int krb_set_key + (char *key, int cvt); + +/* This is exported by KfM. It was previously not KRB5_CALLCONV. */ +extern int KRB5_CALLCONV decomp_ticket + (KTEXT tkt, unsigned char *flags, char *pname, + char *pinstance, char *prealm, unsigned KRB4_32 *paddress, + C_Block session, int *life, unsigned KRB4_32 *time_sec, + char *sname, char *sinstance, C_Block, + Key_schedule key_s); + + +extern void cr_err_reply(KTEXT pkt, char *pname, char *pinst, char *prealm, + u_long time_ws, u_long e, char *e_string); + +extern int create_ciph(KTEXT c, C_Block session, char *service, + char *instance, char *realm, unsigned long life, + int kvno, KTEXT tkt, unsigned long kdc_time, + C_Block key); + + +extern int krb_create_ticket(KTEXT tkt, unsigned int flags, char *pname, + char *pinstance, char *prealm, long paddress, + char *session, int life, long time_sec, + char *sname, char *sinstance, C_Block key); + +#endif /* KRB_PRIVATE */ + +/* This function is used by KEYFILE above. Do not call it directly */ +extern char * krb__get_srvtabname(const char *); + +#if KRB_PRIVATE + +extern int krb_kntoln(AUTH_DAT *, char *); + +#ifdef KRB5_GENERAL__ +extern int krb_cr_tkt_krb5(KTEXT tkt, unsigned int flags, char *pname, + char *pinstance, char *prealm, long paddress, + char *session, int life, long time_sec, + char *sname, char *sinstance, + krb5_keyblock *k5key); + +extern int krb_set_key_krb5(krb5_context ctx, krb5_keyblock *key); + +#endif + +#endif /* KRB_PRIVATE */ + +/* + * krb_change_password -- merged from KfM + */ +/* change_password.c */ +int KRB5_CALLCONV krb_change_password(char *, char *, char *, char *, char *); + +/* + * RealmsConfig-glue.c -- merged from KfM + */ +int KRB5_CALLCONV krb_get_profile(profile_t *); + +#ifdef _WIN32 +HINSTANCE get_lib_instance(void); +unsigned int krb_get_notification_message(void); +char * KRB5_CALLCONV krb_get_default_user(void); +int KRB5_CALLCONV krb_set_default_user(char *); +unsigned KRB4_32 win_time_gmt_unixsec(unsigned KRB4_32 *); +long win_time_get_epoch(void); +#endif + +#if TARGET_OS_MAC +# if defined(__MWERKS__) +# pragma import reset +# endif +# pragma options align=reset +#endif + +KRBINT_END_DECLS + +#endif /* KRB_DEFS */ diff --git a/src/WINNT/kfw/inc/krb5/KerberosIV/krb_err.h b/src/WINNT/kfw/inc/krb5/KerberosIV/krb_err.h new file mode 100644 index 000000000..4118c1b03 --- /dev/null +++ b/src/WINNT/kfw/inc/krb5/KerberosIV/krb_err.h @@ -0,0 +1,278 @@ +/* + * include//kerberosIV/krb_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define KRBET_KSUCCESS (39525376L) +#define KRBET_KDC_NAME_EXP (39525377L) +#define KRBET_KDC_SERVICE_EXP (39525378L) +#define KRBET_KDC_AUTH_EXP (39525379L) +#define KRBET_KDC_PKT_VER (39525380L) +#define KRBET_KDC_P_MKEY_VER (39525381L) +#define KRBET_KDC_S_MKEY_VER (39525382L) +#define KRBET_KDC_BYTE_ORDER (39525383L) +#define KRBET_KDC_PR_UNKNOWN (39525384L) +#define KRBET_KDC_PR_N_UNIQUE (39525385L) +#define KRBET_KDC_NULL_KEY (39525386L) +#define KRBET_KRB_RES11 (39525387L) +#define KRBET_KRB_RES12 (39525388L) +#define KRBET_KRB_RES13 (39525389L) +#define KRBET_KRB_RES14 (39525390L) +#define KRBET_KRB_RES15 (39525391L) +#define KRBET_KRB_RES16 (39525392L) +#define KRBET_KRB_RES17 (39525393L) +#define KRBET_KRB_RES18 (39525394L) +#define KRBET_KRB_RES19 (39525395L) +#define KRBET_KDC_GEN_ERR (39525396L) +#define KRBET_GC_TKFIL (39525397L) +#define KRBET_GC_NOTKT (39525398L) +#define KRBET_KRB_RES23 (39525399L) +#define KRBET_KRB_RES24 (39525400L) +#define KRBET_KRB_RES25 (39525401L) +#define KRBET_MK_AP_TGTEXP (39525402L) +#define KRBET_KRB_RES27 (39525403L) +#define KRBET_KRB_RES28 (39525404L) +#define KRBET_KRB_RES29 (39525405L) +#define KRBET_KRB_RES30 (39525406L) +#define KRBET_RD_AP_UNDEC (39525407L) +#define KRBET_RD_AP_EXP (39525408L) +#define KRBET_RD_AP_NYV (39525409L) +#define KRBET_RD_AP_REPEAT (39525410L) +#define KRBET_RD_AP_NOT_US (39525411L) +#define KRBET_RD_AP_INCON (39525412L) +#define KRBET_RD_AP_TIME (39525413L) +#define KRBET_RD_AP_BADD (39525414L) +#define KRBET_RD_AP_VERSION (39525415L) +#define KRBET_RD_AP_MSG_TYPE (39525416L) +#define KRBET_RD_AP_MODIFIED (39525417L) +#define KRBET_RD_AP_ORDER (39525418L) +#define KRBET_RD_AP_UNAUTHOR (39525419L) +#define KRBET_KRB_RES44 (39525420L) +#define KRBET_KRB_RES45 (39525421L) +#define KRBET_KRB_RES46 (39525422L) +#define KRBET_KRB_RES47 (39525423L) +#define KRBET_KRB_RES48 (39525424L) +#define KRBET_KRB_RES49 (39525425L) +#define KRBET_KRB_RES50 (39525426L) +#define KRBET_GT_PW_NULL (39525427L) +#define KRBET_GT_PW_BADPW (39525428L) +#define KRBET_GT_PW_PROT (39525429L) +#define KRBET_GT_PW_KDCERR (39525430L) +#define KRBET_GT_PW_NULLTKT (39525431L) +#define KRBET_SKDC_RETRY (39525432L) +#define KRBET_SKDC_CANT (39525433L) +#define KRBET_KRB_RES58 (39525434L) +#define KRBET_KRB_RES59 (39525435L) +#define KRBET_KRB_RES60 (39525436L) +#define KRBET_INTK_W_NOTALL (39525437L) +#define KRBET_INTK_BADPW (39525438L) +#define KRBET_INTK_PROT (39525439L) +#define KRBET_KRB_RES64 (39525440L) +#define KRBET_KRB_RES65 (39525441L) +#define KRBET_KRB_RES66 (39525442L) +#define KRBET_KRB_RES67 (39525443L) +#define KRBET_KRB_RES68 (39525444L) +#define KRBET_KRB_RES69 (39525445L) +#define KRBET_INTK_ERR (39525446L) +#define KRBET_AD_NOTGT (39525447L) +#define KRBET_KRB_RES72 (39525448L) +#define KRBET_KRB_RES73 (39525449L) +#define KRBET_KRB_RES74 (39525450L) +#define KRBET_KRB_RES75 (39525451L) +#define KRBET_NO_TKT_FIL (39525452L) +#define KRBET_TKT_FIL_ACC (39525453L) +#define KRBET_TKT_FIL_LCK (39525454L) +#define KRBET_TKT_FIL_FMT (39525455L) +#define KRBET_TKT_FIL_INI (39525456L) +#define KRBET_KNAME_FMT (39525457L) +#define KRBET_RES82 (39525458L) +#define KRBET_RES83 (39525459L) +#define KRBET_RES84 (39525460L) +#define KRBET_RES85 (39525461L) +#define KRBET_RES86 (39525462L) +#define KRBET_RES87 (39525463L) +#define KRBET_RES88 (39525464L) +#define KRBET_RES89 (39525465L) +#define KRBET_RES90 (39525466L) +#define KRBET_RES91 (39525467L) +#define KRBET_RES92 (39525468L) +#define KRBET_RES93 (39525469L) +#define KRBET_RES94 (39525470L) +#define KRBET_RES95 (39525471L) +#define KRBET_RES96 (39525472L) +#define KRBET_RES97 (39525473L) +#define KRBET_RES98 (39525474L) +#define KRBET_RES99 (39525475L) +#define KRBET_RES100 (39525476L) +#define KRBET_RES101 (39525477L) +#define KRBET_RES102 (39525478L) +#define KRBET_RES103 (39525479L) +#define KRBET_RES104 (39525480L) +#define KRBET_RES105 (39525481L) +#define KRBET_RES106 (39525482L) +#define KRBET_RES107 (39525483L) +#define KRBET_RES108 (39525484L) +#define KRBET_RES109 (39525485L) +#define KRBET_RES110 (39525486L) +#define KRBET_RES111 (39525487L) +#define KRBET_RES112 (39525488L) +#define KRBET_RES113 (39525489L) +#define KRBET_RES114 (39525490L) +#define KRBET_RES115 (39525491L) +#define KRBET_RES116 (39525492L) +#define KRBET_RES117 (39525493L) +#define KRBET_RES118 (39525494L) +#define KRBET_RES119 (39525495L) +#define KRBET_RES120 (39525496L) +#define KRBET_RES121 (39525497L) +#define KRBET_RES122 (39525498L) +#define KRBET_RES123 (39525499L) +#define KRBET_RES124 (39525500L) +#define KRBET_RES125 (39525501L) +#define KRBET_RES126 (39525502L) +#define KRBET_RES127 (39525503L) +#define KRBET_RES128 (39525504L) +#define KRBET_RES129 (39525505L) +#define KRBET_RES130 (39525506L) +#define KRBET_RES131 (39525507L) +#define KRBET_RES132 (39525508L) +#define KRBET_RES133 (39525509L) +#define KRBET_RES134 (39525510L) +#define KRBET_RES135 (39525511L) +#define KRBET_RES136 (39525512L) +#define KRBET_RES137 (39525513L) +#define KRBET_RES138 (39525514L) +#define KRBET_RES139 (39525515L) +#define KRBET_RES140 (39525516L) +#define KRBET_RES141 (39525517L) +#define KRBET_RES142 (39525518L) +#define KRBET_RES143 (39525519L) +#define KRBET_RES144 (39525520L) +#define KRBET_RES145 (39525521L) +#define KRBET_RES146 (39525522L) +#define KRBET_RES147 (39525523L) +#define KRBET_RES148 (39525524L) +#define KRBET_RES149 (39525525L) +#define KRBET_RES150 (39525526L) +#define KRBET_RES151 (39525527L) +#define KRBET_RES152 (39525528L) +#define KRBET_RES153 (39525529L) +#define KRBET_RES154 (39525530L) +#define KRBET_RES155 (39525531L) +#define KRBET_RES156 (39525532L) +#define KRBET_RES157 (39525533L) +#define KRBET_RES158 (39525534L) +#define KRBET_RES159 (39525535L) +#define KRBET_RES160 (39525536L) +#define KRBET_RES161 (39525537L) +#define KRBET_RES162 (39525538L) +#define KRBET_RES163 (39525539L) +#define KRBET_RES164 (39525540L) +#define KRBET_RES165 (39525541L) +#define KRBET_RES166 (39525542L) +#define KRBET_RES167 (39525543L) +#define KRBET_RES168 (39525544L) +#define KRBET_RES169 (39525545L) +#define KRBET_RES170 (39525546L) +#define KRBET_RES171 (39525547L) +#define KRBET_RES172 (39525548L) +#define KRBET_RES173 (39525549L) +#define KRBET_RES174 (39525550L) +#define KRBET_RES175 (39525551L) +#define KRBET_RES176 (39525552L) +#define KRBET_RES177 (39525553L) +#define KRBET_RES178 (39525554L) +#define KRBET_RES179 (39525555L) +#define KRBET_RES180 (39525556L) +#define KRBET_RES181 (39525557L) +#define KRBET_RES182 (39525558L) +#define KRBET_RES183 (39525559L) +#define KRBET_RES184 (39525560L) +#define KRBET_RES185 (39525561L) +#define KRBET_RES186 (39525562L) +#define KRBET_RES187 (39525563L) +#define KRBET_RES188 (39525564L) +#define KRBET_RES189 (39525565L) +#define KRBET_RES190 (39525566L) +#define KRBET_RES191 (39525567L) +#define KRBET_RES192 (39525568L) +#define KRBET_RES193 (39525569L) +#define KRBET_RES194 (39525570L) +#define KRBET_RES195 (39525571L) +#define KRBET_RES196 (39525572L) +#define KRBET_RES197 (39525573L) +#define KRBET_RES198 (39525574L) +#define KRBET_RES199 (39525575L) +#define KRBET_RES200 (39525576L) +#define KRBET_RES201 (39525577L) +#define KRBET_RES202 (39525578L) +#define KRBET_RES203 (39525579L) +#define KRBET_RES204 (39525580L) +#define KRBET_RES205 (39525581L) +#define KRBET_RES206 (39525582L) +#define KRBET_RES207 (39525583L) +#define KRBET_RES208 (39525584L) +#define KRBET_RES209 (39525585L) +#define KRBET_RES210 (39525586L) +#define KRBET_RES211 (39525587L) +#define KRBET_RES212 (39525588L) +#define KRBET_RES213 (39525589L) +#define KRBET_RES214 (39525590L) +#define KRBET_RES215 (39525591L) +#define KRBET_RES216 (39525592L) +#define KRBET_RES217 (39525593L) +#define KRBET_RES218 (39525594L) +#define KRBET_RES219 (39525595L) +#define KRBET_RES220 (39525596L) +#define KRBET_RES221 (39525597L) +#define KRBET_RES222 (39525598L) +#define KRBET_RES223 (39525599L) +#define KRBET_RES224 (39525600L) +#define KRBET_RES225 (39525601L) +#define KRBET_RES226 (39525602L) +#define KRBET_RES227 (39525603L) +#define KRBET_RES228 (39525604L) +#define KRBET_RES229 (39525605L) +#define KRBET_RES230 (39525606L) +#define KRBET_RES231 (39525607L) +#define KRBET_RES232 (39525608L) +#define KRBET_RES233 (39525609L) +#define KRBET_RES234 (39525610L) +#define KRBET_RES235 (39525611L) +#define KRBET_RES236 (39525612L) +#define KRBET_RES237 (39525613L) +#define KRBET_RES238 (39525614L) +#define KRBET_RES239 (39525615L) +#define KRBET_RES240 (39525616L) +#define KRBET_RES241 (39525617L) +#define KRBET_RES242 (39525618L) +#define KRBET_RES243 (39525619L) +#define KRBET_RES244 (39525620L) +#define KRBET_RES245 (39525621L) +#define KRBET_RES246 (39525622L) +#define KRBET_RES247 (39525623L) +#define KRBET_RES248 (39525624L) +#define KRBET_RES249 (39525625L) +#define KRBET_RES250 (39525626L) +#define KRBET_RES251 (39525627L) +#define KRBET_RES252 (39525628L) +#define KRBET_RES253 (39525629L) +#define KRBET_RES254 (39525630L) +#define KRBET_KFAILURE (39525631L) +#define ERROR_TABLE_BASE_krb (39525376L) + +extern const struct error_table et_krb_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_krb_error_table () /*@modifies internalState@*/; +#else +#define initialize_krb_error_table() +#endif + +#if !defined(_WIN32) +#define init_krb_err_tbl initialize_krb_error_table +#define krb_err_base ERROR_TABLE_BASE_krb +#endif diff --git a/src/WINNT/kfw/inc/krb5/KerberosIV/mit-copyright.h b/src/WINNT/kfw/inc/krb5/KerberosIV/mit-copyright.h new file mode 100644 index 000000000..e00865769 --- /dev/null +++ b/src/WINNT/kfw/inc/krb5/KerberosIV/mit-copyright.h @@ -0,0 +1,23 @@ +/* + Copyright (C) 1989 by the Massachusetts Institute of Technology + + Export of this software from the United States of America may + require a specific license from the United States Government. + It is the responsibility of any person or organization contemplating + export to obtain such a license before exporting. + +WITHIN THAT CONSTRAINT, Permission to use, copy, modify, and +distribute this software and its documentation for any purpose and +without fee is hereby granted, provided that the above copyright +notice appear in all copies and that both that copyright notice and +this permission notice appear in supporting documentation, and that +the name of M.I.T. not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. Furthermore if you modify this software you must label +your software as modified software and not distribute it in such a +fashion that it might be confused with the original M.I.T. software. +M.I.T. makes no representations about the suitability of +this software for any purpose. It is provided "as is" without express +or implied warranty. + + */ diff --git a/src/WINNT/kfw/inc/krb5/com_err.h b/src/WINNT/kfw/inc/krb5/com_err.h new file mode 100644 index 000000000..042a9bd45 --- /dev/null +++ b/src/WINNT/kfw/inc/krb5/com_err.h @@ -0,0 +1,72 @@ +/* + * Header file for common error description library. + * + * Copyright 1988, Student Information Processing Board of the + * Massachusetts Institute of Technology. + * + * Copyright 1995 by Cygnus Support. + * + * For copyright and distribution info, see the documentation supplied + * with this package. + */ + +#ifndef __COM_ERR_H + +#if defined(_WIN32) +#include +#endif + +#ifndef KRB5_CALLCONV +#define KRB5_CALLCONV +#define KRB5_CALLCONV_C +#endif + +#include + +typedef long errcode_t; +typedef void (*et_old_error_hook_func) (const char *, errcode_t, + const char *, va_list ap); + +struct error_table { + /*@shared@*/ char const * const * msgs; + long base; + unsigned int n_msgs; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +/* Public interfaces */ +extern void KRB5_CALLCONV_C com_err + (const char *, errcode_t, const char *, ...); +extern void KRB5_CALLCONV com_err_va + (const char *whoami, errcode_t code, const char *fmt, + va_list ap); +extern /*@observer@*//*@dependent@*/ const char * KRB5_CALLCONV error_message + (errcode_t) + /*@modifies internalState@*/; +extern errcode_t KRB5_CALLCONV add_error_table + (/*@dependent@*/ const struct error_table *) + /*@modifies internalState@*/; +extern errcode_t KRB5_CALLCONV remove_error_table + (const struct error_table *) + /*@modifies internalState@*/; + +#if !defined(_WIN32) +/* + * The display routine should be application specific. A global hook, + * may cause inappropriate display procedures to be called between + * applications under non-Unix environments. + */ + +extern et_old_error_hook_func set_com_err_hook (et_old_error_hook_func); +extern et_old_error_hook_func reset_com_err_hook (void); +#endif + +#ifdef __cplusplus +} +#endif + +#define __COM_ERR_H +#endif /* ! defined(__COM_ERR_H) */ diff --git a/src/WINNT/kfw/inc/krb5/gssapi/gssapi.h b/src/WINNT/kfw/inc/krb5/gssapi/gssapi.h new file mode 100644 index 000000000..6296e2931 --- /dev/null +++ b/src/WINNT/kfw/inc/krb5/gssapi/gssapi.h @@ -0,0 +1,805 @@ +/* + * Copyright 1993 by OpenVision Technologies, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appears in all copies and + * that both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of OpenVision not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. OpenVision makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _GSSAPI_H_ +#define _GSSAPI_H_ + +/* + * Determine platform-dependent configuration. + */ + +#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)) +# include +# if TARGET_RT_MAC_CFM +# error "Use KfM 4.0 SDK headers for CFM compilation." +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#if TARGET_OS_MAC +# if defined(__MWERKS__) +# pragma import on +# endif +# pragma options align=mac68k +#endif + +#if defined(_MSDOS) || defined(_WIN32) +#include +#endif + +#ifndef KRB5_CALLCONV +#define KRB5_CALLCONV +#define KRB5_CALLCONV_C +#endif + +#define GSS_SIZEOF_INT SIZEOF_INT +#define GSS_SIZEOF_LONG SIZEOF_LONG +#define GSS_SIZEOF_SHORT SIZEOF_SHORT + +/* + * First, include stddef.h to get size_t defined. + */ +#if HAVE_STDDEF_H +#include +#endif /* HAVE_STDDEF_H */ + +/* + * POSIX says that sys/types.h is where size_t is defined. + */ +#include + +/* + * If the platform supports the xom.h header file, it should be included here. + */ +#if HAVE_XOM_H +#include +#endif /* HAVE_XOM_H */ + +/* + * $Id: gssapi.h,v 1.1 2004/02/26 19:22:54 jaltman Exp $ + */ + +/* + * First, define the three platform-dependent pointer types. + */ + +typedef void * gss_name_t; +typedef void * gss_cred_id_t; +typedef void * gss_ctx_id_t; + +/* + * The following type must be defined as the smallest natural unsigned integer + * supported by the platform that has at least 32 bits of precision. + */ +#if (GSS_SIZEOF_SHORT == 4) +typedef unsigned short gss_uint32; +typedef short gss_int32; +#elif (GSS_SIZEOF_INT == 4) +typedef unsigned int gss_uint32; +typedef int gss_int32; +#elif (GSS_SIZEOF_LONG == 4) +typedef unsigned long gss_uint32; +typedef long gss_int32; +#endif + +#ifdef OM_STRING +/* + * We have included the xom.h header file. Use the definition for + * OM_object identifier. + */ +typedef OM_object_identifier gss_OID_desc, *gss_OID; +#else /* OM_STRING */ +/* + * We can't use X/Open definitions, so roll our own. + */ +typedef gss_uint32 OM_uint32; + +typedef struct gss_OID_desc_struct { + OM_uint32 length; + void *elements; +} gss_OID_desc, *gss_OID; +#endif /* OM_STRING */ + +typedef struct gss_OID_set_desc_struct { + size_t count; + gss_OID elements; +} gss_OID_set_desc, *gss_OID_set; + +typedef struct gss_buffer_desc_struct { + size_t length; + void *value; +} gss_buffer_desc, *gss_buffer_t; + +typedef struct gss_channel_bindings_struct { + OM_uint32 initiator_addrtype; + gss_buffer_desc initiator_address; + OM_uint32 acceptor_addrtype; + gss_buffer_desc acceptor_address; + gss_buffer_desc application_data; +} *gss_channel_bindings_t; + +/* + * For now, define a QOP-type as an OM_uint32 (pending resolution of ongoing + * discussions). + */ +typedef OM_uint32 gss_qop_t; +typedef int gss_cred_usage_t; + +/* + * Flag bits for context-level services. + */ +#define GSS_C_DELEG_FLAG 1 +#define GSS_C_MUTUAL_FLAG 2 +#define GSS_C_REPLAY_FLAG 4 +#define GSS_C_SEQUENCE_FLAG 8 +#define GSS_C_CONF_FLAG 16 +#define GSS_C_INTEG_FLAG 32 +#define GSS_C_ANON_FLAG 64 +#define GSS_C_PROT_READY_FLAG 128 +#define GSS_C_TRANS_FLAG 256 + +/* + * Credential usage options + */ +#define GSS_C_BOTH 0 +#define GSS_C_INITIATE 1 +#define GSS_C_ACCEPT 2 + +/* + * Status code types for gss_display_status + */ +#define GSS_C_GSS_CODE 1 +#define GSS_C_MECH_CODE 2 + +/* + * The constant definitions for channel-bindings address families + */ +#define GSS_C_AF_UNSPEC 0 +#define GSS_C_AF_LOCAL 1 +#define GSS_C_AF_INET 2 +#define GSS_C_AF_IMPLINK 3 +#define GSS_C_AF_PUP 4 +#define GSS_C_AF_CHAOS 5 +#define GSS_C_AF_NS 6 +#define GSS_C_AF_NBS 7 +#define GSS_C_AF_ECMA 8 +#define GSS_C_AF_DATAKIT 9 +#define GSS_C_AF_CCITT 10 +#define GSS_C_AF_SNA 11 +#define GSS_C_AF_DECnet 12 +#define GSS_C_AF_DLI 13 +#define GSS_C_AF_LAT 14 +#define GSS_C_AF_HYLINK 15 +#define GSS_C_AF_APPLETALK 16 +#define GSS_C_AF_BSC 17 +#define GSS_C_AF_DSS 18 +#define GSS_C_AF_OSI 19 +#define GSS_C_AF_X25 21 + +#define GSS_C_AF_NULLADDR 255 + +/* + * Various Null values. + */ +#define GSS_C_NO_NAME ((gss_name_t) 0) +#define GSS_C_NO_BUFFER ((gss_buffer_t) 0) +#define GSS_C_NO_OID ((gss_OID) 0) +#define GSS_C_NO_OID_SET ((gss_OID_set) 0) +#define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0) +#define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0) +#define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0) +#define GSS_C_EMPTY_BUFFER {0, NULL} + +/* + * Some alternate names for a couple of the above values. These are defined + * for V1 compatibility. + */ +#define GSS_C_NULL_OID GSS_C_NO_OID +#define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET + +/* + * Define the default Quality of Protection for per-message services. Note + * that an implementation that offers multiple levels of QOP may either reserve + * a value (for example zero, as assumed here) to mean "default protection", or + * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit + * QOP value. However a value of 0 should always be interpreted by a GSSAPI + * implementation as a request for the default protection level. + */ +#define GSS_C_QOP_DEFAULT 0 + +/* + * Expiration time of 2^32-1 seconds means infinite lifetime for a + * credential or security context + */ +#define GSS_C_INDEFINITE ((OM_uint32) 0xfffffffful) + + +/* Major status codes */ + +#define GSS_S_COMPLETE 0 + +/* + * Some "helper" definitions to make the status code macros obvious. + */ +#define GSS_C_CALLING_ERROR_OFFSET 24 +#define GSS_C_ROUTINE_ERROR_OFFSET 16 +#define GSS_C_SUPPLEMENTARY_OFFSET 0 +#define GSS_C_CALLING_ERROR_MASK ((OM_uint32) 0377ul) +#define GSS_C_ROUTINE_ERROR_MASK ((OM_uint32) 0377ul) +#define GSS_C_SUPPLEMENTARY_MASK ((OM_uint32) 0177777ul) + +/* + * The macros that test status codes for error conditions. Note that the + * GSS_ERROR() macro has changed slightly from the V1 GSSAPI so that it now + * evaluates its argument only once. + */ +#define GSS_CALLING_ERROR(x) \ + ((x) & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET)) +#define GSS_ROUTINE_ERROR(x) \ + ((x) & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)) +#define GSS_SUPPLEMENTARY_INFO(x) \ + ((x) & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET)) +#define GSS_ERROR(x) \ + ((x) & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \ + (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))) + +/* + * Now the actual status code definitions + */ + +/* + * Calling errors: + */ +#define GSS_S_CALL_INACCESSIBLE_READ \ + (((OM_uint32) 1ul) << GSS_C_CALLING_ERROR_OFFSET) +#define GSS_S_CALL_INACCESSIBLE_WRITE \ + (((OM_uint32) 2ul) << GSS_C_CALLING_ERROR_OFFSET) +#define GSS_S_CALL_BAD_STRUCTURE \ + (((OM_uint32) 3ul) << GSS_C_CALLING_ERROR_OFFSET) + +/* + * Routine errors: + */ +#define GSS_S_BAD_MECH (((OM_uint32) 1ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_NAME (((OM_uint32) 2ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_NAMETYPE (((OM_uint32) 3ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_BINDINGS (((OM_uint32) 4ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_STATUS (((OM_uint32) 5ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_SIG (((OM_uint32) 6ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_NO_CRED (((OM_uint32) 7ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_NO_CONTEXT (((OM_uint32) 8ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_DEFECTIVE_TOKEN (((OM_uint32) 9ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_DEFECTIVE_CREDENTIAL \ + (((OM_uint32) 10ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_CREDENTIALS_EXPIRED \ + (((OM_uint32) 11ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_CONTEXT_EXPIRED \ + (((OM_uint32) 12ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_FAILURE (((OM_uint32) 13ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_BAD_QOP (((OM_uint32) 14ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_UNAUTHORIZED (((OM_uint32) 15ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_UNAVAILABLE (((OM_uint32) 16ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_DUPLICATE_ELEMENT \ + (((OM_uint32) 17ul) << GSS_C_ROUTINE_ERROR_OFFSET) +#define GSS_S_NAME_NOT_MN \ + (((OM_uint32) 18ul) << GSS_C_ROUTINE_ERROR_OFFSET) + +/* + * Supplementary info bits: + */ +#define GSS_S_CONTINUE_NEEDED (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 0)) +#define GSS_S_DUPLICATE_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 1)) +#define GSS_S_OLD_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 2)) +#define GSS_S_UNSEQ_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 3)) +#define GSS_S_GAP_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 4)) + + +/* + * Finally, function prototypes for the GSSAPI routines. + */ + +#if defined (_WIN32) && defined (_MSC_VER) +# ifdef GSS_DLL_FILE +# define GSS_DLLIMP __declspec(dllexport) +# else +# define GSS_DLLIMP __declspec(dllimport) +# endif +#else +# define GSS_DLLIMP +#endif + +/* Reserved static storage for GSS_oids. Comments are quotes from RFC 2744. + * + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01"}, + * corresponding to an object-identifier value of + * {iso(1) member-body(2) United States(840) mit(113554) + * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant + * GSS_C_NT_USER_NAME should be initialized to point + * to that gss_OID_desc. + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_USER_NAME; + +/* + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"}, + * corresponding to an object-identifier value of + * {iso(1) member-body(2) United States(840) mit(113554) + * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}. + * The constant GSS_C_NT_MACHINE_UID_NAME should be + * initialized to point to that gss_OID_desc. + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_MACHINE_UID_NAME; + +/* + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03"}, + * corresponding to an object-identifier value of + * {iso(1) member-body(2) United States(840) mit(113554) + * infosys(1) gssapi(2) generic(1) string_uid_name(3)}. + * The constant GSS_C_NT_STRING_UID_NAME should be + * initialized to point to that gss_OID_desc. + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_STRING_UID_NAME; + +/* + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {6, (void *)"\x2b\x06\x01\x05\x06\x02"}, + * corresponding to an object-identifier value of + * {iso(1) org(3) dod(6) internet(1) security(5) + * nametypes(6) gss-host-based-services(2)). The constant + * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point + * to that gss_OID_desc. This is a deprecated OID value, and + * implementations wishing to support hostbased-service names + * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID, + * defined below, to identify such names; + * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym + * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input + * parameter, but should not be emitted by GSS-API + * implementations + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X; + +/* + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {10, (void *)"\x2a\x86\x48\x86\xf7\x12" + * "\x01\x02\x01\x04"}, corresponding to an + * object-identifier value of {iso(1) member-body(2) + * Unites States(840) mit(113554) infosys(1) gssapi(2) + * generic(1) service_name(4)}. The constant + * GSS_C_NT_HOSTBASED_SERVICE should be initialized + * to point to that gss_OID_desc. + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE; + +/* + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {6, (void *)"\x2b\x06\01\x05\x06\x03"}, + * corresponding to an object identifier value of + * {1(iso), 3(org), 6(dod), 1(internet), 5(security), + * 6(nametypes), 3(gss-anonymous-name)}. The constant + * and GSS_C_NT_ANONYMOUS should be initialized to point + * to that gss_OID_desc. + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_ANONYMOUS; + + +/* + * The implementation must reserve static storage for a + * gss_OID_desc object containing the value + * {6, (void *)"\x2b\x06\x01\x05\x06\x04"}, + * corresponding to an object-identifier value of + * {1(iso), 3(org), 6(dod), 1(internet), 5(security), + * 6(nametypes), 4(gss-api-exported-name)}. The constant + * GSS_C_NT_EXPORT_NAME should be initialized to point + * to that gss_OID_desc. + */ +GSS_DLLIMP extern gss_OID GSS_C_NT_EXPORT_NAME; + +/* Function Prototypes */ + +OM_uint32 KRB5_CALLCONV gss_acquire_cred +(OM_uint32 *, /* minor_status */ + gss_name_t, /* desired_name */ + OM_uint32, /* time_req */ + gss_OID_set, /* desired_mechs */ + gss_cred_usage_t, /* cred_usage */ + gss_cred_id_t *, /* output_cred_handle */ + gss_OID_set *, /* actual_mechs */ + OM_uint32 * /* time_rec */ + ); + +OM_uint32 KRB5_CALLCONV gss_release_cred +(OM_uint32 *, /* minor_status */ + gss_cred_id_t * /* cred_handle */ + ); + +OM_uint32 KRB5_CALLCONV gss_init_sec_context +(OM_uint32 *, /* minor_status */ + gss_cred_id_t, /* claimant_cred_handle */ + gss_ctx_id_t *, /* context_handle */ + gss_name_t, /* target_name */ + gss_OID, /* mech_type (used to be const) */ + OM_uint32, /* req_flags */ + OM_uint32, /* time_req */ + gss_channel_bindings_t, /* input_chan_bindings */ + gss_buffer_t, /* input_token */ + gss_OID *, /* actual_mech_type */ + gss_buffer_t, /* output_token */ + OM_uint32 *, /* ret_flags */ + OM_uint32 * /* time_rec */ + ); + +OM_uint32 KRB5_CALLCONV gss_accept_sec_context +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t *, /* context_handle */ + gss_cred_id_t, /* acceptor_cred_handle */ + gss_buffer_t, /* input_token_buffer */ + gss_channel_bindings_t, /* input_chan_bindings */ + gss_name_t *, /* src_name */ + gss_OID *, /* mech_type */ + gss_buffer_t, /* output_token */ + OM_uint32 *, /* ret_flags */ + OM_uint32 *, /* time_rec */ + gss_cred_id_t * /* delegated_cred_handle */ + ); + +OM_uint32 KRB5_CALLCONV gss_process_context_token +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_buffer_t /* token_buffer */ + ); + +OM_uint32 KRB5_CALLCONV gss_delete_sec_context +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t *, /* context_handle */ + gss_buffer_t /* output_token */ + ); + +OM_uint32 KRB5_CALLCONV gss_context_time +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + OM_uint32 * /* time_rec */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_get_mic +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_qop_t, /* qop_req */ + gss_buffer_t, /* message_buffer */ + gss_buffer_t /* message_token */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_verify_mic +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_buffer_t, /* message_buffer */ + gss_buffer_t, /* message_token */ + gss_qop_t * /* qop_state */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_wrap +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + int, /* conf_req_flag */ + gss_qop_t, /* qop_req */ + gss_buffer_t, /* input_message_buffer */ + int *, /* conf_state */ + gss_buffer_t /* output_message_buffer */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_unwrap +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_buffer_t, /* input_message_buffer */ + gss_buffer_t, /* output_message_buffer */ + int *, /* conf_state */ + gss_qop_t * /* qop_state */ + ); + +OM_uint32 KRB5_CALLCONV gss_display_status +(OM_uint32 *, /* minor_status */ + OM_uint32, /* status_value */ + int, /* status_type */ + gss_OID, /* mech_type (used to be const) */ + OM_uint32 *, /* message_context */ + gss_buffer_t /* status_string */ + ); + +OM_uint32 KRB5_CALLCONV gss_indicate_mechs +(OM_uint32 *, /* minor_status */ + gss_OID_set * /* mech_set */ + ); + +OM_uint32 KRB5_CALLCONV gss_compare_name +(OM_uint32 *, /* minor_status */ + gss_name_t, /* name1 */ + gss_name_t, /* name2 */ + int * /* name_equal */ + ); + +OM_uint32 KRB5_CALLCONV gss_display_name +(OM_uint32 *, /* minor_status */ + gss_name_t, /* input_name */ + gss_buffer_t, /* output_name_buffer */ + gss_OID * /* output_name_type */ + ); + +OM_uint32 KRB5_CALLCONV gss_import_name +(OM_uint32 *, /* minor_status */ + gss_buffer_t, /* input_name_buffer */ + gss_OID, /* input_name_type(used to be const) */ + gss_name_t * /* output_name */ + ); + +OM_uint32 KRB5_CALLCONV gss_release_name +(OM_uint32 *, /* minor_status */ + gss_name_t * /* input_name */ + ); + +OM_uint32 KRB5_CALLCONV gss_release_buffer +(OM_uint32 *, /* minor_status */ + gss_buffer_t /* buffer */ + ); + +OM_uint32 KRB5_CALLCONV gss_release_oid_set +(OM_uint32 *, /* minor_status */ + gss_OID_set * /* set */ + ); + +OM_uint32 KRB5_CALLCONV gss_inquire_cred +(OM_uint32 *, /* minor_status */ + gss_cred_id_t, /* cred_handle */ + gss_name_t *, /* name */ + OM_uint32 *, /* lifetime */ + gss_cred_usage_t *, /* cred_usage */ + gss_OID_set * /* mechanisms */ + ); + +/* Last argument new for V2 */ +OM_uint32 KRB5_CALLCONV gss_inquire_context +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_name_t *, /* src_name */ + gss_name_t *, /* targ_name */ + OM_uint32 *, /* lifetime_rec */ + gss_OID *, /* mech_type */ + OM_uint32 *, /* ctx_flags */ + int *, /* locally_initiated */ + int * /* open */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_wrap_size_limit +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + int, /* conf_req_flag */ + gss_qop_t, /* qop_req */ + OM_uint32, /* req_output_size */ + OM_uint32 * /* max_input_size */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_import_name_object +(OM_uint32 *, /* minor_status */ + void *, /* input_name */ + gss_OID, /* input_name_type */ + gss_name_t * /* output_name */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_export_name_object +(OM_uint32 *, /* minor_status */ + gss_name_t, /* input_name */ + gss_OID, /* desired_name_type */ + void ** /* output_name */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_add_cred +(OM_uint32 *, /* minor_status */ + gss_cred_id_t, /* input_cred_handle */ + gss_name_t, /* desired_name */ + gss_OID, /* desired_mech */ + gss_cred_usage_t, /* cred_usage */ + OM_uint32, /* initiator_time_req */ + OM_uint32, /* acceptor_time_req */ + gss_cred_id_t *, /* output_cred_handle */ + gss_OID_set *, /* actual_mechs */ + OM_uint32 *, /* initiator_time_rec */ + OM_uint32 * /* acceptor_time_rec */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_inquire_cred_by_mech +(OM_uint32 *, /* minor_status */ + gss_cred_id_t, /* cred_handle */ + gss_OID, /* mech_type */ + gss_name_t *, /* name */ + OM_uint32 *, /* initiator_lifetime */ + OM_uint32 *, /* acceptor_lifetime */ + gss_cred_usage_t * /* cred_usage */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_export_sec_context +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t *, /* context_handle */ + gss_buffer_t /* interprocess_token */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_import_sec_context +(OM_uint32 *, /* minor_status */ + gss_buffer_t, /* interprocess_token */ + gss_ctx_id_t * /* context_handle */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_release_oid +(OM_uint32 *, /* minor_status */ + gss_OID * /* oid */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_create_empty_oid_set +(OM_uint32 *, /* minor_status */ + gss_OID_set * /* oid_set */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_add_oid_set_member +(OM_uint32 *, /* minor_status */ + gss_OID, /* member_oid */ + gss_OID_set * /* oid_set */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_test_oid_set_member +(OM_uint32 *, /* minor_status */ + gss_OID, /* member */ + gss_OID_set, /* set */ + int * /* present */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_str_to_oid +(OM_uint32 *, /* minor_status */ + gss_buffer_t, /* oid_str */ + gss_OID * /* oid */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_oid_to_str +(OM_uint32 *, /* minor_status */ + gss_OID, /* oid */ + gss_buffer_t /* oid_str */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_inquire_names_for_mech +(OM_uint32 *, /* minor_status */ + gss_OID, /* mechanism */ + gss_OID_set * /* name_types */ + ); + +/* + * The following routines are obsolete variants of gss_get_mic, gss_wrap, + * gss_verify_mic and gss_unwrap. They should be provided by GSSAPI V2 + * implementations for backwards compatibility with V1 applications. Distinct + * entrypoints (as opposed to #defines) should be provided, to allow GSSAPI + * V1 applications to link against GSSAPI V2 implementations. + */ +OM_uint32 KRB5_CALLCONV gss_sign +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + int, /* qop_req */ + gss_buffer_t, /* message_buffer */ + gss_buffer_t /* message_token */ + ); + +OM_uint32 KRB5_CALLCONV gss_verify +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_buffer_t, /* message_buffer */ + gss_buffer_t, /* token_buffer */ + int * /* qop_state */ + ); + +OM_uint32 KRB5_CALLCONV gss_seal +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + int, /* conf_req_flag */ + int, /* qop_req */ + gss_buffer_t, /* input_message_buffer */ + int *, /* conf_state */ + gss_buffer_t /* output_message_buffer */ + ); + +OM_uint32 KRB5_CALLCONV gss_unseal +(OM_uint32 *, /* minor_status */ + gss_ctx_id_t, /* context_handle */ + gss_buffer_t, /* input_message_buffer */ + gss_buffer_t, /* output_message_buffer */ + int *, /* conf_state */ + int * /* qop_state */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_export_name +(OM_uint32 *, /* minor_status */ + const gss_name_t, /* input_name */ + gss_buffer_t /* exported_name */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_duplicate_name +(OM_uint32 *, /* minor_status */ + const gss_name_t, /* input_name */ + gss_name_t * /* dest_name */ + ); + +/* New for V2 */ +OM_uint32 KRB5_CALLCONV gss_canonicalize_name +(OM_uint32 *, /* minor_status */ + const gss_name_t, /* input_name */ + const gss_OID, /* mech_type */ + gss_name_t * /* output_name */ + ); + +#if TARGET_OS_MAC +# if defined(__MWERKS__) +# pragma import reset +# endif +# pragma options align=reset +#endif + +#ifdef __cplusplus +} +#endif + +/* XXXX these are not part of the GSSAPI C bindings! (but should be) */ + +#define GSS_CALLING_ERROR_FIELD(x) \ + (((x) >> GSS_C_CALLING_ERROR_OFFSET) & GSS_C_CALLING_ERROR_MASK) +#define GSS_ROUTINE_ERROR_FIELD(x) \ + (((x) >> GSS_C_ROUTINE_ERROR_OFFSET) & GSS_C_ROUTINE_ERROR_MASK) +#define GSS_SUPPLEMENTARY_INFO_FIELD(x) \ + (((x) >> GSS_C_SUPPLEMENTARY_OFFSET) & GSS_C_SUPPLEMENTARY_MASK) + +/* XXXX This is a necessary evil until the spec is fixed */ +#define GSS_S_CRED_UNAVAIL GSS_S_FAILURE + +#endif /* _GSSAPI_H_ */ diff --git a/src/WINNT/kfw/inc/krb5/gssapi/gssapi_generic.h b/src/WINNT/kfw/inc/krb5/gssapi/gssapi_generic.h new file mode 100644 index 000000000..73bfe1a64 --- /dev/null +++ b/src/WINNT/kfw/inc/krb5/gssapi/gssapi_generic.h @@ -0,0 +1,55 @@ +/* + * Copyright 1993 by OpenVision Technologies, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appears in all copies and + * that both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of OpenVision not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. OpenVision makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _GSSAPI_GENERIC_H_ +#define _GSSAPI_GENERIC_H_ + +/* + * $Id: gssapi_generic.h,v 1.1 2004/02/26 19:22:54 jaltman Exp $ + */ + +#include + +#if defined(__cplusplus) && !defined(GSSAPIGENERIC_BEGIN_DECLS) +#define GSSAPIGENERIC_BEGIN_DECLS extern "C" { +#define GSSAPIGENERIC_END_DECLS } +#else +#define GSSAPIGENERIC_BEGIN_DECLS +#define GSSAPIGENERIC_END_DECLS +#endif + +GSSAPIGENERIC_BEGIN_DECLS + +/* Deprecated MIT krb5 oid names provided for compatibility. + * The correct oids (GSS_C_NT_USER_NAME, etc) from rfc 2744 + * are defined in gssapi.h. */ + +GSS_DLLIMP extern gss_OID gss_nt_user_name; +GSS_DLLIMP extern gss_OID gss_nt_machine_uid_name; +GSS_DLLIMP extern gss_OID gss_nt_string_uid_name; +extern gss_OID gss_nt_service_name_v2; +GSS_DLLIMP extern gss_OID gss_nt_service_name; +extern gss_OID gss_nt_exported_name; + +GSSAPIGENERIC_END_DECLS + +#endif /* _GSSAPI_GENERIC_H_ */ diff --git a/src/WINNT/kfw/inc/krb5/gssapi/gssapi_krb5.h b/src/WINNT/kfw/inc/krb5/gssapi/gssapi_krb5.h new file mode 100644 index 000000000..3007a0fd8 --- /dev/null +++ b/src/WINNT/kfw/inc/krb5/gssapi/gssapi_krb5.h @@ -0,0 +1,114 @@ +/* + * Copyright 1993 by OpenVision Technologies, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appears in all copies and + * that both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of OpenVision not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. OpenVision makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _GSSAPI_KRB5_H_ +#define _GSSAPI_KRB5_H_ + +#include +#include + +/* C++ friendlyness */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Reserved static storage for GSS_oids. See rfc 1964 for more details. */ + +/* 2.1.1. Kerberos Principal Name Form: */ +GSS_DLLIMP extern const gss_OID_desc * const GSS_KRB5_NT_PRINCIPAL_NAME; +/* This name form shall be represented by the Object Identifier {iso(1) + * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * krb5(2) krb5_name(1)}. The recommended symbolic name for this type + * is "GSS_KRB5_NT_PRINCIPAL_NAME". */ + +/* 2.1.2. Host-Based Service Name Form */ +#define GSS_KRB5_NT_HOSTBASED_SERVICE_NAME GSS_C_NT_HOSTBASED_SERVICE +/* This name form shall be represented by the Object Identifier {iso(1) + * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * generic(1) service_name(4)}. The previously recommended symbolic + * name for this type is "GSS_KRB5_NT_HOSTBASED_SERVICE_NAME". The + * currently preferred symbolic name for this type is + * "GSS_C_NT_HOSTBASED_SERVICE". */ + +/* 2.2.1. User Name Form */ +#define GSS_KRB5_NT_USER_NAME GSS_C_NT_USER_NAME +/* This name form shall be represented by the Object Identifier {iso(1) + * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * generic(1) user_name(1)}. The recommended symbolic name for this + * type is "GSS_KRB5_NT_USER_NAME". */ + +/* 2.2.2. Machine UID Form */ +#define GSS_KRB5_NT_MACHINE_UID_NAME GSS_C_NT_MACHINE_UID_NAME +/* This name form shall be represented by the Object Identifier {iso(1) + * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * generic(1) machine_uid_name(2)}. The recommended symbolic name for + * this type is "GSS_KRB5_NT_MACHINE_UID_NAME". */ + +/* 2.2.3. String UID Form */ +#define GSS_KRB5_NT_STRING_UID_NAME GSS_C_NT_STRING_UID_NAME +/* This name form shall be represented by the Object Identifier {iso(1) + * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * generic(1) string_uid_name(3)}. The recommended symbolic name for + * this type is "GSS_KRB5_NT_STRING_UID_NAME". */ + +extern const gss_OID_desc * const gss_mech_krb5; +extern const gss_OID_desc * const gss_mech_krb5_old; +extern const gss_OID_set_desc * const gss_mech_set_krb5; +extern const gss_OID_set_desc * const gss_mech_set_krb5_old; +extern const gss_OID_set_desc * const gss_mech_set_krb5_both; + +extern const gss_OID_desc * const gss_nt_krb5_name; +extern const gss_OID_desc * const gss_nt_krb5_principal; + +extern const gss_OID_desc krb5_gss_oid_array[]; + +#define gss_krb5_nt_general_name gss_nt_krb5_name +#define gss_krb5_nt_principal gss_nt_krb5_principal +#define gss_krb5_nt_service_name gss_nt_service_name +#define gss_krb5_nt_user_name gss_nt_user_name +#define gss_krb5_nt_machine_uid_name gss_nt_machine_uid_name +#define gss_krb5_nt_string_uid_name gss_nt_string_uid_name + +/* Alias for Heimdal compat. */ +#define gsskrb5_register_acceptor_identity krb5_gss_register_acceptor_identity + +OM_uint32 KRB5_CALLCONV krb5_gss_register_acceptor_identity(const char *); + +OM_uint32 KRB5_CALLCONV gss_krb5_get_tkt_flags + (OM_uint32 *minor_status, + gss_ctx_id_t context_handle, + krb5_flags *ticket_flags); + +OM_uint32 KRB5_CALLCONV gss_krb5_copy_ccache + (OM_uint32 *minor_status, + gss_cred_id_t cred_handle, + krb5_ccache out_ccache); + +OM_uint32 KRB5_CALLCONV gss_krb5_ccache_name + (OM_uint32 *minor_status, const char *name, + const char **out_name); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _GSSAPI_KRB5_H_ */ diff --git a/src/WINNT/kfw/inc/krb5/krb5.h b/src/WINNT/kfw/inc/krb5/krb5.h new file mode 100644 index 000000000..5c5df50d5 --- /dev/null +++ b/src/WINNT/kfw/inc/krb5/krb5.h @@ -0,0 +1,3063 @@ +/* + * include/krb5.h + * + * Copyright 1989,1990,1995,2001, 2003 by the Massachusetts Institute of Technology. + * All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * + * General definitions for Kerberos version 5. + */ + +/* + * Copyright (C) 1998 by the FundsXpress, INC. + * + * All rights reserved. + * + * Export of this software from the United States of America may require + * a specific license from the United States Government. It is the + * responsibility of any person or organization contemplating export to + * obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of FundsXpress. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. FundsXpress makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef KRB5_GENERAL__ +#define KRB5_GENERAL__ + +/* By default, do not expose deprecated interfaces. */ +#ifndef KRB5_DEPRECATED +#define KRB5_DEPRECATED 0 +#endif +/* Do not expose private interfaces. Build system will override. */ +#ifndef KRB5_PRIVATE +#define KRB5_PRIVATE 0 +#endif + +#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)) +# include +# if TARGET_RT_MAC_CFM +# error "Use KfM 4.0 SDK headers for CFM compilation." +# endif +#endif + +#if defined(_MSDOS) || defined(_WIN32) +#include +#endif + +#ifndef KRB5_CONFIG__ +#ifndef KRB5_CALLCONV +#define KRB5_CALLCONV +#define KRB5_CALLCONV_C +#endif /* !KRB5_CALLCONV */ +#endif /* !KRB5_CONFIG__ */ + +#ifndef KRB5_CALLCONV_WRONG +#define KRB5_CALLCONV_WRONG +#endif + +#ifndef THREEPARAMOPEN +#define THREEPARAMOPEN(x,y,z) open(x,y,z) +#endif + +#define KRB5_OLD_CRYPTO + +#include +#include /* for *_MAX */ + +#ifndef KRB5INT_BEGIN_DECLS +#if defined(__cplusplus) +#define KRB5INT_BEGIN_DECLS extern "C" { +#define KRB5INT_END_DECLS } +#else +#define KRB5INT_BEGIN_DECLS +#define KRB5INT_END_DECLS +#endif +#endif + +KRB5INT_BEGIN_DECLS + +#if TARGET_OS_MAC +# if defined(__MWERKS__) +# pragma import on +# endif +# pragma options align=mac68k +#endif + +/* from profile.h */ +struct _profile_t; +/* typedef struct _profile_t *profile_t; */ + +/* + * begin wordsize.h + */ + +/* + * Word-size related definition. + */ + +typedef unsigned char krb5_octet; + +#if INT_MAX == 0x7fff +typedef int krb5_int16; +typedef unsigned int krb5_ui_2; +#elif SHRT_MAX == 0x7fff +typedef short krb5_int16; +typedef unsigned short krb5_ui_2; +#else +#error undefined 16 bit type +#endif + +#if INT_MAX == 0x7fffffffL +typedef int krb5_int32; +typedef unsigned int krb5_ui_4; +#elif LONG_MAX == 0x7fffffffL +typedef long krb5_int32; +typedef unsigned long krb5_ui_4; +#elif SHRT_MAX == 0x7fffffffL +typedef short krb5_int32; +typedef unsigned short krb5_ui_4; +#else +#error: undefined 32 bit type +#endif + +#define VALID_INT_BITS INT_MAX +#define VALID_UINT_BITS UINT_MAX + +#define KRB5_INT32_MAX 2147483647 +/* this strange form is necessary since - is a unary operator, not a sign + indicator */ +#define KRB5_INT32_MIN (-KRB5_INT32_MAX-1) + +#define KRB5_INT16_MAX 65535 +/* this strange form is necessary since - is a unary operator, not a sign + indicator */ +#define KRB5_INT16_MIN (-KRB5_INT16_MAX-1) + +/* + * end wordsize.h + */ + +/* + * begin "base-defs.h" + */ + +/* + * Basic definitions for Kerberos V5 library + */ + +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif + +typedef unsigned int krb5_boolean; +typedef unsigned int krb5_msgtype; +typedef unsigned int krb5_kvno; + +typedef krb5_int32 krb5_addrtype; +typedef krb5_int32 krb5_enctype; +typedef krb5_int32 krb5_cksumtype; +typedef krb5_int32 krb5_authdatatype; +typedef krb5_int32 krb5_keyusage; + +typedef krb5_int32 krb5_preauthtype; /* This may change, later on */ +typedef krb5_int32 krb5_flags; +typedef krb5_int32 krb5_timestamp; +typedef krb5_int32 krb5_error_code; +typedef krb5_int32 krb5_deltat; + +typedef krb5_error_code krb5_magic; + +typedef struct _krb5_data { + krb5_magic magic; + unsigned int length; + char *data; +} krb5_data; + +/* + * Hack length for crypto library to use the afs_string_to_key It is + * equivalent to -1 without possible sign extension + * We also overload for an unset salt type length - which is also -1, but + * hey, why not.... +*/ +#define SALT_TYPE_AFS_LENGTH UINT_MAX +#define SALT_TYPE_NO_LENGTH UINT_MAX + +typedef void * krb5_pointer; +typedef void const * krb5_const_pointer; + +typedef struct krb5_principal_data { + krb5_magic magic; + krb5_data realm; + krb5_data *data; /* An array of strings */ + krb5_int32 length; + krb5_int32 type; +} krb5_principal_data; + +typedef krb5_principal_data * krb5_principal; + +/* + * Per V5 spec on definition of principal types + */ + +/* Name type not known */ +#define KRB5_NT_UNKNOWN 0 +/* Just the name of the principal as in DCE, or for users */ +#define KRB5_NT_PRINCIPAL 1 +/* Service and other unique instance (krbtgt) */ +#define KRB5_NT_SRV_INST 2 +/* Service with host name as instance (telnet, rcommands) */ +#define KRB5_NT_SRV_HST 3 +/* Service with host as remaining components */ +#define KRB5_NT_SRV_XHST 4 +/* Unique ID */ +#define KRB5_NT_UID 5 + +/* constant version thereof: */ +typedef const krb5_principal_data *krb5_const_principal; + +#define krb5_princ_realm(context, princ) (&(princ)->realm) +#define krb5_princ_set_realm(context, princ,value) ((princ)->realm = *(value)) +#define krb5_princ_set_realm_length(context, princ,value) (princ)->realm.length = (value) +#define krb5_princ_set_realm_data(context, princ,value) (princ)->realm.data = (value) +#define krb5_princ_size(context, princ) (princ)->length +#define krb5_princ_type(context, princ) (princ)->type +#define krb5_princ_name(context, princ) (princ)->data +#define krb5_princ_component(context, princ,i) \ + (((i) < krb5_princ_size(context, princ)) \ + ? (princ)->data + (i) \ + : NULL) + +/* + * end "base-defs.h" + */ + +/* + * begin "hostaddr.h" + */ + +/* structure for address */ +typedef struct _krb5_address { + krb5_magic magic; + krb5_addrtype addrtype; + unsigned int length; + krb5_octet *contents; +} krb5_address; + +/* per Kerberos v5 protocol spec */ +#define ADDRTYPE_INET 0x0002 +#define ADDRTYPE_CHAOS 0x0005 +#define ADDRTYPE_XNS 0x0006 +#define ADDRTYPE_ISO 0x0007 +#define ADDRTYPE_DDP 0x0010 +#define ADDRTYPE_INET6 0x0018 +/* not yet in the spec... */ +#define ADDRTYPE_ADDRPORT 0x0100 +#define ADDRTYPE_IPPORT 0x0101 + +/* macros to determine if a type is a local type */ +#define ADDRTYPE_IS_LOCAL(addrtype) (addrtype & 0x8000) + +/* + * end "hostaddr.h" + */ + + +struct _krb5_context; +typedef struct _krb5_context * krb5_context; + +struct _krb5_auth_context; +typedef struct _krb5_auth_context * krb5_auth_context; + +struct _krb5_cryptosystem_entry; + +/* + * begin "encryption.h" + */ + +typedef struct _krb5_keyblock { + krb5_magic magic; + krb5_enctype enctype; + unsigned int length; + krb5_octet *contents; +} krb5_keyblock; + +#ifdef KRB5_OLD_CRYPTO +typedef struct _krb5_encrypt_block { + krb5_magic magic; + krb5_enctype crypto_entry; /* to call krb5_encrypt_size, you need + this. it was a pointer, but it + doesn't have to be. gross. */ + krb5_keyblock *key; +} krb5_encrypt_block; +#endif + +typedef struct _krb5_checksum { + krb5_magic magic; + krb5_cksumtype checksum_type; /* checksum type */ + unsigned int length; + krb5_octet *contents; +} krb5_checksum; + +typedef struct _krb5_enc_data { + krb5_magic magic; + krb5_enctype enctype; + krb5_kvno kvno; + krb5_data ciphertext; +} krb5_enc_data; + +/* per Kerberos v5 protocol spec */ +#define ENCTYPE_NULL 0x0000 +#define ENCTYPE_DES_CBC_CRC 0x0001 /* DES cbc mode with CRC-32 */ +#define ENCTYPE_DES_CBC_MD4 0x0002 /* DES cbc mode with RSA-MD4 */ +#define ENCTYPE_DES_CBC_MD5 0x0003 /* DES cbc mode with RSA-MD5 */ +#define ENCTYPE_DES_CBC_RAW 0x0004 /* DES cbc mode raw */ +/* XXX deprecated? */ +#define ENCTYPE_DES3_CBC_SHA 0x0005 /* DES-3 cbc mode with NIST-SHA */ +#define ENCTYPE_DES3_CBC_RAW 0x0006 /* DES-3 cbc mode raw */ +#define ENCTYPE_DES_HMAC_SHA1 0x0008 +#define ENCTYPE_DES3_CBC_SHA1 0x0010 +#define ENCTYPE_AES128_CTS_HMAC_SHA1_96 0x0011 +#define ENCTYPE_AES256_CTS_HMAC_SHA1_96 0x0012 +#define ENCTYPE_ARCFOUR_HMAC 0x0017 +#define ENCTYPE_ARCFOUR_HMAC_EXP 0x0018 +#define ENCTYPE_UNKNOWN 0x01ff +/* local crud */ +/* marc's DES-3 with 32-bit length */ +#define ENCTYPE_LOCAL_DES3_HMAC_SHA1 0x7007 + +#define CKSUMTYPE_CRC32 0x0001 +#define CKSUMTYPE_RSA_MD4 0x0002 +#define CKSUMTYPE_RSA_MD4_DES 0x0003 +#define CKSUMTYPE_DESCBC 0x0004 +/* des-mac-k */ +/* rsa-md4-des-k */ +#define CKSUMTYPE_RSA_MD5 0x0007 +#define CKSUMTYPE_RSA_MD5_DES 0x0008 +#define CKSUMTYPE_NIST_SHA 0x0009 +#define CKSUMTYPE_HMAC_SHA1_DES3 0x000c +#define CKSUMTYPE_HMAC_SHA1_96_AES128 0x000f +#define CKSUMTYPE_HMAC_SHA1_96_AES256 0x0010 +#define CKSUMTYPE_HMAC_MD5_ARCFOUR -138 /*Microsoft md5 hmac cksumtype*/ + +/* The following are entropy source designations. Whenever + * krb5_C_random_add_entropy is called, one of these source ids is passed + * in. This allows the library to better estimate bits of + * entropy in the sample and to keep track of what sources of entropy have + * contributed enough entropy. Sources marked internal MUST NOT be + * used by applications outside the Kerberos library +*/ + +enum { + KRB5_C_RANDSOURCE_OLDAPI = 0, /*calls to krb5_C_RANDOM_SEED (INTERNAL)*/ + KRB5_C_RANDSOURCE_OSRAND = 1, /* /dev/random or equivalent (internal)*/ + KRB5_C_RANDSOURCE_TRUSTEDPARTY = 2, /* From KDC or other trusted party*/ + /*This source should be used carefully; data in this category + * should be from a third party trusted to give random bits + * For example keys issued by the KDC in the application server. + */ + KRB5_C_RANDSOURCE_TIMING = 3, /* Timing of operations*/ + KRB5_C_RANDSOURCE_EXTERNAL_PROTOCOL = 4, /*Protocol data possibly from attacker*/ + KRB5_C_RANDSOURCE_MAX = 5 /*Do not use; maximum source ID*/ +}; + +#ifndef krb5_roundup +/* round x up to nearest multiple of y */ +#define krb5_roundup(x, y) ((((x) + (y) - 1)/(y))*(y)) +#endif /* roundup */ + +/* macro function definitions to help clean up code */ + +#if 1 +#define krb5_x(ptr,args) ((ptr)?((*(ptr)) args):(abort(),1)) +#define krb5_xc(ptr,args) ((ptr)?((*(ptr)) args):(abort(),(char*)0)) +#else +#define krb5_x(ptr,args) ((*(ptr)) args) +#define krb5_xc(ptr,args) ((*(ptr)) args) +#endif + +krb5_error_code KRB5_CALLCONV + krb5_c_encrypt + (krb5_context context, const krb5_keyblock *key, + krb5_keyusage usage, const krb5_data *cipher_state, + const krb5_data *input, krb5_enc_data *output); + +krb5_error_code KRB5_CALLCONV + krb5_c_decrypt + (krb5_context context, const krb5_keyblock *key, + krb5_keyusage usage, const krb5_data *cipher_state, + const krb5_enc_data *input, krb5_data *output); + +krb5_error_code KRB5_CALLCONV + krb5_c_encrypt_length + (krb5_context context, krb5_enctype enctype, + size_t inputlen, size_t *length); + +krb5_error_code KRB5_CALLCONV + krb5_c_block_size + (krb5_context context, krb5_enctype enctype, + size_t *blocksize); + +krb5_error_code KRB5_CALLCONV + krb5_c_init_state +(krb5_context context, +const krb5_keyblock *key, krb5_keyusage usage, +krb5_data *new_state); + +krb5_error_code KRB5_CALLCONV + krb5_c_free_state +(krb5_context context, const krb5_keyblock *key, krb5_data *state); + +krb5_error_code KRB5_CALLCONV + krb5_c_make_random_key + (krb5_context context, krb5_enctype enctype, + krb5_keyblock *k5_random_key); + +/* Register a new entropy sample with the PRNG. may cause +* the PRNG to be reseeded, although this is not guaranteed. See previous randsource definitions +* for information on how each source should be used. +*/ +krb5_error_code KRB5_CALLCONV + krb5_c_random_add_entropy +(krb5_context context, unsigned int randsource_id, const krb5_data *data); + + +krb5_error_code KRB5_CALLCONV + krb5_c_random_make_octets + (krb5_context context, krb5_data *data); + +/* +* Collect entropy from the OS if possible. strong requests that as strong +* of a source of entropy as available be used. Setting strong may +* increase the probability of blocking and should not be used for normal +* applications. Good uses include seeding the PRNG for kadmind +* and realm setup. +* If successful is non-null, then successful is set to 1 if the OS provided +* entropy else zero. +*/ +krb5_error_code KRB5_CALLCONV +krb5_c_random_os_entropy +(krb5_context context, int strong, int *success); + +/*deprecated*/ krb5_error_code KRB5_CALLCONV + krb5_c_random_seed + (krb5_context context, krb5_data *data); + +krb5_error_code KRB5_CALLCONV + krb5_c_string_to_key + (krb5_context context, krb5_enctype enctype, + const krb5_data *string, const krb5_data *salt, + krb5_keyblock *key); +krb5_error_code KRB5_CALLCONV +krb5_c_string_to_key_with_params(krb5_context context, + krb5_enctype enctype, + const krb5_data *string, + const krb5_data *salt, + const krb5_data *params, + krb5_keyblock *key); + +krb5_error_code KRB5_CALLCONV + krb5_c_enctype_compare + (krb5_context context, krb5_enctype e1, krb5_enctype e2, + krb5_boolean *similar); + +krb5_error_code KRB5_CALLCONV + krb5_c_make_checksum + (krb5_context context, krb5_cksumtype cksumtype, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *input, krb5_checksum *cksum); + +krb5_error_code KRB5_CALLCONV + krb5_c_verify_checksum + (krb5_context context, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *data, + const krb5_checksum *cksum, + krb5_boolean *valid); + +krb5_error_code KRB5_CALLCONV + krb5_c_checksum_length + (krb5_context context, krb5_cksumtype cksumtype, + size_t *length); + +krb5_error_code KRB5_CALLCONV + krb5_c_keyed_checksum_types + (krb5_context context, krb5_enctype enctype, + unsigned int *count, krb5_cksumtype **cksumtypes); + +#define KRB5_KEYUSAGE_AS_REQ_PA_ENC_TS 1 +#define KRB5_KEYUSAGE_KDC_REP_TICKET 2 +#define KRB5_KEYUSAGE_AS_REP_ENCPART 3 +#define KRB5_KEYUSAGE_TGS_REQ_AD_SESSKEY 4 +#define KRB5_KEYUSAGE_TGS_REQ_AD_SUBKEY 5 +#define KRB5_KEYUSAGE_TGS_REQ_AUTH_CKSUM 6 +#define KRB5_KEYUSAGE_TGS_REQ_AUTH 7 +#define KRB5_KEYUSAGE_TGS_REP_ENCPART_SESSKEY 8 +#define KRB5_KEYUSAGE_TGS_REP_ENCPART_SUBKEY 9 +#define KRB5_KEYUSAGE_AP_REQ_AUTH_CKSUM 10 +#define KRB5_KEYUSAGE_AP_REQ_AUTH 11 +#define KRB5_KEYUSAGE_AP_REP_ENCPART 12 +#define KRB5_KEYUSAGE_KRB_PRIV_ENCPART 13 +#define KRB5_KEYUSAGE_KRB_CRED_ENCPART 14 +#define KRB5_KEYUSAGE_KRB_SAFE_CKSUM 15 +#define KRB5_KEYUSAGE_APP_DATA_ENCRYPT 16 +#define KRB5_KEYUSAGE_APP_DATA_CKSUM 17 +#define KRB5_KEYUSAGE_KRB_ERROR_CKSUM 18 +#define KRB5_KEYUSAGE_AD_KDCISSUED_CKSUM 19 +#define KRB5_KEYUSAGE_AD_MTE 20 +#define KRB5_KEYUSAGE_AD_ITE 21 + +/* XXX need to register these */ + +#define KRB5_KEYUSAGE_GSS_TOK_MIC 22 +#define KRB5_KEYUSAGE_GSS_TOK_WRAP_INTEG 23 +#define KRB5_KEYUSAGE_GSS_TOK_WRAP_PRIV 24 + +/* Defined in hardware preauth draft */ + +#define KRB5_KEYUSAGE_PA_SAM_CHALLENGE_CKSUM 25 +#define KRB5_KEYUSAGE_PA_SAM_CHALLENGE_TRACKID 26 +#define KRB5_KEYUSAGE_PA_SAM_RESPONSE 27 + +krb5_boolean KRB5_CALLCONV krb5_c_valid_enctype + (krb5_enctype ktype); +krb5_boolean KRB5_CALLCONV krb5_c_valid_cksumtype + (krb5_cksumtype ctype); +krb5_boolean KRB5_CALLCONV krb5_c_is_coll_proof_cksum + (krb5_cksumtype ctype); +krb5_boolean KRB5_CALLCONV krb5_c_is_keyed_cksum + (krb5_cksumtype ctype); + +#if KRB5_PRIVATE +/* Use the above four instead. */ +krb5_boolean KRB5_CALLCONV valid_enctype + (krb5_enctype ktype); +krb5_boolean KRB5_CALLCONV valid_cksumtype + (krb5_cksumtype ctype); +krb5_boolean KRB5_CALLCONV is_coll_proof_cksum + (krb5_cksumtype ctype); +krb5_boolean KRB5_CALLCONV is_keyed_cksum + (krb5_cksumtype ctype); +#endif + +#ifdef KRB5_OLD_CRYPTO +/* + * old cryptosystem routine prototypes. These are now layered + * on top of the functions above. + */ +krb5_error_code KRB5_CALLCONV krb5_encrypt + (krb5_context context, + krb5_const_pointer inptr, + krb5_pointer outptr, + size_t size, + krb5_encrypt_block * eblock, + krb5_pointer ivec); +krb5_error_code KRB5_CALLCONV krb5_decrypt + (krb5_context context, + krb5_const_pointer inptr, + krb5_pointer outptr, + size_t size, + krb5_encrypt_block * eblock, + krb5_pointer ivec); +krb5_error_code KRB5_CALLCONV krb5_process_key + (krb5_context context, + krb5_encrypt_block * eblock, + const krb5_keyblock * key); +krb5_error_code KRB5_CALLCONV krb5_finish_key + (krb5_context context, + krb5_encrypt_block * eblock); +krb5_error_code KRB5_CALLCONV krb5_string_to_key + (krb5_context context, + const krb5_encrypt_block * eblock, + krb5_keyblock * keyblock, + const krb5_data * data, + const krb5_data * salt); +krb5_error_code KRB5_CALLCONV krb5_init_random_key + (krb5_context context, + const krb5_encrypt_block * eblock, + const krb5_keyblock * keyblock, + krb5_pointer * ptr); +krb5_error_code KRB5_CALLCONV krb5_finish_random_key + (krb5_context context, + const krb5_encrypt_block * eblock, + krb5_pointer * ptr); +krb5_error_code KRB5_CALLCONV krb5_random_key + (krb5_context context, + const krb5_encrypt_block * eblock, + krb5_pointer ptr, + krb5_keyblock ** keyblock); +krb5_enctype KRB5_CALLCONV krb5_eblock_enctype + (krb5_context context, + const krb5_encrypt_block * eblock); +krb5_error_code KRB5_CALLCONV krb5_use_enctype + (krb5_context context, + krb5_encrypt_block * eblock, + krb5_enctype enctype); +size_t KRB5_CALLCONV krb5_encrypt_size + (size_t length, + krb5_enctype crypto); +size_t KRB5_CALLCONV krb5_checksum_size + (krb5_context context, + krb5_cksumtype ctype); +krb5_error_code KRB5_CALLCONV krb5_calculate_checksum + (krb5_context context, + krb5_cksumtype ctype, + krb5_const_pointer in, size_t in_length, + krb5_const_pointer seed, size_t seed_length, + krb5_checksum * outcksum); +krb5_error_code KRB5_CALLCONV krb5_verify_checksum + (krb5_context context, + krb5_cksumtype ctype, + const krb5_checksum * cksum, + krb5_const_pointer in, size_t in_length, + krb5_const_pointer seed, size_t seed_length); + +#if KRB5_PRIVATE +krb5_error_code KRB5_CALLCONV krb5_random_confounder + (size_t, krb5_pointer); + +krb5_error_code krb5_encrypt_data + (krb5_context context, krb5_keyblock *key, + krb5_pointer ivec, krb5_data *data, + krb5_enc_data *enc_data); + +krb5_error_code krb5_decrypt_data + (krb5_context context, krb5_keyblock *key, + krb5_pointer ivec, krb5_enc_data *data, + krb5_data *enc_data); +#endif + +#endif /* KRB5_OLD_CRYPTO */ + +/* + * end "encryption.h" + */ + +/* + * begin "fieldbits.h" + */ + +/* kdc_options for kdc_request */ +/* options is 32 bits; each host is responsible to put the 4 bytes + representing these bits into net order before transmission */ +/* #define KDC_OPT_RESERVED 0x80000000 */ +#define KDC_OPT_FORWARDABLE 0x40000000 +#define KDC_OPT_FORWARDED 0x20000000 +#define KDC_OPT_PROXIABLE 0x10000000 +#define KDC_OPT_PROXY 0x08000000 +#define KDC_OPT_ALLOW_POSTDATE 0x04000000 +#define KDC_OPT_POSTDATED 0x02000000 +/* #define KDC_OPT_UNUSED 0x01000000 */ +#define KDC_OPT_RENEWABLE 0x00800000 +/* #define KDC_OPT_UNUSED 0x00400000 */ +/* #define KDC_OPT_RESERVED 0x00200000 */ +/* #define KDC_OPT_RESERVED 0x00100000 */ +/* #define KDC_OPT_RESERVED 0x00080000 */ +/* #define KDC_OPT_RESERVED 0x00040000 */ +#define KDC_OPT_REQUEST_ANONYMOUS 0x00020000 +/* #define KDC_OPT_RESERVED 0x00010000 */ +/* #define KDC_OPT_RESERVED 0x00008000 */ +/* #define KDC_OPT_RESERVED 0x00004000 */ +/* #define KDC_OPT_RESERVED 0x00002000 */ +/* #define KDC_OPT_RESERVED 0x00001000 */ +/* #define KDC_OPT_RESERVED 0x00000800 */ +/* #define KDC_OPT_RESERVED 0x00000400 */ +/* #define KDC_OPT_RESERVED 0x00000200 */ +/* #define KDC_OPT_RESERVED 0x00000100 */ +/* #define KDC_OPT_RESERVED 0x00000080 */ +/* #define KDC_OPT_RESERVED 0x00000040 */ +#define KDC_OPT_DISABLE_TRANSITED_CHECK 0x00000020 +#define KDC_OPT_RENEWABLE_OK 0x00000010 +#define KDC_OPT_ENC_TKT_IN_SKEY 0x00000008 +/* #define KDC_OPT_UNUSED 0x00000004 */ +#define KDC_OPT_RENEW 0x00000002 +#define KDC_OPT_VALIDATE 0x00000001 + +/* + * Mask of ticket flags in the TGT which should be converted into KDC + * options when using the TGT to get derivitive tickets. + * + * New mask = KDC_OPT_FORWARDABLE | KDC_OPT_PROXIABLE | + * KDC_OPT_ALLOW_POSTDATE | KDC_OPT_RENEWABLE + */ +#define KDC_TKT_COMMON_MASK 0x54800000 + +/* definitions for ap_options fields */ +/* ap_options are 32 bits; each host is responsible to put the 4 bytes + representing these bits into net order before transmission */ +#define AP_OPTS_RESERVED 0x80000000 +#define AP_OPTS_USE_SESSION_KEY 0x40000000 +#define AP_OPTS_MUTUAL_REQUIRED 0x20000000 +/* #define AP_OPTS_RESERVED 0x10000000 */ +/* #define AP_OPTS_RESERVED 0x08000000 */ +/* #define AP_OPTS_RESERVED 0x04000000 */ +/* #define AP_OPTS_RESERVED 0x02000000 */ +/* #define AP_OPTS_RESERVED 0x01000000 */ +/* #define AP_OPTS_RESERVED 0x00800000 */ +/* #define AP_OPTS_RESERVED 0x00400000 */ +/* #define AP_OPTS_RESERVED 0x00200000 */ +/* #define AP_OPTS_RESERVED 0x00100000 */ +/* #define AP_OPTS_RESERVED 0x00080000 */ +/* #define AP_OPTS_RESERVED 0x00040000 */ +/* #define AP_OPTS_RESERVED 0x00020000 */ +/* #define AP_OPTS_RESERVED 0x00010000 */ +/* #define AP_OPTS_RESERVED 0x00008000 */ +/* #define AP_OPTS_RESERVED 0x00004000 */ +/* #define AP_OPTS_RESERVED 0x00002000 */ +/* #define AP_OPTS_RESERVED 0x00001000 */ +/* #define AP_OPTS_RESERVED 0x00000800 */ +/* #define AP_OPTS_RESERVED 0x00000400 */ +/* #define AP_OPTS_RESERVED 0x00000200 */ +/* #define AP_OPTS_RESERVED 0x00000100 */ +/* #define AP_OPTS_RESERVED 0x00000080 */ +/* #define AP_OPTS_RESERVED 0x00000040 */ +/* #define AP_OPTS_RESERVED 0x00000020 */ +/* #define AP_OPTS_RESERVED 0x00000010 */ +/* #define AP_OPTS_RESERVED 0x00000008 */ +/* #define AP_OPTS_RESERVED 0x00000004 */ +/* #define AP_OPTS_RESERVED 0x00000002 */ +#define AP_OPTS_USE_SUBKEY 0x00000001 + +#define AP_OPTS_WIRE_MASK 0xfffffff0 + +/* definitions for ad_type fields. */ +#define AD_TYPE_RESERVED 0x8000 +#define AD_TYPE_EXTERNAL 0x4000 +#define AD_TYPE_REGISTERED 0x2000 + +#define AD_TYPE_FIELD_TYPE_MASK 0x1fff + +/* Ticket flags */ +/* flags are 32 bits; each host is responsible to put the 4 bytes + representing these bits into net order before transmission */ +/* #define TKT_FLG_RESERVED 0x80000000 */ +#define TKT_FLG_FORWARDABLE 0x40000000 +#define TKT_FLG_FORWARDED 0x20000000 +#define TKT_FLG_PROXIABLE 0x10000000 +#define TKT_FLG_PROXY 0x08000000 +#define TKT_FLG_MAY_POSTDATE 0x04000000 +#define TKT_FLG_POSTDATED 0x02000000 +#define TKT_FLG_INVALID 0x01000000 +#define TKT_FLG_RENEWABLE 0x00800000 +#define TKT_FLG_INITIAL 0x00400000 +#define TKT_FLG_PRE_AUTH 0x00200000 +#define TKT_FLG_HW_AUTH 0x00100000 +#define TKT_FLG_TRANSIT_POLICY_CHECKED 0x00080000 +#define TKT_FLG_OK_AS_DELEGATE 0x00040000 +#define TKT_FLG_ANONYMOUS 0x00020000 +/* #define TKT_FLG_RESERVED 0x00010000 */ +/* #define TKT_FLG_RESERVED 0x00008000 */ +/* #define TKT_FLG_RESERVED 0x00004000 */ +/* #define TKT_FLG_RESERVED 0x00002000 */ +/* #define TKT_FLG_RESERVED 0x00001000 */ +/* #define TKT_FLG_RESERVED 0x00000800 */ +/* #define TKT_FLG_RESERVED 0x00000400 */ +/* #define TKT_FLG_RESERVED 0x00000200 */ +/* #define TKT_FLG_RESERVED 0x00000100 */ +/* #define TKT_FLG_RESERVED 0x00000080 */ +/* #define TKT_FLG_RESERVED 0x00000040 */ +/* #define TKT_FLG_RESERVED 0x00000020 */ +/* #define TKT_FLG_RESERVED 0x00000010 */ +/* #define TKT_FLG_RESERVED 0x00000008 */ +/* #define TKT_FLG_RESERVED 0x00000004 */ +/* #define TKT_FLG_RESERVED 0x00000002 */ +/* #define TKT_FLG_RESERVED 0x00000001 */ + +/* definitions for lr_type fields. */ +#define LR_TYPE_THIS_SERVER_ONLY 0x8000 + +#define LR_TYPE_INTERPRETATION_MASK 0x7fff + +/* definitions for ad_type fields. */ +#define AD_TYPE_EXTERNAL 0x4000 +#define AD_TYPE_REGISTERED 0x2000 + +#define AD_TYPE_FIELD_TYPE_MASK 0x1fff +#define AD_TYPE_INTERNAL_MASK 0x3fff + +/* definitions for msec direction bit for KRB_SAFE, KRB_PRIV */ +#define MSEC_DIRBIT 0x8000 +#define MSEC_VAL_MASK 0x7fff + +/* + * end "fieldbits.h" + */ + +/* + * begin "proto.h" + */ + +/* Protocol version number */ +#define KRB5_PVNO 5 + +/* Message types */ + +#define KRB5_AS_REQ ((krb5_msgtype)10) /* Req for initial authentication */ +#define KRB5_AS_REP ((krb5_msgtype)11) /* Response to KRB_AS_REQ request */ +#define KRB5_TGS_REQ ((krb5_msgtype)12) /* TGS request to server */ +#define KRB5_TGS_REP ((krb5_msgtype)13) /* Response to KRB_TGS_REQ req */ +#define KRB5_AP_REQ ((krb5_msgtype)14) /* application request to server */ +#define KRB5_AP_REP ((krb5_msgtype)15) /* Response to KRB_AP_REQ_MUTUAL */ +#define KRB5_SAFE ((krb5_msgtype)20) /* Safe application message */ +#define KRB5_PRIV ((krb5_msgtype)21) /* Private application message */ +#define KRB5_CRED ((krb5_msgtype)22) /* Credential forwarding message */ +#define KRB5_ERROR ((krb5_msgtype)30) /* Error response */ + +/* LastReq types */ +#define KRB5_LRQ_NONE 0 +#define KRB5_LRQ_ALL_LAST_TGT 1 +#define KRB5_LRQ_ONE_LAST_TGT (-1) +#define KRB5_LRQ_ALL_LAST_INITIAL 2 +#define KRB5_LRQ_ONE_LAST_INITIAL (-2) +#define KRB5_LRQ_ALL_LAST_TGT_ISSUED 3 +#define KRB5_LRQ_ONE_LAST_TGT_ISSUED (-3) +#define KRB5_LRQ_ALL_LAST_RENEWAL 4 +#define KRB5_LRQ_ONE_LAST_RENEWAL (-4) +#define KRB5_LRQ_ALL_LAST_REQ 5 +#define KRB5_LRQ_ONE_LAST_REQ (-5) +#define KRB5_LRQ_ALL_PW_EXPTIME 6 +#define KRB5_LRQ_ONE_PW_EXPTIME (-6) + +/* PADATA types */ +#define KRB5_PADATA_NONE 0 +#define KRB5_PADATA_AP_REQ 1 +#define KRB5_PADATA_TGS_REQ KRB5_PADATA_AP_REQ +#define KRB5_PADATA_ENC_TIMESTAMP 2 +#define KRB5_PADATA_PW_SALT 3 +#if 0 /* Not used */ +#define KRB5_PADATA_ENC_ENCKEY 4 /* Key encrypted within itself */ +#endif +#define KRB5_PADATA_ENC_UNIX_TIME 5 /* timestamp encrypted in key */ +#define KRB5_PADATA_ENC_SANDIA_SECURID 6 /* SecurId passcode */ +#define KRB5_PADATA_SESAME 7 /* Sesame project */ +#define KRB5_PADATA_OSF_DCE 8 /* OSF DCE */ +#define KRB5_CYBERSAFE_SECUREID 9 /* Cybersafe */ +#define KRB5_PADATA_AFS3_SALT 10 /* Cygnus */ +#define KRB5_PADATA_ETYPE_INFO 11 /* Etype info for preauth */ +#define KRB5_PADATA_SAM_CHALLENGE 12 /* draft challenge system */ +#define KRB5_PADATA_SAM_RESPONSE 13 /* draft challenge system response */ +#define KRB5_PADATA_PK_AS_REQ 14 /* PKINIT */ +#define KRB5_PADATA_PK_AS_REP 15 /* PKINIT */ +#define KRB5_PADATA_ETYPE_INFO2 19 +#define KRB5_PADATA_SAM_CHALLENGE_2 30 /* draft challenge system, updated */ +#define KRB5_PADATA_SAM_RESPONSE_2 31 /* draft challenge system, updated */ + +#define KRB5_SAM_USE_SAD_AS_KEY 0x80000000 +#define KRB5_SAM_SEND_ENCRYPTED_SAD 0x40000000 +#define KRB5_SAM_MUST_PK_ENCRYPT_SAD 0x20000000 /* currently must be zero */ + +/* Reserved for SPX pre-authentication. */ +#define KRB5_PADATA_DASS 16 + +/* Transited encoding types */ +#define KRB5_DOMAIN_X500_COMPRESS 1 + +/* alternate authentication types */ +#define KRB5_ALTAUTH_ATT_CHALLENGE_RESPONSE 64 + +/* authorization data types */ +#define KRB5_AUTHDATA_OSF_DCE 64 +#define KRB5_AUTHDATA_SESAME 65 + +/* password change constants */ + +#define KRB5_KPASSWD_SUCCESS 0 +#define KRB5_KPASSWD_MALFORMED 1 +#define KRB5_KPASSWD_HARDERROR 2 +#define KRB5_KPASSWD_AUTHERROR 3 +#define KRB5_KPASSWD_SOFTERROR 4 +/* These are Microsoft's extensions in RFC 3244, and it looks like + they'll become standardized, possibly with other additions. */ +#define KRB5_KPASSWD_ACCESSDENIED 5 /* unused */ +#define KRB5_KPASSWD_BAD_VERSION 6 +#define KRB5_KPASSWD_INITIAL_FLAG_NEEDED 7 /* unused */ + +/* + * end "proto.h" + */ + +/* Time set */ +typedef struct _krb5_ticket_times { + krb5_timestamp authtime; /* XXX ? should ktime in KDC_REP == authtime + in ticket? otherwise client can't get this */ + krb5_timestamp starttime; /* optional in ticket, if not present, + use authtime */ + krb5_timestamp endtime; + krb5_timestamp renew_till; +} krb5_ticket_times; + +/* structure for auth data */ +typedef struct _krb5_authdata { + krb5_magic magic; + krb5_authdatatype ad_type; + unsigned int length; + krb5_octet *contents; +} krb5_authdata; + +/* structure for transited encoding */ +typedef struct _krb5_transited { + krb5_magic magic; + krb5_octet tr_type; + krb5_data tr_contents; +} krb5_transited; + +typedef struct _krb5_enc_tkt_part { + krb5_magic magic; + /* to-be-encrypted portion */ + krb5_flags flags; /* flags */ + krb5_keyblock *session; /* session key: includes enctype */ + krb5_principal client; /* client name/realm */ + krb5_transited transited; /* list of transited realms */ + krb5_ticket_times times; /* auth, start, end, renew_till */ + krb5_address **caddrs; /* array of ptrs to addresses */ + krb5_authdata **authorization_data; /* auth data */ +} krb5_enc_tkt_part; + +typedef struct _krb5_ticket { + krb5_magic magic; + /* cleartext portion */ + krb5_principal server; /* server name/realm */ + krb5_enc_data enc_part; /* encryption type, kvno, encrypted + encoding */ + krb5_enc_tkt_part *enc_part2; /* ptr to decrypted version, if + available */ +} krb5_ticket; + +/* the unencrypted version */ +typedef struct _krb5_authenticator { + krb5_magic magic; + krb5_principal client; /* client name/realm */ + krb5_checksum *checksum; /* checksum, includes type, optional */ + krb5_int32 cusec; /* client usec portion */ + krb5_timestamp ctime; /* client sec portion */ + krb5_keyblock *subkey; /* true session key, optional */ + krb5_ui_4 seq_number; /* sequence #, optional */ + krb5_authdata **authorization_data; /* New add by Ari, auth data */ +} krb5_authenticator; + +typedef struct _krb5_tkt_authent { + krb5_magic magic; + krb5_ticket *ticket; + krb5_authenticator *authenticator; + krb5_flags ap_options; +} krb5_tkt_authent; + +/* credentials: Ticket, session key, etc. */ +typedef struct _krb5_creds { + krb5_magic magic; + krb5_principal client; /* client's principal identifier */ + krb5_principal server; /* server's principal identifier */ + krb5_keyblock keyblock; /* session encryption key info */ + krb5_ticket_times times; /* lifetime info */ + krb5_boolean is_skey; /* true if ticket is encrypted in + another ticket's skey */ + krb5_flags ticket_flags; /* flags in ticket */ + krb5_address **addresses; /* addrs in ticket */ + krb5_data ticket; /* ticket string itself */ + krb5_data second_ticket; /* second ticket, if related to + ticket (via DUPLICATE-SKEY or + ENC-TKT-IN-SKEY) */ + krb5_authdata **authdata; /* authorization data */ +} krb5_creds; + +/* Last request fields */ +typedef struct _krb5_last_req_entry { + krb5_magic magic; + krb5_int32 lr_type; + krb5_timestamp value; +} krb5_last_req_entry; + +/* pre-authentication data */ +typedef struct _krb5_pa_data { + krb5_magic magic; + krb5_preauthtype pa_type; + unsigned int length; + krb5_octet *contents; +} krb5_pa_data; + +typedef struct _krb5_kdc_req { + krb5_magic magic; + krb5_msgtype msg_type; /* AS_REQ or TGS_REQ? */ + krb5_pa_data **padata; /* e.g. encoded AP_REQ */ + /* real body */ + krb5_flags kdc_options; /* requested options */ + krb5_principal client; /* includes realm; optional */ + krb5_principal server; /* includes realm (only used if no + client) */ + krb5_timestamp from; /* requested starttime */ + krb5_timestamp till; /* requested endtime */ + krb5_timestamp rtime; /* (optional) requested renew_till */ + krb5_int32 nonce; /* nonce to match request/response */ + int nktypes; /* # of ktypes, must be positive */ + krb5_enctype *ktype; /* requested enctype(s) */ + krb5_address **addresses; /* requested addresses, optional */ + krb5_enc_data authorization_data; /* encrypted auth data; OPTIONAL */ + krb5_authdata **unenc_authdata; /* unencrypted auth data, + if available */ + krb5_ticket **second_ticket;/* second ticket array; OPTIONAL */ +} krb5_kdc_req; + +typedef struct _krb5_enc_kdc_rep_part { + krb5_magic magic; + /* encrypted part: */ + krb5_msgtype msg_type; /* krb5 message type */ + krb5_keyblock *session; /* session key */ + krb5_last_req_entry **last_req; /* array of ptrs to entries */ + krb5_int32 nonce; /* nonce from request */ + krb5_timestamp key_exp; /* expiration date */ + krb5_flags flags; /* ticket flags */ + krb5_ticket_times times; /* lifetime info */ + krb5_principal server; /* server's principal identifier */ + krb5_address **caddrs; /* array of ptrs to addresses, + optional */ +} krb5_enc_kdc_rep_part; + +typedef struct _krb5_kdc_rep { + krb5_magic magic; + /* cleartext part: */ + krb5_msgtype msg_type; /* AS_REP or KDC_REP? */ + krb5_pa_data **padata; /* preauthentication data from KDC */ + krb5_principal client; /* client's principal identifier */ + krb5_ticket *ticket; /* ticket */ + krb5_enc_data enc_part; /* encryption type, kvno, encrypted + encoding */ + krb5_enc_kdc_rep_part *enc_part2;/* unencrypted version, if available */ +} krb5_kdc_rep; + +/* error message structure */ +typedef struct _krb5_error { + krb5_magic magic; + /* some of these may be meaningless in certain contexts */ + krb5_timestamp ctime; /* client sec portion; optional */ + krb5_int32 cusec; /* client usec portion; optional */ + krb5_int32 susec; /* server usec portion */ + krb5_timestamp stime; /* server sec portion */ + krb5_ui_4 error; /* error code (protocol error #'s) */ + krb5_principal client; /* client's principal identifier; + optional */ + krb5_principal server; /* server's principal identifier */ + krb5_data text; /* descriptive text */ + krb5_data e_data; /* additional error-describing data */ +} krb5_error; + +typedef struct _krb5_ap_req { + krb5_magic magic; + krb5_flags ap_options; /* requested options */ + krb5_ticket *ticket; /* ticket */ + krb5_enc_data authenticator; /* authenticator (already encrypted) */ +} krb5_ap_req; + +typedef struct _krb5_ap_rep { + krb5_magic magic; + krb5_enc_data enc_part; +} krb5_ap_rep; + +typedef struct _krb5_ap_rep_enc_part { + krb5_magic magic; + krb5_timestamp ctime; /* client time, seconds portion */ + krb5_int32 cusec; /* client time, microseconds portion */ + krb5_keyblock *subkey; /* true session key, optional */ + krb5_ui_4 seq_number; /* sequence #, optional */ +} krb5_ap_rep_enc_part; + +typedef struct _krb5_response { + krb5_magic magic; + krb5_octet message_type; + krb5_data response; + krb5_int32 expected_nonce; /* The expected nonce for KDC_REP messages */ + krb5_timestamp request_time; /* When we made the request */ +} krb5_response; + +typedef struct _krb5_cred_info { + krb5_magic magic; + krb5_keyblock *session; /* session key used to encrypt */ + /* ticket */ + krb5_principal client; /* client name/realm, optional */ + krb5_principal server; /* server name/realm, optional */ + krb5_flags flags; /* ticket flags, optional */ + krb5_ticket_times times; /* auth, start, end, renew_till, */ + /* optional */ + krb5_address **caddrs; /* array of ptrs to addresses */ +} krb5_cred_info; + +typedef struct _krb5_cred_enc_part { + krb5_magic magic; + krb5_int32 nonce; /* nonce, optional */ + krb5_timestamp timestamp; /* client time */ + krb5_int32 usec; /* microsecond portion of time */ + krb5_address *s_address; /* sender address, optional */ + krb5_address *r_address; /* recipient address, optional */ + krb5_cred_info **ticket_info; +} krb5_cred_enc_part; + +typedef struct _krb5_cred { + krb5_magic magic; + krb5_ticket **tickets; /* tickets */ + krb5_enc_data enc_part; /* encrypted part */ + krb5_cred_enc_part *enc_part2; /* unencrypted version, if available*/ +} krb5_cred; + +/* Sandia password generation structures */ +typedef struct _passwd_phrase_element { + krb5_magic magic; + krb5_data *passwd; + krb5_data *phrase; +} passwd_phrase_element; + +typedef struct _krb5_pwd_data { + krb5_magic magic; + int sequence_count; + passwd_phrase_element **element; +} krb5_pwd_data; + +/* these need to be here so the typedefs are available for the prototypes */ + +/* + * begin "safepriv.h" + */ + +#define KRB5_AUTH_CONTEXT_DO_TIME 0x00000001 +#define KRB5_AUTH_CONTEXT_RET_TIME 0x00000002 +#define KRB5_AUTH_CONTEXT_DO_SEQUENCE 0x00000004 +#define KRB5_AUTH_CONTEXT_RET_SEQUENCE 0x00000008 +#define KRB5_AUTH_CONTEXT_PERMIT_ALL 0x00000010 +#define KRB5_AUTH_CONTEXT_USE_SUBKEY 0x00000020 + +typedef struct krb5_replay_data { + krb5_timestamp timestamp; + krb5_int32 usec; + krb5_ui_4 seq; +} krb5_replay_data; + +/* flags for krb5_auth_con_genaddrs() */ +#define KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR 0x00000001 +#define KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR 0x00000002 +#define KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR 0x00000004 +#define KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR 0x00000008 + +/* type of function used as a callback to generate checksum data for + * mk_req */ + +typedef krb5_error_code +(KRB5_CALLCONV * krb5_mk_req_checksum_func) (krb5_context, krb5_auth_context , void *, + krb5_data **); + +/* + * end "safepriv.h" + */ + + +/* + * begin "ccache.h" + */ + +typedef krb5_pointer krb5_cc_cursor; /* cursor for sequential lookup */ + +struct _krb5_ccache; +typedef struct _krb5_ccache *krb5_ccache; +struct _krb5_cc_ops; +typedef struct _krb5_cc_ops krb5_cc_ops; + +/* for retrieve_cred */ +#define KRB5_TC_MATCH_TIMES 0x00000001 +#define KRB5_TC_MATCH_IS_SKEY 0x00000002 +#define KRB5_TC_MATCH_FLAGS 0x00000004 +#define KRB5_TC_MATCH_TIMES_EXACT 0x00000008 +#define KRB5_TC_MATCH_FLAGS_EXACT 0x00000010 +#define KRB5_TC_MATCH_AUTHDATA 0x00000020 +#define KRB5_TC_MATCH_SRV_NAMEONLY 0x00000040 +#define KRB5_TC_MATCH_2ND_TKT 0x00000080 +#define KRB5_TC_MATCH_KTYPE 0x00000100 +#define KRB5_TC_SUPPORTED_KTYPES 0x00000200 + +/* for set_flags and other functions */ +#define KRB5_TC_OPENCLOSE 0x00000001 + +const char * KRB5_CALLCONV +krb5_cc_get_name (krb5_context context, krb5_ccache cache); + +krb5_error_code KRB5_CALLCONV +krb5_cc_gen_new (krb5_context context, krb5_ccache *cache); + +krb5_error_code KRB5_CALLCONV +krb5_cc_initialize(krb5_context context, krb5_ccache cache, + krb5_principal principal); + +krb5_error_code KRB5_CALLCONV +krb5_cc_destroy (krb5_context context, krb5_ccache cache); + +krb5_error_code KRB5_CALLCONV +krb5_cc_close (krb5_context context, krb5_ccache cache); + +krb5_error_code KRB5_CALLCONV +krb5_cc_store_cred (krb5_context context, krb5_ccache cache, + krb5_creds *creds); + +krb5_error_code KRB5_CALLCONV +krb5_cc_retrieve_cred (krb5_context context, krb5_ccache cache, + krb5_flags flags, krb5_creds *mcreds, + krb5_creds *creds); + +krb5_error_code KRB5_CALLCONV +krb5_cc_get_principal (krb5_context context, krb5_ccache cache, + krb5_principal *principal); + +krb5_error_code KRB5_CALLCONV +krb5_cc_start_seq_get (krb5_context context, krb5_ccache cache, + krb5_cc_cursor *cursor); + +krb5_error_code KRB5_CALLCONV +krb5_cc_next_cred (krb5_context context, krb5_ccache cache, + krb5_cc_cursor *cursor, krb5_creds *creds); + +krb5_error_code KRB5_CALLCONV +krb5_cc_end_seq_get (krb5_context context, krb5_ccache cache, + krb5_cc_cursor *cursor); + +krb5_error_code KRB5_CALLCONV +krb5_cc_remove_cred (krb5_context context, krb5_ccache cache, krb5_flags flags, + krb5_creds *creds); + +krb5_error_code KRB5_CALLCONV +krb5_cc_set_flags (krb5_context context, krb5_ccache cache, krb5_flags flags); + +const char * KRB5_CALLCONV +krb5_cc_get_type (krb5_context context, krb5_ccache cache); + +/* + * end "ccache.h" + */ + +/* + * begin "rcache.h" + */ + +struct krb5_rc_st; +typedef struct krb5_rc_st *krb5_rcache; + +#if KRB5_PRIVATE +typedef struct _krb5_donot_replay { + krb5_magic magic; + char *server; /* null-terminated */ + char *client; /* null-terminated */ + krb5_int32 cusec; + krb5_timestamp ctime; +} krb5_donot_replay; + +krb5_error_code krb5_rc_default + (krb5_context, + krb5_rcache *); +krb5_error_code krb5_rc_resolve_type + (krb5_context, + krb5_rcache *,char *); +krb5_error_code krb5_rc_resolve_full + (krb5_context, + krb5_rcache *,char *); +char * krb5_rc_get_type + (krb5_context, + krb5_rcache); +char * krb5_rc_default_type + (krb5_context); +char * krb5_rc_default_name + (krb5_context); +krb5_error_code krb5_auth_to_rep + (krb5_context, + krb5_tkt_authent *, + krb5_donot_replay *); + + +krb5_error_code KRB5_CALLCONV krb5_rc_initialize + (krb5_context, krb5_rcache,krb5_deltat); +krb5_error_code KRB5_CALLCONV krb5_rc_recover + (krb5_context, krb5_rcache); +krb5_error_code KRB5_CALLCONV krb5_rc_destroy + (krb5_context, krb5_rcache); +krb5_error_code KRB5_CALLCONV krb5_rc_close + (krb5_context, krb5_rcache); +krb5_error_code KRB5_CALLCONV krb5_rc_store + (krb5_context, krb5_rcache,krb5_donot_replay *); +krb5_error_code KRB5_CALLCONV krb5_rc_expunge + (krb5_context, krb5_rcache); +krb5_error_code KRB5_CALLCONV krb5_rc_get_lifespan + (krb5_context, krb5_rcache,krb5_deltat *); +char *KRB5_CALLCONV krb5_rc_get_name + (krb5_context, krb5_rcache); +krb5_error_code KRB5_CALLCONV krb5_rc_resolve + (krb5_context, krb5_rcache, char *); +#endif /* KRB5_PRIVATE */ +/* + * end "rcache.h" + */ + +/* + * begin "keytab.h" + */ + + +/* XXX */ +#define MAX_KEYTAB_NAME_LEN 1100 /* Long enough for MAXPATHLEN + some extra */ + +typedef krb5_pointer krb5_kt_cursor; /* XXX */ + +typedef struct krb5_keytab_entry_st { + krb5_magic magic; + krb5_principal principal; /* principal of this key */ + krb5_timestamp timestamp; /* time entry written to keytable */ + krb5_kvno vno; /* key version number */ + krb5_keyblock key; /* the secret key */ +} krb5_keytab_entry; + +#if KRB5_PRIVATE +struct _krb5_kt_ops; +typedef struct _krb5_kt { /* should move into k5-int.h */ + krb5_magic magic; + const struct _krb5_kt_ops *ops; + krb5_pointer data; +} *krb5_keytab; +#else +struct _krb5_kt; +typedef struct _krb5_kt *krb5_keytab; +#endif + +char * KRB5_CALLCONV +krb5_kt_get_type (krb5_context, krb5_keytab keytab); +krb5_error_code KRB5_CALLCONV +krb5_kt_get_name(krb5_context context, krb5_keytab keytab, char *name, + unsigned int namelen); +krb5_error_code KRB5_CALLCONV +krb5_kt_close(krb5_context context, krb5_keytab keytab); +krb5_error_code KRB5_CALLCONV +krb5_kt_get_entry(krb5_context context, krb5_keytab keytab, + krb5_const_principal principal, krb5_kvno vno, + krb5_enctype enctype, krb5_keytab_entry *entry); +krb5_error_code KRB5_CALLCONV +krb5_kt_start_seq_get(krb5_context context, krb5_keytab keytab, + krb5_kt_cursor *cursor); +krb5_error_code KRB5_CALLCONV +krb5_kt_next_entry(krb5_context context, krb5_keytab keytab, + krb5_keytab_entry *entry, krb5_kt_cursor *cursor); +krb5_error_code KRB5_CALLCONV +krb5_kt_end_seq_get(krb5_context context, krb5_keytab keytab, + krb5_kt_cursor *cursor); + +/* + * end "keytab.h" + */ + +/* + * begin "func-proto.h" + */ + +krb5_error_code KRB5_CALLCONV krb5_init_context + (krb5_context *); +krb5_error_code KRB5_CALLCONV krb5_init_secure_context + (krb5_context *); +void KRB5_CALLCONV krb5_free_context + (krb5_context); + +#if KRB5_PRIVATE +krb5_error_code krb5_set_default_in_tkt_ktypes + (krb5_context, + const krb5_enctype *); +krb5_error_code krb5_get_default_in_tkt_ktypes + (krb5_context, + krb5_enctype **); + +krb5_error_code krb5_set_default_tgs_ktypes + (krb5_context, + const krb5_enctype *); +#endif + +krb5_error_code KRB5_CALLCONV +krb5_set_default_tgs_enctypes + (krb5_context, + const krb5_enctype *); +#if KRB5_PRIVATE +krb5_error_code KRB5_CALLCONV krb5_get_tgs_ktypes + (krb5_context, + krb5_const_principal, + krb5_enctype **); +#endif + +krb5_error_code KRB5_CALLCONV krb5_get_permitted_enctypes + (krb5_context, krb5_enctype **); + +#if KRB5_PRIVATE +void KRB5_CALLCONV krb5_free_ktypes + (krb5_context, krb5_enctype *); + +krb5_boolean krb5_is_permitted_enctype + (krb5_context, krb5_enctype); +#endif + +/* libkrb.spec */ +#if KRB5_PRIVATE +krb5_error_code krb5_kdc_rep_decrypt_proc + (krb5_context, + const krb5_keyblock *, + krb5_const_pointer, + krb5_kdc_rep * ); +krb5_error_code KRB5_CALLCONV krb5_decrypt_tkt_part + (krb5_context, + const krb5_keyblock *, + krb5_ticket * ); +krb5_error_code krb5_get_cred_from_kdc + (krb5_context, + krb5_ccache, /* not const, as reading may save + state */ + krb5_creds *, + krb5_creds **, + krb5_creds *** ); +krb5_error_code krb5_get_cred_from_kdc_validate + (krb5_context, + krb5_ccache, /* not const, as reading may save + state */ + krb5_creds *, + krb5_creds **, + krb5_creds *** ); +krb5_error_code krb5_get_cred_from_kdc_renew + (krb5_context, + krb5_ccache, /* not const, as reading may save + state */ + krb5_creds *, + krb5_creds **, + krb5_creds *** ); +#endif + +void KRB5_CALLCONV krb5_free_tgt_creds + (krb5_context, + krb5_creds **); /* XXX too hard to do with const */ + +#define KRB5_GC_USER_USER 1 /* want user-user ticket */ +#define KRB5_GC_CACHED 2 /* want cached ticket only */ + +krb5_error_code KRB5_CALLCONV krb5_get_credentials + (krb5_context, + krb5_flags, + krb5_ccache, + krb5_creds *, + krb5_creds **); +krb5_error_code KRB5_CALLCONV krb5_get_credentials_validate + (krb5_context, + krb5_flags, + krb5_ccache, + krb5_creds *, + krb5_creds **); +krb5_error_code KRB5_CALLCONV krb5_get_credentials_renew + (krb5_context, + krb5_flags, + krb5_ccache, + krb5_creds *, + krb5_creds **); +#if KRB5_PRIVATE +krb5_error_code krb5_get_cred_via_tkt + (krb5_context, + krb5_creds *, + krb5_flags, + krb5_address * const *, + krb5_creds *, + krb5_creds **); +#endif +krb5_error_code KRB5_CALLCONV krb5_mk_req + (krb5_context, + krb5_auth_context *, + krb5_flags, + char *, + char *, + krb5_data *, + krb5_ccache, + krb5_data * ); +krb5_error_code KRB5_CALLCONV krb5_mk_req_extended + (krb5_context, + krb5_auth_context *, + krb5_flags, + krb5_data *, + krb5_creds *, + krb5_data * ); +krb5_error_code KRB5_CALLCONV krb5_mk_rep + (krb5_context, + krb5_auth_context, + krb5_data *); +krb5_error_code KRB5_CALLCONV krb5_rd_rep + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_ap_rep_enc_part **); +krb5_error_code KRB5_CALLCONV krb5_mk_error + (krb5_context, + const krb5_error *, + krb5_data * ); +krb5_error_code KRB5_CALLCONV krb5_rd_error + (krb5_context, + const krb5_data *, + krb5_error ** ); +krb5_error_code KRB5_CALLCONV krb5_rd_safe + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_data *, + krb5_replay_data *); +krb5_error_code KRB5_CALLCONV krb5_rd_priv + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_data *, + krb5_replay_data *); +krb5_error_code KRB5_CALLCONV krb5_parse_name + (krb5_context, + const char *, + krb5_principal * ); +krb5_error_code KRB5_CALLCONV krb5_unparse_name + (krb5_context, + krb5_const_principal, + char ** ); +krb5_error_code KRB5_CALLCONV krb5_unparse_name_ext + (krb5_context, + krb5_const_principal, + char **, + unsigned int *); + +krb5_error_code KRB5_CALLCONV krb5_set_principal_realm + (krb5_context, krb5_principal, const char *); + +krb5_boolean KRB5_CALLCONV_WRONG krb5_address_search + (krb5_context, + const krb5_address *, + krb5_address * const *); +krb5_boolean KRB5_CALLCONV krb5_address_compare + (krb5_context, + const krb5_address *, + const krb5_address *); +int KRB5_CALLCONV krb5_address_order + (krb5_context, + const krb5_address *, + const krb5_address *); +krb5_boolean KRB5_CALLCONV krb5_realm_compare + (krb5_context, + krb5_const_principal, + krb5_const_principal); +krb5_boolean KRB5_CALLCONV krb5_principal_compare + (krb5_context, + krb5_const_principal, + krb5_const_principal); +krb5_error_code KRB5_CALLCONV krb5_init_keyblock + (krb5_context, krb5_enctype enctype, + size_t length, krb5_keyblock **out); + /* Initialize a new keyblock and allocate storage + * for the contents of the key, which will be freed along + * with the keyblock when krb5_free_keyblock is called. + * It is legal to pass in a length of 0, in which + * case contents are left unallocated. + */ +krb5_error_code KRB5_CALLCONV krb5_copy_keyblock + (krb5_context, + const krb5_keyblock *, + krb5_keyblock **); +krb5_error_code KRB5_CALLCONV krb5_copy_keyblock_contents + (krb5_context, + const krb5_keyblock *, + krb5_keyblock *); +krb5_error_code KRB5_CALLCONV krb5_copy_creds + (krb5_context, + const krb5_creds *, + krb5_creds **); +krb5_error_code KRB5_CALLCONV krb5_copy_data + (krb5_context, + const krb5_data *, + krb5_data **); +krb5_error_code KRB5_CALLCONV krb5_copy_principal + (krb5_context, + krb5_const_principal, + krb5_principal *); +#if KRB5_PRIVATE +krb5_error_code KRB5_CALLCONV krb5_copy_addr + (krb5_context, + const krb5_address *, + krb5_address **); +#endif +krb5_error_code KRB5_CALLCONV krb5_copy_addresses + (krb5_context, + krb5_address * const *, + krb5_address ***); +krb5_error_code KRB5_CALLCONV krb5_copy_ticket + (krb5_context, + const krb5_ticket *, + krb5_ticket **); +krb5_error_code KRB5_CALLCONV krb5_copy_authdata + (krb5_context, + krb5_authdata * const *, + krb5_authdata ***); +krb5_error_code KRB5_CALLCONV krb5_copy_authenticator + (krb5_context, + const krb5_authenticator *, + krb5_authenticator **); +krb5_error_code KRB5_CALLCONV krb5_copy_checksum + (krb5_context, + const krb5_checksum *, + krb5_checksum **); +#if KRB5_PRIVATE +void krb5_init_ets + (krb5_context); +void krb5_free_ets + (krb5_context); +krb5_error_code krb5_generate_subkey + (krb5_context, + const krb5_keyblock *, krb5_keyblock **); +krb5_error_code krb5_generate_seq_number + (krb5_context, + const krb5_keyblock *, krb5_ui_4 *); +#endif +krb5_error_code KRB5_CALLCONV krb5_get_server_rcache + (krb5_context, + const krb5_data *, krb5_rcache *); +krb5_error_code KRB5_CALLCONV_C krb5_build_principal_ext + (krb5_context, krb5_principal *, unsigned int, const char *, ...); +krb5_error_code KRB5_CALLCONV_C krb5_build_principal + (krb5_context, krb5_principal *, unsigned int, const char *, ...); +#ifdef va_start +/* XXX depending on varargs include file defining va_start... */ +krb5_error_code KRB5_CALLCONV krb5_build_principal_va + (krb5_context, + krb5_principal, unsigned int, const char *, va_list); +#endif + +krb5_error_code KRB5_CALLCONV krb5_425_conv_principal + (krb5_context, + const char *name, + const char *instance, const char *realm, + krb5_principal *princ); + +krb5_error_code KRB5_CALLCONV krb5_524_conv_principal + (krb5_context context, krb5_const_principal princ, + char *name, char *inst, char *realm); + +struct credentials; +int KRB5_CALLCONV krb5_524_convert_creds + (krb5_context context, krb5_creds *v5creds, + struct credentials *v4creds); +#if KRB5_DEPRECATED +#define krb524_convert_creds_kdc krb5_524_convert_creds +#define krb524_init_ets(x) (0) +#endif + +/* libkt.spec */ +#if KRB5_PRIVATE +krb5_error_code KRB5_CALLCONV krb5_kt_register + (krb5_context, + struct _krb5_kt_ops * ); +#endif + +krb5_error_code KRB5_CALLCONV krb5_kt_resolve + (krb5_context, + const char *, + krb5_keytab * ); +krb5_error_code KRB5_CALLCONV krb5_kt_default_name + (krb5_context, + char *, + int ); +krb5_error_code KRB5_CALLCONV krb5_kt_default + (krb5_context, + krb5_keytab * ); +krb5_error_code KRB5_CALLCONV krb5_free_keytab_entry_contents + (krb5_context, + krb5_keytab_entry * ); +#if KRB5_PRIVATE +/* use krb5_free_keytab_entry_contents instead */ +krb5_error_code KRB5_CALLCONV krb5_kt_free_entry + (krb5_context, + krb5_keytab_entry * ); +#endif +/* remove and add are functions, so that they can return NOWRITE + if not a writable keytab */ +krb5_error_code KRB5_CALLCONV krb5_kt_remove_entry + (krb5_context, + krb5_keytab, + krb5_keytab_entry * ); +krb5_error_code KRB5_CALLCONV krb5_kt_add_entry + (krb5_context, + krb5_keytab, + krb5_keytab_entry * ); +krb5_error_code krb5_principal2salt + (krb5_context, + krb5_const_principal, krb5_data *); +#if KRB5_PRIVATE +krb5_error_code krb5_principal2salt_norealm + (krb5_context, + krb5_const_principal, krb5_data *); +#endif +/* librc.spec--see rcache.h */ + +/* libcc.spec */ +krb5_error_code KRB5_CALLCONV krb5_cc_resolve + (krb5_context, + const char *, + krb5_ccache * ); +const char * KRB5_CALLCONV krb5_cc_default_name + (krb5_context); +krb5_error_code KRB5_CALLCONV krb5_cc_set_default_name + (krb5_context, const char *); +krb5_error_code KRB5_CALLCONV krb5_cc_default + (krb5_context, + krb5_ccache *); +#if KRB5_PRIVATE +unsigned int KRB5_CALLCONV krb5_get_notification_message + (void); +#endif + +krb5_error_code KRB5_CALLCONV krb5_cc_copy_creds + (krb5_context context, + krb5_ccache incc, + krb5_ccache outcc); + + +/* chk_trans.c */ +#if KRB5_PRIVATE +krb5_error_code krb5_check_transited_list + (krb5_context, const krb5_data *trans, + const krb5_data *realm1, const krb5_data *realm2); +#endif + +/* free_rtree.c */ +#if KRB5_PRIVATE +void krb5_free_realm_tree + (krb5_context, + krb5_principal *); +#endif + +/* krb5_free.c */ +void KRB5_CALLCONV krb5_free_principal + (krb5_context, krb5_principal ); +void KRB5_CALLCONV krb5_free_authenticator + (krb5_context, krb5_authenticator * ); +#if KRB5_PRIVATE +void KRB5_CALLCONV krb5_free_authenticator_contents + (krb5_context, krb5_authenticator * ); +#endif +void KRB5_CALLCONV krb5_free_addresses + (krb5_context, krb5_address ** ); +#if KRB5_PRIVATE +void KRB5_CALLCONV krb5_free_address + (krb5_context, krb5_address * ); +#endif +void KRB5_CALLCONV krb5_free_authdata + (krb5_context, krb5_authdata ** ); +#if KRB5_PRIVATE +void KRB5_CALLCONV krb5_free_enc_tkt_part + (krb5_context, krb5_enc_tkt_part * ); +#endif +void KRB5_CALLCONV krb5_free_ticket + (krb5_context, krb5_ticket * ); +#if KRB5_PRIVATE +void KRB5_CALLCONV krb5_free_tickets + (krb5_context, krb5_ticket ** ); +void KRB5_CALLCONV krb5_free_kdc_req + (krb5_context, krb5_kdc_req * ); +void KRB5_CALLCONV krb5_free_kdc_rep + (krb5_context, krb5_kdc_rep * ); +void KRB5_CALLCONV krb5_free_last_req + (krb5_context, krb5_last_req_entry ** ); +void KRB5_CALLCONV krb5_free_enc_kdc_rep_part + (krb5_context, krb5_enc_kdc_rep_part * ); +#endif +void KRB5_CALLCONV krb5_free_error + (krb5_context, krb5_error * ); +#if KRB5_PRIVATE +void KRB5_CALLCONV krb5_free_ap_req + (krb5_context, krb5_ap_req * ); +void KRB5_CALLCONV krb5_free_ap_rep + (krb5_context, krb5_ap_rep * ); +void KRB5_CALLCONV krb5_free_cred + (krb5_context, krb5_cred *); +#endif +void KRB5_CALLCONV krb5_free_creds + (krb5_context, krb5_creds *); +void KRB5_CALLCONV krb5_free_cred_contents + (krb5_context, krb5_creds *); +#if KRB5_PRIVATE +void KRB5_CALLCONV krb5_free_cred_enc_part + (krb5_context, krb5_cred_enc_part *); +#endif +void KRB5_CALLCONV krb5_free_checksum + (krb5_context, krb5_checksum *); +void KRB5_CALLCONV krb5_free_checksum_contents + (krb5_context, krb5_checksum *); +void KRB5_CALLCONV krb5_free_keyblock + (krb5_context, krb5_keyblock *); +void KRB5_CALLCONV krb5_free_keyblock_contents + (krb5_context, krb5_keyblock *); +#if KRB5_PRIVATE +void KRB5_CALLCONV krb5_free_pa_data + (krb5_context, krb5_pa_data **); +#endif +void KRB5_CALLCONV krb5_free_ap_rep_enc_part + (krb5_context, krb5_ap_rep_enc_part *); +#if KRB5_PRIVATE +void KRB5_CALLCONV krb5_free_tkt_authent + (krb5_context, krb5_tkt_authent *); +void KRB5_CALLCONV krb5_free_pwd_data + (krb5_context, krb5_pwd_data *); +void KRB5_CALLCONV krb5_free_pwd_sequences + (krb5_context, passwd_phrase_element **); +#endif +void KRB5_CALLCONV krb5_free_data + (krb5_context, krb5_data *); +void KRB5_CALLCONV krb5_free_data_contents + (krb5_context, krb5_data *); +void KRB5_CALLCONV krb5_free_unparsed_name + (krb5_context, char *); +void KRB5_CALLCONV krb5_free_cksumtypes + (krb5_context, krb5_cksumtype *); + +/* From krb5/os but needed but by the outside world */ +krb5_error_code KRB5_CALLCONV krb5_us_timeofday + (krb5_context, + krb5_int32 *, + krb5_int32 * ); +krb5_error_code KRB5_CALLCONV krb5_timeofday + (krb5_context, + krb5_int32 * ); + /* get all the addresses of this host */ +krb5_error_code KRB5_CALLCONV krb5_os_localaddr + (krb5_context, + krb5_address ***); +krb5_error_code KRB5_CALLCONV krb5_get_default_realm + (krb5_context, + char ** ); +krb5_error_code KRB5_CALLCONV krb5_set_default_realm + (krb5_context, + const char * ); +void KRB5_CALLCONV krb5_free_default_realm + (krb5_context, + char * ); +krb5_error_code KRB5_CALLCONV krb5_sname_to_principal + (krb5_context, + const char *, + const char *, + krb5_int32, + krb5_principal *); +krb5_error_code KRB5_CALLCONV +krb5_change_password + (krb5_context context, krb5_creds *creds, char *newpw, + int *result_code, krb5_data *result_code_string, + krb5_data *result_string); +krb5_error_code KRB5_CALLCONV +krb5_set_password + (krb5_context context, krb5_creds *creds, char *newpw, krb5_principal change_password_for, + int *result_code, krb5_data *result_code_string, krb5_data *result_string); +krb5_error_code KRB5_CALLCONV +krb5_set_password_using_ccache + (krb5_context context, krb5_ccache ccache, char *newpw, krb5_principal change_password_for, + int *result_code, krb5_data *result_code_string, krb5_data *result_string); + +#if KRB5_PRIVATE +#ifndef macintosh +krb5_error_code krb5_set_config_files + (krb5_context, const char **); + +krb5_error_code KRB5_CALLCONV krb5_get_default_config_files + (char ***filenames); + +void KRB5_CALLCONV krb5_free_config_files + (char **filenames); + +#endif +#endif + +krb5_error_code KRB5_CALLCONV +krb5_get_profile + (krb5_context, struct _profile_t * /* profile_t */ *); + +#if KRB5_PRIVATE +krb5_error_code krb5_send_tgs + (krb5_context, + krb5_flags, + const krb5_ticket_times *, + const krb5_enctype *, + krb5_const_principal, + krb5_address * const *, + krb5_authdata * const *, + krb5_pa_data * const *, + const krb5_data *, + krb5_creds *, + krb5_response * ); +#endif + +#if KRB5_DEPRECATED +krb5_error_code KRB5_CALLCONV krb5_get_in_tkt + (krb5_context, + krb5_flags, + krb5_address * const *, + krb5_enctype *, + krb5_preauthtype *, + krb5_error_code ( * )(krb5_context, + krb5_enctype, + krb5_data *, + krb5_const_pointer, + krb5_keyblock **), + krb5_const_pointer, + krb5_error_code ( * )(krb5_context, + const krb5_keyblock *, + krb5_const_pointer, + krb5_kdc_rep * ), + krb5_const_pointer, + krb5_creds *, + krb5_ccache, + krb5_kdc_rep ** ); + +krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_password + (krb5_context, + krb5_flags, + krb5_address * const *, + krb5_enctype *, + krb5_preauthtype *, + const char *, + krb5_ccache, + krb5_creds *, + krb5_kdc_rep ** ); + +krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_skey + (krb5_context, + krb5_flags, + krb5_address * const *, + krb5_enctype *, + krb5_preauthtype *, + const krb5_keyblock *, + krb5_ccache, + krb5_creds *, + krb5_kdc_rep ** ); + +krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_keytab + (krb5_context, + krb5_flags, + krb5_address * const *, + krb5_enctype *, + krb5_preauthtype *, + krb5_keytab, + krb5_ccache, + krb5_creds *, + krb5_kdc_rep ** ); +#endif /* KRB5_DEPRECATED */ + +#if KRB5_PRIVATE +krb5_error_code krb5_decode_kdc_rep + (krb5_context, + krb5_data *, + const krb5_keyblock *, + krb5_kdc_rep ** ); +#endif + +krb5_error_code KRB5_CALLCONV krb5_rd_req + (krb5_context, + krb5_auth_context *, + const krb5_data *, + krb5_const_principal, + krb5_keytab, + krb5_flags *, + krb5_ticket **); + +#if KRB5_PRIVATE +krb5_error_code krb5_rd_req_decoded + (krb5_context, + krb5_auth_context *, + const krb5_ap_req *, + krb5_const_principal, + krb5_keytab, + krb5_flags *, + krb5_ticket **); + +krb5_error_code krb5_rd_req_decoded_anyflag + (krb5_context, + krb5_auth_context *, + const krb5_ap_req *, + krb5_const_principal, + krb5_keytab, + krb5_flags *, + krb5_ticket **); +#endif + +krb5_error_code KRB5_CALLCONV krb5_kt_read_service_key + (krb5_context, + krb5_pointer, + krb5_principal, + krb5_kvno, + krb5_enctype, + krb5_keyblock **); +krb5_error_code KRB5_CALLCONV krb5_mk_safe + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_data *, + krb5_replay_data *); +krb5_error_code KRB5_CALLCONV krb5_mk_priv + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_data *, + krb5_replay_data *); +#if KRB5_PRIVATE +krb5_error_code KRB5_CALLCONV krb5_cc_register + (krb5_context, + krb5_cc_ops *, + krb5_boolean ); +#endif + +krb5_error_code KRB5_CALLCONV krb5_sendauth + (krb5_context, + krb5_auth_context *, + krb5_pointer, + char *, + krb5_principal, + krb5_principal, + krb5_flags, + krb5_data *, + krb5_creds *, + krb5_ccache, + krb5_error **, + krb5_ap_rep_enc_part **, + krb5_creds **); + +krb5_error_code KRB5_CALLCONV krb5_recvauth + (krb5_context, + krb5_auth_context *, + krb5_pointer, + char *, + krb5_principal, + krb5_int32, + krb5_keytab, + krb5_ticket **); +krb5_error_code KRB5_CALLCONV krb5_recvauth_version + (krb5_context, + krb5_auth_context *, + krb5_pointer, + krb5_principal, + krb5_int32, + krb5_keytab, + krb5_ticket **, + krb5_data *); + +#if KRB5_PRIVATE +krb5_error_code krb5_walk_realm_tree + (krb5_context, + const krb5_data *, + const krb5_data *, + krb5_principal **, + int); +#endif + +krb5_error_code KRB5_CALLCONV krb5_mk_ncred + (krb5_context, + krb5_auth_context, + krb5_creds **, + krb5_data **, + krb5_replay_data *); + +krb5_error_code KRB5_CALLCONV krb5_mk_1cred + (krb5_context, + krb5_auth_context, + krb5_creds *, + krb5_data **, + krb5_replay_data *); + +krb5_error_code KRB5_CALLCONV krb5_rd_cred + (krb5_context, + krb5_auth_context, + krb5_data *, + krb5_creds ***, + krb5_replay_data *); + +krb5_error_code KRB5_CALLCONV krb5_fwd_tgt_creds + (krb5_context, + krb5_auth_context, + char *, + krb5_principal, + krb5_principal, + krb5_ccache, + int forwardable, + krb5_data *); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_init + (krb5_context, + krb5_auth_context *); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_free + (krb5_context, + krb5_auth_context); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_setflags + (krb5_context, + krb5_auth_context, + krb5_int32); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_getflags + (krb5_context, + krb5_auth_context, + krb5_int32 *); + +krb5_error_code KRB5_CALLCONV +krb5_auth_con_set_checksum_func (krb5_context, krb5_auth_context, + krb5_mk_req_checksum_func, void *); + +krb5_error_code KRB5_CALLCONV +krb5_auth_con_get_checksum_func( krb5_context, krb5_auth_context, + krb5_mk_req_checksum_func *, void **); + +krb5_error_code KRB5_CALLCONV_WRONG krb5_auth_con_setaddrs + (krb5_context, + krb5_auth_context, + krb5_address *, + krb5_address *); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_getaddrs + (krb5_context, + krb5_auth_context, + krb5_address **, + krb5_address **); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_setports + (krb5_context, + krb5_auth_context, + krb5_address *, + krb5_address *); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_setuseruserkey + (krb5_context, + krb5_auth_context, + krb5_keyblock *); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_getkey + (krb5_context, + krb5_auth_context, + krb5_keyblock **); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_getsendsubkey( + krb5_context, krb5_auth_context, krb5_keyblock **); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_getrecvsubkey( + krb5_context, krb5_auth_context, krb5_keyblock **); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_setsendsubkey( + krb5_context, krb5_auth_context, krb5_keyblock *); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_setrecvsubkey( + krb5_context, krb5_auth_context, krb5_keyblock *); + +#if KRB5_DEPRECATED +krb5_error_code KRB5_CALLCONV krb5_auth_con_getlocalsubkey + (krb5_context, + krb5_auth_context, + krb5_keyblock **); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_getremotesubkey + (krb5_context, + krb5_auth_context, + krb5_keyblock **); +#endif + +#if KRB5_PRIVATE +krb5_error_code KRB5_CALLCONV krb5_auth_con_set_req_cksumtype + (krb5_context, + krb5_auth_context, + krb5_cksumtype); + +krb5_error_code krb5_auth_con_set_safe_cksumtype + (krb5_context, + krb5_auth_context, + krb5_cksumtype); +#endif + +krb5_error_code KRB5_CALLCONV krb5_auth_con_getlocalseqnumber + (krb5_context, + krb5_auth_context, + krb5_int32 *); + +krb5_error_code KRB5_CALLCONV krb5_auth_con_getremoteseqnumber + (krb5_context, + krb5_auth_context, + krb5_int32 *); + +#if KRB5_DEPRECATED +krb5_error_code KRB5_CALLCONV krb5_auth_con_initivector + (krb5_context, + krb5_auth_context); +#endif + +#if KRB5_PRIVATE +krb5_error_code krb5_auth_con_setivector + (krb5_context, + krb5_auth_context, + krb5_pointer); + +krb5_error_code krb5_auth_con_getivector + (krb5_context, + krb5_auth_context, + krb5_pointer *); +#endif + +krb5_error_code KRB5_CALLCONV krb5_auth_con_setrcache + (krb5_context, + krb5_auth_context, + krb5_rcache); + +krb5_error_code KRB5_CALLCONV_WRONG krb5_auth_con_getrcache + (krb5_context, + krb5_auth_context, + krb5_rcache *); + +#if KRB5_PRIVATE +krb5_error_code krb5_auth_con_setpermetypes + (krb5_context, + krb5_auth_context, + const krb5_enctype *); + +krb5_error_code krb5_auth_con_getpermetypes + (krb5_context, + krb5_auth_context, + krb5_enctype **); +#endif + +krb5_error_code KRB5_CALLCONV krb5_auth_con_getauthenticator + (krb5_context, + krb5_auth_context, + krb5_authenticator **); + +#define KRB5_REALM_BRANCH_CHAR '.' + +/* + * end "func-proto.h" + */ + +/* + * begin stuff from libos.h + */ + +#if KRB5_PRIVATE +krb5_error_code krb5_read_message (krb5_context, krb5_pointer, krb5_data *); +krb5_error_code krb5_write_message (krb5_context, krb5_pointer, krb5_data *); +int krb5_net_read (krb5_context, int , char *, int); +int krb5_net_write (krb5_context, int , const char *, int); +#endif + +krb5_error_code KRB5_CALLCONV krb5_read_password + (krb5_context, + const char *, + const char *, + char *, + unsigned int * ); +krb5_error_code KRB5_CALLCONV krb5_aname_to_localname + (krb5_context, + krb5_const_principal, + int, + char * ); +krb5_error_code KRB5_CALLCONV krb5_get_host_realm + (krb5_context, + const char *, + char *** ); +krb5_error_code KRB5_CALLCONV krb5_free_host_realm + (krb5_context, + char * const * ); +#if KRB5_PRIVATE +krb5_error_code KRB5_CALLCONV krb5_get_realm_domain + (krb5_context, + const char *, + char ** ); +#endif +krb5_boolean KRB5_CALLCONV krb5_kuserok + (krb5_context, + krb5_principal, const char *); +krb5_error_code KRB5_CALLCONV krb5_auth_con_genaddrs + (krb5_context, + krb5_auth_context, + int, int); +#if KRB5_PRIVATE +krb5_error_code krb5_gen_portaddr + (krb5_context, + const krb5_address *, + krb5_const_pointer, + krb5_address **); +krb5_error_code krb5_gen_replay_name + (krb5_context, + const krb5_address *, + const char *, + char **); +krb5_error_code krb5_make_fulladdr + (krb5_context, + krb5_address *, + krb5_address *, + krb5_address *); +#endif + +krb5_error_code KRB5_CALLCONV krb5_set_real_time + (krb5_context, krb5_int32, krb5_int32); + +#if KRB5_PRIVATE +krb5_error_code krb5_set_debugging_time + (krb5_context, krb5_int32, krb5_int32); +krb5_error_code krb5_use_natural_time + (krb5_context); +#endif +krb5_error_code KRB5_CALLCONV krb5_get_time_offsets + (krb5_context, krb5_int32 *, krb5_int32 *); +#if KRB5_PRIVATE +krb5_error_code krb5_set_time_offsets + (krb5_context, krb5_int32, krb5_int32); +#endif + +/* str_conv.c */ +krb5_error_code KRB5_CALLCONV krb5_string_to_enctype + (char *, krb5_enctype *); +krb5_error_code KRB5_CALLCONV krb5_string_to_salttype + (char *, krb5_int32 *); +krb5_error_code KRB5_CALLCONV krb5_string_to_cksumtype + (char *, krb5_cksumtype *); +krb5_error_code KRB5_CALLCONV krb5_string_to_timestamp + (char *, krb5_timestamp *); +krb5_error_code KRB5_CALLCONV krb5_string_to_deltat + (char *, krb5_deltat *); +krb5_error_code KRB5_CALLCONV krb5_enctype_to_string + (krb5_enctype, char *, size_t); +krb5_error_code KRB5_CALLCONV krb5_salttype_to_string + (krb5_int32, char *, size_t); +krb5_error_code KRB5_CALLCONV krb5_cksumtype_to_string + (krb5_cksumtype, char *, size_t); +krb5_error_code KRB5_CALLCONV krb5_timestamp_to_string + (krb5_timestamp, char *, size_t); +krb5_error_code KRB5_CALLCONV krb5_timestamp_to_sfstring + (krb5_timestamp, char *, size_t, char *); +krb5_error_code KRB5_CALLCONV krb5_deltat_to_string + (krb5_deltat, char *, size_t); + + + +/* The name of the Kerberos ticket granting service... and its size */ +#define KRB5_TGS_NAME "krbtgt" +#define KRB5_TGS_NAME_SIZE 6 + +/* flags for recvauth */ +#define KRB5_RECVAUTH_SKIP_VERSION 0x0001 +#define KRB5_RECVAUTH_BADAUTHVERS 0x0002 +/* initial ticket api functions */ + +typedef struct _krb5_prompt { + char *prompt; + int hidden; + krb5_data *reply; +} krb5_prompt; + +typedef krb5_error_code (KRB5_CALLCONV *krb5_prompter_fct)(krb5_context context, + void *data, + const char *name, + const char *banner, + int num_prompts, + krb5_prompt prompts[]); + + +krb5_error_code KRB5_CALLCONV +krb5_prompter_posix (krb5_context context, + void *data, + const char *name, + const char *banner, + int num_prompts, + krb5_prompt prompts[]); + +typedef struct _krb5_get_init_creds_opt { + krb5_flags flags; + krb5_deltat tkt_life; + krb5_deltat renew_life; + int forwardable; + int proxiable; + krb5_enctype *etype_list; + int etype_list_length; + krb5_address **address_list; + krb5_preauthtype *preauth_list; + int preauth_list_length; + krb5_data *salt; +} krb5_get_init_creds_opt; + +#define KRB5_GET_INIT_CREDS_OPT_TKT_LIFE 0x0001 +#define KRB5_GET_INIT_CREDS_OPT_RENEW_LIFE 0x0002 +#define KRB5_GET_INIT_CREDS_OPT_FORWARDABLE 0x0004 +#define KRB5_GET_INIT_CREDS_OPT_PROXIABLE 0x0008 +#define KRB5_GET_INIT_CREDS_OPT_ETYPE_LIST 0x0010 +#define KRB5_GET_INIT_CREDS_OPT_ADDRESS_LIST 0x0020 +#define KRB5_GET_INIT_CREDS_OPT_PREAUTH_LIST 0x0040 +#define KRB5_GET_INIT_CREDS_OPT_SALT 0x0080 + + +void KRB5_CALLCONV +krb5_get_init_creds_opt_init +(krb5_get_init_creds_opt *opt); + +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_tkt_life +(krb5_get_init_creds_opt *opt, + krb5_deltat tkt_life); + +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_renew_life +(krb5_get_init_creds_opt *opt, + krb5_deltat renew_life); + +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_forwardable +(krb5_get_init_creds_opt *opt, + int forwardable); + +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_proxiable +(krb5_get_init_creds_opt *opt, + int proxiable); + +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_etype_list +(krb5_get_init_creds_opt *opt, + krb5_enctype *etype_list, + int etype_list_length); + +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_address_list +(krb5_get_init_creds_opt *opt, + krb5_address **addresses); + +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_preauth_list +(krb5_get_init_creds_opt *opt, + krb5_preauthtype *preauth_list, + int preauth_list_length); + +void KRB5_CALLCONV +krb5_get_init_creds_opt_set_salt +(krb5_get_init_creds_opt *opt, + krb5_data *salt); + +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_password +(krb5_context context, + krb5_creds *creds, + krb5_principal client, + char *password, + krb5_prompter_fct prompter, + void *data, + krb5_deltat start_time, + char *in_tkt_service, + krb5_get_init_creds_opt *k5_gic_options); + +krb5_error_code KRB5_CALLCONV +krb5_get_init_creds_keytab +(krb5_context context, + krb5_creds *creds, + krb5_principal client, + krb5_keytab arg_keytab, + krb5_deltat start_time, + char *in_tkt_service, + krb5_get_init_creds_opt *k5_gic_options); + +typedef struct _krb5_verify_init_creds_opt { + krb5_flags flags; + int ap_req_nofail; +} krb5_verify_init_creds_opt; + +#define KRB5_VERIFY_INIT_CREDS_OPT_AP_REQ_NOFAIL 0x0001 + +void KRB5_CALLCONV +krb5_verify_init_creds_opt_init +(krb5_verify_init_creds_opt *k5_vic_options); +void KRB5_CALLCONV +krb5_verify_init_creds_opt_set_ap_req_nofail +(krb5_verify_init_creds_opt *k5_vic_options, + int ap_req_nofail); + +krb5_error_code KRB5_CALLCONV +krb5_verify_init_creds +(krb5_context context, + krb5_creds *creds, + krb5_principal ap_req_server, + krb5_keytab ap_req_keytab, + krb5_ccache *ccache, + krb5_verify_init_creds_opt *k5_vic_options); + +krb5_error_code KRB5_CALLCONV +krb5_get_validated_creds +(krb5_context context, + krb5_creds *creds, + krb5_principal client, + krb5_ccache ccache, + char *in_tkt_service); + +krb5_error_code KRB5_CALLCONV +krb5_get_renewed_creds +(krb5_context context, + krb5_creds *creds, + krb5_principal client, + krb5_ccache ccache, + char *in_tkt_service); + +krb5_error_code KRB5_CALLCONV +krb5_decode_ticket +(const krb5_data *code, + krb5_ticket **rep); + +void KRB5_CALLCONV +krb5_appdefault_string +(krb5_context context, + const char *appname, + const krb5_data *realm, + const char *option, + const char *default_value, + char ** ret_value); + +void KRB5_CALLCONV +krb5_appdefault_boolean +(krb5_context context, + const char *appname, + const krb5_data *realm, + const char *option, + int default_value, + int *ret_value); + +#if KRB5_PRIVATE +/* + * The realm iterator functions + */ + +krb5_error_code KRB5_CALLCONV krb5_realm_iterator_create + (krb5_context context, void **iter_p); + +krb5_error_code KRB5_CALLCONV krb5_realm_iterator + (krb5_context context, void **iter_p, char **ret_realm); + +void KRB5_CALLCONV krb5_realm_iterator_free + (krb5_context context, void **iter_p); + +void KRB5_CALLCONV krb5_free_realm_string + (krb5_context context, char *str); +#endif + +/* + * Prompter enhancements + */ + +#define KRB5_PROMPT_TYPE_PASSWORD 0x1 +#define KRB5_PROMPT_TYPE_NEW_PASSWORD 0x2 +#define KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN 0x3 +#define KRB5_PROMPT_TYPE_PREAUTH 0x4 + +typedef krb5_int32 krb5_prompt_type; + +krb5_prompt_type* KRB5_CALLCONV krb5_get_prompt_types + (krb5_context context); + +#if TARGET_OS_MAC +# if defined(__MWERKS__) +# pragma import reset +# endif +# pragma options align=reset +#endif + +KRB5INT_END_DECLS + +/* Don't use this! We're going to phase it out. It's just here to keep + applications from breaking right away. */ +#define krb5_const const + +#endif /* KRB5_GENERAL__ */ + +/* + * include/krb5_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define KRB5KDC_ERR_NONE (-1765328384L) +#define KRB5KDC_ERR_NAME_EXP (-1765328383L) +#define KRB5KDC_ERR_SERVICE_EXP (-1765328382L) +#define KRB5KDC_ERR_BAD_PVNO (-1765328381L) +#define KRB5KDC_ERR_C_OLD_MAST_KVNO (-1765328380L) +#define KRB5KDC_ERR_S_OLD_MAST_KVNO (-1765328379L) +#define KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN (-1765328378L) +#define KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN (-1765328377L) +#define KRB5KDC_ERR_PRINCIPAL_NOT_UNIQUE (-1765328376L) +#define KRB5KDC_ERR_NULL_KEY (-1765328375L) +#define KRB5KDC_ERR_CANNOT_POSTDATE (-1765328374L) +#define KRB5KDC_ERR_NEVER_VALID (-1765328373L) +#define KRB5KDC_ERR_POLICY (-1765328372L) +#define KRB5KDC_ERR_BADOPTION (-1765328371L) +#define KRB5KDC_ERR_ETYPE_NOSUPP (-1765328370L) +#define KRB5KDC_ERR_SUMTYPE_NOSUPP (-1765328369L) +#define KRB5KDC_ERR_PADATA_TYPE_NOSUPP (-1765328368L) +#define KRB5KDC_ERR_TRTYPE_NOSUPP (-1765328367L) +#define KRB5KDC_ERR_CLIENT_REVOKED (-1765328366L) +#define KRB5KDC_ERR_SERVICE_REVOKED (-1765328365L) +#define KRB5KDC_ERR_TGT_REVOKED (-1765328364L) +#define KRB5KDC_ERR_CLIENT_NOTYET (-1765328363L) +#define KRB5KDC_ERR_SERVICE_NOTYET (-1765328362L) +#define KRB5KDC_ERR_KEY_EXP (-1765328361L) +#define KRB5KDC_ERR_PREAUTH_FAILED (-1765328360L) +#define KRB5KDC_ERR_PREAUTH_REQUIRED (-1765328359L) +#define KRB5KDC_ERR_SERVER_NOMATCH (-1765328358L) +#define KRB5PLACEHOLD_27 (-1765328357L) +#define KRB5PLACEHOLD_28 (-1765328356L) +#define KRB5PLACEHOLD_29 (-1765328355L) +#define KRB5PLACEHOLD_30 (-1765328354L) +#define KRB5KRB_AP_ERR_BAD_INTEGRITY (-1765328353L) +#define KRB5KRB_AP_ERR_TKT_EXPIRED (-1765328352L) +#define KRB5KRB_AP_ERR_TKT_NYV (-1765328351L) +#define KRB5KRB_AP_ERR_REPEAT (-1765328350L) +#define KRB5KRB_AP_ERR_NOT_US (-1765328349L) +#define KRB5KRB_AP_ERR_BADMATCH (-1765328348L) +#define KRB5KRB_AP_ERR_SKEW (-1765328347L) +#define KRB5KRB_AP_ERR_BADADDR (-1765328346L) +#define KRB5KRB_AP_ERR_BADVERSION (-1765328345L) +#define KRB5KRB_AP_ERR_MSG_TYPE (-1765328344L) +#define KRB5KRB_AP_ERR_MODIFIED (-1765328343L) +#define KRB5KRB_AP_ERR_BADORDER (-1765328342L) +#define KRB5KRB_AP_ERR_ILL_CR_TKT (-1765328341L) +#define KRB5KRB_AP_ERR_BADKEYVER (-1765328340L) +#define KRB5KRB_AP_ERR_NOKEY (-1765328339L) +#define KRB5KRB_AP_ERR_MUT_FAIL (-1765328338L) +#define KRB5KRB_AP_ERR_BADDIRECTION (-1765328337L) +#define KRB5KRB_AP_ERR_METHOD (-1765328336L) +#define KRB5KRB_AP_ERR_BADSEQ (-1765328335L) +#define KRB5KRB_AP_ERR_INAPP_CKSUM (-1765328334L) +#define KRB5KRB_AP_PATH_NOT_ACCEPTED (-1765328333L) +#define KRB5KRB_ERR_RESPONSE_TOO_BIG (-1765328332L) +#define KRB5PLACEHOLD_53 (-1765328331L) +#define KRB5PLACEHOLD_54 (-1765328330L) +#define KRB5PLACEHOLD_55 (-1765328329L) +#define KRB5PLACEHOLD_56 (-1765328328L) +#define KRB5PLACEHOLD_57 (-1765328327L) +#define KRB5PLACEHOLD_58 (-1765328326L) +#define KRB5PLACEHOLD_59 (-1765328325L) +#define KRB5KRB_ERR_GENERIC (-1765328324L) +#define KRB5KRB_ERR_FIELD_TOOLONG (-1765328323L) +#define KRB5PLACEHOLD_62 (-1765328322L) +#define KRB5PLACEHOLD_63 (-1765328321L) +#define KRB5PLACEHOLD_64 (-1765328320L) +#define KRB5PLACEHOLD_65 (-1765328319L) +#define KRB5PLACEHOLD_66 (-1765328318L) +#define KRB5PLACEHOLD_67 (-1765328317L) +#define KRB5PLACEHOLD_68 (-1765328316L) +#define KRB5PLACEHOLD_69 (-1765328315L) +#define KRB5PLACEHOLD_70 (-1765328314L) +#define KRB5PLACEHOLD_71 (-1765328313L) +#define KRB5PLACEHOLD_72 (-1765328312L) +#define KRB5PLACEHOLD_73 (-1765328311L) +#define KRB5PLACEHOLD_74 (-1765328310L) +#define KRB5PLACEHOLD_75 (-1765328309L) +#define KRB5PLACEHOLD_76 (-1765328308L) +#define KRB5PLACEHOLD_77 (-1765328307L) +#define KRB5PLACEHOLD_78 (-1765328306L) +#define KRB5PLACEHOLD_79 (-1765328305L) +#define KRB5PLACEHOLD_80 (-1765328304L) +#define KRB5PLACEHOLD_81 (-1765328303L) +#define KRB5PLACEHOLD_82 (-1765328302L) +#define KRB5PLACEHOLD_83 (-1765328301L) +#define KRB5PLACEHOLD_84 (-1765328300L) +#define KRB5PLACEHOLD_85 (-1765328299L) +#define KRB5PLACEHOLD_86 (-1765328298L) +#define KRB5PLACEHOLD_87 (-1765328297L) +#define KRB5PLACEHOLD_88 (-1765328296L) +#define KRB5PLACEHOLD_89 (-1765328295L) +#define KRB5PLACEHOLD_90 (-1765328294L) +#define KRB5PLACEHOLD_91 (-1765328293L) +#define KRB5PLACEHOLD_92 (-1765328292L) +#define KRB5PLACEHOLD_93 (-1765328291L) +#define KRB5PLACEHOLD_94 (-1765328290L) +#define KRB5PLACEHOLD_95 (-1765328289L) +#define KRB5PLACEHOLD_96 (-1765328288L) +#define KRB5PLACEHOLD_97 (-1765328287L) +#define KRB5PLACEHOLD_98 (-1765328286L) +#define KRB5PLACEHOLD_99 (-1765328285L) +#define KRB5PLACEHOLD_100 (-1765328284L) +#define KRB5PLACEHOLD_101 (-1765328283L) +#define KRB5PLACEHOLD_102 (-1765328282L) +#define KRB5PLACEHOLD_103 (-1765328281L) +#define KRB5PLACEHOLD_104 (-1765328280L) +#define KRB5PLACEHOLD_105 (-1765328279L) +#define KRB5PLACEHOLD_106 (-1765328278L) +#define KRB5PLACEHOLD_107 (-1765328277L) +#define KRB5PLACEHOLD_108 (-1765328276L) +#define KRB5PLACEHOLD_109 (-1765328275L) +#define KRB5PLACEHOLD_110 (-1765328274L) +#define KRB5PLACEHOLD_111 (-1765328273L) +#define KRB5PLACEHOLD_112 (-1765328272L) +#define KRB5PLACEHOLD_113 (-1765328271L) +#define KRB5PLACEHOLD_114 (-1765328270L) +#define KRB5PLACEHOLD_115 (-1765328269L) +#define KRB5PLACEHOLD_116 (-1765328268L) +#define KRB5PLACEHOLD_117 (-1765328267L) +#define KRB5PLACEHOLD_118 (-1765328266L) +#define KRB5PLACEHOLD_119 (-1765328265L) +#define KRB5PLACEHOLD_120 (-1765328264L) +#define KRB5PLACEHOLD_121 (-1765328263L) +#define KRB5PLACEHOLD_122 (-1765328262L) +#define KRB5PLACEHOLD_123 (-1765328261L) +#define KRB5PLACEHOLD_124 (-1765328260L) +#define KRB5PLACEHOLD_125 (-1765328259L) +#define KRB5PLACEHOLD_126 (-1765328258L) +#define KRB5PLACEHOLD_127 (-1765328257L) +#define KRB5_ERR_RCSID (-1765328256L) +#define KRB5_LIBOS_BADLOCKFLAG (-1765328255L) +#define KRB5_LIBOS_CANTREADPWD (-1765328254L) +#define KRB5_LIBOS_BADPWDMATCH (-1765328253L) +#define KRB5_LIBOS_PWDINTR (-1765328252L) +#define KRB5_PARSE_ILLCHAR (-1765328251L) +#define KRB5_PARSE_MALFORMED (-1765328250L) +#define KRB5_CONFIG_CANTOPEN (-1765328249L) +#define KRB5_CONFIG_BADFORMAT (-1765328248L) +#define KRB5_CONFIG_NOTENUFSPACE (-1765328247L) +#define KRB5_BADMSGTYPE (-1765328246L) +#define KRB5_CC_BADNAME (-1765328245L) +#define KRB5_CC_UNKNOWN_TYPE (-1765328244L) +#define KRB5_CC_NOTFOUND (-1765328243L) +#define KRB5_CC_END (-1765328242L) +#define KRB5_NO_TKT_SUPPLIED (-1765328241L) +#define KRB5KRB_AP_WRONG_PRINC (-1765328240L) +#define KRB5KRB_AP_ERR_TKT_INVALID (-1765328239L) +#define KRB5_PRINC_NOMATCH (-1765328238L) +#define KRB5_KDCREP_MODIFIED (-1765328237L) +#define KRB5_KDCREP_SKEW (-1765328236L) +#define KRB5_IN_TKT_REALM_MISMATCH (-1765328235L) +#define KRB5_PROG_ETYPE_NOSUPP (-1765328234L) +#define KRB5_PROG_KEYTYPE_NOSUPP (-1765328233L) +#define KRB5_WRONG_ETYPE (-1765328232L) +#define KRB5_PROG_SUMTYPE_NOSUPP (-1765328231L) +#define KRB5_REALM_UNKNOWN (-1765328230L) +#define KRB5_SERVICE_UNKNOWN (-1765328229L) +#define KRB5_KDC_UNREACH (-1765328228L) +#define KRB5_NO_LOCALNAME (-1765328227L) +#define KRB5_MUTUAL_FAILED (-1765328226L) +#define KRB5_RC_TYPE_EXISTS (-1765328225L) +#define KRB5_RC_MALLOC (-1765328224L) +#define KRB5_RC_TYPE_NOTFOUND (-1765328223L) +#define KRB5_RC_UNKNOWN (-1765328222L) +#define KRB5_RC_REPLAY (-1765328221L) +#define KRB5_RC_IO (-1765328220L) +#define KRB5_RC_NOIO (-1765328219L) +#define KRB5_RC_PARSE (-1765328218L) +#define KRB5_RC_IO_EOF (-1765328217L) +#define KRB5_RC_IO_MALLOC (-1765328216L) +#define KRB5_RC_IO_PERM (-1765328215L) +#define KRB5_RC_IO_IO (-1765328214L) +#define KRB5_RC_IO_UNKNOWN (-1765328213L) +#define KRB5_RC_IO_SPACE (-1765328212L) +#define KRB5_TRANS_CANTOPEN (-1765328211L) +#define KRB5_TRANS_BADFORMAT (-1765328210L) +#define KRB5_LNAME_CANTOPEN (-1765328209L) +#define KRB5_LNAME_NOTRANS (-1765328208L) +#define KRB5_LNAME_BADFORMAT (-1765328207L) +#define KRB5_CRYPTO_INTERNAL (-1765328206L) +#define KRB5_KT_BADNAME (-1765328205L) +#define KRB5_KT_UNKNOWN_TYPE (-1765328204L) +#define KRB5_KT_NOTFOUND (-1765328203L) +#define KRB5_KT_END (-1765328202L) +#define KRB5_KT_NOWRITE (-1765328201L) +#define KRB5_KT_IOERR (-1765328200L) +#define KRB5_NO_TKT_IN_RLM (-1765328199L) +#define KRB5DES_BAD_KEYPAR (-1765328198L) +#define KRB5DES_WEAK_KEY (-1765328197L) +#define KRB5_BAD_ENCTYPE (-1765328196L) +#define KRB5_BAD_KEYSIZE (-1765328195L) +#define KRB5_BAD_MSIZE (-1765328194L) +#define KRB5_CC_TYPE_EXISTS (-1765328193L) +#define KRB5_KT_TYPE_EXISTS (-1765328192L) +#define KRB5_CC_IO (-1765328191L) +#define KRB5_FCC_PERM (-1765328190L) +#define KRB5_FCC_NOFILE (-1765328189L) +#define KRB5_FCC_INTERNAL (-1765328188L) +#define KRB5_CC_WRITE (-1765328187L) +#define KRB5_CC_NOMEM (-1765328186L) +#define KRB5_CC_FORMAT (-1765328185L) +#define KRB5_CC_NOT_KTYPE (-1765328184L) +#define KRB5_INVALID_FLAGS (-1765328183L) +#define KRB5_NO_2ND_TKT (-1765328182L) +#define KRB5_NOCREDS_SUPPLIED (-1765328181L) +#define KRB5_SENDAUTH_BADAUTHVERS (-1765328180L) +#define KRB5_SENDAUTH_BADAPPLVERS (-1765328179L) +#define KRB5_SENDAUTH_BADRESPONSE (-1765328178L) +#define KRB5_SENDAUTH_REJECTED (-1765328177L) +#define KRB5_PREAUTH_BAD_TYPE (-1765328176L) +#define KRB5_PREAUTH_NO_KEY (-1765328175L) +#define KRB5_PREAUTH_FAILED (-1765328174L) +#define KRB5_RCACHE_BADVNO (-1765328173L) +#define KRB5_CCACHE_BADVNO (-1765328172L) +#define KRB5_KEYTAB_BADVNO (-1765328171L) +#define KRB5_PROG_ATYPE_NOSUPP (-1765328170L) +#define KRB5_RC_REQUIRED (-1765328169L) +#define KRB5_ERR_BAD_HOSTNAME (-1765328168L) +#define KRB5_ERR_HOST_REALM_UNKNOWN (-1765328167L) +#define KRB5_SNAME_UNSUPP_NAMETYPE (-1765328166L) +#define KRB5KRB_AP_ERR_V4_REPLY (-1765328165L) +#define KRB5_REALM_CANT_RESOLVE (-1765328164L) +#define KRB5_TKT_NOT_FORWARDABLE (-1765328163L) +#define KRB5_FWD_BAD_PRINCIPAL (-1765328162L) +#define KRB5_GET_IN_TKT_LOOP (-1765328161L) +#define KRB5_CONFIG_NODEFREALM (-1765328160L) +#define KRB5_SAM_UNSUPPORTED (-1765328159L) +#define KRB5_SAM_INVALID_ETYPE (-1765328158L) +#define KRB5_SAM_NO_CHECKSUM (-1765328157L) +#define KRB5_SAM_BAD_CHECKSUM (-1765328156L) +#define KRB5_KT_NAME_TOOLONG (-1765328155L) +#define KRB5_KT_KVNONOTFOUND (-1765328154L) +#define KRB5_APPL_EXPIRED (-1765328153L) +#define KRB5_LIB_EXPIRED (-1765328152L) +#define KRB5_CHPW_PWDNULL (-1765328151L) +#define KRB5_CHPW_FAIL (-1765328150L) +#define KRB5_KT_FORMAT (-1765328149L) +#define KRB5_NOPERM_ETYPE (-1765328148L) +#define KRB5_CONFIG_ETYPE_NOSUPP (-1765328147L) +#define KRB5_OBSOLETE_FN (-1765328146L) +#define KRB5_EAI_FAIL (-1765328145L) +#define KRB5_EAI_NODATA (-1765328144L) +#define KRB5_EAI_NONAME (-1765328143L) +#define KRB5_EAI_SERVICE (-1765328142L) +#define KRB5_ERR_NUMERIC_REALM (-1765328141L) +#define KRB5_ERR_BAD_S2K_PARAMS (-1765328140L) +#define KRB5_ERR_NO_SERVICE (-1765328139L) +#define KRB5_CC_READONLY (-1765328138L) +#define KRB5_CC_NOSUPP (-1765328137L) +#define ERROR_TABLE_BASE_krb5 (-1765328384L) + +extern const struct error_table et_krb5_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_krb5_error_table () /*@modifies internalState@*/; +#else +#define initialize_krb5_error_table() +#endif + +#if !defined(_WIN32) +#define init_krb5_err_tbl initialize_krb5_error_table +#define krb5_err_base ERROR_TABLE_BASE_krb5 +#endif +/* + * include/kdb5_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define KRB5_KDB_RCSID (-1780008448L) +#define KRB5_KDB_INUSE (-1780008447L) +#define KRB5_KDB_UK_SERROR (-1780008446L) +#define KRB5_KDB_UK_RERROR (-1780008445L) +#define KRB5_KDB_UNAUTH (-1780008444L) +#define KRB5_KDB_NOENTRY (-1780008443L) +#define KRB5_KDB_ILL_WILDCARD (-1780008442L) +#define KRB5_KDB_DB_INUSE (-1780008441L) +#define KRB5_KDB_DB_CHANGED (-1780008440L) +#define KRB5_KDB_TRUNCATED_RECORD (-1780008439L) +#define KRB5_KDB_RECURSIVELOCK (-1780008438L) +#define KRB5_KDB_NOTLOCKED (-1780008437L) +#define KRB5_KDB_BADLOCKMODE (-1780008436L) +#define KRB5_KDB_DBNOTINITED (-1780008435L) +#define KRB5_KDB_DBINITED (-1780008434L) +#define KRB5_KDB_ILLDIRECTION (-1780008433L) +#define KRB5_KDB_NOMASTERKEY (-1780008432L) +#define KRB5_KDB_BADMASTERKEY (-1780008431L) +#define KRB5_KDB_INVALIDKEYSIZE (-1780008430L) +#define KRB5_KDB_CANTREAD_STORED (-1780008429L) +#define KRB5_KDB_BADSTORED_MKEY (-1780008428L) +#define KRB5_KDB_CANTLOCK_DB (-1780008427L) +#define KRB5_KDB_DB_CORRUPT (-1780008426L) +#define KRB5_KDB_BAD_VERSION (-1780008425L) +#define KRB5_KDB_BAD_SALTTYPE (-1780008424L) +#define KRB5_KDB_BAD_ENCTYPE (-1780008423L) +#define KRB5_KDB_BAD_CREATEFLAGS (-1780008422L) +#define KRB5_KDB_NO_PERMITTED_KEY (-1780008421L) +#define KRB5_KDB_NO_MATCHING_KEY (-1780008420L) +#define ERROR_TABLE_BASE_kdb5 (-1780008448L) + +extern const struct error_table et_kdb5_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_kdb5_error_table () /*@modifies internalState@*/; +#else +#define initialize_kdb5_error_table() +#endif + +#if !defined(_WIN32) +#define init_kdb5_err_tbl initialize_kdb5_error_table +#define kdb5_err_base ERROR_TABLE_BASE_kdb5 +#endif +/* + * include/kv5m_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define KV5M_NONE (-1760647424L) +#define KV5M_PRINCIPAL (-1760647423L) +#define KV5M_DATA (-1760647422L) +#define KV5M_KEYBLOCK (-1760647421L) +#define KV5M_CHECKSUM (-1760647420L) +#define KV5M_ENCRYPT_BLOCK (-1760647419L) +#define KV5M_ENC_DATA (-1760647418L) +#define KV5M_CRYPTOSYSTEM_ENTRY (-1760647417L) +#define KV5M_CS_TABLE_ENTRY (-1760647416L) +#define KV5M_CHECKSUM_ENTRY (-1760647415L) +#define KV5M_AUTHDATA (-1760647414L) +#define KV5M_TRANSITED (-1760647413L) +#define KV5M_ENC_TKT_PART (-1760647412L) +#define KV5M_TICKET (-1760647411L) +#define KV5M_AUTHENTICATOR (-1760647410L) +#define KV5M_TKT_AUTHENT (-1760647409L) +#define KV5M_CREDS (-1760647408L) +#define KV5M_LAST_REQ_ENTRY (-1760647407L) +#define KV5M_PA_DATA (-1760647406L) +#define KV5M_KDC_REQ (-1760647405L) +#define KV5M_ENC_KDC_REP_PART (-1760647404L) +#define KV5M_KDC_REP (-1760647403L) +#define KV5M_ERROR (-1760647402L) +#define KV5M_AP_REQ (-1760647401L) +#define KV5M_AP_REP (-1760647400L) +#define KV5M_AP_REP_ENC_PART (-1760647399L) +#define KV5M_RESPONSE (-1760647398L) +#define KV5M_SAFE (-1760647397L) +#define KV5M_PRIV (-1760647396L) +#define KV5M_PRIV_ENC_PART (-1760647395L) +#define KV5M_CRED (-1760647394L) +#define KV5M_CRED_INFO (-1760647393L) +#define KV5M_CRED_ENC_PART (-1760647392L) +#define KV5M_PWD_DATA (-1760647391L) +#define KV5M_ADDRESS (-1760647390L) +#define KV5M_KEYTAB_ENTRY (-1760647389L) +#define KV5M_CONTEXT (-1760647388L) +#define KV5M_OS_CONTEXT (-1760647387L) +#define KV5M_ALT_METHOD (-1760647386L) +#define KV5M_ETYPE_INFO_ENTRY (-1760647385L) +#define KV5M_DB_CONTEXT (-1760647384L) +#define KV5M_AUTH_CONTEXT (-1760647383L) +#define KV5M_KEYTAB (-1760647382L) +#define KV5M_RCACHE (-1760647381L) +#define KV5M_CCACHE (-1760647380L) +#define KV5M_PREAUTH_OPS (-1760647379L) +#define KV5M_SAM_CHALLENGE (-1760647378L) +#define KV5M_SAM_CHALLENGE_2 (-1760647377L) +#define KV5M_SAM_KEY (-1760647376L) +#define KV5M_ENC_SAM_RESPONSE_ENC (-1760647375L) +#define KV5M_ENC_SAM_RESPONSE_ENC_2 (-1760647374L) +#define KV5M_SAM_RESPONSE (-1760647373L) +#define KV5M_SAM_RESPONSE_2 (-1760647372L) +#define KV5M_PREDICTED_SAM_RESPONSE (-1760647371L) +#define KV5M_PASSWD_PHRASE_ELEMENT (-1760647370L) +#define KV5M_GSS_OID (-1760647369L) +#define KV5M_GSS_QUEUE (-1760647368L) +#define ERROR_TABLE_BASE_kv5m (-1760647424L) + +extern const struct error_table et_kv5m_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_kv5m_error_table () /*@modifies internalState@*/; +#else +#define initialize_kv5m_error_table() +#endif + +#if !defined(_WIN32) +#define init_kv5m_err_tbl initialize_kv5m_error_table +#define kv5m_err_base ERROR_TABLE_BASE_kv5m +#endif +/* + * include/krb524_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define KRB524_BADKEY (-1750206208L) +#define KRB524_BADADDR (-1750206207L) +#define KRB524_BADPRINC (-1750206206L) +#define KRB524_BADREALM (-1750206205L) +#define KRB524_V4ERR (-1750206204L) +#define KRB524_ENCFULL (-1750206203L) +#define KRB524_DECEMPTY (-1750206202L) +#define KRB524_NOTRESP (-1750206201L) +#define KRB524_KRB4_DISABLED (-1750206200L) +#define ERROR_TABLE_BASE_k524 (-1750206208L) + +extern const struct error_table et_k524_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_k524_error_table () /*@modifies internalState@*/; +#else +#define initialize_k524_error_table() +#endif + +#if !defined(_WIN32) +#define init_k524_err_tbl initialize_k524_error_table +#define k524_err_base ERROR_TABLE_BASE_k524 +#endif +/* + * include/asn1_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define ASN1_BAD_TIMEFORMAT (1859794432L) +#define ASN1_MISSING_FIELD (1859794433L) +#define ASN1_MISPLACED_FIELD (1859794434L) +#define ASN1_TYPE_MISMATCH (1859794435L) +#define ASN1_OVERFLOW (1859794436L) +#define ASN1_OVERRUN (1859794437L) +#define ASN1_BAD_ID (1859794438L) +#define ASN1_BAD_LENGTH (1859794439L) +#define ASN1_BAD_FORMAT (1859794440L) +#define ASN1_PARSE_ERROR (1859794441L) +#define ASN1_BAD_GMTIME (1859794442L) +#define ASN1_MISMATCH_INDEF (1859794443L) +#define ASN1_MISSING_EOC (1859794444L) +#define ERROR_TABLE_BASE_asn1 (1859794432L) + +extern const struct error_table et_asn1_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_asn1_error_table () /*@modifies internalState@*/; +#else +#define initialize_asn1_error_table() +#endif + +#if !defined(_WIN32) +#define init_asn1_err_tbl initialize_asn1_error_table +#define asn1_err_base ERROR_TABLE_BASE_asn1 +#endif diff --git a/src/WINNT/kfw/inc/krb5/profile.h b/src/WINNT/kfw/inc/krb5/profile.h new file mode 100644 index 000000000..7a5fe432b --- /dev/null +++ b/src/WINNT/kfw/inc/krb5/profile.h @@ -0,0 +1,179 @@ +/* + * profile.h + */ + +#ifndef _KRB5_PROFILE_H +#define _KRB5_PROFILE_H + +#if defined(_WIN32) +#include +#endif + +#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)) +# include +# if TARGET_RT_MAC_CFM +# error "Use KfM 4.0 SDK headers for CFM compilation." +# endif +#endif + +#ifndef KRB5_CALLCONV +#define KRB5_CALLCONV +#define KRB5_CALLCONV_C +#endif + +typedef struct _profile_t *profile_t; + +/* + * Used by the profile iterator in prof_get.c + */ +#define PROFILE_ITER_LIST_SECTION 0x0001 +#define PROFILE_ITER_SECTIONS_ONLY 0x0002 +#define PROFILE_ITER_RELATIONS_ONLY 0x0004 + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#if TARGET_OS_MAC +# if defined(__MWERKS__) +# pragma import on +# endif +#endif + +typedef char* profile_filespec_t; /* path as C string */ +typedef char* profile_filespec_list_t; /* list of : separated paths, C string */ +typedef const char * const_profile_filespec_t; /* path as C string */ +typedef const char * const_profile_filespec_list_t; /* list of : separated paths, C string */ + +long KRB5_CALLCONV profile_init + (const_profile_filespec_t *files, profile_t *ret_profile); + +long KRB5_CALLCONV profile_init_path + (const_profile_filespec_list_t filelist, profile_t *ret_profile); + +long KRB5_CALLCONV profile_flush + (profile_t profile); + +void KRB5_CALLCONV profile_abandon + (profile_t profile); + +void KRB5_CALLCONV profile_release + (profile_t profile); + +long KRB5_CALLCONV profile_get_values + (profile_t profile, const char *const *names, char ***ret_values); + +void KRB5_CALLCONV profile_free_list + (char **list); + +long KRB5_CALLCONV profile_get_string + (profile_t profile, const char *name, const char *subname, + const char *subsubname, const char *def_val, + char **ret_string); +long KRB5_CALLCONV profile_get_integer + (profile_t profile, const char *name, const char *subname, + const char *subsubname, int def_val, + int *ret_default); + +long KRB5_CALLCONV profile_get_boolean + (profile_t profile, const char *name, const char *subname, + const char *subsubname, int def_val, + int *ret_default); + +long KRB5_CALLCONV profile_get_relation_names + (profile_t profile, const char **names, char ***ret_names); + +long KRB5_CALLCONV profile_get_subsection_names + (profile_t profile, const char **names, char ***ret_names); + +long KRB5_CALLCONV profile_iterator_create + (profile_t profile, const char **names, + int flags, void **ret_iter); + +void KRB5_CALLCONV profile_iterator_free + (void **iter_p); + +long KRB5_CALLCONV profile_iterator + (void **iter_p, char **ret_name, char **ret_value); + +void KRB5_CALLCONV profile_release_string (char *str); + +long KRB5_CALLCONV profile_update_relation + (profile_t profile, const char **names, + const char *old_value, const char *new_value); + +long KRB5_CALLCONV profile_clear_relation + (profile_t profile, const char **names); + +long KRB5_CALLCONV profile_rename_section + (profile_t profile, const char **names, + const char *new_name); + +long KRB5_CALLCONV profile_add_relation + (profile_t profile, const char **names, + const char *new_value); + +#if TARGET_OS_MAC +# if defined(__MWERKS__) +# pragma import reset +# endif +#endif + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _KRB5_PROFILE_H */ +/* + * util/profile/prof_err.h: + * This file is automatically generated; please do not edit it. + */ + +#include + +#define PROF_VERSION (-1429577728L) +#define PROF_MAGIC_NODE (-1429577727L) +#define PROF_NO_SECTION (-1429577726L) +#define PROF_NO_RELATION (-1429577725L) +#define PROF_ADD_NOT_SECTION (-1429577724L) +#define PROF_SECTION_WITH_VALUE (-1429577723L) +#define PROF_BAD_LINK_LIST (-1429577722L) +#define PROF_BAD_GROUP_LVL (-1429577721L) +#define PROF_BAD_PARENT_PTR (-1429577720L) +#define PROF_MAGIC_ITERATOR (-1429577719L) +#define PROF_SET_SECTION_VALUE (-1429577718L) +#define PROF_EINVAL (-1429577717L) +#define PROF_READ_ONLY (-1429577716L) +#define PROF_SECTION_NOTOP (-1429577715L) +#define PROF_SECTION_SYNTAX (-1429577714L) +#define PROF_RELATION_SYNTAX (-1429577713L) +#define PROF_EXTRA_CBRACE (-1429577712L) +#define PROF_MISSING_OBRACE (-1429577711L) +#define PROF_MAGIC_PROFILE (-1429577710L) +#define PROF_MAGIC_SECTION (-1429577709L) +#define PROF_TOPSECTION_ITER_NOSUPP (-1429577708L) +#define PROF_INVALID_SECTION (-1429577707L) +#define PROF_END_OF_SECTIONS (-1429577706L) +#define PROF_BAD_NAMESET (-1429577705L) +#define PROF_NO_PROFILE (-1429577704L) +#define PROF_MAGIC_FILE (-1429577703L) +#define PROF_FAIL_OPEN (-1429577702L) +#define PROF_EXISTS (-1429577701L) +#define PROF_BAD_BOOLEAN (-1429577700L) +#define PROF_BAD_INTEGER (-1429577699L) +#define PROF_MAGIC_FILE_DATA (-1429577698L) +#define ERROR_TABLE_BASE_prof (-1429577728L) + +extern const struct error_table et_prof_error_table; + +#if !defined(_WIN32) +/* for compatibility with older versions... */ +extern void initialize_prof_error_table () /*@modifies internalState@*/; +#else +#define initialize_prof_error_table() +#endif + +#if !defined(_WIN32) +#define init_prof_err_tbl initialize_prof_error_table +#define prof_err_base ERROR_TABLE_BASE_prof +#endif diff --git a/src/WINNT/kfw/inc/krb5/win-mac.h b/src/WINNT/kfw/inc/krb5/win-mac.h new file mode 100644 index 000000000..4cf155e62 --- /dev/null +++ b/src/WINNT/kfw/inc/krb5/win-mac.h @@ -0,0 +1,176 @@ +/* + * This file is now only used on Windows + */ + +/* + * type functions split out of here to make things look nicer in the + * various include files which need these definitions, as well as in + * the util/ directories. + */ + +#ifndef _KRB5_WIN_MAC_H +#define _KRB5_WIN_MAC_H + +#ifdef _WIN32 + +#define ID_READ_PWD_DIALOG 10000 +#define ID_READ_PWD_PROMPT 10001 +#define ID_READ_PWD_PROMPT2 10002 +#define ID_READ_PWD_PWD 10003 + +#ifdef RES_ONLY + +#define APSTUDIO_HIDDEN_SYMBOLS +#include + +#else /* ! RES_ONLY */ + +#define SIZEOF_INT 4 +#define SIZEOF_SHORT 2 +#define SIZEOF_LONG 4 + +#include +#include + +#define HAVE_LABS + +#ifndef SIZE_MAX /* in case Microsoft defines max size of size_t */ +#define SIZE_MAX UINT_MAX +#endif + +#ifndef KRB5_CALLCONV +# define KRB5_CALLCONV __stdcall +# define KRB5_CALLCONV_C __cdecl + +/* + * Use this to mark an incorrect calling convention that has been + * "immortalized" because it was incorrectly exported in a previous + * release. + */ + +# define KRB5_CALLCONV_WRONG KRB5_CALLCONV_C + +#endif /* !KRB5_CALLCONV */ + +#ifndef KRB5_SYSTYPES__ +#define KRB5_SYSTYPES__ +#include +typedef unsigned long u_long; /* Not part of sys/types.h on the pc */ +typedef unsigned int u_int; +typedef unsigned short u_short; +typedef unsigned char u_char; +#endif /* KRB5_SYSTYPES__ */ + +#define MAXHOSTNAMELEN 512 +#ifndef MAXPATHLEN +#define MAXPATHLEN 256 /* Also for Windows temp files */ +#endif + +#define HAVE_NETINET_IN_H +#define MSDOS_FILESYSTEM +#define HAVE_STRING_H +#define HAVE_SRAND +#define HAVE_ERRNO +#define HAVE_STRDUP +#define NO_USERID +#define NO_PASSWORD + +#define WM_KERBEROS5_CHANGED "Kerberos5 Changed" +#ifdef KRB4 +#define WM_KERBEROS_CHANGED "Kerberos Changed" +#endif + +/* Kerberos Windows initialization file */ +#define KERBEROS_INI "kerberos.ini" +#ifdef CYGNUS +#define KERBEROS_HLP "kerbnet.hlp" +#else +#define KERBEROS_HLP "krb5clnt.hlp" +#endif +#define INI_DEFAULTS "Defaults" +#define INI_USER "User" /* Default user */ +#define INI_INSTANCE "Instance" /* Default instance */ +#define INI_REALM "Realm" /* Default realm */ +#define INI_POSITION "Position" +#define INI_OPTIONS "Options" +#define INI_DURATION "Duration" /* Ticket duration in minutes */ +#define INI_EXPIRATION "Expiration" /* Action on expiration (alert or beep) */ +#define INI_ALERT "Alert" +#define INI_BEEP "Beep" +#define INI_FILES "Files" +#ifdef KRB4 +#define INI_KRB_CONF "krb.conf" /* Location of krb.conf file */ +#define DEF_KRB_CONF "krb.conf" /* Default name for krb.conf file */ +#else +#define INI_KRB5_CONF "krb5.ini" /* From k5-config.h */ +#define INI_KRB_CONF INI_KRB5_CONF /* Location of krb.conf file */ +#define DEF_KRB_CONF INI_KRB5_CONF /* Default name for krb.conf file */ +#define INI_TICKETOPTS "TicketOptions" /* Ticket options */ +#define INI_FORWARDABLE "Forwardable" /* get forwardable tickets */ +#define INI_KRB_CCACHE "krb5cc" /* From k5-config.h */ +#endif +#define INI_KRB_REALMS "krb.realms" /* Location of krb.realms file */ +#define DEF_KRB_REALMS "krb.realms" /* Default name for krb.realms file */ +#define INI_RECENT_LOGINS "Recent Logins" +#define INI_LOGIN "Login" + +#define HAS_VOID_TYPE +#define HAVE_STDARG_H +#define HAVE_SYS_TYPES_H +#define HAVE_STDLIB_H + +/* This controls which encryption routines libcrypto will provide */ +#define PROVIDE_DES_CBC_MD5 +#define PROVIDE_DES_CBC_CRC +#define PROVIDE_DES_CBC_RAW +#define PROVIDE_DES_CBC_CKSUM +#define PROVIDE_CRC32 +#define PROVIDE_RSA_MD4 +#define PROVIDE_RSA_MD5 +/* #define PROVIDE_DES3_CBC_SHA */ +/* #define PROVIDE_DES3_CBC_RAW */ +/* #define PROVIDE_NIST_SHA */ + +/* Ugly. Microsoft, in stdc mode, doesn't support the low-level i/o + * routines directly. Rather, they only export the _ version. + * The following defines works around this problem. + */ +#include +#include +#include +#include +#include + +#ifdef NEED_SYSERROR +/* Only needed by util/et/error_message.c but let's keep the source clean */ +#define sys_nerr _sys_nerr +#define sys_errlist _sys_errlist +#endif + +/* + * Functions with slightly different names on the PC + */ +#ifndef strcasecmp +#define strcasecmp stricmp +#endif +#ifndef strncasecmp +#define strncasecmp strnicmp +#endif + +HINSTANCE get_lib_instance(void); + +#endif /* !RES_ONLY */ + +#endif /* _WIN32 */ + +#define THREEPARAMOPEN(x,y,z) open(x,y,z) + +#ifndef KRB5_CALLCONV +#define KRB5_CALLCONV +#endif + +#ifndef KRB5_CALLCONV_C +#define KRB5_CALLCONV_C +#endif + +#endif /* _KRB5_WIN_MAC_H */ diff --git a/src/WINNT/kfw/inc/krbcc/cacheapi.h b/src/WINNT/kfw/inc/krbcc/cacheapi.h new file mode 100644 index 000000000..e4ff8e5c6 --- /dev/null +++ b/src/WINNT/kfw/inc/krbcc/cacheapi.h @@ -0,0 +1,458 @@ +/* + * $Id: cacheapi.h,v 1.1 2004/02/26 19:22:54 jaltman Exp $ + * + * Copyright 1997 by the Regents of the University of Michigan + * + * This software is being provided to you, the LICENSEE, by the + * Regents of the University of Michigan (UM) under the following + * license. By obtaining, using and/or copying this software, you agree + * that you have read, understood, and will comply with these terms and + * conditions: + * + * Permission to use, copy, modify and distribute this software and its + * documentation for any purpose and without fee or royalty is hereby + * granted, provided that you agree to comply with the following copyright + * notice and statements, including the disclaimer, and that the same + * appear on ALL copies of the software and documentation, including + * modifications that you make for internal use or for distribution: + * + * Copyright 1997 by the Regents of the University of Michigan. + * All rights reserved. + * + * THIS SOFTWARE IS PROVIDED "AS IS", AND UM MAKES NO REPRESENTATIONS + * OR WARRANTIES, EXPRESS OR IMPLIED. By way of example, but not + * limitation, UM MAKES NO REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY + * OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED + * SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. + * + * The name of the University of Michigan or UM may NOT be used in + * advertising or publicity pertaining to distribution of the software. + * Title to copyright in this software and any associated documentation + * shall at all times remain with UM, and USER agrees to preserve same. + * + * The University of Michigan + * c/o Steve Rothwell + * 535 W. William Street + * Ann Arbor, Michigan 48013-4943 + * U.S.A. + */ + +/* +** CacheAPI.h +** +** The externally visible functions and data structures +** for the Kerberos Common Cache DLL +** This should be the ONLY externally visible file. +** This is ALL anyone should need to call the API. +** +** +*/ + +#ifndef Krb_CCacheAPI_h_ +#define Krb_CCacheAPI_h_ + +#include + +//typedef int cc_int32; +#define cc_int32 long +#define cc_uint32 unsigned long + +typedef cc_int32 cc_time_t; + +#define CC_API_VER_1 1 +#define CC_API_VER_2 2 + +//enum { +// CC_API_VER_1 = 1, +// CC_API_VER_2 = 2 +//}; + +#define CCACHE_API __declspec(dllexport) cc_int32 + +/* +** The Official Error Codes +*/ +#define CC_NOERROR 0 +#define CC_BADNAME 1 +#define CC_NOTFOUND 2 +#define CC_END 3 +#define CC_IO 4 +#define CC_WRITE 5 +#define CC_NOMEM 6 +#define CC_FORMAT 7 +#define CC_LOCKED 8 +#define CC_BAD_API_VERSION 9 +#define CC_NO_EXIST 10 +#define CC_NOT_SUPP 11 +#define CC_BAD_PARM 12 +#define CC_ERR_CACHE_ATTACH 13 +#define CC_ERR_CACHE_RELEASE 14 +#define CC_ERR_CACHE_FULL 15 +#define CC_ERR_CRED_VERSION 16 + + +/* +** types, structs, & constants +*/ +// Flag bits promised by Ted "RSN" +#define CC_FLAGS_RESERVED 0xFFFFFFFF + +typedef cc_uint32 cc_nc_flags; // set via constants above + +typedef struct opaque_dll_control_block_type* apiCB; +typedef struct opaque_ccache_pointer_type* ccache_p; +typedef struct opaque_credential_iterator_type* ccache_cit; + +#if 0 +enum _cc_data_type { + type_ticket = 0, /* 0 for ticket, second_ticket */ + /* Ted's draft spec says these are to be + "as defined in the Kerberos V5 protocol" + all I can find are typdefs, + can't find an enumerated type or #define + */ + type_address, /* = <"as defined in the Kerberos V5 protocol"> */ + type_authdata, /* = <"as defined in the Kerberos V5 protocol"> */ + type_encryption, /* = <"as defined in the Kerberos V5 protocol"> */ + cc_data_type_max /* for validation */ +}; +#endif + +typedef struct _cc_data +{ + cc_uint32 type; // should be one of _cc_data_type + cc_uint32 length; + unsigned char* data; // the proverbial bag-o-bits +} cc_data; + +// V5 Credentials +typedef struct _cc_creds { + char* client; + char* server; + cc_data keyblock; + cc_time_t authtime; + cc_time_t starttime; + cc_time_t endtime; + cc_time_t renew_till; + cc_uint32 is_skey; + cc_uint32 ticket_flags; + cc_data FAR ** addresses; + cc_data ticket; + cc_data second_ticket; + cc_data FAR ** authdata; +} cc_creds; + + +// begin V4 stuff +// use an enumerated type so all callers infer the same meaning +// these values are what krbv4win uses internally. +#define STK_AFS 0 +#define STK_DES 1 + +// K4 uses a MAX_KTXT_LEN of 1250 to hold a ticket +// K95 uses 256 +// To be safe I'll use the larger number, but a factor of 5!!! +#define MAX_V4_CRED_LEN 1250 + +// V4 Credentials + +enum { + KRB_NAME_SZ = 40, + KRB_INSTANCE_SZ = 40, + KRB_REALM_SZ = 40 +}; + +typedef struct cc_V4credential { + unsigned char kversion; + char principal[KRB_NAME_SZ + 1]; + char principal_instance[KRB_INSTANCE_SZ + 1]; + char service[KRB_NAME_SZ + 1]; + char service_instance[KRB_INSTANCE_SZ + 1]; + char realm[KRB_REALM_SZ + 1]; + unsigned char session_key[8]; + cc_int32 kvno; // k95 used BYTE skvno + cc_int32 str_to_key; // k4 infers dynamically, k95 stores + long issue_date; // k95 called this issue_time + cc_int32 lifetime; // k95 used LONG expiration_time + cc_uint32 address; // IP Address of local host + cc_int32 ticket_sz; // k95 used BYTE, k4 ktext uses int to hold up to 1250 + unsigned char ticket[MAX_V4_CRED_LEN]; + unsigned long oops; // zero to catch runaways +} V4Cred_type; + +enum { + CC_CRED_VUNKNOWN = 0, // For validation + CC_CRED_V4 = 1, + CC_CRED_V5 = 2, + CC_CRED_VMAX = 3 // For validation +}; + +typedef union cred_ptr_union_type { + V4Cred_type* pV4Cred; + cc_creds* pV5Cred; +} cred_ptr_union; + +typedef struct cred_union_type { + cc_int32 cred_type; + cred_ptr_union cred; +} cred_union; + +typedef struct _infoNC { + char* name; + char* principal; + cc_int32 vers; +} infoNC; + + +/* +** The official (externally visible) API +*/ + +#ifdef __cplusplus +extern "C" /* this entire list of functions */ +{ +#endif /* __cplusplus */ + +/* +** Main cache routines : initialize, shutdown, get_cache_names, & get_change_time +*/ +CCACHE_API +cc_initialize( + apiCB** cc_ctx, // < DLL's primary control structure. + // returned here, passed everywhere else + cc_int32 api_version, // > ver supported by caller (use CC_API_VER_1) + cc_int32* api_supported, // < if ~NULL, max ver supported by DLL + const char** vendor // < if ~NULL, vendor name in read only C string + ); + +CCACHE_API +cc_shutdown( + apiCB** cc_ctx // <> DLL's primary control structure. NULL after call. + ); + +CCACHE_API +cc_get_change_time( + apiCB* cc_ctx, // > DLL's primary control structure + cc_time_t* time // < time of last change to main cache + ); + + +/* +** Named Cache (NC) routines +** create, open, close, destroy, get_principal, get_cred_version, & +** lock_request +** +** Multiple NCs are allowed within the main cache. Each has a Name +** and kerberos version # (V4 or V5). Caller gets "ccache_ptr"s for +** NCs. +*/ +CCACHE_API +cc_create( + apiCB* cc_ctx, // > DLL's primary control structure + const char* name, // > name of cache to be [destroyed if exists, then] created + const char* principal, + cc_int32 vers, // > ticket version (CC_CRED_V4 or CC_CRED_V5) + cc_uint32 cc_flags, // > options + ccache_p** ccache_ptr // < NC control structure + ); + +CCACHE_API +cc_open( + apiCB* cc_ctx, // > DLL's primary control structure + const char* name, // > name of pre-created cache + cc_int32 vers, // > ticket version (CC_CRED_V4 or CC_CRED_V5) + cc_uint32 cc_flags, // > options + ccache_p** ccache_ptr // < NC control structure + ); + +CCACHE_API +cc_close( + apiCB* cc_ctx, // > DLL's primary control structure + ccache_p** ccache_ptr // <> NC control structure. NULL after call. + ); + +CCACHE_API +cc_destroy( + apiCB* cc_ctx, // > DLL's primary control structure + ccache_p** ccache_ptr // <> NC control structure. NULL after call. + ); + +/* +** Ways to get information about the NCs +*/ + +CCACHE_API +cc_seq_fetch_NCs_begin( + apiCB* cc_ctx, + ccache_cit** itNCs + ); + +CCACHE_API +cc_seq_fetch_NCs_end( + apiCB* cc_ctx, + ccache_cit** itNCs + ); + +CCACHE_API +cc_seq_fetch_NCs_next( + apiCB* cc_ctx, + ccache_p** ccache_ptr, + ccache_cit* itNCs + ); + +CCACHE_API +cc_seq_fetch_NCs( + apiCB* cc_ctx, // > DLL's primary control structure + ccache_p** ccache_ptr, // < NC control structure (free via cc_close()) + ccache_cit** itNCs // <> iterator used by DLL, + // set to NULL before first call + // returned NULL at CC_END + ); + +CCACHE_API +cc_get_NC_info( + apiCB* cc_ctx, // > DLL's primary control structure + struct _infoNC*** ppNCi // < (NULL before call) null terminated, + // list of a structs (free via cc_free_infoNC()) + ); + +CCACHE_API +cc_free_NC_info( + apiCB* cc_ctx, + struct _infoNC*** ppNCi // < free list of structs returned by + // cc_get_cache_names(). set to NULL on return + ); + +/* +** Functions that provide distinguishing characteristics of NCs. +*/ + +CCACHE_API +cc_get_name( + apiCB* cc_ctx, // > DLL's primary control structure + const ccache_p* ccache_ptr, // > NC control structure + char** name // < name of NC associated with ccache_ptr + // (free via cc_free_name()) + ); + +CCACHE_API +cc_set_principal( + apiCB* cc_ctx, // > DLL's primary control structure + const ccache_p* ccache_pointer, // > NC control structure + const cc_int32 vers, + const char* principal // > name of principal associated with NC + // Free via cc_free_principal() + ); + +CCACHE_API +cc_get_principal( + apiCB* cc_ctx, // > DLL's primary control structure + const ccache_p* ccache_pointer, // > NC control structure + char** principal // < name of principal associated with NC + // Free via cc_free_principal() + ); + +CCACHE_API +cc_get_cred_version( + apiCB* cc_ctx, // > DLL's primary control structure + const ccache_p* ccache_ptr, // > NC control structure + cc_int32* vers // < ticket version associated with NC + ); + +#define CC_LOCK_UNLOCK 1 +#define CC_LOCK_READER 2 +#define CC_LOCK_WRITER 3 +#define CC_LOCK_NOBLOCK 16 + +CCACHE_API +cc_lock_request( + apiCB* cc_ctx, // > DLL's primary control structure + const ccache_p* ccache_ptr, // > NC control structure + const cc_int32 lock_type // > one (or combination) of above defined + // lock types + ); + + +/* +** Credentials routines (work within an NC) +** store, remove_cred, seq_fetch_creds +*/ +CCACHE_API +cc_store( + apiCB* cc_ctx, // > DLL's primary control structure + ccache_p* ccache_ptr, // > NC control structure + const cred_union creds // > credentials to be copied into NC + ); + +CCACHE_API +cc_remove_cred( + apiCB* cc_ctx, // > DLL's primary control structure + ccache_p* ccache_ptr, // > NC control structure + const cred_union cred // > credentials to remove from NC + ); + +CCACHE_API +cc_seq_fetch_creds( + apiCB* cc_ctx, // > DLL's primary control structure + const ccache_p* ccache_ptr, // > NC control structure + cred_union** creds, // < filled in by DLL, free via cc_free_creds() + ccache_cit** itCreds // <> iterator used by DLL, set to NULL + // before first call -- Also NULL for final + // call if loop ends before CC_END + ); + +CCACHE_API +cc_seq_fetch_creds_begin( + apiCB* cc_ctx, + const ccache_p* ccache_ptr, + ccache_cit** itCreds + ); + +CCACHE_API +cc_seq_fetch_creds_end( + apiCB* cc_ctx, + ccache_cit** itCreds + ); + +CCACHE_API +cc_seq_fetch_creds_next( + apiCB* cc_ctx, + cred_union** cred, + ccache_cit* itCreds + ); + +/* +** methods of liberation, +** or freeing space via the free that goes with the malloc used to get it +** It's important to use the free carried in the DLL, not the one supplied +** by your compiler vendor. +** +** freeing a NULL pointer is not treated as an error +*/ +CCACHE_API +cc_free_principal( + apiCB* cc_ctx, // > DLL's primary control structure + char** principal // <> ptr to principal to be freed, returned as NULL + // (from cc_get_principal()) + ); + +CCACHE_API +cc_free_name( + apiCB* cc_ctx, // > DLL's primary control structure + char** name // <> ptr to name to be freed, returned as NULL + // (from cc_get_name()) + ); + +CCACHE_API +cc_free_creds( + apiCB* cc_ctx, // > DLL's primary control structure + cred_union** pCred // <> cred (from cc_seq_fetch_creds()) to be freed + // Returned as NULL. + ); + +#ifdef __cplusplus +} /* end extern "C" */ +#endif /* __cplusplus */ + +#endif /* Krb_CCacheAPI_h_ */ diff --git a/src/WINNT/kfw/inc/leash/leasherr.h b/src/WINNT/kfw/inc/leash/leasherr.h new file mode 100644 index 000000000..834765fbb --- /dev/null +++ b/src/WINNT/kfw/inc/leash/leasherr.h @@ -0,0 +1,32 @@ +/* + * leasherr.h + * This file is the #include file for leasherr.et. + * Please do not edit it as it is automatically generated. + */ + +#define LSH_ONLYONEME (40591872L) +#define LSH_INVPRINCIPAL (40591873L) +#define LSH_FAILEDREALM (40591874L) +#define LSH_INVINSTANCE (40591875L) +#define LSH_INVREALM (40591876L) +#define LSH_EOF (40591877L) +#define LSH_EXPIRESOON (40591878L) +#define LSH_NOMATCH (40591879L) +#define LSH_BADCHARS (40591880L) +#define LSH_FATAL_ERROR (40591881L) +#define LSH_BADWINSOCK (40591882L) +#define LSH_BADTIMESERV (40591883L) +#define LSH_NOSOCKET (40591884L) +#define LSH_NOCONNECT (40591885L) +#define LSH_TIMEFAILED (40591886L) +#define LSH_GETTIMEOFDAY (40591887L) +#define LSH_SETTIMEOFDAY (40591888L) +#define LSH_RECVTIME (40591889L) +#define LSH_RECVBYTES (40591890L) +#define LSH_ALREADY_SETTIME (40591891L) +extern void initialize_lsh_error_table(struct et_list **); +#define ERROR_TABLE_BASE_lsh (40591872L) + +/* for compatibility with older versions... */ +#define init_lsh_err_tbl() initialize_lsh_error_table(&_et_list) +#define lsh_err_base ERROR_TABLE_BASE_lsh diff --git a/src/WINNT/kfw/inc/leash/leashinfo.h b/src/WINNT/kfw/inc/leash/leashinfo.h new file mode 100644 index 000000000..7365aa1b5 --- /dev/null +++ b/src/WINNT/kfw/inc/leash/leashinfo.h @@ -0,0 +1,2 @@ +#define LSH_TIME_HOST 1970 +#define LSH_DEFAULT_TICKET_LIFE 1971 diff --git a/src/WINNT/kfw/inc/leash/leashwin.h b/src/WINNT/kfw/inc/leash/leashwin.h new file mode 100644 index 000000000..f3ac7429d --- /dev/null +++ b/src/WINNT/kfw/inc/leash/leashwin.h @@ -0,0 +1,133 @@ +#ifndef __LEASHWIN__ +#define __LEASHWIN__ + +#include + +typedef struct { + int dlgtype; +#define DLGTYPE_PASSWD 0 +#define DLGTYPE_CHPASSWD 1 + // Tells whether dialog box is in change pwd more or init ticket mode??? + // (verify this): + int dlgstatemax; // What is this??? + // The title on the Dialog box - for Renewing or Initializing: + LPSTR title; + LPSTR principal; +} LSH_DLGINFO, FAR *LPLSH_DLGINFO; + +#define LEASH_USERNAME_SZ 64 +#define LEASH_REALM_SZ 192 + +typedef struct { + DWORD size; + int dlgtype; +#define DLGTYPE_PASSWD 0 +#define DLGTYPE_CHPASSWD 1 + // Tells whether dialog box is in change pwd more or init ticket mode??? + // (verify this): + LPSTR title; + LPSTR username; + LPSTR realm; + int use_defaults; + int forwardable; + int noaddresses; + int lifetime; + int renew_till; + int proxiable; + int publicip; + // Version 1 of this structure ended here + struct { + char username[LEASH_USERNAME_SZ]; + char realm[LEASH_REALM_SZ]; + } out; +} LSH_DLGINFO_EX, FAR *LPLSH_DLGINFO_EX; + +#define LSH_DLGINFO_EX_V1_SZ (sizeof(DWORD) + 3 * sizeof(LPSTR) * 8 * sizeof(int)) + +typedef struct { + char principal[MAX_K_NAME_SZ]; /* Principal name/instance/realm */ + int btickets; /* Do we have tickets? */ + long lifetime; /* Lifetime -- needs to have + room for 255 5-minute + periods * 5 * 60 */ + long issue_date; /* The issue time */ + long renew_till; /* The Renew time (k5 only) */ +} TICKETINFO; + +int FAR Leash_kinit_dlg(HWND hParent, LPLSH_DLGINFO lpdlginfo); +int FAR Leash_kinit_dlg_ex(HWND hParent, LPLSH_DLGINFO_EX lpdlginfoex); +int FAR Leash_changepwd_dlg(HWND hParent, LPLSH_DLGINFO lpdlginfo); +int FAR Leash_changepwd_dlg_ex(HWND hParent, LPLSH_DLGINFO_EX lpdlginfo); + +long FAR Leash_checkpwd(char *principal, char *password); +long FAR Leash_changepwd(char *principal, char *password, char *newpassword, char** result_string); +long FAR Leash_kinit(char *principal, char *password, int lifetime); +long FAR Leash_kinit_ex(char * principal, char * password, int lifetime, + int forwardable, int proxiable, int renew_life, + int addressless, unsigned long publicIP); + +long FAR Leash_klist(HWND hlist, TICKETINFO FAR *ticketinfo); +long FAR Leash_kdestroy(void); +long FAR Leash_get_lsh_errno( LONG FAR *err_val); + +long FAR Leash_renew(void); +long FAR Leash_importable(void); +long FAR Leash_import(void); + +BOOL Leash_set_help_file( char FAR *szHelpFile ); +LPSTR Leash_get_help_file(void); + +void Leash_reset_defaults(void); + +#define NO_TICKETS 0 +#define EXPD_TICKETS 2 +#define GOOD_TICKETS 1 + +/* Leash Configuration functions - alters Current User Registry */ +DWORD Leash_get_default_lifetime(); +DWORD Leash_set_default_lifetime(DWORD minutes); +DWORD Leash_reset_default_lifetime(); +DWORD Leash_get_default_renew_till(); +DWORD Leash_set_default_renew_till(DWORD minutes); +DWORD Leash_reset_default_renew_till(); +DWORD Leash_get_default_renewable(); +DWORD Leash_set_default_renewable(DWORD onoff); +DWORD Leash_reset_default_renewable(); +DWORD Leash_get_default_forwardable(); +DWORD Leash_set_default_forwardable(DWORD onoff); +DWORD Leash_reset_default_forwardable(); +DWORD Leash_get_default_noaddresses(); +DWORD Leash_set_default_noaddresses(DWORD onoff); +DWORD Leash_reset_default_noaddresses(); +DWORD Leash_get_default_proxiable(); +DWORD Leash_set_default_proxiable(DWORD onoff); +DWORD Leash_reset_default_proxiable(); +DWORD Leash_get_default_publicip(); +DWORD Leash_set_default_publicip(DWORD ipv4addr); +DWORD Leash_reset_default_publicip(); +DWORD Leash_get_default_use_krb4(); +DWORD Leash_set_default_use_krb4(DWORD onoff); +DWORD Leash_reset_default_use_krb4(); +DWORD Leash_get_hide_kinit_options(); +DWORD Leash_set_hide_kinit_options(DWORD onoff); +DWORD Leash_reset_hide_kinit_options(); +DWORD Leash_get_default_life_min(); +DWORD Leash_set_default_life_min(DWORD minutes); +DWORD Leash_reset_default_life_min(); +DWORD Leash_get_default_life_max(); +DWORD Leash_set_default_life_max(DWORD minutes); +DWORD Leash_reset_default_life_max(); +DWORD Leash_get_default_renew_min(); +DWORD Leash_set_default_renew_min(DWORD minutes); +DWORD Leash_reset_default_renew_min(); +DWORD Leash_get_default_renew_max(); +DWORD Leash_set_default_renew_max(DWORD minutes); +DWORD Leash_reset_default_renew_max(); +DWORD Leash_get_lock_file_locations(); +DWORD Leash_set_lock_file_locations(DWORD onoff); +DWORD Leash_reset_lock_file_locations(); +DWORD Leash_get_default_uppercaserealm(); +DWORD Leash_set_default_uppercaserealm(DWORD onoff); +DWORD Leash_reset_default_uppercaserealm(); + +#endif /* LEASHWIN */ diff --git a/src/WINNT/kfw/inc/loadfuncs/loadfuncs-afs.h b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-afs.h new file mode 100644 index 000000000..be2023787 --- /dev/null +++ b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-afs.h @@ -0,0 +1,51 @@ +#ifndef __LOADFUNCS_AFS_H__ +#define __LOADFUNCS_AFS_H__ + +#include "loadfuncs.h" + +#define AFSTOKENS_DLL "libafstokens.dll" +#define AFSCONF_DLL "libafsconf.dll" + +#define CALLCONV_C +typedef long cm_configProc_t(void *, struct sockaddr_in *, char *); + +TYPEDEF_FUNC( + int, + CALLCONV_C, + ktc_ListTokens, + (int, int *, struct ktc_principal *) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + ktc_GetToken, + (struct ktc_principal *, struct ktc_token *, int, struct ktc_principal *) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + ktc_SetToken, + (struct ktc_principal *, struct ktc_principal *, struct ktc_token *, int) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + ktc_ForgetAllTokens, + () + ); + + +TYPEDEF_FUNC( + long, + CALLCONV_C, + cm_SearchCellFile, + (char *, cm_configProc_t *, void *) + ); +TYPEDEF_FUNC( + long, + CALLCONV_C, + cm_GetRootCellName, + (char *) + ); + +#endif /* __LOADFUNCS_AFS_H__ */ diff --git a/src/WINNT/kfw/inc/loadfuncs/loadfuncs-afs36.h b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-afs36.h new file mode 100644 index 000000000..974b8dbd3 --- /dev/null +++ b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-afs36.h @@ -0,0 +1,51 @@ +#ifndef __LOADFUNCS_AFS36_H__ +#define __LOADFUNCS_AFS36_H__ + +#include "loadfuncs.h" + +#define AFSTOKENS_DLL "afsauthent.dll" +#define AFSCONF_DLL "libafsconf.dll" + +#define CALLCONV_C +typedef long cm_configProc_t(void *, struct sockaddr_in *, char *); + +TYPEDEF_FUNC( + int, + CALLCONV_C, + ktc_ListTokens, + (int, int *, struct ktc_principal *) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + ktc_GetToken, + (struct ktc_principal *, struct ktc_token *, int, struct ktc_principal *) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + ktc_SetToken, + (struct ktc_principal *, struct ktc_token *, struct ktc_principal *, int) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + ktc_ForgetAllTokens, + () + ); + + +TYPEDEF_FUNC( + long, + CALLCONV_C, + cm_SearchCellFile, + (char *, char *, cm_configProc_t *, void *) + ); +TYPEDEF_FUNC( + long, + CALLCONV_C, + cm_GetRootCellName, + (char *) + ); + +#endif /* __LOADFUNCS_AFS_H__ */ diff --git a/src/WINNT/kfw/inc/loadfuncs/loadfuncs-com_err.h b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-com_err.h new file mode 100644 index 000000000..42e50a086 --- /dev/null +++ b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-com_err.h @@ -0,0 +1,40 @@ +#ifndef __LOADFUNCS_COM_ERR_H__ +#define __LOADFUNCS_COM_ERR_H__ + +#include "loadfuncs.h" +#include + +#define COMERR_DLL "comerr32.dll" + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV_C, + com_err, + (const char FAR *, errcode_t, const char FAR *, ...) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + com_err_va, + (const char FAR *whoami, errcode_t code, const char FAR *fmt, va_list ap) + ); +TYPEDEF_FUNC( + const char FAR *, + KRB5_CALLCONV, + error_message, + (errcode_t) + ); +TYPEDEF_FUNC( + errcode_t, + KRB5_CALLCONV, + add_error_table, + (const struct error_table FAR *) + ); +TYPEDEF_FUNC( + errcode_t, + KRB5_CALLCONV, + remove_error_table, + (const struct error_table FAR *) + ); + +#endif /* __LOADFUNCS_COM_ERR_H__ */ diff --git a/src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb.h b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb.h new file mode 100644 index 000000000..5ba4578ee --- /dev/null +++ b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb.h @@ -0,0 +1,306 @@ +#ifndef __LOADFUNCS_KRB_H__ +#define __LOADFUNCS_KRB_H__ + +#include "loadfuncs.h" +#include + +#define KRB4_DLL "krbv4w32.dll" + +#define krb_err_text(status) pget_krb_err_txt_entry(status) +#define CALLCONV_C + +TYPEDEF_FUNC( + char *, + CALLCONV_C, + tkt_string, + () + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + gettimeofday, + (struct timeval *tv, struct timezone *tz) + ); +TYPEDEF_FUNC( + int, + PASCAL, + krb_sendauth, + (long, int, KTEXT, char *, char *, char *, + unsigned long, MSG_DAT *, CREDENTIALS *, + Key_schedule *, struct sockaddr_in *, + struct sockaddr_in FAR *, char *) + ); +TYPEDEF_FUNC( + int, + PASCAL, + krb_mk_req, + (KTEXT, char *, char *, char *, long) + ); +TYPEDEF_FUNC( + char *, + PASCAL, + krb_getrealm, + (char *host) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + krb_get_tf_fullname, + (char FAR *, char FAR *, char FAR *, char FAR *) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + krb_get_tf_realm, + (char FAR *,char FAR *) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + tf_init, + (char FAR*,int) + ); +TYPEDEF_FUNC( + long, + CALLCONV_C, + LocalHostAddr, + () + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + tf_get_pname, + (char FAR*) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + tf_get_pinst, + (char FAR*) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + tf_get_cred, + (CREDENTIALS FAR*) + ); +TYPEDEF_FUNC( + void, + CALLCONV_C, + tf_close, + (void) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + tf_save_cred, + (char FAR*,char FAR*,char FAR*,C_Block,int,int,KTEXT,long) + ); +TYPEDEF_FUNC( + BOOL, + CALLCONV_C, + k_isinst, + (char FAR *s) + ); +TYPEDEF_FUNC( + BOOL, + CALLCONV_C, + k_isrealm, + (char FAR *s) + ); +TYPEDEF_FUNC( + BOOL, + CALLCONV_C, + k_isname, + (char FAR *s) + ); + +TYPEDEF_FUNC( + char **, + CALLCONV_C, + get_krb_err_txt, + (void) + ); + +/* Warning, unique to Windows! */ +TYPEDEF_FUNC( + int, + CALLCONV_C, + set_krb_debug, + (int) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + set_krb_ap_req_debug, + (int) + ); +TYPEDEF_FUNC( + char *, + PASCAL, + get_krb_err_txt_entry, + (int i) + ); +TYPEDEF_FUNC( + char *, + CALLCONV_C, + krb_err_func, + (int offset, long code) + ); +TYPEDEF_FUNC( + int, + PASCAL, + k_decomp_ticket, + (KTEXT, unsigned char *, char *, char *, char *, + unsigned long *, C_Block, int *, unsigned long *, + char *, char *, C_Block, Key_schedule) + ); +TYPEDEF_FUNC( + int, + PASCAL, + krb_mk_req, + (KTEXT,char *,char *,char *,long) + ); +TYPEDEF_FUNC( + char *, + PASCAL, + krb_getrealm, + (char *host) + ); +TYPEDEF_FUNC( + char *, + PASCAL, + krb_realmofhost, + (char *host) + ); +TYPEDEF_FUNC( + char *, + CALLCONV_C, + krb_get_phost, + (char *host) + ); + +TYPEDEF_FUNC( + int, + CALLCONV_C, + kname_parse, + (char *, char *, char *, char *) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + krb_get_pw_in_tkt, + (char *, char *, char *, char *, char *, int, char *) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + dest_tkt, + (void) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + krb_get_lrealm, + (char *, int) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + krb_check_serv, + (char*) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + krb_get_cred, + (char *, char *, char *, CREDENTIALS *) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + send_to_kdc, + (KTEXT, KTEXT, char *) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + create_ciph, + (KTEXT, C_Block, char *, char *, char *, unsigned long, int, + KTEXT, unsigned long, C_Block *) + ); +TYPEDEF_FUNC( + char *, + CALLCONV_C, + krb_get_krbconf2, + (char *, size_t *) + ); +TYPEDEF_FUNC( + char *, + CALLCONV_C, + krb_get_krbrealm2, + (char *, size_t *) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + krb_in_tkt, + (char *, char *, char *) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + krb_save_credentials, + (char *, char *, char *, C_Block, int, int, KTEXT, long) + ); + +/* NOT IN krb.h HEADER: */ + +TYPEDEF_FUNC( + int, + CALLCONV_C, + k_gethostname, + (char FAR*, int) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + krb_get_krbhst, + (char *, char *, int) + ); +TYPEDEF_FUNC( + void, + CALLCONV_C, + krb_set_tkt_string, + (char *) + ); + +/* Evil incarnate... */ + +TYPEDEF_FUNC( + long, + CALLCONV_C, + kadm_change_your_password, + (LPSTR principal, LPSTR old_password, + LPSTR new_password, HANDLE FAR * hInfo_desc) + ); +TYPEDEF_FUNC( + void, + CALLCONV_C, + initialize_krb_error_func, + (void* func, HANDLE *__et_list) + ); +TYPEDEF_FUNC( + void, + CALLCONV_C, + initialize_kadm_error_table, + (HANDLE *__et_list) + ); +TYPEDEF_FUNC( + LONG, + CALLCONV_C, + lsh_LoadKrb4LeashErrorTables, + (HMODULE hLeashDll, INT useCallBackFunction) + ); + +#endif /* __LOADFUNCS_KRB_H__ */ diff --git a/src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb5.h b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb5.h new file mode 100644 index 000000000..46827f64c --- /dev/null +++ b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb5.h @@ -0,0 +1,1737 @@ +#ifndef __LOADFUNCS_KRB5_H__ +#define __LOADFUNCS_KRB5_H__ + +#include "loadfuncs.h" +#include + +#define KRB5_DLL "krb5_32.dll" + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_principal, + (krb5_context, krb5_principal) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_authenticator, + (krb5_context, krb5_authenticator * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_authenticator_contents, + (krb5_context, krb5_authenticator * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_addresses, + (krb5_context, krb5_address * * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_address, + (krb5_context, krb5_address * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_authdata, + (krb5_context, krb5_authdata * * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_enc_tkt_part, + (krb5_context, krb5_enc_tkt_part * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_ticket, + (krb5_context, krb5_ticket * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_tickets, + (krb5_context, krb5_ticket * * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_kdc_req, + (krb5_context, krb5_kdc_req * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_kdc_rep, + (krb5_context, krb5_kdc_rep * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_last_req, + (krb5_context, krb5_last_req_entry * * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_enc_kdc_rep_part, + (krb5_context, krb5_enc_kdc_rep_part * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_error, + (krb5_context, krb5_error * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_ap_req, + (krb5_context, krb5_ap_req * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_ap_rep, + (krb5_context, krb5_ap_rep * ) + ); + +/* Removed around the time of krb5_rc_* change... */ +#if 0 +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_safe, + (krb5_context, krb5_safe * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_priv, + (krb5_context, krb5_priv * ) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_priv_enc_part, + (krb5_context, krb5_priv_enc_part * ) + ); +#endif + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_cred, + (krb5_context, krb5_cred *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_creds, + (krb5_context, krb5_creds *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_cred_contents, + (krb5_context, krb5_creds *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_cred_enc_part, + (krb5_context, krb5_cred_enc_part *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_checksum, + (krb5_context, krb5_checksum *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_checksum_contents, + (krb5_context, krb5_checksum *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_keyblock, + (krb5_context, krb5_keyblock *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_keyblock_contents, + (krb5_context, krb5_keyblock *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_pa_data, + (krb5_context, krb5_pa_data * *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_ap_rep_enc_part, + (krb5_context, krb5_ap_rep_enc_part *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_tkt_authent, + (krb5_context, krb5_tkt_authent *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_pwd_data, + (krb5_context, krb5_pwd_data *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_pwd_sequences, + (krb5_context, passwd_phrase_element * *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_data, + (krb5_context, krb5_data *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_data_contents, + (krb5_context, krb5_data *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_unparsed_name, + (krb5_context, char *) + ); +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_cksumtypes, + (krb5_context, krb5_cksumtype *) + ); + +/* ------------------------------------------------------------------------- */ + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_c_encrypt, + (krb5_context context, const krb5_keyblock *key, + krb5_keyusage usage, const krb5_data *ivec, + const krb5_data *input, krb5_enc_data *output) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_c_decrypt, + (krb5_context context, const krb5_keyblock *key, + krb5_keyusage usage, const krb5_data *ivec, + const krb5_enc_data *input, krb5_data *output) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_c_encrypt_length, + (krb5_context context, krb5_enctype enctype, + size_t inputlen, size_t *length) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_c_block_size, + (krb5_context context, krb5_enctype enctype, + size_t *blocksize) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_c_make_random_key, + (krb5_context context, krb5_enctype enctype, + krb5_keyblock *random_key) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_c_random_make_octets, + (krb5_context context, krb5_data *data) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_c_random_seed, + (krb5_context context, krb5_data *data) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_c_string_to_key, + (krb5_context context, krb5_enctype enctype, + const krb5_data *string, const krb5_data *salt, + krb5_keyblock *key) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_c_enctype_compare, + (krb5_context context, krb5_enctype e1, krb5_enctype e2, + krb5_boolean *similar) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_c_make_checksum, + (krb5_context context, krb5_cksumtype cksumtype, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *input, krb5_checksum *cksum) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_c_verify_checksum, + (krb5_context context, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *data, + const krb5_checksum *cksum, + krb5_boolean *valid) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_c_checksum_length, + (krb5_context context, krb5_cksumtype cksumtype, + size_t *length) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_c_keyed_checksum_types, + (krb5_context context, krb5_enctype enctype, + unsigned int *count, krb5_cksumtype **cksumtypes) + ); + +/* ------------------------------------------------------------------------- */ + +TYPEDEF_FUNC( + krb5_boolean, + KRB5_CALLCONV, + valid_enctype, + (const krb5_enctype ktype) + ); + +TYPEDEF_FUNC( + krb5_boolean, + KRB5_CALLCONV, + valid_cksumtype, + (const krb5_cksumtype ctype) + ); + +TYPEDEF_FUNC( + krb5_boolean, + KRB5_CALLCONV, + is_coll_proof_cksum, + (const krb5_cksumtype ctype) + ); + +TYPEDEF_FUNC( + krb5_boolean, + KRB5_CALLCONV, + is_keyed_cksum, + (const krb5_cksumtype ctype) + ); + +/* ------------------------------------------------------------------------- */ + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_init_context, + (krb5_context *) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_context, + (krb5_context) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_decrypt_tkt_part, + (krb5_context, + const krb5_keyblock *, + krb5_ticket * ) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_tgt_creds, + (krb5_context, + krb5_creds ** ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_credentials, + (krb5_context, + const krb5_flags, + krb5_ccache, + krb5_creds *, + krb5_creds * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_credentials_validate, + (krb5_context, + const krb5_flags, + krb5_ccache, + krb5_creds *, + krb5_creds * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_credentials_renew, + (krb5_context, + const krb5_flags, + krb5_ccache, + krb5_creds *, + krb5_creds * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_mk_req, + (krb5_context, + krb5_auth_context *, + const krb5_flags, + char *, + char *, + krb5_data *, + krb5_ccache, + krb5_data * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_mk_req_extended, + (krb5_context, + krb5_auth_context *, + const krb5_flags, + krb5_data *, + krb5_creds *, + krb5_data * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_mk_rep, + (krb5_context, + krb5_auth_context, + krb5_data *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_rd_rep, + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_ap_rep_enc_part * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_mk_error, + (krb5_context, + const krb5_error *, + krb5_data * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_rd_error, + (krb5_context, + const krb5_data *, + krb5_error * * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_rd_safe, + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_data *, + krb5_replay_data *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_rd_priv, + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_data *, + krb5_replay_data *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_parse_name, + (krb5_context, + const char *, + krb5_principal * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_unparse_name, + (krb5_context, + krb5_const_principal, + char * * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_unparse_name_ext, + (krb5_context, + krb5_const_principal, + char * *, + int *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_set_principal_realm, + (krb5_context, krb5_principal, const char *) + ); + +TYPEDEF_FUNC( + krb5_boolean, + KRB5_CALLCONV, + krb5_principal_compare, + (krb5_context, + krb5_const_principal, + krb5_const_principal) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_copy_keyblock, + (krb5_context, + const krb5_keyblock *, + krb5_keyblock * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_copy_keyblock_contents, + (krb5_context, + const krb5_keyblock *, + krb5_keyblock *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_copy_creds, + (krb5_context, + const krb5_creds *, + krb5_creds * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_copy_data, + (krb5_context, + const krb5_data *, + krb5_data * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_copy_principal, + (krb5_context, + krb5_const_principal, + krb5_principal *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_copy_addr, + (krb5_context, + const krb5_address *, + krb5_address * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_copy_addresses, + (krb5_context, + krb5_address * const *, + krb5_address * * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_copy_ticket, + (krb5_context, + const krb5_ticket *, + krb5_ticket * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_copy_authdata, + (krb5_context, + krb5_authdata * const *, + krb5_authdata * * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_copy_authenticator, + (krb5_context, + const krb5_authenticator *, + krb5_authenticator * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_copy_checksum, + (krb5_context, + const krb5_checksum *, + krb5_checksum * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_server_rcache, + (krb5_context, + const krb5_data *, krb5_rcache *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV_C, + krb5_build_principal_ext, + (krb5_context, krb5_principal *, int, const char *, ...) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV_C, + krb5_build_principal, + (krb5_context, krb5_principal *, int, const char *, ...) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_425_conv_principal, + (krb5_context, + const char *name, + const char *instance, const char *realm, + krb5_principal *princ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_524_conv_principal, + (krb5_context context, const krb5_principal princ, + char *name, char *inst, char *realm) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_mk_chpw_req, + (krb5_context context, krb5_auth_context auth_context, + krb5_data *ap_req, char *passwd, krb5_data *packet) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_rd_chpw_rep, + (krb5_context context, krb5_auth_context auth_context, + krb5_data *packet, int *result_code, + krb5_data *result_data) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_chpw_result_code_string, + (krb5_context context, int result_code, + char **result_codestr) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_register, + (krb5_context, + struct _krb5_kt_ops * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_resolve, + (krb5_context, + const char *, + krb5_keytab * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_default_name, + (krb5_context, + char *, + int ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_default, + (krb5_context, + krb5_keytab * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_free_entry, + (krb5_context, + krb5_keytab_entry * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_remove_entry, + (krb5_context, + krb5_keytab, + krb5_keytab_entry * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_add_entry, + (krb5_context, + krb5_keytab, + krb5_keytab_entry * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_resolve, + (krb5_context, + const char *, + krb5_ccache * ) + ); + +TYPEDEF_FUNC( + const char*, + KRB5_CALLCONV, + krb5_cc_default_name, + (krb5_context) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_set_default_name, + (krb5_context, const char *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_default, + (krb5_context, + krb5_ccache *) + ); + +TYPEDEF_FUNC( + unsigned int, + KRB5_CALLCONV, + krb5_get_notification_message, + (void) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_copy_creds, + (krb5_context context, + krb5_ccache incc, + krb5_ccache outcc) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_us_timeofday, + (krb5_context, + krb5_int32 *, + krb5_int32 * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_timeofday, + (krb5_context, + krb5_int32 * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_os_localaddr, + (krb5_context, + krb5_address * * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_default_realm, + (krb5_context, + char * * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_set_default_realm, + (krb5_context, + const char * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_sname_to_principal, + (krb5_context, + const char *, + const char *, + krb5_int32, + krb5_principal *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_change_password, + (krb5_context context, krb5_creds *creds, char *newpw, + int *result_code, krb5_data *result_code_string, + krb5_data *result_string) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_default_config_files, + (char ***filenames) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_config_files, + (char **filenames) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_in_tkt, + (krb5_context, + const krb5_flags, + krb5_address * const *, + krb5_enctype *, + krb5_preauthtype *, + krb5_error_code ( * )(krb5_context, + const krb5_enctype, + krb5_data *, + krb5_const_pointer, + krb5_keyblock * *), + krb5_const_pointer, + krb5_error_code ( * )(krb5_context, + const krb5_keyblock *, + krb5_const_pointer, + krb5_kdc_rep * ), + krb5_const_pointer, + krb5_creds *, + krb5_ccache, + krb5_kdc_rep * * ) + ); + + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_in_tkt_with_password, + (krb5_context, + const krb5_flags, + krb5_address * const *, + krb5_enctype *, + krb5_preauthtype *, + const char *, + krb5_ccache, + krb5_creds *, + krb5_kdc_rep * * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_in_tkt_with_skey, + (krb5_context, + const krb5_flags, + krb5_address * const *, + krb5_enctype *, + krb5_preauthtype *, + const krb5_keyblock *, + krb5_ccache, + krb5_creds *, + krb5_kdc_rep * * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_in_tkt_with_keytab, + (krb5_context, + const krb5_flags, + krb5_address * const *, + krb5_enctype *, + krb5_preauthtype *, + const krb5_keytab, + krb5_ccache, + krb5_creds *, + krb5_kdc_rep * * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_rd_req, + (krb5_context, + krb5_auth_context *, + const krb5_data *, + krb5_const_principal, + krb5_keytab, + krb5_flags *, + krb5_ticket * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_read_service_key, + (krb5_context, + krb5_pointer, + krb5_principal, + krb5_kvno, + krb5_enctype, + krb5_keyblock * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_mk_safe, + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_data *, + krb5_replay_data *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_mk_priv, + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_data *, + krb5_replay_data *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_register, + (krb5_context, + krb5_cc_ops *, + krb5_boolean ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_sendauth, + (krb5_context, + krb5_auth_context *, + krb5_pointer, + char *, + krb5_principal, + krb5_principal, + krb5_flags, + krb5_data *, + krb5_creds *, + krb5_ccache, + krb5_error * *, + krb5_ap_rep_enc_part * *, + krb5_creds * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_recvauth, + (krb5_context, + krb5_auth_context *, + krb5_pointer, + char *, + krb5_principal, + krb5_int32, + krb5_keytab, + krb5_ticket * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_mk_ncred, + (krb5_context, + krb5_auth_context, + krb5_creds * *, + krb5_data * *, + krb5_replay_data *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_mk_1cred, + (krb5_context, + krb5_auth_context, + krb5_creds *, + krb5_data * *, + krb5_replay_data *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_rd_cred, + (krb5_context, + krb5_auth_context, + krb5_data *, + krb5_creds * * *, + krb5_replay_data *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_fwd_tgt_creds, + (krb5_context, + krb5_auth_context, + char *, + krb5_principal, + krb5_principal, + krb5_ccache, + int forwardable, + krb5_data *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_init, + (krb5_context, + krb5_auth_context *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_free, + (krb5_context, + krb5_auth_context) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_setflags, + (krb5_context, + krb5_auth_context, + krb5_int32) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_getflags, + (krb5_context, + krb5_auth_context, + krb5_int32 *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_setuseruserkey, + (krb5_context, + krb5_auth_context, + krb5_keyblock *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_getkey, + (krb5_context, + krb5_auth_context, + krb5_keyblock **) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_getlocalsubkey, + (krb5_context, + krb5_auth_context, + krb5_keyblock * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_set_req_cksumtype, + (krb5_context, + krb5_auth_context, + krb5_cksumtype) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_getlocalseqnumber, + (krb5_context, + krb5_auth_context, + krb5_int32 *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_getremoteseqnumber, + (krb5_context, + krb5_auth_context, + krb5_int32 *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_setrcache, + (krb5_context, + krb5_auth_context, + krb5_rcache) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_getauthenticator, + (krb5_context, + krb5_auth_context, + krb5_authenticator * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_getremotesubkey, + (krb5_context, + krb5_auth_context, + krb5_keyblock * *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_read_password, + (krb5_context, + const char *, + const char *, + char *, + int * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_host_realm, + (krb5_context, + const char *, + char * * * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_free_host_realm, + (krb5_context, + char * const * ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_realm_domain, + (krb5_context, + const char *, + char ** ) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_auth_con_genaddrs, + (krb5_context, + krb5_auth_context, + int, int) + ); + +/* ------------------------------------------------------------------------- */ + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_string_to_enctype, + (char *, krb5_enctype *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_string_to_salttype, + (char *, krb5_int32 *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_string_to_cksumtype, + (char *, krb5_cksumtype *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_string_to_timestamp, + (char *, krb5_timestamp *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_string_to_deltat, + (char *, krb5_deltat *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_enctype_to_string, + (krb5_enctype, char *, size_t) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_salttype_to_string, + (krb5_int32, char *, size_t) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cksumtype_to_string, + (krb5_cksumtype, char *, size_t) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_timestamp_to_string, + (krb5_timestamp, char *, size_t) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_timestamp_to_sfstring, + (krb5_timestamp, char *, size_t, char *) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_deltat_to_string, + (krb5_deltat, char *, size_t) + ); + +/* ------------------------------------------------------------------------- */ + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_prompter_posix, + (krb5_context context, + void *data, + const char *name, + const char *banner, + int num_prompts, + krb5_prompt prompts[]) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_get_init_creds_opt_init, + (krb5_get_init_creds_opt *opt) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_get_init_creds_opt_set_tkt_life, + (krb5_get_init_creds_opt *opt, + krb5_deltat tkt_life) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_get_init_creds_opt_set_renew_life, + (krb5_get_init_creds_opt *opt, + krb5_deltat renew_life) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_get_init_creds_opt_set_forwardable, + (krb5_get_init_creds_opt *opt, + int forwardable) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_get_init_creds_opt_set_proxiable, + (krb5_get_init_creds_opt *opt, + int proxiable) + ); + + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_get_init_creds_opt_set_etype_list, + (krb5_get_init_creds_opt *opt, + krb5_enctype *etype_list, + int etype_list_length) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_get_init_creds_opt_set_address_list, + (krb5_get_init_creds_opt *opt, + krb5_address **addresses) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_get_init_creds_opt_set_preauth_list, + (krb5_get_init_creds_opt *opt, + krb5_preauthtype *preauth_list, + int preauth_list_length) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_get_init_creds_opt_set_salt, + (krb5_get_init_creds_opt *opt, + krb5_data *salt) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_init_creds_password, + (krb5_context context, + krb5_creds *creds, + krb5_principal client, + char *password, + krb5_prompter_fct prompter, + void *data, + krb5_deltat start_time, + char *in_tkt_service, + krb5_get_init_creds_opt *options) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_init_creds_keytab, + (krb5_context context, + krb5_creds *creds, + krb5_principal client, + krb5_keytab arg_keytab, + krb5_deltat start_time, + char *in_tkt_service, + krb5_get_init_creds_opt *options) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_verify_init_creds_opt_init, + (krb5_verify_init_creds_opt *options) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_verify_init_creds_opt_set_ap_req_nofail, + (krb5_verify_init_creds_opt *options, + int ap_req_nofail) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_verify_init_creds, + (krb5_context context, + krb5_creds *creds, + krb5_principal ap_req_server, + krb5_keytab ap_req_keytab, + krb5_ccache *ccache, + krb5_verify_init_creds_opt *options) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_validated_creds, + (krb5_context context, + krb5_creds *creds, + krb5_principal client, + krb5_ccache ccache, + char *in_tkt_service) + ); + + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_get_renewed_creds, + (krb5_context context, + krb5_creds *creds, + krb5_principal client, + krb5_ccache ccache, + char *in_tkt_service) + ); + +/* ------------------------------------------------------------------------- */ + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_realm_iterator_create, + (krb5_context context, void **iter_p) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_realm_iterator, + (krb5_context context, void **iter_p, char **ret_realm) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_realm_iterator_free, + (krb5_context context, void **iter_p) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + krb5_free_realm_string, + (krb5_context context, char *str) + ); + +TYPEDEF_FUNC( + krb5_prompt_type*, + KRB5_CALLCONV, + krb5_get_prompt_types, + (krb5_context context) + ); + +/* NOT IN krb5.h HEADER: */ + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_decode_ticket, + (const krb5_data *code, krb5_ticket **rep) + ); + +/* --- more --- */ + +TYPEDEF_FUNC( + char *, + KRB5_CALLCONV, + krb5_cc_get_name, + (krb5_context context, krb5_ccache cache) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_gen_new, + (krb5_context context, krb5_ccache *cache) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_initialize, + (krb5_context context, krb5_ccache cache, krb5_principal principal) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_destroy, + (krb5_context context, krb5_ccache cache) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_close, + (krb5_context context, krb5_ccache cache) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_store_cred, + (krb5_context context, krb5_ccache cache, krb5_creds *creds) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_retrieve_cred, + (krb5_context context, krb5_ccache cache, + krb5_flags flags, krb5_creds *mcreds, + krb5_creds *creds) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_get_principal, + (krb5_context context, krb5_ccache cache, krb5_principal *principal) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_start_seq_get, + (krb5_context context, krb5_ccache cache, krb5_cc_cursor *cursor) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_next_cred, + (krb5_context context, krb5_ccache cache, krb5_cc_cursor *cursor, + krb5_creds *creds) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_end_seq_get, + (krb5_context context, krb5_ccache cache, krb5_cc_cursor *cursor) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_remove_cred, + (krb5_context context, krb5_ccache cache, krb5_flags flags, + krb5_creds *creds) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_cc_set_flags, + (krb5_context context, krb5_ccache cache, krb5_flags flags) + ); + +TYPEDEF_FUNC( + const char *, + KRB5_CALLCONV, + krb5_cc_get_type, + (krb5_context context, krb5_ccache cache) + ); + +TYPEDEF_FUNC( + char *, + KRB5_CALLCONV, + krb5_kt_get_type, + (krb5_context, krb5_keytab keytab) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_get_name, + (krb5_context context, krb5_keytab keytab, char *name, + unsigned int namelen) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_close, + (krb5_context context, krb5_keytab keytab) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_get_entry, + (krb5_context context, krb5_keytab keytab, + krb5_const_principal principal, krb5_kvno vno, + krb5_enctype enctype, krb5_keytab_entry *entry) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_start_seq_get, + (krb5_context context, krb5_keytab keytab, krb5_kt_cursor *cursor) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_next_entry, + (krb5_context context, krb5_keytab keytab, + krb5_keytab_entry *entry, krb5_kt_cursor *cursor) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_kt_end_seq_get, + (krb5_context context, krb5_keytab keytab, krb5_kt_cursor *cursor) + ); + +TYPEDEF_FUNC( + krb5_error_code, + KRB5_CALLCONV, + krb5_locate_kdc, + (krb5_context context, const krb5_data *realm, + struct addrlist *addrlist, + int get_masters, int socktype, int family) + ); +#endif /* __LOADFUNCS_KRB5_H__ */ diff --git a/src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb524.h b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb524.h new file mode 100644 index 000000000..18f427414 --- /dev/null +++ b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-krb524.h @@ -0,0 +1,23 @@ +#ifndef __LOADFUNCS_KRB524_H__ +#define __LOADFUNCS_KRB524_H__ + +#include "loadfuncs.h" +#include +#include + +#define KRB524_DLL "krb524.dll" + +TYPEDEF_FUNC( + int, + KRB5_CALLCONV_C, + krb524_init_ets, + (krb5_context context) + ); +TYPEDEF_FUNC( + int, + KRB5_CALLCONV_C, + krb524_convert_creds_kdc, + (krb5_context context, krb5_creds *v5creds, + CREDENTIALS *v4creds) + ); +#endif /* __LOADFUNCS_KRB524_H__ */ diff --git a/src/WINNT/kfw/inc/loadfuncs/loadfuncs-leash.h b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-leash.h new file mode 100644 index 000000000..4222245d8 --- /dev/null +++ b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-leash.h @@ -0,0 +1,373 @@ +#ifndef __LOADFUNCS_LEASH_H__ +#define __LOADFUNCS_LEASH_H__ + +#include "loadfuncs.h" +#include + +#define LEASH_DLL "leashw32.dll" + +#define CALLCONV_C + +TYPEDEF_FUNC( + int, + CALLCONV_C, + Leash_kinit_dlg, + (HWND, LPLSH_DLGINFO) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + Leash_kinit_dlg_ex, + (HWND, LPLSH_DLGINFO_EX) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + Leash_changepwd_dlg, + (HWND, LPLSH_DLGINFO) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + Leash_changepwd_dlg_ex, + (HWND, LPLSH_DLGINFO_EX) + ); +TYPEDEF_FUNC( + long, + CALLCONV_C, + Leash_checkpwd, + (char *, char *) + ); +TYPEDEF_FUNC( + long, + CALLCONV_C, + Leash_changepwd, + (char *, char *, char*, char*) + ); +TYPEDEF_FUNC( + long, + CALLCONV_C, + Leash_kinit, + (char *, char *, int) + ); +TYPEDEF_FUNC( + long, + CALLCONV_C, + Leash_kinit_ex, + (char *, char *, int,int, int, int, int, unsigned long) + ); +TYPEDEF_FUNC( + long, + CALLCONV_C, + Leash_klist, + (HWND, TICKETINFO*) + ); +TYPEDEF_FUNC( + long, + CALLCONV_C, + Leash_kdestroy, + (void) + ); +TYPEDEF_FUNC( + long, + CALLCONV_C, + Leash_get_lsh_errno, + (LONG *) + ); +TYPEDEF_FUNC( + BOOL, + CALLCONV_C, + Leash_set_help_file, + (char *) + ); +TYPEDEF_FUNC( + char *, + CALLCONV_C, + Leash_get_help_file, + (void) + ); +TYPEDEF_FUNC( + long, + CALLCONV_C, + Leash_timesync, + (int) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_default_lifetime, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_default_lifetime, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_default_lifetime, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_default_renew_till, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_default_renew_till, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_default_renew_till, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_default_forwardable, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_default_forwardable, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_default_forwardable, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_default_noaddresses, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_default_noaddresses, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_default_noaddresses, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_default_proxiable, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_default_proxiable, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_default_proxiable, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_default_publicip, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_default_publicip, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_default_publicip, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_default_use_krb4, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_default_use_krb4, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_default_use_krb4, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_default_life_min, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_default_life_min, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_default_life_min, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_default_life_max, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_default_life_max, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_default_life_max, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_default_renew_min, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_default_renew_min, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_default_renew_min, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_default_renew_max, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_default_renew_max, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_default_renew_max, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_default_renewable, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_default_renewable, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_default_renewable, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_lock_file_locations, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_lock_file_locations, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_lock_file_locations, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_get_default_uppercaserealm, + (void) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_set_default_uppercaserealm, + (DWORD) + ); +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + Leash_reset_default_uppercaserealm, + (void) + ); +TYPEDEF_FUNC( + BOOL, + CALLCONV_C, + Leash_import, + (void) + ); +TYPEDEF_FUNC( + long, + CALLCONV_C, + Leash_importable, + (void) + ); +TYPEDEF_FUNC( + int, + CALLCONV_C, + Leash_renew, + (void) + ); +TYPEDEF_FUNC( + void, + CALLCONV_C, + Leash_reset_defaults, + (void) + ); +/* They are not yet all here... */ + +#endif /* __LOADFUNCS_LEASH_H__ */ diff --git a/src/WINNT/kfw/inc/loadfuncs/loadfuncs-lsa.h b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-lsa.h new file mode 100644 index 000000000..0393edf73 --- /dev/null +++ b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-lsa.h @@ -0,0 +1,45 @@ +#ifndef __LOADFUNCS_LSA_H__ +#define __LOADFUNCS_LSA_H__ + +#include "loadfuncs.h" + +#define SECUR32_DLL "secur32.dll" +#define ADVAPI32_DLL "advapi32.dll" + +TYPEDEF_FUNC( + NTSTATUS, + NTAPI, + LsaConnectUntrusted, + (PHANDLE) + ); +TYPEDEF_FUNC( + NTSTATUS, + NTAPI, + LsaLookupAuthenticationPackage, + (HANDLE, PLSA_STRING, PULONG) + ); +TYPEDEF_FUNC( + NTSTATUS, + NTAPI, + LsaCallAuthenticationPackage, + (HANDLE, ULONG, PVOID, ULONG, PVOID *, PULONG, PNTSTATUS) + ); +TYPEDEF_FUNC( + NTSTATUS, + NTAPI, + LsaFreeReturnBuffer, + (PVOID) + ); +TYPEDEF_FUNC( + ULONG, + NTAPI, + LsaNtStatusToWinError, + (NTSTATUS) + ); +TYPEDEF_FUNC( + ULONG, + NTAPI, + LsaGetLogonSessionData, + (PLUID, PSECURITY_LOGON_SESSION_DATA*) + ); +#endif /* __LOADFUNCS_LSA_H__ */ diff --git a/src/WINNT/kfw/inc/loadfuncs/loadfuncs-profile.h b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-profile.h new file mode 100644 index 000000000..d7c21655b --- /dev/null +++ b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-profile.h @@ -0,0 +1,147 @@ +#ifndef __LOADFUNCS_PROFILE_H__ +#define __LOADFUNCS_PROFILE_H__ + +#include "loadfuncs.h" +#include + +#define PROFILE_DLL "xpprof32.dll" + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_init, + (const_profile_filespec_t *files, profile_t *ret_profile) + ); + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_init_path, + (const_profile_filespec_list_t filelist, profile_t *ret_profile) + ); + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_flush, + (profile_t profile) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + profile_abandon, + (profile_t profile) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + profile_release, + (profile_t profile) + ); + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_get_values, + (profile_t profile, const char **names, char ***ret_values) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + profile_free_list, + (char **list) + ); + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_get_string, + (profile_t profile, const char *name, const char *subname, + const char *subsubname, const char *def_val, + char **ret_string) + ); + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_get_integer, + (profile_t profile, const char *name, const char *subname, + const char *subsubname, int def_val, + int *ret_default) + ); + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_get_relation_names, + (profile_t profile, const char **names, char ***ret_names) + ); + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_get_subsection_names, + (profile_t profile, const char **names, char ***ret_names) + ); + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_iterator_create, + (profile_t profile, const char **names, int flags, void **ret_iter) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + profile_iterator_free, + (void **iter_p) + ); + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_iterator, + (void **iter_p, char **ret_name, char **ret_value) + ); + +TYPEDEF_FUNC( + void, + KRB5_CALLCONV, + profile_release_string, + (char *str) + ); + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_update_relation, + (profile_t profile, const char **names, const char *old_value, const char *new_value) + ); + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_clear_relation, + (profile_t profile, const char **names) + ); + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_rename_section, + (profile_t profile, const char **names, const char *new_name) + ); + +TYPEDEF_FUNC( + long, + KRB5_CALLCONV, + profile_add_relation, + (profile_t profile, const char **names, const char *new_value) + ); + + +#endif /* __LOADFUNCS_PROFILE_H__ */ diff --git a/src/WINNT/kfw/inc/loadfuncs/loadfuncs-wshelper.h b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-wshelper.h new file mode 100644 index 000000000..35780c588 --- /dev/null +++ b/src/WINNT/kfw/inc/loadfuncs/loadfuncs-wshelper.h @@ -0,0 +1,232 @@ +#ifndef __LOADFUNCS_WSHELPER_H__ +#define __LOADFUNCS_WSHELPER_H__ + +#include +#include + +#define WSHELPER_DLL "wshelp32.dll" +#define CALLCONV_C + +TYPEDEF_FUNC( + struct hostent *, + WINAPI, + rgethostbyname, + (char *name) + ); + +TYPEDEF_FUNC( + struct hostent *, + WINAPI, + rgethostbyaddr, + (char* addr, int len, int type) + ); + +TYPEDEF_FUNC( + struct servent, + WINAPI, + rgetservbyname, + (LPSTR name, LPSTR proto) + ); + +TYPEDEF_FUNC( + LPSTR, + WINAPI, + gethinfobyname, + (LPSTR name) + ); + +TYPEDEF_FUNC( + LPSTR, + WINAPI, + getmxbyname, + (LPSTR name) + ); + +TYPEDEF_FUNC( + LPSTR, + WINAPI, + getrecordbyname, + (LPSTR name, int rectype) + ); + +TYPEDEF_FUNC( + DWORD, + WINAPI, + rrhost, + (LPSTR lpHost) + ); + +TYPEDEF_FUNC( + unsigned long, + WINAPI, + inet_aton, + (const char* cp, struct in_addr *addr) + ); + +TYPEDEF_FUNC( + DWORD, + CALLCONV_C, + WhichOS, + (DWORD * check) + ); + +TYPEDEF_FUNC( + int, + WINAPI, + wsh_gethostname, + (char* name, int size) + ); + +TYPEDEF_FUNC( + int, + WINAPI, + wsh_getdomainname, + (char* name, int size) + ); + +TYPEDEF_FUNC( + LONG, + CALLCONV_C, + WSHGetHostID, + () + ); + +TYPEDEF_FUNC( + int, + WINAPI, + res_init, + () + ); + +TYPEDEF_FUNC( + void, + WINAPI, + res_setopts, + (long opts) + ); + +TYPEDEF_FUNC( + long, + WINAPI, + res_getopts, + (void) + ); + +TYPEDEF_FUNC( + int, + WINAPI, + res_mkquery, + (int op, const char FAR *dname, + int qclass, int type, + const char FAR *data, int datalen, + const struct rrec FAR *newrr, + char FAR *buf, int buflen) + ); + +TYPEDEF_FUNC( + int, + WINAPI, + res_send, + (const char FAR *msg, int msglen, + char FAR *answer, int anslen) + ); + +TYPEDEF_FUNC( + int, + WINAPI, + res_querydomain, + (const char FAR *name, + const char FAR *domain, + int qclass, int type, + u_char FAR *answer, int anslen) + ); + +TYPEDEF_FUNC( + int, + WINAPI, + res_search, + (const char FAR *name, + int qclass, int type, + u_char FAR *answer, int anslen) + ); + +TYPEDEF_FUNC( + int, + WINAPI, + dn_comp, + (const u_char FAR *exp_dn, + u_char FAR *comp_dn, + int length, u_char FAR * FAR *dnptrs, + u_char FAR * FAR *lastdnptr) + ); + +TYPEDEF_FUNC( + int, + WINAPI, + rdn_expand, + (const u_char FAR *msg, + const u_char FAR *eomorig, + const u_char FAR *comp_dn, + u_char FAR *exp_dn, + int length) + ); + +TYPEDEF_FUNC( + LPSTR, + WINAPI, + hes_to_bind, + ( + LPSTR HesiodName, + LPSTR HesiodNameType + ) + ); + +TYPEDEF_FUNC( + LPSTR *, + WINAPI, + hes_resolve, + ( + LPSTR HesiodName, + LPSTR HesiodNameType + ) + ); + +TYPEDEF_FUNC( + int, + WINAPI, + hes_error, + ( + void + ) + ); + +TYPEDEF_FUNC( + struct hes_postoffice *, + WINAPI, + hes_getmailhost, + (LPSTR user) + ); + +TYPEDEF_FUNC( + struct servent *, + WINAPI, + hes_getservbyname, + (LPSTR name, + LPSTR proto) + ); + +TYPEDEF_FUNC( + struct passwd *, + WINAPI, + hes_getpwnam, + (LPSTR nam) + ); + +TYPEDEF_FUNC( + struct passwd *, + WINAPI, + hes_getpwuid, + (int uid) + ); + +#endif /* __LOADFUNCS_WSHELPER_H__ */ diff --git a/src/WINNT/kfw/inc/loadfuncs/loadfuncs.c b/src/WINNT/kfw/inc/loadfuncs/loadfuncs.c new file mode 100644 index 000000000..46cacfd9f --- /dev/null +++ b/src/WINNT/kfw/inc/loadfuncs/loadfuncs.c @@ -0,0 +1,88 @@ +#define WIN32_LEAN_AND_MEAN +#include +#include "loadfuncs.h" + +// +// UnloadFuncs: +// +// This function will reset all the function pointers of a function loaded +// by LaodFuncs and will free the DLL instance provided. +// + +void +UnloadFuncs( + FUNC_INFO fi[], + HINSTANCE h + ) +{ + int n; + if (fi) + for (n = 0; fi[n].func_ptr_var; n++) + *(fi[n].func_ptr_var) = 0; + if (h) FreeLibrary(h); +} + + +// +// LoadFuncs: +// +// This function try to load the functions for a DLL. It returns 0 on failure +// and non-zero on success. The parameters are descibed below. +// + +int +LoadFuncs( + const char* dll_name, + FUNC_INFO fi[], + HINSTANCE* ph, // [out, optional] - DLL handle + int* pindex, // [out, optional] - index of last func loaded (-1 if none) + int cleanup, // cleanup function pointers and unload on error + int go_on, // continue loading even if some functions cannot be loaded + int silent // do not pop-up a system dialog if DLL cannot be loaded + + ) +{ + HINSTANCE h; + int i, n, last_i; + int error = 0; + UINT em; + + if (ph) *ph = 0; + if (pindex) *pindex = -1; + + for (n = 0; fi[n].func_ptr_var; n++) + *(fi[n].func_ptr_var) = 0; + + if (silent) + em = SetErrorMode(SEM_FAILCRITICALERRORS); + h = LoadLibrary(dll_name); + if (silent) + SetErrorMode(em); + + if (!h) + return 0; + + last_i = -1; + for (i = 0; (go_on || !error) && (i < n); i++) + { + void* p = (void*)GetProcAddress(h, fi[i].func_name); + if (!p) + error = 1; + else + { + last_i = i; + *(fi[i].func_ptr_var) = p; + } + } + if (pindex) *pindex = last_i; + if (error && cleanup && !go_on) { + for (i = 0; i < n; i++) { + *(fi[i].func_ptr_var) = 0; + } + FreeLibrary(h); + return 0; + } + if (ph) *ph = h; + if (error) return 0; + return 1; +} diff --git a/src/WINNT/kfw/inc/loadfuncs/loadfuncs.h b/src/WINNT/kfw/inc/loadfuncs/loadfuncs.h new file mode 100644 index 000000000..e56b5337e --- /dev/null +++ b/src/WINNT/kfw/inc/loadfuncs/loadfuncs.h @@ -0,0 +1,41 @@ +#ifndef __LOADFUNCS_H__ +#define __LOADFUNCS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +typedef struct _FUNC_INFO { + void** func_ptr_var; + char* func_name; +} FUNC_INFO; + +#define DECL_FUNC_PTR(x) FP_##x p##x +#define MAKE_FUNC_INFO(x) { (void**) &p##x, #x } +#define END_FUNC_INFO { 0, 0 } +#define TYPEDEF_FUNC(ret, call, name, args) typedef ret (call *FP_##name) args + +void +UnloadFuncs( + FUNC_INFO fi[], + HINSTANCE h + ); + +int +LoadFuncs( + const char* dll_name, + FUNC_INFO fi[], + HINSTANCE* ph, // [out, optional] - DLL handle + int* pindex, // [out, optional] - index of last func loaded (-1 if none) + int cleanup, // cleanup function pointers and unload on error + int go_on, // continue loading even if some functions cannot be loaded + int silent // do not pop-up a system dialog if DLL cannot be loaded + ); + +#ifdef __cplusplus +} +#endif + +#endif /* __LOADFUNCS_H__ */ diff --git a/src/WINNT/kfw/inc/wshelper/arpa/nameser.h b/src/WINNT/kfw/inc/wshelper/arpa/nameser.h new file mode 100644 index 000000000..4dba1baeb --- /dev/null +++ b/src/WINNT/kfw/inc/wshelper/arpa/nameser.h @@ -0,0 +1,263 @@ +/* + * @doc + * @module nameser.h | + * Copyright (c) 1983, 1989 Regents of the University of California. + * 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 University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + * + * @(#)nameser.h 5.25 (Berkeley) 4/3/91 + */ + +#ifndef _NAMESER_H_ +#define _NAMESER_H_ + +/* + * Define constants based on rfc883 + */ +#define PACKETSZ 512 /* maximum packet size */ +#define MAXDNAME 256 /* maximum domain name */ +#define MAXCDNAME 255 /* maximum compressed domain name */ +#define MAXLABEL 63 /* maximum length of domain label */ + /* Number of bytes of fixed size data in query structure */ +#define QFIXEDSZ 4 + /* number of bytes of fixed size data in resource record */ +#define RRFIXEDSZ 10 + +#if !defined(MAXHOSTNAME) +#define MAXHOSTNAME MAXCDNAME +#endif + +/* + * Internet nameserver port number + */ +#define NAMESERVER_PORT 53 + +/* + * Currently defined opcodes + */ +#define QUERY 0x0 /* standard query */ +#define IQUERY 0x1 /* inverse query */ +#define STATUS 0x2 /* nameserver status query */ +/*#define xxx 0x3 /* 0x3 reserved */ + /* non standard */ +#define UPDATEA 0x9 /* add resource record */ +#define UPDATED 0xa /* delete a specific resource record */ +#define UPDATEDA 0xb /* delete all nemed resource record */ +#define UPDATEM 0xc /* modify a specific resource record */ +#define UPDATEMA 0xd /* modify all named resource record */ + +#define ZONEINIT 0xe /* initial zone transfer */ +#define ZONEREF 0xf /* incremental zone referesh */ + +/* + * Currently defined response codes + */ +#define NOERROR 0 /* no error */ +#define FORMERR 1 /* format error */ +#define SERVFAIL 2 /* server failure */ +#define NXDOMAIN 3 /* non existent domain */ +#define NOTIMP 4 /* not implemented */ +#define REFUSED 5 /* query refused */ + /* non standard */ +#define NOCHANGE 0xf /* update failed to change db */ + +/* + * Type values for resources and queries + */ +#define T_A 1 /* host address */ +#define T_NS 2 /* authoritative server */ +#define T_MD 3 /* mail destination */ +#define T_MF 4 /* mail forwarder */ +#define T_CNAME 5 /* connonical name */ +#define T_SOA 6 /* start of authority zone */ +#define T_MB 7 /* mailbox domain name */ +#define T_MG 8 /* mail group member */ +#define T_MR 9 /* mail rename name */ +#define T_NULL 10 /* null resource record */ +#define T_WKS 11 /* well known service */ +#define T_PTR 12 /* domain name pointer */ +#define T_HINFO 13 /* host information */ +#define T_MINFO 14 /* mailbox information */ +#define T_MX 15 /* mail routing information */ +#define T_TXT 16 /* text strings */ + /* non standard */ +#define T_UINFO 100 /* user (finger) information */ +#define T_UID 101 /* user ID */ +#define T_GID 102 /* group ID */ +#define T_UNSPEC 103 /* Unspecified format (binary data) */ + /* Query type values which do not appear in resource records */ +#define T_AXFR 252 /* transfer zone of authority */ +#define T_MAILB 253 /* transfer mailbox records */ +#define T_MAILA 254 /* transfer mail agent records */ +#define T_ANY 255 /* wildcard match */ + +/* + * Values for class field + */ + +#define C_IN 1 /* the arpa internet */ +#define C_CHAOS 3 /* for chaos net at MIT */ +#define C_HS 4 /* for Hesiod name server at MIT */ + /* Query class values which do not appear in resource records */ +#define C_ANY 255 /* wildcard match */ + +/* + * Status return codes for T_UNSPEC conversion routines + */ +#define CONV_SUCCESS 0 +#define CONV_OVERFLOW -1 +#define CONV_BADFMT -2 +#define CONV_BADCKSUM -3 +#define CONV_BADBUFLEN -4 + +#ifndef BYTE_ORDER +#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax) */ +#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */ +#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */ + +#if defined(vax) || defined(ns32000) || defined(sun386) || defined(MIPSEL) || \ + defined(BIT_ZERO_ON_RIGHT) +#define BYTE_ORDER LITTLE_ENDIAN + +#endif +#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \ + defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \ + defined(MIPSEB) || defined (BIT_ZERO_ON_LEFT) +#define BYTE_ORDER BIG_ENDIAN +#endif +#endif /* BYTE_ORDER */ + +#ifndef BYTE_ORDER + /* you must determine what the correct bit order is for your compiler */ + #define BYTE_ORDER LITTLE_ENDIAN /* for Intel x86 series */ +#endif +/* + * Structure for query header, the order of the fields is machine and + * compiler dependent, in our case, the bits within a byte are assignd + * least significant first, while the order of transmition is most + * significant first. This requires a somewhat confusing rearrangement. + */ + +#if defined (_WINDLL) || (_WIN32) +/* define UNIX types */ +#include +#endif + +typedef struct { + u_short id; /* query identification number */ +#if BYTE_ORDER == BIG_ENDIAN + /* fields in third byte */ + u_char qr:1; /* response flag */ + u_char opcode:4; /* purpose of message */ + u_char aa:1; /* authoritive answer */ + u_char tc:1; /* truncated message */ + u_char rd:1; /* recursion desired */ + /* fields in fourth byte */ + u_char ra:1; /* recursion available */ + u_char pr:1; /* primary server required (non standard) */ + u_char unused:2; /* unused bits */ + u_char rcode:4; /* response code */ +#endif +#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN + /* fields in third byte */ + u_char rd:1; /* recursion desired */ + u_char tc:1; /* truncated message */ + u_char aa:1; /* authoritive answer */ + u_char opcode:4; /* purpose of message */ + u_char qr:1; /* response flag */ + /* fields in fourth byte */ + u_char rcode:4; /* response code */ + u_char unused:2; /* unused bits */ + u_char pr:1; /* primary server required (non standard) */ + u_char ra:1; /* recursion available */ +#endif + /* remaining bytes */ + u_short qdcount; /* number of question entries */ + u_short ancount; /* number of answer entries */ + u_short nscount; /* number of authority entries */ + u_short arcount; /* number of resource entries */ +} HEADER; + +/* + * Defines for handling compressed domain names + */ +#define INDIR_MASK 0xc0 + +/* + * Structure for passing resource records around. + */ +struct rrec { + short r_zone; /* zone number */ + short r_class; /* class number */ + short r_type; /* type number */ + u_long r_ttl; /* time to live */ + int r_size; /* size of data area */ + char *r_data; /* pointer to data */ +}; + +extern u_short _getshort(); +extern u_long _getlong(); + +/* + * Inline versions of get/put short/long. + * Pointer is advanced; we assume that both arguments + * are lvalues and will already be in registers. + * cp MUST be u_char *. + */ +#define GETSHORT(s, cp) { \ + (s) = *(cp)++ << 8; \ + (s) |= *(cp)++; \ +} + +#define GETLONG(l, cp) { \ + (l) = *(cp)++ << 8; \ + (l) |= *(cp)++; (l) <<= 8; \ + (l) |= *(cp)++; (l) <<= 8; \ + (l) |= *(cp)++; \ +} + + +#define PUTSHORT(s, cp) { \ + *(cp)++ = (s) >> 8; \ + *(cp)++ = (s); \ +} + +/* + * Warning: PUTLONG destroys its first argument. + */ +#define PUTLONG(l, cp) { \ + (cp)[3] = l; \ + (cp)[2] = (l >>= 8); \ + (cp)[1] = (l >>= 8); \ + (cp)[0] = l >> 8; \ + (cp) += sizeof(u_long); \ +} + +#endif /* !_NAMESER_H_ */ diff --git a/src/WINNT/kfw/inc/wshelper/hesiod.h b/src/WINNT/kfw/inc/wshelper/hesiod.h new file mode 100644 index 000000000..4de160fd6 --- /dev/null +++ b/src/WINNT/kfw/inc/wshelper/hesiod.h @@ -0,0 +1,125 @@ +/* This file contains definitions for use by the Hesiod name service and + * applications. + * + * @doc + * + * @module hesiod.h | + * For copying and distribution information, see the file + * mit-copyright.h . + * + * Original version by Steve Dyer, IBM/Project Athena. + * + */ + +/* Configuration information. */ + +#ifndef _HESIOD_ +#define _HESIOD_ + +#if defined(_WINDOWS) || defined(_WIN32) +#include +#endif + +#if defined(_WINDOWS) || defined(_WIN32) +#define HESIOD_CONF "c:\\net\\tcp\\hesiod.cfg" +#else +#define HESIOD_CONF "/etc/hesiod.conf" /* Configuration file. */ +#endif + +#define DEF_RHS ".Athena.MIT.EDU" /* Defaults if HESIOD_CONF */ +#define DEF_LHS ".ns" /* file is not present. */ + +/* @doc ERROR +/* Error codes. */ +/* + +@type HES_ER_UNINIT | -1 uninitialized +@type HES_ER_OK | 0 no error +@type HES_ER_NOTFOUND | 1 Hesiod name not found by server +@type HES_ER_CONFIG | 2 local problem (no config file?) +@type HES_ER_NET | 3 network problem + + */ + +#define HES_ER_UNINIT -1 /* uninitialized */ +#define HES_ER_OK 0 /* no error */ +#define HES_ER_NOTFOUND 1 /* Hesiod name not found by server */ +#define HES_ER_CONFIG 2 /* local problem (no config file?) */ +#define HES_ER_NET 3 /* network problem */ + +/* Declaration of routines */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WINDOWS) || defined(_WIN32) + +LPSTR WINAPI +hes_to_bind( + LPSTR HesiodName, + LPSTR HesiodNameType + ); + +LPSTR * WINAPI +hes_resolve( + LPSTR HesiodName, + LPSTR HesiodNameType + ); + +int WINAPI +hes_error( + void + ); + +#else +char *hes_to_bind(const char *name, const char *type); +char **hes_resolve(const char *name, const char *type); +int hes_error(void); +#endif /* WINDOWS */ + + +/* + * @doc + * + * @struct hes_postoffice | For use in getting post-office information. + * + * @field LPSTR | po_type | The post office type, e.g. POP, IMAP + * @field LPSTR | po_host | The post office host, e.g. PO10.MIT.EDU + * @field LPSTR | po_name | The account name on the post office, e.g. tom + * + */ +#if defined(_WINDOWS) || defined(_WIN32) +struct hes_postoffice { + LPSTR po_type; + LPSTR po_host; + LPSTR po_name; +}; +#else +struct hes_postoffice { + char *po_type; + char *po_host; + char *po_name; +}; +#endif + +/* Other routines */ + +#if defined(_WINDOWS) || defined(_WIN32) +struct hes_postoffice FAR * WINAPI hes_getmailhost(LPSTR user); +struct servent FAR * WINAPI hes_getservbyname(LPSTR name, + LPSTR proto); +struct passwd FAR * WINAPI hes_getpwnam(LPSTR nam); +struct passwd FAR * WINAPI hes_getpwuid(int uid); +#else +struct hes_postoffice *hes_getmailhost(); +struct servent *hes_getservbyname(); +struct passwd *hes_getpwnam(); +struct passwd *hes_getpwuid(); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _HESIOD_ */ diff --git a/src/WINNT/kfw/inc/wshelper/mitwhich.h b/src/WINNT/kfw/inc/wshelper/mitwhich.h new file mode 100644 index 000000000..c6b7f057d --- /dev/null +++ b/src/WINNT/kfw/inc/wshelper/mitwhich.h @@ -0,0 +1,156 @@ +/* + +@doc + +@module mitwhich.h | + +some defines so that we can figure out which MS OS and subsystem an +application is running under. Also support for finding out which +TCP/IP stack is being used. This is useful when you need to find out +about the domain or the nameservers. + + */ + +#if !defined( __MIT_WHICH_H ) +#define __MIT_WHICH_H + +// these should become resources and loaded at run time +#define NT_32 "Winsock 2.0" +#define NT_16 "Windows NT 16-bit Windows Sockets" +#define W95_32 "Microsoft Windows Sockets Version 1.1." +#define W95_16 "Microsoft Windows Sockets Version 1.1." +#define LWP_16 "Novell Winsock version 1.1" +// Note that these are currently in wshelper.h and should be somewhere else +#define MS_NT_32 1 +#define MS_NT_16 2 +#define MS_95_32 3 +#define MS_95_16 4 +#define NOVELL_LWP_16 5 + +#define MS_OS_WIN 1 +#define MS_OS_95 2 +#define MS_OS_NT 4 +#define MS_OS_2000 12 +#define MS_OS_XP 28 +#define MS_OS_2003 60 +#define MS_OS_NT_UNKNOWN 124 +#define MS_OS_UNKNOWN 0 + +#define STACK_UNKNOWN 0 +#define UNKNOWN_16_UNDER_32 -2 +#define UNKNOWN_16_UNDER_16 -3 +#define UNKNOWN_32_UNDER_32 -4 +#define UNKNOWN_32_UNDER_16 -5 + + +/* + @comm these are the current MIT DNS servers, the wshelper and + wshelp32 DLLs will do their best to find the correct DNS servers + for the local machine however, if all else fails these will be used + as a last resort. Site administrators outside of the MIT domain + should change these defaults to their own defaults either by + editing this file and recompiling or by editing the string tables + of the binaries. Don't use App Studio to edit the .RC files. + + #define DNS1 "18.70.0.160" + #define DNS2 "18.71.0.151" + #define DNS3 "18.72.0.3" + + #define DEFAULT_DOMAIN "mit.edu" +*/ + +#define DNS1 "18.70.0.160" +#define DNS2 "18.71.0.151" +#define DNS3 "18.72.0.3" + +#define DEFAULT_DOMAIN "mit.edu" + + +#ifndef _PATH_RESCONF +#if !defined(WINDOWS) && !defined(_WINDOWS) && !defined(_WIN32) +#define _PATH_RESCONF "/etc/resolv.conf" +#else +#define _PATH_RESCONF "c:/net/tcp/resolv.cfg" +#endif +#endif + + +/* Microsoft TCP/IP registry values that we care about */ +#define NT_TCP_PATH "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters" +#define NT_TCP_PATH_TRANS "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Transient" +#define W95_TCP_PATH "SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP" + +#define NT_DOMAIN_KEY "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Domain" +#define NT_NS_KEY "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\NameServer" + +#define W95_DOMAIN_KEY "SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP\\Domain" +#define W95_NS_KEY "SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP\\NameServer" + +/* + + @comm Notes on different Winsock stack configuration files. + + The Microsoft stacks for Windows95 and NT 3.x, 4.x use the registry + to store the default domain and the IP addresses of the DNS + servers. The wshelper and wshelp32 will use the registry information + when possible. + + Novell's LAN WorkPlace stack and the much older Excelan products use + a resolv.cfg file to store this information. The resolv.cfg file + could be located in a number of places over the years. Our DLL will + try to search for it in: + + C:\etc\resolv.cfg + C:\excelan\tcp\resolv.cfg + C:\net\tcp\resolv.cfg + %NDIR%\etc\resolv.cfg + %NDIR%\tcp\resolv.cfg + + where %NDIR% is the expansion of the local environment variable + NDIR. So setting NDIR to be N:\COMMON\NET would mean that we would + also look in N:\common\net\etc\resolv.cfg and + N:\common\net\tcp\resolv.cfg for the domain and nameserver + information. + + Here is a sample resolv.cfg file + + ; LAN WorkPlace resolver configuration file + domain mit.edu + + nameserver 18.70.0.160 + nameserver 18.71.0.151 + nameserver 18.72.0.3 + ; end of file + + The TRUMPET Winsock stack uses a TRUMPETWSK.INI file to store the + domain and nameserver configuration information. The section tag is + [Trumpet Winsock]. The domain information is identified by domain= + and the nameserver information is identified by a single name, dns=, + multiple nameservers may be specified on the same line and they + should be space delimited. + + trupwsk.ini + [Trumpet Winsock] + dns=18.71.0.151 18.70.0.160 18.72.0.3 + domain=mit.edu + + Core Internet-Connect uses a CORE.INI file, nameservers are comma + delimited. + + [winsock] + domainname=mit.edu + nameservers=18.71.0.151, 18.70.0.160, 18.72.0.3 + + FTP software uses a PCTCP.INI file. This file may be located by use + of the environment variable PCTCP. + + [pctcp general] + domain=mit.edu + [pctcp addresses] + domain-name-server=18.70.0.160 + domain-name-server=18.71.0.151 + domain-name-server=18.72.0.3 + +*/ + +#endif // __MIT_WHICH_H diff --git a/src/WINNT/kfw/inc/wshelper/resolv.h b/src/WINNT/kfw/inc/wshelper/resolv.h new file mode 100644 index 000000000..ec904d67b --- /dev/null +++ b/src/WINNT/kfw/inc/wshelper/resolv.h @@ -0,0 +1,201 @@ +/* + +@doc + +@module resolv.h | + * Copyright (c) 1983, 1987, 1989 The Regents of the University of California. + * All rights reserved. + + Structure definitions for resolver functions and #define statements + +*/ + +/* + * Copyright (c) 1983, 1987, 1989 The Regents of the University of California. + * 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 University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + * + * @(#)resolv.h 5.15 (Berkeley) 4/3/91 + */ + +#ifndef _RESOLV_H_ +#define _RESOLV_H_ + +#if defined(_WINDOWS) || defined(_WIN32) +#include +#endif + +/* + * Resolver configuration file. + * Normally not present, but may contain the address of the + * inital name server(s) to query and the domain search list. + */ + +#ifndef _PATH_RESCONF +#if defined(_WINDOWS) || defined(_WIN32) +#define _PATH_RESCONF "c:\\net\\tcp\\resolv.cfg" +#else +#define _PATH_RESCONF "/etc/resolv.conf" +#endif +#endif + +#ifndef MAXDNAME +#include +#endif + +/* + * Global defines and variables for resolver stub. + */ +#define MAXNS 3 /* max # name servers we'll track */ +#define MAXDFLSRCH 3 /* # default domain levels to try */ +#define MAXDNSRCH 6 /* max # domains in search path */ +#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */ + +#define RES_TIMEOUT 5 /* min. seconds between retries */ + +// new +#define MAXMXRECS 8 + +struct mxent { + int numrecs; + u_short pref[MAXMXRECS]; + char FAR * FAR * hostname; +}; + + +/* + + @struct state | This structure holds the state for the resolver query + + */ +struct state { + int retrans; /* @field retransmition time interval */ + int retry; /* @field number of times to retransmit */ + long options; /* @field option flags - see below. */ + int nscount; /* @field number of name servers */ + struct sockaddr_in nsaddr_list[MAXNS]; /* @field address of name server */ +#define nsaddr nsaddr_list[0] /* @field for backward compatibility */ + u_short id; /* @field current packet id */ + char defdname[MAXDNAME]; /* @field default domain */ + char *dnsrch[MAXDNSRCH+1]; /* @field components of domain to search */ +}; + +/* + * Resolver options + */ +#define RES_INIT 0x0001 /* address initialized */ +#define RES_DEBUG 0x0002 /* print debug messages */ +#define RES_AAONLY 0x0004 /* authoritative answers only */ +#define RES_USEVC 0x0008 /* use virtual circuit */ +#define RES_PRIMARY 0x0010 /* query primary server only */ +#define RES_IGNTC 0x0020 /* ignore trucation errors */ +#define RES_RECURSE 0x0040 /* recursion desired */ +#define RES_DEFNAMES 0x0080 /* use default domain name */ +#define RES_STAYOPEN 0x0100 /* Keep TCP socket open */ +#define RES_DNSRCH 0x0200 /* search up local domain tree */ + +#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH) + +extern struct state _res; + +#include + +/* Private routines shared between libc/net, named, nslookup and others. */ +#define dn_skipname __dn_skipname +#define fp_query __fp_query +#define hostalias __hostalias +#define putlong __putlong +#define putshort __putshort +#define p_class __p_class +#define p_time __p_time +#define p_type __p_type + +#if defined(_WINDOWS) || defined(_WIN32) + +#ifdef __cplusplus +extern "C" { +#endif + +int WINAPI res_init(); +void WINAPI res_setopts(long opts); +long WINAPI res_getopts(void); +int WINAPI res_mkquery(int op, const char FAR *dname, + int qclass, int type, + const char FAR *data, int datalen, + const struct rrec FAR *newrr, + char FAR *buf, int buflen); +int WINAPI res_send(const char FAR *msg, int msglen, + char FAR *answer, int anslen); +int WINAPI res_querydomain(const char FAR *name, + const char FAR *domain, + int qclass, int type, + u_char FAR *answer, int anslen); +int WINAPI res_search(const char FAR *name, + int qclass, int type, + u_char FAR *answer, int anslen); + +int WINAPI dn_comp(const u_char FAR *exp_dn, + u_char FAR *comp_dn, + int length, u_char FAR * FAR *dnptrs, + u_char FAR * FAR *lastdnptr); +int WINAPI rdn_expand(const u_char FAR *msg, + const u_char FAR *eomorig, + const u_char FAR *comp_dn, + u_char FAR *exp_dn, + int length); +/* Microsoft includes an implementation of dn_expand() in winsock */ +/* Make sure we do not use it. jaltman@columbia.edu */ +#define dn_expand(a,b,c,d,e) rdn_expand(a,b,c,d,e) + +#ifdef __cplusplus +} +#endif +#else +__BEGIN_DECLS +int __dn_skipname __P((const u_char *, const u_char *)); +void __fp_query __P((char *, FILE *)); +char *__hostalias __P((const char *)); +void __putlong __P((u_long, u_char *)); +void __putshort __P((u_short, u_char *)); +char *__p_class __P((int)); +char *__p_time __P((u_long)); +char *__p_type __P((int)); + +int dn_comp __P((const u_char *, u_char *, int, u_char **, u_char **)); +int rdn_expand __P((const u_char *, const u_char *, const u_char *, + u_char *, int)); +int res_init __P((void)); +int res_mkquery __P((int, const char *, int, int, const char *, int, + const struct rrec *, char *, int)); +int res_send __P((const char *, int, char *, int)); +__END_DECLS +#endif /* _WINDOWS || _WIN32 */ + +#endif /* !_RESOLV_H_ */ diff --git a/src/WINNT/kfw/inc/wshelper/wshelper.h b/src/WINNT/kfw/inc/wshelper/wshelper.h new file mode 100644 index 000000000..0bdf3630e --- /dev/null +++ b/src/WINNT/kfw/inc/wshelper/wshelper.h @@ -0,0 +1,58 @@ +/* + WSHelper DNS/Hesiod Library for WINSOCK + wshelper.h +*/ + +#ifndef _WSHELPER_ +#define _WSHELPER_ + +#include +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct hostent FAR* WINAPI rgethostbyname(char FAR *name); +struct hostent FAR* WINAPI rgethostbyaddr(char FAR *addr, + int len, int type); +struct servent FAR* WINAPI rgetservbyname(LPSTR name, + LPSTR proto); + +LPSTR WINAPI gethinfobyname(LPSTR name); +LPSTR WINAPI getmxbyname(LPSTR name); +LPSTR WINAPI getrecordbyname(LPSTR name, int rectype); +DWORD WINAPI rrhost( LPSTR lpHost ); + +unsigned long WINAPI inet_aton(register const char *cp, + struct in_addr *addr); + +DWORD WhichOS( DWORD *check); + +#ifdef _WIN32 +int WINAPI wsh_gethostname(char* name, int size); +int WINAPI wsh_getdomainname(char* name, int size); +LONG FAR WSHGetHostID(); +#endif + +/* some definitions to determine which OS were using and which subsystem */ + +#if !defined( STACK_UNKNOWN ) +#define STACK_UNKNOWN -1 +#define MS_NT_32 1 +#define MS_NT_16 2 +#define MS_95_32 3 +#define MS_95_16 4 +#define NOVELL_LWP_16 5 +#endif /* STACK_UNKNOWN */ + + +#ifdef __cplusplus +} +#endif + +#endif /* _WSHELPER_ */ + diff --git a/src/WINNT/kfw/lib/i386/comerr32.lib b/src/WINNT/kfw/lib/i386/comerr32.lib new file mode 100644 index 0000000000000000000000000000000000000000..be521f5b6e72ba10979b4a16ccebf48c3d477d84 GIT binary patch literal 2560 zcmcIm&ub& z>ZSjI2M=C)^X5NM-`ky8c40v%I?2qudGmI@nfJaovny|nZteVC>~+drvYBErt0R*ep5Jka&h-obvQs_%R_+^&=k zs{0ka)@e7o-FyzZUOv*aaSMErCYC|<<5786-`T2e(I?IJh0aUpv<8NPORrxVYIfb8 zl|##hzUy@LcB9ub&Kjx$UdXMm?2LL{O!bY^mTBpsvTVDJcIUD&YVN6>I||A$3K0rJ zG60l=z*Pv)NO4Uy83k^`z<_!R6MXO^j3opSLc}2j$ba{Vhw%Eu^qi8u=BA-jwTP=>w-?Bp4+!Xn764QJEJouegANwc=$nWg>biHx< z`E2#j8UouSP%5~Jip2YLvu^Z_)tsDoO2T)lzl4Iq3>BFhVYe>SctnDa@T48g>6Uy+omwouzrOb zQFwLWjTmv~N0r+95q>gVV$LJa!k1hj=irOqyU*$mb z%$NVfgIQwxg0?a7PM_Ov8(D|ntUUWk09K&A{Wc}f3er_fN6s^6apajI^=$V;4n+Tt z{X2_K=|!FL9L~)~n~W)b(>X~sAKzdp^MrBe<2SD}aIS=(h5d>o{|MeQ!t>FcX+PkL zp==1MjG#Ox6hG)xv^qb|;>}nHt014_5iAZ=fU!m&q{Yzee=~QyUJ}|8qj|n|F38v) Dij^EI literal 0 HcmV?d00001 diff --git a/src/WINNT/kfw/lib/i386/delaydlls.lib b/src/WINNT/kfw/lib/i386/delaydlls.lib new file mode 100644 index 0000000000000000000000000000000000000000..a39ff4ac7368ca5c8d679e148d0c252d103e707c GIT binary patch literal 13306 zcmeHOe{@sVeZR7VB#em#h~N;D2rvUe>&O-{HfFJ8EL#pX5&j_&uqBKw2Z4V@ekPEG zmDae+>pM=f^d#-po}A>gNlErAXXh-)qw^dw1_)H8o{9^wEZ_jG%9K zqZeg-Jw0`Oecr76-ND+rbiO~47))en?PHg6$ zkM2~vK85kk*_+Yr^z>#m1*F zGu`CB&t~Okvr?V2pUp~IclFB$yE|iA&b6nOS803gzWmaT!Tkq2;-1Qijzp}lqlXrE ztm(t0P_z8IwQX1}kc+v@?XIY(aJkCL%D0qr?7sXa(_L)!Rgd>s?Ad>Uxlf_AClTwG z4#z}_u{{vJW7SgXGv5JRZ2!oEC9PV{w;}u{1LtLq+R{W%m(-=97;A(09M+gm@S$MA z$IHClQYm&s;u;aT!L`cHSo19+{dqiGEVxg#TdzTbShNZqj766S&2l`r-Qgn!!(^vy zsa8sT=DAs>-BrlCCj;klWZQ*F)&ksq6-#TU*Ma(G)T0XezIpOJ58U6(!M6x}Kb$Au zkAQo39(-wOD1VV-;+0C!^! zzB|EZx>c*Gc;>3F3plrm&DDMiD7FG~TE#6uIv3v!U~E(&gj{?Vk+%ext16D>OD?`8 zSm#&cLm?L*`LhWaw+@$!Z!0kO>2NcRzdOL!224W5%{KnN49wFRe0SIR>wWD_ZB31} zTi1+?#CuBn;``UQ=A&+I4Q+2}%fQ~>RJYUD>~CG;B2T*6Ld1-9Y~R{3oapX26ie)n zB?gB(`s32)yAKa{48@20V~JQtmvkUD(A6;_#rrzoKzbME#YmHTldfdT941(^vc)W) zEhrH2>gISiEDiQbt_>|4UH1=3@&5QD@qq_j+XwrH;(f6M7OErNG3W;eT=4-{PkeX? zTYog(KQx$-hBvs6taDfH-spPx0KhK1{?>q9glPm-C0-k-=|0y}7G+*nH7gOnIWUunCos+N9n4DB%S2TeCau!B) z1`nmK#6Eh3Nw)^1l>y1@NlrpznfBUM8lJF-1eMb8p9@G^QurdJsl=(Yl{kXPcI-l` zpe1;Pd{SAUAgx`eQ(b`8GIowwM;4DICF@xhMlrY{62zhS97ueq_=?ep^TIm?-lfME zW^5bqe} z0xXQZB{{>&`H8D}o}}_$AOD$he)Q+&k6(%^ry^wbrt#yOk5Bv}Z{7ylmA(@DS@a0? z{CFc%{0t3HHFjNEKbAbY*puvq<{%3mG)*n0aW>v&&ucjdP55A5>-0}Y-zefE^t8n* zgJdd6sZL#c%`yLq#r#u#>6w;~U6PNzFCV)sAG;_Ydq+O@snTgz-sCMM`!7|WEj;le zjn3nj5X=7eNs))SH(pRAH(##)ap8#{P`1xP8CM~WZz}>7YOVq)eJ?*N+5jgc8kT2d`x{A8M; z@v{YWx>Y&PYbb^VjcfiMgAvx+9y(a!dC&6^&sVM?uli%DJ>2@(9dg7XN9=N>K#n-% zh*ORf$&q3?;t~t2@~cqzZ>i3rV7&!3ubz|^R7LC~cV?RNT=#r5waIh+H9HDStyQy6 zBu6$V=ef@4o#%R#7B8Jx(bPQC?^YGKg9+K=|D<)EG3j(rs~m@JY=Rdy_(H#HcclP zeV8jvUn7Wsp@fi`*8CR-WX3`QjMt_G)Fq5w2SgC%`NW07#LPV3tLEnM12(>zK-$K8 zllsxdT!^VJY|M=~&LuD6gIo$CrWZ;Z+lRQ1OGAkJxpW-y0GFOXJjkVI5fj43UPk;7 zmy(EwxpV=s#HCA!N4Rti@xxpq7msks0g1*p{Dbr~m)wxP&LuCTZ*Ym`3RZh%SMj*> zlvjpSS7M>#k(?*rXE{Y{65i-}EZ#Ipq&EN?Q+7GWEl<|UyXd%O4=E41sNA^a%d))} zl0yz!km2l=19l{fO&>NO!R^il zqW-tBX`h8tV5%BIxteRAF?S2kZB;r-?ClC4NFn8yN_~N{vq&zUAR$x~9)I+d#e2{s z*B4Cxq!l}Rky!L)8=B4;oc_sZ4I5E)%1(z8Ld*WhC+~E~E9F{C6btq#3!`?e!NinpKY-89f!^*Ff28-wVSn}{)aK|YcaQr(ZgjO1gl!9x!TG2c>NhGBu zfYw)EOMHL^DNj<9C}AAk{{sz#&OO(OAwWucU)h0=SggXtgkWM;2R&&Eu`zy33%4u3 zzCt=|oC~6z#Mj^&tz@ksX_Laoujjhvip3gipMG2Tu>vrq$?65BMPP^1e{$S5%3Iro@d4p=bj<NdJFRN)zKvnSQIPL>MM&} zigMelFDBl`+h0QwG73^J3-Vx*(omeCDn{dHs9e#`NjJ=$z{kp`$S5Qy+l^T4X*B+X zMDMpkg1{7tc(Cvep}mk#nB(`d!m-zog7ag^!V`Z@;!gY6xxy3Qh1eP%-*y^L7Utt8 z_2QxYSoz2Fo5!2{%>xWx4K0U?=2O6q0>>vl$P3G%;`!i<#*$Gv5K3Z zWIJOuy=+RI+RBrWNm`r^;^*$a5C9Mq=?#e1R4NHzuHI-GgMCvtL_=}Fv=zldJKC_8_ z|DbML>Q?BKpa#mLU|}w`rTD%hlsKg5e;uLzF`MZ35n30Gp#e!6_kyRSsiLgB!ov>( z+&UAQ&HSLC*Oc=<6B=Tq1F#mT)xY#>SS3_yO?AJ^&^m24X>}U-R-;-)sXs|f{jso=$RKHZ8m8~3;&G}7H?4p z#wMr;!onkBUtPtN*4nvM zWnPlSyflk>NftA`oS9AC6ywAG>Ss8)YRnI*%*!}4W&g3NAz7flo27ZppwZ7JI*1x; zx-82dnrCLyA(j8}wLiczrup->%DkMpRNal7wr7LeN|=U|!;zlD-z$I+z=E zOV?{JG*1{b-=J+u4cPUtpL(jcus+lT|FJp=O(i>&p{ZcKX$|(u&1G&D;3cS(ez#gn zT9bm98l(Eq2o`KO&ch3;^|h&bok{tl)%2fJ8Y-usrzPMpj`_9RhTi%*j-jI=)#sT{ z{^?}e`VEzN9k;G${=F>bby>{oIfm+l!NmUZ`8QxntJgBx#u3(MF>ip@==1t4=8YUf zGn)8zZv69arI|OW%p0?q@5*A{$eE#L4JhS+tLc$&92&Q(5ng`{nrkV|3rNv@&Fv$J zL~K9`CI-7>!^6#kJtKWFTs=)7;q^Y?3*x@x9u}pa_M%b11t7q0xca=CSxwL%h~dU! zqCPR$Zz$IuZEW^6;KpTJG~oBu`CD4OUa;Z9X*3$+zaB>WaFsNj64z!E9_{MuEca3M zS6gR+Y1dYNH!g+FaiKTe#!X$rlBktiYk9h|)fC^K=t>-=R#&mDF@Zy;#HcS|A;+cE z)Meka73y)V!zx)#>QdND7gNQ(Q?=}{l!$lt59x}`dJXk=;8O4$S8j9N+TK1mG9ZP! z`tZ{`O@#n%W`{RF%+t|cx_R8yO}~IgV;IMq~i88dg z32N(jiQ2kZAevikf%cs{qIJGDpQl{4R6BECnryhMHx|WR#h4U}b|n&BN4@R1w1_L{ z6sPa*lM}mr)C4o;qN{5>1i`4Fey=H+f!A;Y+j!kQO+OoGe#Cq*#jn@QX_=3(nRLdnC39w z>vp7vyK!6vE9Rd39`Bwq4+a^H1x`&DVW}&?>YpzG-yHc?JCwjQ?PWD{{KZ8y8m(_1 z=);zl4DiLQxO6R8vmeaLr_#r41_3}hSH^7Nj0Q_1gnOa;4g|Y2?>xO`=jA^&Ux?o zIZaqM!HM3zzkBYv=broV@_xsakH^!4XZDuu)(RyOZfJmu+MCugRP;s5s z$87)*7v6MWUsZ0v}sl7P)l}mPuXt!sO%G4=0qdmaD6=vvnJfwD5m{o?H<3{^w*l` zPjRkWv0Efnr_%bMaZZ<(Qab^B*u?@V3&Ktx$P9(LZ2flu!i(&pD%e_eDsIGWBh*uP zZo%$29S?+tL{)gYYG7=P6;@H~ZdiC+1*fYF{k-Ao`?Xi8KKR<<7iAMFO?CEL@jYpq zh5>Y}^Aa8s48y#^*4=Ffp4`{ne!Ttjt<4)dx_b5>JHAmXP#$S-JG`&sK-Wf%LO!7$ zpy8@(e{=6xda(CdJw2eON5*=G6UMH=b7Q@uiLqflt@p-_GkPlCn=ul}-eh9HI@AAp z&W&nq5Z6=r)k;;Sip!;}>_`k^f|1jPw(Zzs+L2KsF`W2vA~mG#9~mA^B=s~0q&AN= zYl&o1ABrb6T-wA)O53$d+dN1wF7;WuwEo3R0&kZVPic4wGsAkya18IqZVV2WnTxt0 z590Bwv%7m12&wG#(%iIB6rC~Oo_QxPFH>J`+GLwI#7j_(pZ7F#0LJRPukl8eIX9Q0>I8R2_uOGOFCOA% zZaQyk>>S_QY-}}oF0}i_TLvf zIm1A_X0g+59@NXMycGOxzAXqYlK2( z?br5A*3taZmp$+EWKK$dZZ^}!+k-=S0xq_VH#Hlzm@s5kFM2z?(YYe??e0!C&rZu( zb=tcYjP;%5d-4o+e#SghnwvGF<%Vz4Q!@>}VT9HLlgZW6kCU>eZMLV4m<>x#X}x|+ zT+OR=JK&Xl(p`K6k6%@yr2Y1*$53u!L|3?i(IJ%5`z1&BJkT2M{T9lNjObO95kCMT zpMLd*qniQJSa%zx%<(4&{RQZAc>L;bD8YNMqCpB>o-;0&jr7Rv?MsAdp1g>Dcu+x?#sI4J7epfh2-SAc^1`K&#pFOF$CA z6(E`S$3Sbj_dTFTfhyD;Ac^3g4hrBiQOR~s1A&Vn(%%DVj6ML85g$6bzdO3Sj;_RO zN4g0}&bJ;&BHatLg8dx;l1RS_By0ONkc{{tkc{{V5Pbst>K8yV0!{uPP;CpXoWx5X zJjhB!gaN8p1-MOnR>J2=J5a)_+RUixG(LDhBzG5-8uC;Xu%$uhql5S^RwYgqm&eos zY`iLZT8|r5Vdf{Ianl?M#_J)XQz&kVg8*SeB&Sf^^oCa8^-Q58k5^87^t9N9x(-I_ z8XMIp_46Z|8bxo5Xx#M2M_LcPafQO8YU>pBvyBo>HSdqhb4?R_b=lN}tr0XIkE#w6 z({THVG;-WBie@H6;_@5`vqo&(RE(nadWeiQ0eyetyRPjF@fbQ?jeUVAS{kZ~Y%0lA z4eu}fP(RIDC@pAec*qaMu2d(NQivv2ps^DSTUo@Z1*IOg$f#%SCTg((S#orup#;Si z8TFjqL@k;u(6q-L;nxdnzK2%JXfi&iM_VE-EsK(+XtXKXq++qyXnJHQ6(81t6T_pi z*qD(<_J%xZ(Ez*u^k^Ch*J-;MONp;x9;9Hj9V&~(4e2hIxk!AD7pPKxkR^>OC0{+e)=>5 z>*viuwH(F&B^tOTMUcesTJ7Ud3CpvvbC59S?#pa*g} z^v-<+&?woHXJHD0_ZL=7CtBl@?fwH8xv}lcPL(>P^p!xuVj3JBec?pc0Yu+* zzoO3~t;4VSQ3^9m0ZH$xK+^jor}s6WARfQEj`9&kvnXZkdqA65H|OYx4?fJgavZv# zwLs!|y@R#@iI?p_!uXnj9^$cWKr-7GfMgvDUn~65VCT?lmBZk zRz*<5Q=*nA>)HQ*N*ct%#Nb$Hl*F~(B*eSK1 z3?ULTF%)7JG=d)C8uX(mNnS&og<2%?6>9*>Yse3Amb~U(c1E8!TK9853;u@ui0rfK zV%!CaNvU>AL)B93Ok+Lu+G78dszE`1B*JIxZq%YVdynQ^fo1}&d-##iqLw@@a&ae% SGUeIL^4v+N&c{=wvi|@e>OlYi literal 0 HcmV?d00001 diff --git a/src/WINNT/kfw/lib/i386/gssapi32.lib b/src/WINNT/kfw/lib/i386/gssapi32.lib new file mode 100644 index 0000000000000000000000000000000000000000..3a7de55952a6370b55123fdb1f2c2fbc9886e4f3 GIT binary patch literal 13558 zcmcIqOK%%T5-!>6I93!{u^l^(U(~~T*?Li=WCe=_6-S`%O(AY1O`YQm0`W{o7>INV*{T`*suK)<8wPAT+*9X>tkgvOCx6okncc{3|6VhJA^PPrUbc)rA?>_Q#S%zS&5PF4T(XFYPnGAn7 zW0laY)vHApd&VFgzxvRvK_g5d-|%)Sx%4FM zTUZeFpSpE#`yiB%ibAI07RtFan~bm^>h~*@$wp8r3Yn7EsFe!`PQx$w`;AK5?#CD`j8ny zPHw{4ItZpLv>9uqL7y$;X*PMGs>Bysf2$X2PQ&}V>y*7c&kxPY#1~rbqhJw-`%VE2aYt8#C_W8gf^Kqri3%Gw}tk^duXW= zy1v`+Bg$+xY;{7Lp!!u@<^oY;30V{(vREI!oyHQfWJW`K3Jaosze1Uz4+@JyX2K z^#T<(9IR_pPpc4m72nx!xb;9sUP;K`Lwv8|I{Rpxr1M%e8l6|!vDUivPrV|Y8m{=k z`nt2=pdV#u6 zP$q|Z&k=9t7V3@ye2CPAI^SUV%i9=BBi+aM-M$X+15)i8z)Peru43PiO4!d1I01KH z4rX8$GLVI7I1PV*cOV5L@D_B!4LAem;4IvNQMd|&a2~Ef54;BN!X>y2!!QnGa2qBe z4O1`yeegQG4X5A&T!)MBCcFXt&GTMEq=j3a!62R zyy#HumSW$an#Nw{{n{RXHx0<*Qi&!RB;VTE4CF|>Dn=lzC0Q?tvdvXWpd1w;Ta^}7 z2%#psVJn+#bYmCIx3Fs(_C>OUP&0l*HSW^ZAhDH%ng`Z#Nm6hCp@i66D+q^-H6${% zRq%{U44EM_HYD8E2)B7`ZA`4Cz*oGAF^#uIv4(J(uuO?n?7@kYS%xP)a<&*aSbJt- z_JcvfV@~UXBOk|CPC{bRCX2r#0NkC?$e1NNoGJOZK-L^b>wb-hT09!5l6@H|>t0Oa z8FNj`(TMdpjLnUdMF$AYP6HGVC2JUb6R9?OB~f9^2BMyb=x9EHutwJ-D7s@GV2y%To0(u0C>!WKpAQrBy77N@5zWTvBgXv-Ts} zPSgm_cgIWRGC9w0c7~sso1+1L>XXjpj+4;!ayoam12BROo{sU7yS2YFuuh8r3;54J zd4c`rpy&N@uT=000~nvv=K}tGhx9*IK8e3Mn0&_M@NAnt-T2dicwCNfbC7y=0)NkA z)J>i)xl_Y%zUMSDNrU7$jp6yJu5&A1v0iOdxBb-c+DK}7DgP0z*8bwzd7w#J01WYo zeh>aV75pdT;A@Zw4d3@v*I(fG-#H@DArE=M6TrKj!`y>#b~z{LAbH1=oRc9k$PhAF z!6AIiWx|KFg(+27CRiI-I$VH%g!YoorX_nh5!lPW@x|y1gVA0{h9y6eyN+W5+tsUkOC{ASM~+3^yGO6AwVpeq_u@h7AdkE#r$vE9lr_kukSVh|RB=wO-?K z5n8>B9XT^lfaO9fD>chEL=6{@rf{2(arL7<8R-y~Wf^N?%daW8;)o*|;!Mm4pT@H) zcByMRI#Gb-LQ5l@F|XP_?CI+QSIs+Q5XG`uLbUXhxT7;6qLkDmLW>*MP8p3v!g#|c z-Q^_0jkDZ0IIb}rQ()Woi81rp72;~io&qTsTAI%o#5V<^nn}taZCg;B5AF^T&1tFv z-1g|kS<_jLY)*m|V7ZWVjC(>{cK^>aY#F5OG0ukH8L7MZ0It%vbVQN99~5Oj(wT|e{?YEB7de`CB9ja; zZf#!D5RY4&#( zA!_6tOvX8cCB^J7S0bqFHb8-t3$65XhNsn9)QOjwc;l$|6A|SjJQ=KQuRCMuD_)!8 zEvJSYJs(Vj9cNS5IkxHW@z_vrsHp16W+K!$Uy)K!BgdwRaO1|fm*f@LI=S76d`*!I z)nZj7#_y9*@zW0R8AdY17*EkJBWj<8D4=cctXWHLjvpN0O}`jjaXXd}&*CRih)2FJ z2xe0~VOIdf~h!|r-qdFqJHc*%UCj(28}& zVND4veuXDD-@aAG^efG=#Qk6*tT=0#Rc F{{!W=fdK#j literal 0 HcmV?d00001 diff --git a/src/WINNT/kfw/lib/i386/kclnt32.lib b/src/WINNT/kfw/lib/i386/kclnt32.lib new file mode 100644 index 0000000000000000000000000000000000000000..085dbd36eb4841af699a62d550656a715eb44389 GIT binary patch literal 4570 zcmcIoOK;mo5FW{|T9#}n>7hVh3gD(`fV#3p#W7G6v}HFnBrAp_9}7m0jYX7}0+MNa z>oo=X19Hf@zac1c$S>%j2mgTHdM|QKXSiH($t4*Hb{AOf?(E~+*_m&4sas$7?7`@p z+*jpr+OF*GZfn&&trnJ7{O0|ts6EO7z^4E!%K)ntfZPZm|AOa25rA_3F3-j10F(>Q zcwWB*pj^Do^Tta6%B4k~*Iofo-Z={?QyTeVbM? zFP<2Qz0+9_?B3Wl$LD+vy`oH12OKhsxoqFEI?Qp*$=C^I#ddX=d*(2^)w^K2Cf1J# z8+F`~I!X~YO~+T)3D$}TacQni(|pXjW&~C3!to8eKeViq$uPXbu(*5f9{r5?fx5D! zKI)Cn*=f&lewx_BV2mp7u<bD!r?lXJh#E({cy_0S| zy*M7D6@t~#Gtn@Td~W7x0rN^oz2y~v$|}GJdH5oaJSqU(#qv4w?itoE*8y&0{pAM0 zB2IX<25^A&H`v$5J_}_?UnsybEW#4J2OCg?Ral2L$iWKaAp<4Iru3I!0SwhDv93F% zNrYTexyla3WoI>z;>8JGqPT0UzoSs5lkBN#c#+~y)ZU2^$qz80C`5PzZ z00Y|Ov0J{={-WGGZZ-V=a6xD^lUBeO;?*#qV5}gS1OxhDa`6N=yOjSP-o6!hG=mcD zE(=0u9l+b~NJu>G2xmb^G#Y~fn2xCh5|Wqc$4|66z@FctA`5N&z24V>r0qnxNDx~Bozl(-nlBfJX9x#htKgL}o#K!gwP3HMbo?ol_28^KHLL`bDM%;xa1J1ACy?De;M5DNp^mdm)rTT1I3O9{t z`8nc|4+WUY?JGgS+`4KBxWqz=)BNs}Zpo{m-H$)nj}YlgyoV4i^j46;r21?pnqtK* z2`l;nk#OerRc$w3zYkGAy3>vDyGDkZ+j6x8tj`eVCSfH#m#&1G<}dUCkEr2S*p<-I zxKFPWLQ@`hS3*p)ApSAoAzm9B#N#i*`412WKd!)#o}#i+Qhhciq{Qogi3yzK(zm39 G0RI8dA1pEe literal 0 HcmV?d00001 diff --git a/src/WINNT/kfw/lib/i386/krb524.lib b/src/WINNT/kfw/lib/i386/krb524.lib new file mode 100644 index 0000000000000000000000000000000000000000..b43d494f74683cb257c3cd9aad7ff9df8f9e05ef GIT binary patch literal 1976 zcmcIl&2G~`5dQ2WO$j-K!jXy~m8x7qe(a`|5OSbMM0L|BO^;}s+JQ#>NtGC`Tzcd+ zcnEHN0S+AKohvUu*&WZ!H?y-(Uv>u0!K=)R{Aeo`tJRWW6xS=G z{Guew#Z|f5%K%6N`ZADg0I4%z?jq=Eo3?Br>RZk2R$FYm-FefhH{07SaX8pF%LasK z?ArGDKE4D8g6;OZ-NvTasI_Y(&^taAQd~Iwlh56OC!9go9g0KO!IYg5$=*rN6J2i@ z3WSVXBTGS5R8I* zbQGX-Q+62Zr7$~eErG>973;nR%o7d_MZxXvfBLwz6OcfS7GD)1XA8O4g`V5-I!k4> z^@tWfsQ;FX1kDzT=knaDWFt$9OX}(z^DX4hDKvP1drTq|Ikkd^ISvv3j$0ZTq_PWJ zJ!jA#_CI*}mDcmTU2kj#+gCVMTE?a2i7FTla3~h|B{H4(j*4yYs0Ht_m9as91mh~-H|aXC-EDMHSiC;uh>vqW`~jF?#Kq7<1CwQ6gL`1}yVY+8X$fO;SfR0FTB!nQ3H?LpMG}F_s=e;-0 z5`riLDB=c)h^T;oiU`OivPlqR5s*zpL_|PDz)@gA3?HA#@6@g3RNcDO_x5f6O6L2{ z)a$A`^{eI7dg|1D!|u&)YvtlC-ag0wH*fC3h4U6Hn7eS$_n)i(oHsakQ5JN_7DO98 zM|AWc(J_Y*efV^u`uH}QPJ#^)`pp*B?=#(3Ym`>Jo zD$1tlBDkQ>?x5*Qa6zXbzlu(S3;Nt_O~=D!LY|pU?`wJzF6i?IYq|?A=#0ghE{6;H z!p@q`hYLD$TTQ6rGeKY6Qq%EpLC8u*UARn7W%Om#i=s#2g3el|32ku}=hLbkTmAkk^Yq z7cbF-yj~2t1m$M>7RsyW7`RNxC)1_NHQf&vblFWAUA}-w(S>k9SIo)iN~ELcD7Z`; zGWzxik)p@og09+M6WZb`(03MVx)LtvYUD}Lsc=Ep%+mA{T+p?LYC;*W1zoqVCZu&8 z==y6j`tDpJMd!i=-7s6zNpL~`L7FDvGCiNsjT1zQ*24vTZ&=fVa6vcir3v+M6X<5t zt0Lgu4Ep{eO_#$3-LktT#JvS{>rzb*zy;lQkS5g4ZJ^tiYkCqc=m*1^9)%0KV}DI( z(>p+SUY*fhD6gUm;DUa*t)@@I1>OBBO)tU)-Lp~?@^BC6-aR#;4EKWWJ13+2QE!Tl zhsy+BrXQgl6g>eK^uU3dZifr{@sOsA;DR1ReiWSum+AKz{bYnl(YIa`q?2witdLCdgRiKem;jt(I??Dy`0gbD8C}aeH8SIC7P~; z3wmrPO{c>JJ-($T)WPGRr)FzHS)Ky@dUH)j!ex3Xqo?~sOwXWx6rqgIfS!G~rW@db zelw`)0=S^{D7T_B;DUaO^cAgx%k+ngeg}C~^dwx+a|dX;9WLnkAx&4o1--B+qZ1y% zdYH4)Qsz-BsrmZqcNg4XSx(MO&oVmkJqj4oS>aRPMr(HT9y z0rdrXVqDW>a6!LBJ{8>o7xX0ZspxXJpkE;$ioOIF^z>61ZCF6WbOrLnbUm<`?%Xq@ zQ_zk~_sz}dkv$*>pljA;bjhh0_fBmz_I~fa@7r%#V~=;e|DF5oz3;O3?blecJF-O`e!rQEQjk`owX)q>)myu|F|u~N6)j9Z5~m=wk+J3q)QFW#ks}vWz`Lq_ zM4ZzE6!0mL>$TU6uU);|6L0|@iIYri?Q#Q}^{`x0E^537gWHT ziEN~Ef?0$War+XR%X$fk22LOsxm1Gig1oHlwYyC5-VK;Af=Fli+R?FLH}Pv($oUp? zG}?#v<6K!tf^)Lz))@g}Lx&0OR%1B^yj6|f=#gTXkn{C8>@+ae9$(R4=^DG`E*?3kLTh_uUOoM!8I$2RztJMkdU)~#6;Vzl|0s5kjFd9ORTXm zv~;I4(ol2bkXeni8U>+Y3J|dNaEv(!@c49?nUFb~qRX}#h2dT*tDCD(aGi*3lYBs) zuiG3S?yP1cDFKQz2=aJ!n2OhF_0e7JINNH(17rNXc6&I_XnZ}6Y(2+IPR^@cgtr>` zfMUMJVWU|8VKv=c-IF!trICx|r8n6e8`TZX?Ik275)$ErBuDv#zt7d~j*c7=ZQsdA zkmPNSwbqU``%*Z}WQaw3EKG7^92o2L+#j_rH ztl#X%gf$u>5Zc*N+f3IcQ+aR66Rv^va#nT7e7tNOZ&S{gt*0NqsL$#A1tk=`BN*g+ zE7fAkAo*VTxWR%@HMr&pf+Q~v+CH&vA9eM@CmPMn=aF zZq`#7Ul0=E>|^@RF&WQXd`$UX0Wz847UTiZ3ySfE#ZqfbR8tsN4US&*8J}2857y;~ zS-hYeuRgQxwwq(C?W#{zoH@?6K_PFu+ZAU~ipP3|aaVSFeaL#F&|`y zw0jGFh$IL}Yk672b&%z313y&n*WcDaPVXoqAg>rBvFUz;OOm zuk1BAyPS9sb?UT7I^DyX-Qni)F?XI)knteu)M-zk2VhatD3$YEL zh*PJl1}WrvWXdY>V@{oNuQ@iQe3&>>r-t#MR4!$_;#9rvt7e2i4!j6KIuq^g>d}55 zbCF)&yIGG@i3f*iba9;kJ0G<;l-&}|=LH0Osu6g}rq*EI+>#Fpc%gv7S!F}0j%>;E zK>=@n6c-ITBO~Z{VwcLr&4mPwLf0z$rCyS0{2ePUV6hY4;-Gse+u!RC$(a=t!?e-ezy*29k{j&M~ABc||*#?6*h zcEoiYF2Lst&twfy=zR+wy~?h?b#&wB$5!X1S%&Pz z888IiJ`V4^_rMn?O2WY)BqG~S9tjGoNQ)kVw6^=23!e?x@+k;j+aJs7m zURabn(=|j`T|ksiul^&9A|%SmBctt=E~~~n%41|b0w;r_yu3!ow7+^H!t8|!Zuakt z3^$$X-t!4!s??R5W5nnk&46bCa>0dZWcP`!^!X{cK*6ui0E783=Uc$Rleg1}OD-EC zIeSXRv&ylVTpRj&9BnfyxSoN9mFFqq=dP5P!5|ip=W}NzZZg%JK~RcUowIO!du)_T z!;3OyT09gejnSIMcxR+JI%cIYo^Uk2Krwgs+fd|Z`(fJ{@gT=LI*zQgctPUS0ijVi}O#q~px0h#@k)K8=o{Z!eqnS!nZ09Fpt5ZF!V|Ab% zR3rX^%gDMqn(yKkpIdm@6sCwHQo{*Grk!PtrY&L4S8#O2#Yoji(nG}4$+lR-6uHuX zao!6Noca=r3%2Eog-pXDem7$g{}K@m!q)GQV_@g~Vc06dHgerNti8MGn{1j~VKnKEZ^=E&}cFS=fDpwmB`cN1y#U*e8Ns2K7&eEg|UO&%-7bv>5h+mxFfx0&KKF z+n$L$gSPx4ctC7W-UU4cI`qr13k5AZ3*`XqaW={U+Tk4FfVTJw(UG9_po7mv`k+0| zL;9c{&xcJrXv?qStpLyl(Ad{dCeX64!|oTf_yX7=f_C}_U_o17i1z?Me*let6LCTN zU4(Q&OD;ybpdBs&?ziyv0B8ef`K7SM1>JNR(Spli2M(HZ1>(Sd^(fE=(8#x8zY5y_ zDwG4X_&c!62JLV)?E68pt|58}bm+Cf1nqkr;(@Nco@nlOVe1Z>eFNGI#75JTpyxpo zH=^vI;qSqY7qr(+nLYH9o52fO^nK(RwEHda2Q9r7Z3sH(HslAi{C2brX!r-HXVCt4 zpsb*)?*#5$uzd$@`$N240D9HkL@$C?-h(tid)^BS&^h-ZZ}+3^Krez0{SjFC_S`RwpXQ)@urH`OKe~$MR zKre$)(l3$<>K|4JL`2lVDIPw6R{ST80necfprPksCl6Zm0@~*U)Fs?Ij)jaJhq_t^ez>!a zM|*>I$KTI>1a*w?rI$hWP-h#Eukj~P=b!_A30~09lPEiA$6rDAKu;l$3pOAv$j(x< z`<`fnC8wYr?t@ID4%R_FPQ3*7#2exL3)+~TpkLC@=yCcvJwlJtFX%Dals2QE(yQpz zv^o6|Z9#ubv*=G~E83F&l>Usirq|GH`g8gV`b+vN`fJ*T{)S#lFVeR3I(j|Lp*PTW z^hVmA-b6dln`uXS3++U2rJd<*v(38}p<vT1y*fk`AN8 z=?FTK{*8{Jf2X7ALv##%m_9i*(I@DW^eOr@eTGh^Q|LeG zRQfEPMxUe8>GSj}I)lDIXVMoj{QMVvna-lK=^XkBolED@`Sex#8hxEEpl{HH^i8^m zE~ZQ9TXY#+N|)0WbS3?szD-xrcj#)mhOVXS=z97t-GGjIBRxgGrl;u{dX|1e>*=@j zJNh2oL^sp-=@z<`o}=67cKQL`L3h$!^h3Iv?xB0>KDwWNL=Vu9=|TDlJwy-F^Z(!4 z|EF4e6RgIjVH>ZPaFupM*?NUHZ{e=hg_PNuaS8?7(9~A8{BG1`r(l<<7I6iZ|6)~U zw)(*tVkCxtP9P$f8!b{b5(zG4vM>3}38rtIFJny8%3da+x0u$HJ{DHSGTz!YIg9jo zQqwV%FGwkBoMAT!*l$1r)$Xu>fBN?21qo)`NN?{Xvs1!m7MZSN;9Zcf5@xn))9!Ek zY}Pq!YFq1)5|Ewfhx@x&#u1adRxe(k2u-&?B2=-FF33TNHUm(J3P!9dX38Qvq3JM= zp1djv!%LVJi`232H6}sEV%OJHmNX0YlGMkYl`MU|1g2-O>m`BC&o`Y+;j-fkK2Gss zO~bs_<#-FDbWl|WilN10z+1_HQSzD|TEQYwva@*UB^Vze2Q8#RvB)X3yyIDpuj;#J zdBVia5E4z>X^uj+LPQKq&ekvFGJ)B-zcK0yV--te1v@;EXrY0f(pvdPmL6Ng08fOM zwx^RkRW0QtZ(Ly`VpOz_lbqABb<6Ry#oL@PIhag1w6YyhkjaeSEakLGKidf<;#ITr$tC1j zzNmekzn;p9<;CKKfH~GMhC1nVnWL^n&D02WEnlWan68=1)G1HHv?NG$TBadE8q+ZI z2vXoHh(fm;hK80NLAdF_+5OqfI#NVo@yrIv%w!`BG6Si)Di8)1-``cqCM_zUE|1;T z5D?J!qDx>0#VX}sWI))|#uR>9W*AZ%oP2VLjZ8|7jWF)cStj|8xev-=8K6JnXtu~k z1|ikW8GKN^pDC)iDnm1G!QF{6m*!>q>fOG~OvCq1-+=eymb>6Cc}ibd_n5Ma z>lLq|ixi44mKR(E^LV@Z=C-}s6ov*@x`JT6^o%SH?42riLo47_ccbF>m~hXj;?1fc z?c^;fjAdpJjjiQ)MPkCMT$}f@;4aTk>-Kw)R`E^t!pmKaX`8(-RcF0M% z@^(j*)$Wmt^sCh$%BhCgGq{h;UQQlaSh3ShDS}m4 zfeP3Q^Oe6U$n1~gwCV*og|Fvr9%9ct<4WEvEUw-S!?FUqtNK=L$0q`|0<5p6%+1m= zI$&NMnxiDA#?8gyf{VMlBIU>f<~eS6zMKo<2IG}*E+C?)Er{b@vd%>?%GrEC>ZxPY zNlYOdNhEklI~OC+5&Ge3<~71m9sBZG|AGTFvDu ztLR8ef-O*|=6I8p1pZKksuBnkpt>M|FAweoA@ZH(+NYvpSV zFQiJ;Mdpo{Tc2ZZrh^L9pe__$h7VZz_}1FlB%U1BjCrM}43O)3(;JK41J-<+#i%&7 zuRj!9i?!gjUvm}~KIfY$EZsG5Y-V-3IaQ|dk0>#-p!h?%S(s2q(r|}6dgCvYlFrM$DJ%W#HqUh~uu~Gn|2o!-BzteREHx+O&LSV&)xr?oRbqO%<{n2g zzR^cEePy4H8d3A9ki3E~^VZgGcK9>*L5zym#8Ts4#4@|Ux=OM6Dm>{G8@QBOL@(8# z9yT(WdFS7s%#yQ@Qz})R@H3L(Cj(zrVq_X*FUZP8)YmnvA8aHy$Zn|DaQV`9S#}0c zrDNSn5rR>=xg?Cb&G#wbH`{8v?RH$D0gMRAKb|O5EnW@S4iWV&$P}33>NA%Gr#N$d zt`~V=p0dov4my#l=$wKqi=I=BDQ~sLc3LlI#~lO+by$oK-;clx_PLk+Ov6M)g%L~y zzvVbYw1pjJ*k35TY(}IKE35Y6N9ye31BH*_S@o7k-)f_D@w-RM;wtv-x>?lPnLxbk>XE`nXV#LPKr&PO@w2o^0WhxHNRBea)L37bQO?S zEop$LQb~nDu>zqK>LlZ96-mY;Ty}!fbYrVLGI67eOfaZ{D$~H2VGh1522NFE(qLb! zB$A%qA`|R^V#q|r*phnTDtM*JaRrM_02C|`R|(aRVuunZ|D2Rl_n0_N(PMlt`1{X5 z8Rd?Nz_)dRmz{itj)`d149X)^;waDHd8N$HyowTi90@a>Q`zYFzOu%6MqfaRiK|r2 zC}ydYF&;tHA&Os7>UkkNjAiWyxgFL3K7fd8p(_k%w~M^N)X3rBpE9ge*VZVBAB1O!k2vll}DD4 zISzHJGAk_ZG{Kz-*gQrQ99e=k01H!Z{Bp^m1>G{tc^k>Hlco!@FUr_3Plch7ZJgY@ zHId+8dn%O@t|FzcRaL0Oa*xMoU;l*|<*79fc4J}}R&kYt7!4! zgbD~wgZ*$Q;AXoIsg!q}pZm6}_TOcAY)qNSPxZC<1-mWK-;FAQw)k<9`9r%ywAGSbc*Wh^e!dBsjUO(rdPQHT*a|{`YEF?`}40>-Ubf zx}9EUq(5iJ{oXQX>E8RiCkqb#XEf&I6ktECer<*SH&ed^3=Q%0g3N9<>x1+^|6}l& zga2{vHYQW%A(%uZsV!mlcC zA*7^K51YSmH&Jg{4}-CPvfdIsY`|0%%OdwM`A_t)1;(G_-E02P?#$M2**Yy0#maSR zMRCp{TafCXOE=-DO9o5!9y63s@{@#gC$4DjXvZzGJA7@2dgB}qW>yOhifB=FGl zvR9x2D`bH|;&&;$!R&by6w-u(HEEw5}(+IB$O%%J7;>=IJ^E>*h&yT+yG4M2RAK@4^H0%RKUYKH2djNCt7Z4mtn0`>3` zCEVQLxiuoMDi=vHsb0dtx$!#P5heU1MpWgA+qlc3ir=N$GKIT^#f@K^5LmMCrEmud z`pBD6UVgnKE3d)zu4G8q>b+%Qyq@0#+*uaa93hH5c|FvDIO-dL`X@P5dzqvjW~7Qai$QVMq~ha0_OBd}&vhW{*vn~fNJeMiDp zm*K>SzqP|PSAFt}(ucEj-_0}!z zU_#3NI*OXVq$Z0kewUK6!GhW0Z7B6N34D72P5@SywSh#P|Bag`%xD6QfxcZ=3w5wy z4BHuH-Zolh|2mlj7r)EZcfs0Y9bfcmq+Fk zRC88qujI-Mh~MQ(o*38O7{||DAQhO^+qyu?w@1xypC4IJel>ea9QnIcnNu^@o1$f& zp_!{-OyT{^4pCftt5#NV<+WgH?fd2^uDh};fyM7q^_&{NcZ}nDSFZ(L)Dc0=?Ecv?>ZmNEFvAE&A@mh$9apUa*(M}BR;VubVU6KlBMLtoRD{#ey z_g4&Wp1>2g>FePoaV}RYRIrr?}2@n{$zo+9h5nuyckN0;qZm zr`9!#LR5JfsOCvPYW2LEz}1lc+j#X#oY*P+Z5~%@0Eywv1KjHL`&}DW7@m*weS-1`aT~I z7h2nsFlmORQ{DY{YM$IzqVid(XBbiMj5sAj{}kdz4-7?J*B%e{^AJPBS%Ea8{qy}k zYKK2o&rKQ(L6z6HDgDwihnctdl?APin%F&jK%n~O#1c~cF4dx`oznge(HMOCMhpUM z8gp4m3kaLUm{?p#@C!a;8Ryf5~GyJKaEpMJ8&O z^*|rj9MjeBHHq>5Ujs~K;aj(iiFNcrKHiM9WlDZN=;PrK$C}KGrkjTR6pRV1b3QnZ z>Fkf|)^DPZHhk=vTm2<&fF0svx_1O>)o^MaZCb?ekpc-RewXT-sU7ZeiD(``5CGLB zD5VW)g=pUE3KCZQE>*@9>aak~zuX{@W^}F4wy3#RAtYqwSv%F5BM#F&IZ+EOb&q*P zh}O{WS=2*JoIkCUh)O%)J(f`mH#KvPI^5`!`Vv_DE+@H(S>;fR>%H~9{*DF=Ncc^t~7nfs&zY9uts<*>b4t4bZa6Xx_W67YocC&ZMIGP zPL3#}{9R6#66YHI0JAebGPK`pbz%-S5P{=kMTX7##FNbqEUi2cLN zwP|9+KP-b0Bb zE&t}@29H5W;T6Bj_0fb39TlMJho%I?G*%6Xap>QDJn?dpU$r6w<;s|t(~kBr?f$nO zVrr!SP#kf_?Z>0&=D{BcD}I+M^FU(eJIO;86JOnv(8O5$2@lgfM<~iwdBvZ) zEBMI>UUsz#lP;zqe(JCmc0v8}I|QF9#5ON5)kZIze`DJ%0BM%Q{_UxaVjvY_mYC~k)Ikm zV=8>{erlaOq*fhYD9S_81W~zvrdE4rdg#%IUuD57W2f$ge9_15;_b5R-TUw$t~zRB z2k|8jHTPs~z0xLdzwF`W-ovejTQDQB4dz)MuK(Ds1Qowa_3MQZaj4G&oMKj#x0S@=fb=eMEbDgcn@vm9k(C z<^AY+KBm;H)kIBcF3s;WH^QURe>9O^jToZDldhb(g1zU;^Mtz+~jf( zO4mV5>D<3A5zS-O60Ex9CeC&*kZ3b?Uq2zW--zJp*RX3^O{MnL7fRHbyg^^EreiJX zHzlU`KDca5@w>LHUL+B{x5oua_1=*fX)g{D&Aa9ju)4e!tP$s+Rxb$=U*Q|{-;#L# zgY31+n3_2+m6$kk%Dwhp3puq0yv#@TpOUYKnrPF@ebiU{F8vh}FZTw%ET;Hfs&}Tw z^(!5!dtYAwOym4Ap@;ppMU#*BOE~enRM`d+Xje%z`?|eAs6Of>(7q$l>_-RcprzXF zYKaETk@}#41gkv0Ehsp5-WKEAH4;sKEkS~b-=$hDg>|iurM|=<(y!iTiFyCJ0L%Nz zg9NQ!n+3Z(e);u!iE2KXPzx<}fAPB(E%-h~J;cPwd4omtKYk$r#qUxQlPckV*w;s_ z3N`z%h5(tyI9AYtY$1H3E1~@Wf_=fE?us$7viY9C^*#wwucV2Sftw^^@VyZUDt?!1 z&xHKkY%z%0-6qjq@mcA1 ziKb>H|A?Woj3j2jANW}6vo|9B%Cl0c7VnT)Gc!LVPKoYxXuPPmC(3nSvq;^1xl3Y> zt;X#l`^6(!sWaLWekd?oll(m({>GDp6Ti!iVFmKSFJj%DLz7=I5=b%!rBGAnQTJF> z^BtRF<3f>#Qn;y6=3a-3a|~6t1NG{5uwZ^*jrDy3E&gREQMStUn>w+%-$QP-nz(yy zz9v-*GqFbfk&o$rkxGJA?=6XW{{as*Q^?OqNfVeq_Au2av+M`3WI@I6a*~_Cd@zq` zKdmKjW>kuP;$ixq0IP+W7>^$EFvHJ_y;7(@jiJs={U*x#ut0T>1I)xNsg#cPXHnGP zlWVe~tM}K$x$Yw#x|_uPD>MSWRL@D>*8O=DG54)F0a<+ymO77o)W^5`u&kYft7+Bi zI|_A7U_N}Jl_KISm}Pw3S`OsypzcZlXY4R(7SZdpVo%E?v1IU0ZC zE4OTFB!0F4+kW4&7II1t{u_%dKa&|gxgp@owQ8cju8$&`4|58n%B`C!=WiWqPt7%* zk>O_Ua~A@=TsadbjlUC!-UmemNcH(VrR96hB1XPeS`RfbDm@>fy6>IV{yI-;_4Gn9 zuKdnwt#U6am}PgzEW2R}e02?(jm6hA#yca;(XqNCWx;-a4)XG!CNIGUVrAjQ?{c!8 PSS!CM@w|`E3KaTZILdQv literal 0 HcmV?d00001 diff --git a/src/WINNT/kfw/lib/i386/krbcc32.lib b/src/WINNT/kfw/lib/i386/krbcc32.lib new file mode 100644 index 0000000000000000000000000000000000000000..03bbcdcbadd156913b2873f0ec7dc574e5179934 GIT binary patch literal 6844 zcmcIoOK($06h2N!6HK1YJ3MMyTG0(9u}u=GLWY1;L3STF5d zPJW-Zzxj)ci}Tsc((;0>zo?4ynT*OlNCLnjK=LEN&5*)DWd}bLaLaO>`NKD z3?SqUrYI?FC*(P%BnMK)?*j;Vk15JTUdd}rQ6{mSkQbPeU^|kjdrID6iZZ>V1lvrb z%$!m35>u2}9H)?Hn38;uGPemZx9K=HZmr+mC^*-y-&xtXv0k{n;XJB8ER`|~;5ch{ zS65pN;CE#q>kB{LUAyUAyHdCU&dN&R`kex{^mg~0K&e!6N|jo}1;@`xJ1W=RVpCPA ztf?!zjb^>}t7vEPrgp3Dy3X2)<5jn6!o*hCb_i2$_*SZD+f<9Yav-83S+Xtm>Rz?v z?G-D2PfTTOx80^SFsp1?m3E5NZP#gf3Yjb|oo$ViaGtvLhF7bK5eRcjY1x|zkzHUu zq+(;ood{@5PhQn)dc}(On_L`TG&Yr5>5)@+A3wnz6C<+~#;&&K%8|>A(bwJG+EbUD zp)8tPWnhVGifbZjqfREVR6Lpp=~$lLsIKFjZNJlYhnHQ= z{#9)JMen}ZQLRuuqKoFL5x&xTvGDffA(k&-Cqif4WJ+l|4qQ)I&G#IO_LYMQbJ)DVzLY6N<~oc=c3%~a#qE= z50a~iUMT#V$qy!w8B%oX+QJf|!eZ ziMUI@IoV$E(;ds-v*v#R8)FI)5`=+dEU(M1P%_Fn0yDud6+J|u$g7ycbiQJm<^wnw z1|v&J9DUDoAeN7}YTDTYICQ3tDI5_M=oo+jKcyo(5RcXXJ z&aik$$S^uS#kq*{br$iG9FK>a9I$hr%!RKeJ~HtoDR+-nQ^c}eA?5U6l>tA&zy2_; z@{#-ioWrqvtewlYIcq}-jRoPX`$KqS8x|Q>SXPAJ9hweo0_%u>9pIZ^uA_K9bcfRB zl#MDB{x;!YEFWvHauHm04rer`u)^Lw45#yx7IDLTg_x;OOnOswg&1+tzDC6HP(<;_ z;*cGm?p(w!ev6nBEtvc<$YEK&>;0UJK<#>UBhLFbIMb;J%p+LeHk>wXQ27g)ttI!S gSnHaN@F3#q8I7i2-yEo8ziAgu&T1s_wC6DY0c0A`d;kCd literal 0 HcmV?d00001 diff --git a/src/WINNT/kfw/lib/i386/krbv4w32.lib b/src/WINNT/kfw/lib/i386/krbv4w32.lib new file mode 100644 index 0000000000000000000000000000000000000000..31e0a63522cee8a48388b781e0bd33eb7a34bb01 GIT binary patch literal 19668 zcmd5@OKe<47QIPGm}8G6HI>O<4^mOzwOxhx%0u80GWZ8c6ZzEal6}ew+TT= zvx!(C#DXPDq>)&J4MK>K5Msf05F;@x5JHR;X*P&emN4hmef6s9^?Q|WcSf3)uHU=2 z?yFP(d+S#DsUx{se*W0{16}T~w`XXmH`9MG)8ooDo9Q14U$3kuqK}ET-yrJ#k!Z&j zqMc=-zUxFxyE8(&J|kl4`$g!$Eh46#uZ4P{$CUX(XkZ7CqIdBG4OWB>eNM!5_BwC|2QeO*4xJSm zL)n;)e!~<5XU<)`Ff|>FPdtBO>deLI3sb@5)YzrWi~W5R1m|DKW}7wWuUbVErcb|c zeli#zogSrNyj(t)D^*5%`Sa4^Qjj2-e{QlibEZ;njPy|8FxmQiFi~j~Yr(}_y?(V? zD+J@ET)8?oGOV-ns&L|o`CMhL=+EGGI;Bdf0o>A?#b6;*31>Qud zbD>yo1dW9T1?Ejs=8BDAp*F)g28}nM&?HFI3yPIS?b=ADN#7*McMCzOUP9ASVBSnh zCAWwQaEiQ{lv*)YUX-NpHB4j0U@2Ft^M^JQrlT%gg|f~d#=BZeSJ8UXFx&|Ip(S#4 z8?!+yPa`p!^{`=?NxS)L>0CfyaX zu1;wv1Bd z7wXHH2&`uFqGb=TV7aiApI>lCT_jA_Z&udJ8s}{K-sMbQs`GgaOGXxJbg*Wc-ijEL zUcqqV{*WvT=W1N7l^Q(bQ7l#oS);?ySQ+Q-qG(>U%295i`yh)xsS%T{VpHRJRh>~Z<>NA=EiJ-R9d@bI2$zUvsriDJ@vxv#3DLxQ)$k-s9^5aON?0jn zO6d16m0Or+r7XG&E*t8w8zI9jxK>@Rq3Gh^Aj9+|`IcKzdm|`_I3u&mmAvbV#F9+O zxq9}9@V+(>I)w0MjxIcsRMBwNkr%BRsLqlE$ngM64MT)N|JoLTq(VQR)#+} zx7Y}ns~0hbQpBcK@Db{{*|6#nW74^8*jk(RaV17mfkTtir6pa7(bPHQnllYWMpp^A z04Cd*$mn9`nz}@cN#`EKh{;zgvr<4uAbPxfW~;fvWNjvsE#~U;6TCf`=G{SE7T5Gt z7b$XnVX}+t#v06oB=_5}l%d;e6%&#sP37yls#;`p>$%s9YI0$-f%OJ;0S1~YE;V21 zb%FK5_x7VH!%;NlWg@ztph|~_dwQ5^hE|S zmjR-8L6t$G&#^Cl|1i;&qeRmuh?d5P-aJFJ4s;WA9(&-=K;4r>?}4r#C)x`72zhPa zPxLnOp505dZ4c2W`w&kUC;AHcbPr>1k9_+^i7t--AN1)E_Vqz^bB>=X&RvmG)+BpfCgzF?WO&+g&v}Z=@ELAw$fwNM_Ky+ zFX0+D4st5ZuZ-ElEY_9u$ONaR$3|8X#z_s(q!w6aeyrG`&|7$;lU@ZCElPD{*}6GC zhh(Y5?ER~)pY{h$T8iuHwUeA@tDbA(hBMuDb=@XY%;v2o7lOBG_O{vRvxku4(7H-Z z{)LsSHsjGYJ4y&6SHiPh5r50@yxK?ct3+`;DurCwj)zeK`6Rw03Z-^zP(-%-%dWEc zzhN-0Sw#wmaGiL_qLAcd>J${tIPY4hqiBY=BPtw0Q}#15wYT%(Q$lB{eoFJMk6WF4 z14zoh4NDeE?LN|)+B&|D*`8PICgu7?NRFSa85| zx$LqqbzPNYLW~>YizC-jrQlg1uEHwJBuUWMf&)v92sgv8$Zqx2UXP*-~cX zR+MF~{bY%4Ihn_pcWfrhJl0YtH`z&*;95wCLfdG1iQl--BYPMV7)yu*%Lc}+pK}c6 zwRm=-07tei$;!o|QRY<0oB~6oy(Z8g|Qo~X@%#Rjci58*fC3!Ma(j=ZnI5L(zNq6u>-bBboL=ad+pZ}ds$+c zJA(Wxee)VG60^E9&m)eX(Ynrzy`n3g=a4y;(5tv!quupeOT(2LJ#UWk7){2ryH0CP zR%mbxi1Rn=h#+}APCr@KNACLzPxe1X3{%x=;wTm`wyc5TD4xCZFKFL+TE2sa~`pk zgx?0p_)E@#gB$#|5r5aJHya1V;BYg_yLQ7X^!x7`k-y;|7jQM{YL5`9BF}4ysvsk+ z(UJ`7KtPesfRV8LDgG1wIClhULXID+5%3_`?Un4{(}&A?yUMMMm%f2MYrL#h0X2K_rm;cc?Xr*tTKrvG9wzS=D!@X9!$vpcP0HmXn z+s!l25DAnY4@aJ7_RpGUh#Ja|_5P`u@Og*Zx0N>C2IxCD8Z!f7qjvEfJD#N3RlI^d z3K%RZPJGSoF=~6<4-6+GA^eO;Balv|MDH9}n`vdXWl~Td2jV$Kbz^LH_GB}yU=8*s z*AM|@wNM6Gn8?()qm9;n>kjHgCDxA!fUD(NVW))z9cY_rrPk4M7DMg=GD6}MH1B+D zh_+jKKwl4y;qk;iOaJS&9I8Je#> zyEIxXK+zfEU?zFA?giSIMobTXIN&zZ(&$OCVQe{-OPdy3v4Ps2pT2dS$E{jt-RpuK z;bl_h$iu)|7vf1&$bo5p-g|H^Fiy1B>`F{aB=k_hU4+mR0!BKIs4slW}-y^`dN8?C1)&a7aR@%)s z8gab_^+`SYwV~Rc1sTsw=U|uf&lnvc`7G+66cQ$xdr;jGp3f)az?eEuu}%^ku=eMe zXMJX$UZJsV4bLe$MDtjloi>_^8h420sTl`Jqnd>$5uKs={DxO-H24nc1jm81nO0_< zZ=W!ifY#^CuNACXp0>Og!{fszyFTrs`DWaF3{5RzvFh3At+b|Z#@%bknl z0NY+S2U6@S#~_}w5plW|9fdlOHq%Pm`sV!oF~kJJ-gXUrG3LK$ygRdYrbI!zfO1(Q z=>uUoBeol_?NRD$$(Q1I>Hyk-YriEuzKS|*;r*mO-gcmDrj;?`TU*#`R`bBzzp}G$ zyA^#N*ozjHI#urs$>TNPD!9}tI`wy;+V3mRoX4VL`Np95wyE%laXTyTU+^_IS{ zU}xTbU!}yu`Ml_ag~YcZ9H92w&r_#ATS%Rc3ZHFzAVT8*+m5dIIaRZnR(fk7r49K^ zp``JeZi(0^?fVKouab}N)d`@B=)S0XI*{i5Yf|zFKa~SUQuUwzSGk@LFS>En8Jf?-JgU)nXU;9G?{hhjHq*-N@YN6h0w(pd zE{oauw?8+0QE2>ASBR#sqIHPnu}XY(OSPfCuIxbBOe<~Zvl4vQM_smMf6uu^XQQm3 zB|SdNCL2@k=s93E(@On(@ymx83;P|p0BGmDf;xG6Y)gp4gTFaYWaG9}Bae5vl?RI>vk}&vhybVTs<`#o?_(@=@6xG~&9u~dDP9pH;9o3(VlH*sdAHwo S11TedmlQu38i2lT&urYqL~ literal 0 HcmV?d00001 diff --git a/src/WINNT/kfw/lib/i386/leashw32.lib b/src/WINNT/kfw/lib/i386/leashw32.lib new file mode 100644 index 0000000000000000000000000000000000000000..ff059831dd649594b9163a4fe136b0543c029c9c GIT binary patch literal 20078 zcmc&*No-tI7QN00CLKazx*?-8PmaebPZ>NU8z)8XRln|8D6G4yZXh?*O~#~?*OO2066;t!1+@E z{r5xp6~9s19t*kfDga48VNeFvg!Fv|Kr--1$c3*FhthUWNV)((a`o*{e!*{)zCj_q zp97E#PKQFjQD%^XB=we%t1WmRO2;Qc#$N#-xr}8b-R}vR>IEPfLfc8&hlPxO4?uG9 z10g-=JIU0iLWa>^lFoBN#?c3o%h(kBX4@a85)ZchKPryD$P{^hwj9RYuhAOf&3 z{qp>*H$Jj30^XdTS-vspJiS=KdHx#~XrK}3?Cs3zEr0D!POn)} z8Sol|bPHn%Y&RGq`)0P6N<+_b{(8Aod{e0?E)7wI{CZh|h@!{?Kf8<$%aH8ts5C-_ z?V`fsVu8Emm%Re^j$bOR7G6!Lfd=(b|XD`yr9K6oyj=yGDp7FUSPTPqc_ z5L6ICkESU(tx6_&=7+evPPf_#Y`@CHk&CF z7Bksp*?J2^+`o=JbK5Vhc}sa}TyCqP5_sw^3tmwPd^x}3ufM4_Xi}Qgn)8=38wHG$ z{E|<4*%+!^M za6PX>_JgBzPnL?MJDE~WJaoJg-W3u^_eE0kI=C|u$mER#;I+u^NHE=>z+1OB45ItO zl-vgH34@sYU}|22>;(hqKCI%?ocvvo~pSK#VZjA8Yyj ziuo}{w|-;Y_i$cG*{x3yy7h^Uvvcbcgvt6u%kP)1PcXXmG*@^l`Bl612|~9%(Q$Te zeS$DqpJ@60vh@kZW_?CkfAZl~+)W6Z_3GWa^~v2P%hdaA7~T3{pmH}pgXs1%C2v0N z0E3A8W$T!l*I)%%eNY>LcR@&!w4%X4^?nP);e%R((TBtaGO$q0E(fbN`jsi?i>rn? z!3awF!l>qLNuC%%+!rH&*CM8}3DmC1t}El?gs^rB8;uJhBYem~z7eQ5uaBl08aLn02egvX@!)My}6@ zfo5d#=9FJvC@%Xrv^tfdO;yP3jnOn!kk2mrWwfA@-dxLM$@fJSbHQd+twq(FYe8F5 z6>O38=30UpR{WcO=`Vh1K116R)f@xFT$eYJ{qsh?;^Kr+mR$KvJ zdseSI&g#tqz!#?hemDzo>O8>xet=(59%Jt3)eBgLzt;u;KI;Q`gx_Cd**(-1(g1H` z9_Sa8LDYSYd8+9_{6;x71Mn8+g<4SeNe93y z0X)PybNKrp{%%38hm&X{a=nlDj^ghf`1?n^_W|1XI&!~*ylq&|&&c}-{ke)hq|lz9 zu-*bT%;GhG@9_KEIjk4u8@$F8DEtm~z)si&hoJ{L;RQGWr{Nq7KrbACqc8*);P-F| zcEc!)!CrU{n&Bzf2HW9jcn0=C3yec6q@f%3!znlmZEz9#;Sd~$5$J#kxB^EY1zqqW zoP;xQ9tNQg4#F`QhIV)!F2f(73AX&-ZFm;;z$8q=RhWS(m<9EEYcv+cxh}0hq|(HQ z7Ne+;WyI8c(=E1Budv-ymrnfFN{cd)eh{Yd`>Nl~==Z9d0A8=Q#xN*pk*n7#?iA?; zi&o4iy3#yPac0xXo8^9zDl5$FEb}Msu}^%VK1u&ATe4&oQ*z5{!jtZZnvi9Q1!G*m zf=`sO#468^){u)64E7n?Geoj9O$RA4ZzWm&nY2lK=vp4nveppMGC#=RPokzEOo9msWB_ZgICYxS zOlLLvMvV7>8l|?Xk||V0u!vPv#<GRE>08bNOFY)_)0D*aiML9VA!LB?~3-0^IFF(ynZK9Z~gc?rOIILI6%Iznwk z6`=ElJb3KRE0d2vz_!7a<+}C zR9i*W8`?vKs4Zd8OKqU)D|l}|*%TdlYR?r4lYA-b~5T4(At$D6#E1Y}WGyH55 zU=}L)G_~ja#f@7hZi-7hLxw;87F~qj!?0(xJ)g^zGbb>UCO$3r^-q-lgx6c~dl)*u z3~`t}6CXV822IEp;iz;NTEEGQ)b(D?Y)-ImWu1e zrE=?;8)sYRX67kbseg815#32OU~(|{wFm!h4}NhTGy@L-t)ac!cl`-|`z>Omd+0+3 zZh^?{VSvEo+fhm2ATe!?N>YTu0*Eo`q=d?k(x31{wPUh0yrQoyuz-IXeGsmhyIf7Y zbf>#nyle^L%gL;Ucg@T_ z<`ENLSL1t7V{5Z*Bxl>iGwtwtw}U&_o=VjGqN?_`%oF&+8{f7Xy;gR;oN*JLJ7Ro~ zg+JO&*T?Ldlb@5BlU=$*$uFvEYsV3*(Ghc6bvZYm-6YwYrp2~=y8kUjKUNB1z^NXq?DgIA7 zdG(4%Q}E=5kzY=zbHbWq$+gORAz_d6^b%RkZJo0Cx*vUgk+B6Y-X$u2QBAA5_5}MC zrUtCgE%Oa+<_{Ryp6u%UpvqYPUck|BhZtM%c7=CU&GDFawB%vN#9!J-gf+)xuVcPG zk}#TI21(TXqM8_WJq@i1bFeaz8dAEbhN;)me>BD%wm7xA5pMo^y@YF!GDl#_hNqo}YKJ>&wTQJ-1}Z@BlHM z)3tcs*j<++-Y-}!XwbgP((lL7`*sWWx-@%j;u&*{Y#l0R!}ngUJY{FX{$%D+%g%`M zlwD@-M$MuQ=580WIz?%FNuj`O~o`O`EwJHG4YRyVt_ppt;lG zbDx>HQ8TB5x!=jGhIh@ghhyv>a4`qR_c_}p#!-jYgAVQn%$b&K66Gl`nwc9rV>)8| zl7+uP^QC1>p?8OuW#<1up7M&!*zmd1m0KE0xM{2o4p!G0&yHRlCN`GAQ_ob@$Lz{j zju5kU5~)5uSH@zL_|$Vm{0x{x%`fU*=Z~3~l|xjVZxbVyBU3wWV%LvoNe1wXdcB`8 t@hj)QINv6`x2&~kk2Psw=cmi+V~-E6C|Pp+r%U{AK10k^IJ+iW^IvdT2wVUF literal 0 HcmV?d00001 diff --git a/src/WINNT/kfw/lib/i386/loadfuncs.lib b/src/WINNT/kfw/lib/i386/loadfuncs.lib new file mode 100644 index 0000000000000000000000000000000000000000..979f351f6c8901d7c1a8a6a455b29a4b469db786 GIT binary patch literal 1646 zcmb7ETWb?h5T5O(ZH(1Mt>}ZwS{7-gO%qdVy&#EABbBYzrd7n%ZMr$Ft4&ijC*DwB z>ORCp@Imkg=uhwmL@JbmA}E57zDh+qXEe=jVPN{@4Fn+^LX&0rudA zK|sLYA7lIyv{=xeu zAbc#s*>zrrm#|ycaDAkfAvNQYU~J0smv%r01K5Rm9mPdN>g2C4HJnaPDig}cu|u7s znKMJ<6P;26cuGl~OpXp`Iwi6>3+u=n#)b~5MN?O=Fmsxjg`%1_c&~o7s4f`AJTsY^ z<(JreRxNR(uE&3A{UB@!Q&ugo0YcE+=I*;k4IRA~X1LTf-YuP4;6~oKY0S?`Lxuc; zF~>{*Tag3S3g2c6R)ue}Ym3i<%TA62ls?-jIf#PRvD#KbmtHJ>3?kNHRhCn7fFR!D z>8IrFsEMZ=3``rg#Vk%+S@tBlOXRk&S*5XH6T zC+3Ur>*|mEhG-2)2~Q0Vw5A#P1x-tvj48&nnKf@D`Ws$aSALxFF|(j2bNGT4i-|$- a?C9C|?2=^YYG)W9HqC-LTF5a(Lq7o6>}7)h literal 0 HcmV?d00001 diff --git a/src/WINNT/kfw/lib/i386/wshelp32.lib b/src/WINNT/kfw/lib/i386/wshelp32.lib new file mode 100644 index 0000000000000000000000000000000000000000..7bdc3132d52982c4f6736eb3d733d5e8c17b255c GIT binary patch literal 6982 zcmcIpOK%iM5dLfj2*%*|6GN5=A?IRj@2)XX6b%6+BNl^%9Oj1HB)Ble567EnxJ8ps@phY5akpv3JBX zofS0xhU7&3uLO;}1(+tM1x-8$m`08Y8h!>a4F-}(caUg!M$k|RU>aQ(G~rNvq7l+( z8n__oDZPmXy9G_YCp@MDK|?R89il1fTSy+gJ=eW)>(1@fHTT-}yH{6l+*!N5>i&Fp z`FiP2egUq#a<5cs*1+#dMJTK--&?uqUc0h(g{o9`_gpvd>u#l5X*hGRzIEwu`+o4m zS&-$L(;9W3moZW?SgjM*^J=^0O4V5?2&}kFYw!LlaPo^n)8w^Q-LHDiyi|!8QSMdU z&D!o>*eUZ{)+Ukvc&|+L!-3hX)Vc3Bwrlmq#*=D!*LS$jO_I1~+4BNtp4LOFMk1lR zP4nHTxf>ONUV59D;)3$`2d)-3hb;*U|1Nq+Blfc#~;Ke9#Fa|sr z2j0>9EYTbKe$@}W9Ra2%f#(yzQTl#13V%HLDH z1EQCt^JWV0h{)Ze3*G3&I3_TO0Ssao(-=ZOPGJluFoLh}HICpIj^a2*aT0wvjVYYP zna`}%L;mt}{IB$~%^rwX)3#c%dL(blD7E!`dgE(dYCX0~&`{y ziZid*I^tqkg|WV@60NLY1dtWXqX^x+j?G?MuU+D*HLq9e3{0hFv);}Q`{GY!y@kt{ zW&XR~Tk7h;#sBh7e;3Hpg-_S4=Wp!aKYv%Sz*YL7l+t<}4E!`(@ydVyM(9oSneSAn$lSEzsH$HpE;-*3=bS5Aveg+F><~~`i5>* zHiKHdw$;eZtbUg(-B`IPietZh#B)t<0p!s6i=qO#b^bDOs2iN?QGbv0{eq7l6(ZN+ zhdbB}HEah6yS%L=;Q$$_M@b5-LjpuPMJ-|ZIsTCkw+?(SIev9xjeb8bV6--uUUSIp z*vmq3!LXO^&|dxwyT_eGqP@^j!+H#R$*Tgkmp>FE-)t{m$PU_B+cVUSmS>=j=WS`; zm^ZP{{viOd(8=?bvd@ZYs@NQPpP7%b&k9P;dVecMz7KhR+nG~N@ea`%3(;AAo$^NB zq@^zQV3gd29?Ui3nz>@=*zSvJ`EoYWH-toKCc;eG%DuATsjN5`!# zOs1VZ9c}3tR*rBe-43y00pEnM+-5s?g+;j)VtAB>hw;EVdS*gO8yOuUl8&#L@CquJ z#zw}jgbp4Np30Xku#Rmq4UOkg9nRG`FdJI2ki2T&5)y|{g=Xb&7Np6vWhe4vn6wAz zh$s*#1Cw_eX7iofWC|814dLi?_L&VU#r`=CS{D-8kWxm)xs_|@&0h?Q4%*_*O(*5q zuu}X!M^y9H(E>WuJw{i!0?9Z}WJJ4^yvI%x5+{@4xT4caHmqVk8H>|UPKPy?J_}_- zOp9rppM;3|q-BAbOk2JqWsh<4FR{d3ui5yadJejXQb_8ImXoHFSWpx0} zhL@7{@Sh~cm9)I2u;4o0ZE0B+=X4=n>j2X+UZKSv;H-x(4hc`)#%3H>O6;7Zdqj2d YYTedYkS5cP{ij*Vl!0j6{+bZ@AMzKny#N3J literal 0 HcmV?d00001 diff --git a/src/WINNT/kfw/lib/i386/xpprof32.lib b/src/WINNT/kfw/lib/i386/xpprof32.lib new file mode 100644 index 0000000000000000000000000000000000000000..47166293ef358db1db3e85b399d5976f079ced45 GIT binary patch literal 6114 zcmcIoL2naB6n=3C3C6*WodhneOcmN7p%6Q^6RN5*g-VSG0hw^DHXC~rujJU)+NpBu zAE-F+3nC8mNA$vpYY#=L#I>Ay;s+qn_q;p1Z)RuhT|!rSo}D-E&A0RB%{Mc?{+;PG z+ux^e7v-n4zPVYdRPa~UuY1)}xwhrL?xz9ZCP3N&$h-iUe+y7}?aE>WfF$?KmE}1A zlI*%Gg$CN8g>TED{?Cw#$ z%torH!#;L*XdPKj$cgL2UKkd0X!p8C*F4sYO4A(fV{mdXu$p6f(HhA8*h9-Phdsw= zI+i)K>ZMu`UR_&+H^r65*>@EUdOvA4h0jPS+j~hQ=7&vBxJC9n>9=rLhKQ#$K3$va z-NbZu0%x|a!Y#6=W6{JK-uy`8)HKPyW~&uo@_bhtlJn)J&zDF{;2>+h$N;>Z2Y6io zs4N0J%K^+`<9ZgLfw~V^-_HYd7XaR&yutTtO90PNUZVXe+P1GE!=c@Kd_O}!Bx0C? z6wJXgEW$-dLk8yIGF*X6Z~{aSPm7ti405Hh>c>*8Wv5QX_S5i7wJjETk1qJvfm^Qn7H6{L?HGU zmN335YJG;2M7a3r;VX2z6U_xr31Lin!C(;^M%2zVX^YV8s$$Xwx-{Ls(wi%Z*>qE^ zIv8SdMFX2wMWvW}xu4#dnuhs*H|p6bWJ+W@ zBD=Mgb#QXD^2DtI+{2gOM8zxXko#fH#_h;lDT^i~Q1}z&A5SrjWgXUEd3H5Vjm(K4 zh$rkwUx(tW6qW^KReCafP^(bL&7zVzq-PdMcqWs7Xg8hSpm#Vdt~PEKceZyQxXsEh z?g=AL>H(0l$shS0shi$74t_?ncihMCoyq(RA3q92@}Y-5Fa=`Rb%4<)w}oajK>EgM zp{bA!D!{j?1{%^|ryuX3-T}V#YE-0P4}U*xtB6jQG#_%Dd?{DUEMHQieEDPadGwL` zd})oEf*+PI8$wI@^1G;bCFRTilm~I<_6z)s$a_oTxNVhK+}w5cHv+g5t&iK7bygLj zqI9Hn#viuMDnd_oe~F4$e&+bbiRqUJ{TZ{-PsSqMlWCFeOc8?>M z_&C{L^-h^Z1@CLbo5Hi8e}PjEUFSm;6s@3sgQzKv8rr5M*u-nSD*ld8aA^{!Ij%Sa zNN~IoE4CGHfhcHSA=(8Ajh!$!Nb=eA|9z3O=LRCqa75+!B7r83YAs@%w-EKBiW)u~ zN#MK^E5clZUK}QIlxq=~Ylt})!qgn=&V^o$K&KI3QqhAmevent = CreateEvent((LPSECURITY_ATTRIBUTES) 0, FALSE, - FALSE, (LPCTSTR) 0); + CHAR eventName[MAX_PATH]; + static eventCount = 0; + sprintf(eventName, "cond_waiters_t %d::%d", _getpid(), eventCount++); + new->event = CreateEvent((LPSECURITY_ATTRIBUTES) 0, FALSE, + FALSE, (LPCTSTR) eventName); if (new->event == NULL) { free(new); new = NULL; diff --git a/src/WINNT/pthread/test/NTMakefile b/src/WINNT/pthread/test/NTMakefile index a56c1820d..d4926c28c 100644 --- a/src/WINNT/pthread/test/NTMakefile +++ b/src/WINNT/pthread/test/NTMakefile @@ -5,17 +5,23 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=WINNT\pthread\test !INCLUDE ../../../config/NTMakefile.$(SYS_NAME) test tests: ptest.exe tsd.exe native.exe -ptest.exe: ptest.obj $(DESTDIR)/lib/afspthread.lib $(DESTDIR)/lib/afs/afsutil.lib +$(OUT)\ptest.exe: $(OUT)\ptest.obj $(DESTDIR)/lib/afspthread.lib $(DESTDIR)/lib/afs/afsutil.lib $(EXECONLINK) -tsd.exe: tsd.obj $(DESTDIR)/lib/afspthread.lib $(DESTDIR)/lib/afs/afsutil.lib +$(OUT)\tsd.exe: $(OUT)\tsd.obj $(DESTDIR)/lib/afspthread.lib $(DESTDIR)/lib/afs/afsutil.lib $(EXECONLINK) -native.exe: native.obj $(DESTDIR)/lib/afspthread.lib $(DESTDIR)/lib/afs/afsutil.lib +$(OUT)\native.exe: $(OUT)\native.obj $(DESTDIR)/lib/afspthread.lib $(DESTDIR)/lib/afs/afsutil.lib $(EXECONLINK) +clean:: + $(DEL) $(DESTDIR)/lib/afspthread.lib + +mkdir: + diff --git a/src/WINNT/pthread/test/native.cpp b/src/WINNT/pthread/test/native.cpp index 87c356607..5d82dac06 100644 --- a/src/WINNT/pthread/test/native.cpp +++ b/src/WINNT/pthread/test/native.cpp @@ -1,400 +1,400 @@ -/* - * Copyright 2000, International Business Machines Corporation and others. - * All Rights Reserved. - * - * This software has been released under the terms of the IBM Public - * License. For details, see the LICENSE file in the top-level source - * directory or online at http://www.openafs.org/dl/license10.html - */ - -/* - * Test pthread interaction with native Win32 threads - * - */ - - -#include -#include - -#include -#include -#include - -extern "C" { -#include -#include -#include -} - - -#define nTESTS 3 -#define nPASSES_MAX 256 - - -/* - * Test1 - Tests the main thread calling pthread_self() - * - */ - -BOOL Test1 (void) -{ - BOOL rc = TRUE; - printf ("Begin Test1:\n"); - - PVOID hSelf; - if ((hSelf = pthread_self()) == NULL) - rc = FALSE; - - printf (" 1: pthread_self() on main thread returned 0x%08lX\n", hSelf); - - printf ("--> Test1 %s\n", (rc) ? TEXT("succeeded") : TEXT("FAILED")); - return rc; -} - - -/* - * Test2 - Tests a Win32 thread's ability to join onto a pthread - * - */ -#define TEST2_RETURNVALUE 'Test' - -DWORD WINAPI Test2_Thread1 (LPVOID lp) -{ - printf (" 1-1: waiting for thread 2 to begin\n"); - - while (!*(volatile DWORD*)lp) - ; - - printf (" 1-1: calling pthread_join (0x%08lX)\n", *(DWORD*)lp); - - DWORD status; - int rc; - if ((rc = pthread_join ((pthread_t)(*(DWORD*)lp), (void**)&status)) != 0) - { - printf (" 1-1: pthread_join failed; rc=%lu\n", rc); - return 0; - } - - if (status != TEST2_RETURNVALUE) - { - printf (" 1-1: pthread_join succeeded with wrong status (rc=%lu)\n", status); - return 0; - } - - printf (" 1-1: pthread_join succeeded; terminating\n"); - return 1; -} - -extern "C" void *Test2_Thread2 (void *pdwCommonParam) -{ - printf (" 1-2: signalling that thread 2 began\n"); - *(volatile DWORD*)pdwCommonParam = (DWORD)pthread_self(); - Sleep (1500); - - printf (" 1-2: terminating\n"); - return (void*)TEST2_RETURNVALUE; -} - -BOOL Test2 (void) -{ - BOOL rc = TRUE; - printf ("Begin Test2:\n"); - - DWORD dwCommonParam = 0; - DWORD idThread; - - printf (" 1: creating win32 thread\n"); - HANDLE hThread1 = CreateThread (0, 0, Test2_Thread1, (LPVOID)&dwCommonParam, 0, &idThread); - Sleep(500); - - printf (" 1: creating pthread thread\n"); - pthread_t hThread2; - pthread_create (&hThread2, NULL, Test2_Thread2, (void *)&dwCommonParam); - Sleep(500); - - printf (" 1: blocking until win32 thread (thread1) terminates...\n"); - - WaitForSingleObject (hThread1, INFINITE); - GetExitCodeThread (hThread1, (ULONG*)&rc); - - printf (" 1: detected thread1 termination\n"); - - printf ("--> Test2 %s\n", (rc) ? TEXT("succeeded") : TEXT("FAILED")); - return rc; -} - - -/* - * Test3 - Makes sure the pthread library recognizes when native threads die - * - */ - -DWORD WINAPI Test3_Thread1 (LPVOID lp) -{ - LONG *pdw = (LONG*)lp; - - // We're awake. Do something pthready. - // - pthread_t pMe; - if ((pMe = pthread_self()) == NULL) - printf (" 3-1: could not get a pthread_self!\n"); - else - printf (" 3-1: ready\n"); - - InterlockedIncrement (pdw); - - // Now wait until we see the signal to die. - // - while (*(volatile LONG*)pdw != 5) - ; - - printf (" 3-1: terminating\n"); - InterlockedIncrement (pdw); - return 1; -} - - -DWORD WINAPI Test3_Thread2 (LPVOID lp) -{ - LONG *pdw = (LONG*)lp; - - // We're awake. Do something pthready. - // - pthread_t pMe; - if ((pMe = pthread_self()) == NULL) - printf (" 3-2: could not get a pthread_self!\n"); - else - printf (" 3-2: ready\n"); - - InterlockedIncrement (pdw); - - // Now wait until we see the signal to die. - // - while (*(volatile LONG*)pdw != 7) - ; - - printf (" 3-2: terminating\n"); - InterlockedIncrement (pdw); - return 1; -} - - -extern "C" void *Test3_Thread3 (void *pdwParam) -{ - LONG *pdw = (LONG*)pdwParam; - - // We're awake. - // - printf (" 3-3: ready\n"); - InterlockedIncrement (pdw); - - // Now wait until we see the signal to die. - // - while (*(volatile LONG*)pdw != 9) - ; - - printf (" 3-3: terminating\n"); - InterlockedIncrement (pdw); - return (void*)1; -} - - -extern "C" void *Test3_Thread4 (void *pdwParam) -{ - LONG *pdw = (LONG*)pdwParam; - - // We're awake. - // - printf (" 3-4: ready\n"); - InterlockedIncrement (pdw); - - // Now wait until we see the signal to die. - // - while (*(volatile LONG*)pdw != 11) - ; - - printf (" 3-4: terminating\n"); - InterlockedIncrement (pdw); - return (void*)1; -} - - -extern "C" void *Test3_ThreadCount (void *pdwParam) -{ - volatile LONG *pdw = (LONG*)pdwParam; - - pthread_t pMe; - if ((pMe = pthread_self()) == NULL) - return (void*)0; - - try { - struct rx_queue *pNow = (rx_queue*)pMe; - - for (struct rx_queue *pWalk = pNow->next; pWalk != pNow; pWalk = pWalk->next) - ++(*pdw); - - } catch(...) { - *pdw = 0; - } - - return (void*)*pdw; -} - -size_t Test3_CountActiveQueue (void) -{ - DWORD dwArg = 0; - pthread_t pThread; - pthread_create (&pThread, NULL, Test3_ThreadCount, (void *)&dwArg); - - DWORD status; - int rc; - if ((rc = pthread_join (pThread, (void**)&status)) != 0) - { - printf (" 3: counter: pthread_join failed; rc=%lu\n", rc); - return 0; - } - - return dwArg; -} - -BOOL Test3 (void) -{ - BOOL rc = TRUE; - printf ("Begin Test3:\n"); - - // Find the size of the active queue - // - size_t cInitialQueueSize; - if ((cInitialQueueSize = Test3_CountActiveQueue()) == 0) - { - printf (" 3: unable to determine active queue size\n"); - rc = FALSE; - } - else - { - // Start two Win32 threads and two pthreads. We'll use a single, common - // parameter for each thread: dwSignal. Each thread will increment the - // signal param when it's ready for us to go; once that's done, a - // thread will kill itself and inc the signal *again* each die we - // increment the signal: - // - // starts at 0 - // thread 1 wakes up and incs signal to 1 - // thread 2 wakes up and incs signal to 2 - // thread 3 wakes up and incs signal to 3 - // thread 4 wakes up and incs signal to 4 - // we notice signal is 4, and we increment signal to 5 - // thread 1 notices signal is 5, incs to 6 and dies - // we notice signal is 6, and we increment signal to 7 - // thread 1 notices signal is 7, incs to 8 and dies - // we notice signal is 8, and we increment signal to 9 - // thread 1 notices signal is 9, incs to 10 and dies - // we notice signal is 10, and we increment signal to 11 - // thread 1 notices signal is 11, incs to 12 and dies - // we notice signal is 12 and finish our tests - // - volatile LONG dwSignal = 0; - printf (" 3: creating test threads\n"); - - DWORD idThread; - CreateThread (0, 0, Test3_Thread1, (LPVOID)&dwSignal, 0, &idThread); - Sleep (500); - - CreateThread (0, 0, Test3_Thread2, (LPVOID)&dwSignal, 0, &idThread); - Sleep (500); - - pthread_attr_t attr; - attr.is_joinable = PTHREAD_CREATE_DETACHED; - - pthread_t hThread; - pthread_create (&hThread, &attr, Test3_Thread3, (void *)&dwSignal); - Sleep (500); - - pthread_create (&hThread, &attr, Test3_Thread4, (void *)&dwSignal); - Sleep (500); - - // Count the active queue again as soon as we're sure all the threads - // are ready for us to do so. - // - while (dwSignal != 4) - ; - - size_t cQueueSize; - if ((cQueueSize = Test3_CountActiveQueue()) == 0) - { - printf (" 3: unable to determine active queue size\n"); - rc = FALSE; - } - else if (cQueueSize != cInitialQueueSize+4) - { - printf (" 3: error: active queue wasn't increased by 4\n"); - rc = FALSE; - } - else while (rc && (dwSignal < 12)) - { - LONG dwTarget = dwSignal +2; - InterlockedIncrement ((LONG*)&dwSignal); - - // wait for a thread to notice the change and kill itself - while (dwSignal != dwTarget) - ; - Sleep (500); // give a little time for cleanup after thread incremented - - if ((cQueueSize = Test3_CountActiveQueue()) == 0) - { - printf (" 3: unable to determine active queue size (dwSignal=%ld)\n", dwSignal); - rc = FALSE; - } - else if (cQueueSize != (cInitialQueueSize + 4 - ((dwTarget -4) /2))) - { - printf (" 3: active queue size did not diminish (dwSignal=%ld)\n", dwSignal); - rc = FALSE; - } - } - } - - printf ("--> Test3 %s\n", (rc) ? TEXT("succeeded") : TEXT("FAILED")); - return rc; -} - - -/* - * main - Runs all tests (unless the command-line says otherwise) - * - */ -int main(int argc, char **argv) -{ - DWORD iRunTest[nPASSES_MAX]; - for (size_t ii = 0; ii < nPASSES_MAX; ++ii) - iRunTest[ii] = (ii < nTESTS) ? (ii+1) : 0; - - ii = 0; - for (--argc,++argv; argc; --argc,++argv) - { - DWORD iTest; - if ( ((iTest = (size_t)atol (*argv)) > 0) && (iTest <= nTESTS) ) - { - if (ii == 0) - memset (iRunTest, 0x00, sizeof(iRunTest)); - if (ii < nPASSES_MAX) - iRunTest[ ii++ ] = iTest; - } - } - - BOOL rc = TRUE; - - for (ii = 0; ii < nPASSES_MAX; ++ii) - { - if (iRunTest[ ii ] == 0) - break; - else switch (iRunTest[ ii ]) - { - case 1: if (!Test1()) rc = FALSE; break; - case 2: if (!Test2()) rc = FALSE; break; - case 3: if (!Test3()) rc = FALSE; break; - } - } - - return rc; -} - +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* + * Test pthread interaction with native Win32 threads + * + */ + + +#include +#include + +#include +#include +#include + +extern "C" { +#include +#include +#include +} + + +#define nTESTS 3 +#define nPASSES_MAX 256 + + +/* + * Test1 - Tests the main thread calling pthread_self() + * + */ + +BOOL Test1 (void) +{ + BOOL rc = TRUE; + printf ("Begin Test1:\n"); + + PVOID hSelf; + if ((hSelf = pthread_self()) == NULL) + rc = FALSE; + + printf (" 1: pthread_self() on main thread returned 0x%08lX\n", hSelf); + + printf ("--> Test1 %s\n", (rc) ? TEXT("succeeded") : TEXT("FAILED")); + return rc; +} + + +/* + * Test2 - Tests a Win32 thread's ability to join onto a pthread + * + */ +#define TEST2_RETURNVALUE 'Test' + +DWORD WINAPI Test2_Thread1 (LPVOID lp) +{ + printf (" 1-1: waiting for thread 2 to begin\n"); + + while (!*(volatile DWORD*)lp) + ; + + printf (" 1-1: calling pthread_join (0x%08lX)\n", *(DWORD*)lp); + + DWORD status; + int rc; + if ((rc = pthread_join ((pthread_t)(*(DWORD*)lp), (void**)&status)) != 0) + { + printf (" 1-1: pthread_join failed; rc=%lu\n", rc); + return 0; + } + + if (status != TEST2_RETURNVALUE) + { + printf (" 1-1: pthread_join succeeded with wrong status (rc=%lu)\n", status); + return 0; + } + + printf (" 1-1: pthread_join succeeded; terminating\n"); + return 1; +} + +extern "C" void *Test2_Thread2 (void *pdwCommonParam) +{ + printf (" 1-2: signalling that thread 2 began\n"); + *(volatile DWORD*)pdwCommonParam = (DWORD)pthread_self(); + Sleep (1500); + + printf (" 1-2: terminating\n"); + return (void*)TEST2_RETURNVALUE; +} + +BOOL Test2 (void) +{ + BOOL rc = TRUE; + printf ("Begin Test2:\n"); + + DWORD dwCommonParam = 0; + DWORD idThread; + + printf (" 1: creating win32 thread\n"); + HANDLE hThread1 = CreateThread (0, 0, Test2_Thread1, (LPVOID)&dwCommonParam, 0, &idThread); + Sleep(500); + + printf (" 1: creating pthread thread\n"); + pthread_t hThread2; + pthread_create (&hThread2, NULL, Test2_Thread2, (void *)&dwCommonParam); + Sleep(500); + + printf (" 1: blocking until win32 thread (thread1) terminates...\n"); + + WaitForSingleObject (hThread1, INFINITE); + GetExitCodeThread (hThread1, (ULONG*)&rc); + + printf (" 1: detected thread1 termination\n"); + + printf ("--> Test2 %s\n", (rc) ? TEXT("succeeded") : TEXT("FAILED")); + return rc; +} + + +/* + * Test3 - Makes sure the pthread library recognizes when native threads die + * + */ + +DWORD WINAPI Test3_Thread1 (LPVOID lp) +{ + LONG *pdw = (LONG*)lp; + + // We're awake. Do something pthready. + // + pthread_t pMe; + if ((pMe = pthread_self()) == NULL) + printf (" 3-1: could not get a pthread_self!\n"); + else + printf (" 3-1: ready\n"); + + InterlockedIncrement (pdw); + + // Now wait until we see the signal to die. + // + while (*(volatile LONG*)pdw != 5) + ; + + printf (" 3-1: terminating\n"); + InterlockedIncrement (pdw); + return 1; +} + + +DWORD WINAPI Test3_Thread2 (LPVOID lp) +{ + LONG *pdw = (LONG*)lp; + + // We're awake. Do something pthready. + // + pthread_t pMe; + if ((pMe = pthread_self()) == NULL) + printf (" 3-2: could not get a pthread_self!\n"); + else + printf (" 3-2: ready\n"); + + InterlockedIncrement (pdw); + + // Now wait until we see the signal to die. + // + while (*(volatile LONG*)pdw != 7) + ; + + printf (" 3-2: terminating\n"); + InterlockedIncrement (pdw); + return 1; +} + + +extern "C" void *Test3_Thread3 (void *pdwParam) +{ + LONG *pdw = (LONG*)pdwParam; + + // We're awake. + // + printf (" 3-3: ready\n"); + InterlockedIncrement (pdw); + + // Now wait until we see the signal to die. + // + while (*(volatile LONG*)pdw != 9) + ; + + printf (" 3-3: terminating\n"); + InterlockedIncrement (pdw); + return (void*)1; +} + + +extern "C" void *Test3_Thread4 (void *pdwParam) +{ + LONG *pdw = (LONG*)pdwParam; + + // We're awake. + // + printf (" 3-4: ready\n"); + InterlockedIncrement (pdw); + + // Now wait until we see the signal to die. + // + while (*(volatile LONG*)pdw != 11) + ; + + printf (" 3-4: terminating\n"); + InterlockedIncrement (pdw); + return (void*)1; +} + + +extern "C" void *Test3_ThreadCount (void *pdwParam) +{ + volatile LONG *pdw = (LONG*)pdwParam; + + pthread_t pMe; + if ((pMe = pthread_self()) == NULL) + return (void*)0; + + try { + struct rx_queue *pNow = (rx_queue*)pMe; + + for (struct rx_queue *pWalk = pNow->next; pWalk != pNow; pWalk = pWalk->next) + ++(*pdw); + + } catch(...) { + *pdw = 0; + } + + return (void*)*pdw; +} + +size_t Test3_CountActiveQueue (void) +{ + DWORD dwArg = 0; + pthread_t pThread; + pthread_create (&pThread, NULL, Test3_ThreadCount, (void *)&dwArg); + + DWORD status; + int rc; + if ((rc = pthread_join (pThread, (void**)&status)) != 0) + { + printf (" 3: counter: pthread_join failed; rc=%lu\n", rc); + return 0; + } + + return dwArg; +} + +BOOL Test3 (void) +{ + BOOL rc = TRUE; + printf ("Begin Test3:\n"); + + // Find the size of the active queue + // + size_t cInitialQueueSize; + if ((cInitialQueueSize = Test3_CountActiveQueue()) == 0) + { + printf (" 3: unable to determine active queue size\n"); + rc = FALSE; + } + else + { + // Start two Win32 threads and two pthreads. We'll use a single, common + // parameter for each thread: dwSignal. Each thread will increment the + // signal param when it's ready for us to go; once that's done, a + // thread will kill itself and inc the signal *again* each die we + // increment the signal: + // + // starts at 0 + // thread 1 wakes up and incs signal to 1 + // thread 2 wakes up and incs signal to 2 + // thread 3 wakes up and incs signal to 3 + // thread 4 wakes up and incs signal to 4 + // we notice signal is 4, and we increment signal to 5 + // thread 1 notices signal is 5, incs to 6 and dies + // we notice signal is 6, and we increment signal to 7 + // thread 1 notices signal is 7, incs to 8 and dies + // we notice signal is 8, and we increment signal to 9 + // thread 1 notices signal is 9, incs to 10 and dies + // we notice signal is 10, and we increment signal to 11 + // thread 1 notices signal is 11, incs to 12 and dies + // we notice signal is 12 and finish our tests + // + volatile LONG dwSignal = 0; + printf (" 3: creating test threads\n"); + + DWORD idThread; + CreateThread (0, 0, Test3_Thread1, (LPVOID)&dwSignal, 0, &idThread); + Sleep (500); + + CreateThread (0, 0, Test3_Thread2, (LPVOID)&dwSignal, 0, &idThread); + Sleep (500); + + pthread_attr_t attr; + attr.is_joinable = PTHREAD_CREATE_DETACHED; + + pthread_t hThread; + pthread_create (&hThread, &attr, Test3_Thread3, (void *)&dwSignal); + Sleep (500); + + pthread_create (&hThread, &attr, Test3_Thread4, (void *)&dwSignal); + Sleep (500); + + // Count the active queue again as soon as we're sure all the threads + // are ready for us to do so. + // + while (dwSignal != 4) + ; + + size_t cQueueSize; + if ((cQueueSize = Test3_CountActiveQueue()) == 0) + { + printf (" 3: unable to determine active queue size\n"); + rc = FALSE; + } + else if (cQueueSize != cInitialQueueSize+4) + { + printf (" 3: error: active queue wasn't increased by 4\n"); + rc = FALSE; + } + else while (rc && (dwSignal < 12)) + { + LONG dwTarget = dwSignal +2; + InterlockedIncrement ((LONG*)&dwSignal); + + // wait for a thread to notice the change and kill itself + while (dwSignal != dwTarget) + ; + Sleep (500); // give a little time for cleanup after thread incremented + + if ((cQueueSize = Test3_CountActiveQueue()) == 0) + { + printf (" 3: unable to determine active queue size (dwSignal=%ld)\n", dwSignal); + rc = FALSE; + } + else if (cQueueSize != (cInitialQueueSize + 4 - ((dwTarget -4) /2))) + { + printf (" 3: active queue size did not diminish (dwSignal=%ld)\n", dwSignal); + rc = FALSE; + } + } + } + + printf ("--> Test3 %s\n", (rc) ? TEXT("succeeded") : TEXT("FAILED")); + return rc; +} + + +/* + * main - Runs all tests (unless the command-line says otherwise) + * + */ +int main(int argc, char **argv) +{ + DWORD iRunTest[nPASSES_MAX]; + for (size_t ii = 0; ii < nPASSES_MAX; ++ii) + iRunTest[ii] = (ii < nTESTS) ? (ii+1) : 0; + + ii = 0; + for (--argc,++argv; argc; --argc,++argv) + { + DWORD iTest; + if ( ((iTest = (size_t)atol (*argv)) > 0) && (iTest <= nTESTS) ) + { + if (ii == 0) + memset (iRunTest, 0x00, sizeof(iRunTest)); + if (ii < nPASSES_MAX) + iRunTest[ ii++ ] = iTest; + } + } + + BOOL rc = TRUE; + + for (ii = 0; ii < nPASSES_MAX; ++ii) + { + if (iRunTest[ ii ] == 0) + break; + else switch (iRunTest[ ii ]) + { + case 1: if (!Test1()) rc = FALSE; break; + case 2: if (!Test2()) rc = FALSE; break; + case 3: if (!Test3()) rc = FALSE; break; + } + } + + return rc; +} + diff --git a/src/WINNT/talocale/NTMakefile b/src/WINNT/talocale/NTMakefile index 155629d6d..2e08cc9c9 100644 --- a/src/WINNT/talocale/NTMakefile +++ b/src/WINNT/talocale/NTMakefile @@ -10,7 +10,7 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -WX # include the primary makefile - +RELDIR=WINNT\talocale !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) ############################################################################ @@ -18,10 +18,10 @@ AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -WX INCFILEDIR = $(DESTDIR)\include\WINNT LIBOBJS = \ - tal_alloc.obj \ - tal_main.obj \ - tal_string.obj \ - tal_dialog.obj + $(OUT)\tal_alloc.obj \ + $(OUT)\tal_main.obj \ + $(OUT)\tal_string.obj \ + $(OUT)\tal_dialog.obj LIBINCLUDES = \ $(INCFILEDIR)\talocale.h \ @@ -43,3 +43,6 @@ $(LIBFILE): $(LIBOBJS) clean:: $(DEL) $(LIBINCLUDES) + +mkdir: + diff --git a/src/WINNT/talocale/tal_alloc.cpp b/src/WINNT/talocale/tal_alloc.cpp index 9a687c54b..532d879e8 100644 --- a/src/WINNT/talocale/tal_alloc.cpp +++ b/src/WINNT/talocale/tal_alloc.cpp @@ -354,7 +354,7 @@ void SetDlgItemBytes (HWND hDlg, int idc, double lfValue) void MemMgr_ShowWarning (PMEMCHUNK pChunk, LPSTR pszFile, DWORD dwLine, LPTSTR pszDesc) { TCHAR szMessage[ 1024 ]; - wsprintf (szMessage, TEXT("%s\n\n Address: 0x%08lX (%s)\n Allocated: %s line %ld\n Freed: %s line %ld\n\nClick OK for memory details."), pszDesc, pChunk->pData, pChunk->pszExpr, pChunk->pszFile, pChunk->dwLine, pszFile, dwLine); + wsprintf (szMessage, TEXT("%s\n\n Address: 0x%08lX (%s)\n Allocated: %s line %ld\n Freed: %s line %ld\n\nClick OK for memory details."), pszDesc, (long)pChunk->pData, pChunk->pszExpr, pChunk->pszFile, pChunk->dwLine, pszFile, dwLine); if (MessageBox (NULL, szMessage, cszTITLE, MB_ICONHAND | MB_OKCANCEL | MB_DEFBUTTON2) == IDOK) { // TODO: Show Details @@ -666,10 +666,10 @@ void MemMgr_OnListAdd (PMEMCHUNK pCopy) wsprintf (szLocation, TEXT("%s, %ld"), pszFile, pCopy->dwLine); TCHAR szBytes[256]; - FormatBytes (szBytes, pCopy->cbData); + FormatBytes (szBytes, (double)pCopy->cbData); TCHAR szAddress[256]; - wsprintf (szAddress, TEXT("0x%08lX"), pCopy->pData); + wsprintf (szAddress, TEXT("0x%08lX"), (long)pCopy->pData); LPTSTR pszKey = NULL; switch (lr.iColSort) diff --git a/src/WINNT/talocale/tal_dialog.cpp b/src/WINNT/talocale/tal_dialog.cpp index f31bb29d5..7bf779ad7 100644 --- a/src/WINNT/talocale/tal_dialog.cpp +++ b/src/WINNT/talocale/tal_dialog.cpp @@ -76,7 +76,7 @@ int ModalDialogParam (int idd, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwI int cdecl Message (UINT type, LPCTSTR title, LPCTSTR text, LPCTSTR fmt, ...) { va_list arg; - if (fmt != NULL) + // if (fmt != NULL) va_start (arg, fmt); return vMessage (type, (LONG)title, (LONG)text, fmt, arg); } @@ -85,7 +85,7 @@ int cdecl Message (UINT type, LPCTSTR title, LPCTSTR text, LPCTSTR fmt, ...) int cdecl Message (UINT type, LPCTSTR title, int text, LPCTSTR fmt, ...) { va_list arg; - if (fmt != NULL) + // if (fmt != NULL) va_start (arg, fmt); return vMessage (type, (LONG)title, (LONG)text, fmt, arg); } @@ -94,7 +94,7 @@ int cdecl Message (UINT type, LPCTSTR title, int text, LPCTSTR fmt, ...) int cdecl Message (UINT type, int title, LPCTSTR text, LPCTSTR fmt, ...) { va_list arg; - if (fmt != NULL) + // if (fmt != NULL) va_start (arg, fmt); return vMessage (type, (LONG)title, (LONG)text, fmt, arg); } @@ -103,7 +103,7 @@ int cdecl Message (UINT type, int title, LPCTSTR text, LPCTSTR fmt, ...) int cdecl Message (UINT type, int title, int text, LPCTSTR fmt, ...) { va_list arg; - if (fmt != NULL) + // if (fmt != NULL) va_start (arg, fmt); return vMessage (type, (LONG)title, (LONG)text, fmt, arg); } diff --git a/src/WINNT/talocale/tal_main.cpp b/src/WINNT/talocale/tal_main.cpp index 895174558..ebea1ad3d 100644 --- a/src/WINNT/talocale/tal_main.cpp +++ b/src/WINNT/talocale/tal_main.cpp @@ -10,6 +10,8 @@ extern "C" { #include #include +#include +#include } #include @@ -55,22 +57,38 @@ BOOL IsValidStringTemplate (LPCSTRINGTEMPLATE pTable); void TaLocale_Initialize (void) { - static BOOL fInitialized = FALSE; - if (!fInitialized) - { - fInitialized = TRUE; + static BOOL fInitialized = FALSE; + + if (!fInitialized) { + char mutexName[256]; + sprintf(mutexName, "TaLocale_Initialize pid=%d", getpid()); + HANDLE hMutex = CreateMutex(NULL, TRUE, mutexName); + if ( GetLastError() == ERROR_ALREADY_EXISTS ) { + if ( WaitForSingleObject( hMutex, INFINITE ) != WAIT_OBJECT_0 ) { + return; + } + } - InitCommonControls(); - InitializeCriticalSection (&l_csModules); - TaLocale_SpecifyModule (GetModuleHandle(NULL)); + if (!fInitialized) + { + InitCommonControls(); + InitializeCriticalSection (&l_csModules); - LCID lcidUser = GetUserDefaultLCID(); - TaLocale_SetLanguage (LANGIDFROMLCID (lcidUser)); + fInitialized = TRUE; + ReleaseMutex(hMutex); + CloseHandle(hMutex); - LANGID LangOverride; - if ((LangOverride = TaLocale_GetLanguageOverride()) != (LANGID)0) - TaLocale_SetLanguage (LangOverride); - } + + TaLocale_SpecifyModule (GetModuleHandle(NULL)); + + LCID lcidUser = GetUserDefaultLCID(); + TaLocale_SetLanguage (LANGIDFROMLCID (lcidUser)); + + LANGID LangOverride; + if ((LangOverride = TaLocale_GetLanguageOverride()) != (LANGID)0) + TaLocale_SetLanguage (LangOverride); + } + } } @@ -609,81 +627,87 @@ LPCDLGTEMPLATE TaLocale_GetDialogResource (int idd, HINSTANCE *phInstFound) LPCSTRINGTEMPLATE TaLocale_GetStringResource (int ids, HINSTANCE *phInstFound) { - // Strings are organized into heaps of String Tables, each table - // holding 16 strings (regardless of their length). The first table's - // first string index is for string #1. When searching for a string, - // the string's table is the index given to FindResource. - // - LPCSTRINGTEMPLATE pst = NULL; - LANGID lang = TaLocale_GetLanguage(); - - int iTable = (ids / 16) + 1; // 1 = first string table - int iIndex = ids - ((iTable-1) * 16); // 0 = first string in the table - - HINSTANCE hInstance; - for (size_t iModule = 0; !pst && TaLocale_EnumModule (iModule, &hInstance); ++iModule) - { - HRSRC hr; - if ((hr = FindResourceEx (hInstance, RT_STRING, MAKEINTRESOURCE( iTable ), lang)) == NULL) - { - // Our translation teams don't usually change the language - // constants within .RC files, so we should look for English - // language translations too. - // - if ((hr = FindResourceEx (hInstance, RT_STRING, MAKEINTRESOURCE( iTable ), MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US))) == NULL) - { - // If we still can't find it, we'll take anything... + // Strings are organized into heaps of String Tables, each table + // holding 16 strings (regardless of their length). The first table's + // first string index is for string #1. When searching for a string, + // the string's table is the index given to FindResource. + // + LPCSTRINGTEMPLATE pst = NULL; + LANGID lang = TaLocale_GetLanguage(); + + int iTable = (ids / 16) + 1; // 1 = first string table + int iIndex = ids - ((iTable-1) * 16); // 0 = first string in the table + + HINSTANCE hInstance; + for (size_t iModule = 0; !pst && TaLocale_EnumModule (iModule, &hInstance); ++iModule) + { + HRSRC hr; + if ((hr = FindResourceEx (hInstance, RT_STRING, MAKEINTRESOURCE( iTable ), lang)) == NULL) + { + // Our translation teams don't usually change the language + // constants within .RC files, so we should look for English + // language translations too. // - if ((hr = FindResource (hInstance, RT_STRING, MAKEINTRESOURCE( iTable ))) == NULL) - continue; + if ((hr = FindResourceEx (hInstance, RT_STRING, MAKEINTRESOURCE( iTable ), MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US))) == NULL) + { + // If we still can't find it, we'll take anything... + // + if ((hr = FindResource (hInstance, RT_STRING, MAKEINTRESOURCE( iTable ))) == NULL) + continue; } - } + } - HGLOBAL hg; - if ((hg = LoadResource (hInstance, hr)) != NULL) - { - const WORD *pTable; - if ((pTable = (WORD*)LockResource (hg)) != NULL) + HGLOBAL hg; + if ((hg = LoadResource (hInstance, hr)) != NULL) + { + const WORD *pTable; + if ((pTable = (WORD*)LockResource (hg)) != NULL) { - try { - // Skip words in the string table until we reach the string - // index we're looking for. - // - for (int iIndexWalk = iIndex; iIndexWalk; --iIndexWalk) - pTable += 1 + ((LPCSTRINGTEMPLATE)pTable)->cchString; - - if (IsValidStringTemplate ((LPCSTRINGTEMPLATE)pTable)) - { - pst = (LPCSTRINGTEMPLATE)pTable; - if (phInstFound) - *phInstFound = hInstance; - } - } - catch(...) - { - // If we walked off the end of the table, then the - // string we want just wasn't there. - } + try { + // Skip words in the string table until we reach the string + // index we're looking for. + // + for (int iIndexWalk = iIndex; iIndexWalk && ((LPCSTRINGTEMPLATE)pTable)->cchString; --iIndexWalk) { + pTable += 1 + ((LPCSTRINGTEMPLATE)pTable)->cchString; + } + + if (IsValidStringTemplate ((LPCSTRINGTEMPLATE)pTable)) + { + pst = (LPCSTRINGTEMPLATE)pTable; + if (phInstFound) + *phInstFound = hInstance; + } else { + UnlockResource(pTable); + FreeResource(hg); + } + } + catch(...) + { + UnlockResource(pTable); + FreeResource(hg); + // If we walked off the end of the table, then the + // string we want just wasn't there. + } } - } - } + } + } - return pst; + return pst; } BOOL IsValidStringTemplate (LPCSTRINGTEMPLATE pTable) { - if (!pTable->cchString) - return FALSE; + if (!pTable->cchString) + return FALSE; - for (size_t ii = 0; ii < pTable->cchString; ++ii) - { - if (!pTable->achString[ii]) - return FALSE; - } + for (size_t ii = 0; ii < pTable->cchString; ++ii) + { + if (!pTable->achString[ii]) + return FALSE; + } - return TRUE; + return TRUE; } diff --git a/src/WINNT/talocale/tal_string.cpp b/src/WINNT/talocale/tal_string.cpp index 59793a6b8..bae31ee0b 100644 --- a/src/WINNT/talocale/tal_string.cpp +++ b/src/WINNT/talocale/tal_string.cpp @@ -181,7 +181,7 @@ void cdecl vFormatMultiString (LPTSTR *ppszTarget, BOOL fAddHead, LONG ids, LPCT void cdecl FormatMultiString (LPTSTR *ppszTarget, BOOL fAddHead, LPCTSTR pszTemplate, LPCTSTR pszFormat, ...) { va_list arg; - if (pszFormat != NULL) + //if (pszFormat != NULL) va_start (arg, pszFormat); vFormatMultiString (ppszTarget, fAddHead, (LONG)pszTemplate, pszFormat, arg); } @@ -189,7 +189,7 @@ void cdecl FormatMultiString (LPTSTR *ppszTarget, BOOL fAddHead, LPCTSTR pszTemp void cdecl FormatMultiString (LPTSTR *ppszTarget, BOOL fAddHead, int idsTemplate, LPCTSTR pszFormat, ...) { va_list arg; - if (pszFormat != NULL) + //if (pszFormat != NULL) va_start (arg, pszFormat); vFormatMultiString (ppszTarget, fAddHead, (LONG)idsTemplate, pszFormat, arg); } @@ -212,7 +212,7 @@ void cdecl vFormatMultiString (LPTSTR *ppszTarget, BOOL fAddHead, int idsTemplat LPTSTR cdecl FormatString (LPCTSTR psz, LPCTSTR pszFmt, ...) { va_list arg; - if (pszFmt != NULL) + //if (pszFmt != NULL) va_start (arg, pszFmt); return vFormatString ((LONG)psz, pszFmt, arg); } @@ -220,7 +220,7 @@ LPTSTR cdecl FormatString (LPCTSTR psz, LPCTSTR pszFmt, ...) LPTSTR cdecl FormatString (int ids, LPCTSTR pszFmt, ...) { va_list arg; - if (pszFmt != NULL) + //if (pszFmt != NULL) va_start (arg, pszFmt); return vFormatString ((LONG)ids, pszFmt, arg); } @@ -1491,59 +1491,66 @@ void FreeString (LPCVOID pszString, LPCVOID pszOriginalString) LPSTR StringToAnsi (LPCTSTR pszOriginal) { -#ifndef UNICODE - return (LPSTR)pszOriginal; + if (!pszOriginal) + return NULL; + LPSTR pszTargetA; + int len = lstrlen(pszOriginal); + if ((pszTargetA = AllocateAnsi (1+len)) != NULL) { +#ifdef UNICODE + CopyUnicodeToAnsi (pszTargetA, pszOriginal); #else - if (!pszOriginal) - return NULL; - LPSTR pszTargetA; - if ((pszTargetA = AllocateAnsi (1+lstrlen(pszOriginal))) != NULL) - CopyUnicodeToAnsi (pszTargetA, pszOriginal); - return pszTargetA; + lstrcpy (pszTargetA, (LPSTR)pszOriginal); #endif + } + return pszTargetA; } LPTSTR AnsiToString (LPCSTR pszOriginalA) { -#ifndef UNICODE - return (LPTSTR)pszOriginalA; + if (!pszOriginalA) + return NULL; + LPTSTR pszTarget; + int lenA = lstrlenA(pszOriginalA); + if ((pszTarget = AllocateString (1+lenA)) != NULL) { +#ifdef UNICODE + CopyAnsiToUnicode (pszTarget, pszOriginalA); #else - if (!pszOriginalA) - return NULL; - LPTSTR pszTarget; - if ((pszTarget = AllocateString (1+lstrlenA(pszOriginalA))) != NULL) - CopyAnsiToUnicode (pszTarget, pszOriginalA); - return pszTarget; + lstrcpy (pszTarget, (LPSTR)pszOriginalA); #endif + } + return pszTarget; } LPWSTR StringToUnicode (LPCTSTR pszOriginal) { + if (!pszOriginal) + return NULL; + LPWSTR pszTargetW; + int len = lstrlen(pszOriginal); + if ((pszTargetW = AllocateUnicode (1+len)) != NULL) { #ifdef UNICODE - return (LPWSTR)pszOriginal; + lstrcpyW ((LPWSTR)pszTargetW, (LPWSTR)pszOriginal); #else - if (!pszOriginal) - return NULL; - LPWSTR pszTargetW; - if ((pszTargetW = AllocateUnicode (1+lstrlen(pszOriginal))) != NULL) - CopyAnsiToUnicode (pszTargetW, pszOriginal); - return pszTargetW; + CopyAnsiToUnicode (pszTargetW, pszOriginal); #endif + } + return pszTargetW; } LPTSTR UnicodeToString (LPCWSTR pszOriginalW) { + if (!pszOriginalW) + return NULL; + LPTSTR pszTarget; + if ((pszTarget = AllocateString (1+lstrlenW(pszOriginalW))) != NULL) { #ifdef UNICODE - return (LPTSTR)pszOriginalW; + lstrcpyW ((LPWSTR)pszTargetW, (LPWSTR)pszOriginal); #else - if (!pszOriginalW) - return NULL; - LPTSTR pszTarget; - if ((pszTarget = AllocateString (1+lstrlenW(pszOriginalW))) != NULL) - CopyUnicodeToAnsi (pszTarget, pszOriginalW); - return pszTarget; + CopyUnicodeToAnsi (pszTarget, pszOriginalW); #endif + } + return pszTarget; } diff --git a/src/WINNT/win9xpanel/NTMakefile b/src/WINNT/win9xpanel/NTMakefile index 8cc9dce0d..a34b3e9ce 100644 --- a/src/WINNT/win9xpanel/NTMakefile +++ b/src/WINNT/win9xpanel/NTMakefile @@ -11,6 +11,7 @@ #AFSD_INC_SDK9X = /I $(HOMEDRIVE)\tol\sdk95\Include #AFSD_INC_MFC9X = /I $(HOMEDRIVE)\PROGRA~1\MICROS~2\VC98\INCLUDE /I $(HOMEDRIVE)\PROGRA~1\MICROS~2\VC98\MFC\INCLUDE /I $(HOMEDRIVE)\PROGRA~1\MICROS~2\VC98\ATL\INCLUDE +RELDIR=WINNT\win9xpanel !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) OUTDIR = $(DESTDIR)\WinInstall OUTDIRHLP = $(OUTDIR) @@ -53,12 +54,12 @@ prep : !IF "$(AFSDEV_BUILDTYPE)" == "FREE" -INTDIR=. +INTDIR=$(OUT)\ HLP=hcrtf.exe HLP_PROJ = /x # Begin Custom Macros # End Custom Macros - + INSTALL : prep "$(OUTDIR)\WinAfsLoad.exe" "$(OUTDIRHLP)\afswin9x.HLP" "$(OUTDIR)\afswin9x.CNT" CLEAN :: @@ -74,7 +75,7 @@ CLEAN :: CPP_PROJ=/nologo /MD /W3 /GX /O2 \ $(CPP_INCLUDE) /P \ /I "$(DESTDIR)\include\\" /I "$(DESTDIR)\include\rx" /I "$(DESTDIR)\include\afs" \ - /D "NDEBUG" /D "_MFC" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_WINNT" /D "_AFXDLL" /D "ENCRIPT" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c + /D "NDEBUG" /D "_MFC" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_WINNT" /D "_AFXDLL" /D "ENCRIPT" /Fo"$(OUT)\\\" /Fd"$(INTDIR)\\" /FD /c MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 RSC_PROJ=/l 0x409 /fo"$(INTDIR)\WinAfsLoad.res" $(AFSD_INC_MFC) /d "AFSPRODUCT_VERSION=\"$(AFSPRODUCT_VERSION)\"" /d "NDEBUG" /d "_AFXDLL" @@ -112,7 +113,7 @@ LINK32_OBJS= \ !ELSEIF "$(AFSDEV_BUILDTYPE)" == "CHECKED" -INTDIR=. +INTDIR=$(OUT)\ HLP=hcrtf.exe HLP_PROJ = /x # Begin Custom Macros @@ -186,27 +187,27 @@ $(DS_POSTBUILD_DEP) : "$(OUTDIR)\WinAfsLoad.exe" !ENDIF -.c{$(INTDIR)}.obj:: +.c.${$(OUT)\}obj:: $(CPP) @<< $(CPP_PROJ) $< << -.cxx{$(INTDIR)}.obj:: +.cxx.obj:: $(CPP) @<< $(CPP_PROJ) $< << -.c{$(INTDIR)}.sbr:: +.c.$(OUT)\sbr:: $(CPP) @<< $(CPP_PROJ) $< << -.cpp{$(INTDIR)}.sbr:: +.cpp$.$(OUT)\sbr:: $(CPP) @<< $(CPP_PROJ) $< << -.cxx{$(INTDIR)}.sbr:: +.cxx.$(OUT)\sbr:: $(CPP) @<< $(CPP_PROJ) $< << @@ -334,3 +335,6 @@ SOURCE=.\WinAfsLoadDlg.cpp install9x: install +mkdir: + + diff --git a/src/WINNT/win9xpanel/resource.h b/src/WINNT/win9xpanel/resource.h index 4b4a1573e..a9bd147a9 100644 --- a/src/WINNT/win9xpanel/resource.h +++ b/src/WINNT/win9xpanel/resource.h @@ -9,9 +9,16 @@ License. For details, see the LICENSE file in the top-level source directory or online at http://www.openafs.org/dl/license10.html */ + +#define IDS_ABOUTBOX 0 +#define IDS_HIDE 1 +#define IDS_DISCONNECT 2 +#define IDS_HIDEADVANCE 3 +#define IDS_HIDELOG 4 +#define IDS_FORGETUSERNAME 5 + #define IDM_ABOUTBOX 0x0010 #define IDD_ABOUTBOX 100 -#define IDS_ABOUTBOX 101 #define IDD_WINAFSLOAD_DIALOG 102 #define IDP_SOCKETS_INIT_FAILED 103 #define IDR_MAINFRAME 128 @@ -28,7 +35,6 @@ #define IDD_SETTINGS 252 #define IDC_CONNECT 1001 #define IDC_CANCEL 1002 -#define IDS_HIDE 1003 #define IDC_OPTIONLINE 1005 #define IDC_PICTURE 1006 #define IDC_EDIT 1007 @@ -42,11 +48,7 @@ #define IDC_ADD 1018 #define IDC_CHANGE 1019 #define IDC_REMOVE 1020 -#define IDS_DISCONNECT 1021 -#define IDS_HIDEADVANCE 1023 #define IDC_MOUNTDISPLAY 1024 -#define IDS_HIDELOG 1024 -#define IDS_FORGETUSERNAME 1025 #define IDC_DRIVE 1027 #define IDC_STATICMSG 1029 #define IDC_AUTH 1033 diff --git a/src/afs/.cvsignore b/src/afs/.cvsignore index 61d3b800b..fb596ce66 100644 --- a/src/afs/.cvsignore +++ b/src/afs/.cvsignore @@ -3,3 +3,5 @@ Makefile afs_trace.h afs_trace.msf afszcm.cat +unified_afs.c +unified_afs.h diff --git a/src/afs/AIX/osi_assem32.s b/src/afs/AIX/osi_assem32.s new file mode 100644 index 000000000..add910512 --- /dev/null +++ b/src/afs/AIX/osi_assem32.s @@ -0,0 +1,43 @@ +# Copyright 2000, International Business Machines Corporation and others. +# All Rights Reserved. +# +# This software has been released under the terms of the IBM Public +# License. For details, see the LICENSE file in the top-level source +# directory or online at http://www.openafs.org/dl/license10.html + +# $Locker: $ +# +# misc.s - miscellaneous assembler routines for the rs/6000 +# + +# +# get_toc - return the current TOC +# + .csect .get_toc[PR] + .globl .get_toc[PR] + mr 3,2 # get TOC + br + .align 2 + .tbtag 0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 + + .toc + .csect get_toc[DS] + .globl get_toc[DS] + .long .get_toc[PR] + .long TOC[t0] + +# +# get_ret_addr - return the caller's return address +# + .csect .get_ret_addr[PR] + .globl .get_ret_addr[PR] + l 3, 0(1) # caller's saved stack pointer + l 3, 8(3) # caller's saved link register + br + .align 2 + .tbtag 0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 + .toc + .csect get_ret_addr[DS] + .globl get_ret_addr[DS] + .long .get_ret_addr[PR] + .long TOC[t0] diff --git a/src/afs/AIX/osi_assem64.s b/src/afs/AIX/osi_assem64.s new file mode 100644 index 000000000..6177fd568 --- /dev/null +++ b/src/afs/AIX/osi_assem64.s @@ -0,0 +1,43 @@ +# Copyright 2000, International Business Machines Corporation and others. +# All Rights Reserved. +# +# This software has been released under the terms of the IBM Public +# License. For details, see the LICENSE file in the top-level source +# directory or online at http://www.openafs.org/dl/license10.html + +# $Locker: $ +# +# misc.s - miscellaneous assembler routines for the rs/6000 +# + +# +# get_toc - return the current TOC +# + .csect .get_toc[PR] + .globl .get_toc[PR] + mr 3,2 # get TOC + br + .align 2 + .tbtag 0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 + + .toc + .csect get_toc[DS] + .globl get_toc[DS] + .llong .get_toc[PR] + .llong TOC[t0] + +# +# get_ret_addr - return the caller's return address +# + .csect .get_ret_addr[PR] + .globl .get_ret_addr[PR] + l 3, 0(1) # caller's saved stack pointer + l 3, 8(3) # caller's saved link register + br + .align 2 + .tbtag 0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 + .toc + .csect get_ret_addr[DS] + .globl get_ret_addr[DS] + .llong .get_ret_addr[PR] + .llong TOC[t0] diff --git a/src/afs/AIX/osi_config.c b/src/afs/AIX/osi_config.c index 6fa3d470c..93d015ab1 100644 --- a/src/afs/AIX/osi_config.c +++ b/src/afs/AIX/osi_config.c @@ -34,9 +34,10 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_config.c,v 1.1.1.4 2001/07/14 22:19:33 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/AIX/osi_config.c,v 1.8 2003/07/15 23:14:16 shadow Exp $"); #include "sys/limits.h" #include "sys/types.h" @@ -50,14 +51,14 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_config.c,v 1.1.1.4 2001/07/ #include "sys/gfs.h" #include "sys/uio.h" #include "sys/pri.h" -#include "sys/priv.h" /* XXX */ +#include "sys/priv.h" /* XXX */ #include "sys/lockl.h" #include "sys/malloc.h" -#include /* to define the assert and ASSERT macros */ -#include /* For the timer related defines */ -#include /* for the serialization defines */ -#include /* for the parameters to xmalloc() */ -#include "afs/afs_osi.h" /* pick up osi_timeval_t for afs_stats.h */ +#include /* to define the assert and ASSERT macros */ +#include /* For the timer related defines */ +#include /* for the serialization defines */ +#include /* for the parameters to xmalloc() */ +#include "afs/afs_osi.h" /* pick up osi_timeval_t for afs_stats.h */ #include "afs/afs_stats.h" #include "export.h" @@ -66,15 +67,24 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_config.c,v 1.1.1.4 2001/07/ #else #define KOFF_PRESENT 0 #endif - + #if !KOFF_PRESENT -_db_trace() { ; } +_db_trace() +{; +} + long db_tflags = 0; #endif extern struct gfs afs_gfs; extern struct vnodeops locked_afs_gn_vnodeops; +#ifdef __64BIT__ +afs_uint64 get_toc(); +#else +afs_uint32 get_toc(); +#endif + #define AFS_CALLOUT_TBL_SIZE 256 #include @@ -88,69 +98,70 @@ extern Simple_lock afs_callout_lock; * uiop - uio vector describing any config params */ afs_config(cmd, uiop) -struct uio *uiop; { - int err; - extern struct vnodeops *afs_ops; - - AFS_STATCNT(afs_config); - - err = 0; - AFS_GLOCK(); - if (cmd == CFG_INIT) { /* add AFS gfs */ - /* - * init any vrmix mandated kluges - */ - if (err = kluge_init()) - goto out; - /* - * make sure that we pin everything - */ - if (err = pincode(afs_config)) - goto out; - err = gfsadd(AFS_MOUNT_AFS, &afs_gfs); - /* - * ok, if already installed - */ - if (err == EBUSY) - err = 0; - if (!err) { - pin(&afs_callout_lock, sizeof(afs_callout_lock)); - lock_alloc(&afs_callout_lock, LOCK_ALLOC_PIN, 0, 5); - simple_lock_init(&afs_callout_lock); - afs_ops = &locked_afs_gn_vnodeops; - timeoutcf(AFS_CALLOUT_TBL_SIZE); - } else { - unpincode(afs_config); - goto out; - } - if (KOFF_PRESENT) { - extern void *db_syms[]; - extern db_nsyms; - - koff_addsyms(db_syms, db_nsyms); - } - } else if (cmd == CFG_TERM) { /* delete AFS gfs */ - err = gfsdel(AFS_MOUNT_AFS); - /* - * ok, if already deleted - */ - if (err == ENOENT) - err = 0; - else if (!err) { - if (err = unpincode(afs_config)) - err = 0; - - timeoutcf(-AFS_CALLOUT_TBL_SIZE); - } - } else /* unknown command */ - err = EINVAL; - - out: - AFS_GUNLOCK(); - if ( !err && (cmd == CFG_INIT) ) - osi_Init(); - - return err; + struct uio *uiop; +{ + int err; + extern struct vnodeops *afs_ops; + + AFS_STATCNT(afs_config); + + err = 0; + AFS_GLOCK(); + if (cmd == CFG_INIT) { /* add AFS gfs */ + /* + * init any vrmix mandated kluges + */ + if (err = kluge_init()) + goto out; + /* + * make sure that we pin everything + */ + if (err = pincode(afs_config)) + goto out; + err = gfsadd(AFS_MOUNT_AFS, &afs_gfs); + /* + * ok, if already installed + */ + if (err == EBUSY) + err = 0; + if (!err) { + pin(&afs_callout_lock, sizeof(afs_callout_lock)); + lock_alloc(&afs_callout_lock, LOCK_ALLOC_PIN, 0, 5); + simple_lock_init(&afs_callout_lock); + afs_ops = &locked_afs_gn_vnodeops; + timeoutcf(AFS_CALLOUT_TBL_SIZE); + } else { + unpincode(afs_config); + goto out; + } + if (KOFF_PRESENT) { + extern void *db_syms[]; + extern db_nsyms; + + koff_addsyms(db_syms, db_nsyms); + } + } else if (cmd == CFG_TERM) { /* delete AFS gfs */ + err = gfsdel(AFS_MOUNT_AFS); + /* + * ok, if already deleted + */ + if (err == ENOENT) + err = 0; + else if (!err) { + if (err = unpincode(afs_config)) + err = 0; + + timeoutcf(-AFS_CALLOUT_TBL_SIZE); + } + } else /* unknown command */ + err = EINVAL; + + out: + AFS_GUNLOCK(); + if (!err && (cmd == CFG_INIT)) + osi_Init(); + + return err; } /* @@ -164,7 +175,8 @@ struct uio *uiop; { * Seems we can't make up our mind what to call these */ char * -mem_getbytes(size) { +mem_getbytes(size) +{ return malloc(size); } @@ -173,33 +185,38 @@ mem_getbytes(size) { * mem_freebytes - memory deallocator */ mem_freebytes(p, size) -char *p; { + char *p; +{ free(p); } char * -kmem_alloc(size) { +kmem_alloc(size) +{ - return malloc(size); + return malloc(size); } kmem_free(p, size) -char *p; { + char *p; +{ - free(p); + free(p); } VN_RELE(vp) -register struct vnode *vp; { + register struct vnode *vp; +{ - VNOP_RELE(vp); + VNOP_RELE(vp); } VN_HOLD(vp) -register struct vnode *vp; { + register struct vnode *vp; +{ - VNOP_HOLD(vp); + VNOP_HOLD(vp); } /* @@ -207,48 +224,48 @@ register struct vnode *vp; { * from the kernel isn't, so we must be devious. */ -int (*kluge_ufdalloc)(); -int (*kluge_fpalloc)(); -void *(*kluge_ufdfree)(); -void *(*kluge_ffree)(); -int (*kluge_iptovp)(); -int (*kluge_dev_ialloc)(); -int (*kluge_iget)(); -int (*kluge_iput)(); -int (*kluge_commit)(); -void *(*kluge_ksettimer)(); -void *(*kluge_fsSimpleLock)(); -void *(*kluge_fsSimpleUnlock)(); -void *(*kluge_fsReadLock)(); -void *(*kluge_fsWriteLock)(); -void *(*kluge_fsCxUnlock)(); +int (*kluge_ufdalloc) (); +int (*kluge_fpalloc) (); +void *(*kluge_ufdfree) (); +void *(*kluge_ffree) (); +int (*kluge_iptovp) (); +int (*kluge_dev_ialloc) (); +int (*kluge_iget) (); +int (*kluge_iput) (); +int (*kluge_commit) (); +void *(*kluge_ksettimer) (); +void *(*kluge_fsSimpleLock) (); +void *(*kluge_fsSimpleUnlock) (); +void *(*kluge_fsReadLock) (); +void *(*kluge_fsWriteLock) (); +void *(*kluge_fsCxUnlock) (); /* * kernel function import list */ struct k_func kfuncs[] = { - { (void *(**)()) &kluge_ufdalloc, ".ufdalloc" }, - { (void *(**)()) &kluge_fpalloc, ".fpalloc" }, - { &kluge_ufdfree, ".ufdfree" }, - { &kluge_ffree, ".ffree" }, - { (void *(**)()) &kluge_iptovp, ".iptovp" }, - { (void *(**)()) &kluge_dev_ialloc, ".dev_ialloc" }, - { (void *(**)()) &kluge_iget, ".iget" }, - { (void *(**)()) &kluge_iput, ".iput" }, - { (void *(**)()) &kluge_commit, ".commit" }, - { &kluge_ksettimer, ".ksettimer" }, + {(void *(**)())&kluge_ufdalloc, ".ufdalloc"}, + {(void *(**)())&kluge_fpalloc, ".fpalloc"}, + {&kluge_ufdfree, ".ufdfree"}, + {&kluge_ffree, ".ffree"}, + {(void *(**)())&kluge_iptovp, ".iptovp"}, + {(void *(**)())&kluge_dev_ialloc, ".dev_ialloc"}, + {(void *(**)())&kluge_iget, ".iget"}, + {(void *(**)())&kluge_iput, ".iput"}, + {(void *(**)())&kluge_commit, ".commit"}, + {&kluge_ksettimer, ".ksettimer"}, #ifdef _FSDEBUG - { &kluge_fsSimpleLock, ".fs_simple_lock" }, - { &kluge_fsSimpleUnlock, ".fs_simple_unlock" }, - { &kluge_fsReadLock, ".fs_read_lock" }, - { &kluge_fsWriteLock, ".fs_write_lock" }, - { &kluge_fsCxUnlock, ".fs_complex_unlock" }, + {&kluge_fsSimpleLock, ".fs_simple_lock"}, + {&kluge_fsSimpleUnlock, ".fs_simple_unlock"}, + {&kluge_fsReadLock, ".fs_read_lock"}, + {&kluge_fsWriteLock, ".fs_write_lock"}, + {&kluge_fsCxUnlock, ".fs_complex_unlock"}, #endif - { 0, 0 }, + {0, 0}, }; -void *vnodefops; /* dummy vnodeops */ +void *vnodefops; /* dummy vnodeops */ struct ifnet *ifnet; Simple_lock jfs_icache_lock; Simple_lock proc_tbl_lock; @@ -257,120 +274,148 @@ Simple_lock proc_tbl_lock; * kernel variable import list */ struct k_var kvars[] = { - { (void *) &vnodefops, "vnodefops" }, - { (void *) &ifnet, "ifnet" }, - { (void *) &jfs_icache_lock, "jfs_icache_lock" }, - { (void *) &proc_tbl_lock, "proc_tbl_lock" }, - { 0, 0 }, + {(void *)&vnodefops, "vnodefops"}, + {(void *)&ifnet, "ifnet"}, + {(void *)&jfs_icache_lock, "jfs_icache_lock"}, +#ifndef AFS_AIX51_ENV + {(void *)&proc_tbl_lock, "proc_tbl_lock"}, +#endif + {0, 0}, }; /* * kluge_init - initialise the kernel imports kluge */ -kluge_init() { - register struct k_func *kf; - register struct k_var *kv; - register afs_uint32 toc; - register err = 0; - - toc = get_toc(); - for (kf = kfuncs; !err && kf->name; ++kf) { - err = import_kfunc(kf); - } - for (kv = kvars; !err && kv->name; ++kv) { - err = import_kvar(kv, toc); - } +kluge_init() +{ + register struct k_func *kf; + register struct k_var *kv; +#ifdef __64BIT__ + register afs_uint64 toc; +#else + register afs_uint32 toc; +#endif + register err = 0; + + toc = get_toc(); + for (kf = kfuncs; !err && kf->name; ++kf) { + err = import_kfunc(kf); + } + for (kv = kvars; !err && kv->name; ++kv) { + err = import_kvar(kv, toc); + } - return err; + return err; } ufdalloc(i, fdp) -int *fdp; { + int *fdp; +{ - return (*kluge_ufdalloc)(i, fdp); + return (*kluge_ufdalloc) (i, fdp); } fpalloc(vp, flag, type, ops, fpp) -struct vnode *vp; -struct fileops *ops; -struct file **fpp; { + struct vnode *vp; + struct fileops *ops; + struct file **fpp; +{ - return (*kluge_fpalloc)(vp, flag, type, ops, fpp); + return (*kluge_fpalloc) (vp, flag, type, ops, fpp); } void -ufdfree(fd) { +ufdfree(fd) +{ - (void) (*kluge_ufdfree)(fd); + (void)(*kluge_ufdfree) (fd); } void ffree(fp) -struct file *fp; { + struct file *fp; +{ - (void) (*kluge_ffree)(fp); + (void)(*kluge_ffree) (fp); } iptovp(vfsp, ip, vpp) -struct vfs *vfsp; -struct inode *ip, **vpp; { + struct vfs *vfsp; + struct inode *ip, **vpp; +{ - return (*kluge_iptovp)(vfsp, ip, vpp); + return (*kluge_iptovp) (vfsp, ip, vpp); } dev_ialloc(pip, ino, mode, vfsp, ipp) -struct inode *pip; -ino_t ino; -mode_t mode; -struct vfs *vfsp; -struct inode **ipp; { + struct inode *pip; + ino_t ino; + mode_t mode; + struct vfs *vfsp; + struct inode **ipp; +{ - return (*kluge_dev_ialloc)(pip, ino, mode, vfsp, ipp); + return (*kluge_dev_ialloc) (pip, ino, mode, vfsp, ipp); } iget(dev, ino, ipp, doscan, vfsp) -dev_t dev; -ino_t ino; -struct vfs *vfsp; -struct inode **ipp; { - - return (*kluge_iget)(dev, ino, ipp, doscan, vfsp); + dev_t dev; + ino_t ino; +#ifdef __64BIT__ + afs_size_t doscan; +#endif + struct vfs *vfsp; + struct inode **ipp; +{ +#ifdef __64BIT__ + afs_int64 dummy[10]; + dummy[0] = doscan; + + return (*kluge_iget) (dev, ino, ipp, (afs_size_t) doscan, vfsp, &dummy); +#else + return (*kluge_iget) (dev, ino, ipp, doscan, vfsp); +#endif } iput(ip, vfsp) -struct vfs *vfsp; -struct inode *ip; { - return (*kluge_iput)(ip, vfsp); + struct vfs *vfsp; + struct inode *ip; +{ + return (*kluge_iput) (ip, vfsp); } commit(n, i0, i1, i2) -struct inode *i0, *i1, *i2; { + struct inode *i0, *i1, *i2; +{ - return (*kluge_commit)(n, i0, i1, i2); + return (*kluge_commit) (n, i0, i1, i2); } #ifdef _FSDEBUG -fs_simple_lock(void *lp, int type) { - return (*kluge_fsSimpleLock)(lp, type); +fs_simple_lock(void *lp, int type) +{ + return (*kluge_fsSimpleLock) (lp, type); } -fs_simple_unlock(void *lp, int type) { - return (*kluge_fsSimpleUnlock)(lp, type); +fs_simple_unlock(void *lp, int type) +{ + return (*kluge_fsSimpleUnlock) (lp, type); } -fs_read_lock(complex_lock_t lp, int type) { - return (*kluge_fsReadLock)(lp, type); +fs_read_lock(complex_lock_t lp, int type) +{ + return (*kluge_fsReadLock) (lp, type); } -fs_write_lock(complex_lock_t lp, int type) { - return (*kluge_fsWriteLock)(lp, type); +fs_write_lock(complex_lock_t lp, int type) +{ + return (*kluge_fsWriteLock) (lp, type); } -fs_complex_unlock(complex_lock_t lp, int type) { - return (*kluge_fsCxUnlock)(lp, type); +fs_complex_unlock(complex_lock_t lp, int type) +{ + return (*kluge_fsCxUnlock) (lp, type); } #endif - - diff --git a/src/afs/AIX/osi_file.c b/src/afs/AIX/osi_file.c index 4f64a92ee..2bea9a41e 100644 --- a/src/afs/AIX/osi_file.c +++ b/src/afs/AIX/osi_file.c @@ -8,34 +8,35 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_file.c,v 1.1.1.5 2001/09/11 14:24:51 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/AIX/osi_file.c,v 1.9 2003/07/15 23:14:16 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ -int afs_osicred_initialized=0; -struct AFS_UCRED afs_osi_cred; +int afs_osicred_initialized = 0; +struct AFS_UCRED afs_osi_cred; afs_lock_t afs_xosi; /* lock is for tvattr */ extern struct osi_dev cacheDev; extern struct vfs *afs_cacheVfsp; -void *osi_UFSOpen(ainode) - afs_int32 ainode; +void * +osi_UFSOpen(afs_int32 ainode) { struct inode *ip; register struct osi_file *afile = NULL; extern struct vfs *rootvfs; - struct vnode *vp = (struct vnode *)0; + struct vnode *vp = NULL; extern int cacheDiskType; afs_int32 code = 0; int dummy; AFS_STATCNT(osi_UFSOpen); - if(cacheDiskType != AFS_FCACHE_TYPE_UFS) { + if (cacheDiskType != AFS_FCACHE_TYPE_UFS) { osi_Panic("UFSOpen called for non-UFS cache\n"); } if (!afs_osicred_initialized) { @@ -44,30 +45,31 @@ void *osi_UFSOpen(ainode) crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */ afs_osicred_initialized = 1; } - afile = (struct osi_file *) osi_AllocSmallSpace(sizeof(struct osi_file)); + afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file)); setuerror(0); AFS_GUNLOCK(); - ip = (struct inode *) igetinode((dev_t) cacheDev.dev, rootvfs, (ino_t)ainode, &vp,&dummy); + ip = (struct inode *)igetinode((dev_t) cacheDev.dev, rootvfs, + (ino_t) ainode, &vp, &dummy); AFS_GLOCK(); if (getuerror()) { osi_FreeSmallSpace(afile); osi_Panic("UFSOpen: igetinode failed"); } - afile->vnode = vp; /* Save the vnode pointer for the inode ip; also ip is already prele'ed in igetinode */ + afile->vnode = vp; /* Save the vnode pointer for the inode ip; also ip is already prele'ed in igetinode */ afile->size = VTOI(afile->vnode)->i_size; afile->offset = 0; - afile->proc = (int (*)()) 0; - afile->inum = ainode; /* for hint validity checking */ + afile->proc = (int (*)())0; + afile->inum = ainode; /* for hint validity checking */ return (void *)afile; } -afs_osi_Stat(afile, astat) - register struct osi_file *afile; - register struct osi_stat *astat; { +int +afs_osi_Stat(register struct osi_file *afile, register struct osi_stat *astat) +{ register afs_int32 code; struct vattr tvattr; AFS_STATCNT(osi_Stat); - MObtainWriteLock(&afs_xosi,320); + MObtainWriteLock(&afs_xosi, 320); AFS_GUNLOCK(); code = VNOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred); AFS_GLOCK(); @@ -81,11 +83,11 @@ afs_osi_Stat(afile, astat) return code; } -osi_UFSClose(afile) - register struct osi_file *afile; - { - AFS_STATCNT(osi_Close); - if(afile->vnode) { +int +osi_UFSClose(register struct osi_file *afile) +{ + AFS_STATCNT(osi_Close); + if (afile->vnode) { /* AIX writes entire data regions at a time when dumping core. We've * seen a 26M write go through the system. When this happens, we run * out of available pages. So, we'll flush the vnode's vm if we're short @@ -101,20 +103,20 @@ osi_UFSClose(afile) } } AFS_RELE(afile->vnode); - } - - osi_FreeSmallSpace(afile); - return 0; - } + } + + osi_FreeSmallSpace(afile); + return 0; +} -osi_UFSTruncate(afile, asize) - register struct osi_file *afile; - afs_int32 asize; { +int +osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize) +{ struct AFS_UCRED *oldCred; struct vattr tvattr; register afs_int32 code; struct osi_stat tstat; - afs_int32 mode=FWRITE|FSYNC; + afs_int32 mode = FWRITE | FSYNC; AFS_STATCNT(osi_Truncate); /* This routine only shrinks files, and most systems @@ -122,69 +124,76 @@ osi_UFSTruncate(afile, asize) * small enough. Check now and save some time. */ code = afs_osi_Stat(afile, &tstat); - if (code || tstat.size <= asize) return code; - MObtainWriteLock(&afs_xosi,321); + if (code || tstat.size <= asize) + return code; + MObtainWriteLock(&afs_xosi, 321); /* * If we're truncating an unopened file to a non-zero length, * we need to bind it to a vm segment * Note that that the binding will actually happen inside * jfs by xix_ftrunc; setting mode to 0 will enable that. */ - if (asize && !VTOGP(afile->vnode)->gn_seg) + if (asize && !VTOGP(afile->vnode)->gn_seg) mode = 0; AFS_GUNLOCK(); - code = VNOP_FTRUNC(afile->vnode, mode, asize, (caddr_t)0, &afs_osi_cred); + code = VNOP_FTRUNC(afile->vnode, mode, asize, (caddr_t) 0, &afs_osi_cred); AFS_GLOCK(); MReleaseWriteLock(&afs_xosi); return code; } -void osi_DisableAtimes(avp) -struct vnode *avp; +void +osi_DisableAtimes(struct vnode *avp) { - struct inode *ip = VTOIP(avp); - ip->i_flag &= ~IACC; + struct inode *ip = VTOIP(avp); + ip->i_flag &= ~IACC; } /* Generic read interface */ -afs_osi_Read(afile, offset, aptr, asize) - register struct osi_file *afile; - int offset; - char *aptr; - afs_int32 asize; { +int +afs_osi_Read(register struct osi_file *afile, int offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; unsigned int resid; register afs_int32 code; - register afs_int32 cnt1=0; + register afs_int32 cnt1 = 0; AFS_STATCNT(osi_Read); - + /** * If the osi_file passed in is NULL, panic only if AFS is not shutting * down. No point in crashing when we are already shutting down */ - if ( !afile ) { - if ( !afs_shuttingdown ) + if (!afile) { + if (!afs_shuttingdown) osi_Panic("osi_Read called with null param"); else return EIO; } - if (offset != -1) afile->offset = offset; -retry_IO: + if (offset != -1) + afile->offset = offset; + retry_IO: /* Note the difference in the way the afile->offset is passed (see comments in gop_rdwr() in afs_aix_subr.c for comments) */ AFS_GUNLOCK(); - code = gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, - (off_t)&afile->offset, AFS_UIOSYS, NULL, &resid); +#ifdef AFS_64BIT_KERNEL + code = + gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, + &afile->offset, AFS_UIOSYS, NULL, &resid); +#else + code = + gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, + (off_t) & afile->offset, AFS_UIOSYS, NULL, &resid); +#endif AFS_GLOCK(); if (code == 0) { code = asize - resid; afile->offset += code; osi_DisableAtimes(afile->vnode); - } - else { + } else { afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid, - ICL_TYPE_INT32, code); + ICL_TYPE_INT32, code); /* * To handle periodic low-level EFAULT failures that we've seen with the * Weitek chip; in all observed failed cases a second read succeeded. @@ -193,41 +202,54 @@ retry_IO: afs_stats_cmperf.osiread_efaults++; goto retry_IO; } - setuerror(code); + setuerror(code); code = -1; } return code; } /* Generic write interface */ -afs_osi_Write(afile, offset, aptr, asize) - register struct osi_file *afile; - char *aptr; - afs_int32 offset; - afs_int32 asize; { +int +afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; unsigned int resid; register afs_int32 code; AFS_STATCNT(osi_Write); - if ( !afile ) - osi_Panic("afs_osi_Write called with null param"); - if (offset != -1) afile->offset = offset; + if (!afile) + osi_Panic("afs_osi_Write called with null param"); + if (offset != -1) + afile->offset = offset; /* Note the difference in the way the afile->offset is passed (see comments in gop_rdwr() in afs_aix_subr.c for comments) */ AFS_GUNLOCK(); - code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, - (off_t)&afile->offset, AFS_UIOSYS, NULL, &resid); +#ifdef AFS_64BIT_KERNEL + code = + gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, + &afile->offset, AFS_UIOSYS, NULL, &resid); +#else + code = + gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, + (off_t) & afile->offset, AFS_UIOSYS, NULL, &resid); +#endif AFS_GLOCK(); if (code == 0) { + if (resid) + afs_Trace3(afs_iclSetp, CM_TRACE_WRITEFAILED, ICL_TYPE_INT32, + asize, ICL_TYPE_INT32, resid, ICL_TYPE_INT32, code); code = asize - resid; afile->offset += code; - } - else { - if (code == ENOSPC) afs_warnuser("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n"); + } else { + afs_Trace3(afs_iclSetp, CM_TRACE_WRITEFAILED, ICL_TYPE_INT32, asize, + ICL_TYPE_INT32, resid, ICL_TYPE_INT32, code); + if (code == ENOSPC) + afs_warnuser + ("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n"); setuerror(code); code = -1; } if (afile->proc) { - (*afile->proc)(afile, code); + (*afile->proc) (afile, code); } return code; } @@ -236,9 +258,8 @@ afs_osi_Write(afile, offset, aptr, asize) /* This work should be handled by physstrat in ca/machdep.c. This routine written from the RT NFS port strategy routine. It has been generalized a bit, but should still be pretty clear. */ -int afs_osi_MapStrategy(aproc, bp) - int (*aproc)(); - register struct buf *bp; +int +afs_osi_MapStrategy(int (*aproc) (), register struct buf *bp) { afs_int32 returnCode; @@ -251,13 +272,12 @@ int afs_osi_MapStrategy(aproc, bp) void -shutdown_osifile() +shutdown_osifile(void) { - extern int afs_cold_shutdown; + extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); - if (afs_cold_shutdown) { - afs_osicred_initialized = 0; - } + AFS_STATCNT(shutdown_osifile); + if (afs_cold_shutdown) { + afs_osicred_initialized = 0; + } } - diff --git a/src/afs/AIX/osi_groups.c b/src/afs/AIX/osi_groups.c index 9ac2b6f9e..e2d9a3db1 100644 --- a/src/afs/AIX/osi_groups.c +++ b/src/afs/AIX/osi_groups.c @@ -14,32 +14,28 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_groups.c,v 1.1.1.4 2001/07/14 22:19:32 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/AIX/osi_groups.c,v 1.8 2003/07/15 23:14:17 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/afs_stats.h" /* statistics */ static int -afs_getgroups( - struct ucred *cred, - int ngroups, - gid_t *gidset); + afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset); static int -afs_setgroups( - struct ucred **cred, - int ngroups, - gid_t *gidset, - int change_parent); + afs_setgroups(struct ucred **cred, int ngroups, gid_t * gidset, + int change_parent); +#ifndef AFS_AIX51_ENV int setgroups(ngroups, gidset) - int ngroups; - gid_t *gidset; + int ngroups; + gid_t *gidset; { int code = 0; struct vrequest treq; @@ -53,7 +49,8 @@ setgroups(ngroups, gidset) code = afs_InitReq(&treq, credp); AFS_GUNLOCK(); crfree(credp); - if (code) return code; + if (code) + return code; code = osetgroups(ngroups, gidset); @@ -77,45 +74,57 @@ setgroups(ngroups, gidset) } return code; } - +#endif int setpag(cred, pagvalue, newpag, change_parent) - struct ucred **cred; - afs_uint32 pagvalue; - afs_uint32 *newpag; - afs_uint32 change_parent; + struct ucred **cred; + afs_uint32 pagvalue; + afs_uint32 *newpag; + afs_uint32 change_parent; { gid_t gidset[NGROUPS]; int ngroups, code; int j; AFS_STATCNT(setpag); +#ifndef AFS_AIX51_ENV ngroups = afs_getgroups(*cred, NGROUPS, gidset); if (afs_get_pag_from_groups(gidset[0], gidset[1]) == NOPAG) { /* We will have to shift grouplist to make room for pag */ if (ngroups + 2 > NGROUPS) { return (setuerror(E2BIG), E2BIG); } - for (j = ngroups -1; j >= 0; j--) { - gidset[j+2] = gidset[j]; - } + for (j = ngroups - 1; j >= 0; j--) { + gidset[j + 2] = gidset[j]; + } ngroups += 2; } - *newpag = (pagvalue == -1 ? genpag(): pagvalue); +#endif + *newpag = (pagvalue == -1 ? genpag() : pagvalue); +#ifdef AFS_AIX51_ENV + if (change_parent) { + code = kcred_setpag(*cred, PAG_AFS, *newpag); + } else { + struct ucred *newcr = crdup(*cred); + + crset(newcr); + code = kcred_setpag(newcr, PAG_AFS, *newpag); + *cred = newcr; + } +#else afs_get_groups_from_pag(*newpag, &gidset[0], &gidset[1]); if (code = afs_setgroups(cred, ngroups, gidset, change_parent)) { return (setuerror(code), code); } +#endif return code; } +#ifndef AFS_AIX51_ENV static int -afs_getgroups( - struct ucred *cred, - int ngroups, - gid_t *gidset) +afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) { int ngrps, savengrps; gid_t *gp; @@ -134,9 +143,9 @@ afs_getgroups( static void copy_to_cred(newcr, ngroups, gidset) - struct ucred *newcr; - int ngroups; - gid_t *gidset; + struct ucred *newcr; + int ngroups; + gid_t *gidset; { gid_t *gp; int newngroups; @@ -162,11 +171,8 @@ copy_to_cred(newcr, ngroups, gidset) */ static int -afs_setgroups( - struct ucred **cred, - int ngroups, - gid_t *gidset, - int change_parent) +afs_setgroups(struct ucred **cred, int ngroups, gid_t * gidset, + int change_parent) { AFS_STATCNT(afs_setgroups); @@ -198,3 +204,4 @@ afs_setgroups( } return 0; } +#endif diff --git a/src/afs/AIX/osi_inode.c b/src/afs/AIX/osi_inode.c index e1d89754a..cf5c75e6d 100644 --- a/src/afs/AIX/osi_inode.c +++ b/src/afs/AIX/osi_inode.c @@ -14,21 +14,22 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_inode.c,v 1.1.1.4 2001/07/14 22:19:33 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/AIX/osi_inode.c,v 1.8 2003/07/15 23:14:17 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/osi_inode.h" -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/osi_inode.h" +#include "afs/afs_stats.h" /* statistics stuff */ #include "sys/syspest.h" #if !defined(offsetof) -#include /* for definition of offsetof() */ +#include /* for definition of offsetof() */ #endif -extern Simple_lock jfs_icache_lock; +extern Simple_lock jfs_icache_lock; #define ICACHE_LOCK() simple_lock(&jfs_icache_lock) #define ICACHE_UNLOCK() simple_unlock(&jfs_icache_lock) @@ -57,11 +58,11 @@ extern Simple_lock jfs_icache_lock; * is at an expected offset. */ -#if IACTIVITY == 0x0020 /* in on AIX 4.2.0 */ +#if IACTIVITY == 0x0020 /* in on AIX 4.2.0 */ #define afs_inode_lock i_rdwrlock #endif -#if IACTIVITY == 0x0010 /* in on AIX 4.2.1 and later */ +#if IACTIVITY == 0x0010 /* in on AIX 4.2.1 and later */ #define afs_inode_lock i_nodelock #endif @@ -115,7 +116,8 @@ struct devtovfs_args { * (Returning nonzero causes vfs_search() to terminate the search.) */ -static int devtovfs_func(struct vfs *vfsp, struct devtovfs_args *rock) +static int +devtovfs_func(struct vfs *vfsp, struct devtovfs_args *rock) { if (vfsp->vfs_mntd != NULL && vfsp->vfs_type == MNT_JFS && (vfsp->vfs_flag & VFS_DEVMOUNT)) { @@ -141,7 +143,7 @@ devtovfs(dev_t dev) AFS_STATCNT(devtovfs); a.dev = dev; - a.ans = (struct vfs *)0; + a.ans = NULL; vfs_search(devtovfs_func, &a); return a.ans; } @@ -156,84 +158,93 @@ int IGI_mode; /* get an existing inode. Common code for iopen, iread/write, iinc/dec. */ /* Also used by rmt_remote to support passing of inode number from venus */ extern int iget(); +extern struct vnode *filevp; struct inode * -igetinode(dev, vfsp, inode, vpp,perror) - struct vfs *vfsp; - struct vnode **vpp; /* vnode associated with the inode */ - dev_t dev; - ino_t inode; - int *perror; +igetinode(dev, vfsp, inode, vpp, perror) + struct vfs *vfsp; + struct vnode **vpp; /* vnode associated with the inode */ + dev_t dev; + ino_t inode; + int *perror; { - struct inode *ip; - register was_locked; - struct vfs *nvfsp = NULL; - int code; - *perror = 0; - *vpp = NULL; - AFS_STATCNT(igetinode); - - /* - * Double check that the inode lock is at a known offset. - * - * If it isn't, then we need to reexamine our code to make - * sure that it is still okay. - */ - osi_Assert(offsetof(struct inode, afs_inode_lock) == 128); - - if (!vfsp && !(vfsp = devtovfs((dev_t)dev))) { - afs_warn("Dev=%d not mounted!!; quitting\n", dev); - setuerror(ENODEV); - ip = 0; - goto out; - } - if (vfsp->vfs_flag & VFS_DEVMOUNT) - nvfsp = vfsp; + struct inode *ip; + register was_locked; + struct vfs *nvfsp = NULL; + int code; + *perror = 0; + *vpp = NULL; + AFS_STATCNT(igetinode); + + /* + * Double check that the inode lock is at a known offset. + * + * If it isn't, then we need to reexamine our code to make + * sure that it is still okay. + */ +#ifdef __64BIT__ +/* osi_Assert(offsetof(struct inode, afs_inode_lock) == 208); */ +#else + osi_Assert(offsetof(struct inode, afs_inode_lock) == 128); +#endif - /* Check if inode 0. This is the mount inode for the device - * and will panic the aix system if removed: defect 11434. - * No file should ever point to this inode. - */ - if (inode == 0) { - afs_warn("Dev=%d zero inode.\n", dev); - setuerror(ENOENT); - ip = 0; - goto out; - } + if (!vfsp && !(vfsp = devtovfs((dev_t) dev))) { + afs_warn("Dev=%d not mounted!!; quitting\n", dev); + setuerror(ENODEV); + ip = 0; + goto out; + } + if (vfsp->vfs_flag & VFS_DEVMOUNT) + nvfsp = vfsp; + + /* Check if inode 0. This is the mount inode for the device + * and will panic the aix system if removed: defect 11434. + * No file should ever point to this inode. + */ + if (inode == 0) { + afs_warn("Dev=%d zero inode.\n", dev); + setuerror(ENOENT); + ip = 0; + goto out; + } - ICACHE_LOCK(); - if ((code = iget(dev, inode, &ip, 1, nvfsp))) { - IGI_error = code; - IGI_inode = inode; - *perror = BAD_IGET; - ICACHE_UNLOCK(); - setuerror(ENOENT); /* Well... */ - ip = 0; - goto out; - } + ICACHE_LOCK(); +#ifdef __64BIT__ + if ((code = iget(dev, inode, &ip, (afs_size_t) 1, nvfsp))) { +#else + if ((code = iget(dev, inode, &ip, 1, nvfsp))) { +#endif + IGI_error = code; + IGI_inode = inode; + *perror = BAD_IGET; ICACHE_UNLOCK(); - IREAD_LOCK(ip); - if (ip->i_nlink == 0 || (ip->i_mode&IFMT) != IFREG) { - IGI_error = 0; - IGI_inode = inode; - IGI_nlink = ip->i_nlink; - IGI_mode = ip->i_mode; - IREAD_UNLOCK(ip); - ICACHE_LOCK(); - iput(ip, NULL); - ICACHE_UNLOCK(); - setuerror(ENOENT); - ip = 0; - goto out; - } + setuerror(ENOENT); /* Well... */ + ip = 0; + goto out; + } + ICACHE_UNLOCK(); + IREAD_LOCK(ip); + if (ip->i_nlink == 0 || (ip->i_mode & IFMT) != IFREG) { + IGI_error = 0; + IGI_inode = inode; + IGI_nlink = ip->i_nlink; + IGI_mode = ip->i_mode; IREAD_UNLOCK(ip); - if (vpp) { - if (nvfsp) - *vpp = ip->i_gnode.gn_vnode; - else - setuerror(iptovp(vfsp, ip, vpp)); - } -out: - return ip; + ICACHE_LOCK(); + iput(ip, NULL); + ICACHE_UNLOCK(); + setuerror(ENOENT); + ip = 0; + goto out; + } + IREAD_UNLOCK(ip); + if (vpp) { + if (nvfsp) + *vpp = ip->i_gnode.gn_vnode; + else + setuerror(iptovp(vfsp, ip, vpp)); + } + out: + return ip; } @@ -243,113 +254,117 @@ out: * marked as journalled. We would also like to journal inodes corresponding * to directory information... */ -#define INODESPECIAL 0xffffffff /* ... from ../vol/viceonode.h */ +#define INODESPECIAL 0xffffffff /* ... from ../vol/viceonode.h */ #endif -SYSENT(icreate, (dev, near_inode, param1, param2, param3, param4), ) { - struct inode *ip, *newip, *pip; - register int err, rval1, rc=0; - struct vnode *vp = (struct vnode *)0; - extern struct vfs *rootvfs; - register struct vfs *vfsp; - struct vfs *nvfsp = NULL; - char error; - ino_t ino = near_inode; - - AFS_STATCNT(afs_syscall_icreate); - if (!suser(&error)) { - setuerror(error); - return -1; - } +SYSENT(icreate, (dev, near_inode, param1, param2, param3, param4),) +{ + struct inode *ip, *newip, *pip; + register int err, rval1, rc = 0; + struct vnode *vp = NULL; + extern struct vfs *rootvfs; + register struct vfs *vfsp; + struct vfs *nvfsp = NULL; + char error; + ino_t ino = near_inode; + + AFS_STATCNT(afs_syscall_icreate); + if (!suser(&error)) { + setuerror(error); + return -1; + } - if ((vfsp = devtovfs((dev_t)dev)) == 0) { - afs_warn("Dev=%d not mounted!!; quitting\n", dev); - setuerror(ENODEV); - return -1; - } - if (vfsp->vfs_flag & VFS_DEVMOUNT) - nvfsp = vfsp; - ICACHE_LOCK(); - rc = iget(dev, 0, &pip, 1, nvfsp); - if (!rc) { - /* - * this is the mount inode, and thus we should be - * safe putting it back. - */ - iput(pip, nvfsp); - } - ICACHE_UNLOCK(); + if ((vfsp = devtovfs((dev_t) dev)) == 0) { + afs_warn("Dev=%d not mounted!!; quitting\n", dev); + setuerror(ENODEV); + return -1; + } + if (vfsp->vfs_flag & VFS_DEVMOUNT) + nvfsp = vfsp; + ICACHE_LOCK(); + rc = iget(dev, 0, &pip, 1, nvfsp); + if (!rc) { + /* + * this is the mount inode, and thus we should be + * safe putting it back. + */ + iput(pip, nvfsp); + } + ICACHE_UNLOCK(); - if (rc) { - setuerror(EINVAL); - return -1; - } + if (rc) { + setuerror(EINVAL); + return -1; + } - if (setuerror(dev_ialloc(pip, ino, IFREG, nvfsp, &newip))) - return -1; - newip->i_flag |= IACC|IUPD|ICHG; - newip->i_gid = -2; /* Put special gid flag */ - newip->i_vicemagic = VICEMAGIC; - newip->i_vicep1 = param1; - newip->i_vicep2 = param2; - newip->i_vicep3 = param3; - newip->i_vicep4 = param4; - IWRITE_UNLOCK(newip); - if (nvfsp) { - vp = newip->i_gnode.gn_vnode; - } else { - rc = iptovp(vfsp, newip, &vp); - } - setuerror(rc); - - rval1 = newip->i_number; - if (vp) { - VNOP_RELE(vp); - } - return getuerror() ? -1 : rval1; + if (setuerror(dev_ialloc(pip, ino, IFREG, nvfsp, &newip))) + return -1; + newip->i_flag |= IACC | IUPD | ICHG; + newip->i_gid = -2; /* Put special gid flag */ + newip->i_vicemagic = VICEMAGIC; + newip->i_vicep1 = param1; + newip->i_vicep2 = param2; + newip->i_vicep3 = param3; + newip->i_vicep4 = param4; + IWRITE_UNLOCK(newip); + if (nvfsp) { + vp = newip->i_gnode.gn_vnode; + } else { + rc = iptovp(vfsp, newip, &vp); + } + setuerror(rc); + + rval1 = newip->i_number; + if (vp) { + VNOP_RELE(vp); + } + return getuerror()? -1 : rval1; } -SYSENT(iopen, (dev, inode, usrmod), ) { - struct file *fp; - register struct inode *ip; - struct vnode *vp = (struct vnode *)0; - extern struct fileops vnodefops; - register struct vfs *vfsp; - int fd; - char error; - struct ucred *credp; - int dummy; - - AFS_STATCNT(afs_syscall_iopen); - if (!suser(&error)) { - setuerror(error); - return -1; - } +SYSENT(iopen, (dev, inode, usrmod),) +{ + struct file *fp; + register struct inode *ip; + struct vnode *vp = NULL; + extern struct fileops vnodefops; + register struct vfs *vfsp; + int fd; + char error; + struct ucred *credp; + int dummy; + + AFS_STATCNT(afs_syscall_iopen); + if (!suser(&error)) { + setuerror(error); + return -1; + } - if ((vfsp = devtovfs((dev_t)dev)) == 0) { - afs_warn("Dev=%d not mounted!!; quitting\n", dev); - setuerror(ENODEV); - return -1; - } - ip = igetinode((dev_t)dev, vfsp, (ino_t)inode, &vp,&dummy); - if (getuerror()) - return -1; - - credp = crref(); - if (setuerror(ufdcreate((usrmod-FOPEN)&FMASK, &vnodefops, vp - , DTYPE_VNODE, &fd, credp))) { - crfree(credp); - VNOP_RELE(vp); - return -1; - } - - if (setuerror(VNOP_OPEN(vp, (usrmod-FOPEN)&FMASK, 0, 0, credp))) { - close(fd); - crfree(credp); - return -1; - } + if ((vfsp = devtovfs((dev_t) dev)) == 0) { + afs_warn("Dev=%d not mounted!!; quitting\n", dev); + setuerror(ENODEV); + return -1; + } + ip = igetinode((dev_t) dev, vfsp, (ino_t) inode, &vp, &dummy); + if (getuerror()) + return -1; + + credp = crref(); + if (setuerror + (ufdcreate + ((usrmod - FOPEN) & FMASK, &vnodefops, vp, DTYPE_VNODE, &fd, + credp))) { crfree(credp); - return fd; + VNOP_RELE(vp); + return -1; + } + + if (setuerror(VNOP_OPEN(vp, (usrmod - FOPEN) & FMASK, 0, 0, credp))) { + close(fd); + crfree(credp); + return -1; + } + crfree(credp); + return fd; } @@ -359,55 +374,58 @@ SYSENT(iopen, (dev, inode, usrmod), ) { * Restricted to super user. * Only VICEMAGIC type inodes. */ -iinc(dev, inode, inode_p1) { +iinc(dev, inode, inode_p1) +{ AFS_STATCNT(iinc); return iincdec(dev, inode, inode_p1, 1); } -idec(dev, inode, inode_p1) { +idec(dev, inode, inode_p1) +{ AFS_STATCNT(idec); return iincdec(dev, inode, inode_p1, -1); } -SYSENT(iincdec, (dev, inode, inode_p1, amount), ) { - register struct inode *ip; - char error; - struct vnode *vp = (struct vnode *)0; - int dummy; - - AFS_STATCNT(afs_syscall_iincdec); - if (!suser(&error)) { - setuerror(error); - return -1; - } +SYSENT(iincdec, (dev, inode, inode_p1, amount),) +{ + register struct inode *ip; + char error; + struct vnode *vp = NULL; + int dummy; + + AFS_STATCNT(afs_syscall_iincdec); + if (!suser(&error)) { + setuerror(error); + return -1; + } - ip = igetinode((dev_t)dev, 0, (ino_t)inode, &vp, &dummy); - if (getuerror()) { - return -1; - } - IWRITE_LOCK(ip); - if (ip->i_vicemagic != VICEMAGIC) - setuerror(EPERM); - else if (ip->i_vicep1 != inode_p1) - setuerror(ENXIO); - else { - ip->i_nlink += amount; - if (ip->i_nlink == 0) { - ip->i_vicemagic = 0; - ip->i_cflag &= ~CMNEW; - } - ip->i_flag |= ICHG; - commit(1, ip); /* always commit */ + ip = igetinode((dev_t) dev, 0, (ino_t) inode, &vp, &dummy); + if (getuerror()) { + return -1; + } + IWRITE_LOCK(ip); + if (ip->i_vicemagic != VICEMAGIC) + setuerror(EPERM); + else if (ip->i_vicep1 != inode_p1) + setuerror(ENXIO); + else { + ip->i_nlink += amount; + if (ip->i_nlink == 0) { + ip->i_vicemagic = 0; + ip->i_cflag &= ~CMNEW; } - IWRITE_UNLOCK(ip); - VNOP_RELE(vp); + ip->i_flag |= ICHG; + commit(1, ip); /* always commit */ + } + IWRITE_UNLOCK(ip); + VNOP_RELE(vp); /* ICACHE_LOCK(); iput(ip, 0); ICACHE_UNLOCK(); */ - return getuerror() ? -1 : 0; + return getuerror()? -1 : 0; } diff --git a/src/afs/AIX/osi_machdep.h b/src/afs/AIX/osi_machdep.h index 110ef7c4c..f52c4c11b 100644 --- a/src/afs/AIX/osi_machdep.h +++ b/src/afs/AIX/osi_machdep.h @@ -70,7 +70,7 @@ extern simple_lock_data afs_global_lock; } while(0) #define ISAFS_GLOCK() lock_mine((void *)&afs_global_lock) -#define AFS_RXGLOCK() +#define AFS_RXGLOCK() #define AFS_RXGUNLOCK() #define ISAFS_RXGLOCK() 1 #endif diff --git a/src/afs/AIX/osi_misc.c b/src/afs/AIX/osi_misc.c index 80ff5cc91..b89229c3e 100644 --- a/src/afs/AIX/osi_misc.c +++ b/src/afs/AIX/osi_misc.c @@ -17,47 +17,48 @@ */ #include -#include "../afs/param.h" - -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_misc.c,v 1.1.1.4 2001/07/14 22:19:33 hartmans Exp $"); - -#include "../h/systm.h" -#include "../h/types.h" -#include "../h/errno.h" -#include "../h/stat.h" -#include "../h/user.h" -#include "../h/uio.h" -#include "../h/vattr.h" -#include "../h/file.h" -#include "../h/vfs.h" -#include "../h/chownx.h" -#include "../h/systm.h" -#include "../h/access.h" -#include "../rpc/types.h" -#include "../afs/osi_vfs.h" -#include "../netinet/in.h" -#include "../h/mbuf.h" -#include "../rpc/types.h" -#include "../rpc/xdr.h" -#include "../h/vmuser.h" -#include "../h/syspest.h" - -#include "../afs/stds.h" -#include "../afs/afs_osi.h" +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/AIX/osi_misc.c,v 1.7 2003/07/15 23:14:17 shadow Exp $"); + +#include "h/systm.h" +#include "h/types.h" +#include "h/errno.h" +#include "h/stat.h" +#include "h/user.h" +#include "h/uio.h" +#include "h/vattr.h" +#include "h/file.h" +#include "h/vfs.h" +#include "h/chownx.h" +#include "h/systm.h" +#include "h/access.h" +#include "rpc/types.h" +#include "osi_vfs.h" +#include "netinet/in.h" +#include "h/mbuf.h" +#include "rpc/types.h" +#include "rpc/xdr.h" +#include "h/vmuser.h" +#include "h/syspest.h" + +#include "afs/stds.h" +#include "afs/afs_osi.h" #define RFTP_INTERNALS 1 -#include "../afs/volerrors.h" -#include "../afsint/afsint.h" -#include "../afsint/vldbint.h" -#include "../afs/lock.h" -#include "../afs/exporter.h" -#include "../afs/afs.h" -#include "../afs/afs_stats.h" +#include "afs/volerrors.h" +#include "afsint.h" +#include "vldbint.h" +#include "afs/lock.h" +#include "afs/exporter.h" +#include "afs/afs.h" +#include "afs/afs_stats.h" /* In Aix one may specify an init routine routine which is called once during * initialization of all gfs; one day we might need to actual do somehing here. */ Afs_init(gfsp) -char *gfsp; /* this is really struct gfs *, but we do not use it */ + char *gfsp; /* this is really struct gfs *, but we do not use it */ { extern int afs_gn_strategy(); #define AFS_VM_BUFS 50 @@ -65,7 +66,7 @@ char *gfsp; /* this is really struct gfs *, but we do not use it */ /* For now nothing special is required during AFS initialization. */ AFS_STATCNT(afs_init); - (void) vm_mount(D_REMOTE, afs_gn_strategy, AFS_VM_BUFS); + (void)vm_mount(D_REMOTE, afs_gn_strategy, AFS_VM_BUFS); return 0; } @@ -82,15 +83,19 @@ char *gfsp; /* this is really struct gfs *, but we do not use it */ */ int gop_rdwr(rw, vp, base, len, offset, segflg, unit, aresid) -enum uio_rw rw; -struct vnode *vp; -caddr_t base; -off_t *offset; -int len, segflg; -int *aresid; -int unit; /* Ignored */ + enum uio_rw rw; + struct vnode *vp; + caddr_t base; +#ifdef AFS_64BIT_KERNEL + offset_t *offset; +#else + off_t *offset; +#endif + int len, segflg; + int *aresid; + int unit; /* Ignored */ { - struct uio uio_struct; + struct uio uio_struct; struct iovec uiovector; register int code; @@ -106,8 +111,16 @@ int unit; /* Ignored */ uio_struct.uio_resid = len; uio_struct.uio_fmode = (rw == UIO_READ ? FREAD : FWRITE); - code = VNOP_RDWR(vp, rw, (rw == UIO_READ ? FREAD : FWRITE), &uio_struct, - NULL, NULL, NULL, &afs_osi_cred); +#ifdef AFS_64BIT_KERNEL + code = + VNOP_RDWR(vp, rw, (int32long64_t) (rw == UIO_READ ? FREAD : FWRITE), + &uio_struct, (ext_t) 0, (caddr_t) 0, (struct vattr *)0, + &afs_osi_cred); +#else + code = + VNOP_RDWR(vp, rw, (rw == UIO_READ ? FREAD : FWRITE), &uio_struct, + NULL, NULL, NULL, &afs_osi_cred); +#endif *aresid = uio_struct.uio_resid; return code; } @@ -124,7 +137,7 @@ int unit; /* Ignored */ * no linked list of gnodes to remove this element from. */ aix_gnode_rele(vp) -struct vnode *vp; + struct vnode *vp; { register struct vnode *tvp; register struct vfs *vfsp = vp->v_vfsp; @@ -138,12 +151,12 @@ struct vnode *vp; if (vp->v_vfsprev != NULL) vp->v_vfsprev->v_vfsnext = vp->v_vfsnext; - endgnode: - /* Free the allocated gnode that was accompanying the vcache's vnode */ - if (vp->v_gnode) { - osi_FreeSmallSpace(vp->v_gnode); - vp->v_gnode = 0; - } + endgnode: + /* Free the allocated gnode that was accompanying the vcache's vnode */ + if (vp->v_gnode) { + osi_FreeSmallSpace(vp->v_gnode); + vp->v_gnode = 0; + } return 0; } @@ -154,11 +167,11 @@ struct vnode *vp; * Note that it must NOT set errno. */ -afs_suser() { +afs_suser() +{ register rc; char err; - + rc = suser(&err); return rc; } - diff --git a/src/afs/AIX/osi_prototypes.h b/src/afs/AIX/osi_prototypes.h index c869dc085..25f551258 100644 --- a/src/afs/AIX/osi_prototypes.h +++ b/src/afs/AIX/osi_prototypes.h @@ -10,6 +10,9 @@ #ifndef _OSI_PROTOTYPES_H_ #define _OSI_PROTOTYPES_H_ +/* osi_file.c */ +extern afs_rwlock_t afs_xosi; + /* osi_groups.c */ extern void afs_aix_SetupPagRefCount(void); diff --git a/src/afs/AIX/osi_sleep.c b/src/afs/AIX/osi_sleep.c index 06a058224..b5cd4dfde 100644 --- a/src/afs/AIX/osi_sleep.c +++ b/src/afs/AIX/osi_sleep.c @@ -8,44 +8,47 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_sleep.c,v 1.1.1.4 2001/07/14 22:19:33 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/AIX/osi_sleep.c,v 1.10 2003/07/15 23:14:17 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok); -void afs_osi_Wakeup(char *event); -void afs_osi_Sleep(char *event); static char waitV; -static void AfsWaitHack(struct trb *trb) +static void +AfsWaitHack(struct trb *trb) { AFS_STATCNT(WaitHack); e_clear_wait(trb->func_data, THREAD_TIMED_OUT); } -void afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) +void +afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) { AFS_STATCNT(osi_InitWaitHandle); achandle->proc = (caddr_t) 0; } /* cancel osi_Wait */ -void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) +void +afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) { caddr_t proc; AFS_STATCNT(osi_CancelWait); proc = achandle->proc; - if (proc == 0) return; - achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ + if (proc == 0) + return; + achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ afs_osi_Wakeup(&waitV); } @@ -53,13 +56,14 @@ void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) * Waits for data on ahandle, or ams ms later. ahandle may be null. * Returns 0 if timeout and EINTR if signalled. */ -int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) +int +afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) { int code; afs_int32 endTime, tid; AFS_STATCNT(osi_Wait); - endTime = osi_Time() + (ams/1000); + endTime = osi_Time() + (ams / 1000); if (ahandle) ahandle->proc = (caddr_t) thread_self(); do { @@ -67,7 +71,8 @@ int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) code = 0; code = osi_TimedSleep(&waitV, ams, aintok); - if (code) break; /* if something happened, quit now */ + if (code) + break; /* if something happened, quit now */ /* if we we're cancelled, quit now */ if (ahandle && (ahandle->proc == (caddr_t) 0)) { /* we've been signalled */ @@ -85,19 +90,20 @@ typedef struct afs_event { char *event; /* lwp event: an address */ int refcount; /* Is it in use? */ int seq; /* Sequence number: this is incremented - by wakeup calls; wait will not return until - it changes */ - int cond; + * by wakeup calls; wait will not return until + * it changes */ + tid_t cond; } afs_event_t; #define HASHSIZE 128 -afs_event_t *afs_evhasht[HASHSIZE];/* Hash table for events */ +afs_event_t *afs_evhasht[HASHSIZE]; /* Hash table for events */ #define afs_evhash(event) (afs_uint32) ((((long)event)>>2) & (HASHSIZE-1)); int afs_evhashcnt = 0; /* Get and initialize event structure corresponding to lwp event (i.e. address) * */ -static afs_event_t *afs_getevent(char *event) +static afs_event_t * +afs_getevent(char *event) { afs_event_t *evp, *newp = 0; int hashcode; @@ -115,7 +121,7 @@ static afs_event_t *afs_getevent(char *event) evp = evp->next; } if (!newp) { - newp = (afs_event_t *) osi_AllocSmallSpace(sizeof (afs_event_t)); + newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t)); afs_evhashcnt++; newp->next = afs_evhasht[hashcode]; afs_evhasht[hashcode] = newp; @@ -131,7 +137,8 @@ static afs_event_t *afs_getevent(char *event) #define relevent(evp) ((evp)->refcount--) -void afs_osi_Sleep(char *event) +void +afs_osi_Sleep(void *event) { struct afs_event *evp; int seq; @@ -148,6 +155,13 @@ void afs_osi_Sleep(char *event) relevent(evp); } +int +afs_osi_SleepSig(void *event) +{ + afs_osi_Sleep(event); + return 0; +} + /* osi_TimedSleep * * Arguments: @@ -157,7 +171,8 @@ void afs_osi_Sleep(char *event) * * Returns 0 if timeout and EINTR if signalled. */ -static int osi_TimedSleep(char *event, afs_int32 ams, int aintok) +static int +osi_TimedSleep(char *event, afs_int32 ams, int aintok) { int code = 0; struct afs_event *evp; @@ -166,7 +181,7 @@ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok) int rc; ticks.tv_sec = ams / 1000; - ticks.tv_nsec = (ams - (ticks.tv_sec * 1000) ) * 1000000; + ticks.tv_nsec = (ams - (ticks.tv_sec * 1000)) * 1000000; evp = afs_getevent(event); @@ -175,7 +190,7 @@ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok) if (trb == NULL) osi_Panic("talloc returned NULL"); trb->flags = 0; - trb->func = AfsWaitHack; + trb->func = AfsWaitHack; trb->eventlist = EVENT_NULL; trb->ipri = INTTIMER; trb->func_data = thread_self(); @@ -185,25 +200,29 @@ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok) AFS_GUNLOCK(); tstart(trb); rc = e_block_thread(); - while(tstop(trb)); + while (tstop(trb)); if (rc == THREAD_INTERRUPTED) code = EINTR; tfree(trb); AFS_GLOCK(); - + relevent(evp); return code; } -void afs_osi_Wakeup(char *event) +int +afs_osi_Wakeup(void *event) { + int ret = 1; struct afs_event *evp; evp = afs_getevent(event); if (evp->refcount > 1) { - evp->seq++; + evp->seq++; e_wakeup(&evp->cond); + ret = 0; } relevent(evp); + return ret; } diff --git a/src/afs/AIX/osi_timeout.c b/src/afs/AIX/osi_timeout.c index cbdab5616..5f957ff0e 100644 --- a/src/afs/AIX/osi_timeout.c +++ b/src/afs/AIX/osi_timeout.c @@ -13,21 +13,22 @@ * Implements: */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_timeout.c,v 1.1.1.5 2001/09/11 14:24:52 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/AIX/osi_timeout.c,v 1.7 2003/07/15 23:14:17 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ #include "sys/limits.h" #include "sys/types.h" #include "sys/user.h" #include "sys/pri.h" -#include "sys/priv.h" /* XXX */ +#include "sys/priv.h" /* XXX */ #include "sys/lockl.h" #include "sys/malloc.h" -#include /* For the timer related defines */ -#include /* for the serialization defines */ +#include /* For the timer related defines */ +#include /* for the serialization defines */ /* NOTE: This lock makes the callout table MP-safe. timeout itself could * be subject to deadlocks if used for anything more complex than we are @@ -39,320 +40,306 @@ Simple_lock afs_callout_lock; #define AFS_UNLOCK_ENABLE(_pri, _lock) unlock_enable((_pri), (_lock)) -struct tos { - struct tos *toprev; /* previous tos in callout table*/ - struct tos *tonext; /* next tos in callout table */ - struct trb *trb; /* this timer request block */ - afs_int32 type; - long p1; +struct tos { + struct tos *toprev; /* previous tos in callout table */ + struct tos *tonext; /* next tos in callout table */ + struct trb *trb; /* this timer request block */ + afs_int32 type; + long p1; }; -struct callo { - int ncallo; /* number of callout table elements */ - struct tos *head; /* callout table head element */ +struct callo { + int ncallo; /* number of callout table elements */ + struct tos *head; /* callout table head element */ }; -struct callo afs_callo = {0, NULL};/* callout table anchor */ +struct callo afs_callo = { 0, NULL }; /* callout table anchor */ -static void timeout_end(struct trb *); /* timeout()'s timeout function */ -extern void tstart(struct trb *); -extern void i_enable(int); +static void timeout_end(struct trb *); /* timeout()'s timeout function */ +extern void tstart(struct trb *); +extern void i_enable(int); -void timeout( - register void (*func)(), /* function to call at timeout*/ - register caddr_t arg, /* It's argument. */ - register int ticks, /* when to set timeout for */ - register int type, - register char *p1) +void +timeout(register void (*func) (), /* function to call at timeout */ + register caddr_t arg, /* It's argument. */ + register int ticks, /* when to set timeout for */ + register int type, register char *p1) { - register int ipri; /* caller's interrupt priority */ - register struct tos *tos; /* tos to use for timeout */ - register struct trb *trb; /* trb in the tos being used */ - struct itimerstruc_t tv; /* timeout interval */ - - tv.it_value.tv_sec = ticks / HZ; - tv.it_value.tv_nsec = (ticks % HZ) * (NS_PER_SEC / HZ); - - osi_Assert(afs_callo.ncallo != 0); - -timeout_retry: - - ipri = AFS_DISABLE_LOCK(INTMAX, &afs_callout_lock); - /* - * Run the callout table chain to see if there is already a pending - * timeout for the specified function. If so, that timeout will - * be cancelled and the tos re-used. - */ - for(tos = afs_callo.head; tos != NULL; tos = tos->tonext) { - if((tos->trb->tof == func) && (tos->trb->func_data == (ulong) arg)) { - break; - } + register int ipri; /* caller's interrupt priority */ + register struct tos *tos; /* tos to use for timeout */ + register struct trb *trb; /* trb in the tos being used */ + struct itimerstruc_t tv; /* timeout interval */ + + tv.it_value.tv_sec = ticks / HZ; + tv.it_value.tv_nsec = (ticks % HZ) * (NS_PER_SEC / HZ); + + osi_Assert(afs_callo.ncallo != 0); + + timeout_retry: + + ipri = AFS_DISABLE_LOCK(INTMAX, &afs_callout_lock); + /* + * Run the callout table chain to see if there is already a pending + * timeout for the specified function. If so, that timeout will + * be cancelled and the tos re-used. + */ + for (tos = afs_callo.head; tos != NULL; tos = tos->tonext) { + if ((tos->trb->tof == func) && (tos->trb->func_data == (ulong) arg)) { + break; + } + } + + /* + * If a pending timeout for the specified function was NOT found, + * then the callout table chain will have to be run to find an + * unused tos. + */ + if (tos == NULL) { + for (tos = afs_callo.head; tos != NULL; tos = tos->tonext) { + if (tos->trb->tof == NULL) { + break; + } } /* - * If a pending timeout for the specified function was NOT found, - * then the callout table chain will have to be run to find an - * unused tos. + * If there isn't an available tos, then there is no error + * recovery. This means that either the caller has not + * correctly registered the number of callout table entries + * that would be needed or is incorrectly using the ones that + * were registered. Either way, panic is the only recourse. */ - if(tos == NULL) { - for(tos = afs_callo.head; tos != NULL; tos = tos->tonext) { - if(tos->trb->tof == NULL) { - break; - } - } - - /* - * If there isn't an available tos, then there is no error - * recovery. This means that either the caller has not - * correctly registered the number of callout table entries - * that would be needed or is incorrectly using the ones that - * were registered. Either way, panic is the only recourse. - */ - osi_Assert(tos != NULL); - } - /* - * A pending timeout for the specified function WAS found. - * If the request is still active, stop it. - */ - while (tstop(tos->trb)) { - AFS_UNLOCK_ENABLE(ipri, &afs_callout_lock); - goto timeout_retry; - } - - tos->type = type; /* Temp */ - tos->p1 = (long)p1; /* Temp */ - tos->trb->knext = NULL; - tos->trb->kprev = NULL; - tos->trb->flags = 0; - tos->trb->timeout = tv; - tos->trb->tof = func; - tos->trb->func = timeout_end; - tos->trb->func_data = (ulong) arg; - tos->trb->ipri = INTTIMER; - tos->trb->id = -1; - tstart(tos->trb); - + osi_Assert(tos != NULL); + } + /* + * A pending timeout for the specified function WAS found. + * If the request is still active, stop it. + */ + while (tstop(tos->trb)) { AFS_UNLOCK_ENABLE(ipri, &afs_callout_lock); + goto timeout_retry; + } + + tos->type = type; /* Temp */ + tos->p1 = (long)p1; /* Temp */ + tos->trb->knext = NULL; + tos->trb->kprev = NULL; + tos->trb->flags = 0; + tos->trb->timeout = tv; + tos->trb->tof = func; + tos->trb->func = timeout_end; + tos->trb->func_data = (ulong) arg; + tos->trb->ipri = INTTIMER; + tos->trb->id = -1; + tstart(tos->trb); + + AFS_UNLOCK_ENABLE(ipri, &afs_callout_lock); } -void untimeout( -register void (*func)(), -register ulong arg) +void +untimeout(register void (*func) (), register ulong arg) { - register int ipri; /* caller's interrupt priority */ - register struct tos *tos; /* tos to walk callout table */ - register struct trb *trb; /* trb for this tos */ + register int ipri; /* caller's interrupt priority */ + register struct tos *tos; /* tos to walk callout table */ + register struct trb *trb; /* trb for this tos */ - untimeout_retry: + untimeout_retry: - ipri = AFS_DISABLE_LOCK(INTMAX, &afs_callout_lock); - /* Run the callout table chain looking for the timeout. */ - for(tos = afs_callo.head; tos != NULL; tos = tos->tonext) { - if(tos->trb->tof == func && tos->trb->func_data == arg) { - break; - } + ipri = AFS_DISABLE_LOCK(INTMAX, &afs_callout_lock); + /* Run the callout table chain looking for the timeout. */ + for (tos = afs_callo.head; tos != NULL; tos = tos->tonext) { + if (tos->trb->tof == func && tos->trb->func_data == arg) { + break; } + } - if(tos) { - /* - * Found it on the timeout list - stop the pending timeout - * if it is active. - */ - while(tstop(tos->trb)) { - AFS_UNLOCK_ENABLE(ipri, &afs_callout_lock); - goto untimeout_retry; - } - - /* Mark this callout table entry as free. */ - tos->trb->knext = NULL; - tos->trb->kprev = NULL; - tos->trb->tof = NULL; + if (tos) { + /* + * Found it on the timeout list - stop the pending timeout + * if it is active. + */ + while (tstop(tos->trb)) { + AFS_UNLOCK_ENABLE(ipri, &afs_callout_lock); + goto untimeout_retry; } - AFS_UNLOCK_ENABLE(ipri, &afs_callout_lock); + + /* Mark this callout table entry as free. */ + tos->trb->knext = NULL; + tos->trb->kprev = NULL; + tos->trb->tof = NULL; + } + AFS_UNLOCK_ENABLE(ipri, &afs_callout_lock); } -static void timeout_end( -struct trb *trb) /* trb of the current timeout */ -{ - register void (*func)(); /* function to call at timeout */ - int ipri; - ipri = AFS_DISABLE_LOCK(INTMAX, &afs_callout_lock); +static void +timeout_end(struct trb *trb) +{ /* trb of the current timeout */ + register void (*func) (); /* function to call at timeout */ + int ipri; + ipri = AFS_DISABLE_LOCK(INTMAX, &afs_callout_lock); - func = trb->tof; - trb->func = NULL; - trb->tof = NULL; /* Zero out pointer to user function */ + func = trb->tof; + trb->func = NULL; + trb->tof = NULL; /* Zero out pointer to user function */ - AFS_UNLOCK_ENABLE(ipri, &afs_callout_lock); + AFS_UNLOCK_ENABLE(ipri, &afs_callout_lock); - (* func)(trb->func_data); - /* for compatibility with untimeout() */ + (*func) (trb->func_data); + /* for compatibility with untimeout() */ } -int timeoutcf( - register int cocnt) /* # entries to change callout table by */ -{ - register int ipri; /* caller's interrupt priority */ - register int rv; /* return value to the caller */ - register struct tos *tos; /* tos to add to/remove from table */ - register struct trb *trb; /* trb in the tos to be added/removed */ +int +timeoutcf(register int cocnt) +{ /* # entries to change callout table by */ + register int ipri; /* caller's interrupt priority */ + register int rv; /* return value to the caller */ + register struct tos *tos; /* tos to add to/remove from table */ + register struct trb *trb; /* trb in the tos to be added/removed */ - rv = 0; + rv = 0; - if(cocnt > 0) { - /* - * Callout table is being enlarged - keep working until the - * right number of elements have been added. - */ - while(cocnt > 0) { - /* Allocate a timer request block. */ - trb = (struct trb *) talloc(); - - /* - * If the low-level timer service could not provide - * a trb, the callout table can't be expanded any - * more so get out. - */ - if(trb == NULL) { - rv = -1; - break; - } - - /* Allocate memory for the callout table structure. */ - tos = (struct tos *) - xmalloc((uint)sizeof(struct tos), (uint)0, pinned_heap); - - /* - * If memory couldn't be allocated for the tos, the - * callout table can't be expanded any more so get out. - */ - if(tos == NULL) { - rv = -1; - break; - } - else { - memset(tos, 0, sizeof(struct tos)); - } - - /* The trb and the tos were both allocated. */ - tos->trb = trb; + if (cocnt > 0) { + /* + * Callout table is being enlarged - keep working until the + * right number of elements have been added. + */ + while (cocnt > 0) { + /* Allocate a timer request block. */ + trb = (struct trb *)talloc(); + + /* + * If the low-level timer service could not provide + * a trb, the callout table can't be expanded any + * more so get out. + */ + if (trb == NULL) { + rv = -1; + break; + } + + /* Allocate memory for the callout table structure. */ + tos = (struct tos *) + xmalloc((uint) sizeof(struct tos), (uint) 0, pinned_heap); + + /* + * If memory couldn't be allocated for the tos, the + * callout table can't be expanded any more so get out. + */ + if (tos == NULL) { + rv = -1; + break; + } else { + memset(tos, 0, sizeof(struct tos)); + } + + /* The trb and the tos were both allocated. */ + tos->trb = trb; #ifdef DEBUG - /* - * Debug code to ensure that the low-level timer - * service talloc() clears out the pointers. - */ - osi_Assert(trb->knext == NULL); - osi_Assert(trb->kprev == NULL); + /* + * Debug code to ensure that the low-level timer + * service talloc() clears out the pointers. + */ + osi_Assert(trb->knext == NULL); + osi_Assert(trb->kprev == NULL); #endif /* DEBUG */ - ipri = AFS_DISABLE_LOCK(INTMAX, &afs_callout_lock); - if(afs_callo.head == NULL) { - /* - * The callout table is currently empty. This - * is the easy case, just set the head of the - * callout chain to this tos. - */ - afs_callo.head = tos; - } - else { - /* - * The callout table is not empty. Chain this - * trb to the head of the callout chain. - */ - tos->tonext = afs_callo.head; - afs_callo.head->toprev = tos; - afs_callo.head = tos; - } - - /* Just finished adding a trb to the callout table. */ - afs_callo.ncallo++; - cocnt--; - AFS_UNLOCK_ENABLE(ipri, &afs_callout_lock); - } - } - else { + ipri = AFS_DISABLE_LOCK(INTMAX, &afs_callout_lock); + if (afs_callo.head == NULL) { /* - * Callout table is being shrunk - keep working until the - * right number of elements have been removed being careful - * only to remove elements which do not belong to timeout - * requests that are currently active. + * The callout table is currently empty. This + * is the easy case, just set the head of the + * callout chain to this tos. */ - if(cocnt < 0) { - - /* - * There had better be at least as many tos's in - * the callout table as the size by which the caller - * wants to decrease the size of the table. - */ - osi_Assert(afs_callo.ncallo >= -cocnt); - - while(cocnt < 0) { - - /* - * Start from the head of the callout chain, - * making sure that there is a tos at the - * head (i.e. that there is a callout chain). - */ - ipri = AFS_DISABLE_LOCK(INTMAX, - &afs_callout_lock); - tos = afs_callo.head; - osi_Assert(tos != NULL); - - /* - * Keep walking down the callout chain until - * a tos is found which is not currently - * active. - */ - while((tos != NULL) && - (tos->trb->tof != NULL)) { - tos = tos->tonext; - } - - /* - * If trb is not NULL, then there was not a - * callout table entry that wasn't set to - * timeout. Panic. - */ - osi_Assert(tos != NULL); - - /* - * Found a free callout table element, free - * it and remove it from the callout table. - */ - tfree(tos->trb); - if(afs_callo.head == tos) { - afs_callo.head = tos->tonext; - if(afs_callo.head != NULL) { - afs_callo.head->toprev = NULL; - } - } - else { - osi_Assert(tos->toprev != NULL); - tos->toprev->tonext = tos->tonext; - if(tos->tonext != NULL) { - tos->tonext->toprev = - tos->toprev; - } - } - /* - * Just finished removing a trb from the - * callout table. - */ - afs_callo.ncallo--; - cocnt++; - AFS_UNLOCK_ENABLE(ipri, &afs_callout_lock); - xmfree((void *)tos, pinned_heap); - - } - } + afs_callo.head = tos; + } else { + /* + * The callout table is not empty. Chain this + * trb to the head of the callout chain. + */ + tos->tonext = afs_callo.head; + afs_callo.head->toprev = tos; + afs_callo.head = tos; + } + + /* Just finished adding a trb to the callout table. */ + afs_callo.ncallo++; + cocnt--; + AFS_UNLOCK_ENABLE(ipri, &afs_callout_lock); } + } else { + /* + * Callout table is being shrunk - keep working until the + * right number of elements have been removed being careful + * only to remove elements which do not belong to timeout + * requests that are currently active. + */ + if (cocnt < 0) { - return(rv); -} + /* + * There had better be at least as many tos's in + * the callout table as the size by which the caller + * wants to decrease the size of the table. + */ + osi_Assert(afs_callo.ncallo >= -cocnt); + + while (cocnt < 0) { + + /* + * Start from the head of the callout chain, + * making sure that there is a tos at the + * head (i.e. that there is a callout chain). + */ + ipri = AFS_DISABLE_LOCK(INTMAX, &afs_callout_lock); + tos = afs_callo.head; + osi_Assert(tos != NULL); + /* + * Keep walking down the callout chain until + * a tos is found which is not currently + * active. + */ + while ((tos != NULL) && (tos->trb->tof != NULL)) { + tos = tos->tonext; + } + /* + * If trb is not NULL, then there was not a + * callout table entry that wasn't set to + * timeout. Panic. + */ + osi_Assert(tos != NULL); + /* + * Found a free callout table element, free + * it and remove it from the callout table. + */ + tfree(tos->trb); + if (afs_callo.head == tos) { + afs_callo.head = tos->tonext; + if (afs_callo.head != NULL) { + afs_callo.head->toprev = NULL; + } + } else { + osi_Assert(tos->toprev != NULL); + tos->toprev->tonext = tos->tonext; + if (tos->tonext != NULL) { + tos->tonext->toprev = tos->toprev; + } + } + /* + * Just finished removing a trb from the + * callout table. + */ + afs_callo.ncallo--; + cocnt++; + AFS_UNLOCK_ENABLE(ipri, &afs_callout_lock); + xmfree((void *)tos, pinned_heap); + } + } + } + return (rv); +} diff --git a/src/afs/AIX/osi_vfs.h b/src/afs/AIX/osi_vfs.h index 4b98e8b70..3e2842ccf 100644 --- a/src/afs/AIX/osi_vfs.h +++ b/src/afs/AIX/osi_vfs.h @@ -34,10 +34,9 @@ * if _SUN is defined, this is in vnode.h (at least today... who knows where * they will hide it tomorrow) */ -enum vcexcl {NONEXCL, EXCL}; /* (non)exclusive create */ +enum vcexcl { NONEXCL, EXCL }; /* (non)exclusive create */ #endif -struct buf *getblk(), *geteblk(), *breada(), *bread(); +struct buf *getblk(), *geteblk(), *breada(), *bread(); #define b_actf av_forw #define dbtob(db) ((unsigned)(db) << 9) /* (db * 512) */ - diff --git a/src/afs/AIX/osi_vfsops.c b/src/afs/AIX/osi_vfsops.c index 7fc5b38c7..6b051fced 100644 --- a/src/afs/AIX/osi_vfsops.c +++ b/src/afs/AIX/osi_vfsops.c @@ -11,19 +11,20 @@ * osi_vfsops.c for AIX */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_vfsops.c,v 1.1.1.5 2002/05/10 23:43:33 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/AIX/osi_vfsops.c,v 1.11 2003/07/15 23:14:17 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics stuff */ #ifdef AFS_AIX_IAUTH_ENV -#include "../afs/nfsclient.h" -#include "../afs/exporter.h" -extern struct afs_exporter *afs_nfsexporter; +#include "afs/nfsclient.h" +#include "afs/exporter.h" +extern struct afs_exporter *afs_nfsexporter; #endif #define AFS_VFSLOCK_DECL register int glockOwner = ISAFS_GLOCK() @@ -34,12 +35,13 @@ struct vfs *afs_globalVFS = 0; struct vcache *afs_globalVp = 0; -static int afs_root_nolock (struct vfs *afsp, struct vnode **avpp); +static int afs_root_nolock(struct vfs *afsp, struct vnode **avpp); -static int afs_mount(afsp, path, data) - char *path; - caddr_t data; - struct vfs *afsp; +static int +afs_mount(afsp, path, data) + char *path; + caddr_t data; + struct vfs *afsp; { struct vnode *afsrootvp = NULL; int error; @@ -52,38 +54,43 @@ static int afs_mount(afsp, path, data) * it well. */ AFS_VFSUNLOCK(); - return (setuerror(EBUSY)); + return (setuerror(EBUSY)); } afs_globalVFS = afsp; afsp->vfs_bsize = 8192; + afsp->vfs_count = 0; +#ifdef AFS_64BIT_CLIENT + afsp->vfs_flag |= VFS_DEVMOUNT; +#endif /* AFS_64BIT_CLIENT */ - afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */ - afsp->vfs_fsid.val[1] = AFS_VFSFSID; + afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */ + afsp->vfs_fsid.val[1] = AFS_VFSFSID; /* For AFS, we don't allow file over file mounts. */ - if (afsp->vfs_mntdover->v_type != VDIR) - return(ENOTDIR); - /* try to get the root vnode, but don't worry if you don't. The actual - * setting of the root vnode (vfs_mntd) is done in afs_root, so that it - * get re-eval'd at the right time if things aren't working when we - * first try the mount. - */ + if (afsp->vfs_mntdover->v_type != VDIR) + return (ENOTDIR); + /* try to get the root vnode, but don't worry if you don't. The actual + * setting of the root vnode (vfs_mntd) is done in afs_root, so that it + * get re-eval'd at the right time if things aren't working when we + * first try the mount. + */ afs_root_nolock(afsp, &afsrootvp); afsp->vfs_mntdover->v_mvfsp = afsp; afsp->vfs_mdata->vmt_flags |= MNT_REMOTE; #ifdef AFS_AIX_IAUTH_ENV - if (afs_iauth_register()<0) + if (afs_iauth_register() < 0) afs_warn("Can't register AFS iauth interface.\n"); #endif AFS_VFSUNLOCK(); return 0; } -static int afs_unmount (struct vfs *afsp, int flag) +static int +afs_unmount(struct vfs *afsp, int flag) { AFS_VFSLOCK_DECL; AFS_VFSLOCK(); @@ -96,22 +103,25 @@ static int afs_unmount (struct vfs *afsp, int flag) return 0; } -static int afs_root_nolock (struct vfs *afsp, struct vnode **avpp) +static int +afs_root_nolock(struct vfs *afsp, struct vnode **avpp) { register afs_int32 code = 0; struct vrequest treq; - register struct vcache *tvp=0; + register struct vcache *tvp = 0; AFS_STATCNT(afs_root); if (afs_globalVp && (afs_globalVp->states & CStatd)) { tvp = afs_globalVp; } else { struct ucred *credp; + if (afs_globalVp) { + afs_PutVCache(afs_globalVp); + afs_globalVp = NULL; + } credp = crref(); - if (!(code = afs_InitReq(&treq, credp)) && - !(code = afs_CheckInit())) { - tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); + if (!(code = afs_InitReq(&treq, credp)) && !(code = afs_CheckInit())) { + tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL); /* we really want this to stay around */ if (tvp) { afs_globalVp = tvp; @@ -124,12 +134,12 @@ static int afs_root_nolock (struct vfs *afsp, struct vnode **avpp) VN_HOLD(AFSTOV(tvp)); VN_LOCK(AFSTOV(tvp)); - AFSTOV(tvp)->v_flag |= VROOT; /* No-op on Ultrix 2.2 */ + AFSTOV(tvp)->v_flag |= VROOT; /* No-op on Ultrix 2.2 */ VN_UNLOCK(AFSTOV(tvp)); afs_globalVFS = afsp; *avpp = AFSTOV(tvp); - afsp->vfs_mntd = *avpp; + afsp->vfs_mntd = *avpp; } afs_Trace2(afs_iclSetp, CM_TRACE_VFSROOT, ICL_TYPE_POINTER, *avpp, @@ -138,7 +148,8 @@ static int afs_root_nolock (struct vfs *afsp, struct vnode **avpp) } -static int afs_root (struct vfs *afsp, struct vnode **avpp) +static int +afs_root(struct vfs *afsp, struct vnode **avpp) { int code; AFS_VFSLOCK_DECL; @@ -148,8 +159,8 @@ static int afs_root (struct vfs *afsp, struct vnode **avpp) return code; } -static int afs_statfs(struct vfs *afsp, struct statfs *abp, - struct ucred *credp) +static int +afs_statfs(struct vfs *afsp, struct statfs *abp, struct ucred *credp) { AFS_VFSLOCK_DECL; AFS_VFSLOCK(); @@ -163,17 +174,18 @@ static int afs_statfs(struct vfs *afsp, struct statfs *abp, abp->f_vfstype = AFS_VFSFSID; abp->f_vfsnumber = afsp->vfs_number; abp->f_vfsoff = abp->f_vfslen = abp->f_vfsvers = -1; - abp->f_fsize = 4096; /* fundamental filesystem block size */ + abp->f_fsize = 4096; /* fundamental filesystem block size */ abp->f_fsid = afsp->vfs_fsid; - (void) strcpy(abp->f_fname, "/afs"); - (void) strcpy(abp->f_fpack, "AFS"); + (void)strcpy(abp->f_fname, "/afs"); + (void)strcpy(abp->f_fpack, "AFS"); abp->f_name_max = 256; AFS_VFSUNLOCK(); return 0; } -static int afs_sync() +static int +afs_sync() { AFS_VFSLOCK_DECL; AFS_VFSLOCK(); @@ -185,7 +197,8 @@ static int afs_sync() /* Note that the cred is only for AIX 4.1.5+ and AIX 4.2+ */ -static int afs_vget(struct vfs *vfsp, struct vnode **avcp, struct fileid *fidp, +static int +afs_vget(struct vfs *vfsp, struct vnode **avcp, struct fileid *fidp, struct ucred *credp) { int code; @@ -203,8 +216,8 @@ static int afs_vget(struct vfs *vfsp, struct vnode **avcp, struct fileid *fidp, } #endif - if ((code = afs_InitReq(&treq, credp))==0) { - code = afs_osi_vget((struct vcache**)avcp, fidp, &treq); + if ((code = afs_InitReq(&treq, credp)) == 0) { + code = afs_osi_vget((struct vcache **)avcp, fidp, &treq); } afs_Trace3(afs_iclSetp, CM_TRACE_VGET, ICL_TYPE_POINTER, *avcp, @@ -214,22 +227,26 @@ static int afs_vget(struct vfs *vfsp, struct vnode **avcp, struct fileid *fidp, AFS_VFSUNLOCK(); return code; } - -static int afs_badop() + +static int +afs_badop() { return EOPNOTSUPP; } struct vfsops Afs_vfsops = { - afs_mount, - afs_unmount, - afs_root, - afs_statfs, - afs_sync, - afs_vget, - afs_badop, /* vfs_cntl */ - afs_badop /* vfs_quotactl */ + afs_mount, + afs_unmount, + afs_root, + afs_statfs, + afs_sync, + afs_vget, + afs_badop, /* vfs_cntl */ + afs_badop /* vfs_quotactl */ +#ifdef AFS_AIX51_ENV + , afs_badop /* vfs_syncvfs */ +#endif }; /* diff --git a/src/afs/AIX/osi_vm.c b/src/afs/AIX/osi_vm.c index 46682c0a9..0c44b3315 100644 --- a/src/afs/AIX/osi_vm.c +++ b/src/afs/AIX/osi_vm.c @@ -8,13 +8,14 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_vm.c,v 1.1.1.5 2002/05/10 23:43:33 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/AIX/osi_vm.c,v 1.9 2003/07/15 23:14:17 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ /* Try to discard pages, in order to recycle a vcache entry. * @@ -31,9 +32,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_vm.c,v 1.1.1.5 2002/05/10 2 * therefore obsolescent. */ int -osi_VM_FlushVCache(avc, slept) - struct vcache *avc; - int *slept; +osi_VM_FlushVCache(struct vcache *avc, int *slept) { if (avc->vrefCount != 0) return EBUSY; @@ -70,46 +69,45 @@ osi_VM_FlushVCache(avc, slept) * re-obtained. */ void -osi_VM_StoreAllSegments(avc) - struct vcache *avc; +osi_VM_StoreAllSegments(struct vcache *avc) { - if (avc->vmh) { + if (avc->segid) { /* * The execsOrWriters test is done so that we don't thrash on * the vm_writep call below. We only initiate a pageout of the * dirty vm pages on the last store... * this is strictly a pragmatic decision, and _does_ break the - * advertised AFS consistency semantics. Without this hack, - * AIX systems panic under heavy load. I consider the current - * behavior a bug introduced to hack around a worse bug. XXX + * advertised AFS consistency semantics. Without this hack, + * AIX systems panic under heavy load. I consider the current + * behavior a bug introduced to hack around a worse bug. XXX * * Removed do_writep governing sync'ing behavior. - */ - ReleaseWriteLock(&avc->lock); /* XXX */ + */ + ReleaseWriteLock(&avc->lock); /* XXX */ AFS_GUNLOCK(); - vm_writep(avc->vmh, 0, MAXFSIZE/PAGESIZE -1 ); - vms_iowait(avc->vmh); + vm_writep(avc->segid, 0, MAXFSIZE / PAGESIZE - 1); + vms_iowait(avc->segid); AFS_GLOCK(); - ObtainWriteLock(&avc->lock,93); /* XXX */ + ObtainWriteLock(&avc->lock, 93); /* XXX */ /* * The following is necessary because of the following * asynchronicity: We open a file, write to it and - * close the file + * close the file * if CCore flag is set, we clear it and do the extra - * decrement ourselves now. - * If we're called by the CCore clearer, the CCore flag - * will already be clear, so we don't have to worry about - * clearing it twice. + * decrement ourselves now. + * If we're called by the CCore clearer, the CCore flag + * will already be clear, so we don't have to worry about + * clearing it twice. * avc was "VN_HELD" and "crheld" when CCore was set in * afs_FakeClose - */ + */ if (avc->states & CCore) { avc->states &= ~CCore; avc->opens--; avc->execsOrWriters--; - AFS_RELE(AFSTOV(avc)); - crfree((struct ucred *)avc->linkData); - avc->linkData = (char *)0; + AFS_RELE(AFSTOV(avc)); + crfree((struct ucred *)avc->linkData); + avc->linkData = NULL; } } } @@ -124,18 +122,15 @@ osi_VM_StoreAllSegments(avc) * be some pages around when we return, newly created by concurrent activity. */ void -osi_VM_TryToSmush(avc, acred, sync) - struct vcache *avc; - struct AFS_UCRED *acred; - int sync; +osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync) { if (avc->segid) { ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); - vm_flushp(avc->segid, 0, MAXFSIZE/PAGESIZE - 1); - vms_iowait(avc->vmh); /* XXX Wait?? XXX */ + vm_flushp(avc->segid, 0, MAXFSIZE / PAGESIZE - 1); + vms_iowait(avc->segid); /* XXX Wait?? XXX */ AFS_GLOCK(); - ObtainWriteLock(&avc->lock,60); + ObtainWriteLock(&avc->lock, 60); } } @@ -144,16 +139,14 @@ osi_VM_TryToSmush(avc, acred, sync) * Locking: No lock is held, not even the global lock. */ void -osi_VM_FlushPages(avc, credp) - struct vcache *avc; - struct AFS_UCRED *credp; +osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) { if (avc->segid) { - vm_flushp(avc->segid, 0, MAXFSIZE/PAGESIZE - 1); - /* - * XXX We probably don't need to wait but better be safe XXX - */ - vms_iowait(avc->vmh); + vm_flushp(avc->segid, 0, MAXFSIZE / PAGESIZE - 1); + /* + * XXX We probably don't need to wait but better be safe XXX + */ + vms_iowait(avc->segid); } } @@ -164,14 +157,11 @@ osi_VM_FlushPages(avc, credp) * it only works on Solaris. */ void -osi_VM_Truncate(avc, alen, acred) - struct vcache *avc; - int alen; - struct AFS_UCRED *acred; +osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) { if (avc->segid) { - int firstpage = (alen + PAGESIZE-1)/PAGESIZE; - vm_releasep(avc->segid, firstpage, MAXFSIZE/PAGESIZE - firstpage); - vms_iowait(avc->vmh); /* Do we need this? */ + int firstpage = (alen + PAGESIZE - 1) / PAGESIZE; + vm_releasep(avc->segid, firstpage, MAXFSIZE / PAGESIZE - firstpage); + vms_iowait(avc->segid); /* Do we need this? */ } } diff --git a/src/afs/AIX/osi_vnodeops.c b/src/afs/AIX/osi_vnodeops.c index 8ca0b0d4d..3c814d002 100644 --- a/src/afs/AIX/osi_vnodeops.c +++ b/src/afs/AIX/osi_vnodeops.c @@ -8,46 +8,51 @@ */ #include -#include "../afs/param.h" - -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/AIX/osi_vnodeops.c,v 1.1.1.6 2002/05/10 23:43:34 hartmans Exp $"); - -#include "../h/systm.h" -#include "../h/types.h" -#include "../h/errno.h" -#include "../h/stat.h" -#include "../h/user.h" -#include "../h/uio.h" -#include "../h/vattr.h" -#include "../h/file.h" -#include "../h/vfs.h" -#include "../h/chownx.h" -#include "../h/systm.h" -#include "../h/access.h" -#include "../rpc/types.h" -#include "../afs/osi_vfs.h" -#include "../netinet/in.h" -#include "../h/mbuf.h" -#include "../h/vmuser.h" -#include "../h/shm.h" -#include "../rpc/types.h" -#include "../rpc/xdr.h" - -#include "../afs/stds.h" -#include "../afs/afs_osi.h" +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/AIX/osi_vnodeops.c,v 1.15 2004/03/17 02:29:39 shadow Exp $"); + +#include "h/systm.h" +#include "h/types.h" +#include "h/errno.h" +#include "h/stat.h" +#include "h/user.h" +#include "h/uio.h" +#include "h/vattr.h" +#include "h/file.h" +#include "h/vfs.h" +#include "h/chownx.h" +#include "h/systm.h" +#include "h/access.h" +#ifdef AFS_AIX51_ENV +#include "h/acl.h" +#endif +#include "rpc/types.h" +#include "osi_vfs.h" +#include "netinet/in.h" +#include "h/mbuf.h" +#include "h/vmuser.h" +#include "h/shm.h" +#include "rpc/types.h" +#include "rpc/xdr.h" + +#include "afs/stds.h" +#include "afs/afs_osi.h" #define RFTP_INTERNALS 1 -#include "../afs/volerrors.h" -#include "../afsint/afsint.h" -#include "../afsint/vldbint.h" -#include "../afs/lock.h" -#include "../afs/exporter.h" -#include "../afs/afs.h" -#include "../afs/afs_chunkops.h" -#include "../afs/afs_stats.h" -#include "../afs/nfsclient.h" -#include "../afs/icl.h" -#include "../afs/prs_fs.h" -#include "../h/flock.h" +#include "afs/volerrors.h" +#include "afsint.h" +#include "vldbint.h" +#include "afs/lock.h" +#include "afs/exporter.h" +#include "afs/afs.h" +#include "afs/afs_chunkops.h" +#include "afs/afs_stats.h" +#include "afs/nfsclient.h" +#include "afs/icl.h" +#include "afs/prs_fs.h" +#include "h/flock.h" +#include "afsincludes.h" /* @@ -102,122 +107,140 @@ int afs_gn_enosys(); * declare a struct vnodeops and initialize it with ptrs to all functions */ struct vnodeops afs_gn_vnodeops = { - /* creation/naming/deletion */ - afs_gn_link, - afs_gn_mkdir, - afs_gn_mknod, - afs_gn_remove, - afs_gn_rename, - afs_gn_rmdir, - /* lookup, file handle stuff */ - afs_gn_lookup, - afs_gn_fid, - /* access to files */ - afs_gn_open, - afs_gn_create, - afs_gn_hold, - afs_gn_rele, - afs_gn_close, - afs_gn_map, - afs_gn_unmap, - /* manipulate attributes of files */ - afs_gn_access, - afs_gn_getattr, - afs_gn_setattr, - /* data update operations */ - afs_gn_fclear, - afs_gn_fsync, - afs_gn_ftrunc, - afs_gn_rdwr, - afs_gn_lockctl, - /* extensions */ - afs_gn_ioctl, - afs_gn_readlink, - afs_gn_select, - afs_gn_symlink, - afs_gn_readdir, - /* buffer ops */ - afs_gn_strategy, - /* security things */ - afs_gn_revoke, - afs_gn_getacl, - afs_gn_setacl, - afs_gn_getpcl, - afs_gn_setpcl, - afs_gn_enosys, /* vn_seek */ - afs_gn_enosys, /* vn_spare0 */ - afs_gn_enosys, /* vn_spare1 */ - afs_gn_enosys, /* vn_spare2 */ - afs_gn_enosys, /* vn_spare3 */ - afs_gn_enosys, /* vn_spare4 */ - afs_gn_enosys, /* vn_spare5 */ - afs_gn_enosys, /* vn_spare6 */ - afs_gn_enosys, /* vn_spare7 */ - afs_gn_enosys, /* vn_spare8 */ - afs_gn_enosys, /* vn_spare9 */ - afs_gn_enosys, /* vn_spareA */ - afs_gn_enosys, /* vn_spareB */ - afs_gn_enosys, /* vn_spareC */ - afs_gn_enosys, /* vn_spareD */ - afs_gn_enosys, /* vn_spareE */ - afs_gn_enosys /* vn_spareF */ + /* creation/naming/deletion */ + afs_gn_link, + afs_gn_mkdir, + afs_gn_mknod, + afs_gn_remove, + afs_gn_rename, + afs_gn_rmdir, + /* lookup, file handle stuff */ + afs_gn_lookup, + afs_gn_fid, + /* access to files */ + afs_gn_open, + afs_gn_create, + afs_gn_hold, + afs_gn_rele, + afs_gn_close, + afs_gn_map, + afs_gn_unmap, + /* manipulate attributes of files */ + afs_gn_access, + afs_gn_getattr, + afs_gn_setattr, + /* data update operations */ + afs_gn_fclear, + afs_gn_fsync, + afs_gn_ftrunc, + afs_gn_rdwr, + afs_gn_lockctl, + /* extensions */ + afs_gn_ioctl, + afs_gn_readlink, + afs_gn_select, + afs_gn_symlink, + afs_gn_readdir, + /* buffer ops */ + afs_gn_strategy, + /* security things */ + afs_gn_revoke, + afs_gn_getacl, + afs_gn_setacl, + afs_gn_getpcl, + afs_gn_setpcl, + afs_gn_enosys, /* vn_seek */ + afs_gn_enosys, /* vn_fsync_range */ + afs_gn_enosys, /* vn_create_attr */ + afs_gn_enosys, /* vn_finfo */ + afs_gn_enosys, /* vn_map_lloff */ + afs_gn_enosys, /* vn_readdir_eofp */ + afs_gn_enosys, /* vn_rdwr_attr */ + afs_gn_enosys, /* vn_memcntl */ + afs_gn_enosys, /* vn_spare7 */ + afs_gn_enosys, /* vn_spare8 */ + afs_gn_enosys, /* vn_spare9 */ + afs_gn_enosys, /* vn_spareA */ + afs_gn_enosys, /* vn_spareB */ + afs_gn_enosys, /* vn_spareC */ + afs_gn_enosys, /* vn_spareD */ + afs_gn_enosys, /* vn_spareE */ + afs_gn_enosys /* vn_spareF */ +#ifdef AFS_AIX51_ENV + , afs_gn_enosys, /* pagerBackRange */ + afs_gn_enosys, /* pagerGetFileSize */ + afs_gn_enosys, /* pagerReadAhead */ + afs_gn_enosys, /* pagerWriteBehind */ + afs_gn_enosys /* pagerEndCopy */ +#endif }; struct vnodeops *afs_ops = &afs_gn_vnodeops; int afs_gn_link(vp, dp, name, cred) -struct vnode *vp; -struct vnode *dp; -char *name; -struct ucred *cred; + struct vnode *vp; + struct vnode *dp; + char *name; + struct ucred *cred; { - int error; + int error; AFS_STATCNT(afs_gn_link); error = afs_link(vp, dp, name, cred); - afs_Trace3(afs_iclSetp, CM_TRACE_GNLINK, ICL_TYPE_POINTER, (afs_int32)vp, + afs_Trace3(afs_iclSetp, CM_TRACE_GNLINK, ICL_TYPE_POINTER, vp, ICL_TYPE_STRING, name, ICL_TYPE_LONG, error); - return(error); + return (error); } int -afs_gn_mkdir(dp, name, mode, cred) -struct vnode *dp; -char *name; -int mode; -struct ucred *cred; +afs_gn_mkdir(dp, name, Mode, cred) + struct vnode *dp; + char *name; +#ifdef AFS_AIX51_ENV + int32long64_t Mode; +#else + int Mode; +#endif + struct ucred *cred; { - struct vattr va; - struct vnode *vp; - int error; + struct vattr va; + struct vnode *vp; + int error; + int mode = Mode; AFS_STATCNT(afs_gn_mkdir); VATTR_NULL(&va); va.va_type = VDIR; va.va_mode = (mode & 07777) & ~get_umask(); error = afs_mkdir(dp, name, &va, &vp, cred); - if (! error) { + if (!error) { AFS_RELE(vp); } - afs_Trace4(afs_iclSetp, CM_TRACE_GMKDIR, ICL_TYPE_POINTER, (afs_int32)vp, - ICL_TYPE_STRING, name, ICL_TYPE_LONG, mode, ICL_TYPE_LONG, error); - return(error); + afs_Trace4(afs_iclSetp, CM_TRACE_GMKDIR, ICL_TYPE_POINTER, vp, + ICL_TYPE_STRING, name, ICL_TYPE_LONG, mode, ICL_TYPE_LONG, + error); + return (error); } int -afs_gn_mknod(dp, name, mode, dev, cred) -struct vnode *dp; -char *name; -int mode; -dev_t dev; -struct ucred *cred; +afs_gn_mknod(dp, name, Mode, dev, cred) + struct vnode *dp; + char *name; +#ifdef AFS_AIX51_ENV + int Mode; +#else + int Mode; +#endif + dev_t dev; + struct ucred *cred; { - struct vattr va; - struct vnode *vp; - int error; + struct vattr va; + struct vnode *vp; + int error; + int mode = Mode; AFS_STATCNT(afs_gn_mknod); VATTR_NULL(&va); @@ -226,155 +249,171 @@ struct ucred *cred; /**** I'm not sure if suser() should stay here since it makes no sense in AFS; however the documentation says that one "should be super-user unless making a FIFO file. Others systems such as SUN do this checking in the early stages of mknod (before the abstraction), so it's equivalently the same! *****/ if (va.va_type != VFIFO && !suser(&error)) - return(EPERM); + return (EPERM); switch (va.va_type) { - case VDIR: - error = afs_mkdir(dp, name, &va, &vp, cred); - break; - case VNON: - error = EINVAL; - break; - case VBAD: - case VCHR: - case VBLK: - va.va_rdev = dev; - default: - error = afs_create(dp, name, &va, NONEXCL, mode, &vp, cred); + case VDIR: + error = afs_mkdir(dp, name, &va, &vp, cred); + break; + case VNON: + error = EINVAL; + break; + case VBAD: + case VCHR: + case VBLK: + va.va_rdev = dev; + default: + error = afs_create(dp, name, &va, NONEXCL, mode, &vp, cred); } - if (! error) { + if (!error) { AFS_RELE(vp); } - afs_Trace4(afs_iclSetp, CM_TRACE_GMKNOD, ICL_TYPE_POINTER, (afs_int32)vp, - ICL_TYPE_STRING, name, ICL_TYPE_LONG, mode, ICL_TYPE_LONG, error); - return(error); + afs_Trace4(afs_iclSetp, CM_TRACE_GMKNOD, ICL_TYPE_POINTER, (afs_int32) vp, + ICL_TYPE_STRING, name, ICL_TYPE_LONG, mode, ICL_TYPE_LONG, + error); + return (error); } int afs_gn_remove(vp, dp, name, cred) -struct vnode *vp; /* Ignored in AFS */ -struct vnode *dp; -char *name; -struct ucred *cred; + struct vnode *vp; /* Ignored in AFS */ + struct vnode *dp; + char *name; + struct ucred *cred; { - int error; + int error; - AFS_STATCNT(afs_gn_remove); - error = afs_remove(dp, name, cred); - afs_Trace3(afs_iclSetp, CM_TRACE_GREMOVE, ICL_TYPE_POINTER, (afs_int32)dp, - ICL_TYPE_STRING, name, ICL_TYPE_LONG, error); - return(error); + AFS_STATCNT(afs_gn_remove); + error = afs_remove(dp, name, cred); + afs_Trace3(afs_iclSetp, CM_TRACE_GREMOVE, ICL_TYPE_POINTER, dp, + ICL_TYPE_STRING, name, ICL_TYPE_LONG, error); + return (error); } int afs_gn_rename(vp, dp, name, tp, tdp, tname, cred) -struct vnode *dp; -char *name; -struct vnode *vp; /* Ignored in AFS */ -struct vnode *tp; /* Ignored in AFS */ -struct vnode *tdp; -char *tname; -struct ucred *cred; + struct vnode *dp; + char *name; + struct vnode *vp; /* Ignored in AFS */ + struct vnode *tp; /* Ignored in AFS */ + struct vnode *tdp; + char *tname; + struct ucred *cred; { - int error; + int error; - AFS_STATCNT(afs_gn_rename); + AFS_STATCNT(afs_gn_rename); error = afs_rename(dp, name, tdp, tname, cred); - afs_Trace4(afs_iclSetp, CM_TRACE_GRENAME, ICL_TYPE_POINTER, (afs_int32)dp, - ICL_TYPE_STRING, name, ICL_TYPE_STRING, tname, ICL_TYPE_LONG, error); - return(error); + afs_Trace4(afs_iclSetp, CM_TRACE_GRENAME, ICL_TYPE_POINTER, dp, + ICL_TYPE_STRING, name, ICL_TYPE_STRING, tname, ICL_TYPE_LONG, + error); + return (error); } int afs_gn_rmdir(vp, dp, name, cred) -struct vnode *vp; /* Ignored in AFS */ -struct vnode *dp; -char *name; -struct ucred *cred; + struct vnode *vp; /* Ignored in AFS */ + struct vnode *dp; + char *name; + struct ucred *cred; { - int error; + int error; - AFS_STATCNT(afs_gn_rmdir); + AFS_STATCNT(afs_gn_rmdir); error = afs_rmdir(dp, name, cred); if (error) { - if (error == 66 /* 4.3's ENOTEMPTY */) - error = EEXIST; /* AIX returns EEXIST where 4.3 used ENOTEMPTY */ + if (error == 66 /* 4.3's ENOTEMPTY */ ) + error = EEXIST; /* AIX returns EEXIST where 4.3 used ENOTEMPTY */ } - afs_Trace3(afs_iclSetp, CM_TRACE_GRMDIR, ICL_TYPE_POINTER, (afs_int32)dp, + afs_Trace3(afs_iclSetp, CM_TRACE_GRMDIR, ICL_TYPE_POINTER, dp, ICL_TYPE_STRING, name, ICL_TYPE_LONG, error); - return(error); + return (error); } int -afs_gn_lookup(dp, vpp, name, flags, vattrp, cred) -struct vattr *vattrp; -struct vnode *dp; -struct vnode **vpp; -char *name; -afs_uint32 flags; /* includes FOLLOW... */ -struct ucred *cred; +afs_gn_lookup(dp, vpp, name, Flags, vattrp, cred) + struct vattr *vattrp; + struct vnode *dp; + struct vnode **vpp; + char *name; +#ifdef AFS_AIX51_ENV + int32long64_t Flags; /* includes FOLLOW... */ +#else + afs_uint32 Flags; /* includes FOLLOW... */ +#endif + struct ucred *cred; { - int error; + int error; + int flags = Flags; - AFS_STATCNT(afs_gn_lookup); + AFS_STATCNT(afs_gn_lookup); error = afs_lookup(dp, name, vpp, cred); - afs_Trace3(afs_iclSetp, CM_TRACE_GLOOKUP, ICL_TYPE_POINTER, (afs_int32)dp, + afs_Trace3(afs_iclSetp, CM_TRACE_GLOOKUP, ICL_TYPE_POINTER, dp, ICL_TYPE_STRING, name, ICL_TYPE_LONG, error); - if (vattrp != NULL && error == 0) - afs_gn_getattr(*vpp, vattrp, cred); - return(error); + if (vattrp != NULL && error == 0) + afs_gn_getattr(*vpp, vattrp, cred); + return (error); } int afs_gn_fid(vp, fidp, cred) -struct vnode *vp; -struct fid *fidp; -struct ucred *cred; + struct vnode *vp; + struct fid *fidp; + struct ucred *cred; { - int error; + int error; AFS_STATCNT(afs_gn_fid); - error = afs_fid(vp, fidp); - afs_Trace3(afs_iclSetp, CM_TRACE_GFID, ICL_TYPE_POINTER, (afs_int32)vp, - ICL_TYPE_LONG, (afs_int32)fidp, ICL_TYPE_LONG, error); - return(error); + error = afs_fid(vp, fidp); + afs_Trace3(afs_iclSetp, CM_TRACE_GFID, ICL_TYPE_POINTER, vp, + ICL_TYPE_LONG, (afs_int32) fidp, ICL_TYPE_LONG, error); + return (error); } int -afs_gn_open(vp, flags, ext, vinfop, cred) -struct vnode *vp; -int flags; -int ext; /* Ignored in AFS */ -struct ucred **vinfop; /* return ptr for fp->f_vinfo, used as fp->f_cred */ -struct ucred *cred; -{ - int error; - struct vattr va; +afs_gn_open(vp, Flags, ext, vinfop, cred) + struct vnode *vp; +#ifdef AFS_AIX51_ENV + int32long64_t Flags; + ext_t ext; /* Ignored in AFS */ +#else + int Flags; + int ext; /* Ignored in AFS */ +#endif + struct ucred **vinfop; /* return ptr for fp->f_vinfo, used as fp->f_cred */ + struct ucred *cred; +{ + int error; + struct vattr va; struct vcache *tvp = VTOAFS(vp); afs_int32 modes; + int flags = Flags; AFS_STATCNT(afs_gn_open); modes = 0; - if ((flags & FREAD)) modes |= R_ACC; - if ((flags & FEXEC)) modes |= X_ACC; - if ((flags & FWRITE) || (flags & FTRUNC)) modes |= W_ACC; + if ((flags & FREAD)) + modes |= R_ACC; + if ((flags & FEXEC)) + modes |= X_ACC; + if ((flags & FWRITE) || (flags & FTRUNC)) + modes |= W_ACC; while ((flags & FNSHARE) && tvp->opens) { if (!(flags & FDELAY)) { - error = ETXTBSY; - goto abort; + error = ETXTBSY; + goto abort; } afs_osi_Sleep(&tvp->opens); } error = afs_access(vp, modes, cred); if (error) { - goto abort; + goto abort; } error = afs_open(&vp, flags, cred); @@ -388,51 +427,60 @@ struct ucred *cred; if (flags & FNSHARE) tvp->states |= CNSHARE; - if (! error) { - *vinfop = cred; /* fp->f_vinfo is like fp->f_cred in suns */ - } - else { + if (!error) { + *vinfop = cred; /* fp->f_vinfo is like fp->f_cred in suns */ + } else { /* an error occurred; we've told CM that the file - * is open, so close it now so that open and - * writer counts are correct. Ignore error code, - * as it is likely to fail (the setattr just did). - */ + * is open, so close it now so that open and + * writer counts are correct. Ignore error code, + * as it is likely to fail (the setattr just did). + */ afs_close(vp, flags, cred); } } -abort: - afs_Trace3(afs_iclSetp, CM_TRACE_GOPEN, ICL_TYPE_POINTER, (afs_int32)vp, + abort: + afs_Trace3(afs_iclSetp, CM_TRACE_GOPEN, ICL_TYPE_POINTER, vp, ICL_TYPE_LONG, flags, ICL_TYPE_LONG, error); - return(error); + return (error); } int -afs_gn_create(dp, vpp, flags, name, mode, vinfop, cred) -struct vnode *dp; -struct vnode **vpp; -int flags; -char *name; -int mode; -struct ucred **vinfop; /* return ptr for fp->f_vinfo, used as fp->f_cred */ -struct ucred *cred; -{ - struct vattr va; - enum vcexcl exclusive; - int error, modes=0; +afs_gn_create(dp, vpp, Flags, name, Mode, vinfop, cred) + struct vnode *dp; + struct vnode **vpp; + char *name; +#ifdef AFS_AIX51_ENV + int32long64_t Flags; + int32long64_t Mode; +#else + int Flags; + int Mode; +#endif + struct ucred **vinfop; /* return ptr for fp->f_vinfo, used as fp->f_cred */ + struct ucred *cred; +{ + struct vattr va; + enum vcexcl exclusive; + int error, modes = 0; + int flags = Flags; + int mode = Mode; AFS_STATCNT(afs_gn_create); - if ((flags & (O_EXCL|O_CREAT)) == (O_EXCL|O_CREAT)) + if ((flags & (O_EXCL | O_CREAT)) == (O_EXCL | O_CREAT)) exclusive = EXCL; - else + else exclusive = NONEXCL; VATTR_NULL(&va); va.va_type = VREG; va.va_mode = (mode & 07777) & ~get_umask(); - if ((flags & FREAD)) modes |= R_ACC; - if ((flags & FEXEC)) modes |= X_ACC; - if ((flags & FWRITE) || (flags & FTRUNC)) modes |= W_ACC; + if ((flags & FREAD)) + modes |= R_ACC; + if ((flags & FEXEC)) + modes |= X_ACC; + if ((flags & FWRITE) || (flags & FTRUNC)) + modes |= W_ACC; error = afs_create(dp, name, &va, exclusive, modes, vpp, cred); if (error) { return error; @@ -453,56 +501,62 @@ struct ucred *cred; * are stuff in afs_open that we need. For example advance the * execsOrWriters flag (else we'll be treated as the sun's "core" * case). */ - *vinfop = cred; /* save user creds in fp->f_vinfo */ + *vinfop = cred; /* save user creds in fp->f_vinfo */ error = afs_open(vpp, flags, cred); } - afs_Trace4(afs_iclSetp, CM_TRACE_GCREATE, ICL_TYPE_POINTER, (afs_int32)dp, - ICL_TYPE_STRING, name, ICL_TYPE_LONG, mode, ICL_TYPE_LONG, error); + afs_Trace4(afs_iclSetp, CM_TRACE_GCREATE, ICL_TYPE_POINTER, dp, + ICL_TYPE_STRING, name, ICL_TYPE_LONG, mode, ICL_TYPE_LONG, + error); return error; } int afs_gn_hold(vp) -struct vnode *vp; + struct vnode *vp; { AFS_STATCNT(afs_gn_hold); ++(vp->v_count); - return(0); + return (0); } int vmPageHog = 0; int afs_gn_rele(vp) -struct vnode *vp; + struct vnode *vp; { - struct vcache *vcp = VTOAFS(vp); - int error = 0; + struct vcache *vcp = VTOAFS(vp); + int error = 0; AFS_STATCNT(afs_gn_rele); if (vp->v_count == 0) osi_Panic("afs_rele: zero v_count"); if (--(vp->v_count) == 0) { if (vcp->states & CPageHog) { - vmPageHog --; + vmPageHog--; vcp->states &= ~CPageHog; } error = afs_inactive(vp, 0); } - return(error); + return (error); } int -afs_gn_close(vp, flags, vinfo, cred) -struct vnode *vp; -int flags; -caddr_t vinfo; /* Ignored in AFS */ -struct ucred *cred; +afs_gn_close(vp, Flags, vinfo, cred) + struct vnode *vp; +#ifdef AFS_AIX51_ENV + int32long64_t Flags; +#else + int Flags; +#endif + caddr_t vinfo; /* Ignored in AFS */ + struct ucred *cred; { - int error; + int error; struct vcache *tvp = VTOAFS(vp); + int flags = Flags; AFS_STATCNT(afs_gn_close); @@ -512,48 +566,66 @@ struct ucred *cred; } error = afs_close(vp, flags, cred); - afs_Trace3(afs_iclSetp, CM_TRACE_GCLOSE, ICL_TYPE_POINTER, (afs_int32)vp, + afs_Trace3(afs_iclSetp, CM_TRACE_GCLOSE, ICL_TYPE_POINTER, (afs_int32) vp, ICL_TYPE_LONG, flags, ICL_TYPE_LONG, error); - return(error); + return (error); } int -afs_gn_map(vp, addr, len, off, flag, cred) -struct vnode *vp; -caddr_t addr; -u_int len, off, flag; -struct ucred *cred; +afs_gn_map(vp, addr, Len, Off, Flag, cred) + struct vnode *vp; + caddr_t addr; +#ifdef AFS_AIX51_ENV + uint32long64_t Len, Off, Flag; +#else + u_int Len, Off, Flag; +#endif + struct ucred *cred; { struct vcache *vcp = VTOAFS(vp); struct vrequest treq; afs_int32 error; + afs_int32 len = Len; + afs_int32 off = Off; + afs_int32 flag = Flag; + AFS_STATCNT(afs_gn_map); #ifdef notdef - if (error = afs_InitReq(&treq, cred)) return error; + if (error = afs_InitReq(&treq, cred)) + return error; error = afs_VerifyVCache(vcp, &treq); if (error) return afs_CheckCode(error, &treq, 49); #endif - osi_FlushPages(vcp, cred); /* XXX ensure old pages are gone XXX */ + osi_FlushPages(vcp, cred); /* XXX ensure old pages are gone XXX */ ObtainWriteLock(&vcp->lock, 401); - vcp->states |= CMAPPED; /* flag cleared at afs_inactive */ + vcp->states |= CMAPPED; /* flag cleared at afs_inactive */ /* * We map the segment into our address space using the handle returned by vm_create. */ - if (!vcp->vmh) { + if (!vcp->segid) { + afs_uint32 tlen = vcp->m.Length; +#ifdef AFS_64BIT_CLIENT + if (vcp->m.Length > afs_vmMappingEnd) + tlen = afs_vmMappingEnd; +#endif /* Consider V_INTRSEG too for interrupts */ - if (error = vms_create(&vcp->segid, V_CLIENT, vcp->v.v_gnode, vcp->m.Length, 0, 0)) { + if (error = + vms_create(&vcp->segid, V_CLIENT, vcp->v.v_gnode, tlen, 0, 0)) { ReleaseWriteLock(&vcp->lock); - return(EOPNOTSUPP); + return (EOPNOTSUPP); } +#ifdef AFS_64BIT_KERNEL + vcp->vmh = vm_handle(vcp->segid, (int32long64_t) 0); +#else vcp->vmh = SRVAL(vcp->segid, 0, 0); +#endif } - vcp->v.v_gnode->gn_seg = vcp->segid; /* XXX Important XXX */ + vcp->v.v_gnode->gn_seg = vcp->segid; /* XXX Important XXX */ if (flag & SHM_RDONLY) { vp->v_gnode->gn_mrdcnt++; - } - else { + } else { vp->v_gnode->gn_mwrcnt++; } /* @@ -564,35 +636,40 @@ struct ucred *cred; crhold(cred); if (vcp->credp) { struct ucred *crp = vcp->credp; - vcp->credp = (struct ucred *)0; + vcp->credp = NULL; crfree(crp); } vcp->credp = cred; } ReleaseWriteLock(&vcp->lock); VN_HOLD(vp); - afs_Trace4(afs_iclSetp, CM_TRACE_GMAP, ICL_TYPE_POINTER, (afs_int32)vp, + afs_Trace4(afs_iclSetp, CM_TRACE_GMAP, ICL_TYPE_POINTER, vp, ICL_TYPE_LONG, addr, ICL_TYPE_LONG, len, ICL_TYPE_LONG, off); - return(0); + return (0); } int afs_gn_unmap(vp, flag, cred) -struct vnode *vp; -int flag; -struct ucred *cred; + struct vnode *vp; +#ifdef AFS_AIX51_ENV + int32long64_t flag; +#else + int flag; +#endif + struct ucred *cred; { struct vcache *vcp = VTOAFS(vp); AFS_STATCNT(afs_gn_unmap); ObtainWriteLock(&vcp->lock, 402); if (flag & SHM_RDONLY) { vp->v_gnode->gn_mrdcnt--; - if (vp->v_gnode->gn_mrdcnt <=0) vp->v_gnode->gn_mrdcnt = 0; - } - else { + if (vp->v_gnode->gn_mrdcnt <= 0) + vp->v_gnode->gn_mrdcnt = 0; + } else { vp->v_gnode->gn_mwrcnt--; - if (vp->v_gnode->gn_mwrcnt <=0) vp->v_gnode->gn_mwrcnt = 0; + if (vp->v_gnode->gn_mwrcnt <= 0) + vp->v_gnode->gn_mwrcnt = 0; } ReleaseWriteLock(&vcp->lock); @@ -602,18 +679,27 @@ struct ucred *cred; int -afs_gn_access(vp, mode, who, cred) -struct vnode *vp; -int mode; -int who; -struct ucred *cred; +afs_gn_access(vp, Mode, Who, cred) + struct vnode *vp; +#ifdef AFS_AIX51_ENV + int32long64_t Mode; + int32long64_t Who; +#else + int Mode; + int Who; +#endif + struct ucred *cred; { - int error; + int error; struct vattr vattr; + int mode = Mode; + int who = Who; AFS_STATCNT(afs_gn_access); - if (mode & ~0x7) - return(EINVAL); + if (mode & ~0x7) { + error = EINVAL; + goto out; + } error = afs_access(vp, mode, cred); if (!error) { @@ -623,117 +709,131 @@ struct ucred *cred; if (!error) { if (who == ACC_ANY) { if (((vattr.va_mode >> 6) & mode) == mode) { - error = 0; + error = 0; goto out; } } if (((vattr.va_mode >> 3) & mode) == mode) - error = 0; + error = 0; else error = EACCES; } } else if (who == ACC_ALL) { error = afs_getattr(vp, &vattr, cred); if (!error) { - if ((!((vattr.va_mode >> 6) & mode)) || (!((vattr.va_mode >> 3) & mode)) || - (!(vattr.va_mode & mode))) + if ((!((vattr.va_mode >> 6) & mode)) + || (!((vattr.va_mode >> 3) & mode)) + || (!(vattr.va_mode & mode))) error = EACCES; else error = 0; } } - + } -out: - afs_Trace3(afs_iclSetp, CM_TRACE_GACCESS, ICL_TYPE_POINTER, (afs_int32)vp, + out: + afs_Trace3(afs_iclSetp, CM_TRACE_GACCESS, ICL_TYPE_POINTER, vp, ICL_TYPE_LONG, mode, ICL_TYPE_LONG, error); - return(error); + return (error); } int afs_gn_getattr(vp, vattrp, cred) -struct vnode *vp; -struct vattr *vattrp; -struct ucred *cred; + struct vnode *vp; + struct vattr *vattrp; + struct ucred *cred; { - int error; + int error; - AFS_STATCNT(afs_gn_getattr); + AFS_STATCNT(afs_gn_getattr); error = afs_getattr(vp, vattrp, cred); - afs_Trace2(afs_iclSetp, CM_TRACE_GGETATTR, ICL_TYPE_POINTER, (afs_int32)vp, + afs_Trace2(afs_iclSetp, CM_TRACE_GGETATTR, ICL_TYPE_POINTER, vp, ICL_TYPE_LONG, error); - return(error); + return (error); } int afs_gn_setattr(vp, op, arg1, arg2, arg3, cred) -struct vnode *vp; -int op; -int arg1; -int arg2; -int arg3; -struct ucred *cred; + struct vnode *vp; +#ifdef AFS_AIX51_ENV + int32long64_t op; + int32long64_t arg1; + int32long64_t arg2; + int32long64_t arg3; +#else + int op; + int arg1; + int arg2; + int arg3; +#endif + struct ucred *cred; { - struct vattr va; - int error = 0; + struct vattr va; + int error = 0; - AFS_STATCNT(afs_gn_setattr); + AFS_STATCNT(afs_gn_setattr); VATTR_NULL(&va); - switch(op) { + switch (op) { /* change mode */ - case V_MODE: - va.va_mode = arg1; - break; - case V_OWN: - if ((arg1 & T_OWNER_AS_IS) == 0) - va.va_uid = arg2; - if ((arg1 & T_GROUP_AS_IS) == 0) - va.va_gid = arg3; - break; - case V_UTIME: + case V_MODE: + va.va_mode = arg1; + break; + case V_OWN: + if ((arg1 & T_OWNER_AS_IS) == 0) + va.va_uid = arg2; + if ((arg1 & T_GROUP_AS_IS) == 0) + va.va_gid = arg3; + break; + case V_UTIME: #ifdef notdef - error = afs_access(vp, VWRITE, cred); - if (error) - return(error); + error = afs_access(vp, VWRITE, cred); + if (error) + goto out; #endif - if (arg1 & T_SETTIME) { - va.va_atime.tv_sec = time; - va.va_mtime.tv_sec = time; - } else { - va.va_atime = *(struct timestruc_t *) arg2; - va.va_mtime = *(struct timestruc_t *) arg3; - } - break; - default: - return(EINVAL); + if (arg1 & T_SETTIME) { + va.va_atime.tv_sec = time; + va.va_mtime.tv_sec = time; + } else { + va.va_atime = *(struct timestruc_t *)arg2; + va.va_mtime = *(struct timestruc_t *)arg3; + } + break; + default: + error = EINVAL; + goto out; } error = afs_setattr(vp, &va, cred); - afs_Trace2(afs_iclSetp, CM_TRACE_GSETATTR, ICL_TYPE_POINTER, (afs_int32)vp, + out: + afs_Trace2(afs_iclSetp, CM_TRACE_GSETATTR, ICL_TYPE_POINTER, vp, ICL_TYPE_LONG, error); - return(error); + return (error); } char zero_buffer[PAGESIZE]; int -afs_gn_fclear(vp, flags, offset, length, vinfo, cred) -struct vnode *vp; -int flags; -offset_t offset; -offset_t length; -caddr_t vinfo; -struct ucred *cred; +afs_gn_fclear(vp, flags, offset, length, vinfo, cred) + struct vnode *vp; +#ifdef AFS_AIX51_ENV + int32long64_t flags; +#else + int flags; +#endif + offset_t offset; + offset_t length; + caddr_t vinfo; + struct ucred *cred; { int i, len, error = 0; struct iovec iov; struct uio uio; - static int fclear_init =0; + static int fclear_init = 0; register struct vcache *avc = VTOAFS(vp); - AFS_STATCNT(afs_gn_fclear); + AFS_STATCNT(afs_gn_fclear); if (!fclear_init) { memset(zero_buffer, 0, PAGESIZE); fclear_init = 1; @@ -742,19 +842,19 @@ struct ucred *cred; * Don't clear past ulimit */ if (offset + length > get_ulimit()) - return(EFBIG); + return (EFBIG); /* Flush all pages first */ if (avc->segid) { AFS_GUNLOCK(); - vm_flushp(avc->segid, 0, MAXFSIZE/PAGESIZE - 1); - vms_iowait(avc->vmh); + vm_flushp(avc->segid, 0, MAXFSIZE / PAGESIZE - 1); + vms_iowait(avc->segid); AFS_GLOCK(); - } + } uio.afsio_offset = offset; for (i = offset; i < offset + length; i = uio.afsio_offset) { len = offset + length - i; - iov.iov_len = (len > PAGESIZE) ? PAGESIZE : len; + iov.iov_len = (len > PAGESIZE) ? PAGESIZE : len; iov.iov_base = zero_buffer; uio.afsio_iov = &iov; uio.afsio_iovcnt = 1; @@ -763,74 +863,94 @@ struct ucred *cred; if (error = afs_rdwr(vp, &uio, UIO_WRITE, 0, cred)) break; } - afs_Trace4(afs_iclSetp, CM_TRACE_GFCLEAR, ICL_TYPE_POINTER, (afs_int32)vp, - ICL_TYPE_LONG, offset, ICL_TYPE_LONG, length, ICL_TYPE_LONG, error); + afs_Trace4(afs_iclSetp, CM_TRACE_GFCLEAR, ICL_TYPE_POINTER, vp, + ICL_TYPE_LONG, offset, ICL_TYPE_LONG, length, ICL_TYPE_LONG, + error); return (error); } int afs_gn_fsync(vp, flags, vinfo, cred) -struct vnode *vp; -int flags; /* Not used by AFS */ -caddr_t vinfo; /* Not used by AFS */ -struct ucred *cred; + struct vnode *vp; +#ifdef AFS_AIX51_ENV + int32long64_t flags; /* Not used by AFS */ + int32long64_t vinfo; /* Not used by AFS */ +#else + int flags; /* Not used by AFS */ + caddr_t vinfo; /* Not used by AFS */ +#endif + struct ucred *cred; { - int error; + int error; - AFS_STATCNT(afs_gn_fsync); + AFS_STATCNT(afs_gn_fsync); error = afs_fsync(vp, cred); - afs_Trace3(afs_iclSetp, CM_TRACE_GFSYNC, ICL_TYPE_POINTER, (afs_int32)vp, + afs_Trace3(afs_iclSetp, CM_TRACE_GFSYNC, ICL_TYPE_POINTER, vp, ICL_TYPE_LONG, flags, ICL_TYPE_LONG, error); - return(error); + return (error); } int afs_gn_ftrunc(vp, flags, length, vinfo, cred) -struct vnode *vp; -int flags; /* Ignored in AFS */ -offset_t length; -caddr_t vinfo; /* Ignored in AFS */ -struct ucred *cred; + struct vnode *vp; +#ifdef AFS_AIX51_ENV + int32long64_t flags; /* Ignored in AFS */ +#else + int flags; /* Ignored in AFS */ +#endif + offset_t length; + caddr_t vinfo; /* Ignored in AFS */ + struct ucred *cred; { - struct vattr va; - int error; + struct vattr va; + int error; AFS_STATCNT(afs_gn_ftrunc); VATTR_NULL(&va); va.va_size = length; error = afs_setattr(vp, &va, cred); - afs_Trace4(afs_iclSetp, CM_TRACE_GFTRUNC, ICL_TYPE_POINTER, (afs_int32)vp, - ICL_TYPE_LONG, flags, ICL_TYPE_LONG, length, ICL_TYPE_LONG, error); - return(error); + afs_Trace4(afs_iclSetp, CM_TRACE_GFTRUNC, ICL_TYPE_POINTER, vp, + ICL_TYPE_LONG, flags, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(length), ICL_TYPE_LONG, error); + return (error); } /* Min size of a file which is dumping core before we declare it a page hog. */ #define MIN_PAGE_HOG_SIZE 8388608 -int afs_gn_rdwr(vp, op, flags, ubuf, ext, vinfo, vattrp, cred) -struct vnode *vp; -enum uio_rw op; -int flags; -struct uio *ubuf; -int ext; /* Ignored in AFS */ -caddr_t vinfo; /* Ignored in AFS */ -struct vattr *vattrp; -struct ucred *cred; -{ - register struct vcache *vcp = VTOAFS(vp); +int +afs_gn_rdwr(vp, op, Flags, ubuf, ext, vinfo, vattrp, cred) + struct vnode *vp; + enum uio_rw op; +#ifdef AFS_AIX51_ENV + int32long64_t Flags; + ext_t ext; /* Ignored in AFS */ +#else + int Flags; + int ext; /* Ignored in AFS */ +#endif + struct uio *ubuf; + caddr_t vinfo; /* Ignored in AFS */ + struct vattr *vattrp; + struct ucred *cred; +{ + register struct vcache *vcp = VTOAFS(vp); struct vrequest treq; - int error=0; + int error = 0; int free_cred = 0; + int flags = Flags; AFS_STATCNT(afs_gn_rdwr); if (vcp->vc_error) { - if (op == UIO_WRITE) + if (op == UIO_WRITE) { + afs_Trace2(afs_iclSetp, CM_TRACE_GRDWR1, ICL_TYPE_POINTER, vp, + ICL_TYPE_LONG, vcp->vc_error); return vcp->vc_error; - else - return EIO; + } else + return EIO; } ObtainSharedLock(&vcp->lock, 507); @@ -850,37 +970,39 @@ struct ucred *cred; free_cred = 1; } #endif - crhold(cred); /* Bump refcount for reference in vcache */ + crhold(cred); /* Bump refcount for reference in vcache */ if (vcp->credp) { struct ucred *crp; UpgradeSToWLock(&vcp->lock, 508); crp = vcp->credp; - vcp->credp = (struct ucred *)0; + vcp->credp = NULL; ConvertWToSLock(&vcp->lock); crfree(crp); } - vcp->credp = cred; + vcp->credp = cred; } ReleaseSharedLock(&vcp->lock); /* * XXX Is the following really required?? XXX */ - if (error = afs_InitReq(&treq, cred)) return error; + if (error = afs_InitReq(&treq, cred)) + return error; if (error = afs_VerifyVCache(vcp, &treq)) return afs_CheckCode(error, &treq, 50); - osi_FlushPages(vcp, cred); /* Flush old pages */ + osi_FlushPages(vcp, cred); /* Flush old pages */ if (AFS_NFSXLATORREQ(cred)) { if (flags & FSYNC) flags &= ~FSYNC; if (op == UIO_READ) { - if (!afs_AccessOK(vcp, PRSFS_READ, &treq, - CHECK_MODE_BITS|CMB_ALLOW_EXEC_AS_READ)) { - if (free_cred) - crfree(cred); - return EACCES; + if (!afs_AccessOK + (vcp, PRSFS_READ, &treq, + CHECK_MODE_BITS | CMB_ALLOW_EXEC_AS_READ)) { + if (free_cred) + crfree(cred); + return EACCES; } } } @@ -891,60 +1013,80 @@ struct ucred *cred; * We do a similar thing on the afs_read/write interface. */ if (op == UIO_WRITE) { - ObtainWriteLock(&vcp->lock,240); - vcp->states |= CDirty; /* Set the dirty bit */ - afs_FakeOpen(vcp); - ReleaseWriteLock(&vcp->lock); +#ifdef AFS_64BIT_CLIENT + if (ubuf->afsio_offset < afs_vmMappingEnd) { +#endif /* AFS_64BIT_ENV */ + ObtainWriteLock(&vcp->lock, 240); + vcp->states |= CDirty; /* Set the dirty bit */ + afs_FakeOpen(vcp); + ReleaseWriteLock(&vcp->lock); +#ifdef AFS_64BIT_CLIENT + } +#endif /* AFS_64BIT_ENV */ } error = afs_vm_rdwr(vp, ubuf, op, flags, cred); if (op == UIO_WRITE) { - ObtainWriteLock(&vcp->lock,241); - afs_FakeClose(vcp, cred); /* XXXX For nfs trans and cores XXXX */ - ReleaseWriteLock(&vcp->lock); +#ifdef AFS_64BIT_CLIENT + if (ubuf->afsio_offset < afs_vmMappingEnd) { +#endif /* AFS_64BIT_ENV */ + ObtainWriteLock(&vcp->lock, 241); + afs_FakeClose(vcp, cred); /* XXXX For nfs trans and cores XXXX */ + ReleaseWriteLock(&vcp->lock); +#ifdef AFS_64BIT_CLIENT + } +#endif /* AFS_64BIT_ENV */ } if (vattrp != NULL && error == 0) afs_gn_getattr(vp, vattrp, cred); - afs_Trace4(afs_iclSetp, CM_TRACE_GRDWR, ICL_TYPE_POINTER, (afs_int32)vp, + afs_Trace4(afs_iclSetp, CM_TRACE_GRDWR, ICL_TYPE_POINTER, vp, ICL_TYPE_LONG, flags, ICL_TYPE_LONG, op, ICL_TYPE_LONG, error); if (free_cred) - crfree(cred); - return(error); + crfree(cred); + return (error); } - #define AFS_MAX_VM_CHUNKS 10 afs_vm_rdwr(vp, uiop, rw, ioflag, credp) - register struct vnode *vp; - struct uio *uiop; - enum uio_rw rw; - int ioflag; - struct ucred *credp; + register struct vnode *vp; + struct uio *uiop; + enum uio_rw rw; + int ioflag; + struct ucred *credp; { register afs_int32 code = 0; register int i; - afs_int32 blockSize, fileSize; - afs_int32 xfrSize, xfrOffset; + afs_int32 blockSize; + afs_size_t fileSize, xfrOffset, offset, old_offset, xfrSize; + vmsize_t txfrSize; +#ifdef AFS_64BIT_CLIENT + afs_size_t finalOffset; + off_t toffset; + int mixed = 0; + afs_size_t add2resid = 0; +#endif /* AFS_64BIT_CLIENT */ register struct vcache *vcp = VTOAFS(vp); struct dcache *tdc; - register afs_int32 start_offset; - int save_resid = uiop->afsio_resid; - int old_offset, first_page; - int offset, count, len; + afs_size_t start_offset; + afs_int32 save_resid = uiop->afsio_resid; + int first_page, last_page, pages; + int count, len; int counter = 0; struct vrequest treq; - if (code = afs_InitReq(&treq, credp)) return code; + if (code = afs_InitReq(&treq, credp)) + return code; /* special case easy transfer; apparently a lot are done */ - if ((xfrSize=uiop->afsio_resid) == 0) return 0; + if ((xfrSize = uiop->afsio_resid) == 0) + return 0; ObtainReadLock(&vcp->lock); fileSize = vcp->m.Length; - if (rw == UIO_WRITE && (ioflag & IO_APPEND)) { /* handle IO_APPEND mode */ + if (rw == UIO_WRITE && (ioflag & IO_APPEND)) { /* handle IO_APPEND mode */ uiop->afsio_offset = fileSize; } /* compute xfrOffset now, and do some checks */ @@ -953,29 +1095,101 @@ afs_vm_rdwr(vp, uiop, rw, ioflag, credp) code = EINVAL; goto fail; } - +#ifndef AFS_64BIT_CLIENT /* check for "file too big" error, which should really be done above us */ if (rw == UIO_WRITE && xfrSize + fileSize > get_ulimit()) { code = EFBIG; goto fail; } +#endif /* AFS_64BIT_CLIENT */ + +#ifdef AFS_64BIT_CLIENT + if (xfrOffset + xfrSize > afs_vmMappingEnd) { + if (rw == UIO_READ) { + /* don't read past EOF */ + if (xfrSize+xfrOffset > fileSize) { + add2resid = xfrSize + xfrOffset - fileSize; + xfrSize = fileSize - xfrOffset; + if (xfrSize <= 0) goto fail; + txfrSize = xfrSize; + afsio_trim(uiop, txfrSize); + } + } + if (xfrOffset < afs_vmMappingEnd) { + /* special case of a buffer crossing the VM mapping line */ + struct uio tuio; + struct iovec tvec[16]; /* Should have access to #define */ + afs_int32 tsize; + + mixed = 1; + finalOffset = xfrOffset + xfrSize; + tsize = (afs_size_t) (xfrOffset + xfrSize - afs_vmMappingEnd); + txfrSize = xfrSize; + afsio_copy(uiop, &tuio, tvec); + afsio_skip(&tuio, txfrSize - tsize); + afsio_trim(&tuio, tsize); + tuio.afsio_offset = afs_vmMappingEnd; + ReleaseReadLock(&vcp->lock); + ObtainWriteLock(&vcp->lock, 243); + afs_FakeClose(vcp, credp); /* XXXX For nfs trans and cores XXXX */ + ReleaseWriteLock(&vcp->lock); + code = afs_direct_rdwr(vp, &tuio, rw, ioflag, credp); + ObtainWriteLock(&vcp->lock, 244); + afs_FakeOpen(vcp); /* XXXX For nfs trans and cores XXXX */ + ReleaseWriteLock(&vcp->lock); + ObtainReadLock(&vcp->lock); + if (code) + goto fail; + xfrSize = afs_vmMappingEnd - xfrOffset; + txfrSize = xfrSize; + afsio_trim(uiop, txfrSize); + } else { + ReleaseReadLock(&vcp->lock); + code = afs_direct_rdwr(vp, uiop, rw, ioflag, credp); + uiop->uio_resid += add2resid; + return code; + } + } +#endif /* AFS_64BIT_CLIENT */ - if (!vcp->vmh) { + if (!vcp->segid) { + afs_uint32 tlen = vcp->m.Length; +#ifdef AFS_64BIT_CLIENT + if (vcp->m.Length > afs_vmMappingEnd) + tlen = afs_vmMappingEnd; +#endif /* Consider V_INTRSEG too for interrupts */ - if (code = vms_create(&vcp->segid, V_CLIENT, vcp->v.v_gnode, - vcp->m.Length, 0, 0)) { + if (code = + vms_create(&vcp->segid, V_CLIENT, vcp->v.v_gnode, tlen, 0, 0)) { goto fail; } - vcp->vmh = SRVAL(vcp->segid, 0, 0); +#ifdef AFS_64BIT_KERNEL + vcp->vmh = vm_handle(vcp->segid, (int32long64_t) 0); +#else + vcp->vmh = SRVAL(vcp->segid, 0, 0); +#endif } + vcp->v.v_gnode->gn_seg = vcp->segid; if (rw == UIO_READ) { /* don't read past EOF */ - if (xfrSize+xfrOffset > fileSize) + if (xfrSize + xfrOffset > fileSize) xfrSize = fileSize - xfrOffset; - if (xfrSize <= 0) goto fail; + if (xfrSize <= 0) + goto fail; ReleaseReadLock(&vcp->lock); +#ifdef AFS_64BIT_CLIENT + toffset = xfrOffset; + uiop->afsio_offset = xfrOffset; + afs_Trace3(afs_iclSetp, CM_TRACE_VMWRITE, ICL_TYPE_POINTER, vcp, + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(xfrOffset), + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(xfrSize)); + AFS_GUNLOCK(); + txfrSize = xfrSize; + code = vm_move(vcp->segid, toffset, txfrSize, rw, uiop); +#else /* AFS_64BIT_CLIENT */ AFS_GUNLOCK(); code = vm_move(vcp->segid, xfrOffset, xfrSize, rw, uiop); +#endif /* AFS_64BIT_CLIENT */ AFS_GLOCK(); /* * If at a chunk boundary and staying within chunk, @@ -983,108 +1197,140 @@ afs_vm_rdwr(vp, uiop, rw, ioflag, credp) */ if (counter == 0 || AFS_CHUNKOFFSET(xfrOffset) == 0 && xfrSize <= AFS_CHUNKSIZE(xfrOffset)) { - ObtainWriteLock(&vcp->lock,407); + ObtainWriteLock(&vcp->lock, 407); tdc = afs_FindDCache(vcp, xfrOffset); - if (tdc) { - if (!(tdc->flags & DFNextStarted)) - afs_PrefetchChunk(vcp, tdc, credp, &treq); - afs_PutDCache(tdc); - } + if (tdc) { + if (!(tdc->mflags & DFNextStarted)) + afs_PrefetchChunk(vcp, tdc, credp, &treq); + afs_PutDCache(tdc); + } ReleaseWriteLock(&vcp->lock); } +#ifdef AFS_64BIT_CLIENT + if (mixed) { + uiop->afsio_offset = finalOffset; + } + uiop->uio_resid += add2resid; +#endif /* AFS_64BIT_CLIENT */ return code; } /* UIO_WRITE */ + start_offset = uiop->afsio_offset; + afs_Trace3(afs_iclSetp, CM_TRACE_VMWRITE, ICL_TYPE_POINTER, vcp, + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(start_offset), + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(xfrSize)); ReleaseReadLock(&vcp->lock); - ObtainWriteLock(&vcp->lock,400); + ObtainWriteLock(&vcp->lock, 400); vcp->m.Date = osi_Time(); /* Set file date (for ranlib) */ /* extend file */ /* un-protect last page. */ - vm_protectp(vcp->vmh, vcp->m.Length/PAGESIZE, 1, FILEKEY); + last_page = vcp->m.Length / PAGESIZE; +#ifdef AFS_64BIT_CLIENT + if (vcp->m.Length > afs_vmMappingEnd) + last_page = afs_vmMappingEnd / PAGESIZE; +#endif + vm_protectp(vcp->segid, last_page, 1, FILEKEY); if (xfrSize + xfrOffset > fileSize) { - vcp->m.Length = xfrSize+xfrOffset; - } + vcp->m.Length = xfrSize + xfrOffset; + } if ((!(vcp->states & CPageHog)) && (xfrSize >= MIN_PAGE_HOG_SIZE)) { - vmPageHog ++; + vmPageHog++; vcp->states |= CPageHog; } ReleaseWriteLock(&vcp->lock); - + /* If the write will fit into a single chunk we'll write all of it * at once. Otherwise, we'll write one chunk at a time, flushing * some of it to disk. */ - start_offset = uiop->afsio_offset; count = 0; /* Only create a page to avoid excess VM access if we're writing a * small file which is either new or completely overwrites the * existing file. */ - if ((xfrOffset == 0) && (xfrSize < PAGESIZE) && (xfrSize >= fileSize) && - (vcp->v.v_gnode->gn_mwrcnt == 0) && - (vcp->v.v_gnode->gn_mrdcnt == 0)) { - (void) vm_makep(vcp->segid, 0); + if ((xfrOffset == 0) && (xfrSize < PAGESIZE) && (xfrSize >= fileSize) + && (vcp->v.v_gnode->gn_mwrcnt == 0) + && (vcp->v.v_gnode->gn_mrdcnt == 0)) { + (void)vm_makep(vcp->segid, 0); } - + while (xfrSize > 0) { offset = AFS_CHUNKBASE(xfrOffset); len = xfrSize; - + if (AFS_CHUNKSIZE(xfrOffset) <= len) - len = AFS_CHUNKSIZE(xfrOffset) - (xfrOffset - offset); - + len = + (afs_size_t) AFS_CHUNKSIZE(xfrOffset) - (xfrOffset - offset); + if (len == xfrSize) { /* All data goes to this one chunk. */ AFS_GUNLOCK(); old_offset = uiop->afsio_offset; +#ifdef AFS_64BIT_CLIENT + uiop->afsio_offset = xfrOffset; + toffset = xfrOffset; + txfrSize = xfrSize; + code = vm_move(vcp->segid, toffset, txfrSize, rw, uiop); +#else /* AFS_64BIT_CLIENT */ code = vm_move(vcp->segid, xfrOffset, xfrSize, rw, uiop); +#endif /* AFS_64BIT_CLIENT */ AFS_GLOCK(); xfrOffset += len; xfrSize = 0; - } - else { + } else { /* Write just one chunk's worth of data. */ struct uio tuio; - struct iovec tvec[16]; /* Should have access to #define */ + struct iovec tvec[16]; /* Should have access to #define */ /* Purge dirty chunks of file if there are too many dirty chunks. * Inside the write loop, we only do this at a chunk boundary. * Clean up partial chunk if necessary at end of loop. */ if (counter > 0 && code == 0 && xfrOffset == offset) { - ObtainWriteLock(&vcp->lock,403); - code = afs_DoPartialWrite(vcp, &treq); + ObtainWriteLock(&vcp->lock, 403); + if (xfrOffset > vcp->m.Length) + vcp->m.Length = xfrOffset; + code = afs_DoPartialWrite(vcp, &treq); vcp->states |= CDirty; ReleaseWriteLock(&vcp->lock); } counter++; - + afsio_copy(uiop, &tuio, tvec); afsio_trim(&tuio, len); tuio.afsio_offset = xfrOffset; - + AFS_GUNLOCK(); old_offset = uiop->afsio_offset; +#ifdef AFS_64BIT_CLIENT + toffset = xfrOffset; + code = vm_move(vcp->segid, toffset, len, rw, &tuio); +#else /* AFS_64BIT_CLIENT */ code = vm_move(vcp->segid, xfrOffset, len, rw, &tuio); +#endif /* AFS_64BIT_CLIENT */ AFS_GLOCK(); len -= tuio.afsio_resid; afsio_skip(uiop, len); xfrSize -= len; xfrOffset += len; } - - first_page = old_offset >> PGSHIFT; + + first_page = (afs_size_t) old_offset >> PGSHIFT; + pages = + 1 + (((afs_size_t) old_offset + (len - 1)) >> PGSHIFT) - + first_page; + afs_Trace3(afs_iclSetp, CM_TRACE_VMWRITE2, ICL_TYPE_POINTER, vcp, + ICL_TYPE_INT32, first_page, ICL_TYPE_INT32, pages); AFS_GUNLOCK(); - code = vm_writep(vcp->segid, first_page, - 1 + ((old_offset + (len - 1)) >> PGSHIFT) - first_page); + code = vm_writep(vcp->segid, first_page, pages); if (++count > AFS_MAX_VM_CHUNKS) { count = 0; vms_iowait(vcp->segid); } AFS_GLOCK(); - + } if (count) { @@ -1093,17 +1339,17 @@ afs_vm_rdwr(vp, uiop, rw, ioflag, credp) AFS_GLOCK(); } - ObtainWriteLock(&vcp->lock,242); + ObtainWriteLock(&vcp->lock, 242); if (code == 0 && (vcp->states & CDirty)) { code = afs_DoPartialWrite(vcp, &treq); } - vm_protectp(vcp->vmh, vcp->m.Length/PAGESIZE, 1, RDONLY); + vm_protectp(vcp->segid, last_page, 1, RDONLY); ReleaseWriteLock(&vcp->lock); - + /* If requested, fsync the file after every write */ if (ioflag & FSYNC) afs_fsync(vp, credp); - + ObtainReadLock(&vcp->lock); if (vcp->vc_error) { /* Pretend we didn't write anything. We need to get the error back to @@ -1114,37 +1360,125 @@ afs_vm_rdwr(vp, uiop, rw, ioflag, credp) */ code = vcp->vc_error; if (code == EDQUOT || code == ENOSPC) - uiop->afsio_resid = save_resid; + uiop->afsio_resid = save_resid; + } +#ifdef AFS_64BIT_CLIENT + if (mixed) { + uiop->afsio_offset = finalOffset; } +#endif /* AFS_64BIT_CLIENT */ fail: ReleaseReadLock(&vcp->lock); + afs_Trace2(afs_iclSetp, CM_TRACE_VMWRITE3, ICL_TYPE_POINTER, vcp, + ICL_TYPE_INT32, code); return code; } +afs_direct_rdwr(vp, uiop, rw, ioflag, credp) + register struct vnode *vp; + struct uio *uiop; + enum uio_rw rw; + int ioflag; + struct ucred *credp; +{ + register afs_int32 code = 0; + afs_size_t fileSize, xfrOffset, offset, old_offset, xfrSize; + struct vcache *vcp = VTOAFS(vp); + afs_int32 save_resid = uiop->afsio_resid; + struct vrequest treq; -static int lock_normalize(vp, lckdat, offset, cred) - struct vnode *vp; - struct eflock *lckdat; - offset_t offset; - struct ucred *cred; + if (code = afs_InitReq(&treq, credp)) + return code; + + /* special case easy transfer; apparently a lot are done */ + if ((xfrSize = uiop->afsio_resid) == 0) + return 0; + + ObtainReadLock(&vcp->lock); + fileSize = vcp->m.Length; + if (rw == UIO_WRITE && (ioflag & IO_APPEND)) { /* handle IO_APPEND mode */ + uiop->afsio_offset = fileSize; + } + /* compute xfrOffset now, and do some checks */ + xfrOffset = uiop->afsio_offset; + if (xfrOffset < 0 || xfrOffset + xfrSize < 0) { + code = EINVAL; + ReleaseReadLock(&vcp->lock); + goto fail; + } + + /* check for "file too big" error, which should really be done above us */ +#ifdef notdef + if (rw == UIO_WRITE && xfrSize + fileSize > get_ulimit()) { + code = EFBIG; + ReleaseReadLock(&vcp->lock); + goto fail; + } +#endif + ReleaseReadLock(&vcp->lock); + if (rw == UIO_WRITE) { + ObtainWriteLock(&vcp->lock, 400); + vcp->m.Date = osi_Time(); /* Set file date (for ranlib) */ + /* extend file */ + if (xfrSize + xfrOffset > fileSize) + vcp->m.Length = xfrSize + xfrOffset; + ReleaseWriteLock(&vcp->lock); + } + afs_Trace3(afs_iclSetp, CM_TRACE_DIRECTRDWR, ICL_TYPE_POINTER, vp, + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(uiop->afsio_offset), + ICL_TYPE_LONG, uiop->afsio_resid); + code = afs_rdwr(vp, uiop, rw, ioflag, credp); + if (code != 0) { + uiop->afsio_resid = save_resid; + } else { + uiop->afsio_offset = xfrOffset + xfrSize; + if (uiop->afsio_resid > 0) { + /* should zero here the remaining buffer */ + uiop->afsio_resid = 0; + } + /* Purge dirty chunks of file if there are too many dirty chunks. + * Inside the write loop, we only do this at a chunk boundary. + * Clean up partial chunk if necessary at end of loop. + */ + if (AFS_CHUNKBASE(uiop->afsio_offset) != AFS_CHUNKBASE(xfrOffset)) { + ObtainWriteLock(&vcp->lock, 402); + code = afs_DoPartialWrite(vcp, &treq); + vcp->states |= CDirty; + ReleaseWriteLock(&vcp->lock); + } + } + + fail: + return code; +} + + +static int +lock_normalize(vp, lckdat, offset, cred) + struct vnode *vp; + struct eflock *lckdat; + offset_t offset; + struct ucred *cred; { struct vattr vattr; int code; - switch(lckdat->l_whence) { - case 0: - return 0; - case 1: - lckdat->l_start += (off_t) offset; - break; - case 2: - code = afs_getattr(vp, &vattr, cred); - if (code != 0) return code; - lckdat->l_start += (off_t) vattr.va_size; - break; - default: return EINVAL; + switch (lckdat->l_whence) { + case 0: + return 0; + case 1: + lckdat->l_start += (off_t) offset; + break; + case 2: + code = afs_getattr(vp, &vattr, cred); + if (code != 0) + return code; + lckdat->l_start += (off_t) vattr.va_size; + break; + default: + return EINVAL; } lckdat->l_whence = 0; return 0; @@ -1153,131 +1487,144 @@ static int lock_normalize(vp, lckdat, offset, cred) afs_gn_lockctl(vp, offset, lckdat, cmd, ignored_fcn, ignored_id, cred) -void (*ignored_fcn)(); -void *ignored_id; -struct vnode *vp; -offset_t offset; -struct eflock *lckdat; -struct ucred *cred; -{ - int error, ncmd=0; - struct flock flkd; - struct vattr *attrs; - - AFS_STATCNT(afs_gn_lockctl); - /* Convert from AIX's cmd to standard lockctl lock types... */ - if (cmd == 0) - ncmd = F_GETLK; - else if (cmd & SETFLCK) { - ncmd = F_SETLK; - if (cmd & SLPFLCK) - ncmd = F_SETLKW; - } - flkd.l_type = lckdat->l_type; - flkd.l_whence = lckdat->l_whence; - flkd.l_start = lckdat->l_start; - flkd.l_len = lckdat->l_len; - flkd.l_pid = lckdat->l_pid; - flkd.l_sysid = lckdat->l_sysid; - - if (flkd.l_start != lckdat->l_start || flkd.l_len != lckdat->l_len) - return EINVAL; + void (*ignored_fcn) (); + void *ignored_id; + struct vnode *vp; + offset_t offset; + struct eflock *lckdat; + struct ucred *cred; +#ifdef AFS_AIX51_ENV + int32long64_t cmd; +#else + int cmd; +#endif +{ + int error, ncmd = 0; + struct flock flkd; + struct vattr *attrs; + + AFS_STATCNT(afs_gn_lockctl); + /* Convert from AIX's cmd to standard lockctl lock types... */ + if (cmd == 0) + ncmd = F_GETLK; + else if (cmd & SETFLCK) { + ncmd = F_SETLK; + if (cmd & SLPFLCK) + ncmd = F_SETLKW; + } + flkd.l_type = lckdat->l_type; + flkd.l_whence = lckdat->l_whence; + flkd.l_start = lckdat->l_start; + flkd.l_len = lckdat->l_len; + flkd.l_pid = lckdat->l_pid; + flkd.l_sysid = lckdat->l_sysid; + + if (flkd.l_start != lckdat->l_start || flkd.l_len != lckdat->l_len) + return EINVAL; if (error = lock_normalize(vp, &flkd, offset, cred)) - return(error); + return (error); error = afs_lockctl(vp, &flkd, ncmd, cred); - lckdat->l_type = flkd.l_type; - lckdat->l_whence = flkd.l_whence; - lckdat->l_start = flkd.l_start; - lckdat->l_len = flkd.l_len; - lckdat->l_pid = flkd.l_pid; - lckdat->l_sysid = flkd.l_sysid; - afs_Trace3(afs_iclSetp, CM_TRACE_GLOCKCTL, ICL_TYPE_POINTER, (afs_int32)vp, + lckdat->l_type = flkd.l_type; + lckdat->l_whence = flkd.l_whence; + lckdat->l_start = flkd.l_start; + lckdat->l_len = flkd.l_len; + lckdat->l_pid = flkd.l_pid; + lckdat->l_sysid = flkd.l_sysid; + afs_Trace3(afs_iclSetp, CM_TRACE_GLOCKCTL, ICL_TYPE_POINTER, vp, ICL_TYPE_LONG, ncmd, ICL_TYPE_LONG, error); - return(error); + return (error); } /* NOTE: In the nfs glue routine (nfs_gn2sun.c) the order was wrong (vp, flags, cmd, arg, ext); was that another typo? */ -int afs_gn_ioctl(vp, cmd, arg, flags, channel, ext) -struct vnode *vp; -int cmd; -int arg; -int flags; /* Ignored in AFS */ -int channel; /* Ignored in AFS */ -int ext; /* Ignored in AFS */ -{ - int error; +int +afs_gn_ioctl(vp, Cmd, arg, flags, channel, ext) + struct vnode *vp; +#ifdef AFS_AIX51_ENV + int32long64_t Cmd; +#else + int Cmd; +#endif + int arg; + int flags; /* Ignored in AFS */ + int channel; /* Ignored in AFS */ + int ext; /* Ignored in AFS */ +{ + int error; + int cmd = Cmd; + AFS_STATCNT(afs_gn_ioctl); - /* This seems to be a perfect fit for our ioctl redirection (afs_xioctl hack); thus the ioctl(2) entry in sysent.c is unaffected in the aix/afs port. */ + /* This seems to be a perfect fit for our ioctl redirection (afs_xioctl hack); thus the ioctl(2) entry in sysent.c is unaffected in the aix/afs port. */ error = afs_ioctl(vp, cmd, arg); - afs_Trace3(afs_iclSetp, CM_TRACE_GIOCTL, ICL_TYPE_POINTER, (afs_int32)vp, + afs_Trace3(afs_iclSetp, CM_TRACE_GIOCTL, ICL_TYPE_POINTER, vp, ICL_TYPE_LONG, cmd, ICL_TYPE_LONG, error); - return(error); + return (error); } int -afs_gn_readlink(vp, uiop, cred) -struct vnode *vp; -struct uio *uiop; -struct ucred *cred; +afs_gn_readlink(vp, uiop, cred) + struct vnode *vp; + struct uio *uiop; + struct ucred *cred; { - int error; + int error; - AFS_STATCNT(afs_gn_readlink); + AFS_STATCNT(afs_gn_readlink); error = afs_readlink(vp, uiop, cred); - afs_Trace2(afs_iclSetp, CM_TRACE_GREADLINK, ICL_TYPE_POINTER, (afs_int32)vp, + afs_Trace2(afs_iclSetp, CM_TRACE_GREADLINK, ICL_TYPE_POINTER, vp, ICL_TYPE_LONG, error); - return(error); + return (error); } int afs_gn_select(vp, which, vinfo, mpx) -struct vnode *vp; -int which; -caddr_t *vinfo; -caddr_t *mpx; + struct vnode *vp; + int which; + caddr_t *vinfo; + caddr_t *mpx; { - AFS_STATCNT(afs_gn_select); + AFS_STATCNT(afs_gn_select); /* NO SUPPORT for this in afs YET! */ - return(EOPNOTSUPP); + return (EOPNOTSUPP); } int afs_gn_symlink(vp, link, target, cred) -struct vnode *vp; -char *target; -char *link; -struct ucred *cred; + struct vnode *vp; + char *target; + char *link; + struct ucred *cred; { - struct vattr va; - int error; + struct vattr va; + int error; AFS_STATCNT(afs_gn_symlink); VATTR_NULL(&va); va.va_mode = 0777; error = afs_symlink(vp, link, &va, target, cred); - afs_Trace4(afs_iclSetp, CM_TRACE_GSYMLINK, ICL_TYPE_POINTER, (afs_int32)vp, - ICL_TYPE_STRING, link, ICL_TYPE_STRING, target, ICL_TYPE_LONG, error); - return(error); + afs_Trace4(afs_iclSetp, CM_TRACE_GSYMLINK, ICL_TYPE_POINTER, vp, + ICL_TYPE_STRING, link, ICL_TYPE_STRING, target, ICL_TYPE_LONG, + error); + return (error); } int afs_gn_readdir(vp, uiop, cred) -struct vnode *vp; -struct uio *uiop; -struct ucred *cred; + struct vnode *vp; + struct uio *uiop; + struct ucred *cred; { - int error; + int error; - AFS_STATCNT(afs_gn_readdir); + AFS_STATCNT(afs_gn_readdir); error = afs_readdir(vp, uiop, cred); - afs_Trace2(afs_iclSetp, CM_TRACE_GREADDIR, ICL_TYPE_POINTER, (afs_int32)vp, + afs_Trace2(afs_iclSetp, CM_TRACE_GREADDIR, ICL_TYPE_POINTER, vp, ICL_TYPE_LONG, error); - return(error); + return (error); } @@ -1301,11 +1648,15 @@ extern int afs_asyncbuf_cv; */ #define AIX_VM_BLKSIZE 8192 afs_gn_strategy(abp, cred) -struct ucred *cred; -register struct buf *abp; + struct ucred *cred; + register struct buf *abp; { register struct buf **lbp, *tbp; - int *lwbp; /* last guy in work chain */ +#ifdef AFS_64BIT_KERNEL + afs_int64 *lwbp; /* last quy in work chain */ +#else + int *lwbp; /* last guy in work chain */ +#endif struct buf *nbp, *qbp, *qnbp, *firstComparable; int doMerge; int oldPriority; @@ -1317,21 +1668,22 @@ register struct buf *abp; && !((y)->b_flags & B_PFPROT)) oldPriority = disable_lock(INTMAX, &afs_asyncbuf_lock); - for(tbp = abp; tbp; tbp=nbp) { + for (tbp = abp; tbp; tbp = nbp) { nbp = tbp->av_forw; /* remember for later */ tbp->b_work = 0; - tbp->av_back = (struct buf *) afs_biotime++; + tbp->av_back = (struct buf *)afs_biotime++; /* first insert the buffer into the afs_async queue. Insert buffer * sorted within its disk position within a set of comparable buffers. * Ensure that all comparable buffers are grouped contiguously. * Later on, we'll merge adjacent buffers into a single request. */ - firstComparable = (struct buf *) 0; + firstComparable = NULL; lbp = &afs_asyncbuf; - for(qbp = *lbp; qbp; lbp = &qbp->av_forw, qbp = *lbp) { + for (qbp = *lbp; qbp; lbp = &qbp->av_forw, qbp = *lbp) { if (EFS_COMPARABLE(tbp, qbp)) { - if (!firstComparable) firstComparable = qbp; + if (!firstComparable) + firstComparable = qbp; /* this buffer is comparable, so see if the next buffer * is farther in the file; if it is insert before next buffer. */ @@ -1350,7 +1702,7 @@ register struct buf *abp; /* do the insert before qbp now */ tbp->av_forw = *lbp; *lbp = tbp; - if (firstComparable == (struct buf *) 0) { + if (firstComparable == NULL) { /* next we're going to do all sorts of buffer merging tricks, but * here we know we're the only COMPARABLE block in the * afs_asyncbuf list, so we just skip that and continue with @@ -1383,31 +1735,34 @@ register struct buf *abp; * the file system block size, then we know that such blocks are also * on block boundaries. */ - - doMerge = 1; /* start the loop */ - while(doMerge) { /* loop until an iteration doesn't - * make any more changes */ + + doMerge = 1; /* start the loop */ + while (doMerge) { /* loop until an iteration doesn't + * make any more changes */ doMerge = 0; - for (qbp = firstComparable; ; qbp = qnbp) { + for (qbp = firstComparable;; qbp = qnbp) { qnbp = qbp->av_forw; - if (!qnbp) break; /* we're done */ - if (!EFS_COMPARABLE(qbp, qnbp)) break; + if (!qnbp) + break; /* we're done */ + if (!EFS_COMPARABLE(qbp, qnbp)) + break; /* try to merge qbp and qnbp */ /* first check if both not adjacent go on to next region */ - if ((dbtob(qbp->b_blkno) + qbp->b_bcount) != dbtob(qnbp->b_blkno)) + if ((dbtob(qbp->b_blkno) + qbp->b_bcount) != + dbtob(qnbp->b_blkno)) continue; /* note if both in the same block, the first byte of leftmost guy * and last byte of rightmost guy are in the same block. */ - if ((dbtob(qbp->b_blkno) & ~(AIX_VM_BLKSIZE-1)) == - ((dbtob(qnbp->b_blkno)+qnbp->b_bcount-1) & ~(AIX_VM_BLKSIZE-1))) { + if ((dbtob(qbp->b_blkno) & ~(AIX_VM_BLKSIZE - 1)) == + ((dbtob(qnbp->b_blkno) + qnbp->b_bcount - + 1) & ~(AIX_VM_BLKSIZE - 1))) { doMerge = 1; /* both in same block */ - } - else if ((qbp->b_bcount & (AIX_VM_BLKSIZE-1)) == 0 - && (qnbp->b_bcount & (AIX_VM_BLKSIZE-1)) == 0) { + } else if ((qbp->b_bcount & (AIX_VM_BLKSIZE - 1)) == 0 + && (qnbp->b_bcount & (AIX_VM_BLKSIZE - 1)) == 0) { doMerge = 1; /* both integral #s of blocks */ } if (doMerge) { @@ -1415,93 +1770,107 @@ register struct buf *abp; /* merge both of these blocks together */ /* first set age to the older of the two */ - if ((int) qnbp->av_back - (int) qbp->av_back < 0) +#ifdef AFS_64BIT_KERNEL + if ((afs_int64) qnbp->av_back - (afs_int64) qbp->av_back < + 0) +#else + if ((int)qnbp->av_back - (int)qbp->av_back < 0) +#endif qbp->av_back = qnbp->av_back; lwbp = &qbp->b_work; /* find end of qbp's work queue */ - for(xbp = (struct buf *)(*lwbp); xbp; - lwbp = &xbp->b_work, xbp = (struct buf *) (*lwbp)); + for (xbp = (struct buf *)(*lwbp); xbp; + lwbp = &xbp->b_work, xbp = (struct buf *)(*lwbp)); /* * now setting *lwbp will change the last ptr in the qbp's * work chain */ - qbp->av_forw = qnbp->av_forw; /* splice out qnbp */ - qbp->b_bcount += qnbp->b_bcount; /* fix count */ - *lwbp = (int) qnbp; /* append qnbp to end */ + qbp->av_forw = qnbp->av_forw; /* splice out qnbp */ + qbp->b_bcount += qnbp->b_bcount; /* fix count */ +#ifdef AFS_64BIT_KERNEL + *lwbp = (afs_int64) qnbp; /* append qnbp to end */ +#else + *lwbp = (int)qnbp; /* append qnbp to end */ +#endif /* * note that qnbp is bogus, but it doesn't matter because * we're going to restart the for loop now. */ - break; /* out of the for loop */ + break; /* out of the for loop */ } } } - } /* for loop for all interrupt data */ + } /* for loop for all interrupt data */ /* at this point, all I/O has been queued. Wakeup the daemon */ - e_wakeup_one((int*) &afs_asyncbuf_cv); + e_wakeup_one((int *)&afs_asyncbuf_cv); unlock_enable(oldPriority, &afs_asyncbuf_lock); return 0; } afs_inactive(avc, acred) - register struct vcache *avc; - struct AFS_UCRED *acred; + register struct vcache *avc; + struct AFS_UCRED *acred; { afs_InactiveVCache(avc, acred); } int afs_gn_revoke(vp) -struct vnode *vp; + struct vnode *vp; { AFS_STATCNT(afs_gn_revoke); /* NO SUPPORT for this in afs YET! */ - return(EOPNOTSUPP); + return (EOPNOTSUPP); } -int afs_gn_getacl(vp, uiop, cred) - struct vnode *vp; - struct uio *uiop; - struct ucred *cred; -{ +int +afs_gn_getacl(vp, uiop, cred) + struct vnode *vp; + struct uio *uiop; + struct ucred *cred; +{ return ENOSYS; }; -int afs_gn_setacl(vp, uiop, cred) - struct vnode *vp; - struct uio *uiop; - struct ucred *cred; -{ +int +afs_gn_setacl(vp, uiop, cred) + struct vnode *vp; + struct uio *uiop; + struct ucred *cred; +{ return ENOSYS; }; -int afs_gn_getpcl(vp, uiop, cred) - struct vnode *vp; - struct uio *uiop; - struct ucred *cred; -{ +int +afs_gn_getpcl(vp, uiop, cred) + struct vnode *vp; + struct uio *uiop; + struct ucred *cred; +{ return ENOSYS; }; -int afs_gn_setpcl(vp, uiop, cred) - struct vnode *vp; - struct uio *uiop; - struct ucred *cred; -{ +int +afs_gn_setpcl(vp, uiop, cred) + struct vnode *vp; + struct uio *uiop; + struct ucred *cred; +{ return ENOSYS; }; -int afs_gn_enosys() +int +afs_gn_enosys() { return ENOSYS; } - -extern struct vfsops Afs_vfsops; -extern struct vnodeops afs_gn_vnodeops; -extern int Afs_init(); + +extern struct vfsops Afs_vfsops; +extern struct vnodeops afs_gn_vnodeops; +extern int Afs_init(); #define AFS_CALLOUT_TBL_SIZE 256 @@ -1512,645 +1881,825 @@ extern int Afs_init(); */ static -vfs_mount(struct vfs *a, struct ucred *b) { - register glockOwner, ret; +vfs_mount(struct vfs *a, struct ucred *b) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*Afs_vfsops.vfs_mount)(a, b); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*Afs_vfsops.vfs_mount) (a, b); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vfs_unmount(struct vfs *a, int b, struct ucred *c) { - register glockOwner, ret; +vfs_unmount(struct vfs *a, int b, struct ucred *c) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*Afs_vfsops.vfs_unmount)(a, b, c); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*Afs_vfsops.vfs_unmount) (a, b, c); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vfs_root(struct vfs *a, struct vnode **b, struct ucred *c) { - register glockOwner, ret; +vfs_root(struct vfs *a, struct vnode **b, struct ucred *c) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*Afs_vfsops.vfs_root)(a, b, c); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*Afs_vfsops.vfs_root) (a, b, c); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vfs_statfs(struct vfs *a, struct statfs *b, struct ucred *c) { - register glockOwner, ret; +vfs_statfs(struct vfs *a, struct statfs *b, struct ucred *c) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*Afs_vfsops.vfs_statfs)(a, b, c); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*Afs_vfsops.vfs_statfs) (a, b, c); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vfs_sync(struct gfs *a) { - register glockOwner, ret; +vfs_sync(struct gfs *a) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*Afs_vfsops.vfs_sync)(a); - if (!glockOwner) - AFS_GUNLOCK(); - return ret; + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*Afs_vfsops.vfs_sync) (a); + if (!glockOwner) + AFS_GUNLOCK(); + return ret; } static -vfs_vget(struct vfs *a, struct vnode **b, struct fileid *c - , struct ucred *d) { - register glockOwner, ret; +vfs_vget(struct vfs *a, struct vnode **b, struct fileid *c, struct ucred *d) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*Afs_vfsops.vfs_vget)(a, b, c, d); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*Afs_vfsops.vfs_vget) (a, b, c, d); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vfs_cntl(struct vfs *a, int b, caddr_t c, size_t d, struct ucred *e) { - register glockOwner, ret; +vfs_cntl(struct vfs *a, int b, caddr_t c, size_t d, struct ucred *e) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*Afs_vfsops.vfs_cntl)(a, b, c, d, e); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*Afs_vfsops.vfs_cntl) (a, b, c, d, e); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vfs_quotactl(struct vfs *a, int b, uid_t c, caddr_t d - , struct ucred *e) { - register glockOwner, ret; +vfs_quotactl(struct vfs *a, int b, uid_t c, caddr_t d, struct ucred *e) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*Afs_vfsops.vfs_quotactl)(a, b, c, d, e); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*Afs_vfsops.vfs_quotactl) (a, b, c, d, e); + if (!glockOwner) + AFS_GUNLOCK(); + + return ret; +} + +#ifdef AFS_AIX51_ENV +static +vfs_syncvfs(struct gfs *a, struct vfs *b, int c, struct ucred *d) +{ + register glockOwner, ret; + + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*Afs_vfsops.vfs_syncvfs) (a, b, c, d); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } +#endif struct vfsops locked_Afs_vfsops = { - vfs_mount, - vfs_unmount, - vfs_root, - vfs_statfs, - vfs_sync, - vfs_vget, - vfs_cntl, - vfs_quotactl, + vfs_mount, + vfs_unmount, + vfs_root, + vfs_statfs, + vfs_sync, + vfs_vget, + vfs_cntl, + vfs_quotactl, +#ifdef AFS_AIX51_ENV + vfs_syncvfs +#endif }; static -vn_link(struct vnode *a, struct vnode *b, char *c, struct ucred *d) { - register glockOwner, ret; +vn_link(struct vnode *a, struct vnode *b, char *c, struct ucred *d) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_link)(a, b, c, d); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_link) (a, b, c, d); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_mkdir(struct vnode *a, char *b, int c, struct ucred *d) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_mkdir(struct vnode *a, char *b, int32long64_t c, struct ucred *d) +{ +#else +vn_mkdir(struct vnode *a, char *b, int c, struct ucred *d) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_mkdir)(a, b, c, d); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_mkdir) (a, b, c, d); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_mknod(struct vnode *a, caddr_t b, int c, dev_t d, struct ucred *e) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_mknod(struct vnode *a, caddr_t b, int32long64_t c, dev_t d, + struct ucred *e) +{ +#else +vn_mknod(struct vnode *a, caddr_t b, int c, dev_t d, struct ucred *e) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_mknod)(a, b, c, d, e); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_mknod) (a, b, c, d, e); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_remove(struct vnode *a, struct vnode *b, char *c, struct ucred *d) { - register glockOwner, ret; +vn_remove(struct vnode *a, struct vnode *b, char *c, struct ucred *d) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_remove)(a, b, c, d); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_remove) (a, b, c, d); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_rename(struct vnode *a, struct vnode *b, caddr_t c - , struct vnode *d, struct vnode *e, caddr_t f, struct ucred *g) { - register glockOwner, ret; +vn_rename(struct vnode *a, struct vnode *b, caddr_t c, struct vnode *d, + struct vnode *e, caddr_t f, struct ucred *g) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_rename)(a, b, c, d, e, f, g); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_rename) (a, b, c, d, e, f, g); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_rmdir(struct vnode *a, struct vnode *b, char *c, struct ucred *d) { - register glockOwner, ret; +vn_rmdir(struct vnode *a, struct vnode *b, char *c, struct ucred *d) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_rmdir)(a, b, c, d); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_rmdir) (a, b, c, d); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static +#ifdef AFS_AIX51_ENV + vn_lookup(struct vnode *a, struct vnode **b, char *c, int32long64_t d, +#else vn_lookup(struct vnode *a, struct vnode **b, char *c, int d, - struct vattr *v, struct ucred *e) { - register glockOwner, ret; +#endif + struct vattr *v, struct ucred *e) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_lookup)(a, b, c, d, v, e); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_lookup) (a, b, c, d, v, e); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_fid(struct vnode *a, struct fileid *b, struct ucred *c) { - register glockOwner, ret; +vn_fid(struct vnode *a, struct fileid *b, struct ucred *c) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_fid)(a, b, c); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_fid) (a, b, c); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_open(struct vnode *a, int b, int c, caddr_t *d, struct ucred *e) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_open(struct vnode *a, int b, int c, caddr_t * d, struct ucred *e) +{ +#else +vn_open(struct vnode *a, int32long64_t b, ext_t c, caddr_t * d, + struct ucred *e) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_open)(a, b, c, d, e); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_open) (a, b, c, d, e); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_create(struct vnode *a, struct vnode **b, int c, caddr_t d - , int e, caddr_t *f, struct ucred *g) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_create(struct vnode *a, struct vnode **b, int32long64_t c, caddr_t d, + int32long64_t e, caddr_t * f, struct ucred *g) +{ +#else +vn_create(struct vnode *a, struct vnode **b, int c, caddr_t d, int e, + caddr_t * f, struct ucred *g) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_create)(a, b, c, d, e, f, g); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_create) (a, b, c, d, e, f, g); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_hold(struct vnode *a) { - register glockOwner, ret; +vn_hold(struct vnode *a) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_hold)(a); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_hold) (a); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_rele(struct vnode *a) { - register glockOwner, ret; +vn_rele(struct vnode *a) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_rele)(a); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_rele) (a); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_close(struct vnode *a, int b, caddr_t c, struct ucred *d) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_close(struct vnode *a, int32long64_t b, caddr_t c, struct ucred *d) +{ +#else +vn_close(struct vnode *a, int b, caddr_t c, struct ucred *d) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_close)(a, b, c, d); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_close) (a, b, c, d); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_map(struct vnode *a, caddr_t b, uint c, uint d, uint e, struct ucred *f) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_map(struct vnode *a, caddr_t b, uint32long64_t c, uint32long64_t d, + uint32long64_t e, struct ucred *f) +{ +#else +vn_map(struct vnode *a, caddr_t b, uint c, uint d, uint e, struct ucred *f) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_map)(a, b, c, d, e, f); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_map) (a, b, c, d, e, f); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_unmap(struct vnode *a, int b, struct ucred *c) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_unmap(struct vnode *a, int32long64_t b, struct ucred *c) +{ +#else +vn_unmap(struct vnode *a, int b, struct ucred *c) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_unmap)(a, b, c); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_unmap) (a, b, c); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_access(struct vnode *a, int b, int c, struct ucred *d) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_access(struct vnode *a, int32long64_t b, int32long64_t c, struct ucred *d) +{ +#else +vn_access(struct vnode *a, int b, int c, struct ucred *d) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_access)(a, b, c, d); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_access) (a, b, c, d); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_getattr(struct vnode *a, struct vattr *b, struct ucred *c) { - register glockOwner, ret; +vn_getattr(struct vnode *a, struct vattr *b, struct ucred *c) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_getattr)(a, b, c); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_getattr) (a, b, c); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_setattr(struct vnode *a, int b, int c, int d, int e, struct ucred *f) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_setattr(struct vnode *a, int32long64_t b, int32long64_t c, int32long64_t d, + int32long64_t e, struct ucred *f) +{ +#else +vn_setattr(struct vnode *a, int b, int c, int d, int e, struct ucred *f) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_setattr)(a, b, c, d, e, f); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_setattr) (a, b, c, d, e, f); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static +#ifdef AFS_AIX51_ENV + vn_fclear(struct vnode *a, int32long64_t b, offset_t c, offset_t d +#else vn_fclear(struct vnode *a, int b, offset_t c, offset_t d - , caddr_t e, struct ucred *f) { - register glockOwner, ret; +#endif + , caddr_t e, struct ucred *f) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_fclear)(a, b, c, d, e, f); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_fclear) (a, b, c, d, e, f); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_fsync(struct vnode *a, int b, int c, struct ucred *d) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_fsync(struct vnode *a, int32long64_t b, int32long64_t c, struct ucred *d) +{ +#else +vn_fsync(struct vnode *a, int b, int c, struct ucred *d) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_fsync)(a, b, c, d); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_fsync) (a, b, c, d); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_ftrunc(struct vnode *a, int b, offset_t c, caddr_t d, struct ucred *e) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_ftrunc(struct vnode *a, int32long64_t b, offset_t c, caddr_t d, + struct ucred *e) +{ +#else +vn_ftrunc(struct vnode *a, int b, offset_t c, caddr_t d, struct ucred *e) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_ftrunc)(a, b, c, d, e); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_ftrunc) (a, b, c, d, e); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_rdwr(struct vnode *a, enum uio_rw b, int c, struct uio *d - , int e, caddr_t f, struct vattr *v, struct ucred *g) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_rdwr(struct vnode *a, enum uio_rw b, int32long64_t c, struct uio *d, + ext_t e, caddr_t f, struct vattr *v, struct ucred *g) +{ +#else +vn_rdwr(struct vnode *a, enum uio_rw b, int c, struct uio *d, int e, + caddr_t f, struct vattr *v, struct ucred *g) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_rdwr)(a, b, c, d, e, f, v, g); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_rdwr) (a, b, c, d, e, f, v, g); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_lockctl(struct vnode *a, offset_t b, struct eflock *c, int d - , int (*e)(), ulong *f, struct ucred *g) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_lockctl(struct vnode *a, offset_t b, struct eflock *c, int32long64_t d, + int (*e) (), ulong32int64_t * f, struct ucred *g) +{ +#else +vn_lockctl(struct vnode *a, offset_t b, struct eflock *c, int d, int (*e) (), + ulong * f, struct ucred *g) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_lockctl)(a, b, c, d, e, f, g); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_lockctl) (a, b, c, d, e, f, g); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_ioctl(struct vnode *a, int b, caddr_t c, size_t d, int e, struct ucred *f) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_ioctl(struct vnode *a, int32long64_t b, caddr_t c, size_t d, ext_t e, + struct ucred *f) +{ +#else +vn_ioctl(struct vnode *a, int b, caddr_t c, size_t d, int e, struct ucred *f) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_ioctl)(a, b, c, d, e, f); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_ioctl) (a, b, c, d, e, f); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_readlink(struct vnode *a, struct uio *b, struct ucred *c) { - register glockOwner, ret; +vn_readlink(struct vnode *a, struct uio *b, struct ucred *c) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_readlink)(a, b, c); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_readlink) (a, b, c); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_select(struct vnode *a, int b, ushort c, ushort *d, void (*e)() - , caddr_t f, struct ucred *g) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV + vn_select(struct vnode *a, int32long64_t b, ushort c, ushort * d, + void (*e) () +#else +vn_select(struct vnode *a, int b, ushort c, ushort * d, void (*e) () +#endif + , caddr_t f, struct ucred *g) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_select)(a, b, c, d, e, f, g); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_select) (a, b, c, d, e, f, g); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_symlink(struct vnode *a, char *b, char *c, struct ucred *d) { - register glockOwner, ret; +vn_symlink(struct vnode *a, char *b, char *c, struct ucred *d) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_symlink)(a, b, c, d); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_symlink) (a, b, c, d); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_readdir(struct vnode *a, struct uio *b, struct ucred *c) { - register glockOwner, ret; +vn_readdir(struct vnode *a, struct uio *b, struct ucred *c) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_readdir)(a, b, c); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_readdir) (a, b, c); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_revoke(struct vnode *a, int b, int c, struct vattr *d, struct ucred *e) { - register glockOwner, ret; +#ifdef AFS_AIX51_ENV +vn_revoke(struct vnode *a, int32long64_t b, int32long64_t c, struct vattr *d, + struct ucred *e) +{ +#else +vn_revoke(struct vnode *a, int b, int c, struct vattr *d, struct ucred *e) +{ +#endif + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_revoke)(a, b, c, d, e); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_revoke) (a, b, c, d, e); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_getacl(struct vnode *a, struct uio *b, struct ucred *c) { - register glockOwner, ret; +vn_getacl(struct vnode *a, struct uio *b, struct ucred *c) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_getacl)(a, b, c); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_getacl) (a, b, c); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_setacl(struct vnode *a, struct uio *b, struct ucred *c) { - register glockOwner, ret; +vn_setacl(struct vnode *a, struct uio *b, struct ucred *c) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_setacl)(a, b, c); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_setacl) (a, b, c); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_getpcl(struct vnode *a, struct uio *b, struct ucred *c) { - register glockOwner, ret; +vn_getpcl(struct vnode *a, struct uio *b, struct ucred *c) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_getpcl)(a, b, c); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_getpcl) (a, b, c); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } static -vn_setpcl(struct vnode *a, struct uio *b, struct ucred *c) { - register glockOwner, ret; +vn_setpcl(struct vnode *a, struct uio *b, struct ucred *c) +{ + register glockOwner, ret; - glockOwner = ISAFS_GLOCK(); - if (!glockOwner) - AFS_GLOCK(); - ret = (*afs_gn_vnodeops.vn_setpcl)(a, b, c); - if (!glockOwner) - AFS_GUNLOCK(); + glockOwner = ISAFS_GLOCK(); + if (!glockOwner) + AFS_GLOCK(); + ret = (*afs_gn_vnodeops.vn_setpcl) (a, b, c); + if (!glockOwner) + AFS_GUNLOCK(); - return ret; + return ret; } extern int afs_gn_strategy(); struct vnodeops locked_afs_gn_vnodeops = { - vn_link, - vn_mkdir, - vn_mknod, - vn_remove, - vn_rename, - vn_rmdir, - vn_lookup, - vn_fid, - vn_open, - vn_create, - vn_hold, - vn_rele, - vn_close, - vn_map, - vn_unmap, - vn_access, - vn_getattr, - vn_setattr, - vn_fclear, - vn_fsync, - vn_ftrunc, - vn_rdwr, - vn_lockctl, - vn_ioctl, - vn_readlink, - vn_select, - vn_symlink, - vn_readdir, - afs_gn_strategy, /* no locking!!! (discovered the hard way) */ - vn_revoke, - vn_getacl, - vn_setacl, - vn_getpcl, - vn_setpcl, + vn_link, + vn_mkdir, + vn_mknod, + vn_remove, + vn_rename, + vn_rmdir, + vn_lookup, + vn_fid, + vn_open, + vn_create, + vn_hold, + vn_rele, + vn_close, + vn_map, + vn_unmap, + vn_access, + vn_getattr, + vn_setattr, + vn_fclear, + vn_fsync, + vn_ftrunc, + vn_rdwr, + vn_lockctl, + vn_ioctl, + vn_readlink, + vn_select, + vn_symlink, + vn_readdir, + afs_gn_strategy, /* no locking!!! (discovered the hard way) */ + vn_revoke, + vn_getacl, + vn_setacl, + vn_getpcl, + vn_setpcl, + afs_gn_enosys, /* vn_seek */ + afs_gn_enosys, /* vn_fsync_range */ + afs_gn_enosys, /* vn_create_attr */ + afs_gn_enosys, /* vn_finfo */ + afs_gn_enosys, /* vn_map_lloff */ + afs_gn_enosys, /* vn_readdir_eofp */ + afs_gn_enosys, /* vn_rdwr_attr */ + afs_gn_enosys, /* vn_memcntl */ + afs_gn_enosys, /* vn_spare7 */ + afs_gn_enosys, /* vn_spare8 */ + afs_gn_enosys, /* vn_spare9 */ + afs_gn_enosys, /* vn_spareA */ + afs_gn_enosys, /* vn_spareB */ + afs_gn_enosys, /* vn_spareC */ + afs_gn_enosys, /* vn_spareD */ + afs_gn_enosys, /* vn_spareE */ + afs_gn_enosys /* vn_spareF */ +#ifdef AFS_AIX51_ENV + , afs_gn_enosys, /* pagerBackRange */ + afs_gn_enosys, /* pagerGetFileSize */ + afs_gn_enosys, /* pagerReadAhead */ + afs_gn_enosys, /* pagerWriteBehind */ + afs_gn_enosys /* pagerEndCopy */ +#endif }; struct gfs afs_gfs = { - &locked_Afs_vfsops, - &locked_afs_gn_vnodeops, - AFS_MOUNT_AFS, - "afs", - Afs_init, - GFS_VERSION4 | GFS_REMOTE, - NULL + &locked_Afs_vfsops, + &locked_afs_gn_vnodeops, + AFS_MOUNT_AFS, + "afs", + Afs_init, + GFS_VERSION4 | GFS_REMOTE, + NULL }; - diff --git a/src/afs/DARWIN/osi_file.c b/src/afs/DARWIN/osi_file.c index 48dbea120..6bc21e3df 100644 --- a/src/afs/DARWIN/osi_file.c +++ b/src/afs/DARWIN/osi_file.c @@ -8,91 +8,93 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_file.c,v 1.1.1.4 2001/09/11 14:24:53 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DARWIN/osi_file.c,v 1.8 2003/07/15 23:14:17 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ -#include "../afs/osi_inode.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ +#include "afs/osi_inode.h" -int afs_osicred_initialized=0; -struct AFS_UCRED afs_osi_cred; -afs_lock_t afs_xosi; /* lock is for tvattr */ +int afs_osicred_initialized = 0; +struct AFS_UCRED afs_osi_cred; +afs_lock_t afs_xosi; /* lock is for tvattr */ extern struct osi_dev cacheDev; extern struct mount *afs_cacheVfsp; int afs_CacheFSType = -1; /* Initialize the cache operations. Called while initializing cache files. */ -void afs_InitDualFSCacheOps(struct vnode *vp) +void +afs_InitDualFSCacheOps(struct vnode *vp) { int code; static int inited = 0; if (inited) - return; + return; inited = 1; if (vp == NULL) - return; + return; if (strncmp("hfs", vp->v_mount->mnt_vfc->vfc_name, 3) == 0) - afs_CacheFSType = AFS_APPL_HFS_CACHE; - else - if (strncmp("ufs", vp->v_mount->mnt_vfc->vfc_name, 3) == 0) - afs_CacheFSType = AFS_APPL_UFS_CACHE; + afs_CacheFSType = AFS_APPL_HFS_CACHE; + else if (strncmp("ufs", vp->v_mount->mnt_vfc->vfc_name, 3) == 0) + afs_CacheFSType = AFS_APPL_UFS_CACHE; else - osi_Panic("Unknown cache vnode type\n"); + osi_Panic("Unknown cache vnode type\n"); } -ino_t VnodeToIno(vnode_t *avp) +ino_t +VnodeToIno(vnode_t * avp) { - unsigned long ret; + unsigned long ret; - if (afs_CacheFSType == AFS_APPL_UFS_CACHE) { - struct inode *ip = VTOI(avp); - ret=ip->i_number; - } else if (afs_CacheFSType == AFS_APPL_HFS_CACHE) { + if (afs_CacheFSType == AFS_APPL_UFS_CACHE) { + struct inode *ip = VTOI(avp); + ret = ip->i_number; + } else if (afs_CacheFSType == AFS_APPL_HFS_CACHE) { #ifndef VTOH - struct vattr va; - if (VOP_GETATTR(avp, &va, &afs_osi_cred, current_proc())) - osi_Panic("VOP_GETATTR failed in VnodeToIno\n"); - ret=va.va_fileid; + struct vattr va; + if (VOP_GETATTR(avp, &va, &afs_osi_cred, current_proc())) + osi_Panic("VOP_GETATTR failed in VnodeToIno\n"); + ret = va.va_fileid; #else - struct hfsnode *hp = VTOH(avp); - ret=H_FILEID(hp); + struct hfsnode *hp = VTOH(avp); + ret = H_FILEID(hp); #endif - } else - osi_Panic("VnodeToIno called before cacheops initialized\n"); - return ret; + } else + osi_Panic("VnodeToIno called before cacheops initialized\n"); + return ret; } -dev_t VnodeToDev(vnode_t *avp) +dev_t +VnodeToDev(vnode_t * avp) { - - if (afs_CacheFSType == AFS_APPL_UFS_CACHE) { - struct inode *ip = VTOI(avp); - return ip->i_dev; - } else - if (afs_CacheFSType == AFS_APPL_HFS_CACHE) { -#ifndef VTOH /* slow, but works */ - struct vattr va; - if (VOP_GETATTR(avp, &va, &afs_osi_cred, current_proc())) - osi_Panic("VOP_GETATTR failed in VnodeToDev\n"); - return va.va_fsid; /* XXX they say it's the dev.... */ + + if (afs_CacheFSType == AFS_APPL_UFS_CACHE) { + struct inode *ip = VTOI(avp); + return ip->i_dev; + } else if (afs_CacheFSType == AFS_APPL_HFS_CACHE) { +#ifndef VTOH /* slow, but works */ + struct vattr va; + if (VOP_GETATTR(avp, &va, &afs_osi_cred, current_proc())) + osi_Panic("VOP_GETATTR failed in VnodeToDev\n"); + return va.va_fsid; /* XXX they say it's the dev.... */ #else - struct hfsnode *hp = VTOH(avp); - return H_DEV(hp); + struct hfsnode *hp = VTOH(avp); + return H_DEV(hp); #endif - } else - osi_Panic("VnodeToDev called before cacheops initialized\n"); + } else + osi_Panic("VnodeToDev called before cacheops initialized\n"); } -void *osi_UFSOpen(ainode) - afs_int32 ainode; +void * +osi_UFSOpen(afs_int32 ainode) { struct vnode *vp; struct vattr va; @@ -101,25 +103,26 @@ void *osi_UFSOpen(ainode) afs_int32 code = 0; int dummy; AFS_STATCNT(osi_UFSOpen); - if(cacheDiskType != AFS_FCACHE_TYPE_UFS) { + if (cacheDiskType != AFS_FCACHE_TYPE_UFS) { osi_Panic("UFSOpen called for non-UFS cache\n"); } if (!afs_osicred_initialized) { /* valid for alpha_osf, SunOS, Ultrix */ memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED)); afs_osi_cred.cr_ref++; - afs_osi_cred.cr_ngroups=1; + afs_osi_cred.cr_ngroups = 1; afs_osicred_initialized = 1; } - afile = (struct osi_file *) osi_AllocSmallSpace(sizeof(struct osi_file)); + afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file)); AFS_GUNLOCK(); - if (afs_CacheFSType == AFS_APPL_HFS_CACHE) - code = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, &ainode, &vp, &va, &dummy); /* XXX hfs is broken */ + if (afs_CacheFSType == AFS_APPL_HFS_CACHE) + code = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, &ainode, &vp, &va, &dummy); /* XXX hfs is broken */ + else if (afs_CacheFSType == AFS_APPL_UFS_CACHE) + code = + igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t) ainode, + &vp, &va, &dummy); else - if (afs_CacheFSType == AFS_APPL_UFS_CACHE) - code = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t)ainode, &vp, &va, &dummy); - else - panic("osi_UFSOpen called before cacheops initialized\n"); + panic("osi_UFSOpen called before cacheops initialized\n"); AFS_GLOCK(); if (code) { osi_FreeSmallSpace(afile); @@ -128,20 +131,20 @@ void *osi_UFSOpen(ainode) afile->vnode = vp; afile->size = va.va_size; afile->offset = 0; - afile->proc = (int (*)()) 0; - afile->inum = ainode; /* for hint validity checking */ + afile->proc = (int (*)())0; + afile->inum = ainode; /* for hint validity checking */ return (void *)afile; } -afs_osi_Stat(afile, astat) - register struct osi_file *afile; - register struct osi_stat *astat; { +int +afs_osi_Stat(register struct osi_file *afile, register struct osi_stat *astat) +{ register afs_int32 code; struct vattr tvattr; AFS_STATCNT(osi_Stat); - MObtainWriteLock(&afs_xosi,320); + MObtainWriteLock(&afs_xosi, 320); AFS_GUNLOCK(); - code=VOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred, current_proc()); + code = VOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred, current_proc()); AFS_GLOCK(); if (code == 0) { astat->size = tvattr.va_size; @@ -153,21 +156,21 @@ afs_osi_Stat(afile, astat) return code; } -osi_UFSClose(afile) - register struct osi_file *afile; - { - AFS_STATCNT(osi_Close); - if(afile->vnode) { +int +osi_UFSClose(register struct osi_file *afile) +{ + AFS_STATCNT(osi_Close); + if (afile->vnode) { AFS_RELE(afile->vnode); - } - - osi_FreeSmallSpace(afile); - return 0; - } - -osi_UFSTruncate(afile, asize) - register struct osi_file *afile; - afs_int32 asize; { + } + + osi_FreeSmallSpace(afile); + return 0; +} + +int +osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize) +{ struct AFS_UCRED *oldCred; struct vattr tvattr; register afs_int32 code; @@ -179,41 +182,41 @@ osi_UFSTruncate(afile, asize) * small enough. Check now and save some time. */ code = afs_osi_Stat(afile, &tstat); - if (code || tstat.size <= asize) return code; - MObtainWriteLock(&afs_xosi,321); + if (code || tstat.size <= asize) + return code; + MObtainWriteLock(&afs_xosi, 321); VATTR_NULL(&tvattr); tvattr.va_size = asize; AFS_GUNLOCK(); - code=VOP_SETATTR(afile->vnode, &tvattr, &afs_osi_cred, current_proc()); + code = VOP_SETATTR(afile->vnode, &tvattr, &afs_osi_cred, current_proc()); AFS_GLOCK(); MReleaseWriteLock(&afs_xosi); return code; } -void osi_DisableAtimes(avp) -struct vnode *avp; +void +osi_DisableAtimes(struct vnode *avp) { - if (afs_CacheFSType == AFS_APPL_UFS_CACHE) { - struct inode *ip = VTOI(avp); - ip->i_flag &= ~IN_ACCESS; - } -#ifdef VTOH /* can't do this without internals */ - else if (afs_CacheFSType == AFS_APPL_HFS_CACHE) { - struct hfsnode *hp = VTOH(avp); - hp->h_nodeflags &= ~IN_ACCESS; - } + if (afs_CacheFSType == AFS_APPL_UFS_CACHE) { + struct inode *ip = VTOI(avp); + ip->i_flag &= ~IN_ACCESS; + } +#ifdef VTOH /* can't do this without internals */ + else if (afs_CacheFSType == AFS_APPL_HFS_CACHE) { + struct hfsnode *hp = VTOH(avp); + hp->h_nodeflags &= ~IN_ACCESS; + } #endif } /* Generic read interface */ -afs_osi_Read(afile, offset, aptr, asize) - register struct osi_file *afile; - int offset; - char *aptr; - afs_int32 asize; { +int +afs_osi_Read(register struct osi_file *afile, int offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; unsigned int resid; register afs_int32 code; @@ -223,59 +226,61 @@ afs_osi_Read(afile, offset, aptr, asize) * If the osi_file passed in is NULL, panic only if AFS is not shutting * down. No point in crashing when we are already shutting down */ - if ( !afile ) { - if ( !afs_shuttingdown ) + if (!afile) { + if (!afs_shuttingdown) osi_Panic("osi_Read called with null param"); else return EIO; } - if (offset != -1) afile->offset = offset; + if (offset != -1) + afile->offset = offset; AFS_GUNLOCK(); - code = gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset, - AFS_UIOSYS, IO_UNIT, &afs_osi_cred, &resid); + code = + gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset, + AFS_UIOSYS, IO_UNIT, &afs_osi_cred, &resid); AFS_GLOCK(); if (code == 0) { code = asize - resid; afile->offset += code; osi_DisableAtimes(afile->vnode); - } - else { + } else { afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid, - ICL_TYPE_INT32, code); + ICL_TYPE_INT32, code); code = -1; } return code; } /* Generic write interface */ -afs_osi_Write(afile, offset, aptr, asize) - register struct osi_file *afile; - char *aptr; - afs_int32 offset; - afs_int32 asize; { +int +afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; unsigned int resid; register afs_int32 code; AFS_STATCNT(osi_Write); - if ( !afile ) + if (!afile) osi_Panic("afs_osi_Write called with null param"); - if (offset != -1) afile->offset = offset; + if (offset != -1) + afile->offset = offset; { AFS_GUNLOCK(); - code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, afile->offset, - AFS_UIOSYS, IO_UNIT, &afs_osi_cred, &resid); + code = + gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, + afile->offset, AFS_UIOSYS, IO_UNIT, &afs_osi_cred, + &resid); AFS_GLOCK(); } if (code == 0) { code = asize - resid; afile->offset += code; - } - else { + } else { code = -1; } if (afile->proc) { - (*afile->proc)(afile, code); + (*afile->proc) (afile, code); } return code; } @@ -285,13 +290,12 @@ afs_osi_Write(afile, offset, aptr, asize) void -shutdown_osifile() +shutdown_osifile(void) { - extern int afs_cold_shutdown; + extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); - if (afs_cold_shutdown) { - afs_osicred_initialized = 0; - } + AFS_STATCNT(shutdown_osifile); + if (afs_cold_shutdown) { + afs_osicred_initialized = 0; + } } - diff --git a/src/afs/DARWIN/osi_groups.c b/src/afs/DARWIN/osi_groups.c index a5a5d9eed..ded6bb485 100644 --- a/src/afs/DARWIN/osi_groups.c +++ b/src/afs/DARWIN/osi_groups.c @@ -15,63 +15,58 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_groups.c,v 1.1.1.3 2001/07/14 22:19:58 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DARWIN/osi_groups.c,v 1.5 2003/07/15 23:14:17 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/afs_stats.h" /* statistics */ static int -afs_getgroups( - struct ucred *cred, - int ngroups, - gid_t *gidset); + afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset); static int -afs_setgroups( - struct proc *proc, - struct ucred **cred, - int ngroups, - gid_t *gidset, - int change_parent); + afs_setgroups(struct proc *proc, struct ucred **cred, int ngroups, + gid_t * gidset, int change_parent); int Afs_xsetgroups(p, args, retval) - struct proc *p; - void *args; - int *retval; + struct proc *p; + void *args; + int *retval; { int code = 0; struct vrequest treq; struct ucred *cr; pcred_readlock(p); - cr=crdup(p->p_cred->pc_ucred); + cr = crdup(p->p_cred->pc_ucred); pcred_unlock(p); AFS_STATCNT(afs_xsetgroups); AFS_GLOCK(); - + code = afs_InitReq(&treq, cr); AFS_GUNLOCK(); crfree(cr); - if (code) return setgroups(p, args, retval); /* afs has shut down */ + if (code) + return setgroups(p, args, retval); /* afs has shut down */ code = setgroups(p, args, retval); /* Note that if there is a pag already in the new groups we don't * overwrite it with the old pag. */ pcred_readlock(p); - cr=crdup(p->p_cred->pc_ucred); + cr = crdup(p->p_cred->pc_ucred); pcred_unlock(p); if (PagInCred(cr) == NOPAG) { if (((treq.uid >> 24) & 0xff) == 'A') { AFS_GLOCK(); /* we've already done a setpag, so now we redo it */ - AddPag(p, treq.uid, &cr ); + AddPag(p, treq.uid, &cr); AFS_GUNLOCK(); } } @@ -82,11 +77,11 @@ Afs_xsetgroups(p, args, retval) int setpag(proc, cred, pagvalue, newpag, change_parent) - struct proc *proc; - struct ucred **cred; - afs_uint32 pagvalue; - afs_uint32 *newpag; - afs_uint32 change_parent; + struct proc *proc; + struct ucred **cred; + afs_uint32 pagvalue; + afs_uint32 *newpag; + afs_uint32 change_parent; { gid_t gidset[NGROUPS]; int ngroups, code; @@ -99,12 +94,12 @@ setpag(proc, cred, pagvalue, newpag, change_parent) if (ngroups + 2 > NGROUPS) { return (E2BIG); } - for (j = ngroups -1; j >= 1; j--) { - gidset[j+2] = gidset[j]; + for (j = ngroups - 1; j >= 1; j--) { + gidset[j + 2] = gidset[j]; } ngroups += 2; } - *newpag = (pagvalue == -1 ? genpag(): pagvalue); + *newpag = (pagvalue == -1 ? genpag() : pagvalue); afs_get_groups_from_pag(*newpag, &gidset[1], &gidset[2]); code = afs_setgroups(proc, cred, ngroups, gidset, change_parent); return code; @@ -112,10 +107,7 @@ setpag(proc, cred, pagvalue, newpag, change_parent) static int -afs_getgroups( - struct ucred *cred, - int ngroups, - gid_t *gidset) +afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) { int ngrps, savengrps; gid_t *gp; @@ -124,19 +116,15 @@ afs_getgroups( savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); gp = cred->cr_groups; while (ngrps--) - *gidset++ = *gp++; + *gidset++ = *gp++; return savengrps; } static int -afs_setgroups( - struct proc *proc, - struct ucred **cred, - int ngroups, - gid_t *gidset, - int change_parent) +afs_setgroups(struct proc *proc, struct ucred **cred, int ngroups, + gid_t * gidset, int change_parent) { int ngrps; int i; @@ -158,16 +146,16 @@ afs_setgroups( if (change_parent) { crhold(cr); pcred_writelock(proc->p_pptr); - oldcr=proc->p_pptr->p_cred->pc_ucred; - proc->p_pptr->p_cred->pc_ucred=cr; + oldcr = proc->p_pptr->p_cred->pc_ucred; + proc->p_pptr->p_cred->pc_ucred = cr; pcred_unlock(proc->p_pptr); crfree(oldcr); } crhold(cr); pcred_writelock(proc); - oldcr=proc->p_cred->pc_ucred; - proc->p_cred->pc_ucred=cr; + oldcr = proc->p_cred->pc_ucred; + proc->p_cred->pc_ucred = cr; pcred_unlock(proc); crfree(oldcr); - return(0); + return (0); } diff --git a/src/afs/DARWIN/osi_inode.c b/src/afs/DARWIN/osi_inode.c index adf5d93fd..a219f59d7 100644 --- a/src/afs/DARWIN/osi_inode.c +++ b/src/afs/DARWIN/osi_inode.c @@ -13,14 +13,15 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_inode.c,v 1.1.1.3 2001/07/14 22:20:01 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DARWIN/osi_inode.c,v 1.6 2003/07/15 23:14:17 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/osi_inode.h" -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/osi_inode.h" +#include "afs/afs_stats.h" /* statistics stuff */ #include extern struct ucred afs_osi_cred; @@ -44,43 +45,44 @@ getinode(fs, dev, inode, vpp, perror) register struct vnode *vp; register struct mount *mp; extern struct mount *rootfs; - if (mp = rootfs) do { - /* - * XXX Also do the test for MFS - */ - if (!strcmp(mp->mnt_vfc->vfc_name, "ufs")) { - ump = VFSTOUFS(mp); - if (ump->um_fs == NULL) - break; - if (ump->um_dev == dev) { - fs = ump->um_mountp; - } - } + if (mp = rootfs) + do { + /* + * XXX Also do the test for MFS + */ + if (!strcmp(mp->mnt_vfc->vfc_name, "ufs")) { + ump = VFSTOUFS(mp); + if (ump->um_fs == NULL) + break; + if (ump->um_dev == dev) { + fs = ump->um_mountp; + } + } #ifdef VFSTOHFS - if (!strcmp(mp->mnt_vfc->vfc_name, "hfs")) { - hmp = VFSTOHFS(mp); + if (!strcmp(mp->mnt_vfc->vfc_name, "hfs")) { + hmp = VFSTOHFS(mp); #if 0 - if (hmp->hfs_mp == NULL) - break; + if (hmp->hfs_mp == NULL) + break; #endif - if (hmp->hfs_raw_dev == dev) { - fs = hmp->hfs_mp; - } - } + if (hmp->hfs_raw_dev == dev) { + fs = hmp->hfs_mp; + } + } #endif - mp = CIRCLEQ_NEXT(mp, mnt_list); - } while (mp != rootfs); + mp = CIRCLEQ_NEXT(mp, mnt_list); + } while (mp != rootfs); if (!fs) - return(ENXIO); + return (ENXIO); } - code=VFS_VGET(fs, (void *)inode, &vp); + code = VFS_VGET(fs, (void *)inode, &vp); if (code) { *perror = BAD_IGET; return code; - } else { + } else { *vpp = vp; - return(0); + return (0); } } extern int afs_CacheFSType; @@ -100,34 +102,34 @@ igetinode(vfsp, dev, inode, vpp, va, perror) AFS_STATCNT(igetinode); if ((code = getinode(vfsp, dev, inode, &vp, perror)) != 0) { - return(code); + return (code); } if (vp->v_type != VREG && vp->v_type != VDIR && vp->v_type != VLNK) { - printf("igetinode: bad type %d\n", vp->v_type); - iforget(vp); - return(ENOENT); + printf("igetinode: bad type %d\n", vp->v_type); + iforget(vp); + return (ENOENT); } VOP_GETATTR(vp, va, &afs_osi_cred, current_proc()); if (va->va_mode == 0) { /* Not an allocated inode */ - iforget(vp); - return(ENOENT); + iforget(vp); + return (ENOENT); } if (vfsp && afs_CacheFSType == AFS_APPL_HFS_CACHE && va->va_nlink == 0) { - printf("igetinode: hfs nlink 0\n"); + printf("igetinode: hfs nlink 0\n"); } if (va->va_nlink == 0) { vput(vp); - return(ENOENT); + return (ENOENT); } VOP_UNLOCK(vp, 0, current_proc()); *vpp = vp; - return(0); + return (0); } iforget(vp) -struct vnode *vp; + struct vnode *vp; { AFS_STATCNT(iforget); @@ -135,8 +137,8 @@ struct vnode *vp; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, current_proc()); /* this whole thing is too wierd. Why??? XXX */ if (vp->v_usecount == 1) { - vp->v_usecount=0; - VOP_UNLOCK(vp,0, current_proc()); + vp->v_usecount = 0; + VOP_UNLOCK(vp, 0, current_proc()); #if 0 simple_lock(&vnode_free_list_slock); TAILQ_INSERT_TAIL(&vnode_free_list, vp, v_freelist); @@ -158,72 +160,70 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, retval) long *retval; long dev, near_inode, param1, param2, param3, param4; { - int dummy, err=0; + int dummy, err = 0; struct inode *ip, *newip; register int code; struct vnode *vp; - + AFS_STATCNT(afs_syscall_icreate); - + if (!afs_suser()) - return(EPERM); + return (EPERM); - code = getinode(0, (dev_t)dev, 2, &ip, &dummy); + code = getinode(0, (dev_t) dev, 2, &ip, &dummy); if (code) { - return(ENOENT); + return (ENOENT); } - code = ialloc(ip, (ino_t)near_inode, 0, &newip); + code = ialloc(ip, (ino_t) near_inode, 0, &newip); iput(ip); if (code) { - return(code); + return (code); } IN_LOCK(newip); - newip->i_flag |= IACC|IUPD|ICHG; - + newip->i_flag |= IACC | IUPD | ICHG; + newip->i_nlink = 1; newip->i_mode = IFREG; - + IN_UNLOCK(newip); vp = ITOV(newip); VN_LOCK(vp); vp->v_type = VREG; VN_UNLOCK(vp); - - if ( !vp->v_object) - { - extern struct vfs_ubcops ufs_ubcops; - extern struct vm_ubc_object* ubc_object_allocate(); - struct vm_ubc_object* vop; - vop = ubc_object_allocate(&vp, &ufs_ubcops, - vp->v_mount->m_funnel); - VN_LOCK(vp); - vp->v_object = vop; - VN_UNLOCK(vp); - } - - + + if (!vp->v_object) { + extern struct vfs_ubcops ufs_ubcops; + extern struct vm_ubc_object *ubc_object_allocate(); + struct vm_ubc_object *vop; + vop = ubc_object_allocate(&vp, &ufs_ubcops, vp->v_mount->m_funnel); + VN_LOCK(vp); + vp->v_object = vop; + VN_UNLOCK(vp); + } + + IN_LOCK(newip); - newip->i_flags |= IC_XUID|IC_XGID; + newip->i_flags |= IC_XUID | IC_XGID; newip->i_flags &= ~IC_PROPLIST; newip->i_vicep1 = param1; - if (param2 == 0x1fffffff/*INODESPECIAL*/) { + if (param2 == 0x1fffffff /*INODESPECIAL*/) { newip->i_vicep2 = ((0x1fffffff << 3) + (param4 & 0x3)); - newip->i_vicep3a = (u_short)(param3 >> 16); - newip->i_vicep3b = (u_short)param3; + newip->i_vicep3a = (u_short) (param3 >> 16); + newip->i_vicep3b = (u_short) param3; } else { - newip->i_vicep2 = (((param2 >> 16) & 0x1f) << 27) + - (((param4 >> 16) & 0x1f) << 22) + - (param3 & 0x3fffff); - newip->i_vicep3a = (u_short)param4; - newip->i_vicep3b = (u_short)param2; + newip->i_vicep2 = + (((param2 >> 16) & 0x1f) << 27) + + (((param4 >> 16) & 0x1f) << 22) + (param3 & 0x3fffff); + newip->i_vicep3a = (u_short) param4; + newip->i_vicep3b = (u_short) param2; } newip->i_vicemagic = VICEMAGIC; - + *retval = newip->i_number; IN_UNLOCK(newip); iput(newip); - return(code); + return (code); } @@ -233,37 +233,37 @@ afs_syscall_iopen(dev, inode, usrmod, retval) { struct file *fp; struct inode *ip; - struct vnode *vp = (struct vnode *)0; + struct vnode *vp = NULL; int dummy; int fd; extern struct fileops vnops; register int code; - + AFS_STATCNT(afs_syscall_iopen); - + if (!afs_suser()) - return(EPERM); + return (EPERM); - code = igetinode(0, (dev_t)dev, (ino_t)inode, &ip, &dummy); + code = igetinode(0, (dev_t) dev, (ino_t) inode, &ip, &dummy); if (code) { - return(code); + return (code); } if ((code = falloc(&fp, &fd)) != 0) { iput(ip); - return(code); + return (code); } IN_UNLOCK(ip); - + FP_LOCK(fp); - fp->f_flag = (usrmod-FOPEN) & FMASK; + fp->f_flag = (usrmod - FOPEN) & FMASK; fp->f_type = DTYPE_VNODE; fp->f_ops = &vnops; - fp->f_data = (caddr_t)ITOV(ip); - + fp->f_data = (caddr_t) ITOV(ip); + FP_UNLOCK(fp); U_FD_SET(fd, fp, &u.u_file_state); *retval = fd; - return(0); + return (0); } @@ -279,18 +279,18 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount) int dummy; struct inode *ip; register int code; - + if (!afs_suser()) - return(EPERM); + return (EPERM); - code = igetinode(0, (dev_t)dev, (ino_t)inode, &ip, &dummy); + code = igetinode(0, (dev_t) dev, (ino_t) inode, &ip, &dummy); if (code) { - return(code); + return (code); } if (!IS_VICEMAGIC(ip)) { - return(EPERM); + return (EPERM); } else if (ip->i_vicep1 != inode_p1) { - return(ENXIO); + return (ENXIO); } ip->i_nlink += amount; if (ip->i_nlink == 0) { @@ -298,24 +298,26 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount) } ip->i_flag |= ICHG; iput(ip); - return(0); + return (0); } #else afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, retval) long *retval; long dev, near_inode, param1, param2, param3, param4; { - return EOPNOTSUPP; + return EOPNOTSUPP; } + afs_syscall_iopen(dev, inode, usrmod, retval) long *retval; int dev, inode, usrmod; { - return EOPNOTSUPP; + return EOPNOTSUPP; } + afs_syscall_iincdec(dev, inode, inode_p1, amount) int dev, inode, inode_p1, amount; { - return EOPNOTSUPP; + return EOPNOTSUPP; } #endif diff --git a/src/afs/DARWIN/osi_inode.h b/src/afs/DARWIN/osi_inode.h index f392a2666..c1b48fb84 100644 --- a/src/afs/DARWIN/osi_inode.h +++ b/src/afs/DARWIN/osi_inode.h @@ -25,13 +25,13 @@ #define i_vicep1 i_din.di_gen #define i_vicep2 i_din.di_uid #define i_vicep3 i_din.di_gid -#define i_vicep4 i_din.di_spare[0] /* not used */ +#define i_vicep4 i_din.di_spare[0] /* not used */ #define di_vicemagic di_flags #define di_vicep1 di_gen #define di_vicep2 di_uid #define di_vicep3 di_gid -#define di_vicep4 di_spare[0] /* not used */ +#define di_vicep4 di_spare[0] /* not used */ #define IS_VICEMAGIC(ip) ((ip)->i_vicemagic == VICEMAGIC) #define IS_DVICEMAGIC(dp) ((dp)->di_vicemagic == VICEMAGIC) diff --git a/src/afs/DARWIN/osi_machdep.h b/src/afs/DARWIN/osi_machdep.h index 9feda0345..c7eeaf652 100644 --- a/src/afs/DARWIN/osi_machdep.h +++ b/src/afs/DARWIN/osi_machdep.h @@ -21,7 +21,7 @@ #ifdef XAFS_DARWIN_ENV #ifndef _MACH_ETAP_H_ #define _MACH_ETAP_H_ -typedef unsigned short etap_event_t; +typedef unsigned short etap_event_t; #endif #endif @@ -37,7 +37,7 @@ typedef unsigned short etap_event_t; #define FTRUNC 0 /* vcexcl - used only by afs_create */ -enum vcexcl { EXCL, NONEXCL } ; +enum vcexcl { EXCL, NONEXCL }; /* * Time related macros @@ -103,8 +103,8 @@ extern struct lock__bsd__ afs_global_lock; #define AFS_APPL_UFS_CACHE 1 #define AFS_APPL_HFS_CACHE 2 -extern ino_t VnodeToIno(vnode_t *vp); -extern dev_t VnodeToDev(vnode_t *vp); +extern ino_t VnodeToIno(vnode_t * vp); +extern dev_t VnodeToDev(vnode_t * vp); #endif /* KERNEL */ diff --git a/src/afs/DARWIN/osi_misc.c b/src/afs/DARWIN/osi_misc.c index 4a23bbd6c..f5afaec76 100644 --- a/src/afs/DARWIN/osi_misc.c +++ b/src/afs/DARWIN/osi_misc.c @@ -8,37 +8,39 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_misc.c,v 1.1.1.3 2001/07/14 22:20:01 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DARWIN/osi_misc.c,v 1.5 2003/07/15 23:14:17 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" +#include "afs/sysincludes.h" +#include "afsincludes.h" #include -int osi_lookupname(char *aname, enum uio_seg seg, int followlink, - struct vnode **dirvpp, struct vnode **vpp) +int +osi_lookupname(char *aname, enum uio_seg seg, int followlink, + struct vnode **dirvpp, struct vnode **vpp) { - struct nameidata n; - int flags,error; - flags=0; - flags=LOCKLEAF; - if (followlink) - flags|=FOLLOW; - else - flags|=NOFOLLOW; -/* if (dirvpp) flags|=WANTPARENT;*/ /* XXX LOCKPARENT? */ - NDINIT(&n, LOOKUP, flags, seg, aname, current_proc()); - if (error=namei(&n)) - return error; - *vpp=n.ni_vp; + struct nameidata n; + int flags, error; + flags = 0; + flags = LOCKLEAF; + if (followlink) + flags |= FOLLOW; + else + flags |= NOFOLLOW; + /* if (dirvpp) flags|=WANTPARENT; *//* XXX LOCKPARENT? */ + NDINIT(&n, LOOKUP, flags, seg, aname, current_proc()); + if (error = namei(&n)) + return error; + *vpp = n.ni_vp; /* if (dirvpp) *dirvpp = n.ni_dvp; #/ /* should we do this? */ - VOP_UNLOCK(n.ni_vp, 0, current_proc()); - return 0; + VOP_UNLOCK(n.ni_vp, 0, current_proc()); + return 0; } /* @@ -47,12 +49,13 @@ int osi_lookupname(char *aname, enum uio_seg seg, int followlink, * Note that it must NOT set errno. */ -afs_suser() { +afs_suser() +{ int error; - struct proc *p=current_proc(); + struct proc *p = current_proc(); if ((error = suser(p->p_ucred, &p->p_acflag)) == 0) { - return(1); + return (1); } - return(0); + return (0); } diff --git a/src/afs/DARWIN/osi_module.c b/src/afs/DARWIN/osi_module.c index 5de3cf224..4a490e2b8 100644 --- a/src/afs/DARWIN/osi_module.c +++ b/src/afs/DARWIN/osi_module.c @@ -1,14 +1,15 @@ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_module.c,v 1.1.1.6 2002/09/26 18:58:04 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DARWIN/osi_module.c,v 1.10 2003/07/15 23:14:18 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#ifdef AFS_DARWIN60_ENV /* not in Kernel.framework anymore !?! */ +#include "afs/sysincludes.h" +#include "afsincludes.h" +#ifdef AFS_DARWIN60_ENV /* not in Kernel.framework anymore !?! */ #include #else -#include "../sys/syscall.h" +#include "sys/syscall.h" #endif #include @@ -22,44 +23,48 @@ extern int afs3_syscall(); extern int ioctl(); extern int setgroups(); extern int maxvfsconf; -kern_return_t afs_modload(struct kmod_info *ki, void *data) +kern_return_t +afs_modload(struct kmod_info *ki, void *data) { - if (sysent[AFS_SYSCALL].sy_call != nosys) { - printf("AFS_SYSCALL in use. aborting\n"); - return KERN_FAILURE; - } - memset(&afs_vfsconf, 0, sizeof(struct vfsconf)); - strcpy(afs_vfsconf.vfc_name, "afs"); - afs_vfsconf.vfc_vfsops=&afs_vfsops; - afs_vfsconf.vfc_typenum=maxvfsconf++;/* oddly not VT_AFS */ - afs_vfsconf.vfc_flags=MNT_NODEV; - if (vfsconf_add(&afs_vfsconf)) { - printf("AFS: vfsconf_add failed. aborting\n"); - return KERN_FAILURE; - } - sysent[SYS_setgroups].sy_call=Afs_xsetgroups; - sysent[SYS_ioctl].sy_call=afs_xioctl; - sysent[AFS_SYSCALL].sy_call=afs3_syscall; - sysent[AFS_SYSCALL].sy_narg = 5; - sysent[AFS_SYSCALL].sy_parallel = 0; + if (sysent[AFS_SYSCALL].sy_call != nosys) { + printf("AFS_SYSCALL in use. aborting\n"); + return KERN_FAILURE; + } + memset(&afs_vfsconf, 0, sizeof(struct vfsconf)); + strcpy(afs_vfsconf.vfc_name, "afs"); + afs_vfsconf.vfc_vfsops = &afs_vfsops; + afs_vfsconf.vfc_typenum = maxvfsconf++; /* oddly not VT_AFS */ + afs_vfsconf.vfc_flags = MNT_NODEV; + if (vfsconf_add(&afs_vfsconf)) { + printf("AFS: vfsconf_add failed. aborting\n"); + return KERN_FAILURE; + } + sysent[SYS_setgroups].sy_call = Afs_xsetgroups; + sysent[SYS_ioctl].sy_call = afs_xioctl; + sysent[AFS_SYSCALL].sy_call = afs3_syscall; + sysent[AFS_SYSCALL].sy_narg = 5; + sysent[AFS_SYSCALL].sy_parallel = 0; #ifdef KERNEL_FUNNEL - sysent[AFS_SYSCALL].sy_funnel=KERNEL_FUNNEL; + sysent[AFS_SYSCALL].sy_funnel = KERNEL_FUNNEL; #endif - return KERN_SUCCESS; + return KERN_SUCCESS; } -kern_return_t afs_modunload(struct kmod_info *ki, void *data) + +kern_return_t +afs_modunload(struct kmod_info * ki, void *data) { - if (afs_globalVFS) - return KERN_FAILURE; - if (vfsconf_del("afs")) - return KERN_FAILURE; - /* give up syscall entries for ioctl & setgroups, which we've stolen */ - sysent[SYS_ioctl].sy_call = ioctl; - sysent[SYS_setgroups].sy_call = setgroups; - /* give up the stolen syscall entry */ - sysent[AFS_SYSCALL].sy_narg = 0; - sysent[AFS_SYSCALL].sy_call = nosys; - return KERN_SUCCESS; - } + if (afs_globalVFS) + return KERN_FAILURE; + if (vfsconf_del("afs")) + return KERN_FAILURE; + /* give up syscall entries for ioctl & setgroups, which we've stolen */ + sysent[SYS_ioctl].sy_call = ioctl; + sysent[SYS_setgroups].sy_call = setgroups; + /* give up the stolen syscall entry */ + sysent[AFS_SYSCALL].sy_narg = 0; + sysent[AFS_SYSCALL].sy_call = nosys; + return KERN_SUCCESS; +} -KMOD_EXPLICIT_DECL(org.openafs.filesystems.afs, VERSION, afs_modload, afs_modunload) +KMOD_EXPLICIT_DECL(org.openafs.filesystems.afs, VERSION, afs_modload, + afs_modunload) diff --git a/src/afs/DARWIN/osi_prototypes.h b/src/afs/DARWIN/osi_prototypes.h index ed68243c1..012036e4d 100644 --- a/src/afs/DARWIN/osi_prototypes.h +++ b/src/afs/DARWIN/osi_prototypes.h @@ -14,9 +14,12 @@ #ifndef _OSI_PROTO_H_ #define _OSI_PROTO_H_ +/* osi_file.c */ +extern afs_rwlock_t afs_xosi; + /* osi_misc.c */ extern int osi_lookupname(char *aname, enum uio_seg seg, int followlink, - struct vnode **dirvpp, struct vnode **vpp); + struct vnode **dirvpp, struct vnode **vpp); /* osi_vm.c */ extern void osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size); extern int osi_VM_Setup(struct vcache *avc, int force); diff --git a/src/afs/DARWIN/osi_sleep.c b/src/afs/DARWIN/osi_sleep.c index 5025b12f4..c9788a2f2 100644 --- a/src/afs/DARWIN/osi_sleep.c +++ b/src/afs/DARWIN/osi_sleep.c @@ -8,37 +8,39 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_sleep.c,v 1.1.1.4 2002/01/22 19:48:05 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DARWIN/osi_sleep.c,v 1.9 2003/07/15 23:14:18 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok); -void afs_osi_Wakeup(char *event); -void afs_osi_Sleep(char *event); static char waitV; -void afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) +void +afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) { AFS_STATCNT(osi_InitWaitHandle); achandle->proc = (caddr_t) 0; } /* cancel osi_Wait */ -void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) +void +afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) { caddr_t proc; AFS_STATCNT(osi_CancelWait); proc = achandle->proc; - if (proc == 0) return; - achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ + if (proc == 0) + return; + achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ afs_osi_Wakeup(&waitV); } @@ -46,22 +48,24 @@ void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) * Waits for data on ahandle, or ams ms later. ahandle may be null. * Returns 0 if timeout and EINTR if signalled. */ -int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) +int +afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) { int code; afs_int32 endTime, tid; - struct proc *p=current_proc(); + struct proc *p = current_proc(); AFS_STATCNT(osi_Wait); - endTime = osi_Time() + (ams/1000); + endTime = osi_Time() + (ams / 1000); if (ahandle) - ahandle->proc = (caddr_t)p; + ahandle->proc = (caddr_t) p; do { AFS_ASSERT_GLOCK(); code = 0; code = osi_TimedSleep(&waitV, ams, aintok); - if (code) break; /* if something happened, quit now */ + if (code) + break; /* if something happened, quit now */ /* if we we're cancelled, quit now */ if (ahandle && (ahandle->proc == (caddr_t) 0)) { /* we've been signalled */ @@ -74,22 +78,23 @@ int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) typedef struct afs_event { - struct afs_event *next; /* next in hash chain */ - char *event; /* lwp event: an address */ - int refcount; /* Is it in use? */ - int seq; /* Sequence number: this is incremented - by wakeup calls; wait will not return until - it changes */ + struct afs_event *next; /* next in hash chain */ + char *event; /* lwp event: an address */ + int refcount; /* Is it in use? */ + int seq; /* Sequence number: this is incremented + * by wakeup calls; wait will not return until + * it changes */ } afs_event_t; #define HASHSIZE 128 -afs_event_t *afs_evhasht[HASHSIZE];/* Hash table for events */ +afs_event_t *afs_evhasht[HASHSIZE]; /* Hash table for events */ #define afs_evhash(event) (afs_uint32) ((((long)event)>>2) & (HASHSIZE-1)); int afs_evhashcnt = 0; /* Get and initialize event structure corresponding to lwp event (i.e. address) * */ -static afs_event_t *afs_getevent(char *event) +static afs_event_t * +afs_getevent(char *event) { afs_event_t *evp, *newp = 0; int hashcode; @@ -107,7 +112,7 @@ static afs_event_t *afs_getevent(char *event) evp = evp->next; } if (!newp) { - newp = (afs_event_t *) osi_AllocSmallSpace(sizeof (afs_event_t)); + newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t)); afs_evhashcnt++; newp->next = afs_evhasht[hashcode]; afs_evhasht[hashcode] = newp; @@ -122,7 +127,8 @@ static afs_event_t *afs_getevent(char *event) #define relevent(evp) ((evp)->refcount--) -void afs_osi_Sleep(char *event) +void +afs_osi_Sleep(void *event) { struct afs_event *evp; int seq; @@ -133,10 +139,10 @@ void afs_osi_Sleep(char *event) AFS_ASSERT_GLOCK(); AFS_GUNLOCK(); #ifdef AFS_DARWIN14_ENV - /* this is probably safe for all versions, but testing is hard */ - sleep(event, PVFS); + /* this is probably safe for all versions, but testing is hard */ + sleep(event, PVFS); #else - assert_wait((event_t)event, 0); + assert_wait((event_t) event, 0); thread_block(0); #endif AFS_GLOCK(); @@ -144,6 +150,13 @@ void afs_osi_Sleep(char *event) relevent(evp); } +int +afs_osi_SleepSig(void *event) +{ + afs_osi_Sleep(event); + return 0; +} + /* osi_TimedSleep * * Arguments: @@ -153,61 +166,66 @@ void afs_osi_Sleep(char *event) * * Returns 0 if timeout and EINTR if signalled. */ -static int osi_TimedSleep(char *event, afs_int32 ams, int aintok) +static int +osi_TimedSleep(char *event, afs_int32 ams, int aintok) { int code = 0; struct afs_event *evp; - int ticks,seq; + int ticks, seq; int prio; - ticks = ( ams * afs_hz )/1000; + ticks = (ams * afs_hz) / 1000; evp = afs_getevent(event); - seq=evp->seq; + seq = evp->seq; AFS_GUNLOCK(); #ifdef AFS_DARWIN14_ENV /* this is probably safe for all versions, but testing is hard. */ /* using tsleep instead of assert_wait/thread_set_timer/thread_block - allows shutdown to work in 1.4 */ + * allows shutdown to work in 1.4 */ /* lack of PCATCH does *not* prevent signal delivery, neither does - a low priority. We would need to deal with ERESTART here if we - wanted to mess with p->p_sigmask, and messing with p_sigignore is - not the way to go.... (someone correct me if I'm wrong) - */ + * a low priority. We would need to deal with ERESTART here if we + * wanted to mess with p->p_sigmask, and messing with p_sigignore is + * not the way to go.... (someone correct me if I'm wrong) + */ if (aintok) - prio=PCATCH|PPAUSE; + prio = PCATCH | PPAUSE; else - prio=PVFS; - code=tsleep(event, prio, "afs_osi_TimedSleep", ticks); -#else - assert_wait((event_t)event, aintok ? THREAD_ABORTSAFE : THREAD_UNINT); + prio = PVFS; + code = tsleep(event, prio, "afs_osi_TimedSleep", ticks); +#else + assert_wait((event_t) event, aintok ? THREAD_ABORTSAFE : THREAD_UNINT); thread_set_timer(ticks, NSEC_PER_SEC / hz); thread_block(0); - code=0; + code = 0; #endif AFS_GLOCK(); if (seq == evp->seq) code = EINTR; - + relevent(evp); return code; } -void afs_osi_Wakeup(char *event) +int +afs_osi_Wakeup(void *event) { struct afs_event *evp; - + int ret = 1; + evp = afs_getevent(event); if (evp->refcount > 1) { - evp->seq++; + evp->seq++; #ifdef AFS_DARWIN14_ENV - /* this is probably safe for all versions, but testing is hard. */ - wakeup(event); + /* this is probably safe for all versions, but testing is hard. */ + wakeup(event); #else - thread_wakeup((event_t)event); + thread_wakeup((event_t) event); #endif + ret = 0; } relevent(evp); + return ret; } diff --git a/src/afs/DARWIN/osi_vfsops.c b/src/afs/DARWIN/osi_vfsops.c index f62d31f30..f5c15eb81 100644 --- a/src/afs/DARWIN/osi_vfsops.c +++ b/src/afs/DARWIN/osi_vfsops.c @@ -4,11 +4,12 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vfsops.c,v 1.1.1.7 2004/01/10 20:52:50 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vfsops.c,v 1.11 2003/10/24 06:26:01 shadow Exp $"); -#include /* Standard vendor system headers */ -#include /* Afs-based standard headers */ -#include /* statistics */ +#include /* Standard vendor system headers */ +#include /* Afs-based standard headers */ +#include /* statistics */ #include #include #include @@ -22,47 +23,47 @@ struct mount *afs_globalVFS = 0; int afs_quotactl() { - return EOPNOTSUPP; + return EOPNOTSUPP; } int afs_fhtovp(mp, fhp, vpp) -struct mount *mp; -struct fid *fhp; -struct vnode **vpp; + struct mount *mp; + struct fid *fhp; + struct vnode **vpp; { - return (EINVAL); + return (EINVAL); } int afs_vptofh(vp, fhp) -struct vnode *vp; -struct fid *fhp; + struct vnode *vp; + struct fid *fhp; { - return (EINVAL); + return (EINVAL); } int afs_start(mp, flags, p) -struct mount *mp; -int flags; -struct proc *p; + struct mount *mp; + int flags; + struct proc *p; { - return (0); /* nothing to do. ? */ + return (0); /* nothing to do. ? */ } int afs_mount(mp, path, data, ndp, p) -register struct mount *mp; -char *path; -caddr_t data; -struct nameidata *ndp; -struct proc *p; + register struct mount *mp; + char *path; + caddr_t data; + struct nameidata *ndp; + struct proc *p; { /* ndp contains the mounted-from device. Just ignore it. - we also don't care about our proc struct. */ + * we also don't care about our proc struct. */ size_t size; int error; @@ -72,7 +73,7 @@ struct proc *p; AFS_GLOCK(); AFS_STATCNT(afs_mount); - if (data == NULL && afs_globalVFS) { /* Don't allow remounts. */ + if (data == NULL && afs_globalVFS) { /* Don't allow remounts. */ AFS_GUNLOCK(); return (EBUSY); } @@ -80,27 +81,27 @@ struct proc *p; afs_globalVFS = mp; mp->vfs_bsize = 8192; vfs_getnewfsid(mp); - mp->mnt_stat.f_iosize=8192; - - (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN-1, &size); + mp->mnt_stat.f_iosize = 8192; + + (void)copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); memset(mp->mnt_stat.f_mntonname + size, 0, MNAMELEN - size); memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN); if (data == NULL) { strcpy(mp->mnt_stat.f_mntfromname, "AFS"); /* null terminated string "AFS" will fit, just leave it be. */ - mp->mnt_data = (qaddr_t)NULL; + mp->mnt_data = (qaddr_t) NULL; } else { struct VenusFid *rootFid = NULL; struct volume *tvp; char volName[MNAMELEN]; - (void) copyinstr((char *)data, volName, MNAMELEN-1, &size); + (void)copyinstr((char *)data, volName, MNAMELEN - 1, &size); memset(volName + size, 0, MNAMELEN - size); if (volName[0] == 0) { strcpy(mp->mnt_stat.f_mntfromname, "AFS"); - mp->mnt_data = (qaddr_t)&afs_rootFid; + mp->mnt_data = (qaddr_t) & afs_rootFid; } else { struct cell *localcell = afs_GetPrimaryCell(READ_LOCK); if (localcell == NULL) { @@ -109,15 +110,16 @@ struct proc *p; } /* Set the volume identifier to "AFS:volume.name" */ - snprintf(mp->mnt_stat.f_mntfromname, MNAMELEN-1, "AFS:%s", + snprintf(mp->mnt_stat.f_mntfromname, MNAMELEN - 1, "AFS:%s", volName); - tvp = afs_GetVolumeByName(volName, localcell->cellNum, 1, - (struct vrequest *)0, READ_LOCK); - + tvp = + afs_GetVolumeByName(volName, localcell->cellNum, 1, + (struct vrequest *)0, READ_LOCK); + if (tvp) { int volid = (tvp->roVol ? tvp->roVol : tvp->volume); - MALLOC(rootFid, struct VenusFid *, sizeof(*rootFid), - M_UFSMNT, M_WAITOK); + MALLOC(rootFid, struct VenusFid *, sizeof(*rootFid), M_UFSMNT, + M_WAITOK); rootFid->Cell = localcell->cellNum; rootFid->Fid.Volume = volid; rootFid->Fid.Vnode = 1; @@ -126,30 +128,30 @@ struct proc *p; AFS_GUNLOCK(); return ENODEV; } - - mp->mnt_data = (qaddr_t)rootFid; + + mp->mnt_data = (qaddr_t) rootFid; } } strcpy(mp->mnt_stat.f_fstypename, "afs"); AFS_GUNLOCK(); - (void) afs_statfs(mp, &mp->mnt_stat, p); + (void)afs_statfs(mp, &mp->mnt_stat, p); return 0; } int afs_unmount(mp, flags, p) -struct mount *mp; -int flags; -struct proc *p; + struct mount *mp; + int flags; + struct proc *p; { - + AFS_GLOCK(); AFS_STATCNT(afs_unmount); - if (mp->mnt_data != (qaddr_t)-1) { + if (mp->mnt_data != (qaddr_t) - 1) { if (mp->mnt_data != NULL) { FREE(mp->mnt_data, M_UFSMNT); - mp->mnt_data = (qaddr_t)-1; + mp->mnt_data = (qaddr_t) - 1; } else { if (flags & MNT_FORCE) { afs_globalVFS = 0; @@ -168,52 +170,54 @@ struct proc *p; } int -afs_root(struct mount *mp, - struct vnode **vpp) +afs_root(struct mount *mp, struct vnode **vpp) { int error; struct vrequest treq; - register struct vcache *tvp=0; - struct proc *p=current_proc(); + register struct vcache *tvp = 0; + struct proc *p = current_proc(); struct ucred cr; pcred_readlock(p); - cr=*p->p_cred->pc_ucred; + cr = *p->p_cred->pc_ucred; pcred_unlock(p); AFS_GLOCK(); AFS_STATCNT(afs_root); - if (mp->mnt_data == NULL - && afs_globalVp && (afs_globalVp->states & CStatd)) { + if (mp->mnt_data == NULL && afs_globalVp + && (afs_globalVp->states & CStatd)) { tvp = afs_globalVp; - error=0; - } else if (mp->mnt_data == (qaddr_t)-1) { + error = 0; + } else if (mp->mnt_data == (qaddr_t) - 1) { error = ENOENT; } else { struct VenusFid *rootFid = (mp->mnt_data == NULL) ? &afs_rootFid : (struct VenusFid *)mp->mnt_data; - - if (!(error = afs_InitReq(&treq, &cr)) && - !(error = afs_CheckInit())) { - tvp = afs_GetVCache(rootFid, &treq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); + + if (afs_globalVp) { + afs_PutVCache(afs_globalVp); + afs_globalVp = NULL; + } + + if (!(error = afs_InitReq(&treq, &cr)) && !(error = afs_CheckInit())) { + tvp = afs_GetVCache(rootFid, &treq, NULL, NULL); /* we really want this to stay around */ if (tvp) { if (mp->mnt_data == NULL) afs_globalVp = tvp; } else - error = ENOENT; + error = ENOENT; } } if (tvp) { - osi_vnhold(tvp,0); - AFS_GUNLOCK(); - vn_lock(AFSTOV(tvp), LK_EXCLUSIVE | LK_RETRY, p); - AFS_GLOCK(); - if (mp->mnt_data == NULL) { + osi_vnhold(tvp, 0); + AFS_GUNLOCK(); + vn_lock(AFSTOV(tvp), LK_EXCLUSIVE | LK_RETRY, p); + AFS_GLOCK(); + if (mp->mnt_data == NULL) { afs_globalVFS = mp; - } + } *vpp = AFSTOV(tvp); - AFSTOV(tvp)->v_flag |= VROOT; + AFSTOV(tvp)->v_flag |= VROOT; AFSTOV(tvp)->v_vfsp = mp; } @@ -225,9 +229,9 @@ afs_root(struct mount *mp, int afs_vget(mp, lfl, vp) -struct mount *mp; -struct vnode *vp; -int lfl; + struct mount *mp; + struct vnode *vp; + int lfl; { int error; printf("vget called. help!\n"); @@ -237,11 +241,12 @@ int lfl; } error = vget(vp, lfl, current_proc()); if (!error) - insmntque(vp, mp); /* take off free list */ + insmntque(vp, mp); /* take off free list */ return error; } -int afs_statfs(struct mount *mp, struct statfs *abp, struct proc *p) +int +afs_statfs(struct mount *mp, struct statfs *abp, struct proc *p) { AFS_GLOCK(); AFS_STATCNT(afs_statfs); @@ -257,144 +262,141 @@ int afs_statfs(struct mount *mp, struct statfs *abp, struct proc *p) * storing something there. */ abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files = - abp->f_ffree = 2000000; + abp->f_ffree = 2000000; abp->f_fsid.val[0] = mp->mnt_stat.f_fsid.val[0]; abp->f_fsid.val[1] = mp->mnt_stat.f_fsid.val[1]; if (abp != &mp->mnt_stat) { abp->f_type = mp->mnt_vfc->vfc_typenum; - memcpy((caddr_t)&abp->f_mntonname[0], (caddr_t)mp->mnt_stat.f_mntonname, MNAMELEN); - memcpy((caddr_t)&abp->f_mntfromname[0], (caddr_t)mp->mnt_stat.f_mntfromname, MNAMELEN); + memcpy((caddr_t) & abp->f_mntonname[0], + (caddr_t) mp->mnt_stat.f_mntonname, MNAMELEN); + memcpy((caddr_t) & abp->f_mntfromname[0], + (caddr_t) mp->mnt_stat.f_mntfromname, MNAMELEN); } AFS_GUNLOCK(); return 0; } -int afs_sync(mp, waitfor, cred, p) -struct mount *mp; -int waitfor; -struct ucred *cred; -struct prioc *p; +int +afs_sync(mp, waitfor, cred, p) + struct mount *mp; + int waitfor; + struct ucred *cred; + struct prioc *p; { -return 0; + return 0; } u_int32_t afs_darwin_realmodes = 0; -int afs_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) -int *name; -u_int namelen; -void *oldp; -size_t *oldlenp; -void *newp; -size_t newlen; -struct proc *p; +int afs_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, + void *newp, size_t newlen, struct proc *p) { int error; switch (name[0]) { case AFS_SC_ALL: - /* nothing defined */ - break; + /* nothing defined */ + break; case AFS_SC_DARWIN: - if (namelen < 3) + if (namelen < 3) return ENOENT; switch (name[1]) { case AFS_SC_DARWIN_ALL: switch (name[2]) { case AFS_SC_DARWIN_ALL_REALMODES: - return sysctl_int(oldp, oldlenp, newp, newlen, - &afs_darwin_realmodes); + return sysctl_int(oldp, oldlenp, newp, newlen, + &afs_darwin_realmodes); } break; - /* darwin version specific sysctl's goes here */ + /* darwin version specific sysctl's goes here */ } break; } return EOPNOTSUPP; } - -typedef (*PFI)(); -extern int vfs_opv_numops; /* The total number of defined vnode operations */ +typedef (*PFI) (); +extern int vfs_opv_numops; /* The total number of defined vnode operations */ extern struct vnodeopv_desc afs_vnodeop_opv_desc; -int afs_init(struct vfsconf *vfc) { - int j; - int (**opv_desc_vector)(); - struct vnodeopv_entry_desc *opve_descp; - - - - MALLOC(afs_vnodeop_p, PFI *, vfs_opv_numops*sizeof(PFI), M_TEMP, M_WAITOK); - - memset(afs_vnodeop_p, 0, vfs_opv_numops*sizeof(PFI)); - - opv_desc_vector = afs_vnodeop_p; - for (j=0; afs_vnodeop_opv_desc.opv_desc_ops[j].opve_op; j++) { - opve_descp = &(afs_vnodeop_opv_desc.opv_desc_ops[j]); - - /* - * Sanity check: is this operation listed - * in the list of operations? We check this - * by seeing if its offest is zero. Since - * the default routine should always be listed - * first, it should be the only one with a zero - * offset. Any other operation with a zero - * offset is probably not listed in - * vfs_op_descs, and so is probably an error. - * - * A panic here means the layer programmer - * has committed the all-too common bug - * of adding a new operation to the layer's - * list of vnode operations but - * not adding the operation to the system-wide - * list of supported operations. - */ - if (opve_descp->opve_op->vdesc_offset == 0 && - opve_descp->opve_op->vdesc_offset != VOFFSET(vop_default)) { - printf("afs_init: operation %s not listed in %s.\n", - opve_descp->opve_op->vdesc_name, - "vfs_op_descs"); - panic ("load_afs: bad operation"); - } - /* - * Fill in this entry. - */ - opv_desc_vector[opve_descp->opve_op->vdesc_offset] = - opve_descp->opve_impl; - } - - /* - * Finally, go back and replace unfilled routines - * with their default. (Sigh, an O(n^3) algorithm. I - * could make it better, but that'd be work, and n is small.) - */ - - /* - * Force every operations vector to have a default routine. - */ - opv_desc_vector = afs_vnodeop_p; - if (opv_desc_vector[VOFFSET(vop_default)]==NULL) { - panic("afs_init: operation vector without default routine."); - } - for (j = 0;jopve_op->vdesc_offset == 0 + && opve_descp->opve_op->vdesc_offset != VOFFSET(vop_default)) { + printf("afs_init: operation %s not listed in %s.\n", + opve_descp->opve_op->vdesc_name, "vfs_op_descs"); + panic("load_afs: bad operation"); + } + /* + * Fill in this entry. + */ + opv_desc_vector[opve_descp->opve_op->vdesc_offset] = + opve_descp->opve_impl; + } + + /* + * Finally, go back and replace unfilled routines + * with their default. (Sigh, an O(n^3) algorithm. I + * could make it better, but that'd be work, and n is small.) + */ + + /* + * Force every operations vector to have a default routine. + */ + opv_desc_vector = afs_vnodeop_p; + if (opv_desc_vector[VOFFSET(vop_default)] == NULL) { + panic("afs_init: operation vector without default routine."); + } + for (j = 0; j < vfs_opv_numops; j++) + if (opv_desc_vector[j] == NULL) + opv_desc_vector[j] = opv_desc_vector[VOFFSET(vop_default)]; } struct vfsops afs_vfsops = { - afs_mount, - afs_start, - afs_unmount, - afs_root, - afs_quotactl, - afs_statfs, - afs_sync, - afs_vget, - afs_fhtovp, - afs_vptofh, - afs_init, - afs_sysctl + afs_mount, + afs_start, + afs_unmount, + afs_root, + afs_quotactl, + afs_statfs, + afs_sync, + afs_vget, + afs_fhtovp, + afs_vptofh, + afs_init, + afs_sysctl }; diff --git a/src/afs/DARWIN/osi_vm.c b/src/afs/DARWIN/osi_vm.c index f52b152e6..be31ed6a6 100644 --- a/src/afs/DARWIN/osi_vm.c +++ b/src/afs/DARWIN/osi_vm.c @@ -8,13 +8,14 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vm.c,v 1.1.1.7 2002/09/26 18:58:05 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vm.c,v 1.11 2003/07/15 23:14:18 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ #include /* Try to discard pages, in order to recycle a vcache entry. @@ -34,11 +35,9 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vm.c,v 1.1.1.7 2002/09/2 * OSF/1 Locking: VN_LOCK has been called. */ int -osi_VM_FlushVCache(avc, slept) - struct vcache *avc; - int *slept; +osi_VM_FlushVCache(struct vcache *avc, int *slept) { - struct vnode *vp=AFSTOV(avc); + struct vnode *vp = AFSTOV(avc); #ifdef AFS_DARWIN14_ENV if (UBCINFOEXISTS(vp)) return EBUSY; @@ -56,13 +55,12 @@ osi_VM_FlushVCache(avc, slept) AFS_GUNLOCK(); cache_purge(vp); #ifndef AFS_DARWIN14_ENV - if (UBCINFOEXISTS(vp)) - { - ubc_clean(vp, 1); - ubc_uncache(vp); - ubc_release(vp); - ubc_info_free(vp); - } + if (UBCINFOEXISTS(vp)) { + ubc_clean(vp, 1); + ubc_uncache(vp); + ubc_release(vp); + ubc_info_free(vp); + } #endif AFS_GLOCK(); @@ -77,17 +75,16 @@ osi_VM_FlushVCache(avc, slept) * re-obtained. */ void -osi_VM_StoreAllSegments(avc) - struct vcache *avc; +osi_VM_StoreAllSegments(struct vcache *avc) { - struct vnode *vp=AFSTOV(avc); + struct vnode *vp = AFSTOV(avc); ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); if (UBCINFOEXISTS(vp)) { ubc_pushdirty(vp); } AFS_GLOCK(); - ObtainWriteLock(&avc->lock,94); + ObtainWriteLock(&avc->lock, 94); } /* Try to invalidate pages, for "fs flush" or "fs flushv"; or @@ -100,26 +97,23 @@ osi_VM_StoreAllSegments(avc) * be some pages around when we return, newly created by concurrent activity. */ void -osi_VM_TryToSmush(avc, acred, sync) - struct vcache *avc; - struct AFS_UCRED *acred; - int sync; +osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync) { - struct vnode *vp=AFSTOV(avc); + struct vnode *vp = AFSTOV(avc); void *object; kern_return_t kret; off_t size, lastpg; - + ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); - if (UBCINFOEXISTS(vp)) { - size=ubc_getsize(vp); - kret=ubc_invalidate(vp,0,size); - if (kret != 1) /* should be KERN_SUCCESS */ - printf("TryToSmush: invalidate failed (error = %d)\n", kret); + if (UBCINFOEXISTS(vp)) { + size = ubc_getsize(vp); + kret = ubc_invalidate(vp, 0, size); + if (kret != 1) /* should be KERN_SUCCESS */ + printf("TryToSmush: invalidate failed (error = %d)\n", kret); } AFS_GLOCK(); - ObtainWriteLock(&avc->lock,59); + ObtainWriteLock(&avc->lock, 59); } /* Purge VM for a file when its callback is revoked. @@ -130,22 +124,20 @@ osi_VM_TryToSmush(avc, acred, sync) this, and also making sure that ubc's idea of the filesize is right more often */ void -osi_VM_FlushPages(avc, credp) - struct vcache *avc; - struct AFS_UCRED *credp; +osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) { - struct vnode *vp=AFSTOV(avc); + struct vnode *vp = AFSTOV(avc); void *object; kern_return_t kret; off_t size; - if (UBCINFOEXISTS(vp)) { - size=ubc_getsize(vp); - kret=ubc_invalidate(vp,0,size); - if (kret != 1) /* Should be KERN_SUCCESS */ - printf("VMFlushPages: invalidate failed (error = %d)\n", kret); - /* XXX what about when not CStatd */ - if (avc->states & CStatd && size != avc->m.Length) - ubc_setsize(vp, avc->m.Length); + if (UBCINFOEXISTS(vp)) { + size = ubc_getsize(vp); + kret = ubc_invalidate(vp, 0, size); + if (kret != 1) /* Should be KERN_SUCCESS */ + printf("VMFlushPages: invalidate failed (error = %d)\n", kret); + /* XXX what about when not CStatd */ + if (avc->states & CStatd && size != avc->m.Length) + ubc_setsize(vp, avc->m.Length); } } @@ -156,202 +148,199 @@ osi_VM_FlushPages(avc, credp) * it only works on Solaris. */ void -osi_VM_Truncate(avc, alen, acred) - struct vcache *avc; - int alen; - struct AFS_UCRED *acred; +osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) { - struct vnode *vp=AFSTOV(avc); - if (UBCINFOEXISTS(vp)) { + struct vnode *vp = AFSTOV(avc); + if (UBCINFOEXISTS(vp)) { ubc_setsize(vp, alen); } } -extern struct AFS_UCRED afs_osi_cred; -extern afs_rwlock_t afs_xvcache; /* vnreclaim and vinactive are probably not aggressive enough to keep enough afs vcaches free, so we try to do some of it ourselves */ /* XXX there's probably not nearly enough locking here */ -void osi_VM_TryReclaim(avc, slept) - struct vcache *avc; - int *slept; +void +osi_VM_TryReclaim(struct vcache *avc, int *slept) { - struct proc *p=current_proc(); - struct vnode *vp=AFSTOV(avc); + struct proc *p = current_proc(); + struct vnode *vp = AFSTOV(avc); void *obj; if (slept) - *slept=0; - VN_HOLD(vp); /* remove from inactive list */ + *slept = 0; + VN_HOLD(vp); /* remove from inactive list */ if (!simple_lock_try(&vp->v_interlock)) { - AFS_RELE(vp); - return; + AFS_RELE(vp); + return; } if (!UBCINFOEXISTS(vp) || vp->v_count != 2) { - simple_unlock(&vp->v_interlock); - AFS_RELE(vp); - return; + simple_unlock(&vp->v_interlock); + AFS_RELE(vp); + return; } #ifdef AFS_DARWIN14_ENV if (vp->v_ubcinfo->ui_refcount > 1 || vp->v_ubcinfo->ui_mapped) { - simple_unlock(&vp->v_interlock); - AFS_RELE(vp); - return; + simple_unlock(&vp->v_interlock); + AFS_RELE(vp); + return; } #else if (vp->v_ubcinfo->ui_holdcnt) { - simple_unlock(&vp->v_interlock); - AFS_RELE(vp); - return; + simple_unlock(&vp->v_interlock); + AFS_RELE(vp); + return; } #endif if (slept && ubc_issetflags(vp, UI_WASMAPPED)) { - /* We can't possibly release this in time for this NewVCache to get it */ - simple_unlock(&vp->v_interlock); - AFS_RELE(vp); - return; + /* We can't possibly release this in time for this NewVCache to get it */ + simple_unlock(&vp->v_interlock); + AFS_RELE(vp); + return; } - vp->v_usecount--; /* we want the usecount to be 1 */ + vp->v_usecount--; /* we want the usecount to be 1 */ if (slept) { - ReleaseWriteLock(&afs_xvcache); - *slept=1; + ReleaseWriteLock(&afs_xvcache); + *slept = 1; } else - ReleaseReadLock(&afs_xvcache); + ReleaseReadLock(&afs_xvcache); AFS_GUNLOCK(); - obj=0; + obj = 0; if (ubc_issetflags(vp, UI_WASMAPPED)) { - simple_unlock(&vp->v_interlock); + simple_unlock(&vp->v_interlock); #ifdef AFS_DARWIN14_ENV - ubc_release_named(vp); + ubc_release_named(vp); #else - ubc_release(vp); + ubc_release(vp); #endif - if (ubc_issetflags(vp, UI_HASOBJREF)) - printf("ubc_release didn't release the reference?!\n"); - } else if (!vn_lock(vp, LK_EXCLUSIVE|LK_INTERLOCK,current_proc())) { + if (ubc_issetflags(vp, UI_HASOBJREF)) + printf("ubc_release didn't release the reference?!\n"); + } else if (!vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK, current_proc())) { #ifdef AFS_DARWIN14_ENV - obj = ubc_getobject(vp,UBC_HOLDOBJECT); + obj = ubc_getobject(vp, UBC_HOLDOBJECT); #else #ifdef AFS_DARWIN13_ENV - obj = ubc_getobject(vp,(UBC_NOREACTIVATE|UBC_HOLDOBJECT)); + obj = ubc_getobject(vp, (UBC_NOREACTIVATE | UBC_HOLDOBJECT)); #else - obj = ubc_getobject(vp); + obj = ubc_getobject(vp); #endif #endif - (void)ubc_clean(vp, 1); - vinvalbuf(vp, V_SAVE, &afs_osi_cred, p, 0, 0); - if (vp->v_usecount == 1) - VOP_INACTIVE(vp, p); - else - VOP_UNLOCK(vp, 0, p); - if (obj) { - if (ISSET(vp->v_flag, VTERMINATE)) - panic("afs_vnreclaim: already teminating"); - SET(vp->v_flag, VTERMINATE); - memory_object_destroy(obj, 0); - while (ISSET(vp->v_flag, VTERMINATE)) { - SET(vp->v_flag, VTERMWANT); - tsleep((caddr_t)&vp->v_ubcinfo, PINOD, "afs_vnreclaim", 0); - } - } - } else { - if (simple_lock_try(&vp->v_interlock)) - panic("afs_vnreclaim: slept, but did no work :("); - if (UBCINFOEXISTS(vp) && vp->v_count == 1) { - vp->v_usecount++; - simple_unlock(&vp->v_interlock); - VN_RELE(vp); - } else - simple_unlock(&vp->v_interlock); - } - AFS_GLOCK(); - if (slept) - ObtainWriteLock(&afs_xvcache,175); - else - ObtainReadLock(&afs_xvcache); + (void)ubc_clean(vp, 1); + vinvalbuf(vp, V_SAVE, &afs_osi_cred, p, 0, 0); + if (vp->v_usecount == 1) + VOP_INACTIVE(vp, p); + else + VOP_UNLOCK(vp, 0, p); + if (obj) { + if (ISSET(vp->v_flag, VTERMINATE)) + panic("afs_vnreclaim: already teminating"); + SET(vp->v_flag, VTERMINATE); + memory_object_destroy(obj, 0); + while (ISSET(vp->v_flag, VTERMINATE)) { + SET(vp->v_flag, VTERMWANT); + tsleep((caddr_t) & vp->v_ubcinfo, PINOD, "afs_vnreclaim", 0); + } + } + } else { + if (simple_lock_try(&vp->v_interlock)) + panic("afs_vnreclaim: slept, but did no work :("); + if (UBCINFOEXISTS(vp) && vp->v_count == 1) { + vp->v_usecount++; + simple_unlock(&vp->v_interlock); + VN_RELE(vp); + } else + simple_unlock(&vp->v_interlock); + } + AFS_GLOCK(); + if (slept) + ObtainWriteLock(&afs_xvcache, 175); + else + ObtainReadLock(&afs_xvcache); } -void osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size) { - +void +osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size) +{ void *object; struct vcache *avc = VTOAFS(vp); #ifdef AFS_DARWIN14_ENV - offset=trunc_page(offset); - size=round_page(size+1); + offset = trunc_page(offset); + size = round_page(size + 1); while (size) { - ubc_page_op(vp, (vm_offset_t)offset, - UPL_POP_SET | UPL_POP_BUSY | UPL_POP_DUMP, - 0, 0); - size-=PAGE_SIZE; - offset+=PAGE_SIZE; + ubc_page_op(vp, (vm_offset_t) offset, + UPL_POP_SET | UPL_POP_BUSY | UPL_POP_DUMP, 0, 0); + size -= PAGE_SIZE; + offset += PAGE_SIZE; } #else - object=NULL; + object = NULL; #ifdef AFS_DARWIN13_ENV if (UBCINFOEXISTS(vp)) - object = ubc_getobject(vp, UBC_NOREACTIVATE); + object = ubc_getobject(vp, UBC_NOREACTIVATE); #else if (UBCINFOEXISTS(vp)) - object = ubc_getobject(vp); + object = ubc_getobject(vp); #endif if (!object) - return; + return; - offset=trunc_page(offset); - size=round_page(size+1); + offset = trunc_page(offset); + size = round_page(size + 1); #ifdef AFS_DARWIN13_ENV while (size) { - memory_object_page_op(object, (vm_offset_t)offset, - UPL_POP_SET | UPL_POP_BUSY | UPL_POP_DUMP, - 0, 0); - size-=PAGE_SIZE; - offset+=PAGE_SIZE; + memory_object_page_op(object, (vm_offset_t) offset, + UPL_POP_SET | UPL_POP_BUSY | UPL_POP_DUMP, 0, + 0); + size -= PAGE_SIZE; + offset += PAGE_SIZE; } -#else +#else /* This is all we can do, and it's not enough. sucks to be us */ ubc_setsize(vp, offset); - size=(offset + size > avc->m.Length) ? offset + size : avc->m.Length; + size = (offset + size > avc->m.Length) ? offset + size : avc->m.Length; ubc_setsize(vp, size); #endif #endif - } -int osi_VM_Setup(struct vcache *avc, int force) { - int error; - struct vnode *vp=AFSTOV(avc); - if (UBCISVALID(vp) && ((avc->states & CStatd) || force)) { - if (!UBCINFOEXISTS(vp) && !ISSET(vp->v_flag, VTERMINATE)) { - osi_vnhold(avc,0); - avc->states |= CUBCinit; - AFS_GUNLOCK(); - if ((error=ubc_info_init(&avc->v))) { - AFS_GLOCK(); - avc->states &= ~CUBCinit; - AFS_RELE(avc); - return error; - } +int +osi_VM_Setup(struct vcache *avc, int force) +{ + int error; + struct vnode *vp = AFSTOV(avc); + + if (UBCISVALID(vp) && ((avc->states & CStatd) || force)) { + if (!UBCINFOEXISTS(vp) && !ISSET(vp->v_flag, VTERMINATE)) { + osi_vnhold(avc, 0); + avc->states |= CUBCinit; + AFS_GUNLOCK(); + if ((error = ubc_info_init(&avc->v))) { + AFS_GLOCK(); + avc->states &= ~CUBCinit; + AFS_RELE(avc); + return error; + } #ifndef AFS_DARWIN14_ENV - simple_lock(&avc->v.v_interlock); - if (!ubc_issetflags(&avc->v, UI_HASOBJREF)) + simple_lock(&avc->v.v_interlock); + if (!ubc_issetflags(&avc->v, UI_HASOBJREF)) #ifdef AFS_DARWIN13_ENV - if (ubc_getobject(&avc->v, (UBC_NOREACTIVATE|UBC_HOLDOBJECT))) - panic("VM_Setup: null object"); + if (ubc_getobject + (&avc->v, (UBC_NOREACTIVATE | UBC_HOLDOBJECT))) + panic("VM_Setup: null object"); #else - (void)_ubc_getobject(&avc->v, 1); /* return value not used */ + (void)_ubc_getobject(&avc->v, 1); /* return value not used */ #endif - simple_unlock(&avc->v.v_interlock); + simple_unlock(&avc->v.v_interlock); #endif - AFS_GLOCK(); - avc->states &= ~CUBCinit; - AFS_RELE(avc); - } - if (UBCINFOEXISTS(&avc->v)) - ubc_setsize(&avc->v, avc->m.Length); - } - return 0; + AFS_GLOCK(); + avc->states &= ~CUBCinit; + AFS_RELE(avc); + } + if (UBCINFOEXISTS(&avc->v)) + ubc_setsize(&avc->v, avc->m.Length); + } + return 0; } diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c index 18cca9b80..b914bbc5f 100644 --- a/src/afs/DARWIN/osi_vnodeops.c +++ b/src/afs/DARWIN/osi_vnodeops.c @@ -4,11 +4,12 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.1.1.10 2004/01/10 20:52:51 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.16 2004/04/05 06:21:33 shadow Exp $"); -#include /* Standard vendor system headers */ -#include /* Afs-based standard headers */ -#include /* statistics */ +#include /* Standard vendor system headers */ +#include /* Afs-based standard headers */ +#include /* statistics */ #include #include #include @@ -69,65 +70,65 @@ int afs_vop_cmap __P((struct vop_cmap_args *)); #define afs_vop_reallocblks afs_vop_opnotsupp /* Global vfs data structures for AFS. */ -int (**afs_vnodeop_p)(); +int (**afs_vnodeop_p) (); struct vnodeopv_entry_desc afs_vnodeop_entries[] = { - { &vop_default_desc, vn_default_error }, - { &vop_lookup_desc, afs_vop_lookup }, /* lookup */ - { &vop_create_desc, afs_vop_create }, /* create */ - { &vop_mknod_desc, afs_vop_mknod }, /* mknod */ - { &vop_open_desc, afs_vop_open }, /* open */ - { &vop_close_desc, afs_vop_close }, /* close */ - { &vop_access_desc, afs_vop_access }, /* access */ - { &vop_getattr_desc, afs_vop_getattr }, /* getattr */ - { &vop_setattr_desc, afs_vop_setattr }, /* setattr */ - { &vop_read_desc, afs_vop_read }, /* read */ - { &vop_write_desc, afs_vop_write }, /* write */ - { &vop_pagein_desc, afs_vop_pagein }, /* read */ - { &vop_pageout_desc, afs_vop_pageout }, /* write */ - { &vop_ioctl_desc, afs_vop_ioctl }, /* XXX ioctl */ - { &vop_select_desc, afs_vop_select }, /* select */ - { &vop_mmap_desc, afs_vop_mmap }, /* mmap */ - { &vop_fsync_desc, afs_vop_fsync }, /* fsync */ - { &vop_seek_desc, afs_vop_seek }, /* seek */ - { &vop_remove_desc, afs_vop_remove }, /* remove */ - { &vop_link_desc, afs_vop_link }, /* link */ - { &vop_rename_desc, afs_vop_rename }, /* rename */ - { &vop_mkdir_desc, afs_vop_mkdir }, /* mkdir */ - { &vop_rmdir_desc, afs_vop_rmdir }, /* rmdir */ - { &vop_symlink_desc, afs_vop_symlink }, /* symlink */ - { &vop_readdir_desc, afs_vop_readdir }, /* readdir */ - { &vop_readlink_desc, afs_vop_readlink }, /* readlink */ + {&vop_default_desc, vn_default_error}, + {&vop_lookup_desc, afs_vop_lookup}, /* lookup */ + {&vop_create_desc, afs_vop_create}, /* create */ + {&vop_mknod_desc, afs_vop_mknod}, /* mknod */ + {&vop_open_desc, afs_vop_open}, /* open */ + {&vop_close_desc, afs_vop_close}, /* close */ + {&vop_access_desc, afs_vop_access}, /* access */ + {&vop_getattr_desc, afs_vop_getattr}, /* getattr */ + {&vop_setattr_desc, afs_vop_setattr}, /* setattr */ + {&vop_read_desc, afs_vop_read}, /* read */ + {&vop_write_desc, afs_vop_write}, /* write */ + {&vop_pagein_desc, afs_vop_pagein}, /* read */ + {&vop_pageout_desc, afs_vop_pageout}, /* write */ + {&vop_ioctl_desc, afs_vop_ioctl}, /* XXX ioctl */ + {&vop_select_desc, afs_vop_select}, /* select */ + {&vop_mmap_desc, afs_vop_mmap}, /* mmap */ + {&vop_fsync_desc, afs_vop_fsync}, /* fsync */ + {&vop_seek_desc, afs_vop_seek}, /* seek */ + {&vop_remove_desc, afs_vop_remove}, /* remove */ + {&vop_link_desc, afs_vop_link}, /* link */ + {&vop_rename_desc, afs_vop_rename}, /* rename */ + {&vop_mkdir_desc, afs_vop_mkdir}, /* mkdir */ + {&vop_rmdir_desc, afs_vop_rmdir}, /* rmdir */ + {&vop_symlink_desc, afs_vop_symlink}, /* symlink */ + {&vop_readdir_desc, afs_vop_readdir}, /* readdir */ + {&vop_readlink_desc, afs_vop_readlink}, /* readlink */ #if defined(AFS_DARWIN70_ENV) - { &vop_abortop_desc, nop_abortop }, /* abortop */ + { &vop_abortop_desc, nop_abortop }, /* abortop */ #else /* ! defined(AFS_DARWIN70_ENV) */ - /* Yes, we use the ufs_abortop call. It just releases the namei - buffer stuff */ - { &vop_abortop_desc, ufs_abortop }, /* abortop */ + /* Yes, we use the ufs_abortop call. It just releases the namei + * buffer stuff */ + {&vop_abortop_desc, ufs_abortop}, /* abortop */ #endif /* defined(AFS_DARWIN70_ENV) */ - { &vop_inactive_desc, afs_vop_inactive }, /* inactive */ - { &vop_reclaim_desc, afs_vop_reclaim }, /* reclaim */ - { &vop_lock_desc, afs_vop_lock }, /* lock */ - { &vop_unlock_desc, afs_vop_unlock }, /* unlock */ - { &vop_bmap_desc, afs_vop_bmap }, /* bmap */ - { &vop_strategy_desc, afs_vop_strategy }, /* strategy */ - { &vop_print_desc, afs_vop_print }, /* print */ - { &vop_islocked_desc, afs_vop_islocked }, /* islocked */ - { &vop_pathconf_desc, afs_vop_pathconf }, /* pathconf */ - { &vop_advlock_desc, afs_vop_advlock }, /* advlock */ - { &vop_blkatoff_desc, afs_vop_blkatoff }, /* blkatoff */ - { &vop_valloc_desc, afs_vop_valloc }, /* valloc */ - { &vop_reallocblks_desc, afs_vop_reallocblks }, /* reallocblks */ - { &vop_vfree_desc, afs_vop_vfree }, /* vfree */ - { &vop_truncate_desc, afs_vop_truncate }, /* truncate */ - { &vop_update_desc, afs_vop_update }, /* update */ - { &vop_blktooff_desc, afs_vop_blktooff }, /* blktooff */ - { &vop_offtoblk_desc, afs_vop_offtoblk }, /* offtoblk */ - { &vop_cmap_desc, afs_vop_cmap }, /* cmap */ - { &vop_bwrite_desc, vn_bwrite }, - { (struct vnodeop_desc*)NULL, (int(*)())NULL } + {&vop_inactive_desc, afs_vop_inactive}, /* inactive */ + {&vop_reclaim_desc, afs_vop_reclaim}, /* reclaim */ + {&vop_lock_desc, afs_vop_lock}, /* lock */ + {&vop_unlock_desc, afs_vop_unlock}, /* unlock */ + {&vop_bmap_desc, afs_vop_bmap}, /* bmap */ + {&vop_strategy_desc, afs_vop_strategy}, /* strategy */ + {&vop_print_desc, afs_vop_print}, /* print */ + {&vop_islocked_desc, afs_vop_islocked}, /* islocked */ + {&vop_pathconf_desc, afs_vop_pathconf}, /* pathconf */ + {&vop_advlock_desc, afs_vop_advlock}, /* advlock */ + {&vop_blkatoff_desc, afs_vop_blkatoff}, /* blkatoff */ + {&vop_valloc_desc, afs_vop_valloc}, /* valloc */ + {&vop_reallocblks_desc, afs_vop_reallocblks}, /* reallocblks */ + {&vop_vfree_desc, afs_vop_vfree}, /* vfree */ + {&vop_truncate_desc, afs_vop_truncate}, /* truncate */ + {&vop_update_desc, afs_vop_update}, /* update */ + {&vop_blktooff_desc, afs_vop_blktooff}, /* blktooff */ + {&vop_offtoblk_desc, afs_vop_offtoblk}, /* offtoblk */ + {&vop_cmap_desc, afs_vop_cmap}, /* cmap */ + {&vop_bwrite_desc, vn_bwrite}, + {(struct vnodeop_desc *)NULL, (int (*)())NULL} }; struct vnodeopv_desc afs_vnodeop_opv_desc = - { &afs_vnodeop_p, afs_vnodeop_entries }; + { &afs_vnodeop_p, afs_vnodeop_entries }; #define GETNAME() \ struct componentname *cnp = ap->a_cnp; \ @@ -137,29 +138,29 @@ struct vnodeopv_desc afs_vnodeop_opv_desc = name[cnp->cn_namelen] = '\0' #define DROPNAME() FREE(name, M_TEMP) - + int afs_vop_lookup(ap) -struct vop_lookup_args /* { - struct vnodeop_desc * a_desc; - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - } */ *ap; + struct vop_lookup_args /* { + * struct vnodeop_desc * a_desc; + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * } */ *ap; { int error; struct vcache *vcp; struct vnode *vp, *dvp; register int flags = ap->a_cnp->cn_flags; - int lockparent; /* 1 => lockparent flag is set */ - int wantparent; /* 1 => wantparent or lockparent flag */ + int lockparent; /* 1 => lockparent flag is set */ + int wantparent; /* 1 => wantparent or lockparent flag */ struct proc *p; GETNAME(); - p=cnp->cn_proc; + p = cnp->cn_proc; lockparent = flags & LOCKPARENT; - wantparent = flags & (LOCKPARENT|WANTPARENT); + wantparent = flags & (LOCKPARENT | WANTPARENT); if (ap->a_dvp->v_type != VDIR) { *ap->a_vpp = 0; @@ -167,16 +168,16 @@ struct vop_lookup_args /* { return ENOTDIR; } dvp = ap->a_dvp; - if (flags & ISDOTDOT) - VOP_UNLOCK(dvp, 0, p); + if (flags & ISDOTDOT) + VOP_UNLOCK(dvp, 0, p); AFS_GLOCK(); error = afs_lookup(VTOAFS(dvp), name, &vcp, cnp->cn_cred); AFS_GUNLOCK(); if (error) { - if (flags & ISDOTDOT) - VOP_LOCK(dvp, LK_EXCLUSIVE | LK_RETRY, p); - if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME) && - (flags & ISLASTCN) && error == ENOENT) + if (flags & ISDOTDOT) + VOP_LOCK(dvp, LK_EXCLUSIVE | LK_RETRY, p); + if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME) + && (flags & ISLASTCN) && error == ENOENT) error = EJUSTRETURN; if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) cnp->cn_flags |= SAVENAME; @@ -184,35 +185,35 @@ struct vop_lookup_args /* { *ap->a_vpp = 0; return (error); } - vp = AFSTOV(vcp); /* always get a node if no error */ + vp = AFSTOV(vcp); /* always get a node if no error */ vp->v_vfsp = dvp->v_vfsp; /* The parent directory comes in locked. We unlock it on return - unless the caller wants it left locked. - we also always return the vnode locked. */ + * unless the caller wants it left locked. + * we also always return the vnode locked. */ if (flags & ISDOTDOT) { vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); - /* always return the child locked */ - if (lockparent && (flags & ISLASTCN) && - (error = vn_lock(dvp, LK_EXCLUSIVE, p))) { - vput(vp); - DROPNAME(); - return (error); - } + /* always return the child locked */ + if (lockparent && (flags & ISLASTCN) + && (error = vn_lock(dvp, LK_EXCLUSIVE, p))) { + vput(vp); + DROPNAME(); + return (error); + } } else if (vp == dvp) { /* they're the same; afs_lookup() already ref'ed the leaf. - It came in locked, so we don't need to ref OR lock it */ + * It came in locked, so we don't need to ref OR lock it */ } else { if (!lockparent || !(flags & ISLASTCN)) - VOP_UNLOCK(dvp, 0, p); /* done with parent. */ + VOP_UNLOCK(dvp, 0, p); /* done with parent. */ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); - /* always return the child locked */ + /* always return the child locked */ } *ap->a_vpp = vp; - if ((cnp->cn_nameiop == RENAME && wantparent && (flags & ISLASTCN) || - (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)))) + if ((cnp->cn_nameiop == RENAME && wantparent && (flags & ISLASTCN) + || (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)))) cnp->cn_flags |= SAVENAME; DROPNAME(); @@ -221,42 +222,41 @@ struct vop_lookup_args /* { int afs_vop_create(ap) - struct vop_create_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; + struct vop_create_args /* { + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * struct vattr *a_vap; + * } */ *ap; { int error = 0; struct vcache *vcp; register struct vnode *dvp = ap->a_dvp; struct proc *p; GETNAME(); - p=cnp->cn_proc; + p = cnp->cn_proc; /* vnode layer handles excl/nonexcl */ AFS_GLOCK(); - error = afs_create(VTOAFS(dvp), name, ap->a_vap, NONEXCL, - ap->a_vap->va_mode, &vcp, - cnp->cn_cred); + error = + afs_create(VTOAFS(dvp), name, ap->a_vap, NONEXCL, ap->a_vap->va_mode, + &vcp, cnp->cn_cred); AFS_GUNLOCK(); if (error) { VOP_ABORTOP(dvp, cnp); vput(dvp); DROPNAME(); - return(error); + return (error); } if (vcp) { *ap->a_vpp = AFSTOV(vcp); (*ap->a_vpp)->v_vfsp = dvp->v_vfsp; - vn_lock(*ap->a_vpp, LK_EXCLUSIVE| LK_RETRY, p); - if (UBCINFOMISSING(*ap->a_vpp) || - UBCINFORECLAIMED(*ap->a_vpp)) - ubc_info_init(*ap->a_vpp); - } - else *ap->a_vpp = 0; + vn_lock(*ap->a_vpp, LK_EXCLUSIVE | LK_RETRY, p); + if (UBCINFOMISSING(*ap->a_vpp) || UBCINFORECLAIMED(*ap->a_vpp)) + ubc_info_init(*ap->a_vpp); + } else + *ap->a_vpp = 0; if ((cnp->cn_flags & SAVESTART) == 0) FREE_ZONE(cnp->cn_pnbuf, cnp->cn_pnlen, M_NAMEI); @@ -267,26 +267,26 @@ afs_vop_create(ap) int afs_vop_mknod(ap) - struct vop_mknod_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; + struct vop_mknod_args /* { + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * struct vattr *a_vap; + * } */ *ap; { FREE_ZONE(ap->a_cnp->cn_pnbuf, ap->a_cnp->cn_pnlen, M_NAMEI); vput(ap->a_dvp); - return(ENODEV); + return (ENODEV); } int afs_vop_open(ap) - struct vop_open_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_open_args /* { + * struct vnode *a_vp; + * int a_mode; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { int error; struct vnode *vp = ap->a_vp; @@ -325,32 +325,32 @@ afs_vop_open(ap) int afs_vop_close(ap) - struct vop_close_args /* { - struct vnode *a_vp; - int a_fflag; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_close_args /* { + * struct vnode *a_vp; + * int a_fflag; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { int code; - struct vcache *avc=ap->a_vp; + struct vcache *avc = ap->a_vp; AFS_GLOCK(); - if (ap->a_cred) - code=afs_close(avc, ap->a_fflag, ap->a_cred, ap->a_p); + if (ap->a_cred) + code = afs_close(avc, ap->a_fflag, ap->a_cred, ap->a_p); else - code=afs_close(avc, ap->a_fflag, &afs_osi_cred, ap->a_p); + code = afs_close(avc, ap->a_fflag, &afs_osi_cred, ap->a_p); afs_BozonLock(&avc->pvnLock, avc); - osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ + osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); #ifdef AFS_DARWIN14_ENV if (UBCINFOEXISTS(ap->a_vp) && ap->a_vp->v_ubcinfo->ui_refcount < 2) { - ubc_hold(ap->a_vp); - if (ap->a_vp->v_ubcinfo->ui_refcount < 2) { - printf("afs: Imminent ui_refcount panic\n"); - } else { - printf("afs: WARNING: ui_refcount panic averted\n"); - } + ubc_hold(ap->a_vp); + if (ap->a_vp->v_ubcinfo->ui_refcount < 2) { + printf("afs: Imminent ui_refcount panic\n"); + } else { + printf("afs: WARNING: ui_refcount panic averted\n"); + } } #endif @@ -359,126 +359,130 @@ afs_vop_close(ap) int afs_vop_access(ap) - struct vop_access_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_access_args /* { + * struct vnode *a_vp; + * int a_mode; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { int code; AFS_GLOCK(); - code=afs_access(VTOAFS(ap->a_vp), ap->a_mode, ap->a_cred); + code = afs_access(VTOAFS(ap->a_vp), ap->a_mode, ap->a_cred); AFS_GUNLOCK(); return code; } + int afs_vop_getattr(ap) - struct vop_getattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_getattr_args /* { + * struct vnode *a_vp; + * struct vattr *a_vap; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { int code; AFS_GLOCK(); - code=afs_getattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred); + code = afs_getattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred); AFS_GUNLOCK(); return code; } + int afs_vop_setattr(ap) - struct vop_setattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_setattr_args /* { + * struct vnode *a_vp; + * struct vattr *a_vap; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { int code; AFS_GLOCK(); - code=afs_setattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred); + code = afs_setattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred); AFS_GUNLOCK(); return code; } + int afs_vop_read(ap) - struct vop_read_args /* { - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; - } */ *ap; + struct vop_read_args /* { + * struct vnode *a_vp; + * struct uio *a_uio; + * int a_ioflag; + * struct ucred *a_cred; + * } */ *ap; { int code; - struct vcache *avc=VTOAFS(ap->a_vp); + struct vcache *avc = VTOAFS(ap->a_vp); AFS_GLOCK(); afs_BozonLock(&avc->pvnLock, avc); - osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ - code=afs_read(avc, ap->a_uio, ap->a_cred, 0, 0, 0); + osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ + code = afs_read(avc, ap->a_uio, ap->a_cred, 0, 0, 0); afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); return code; } + int afs_vop_pagein(ap) - struct vop_pagein_args /* { - struct vnode *a_vp; - upl_t a_pl; - vm_offset_t a_pl_offset; - off_t a_f_offset; - size_t a_size; - struct ucred *a_cred; - int a_flags; - } */ *ap; + struct vop_pagein_args /* { + * struct vnode *a_vp; + * upl_t a_pl; + * vm_offset_t a_pl_offset; + * off_t a_f_offset; + * size_t a_size; + * struct ucred *a_cred; + * int a_flags; + * } */ *ap; { register struct vnode *vp = ap->a_vp; upl_t pl = ap->a_pl; - size_t size= ap->a_size; + size_t size = ap->a_size; off_t f_offset = ap->a_f_offset; vm_offset_t pl_offset = ap->a_pl_offset; - int flags = ap->a_flags; + int flags = ap->a_flags; struct ucred *cred; vm_offset_t ioaddr; - struct uio auio; - struct iovec aiov; - struct uio * uio = &auio; + struct uio auio; + struct iovec aiov; + struct uio *uio = &auio; int nocommit = flags & UPL_NOCOMMIT; int code; - struct vcache *tvc=VTOAFS(vp); + struct vcache *tvc = VTOAFS(vp); if (UBCINVALID(vp)) { #if DIAGNOSTIC - panic("afs_vop_pagein: invalid vp"); + panic("afs_vop_pagein: invalid vp"); #endif /* DIAGNOSTIC */ - return (EPERM); + return (EPERM); } UBCINFOCHECK("afs_vop_pagein", vp); - if(pl == (upl_t)NULL) { - panic("afs_vop_pagein: no upl"); + if (pl == (upl_t) NULL) { + panic("afs_vop_pagein: no upl"); } cred = ubc_getcred(vp); if (cred == NOCRED) - cred = ap->a_cred; + cred = ap->a_cred; if (size == 0) { - if (!nocommit) - kernel_upl_abort_range(pl, pl_offset, size, - UPL_ABORT_ERROR | UPL_ABORT_FREE_ON_EMPTY); - return (0); + if (!nocommit) + kernel_upl_abort_range(pl, pl_offset, size, + UPL_ABORT_ERROR | UPL_ABORT_FREE_ON_EMPTY); + return (0); } if (f_offset < 0) { - if (!nocommit) - kernel_upl_abort_range(pl, pl_offset, size, - UPL_ABORT_ERROR | UPL_ABORT_FREE_ON_EMPTY); - return (EINVAL); + if (!nocommit) + kernel_upl_abort_range(pl, pl_offset, size, + UPL_ABORT_ERROR | UPL_ABORT_FREE_ON_EMPTY); + return (EINVAL); } if (f_offset & PAGE_MASK) - panic("afs_vop_pagein: offset not page aligned"); + panic("afs_vop_pagein: offset not page aligned"); auio.uio_iov = &aiov; auio.uio_iovcnt = 1; @@ -489,15 +493,15 @@ afs_vop_pagein(ap) kernel_upl_map(kernel_map, pl, &ioaddr); ioaddr += pl_offset; auio.uio_resid = aiov.iov_len = size; - aiov.iov_base = (caddr_t)ioaddr; + aiov.iov_base = (caddr_t) ioaddr; AFS_GLOCK(); afs_BozonLock(&tvc->pvnLock, tvc); - osi_FlushPages(tvc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ - code=afs_read(tvc, uio, cred, 0, 0, 0); + osi_FlushPages(tvc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ + code = afs_read(tvc, uio, cred, 0, 0, 0); if (code == 0) { - ObtainWriteLock(&tvc->lock, 2); - tvc->states |= CMAPPED; - ReleaseWriteLock(&tvc->lock); + ObtainWriteLock(&tvc->lock, 2); + tvc->states |= CMAPPED; + ReleaseWriteLock(&tvc->lock); } afs_BozonUnlock(&tvc->pvnLock, tvc); AFS_GUNLOCK(); @@ -508,37 +512,41 @@ afs_vop_pagein(ap) kernel_upl_unmap(kernel_map, pl); if (!nocommit) { - if (code) - kernel_upl_abort_range(pl, pl_offset, size, - UPL_ABORT_ERROR | UPL_ABORT_FREE_ON_EMPTY); - else - kernel_upl_commit_range(pl, pl_offset, size, - UPL_COMMIT_CLEAR_DIRTY | UPL_COMMIT_FREE_ON_EMPTY, - UPL_GET_INTERNAL_PAGE_LIST(pl), MAX_UPL_TRANSFER); + if (code) + kernel_upl_abort_range(pl, pl_offset, size, + UPL_ABORT_ERROR | UPL_ABORT_FREE_ON_EMPTY); + else + kernel_upl_commit_range(pl, pl_offset, size, + UPL_COMMIT_CLEAR_DIRTY | + UPL_COMMIT_FREE_ON_EMPTY, + UPL_GET_INTERNAL_PAGE_LIST(pl), + MAX_UPL_TRANSFER); } return code; } int afs_vop_write(ap) - struct vop_write_args /* { - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; - } */ *ap; + struct vop_write_args /* { + * struct vnode *a_vp; + * struct uio *a_uio; + * int a_ioflag; + * struct ucred *a_cred; + * } */ *ap; { int code; - struct vcache *avc=VTOAFS(ap->a_vp); + struct vcache *avc = VTOAFS(ap->a_vp); void *object; AFS_GLOCK(); afs_BozonLock(&avc->pvnLock, avc); - osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ + osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ if (UBCINFOEXISTS(ap->a_vp)) - ubc_clean(ap->a_vp, 1); + ubc_clean(ap->a_vp, 1); if (UBCINFOEXISTS(ap->a_vp)) - osi_VM_NukePages(ap->a_vp, ap->a_uio->uio_offset, ap->a_uio->uio_resid); - code=afs_write(VTOAFS(ap->a_vp), ap->a_uio, ap->a_ioflag, ap->a_cred, 0); + osi_VM_NukePages(ap->a_vp, ap->a_uio->uio_offset, + ap->a_uio->uio_resid); + code = + afs_write(VTOAFS(ap->a_vp), ap->a_uio, ap->a_ioflag, ap->a_cred, 0); afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); return code; @@ -546,94 +554,108 @@ afs_vop_write(ap) int afs_vop_pageout(ap) - struct vop_pageout_args /* { - struct vnode *a_vp; - upl_t a_pl, - vm_offset_t a_pl_offset, - off_t a_f_offset, - size_t a_size, - struct ucred *a_cred, - int a_flags - } */ *ap; + struct vop_pageout_args /* { + * struct vnode *a_vp; + * upl_t a_pl, + * vm_offset_t a_pl_offset, + * off_t a_f_offset, + * size_t a_size, + * struct ucred *a_cred, + * int a_flags + * } */ *ap; { register struct vnode *vp = ap->a_vp; upl_t pl = ap->a_pl; - size_t size= ap->a_size; + size_t size = ap->a_size; off_t f_offset = ap->a_f_offset; vm_offset_t pl_offset = ap->a_pl_offset; - int flags = ap->a_flags; + int flags = ap->a_flags; struct ucred *cred; vm_offset_t ioaddr; - struct uio auio; - struct iovec aiov; - struct uio * uio = &auio; + struct uio auio; + struct iovec aiov; + struct uio *uio = &auio; int nocommit = flags & UPL_NOCOMMIT; + int iosize; int code; - struct vcache *tvc=VTOAFS(vp); + struct vcache *tvc = VTOAFS(vp); if (UBCINVALID(vp)) { #if DIAGNOSTIC - panic("afs_vop_pageout: invalid vp"); + panic("afs_vop_pageout: invalid vp"); #endif /* DIAGNOSTIC */ - return (EPERM); + return (EPERM); } UBCINFOCHECK("afs_vop_pageout", vp); - if(pl == (upl_t)NULL) { - panic("afs_vop_pageout: no upl"); + if (pl == (upl_t) NULL) { + panic("afs_vop_pageout: no upl"); } #if 1 - { int lbn, iosize, s; - struct buf *bp; - int biosize = DEV_BSIZE; - - lbn = f_offset / DEV_BSIZE; - - for (iosize = size; iosize > 0; iosize -= biosize, lbn++) { - - s = splbio(); - if (bp = incore(vp, lbn)) { - if (ISSET(bp->b_flags, B_BUSY)) - panic("nfs_pageout: found BUSY buffer incore\n") -; - - bremfree(bp); - SET(bp->b_flags, (B_BUSY | B_INVAL)); - brelse(bp); - } - splx(s); - } + { + int lbn, s; + struct buf *bp; + int biosize = DEV_BSIZE; + + lbn = f_offset / DEV_BSIZE; + + for (iosize = size; iosize > 0; iosize -= biosize, lbn++) { + + s = splbio(); + if (bp = incore(vp, lbn)) { + if (ISSET(bp->b_flags, B_BUSY)) + panic("nfs_pageout: found BUSY buffer incore\n"); + + bremfree(bp); + SET(bp->b_flags, (B_BUSY | B_INVAL)); + brelse(bp); + } + splx(s); + } } #endif cred = ubc_getcred(vp); if (cred == NOCRED) - cred = ap->a_cred; + cred = ap->a_cred; if (size == 0) { - if (!nocommit) - kernel_upl_abort_range(pl, pl_offset, size, - UPL_ABORT_FREE_ON_EMPTY); - return (0); + if (!nocommit) + kernel_upl_abort_range(pl, pl_offset, size, + UPL_ABORT_FREE_ON_EMPTY); + return (0); } if (flags & (IO_APPEND | IO_SYNC)) - panic("nfs_pageout: (IO_APPEND | IO_SYNC)"); + panic("nfs_pageout: (IO_APPEND | IO_SYNC)"); if (f_offset < 0) { - if (!nocommit) - kernel_upl_abort_range(pl, pl_offset, size, - UPL_ABORT_FREE_ON_EMPTY); - return (EINVAL); + if (!nocommit) + kernel_upl_abort_range(pl, pl_offset, size, + UPL_ABORT_FREE_ON_EMPTY); + return (EINVAL); } if (f_offset >= tvc->m.Length) { - if (!nocommit) - kernel_upl_abort_range(pl, pl_offset, size, - UPL_ABORT_FREE_ON_EMPTY); - return (EINVAL); + if (!nocommit) + kernel_upl_abort_range(pl, pl_offset, size, + UPL_ABORT_FREE_ON_EMPTY); + return (EINVAL); } if (f_offset & PAGE_MASK) - panic("afs_vop_pageout: offset not page aligned"); + panic("afs_vop_pageout: offset not page aligned"); + + /* size will always be a multiple of PAGE_SIZE */ + /* pageout isn't supposed to extend files */ + if (f_offset + size > tvc->m.Length) + iosize = tvc->m.Length - f_offset; + else + iosize = size; + if (size > (iosize + (PAGE_SIZE - 1)) & ~PAGE_MASK && !nocommit) { + int iosize_rnd=(iosize + (PAGE_SIZE - 1)) & ~PAGE_MASK; + kernel_upl_abort_range(pl, pl_offset + iosize_rnd, + size - iosize_rnd, + UPL_ABORT_FREE_ON_EMPTY); + } auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_offset = f_offset; @@ -642,31 +664,31 @@ afs_vop_pageout(ap) auio.uio_procp = NULL; kernel_upl_map(kernel_map, pl, &ioaddr); ioaddr += pl_offset; - auio.uio_resid = aiov.iov_len = size; - aiov.iov_base = (caddr_t)ioaddr; -#if 1 /* USV [ */ - { - /* - * check for partial page and clear the - * contents past end of the file before - * releasing it in the VM page cache - */ - if ((f_offset < tvc->m.Length) && (f_offset + size) > tvc->m.Length) { - size_t io = tvc->m.Length - f_offset; - - memset((caddr_t)(ioaddr + pl_offset + io), 0, size - io); - } - } + auio.uio_resid = aiov.iov_len = iosize; + aiov.iov_base = (caddr_t) ioaddr; +#if 1 /* USV [ */ + { + /* + * check for partial page and clear the + * contents past end of the file before + * releasing it in the VM page cache + */ + if ((f_offset < tvc->m.Length) && (f_offset + size) > tvc->m.Length) { + size_t io = tvc->m.Length - f_offset; + + memset((caddr_t) (ioaddr + pl_offset + io), 0, size - io); + } + } #endif /* ] USV */ AFS_GLOCK(); afs_BozonLock(&tvc->pvnLock, tvc); - osi_FlushPages(tvc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ + osi_FlushPages(tvc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ ObtainWriteLock(&tvc->lock, 1); afs_FakeOpen(tvc); ReleaseWriteLock(&tvc->lock); - code=afs_write(tvc, uio, flags, cred, 0); + code = afs_write(tvc, uio, flags, cred, 0); ObtainWriteLock(&tvc->lock, 1); afs_FakeClose(tvc, cred); @@ -675,64 +697,68 @@ afs_vop_pageout(ap) AFS_GUNLOCK(); kernel_upl_unmap(kernel_map, pl); if (!nocommit) { - if(code) - kernel_upl_abort_range(pl, pl_offset, size, - UPL_ABORT_FREE_ON_EMPTY); - else - kernel_upl_commit_range(pl, pl_offset, size, - UPL_COMMIT_CLEAR_DIRTY | UPL_COMMIT_FREE_ON_EMPTY, - UPL_GET_INTERNAL_PAGE_LIST(pl), MAX_UPL_TRANSFER); + if (code) + kernel_upl_abort_range(pl, pl_offset, size, + UPL_ABORT_FREE_ON_EMPTY); + else + kernel_upl_commit_range(pl, pl_offset, size, + UPL_COMMIT_CLEAR_DIRTY | + UPL_COMMIT_FREE_ON_EMPTY, + UPL_GET_INTERNAL_PAGE_LIST(pl), + MAX_UPL_TRANSFER); } return code; } + int afs_vop_ioctl(ap) - struct vop_ioctl_args /* { - struct vnode *a_vp; - int a_command; - caddr_t a_data; - int a_fflag; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_ioctl_args /* { + * struct vnode *a_vp; + * int a_command; + * caddr_t a_data; + * int a_fflag; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { struct vcache *tvc = VTOAFS(ap->a_vp); struct afs_ioctl data; int error = 0; - + /* in case we ever get in here... */ AFS_STATCNT(afs_ioctl); if (((ap->a_command >> 8) & 0xff) == 'V') { /* This is a VICEIOCTL call */ - AFS_GLOCK(); - error = HandleIoctl(tvc, (struct file *)0/*Not used*/, - ap->a_command, ap->a_data); - AFS_GUNLOCK(); - return(error); + AFS_GLOCK(); + error = HandleIoctl(tvc, (struct file *)0 /*Not used */ , + ap->a_command, ap->a_data); + AFS_GUNLOCK(); + return (error); } else { /* No-op call; just return. */ - return(ENOTTY); + return (ENOTTY); } } /* ARGSUSED */ int afs_vop_select(ap) - struct vop_select_args /* { - struct vnode *a_vp; - int a_which; - int a_fflags; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_select_args /* { + * struct vnode *a_vp; + * int a_which; + * int a_fflags; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { - /* - * We should really check to see if I/O is possible. - */ - return (1); + /* + * We should really check to see if I/O is possible. + */ + return (1); } + /* * Mmap a file * @@ -741,60 +767,60 @@ afs_vop_select(ap) /* ARGSUSED */ int afs_vop_mmap(ap) - struct vop_mmap_args /* { - struct vnode *a_vp; - int a_fflags; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_mmap_args /* { + * struct vnode *a_vp; + * int a_fflags; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { - return (EINVAL); + return (EINVAL); } int afs_vop_fsync(ap) - struct vop_fsync_args /* { - struct vnode *a_vp; - struct ucred *a_cred; - int a_waitfor; - struct proc *a_p; - } */ *ap; + struct vop_fsync_args /* { + * struct vnode *a_vp; + * struct ucred *a_cred; + * int a_waitfor; + * struct proc *a_p; + * } */ *ap; { int wait = ap->a_waitfor == MNT_WAIT; int error; register struct vnode *vp = ap->a_vp; AFS_GLOCK(); - /*vflushbuf(vp, wait);*/ + /*vflushbuf(vp, wait); */ if (ap->a_cred) - error=afs_fsync(VTOAFS(vp), ap->a_cred); + error = afs_fsync(VTOAFS(vp), ap->a_cred); else - error=afs_fsync(VTOAFS(vp), &afs_osi_cred); + error = afs_fsync(VTOAFS(vp), &afs_osi_cred); AFS_GUNLOCK(); return error; } int afs_vop_seek(ap) - struct vop_seek_args /* { - struct vnode *a_vp; - off_t a_oldoff; - off_t a_newoff; - struct ucred *a_cred; - } */ *ap; + struct vop_seek_args /* { + * struct vnode *a_vp; + * off_t a_oldoff; + * off_t a_newoff; + * struct ucred *a_cred; + * } */ *ap; { - if (ap->a_newoff > ULONG_MAX) /* AFS doesn't support 64-bit offsets */ + if (ap->a_newoff > ULONG_MAX) /* AFS doesn't support 64-bit offsets */ return EINVAL; return (0); } int afs_vop_remove(ap) - struct vop_remove_args /* { - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; + struct vop_remove_args /* { + * struct vnode *a_dvp; + * struct vnode *a_vp; + * struct componentname *a_cnp; + * } */ *ap; { int error = 0; register struct vnode *vp = ap->a_vp; @@ -802,20 +828,20 @@ afs_vop_remove(ap) GETNAME(); AFS_GLOCK(); - error = afs_remove(VTOAFS(dvp), name, cnp->cn_cred); + error = afs_remove(VTOAFS(dvp), name, cnp->cn_cred); AFS_GUNLOCK(); cache_purge(vp); if (!error && UBCINFOEXISTS(vp)) { #ifdef AFS_DARWIN14_ENV - (void) ubc_uncache(vp); + (void)ubc_uncache(vp); #else - int wasmapped=ubc_issetflags(vp, UI_WASMAPPED); - int hasobjref=ubc_issetflags(vp, UI_HASOBJREF); - if (wasmapped) - (void) ubc_uncache(vp); - if (hasobjref) - ubc_release(vp); - /* WARNING vp may not be valid after this */ + int wasmapped = ubc_issetflags(vp, UI_WASMAPPED); + int hasobjref = ubc_issetflags(vp, UI_HASOBJREF); + if (wasmapped) + (void)ubc_uncache(vp); + if (hasobjref) + ubc_release(vp); + /* WARNING vp may not be valid after this */ #endif } if (dvp == vp) @@ -831,11 +857,11 @@ afs_vop_remove(ap) int afs_vop_link(ap) - struct vop_link_args /* { - struct vnode *a_vp; - struct vnode *a_tdvp; - struct componentname *a_cnp; - } */ *ap; + struct vop_link_args /* { + * struct vnode *a_vp; + * struct vnode *a_tdvp; + * struct componentname *a_cnp; + * } */ *ap; { int error = 0; register struct vnode *dvp = ap->a_tdvp; @@ -843,7 +869,7 @@ afs_vop_link(ap) struct proc *p; GETNAME(); - p=cnp->cn_proc; + p = cnp->cn_proc; if (vp->v_type == VDIR) { VOP_ABORTOP(vp, cnp); error = EISDIR; @@ -858,8 +884,8 @@ afs_vop_link(ap) AFS_GUNLOCK(); FREE_ZONE(cnp->cn_pnbuf, cnp->cn_pnlen, M_NAMEI); if (dvp != vp) - VOP_UNLOCK(vp,0, p); -out: + VOP_UNLOCK(vp, 0, p); + out: vput(dvp); DROPNAME(); return error; @@ -867,14 +893,14 @@ out: int afs_vop_rename(ap) - struct vop_rename_args /* { - struct vnode *a_fdvp; - struct vnode *a_fvp; - struct componentname *a_fcnp; - struct vnode *a_tdvp; - struct vnode *a_tvp; - struct componentname *a_tcnp; - } */ *ap; + struct vop_rename_args /* { + * struct vnode *a_fdvp; + * struct vnode *a_fvp; + * struct componentname *a_fcnp; + * struct vnode *a_tdvp; + * struct vnode *a_tvp; + * struct componentname *a_tcnp; + * } */ *ap; { int error = 0; struct componentname *fcnp = ap->a_fcnp; @@ -885,7 +911,16 @@ afs_vop_rename(ap) register struct vnode *tdvp = ap->a_tdvp; struct vnode *fvp = ap->a_fvp; register struct vnode *fdvp = ap->a_fdvp; - struct proc *p=fcnp->cn_proc; + struct proc *p = fcnp->cn_proc; + + /* Check for cross-device rename. + * For AFS, this means anything not in AFS-space + */ + if ((0 != strcmp(tdvp->v_mount->mnt_stat.f_fstypename, "afs")) || + (tvp && (0 != strcmp(tvp->v_mount->mnt_stat.f_fstypename, "afs")))) { + error = EXDEV; + goto abortit; + } /* * if fvp == tvp, we're just removing one name of a pair of @@ -895,15 +930,15 @@ afs_vop_rename(ap) if (fvp == tvp) { if (fvp->v_type == VDIR) { error = EINVAL; - abortit: - VOP_ABORTOP(tdvp, tcnp); /* XXX, why not in NFS? */ + abortit: + VOP_ABORTOP(tdvp, tcnp); /* XXX, why not in NFS? */ if (tdvp == tvp) vrele(tdvp); else vput(tdvp); if (tvp) vput(tvp); - VOP_ABORTOP(fdvp, fcnp); /* XXX, why not in NFS? */ + VOP_ABORTOP(fdvp, fcnp); /* XXX, why not in NFS? */ vrele(fdvp); vrele(fvp); return (error); @@ -922,30 +957,31 @@ afs_vop_rename(ap) if ((fcnp->cn_flags & SAVESTART) == 0) panic("afs_rename: lost from startdir"); fcnp->cn_nameiop = DELETE; - (void) relookup(fdvp, &fvp, fcnp); + (void)relookup(fdvp, &fvp, fcnp); return (VOP_REMOVE(fdvp, fvp, fcnp)); } if (error = vn_lock(fvp, LK_EXCLUSIVE, p)) goto abortit; - MALLOC(fname, char *, fcnp->cn_namelen+1, M_TEMP, M_WAITOK); + MALLOC(fname, char *, fcnp->cn_namelen + 1, M_TEMP, M_WAITOK); memcpy(fname, fcnp->cn_nameptr, fcnp->cn_namelen); fname[fcnp->cn_namelen] = '\0'; - MALLOC(tname, char *, tcnp->cn_namelen+1, M_TEMP, M_WAITOK); + MALLOC(tname, char *, tcnp->cn_namelen + 1, M_TEMP, M_WAITOK); memcpy(tname, tcnp->cn_nameptr, tcnp->cn_namelen); tname[tcnp->cn_namelen] = '\0'; AFS_GLOCK(); /* XXX use "from" or "to" creds? NFS uses "to" creds */ - error = afs_rename(VTOAFS(fdvp), fname, VTOAFS(tdvp), tname, tcnp->cn_cred); + error = + afs_rename(VTOAFS(fdvp), fname, VTOAFS(tdvp), tname, tcnp->cn_cred); AFS_GUNLOCK(); VOP_UNLOCK(fvp, 0, p); FREE(fname, M_TEMP); FREE(tname, M_TEMP); if (error) - goto abortit; /* XXX */ + goto abortit; /* XXX */ if (tdvp == tvp) vrele(tdvp); else @@ -959,12 +995,12 @@ afs_vop_rename(ap) int afs_vop_mkdir(ap) - struct vop_mkdir_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; + struct vop_mkdir_args /* { + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * struct vattr *a_vap; + * } */ *ap; { register struct vnode *dvp = ap->a_dvp; register struct vattr *vap = ap->a_vap; @@ -973,7 +1009,7 @@ afs_vop_mkdir(ap) struct proc *p; GETNAME(); - p=cnp->cn_proc; + p = cnp->cn_proc; #ifdef DIAGNOSTIC if ((cnp->cn_flags & HASBUF) == 0) panic("afs_vop_mkdir: no name"); @@ -985,12 +1021,12 @@ afs_vop_mkdir(ap) VOP_ABORTOP(dvp, cnp); vput(dvp); DROPNAME(); - return(error); + return (error); } if (vcp) { *ap->a_vpp = AFSTOV(vcp); (*ap->a_vpp)->v_vfsp = dvp->v_vfsp; - vn_lock(*ap->a_vpp, LK_EXCLUSIVE|LK_RETRY, p); + vn_lock(*ap->a_vpp, LK_EXCLUSIVE | LK_RETRY, p); } else *ap->a_vpp = 0; DROPNAME(); @@ -1001,11 +1037,11 @@ afs_vop_mkdir(ap) int afs_vop_rmdir(ap) - struct vop_rmdir_args /* { - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; + struct vop_rmdir_args /* { + * struct vnode *a_dvp; + * struct vnode *a_vp; + * struct componentname *a_cnp; + * } */ *ap; { int error = 0; register struct vnode *vp = ap->a_vp; @@ -1031,13 +1067,13 @@ afs_vop_rmdir(ap) int afs_vop_symlink(ap) - struct vop_symlink_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - char *a_target; - } */ *ap; + struct vop_symlink_args /* { + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * struct vattr *a_vap; + * char *a_target; + * } */ *ap; { register struct vnode *dvp = ap->a_dvp; int error = 0; @@ -1045,8 +1081,8 @@ afs_vop_symlink(ap) GETNAME(); AFS_GLOCK(); - error = afs_symlink(VTOAFS(dvp), name, ap->a_vap, ap->a_target, - cnp->cn_cred); + error = + afs_symlink(VTOAFS(dvp), name, ap->a_vap, ap->a_target, cnp->cn_cred); AFS_GUNLOCK(); DROPNAME(); FREE_ZONE(cnp->cn_pnbuf, cnp->cn_pnlen, M_NAMEI); @@ -1056,23 +1092,23 @@ afs_vop_symlink(ap) int afs_vop_readdir(ap) - struct vop_readdir_args /* { - struct vnode *a_vp; - struct uio *a_uio; - struct ucred *a_cred; - int *a_eofflag; - u_long *a_cookies; - int ncookies; - } */ *ap; + struct vop_readdir_args /* { + * struct vnode *a_vp; + * struct uio *a_uio; + * struct ucred *a_cred; + * int *a_eofflag; + * u_long *a_cookies; + * int ncookies; + * } */ *ap; { int error; off_t off; /* printf("readdir %x cookies %x ncookies %d\n", ap->a_vp, ap->a_cookies, ap->a_ncookies); */ - off=ap->a_uio->uio_offset; + off = ap->a_uio->uio_offset; AFS_GLOCK(); - error= afs_readdir(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred, - ap->a_eofflag); + error = + afs_readdir(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred, ap->a_eofflag); AFS_GUNLOCK(); if (!error && ap->a_ncookies != NULL) { struct uio *uio = ap->a_uio; @@ -1085,17 +1121,15 @@ afs_vop_readdir(ap) dp = (const struct dirent *) ((const char *)uio->uio_iov->iov_base - (uio->uio_offset - off)); - dp_end = (const struct dirent *) uio->uio_iov->iov_base; - for (dp_start = dp, ncookies = 0; - dp < dp_end; - dp = (const struct dirent *)((const char *) dp + dp->d_reclen)) + dp_end = (const struct dirent *)uio->uio_iov->iov_base; + for (dp_start = dp, ncookies = 0; dp < dp_end; + dp = (const struct dirent *)((const char *)dp + dp->d_reclen)) ncookies++; - MALLOC(cookies, u_long *, ncookies * sizeof(u_long), - M_TEMP, M_WAITOK); - for (dp = dp_start, cookiep = cookies; - dp < dp_end; - dp = (const struct dirent *)((const char *) dp + dp->d_reclen)) { + MALLOC(cookies, u_long *, ncookies * sizeof(u_long), M_TEMP, + M_WAITOK); + for (dp = dp_start, cookiep = cookies; dp < dp_end; + dp = (const struct dirent *)((const char *)dp + dp->d_reclen)) { off += dp->d_reclen; *cookiep++ = off; } @@ -1108,16 +1142,16 @@ afs_vop_readdir(ap) int afs_vop_readlink(ap) - struct vop_readlink_args /* { - struct vnode *a_vp; - struct uio *a_uio; - struct ucred *a_cred; - } */ *ap; + struct vop_readlink_args /* { + * struct vnode *a_vp; + * struct uio *a_uio; + * struct ucred *a_cred; + * } */ *ap; { int error; /* printf("readlink %x\n", ap->a_vp);*/ AFS_GLOCK(); - error= afs_readlink(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred); + error = afs_readlink(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred); AFS_GUNLOCK(); return error; } @@ -1126,10 +1160,10 @@ extern int prtactive; int afs_vop_inactive(ap) - struct vop_inactive_args /* { - struct vnode *a_vp; - struct proc *a_p; - } */ *ap; + struct vop_inactive_args /* { + * struct vnode *a_vp; + * struct proc *a_p; + * } */ *ap; { register struct vnode *vp = ap->a_vp; @@ -1137,7 +1171,7 @@ afs_vop_inactive(ap) vprint("afs_vop_inactive(): pushing active", vp); AFS_GLOCK(); - afs_InactiveVCache(VTOAFS(vp), 0); /* decrs ref counts */ + afs_InactiveVCache(VTOAFS(vp), 0); /* decrs ref counts */ AFS_GUNLOCK(); VOP_UNLOCK(vp, 0, ap->a_p); return 0; @@ -1145,74 +1179,74 @@ afs_vop_inactive(ap) int afs_vop_reclaim(ap) - struct vop_reclaim_args /* { - struct vnode *a_vp; - } */ *ap; + struct vop_reclaim_args /* { + * struct vnode *a_vp; + * } */ *ap; { int error; int sl; register struct vnode *vp = ap->a_vp; - cache_purge(vp); /* just in case... */ + cache_purge(vp); /* just in case... */ -#if 0 +#if 0 AFS_GLOCK(); - error = afs_FlushVCache(VTOAFS(vp), &sl); /* tosses our stuff from vnode */ + error = afs_FlushVCache(VTOAFS(vp), &sl); /* tosses our stuff from vnode */ AFS_GUNLOCK(); ubc_unlink(vp); if (!error && vp->v_data) panic("afs_reclaim: vnode not cleaned"); return error; #else - if (vp->v_usecount == 2) { - vprint("reclaim count==2", vp); - } else if (vp->v_usecount == 1) { - vprint("reclaim count==1", vp); - } else - vprint("reclaim bad count", vp); - - return 0; + if (vp->v_usecount == 2) { + vprint("reclaim count==2", vp); + } else if (vp->v_usecount == 1) { + vprint("reclaim count==1", vp); + } else + vprint("reclaim bad count", vp); + + return 0; #endif } int afs_vop_lock(ap) - struct vop_lock_args /* { - struct vnode *a_vp; - } */ *ap; + struct vop_lock_args /* { + * struct vnode *a_vp; + * } */ *ap; { - register struct vnode *vp = ap->a_vp; - register struct vcache *avc = VTOAFS(vp); + register struct vnode *vp = ap->a_vp; + register struct vcache *avc = VTOAFS(vp); - if (vp->v_tag == VT_NON) - return (ENOENT); - return (lockmgr(&avc->rwlock, ap->a_flags, &vp->v_interlock, - ap->a_p)); + if (vp->v_tag == VT_NON) + return (ENOENT); + return (lockmgr(&avc->rwlock, ap->a_flags, &vp->v_interlock, ap->a_p)); } int afs_vop_unlock(ap) - struct vop_unlock_args /* { - struct vnode *a_vp; - } */ *ap; + struct vop_unlock_args /* { + * struct vnode *a_vp; + * } */ *ap; { struct vnode *vp = ap->a_vp; struct vcache *avc = VTOAFS(vp); - return (lockmgr(&avc->rwlock, ap->a_flags | LK_RELEASE, - &vp->v_interlock, ap->a_p)); + return (lockmgr + (&avc->rwlock, ap->a_flags | LK_RELEASE, &vp->v_interlock, + ap->a_p)); } int afs_vop_bmap(ap) - struct vop_bmap_args /* { - struct vnode *a_vp; - daddr_t a_bn; - struct vnode **a_vpp; - daddr_t *a_bnp; - int *a_runp; - int *a_runb; - } */ *ap; + struct vop_bmap_args /* { + * struct vnode *a_vp; + * daddr_t a_bn; + * struct vnode **a_vpp; + * daddr_t *a_bnp; + * int *a_runp; + * int *a_runb; + * } */ *ap; { struct vcache *vcp; int error; @@ -1222,52 +1256,58 @@ afs_vop_bmap(ap) if (ap->a_vpp) { *ap->a_vpp = ap->a_vp; } - if (ap->a_runp != NULL) - *ap->a_runp = 0; + if (ap->a_runp != NULL) + *ap->a_runp = 0; #ifdef notyet - if (ap->a_runb != NULL) - *ap->a_runb = 0; + if (ap->a_runb != NULL) + *ap->a_runb = 0; #endif - + return 0; } + int afs_vop_strategy(ap) - struct vop_strategy_args /* { - struct buf *a_bp; - } */ *ap; + struct vop_strategy_args /* { + * struct buf *a_bp; + * } */ *ap; { int error; AFS_GLOCK(); - error= afs_ustrategy(ap->a_bp); + error = afs_ustrategy(ap->a_bp); AFS_GUNLOCK(); return error; } + int afs_vop_print(ap) - struct vop_print_args /* { - struct vnode *a_vp; - } */ *ap; + struct vop_print_args /* { + * struct vnode *a_vp; + * } */ *ap; { register struct vnode *vp = ap->a_vp; register struct vcache *vc = VTOAFS(ap->a_vp); int s = vc->states; - printf("tag %d, fid: %ld.%x.%x.%x, opens %d, writers %d", vp->v_tag, vc->fid.Cell, - vc->fid.Fid.Volume, vc->fid.Fid.Vnode, vc->fid.Fid.Unique, vc->opens, - vc->execsOrWriters); - printf("\n states%s%s%s%s%s", (s&CStatd) ? " statd" : "", (s&CRO) ? " readonly" : "",(s&CDirty) ? " dirty" : "",(s&CMAPPED) ? " mapped" : "", (s&CVFlushed) ? " flush in progress" : ""); + printf("tag %d, fid: %ld.%x.%x.%x, opens %d, writers %d", vp->v_tag, + vc->fid.Cell, vc->fid.Fid.Volume, vc->fid.Fid.Vnode, + vc->fid.Fid.Unique, vc->opens, vc->execsOrWriters); + printf("\n states%s%s%s%s%s", (s & CStatd) ? " statd" : "", + (s & CRO) ? " readonly" : "", (s & CDirty) ? " dirty" : "", + (s & CMAPPED) ? " mapped" : "", + (s & CVFlushed) ? " flush in progress" : ""); if (UBCISVALID(vp)) { - printf("\n UBC: "); - if (UBCINFOEXISTS(vp)) { - printf("exists, ") ; + printf("\n UBC: "); + if (UBCINFOEXISTS(vp)) { + printf("exists, "); #ifdef AFS_DARWIN14_ENV - printf("refs %d%s%s", vp->v_ubcinfo->ui_refcount, - ubc_issetflags(vp, UI_HASOBJREF) ? " HASOBJREF" : "", - ubc_issetflags(vp, UI_WASMAPPED) ? " WASMAPPED" : ""); + printf("refs %d%s%s", vp->v_ubcinfo->ui_refcount, + ubc_issetflags(vp, UI_HASOBJREF) ? " HASOBJREF" : "", + ubc_issetflags(vp, UI_WASMAPPED) ? " WASMAPPED" : ""); #else - printf("holdcnt %d", vp->v_ubcinfo->ui_holdcnt); + printf("holdcnt %d", vp->v_ubcinfo->ui_holdcnt); #endif - } else printf("does not exist"); + } else + printf("does not exist"); } printf("\n"); return 0; @@ -1275,9 +1315,9 @@ afs_vop_print(ap) int afs_vop_islocked(ap) - struct vop_islocked_args /* { - struct vnode *a_vp; - } */ *ap; + struct vop_islocked_args /* { + * struct vnode *a_vp; + * } */ *ap; { struct vcache *vc = VTOAFS(ap->a_vp); return lockstatus(&vc->rwlock); @@ -1287,44 +1327,44 @@ afs_vop_islocked(ap) * Return POSIX pathconf information applicable to ufs filesystems. */ afs_vop_pathconf(ap) - struct vop_pathconf_args /* { - struct vnode *a_vp; - int a_name; - int *a_retval; - } */ *ap; + struct vop_pathconf_args /* { + * struct vnode *a_vp; + * int a_name; + * int *a_retval; + * } */ *ap; { AFS_STATCNT(afs_cntl); switch (ap->a_name) { - case _PC_LINK_MAX: + case _PC_LINK_MAX: *ap->a_retval = LINK_MAX; break; - case _PC_NAME_MAX: + case _PC_NAME_MAX: *ap->a_retval = NAME_MAX; break; - case _PC_PATH_MAX: + case _PC_PATH_MAX: *ap->a_retval = PATH_MAX; break; - case _PC_CHOWN_RESTRICTED: + case _PC_CHOWN_RESTRICTED: *ap->a_retval = 1; break; - case _PC_NO_TRUNC: + case _PC_NO_TRUNC: *ap->a_retval = 1; break; - case _PC_PIPE_BUF: + case _PC_PIPE_BUF: return EINVAL; break; #if defined(AFS_DARWIN70_ENV) - case _PC_NAME_CHARS_MAX: - *ap->a_retval = NAME_MAX; + case _PC_NAME_CHARS_MAX: + *ap->a_retval = NAME_MAX; break; - case _PC_CASE_SENSITIVE: - *ap->a_retval = 1; + case _PC_CASE_SENSITIVE: + *ap->a_retval = 1; break; - case _PC_CASE_PRESERVING: - *ap->a_retval = 1; + case _PC_CASE_PRESERVING: + *ap->a_retval = 1; break; #endif /* defined(AFS_DARWIN70_ENV) */ - default: + default: return EINVAL; } return 0; @@ -1335,36 +1375,36 @@ afs_vop_pathconf(ap) */ int afs_vop_advlock(ap) - struct vop_advlock_args /* { - struct vnode *a_vp; - caddr_t a_id; - int a_op; - struct flock *a_fl; - int a_flags; - } */ *ap; + struct vop_advlock_args /* { + * struct vnode *a_vp; + * caddr_t a_id; + * int a_op; + * struct flock *a_fl; + * int a_flags; + * } */ *ap; { int error; - struct proc *p=current_proc(); + struct proc *p = current_proc(); struct ucred cr; pcred_readlock(p); - cr=*p->p_cred->pc_ucred; + cr = *p->p_cred->pc_ucred; pcred_unlock(p); AFS_GLOCK(); - error= afs_lockctl(VTOAFS(ap->a_vp), ap->a_fl, ap->a_op, &cr, - (int) ap->a_id); + error = + afs_lockctl(VTOAFS(ap->a_vp), ap->a_fl, ap->a_op, &cr, (int)ap->a_id); AFS_GUNLOCK(); return error; } int afs_vop_truncate(ap) - struct vop_truncate_args /* { - struct vnode *a_vp; - off_t a_length; - int a_flags; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_truncate_args /* { + * struct vnode *a_vp; + * off_t a_length; + * int a_flags; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { printf("stray afs_vop_truncate\n"); return EOPNOTSUPP; @@ -1372,52 +1412,54 @@ afs_vop_truncate(ap) int afs_vop_update(ap) - struct vop_update_args /* { - struct vnode *a_vp; - struct timeval *a_access; - struct timeval *a_modify; - int a_waitfor; - } */ *ap; + struct vop_update_args /* { + * struct vnode *a_vp; + * struct timeval *a_access; + * struct timeval *a_modify; + * int a_waitfor; + * } */ *ap; { printf("stray afs_vop_update\n"); return EOPNOTSUPP; } -int afs_vop_blktooff(ap) - struct vop_blktooff_args /* { - struct vnode *a_vp; - daddr_t a_lblkno; - off_t *a_offset; - } */ *ap; +int +afs_vop_blktooff(ap) + struct vop_blktooff_args /* { + * struct vnode *a_vp; + * daddr_t a_lblkno; + * off_t *a_offset; + * } */ *ap; { - *ap->a_offset = (off_t)(ap->a_lblkno * DEV_BSIZE); - return 0; + *ap->a_offset = (off_t) (ap->a_lblkno * DEV_BSIZE); + return 0; } -int afs_vop_offtoblk(ap) - struct vop_offtoblk_args /* { - struct vnode *a_vp; - off_t a_offset; - daddr_t *a_lblkno; - } */ *ap; +int +afs_vop_offtoblk(ap) + struct vop_offtoblk_args /* { + * struct vnode *a_vp; + * off_t a_offset; + * daddr_t *a_lblkno; + * } */ *ap; { - *ap->a_lblkno = (daddr_t)(ap->a_offset / DEV_BSIZE); + *ap->a_lblkno = (daddr_t) (ap->a_offset / DEV_BSIZE); - return (0); + return (0); } -int afs_vop_cmap(ap) - struct vop_cmap_args /* { - struct vnode *a_vp; - off_t a_foffset; - size_t a_size; - daddr_t *a_bpn; - size_t *a_run; - void *a_poff; - } */ *ap; +int +afs_vop_cmap(ap) + struct vop_cmap_args /* { + * struct vnode *a_vp; + * off_t a_foffset; + * size_t a_size; + * daddr_t *a_bpn; + * size_t *a_run; + * void *a_poff; + * } */ *ap; { - *ap->a_bpn = (daddr_t)(ap->a_foffset / DEV_BSIZE); - *ap->a_run= MAX(ap->a_size, AFS_CHUNKSIZE(ap->a_foffset)); - return 0; + *ap->a_bpn = (daddr_t) (ap->a_foffset / DEV_BSIZE); + *ap->a_run = MAX(ap->a_size, AFS_CHUNKSIZE(ap->a_foffset)); + return 0; } - diff --git a/src/afs/DOC/afs_rwlocks b/src/afs/DOC/afs_rwlocks index 865979402..b554d45ef 100644 --- a/src/afs/DOC/afs_rwlocks +++ b/src/afs/DOC/afs_rwlocks @@ -14,44 +14,65 @@ our own layer. they're locked in order of vnode within the same volume. afs_AccessOK is called before locking other entries. -3. afs_xvcache locked before afs_xdcache in afs_remove, afs_symlink, etc -in the file afs_vnodeops.c +3. VCache entry vlock (Solaris only). -4. afs_xvcache. Must be able to load new cache -entries while holding locks on others. Note this means you can't lock -a cache entry while holding either of this lock, unless, as in afs_create, -the cache entry is actually created while the afs_xvcache is held. +4. DCache entries. Tentatively, multiple ones can be locked now. +Locking order between dcache entries is in increasing offset order. +However, if it turns out we never need to lock multiple dcache's, +we should just say it's not allowed, and simplify things. -5. afs_xvcb. Volume callback lock. Locked before afs_xserver in afs_RemoveVCB. +5. afs_xdcache. Protects the dcache hash tables and afs_index* in +afs_dcache.c. As with afs_xvcache below, a newly created dcache +entries can be locked while holding afs_xdcache. -6. afs_xvolume -- allows low-level server etc stuff to happen while +Bugs: afs_xvcache locked before afs_xdcache in afs_remove, afs_symlink, +etc in the file afs_vnodeops.c + +6. afs_xvcache. Must be able to load new cache entries while holding +locks on others. Note this means you can't lock a cache entry while +holding either of this lock, unless, as in afs_create, the cache entry +is actually created while the afs_xvcache is held. + +7. afs_xvcb. Volume callback lock. Locked before afs_xserver in +afs_RemoveVCB. + +8. afs_xvolume -- allows low-level server etc stuff to happen while creating a volume? -7. afs_xuser -- afs_xuser locked before afs_xserver and afs_xconn in -PUnlog. +9. afs_xuser -- afs_xuser is locked before afs_xserver and afs_xconn +in PUnlog. -8. afs_xcell -- locked before server in afs_GetCell. +10. afs_xcell -- afs_xcell locked before afs_xserver in afs_GetCell. -9. afs_xserver -- afs_xserver locked before afs_xconn in -afs_ResetUserConns. +11. afs_xserver -- locked before afs_xconn in afs_ResetUserConns. -10. afs_xsrvAddr -- afs_xserver locked before afs_xsrvAddr in +12. afs_xsrvAddr -- afs_xserver locked before afs_xsrvAddr in afs_CheckServers. -11. afs_xconn -- see above +13. afs_xconn -- see above -12. Individual volume locks. Must be after afs_xvolume so we can +14. Individual volume locks. Must be after afs_xvolume so we can iterate over all volumes without others being inserted/deleted. Same hack doesn't work for cache entry locks since we need to be able to lock multiple cache entries (but not multiple volumes) simultaneously. -13. afs_xdnlc -- locked after afs_xvcache in afs_osidnlc.c. Shouldn't +15. afs_xdnlc -- locked after afs_xvcache in afs_osidnlc.c. Shouldn't interact with any of the other locks. -14. afs_xcbhash -- No code which holds xcbhash (all of it is in -afs_cbqueue.c) attempts to get any other locks, so it should always be -obtained last. It is locked in afs_DequeueCallbacks which is called from -afs_FlushVCache with afs_xvcache write-locked. +16. afs_xcbhash -- No code which holds xcbhash (all of it is in +afs_cbqueue.c) (note: this doesn't seem to be true -- it's used +elsewhere too) attempts to get any other locks, so it should always +be obtained last. It is locked in afs_DequeueCallbacks which is +called from afs_FlushVCache with afs_xvcache write-locked. + +17. afs_dynrootDirLock -- afs_GetDynroot returns the lock held, +afs_PutDynroot releases it. + +18. Dcache entry mflock -- used to atomize accesses and updates to +dcache mflags. + +19. DCache entry tlock -- used to make atomic reads or writes to +the dcache refcount. ***** RX_ENABLE_LOCKS diff --git a/src/afs/DUX/osi_file.c b/src/afs/DUX/osi_file.c index 842f5a220..edba62fd2 100644 --- a/src/afs/DUX/osi_file.c +++ b/src/afs/DUX/osi_file.c @@ -8,24 +8,25 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_file.c,v 1.1.1.6 2001/09/11 14:24:56 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DUX/osi_file.c,v 1.9 2003/07/15 23:14:18 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ -int afs_osicred_initialized=0; -struct AFS_UCRED afs_osi_cred; +int afs_osicred_initialized = 0; +struct AFS_UCRED afs_osi_cred; afs_lock_t afs_xosi; /* lock is for tvattr */ extern struct osi_dev cacheDev; extern struct mount *afs_cacheVfsp; -void *osi_UFSOpen(ainode) - afs_int32 ainode; +void * +osi_UFSOpen(afs_int32 ainode) { static struct vnode *tags_vnode = NULL; struct inode *ip; @@ -34,70 +35,72 @@ void *osi_UFSOpen(ainode) afs_int32 code = 0; int dummy; AFS_STATCNT(osi_UFSOpen); - if(cacheDiskType != AFS_FCACHE_TYPE_UFS) + if (cacheDiskType != AFS_FCACHE_TYPE_UFS) osi_Panic("UFSOpen called for non-UFS cache\n"); - afile = (struct osi_file *) osi_AllocSmallSpace(sizeof(struct osi_file)); + afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file)); AFS_GUNLOCK(); - switch(afs_cacheVfsp->m_stat.f_type) { + switch (afs_cacheVfsp->m_stat.f_type) { case MOUNT_UFS: - code = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t)ainode, &ip, &dummy); - if (code) { - osi_FreeSmallSpace(afile); - osi_Panic("UFSOpen: igetinode failed"); - } - IN_UNLOCK(ip); - afile->vnode = ITOV(ip); - afile->size = VTOI(afile->vnode)->i_size; - afile->offset = 0; - afile->proc = NULL; - afile->inum = ainode; /* for hint validity checking */ - break; - case MOUNT_MSFS: { - char path[1024]; - struct nameidata nd, *ndp = &nd; - struct utask_nd utnd = { NULL, NULL }; - struct vattr attr; - - memset(&nd, 0, sizeof(nd)); - ndp->ni_utnd = &utnd; - ndp->ni_nameiop = LOOKUP; - ndp->ni_cred = &afs_osi_cred; - ndp->ni_segflg = UIO_SYSSPACE; - - /* get hold of a vnode for the .tags directory, so we can - lookup files relative to it */ - if(tags_vnode == NULL) { - ndp->ni_cdir = afs_cacheVfsp->m_vnodecovered; - strcpy(path, afs_cacheVfsp->m_stat.f_mntonname); - strcat(path, "/.tags"); - ndp->ni_dirp = path; - if((code = namei(ndp))) - osi_Panic("failed to lookup %s (%d)", path, code); - tags_vnode = ndp->ni_vp; - } - sprintf(path, "%d", ainode); - ndp->ni_dirp = path; - ndp->ni_cdir = tags_vnode; - if((code = namei(ndp))) - osi_Panic("failed to lookup %s (%d)", path, code); - - /* XXX this sucks, chances are we're going to do this again right - away, but apparently we can't just set the size to 0 */ - VOP_GETATTR(ndp->ni_vp, &attr, &afs_osi_cred, code); - if(code) - osi_Panic("failed to stat %s (%d)", path, code); - - afile->vnode = ndp->ni_vp; - afile->size = attr.va_size; - afile->offset = 0; - afile->proc = NULL; - afile->inum = ainode; /* for hint validity checking */ - break; - } + code = + igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t) ainode, + &ip, &dummy); + if (code) { + osi_FreeSmallSpace(afile); + osi_Panic("UFSOpen: igetinode failed"); + } + IN_UNLOCK(ip); + afile->vnode = ITOV(ip); + afile->size = VTOI(afile->vnode)->i_size; + afile->offset = 0; + afile->proc = NULL; + afile->inum = ainode; /* for hint validity checking */ + break; + case MOUNT_MSFS:{ + char path[1024]; + struct nameidata nd, *ndp = &nd; + struct utask_nd utnd = { NULL, NULL }; + struct vattr attr; + + memset(&nd, 0, sizeof(nd)); + ndp->ni_utnd = &utnd; + ndp->ni_nameiop = LOOKUP; + ndp->ni_cred = &afs_osi_cred; + ndp->ni_segflg = UIO_SYSSPACE; + + /* get hold of a vnode for the .tags directory, so we can + * lookup files relative to it */ + if (tags_vnode == NULL) { + ndp->ni_cdir = afs_cacheVfsp->m_vnodecovered; + strcpy(path, afs_cacheVfsp->m_stat.f_mntonname); + strcat(path, "/.tags"); + ndp->ni_dirp = path; + if ((code = namei(ndp))) + osi_Panic("failed to lookup %s (%d)", path, code); + tags_vnode = ndp->ni_vp; + } + sprintf(path, "%d", ainode); + ndp->ni_dirp = path; + ndp->ni_cdir = tags_vnode; + if ((code = namei(ndp))) + osi_Panic("failed to lookup %s (%d)", path, code); + + /* XXX this sucks, chances are we're going to do this again right + * away, but apparently we can't just set the size to 0 */ + VOP_GETATTR(ndp->ni_vp, &attr, &afs_osi_cred, code); + if (code) + osi_Panic("failed to stat %s (%d)", path, code); + + afile->vnode = ndp->ni_vp; + afile->size = attr.va_size; + afile->offset = 0; + afile->proc = NULL; + afile->inum = ainode; /* for hint validity checking */ + break; + } default: - osi_Panic("UFSOpen called for unknown cache-type (%d)", + osi_Panic("UFSOpen called for unknown cache-type (%d)", afs_cacheVfsp->m_stat.f_type); } @@ -105,13 +108,13 @@ void *osi_UFSOpen(ainode) return afile; } -afs_osi_Stat(afile, astat) - register struct osi_file *afile; - register struct osi_stat *astat; { +int +afs_osi_Stat(register struct osi_file *afile, register struct osi_stat *astat) +{ register afs_int32 code; struct vattr tvattr; AFS_STATCNT(osi_Stat); - MObtainWriteLock(&afs_xosi,320); + MObtainWriteLock(&afs_xosi, 320); AFS_GUNLOCK(); VOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred, code); AFS_GLOCK(); @@ -125,21 +128,21 @@ afs_osi_Stat(afile, astat) return code; } -osi_UFSClose(afile) - register struct osi_file *afile; - { - AFS_STATCNT(osi_Close); - if(afile->vnode) { +int +osi_UFSClose(register struct osi_file *afile) +{ + AFS_STATCNT(osi_Close); + if (afile->vnode) { AFS_RELE(afile->vnode); - } - - osi_FreeSmallSpace(afile); - return 0; - } - -osi_UFSTruncate(afile, asize) - register struct osi_file *afile; - afs_int32 asize; { + } + + osi_FreeSmallSpace(afile); + return 0; +} + +int +osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize) +{ struct AFS_UCRED *oldCred; struct vattr tvattr; register afs_int32 code; @@ -151,105 +154,107 @@ osi_UFSTruncate(afile, asize) * small enough. Check now and save some time. */ code = afs_osi_Stat(afile, &tstat); - if (code || tstat.size <= asize) return code; - MObtainWriteLock(&afs_xosi,321); + if (code || tstat.size <= asize) + return code; + MObtainWriteLock(&afs_xosi, 321); VATTR_NULL(&tvattr); /* note that this credential swapping stuff is only necessary because - of ufs's references directly to u.u_cred instead of to - credentials parameter. Probably should fix ufs some day. */ - oldCred = u.u_cred; /* remember old credentials pointer */ - u.u_cred = &afs_osi_cred; /* temporarily use superuser credentials */ + * of ufs's references directly to u.u_cred instead of to + * credentials parameter. Probably should fix ufs some day. */ + oldCred = u.u_cred; /* remember old credentials pointer */ + u.u_cred = &afs_osi_cred; /* temporarily use superuser credentials */ tvattr.va_size = asize; AFS_GUNLOCK(); VOP_SETATTR(afile->vnode, &tvattr, &afs_osi_cred, code); AFS_GLOCK(); - u.u_cred = oldCred; /* restore */ + u.u_cred = oldCred; /* restore */ MReleaseWriteLock(&afs_xosi); return code; } -void osi_DisableAtimes(avp) -struct vnode *avp; +void +osi_DisableAtimes(struct vnode *avp) { - struct inode *ip; - assert(avp->v_tag == VT_UFS); - ip = VTOI(avp); - ip->i_flag &= ~IACC; + struct inode *ip; + assert(avp->v_tag == VT_UFS); + ip = VTOI(avp); + ip->i_flag &= ~IACC; } /* Generic read interface */ -afs_osi_Read(afile, offset, aptr, asize) - register struct osi_file *afile; - int offset; - char *aptr; - afs_int32 asize; { +int +afs_osi_Read(register struct osi_file *afile, int offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; unsigned int resid; register afs_int32 code; - register afs_int32 cnt1=0; + register afs_int32 cnt1 = 0; AFS_STATCNT(osi_Read); /** * If the osi_file passed in is NULL, panic only if AFS is not shutting * down. No point in crashing when we are already shutting down */ - if ( !afile ) { - if ( !afs_shuttingdown ) + if (!afile) { + if (!afs_shuttingdown) osi_Panic("osi_Read called with null param"); else return EIO; } - if (offset != -1) afile->offset = offset; + if (offset != -1) + afile->offset = offset; AFS_GUNLOCK(); - code = gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset, - AFS_UIOSYS, IO_UNIT, &afs_osi_cred, &resid); + code = + gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset, + AFS_UIOSYS, IO_UNIT, &afs_osi_cred, &resid); AFS_GLOCK(); if (code == 0) { code = asize - resid; afile->offset += code; osi_DisableAtimes(afile->vnode); - } - else { + } else { afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid, - ICL_TYPE_INT32, code); + ICL_TYPE_INT32, code); code = -1; } return code; } /* Generic write interface */ -afs_osi_Write(afile, offset, aptr, asize) - register struct osi_file *afile; - char *aptr; - afs_int32 offset; - afs_int32 asize; { +int +afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; unsigned int resid; register afs_int32 code; AFS_STATCNT(osi_Write); - if ( !afile ) - osi_Panic("afs_osi_Write called with null param"); - if (offset != -1) afile->offset = offset; + if (!afile) + osi_Panic("afs_osi_Write called with null param"); + if (offset != -1) + afile->offset = offset; { struct ucred *tmpcred = u.u_cred; u.u_cred = &afs_osi_cred; AFS_GUNLOCK(); - code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, afile->offset, - AFS_UIOSYS, IO_UNIT, &afs_osi_cred, &resid); + code = + gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, + afile->offset, AFS_UIOSYS, IO_UNIT, &afs_osi_cred, + &resid); AFS_GLOCK(); u.u_cred = tmpcred; } if (code == 0) { code = asize - resid; afile->offset += code; - } - else { + } else { code = -1; } if (afile->proc) { - (*afile->proc)(afile, code); + (*afile->proc) (afile, code); } return code; } @@ -258,9 +263,8 @@ afs_osi_Write(afile, offset, aptr, asize) /* This work should be handled by physstrat in ca/machdep.c. This routine written from the RT NFS port strategy routine. It has been generalized a bit, but should still be pretty clear. */ -int afs_osi_MapStrategy(aproc, bp) - int (*aproc)(); - register struct buf *bp; +int +afs_osi_MapStrategy(int (*aproc) (), register struct buf *bp) { afs_int32 returnCode; @@ -273,13 +277,12 @@ int afs_osi_MapStrategy(aproc, bp) void -shutdown_osifile() +shutdown_osifile(void) { - extern int afs_cold_shutdown; + extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); - if (afs_cold_shutdown) { - afs_osicred_initialized = 0; - } + AFS_STATCNT(shutdown_osifile); + if (afs_cold_shutdown) { + afs_osicred_initialized = 0; + } } - diff --git a/src/afs/DUX/osi_groups.c b/src/afs/DUX/osi_groups.c index cca17fbf1..f12553871 100644 --- a/src/afs/DUX/osi_groups.c +++ b/src/afs/DUX/osi_groups.c @@ -14,33 +14,27 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_groups.c,v 1.1.1.4 2001/07/14 22:19:36 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DUX/osi_groups.c,v 1.6 2003/07/15 23:14:18 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/afs_stats.h" /* statistics */ static int -afs_getgroups( - struct ucred *cred, - int ngroups, - gid_t *gidset); + afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset); static int -afs_setgroups( - struct proc *proc, - struct ucred **cred, - int ngroups, - gid_t *gidset, - int change_parent); + afs_setgroups(struct proc *proc, struct ucred **cred, int ngroups, + gid_t * gidset, int change_parent); int Afs_xsetgroups(p, args, retval) - struct proc *p; - void *args; - int *retval; + struct proc *p; + void *args; + int *retval; { int code = 0; struct vrequest treq; @@ -50,7 +44,8 @@ Afs_xsetgroups(p, args, retval) code = afs_InitReq(&treq, u.u_cred); AFS_GUNLOCK(); - if (code) return code; + if (code) + return code; code = setgroups(p, args, retval); /* Note that if there is a pag already in the new groups we don't @@ -70,11 +65,11 @@ Afs_xsetgroups(p, args, retval) int setpag(proc, cred, pagvalue, newpag, change_parent) - struct proc *proc; - struct ucred **cred; - afs_uint32 pagvalue; - afs_uint32 *newpag; - afs_uint32 change_parent; + struct proc *proc; + struct ucred **cred; + afs_uint32 pagvalue; + afs_uint32 *newpag; + afs_uint32 change_parent; { gid_t gidset[NGROUPS]; int ngroups, code; @@ -87,12 +82,12 @@ setpag(proc, cred, pagvalue, newpag, change_parent) if (ngroups + 2 > NGROUPS) { return (E2BIG); } - for (j = ngroups -1; j >= 0; j--) { - gidset[j+2] = gidset[j]; - } + for (j = ngroups - 1; j >= 0; j--) { + gidset[j + 2] = gidset[j]; + } ngroups += 2; } - *newpag = (pagvalue == -1 ? genpag(): pagvalue); + *newpag = (pagvalue == -1 ? genpag() : pagvalue); afs_get_groups_from_pag(*newpag, &gidset[0], &gidset[1]); code = afs_setgroups(proc, cred, ngroups, gidset, change_parent); return code; @@ -100,10 +95,7 @@ setpag(proc, cred, pagvalue, newpag, change_parent) static int -afs_getgroups( - struct ucred *cred, - int ngroups, - gid_t *gidset) +afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) { int ngrps, savengrps; gid_t *gp; @@ -112,19 +104,15 @@ afs_getgroups( savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); gp = cred->cr_groups; while (ngrps--) - *gidset++ = *gp++; + *gidset++ = *gp++; return savengrps; } static int -afs_setgroups( - struct proc *proc, - struct ucred **cred, - int ngroups, - gid_t *gidset, - int change_parent) +afs_setgroups(struct proc *proc, struct ucred **cred, int ngroups, + gid_t * gidset, int change_parent) { int ngrps; int i; @@ -152,5 +140,5 @@ afs_setgroups( substitute_real_creds(proc, NOUID, NOUID, NOGID, NOGID, newcr); } *cred = newcr; - return(0); + return (0); } diff --git a/src/afs/DUX/osi_inode.c b/src/afs/DUX/osi_inode.c index 7ed70b301..128a962fd 100644 --- a/src/afs/DUX/osi_inode.c +++ b/src/afs/DUX/osi_inode.c @@ -14,14 +14,15 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_inode.c,v 1.1.1.6 2001/07/14 22:19:37 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DUX/osi_inode.c,v 1.12 2003/07/15 23:14:18 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/osi_inode.h" -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/osi_inode.h" +#include "afs/afs_stats.h" /* statistics stuff */ #include /* given a vnode, return the `inode number'; if it's a UFS vnode just @@ -34,28 +35,28 @@ osi_vnodeToInumber(struct vnode *vnode) struct vattr attr; /* use faster version with UFS */ - if(vnode->v_tag == VT_UFS) + if (vnode->v_tag == VT_UFS) return VTOI(vnode)->i_number; /* otherwise stat the file */ VOP_GETATTR(vnode, &attr, NULL, error); - if(error) + if (error) osi_Panic("VOP_GETATTR = %d", error); return attr.va_fileid; } /* return the id of the device containing the file */ afs_uint32 -osi_vnodeToDev(struct vnode *vnode) +osi_vnodeToDev(struct vnode * vnode) { int error; struct vattr attr; /* use faster version with UFS */ - if(vnode->v_tag == VT_UFS) + if (vnode->v_tag == VT_UFS) return VTOI(vnode)->i_dev; /* otherwise stat the file */ VOP_GETATTR(vnode, &attr, NULL, error); - if(error) + if (error) osi_Panic("VOP_GETATTR = %d", error); return attr.va_rdev; } @@ -78,43 +79,44 @@ getinode(fs, dev, inode, ipp, perror) register struct ufsmount *ump; register struct vnode *vp; register struct mount *mp; - + MOUNTLIST_LOCK(); - if (mp = rootfs) do { - /* - * XXX Also do the test for MFS - */ + if (mp = rootfs) + do { + /* + * XXX Also do the test for MFS + */ #undef m_data #undef m_next - if (mp->m_stat.f_type == MOUNT_UFS) { - MOUNTLIST_UNLOCK(); - ump = VFSTOUFS(mp); - if (ump->um_fs == NULL) - break; - if (ump->um_dev == dev) { - fs = ump->um_mountp; + if (mp->m_stat.f_type == MOUNT_UFS) { + MOUNTLIST_UNLOCK(); + ump = VFSTOUFS(mp); + if (ump->um_fs == NULL) + break; + if (ump->um_dev == dev) { + fs = ump->um_mountp; + } + MOUNTLIST_LOCK(); } - MOUNTLIST_LOCK(); - } #ifdef AFS_DUX50_ENV #define m_next m_nxt #endif - mp = mp->m_next; - } while (mp != rootfs); + mp = mp->m_next; + } while (mp != rootfs); MOUNTLIST_UNLOCK(); if (!fs) - return(ENXIO); + return (ENXIO); } - vp = (struct vnode *) fake_vnode; + vp = (struct vnode *)fake_vnode; fake_inode_init(vp, fs); assert(vp->v_tag == VT_UFS); code = iget(VTOI(vp), inode, &ip, 0); if (code != 0) { *perror = BAD_IGET; - return code; + return code; } else { *ipp = ip; - return(0); + return (0); } } @@ -134,26 +136,26 @@ igetinode(vfsp, dev, inode, ipp, perror) AFS_STATCNT(igetinode); if ((code = getinode(vfsp, dev, inode, &ip, perror)) != 0) { - return(code); + return (code); } if (ip->i_mode == 0) { /* Not an allocated inode */ - iforget(ip); - return(ENOENT); + iforget(ip); + return (ENOENT); } - if (ip->i_nlink == 0 || (ip->i_mode&IFMT) != IFREG) { + if (ip->i_nlink == 0 || (ip->i_mode & IFMT) != IFREG) { iput(ip); - return(ENOENT); + return (ENOENT); } *ipp = ip; - return(0); + return (0); } iforget(ip) -struct inode *ip; + struct inode *ip; { struct vnode *vp = ITOV(ip); @@ -176,72 +178,70 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, retval) long *retval; long dev, near_inode, param1, param2, param3, param4; { - int dummy, err=0; + int dummy, err = 0; struct inode *ip, *newip; register int code; struct vnode *vp; - + AFS_STATCNT(afs_syscall_icreate); - + if (!afs_suser()) - return(EPERM); + return (EPERM); - code = getinode(0, (dev_t)dev, 2, &ip, &dummy); + code = getinode(0, (dev_t) dev, 2, &ip, &dummy); if (code) { - return(ENOENT); + return (ENOENT); } - code = ialloc(ip, (ino_t)near_inode, 0, &newip); + code = ialloc(ip, (ino_t) near_inode, 0, &newip); iput(ip); if (code) { - return(code); + return (code); } IN_LOCK(newip); - newip->i_flag |= IACC|IUPD|ICHG; - + newip->i_flag |= IACC | IUPD | ICHG; + newip->i_nlink = 1; newip->i_mode = IFREG; - + IN_UNLOCK(newip); vp = ITOV(newip); VN_LOCK(vp); vp->v_type = VREG; VN_UNLOCK(vp); - - if ( !vp->v_object) - { - extern struct vfs_ubcops ufs_ubcops; - extern struct vm_ubc_object* ubc_object_allocate(); - struct vm_ubc_object* vop; - vop = ubc_object_allocate(&vp, &ufs_ubcops, - vp->v_mount->m_funnel); - VN_LOCK(vp); - vp->v_object = vop; - VN_UNLOCK(vp); - } - - + + if (!vp->v_object) { + extern struct vfs_ubcops ufs_ubcops; + extern struct vm_ubc_object *ubc_object_allocate(); + struct vm_ubc_object *vop; + vop = ubc_object_allocate(&vp, &ufs_ubcops, vp->v_mount->m_funnel); + VN_LOCK(vp); + vp->v_object = vop; + VN_UNLOCK(vp); + } + + IN_LOCK(newip); - newip->i_flags |= IC_XUID|IC_XGID; + newip->i_flags |= IC_XUID | IC_XGID; newip->i_flags &= ~IC_PROPLIST; newip->i_vicep1 = param1; - if (param2 == 0x1fffffff/*INODESPECIAL*/) { + if (param2 == 0x1fffffff /*INODESPECIAL*/) { newip->i_vicep2 = ((0x1fffffff << 3) + (param4 & 0x3)); - newip->i_vicep3a = (u_short)(param3 >> 16); - newip->i_vicep3b = (u_short)param3; + newip->i_vicep3a = (u_short) (param3 >> 16); + newip->i_vicep3b = (u_short) param3; } else { - newip->i_vicep2 = (((param2 >> 16) & 0x1f) << 27) + - (((param4 >> 16) & 0x1f) << 22) + - (param3 & 0x3fffff); - newip->i_vicep3a = (u_short)param4; - newip->i_vicep3b = (u_short)param2; + newip->i_vicep2 = + (((param2 >> 16) & 0x1f) << 27) + + (((param4 >> 16) & 0x1f) << 22) + (param3 & 0x3fffff); + newip->i_vicep3a = (u_short) param4; + newip->i_vicep3b = (u_short) param2; } newip->i_vicemagic = VICEMAGIC; - + *retval = newip->i_number; IN_UNLOCK(newip); iput(newip); - return(code); + return (code); } @@ -251,7 +251,7 @@ afs_syscall_iopen(dev, inode, usrmod, retval) { struct file *fp; struct inode *ip; - struct vnode *vp = (struct vnode *)0; + struct vnode *vp = NULL; int dummy; int fd; extern struct fileops vnops; @@ -259,35 +259,35 @@ afs_syscall_iopen(dev, inode, usrmod, retval) #ifdef AFS_DUX50_ENV struct ufile_entry *fe; #endif - + AFS_STATCNT(afs_syscall_iopen); - + if (!afs_suser()) - return(EPERM); + return (EPERM); - code = igetinode(0, (dev_t)dev, (ino_t)inode, &ip, &dummy); + code = igetinode(0, (dev_t) dev, (ino_t) inode, &ip, &dummy); if (code) { - return(code); + return (code); } #ifdef AFS_DUX50_ENV if ((code = falloc(&fp, &fd, &fe)) != 0) { - iput(ip); - return(code); + iput(ip); + return (code); } #else if ((code = falloc(&fp, &fd)) != 0) { iput(ip); - return(code); + return (code); } #endif IN_UNLOCK(ip); - + FP_LOCK(fp); - fp->f_flag = (usrmod-FOPEN) & FMASK; + fp->f_flag = (usrmod - FOPEN) & FMASK; fp->f_type = DTYPE_VNODE; fp->f_ops = &vnops; - fp->f_data = (caddr_t)ITOV(ip); - + fp->f_data = (caddr_t) ITOV(ip); + FP_UNLOCK(fp); #ifdef AFS_DUX50_ENV u_set_fe(fd, fe, fp, &u.u_file_state); @@ -295,7 +295,7 @@ afs_syscall_iopen(dev, inode, usrmod, retval) U_FD_SET(fd, fp, &u.u_file_state); #endif *retval = fd; - return(0); + return (0); } @@ -311,18 +311,18 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount) int dummy; struct inode *ip; register int code; - + if (!afs_suser()) - return(EPERM); + return (EPERM); - code = igetinode(0, (dev_t)dev, (ino_t)inode, &ip, &dummy); + code = igetinode(0, (dev_t) dev, (ino_t) inode, &ip, &dummy); if (code) { - return(code); + return (code); } if (!IS_VICEMAGIC(ip)) { - return(EPERM); + return (EPERM); } else if (ip->i_vicep1 != inode_p1) { - return(ENXIO); + return (ENXIO); } ip->i_nlink += amount; if (ip->i_nlink == 0) { @@ -330,5 +330,5 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount) } ip->i_flag |= ICHG; iput(ip); - return(0); + return (0); } diff --git a/src/afs/DUX/osi_inode.h b/src/afs/DUX/osi_inode.h index ea16d3350..505528292 100644 --- a/src/afs/DUX/osi_inode.h +++ b/src/afs/DUX/osi_inode.h @@ -34,7 +34,7 @@ #define di_vicep2 di_gid #define di_vicep3a di_bcuid #define di_vicep3b di_bcgid -#define di_vicep4 di_spare[0] /* not used */ +#define di_vicep4 di_spare[0] /* not used */ #define IS_VICEMAGIC(ip) ((ip)->i_vicemagic == VICEMAGIC) #define IS_DVICEMAGIC(dp) ((dp)->di_vicemagic == VICEMAGIC) diff --git a/src/afs/DUX/osi_misc.c b/src/afs/DUX/osi_misc.c index 774ceb31b..bd3208bd5 100644 --- a/src/afs/DUX/osi_misc.c +++ b/src/afs/DUX/osi_misc.c @@ -13,12 +13,13 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_misc.c,v 1.1.1.4 2001/07/14 22:19:37 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DUX/osi_misc.c,v 1.6 2003/07/15 23:14:19 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ /* * afs_suser() returns true if the caller is superuser, false otherwise. @@ -26,11 +27,12 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_misc.c,v 1.1.1.4 2001/07/14 * Note that it must NOT set errno. */ -afs_suser() { +afs_suser() +{ int error; if ((error = suser(u.u_cred, &u.u_acflag)) == 0) { - return(1); + return (1); } - return(0); + return (0); } diff --git a/src/afs/DUX/osi_prototypes.h b/src/afs/DUX/osi_prototypes.h new file mode 100644 index 000000000..4bc45e9e8 --- /dev/null +++ b/src/afs/DUX/osi_prototypes.h @@ -0,0 +1,12 @@ +/* + * osi_prototypes.h + * + * Exported macos support routines. + */ +#ifndef _OSI_PROTO_H_ +#define _OSI_PROTO_H_ + +/* osi_file.c */ +extern afs_rwlock_t afs_xosi; + +#endif /* _OSI_PROTO_H_ */ diff --git a/src/afs/DUX/osi_sleep.c b/src/afs/DUX/osi_sleep.c index 158771bbc..a036738c7 100644 --- a/src/afs/DUX/osi_sleep.c +++ b/src/afs/DUX/osi_sleep.c @@ -8,38 +8,40 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_sleep.c,v 1.1.1.4 2001/07/14 22:19:36 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DUX/osi_sleep.c,v 1.9 2003/07/15 23:14:19 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok); -void afs_osi_Wakeup(char *event); -void afs_osi_Sleep(char *event); static char waitV; -void afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) +void +afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) { AFS_STATCNT(osi_InitWaitHandle); achandle->proc = (caddr_t) 0; } /* cancel osi_Wait */ -void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) +void +afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) { caddr_t proc; AFS_STATCNT(osi_CancelWait); proc = achandle->proc; - if (proc == 0) return; - achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ + if (proc == 0) + return; + achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ afs_osi_Wakeup(&waitV); } @@ -47,13 +49,14 @@ void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) * Waits for data on ahandle, or ams ms later. ahandle may be null. * Returns 0 if timeout and EINTR if signalled. */ -int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) +int +afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) { int code; afs_int32 endTime, tid; AFS_STATCNT(osi_Wait); - endTime = osi_Time() + (ams/1000); + endTime = osi_Time() + (ams / 1000); if (ahandle) ahandle->proc = (caddr_t) u.u_procp; do { @@ -61,7 +64,8 @@ int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) code = 0; code = osi_TimedSleep(&waitV, ams, aintok); - if (code) break; /* if something happened, quit now */ + if (code) + break; /* if something happened, quit now */ /* if we we're cancelled, quit now */ if (ahandle && (ahandle->proc == (caddr_t) 0)) { /* we've been signalled */ @@ -79,19 +83,20 @@ typedef struct afs_event { char *event; /* lwp event: an address */ int refcount; /* Is it in use? */ int seq; /* Sequence number: this is incremented - by wakeup calls; wait will not return until - it changes */ + * by wakeup calls; wait will not return until + * it changes */ int cond; } afs_event_t; #define HASHSIZE 128 -afs_event_t *afs_evhasht[HASHSIZE];/* Hash table for events */ +afs_event_t *afs_evhasht[HASHSIZE]; /* Hash table for events */ #define afs_evhash(event) (afs_uint32) ((((long)event)>>2) & (HASHSIZE-1)); int afs_evhashcnt = 0; /* Get and initialize event structure corresponding to lwp event (i.e. address) * */ -static afs_event_t *afs_getevent(char *event) +static afs_event_t * +afs_getevent(char *event) { afs_event_t *evp, *newp = 0; int hashcode; @@ -109,7 +114,7 @@ static afs_event_t *afs_getevent(char *event) evp = evp->next; } if (!newp) { - newp = (afs_event_t *) osi_AllocSmallSpace(sizeof (afs_event_t)); + newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t)); afs_evhashcnt++; newp->next = afs_evhasht[hashcode]; afs_evhasht[hashcode] = newp; @@ -124,7 +129,8 @@ static afs_event_t *afs_getevent(char *event) #define relevent(evp) ((evp)->refcount--) -void afs_osi_Sleep(char *event) +void +afs_osi_Sleep(void *event) { struct afs_event *evp; int seq; @@ -133,7 +139,7 @@ void afs_osi_Sleep(char *event) seq = evp->seq; while (seq == evp->seq) { AFS_ASSERT_GLOCK(); - assert_wait((vm_offset_t)(&evp->cond), 0); + assert_wait((vm_offset_t) (&evp->cond), 0); AFS_GUNLOCK(); thread_block(); AFS_GLOCK(); @@ -141,6 +147,13 @@ void afs_osi_Sleep(char *event) relevent(evp); } +int +afs_osi_SleepSig(void *event) +{ + afs_osi_Sleep(event); + return 0; +} + /* osi_TimedSleep * * Arguments: @@ -150,38 +163,43 @@ void afs_osi_Sleep(char *event) * * Returns 0 if timeout and EINTR if signalled. */ -static int osi_TimedSleep(char *event, afs_int32 ams, int aintok) +static int +osi_TimedSleep(char *event, afs_int32 ams, int aintok) { int code = 0; struct afs_event *evp; int ticks; - ticks = ( ams * afs_hz )/1000; + ticks = (ams * afs_hz) / 1000; evp = afs_getevent(event); - assert_wait((vm_offset_t)(&evp->cond), aintok); + assert_wait((vm_offset_t) (&evp->cond), aintok); AFS_GUNLOCK(); thread_set_timeout(ticks); thread_block(); AFS_GLOCK(); if (current_thread()->wait_result != THREAD_AWAKENED) code = EINTR; - + relevent(evp); return code; } -void afs_osi_Wakeup(char *event) +int +afs_osi_Wakeup(void *event) { + int ret = 1; struct afs_event *evp; evp = afs_getevent(event); if (evp->refcount > 1) { - evp->seq++; - thread_wakeup((vm_offset_t)(&evp->cond)); + evp->seq++; + thread_wakeup((vm_offset_t) (&evp->cond)); + ret = 0; } relevent(evp); + return ret; } diff --git a/src/afs/DUX/osi_vfsops.c b/src/afs/DUX/osi_vfsops.c index f66430cee..83e8eadac 100644 --- a/src/afs/DUX/osi_vfsops.c +++ b/src/afs/DUX/osi_vfsops.c @@ -11,13 +11,14 @@ * osi_vfsops.c for DUX */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_vfsops.c,v 1.1.1.8 2002/08/02 04:28:50 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DUX/osi_vfsops.c,v 1.15 2003/07/15 23:14:19 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics stuff */ #include #include #include @@ -37,10 +38,8 @@ udecl_simple_lock_data(, afsmntid_lock) #define AFSMNTID_LOCK() usimple_lock(&afsmntid_lock) #define AFSMNTID_UNLOCK() usimple_unlock(&afsmntid_lock) #define AFSMNTID_LOCK_INIT() usimple_lock_init(&afsmntid_lock) - - -int mp_afs_mount(struct mount *afsp,char * path, caddr_t data, - struct nameidata *ndp) + int mp_afs_mount(struct mount *afsp, char *path, caddr_t data, + struct nameidata *ndp) { u_int size; @@ -51,7 +50,7 @@ int mp_afs_mount(struct mount *afsp,char * path, caddr_t data, AFS_GLOCK(); AFS_STATCNT(afs_mount); - if (afs_globalVFS) { /* Don't allow remounts. */ + if (afs_globalVFS) { /* Don't allow remounts. */ AFS_GUNLOCK(); return (EBUSY); } @@ -65,7 +64,7 @@ int mp_afs_mount(struct mount *afsp,char * path, caddr_t data, afsp->m_stat.f_fsid.val[1] = MOUNT_AFS; AFSMNTID_LOCK(); if (++afs_mntid == 0) - ++afs_mntid; + ++afs_mntid; AFSMNTID_UNLOCK(); BM(AFSMNTID_LOCK()); tfsid.val[0] = makedev(130, afs_mntid); @@ -73,29 +72,30 @@ int mp_afs_mount(struct mount *afsp,char * path, caddr_t data, BM(AFSMNTID_UNLOCK()); while (xmp = getvfs(&tfsid)) { - UNMOUNT_READ_UNLOCK(xmp); - tfsid.val[0]++; - AFSMNTID_LOCK(); - afs_mntid++; - AFSMNTID_UNLOCK(); + UNMOUNT_READ_UNLOCK(xmp); + tfsid.val[0]++; + AFSMNTID_LOCK(); + afs_mntid++; + AFSMNTID_UNLOCK(); } if (major(tfsid.val[0]) != 130) { AFS_GUNLOCK(); - return (ENOENT); + return (ENOENT); } afsp->m_stat.f_fsid.val[0] = tfsid.val[0]; afsp->m_stat.f_mntonname = AFS_KALLOC(MNAMELEN); - afsp->m_stat.f_mntfromname = AFS_KALLOC(MNAMELEN); - if ( !afsp->m_stat.f_mntonname || !afsp->m_stat.f_mntfromname) + afsp->m_stat.f_mntfromname = AFS_KALLOC(MNAMELEN); + if (!afsp->m_stat.f_mntonname || !afsp->m_stat.f_mntfromname) panic("malloc failure in afs_mount\n"); memset(afsp->m_stat.f_mntonname, 0, MNAMELEN); memset(afsp->m_stat.f_mntfromname, 0, MNAMELEN); - AFS_COPYINSTR(path, (caddr_t)afsp->m_stat.f_mntonname, MNAMELEN, &size, code); + AFS_COPYINSTR(path, (caddr_t) afsp->m_stat.f_mntonname, MNAMELEN, &size, + code); memcpy(afsp->m_stat.f_mntfromname, "AFS", 4); AFS_GUNLOCK(); - (void) mp_afs_statfs(afsp); + (void)mp_afs_statfs(afsp); AFS_GLOCK(); afs_vfsdev = afsp->m_stat.f_fsid.val[0]; @@ -109,7 +109,8 @@ int mp_afs_mount(struct mount *afsp,char * path, caddr_t data, } -int mp_afs_unmount (struct mount *afsp, int flag) +int +mp_afs_unmount(struct mount *afsp, int flag) { AFS_GLOCK(); AFS_STATCNT(afs_unmount); @@ -120,26 +121,32 @@ int mp_afs_unmount (struct mount *afsp, int flag) } -int mp_afs_start(struct mount *mp, int flags) +int +mp_afs_start(struct mount *mp, int flags) { - return(0); + return (0); } -int mp_afs_root (struct mount *afsp, struct vnode **avpp) +int +mp_afs_root(struct mount *afsp, struct vnode **avpp) { register afs_int32 code = 0; struct vrequest treq; - register struct vcache *tvp=0; + register struct vcache *tvp = 0; AFS_GLOCK(); AFS_STATCNT(afs_root); if (afs_globalVp && (afs_globalVp->states & CStatd)) { tvp = afs_globalVp; } else { - if (!(code = afs_InitReq(&treq, u.u_cred)) && - !(code = afs_CheckInit())) { - tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); + if (afs_globalVp) { + afs_PutVCache(afs_globalVp); + afs_globalVp = NULL; + } + + if (!(code = afs_InitReq(&treq, u.u_cred)) + && !(code = afs_CheckInit())) { + tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL); /* we really want this to stay around */ if (tvp) { afs_globalVp = tvp; @@ -152,7 +159,7 @@ int mp_afs_root (struct mount *afsp, struct vnode **avpp) AFS_GUNLOCK(); VN_HOLD(vp); VN_LOCK(vp); - vp->v_flag |= VROOT; /* No-op on Ultrix 2.2 */ + vp->v_flag |= VROOT; /* No-op on Ultrix 2.2 */ VN_UNLOCK(vp); AFS_GLOCK(); @@ -167,12 +174,13 @@ int mp_afs_root (struct mount *afsp, struct vnode **avpp) } -mp_afs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg) +mp_afs_quotactl(struct mount * mp, int cmd, uid_t uid, caddr_t arg) { return EOPNOTSUPP; } -int mp_afs_statfs(struct mount *afsp) +int +mp_afs_statfs(struct mount *afsp) { struct nstatfs *abp = &afsp->m_stat; @@ -187,7 +195,7 @@ int mp_afs_statfs(struct mount *afsp) * storing something there. */ abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files = - abp->f_ffree = 2000000; + abp->f_ffree = 2000000; abp->f_fsize = 1024; abp->f_fsid.val[0] = afsp->m_stat.f_fsid.val[0]; @@ -198,7 +206,8 @@ int mp_afs_statfs(struct mount *afsp) } -int mp_afs_sync(struct mount *mp, int flags) +int +mp_afs_sync(struct mount *mp, int flags) { AFS_STATCNT(afs_sync); return 0; @@ -206,14 +215,16 @@ int mp_afs_sync(struct mount *mp, int flags) #ifdef AFS_DUX50_ENV -int mp_afs_smoothsync(struct mount *mp, u_int age, u_int smsync_flag) +int +mp_afs_smoothsync(struct mount *mp, u_int age, u_int smsync_flag) { AFS_STATCNT(afs_sync); return 0; } #endif -int mp_afs_fhtovp(struct mount *afsp, struct fid *fidp, struct vnode **avcp) +int +mp_afs_fhtovp(struct mount *afsp, struct fid *fidp, struct vnode **avcp) { struct vrequest treq; register code = 0; @@ -224,7 +235,7 @@ int mp_afs_fhtovp(struct mount *afsp, struct fid *fidp, struct vnode **avcp) *avcp = NULL; if ((code = afs_InitReq(&treq, u.u_cred)) == 0) { - code = afs_osi_vget((struct vcache**)avcp, fidp, &treq); + code = afs_osi_vget((struct vcache **)avcp, fidp, &treq); } afs_Trace3(afs_iclSetp, CM_TRACE_VGET, ICL_TYPE_POINTER, *avcp, @@ -264,11 +275,12 @@ int mp_afs_fhtovp(struct mount *afsp, struct fid *fidp, struct vnode **avcp) */ #define AFS_FIDDATASIZE 8 -#define AFS_SIZEOFSMALLFID 12 /* full size of fid, including len field */ -extern int afs_NFSRootOnly; /* 1 => only allow NFS mounts of /afs. */ -int afs_fid_vnodeoverflow=0, afs_fid_uniqueoverflow=0; +#define AFS_SIZEOFSMALLFID 12 /* full size of fid, including len field */ +extern int afs_NFSRootOnly; /* 1 => only allow NFS mounts of /afs. */ +int afs_fid_vnodeoverflow = 0, afs_fid_uniqueoverflow = 0; -int mp_afs_vptofh(struct vnode *avn, struct fid *fidp) +int +mp_afs_vptofh(struct vnode *avn, struct fid *fidp) { struct SmallFid Sfid; long addr[2]; @@ -284,13 +296,14 @@ int mp_afs_vptofh(struct vnode *avn, struct fid *fidp) return EIO; } - if (afs_NFSRootOnly && (avc == afs_globalVp)) rootvp = 1; + if (afs_NFSRootOnly && (avc == afs_globalVp)) + rootvp = 1; if (!afs_NFSRootOnly || rootvp) { tcell = afs_GetCell(avc->fid.Cell, READ_LOCK); Sfid.Volume = avc->fid.Fid.Volume; fidp->fid_reserved = avc->fid.Fid.Vnode; - Sfid.CellAndUnique = ((tcell->cellIndex << 24) + - (avc->fid.Fid.Unique & 0xffffff)); + Sfid.CellAndUnique = + ((tcell->cellIndex << 24) + (avc->fid.Fid.Unique & 0xffffff)); afs_PutCell(tcell, READ_LOCK); if (avc->fid.Fid.Vnode > 0xffff) afs_fid_vnodeoverflow++; @@ -308,26 +321,27 @@ int mp_afs_vptofh(struct vnode *avn, struct fid *fidp) fidp->fid_len = AFS_SIZEOFSMALLFID; if (afs_NFSRootOnly) { if (rootvp) { - memcpy(fidp->fid_data, (caddr_t)&Sfid, AFS_FIDDATASIZE); + memcpy(fidp->fid_data, (caddr_t) & Sfid, AFS_FIDDATASIZE); } else { - memcpy(fidp->fid_data, (caddr_t)addr, AFS_FIDDATASIZE); + memcpy(fidp->fid_data, (caddr_t) addr, AFS_FIDDATASIZE); } } else { - memcpy(fidp->fid_data, (caddr_t)&Sfid, AFS_FIDDATASIZE); + memcpy(fidp->fid_data, (caddr_t) & Sfid, AFS_FIDDATASIZE); } AFS_GUNLOCK(); return 0; } -int mp_Afs_init(void); /* vfs_init - defined below */ +int mp_Afs_init(void); /* vfs_init - defined below */ /* This is only called by vfs_mount when afs is going to be mounted as root. * Since we don't support diskless clients we shouldn't come here. */ -int afsmountroot=0; -int mp_afs_mountroot(struct mount *afsp, struct vnode **vp) +int afsmountroot = 0; +int +mp_afs_mountroot(struct mount *afsp, struct vnode **vp) { AFS_GLOCK(); AFS_STATCNT(afs_mountroot); @@ -340,8 +354,9 @@ int mp_afs_mountroot(struct mount *afsp, struct vnode **vp) /* It's called to setup swapping over the net for diskless clients; again * not for us. */ -int afsswapvp=0; -int mp_afs_swapvp(void) +int afsswapvp = 0; +int +mp_afs_swapvp(void) { AFS_GLOCK(); AFS_STATCNT(afs_swapvp); @@ -359,7 +374,7 @@ struct vfsops afs_vfsops = { mp_afs_quotactl, mp_afs_statfs, mp_afs_sync, - mp_afs_fhtovp, /* afs_vget */ + mp_afs_fhtovp, /* afs_vget */ mp_afs_vptofh, mp_Afs_init, mp_afs_mountroot, @@ -375,16 +390,16 @@ struct vfsops afs_vfsops = { */ #define NULL_FUNC (int (*)(int))0 -int (*afs_syscall_func)() = NULL_FUNC; -int (*afs_xsetgroups_func)() = NULL_FUNC; -int (*afs_xioctl_func)() = NULL_FUNC; +int (*afs_syscall_func) () = NULL_FUNC; +int (*afs_xsetgroups_func) () = NULL_FUNC; +int (*afs_xioctl_func) () = NULL_FUNC; afssyscall(p, args, retval) - struct proc *p; - void *args; - long *retval; + struct proc *p; + void *args; + long *retval; { - int (*func)(); + int (*func) (); int code; AFS_GLOCK(); @@ -392,18 +407,18 @@ afssyscall(p, args, retval) if (func == NULL_FUNC) { code = nosys(p, args, retval); } else { - code = (*func)(p, args, retval); + code = (*func) (p, args, retval); } AFS_GUNLOCK(); return code; } afsxsetgroups(p, args, retval) - struct proc *p; - void *args; - long *retval; + struct proc *p; + void *args; + long *retval; { - int (*func)(); + int (*func) (); int code; AFS_GLOCK(); @@ -411,18 +426,18 @@ afsxsetgroups(p, args, retval) if (func == NULL_FUNC) { code = nosys(p, args, retval); } else { - code = (*func)(p, args, retval); + code = (*func) (p, args, retval); } AFS_GUNLOCK(); return code; } afsxioctl(p, args, retval) - struct proc *p; - void *args; - long *retval; + struct proc *p; + void *args; + long *retval; { - int (*func)(); + int (*func) (); int code; AFS_GLOCK(); @@ -430,7 +445,7 @@ afsxioctl(p, args, retval) if (func == NULL_FUNC) { code = nosys(p, args, retval); } else { - code = (*func)(p, args, retval); + code = (*func) (p, args, retval); } AFS_GUNLOCK(); return code; @@ -447,15 +462,16 @@ afs_unconfig() } -cfg_subsys_attr_t afs_attributes[] = { +cfg_subsys_attr_t afs_attributes[] = { {"", 0, 0, 0, 0, 0, 0} /* must be the last element */ }; -afs_configure(cfg_op_t op, caddr_t indata, size_t indata_size, caddr_t outdata, size_t outdata_size) +afs_configure(cfg_op_t op, caddr_t indata, size_t indata_size, + caddr_t outdata, size_t outdata_size) { - cfg_attr_t *attributes; - int ret = ESUCCESS; - int i, j, size; + cfg_attr_t *attributes; + int ret = ESUCCESS; + int i, j, size; caddr_t p; switch (op) { @@ -465,11 +481,11 @@ afs_configure(cfg_op_t op, caddr_t indata, size_t indata_size, caddr_t outdata, * indata_size is the count of attributes. */ if ((ret = vfssw_add_fsname(MOUNT_AFS, &afs_vfsops, "afs")) != 0) - return(ret); + return (ret); break; case CFG_OP_UNCONFIGURE: if ((ret = afs_unconfig()) != 0) - return(ret); + return (ret); break; default: ret = EINVAL; @@ -479,22 +495,22 @@ afs_configure(cfg_op_t op, caddr_t indata, size_t indata_size, caddr_t outdata, } -int mp_Afs_init(void) +int +mp_Afs_init(void) { extern int Afs_xsetgroups(), afs_xioctl(), afs3_syscall(); - + AFS_GLOCK(); - ((struct sysent *) (&sysent[AFS_SYSCALL]))->sy_call = afs3_syscall; + ((struct sysent *)(&sysent[AFS_SYSCALL]))->sy_call = afs3_syscall; #ifdef SY_NARG - ((struct sysent *) (&sysent[AFS_SYSCALL]))->sy_info = 6; + ((struct sysent *)(&sysent[AFS_SYSCALL]))->sy_info = 6; #else - ((struct sysent *) (&sysent[AFS_SYSCALL]))->sy_parallel = 0; - ((struct sysent *) (&sysent[AFS_SYSCALL]))->sy_narg = 6; + ((struct sysent *)(&sysent[AFS_SYSCALL]))->sy_parallel = 0; + ((struct sysent *)(&sysent[AFS_SYSCALL]))->sy_narg = 6; #endif - ((struct sysent *) (&sysent[SYS_setgroups]))->sy_call = - Afs_xsetgroups; - afs_xioctl_func = afsxioctl; + ((struct sysent *)(&sysent[SYS_setgroups]))->sy_call = Afs_xsetgroups; + afs_xioctl_func = afsxioctl; afs_xsetgroups_func = afsxsetgroups; afs_syscall_func = afssyscall; AFS_GUNLOCK(); diff --git a/src/afs/DUX/osi_vm.c b/src/afs/DUX/osi_vm.c index 4a635cac6..d41afc844 100644 --- a/src/afs/DUX/osi_vm.c +++ b/src/afs/DUX/osi_vm.c @@ -8,13 +8,14 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_vm.c,v 1.1.1.5 2002/05/10 23:43:40 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DUX/osi_vm.c,v 1.8 2003/07/15 23:14:19 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ #include #include @@ -35,9 +36,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_vm.c,v 1.1.1.5 2002/05/10 2 * OSF/1 Locking: VN_LOCK has been called. */ int -osi_VM_FlushVCache(avc, slept) - struct vcache *avc; - int *slept; +osi_VM_FlushVCache(struct vcache *avc, int *slept) { if (avc->vrefCount > 1) return EBUSY; @@ -82,18 +81,17 @@ osi_VM_FlushVCache(avc, slept) * * Called with the global lock NOT held. */ -void -osi_ubc_flush_dirty_and_wait(vp, flags) -struct vnode *vp; -int flags; { +static void +osi_ubc_flush_dirty_and_wait(struct vnode *vp, int flags) +{ int retry; vm_page_t pp; int first; do { - struct vm_ubc_object* vop; - vop = (struct vm_ubc_object*)(vp->v_object); - ubc_flush_dirty(vop, flags); + struct vm_ubc_object *vop; + vop = (struct vm_ubc_object *)(vp->v_object); + ubc_flush_dirty(vop, flags); vm_object_lock(vop); if (vop->vu_dirtypl) @@ -108,14 +106,15 @@ int flags; { if (pp->pg_busy) { retry = 1; pp->pg_wait = 1; - assert_wait_mesg((vm_offset_t)pp, FALSE, "pg_wait"); + assert_wait_mesg((vm_offset_t) pp, FALSE, "pg_wait"); vm_object_unlock(vop); thread_block(); break; } } } - if (retry) continue; + if (retry) + continue; } vm_object_unlock(vop); } while (retry); @@ -127,14 +126,13 @@ int flags; { * re-obtained. */ void -osi_VM_StoreAllSegments(avc) - struct vcache *avc; +osi_VM_StoreAllSegments(struct vcache *avc) { ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); osi_ubc_flush_dirty_and_wait(AFSTOV(avc), 0); AFS_GLOCK(); - ObtainWriteLock(&avc->lock,94); + ObtainWriteLock(&avc->lock, 94); } /* Try to invalidate pages, for "fs flush" or "fs flushv"; or @@ -147,17 +145,14 @@ osi_VM_StoreAllSegments(avc) * be some pages around when we return, newly created by concurrent activity. */ void -osi_VM_TryToSmush(avc, acred, sync) - struct vcache *avc; - struct AFS_UCRED *acred; - int sync; +osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync) { ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); osi_ubc_flush_dirty_and_wait(AFSTOV(avc), 0); ubc_invalidate(AFSTOV(avc)->v_object, 0, 0, B_INVAL); AFS_GLOCK(); - ObtainWriteLock(&avc->lock,59); + ObtainWriteLock(&avc->lock, 59); } /* Purge VM for a file when its callback is revoked. @@ -165,9 +160,7 @@ osi_VM_TryToSmush(avc, acred, sync) * Locking: No lock is held, not even the global lock. */ void -osi_VM_FlushPages(avc, credp) - struct vcache *avc; - struct AFS_UCRED *credp; +osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) { ubc_flush_dirty(AFSTOV(avc)->v_object, 0); ubc_invalidate(AFSTOV(avc)->v_object, 0, 0, B_INVAL); @@ -180,11 +173,7 @@ osi_VM_FlushPages(avc, credp) * it only works on Solaris. */ void -osi_VM_Truncate(avc, alen, acred) - struct vcache *avc; - int alen; - struct AFS_UCRED *acred; +osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) { - ubc_invalidate(AFSTOV(avc)->v_object, alen, - MAXINT - alen, B_INVAL); + ubc_invalidate(AFSTOV(avc)->v_object, alen, MAXINT - alen, B_INVAL); } diff --git a/src/afs/DUX/osi_vnodeops.c b/src/afs/DUX/osi_vnodeops.c index c14e967a0..543a6453a 100644 --- a/src/afs/DUX/osi_vnodeops.c +++ b/src/afs/DUX/osi_vnodeops.c @@ -12,19 +12,20 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_vnodeops.c,v 1.1.1.7 2002/09/26 18:58:07 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/DUX/osi_vnodeops.c,v 1.11 2003/07/15 23:14:19 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ #include #include -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" extern int afs_lookup(), afs_create(), afs_noop(), afs_open(), afs_close(); @@ -48,48 +49,48 @@ int mp_afs_ioctl(); /* AFS vnodeops */ struct vnodeops Afs_vnodeops = { - mp_afs_lookup, - mp_afs_create, - afs_noop, /* vn_mknod */ - mp_afs_open, - mp_afs_close, - mp_afs_access, - mp_afs_getattr, - mp_afs_setattr, - mp_afs_ubcrdwr, - mp_afs_ubcrdwr, - mp_afs_ioctl, /* vn_ioctl */ - seltrue, /* vn_select */ - mp_afs_mmap, - mp_afs_fsync, - mp_afs_seek, - mp_afs_remove, - mp_afs_link, - mp_afs_rename, - mp_afs_mkdir, - mp_afs_rmdir, - mp_afs_symlink, - mp_afs_readdir, - mp_afs_readlink, - mp_afs_abortop, - mp_afs_inactive, - mp_afs_reclaim, - mp_afs_bmap, - mp_afs_strategy, - mp_afs_print, - mp_afs_page_read, - mp_afs_page_write, - mp_afs_swap, - mp_afs_bread, - mp_afs_brelse, - mp_afs_lockctl, - mp_afs_syncdata, - afs_noop, /* Lock */ - afs_noop, /* unLock */ - afs_noop, /* get ext attrs */ - afs_noop, /* set ext attrs */ - afs_noop, /* del ext attrs */ - vn_pathconf_default, + mp_afs_lookup, + mp_afs_create, + afs_noop, /* vn_mknod */ + mp_afs_open, + mp_afs_close, + mp_afs_access, + mp_afs_getattr, + mp_afs_setattr, + mp_afs_ubcrdwr, + mp_afs_ubcrdwr, + mp_afs_ioctl, /* vn_ioctl */ + seltrue, /* vn_select */ + mp_afs_mmap, + mp_afs_fsync, + mp_afs_seek, + mp_afs_remove, + mp_afs_link, + mp_afs_rename, + mp_afs_mkdir, + mp_afs_rmdir, + mp_afs_symlink, + mp_afs_readdir, + mp_afs_readlink, + mp_afs_abortop, + mp_afs_inactive, + mp_afs_reclaim, + mp_afs_bmap, + mp_afs_strategy, + mp_afs_print, + mp_afs_page_read, + mp_afs_page_write, + mp_afs_swap, + mp_afs_bread, + mp_afs_brelse, + mp_afs_lockctl, + mp_afs_syncdata, + afs_noop, /* Lock */ + afs_noop, /* unLock */ + afs_noop, /* get ext attrs */ + afs_noop, /* set ext attrs */ + afs_noop, /* del ext attrs */ + vn_pathconf_default, }; struct vnodeops *afs_ops = &Afs_vnodeops; @@ -109,8 +110,8 @@ struct fileops afs_fileops = { }; mp_afs_lookup(adp, ndp) - struct vcache *adp; - struct nameidata *ndp; + struct vcache *adp; + struct nameidata *ndp; { int code; AFS_GLOCK(); @@ -120,8 +121,8 @@ mp_afs_lookup(adp, ndp) } mp_afs_create(ndp, attrs) - struct nameidata *ndp; - struct vattr *attrs; + struct nameidata *ndp; + struct vattr *attrs; { int code; AFS_GLOCK(); @@ -131,9 +132,9 @@ mp_afs_create(ndp, attrs) } mp_afs_open(avcp, aflags, acred) - struct vcache **avcp; - afs_int32 aflags; - struct AFS_UCRED *acred; + struct vcache **avcp; + afs_int32 aflags; + struct AFS_UCRED *acred; { int code; AFS_GLOCK(); @@ -143,9 +144,9 @@ mp_afs_open(avcp, aflags, acred) } mp_afs_access(avc, amode, acred) - struct vcache *avc; - afs_int32 amode; - struct AFS_UCRED *acred; + struct vcache *avc; + afs_int32 amode; + struct AFS_UCRED *acred; { int code; AFS_GLOCK(); @@ -155,9 +156,9 @@ mp_afs_access(avc, amode, acred) } mp_afs_close(avc, flags, cred) - struct vnode *avc; - int flags; - struct ucred *cred; + struct vnode *avc; + int flags; + struct ucred *cred; { int code; AFS_GLOCK(); @@ -167,9 +168,9 @@ mp_afs_close(avc, flags, cred) } mp_afs_getattr(avc, attrs, acred) - struct vcache *avc; - struct vattr *attrs; - struct AFS_UCRED *acred; + struct vcache *avc; + struct vattr *attrs; + struct AFS_UCRED *acred; { int code; AFS_GLOCK(); @@ -179,9 +180,9 @@ mp_afs_getattr(avc, attrs, acred) } mp_afs_setattr(avc, attrs, acred) - struct vcache *avc; - struct vattr *attrs; - struct AFS_UCRED *acred; + struct vcache *avc; + struct vattr *attrs; + struct AFS_UCRED *acred; { int code; AFS_GLOCK(); @@ -191,10 +192,10 @@ mp_afs_setattr(avc, attrs, acred) } mp_afs_fsync(avc, fflags, acred, waitfor) - struct vcache *avc; - int fflags; - struct AFS_UCRED *acred; - int waitfor; + struct vcache *avc; + int fflags; + struct AFS_UCRED *acred; + int waitfor; { int code; AFS_GLOCK(); @@ -204,7 +205,7 @@ mp_afs_fsync(avc, fflags, acred, waitfor) } mp_afs_remove(ndp) - struct nameidata *ndp; + struct nameidata *ndp; { int code; AFS_GLOCK(); @@ -214,8 +215,8 @@ mp_afs_remove(ndp) } mp_afs_link(avc, ndp) - struct vcache *avc; - struct nameidata *ndp; + struct vcache *avc; + struct nameidata *ndp; { int code; AFS_GLOCK(); @@ -225,7 +226,7 @@ mp_afs_link(avc, ndp) } mp_afs_rename(fndp, tndp) - struct nameidata *fndp, *tndp; + struct nameidata *fndp, *tndp; { int code; AFS_GLOCK(); @@ -235,8 +236,8 @@ mp_afs_rename(fndp, tndp) } mp_afs_mkdir(ndp, attrs) - struct nameidata *ndp; - struct vattr *attrs; + struct nameidata *ndp; + struct vattr *attrs; { int code; AFS_GLOCK(); @@ -246,7 +247,7 @@ mp_afs_mkdir(ndp, attrs) } mp_afs_rmdir(ndp) - struct nameidata *ndp; + struct nameidata *ndp; { int code; AFS_GLOCK(); @@ -256,9 +257,9 @@ mp_afs_rmdir(ndp) } mp_afs_symlink(ndp, attrs, atargetName) - struct nameidata *ndp; - struct vattr *attrs; - register char *atargetName; + struct nameidata *ndp; + struct vattr *attrs; + register char *atargetName; { int code; AFS_GLOCK(); @@ -268,10 +269,10 @@ mp_afs_symlink(ndp, attrs, atargetName) } mp_afs_readdir(avc, auio, acred, eofp) - struct vcache *avc; - struct uio *auio; - struct AFS_UCRED *acred; - int *eofp; + struct vcache *avc; + struct uio *auio; + struct AFS_UCRED *acred; + int *eofp; { int code; AFS_GLOCK(); @@ -281,9 +282,9 @@ mp_afs_readdir(avc, auio, acred, eofp) } mp_afs_readlink(avc, auio, acred) - struct vcache *avc; - struct uio *auio; - struct AFS_UCRED *acred; + struct vcache *avc; + struct uio *auio; + struct AFS_UCRED *acred; { int code; AFS_GLOCK(); @@ -293,12 +294,12 @@ mp_afs_readlink(avc, auio, acred) } mp_afs_lockctl(avc, af, flag, acred, clid, offset) - struct vcache *avc; - struct eflock *af; - struct AFS_UCRED *acred; - int flag; - pid_t clid; - off_t offset; + struct vcache *avc; + struct eflock *af; + struct AFS_UCRED *acred; + int flag; + pid_t clid; + off_t offset; { int code; AFS_GLOCK(); @@ -308,7 +309,7 @@ mp_afs_lockctl(avc, af, flag, acred, clid, offset) } mp_afs_closex(afd) - struct file *afd; + struct file *afd; { int code; AFS_GLOCK(); @@ -318,25 +319,25 @@ mp_afs_closex(afd) } mp_afs_seek(avc, oldoff, newoff, cred) - struct vcache *avc; - off_t oldoff, newoff; - struct ucred *cred; + struct vcache *avc; + off_t oldoff, newoff; + struct ucred *cred; { - if ((int) newoff < 0) - return(EINVAL); + if ((int)newoff < 0) + return (EINVAL); else - return(0); + return (0); } mp_afs_abortop(ndp) - struct nameidata *ndp; + struct nameidata *ndp; { - return(0); + return (0); } mp_afs_inactive(avc, acred) - register struct vcache *avc; - struct AFS_UCRED *acred; + register struct vcache *avc; + struct AFS_UCRED *acred; { AFS_GLOCK(); afs_InactiveVCache(avc, acred); @@ -345,21 +346,21 @@ mp_afs_inactive(avc, acred) mp_afs_reclaim(avc) - struct vcache *avc; + struct vcache *avc; { - return(0); + return (0); } mp_afs_print(avc) - struct vcache *avc; + struct vcache *avc; { - return(0); + return (0); } mp_afs_page_read(avc, uio, acred) - struct vcache *avc; - struct uio *uio; - struct ucred *acred; + struct vcache *avc; + struct uio *uio; + struct ucred *acred; { int error; struct vrequest treq; @@ -367,26 +368,26 @@ mp_afs_page_read(avc, uio, acred) AFS_GLOCK(); error = afs_rdwr(avc, uio, UIO_READ, 0, acred); afs_Trace3(afs_iclSetp, CM_TRACE_PAGE_READ, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, error, ICL_TYPE_INT32, avc->states); + ICL_TYPE_INT32, error, ICL_TYPE_INT32, avc->states); if (error) { error = EIO; } else if ((avc->states & CWired) == 0) { afs_InitReq(&treq, acred); - ObtainWriteLock(&avc->lock,161); + ObtainWriteLock(&avc->lock, 161); afs_Wire(avc, &treq); ReleaseWriteLock(&avc->lock); } AFS_GUNLOCK(); - return(error); + return (error); } mp_afs_page_write(avc, uio, acred, pager, offset) - struct vcache *avc; - struct uio *uio; - struct ucred *acred; - memory_object_t pager; - vm_offset_t offset; + struct vcache *avc; + struct uio *uio; + struct ucred *acred; + memory_object_t pager; + vm_offset_t offset; { int error; @@ -398,20 +399,20 @@ mp_afs_page_write(avc, uio, acred, pager, offset) error = EIO; } AFS_GUNLOCK(); - return(error); + return (error); } -int DO_FLUSH=1; +int DO_FLUSH = 1; mp_afs_ubcrdwr(avc, uio, ioflag, cred) - struct vcache *avc; - struct uio *uio; - int ioflag; - struct ucred *cred; + struct vcache *avc; + struct uio *uio; + int ioflag; + struct ucred *cred; { register afs_int32 code; register char *data; - afs_int32 fileBase, size, cnt=0; + afs_int32 fileBase, size, cnt = 0; afs_int32 pageBase; register afs_int32 tsize; register afs_int32 pageOffset; @@ -419,26 +420,26 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred) struct vrequest treq; int rw = uio->uio_rw; int rv, flags; - int newpage=0; + int newpage = 0; vm_page_t page; afs_int32 save_resid; struct dcache *tdc; - int didFakeOpen=0; - int counter=0; + int didFakeOpen = 0; + int counter = 0; AFS_GLOCK(); afs_InitReq(&treq, cred); if (AFS_NFSXLATORREQ(cred) && rw == UIO_READ) { - if (!afs_AccessOK(avc, PRSFS_READ, &treq, - CHECK_MODE_BITS|CMB_ALLOW_EXEC_AS_READ)) { + if (!afs_AccessOK + (avc, PRSFS_READ, &treq, + CHECK_MODE_BITS | CMB_ALLOW_EXEC_AS_READ)) { AFS_GUNLOCK(); return EACCES; } } afs_Trace4(afs_iclSetp, CM_TRACE_VMRW, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, (rw==UIO_WRITE? 1 : 0), - ICL_TYPE_LONG, uio->uio_offset, - ICL_TYPE_LONG, uio->uio_resid); + ICL_TYPE_INT32, (rw == UIO_WRITE ? 1 : 0), ICL_TYPE_LONG, + uio->uio_offset, ICL_TYPE_LONG, uio->uio_resid); code = afs_VerifyVCache(avc, &treq); if (code) { code = afs_CheckCode(code, &treq, 35); @@ -447,25 +448,26 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred) } if (vType(avc) != VREG) { AFS_GUNLOCK(); - return EISDIR; /* can't read or write other things */ + return EISDIR; /* can't read or write other things */ } afs_BozonLock(&avc->pvnLock, avc); osi_FlushPages(avc, cred); /* hold bozon lock, but not basic vnode lock */ - ObtainWriteLock(&avc->lock,162); + ObtainWriteLock(&avc->lock, 162); /* adjust parameters when appending files */ if ((ioflag & IO_APPEND) && uio->uio_rw == UIO_WRITE) uio->uio_offset = avc->m.Length; /* write at EOF position */ if (uio->uio_rw == UIO_WRITE) { avc->states |= CDirty; afs_FakeOpen(avc); - didFakeOpen=1; + didFakeOpen = 1; /* * before starting any I/O, we must ensure that the file is big enough * to hold the results (since afs_putpage will be called to force * the I/O. */ size = uio->afsio_resid + uio->afsio_offset; /* new file size */ - if (size > avc->m.Length) avc->m.Length = size; /* file grew */ + if (size > avc->m.Length) + avc->m.Length = size; /* file grew */ avc->m.Date = osi_Time(); /* Set file date (for ranlib) */ if (uio->afsio_resid > PAGE_SIZE) cnt = uio->afsio_resid / PAGE_SIZE; @@ -477,26 +479,29 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred) * compute the amount of data to move into this block, * based on uio->afsio_resid. */ - size = uio->afsio_resid; /* transfer size */ - fileBase = uio->afsio_offset; /* start file position */ - pageBase = fileBase & ~(PAGE_SIZE-1); /* file position of the page */ - pageOffset = fileBase & (PAGE_SIZE-1); /* start offset within page */ - tsize = PAGE_SIZE-pageOffset; /* amount left in this page */ + size = uio->afsio_resid; /* transfer size */ + fileBase = uio->afsio_offset; /* start file position */ + pageBase = fileBase & ~(PAGE_SIZE - 1); /* file position of the page */ + pageOffset = fileBase & (PAGE_SIZE - 1); /* start offset within page */ + tsize = PAGE_SIZE - pageOffset; /* amount left in this page */ /* * we'll read tsize bytes, * but first must make sure tsize isn't too big */ - if (tsize > size) tsize = size; /* don't read past end of request */ - eof = 0; /* flag telling us if we hit the EOF on the read */ + if (tsize > size) + tsize = size; /* don't read past end of request */ + eof = 0; /* flag telling us if we hit the EOF on the read */ if (uio->uio_rw == UIO_READ) { /* we're doing a read operation */ /* don't read past EOF */ if (tsize + fileBase > avc->m.Length) { tsize = avc->m.Length - fileBase; eof = 1; /* we did hit the EOF */ - if (tsize < 0) tsize = 0; /* better safe than sorry */ + if (tsize < 0) + tsize = 0; /* better safe than sorry */ } } - if (tsize <= 0) break; /* nothing to transfer, we're done */ + if (tsize <= 0) + break; /* nothing to transfer, we're done */ /* Purge dirty chunks of file if there are too many dirty chunks. * Inside the write loop, we only do this at a chunk boundary. @@ -516,28 +521,32 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred) ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); #ifdef AFS_DUX50_ENV - code = ubc_lookup(AFSTOV(avc)->v_object, pageBase, - PAGE_SIZE, PAGE_SIZE, &page, &flags, NULL); + code = + ubc_lookup(AFSTOV(avc)->v_object, pageBase, PAGE_SIZE, PAGE_SIZE, + &page, &flags, NULL); #else - code = ubc_lookup(AFSTOV(avc)->v_object, pageBase, - PAGE_SIZE, PAGE_SIZE, &page, &flags); + code = + ubc_lookup(AFSTOV(avc)->v_object, pageBase, PAGE_SIZE, PAGE_SIZE, + &page, &flags); #endif AFS_GLOCK(); - ObtainWriteLock(&avc->lock,163); + ObtainWriteLock(&avc->lock, 163); if (code) { break; } if (flags & B_NOCACHE) { /* - No page found. We should not read the page in if - 1. the write starts on a page edge (ie, pageoffset == 0) - and either - 1. we will fill the page (ie, size == PAGESIZE), or - 2. we are writing past eof + * No page found. We should not read the page in if + * 1. the write starts on a page edge (ie, pageoffset == 0) + * and either + * 1. we will fill the page (ie, size == PAGESIZE), or + * 2. we are writing past eof */ - if ((uio->uio_rw == UIO_WRITE) && - ((pageOffset == 0 && (size == PAGE_SIZE || fileBase >= avc->m.Length)))) { + if ((uio->uio_rw == UIO_WRITE) + && + ((pageOffset == 0 + && (size == PAGE_SIZE || fileBase >= avc->m.Length)))) { struct vnode *vp = AFSTOV(avc); /* we're doing a write operation past eof; no need to read it */ newpage = 1; @@ -557,13 +566,13 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred) bp->b_blkno = btodb(pageBase); ReleaseWriteLock(&avc->lock); code = afs_ustrategy(bp, cred); /* do the I/O */ - ObtainWriteLock(&avc->lock,164); + ObtainWriteLock(&avc->lock, 164); AFS_GUNLOCK(); ubc_sync_iodone(bp); AFS_GLOCK(); if (code) { AFS_GUNLOCK(); - ubc_page_release(page, 0); + ubc_page_release(page, 0); AFS_GLOCK(); break; } @@ -571,53 +580,53 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred) } AFS_GUNLOCK(); ubc_page_wait(page); - data = ubc_load(page, pageOffset, page_size); + data = ubc_load(page, pageOffset, page_size); AFS_GLOCK(); ReleaseWriteLock(&avc->lock); /* uiomove may page fault */ AFS_GUNLOCK(); - code = uiomove(data+pageOffset, tsize, uio); + code = uiomove(data + pageOffset, tsize, uio); ubc_unload(page, pageOffset, page_size); if (uio->uio_rw == UIO_WRITE) { - vm_offset_t toffset; - - /* Mark the page dirty and release it to avoid a deadlock - * in ubc_dirty_kluster when more than one process writes - * this page at the same time. */ - toffset = page->pg_offset; - flags |= B_DIRTY; - ubc_page_release(page, flags); - - if (cnt > 10) { - vm_page_t pl; - int kpcnt; - struct buf *bp; - - /* We released the page, so we can get a null page - * list if another thread calls the strategy routine. - */ - pl = ubc_dirty_kluster(AFSTOV(avc)->v_object, - NULL, toffset, 0, B_WANTED, FALSE, &kpcnt); - if (pl) { - bp = ubc_bufalloc(pl, 1, PAGE_SIZE, 1, B_WRITE); - bp->b_dev = 0; - bp->b_vp = AFSTOV(avc); - bp->b_blkno = btodb(pageBase); + vm_offset_t toffset; + + /* Mark the page dirty and release it to avoid a deadlock + * in ubc_dirty_kluster when more than one process writes + * this page at the same time. */ + toffset = page->pg_offset; + flags |= B_DIRTY; + ubc_page_release(page, flags); + + if (cnt > 10) { + vm_page_t pl; + int kpcnt; + struct buf *bp; + + /* We released the page, so we can get a null page + * list if another thread calls the strategy routine. + */ + pl = ubc_dirty_kluster(AFSTOV(avc)->v_object, NULL, toffset, + 0, B_WANTED, FALSE, &kpcnt); + if (pl) { + bp = ubc_bufalloc(pl, 1, PAGE_SIZE, 1, B_WRITE); + bp->b_dev = 0; + bp->b_vp = AFSTOV(avc); + bp->b_blkno = btodb(pageBase); + AFS_GLOCK(); + code = afs_ustrategy(bp, cred); /* do the I/O */ + AFS_GUNLOCK(); + ubc_sync_iodone(bp); + if (code) { AFS_GLOCK(); - code = afs_ustrategy(bp, cred); /* do the I/O */ - AFS_GUNLOCK(); - ubc_sync_iodone(bp); - if (code) { - AFS_GLOCK(); - ObtainWriteLock(&avc->lock,415); - break; - } + ObtainWriteLock(&avc->lock, 415); + break; } } + } } else { ubc_page_release(page, flags); } AFS_GLOCK(); - ObtainWriteLock(&avc->lock,165); + ObtainWriteLock(&avc->lock, 165); /* * If reading at a chunk boundary, start prefetch of next chunk. */ @@ -625,13 +634,14 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred) && (counter == 0 || AFS_CHUNKOFFSET(fileBase) == 0)) { tdc = afs_FindDCache(avc, fileBase); if (tdc) { - if (!(tdc->flags & DFNextStarted)) + if (!(tdc->mflags & DFNextStarted)) afs_PrefetchChunk(avc, tdc, cred, &treq); afs_PutDCache(tdc); } } counter++; - if (code) break; + if (code) + break; } if (didFakeOpen) afs_FakeClose(avc, cred); @@ -642,7 +652,7 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred) afs_BozonUnlock(&avc->pvnLock, avc); if (DO_FLUSH || (!newpage && (cnt < 10))) { AFS_GUNLOCK(); - ubc_flush_dirty(AFSTOV(avc)->v_object, flags); + ubc_flush_dirty(AFSTOV(avc)->v_object, flags); AFS_GLOCK(); } @@ -668,7 +678,7 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred) && !AFS_NFSXLATORREQ(cred)) { code = afs_fsync(avc, 0, cred, 0); } -out: + out: code = afs_CheckCode(code, &treq, 36); AFS_GUNLOCK(); return code; @@ -678,7 +688,7 @@ int mp_afs_ioctl(struct vnode *vp, int com, caddr_t data, int fflag, struct ucred *cred, int *retval) { - return ENOSYS; + return ENOSYS; } /* @@ -690,15 +700,15 @@ mp_afs_ioctl(struct vnode *vp, int com, caddr_t data, int fflag, */ mp_afs_mmap(avc, offset, map, addrp, len, prot, maxprot, flags, cred) - register struct vcache *avc; - vm_offset_t offset; - vm_map_t map; - vm_offset_t *addrp; - vm_size_t len; - vm_prot_t prot; - vm_prot_t maxprot; - int flags; - struct ucred *cred; + register struct vcache *avc; + vm_offset_t offset; + vm_map_t map; + vm_offset_t *addrp; + vm_size_t len; + vm_prot_t prot; + vm_prot_t maxprot; + int flags; + struct ucred *cred; { struct vp_mmap_args args; register struct vp_mmap_args *ap = &args; @@ -713,21 +723,20 @@ mp_afs_mmap(avc, offset, map, addrp, len, prot, maxprot, flags, cred) afs_InitReq(&treq, cred); code = afs_VerifyVCache(avc, &treq); if (code) { - code = afs_CheckCode(code, &treq, 37); - AFS_GUNLOCK(); - return code; + code = afs_CheckCode(code, &treq, 37); + AFS_GUNLOCK(); + return code; } afs_BozonLock(&avc->pvnLock, avc); osi_FlushPages(avc, cred); /* ensure old pages are gone */ afs_BozonUnlock(&avc->pvnLock, avc); - ObtainWriteLock(&avc->lock,166); + ObtainWriteLock(&avc->lock, 166); avc->states |= CMAPPED; ReleaseWriteLock(&avc->lock); ap->a_offset = offset; ap->a_vaddr = addrp; ap->a_size = len; - ap->a_prot = prot, - ap->a_maxprot = maxprot; + ap->a_prot = prot, ap->a_maxprot = maxprot; ap->a_flags = flags; AFS_GUNLOCK(); code = u_vp_create(map, vp->v_object, (vm_offset_t) ap); @@ -738,27 +747,28 @@ mp_afs_mmap(avc, offset, map, addrp, len, prot, maxprot, flags, cred) } -int mp_afs_getpage(vop, offset, len, protp, pl, plsz, +int +mp_afs_getpage(vop, offset, len, protp, pl, plsz, #ifdef AFS_DUX50_ENV - policy, + policy, #else - mape, addr, + mape, addr, #endif - rw, cred) - vm_ubc_object_t vop; - vm_offset_t offset; - vm_size_t len; - vm_prot_t *protp; - vm_page_t *pl; - int plsz; + rw, cred) + vm_ubc_object_t vop; + vm_offset_t offset; + vm_size_t len; + vm_prot_t *protp; + vm_page_t *pl; + int plsz; #ifdef AFS_DUX50_ENV - struct vm_policy *policy; + struct vm_policy *policy; #else - vm_map_entry_t mape; - vm_offset_t addr; + vm_map_entry_t mape; + vm_offset_t addr; #endif - int rw; - struct ucred *cred; + int rw; + struct ucred *cred; { register afs_int32 code; struct vrequest treq; @@ -767,7 +777,7 @@ int mp_afs_getpage(vop, offset, len, protp, pl, plsz, vm_page_t *pagep; vm_offset_t off; - struct vcache *avc = VTOAFS(vop->vu_vp); + struct vcache *avc = VTOAFS(vop->vu_vp); /* first, obtain the proper lock for the VM system */ @@ -776,42 +786,45 @@ int mp_afs_getpage(vop, offset, len, protp, pl, plsz, code = afs_VerifyVCache(avc, &treq); if (code) { *pl = VM_PAGE_NULL; - code = afs_CheckCode(code, &treq, 39); /* failed to get it */ + code = afs_CheckCode(code, &treq, 39); /* failed to get it */ AFS_GUNLOCK(); return code; } - + /* clean all dirty pages for this vnode */ AFS_GUNLOCK(); - ubc_flush_dirty(vop,0); + ubc_flush_dirty(vop, 0); AFS_GLOCK(); afs_BozonLock(&avc->pvnLock, avc); - ObtainWriteLock(&avc->lock,167); + ObtainWriteLock(&avc->lock, 167); afs_Trace4(afs_iclSetp, CM_TRACE_PAGEIN, ICL_TYPE_POINTER, avc, - ICL_TYPE_LONG, offset, ICL_TYPE_LONG, len, - ICL_TYPE_INT32, (int) rw); + ICL_TYPE_LONG, offset, ICL_TYPE_LONG, len, ICL_TYPE_INT32, + (int)rw); for (i = 0; i < pages; i++) { pagep = &pl[i]; off = offset + PAGE_SIZE * i; - if (protp) protp[i] = 0; + if (protp) + protp[i] = 0; flags = 0; ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); #ifdef AFS_DUX50_ENV - code = ubc_lookup(AFSTOV(avc)->v_object, off, - PAGE_SIZE, PAGE_SIZE, pagep, &flags, NULL); + code = + ubc_lookup(AFSTOV(avc)->v_object, off, PAGE_SIZE, PAGE_SIZE, + pagep, &flags, NULL); #else - code = ubc_lookup(AFSTOV(avc)->v_object, off, - PAGE_SIZE, PAGE_SIZE, pagep, &flags); + code = + ubc_lookup(AFSTOV(avc)->v_object, off, PAGE_SIZE, PAGE_SIZE, + pagep, &flags); #endif AFS_GLOCK(); - ObtainWriteLock(&avc->lock,168); + ObtainWriteLock(&avc->lock, 168); if (code) { goto out; } - if(flags & B_NOCACHE) { /* if (page) */ - if ((rw & B_WRITE) && (offset+len >= avc->m.Length)) { + if (flags & B_NOCACHE) { /* if (page) */ + if ((rw & B_WRITE) && (offset + len >= avc->m.Length)) { struct vnode *vp = AFSTOV(avc); /* we're doing a write operation past eof; no need to read it */ AFS_GUNLOCK(); @@ -830,7 +843,7 @@ int mp_afs_getpage(vop, offset, len, protp, pl, plsz, bp->b_blkno = btodb(off); ReleaseWriteLock(&avc->lock); code = afs_ustrategy(bp, cred); /* do the I/O */ - ObtainWriteLock(&avc->lock,169); + ObtainWriteLock(&avc->lock, 169); AFS_GUNLOCK(); ubc_sync_iodone(bp); AFS_GLOCK(); @@ -856,7 +869,7 @@ int mp_afs_getpage(vop, offset, len, protp, pl, plsz, } } } -out: + out: pl[i] = VM_PAGE_NULL; ReleaseWriteLock(&avc->lock); afs_BozonUnlock(&avc->pvnLock, avc); @@ -868,14 +881,15 @@ out: } -int mp_afs_putpage(vop, pl, pcnt, flags, cred) - vm_ubc_object_t vop; - vm_page_t *pl; - int pcnt; - int flags; - struct ucred *cred; +int +mp_afs_putpage(vop, pl, pcnt, flags, cred) + vm_ubc_object_t vop; + vm_page_t *pl; + int pcnt; + int flags; + struct ucred *cred; { - register afs_int32 code=0; + register afs_int32 code = 0; struct vnode *vp = vop->vu_vp; struct vcache *avc = VTOAFS(vp); int i; @@ -890,10 +904,10 @@ int mp_afs_putpage(vop, pl, pcnt, flags, cred) if (vp->v_flag & VXLOCK) { VN_UNLOCK(vp); for (i = 0; i < pcnt; i++) { - ubc_page_release(pl[i], B_DONE|B_DIRTY); + ubc_page_release(pl[i], B_DONE | B_DIRTY); pl[i] = VM_PAGE_NULL; } - return(0); + return (0); } else { VN_UNLOCK(vp); } @@ -902,7 +916,7 @@ int mp_afs_putpage(vop, pl, pcnt, flags, cred) /* first, obtain the proper lock for the VM system */ afs_BozonLock(&avc->pvnLock, avc); - ObtainWriteLock(&avc->lock,170); + ObtainWriteLock(&avc->lock, 170); for (i = 0; i < pcnt; i++) { vm_page_t page = pl[i]; struct buf *bp; @@ -916,7 +930,7 @@ int mp_afs_putpage(vop, pl, pcnt, flags, cred) bp->b_blkno = btodb(page->pg_offset); ReleaseWriteLock(&avc->lock); code = afs_ustrategy(bp, cred); /* do the I/O */ - ObtainWriteLock(&avc->lock,171); + ObtainWriteLock(&avc->lock, 171); AFS_GUNLOCK(); ubc_sync_iodone(bp); AFS_GLOCK(); @@ -926,7 +940,7 @@ int mp_afs_putpage(vop, pl, pcnt, flags, cred) pl[i] = VM_PAGE_NULL; } } -done: + done: ReleaseWriteLock(&avc->lock); afs_BozonUnlock(&avc->pvnLock, avc); afs_Trace2(afs_iclSetp, CM_TRACE_PAGEOUTDONE, ICL_TYPE_INT32, code, @@ -936,20 +950,22 @@ done: } -int mp_afs_swap(avc, swapop, argp) - struct vcache *avc; - vp_swap_op_t swapop; - vm_offset_t argp; +int +mp_afs_swap(avc, swapop, argp) + struct vcache *avc; + vp_swap_op_t swapop; + vm_offset_t argp; { return EIO; } -int mp_afs_syncdata(avc, flag, offset, length, cred) - struct vcache *avc; - int flag; - vm_offset_t offset; - vm_size_t length; - struct ucred *cred; +int +mp_afs_syncdata(avc, flag, offset, length, cred) + struct vcache *avc; + int flag; + vm_offset_t offset; + vm_size_t length; + struct ucred *cred; { /* NFS V3 makes this call, ignore it. We'll sync the data in afs_fsync. */ if (AFS_NFSXLATORREQ(cred)) @@ -966,90 +982,90 @@ struct buf *afs_bread_freebp = 0; * Thus we can use fake bufs (ie not from the real buffer pool). */ mp_afs_bread(vp, lbn, bpp, cred) - struct ucred *cred; - struct vnode *vp; - daddr_t lbn; - struct buf **bpp; + struct ucred *cred; + struct vnode *vp; + daddr_t lbn; + struct buf **bpp; { - int offset, fsbsize, error; - struct buf *bp; - struct iovec iov; - struct uio uio; + int offset, fsbsize, error; + struct buf *bp; + struct iovec iov; + struct uio uio; - AFS_GLOCK(); - AFS_STATCNT(afs_bread); - fsbsize = vp->v_vfsp->vfs_bsize; - offset = lbn * fsbsize; - if (afs_bread_freebp) { - bp = afs_bread_freebp; - afs_bread_freebp = 0; - } else { - bp = (struct buf *) AFS_KALLOC(sizeof(*bp)); - bp->b_un.b_addr = (caddr_t) AFS_KALLOC(fsbsize); - } + AFS_GLOCK(); + AFS_STATCNT(afs_bread); + fsbsize = vp->v_vfsp->vfs_bsize; + offset = lbn * fsbsize; + if (afs_bread_freebp) { + bp = afs_bread_freebp; + afs_bread_freebp = 0; + } else { + bp = (struct buf *)AFS_KALLOC(sizeof(*bp)); + bp->b_un.b_addr = (caddr_t) AFS_KALLOC(fsbsize); + } - iov.iov_base = bp->b_un.b_addr; - iov.iov_len = fsbsize; - uio.afsio_iov = &iov; - uio.afsio_iovcnt = 1; - uio.afsio_seg = AFS_UIOSYS; - uio.afsio_offset = offset; - uio.afsio_resid = fsbsize; - *bpp = 0; - error = afs_read(VTOAFS(vp), &uio, cred, lbn, bpp, 0); - if (error) { - afs_bread_freebp = bp; - AFS_GUNLOCK(); - return error; - } - if (*bpp) { - afs_bread_freebp = bp; - } else { - *(struct buf **)&bp->b_vp = bp; /* mark as fake */ - *bpp = bp; - } + iov.iov_base = bp->b_un.b_addr; + iov.iov_len = fsbsize; + uio.afsio_iov = &iov; + uio.afsio_iovcnt = 1; + uio.afsio_seg = AFS_UIOSYS; + uio.afsio_offset = offset; + uio.afsio_resid = fsbsize; + *bpp = 0; + error = afs_read(VTOAFS(vp), &uio, cred, lbn, bpp, 0); + if (error) { + afs_bread_freebp = bp; AFS_GUNLOCK(); - return 0; + return error; + } + if (*bpp) { + afs_bread_freebp = bp; + } else { + *(struct buf **)&bp->b_vp = bp; /* mark as fake */ + *bpp = bp; + } + AFS_GUNLOCK(); + return 0; } mp_afs_brelse(vp, bp) -struct vnode *vp; -struct buf *bp; + struct vnode *vp; + struct buf *bp; { AFS_GLOCK(); AFS_STATCNT(afs_brelse); - if ((struct buf *)bp->b_vp != bp) { /* not fake */ - brelse(bp); - } else if (afs_bread_freebp) { - AFS_KFREE(bp->b_un.b_addr, vp->v_vfsp->vfs_bsize); - AFS_KFREE(bp, sizeof(*bp)); - } else { - afs_bread_freebp = bp; - } + if ((struct buf *)bp->b_vp != bp) { /* not fake */ + brelse(bp); + } else if (afs_bread_freebp) { + AFS_KFREE(bp->b_un.b_addr, vp->v_vfsp->vfs_bsize); + AFS_KFREE(bp, sizeof(*bp)); + } else { + afs_bread_freebp = bp; + } AFS_GUNLOCK(); } mp_afs_bmap(avc, abn, anvp, anbn) - register struct vcache *avc; - afs_int32 abn, *anbn; - struct vcache **anvp; + register struct vcache *avc; + afs_int32 abn, *anbn; + struct vcache **anvp; { AFS_GLOCK(); AFS_STATCNT(afs_bmap); if (anvp) *anvp = avc; if (anbn) - *anbn = abn * (8192 / DEV_BSIZE); /* in 512 byte units */ + *anbn = abn * (8192 / DEV_BSIZE); /* in 512 byte units */ AFS_GUNLOCK(); return 0; } /* real strategy */ -mp_afs_strategy (abp) - register struct buf *abp; +mp_afs_strategy(abp) + register struct buf *abp; { register afs_int32 code; @@ -1063,47 +1079,47 @@ mp_afs_strategy (abp) mp_afs_refer(vm_ubc_object_t vop) { - VREF(vop->vu_vp); + VREF(vop->vu_vp); } mp_afs_release(vm_ubc_object_t vop) { - vrele(vop->vu_vp); + vrele(vop->vu_vp); } mp_afs_write_check(vm_ubc_object_t vop, vm_page_t pp) { - return TRUE; + return TRUE; } #ifdef AFS_DUX50_ENV int mp_afs_objtovp(vm_ubc_object_t vop, struct vnode **vp) { - *vp = vop->vu_vp; - return 0; + *vp = vop->vu_vp; + return 0; } int mp_afs_setpgstamp(vm_page_t pp, unsigned int tick) { - pp->pg_stamp = tick; - return 0; + pp->pg_stamp = tick; + return 0; } #endif struct vfs_ubcops afs_ubcops = { - mp_afs_refer, /* refer vnode */ - mp_afs_release, /* release vnode */ - mp_afs_getpage, /* get page */ - mp_afs_putpage, /* put page */ - mp_afs_write_check, /* check writablity */ + mp_afs_refer, /* refer vnode */ + mp_afs_release, /* release vnode */ + mp_afs_getpage, /* get page */ + mp_afs_putpage, /* put page */ + mp_afs_write_check, /* check writablity */ #ifdef AFS_DUX50_ENV - mp_afs_objtovp, /* get vnode pointer */ - mp_afs_setpgstamp /* set page stamp */ + mp_afs_objtovp, /* get vnode pointer */ + mp_afs_setpgstamp /* set page stamp */ #endif }; @@ -1115,24 +1131,23 @@ struct vfs_ubcops afs_ubcops = { * locked after return. */ lookupname(namep, seg, follow, dvpp, cvpp) - char *namep; /* path name */ - int seg; /* address space containing name */ - int follow; /* follow symbolic links */ - struct vnode **dvpp; /* result, containing parent vnode */ - struct vnode **cvpp; /* result, containing final component vnode */ + char *namep; /* path name */ + int seg; /* address space containing name */ + int follow; /* follow symbolic links */ + struct vnode **dvpp; /* result, containing parent vnode */ + struct vnode **cvpp; /* result, containing final component vnode */ { /* Should I use free-bee in u-area? */ struct nameidata *ndp = &u.u_nd; int error; - ndp->ni_nameiop = ((follow) ? (LOOKUP|FOLLOW) : (LOOKUP)); + ndp->ni_nameiop = ((follow) ? (LOOKUP | FOLLOW) : (LOOKUP)); ndp->ni_segflg = seg; ndp->ni_dirp = namep; error = namei(ndp); - if (dvpp != (struct vnode **)0) + if (dvpp != NULL) *dvpp = ndp->ni_dvp; - if (cvpp != (struct vnode **)0) + if (cvpp != NULL) *cvpp = ndp->ni_vp; - return(error); + return (error); } - diff --git a/src/afs/FBSD/osi_file.c b/src/afs/FBSD/osi_file.c index d8688f59c..7d80b62c5 100644 --- a/src/afs/FBSD/osi_file.c +++ b/src/afs/FBSD/osi_file.c @@ -8,66 +8,76 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_file.c,v 1.1.1.5 2002/09/26 18:58:08 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/FBSD/osi_file.c,v 1.13 2004/03/10 23:01:51 rees Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ -int afs_osicred_initialized=0; -struct AFS_UCRED afs_osi_cred; +int afs_osicred_initialized = 0; +struct AFS_UCRED afs_osi_cred; afs_lock_t afs_xosi; /* lock is for tvattr */ extern struct osi_dev cacheDev; extern struct mount *afs_cacheVfsp; -void *osi_UFSOpen(ainode) - afs_int32 ainode; +void * +osi_UFSOpen(afs_int32 ainode) { - struct inode *ip; - register struct osi_file *afile = NULL; + struct osi_file *afile; + struct vnode *vp; extern int cacheDiskType; - afs_int32 code = 0; - int dummy; + afs_int32 code; + AFS_STATCNT(osi_UFSOpen); - if(cacheDiskType != AFS_FCACHE_TYPE_UFS) { + if (cacheDiskType != AFS_FCACHE_TYPE_UFS) osi_Panic("UFSOpen called for non-UFS cache\n"); - } - if (!afs_osicred_initialized) { - /* valid for alpha_osf, SunOS, Ultrix */ - memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED)); - afs_osi_cred.cr_ref++; - afs_osicred_initialized = 1; - } - afile = (struct osi_file *) osi_AllocSmallSpace(sizeof(struct osi_file)); + afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file)); AFS_GUNLOCK(); - code = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t)ainode, &ip, &dummy); +#if defined(AFS_FBSD50_ENV) + code = VFS_VGET(afs_cacheVfsp, (ino_t) ainode, LK_EXCLUSIVE, &vp); +#else + code = VFS_VGET(afs_cacheVfsp, (ino_t) ainode, &vp); +#endif AFS_GLOCK(); + if (code == 0 && vp->v_type == VNON) + code = ENOENT; if (code) { osi_FreeSmallSpace(afile); osi_Panic("UFSOpen: igetinode failed"); } - afile->vnode = ITOV(ip); - VOP_UNLOCK(afile->vnode, 0, curproc); - afile->size = VTOI(afile->vnode)->i_size; +#if defined(AFS_FBSD50_ENV) + VOP_UNLOCK(vp, 0, curthread); +#else + VOP_UNLOCK(vp, 0, curproc); +#endif + afile->vnode = vp; + afile->size = VTOI(vp)->i_size; afile->offset = 0; - afile->proc = (int (*)()) 0; - afile->inum = ainode; /* for hint validity checking */ + afile->proc = NULL; + afile->inum = ainode; /* for hint validity checking */ return (void *)afile; } -afs_osi_Stat(afile, astat) - register struct osi_file *afile; - register struct osi_stat *astat; { +int +afs_osi_Stat(register struct osi_file *afile, register struct osi_stat *astat) +{ register afs_int32 code; struct vattr tvattr; AFS_STATCNT(osi_Stat); - MObtainWriteLock(&afs_xosi,320); + MObtainWriteLock(&afs_xosi, 320); AFS_GUNLOCK(); - code=VOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred, curproc); +#if defined(AFS_FBSD50_ENV) + vn_lock(afile->vnode, LK_EXCLUSIVE | LK_RETRY, curthread); + code = VOP_GETATTR(afile->vnode, &tvattr, afs_osi_credp, curthread); + VOP_UNLOCK(afile->vnode, LK_EXCLUSIVE, curthread); +#else + code = VOP_GETATTR(afile->vnode, &tvattr, afs_osi_credp, curproc); +#endif AFS_GLOCK(); if (code == 0) { astat->size = tvattr.va_size; @@ -79,117 +89,138 @@ afs_osi_Stat(afile, astat) return code; } -osi_UFSClose(afile) - register struct osi_file *afile; - { - AFS_STATCNT(osi_Close); - if(afile->vnode) { +int +osi_UFSClose(register struct osi_file *afile) +{ + AFS_STATCNT(osi_Close); + if (afile->vnode) { AFS_RELE(afile->vnode); - } - - osi_FreeSmallSpace(afile); - return 0; - } - -osi_UFSTruncate(afile, asize) - register struct osi_file *afile; - afs_int32 asize; { + } + + osi_FreeSmallSpace(afile); + return 0; +} + +int +osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize) +{ struct vattr tvattr; + struct vnode *vp; register afs_int32 code; - struct osi_stat tstat; AFS_STATCNT(osi_Truncate); - /* This routine only shrinks files, and most systems + MObtainWriteLock(&afs_xosi, 321); + vp = afile->vnode; + /* + * This routine only shrinks files, and most systems * have very slow truncates, even when the file is already * small enough. Check now and save some time. */ - code = afs_osi_Stat(afile, &tstat); - if (code || tstat.size <= asize) return code; - MObtainWriteLock(&afs_xosi,321); + AFS_GUNLOCK(); +#if defined(AFS_FBSD50_ENV) + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); + code = VOP_GETATTR(afile->vnode, &tvattr, afs_osi_credp, curthread); +#else + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curproc); + code = VOP_GETATTR(afile->vnode, &tvattr, afs_osi_credp, curproc); +#endif + if (code != 0 || tvattr.va_size <= asize) + goto out; + VATTR_NULL(&tvattr); tvattr.va_size = asize; - AFS_GUNLOCK(); - code=VOP_SETATTR(afile->vnode, &tvattr, &afs_osi_cred, curproc); +#if defined(AFS_FBSD50_ENV) + code = VOP_SETATTR(vp, &tvattr, afs_osi_credp, curthread); +#else + code = VOP_SETATTR(vp, &tvattr, afs_osi_credp, curproc); +#endif + +out: +#if defined(AFS_FBSD50_ENV) + VOP_UNLOCK(vp, LK_EXCLUSIVE, curthread); +#else + VOP_UNLOCK(vp, LK_EXCLUSIVE, curproc); +#endif AFS_GLOCK(); MReleaseWriteLock(&afs_xosi); return code; } -void osi_DisableAtimes(avp) -struct vnode *avp; +void +osi_DisableAtimes(struct vnode *avp) { - struct inode *ip = VTOI(avp); - ip->i_flag &= ~IN_ACCESS; + struct inode *ip = VTOI(avp); + ip->i_flag &= ~IN_ACCESS; } /* Generic read interface */ -afs_osi_Read(afile, offset, aptr, asize) - register struct osi_file *afile; - int offset; - char *aptr; - afs_int32 asize; { +int +afs_osi_Read(register struct osi_file *afile, int offset, void *aptr, + afs_int32 asize) +{ unsigned int resid; register afs_int32 code; - register afs_int32 cnt1=0; AFS_STATCNT(osi_Read); /** * If the osi_file passed in is NULL, panic only if AFS is not shutting * down. No point in crashing when we are already shutting down */ - if ( !afile ) { - if ( !afs_shuttingdown ) + if (!afile) { + if (!afs_shuttingdown) osi_Panic("osi_Read called with null param"); else return EIO; } - if (offset != -1) afile->offset = offset; + if (offset != -1) + afile->offset = offset; AFS_GUNLOCK(); - code = gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset, - AFS_UIOSYS, IO_UNIT, &afs_osi_cred, &resid); + code = + gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset, + AFS_UIOSYS, IO_UNIT, afs_osi_credp, &resid); AFS_GLOCK(); if (code == 0) { code = asize - resid; afile->offset += code; osi_DisableAtimes(afile->vnode); - } - else { + } else { afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid, - ICL_TYPE_INT32, code); + ICL_TYPE_INT32, code); code = -1; } return code; } /* Generic write interface */ -afs_osi_Write(afile, offset, aptr, asize) - register struct osi_file *afile; - char *aptr; - afs_int32 offset; - afs_int32 asize; { +int +afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr, + afs_int32 asize) +{ unsigned int resid; register afs_int32 code; AFS_STATCNT(osi_Write); - if ( !afile ) - osi_Panic("afs_osi_Write called with null param"); - if (offset != -1) afile->offset = offset; + if (!afile) + osi_Panic("afs_osi_Write called with null param"); + if (offset != -1) + afile->offset = offset; { AFS_GUNLOCK(); - code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, afile->offset, - AFS_UIOSYS, IO_UNIT, &afs_osi_cred, &resid); + code = + gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, + afile->offset, AFS_UIOSYS, IO_UNIT, afs_osi_credp, + &resid); AFS_GLOCK(); } if (code == 0) { code = asize - resid; afile->offset += code; - } - else { + } else { code = -1; } if (afile->proc) { - (*afile->proc)(afile, code); + (*afile->proc) (afile, code); } return code; } @@ -198,9 +229,8 @@ afs_osi_Write(afile, offset, aptr, asize) /* This work should be handled by physstrat in ca/machdep.c. This routine written from the RT NFS port strategy routine. It has been generalized a bit, but should still be pretty clear. */ -int afs_osi_MapStrategy(aproc, bp) - int (*aproc)(); - register struct buf *bp; +int +afs_osi_MapStrategy(int (*aproc) (), register struct buf *bp) { afs_int32 returnCode; @@ -213,13 +243,12 @@ int afs_osi_MapStrategy(aproc, bp) void -shutdown_osifile() +shutdown_osifile(void) { - extern int afs_cold_shutdown; + extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); - if (afs_cold_shutdown) { - afs_osicred_initialized = 0; - } + AFS_STATCNT(shutdown_osifile); + if (afs_cold_shutdown) { + afs_osicred_initialized = 0; + } } - diff --git a/src/afs/FBSD/osi_groups.c b/src/afs/FBSD/osi_groups.c index f49c0d27b..13cac178b 100644 --- a/src/afs/FBSD/osi_groups.c +++ b/src/afs/FBSD/osi_groups.c @@ -15,74 +15,117 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" +#include +#ifdef AFS_FBSD50_ENV +#include +#endif -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_groups.c,v 1.1.1.4 2002/09/26 18:58:08 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/FBSD/osi_groups.c,v 1.8 2003/07/15 23:14:19 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/afs_stats.h" /* statistics */ static int -afs_getgroups( - struct ucred *cred, - int ngroups, - gid_t *gidset); + afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset); static int -afs_setgroups( - struct proc *proc, - struct ucred **cred, - int ngroups, - gid_t *gidset, - int change_parent); + afs_setgroups(struct proc *proc, struct ucred **cred, int ngroups, + gid_t * gidset, int change_parent); + +#ifdef AFS_FBSD50_ENV +/* + * This does nothing useful yet. + * In 5.0, creds are associated not with a process, but with a thread. + * Probably the right thing to do is replace struct proc with struct thread + * everywhere, including setpag. + * That will be a tedious undertaking. + * For now, I'm just passing curproc to AddPag. + * This is probably wrong and I don't know what the consequences might be. + */ +int +Afs_xsetgroups(struct thread *td, struct setgroups_args *uap) +{ + int code = 0; + struct vrequest treq; + struct ucred *cr; + + cr = crdup(td->td_ucred); + + AFS_STATCNT(afs_xsetgroups); + AFS_GLOCK(); + + code = afs_InitReq(&treq, cr); + AFS_GUNLOCK(); + crfree(cr); + if (code) + return setgroups(td, uap); /* afs has shut down */ + + code = setgroups(td, uap); + /* Note that if there is a pag already in the new groups we don't + * overwrite it with the old pag. + */ + cr = crdup(td->td_ucred); + + if (PagInCred(cr) == NOPAG) { + if (((treq.uid >> 24) & 0xff) == 'A') { + AFS_GLOCK(); + /* we've already done a setpag, so now we redo it */ + AddPag(curproc, treq.uid, &cr); + AFS_GUNLOCK(); + } + } + crfree(cr); + return code; +} +#else /* FBSD50 */ int Afs_xsetgroups(p, args, retval) - struct proc *p; - void *args; - int *retval; + struct proc *p; + void *args; + int *retval; { int code = 0; struct vrequest treq; struct ucred *cr; - cr=crdup(p->p_cred->pc_ucred); + cr = crdup(p->p_cred->pc_ucred); AFS_STATCNT(afs_xsetgroups); AFS_GLOCK(); - + code = afs_InitReq(&treq, cr); AFS_GUNLOCK(); crfree(cr); - if (code) return setgroups(p, args, retval); /* afs has shut down */ + if (code) + return setgroups(p, args, retval); /* afs has shut down */ code = setgroups(p, args, retval); /* Note that if there is a pag already in the new groups we don't * overwrite it with the old pag. */ - cr=crdup(p->p_cred->pc_ucred); + cr = crdup(p->p_cred->pc_ucred); if (PagInCred(cr) == NOPAG) { if (((treq.uid >> 24) & 0xff) == 'A') { AFS_GLOCK(); /* we've already done a setpag, so now we redo it */ - AddPag(p, treq.uid, &cr ); + AddPag(p, treq.uid, &cr); AFS_GUNLOCK(); } } crfree(cr); return code; } +#endif int -setpag(proc, cred, pagvalue, newpag, change_parent) - struct proc *proc; - struct ucred **cred; - afs_uint32 pagvalue; - afs_uint32 *newpag; - afs_uint32 change_parent; +setpag(struct proc *proc, struct ucred **cred, afs_uint32 pagvalue, + afs_uint32 * newpag, int change_parent) { gid_t gidset[NGROUPS]; int ngroups, code; @@ -95,12 +138,12 @@ setpag(proc, cred, pagvalue, newpag, change_parent) if (ngroups + 2 > NGROUPS) { return (E2BIG); } - for (j = ngroups -1; j >= 1; j--) { - gidset[j+2] = gidset[j]; + for (j = ngroups - 1; j >= 1; j--) { + gidset[j + 2] = gidset[j]; } ngroups += 2; } - *newpag = (pagvalue == -1 ? genpag(): pagvalue); + *newpag = (pagvalue == -1 ? genpag() : pagvalue); afs_get_groups_from_pag(*newpag, &gidset[1], &gidset[2]); code = afs_setgroups(proc, cred, ngroups, gidset, change_parent); return code; @@ -108,10 +151,7 @@ setpag(proc, cred, pagvalue, newpag, change_parent) static int -afs_getgroups( - struct ucred *cred, - int ngroups, - gid_t *gidset) +afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) { int ngrps, savengrps; gid_t *gp; @@ -120,20 +160,16 @@ afs_getgroups( savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); gp = cred->cr_groups; while (ngrps--) - *gidset++ = *gp++; + *gidset++ = *gp++; return savengrps; } - static int -afs_setgroups( - struct proc *proc, - struct ucred **cred, - int ngroups, - gid_t *gidset, - int change_parent) +afs_setgroups(struct proc *proc, struct ucred **cred, int ngroups, + gid_t * gidset, int change_parent) { +#ifndef AFS_FBSD50_ENV int ngrps; int i; gid_t *gp; @@ -153,13 +189,14 @@ afs_setgroups( *gp++ = *gidset++; if (change_parent) { crhold(cr); - oldcr=proc->p_pptr->p_cred->pc_ucred; - proc->p_pptr->p_cred->pc_ucred=cr; + oldcr = proc->p_pptr->p_cred->pc_ucred; + proc->p_pptr->p_cred->pc_ucred = cr; crfree(oldcr); } crhold(cr); - oldcr=proc->p_cred->pc_ucred; - proc->p_cred->pc_ucred=cr; + oldcr = proc->p_cred->pc_ucred; + proc->p_cred->pc_ucred = cr; crfree(oldcr); - return(0); +#endif + return (0); } diff --git a/src/afs/FBSD/osi_inode.c b/src/afs/FBSD/osi_inode.c index ef70494f6..3179c32f7 100644 --- a/src/afs/FBSD/osi_inode.c +++ b/src/afs/FBSD/osi_inode.c @@ -14,19 +14,24 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_inode.c,v 1.1.1.4 2002/09/26 18:58:08 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/FBSD/osi_inode.c,v 1.9 2004/03/10 23:01:51 rees Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/osi_inode.h" -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/osi_inode.h" +#include "afs/afs_stats.h" /* statistics stuff */ #include #include -#include #include +#if defined(AFS_FBSD50_ENV) +#include +#endif +#include +int getinode(fs, dev, inode, ipp, perror) struct mount *fs; struct inode **ipp; @@ -42,38 +47,52 @@ getinode(fs, dev, inode, ipp, perror) if (!fs) { register struct ufsmount *ump; register struct mount *mp; - - simple_lock(&mountlist_slock); - if (mp = TAILQ_FIRST(&mountlist)) do { - /* - * XXX Also do the test for MFS - */ + +#if defined(AFS_FBSD50_ENV) + mtx_lock(&mountlist_mtx); +#else + simple_lock(&mountlist_slock); +#endif + if ((mp = TAILQ_FIRST(&mountlist)) != NULL) + do { + /* + * XXX Also do the test for MFS + */ #undef m_data #undef m_next - if (mp->mnt_stat.f_type == MOUNT_UFS) { - ump = VFSTOUFS(mp); - if (ump->um_fs == NULL) - break; - if (ump->um_dev == dev) { - fs = ump->um_mountp; + if (!strcmp(mp->mnt_stat.f_fstypename, MOUNT_UFS)) { + ump = VFSTOUFS(mp); + if (ump->um_fs == NULL) + break; + if (ump->um_dev == dev) { + fs = ump->um_mountp; + } } - } - mp = TAILQ_NEXT(mp, mnt_list); - } while (mp != TAILQ_FIRST(&mountlist)); - simple_unlock(&mountlist_slock); + mp = TAILQ_NEXT(mp, mnt_list); + } while (mp != TAILQ_FIRST(&mountlist)); +#if defined(AFS_FBSD50_ENV) + mtx_unlock(&mountlist_mtx); +#else + simple_unlock(&mountlist_slock); +#endif if (!fs) - return(ENXIO); + return (ENXIO); } - code = VFS_VGET(fs,inode, &vp); +#if defined(AFS_FBSD50_ENV) + code = VFS_VGET(fs, inode, 0, &vp); +#else + code = VFS_VGET(fs, inode, &vp); +#endif if (code != 0) { *perror = BAD_IGET; - return code; + return code; } else { *ipp = VTOI(vp); - return(0); + return (0); } } +int igetinode(vfsp, dev, inode, ipp, perror) struct inode **ipp; struct mount *vfsp; @@ -81,8 +100,7 @@ igetinode(vfsp, dev, inode, ipp, perror) ino_t inode; int *perror; { - struct inode *pip, *ip; - extern struct osi_dev cacheDev; + struct inode *ip; register int code = 0; *perror = 0; @@ -90,22 +108,22 @@ igetinode(vfsp, dev, inode, ipp, perror) AFS_STATCNT(igetinode); if ((code = getinode(vfsp, dev, inode, &ip, perror)) != 0) { - return(code); + return (code); } if (ip->i_mode == 0) { /* Not an allocated inode */ - vput(ITOV(ip)); - return(ENOENT); + vput(ITOV(ip)); + return (ENOENT); } - if (ip->i_nlink == 0 || (ip->i_mode&IFMT) != IFREG) { - vput(ITOV(ip)); - return(ENOENT); + if (ip->i_nlink == 0 || (ip->i_mode & IFMT) != IFREG) { + vput(ITOV(ip)); + return (ENOENT); } *ipp = ip; - return(0); + return (0); } #if 0 @@ -116,112 +134,113 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, retval) long *retval; long dev, near_inode, param1, param2, param3, param4; { - int dummy, err=0; + int dummy, err = 0; struct inode *ip, *newip; register int code; struct vnode *vp; - + AFS_STATCNT(afs_syscall_icreate); - + if (!afs_suser()) - return(EPERM); + return (EPERM); - code = getinode(0, (dev_t)dev, 2, &ip, &dummy); + code = getinode(0, (dev_t) dev, 2, &ip, &dummy); if (code) { - return(ENOENT); + return (ENOENT); } - code = ialloc(ip, (ino_t)near_inode, 0, &newip); + code = ialloc(ip, (ino_t) near_inode, 0, &newip); iput(ip); if (code) { - return(code); + return (code); } IN_LOCK(newip); - newip->i_flag |= IACC|IUPD|ICHG; - + newip->i_flag |= IACC | IUPD | ICHG; + newip->i_nlink = 1; newip->i_mode = IFREG; - + IN_UNLOCK(newip); vp = ITOV(newip); VN_LOCK(vp); vp->v_type = VREG; VN_UNLOCK(vp); - + /* - if ( !vp->v_object) - { - extern struct vfs_ubcops ufs_ubcops; - extern struct vm_ubc_object* ubc_object_allocate(); - struct vm_ubc_object* vop; - vop = ubc_object_allocate(&vp, &ufs_ubcops, - vp->v_mount->m_funnel); - VN_LOCK(vp); - vp->v_object = vop; - VN_UNLOCK(vp); - } - */ - + * if ( !vp->v_object) + * { + * extern struct vfs_ubcops ufs_ubcops; + * extern struct vm_ubc_object* ubc_object_allocate(); + * struct vm_ubc_object* vop; + * vop = ubc_object_allocate(&vp, &ufs_ubcops, + * vp->v_mount->m_funnel); + * VN_LOCK(vp); + * vp->v_object = vop; + * VN_UNLOCK(vp); + * } + */ + IN_LOCK(newip); /* newip->i_flags |= IC_XUID|IC_XGID; */ /* newip->i_flags &= ~IC_PROPLIST; */ newip->i_vicep1 = param1; - if (param2 == 0x1fffffff/*INODESPECIAL*/) { + if (param2 == 0x1fffffff /*INODESPECIAL*/) { newip->i_vicep2 = ((0x1fffffff << 3) + (param4 & 0x3)); - newip->i_vicep3a = (u_short)(param3 >> 16); - newip->i_vicep3b = (u_short)param3; + newip->i_vicep3a = (u_short) (param3 >> 16); + newip->i_vicep3b = (u_short) param3; } else { - newip->i_vicep2 = (((param2 >> 16) & 0x1f) << 27) + - (((param4 >> 16) & 0x1f) << 22) + - (param3 & 0x3fffff); - newip->i_vicep3a = (u_short)param4; - newip->i_vicep3b = (u_short)param2; + newip->i_vicep2 = + (((param2 >> 16) & 0x1f) << 27) + + (((param4 >> 16) & 0x1f) << 22) + (param3 & 0x3fffff); + newip->i_vicep3a = (u_short) param4; + newip->i_vicep3b = (u_short) param2; } newip->i_vicemagic = VICEMAGIC; - + *retval = newip->i_number; IN_UNLOCK(newip); iput(newip); - return(code); + return (code); } +int afs_syscall_iopen(dev, inode, usrmod, retval) long *retval; int dev, inode, usrmod; { struct file *fp; struct inode *ip; - struct vnode *vp = (struct vnode *)0; + struct vnode *vp = NULL; int dummy; int fd; extern struct fileops vnops; register int code; - + AFS_STATCNT(afs_syscall_iopen); - + if (!afs_suser()) - return(EPERM); + return (EPERM); - code = igetinode(0, (dev_t)dev, (ino_t)inode, &ip, &dummy); + code = igetinode(0, (dev_t) dev, (ino_t) inode, &ip, &dummy); if (code) { - return(code); + return (code); } if ((code = falloc(curproc, &fp, &fd)) != 0) { iput(ip); - return(code); + return (code); } IN_UNLOCK(ip); - + /* FreeBSD doesn't do much mp stuff yet :( */ /* FP_LOCK(fp); */ fp->f_flag = (usrmod) & FMASK; fp->f_type = DTYPE_VNODE; fp->f_ops = &vnops; - fp->f_data = (caddr_t)ITOV(ip); - + fp->f_data = (caddr_t) ITOV(ip); + /* FP_UNLOCK(fp); */ - return(0); + return (0); } @@ -231,24 +250,25 @@ afs_syscall_iopen(dev, inode, usrmod, retval) * Restricted to super user. * Only VICEMAGIC type inodes. */ +int afs_syscall_iincdec(dev, inode, inode_p1, amount) int dev, inode, inode_p1, amount; { int dummy; struct inode *ip; register int code; - + if (!afs_suser()) - return(EPERM); + return (EPERM); - code = igetinode(0, (dev_t)dev, (ino_t)inode, &ip, &dummy); + code = igetinode(0, (dev_t) dev, (ino_t) inode, &ip, &dummy); if (code) { - return(code); + return (code); } if (!IS_VICEMAGIC(ip)) { - return(EPERM); + return (EPERM); } else if (ip->i_vicep1 != inode_p1) { - return(ENXIO); + return (ENXIO); } ip->i_nlink += amount; if (ip->i_nlink == 0) { @@ -256,25 +276,29 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount) } ip->i_flag |= ICHG; iput(ip); - return(0); + return (0); } #else +int afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, retval) long *retval; long dev, near_inode, param1, param2, param3, param4; { - return EOPNOTSUPP; + return EOPNOTSUPP; } + +int afs_syscall_iopen(dev, inode, usrmod, retval) long *retval; int dev, inode, usrmod; { - return EOPNOTSUPP; + return EOPNOTSUPP; } + +int afs_syscall_iincdec(dev, inode, inode_p1, amount) int dev, inode, inode_p1, amount; { - return EOPNOTSUPP; + return EOPNOTSUPP; } #endif - diff --git a/src/afs/FBSD/osi_inode.h b/src/afs/FBSD/osi_inode.h index 39c706fa1..d63526c95 100644 --- a/src/afs/FBSD/osi_inode.h +++ b/src/afs/FBSD/osi_inode.h @@ -46,7 +46,7 @@ #define di_vicep2 di_gid #define di_vicep3a di_u.oldids[0] #define di_vicep3b di_u.oldids[1] -#define di_vicep4 di_spare[1] /* not used */ +#define di_vicep4 di_spare[1] /* not used */ /* * Macros for handling inode numbers: diff --git a/src/afs/FBSD/osi_machdep.h b/src/afs/FBSD/osi_machdep.h index b134ad6d1..3e0cb3999 100644 --- a/src/afs/FBSD/osi_machdep.h +++ b/src/afs/FBSD/osi_machdep.h @@ -21,17 +21,17 @@ #include #include -/* #include */ -/* #include */ +#if defined(AFS_FBSD50_ENV) +#include +#endif -#define getpid() curproc extern struct simplelock afs_rxglobal_lock; /* * Time related macros */ -#define osi_Time() time_second -#define afs_hz hz +#define osi_Time() time_second +#define afs_hz hz #define PAGESIZE 8192 @@ -39,19 +39,57 @@ extern struct simplelock afs_rxglobal_lock; #define AFS_PROC struct proc #define afs_bufferpages bufpages +#ifndef iodone +#define iodone biodone +#endif -#define osi_vnhold(avc,r) do { VN_HOLD((struct vnode *)(avc)); } while (0) +#define osi_vnhold(avc,r) vref(AFSTOV(avc)) +#undef vSetVfsp +#define vSetVfsp(vc, vfsp) AFSTOV(vc)->v_mount = (vfsp) +#undef vSetType +#define vSetType(vc, type) AFSTOV(vc)->v_type = (type) +#undef vType +#define vType(vc) AFSTOV(vc)->v_type -#define gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \ - vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(unit),(cred),(aresid), curproc) #undef gop_lookupname #define gop_lookupname osi_lookupname #undef afs_suser +#define afs_strcat(s1, s2) strcat((s1), (s2)) + #ifdef KERNEL -extern struct proc * afs_global_owner; + +#undef afs_osi_Alloc_NoSleep +#define afs_osi_Alloc_NoSleep(size) osi_fbsd_alloc((size), 0) + +#define VN_RELE(vp) vrele(vp) +#define VN_HOLD(vp) VREF(vp) + +#if defined(AFS_FBSD50_ENV) +#define VT_AFS "afs" +#define VROOT VV_ROOT +#define v_flag v_vflag +#define osi_curcred() (curthread->td_ucred) +#define afs_suser() (!suser(curthread)) +#define simple_lock(x) mtx_lock(x) +#define simple_unlock(x) mtx_unlock(x) +#define gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \ + vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(unit),(cred),(cred),(aresid), curthread) +extern struct mtx afs_global_mtx; +#define AFS_GLOCK() mtx_lock(&afs_global_mtx) +#define AFS_GUNLOCK() mtx_unlock(&afs_global_mtx) +#define ISAFS_GLOCK() (mtx_owned(&afs_global_mtx)) + +#else /* FBSD50 */ extern struct lock afs_global_lock; + +#define osi_curcred() (curproc->p_cred->pc_ucred) +#define afs_suser() (!suser(curproc)) +#define getpid() curproc +#define gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \ + vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(unit),(cred),(aresid), curproc) +extern struct proc *afs_global_owner; #define AFS_GLOCK() \ do { \ osi_Assert(curproc); \ @@ -67,6 +105,8 @@ extern struct lock afs_global_lock; lockmgr(&afs_global_lock, LK_RELEASE, 0, curproc); \ } while(0) #define ISAFS_GLOCK() (afs_global_owner == curproc && curproc) +#endif /* FBSD50 */ + #define AFS_RXGLOCK() #define AFS_RXGUNLOCK() #define ISAFS_RXGLOCK() 1 diff --git a/src/afs/FBSD/osi_misc.c b/src/afs/FBSD/osi_misc.c index 1040984fe..943197573 100644 --- a/src/afs/FBSD/osi_misc.c +++ b/src/afs/FBSD/osi_misc.c @@ -15,50 +15,160 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_misc.c,v 1.1.1.4 2002/09/26 18:58:09 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/FBSD/osi_misc.c,v 1.9 2004/03/10 23:01:51 rees Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ #include -/* - * afs_suser() returns true if the caller is superuser, false otherwise. - * - * Note that it must NOT set errno. - */ -afs_suser() { - int error; - - if (suser(curproc) == 0) { - return(1); - } - return(0); -} +#ifdef AFS_FBSD50_ENV +/* serious cheating */ +#undef curproc +#define curproc curthread +#endif -int osi_lookupname(char *aname, enum uio_seg seg, int followlink, - struct vnode **dirvpp, struct vnode **vpp) +int +osi_lookupname(char *aname, enum uio_seg seg, int followlink, + struct vnode **dirvpp, struct vnode **vpp) { - struct nameidata n; - int flags,error; - flags=0; - flags=LOCKLEAF; - if (followlink) - flags|=FOLLOW; - else - flags|=NOFOLLOW; -/* if (dirvpp) flags|=WANTPARENT;*/ /* XXX LOCKPARENT? */ - NDINIT(&n, LOOKUP, flags, seg, aname, curproc); - if (error=namei(&n)) - return error; - *vpp=n.ni_vp; + struct nameidata n; + int flags, error, wasowned; + +#ifdef AFS_FBSD50_ENV + wasowned = mtx_owned(&afs_global_mtx); + if (wasowned) + mtx_unlock(&afs_global_mtx); +#endif + + flags = 0; + flags = LOCKLEAF; + if (followlink) + flags |= FOLLOW; + else + flags |= NOFOLLOW; + /* if (dirvpp) flags|=WANTPARENT; *//* XXX LOCKPARENT? */ + NDINIT(&n, LOOKUP, flags, seg, aname, curproc); + if ((error = namei(&n)) != 0) { +#ifdef AFS_FBSD50_ENV + if (wasowned) + mtx_lock(&afs_global_mtx); +#endif + return error; + } + *vpp = n.ni_vp; /* if (dirvpp) *dirvpp = n.ni_dvp; */ - /* should we do this? */ - VOP_UNLOCK(n.ni_vp, 0, curproc); - NDFREE(&n, NDF_ONLY_PNBUF); - return 0; + /* should we do this? */ + VOP_UNLOCK(n.ni_vp, 0, curproc); + NDFREE(&n, NDF_ONLY_PNBUF); +#ifdef AFS_FBSD50_ENV + if (wasowned) + mtx_lock(&afs_global_mtx); +#endif + return 0; +} + +/* + * does not implement security features of kern_time.c:settime() + */ +void +afs_osi_SetTime(osi_timeval_t * atv) +{ +#ifdef AFS_FBSD50_ENV + printf("afs attempted to set clock; use \"afsd -nosettime\"\n"); +#else + struct timespec ts; + struct timeval tv, delta; + int s; + + AFS_GUNLOCK(); + s = splclock(); + microtime(&tv); + delta = *atv; + timevalsub(&delta, &tv); + ts.tv_sec = atv->tv_sec; + ts.tv_nsec = atv->tv_usec * 1000; + set_timecounter(&ts); + (void)splsoftclock(); + lease_updatetime(delta.tv_sec); + splx(s); + resettodr(); + AFS_GLOCK(); +#endif +} + +/* + * Replace all of the bogus special-purpose memory allocators... + */ +void * +osi_fbsd_alloc(size_t size, int dropglobal) +{ + void *rv; +#ifdef AFS_FBSD50_ENV + int wasowned; + + if (dropglobal) { + wasowned = mtx_owned(&afs_global_mtx); + if (wasowned) + mtx_unlock(&afs_global_mtx); + rv = malloc(size, M_AFS, M_WAITOK); + if (wasowned) + mtx_lock(&afs_global_mtx); + } else +#endif + rv = malloc(size, M_AFS, M_NOWAIT); + + return (rv); +} + +void +osi_fbsd_free(void *p) +{ + + free(p, M_AFS); +} + +void +osi_AllocMoreSSpace(afs_int32 preallocs) +{ + ; +} + +void +osi_FreeLargeSpace(void *p) +{ + osi_fbsd_free(p); +} + +void +osi_FreeSmallSpace(void *p) +{ + osi_fbsd_free(p); +} + +void * +osi_AllocLargeSpace(size_t size) +{ + AFS_ASSERT_GLOCK(); + AFS_STATCNT(osi_AllocLargeSpace); + return (osi_fbsd_alloc(size, 1)); +} + +void * +osi_AllocSmallSpace(size_t size) +{ + AFS_ASSERT_GLOCK(); + AFS_STATCNT(osi_AllocSmallSpace); + return (osi_fbsd_alloc(size, 1)); +} + +void +shutdown_osinet(void) +{ + ; } diff --git a/src/afs/FBSD/osi_module.c b/src/afs/FBSD/osi_module.c index 1b8fbd9da..a562ee251 100644 --- a/src/afs/FBSD/osi_module.c +++ b/src/afs/FBSD/osi_module.c @@ -1,8 +1,21 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ +#include #include + +RCSID + ("$Header: /cvs/openafs/src/afs/FBSD/osi_module.c,v 1.5 2004/03/10 23:01:51 rees Exp $"); + #include -#include +#include #include #include #include @@ -19,73 +32,79 @@ extern int afs3_syscall(); extern int Afs_xsetgroups(); extern int afs_xioctl(); -int afs_module_handler(module_t mod, int what, void *arg) { - static sy_call_t *old_handler; - static int inited=0; - int error; - error=0; - switch (what) { - case MOD_LOAD: - if (inited) { - printf ("afs cannot be MOD_LOAD'd more than once\n"); - error=-1; - break; - } - if (sysent[AFS_SYSCALL].sy_call != nosys && - sysent[AFS_SYSCALL].sy_call != lkmnosys) { - printf("AFS_SYSCALL in use. aborting\n"); - error=-1; - break; - } - memset(&afs_vfsconf, 0, sizeof(struct vfsconf)); - strcpy(afs_vfsconf.vfc_name, "AFS"); - afs_vfsconf.vfc_vfsops=&afs_vfsops; - afs_vfsconf.vfc_typenum=-1; /* set by vfs_register */ - afs_vfsconf.vfc_flags=VFCF_NETWORK; - vfs_register(&afs_vfsconf); /* doesn't fail */ - vfs_add_vnodeops(&afs_vnodeop_opv_desc); - osi_Init(); - sysent[SYS_setgroups].sy_call=Afs_xsetgroups; - sysent[SYS_ioctl].sy_call=afs_xioctl; - old_handler=sysent[AFS_SYSCALL].sy_call; - sysent[AFS_SYSCALL].sy_call=afs3_syscall; - sysent[AFS_SYSCALL].sy_narg = 5; - inited=1; - break; - case MOD_UNLOAD: +int +afs_module_handler(module_t mod, int what, void *arg) +{ + static sy_call_t *old_handler; + static int inited = 0; + int error = 0; + + switch (what) { + case MOD_LOAD: + if (inited) { + printf("afs cannot be MOD_LOAD'd more than once\n"); + error = -1; + break; + } + if (sysent[AFS_SYSCALL].sy_call != nosys + && sysent[AFS_SYSCALL].sy_call != lkmnosys) { + printf("AFS_SYSCALL in use. aborting\n"); + error = -1; + break; + } + memset(&afs_vfsconf, 0, sizeof(struct vfsconf)); + strcpy(afs_vfsconf.vfc_name, "AFS"); + afs_vfsconf.vfc_vfsops = &afs_vfsops; + afs_vfsconf.vfc_typenum = -1; /* set by vfs_register */ + afs_vfsconf.vfc_flags = VFCF_NETWORK; + vfs_register(&afs_vfsconf); /* doesn't fail */ + vfs_add_vnodeops(&afs_vnodeop_opv_desc); + osi_Init(); +#if 0 + sysent[SYS_setgroups].sy_call = Afs_xsetgroups; + sysent[SYS_ioctl].sy_call = afs_xioctl; +#endif + old_handler = sysent[AFS_SYSCALL].sy_call; + sysent[AFS_SYSCALL].sy_call = afs3_syscall; + sysent[AFS_SYSCALL].sy_narg = 5; + inited = 1; + break; + case MOD_UNLOAD: #ifndef RXK_LISTENER_ENV - /* shutdown is incomplete unless RXK_LISTENER_ENV */ - printf("afs: I can't be unloaded yet\n"); - return -1; + /* shutdown is incomplete unless RXK_LISTENER_ENV */ + printf("afs: I can't be unloaded yet\n"); + return -1; #endif - if (! inited) { - error=0; - break; - } - if (afs_globalVFS) { - error=-1; - break; - } - if (vfs_unregister(&afs_vfsconf)) { - error=-1; - break; - } - vfs_rm_vnodeops(&afs_vnodeop_opv_desc); - sysent[SYS_ioctl].sy_call = ioctl; - sysent[SYS_setgroups].sy_call = setgroups; - sysent[AFS_SYSCALL].sy_narg = 0; - sysent[AFS_SYSCALL].sy_call = old_handler; - break; - } + if (!inited) { + error = 0; + break; + } + if (afs_globalVFS) { + error = -1; + break; + } + if (vfs_unregister(&afs_vfsconf)) { + error = -1; + break; + } + vfs_rm_vnodeops(&afs_vnodeop_opv_desc); +#if 0 + sysent[SYS_ioctl].sy_call = ioctl; + sysent[SYS_setgroups].sy_call = setgroups; +#endif + sysent[AFS_SYSCALL].sy_narg = 0; + sysent[AFS_SYSCALL].sy_call = old_handler; + break; + } - return (error); + return (error); } static moduledata_t afs_mod = { - "afs", - afs_module_handler, - &afs_mod + "afs", + afs_module_handler, + &afs_mod }; -DECLARE_MODULE(afs, afs_mod, SI_SUB_VFS, SI_ORDER_MIDDLE); +DECLARE_MODULE(afs, afs_mod, SI_SUB_VFS, SI_ORDER_MIDDLE); diff --git a/src/afs/FBSD/osi_prototypes.h b/src/afs/FBSD/osi_prototypes.h index b6bac7919..085eef7e3 100644 --- a/src/afs/FBSD/osi_prototypes.h +++ b/src/afs/FBSD/osi_prototypes.h @@ -9,12 +9,25 @@ /* * osi_prototypes.h * - * Exported macos support routines. + * Exported support routines. */ #ifndef _OSI_PROTO_H_ #define _OSI_PROTO_H_ +/* osi_file.c */ +extern afs_rwlock_t afs_xosi; + /* osi_misc.c */ extern int osi_lookupname(char *aname, enum uio_seg seg, int followlink, - struct vnode **dirvpp, struct vnode **vpp); + struct vnode **dirvpp, struct vnode **vpp); +extern void *osi_fbsd_alloc(size_t size, int dropglobal); +extern void osi_fbsd_free(void *p); + +/* osi_vfsops.c */ +#ifdef AFS_FBSD50_ENV +extern int afs_statfs(struct mount *mp, struct statfs *abp, struct thread *th); +#else +extern int afs_statfs(struct mount *mp, struct statfs *abp, struct proc *p); +#endif + #endif /* _OSI_PROTO_H_ */ diff --git a/src/afs/FBSD/osi_sleep.c b/src/afs/FBSD/osi_sleep.c index 4728a201a..15786fbff 100644 --- a/src/afs/FBSD/osi_sleep.c +++ b/src/afs/FBSD/osi_sleep.c @@ -9,90 +9,140 @@ #include -#include "../afs/param.h" - -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_sleep.c,v 1.1.1.4 2002/09/26 18:58:09 hartmans Exp $"); - -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/param.h" +RCSID + ("$Header: /cvs/openafs/src/afs/FBSD/osi_sleep.c,v 1.11 2004/03/10 23:01:51 rees Exp $"); +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ +#ifndef AFS_FBSD50_ENV static int osi_TimedSleep(char *event, afs_int32 ams, int aintok); -void afs_osi_Wakeup(char *event); -void afs_osi_Sleep(char *event); - static char waitV; +#endif -void afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) +void +afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) { AFS_STATCNT(osi_InitWaitHandle); - achandle->proc = (caddr_t) 0; +#ifdef AFS_FBSD50_ENV + cv_init(&achandle->wh_condvar, "afscondvar"); + achandle->wh_inited = 1; +#else + achandle->proc = NULL; +#endif } /* cancel osi_Wait */ -void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) +/* XXX + * I can't tell -- is this supposed to be cv_signal() or cv_waitq_remove()? + * Or perhaps cv_broadcast()? + * Assuming cv_signal() is the desired meaning. -GAW + */ +void +afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) { +#ifndef AFS_FBSD50_ENV caddr_t proc; +#endif AFS_STATCNT(osi_CancelWait); + +#ifdef AFS_FBSD50_ENV + /* XXX should not be necessary */ + if (!achandle->wh_inited) + return; + AFS_ASSERT_GLOCK(); + cv_signal(&achandle->wh_condvar); +#else proc = achandle->proc; - if (proc == 0) return; - achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ + if (proc == 0) + return; + achandle->proc = NULL; /* so dude can figure out he was signalled */ afs_osi_Wakeup(&waitV); +#endif } /* afs_osi_Wait * Waits for data on ahandle, or ams ms later. ahandle may be null. * Returns 0 if timeout and EINTR if signalled. */ -int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) +int +afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) { int code; - afs_int32 endTime, tid; +#ifdef AFS_FBSD50_ENV + struct timeval tv; + int ticks; +#else + afs_int32 endTime; +#endif AFS_STATCNT(osi_Wait); - endTime = osi_Time() + (ams/1000); +#ifdef AFS_FBSD50_ENV + tv.tv_sec = ams / 1000; + tv.tv_usec = (ams % 1000) * 1000; + ticks = tvtohz(&tv); + + AFS_ASSERT_GLOCK(); + if (ahandle == NULL) { + /* This is nasty and evil and rude. */ + code = msleep(&tv, &afs_global_mtx, (aintok ? PPAUSE|PCATCH : PVFS), + "afswait", ticks); + } else { + if (!ahandle->wh_inited) + afs_osi_InitWaitHandle(ahandle); /* XXX should not be needed */ + + if (aintok) + code = cv_timedwait_sig(&ahandle->wh_condvar, &afs_global_mtx, + ticks); + else + code = cv_timedwait(&ahandle->wh_condvar, &afs_global_mtx, ticks); + } +#else + endTime = osi_Time() + (ams / 1000); if (ahandle) - ahandle->proc = (caddr_t) curproc; + ahandle->proc = (caddr_t) curproc; do { AFS_ASSERT_GLOCK(); - code = 0; code = osi_TimedSleep(&waitV, ams, aintok); - - if (code) break; /* if something happened, quit now */ + if (code) + break; /* if something happened, quit now */ /* if we we're cancelled, quit now */ - if (ahandle && (ahandle->proc == (caddr_t) 0)) { + if (ahandle && (ahandle->proc == NULL)) { /* we've been signalled */ break; } } while (osi_Time() < endTime); +#endif return code; } - - - +/* + * All this gluck should probably also be replaced with CVs. + */ typedef struct afs_event { struct afs_event *next; /* next in hash chain */ char *event; /* lwp event: an address */ int refcount; /* Is it in use? */ int seq; /* Sequence number: this is incremented - by wakeup calls; wait will not return until - it changes */ + * by wakeup calls; wait will not return until + * it changes */ int cond; } afs_event_t; #define HASHSIZE 128 -afs_event_t *afs_evhasht[HASHSIZE];/* Hash table for events */ +afs_event_t *afs_evhasht[HASHSIZE]; /* Hash table for events */ #define afs_evhash(event) (afs_uint32) ((((long)event)>>2) & (HASHSIZE-1)); int afs_evhashcnt = 0; /* Get and initialize event structure corresponding to lwp event (i.e. address) * */ -static afs_event_t *afs_getevent(char *event) +static afs_event_t * +afs_getevent(char *event) { afs_event_t *evp, *newp = 0; int hashcode; @@ -110,7 +160,7 @@ static afs_event_t *afs_getevent(char *event) evp = evp->next; } if (!newp) { - newp = (afs_event_t *) osi_AllocSmallSpace(sizeof (afs_event_t)); + newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t)); afs_evhashcnt++; newp->next = afs_evhasht[hashcode]; afs_evhasht[hashcode] = newp; @@ -125,7 +175,8 @@ static afs_event_t *afs_getevent(char *event) #define relevent(evp) ((evp)->refcount--) -void afs_osi_Sleep(char *event) +void +afs_osi_Sleep(void *event) { struct afs_event *evp; int seq; @@ -134,19 +185,25 @@ void afs_osi_Sleep(char *event) seq = evp->seq; while (seq == evp->seq) { AFS_ASSERT_GLOCK(); +#ifdef AFS_FBSD50_ENV + msleep(event, &afs_global_mtx, PVFS, "afsslp", 0); +#else AFS_GUNLOCK(); - tsleep(event, PVFS, "afs_osi_Sleep", 0); + tsleep(event, PVFS, "afs_osi_Sleep", 0); AFS_GLOCK(); +#endif } relevent(evp); } -int afs_osi_SleepSig(char *event) +int +afs_osi_SleepSig(void *event) { afs_osi_Sleep(event); return 0; } +#ifndef AFS_FBSD50_ENV /* osi_TimedSleep * * Arguments: @@ -156,40 +213,45 @@ int afs_osi_SleepSig(char *event) * * Returns 0 if timeout and EINTR if signalled. */ -static int osi_TimedSleep(char *event, afs_int32 ams, int aintok) +static int +osi_TimedSleep(char *event, afs_int32 ams, int aintok) { int code = 0; struct afs_event *evp; int ticks; - int seq,prio; - - ticks = ( ams * afs_hz )/1000; + int seq, prio; + + ticks = (ams * afs_hz) / 1000; evp = afs_getevent(event); - seq=evp->seq; + seq = evp->seq; AFS_GUNLOCK(); if (aintok) - prio=PCATCH|PPAUSE; + prio = PCATCH | PPAUSE; else - prio=PVFS; - code=tsleep(event, prio, "afs_osi_TimedSleep", ticks); + prio = PVFS; + code = tsleep(event, prio, "afs_osi_TimedSleep", ticks); AFS_GLOCK(); if (seq == evp->seq) - code=EINTR; + code = EINTR; relevent(evp); return code; } +#endif /* not AFS_FBSD50_ENV */ - -void afs_osi_Wakeup(char *event) +int +afs_osi_Wakeup(void *event) { + int ret = 1; struct afs_event *evp; evp = afs_getevent(event); if (evp->refcount > 1) { - evp->seq++; + evp->seq++; wakeup(event); + ret = 0; } relevent(evp); + return ret; } diff --git a/src/afs/FBSD/osi_vfsops.c b/src/afs/FBSD/osi_vfsops.c index 1617010fd..b66f76061 100644 --- a/src/afs/FBSD/osi_vfsops.c +++ b/src/afs/FBSD/osi_vfsops.c @@ -1,11 +1,12 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_vfsops.c,v 1.1.1.6 2002/09/26 18:58:09 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/FBSD/osi_vfsops.c,v 1.15 2004/03/10 23:01:51 rees Exp $"); -#include /* Standard vendor system headers */ -#include /* Afs-based standard headers */ -#include /* statistics */ +#include /* Standard vendor system headers */ +#include /* Afs-based standard headers */ +#include /* statistics */ #include #include #include @@ -13,54 +14,28 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_vfsops.c,v 1.1.1.6 2002/09 struct vcache *afs_globalVp = 0; struct mount *afs_globalVFS = 0; -int afs_pbuf_freecnt=-1; -int -afs_quotactl() -{ - return EOPNOTSUPP; -} - -int -afs_fhtovp(mp, fhp, vpp) -struct mount *mp; -struct fid *fhp; -struct vnode **vpp; -{ - - return (EINVAL); -} - -int -afs_vptofh(vp, fhp) -struct vnode *vp; -struct fid *fhp; -{ +int afs_pbuf_freecnt = -1; - return (EINVAL); -} +#ifdef AFS_FBSD50_ENV +#define THREAD_OR_PROC struct thread *p +#else +#define THREAD_OR_PROC struct proc *p +#endif int -afs_start(mp, flags, p) -struct mount *mp; -int flags; -struct proc *p; +afs_start(struct mount *mp, int flags, THREAD_OR_PROC) { afs_pbuf_freecnt = nswbuf / 2 + 1; - return (0); /* nothing to do. ? */ + return (0); /* nothing to do. ? */ } int -afs_mount(mp, path, data, ndp, p) -register struct mount *mp; -char *path; -caddr_t data; -struct nameidata *ndp; -struct proc *p; +afs_mount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp, + THREAD_OR_PROC) { /* ndp contains the mounted-from device. Just ignore it. - we also don't care about our proc struct. */ + * we also don't care about our proc struct. */ size_t size; - int error; if (mp->mnt_flag & MNT_UPDATE) return EINVAL; @@ -68,7 +43,7 @@ struct proc *p; AFS_GLOCK(); AFS_STATCNT(afs_mount); - if (afs_globalVFS) { /* Don't allow remounts. */ + if (afs_globalVFS) { /* Don't allow remounts. */ AFS_GUNLOCK(); return (EBUSY); } @@ -76,26 +51,30 @@ struct proc *p; afs_globalVFS = mp; mp->vfs_bsize = 8192; vfs_getnewfsid(mp); - mp->mnt_stat.f_iosize=8192; - - (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN-1, &size); + mp->mnt_stat.f_iosize = 8192; + + (void)copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); memset(mp->mnt_stat.f_mntonname + size, 0, MNAMELEN - size); memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN); strcpy(mp->mnt_stat.f_mntfromname, "AFS"); /* null terminated string "AFS" will fit, just leave it be. */ strcpy(mp->mnt_stat.f_fstypename, "afs"); AFS_GUNLOCK(); - (void) afs_statfs(mp, &mp->mnt_stat, p); + (void)afs_statfs(mp, &mp->mnt_stat, p); return 0; } int -afs_unmount(mp, flags, p) -struct mount *mp; -int flags; -struct proc *p; +afs_unmount(struct mount *mp, int flags, THREAD_OR_PROC) { - + + /* + * Release any remaining vnodes on this mount point. + * The `1' means that we hold one extra reference on + * the root vnode (this is just a guess right now). + * This has to be done outside the global lock. + */ + vflush(mp, 1, (flags & MNT_FORCE) ? FORCECLOSE : 0); AFS_GLOCK(); AFS_STATCNT(afs_unmount); afs_globalVFS = 0; @@ -106,76 +85,82 @@ struct proc *p; } int -afs_root(struct mount *mp, - struct vnode **vpp) +afs_root(struct mount *mp, struct vnode **vpp) { int error; struct vrequest treq; - register struct vcache *tvp=0; - struct proc *p=curproc; - struct ucred cr; + register struct vcache *tvp = 0; +#ifdef AFS_FBSD50_ENV + struct thread *td = curthread; + struct ucred *cr = td->td_ucred; +#else + struct proc *p = curproc; + struct ucred *cr = p->p_cred->pc_ucred; +#endif - cr=*p->p_cred->pc_ucred; AFS_GLOCK(); AFS_STATCNT(afs_root); + crhold(cr); if (afs_globalVp && (afs_globalVp->states & CStatd)) { tvp = afs_globalVp; - error=0; + error = 0; } else { - - if (!(error = afs_InitReq(&treq, &cr)) && - !(error = afs_CheckInit())) { - tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); +tryagain: + if (afs_globalVp) { + afs_PutVCache(afs_globalVp); + /* vrele() needed here or not? */ + afs_globalVp = NULL; + } + + if (!(error = afs_InitReq(&treq, cr)) && !(error = afs_CheckInit())) { + tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL); /* we really want this to stay around */ - if (tvp) { - afs_globalVp = tvp; - } else - error = ENOENT; + if (tvp) + afs_globalVp = tvp; + else + error = ENOENT; } } if (tvp) { - osi_vnhold(tvp,0); - AFS_GUNLOCK(); - vn_lock(AFSTOV(tvp), LK_EXCLUSIVE | LK_RETRY, p); - AFS_GLOCK(); + struct vnode *vp = AFSTOV(tvp); + +#ifdef AFS_FBSD50_ENV + ASSERT_VI_UNLOCKED(vp, "afs_root"); +#endif + AFS_GUNLOCK(); + /* + * I'm uncomfortable about this. Shouldn't this happen at a + * higher level, and shouldn't we busy the top-level directory + * to prevent recycling? + */ +#ifdef AFS_FBSD50_ENV + error = vget(vp, LK_EXCLUSIVE | LK_RETRY, td); + vp->v_vflag |= VV_ROOT; +#else + error = vget(vp, LK_EXCLUSIVE | LK_RETRY, p); + vp->v_flag |= VROOT; +#endif + AFS_GLOCK(); + if (error != 0) + goto tryagain; + afs_globalVFS = mp; - *vpp = AFSTOV(tvp); - tvp->v.v_flag |= VROOT; + *vpp = vp; } afs_Trace2(afs_iclSetp, CM_TRACE_VFSROOT, ICL_TYPE_POINTER, *vpp, ICL_TYPE_INT32, error); AFS_GUNLOCK(); + crfree(cr); return error; } int -afs_vget(mp, lfl, vp) -struct mount *mp; -struct vnode *vp; -int lfl; -{ - int error; - printf("vget called. help!\n"); - if (vp->v_usecount < 0) { - vprint("bad usecount", vp); - panic("afs_vget"); - } - error = vget(vp, lfl, curproc); - if (!error) - insmntque(vp, afs_globalVFS); /* take off free list */ - return error; -} - -int afs_statfs(struct mount *mp, struct statfs *abp, struct proc *p) +afs_statfs(struct mount *mp, struct statfs *abp, THREAD_OR_PROC) { AFS_GLOCK(); AFS_STATCNT(afs_statfs); -#if 0 - abp->f_type = MOUNT_AFS; -#endif abp->f_bsize = mp->vfs_bsize; abp->f_iosize = mp->vfs_bsize; @@ -184,49 +169,50 @@ int afs_statfs(struct mount *mp, struct statfs *abp, struct proc *p) * storing something there. */ abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files = - abp->f_ffree = 2000000; + abp->f_ffree = 2000000; abp->f_fsid.val[0] = mp->mnt_stat.f_fsid.val[0]; abp->f_fsid.val[1] = mp->mnt_stat.f_fsid.val[1]; if (abp != &mp->mnt_stat) { abp->f_type = mp->mnt_vfc->vfc_typenum; - memcpy((caddr_t)&abp->f_mntonname[0], (caddr_t)mp->mnt_stat.f_mntonname, MNAMELEN); - memcpy((caddr_t)&abp->f_mntfromname[0], (caddr_t)mp->mnt_stat.f_mntfromname, MNAMELEN); + memcpy((caddr_t) & abp->f_mntonname[0], + (caddr_t) mp->mnt_stat.f_mntonname, MNAMELEN); + memcpy((caddr_t) & abp->f_mntfromname[0], + (caddr_t) mp->mnt_stat.f_mntfromname, MNAMELEN); } AFS_GUNLOCK(); return 0; } -int afs_sync(mp, waitfor, cred, p) -struct mount *mp; -int waitfor; -struct ucred *cred; -struct prioc *p; +int +afs_sync(struct mount *mp, int waitfor, struct ucred *cred, THREAD_OR_PROC) { -return 0; -} - -int afs_sysctl() { - return EOPNOTSUPP; + return 0; } - -int afs_init(struct vfsconf *vfc) { - return 0; +int +afs_init(struct vfsconf *vfc) +{ + return 0; } struct vfsops afs_vfsops = { - afs_mount, - afs_start, - afs_unmount, - afs_root, - afs_quotactl, - afs_statfs, - afs_sync, - afs_vget, - afs_fhtovp, - afs_vptofh, - afs_init, - afs_sysctl + afs_mount, + afs_start, + afs_unmount, + afs_root, + vfs_stdquotactl, + afs_statfs, + afs_sync, + vfs_stdvget, + vfs_stdfhtovp, + vfs_stdcheckexp, + vfs_stdvptofh, + afs_init, + vfs_stduninit, + vfs_stdextattrctl, +#ifdef AFS_FBSD50_ENV + NULL, +#endif }; diff --git a/src/afs/FBSD/osi_vm.c b/src/afs/FBSD/osi_vm.c index 7dddab8ad..08db0570c 100644 --- a/src/afs/FBSD/osi_vm.c +++ b/src/afs/FBSD/osi_vm.c @@ -19,18 +19,46 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_vm.c,v 1.1.1.5 2002/09/26 18:58:09 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/FBSD/osi_vm.c,v 1.11 2004/03/10 23:01:51 rees Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ #include #include #include #include +/* + * FreeBSD implementation notes: + * Most of these operations require us to frob vm_objects. Most + * functions require that the object be locked (with VM_OBJECT_LOCK) + * on entry and leave it locked on exit. In order to get the + * vm_object itself we call VOP_GETVOBJECT on the vnode; the + * locking protocol requires that we do so with the heavy vnode lock + * held and the vnode interlock unlocked, and it returns the same + * way. + * + * The locking protocol for vnodes is defined in + * kern/vnode_if.src and sys/vnode.h; the locking is still a work in + * progress, so some fields are (as of 5.1) still protected by Giant + * rather than an explicit lock. + */ + +#ifdef AFS_FBSD50_ENV +#define lock_vnode(v) vn_lock((v), LK_EXCLUSIVE | LK_RETRY, curthread) +#define unlock_vnode(v) VOP_UNLOCK((v), 0, curthread) +#else +#define lock_vnode(v) vn_lock((v), LK_EXCLUSIVE | LK_RETRY, curproc) +#define unlock_vnode(v) VOP_UNLOCK((v), 0, curproc) +/* need splvm() protection? */ +#define VM_OBJECT_LOCK(o) +#define VM_OBJECT_UNLOCK(o) +#endif + /* Try to discard pages, in order to recycle a vcache entry. * * We also make some sanity checks: ref count, open count, held locks. @@ -46,11 +74,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_vm.c,v 1.1.1.5 2002/09/26 * therefore obsolescent. * * OSF/1 Locking: VN_LOCK has been called. + * XXX - should FreeBSD have done this, too? Certainly looks like it. + * Maybe better to just call vnode_pager_setsize()? */ int -osi_VM_FlushVCache(avc, slept) - struct vcache *avc; - int *slept; +osi_VM_FlushVCache(struct vcache *avc, int *slept) { struct vm_object *obj; struct vnode *vp; @@ -65,20 +93,22 @@ osi_VM_FlushVCache(avc, slept) return EBUSY; AFS_GUNLOCK(); - vp=avc; - simple_lock(&vp->v_interlock); + vp = AFSTOV(avc); + lock_vnode(vp); if (VOP_GETVOBJECT(vp, &obj) == 0) { - vm_object_page_remove(obj, 0, 0, FALSE); + VM_OBJECT_LOCK(obj); + vm_object_page_remove(obj, 0, 0, FALSE); #if 0 - if (obj->ref_count == 0) { - vgonel(vp,curproc); - simple_lock(&vp->v_interlock); - vp->v_tag=VT_AFS; - SetAfsVnode(vp); - } + if (obj->ref_count == 0) { + vgonel(vp, curproc); + simple_lock(&vp->v_interlock); + vp->v_tag = VT_AFS; + SetAfsVnode(vp); + } #endif - } - simple_unlock(&vp->v_interlock); + VM_OBJECT_UNLOCK(obj); + } + unlock_vnode(vp); AFS_GLOCK(); return 0; @@ -90,35 +120,50 @@ osi_VM_FlushVCache(avc, slept) * re-obtained. */ void -osi_VM_StoreAllSegments(avc) - struct vcache *avc; +osi_VM_StoreAllSegments(struct vcache *avc) { struct vnode *vp; struct vm_object *obj; - int anyio,tries; + int anyio, tries; + ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); - tries=5; - vp=avc; + tries = 5; + vp = AFSTOV(avc); + + /* + * I don't understand this. Why not just call vm_object_page_clean() + * and be done with it? I particularly don't understand why we're calling + * vget() here. Is there some reason to believe that the vnode might + * be being recycled at this point? I don't think there's any need for + * this loop, either -- if we keep the vnode locked all the time, + * that and the object lock will prevent any new pages from appearing. + * The loop is what causes the race condition. -GAW + */ do { - anyio=0; - simple_lock(&vp->v_interlock); - if (VOP_GETVOBJECT(vp, &obj) == 0 && - (obj->flags & OBJ_MIGHTBEDIRTY)) { - if (!vget(vp, - LK_INTERLOCK | LK_EXCLUSIVE | LK_RETRY | LK_NOOBJ, curproc)) { - if (VOP_GETVOBJECT(vp, &obj) == 0) { - vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); - anyio = 1; - } - vput(vp); - } - } else { - simple_unlock(&vp->v_interlock); - } + anyio = 0; + lock_vnode(vp); + if (VOP_GETVOBJECT(vp, &obj) == 0 && (obj->flags & OBJ_MIGHTBEDIRTY)) { + /* XXX - obj locking? */ + unlock_vnode(vp); +#ifdef AFS_FBSD50_ENV + if (!vget(vp, LK_EXCLUSIVE | LK_RETRY, curthread)) { +#else + if (!vget(vp, LK_EXCLUSIVE | LK_RETRY | LK_NOOBJ, curproc)) { +#endif + if (VOP_GETVOBJECT(vp, &obj) == 0) { + VM_OBJECT_LOCK(obj); + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_UNLOCK(obj); + anyio = 1; + } + vput(vp); + } + } else + unlock_vnode(vp); } while (anyio && (--tries > 0)); AFS_GLOCK(); - ObtainWriteLock(&avc->lock,94); + ObtainWriteLock(&avc->lock, 94); } /* Try to invalidate pages, for "fs flush" or "fs flushv"; or @@ -131,43 +176,56 @@ osi_VM_StoreAllSegments(avc) * be some pages around when we return, newly created by concurrent activity. */ void -osi_VM_TryToSmush(avc, acred, sync) - struct vcache *avc; - struct AFS_UCRED *acred; - int sync; +osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync) { struct vnode *vp; struct vm_object *obj; int anyio, tries; + ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); - tries=5; - vp=avc; + tries = 5; + vp = AFSTOV(avc); do { - anyio=0; - simple_lock(&vp->v_interlock); - if (VOP_GETVOBJECT(vp, &obj) == 0 && - (obj->flags & OBJ_MIGHTBEDIRTY)) { - if (!vget(vp, - LK_INTERLOCK | LK_EXCLUSIVE | LK_RETRY | LK_NOOBJ, curproc)) { - if (VOP_GETVOBJECT(vp, &obj) == 0) { - vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); - anyio = 1; - } - vput(vp); - } - } else { - simple_unlock(&vp->v_interlock); - } + anyio = 0; + lock_vnode(vp); + /* See the comments above. */ + if (VOP_GETVOBJECT(vp, &obj) == 0 && (obj->flags & OBJ_MIGHTBEDIRTY)) { + /* XXX - obj locking */ + unlock_vnode(vp); +#ifdef AFS_FBSD50_ENV + if (!vget(vp, LK_EXCLUSIVE | LK_RETRY, curthread)) { +#else + if (!vget(vp, LK_EXCLUSIVE | LK_RETRY | LK_NOOBJ, curproc)) { +#endif + if (VOP_GETVOBJECT(vp, &obj) == 0) { + VM_OBJECT_LOCK(obj); + /* + * Do we really want OBJPC_SYNC? OBJPC_INVAL would be + * faster, if invalidation is really what we are being + * asked to do. (It would make more sense, too, since + * otherwise this function is practically identical to + * osi_VM_StoreAllSegments().) -GAW + */ + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_UNLOCK(obj); + anyio = 1; + } + vput(vp); + } + } else + unlock_vnode(vp); } while (anyio && (--tries > 0)); - simple_lock(&vp->v_interlock); + lock_vnode(vp); if (VOP_GETVOBJECT(vp, &obj) == 0) { - vm_object_page_remove(obj, 0, 0, FALSE); + VM_OBJECT_LOCK(obj); + vm_object_page_remove(obj, 0, 0, FALSE); + VM_OBJECT_UNLOCK(obj); } - simple_unlock(&vp->v_interlock); - /*vinvalbuf(AFSTOV(avc),0, NOCRED, curproc, 0,0);*/ + unlock_vnode(vp); + /*vinvalbuf(AFSTOV(avc),0, NOCRED, curproc, 0,0); */ AFS_GLOCK(); - ObtainWriteLock(&avc->lock,59); + ObtainWriteLock(&avc->lock, 59); } /* Purge VM for a file when its callback is revoked. @@ -175,19 +233,19 @@ osi_VM_TryToSmush(avc, acred, sync) * Locking: No lock is held, not even the global lock. */ void -osi_VM_FlushPages(avc, credp) - struct vcache *avc; - struct AFS_UCRED *credp; +osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) { struct vnode *vp; struct vm_object *obj; - vp=avc; - simple_lock(&vp->v_interlock); + + vp = AFSTOV(avc); + ASSERT_VOP_LOCKED(vp, __func__); if (VOP_GETVOBJECT(vp, &obj) == 0) { - vm_object_page_remove(obj, 0, 0, FALSE); + VM_OBJECT_LOCK(obj); + vm_object_page_remove(obj, 0, 0, FALSE); + VM_OBJECT_UNLOCK(obj); } - simple_unlock(&vp->v_interlock); - /*vinvalbuf(AFSTOV(avc),0, NOCRED, curproc, 0,0);*/ + /*vinvalbuf(AFSTOV(avc),0, NOCRED, curproc, 0,0); */ } /* Purge pages beyond end-of-file, when truncating a file. @@ -197,10 +255,7 @@ osi_VM_FlushPages(avc, credp) * it only works on Solaris. */ void -osi_VM_Truncate(avc, alen, acred) - struct vcache *avc; - int alen; - struct AFS_UCRED *acred; +osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) { vnode_pager_setsize(AFSTOV(avc), alen); } diff --git a/src/afs/FBSD/osi_vnodeops.c b/src/afs/FBSD/osi_vnodeops.c index 574d0a493..be0030c32 100644 --- a/src/afs/FBSD/osi_vnodeops.c +++ b/src/afs/FBSD/osi_vnodeops.c @@ -1,14 +1,64 @@ +/* + * A large chunk of this file appears to be copied directly from + * sys/nfsclient/nfs_bio.c, which has the following license: + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Rick Macklem at The University of Guelph. + * + * 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 University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + * + * @(#)nfs_bio.c 8.9 (Berkeley) 3/30/95 + */ +/* + * Pursuant to a statement of U.C. Berkeley dated 1999-07-22, this license + * is amended to drop clause (3) above. + */ + #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_vnodeops.c,v 1.1.1.4 2002/09/26 18:58:10 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/FBSD/osi_vnodeops.c,v 1.18 2004/03/19 15:37:10 rees Exp $"); -#include /* Standard vendor system headers */ -#include /* Afs-based standard headers */ -#include /* statistics */ +#include /* Standard vendor system headers */ +#include /* Afs-based standard headers */ +#include /* statistics */ #include #include +#include +#ifndef AFS_FBSD50_ENV #include +#endif #include #include #include @@ -28,8 +78,11 @@ int afs_vop_write(struct vop_write_args *); int afs_vop_getpages(struct vop_getpages_args *); int afs_vop_putpages(struct vop_putpages_args *); int afs_vop_ioctl(struct vop_ioctl_args *); +static int afs_vop_pathconf(struct vop_pathconf_args *); int afs_vop_poll(struct vop_poll_args *); +#ifndef AFS_FBSD50_ENV int afs_vop_mmap(struct vop_mmap_args *); +#endif int afs_vop_fsync(struct vop_fsync_args *); int afs_vop_remove(struct vop_remove_args *); int afs_vop_link(struct vop_link_args *); @@ -54,50 +107,52 @@ int afs_vop_advlock(struct vop_advlock_args *); /* Global vfs data structures for AFS. */ vop_t **afs_vnodeop_p; struct vnodeopv_entry_desc afs_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vop_eopnotsupp }, - { &vop_access_desc, (vop_t *) afs_vop_access }, /* access */ - { &vop_advlock_desc, (vop_t *) afs_vop_advlock }, /* advlock */ - { &vop_bmap_desc, (vop_t *) afs_vop_bmap }, /* bmap */ - { &vop_bwrite_desc, (vop_t *) vop_stdbwrite }, - { &vop_close_desc, (vop_t *) afs_vop_close }, /* close */ - { &vop_createvobject_desc, (vop_t *) vop_stdcreatevobject }, - { &vop_destroyvobject_desc, (vop_t *) vop_stddestroyvobject }, - { &vop_create_desc, (vop_t *) afs_vop_create }, /* create */ - { &vop_fsync_desc, (vop_t *) afs_vop_fsync }, /* fsync */ - { &vop_getattr_desc, (vop_t *) afs_vop_getattr }, /* getattr */ - { &vop_getpages_desc, (vop_t *) afs_vop_getpages }, /* read */ - { &vop_getvobject_desc, (vop_t *) vop_stdgetvobject }, - { &vop_putpages_desc, (vop_t *) afs_vop_putpages }, /* write */ - { &vop_inactive_desc, (vop_t *) afs_vop_inactive }, /* inactive */ - { &vop_islocked_desc, (vop_t *) afs_vop_islocked }, /* islocked */ - { &vop_lease_desc, (vop_t *) vop_null }, - { &vop_link_desc, (vop_t *) afs_vop_link }, /* link */ - { &vop_lock_desc, (vop_t *) afs_vop_lock }, /* lock */ - { &vop_lookup_desc, (vop_t *) afs_vop_lookup }, /* lookup */ - { &vop_mkdir_desc, (vop_t *) afs_vop_mkdir }, /* mkdir */ - { &vop_mknod_desc, (vop_t *) afs_vop_mknod }, /* mknod */ - { &vop_mmap_desc, (vop_t *) afs_vop_mmap }, /* mmap */ - { &vop_open_desc, (vop_t *) afs_vop_open }, /* open */ - { &vop_poll_desc, (vop_t *) afs_vop_poll }, /* select */ - { &vop_print_desc, (vop_t *) afs_vop_print }, /* print */ - { &vop_read_desc, (vop_t *) afs_vop_read }, /* read */ - { &vop_readdir_desc, (vop_t *) afs_vop_readdir }, /* readdir */ - { &vop_readlink_desc, (vop_t *) afs_vop_readlink }, /* readlink */ - { &vop_reclaim_desc, (vop_t *) afs_vop_reclaim }, /* reclaim */ - { &vop_remove_desc, (vop_t *) afs_vop_remove }, /* remove */ - { &vop_rename_desc, (vop_t *) afs_vop_rename }, /* rename */ - { &vop_rmdir_desc, (vop_t *) afs_vop_rmdir }, /* rmdir */ - { &vop_setattr_desc, (vop_t *) afs_vop_setattr }, /* setattr */ - { &vop_strategy_desc, (vop_t *) afs_vop_strategy }, /* strategy */ - { &vop_symlink_desc, (vop_t *) afs_vop_symlink }, /* symlink */ - { &vop_unlock_desc, (vop_t *) afs_vop_unlock }, /* unlock */ - { &vop_write_desc, (vop_t *) afs_vop_write }, /* write */ - { &vop_ioctl_desc, (vop_t *) afs_vop_ioctl }, /* XXX ioctl */ - /*{ &vop_seek_desc, afs_vop_seek },*/ /* seek */ - { NULL, NULL } + {&vop_default_desc, (vop_t *) vop_defaultop}, + {&vop_access_desc, (vop_t *) afs_vop_access}, /* access */ + {&vop_advlock_desc, (vop_t *) afs_vop_advlock}, /* advlock */ + {&vop_bmap_desc, (vop_t *) afs_vop_bmap}, /* bmap */ +#ifndef AFS_FBSD50_ENV + {&vop_bwrite_desc, (vop_t *) vop_stdbwrite}, +#endif + {&vop_close_desc, (vop_t *) afs_vop_close}, /* close */ + {&vop_createvobject_desc, (vop_t *) vop_stdcreatevobject}, + {&vop_destroyvobject_desc, (vop_t *) vop_stddestroyvobject}, + {&vop_create_desc, (vop_t *) afs_vop_create}, /* create */ + {&vop_fsync_desc, (vop_t *) afs_vop_fsync}, /* fsync */ + {&vop_getattr_desc, (vop_t *) afs_vop_getattr}, /* getattr */ + {&vop_getpages_desc, (vop_t *) afs_vop_getpages}, /* read */ + {&vop_getvobject_desc, (vop_t *) vop_stdgetvobject}, + {&vop_putpages_desc, (vop_t *) afs_vop_putpages}, /* write */ + {&vop_inactive_desc, (vop_t *) afs_vop_inactive}, /* inactive */ + {&vop_lease_desc, (vop_t *) vop_null}, + {&vop_link_desc, (vop_t *) afs_vop_link}, /* link */ + {&vop_lookup_desc, (vop_t *) afs_vop_lookup}, /* lookup */ + {&vop_mkdir_desc, (vop_t *) afs_vop_mkdir}, /* mkdir */ + {&vop_mknod_desc, (vop_t *) afs_vop_mknod}, /* mknod */ +#ifndef AFS_FBSD50_ENV + {&vop_mmap_desc, (vop_t *) afs_vop_mmap}, /* mmap */ +#endif + {&vop_open_desc, (vop_t *) afs_vop_open}, /* open */ + {&vop_pathconf_desc, (vop_t *) afs_vop_pathconf}, /* pathconf */ + {&vop_poll_desc, (vop_t *) afs_vop_poll}, /* select */ + {&vop_print_desc, (vop_t *) afs_vop_print}, /* print */ + {&vop_read_desc, (vop_t *) afs_vop_read}, /* read */ + {&vop_readdir_desc, (vop_t *) afs_vop_readdir}, /* readdir */ + {&vop_readlink_desc, (vop_t *) afs_vop_readlink}, /* readlink */ + {&vop_reclaim_desc, (vop_t *) afs_vop_reclaim}, /* reclaim */ + {&vop_remove_desc, (vop_t *) afs_vop_remove}, /* remove */ + {&vop_rename_desc, (vop_t *) afs_vop_rename}, /* rename */ + {&vop_rmdir_desc, (vop_t *) afs_vop_rmdir}, /* rmdir */ + {&vop_setattr_desc, (vop_t *) afs_vop_setattr}, /* setattr */ + {&vop_strategy_desc, (vop_t *) afs_vop_strategy}, /* strategy */ + {&vop_symlink_desc, (vop_t *) afs_vop_symlink}, /* symlink */ + {&vop_write_desc, (vop_t *) afs_vop_write}, /* write */ + {&vop_ioctl_desc, (vop_t *) afs_vop_ioctl}, /* XXX ioctl */ + /*{ &vop_seek_desc, afs_vop_seek }, *//* seek */ + {NULL, NULL} }; struct vnodeopv_desc afs_vnodeop_opv_desc = - { &afs_vnodeop_p, afs_vnodeop_entries }; + { &afs_vnodeop_p, afs_vnodeop_entries }; #define GETNAME() \ struct componentname *cnp = ap->a_cnp; \ @@ -107,29 +162,129 @@ struct vnodeopv_desc afs_vnodeop_opv_desc = name[cnp->cn_namelen] = '\0' #define DROPNAME() FREE(name, M_TEMP) - +/* This is a bit of a cheat... */ +#ifdef AFS_FBSD50_ENV +#define a_p a_td +#endif + +/* + * Mosty copied from sys/ufs/ufs/ufs_vnops.c:ufs_pathconf(). + * We should know the correct answers to these questions with + * respect to the AFS protocol (which may differ from the UFS + * values) but for the moment this will do. + */ +static int +afs_vop_pathconf(struct vop_pathconf_args *ap) +{ + int error; + + error = 0; + switch (ap->a_name) { + case _PC_LINK_MAX: + *ap->a_retval = LINK_MAX; + break; + case _PC_NAME_MAX: + *ap->a_retval = NAME_MAX; + break; + case _PC_PATH_MAX: + *ap->a_retval = PATH_MAX; + break; + case _PC_PIPE_BUF: + *ap->a_retval = PIPE_BUF; + break; + case _PC_CHOWN_RESTRICTED: + *ap->a_retval = 1; + break; + case _PC_NO_TRUNC: + *ap->a_retval = 1; + break; +#ifdef _PC_ACL_EXTENDED + case _PC_ACL_EXTENDED: + *ap->a_retval = 0; + break; + case _PC_ACL_PATH_MAX: + *ap->a_retval = 3; + break; +#endif +#ifdef _PC_MAC_PRESENT + case _PC_MAC_PRESENT: + *ap->a_retval = 0; + break; +#endif +#ifdef _PC_ASYNC_IO + case _PC_ASYNC_IO: + /* _PC_ASYNC_IO should have been handled by upper layers. */ + KASSERT(0, ("_PC_ASYNC_IO should not get here")); + error = EINVAL; + break; + case _PC_PRIO_IO: + *ap->a_retval = 0; + break; + case _PC_SYNC_IO: + *ap->a_retval = 0; + break; +#endif +#ifdef _PC_ALLOC_SIZE_MIN + case _PC_ALLOC_SIZE_MIN: + *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_bsize; + break; +#endif +#ifdef _PC_FILESIZEBITS + case _PC_FILESIZEBITS: + *ap->a_retval = 32; /* XXX */ + break; +#endif +#ifdef _PC_REC_INCR_XFER_SIZE + case _PC_REC_INCR_XFER_SIZE: + *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; + break; + case _PC_REC_MAX_XFER_SIZE: + *ap->a_retval = -1; /* means ``unlimited'' */ + break; + case _PC_REC_MIN_XFER_SIZE: + *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; + break; + case _PC_REC_XFER_ALIGN: + *ap->a_retval = PAGE_SIZE; + break; +#endif +#ifdef _PC_SYMLINK_MAX + case _PC_SYMLINK_MAX: + *ap->a_retval = MAXPATHLEN; + break; +#endif + default: + error = EINVAL; + break; + } + return (error); +} int afs_vop_lookup(ap) -struct vop_lookup_args /* { - struct vnodeop_desc * a_desc; - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - } */ *ap; + struct vop_lookup_args /* { + * struct vnodeop_desc * a_desc; + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * } */ *ap; { int error; struct vcache *vcp; struct vnode *vp, *dvp; register int flags = ap->a_cnp->cn_flags; - int lockparent; /* 1 => lockparent flag is set */ - int wantparent; /* 1 => wantparent or lockparent flag */ - struct proc *p; + int lockparent; /* 1 => lockparent flag is set */ + int wantparent; /* 1 => wantparent or lockparent flag */ +#ifdef AFS_FBSD50_ENV + struct thread *p = ap->a_cnp->cn_thread; +#else + struct proc *p = ap->a_cnp->cn_proc; +#endif GETNAME(); - p=cnp->cn_proc; + lockparent = flags & LOCKPARENT; - wantparent = flags & (LOCKPARENT|WANTPARENT); + wantparent = flags & (LOCKPARENT | WANTPARENT); if (ap->a_dvp->v_type != VDIR) { *ap->a_vpp = 0; @@ -137,16 +292,16 @@ struct vop_lookup_args /* { return ENOTDIR; } dvp = ap->a_dvp; - if (flags & ISDOTDOT) - VOP_UNLOCK(dvp, 0, p); + if (flags & ISDOTDOT) + VOP_UNLOCK(dvp, 0, p); AFS_GLOCK(); error = afs_lookup(VTOAFS(dvp), name, &vcp, cnp->cn_cred); AFS_GUNLOCK(); if (error) { - if (flags & ISDOTDOT) - VOP_LOCK(dvp, LK_EXCLUSIVE | LK_RETRY, p); - if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME) && - (flags & ISLASTCN) && error == ENOENT) + if (flags & ISDOTDOT) + VOP_LOCK(dvp, LK_EXCLUSIVE | LK_RETRY, p); + if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME) + && (flags & ISLASTCN) && error == ENOENT) error = EJUSTRETURN; if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) cnp->cn_flags |= SAVENAME; @@ -154,34 +309,34 @@ struct vop_lookup_args /* { *ap->a_vpp = 0; return (error); } - vp = AFSTOV(vcp); /* always get a node if no error */ + vp = AFSTOV(vcp); /* always get a node if no error */ /* The parent directory comes in locked. We unlock it on return - unless the caller wants it left locked. - we also always return the vnode locked. */ + * unless the caller wants it left locked. + * we also always return the vnode locked. */ if (flags & ISDOTDOT) { vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); - /* always return the child locked */ - if (lockparent && (flags & ISLASTCN) && - (error = vn_lock(dvp, LK_EXCLUSIVE, p))) { - vput(vp); - DROPNAME(); - return (error); - } + /* always return the child locked */ + if (lockparent && (flags & ISLASTCN) + && (error = vn_lock(dvp, LK_EXCLUSIVE, p))) { + vput(vp); + DROPNAME(); + return (error); + } } else if (vp == dvp) { /* they're the same; afs_lookup() already ref'ed the leaf. - It came in locked, so we don't need to ref OR lock it */ + * It came in locked, so we don't need to ref OR lock it */ } else { if (!lockparent || !(flags & ISLASTCN)) - VOP_UNLOCK(dvp, 0, p); /* done with parent. */ + VOP_UNLOCK(dvp, 0, p); /* done with parent. */ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); - /* always return the child locked */ + /* always return the child locked */ } *ap->a_vpp = vp; - if ((cnp->cn_nameiop == RENAME && wantparent && (flags & ISLASTCN)) || - (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN))) + if ((cnp->cn_nameiop == RENAME && wantparent && (flags & ISLASTCN)) + || (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN))) cnp->cn_flags |= SAVENAME; DROPNAME(); @@ -190,35 +345,39 @@ struct vop_lookup_args /* { int afs_vop_create(ap) - struct vop_create_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; + struct vop_create_args /* { + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * struct vattr *a_vap; + * } */ *ap; { int error = 0; struct vcache *vcp; register struct vnode *dvp = ap->a_dvp; - struct proc *p; +#ifdef AFS_FBSD50_ENV + struct thread *p = ap->a_cnp->cn_thread; +#else + struct proc *p = ap->a_cnp->cn_proc; +#endif GETNAME(); - p=cnp->cn_proc; AFS_GLOCK(); - error = afs_create(VTOAFS(dvp), name, ap->a_vap, ap->a_vap->va_vaflags & VA_EXCLUSIVE? EXCL : NONEXCL, - ap->a_vap->va_mode, &vcp, - cnp->cn_cred); + error = + afs_create(VTOAFS(dvp), name, ap->a_vap, + ap->a_vap->va_vaflags & VA_EXCLUSIVE ? EXCL : NONEXCL, + ap->a_vap->va_mode, &vcp, cnp->cn_cred); AFS_GUNLOCK(); if (error) { DROPNAME(); - return(error); + return (error); } if (vcp) { *ap->a_vpp = AFSTOV(vcp); - vn_lock(AFSTOV(vcp), LK_EXCLUSIVE| LK_RETRY, p); - } - else *ap->a_vpp = 0; + vn_lock(AFSTOV(vcp), LK_EXCLUSIVE | LK_RETRY, p); + } else + *ap->a_vpp = 0; DROPNAME(); return error; @@ -226,49 +385,50 @@ afs_vop_create(ap) int afs_vop_mknod(ap) - struct vop_mknod_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; + struct vop_mknod_args /* { + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * struct vattr *a_vap; + * } */ *ap; { - return(ENODEV); + return (ENODEV); } #if 0 -static int validate_vops(struct vnode *vp, int after) +static int +validate_vops(struct vnode *vp, int after) { - int ret=0; - struct vnodeopv_entry_desc *this; - for (this=afs_vnodeop_entries; this->opve_op; this++) { + int ret = 0; + struct vnodeopv_entry_desc *this; + for (this = afs_vnodeop_entries; this->opve_op; this++) { if (vp->v_op[this->opve_op->vdesc_offset] != this->opve_impl) { - if (!ret) { - printf("v_op %d ", after); - vprint("check", vp); - } - ret=1; - printf("For oper %d (%s), func is %p, not %p", - this->opve_op->vdesc_offset, this->opve_op->vdesc_name, - vp->v_op[this->opve_op->vdesc_offset], this->opve_impl); - } - } - return ret; -} + if (!ret) { + printf("v_op %d ", after); + vprint("check", vp); + } + ret = 1; + printf("For oper %d (%s), func is %p, not %p", + this->opve_op->vdesc_offset, this->opve_op->vdesc_name, + vp->v_op[this->opve_op->vdesc_offset], this->opve_impl); + } + } + return ret; +} #endif int afs_vop_open(ap) - struct vop_open_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_open_args /* { + * struct vnode *a_vp; + * int a_mode; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { int error; int bad; struct vcache *vc = VTOAFS(ap->a_vp); - bad=0; + bad = 0; AFS_GLOCK(); error = afs_open(&vc, ap->a_mode, ap->a_cred); #ifdef DIAGNOSTIC @@ -276,7 +436,7 @@ afs_vop_open(ap) panic("AFS open changed vnode!"); #endif afs_BozonLock(&vc->pvnLock, vc); - osi_FlushPages(vc); + osi_FlushPages(vc, ap->a_cred); afs_BozonUnlock(&vc->pvnLock, vc); AFS_GUNLOCK(); return error; @@ -284,22 +444,22 @@ afs_vop_open(ap) int afs_vop_close(ap) - struct vop_close_args /* { - struct vnode *a_vp; - int a_fflag; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_close_args /* { + * struct vnode *a_vp; + * int a_fflag; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { int code; - struct vcache *avc=ap->a_vp; + struct vcache *avc = VTOAFS(ap->a_vp); AFS_GLOCK(); - if (ap->a_cred) - code=afs_close(avc, ap->a_fflag, ap->a_cred, ap->a_p); + if (ap->a_cred) + code = afs_close(avc, ap->a_fflag, ap->a_cred); else - code=afs_close(avc, ap->a_fflag, &afs_osi_cred, ap->a_p); + code = afs_close(avc, ap->a_fflag, afs_osi_credp); afs_BozonLock(&avc->pvnLock, avc); - osi_FlushPages(avc); /* hold bozon lock, but not basic vnode lock */ + osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); return code; @@ -307,77 +467,83 @@ afs_vop_close(ap) int afs_vop_access(ap) - struct vop_access_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_access_args /* { + * struct vnode *a_vp; + * int a_mode; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { int code; AFS_GLOCK(); - code=afs_access(VTOAFS(ap->a_vp), ap->a_mode, ap->a_cred); + code = afs_access(VTOAFS(ap->a_vp), ap->a_mode, ap->a_cred); AFS_GUNLOCK(); return code; } + int afs_vop_getattr(ap) - struct vop_getattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_getattr_args /* { + * struct vnode *a_vp; + * struct vattr *a_vap; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { int code; AFS_GLOCK(); - code=afs_getattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred); + code = afs_getattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred); AFS_GUNLOCK(); return code; } + int afs_vop_setattr(ap) - struct vop_setattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_setattr_args /* { + * struct vnode *a_vp; + * struct vattr *a_vap; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { int code; AFS_GLOCK(); - code=afs_setattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred); + code = afs_setattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred); AFS_GUNLOCK(); return code; -}int +} + +int afs_vop_read(ap) - struct vop_read_args /* { - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; - -} */ *ap; + struct vop_read_args /* { + * struct vnode *a_vp; + * struct uio *a_uio; + * int a_ioflag; + * struct ucred *a_cred; + * + * } */ *ap; { int code; - struct vcache *avc=VTOAFS(ap->a_vp); + struct vcache *avc = VTOAFS(ap->a_vp); AFS_GLOCK(); afs_BozonLock(&avc->pvnLock, avc); - osi_FlushPages(avc); /* hold bozon lock, but not basic vnode lock */ - code=afs_read(avc, ap->a_uio, ap->a_cred, 0, 0, 0); + osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ + code = afs_read(avc, ap->a_uio, ap->a_cred, 0, 0, 0); afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); return code; } + +/* struct vop_getpages_args { + * struct vnode *a_vp; + * vm_page_t *a_m; + * int a_count; + * int a_reqpage; + * vm_oofset_t a_offset; + * }; + */ int -afs_vop_getpages(ap) - struct vop_getpages_args /* { - struct vnode *a_vp; - vm_page_t *a_m; - int a_count; - int a_reqpage; - vm_oofset_t a_offset; - } */ *ap; +afs_vop_getpages(struct vop_getpages_args *ap) { int code; int i, nextoff, size, toff, npages; @@ -385,13 +551,20 @@ afs_vop_getpages(ap) struct iovec iov; struct buf *bp; vm_offset_t kva; - struct vcache *avc=VTOAFS(ap->a_vp); + vm_object_t object; + struct vnode *vp; + struct vcache *avc; - if (avc->v.v_object == NULL) { - printf("afs_getpages: called with non-merged cache vnode??\n"); - return VM_PAGER_ERROR; +#ifdef AFS_FBSD50_ENV + GIANT_REQUIRED; +#endif + vp = ap->a_vp; + avc = VTOAFS(vp); + if ((object = vp->v_object) == NULL) { + printf("afs_getpages: called with non-merged cache vnode??\n"); + return VM_PAGER_ERROR; } - npages=btoc(ap->a_count); + npages = btoc(ap->a_count); /* * If the requested page is partially valid, just return it and * allow the pager to zero-out the blanks. Partially valid pages @@ -399,127 +572,175 @@ afs_vop_getpages(ap) */ { - vm_page_t m = ap->a_m[ap->a_reqpage]; - - if (m->valid != 0) { - /* handled by vm_fault now */ - /* vm_page_zero_invalid(m, TRUE); */ - for (i = 0; i < npages; ++i) { - if (i != ap->a_reqpage) - vnode_pager_freepage(ap->a_m[i]); - } - return(0); - } + vm_page_t m = ap->a_m[ap->a_reqpage]; + +#ifdef AFS_FBSD50_ENV + VM_OBJECT_LOCK(object); + vm_page_lock_queues(); +#endif + if (m->valid != 0) { + /* handled by vm_fault now */ + /* vm_page_zero_invalid(m, TRUE); */ + for (i = 0; i < npages; ++i) { + if (i != ap->a_reqpage) + vm_page_free(ap->a_m[i]); + } +#ifdef AFS_FBSD50_ENV + vm_page_unlock_queues(); + VM_OBJECT_UNLOCK(object); +#endif + return (0); + } +#ifdef AFS_FBSD50_ENV + vm_page_unlock_queues(); + VM_OBJECT_UNLOCK(object); +#endif } bp = getpbuf(&afs_pbuf_freecnt); + kva = (vm_offset_t) bp->b_data; pmap_qenter(kva, ap->a_m, npages); - iov.iov_base=(caddr_t)kva; - iov.iov_len=ap->a_count; - uio.uio_iov=&iov; - uio.uio_iovcnt=1; - uio.uio_offset=IDX_TO_OFF(ap->a_m[0]->pindex); - uio.uio_resid=ap->a_count; - uio.uio_segflg=UIO_SYSSPACE; - uio.uio_rw=UIO_READ; - uio.uio_procp=curproc; +#ifdef AFS_FBSD50_ENV + cnt.v_vnodein++; + cnt.v_vnodepgsin += npages; +#endif + + iov.iov_base = (caddr_t) kva; + iov.iov_len = ap->a_count; + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + uio.uio_offset = IDX_TO_OFF(ap->a_m[0]->pindex); + uio.uio_resid = ap->a_count; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = UIO_READ; +#ifdef AFS_FBSD50_ENV + uio.uio_td = curthread; +#else + uio.uio_procp = curproc; +#endif + AFS_GLOCK(); afs_BozonLock(&avc->pvnLock, avc); - osi_FlushPages(avc); /* hold bozon lock, but not basic vnode lock */ - code=afs_read(avc, &uio, curproc->p_cred->pc_ucred, 0, 0, 0); + osi_FlushPages(avc, osi_curcred()); /* hold bozon lock, but not basic vnode lock */ + code = afs_read(avc, &uio, osi_curcred(), 0, 0, 0); afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); pmap_qremove(kva, npages); relpbuf(bp, &afs_pbuf_freecnt); + if (code && (uio.uio_resid == ap->a_count)) { - for (i = 0; i < npages; ++i) { - if (i != ap->a_reqpage) - vnode_pager_freepage(ap->a_m[i]); - } - return VM_PAGER_ERROR; +#ifdef AFS_FBSD50_ENV + VM_OBJECT_LOCK(object); + vm_page_lock_queues(); +#endif + for (i = 0; i < npages; ++i) { + if (i != ap->a_reqpage) + vm_page_free(ap->a_m[i]); + } +#ifdef AFS_FBSD50_ENV + vm_page_unlock_queues(); + VM_OBJECT_UNLOCK(object); +#endif + return VM_PAGER_ERROR; } + size = ap->a_count - uio.uio_resid; +#ifdef AFS_FBSD50_ENV + VM_OBJECT_LOCK(object); + vm_page_lock_queues(); +#endif for (i = 0, toff = 0; i < npages; i++, toff = nextoff) { - vm_page_t m; - nextoff = toff + PAGE_SIZE; - m = ap->a_m[i]; - - m->flags &= ~PG_ZERO; - - if (nextoff <= size) { - /* - * Read operation filled an entire page - */ - m->valid = VM_PAGE_BITS_ALL; - vm_page_undirty(m); - } else if (size > toff) { - /* - * Read operation filled a partial page. - */ - m->valid = 0; - vm_page_set_validclean(m, 0, size - toff); - /* handled by vm_fault now */ - /* vm_page_zero_invalid(m, TRUE); */ - } - - if (i != ap->a_reqpage) { - /* - * Whether or not to leave the page activated is up in - * the air, but we should put the page on a page queue - * somewhere (it already is in the object). Result: - * It appears that emperical results show that - * deactivating pages is best. - */ - - /* - * Just in case someone was asking for this page we - * now tell them that it is ok to use. - */ - if (!code) { - if (m->flags & PG_WANTED) - vm_page_activate(m); - else - vm_page_deactivate(m); - vm_page_wakeup(m); - } else { - vnode_pager_freepage(m); - } - } + vm_page_t m; + nextoff = toff + PAGE_SIZE; + m = ap->a_m[i]; + + m->flags &= ~PG_ZERO; + + if (nextoff <= size) { + /* + * Read operation filled an entire page + */ + m->valid = VM_PAGE_BITS_ALL; + vm_page_undirty(m); + } else if (size > toff) { + /* + * Read operation filled a partial page. + */ + m->valid = 0; + vm_page_set_validclean(m, 0, size - toff); + /* handled by vm_fault now */ + /* vm_page_zero_invalid(m, TRUE); */ + } + + if (i != ap->a_reqpage) { + /* + * Whether or not to leave the page activated is up in + * the air, but we should put the page on a page queue + * somewhere (it already is in the object). Result: + * It appears that emperical results show that + * deactivating pages is best. + */ + + /* + * Just in case someone was asking for this page we + * now tell them that it is ok to use. + */ + if (!code) { + if (m->flags & PG_WANTED) + vm_page_activate(m); + else + vm_page_deactivate(m); + vm_page_wakeup(m); + } else { + vm_page_free(m); + } + } } +#ifdef AFS_FBSD50_ENV + vm_page_unlock_queues(); + VM_OBJECT_UNLOCK(object); +#endif return 0; } - + int afs_vop_write(ap) - struct vop_write_args /* { - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; - } */ *ap; + struct vop_write_args /* { + * struct vnode *a_vp; + * struct uio *a_uio; + * int a_ioflag; + * struct ucred *a_cred; + * } */ *ap; { int code; - struct vcache *avc=VTOAFS(ap->a_vp); + struct vcache *avc = VTOAFS(ap->a_vp); AFS_GLOCK(); afs_BozonLock(&avc->pvnLock, avc); - osi_FlushPages(avc); /* hold bozon lock, but not basic vnode lock */ - code=afs_write(VTOAFS(ap->a_vp), ap->a_uio, ap->a_ioflag, ap->a_cred, 0); + osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */ + code = + afs_write(VTOAFS(ap->a_vp), ap->a_uio, ap->a_ioflag, ap->a_cred, 0); afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); return code; } +/*- + * struct vop_putpages_args { + * struct vnode *a_vp; + * vm_page_t *a_m; + * int a_count; + * int a_sync; + * int *a_rtvals; + * vm_oofset_t a_offset; + * }; + */ +/* + * All of the pages passed to us in ap->a_m[] are already marked as busy, + * so there is no additional locking required to set their flags. -GAW + */ int -afs_vop_putpages(ap) - struct vop_putpages_args /* { - struct vnode *a_vp; - vm_page_t *a_m; - int a_count; - int a_sync; - int *a_rtvals; - vm_oofset_t a_offset; - } */ *ap; +afs_vop_putpages(struct vop_putpages_args *ap) { int code; int i, size, npages, sync; @@ -527,100 +748,120 @@ afs_vop_putpages(ap) struct iovec iov; struct buf *bp; vm_offset_t kva; - struct vcache *avc=VTOAFS(ap->a_vp); + struct vnode *vp; + struct vcache *avc; - if (avc->v.v_object == NULL) { - printf("afs_putpages: called with non-merged cache vnode??\n"); - return VM_PAGER_ERROR; +#ifdef AFS_FBSD50_ENV + GIANT_REQUIRED; +#endif + + vp = ap->a_vp; + avc = VTOAFS(vp); + /* Perhaps these two checks should just be KASSERTs instead... */ + if (vp->v_object == NULL) { + printf("afs_putpages: called with non-merged cache vnode??\n"); + return VM_PAGER_ERROR; /* XXX I think this is insufficient */ } if (vType(avc) != VREG) { - printf("afs_putpages: not VREG"); - return VM_PAGER_ERROR; + printf("afs_putpages: not VREG"); + return VM_PAGER_ERROR; /* XXX I think this is insufficient */ } - npages=btoc(ap->a_count); - for (i=0; i < npages; i++ ) ap->a_rtvals[i]=VM_PAGER_AGAIN; + npages = btoc(ap->a_count); + for (i = 0; i < npages; i++) + ap->a_rtvals[i] = VM_PAGER_AGAIN; bp = getpbuf(&afs_pbuf_freecnt); + kva = (vm_offset_t) bp->b_data; pmap_qenter(kva, ap->a_m, npages); - iov.iov_base=(caddr_t)kva; - iov.iov_len=ap->a_count; - uio.uio_iov=&iov; - uio.uio_iovcnt=1; - uio.uio_offset=IDX_TO_OFF(ap->a_m[0]->pindex); - uio.uio_resid=ap->a_count; - uio.uio_segflg=UIO_SYSSPACE; - uio.uio_rw=UIO_WRITE; - uio.uio_procp=curproc; - sync=IO_VMIO; +#ifdef AFS_FBSD50_ENV + cnt.v_vnodeout++; + cnt.v_vnodepgsout += ap->a_count; +#endif + + iov.iov_base = (caddr_t) kva; + iov.iov_len = ap->a_count; + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + uio.uio_offset = IDX_TO_OFF(ap->a_m[0]->pindex); + uio.uio_resid = ap->a_count; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = UIO_WRITE; +#ifdef AFS_FBSD50_ENV + uio.uio_td = curthread; +#else + uio.uio_procp = curproc; +#endif + sync = IO_VMIO; if (ap->a_sync & VM_PAGER_PUT_SYNC) - sync|=IO_SYNC; + sync |= IO_SYNC; /*if (ap->a_sync & VM_PAGER_PUT_INVAL) - sync|=IO_INVAL;*/ + * sync |= IO_INVAL; */ AFS_GLOCK(); afs_BozonLock(&avc->pvnLock, avc); - code=afs_write(avc, &uio, sync, curproc->p_cred->pc_ucred, 0); + code = afs_write(avc, &uio, sync, osi_curcred(), 0); afs_BozonUnlock(&avc->pvnLock, avc); AFS_GUNLOCK(); - pmap_qremove(kva, npages); + pmap_qremove(kva, npages); relpbuf(bp, &afs_pbuf_freecnt); + if (!code) { - size = ap->a_count - uio.uio_resid; - for (i = 0; i < round_page(size) / PAGE_SIZE; i++) { - ap->a_rtvals[i]=VM_PAGER_OK; - ap->a_m[i]->dirty=0; - } - return VM_PAGER_ERROR; + size = ap->a_count - uio.uio_resid; + for (i = 0; i < round_page(size) / PAGE_SIZE; i++) { + ap->a_rtvals[i] = VM_PAGER_OK; + vm_page_undirty(ap->a_m[i]); + } } return ap->a_rtvals[0]; } + int afs_vop_ioctl(ap) - struct vop_ioctl_args /* { - struct vnode *a_vp; - int a_command; - caddr_t a_data; - int a_fflag; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_ioctl_args /* { + * struct vnode *a_vp; + * int a_command; + * caddr_t a_data; + * int a_fflag; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { struct vcache *tvc = VTOAFS(ap->a_vp); - struct afs_ioctl data; int error = 0; - + /* in case we ever get in here... */ AFS_STATCNT(afs_ioctl); if (((ap->a_command >> 8) & 0xff) == 'V') { /* This is a VICEIOCTL call */ - AFS_GLOCK(); - error = HandleIoctl(tvc, (struct file *)0/*Not used*/, - ap->a_command, ap->a_data); - AFS_GUNLOCK(); - return(error); + AFS_GLOCK(); + error = HandleIoctl(tvc, NULL /*Not used */ , + ap->a_command, ap->a_data); + AFS_GUNLOCK(); + return (error); } else { /* No-op call; just return. */ - return(ENOTTY); + return (ENOTTY); } } /* ARGSUSED */ int afs_vop_poll(ap) - struct vop_poll_args /* { - struct vnode *a_vp; - int a_events; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_poll_args /* { + * struct vnode *a_vp; + * int a_events; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { - /* - * We should really check to see if I/O is possible. - */ - return (1); + /* + * We should really check to see if I/O is possible. + */ + return (1); } + /* * Mmap a file * @@ -629,46 +870,45 @@ afs_vop_poll(ap) /* ARGSUSED */ int afs_vop_mmap(ap) - struct vop_mmap_args /* { - struct vnode *a_vp; - int a_fflags; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; + struct vop_mmap_args /* { + * struct vnode *a_vp; + * int a_fflags; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap; { - return (EINVAL); + return (EINVAL); } int afs_vop_fsync(ap) - struct vop_fsync_args /* { - struct vnode *a_vp; - struct ucred *a_cred; - int a_waitfor; - struct proc *a_p; - } */ *ap; + struct vop_fsync_args /* { + * struct vnode *a_vp; + * struct ucred *a_cred; + * int a_waitfor; + * struct proc *a_p; + * } */ *ap; { - int wait = ap->a_waitfor == MNT_WAIT; int error; register struct vnode *vp = ap->a_vp; AFS_GLOCK(); - /*vflushbuf(vp, wait);*/ + /*vflushbuf(vp, wait); */ if (ap->a_cred) - error=afs_fsync(VTOAFS(vp), ap->a_cred); + error = afs_fsync(VTOAFS(vp), ap->a_cred); else - error=afs_fsync(VTOAFS(vp), &afs_osi_cred); + error = afs_fsync(VTOAFS(vp), afs_osi_credp); AFS_GUNLOCK(); return error; } int afs_vop_remove(ap) - struct vop_remove_args /* { - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; + struct vop_remove_args /* { + * struct vnode *a_dvp; + * struct vnode *a_vp; + * struct componentname *a_cnp; + * } */ *ap; { int error = 0; register struct vnode *vp = ap->a_vp; @@ -676,7 +916,7 @@ afs_vop_remove(ap) GETNAME(); AFS_GLOCK(); - error = afs_remove(VTOAFS(dvp), name, cnp->cn_cred); + error = afs_remove(VTOAFS(dvp), name, cnp->cn_cred); AFS_GUNLOCK(); cache_purge(vp); DROPNAME(); @@ -685,19 +925,22 @@ afs_vop_remove(ap) int afs_vop_link(ap) - struct vop_link_args /* { - struct vnode *a_vp; - struct vnode *a_tdvp; - struct componentname *a_cnp; - } */ *ap; + struct vop_link_args /* { + * struct vnode *a_vp; + * struct vnode *a_tdvp; + * struct componentname *a_cnp; + * } */ *ap; { int error = 0; register struct vnode *dvp = ap->a_tdvp; register struct vnode *vp = ap->a_vp; - struct proc *p; +#ifdef AFS_FBSD50_ENV + struct thread *p = ap->a_cnp->cn_thread; +#else + struct proc *p = ap->a_cnp->cn_proc; +#endif GETNAME(); - p=cnp->cn_proc; if (dvp->v_mount != vp->v_mount) { error = EXDEV; goto out; @@ -706,29 +949,29 @@ afs_vop_link(ap) error = EISDIR; goto out; } - if (error = vn_lock(vp, LK_EXCLUSIVE, p)) { + if ((error = vn_lock(vp, LK_EXCLUSIVE, p)) != 0) { goto out; } AFS_GLOCK(); error = afs_link(VTOAFS(vp), VTOAFS(dvp), name, cnp->cn_cred); AFS_GUNLOCK(); if (dvp != vp) - VOP_UNLOCK(vp,0, p); -out: + VOP_UNLOCK(vp, 0, p); + out: DROPNAME(); return error; } int afs_vop_rename(ap) - struct vop_rename_args /* { - struct vnode *a_fdvp; - struct vnode *a_fvp; - struct componentname *a_fcnp; - struct vnode *a_tdvp; - struct vnode *a_tvp; - struct componentname *a_tcnp; - } */ *ap; + struct vop_rename_args /* { + * struct vnode *a_fdvp; + * struct vnode *a_fvp; + * struct componentname *a_fcnp; + * struct vnode *a_tdvp; + * struct vnode *a_tvp; + * struct componentname *a_tcnp; + * } */ *ap; { int error = 0; struct componentname *fcnp = ap->a_fcnp; @@ -739,15 +982,19 @@ afs_vop_rename(ap) register struct vnode *tdvp = ap->a_tdvp; struct vnode *fvp = ap->a_fvp; register struct vnode *fdvp = ap->a_fdvp; - struct proc *p=fcnp->cn_proc; +#ifdef AFS_FBSD50_ENV + struct thread *p = fcnp->cn_thread; +#else + struct proc *p = fcnp->cn_proc; +#endif /* * Check for cross-device rename. */ - if ((fvp->v_mount != tdvp->v_mount) || - (tvp && (fvp->v_mount != tvp->v_mount))) { + if ((fvp->v_mount != tdvp->v_mount) + || (tvp && (fvp->v_mount != tvp->v_mount))) { error = EXDEV; -abortit: + abortit: if (tdvp == tvp) vrele(tdvp); else @@ -762,7 +1009,7 @@ abortit: * if fvp == tvp, we're just removing one name of a pair of * directory entries for the same element. convert call into rename. ( (pinched from FreeBSD 4.4's ufs_rename()) - + */ if (fvp == tvp) { if (fvp->v_type == VDIR) { @@ -782,36 +1029,37 @@ abortit: if ((fcnp->cn_flags & SAVESTART) == 0) panic("afs_rename: lost from startdir"); fcnp->cn_nameiop = DELETE; - VREF(fdvp); - error=relookup(fdvp, &fvp, fcnp); - if (error == 0) - vrele(fdvp); - if (fvp == NULL) { - return (ENOENT); - } - - error=VOP_REMOVE(fdvp, fvp, fcnp); - if (fdvp == fvp) - vrele(fdvp); - else - vput(fdvp); - vput(fvp); - return (error); + VREF(fdvp); + error = relookup(fdvp, &fvp, fcnp); + if (error == 0) + vrele(fdvp); + if (fvp == NULL) { + return (ENOENT); + } + + error = VOP_REMOVE(fdvp, fvp, fcnp); + if (fdvp == fvp) + vrele(fdvp); + else + vput(fdvp); + vput(fvp); + return (error); } - if (error = vn_lock(fvp, LK_EXCLUSIVE, p)) + if ((error = vn_lock(fvp, LK_EXCLUSIVE, p)) != 0) goto abortit; - MALLOC(fname, char *, fcnp->cn_namelen+1, M_TEMP, M_WAITOK); + MALLOC(fname, char *, fcnp->cn_namelen + 1, M_TEMP, M_WAITOK); memcpy(fname, fcnp->cn_nameptr, fcnp->cn_namelen); fname[fcnp->cn_namelen] = '\0'; - MALLOC(tname, char *, tcnp->cn_namelen+1, M_TEMP, M_WAITOK); + MALLOC(tname, char *, tcnp->cn_namelen + 1, M_TEMP, M_WAITOK); memcpy(tname, tcnp->cn_nameptr, tcnp->cn_namelen); tname[tcnp->cn_namelen] = '\0'; AFS_GLOCK(); /* XXX use "from" or "to" creds? NFS uses "to" creds */ - error = afs_rename(VTOAFS(fdvp), fname, VTOAFS(tdvp), tname, tcnp->cn_cred); + error = + afs_rename(VTOAFS(fdvp), fname, VTOAFS(tdvp), tname, tcnp->cn_cred); AFS_GUNLOCK(); FREE(fname, M_TEMP); @@ -829,21 +1077,24 @@ abortit: int afs_vop_mkdir(ap) - struct vop_mkdir_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; + struct vop_mkdir_args /* { + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * struct vattr *a_vap; + * } */ *ap; { register struct vnode *dvp = ap->a_dvp; register struct vattr *vap = ap->a_vap; int error = 0; struct vcache *vcp; - struct proc *p; +#ifdef AFS_FBSD50_ENV + struct thread *p = ap->a_cnp->cn_thread; +#else + struct proc *p = ap->a_cnp->cn_proc; +#endif GETNAME(); - p=cnp->cn_proc; #ifdef DIAGNOSTIC if ((cnp->cn_flags & HASBUF) == 0) panic("afs_vop_mkdir: no name"); @@ -852,13 +1103,12 @@ afs_vop_mkdir(ap) error = afs_mkdir(VTOAFS(dvp), name, vap, &vcp, cnp->cn_cred); AFS_GUNLOCK(); if (error) { - vput(dvp); DROPNAME(); - return(error); + return (error); } if (vcp) { *ap->a_vpp = AFSTOV(vcp); - vn_lock(AFSTOV(vcp), LK_EXCLUSIVE|LK_RETRY, p); + vn_lock(AFSTOV(vcp), LK_EXCLUSIVE | LK_RETRY, p); } else *ap->a_vpp = 0; DROPNAME(); @@ -867,14 +1117,13 @@ afs_vop_mkdir(ap) int afs_vop_rmdir(ap) - struct vop_rmdir_args /* { - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; + struct vop_rmdir_args /* { + * struct vnode *a_dvp; + * struct vnode *a_vp; + * struct componentname *a_cnp; + * } */ *ap; { int error = 0; - register struct vnode *vp = ap->a_vp; register struct vnode *dvp = ap->a_dvp; GETNAME(); @@ -885,48 +1134,66 @@ afs_vop_rmdir(ap) return error; } +/* struct vop_symlink_args { + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * struct vattr *a_vap; + * char *a_target; + * }; + */ int -afs_vop_symlink(ap) - struct vop_symlink_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - char *a_target; - } */ *ap; +afs_vop_symlink(struct vop_symlink_args *ap) { - register struct vnode *dvp = ap->a_dvp; - int error = 0; - /* NFS ignores a_vpp; so do we. */ + struct vnode *dvp; + struct vnode *newvp; + struct vcache *vcp; + int error; GETNAME(); AFS_GLOCK(); - error = afs_symlink(VTOAFS(dvp), name, ap->a_vap, ap->a_target, - cnp->cn_cred); + + dvp = ap->a_dvp; + newvp = NULL; + + error = + afs_symlink(VTOAFS(dvp), name, ap->a_vap, ap->a_target, cnp->cn_cred); + if (error == 0) { + error = afs_lookup(VTOAFS(dvp), name, &vcp, cnp->cn_cred); + if (error == 0) { + newvp = AFSTOV(vcp); +#ifdef AFS_FBSD50_ENV + vn_lock(newvp, LK_EXCLUSIVE | LK_RETRY, cnp->cn_thread); +#else + vn_lock(newvp, LK_EXCLUSIVE | LK_RETRY, cnp->cn_proc); +#endif + } + } AFS_GUNLOCK(); DROPNAME(); + *(ap->a_vpp) = newvp; return error; } int afs_vop_readdir(ap) - struct vop_readdir_args /* { - struct vnode *a_vp; - struct uio *a_uio; - struct ucred *a_cred; - int *a_eofflag; - u_long *a_cookies; - int ncookies; - } */ *ap; + struct vop_readdir_args /* { + * struct vnode *a_vp; + * struct uio *a_uio; + * struct ucred *a_cred; + * int *a_eofflag; + * u_long *a_cookies; + * int ncookies; + * } */ *ap; { int error; off_t off; /* printf("readdir %x cookies %x ncookies %d\n", ap->a_vp, ap->a_cookies, ap->a_ncookies); */ - off=ap->a_uio->uio_offset; + off = ap->a_uio->uio_offset; AFS_GLOCK(); - error= afs_readdir(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred, - ap->a_eofflag); + error = + afs_readdir(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred, ap->a_eofflag); AFS_GUNLOCK(); if (!error && ap->a_ncookies != NULL) { struct uio *uio = ap->a_uio; @@ -939,17 +1206,15 @@ afs_vop_readdir(ap) dp = (const struct dirent *) ((const char *)uio->uio_iov->iov_base - (uio->uio_offset - off)); - dp_end = (const struct dirent *) uio->uio_iov->iov_base; - for (dp_start = dp, ncookies = 0; - dp < dp_end; - dp = (const struct dirent *)((const char *) dp + dp->d_reclen)) + dp_end = (const struct dirent *)uio->uio_iov->iov_base; + for (dp_start = dp, ncookies = 0; dp < dp_end; + dp = (const struct dirent *)((const char *)dp + dp->d_reclen)) ncookies++; - MALLOC(cookies, u_long *, ncookies * sizeof(u_long), - M_TEMP, M_WAITOK); - for (dp = dp_start, cookiep = cookies; - dp < dp_end; - dp = (const struct dirent *)((const char *) dp + dp->d_reclen)) { + MALLOC(cookies, u_long *, ncookies * sizeof(u_long), M_TEMP, + M_WAITOK); + for (dp = dp_start, cookiep = cookies; dp < dp_end; + dp = (const struct dirent *)((const char *)dp + dp->d_reclen)) { off += dp->d_reclen; *cookiep++ = off; } @@ -962,16 +1227,16 @@ afs_vop_readdir(ap) int afs_vop_readlink(ap) - struct vop_readlink_args /* { - struct vnode *a_vp; - struct uio *a_uio; - struct ucred *a_cred; - } */ *ap; + struct vop_readlink_args /* { + * struct vnode *a_vp; + * struct uio *a_uio; + * struct ucred *a_cred; + * } */ *ap; { int error; /* printf("readlink %x\n", ap->a_vp);*/ AFS_GLOCK(); - error= afs_readlink(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred); + error = afs_readlink(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred); AFS_GUNLOCK(); return error; } @@ -980,10 +1245,10 @@ extern int prtactive; int afs_vop_inactive(ap) - struct vop_inactive_args /* { - struct vnode *a_vp; - struct proc *a_p; - } */ *ap; + struct vop_inactive_args /* { + * struct vnode *a_vp; + * struct proc *a_p; + * } */ *ap; { register struct vnode *vp = ap->a_vp; @@ -991,158 +1256,137 @@ afs_vop_inactive(ap) vprint("afs_vop_inactive(): pushing active", vp); AFS_GLOCK(); - afs_InactiveVCache(VTOAFS(vp), 0); /* decrs ref counts */ + afs_InactiveVCache(VTOAFS(vp), 0); /* decrs ref counts */ AFS_GUNLOCK(); VOP_UNLOCK(vp, 0, ap->a_p); return 0; } +/* + * struct vop_reclaim_args { + * struct vnode *a_vp; + * }; + */ int -afs_vop_reclaim(ap) - struct vop_reclaim_args /* { - struct vnode *a_vp; - } */ *ap; -{ - int error; - int sl; - register struct vnode *vp = ap->a_vp; - - cache_purge(vp); /* just in case... */ - -#if 0 - AFS_GLOCK(); - error = afs_FlushVCache(VTOAFS(vp), &sl); /* tosses our stuff from vnode */ - AFS_GUNLOCK(); - ubc_unlink(vp); - if (!error && vp->v_data) - panic("afs_reclaim: vnode not cleaned"); - return error; -#else - if (vp->v_usecount == 2) { - vprint("reclaim count==2", vp); - } else if (vp->v_usecount == 1) { - vprint("reclaim count==1", vp); - } else - vprint("reclaim bad count", vp); - - return 0; -#endif -} - -int -afs_vop_lock(ap) - struct vop_lock_args /* { - struct vnode *a_vp; - } */ *ap; -{ - register struct vnode *vp = ap->a_vp; - register struct vcache *avc = VTOAFS(vp); - - if (vp->v_tag == VT_NON) - return (ENOENT); - return (lockmgr(&avc->rwlock, ap->a_flags, &vp->v_interlock, - ap->a_p)); -} - -int -afs_vop_unlock(ap) - struct vop_unlock_args /* { - struct vnode *a_vp; - } */ *ap; +afs_vop_reclaim(struct vop_reclaim_args *ap) { + /* copied from ../OBSD/osi_vnodeops.c:afs_nbsd_reclaim() */ + int code, slept; struct vnode *vp = ap->a_vp; struct vcache *avc = VTOAFS(vp); - return (lockmgr(&avc->rwlock, ap->a_flags | LK_RELEASE, - &vp->v_interlock, ap->a_p)); + int haveGlock = ISAFS_GLOCK(); + int haveVlock = CheckLock(&afs_xvcache); + + if (!haveGlock) + AFS_GLOCK(); + if (!haveVlock) + ObtainWriteLock(&afs_xvcache, 901); +#ifndef AFS_DISCON_ENV + code = afs_FlushVCache(avc, &slept); /* tosses our stuff from vnode */ +#else + /* reclaim the vnode and the in-memory vcache, but keep the on-disk vcache */ + code = afs_FlushVS(avc); +#endif + if (!haveVlock) + ReleaseWriteLock(&afs_xvcache); + if (!haveGlock) + AFS_GUNLOCK(); + /* + * XXX Pretend it worked, to prevent panic on shutdown + * Garrett, please fix - Jim Rees + */ + if (code) + printf("afs_vop_reclaim: afs_FlushVCache failed code %d\n", code); + return 0; } int afs_vop_bmap(ap) - struct vop_bmap_args /* { - struct vnode *a_vp; - daddr_t a_bn; - struct vnode **a_vpp; - daddr_t *a_bnp; - int *a_runp; - int *a_runb; - } */ *ap; + struct vop_bmap_args /* { + * struct vnode *a_vp; + * daddr_t a_bn; + * struct vnode **a_vpp; + * daddr_t *a_bnp; + * int *a_runp; + * int *a_runb; + * } */ *ap; { - struct vcache *vcp; - int error; if (ap->a_bnp) { *ap->a_bnp = ap->a_bn * (PAGE_SIZE / DEV_BSIZE); } if (ap->a_vpp) { *ap->a_vpp = ap->a_vp; } - if (ap->a_runp != NULL) - *ap->a_runp = 0; - if (ap->a_runb != NULL) - *ap->a_runb = 0; - + if (ap->a_runp != NULL) + *ap->a_runp = 0; + if (ap->a_runb != NULL) + *ap->a_runb = 0; + return 0; } + int afs_vop_strategy(ap) - struct vop_strategy_args /* { - struct buf *a_bp; - } */ *ap; + struct vop_strategy_args /* { + * struct buf *a_bp; + * } */ *ap; { int error; AFS_GLOCK(); - error= afs_ustrategy(ap->a_bp); + error = afs_ustrategy(ap->a_bp); AFS_GUNLOCK(); return error; } + int afs_vop_print(ap) - struct vop_print_args /* { - struct vnode *a_vp; - } */ *ap; + struct vop_print_args /* { + * struct vnode *a_vp; + * } */ *ap; { register struct vnode *vp = ap->a_vp; register struct vcache *vc = VTOAFS(ap->a_vp); int s = vc->states; - printf("tag %d, fid: %ld.%x.%x.%x, opens %d, writers %d", vp->v_tag, vc->fid.Cell, - vc->fid.Fid.Volume, vc->fid.Fid.Vnode, vc->fid.Fid.Unique, vc->opens, + +#ifdef AFS_FBSD50_ENV + printf("tag %s, fid: %d.%x.%x.%x, opens %d, writers %d", vp->v_tag, + (int)vc->fid.Cell, (u_int) vc->fid.Fid.Volume, + (u_int) vc->fid.Fid.Vnode, (u_int) vc->fid.Fid.Unique, vc->opens, vc->execsOrWriters); - printf("\n states%s%s%s%s%s", (s&CStatd) ? " statd" : "", (s&CRO) ? " readonly" : "",(s&CDirty) ? " dirty" : "",(s&CMAPPED) ? " mapped" : "", (s&CVFlushed) ? " flush in progress" : ""); +#else + printf("tag %d, fid: %ld.%x.%x.%x, opens %d, writers %d", vp->v_tag, + vc->fid.Cell, (u_int) vc->fid.Fid.Volume, + (u_int) vc->fid.Fid.Vnode, (u_int) vc->fid.Fid.Unique, vc->opens, + vc->execsOrWriters); +#endif + printf("\n states%s%s%s%s%s", (s & CStatd) ? " statd" : "", + (s & CRO) ? " readonly" : "", (s & CDirty) ? " dirty" : "", + (s & CMAPPED) ? " mapped" : "", + (s & CVFlushed) ? " flush in progress" : ""); printf("\n"); return 0; } -int -afs_vop_islocked(ap) - struct vop_islocked_args /* { - struct vnode *a_vp; - } */ *ap; -{ - struct vcache *vc = VTOAFS(ap->a_vp); - return lockstatus(&vc->rwlock, ap->a_p); -} - /* * Advisory record locking support (fcntl() POSIX style) */ int afs_vop_advlock(ap) - struct vop_advlock_args /* { - struct vnode *a_vp; - caddr_t a_id; - int a_op; - struct flock *a_fl; - int a_flags; - } */ *ap; + struct vop_advlock_args /* { + * struct vnode *a_vp; + * caddr_t a_id; + * int a_op; + * struct flock *a_fl; + * int a_flags; + * } */ *ap; { int error; - struct proc *p=curproc; - struct ucred cr; - cr=*p->p_cred->pc_ucred; + struct ucred cr = *osi_curcred(); + AFS_GLOCK(); - error= afs_lockctl(VTOAFS(ap->a_vp), ap->a_fl, ap->a_op, &cr, - (int) ap->a_id); + error = + afs_lockctl(VTOAFS(ap->a_vp), ap->a_fl, ap->a_op, &cr, (int)ap->a_id); AFS_GUNLOCK(); return error; } - diff --git a/src/afs/FBSD/vnode_if.h b/src/afs/FBSD/vnode_if.h deleted file mode 100644 index ded87a16d..000000000 --- a/src/afs/FBSD/vnode_if.h +++ /dev/null @@ -1,1423 +0,0 @@ -/* - * This file is produced automatically. - * Do not modify anything in here by hand. - * - * Created from @(#)vnode_if.sh 8.1 (Berkeley) 6/10/93 - */ - -extern struct vnodeop_desc vop_default_desc; -struct vop_islocked_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_islocked_desc; -static __inline int VOP_ISLOCKED __P(( - struct vnode *vp, - struct proc *p)); -static __inline int VOP_ISLOCKED(vp, p) - struct vnode *vp; - struct proc *p; -{ - struct vop_islocked_args a; - int rc; - a.a_desc = VDESC(vop_islocked); - a.a_vp = vp; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_islocked), &a); - return (rc); -} -struct vop_lookup_args { - struct vnodeop_desc *a_desc; - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; -}; -extern struct vnodeop_desc vop_lookup_desc; -static __inline int VOP_LOOKUP __P(( - struct vnode *dvp, - struct vnode **vpp, - struct componentname *cnp)); -static __inline int VOP_LOOKUP(dvp, vpp, cnp) - struct vnode *dvp; - struct vnode **vpp; - struct componentname *cnp; -{ - struct vop_lookup_args a; - int rc; - a.a_desc = VDESC(vop_lookup); - a.a_dvp = dvp; - a.a_vpp = vpp; - a.a_cnp = cnp; - rc = VCALL(dvp, VOFFSET(vop_lookup), &a); - return (rc); -} -struct vop_cachedlookup_args { - struct vnodeop_desc *a_desc; - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; -}; -extern struct vnodeop_desc vop_cachedlookup_desc; -static __inline int VOP_CACHEDLOOKUP __P(( - struct vnode *dvp, - struct vnode **vpp, - struct componentname *cnp)); -static __inline int VOP_CACHEDLOOKUP(dvp, vpp, cnp) - struct vnode *dvp; - struct vnode **vpp; - struct componentname *cnp; -{ - struct vop_cachedlookup_args a; - int rc; - a.a_desc = VDESC(vop_cachedlookup); - a.a_dvp = dvp; - a.a_vpp = vpp; - a.a_cnp = cnp; - rc = VCALL(dvp, VOFFSET(vop_cachedlookup), &a); - return (rc); -} -struct vop_create_args { - struct vnodeop_desc *a_desc; - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; -}; -extern struct vnodeop_desc vop_create_desc; -static __inline int VOP_CREATE __P(( - struct vnode *dvp, - struct vnode **vpp, - struct componentname *cnp, - struct vattr *vap)); -static __inline int VOP_CREATE(dvp, vpp, cnp, vap) - struct vnode *dvp; - struct vnode **vpp; - struct componentname *cnp; - struct vattr *vap; -{ - struct vop_create_args a; - int rc; - a.a_desc = VDESC(vop_create); - a.a_dvp = dvp; - a.a_vpp = vpp; - a.a_cnp = cnp; - a.a_vap = vap; - rc = VCALL(dvp, VOFFSET(vop_create), &a); - return (rc); -} -struct vop_whiteout_args { - struct vnodeop_desc *a_desc; - struct vnode *a_dvp; - struct componentname *a_cnp; - int a_flags; -}; -extern struct vnodeop_desc vop_whiteout_desc; -static __inline int VOP_WHITEOUT __P(( - struct vnode *dvp, - struct componentname *cnp, - int flags)); -static __inline int VOP_WHITEOUT(dvp, cnp, flags) - struct vnode *dvp; - struct componentname *cnp; - int flags; -{ - struct vop_whiteout_args a; - int rc; - a.a_desc = VDESC(vop_whiteout); - a.a_dvp = dvp; - a.a_cnp = cnp; - a.a_flags = flags; - rc = VCALL(dvp, VOFFSET(vop_whiteout), &a); - return (rc); -} -struct vop_mknod_args { - struct vnodeop_desc *a_desc; - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; -}; -extern struct vnodeop_desc vop_mknod_desc; -static __inline int VOP_MKNOD __P(( - struct vnode *dvp, - struct vnode **vpp, - struct componentname *cnp, - struct vattr *vap)); -static __inline int VOP_MKNOD(dvp, vpp, cnp, vap) - struct vnode *dvp; - struct vnode **vpp; - struct componentname *cnp; - struct vattr *vap; -{ - struct vop_mknod_args a; - int rc; - a.a_desc = VDESC(vop_mknod); - a.a_dvp = dvp; - a.a_vpp = vpp; - a.a_cnp = cnp; - a.a_vap = vap; - rc = VCALL(dvp, VOFFSET(vop_mknod), &a); - return (rc); -} -struct vop_open_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_open_desc; -static __inline int VOP_OPEN __P(( - struct vnode *vp, - int mode, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_OPEN(vp, mode, cred, p) - struct vnode *vp; - int mode; - struct ucred *cred; - struct proc *p; -{ - struct vop_open_args a; - int rc; - a.a_desc = VDESC(vop_open); - a.a_vp = vp; - a.a_mode = mode; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_open), &a); - return (rc); -} -struct vop_close_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - int a_fflag; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_close_desc; -static __inline int VOP_CLOSE __P(( - struct vnode *vp, - int fflag, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_CLOSE(vp, fflag, cred, p) - struct vnode *vp; - int fflag; - struct ucred *cred; - struct proc *p; -{ - struct vop_close_args a; - int rc; - a.a_desc = VDESC(vop_close); - a.a_vp = vp; - a.a_fflag = fflag; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_close), &a); - return (rc); -} -struct vop_access_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_access_desc; -static __inline int VOP_ACCESS __P(( - struct vnode *vp, - int mode, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_ACCESS(vp, mode, cred, p) - struct vnode *vp; - int mode; - struct ucred *cred; - struct proc *p; -{ - struct vop_access_args a; - int rc; - a.a_desc = VDESC(vop_access); - a.a_vp = vp; - a.a_mode = mode; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_access), &a); - return (rc); -} -struct vop_getattr_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_getattr_desc; -static __inline int VOP_GETATTR __P(( - struct vnode *vp, - struct vattr *vap, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_GETATTR(vp, vap, cred, p) - struct vnode *vp; - struct vattr *vap; - struct ucred *cred; - struct proc *p; -{ - struct vop_getattr_args a; - int rc; - a.a_desc = VDESC(vop_getattr); - a.a_vp = vp; - a.a_vap = vap; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_getattr), &a); - return (rc); -} -struct vop_setattr_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_setattr_desc; -static __inline int VOP_SETATTR __P(( - struct vnode *vp, - struct vattr *vap, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_SETATTR(vp, vap, cred, p) - struct vnode *vp; - struct vattr *vap; - struct ucred *cred; - struct proc *p; -{ - struct vop_setattr_args a; - int rc; - a.a_desc = VDESC(vop_setattr); - a.a_vp = vp; - a.a_vap = vap; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_setattr), &a); - return (rc); -} -struct vop_read_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; -}; -extern struct vnodeop_desc vop_read_desc; -static __inline int VOP_READ __P(( - struct vnode *vp, - struct uio *uio, - int ioflag, - struct ucred *cred)); -static __inline int VOP_READ(vp, uio, ioflag, cred) - struct vnode *vp; - struct uio *uio; - int ioflag; - struct ucred *cred; -{ - struct vop_read_args a; - int rc; - a.a_desc = VDESC(vop_read); - a.a_vp = vp; - a.a_uio = uio; - a.a_ioflag = ioflag; - a.a_cred = cred; - rc = VCALL(vp, VOFFSET(vop_read), &a); - return (rc); -} -struct vop_write_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; -}; -extern struct vnodeop_desc vop_write_desc; -static __inline int VOP_WRITE __P(( - struct vnode *vp, - struct uio *uio, - int ioflag, - struct ucred *cred)); -static __inline int VOP_WRITE(vp, uio, ioflag, cred) - struct vnode *vp; - struct uio *uio; - int ioflag; - struct ucred *cred; -{ - struct vop_write_args a; - int rc; - a.a_desc = VDESC(vop_write); - a.a_vp = vp; - a.a_uio = uio; - a.a_ioflag = ioflag; - a.a_cred = cred; - rc = VCALL(vp, VOFFSET(vop_write), &a); - return (rc); -} -struct vop_lease_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct proc *a_p; - struct ucred *a_cred; - int a_flag; -}; -extern struct vnodeop_desc vop_lease_desc; -static __inline int VOP_LEASE __P(( - struct vnode *vp, - struct proc *p, - struct ucred *cred, - int flag)); -static __inline int VOP_LEASE(vp, p, cred, flag) - struct vnode *vp; - struct proc *p; - struct ucred *cred; - int flag; -{ - struct vop_lease_args a; - int rc; - a.a_desc = VDESC(vop_lease); - a.a_vp = vp; - a.a_p = p; - a.a_cred = cred; - a.a_flag = flag; - rc = VCALL(vp, VOFFSET(vop_lease), &a); - return (rc); -} -struct vop_ioctl_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - u_long a_command; - caddr_t a_data; - int a_fflag; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_ioctl_desc; -static __inline int VOP_IOCTL __P(( - struct vnode *vp, - u_long command, - caddr_t data, - int fflag, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_IOCTL(vp, command, data, fflag, cred, p) - struct vnode *vp; - u_long command; - caddr_t data; - int fflag; - struct ucred *cred; - struct proc *p; -{ - struct vop_ioctl_args a; - int rc; - a.a_desc = VDESC(vop_ioctl); - a.a_vp = vp; - a.a_command = command; - a.a_data = data; - a.a_fflag = fflag; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_ioctl), &a); - return (rc); -} -struct vop_poll_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - int a_events; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_poll_desc; -static __inline int VOP_POLL __P(( - struct vnode *vp, - int events, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_POLL(vp, events, cred, p) - struct vnode *vp; - int events; - struct ucred *cred; - struct proc *p; -{ - struct vop_poll_args a; - int rc; - a.a_desc = VDESC(vop_poll); - a.a_vp = vp; - a.a_events = events; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_poll), &a); - return (rc); -} -struct vop_kqfilter_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct knote *a_kn; -}; -extern struct vnodeop_desc vop_kqfilter_desc; -static __inline int VOP_KQFILTER __P(( - struct vnode *vp, - struct knote *kn)); -static __inline int VOP_KQFILTER(vp, kn) - struct vnode *vp; - struct knote *kn; -{ - struct vop_kqfilter_args a; - int rc; - a.a_desc = VDESC(vop_kqfilter); - a.a_vp = vp; - a.a_kn = kn; - rc = VCALL(vp, VOFFSET(vop_kqfilter), &a); - return (rc); -} -struct vop_revoke_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - int a_flags; -}; -extern struct vnodeop_desc vop_revoke_desc; -static __inline int VOP_REVOKE __P(( - struct vnode *vp, - int flags)); -static __inline int VOP_REVOKE(vp, flags) - struct vnode *vp; - int flags; -{ - struct vop_revoke_args a; - int rc; - a.a_desc = VDESC(vop_revoke); - a.a_vp = vp; - a.a_flags = flags; - rc = VCALL(vp, VOFFSET(vop_revoke), &a); - return (rc); -} -struct vop_mmap_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - int a_fflags; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_mmap_desc; -static __inline int VOP_MMAP __P(( - struct vnode *vp, - int fflags, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_MMAP(vp, fflags, cred, p) - struct vnode *vp; - int fflags; - struct ucred *cred; - struct proc *p; -{ - struct vop_mmap_args a; - int rc; - a.a_desc = VDESC(vop_mmap); - a.a_vp = vp; - a.a_fflags = fflags; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_mmap), &a); - return (rc); -} -struct vop_fsync_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct ucred *a_cred; - int a_waitfor; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_fsync_desc; -static __inline int VOP_FSYNC __P(( - struct vnode *vp, - struct ucred *cred, - int waitfor, - struct proc *p)); -static __inline int VOP_FSYNC(vp, cred, waitfor, p) - struct vnode *vp; - struct ucred *cred; - int waitfor; - struct proc *p; -{ - struct vop_fsync_args a; - int rc; - a.a_desc = VDESC(vop_fsync); - a.a_vp = vp; - a.a_cred = cred; - a.a_waitfor = waitfor; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_fsync), &a); - return (rc); -} -struct vop_remove_args { - struct vnodeop_desc *a_desc; - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; -}; -extern struct vnodeop_desc vop_remove_desc; -static __inline int VOP_REMOVE __P(( - struct vnode *dvp, - struct vnode *vp, - struct componentname *cnp)); -static __inline int VOP_REMOVE(dvp, vp, cnp) - struct vnode *dvp; - struct vnode *vp; - struct componentname *cnp; -{ - struct vop_remove_args a; - int rc; - a.a_desc = VDESC(vop_remove); - a.a_dvp = dvp; - a.a_vp = vp; - a.a_cnp = cnp; - rc = VCALL(dvp, VOFFSET(vop_remove), &a); - return (rc); -} -struct vop_link_args { - struct vnodeop_desc *a_desc; - struct vnode *a_tdvp; - struct vnode *a_vp; - struct componentname *a_cnp; -}; -extern struct vnodeop_desc vop_link_desc; -static __inline int VOP_LINK __P(( - struct vnode *tdvp, - struct vnode *vp, - struct componentname *cnp)); -static __inline int VOP_LINK(tdvp, vp, cnp) - struct vnode *tdvp; - struct vnode *vp; - struct componentname *cnp; -{ - struct vop_link_args a; - int rc; - a.a_desc = VDESC(vop_link); - a.a_tdvp = tdvp; - a.a_vp = vp; - a.a_cnp = cnp; - rc = VCALL(tdvp, VOFFSET(vop_link), &a); - return (rc); -} -struct vop_rename_args { - struct vnodeop_desc *a_desc; - struct vnode *a_fdvp; - struct vnode *a_fvp; - struct componentname *a_fcnp; - struct vnode *a_tdvp; - struct vnode *a_tvp; - struct componentname *a_tcnp; -}; -extern struct vnodeop_desc vop_rename_desc; -static __inline int VOP_RENAME __P(( - struct vnode *fdvp, - struct vnode *fvp, - struct componentname *fcnp, - struct vnode *tdvp, - struct vnode *tvp, - struct componentname *tcnp)); -static __inline int VOP_RENAME(fdvp, fvp, fcnp, tdvp, tvp, tcnp) - struct vnode *fdvp; - struct vnode *fvp; - struct componentname *fcnp; - struct vnode *tdvp; - struct vnode *tvp; - struct componentname *tcnp; -{ - struct vop_rename_args a; - int rc; - a.a_desc = VDESC(vop_rename); - a.a_fdvp = fdvp; - a.a_fvp = fvp; - a.a_fcnp = fcnp; - a.a_tdvp = tdvp; - a.a_tvp = tvp; - a.a_tcnp = tcnp; - rc = VCALL(fdvp, VOFFSET(vop_rename), &a); - return (rc); -} -struct vop_mkdir_args { - struct vnodeop_desc *a_desc; - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; -}; -extern struct vnodeop_desc vop_mkdir_desc; -static __inline int VOP_MKDIR __P(( - struct vnode *dvp, - struct vnode **vpp, - struct componentname *cnp, - struct vattr *vap)); -static __inline int VOP_MKDIR(dvp, vpp, cnp, vap) - struct vnode *dvp; - struct vnode **vpp; - struct componentname *cnp; - struct vattr *vap; -{ - struct vop_mkdir_args a; - int rc; - a.a_desc = VDESC(vop_mkdir); - a.a_dvp = dvp; - a.a_vpp = vpp; - a.a_cnp = cnp; - a.a_vap = vap; - rc = VCALL(dvp, VOFFSET(vop_mkdir), &a); - return (rc); -} -struct vop_rmdir_args { - struct vnodeop_desc *a_desc; - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; -}; -extern struct vnodeop_desc vop_rmdir_desc; -static __inline int VOP_RMDIR __P(( - struct vnode *dvp, - struct vnode *vp, - struct componentname *cnp)); -static __inline int VOP_RMDIR(dvp, vp, cnp) - struct vnode *dvp; - struct vnode *vp; - struct componentname *cnp; -{ - struct vop_rmdir_args a; - int rc; - a.a_desc = VDESC(vop_rmdir); - a.a_dvp = dvp; - a.a_vp = vp; - a.a_cnp = cnp; - rc = VCALL(dvp, VOFFSET(vop_rmdir), &a); - return (rc); -} -struct vop_symlink_args { - struct vnodeop_desc *a_desc; - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - char *a_target; -}; -extern struct vnodeop_desc vop_symlink_desc; -static __inline int VOP_SYMLINK __P(( - struct vnode *dvp, - struct vnode **vpp, - struct componentname *cnp, - struct vattr *vap, - char *target)); -static __inline int VOP_SYMLINK(dvp, vpp, cnp, vap, target) - struct vnode *dvp; - struct vnode **vpp; - struct componentname *cnp; - struct vattr *vap; - char *target; -{ - struct vop_symlink_args a; - int rc; - a.a_desc = VDESC(vop_symlink); - a.a_dvp = dvp; - a.a_vpp = vpp; - a.a_cnp = cnp; - a.a_vap = vap; - a.a_target = target; - rc = VCALL(dvp, VOFFSET(vop_symlink), &a); - return (rc); -} -struct vop_readdir_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct uio *a_uio; - struct ucred *a_cred; - int *a_eofflag; - int *a_ncookies; - u_long **a_cookies; -}; -extern struct vnodeop_desc vop_readdir_desc; -static __inline int VOP_READDIR __P(( - struct vnode *vp, - struct uio *uio, - struct ucred *cred, - int *eofflag, - int *ncookies, - u_long **cookies)); -static __inline int VOP_READDIR(vp, uio, cred, eofflag, ncookies, cookies) - struct vnode *vp; - struct uio *uio; - struct ucred *cred; - int *eofflag; - int *ncookies; - u_long **cookies; -{ - struct vop_readdir_args a; - int rc; - a.a_desc = VDESC(vop_readdir); - a.a_vp = vp; - a.a_uio = uio; - a.a_cred = cred; - a.a_eofflag = eofflag; - a.a_ncookies = ncookies; - a.a_cookies = cookies; - rc = VCALL(vp, VOFFSET(vop_readdir), &a); - return (rc); -} -struct vop_readlink_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct uio *a_uio; - struct ucred *a_cred; -}; -extern struct vnodeop_desc vop_readlink_desc; -static __inline int VOP_READLINK __P(( - struct vnode *vp, - struct uio *uio, - struct ucred *cred)); -static __inline int VOP_READLINK(vp, uio, cred) - struct vnode *vp; - struct uio *uio; - struct ucred *cred; -{ - struct vop_readlink_args a; - int rc; - a.a_desc = VDESC(vop_readlink); - a.a_vp = vp; - a.a_uio = uio; - a.a_cred = cred; - rc = VCALL(vp, VOFFSET(vop_readlink), &a); - return (rc); -} -struct vop_inactive_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_inactive_desc; -static __inline int VOP_INACTIVE __P(( - struct vnode *vp, - struct proc *p)); -static __inline int VOP_INACTIVE(vp, p) - struct vnode *vp; - struct proc *p; -{ - struct vop_inactive_args a; - int rc; - a.a_desc = VDESC(vop_inactive); - a.a_vp = vp; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_inactive), &a); - return (rc); -} -struct vop_reclaim_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_reclaim_desc; -static __inline int VOP_RECLAIM __P(( - struct vnode *vp, - struct proc *p)); -static __inline int VOP_RECLAIM(vp, p) - struct vnode *vp; - struct proc *p; -{ - struct vop_reclaim_args a; - int rc; - a.a_desc = VDESC(vop_reclaim); - a.a_vp = vp; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_reclaim), &a); - return (rc); -} -struct vop_lock_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - int a_flags; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_lock_desc; -static __inline int VOP_LOCK __P(( - struct vnode *vp, - int flags, - struct proc *p)); -static __inline int VOP_LOCK(vp, flags, p) - struct vnode *vp; - int flags; - struct proc *p; -{ - struct vop_lock_args a; - int rc; - a.a_desc = VDESC(vop_lock); - a.a_vp = vp; - a.a_flags = flags; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_lock), &a); - return (rc); -} -struct vop_unlock_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - int a_flags; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_unlock_desc; -static __inline int VOP_UNLOCK __P(( - struct vnode *vp, - int flags, - struct proc *p)); -static __inline int VOP_UNLOCK(vp, flags, p) - struct vnode *vp; - int flags; - struct proc *p; -{ - struct vop_unlock_args a; - int rc; - a.a_desc = VDESC(vop_unlock); - a.a_vp = vp; - a.a_flags = flags; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_unlock), &a); - return (rc); -} -struct vop_bmap_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - daddr_t a_bn; - struct vnode **a_vpp; - daddr_t *a_bnp; - int *a_runp; - int *a_runb; -}; -extern struct vnodeop_desc vop_bmap_desc; -static __inline int VOP_BMAP __P(( - struct vnode *vp, - daddr_t bn, - struct vnode **vpp, - daddr_t *bnp, - int *runp, - int *runb)); -static __inline int VOP_BMAP(vp, bn, vpp, bnp, runp, runb) - struct vnode *vp; - daddr_t bn; - struct vnode **vpp; - daddr_t *bnp; - int *runp; - int *runb; -{ - struct vop_bmap_args a; - int rc; - a.a_desc = VDESC(vop_bmap); - a.a_vp = vp; - a.a_bn = bn; - a.a_vpp = vpp; - a.a_bnp = bnp; - a.a_runp = runp; - a.a_runb = runb; - rc = VCALL(vp, VOFFSET(vop_bmap), &a); - return (rc); -} -struct vop_strategy_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct buf *a_bp; -}; -extern struct vnodeop_desc vop_strategy_desc; -static __inline int VOP_STRATEGY __P(( - struct vnode *vp, - struct buf *bp)); -static __inline int VOP_STRATEGY(vp, bp) - struct vnode *vp; - struct buf *bp; -{ - struct vop_strategy_args a; - int rc; - a.a_desc = VDESC(vop_strategy); - a.a_vp = vp; - a.a_bp = bp; - rc = VCALL(vp, VOFFSET(vop_strategy), &a); - return (rc); -} -struct vop_print_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; -}; -extern struct vnodeop_desc vop_print_desc; -static __inline int VOP_PRINT __P(( - struct vnode *vp)); -static __inline int VOP_PRINT(vp) - struct vnode *vp; -{ - struct vop_print_args a; - int rc; - a.a_desc = VDESC(vop_print); - a.a_vp = vp; - rc = VCALL(vp, VOFFSET(vop_print), &a); - return (rc); -} -struct vop_pathconf_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - int a_name; - register_t *a_retval; -}; -extern struct vnodeop_desc vop_pathconf_desc; -static __inline int VOP_PATHCONF __P(( - struct vnode *vp, - int name, - register_t *retval)); -static __inline int VOP_PATHCONF(vp, name, retval) - struct vnode *vp; - int name; - register_t *retval; -{ - struct vop_pathconf_args a; - int rc; - a.a_desc = VDESC(vop_pathconf); - a.a_vp = vp; - a.a_name = name; - a.a_retval = retval; - rc = VCALL(vp, VOFFSET(vop_pathconf), &a); - return (rc); -} -struct vop_advlock_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - caddr_t a_id; - int a_op; - struct flock *a_fl; - int a_flags; -}; -extern struct vnodeop_desc vop_advlock_desc; -static __inline int VOP_ADVLOCK __P(( - struct vnode *vp, - caddr_t id, - int op, - struct flock *fl, - int flags)); -static __inline int VOP_ADVLOCK(vp, id, op, fl, flags) - struct vnode *vp; - caddr_t id; - int op; - struct flock *fl; - int flags; -{ - struct vop_advlock_args a; - int rc; - a.a_desc = VDESC(vop_advlock); - a.a_vp = vp; - a.a_id = id; - a.a_op = op; - a.a_fl = fl; - a.a_flags = flags; - rc = VCALL(vp, VOFFSET(vop_advlock), &a); - return (rc); -} -struct vop_balloc_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - off_t a_startoffset; - int a_size; - struct ucred *a_cred; - int a_flags; - struct buf **a_bpp; -}; -extern struct vnodeop_desc vop_balloc_desc; -static __inline int VOP_BALLOC __P(( - struct vnode *vp, - off_t startoffset, - int size, - struct ucred *cred, - int flags, - struct buf **bpp)); -static __inline int VOP_BALLOC(vp, startoffset, size, cred, flags, bpp) - struct vnode *vp; - off_t startoffset; - int size; - struct ucred *cred; - int flags; - struct buf **bpp; -{ - struct vop_balloc_args a; - int rc; - a.a_desc = VDESC(vop_balloc); - a.a_vp = vp; - a.a_startoffset = startoffset; - a.a_size = size; - a.a_cred = cred; - a.a_flags = flags; - a.a_bpp = bpp; - rc = VCALL(vp, VOFFSET(vop_balloc), &a); - return (rc); -} -struct vop_reallocblks_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct cluster_save *a_buflist; -}; -extern struct vnodeop_desc vop_reallocblks_desc; -static __inline int VOP_REALLOCBLKS __P(( - struct vnode *vp, - struct cluster_save *buflist)); -static __inline int VOP_REALLOCBLKS(vp, buflist) - struct vnode *vp; - struct cluster_save *buflist; -{ - struct vop_reallocblks_args a; - int rc; - a.a_desc = VDESC(vop_reallocblks); - a.a_vp = vp; - a.a_buflist = buflist; - rc = VCALL(vp, VOFFSET(vop_reallocblks), &a); - return (rc); -} -struct vop_getpages_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - vm_page_t *a_m; - int a_count; - int a_reqpage; - vm_ooffset_t a_offset; -}; -extern struct vnodeop_desc vop_getpages_desc; -static __inline int VOP_GETPAGES __P(( - struct vnode *vp, - vm_page_t *m, - int count, - int reqpage, - vm_ooffset_t offset)); -static __inline int VOP_GETPAGES(vp, m, count, reqpage, offset) - struct vnode *vp; - vm_page_t *m; - int count; - int reqpage; - vm_ooffset_t offset; -{ - struct vop_getpages_args a; - int rc; - a.a_desc = VDESC(vop_getpages); - a.a_vp = vp; - a.a_m = m; - a.a_count = count; - a.a_reqpage = reqpage; - a.a_offset = offset; - rc = VCALL(vp, VOFFSET(vop_getpages), &a); - return (rc); -} -struct vop_putpages_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - vm_page_t *a_m; - int a_count; - int a_sync; - int *a_rtvals; - vm_ooffset_t a_offset; -}; -extern struct vnodeop_desc vop_putpages_desc; -static __inline int VOP_PUTPAGES __P(( - struct vnode *vp, - vm_page_t *m, - int count, - int sync, - int *rtvals, - vm_ooffset_t offset)); -static __inline int VOP_PUTPAGES(vp, m, count, sync, rtvals, offset) - struct vnode *vp; - vm_page_t *m; - int count; - int sync; - int *rtvals; - vm_ooffset_t offset; -{ - struct vop_putpages_args a; - int rc; - a.a_desc = VDESC(vop_putpages); - a.a_vp = vp; - a.a_m = m; - a.a_count = count; - a.a_sync = sync; - a.a_rtvals = rtvals; - a.a_offset = offset; - rc = VCALL(vp, VOFFSET(vop_putpages), &a); - return (rc); -} -struct vop_freeblks_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - daddr_t a_addr; - daddr_t a_length; -}; -extern struct vnodeop_desc vop_freeblks_desc; -static __inline int VOP_FREEBLKS __P(( - struct vnode *vp, - daddr_t addr, - daddr_t length)); -static __inline int VOP_FREEBLKS(vp, addr, length) - struct vnode *vp; - daddr_t addr; - daddr_t length; -{ - struct vop_freeblks_args a; - int rc; - a.a_desc = VDESC(vop_freeblks); - a.a_vp = vp; - a.a_addr = addr; - a.a_length = length; - rc = VCALL(vp, VOFFSET(vop_freeblks), &a); - return (rc); -} -struct vop_bwrite_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct buf *a_bp; -}; -extern struct vnodeop_desc vop_bwrite_desc; -static __inline int VOP_BWRITE __P(( - struct vnode *vp, - struct buf *bp)); -static __inline int VOP_BWRITE(vp, bp) - struct vnode *vp; - struct buf *bp; -{ - struct vop_bwrite_args a; - int rc; - a.a_desc = VDESC(vop_bwrite); - a.a_vp = vp; - a.a_bp = bp; - rc = VCALL(vp, VOFFSET(vop_bwrite), &a); - return (rc); -} -struct vop_getacl_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - acl_type_t a_type; - struct acl *a_aclp; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_getacl_desc; -static __inline int VOP_GETACL __P(( - struct vnode *vp, - acl_type_t type, - struct acl *aclp, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_GETACL(vp, type, aclp, cred, p) - struct vnode *vp; - acl_type_t type; - struct acl *aclp; - struct ucred *cred; - struct proc *p; -{ - struct vop_getacl_args a; - int rc; - a.a_desc = VDESC(vop_getacl); - a.a_vp = vp; - a.a_type = type; - a.a_aclp = aclp; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_getacl), &a); - return (rc); -} -struct vop_setacl_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - acl_type_t a_type; - struct acl *a_aclp; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_setacl_desc; -static __inline int VOP_SETACL __P(( - struct vnode *vp, - acl_type_t type, - struct acl *aclp, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_SETACL(vp, type, aclp, cred, p) - struct vnode *vp; - acl_type_t type; - struct acl *aclp; - struct ucred *cred; - struct proc *p; -{ - struct vop_setacl_args a; - int rc; - a.a_desc = VDESC(vop_setacl); - a.a_vp = vp; - a.a_type = type; - a.a_aclp = aclp; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_setacl), &a); - return (rc); -} -struct vop_aclcheck_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - acl_type_t a_type; - struct acl *a_aclp; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_aclcheck_desc; -static __inline int VOP_ACLCHECK __P(( - struct vnode *vp, - acl_type_t type, - struct acl *aclp, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_ACLCHECK(vp, type, aclp, cred, p) - struct vnode *vp; - acl_type_t type; - struct acl *aclp; - struct ucred *cred; - struct proc *p; -{ - struct vop_aclcheck_args a; - int rc; - a.a_desc = VDESC(vop_aclcheck); - a.a_vp = vp; - a.a_type = type; - a.a_aclp = aclp; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_aclcheck), &a); - return (rc); -} -struct vop_getextattr_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - char *a_name; - struct uio *a_uio; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_getextattr_desc; -static __inline int VOP_GETEXTATTR __P(( - struct vnode *vp, - char *name, - struct uio *uio, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_GETEXTATTR(vp, name, uio, cred, p) - struct vnode *vp; - char *name; - struct uio *uio; - struct ucred *cred; - struct proc *p; -{ - struct vop_getextattr_args a; - int rc; - a.a_desc = VDESC(vop_getextattr); - a.a_vp = vp; - a.a_name = name; - a.a_uio = uio; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_getextattr), &a); - return (rc); -} -struct vop_setextattr_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - char *a_name; - struct uio *a_uio; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_setextattr_desc; -static __inline int VOP_SETEXTATTR __P(( - struct vnode *vp, - char *name, - struct uio *uio, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_SETEXTATTR(vp, name, uio, cred, p) - struct vnode *vp; - char *name; - struct uio *uio; - struct ucred *cred; - struct proc *p; -{ - struct vop_setextattr_args a; - int rc; - a.a_desc = VDESC(vop_setextattr); - a.a_vp = vp; - a.a_name = name; - a.a_uio = uio; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_setextattr), &a); - return (rc); -} -struct vop_createvobject_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct ucred *a_cred; - struct proc *a_p; -}; -extern struct vnodeop_desc vop_createvobject_desc; -static __inline int VOP_CREATEVOBJECT __P(( - struct vnode *vp, - struct ucred *cred, - struct proc *p)); -static __inline int VOP_CREATEVOBJECT(vp, cred, p) - struct vnode *vp; - struct ucred *cred; - struct proc *p; -{ - struct vop_createvobject_args a; - int rc; - a.a_desc = VDESC(vop_createvobject); - a.a_vp = vp; - a.a_cred = cred; - a.a_p = p; - rc = VCALL(vp, VOFFSET(vop_createvobject), &a); - return (rc); -} -struct vop_destroyvobject_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; -}; -extern struct vnodeop_desc vop_destroyvobject_desc; -static __inline int VOP_DESTROYVOBJECT __P(( - struct vnode *vp)); -static __inline int VOP_DESTROYVOBJECT(vp) - struct vnode *vp; -{ - struct vop_destroyvobject_args a; - int rc; - a.a_desc = VDESC(vop_destroyvobject); - a.a_vp = vp; - rc = VCALL(vp, VOFFSET(vop_destroyvobject), &a); - return (rc); -} -struct vop_getvobject_args { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - struct vm_object **a_objpp; -}; -extern struct vnodeop_desc vop_getvobject_desc; -static __inline int VOP_GETVOBJECT __P(( - struct vnode *vp, - struct vm_object **objpp)); -static __inline int VOP_GETVOBJECT(vp, objpp) - struct vnode *vp; - struct vm_object **objpp; -{ - struct vop_getvobject_args a; - int rc; - a.a_desc = VDESC(vop_getvobject); - a.a_vp = vp; - a.a_objpp = objpp; - rc = VCALL(vp, VOFFSET(vop_getvobject), &a); - return (rc); -} diff --git a/src/afs/HPUX/hpux_mod.modmeta b/src/afs/HPUX/hpux_mod.modmeta new file mode 100644 index 000000000..f368e5f51 --- /dev/null +++ b/src/afs/HPUX/hpux_mod.modmeta @@ -0,0 +1,8 @@ +module AFSLIB_NAME { + version 1.0.3 + type misc + desc "AFS Kernel routines" + states loaded static + loadtimes driver_install run + initfunc driver_install afsc_link static +} diff --git a/src/afs/HPUX/osi_debug.c b/src/afs/HPUX/osi_debug.c index f339480e0..cb8e4facc 100644 --- a/src/afs/HPUX/osi_debug.c +++ b/src/afs/HPUX/osi_debug.c @@ -10,7 +10,8 @@ #include #include "param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_debug.c,v 1.1.1.4 2001/07/14 22:19:39 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/HPUX/osi_debug.c,v 1.5 2003/07/15 23:14:21 shadow Exp $"); #include "sysincludes.h" #include "afsincludes.h" diff --git a/src/afs/HPUX/osi_file.c b/src/afs/HPUX/osi_file.c index 81954b0b0..f88b5f6b0 100644 --- a/src/afs/HPUX/osi_file.c +++ b/src/afs/HPUX/osi_file.c @@ -8,25 +8,26 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_file.c,v 1.1.1.5 2001/09/11 14:24:59 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/HPUX/osi_file.c,v 1.8 2003/07/15 23:14:21 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ -#include "../afs/osi_inode.h" /* igetinode() */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ +#include "afs/osi_inode.h" /* igetinode() */ -int afs_osicred_initialized=0; -struct AFS_UCRED afs_osi_cred; +int afs_osicred_initialized = 0; +struct AFS_UCRED afs_osi_cred; afs_lock_t afs_xosi; /* lock is for tvattr */ extern struct osi_dev cacheDev; extern struct vfs *afs_cacheVfsp; -void *osi_UFSOpen(ainode) - afs_int32 ainode; +void * +osi_UFSOpen(afs_int32 ainode) { struct inode *ip; register struct osi_file *afile = NULL; @@ -34,7 +35,7 @@ void *osi_UFSOpen(ainode) afs_int32 code = 0; int dummy; AFS_STATCNT(osi_UFSOpen); - if(cacheDiskType != AFS_FCACHE_TYPE_UFS) { + if (cacheDiskType != AFS_FCACHE_TYPE_UFS) { osi_Panic("UFSOpen called for non-UFS cache\n"); } if (!afs_osicred_initialized) { @@ -43,10 +44,11 @@ void *osi_UFSOpen(ainode) crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */ afs_osicred_initialized = 1; } - afile = (struct osi_file *) osi_AllocSmallSpace(sizeof(struct osi_file)); + afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file)); setuerror(0); AFS_GUNLOCK(); - ip = (struct inode *) igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t)ainode,&dummy); + ip = (struct inode *)igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, + (ino_t) ainode, &dummy); AFS_GLOCK(); if (getuerror()) { osi_FreeSmallSpace(afile); @@ -56,18 +58,18 @@ void *osi_UFSOpen(ainode) afile->vnode = ITOV(ip); afile->size = VTOI(afile->vnode)->i_size; afile->offset = 0; - afile->proc = (int (*)()) 0; - afile->inum = ainode; /* for hint validity checking */ + afile->proc = (int (*)())0; + afile->inum = ainode; /* for hint validity checking */ return (void *)afile; } -afs_osi_Stat(afile, astat) - register struct osi_file *afile; - register struct osi_stat *astat; { +int +afs_osi_Stat(register struct osi_file *afile, register struct osi_stat *astat) +{ register afs_int32 code; struct vattr tvattr; AFS_STATCNT(osi_Stat); - MObtainWriteLock(&afs_xosi,320); + MObtainWriteLock(&afs_xosi, 320); AFS_GUNLOCK(); code = VOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred, VSYNC); AFS_GLOCK(); @@ -81,21 +83,21 @@ afs_osi_Stat(afile, astat) return code; } -osi_UFSClose(afile) - register struct osi_file *afile; - { - AFS_STATCNT(osi_Close); - if(afile->vnode) { +int +osi_UFSClose(register struct osi_file *afile) +{ + AFS_STATCNT(osi_Close); + if (afile->vnode) { AFS_RELE(afile->vnode); - } - - osi_FreeSmallSpace(afile); - return 0; - } - -osi_UFSTruncate(afile, asize) - register struct osi_file *afile; - afs_int32 asize; { + } + + osi_FreeSmallSpace(afile); + return 0; +} + +int +osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize) +{ struct AFS_UCRED *oldCred; struct vattr tvattr; register afs_int32 code; @@ -107,68 +109,69 @@ osi_UFSTruncate(afile, asize) * small enough. Check now and save some time. */ code = afs_osi_Stat(afile, &tstat); - if (code || tstat.size <= asize) return code; - MObtainWriteLock(&afs_xosi,321); + if (code || tstat.size <= asize) + return code; + MObtainWriteLock(&afs_xosi, 321); VATTR_NULL(&tvattr); /* note that this credential swapping stuff is only necessary because - of ufs's references directly to u.u_cred instead of to - credentials parameter. Probably should fix ufs some day. */ + * of ufs's references directly to u.u_cred instead of to + * credentials parameter. Probably should fix ufs some day. */ oldCred = p_cred(u.u_procp); set_p_cred(u.u_procp, &afs_osi_cred); tvattr.va_size = asize; AFS_GUNLOCK(); code = VOP_SETATTR(afile->vnode, &tvattr, &afs_osi_cred, 0); AFS_GLOCK(); - set_p_cred(u.u_procp, oldCred); /* restore */ + set_p_cred(u.u_procp, oldCred); /* restore */ MReleaseWriteLock(&afs_xosi); return code; } -void osi_DisableAtimes(avp) -struct vnode *avp; +void +osi_DisableAtimes(struct vnode *avp) { - struct inode *ip = VTOI(avp); - ip->i_flag &= ~IACC; + struct inode *ip = VTOI(avp); + ip->i_flag &= ~IACC; } /* Generic read interface */ -afs_osi_Read(afile, offset, aptr, asize) - register struct osi_file *afile; - int offset; - char *aptr; - afs_int32 asize; { +int +afs_osi_Read(register struct osi_file *afile, int offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; long resid; register afs_int32 code; - register afs_int32 cnt1=0; + register afs_int32 cnt1 = 0; AFS_STATCNT(osi_Read); /** * If the osi_file passed in is NULL, panic only if AFS is not shutting * down. No point in crashing when we are already shutting down */ - if ( !afile ) { - if ( !afs_shuttingdown ) + if (!afile) { + if (!afs_shuttingdown) osi_Panic("osi_Read called with null param"); else return EIO; } - if (offset != -1) afile->offset = offset; -retry_IO: + if (offset != -1) + afile->offset = offset; + retry_IO: AFS_GUNLOCK(); - code = gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset, - AFS_UIOSYS, IO_UNIT, &resid); + code = + gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset, + AFS_UIOSYS, IO_UNIT, &resid); AFS_GLOCK(); if (code == 0) { code = asize - resid; afile->offset += code; osi_DisableAtimes(afile->vnode); - } - else { - afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, (afs_int32) resid, - ICL_TYPE_INT32, code); + } else { + afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, + (afs_int32) resid, ICL_TYPE_INT32, code); /* * To handle periodic low-level EFAULT failures that we've seen with the * Weitek chip; in all observed failed cases a second read succeeded. @@ -177,53 +180,54 @@ retry_IO: afs_stats_cmperf.osiread_efaults++; goto retry_IO; } - setuerror(code); + setuerror(code); code = -1; } return code; } /* Generic write interface */ -afs_osi_Write(afile, offset, aptr, asize) - register struct osi_file *afile; - char *aptr; - afs_int32 offset; - afs_int32 asize; { +int +afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; long resid; register afs_int32 code; AFS_STATCNT(osi_Write); - if ( !afile ) - osi_Panic("afs_osi_Write called with null param"); - if (offset != -1) afile->offset = offset; + if (!afile) + osi_Panic("afs_osi_Write called with null param"); + if (offset != -1) + afile->offset = offset; AFS_GUNLOCK(); - code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, afile->offset, - AFS_UIOSYS, IO_UNIT, &resid); + code = + gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, + afile->offset, AFS_UIOSYS, IO_UNIT, &resid); AFS_GLOCK(); if (code == 0) { code = asize - resid; afile->offset += code; - } - else { - if (code == ENOSPC) afs_warnuser("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n"); + } else { + if (code == ENOSPC) + afs_warnuser + ("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n"); setuerror(code); code = -1; } if (afile->proc) { - (*afile->proc)(afile, code); + (*afile->proc) (afile, code); } return code; } void -shutdown_osifile() +shutdown_osifile(void) { - extern int afs_cold_shutdown; + extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); - if (afs_cold_shutdown) { - afs_osicred_initialized = 0; - } + AFS_STATCNT(shutdown_osifile); + if (afs_cold_shutdown) { + afs_osicred_initialized = 0; + } } - diff --git a/src/afs/HPUX/osi_groups.c b/src/afs/HPUX/osi_groups.c index 20d28d146..103adf1dc 100644 --- a/src/afs/HPUX/osi_groups.c +++ b/src/afs/HPUX/osi_groups.c @@ -14,29 +14,24 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_groups.c,v 1.1.1.5 2003/07/30 17:08:07 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/HPUX/osi_groups.c,v 1.8 2003/07/15 23:14:21 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/afs_stats.h" /* statistics */ static int -afs_getgroups( - struct ucred *cred, - int ngroups, - gid_t *gidset); + afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset); static int -afs_setgroups( - struct ucred **cred, - int ngroups, - gid_t *gidset, - int change_parent); + afs_setgroups(struct ucred **cred, int ngroups, gid_t * gidset, + int change_parent); int -Afs_xsetgroups() +Afs_xsetgroups() { int code = 0; struct vrequest treq; @@ -45,7 +40,8 @@ Afs_xsetgroups() AFS_GLOCK(); code = afs_InitReq(&treq, p_cred(u.u_procp)); AFS_GUNLOCK(); - if (code) return code; + if (code) + return code; setgroups(); /* Note that if there is a pag already in the new groups we don't @@ -66,10 +62,10 @@ Afs_xsetgroups() int setpag(cred, pagvalue, newpag, change_parent) - struct ucred **cred; - afs_uint32 pagvalue; - afs_uint32 *newpag; - afs_uint32 change_parent; + struct ucred **cred; + afs_uint32 pagvalue; + afs_uint32 *newpag; + afs_uint32 change_parent; { gid_t gidset[NGROUPS]; int ngroups, code; @@ -82,12 +78,12 @@ setpag(cred, pagvalue, newpag, change_parent) if (ngroups + 2 > NGROUPS) { return (setuerror(E2BIG), E2BIG); } - for (j = ngroups -1; j >= 0; j--) { - gidset[j+2] = gidset[j]; - } + for (j = ngroups - 1; j >= 0; j--) { + gidset[j + 2] = gidset[j]; + } ngroups += 2; } - *newpag = (pagvalue == -1 ? genpag(): pagvalue); + *newpag = (pagvalue == -1 ? genpag() : pagvalue); afs_get_groups_from_pag(*newpag, &gidset[0], &gidset[1]); if (code = afs_setgroups(cred, ngroups, gidset, change_parent)) { @@ -98,10 +94,7 @@ setpag(cred, pagvalue, newpag, change_parent) static int -afs_getgroups( - struct ucred *cred, - int ngroups, - gid_t *gidset) +afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) { int ngrps, savengrps; int *gp; @@ -111,10 +104,10 @@ afs_getgroups( for (gp = &cred->cr_groups[NGROUPS]; gp > cred->cr_groups; gp--) { if (gp[-1] != NOGROUP) - break; + break; } savengrps = ngrps = MIN(ngroups, gp - cred->cr_groups); - for (gp = cred->cr_groups; ngrps--; ) + for (gp = cred->cr_groups; ngrps--;) *gidset++ = *gp++; return savengrps; } @@ -122,11 +115,8 @@ afs_getgroups( static int -afs_setgroups( - struct ucred **cred, - int ngroups, - gid_t *gidset, - int change_parent) +afs_setgroups(struct ucred **cred, int ngroups, gid_t * gidset, + int change_parent) { int ngrps; int i; @@ -138,51 +128,47 @@ afs_setgroups( #endif AFS_STATCNT(afs_setgroups); - - if (!change_parent) - { - newcr = (struct ucred *)crdup(*cred); - /* nobody else has the pointer to newcr because we - ** just allocated it, so no need for locking */ - } - else - { - /* somebody else might have a pointer to this structure. - ** make sure we do not have a race condition */ - newcr = *cred; + + if (!change_parent) { + newcr = (struct ucred *)crdup(*cred); + /* nobody else has the pointer to newcr because we + ** just allocated it, so no need for locking */ + } else { + /* somebody else might have a pointer to this structure. + ** make sure we do not have a race condition */ + newcr = *cred; #if defined(AFS_HPUX110_ENV) - /* all of the uniprocessor spinlocks are not defined. */ - /* I assume the UP and MP are now handled together */ - MP_SPINLOCK_USAV(cred_lock, context); + /* all of the uniprocessor spinlocks are not defined. */ + /* I assume the UP and MP are now handled together */ + MP_SPINLOCK_USAV(cred_lock, context); #else - s = UP_SPL6(); - SPINLOCK(cred_lock); + s = UP_SPL6(); + SPINLOCK(cred_lock); #endif - } - + } + + /* copy the group info */ gp = newcr->cr_groups; while (ngroups--) *gp++ = *gidset++; - for ( ; gp < &(newcr)->cr_groups[NGROUPS]; gp++) - *gp = ((gid_t) -1); - - if ( !change_parent) - { - /* replace the new cred structure in the proc area */ - struct ucred* tmp; - tmp = *cred; - set_p_cred(u.u_procp, newcr); - crfree(tmp); - } - else - { + for (; gp < &(newcr)->cr_groups[NGROUPS]; gp++) + *gp = ((gid_t) - 1); + + if (!change_parent) { + /* replace the new cred structure in the proc area */ + struct ucred *tmp; + tmp = *cred; + set_p_cred(u.u_procp, newcr); + crfree(tmp); + } else { #if defined(AFS_HPUX110_ENV) - MP_SPINUNLOCK_USAV(cred_lock, context); + MP_SPINUNLOCK_USAV(cred_lock, context); #else - (void) UP_SPLX(s); - SPINUNLOCK(cred_lock); + (void)UP_SPLX(s); + SPINUNLOCK(cred_lock); #endif - } + } + return (setuerror(0), 0); } diff --git a/src/afs/HPUX/osi_inode.c b/src/afs/HPUX/osi_inode.c index 5cb63d7bd..ea5fbf205 100644 --- a/src/afs/HPUX/osi_inode.c +++ b/src/afs/HPUX/osi_inode.c @@ -14,205 +14,206 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_inode.c,v 1.1.1.4 2001/07/14 22:19:40 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/HPUX/osi_inode.c,v 1.7 2003/07/15 23:14:21 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/osi_inode.h" -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/osi_inode.h" +#include "afs/afs_stats.h" /* statistics stuff */ #include static struct inode * getinode(struct vfs *vfsp, dev_t dev, ino_t inode, int *perror) { - struct mount *mp = (vfsp ? VFSTOM(vfsp) : 0); - struct inode *pip; - *perror = 0; - - if (!mp && !(mp = getmp(dev))) { - u.u_error = ENXIO; - return((struct inode *)0); - } - pip=iget(dev,mp,inode); - if(!pip) + struct mount *mp = (vfsp ? VFSTOM(vfsp) : 0); + struct inode *pip; + *perror = 0; + + if (!mp && !(mp = getmp(dev))) { + u.u_error = ENXIO; + return (NULL); + } + pip = iget(dev, mp, inode); + if (!pip) *perror = BAD_IGET; - return(pip); + return (pip); } struct inode * igetinode(struct vfs *vfsp, dev_t dev, ino_t inode, int *perror) { - struct inode *pip, *ip; - extern struct osi_dev cacheDev; - register int code = 0; - - *perror = 0; - AFS_STATCNT(igetinode); - ip = getinode(vfsp, dev, inode,perror); - if (ip == NULL) { - *perror = BAD_IGET; - u.u_error = ENOENT; /* Well... */ - return; - } - if (ip->i_mode == 0) { - /* Not an allocated inode */ - iforget(ip); - u.u_error = ENOENT; - return; - } - if (ip->i_nlink == 0 || (ip->i_mode&IFMT) != IFREG) { - iput(ip); - u.u_error = ENOENT; - return; - } - return ip; + struct inode *pip, *ip; + extern struct osi_dev cacheDev; + register int code = 0; + + *perror = 0; + AFS_STATCNT(igetinode); + ip = getinode(vfsp, dev, inode, perror); + if (ip == NULL) { + *perror = BAD_IGET; + u.u_error = ENOENT; /* Well... */ + return; + } + if (ip->i_mode == 0) { + /* Not an allocated inode */ + iforget(ip); + u.u_error = ENOENT; + return; + } + if (ip->i_nlink == 0 || (ip->i_mode & IFMT) != IFREG) { + iput(ip); + u.u_error = ENOENT; + return; + } + return ip; } iforget(ip) struct inode *ip; { - idrop(ip); + idrop(ip); } afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4) -long dev, near_inode, param1, param2, param3, param4; + long dev, near_inode, param1, param2, param3, param4; { - int dummy, err=0; - struct inode *ip, *newip; - - AFS_STATCNT(afs_syscall_icreate); - - if (!afs_suser()) { - u.u_error = EPERM; - goto out; - } - - ip = getinode(0, (dev_t)dev, 2,&dummy); - if (ip == NULL) { - u.u_error = ENOENT; /* Well... */ - goto out; - } - - newip = (struct inode *)ialloc(ip, near_inode, 0); - iput(ip); - if (newip == NULL) - goto out; - - newip->i_flag |= IACC|IUPD|ICHG; - newip->i_nlink = 1; - newip->i_mode = IFREG; - newip->i_vnode.v_type = VREG; - newip->i_vicemagic = VICEMAGIC; - newip->i_vicep1 = param1; - newip->i_vicep2 = param2; - I_VICE3(newip) = param3; - newip->i_vicep4 = param4; - u.u_r.r_val1 = newip->i_number; - - iput(newip); - -out: - return err; + int dummy, err = 0; + struct inode *ip, *newip; + + AFS_STATCNT(afs_syscall_icreate); + + if (!afs_suser()) { + u.u_error = EPERM; + goto out; + } + + ip = getinode(0, (dev_t) dev, 2, &dummy); + if (ip == NULL) { + u.u_error = ENOENT; /* Well... */ + goto out; + } + + newip = (struct inode *)ialloc(ip, near_inode, 0); + iput(ip); + if (newip == NULL) + goto out; + + newip->i_flag |= IACC | IUPD | ICHG; + newip->i_nlink = 1; + newip->i_mode = IFREG; + newip->i_vnode.v_type = VREG; + newip->i_vicemagic = VICEMAGIC; + newip->i_vicep1 = param1; + newip->i_vicep2 = param2; + I_VICE3(newip) = param3; + newip->i_vicep4 = param4; + u.u_r.r_val1 = newip->i_number; + + iput(newip); + + out: + return err; } afs_syscall_iopen(dev, inode, usrmod) -int dev, inode, usrmod; + int dev, inode, usrmod; { - struct file *fp; - struct inode *ip; - struct vnode *vp = (struct vnode *)0; - int dummy; - extern struct fileops vnodefops; - register int code; - - AFS_STATCNT(afs_syscall_iopen); - - if (!afs_suser()) { - u.u_error = EPERM; - goto out; - } - - ip = igetinode(0, (dev_t)dev, (ino_t)inode,&dummy); - if (u.u_error) - goto out; - fp = falloc(); - if (!fp) { - iput(ip); - goto out; - } - iunlock(ip); - - fp->f_ops = &vnodefops; - vp = ITOV(ip); - fp->f_data = (char *)vp; - fp->f_type = DTYPE_VNODE; - fp->f_flag = (usrmod+1) & (FMASK); - - /* Obtained from hp kernel sys/vfs_scalls.c: copen(). - * Otherwise we panic because the v_writecount - * goes less than 0 during close. - */ - if ((vp->v_type == VREG) && (fp->f_flag & FWRITE)) { - VN_INC_WRITECOUNT(vp); - } - - /* fp->f_count, f_msgcount are set by falloc */ - /* fp->f_offset zeroed by falloc */ - /* f_cred set by falloc */ - - /* - * Obtained from hp kernel sys/vfs_scalls.c: copen() does - * a PUTF() (defined earlier in the file) before returning, - * so we parrot what it does. If this is not done, then - * threaded processes will get EBADF errors when they try - * to use the resulting file descriptor (e.g. with lseek()). - * - * Note: u.u_r.r_val1 is set by ufalloc(), which is - * called by falloc(), which is called above. - */ - if (is_multithreaded(u.u_procp)) { - int fd = (int)u.u_r.r_val1; - putf(fd); - } - -out: - return; + struct file *fp; + struct inode *ip; + struct vnode *vp = NULL; + int dummy; + extern struct fileops vnodefops; + register int code; + + AFS_STATCNT(afs_syscall_iopen); + + if (!afs_suser()) { + u.u_error = EPERM; + goto out; + } + + ip = igetinode(0, (dev_t) dev, (ino_t) inode, &dummy); + if (u.u_error) + goto out; + fp = falloc(); + if (!fp) { + iput(ip); + goto out; + } + iunlock(ip); + + fp->f_ops = &vnodefops; + vp = ITOV(ip); + fp->f_data = (char *)vp; + fp->f_type = DTYPE_VNODE; + fp->f_flag = (usrmod + 1) & (FMASK); + + /* Obtained from hp kernel sys/vfs_scalls.c: copen(). + * Otherwise we panic because the v_writecount + * goes less than 0 during close. + */ + if ((vp->v_type == VREG) && (fp->f_flag & FWRITE)) { + VN_INC_WRITECOUNT(vp); + } + + /* fp->f_count, f_msgcount are set by falloc */ + /* fp->f_offset zeroed by falloc */ + /* f_cred set by falloc */ + + /* + * Obtained from hp kernel sys/vfs_scalls.c: copen() does + * a PUTF() (defined earlier in the file) before returning, + * so we parrot what it does. If this is not done, then + * threaded processes will get EBADF errors when they try + * to use the resulting file descriptor (e.g. with lseek()). + * + * Note: u.u_r.r_val1 is set by ufalloc(), which is + * called by falloc(), which is called above. + */ + if (is_multithreaded(u.u_procp)) { + int fd = (int)u.u_r.r_val1; + putf(fd); + } + + out: + return; } afs_syscall_iincdec(dev, inode, inode_p1, amount) -int dev, inode, inode_p1, amount; + int dev, inode, inode_p1, amount; { - int dummy; - struct inode *ip; - register afs_int32 code; - - if (!afs_suser()) { - u.u_error = EPERM; - goto out; - } - - ip = igetinode(0, (dev_t)dev, (ino_t)inode,&dummy); - if (u.u_error) { - goto out; + int dummy; + struct inode *ip; + register afs_int32 code; + + if (!afs_suser()) { + u.u_error = EPERM; + goto out; + } + + ip = igetinode(0, (dev_t) dev, (ino_t) inode, &dummy); + if (u.u_error) { + goto out; + } + + if (!IS_VICEMAGIC(ip)) + u.u_error = EPERM; + else if (ip->i_vicep1 != inode_p1) + u.u_error = ENXIO; + else { + ip->i_nlink += amount; + if (ip->i_nlink == 0) { + CLEAR_VICEMAGIC(ip); } + ip->i_flag |= ICHG; + } - if (!IS_VICEMAGIC(ip)) - u.u_error = EPERM; - else if (ip->i_vicep1 != inode_p1) - u.u_error = ENXIO; - else { - ip->i_nlink += amount; - if (ip->i_nlink == 0) { - CLEAR_VICEMAGIC(ip); - } - ip->i_flag |= ICHG; - } - - iput(ip); + iput(ip); -out: + out: return; } diff --git a/src/afs/HPUX/osi_inode.h b/src/afs/HPUX/osi_inode.h index d7f69a9d7..cdd3bac45 100644 --- a/src/afs/HPUX/osi_inode.h +++ b/src/afs/HPUX/osi_inode.h @@ -47,6 +47,7 @@ #define CLEAR_VICEMAGIC(ip) (ip)->i_vicemagic = 0 #define CLEAR_DVICEMAGIC(dp) (dp)->di_vicemagic = 0 -struct inode *igetinode(struct vfs *vfsp, dev_t dev, ino_t inode, int *perror); +struct inode *igetinode(struct vfs *vfsp, dev_t dev, ino_t inode, + int *perror); #endif /* _OSI_INODE_H_ */ diff --git a/src/afs/HPUX/osi_machdep.h b/src/afs/HPUX/osi_machdep.h index e7b8312f4..b13f6e461 100644 --- a/src/afs/HPUX/osi_machdep.h +++ b/src/afs/HPUX/osi_machdep.h @@ -18,7 +18,7 @@ #ifndef _OSI_MACHDEP_H_ #define _OSI_MACHDEP_H_ -#include "../h/kern_sem.h" +#include "h/kern_sem.h" #define afs_hz hz extern struct timeval time; @@ -38,6 +38,8 @@ extern struct timeval time; #undef afs_suser +#define osi_curcred() (p_cred(u.u_procp)) + #define getpid() (afs_uint32)p_pid(u.u_procp) #define getppid() (afs_uint32)p_ppid(u.u_procp) @@ -58,24 +60,27 @@ extern b_sema_t afs_global_sema; extern void osi_InitGlock(void); #if !defined(AFS_HPUX110_ENV) -extern void afsHash(int nbuckets); +extern void afsHash(int nbuckets); extern sv_sema_t *afsHashInsertFind(tid_t key); extern sv_sema_t *afsHashFind(tid_t key); -extern void afsHashRelease(tid_t key); +extern void afsHashRelease(tid_t key); #define AFS_GLOCK_PID kt_tid(u.u_kthreadp) #define AFS_SAVE_SEMA afsHashInsertFind(AFS_GLOCK_PID) #define AFS_FIND_SEMA afsHashFind(AFS_GLOCK_PID) + #define AFS_GLOCK() MP_PXSEMA(&afs_global_sema, AFS_SAVE_SEMA) #define AFS_GUNLOCK() (AFS_ASSERT_GLOCK(), MP_VXSEMA(&afs_global_sema,AFS_FIND_SEMA), (!uniprocessor ? (afsHashRelease(AFS_GLOCK_PID),0) : 0)) #define ISAFS_GLOCK() (!uniprocessor ? owns_sema(&afs_global_sema):1) + #else #define AFS_GLOCK() b_psema(&afs_global_sema) #define AFS_GUNLOCK() b_vsema(&afs_global_sema) #define ISAFS_GLOCK() b_owns_sema(&afs_global_sema) + #endif -#define AFS_RXGLOCK() +#define AFS_RXGLOCK() #define AFS_RXGUNLOCK() #define ISAFS_RXGLOCK() 1 @@ -92,11 +97,10 @@ extern void afsHashRelease(tid_t key); */ #define afs_osi_Sleep(x) sleep((caddr_t) x,PZERO-2) -#define afs_osi_Wakeup(x) wakeup((caddr_t) x) #else /* - * On 11.* global lock is a beta semaphore, hence we need to - * release and reacquire around sleep and wakeup. We also need to + * On 11.22 global lock is a beta semaphore, hence we need to + * release and reacquire around sllep and wakeup. We also need to * use the get_sleep_lock. * afs_osi_Sleep and afs_osi_Wakeup are defined */ @@ -104,13 +108,11 @@ void afs_osi_Sleep(void *event); int afs_osi_Wakeup(void *event); #endif - #define osi_NullHandle(x) ((x)->proc == (caddr_t) 0) #if !defined(AFS_HPUX110_ENV) extern caddr_t kmem_alloc(); #endif - #include /* for kt_cred() */ /* Expected to be available as a patch from HP */ diff --git a/src/afs/HPUX/osi_misc.c b/src/afs/HPUX/osi_misc.c index a0ee1e61c..ca1821a55 100644 --- a/src/afs/HPUX/osi_misc.c +++ b/src/afs/HPUX/osi_misc.c @@ -13,12 +13,13 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_misc.c,v 1.1.1.4 2001/07/14 22:19:40 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/HPUX/osi_misc.c,v 1.6 2003/07/15 23:14:21 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ /* * afs_suser() returns true if the caller is superuser, false otherwise. @@ -28,7 +29,8 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_misc.c,v 1.1.1.4 2001/07/1 * Here we have to save and restore errno since the HP-UX suser() sets errno. */ -afs_suser() { +afs_suser() +{ int save_errno; int code; diff --git a/src/afs/HPUX/osi_prototypes.h b/src/afs/HPUX/osi_prototypes.h new file mode 100644 index 000000000..4bc45e9e8 --- /dev/null +++ b/src/afs/HPUX/osi_prototypes.h @@ -0,0 +1,12 @@ +/* + * osi_prototypes.h + * + * Exported macos support routines. + */ +#ifndef _OSI_PROTO_H_ +#define _OSI_PROTO_H_ + +/* osi_file.c */ +extern afs_rwlock_t afs_xosi; + +#endif /* _OSI_PROTO_H_ */ diff --git a/src/afs/HPUX/osi_sleep.c b/src/afs/HPUX/osi_sleep.c index 1e123ad4d..bd6a1bb51 100644 --- a/src/afs/HPUX/osi_sleep.c +++ b/src/afs/HPUX/osi_sleep.c @@ -8,25 +8,25 @@ */ #include -#include "../afs/param.h" - -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_sleep.c,v 1.1.1.5 2003/07/30 17:08:07 hartmans Exp $"); - -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/param.h" +RCSID + ("$Header: /cvs/openafs/src/afs/HPUX/osi_sleep.c,v 1.12 2003/07/15 23:14:21 shadow Exp $"); +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ #if !defined(AFS_HPUX110_ENV) static char waitV; #endif /* call procedure aproc with arock as an argument, in ams milliseconds */ -static int afs_osi_CallProc(aproc, arock, ams) - register void (*aproc)(); - register char *arock; - afs_int32 ams; +static int +afs_osi_CallProc(aproc, arock, ams) + register void (*aproc) (); + register char *arock; + afs_int32 ams; { int code; @@ -35,7 +35,7 @@ static int afs_osi_CallProc(aproc, arock, ams) AFS_GUNLOCK(); #endif /* hz is in cycles/second, and timeout's 3rd parm is in cycles */ - code = timeout(aproc, arock, (ams * afs_hz)/1000 + 1); + code = timeout(aproc, arock, (ams * afs_hz) / 1000 + 1); #if !defined(AFS_HPUX110_ENV) AFS_GLOCK(); #endif @@ -43,9 +43,10 @@ static int afs_osi_CallProc(aproc, arock, ams) } /* cancel a timeout, whether or not it has already occurred */ -static int afs_osi_CancelProc(aproc, arock) - register void (*aproc)(); - register char *arock; +static int +afs_osi_CancelProc(aproc, arock) + register void (*aproc) (); + register char *arock; { int code = 0; AFS_STATCNT(osi_CancelProc); @@ -61,9 +62,10 @@ static int afs_osi_CancelProc(aproc, arock) } #if defined(AFS_HPUX110_ENV) -static void AfsWaitHack(char * event) +static void +AfsWaitHack(char *event) { - lock_t * sleep_lock; + lock_t *sleep_lock; AFS_STATCNT(WaitHack); sleep_lock = get_sleep_lock(event); @@ -72,50 +74,56 @@ static void AfsWaitHack(char * event) } #else -static void AfsWaitHack() +static void +AfsWaitHack() { AFS_STATCNT(WaitHack); wakeup(&waitV); } #endif -void afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) +void +afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) { AFS_STATCNT(osi_InitWaitHandle); achandle->proc = (caddr_t) 0; } /* cancel osi_Wait */ -void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) +void +afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) { caddr_t proc; AFS_STATCNT(osi_CancelWait); proc = achandle->proc; - if (proc == 0) return; - achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ + if (proc == 0) + return; + achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ #if defined(AFS_HPUX110_ENV) - afs_osi_Wakeup((char *)achandle); + afs_osi_Wakeup((char *)achandle); #else afs_osi_Wakeup(&waitV); #endif + } /* afs_osi_Wait * Waits for data on ahandle, or ams ms later. ahandle may be null. * Returns 0 if timeout and EINTR if signalled. */ -int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) +int +afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) { int code; afs_int32 endTime, tid; #if defined(AFS_HPUX110_ENV) - char localwait; - char * event; + char localwait; + char *event; #endif AFS_STATCNT(osi_Wait); - endTime = osi_Time() + (ams/1000); + endTime = osi_Time() + (ams / 1000); if (ahandle) ahandle->proc = (caddr_t) u.u_procp; do { @@ -123,22 +131,22 @@ int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) code = 0; /* do not do anything for solaris, digital, AIX, and SGI MP */ #if defined(AFS_HPUX110_ENV) - if (ahandle) { - event = (char *) ahandle; - } - else { - event = &localwait; - } - afs_osi_CallProc(AfsWaitHack, event, ams); - afs_osi_Sleep(event); - afs_osi_CancelProc(AfsWaitHack, event); + if (ahandle) { + event = (char *)ahandle; + } else { + event = &localwait; + } + afs_osi_CallProc(AfsWaitHack, event, ams); + afs_osi_Sleep(event); + afs_osi_CancelProc(AfsWaitHack, event); #else - afs_osi_CallProc(AfsWaitHack, (char *) u.u_procp, ams); - afs_osi_Sleep(&waitV); /* for HP 10.0 */ + afs_osi_CallProc(AfsWaitHack, (char *)u.u_procp, ams); + afs_osi_Sleep(&waitV); /* for HP 10.0 */ /* do not do anything for solaris, digital, and SGI MP */ - afs_osi_CancelProc(AfsWaitHack, (char *) u.u_procp); - if (code) break; /* if something happened, quit now */ + afs_osi_CancelProc(AfsWaitHack, (char *)u.u_procp); + if (code) + break; /* if something happened, quit now */ #endif /* if we we're cancelled, quit now */ if (ahandle && (ahandle->proc == (caddr_t) 0)) { @@ -149,26 +157,41 @@ int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) return code; } +int +afs_osi_SleepSig(void *event) +{ + afs_osi_Sleep(event); + return 0; +} + #if defined(AFS_HPUX110_ENV) -void afs_osi_Sleep(void *event) +void +afs_osi_Sleep(void *event) { - lock_t * sleep_lock; - - AFS_ASSERT_GLOCK(); - get_sleep_lock(event); - AFS_GUNLOCK(); - sleep((caddr_t) event, PZERO-2); - AFS_GLOCK(); + lock_t *sleep_lock; + + AFS_ASSERT_GLOCK(); + get_sleep_lock(event); + AFS_GUNLOCK(); + sleep((caddr_t) event, PZERO - 2); + AFS_GLOCK(); } -int afs_osi_Wakeup(void *event) +int +afs_osi_Wakeup(void *event) { - lock_t * sleep_lock; + lock_t *sleep_lock; - sleep_lock = get_sleep_lock(event); - wakeup((caddr_t) event); - spinunlock(sleep_lock); - return 0; + sleep_lock = get_sleep_lock(event); + wakeup((caddr_t) event); + spinunlock(sleep_lock); + return 0; +} +#else +int +afs_osi_Wakeup(void *event) +{ + wakeup((caddr_t) event); + return 0; } #endif - diff --git a/src/afs/HPUX/osi_vfs.h b/src/afs/HPUX/osi_vfs.h index 43b9f2519..bfcb3bd15 100644 --- a/src/afs/HPUX/osi_vfs.h +++ b/src/afs/HPUX/osi_vfs.h @@ -6,10 +6,10 @@ /* * Flock(3) call. (from sys/file.h) */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* don't block when locking */ -#define LOCK_UN 8 /* unlock */ +#define LOCK_SH 1 /* shared lock */ +#define LOCK_EX 2 /* exclusive lock */ +#define LOCK_NB 4 /* don't block when locking */ +#define LOCK_UN 8 /* unlock */ #define d_fileno d_ino diff --git a/src/afs/HPUX/osi_vfsops.c b/src/afs/HPUX/osi_vfsops.c index 15aca3888..bd4e47af1 100644 --- a/src/afs/HPUX/osi_vfsops.c +++ b/src/afs/HPUX/osi_vfsops.c @@ -11,34 +11,77 @@ * osi_vfsops.c for HPUX */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_vfsops.c,v 1.1.1.6 2003/07/30 17:08:07 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/HPUX/osi_vfsops.c,v 1.13 2003/11/27 01:17:39 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics stuff */ #include +#if defined(AFS_HPUX1123_ENV) +#include +#endif /* AFS_HPUX1123_ENV */ + +#if defined(AFS_HPUX1123_ENV) +/* defind DLKM tables so we can load dynamicly */ +/* we still need an afs_unload to unload */ +/* Note: There is to be a dependency on the + * the name of the struct _wrapper, and the + * name of the dynamicly loaded file + * We will define -DAFS_WRAPPER=_wrapper + * and -DAFS_CONF_DATA=_conf_data and pass into + * this routine + */ + +extern struct mod_operations mod_misc_ops; +extern struct mod_conf_data AFS_CONF_DATA; + +static int afs_load(void *arg); +/* static int afs_unload(void *arg); */ + +struct mod_type_data afs_mod_link = { + "AFS kernel module", + NULL +}; + +struct modlink afs_modlink[] = { + {&mod_misc_ops, &afs_mod_link}, + { NULL, NULL } +}; + +struct modwrapper AFS_WRAPPER = { + MODREV, + afs_load, + NULL, /* should be afs_unload if we had one */ + NULL, + &AFS_CONF_DATA, + afs_modlink +}; + +#endif /* AFS_HPUX1123_ENV */ static char afs_mountpath[512]; struct vfs *afs_globalVFS = 0; struct vcache *afs_globalVp = 0; -int afs_mount(struct vfs *afsp, char *path, smountargs_t *data) +int +afs_mount(struct vfs *afsp, char *path, smountargs_t * data) { AFS_GLOCK(); AFS_STATCNT(afs_mount); - if (afs_globalVFS) { /* Don't allow remounts. */ + if (afs_globalVFS) { /* Don't allow remounts. */ AFS_GUNLOCK(); - return (setuerror(EBUSY)); + return (setuerror(EBUSY)); } afs_globalVFS = afsp; afsp->vfs_bsize = 8192; - afsp->vfs_fsid[0] = AFS_VFSMAGIC; /* magic */ - afsp->vfs_fsid[1] = AFS_VFSFSID; + afsp->vfs_fsid[0] = AFS_VFSMAGIC; /* magic */ + afsp->vfs_fsid[1] = AFS_VFSFSID; strcpy(afsp->vfs_name, "AFS"); afsp->vfs_name[3] = '\0'; @@ -47,7 +90,7 @@ int afs_mount(struct vfs *afsp, char *path, smountargs_t *data) #ifndef AFS_NONFSTRANS /* Set up the xlator in case it wasn't done elsewhere */ - afs_xlatorinit_v2(); + afs_xlatorinit_v2(); #endif AFS_GUNLOCK(); @@ -55,7 +98,8 @@ int afs_mount(struct vfs *afsp, char *path, smountargs_t *data) } -int afs_unmount(struct vfs *afsp) +int +afs_unmount(struct vfs *afsp) { AFS_GLOCK(); AFS_STATCNT(afs_unmount); @@ -65,23 +109,28 @@ int afs_unmount(struct vfs *afsp) AFS_GUNLOCK(); return 0; -} +} -int afs_root (struct vfs *afsp, struct vnode **avpp, char *unused1) +int +afs_root(struct vfs *afsp, struct vnode **avpp, char *unused1) { int code = 0; struct vrequest treq; - register struct vcache *tvp=0; + register struct vcache *tvp = 0; AFS_GLOCK(); AFS_STATCNT(afs_root); if (afs_globalVp && (afs_globalVp->states & CStatd)) { tvp = afs_globalVp; } else { - if (!(code = afs_InitReq(&treq, p_cred(u.u_procp))) && - !(code = afs_CheckInit())) { - tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); + if (afs_globalVp) { + afs_PutVCache(afs_globalVp); + afs_globalVp = NULL; + } + + if (!(code = afs_InitReq(&treq, p_cred(u.u_procp))) + && !(code = afs_CheckInit())) { + tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL); /* we really want this to stay around */ if (tvp) { afs_globalVp = tvp; @@ -102,9 +151,10 @@ int afs_root (struct vfs *afsp, struct vnode **avpp, char *unused1) AFS_GUNLOCK(); return code; -} +} -int afs_statfs(register struct vfs *afsp, struct k_statvfs *abp) +int +afs_statfs(register struct vfs *afsp, struct k_statvfs *abp) { AFS_GLOCK(); AFS_STATCNT(afs_statfs); @@ -122,25 +172,27 @@ int afs_statfs(register struct vfs *afsp, struct k_statvfs *abp) AFS_GUNLOCK(); return 0; -} +} -int afs_sync(struct vfs *unused1, int unused2) +int +afs_sync(struct vfs *unused1, int unused2) { AFS_STATCNT(afs_sync); return 0; } -int afs_vget(struct vfs *afsp, struct vnode **avcp, struct fid *fidp) +int +afs_vget(struct vfs *afsp, struct vnode **avcp, struct fid *fidp) { int code; struct vrequest treq; AFS_GLOCK(); AFS_STATCNT(afs_vget); - * avcp = NULL; + *avcp = NULL; - if ((code = afs_InitReq(&treq, p_cred(u.u_procp)))==0) { - code = afs_osi_vget((struct vcache**)avcp, fidp, &treq); + if ((code = afs_InitReq(&treq, p_cred(u.u_procp))) == 0) { + code = afs_osi_vget((struct vcache **)avcp, fidp, &treq); } afs_Trace3(afs_iclSetp, CM_TRACE_VGET, ICL_TYPE_POINTER, *avcp, @@ -149,16 +201,19 @@ int afs_vget(struct vfs *afsp, struct vnode **avcp, struct fid *fidp) AFS_GUNLOCK(); return code; -} +} -int afs_getmount(struct vfs *vfsp, char *fsmntdir, struct mount_data *mdp, char *unused1) +int +afs_getmount(struct vfs *vfsp, char *fsmntdir, struct mount_data *mdp, + char *unused1) { int l; mdp->md_msite = 0; mdp->md_dev = 0; mdp->md_rdev = 0; - return(copyoutstr(afs_mountpath, fsmntdir, strlen(afs_mountpath)+1, &l)); + return (copyoutstr + (afs_mountpath, fsmntdir, strlen(afs_mountpath) + 1, &l)); } @@ -170,29 +225,29 @@ struct vfsops Afs_vfsops = { afs_sync, afs_vget, afs_getmount, - (vfs_freeze_t *)0, /* vfs_freeze */ - (vfs_thaw_t *)0, /* vfs_thaw */ - (vfs_quota_t *)0, /* vfs_quota */ - (vfs_mountroot_t *)0, /* vfs_mountroot. Note: afs_mountroot_nullop in this - * position panicked HP 11.00+ - */ - (vfs_size_t *)0 /* vfs_size */ + (vfs_freeze_t *) 0, /* vfs_freeze */ + (vfs_thaw_t *) 0, /* vfs_thaw */ + (vfs_quota_t *) 0, /* vfs_quota */ + (vfs_mountroot_t *) 0, /* vfs_mountroot. Note: afs_mountroot_nullop in this + * position panicked HP 11.00+ + */ + (vfs_size_t *) 0 /* vfs_size */ }; static int afs_Starting = 0; #pragma align 64 -#if defined(AFS_HPUX110_ENV) -b_sema_t afs_global_sema = {0}; -#else +#if !defined(AFS_HPUX110_ENV) sema_t afs_global_sema = { - NULL, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, /* sa_type */ - 0, 0, 0, 0, 0, 0, 0, NULL, /* sa_link */ - NULL, NULL + NULL, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, /* sa_type */ + 0, 0, 0, 0, 0, 0, 0, NULL, /* sa_link */ + NULL, NULL #ifdef SEMA_COUNTING - , 0, 0, 0, NULL + , 0, 0, 0, NULL #endif - }; +}; +#else +b_sema_t afs_global_sema = { 0 }; #endif void @@ -201,14 +256,15 @@ osi_InitGlock() register ulong_t context; SPINLOCK_USAV(sched_lock, context); - if ( !afs_Starting ) { + if (!afs_Starting) { afs_Starting = 1; SPINUNLOCK_USAV(sched_lock, context); #if defined(AFS_HPUX110_ENV) - b_initsema(&afs_global_sema, 1, NFS_LOCK_ORDER2, "AFS GLOCK"); + b_initsema(&afs_global_sema, 1, NFS_LOCK_ORDER2, "AFS GLOCK"); + /* afsHash(64); *//* 64 buckets */ #else initsema(&afs_global_sema, 1, FILESYS_SEMA_PRI, FILESYS_SEMA_ORDER); - afsHash(64); /* 64 buckets */ + afsHash(64); /* 64 buckets */ #endif } else { SPINUNLOCK_USAV(sched_lock, context); @@ -218,10 +274,20 @@ osi_InitGlock() } } +#if defined(AFS_HPUX1123_ENV) +/* DLKM routine called when loaded */ +static int +afs_load(void *arg) +{ + afsc_link(); + return 0; +} +#endif /* AFS_HPUX1123_ENV */ + /* * afsc_link - Initialize VFS */ -int afs_vfs_slot=-1; +int afs_vfs_slot = -1; afsc_link() @@ -230,10 +296,11 @@ afsc_link() /* For now nothing special is required during AFS initialization. */ AFS_STATCNT(afsc_link); - osi_Init(); - if ( (afs_vfs_slot=add_vfs_type("afs", &Afs_vfsops)) < 0 ) + osi_Init(); + if ((afs_vfs_slot = add_vfs_type("afs", &Afs_vfsops)) < 0) return; - sysent_assign_function(AFS_SYSCALL, 7, (void (*)())Afs_syscall, "Afs_syscall"); + sysent_assign_function(AFS_SYSCALL, 7, (void (*)())Afs_syscall, + "Afs_syscall"); sysent_define_arg(AFS_SYSCALL, 0, longArg); sysent_define_arg(AFS_SYSCALL, 1, longArg); sysent_define_arg(AFS_SYSCALL, 2, longArg); @@ -250,4 +317,3 @@ afsc_link() sysent_returns_long(80); return 0; } - diff --git a/src/afs/HPUX/osi_vm.c b/src/afs/HPUX/osi_vm.c index 16d247c36..d3651fe79 100644 --- a/src/afs/HPUX/osi_vm.c +++ b/src/afs/HPUX/osi_vm.c @@ -8,13 +8,14 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_vm.c,v 1.1.1.5 2002/05/10 23:43:52 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/HPUX/osi_vm.c,v 1.8 2003/07/15 23:14:22 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ /* Try to discard pages, in order to recycle a vcache entry. * @@ -31,9 +32,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_vm.c,v 1.1.1.5 2002/05/10 * therefore obsolescent. */ int -osi_VM_FlushVCache(avc, slept) - struct vcache *avc; - int *slept; +osi_VM_FlushVCache(struct vcache *avc, int *slept) { if (avc->vrefCount > 1) return EBUSY; @@ -50,10 +49,9 @@ osi_VM_FlushVCache(avc, slept) * re-obtained. */ void -osi_VM_StoreAllSegments(avc) - struct vcache *avc; +osi_VM_StoreAllSegments(struct vcache *avc) { - ; /* Nothing here yet */ + ; /* Nothing here yet */ } /* Try to invalidate pages, for "fs flush" or "fs flushv"; or @@ -63,10 +61,7 @@ osi_VM_StoreAllSegments(avc) * re-obtained. */ void -osi_VM_TryToSmush(avc, acred, sync) - struct vcache *avc; - struct AFS_UCRED *acred; - int sync; +osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync) { struct vnode *vp = AFSTOV(avc); @@ -74,7 +69,7 @@ osi_VM_TryToSmush(avc, acred, sync) * from the buffer cache */ if ((vp->v_flag & VTEXT) == 0) { - mpurge(vp); + mpurge(vp); } /* Mark the cached blocks on the free list as invalid; it invalidates blocks * associated with vp which are on the freelist. @@ -88,11 +83,9 @@ osi_VM_TryToSmush(avc, acred, sync) * Locking: No lock is held, not even the global lock. */ void -osi_VM_FlushPages(avc, credp) - struct vcache *avc; - struct AFS_UCRED *credp; +osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) { - ; /* Nothing here yet */ + ; /* Nothing here yet */ } /* Purge pages beyond end-of-file, when truncating a file. @@ -102,10 +95,7 @@ osi_VM_FlushPages(avc, credp) * it only works on Solaris. */ void -osi_VM_Truncate(avc, alen, acred) - struct vcache *avc; - int alen; - struct AFS_UCRED *acred; +osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) { - ; /* Nothing here yet */ + ; /* Nothing here yet */ } diff --git a/src/afs/HPUX/osi_vnodeops.c b/src/afs/HPUX/osi_vnodeops.c index b579afcbc..16dbf73dd 100644 --- a/src/afs/HPUX/osi_vnodeops.c +++ b/src/afs/HPUX/osi_vnodeops.c @@ -10,13 +10,14 @@ /* This is a placeholder for routines unique to the port of AFS to hp-ux*/ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/HPUX/osi_vnodeops.c,v 1.1.1.8 2003/07/30 17:08:08 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/HPUX/osi_vnodeops.c,v 1.13 2003/11/27 01:17:39 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics stuff */ #include #include @@ -61,7 +62,6 @@ extern int afs_close(); #define vmemp_unlockx() #endif - #if !defined(AFS_HPUX110_ENV) /* * Copy an mbuf to the contiguous area pointed to by cp. @@ -71,39 +71,39 @@ extern int afs_close(); */ int m_cpytoc(m, off, len, cp) - register struct mbuf *m; - register int off, len; - register caddr_t cp; + register struct mbuf *m; + register int off, len; + register caddr_t cp; { - register int ml; - - if (m == NULL || off < 0 || len < 0 || cp == NULL) - osi_Panic("m_cpytoc"); - while (off && m) - if (m->m_len <= off) { - off -= m->m_len; - m = m->m_next; - continue; - } else - break; - if (m == NULL) - return (len); - - ml = MIN(len, m->m_len - off); - memcpy(cp, mtod(m, caddr_t)+off, (u_int)ml); + register int ml; + + if (m == NULL || off < 0 || len < 0 || cp == NULL) + osi_Panic("m_cpytoc"); + while (off && m) + if (m->m_len <= off) { + off -= m->m_len; + m = m->m_next; + continue; + } else + break; + if (m == NULL) + return (len); + + ml = MIN(len, m->m_len - off); + memcpy(cp, mtod(m, caddr_t) + off, (u_int) ml); + cp += ml; + len -= ml; + m = m->m_next; + + while (len && m) { + ml = m->m_len; + memcpy(cp, mtod(m, caddr_t), (u_int) ml); cp += ml; len -= ml; m = m->m_next; + } - while (len && m) { - ml = m->m_len; - memcpy(cp, mtod(m, caddr_t), (u_int)ml); - cp += ml; - len -= ml; - m = m->m_next; - } - - return (len); + return (len); } #endif @@ -115,14 +115,14 @@ m_cpytoc(m, off, len, cp) * fcntl() looking request, and then translate the results back if necessary. * we call afs_lockctl() directly . */ -afs_lockf( vp, flag, len, cred, fp, LB, UB ) - struct vnode *vp; - int flag; - struct AFS_UCRED *cred; - struct file *fp; - k_off_t len, LB, UB; +afs_lockf(vp, flag, len, cred, fp, LB, UB) + struct vnode *vp; + int flag; + struct AFS_UCRED *cred; + struct file *fp; + k_off_t len, LB, UB; { - /*for now, just pretend it works*/ + /*for now, just pretend it works */ struct k_flock flock; int cmd, code; @@ -134,7 +134,7 @@ afs_lockf( vp, flag, len, cred, fp, LB, UB ) flock.l_len = len; flock.l_start = fp->f_offset; /* convert negative lengths to positive */ - if (flock.l_len < 0 ) { + if (flock.l_len < 0) { flock.l_start += flock.l_len; flock.l_len = -(flock.l_len); } @@ -147,19 +147,19 @@ afs_lockf( vp, flag, len, cred, fp, LB, UB ) flock.l_type = F_WRLCK; cmd = F_SETLK; switch (flag) { - case F_ULOCK: + case F_ULOCK: flock.l_type = F_UNLCK; break; - case F_LOCK: + case F_LOCK: cmd = F_SETLKW; break; - case F_TEST: + case F_TEST: cmd = F_GETLK; break; } - u.u_error = mp_afs_lockctl(vp, &flock, cmd, fp->f_cred); + u.u_error = mp_afs_lockctl(vp, &flock, cmd, fp->f_cred); if (u.u_error) { - return(u.u_error); /* some other error code */ + return (u.u_error); /* some other error code */ } /* * if request is F_TEST, and GETLK changed @@ -175,28 +175,37 @@ afs_lockf( vp, flag, len, cred, fp, LB, UB ) #if defined(AFS_HPUX1122_ENV) -#include "../machine/vm/vmparam.h" +#include "machine/vm/vmparam.h" #else -#include "../machine/vmparam.h" /* For KERNELSPACE */ +#include "../machine/vmparam.h" /* For KERNELSPACE */ +#endif +#include "h/debug.h" +#include "h/types.h" +#if !defined(AFS_HPUX1123_ENV) + /* 11.23 is using 64 bit in many cases */ +#define kern_daddr_t daddr_t #endif -#include "../h/debug.h" -#include "../h/types.h" -#include "../h/param.h" -#include "../h/vmmac.h" -#include "../h/time.h" -#include "../ufs/inode.h" -#include "../ufs/fs.h" -#include "../h/dbd.h" -#include "../h/vfd.h" -#include "../h/region.h" -#include "../h/pregion.h" -#include "../h/vmmeter.h" -#include "../h/user.h" -#include "../h/sysinfo.h" -#include "../h/pfdat.h" -#include "../h/tuneable.h" -#include "../h/buf.h" -#include "../netinet/in.h" +#include "h/param.h" +#include "h/vmmac.h" +#include "h/time.h" +#include "ufs/inode.h" +#include "ufs/fs.h" +#include "h/dbd.h" +#if defined(AFS_HPUX1123_ENV) +dbd_t *finddbd(); +#endif /* AFS_HPUX1123_ENV */ +#include "h/vfd.h" +#include "h/region.h" +#include "h/pregion.h" +#include "h/vmmeter.h" +#include "h/user.h" +#include "h/sysinfo.h" +#include "h/pfdat.h" +#if !defined(AFS_HPUX1123_ENV) +#include "h/tuneable.h" +#endif +#include "h/buf.h" +#include "netinet/in.h" /* a freelist of one */ struct buf *afs_bread_freebp = 0; @@ -206,58 +215,57 @@ struct buf *afs_bread_freebp = 0; * Thus we can use fake bufs (ie not from the real buffer pool). */ afs_bread(vp, lbn, bpp) - struct vnode *vp; - daddr_t lbn; - struct buf **bpp; + struct vnode *vp; + kern_daddr_t lbn; + struct buf **bpp; { - int offset, fsbsize, error; - struct buf *bp; - struct iovec iov; - struct uio uio; - - AFS_STATCNT(afs_bread); - fsbsize = vp->v_vfsp->vfs_bsize; - offset = lbn * fsbsize; - if (afs_bread_freebp) { - bp = afs_bread_freebp; - afs_bread_freebp = 0; - } else { - bp = (struct buf *) AFS_KALLOC(sizeof(*bp)); - bp->b_un.b_addr = (caddr_t) AFS_KALLOC(fsbsize); - } + int offset, fsbsize, error; + struct buf *bp; + struct iovec iov; + struct uio uio; + + AFS_STATCNT(afs_bread); + fsbsize = vp->v_vfsp->vfs_bsize; + offset = lbn * fsbsize; + if (afs_bread_freebp) { + bp = afs_bread_freebp; + afs_bread_freebp = 0; + } else { + bp = (struct buf *)AFS_KALLOC(sizeof(*bp)); + bp->b_un.b_addr = (caddr_t) AFS_KALLOC(fsbsize); + } - iov.iov_base = bp->b_un.b_addr; - iov.iov_len = fsbsize; - uio.afsio_iov = &iov; - uio.afsio_iovcnt = 1; - uio.afsio_seg = AFS_UIOSYS; - uio.afsio_offset = offset; - uio.afsio_resid = fsbsize; - uio.uio_fpflags = 0; - *bpp = 0; - - error = afs_read(VTOAFS(vp), &uio, p_cred(u.u_procp), - lbn, bpp, 0); - if (error) { - afs_bread_freebp = bp; - return error; - } - if (*bpp) { - afs_bread_freebp = bp; - } else { - *(struct buf **)&bp->b_vp = bp; /* mark as fake */ - *bpp = bp; - } - return 0; + iov.iov_base = bp->b_un.b_addr; + iov.iov_len = fsbsize; + uio.afsio_iov = &iov; + uio.afsio_iovcnt = 1; + uio.afsio_seg = AFS_UIOSYS; + uio.afsio_offset = offset; + uio.afsio_resid = fsbsize; + uio.uio_fpflags = 0; + *bpp = 0; + + error = afs_read(VTOAFS(vp), &uio, p_cred(u.u_procp), lbn, bpp, 0); + if (error) { + afs_bread_freebp = bp; + return error; + } + if (*bpp) { + afs_bread_freebp = bp; + } else { + *(struct buf **)&bp->b_vp = bp; /* mark as fake */ + *bpp = bp; + } + return 0; } afs_brelse(vp, bp) -struct vnode *vp; -struct buf *bp; + struct vnode *vp; + struct buf *bp; { AFS_STATCNT(afs_brelse); - if ((struct buf *)bp->b_vp != bp) { /* not fake */ + if ((struct buf *)bp->b_vp != bp) { /* not fake */ ufs_brelse(bp->b_vp, bp); } else if (afs_bread_freebp) { AFS_KFREE(bp->b_un.b_addr, vp->v_vfsp->vfs_bsize); @@ -269,42 +277,45 @@ struct buf *bp; afs_bmap(avc, abn, anvp, anbn) - register struct vcache *avc; - afs_int32 abn, *anbn; - struct vcache **anvp; { + register struct vcache *avc; + kern_daddr_t abn, *anbn; + struct vcache **anvp; +{ AFS_STATCNT(afs_bmap); if (anvp) *anvp = avc; if (anbn) - *anbn = abn * (8192 / DEV_BSIZE); /* in 512 byte units */ + *anbn = abn * (8192 / DEV_BSIZE); /* in 512 byte units */ return 0; } afs_inactive(avc, acred) - register struct vcache *avc; - struct AFS_UCRED *acred; + register struct vcache *avc; + struct AFS_UCRED *acred; { struct vnode *vp = AFSTOV(avc); ulong_t context; lock_t *sv_lock; - if (afs_shuttingdown) return ; + if (afs_shuttingdown) + return; /* * In Solaris and HPUX s800 and HP-UX10.0 they actually call us with * v_count 1 on last reference! */ - MP_H_SPINLOCK_USAV(vn_h_sl_pool,vp,&sv_lock,&context); - if (avc->vrefCount < 1) osi_Panic("afs_inactive : v_count < 1\n"); + MP_H_SPINLOCK_USAV(vn_h_sl_pool, vp, &sv_lock, &context); + if (avc->vrefCount < 1) + osi_Panic("afs_inactive : v_count < 1\n"); /* * If more than 1 don't unmap the vnode but do decrement the ref count */ vp->v_count--; if (vp->v_count > 0) { - MP_SPINUNLOCK_USAV(sv_lock,context); + MP_SPINUNLOCK_USAV(sv_lock, context); return 0; } - MP_SPINUNLOCK_USAV(sv_lock,context); + MP_SPINUNLOCK_USAV(sv_lock, context); afs_InactiveVCache(avc, acred); return 0; } @@ -333,7 +344,8 @@ mp_afs_close(register struct vnode *avcp, int aflags, struct AFS_UCRED *acred) } int -mp_afs_rdwr(register struct vnode *avcp, struct uio *uio, enum uio_rw arw, int aio, struct AFS_UCRED *acred) +mp_afs_rdwr(register struct vnode *avcp, struct uio *uio, enum uio_rw arw, + int aio, struct AFS_UCRED *acred) { register int code; long save_resid; @@ -350,7 +362,8 @@ mp_afs_rdwr(register struct vnode *avcp, struct uio *uio, enum uio_rw arw, int a } int -mp_afs_getattr(register struct vnode *avcp, struct vattr *attrs, struct AFS_UCRED *acred, enum vsync unused1) +mp_afs_getattr(register struct vnode *avcp, struct vattr *attrs, + struct AFS_UCRED *acred, enum vsync unused1) { register int code; @@ -361,7 +374,8 @@ mp_afs_getattr(register struct vnode *avcp, struct vattr *attrs, struct AFS_UCRE } int -mp_afs_setattr(register struct vnode *avcp, register struct vattr *attrs, struct AFS_UCRED *acred, int unused1) +mp_afs_setattr(register struct vnode *avcp, register struct vattr *attrs, + struct AFS_UCRED *acred, int unused1) { register int code; @@ -383,7 +397,9 @@ mp_afs_access(register struct vnode *avcp, int mode, struct AFS_UCRED *acred) } int -mp_afs_lookup(register struct vnode *adp, char *aname, register struct vnode **avcp, struct AFS_UCRED *acred, struct vnode *unused1) +mp_afs_lookup(register struct vnode *adp, char *aname, + register struct vnode **avcp, struct AFS_UCRED *acred, + struct vnode *unused1) { register int code; @@ -394,7 +410,9 @@ mp_afs_lookup(register struct vnode *adp, char *aname, register struct vnode **a } int -mp_afs_create(register struct vnode *adp, char *aname, struct vattr *attrs, enum vcexcl aexcl, int amode, struct vnode **avcp, struct AFS_UCRED *acred) +mp_afs_create(register struct vnode *adp, char *aname, struct vattr *attrs, + enum vcexcl aexcl, int amode, struct vnode **avcp, + struct AFS_UCRED *acred) { register int code; @@ -406,7 +424,8 @@ mp_afs_create(register struct vnode *adp, char *aname, struct vattr *attrs, enum int -mp_afs_remove(register struct vnode *adp, char *aname, struct AFS_UCRED *acred) +mp_afs_remove(register struct vnode *adp, char *aname, + struct AFS_UCRED *acred) { register int code; @@ -417,7 +436,8 @@ mp_afs_remove(register struct vnode *adp, char *aname, struct AFS_UCRED *acred) } int -mp_afs_link(register struct vnode *avc, register struct vnode *adp, char *aname, struct AFS_UCRED *acred) +mp_afs_link(register struct vnode *avc, register struct vnode *adp, + char *aname, struct AFS_UCRED *acred) { register int code; @@ -428,7 +448,9 @@ mp_afs_link(register struct vnode *avc, register struct vnode *adp, char *aname, } int -mp_afs_rename(register struct vnode *aodp, char *aname1, register struct vnode *andp, char *aname2, struct AFS_UCRED *acred) +mp_afs_rename(register struct vnode *aodp, char *aname1, + register struct vnode *andp, char *aname2, + struct AFS_UCRED *acred) { register int code; @@ -439,7 +461,8 @@ mp_afs_rename(register struct vnode *aodp, char *aname1, register struct vnode * } int -mp_afs_mkdir(register struct vnode *adp, char *aname, struct vattr *attrs, register struct vnode **avcp, struct AFS_UCRED *acred) +mp_afs_mkdir(register struct vnode *adp, char *aname, struct vattr *attrs, + register struct vnode **avcp, struct AFS_UCRED *acred) { register int code; @@ -463,18 +486,20 @@ mp_afs_rmdir(register struct vnode *adp, char *aname, struct AFS_UCRED *acred) int -mp_afs_readdir(register struct vnode *avc, struct uio *auio, struct AFS_UCRED *acred) +mp_afs_readdir(register struct vnode *avc, struct uio *auio, + struct AFS_UCRED *acred) { register int code; AFS_GLOCK(); code = afs_readdir(avc, auio, acred); AFS_GUNLOCK(); - return (code); + return (code); } int -mp_afs_symlink(register struct vnode *adp, char *aname, struct vattr *attrs, char *atargetName, struct AFS_UCRED *acred) +mp_afs_symlink(register struct vnode *adp, char *aname, struct vattr *attrs, + char *atargetName, struct AFS_UCRED *acred) { register int code; @@ -486,7 +511,8 @@ mp_afs_symlink(register struct vnode *adp, char *aname, struct vattr *attrs, cha int -mp_afs_readlink(register struct vnode *avc, struct uio *auio, struct AFS_UCRED *acred) +mp_afs_readlink(register struct vnode *avc, struct uio *auio, + struct AFS_UCRED *acred) { register int code; @@ -508,7 +534,8 @@ mp_afs_fsync(register struct vnode *avc, struct AFS_UCRED *acred, int unused1) } int -mp_afs_bread(register struct vnode *avc, daddr_t lbn, struct buf **bpp, struct vattr *unused1, struct ucred *unused2) +mp_afs_bread(register struct vnode *avc, kern_daddr_t lbn, struct buf **bpp, + struct vattr *unused1, struct ucred *unused2) { register int code; @@ -542,7 +569,9 @@ mp_afs_inactive(register struct vnode *avc, struct AFS_UCRED *acred) } int -mp_afs_lockctl(struct vnode *avc, struct flock *af, int cmd, struct AFS_UCRED *acred, struct file *unused1, off_t unused2, off_t unused3) +mp_afs_lockctl(struct vnode *avc, struct flock *af, int cmd, + struct AFS_UCRED *acred, struct file *unused1, off_t unused2, + off_t unused3) { register int code; @@ -562,8 +591,10 @@ mp_afs_fid(struct vnode *avc, struct fid **fidpp) AFS_GUNLOCK(); return (code); } + int -mp_afs_readdir2(register struct vnode *avc, struct uio *auio, struct AFS_UCRED *acred) +mp_afs_readdir2(register struct vnode *avc, struct uio *auio, + struct AFS_UCRED *acred) { register int code; @@ -575,66 +606,66 @@ mp_afs_readdir2(register struct vnode *avc, struct uio *auio, struct AFS_UCRED * struct vnodeops Afs_vnodeops = { - mp_afs_open, - mp_afs_close, - mp_afs_rdwr, - afs_ioctl, - afs_noop, - mp_afs_getattr, - mp_afs_setattr, - mp_afs_access, - mp_afs_lookup, - mp_afs_create, - mp_afs_remove, - mp_afs_link, - mp_afs_rename, - mp_afs_mkdir, - mp_afs_rmdir, - afs_readdir, - mp_afs_symlink, - mp_afs_readlink, - mp_afs_fsync, - mp_afs_inactive, - afs_bmap, - afs_hp_strategy, + mp_afs_open, + mp_afs_close, + mp_afs_rdwr, + afs_ioctl, + afs_noop, + mp_afs_getattr, + mp_afs_setattr, + mp_afs_access, + mp_afs_lookup, + mp_afs_create, + mp_afs_remove, + mp_afs_link, + mp_afs_rename, + mp_afs_mkdir, + mp_afs_rmdir, + afs_readdir, + mp_afs_symlink, + mp_afs_readlink, + mp_afs_fsync, + mp_afs_inactive, + afs_bmap, + afs_hp_strategy, #if !defined(AFS_NONFSTRANS) - /* on HPUX102 the nfs translator calls afs_bread but does - * not call afs_brelse. Hence we see a memory leak. If the - * VOP_BREAD() call fails, then nfs does VOP_RDWR() to get - * the same data : this is the path we follow now. */ - afs_noop, - afs_noop, + /* on HPUX102 the nfs translator calls afs_bread but does + * not call afs_brelse. Hence we see a memory leak. If the + * VOP_BREAD() call fails, then nfs does VOP_RDWR() to get + * the same data : this is the path we follow now. */ + afs_noop, + afs_noop, #else - mp_afs_bread, - mp_afs_brelse, + mp_afs_bread, + mp_afs_brelse, #endif - afs_badop, /* pathsend */ - afs_noop, /* setacl */ - afs_noop, /* getacl */ - afs_pathconf, - afs_pathconf, - mp_afs_lockctl, - afs_lockf, /* lockf */ - mp_afs_fid, - afs_noop, /*fsctl */ - afs_badop, - afs_pagein, - afs_pageout, - NULL, - NULL, - afs_prealloc, - afs_mapdbd, - afs_mmap, - afs_cachelimit, - afs_vm_checkpage, - afs_vm_fscontiguous, - afs_vm_stopio, - afs_read_ahead , - afs_release, - afs_unmap, - afs_swapfs_len, - mp_afs_readdir2, - afs_readdir3, + afs_badop, /* pathsend */ + afs_noop, /* setacl */ + afs_noop, /* getacl */ + afs_pathconf, + afs_pathconf, + mp_afs_lockctl, + afs_lockf, /* lockf */ + mp_afs_fid, + afs_noop, /*fsctl */ + afs_badop, + afs_pagein, + afs_pageout, + NULL, + NULL, + afs_prealloc, + afs_mapdbd, + afs_mmap, + afs_cachelimit, + afs_vm_checkpage, + afs_vm_fscontiguous, + afs_vm_stopio, + afs_read_ahead, + afs_release, + afs_unmap, + afs_swapfs_len, + mp_afs_readdir2, + afs_readdir3, }; struct vnodeops *afs_ops = &Afs_vnodeops; @@ -662,133 +693,130 @@ struct fileops afs_fileops = { ******************************************************************** */ pgcnt_t -afspgin_setup_io_ranges( - vfspage_t *vm_info, - pgcnt_t bpages, - k_off_t isize, - pgcnt_t startindex) +afspgin_setup_io_ranges(vfspage_t * vm_info, pgcnt_t bpages, k_off_t isize, + pgcnt_t startindex) { - pgcnt_t file_offset = VM_FILE_OFFSET(vm_info); - pgcnt_t minpage; /* first page to bring in */ - pgcnt_t maxpage; /* one past last page to bring in */ - pgcnt_t maxpagein; - pgcnt_t multio_maxpage; - daddr_t start_blk; - dbd_t *dbd; - expnd_flags_t up_reason, down_reason; - int count = 1; - int indx = 0; - int max_num_io; - int dbdtype; - preg_t *prp; - - VM_GET_IO_INFO(vm_info, maxpagein, max_num_io); - - /* - * We do not go past the end of the current pregion nor past the end - * of the current file. - */ - - maxpage = startindex + (bpages - (startindex+file_offset) % bpages); - maxpage = vm_reset_maxpage(vm_info, maxpage); - maxpage = MIN(maxpage, (pgcnt_t)btorp(isize) - file_offset); - maxpage = MIN(maxpage, startindex + maxpagein); - multio_maxpage = maxpage = vm_maxpage(vm_info, maxpage); - - if (!maxpage) - return (0); - - VASSERT(maxpage >= startindex); - - /* - * Expanding the fault will create calls to FINDENTRY() for new - * pages, which will obsolete "dbd", so copy what it points to - * and clear it to prevent using stale data. - */ - - prp = VM_PRP(vm_info); - dbdtype = DBD_TYPE(vm_info); - start_blk = DBD_DATA(vm_info); - vm_info->dbd = NULL; - vm_info->vfd = NULL; - VASSERT(dbdtype != DBD_NONE); - - if (max_num_io == 1) { - /* - * We need to set up one I/O: First we attempt to expand the - * I/O forward. Then we expand the I/O backwards. - */ - count = expand_faultin_up(vm_info, dbdtype, (int)bpages, - maxpage, count, startindex, - start_blk, &up_reason); - maxpage = startindex + count; - VASSERT(maxpage <= startindex + maxpagein); - minpage = startindex - (startindex+file_offset) % bpages; - minpage = MAX(minpage, maxpage - maxpagein); - VASSERT(startindex >= VM_BASE_OFFSET(vm_info)); - minpage = vm_minpage(vm_info, minpage); - VASSERT(minpage <= startindex); - count = expand_faultin_down(vm_info, dbdtype, (int)bpages, - minpage, count, &startindex, - &start_blk, &down_reason); - VM_SET_IO_STARTINDX(vm_info, 0, startindex); - VM_SET_IO_STARTBLK(vm_info, 0, start_blk); - VM_SET_IO_COUNT(vm_info, 0, count); - VM_SET_NUM_IO(vm_info, 1); - } - - if (max_num_io > 1) { - /* - * We need to set up multiple I/O information; beginning - * with the startindex, we will expand upwards. The expansion - * could stop for one of 2 reasons; we take the appropriate - * action in each of these cases: - * o VM reasons: abort setting up the multiple I/O - * information and return to our caller indicating - * that "retry" is required. - * o pagelimit: set up the next I/O info [we may have - * reached multio_maxpage at this point]. - * Note that expansion involves no more than a block at a time; - * hence it could never stop due to "discontiguous block" - * reason. - */ - startindex = minpage = vm_minpage(vm_info, 0); - for (indx = 0; - (indx < max_num_io) && (startindex < multio_maxpage); - indx++, startindex +=count) { - dbd = FINDDBD(prp->p_reg, startindex); - start_blk = dbd->dbd_data; - maxpage = startindex + - (bpages - (startindex+file_offset) % bpages); - maxpage = min(maxpage, multio_maxpage); - count = expand_faultin_up(vm_info, dbdtype, - bpages, maxpage, 1 /* count */, - startindex, start_blk, &up_reason); - VM_SET_IO_STARTINDX(vm_info, indx, startindex); - VM_SET_IO_STARTBLK(vm_info, indx, start_blk); - VM_SET_IO_COUNT(vm_info, indx, count); - if (up_reason & VM_REASONS) - break; - VASSERT(!(up_reason&NONCONTIGUOUS_BLOCK)); - VASSERT(up_reason & PAGELIMIT); - } - if (startindex < multio_maxpage) { - VM_MULT_IO_FAILURE(vm_info); - VM_REINIT_FAULT_DBDVFD(vm_info); - return (0); /* retry */ - } - count = maxpagein; - VM_SET_NUM_IO(vm_info, indx); - } - - /* - * Tell VM where the I/O intends to start. This may be different - * from the faulting point. - */ - - VM_SET_STARTINDX(vm_info, VM_GET_IO_STARTINDX(vm_info, 0)); - - return(count); + pgcnt_t file_offset = VM_FILE_OFFSET(vm_info); + pgcnt_t minpage; /* first page to bring in */ + pgcnt_t maxpage; /* one past last page to bring in */ + pgcnt_t maxpagein; + pgcnt_t multio_maxpage; + kern_daddr_t start_blk; + dbd_t *dbd; + expnd_flags_t up_reason, down_reason; + int count = 1; + int indx = 0; + int max_num_io; + int dbdtype; + preg_t *prp; + + VM_GET_IO_INFO(vm_info, maxpagein, max_num_io); + + /* + * We do not go past the end of the current pregion nor past the end + * of the current file. + */ + + maxpage = startindex + (bpages - (startindex + file_offset) % bpages); + maxpage = vm_reset_maxpage(vm_info, maxpage); + maxpage = MIN(maxpage, (pgcnt_t) btorp(isize) - file_offset); + maxpage = MIN(maxpage, startindex + maxpagein); + multio_maxpage = maxpage = vm_maxpage(vm_info, maxpage); + + if (!maxpage) + return (0); + + VASSERT(maxpage >= startindex); + + /* + * Expanding the fault will create calls to FINDENTRY() for new + * pages, which will obsolete "dbd", so copy what it points to + * and clear it to prevent using stale data. + */ + + prp = VM_PRP(vm_info); + dbdtype = DBD_TYPE(vm_info); + start_blk = DBD_DATA(vm_info); + vm_info->dbd = NULL; + vm_info->vfd = NULL; + VASSERT(dbdtype != DBD_NONE); + + if (max_num_io == 1) { + /* + * We need to set up one I/O: First we attempt to expand the + * I/O forward. Then we expand the I/O backwards. + */ + count = + expand_faultin_up(vm_info, dbdtype, (int)bpages, maxpage, count, + startindex, start_blk, &up_reason); + maxpage = startindex + count; + VASSERT(maxpage <= startindex + maxpagein); + minpage = startindex - (startindex + file_offset) % bpages; + minpage = MAX(minpage, maxpage - maxpagein); + VASSERT(startindex >= VM_BASE_OFFSET(vm_info)); + minpage = vm_minpage(vm_info, minpage); + VASSERT(minpage <= startindex); + count = + expand_faultin_down(vm_info, dbdtype, (int)bpages, minpage, count, + &startindex, &start_blk, &down_reason); + VM_SET_IO_STARTINDX(vm_info, 0, startindex); + VM_SET_IO_STARTBLK(vm_info, 0, start_blk); + VM_SET_IO_COUNT(vm_info, 0, count); + VM_SET_NUM_IO(vm_info, 1); + } + + if (max_num_io > 1) { + /* + * We need to set up multiple I/O information; beginning + * with the startindex, we will expand upwards. The expansion + * could stop for one of 2 reasons; we take the appropriate + * action in each of these cases: + * o VM reasons: abort setting up the multiple I/O + * information and return to our caller indicating + * that "retry" is required. + * o pagelimit: set up the next I/O info [we may have + * reached multio_maxpage at this point]. + * Note that expansion involves no more than a block at a time; + * hence it could never stop due to "discontiguous block" + * reason. + */ + startindex = minpage = vm_minpage(vm_info, 0); + for (indx = 0; (indx < max_num_io) && (startindex < multio_maxpage); + indx++, startindex += count) { + dbd = FINDDBD(prp->p_reg, startindex); + start_blk = dbd->dbd_data; + maxpage = + startindex + (bpages - (startindex + file_offset) % bpages); + maxpage = min(maxpage, multio_maxpage); + count = + expand_faultin_up(vm_info, dbdtype, bpages, maxpage, + 1 /* count */ , + startindex, start_blk, &up_reason); + VM_SET_IO_STARTINDX(vm_info, indx, startindex); + VM_SET_IO_STARTBLK(vm_info, indx, start_blk); + VM_SET_IO_COUNT(vm_info, indx, count); + if (up_reason & VM_REASONS) + break; + VASSERT(!(up_reason & NONCONTIGUOUS_BLOCK)); + VASSERT(up_reason & PAGELIMIT); + } + if (startindex < multio_maxpage) { + VM_MULT_IO_FAILURE(vm_info); + VM_REINIT_FAULT_DBDVFD(vm_info); + return (0); /* retry */ + } + count = maxpagein; + VM_SET_NUM_IO(vm_info, indx); + } + + /* + * Tell VM where the I/O intends to start. This may be different + * from the faulting point. + */ + + VM_SET_STARTINDX(vm_info, VM_GET_IO_STARTINDX(vm_info, 0)); + + return (count); } @@ -800,39 +828,36 @@ afspgin_setup_io_ranges( ******************************************************************** */ retval_t -afspgin_blkflsh ( - vfspage_t *vm_info, - struct vnode *devvp, - pgcnt_t *num_4k) +afspgin_blkflsh(vfspage_t * vm_info, struct vnode * devvp, pgcnt_t * num_4k) { - int flush_reslt = 0; - pgcnt_t count = *num_4k; - pgcnt_t page_count; - int indx = 0; - int num_io = VM_GET_NUM_IO(vm_info); - - /* - * On this blkflush() we don't want to purge the buffer cache and we do - * want to wait, so the flags are '0'. - */ - - for (indx = 0; indx < num_io; indx++) { - flush_reslt = blkflush(devvp, - (daddr_t)VM_GET_IO_STARTBLK(vm_info, indx), - ptob(VM_GET_IO_COUNT(vm_info, indx)), - 0, VM_REGION(vm_info)); - if (flush_reslt) { - vm_lock(vm_info); - if (vm_page_now_valid(vm_info, &page_count)) { - vm_release_memory(vm_info); - vm_release_structs(vm_info); - *num_4k = page_count; - return(VM_PAGE_PRESENT); - } - return (VM_RETRY); - } - } - return (VM_DONE); + int flush_reslt = 0; + pgcnt_t count = *num_4k; + pgcnt_t page_count; + int indx = 0; + int num_io = VM_GET_NUM_IO(vm_info); + + /* + * On this blkflush() we don't want to purge the buffer cache and we do + * want to wait, so the flags are '0'. + */ + + for (indx = 0; indx < num_io; indx++) { + flush_reslt = + blkflush(devvp, (kern_daddr_t) VM_GET_IO_STARTBLK(vm_info, indx), + ptob(VM_GET_IO_COUNT(vm_info, indx)), 0, + VM_REGION(vm_info)); + if (flush_reslt) { + vm_lock(vm_info); + if (vm_page_now_valid(vm_info, &page_count)) { + vm_release_memory(vm_info); + vm_release_structs(vm_info); + *num_4k = page_count; + return (VM_PAGE_PRESENT); + } + return (VM_RETRY); + } + } + return (VM_DONE); } /* @@ -843,104 +868,96 @@ afspgin_blkflsh ( ******************************************************************** */ int -afspgin_io( - vfspage_t *vm_info, - struct vnode *devvp, - pgcnt_t bpages, - pgcnt_t maxpagein, - pgcnt_t count) +afspgin_io(vfspage_t * vm_info, struct vnode *devvp, pgcnt_t bpages, + pgcnt_t maxpagein, pgcnt_t count) { - int i; - int error = 0; - caddr_t vaddr = VM_ADDR(vm_info); - caddr_t virt_addr = VM_MAPPED_ADDR(vm_info); - pagein_info_t *io = VM_PAGEIN_INFO(vm_info); - preg_t *prp = VM_PRP(vm_info); - int wrt = VM_WRT(vm_info); - space_t space = VM_SPACE(vm_info); - int num_io = VM_GET_NUM_IO(vm_info); - -#ifdef notdef /* Not used in AFS */ - /* - * With VM_READ_AHEAD_ALLOWED() macro, check if read-ahead should - * be used in this case. - * - * Unlike UFS, NFS does not start the faulting page I/O - * asynchronously. Why? Asynchronous requests are handled by the - * biod's. It doesn't make sense to queue up the faulting request - * behind other asynchrnous requests. This is not true for UFS - * where the asynchrnous request is immediately handled. - */ - - if ((VM_READ_AHEAD_ALLOWED(vm_info)) && - (nfs_read_ahead_on) && - (NFS_DO_READ_AHEAD) && - (should_do_read_ahead(prp, vaddr))) { - - pgcnt_t max_rhead_io; - caddr_t rhead_vaddr; - pgcnt_t total_rheads_allowed; - - /* - * Determine the maximum amount of read-ahead I/O. - */ - total_rheads_allowed = maxpagein - count ; - - /* - * If the count is less than a block, raise it to one. - */ - if (total_rheads_allowed < bpages) - total_rheads_allowed = bpages; - - max_rhead_io = total_rheads_allowed; - rhead_vaddr = VM_MAPPED_ADDR(vm_info) + (count*NBPG); - error = nfs_read_ahead(vm_info->vp, prp, wrt, space, - rhead_vaddr, &max_rhead_io); - - /* - * Set the next fault location. If read_ahead launches any - * I/O it will adjust it accordingly. - */ - vm_info->prp->p_nextfault = vm_info->startindex + count; - - /* - * Now perform the faulting I/O synchronously. - */ - vm_unlock(vm_info); - - error = syncpageio((swblk_t)VM_GET_IO_STARTBLK(vm_info, 0), - VM_MAPPED_SPACE(vm_info), - VM_MAPPED_ADDR(vm_info), - (int)ptob(count), B_READ, devvp, - B_vfs_pagein|B_pagebf, VM_REGION(vm_info)); - } else + int i; + int error = 0; + caddr_t vaddr = VM_ADDR(vm_info); + caddr_t virt_addr = VM_MAPPED_ADDR(vm_info); + pagein_info_t *io = VM_PAGEIN_INFO(vm_info); + preg_t *prp = VM_PRP(vm_info); + int wrt = VM_WRT(vm_info); + space_t space = VM_SPACE(vm_info); + int num_io = VM_GET_NUM_IO(vm_info); + +#ifdef notdef /* Not used in AFS */ + /* + * With VM_READ_AHEAD_ALLOWED() macro, check if read-ahead should + * be used in this case. + * + * Unlike UFS, NFS does not start the faulting page I/O + * asynchronously. Why? Asynchronous requests are handled by the + * biod's. It doesn't make sense to queue up the faulting request + * behind other asynchrnous requests. This is not true for UFS + * where the asynchrnous request is immediately handled. + */ + + if ((VM_READ_AHEAD_ALLOWED(vm_info)) && (nfs_read_ahead_on) + && (NFS_DO_READ_AHEAD) && (should_do_read_ahead(prp, vaddr))) { + + pgcnt_t max_rhead_io; + caddr_t rhead_vaddr; + pgcnt_t total_rheads_allowed; + + /* + * Determine the maximum amount of read-ahead I/O. + */ + total_rheads_allowed = maxpagein - count; + + /* + * If the count is less than a block, raise it to one. + */ + if (total_rheads_allowed < bpages) + total_rheads_allowed = bpages; + + max_rhead_io = total_rheads_allowed; + rhead_vaddr = VM_MAPPED_ADDR(vm_info) + (count * NBPG); + error = + nfs_read_ahead(vm_info->vp, prp, wrt, space, rhead_vaddr, + &max_rhead_io); + + /* + * Set the next fault location. If read_ahead launches any + * I/O it will adjust it accordingly. + */ + vm_info->prp->p_nextfault = vm_info->startindex + count; + + /* + * Now perform the faulting I/O synchronously. + */ + vm_unlock(vm_info); + + error = + syncpageio((swblk_t) VM_GET_IO_STARTBLK(vm_info, 0), + VM_MAPPED_SPACE(vm_info), VM_MAPPED_ADDR(vm_info), + (int)ptob(count), B_READ, devvp, + B_vfs_pagein | B_pagebf, VM_REGION(vm_info)); + } else #endif - { - virt_addr = VM_MAPPED_ADDR(vm_info); - vm_unlock(vm_info); - for (i = 0; i < num_io; i++) { - /* - * REVISIT -- investigate doing asyncpageio(). - */ - error |= (io[i].error = - syncpageio( - (swblk_t)VM_GET_IO_STARTBLK(vm_info, i), - VM_MAPPED_SPACE(vm_info), - virt_addr, - (int)ptob(VM_GET_IO_COUNT(vm_info, i)), - B_READ, devvp, - B_vfs_pagein|B_pagebf, - VM_REGION(vm_info))); - virt_addr += ptob(VM_GET_IO_COUNT(vm_info, i)); - } - /* - * Set the next fault location. If read_ahead launches any - * I/O it will adjust it accordingly. - */ - vm_info->prp->p_nextfault = vm_info->startindex + count; - } - - return (error); + { + virt_addr = VM_MAPPED_ADDR(vm_info); + vm_unlock(vm_info); + for (i = 0; i < num_io; i++) { + /* + * REVISIT -- investigate doing asyncpageio(). + */ + error |= (io[i].error = + syncpageio((swblk_t) VM_GET_IO_STARTBLK(vm_info, i), + VM_MAPPED_SPACE(vm_info), virt_addr, + (int)ptob(VM_GET_IO_COUNT(vm_info, i)), + B_READ, devvp, B_vfs_pagein | B_pagebf, + VM_REGION(vm_info))); + virt_addr += ptob(VM_GET_IO_COUNT(vm_info, i)); + } + /* + * Set the next fault location. If read_ahead launches any + * I/O it will adjust it accordingly. + */ + vm_info->prp->p_nextfault = vm_info->startindex + count; + } + + return (error); } /* @@ -951,91 +968,90 @@ afspgin_io( ******************************************************************** */ void -afspgin_update_dbd( - vfspage_t *vm_info, - int bsize) +afspgin_update_dbd(vfspage_t * vm_info, int bsize) { - k_off_t off; - pgcnt_t count = bsize / NBPG; - k_off_t rem; - pgcnt_t m; - pgcnt_t pgindx; - daddr_t blkno; - int num_io = VM_GET_NUM_IO(vm_info); - int i; - - for (i = 0; i < num_io; i++) { - - pgindx = VM_GET_IO_STARTINDX(vm_info, i); - off = vnodindx(VM_REGION(vm_info), pgindx); - rem = off % bsize; - blkno = VM_GET_IO_STARTBLK(vm_info, i); - - VASSERT(bsize % NBPG == 0); - VASSERT(rem % NBPG == 0); - - pgindx -= (pgcnt_t)btop(rem); - blkno -= (daddr_t)btodb(rem); - - /* - * This region could start in mid-block. If so, pgindx - * could be less than 0, so we adjust pgindx and blkno back - * up so that pgindx is 0. - */ - - if (pgindx < 0) { - pgcnt_t prem; - prem = 0 - pgindx; - pgindx = 0; - count -= prem; - blkno += btodb(ptob(prem)); - } - - for (m = 0; m < count && pgindx < VM_REGION_SIZE(vm_info); - m++, pgindx++, blkno += btodb(NBPG)) { - /* - * Note: since this only changes one block, it - * assumes only one block was faulted in. Currently - * this is always true for remote files, and we only - * get here for remote files, so everything is ok. - */ - vm_mark_dbd(vm_info, pgindx, blkno); - } - } + k_off_t off; + pgcnt_t count = bsize / NBPG; + k_off_t rem; + pgcnt_t m; + pgcnt_t pgindx; + kern_daddr_t blkno; + int num_io = VM_GET_NUM_IO(vm_info); + int i; + + for (i = 0; i < num_io; i++) { + + pgindx = VM_GET_IO_STARTINDX(vm_info, i); + off = vnodindx(VM_REGION(vm_info), pgindx); + rem = off % bsize; + blkno = VM_GET_IO_STARTBLK(vm_info, i); + + VASSERT(bsize % NBPG == 0); + VASSERT(rem % NBPG == 0); + + pgindx -= (pgcnt_t) btop(rem); + blkno -= (kern_daddr_t) btodb(rem); + + /* + * This region could start in mid-block. If so, pgindx + * could be less than 0, so we adjust pgindx and blkno back + * up so that pgindx is 0. + */ + + if (pgindx < 0) { + pgcnt_t prem; + prem = 0 - pgindx; + pgindx = 0; + count -= prem; + blkno += btodb(ptob(prem)); + } + + for (m = 0; m < count && pgindx < VM_REGION_SIZE(vm_info); + m++, pgindx++, blkno += btodb(NBPG)) { + /* + * Note: since this only changes one block, it + * assumes only one block was faulted in. Currently + * this is always true for remote files, and we only + * get here for remote files, so everything is ok. + */ + vm_mark_dbd(vm_info, pgindx, blkno); + } + } } -int afs_pagein(vp, prp, wrt, space, vaddr, ret_startindex) - struct vnode *vp; - preg_t *prp; - int wrt; - space_t space; - caddr_t vaddr; - pgcnt_t *ret_startindex; +int +afs_pagein(vp, prp, wrt, space, vaddr, ret_startindex) + struct vnode *vp; + preg_t *prp; + int wrt; + space_t space; + caddr_t vaddr; + pgcnt_t *ret_startindex; { - pgcnt_t startindex; - pgcnt_t pgindx = *ret_startindex; - pgcnt_t maxpagein; - struct vnode *devvp; - pgcnt_t count; - daddr_t start_blk=0; - int bsize; - int error; - k_off_t isize; - int shared; /* writable memory mapped file */ - retval_t retval = 0; - pgcnt_t ok_dbd_limit = 0; /* last dbd that we can trust */ - pgcnt_t bpages; /* number of pages per block */ - pgcnt_t page_count; - vfspage_t* vm_info=NULL; - int done; + pgcnt_t startindex; + pgcnt_t pgindx = *ret_startindex; + pgcnt_t maxpagein; + struct vnode *devvp; + pgcnt_t count; + kern_daddr_t start_blk = 0; + int bsize; + int error; + k_off_t isize; + int shared; /* writable memory mapped file */ + retval_t retval = 0; + pgcnt_t ok_dbd_limit = 0; /* last dbd that we can trust */ + pgcnt_t bpages; /* number of pages per block */ + pgcnt_t page_count; + vfspage_t *vm_info = NULL; + int done; struct vattr va; - caddr_t nvaddr; - space_t nspace; - int change_to_fstore = 0; /* need to change dbds to DBD_FSTORE */ - int flush_start_blk = 0; - int flush_end_blk = 0; + caddr_t nvaddr; + space_t nspace; + int change_to_fstore = 0; /* need to change dbds to DBD_FSTORE */ + int flush_start_blk = 0; + int flush_end_blk = 0; int i, j; @@ -1043,13 +1059,14 @@ int afs_pagein(vp, prp, wrt, space, vaddr, ret_startindex) vmemp_lockx(); /* lock down VM empire */ /* Initialize the VM info structure */ - done = vm_pagein_init(&vm_info, prp, pgindx, space, vaddr, wrt, 0, - LGPG_ENABLE); + done = + vm_pagein_init(&vm_info, prp, pgindx, space, vaddr, wrt, 0, + LGPG_ENABLE); /* Check to see if we slept and the page was falted in. */ if (done) { - vm_release_structs(vm_info); - vmemp_returnx(1); + vm_release_structs(vm_info); + vmemp_returnx(1); } vp = VM_GET_PAGEIN_VNODE(vm_info); @@ -1065,22 +1082,22 @@ int afs_pagein(vp, prp, wrt, space, vaddr, ret_startindex) if (bsize <= 0 || (bsize & (DEV_BSIZE - 1))) osi_Panic("afs_pagein: bsize is zero or not a multiple of DEV_BSIZE"); - bpages = (pgcnt_t)btop(bsize); + bpages = (pgcnt_t) btop(bsize); VASSERT(bpages > 0); VM_SET_FS_MAX_PAGES(vm_info, bpages); /* this trace cannot be here because the afs_global lock might not be - held at this point. We hold the vm global lock throughout - this procedure ( and not the AFS global lock ) - afs_Trace4(afs_iclSetp, CM_TRACE_HPPAGEIN, ICL_TYPE_POINTER, (afs_int32) vp, - ICL_TYPE_LONG, DBD_TYPE(vm_info), ICL_TYPE_LONG, bpages, - ICL_TYPE_LONG, shared); - */ + * held at this point. We hold the vm global lock throughout + * this procedure ( and not the AFS global lock ) + * afs_Trace4(afs_iclSetp, CM_TRACE_HPPAGEIN, ICL_TYPE_POINTER, (afs_int32) vp, + * ICL_TYPE_LONG, DBD_TYPE(vm_info), ICL_TYPE_LONG, bpages, + * ICL_TYPE_LONG, shared); + */ /* Come here if we have to release the region lock before * locking pages. This can happen in memreserve() and * blkflush(). */ -retry: + retry: /* * For remote files like ours, we want to check to see if the file has shrunk. * If so, we should invalidate any pages past the end. In the name @@ -1088,47 +1105,46 @@ retry: * past the end of the file. */ { - if (VOP_GETATTR(vp, &va, kt_cred(u.u_kthreadp), VIFSYNC) != 0) { - VM_ZOMBIE_OBJECT(vm_info); - vm_release_memory(vm_info); - vm_release_structs(vm_info); - vmemp_returnx(0); - } - isize = va.va_size; - if (vnodindx(VM_REGION(vm_info), pgindx) >= isize) { - /* - * The file has shrunk and someone is trying to access a - * page past the end of the object. Shrink the object back - * to its currrent size, send a SIGBUS to the faulting - * process and return. - * - * We must release the region lock before calling mtrunc(), - * since mtrunc() locks all the regions that are using this - * file. - */ - vm_release_memory(vm_info); - vm_truncate_region(vm_info, isize); - vm_release_structs(vm_info); - vmemp_returnx(-SIGBUS); - } + if (VOP_GETATTR(vp, &va, kt_cred(u.u_kthreadp), VIFSYNC) != 0) { + VM_ZOMBIE_OBJECT(vm_info); + vm_release_memory(vm_info); + vm_release_structs(vm_info); + vmemp_returnx(0); + } + isize = va.va_size; + if (vnodindx(VM_REGION(vm_info), pgindx) >= isize) { + /* + * The file has shrunk and someone is trying to access a + * page past the end of the object. Shrink the object back + * to its currrent size, send a SIGBUS to the faulting + * process and return. + * + * We must release the region lock before calling mtrunc(), + * since mtrunc() locks all the regions that are using this + * file. + */ + vm_release_memory(vm_info); + vm_truncate_region(vm_info, isize); + vm_release_structs(vm_info); + vmemp_returnx(-SIGBUS); + } } maxpagein = vm_pick_maxpagein(vm_info); if (vm_wait_for_memory(vm_info, maxpagein, 1)) { - /* Check to see if we should continue faulting. */ - if (vm_page_now_valid(vm_info, &page_count)) { - vm_release_memory(vm_info); - vm_release_structs(vm_info); - vmemp_returnx(page_count); - } + /* Check to see if we should continue faulting. */ + if (vm_page_now_valid(vm_info, &page_count)) { + vm_release_memory(vm_info); + vm_release_structs(vm_info); + vmemp_returnx(page_count); + } } if (count = vm_no_io_required(vm_info)) { - /* Release any excess memory. */ - vm_release_memory(vm_info); - vm_release_structs(vm_info); - vmemp_returnx(count); + /* Release any excess memory. */ + vm_release_memory(vm_info); + vm_release_structs(vm_info); + vmemp_returnx(count); } - #ifdef OSDEBUG /* * We should never have DBD_HOLE pages in a non-MMF region. @@ -1136,51 +1152,51 @@ retry: if (!shared) VASSERT(dbd->dbd_type != DBD_HOLE); #endif - VASSERT( DBD_TYPE(vm_info) != DBD_NONE); + VASSERT(DBD_TYPE(vm_info) != DBD_NONE); startindex = *ret_startindex; /* * If the page we want is in memory already, take it */ - if (VM_MEMORY_RESERVED(vm_info) < maxpagein) - { - /* pick up the rest of memory now. */ - if (vm_wait_for_memory(vm_info, maxpagein, 0)) { - if (vm_page_now_valid(vm_info, &page_count)) { - vm_release_memory(vm_info); - vm_release_structs(vm_info); - vmemp_returnx(page_count); - } - goto retry; - } + if (VM_MEMORY_RESERVED(vm_info) < maxpagein) { + /* pick up the rest of memory now. */ + if (vm_wait_for_memory(vm_info, maxpagein, 0)) { + if (vm_page_now_valid(vm_info, &page_count)) { + vm_release_memory(vm_info); + vm_release_structs(vm_info); + vmemp_returnx(page_count); + } + goto retry; + } } - if (!(count = afspgin_setup_io_ranges(vm_info, bpages, isize, - startindex))) { - goto retry; + if (! + (count = + afspgin_setup_io_ranges(vm_info, bpages, isize, startindex))) { + goto retry; } startindex = VM_GET_STARTINDX(vm_info); VASSERT(maxpagein >= count); - + /* * Release the memory we won't need. */ if (count < maxpagein) { - vm_release_excess_memory(vm_info, - (VM_MEMORY_RESERVED(vm_info) - count)); - } + vm_release_excess_memory(vm_info, + (VM_MEMORY_RESERVED(vm_info) - count)); + } retval = afspgin_blkflsh(vm_info, devvp, &count); - + if (retval == VM_RETRY) { - goto retry; + goto retry; } if (retval == VM_PAGE_PRESENT) - return (count); + return (count); #if 0 /* @@ -1192,9 +1208,9 @@ retry: /* It's a real fault, not a reclaim */ { - krusage_cntr_t *temp; - temp = kt_cntrp(u.u_kthreadp); - temp->krc_majflt++; + krusage_cntr_t *temp; + temp = kt_cntrp(u.u_kthreadp); + temp->krc_majflt++; } #endif @@ -1213,26 +1229,26 @@ retry: * Count may have been adjusted, check to make sure it's non-zero. */ if (count == 0) { - if (vm_retry(vm_info)) { - goto retry; - } - - /* - * Release resources and retry the fault. Release any excess - * memory. - */ - - vm_release_memory(vm_info); - vm_release_structs(vm_info); - vmemp_returnx(0); + if (vm_retry(vm_info)) { + goto retry; + } + + /* + * Release resources and retry the fault. Release any excess + * memory. + */ + + vm_release_memory(vm_info); + vm_release_structs(vm_info); + vmemp_returnx(0); } error = afspgin_io(vm_info, devvp, bpages, maxpagein, count); if ((VM_IS_ZOMBIE(vm_info)) || (error)) { - retval = -SIGBUS; - VM_ZOMBIE_OBJECT(vm_info); - goto backout; + retval = -SIGBUS; + VM_ZOMBIE_OBJECT(vm_info); + goto backout; } /* * For a writable memory mapped file that is remote we must @@ -1241,63 +1257,63 @@ retry: * no easy way to do this, so this gets a little ugly. */ if (shared && wrt) { - /* - * See if The user wants to write to this page. Write some - * minimal amount of data back to the remote file to - * force allocation of file space. We only need to - * write a small amount, since holes are always at - * least one filesystem block in size. - */ - error = vm_alloc_hole(vm_info); - - /* - * If some sort of I/O error occurred we generate a - * SIGBUS for the process that caused the write, - * undo our page locks, etc and return. - */ - if ((VM_IS_ZOMBIE(vm_info)) || (error)) { - VM_ZOMBIE_OBJECT(vm_info); - retval = -SIGBUS; - goto backout; - } - - /* - * Change these dbds to DBD_FSTORE. We cannot do it here, - * since the region must be locked, and it is not locked - * at the moment. We cannot lock the region yet, as we - * first have to release the page locks. - */ - change_to_fstore = 1; + /* + * See if The user wants to write to this page. Write some + * minimal amount of data back to the remote file to + * force allocation of file space. We only need to + * write a small amount, since holes are always at + * least one filesystem block in size. + */ + error = vm_alloc_hole(vm_info); + + /* + * If some sort of I/O error occurred we generate a + * SIGBUS for the process that caused the write, + * undo our page locks, etc and return. + */ + if ((VM_IS_ZOMBIE(vm_info)) || (error)) { + VM_ZOMBIE_OBJECT(vm_info); + retval = -SIGBUS; + goto backout; + } + + /* + * Change these dbds to DBD_FSTORE. We cannot do it here, + * since the region must be locked, and it is not locked + * at the moment. We cannot lock the region yet, as we + * first have to release the page locks. + */ + change_to_fstore = 1; } vm_finish_io(vm_info, count); - + /* * Acquire the lock before we play around with changing the vfd's. */ vm_lock(vm_info); if (change_to_fstore) - afspgin_update_dbd(vm_info, bsize); - + afspgin_update_dbd(vm_info, bsize); + #if defined(AFS_HPUX110_ENV) - getppdp()->cnt.v_exfod += count; + getppdp()->cnt.v_exfod += count; #else mpproc_info[getprocindex()].cnt.v_exfod += count; #endif - vmemp_unlockx(); /* free up VM empire */ + vmemp_unlockx(); /* free up VM empire */ *ret_startindex = startindex; - + /* * In case we have any excess memory... */ if (VM_MEMORY_RESERVED(vm_info)) - vm_release_memory(vm_info); + vm_release_memory(vm_info); vm_release_structs(vm_info); - + return count; -backout: + backout: vm_finish_io_failed(vm_info, count); @@ -1309,20 +1325,20 @@ backout: * In case we have any excess memory... */ if (VM_MEMORY_RESERVED(vm_info)) - vm_release_memory(vm_info); + vm_release_memory(vm_info); vm_release_structs(vm_info); - vmemp_unlockx(); /* free up VM empire */ + vmemp_unlockx(); /* free up VM empire */ return retval; } int -afs_pageout(vp,prp, start, end, flags) - struct vnode *vp; /* not used */ - preg_t *prp; - pgcnt_t start; - pgcnt_t end; - int flags; +afs_pageout(vp, prp, start, end, flags) + struct vnode *vp; /* not used */ + preg_t *prp; + pgcnt_t start; + pgcnt_t end; + int flags; { struct vnode *filevp; struct vnode *devvp; @@ -1330,7 +1346,7 @@ afs_pageout(vp,prp, start, end, flags) int steal; int vhand; int hard; - int *piocnt; /* wakeup counter used if PAGEOUT_WAIT */ + int *piocnt; /* wakeup counter used if PAGEOUT_WAIT */ struct ucred *old_cred; vfspage_t vm_info; fsdata_t args; @@ -1340,10 +1356,10 @@ afs_pageout(vp,prp, start, end, flags) struct inode *ip; AFS_STATCNT(afs_pageout); - + steal = (flags & PAGEOUT_FREE); vhand = (flags & PAGEOUT_VHAND); - hard = (flags & PAGEOUT_HARD); + hard = (flags & PAGEOUT_HARD); vmemp_lockx(); @@ -1357,7 +1373,7 @@ afs_pageout(vp,prp, start, end, flags) */ if (vm_no_pageout(&vm_info)) { vmemp_unlockx(); - return(0); + return (0); } /* @@ -1365,10 +1381,10 @@ afs_pageout(vp,prp, start, end, flags) */ vm_setup_wait_for_io(&vm_info); - filevp = VM_GET_PAGEOUT_VNODE(&vm_info); /* always page out to back store */ + filevp = VM_GET_PAGEOUT_VNODE(&vm_info); /* always page out to back store */ VASSERT(filevp != NULL); - memset((caddr_t)&args, 0, sizeof(fsdata_t)); + memset((caddr_t) & args, 0, sizeof(fsdata_t)); args.remote_down = 0; /* assume remote file servers are up */ args.remote = 1; /* we are remote */ args.bsize = 0; /* filled up later by afs_vm_checkpage() */ @@ -1377,8 +1393,7 @@ afs_pageout(vp,prp, start, end, flags) ip = VTOI(filevp); devvp = ip->i_devvp; file_is_remote = 0; - } - else { + } else { file_is_remote = 1; devvp = filevp; @@ -1389,8 +1404,8 @@ afs_pageout(vp,prp, start, end, flags) * of dirty NFS pages until a future time. */ #ifdef notdef - if (vhand && filevp->v_fstype == VNFS && - vtomi(filevp)->mi_down && vtomi(filevp)->mi_hard) { + if (vhand && filevp->v_fstype == VNFS && vtomi(filevp)->mi_down + && vtomi(filevp)->mi_hard) { extern afs_int32 vhand_nfs_retry; /* * If there is still time left on our timer, we will @@ -1407,14 +1422,14 @@ afs_pageout(vp,prp, start, end, flags) * it must get the file size and other attributes if it comes across * a dirty page. */ - vm_info.fs_data = (caddr_t)&args; + vm_info.fs_data = (caddr_t) & args; /* this trace cannot be here because the afs_global lock might not be - held at this point. We hold the vm global lock throughout - this procedure ( and not the AFS global lock ) - afs_Trace4(afs_iclSetp, CM_TRACE_HPPAGEOUT, ICL_TYPE_POINTER, (afs_int32) filevp, - ICL_TYPE_LONG, start, ICL_TYPE_LONG, end, ICL_TYPE_LONG, flags); - */ + * held at this point. We hold the vm global lock throughout + * this procedure ( and not the AFS global lock ) + * afs_Trace4(afs_iclSetp, CM_TRACE_HPPAGEOUT, ICL_TYPE_POINTER, (afs_int32) filevp, + * ICL_TYPE_LONG, start, ICL_TYPE_LONG, end, ICL_TYPE_LONG, flags); + */ i = start; @@ -1429,37 +1444,37 @@ afs_pageout(vp,prp, start, end, flags) space_t nspace; caddr_t nvaddr; - /* - * Ask the VM system to find the next run of pages. - */ - vm_find_next_range(&vm_info, i, end); - - /* - * It's possible that the remote file shrunk in size. Check the flags - * to see if the request was beyond the end of the file. If it was, - * truncate the region to the file size and continue. We could be on a - * run so after trunction continue, there may be some I/O to write - * out. - */ - if (VM_FS_FLAGS(&vm_info) & PAGEOUT_TRUNCATE) { - pgcnt_t pglen = (pgcnt_t)btorp(args.isize); - - /* - * This page is past the end of the file. Unlock this page - * (region_trunc will throw it away) and then call - * region_trunc() to invalidate all pages past the new end of - * the file. - */ - region_trunc(VM_REGION(&vm_info), pglen, pglen + 1); - - /* - * remove the truncation flag. - */ - VM_UNSETFS_FLAGS(&vm_info, PAGEOUT_TRUNCATE); - } - - if (VM_NO_PAGEOUT_RUN(&vm_info)) - break; + /* + * Ask the VM system to find the next run of pages. + */ + vm_find_next_range(&vm_info, i, end); + + /* + * It's possible that the remote file shrunk in size. Check the flags + * to see if the request was beyond the end of the file. If it was, + * truncate the region to the file size and continue. We could be on a + * run so after trunction continue, there may be some I/O to write + * out. + */ + if (VM_FS_FLAGS(&vm_info) & PAGEOUT_TRUNCATE) { + pgcnt_t pglen = (pgcnt_t) btorp(args.isize); + + /* + * This page is past the end of the file. Unlock this page + * (region_trunc will throw it away) and then call + * region_trunc() to invalidate all pages past the new end of + * the file. + */ + region_trunc(VM_REGION(&vm_info), pglen, pglen + 1); + + /* + * remove the truncation flag. + */ + VM_UNSETFS_FLAGS(&vm_info, PAGEOUT_TRUNCATE); + } + + if (VM_NO_PAGEOUT_RUN(&vm_info)) + break; /* * We have a run of dirty pages [args.start...args.end]. @@ -1468,31 +1483,32 @@ afs_pageout(vp,prp, start, end, flags) VASSERT((filevp->v_vfsp->vfs_flag & VFS_RDONLY) == 0); VASSERT(VM_GET_NUM_IO(&vm_info) == 1); - /* - * We will be doing an I/O on the region, let the VM system know. - */ - (void)vm_up_physio_count(&vm_info); + /* + * We will be doing an I/O on the region, let the VM system know. + */ + (void)vm_up_physio_count(&vm_info); /* * Okay, get set to perform the I/O. */ inode_changed = 1; - npages = (VM_END_PAGEOUT_INDX(&vm_info) + 1) - - VM_START_PAGEOUT_INDX(&vm_info); + npages = + (VM_END_PAGEOUT_INDX(&vm_info) + 1) - + VM_START_PAGEOUT_INDX(&vm_info); /* * Allocate and initialize an I/O buffer. */ bp = bswalloc(); - vm_init_bp(&vm_info, bp); /* Let the VM system initialize */ + vm_init_bp(&vm_info, bp); /* Let the VM system initialize */ - /* Identify this buffer for KI */ - bp->b_bptype = B_vfs_pageout|B_pagebf; + /* Identify this buffer for KI */ + bp->b_bptype = B_vfs_pageout | B_pagebf; if (steal) - bp->b_flags = B_CALL|B_BUSY|B_PAGEOUT; /* steal pages */ + bp->b_flags = B_CALL | B_BUSY | B_PAGEOUT; /* steal pages */ else - bp->b_flags = B_CALL|B_BUSY; /* keep pages */ + bp->b_flags = B_CALL | B_BUSY; /* keep pages */ /* * If we are vhand paging over NFS, we will wait for the I/O @@ -1535,32 +1551,31 @@ afs_pageout(vp,prp, start, end, flags) nbytes = roundup(args.isize - start, DEV_BSIZE); } - /* - * Now get ready to perform the I/O - */ - if (!vm_protect_pageout(&vm_info, npages)) - { - VASSERT(vhand); - vm_undo_invalidation(&vm_info, vm_info.start, vm_info.end); - vm_finish_io_failed(&vm_info, npages); - bswfree(bp); - break; - } - /* - * If this is an NFS write by vhand(), we will not be calling - * pageiodone(). asyncpageio() increments parolemem for us - * if bp->b_iodone is pageiodone, so we must do it manually - * if pageiodone() will not be called automatically. - */ - if (!(bp->b_flags & B_CALL) && steal) { - register ulong_t context; - - SPINLOCK_USAV(pfdat_lock, context); - parolemem += btorp(nbytes); - SPINUNLOCK_USAV(pfdat_lock, context); - } - blkflush(devvp, VM_START_PAGEOUT_BLK(&vm_info), (long)nbytes, - (BX_NOBUFWAIT|BX_PURGE), VM_REGION(&vm_info)); + /* + * Now get ready to perform the I/O + */ + if (!vm_protect_pageout(&vm_info, npages)) { + VASSERT(vhand); + vm_undo_invalidation(&vm_info, vm_info.start, vm_info.end); + vm_finish_io_failed(&vm_info, npages); + bswfree(bp); + break; + } + /* + * If this is an NFS write by vhand(), we will not be calling + * pageiodone(). asyncpageio() increments parolemem for us + * if bp->b_iodone is pageiodone, so we must do it manually + * if pageiodone() will not be called automatically. + */ + if (!(bp->b_flags & B_CALL) && steal) { + register ulong_t context; + + SPINLOCK_USAV(pfdat_lock, context); + parolemem += btorp(nbytes); + SPINUNLOCK_USAV(pfdat_lock, context); + } + blkflush(devvp, VM_START_PAGEOUT_BLK(&vm_info), (long)nbytes, + (BX_NOBUFWAIT | BX_PURGE), VM_REGION(&vm_info)); /* * If vhand is the one paging things out, and this is an NFS @@ -1573,64 +1588,76 @@ afs_pageout(vp,prp, start, end, flags) * value in the vas (this should be fixed in 10.0). */ old_cred = kt_cred(u.u_kthreadp); - if (vhand) { - set_kt_cred(u.u_kthreadp, filevp->v_vas->va_cred); - - /* - * If root was the one who opened the mmf for write, - * va_cred will be NULL. So reset kt_cred(u.u_kthreadp) to what it - * was. We will page out as root, but that is the - * correct thing to do in this case anyway. - */ - if (kt_cred(u.u_kthreadp) == NULL) - set_kt_cred(u.u_kthreadp, old_cred); - } + if (vhand) { +#if defined(AFS_HPUX1123_ENV) + /* + * DEE - 1123 does not have the vas.h, and it looks + * we should never be called with a NFS type file anyway. + * so where did this come from? Was it copied from NFS? + * I assume it was, so we will add an assert for now + * and see if the code runs at all. + */ + VASSERT(filevp->v_fstype != VNFS); +#else + set_kt_cred(u.u_kthreadp, filevp->v_vas->va_cred); + + /* + * If root was the one who opened the mmf for write, + * va_cred will be NULL. So reset kt_cred(u.u_kthreadp) to what it + * was. We will page out as root, but that is the + * correct thing to do in this case anyway. + */ + if (kt_cred(u.u_kthreadp) == NULL) + set_kt_cred(u.u_kthreadp, old_cred); +#endif + } /* * Really do the I/O. */ - error = asyncpageio(bp, VM_START_PAGEOUT_BLK(&vm_info), - VM_MAPPED_SPACE(&vm_info), VM_MAPPED_ADDR(&vm_info), + error = + asyncpageio(bp, VM_START_PAGEOUT_BLK(&vm_info), + VM_MAPPED_SPACE(&vm_info), VM_MAPPED_ADDR(&vm_info), (int)nbytes, B_WRITE, devvp); VASSERT(error == 0); #ifdef notdef - /* - * If we are vhand paging over NFS we want to wait for the - * I/O to complete and take the appropriate actions if an - * error is encountered. - */ - if (vhand) { - if (waitforpageio(bp) && nfs_mi_harddown(filevp)) { - /* - * The server is down, ignore this failure, and - * try again later. (rfscall() has set our retry - * timer). - */ - fsdata.remote_down = 1; - pageiocleanup(bp, 0); - - /* - * vm_vfdcheck() has cleared the valid bit on the - * vfds for these pages. We must go back and set the - * valid bit, as the pages are really not gone. - * - * NOTE: we can do this because we still hold (and have - * not released) the region lock. - */ - if (steal) - vm_undo_invalidation(&vm_info, vm_info.start, vm_info.end); - } - else { - /* - * The I/O succeeded, or we had an error that we do - * not want to defer until later. Call pageidone() - * to handle things. - */ - pageiodone(bp); - } - } + /* + * If we are vhand paging over NFS we want to wait for the + * I/O to complete and take the appropriate actions if an + * error is encountered. + */ + if (vhand) { + if (waitforpageio(bp) && nfs_mi_harddown(filevp)) { + /* + * The server is down, ignore this failure, and + * try again later. (rfscall() has set our retry + * timer). + */ + fsdata.remote_down = 1; + pageiocleanup(bp, 0); + + /* + * vm_vfdcheck() has cleared the valid bit on the + * vfds for these pages. We must go back and set the + * valid bit, as the pages are really not gone. + * + * NOTE: we can do this because we still hold (and have + * not released) the region lock. + */ + if (steal) + vm_undo_invalidation(&vm_info, vm_info.start, + vm_info.end); + } else { + /* + * The I/O succeeded, or we had an error that we do + * not want to defer until later. Call pageidone() + * to handle things. + */ + pageiodone(bp); + } + } #endif /* @@ -1658,8 +1685,7 @@ afs_pageout(vp,prp, start, end, flags) mpproc_info[getprocindex()].cnt.v_pswpout += npages; #endif /* sar_bswapout += ptod(npages);*/ - } - else if (vhand) { + } else if (vhand) { #if defined(AFS_HPUX110_ENV) getppdp()->cnt.v_pgout++; getppdp()->cnt.v_pgpgout += npages; @@ -1674,13 +1700,13 @@ afs_pageout(vp,prp, start, end, flags) * If time and patience have delivered enough * pages, then quit now while we are ahead. */ - if (VM_STOP_PAGING(&vm_info)) - break; + if (VM_STOP_PAGING(&vm_info)) + break; i = VM_END_PAGEOUT_INDX(&vm_info) - VM_BASE_OFFSET(&vm_info) + 1; } - vm_finish_pageout(&vm_info); /* update vhand's stealscan */ + vm_finish_pageout(&vm_info); /* update vhand's stealscan */ vmemp_unlockx(); @@ -1692,7 +1718,7 @@ afs_pageout(vp,prp, start, end, flags) vm_wait_for_io(&vm_info); if (inode_changed && !file_is_remote) { - imark(ip, IUPD|ICHG); + imark(ip, IUPD | ICHG); iupdat(ip, 0, 0); } return 0; @@ -1701,42 +1727,42 @@ afs_pageout(vp,prp, start, end, flags) int afs_mapdbd(filevp, offset, bn, flags, hole, startidx, endidx) struct vnode *filevp; - off_t offset; - daddr_t *bn; /* Block number. */ - int flags; /* B_READ or B_WRITE */ - int *hole; /* To be used for read-ahead. */ - pgcnt_t *startidx; /* To be used for read-ahead. */ - pgcnt_t *endidx; /* To be used for read-ahead. */ + off_t offset; + kern_daddr_t *bn; /* Block number. */ + int flags; /* B_READ or B_WRITE */ + int *hole; /* To be used for read-ahead. */ + pgcnt_t *startidx; /* To be used for read-ahead. */ + pgcnt_t *endidx; /* To be used for read-ahead. */ { - daddr_t lbn, local_bn; - int on; - int err; - long bsize = vtoblksz(filevp) & ~(DEV_BSIZE - 1); - - if (startidx) - *startidx = (pgcnt_t)(offset/NBPG); - if (endidx) - *endidx = (pgcnt_t)(offset/NBPG); - if (hole) - *hole = 0; /* Can't have holes. */ - if (bsize <= 0 ) - osi_Panic("afs_mapdbd: zero size"); - - lbn = (daddr_t)(offset / bsize); - on = offset % bsize; - - err = VOP_BMAP(filevp, lbn, NULL, &local_bn, flags); - VASSERT(err == 0); - - /* - * We can never get a bn less than zero on remote files. - */ - VASSERT(local_bn >= 0); - - local_bn = local_bn + btodb(on); - *bn = local_bn; - - return(0); + kern_daddr_t lbn, local_bn; + int on; + int err; + long bsize = vtoblksz(filevp) & ~(DEV_BSIZE - 1); + + if (startidx) + *startidx = (pgcnt_t) (offset / NBPG); + if (endidx) + *endidx = (pgcnt_t) (offset / NBPG); + if (hole) + *hole = 0; /* Can't have holes. */ + if (bsize <= 0) + osi_Panic("afs_mapdbd: zero size"); + + lbn = (kern_daddr_t) (offset / bsize); + on = offset % bsize; + + err = VOP_BMAP(filevp, lbn, NULL, &local_bn, flags); + VASSERT(err == 0); + + /* + * We can never get a bn less than zero on remote files. + */ + VASSERT(local_bn >= 0); + + local_bn = local_bn + btodb(on); + *bn = local_bn; + + return (0); } /* @@ -1747,14 +1773,14 @@ afs_mapdbd(filevp, offset, bn, flags, hole, startidx, endidx) int afs_vm_fscontiguous(vp, args, cur_data) struct vnode *vp; - vfspage_t *args; - u_int cur_data; + vfspage_t *args; + u_int cur_data; { - if (cur_data == (VM_END_PAGEOUT_BLK(args) + btodb(NBPG))) { - return(1); - } else { - return(0); - } + if (cur_data == (VM_END_PAGEOUT_BLK(args) + btodb(NBPG))) { + return (1); + } else { + return (0); + } } /* @@ -1765,15 +1791,23 @@ afs_vm_fscontiguous(vp, args, cur_data) */ afs_vm_stopio(vp, args) struct vnode *vp; - vfspage_t *args; + vfspage_t *args; { - fsdata_t *fsdata = (fsdata_t *)args->fs_data; + fsdata_t *fsdata = (fsdata_t *) args->fs_data; + +#if defined(AFS_HPUX1123_ENV) + uint64_t tmpdb; + tmpdb = VM_END_PAGEOUT_BLK(args); - if ((dbtob(VM_END_PAGEOUT_BLK(args)) + NBPG) % (fsdata->bsize) == 0) { - return(1); - } else { - return(0); - } + if ((dbtob(tmpdb) + NBPG) % (fsdata->bsize) == 0) +#else + if ((dbtob(VM_END_PAGEOUT_BLK(args)) + NBPG) % (fsdata->bsize) == 0) +#endif /* AFS_HPUX1123_ENV */ + { + return (1); + } else { + return (0); + } } /* @@ -1783,18 +1817,18 @@ afs_vm_stopio(vp, args) */ afs_vm_checkpage(vp, args, pgindx, cur_data) struct vnode *vp; - vfspage_t *args; - pgcnt_t pgindx; - int cur_data; + vfspage_t *args; + pgcnt_t pgindx; + int cur_data; { - fsdata_t *fsdata = (fsdata_t *)args->fs_data; - - if (fsdata->remote_down) { /* never happens for AFS */ - /* - * The remote system is down. - */ - VASSERT(args->run == 0); - return 1; + fsdata_t *fsdata = (fsdata_t *) args->fs_data; + + if (fsdata->remote_down) { /* never happens for AFS */ + /* + * The remote system is down. + */ + VASSERT(args->run == 0); + return 1; } /* * A dirty page. If we have not yet determined the file size and @@ -1803,137 +1837,136 @@ afs_vm_checkpage(vp, args, pgindx, cur_data) */ if (fsdata->bsize == 0) { k_off_t isize; - long bsize; - struct vattr va; - struct vnode *filevp; - /* - * Get the various attributes about the file. Store them - * in args for the next time around. - */ - filevp = args->vp; - - bsize = vtoblksz(filevp); - args->maxpgs = (pgcnt_t)btop(bsize); + long bsize; + struct vattr va; + struct vnode *filevp; + /* + * Get the various attributes about the file. Store them + * in args for the next time around. + */ + filevp = args->vp; + + bsize = vtoblksz(filevp); + args->maxpgs = (pgcnt_t) btop(bsize); if (VOP_GETATTR(filevp, &va, kt_cred(u.u_kthreadp), VIFSYNC) != 0) { - /* - * The VOP_GETATTR() failed. - * we are vhand, and this is a hard mount, we will - * skip dirty pages for a while and try again later. - */ - if (args->vm_flags & PAGEOUT_VHAND) - { - VASSERT(args->run == 0); - return 1; - } - /* - * This is a "soft" mount, or some other error was - * returned from the server. Mark this region - * as a zombie, and free this dirty page. - */ - VM_ZOMBIE_OBJECT(args); - - /* - * The caller will see r_zomb and remove the page - * appropriately. - */ - return(1); - } - isize = va.va_size; - fsdata->isize = isize; - fsdata->bsize = bsize; - fsdata->remote = 1; + /* + * The VOP_GETATTR() failed. + * we are vhand, and this is a hard mount, we will + * skip dirty pages for a while and try again later. + */ + if (args->vm_flags & PAGEOUT_VHAND) { + VASSERT(args->run == 0); + return 1; + } + /* + * This is a "soft" mount, or some other error was + * returned from the server. Mark this region + * as a zombie, and free this dirty page. + */ + VM_ZOMBIE_OBJECT(args); + + /* + * The caller will see r_zomb and remove the page + * appropriately. + */ + return (1); + } + isize = va.va_size; + fsdata->isize = isize; + fsdata->bsize = bsize; + fsdata->remote = 1; } /* - * See if the file has shrunk (this could have happened - * asynchronously because of NFS or DUX). If so, invalidate - * all of the pages past the end of the file. This is only - * needed for remote files, as local files are truncated - * synchronously. - */ + * See if the file has shrunk (this could have happened + * asynchronously because of NFS or DUX). If so, invalidate + * all of the pages past the end of the file. This is only + * needed for remote files, as local files are truncated + * synchronously. + */ if (vnodindx(VM_REGION(args), pgindx) > fsdata->isize) { - /* - * This page is past the end of the file. Unlock this page - * (region_trunc will throw it away) and then call region_trunc() - * to invalidate all pages past the new end of the file. - */ - VM_SETFS_FLAGS(args, PAGEOUT_TRUNCATE); - return(1); + /* + * This page is past the end of the file. Unlock this page + * (region_trunc will throw it away) and then call region_trunc() + * to invalidate all pages past the new end of the file. + */ + VM_SETFS_FLAGS(args, PAGEOUT_TRUNCATE); + return (1); } #ifdef notdef - if ((args->vm_flags & PAGEOUT_VHAND) && - (!(args->vm_flags & PAGEOUT_RESERVED)) && - (!(VM_IS_ZOMBIE(args)))) { - VASSERT(args->run == 0); - if (vm_reserve_malloc_memory(NFS_PAGEOUT_MEM)) { - /* - * Got enough memory to pageout. Mark the fact that we did - * a sysprocmemreserve(), so that we can sysprocmemunreserve() it - * later (in remote_pageout()). - */ - args->vm_flags |= PAGEOUT_RESERVED; - } else { - /* - * We do not have enough memory to do this pageout. By - * definition, we do not yet have a run, so we just unlock - * this page and tell foreach_valid() to continue scanning. - * If we come across another dirty page, we will try to - * reserve memory again. That is okay, in fact some memory - * may have freed up (as earlier pageouts complete under - * interrupt). - */ - return 1; - } + if ((args->vm_flags & PAGEOUT_VHAND) + && (!(args->vm_flags & PAGEOUT_RESERVED)) + && (!(VM_IS_ZOMBIE(args)))) { + VASSERT(args->run == 0); + if (vm_reserve_malloc_memory(NFS_PAGEOUT_MEM)) { + /* + * Got enough memory to pageout. Mark the fact that we did + * a sysprocmemreserve(), so that we can sysprocmemunreserve() it + * later (in remote_pageout()). + */ + args->vm_flags |= PAGEOUT_RESERVED; + } else { + /* + * We do not have enough memory to do this pageout. By + * definition, we do not yet have a run, so we just unlock + * this page and tell foreach_valid() to continue scanning. + * If we come across another dirty page, we will try to + * reserve memory again. That is okay, in fact some memory + * may have freed up (as earlier pageouts complete under + * interrupt). + */ + return 1; + } } #endif - return(0); + return (0); } afs_swapfs_len(bp) struct buf *bp; { - long fs_bsize; - long max_size; - long bnrem; - - fs_bsize = vtoblksz(bp->b_vp); - /* - * Check to see if we are starting mid block. If so, then - * we must return the remainder of the block or less depending - * on the length. - */ - bnrem = bp->b_offset % fs_bsize; - if (bnrem) { - max_size = fs_bsize - bnrem; - } else { - max_size = fs_bsize; - } - - if (bp->b_bcount > max_size) { - return(max_size); - } else { - return(bp->b_bcount); - } + long fs_bsize; + long max_size; + long bnrem; + + fs_bsize = vtoblksz(bp->b_vp); + /* + * Check to see if we are starting mid block. If so, then + * we must return the remainder of the block or less depending + * on the length. + */ + bnrem = bp->b_offset % fs_bsize; + if (bnrem) { + max_size = fs_bsize - bnrem; + } else { + max_size = fs_bsize; + } + + if (bp->b_bcount > max_size) { + return (max_size); + } else { + return (bp->b_bcount); + } } afs_mmap(vp, off, size_bytes, access) struct vnode *vp; u_int off; #if defined(AFS_HPUX1111_ENV) - u_long size_bytes; + u_long size_bytes; #else u_int size_bytes; #endif int access; { - long bsize = vtoblksz(vp); + long bsize = vtoblksz(vp); - if (bsize % NBPG != 0) { - return(EINVAL); - } + if (bsize % NBPG != 0) { + return (EINVAL); + } - return(0); + return (0); } afs_cachelimit(vp, len, location) @@ -1941,31 +1974,31 @@ afs_cachelimit(vp, len, location) k_off_t len; int *location; { - /* - * Disk addresses are logical, not physical, so fragments are - * transparent. - */ - *location = btorp(len) + 1; + /* + * Disk addresses are logical, not physical, so fragments are + * transparent. + */ + *location = btorp(len) + 1; } afs_release(vp) struct vnode *vp; { - return(0); + return (0); } int -afs_unmap(vp,off, size_bytes,access) +afs_unmap(vp, off, size_bytes, access) struct vnode *vp; u_int off; #if defined(AFS_HPUX1111_ENV) - u_long size_bytes; + u_long size_bytes; #else u_int size_bytes; #endif int access; { - return 0; + return 0; } int @@ -1977,51 +2010,52 @@ afs_read_ahead(vp, prp, wrt, space, vaddr, rhead_cnt) caddr_t vaddr; pgcnt_t *rhead_cnt; { - printf("afs_read_ahead returning 0 \n"); - return 0; + printf("afs_read_ahead returning 0 \n"); + return 0; } int afs_prealloc(vp, size, ignore_minfree, reserved) - struct vnode *vp; - /* DEE on 11.22 following is off_t */ - size_t size; - int ignore_minfree; - int reserved; + struct vnode *vp; + /* DEE on 11.22 following is off_t */ + size_t size; + int ignore_minfree; + int reserved; { - printf("afs_prealloc returning ENOSPC\n"); - return ENOSPC; + printf("afs_prealloc returning ENOSPC\n"); + return ENOSPC; } int afs_ioctl(vp, com, data, flag, cred) - struct vnode *vp; - int com; - caddr_t data; - int flag; - struct ucred *cred; + struct vnode *vp; + int com; + caddr_t data; + int flag; + struct ucred *cred; { - int error; - struct afs_ioctl afsioctl, *ai; + int error; + struct afs_ioctl afsioctl, *ai; - AFS_STATCNT(afs_ioctl); + AFS_STATCNT(afs_ioctl); - /* The call must be a VICEIOCTL call */ - if (((com >> 8) & 0xff) == 'V') { -#ifdef notdef - /* AFS_COPYIN returns error 14. Copy data in instead */ - AFS_COPYIN(data, (caddr_t) &afsioctl, sizeof(afsioctl), error); - if (error) return(error); + /* The call must be a VICEIOCTL call */ + if (((com >> 8) & 0xff) == 'V') { +#ifdef notdef + /* AFS_COPYIN returns error 14. Copy data in instead */ + AFS_COPYIN(data, (caddr_t) & afsioctl, sizeof(afsioctl), error); + if (error) + return (error); #endif - ai = (struct afs_ioctl *) data; - afsioctl.in = ai->in; - afsioctl.out = ai->out; - afsioctl.in_size = ai->in_size; - afsioctl.out_size = ai->out_size; - error = HandleIoctl(VTOAFS(vp), com, &afsioctl); - return(error); - } - return(ENOTTY); + ai = (struct afs_ioctl *)data; + afsioctl.in = ai->in; + afsioctl.out = ai->out; + afsioctl.in_size = ai->in_size; + afsioctl.out_size = ai->out_size; + error = HandleIoctl(VTOAFS(vp), com, &afsioctl); + return (error); + } + return (ENOTTY); } #if defined(AFS_HPUX1111_ENV) @@ -2044,60 +2078,60 @@ afs_readdir(vp, uiop, cred) struct uio *uiop; struct ucred *cred; { - struct uio auio; - struct iovec aiov; - caddr_t ibuf, obuf, ibufend, obufend; - struct __dirent32 *idp; - struct dirent *odp; - int count, outcount; - dir_off_t offset; - uint64_t tmp_offset; - - count = uiop->uio_resid; - /* Allocate temporary space for format conversion */ - ibuf = kmem_alloc(2*count); /* overkill - fix later */ - obuf = kmem_alloc(count + sizeof (struct dirent)); - aiov.iov_base = ibuf; - aiov.iov_len = count; - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - offset = auio.uio_offset = uiop->uio_offset; - auio.uio_seg = UIOSEG_KERNEL; - auio.uio_resid = count; - auio.uio_fpflags = 0; - - u.u_error = mp_afs_readdir2(vp, &auio, cred); - if (u.u_error) - goto out; - - /* Convert entries from __dirent32 to dirent format */ - - for (idp = (struct __dirent32 *) ibuf, odp = (struct dirent *) obuf, - ibufend = ibuf + (count - auio.uio_resid), - obufend = obuf + count; - (caddr_t)idp < ibufend; - idp = (struct __dirent32 *) ((caddr_t) idp + idp->__d_reclen), - odp = (struct dirent *) ((caddr_t) odp + odp->d_reclen)) { - odp->d_ino = idp->__d_ino; - odp->d_namlen = idp->__d_namlen; - (void) strcpy(odp->d_name, idp->__d_name); - odp->d_reclen = reclen(odp); - if ((caddr_t) odp + odp->d_reclen > obufend) - break; - /* record offset *after* we're sure to use this entry */ - memcpy((char *)&tmp_offset, (char *)&idp->__d_off, sizeof tmp_offset); - offset = tmp_offset; - } - - outcount = (caddr_t) odp - obuf; - AFS_UIOMOVE(obuf, outcount, UIO_READ, uiop, u.u_error); - if (u.u_error) - goto out; - uiop->uio_offset = offset; -out: - kmem_free(ibuf, count); - kmem_free(obuf, count + sizeof (struct dirent)); - return u.u_error; + struct uio auio; + struct iovec aiov; + caddr_t ibuf, obuf, ibufend, obufend; + struct __dirent32 *idp; + struct dirent *odp; + int count, outcount; + dir_off_t offset; + uint64_t tmp_offset; + + count = uiop->uio_resid; + /* Allocate temporary space for format conversion */ + ibuf = kmem_alloc(2 * count); /* overkill - fix later */ + obuf = kmem_alloc(count + sizeof(struct dirent)); + aiov.iov_base = ibuf; + aiov.iov_len = count; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + offset = auio.uio_offset = uiop->uio_offset; + auio.uio_seg = UIOSEG_KERNEL; + auio.uio_resid = count; + auio.uio_fpflags = 0; + + u.u_error = mp_afs_readdir2(vp, &auio, cred); + if (u.u_error) + goto out; + + /* Convert entries from __dirent32 to dirent format */ + + for (idp = (struct __dirent32 *)ibuf, odp = + (struct dirent *)obuf, ibufend = + ibuf + (count - auio.uio_resid), obufend = obuf + count; + (caddr_t) idp < ibufend; + idp = (struct __dirent32 *)((caddr_t) idp + idp->__d_reclen), odp = + (struct dirent *)((caddr_t) odp + odp->d_reclen)) { + odp->d_ino = idp->__d_ino; + odp->d_namlen = idp->__d_namlen; + (void)strcpy(odp->d_name, idp->__d_name); + odp->d_reclen = reclen(odp); + if ((caddr_t) odp + odp->d_reclen > obufend) + break; + /* record offset *after* we're sure to use this entry */ + memcpy((char *)&tmp_offset, (char *)&idp->__d_off, sizeof tmp_offset); + offset = tmp_offset; + } + + outcount = (caddr_t) odp - obuf; + AFS_UIOMOVE(obuf, outcount, UIO_READ, uiop, u.u_error); + if (u.u_error) + goto out; + uiop->uio_offset = offset; + out: + kmem_free(ibuf, count); + kmem_free(obuf, count + sizeof(struct dirent)); + return u.u_error; } @@ -2111,59 +2145,60 @@ afs_readdir3(vp, uiop, cred) struct uio *uiop; struct ucred *cred; { - struct uio auio; - struct iovec aiov; - caddr_t ibuf, obuf, ibufend, obufend; - struct __dirent32 *idp; - struct __dirent64 *odp; - int count, outcount; - dir_off_t offset; - - count = uiop->uio_resid; - /* Allocate temporary space for format conversion */ - ibuf = kmem_alloc(2*count); /* overkill - fix later */ - obuf = kmem_alloc(count + sizeof (struct __dirent64)); - aiov.iov_base = ibuf; - aiov.iov_len = count; - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - offset = auio.uio_offset = uiop->uio_offset; - auio.uio_seg = UIOSEG_KERNEL; - auio.uio_resid = count; - auio.uio_fpflags = 0; - - u.u_error = mp_afs_readdir2(vp, &auio, cred); - if (u.u_error) - goto out; - - /* Convert entries from __dirent32 to __dirent64 format */ - - for (idp = (struct __dirent32 *) ibuf, odp = (struct __dirent64 *) obuf, - ibufend = ibuf + (count - auio.uio_resid), - obufend = obuf + count; - (caddr_t)idp < ibufend; - idp = (struct __dirent32 *) ((caddr_t) idp + idp->__d_reclen), - odp = (struct __dirent64 *) ((caddr_t) odp + odp->__d_reclen)) { - memcpy((char *)&odp->__d_off, (char *)&idp->__d_off, sizeof odp->__d_off); - odp->__d_ino = idp->__d_ino; - odp->__d_namlen = idp->__d_namlen; - (void) strcpy(odp->__d_name, idp->__d_name); - odp->__d_reclen = reclen_dirent64(odp); - if ((caddr_t) odp + odp->__d_reclen > obufend) - break; - /* record offset *after* we're sure to use this entry */ - offset = odp->__d_off; - } - - outcount = (caddr_t) odp - obuf; - AFS_UIOMOVE(obuf, outcount, UIO_READ, uiop, u.u_error); - if (u.u_error) - goto out; - uiop->uio_offset = offset; -out: - kmem_free(ibuf, count); - kmem_free(obuf, count + sizeof (struct __dirent64)); - return u.u_error; + struct uio auio; + struct iovec aiov; + caddr_t ibuf, obuf, ibufend, obufend; + struct __dirent32 *idp; + struct __dirent64 *odp; + int count, outcount; + dir_off_t offset; + + count = uiop->uio_resid; + /* Allocate temporary space for format conversion */ + ibuf = kmem_alloc(2 * count); /* overkill - fix later */ + obuf = kmem_alloc(count + sizeof(struct __dirent64)); + aiov.iov_base = ibuf; + aiov.iov_len = count; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + offset = auio.uio_offset = uiop->uio_offset; + auio.uio_seg = UIOSEG_KERNEL; + auio.uio_resid = count; + auio.uio_fpflags = 0; + + u.u_error = mp_afs_readdir2(vp, &auio, cred); + if (u.u_error) + goto out; + + /* Convert entries from __dirent32 to __dirent64 format */ + + for (idp = (struct __dirent32 *)ibuf, odp = + (struct __dirent64 *)obuf, ibufend = + ibuf + (count - auio.uio_resid), obufend = obuf + count; + (caddr_t) idp < ibufend; + idp = (struct __dirent32 *)((caddr_t) idp + idp->__d_reclen), odp = + (struct __dirent64 *)((caddr_t) odp + odp->__d_reclen)) { + memcpy((char *)&odp->__d_off, (char *)&idp->__d_off, + sizeof odp->__d_off); + odp->__d_ino = idp->__d_ino; + odp->__d_namlen = idp->__d_namlen; + (void)strcpy(odp->__d_name, idp->__d_name); + odp->__d_reclen = reclen_dirent64(odp); + if ((caddr_t) odp + odp->__d_reclen > obufend) + break; + /* record offset *after* we're sure to use this entry */ + offset = odp->__d_off; + } + + outcount = (caddr_t) odp - obuf; + AFS_UIOMOVE(obuf, outcount, UIO_READ, uiop, u.u_error); + if (u.u_error) + goto out; + uiop->uio_offset = offset; + out: + kmem_free(ibuf, count); + kmem_free(obuf, count + sizeof(struct __dirent64)); + return u.u_error; } #define AFS_SV_SEMA_HASH 1 @@ -2215,28 +2250,26 @@ out: #define hashLock(xx) MP_PSEMA(&xx) #define hashUnlock(xx) MP_VSEMA(&xx) -typedef struct elem -{ - struct elem* next; - ELEMENT element; - KEY key; - int refCnt; +typedef struct elem { + struct elem *next; + ELEMENT element; + KEY key; + int refCnt; } Element; -typedef struct bucket -{ - sema_t lock; - Element* element; +typedef struct bucket { + sema_t lock; + Element *element; } Bucket; -static int sizeOfHashTable; -static Bucket* hashTable; +static int sizeOfHashTable; +static Bucket *hashTable; -static int currentSize=0; -static Element* freeList; /* free list */ +static int currentSize = 0; +static Element *freeList; /* free list */ #pragma align 64 -static sema_t afsHashLock = { 0 }; /* global lock for hash table */ +static sema_t afsHashLock = { 0 }; /* global lock for hash table */ static void afsHashGarbageCollect(); @@ -2250,232 +2283,231 @@ static void afsHashGarbageCollect(); void -afsHash(int nbuckets) /* allocate the hash table */ -{ - int i; +afsHash(int nbuckets) +{ /* allocate the hash table */ + int i; #if AFS_SV_SEMA_HASH_DEBUG -printf("afsHash: enter\n"); + printf("afsHash: enter\n"); #endif - sizeOfHashTable = nbuckets; - currentSize = nbuckets * sizeof(Bucket); + sizeOfHashTable = nbuckets; + currentSize = nbuckets * sizeof(Bucket); - if ( hashTable ) - osi_Panic("afs: SEMA Hashtable already created\n"); + if (hashTable) + osi_Panic("afs: SEMA Hashtable already created\n"); - hashTable = (Bucket *)AFS_KALLOC(sizeOfHashTable * sizeof(Bucket)); - if ( ! hashTable ) - osi_Panic("afs: cannot create SEMA Hashtable\n"); + hashTable = (Bucket *) AFS_KALLOC(sizeOfHashTable * sizeof(Bucket)); + if (!hashTable) + osi_Panic("afs: cannot create SEMA Hashtable\n"); - /* initialize the hash table and associated locks */ - memset((char *)hashTable, 0, sizeOfHashTable * sizeof(Bucket )); - for ( i=0;i < sizeOfHashTable; i ++) - hashLockInit( hashTable[i].lock); - hashLockInit(afsHashLock); + /* initialize the hash table and associated locks */ + memset((char *)hashTable, 0, sizeOfHashTable * sizeof(Bucket)); + for (i = 0; i < sizeOfHashTable; i++) + hashLockInit(hashTable[i].lock); + hashLockInit(afsHashLock); #if AFS_SV_SEMA_HASH_DEBUG -printf("afsHash: exit\n"); + printf("afsHash: exit\n"); #endif } -ELEMENT* +ELEMENT * afsHashInsertFind(KEY key) { - int index; - Element* ptr; + int index; + Element *ptr; #if AFS_SV_SEMA_HASH_DEBUG -printf("afsHashInsertFind: %d\n", key); + printf("afsHashInsertFind: %d\n", key); #endif - if ( ! hashTable ) - osi_Panic("afs: afsHashInsertFind: no hashTable\n"); - - index = Hash(key); /* get bucket number */ - hashLock(hashTable[index].lock); /* lock this bucket */ - ptr = hashTable[index].element; - - /* if it is already there */ - while ( ptr ) { - if ( ptr->key == key ) { - ptr->refCnt++; /* hold it */ - hashUnlock(hashTable[index].lock); + if (!hashTable) + osi_Panic("afs: afsHashInsertFind: no hashTable\n"); + + index = Hash(key); /* get bucket number */ + hashLock(hashTable[index].lock); /* lock this bucket */ + ptr = hashTable[index].element; + + /* if it is already there */ + while (ptr) { + if (ptr->key == key) { + ptr->refCnt++; /* hold it */ + hashUnlock(hashTable[index].lock); #if AFS_SV_SEMA_HASH_DEBUG -printf("afsHashInsertFind: %d FOUND\n", key); + printf("afsHashInsertFind: %d FOUND\n", key); #endif - return &(ptr->element); - } else { - ptr = ptr->next; - } + return &(ptr->element); + } else { + ptr = ptr->next; } + } - hashUnlock(hashTable[index].lock); + hashUnlock(hashTable[index].lock); - /* if something exists in the freeList, take it from there */ - ptr = NULL; - hashLock(afsHashLock); + /* if something exists in the freeList, take it from there */ + ptr = NULL; + hashLock(afsHashLock); - if ( freeList ) { - ptr = freeList; /* reuse entry */ - freeList = freeList->next; + if (freeList) { + ptr = freeList; /* reuse entry */ + freeList = freeList->next; + } else { + afsHashGarbageCollect(); /* afsHashLock locked */ + if (freeList) { + ptr = freeList; /* reuse entry */ + freeList = freeList->next; } else { - afsHashGarbageCollect(); /* afsHashLock locked */ - if ( freeList ) { - ptr = freeList; /* reuse entry */ - freeList = freeList->next; - } else { - ptr = (Element *)AFS_KALLOC(sizeof(Element)); - } + ptr = (Element *) AFS_KALLOC(sizeof(Element)); } + } - currentSize += sizeof(Element); /* update memory used */ - hashUnlock(afsHashLock); - - if ( ! ptr ) - osi_Panic("afs: SEMA Hashtable cannot create new entry\n"); - /* create new entry */ - ptr->key = key; - memset((char *)&ptr->element, 0, sizeof(ptr->element)); - ptr->refCnt = 1; /* this guy */ - - /* insert new entry in bucket */ - hashLock(hashTable[index].lock); /* lock this bucket */ - ptr->next = hashTable[index].element; - hashTable[index].element = ptr; - hashUnlock(hashTable[index].lock); + currentSize += sizeof(Element); /* update memory used */ + hashUnlock(afsHashLock); + + if (!ptr) + osi_Panic("afs: SEMA Hashtable cannot create new entry\n"); + /* create new entry */ + ptr->key = key; + memset((char *)&ptr->element, 0, sizeof(ptr->element)); + ptr->refCnt = 1; /* this guy */ + + /* insert new entry in bucket */ + hashLock(hashTable[index].lock); /* lock this bucket */ + ptr->next = hashTable[index].element; + hashTable[index].element = ptr; + hashUnlock(hashTable[index].lock); #if AFS_SV_SEMA_HASH_DEBUG -printf("afsHashInsertFind: %d MADE\n", key); + printf("afsHashInsertFind: %d MADE\n", key); #endif - return &(ptr->element); + return &(ptr->element); } -ELEMENT* +ELEMENT * afsHashFind(KEY key) { - int index; - Element* ptr; + int index; + Element *ptr; #if AFS_SV_SEMA_HASH_DEBUG -printf("afsHashFind: %d\n", key); + printf("afsHashFind: %d\n", key); #endif - if ( ! hashTable ) - osi_Panic("afs: afsHashFind: no hashTable\n"); - - index = Hash(key); /* get bucket number */ - hashLock(hashTable[index].lock); /* lock this bucket */ - ptr = hashTable[index].element; - - /* it should be in the hash table */ - while ( ptr ) { - if ( ptr->key == key ) - { - if(ptr->refCnt <= 0 ) - osi_Panic("afs: SEMA HashTable entry already released\n"); - hashUnlock(hashTable[index].lock); + if (!hashTable) + osi_Panic("afs: afsHashFind: no hashTable\n"); + + index = Hash(key); /* get bucket number */ + hashLock(hashTable[index].lock); /* lock this bucket */ + ptr = hashTable[index].element; + + /* it should be in the hash table */ + while (ptr) { + if (ptr->key == key) { + if (ptr->refCnt <= 0) + osi_Panic("afs: SEMA HashTable entry already released\n"); + hashUnlock(hashTable[index].lock); #if AFS_SV_SEMA_HASH_DEBUG -printf("afsHashFind: %d FOUND\n", key); + printf("afsHashFind: %d FOUND\n", key); #endif - return &(ptr->element); - } else { - ptr = ptr->next; - } + return &(ptr->element); + } else { + ptr = ptr->next; } + } - hashUnlock(hashTable[index].lock); - /* it better be in the hash table */ - osi_Panic("afs: SEMA HashTable wants non-existent entry \n"); - return 0; + hashUnlock(hashTable[index].lock); + /* it better be in the hash table */ + osi_Panic("afs: SEMA HashTable wants non-existent entry \n"); + return 0; } void afsHashRelease(KEY key) { - int index; - Element* ptr; + int index; + Element *ptr; #if AFS_SV_SEMA_HASH_DEBUG -printf("afsHashRelease: %d\n", key); + printf("afsHashRelease: %d\n", key); #endif - if ( ! hashTable ) - osi_Panic("afs: afsHashRelease: no hashTable\n"); - - index = Hash(key); /* get bucket number */ - hashLock(hashTable[index].lock); /* lock this bucket */ - ptr = hashTable[index].element; - - /* it should be in the hash table */ - while ( ptr ) { - if ( ptr->key == key ) { - if(ptr->refCnt <= 0 ) - osi_Panic("afs: SEMA HashTable entry already released\n"); - ptr->refCnt--; /* release this guy */ - hashUnlock(hashTable[index].lock); + if (!hashTable) + osi_Panic("afs: afsHashRelease: no hashTable\n"); + + index = Hash(key); /* get bucket number */ + hashLock(hashTable[index].lock); /* lock this bucket */ + ptr = hashTable[index].element; + + /* it should be in the hash table */ + while (ptr) { + if (ptr->key == key) { + if (ptr->refCnt <= 0) + osi_Panic("afs: SEMA HashTable entry already released\n"); + ptr->refCnt--; /* release this guy */ + hashUnlock(hashTable[index].lock); #if AFS_SV_SEMA_HASH_DEBUG -printf("afsHashRelease: %d FOUND\n", key); + printf("afsHashRelease: %d FOUND\n", key); #endif - return; - } else { - ptr = ptr->next; - } + return; + } else { + ptr = ptr->next; } + } - hashUnlock(hashTable[index].lock); - /* it better be in the hash table */ - osi_Panic("afs: SEMA HashTable deleting non-existent entry \n"); + hashUnlock(hashTable[index].lock); + /* it better be in the hash table */ + osi_Panic("afs: SEMA HashTable deleting non-existent entry \n"); } /* this should be called with afsHashLock WRITE locked */ static void afsHashGarbageCollect() { - int index; - Element* ptr; - int foundFlag=0; - - if ( ! hashTable ) - osi_Panic("afs: afsHashGarbageCollect: no hashTable\n"); - - for ( index = 0; index < sizeOfHashTable; index++) { - hashLock(hashTable[index].lock); - ptr = hashTable[index].element; /* pick up bucket */ - - while ( ptr && !ptr->refCnt ) { - /* insert this element into free list */ - Element* temp; - temp = ptr->next; - ptr->next = freeList; - freeList = ptr; - - foundFlag = 1; /* found at least one */ - currentSize -= sizeof(Element); - ptr = temp; + int index; + Element *ptr; + int foundFlag = 0; + + if (!hashTable) + osi_Panic("afs: afsHashGarbageCollect: no hashTable\n"); + + for (index = 0; index < sizeOfHashTable; index++) { + hashLock(hashTable[index].lock); + ptr = hashTable[index].element; /* pick up bucket */ + + while (ptr && !ptr->refCnt) { + /* insert this element into free list */ + Element *temp; + temp = ptr->next; + ptr->next = freeList; + freeList = ptr; + + foundFlag = 1; /* found at least one */ + currentSize -= sizeof(Element); + ptr = temp; + } + hashTable[index].element = ptr; + + /* scan thru the remaining list */ + if (ptr) { + while (ptr->next) { + if (ptr->next->refCnt == 0) { + /* collect this element */ + Element *temp; + temp = ptr->next; + ptr->next = ptr->next->next; + temp->next = freeList; + freeList = temp; + foundFlag = 1; + currentSize -= sizeof(Element); + } else { + ptr = ptr->next; } - hashTable[index].element = ptr; - - /* scan thru the remaining list */ - if ( ptr ) { - while ( ptr->next ) { - if ( ptr->next->refCnt == 0 ) { - /* collect this element */ - Element* temp; - temp = ptr->next; - ptr->next = ptr->next->next; - temp->next = freeList; - freeList = temp; - foundFlag = 1; - currentSize -= sizeof(Element); - } else { - ptr = ptr->next; - } - } - } - hashUnlock(hashTable[index].lock); + } } + hashUnlock(hashTable[index].lock); + } #if 0 - if(!foundFlag) - osi_Panic("afs: SEMA HashTable full\n"); + if (!foundFlag) + osi_Panic("afs: SEMA HashTable full\n"); #endif } @@ -2483,7 +2515,7 @@ afsHashGarbageCollect() afs_hp_strategy(bp) - register struct buf *bp; + register struct buf *bp; { register afs_int32 code; struct uio tuio; @@ -2502,40 +2534,37 @@ afs_hp_strategy(bp) hdl_kmap_bp(bp); AFS_GLOCK(); - afs_Trace4(afs_iclSetp, CM_TRACE_HPSTRAT, ICL_TYPE_POINTER, - bp->b_vp, ICL_TYPE_LONG, - (int)bp->b_blkno*DEV_BSIZE, ICL_TYPE_LONG, bp->b_bcount, - ICL_TYPE_LONG,0); - - /* Set up the uio structure */ - tuio.afsio_iov = tiovec; - tuio.afsio_iovcnt = 1; - tuio.afsio_offset = DEV_BSIZE * bp->b_blkno; - tuio.afsio_seg = AFS_UIOSYS; - tuio.afsio_resid = bp->b_bcount; - tuio.uio_fpflags = 0; - tiovec[0].iov_base = bp->b_un.b_addr; - tiovec[0].iov_len = bp->b_bcount; - - /* Do the I/O */ - if ((bp->b_flags & B_READ) == B_READ) - { - /* read b_bcount bytes into kernel address b_un.b_addr - starting at byte DEV_BSIZE * b_blkno. Bzero anything - we can't read, and finally call iodone(bp). File is - in bp->b_vp. Credentials are from u area?? - */ - code = afs_rdwr(VTOAFS(bp->b_vp),&tuio,UIO_READ,0,kt_cred(t)); - if (code == 0) - if (tuio.afsio_resid > 0) - { - privlbzero(bvtospace(bp, bp->b_un.b_addr), - bp->b_un.b_addr + bp->b_bcount - tuio.afsio_resid, - (size_t) tuio.afsio_resid); - - } - } else - code = afs_rdwr(VTOAFS(bp->b_vp),&tuio,UIO_WRITE,0,kt_cred(t)); + afs_Trace4(afs_iclSetp, CM_TRACE_HPSTRAT, ICL_TYPE_POINTER, bp->b_vp, + ICL_TYPE_LONG, (int)bp->b_blkno * DEV_BSIZE, ICL_TYPE_LONG, + bp->b_bcount, ICL_TYPE_LONG, 0); + + /* Set up the uio structure */ + tuio.afsio_iov = tiovec; + tuio.afsio_iovcnt = 1; + tuio.afsio_offset = DEV_BSIZE * bp->b_blkno; + tuio.afsio_seg = AFS_UIOSYS; + tuio.afsio_resid = bp->b_bcount; + tuio.uio_fpflags = 0; + tiovec[0].iov_base = bp->b_un.b_addr; + tiovec[0].iov_len = bp->b_bcount; + + /* Do the I/O */ + if ((bp->b_flags & B_READ) == B_READ) { + /* read b_bcount bytes into kernel address b_un.b_addr + * starting at byte DEV_BSIZE * b_blkno. Bzero anything + * we can't read, and finally call iodone(bp). File is + * in bp->b_vp. Credentials are from u area?? + */ + code = afs_rdwr(VTOAFS(bp->b_vp), &tuio, UIO_READ, 0, kt_cred(t)); + if (code == 0) + if (tuio.afsio_resid > 0) { + privlbzero(bvtospace(bp, bp->b_un.b_addr), + bp->b_un.b_addr + bp->b_bcount - tuio.afsio_resid, + (size_t) tuio.afsio_resid); + + } + } else + code = afs_rdwr(VTOAFS(bp->b_vp), &tuio, UIO_WRITE, 0, kt_cred(t)); /* Remap back to the user's space */ hdl_remap_bp(bp); @@ -2547,76 +2576,75 @@ afs_hp_strategy(bp) } afs_pathconf(vp, name, resultp, cred) -struct vnode *vp; -int name; -int *resultp; -struct ucred *cred; /* unused */ + struct vnode *vp; + int name; + int *resultp; + struct ucred *cred; /* unused */ { - switch(name) - { - case _PC_LINK_MAX: /* Maximum number of links to a file */ - *resultp = 255; /* an unsigned short on the fileserver*/ - break; /* a unsigned char in the client.... */ - - case _PC_NAME_MAX: /* Max length of file name */ - *resultp = 255; - break; + switch (name) { + case _PC_LINK_MAX: /* Maximum number of links to a file */ + *resultp = 255; /* an unsigned short on the fileserver */ + break; /* a unsigned char in the client.... */ - case _PC_PATH_MAX: /* Maximum length of Path Name */ - *resultp = 1024; - break; + case _PC_NAME_MAX: /* Max length of file name */ + *resultp = 255; + break; - case _PC_PIPE_BUF: /* Max atomic write to pipe. See fifo_vnops */ - case _PC_CHOWN_RESTRICTED: /* Anybody can chown? */ - case _PC_NO_TRUNC: /* No file name truncation on overflow? */ - u.u_error = EOPNOTSUPP; - return(EOPNOTSUPP); - break; + case _PC_PATH_MAX: /* Maximum length of Path Name */ + *resultp = 1024; + break; - case _PC_MAX_CANON: /* TTY buffer size for canonical input */ - /* need more work here for pty, ite buffer size, if differ */ - if (vp->v_type != VCHR) { - u.u_error = EINVAL; - return(EINVAL); - } - *resultp = CANBSIZ; /*for tty*/ - break; + case _PC_PIPE_BUF: /* Max atomic write to pipe. See fifo_vnops */ + case _PC_CHOWN_RESTRICTED: /* Anybody can chown? */ + case _PC_NO_TRUNC: /* No file name truncation on overflow? */ + u.u_error = EOPNOTSUPP; + return (EOPNOTSUPP); + break; - case _PC_MAX_INPUT: - /* need more work here for pty, ite buffer size, if differ */ - if (vp->v_type != VCHR) { /* TTY buffer size */ - u.u_error = EINVAL; - return(EINVAL); - } - *resultp = TTYHOG; /*for tty*/ - break; + case _PC_MAX_CANON: /* TTY buffer size for canonical input */ + /* need more work here for pty, ite buffer size, if differ */ + if (vp->v_type != VCHR) { + u.u_error = EINVAL; + return (EINVAL); + } + *resultp = CANBSIZ; /*for tty */ + break; - case _PC_VDISABLE: - /* Terminal special characters can be disabled? */ - if (vp->v_type != VCHR) { - u.u_error = EINVAL; - return(EINVAL); - } - *resultp = 1; - break; + case _PC_MAX_INPUT: + /* need more work here for pty, ite buffer size, if differ */ + if (vp->v_type != VCHR) { /* TTY buffer size */ + u.u_error = EINVAL; + return (EINVAL); + } + *resultp = TTYHOG; /*for tty */ + break; - case _PC_SYNC_IO: - if ((vp->v_type != VREG) && (vp->v_type != VBLK)) { - *resultp = -1; - return EINVAL; - } - *resultp = 1; /* Synchronized IO supported for this file */ - break; - - case _PC_FILESIZEBITS: - if (vp->v_type != VDIR) - return(EINVAL); - *resultp = MAX_SMALL_FILE_BITS; - break; + case _PC_VDISABLE: + /* Terminal special characters can be disabled? */ + if (vp->v_type != VCHR) { + u.u_error = EINVAL; + return (EINVAL); + } + *resultp = 1; + break; - default: - return(EINVAL); + case _PC_SYNC_IO: + if ((vp->v_type != VREG) && (vp->v_type != VBLK)) { + *resultp = -1; + return EINVAL; } + *resultp = 1; /* Synchronized IO supported for this file */ + break; - return(0); + case _PC_FILESIZEBITS: + if (vp->v_type != VDIR) + return (EINVAL); + *resultp = MAX_SMALL_FILE_BITS; + break; + + default: + return (EINVAL); + } + + return (0); } diff --git a/src/afs/IRIX/osi_file.c b/src/afs/IRIX/osi_file.c index 322af9a13..a71f1c555 100644 --- a/src/afs/IRIX/osi_file.c +++ b/src/afs/IRIX/osi_file.c @@ -8,16 +8,16 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_file.c,v 1.1.1.6 2001/09/11 14:25:01 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/IRIX/osi_file.c,v 1.10 2003/07/15 23:14:23 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ -int afs_osicred_initialized=0; -struct AFS_UCRED afs_osi_cred; +int afs_osicred_initialized = 0; afs_lock_t afs_xosi; /* lock is for tvattr */ extern struct osi_dev cacheDev; extern struct vfs *afs_cacheVfsp; @@ -28,32 +28,34 @@ extern struct vfs *afs_cacheVfsp; * added which accesses the inode, that will also need EFS/XFS variants. */ #ifdef AFS_SGI_EFS_IOPS_ENV -vnode_t *afs_EFSIGetVnode(ino_t ainode) +vnode_t * +afs_EFSIGetVnode(ino_t ainode) { struct inode *ip; int error; - if ((error = igetinode(afs_cacheVfsp, (dev_t)cacheDev.dev, ainode, &ip))) { + if ((error = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, ainode, &ip))) { osi_Panic("afs_EFSIGetVnode: igetinode failed, error=%d", error); } /* We don't care about atimes on the cache files, so disable them. I'm not * sure that this is the right place to do this: it should be *after* readi * and getattr and stuff. */ - ip->i_flags &= ~(ISYN|IACC); + ip->i_flags &= ~(ISYN | IACC); iunlock(ip); return (EFS_ITOV(ip)); -} +} #endif /* AFS_SGI_EFS_IOPS_ENV */ -vnode_t *afs_XFSIGetVnode(ino_t ainode) +vnode_t * +afs_XFSIGetVnode(ino_t ainode) { struct xfs_inode *ip; int error; vnode_t *vp; if ((error = - xfs_igetinode(afs_cacheVfsp, (dev_t)cacheDev.dev, ainode, &ip))) { + xfs_igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, ainode, &ip))) { osi_Panic("afs_XFSIGetVnode: xfs_igetinode failed, error=%d", error); } vp = XFS_ITOV(ip); @@ -61,7 +63,8 @@ vnode_t *afs_XFSIGetVnode(ino_t ainode) } /* Force to 64 bits, even for EFS filesystems. */ -void *osi_UFSOpen(ino_t ainode) +void * +osi_UFSOpen(ino_t ainode) { struct inode *ip; register struct osi_file *afile = NULL; @@ -69,7 +72,7 @@ void *osi_UFSOpen(ino_t ainode) afs_int32 code = 0; int dummy; AFS_STATCNT(osi_UFSOpen); - if(cacheDiskType != AFS_FCACHE_TYPE_UFS) { + if (cacheDiskType != AFS_FCACHE_TYPE_UFS) { osi_Panic("UFSOpen called for non-UFS cache\n"); } if (!afs_osicred_initialized) { @@ -78,26 +81,26 @@ void *osi_UFSOpen(ino_t ainode) crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */ afs_osicred_initialized = 1; } - afile = (struct osi_file *) osi_AllocSmallSpace(sizeof(struct osi_file)); + afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file)); AFS_GUNLOCK(); afile->vnode = AFS_SGI_IGETVNODE(ainode); AFS_GLOCK(); afile->size = VnodeToSize(afile->vnode); afile->offset = 0; - afile->proc = (int (*)()) 0; - afile->inum = ainode; /* for hint validity checking */ + afile->proc = (int (*)())0; + afile->inum = ainode; /* for hint validity checking */ return (void *)afile; } -afs_osi_Stat(afile, astat) - register struct osi_file *afile; - register struct osi_stat *astat; { +int +afs_osi_Stat(register struct osi_file *afile, register struct osi_stat *astat) +{ register afs_int32 code; struct vattr tvattr; AFS_STATCNT(osi_Stat); - MObtainWriteLock(&afs_xosi,320); + MObtainWriteLock(&afs_xosi, 320); AFS_GUNLOCK(); - tvattr.va_mask = AT_SIZE|AT_BLKSIZE|AT_MTIME|AT_ATIME; + tvattr.va_mask = AT_SIZE | AT_BLKSIZE | AT_MTIME | AT_ATIME; AFS_VOP_GETATTR(afile->vnode, &tvattr, 0, &afs_osi_cred, code); AFS_GLOCK(); if (code == 0) { @@ -110,21 +113,21 @@ afs_osi_Stat(afile, astat) return code; } -osi_UFSClose(afile) - register struct osi_file *afile; - { - AFS_STATCNT(osi_Close); - if(afile->vnode) { +int +osi_UFSClose(register struct osi_file *afile) +{ + AFS_STATCNT(osi_Close); + if (afile->vnode) { VN_RELE(afile->vnode); - } - - osi_FreeSmallSpace(afile); - return 0; - } + } -osi_UFSTruncate(afile, asize) - register struct osi_file *afile; - afs_int32 asize; { + osi_FreeSmallSpace(afile); + return 0; +} + +int +osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize) +{ struct AFS_UCRED *oldCred; struct vattr tvattr; register afs_int32 code; @@ -137,8 +140,9 @@ osi_UFSTruncate(afile, asize) * small enough. Check now and save some time. */ code = afs_osi_Stat(afile, &tstat); - if (code || tstat.size <= asize) return code; - MObtainWriteLock(&afs_xosi,321); + if (code || tstat.size <= asize) + return code; + MObtainWriteLock(&afs_xosi, 321); AFS_GUNLOCK(); tvattr.va_mask = AT_SIZE; tvattr.va_size = asize; @@ -149,46 +153,46 @@ osi_UFSTruncate(afile, asize) } #ifdef AFS_SGI_EFS_IOPS_ENV -void osi_DisableAtimes(avp) -struct vnode *avp; +void +osi_DisableAtimes(struct vnode *avp) { - if (afs_CacheFSType == AFS_SGI_EFS_CACHE) - { - struct inode *ip = EFS_VTOI(avp); - ip->i_flags &= ~IACC; - } + if (afs_CacheFSType == AFS_SGI_EFS_CACHE) { + struct inode *ip = EFS_VTOI(avp); + ip->i_flags &= ~IACC; + } } #endif /* AFS_SGI_EFS_IOPS_ENV */ /* Generic read interface */ -afs_osi_Read(afile, offset, aptr, asize) - register struct osi_file *afile; - int offset; - char *aptr; - afs_int32 asize; { +int +afs_osi_Read(register struct osi_file *afile, int offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; ssize_t resid; register afs_int32 code; - register afs_int32 cnt1=0; + register afs_int32 cnt1 = 0; AFS_STATCNT(osi_Read); - + /** * If the osi_file passed in is NULL, panic only if AFS is not shutting * down. No point in crashing when we are already shutting down */ - if ( !afile ) { - if ( !afs_shuttingdown ) + if (!afile) { + if (!afs_shuttingdown) osi_Panic("osi_Read called with null param"); else - return EIO; + return EIO; } - - if (offset != -1) afile->offset = offset; + + if (offset != -1) + afile->offset = offset; AFS_GUNLOCK(); - code = gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset, - AFS_UIOSYS, 0, 0x7fffffff, &afs_osi_cred, &resid); + code = + gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset, + AFS_UIOSYS, 0, 0x7fffffff, &afs_osi_cred, &resid); AFS_GLOCK(); if (code == 0) { code = asize - resid; @@ -196,42 +200,44 @@ afs_osi_Read(afile, offset, aptr, asize) #ifdef AFS_SGI_EFS_IOPS_ENV osi_DisableAtimes(afile->vnode); #endif /* AFS_SGI_EFS_IOPS_ENV */ - } - else { + } else { afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid, - ICL_TYPE_INT32, code); + ICL_TYPE_INT32, code); code = -1; } return code; } /* Generic write interface */ -afs_osi_Write(afile, offset, aptr, asize) - register struct osi_file *afile; - char *aptr; - afs_int32 offset; - afs_int32 asize; { +int +afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; ssize_t resid; register afs_int32 code; AFS_STATCNT(osi_Write); - if ( !afile ) - osi_Panic("afs_osi_Write called with null param"); - if (offset != -1) afile->offset = offset; + if (!afile) + osi_Panic("afs_osi_Write called with null param"); + if (offset != -1) + afile->offset = offset; AFS_GUNLOCK(); - code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, afile->offset, - AFS_UIOSYS, 0, 0x7fffffff, &afs_osi_cred, &resid); + code = + gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, + afile->offset, AFS_UIOSYS, 0, 0x7fffffff, &afs_osi_cred, + &resid); AFS_GLOCK(); if (code == 0) { code = asize - resid; afile->offset += code; - } - else { - if (code == ENOSPC) afs_warnuser("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n"); + } else { + if (code == ENOSPC) + afs_warnuser + ("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n"); code = -1; } if (afile->proc) { - (*afile->proc)(afile, code); + (*afile->proc) (afile, code); } return code; } @@ -240,9 +246,8 @@ afs_osi_Write(afile, offset, aptr, asize) /* This work should be handled by physstrat in ca/machdep.c. This routine written from the RT NFS port strategy routine. It has been generalized a bit, but should still be pretty clear. */ -int afs_osi_MapStrategy(aproc, bp) - int (*aproc)(); - register struct buf *bp; +int +afs_osi_MapStrategy(int (*aproc) (), register struct buf *bp) { afs_int32 returnCode; @@ -255,13 +260,12 @@ int afs_osi_MapStrategy(aproc, bp) void -shutdown_osifile() +shutdown_osifile(void) { - extern int afs_cold_shutdown; + extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); - if (afs_cold_shutdown) { - afs_osicred_initialized = 0; - } + AFS_STATCNT(shutdown_osifile); + if (afs_cold_shutdown) { + afs_osicred_initialized = 0; + } } - diff --git a/src/afs/IRIX/osi_groups.c b/src/afs/IRIX/osi_groups.c index 2a646345b..c77465f7b 100644 --- a/src/afs/IRIX/osi_groups.c +++ b/src/afs/IRIX/osi_groups.c @@ -16,27 +16,22 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_groups.c,v 1.1.1.5 2001/09/11 14:25:01 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/IRIX/osi_groups.c,v 1.9 2003/07/15 23:14:23 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/afs_stats.h" /* statistics */ static int -afs_getgroups( - struct ucred *cred, - int ngroups, - gid_t *gidset); + afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset); static int -afs_setgroups( - struct ucred **cred, - int ngroups, - gid_t *gidset, - int change_parent); + afs_setgroups(struct ucred **cred, int ngroups, gid_t * gidset, + int change_parent); /* This is common code between SGI's DFS and our AFS. Do *not* alter it's @@ -47,8 +42,9 @@ afs_setgroups( * Sets up the cred for the call to estgroups. This is pretty convoluted * in order to avoid including the private proc.h header file. */ -int fixup_pags(int **credpp, int ngroups, gid_t *gidset, int old_afs_pag, - int old_dfs_pag) +int +fixup_pags(int **credpp, int ngroups, gid_t * gidset, int old_afs_pag, + int old_dfs_pag) { int new_afs_pag = 0; int new_dfs_pag = 0; @@ -67,45 +63,46 @@ int fixup_pags(int **credpp, int ngroups, gid_t *gidset, int old_afs_pag, return EFAULT; } - if (ngroups >= 2) { /* possibly an AFS PAG */ - new_afs_pag = (afs_get_pag_from_groups(groups[0], groups[1]) != NOPAG); + if (ngroups >= 2) { /* possibly an AFS PAG */ + new_afs_pag = + (afs_get_pag_from_groups(groups[0], groups[1]) != NOPAG); } - if (ngroups >= 1) { /* possibly a DFS PAG */ - new_dfs_pag = (int) groups[ngroups-1]; + if (ngroups >= 1) { /* possibly a DFS PAG */ + new_dfs_pag = (int)groups[ngroups - 1]; if (((new_dfs_pag >> 24) & 0xff) == 'A') - new_dfs_pag = (int) groups[ngroups-1]; + new_dfs_pag = (int)groups[ngroups - 1]; else new_dfs_pag = 0; } /* Now compute the number of groups we will need. */ new = ngroups; - if (old_afs_pag && !new_afs_pag) /* prepend old AFS pag */ + if (old_afs_pag && !new_afs_pag) /* prepend old AFS pag */ new += 2; - if (old_dfs_pag && !new_dfs_pag) /* append old DFS pag */ - new ++; + if (old_dfs_pag && !new_dfs_pag) /* append old DFS pag */ + new++; if (new > ngroups_max) - return EINVAL; /* sorry */ + return EINVAL; /* sorry */ - cr = crdup(OSI_GET_CURRENT_CRED()); /* we will replace all the groups. */ - memset((char*)&cr->cr_groups, 0, ngroups_max * sizeof(gid_t)); + cr = crdup(OSI_GET_CURRENT_CRED()); /* we will replace all the groups. */ + memset((char *)&cr->cr_groups, 0, ngroups_max * sizeof(gid_t)); /* Now cobble the new groups list together. */ new = 0; old = 0; - if (old_afs_pag && !new_afs_pag) { /* prepend old AFS pag */ + if (old_afs_pag && !new_afs_pag) { /* prepend old AFS pag */ gid_t g0, g1; changed = 1; afs_get_groups_from_pag(old_afs_pag, &g0, &g1); cr->cr_groups[new++] = g0; cr->cr_groups[new++] = g1; } - + for (old = 0; old < ngroups; old++) cr->cr_groups[new++] = groups[old]; - if (old_dfs_pag && !new_dfs_pag) { /* append old DFS pag */ + if (old_dfs_pag && !new_dfs_pag) { /* append old DFS pag */ changed = 1; cr->cr_groups[new++] = old_dfs_pag; } @@ -114,8 +111,7 @@ int fixup_pags(int **credpp, int ngroups, gid_t *gidset, int old_afs_pag, if (changed) { cr->cr_ngroups = new; *credpp = cr; - } - else { + } else { crfree(cr); *credpp = NULL; } @@ -127,7 +123,8 @@ int fixup_pags(int **credpp, int ngroups, gid_t *gidset, int old_afs_pag, * If flag = 0 this is a DFS pag held in one group. * If flag = 1 this is a AFS pag held in two group entries */ -static int afsDFS_SetPagInCred(struct ucred *credp, int pag, int flag) +static int +afsDFS_SetPagInCred(struct ucred *credp, int pag, int flag) { int *gidset; int i, ngrps; @@ -138,31 +135,31 @@ static int afsDFS_SetPagInCred(struct ucred *credp, int pag, int flag) ngrps = credp->cr_ngroups + groups_taken; if (ngrps >= ngroups_max) - return E2BIG; + return E2BIG; + - if (flag) { - /* Break out the AFS pag into two groups */ - afs_get_groups_from_pag(pag, &g0, &g1); + /* Break out the AFS pag into two groups */ + afs_get_groups_from_pag(pag, &g0, &g1); } newcredp = crdup(credp); newcredp->cr_ngroups = ngrps; if (flag) { - /* AFS case */ - newcredp->cr_groups[0] = g0; - newcredp->cr_groups[1] = g1; + /* AFS case */ + newcredp->cr_groups[0] = g0; + newcredp->cr_groups[1] = g1; } else { - /* DFS case */ - if (PagInCred(newcredp) != NOPAG){ - /* found an AFS PAG is set in this cred */ - n = 2; - } - newcredp->cr_groups[n] = pag; + /* DFS case */ + if (PagInCred(newcredp) != NOPAG) { + /* found an AFS PAG is set in this cred */ + n = 2; + } + newcredp->cr_groups[n] = pag; } - for (i=n; icr_ngroups; i++) - newcredp->cr_groups[i+groups_taken] = credp->cr_groups[i]; + for (i = n; i < credp->cr_ngroups; i++) + newcredp->cr_groups[i + groups_taken] = credp->cr_groups[i]; /* estgroups sets current threads cred from newcredp and crfree's credp */ estgroups(credp, newcredp); @@ -172,11 +169,12 @@ static int afsDFS_SetPagInCred(struct ucred *credp, int pag, int flag) #endif /* AFS_SGI65_ENV */ /* SGI's osi_GetPagFromCred - They return a long. */ -int osi_DFSGetPagFromCred(struct ucred *credp) +int +osi_DFSGetPagFromCred(struct ucred *credp) { int pag; int ngroups; - + /* * For IRIX, the PAG is stored in the first entry * of the gruop list in the cred structure. gid_t's @@ -185,47 +183,47 @@ int osi_DFSGetPagFromCred(struct ucred *credp) */ ngroups = credp->cr_ngroups; if (ngroups < 1) - return NOPAG; + return NOPAG; /* * Keep in mind that we might be living with AFS here. * This means we don't really know if our DFS PAG is in * the first or third group entry. */ #ifdef AFS_SGI65_ENV - pag = credp->cr_groups[ngroups-1]; + pag = credp->cr_groups[ngroups - 1]; #else pag = credp->cr_groups[0]; - if (PagInCred(credp) != NOPAG ){ - /* AFS has a PAG value in the first two group entries */ - if (ngroups < 3) - return NOPAG; - pag = credp->cr_groups[2]; + if (PagInCred(credp) != NOPAG) { + /* AFS has a PAG value in the first two group entries */ + if (ngroups < 3) + return NOPAG; + pag = credp->cr_groups[2]; } #endif if (((pag >> 24) & 0xff) == 'A') - return pag; + return pag; else - return NOPAG; + return NOPAG; } - + int -Afs_xsetgroups(int ngroups, gid_t *gidset) +Afs_xsetgroups(int ngroups, gid_t * gidset) { int old_afs_pag = NOPAG; int old_dfs_pag = NOPAG; int code = 0; struct ucred *credp = OSI_GET_CURRENT_CRED(); struct ucred *modcredp; - + credp = OSI_GET_CURRENT_CRED(); /* First get any old PAG's */ old_afs_pag = PagInCred(credp); old_dfs_pag = osi_DFSGetPagFromCred(credp); - + /* Set the passed in group list. */ if (code = setgroups(ngroups, gidset)) - return code; + return code; #ifdef AFS_SGI65_ENV if (old_afs_pag == NOPAG && old_dfs_pag == NOPAG) @@ -236,42 +234,43 @@ Afs_xsetgroups(int ngroups, gid_t *gidset) * the uthread until we return to user space. So, we examine the passed * in groups in fixup_pags. */ - code = fixup_pags(&modcredp, ngroups, gidset, - (old_afs_pag == NOPAG) ? 0 : old_afs_pag, - (old_dfs_pag == NOPAG) ? 0 : old_dfs_pag); + code = + fixup_pags(&modcredp, ngroups, gidset, + (old_afs_pag == NOPAG) ? 0 : old_afs_pag, + (old_dfs_pag == NOPAG) ? 0 : old_dfs_pag); if (!code && modcredp) estgroups(OSI_GET_CURRENT_PROCP(), modcredp); #else - + /* * The setgroups gave our curent thread a new cred pointer * Get the value again */ credp = OSI_GET_CURRENT_CRED(); if ((PagInCred(credp) == NOPAG) && (old_afs_pag != NOPAG)) { - /* reset the AFS PAG */ - code = afsDFS_SetPagInCred(credp, old_afs_pag, 1); + /* reset the AFS PAG */ + code = afsDFS_SetPagInCred(credp, old_afs_pag, 1); } /* * Once again get the credp because the afsDFS_SetPagInCred might have * assigned a new one. */ credp = OSI_GET_CURRENT_CRED(); - if ((osi_DFSGetPagFromCred(credp)==NOPAG) + if ((osi_DFSGetPagFromCred(credp) == NOPAG) && (old_dfs_pag != NOPAG)) { - code = afsDFS_SetPagInCred(credp, old_dfs_pag, 0); + code = afsDFS_SetPagInCred(credp, old_dfs_pag, 0); } -#endif /* AFS_SGI65_ENV */ +#endif /* AFS_SGI65_ENV */ return code; } int setpag(cred, pagvalue, newpag, change_parent) - struct ucred **cred; - afs_uint32 pagvalue; - afs_uint32 *newpag; - afs_uint32 change_parent; + struct ucred **cred; + afs_uint32 pagvalue; + afs_uint32 *newpag; + afs_uint32 change_parent; { gid_t gidset[NGROUPS]; int ngroups, code; @@ -283,24 +282,24 @@ setpag(cred, pagvalue, newpag, change_parent) if (afs_get_pag_from_groups(gidset[0], gidset[1]) == NOPAG) { /* We will have to shift grouplist to make room for pag */ if (ngroups + 2 > NGROUPS) { -#ifdef AFS_SGI64_ENV - return (E2BIG); -#else +#if defined(KERNEL_HAVE_UERROR) return (setuerror(E2BIG), E2BIG); +#else + return (E2BIG); #endif } - for (j = ngroups -1; j >= 0; j--) { - gidset[j+2] = gidset[j]; - } + for (j = ngroups - 1; j >= 0; j--) { + gidset[j + 2] = gidset[j]; + } ngroups += 2; } - *newpag = (pagvalue == -1 ? genpag(): pagvalue); + *newpag = (pagvalue == -1 ? genpag() : pagvalue); afs_get_groups_from_pag(*newpag, &gidset[0], &gidset[1]); if (code = afs_setgroups(cred, ngroups, gidset, change_parent)) { -#ifdef AFS_SGI64_ENV - return code; -#else +#if defined(KERNEL_HAVE_UERROR) return (setuerror(code), code); +#else + return code; #endif } return code; @@ -308,10 +307,7 @@ setpag(cred, pagvalue, newpag, change_parent) static int -afs_getgroups( - struct ucred *cred, - int ngroups, - gid_t *gidset) +afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) { int ngrps, savengrps; gid_t *gp; @@ -321,18 +317,15 @@ afs_getgroups( savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); gp = cred->cr_groups; while (ngrps--) - *gidset++ = *gp++; + *gidset++ = *gp++; return savengrps; } static int -afs_setgroups( - struct ucred **cred, - int ngroups, - gid_t *gidset, - int change_parent) +afs_setgroups(struct ucred **cred, int ngroups, gid_t * gidset, + int change_parent) { gid_t *gp; cred_t *cr, *newcr; @@ -340,21 +333,21 @@ afs_setgroups( AFS_STATCNT(afs_setgroups); if (ngroups > ngroups_max) - return EINVAL; + return EINVAL; cr = *cred; if (!change_parent) - newcr = crdup(cr); + newcr = crdup(cr); else - newcr = cr; + newcr = cr; newcr->cr_ngroups = ngroups; gp = newcr->cr_groups; while (ngroups--) - *gp++ = *gidset++; + *gp++ = *gidset++; if (!change_parent) { #ifdef AFS_SGI65_ENV estgroups(OSI_GET_CURRENT_PROCP(), newcr); #else - estgroups(cr, newcr); + estgroups(cr, newcr); #endif } *cred = newcr; diff --git a/src/afs/IRIX/osi_idbg.c b/src/afs/IRIX/osi_idbg.c index 3ec909935..19ded0dd0 100644 --- a/src/afs/IRIX/osi_idbg.c +++ b/src/afs/IRIX/osi_idbg.c @@ -11,14 +11,15 @@ * Implementation of Irix IDBG facility for AFS. */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_idbg.c,v 1.1.1.4 2001/07/14 22:19:42 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/IRIX/osi_idbg.c,v 1.6 2003/07/15 23:14:23 shadow Exp $"); #ifdef AFS_SGI62_ENV -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ /* @@ -40,15 +41,15 @@ printflags(register unsigned int flags, register char **strings) } char *tab_vcache[] = { - "CStatd", /* 1 */ - "CBackup", /* 2 */ - "CRO", /* 4 */ - "CMValid", /* 8 */ - "CCore", /* 0x10 */ - "CDirty", /* 0x20 */ - "CSafeStore", /* 0x40 */ - "CMAPPED", /* 0x80 */ - "CNSHARE", /* 0x100 */ + "CStatd", /* 1 */ + "CBackup", /* 2 */ + "CRO", /* 4 */ + "CMValid", /* 8 */ + "CCore", /* 0x10 */ + "CDirty", /* 0x20 */ + "CSafeStore", /* 0x40 */ + "CMAPPED", /* 0x80 */ + "CNSHARE", /* 0x100 */ }; int @@ -56,119 +57,115 @@ idbg_prafsnode(OSI_VC_DECL(avc)) { OSI_VC_CONVERT(avc) - AFS_GLOCK(); + AFS_GLOCK(); qprintf(" Len %d DV %d Date %d Own %d Grp %d Mode 0%o Lnk %d\n", - avc->m.Length, avc->m.DataVersion, avc->m.Date, - avc->m.Owner, avc->m.Group, avc->m.Mode, avc->m.LinkCount); + avc->m.Length, avc->m.DataVersion, avc->m.Date, avc->m.Owner, + avc->m.Group, avc->m.Mode, avc->m.LinkCount); qprintf(" flushDV %d mapDV %d truncpos 0x%x cb 0x%x cbE 0x%x\n", - avc->flushDV, avc->mapDV, avc->truncPos, - avc->callback, avc->cbExpires); - qprintf(" opens %d ex/wr %d flckcnt %d state 0x%x ", - avc->opens, avc->execsOrWriters, avc->flockCount, - avc->states); + avc->flushDV, avc->mapDV, avc->truncPos, avc->callback, + avc->cbExpires); + qprintf(" opens %d ex/wr %d flckcnt %d state 0x%x ", avc->opens, + avc->execsOrWriters, avc->flockCount, avc->states); printflags(avc->states, tab_vcache); qprintf("\n"); #ifdef AFS_SGI64_ENV qprintf(" mapcnt %llu, mvstat %d anyAcc 0x%x Access 0x%x\n", avc->mapcnt, avc->mvstat, avc->anyAccess, avc->Access); - qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n", - avc->mvid, &avc->lock, avc->cred); - qprintf(" rwlock 0x%x (%d) id %llu trips %d\n", - &avc->vc_rwlock, valusema(&avc->vc_rwlock), avc->vc_rwlockid, - avc->vc_locktrips); + qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n", avc->mvid, &avc->lock, + avc->cred); + qprintf(" rwlock 0x%x (%d) id %llu trips %d\n", &avc->vc_rwlock, + valusema(&avc->vc_rwlock), avc->vc_rwlockid, avc->vc_locktrips); #else - qprintf(" mapcnt %d mvstat %d anyAcc 0x%x Access 0x%x\n", - avc->mapcnt, avc->mvstat, avc->anyAccess, avc->Access); - qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n", - avc->mvid, &avc->lock, avc->cred); - qprintf(" rwlock 0x%x (%d) id %d trips %d\n", - &avc->vc_rwlock, valusema(&avc->vc_rwlock), avc->vc_rwlockid, - avc->vc_locktrips); + qprintf(" mapcnt %d mvstat %d anyAcc 0x%x Access 0x%x\n", avc->mapcnt, + avc->mvstat, avc->anyAccess, avc->Access); + qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n", avc->mvid, &avc->lock, + avc->cred); + qprintf(" rwlock 0x%x (%d) id %d trips %d\n", &avc->vc_rwlock, + valusema(&avc->vc_rwlock), avc->vc_rwlockid, avc->vc_locktrips); #endif AFS_GUNLOCK(); return 0; } -extern struct afs_q VLRU; /*vcache LRU*/ +extern struct afs_q VLRU; /*vcache LRU */ static char *tab_vtypes[] = { - "VNON", - "VREG", - "VDIR", - "VBLK", - "VCHR", - "VLNK", - "VFIFO", - "VXNAM", - "VBAD", - "VSOCK", - 0 + "VNON", + "VREG", + "VDIR", + "VBLK", + "VCHR", + "VLNK", + "VFIFO", + "VXNAM", + "VBAD", + "VSOCK", + 0 }; int idbg_afsvfslist() { - struct vcache *tvc; - register struct afs_q *tq; - struct afs_q *uq; - afs_int32 nodeid; /* what ls prints as 'inode' */ + struct vcache *tvc; + register struct afs_q *tq; + struct afs_q *uq; + afs_int32 nodeid; /* what ls prints as 'inode' */ - AFS_GLOCK(); - for(tq = VLRU.prev; tq != &VLRU; tq = uq) { - tvc = QTOV(tq); - uq = QPrev(tq); - nodeid = tvc->fid.Fid.Vnode + (tvc->fid.Fid.Volume << 16); - nodeid &= 0x7fffffff; - qprintf("avp 0x%x type %s cnt %d pg %d map %d nodeid %d(0x%x)\n", - tvc, tab_vtypes[((vnode_t *)tvc)->v_type], - ((vnode_t *)tvc)->v_count, - (int) VN_GET_PGCNT((vnode_t *)tvc), - (int)tvc->mapcnt, nodeid, nodeid); - } - AFS_GUNLOCK(); - return 0; + AFS_GLOCK(); + for (tq = VLRU.prev; tq != &VLRU; tq = uq) { + tvc = QTOV(tq); + uq = QPrev(tq); + nodeid = tvc->fid.Fid.Vnode + (tvc->fid.Fid.Volume << 16); + nodeid &= 0x7fffffff; + qprintf("avp 0x%x type %s cnt %d pg %d map %d nodeid %d(0x%x)\n", tvc, + tab_vtypes[((vnode_t *) tvc)->v_type], + ((vnode_t *) tvc)->v_count, + (int)VN_GET_PGCNT((vnode_t *) tvc), (int)tvc->mapcnt, nodeid, + nodeid); + } + AFS_GUNLOCK(); + return 0; } static char *tab_userstates[] = { - "UHasTokens", - "UTokensBad", - "UPrimary", - "UNeedsReset", - "UPAGcounted", - "UNK", + "UHasTokens", + "UTokensBad", + "UPrimary", + "UNeedsReset", + "UPAGcounted", + "UNK", }; static void idbg_pruser(struct unixuser *tu) { - qprintf("@0x%x nxt 0x%x uid %d (0x%x) cell 0x%x vid 0x%x ref %d\n", - tu, tu->next, tu->uid, tu->uid, tu->cell, - tu->vid, tu->refCount); - qprintf("time %d stLen %d stp 0x%x exp 0x%x ", - tu->tokenTime, tu->stLen, tu->stp, tu->exporter); + qprintf("@0x%x nxt 0x%x uid %d (0x%x) cell 0x%x vid 0x%x ref %d\n", tu, + tu->next, tu->uid, tu->uid, tu->cell, tu->vid, tu->refCount); + qprintf("time %d stLen %d stp 0x%x exp 0x%x ", tu->tokenTime, tu->stLen, + tu->stp, tu->exporter); printflags(tu->states, tab_userstates); qprintf("\n"); qprintf("ClearToken: handle 0x%x ViceID 0x%x Btime %d Etime %d\n", - tu->ct.AuthHandle, tu->ct.ViceId, tu->ct.BeginTimestamp, - tu->ct.EndTimestamp); + tu->ct.AuthHandle, tu->ct.ViceId, tu->ct.BeginTimestamp, + tu->ct.EndTimestamp); } extern struct unixuser *afs_users[NUSERS]; int idbg_afsuser(void *x) { - struct unixuser *tu; - int i; - AFS_GLOCK(); + struct unixuser *tu; + int i; + AFS_GLOCK(); - if (x == (void *)-1L) { - for (i = 0; i < NUSERS; i++) - for (tu = afs_users[i]; tu; tu = tu->next) - idbg_pruser(tu); - } else - idbg_pruser((struct unixuser *)x); + if (x == (void *)-1L) { + for (i = 0; i < NUSERS; i++) + for (tu = afs_users[i]; tu; tu = tu->next) + idbg_pruser(tu); + } else + idbg_pruser((struct unixuser *)x); - AFS_GUNLOCK(); - return 0; + AFS_GUNLOCK(); + return 0; } #endif /* AFS_SGI62_ENV */ diff --git a/src/afs/IRIX/osi_inode.c b/src/afs/IRIX/osi_inode.c index 4a04d99f0..45741b2af 100644 --- a/src/afs/IRIX/osi_inode.c +++ b/src/afs/IRIX/osi_inode.c @@ -40,14 +40,15 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_inode.c,v 1.1.1.6 2001/09/11 14:25:02 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/IRIX/osi_inode.c,v 1.11 2003/07/15 23:14:23 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/osi_inode.h" -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/osi_inode.h" +#include "afs/afs_stats.h" /* statistics stuff */ #define BAD_IGET -1000 @@ -58,7 +59,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_inode.c,v 1.1.1.6 2001/09/ /* * `INODESPECIAL' type inodes are ones that describe volumes. */ -#define INODESPECIAL 0xffffffff /* ... from ../vol/viceinode.h */ +#define INODESPECIAL 0xffffffff /* ... from ../vol/viceinode.h */ #endif /* * copy disk inode to incore inode and vice-versa @@ -66,82 +67,84 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_inode.c,v 1.1.1.6 2001/09/ void afsdptoip(struct efs_dinode *dp, struct inode *ip) { - struct afsparms *ap; - - ip->i_afs = kmem_alloc(sizeof(struct afsparms), KM_SLEEP); - osi_Assert(ip->i_version == EFS_IVER_AFSSPEC - || ip->i_version == EFS_IVER_AFSINO); - ap = (struct afsparms *)ip->i_afs; - /* vicep1 is VOLid */ - ap->vicep1 = dmag(dp, 0) << 24 | dmag(dp, 1) << 16 | - dmag(dp, 2) << 8 | dmag(dp, 3) << 0; - - if (ip->i_version == EFS_IVER_AFSSPEC) { - ap->vicep3 = dmag(dp, 8); /* Type */ - ap->vicep4 = dmag(dp, 4) << 24 | dmag(dp, 5) << 16 | - dmag(dp, 6) << 8 | dmag(dp, 7) << 0; - - } else { - /* vnode number */ - ap->vicep2 = dmag(dp, 4) << 16 | - dmag(dp, 5) << 8 | dmag(dp, 6) << 0; - /* disk uniqifier */ - ap->vicep3 = dmag(dp, 7) << 16 | - dmag(dp, 8) << 8 | dmag(dp, 9) << 0; - /* data version */ - ap->vicep4 = dmag(dp, 10) << 16 | - dmag(dp, 11) << 8 | (dp)->di_spare; - } + struct afsparms *ap; + + ip->i_afs = kmem_alloc(sizeof(struct afsparms), KM_SLEEP); + osi_Assert(ip->i_version == EFS_IVER_AFSSPEC + || ip->i_version == EFS_IVER_AFSINO); + ap = (struct afsparms *)ip->i_afs; + /* vicep1 is VOLid */ + ap->vicep1 = + dmag(dp, 0) << 24 | dmag(dp, 1) << 16 | dmag(dp, 2) << 8 | dmag(dp, + 3) << + 0; + + if (ip->i_version == EFS_IVER_AFSSPEC) { + ap->vicep3 = dmag(dp, 8); /* Type */ + ap->vicep4 = + dmag(dp, 4) << 24 | dmag(dp, 5) << 16 | dmag(dp, + 6) << 8 | dmag(dp, + 7) << + 0; + + } else { + /* vnode number */ + ap->vicep2 = dmag(dp, 4) << 16 | dmag(dp, 5) << 8 | dmag(dp, 6) << 0; + /* disk uniqifier */ + ap->vicep3 = dmag(dp, 7) << 16 | dmag(dp, 8) << 8 | dmag(dp, 9) << 0; + /* data version */ + ap->vicep4 = dmag(dp, 10) << 16 | dmag(dp, 11) << 8 | (dp)->di_spare; + } } void afsiptodp(struct inode *ip, struct efs_dinode *dp) { - struct afsparms *ap; - - if (ip->i_afs == NULL) - return; - - osi_Assert(ip->i_version == EFS_IVER_AFSSPEC - || ip->i_version == EFS_IVER_AFSINO); - ap = (struct afsparms *)ip->i_afs; - /* vicep1 is VOLid */ - dmag(dp, 0) = ap->vicep1 >> 24; - dmag(dp, 1) = ap->vicep1 >> 16; - dmag(dp, 2) = ap->vicep1 >> 8; - dmag(dp, 3) = ap->vicep1 >> 0; - - if (ip->i_version == EFS_IVER_AFSSPEC) { - /* Type */ - dmag(dp, 8) = ap->vicep3; - /* ParentId */ - dmag(dp, 4) = ap->vicep4 >> 24; - dmag(dp, 5) = ap->vicep4 >> 16; - dmag(dp, 6) = ap->vicep4 >> 8; - dmag(dp, 7) = ap->vicep4 >> 0; - } else { - /* vnode number */ - dmag(dp, 4) = ap->vicep2 >> 16; - dmag(dp, 5) = ap->vicep2 >> 8; - dmag(dp, 6) = ap->vicep2 >> 0; - /* disk uniqifier */ - dmag(dp, 7) = ap->vicep3 >> 16; - dmag(dp, 8) = ap->vicep3 >> 8; - dmag(dp, 9) = ap->vicep3 >> 0; - /* data version */ - dmag(dp, 10) = ap->vicep4 >> 16; - dmag(dp, 11) = ap->vicep4 >> 8; - dp->di_spare = ap->vicep4 >> 0; - } + struct afsparms *ap; + + if (ip->i_afs == NULL) + return; + + osi_Assert(ip->i_version == EFS_IVER_AFSSPEC + || ip->i_version == EFS_IVER_AFSINO); + ap = (struct afsparms *)ip->i_afs; + /* vicep1 is VOLid */ + dmag(dp, 0) = ap->vicep1 >> 24; + dmag(dp, 1) = ap->vicep1 >> 16; + dmag(dp, 2) = ap->vicep1 >> 8; + dmag(dp, 3) = ap->vicep1 >> 0; + + if (ip->i_version == EFS_IVER_AFSSPEC) { + /* Type */ + dmag(dp, 8) = ap->vicep3; + /* ParentId */ + dmag(dp, 4) = ap->vicep4 >> 24; + dmag(dp, 5) = ap->vicep4 >> 16; + dmag(dp, 6) = ap->vicep4 >> 8; + dmag(dp, 7) = ap->vicep4 >> 0; + } else { + /* vnode number */ + dmag(dp, 4) = ap->vicep2 >> 16; + dmag(dp, 5) = ap->vicep2 >> 8; + dmag(dp, 6) = ap->vicep2 >> 0; + /* disk uniqifier */ + dmag(dp, 7) = ap->vicep3 >> 16; + dmag(dp, 8) = ap->vicep3 >> 8; + dmag(dp, 9) = ap->vicep3 >> 0; + /* data version */ + dmag(dp, 10) = ap->vicep4 >> 16; + dmag(dp, 11) = ap->vicep4 >> 8; + dp->di_spare = ap->vicep4 >> 0; + } } void afsidestroy(struct inode *ip) { - if (ip->i_afs) { - kmem_free(ip->i_afs, sizeof(struct afsparms)); - ip->i_afs = NULL; - } + if (ip->i_afs) { + kmem_free(ip->i_afs, sizeof(struct afsparms)); + ip->i_afs = NULL; + } } extern int efs_fstype; @@ -170,8 +173,9 @@ getinode(struct vfs *vfsp, dev_t dev, ino_t inode, struct inode **ipp) return ENOSYS; #endif - if (error = iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)), - (unsigned int)(inode&0xffffffff), &ip)) { + if (error = + iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)), + (unsigned int)(inode & 0xffffffff), &ip)) { return error; } *ipp = ip; @@ -197,8 +201,8 @@ dev_t XFS_IGET_DEV; #define SET_XFS_ERROR(POS, DEV, INO) \ XFS_IGET_EPOS = (POS), XFS_IGET_DEV = (DEV), XFS_IGET_INO = (INO) -int xfs_getinode(struct vfs *vfsp, dev_t dev, ino_t inode, - struct xfs_inode **ipp) +int +xfs_getinode(struct vfs *vfsp, dev_t dev, ino_t inode, struct xfs_inode **ipp) { struct xfs_inode *ip; int error; @@ -222,9 +226,9 @@ int xfs_getinode(struct vfs *vfsp, dev_t dev, ino_t inode, #endif if (error = xfs_iget((((struct mount *) - ((vfsp)->vfs_bh.bh_first)->bd_pdata)), - (void*)0, (xfs_ino_t)inode, - XFS_ILOCK_SHARED, &ip, (daddr_t)0)) { + ((vfsp)->vfs_bh.bh_first)->bd_pdata)), (void *)0, + (xfs_ino_t) inode, XFS_ILOCK_SHARED, &ip, + (daddr_t) 0)) { SET_XFS_ERROR(3, vfsp->vfs_dev, inode); return error; } @@ -236,8 +240,9 @@ int xfs_getinode(struct vfs *vfsp, dev_t dev, ino_t inode, /* xfs_igetinode now returns an unlocked inode. This is fine, since we * have a refcount on the holding vnode. */ -int xfs_igetinode(struct vfs *vfsp, dev_t dev, ino_t inode, - struct xfs_inode **ipp) +int +xfs_igetinode(struct vfs *vfsp, dev_t dev, ino_t inode, + struct xfs_inode **ipp) { struct xfs_inode *ip; vnode_t *vp; @@ -275,22 +280,23 @@ int xfs_igetinode(struct vfs *vfsp, dev_t dev, ino_t inode, * ***************************************************************************/ struct icreateargs { - sysarg_t dev; - sysarg_t near_inode; - sysarg_t param1; - sysarg_t param2; - sysarg_t param3; - sysarg_t param4; + sysarg_t dev; + sysarg_t near_inode; + sysarg_t param1; + sysarg_t param2; + sysarg_t param3; + sysarg_t param4; }; /* EFS only fs suite uses this entry point - icreate in afssyscalls.c. */ int -icreate(struct icreateargs *uap, rval_t *rvp) +icreate(struct icreateargs *uap, rval_t * rvp) { #ifdef AFS_SGI_EFS_IOPS_ENV AFS_STATCNT(icreate); - return(afs_syscall_icreate(uap->dev, uap->near_inode, uap->param1, - uap->param2, uap->param3, uap->param4, rvp)); + return (afs_syscall_icreate + (uap->dev, uap->near_inode, uap->param1, uap->param2, uap->param3, + uap->param4, rvp)); #else return ENOSYS; #endif @@ -299,51 +305,51 @@ icreate(struct icreateargs *uap, rval_t *rvp) #ifdef AFS_SGI_EFS_IOPS_ENV int afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp) -afs_uint32 dev, near_inode, param1, param2, param3, param4; -rval_t *rvp; + afs_uint32 dev, near_inode, param1, param2, param3, param4; + rval_t *rvp; { - struct inode *ip, *newip; - struct afsparms *ap; - struct cred cr; - int error; + struct inode *ip, *newip; + struct afsparms *ap; + struct cred cr; + int error; - AFS_STATCNT(afs_syscall_icreate); - if (!afs_suser()) - return EPERM; + AFS_STATCNT(afs_syscall_icreate); + if (!afs_suser()) + return EPERM; - if (error = getinode(0, (dev_t)dev, 2, &ip)) - return error; + if (error = getinode(0, (dev_t) dev, 2, &ip)) + return error; - cr.cr_uid = 0; - cr.cr_gid = -2; - if (error = efs_ialloc(ip, IFREG, 1, NODEV, &newip, &cr)) { - iput(ip); - return error; - } + cr.cr_uid = 0; + cr.cr_gid = -2; + if (error = efs_ialloc(ip, IFREG, 1, NODEV, &newip, &cr)) { iput(ip); - osi_Assert(newip); - newip->i_flags |= IACC|IUPD|ICHG; - - osi_Assert(newip->i_afs == NULL); - newip->i_afs = kmem_alloc(sizeof(struct afsparms), KM_SLEEP); - if (param2 == INODESPECIAL) - newip->i_version = EFS_IVER_AFSSPEC; - else - newip->i_version = EFS_IVER_AFSINO; - ap = (struct afsparms *)newip->i_afs; - ap->vicep1 = param1; /* VOLid */ - ap->vicep2 = param2; /* Vnode # */ - ap->vicep3 = param3; /* SPEC:type INO:vnode uniq */ - ap->vicep4 = param4; /* SPEC:parentId INO:data version */ - rvp->r_val1 = newip->i_number; - iput(newip); - return 0; + return error; + } + iput(ip); + osi_Assert(newip); + newip->i_flags |= IACC | IUPD | ICHG; + + osi_Assert(newip->i_afs == NULL); + newip->i_afs = kmem_alloc(sizeof(struct afsparms), KM_SLEEP); + if (param2 == INODESPECIAL) + newip->i_version = EFS_IVER_AFSSPEC; + else + newip->i_version = EFS_IVER_AFSINO; + ap = (struct afsparms *)newip->i_afs; + ap->vicep1 = param1; /* VOLid */ + ap->vicep2 = param2; /* Vnode # */ + ap->vicep3 = param3; /* SPEC:type INO:vnode uniq */ + ap->vicep4 = param4; /* SPEC:parentId INO:data version */ + rvp->r_val1 = newip->i_number; + iput(newip); + return 0; } #else /* !AFS_SGI_EFS_IOPS_ENV */ int afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp) -afs_uint32 dev, near_inode, param1, param2, param3, param4; -rval_t *rvp; + afs_uint32 dev, near_inode, param1, param2, param3, param4; + rval_t *rvp; { return ENOSYS; } @@ -388,7 +394,7 @@ int afs_vol_create_lock_inited = 0; */ int xfs_icreatename64(struct vfs *vfsp, int datap, int datalen, - afs_inode_params_t params, ino_t *inop) + afs_inode_params_t params, ino_t * inop) { #define AFS_PNAME_SIZE 16 char path[64]; @@ -400,7 +406,7 @@ xfs_icreatename64(struct vfs *vfsp, int datap, int datalen, int code = 0, unused; struct vnode *vp; struct vnode *dvp; - int rw_vno; /* volume ID of parent volume */ + int rw_vno; /* volume ID of parent volume */ int i; int createdDir = 0; size_t junk; @@ -411,7 +417,7 @@ xfs_icreatename64(struct vfs *vfsp, int datap, int datalen, if (datalen >= AFS_PNAME_SIZE) return E2BIG; - AFS_COPYINSTR((char*)datap, path, AFS_PNAME_SIZE-1, &junk, unused); + AFS_COPYINSTR((char *)datap, path, AFS_PNAME_SIZE - 1, &junk, unused); if (*path != '/') { return EINVAL; } @@ -426,14 +432,13 @@ xfs_icreatename64(struct vfs *vfsp, int datap, int datalen, if (params[1] == INODESPECIAL) AFS_LOCK_VOL_CREATE(); - code = gop_lookupname(path, AFS_UIOSYS, FOLLOW, (struct vnode **) 0, &dvp); + code = gop_lookupname(path, AFS_UIOSYS, FOLLOW, NULL, &dvp); if (code == ENOENT) { /* Maybe it's an old directory name format. */ - AFS_COPYINSTR((char*)datap, name, AFS_PNAME_SIZE-1, &junk, unused); + AFS_COPYINSTR((char *)datap, name, AFS_PNAME_SIZE - 1, &junk, unused); strcat(name, "/."); strcat(name, int_to_base64(stmp1, rw_vno)); - code = gop_lookupname(name, AFS_UIOSYS, FOLLOW, (struct vnode **) 0, - &dvp); + code = gop_lookupname(name, AFS_UIOSYS, FOLLOW, NULL, &dvp); if (!code) { /* Use old name format. */ strcpy(path, name); @@ -444,78 +449,78 @@ xfs_icreatename64(struct vfs *vfsp, int datap, int datalen, if (code == ENOENT) { afs_xfs_dattr_t dattr; /* make directory. */ - - code = AFS_VN_OPEN(path, UIO_SYSSPACE, FCREAT|FEXCL, 0700, &dvp, - CRMKDIR); + + code = + AFS_VN_OPEN(path, UIO_SYSSPACE, FCREAT | FEXCL, 0700, &dvp, + CRMKDIR); if (code) { if (code == EEXIST) { /* someone beat us to it? */ - code = gop_lookupname(path, AFS_UIOSYS, 0, (struct vnode **) 0, - &dvp); + code = gop_lookupname(path, AFS_UIOSYS, 0, NULL, &dvp); } if (code) { AFS_UNLOCK_VOL_CREATE(); return code; } - } - else + } else createdDir = 1; - memset((char*)&dattr, 0, sizeof(dattr)); + memset((char *)&dattr, 0, sizeof(dattr)); dattr.atd_version = AFS_XFS_ATD_VERS; dattr.atd_volume = rw_vno; - AFS_VOP_ATTR_SET(dvp, AFS_XFS_DATTR, (char*)&dattr, - SIZEOF_XFS_DATTR_T, - ATTR_ROOT|ATTR_CREATE, OSI_GET_CURRENT_CRED(), code); + AFS_VOP_ATTR_SET(dvp, AFS_XFS_DATTR, (char *)&dattr, + SIZEOF_XFS_DATTR_T, ATTR_ROOT | ATTR_CREATE, + OSI_GET_CURRENT_CRED(), code); if (code) { VN_RELE(dvp); if (createdDir) - (void) vn_remove(path, UIO_SYSSPACE, RMDIRECTORY); + (void)vn_remove(path, UIO_SYSSPACE, RMDIRECTORY); AFS_UNLOCK_VOL_CREATE(); return code; } } - vattr.va_mask = AT_FSID|AT_NODEID; /* gets a guick return using FSID*/ + vattr.va_mask = AT_FSID | AT_NODEID; /* gets a guick return using FSID */ AFS_VOP_GETATTR(dvp, &vattr, 0, OSI_GET_CURRENT_CRED(), code); if (code) { VN_RELE(dvp); return code; } - memset((char*)&attrs, 0, sizeof(attrs)); + memset((char *)&attrs, 0, sizeof(attrs)); attrs.at_pino = vattr.va_nodeid; VN_RELE(dvp); - + /* Create the desired file. Use up to ten tries to create a unique name. */ - (void) strcpy(name, path); - (void) strcat(name, "/."); - (void) strcat(name, int_to_base64(stmp2, params[2])); + (void)strcpy(name, path); + (void)strcat(name, "/."); + (void)strcat(name, int_to_base64(stmp2, params[2])); s = &name[strlen(name)]; - attrs.at_tag = 0; /* Initial guess at a unique tag. */ - for (i=0; i<10; i++) { - *s = '\0'; - strcat(s, "."); - strcat(s, int_to_base64(stmp1, attrs.at_tag)); - code = AFS_VN_OPEN(name, UIO_SYSSPACE, FCREAT|FEXCL, 0600, &vp, - CRCREAT); + attrs.at_tag = 0; /* Initial guess at a unique tag. */ + for (i = 0; i < 10; i++) { + *s = '\0'; + strcat(s, "."); + strcat(s, int_to_base64(stmp1, attrs.at_tag)); + code = + AFS_VN_OPEN(name, UIO_SYSSPACE, FCREAT | FEXCL, 0600, &vp, + CRCREAT); if (!code || code != EEXIST) break; - attrs.at_tag ++ ; + attrs.at_tag++; } - /* Unlock the creation process since the directory now has a file in it.*/ + /* Unlock the creation process since the directory now has a file in it. */ if (params[1] == INODESPECIAL) AFS_UNLOCK_VOL_CREATE(); - + if (!code) { /* Set attributes. */ - memcpy((char*)attrs.at_param, (char*)params, sizeof(afs_inode_params_t)); + memcpy((char *)attrs.at_param, (char *)params, + sizeof(afs_inode_params_t)); attrs.at_attr_version = AFS_XFS_ATTR_VERS; attrs.at_name_version = name_version; - AFS_VOP_ATTR_SET(vp, AFS_XFS_ATTR, (char*)&attrs, - SIZEOF_XFS_ATTR_T, - ATTR_ROOT|ATTR_CREATE, OSI_GET_CURRENT_CRED(), + AFS_VOP_ATTR_SET(vp, AFS_XFS_ATTR, (char *)&attrs, SIZEOF_XFS_ATTR_T, + ATTR_ROOT | ATTR_CREATE, OSI_GET_CURRENT_CRED(), code); if (!code) { vattr.va_mode = 1; @@ -535,12 +540,12 @@ xfs_icreatename64(struct vfs *vfsp, int datap, int datalen, if (code) { /* remove partially created file. */ - (void) vn_remove(name, UIO_SYSSPACE, RMFILE); - + (void)vn_remove(name, UIO_SYSSPACE, RMFILE); + /* and directory if volume special file. */ if (createdDir) { AFS_LOCK_VOL_CREATE(); - (void) vn_remove(path, UIO_SYSSPACE, RMDIRECTORY); + (void)vn_remove(path, UIO_SYSSPACE, RMDIRECTORY); AFS_UNLOCK_VOL_CREATE(); } } @@ -574,24 +579,25 @@ afs_syscall_icreatename64(int dev, int datap, int datalen, int paramp, return ENXIO; } - AFS_COPYIN((char*)paramp, (char*)param, sizeof(afs_inode_params_t), code); + AFS_COPYIN((char *)paramp, (char *)param, sizeof(afs_inode_params_t), + code); if (vfsp->vfs_fstype == xfs_fstype) { - code = xfs_icreatename64(vfsp, datap, datalen, param, &ino); + code = xfs_icreatename64(vfsp, datap, datalen, param, &ino); if (code) return code; else { - AFS_COPYOUT((char*)&ino, (char*)inop, sizeof(ino_t), code); + AFS_COPYOUT((char *)&ino, (char *)inop, sizeof(ino_t), code); return code; } - } - else if (vfsp->vfs_fstype == efs_fstype) { - code = afs_syscall_icreate(dev, 0, param[0], param[1], param[2], - param[3], &rval); + } else if (vfsp->vfs_fstype == efs_fstype) { + code = + afs_syscall_icreate(dev, 0, param[0], param[1], param[2], + param[3], &rval); if (code) return code; else { - ino = (ino_t)rval.r_val1; - AFS_COPYOUT((char*)&ino, (char*)inop, sizeof(ino_t), code); + ino = (ino_t) rval.r_val1; + AFS_COPYOUT((char *)&ino, (char *)inop, sizeof(ino_t), code); return code; } } @@ -608,69 +614,66 @@ afs_syscall_icreatename64(int dev, int datap, int datalen, int paramp, * still in use. */ struct iopenargs { - sysarg_t dev; - sysarg_t inode; - sysarg_t usrmod; + sysarg_t dev; + sysarg_t inode; + sysarg_t usrmod; }; #ifdef AFS_SGI_XFS_IOPS_ENV struct iopenargs64 { - sysarg_t dev; - sysarg_t inode_hi; - sysarg_t inode_lo; - sysarg_t usrmod; + sysarg_t dev; + sysarg_t inode_hi; + sysarg_t inode_lo; + sysarg_t usrmod; }; #ifdef AFS_SGI65_ENV int -afs_syscall_iopen(int dev, ino_t inode, int usrmod, rval_t *rvp) +afs_syscall_iopen(int dev, ino_t inode, int usrmod, rval_t * rvp) { - struct file *fp; - int fd; - int error; - struct vfs* vfsp; - struct vnode *vp; + struct file *fp; + int fd; + int error; + struct vfs *vfsp; + struct vnode *vp; - AFS_STATCNT(afs_syscall_iopen); - if (!afs_suser()) - return EPERM; - vfsp = vfs_devsearch(dev, xfs_fstype); - if (!vfsp) - vfsp = vfs_devsearch(dev, efs_fstype); - if (!vfsp) - return ENXIO; + AFS_STATCNT(afs_syscall_iopen); + if (!afs_suser()) + return EPERM; + vfsp = vfs_devsearch(dev, xfs_fstype); + if (!vfsp) + vfsp = vfs_devsearch(dev, efs_fstype); + if (!vfsp) + return ENXIO; #ifdef AFS_SGI_EFS_IOPS_ENV - if (vfsp->vfs_fstype == efs_fstype) { - struct inode *ip; - if (error = igetinode(vfsp, (dev_t)dev, inode, &ip)) - return error; - vp = EFS_ITOV(ip); - if (error = vfile_alloc((usrmod+1) & (FMASK), &fp, &fd)) { - iput(ip); - return error; - } - iunlock(ip); + if (vfsp->vfs_fstype == efs_fstype) { + struct inode *ip; + if (error = igetinode(vfsp, (dev_t) dev, inode, &ip)) + return error; + vp = EFS_ITOV(ip); + if (error = vfile_alloc((usrmod + 1) & (FMASK), &fp, &fd)) { + iput(ip); + return error; } - else + iunlock(ip); + } else #endif /* AFS_SGI_EFS_IOPS_ENV */ - if (vfsp->vfs_fstype == xfs_fstype) { - struct xfs_inode *xip; - if (error = xfs_igetinode(vfsp, (dev_t)dev, inode, &xip)) - return error; - vp = XFS_ITOV(xip); - if (error = vfile_alloc((usrmod+1) & (FMASK), &fp, &fd)) { - VN_RELE(vp); - return error; - } - } - else { - osi_Panic("afs_syscall_iopen: bad fstype = %d\n", - vfsp->vfs_fstype); - } - vfile_ready(fp, vp); - rvp->r_val1 = fd; - return 0; + if (vfsp->vfs_fstype == xfs_fstype) { + struct xfs_inode *xip; + if (error = xfs_igetinode(vfsp, (dev_t) dev, inode, &xip)) + return error; + vp = XFS_ITOV(xip); + if (error = vfile_alloc((usrmod + 1) & (FMASK), &fp, &fd)) { + VN_RELE(vp); + return error; + } + } else { + osi_Panic("afs_syscall_iopen: bad fstype = %d\n", vfsp->vfs_fstype); + } + vfile_ready(fp, vp); + rvp->r_val1 = fd; + return 0; } #else /* afs_syscall_iopen @@ -678,67 +681,64 @@ afs_syscall_iopen(int dev, ino_t inode, int usrmod, rval_t *rvp) * 64 bit inode number. */ int -afs_syscall_iopen(int dev, ino_t inode, int usrmod, rval_t *rvp) +afs_syscall_iopen(int dev, ino_t inode, int usrmod, rval_t * rvp) { - struct file *fp; - int fd; - int error; - struct vfs* vfsp; - - AFS_STATCNT(afs_syscall_iopen); - if (!afs_suser()) - return EPERM; - vfsp = vfs_devsearch(dev); - if (!vfsp) { - return ENXIO; - } + struct file *fp; + int fd; + int error; + struct vfs *vfsp; - if (vfsp->vfs_fstype == xfs_fstype) { - struct xfs_inode *xip; - struct vnode *vp; - if (error = xfs_igetinode(vfsp, (dev_t)dev, inode, &xip)) - return error; - vp = XFS_ITOV(xip); - if (error = falloc(vp, (usrmod+1) & (FMASK), &fp, &fd)) { - VN_RELE(vp); - return error; - } - } - else if (vfsp->vfs_fstype == efs_fstype) { - struct inode *ip; - if (error = igetinode(vfsp, (dev_t)dev, inode, &ip)) - return error; - if (error = falloc(EFS_ITOV(ip), (usrmod+1) & (FMASK), &fp, &fd)) { - iput(ip); - return error; - } - iunlock(ip); + AFS_STATCNT(afs_syscall_iopen); + if (!afs_suser()) + return EPERM; + vfsp = vfs_devsearch(dev); + if (!vfsp) { + return ENXIO; + } + + if (vfsp->vfs_fstype == xfs_fstype) { + struct xfs_inode *xip; + struct vnode *vp; + if (error = xfs_igetinode(vfsp, (dev_t) dev, inode, &xip)) + return error; + vp = XFS_ITOV(xip); + if (error = falloc(vp, (usrmod + 1) & (FMASK), &fp, &fd)) { + VN_RELE(vp); + return error; } - else { - osi_Panic("afs_syscall_iopen: bad fstype = %d\n", - vfsp->vfs_fstype); + } else if (vfsp->vfs_fstype == efs_fstype) { + struct inode *ip; + if (error = igetinode(vfsp, (dev_t) dev, inode, &ip)) + return error; + if (error = falloc(EFS_ITOV(ip), (usrmod + 1) & (FMASK), &fp, &fd)) { + iput(ip); + return error; } - fready(fp); - rvp->r_val1 = fd; - return 0; + iunlock(ip); + } else { + osi_Panic("afs_syscall_iopen: bad fstype = %d\n", vfsp->vfs_fstype); + } + fready(fp); + rvp->r_val1 = fd; + return 0; } #endif /* AFS_SGI65_ENV */ int -iopen(struct iopenargs *uap, rval_t *rvp) +iopen(struct iopenargs *uap, rval_t * rvp) { - AFS_STATCNT(iopen); - return (afs_syscall_iopen(uap->dev, (ino_t)uap->inode, uap->usrmod, - rvp)); + AFS_STATCNT(iopen); + return (afs_syscall_iopen + (uap->dev, (ino_t) uap->inode, uap->usrmod, rvp)); } int -iopen64(struct iopenargs64 *uap, rval_t *rvp) +iopen64(struct iopenargs64 *uap, rval_t * rvp) { - AFS_STATCNT(iopen); - return (afs_syscall_iopen(uap->dev, - (ino_t)((uap->inode_hi<<32) | uap->inode_lo), - uap->usrmod, rvp)); + AFS_STATCNT(iopen); + return (afs_syscall_iopen + (uap->dev, (ino_t) ((uap->inode_hi << 32) | uap->inode_lo), + uap->usrmod, rvp)); } #else /* AFS_SGI_XFS_IOPS_ENV */ @@ -747,37 +747,37 @@ iopen64(struct iopenargs64 *uap, rval_t *rvp) * Original EFS only 32 bit iopen call. */ int -iopen(struct iopenargs *uap, rval_t *rvp) +iopen(struct iopenargs *uap, rval_t * rvp) { - AFS_STATCNT(iopen); - return (afs_syscall_iopen(uap->dev, uap->inode, uap->usrmod, rvp)); + AFS_STATCNT(iopen); + return (afs_syscall_iopen(uap->dev, uap->inode, uap->usrmod, rvp)); } int afs_syscall_iopen(dev, inode, usrmod, rvp) -int dev, inode, usrmod; -rval_t *rvp; + int dev, inode, usrmod; + rval_t *rvp; { - struct file *fp; - struct inode *ip; - int fd; - int error; - - AFS_STATCNT(afs_syscall_iopen); - if (!afs_suser()) - return EPERM; - if (error = igetinode(0, (dev_t)dev, inode, &ip)) - return error; - if (error = falloc(EFS_ITOV(ip), (usrmod+1) & (FMASK), &fp, &fd)) { - iput(ip); - return error; - } - iunlock(ip); - rvp->r_val1 = fd; + struct file *fp; + struct inode *ip; + int fd; + int error; + + AFS_STATCNT(afs_syscall_iopen); + if (!afs_suser()) + return EPERM; + if (error = igetinode(0, (dev_t) dev, inode, &ip)) + return error; + if (error = falloc(EFS_ITOV(ip), (usrmod + 1) & (FMASK), &fp, &fd)) { + iput(ip); + return error; + } + iunlock(ip); + rvp->r_val1 = fd; #ifdef AFS_SGI53_ENV - fready(fp); + fready(fp); #endif - return 0; + return 0; } #endif /* AFS_SGI_XFS_IOPS_ENV */ @@ -793,16 +793,17 @@ rval_t *rvp; * * XFS/EFS iinc/idec code for EFS. Uses 32 bit inode numbers. */ -static int efs_iincdec(vfsp, inode, inode_p1, amount) -struct vfs *vfsp; -int inode, inode_p1, amount; +static int +efs_iincdec(vfsp, inode, inode_p1, amount) + struct vfs *vfsp; + int inode, inode_p1, amount; { struct inode *ip; int error; if (error = igetinode(vfsp, NULL, inode, &ip)) return error; - + if (!IS_VICEMAGIC(ip)) error = EPERM; else if (((struct afsparms *)ip->i_afs)->vicep1 != inode_p1) @@ -826,8 +827,8 @@ int inode, inode_p1, amount; * * XFS/EFS iinc/idec code for EFS. Uses 64 bit inode numbers. */ -static int xfs_iincdec64(struct vfs *vfsp, ino_t inode, int inode_p1, - int amount) +static int +xfs_iincdec64(struct vfs *vfsp, ino_t inode, int inode_p1, int amount) { vnode_t *vp; xfs_inode_t *ip; @@ -838,24 +839,25 @@ static int xfs_iincdec64(struct vfs *vfsp, ino_t inode, int inode_p1, struct vattr vattr; int nlink; int vol; - - code = xfs_iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)), - (void*)0, (xfs_ino_t)inode, XFS_ILOCK_SHARED, &ip, - (daddr_t)0); + + code = + xfs_iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)), + (void *)0, (xfs_ino_t) inode, XFS_ILOCK_SHARED, &ip, + (daddr_t) 0); if (code) return code; vp = XFS_ITOV(ip); xfs_iunlock(ip, XFS_ILOCK_SHARED); - + vattr.va_mask = AT_GID | AT_UID | AT_MODE; AFS_VOP_GETATTR(vp, &vattr, 0, OSI_GET_CURRENT_CRED(), code); - if (code) + if (code) code = EPERM; if (!code && (vattr.va_gid != XFS_VICEMAGIC)) code = EPERM; - + if (!code && (AFS_XFS_VNO_CLIP(inode_p1) != vattr.va_uid)) code = ENXIO; @@ -876,16 +878,15 @@ static int xfs_iincdec64(struct vfs *vfsp, ino_t inode, int inode_p1, AFS_VOP_SETATTR(vp, &vattr, 0, OSI_GET_CURRENT_CRED(), code); VN_RELE(vp); return code; - } - else { + } else { char path[64]; b64_string_t stmp1, stmp2; vnode_t *dvp; xfs_inode_t *ip; - + length = SIZEOF_XFS_ATTR_T; - AFS_VOP_ATTR_GET(vp, AFS_XFS_ATTR, (char*)&attrs, &length, - ATTR_ROOT, OSI_GET_CURRENT_CRED(), code); + AFS_VOP_ATTR_GET(vp, AFS_XFS_ATTR, (char *)&attrs, &length, ATTR_ROOT, + OSI_GET_CURRENT_CRED(), code); VN_RELE(vp); if (!code) { if (length != SIZEOF_XFS_ATTR_T @@ -905,7 +906,7 @@ static int xfs_iincdec64(struct vfs *vfsp, ino_t inode, int inode_p1, /* Verify directory attributes. */ length = SIZEOF_XFS_DATTR_T; - AFS_VOP_ATTR_GET(dvp, AFS_XFS_DATTR , (char*)&dattr, &length, + AFS_VOP_ATTR_GET(dvp, AFS_XFS_DATTR, (char *)&dattr, &length, ATTR_ROOT, OSI_GET_CURRENT_CRED(), code); if (!code) { if (length != SIZEOF_XFS_DATTR_T @@ -921,35 +922,34 @@ static int xfs_iincdec64(struct vfs *vfsp, ino_t inode, int inode_p1, strcat(path, int_to_base64(stmp1, attrs.at_param[2])); strcat(path, "."); strcat(path, int_to_base64(stmp1, attrs.at_tag)); - + AFS_VOP_REMOVE(dvp, path, OSI_GET_CURRENT_CRED(), code); - + if (!code) { int code2; vattr.va_mask = AT_NLINK; - AFS_VOP_GETATTR(dvp, &vattr, 0, OSI_GET_CURRENT_CRED(), - code2); + AFS_VOP_GETATTR(dvp, &vattr, 0, OSI_GET_CURRENT_CRED(), code2); if (!code2) { if (vattr.va_nlink == 2) { - vnode_t *ddvp; /* parent of volume directory. */ + vnode_t *ddvp; /* parent of volume directory. */ /* Try to remove the directory if this is a volume * special file. It's ok to fail. */ - AFS_VOP_LOOKUP(dvp, "..", &ddvp, - (struct pathname *)NULL, + AFS_VOP_LOOKUP(dvp, "..", &ddvp, (struct pathname *)NULL, 0, OSI_GET_CURRENT_RDIR(), OSI_GET_CURRENT_CRED(), code2); if (!code2) { VN_RELE(dvp); - dvp = (vnode_t*)0; + dvp = (vnode_t *) 0; strcpy(path, "."); if (attrs.at_name_version == AFS_XFS_NAME_VERS2) strcpy(path, AFS_INODE_DIR_NAME); - else + else strcpy(path, "."); int_to_base64(stmp1, - (attrs.at_param[1] == INODESPECIAL) ? - attrs.at_param[3] : attrs.at_param[0]); + (attrs.at_param[1] == + INODESPECIAL) ? attrs. + at_param[3] : attrs.at_param[0]); strcat(path, stmp1); AFS_LOCK_VOL_CREATE(); AFS_VOP_RMDIR(ddvp, path, OSI_GET_CURRENT_CDIR(), @@ -1013,17 +1013,22 @@ afs_syscall_iinc64(int dev, int inode_hi, int inode_lo, int inode_p1) struct iincargs { - sysarg_t dev; - sysarg_t inode; - sysarg_t inode_p1; + sysarg_t dev; + sysarg_t inode; + sysarg_t inode_p1; }; #ifdef AFS_SGI65_ENV -int iinc(struct iincargs *uap, rval_t *rvp) { +int +iinc(struct iincargs *uap, rval_t * rvp) +{ AFS_STATCNT(iinc); return ENOTSUP; } -int idec(struct iincargs *uap, rval_t *rvp) { + +int +idec(struct iincargs *uap, rval_t * rvp) +{ AFS_STATCNT(idec); return ENOTSUP; } @@ -1035,10 +1040,10 @@ int idec(struct iincargs *uap, rval_t *rvp) { */ int iincdec(dev, inode, inode_p1, amount) -int dev, inode, inode_p1, amount; + int dev, inode, inode_p1, amount; { struct vfs *vfsp; - + if (!afs_suser()) return EPERM; vfsp = vfs_devsearch(dev); @@ -1050,14 +1055,17 @@ int dev, inode, inode_p1, amount; return efs_iincdec(vfsp, inode, inode_p1, amount); } + int -iinc(struct iincargs *uap, rval_t *rvp) { +iinc(struct iincargs *uap, rval_t * rvp) +{ AFS_STATCNT(iinc); return (iincdec(uap->dev, uap->inode, uap->inode_p1, 1)); } int -idec(struct iincargs *uap, rval_t *rvp) { +idec(struct iincargs *uap, rval_t * rvp) +{ AFS_STATCNT(idec); return (iincdec(uap->dev, uap->inode, uap->inode_p1, -1)); } @@ -1070,48 +1078,50 @@ idec(struct iincargs *uap, rval_t *rvp) { */ int afs_syscall_iincdec(dev, inode, inode_p1, amount) -int dev, inode, inode_p1, amount; + int dev, inode, inode_p1, amount; { - struct inode *ip; - int error = 0; + struct inode *ip; + int error = 0; - if (!afs_suser()) - return EPERM; - if (error = igetinode(0, (dev_t)dev, inode, &ip)) - return error; + if (!afs_suser()) + return EPERM; + if (error = igetinode(0, (dev_t) dev, inode, &ip)) + return error; - if (!IS_VICEMAGIC(ip)) - error = EPERM; - else if (((struct afsparms *)ip->i_afs)->vicep1 != inode_p1) - error = ENXIO; - else { - ip->i_nlink += amount; - osi_Assert(ip->i_nlink >= 0); - if (ip->i_nlink == 0) { - CLEAR_VICEMAGIC(ip); - afsidestroy(ip); - } - ip->i_flags |= ICHG; + if (!IS_VICEMAGIC(ip)) + error = EPERM; + else if (((struct afsparms *)ip->i_afs)->vicep1 != inode_p1) + error = ENXIO; + else { + ip->i_nlink += amount; + osi_Assert(ip->i_nlink >= 0); + if (ip->i_nlink == 0) { + CLEAR_VICEMAGIC(ip); + afsidestroy(ip); } - /* XXX sync write?? */ - iput(ip); - return error; + ip->i_flags |= ICHG; + } + /* XXX sync write?? */ + iput(ip); + return error; } struct iincargs { - sysarg_t dev; - sysarg_t inode; - sysarg_t inode_p1; + sysarg_t dev; + sysarg_t inode; + sysarg_t inode_p1; }; int -iinc(struct iincargs *uap, rval_t *rvp) { +iinc(struct iincargs *uap, rval_t * rvp) +{ AFS_STATCNT(iinc); return (afs_syscall_iincdec(uap->dev, uap->inode, uap->inode_p1, 1)); } int -idec(struct iincargs *uap, rval_t *rvp) { +idec(struct iincargs *uap, rval_t * rvp) +{ AFS_STATCNT(idec); return (afs_syscall_iincdec(uap->dev, uap->inode, uap->inode_p1, -1)); } @@ -1122,8 +1132,8 @@ idec(struct iincargs *uap, rval_t *rvp) { * Gathers up all required info for ListViceInodes in one system call. */ int -afs_syscall_ilistinode64(int dev, int inode_hi, int inode_lo, - int datap, int datalenp) +afs_syscall_ilistinode64(int dev, int inode_hi, int inode_lo, int datap, + int datalenp) { int code = 0; ino_t inode; @@ -1151,40 +1161,42 @@ afs_syscall_ilistinode64(int dev, int inode_hi, int inode_lo, return ENOSYS; #endif - AFS_COPYIN((char*)datalenp, &idatalen, sizeof(int), code); + AFS_COPYIN((char *)datalenp, &idatalen, sizeof(int), code); if (idatalen < sizeof(i_list_inode_t)) { idatalen = sizeof(i_list_inode_t); - AFS_COPYOUT((char*)datalenp, (char*)&idatalen, sizeof(int), code); + AFS_COPYOUT((char *)datalenp, (char *)&idatalen, sizeof(int), code); return E2BIG; } idatalen = sizeof(i_list_inode_t); - AFS_COPYOUT((char*)datalenp, (char*)&idatalen, sizeof(int), code); + AFS_COPYOUT((char *)datalenp, (char *)&idatalen, sizeof(int), code); - AFS_COPYIN((char*)datap, (char*)&data, sizeof(i_list_inode_t), code); + AFS_COPYIN((char *)datap, (char *)&data, sizeof(i_list_inode_t), code); if (data.ili_version != AFS_XFS_ILI_VERSION) { data.ili_version = AFS_XFS_ILI_VERSION; - AFS_COPYOUT((char*)&data, (char*)datap, sizeof(i_list_inode_t), code); + AFS_COPYOUT((char *)&data, (char *)datap, sizeof(i_list_inode_t), + code); return EINVAL; } - - + + inode = inode_hi; inode <<= 32; inode |= inode_lo; - code = xfs_iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)), - (void*)0, (xfs_ino_t)inode, - XFS_ILOCK_SHARED, &ip, (daddr_t)0); + code = + xfs_iget((((struct mount *)((vfsp)->vfs_bh.bh_first)->bd_pdata)), + (void *)0, (xfs_ino_t) inode, XFS_ILOCK_SHARED, &ip, + (daddr_t) 0); if (code) return code; - + vp = XFS_ITOV(ip); xfs_iunlock(ip, XFS_ILOCK_SHARED); - + length = SIZEOF_XFS_ATTR_T; - AFS_VOP_ATTR_GET(vp, AFS_XFS_ATTR, (char*)&attrs, &length, - ATTR_ROOT, OSI_GET_CURRENT_CRED(), code); - if (code) { + AFS_VOP_ATTR_GET(vp, AFS_XFS_ATTR, (char *)&attrs, &length, ATTR_ROOT, + OSI_GET_CURRENT_CRED(), code); + if (code) { code = EPERM; } @@ -1192,25 +1204,26 @@ afs_syscall_ilistinode64(int dev, int inode_hi, int inode_lo, if (attrs.at_attr_version != AFS_XFS_ATTR_VERS) code = EINVAL; } - + if (!code) { vattr.va_mask = AT_STAT; AFS_VOP_GETATTR(vp, &vattr, 0, OSI_GET_CURRENT_CRED(), code); } - + if (!code) { - memset((char*)&data, 0, sizeof(data)); + memset((char *)&data, 0, sizeof(data)); data.ili_info.inodeNumber = inode; data.ili_info.byteCount = vattr.va_size; data.ili_info.linkCount = (vattr.va_mode & AFS_XFS_MODE_LINK_MASK); - memcpy((char*)data.ili_info.param, (char*)attrs.at_param, sizeof(data.ili_info.param)); + memcpy((char *)data.ili_info.param, (char *)attrs.at_param, + sizeof(data.ili_info.param)); data.ili_attr_version = attrs.at_attr_version; data.ili_name_version = attrs.at_name_version; data.ili_tag = attrs.at_tag; data.ili_pino = attrs.at_pino; data.ili_vno = vattr.va_uid; data.ili_magic = vattr.va_gid; - AFS_COPYOUT((char*)&data, (char*)datap, sizeof(data), code); + AFS_COPYOUT((char *)&data, (char *)datap, sizeof(data), code); } VN_RELE(vp); return code; diff --git a/src/afs/IRIX/osi_inode.h b/src/afs/IRIX/osi_inode.h index 56a533647..0340062f2 100644 --- a/src/afs/IRIX/osi_inode.h +++ b/src/afs/IRIX/osi_inode.h @@ -47,11 +47,11 @@ /* we hang this struct off of the incore inode */ struct afsparms { - afs_int32 vicep1; - afs_int32 vicep2; - afs_int32 vicep3; - afs_int32 vicep4; - }; + afs_int32 vicep1; + afs_int32 vicep2; + afs_int32 vicep3; + afs_int32 vicep4; +}; #define dmag(p,n) ((p)->di_u.di_extents[n].ex_magic) diff --git a/src/afs/IRIX/osi_machdep.h b/src/afs/IRIX/osi_machdep.h index 241f92515..fb6b59876 100644 --- a/src/afs/IRIX/osi_machdep.h +++ b/src/afs/IRIX/osi_machdep.h @@ -26,7 +26,8 @@ extern kmutex_t afs_global_lock; extern time_t time; #define osi_Time() (time) -#define AFS_UCRED ucred +/* This gets redefined from ucred to cred in osi_vfs.h, just do it right */ +#define AFS_UCRED cred #define osi_vnhold(avc, r) do { VN_HOLD(AFSTOV(avc)); } while(0) @@ -129,7 +130,7 @@ extern flid_t osi_flid; #if defined(KERNEL) #if defined(MP) -#define _MP_NETLOCKS /* to get sblock to work right */ +#define _MP_NETLOCKS /* to get sblock to work right */ /* On SGI mutex_owned doesn't work, so simulate this by remembering the owning * thread explicitly. This is only used for debugging so could be disabled for @@ -285,6 +286,8 @@ extern long afs_global_owner; #define OSI_GET_CURRENT_CRED() get_current_cred() #endif /* AFS_SGI64_ENV */ +#define osi_curcred() OSI_GET_CURRENT_CRED() + /* * OSI_SET_CURRENT_CRED */ diff --git a/src/afs/IRIX/osi_misc.c b/src/afs/IRIX/osi_misc.c index 3e5403bdb..fd7f3436a 100644 --- a/src/afs/IRIX/osi_misc.c +++ b/src/afs/IRIX/osi_misc.c @@ -11,14 +11,15 @@ * Implementation of miscellaneous Irix routines. */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_misc.c,v 1.1.1.5 2002/01/22 19:48:10 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/IRIX/osi_misc.c,v 1.7 2003/07/15 23:14:23 shadow Exp $"); #ifdef AFS_SGI62_ENV -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ @@ -26,7 +27,10 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_misc.c,v 1.1.1.5 2002/01/2 /* * various special purpose routines */ -void afs_mpservice(void *a) {} +void +afs_mpservice(void *a) +{ +} #ifdef AFS_SGI_VNODE_GLUE #include @@ -38,31 +42,32 @@ extern mutex_t afs_init_kern_lock; * Argument: flag * 0 = no numa, 1 = has numa, -1 = test for numa. */ -int afs_init_kernel_config(int flag) +int +afs_init_kernel_config(int flag) { static int afs_kern_inited = 0; int code = 0; - + mutex_enter(&afs_init_kern_lock); if (!afs_kern_inited) { afs_kern_inited = 1; - + if (flag == -1) { inventory_t *pinv; /* test for numa arch. */ /* Determine if thisis a NUMA platform. Currently, this is true * only if it's an IP27 or IP35. */ - pinv = find_inventory((inventory_t*)NULL, INV_PROCESSOR, - INV_CPUBOARD, -1, -1, -1); + pinv = + find_inventory((inventory_t *) NULL, INV_PROCESSOR, + INV_CPUBOARD, -1, -1, -1); if (!pinv) code = ENODEV; - else - afs_is_numa_arch = ((pinv->inv_state == INV_IP27BOARD) || - (pinv->inv_state == INV_IP35BOARD)) - ? 1 : 0; - } - else + else + afs_is_numa_arch = ((pinv->inv_state == INV_IP27BOARD) + || (pinv->inv_state == INV_IP35BOARD)) + ? 1 : 0; + } else afs_is_numa_arch = flag; } mutex_exit(&afs_init_kern_lock); diff --git a/src/afs/IRIX/osi_prototypes.h b/src/afs/IRIX/osi_prototypes.h new file mode 100644 index 000000000..278be49a7 --- /dev/null +++ b/src/afs/IRIX/osi_prototypes.h @@ -0,0 +1,16 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +#ifndef _OSI_PROTOTYPES_H_ +#define _OSI_PROTOTYPES_H_ + +/* osi_file.c */ +extern afs_lock_t afs_xosi; + +#endif /* _OSI_PROTOTYPES_H_ */ diff --git a/src/afs/IRIX/osi_sleep.c b/src/afs/IRIX/osi_sleep.c index b43def99e..1e8f0a890 100644 --- a/src/afs/IRIX/osi_sleep.c +++ b/src/afs/IRIX/osi_sleep.c @@ -8,38 +8,40 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_sleep.c,v 1.1.1.4 2001/07/14 22:19:42 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/IRIX/osi_sleep.c,v 1.9 2003/07/15 23:14:23 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok); -void afs_osi_Wakeup(char *event); -void afs_osi_Sleep(char *event); static char waitV; -void afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) +void +afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) { AFS_STATCNT(osi_InitWaitHandle); achandle->proc = (caddr_t) 0; } /* cancel osi_Wait */ -void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) +void +afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) { caddr_t proc; AFS_STATCNT(osi_CancelWait); proc = achandle->proc; - if (proc == 0) return; - achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ + if (proc == 0) + return; + achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ afs_osi_Wakeup(&waitV); } @@ -47,13 +49,14 @@ void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) * Waits for data on ahandle, or ams ms later. ahandle may be null. * Returns 0 if timeout and EINTR if signalled. */ -int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) +int +afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) { int code; afs_int32 endTime, tid; AFS_STATCNT(osi_Wait); - endTime = osi_Time() + (ams/1000); + endTime = osi_Time() + (ams / 1000); if (ahandle) ahandle->proc = (caddr_t) curthreadp; do { @@ -61,7 +64,8 @@ int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) code = 0; code = osi_TimedSleep(&waitV, ams, aintok); - if (code) break; /* if something happened, quit now */ + if (code) + break; /* if something happened, quit now */ /* if we we're cancelled, quit now */ if (ahandle && (ahandle->proc == (caddr_t) 0)) { /* we've been signalled */ @@ -79,13 +83,13 @@ typedef struct afs_event { char *event; /* lwp event: an address */ int refcount; /* Is it in use? */ int seq; /* Sequence number: this is incremented - by wakeup calls; wait will not return until - it changes */ + * by wakeup calls; wait will not return until + * it changes */ kcondvar_t cond; /* Currently associated condition variable */ } afs_event_t; #define HASHSIZE 128 -afs_event_t *afs_evhasht[HASHSIZE];/* Hash table for events */ +afs_event_t *afs_evhasht[HASHSIZE]; /* Hash table for events */ #if (_MIPS_SZPTR == 64) #define afs_evhash(event) (afs_uint32) ((((long)event)>>3) & (HASHSIZE-1)); #else @@ -95,7 +99,8 @@ int afs_evhashcnt = 0; /* Get and initialize event structure corresponding to lwp event (i.e. address) * */ -static afs_event_t *afs_getevent(char *event) +static afs_event_t * +afs_getevent(char *event) { afs_event_t *evp, *newp = 0; int hashcode; @@ -113,7 +118,7 @@ static afs_event_t *afs_getevent(char *event) evp = evp->next; } if (!newp) { - newp = (afs_event_t *) osi_AllocSmallSpace(sizeof (afs_event_t)); + newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t)); afs_evhashcnt++; newp->next = afs_evhasht[hashcode]; afs_evhasht[hashcode] = newp; @@ -129,7 +134,8 @@ static afs_event_t *afs_getevent(char *event) #define relevent(evp) ((evp)->refcount--) -void afs_osi_Sleep(char *event) +void +afs_osi_Sleep(void *event) { struct afs_event *evp; int seq; @@ -143,6 +149,13 @@ void afs_osi_Sleep(char *event) relevent(evp); } +int +afs_osi_SleepSig(void *event) +{ + afs_osi_Sleep(event); + return 0; +} + /* osi_TimedSleep * * Arguments: @@ -152,41 +165,47 @@ void afs_osi_Sleep(char *event) * * Returns 0 if timeout and EINTR if signalled. */ -static int osi_TimedSleep(char *event, afs_int32 ams, int aintok) +static int +osi_TimedSleep(char *event, afs_int32 ams, int aintok) { int code = 0; struct afs_event *evp; struct timespec ticks; ticks.tv_sec = ams / 1000; - ticks.tv_nsec = (ams - (ticks.tv_sec * 1000) ) * 1000000; + ticks.tv_nsec = (ams - (ticks.tv_sec * 1000)) * 1000000; evp = afs_getevent(event); AFS_ASSERT_GLOCK(); if (aintok) { - if (sv_timedwait_sig(&evp->cond, AFSD_PRI(), &afs_global_lock, - 0, 0, &ticks, (struct timespec*)0)) + if (sv_timedwait_sig + (&evp->cond, AFSD_PRI(), &afs_global_lock, 0, 0, &ticks, + (struct timespec *)0)) code = EINTR; - AFS_MUTEX_ENTER(&afs_global_lock); + AFS_MUTEX_ENTER(&afs_global_lock); } else { cv_timedwait(&evp->cond, &afs_global_lock, ticks); } - + relevent(evp); return code; } -void afs_osi_Wakeup(char *event) +int +afs_osi_Wakeup(void *event) { + int ret = 1; struct afs_event *evp; evp = afs_getevent(event); if (evp->refcount > 1) { - evp->seq++; + evp->seq++; cv_broadcast(&evp->cond); + ret = 0; } relevent(evp); + return ret; } diff --git a/src/afs/IRIX/osi_vfs.h b/src/afs/IRIX/osi_vfs.h index d0225ed4e..1f2460a8b 100644 --- a/src/afs/IRIX/osi_vfs.h +++ b/src/afs/IRIX/osi_vfs.h @@ -47,8 +47,8 @@ typedef struct xfs_inode xfs_inode_t; #define XFS_ILOCK_SHARED 0x08 struct xfs_trans; struct xfs_mount; -extern int xfs_iget(struct mount *, struct xfs_trans *, xfs_ino_t, - uint, xfs_inode_t **, daddr_t); +extern int xfs_iget(struct mount *, struct xfs_trans *, xfs_ino_t, uint, + xfs_inode_t **, daddr_t); #ifdef AFS_SGI64_ENV #define XFS_ITOV(ip) BHV_TO_VNODE((struct bhv_desc *)(((char*)(ip)) + 6*sizeof(void*))) @@ -63,15 +63,15 @@ extern int xfs_iget(struct mount *, struct xfs_trans *, xfs_ino_t, #define AFS_SGI_EFS_CACHE 0 #define AFS_SGI_XFS_CACHE 1 extern int afs_CacheFSType; -extern vnode_t * (*afs_IGetVnode)(ino_t); +extern vnode_t *(*afs_IGetVnode) (ino_t); extern struct vnodeops *afs_efs_vnodeopsp; extern struct vnodeops *afs_xfs_vnodeopsp; #define AFS_SGI_IGETVNODE(INO) (*afs_IGetVnode)(INO) /* These need to be functions to wrap the vnode op calls. */ -extern ino_t VnodeToIno(vnode_t *vp); -extern dev_t VnodeToDev(vnode_t *vp); -extern off_t VnodeToSize(vnode_t *vp); +extern ino_t VnodeToIno(vnode_t * vp); +extern dev_t VnodeToDev(vnode_t * vp); +extern off_t VnodeToSize(vnode_t * vp); #else /* Just the EFS variants exist for now. */ #define VnodeToIno(vp) ((ino_t)(EFS_VTOI((vp))->i_number)) @@ -241,65 +241,65 @@ extern int afs_is_numa_arch; #ifdef AFS_SGI_VNODE_GLUE extern int afs_is_numa_arch; typedef struct bhv_head1 { - struct bhv_desc *bh_first; /* first behavior in chain */ + struct bhv_desc *bh_first; /* first behavior in chain */ #ifdef notdef - /* This is not present in the non NUMA machines. */ - mrlock_t bh_mrlock; /* lock for ops-in-progress synch. */ + /* This is not present in the non NUMA machines. */ + mrlock_t bh_mrlock; /* lock for ops-in-progress synch. */ #endif } bhv_head1_t; typedef struct vnode1 { - struct vnlist v_list; /* freelist linkage */ - uint v_flag; /* vnode flags (see below) */ - cnt_t v_count; /* reference count */ - u_short v_namecap; /* name cache capability */ - enum vtype v_type; /* vnode type */ - dev_t v_rdev; /* device (VCHR, VBLK) */ - struct vfs *v_vfsmountedhere; /* ptr to vfs mounted here */ - struct vfs *v_vfsp; /* ptr to containing VFS */ - struct stdata *v_stream; /* associated stream */ - struct filock *v_filocks; /* ptr to filock list */ - mutex_t *v_filocksem; /* ptr to mutex for list */ - vnumber_t v_number; /* in-core vnode number */ - short v_listid; /* free list id */ - cnt_t v_intpcount; /* interp. refcount for imon */ - bhv_head1_t v_bh; /* behavior head */ + struct vnlist v_list; /* freelist linkage */ + uint v_flag; /* vnode flags (see below) */ + cnt_t v_count; /* reference count */ + u_short v_namecap; /* name cache capability */ + enum vtype v_type; /* vnode type */ + dev_t v_rdev; /* device (VCHR, VBLK) */ + struct vfs *v_vfsmountedhere; /* ptr to vfs mounted here */ + struct vfs *v_vfsp; /* ptr to containing VFS */ + struct stdata *v_stream; /* associated stream */ + struct filock *v_filocks; /* ptr to filock list */ + mutex_t *v_filocksem; /* ptr to mutex for list */ + vnumber_t v_number; /* in-core vnode number */ + short v_listid; /* free list id */ + cnt_t v_intpcount; /* interp. refcount for imon */ + bhv_head1_t v_bh; /* behavior head */ - /* - * Used only by global cache. - */ - struct vnode *v_hashp; /* hash list for lookup */ - struct vnode *v_hashn; /* hash list for lookup */ + /* + * Used only by global cache. + */ + struct vnode *v_hashp; /* hash list for lookup */ + struct vnode *v_hashn; /* hash list for lookup */ - /* - * Values manipulated only by VM and - * the page/buffer caches. - */ - struct pregion *v_mreg; /* mapped file region pointer */ - int v_dbuf; /* delwri buffer count */ - pgno_t v_pgcnt; /* pages hashed to vnode */ - struct pfdat *v_dpages; /* delwri pages */ - struct buf *v_buf; /* vnode buffer tree head */ - unsigned int v_bufgen; /* buf list generation number */ - mutex_t v_buf_lock; /* mutex for buffer tree */ + /* + * Values manipulated only by VM and + * the page/buffer caches. + */ + struct pregion *v_mreg; /* mapped file region pointer */ + int v_dbuf; /* delwri buffer count */ + pgno_t v_pgcnt; /* pages hashed to vnode */ + struct pfdat *v_dpages; /* delwri pages */ + struct buf *v_buf; /* vnode buffer tree head */ + unsigned int v_bufgen; /* buf list generation number */ + mutex_t v_buf_lock; /* mutex for buffer tree */ - vnode_pcache_t v_pc; /* Page cache structure. - * per vnode. Refer to - * vnode_pcache.h - * for details. - */ + vnode_pcache_t v_pc; /* Page cache structure. + * per vnode. Refer to + * vnode_pcache.h + * for details. + */ #ifdef VNODE_TRACING - struct ktrace *v_trace; /* trace header structure */ + struct ktrace *v_trace; /* trace header structure */ #endif #ifdef CKPT - ckpt_handle_t v_ckpt; /* ckpt lookup info */ + ckpt_handle_t v_ckpt; /* ckpt lookup info */ #endif } vnode1_t; -extern struct pfdat *vnode_get_dpages(vnode_t*); -extern int vnode_get_dbuf(vnode_t*); -extern pgno_t vnode_get_pgcnt(vnode_t*); -extern struct pregion *vnode_get_mreg(vnode_t*); +extern struct pfdat *vnode_get_dpages(vnode_t *); +extern int vnode_get_dbuf(vnode_t *); +extern pgno_t vnode_get_pgcnt(vnode_t *); +extern struct pregion *vnode_get_mreg(vnode_t *); #define VN_GET_DPAGES(V) (afs_is_numa_arch ? \ ((V)->v_dpages) : \ (((vnode1_t*)(V))->v_dpages)) @@ -351,10 +351,10 @@ extern struct pregion *vnode_get_mreg(vnode_t*); /* * Flock(3) call. (from sys/file.h) */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* don't block when locking */ -#define LOCK_UN 8 /* unlock */ +#define LOCK_SH 1 /* shared lock */ +#define LOCK_EX 2 /* exclusive lock */ +#define LOCK_NB 4 /* don't block when locking */ +#define LOCK_UN 8 /* unlock */ #endif diff --git a/src/afs/IRIX/osi_vfsops.c b/src/afs/IRIX/osi_vfsops.c index 0b8b596d8..3164d7b92 100644 --- a/src/afs/IRIX/osi_vfsops.c +++ b/src/afs/IRIX/osi_vfsops.c @@ -11,13 +11,14 @@ * osi_vfsops.c for IRIX */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_vfsops.c,v 1.1.1.7 2003/04/13 19:02:45 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/IRIX/osi_vfsops.c,v 1.13 2003/07/15 23:14:23 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics stuff */ #include "sys/syssgi.h" @@ -33,7 +34,7 @@ mutex_t afs_init_kern_lock; #define SYS_setgroups SGI_SETGROUPS -int (*nfs_rfsdisptab_v2)() = NULL; +int (*nfs_rfsdisptab_v2) () = NULL; int afs_fstype; lock_t afs_rxlock; @@ -41,7 +42,7 @@ lock_t afs_rxlock; #include "sys/mload.h" char *Afs_mversion = M_VERSION; -extern int (*setgroupsp)(int, gid_t *); +extern int (*setgroupsp) (int, gid_t *); extern struct afs_lock afs_xvcache; extern int idbg_afsuser(); extern void afs_mpservice(void *); @@ -55,14 +56,14 @@ extern void afs_mpservice(void *); syscallsw[ABI_IRIX5].sc_sysent[(n)-1000].sy_flags = 0; extern struct vfsops Afs_vfsops, *afs_vfsopsp; extern struct vnodeops Afs_vnodeops, *afs_vnodeopsp; -extern void (*afsidestroyp)(struct inode *); -extern void (*afsdptoipp)(struct efs_dinode *, struct inode *); -extern void (*afsiptodpp)(struct inode *, struct efs_dinode *); +extern void (*afsidestroyp) (struct inode *); +extern void (*afsdptoipp) (struct efs_dinode *, struct inode *); +extern void (*afsiptodpp) (struct inode *, struct efs_dinode *); extern void afsidestroy(struct inode *); extern void afsdptoip(struct efs_dinode *, struct inode *); extern void afsiptodp(struct inode *, struct efs_dinode *); -extern int (*idbg_prafsnodep)(vnode_t *); -extern int (*idbg_afsvfslistp)(void); +extern int (*idbg_prafsnodep) (vnode_t *); +extern int (*idbg_afsvfslistp) (void); extern int idbg_prafsnode(vnode_t *); extern int idbg_afsvfslist(void); @@ -96,18 +97,18 @@ Afs_init(struct vfssw *vswp, int fstype) afsdptoipp = afsdptoip; idbg_prafsnodep = idbg_prafsnode; idbg_afsvfslistp = idbg_afsvfslist; - NewSystemCall (AFS_SYSCALL, Afs_syscall, 6); - NewSystemCall (AFS_PIOCTL, afs_pioctl, 4); - NewSystemCall (AFS_SETPAG, afs_setpag, 0); - NewSystemCall (AFS_IOPEN, iopen, 3); - NewSystemCall (AFS_ICREATE, icreate, 6); - NewSystemCall (AFS_IINC, iinc, 3); - NewSystemCall (AFS_IDEC, idec, 3); + NewSystemCall(AFS_SYSCALL, Afs_syscall, 6); + NewSystemCall(AFS_PIOCTL, afs_pioctl, 4); + NewSystemCall(AFS_SETPAG, afs_setpag, 0); + NewSystemCall(AFS_IOPEN, iopen, 3); + NewSystemCall(AFS_ICREATE, icreate, 6); + NewSystemCall(AFS_IINC, iinc, 3); + NewSystemCall(AFS_IDEC, idec, 3); #ifdef AFS_SGI_XFS_IOPS_ENV - NewSystemCall (AFS_IOPEN64, iopen64, 4); + NewSystemCall(AFS_IOPEN64, iopen64, 4); #else - NewSystemCall (AFS_IREAD, iread, 6); - NewSystemCall (AFS_IWRITE, iwrite, 6); + NewSystemCall(AFS_IREAD, iread, 6); + NewSystemCall(AFS_IWRITE, iwrite, 6); #endif /* last replace these */ @@ -124,7 +125,7 @@ extern int afs_sync(OSI_VFS_DECL(afsp), int flags, struct cred *cr); #else extern int afs_sync(OSI_VFS_DECL(afsp), short flags, struct cred *cr); #endif -extern int afs_vget(OSI_VFS_DECL(afsp), vnode_t **vpp, struct fid *afidp); +extern int afs_vget(OSI_VFS_DECL(afsp), vnode_t ** vpp, struct fid *afidp); #ifdef MP struct vfsops afs_lockedvfsops = #else @@ -140,8 +141,8 @@ struct vfsops Afs_vfsops = #endif afs_mount, #ifdef AFS_SGI64_ENV - fs_nosys, /* rootinit */ - fs_nosys, /* mntupdate */ + fs_nosys, /* rootinit */ + fs_nosys, /* mntupdate */ fs_dounmount, #endif afs_unmount, @@ -149,25 +150,25 @@ struct vfsops Afs_vfsops = afs_statfs, afs_sync, afs_vget, - fs_nosys, /* mountroot */ + fs_nosys, /* mountroot */ #ifdef AFS_SGI65_ENV - fs_nosys, /* realvfsops */ - fs_import, /* import */ - fs_nosys, /* quotactl */ + fs_nosys, /* realvfsops */ + fs_import, /* import */ + fs_nosys, /* quotactl */ #else - fs_nosys, /* swapvp */ + fs_nosys, /* swapvp */ #endif }; -extern struct afs_q VLRU; /*vcache LRU*/ +extern struct afs_q VLRU; /*vcache LRU */ #ifdef AFS_SGI64_ENV static bhv_desc_t afs_vfs_bhv; #endif -afs_mount(struct vfs *afsp, vnode_t *mvp, struct mounta *uap, +afs_mount(struct vfs *afsp, vnode_t * mvp, struct mounta *uap, #ifdef AFS_SGI65_ENV char *attrs, #endif - cred_t *cr) + cred_t * cr) { AFS_STATCNT(afs_mount); @@ -177,21 +178,21 @@ afs_mount(struct vfs *afsp, vnode_t *mvp, struct mounta *uap, if (mvp->v_type != VDIR) return ENOTDIR; - if (afs_globalVFS) { /* Don't allow remounts. */ + if (afs_globalVFS) { /* Don't allow remounts. */ return EBUSY; } afs_globalVFS = afsp; afsp->vfs_bsize = 8192; - afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */ - afsp->vfs_fsid.val[1] = afs_fstype; + afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */ + afsp->vfs_fsid.val[1] = afs_fstype; #ifdef AFS_SGI64_ENV vfs_insertbhv(afsp, &afs_vfs_bhv, &Afs_vfsops, &afs_vfs_bhv); #else afsp->vfs_data = NULL; #endif afsp->vfs_fstype = afs_fstype; - afsp->vfs_dev = 0xbabebabe; /* XXX this should be unique */ + afsp->vfs_dev = 0xbabebabe; /* XXX this should be unique */ #ifndef AFS_NONFSTRANS if (nfs_rfsdisptab_v2) @@ -202,9 +203,9 @@ afs_mount(struct vfs *afsp, vnode_t *mvp, struct mounta *uap, } afs_unmount(OSI_VFS_ARG(afsp), flags, cr) -OSI_VFS_DECL(afsp); -int flags; -cred_t *cr; + OSI_VFS_DECL(afsp); + int flags; + cred_t *cr; { extern int afs_afs_cold_shutdown; struct vcache *tvc; @@ -214,7 +215,7 @@ cred_t *cr; int error, fv_slept; OSI_VFS_CONVERT(afsp) - AFS_STATCNT(afs_unmount); + AFS_STATCNT(afs_unmount); if (!suser()) return EPERM; @@ -223,19 +224,19 @@ cred_t *cr; * flush all pages from inactive vnodes - return * EBUSY if any still in use */ - ObtainWriteLock(&afs_xvcache,172); + ObtainWriteLock(&afs_xvcache, 172); for (tq = VLRU.prev; tq != &VLRU; tq = uq) { tvc = QTOV(tq); uq = QPrev(tq); - vp = (vnode_t *)tvc; + vp = (vnode_t *) tvc; if (error = afs_FlushVCache(tvc, &fv_slept)) - if (vp->v_flag & VROOT) { - rootvp = vp; - continue; - } else { - ReleaseWriteLock(&afs_xvcache); - return error; - } + if (vp->v_flag & VROOT) { + rootvp = vp; + continue; + } else { + ReleaseWriteLock(&afs_xvcache); + return error; + } } /* @@ -243,14 +244,14 @@ cred_t *cr; */ if (rootvp) { tvc = VTOAFS(rootvp); - if (tvc->opens || CheckLock(&tvc->lock) || LockWaiters(&tvc->lock)) { + if (tvc->opens || CheckLock(&tvc->lock) || LockWaiters(&tvc->lock)) { ReleaseWriteLock(&afs_xvcache); return EBUSY; } - ReleaseWriteLock(&afs_xvcache); + ReleaseWriteLock(&afs_xvcache); rootvp->v_count = 1; AFS_RELE(rootvp); - ObtainWriteLock(&afs_xvcache,173); + ObtainWriteLock(&afs_xvcache, 173); afs_FlushVCache(tvc, &fv_slept); } ReleaseWriteLock(&afs_xvcache); @@ -264,23 +265,27 @@ cred_t *cr; -afs_root (OSI_VFS_ARG(afsp), avpp) +afs_root(OSI_VFS_ARG(afsp), avpp) OSI_VFS_DECL(afsp); - struct vnode **avpp; + struct vnode **avpp; { register afs_int32 code = 0; struct vrequest treq; - register struct vcache *tvp=0; + register struct vcache *tvp = 0; OSI_VFS_CONVERT(afsp) - AFS_STATCNT(afs_root); + AFS_STATCNT(afs_root); if (afs_globalVp && (afs_globalVp->states & CStatd)) { tvp = afs_globalVp; } else { - if (!(code = afs_InitReq(&treq, OSI_GET_CURRENT_CRED())) && - !(code = afs_CheckInit())) { - tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); + if (afs_globalVp) { + afs_PutVCache(afs_globalVp); + afs_globalVp = NULL; + } + + if (!(code = afs_InitReq(&treq, OSI_GET_CURRENT_CRED())) + && !(code = afs_CheckInit())) { + tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL); /* we really want this to stay around */ if (tvp) { afs_globalVp = tvp; @@ -292,7 +297,7 @@ afs_root (OSI_VFS_ARG(afsp), avpp) int s; VN_HOLD(AFSTOV(tvp)); s = VN_LOCK(AFSTOV(tvp)); - AFSTOV(tvp)->v_flag |= VROOT; + AFSTOV(tvp)->v_flag |= VROOT; VN_UNLOCK(AFSTOV(tvp), s); afs_globalVFS = afsp; @@ -305,27 +310,27 @@ afs_root (OSI_VFS_ARG(afsp), avpp) } afs_statfs(OSI_VFS_ARG(afsp), abp, avp) -OSI_VFS_DECL(afsp); -struct statvfs *abp; -struct vnode *avp; /* unused */ + OSI_VFS_DECL(afsp); + struct statvfs *abp; + struct vnode *avp; /* unused */ { OSI_VFS_CONVERT(afsp) AFS_STATCNT(afs_statfs); - abp->f_bsize = afsp->vfs_bsize; - abp->f_frsize = afsp->vfs_bsize; - /* Fake a high number below to satisfy programs that use the statfs - * call to make sure that there's enough space in the device partition - * before storing something there. - */ - abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files = - abp->f_ffree = abp->f_favail = 900000; - - abp->f_fsid = AFS_VFSMAGIC; /* magic */ - strcpy(abp->f_basetype, AFS_MOUNT_AFS); - abp->f_flag = 0; - abp->f_namemax = 256; - return 0; + abp->f_bsize = afsp->vfs_bsize; + abp->f_frsize = afsp->vfs_bsize; + /* Fake a high number below to satisfy programs that use the statfs + * call to make sure that there's enough space in the device partition + * before storing something there. + */ + abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files = + abp->f_ffree = abp->f_favail = 900000; + + abp->f_fsid = AFS_VFSMAGIC; /* magic */ + strcpy(abp->f_basetype, AFS_MOUNT_AFS); + abp->f_flag = 0; + abp->f_namemax = 256; + return 0; } @@ -367,154 +372,151 @@ afs_sync(OSI_VFS_DECL(afsp), struct cred *cr) { /* Why enable the vfs sync operation?? */ - int error, lasterr, preempt; - struct vcache *tvc; - struct vnode *vp; - afs_uint32 lvcachegen; - register struct afs_q *tq; - struct afs_q *uq; - int s; - OSI_VFS_CONVERT(afsp) + int error, lasterr, preempt; + struct vcache *tvc; + struct vnode *vp; + afs_uint32 lvcachegen; + register struct afs_q *tq; + struct afs_q *uq; + int s; + OSI_VFS_CONVERT(afsp) error = lasterr = 0; - /* - * if not interested in vnodes, skip all this - */ + /* + * if not interested in vnodes, skip all this + */ #ifdef AFS_SGI61_ENV - if ((flags & (SYNC_CLOSE|SYNC_DELWRI|SYNC_PDFLUSH)) == 0) - goto end; + if ((flags & (SYNC_CLOSE | SYNC_DELWRI | SYNC_PDFLUSH)) == 0) + goto end; #else /* AFS_SGI61_ENV */ - if ((flags & (SYNC_CLOSE|SYNC_DELWRI|SYNC_ATTR)) == 0) - goto end; + if ((flags & (SYNC_CLOSE | SYNC_DELWRI | SYNC_ATTR)) == 0) + goto end; #endif /* AFS_SGI61_ENV */ -loop: - ObtainReadLock(&afs_xvcache); - for (tq = VLRU.prev; tq != &VLRU; tq = uq) { - tvc = QTOV(tq); - uq = QPrev(tq); - vp = (vnode_t *)tvc; - /* - * Since we push all dirty pages on last close/VOP_INACTIVE - * we are only concerned with vnodes with - * active reference counts. - */ - s = VN_LOCK(vp); - if (vp->v_count == 0) { - VN_UNLOCK(vp, s); - continue; - } - if ((flags & SYNC_CLOSE) == 0 && !AFS_VN_DIRTY(vp)) { - VN_UNLOCK(vp, s); - continue; - } - - /* - * ignore vnodes which need no flushing - */ - if (flags & SYNC_DELWRI) { - if (!AFS_VN_DIRTY(vp)) { - VN_UNLOCK(vp, s); - continue; - } - } + loop: + ObtainReadLock(&afs_xvcache); + for (tq = VLRU.prev; tq != &VLRU; tq = uq) { + tvc = QTOV(tq); + uq = QPrev(tq); + vp = (vnode_t *) tvc; + /* + * Since we push all dirty pages on last close/VOP_INACTIVE + * we are only concerned with vnodes with + * active reference counts. + */ + s = VN_LOCK(vp); + if (vp->v_count == 0) { + VN_UNLOCK(vp, s); + continue; + } + if ((flags & SYNC_CLOSE) == 0 && !AFS_VN_DIRTY(vp)) { + VN_UNLOCK(vp, s); + continue; + } + + /* + * ignore vnodes which need no flushing + */ + if (flags & SYNC_DELWRI) { + if (!AFS_VN_DIRTY(vp)) { + VN_UNLOCK(vp, s); + continue; + } + } #ifdef AFS_SGI61_ENV - else if (flags & SYNC_PDFLUSH) { - if (!VN_GET_DPAGES(vp)) { - VN_UNLOCK(vp, s); - continue; - } - } + else if (flags & SYNC_PDFLUSH) { + if (!VN_GET_DPAGES(vp)) { + VN_UNLOCK(vp, s); + continue; + } + } #endif /* AFS_SGI61_ENV */ - vp->v_count++; - VN_UNLOCK(vp, s); - lvcachegen = vcachegen; - ReleaseReadLock(&afs_xvcache); - - /* - * Try to lock rwlock without sleeping. If we can't, we must - * sleep for rwlock. - */ - if (afs_rwlock_nowait(vp, 1) == 0) { + vp->v_count++; + VN_UNLOCK(vp, s); + lvcachegen = vcachegen; + ReleaseReadLock(&afs_xvcache); + + /* + * Try to lock rwlock without sleeping. If we can't, we must + * sleep for rwlock. + */ + if (afs_rwlock_nowait(vp, 1) == 0) { #ifdef AFS_SGI61_ENV - if (flags & (SYNC_BDFLUSH | SYNC_PDFLUSH)) + if (flags & (SYNC_BDFLUSH | SYNC_PDFLUSH)) #else /* AFS_SGI61_ENV */ - if (flags & SYNC_BDFLUSH) + if (flags & SYNC_BDFLUSH) #endif /* AFS_SGI61_ENV */ - { - AFS_RELE(vp); - ObtainReadLock(&afs_xvcache); - if (vcachegen != lvcachegen) { - ReleaseReadLock(&afs_xvcache); - goto loop; - } - continue; - } - AFS_RWLOCK(vp, VRWLOCK_WRITE); + { + AFS_RELE(vp); + ObtainReadLock(&afs_xvcache); + if (vcachegen != lvcachegen) { + ReleaseReadLock(&afs_xvcache); + goto loop; } + continue; + } + AFS_RWLOCK(vp, VRWLOCK_WRITE); + } - AFS_GUNLOCK(); - if (flags & SYNC_CLOSE) { - PFLUSHINVALVP(vp, (off_t)0, (off_t)tvc->m.Length); - } + AFS_GUNLOCK(); + if (flags & SYNC_CLOSE) { + PFLUSHINVALVP(vp, (off_t) 0, (off_t) tvc->m.Length); + } #ifdef AFS_SGI61_ENV - else if (flags & SYNC_PDFLUSH) { - if (VN_GET_DPAGES(vp)) { - pdflush(vp, B_ASYNC); - } - } + else if (flags & SYNC_PDFLUSH) { + if (VN_GET_DPAGES(vp)) { + pdflush(vp, B_ASYNC); + } + } #endif /* AFS_SGI61_ENV */ - if ((flags & SYNC_DELWRI) && AFS_VN_DIRTY(vp)) { + if ((flags & SYNC_DELWRI) && AFS_VN_DIRTY(vp)) { #ifdef AFS_SGI61_ENV - PFLUSHVP(vp, (off_t)tvc->m.Length, - (flags & SYNC_WAIT) ? 0 : B_ASYNC, error); + PFLUSHVP(vp, (off_t) tvc->m.Length, + (flags & SYNC_WAIT) ? 0 : B_ASYNC, error); #else /* AFS_SGI61_ENV */ - if (flags & SYNC_WAIT) - /* push all and wait */ - PFLUSHVP(vp, (off_t)tvc->m.Length, - (off_t)0, error); - else if (flags & SYNC_BDFLUSH) { - /* push oldest */ - error = pdflush(vp, B_ASYNC); - } - else { - /* push all but don't wait */ - PFLUSHVP(vp, (off_t)tvc->m.Length, - (off_t)B_ASYNC, error); - } + if (flags & SYNC_WAIT) + /* push all and wait */ + PFLUSHVP(vp, (off_t) tvc->m.Length, (off_t) 0, error); + else if (flags & SYNC_BDFLUSH) { + /* push oldest */ + error = pdflush(vp, B_ASYNC); + } else { + /* push all but don't wait */ + PFLUSHVP(vp, (off_t) tvc->m.Length, (off_t) B_ASYNC, error); + } #endif /* AFS_SGI61_ENV */ - } + } - /* - * Release vp, check error and whether to preempt, and if - * we let go of xvcache lock and someone has changed the - * VLRU, restart the loop - */ - AFS_GLOCK(); - AFS_RWUNLOCK(vp, VRWLOCK_WRITE); - AFS_RELE(vp); - if (error) - lasterr = error; - if ((++preempt & PREEMPT_MASK) == 0) { - AFS_GUNLOCK(); - PREEMPT(); - AFS_GLOCK(); - } - ObtainReadLock(&afs_xvcache); - if (vcachegen != lvcachegen) { - ReleaseReadLock(&afs_xvcache); - goto loop; - } + /* + * Release vp, check error and whether to preempt, and if + * we let go of xvcache lock and someone has changed the + * VLRU, restart the loop + */ + AFS_GLOCK(); + AFS_RWUNLOCK(vp, VRWLOCK_WRITE); + AFS_RELE(vp); + if (error) + lasterr = error; + if ((++preempt & PREEMPT_MASK) == 0) { + AFS_GUNLOCK(); + PREEMPT(); + AFS_GLOCK(); } - ReleaseReadLock(&afs_xvcache); -end: - return lasterr; + ObtainReadLock(&afs_xvcache); + if (vcachegen != lvcachegen) { + ReleaseReadLock(&afs_xvcache); + goto loop; + } + } + ReleaseReadLock(&afs_xvcache); + end: + return lasterr; } -afs_vget(OSI_VFS_DECL(afsp), vnode_t **avcp, struct fid *fidp) +afs_vget(OSI_VFS_DECL(afsp), vnode_t ** avcp, struct fid * fidp) { struct VenusFid vfid; struct vrequest treq; @@ -524,16 +526,16 @@ afs_vget(OSI_VFS_DECL(afsp), vnode_t **avcp, struct fid *fidp) #if defined(AFS_SGI64_ENV) && defined(CKPT) && !defined(_R5000_CVT_WAR) afs_fid2_t *afid2; -#endif +#endif OSI_VFS_CONVERT(afsp) - AFS_STATCNT(afs_vget); + AFS_STATCNT(afs_vget); *avcp = NULL; #if defined(AFS_SGI64_ENV) && defined(CKPT) && !defined(_R5000_CVT_WAR) - afid2 = (afs_fid2_t*)fidp; + afid2 = (afs_fid2_t *) fidp; if (afid2->af_len == sizeof(afs_fid2_t) - sizeof(afid2->af_len)) { /* It's a checkpoint restart fid. */ tcell = afs_GetCellByIndex(afid2->af_cell, READ_LOCK); @@ -549,19 +551,20 @@ afs_vget(OSI_VFS_DECL(afsp), vnode_t **avcp, struct fid *fidp) if (code = afs_InitReq(&treq, OSI_GET_CURRENT_CRED())) goto out; - *avcp = (vnode_t*) afs_GetVCache(&vfid, &treq, (afs_int32 *)0, - (struct vcache*)0, 0); - if (! *avcp) { + *avcp = + (vnode_t *) afs_GetVCache(&vfid, &treq, NULL, (struct vcache *)0); + if (!*avcp) { code = ENOENT; } goto out; } #endif - if (code = afs_InitReq(&treq, OSI_GET_CURRENT_CRED())) goto out; - code = afs_osi_vget((struct vcache**)avcp, fidp, &treq); + if (code = afs_InitReq(&treq, OSI_GET_CURRENT_CRED())) + goto out; + code = afs_osi_vget((struct vcache **)avcp, fidp, &treq); - out: + out: afs_Trace3(afs_iclSetp, CM_TRACE_VGET, ICL_TYPE_POINTER, *avcp, ICL_TYPE_INT32, treq.uid, ICL_TYPE_FID, &vfid); code = afs_CheckCode(code, &treq, 42); @@ -569,7 +572,7 @@ afs_vget(OSI_VFS_DECL(afsp), vnode_t **avcp, struct fid *fidp) } -#ifdef MP /* locked versions of vfs operations. */ +#ifdef MP /* locked versions of vfs operations. */ /* wrappers for vfs calls */ #ifdef AFS_SGI64_ENV @@ -578,70 +581,78 @@ afs_vget(OSI_VFS_DECL(afsp), vnode_t **avcp, struct fid *fidp) #define AFS_MP_VFS_ARG(A) struct vfs A #endif -int mp_afs_mount(struct vfs *a, struct vnode *b, struct mounta *c, +int +mp_afs_mount(struct vfs *a, struct vnode *b, struct mounta *c, #ifdef AFS_SGI65_ENV - char *d, + char *d, #endif - struct cred *e) + struct cred *e) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvfsops.vfs_mount(a, b, c, d + int rv; + AFS_GLOCK(); + rv = afs_lockedvfsops.vfs_mount(a, b, c, d #ifdef AFS_SGI65_ENV - , e + , e #endif - ); - AFS_GUNLOCK(); - return rv; + ); + AFS_GUNLOCK(); + return rv; } -int mp_afs_unmount(AFS_MP_VFS_ARG(*a), int b, struct cred *c) +int +mp_afs_unmount(AFS_MP_VFS_ARG(*a), int b, struct cred *c) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvfsops.vfs_unmount(a, b, c); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvfsops.vfs_unmount(a, b, c); + AFS_GUNLOCK(); + return rv; } -int mp_afs_root(AFS_MP_VFS_ARG(*a), struct vnode **b) +int +mp_afs_root(AFS_MP_VFS_ARG(*a), struct vnode **b) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvfsops.vfs_root(a, b); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvfsops.vfs_root(a, b); + AFS_GUNLOCK(); + return rv; } -int mp_afs_statvfs(AFS_MP_VFS_ARG(*a), struct statvfs *b, struct vnode *c) +int +mp_afs_statvfs(AFS_MP_VFS_ARG(*a), struct statvfs *b, struct vnode *c) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvfsops.vfs_statvfs(a, b, c); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvfsops.vfs_statvfs(a, b, c); + AFS_GUNLOCK(); + return rv; } -int mp_afs_sync(AFS_MP_VFS_ARG(*a), + +int +mp_afs_sync(AFS_MP_VFS_ARG(*a), #ifdef AFS_SGI65_ENV - int b, + int b, #else - short b, + short b, #endif - struct cred *c) + struct cred *c) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvfsops.vfs_sync(a, b, c); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvfsops.vfs_sync(a, b, c); + AFS_GUNLOCK(); + return rv; } -int mp_afs_vget(AFS_MP_VFS_ARG(*a), struct vnode **b, struct fid *c) + +int +mp_afs_vget(AFS_MP_VFS_ARG(*a), struct vnode **b, struct fid *c) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvfsops.vfs_vget(a, b, c); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvfsops.vfs_vget(a, b, c); + AFS_GUNLOCK(); + return rv; } struct vfsops Afs_vfsops = { @@ -654,8 +665,8 @@ struct vfsops Afs_vfsops = { #endif mp_afs_mount, #ifdef AFS_SGI64_ENV - fs_nosys, /* rootinit */ - fs_nosys, /* mntupdate */ + fs_nosys, /* rootinit */ + fs_nosys, /* mntupdate */ fs_dounmount, #endif mp_afs_unmount, @@ -663,13 +674,13 @@ struct vfsops Afs_vfsops = { mp_afs_statvfs, mp_afs_sync, mp_afs_vget, - fs_nosys, /* mountroot */ + fs_nosys, /* mountroot */ #ifdef AFS_SGI65_ENV - fs_nosys, /* realvfsops */ - fs_import, /* import */ - fs_nosys, /* quotactl */ + fs_nosys, /* realvfsops */ + fs_import, /* import */ + fs_nosys, /* quotactl */ #else - fs_nosys, /* swapvp */ + fs_nosys, /* swapvp */ #endif }; diff --git a/src/afs/IRIX/osi_vm.c b/src/afs/IRIX/osi_vm.c index cf447678c..2bfefaa5a 100644 --- a/src/afs/IRIX/osi_vm.c +++ b/src/afs/IRIX/osi_vm.c @@ -8,13 +8,14 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_vm.c,v 1.1.1.5 2002/05/10 23:44:01 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/IRIX/osi_vm.c,v 1.8 2003/07/15 23:14:23 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ #include "sys/flock.h" /* for IGN_PID */ extern struct vnodeops Afs_vnodeops; @@ -34,9 +35,7 @@ extern struct vnodeops Afs_vnodeops; * therefore obsolescent. */ int -osi_VM_FlushVCache(avc, slept) - struct vcache *avc; - int *slept; +osi_VM_FlushVCache(struct vcache *avc, int *slept) { int s, code; vnode_t *vp = &avc->v; @@ -63,7 +62,7 @@ osi_VM_FlushVCache(avc, slept) * Note that although we checked vcount above, we didn't have the lock */ if (vp->v_count > 0 || (vp->v_flag & VINACT)) { - VN_UNLOCK(vp, s); + VN_UNLOCK(vp, s); return EBUSY; } VN_UNLOCK(vp, s); @@ -74,7 +73,7 @@ osi_VM_FlushVCache(avc, slept) * Note that we hold the xvcache lock the entire time. */ AFS_GUNLOCK(); - PTOSSVP(vp, (off_t)0, (off_t)MAXLONG); + PTOSSVP(vp, (off_t) 0, (off_t) MAXLONG); AFS_GLOCK(); /* afs_chkpgoob will drop and re-acquire the global lock. */ @@ -91,9 +90,9 @@ osi_VM_FlushVCache(avc, slept) if (vp->v_filocksem) { if (vp->v_filocks) #ifdef AFS_SGI64_ENV - cleanlocks(vp, &curprocp->p_flid); + cleanlocks(vp, &curprocp->p_flid); #else - cleanlocks(vp, IGN_PID, 0); + cleanlocks(vp, IGN_PID, 0); #endif osi_Assert(vp->v_filocks == NULL); mutex_destroy(vp->v_filocksem); @@ -102,10 +101,11 @@ osi_VM_FlushVCache(avc, slept) } #endif /* AFS_SGI65_ENV */ - if (avc->vrefCount) osi_Panic("flushVcache: vm race"); + if (avc->vrefCount) + osi_Panic("flushVcache: vm race"); #ifdef AFS_SGI64_ENV AFS_GUNLOCK(); - vnode_pcache_reclaim(vp); /* this can sleep */ + vnode_pcache_reclaim(vp); /* this can sleep */ vnode_pcache_free(vp); if (vp->v_op != &Afs_vnodeops) { VOP_RECLAIM(vp, FSYNC_WAIT, code); @@ -123,7 +123,7 @@ osi_VM_FlushVCache(avc, slept) bhv_remove(VN_BHV_HEAD(vp), &(avc->vc_bhv_desc)); bhv_head_destroy(&(vp->v_bh)); #endif - vp->v_flag = 0; /* debug */ + vp->v_flag = 0; /* debug */ #if defined(DEBUG) && defined(VNODE_INIT_BITLOCK) destroy_bitlock(&vp->v_flag); #endif @@ -145,20 +145,17 @@ osi_VM_FlushVCache(avc, slept) * be some pages around when we return, newly created by concurrent activity. */ void -osi_VM_TryToSmush(avc, acred, sync) - struct vcache *avc; - struct AFS_UCRED *acred; - int sync; +osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync) { ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); /* current remapf restriction - cannot have VOP_RWLOCK */ osi_Assert(OSI_GET_LOCKID() != avc->vc_rwlockid); - if (((vnode_t *)avc)->v_type == VREG && AFS_VN_MAPPED(((vnode_t *)avc))) - remapf(((vnode_t *)avc), 0, 0); - PTOSSVP(AFSTOV(avc), (off_t)0, (off_t)MAXLONG); + if (((vnode_t *) avc)->v_type == VREG && AFS_VN_MAPPED(((vnode_t *) avc))) + remapf(((vnode_t *) avc), 0, 0); + PTOSSVP(AFSTOV(avc), (off_t) 0, (off_t) MAXLONG); AFS_GLOCK(); - ObtainWriteLock(&avc->lock,62); + ObtainWriteLock(&avc->lock, 62); } /* Flush and invalidate pages, for fsync() with INVAL flag @@ -166,11 +163,10 @@ osi_VM_TryToSmush(avc, acred, sync) * Locking: only the global lock is held. */ void -osi_VM_FSyncInval(avc) - struct vcache *avc; +osi_VM_FSyncInval(struct vcache *avc) { AFS_GUNLOCK(); - PFLUSHINVALVP((vnode_t *)avc, (off_t)0, (off_t)avc->m.Length); + PFLUSHINVALVP((vnode_t *) avc, (off_t) 0, (off_t) avc->m.Length); AFS_GLOCK(); } @@ -180,8 +176,7 @@ osi_VM_FSyncInval(avc) * re-obtained. */ void -osi_VM_StoreAllSegments(avc) - struct vcache *avc; +osi_VM_StoreAllSegments(struct vcache *avc) { int error; osi_Assert(valusema(&avc->vc_rwlock) <= 0); @@ -194,11 +189,11 @@ osi_VM_StoreAllSegments(avc) AFS_GUNLOCK(); /* Write out dirty pages list to avoid B_DELWRI buffers. */ - while (VN_GET_DPAGES((vnode_t*)avc)) { + while (VN_GET_DPAGES((vnode_t *) avc)) { pdflush(AFSTOV(avc), 0); } - PFLUSHVP(AFSTOV(avc), (off_t)avc->m.Length, (off_t)0, error); + PFLUSHVP(AFSTOV(avc), (off_t) avc->m.Length, (off_t) 0, error); AFS_GLOCK(); if (error) { /* @@ -209,11 +204,12 @@ osi_VM_StoreAllSegments(avc) * does what we want (we don't use this normally since * it also unhashes pages ..) */ - PINVALFREE((vnode_t *)avc, avc->m.Length); + PINVALFREE((vnode_t *) avc, avc->m.Length); } - ObtainWriteLock(&avc->lock,121); + ObtainWriteLock(&avc->lock, 121); if (error && avc->m.LinkCount) - cmn_err(CE_WARN, "AFS:Failed to push back pages for vnode 0x%x error %d (from afs_StoreOnLastReference)", + cmn_err(CE_WARN, + "AFS:Failed to push back pages for vnode 0x%x error %d (from afs_StoreOnLastReference)", avc, error); } @@ -222,13 +218,11 @@ osi_VM_StoreAllSegments(avc) * Locking: No lock is held, not even the global lock. */ void -osi_VM_FlushPages(avc, credp) - struct vcache *avc; - struct AFS_UCRED *credp; +osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) { - vnode_t *vp = (vnode_t *)avc; + vnode_t *vp = (vnode_t *) avc; - remapf(vp, /*avc->m.Length*/ 0, 0); + remapf(vp, /*avc->m.Length */ 0, 0); /* Used to grab locks and recheck avc->m.DataVersion and * avc->execsOrWriters here, but we have to drop locks before calling @@ -239,7 +233,7 @@ osi_VM_FlushPages(avc, credp) * ptossvp tosses all pages associated with this vnode * All in-use pages are marked BAD */ - PTOSSVP(vp, (off_t)0, (off_t)MAXLONG); + PTOSSVP(vp, (off_t) 0, (off_t) MAXLONG); } /* Purge pages beyond end-of-file, when truncating a file. @@ -249,10 +243,7 @@ osi_VM_FlushPages(avc, credp) * it only works on Solaris. */ void -osi_VM_Truncate(avc, alen, acred) - struct vcache *avc; - int alen; - struct AFS_UCRED *acred; +osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) { - PTOSSVP(&avc->v, (off_t)alen, (off_t)MAXLONG); + PTOSSVP(&avc->v, (off_t) alen, (off_t) MAXLONG); } diff --git a/src/afs/IRIX/osi_vnodeops.c b/src/afs/IRIX/osi_vnodeops.c index cbbcdc407..796d34c78 100644 --- a/src/afs/IRIX/osi_vnodeops.c +++ b/src/afs/IRIX/osi_vnodeops.c @@ -11,16 +11,17 @@ * SGI specific vnodeops + other misc interface glue */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/IRIX/osi_vnodeops.c,v 1.1.1.9 2002/05/10 23:44:01 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/IRIX/osi_vnodeops.c,v 1.14 2003/07/15 23:14:23 shadow Exp $"); #ifdef AFS_SGI62_ENV -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../sys/flock.h" -#include "../afs/nfsclient.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "sys/flock.h" +#include "afs/nfsclient.h" /* AFSBSIZE must be at least the size of a page, else the client will hang. * For 64 bit platforms, the page size is more than 8K. @@ -33,14 +34,15 @@ static void afs_strategy(); static int afs_xread(), afs_xwrite(); static int afs_xbmap(), afs_map(), afs_reclaim(); #ifndef AFS_SGI65_ENV -static int afs_addmap(), afs_delmap(); +static int afs_addmap(), afs_delmap(); #endif extern int afs_open(), afs_close(), afs_ioctl(), afs_getattr(), afs_setattr(); extern int afs_access(), afs_lookup(); extern int afs_create(), afs_remove(), afs_link(), afs_rename(); extern int afs_mkdir(), afs_rmdir(), afs_readdir(); -extern int afs_symlink(), afs_readlink(), afs_fsync(), afs_fid(), afs_frlock(); -static int afs_seek(OSI_VC_DECL(a), off_t b, off_t *c); +extern int afs_symlink(), afs_readlink(), afs_fsync(), afs_fid(), +afs_frlock(); +static int afs_seek(OSI_VC_DECL(a), off_t b, off_t * c); #ifdef AFS_SGI64_ENV extern int afs_xinactive(); #else @@ -48,17 +50,14 @@ extern void afs_xinactive(); #endif extern void afs_rwlock(OSI_VN_DECL(vp), AFS_RWLOCK_T b); -extern void afs_rwunlock(OSI_VN_DECL(vp), AFS_RWLOCK_T b); +extern void afs_rwunlock(OSI_VN_DECL(vp), AFS_RWLOCK_T b); extern int afs_fid2(); -static int afsrwvp(register struct vcache *avc, - register struct uio *uio, - enum uio_rw rw, - int ioflag, +static int afsrwvp(register struct vcache *avc, register struct uio *uio, + enum uio_rw rw, int ioflag, #ifdef AFS_SGI64_ENV - struct cred *cr, - struct flid *flp); + struct cred *cr, struct flid *flp); #else struct cred *cr); #endif @@ -72,89 +71,91 @@ struct vnodeops Afs_vnodeops = { #ifdef AFS_SGI64_ENV #ifdef AFS_SGI65_ENV - BHV_IDENTITY_INIT_POSITION(VNODE_POSITION_BASE), + BHV_IDENTITY_INIT_POSITION(VNODE_POSITION_BASE), #else - VNODE_POSITION_BASE, -#endif -#endif - afs_open, - afs_close, - afs_xread, - afs_xwrite, - afs_ioctl, - fs_setfl, - afs_getattr, - afs_setattr, - afs_access, - afs_lookup, - afs_create, - afs_remove, - afs_link, - afs_rename, - afs_mkdir, - afs_rmdir, - afs_readdir, - afs_symlink, - afs_readlink, - afs_fsync, - afs_xinactive, - afs_fid, - afs_fid2, - afs_rwlock, - afs_rwunlock, - afs_seek, - fs_cmp, - afs_frlock, - fs_nosys, /* realvp */ - afs_xbmap, - afs_strategy, - afs_map, + VNODE_POSITION_BASE, +#endif +#endif + afs_open, + afs_close, + afs_xread, + afs_xwrite, + afs_ioctl, + fs_setfl, + afs_getattr, + afs_setattr, + afs_access, + afs_lookup, + afs_create, + afs_remove, + afs_link, + afs_rename, + afs_mkdir, + afs_rmdir, + afs_readdir, + afs_symlink, + afs_readlink, + afs_fsync, + afs_xinactive, + afs_fid, + afs_fid2, + afs_rwlock, + afs_rwunlock, + afs_seek, + fs_cmp, + afs_frlock, + fs_nosys, /* realvp */ + afs_xbmap, + afs_strategy, + afs_map, #ifdef AFS_SGI65_ENV - fs_noerr, /* addmap - devices only */ - fs_noerr, /* delmap - devices only */ + fs_noerr, /* addmap - devices only */ + fs_noerr, /* delmap - devices only */ #else - afs_addmap, - afs_delmap, -#endif - fs_poll, /* poll */ - fs_nosys, /* dump */ - fs_pathconf, - fs_nosys, /* allocstore */ - fs_nosys, /* fcntl */ - afs_reclaim, /* reclaim */ - fs_nosys, /* attr_get */ - fs_nosys, /* attr_set */ - fs_nosys, /* attr_remove */ - fs_nosys, /* attr_list */ + afs_addmap, + afs_delmap, +#endif + fs_poll, /* poll */ + fs_nosys, /* dump */ + fs_pathconf, + fs_nosys, /* allocstore */ + fs_nosys, /* fcntl */ + afs_reclaim, /* reclaim */ + fs_nosys, /* attr_get */ + fs_nosys, /* attr_set */ + fs_nosys, /* attr_remove */ + fs_nosys, /* attr_list */ #ifdef AFS_SGI64_ENV #ifdef AFS_SGI65_ENV - fs_cover, - (vop_link_removed_t)fs_noval, - fs_vnode_change, - fs_tosspages, - fs_flushinval_pages, - fs_flush_pages, - fs_invalfree_pages, - fs_pages_sethole, - (vop_commit_t)fs_nosys, - (vop_readbuf_t)fs_nosys, - fs_strgetmsg, - fs_strputmsg, + fs_cover, + (vop_link_removed_t) fs_noval, + fs_vnode_change, + fs_tosspages, + fs_flushinval_pages, + fs_flush_pages, + fs_invalfree_pages, + fs_pages_sethole, + (vop_commit_t) fs_nosys, + (vop_readbuf_t) fs_nosys, + fs_strgetmsg, + fs_strputmsg, #else - fs_mount, + fs_mount, #endif #endif }; + #ifndef MP struct vnodeops *afs_ops = &Afs_vnodeops; #endif -int afs_frlock(OSI_VN_DECL(vp), int cmd, struct flock *lfp, int flag, - off_t offset, +int +afs_frlock(OSI_VN_DECL(vp), int cmd, struct flock *lfp, int flag, + off_t offset, #ifdef AFS_SGI65_ENV - vrwlock_t vrwlock, + vrwlock_t vrwlock, #endif - cred_t *cr) + cred_t * cr) { int error; OSI_VN_CONVERT(vp) @@ -177,13 +178,13 @@ int afs_frlock(OSI_VN_DECL(vp), int cmd, struct flock *lfp, int flag, * For GETLK we do a bit more - we first check any byte-wise * locks - if none then check for full AFS file locks */ - if (cmd == F_GETLK || lfp->l_whence != 0 || lfp->l_start != 0 || - (lfp->l_len != MAXEND && lfp->l_len != 0)) { + if (cmd == F_GETLK || lfp->l_whence != 0 || lfp->l_start != 0 + || (lfp->l_len != MAXEND && lfp->l_len != 0)) { AFS_RWLOCK(vp, VRWLOCK_WRITE); AFS_GUNLOCK(); #ifdef AFS_SGI65_ENV - error = fs_frlock(OSI_VN_ARG(vp), cmd, lfp, flag, offset, - vrwlock, cr); + error = + fs_frlock(OSI_VN_ARG(vp), cmd, lfp, flag, offset, vrwlock, cr); #else error = fs_frlock(vp, cmd, lfp, flag, offset, cr); #endif @@ -197,37 +198,36 @@ int afs_frlock(OSI_VN_DECL(vp), int cmd, struct flock *lfp, int flag, /* fall through to check for full AFS file locks */ } - /* map BSD style to plain - we don't call reclock() + /* map BSD style to plain - we don't call reclock() * and its only there that the difference is important */ switch (cmd) { - case F_GETLK: - case F_RGETLK: - break; - case F_SETLK: - case F_RSETLK: - break; - case F_SETBSDLK: - cmd = F_SETLK; - break; - case F_SETLKW: - case F_RSETLKW: - break; - case F_SETBSDLKW: - cmd = F_SETLKW; - break; - default: - return EINVAL; + case F_GETLK: + case F_RGETLK: + break; + case F_SETLK: + case F_RSETLK: + break; + case F_SETBSDLK: + cmd = F_SETLK; + break; + case F_SETLKW: + case F_RSETLKW: + break; + case F_SETBSDLKW: + cmd = F_SETLKW; + break; + default: + return EINVAL; } AFS_GUNLOCK(); - error = convoff(vp, lfp, 0, offset - , SEEKLIMIT + error = convoff(vp, lfp, 0, offset, SEEKLIMIT #ifdef AFS_SGI64_ENV , OSI_GET_CURRENT_CRED() #endif /* AFS_SGI64_ENV */ - ); + ); AFS_GLOCK(); if (!error) { @@ -263,32 +263,34 @@ int afs_frlock(OSI_VN_DECL(vp), int cmd, struct flock *lfp, int flag, */ /* ARGSUSED */ #ifdef AFS_SGI64_ENV -static int afs_xread(OSI_VC_ARG(avc), uiop, ioflag, cr, flp) -struct flid *flp; +static int +afs_xread(OSI_VC_ARG(avc), uiop, ioflag, cr, flp) + struct flid *flp; #else -static int afs_xread(OSI_VC_ARG(avc), uiop, ioflag, cr) +static int +afs_xread(OSI_VC_ARG(avc), uiop, ioflag, cr) #endif - OSI_VC_DECL(avc); - struct uio *uiop; - int ioflag; - struct cred *cr; +OSI_VC_DECL(avc); + struct uio *uiop; + int ioflag; + struct cred *cr; { int code; OSI_VC_CONVERT(avc) - osi_Assert(avc->v.v_count > 0); + osi_Assert(avc->v.v_count > 0); if (avc->v.v_type != VREG) return EISDIR; #ifdef AFS_SGI64_ENV #ifdef AFS_SGI65_ENV if (!(ioflag & IO_ISLOCKED)) - AFS_RWLOCK((vnode_t*)avc, VRWLOCK_READ); + AFS_RWLOCK((vnode_t *) avc, VRWLOCK_READ); #endif code = afsrwvp(avc, uiop, UIO_READ, ioflag, cr, flp); #ifdef AFS_SGI65_ENV if (!(ioflag & IO_ISLOCKED)) - AFS_RWUNLOCK((vnode_t*)avc, VRWLOCK_READ); + AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_READ); #endif #else code = afsrwvp(avc, uiop, UIO_READ, ioflag, cr); @@ -298,20 +300,22 @@ static int afs_xread(OSI_VC_ARG(avc), uiop, ioflag, cr) /* ARGSUSED */ #ifdef AFS_SGI64_ENV -static int afs_xwrite(OSI_VC_ARG(avc), uiop, ioflag, cr, flp) -struct flid *flp; +static int +afs_xwrite(OSI_VC_ARG(avc), uiop, ioflag, cr, flp) + struct flid *flp; #else -static int afs_xwrite(OSI_VC_ARG(avc), uiop, ioflag, cr) +static int +afs_xwrite(OSI_VC_ARG(avc), uiop, ioflag, cr) #endif - OSI_VC_DECL(avc); - struct uio *uiop; - int ioflag; - struct cred *cr; +OSI_VC_DECL(avc); + struct uio *uiop; + int ioflag; + struct cred *cr; { int code; OSI_VC_CONVERT(avc) - osi_Assert(avc->v.v_count > 0); + osi_Assert(avc->v.v_count > 0); if (avc->v.v_type != VREG) return EISDIR; @@ -320,12 +324,12 @@ static int afs_xwrite(OSI_VC_ARG(avc), uiop, ioflag, cr) #ifdef AFS_SGI64_ENV #ifdef AFS_SGI65_ENV if (!(ioflag & IO_ISLOCKED)) - AFS_RWLOCK(((vnode_t*)avc), VRWLOCK_WRITE); + AFS_RWLOCK(((vnode_t *) avc), VRWLOCK_WRITE); #endif code = afsrwvp(avc, uiop, UIO_WRITE, ioflag, cr, flp); #ifdef AFS_SGI65_ENV if (!(ioflag & IO_ISLOCKED)) - AFS_RWUNLOCK((vnode_t*)avc, VRWLOCK_WRITE); + AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_WRITE); #endif #else code = afsrwvp(avc, uiop, UIO_WRITE, ioflag, cr); @@ -338,15 +342,13 @@ static int prnra = 0; static int acchk = 0; static int acdrop = 0; -static int afsrwvp(register struct vcache *avc, - register struct uio *uio, - enum uio_rw rw, - int ioflag, +static int +afsrwvp(register struct vcache *avc, register struct uio *uio, enum uio_rw rw, + int ioflag, #ifdef AFS_SGI64_ENV - struct cred *cr, - struct flid *flp) + struct cred *cr, struct flid *flp) #else - struct cred *cr) + struct cred *cr) #endif { register struct vnode *vp = AFSTOV(avc); @@ -362,34 +364,32 @@ static int afsrwvp(register struct vcache *avc, struct dcache *tdc; int counter = 0; - osi_Assert((valusema(&avc->vc_rwlock) <= 0) && - (OSI_GET_LOCKID() == avc->vc_rwlockid)); + osi_Assert((valusema(&avc->vc_rwlock) <= 0) + && (OSI_GET_LOCKID() == avc->vc_rwlockid)); newoff = uio->uio_resid + uio->uio_offset; if (uio->uio_resid <= 0) { return (0); } - if (uio->uio_offset < 0 - || (signed long)newoff < 0) { + if (uio->uio_offset < 0 || (signed long)newoff < 0) { return (EINVAL); } if (ioflag & IO_DIRECT) return EINVAL; - if (rw == UIO_WRITE && vp->v_type == VREG - && newoff > uio->uio_limit) { + if (rw == UIO_WRITE && vp->v_type == VREG && newoff > uio->uio_limit) { return (EFBIG); } afs_Trace4(afs_iclSetp, CM_TRACE_GRDWR, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, ioflag, - ICL_TYPE_INT32, rw, ICL_TYPE_INT32, 0); + ICL_TYPE_INT32, ioflag, ICL_TYPE_INT32, rw, ICL_TYPE_INT32, 0); /* get a validated vcache entry */ afs_InitReq(&treq, cr); error = afs_VerifyVCache(avc, &treq); - if (error) return afs_CheckCode(error, &treq, 51); + if (error) + return afs_CheckCode(error, &treq, 51); /* * flush any stale pages - this will unmap @@ -398,8 +398,9 @@ static int afsrwvp(register struct vcache *avc, osi_FlushPages(avc, cr); if (cr && AFS_NFSXLATORREQ(cr) && rw == UIO_READ) { - if (!afs_AccessOK(avc, PRSFS_READ, &treq, - CHECK_MODE_BITS|CMB_ALLOW_EXEC_AS_READ)) + if (!afs_AccessOK + (avc, PRSFS_READ, &treq, + CHECK_MODE_BITS | CMB_ALLOW_EXEC_AS_READ)) return EACCES; } /* @@ -408,7 +409,7 @@ static int afsrwvp(register struct vcache *avc, * the last writers credentials */ if (rw == UIO_WRITE || (rw == UIO_READ && avc->cred == NULL)) { - ObtainWriteLock(&avc->lock,92); + ObtainWriteLock(&avc->lock, 92); if (avc->cred) crfree(avc->cred); crhold(cr); @@ -422,7 +423,7 @@ static int afsrwvp(register struct vcache *avc, * because there're no open/close nfs rpc's to call our afs_open/close. */ if (root_exported && rw == UIO_WRITE) { - ObtainWriteLock(&avc->lock,234); + ObtainWriteLock(&avc->lock, 234); if (root_exported) { didFakeOpen = 1; afs_FakeOpen(avc); @@ -432,7 +433,7 @@ static int afsrwvp(register struct vcache *avc, error = 0; if (rw == UIO_WRITE) { - ObtainWriteLock(&avc->lock,330); + ObtainWriteLock(&avc->lock, 330); avc->states |= CDirty; ReleaseWriteLock(&avc->lock); } @@ -453,7 +454,7 @@ static int afsrwvp(register struct vcache *avc, error = avc->vc_error; break; } - bsize = AFSBSIZE; /* why not?? */ + bsize = AFSBSIZE; /* why not?? */ off = uio->uio_offset % bsize; bn = BTOBBT(uio->uio_offset - off); /* @@ -472,7 +473,7 @@ static int afsrwvp(register struct vcache *avc, /* * read/paging in a normal file */ - rem = avc->m.Length - (afs_int32)uio->uio_offset; + rem = avc->m.Length - (afs_int32) uio->uio_offset; if (rem <= 0) /* EOF */ break; @@ -503,8 +504,8 @@ static int afsrwvp(register struct vcache *avc, * do read-ahead on any file that has potentially * dirty mmap pages. */ - if ((avc->lastr + BTOBB(AFSBSIZE) == bn || - uio->uio_resid > AFSBSIZE) + if ((avc->lastr + BTOBB(AFSBSIZE) == bn + || uio->uio_resid > AFSBSIZE) #ifdef AFS_SGI61_ENV && (!AFS_VN_MAPPED(vp)) #else /* AFS_SGI61_ENV */ @@ -533,10 +534,10 @@ static int afsrwvp(register struct vcache *avc, } #ifdef DEBUG else if (prnra) - printf("NRA:vp 0x%x lastr %d bn %d len %d cnt %d bsize %d rem %d resid %d\n", - vp, avc->lastr, bn, - len, cnt, bsize, rem, - uio->uio_resid); + printf + ("NRA:vp 0x%x lastr %d bn %d len %d cnt %d bsize %d rem %d resid %d\n", + vp, avc->lastr, bn, len, cnt, bsize, rem, + uio->uio_resid); #endif avc->lastr = bn; @@ -546,13 +547,13 @@ static int afsrwvp(register struct vcache *avc, */ if (counter == 0 || AFS_CHUNKOFFSET(off) == 0) { AFS_GLOCK(); - ObtainWriteLock(&avc->lock,562); + ObtainWriteLock(&avc->lock, 562); tdc = afs_FindDCache(avc, off); - if (tdc) { - if (!(tdc->flags & DFNextStarted)) - afs_PrefetchChunk(avc, tdc, cr, &treq); + if (tdc) { + if (!(tdc->mflags & DFNextStarted)) + afs_PrefetchChunk(avc, tdc, cr, &treq); afs_PutDCache(tdc); - } + } ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); } @@ -568,13 +569,14 @@ static int afsrwvp(register struct vcache *avc, */ if (counter > 0 && AFS_CHUNKOFFSET(uio->uio_offset) == 0) { AFS_GLOCK(); - ObtainWriteLock(&avc->lock,90); + ObtainWriteLock(&avc->lock, 90); error = afs_DoPartialWrite(avc, &treq); if (error == 0) avc->states |= CDirty; ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); - if (error) break; + if (error) + break; } counter++; @@ -623,7 +625,7 @@ static int afsrwvp(register struct vcache *avc, osi_Assert(bp->b_error == 0); if (uio->uio_segflg != UIO_NOSPACE) - (void) bp_mapin(bp); + (void)bp_mapin(bp); AFS_UIOMOVE(bp->b_un.b_addr + bmv[0].pboff, cnt, rw, uio, error); if (rw == UIO_READ || error) { if (bp->b_flags & B_DELWRI) { @@ -635,12 +637,12 @@ static int afsrwvp(register struct vcache *avc, * m.Length is the maximum number of bytes known to be in the file. * Make sure it is at least as high as the last byte we just wrote * into the buffer. - */ - if (avc->m.Length < (afs_int32)uio->uio_offset) { + */ + if (avc->m.Length < (afs_int32) uio->uio_offset) { AFS_GLOCK(); - ObtainWriteLock(&avc->lock,235); + ObtainWriteLock(&avc->lock, 235); avc->m.Length = uio->uio_offset; - ReleaseWriteLock(&avc->lock); + ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); } if (uio->uio_fmode & FSYNC) { @@ -654,10 +656,11 @@ static int afsrwvp(register struct vcache *avc, /* * Since EIO on an unlinked file is non-intuitive - give some * explanation - */ + */ if (error) { if (avc->m.LinkCount == 0) - cmn_err(CE_WARN,"AFS: Process pid %d write error %d writing to unlinked file.", + cmn_err(CE_WARN, + "AFS: Process pid %d write error %d writing to unlinked file.", OSI_GET_CURRENT_PID(), error); } } @@ -674,8 +677,8 @@ static int afsrwvp(register struct vcache *avc, if (!error) { #ifdef AFS_SGI61_ENV - if (((ioflag & IO_SYNC) || (ioflag & IO_DSYNC)) && (rw == UIO_WRITE) && - !AFS_NFSXLATORREQ(cr)) { + if (((ioflag & IO_SYNC) || (ioflag & IO_DSYNC)) && (rw == UIO_WRITE) + && !AFS_NFSXLATORREQ(cr)) { error = afs_fsync(avc, 0, cr); } #else /* AFS_SGI61_ENV */ @@ -685,42 +688,43 @@ static int afsrwvp(register struct vcache *avc, #endif /* AFS_SGI61_ENV */ } if (didFakeOpen) { - ObtainWriteLock(&avc->lock,236); + ObtainWriteLock(&avc->lock, 236); afs_FakeClose(avc, cr); /* XXXX For nfs trans XXXX */ ReleaseWriteLock(&avc->lock); } afs_Trace4(afs_iclSetp, CM_TRACE_GRDWR, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, ioflag, - ICL_TYPE_INT32, rw, ICL_TYPE_INT32, error); + ICL_TYPE_INT32, ioflag, ICL_TYPE_INT32, rw, ICL_TYPE_INT32, + error); return (error); } -int afs_xbmap(OSI_VC_ARG(avc), offset, count, flag, cr, bmv, nbmv) - OSI_VC_DECL(avc); - off_t offset; - ssize_t count; - int flag; - struct cred *cr; - struct bmapval *bmv; - int *nbmv; +int +afs_xbmap(OSI_VC_ARG(avc), offset, count, flag, cr, bmv, nbmv) +OSI_VC_DECL(avc); + off_t offset; + ssize_t count; + int flag; + struct cred *cr; + struct bmapval *bmv; + int *nbmv; { - int bsize; /* server's block size in bytes */ + int bsize; /* server's block size in bytes */ off_t off; size_t rem, cnt; OSI_VC_CONVERT(avc) - bsize = AFSBSIZE; + bsize = AFSBSIZE; off = offset % bsize; /* offset into block */ bmv->bn = BTOBBT(offset - off); bmv->offset = bmv->bn; bmv->pboff = off; rem = avc->m.Length - offset; if (rem <= 0) - cnt = 0; /* EOF */ + cnt = 0; /* EOF */ else cnt = MIN(bsize - off, rem); - + /* * It is benign to ignore *nbmv > 1, since it is only for requesting * readahead. @@ -753,7 +757,7 @@ int afs_xbmap(OSI_VC_ARG(avc), offset, count, flag, cr, bmv, nbmv) */ static void afs_strategy(OSI_VC_ARG(avc), bp) - OSI_VC_DECL(avc); +OSI_VC_DECL(avc); struct buf *bp; { uio_t auio; @@ -762,31 +766,31 @@ afs_strategy(OSI_VC_ARG(avc), bp) int error; struct cred *cr; OSI_VC_CONVERT(avc) - vnode_t *vp = (vnode_t *)avc; + vnode_t *vp = (vnode_t *) avc; /* * We can't afford DELWRI buffers for 2 reasons: * 1) Since we can call underlying EFS, we can require a - * buffer to flush a buffer. This leads to 2 potential - * recursions/deadlocks - * a) if all buffers are DELWRI afs buffers, then - * ngeteblk -> bwrite -> afs_strategy -> afs_write -> - * UFS_Write -> efs_write -> ngeteblk .... could - * recurse a long ways! - * b) brelse -> chunkhold which can call dchunkpush - * will look for any DELWRI buffers and call strategy - * on them. This can then end up via UFS_Write - * recursing + * buffer to flush a buffer. This leads to 2 potential + * recursions/deadlocks + * a) if all buffers are DELWRI afs buffers, then + * ngeteblk -> bwrite -> afs_strategy -> afs_write -> + * UFS_Write -> efs_write -> ngeteblk .... could + * recurse a long ways! + * b) brelse -> chunkhold which can call dchunkpush + * will look for any DELWRI buffers and call strategy + * on them. This can then end up via UFS_Write + * recursing * Current hack: - * a) We never do bdwrite(s) on AFS buffers. - * b) We call pdflush with B_ASYNC - * c) in chunkhold where it can set a buffer DELWRI - * we immediatly do a clusterwrite for AFS vp's + * a) We never do bdwrite(s) on AFS buffers. + * b) We call pdflush with B_ASYNC + * c) in chunkhold where it can set a buffer DELWRI + * we immediatly do a clusterwrite for AFS vp's * XXX Alas, 'c' got dropped in 5.1 so its possible to get DELWRI - * buffers if someone has mmaped the file and dirtied it then - * reads/faults it again. - * Instead - wherever we call chunkread/getchunk we check for a - * returned bp with DELWRI set, and write it out immediately + * buffers if someone has mmaped the file and dirtied it then + * reads/faults it again. + * Instead - wherever we call chunkread/getchunk we check for a + * returned bp with DELWRI set, and write it out immediately */ if (CheckLock(&avc->lock) && VN_GET_DBUF(vp)) { printf("WARN: afs_strategy vp=%x, v_dbuf=%x bp=%x\n", vp, @@ -796,8 +800,9 @@ afs_strategy(OSI_VC_ARG(avc), bp) iodone(bp); return; } - if (bp->b_error != 0) - printf("WARNING: afs_strategy3 vp=%x, bp=%x, err=%x\n", vp, bp, bp->b_error); + if (bp->b_error != 0) + printf("WARNING: afs_strategy3 vp=%x, bp=%x, err=%x\n", vp, bp, + bp->b_error); /* * To get credentials somewhat correct (we may be called from bdflush/ @@ -815,7 +820,7 @@ afs_strategy(OSI_VC_ARG(avc), bp) ReleaseReadLock(&avc->lock); return; } - } else if ((avc->states & CWritingUFS) && (bp->b_flags & B_DELWRI)) { + } else if ((avc->states & CWritingUFS) && (bp->b_flags & B_DELWRI)) { bp->b_ref = 3; ReleaseReadLock(&avc->lock); iodone(bp); @@ -864,27 +869,28 @@ afs_strategy(OSI_VC_ARG(avc), bp) } /* ARGSUSED */ -static int afs_seek(OSI_VC_ARG(avc), ooff, noffp) - OSI_VC_DECL(avc); - off_t ooff; - off_t *noffp; +static int +afs_seek(OSI_VC_ARG(avc), ooff, noffp) +OSI_VC_DECL(avc); + off_t ooff; + off_t *noffp; { - return *noffp < 0 ? EINVAL : 0; + return *noffp < 0 ? EINVAL : 0; } #if !defined(AFS_SGI65_ENV) /* Irix 6.5 uses addmap/delmap only for devices. */ /* ARGSUSED */ -static int afs_addmap(OSI_VC_ARG(avc), off, prp, addr, len, prot, maxprot, - flags, cr) - off_t off; - OSI_VC_DECL(avc); - struct pregion *prp; - addr_t addr; - size_t len; - u_int prot, maxprot; - u_int flags; - struct cred *cr; +static int +afs_addmap(OSI_VC_ARG(avc), off, prp, addr, len, prot, maxprot, flags, cr) + off_t off; +OSI_VC_DECL(avc); + struct pregion *prp; + addr_t addr; + size_t len; + u_int prot, maxprot; + u_int flags; + struct cred *cr; { OSI_VC_CONVERT(avc) struct vnode *vp = AFSTOV(avc); @@ -896,7 +902,7 @@ static int afs_addmap(OSI_VC_ARG(avc), off, prp, addr, len, prot, maxprot, AFS_RWLOCK(vp, VRWLOCK_WRITE); if (avc->mapcnt == 0) { /* on first mapping add a open reference */ - ObtainWriteLock(&avc->lock,237); + ObtainWriteLock(&avc->lock, 237); avc->execsOrWriters++; avc->opens++; ReleaseWriteLock(&avc->lock); @@ -906,17 +912,16 @@ static int afs_addmap(OSI_VC_ARG(avc), off, prp, addr, len, prot, maxprot, return 0; } -/*ARGSUSED*/ -static int afs_delmap(OSI_VC_ARG(avc), off, prp, addr, len, prot, maxprot, - flags, acred) - off_t off; - OSI_VC_DECL(avc); - struct pregion *prp; - addr_t addr; - size_t len; - u_int prot, maxprot; - u_int flags; - struct cred *acred; + /*ARGSUSED*/ static int +afs_delmap(OSI_VC_ARG(avc), off, prp, addr, len, prot, maxprot, flags, acred) + off_t off; +OSI_VC_DECL(avc); + struct pregion *prp; + addr_t addr; + size_t len; + u_int prot, maxprot; + u_int flags; + struct cred *acred; { OSI_VC_CONVERT(avc) struct vnode *vp = AFSTOV(avc); @@ -937,9 +942,9 @@ static int afs_delmap(OSI_VC_ARG(avc), off, prp, addr, len, prot, maxprot, osi_Assert(avc->execsOrWriters > 0); osi_Assert(avc->opens > 0); if (avc->m.LinkCount == 0) { - ObtainWriteLock(&avc->lock,238); + ObtainWriteLock(&avc->lock, 238); AFS_GUNLOCK(); - PTOSSVP(vp, (off_t)0, (off_t)MAXLONG); + PTOSSVP(vp, (off_t) 0, (off_t) MAXLONG); AFS_GLOCK(); ReleaseWriteLock(&avc->lock); } @@ -949,17 +954,18 @@ static int afs_delmap(OSI_VC_ARG(avc), off, prp, addr, len, prot, maxprot, afs_InitReq(&treq, acred); if (afs_BBusy()) { /* do it yourself if daemons are all busy */ - ObtainWriteLock(&avc->lock,239); + ObtainWriteLock(&avc->lock, 239); code = afs_StoreOnLastReference(avc, &treq); ReleaseWriteLock(&avc->lock); /* BStore does CheckCode so we should also */ /* VNOVNODE is "acceptable" error code from close, since - may happen when deleting a file on another machine while - it is open here. */ + * may happen when deleting a file on another machine while + * it is open here. */ if (code == VNOVNODE) code = 0; if (code) { - afs_StoreWarn(code, avc->fid.Fid.Volume, /* /dev/console */ 1); + afs_StoreWarn(code, avc->fid.Fid.Volume, /* /dev/console */ + 1); } code = afs_CheckCode(code, &treq, 52); AFS_RWUNLOCK(vp, VRWLOCK_WRITE); @@ -967,8 +973,8 @@ static int afs_delmap(OSI_VC_ARG(avc), off, prp, addr, len, prot, maxprot, AFS_RWUNLOCK(vp, VRWLOCK_WRITE); /* at least one daemon is idle, so ask it to do the store. * Also, note that we don't lock it any more... */ - tb = afs_BQueue(BOP_STORE, avc, 0, 1, acred, (long)acred->cr_uid, - 0L, 0L, 0L); + tb = afs_BQueue(BOP_STORE, avc, 0, 1, acred, + (afs_size_t) acred->cr_uid, 0L, (void *)0); /* sleep waiting for the store to start, then retrieve error code */ while ((tb->flags & BUVALID) == 0) { tb->flags |= BUWAIT; @@ -991,25 +997,26 @@ static int afs_delmap(OSI_VC_ARG(avc), off, prp, addr, len, prot, maxprot, * ever having been 'opened' */ #ifdef AFS_SGI65_ENV -static int afs_map(OSI_VC_ARG(avc), off, len, prot, flags, cr, vpp) +static int +afs_map(OSI_VC_ARG(avc), off, len, prot, flags, cr, vpp) off_t off; - OSI_VC_DECL(avc); +OSI_VC_DECL(avc); size_t len; mprot_t prot; u_int flags; struct cred *cr; vnode_t **vpp; #else -static int afs_map(OSI_VC_ARG(avc), off, prp, addrp, len, prot, maxprot, - flags, cr) - off_t off; - OSI_VC_DECL(avc); - struct pregion *prp; - addr_t *addrp; - size_t len; - u_int prot, maxprot; - u_int flags; - struct cred *cr; +static int +afs_map(OSI_VC_ARG(avc), off, prp, addrp, len, prot, maxprot, flags, cr) + off_t off; +OSI_VC_DECL(avc); + struct pregion *prp; + addr_t *addrp; + size_t len; + u_int prot, maxprot; + u_int flags; + struct cred *cr; #endif { OSI_VC_CONVERT(avc) @@ -1020,7 +1027,8 @@ static int afs_map(OSI_VC_ARG(avc), off, prp, addrp, len, prot, maxprot, /* get a validated vcache entry */ afs_InitReq(&treq, cr); error = afs_VerifyVCache(avc, &treq); - if (error) return afs_CheckCode(error, &treq, 53); + if (error) + return afs_CheckCode(error, &treq, 53); osi_FlushPages(avc, cr); /* ensure old pages are gone */ #ifdef AFS_SGI65_ENV @@ -1031,17 +1039,18 @@ static int afs_map(OSI_VC_ARG(avc), off, prp, addrp, len, prot, maxprot, AFS_RWLOCK(vp, VRWLOCK_WRITE); ObtainWriteLock(&avc->lock, 501); if (avc->execsOrWriters > 0) { - avc->execsOrWriters ++; - avc->opens ++; - avc->mapcnt ++; /* count eow's due to mappings. */ + avc->execsOrWriters++; + avc->opens++; + avc->mapcnt++; /* count eow's due to mappings. */ } ReleaseWriteLock(&avc->lock); AFS_RWUNLOCK(vp, VRWLOCK_WRITE); #else AFS_RWLOCK(vp, VRWLOCK_WRITE); AFS_GUNLOCK(); - error = fs_map_subr(vp, (off_t) avc->m.Length, (u_int)avc->m.Mode, off, prp, - *addrp, len, prot, maxprot, flags, cr); + error = + fs_map_subr(vp, (off_t) avc->m.Length, (u_int) avc->m.Mode, off, prp, + *addrp, len, prot, maxprot, flags, cr); AFS_GLOCK(); AFS_RWUNLOCK(vp, VRWLOCK_WRITE); #endif /* AFS_SGI65_ENV */ @@ -1061,17 +1070,17 @@ extern afs_lock_t afs_xdcache; #ifdef AFS_SGI64_ENV int #else -void +void #endif afs_xinactive(OSI_VC_ARG(avc), acred) - OSI_VC_DECL(avc); - struct ucred *acred; +OSI_VC_DECL(avc); + struct ucred *acred; { int s; OSI_VC_CONVERT(avc) - vnode_t *vp = (vnode_t *)avc; - int mapcnt = avc->mapcnt; /* We just clear off this many. */ - + vnode_t *vp = (vnode_t *) avc; + int mapcnt = avc->mapcnt; /* We just clear off this many. */ + AFS_STATCNT(afs_inactive); s = VN_LOCK(vp); @@ -1096,7 +1105,7 @@ afs_xinactive(OSI_VC_ARG(avc), acred) /* In Irix 6.5, the last unmap of a dirty mmap'd file does not * get an explicit vnode op. Instead we only find out at VOP_INACTIVE. */ - if (!afs_rwlock_nowait((vnode_t*)avc, VRWLOCK_WRITE)) { + if (!afs_rwlock_nowait((vnode_t *) avc, VRWLOCK_WRITE)) { return VN_INACTIVE_CACHE; } if (NBObtainWriteLock(&avc->lock, 502)) { @@ -1104,7 +1113,7 @@ afs_xinactive(OSI_VC_ARG(avc), acred) return VN_INACTIVE_CACHE; } if (avc->states & CUnlinked) { - if (CheckLock(&afs_xvcache) || CheckLock(&afs_xdcache)) { + if (CheckLock(&afs_xvcache) || CheckLock(&afs_xdcache)) { avc->states |= CUnlinkedDel; ReleaseWriteLock(&avc->lock); AFS_RWUNLOCK(vp, VRWLOCK_WRITE); @@ -1136,16 +1145,16 @@ afs_xinactive(OSI_VC_ARG(avc), acred) code = 0; if (code) { if (mapcnt) { - cmn_err(CE_WARN, "AFS: Failed to store FID (%x:%lu.%lu.%lu) in VOP_INACTIVE, error = %d\n", + cmn_err(CE_WARN, + "AFS: Failed to store FID (%x:%lu.%lu.%lu) in VOP_INACTIVE, error = %d\n", (int)(avc->fid.Cell) & 0xffffffff, - avc->fid.Fid.Volume, - avc->fid.Fid.Vnode, avc->fid.Fid.Unique, - code); + avc->fid.Fid.Volume, avc->fid.Fid.Vnode, + avc->fid.Fid.Unique, code); } - afs_InvalidateAllSegments(avc, 1); + afs_InvalidateAllSegments(avc); } s = VN_LOCK(vp); - vp->v_count --; + vp->v_count--; code = (vp->v_count == 0); VN_UNLOCK(vp, s); /* If the vnode is now in use by someone else, return early. */ @@ -1158,7 +1167,7 @@ afs_xinactive(OSI_VC_ARG(avc), acred) } #endif - osi_Assert((avc->states & (CCore|CMAPPED)) == 0); + osi_Assert((avc->states & (CCore | CMAPPED)) == 0); if (avc->cred) { crfree(avc->cred); @@ -1173,17 +1182,16 @@ afs_xinactive(OSI_VC_ARG(avc), acred) */ if (avc->m.LinkCount == 0) { AFS_GUNLOCK(); - PTOSSVP(vp, (off_t)0, (off_t)MAXLONG); + PTOSSVP(vp, (off_t) 0, (off_t) MAXLONG); AFS_GLOCK(); } - #ifndef AFS_SGI65_ENV osi_Assert(avc->mapcnt == 0); afs_chkpgoob(&avc->v, btoc(avc->m.Length)); - avc->states &= ~CDirty; /* Give up on store-backs */ + avc->states &= ~CDirty; /* Give up on store-backs */ if (avc->states & CUnlinked) { - if (CheckLock(&afs_xvcache) || CheckLock(&afs_xdcache)) { + if (CheckLock(&afs_xvcache) || CheckLock(&afs_xdcache)) { avc->states |= CUnlinkedDel; } else { afs_remunlink(avc, 1); /* ignore any return code */ @@ -1199,14 +1207,15 @@ static int afs_reclaim(OSI_VC_DECL(avc), int flag) { #ifdef AFS_SGI64_ENV - /* Get's called via VOP_RELCAIM in afs_FlushVCache to clear repl_vnodeops*/ + /* Get's called via VOP_RELCAIM in afs_FlushVCache to clear repl_vnodeops */ return 0; #else panic("afs_reclaim"); #endif } -void afs_rwlock(OSI_VN_DECL(vp), AFS_RWLOCK_T flag) +void +afs_rwlock(OSI_VN_DECL(vp), AFS_RWLOCK_T flag) { OSI_VN_CONVERT(vp) struct vcache *avc = VTOAFS(vp); @@ -1221,7 +1230,8 @@ void afs_rwlock(OSI_VN_DECL(vp), AFS_RWLOCK_T flag) avc->vc_rwlockid = OSI_GET_LOCKID(); } -void afs_rwunlock(OSI_VN_DECL(vp), AFS_RWLOCK_T flag) +void +afs_rwunlock(OSI_VN_DECL(vp), AFS_RWLOCK_T flag) { OSI_VN_CONVERT(vp) struct vcache *avc = VTOAFS(vp); @@ -1242,7 +1252,8 @@ void afs_rwunlock(OSI_VN_DECL(vp), AFS_RWLOCK_T flag) * does not match the corresponding lock flag. But they may start using this * flag for a real rw lock at some time. */ -int afs_rwlock_nowait(vnode_t *vp, AFS_RWLOCK_T flag) +int +afs_rwlock_nowait(vnode_t * vp, AFS_RWLOCK_T flag) { struct vcache *avc = VTOAFS(vp); @@ -1253,25 +1264,26 @@ int afs_rwlock_nowait(vnode_t *vp, AFS_RWLOCK_T flag) } if (cpsema(&avc->vc_rwlock)) { avc->vc_rwlockid = OSI_GET_LOCKID(); - return 1; + return 1; } return 0; } #if defined(AFS_SGI64_ENV) && defined(CKPT) && !defined(_R5000_CVT_WAR) -int afs_fid2(OSI_VC_DECL(avc), struct fid *fidp) +int +afs_fid2(OSI_VC_DECL(avc), struct fid *fidp) { struct cell *tcell; - afs_fid2_t *afid = (afs_fid2_t*)fidp; + afs_fid2_t *afid = (afs_fid2_t *) fidp; OSI_VC_CONVERT(avc) - osi_Assert(sizeof(fid_t) >= sizeof(afs_fid2_t)); + osi_Assert(sizeof(fid_t) >= sizeof(afs_fid2_t)); afid->af_len = sizeof(afs_fid2_t) - sizeof(afid->af_len); tcell = afs_GetCell(avc->fid.Cell, READ_LOCK); afid->af_cell = tcell->cellIndex & 0xffff; afs_PutCell(tcell, READ_LOCK); - + afid->af_volid = avc->fid.Fid.Volume; afid->af_vno = avc->fid.Fid.Vnode; afid->af_uniq = avc->fid.Fid.Unique; @@ -1286,7 +1298,8 @@ int afs_fid2(OSI_VC_DECL(avc), struct fid *fidp) * * afs_fid2 is used to support the R5000 workarounds (_R5000_CVT_WAR) */ -int afs_fid2(OSI_VC_DECL(avc), struct fid *fidp) +int +afs_fid2(OSI_VC_DECL(avc), struct fid *fidp) { #if defined(_R5000_CVT_WAR) extern int R5000_cvt_war; @@ -1308,7 +1321,7 @@ int afs_fid2(OSI_VC_DECL(avc), struct fid *fidp) * Drop the global lock here, since we may not actually do the call. */ void -afs_chkpgoob(vnode_t *vp, pgno_t pgno) +afs_chkpgoob(vnode_t * vp, pgno_t pgno) { #undef PGDEBUG #ifdef PGDEBUG @@ -1328,485 +1341,542 @@ afs_chkpgoob(vnode_t *vp, pgno_t pgno) #endif #ifdef AFS_SGI64_ENV -int mp_afs_open(bhv_desc_t *bhp, vnode_t **a, mode_t b, struct cred *c) +int +mp_afs_open(bhv_desc_t * bhp, vnode_t ** a, mode_t b, struct cred *c) #else -int mp_afs_open(vnode_t **a, mode_t b, struct cred *c) +int +mp_afs_open(vnode_t ** a, mode_t b, struct cred *c) #endif { - int rv; - AFS_GLOCK(); + int rv; + AFS_GLOCK(); #ifdef AFS_SGI64_ENV - rv = afs_lockedvnodeops.vop_open(bhp, a, b, c); + rv = afs_lockedvnodeops.vop_open(bhp, a, b, c); #else - rv = afs_lockedvnodeops.vop_open(a, b, c); + rv = afs_lockedvnodeops.vop_open(a, b, c); #endif - AFS_GUNLOCK(); - return rv; + AFS_GUNLOCK(); + return rv; } #if defined(AFS_SGI64_ENV) #if defined(AFS_SGI65_ENV) -int mp_afs_close(AFS_MP_VC_ARG (*a), int b, lastclose_t c, struct cred *d) +int +mp_afs_close(AFS_MP_VC_ARG(*a), int b, lastclose_t c, struct cred *d) #else -int mp_afs_close(AFS_MP_VC_ARG (*a), int b, lastclose_t c, off_t d, - struct cred *e, struct flid *f) +int +mp_afs_close(AFS_MP_VC_ARG(*a), int b, lastclose_t c, off_t d, struct cred *e, + struct flid *f) #endif #else -int mp_afs_close(AFS_MP_VC_ARG (*a), int b, lastclose_t c, off_t d, - struct cred *e) +int +mp_afs_close(AFS_MP_VC_ARG(*a), int b, lastclose_t c, off_t d, struct cred *e) #endif { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_close(a, b, c, d + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_close(a, b, c, d #if !defined(AFS_SGI65_ENV) - , e + , e #if defined(AFS_SGI64_ENV) - , f + , f #endif #endif - ); - - AFS_GUNLOCK(); - return rv; + ); + + AFS_GUNLOCK(); + return rv; } #ifdef AFS_SGI64_ENV -int mp_afs_read(AFS_MP_VC_ARG(*a), struct uio *b, int c, struct cred *d, - struct flid *f) +int +mp_afs_read(AFS_MP_VC_ARG(*a), struct uio *b, int c, struct cred *d, + struct flid *f) #else -int mp_afs_read(AFS_MP_VC_ARG(*a), struct uio *b, int c, struct cred *d) +int +mp_afs_read(AFS_MP_VC_ARG(*a), struct uio *b, int c, struct cred *d) #endif { - int rv; - AFS_GLOCK(); + int rv; + AFS_GLOCK(); #ifdef AFS_SGI64_ENV - rv = afs_lockedvnodeops.vop_read(a, b, c, d, f); + rv = afs_lockedvnodeops.vop_read(a, b, c, d, f); #else - rv = afs_lockedvnodeops.vop_read(a, b, c, d); + rv = afs_lockedvnodeops.vop_read(a, b, c, d); #endif - AFS_GUNLOCK(); - return rv; + AFS_GUNLOCK(); + return rv; } #ifdef AFS_SGI64_ENV -int mp_afs_write(AFS_MP_VC_ARG(*a), struct uio *b, int c, struct cred *d, - struct flid *f) +int +mp_afs_write(AFS_MP_VC_ARG(*a), struct uio *b, int c, struct cred *d, + struct flid *f) #else -int mp_afs_write(AFS_MP_VC_ARG(*a), struct uio *b, int c, struct cred *d) +int +mp_afs_write(AFS_MP_VC_ARG(*a), struct uio *b, int c, struct cred *d) #endif { - int rv; - AFS_GLOCK(); + int rv; + AFS_GLOCK(); #ifdef AFS_SGI64_ENV - rv = afs_lockedvnodeops.vop_write(a, b, c, d, f); + rv = afs_lockedvnodeops.vop_write(a, b, c, d, f); #else - rv = afs_lockedvnodeops.vop_write(a, b, c, d); + rv = afs_lockedvnodeops.vop_write(a, b, c, d); #endif - AFS_GUNLOCK(); - return rv; + AFS_GUNLOCK(); + return rv; } -int mp_afs_ioctl(AFS_MP_VC_ARG(*a), int b, void *c, int d, struct cred *e, - int *f +int +mp_afs_ioctl(AFS_MP_VC_ARG(*a), int b, void *c, int d, struct cred *e, int *f #ifdef AFS_SGI65_ENV - , struct vopbd *vbds + , struct vopbd *vbds #endif - ) + ) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_ioctl(a, b, c, d, e, f + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_ioctl(a, b, c, d, e, f #ifdef AFS_SGI65_ENV - , vbds + , vbds #endif - ); - AFS_GUNLOCK(); - return rv; + ); + AFS_GUNLOCK(); + return rv; } -int mp_fs_setfl(AFS_MP_VC_ARG(*a), int b, int c, struct cred *d) +int +mp_fs_setfl(AFS_MP_VC_ARG(*a), int b, int c, struct cred *d) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_setfl(a, b, c, d); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_setfl(a, b, c, d); + AFS_GUNLOCK(); + return rv; } -int mp_afs_getattr(AFS_MP_VC_ARG(*a), struct vattr *b, int c, struct cred *d) + +int +mp_afs_getattr(AFS_MP_VC_ARG(*a), struct vattr *b, int c, struct cred *d) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_getattr(a, b, c, d); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_getattr(a, b, c, d); + AFS_GUNLOCK(); + return rv; } -int mp_afs_setattr(AFS_MP_VC_ARG(*a), struct vattr *b, int c, struct cred *d) + +int +mp_afs_setattr(AFS_MP_VC_ARG(*a), struct vattr *b, int c, struct cred *d) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_setattr(a, b, c, d); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_setattr(a, b, c, d); + AFS_GUNLOCK(); + return rv; } -int mp_afs_access(AFS_MP_VC_ARG(*a), int b, +int +mp_afs_access(AFS_MP_VC_ARG(*a), int b, #ifndef AFS_SGI65_ENV - int c, + int c, #endif - struct cred *d) + struct cred *d) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_access(a, b, + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_access(a, b, #ifndef AFS_SGI65_ENV - c, + c, #endif - d); - AFS_GUNLOCK(); - return rv; + d); + AFS_GUNLOCK(); + return rv; } -int mp_afs_lookup(AFS_MP_VC_ARG(*a), char *b, vnode_t **c, struct pathname *d, - int e, vnode_t *f, struct cred *g) +int +mp_afs_lookup(AFS_MP_VC_ARG(*a), char *b, vnode_t ** c, struct pathname *d, + int e, vnode_t * f, struct cred *g) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_lookup(a, b, c, d, e, f, g); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_lookup(a, b, c, d, e, f, g); + AFS_GUNLOCK(); + return rv; } + #ifdef AFS_SGI64_ENV -int mp_afs_create(AFS_MP_VC_ARG(*a), char *b, struct vattr *c, int d, int e, - vnode_t **f, struct cred *g) +int +mp_afs_create(AFS_MP_VC_ARG(*a), char *b, struct vattr *c, int d, int e, + vnode_t ** f, struct cred *g) #else -int mp_afs_create(AFS_MP_VC_ARG(*a), char *b, struct vattr *c, enum vcexcl d, - int e, vnode_t **f, struct cred *g) +int +mp_afs_create(AFS_MP_VC_ARG(*a), char *b, struct vattr *c, enum vcexcl d, + int e, vnode_t ** f, struct cred *g) #endif { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_create(a, b, c, d, e, f, g); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_create(a, b, c, d, e, f, g); + AFS_GUNLOCK(); + return rv; } -int mp_afs_remove(AFS_MP_VC_ARG(*a), char *b, struct cred *c) + +int +mp_afs_remove(AFS_MP_VC_ARG(*a), char *b, struct cred *c) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_remove(a, b, c); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_remove(a, b, c); + AFS_GUNLOCK(); + return rv; } -int mp_afs_link(AFS_MP_VC_ARG(*a), vnode_t *b, char *c, struct cred *d) + +int +mp_afs_link(AFS_MP_VC_ARG(*a), vnode_t * b, char *c, struct cred *d) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_link(a, b, c, d); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_link(a, b, c, d); + AFS_GUNLOCK(); + return rv; } -int mp_afs_rename(AFS_MP_VC_ARG(*a), char *b, vnode_t *c, char *d, - struct pathname *e, struct cred *f) + +int +mp_afs_rename(AFS_MP_VC_ARG(*a), char *b, vnode_t * c, char *d, + struct pathname *e, struct cred *f) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_rename(a, b, c, d, e, f); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_rename(a, b, c, d, e, f); + AFS_GUNLOCK(); + return rv; } -int mp_afs_mkdir(AFS_MP_VC_ARG(*a), char *b, struct vattr *c, vnode_t **d, - struct cred *e) + +int +mp_afs_mkdir(AFS_MP_VC_ARG(*a), char *b, struct vattr *c, vnode_t ** d, + struct cred *e) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_mkdir(a, b, c, d, e); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_mkdir(a, b, c, d, e); + AFS_GUNLOCK(); + return rv; } -int mp_afs_rmdir(AFS_MP_VC_ARG(*a), char *b, vnode_t *c, struct cred *d) + +int +mp_afs_rmdir(AFS_MP_VC_ARG(*a), char *b, vnode_t * c, struct cred *d) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_rmdir(a, b, c, d); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_rmdir(a, b, c, d); + AFS_GUNLOCK(); + return rv; } -int mp_afs_readdir(AFS_MP_VC_ARG(*a), struct uio *b, struct cred *c, int *d) + +int +mp_afs_readdir(AFS_MP_VC_ARG(*a), struct uio *b, struct cred *c, int *d) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_readdir(a, b, c, d); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_readdir(a, b, c, d); + AFS_GUNLOCK(); + return rv; } -int mp_afs_symlink(AFS_MP_VC_ARG(*a), char *b, struct vattr *c, char *d, - struct cred *e) + +int +mp_afs_symlink(AFS_MP_VC_ARG(*a), char *b, struct vattr *c, char *d, + struct cred *e) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_symlink(a, b, c, d, e); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_symlink(a, b, c, d, e); + AFS_GUNLOCK(); + return rv; } -int mp_afs_readlink(AFS_MP_VC_ARG(*a), struct uio *b, struct cred *c) + +int +mp_afs_readlink(AFS_MP_VC_ARG(*a), struct uio *b, struct cred *c) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_readlink(a, b, c); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_readlink(a, b, c); + AFS_GUNLOCK(); + return rv; } -int mp_afs_fsync(AFS_MP_VC_ARG(*a), int b, struct cred *c +int +mp_afs_fsync(AFS_MP_VC_ARG(*a), int b, struct cred *c #ifdef AFS_SGI65_ENV - , off_t start, off_t stop + , off_t start, off_t stop #endif - ) + ) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_fsync(a, b, c + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_fsync(a, b, c #ifdef AFS_SGI65_ENV - , start, stop + , start, stop #endif - ); - AFS_GUNLOCK(); - return rv; + ); + AFS_GUNLOCK(); + return rv; } -void mp_afs_inactive(AFS_MP_VC_ARG(*a), struct cred *b) +void +mp_afs_inactive(AFS_MP_VC_ARG(*a), struct cred *b) { - AFS_GLOCK(); - afs_lockedvnodeops.vop_inactive(a, b); - AFS_GUNLOCK(); - return; + AFS_GLOCK(); + afs_lockedvnodeops.vop_inactive(a, b); + AFS_GUNLOCK(); + return; } -int mp_afs_fid(AFS_MP_VC_ARG(*a), struct fid **b) + +int +mp_afs_fid(AFS_MP_VC_ARG(*a), struct fid **b) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_fid(a, b); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_fid(a, b); + AFS_GUNLOCK(); + return rv; } -int mp_afs_fid2(AFS_MP_VC_ARG(*a), struct fid *b) + +int +mp_afs_fid2(AFS_MP_VC_ARG(*a), struct fid *b) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_fid2(a, b); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_fid2(a, b); + AFS_GUNLOCK(); + return rv; } -void mp_afs_rwlock(AFS_MP_VC_ARG(*a), AFS_RWLOCK_T b) + +void +mp_afs_rwlock(AFS_MP_VC_ARG(*a), AFS_RWLOCK_T b) { - AFS_GLOCK(); - afs_rwlock(a, VRWLOCK_WRITE); - AFS_GUNLOCK(); + AFS_GLOCK(); + afs_rwlock(a, VRWLOCK_WRITE); + AFS_GUNLOCK(); } -void mp_afs_rwunlock(AFS_MP_VC_ARG(*a), AFS_RWLOCK_T b) + +void +mp_afs_rwunlock(AFS_MP_VC_ARG(*a), AFS_RWLOCK_T b) { - AFS_GLOCK(); - afs_rwunlock(a, VRWLOCK_WRITE); - AFS_GUNLOCK(); + AFS_GLOCK(); + afs_rwunlock(a, VRWLOCK_WRITE); + AFS_GUNLOCK(); } -int mp_afs_seek(AFS_MP_VC_ARG(*a), off_t b, off_t*c) + +int +mp_afs_seek(AFS_MP_VC_ARG(*a), off_t b, off_t * c) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_seek(a, b, c); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_seek(a, b, c); + AFS_GUNLOCK(); + return rv; } -int mp_fs_cmp(AFS_MP_VC_ARG(*a), vnode_t *b) + +int +mp_fs_cmp(AFS_MP_VC_ARG(*a), vnode_t * b) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_cmp(a, b); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_cmp(a, b); + AFS_GUNLOCK(); + return rv; } -int mp_afs_frlock(AFS_MP_VC_ARG(*a), int b, struct flock *c, int d, off_t e, +int +mp_afs_frlock(AFS_MP_VC_ARG(*a), int b, struct flock *c, int d, off_t e, #ifdef AFS_SGI65_ENV - vrwlock_t vrwlock, + vrwlock_t vrwlock, #endif - struct cred *f) + struct cred *f) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_frlock(a, b, c, d, e, + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_frlock(a, b, c, d, e, #ifdef AFS_SGI65_ENV - vrwlock, + vrwlock, #endif - f); - AFS_GUNLOCK(); - return rv; + f); + AFS_GUNLOCK(); + return rv; } -int mp_afs_realvp(AFS_MP_VC_ARG(*a), vnode_t **b) +int +mp_afs_realvp(AFS_MP_VC_ARG(*a), vnode_t ** b) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_realvp(a, b); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_realvp(a, b); + AFS_GUNLOCK(); + return rv; } -int mp_afs_bmap(AFS_MP_VC_ARG(*a), off_t b, ssize_t c, int d, struct cred *e, - struct bmapval *f, int *g) + +int +mp_afs_bmap(AFS_MP_VC_ARG(*a), off_t b, ssize_t c, int d, struct cred *e, + struct bmapval *f, int *g) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_bmap(a, b, c, d, e, f, g); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_bmap(a, b, c, d, e, f, g); + AFS_GUNLOCK(); + return rv; } -void mp_afs_strategy(AFS_MP_VC_ARG(*a), struct buf *b) +void +mp_afs_strategy(AFS_MP_VC_ARG(*a), struct buf *b) { - int rv; - AFS_GLOCK(); - afs_lockedvnodeops.vop_strategy(a, b); - AFS_GUNLOCK(); - return; + int rv; + AFS_GLOCK(); + afs_lockedvnodeops.vop_strategy(a, b); + AFS_GUNLOCK(); + return; } #ifdef AFS_SGI65_ENV -int mp_afs_map(AFS_MP_VC_ARG(*a), off_t b, size_t c, mprot_t d, - u_int e, struct cred *f, vnode_t **g) +int +mp_afs_map(AFS_MP_VC_ARG(*a), off_t b, size_t c, mprot_t d, u_int e, + struct cred *f, vnode_t ** g) #else -int mp_afs_map(AFS_MP_VC_ARG(*a), off_t b, struct pregion *c, char ** d, - size_t e, u_int f, u_int g, u_int h, struct cred *i) +int +mp_afs_map(AFS_MP_VC_ARG(*a), off_t b, struct pregion *c, char **d, size_t e, + u_int f, u_int g, u_int h, struct cred *i) #endif { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_map(a, b, c, d, e, f, g + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_map(a, b, c, d, e, f, g #ifndef AFS_SGI65_ENV - , h, i + , h, i #endif - ); - AFS_GUNLOCK(); - return rv; + ); + AFS_GUNLOCK(); + return rv; } #ifndef AFS_SGI65_ENV /* As of Irix 6.5, addmap and delmap are only for devices */ -int mp_afs_addmap(AFS_MP_VC_ARG(*a), off_t b, struct pregion *c, addr_t d, - size_t e, u_int f, u_int g, u_int h, struct cred *i) +int +mp_afs_addmap(AFS_MP_VC_ARG(*a), off_t b, struct pregion *c, addr_t d, + size_t e, u_int f, u_int g, u_int h, struct cred *i) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_addmap(a, b, c, d, e, f, g, h, i); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_addmap(a, b, c, d, e, f, g, h, i); + AFS_GUNLOCK(); + return rv; } -int mp_afs_delmap(AFS_MP_VC_ARG(*a), off_t b, struct pregion *c, addr_t d, - size_t e, u_int f, u_int g, u_int h, struct cred *i) +int +mp_afs_delmap(AFS_MP_VC_ARG(*a), off_t b, struct pregion *c, addr_t d, + size_t e, u_int f, u_int g, u_int h, struct cred *i) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_delmap(a, b, c, d, e, f, g, h, i); - AFS_GUNLOCK(); - return rv; + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_delmap(a, b, c, d, e, f, g, h, i); + AFS_GUNLOCK(); + return rv; } #endif /* ! AFS_SGI65_ENV */ -int mp_fs_poll(AFS_MP_VC_ARG(*a), short b, int c, short *d, - struct pollhead **e +int +mp_fs_poll(AFS_MP_VC_ARG(*a), short b, int c, short *d, struct pollhead **e #ifdef AFS_SGI65_ENV - , unsigned int *f + , unsigned int *f #endif - ) + ) { - int rv; - AFS_GLOCK(); - rv = afs_lockedvnodeops.vop_poll(a, b, c, d, e + int rv; + AFS_GLOCK(); + rv = afs_lockedvnodeops.vop_poll(a, b, c, d, e #ifdef AFS_SGI65_ENV - , f + , f #endif - ); - AFS_GUNLOCK(); - return rv; + ); + AFS_GUNLOCK(); + return rv; } struct vnodeops Afs_vnodeops = { #ifdef AFS_SGI64_ENV #ifdef AFS_SGI65_ENV - BHV_IDENTITY_INIT_POSITION(VNODE_POSITION_BASE), + BHV_IDENTITY_INIT_POSITION(VNODE_POSITION_BASE), #else - VNODE_POSITION_BASE, -#endif -#endif - mp_afs_open, - mp_afs_close, - mp_afs_read, - mp_afs_write, - mp_afs_ioctl, - mp_fs_setfl, - mp_afs_getattr, - mp_afs_setattr, - mp_afs_access, - mp_afs_lookup, - mp_afs_create, - mp_afs_remove, - mp_afs_link, - mp_afs_rename, - mp_afs_mkdir, - mp_afs_rmdir, - mp_afs_readdir, - mp_afs_symlink, - mp_afs_readlink, - mp_afs_fsync, - mp_afs_inactive, - mp_afs_fid, - mp_afs_fid2, - mp_afs_rwlock, - mp_afs_rwunlock, - mp_afs_seek, - mp_fs_cmp, - mp_afs_frlock, - fs_nosys, /* realvp */ - mp_afs_bmap, - mp_afs_strategy, - mp_afs_map, + VNODE_POSITION_BASE, +#endif +#endif + mp_afs_open, + mp_afs_close, + mp_afs_read, + mp_afs_write, + mp_afs_ioctl, + mp_fs_setfl, + mp_afs_getattr, + mp_afs_setattr, + mp_afs_access, + mp_afs_lookup, + mp_afs_create, + mp_afs_remove, + mp_afs_link, + mp_afs_rename, + mp_afs_mkdir, + mp_afs_rmdir, + mp_afs_readdir, + mp_afs_symlink, + mp_afs_readlink, + mp_afs_fsync, + mp_afs_inactive, + mp_afs_fid, + mp_afs_fid2, + mp_afs_rwlock, + mp_afs_rwunlock, + mp_afs_seek, + mp_fs_cmp, + mp_afs_frlock, + fs_nosys, /* realvp */ + mp_afs_bmap, + mp_afs_strategy, + mp_afs_map, #ifdef AFS_SGI65_ENV - fs_noerr, /* addmap - devices only */ - fs_noerr, /* delmap - devices only */ + fs_noerr, /* addmap - devices only */ + fs_noerr, /* delmap - devices only */ #else - mp_afs_addmap, - mp_afs_delmap, -#endif - mp_fs_poll, /* poll */ - fs_nosys, /* dump */ - fs_pathconf, - fs_nosys, /* allocstore */ - fs_nosys, /* fcntl */ - afs_reclaim, /* reclaim */ - fs_nosys, /* attr_get */ - fs_nosys, /* attr_set */ - fs_nosys, /* attr_remove */ - fs_nosys, /* attr_list */ + mp_afs_addmap, + mp_afs_delmap, +#endif + mp_fs_poll, /* poll */ + fs_nosys, /* dump */ + fs_pathconf, + fs_nosys, /* allocstore */ + fs_nosys, /* fcntl */ + afs_reclaim, /* reclaim */ + fs_nosys, /* attr_get */ + fs_nosys, /* attr_set */ + fs_nosys, /* attr_remove */ + fs_nosys, /* attr_list */ #ifdef AFS_SGI64_ENV #ifdef AFS_SGI65_ENV - fs_cover, - (vop_link_removed_t)fs_noval, - fs_vnode_change, - fs_tosspages, - fs_flushinval_pages, - fs_flush_pages, - fs_invalfree_pages, - fs_pages_sethole, - (vop_commit_t)fs_nosys, - (vop_readbuf_t)fs_nosys, - fs_strgetmsg, - fs_strputmsg, + fs_cover, + (vop_link_removed_t) fs_noval, + fs_vnode_change, + fs_tosspages, + fs_flushinval_pages, + fs_flush_pages, + fs_invalfree_pages, + fs_pages_sethole, + (vop_commit_t) fs_nosys, + (vop_readbuf_t) fs_nosys, + fs_strgetmsg, + fs_strputmsg, #else - fs_mount, + fs_mount, #endif #endif }; @@ -1823,15 +1893,16 @@ struct vnodeops *afs_ops = &Afs_vnodeops; int afs_CacheFSType = -1; vnodeops_t *afs_efs_vnodeopsp; vnodeops_t *afs_xfs_vnodeopsp; -vnode_t * (*afs_IGetVnode)(ino_t); +vnode_t *(*afs_IGetVnode) (ino_t); -extern vnode_t *afs_EFSIGetVnode(ino_t); /* defined in osi_file.c */ -extern vnode_t *afs_XFSIGetVnode(ino_t); /* defined in osi_file.c */ +extern vnode_t *afs_EFSIGetVnode(ino_t); /* defined in osi_file.c */ +extern vnode_t *afs_XFSIGetVnode(ino_t); /* defined in osi_file.c */ -extern afs_lock_t afs_xosi; /* lock is for tvattr */ +extern afs_lock_t afs_xosi; /* lock is for tvattr */ /* Initialize the cache operations. Called while initializing cache files. */ -void afs_InitDualFSCacheOps(struct vnode *vp) +void +afs_InitDualFSCacheOps(struct vnode *vp) { static int inited = 0; struct vfssw *swp; @@ -1845,8 +1916,8 @@ void afs_InitDualFSCacheOps(struct vnode *vp) #ifdef AFS_SGI_EFS_IOPS_ENV swp = vfs_getvfssw("efs"); if (swp) { - afs_efs_vnodeopsp = swp->vsw_vnodeops; - if(vp && vp->v_op == afs_efs_vnodeopsp) { + afs_efs_vnodeopsp = swp->vsw_vnodeops; + if (vp && vp->v_op == afs_efs_vnodeopsp) { afs_CacheFSType = AFS_SGI_EFS_CACHE; afs_IGetVnode = afs_EFSIGetVnode; found = 1; @@ -1858,7 +1929,7 @@ void afs_InitDualFSCacheOps(struct vnode *vp) if (swp) { afs_xfs_vnodeopsp = swp->vsw_vnodeops; if (!found) { - if (vp &&vp->v_op == afs_xfs_vnodeopsp) { + if (vp && vp->v_op == afs_xfs_vnodeopsp) { afs_CacheFSType = AFS_SGI_XFS_CACHE; afs_IGetVnode = afs_XFSIGetVnode; found = 1; @@ -1866,18 +1937,19 @@ void afs_InitDualFSCacheOps(struct vnode *vp) } } - if (vp && !found) + if (vp && !found) osi_Panic("osi_InitCacheFSType: Can't find fstype for vnode 0x%llx\n", vp); } -ino_t VnodeToIno(vnode_t *vp) +ino_t +VnodeToIno(vnode_t * vp) { int code; struct vattr vattr; - MObtainWriteLock(&afs_xosi,579); - vattr.va_mask = AT_FSID|AT_NODEID; /* quick return using this mask. */ + MObtainWriteLock(&afs_xosi, 579); + vattr.va_mask = AT_FSID | AT_NODEID; /* quick return using this mask. */ AFS_GUNLOCK(); AFS_VOP_GETATTR(vp, &vattr, 0, OSI_GET_CURRENT_CRED(), code); AFS_GLOCK(); @@ -1888,13 +1960,14 @@ ino_t VnodeToIno(vnode_t *vp) return vattr.va_nodeid; } -dev_t VnodeToDev(vnode_t *vp) +dev_t +VnodeToDev(vnode_t * vp) { int code; struct vattr vattr; - MObtainWriteLock(&afs_xosi,580); - vattr.va_mask = AT_FSID|AT_NODEID; /* quick return using this mask. */ + MObtainWriteLock(&afs_xosi, 580); + vattr.va_mask = AT_FSID | AT_NODEID; /* quick return using this mask. */ AFS_GUNLOCK(); AFS_VOP_GETATTR(vp, &vattr, 0, OSI_GET_CURRENT_CRED(), code); AFS_GLOCK(); @@ -1902,15 +1975,16 @@ dev_t VnodeToDev(vnode_t *vp) osi_Panic("VnodeToDev"); } MReleaseWriteLock(&afs_xosi); - return (dev_t)vattr.va_fsid; + return (dev_t) vattr.va_fsid; } -off_t VnodeToSize(vnode_t *vp) +off_t +VnodeToSize(vnode_t * vp) { int code; struct vattr vattr; - MObtainWriteLock(&afs_xosi,581); + MObtainWriteLock(&afs_xosi, 581); vattr.va_mask = AT_SIZE; AFS_GUNLOCK(); AFS_VOP_GETATTR(vp, &vattr, 0, OSI_GET_CURRENT_CRED(), code); diff --git a/src/afs/LINUX/.cvsignore b/src/afs/LINUX/.cvsignore new file mode 100644 index 000000000..a17ac6d4d --- /dev/null +++ b/src/afs/LINUX/.cvsignore @@ -0,0 +1 @@ +osi_vfs.h diff --git a/src/afs/LINUX/osi_alloc.c b/src/afs/LINUX/osi_alloc.c index 37dd1acb2..2a6440713 100644 --- a/src/afs/LINUX/osi_alloc.c +++ b/src/afs/LINUX/osi_alloc.c @@ -12,25 +12,26 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_alloc.c,v 1.1.1.12 2003/07/30 17:08:09 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/LINUX/osi_alloc.c,v 1.21 2004/04/12 16:04:32 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../h/mm.h" -#include "../h/slab.h" +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "h/mm.h" +#include "h/slab.h" -#include "../afs/afs_atomlist.h" -#include "../afs/afs_lhash.h" +#include "afs_atomlist.h" +#include "afs_lhash.h" -#define MAX_KMALLOC_SIZE PAGE_SIZE /* Max we should alloc with kmalloc */ -#define MAX_BUCKET_LEN 30 /* max. no. of entries per buckets we expect to see */ -#define STAT_INTERVAL 8192 /* we collect stats once every STAT_INTERVAL allocs*/ +#define MAX_KMALLOC_SIZE PAGE_SIZE /* Max we should alloc with kmalloc */ +#define MAX_BUCKET_LEN 30 /* max. no. of entries per buckets we expect to see */ +#define STAT_INTERVAL 8192 /* we collect stats once every STAT_INTERVAL allocs */ /* types of alloc */ -#define KM_TYPE 1 /* kmalloc */ -#define VM_TYPE 2 /* vmalloc */ +#define KM_TYPE 1 /* kmalloc */ +#define VM_TYPE 2 /* vmalloc */ struct osi_linux_mem { void *chunk; @@ -41,30 +42,31 @@ struct osi_linux_mem { #define MEMADDR(A) (void *)((unsigned long)(A) & (~0x3)) /* globals */ -afs_atomlist *al_mem_pool; /* pool of osi_linux_mem structures */ -afs_lhash *lh_mem_htab; /* mem hash table */ -unsigned int allocator_init = 0; /* has the allocator been initialized? */ +afs_atomlist *al_mem_pool; /* pool of osi_linux_mem structures */ +afs_lhash *lh_mem_htab; /* mem hash table */ +unsigned int allocator_init = 0; /* has the allocator been initialized? */ unsigned int afs_linux_cur_allocs = 0; unsigned int afs_linux_total_allocs = 0; -unsigned int afs_linux_hash_verify_count = 0; /* used by hash_verify */ -struct afs_lhash_stat afs_linux_lsb; /* hash table statistics */ -unsigned int afs_linux_hash_bucket_dist[MAX_BUCKET_LEN]; /* bucket population distribution in our hash table */ +unsigned int afs_linux_hash_verify_count = 0; /* used by hash_verify */ +struct afs_lhash_stat afs_linux_lsb; /* hash table statistics */ +unsigned int afs_linux_hash_bucket_dist[MAX_BUCKET_LEN]; /* bucket population distribution in our hash table */ #if defined(AFS_LINUX24_ENV) -#include "../h/vmalloc.h" +#include "h/vmalloc.h" #else /* externs : can we do this in a better way. Including vmalloc.h causes other * problems.*/ -extern void vfree(void * addr); +extern void vfree(void *addr); extern void *vmalloc(unsigned long size); #endif /* Allocator support functions (static) */ -static int hash_equal(const void *a, const void *b) +static int +hash_equal(const void *a, const void *b) { - return ( MEMADDR(((struct osi_linux_mem *)a)->chunk) == - MEMADDR(((struct osi_linux_mem *)b)->chunk) ); + return (MEMADDR(((struct osi_linux_mem *)a)->chunk) == + MEMADDR(((struct osi_linux_mem *)b)->chunk)); } @@ -76,30 +78,30 @@ static int hash_equal(const void *a, const void *b) * returns NULL if we failed to allocate memory. * or pointer to memory if we succeeded. */ -static void *linux_alloc(unsigned int asize, int drop_glock) +static void * +linux_alloc(unsigned int asize, int drop_glock) { void *new = NULL; int max_retry = 10; int haveGlock = ISAFS_GLOCK(); /* if we can use kmalloc use it to allocate the required memory. */ - while(!new && max_retry) - { - if (asize <= MAX_KMALLOC_SIZE) { - new = (void *)(unsigned long)kmalloc(asize, + while (!new && max_retry) { + if (asize <= MAX_KMALLOC_SIZE) { + new = (void *)(unsigned long)kmalloc(asize, #ifdef GFP_NOFS - GFP_NOFS + GFP_NOFS #else - GFP_KERNEL + GFP_KERNEL #endif - ); - if (new) /* piggy back alloc type */ - (unsigned long)new |= KM_TYPE; - } else { - new = (void *)vmalloc(asize); - if (new) /* piggy back alloc type */ - (unsigned long)new |= VM_TYPE; - } + ); + if (new) /* piggy back alloc type */ + (unsigned long)new |= KM_TYPE; + } else { + new = (void *)vmalloc(asize); + if (new) /* piggy back alloc type */ + (unsigned long)new |= VM_TYPE; + } if (!new) { #ifdef set_current_state @@ -107,16 +109,18 @@ static void *linux_alloc(unsigned int asize, int drop_glock) #else current->state = TASK_INTERRUPTIBLE; #endif - if (drop_glock && haveGlock) AFS_GUNLOCK(); + if (drop_glock && haveGlock) + AFS_GUNLOCK(); schedule_timeout(HZ); - if (drop_glock && haveGlock) AFS_GLOCK(); + if (drop_glock && haveGlock) + AFS_GLOCK(); #ifdef set_current_state - set_current_state(TASK_RUNNING); + set_current_state(TASK_RUNNING); #else - current->state = TASK_RUNNING; + current->state = TASK_RUNNING; #endif - --max_retry; - } + --max_retry; + } } if (new) memset(MEMADDR(new), 0, asize); @@ -124,23 +128,24 @@ static void *linux_alloc(unsigned int asize, int drop_glock) return new; } -static void linux_free(void *p) +static void +linux_free(void *p) { - + /* mask out the type information from the pointer and - * use the appropriate free routine to free the chunk. + * use the appropriate free routine to free the chunk. */ - switch(MEMTYPE(p)) { - case KM_TYPE: - kfree(MEMADDR(p)); - break; - case VM_TYPE: - vfree(MEMADDR(p)); - break; - default: - printf("afs_osi_Free: Asked to free unknown type %d at 0x%x\n", - MEMTYPE(p), MEMADDR(p)); - break; + switch (MEMTYPE(p)) { + case KM_TYPE: + kfree(MEMADDR(p)); + break; + case VM_TYPE: + vfree(MEMADDR(p)); + break; + default: + printf("afs_osi_Free: Asked to free unknown type %d at 0x%x\n", + MEMTYPE(p), MEMADDR(p)); + break; } } @@ -152,12 +157,13 @@ static void linux_free(void *p) */ #define HASH_CONST 32786 #define HASH_PRIME 79367 -static unsigned hash_chunk(void *p) +static unsigned +hash_chunk(void *p) { unsigned int key; key = (unsigned int)(long)p >> 2; - key = (key * HASH_CONST)%HASH_PRIME; + key = (key * HASH_CONST) % HASH_PRIME; return key; } @@ -188,25 +194,18 @@ hash_verify(size_t index, unsigned key, void *data) int memtype; memtype = MEMTYPE(lmp->chunk); -#if defined(AFS_SPARC64_LINUX24_ENV) || defined(AFS_I386_UMLINUX20_ENV) - if ((memtype == KM_TYPE) && (!VALID_PAGE(virt_to_page(lmp->chunk)))) { - printf("osi_linux_verify_alloced_memory: address 0x%x outside range, index=%d, key=%d\n", lmp->chunk, index, key); - } -#else - if ((memtype == KM_TYPE) && (AFS_LINUX_MAP_NR(lmp->chunk) > max_mapnr)) { - printf("osi_linux_verify_alloced_memory: address 0x%x outside range, index=%d, key=%d\n", lmp->chunk, index, key); - } -#endif - if (memtype != KM_TYPE && memtype != VM_TYPE) { - printf("osi_linux_verify_alloced_memory: unknown type %d at 0x%x, index=%d\n", memtype, lmp->chunk, index); + printf + ("osi_linux_verify_alloced_memory: unknown type %d at 0x%x, index=%d\n", + memtype, lmp->chunk, index); } afs_linux_hash_verify_count++; } /* local_free() : wrapper for vfree(), to deal with incompatible protoypes */ -static void local_free(void *p, size_t n) +static void +local_free(void *p, size_t n) { vfree(p); } @@ -218,57 +217,62 @@ static void local_free(void *p, size_t n) * 0 - failure * 1 - success */ -static int linux_alloc_init() +static int +linux_alloc_init() { /* initiate our pool of osi_linux_mem structs */ - al_mem_pool = afs_atomlist_create(sizeof(struct osi_linux_mem), - sizeof(long)*1024, (void *)vmalloc, - local_free); + al_mem_pool = + afs_atomlist_create(sizeof(struct osi_linux_mem), sizeof(long) * 1024, + (void *)vmalloc, local_free); if (!al_mem_pool) { - printf("afs_osi_Alloc: Error in initialization(atomlist_create)\n"); - return 0; + printf("afs_osi_Alloc: Error in initialization(atomlist_create)\n"); + return 0; } /* initialize the hash table to hold references to alloc'ed chunks */ lh_mem_htab = afs_lhash_create(hash_equal, (void *)vmalloc, local_free); if (!lh_mem_htab) { - printf("afs_osi_Alloc: Error in initialization(lhash_create)\n"); - return 0; + printf("afs_osi_Alloc: Error in initialization(lhash_create)\n"); + return 0; } - + return 1; - + } /* hash_bucket_stat() : Counts the no. of elements in each bucket and * stores results in our bucket stats vector. */ static unsigned int cur_bucket, cur_bucket_len; -static void hash_bucket_stat(size_t index, unsigned key, void *data) +static void +hash_bucket_stat(size_t index, unsigned key, void *data) { - if (index == cur_bucket) { + if (index == cur_bucket) { /* while still on the same bucket, inc len & return */ cur_bucket_len++; return; - } - else { /* if we're on the next bucket, store the distribution */ + } else { /* if we're on the next bucket, store the distribution */ if (cur_bucket_len < MAX_BUCKET_LEN) afs_linux_hash_bucket_dist[cur_bucket_len]++; else - printf("afs_get_hash_stats: Warning! exceeded max bucket len %d\n", cur_bucket_len); + printf + ("afs_get_hash_stats: Warning! exceeded max bucket len %d\n", + cur_bucket_len); cur_bucket = index; cur_bucket_len = 1; } } + /* get_hash_stats() : get hash table statistics */ -static void get_hash_stats() +static void +get_hash_stats() { int i; afs_lhash_stat(lh_mem_htab, &afs_linux_lsb); /* clear out the bucket stat vector */ - for(i=0;ichunk); /* this contains the piggybacked type info*/ - afs_atomlist_put(al_mem_pool, lmp); /* return osi_linux_mem struct to pool*/ - afs_linux_cur_allocs--; - } - else { - printf("osi_linux_free: failed to remove chunk from hashtable\n"); + if ((lmp = + (struct osi_linux_mem *)afs_lhash_remove(lh_mem_htab, + hash_chunk(addr), &lmem))) { + linux_free(lmp->chunk); /* this contains the piggybacked type info */ + afs_atomlist_put(al_mem_pool, lmp); /* return osi_linux_mem struct to pool */ + afs_linux_cur_allocs--; + } else { + printf("osi_linux_free: failed to remove chunk from hashtable\n"); } up(&afs_linux_alloc_sem); @@ -364,7 +371,8 @@ void osi_linux_free(void *addr) /* osi_linux_free_afs_memory() - free all chunks of memory allocated. */ -void osi_linux_free_afs_memory(void) +void +osi_linux_free_afs_memory(void) { down(&afs_linux_alloc_sem); @@ -379,20 +387,21 @@ void osi_linux_free_afs_memory(void) /* free the hashlist. */ afs_lhash_destroy(lh_mem_htab); - + /* change the state so that the allocator is now uninitialized. */ allocator_init = 0; } - up(&afs_linux_alloc_sem); + up(&afs_linux_alloc_sem); } /* osi_linux_verify_alloced_memory(): verify all chunks of alloced memory in * our hash table. */ -void osi_linux_verify_alloced_memory() +void +osi_linux_verify_alloced_memory() { down(&afs_linux_alloc_sem); - + /* count of times hash_verify was called. reset it to 0 before iteration */ afs_linux_hash_verify_count = 0; @@ -401,10 +410,11 @@ void osi_linux_verify_alloced_memory() if (afs_linux_hash_verify_count != afs_linux_cur_allocs) { /* hmm, some pieces of memory are missing. */ - printf("osi_linux_verify_alloced_memory: %d chunks of memory are not accounted for during verify!\n", afs_linux_hash_verify_count - afs_linux_cur_allocs); + printf + ("osi_linux_verify_alloced_memory: %d chunks of memory are not accounted for during verify!\n", + afs_linux_hash_verify_count - afs_linux_cur_allocs); } up(&afs_linux_alloc_sem); return; } - diff --git a/src/afs/LINUX/osi_cred.c b/src/afs/LINUX/osi_cred.c index ffa5e4874..a4c499fc9 100644 --- a/src/afs/LINUX/osi_cred.c +++ b/src/afs/LINUX/osi_cred.c @@ -12,15 +12,16 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_cred.c,v 1.1.1.6 2001/07/14 22:19:45 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/LINUX/osi_cred.c,v 1.10 2004/04/21 02:20:23 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" +#include "afs/sysincludes.h" +#include "afsincludes.h" /* Setup a pool for creds. Allocate several at a time. */ -#define CRED_ALLOC_STEP 29 /* at 140 bytes/cred = 4060 bytes. */ +#define CRED_ALLOC_STEP 29 /* at 140 bytes/cred = 4060 bytes. */ static cred_t *cred_pool = NULL; @@ -39,7 +40,8 @@ static struct semaphore linux_cred_pool_lock = MUTEX; #define CRED_LOCK() down(&linux_cred_pool_lock) #define CRED_UNLOCK() up(&linux_cred_pool_lock) -cred_t *crget(void) +cred_t * +crget(void) { cred_t *tmp; int i; @@ -47,27 +49,34 @@ cred_t *crget(void) CRED_LOCK(); if (!cred_pool) { cred_allocs++; - cred_pool = (cred_t*)osi_Alloc(CRED_ALLOC_STEP * sizeof(cred_t)); + cred_pool = (cred_t *) osi_Alloc(CRED_ALLOC_STEP * sizeof(cred_t)); if (!cred_pool) osi_Panic("crget: No more memory for creds!\n"); - - for (i=0; i < CRED_ALLOC_STEP-1; i++) - cred_pool[i].cr_ref = (long)&cred_pool[i+1]; + + for (i = 0; i < CRED_ALLOC_STEP - 1; i++) + cred_pool[i].cr_ref = (long)&cred_pool[i + 1]; cred_pool[i].cr_ref = 0; } tmp = cred_pool; - cred_pool = (cred_t*)tmp->cr_ref; + cred_pool = (cred_t *) tmp->cr_ref; ncreds_inuse++; CRED_UNLOCK(); memset(tmp, 0, sizeof(cred_t)); +#if defined(AFS_LINUX26_ENV) + tmp->cr_group_info = groups_alloc(0); +#endif tmp->cr_ref = 1; return tmp; } -void crfree(cred_t *cr) +void +crfree(cred_t * cr) { if (cr->cr_ref > 1) { +#if defined(AFS_LINUX26_ENV) + put_group_info(cr->cr_group_info); +#endif cr->cr_ref--; return; } @@ -76,39 +85,83 @@ void crfree(cred_t *cr) cr->cr_ref = (long)cred_pool; cred_pool = cr; CRED_UNLOCK(); - ncreds_inuse --; + ncreds_inuse--; } /* Return a duplicate of the cred. */ -cred_t *crdup(cred_t *cr) +cred_t * +crdup(cred_t * cr) { cred_t *tmp = crget(); - *tmp = *cr; + + tmp->cr_uid = cr->cr_uid; + tmp->cr_ruid = cr->cr_ruid; + tmp->cr_gid = cr->cr_gid; +#if defined(AFS_LINUX26_ENV) +{ + struct group_info *old_info; + + old_info = tmp->cr_group_info; + get_group_info(cr->cr_group_info); + tmp->cr_group_info = cr->cr_group_info; + put_group_info(old_info); +} +#else + memcpy(tmp->cr_groups, cr->cr_groups, NGROUPS * sizeof(gid_t)); + tmp->cr_ngroups = cr->cr_ngroups; +#endif + tmp->cr_ref = 1; return tmp; } -cred_t *crref(void) +cred_t * +crref(void) { cred_t *cr = crget(); + cr->cr_uid = current->fsuid; cr->cr_ruid = current->uid; cr->cr_gid = current->fsgid; cr->cr_rgid = current->gid; +#if defined(AFS_LINUX26_ENV) +{ + struct group_info *old_info; + + old_info = cr->cr_group_info; + get_group_info(current->group_info); + cr->cr_group_info = current->group_info; + put_group_info(old_info); +} +#else memcpy(cr->cr_groups, current->groups, NGROUPS * sizeof(gid_t)); cr->cr_ngroups = current->ngroups; +#endif return cr; } /* Set the cred info into the current task */ -void crset(cred_t *cr) +void +crset(cred_t * cr) { current->fsuid = cr->cr_uid; current->uid = cr->cr_ruid; current->fsgid = cr->cr_gid; current->gid = cr->cr_rgid; +#if defined(AFS_LINUX26_ENV) +{ + struct group_info *old_info; + + /* using set_current_groups() will sort the groups */ + old_info = current->group_info; + get_group_info(cr->cr_group_info); + current->group_info = cr->cr_group_info; + put_group_info(old_info); +} +#else memcpy(current->groups, cr->cr_groups, NGROUPS * sizeof(gid_t)); current->ngroups = cr->cr_ngroups; +#endif } diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c index 4d454db05..0191e78a7 100644 --- a/src/afs/LINUX/osi_file.c +++ b/src/afs/LINUX/osi_file.c @@ -8,24 +8,26 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_file.c,v 1.1.1.10 2003/07/30 17:08:09 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/LINUX/osi_file.c,v 1.19 2004/04/12 16:04:32 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ -#include "../h/smp_lock.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ +#include "h/smp_lock.h" +#include "h/module.h" -int afs_osicred_initialized=0; -struct AFS_UCRED afs_osi_cred; +int afs_osicred_initialized = 0; +struct AFS_UCRED afs_osi_cred; afs_lock_t afs_xosi; /* lock is for tvattr */ extern struct osi_dev cacheDev; extern struct super_block *afs_cacheSBp; -void *osi_UFSOpen(ainode) - afs_int32 ainode; +void * +osi_UFSOpen(afs_int32 ainode) { struct inode *ip; register struct osi_file *afile = NULL; @@ -35,7 +37,7 @@ void *osi_UFSOpen(ainode) struct inode *tip = NULL; struct file *filp = NULL; AFS_STATCNT(osi_UFSOpen); - if(cacheDiskType != AFS_FCACHE_TYPE_UFS) { + if (cacheDiskType != AFS_FCACHE_TYPE_UFS) { osi_Panic("UFSOpen called for non-UFS cache\n"); } if (!afs_osicred_initialized) { @@ -44,21 +46,24 @@ void *osi_UFSOpen(ainode) crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */ afs_osicred_initialized = 1; } - afile = (struct osi_file *) osi_AllocSmallSpace(sizeof(struct osi_file)); + afile = (struct osi_file *)osi_AllocLargeSpace(sizeof(struct osi_file)); AFS_GUNLOCK(); if (!afile) { osi_Panic("osi_UFSOpen: Failed to allocate %d bytes for osi_file.\n", - sizeof(struct osi_file)); + sizeof(struct osi_file)); } memset(afile, 0, sizeof(struct osi_file)); filp = &afile->file; filp->f_dentry = &afile->dentry; - tip = iget(afs_cacheSBp, (u_long)ainode); + tip = iget(afs_cacheSBp, (u_long) ainode); if (!tip) osi_Panic("Can't get inode %d\n", ainode); FILE_INODE(filp) = tip; - tip->i_flags |= MS_NOATIME; /* Disable updating access times. */ + tip->i_flags |= MS_NOATIME; /* Disable updating access times. */ filp->f_flags = O_RDWR; +#if defined(AFS_LINUX26_ENV) + filp->f_mapping = tip->i_mapping; +#endif #if defined(AFS_LINUX24_ENV) filp->f_op = fops_get(tip->i_fop); #else @@ -71,46 +76,51 @@ void *osi_UFSOpen(ainode) afile->size = tip->i_size; AFS_GLOCK(); afile->offset = 0; - afile->proc = (int (*)()) 0; - afile->inum = ainode; /* for hint validity checking */ + afile->proc = (int (*)())0; + afile->inum = ainode; /* for hint validity checking */ return (void *)afile; } -afs_osi_Stat(afile, astat) - register struct osi_file *afile; - register struct osi_stat *astat; { +int +afs_osi_Stat(register struct osi_file *afile, register struct osi_stat *astat) +{ register afs_int32 code; AFS_STATCNT(osi_Stat); - MObtainWriteLock(&afs_xosi,320); + MObtainWriteLock(&afs_xosi, 320); astat->size = FILE_INODE(&afile->file)->i_size; astat->blksize = FILE_INODE(&afile->file)->i_blksize; +#if defined(AFS_LINUX26_ENV) + astat->mtime = FILE_INODE(&afile->file)->i_mtime.tv_sec; + astat->atime = FILE_INODE(&afile->file)->i_atime.tv_sec; +#else astat->mtime = FILE_INODE(&afile->file)->i_mtime; astat->atime = FILE_INODE(&afile->file)->i_atime; +#endif code = 0; MReleaseWriteLock(&afs_xosi); return code; } -osi_UFSClose(afile) - register struct osi_file *afile; - { - AFS_STATCNT(osi_Close); - if (afile) { - if (FILE_INODE(&afile->file)) { - struct file *filp = &afile->file; - if (filp->f_op && filp->f_op->release) - filp->f_op->release(FILE_INODE(filp), filp); - iput(FILE_INODE(filp)); - } - } - - osi_FreeSmallSpace(afile); - return 0; - } +int +osi_UFSClose(register struct osi_file *afile) +{ + AFS_STATCNT(osi_Close); + if (afile) { + if (FILE_INODE(&afile->file)) { + struct file *filp = &afile->file; + if (filp->f_op && filp->f_op->release) + filp->f_op->release(FILE_INODE(filp), filp); + iput(FILE_INODE(filp)); + } + } + + osi_FreeLargeSpace(afile); + return 0; +} -osi_UFSTruncate(afile, asize) - register struct osi_file *afile; - afs_int32 asize; { +int +osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize) +{ struct AFS_UCRED *oldCred; register afs_int32 code; struct osi_stat tstat; @@ -123,8 +133,9 @@ osi_UFSTruncate(afile, asize) * small enough. Check now and save some time. */ code = afs_osi_Stat(afile, &tstat); - if (code || tstat.size <= asize) return code; - MObtainWriteLock(&afs_xosi,321); + if (code || tstat.size <= asize) + return code; + MObtainWriteLock(&afs_xosi, 321); AFS_GUNLOCK(); #ifdef STRUCT_INODE_HAS_I_ALLOC_SEM down_write(&inode->i_alloc_sem); @@ -169,74 +180,74 @@ osi_UFSTruncate(afile, asize) /* Generic read interface */ -afs_osi_Read(afile, offset, aptr, asize) - register struct osi_file *afile; - int offset; - char *aptr; - afs_int32 asize; { +int +afs_osi_Read(register struct osi_file *afile, int offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; size_t resid; register afs_int32 code; - register afs_int32 cnt1=0; + register afs_int32 cnt1 = 0; AFS_STATCNT(osi_Read); /** * If the osi_file passed in is NULL, panic only if AFS is not shutting * down. No point in crashing when we are already shutting down */ - if ( !afile ) { - if ( !afs_shuttingdown ) + if (!afile) { + if (!afs_shuttingdown) osi_Panic("osi_Read called with null param"); else return EIO; } - if (offset != -1) afile->offset = offset; + if (offset != -1) + afile->offset = offset; AFS_GUNLOCK(); code = osi_rdwr(UIO_READ, afile, (caddr_t) aptr, asize, &resid); AFS_GLOCK(); if (code == 0) { code = asize - resid; afile->offset += code; - } - else { + } else { afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid, - ICL_TYPE_INT32, code); + ICL_TYPE_INT32, code); code = -1; } return code; } /* Generic write interface */ -afs_osi_Write(afile, offset, aptr, asize) - register struct osi_file *afile; - char *aptr; - afs_int32 offset; - afs_int32 asize; { +int +afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; size_t resid; register afs_int32 code; AFS_STATCNT(osi_Write); - if ( !afile ) { - if ( !afs_shuttingdown ) + if (!afile) { + if (!afs_shuttingdown) osi_Panic("afs_osi_Write called with null param"); else return EIO; - } - if (offset != -1) afile->offset = offset; + } + if (offset != -1) + afile->offset = offset; AFS_GUNLOCK(); - code = osi_rdwr(UIO_WRITE, afile, (caddr_t)aptr, asize, &resid); + code = osi_rdwr(UIO_WRITE, afile, (caddr_t) aptr, asize, &resid); AFS_GLOCK(); if (code == 0) { code = asize - resid; afile->offset += code; - } - else { - if (code == ENOSPC) afs_warnuser("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n"); + } else { + if (code == ENOSPC) + afs_warnuser + ("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n"); code = -1; } if (afile->proc) { - (*afile->proc)(afile, code); + (*afile->proc) (afile, code); } return code; } @@ -245,9 +256,8 @@ afs_osi_Write(afile, offset, aptr, asize) /* This work should be handled by physstrat in ca/machdep.c. This routine written from the RT NFS port strategy routine. It has been generalized a bit, but should still be pretty clear. */ -int afs_osi_MapStrategy(aproc, bp) - int (*aproc)(); - register struct buf *bp; +int +afs_osi_MapStrategy(int (*aproc) (struct buf * bp), register struct buf *bp) { afs_int32 returnCode; @@ -258,13 +268,12 @@ int afs_osi_MapStrategy(aproc, bp) } void -shutdown_osifile() +shutdown_osifile(void) { - extern int afs_cold_shutdown; + extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); - if (afs_cold_shutdown) { - afs_osicred_initialized = 0; - } + AFS_STATCNT(shutdown_osifile); + if (afs_cold_shutdown) { + afs_osicred_initialized = 0; + } } - diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index 3f2c11f38..52f1e6036 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -14,38 +14,111 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_groups.c,v 1.1.1.12 2003/07/30 17:08:10 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/LINUX/osi_groups.c,v 1.22 2004/04/21 02:20:23 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/afs_stats.h" /* statistics */ #ifdef AFS_LINUX22_ENV -#include "../h/smp_lock.h" +#include "h/smp_lock.h" #endif -static int afs_getgroups(cred_t *cr, gid_t *groups); -static int afs_setgroups(cred_t **cr, int ngroups, gid_t *gidset, int change_parent); +#if defined(AFS_LINUX26_ENV) +static int +afs_setgroups(cred_t **cr, struct group_info *group_info, int change_parent) +{ + struct group_info *old_info; + + AFS_STATCNT(afs_setgroups); + + old_info = (*cr)->cr_group_info; + get_group_info(group_info); + (*cr)->cr_group_info = group_info; + put_group_info(old_info); + + crset(*cr); + + if (change_parent) { + old_info = current->parent->group_info; + get_group_info(group_info); + current->parent->group_info = group_info; + put_group_info(old_info); + } + + return (0); +} +#else +static int +afs_setgroups(cred_t **cr, int ngroups, gid_t * gidset, int change_parent) +{ + int ngrps; + int i; + gid_t *gp; + + AFS_STATCNT(afs_setgroups); + + if (ngroups > NGROUPS) + return EINVAL; + + gp = (*cr)->cr_groups; + if (ngroups < NGROUPS) + gp[ngroups] = (gid_t) NOGROUP; + + for (i = ngroups; i > 0; i--) { + *gp++ = *gidset++; + } + + (*cr)->cr_ngroups = ngroups; + crset(*cr); + return (0); +} +#endif + +#if defined(AFS_LINUX26_ENV) +static struct group_info * +afs_getgroups(cred_t * cr) +{ + AFS_STATCNT(afs_getgroups); + + get_group_info(cr->cr_group_info); + return cr->cr_group_info; +} +#else +/* Returns number of groups. And we trust groups to be large enough to + * hold all the groups. + */ +static int +afs_getgroups(cred_t *cr, gid_t *groups) +{ + int i; + AFS_STATCNT(afs_getgroups); + gid_t *gp = cr->cr_groups; + int n = cr->cr_ngroups; + + for (i = 0; (i < n) && (*gp != (gid_t) NOGROUP); i++) + *groups++ = *gp++; + return i; +} +#endif + +#if !defined(AFS_LINUX26_ENV) /* Only propogate the PAG to the parent process. Unix's propogate to * all processes sharing the cred. */ -int set_pag_in_parent(int pag, int g0, int g1) +int +set_pag_in_parent(int pag, int g0, int g1) { + int i; #ifdef STRUCT_TASK_STRUCT_HAS_PARENT gid_t *gp = current->parent->groups; + int ngroups = current->parent->ngroups; #else gid_t *gp = current->p_pptr->groups; -#endif - int ngroups; - int i; - - -#ifdef STRUCT_TASK_STRUCT_HAS_PARENT - ngroups = current->parent->ngroups; -#else - ngroups = current->p_pptr->ngroups; + int ngroups = current->p_pptr->ngroups; #endif if ((ngroups < 2) || (afs_get_pag_from_groups(gp[0], gp[1]) == NOPAG)) { @@ -53,9 +126,9 @@ int set_pag_in_parent(int pag, int g0, int g1) if (ngroups + 2 > NGROUPS) { return EINVAL; } - for (i = ngroups-1; i >= 0; i--) { - gp[i+2] = gp[i]; - } + for (i = ngroups - 1; i >= 0; i--) { + gp[i + 2] = gp[i]; + } ngroups += 2; } gp[0] = g0; @@ -70,30 +143,66 @@ int set_pag_in_parent(int pag, int g0, int g1) #endif return 0; } +#endif -int setpag(cred_t **cr, afs_uint32 pagvalue, afs_uint32 *newpag, int change_parent) +int +setpag(cred_t ** cr, afs_uint32 pagvalue, afs_uint32 * newpag, + int change_parent) { +#if defined(AFS_LINUX26_ENV) + struct group_info *group_info; + gid_t g0, g1; + + AFS_STATCNT(setpag); + + group_info = afs_getgroups(*cr); + g0 = GROUP_AT(group_info, 0); + g1 = GROUP_AT(group_info, 1); + + if (afs_get_pag_from_groups(g0, g1) == NOPAG) { + /* We will have to make sure group_info is big enough for pag */ + struct group_info *tmp; + int i; + + tmp = groups_alloc(group_info->ngroups + 2); + for (i = 0; i < group_info->ngroups; ++i) + GROUP_AT(tmp, i + 2) = GROUP_AT(group_info, i); + put_group_info(group_info); + group_info = tmp; + } + + *newpag = (pagvalue == -1 ? genpag() : pagvalue); + afs_get_groups_from_pag(*newpag, &g0, &g1); + GROUP_AT(group_info, 0) = g0; + GROUP_AT(group_info, 1) = g1; + + afs_setgroups(cr, group_info, change_parent); + + put_group_info(group_info); + + return 0; +#else gid_t *gidset; afs_int32 ngroups, code = 0; int j; AFS_STATCNT(setpag); - gidset = (gid_t *) osi_Alloc(NGROUPS*sizeof(gidset[0])); + gidset = (gid_t *) osi_Alloc(NGROUPS * sizeof(gidset[0])); ngroups = afs_getgroups(*cr, gidset); if (afs_get_pag_from_groups(gidset[0], gidset[1]) == NOPAG) { /* We will have to shift grouplist to make room for pag */ if (ngroups + 2 > NGROUPS) { - osi_Free((char *)gidset, NGROUPS*sizeof(int)); + osi_Free((char *)gidset, NGROUPS * sizeof(int)); return EINVAL; } for (j = ngroups - 1; j >= 0; j--) { - gidset[j+2] = gidset[j]; - } + gidset[j + 2] = gidset[j]; + } ngroups += 2; } - *newpag = (pagvalue == -1 ? genpag(): pagvalue); + *newpag = (pagvalue == -1 ? genpag() : pagvalue); afs_get_groups_from_pag(*newpag, &gidset[0], &gidset[1]); code = afs_setgroups(cr, ngroups, gidset, change_parent); @@ -104,14 +213,16 @@ int setpag(cred_t **cr, afs_uint32 pagvalue, afs_uint32 *newpag, int change_pare code = set_pag_in_parent(*newpag, gidset[0], gidset[1]); } - osi_Free((char *)gidset, NGROUPS*sizeof(int)); + osi_Free((char *)gidset, NGROUPS * sizeof(int)); return code; +#endif } /* Intercept the standard system call. */ -extern long (*sys_setgroupsp)(int gidsetsize, gid_t *grouplist); -asmlinkage long afs_xsetgroups(int gidsetsize, gid_t *grouplist) +extern long (*sys_setgroupsp) (int gidsetsize, gid_t * grouplist); +asmlinkage long +afs_xsetgroups(int gidsetsize, gid_t * grouplist) { long code; cred_t *cr = crref(); @@ -123,7 +234,7 @@ asmlinkage long afs_xsetgroups(int gidsetsize, gid_t *grouplist) crfree(cr); unlock_kernel(); - code = (*sys_setgroupsp)(gidsetsize, grouplist); + code = (*sys_setgroupsp) (gidsetsize, grouplist); if (code) { return code; } @@ -138,25 +249,26 @@ asmlinkage long afs_xsetgroups(int gidsetsize, gid_t *grouplist) unlock_kernel(); /* Linux syscall ABI returns errno as negative */ - return (- code); + return (-code); } #if defined(AFS_LINUX24_ENV) /* Intercept the standard uid32 system call. */ -extern long (*sys_setgroups32p)(int gidsetsize, gid_t *grouplist); -asmlinkage long afs_xsetgroups32(int gidsetsize, gid_t *grouplist) +extern long (*sys_setgroups32p) (int gidsetsize, gid_t * grouplist); +asmlinkage long +afs_xsetgroups32(int gidsetsize, gid_t * grouplist) { long code; cred_t *cr = crref(); afs_uint32 junk; int old_pag; - + lock_kernel(); old_pag = PagInCred(cr); crfree(cr); unlock_kernel(); - code = (*sys_setgroups32p)(gidsetsize, grouplist); + code = (*sys_setgroups32p) (gidsetsize, grouplist); if (code) { return code; @@ -172,30 +284,30 @@ asmlinkage long afs_xsetgroups32(int gidsetsize, gid_t *grouplist) unlock_kernel(); /* Linux syscall ABI returns errno as negative */ - return (- code); + return (-code); } #endif -#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_AMD64_LINUX20_ENV) +#if defined(AFS_PPC64_LINUX20_ENV) /* Intercept the uid16 system call as used by 32bit programs. */ -extern long (*sys32_setgroupsp)(int gidsetsize, old_gid_t *grouplist); -asmlinkage long afs32_xsetgroups(int gidsetsize, old_gid_t *grouplist) +extern long (*sys32_setgroupsp)(int gidsetsize, gid_t *grouplist); +asmlinkage long afs32_xsetgroups(int gidsetsize, gid_t *grouplist) { long code; cred_t *cr = crref(); afs_uint32 junk; int old_pag; - + lock_kernel(); old_pag = PagInCred(cr); crfree(cr); unlock_kernel(); - + code = (*sys32_setgroupsp)(gidsetsize, grouplist); if (code) { return code; } - + lock_kernel(); cr = crref(); if (old_pag != NOPAG && PagInCred(cr) == NOPAG) { @@ -204,14 +316,51 @@ asmlinkage long afs32_xsetgroups(int gidsetsize, old_gid_t *grouplist) } crfree(cr); unlock_kernel(); + + /* Linux syscall ABI returns errno as negative */ + return (-code); +} +#endif +#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_AMD64_LINUX20_ENV) +/* Intercept the uid16 system call as used by 32bit programs. */ +extern long (*sys32_setgroupsp) (int gidsetsize, u16 * grouplist); +asmlinkage long +afs32_xsetgroups(int gidsetsize, u16 * grouplist) +{ + long code; + cred_t *cr = crref(); + afs_uint32 junk; + int old_pag; + + lock_kernel(); + old_pag = PagInCred(cr); + crfree(cr); + unlock_kernel(); + + code = (*sys32_setgroupsp) (gidsetsize, grouplist); + if (code) { + return code; + } + + lock_kernel(); + cr = crref(); + if (old_pag != NOPAG && PagInCred(cr) == NOPAG) { + /* re-install old pag if there's room. */ + code = setpag(&cr, old_pag, &junk, 0); + } + crfree(cr); + unlock_kernel(); + /* Linux syscall ABI returns errno as negative */ - return (- code); + return (-code); } + #ifdef AFS_LINUX24_ENV /* Intercept the uid32 system call as used by 32bit programs. */ -extern long (*sys32_setgroups32p)(int gidsetsize, gid_t *grouplist); -asmlinkage long afs32_xsetgroups32(int gidsetsize, gid_t *grouplist) +extern long (*sys32_setgroups32p) (int gidsetsize, gid_t * grouplist); +asmlinkage long +afs32_xsetgroups32(int gidsetsize, gid_t * grouplist) { long code; cred_t *cr = crref(); @@ -223,7 +372,7 @@ asmlinkage long afs32_xsetgroups32(int gidsetsize, gid_t *grouplist) crfree(cr); unlock_kernel(); - code = (*sys32_setgroups32p)(gidsetsize, grouplist); + code = (*sys32_setgroups32p) (gidsetsize, grouplist); if (code) { return code; } @@ -238,48 +387,8 @@ asmlinkage long afs32_xsetgroups32(int gidsetsize, gid_t *grouplist) unlock_kernel(); /* Linux syscall ABI returns errno as negative */ - return (- code); + return (-code); } #endif #endif -static int afs_setgroups(cred_t **cr, int ngroups, gid_t *gidset, int change_parent) -{ - int ngrps; - int i; - gid_t *gp; - - AFS_STATCNT(afs_setgroups); - - if (ngroups > NGROUPS) - return EINVAL; - - gp = (*cr)->cr_groups; - if (ngroups < NGROUPS) - gp[ngroups] = (gid_t)NOGROUP; - - for (i = ngroups; i > 0; i--) { - *gp++ = *gidset++; - } - - (*cr)->cr_ngroups = ngroups; - crset(*cr); - return (0); -} - -/* Returns number of groups. And we trust groups to be large enough to - * hold all the groups. - */ -static int afs_getgroups(cred_t *cr, gid_t *groups) -{ - int i; - gid_t *gp = cr->cr_groups; - int n = cr->cr_ngroups; - AFS_STATCNT(afs_getgroups); - - for (i = 0; (i < n) && (*gp != (gid_t)NOGROUP); i++) { - *groups++ = *gp++; - } - return i; -} - diff --git a/src/afs/LINUX/osi_inode.c b/src/afs/LINUX/osi_inode.c index f55d6551f..131ad1222 100644 --- a/src/afs/LINUX/osi_inode.c +++ b/src/afs/LINUX/osi_inode.c @@ -18,39 +18,30 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_inode.c,v 1.1.1.4 2001/07/14 22:19:46 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/LINUX/osi_inode.c,v 1.7 2004/04/05 22:39:53 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/osi_inode.h" -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/osi_inode.h" +#include "afs/afs_stats.h" /* statistics stuff */ -#define BAD_IGET -1000 - -/* - * SGI dependent system calls - */ -#ifndef INODESPECIAL -/* - * `INODESPECIAL' type inodes are ones that describe volumes. - */ -#define INODESPECIAL 0xffffffff /* ... from ../vol/viceinode.h */ -#endif - - -int afs_syscall_icreate(void) +int +afs_syscall_icreate(void) { return 0; } -int afs_syscall_iopen(void) +int +afs_syscall_iopen(void) { return 0; } -int afs_syscall_iincdec(void) +int +afs_syscall_iincdec(void) { return 0; } diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h index c402a2388..038a19040 100644 --- a/src/afs/LINUX/osi_machdep.h +++ b/src/afs/LINUX/osi_machdep.h @@ -47,23 +47,33 @@ #define SIG_UNLOCK(X) spin_unlock_irq(&X->sig->siglock) #endif + #define afs_hz HZ +#include "h/sched.h" #define osi_Time() (xtime.tv_sec) -#if (CPU == sparc64) -#define osi_GetTime(V) do { (*(V)).tv_sec = xtime.tv_sec; (*(V)).tv_usec = xtime.tv_usec; } while (0) -#else -#define osi_GetTime(V) (*(V)=xtime) -#endif +#define osi_GetTime(V) do_gettimeofday((V)) #undef gop_lookupname #define gop_lookupname osi_lookupname -#define osi_vnhold(v, n) VN_HOLD(v) +#define osi_vnhold(v, n) do { VN_HOLD(AFSTOV(v)); } while (0) + +#if defined(AFS_LINUX24_ENV) +#define VN_HOLD(V) atomic_inc(&((vnode_t *) V)->i_count) +#else +#define VN_HOLD(V) ((vnode_t *) V)->i_count++ +#endif + +#if defined(AFS_LINUX26_ENV) +#define VN_RELE(V) iput((struct inode *) V) +#else +#define VN_RELE(V) osi_iput((struct inode *) V) +#endif #define osi_AllocSmall afs_osi_Alloc #define osi_FreeSmall afs_osi_Free -#define afs_suser suser +#define afs_suser(x) capable(CAP_SYS_ADMIN) #define wakeup afs_osi_Wakeup #undef vType @@ -73,16 +83,12 @@ * Use the same type of test as other OS's for compatibility. */ #undef IsAfsVnode -extern struct vnodeops afs_dir_iops, afs_symlink_iops; -#define IsAfsVnode(vc) (((vc)->v_op == afs_ops) ? 1 : \ - ((vc)->v_op == &afs_dir_iops) ? 1 : \ - ((vc)->v_op == &afs_symlink_iops)) - -#if 0 -/* bcopy is in stds.h, just so fcrypt.c can pick it up. */ -#define bzero(D,C) memset((D), 0, (C)) -#define bcmp(A,B,C) memcmp((A), (B), (C)) -#endif +extern struct vnodeops afs_file_iops, afs_dir_iops, afs_symlink_iops; +#define IsAfsVnode(v) (((v)->v_op == &afs_file_iops) ? 1 : \ + ((v)->v_op == &afs_dir_iops) ? 1 : \ + ((v)->v_op == &afs_symlink_iops)) +#undef SetAfsVnode +#define SetAfsVnode(v) /* We often need to pretend we're in user space to get memory transfers * right for the kernel calls we use. @@ -111,6 +117,9 @@ extern struct vnodeops afs_dir_iops, afs_symlink_iops; #define PAGESIZE PAGE_SIZE +#ifndef NGROUPS +#define NGROUPS NGROUPS_SMALL +#endif /* cred struct */ typedef struct cred { /* maps to task field: */ @@ -119,12 +128,16 @@ typedef struct cred { /* maps to task field: */ #else int cr_ref; #endif - uid_t cr_uid; /* euid */ - uid_t cr_ruid; /* uid */ - gid_t cr_gid; /* egid */ - gid_t cr_rgid; /* gid */ + uid_t cr_uid; /* euid */ + uid_t cr_ruid; /* uid */ + gid_t cr_gid; /* egid */ + gid_t cr_rgid; /* gid */ +#if defined(AFS_LINUX26_ENV) + struct group_info *cr_group_info; +#else gid_t cr_groups[NGROUPS]; /* 32 groups - empty set to NOGROUP */ int cr_ngroups; +#endif } cred_t; #define AFS_UCRED cred #define AFS_PROC struct task_struct @@ -134,12 +147,12 @@ typedef struct cred { /* maps to task field: */ typedef enum { AFS_UIOSYS, AFS_UIOUSER } uio_seg_t; typedef enum { UIO_READ, UIO_WRITE } uio_flag_t; typedef struct uio { - struct iovec *uio_iov; - int uio_iovcnt; - int uio_offset; - uio_seg_t uio_seg; - int uio_resid; - uio_flag_t uio_flag; + struct iovec *uio_iov; + int uio_iovcnt; + afs_offs_t uio_offset; + uio_seg_t uio_seg; + int uio_resid; + uio_flag_t uio_flag; } uio_t; #define afsio_iov uio_iov #define afsio_iovcnt uio_iovcnt @@ -159,9 +172,7 @@ typedef struct uio { */ extern unsigned long afs_linux_page_offset; -/* some more functions to help with the page offset stuff */ -#define AFS_LINUX_MAP_NR(addr) ((((unsigned long)addr) - afs_linux_page_offset) >> PAGE_SHIFT) - +/* function to help with the page offset stuff */ #define afs_linux_page_address(page) (afs_linux_page_offset + PAGE_SIZE * (page - mem_map)) #if defined(__KERNEL__) && defined(CONFIG_SMP) @@ -185,7 +196,7 @@ do { \ #define AFS_GUNLOCK() \ do { \ if (!ISAFS_GLOCK()) \ - osi_Panic("afs global lock not held"); \ + osi_Panic("afs global lock not held at %s:%d", __FILE__, __LINE__); \ afs_global_owner = 0; \ up(&afs_global_lock); \ } while (0) diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c index 0cfc87d49..9a6d1a2c5 100644 --- a/src/afs/LINUX/osi_misc.c +++ b/src/afs/LINUX/osi_misc.c @@ -12,35 +12,43 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_misc.c,v 1.1.1.16 2003/07/30 17:08:10 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/LINUX/osi_misc.c,v 1.33 2004/05/08 03:58:27 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/afs_stats.h" +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/afs_stats.h" #if defined(AFS_LINUX24_ENV) -#include "../h/smp_lock.h" +#include "h/smp_lock.h" +#endif +#if defined(AFS_LINUX26_ENV) +#include "h/namei.h" #endif - -char *crash_addr = 0; /* Induce an oops by writing here. */ #if defined(AFS_LINUX24_ENV) /* Lookup name and return vnode for same. */ -int osi_lookupname_internal(char *aname, uio_seg_t seg, int followlink, - vnode_t **dirvpp, struct dentry **dpp, - struct nameidata *nd) +int +osi_lookupname(char *aname, uio_seg_t seg, int followlink, + vnode_t ** dirvpp, struct dentry **dpp) { int code; + extern struct nameidata afs_cacheNd; + struct nameidata *nd = &afs_cacheNd; code = ENOENT; if (seg == AFS_UIOUSER) { - code = followlink ? - user_path_walk(aname, nd) : user_path_walk_link(aname, nd); - } - else { + code = + followlink ? user_path_walk(aname, + nd) : user_path_walk_link(aname, nd); + } else { +#if defined(AFS_LINUX26_ENV) + code = path_lookup(aname, followlink ? LOOKUP_FOLLOW : 0, nd); +#else if (path_init(aname, followlink ? LOOKUP_FOLLOW : 0, nd)) code = path_walk(aname, nd); +#endif } if (!code) { @@ -54,28 +62,18 @@ int osi_lookupname_internal(char *aname, uio_seg_t seg, int followlink, } return code; } -#endif - -int osi_lookupname(char *aname, uio_seg_t seg, int followlink, - vnode_t **dirvpp, struct dentry **dpp) -{ -#if defined(AFS_LINUX24_ENV) - struct nameidata nd; - int code = osi_lookupname_internal(aname, seg, followlink, dirvpp, dpp, - &nd); - if (!code) - path_release(&nd); - - return (code); #else +int +osi_lookupname(char *aname, uio_seg_t seg, int followlink, vnode_t ** dirvpp, + struct dentry **dpp) +{ struct dentry *dp = NULL; int code; - + code = ENOENT; if (seg == AFS_UIOUSER) { dp = followlink ? namei(aname) : lnamei(aname); - } - else { + } else { dp = lookup_dentry(aname, NULL, followlink ? 1 : 0); } @@ -83,17 +81,17 @@ int osi_lookupname(char *aname, uio_seg_t seg, int followlink, if (dp->d_inode) { *dpp = dp; code = 0; - } - else + } else dput(dp); } - + return code; -#endif } +#endif /* Intialize cache device info and fragment size for disk cache partition. */ -int osi_InitCacheInfo(char *aname) +int +osi_InitCacheInfo(char *aname) { int code; struct dentry *dp; @@ -101,14 +99,12 @@ int osi_InitCacheInfo(char *aname) extern struct osi_dev cacheDev; extern afs_int32 afs_fsfragsize; extern struct super_block *afs_cacheSBp; - extern struct nameidata afs_cacheNd; - - code = osi_lookupname_internal(aname, AFS_UIOSYS, 1, NULL, &dp, - &afs_cacheNd); - if (code) return ENOENT; + code = osi_lookupname(aname, AFS_UIOSYS, 1, NULL, &dp); + if (code) + return ENOENT; cacheInode = dp->d_inode->i_ino; - cacheDev.dev = dp->d_inode->i_dev; + cacheDev.dev = dp->d_inode->i_sb->s_dev; afs_fsfragsize = dp->d_inode->i_sb->s_blocksize - 1; afs_cacheSBp = dp->d_inode->i_sb; @@ -125,8 +121,9 @@ int osi_InitCacheInfo(char *aname) * Seek, then read or write to an open inode. addrp points to data in * kernel space. */ -int osi_rdwr(int rw, struct osi_file *file, caddr_t addrp, size_t asize, - size_t *resid) +int +osi_rdwr(int rw, struct osi_file *file, caddr_t addrp, size_t asize, + size_t * resid) { int code = 0; KERNEL_SPACE_DECL; @@ -136,10 +133,9 @@ int osi_rdwr(int rw, struct osi_file *file, caddr_t addrp, size_t asize, /* Seek to the desired position. Return -1 on error. */ if (filp->f_op->llseek) { - if (filp->f_op->llseek(filp, (loff_t)offset, 0) != offset) + if (filp->f_op->llseek(filp, (loff_t) offset, 0) != offset) return -1; - } - else + } else filp->f_pos = offset; savelim = current->rlim[RLIMIT_FSIZE].rlim_cur; @@ -151,24 +147,24 @@ int osi_rdwr(int rw, struct osi_file *file, caddr_t addrp, size_t asize, code = FOP_READ(filp, addrp, asize); else if (rw == UIO_WRITE) code = FOP_WRITE(filp, addrp, asize); - else /* all is well? */ + else /* all is well? */ code = asize; TO_KERNEL_SPACE(); current->rlim[RLIMIT_FSIZE].rlim_cur = savelim; - if (code >=0) { + if (code >= 0) { *resid = asize - code; return 0; - } - else + } else return -1; } /* This variant is called from AFS read/write routines and takes a uio * struct and, if successful, returns 0. */ -int osi_file_uio_rdwr(struct osi_file *osifile, uio_t *uiop, int rw) +int +osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw) { struct file *filp = &osifile->file; struct inode *ip = FILE_INODE(&osifile->file); @@ -202,8 +198,16 @@ int osi_file_uio_rdwr(struct osi_file *osifile, uio_t *uiop, int rw) if (code < 0) { code = -code; break; + } else if (code == 0) { + /* + * This is bad -- we can't read any more data from the + * file, but we have no good way of signaling a partial + * read either. + */ + code = EIO; + break; } - + iov->iov_base += code; iov->iov_len -= code; uiop->uio_resid -= code; @@ -222,9 +226,9 @@ int osi_file_uio_rdwr(struct osi_file *osifile, uio_t *uiop, int rw) /* setup_uio * Setup a uio struct. */ -void setup_uio(uio_t *uiop, struct iovec *iovecp, char *buf, - int pos, int count, uio_flag_t flag, - uio_seg_t seg) +void +setup_uio(uio_t * uiop, struct iovec *iovecp, char *buf, afs_offs_t pos, + int count, uio_flag_t flag, uio_seg_t seg) { iovecp->iov_base = buf; iovecp->iov_len = count; @@ -241,7 +245,8 @@ void setup_uio(uio_t *uiop, struct iovec *iovecp, char *buf, * UIO_READ : dp -> uio * UIO_WRITE : uio -> dp */ -int uiomove(char *dp, int length, uio_flag_t rw, uio_t *uiop) +int +uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop) { int count, n; struct iovec *iov; @@ -259,25 +264,29 @@ int uiomove(char *dp, int length, uio_flag_t rw, uio_t *uiop) if (count > length) count = length; - - switch(uiop->uio_seg) { + + switch (uiop->uio_seg) { case AFS_UIOSYS: - switch(rw) { + switch (rw) { case UIO_READ: - memcpy(iov->iov_base, dp, count); break; + memcpy(iov->iov_base, dp, count); + break; case UIO_WRITE: - memcpy(dp, iov->iov_base, count); break; + memcpy(dp, iov->iov_base, count); + break; default: printf("uiomove: Bad rw = %d\n", rw); return -EINVAL; } break; case AFS_UIOUSER: - switch(rw) { + switch (rw) { case UIO_READ: - AFS_COPYOUT(dp, iov->iov_base, count, code); break; + AFS_COPYOUT(dp, iov->iov_base, count, code); + break; case UIO_WRITE: - AFS_COPYIN(iov->iov_base, dp, count, code); break; + AFS_COPYIN(iov->iov_base, dp, count, code); + break; default: printf("uiomove: Bad rw = %d\n", rw); return -EINVAL; @@ -298,22 +307,34 @@ int uiomove(char *dp, int length, uio_flag_t rw, uio_t *uiop) return 0; } -void afs_osi_SetTime(osi_timeval_t *tvp) +void +afs_osi_SetTime(osi_timeval_t * tvp) { - extern int (*sys_settimeofdayp)(struct timeval *tv, struct timezone *tz); -#ifdef AFS_LINUX_64BIT_KERNEL +#if defined(AFS_LINUX24_ENV) + +#if defined(AFS_LINUX26_ENV) + struct timespec tv; + tv.tv_sec = tvp->tv_sec; + tv.tv_nsec = tvp->tv_usec * NSEC_PER_USEC; +#else struct timeval tv; - AFS_STATCNT(osi_SetTime); tv.tv_sec = tvp->tv_sec; tv.tv_usec = tvp->tv_usec; - (void) (*sys_settimeofdayp)(&tv, NULL); +#endif + + AFS_STATCNT(osi_SetTime); + + do_settimeofday(&tv); #else + extern int (*sys_settimeofdayp) (struct timeval * tv, + struct timezone * tz); + KERNEL_SPACE_DECL; AFS_STATCNT(osi_SetTime); TO_USER_SPACE(); - (void) (*sys_settimeofdayp)(tvp, NULL); + (void)(*sys_settimeofdayp) (tvp, NULL); TO_KERNEL_SPACE(); #endif } @@ -321,15 +342,16 @@ void afs_osi_SetTime(osi_timeval_t *tvp) /* Free all the pages on any of the vnodes in the vlru. Must be done before * freeing all memory. */ -void osi_linux_free_inode_pages(void) +void +osi_linux_free_inode_pages(void) { int i; struct vcache *tvc; struct inode *ip; extern struct vcache *afs_vhashT[VCSIZE]; - for (i=0; ihnext) { + for (i = 0; i < VCSIZE; i++) { + for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { ip = AFSTOI(tvc); #if defined(AFS_LINUX24_ENV) if (ip->i_data.nrpages) { @@ -337,9 +359,9 @@ void osi_linux_free_inode_pages(void) if (ip->i_nrpages) { #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) - truncate_inode_pages(&ip->i_data, 0); + truncate_inode_pages(&ip->i_data, 0); #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15) - truncate_inode_pages(ip, 0); + truncate_inode_pages(ip, 0); #else invalidate_inode_pages(ip); #endif @@ -356,7 +378,8 @@ void osi_linux_free_inode_pages(void) } } -void osi_clear_inode(struct inode *ip) +void +osi_clear_inode(struct inode *ip) { cred_t *credp = crref(); struct vcache *vcp = ITOAFS(ip); @@ -366,55 +389,57 @@ void osi_clear_inode(struct inode *ip) #else if (ip->i_count > 1) #endif - printf("afs_put_inode: ino %d (0x%x) has count %d\n", ip->i_ino, ip); + printf("afs_put_inode: ino %d (0x%x) has count %d\n", ip->i_ino, ip, + ip->i_count); afs_InactiveVCache(vcp, credp); ObtainWriteLock(&vcp->lock, 504); -#if defined(AFS_LINUX24_ENV) - atomic_set(&ip->i_count, 0); -#else - ip->i_count = 0; -#endif - ip->i_nlink = 0; /* iput checks this after calling this routine. */ + ip->i_nlink = 0; /* iput checks this after calling this routine. */ + ip->i_state = I_CLEAR; ReleaseWriteLock(&vcp->lock); crfree(credp); } +#if !defined(AFS_LINUX26_ENV) /* iput an inode. Since we still have a separate inode pool, we don't want * to call iput on AFS inodes, since they would then end up on Linux's * inode_unsed list. */ -void osi_iput(struct inode *ip) +void +osi_iput(struct inode *ip) { extern struct vfs *afs_globalVFS; AFS_GLOCK(); + + if (afs_globalVFS && ip->i_sb != afs_globalVFS) + osi_Panic("IPUT Not an afs inode\n"); + #if defined(AFS_LINUX24_ENV) - if (atomic_read(&ip->i_count) == 0 || atomic_read(&ip->i_count) & 0xffff0000) { + if (atomic_read(&ip->i_count) == 0) #else - if (ip->i_count == 0 || ip->i_count & 0xffff0000) { + if (ip->i_count == 0) #endif osi_Panic("IPUT Bad refCount %d on inode 0x%x\n", #if defined(AFS_LINUX24_ENV) - atomic_read(&ip->i_count), ip); + atomic_read(&ip->i_count), #else - ip->i_count, ip); + ip->i_count, #endif - } - if (afs_globalVFS && afs_globalVFS == ip->i_sb ) { + ip); + #if defined(AFS_LINUX24_ENV) - atomic_dec(&ip->i_count); - if (!atomic_read(&ip->i_count)) + if (atomic_dec_and_test(&ip->i_count)) #else - ip->i_count --; - if (!ip->i_count) + if (!--ip->i_count) #endif - osi_clear_inode(ip); + { + osi_clear_inode(ip); + ip->i_state = 0; } - else - iput(ip); AFS_GUNLOCK(); } +#endif /* check_bad_parent() : Checks if this dentry's vcache is a root vcache * that has its mvid (parent dir's fid) pointer set to the wrong directory @@ -432,42 +457,46 @@ void osi_iput(struct inode *ip) * to the correct parent and mountpoint fids. */ -void check_bad_parent(struct dentry *dp) +void +check_bad_parent(struct dentry *dp) { - cred_t *credp; - struct vcache *vcp = ITOAFS(dp->d_inode), *avc = NULL; - struct vcache *pvc = ITOAFS(dp->d_parent->d_inode); - - if (vcp->mvid->Fid.Volume != pvc->fid.Fid.Volume) { /* bad parent */ - credp = crref(); - - - /* force a lookup, so vcp->mvid is fixed up */ - afs_lookup(pvc, dp->d_name.name, &avc, credp); - if (!avc || vcp != avc) { /* bad, very bad.. */ - afs_Trace4(afs_iclSetp, CM_TRACE_TMP_1S3L, ICL_TYPE_STRING, - "afs_linux_revalidate : bad pointer returned from afs_lookup origvc newvc dentry", - ICL_TYPE_POINTER, vcp, - ICL_TYPE_POINTER, avc, - ICL_TYPE_POINTER, dp); + cred_t *credp; + struct vcache *vcp = ITOAFS(dp->d_inode), *avc = NULL; + struct vcache *pvc = ITOAFS(dp->d_parent->d_inode); + + if (vcp->mvid->Fid.Volume != pvc->fid.Fid.Volume) { /* bad parent */ + credp = crref(); + + + /* force a lookup, so vcp->mvid is fixed up */ + afs_lookup(pvc, dp->d_name.name, &avc, credp); + if (!avc || vcp != avc) { /* bad, very bad.. */ + afs_Trace4(afs_iclSetp, CM_TRACE_TMP_1S3L, ICL_TYPE_STRING, + "check_bad_parent: bad pointer returned from afs_lookup origvc newvc dentry", + ICL_TYPE_POINTER, vcp, ICL_TYPE_POINTER, avc, + ICL_TYPE_POINTER, dp); + } + if (avc) + AFS_RELE(avc); + crfree(credp); } - if (avc) - AFS_RELE(avc); - crfree(credp); - } /* if bad parent */ - - return; + /* if bad parent */ + return; } struct task_struct *rxk_ListenerTask; -void osi_linux_mask() { +void +osi_linux_mask(void) +{ SIG_LOCK(current); sigfillset(¤t->blocked); RECALC_SIGPENDING(current); SIG_UNLOCK(current); } -void osi_linux_rxkreg() { +void +osi_linux_rxkreg(void) +{ rxk_ListenerTask = current; } diff --git a/src/afs/LINUX/osi_module.c b/src/afs/LINUX/osi_module.c index d697b6045..4eafd9d40 100644 --- a/src/afs/LINUX/osi_module.c +++ b/src/afs/LINUX/osi_module.c @@ -12,20 +12,22 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_module.c,v 1.1.1.14 2003/07/30 17:08:10 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/LINUX/osi_module.c,v 1.48 2004/05/11 20:36:13 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../h/unistd.h" /* For syscall numbers. */ -#include "../h/mm.h" +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "h/unistd.h" /* For syscall numbers. */ +#include "h/mm.h" #ifdef AFS_AMD64_LINUX20_ENV #include "../asm/ia32_unistd.h" #endif #include +#include #include #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) #include @@ -35,31 +37,37 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_module.c,v 1.1.1.14 2003/ #include #endif +#if defined(AFS_LINUX26_ENV) +#include +#include + +MODULE_INFO(vermagic, VERMAGIC_STRING); -#ifdef AFS_SPARC64_LINUX24_ENV -#define __NR_setgroups32 82 /* This number is not exported for some bizarre reason. */ #endif -asmlinkage int (*sys_settimeofdayp)(struct timeval *tv, struct timezone *tz); -#if !defined(AFS_ALPHA_LINUX20_ENV) -asmlinkage int (*sys_socketcallp)(int call, long *args); -#endif /* no socketcall on alpha */ -asmlinkage long (*sys_setgroupsp)(int gidsetsize, gid_t *grouplist); +#ifdef AFS_SPARC64_LINUX24_ENV +#define __NR_setgroups32 82 /* This number is not exported for some bizarre reason. */ +#endif +#if !defined(AFS_LINUX24_ENV) +asmlinkage int (*sys_settimeofdayp) (struct timeval * tv, + struct timezone * tz); +#endif +asmlinkage long (*sys_setgroupsp) (int gidsetsize, gid_t * grouplist); #ifdef EXPORTED_SYS_CALL_TABLE #ifdef AFS_SPARC64_LINUX20_ENV -extern unsigned int sys_call_table[]; /* changed to uint because SPARC64 has syscaltable of 32bit items */ +extern unsigned int sys_call_table[]; /* changed to uint because SPARC64 has syscaltable of 32bit items */ #else -extern void * sys_call_table[]; /* safer for other linuces */ +extern void *sys_call_table[]; /* safer for other linuces */ #endif #else /* EXPORTED_SYS_CALL_TABLE */ #ifdef AFS_SPARC64_LINUX20_ENV -static unsigned int *sys_call_table; /* changed to uint because SPARC64 has syscaltable of 32bit items */ +static unsigned int *sys_call_table; /* changed to uint because SPARC64 has syscaltable of 32bit items */ #else -static void ** sys_call_table; /* safer for other linuces */ +static void **sys_call_table; /* safer for other linuces */ #endif #endif -extern struct file_system_type afs_file_system; +extern struct file_system_type afs_fs_type; static long get_page_offset(void); @@ -69,7 +77,9 @@ DECLARE_MUTEX(afs_global_lock); struct semaphore afs_global_lock = MUTEX; #endif int afs_global_owner = 0; -unsigned long afs_linux_page_offset = 0; /* contains the PAGE_OFFSET value */ +#if !defined(AFS_LINUX24_ENV) +unsigned long afs_linux_page_offset = 0; /* contains the PAGE_OFFSET value */ +#endif /* Since sys_ni_syscall is not exported, I need to cache it in order to restore * it. @@ -77,28 +87,34 @@ unsigned long afs_linux_page_offset = 0; /* contains the PAGE_OFFSET value */ #ifdef AFS_SPARC64_LINUX20_ENV static unsigned int afs_ni_syscall = 0; #else -static void* afs_ni_syscall = 0; +static void *afs_ni_syscall = 0; #endif - + #ifdef AFS_AMD64_LINUX20_ENV #ifdef EXPORTED_IA32_SYS_CALL_TABLE -extern void * ia32_sys_call_table[]; +extern void *ia32_sys_call_table[]; #else static void **ia32_sys_call_table; #endif static void *ia32_ni_syscall = 0; -asmlinkage long (*sys32_setgroupsp)(int gidsetsize, old_gid_t *grouplist); +asmlinkage long (*sys32_setgroupsp) (int gidsetsize, u16 * grouplist); #if defined(__NR_ia32_setgroups32) -asmlinkage long (*sys32_setgroups32p)(int gidsetsize, gid_t *grouplist); +asmlinkage long (*sys32_setgroups32p) (int gidsetsize, gid_t * grouplist); #endif /* __NR_ia32_setgroups32 */ #endif /* AFS_AMD64_LINUX20_ENV */ +#ifdef AFS_PPC64_LINUX20_ENV +asmlinkage long (*sys32_setgroupsp)(int gidsetsize, gid_t *grouplist); +#endif /* AFS_AMD64_LINUX20_ENV */ + #ifdef AFS_SPARC64_LINUX20_ENV static unsigned int afs_ni_syscall32 = 0; -asmlinkage int (*sys32_setgroupsp)(int gidsetsize, __kernel_gid_t32 *grouplist); +asmlinkage int (*sys32_setgroupsp) (int gidsetsize, + __kernel_gid_t32 * grouplist); #if defined(__NR_setgroups32) -asmlinkage int (*sys32_setgroups32p)(int gidsetsize, __kernel_gid_t32 *grouplist); +asmlinkage int (*sys32_setgroups32p) (int gidsetsize, + __kernel_gid_t32 * grouplist); #endif /* __NR_setgroups32 */ #ifdef EXPORTED_SYS_CALL_TABLE extern unsigned int sys_call_table32[]; @@ -106,94 +122,95 @@ extern unsigned int sys_call_table32[]; static unsigned int *sys_call_table32; #endif /* EXPORTED_SYS_CALL_TABLE */ -asmlinkage int afs_syscall32(long syscall, long parm1, long parm2, long parm3, - long parm4, long parm5) +asmlinkage int +afs_syscall32(long syscall, long parm1, long parm2, long parm3, long parm4, + long parm5) { -__asm__ __volatile__ ("srl %o4, 0, %o4\n\t" - "mov %o7, %i7\n\t" - "call afs_syscall\n\t" - "srl %o5, 0, %o5\n\t" - "ret\n\t" - "nop"); + __asm__ __volatile__("srl %o4, 0, %o4\n\t" "mov %o7, %i7\n\t" + "call afs_syscall\n\t" "srl %o5, 0, %o5\n\t" + "ret\n\t" "nop"); } #endif /* AFS_SPARC64_LINUX20_ENV */ +static int afs_ioctl(struct inode *, struct file *, unsigned int, + unsigned long); + +static struct file_operations afs_syscall_fops = { + .ioctl = afs_ioctl, +}; + +static struct proc_dir_entry *openafs_procfs; + +static int +afsproc_init() +{ + struct proc_dir_entry *entry1; + + openafs_procfs = proc_mkdir(PROC_FSDIRNAME, proc_root_fs); + entry1 = create_proc_entry(PROC_SYSCALL_NAME, 0, openafs_procfs); + + entry1->proc_fops = &afs_syscall_fops; + + entry1->owner = THIS_MODULE; + + return 0; +} + +static void +afsproc_exit() +{ + remove_proc_entry(PROC_SYSCALL_NAME, openafs_procfs); + remove_proc_entry(PROC_FSDIRNAME, proc_root_fs); +} + +static int +afs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg) +{ + + struct afsprocdata sysargs; + + if (cmd != VIOC_SYSCALL) return -EINVAL; + + if (copy_from_user(&sysargs, (void *)arg, sizeof(struct afsprocdata))) + return -EFAULT; + + return afs_syscall(sysargs.syscall, sysargs.param1, + sysargs.param2, sysargs.param3, sysargs.param4); +} + #ifdef AFS_IA64_LINUX20_ENV asmlinkage long afs_syscall_stub(int r0, int r1, long r2, long r3, long r4, long gp) { -__asm__ __volatile__ ("alloc r42 = ar.pfs, 8, 3, 6, 0\n\t" - "mov r41 = b0\n\t" /* save rp */ - "mov out0 = in0\n\t" - "mov out1 = in1\n\t" - "mov out2 = in2\n\t" - "mov out3 = in3\n\t" - "mov out4 = in4\n\t" - "mov out5 = gp\n\t" /* save gp */ - ";;\n" - ".L1: mov r3 = ip\n\t" - ";;\n\t" - "addl r15=.fptr_afs_syscall-.L1,r3\n\t" - ";;\n\t" - "ld8 r15=[r15]\n\t" - ";;\n\t" - "ld8 r16=[r15],8\n\t" - ";;\n\t" - "ld8 gp=[r15]\n\t" - "mov b6=r16\n\t" - "br.call.sptk.many b0 = b6\n\t" - ";;\n\t" - "mov ar.pfs = r42\n\t" - "mov b0 = r41\n\t" - "mov gp = r48\n\t" /* restore gp */ - "br.ret.sptk.many b0\n" - ".fptr_afs_syscall:\n\t" - "data8 @fptr(afs_syscall)"); + __asm__ __volatile__("alloc r42 = ar.pfs, 8, 3, 6, 0\n\t" "mov r41 = b0\n\t" /* save rp */ + "mov out0 = in0\n\t" "mov out1 = in1\n\t" "mov out2 = in2\n\t" "mov out3 = in3\n\t" "mov out4 = in4\n\t" "mov out5 = gp\n\t" /* save gp */ + ";;\n" ".L1: mov r3 = ip\n\t" ";;\n\t" "addl r15=.fptr_afs_syscall-.L1,r3\n\t" ";;\n\t" "ld8 r15=[r15]\n\t" ";;\n\t" "ld8 r16=[r15],8\n\t" ";;\n\t" "ld8 gp=[r15]\n\t" "mov b6=r16\n\t" "br.call.sptk.many b0 = b6\n\t" ";;\n\t" "mov ar.pfs = r42\n\t" "mov b0 = r41\n\t" "mov gp = r48\n\t" /* restore gp */ + "br.ret.sptk.many b0\n" ".fptr_afs_syscall:\n\t" + "data8 @fptr(afs_syscall)"); } asmlinkage long afs_xsetgroups_stub(int r0, int r1, long r2, long r3, long r4, long gp) { -__asm__ __volatile__ ("alloc r42 = ar.pfs, 8, 3, 6, 0\n\t" - "mov r41 = b0\n\t" /* save rp */ - "mov out0 = in0\n\t" - "mov out1 = in1\n\t" - "mov out2 = in2\n\t" - "mov out3 = in3\n\t" - "mov out4 = in4\n\t" - "mov out5 = gp\n\t" /* save gp */ - ";;\n" - ".L2: mov r3 = ip\n\t" - ";;\n\t" - "addl r15=.fptr_afs_xsetgroups - .L2,r3\n\t" - ";;\n\t" - "ld8 r15=[r15]\n\t" - ";;\n\t" - "ld8 r16=[r15],8\n\t" - ";;\n\t" - "ld8 gp=[r15]\n\t" - "mov b6=r16\n\t" - "br.call.sptk.many b0 = b6\n\t" - ";;\n\t" - "mov ar.pfs = r42\n\t" - "mov b0 = r41\n\t" - "mov gp = r48\n\t" /* restore gp */ - "br.ret.sptk.many b0\n" - ".fptr_afs_xsetgroups:\n\t" - "data8 @fptr(afs_xsetgroups)"); + __asm__ __volatile__("alloc r42 = ar.pfs, 8, 3, 6, 0\n\t" "mov r41 = b0\n\t" /* save rp */ + "mov out0 = in0\n\t" "mov out1 = in1\n\t" "mov out2 = in2\n\t" "mov out3 = in3\n\t" "mov out4 = in4\n\t" "mov out5 = gp\n\t" /* save gp */ + ";;\n" ".L2: mov r3 = ip\n\t" ";;\n\t" "addl r15=.fptr_afs_xsetgroups - .L2,r3\n\t" ";;\n\t" "ld8 r15=[r15]\n\t" ";;\n\t" "ld8 r16=[r15],8\n\t" ";;\n\t" "ld8 gp=[r15]\n\t" "mov b6=r16\n\t" "br.call.sptk.many b0 = b6\n\t" ";;\n\t" "mov ar.pfs = r42\n\t" "mov b0 = r41\n\t" "mov gp = r48\n\t" /* restore gp */ + "br.ret.sptk.many b0\n" ".fptr_afs_xsetgroups:\n\t" + "data8 @fptr(afs_xsetgroups)"); } -struct fptr -{ - void *ip; - unsigned long gp; +struct fptr { + void *ip; + unsigned long gp; }; #endif /* AFS_IA64_LINUX20_ENV */ #ifdef AFS_LINUX24_ENV -asmlinkage int (*sys_setgroups32p)(int gidsetsize, __kernel_gid32_t *grouplist); +asmlinkage int (*sys_setgroups32p) (int gidsetsize, + __kernel_gid32_t * grouplist); #endif /* AFS_LINUX24_ENV */ #ifdef AFS_SPARC64_LINUX20_ENV @@ -204,275 +221,277 @@ asmlinkage int (*sys_setgroups32p)(int gidsetsize, __kernel_gid32_t *grouplist); #define SYSCALL2POINTER (void *) #endif +#ifdef AFS_PPC64_LINUX20_ENV +extern void *set_afs_syscall(void*); +extern void *set_afs_xsetgroups_syscall(void*); +extern void *set_afs_xsetgroups_syscall32(void*); +#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) -int __init afs_init(void) +int __init +afs_init(void) #else -int init_module(void) +int +init_module(void) #endif { #if defined(AFS_IA64_LINUX20_ENV) - unsigned long kernel_gp; - static struct fptr sys_settimeofday, sys_setgroups; -#endif + unsigned long kernel_gp = 0; + static struct fptr sys_setgroups; +#endif /* defined(AFS_IA64_LINUX20_ENV) */ extern int afs_syscall(); extern long afs_xsetgroups(); #if defined(__NR_setgroups32) extern int afs_xsetgroups32(); #endif /* __NR_setgroups32 */ -#if defined(AFS_SPARC64_LINUX20_ENV) || defined (AFS_AMD64_LINUX20_ENV) +#if defined(AFS_SPARC64_LINUX20_ENV) || defined (AFS_AMD64_LINUX20_ENV) || defined(AFS_PPC64_LINUX20_ENV) extern int afs32_xsetgroups(); #if (defined(__NR_setgroups32) && defined(AFS_SPARC64_LINUX20_ENV)) extern int afs32_xsetgroups32(); -#endif +#endif /* defined(__NR_setgroups32) && defined(AFS_SPARC64_LINUX20_ENV) */ #if (defined(__NR_ia32_setgroups32) && defined(AFS_AMD64_LINUX20_ENV)) extern int afs32_xsetgroups32(); -#endif -#endif /* AFS_SPARC64_LINUX20_ENV || AFS_AMD64_LINUX20_ENV */ +#endif /* (defined(__NR_ia32_setgroups32) && defined(AFS_AMD64_LINUX20_ENV) */ +#endif /* AFS_SPARC64_LINUX20_ENV || AFS_AMD64_LINUX20_ENV || AFS_PPC64_LINUX20_ENV */ #if !defined(EXPORTED_SYS_CALL_TABLE) || (defined(AFS_AMD64_LINUX20_ENV) && !defined(EXPORTED_IA32_SYS_CALL_TABLE)) unsigned long *ptr; - unsigned long offset; - unsigned long datalen; + unsigned long offset=0; + unsigned long datalen=0; int ret; - unsigned long token; - char *mod_name; - unsigned long mod_start; - unsigned long mod_end; - char *sec_name; - unsigned long sec_start; - unsigned long sec_end; - char *sym_name; - unsigned long sym_start; - unsigned long sym_end; + unsigned long token=0; + char *mod_name; + unsigned long mod_start=0; + unsigned long mod_end=0; + char *sec_name; + unsigned long sec_start=0; + unsigned long sec_end=0; + char *sym_name; + unsigned long sym_start=0; + unsigned long sym_end=0; #endif /* EXPORTED_SYS_CALL_TABLE */ RWLOCK_INIT(&afs_xosi, "afs_xosi"); +#if !defined(AFS_LINUX24_ENV) /* obtain PAGE_OFFSET value */ afs_linux_page_offset = get_page_offset(); #ifndef AFS_S390_LINUX22_ENV if (afs_linux_page_offset == 0) { - /* couldn't obtain page offset so can't continue */ - printf("afs: Unable to obtain PAGE_OFFSET. Exiting.."); - return -EIO; + /* couldn't obtain page offset so can't continue */ + printf("afs: Unable to obtain PAGE_OFFSET. Exiting.."); + return -EIO; } #endif /* AFS_S390_LINUX22_ENV */ +#endif /* !defined(AFS_LINUX24_ENV) */ #ifndef EXPORTED_SYS_CALL_TABLE - sys_call_table=0; + sys_call_table = 0; + #ifdef EXPORTED_KALLSYMS_SYMBOL - ret=1; - token=0; + ret = 1; + token = 0; while (ret) { - sym_start=0; - ret=kallsyms_symbol_to_address("sys_call_table", &token, &mod_name, - &mod_start, &mod_end, &sec_name, &sec_start, &sec_end, - &sym_name, &sym_start, &sym_end); - if (ret && !strcmp(mod_name, "kernel")) - break; + sym_start = 0; + ret = + kallsyms_symbol_to_address("sys_call_table", &token, &mod_name, + &mod_start, &mod_end, &sec_name, + &sec_start, &sec_end, &sym_name, + &sym_start, &sym_end); + if (ret && !strcmp(mod_name, "kernel")) + break; } if (ret && sym_start) { - sys_call_table=sym_start; + sys_call_table = sym_start; } +#elif defined(EXPORTED_KALLSYMS_ADDRESS) + ret = + kallsyms_address_to_symbol((unsigned long)&init_mm, &mod_name, + &mod_start, &mod_end, &sec_name, + &sec_start, &sec_end, &sym_name, + &sym_start, &sym_end); + ptr = (unsigned long *)sec_start; + datalen = (sec_end - sec_start) / sizeof(unsigned long); +#elif defined(AFS_IA64_LINUX20_ENV) + ptr = (unsigned long *)(&sys_close - 0x180000); + datalen = 0x180000 / sizeof(ptr); +#elif defined(AFS_AMD64_LINUX20_ENV) + ptr = (unsigned long *)&init_mm; + datalen = 0x360000 / sizeof(ptr); #else -#ifdef EXPORTED_KALLSYMS_ADDRESS - ret=kallsyms_address_to_symbol((unsigned long)&init_mm, &mod_name, - &mod_start, &mod_end, &sec_name, &sec_start, &sec_end, - &sym_name, &sym_start, &sym_end); - ptr=(unsigned long *)sec_start; - datalen=(sec_end-sec_start)/sizeof(unsigned long); -#else -#if defined(AFS_IA64_LINUX20_ENV) - ptr = (unsigned long *) (&sys_close - 0x180000); - datalen=0x180000/sizeof(ptr); -#else -#if defined(AFS_AMD64_LINUX20_ENV) - ptr=(unsigned long *)&init_mm; - datalen=0x360000/sizeof(ptr); -#else - ptr=(unsigned long *)&init_mm; - datalen=16384; + ptr = (unsigned long *)&init_mm; + datalen = 16384; #endif -#endif -#endif - for (offset=0;offset ip; - unsigned long chdir_ip=(unsigned long) ((struct fptr *)&sys_chdir)->ip; - unsigned long write_ip=(unsigned long) ((struct fptr *)&sys_write)->ip; - if (ptr[0] == close_ip && - ptr[__NR_chdir - __NR_close] == chdir_ip && - ptr[__NR_write - __NR_close] == write_ip) { - sys_call_table=(void *) &(ptr[ -1 * (__NR_close-1024)]); + unsigned long close_ip = + (unsigned long)((struct fptr *)&sys_close)->ip; + unsigned long chdir_ip = + (unsigned long)((struct fptr *)&sys_chdir)->ip; + unsigned long write_ip = + (unsigned long)((struct fptr *)&sys_write)->ip; + if (ptr[0] == close_ip && ptr[__NR_chdir - __NR_close] == chdir_ip + && ptr[__NR_write - __NR_close] == write_ip) { + sys_call_table = (void *)&(ptr[-1 * (__NR_close - 1024)]); break; } -#else -#if defined(EXPORTED_SYS_WAIT4) && defined(EXPORTED_SYS_CLOSE) - if (ptr[0] == (unsigned long)&sys_close && - ptr[__NR_wait4 - __NR_close] == (unsigned long)&sys_wait4) { - sys_call_table=ptr - __NR_close; - break; - } -#else -#if defined(EXPORTED_SYS_CHDIR) && defined(EXPORTED_SYS_CLOSE) - if (ptr[0] == (unsigned long)&sys_close && - ptr[__NR_chdir - __NR_close] == (unsigned long)&sys_chdir) { - sys_call_table=ptr - __NR_close; +#elif defined(EXPORTED_SYS_WAIT4) && defined(EXPORTED_SYS_CLOSE) + if (ptr[0] == (unsigned long)&sys_close + && ptr[__NR_wait4 - __NR_close] == (unsigned long)&sys_wait4) { + sys_call_table = ptr - __NR_close; break; } -#else - if (ptr[0] == (unsigned long)&sys_exit && - ptr[__NR_open - __NR_exit] == (unsigned long)&sys_open) { - sys_call_table=ptr - __NR_exit; +#elif defined(EXPORTED_SYS_CHDIR) && defined(EXPORTED_SYS_CLOSE) + if (ptr[0] == (unsigned long)&sys_close + && ptr[__NR_chdir - __NR_close] == (unsigned long)&sys_chdir) { + sys_call_table = ptr - __NR_close; break; } -#endif -#endif -#endif +#elif defined(EXPORTED_SYS_OPEN) + if (ptr[0] == (unsigned long)&sys_exit + && ptr[__NR_open - __NR_exit] == (unsigned long)&sys_open) { + sys_call_table = ptr - __NR_exit; + break; + } +#else /* EXPORTED_SYS_OPEN */ + break; +#endif /* EXPORTED_KALLSYMS_ADDRESS */ } #ifdef EXPORTED_KALLSYMS_ADDRESS - ret=kallsyms_address_to_symbol((unsigned long)sys_call_table, &mod_name, - &mod_start, &mod_end, &sec_name, &sec_start, &sec_end, - &sym_name, &sym_start, &sym_end); + ret = + kallsyms_address_to_symbol((unsigned long)sys_call_table, &mod_name, + &mod_start, &mod_end, &sec_name, + &sec_start, &sec_end, &sym_name, + &sym_start, &sym_end); if (ret && strcmp(sym_name, "sys_call_table")) - sys_call_table=0; -#endif -#endif + sys_call_table = 0; +#endif /* EXPORTED_KALLSYMS_ADDRESS */ if (!sys_call_table) { - printf("Failed to find address of sys_call_table\n"); - return -EIO; - } - printf("Found sys_call_table at %x\n", sys_call_table); -# ifdef AFS_SPARC64_LINUX20_ENV -error cant support this yet. -#endif -#endif /* SYS_CALL_TABLE */ + printf("Failed to find address of sys_call_table\n"); + sys_settimeofdayp = 0; + } else { + printf("Found sys_call_table at %x\n", sys_call_table); +#ifdef AFS_SPARC64_LINUX20_ENV + error cant support this yet.; +#endif /* AFS_SPARC64_LINUX20_ENV */ +#endif /* EXPORTED_SYS_CALL_TABLE */ #ifdef AFS_AMD64_LINUX20_ENV #ifndef EXPORTED_IA32_SYS_CALL_TABLE - ia32_sys_call_table=0; + ia32_sys_call_table = 0; #ifdef EXPORTED_KALLSYMS_SYMBOL - ret=1; - token=0; - while (ret) { - sym_start=0; - ret=kallsyms_symbol_to_address("ia32_sys_call_table", &token, - &mod_name, &mod_start, &mod_end, - &sec_name, &sec_start, &sec_end, - &sym_name, &sym_start, &sym_end); - if (ret && !strcmp(mod_name, "kernel")) + ret = 1; + token = 0; + while (ret) { + sym_start = 0; + ret = kallsyms_symbol_to_address("ia32_sys_call_table", &token, + &mod_name, &mod_start, &mod_end, + &sec_name, &sec_start, &sec_end, + &sym_name, &sym_start, &sym_end); + if (ret && !strcmp(mod_name, "kernel")) break; - } - if (ret && sym_start) { - ia32_sys_call_table=sym_start; - } + } + if (ret && sym_start) { + ia32_sys_call_table = sym_start; + } #else /* EXPORTED_KALLSYMS_SYMBOL */ #ifdef EXPORTED_KALLSYMS_ADDRESS - ret=kallsyms_address_to_symbol((unsigned long)&sys_close, &mod_name, - &mod_start, &mod_end, &sec_name, &sec_start, &sec_end, - &sym_name, &sym_start, &sym_end); - ptr=(unsigned long *)sec_start; - datalen=(sec_end-sec_start)/sizeof(unsigned long); + ret = kallsyms_address_to_symbol((unsigned long) + &interruptible_sleep_on, + &mod_name, &mod_start, &mod_end, + &sec_name, &sec_start, &sec_end, + &sym_name, &sym_start, &sym_end); + ptr = (unsigned long *)sec_start; + datalen = (sec_end - sec_start) / sizeof(unsigned long); #else /* EXPORTED_KALLSYMS_ADDRESS */ -#if defined(AFS_IA64_LINUX20_ENV) - ptr = (unsigned long *) (&sys_close - 0x180000); - datalen=0x180000/sizeof(ptr); -#else /* AFS_IA64_LINUX20_ENV */ #if defined(AFS_AMD64_LINUX20_ENV) - ptr=(unsigned long *)&interruptible_sleep_on; - datalen=0x180000/sizeof(ptr); + ptr = (unsigned long *)&interruptible_sleep_on; + datalen = 0x180000 / sizeof(ptr); #else /* AFS_AMD64_LINUX20_ENV */ - ptr=(unsigned long *)&interruptible_sleep_on; - datalen=16384; + ptr = (unsigned long *)&interruptible_sleep_on; + datalen = 16384; #endif /* AFS_AMD64_LINUX20_ENV */ -#endif /* AFS_IA64_LINUX20_ENV */ #endif /* EXPORTED_KALLSYMS_ADDRESS */ - for (offset=0;offset gp; - - sys_settimeofdayp = (void *) &sys_settimeofday; - - ((struct fptr *)sys_settimeofdayp)->ip = - SYSCALL2POINTER sys_call_table[__NR_settimeofday - 1024]; - ((struct fptr *)sys_settimeofdayp)->gp = kernel_gp; - -#else /* !AFS_IA64_LINUX20_ENV */ - sys_settimeofdayp = SYSCALL2POINTER sys_call_table[__NR_settimeofday]; -#ifdef __NR_socketcall - sys_socketcallp = SYSCALL2POINTER sys_call_table[__NR_socketcall]; -#endif /* no socketcall on alpha */ + /* Initialize pointers to kernel syscalls. */ +#if !defined(AFS_LINUX24_ENV) + sys_settimeofdayp = SYSCALL2POINTER sys_call_table[__NR_settimeofday]; #endif /* AFS_IA64_LINUX20_ENV */ - /* setup AFS entry point. */ - if ( + /* setup AFS entry point. */ + if ( #if defined(AFS_IA64_LINUX20_ENV) - SYSCALL2POINTER sys_call_table[__NR_afs_syscall - 1024] + SYSCALL2POINTER sys_call_table[__NR_afs_syscall - 1024] #else - SYSCALL2POINTER sys_call_table[__NR_afs_syscall] + SYSCALL2POINTER sys_call_table[__NR_afs_syscall] #endif - == afs_syscall) { - printf("AFS syscall entry point already in use!\n"); - return -EBUSY; - } - + == afs_syscall) { + printf("AFS syscall entry point already in use!\n"); + return -EBUSY; + } #if defined(AFS_IA64_LINUX20_ENV) - afs_ni_syscall = sys_call_table[__NR_afs_syscall - 1024]; - sys_call_table[__NR_afs_syscall - 1024] = POINTER2SYSCALL ((struct fptr *)afs_syscall_stub)->ip; + afs_ni_syscall = sys_call_table[__NR_afs_syscall - 1024]; + sys_call_table[__NR_afs_syscall - 1024] = + POINTER2SYSCALL((struct fptr *)afs_syscall_stub)->ip; #else /* AFS_IA64_LINUX20_ENV */ - afs_ni_syscall = sys_call_table[__NR_afs_syscall]; - sys_call_table[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall; -# ifdef AFS_SPARC64_LINUX20_ENV - afs_ni_syscall32 = sys_call_table32[__NR_afs_syscall]; - sys_call_table32[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall32; -# endif + afs_ni_syscall = sys_call_table[__NR_afs_syscall]; + sys_call_table[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall; +#ifdef AFS_SPARC64_LINUX20_ENV + afs_ni_syscall32 = sys_call_table32[__NR_afs_syscall]; + sys_call_table32[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall32; +#endif #endif /* AFS_IA64_LINUX20_ENV */ #ifdef AFS_AMD64_LINUX20_ENV - if (ia32_sys_call_table) { - ia32_ni_syscall = ia32_sys_call_table[__NR_ia32_afs_syscall]; - ia32_sys_call_table[__NR_ia32_afs_syscall] = POINTER2SYSCALL afs_syscall; + if (ia32_sys_call_table) { + ia32_ni_syscall = ia32_sys_call_table[__NR_ia32_afs_syscall]; + ia32_sys_call_table[__NR_ia32_afs_syscall] = + POINTER2SYSCALL afs_syscall; + } +#endif /* AFS_S390_LINUX22_ENV */ +#ifndef EXPORTED_SYS_CALL_TABLE } -#endif - +#endif /* EXPORTED_SYS_CALL_TABLE */ osi_Init(); - register_filesystem(&afs_file_system); + register_filesystem(&afs_fs_type); /* Intercept setgroups calls */ + if (sys_call_table) { #if defined(AFS_IA64_LINUX20_ENV) - sys_setgroupsp = (void *) &sys_setgroups; + sys_setgroupsp = (void *)&sys_setgroups; ((struct fptr *)sys_setgroupsp)->ip = - SYSCALL2POINTER sys_call_table[__NR_setgroups - 1024]; + SYSCALL2POINTER sys_call_table[__NR_setgroups - 1024]; ((struct fptr *)sys_setgroupsp)->gp = kernel_gp; - sys_call_table[__NR_setgroups - 1024] = POINTER2SYSCALL ((struct fptr *)afs_xsetgroups_stub)->ip; + sys_call_table[__NR_setgroups - 1024] = + POINTER2SYSCALL((struct fptr *)afs_xsetgroups_stub)->ip; #else /* AFS_IA64_LINUX20_ENV */ sys_setgroupsp = SYSCALL2POINTER sys_call_table[__NR_setgroups]; sys_call_table[__NR_setgroups] = POINTER2SYSCALL afs_xsetgroups; @@ -484,43 +503,56 @@ error cant support this yet. sys_setgroups32p = SYSCALL2POINTER sys_call_table[__NR_setgroups32]; sys_call_table[__NR_setgroups32] = POINTER2SYSCALL afs_xsetgroups32; #ifdef AFS_SPARC64_LINUX20_ENV - sys32_setgroups32p = SYSCALL2POINTER sys_call_table32[__NR_setgroups32]; - sys_call_table32[__NR_setgroups32] = POINTER2SYSCALL afs32_xsetgroups32; + sys32_setgroups32p = + SYSCALL2POINTER sys_call_table32[__NR_setgroups32]; + sys_call_table32[__NR_setgroups32] = + POINTER2SYSCALL afs32_xsetgroups32; #endif /* AFS_SPARC64_LINUX20_ENV */ #endif /* __NR_setgroups32 */ -#ifdef AFS_AMD64_LINUX20_ENV +#ifdef AFS_AMD64_LINUX20_ENV if (ia32_sys_call_table) { - sys32_setgroupsp = + sys32_setgroupsp = SYSCALL2POINTER ia32_sys_call_table[__NR_ia32_setgroups]; - ia32_sys_call_table[__NR_ia32_setgroups] = + ia32_sys_call_table[__NR_ia32_setgroups] = POINTER2SYSCALL afs32_xsetgroups; #if defined(__NR_ia32_setgroups32) - sys32_setgroups32p = + sys32_setgroups32p = SYSCALL2POINTER ia32_sys_call_table[__NR_ia32_setgroups32]; - ia32_sys_call_table[__NR_ia32_setgroups32] = + ia32_sys_call_table[__NR_ia32_setgroups32] = POINTER2SYSCALL afs32_xsetgroups32; #endif /* __NR_ia32_setgroups32 */ } #endif /* AFS_AMD64_LINUX20_ENV */ #endif /* AFS_IA64_LINUX20_ENV */ +#ifdef AFS_PPC64_LINUX20_ENV + afs_ni_syscall = set_afs_syscall(afs_syscall); + sys_setgroupsp = set_afs_xsetgroups_syscall(afs_xsetgroups); + sys32_setgroupsp = set_afs_xsetgroups_syscall32(afs32_xsetgroups); +#endif + } + osi_sysctl_init(); + afsproc_init(); return 0; } #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) -void __exit afs_cleanup(void) +void __exit +afs_cleanup(void) #else -void cleanup_module(void) +void +cleanup_module(void) #endif { struct task_struct *t; osi_sysctl_clean(); - + if (sys_call_table) { #if defined(AFS_IA64_LINUX20_ENV) - sys_call_table[__NR_setgroups - 1024] = POINTER2SYSCALL ((struct fptr *) sys_setgroupsp)->ip; + sys_call_table[__NR_setgroups - 1024] = + POINTER2SYSCALL((struct fptr *)sys_setgroupsp)->ip; sys_call_table[__NR_afs_syscall - 1024] = afs_ni_syscall; #else /* AFS_IA64_LINUX20_ENV */ sys_call_table[__NR_setgroups] = POINTER2SYSCALL sys_setgroupsp; @@ -532,27 +564,35 @@ void cleanup_module(void) # if defined(__NR_setgroups32) sys_call_table[__NR_setgroups32] = POINTER2SYSCALL sys_setgroups32p; # ifdef AFS_SPARC64_LINUX20_ENV - sys_call_table32[__NR_setgroups32] = POINTER2SYSCALL sys32_setgroups32p; + sys_call_table32[__NR_setgroups32] = + POINTER2SYSCALL sys32_setgroups32p; # endif # endif #endif /* AFS_IA64_LINUX20_ENV */ #ifdef AFS_AMD64_LINUX20_ENV if (ia32_sys_call_table) { - ia32_sys_call_table[__NR_ia32_setgroups] = + ia32_sys_call_table[__NR_ia32_setgroups] = POINTER2SYSCALL sys32_setgroupsp; - ia32_sys_call_table[__NR_ia32_afs_syscall] = + ia32_sys_call_table[__NR_ia32_afs_syscall] = POINTER2SYSCALL ia32_ni_syscall; # if defined(__NR_setgroups32) - ia32_sys_call_table[__NR_ia32_setgroups32] = + ia32_sys_call_table[__NR_ia32_setgroups32] = POINTER2SYSCALL sys32_setgroups32p; #endif } #endif - unregister_filesystem(&afs_file_system); + } +#ifdef AFS_PPC64_LINUX20_ENV + set_afs_syscall(afs_ni_syscall); + set_afs_xsetgroups_syscall(sys_setgroupsp); + set_afs_xsetgroups_syscall32(sys32_setgroupsp); +#endif + unregister_filesystem(&afs_fs_type); - osi_linux_free_inode_pages(); /* Invalidate all pages using AFS inodes. */ + osi_linux_free_inode_pages(); /* Invalidate all pages using AFS inodes. */ osi_linux_free_afs_memory(); + afsproc_exit(); return; } @@ -562,9 +602,11 @@ module_exit(afs_cleanup); #endif -static long get_page_offset(void) +#if !defined(AFS_LINUX24_ENV) +static long +get_page_offset(void) { -#if defined(AFS_PPC_LINUX22_ENV) || defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV) || defined(AFS_ALPHA_LINUX20_ENV) || defined(AFS_S390_LINUX22_ENV) || defined(AFS_IA64_LINUX20_ENV) || defined(AFS_PARISC_LINUX24_ENV) || defined(AFS_AMD64_LINUX20_ENV) +#if defined(AFS_PPC_LINUX22_ENV) || defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV) || defined(AFS_ALPHA_LINUX20_ENV) || defined(AFS_S390_LINUX22_ENV) || defined(AFS_IA64_LINUX20_ENV) || defined(AFS_PARISC_LINUX24_ENV) || defined(AFS_AMD64_LINUX20_ENV) || defined(AFS_PPC64_LINUX20_ENV) return PAGE_OFFSET; #else struct task_struct *p, *q; @@ -575,21 +617,22 @@ static long get_page_offset(void) #endif /* search backward thru the circular list */ #ifdef DEFINED_PREV_TASK - for(q = current; p = q; q = prev_task(p)) { + for (q = current; p = q; q = prev_task(p)) { #else - for(p = current; p; p = p->prev_task) { + for (p = current; p; p = p->prev_task) { #endif - if (p->pid == 1) { + if (p->pid == 1) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) - read_unlock(&tasklist_lock); + read_unlock(&tasklist_lock); #endif - return p->addr_limit.seg; - } + return p->addr_limit.seg; + } } - + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) read_unlock(&tasklist_lock); #endif - return 0; + return 0; #endif } +#endif /* !AFS_LINUX24_ENV */ diff --git a/src/afs/LINUX/osi_prototypes.h b/src/afs/LINUX/osi_prototypes.h index 0d119216c..b39361a6d 100644 --- a/src/afs/LINUX/osi_prototypes.h +++ b/src/afs/LINUX/osi_prototypes.h @@ -22,25 +22,25 @@ extern void osi_linux_verify_alloced_memory(void); /* osi_cred.c */ extern cred_t *crget(void); -extern void crfree(cred_t *cr); -extern cred_t *crdup(cred_t *cr); +extern void crfree(cred_t * cr); +extern cred_t *crdup(cred_t * cr); extern cred_t *crref(void); -extern void crset(cred_t *cr); +extern void crset(cred_t * cr); /* osi_file.c */ extern afs_rwlock_t afs_xosi; /* osi_misc.c */ extern int osi_lookupname(char *aname, uio_seg_t seg, int followlink, - vnode_t **dirvpp, struct dentry **dpp); + vnode_t ** dirvpp, struct dentry **dpp); extern int osi_InitCacheInfo(char *aname); -extern int osi_rdwr(int rw, struct osi_file *file, caddr_t addrp, size_t asize, - size_t *resid); -extern void inline setup_uio(uio_t *uiop, struct iovec *iovecp, char *buf, - int pos, int count, uio_flag_t flag, +extern int osi_rdwr(int rw, struct osi_file *file, caddr_t addrp, + size_t asize, size_t * resid); +extern void inline setup_uio(uio_t * uiop, struct iovec *iovecp, char *buf, + afs_offs_t pos, int count, uio_flag_t flag, uio_seg_t seg); -extern int osi_file_uio_rdwr(struct osi_file *osifile, uio_t *uiop, int rw); -extern void afs_osi_SetTime(osi_timeval_t *tvp); +extern int osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw); +extern void afs_osi_SetTime(osi_timeval_t * tvp); extern void osi_linux_free_inode_pages(void); extern void check_bad_parent(struct dentry *dp); diff --git a/src/afs/LINUX/osi_sleep.c b/src/afs/LINUX/osi_sleep.c index 91dde0e29..b559dd2c9 100644 --- a/src/afs/LINUX/osi_sleep.c +++ b/src/afs/LINUX/osi_sleep.c @@ -8,37 +8,37 @@ */ #include -#include "../afs/param.h" - -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_sleep.c,v 1.1.1.10 2003/04/13 19:02:46 hartmans Exp $"); - -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/param.h" +RCSID + ("$Header: /cvs/openafs/src/afs/LINUX/osi_sleep.c,v 1.21 2003/07/15 23:14:24 shadow Exp $"); +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok); -void afs_osi_Wakeup(char *event); -void afs_osi_Sleep(char *event); static char waitV, dummyV; -void afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) +void +afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) { AFS_STATCNT(osi_InitWaitHandle); achandle->proc = (caddr_t) 0; } /* cancel osi_Wait */ -void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) +void +afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) { caddr_t proc; AFS_STATCNT(osi_CancelWait); proc = achandle->proc; - if (proc == 0) return; - achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ + if (proc == 0) + return; + achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ afs_osi_Wakeup(&waitV); } @@ -46,23 +46,23 @@ void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) * Waits for data on ahandle, or ams ms later. ahandle may be null. * Returns 0 if timeout and EINTR if signalled. */ -int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) +int +afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) { - int code; - afs_int32 endTime, tid; + afs_int32 endTime; struct timer_list *timer = NULL; + int code; AFS_STATCNT(osi_Wait); - endTime = osi_Time() + (ams/1000); + endTime = osi_Time() + (ams / 1000); if (ahandle) ahandle->proc = (caddr_t) current; do { - AFS_ASSERT_GLOCK(); - code = 0; - code = osi_TimedSleep(&waitV, ams, aintok); - - if (code) break; + AFS_ASSERT_GLOCK(); + code = osi_TimedSleep(&waitV, ams, 1); + if (code) + break; if (ahandle && (ahandle->proc == (caddr_t) 0)) { /* we've been signalled */ break; @@ -79,8 +79,8 @@ typedef struct afs_event { char *event; /* lwp event: an address */ int refcount; /* Is it in use? */ int seq; /* Sequence number: this is incremented - by wakeup calls; wait will not return until - it changes */ + * by wakeup calls; wait will not return until + * it changes */ #if defined(AFS_LINUX24_ENV) wait_queue_head_t cond; #else @@ -89,13 +89,14 @@ typedef struct afs_event { } afs_event_t; #define HASHSIZE 128 -afs_event_t *afs_evhasht[HASHSIZE];/* Hash table for events */ +afs_event_t *afs_evhasht[HASHSIZE]; /* Hash table for events */ #define afs_evhash(event) (afs_uint32) ((((long)event)>>2) & (HASHSIZE-1)); int afs_evhashcnt = 0; /* Get and initialize event structure corresponding to lwp event (i.e. address) * */ -static afs_event_t *afs_getevent(char *event) +static afs_event_t * +afs_getevent(char *event) { afs_event_t *evp, *newp = 0; int hashcode; @@ -132,11 +133,12 @@ static afs_event_t *afs_getevent(char *event) * a deadlock). */ -static void afs_addevent(char *event) +static void +afs_addevent(char *event) { int hashcode; afs_event_t *newp; - + AFS_ASSERT_GLOCK(); hashcode = afs_evhash(event); newp = osi_linux_alloc(sizeof(afs_event_t), 0); @@ -149,7 +151,7 @@ static void afs_addevent(char *event) init_waitqueue(&newp->cond); #endif newp->seq = 0; - newp->event = &dummyV; /* Dummy address for new events */ + newp->event = &dummyV; /* Dummy address for new events */ newp->refcount = 0; } @@ -160,17 +162,16 @@ static void afs_addevent(char *event) /* Release the specified event */ #define relevent(evp) ((evp)->refcount--) -/* afs_osi_Sleep -- waits for an event to be notified, ignoring signals. - * - NOTE: that on Linux, there are circumstances in which TASK_INTERRUPTIBLE - * can wake up, even if all signals are blocked - * - TODO: handle signals correctly by passing an indication back to the - * caller that the wait has been interrupted and the stack should be cleaned - * up preparatory to signal delivery +/* afs_osi_SleepSig + * + * Waits for an event to be notified, returning early if a signal + * is received. Returns EINTR if signaled, and 0 otherwise. */ -void afs_osi_Sleep(char *event) +int +afs_osi_SleepSig(void *event) { struct afs_event *evp; - int seq; + int seq, retval; #ifdef DECLARE_WAITQUEUE DECLARE_WAITQUEUE(wait, current); #else @@ -179,38 +180,56 @@ void afs_osi_Sleep(char *event) evp = afs_getevent(event); if (!evp) { - afs_addevent(event); + afs_addevent(event); evp = afs_getevent(event); } seq = evp->seq; + retval = 0; add_wait_queue(&evp->cond, &wait); while (seq == evp->seq) { - sigset_t saved_set; - set_current_state(TASK_INTERRUPTIBLE); AFS_ASSERT_GLOCK(); AFS_GUNLOCK(); - - SIG_LOCK(current); - saved_set = current->blocked; - sigfillset(¤t->blocked); - RECALC_SIGPENDING(current); - SIG_UNLOCK(current); - schedule(); - - SIG_LOCK(current); - current->blocked = saved_set; - RECALC_SIGPENDING(current); - SIG_UNLOCK(current); AFS_GLOCK(); + if (signal_pending(current)) { + retval = EINTR; + break; + } } remove_wait_queue(&evp->cond, &wait); set_current_state(TASK_RUNNING); relevent(evp); + return retval; +} + +/* afs_osi_Sleep -- waits for an event to be notified, ignoring signals. + * - NOTE: that on Linux, there are circumstances in which TASK_INTERRUPTIBLE + * can wake up, even if all signals are blocked + * - TODO: handle signals correctly by passing an indication back to the + * caller that the wait has been interrupted and the stack should be cleaned + * up preparatory to signal delivery + */ +void +afs_osi_Sleep(void *event) +{ + sigset_t saved_set; + + SIG_LOCK(current); + saved_set = current->blocked; + sigfillset(¤t->blocked); + RECALC_SIGPENDING(current); + SIG_UNLOCK(current); + + afs_osi_SleepSig(event); + + SIG_LOCK(current); + current->blocked = saved_set; + RECALC_SIGPENDING(current); + SIG_UNLOCK(current); } /* osi_TimedSleep @@ -223,7 +242,8 @@ void afs_osi_Sleep(char *event) * Returns 0 if timeout, EINTR if signalled, and EGAIN if it might * have raced. */ -static int osi_TimedSleep(char *event, afs_int32 ams, int aintok) +static int +osi_TimedSleep(char *event, afs_int32 ams, int aintok) { int code = 0; long ticks = (ams * HZ / 1000) + 1; @@ -236,23 +256,23 @@ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok) evp = afs_getevent(event); if (!evp) { - afs_addevent(event); + afs_addevent(event); evp = afs_getevent(event); } add_wait_queue(&evp->cond, &wait); set_current_state(TASK_INTERRUPTIBLE); /* always sleep TASK_INTERRUPTIBLE to keep load average - from artifically increasing. */ - + * from artifically increasing. */ AFS_GUNLOCK(); + if (aintok) { - if (schedule_timeout(ticks)) - code = EINTR; + if (schedule_timeout(ticks)) + code = EINTR; } else - schedule_timeout(ticks); - AFS_GLOCK(); + schedule_timeout(ticks); + AFS_GLOCK(); remove_wait_queue(&evp->cond, &wait); set_current_state(TASK_RUNNING); @@ -262,17 +282,21 @@ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok) } -void afs_osi_Wakeup(char *event) +int +afs_osi_Wakeup(void *event) { + int ret = 2; struct afs_event *evp; evp = afs_getevent(event); - if (!evp) /* No sleepers */ - return; + if (!evp) /* No sleepers */ + return 1; if (evp->refcount > 1) { - evp->seq++; + evp->seq++; wake_up(&evp->cond); + ret = 0; } relevent(evp); + return ret; } diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c index eabc30915..3b8e610f3 100644 --- a/src/afs/LINUX/osi_sysctl.c +++ b/src/afs/LINUX/osi_sysctl.c @@ -1,17 +1,17 @@ /* * osi_sysctl.c: Linux sysctl interface to OpenAFS * - * $Id: osi_sysctl.c,v 1.1.1.2 2002/08/02 04:28:56 hartmans Exp $ + * $Id: osi_sysctl.c,v 1.7 2003/08/08 19:55:05 shadow Exp $ * * Written Jan 30, 2002 by Kris Van Hees (Sine Nomine Associates) */ #include -#include "../afs/param.h" +#include "afs/param.h" -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ #include #include @@ -25,41 +25,55 @@ extern afs_int32 hm_retry_int; static struct ctl_table_header *afs_sysctl = NULL; static ctl_table afs_sysctl_table[] = { - {1, "hm_retry_RO", - &hm_retry_RO, sizeof(afs_int32), 0644, NULL, - &proc_dointvec}, - {2, "hm_retry_RW", - &hm_retry_RW, sizeof(afs_int32), 0644, NULL, - &proc_dointvec}, - {3, "hm_retry_int", - &hm_retry_int, sizeof(afs_int32), 0644, NULL, - &proc_dointvec}, - {4, "GCPAGs", - &afs_gcpags, sizeof(afs_int32), 0644, NULL, - &proc_dointvec}, - {0} + {1, "hm_retry_RO", + &hm_retry_RO, sizeof(afs_int32), 0644, NULL, + &proc_dointvec} + , + {2, "hm_retry_RW", + &hm_retry_RW, sizeof(afs_int32), 0644, NULL, + &proc_dointvec} + , + {3, "hm_retry_int", + &hm_retry_int, sizeof(afs_int32), 0644, NULL, + &proc_dointvec} + , + {4, "GCPAGs", + &afs_gcpags, sizeof(afs_int32), 0644, NULL, + &proc_dointvec} + , + {5, "rx_deadtime", + &afs_rx_deadtime, sizeof(afs_int32), 0644, NULL, + &proc_dointvec} + , + {6, "bkVolPref", + &afs_bkvolpref, sizeof(afs_int32), 0644, NULL, + &proc_dointvec} + , + {0} }; static ctl_table fs_sysctl_table[] = { - {1, "afs", NULL, 0, 0555, afs_sysctl_table}, - {0} + {1, "afs", NULL, 0, 0555, afs_sysctl_table}, + {0} }; -int osi_sysctl_init() +int +osi_sysctl_init() { - afs_sysctl = register_sysctl_table(fs_sysctl_table, 0); - if (!afs_sysctl) - return -1; + afs_sysctl = register_sysctl_table(fs_sysctl_table, 0); + if (!afs_sysctl) + return -1; - return 0; + return 0; } -void osi_sysctl_clean() +void +osi_sysctl_clean() { - if (afs_sysctl) { - unregister_sysctl_table(afs_sysctl); - afs_sysctl = NULL; - } + if (afs_sysctl) { + unregister_sysctl_table(afs_sysctl); + afs_sysctl = NULL; + } } #endif /* CONFIG_SYSCTL */ diff --git a/src/afs/LINUX/osi_vfs.hin b/src/afs/LINUX/osi_vfs.hin index 90a572c17..87d58fe65 100644 --- a/src/afs/LINUX/osi_vfs.hin +++ b/src/afs/LINUX/osi_vfs.hin @@ -17,6 +17,7 @@ #ifndef OSI_VFS_H_ #define OSI_VFS_H_ +#if !defined(AFS_LINUX26_ENV) /* The vnode should match the current implementation of the fs independent * part of the Linux inode. */ @@ -24,6 +25,10 @@ /* LINUX VNODE INCLUDED BELOW -- DO NOT MODIFY */ typedef struct vnode vnode_t; +#else +typedef struct inode vnode_t; +#define vnode inode +#endif /* Map vnode fields to inode fields. */ #define i_number i_ino @@ -58,12 +63,6 @@ enum vcexcl { EXCL, NONEXCL } ; #define FSYNC O_SYNC #define VTOI(V) ((struct inode*)V) -#ifdef AFS_LINUX24_ENV -#define VN_HOLD(V) atomic_inc(&((vnode_t*)V)->i_count) -#else -#define VN_HOLD(V) ((vnode_t*)V)->i_count++; -#endif -#define VN_RELE(V) osi_iput((struct inode *)V); #define VFS_STATFS(V, S) ((V)->s_op->statfs)((V), (S), sizeof(*(S))) @@ -80,7 +79,7 @@ enum vcexcl { EXCL, NONEXCL } ; typedef struct vattr { int va_type; /* One of v_types above. */ - size_t va_size; + afs_size_t va_size; unsigned long va_blocks; unsigned long va_blocksize; int va_mask; /* AT_xxx operation to perform. */ @@ -105,7 +104,9 @@ typedef struct vattr { */ #define AT_SIZE ATTR_SIZE #define AT_MODE ATTR_MODE +#undef AT_UID #define AT_UID ATTR_UID +#undef AT_GID #define AT_GID ATTR_GID #define AT_MTIME ATTR_MTIME diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 610daced5..5e9f30d8b 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -13,26 +13,31 @@ * super_block operations should return negated errno to Linux. */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vfsops.c,v 1.1.1.14 2003/07/30 17:08:10 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/LINUX/osi_vfsops.c,v 1.27 2004/04/21 02:20:23 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/afs_stats.h" -#include "../h/locks.h" +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/afs_stats.h" +#if !defined(AFS_LINUX26_ENV) +#include "h/locks.h" +#endif #if defined(AFS_LINUX24_ENV) -#include "../h/smp_lock.h" +#include "h/smp_lock.h" #endif -#define __NO_VERSION__ /* don't define kernel_verion in module.h */ +#define __NO_VERSION__ /* don't define kernel_version in module.h */ #include struct vcache *afs_globalVp = 0; struct vfs *afs_globalVFS = 0; +#if defined(AFS_LINUX24_ENV) struct nameidata afs_cacheNd; -int afs_was_mounted = 0; /* Used to force reload if mount/unmount/mount */ +#endif +int afs_was_mounted = 0; /* Used to force reload if mount/unmount/mount */ extern struct super_operations afs_sops; extern afs_rwlock_t afs_xvcache; @@ -44,8 +49,9 @@ extern struct dentry_operations afs_dentry_operations; static void iattr2vattr(struct vattr *vattrp, struct iattr *iattrp); static void update_inode_cache(struct inode *ip, struct vattr *vp); static int afs_root(struct super_block *afsp); -struct super_block *afs_read_super(struct super_block *sb, void *data, - int silent); +struct super_block *afs_read_super(struct super_block *sb, void *data, int silent); +int afs_fill_super(struct super_block *sb, void *data, int silent); +static struct super_block *afs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data); void put_inode_on_dummy_list(struct inode *ip); /* afs_file_system @@ -55,15 +61,28 @@ void put_inode_on_dummy_list(struct inode *ip); * 2) Mount call comes to us via do_mount -> read_super -> afs_read_super. * We are expected to setup the super_block. See afs_read_super. */ -#if defined(AFS_LINUX24_ENV) -DECLARE_FSTYPE(afs_file_system, "afs", afs_read_super, 0); +#if defined(AFS_LINUX26_ENV) +struct backing_dev_info afs_backing_dev_info = { + .ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE, + .state = 0, +}; + +struct file_system_type afs_fs_type = { + .owner = THIS_MODULE, + .name = "afs", + .get_sb = afs_get_sb, + .kill_sb = kill_anon_super, + .fs_flags = FS_BINARY_MOUNTDATA, +}; +#elif defined(AFS_LINUX24_ENV) +DECLARE_FSTYPE(afs_fs_type, "afs", afs_read_super, 0); #else -struct file_system_type afs_file_system = { - "afs", /* name - used by mount operation. */ - 0, /* requires_dev - no for network filesystems. mount() will - * pass us an "unnamed" device. */ - afs_read_super, /* wrapper to afs_mount */ - NULL /* pointer to next file_system_type once registered. */ +struct file_system_type afs_fs_type = { + "afs", /* name - used by mount operation. */ + 0, /* requires_dev - no for network filesystems. mount() will + * pass us an "unnamed" device. */ + afs_read_super, /* wrapper to afs_mount */ + NULL /* pointer to next file_system_type once registered. */ }; #endif @@ -71,16 +90,32 @@ struct file_system_type afs_file_system = { * read the "super block" for AFS - roughly eguivalent to struct vfs. * dev, covered, s_rd_only, s_dirt, and s_type will be set by read_super. */ -struct super_block *afs_read_super(struct super_block *sb, void *data, - int silent) +#if defined(AFS_LINUX26_ENV) +static struct super_block * +afs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) +{ + return get_sb_nodev(fs_type, flags, data, afs_fill_super); +} + +int +afs_fill_super(struct super_block *sb, void *data, int silent) +#else +struct super_block * +afs_read_super(struct super_block *sb, void *data, int silent) +#endif { int code = 0; AFS_GLOCK(); if (afs_was_mounted) { - printf("You must reload the AFS kernel extensions before remounting AFS.\n"); + printf + ("You must reload the AFS kernel extensions before remounting AFS.\n"); AFS_GUNLOCK(); +#if defined(AFS_LINUX26_ENV) + return -EINVAL; +#else return NULL; +#endif } afs_was_mounted = 1; @@ -88,7 +123,11 @@ struct super_block *afs_read_super(struct super_block *sb, void *data, #if !defined(AFS_LINUX24_ENV) lock_super(sb); #endif +#if defined(AFS_LINUX26_ENV) + __module_get(THIS_MODULE); +#else MOD_INC_USE_COUNT; +#endif afs_globalVFS = sb; sb->s_blocksize = 1024; @@ -100,40 +139,52 @@ struct super_block *afs_read_super(struct super_block *sb, void *data, #endif code = afs_root(sb); if (code) +#if defined(AFS_LINUX26_ENV) + module_put(THIS_MODULE); +#else MOD_DEC_USE_COUNT; +#endif #if !defined(AFS_LINUX24_ENV) unlock_super(sb); #endif AFS_GUNLOCK(); +#if defined(AFS_LINUX26_ENV) + return code ? -EINVAL : 0; +#else return code ? NULL : sb; +#endif } /* afs_root - stat the root of the file system. AFS global held on entry. */ -static int afs_root(struct super_block *afsp) +static int +afs_root(struct super_block *afsp) { register afs_int32 code = 0; struct vrequest treq; - register struct vcache *tvp=0; + register struct vcache *tvp = 0; AFS_STATCNT(afs_root); if (afs_globalVp && (afs_globalVp->states & CStatd)) { tvp = afs_globalVp; } else { cred_t *credp = crref(); - afs_globalVp = 0; - if (!(code = afs_InitReq(&treq, credp)) && - !(code = afs_CheckInit())) { - tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); + + if (afs_globalVp) { + afs_PutVCache(afs_globalVp); + afs_globalVp = NULL; + } + + if (!(code = afs_InitReq(&treq, credp)) && !(code = afs_CheckInit())) { + tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL); if (tvp) { extern struct inode_operations afs_dir_iops; #if defined(AFS_LINUX24_ENV) extern struct file_operations afs_dir_fops; #endif - + /* "/afs" is a directory, reset inode ops accordingly. */ AFSTOV(tvp)->v_op = &afs_dir_iops; #if defined(AFS_LINUX24_ENV) @@ -161,24 +212,12 @@ static int afs_root(struct super_block *afsp) /* super_operations */ -/* afs_read_inode - * called via iget to read in the inode. The passed in inode has i_ino, i_dev - * and i_sb setup on input. Linux file systems use this to get super block - * inode information, so we don't really care what happens here. - * For Linux 2.2, we'll be called if we participate in the inode pool. - */ -void afs_read_inode(struct inode *ip) -{ - /* I don't think we ever get called with this. So print if we do. */ - printf("afs_read_inode: Called for inode %d\n", ip->i_ino); -} - - /* afs_notify_change * Linux version of setattr call. What to change is in the iattr struct. * We need to set bits in both the Linux inode as well as the vcache. */ -int afs_notify_change(struct dentry *dp, struct iattr* iattrp) +int +afs_notify_change(struct dentry *dp, struct iattr *iattrp) { struct vattr vattr; int code; @@ -186,8 +225,11 @@ int afs_notify_change(struct dentry *dp, struct iattr* iattrp) struct inode *ip = dp->d_inode; AFS_GLOCK(); +#if defined(AFS_LINUX26_ENV) + lock_kernel(); +#endif VATTR_NULL(&vattr); - iattr2vattr(&vattr, iattrp); /* Convert for AFS vnodeops call. */ + iattr2vattr(&vattr, iattrp); /* Convert for AFS vnodeops call. */ update_inode_cache(ip, &vattr); code = afs_setattr(ITOAFS(ip), &vattr, credp); afs_CopyOutAttrs(ITOAFS(ip), &vattr); @@ -195,6 +237,9 @@ int afs_notify_change(struct dentry *dp, struct iattr* iattrp) * least we've got the newest version of what was supposed to be set. */ +#if defined(AFS_LINUX26_ENV) + unlock_kernel(); +#endif AFS_GUNLOCK(); crfree(credp); return -code; @@ -220,20 +265,29 @@ static LIST_HEAD(dummy_inode_list); * has synced some pages of a file to disk. */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) -void afs_write_inode(struct inode *ip, int unused) +static void +afs_write_inode(struct inode *ip, int unused) #else -void afs_write_inode(struct inode *ip) +static void +afs_write_inode(struct inode *ip) #endif { - /* and put it back on our dummy list. */ list_del(&ip->i_list); - list_add(&ip->i_list, &dummy_inode_list); + /* and put it back on our dummy list. */ + put_inode_on_dummy_list(ip); /* for now we don't actually update the metadata during msync. This * is just to keep linux happy. */ } +static void +afs_destroy_inode(struct inode *ip) +{ + ip->i_state = 0; +} + + /* afs_put_inode * called from iput when count goes to zero. Linux version of inactive. * For Linux 2.2, this funcionality has moved to the delete inode super op. @@ -241,9 +295,14 @@ void afs_write_inode(struct inode *ip) * That will trigger the call to delete routine. */ -void afs_delete_inode(struct inode *ip) +static void +afs_delete_inode(struct inode *ip) { - struct vcache *vc = ITOAFS(ip); + struct vcache *vp = ITOAFS(ip); + +#ifdef AFS_LINUX26_ENV + put_inode_on_dummy_list(ip); +#endif AFS_GLOCK(); osi_clear_inode(ip); @@ -253,7 +312,8 @@ void afs_delete_inode(struct inode *ip) /* afs_put_super * Called from unmount to release super_block. */ -void afs_put_super(struct super_block *sbp) +static void +afs_put_super(struct super_block *sbp) { extern int afs_afs_cold_shutdown; int code = 0; @@ -262,116 +322,104 @@ void afs_put_super(struct super_block *sbp) AFS_GLOCK(); AFS_STATCNT(afs_unmount); +#if !defined(AFS_LINUX26_ENV) if (!suser()) { AFS_GUNLOCK(); return; } +#endif afs_globalVFS = 0; afs_globalVp = 0; afs_shutdown(); +#if defined(AFS_LINUX24_ENV) path_release(&afs_cacheNd); +#endif osi_linux_verify_alloced_memory(); - done: + done: AFS_GUNLOCK(); if (!code) { sbp->s_dev = 0; +#if defined(AFS_LINUX26_ENV) + module_put(THIS_MODULE); +#else MOD_DEC_USE_COUNT; +#endif } } -#ifdef NOTUSED -/* afs_write_super - * Not required since we don't write out a super block. */ -void afs_write_super(struct super_block *sbp) -{ -} - -/* afs_remount_fs - * Used to remount filesystems with different flags. Not relevant for AFS. - */ -int afs_remount_fs(struct super_block *sbp, int *, char *) -{ - return -EINVAL; -} -#endif /* afs_statfs * statp is in user space, so we need to cobble together a statfs, then * copy it. */ -#if defined(AFS_LINUX24_ENV) -int afs_statfs(struct super_block *sbp, struct statfs *statp) +#if defined(AFS_LINUX26_ENV) +int +afs_statfs(struct super_block *sbp, struct kstatfs *statp) +#elif defined(AFS_LINUX24_ENV) +int +afs_statfs(struct super_block *sbp, struct statfs *statp) #else -int afs_statfs(struct super_block *sbp, struct statfs *statp, int size) +int +afs_statfs(struct super_block *sbp, struct statfs *__statp, int size) #endif { +#if !defined(AFS_LINUX24_ENV) struct statfs stat; - AFS_STATCNT(afs_statfs); - -#if !defined(AFS_LINUX24_ENV) if (size < sizeof(struct statfs)) return; - + memset(&stat, 0, size); + statp = &stat; #endif - stat.f_type = 0; /* Can we get a real type sometime? */ - stat.f_bsize = sbp->s_blocksize; - stat.f_blocks = stat.f_bfree = stat.f_bavail = stat.f_files = - stat.f_ffree = 9000000; - stat.f_fsid.val[0] = AFS_VFSMAGIC; - stat.f_fsid.val[1] = AFS_VFSFSID; - stat.f_namelen = 256; -#if defined(AFS_LINUX24_ENV) - *statp = stat; -#else - memcpy_tofs(statp, &stat, size); + AFS_STATCNT(afs_statfs); + + statp->f_type = 0; /* Can we get a real type sometime? */ + statp->f_bsize = sbp->s_blocksize; + statp->f_blocks = statp->f_bfree = statp->f_bavail = statp->f_files = + statp->f_ffree = 9000000; + statp->f_fsid.val[0] = AFS_VFSMAGIC; + statp->f_fsid.val[1] = AFS_VFSFSID; + statp->f_namelen = 256; + +#if !defined(AFS_LINUX24_ENV) + memcpy_tofs(__statp, &stat, size); #endif return 0; } - -void +void afs_umount_begin(struct super_block *sbp) { - afs_shuttingdown=1; + afs_shuttingdown = 1; } -#if defined(AFS_LINUX24_ENV) -struct super_operations afs_sops = { - read_inode: afs_read_inode, - write_inode: afs_write_inode, - delete_inode: afs_delete_inode, - put_super: afs_put_super, - statfs: afs_statfs, - umount_begin: afs_umount_begin -}; -#else struct super_operations afs_sops = { - afs_read_inode, - afs_write_inode, /* afs_write_inode - see doc above. */ - NULL, /* afs_put_inode */ - afs_delete_inode, - afs_notify_change, - afs_put_super, - NULL, /* afs_write_super - see doc above */ - afs_statfs, - NULL, /* afs_remount_fs - see doc above */ - NULL, /* afs_clear_inode */ - afs_umount_begin -}; +#if defined(AFS_LINUX26_ENV) + .drop_inode = generic_delete_inode, + .destroy_inode = afs_destroy_inode, #endif + .delete_inode = afs_delete_inode, + .write_inode = afs_write_inode, + .put_super = afs_put_super, + .statfs = afs_statfs, + .umount_begin = afs_umount_begin +#if !defined(AFS_LINUX24_ENV) + .notify_change = afs_notify_change, +#endif +}; /************** Support routines ************************/ /* vattr_setattr * Set iattr data into vattr. Assume vattr cleared before call. */ -static void iattr2vattr(struct vattr *vattrp, struct iattr *iattrp) +static void +iattr2vattr(struct vattr *vattrp, struct iattr *iattrp) { vattrp->va_mask = iattrp->ia_valid; if (iattrp->ia_valid & ATTR_MODE) @@ -383,15 +431,27 @@ static void iattr2vattr(struct vattr *vattrp, struct iattr *iattrp) if (iattrp->ia_valid & ATTR_SIZE) vattrp->va_size = iattrp->ia_size; if (iattrp->ia_valid & ATTR_ATIME) { +#if defined(AFS_LINUX26_ENV) + vattrp->va_atime.tv_sec = iattrp->ia_atime.tv_sec; +#else vattrp->va_atime.tv_sec = iattrp->ia_atime; +#endif vattrp->va_atime.tv_usec = 0; } if (iattrp->ia_valid & ATTR_MTIME) { +#if defined(AFS_LINUX26_ENV) + vattrp->va_mtime.tv_sec = iattrp->ia_mtime.tv_sec; +#else vattrp->va_mtime.tv_sec = iattrp->ia_mtime; +#endif vattrp->va_mtime.tv_usec = 0; } if (iattrp->ia_valid & ATTR_CTIME) { +#if defined(AFS_LINUX26_ENV) + vattrp->va_ctime.tv_sec = iattrp->ia_ctime.tv_sec; +#else vattrp->va_ctime.tv_sec = iattrp->ia_ctime; +#endif vattrp->va_ctime.tv_usec = 0; } } @@ -400,7 +460,8 @@ static void iattr2vattr(struct vattr *vattrp, struct iattr *iattrp) * Update inode with info from vattr struct. Use va_mask to determine what * to update. */ -static void update_inode_cache(struct inode *ip, struct vattr *vp) +static void +update_inode_cache(struct inode *ip, struct vattr *vp) { if (vp->va_mask & ATTR_MODE) ip->i_mode = vp->va_mode; @@ -411,17 +472,30 @@ static void update_inode_cache(struct inode *ip, struct vattr *vp) if (vp->va_mask & ATTR_SIZE) ip->i_size = vp->va_size; if (vp->va_mask & ATTR_ATIME) +#if defined(AFS_LINUX26_ENV) + ip->i_atime.tv_sec = vp->va_atime.tv_sec; +#else ip->i_atime = vp->va_atime.tv_sec; +#endif if (vp->va_mask & ATTR_MTIME) +#if defined(AFS_LINUX26_ENV) + ip->i_mtime.tv_sec = vp->va_mtime.tv_sec; +#else ip->i_mtime = vp->va_mtime.tv_sec; +#endif if (vp->va_mask & ATTR_CTIME) +#if defined(AFS_LINUX26_ENV) + ip->i_ctime.tv_sec = vp->va_ctime.tv_sec; +#else ip->i_ctime = vp->va_ctime.tv_sec; +#endif } /* vattr2inode * Rewrite the inode cache from the attr. Assumes all vattr fields are valid. */ -void vattr2inode(struct inode *ip, struct vattr *vp) +void +vattr2inode(struct inode *ip, struct vattr *vp) { ip->i_ino = vp->va_nodeid; ip->i_nlink = vp->va_nlink; @@ -432,44 +506,45 @@ void vattr2inode(struct inode *ip, struct vattr *vp) ip->i_uid = vp->va_uid; ip->i_gid = vp->va_gid; ip->i_size = vp->va_size; +#if defined(AFS_LINUX26_ENV) + ip->i_atime.tv_sec = vp->va_atime.tv_sec; + ip->i_mtime.tv_sec = vp->va_mtime.tv_sec; + ip->i_ctime.tv_sec = vp->va_ctime.tv_sec; +#else ip->i_atime = vp->va_atime.tv_sec; ip->i_mtime = vp->va_mtime.tv_sec; ip->i_ctime = vp->va_ctime.tv_sec; - - /* we should put our inodes on a dummy inode list to keep linux happy.*/ - if (!ip->i_list.prev && !ip->i_list.next) { - /* this might be bad as we are reaching under the covers of the - * list structure but we want to avoid putting the inode - * on the list more than once. */ - put_inode_on_dummy_list(ip); - } +#endif } /* Put this afs inode on our own dummy list. Linux expects to see inodes * nicely strung up in lists. Linux inode syncing code chokes on our inodes if * they're not on any lists. */ -void put_inode_on_dummy_list(struct inode *ip) +void +put_inode_on_dummy_list(struct inode *ip) { /* Initialize list. See explanation above. */ list_add(&ip->i_list, &dummy_inode_list); } /* And yet another routine to update the inode cache - called from ProcessFS */ -void vcache2inode(struct vcache *avc) +void +vcache2inode(struct vcache *avc) { struct vattr vattr; VATTR_NULL(&vattr); - afs_CopyOutAttrs(avc, &vattr); /* calls vattr2inode */ + afs_CopyOutAttrs(avc, &vattr); /* calls vattr2inode */ } /* Yet another one for fakestat'ed mountpoints */ -void vcache2fakeinode(struct vcache *rootvp, struct vcache *mpvp) +void +vcache2fakeinode(struct vcache *rootvp, struct vcache *mpvp) { struct vattr vattr; VATTR_NULL(&vattr); afs_CopyOutAttrs(rootvp, &vattr); - vattr2inode(AFSTOV(mpvp), &vattr); + vattr2inode(AFSTOI(mpvp), &vattr); } diff --git a/src/afs/LINUX/osi_vm.c b/src/afs/LINUX/osi_vm.c index fb859018b..542a97963 100644 --- a/src/afs/LINUX/osi_vm.c +++ b/src/afs/LINUX/osi_vm.c @@ -8,13 +8,14 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vm.c,v 1.1.1.9 2002/05/10 23:44:09 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/LINUX/osi_vm.c,v 1.16 2004/04/12 16:04:32 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ /* Linux VM operations * @@ -39,7 +40,8 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vm.c,v 1.1.1.9 2002/05/10 * is not dropped and re-acquired for any platform. It may be that *slept is * therefore obsolescent. */ -int osi_VM_FlushVCache(struct vcache *avc, int *slept) +int +osi_VM_FlushVCache(struct vcache *avc, int *slept) { struct inode *ip = AFSTOI(avc); @@ -68,16 +70,24 @@ int osi_VM_FlushVCache(struct vcache *avc, int *slept) * Since we drop and re-obtain the lock, we can't guarantee that there won't * be some pages around when we return, newly created by concurrent activity. */ -void osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync) +void +osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync) { - invalidate_inode_pages(AFSTOI(avc)); + struct inode *ip = AFSTOI(avc); + +#if defined(AFS_LINUX26_ENV) + invalidate_inode_pages(ip->i_mapping); +#else + invalidate_inode_pages(ip); +#endif } /* Flush and invalidate pages, for fsync() with INVAL flag * * Locking: only the global lock is held. */ -void osi_VM_FSyncInval(struct vcache *avc) +void +osi_VM_FSyncInval(struct vcache *avc) { } @@ -87,7 +97,8 @@ void osi_VM_FSyncInval(struct vcache *avc) * Locking: the vcache entry's lock is held. It will usually be dropped and * re-obtained. */ -void osi_VM_StoreAllSegments(struct vcache *avc) +void +osi_VM_StoreAllSegments(struct vcache *avc) { struct inode *ip = AFSTOI(avc); @@ -95,7 +106,11 @@ void osi_VM_StoreAllSegments(struct vcache *avc) /* filemap_fdatasync() only exported in 2.4.5 and above */ ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); +#if defined(AFS_LINUX26_ENV) + filemap_fdatawrite(ip->i_mapping); +#else filemap_fdatasync(ip->i_mapping); +#endif filemap_fdatawait(ip->i_mapping); AFS_GLOCK(); ObtainWriteLock(&avc->lock, 121); @@ -106,7 +121,8 @@ void osi_VM_StoreAllSegments(struct vcache *avc) * * Locking: No lock is held, not even the global lock. */ -void osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) +void +osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) struct inode *ip = AFSTOI(avc); @@ -127,7 +143,8 @@ void osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) * activeV is raised. This is supposed to block pageins, but at present * it only works on Solaris. */ -void osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) +void +osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) struct inode *ip = AFSTOI(avc); diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 24d92b1e4..fad6b7687 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -9,9 +9,7 @@ /* * Linux specific vnodeops. Also includes the glue routines required to call - * AFS vnodeops. The "NOTUSED" #define is used to indicate routines and - * calling sequences present in an ops table that we don't actually use. - * They are present solely for documentation purposes. + * AFS vnodeops. * * So far the only truly scary part is that Linux relies on the inode cache * to be up to date. Don't you dare break a callback and expect an fstat @@ -21,18 +19,19 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.1.1.18 2003/04/13 19:02:47 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.74 2004/04/21 02:20:23 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/afs_stats.h" -#include "../afs/afs_osidnlc.h" -#include "../h/mm.h" -#include "../h/pagemap.h" +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/afs_stats.h" +#include "afs/afs_osidnlc.h" +#include "h/mm.h" +#include "h/pagemap.h" #if defined(AFS_LINUX24_ENV) -#include "../h/smp_lock.h" +#include "h/smp_lock.h" #endif #ifdef pgoff2loff @@ -41,10 +40,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.1.1.18 200 #define pageoff(pp) pp->offset #endif +#if defined(AFS_LINUX26_ENV) +#define UnlockPage(pp) unlock_page(pp) +#endif + extern struct vcache *afs_globalVp; extern afs_rwlock_t afs_xvcache; -extern struct dentry_operations *afs_dops; #if defined(AFS_LINUX24_ENV) extern struct inode_operations afs_file_iops; extern struct address_space_operations afs_file_aops; @@ -54,12 +56,8 @@ extern struct inode_operations afs_dir_iops; extern struct inode_operations afs_symlink_iops; -#ifdef NOTUSED -static int afs_linux_lseek(struct inode *ip, struct file *fp, off_t, int) {} -#endif - -static ssize_t afs_linux_read(struct file *fp, char *buf, size_t count, - loff_t *offp) +static ssize_t +afs_linux_read(struct file *fp, char *buf, size_t count, loff_t * offp) { ssize_t code; struct vcache *vcp = ITOAFS(fp->f_dentry->d_inode); @@ -68,9 +66,8 @@ static ssize_t afs_linux_read(struct file *fp, char *buf, size_t count, AFS_GLOCK(); afs_Trace4(afs_iclSetp, CM_TRACE_READOP, ICL_TYPE_POINTER, vcp, - ICL_TYPE_INT32, (int)*offp, - ICL_TYPE_INT32, count, - ICL_TYPE_INT32, 99999); + ICL_TYPE_OFFSET, offp, ICL_TYPE_INT32, count, ICL_TYPE_INT32, + 99999); /* get a validated vcache entry */ code = afs_InitReq(&treq, credp); @@ -80,16 +77,56 @@ static ssize_t afs_linux_read(struct file *fp, char *buf, size_t count, if (code) code = -code; else { - osi_FlushPages(vcp, credp); /* ensure stale pages are gone */ - AFS_GUNLOCK(); - code = generic_file_read(fp, buf, count, offp); - AFS_GLOCK(); +#ifdef AFS_64BIT_CLIENT + if (*offp + count > afs_vmMappingEnd) { + uio_t tuio; + struct iovec iov; + afs_size_t oldOffset = *offp; + afs_int32 xfered = 0; + + if (*offp < afs_vmMappingEnd) { + /* special case of a buffer crossing the VM mapping end */ + afs_int32 tcount = afs_vmMappingEnd - *offp; + count -= tcount; + osi_FlushPages(vcp, credp); /* ensure stale pages are gone */ + AFS_GUNLOCK(); + code = generic_file_read(fp, buf, tcount, offp); + AFS_GLOCK(); + if (code != tcount) { + goto done; + } + xfered = tcount; + } + setup_uio(&tuio, &iov, buf + xfered, (afs_offs_t) * offp, count, + UIO_READ, AFS_UIOSYS); + code = afs_read(vcp, &tuio, credp, 0, 0, 0); + xfered += count - tuio.uio_resid; + if (code != 0) { + afs_Trace4(afs_iclSetp, CM_TRACE_READOP, ICL_TYPE_POINTER, + vcp, ICL_TYPE_OFFSET, offp, ICL_TYPE_INT32, -1, + ICL_TYPE_INT32, code); + code = xfered; + *offp += count - tuio.uio_resid; + } else { + code = xfered; + *offp += count; + } + done: + ; + } else { +#endif /* AFS_64BIT_CLIENT */ + osi_FlushPages(vcp, credp); /* ensure stale pages are gone */ + AFS_GUNLOCK(); + code = generic_file_read(fp, buf, count, offp); + AFS_GLOCK(); +#ifdef AFS_64BIT_CLIENT + } +#endif /* AFS_64BIT_CLIENT */ } afs_Trace4(afs_iclSetp, CM_TRACE_READOP, ICL_TYPE_POINTER, vcp, - ICL_TYPE_INT32, (int)*offp, - ICL_TYPE_INT32, count, - ICL_TYPE_INT32, code); + ICL_TYPE_OFFSET, offp, ICL_TYPE_INT32, count, ICL_TYPE_INT32, + code); AFS_GUNLOCK(); crfree(credp); @@ -101,50 +138,111 @@ static ssize_t afs_linux_read(struct file *fp, char *buf, size_t count, * also takes care of re-positioning the pointer if file is open in append * mode. Call fake open/close to ensure we do writes of core dumps. */ -static ssize_t afs_linux_write(struct file *fp, const char *buf, size_t count, - loff_t *offp) +static ssize_t +afs_linux_write(struct file *fp, const char *buf, size_t count, loff_t * offp) { ssize_t code = 0; int code2; struct vcache *vcp = ITOAFS(fp->f_dentry->d_inode); struct vrequest treq; cred_t *credp = crref(); + afs_offs_t toffs; AFS_GLOCK(); afs_Trace4(afs_iclSetp, CM_TRACE_WRITEOP, ICL_TYPE_POINTER, vcp, - ICL_TYPE_INT32, (int)*offp, ICL_TYPE_INT32, count, - ICL_TYPE_INT32, (fp->f_flags & O_APPEND) ? 99998 : 99999); + ICL_TYPE_OFFSET, offp, ICL_TYPE_INT32, count, ICL_TYPE_INT32, + (fp->f_flags & O_APPEND) ? 99998 : 99999); /* get a validated vcache entry */ - code = (ssize_t)afs_InitReq(&treq, credp); + code = (ssize_t) afs_InitReq(&treq, credp); if (!code) - code = (ssize_t)afs_VerifyVCache(vcp, &treq); + code = (ssize_t) afs_VerifyVCache(vcp, &treq); ObtainWriteLock(&vcp->lock, 529); afs_FakeOpen(vcp); ReleaseWriteLock(&vcp->lock); - AFS_GUNLOCK(); if (code) code = -code; else { - code = generic_file_write(fp, buf, count, offp); +#ifdef AFS_64BIT_CLIENT + toffs = *offp; + if (fp->f_flags & O_APPEND) + toffs += vcp->m.Length; + if (toffs + count > afs_vmMappingEnd) { + uio_t tuio; + struct iovec iov; + afs_size_t oldOffset = *offp; + afs_int32 xfered = 0; + + if (toffs < afs_vmMappingEnd) { + /* special case of a buffer crossing the VM mapping end */ + afs_int32 tcount = afs_vmMappingEnd - *offp; + count -= tcount; + AFS_GUNLOCK(); + code = generic_file_write(fp, buf, tcount, offp); + AFS_GLOCK(); + if (code != tcount) { + goto done; + } + xfered = tcount; + toffs += tcount; + } + setup_uio(&tuio, &iov, buf + xfered, (afs_offs_t) toffs, count, + UIO_WRITE, AFS_UIOSYS); + code = afs_write(vcp, &tuio, fp->f_flags, credp, 0); + xfered += count - tuio.uio_resid; + if (code != 0) { + code = xfered; + *offp += count - tuio.uio_resid; + } else { + /* Purge dirty chunks of file if there are too many dirty chunks. + * Inside the write loop, we only do this at a chunk boundary. + * Clean up partial chunk if necessary at end of loop. + */ + if (AFS_CHUNKBASE(tuio.afsio_offset) != + AFS_CHUNKBASE(oldOffset)) { + ObtainWriteLock(&vcp->lock, 402); + code = afs_DoPartialWrite(vcp, &treq); + vcp->states |= CDirty; + ReleaseWriteLock(&vcp->lock); + } + code = xfered; + *offp += count; + toffs += count; + ObtainWriteLock(&vcp->lock, 400); + vcp->m.Date = osi_Time(); /* Set file date (for ranlib) */ + /* extend file */ + if (!(fp->f_flags & O_APPEND) && toffs > vcp->m.Length) { + vcp->m.Length = toffs; + } + ReleaseWriteLock(&vcp->lock); + } + done: + ; + } else { +#endif /* AFS_64BIT_CLIENT */ + AFS_GUNLOCK(); + code = generic_file_write(fp, buf, count, offp); + AFS_GLOCK(); +#ifdef AFS_64BIT_CLIENT + } +#endif /* AFS_64BIT_CLIENT */ } - AFS_GLOCK(); ObtainWriteLock(&vcp->lock, 530); - vcp->m.Date = osi_Time(); /* set modification time */ + vcp->m.Date = osi_Time(); /* set modification time */ afs_FakeClose(vcp, credp); - if (code>=0) + if (code >= 0) code2 = afs_DoPartialWrite(vcp, &treq); - if (code2 && code >=0) - code = (ssize_t) -code2; + if (code2 && code >= 0) + code = (ssize_t) - code2; ReleaseWriteLock(&vcp->lock); - + afs_Trace4(afs_iclSetp, CM_TRACE_WRITEOP, ICL_TYPE_POINTER, vcp, - ICL_TYPE_INT32, (int)*offp, ICL_TYPE_INT32, count, - ICL_TYPE_INT32, code); + ICL_TYPE_OFFSET, offp, ICL_TYPE_INT32, count, ICL_TYPE_INT32, + code); AFS_GUNLOCK(); crfree(credp); @@ -155,10 +253,10 @@ static ssize_t afs_linux_write(struct file *fp, const char *buf, size_t count, * filldir instead of afs_readdir_move. Note that changes to vcache/dcache * handling and use of bulkstats will need to be reflected here as well. */ -static int afs_linux_readdir(struct file *fp, - void *dirbuf, filldir_t filldir) +static int +afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir) { - extern struct DirEntry * afs_dir_GetBlob(); + extern struct DirEntry *afs_dir_GetBlob(); struct vcache *avc = ITOAFS(FILE_INODE(fp)); struct vrequest treq; register struct dcache *tdc; @@ -168,45 +266,41 @@ static int afs_linux_readdir(struct file *fp, struct DirEntry *de; ino_t ino; int len; - int origOffset; + afs_size_t origOffset, tlen; cred_t *credp = crref(); struct afs_fakestat_state fakestat; AFS_GLOCK(); +#if defined(AFS_LINUX26_ENV) + lock_kernel(); +#endif AFS_STATCNT(afs_readdir); code = afs_InitReq(&treq, credp); crfree(credp); - if (code) { - AFS_GUNLOCK(); - return -code; - } + if (code) + goto out1; afs_InitFakeStat(&fakestat); code = afs_EvalFakeStat(&avc, &fakestat, &treq); - if (code) { - afs_PutFakeStat(&fakestat); - AFS_GUNLOCK(); - return -code; - } + if (code) + goto out; /* update the cache entry */ -tagain: + tagain: code = afs_VerifyVCache(avc, &treq); - if (code) { - afs_PutFakeStat(&fakestat); - AFS_GUNLOCK(); - return -code; - } + if (code) + goto out; /* get a reference to the entire directory */ - tdc = afs_GetDCache(avc, 0, &treq, &origOffset, &len, 1); + tdc = afs_GetDCache(avc, (afs_size_t) 0, &treq, &origOffset, &tlen, 1); + len = tlen; if (!tdc) { - afs_PutFakeStat(&fakestat); - AFS_GUNLOCK(); - return -ENOENT; + code = -ENOENT; + goto out; } ObtainReadLock(&avc->lock); + ObtainReadLock(&tdc->lock); /* * Make sure that the data in the cache is current. There are two * cases we need to worry about: @@ -214,15 +308,17 @@ tagain: * 2. The cache data is no longer valid */ while ((avc->states & CStatd) - && (tdc->flags & DFFetching) + && (tdc->dflags & DFFetching) && hsame(avc->m.DataVersion, tdc->f.versionNo)) { - tdc->flags |= DFWaiting; + ReleaseReadLock(&tdc->lock); ReleaseReadLock(&avc->lock); afs_osi_Sleep(&tdc->validPos); ObtainReadLock(&avc->lock); + ObtainReadLock(&tdc->lock); } if (!(avc->states & CStatd) || !hsame(avc->m.DataVersion, tdc->f.versionNo)) { + ReleaseReadLock(&tdc->lock); ReleaseReadLock(&avc->lock); afs_PutDCache(tdc); goto tagain; @@ -232,82 +328,96 @@ tagain: * takes an offset in units of blobs, rather than bytes. */ code = 0; - offset = (int)fp->f_pos; - while(1) { + offset = (int) fp->f_pos; + while (1) { dirpos = BlobScan(&tdc->f.inode, offset); if (!dirpos) break; - de = (struct DirEntry*)afs_dir_GetBlob(&tdc->f.inode, dirpos); + de = afs_dir_GetBlob(&tdc->f.inode, dirpos); if (!de) break; ino = (avc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode); - ino &= 0x7fffffff; /* Assumes 32 bit ino_t ..... */ - len = strlen(de->name); + ino &= 0x7fffffff; /* Assumes 32 bit ino_t ..... */ + if (de->name) + len = strlen(de->name); + else { + printf("afs_linux_readdir: afs_dir_GetBlob failed, null name (inode %x, dirpos %d)\n", + &tdc->f.inode, dirpos); + DRelease((struct buffer *) de, 0); + afs_PutDCache(tdc); + ReleaseReadLock(&avc->lock); + code = -ENOENT; + goto out; + } /* filldir returns -EINVAL when the buffer is full. */ -#if (defined(AFS_LINUX24_ENV) || defined(pgoff2loff)) && defined(DECLARE_FSTYPE) - { - unsigned int type=DT_UNKNOWN; - struct VenusFid afid; - struct vcache *tvc; - int vtype; - afid.Cell=avc->fid.Cell; - afid.Fid.Volume=avc->fid.Fid.Volume; - afid.Fid.Vnode=ntohl(de->fid.vnode); - afid.Fid.Unique=ntohl(de->fid.vunique); - if ((avc->states & CForeign) == 0 && - (ntohl(de->fid.vnode) & 1)) { - type=DT_DIR; - } else if ((tvc=afs_FindVCache(&afid,0,0,0,0))) { - if (tvc->mvstat) { - type=DT_DIR; - } else if (((tvc->states) & (CStatd|CTruth))) { - /* CTruth will be set if the object has - *ever* been statd */ - vtype=vType(tvc); - if (vtype == VDIR) - type=DT_DIR; - else if (vtype == VREG) - type=DT_REG; - /* Don't do this until we're sure it can't be a mtpt */ - /* else if (vtype == VLNK) - type=DT_LNK; */ - /* what other types does AFS support? */ - } - /* clean up from afs_FindVCache */ - afs_PutVCache(tvc, WRITE_LOCK); - } - code = (*filldir)(dirbuf, de->name, len, offset, ino, type); - } +#if defined(AFS_LINUX26_ENV) || ((defined(AFS_LINUX24_ENV) || defined(pgoff2loff)) && defined(DECLARE_FSTYPE)) + { + unsigned int type = DT_UNKNOWN; + struct VenusFid afid; + struct vcache *tvc; + int vtype; + afid.Cell = avc->fid.Cell; + afid.Fid.Volume = avc->fid.Fid.Volume; + afid.Fid.Vnode = ntohl(de->fid.vnode); + afid.Fid.Unique = ntohl(de->fid.vunique); + if ((avc->states & CForeign) == 0 && (ntohl(de->fid.vnode) & 1)) { + type = DT_DIR; + } else if ((tvc = afs_FindVCache(&afid, 0, 0))) { + if (tvc->mvstat) { + type = DT_DIR; + } else if (((tvc->states) & (CStatd | CTruth))) { + /* CTruth will be set if the object has + *ever* been statd */ + vtype = vType(tvc); + if (vtype == VDIR) + type = DT_DIR; + else if (vtype == VREG) + type = DT_REG; + /* Don't do this until we're sure it can't be a mtpt */ + /* else if (vtype == VLNK) + * type=DT_LNK; */ + /* what other types does AFS support? */ + } + /* clean up from afs_FindVCache */ + afs_PutVCache(tvc); + } + code = (*filldir) (dirbuf, de->name, len, offset, ino, type); + } #else - code = (*filldir)(dirbuf, de->name, len, offset, ino); + code = (*filldir) (dirbuf, de->name, len, offset, ino); #endif - DRelease(de, 0); + DRelease((struct buffer *)de, 0); if (code) break; - offset = dirpos + 1 + ((len+16)>>5); + offset = dirpos + 1 + ((len + 16) >> 5); } /* If filldir didn't fill in the last one this is still pointing to that * last attempt. */ - fp->f_pos = (loff_t)offset; + fp->f_pos = (loff_t) offset; + ReleaseReadLock(&tdc->lock); afs_PutDCache(tdc); ReleaseReadLock(&avc->lock); + code = 0; + +out: afs_PutFakeStat(&fakestat); +out1: +#if defined(AFS_LINUX26_ENV) + unlock_kernel(); +#endif AFS_GUNLOCK(); - return 0; + return code; } -#ifdef NOTUSED -int afs_linux_select(struct inode *ip, struct file *fp, int, select_table *); -#endif /* in afs_pioctl.c */ -extern int afs_xioctl(struct inode *ip, struct file *fp, - unsigned int com, unsigned long arg); +extern int afs_xioctl(struct inode *ip, struct file *fp, unsigned int com, + unsigned long arg); /* We need to detect unmap's after close. To do that, we need our own @@ -320,10 +430,12 @@ static int afs_private_mmap_ops_inited = 0; static struct vm_operations_struct afs_shared_mmap_ops; static int afs_shared_mmap_ops_inited = 0; -void afs_linux_vma_close(struct vm_area_struct *vmap) +void +afs_linux_vma_close(struct vm_area_struct *vmap) { struct vcache *vcp; cred_t *credp; + int need_unlock = 0; if (!vmap->vm_file) return; @@ -333,36 +445,49 @@ void afs_linux_vma_close(struct vm_area_struct *vmap) return; AFS_GLOCK(); - afs_Trace4(afs_iclSetp, CM_TRACE_VM_CLOSE, - ICL_TYPE_POINTER, vcp, - ICL_TYPE_INT32, vcp->mapcnt, - ICL_TYPE_INT32, vcp->opens, + afs_Trace4(afs_iclSetp, CM_TRACE_VM_CLOSE, ICL_TYPE_POINTER, vcp, + ICL_TYPE_INT32, vcp->mapcnt, ICL_TYPE_INT32, vcp->opens, ICL_TYPE_INT32, vcp->execsOrWriters); - ObtainWriteLock(&vcp->lock, 532); + if ((&vcp->lock)->excl_locked == 0 || (&vcp->lock)->pid_writer == MyPidxx) { + ObtainWriteLock(&vcp->lock, 532); + need_unlock = 1; + } else + printk("AFS_VMA_CLOSE(%d): Skipping Already locked vcp=%p vmap=%p\n", + MyPidxx, &vcp, &vmap); if (vcp->mapcnt) { vcp->mapcnt--; - ReleaseWriteLock(&vcp->lock); + if (need_unlock) + ReleaseWriteLock(&vcp->lock); if (!vcp->mapcnt) { - credp = crref(); - (void) afs_close(vcp, vmap->vm_file->f_flags, credp); - /* only decrement the execsOrWriters flag if this is not a writable - * file. */ - if (! (vmap->vm_file->f_flags & (FWRITE | FTRUNC))) + if (need_unlock && vcp->execsOrWriters < 2) { + credp = crref(); + (void)afs_close(vcp, vmap->vm_file->f_flags, credp); + /* only decrement the execsOrWriters flag if this is not a + * writable file. */ + if (!(vmap->vm_file->f_flags & (FWRITE | FTRUNC))) + vcp->execsOrWriters--; + vcp->states &= ~CMAPPED; + crfree(credp); + } else if ((vmap->vm_file->f_flags & (FWRITE | FTRUNC))) vcp->execsOrWriters--; - - vcp->states &= ~CMAPPED; - crfree(credp); + /* If we did not have the lock */ + if (!need_unlock) { + vcp->mapcnt++; + if (!vcp->execsOrWriters) + vcp->execsOrWriters = 1; + } } - } - else { - ReleaseWriteLock(&vcp->lock); + } else { + if (need_unlock) + ReleaseWriteLock(&vcp->lock); } - unlock_exit: + unlock_exit: AFS_GUNLOCK(); } -static int afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap) +static int +afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap) { struct vcache *vcp = ITOAFS(FILE_INODE(fp)); cred_t *credp = crref(); @@ -372,13 +497,13 @@ static int afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap) AFS_GLOCK(); #if defined(AFS_LINUX24_ENV) afs_Trace3(afs_iclSetp, CM_TRACE_GMAP, ICL_TYPE_POINTER, vcp, - ICL_TYPE_POINTER, vmap->vm_start, - ICL_TYPE_INT32, vmap->vm_end - vmap->vm_start); + ICL_TYPE_POINTER, vmap->vm_start, ICL_TYPE_INT32, + vmap->vm_end - vmap->vm_start); #else afs_Trace4(afs_iclSetp, CM_TRACE_GMAP, ICL_TYPE_POINTER, vcp, - ICL_TYPE_POINTER, vmap->vm_start, - ICL_TYPE_INT32, vmap->vm_end - vmap->vm_start, - ICL_TYPE_INT32, vmap->vm_offset); + ICL_TYPE_POINTER, vmap->vm_start, ICL_TYPE_INT32, + vmap->vm_end - vmap->vm_start, ICL_TYPE_INT32, + vmap->vm_offset); #endif /* get a validated vcache entry */ @@ -398,7 +523,7 @@ static int afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap) } if (code == 0) { - ObtainWriteLock(&vcp->lock,531); + ObtainWriteLock(&vcp->lock, 531); /* Set out vma ops so we catch the close. The following test should be * the same as used in generic_file_mmap. */ @@ -409,8 +534,7 @@ static int afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap) afs_shared_mmap_ops.close = afs_linux_vma_close; } vmap->vm_ops = &afs_shared_mmap_ops; - } - else { + } else { if (!afs_private_mmap_ops_inited) { afs_private_mmap_ops_inited = 1; afs_private_mmap_ops = *vmap->vm_ops; @@ -418,8 +542,8 @@ static int afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap) } vmap->vm_ops = &afs_private_mmap_ops; } - - + + /* Add an open reference on the first mapping. */ if (vcp->mapcnt == 0) { vcp->execsOrWriters++; @@ -435,7 +559,8 @@ static int afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap) return code; } -int afs_linux_open(struct inode *ip, struct file *fp) +int +afs_linux_open(struct inode *ip, struct file *fp) { int code; cred_t *credp = crref(); @@ -444,7 +569,7 @@ int afs_linux_open(struct inode *ip, struct file *fp) #ifdef AFS_LINUX24_ENV lock_kernel(); #endif - code = afs_open((struct vcache**)&ip, fp->f_flags, credp); + code = afs_open((struct vcache **)&ip, fp->f_flags, credp); #ifdef AFS_LINUX24_ENV unlock_kernel(); #endif @@ -461,7 +586,8 @@ int afs_linux_open(struct inode *ip, struct file *fp) * fput. See afs_linux_flush for notes on interactions between release and * flush. */ -static int afs_linux_release(struct inode *ip, struct file *fp) +static int +afs_linux_release(struct inode *ip, struct file *fp) { int code = 0; cred_t *credp = crref(); @@ -472,9 +598,8 @@ static int afs_linux_release(struct inode *ip, struct file *fp) lock_kernel(); #endif if (vcp->flushcnt) { - vcp->flushcnt--; /* protected by AFS global lock. */ - } - else { + vcp->flushcnt--; /* protected by AFS global lock. */ + } else { code = afs_close(vcp, fp->f_flags, credp); } #ifdef AFS_LINUX24_ENV @@ -487,9 +612,11 @@ static int afs_linux_release(struct inode *ip, struct file *fp) } #if defined(AFS_LINUX24_ENV) -static int afs_linux_fsync(struct file *fp, struct dentry *dp, int datasync) +static int +afs_linux_fsync(struct file *fp, struct dentry *dp, int datasync) #else -static int afs_linux_fsync(struct file *fp, struct dentry *dp) +static int +afs_linux_fsync(struct file *fp, struct dentry *dp) #endif { int code; @@ -507,21 +634,12 @@ static int afs_linux_fsync(struct file *fp, struct dentry *dp) AFS_GUNLOCK(); crfree(credp); return -code; - -} -#ifdef NOTUSED -/* No support for async i/o */ -int afs_linux_fasync(struct inode *ip, struct file *fp, int); - -/* I don't think it will, at least not as can be detected here. */ -int afs_linux_check_media_change(kdev_t dev); +} -/* Revalidate media and file system. */ -int afs_linux_file_revalidate(kdev_t dev); -#endif /* NOTUSED */ -static int afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp) +static int +afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp) { int code = 0; struct vcache *vcp = ITOAFS(FILE_INODE(fp)); @@ -531,9 +649,9 @@ static int afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp) #else struct flock flock; #endif - + /* Convert to a lock format afs_lockctl understands. */ - memset((char*)&flock, 0, sizeof(flock)); + memset((char *)&flock, 0, sizeof(flock)); flock.l_type = flp->fl_type; flock.l_pid = flp->fl_pid; flock.l_whence = 0; @@ -562,7 +680,7 @@ static int afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp) crfree(credp); return -code; - + } /* afs_linux_flush @@ -577,7 +695,8 @@ static int afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp) * on the just flushed file is wasteful, since the background daemon will * execute the code that finally decides there is nothing to do. */ -int afs_linux_flush(struct file *fp) +int +afs_linux_flush(struct file *fp) { struct vcache *vcp = ITOAFS(FILE_INODE(fp)); int code = 0; @@ -595,81 +714,50 @@ int afs_linux_flush(struct file *fp) AFS_GLOCK(); code = afs_close(vcp, fp->f_flags, credp); - vcp->flushcnt++; /* protected by AFS global lock. */ + vcp->flushcnt++; /* protected by AFS global lock. */ AFS_GUNLOCK(); crfree(credp); return -code; } +#if !defined(AFS_LINUX24_ENV) /* Not allowed to directly read a directory. */ -ssize_t afs_linux_dir_read(struct file *fp, char *buf, size_t count, loff_t *ppos) +ssize_t +afs_linux_dir_read(struct file * fp, char *buf, size_t count, loff_t * ppos) { return -EISDIR; } +#endif -#if defined(AFS_LINUX24_ENV) struct file_operations afs_dir_fops = { - read: generic_read_dir, - readdir: afs_linux_readdir, - ioctl: afs_xioctl, - open: afs_linux_open, - release: afs_linux_release, -}; +#if !defined(AFS_LINUX24_ENV) + .read = afs_linux_dir_read, + .lock = afs_linux_lock, + .fsync = afs_linux_fsync, #else -struct file_operations afs_dir_fops = { - NULL, /* afs_linux_lseek */ - afs_linux_dir_read, - NULL, /* afs_linux_write */ - afs_linux_readdir, - NULL, /* afs_linux_select */ - afs_xioctl, /* close enough to use the ported AFS one */ - NULL, /* afs_linux_mmap */ - afs_linux_open, - NULL, /* afs_linux_flush */ - afs_linux_release, - afs_linux_fsync, - NULL, /* afs_linux_fasync */ - NULL, /* afs_linux_check_media_change */ - NULL, /* afs_linux_file_revalidate */ - afs_linux_lock, -}; + .read = generic_read_dir, #endif - -#if defined(AFS_LINUX24_ENV) -struct file_operations afs_file_fops = { - read: afs_linux_read, - write: afs_linux_write, - ioctl: afs_xioctl, - mmap: afs_linux_mmap, - open: afs_linux_open, - flush: afs_linux_flush, - release: afs_linux_release, - fsync: afs_linux_fsync, - lock: afs_linux_lock, + .readdir = afs_linux_readdir, + .ioctl = afs_xioctl, + .open = afs_linux_open, + .release = afs_linux_release, }; -#else + struct file_operations afs_file_fops = { - NULL, /* afs_linux_lseek */ - afs_linux_read, - afs_linux_write, - NULL, /* afs_linux_readdir */ - NULL, /* afs_linux_select */ - afs_xioctl, /* close enough to use the ported AFS one */ - afs_linux_mmap, - afs_linux_open, - afs_linux_flush, - afs_linux_release, - afs_linux_fsync, - NULL, /* afs_linux_fasync */ - NULL, /* afs_linux_check_media_change */ - NULL, /* afs_linux_file_revalidate */ - afs_linux_lock, + .read = afs_linux_read, + .write = afs_linux_write, + .ioctl = afs_xioctl, + .mmap = afs_linux_mmap, + .open = afs_linux_open, + .flush = afs_linux_flush, + .release = afs_linux_release, + .fsync = afs_linux_fsync, + .lock = afs_linux_lock, }; -#endif - + /********************************************************************** * AFS Linux dentry operations @@ -678,7 +766,8 @@ struct file_operations afs_file_fops = { /* afs_linux_revalidate * Ensure vcache is stat'd before use. Return 0 if entry is valid. */ -static int afs_linux_revalidate(struct dentry *dp) +static int +afs_linux_revalidate(struct dentry *dp) { int code; cred_t *credp; @@ -688,21 +777,20 @@ static int afs_linux_revalidate(struct dentry *dp) AFS_GLOCK(); - if (afs_fakestat_enable && vcp->mvstat == 1 && vcp->mvid && - (vcp->states & CMValid) && (vcp->states & CStatd)) { + if (afs_fakestat_enable && vcp->mvstat == 1 && vcp->mvid + && (vcp->states & CMValid) && (vcp->states & CStatd)) { ObtainSharedLock(&afs_xvcache, 680); - rootvp = afs_FindVCache(vcp->mvid, 0, 0, 0, 0); + rootvp = afs_FindVCache(vcp->mvid, 0, 0); ReleaseSharedLock(&afs_xvcache); } - #ifdef AFS_LINUX24_ENV lock_kernel(); #endif /* Make this a fast path (no crref), since it's called so often. */ if (vcp->states & CStatd) { - if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */ - check_bad_parent(dp); /* check and correct mvid */ + if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */ + check_bad_parent(dp); /* check and correct mvid */ if (rootvp) vcache2fakeinode(rootvp, vcp); else @@ -710,7 +798,8 @@ static int afs_linux_revalidate(struct dentry *dp) #ifdef AFS_LINUX24_ENV unlock_kernel(); #endif - if (rootvp) afs_PutVCache(rootvp); + if (rootvp) + afs_PutVCache(rootvp); AFS_GUNLOCK(); return 0; } @@ -726,9 +815,19 @@ static int afs_linux_revalidate(struct dentry *dp) AFS_GUNLOCK(); crfree(credp); - return -code ; + return -code; } +#if defined(AFS_LINUX26_ENV) +static int +afs_linux_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) +{ + int err = afs_linux_revalidate(dentry); + if (!err) + generic_fillattr(dentry->d_inode, stat); + return err; +} +#endif /* Validate a dentry. Return 1 if unchanged, 0 if VFS layer should re-evaluate. * In kernels 2.2.10 and above, we are passed an additional flags var which @@ -738,9 +837,11 @@ static int afs_linux_revalidate(struct dentry *dp) * later on, we shouldn't have to do it until later. Perhaps in the future.. */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10) -static int afs_linux_dentry_revalidate(struct dentry *dp, int flags) +static int +afs_linux_dentry_revalidate(struct dentry *dp, int flags) #else -static int afs_linux_dentry_revalidate(struct dentry *dp) +static int +afs_linux_dentry_revalidate(struct dentry *dp) #endif { char *name; @@ -753,108 +854,79 @@ static int afs_linux_dentry_revalidate(struct dentry *dp) struct vcache *parentvcp = ITOAFS(dp->d_parent->d_inode); AFS_GLOCK(); + lock_kernel(); sysState.allocked = 0; /* If it's a negative dentry, then there's nothing to do. */ if (!vcp || !parentvcp) - goto done; + goto done; /* If it is the AFS root, then there's no chance it needs - revalidating */ + * revalidating */ if (vcp == afs_globalVp) { bad_dentry = 0; goto done; } - if (code = afs_InitReq(&treq, credp)) - goto done; + if ((code = afs_InitReq(&treq, credp))) + goto done; Check_AtSys(parentvcp, dp->d_name.name, &sysState, &treq); name = sysState.name; /* First try looking up the DNLC */ - if (lookupvcp = osi_dnlc_lookup(parentvcp, name, WRITE_LOCK)) { - /* Verify that the dentry does not point to an old inode */ - if (vcp != lookupvcp) - goto done; - /* Check and correct mvid */ - if (*name != '/' && vcp->mvstat == 2) - check_bad_parent(dp); + if ((lookupvcp = osi_dnlc_lookup(parentvcp, name, WRITE_LOCK))) { + /* Verify that the dentry does not point to an old inode */ + if (vcp != lookupvcp) + goto done; + /* Check and correct mvid */ + if (*name != '/' && vcp->mvstat == 2) + check_bad_parent(dp); vcache2inode(vcp); - bad_dentry = 0; - goto done; + bad_dentry = 0; + goto done; } - /* A DNLC lookup failure cannot be trusted. Try a real lookup */ - code = afs_lookup(parentvcp, name, &lookupvcp, credp); + /* A DNLC lookup failure cannot be trusted. Try a real lookup. + Make sure to try the real name and not the @sys expansion; + afs_lookup will expand @sys itself. */ + + code = afs_lookup(parentvcp, dp->d_name.name, &lookupvcp, credp); /* Verify that the dentry does not point to an old inode */ if (vcp != lookupvcp) - goto done; + goto done; bad_dentry = 0; -done: + done: /* Clean up */ if (lookupvcp) - afs_PutVCache(lookupvcp, WRITE_LOCK); + afs_PutVCache(lookupvcp); if (sysState.allocked) - osi_FreeLargeSpace(name); + osi_FreeLargeSpace(name); AFS_GUNLOCK(); crfree(credp); if (bad_dentry) { - shrink_dcache_parent(dp); - d_drop(dp); + shrink_dcache_parent(dp); + d_drop(dp); } + unlock_kernel(); return !bad_dentry; } -#ifdef notdef -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10) -static int afs_linux_dentry_revalidate(struct dentry *dp, int flags) -#else -static int afs_linux_dentry_revalidate(struct dentry *dp) -#endif -{ - int code; - cred_t *credp; - struct vrequest treq; - struct inode *ip = AFSTOI(dp->d_inode); - - unsigned long timeout = 3*HZ; /* 3 seconds */ - - if (!ip) - printk("negative dentry: %s\n", dp->d_name.name); - - if (!(flags & LOOKUP_CONTINUE)) { - long diff = CURRENT_TIME - dp->d_parent->d_inode->i_mtime; - - if (diff < 15*60) - timeout = 0; - } - - if (time_after(jiffies, dp->d_time + timeout)) - goto out_bad; - - out_valid: - return 1; - - out_bad: - return 0; -} -#endif - +#if !defined(AFS_LINUX26_ENV) /* afs_dentry_iput */ -static void afs_dentry_iput(struct dentry *dp, struct inode *ip) +static void +afs_dentry_iput(struct dentry *dp, struct inode *ip) { if (ICL_SETACTIVE(afs_iclSetp)) { AFS_GLOCK(); - afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYIPUT, - ICL_TYPE_POINTER, ip, + afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYIPUT, ICL_TYPE_POINTER, ip, ICL_TYPE_STRING, dp->d_parent->d_name.name, ICL_TYPE_STRING, dp->d_name.name); AFS_GUNLOCK(); @@ -862,41 +934,32 @@ static void afs_dentry_iput(struct dentry *dp, struct inode *ip) osi_iput(ip); } +#endif -static int afs_dentry_delete(struct dentry *dp) +static int +afs_dentry_delete(struct dentry *dp) { if (ICL_SETACTIVE(afs_iclSetp)) { AFS_GLOCK(); - afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYDELETE, ICL_TYPE_POINTER, + afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYDELETE, ICL_TYPE_POINTER, dp->d_inode, ICL_TYPE_STRING, dp->d_parent->d_name.name, ICL_TYPE_STRING, dp->d_name.name); AFS_GUNLOCK(); } if (dp->d_inode && (ITOAFS(dp->d_inode)->states & CUnlinked)) - return 1; /* bad inode? */ + return 1; /* bad inode? */ return 0; } -#if defined(AFS_LINUX24_ENV) -struct dentry_operations afs_dentry_operations = { - d_revalidate: afs_linux_dentry_revalidate, - d_iput: afs_dentry_iput, - d_delete: afs_dentry_delete, -}; -struct dentry_operations *afs_dops = &afs_dentry_operations; -#else struct dentry_operations afs_dentry_operations = { - afs_linux_dentry_revalidate, /* d_validate(struct dentry *) */ - NULL, /* d_hash */ - NULL, /* d_compare */ - afs_dentry_delete, /* d_delete(struct dentry *) */ - NULL, /* d_release(struct dentry *) */ - afs_dentry_iput /* d_iput(struct dentry *, struct inode *) */ -}; -struct dentry_operations *afs_dops = &afs_dentry_operations; + .d_revalidate = afs_linux_dentry_revalidate, + .d_delete = afs_dentry_delete, +#if !defined(AFS_LINUX26_ENV) + .d_iput = afs_dentry_iput, #endif +}; /********************************************************************** * AFS Linux inode operations @@ -910,7 +973,8 @@ struct dentry_operations *afs_dops = &afs_dentry_operations; * * name is in kernel space at this point. */ -int afs_linux_create(struct inode *dip, struct dentry *dp, int mode) +int +afs_linux_create(struct inode *dip, struct dentry *dp, int mode) { int code; cred_t *credp = crref(); @@ -923,26 +987,30 @@ int afs_linux_create(struct inode *dip, struct dentry *dp, int mode) vattr.va_mode = mode; AFS_GLOCK(); - code = afs_create(ITOAFS(dip), name, &vattr, NONEXCL, mode, - (struct vcache**)&ip, credp); +#if defined(AFS_LINUX26_ENV) + lock_kernel(); +#endif + code = + afs_create(ITOAFS(dip), name, &vattr, NONEXCL, mode, + (struct vcache **)&ip, credp); if (!code) { vattr2inode(ip, &vattr); /* Reset ops if symlink or directory. */ #if defined(AFS_LINUX24_ENV) - if (S_ISREG(ip->i_mode)) { - ip->i_op = &afs_file_iops; - ip->i_fop = &afs_file_fops; - ip->i_data.a_ops = &afs_file_aops; - } else if (S_ISDIR(ip->i_mode)) { - ip->i_op = &afs_dir_iops; - ip->i_fop = &afs_dir_fops; - } else if (S_ISLNK(ip->i_mode)) { - ip->i_op = &afs_symlink_iops; - ip->i_data.a_ops = &afs_symlink_aops; - ip->i_mapping = &ip->i_data; - } else - printk("afs_linux_create: FIXME\n"); + if (S_ISREG(ip->i_mode)) { + ip->i_op = &afs_file_iops; + ip->i_fop = &afs_file_fops; + ip->i_data.a_ops = &afs_file_aops; + } else if (S_ISDIR(ip->i_mode)) { + ip->i_op = &afs_dir_iops; + ip->i_fop = &afs_dir_fops; + } else if (S_ISLNK(ip->i_mode)) { + ip->i_op = &afs_symlink_iops; + ip->i_data.a_ops = &afs_symlink_aops; + ip->i_mapping = &ip->i_data; + } else + printk("afs_linux_create: FIXME\n"); #else if (S_ISDIR(ip->i_mode)) ip->i_op = &afs_dir_iops; @@ -950,11 +1018,14 @@ int afs_linux_create(struct inode *dip, struct dentry *dp, int mode) ip->i_op = &afs_symlink_iops; #endif - dp->d_op = afs_dops; + dp->d_op = &afs_dentry_operations; dp->d_time = jiffies; d_instantiate(dp, ip); } +#if defined(AFS_LINUX26_ENV) + unlock_kernel(); +#endif AFS_GUNLOCK(); crfree(credp); return -code; @@ -962,46 +1033,57 @@ int afs_linux_create(struct inode *dip, struct dentry *dp, int mode) /* afs_linux_lookup */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10) -struct dentry *afs_linux_lookup(struct inode *dip, struct dentry *dp) +struct dentry * +afs_linux_lookup(struct inode *dip, struct dentry *dp) #else -int afs_linux_lookup(struct inode *dip, struct dentry *dp) +int +afs_linux_lookup(struct inode *dip, struct dentry *dp) #endif { int code = 0; cred_t *credp = crref(); - struct vcache *vcp=NULL; + struct vcache *vcp = NULL; const char *comp = dp->d_name.name; + AFS_GLOCK(); +#if defined(AFS_LINUX26_ENV) + lock_kernel(); +#endif code = afs_lookup(ITOAFS(dip), comp, &vcp, credp); - + if (vcp) { struct inode *ip = AFSTOI(vcp); /* Reset ops if symlink or directory. */ #if defined(AFS_LINUX24_ENV) - if (S_ISREG(ip->i_mode)) { - ip->i_op = &afs_file_iops; - ip->i_fop = &afs_file_fops; - ip->i_data.a_ops = &afs_file_aops; - } else if (S_ISDIR(ip->i_mode)) { - ip->i_op = &afs_dir_iops; - ip->i_fop = &afs_dir_fops; - } else if (S_ISLNK(ip->i_mode)) { - ip->i_op = &afs_symlink_iops; - ip->i_data.a_ops = &afs_symlink_aops; - ip->i_mapping = &ip->i_data; + if (S_ISREG(ip->i_mode)) { + ip->i_op = &afs_file_iops; + ip->i_fop = &afs_file_fops; + ip->i_data.a_ops = &afs_file_aops; + } else if (S_ISDIR(ip->i_mode)) { + ip->i_op = &afs_dir_iops; + ip->i_fop = &afs_dir_fops; + } else if (S_ISLNK(ip->i_mode)) { + ip->i_op = &afs_symlink_iops; + ip->i_data.a_ops = &afs_symlink_aops; + ip->i_mapping = &ip->i_data; } else - printk("afs_linux_lookup: ip->i_mode 0x%x dp->d_name.name %s code %d\n", ip->i_mode, dp->d_name.name, code); + printk + ("afs_linux_lookup: ip->i_mode 0x%x dp->d_name.name %s code %d\n", + ip->i_mode, dp->d_name.name, code); #else if (S_ISDIR(ip->i_mode)) ip->i_op = &afs_dir_iops; else if (S_ISLNK(ip->i_mode)) ip->i_op = &afs_symlink_iops; #endif - } + } dp->d_time = jiffies; - dp->d_op = afs_dops; + dp->d_op = &afs_dentry_operations; d_add(dp, AFSTOI(vcp)); +#if defined(AFS_LINUX26_ENV) + unlock_kernel(); +#endif AFS_GUNLOCK(); crfree(credp); @@ -1020,8 +1102,8 @@ int afs_linux_lookup(struct inode *dip, struct dentry *dp) #endif } -int afs_linux_link(struct dentry *olddp, struct inode *dip, - struct dentry *newdp) +int +afs_linux_link(struct dentry *olddp, struct inode *dip, struct dentry *newdp) { int code; cred_t *credp = crref(); @@ -1041,24 +1123,31 @@ int afs_linux_link(struct dentry *olddp, struct inode *dip, return -code; } -int afs_linux_unlink(struct inode *dip, struct dentry *dp) +int +afs_linux_unlink(struct inode *dip, struct dentry *dp) { int code; cred_t *credp = crref(); const char *name = dp->d_name.name; AFS_GLOCK(); +#if defined(AFS_LINUX26_ENV) + lock_kernel(); +#endif code = afs_remove(ITOAFS(dip), name, credp); - AFS_GUNLOCK(); if (!code) d_drop(dp); +#if defined(AFS_LINUX26_ENV) + lock_kernel(); +#endif + AFS_GUNLOCK(); crfree(credp); return -code; } -int afs_linux_symlink(struct inode *dip, struct dentry *dp, - const char *target) +int +afs_linux_symlink(struct inode *dip, struct dentry *dp, const char *target) { int code; cred_t *credp = crref(); @@ -1078,7 +1167,8 @@ int afs_linux_symlink(struct inode *dip, struct dentry *dp, return -code; } -int afs_linux_mkdir(struct inode *dip, struct dentry *dp, int mode) +int +afs_linux_mkdir(struct inode *dip, struct dentry *dp, int mode) { int code; cred_t *credp = crref(); @@ -1087,6 +1177,9 @@ int afs_linux_mkdir(struct inode *dip, struct dentry *dp, int mode) const char *name = dp->d_name.name; AFS_GLOCK(); +#if defined(AFS_LINUX26_ENV) + lock_kernel(); +#endif VATTR_NULL(&vattr); vattr.va_mask = ATTR_MODE; vattr.va_mode = mode; @@ -1097,23 +1190,30 @@ int afs_linux_mkdir(struct inode *dip, struct dentry *dp, int mode) #if defined(AFS_LINUX24_ENV) tvcp->v.v_fop = &afs_dir_fops; #endif - dp->d_op = afs_dops; + dp->d_op = &afs_dentry_operations; dp->d_time = jiffies; d_instantiate(dp, AFSTOI(tvcp)); } +#if defined(AFS_LINUX26_ENV) + unlock_kernel(); +#endif AFS_GUNLOCK(); crfree(credp); return -code; } -int afs_linux_rmdir(struct inode *dip, struct dentry *dp) +int +afs_linux_rmdir(struct inode *dip, struct dentry *dp) { int code; cred_t *credp = crref(); const char *name = dp->d_name.name; AFS_GLOCK(); +#if defined(AFS_LINUX26_ENV) + lock_kernel(); +#endif code = afs_rmdir(ITOAFS(dip), name, credp); /* Linux likes to see ENOTEMPTY returned from an rmdir() syscall @@ -1123,11 +1223,14 @@ int afs_linux_rmdir(struct inode *dip, struct dentry *dp) if (code == EEXIST) { code = ENOTEMPTY; } - + if (!code) { d_drop(dp); } +#if defined(AFS_LINUX26_ENV) + unlock_kernel(); +#endif AFS_GUNLOCK(); crfree(credp); return -code; @@ -1135,36 +1238,48 @@ int afs_linux_rmdir(struct inode *dip, struct dentry *dp) -int afs_linux_rename(struct inode *oldip, struct dentry *olddp, - struct inode *newip, struct dentry *newdp) +int +afs_linux_rename(struct inode *oldip, struct dentry *olddp, + struct inode *newip, struct dentry *newdp) { int code; cred_t *credp = crref(); const char *oldname = olddp->d_name.name; const char *newname = newdp->d_name.name; + AFS_GLOCK(); +#if defined(AFS_LINUX26_ENV) + lock_kernel(); +#endif /* Remove old and new entries from name hash. New one will change below. * While it's optimal to catch failures and re-insert newdp into hash, * it's also error prone and in that case we're already dealing with error * cases. Let another lookup put things right, if need be. */ - if (!list_empty(&olddp->d_hash)) { +#if defined(AFS_LINUX26_ENV) + if (!d_unhashed(olddp)) d_drop(olddp); - } - if (!list_empty(&newdp->d_hash)) { + if (!d_unhashed(newdp)) d_drop(newdp); - } - AFS_GLOCK(); - code = afs_rename(ITOAFS(oldip), oldname, ITOAFS(newip), - newname, credp); - AFS_GUNLOCK(); +#else + if (!list_empty(&olddp->d_hash)) + d_drop(olddp); + if (!list_empty(&newdp->d_hash)) + d_drop(newdp); +#endif + code = afs_rename(ITOAFS(oldip), oldname, ITOAFS(newip), newname, credp); if (!code) { - /* update time so it doesn't expire immediately */ + /* update time so it doesn't expire immediately */ newdp->d_time = jiffies; d_move(olddp, newdp); } +#if defined(AFS_LINUX26_ENV) + unlock_kernel(); +#endif + AFS_GUNLOCK(); + crfree(credp); return -code; } @@ -1174,15 +1289,15 @@ int afs_linux_rename(struct inode *oldip, struct dentry *olddp, * Internal readlink which can return link contents to user or kernel space. * Note that the buffer is NOT supposed to be null-terminated. */ -static int afs_linux_ireadlink(struct inode *ip, char *target, int maxlen, - uio_seg_t seg) +static int +afs_linux_ireadlink(struct inode *ip, char *target, int maxlen, uio_seg_t seg) { int code; cred_t *credp = crref(); uio_t tuio; struct iovec iov; - setup_uio(&tuio, &iov, target, 0, maxlen, UIO_READ, seg); + setup_uio(&tuio, &iov, target, (afs_offs_t) 0, maxlen, UIO_READ, seg); code = afs_readlink(ITOAFS(ip), &tuio, credp); crfree(credp); @@ -1196,7 +1311,8 @@ static int afs_linux_ireadlink(struct inode *ip, char *target, int maxlen, /* afs_linux_readlink * Fill target (which is in user space) with contents of symlink. */ -int afs_linux_readlink(struct dentry *dp, char *target, int maxlen) +int +afs_linux_readlink(struct dentry *dp, char *target, int maxlen) { int code; struct inode *ip = dp->d_inode; @@ -1211,16 +1327,17 @@ int afs_linux_readlink(struct dentry *dp, char *target, int maxlen) /* afs_linux_follow_link * a file system dependent link following routine. */ -struct dentry * afs_linux_follow_link(struct dentry *dp, - struct dentry *basep, - unsigned int follow) +struct dentry * +afs_linux_follow_link(struct dentry *dp, struct dentry *basep, + unsigned int follow) { int code = 0; char *name; struct dentry *res; + AFS_GLOCK(); - name = osi_Alloc(PATH_MAX+1); + name = osi_Alloc(PATH_MAX + 1); if (!name) { AFS_GUNLOCK(); dput(basep); @@ -1230,17 +1347,16 @@ struct dentry * afs_linux_follow_link(struct dentry *dp, code = afs_linux_ireadlink(dp->d_inode, name, PATH_MAX, AFS_UIOSYS); AFS_GUNLOCK(); - if (code<0) { + if (code < 0) { dput(basep); res = ERR_PTR(code); - } - else { + } else { name[code] = '\0'; res = lookup_dentry(name, basep, follow); } AFS_GLOCK(); - osi_Free(name, PATH_MAX+1); + osi_Free(name, PATH_MAX + 1); AFS_GUNLOCK(); return res; } @@ -1249,29 +1365,26 @@ struct dentry * afs_linux_follow_link(struct dentry *dp, /* afs_linux_readpage * all reads come through here. A strategy-like read call. */ -int afs_linux_readpage(struct file *fp, struct page *pp) +int +afs_linux_readpage(struct file *fp, struct page *pp) { int code; cred_t *credp = crref(); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) char *address; - loff_t offset = pp->index << PAGE_CACHE_SHIFT; + afs_offs_t offset = pp->index << PAGE_CACHE_SHIFT; #else ulong address = afs_linux_page_address(pp); - loff_t offset = pageoff(pp); + afs_offs_t offset = pageoff(pp); #endif uio_t tuio; struct iovec iovec; struct inode *ip = FILE_INODE(fp); int cnt = atomic_read(&pp->count); + struct vcache *avc = ITOAFS(ip); AFS_GLOCK(); - afs_Trace4(afs_iclSetp, CM_TRACE_READPAGE, - ICL_TYPE_POINTER, ip, - ICL_TYPE_POINTER, pp, - ICL_TYPE_INT32, cnt, - ICL_TYPE_INT32, 99999); /* not a possible code value */ - + afs_Trace4(afs_iclSetp, CM_TRACE_READPAGE, ICL_TYPE_POINTER, ip, ICL_TYPE_POINTER, pp, ICL_TYPE_INT32, cnt, ICL_TYPE_INT32, 99999); /* not a possible code value */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) address = kmap(pp); ClearPageError(pp); @@ -1279,20 +1392,20 @@ int afs_linux_readpage(struct file *fp, struct page *pp) lock_kernel(); #else atomic_add(1, &pp->count); - set_bit(PG_locked, &pp->flags); /* other bits? See mm.h */ + set_bit(PG_locked, &pp->flags); /* other bits? See mm.h */ clear_bit(PG_error, &pp->flags); #endif - setup_uio(&tuio, &iovec, (char*)address, offset, PAGESIZE, - UIO_READ, AFS_UIOSYS); - code = afs_rdwr(ITOAFS(ip), &tuio, UIO_READ, 0, credp); + setup_uio(&tuio, &iovec, (char *)address, offset, PAGESIZE, UIO_READ, + AFS_UIOSYS); + code = afs_rdwr(avc, &tuio, UIO_READ, 0, credp); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) unlock_kernel(); #endif if (!code) { - if (tuio.uio_resid) /* zero remainder of page */ - memset((void*)(address+(PAGESIZE-tuio.uio_resid)), 0, + if (tuio.uio_resid) /* zero remainder of page */ + memset((void *)(address + (PAGESIZE - tuio.uio_resid)), 0, tuio.uio_resid); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) flush_dcache_page(pp); @@ -1301,7 +1414,6 @@ int afs_linux_readpage(struct file *fp, struct page *pp) set_bit(PG_uptodate, &pp->flags); #endif } - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) kunmap(pp); UnlockPage(pp); @@ -1311,37 +1423,52 @@ int afs_linux_readpage(struct file *fp, struct page *pp) free_page(address); #endif + if (!code && AFS_CHUNKOFFSET(offset) == 0) { + struct dcache *tdc; + struct vrequest treq; + + code = afs_InitReq(&treq, credp); + if (!code && !NBObtainWriteLock(&avc->lock, 534)) { + tdc = afs_FindDCache(avc, offset); + if (tdc) { + if (!(tdc->mflags & DFNextStarted)) + afs_PrefetchChunk(avc, tdc, credp, &treq); + afs_PutDCache(tdc); + } + ReleaseWriteLock(&avc->lock); + } + } + crfree(credp); - afs_Trace4(afs_iclSetp, CM_TRACE_READPAGE, - ICL_TYPE_POINTER, ip, - ICL_TYPE_POINTER, pp, - ICL_TYPE_INT32, cnt, - ICL_TYPE_INT32, code); + afs_Trace4(afs_iclSetp, CM_TRACE_READPAGE, ICL_TYPE_POINTER, ip, + ICL_TYPE_POINTER, pp, ICL_TYPE_INT32, cnt, ICL_TYPE_INT32, + code); AFS_GUNLOCK(); return -code; } #if defined(AFS_LINUX24_ENV) -int afs_linux_writepage(struct page *pp) +int +afs_linux_writepage(struct page *pp) { struct address_space *mapping = pp->mapping; struct inode *inode; unsigned long end_index; unsigned offset = PAGE_CACHE_SIZE; long status; - - inode = (struct inode *) mapping->host; + + inode = (struct inode *)mapping->host; end_index = inode->i_size >> PAGE_CACHE_SHIFT; /* easy case */ if (pp->index < end_index) goto do_it; /* things got complicated... */ - offset = inode->i_size & (PAGE_CACHE_SIZE-1); + offset = inode->i_size & (PAGE_CACHE_SIZE - 1); /* OK, are we completely out? */ - if (pp->index >= end_index+1 || !offset) + if (pp->index >= end_index + 1 || !offset) return -EIO; -do_it: + do_it: AFS_GLOCK(); status = afs_linux_writepage_sync(inode, pp, 0, offset); AFS_GUNLOCK(); @@ -1354,32 +1481,23 @@ do_it: } #endif -#ifdef NOTUSED -/* afs_linux_bmap - supports generic_readpage, but we roll our own. */ -int afs_linux_bmap(struct inode *ip, int) { return -EINVAL; } - -/* afs_linux_truncate - * Handles discarding disk blocks if this were a device. ext2 indicates we - * may need to zero partial last pages of memory mapped files. - */ -void afs_linux_truncate(struct inode *ip) -{ -} -#endif - /* afs_linux_permission * Check access rights - returns error if can't check or permission denied. */ -int afs_linux_permission(struct inode *ip, int mode) +int +afs_linux_permission(struct inode *ip, int mode) { int code; cred_t *credp = crref(); int tmp = 0; AFS_GLOCK(); - if (mode & MAY_EXEC) tmp |= VEXEC; - if (mode & MAY_READ) tmp |= VREAD; - if (mode & MAY_WRITE) tmp |= VWRITE; + if (mode & MAY_EXEC) + tmp |= VEXEC; + if (mode & MAY_READ) + tmp |= VREAD; + if (mode & MAY_WRITE) + tmp |= VWRITE; code = afs_access(ITOAFS(ip), tmp, credp); AFS_GUNLOCK(); @@ -1388,19 +1506,14 @@ int afs_linux_permission(struct inode *ip, int mode) } -#ifdef NOTUSED -/* msdos sector mapping hack for memory mapping. */ -int afs_linux_smap(struct inode *ip, int) { return -EINVAL; } -#endif - #if defined(AFS_LINUX24_ENV) -int afs_linux_writepage_sync(struct inode *ip, struct page *pp, - unsigned long offset, - unsigned int count) +int +afs_linux_writepage_sync(struct inode *ip, struct page *pp, + unsigned long offset, unsigned int count) { struct vcache *vcp = ITOAFS(ip); char *buffer; - loff_t base; + afs_offs_t base; int code = 0; cred_t *credp; uio_t tuio; @@ -1412,9 +1525,8 @@ int afs_linux_writepage_sync(struct inode *ip, struct page *pp, credp = crref(); afs_Trace4(afs_iclSetp, CM_TRACE_UPDATEPAGE, ICL_TYPE_POINTER, vcp, - ICL_TYPE_POINTER, pp, - ICL_TYPE_INT32, atomic_read(&pp->count), - ICL_TYPE_INT32, 99999); + ICL_TYPE_POINTER, pp, ICL_TYPE_INT32, atomic_read(&pp->count), + ICL_TYPE_INT32, 99999); setup_uio(&tuio, &iovec, buffer, base, count, UIO_WRITE, AFS_UIOSYS); @@ -1422,8 +1534,9 @@ int afs_linux_writepage_sync(struct inode *ip, struct page *pp, vcache2inode(vcp); - if (!code && afs_stats_cmperf.cacheCurrDirtyChunks > - afs_stats_cmperf.cacheMaxDirtyChunks) { + if (!code + && afs_stats_cmperf.cacheCurrDirtyChunks > + afs_stats_cmperf.cacheMaxDirtyChunks) { struct vrequest treq; ObtainWriteLock(&vcp->lock, 533); @@ -1434,9 +1547,8 @@ int afs_linux_writepage_sync(struct inode *ip, struct page *pp, code = code ? -code : count - tuio.uio_resid; afs_Trace4(afs_iclSetp, CM_TRACE_UPDATEPAGE, ICL_TYPE_POINTER, vcp, - ICL_TYPE_POINTER, pp, - ICL_TYPE_INT32, atomic_read(&pp->count), - ICL_TYPE_INT32, code); + ICL_TYPE_POINTER, pp, ICL_TYPE_INT32, atomic_read(&pp->count), + ICL_TYPE_INT32, code); crfree(credp); kunmap(pp); @@ -1445,7 +1557,7 @@ int afs_linux_writepage_sync(struct inode *ip, struct page *pp, } static int -afs_linux_updatepage(struct file *file, struct page *page, +afs_linux_updatepage(struct file *file, struct page *page, unsigned long offset, unsigned int count) { struct dentry *dentry = file->f_dentry; @@ -1458,27 +1570,27 @@ afs_linux_updatepage(struct file *file, struct page *page, * Called from generic_file_write. buffer is still in user space. pagep * has been filled in with old data if we're updating less than a page. */ -int afs_linux_updatepage(struct file *fp, struct page *pp, - unsigned long offset, - unsigned int count, int sync) +int +afs_linux_updatepage(struct file *fp, struct page *pp, unsigned long offset, + unsigned int count, int sync) { struct vcache *vcp = ITOAFS(FILE_INODE(fp)); - u8 *page_addr = (u8*) afs_linux_page_address(pp); + u8 *page_addr = (u8 *) afs_linux_page_address(pp); int code = 0; cred_t *credp; uio_t tuio; struct iovec iovec; - + set_bit(PG_locked, &pp->flags); credp = crref(); AFS_GLOCK(); afs_Trace4(afs_iclSetp, CM_TRACE_UPDATEPAGE, ICL_TYPE_POINTER, vcp, - ICL_TYPE_POINTER, pp, - ICL_TYPE_INT32, atomic_read(&pp->count), + ICL_TYPE_POINTER, pp, ICL_TYPE_INT32, atomic_read(&pp->count), ICL_TYPE_INT32, 99999); - setup_uio(&tuio, &iovec, page_addr + offset, pageoff(pp) + offset, count, - UIO_WRITE, AFS_UIOSYS); + setup_uio(&tuio, &iovec, page_addr + offset, + (afs_offs_t) (pageoff(pp) + offset), count, UIO_WRITE, + AFS_UIOSYS); code = afs_write(vcp, &tuio, fp->f_flags, credp, 0); @@ -1486,8 +1598,7 @@ int afs_linux_updatepage(struct file *fp, struct page *pp, code = code ? -code : count - tuio.uio_resid; afs_Trace4(afs_iclSetp, CM_TRACE_UPDATEPAGE, ICL_TYPE_POINTER, vcp, - ICL_TYPE_POINTER, pp, - ICL_TYPE_INT32, atomic_read(&pp->count), + ICL_TYPE_POINTER, pp, ICL_TYPE_INT32, atomic_read(&pp->count), ICL_TYPE_INT32, code); AFS_GUNLOCK(); @@ -1499,13 +1610,15 @@ int afs_linux_updatepage(struct file *fp, struct page *pp, #endif #if defined(AFS_LINUX24_ENV) -static int afs_linux_commit_write(struct file *file, struct page *page, unsigned offset, unsigned to) +static int +afs_linux_commit_write(struct file *file, struct page *page, unsigned offset, + unsigned to) { int code; AFS_GLOCK(); lock_kernel(); - code = afs_linux_updatepage(file, page, offset, to-offset); + code = afs_linux_updatepage(file, page, offset, to - offset); unlock_kernel(); AFS_GUNLOCK(); kunmap(page); @@ -1513,106 +1626,78 @@ static int afs_linux_commit_write(struct file *file, struct page *page, unsigned return code; } -static int afs_linux_prepare_write(struct file *file, struct page *page, - unsigned from, unsigned to) +static int +afs_linux_prepare_write(struct file *file, struct page *page, unsigned from, + unsigned to) { kmap(page); return 0; } -extern int afs_notify_change(struct dentry *dp, struct iattr* iattrp); +extern int afs_notify_change(struct dentry *dp, struct iattr *iattrp); #endif -#if defined(AFS_LINUX24_ENV) struct inode_operations afs_file_iops = { - revalidate: afs_linux_revalidate, - setattr: afs_notify_change, - permission: afs_linux_permission, -}; -struct address_space_operations afs_file_aops = { - readpage: afs_linux_readpage, - writepage: afs_linux_writepage, - commit_write: afs_linux_commit_write, - prepare_write: afs_linux_prepare_write, -}; - -struct inode_operations *afs_ops = &afs_file_iops; +#if defined(AFS_LINUX26_ENV) + .permission = afs_linux_permission, + .getattr = afs_linux_getattr, + .setattr = afs_notify_change, +#elif defined(AFS_LINUX24_ENV) + .permission = afs_linux_permission, + .revalidate = afs_linux_revalidate, + .setattr = afs_notify_change, #else -struct inode_operations afs_iops = { - &afs_file_fops, /* file operations */ - NULL, /* afs_linux_create */ - NULL, /* afs_linux_lookup */ - NULL, /* afs_linux_link */ - NULL, /* afs_linux_unlink */ - NULL, /* afs_linux_symlink */ - NULL, /* afs_linux_mkdir */ - NULL, /* afs_linux_rmdir */ - NULL, /* afs_linux_mknod */ - NULL, /* afs_linux_rename */ - NULL, /* afs_linux_readlink */ - NULL, /* afs_linux_follow_link */ - afs_linux_readpage, - NULL, /* afs_linux_writepage */ - NULL, /* afs_linux_bmap */ - NULL, /* afs_linux_truncate */ - afs_linux_permission, - NULL, /* afs_linux_smap */ - afs_linux_updatepage, - afs_linux_revalidate, + .default_file_ops = &afs_file_fops, + .readpage = afs_linux_readpage, + .revalidate = afs_linux_revalidate, + .updatepage = afs_linux_updatepage, +#endif }; -struct inode_operations *afs_ops = &afs_iops; +#if defined(AFS_LINUX24_ENV) +struct address_space_operations afs_file_aops = { + .readpage = afs_linux_readpage, + .writepage = afs_linux_writepage, + .commit_write = afs_linux_commit_write, + .prepare_write = afs_linux_prepare_write, +}; #endif + /* Separate ops vector for directories. Linux 2.2 tests type of inode * by what sort of operation is allowed..... */ -#if defined(AFS_LINUX24_ENV) + struct inode_operations afs_dir_iops = { - create: afs_linux_create, - lookup: afs_linux_lookup, - link: afs_linux_link, - unlink: afs_linux_unlink, - symlink: afs_linux_symlink, - mkdir: afs_linux_mkdir, - rmdir: afs_linux_rmdir, - rename: afs_linux_rename, - revalidate: afs_linux_revalidate, - setattr: afs_notify_change, - permission: afs_linux_permission, -}; +#if !defined(AFS_LINUX24_ENV) + .default_file_ops = &afs_dir_fops, #else -struct inode_operations afs_dir_iops = { - &afs_dir_fops, /* file operations for directories */ - afs_linux_create, - afs_linux_lookup, - afs_linux_link, - afs_linux_unlink, - afs_linux_symlink, - afs_linux_mkdir, - afs_linux_rmdir, - NULL, /* afs_linux_mknod */ - afs_linux_rename, - NULL, /* afs_linux_readlink */ - NULL, /* afs_linux_follow_link */ - NULL, /* afs_linux_readpage */ - NULL, /* afs_linux_writepage */ - NULL, /* afs_linux_bmap */ - NULL, /* afs_linux_truncate */ - afs_linux_permission, - NULL, /* afs_linux_smap */ - NULL, /* afs_linux_updatepage */ - afs_linux_revalidate, -}; + .setattr = afs_notify_change, #endif + .create = afs_linux_create, + .lookup = afs_linux_lookup, + .link = afs_linux_link, + .unlink = afs_linux_unlink, + .symlink = afs_linux_symlink, + .mkdir = afs_linux_mkdir, + .rmdir = afs_linux_rmdir, + .rename = afs_linux_rename, +#if defined(AFS_LINUX26_ENV) + .getattr = afs_linux_getattr, +#else + .revalidate = afs_linux_revalidate, +#endif + .permission = afs_linux_permission, +}; /* We really need a separate symlink set of ops, since do_follow_link() * determines if it _is_ a link by checking if the follow_link op is set. */ #if defined(AFS_LINUX24_ENV) -static int afs_symlink_filler(struct file *file, struct page *page) +static int +afs_symlink_filler(struct file *file, struct page *page) { - struct inode *ip = (struct inode *) page->mapping->host; + struct inode *ip = (struct inode *)page->mapping->host; char *p = (char *)kmap(page); int code; @@ -1620,9 +1705,9 @@ static int afs_symlink_filler(struct file *file, struct page *page) lock_kernel(); code = afs_linux_ireadlink(ip, p, PAGE_SIZE, AFS_UIOSYS); - if (code<0) - goto fail; - p[code] = '\0'; /* null terminate? */ + if (code < 0) + goto fail; + p[code] = '\0'; /* null terminate? */ unlock_kernel(); AFS_GUNLOCK(); @@ -1631,7 +1716,7 @@ static int afs_symlink_filler(struct file *file, struct page *page) UnlockPage(page); return 0; -fail: + fail: unlock_kernel(); AFS_GUNLOCK(); @@ -1642,35 +1727,19 @@ fail: } struct address_space_operations afs_symlink_aops = { - readpage: afs_symlink_filler + .readpage = afs_symlink_filler }; +#endif struct inode_operations afs_symlink_iops = { - readlink: page_readlink, - follow_link: page_follow_link, - setattr: afs_notify_change, -}; +#if defined(AFS_LINUX24_ENV) + .readlink = page_readlink, + .follow_link = page_follow_link, + .setattr = afs_notify_change, #else -struct inode_operations afs_symlink_iops = { - NULL, /* file operations */ - NULL, /* create */ - NULL, /* lookup */ - NULL, /* link */ - NULL, /* unlink */ - NULL, /* symlink */ - NULL, /* mkdir */ - NULL, /* rmdir */ - NULL, /* afs_linux_mknod */ - NULL, /* rename */ - afs_linux_readlink, - afs_linux_follow_link, - NULL, /* readpage */ - NULL, /* afs_linux_writepage */ - NULL, /* afs_linux_bmap */ - NULL, /* afs_linux_truncate */ - afs_linux_permission, /* tho the code appears to indicate not used? */ - NULL, /* afs_linux_smap */ - NULL, /* updatepage */ - afs_linux_revalidate, /* tho the code appears to indicate not used? */ -}; + .readlink = afs_linux_readlink, + .follow_link = afs_linux_follow_link, + .permission = afs_linux_permission, + .revalidate = afs_linux_revalidate, #endif +}; diff --git a/src/afs/Makefile.am b/src/afs/Makefile.am index 1ea96181f..58ac16009 100644 --- a/src/afs/Makefile.am +++ b/src/afs/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.1 2001/07/05 01:00:31 hartmans Exp $ +# $Id: Makefile.am,v 1.1 2001/06/05 20:17:49 shadow Exp $ include $(top_srcdir)/Makefile.am.common diff --git a/src/afs/Makefile.in b/src/afs/Makefile.in index 0fb644b8e..d31ce8dc5 100644 --- a/src/afs/Makefile.in +++ b/src/afs/Makefile.in @@ -7,48 +7,25 @@ # # Portions Copyright (c) 2003 Apple Computer, Inc. -DEST=@DEST@ -TOP_INCDIR=@TOP_INCDIR@ -TOP_LIBDIR=@TOP_LIBDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -libdir=@libdir@ -includedir=@includedir@ -mandir=@mandir@ -afssrvbindir=@afssrvbindir@ -afssrvsbindir=@afssrvsbindir@ -afssrvlibexecdir=@afssrvlibexecdir@ -COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et -RXGEN=${TOP_SRCDIR}/rxgen/rxgen -TOP_SRCDIR=@TOP_SRCDIR@ -SYS_NAME=@AFS_SYSNAME@ - -SHELL=/bin/sh -KERNELDIR = ../libafs -UKERNELDIR = ../libuafs - -include ../config/Makefile.${SYS_NAME} - -all: kinstall ukinstall ${TOP_INCDIR}/afs/afs.h ${TOP_INCDIR}/afs/osi_inode.h ${TOP_INCDIR}/afs/afs_stats.h ${TOP_INCDIR}/afs/exporter.h ${TOP_INCDIR}/afs/nfsclient.h ${TOP_INCDIR}/afs/sysctl.h +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config + +all: depinstall + +depinstall: ${TOP_INCDIR}/afs/afs.h ${TOP_INCDIR}/afs/osi_inode.h ${TOP_INCDIR}/afs/afs_stats.h \ + ${TOP_INCDIR}/afs/exporter.h ${TOP_INCDIR}/afs/nfsclient.h afszcm.cat AFS_component_version_number.c ${TOP_INCDIR}/afs/unified_afs.h ${TOP_INCDIR}/afs/sysctl.h case ${SYS_NAME} in \ pmax_ul43 | pmax_ul43a) \ ${INSTALL} longc_procs.h ${TOP_INCDIR}/afs ;; \ esac -kinstall: ${KERNELDIR}/afs AFS_component_version_number.c afs_trace.h afszcm.cat - -chmod 666 ${KERNELDIR}/afs/* - ${INSTALL} *.[csh] ${KERNELDIR}/afs - ${INSTALL} VNOPS/*.[csh] ${KERNELDIR}/afs - ${INSTALL} ${AFS_OSTYPE}/*.[csh] ${KERNELDIR}/afs +afs_trace.h afs_trace.msf: afs_trace.et + ${COMPILE_ET} -v 2 -p ${srcdir} afs_trace.et -afs_trace.h: afs_trace.et - ${COMPILE_ET} -v 2 afs_trace.et +unified_afs.c unified_afs.h: unified_afs.et + $(RM) -f unified_afs.c unified_afs.h + ${COMPILE_ET} -p ${srcdir} unified_afs -h unified_afs -# NOTE: linux case uses --new as well to work around bug in some versions of -# gencat. afszcm.cat: afs_trace.msf -$(RM) -f afszcm.cat case ${SYS_NAME} in \ @@ -64,26 +41,14 @@ afszcm.cat: afs_trace.msf gencat afszcm.cat afs_trace.msf ;; \ esac -${KERNELDIR}/afs: - mkdir -p $@ - -ukinstall: ${UKERNELDIR}/afs AFS_component_version_number.c afs_trace.h - -chmod 666 ${UKERNELDIR}/afs/* - ${INSTALL} *.[csh] ${UKERNELDIR}/afs - ${INSTALL} VNOPS/*.[csh] ${UKERNELDIR}/afs - ${INSTALL} UKERNEL/*.[csh] ${UKERNELDIR}/afs - -${UKERNELDIR}/afs: - mkdir -p $@ - -install: ${DESTDIR}${includedir}/afs/afs.h ${DESTDIR}${includedir}/afs/osi_inode.h ${DESTDIR}${includedir}/afs/afs_stats.h ${DESTDIR}${includedir}/afs/exporter.h ${DESTDIR}${includedir}/afs/nfsclient.h ${DESTDIR}${includedir}/afs/sysctl.h +install: ${DESTDIR}${includedir}/afs/afs.h ${DESTDIR}${includedir}/afs/osi_inode.h ${DESTDIR}${includedir}/afs/afs_stats.h ${DESTDIR}${includedir}/afs/exporter.h ${DESTDIR}${includedir}/afs/nfsclient.h ${DESTDIR}${includedir}/afs/unified_afs.h ${DESTDIR}${includedir}/afs/sysctl.h case ${SYS_NAME} in \ pmax_ul43 | pmax_ul43a) \ ${INSTALL} longc_procs.h ${DESTDIR}${includedir}/afs ;; \ esac case ${SYS_NAME} in \ *linux* ) \ - ${INSTALL} ${AFS_OSTYPE}/osi_vfs.h ${DESTDIR}${includedir}/afs || true ;;\ + ${INSTALL} ${MKAFS_OSTYPE}/osi_vfs.h ${DESTDIR}${includedir}/afs || true ;;\ * ) \ echo No vfs headers to install for ${SYS_NAME};; \ esac @@ -98,18 +63,27 @@ ${DEST}/include/afs/afs.h: afs.h ${DESTDIR}${includedir}/afs/afs.h: afs.h ${INSTALL} $? $@ - ${TOP_INCDIR}/afs/afs.h: afs.h ${INSTALL} $? $@ -${DEST}/include/afs/osi_inode.h: ${AFS_OSTYPE}/osi_inode.h +${DEST}/include/afs/unified_afs.h: unified_afs.h + ${INSTALL} $? $@ + +${DESTDIR}${includedir}/afs/unified_afs.h: unified_afs.h + ${INSTALL} $? $@ + +${TOP_INCDIR}/afs/unified_afs.h: unified_afs.h + ${INSTALL} $? $@ + + +${DEST}/include/afs/osi_inode.h: ${MKAFS_OSTYPE}/osi_inode.h ${INSTALL} $? $@ -${DESTDIR}${includedir}/afs/osi_inode.h: ${AFS_OSTYPE}/osi_inode.h +${DESTDIR}${includedir}/afs/osi_inode.h: ${MKAFS_OSTYPE}/osi_inode.h ${INSTALL} $? $@ -${TOP_INCDIR}/afs/osi_inode.h: ${AFS_OSTYPE}/osi_inode.h +${TOP_INCDIR}/afs/osi_inode.h: ${MKAFS_OSTYPE}/osi_inode.h ${INSTALL} $? $@ @@ -155,20 +129,20 @@ ${TOP_INCDIR}/afs/nfsclient.h: nfsclient.h ${INSTALL} $? $@ -dest: ${DEST}/include/afs/afs.h ${DEST}/include/afs/osi_inode.h ${DEST}/include/afs/afs_stats.h ${DEST}/include/afs/exporter.h ${DEST}/include/afs/nfsclient.h ${DEST}/include/afs/sysctl.h +dest: ${DEST}/include/afs/afs.h ${DEST}/include/afs/osi_inode.h ${DEST}/include/afs/afs_stats.h ${DEST}/include/afs/exporter.h ${DEST}/include/afs/nfsclient.h ${DEST}/include/afs/unified_afs.h ${DEST}/include/afs/sysctl.h case ${SYS_NAME} in \ pmax_ul43 | pmax_ul43a) \ ${INSTALL} longc_procs.h ${DEST}/include/afs ;; \ esac case ${SYS_NAME} in \ - next_mach30 | vax_ul43 | *_darwin_* | i386_fbsd* ) \ + next_mach30 | vax_ul43 | *_darwin* | i386_fbsd* ) \ echo skipping afszcm.cat install for ${SYS_NAME} ;; \ * ) \ ${INSTALL} afszcm.cat ${DEST}/root.client/usr/vice/etc/C ;; \ esac case ${SYS_NAME} in \ *linux* ) \ - ${INSTALL} ${AFS_OSTYPE}/osi_vfs.h ${DEST}/include/afs || true ;;\ + ${INSTALL} ${MKAFS_OSTYPE}/osi_vfs.h ${DEST}/include/afs || true;;\ * ) \ echo No vfs headers to install for ${SYS_NAME};; \ esac diff --git a/src/afs/NBSD/opt_posix.h b/src/afs/NBSD/opt_posix.h new file mode 100644 index 000000000..0215c63ec --- /dev/null +++ b/src/afs/NBSD/opt_posix.h @@ -0,0 +1,2 @@ +#define P1003_1B 1 +#define _KPOSIX_PRIORITY_SCHEDULING 1 diff --git a/src/afs/NBSD/osi_file.c b/src/afs/NBSD/osi_file.c new file mode 100644 index 000000000..837854479 --- /dev/null +++ b/src/afs/NBSD/osi_file.c @@ -0,0 +1,234 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +#include +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/NBSD/osi_file.c,v 1.5 2003/08/27 21:43:18 rees Exp $"); + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ + + +int afs_osicred_initialized = 0; +struct AFS_UCRED afs_osi_cred; +afs_lock_t afs_xosi; /* lock is for tvattr */ +extern struct osi_dev cacheDev; +extern struct mount *afs_cacheVfsp; + + +void * +osi_UFSOpen(afs_int32 ainode) +{ + struct inode *ip; + register struct osi_file *afile = NULL; + extern int cacheDiskType; + afs_int32 code = 0; + int dummy; + AFS_STATCNT(osi_UFSOpen); + if (cacheDiskType != AFS_FCACHE_TYPE_UFS) + osi_Panic("UFSOpen called for non-UFS cache\n"); + afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file)); + AFS_GUNLOCK(); + code = + igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t) ainode, &ip, + &dummy); + AFS_GLOCK(); + if (code) { + osi_FreeSmallSpace(afile); + osi_Panic("UFSOpen: igetinode failed"); + } + IN_UNLOCK(ip); + afile->vnode = ITOV(ip); + afile->size = VTOI(afile->vnode)->i_size; + afile->offset = 0; + afile->proc = (int (*)())0; + afile->inum = ainode; /* for hint validity checking */ + return (void *)afile; +} + +int +afs_osi_Stat(register struct osi_file *afile, register struct osi_stat *astat) +{ + register afs_int32 code; + struct vattr tvattr; + AFS_STATCNT(osi_Stat); + MObtainWriteLock(&afs_xosi, 320); + AFS_GUNLOCK(); + VOP_GETATTR(afile->vnode, &tvattr, afs_osi_credp, code); + AFS_GLOCK(); + if (code == 0) { + astat->size = tvattr.va_size; + astat->blksize = tvattr.va_blocksize; + astat->mtime = tvattr.va_mtime.tv_sec; + astat->atime = tvattr.va_atime.tv_sec; + } + MReleaseWriteLock(&afs_xosi); + return code; +} + +int +osi_UFSClose(register struct osi_file *afile) +{ + AFS_STATCNT(osi_Close); + if (afile->vnode) { + AFS_RELE(afile->vnode); + } + + osi_FreeSmallSpace(afile); + return 0; +} + +int +osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize) +{ + struct AFS_UCRED *oldCred; + struct vattr tvattr; + register afs_int32 code; + struct osi_stat tstat; + AFS_STATCNT(osi_Truncate); + + /* This routine only shrinks files, and most systems + * have very slow truncates, even when the file is already + * small enough. Check now and save some time. + */ + code = afs_osi_Stat(afile, &tstat); + if (code || tstat.size <= asize) + return code; + MObtainWriteLock(&afs_xosi, 321); + VATTR_NULL(&tvattr); + /* note that this credential swapping stuff is only necessary because + * of ufs's references directly to cred instead of to + * credentials parameter. Probably should fix ufs some day. */ + oldCred = curproc->p_cred->pc_ucred; /* remember old credentials pointer */ + curproc->p_cred->pc_ucred = afs_osi_credp; + /* temporarily use superuser credentials */ + tvattr.va_size = asize; + AFS_GUNLOCK(); + VOP_SETATTR(afile->vnode, &tvattr, afs_osi_credp, code); + AFS_GLOCK(); + curproc->p_cred->pc_ucred = oldCred; /* restore */ + MReleaseWriteLock(&afs_xosi); + return code; +} + +void +osi_DisableAtimes(struct vnode *avp) +{ + struct inode *ip = VTOI(avp); + ip->i_flag &= ~IACC; +} + + +/* Generic read interface */ +int +afs_osi_Read(register struct osi_file *afile, int offset, void *aptr, + afs_int32 asize) +{ + struct AFS_UCRED *oldCred; + unsigned int resid; + register afs_int32 code; + register afs_int32 cnt1 = 0; + AFS_STATCNT(osi_Read); + + /** + * If the osi_file passed in is NULL, panic only if AFS is not shutting + * down. No point in crashing when we are already shutting down + */ + if (!afile) { + if (!afs_shuttingdown) + osi_Panic("osi_Read called with null param"); + else + return EIO; + } + + if (offset != -1) + afile->offset = offset; + AFS_GUNLOCK(); + code = + gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset, + AFS_UIOSYS, IO_UNIT, afs_osi_credp, &resid); + AFS_GLOCK(); + if (code == 0) { + code = asize - resid; + afile->offset += code; + osi_DisableAtimes(afile->vnode); + } else { + afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid, + ICL_TYPE_INT32, code); + code = -1; + } + return code; +} + +/* Generic write interface */ +int +afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr, + afs_int32 asize) +{ + struct AFS_UCRED *oldCred; + unsigned int resid; + register afs_int32 code; + AFS_STATCNT(osi_Write); + if (!afile) + osi_Panic("afs_osi_Write called with null param"); + if (offset != -1) + afile->offset = offset; + { + struct ucred *tmpcred = curproc->p_cred->pc_ucred; + curproc->p_cred->pc_ucred = afs_osi_credp; + AFS_GUNLOCK(); + code = + gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, + afile->offset, AFS_UIOSYS, IO_UNIT, afs_osi_credp, + &resid); + AFS_GLOCK(); + curproc->p_cred->pc_ucred = tmpcred; + } + if (code == 0) { + code = asize - resid; + afile->offset += code; + } else { + code = -1; + } + if (afile->proc) { + (*afile->proc) (afile, code); + } + return code; +} + + +/* This work should be handled by physstrat in ca/machdep.c. + This routine written from the RT NFS port strategy routine. + It has been generalized a bit, but should still be pretty clear. */ +int +afs_osi_MapStrategy(int (*aproc) (), register struct buf *bp) +{ + afs_int32 returnCode; + + AFS_STATCNT(osi_MapStrategy); + returnCode = (*aproc) (bp); + + return returnCode; +} + + + +void +shutdown_osifile(void) +{ + extern int afs_cold_shutdown; + + AFS_STATCNT(shutdown_osifile); + if (afs_cold_shutdown) { + afs_osicred_initialized = 0; + } +} diff --git a/src/afs/NBSD/osi_groups.c b/src/afs/NBSD/osi_groups.c new file mode 100644 index 000000000..6ab738929 --- /dev/null +++ b/src/afs/NBSD/osi_groups.c @@ -0,0 +1,152 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* + * osi_groups.c + * + * Implements: + * Afs_xsetgroups (syscall) + * setpag + * + */ +#include +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/NBSD/osi_groups.c,v 1.3 2003/07/15 23:14:25 shadow Exp $"); + +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/afs_stats.h" /* statistics */ + +#define NOCRED ((struct ucred *) -1) +#define NOUID ((uid_t) -1) +#define NOGID ((gid_t) -1) + + +static int + afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset); + +static int + afs_setgroups(struct proc *proc, struct ucred **cred, int ngroups, + gid_t * gidset, int change_parent); + +int +Afs_xsetgroups(p, args, retval) + struct proc *p; + void *args; + int *retval; +{ + int code = 0; + struct vrequest treq; + + AFS_STATCNT(afs_xsetgroups); + AFS_GLOCK(); + + /* code = afs_InitReq(&treq, u.u_cred); */ + code = afs_InitReq(&treq, curproc->p_cred->pc_ucred); + AFS_GUNLOCK(); + if (code) + return code; + + code = setgroups(p, args, retval); + /* Note that if there is a pag already in the new groups we don't + * overwrite it with the old pag. + */ + if (PagInCred(curproc->p_cred->pc_ucred) == NOPAG) { + if (((treq.uid >> 24) & 0xff) == 'A') { + AFS_GLOCK(); + /* we've already done a setpag, so now we redo it */ + AddPag(p, treq.uid, &p->p_rcred); + AFS_GUNLOCK(); + } + } + return code; +} + + +int +setpag(proc, cred, pagvalue, newpag, change_parent) + struct proc *proc; + struct ucred **cred; + afs_uint32 pagvalue; + afs_uint32 *newpag; + afs_uint32 change_parent; +{ + gid_t gidset[NGROUPS]; + int ngroups, code; + int j; + + AFS_STATCNT(setpag); + ngroups = afs_getgroups(*cred, NGROUPS, gidset); + if (afs_get_pag_from_groups(gidset[0], gidset[1]) == NOPAG) { + /* We will have to shift grouplist to make room for pag */ + if (ngroups + 2 > NGROUPS) { + return (E2BIG); + } + for (j = ngroups - 1; j >= 0; j--) { + gidset[j + 2] = gidset[j]; + } + ngroups += 2; + } + *newpag = (pagvalue == -1 ? genpag() : pagvalue); + afs_get_groups_from_pag(*newpag, &gidset[0], &gidset[1]); + code = afs_setgroups(proc, cred, ngroups, gidset, change_parent); + return code; +} + + +static int +afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) +{ + int ngrps, savengrps; + gid_t *gp; + + AFS_STATCNT(afs_getgroups); + savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); + gp = cred->cr_groups; + while (ngrps--) + *gidset++ = *gp++; + return savengrps; +} + + + +static int +afs_setgroups(struct proc *proc, struct ucred **cred, int ngroups, + gid_t * gidset, int change_parent) +{ + int ngrps; + int i; + gid_t *gp; + struct ucred *newcr, *cr; + + AFS_STATCNT(afs_setgroups); + /* + * The real setgroups() call does this, so maybe we should too. + * + */ + if (ngroups > NGROUPS) + return EINVAL; + cr = *cred; + if (!change_parent) { + crhold(cr); + newcr = crcopy(cr); + } else + newcr = cr; + newcr->cr_ngroups = ngroups; + gp = newcr->cr_groups; + while (ngroups--) + *gp++ = *gidset++; + if (!change_parent) { + substitute_real_creds(proc, NOUID, NOUID, NOGID, NOGID, newcr); + } + *cred = newcr; + return (0); +} diff --git a/src/afs/NBSD/osi_inode.c b/src/afs/NBSD/osi_inode.c new file mode 100644 index 000000000..e22d07eb5 --- /dev/null +++ b/src/afs/NBSD/osi_inode.c @@ -0,0 +1,285 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* + * FreeBSD inode operations + * + * Implements: + * + */ +#include +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/NBSD/osi_inode.c,v 1.4 2003/07/15 23:14:25 shadow Exp $"); + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/osi_inode.h" +#include "afs/afs_stats.h" /* statistics stuff */ +#include +#include +#include +#include + +getinode(fs, dev, inode, ipp, perror) + struct mount *fs; + struct inode **ipp; + dev_t dev; + ino_t inode; + int *perror; +{ + register struct vnode *vp; + char fake_vnode[FAKE_INODE_SIZE]; + struct inode *ip; + int code; + + *ipp = 0; + *perror = 0; + if (!fs) { + register struct ufsmount *ump; + register struct vnode *vp; + register struct mount *mp; + + MOUNTLIST_LOCK(); + if (mp = TAILQ_FIRST(&mountlist)) + do { + /* + * XXX Also do the test for MFS + */ +#undef m_data +#undef m_next + if (mp->mnt_stat.f_type == MOUNT_UFS) { + MOUNTLIST_UNLOCK(); + ump = VFSTOUFS(mp); + if (ump->um_fs == NULL) + break; + if (ump->um_dev == dev) { + fs = ump->um_mountp; + } + MOUNTLIST_LOCK(); + } + mp = TAILQ_NEXT(mp, mnt_list); + } while (mp != TAILQ_FIRST(&mountlist)); + MOUNTLIST_UNLOCK(); + if (!fs) + return (ENXIO); + } + vp = (struct vnode *)fake_vnode; + fake_inode_init(vp, fs); + code = iget(VTOI(vp), inode, &ip, 0); + if (code != 0) { + *perror = BAD_IGET; + return code; + } else { + *ipp = ip; + return (0); + } +} + +igetinode(vfsp, dev, inode, ipp, perror) + struct inode **ipp; + struct mount *vfsp; + dev_t dev; + ino_t inode; + int *perror; +{ + struct inode *pip, *ip; + extern struct osi_dev cacheDev; + register int code = 0; + + *perror = 0; + + AFS_STATCNT(igetinode); + + if ((code = getinode(vfsp, dev, inode, &ip, perror)) != 0) { + return (code); + } + + if (ip->i_mode == 0) { + /* Not an allocated inode */ + iforget(ip); + return (ENOENT); + } + + if (ip->i_nlink == 0 || (ip->i_mode & IFMT) != IFREG) { + iput(ip); + return (ENOENT); + } + + *ipp = ip; + return (0); +} + +iforget(ip) + struct inode *ip; +{ + struct vnode *vp = ITOV(ip); + + AFS_STATCNT(iforget); + + VN_LOCK(vp); + /* this whole thing is too wierd. Why??? XXX */ + if (vp->v_usecount == 1) { + VN_UNLOCK(vp); + idrop(ip); + } else { + VN_UNLOCK(vp); + } +} + +/* + * icreate system call -- create an inode + */ +afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, retval) + long *retval; + long dev, near_inode, param1, param2, param3, param4; +{ + int dummy, err = 0; + struct inode *ip, *newip; + register int code; + struct vnode *vp; + + AFS_STATCNT(afs_syscall_icreate); + + if (!afs_suser()) + return (EPERM); + + code = getinode(0, (dev_t) dev, 2, &ip, &dummy); + if (code) { + return (ENOENT); + } + code = ialloc(ip, (ino_t) near_inode, 0, &newip); + iput(ip); + if (code) { + return (code); + } + IN_LOCK(newip); + newip->i_flag |= IACC | IUPD | ICHG; + + newip->i_nlink = 1; + + newip->i_mode = IFREG; + + IN_UNLOCK(newip); + vp = ITOV(newip); + VN_LOCK(vp); + vp->v_type = VREG; + VN_UNLOCK(vp); + + /* + * if ( !vp->v_object) + * { + * extern struct vfs_ubcops ufs_ubcops; + * extern struct vm_ubc_object* ubc_object_allocate(); + * struct vm_ubc_object* vop; + * vop = ubc_object_allocate(&vp, &ufs_ubcops, + * vp->v_mount->m_funnel); + * VN_LOCK(vp); + * vp->v_object = vop; + * VN_UNLOCK(vp); + * } + */ + + IN_LOCK(newip); + /* newip->i_flags |= IC_XUID|IC_XGID; */ + /* newip->i_flags &= ~IC_PROPLIST; */ + newip->i_vicep1 = param1; + if (param2 == 0x1fffffff /*INODESPECIAL*/) { + newip->i_vicep2 = ((0x1fffffff << 3) + (param4 & 0x3)); + newip->i_vicep3a = (u_short) (param3 >> 16); + newip->i_vicep3b = (u_short) param3; + } else { + newip->i_vicep2 = + (((param2 >> 16) & 0x1f) << 27) + + (((param4 >> 16) & 0x1f) << 22) + (param3 & 0x3fffff); + newip->i_vicep3a = (u_short) param4; + newip->i_vicep3b = (u_short) param2; + } + newip->i_vicemagic = VICEMAGIC; + + *retval = newip->i_number; + IN_UNLOCK(newip); + iput(newip); + return (code); +} + + +afs_syscall_iopen(dev, inode, usrmod, retval) + long *retval; + int dev, inode, usrmod; +{ + struct file *fp; + struct inode *ip; + struct vnode *vp = NULL; + int dummy; + int fd; + extern struct fileops vnops; + register int code; + + AFS_STATCNT(afs_syscall_iopen); + + if (!afs_suser()) + return (EPERM); + + code = igetinode(0, (dev_t) dev, (ino_t) inode, &ip, &dummy); + if (code) { + return (code); + } + if ((code = falloc(curproc, &fp, &fd)) != 0) { + iput(ip); + return (code); + } + IN_UNLOCK(ip); + + /* FreeBSD doesn't do much mp stuff yet :( */ + /* FP_LOCK(fp); */ + fp->f_flag = (usrmod) & FMASK; + fp->f_type = DTYPE_VNODE; + fp->f_ops = &vnops; + fp->f_data = (caddr_t) ITOV(ip); + + /* FP_UNLOCK(fp); */ + return (0); +} + + +/* + * Support for iinc() and idec() system calls--increment or decrement + * count on inode. + * Restricted to super user. + * Only VICEMAGIC type inodes. + */ +afs_syscall_iincdec(dev, inode, inode_p1, amount) + int dev, inode, inode_p1, amount; +{ + int dummy; + struct inode *ip; + register int code; + + if (!afs_suser()) + return (EPERM); + + code = igetinode(0, (dev_t) dev, (ino_t) inode, &ip, &dummy); + if (code) { + return (code); + } + if (!IS_VICEMAGIC(ip)) { + return (EPERM); + } else if (ip->i_vicep1 != inode_p1) { + return (ENXIO); + } + ip->i_nlink += amount; + if (ip->i_nlink == 0) { + CLEAR_VICEMAGIC(ip); + } + ip->i_flag |= ICHG; + iput(ip); + return (0); +} diff --git a/src/afs/NBSD/osi_inode.h b/src/afs/NBSD/osi_inode.h new file mode 100644 index 000000000..d63526c95 --- /dev/null +++ b/src/afs/NBSD/osi_inode.h @@ -0,0 +1,70 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* + * osi_inode.h + * + * Inode information required for DUX servers and salvager. + */ +#ifndef _OSI_INODE_H_ +#define _OSI_INODE_H_ + +#define BAD_IGET -1000 + +#define VICEMAGIC 0xb61cfa84 + +#define DI_VICEP3(p) \ + ( ((u_int)((p)->di_vicep3a)) << 16 | ((u_int)((p)->di_vicep3b)) ) +#define I_VICE3(p) \ + ( ((u_int)((p)->i_vicep3a)) << 16 | ((u_int)((p)->i_vicep3b)) ) + +#define FAKE_INODE_SIZE (sizeof(struct vnode)+sizeof(struct inode)) +#define MOUNTLIST_UNLOCK() simple_lock_unlock(&mountlist_slock) +#define MOUNTLIST_LOCK() simple_lock(&mountlist_slock) + +/* FreeBSD doesn't actually have a di_proplb, so we use di_spare[0] */ +#define di_proplb di_spare[0] +/* For some reason, they're called "oldids" instead of "bc_{u,g}id" */ +#define di_bcuid di_u.oldids[0] +#define di_bcgid di_u.oldids[1] + +#define i_vicemagic i_din.di_spare[0] +#define i_vicep1 i_din.di_uid +#define i_vicep2 i_din.di_gid +#define i_vicep3a i_din.di_u.oldids[0] +#define i_vicep3b i_din.di_u.oldids[1] +#define i_vicep4 i_din.di_spare[1] /* not used */ + +#define di_vicemagic di_spare[0] +#define di_vicep1 di_uid +#define di_vicep2 di_gid +#define di_vicep3a di_u.oldids[0] +#define di_vicep3b di_u.oldids[1] +#define di_vicep4 di_spare[1] /* not used */ + +/* + * Macros for handling inode numbers: + * inode number to file system block offset. + * inode number to cylinder group number. + * inode number to file system block address. + */ +#define itoo(fs, x) ((x) % INOPB(fs)) +#define itog(fs, x) ((x) / (fs)->fs_ipg) +#define itod(fs, x) \ + ((daddr_t)(cgimin(fs, itog(fs, x)) + \ + (blkstofrags((fs), (((x) % (fs)->fs_ipg) / INOPB(fs)))))) + + +#define IS_VICEMAGIC(ip) ((ip)->i_vicemagic == VICEMAGIC) +#define IS_DVICEMAGIC(dp) ((dp)->di_vicemagic == VICEMAGIC) + +#define CLEAR_VICEMAGIC(ip) (ip)->i_vicemagic = 0 +#define CLEAR_DVICEMAGIC(dp) (dp)->di_vicemagic = 0 + +#endif /* _OSI_INODE_H_ */ diff --git a/src/afs/NBSD/osi_machdep.h b/src/afs/NBSD/osi_machdep.h new file mode 100644 index 000000000..b0c044266 --- /dev/null +++ b/src/afs/NBSD/osi_machdep.h @@ -0,0 +1,91 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* + * + * DUX OSI header file. Extends afs_osi.h. + * + * afs_osi.h includes this file, which is the only way this file should + * be included in a source file. This file can redefine macros declared in + * afs_osi.h. + */ + +#ifndef _OSI_MACHDEP_H_ +#define _OSI_MACHDEP_H_ + +#include +/* #include */ +/* #include */ + +#define getpid() curproc +extern struct simplelock afs_rxglobal_lock; + +/* + * Time related macros + */ +extern struct timeval time; +#define osi_Time() (time.tv_sec) +#define afs_hz hz + +#define PAGESIZE 8192 + +#define AFS_UCRED ucred +#define AFS_PROC struct proc + +#define afs_bufferpages bufpages + +#define osi_vnhold(avc,r) do { \ + if ((avc)->vrefCount) { VN_HOLD((struct vnode *)(avc)); } \ + else osi_Panic("refcnt==0"); } while(0) + +#define gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \ + vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(unit),(cred),(aresid), curproc) + +#undef afs_suser + +#ifdef KERNEL +extern struct simplelock afs_global_lock; +#if 0 +extern thread_t afs_global_owner; +#define AFS_GLOCK() \ + do { \ + usimple_lock(&afs_global_lock); \ + osi_Assert(afs_global_owner == (thread_t)0); \ + afs_global_owner = current_thread(); \ + } while (0) +#define AFS_GUNLOCK() \ + do { \ + osi_Assert(afs_global_owner == current_thread()); \ + afs_global_owner = (thread_t)0; \ + usimple_unlock(&afs_global_lock); \ + } while(0) +#define ISAFS_GLOCK() (afs_global_owner == current_thread()) +#else +#define AFS_GLOCK() \ + do { \ + simple_lock(&afs_global_lock); \ + } while (0) +#define AFS_GUNLOCK() \ + do { \ + simple_unlock(&afs_global_lock); \ + } while(0) +#endif /* 0 */ +#define AFS_RXGLOCK() +#define AFS_RXGUNLOCK() +#define ISAFS_RXGLOCK() 1 + +#undef SPLVAR +#define SPLVAR +#undef NETPRI +#define NETPRI +#undef USERPRI +#define USERPRI +#endif /* KERNEL */ + +#endif /* _OSI_MACHDEP_H_ */ diff --git a/src/afs/NBSD/osi_misc.c b/src/afs/NBSD/osi_misc.c new file mode 100644 index 000000000..bb467eabc --- /dev/null +++ b/src/afs/NBSD/osi_misc.c @@ -0,0 +1,40 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* + * osi_misc.c + * + * Implements: + * afs_suser + */ + +#include +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/NBSD/osi_misc.c,v 1.3 2003/07/15 23:14:25 shadow Exp $"); + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ + +/* + * afs_suser() returns true if the caller is superuser, false otherwise. + * + * Note that it must NOT set errno. + */ + +afs_suser() +{ + int error; + + if (suser(curproc) == 0) { + return (1); + } + return (0); +} diff --git a/src/afs/NBSD/osi_sleep.c b/src/afs/NBSD/osi_sleep.c new file mode 100644 index 000000000..7c212c1f1 --- /dev/null +++ b/src/afs/NBSD/osi_sleep.c @@ -0,0 +1,205 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + + +#include +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/NBSD/osi_sleep.c,v 1.6 2003/07/15 23:14:25 shadow Exp $"); + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ + + + +static int osi_TimedSleep(char *event, afs_int32 ams, int aintok); +static char waitV; + + +void +afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) +{ + AFS_STATCNT(osi_InitWaitHandle); + achandle->proc = (caddr_t) 0; +} + +/* cancel osi_Wait */ +void +afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) +{ + caddr_t proc; + + AFS_STATCNT(osi_CancelWait); + proc = achandle->proc; + if (proc == 0) + return; + achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ + afs_osi_Wakeup(&waitV); +} + +/* afs_osi_Wait + * Waits for data on ahandle, or ams ms later. ahandle may be null. + * Returns 0 if timeout and EINTR if signalled. + */ +int +afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) +{ + int code; + afs_int32 endTime, tid; + + AFS_STATCNT(osi_Wait); + endTime = osi_Time() + (ams / 1000); + if (ahandle) + ahandle->proc = (caddr_t) curproc; + do { + AFS_ASSERT_GLOCK(); + code = 0; + code = osi_TimedSleep(&waitV, ams, aintok); + + if (code) + break; /* if something happened, quit now */ + /* if we we're cancelled, quit now */ + if (ahandle && (ahandle->proc == (caddr_t) 0)) { + /* we've been signalled */ + break; + } + } while (osi_Time() < endTime); + return code; +} + + + + +typedef struct afs_event { + struct afs_event *next; /* next in hash chain */ + char *event; /* lwp event: an address */ + int refcount; /* Is it in use? */ + int seq; /* Sequence number: this is incremented + * by wakeup calls; wait will not return until + * it changes */ + int cond; +} afs_event_t; + +#define HASHSIZE 128 +afs_event_t *afs_evhasht[HASHSIZE]; /* Hash table for events */ +#define afs_evhash(event) (afs_uint32) ((((long)event)>>2) & (HASHSIZE-1)); +int afs_evhashcnt = 0; + +/* Get and initialize event structure corresponding to lwp event (i.e. address) + * */ +static afs_event_t * +afs_getevent(char *event) +{ + afs_event_t *evp, *newp = 0; + int hashcode; + + AFS_ASSERT_GLOCK(); + hashcode = afs_evhash(event); + evp = afs_evhasht[hashcode]; + while (evp) { + if (evp->event == event) { + evp->refcount++; + return evp; + } + if (evp->refcount == 0) + newp = evp; + evp = evp->next; + } + if (!newp) { + newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t)); + afs_evhashcnt++; + newp->next = afs_evhasht[hashcode]; + afs_evhasht[hashcode] = newp; + newp->seq = 0; + } + newp->event = event; + newp->refcount = 1; + return newp; +} + +/* Release the specified event */ +#define relevent(evp) ((evp)->refcount--) + + +void +afs_osi_Sleep(void *event) +{ + struct afs_event *evp; + int seq; + + evp = afs_getevent(event); + seq = evp->seq; + while (seq == evp->seq) { + AFS_ASSERT_GLOCK(); + assert_wait((vm_offset_t) (&evp->cond), 0); + AFS_GUNLOCK(); + thread_block(); + AFS_GLOCK(); + } + relevent(evp); +} + +int +afs_osi_SleepSig(void *event) +{ + afs_osi_Sleep(event); + return 0; +} + +/* osi_TimedSleep + * + * Arguments: + * event - event to sleep on + * ams --- max sleep time in milliseconds + * aintok - 1 if should sleep interruptibly + * + * Returns 0 if timeout and EINTR if signalled. + */ +static int +osi_TimedSleep(char *event, afs_int32 ams, int aintok) +{ + int code = 0; + struct afs_event *evp; + int ticks; + + ticks = (ams * afs_hz) / 1000; + + + evp = afs_getevent(event); + + assert_wait((vm_offset_t) (&evp->cond), aintok); + AFS_GUNLOCK(); + thread_set_timeout(ticks); + thread_block(); + AFS_GLOCK(); + /* if (current_thread()->wait_result != THREAD_AWAKENED) + * code = EINTR; */ + + relevent(evp); + return code; +} + + +int +afs_osi_Wakeup(void *event) +{ + int ret = 1; + struct afs_event *evp; + + evp = afs_getevent(event); + if (evp->refcount > 1) { + evp->seq++; + thread_wakeup((vm_offset_t) (&evp->cond)); + ret = 0; + } + relevent(evp); + return ret; +} diff --git a/src/afs/NBSD/osi_vfsops.c b/src/afs/NBSD/osi_vfsops.c new file mode 100644 index 000000000..aff36a950 --- /dev/null +++ b/src/afs/NBSD/osi_vfsops.c @@ -0,0 +1,500 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* + * osi_vfsops.c for DUX + */ +#include +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/NBSD/osi_vfsops.c,v 1.8 2003/07/15 23:14:25 shadow Exp $"); + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics stuff */ +#include +#include +#include +#include +#include +#include +#include +#include + + +struct vcache *afs_globalVp = 0; +struct mount *afs_globalVFS = 0; + +static u_char afs_mntid; +int afs_vfsdev = 0; +udecl_simple_lock_data(, afsmntid_lock) +#define AFSMNTID_LOCK() usimple_lock(&afsmntid_lock) +#define AFSMNTID_UNLOCK() usimple_unlock(&afsmntid_lock) +#define AFSMNTID_LOCK_INIT() usimple_lock_init(&afsmntid_lock) + int mp_afs_mount(struct mount *afsp, char *path, caddr_t data, + struct nameidata *ndp) +{ + u_int size; + + fsid_t tfsid; + struct mount *xmp, *getvfs(); + int code; + + AFS_GLOCK(); + AFS_STATCNT(afs_mount); + + if (afs_globalVFS) { /* Don't allow remounts. */ + AFS_GUNLOCK(); + return (EBUSY); + } + + afs_globalVFS = afsp; + afsp->vfs_bsize = 8192; +/* + * Generate a unique afs mount i.d. ( see nfs_mount() ). + */ + afsp->m_stat.f_fsid.val[0] = makedev(130, 0); + afsp->m_stat.f_fsid.val[1] = MOUNT_AFS; + AFSMNTID_LOCK(); + if (++afs_mntid == 0) + ++afs_mntid; + AFSMNTID_UNLOCK(); + BM(AFSMNTID_LOCK()); + tfsid.val[0] = makedev(130, afs_mntid); + tfsid.val[1] = MOUNT_AFS; + BM(AFSMNTID_UNLOCK()); + + while (xmp = getvfs(&tfsid)) { + UNMOUNT_READ_UNLOCK(xmp); + tfsid.val[0]++; + AFSMNTID_LOCK(); + afs_mntid++; + AFSMNTID_UNLOCK(); + } + if (major(tfsid.val[0]) != 130) { + AFS_GUNLOCK(); + return (ENOENT); + } + afsp->m_stat.f_fsid.val[0] = tfsid.val[0]; + + afsp->m_stat.f_mntonname = AFS_KALLOC(MNAMELEN); + afsp->m_stat.f_mntfromname = AFS_KALLOC(MNAMELEN); + if (!afsp->m_stat.f_mntonname || !afsp->m_stat.f_mntfromname) + panic("malloc failure in afs_mount\n"); + + memset(afsp->m_stat.f_mntonname, 0, MNAMELEN); + memset(afsp->m_stat.f_mntfromname, 0, MNAMELEN); + AFS_COPYINSTR(path, (caddr_t) afsp->m_stat.f_mntonname, MNAMELEN, &size, + code); + memcpy(afsp->m_stat.f_mntfromname, "AFS", 4); + AFS_GUNLOCK(); + (void)mp_afs_statfs(afsp); + AFS_GLOCK(); + afs_vfsdev = afsp->m_stat.f_fsid.val[0]; + +#ifndef AFS_NONFSTRANS + /* Set up the xlator in case it wasn't done elsewhere */ + afs_xlatorinit_v2(); + afs_xlatorinit_v3(); +#endif + AFS_GUNLOCK(); + return 0; +} + + +int +mp_afs_unmount(struct mount *afsp, int flag) +{ + AFS_GLOCK(); + AFS_STATCNT(afs_unmount); + afs_globalVFS = 0; + afs_shutdown(); + AFS_GUNLOCK(); + return 0; +} + + +int +mp_afs_start(struct mount *mp, int flags) +{ + return (0); +} + +int +mp_afs_root(struct mount *afsp, struct vnode **avpp) +{ + register afs_int32 code = 0; + struct vrequest treq; + register struct vcache *tvp = 0; + + AFS_GLOCK(); + AFS_STATCNT(afs_root); + if (afs_globalVp && (afs_globalVp->states & CStatd)) { + tvp = afs_globalVp; + } else { + if (afs_globalVp) { + afs_PutVCache(afs_globalVp); + afs_globalVp = NULL; + } + + if (!(code = afs_InitReq(&treq, cred)) && !(code = afs_CheckInit())) { + tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL); + /* we really want this to stay around */ + if (tvp) { + afs_globalVp = tvp; + } else + code = ENOENT; + } + } + if (tvp) { + AFS_GUNLOCK(); + VN_HOLD((struct vnode *)tvp); + VN_LOCK((struct vnode *)tvp); + tvp->v.v_flag |= VROOT; /* No-op on Ultrix 2.2 */ + VN_UNLOCK((struct vnode *)tvp); + AFS_GLOCK(); + + afs_globalVFS = afsp; + *avpp = (struct vnode *)tvp; + } + + afs_Trace2(afs_iclSetp, CM_TRACE_VFSROOT, ICL_TYPE_POINTER, *avpp, + ICL_TYPE_INT32, code); + AFS_GUNLOCK(); + return code; +} + + +mp_afs_quotactl(struct mount * mp, int cmd, uid_t uid, caddr_t arg) +{ + return EOPNOTSUPP; +} + +int +mp_afs_statfs(struct mount *afsp) +{ + struct nstatfs *abp = &afsp->m_stat; + + AFS_GLOCK(); + AFS_STATCNT(afs_statfs); + + abp->f_type = MOUNT_AFS; + abp->f_bsize = afsp->vfs_bsize; + + /* Fake a high number below to satisfy programs that use the statfs call + * to make sure that there's enough space in the device partition before + * storing something there. + */ + abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files = + abp->f_ffree = 2000000; + abp->f_fsize = 1024; + + abp->f_fsid.val[0] = afsp->m_stat.f_fsid.val[0]; + abp->f_fsid.val[1] = afsp->m_stat.f_fsid.val[1]; + + AFS_GUNLOCK(); + return 0; +} + + +int +mp_afs_sync(struct mount *mp, int flags) +{ + AFS_STATCNT(afs_sync); + return 0; +} + + +int +mp_afs_fhtovp(struct mount *afsp, struct fid *fidp, struct vnode **avcp) +{ + struct vrequest treq; + register code = 0; + + AFS_GLOCK(); + AFS_STATCNT(afs_vget); + + *avcp = NULL; + + if ((code = afs_InitReq(&treq, cred)) == 0) { + code = afs_osi_vget((struct vcache **)avcp, fidp, &treq); + } + + afs_Trace3(afs_iclSetp, CM_TRACE_VGET, ICL_TYPE_POINTER, *avcp, + ICL_TYPE_INT32, treq.uid, ICL_TYPE_FID, fidp); + + code = afs_CheckCode(code, &treq, 42); + AFS_GUNLOCK(); + return code; +} + + +/* + * afs_vptofh + * + * afs_vptofh can return two flavors of NFS fid, depending on if submounts are + * allowed. The reason for this is that we can't guarantee that we found all + * the entry points any OS might use to get the fid for the NFS mountd. + * Hence we return a "magic" fid for all but /afs. If it goes through the + * translator code, it will get transformed into a SmallFid that we recognize. + * So, if submounts are disallowed, and an NFS client tries a submount, it will + * get a fid which we don't recognize and the mount will either fail or we + * will ignore subsequent requests for that mount. + * + * The Alpha fid is organized differently than for other platforms. Their + * intention was to have the data portion of the fid aligned on a 4 byte + * boundary. To do so, the fid is organized as: + * u_short reserved + * u_short len + * char data[8] + * The len field is the length of the entire fid, from reserved through data. + * This length is used by fid_copy to include copying the reserved field. + * Alpha's zero the reserved field before handing us the fid, but they use + * it in fid_cmp. We use the reserved field to store the 16 bits of the Vnode. + * + * Note that the SmallFid only allows for 8 bits of the cell index and + * 16 bits of the vnode. + */ + +#define AFS_FIDDATASIZE 8 +#define AFS_SIZEOFSMALLFID 12 /* full size of fid, including len field */ +extern int afs_NFSRootOnly; /* 1 => only allow NFS mounts of /afs. */ +int afs_fid_vnodeoverflow = 0, afs_fid_uniqueoverflow = 0; + +int +mp_afs_vptofh(struct vnode *avn, struct fid *fidp) +{ + struct SmallFid Sfid; + long addr[2]; + register struct cell *tcell; + int rootvp = 0; + struct vcache *avc = VTOAFS(avn); + + AFS_GLOCK(); + AFS_STATCNT(afs_fid); + + if (afs_shuttingdown) { + AFS_GUNLOCK(); + return EIO; + } + + if (afs_NFSRootOnly && (avc == afs_globalVp)) + rootvp = 1; + if (!afs_NFSRootOnly || rootvp) { + tcell = afs_GetCell(avc->fid.Cell, READ_LOCK); + Sfid.Volume = avc->fid.Fid.Volume; + fidp->fid_reserved = avc->fid.Fid.Vnode; + Sfid.CellAndUnique = + ((tcell->cellIndex << 24) + (avc->fid.Fid.Unique & 0xffffff)); + afs_PutCell(tcell, READ_LOCK); + if (avc->fid.Fid.Vnode > 0xffff) + afs_fid_vnodeoverflow++; + if (avc->fid.Fid.Unique > 0xffffff) + afs_fid_uniqueoverflow++; + } else { + fidp->fid_reserved = AFS_XLATOR_MAGIC; + addr[0] = (long)avc; + AFS_GUNLOCK(); + VN_HOLD((struct vnode *)avc); + AFS_GLOCK(); + } + + /* Use the fid pointer passed to us. */ + fidp->fid_len = AFS_SIZEOFSMALLFID; + if (afs_NFSRootOnly) { + if (rootvp) { + memcpy(fidp->fid_data, (caddr_t) & Sfid, AFS_FIDDATASIZE); + } else { + memcpy(fidp->fid_data, (caddr_t) addr, AFS_FIDDATASIZE); + } + } else { + memcpy(fidp->fid_data, (caddr_t) & Sfid, AFS_FIDDATASIZE); + } + AFS_GUNLOCK(); + return 0; +} + + +int mp_Afs_init(void); /* vfs_init - defined below */ + + +/* This is only called by vfs_mount when afs is going to be mounted as root. + * Since we don't support diskless clients we shouldn't come here. + */ +int afsmountroot = 0; +int +mp_afs_mountroot(struct mount *afsp, struct vnode **vp) +{ + AFS_GLOCK(); + AFS_STATCNT(afs_mountroot); + afsmountroot++; + AFS_GUNLOCK(); + return EINVAL; +} + + +/* It's called to setup swapping over the net for diskless clients; again + * not for us. + */ +int afsswapvp = 0; +int +mp_afs_swapvp(void) +{ + AFS_GLOCK(); + AFS_STATCNT(afs_swapvp); + afsswapvp++; + AFS_GUNLOCK(); + return EINVAL; +} + + +struct vfsops afs_vfsops = { + mp_afs_mount, + mp_afs_start, + mp_afs_unmount, + mp_afs_root, + mp_afs_quotactl, + mp_afs_statfs, + mp_afs_sync, + mp_afs_fhtovp, /* afs_vget */ + mp_afs_vptofh, + mp_Afs_init, + mp_afs_mountroot, + mp_afs_swapvp +}; + + +/* + * System Call Entry Points + */ +#define NULL_FUNC (int (*)(int))0 + +int (*afs_syscall_func) () = NULL_FUNC; +int (*afs_xsetgroups_func) () = NULL_FUNC; +int (*afs_xioctl_func) () = NULL_FUNC; + +afssyscall(p, args, retval) + struct proc *p; + void *args; + long *retval; +{ + int (*func) (); + int code; + + AFS_GLOCK(); + func = afs_syscall_func; + if (func == NULL_FUNC) { + code = nosys(p, args, retval); + } else { + code = (*func) (p, args, retval); + } + AFS_GUNLOCK(); + return code; +} + +afsxsetgroups(p, args, retval) + struct proc *p; + void *args; + long *retval; +{ + int (*func) (); + int code; + + AFS_GLOCK(); + func = afs_xsetgroups_func; + if (func == NULL_FUNC) { + code = nosys(p, args, retval); + } else { + code = (*func) (p, args, retval); + } + AFS_GUNLOCK(); + return code; +} + +afsxioctl(p, args, retval) + struct proc *p; + void *args; + long *retval; +{ + int (*func) (); + int code; + + AFS_GLOCK(); + func = afs_xioctl_func; + if (func == NULL_FUNC) { + code = nosys(p, args, retval); + } else { + code = (*func) (p, args, retval); + } + AFS_GUNLOCK(); + return code; +} + + +/* + * VFS initialization and unload + */ + +afs_unconfig() +{ + return EBUSY; +} + + +cfg_subsys_attr_t afs_attributes[] = { + {"", 0, 0, 0, 0, 0, 0} /* must be the last element */ +}; + +afs_configure(cfg_op_t op, caddr_t indata, size_t indata_size, + caddr_t outdata, size_t outdata_size) +{ + cfg_attr_t *attributes; + int ret = ESUCCESS; + int i, j, size; + caddr_t p; + + switch (op) { + case CFG_OP_CONFIGURE: + /* + * The indata parameter is a list of attributes to be configured, and + * indata_size is the count of attributes. + */ + if ((ret = vfssw_add_fsname(MOUNT_AFS, &afs_vfsops, "afs")) != 0) + return (ret); + break; + case CFG_OP_UNCONFIGURE: + if ((ret = afs_unconfig()) != 0) + return (ret); + break; + default: + ret = EINVAL; + break; + } + return ret; +} + + +int +mp_Afs_init(void) +{ + extern int Afs_xsetgroups(), afs_xioctl(), afs3_syscall(); + + AFS_GLOCK(); + sysent[AFS_SYSCALL].sy_call = afs3_syscall; + sysent[AFS_SYSCALL].sy_parallel = 0; + sysent[AFS_SYSCALL].sy_narg = 6; + sysent[SYS_setgroups].sy_call = Afs_xsetgroups; + afs_xioctl_func = afsxioctl; + afs_xsetgroups_func = afsxsetgroups; + afs_syscall_func = afssyscall; + AFS_GUNLOCK(); + + return 0; +} diff --git a/src/afs/NBSD/osi_vm.c b/src/afs/NBSD/osi_vm.c new file mode 100644 index 000000000..b9d914d5f --- /dev/null +++ b/src/afs/NBSD/osi_vm.c @@ -0,0 +1,204 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + + +/* osi_vm.c implements: + * + * osi_VM_FlushVCache(avc, slept) + * osi_ubc_flush_dirty_and_wait(vp, flags) + * osi_VM_StoreAllSegments(avc) + * osi_VM_TryToSmush(avc, acred, sync) + * osi_VM_FlushPages(avc, credp) + * osi_VM_Truncate(avc, alen, acred) + */ + +#include +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/NBSD/osi_vm.c,v 1.4 2003/07/15 23:14:25 shadow Exp $"); + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +/* #include */ +#include +#include + +/* Try to discard pages, in order to recycle a vcache entry. + * + * We also make some sanity checks: ref count, open count, held locks. + * + * We also do some non-VM-related chores, such as releasing the cred pointer + * (for AIX and Solaris) and releasing the gnode (for AIX). + * + * Locking: afs_xvcache lock is held. If it is dropped and re-acquired, + * *slept should be set to warn the caller. + * + * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it + * is not dropped and re-acquired for any platform. It may be that *slept is + * therefore obsolescent. + * + * OSF/1 Locking: VN_LOCK has been called. + */ +int +osi_VM_FlushVCache(struct vcache *avc, int *slept) +{ +#ifdef SECRETLY_OSF1 + if (avc->vrefCount > 1) + return EBUSY; + + if (avc->opens) + return EBUSY; + + /* if a lock is held, give up */ + if (CheckLock(&avc->lock) || afs_CheckBozonLock(&avc->pvnLock)) + return EBUSY; + + AFS_GUNLOCK(); + ubc_invalidate(((struct vnode *)avc)->v_object, 0, 0, B_INVAL); + AFS_GLOCK(); +#endif /* SECRETLY_OSF1 */ + + return 0; +} + +/* + * osi_ubc_flush_dirty_and_wait -- ensure all dirty pages cleaned + * + * Alpha OSF/1 doesn't make it easy to wait for all dirty pages to be cleaned. + * NFS tries to do this by calling waitforio(), which waits for v_numoutput + * to go to zero. But that isn't good enough, because afs_putpage() doesn't + * increment v_numoutput until it has obtained the vcache entry lock. Suppose + * that Process A, trying to flush a page, is waiting for that lock, and + * Process B tries to close the file. Process B calls waitforio() which thinks + * that everything is cool because v_numoutput is still zero. Process B then + * proceeds to call afs_StoreAllSegments(). Finally when B is finished, A gets + * to proceed and flush its page. But then it's too late because the file is + * already closed. + * + * (I suspect that waitforio() is not adequate for NFS, just as it isn't + * adequate for us. But that's not my problem.) + * + * The only way we can be sure that there are no more dirty pages is if there + * are no more pages with pg_busy set. We look for them on the cleanpl. + * + * For some reason, ubc_flush_dirty() only looks at the dirtypl, not the + * dirtywpl. I don't know why this is good enough, but I assume it is. By + * the same token, I only look for busy pages on the cleanpl, not the cleanwpl. + * + * Called with the global lock NOT held. + */ +static void +osi_ubc_flush_dirty_and_wait(struct vnode *vp, int flags) +{ + int retry; + vm_page_t pp; + int first; + +#ifdef SECRETLY_OSF1 + do { + struct vm_ubc_object *vop; + vop = (struct vm_ubc_object *)(vp->v_object); + ubc_flush_dirty(vop, flags); + + vm_object_lock(vop); + if (vop->vu_dirtypl) + /* shouldn't happen, but who knows */ + retry = 1; + else { + retry = 0; + if (vop->vu_cleanpl) { + for (first = 1, pp = vop->vu_cleanpl; + first || pp != vop->vu_cleanpl; + first = 0, pp = pp->pg_onext) { + if (pp->pg_busy) { + retry = 1; + pp->pg_wait = 1; + assert_wait_mesg((vm_offset_t) pp, FALSE, "pg_wait"); + vm_object_unlock(vop); + thread_block(); + break; + } + } + } + if (retry) + continue; + } + vm_object_unlock(vop); + } while (retry); +#endif /* SECRETLY_OSF1 */ +} + +/* Try to store pages to cache, in order to store a file back to the server. + * + * Locking: the vcache entry's lock is held. It will usually be dropped and + * re-obtained. + */ +void +osi_VM_StoreAllSegments(struct vcache *avc) +{ +#ifdef SECRETLY_OSF1 + ReleaseWriteLock(&avc->lock); + AFS_GUNLOCK(); + osi_ubc_flush_dirty_and_wait((struct vnode *)avc, 0); + AFS_GLOCK(); + ObtainWriteLock(&avc->lock, 94); +#endif /* SECRETLY_OSF1 */ +} + +/* Try to invalidate pages, for "fs flush" or "fs flushv"; or + * try to free pages, when deleting a file. + * + * Locking: the vcache entry's lock is held. It may be dropped and + * re-obtained. + * + * Since we drop and re-obtain the lock, we can't guarantee that there won't + * be some pages around when we return, newly created by concurrent activity. + */ +void +osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync) +{ +#ifdef SECRETLY_OSF1 + ReleaseWriteLock(&avc->lock); + AFS_GUNLOCK(); + osi_ubc_flush_dirty_and_wait((struct vnode *)avc, 0); + ubc_invalidate(((struct vnode *)avc)->v_object, 0, 0, B_INVAL); + AFS_GLOCK(); + ObtainWriteLock(&avc->lock, 59); +#endif /* SECRETLY_OSF1 */ +} + +/* Purge VM for a file when its callback is revoked. + * + * Locking: No lock is held, not even the global lock. + */ +void +osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) +{ +#ifdef SECRETLY_OSF1 + ubc_flush_dirty(((struct vnode *)avc)->v_object, 0); + ubc_invalidate(((struct vnode *)avc)->v_object, 0, 0, B_INVAL); +#endif /* SECRETLY_OSF1 */ +} + +/* Purge pages beyond end-of-file, when truncating a file. + * + * Locking: no lock is held, not even the global lock. + * activeV is raised. This is supposed to block pageins, but at present + * it only works on Solaris. + */ +void +osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) +{ +#ifdef SECRETLY_OSF1 + ubc_invalidate(((struct vnode *)avc)->v_object, alen, MAXINT - alen, + B_INVAL); +#endif /* SECRETLY_OSF1 */ +} diff --git a/src/afs/NBSD/osi_vnodeops.c b/src/afs/NBSD/osi_vnodeops.c new file mode 100644 index 000000000..ee222761e --- /dev/null +++ b/src/afs/NBSD/osi_vnodeops.c @@ -0,0 +1,1108 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* + * vnodeops structure and Digital Unix specific ops and support routines. + */ + +#include +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/NBSD/osi_vnodeops.c,v 1.5 2003/07/15 23:14:25 shadow Exp $"); + + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include +#include +#include +/* #include */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" + + +extern int afs_lookup(), afs_create(), afs_noop(), afs_open(), afs_close(); +extern int afs_access(), afs_getattr(), afs_setattr(), afs_badop(); +extern int afs_fsync(), afs_seek(), afs_remove(), afs_link(), afs_rename(); +extern int afs_mkdir(), afs_rmdir(), afs_symlink(), afs_readdir(); +extern int afs_readlink(), afs_lockctl(); +extern int vn_pathconf_default(), seltrue(); + +int mp_afs_lookup(), mp_afs_create(), mp_afs_open(); +int mp_afs_access(), mp_afs_getattr(), mp_afs_setattr(), mp_afs_ubcrdwr(); +int mp_afs_ubcrdwr(), mp_afs_mmap(); +int mp_afs_fsync(), mp_afs_seek(), mp_afs_remove(), mp_afs_link(); +int mp_afs_rename(), mp_afs_mkdir(), mp_afs_rmdir(), mp_afs_symlink(); +int mp_afs_readdir(), mp_afs_readlink(), mp_afs_abortop(), mp_afs_inactive(); +int mp_afs_reclaim(), mp_afs_bmap(), mp_afs_strategy(), mp_afs_print(); +int mp_afs_page_read(), mp_afs_page_write(), mp_afs_swap(), mp_afs_bread(); +int mp_afs_brelse(), mp_afs_lockctl(), mp_afs_syncdata(), mp_afs_close(); +int mp_afs_closex(); + +#if 0 +/* AFS vnodeops */ +struct vnodeops Afs_vnodeops = { + mp_afs_lookup, + mp_afs_create, + afs_noop, /* vn_mknod */ + mp_afs_open, + mp_afs_close, + mp_afs_access, + mp_afs_getattr, + mp_afs_setattr, + mp_afs_ubcrdwr, + mp_afs_ubcrdwr, + afs_badop, /* vn_ioctl */ + seltrue, /* vn_select */ + mp_afs_mmap, + mp_afs_fsync, + mp_afs_seek, + mp_afs_remove, + mp_afs_link, + mp_afs_rename, + mp_afs_mkdir, + mp_afs_rmdir, + mp_afs_symlink, + mp_afs_readdir, + mp_afs_readlink, + mp_afs_abortop, + mp_afs_inactive, + mp_afs_reclaim, + mp_afs_bmap, + mp_afs_strategy, + mp_afs_print, + mp_afs_page_read, + mp_afs_page_write, + mp_afs_swap, + mp_afs_bread, + mp_afs_brelse, + mp_afs_lockctl, + mp_afs_syncdata, + afs_noop, /* Lock */ + afs_noop, /* unLock */ + afs_noop, /* get ext attrs */ + afs_noop, /* set ext attrs */ + afs_noop, /* del ext attrs */ + vn_pathconf_default, +}; +struct vnodeops *afs_ops = &Afs_vnodeops; +#endif /* 0 */ + +/* vnode file operations, and our own */ +extern int vn_read(); +extern int vn_write(); +extern int vn_ioctl(); +extern int vn_select(); +extern int afs_closex(); + +struct fileops afs_fileops = { + vn_read, + vn_write, + vn_ioctl, + vn_select, + mp_afs_closex, +}; + +#if 0 +mp_afs_lookup(adp, ndp) + struct vcache *adp; + struct nameidata *ndp; +{ + int code; + AFS_GLOCK(); + code = afs_lookup(adp, ndp); + AFS_GUNLOCK(); + return code; +} + +mp_afs_create(ndp, attrs) + struct nameidata *ndp; + struct vattr *attrs; +{ + int code; + AFS_GLOCK(); + code = afs_create(ndp, attrs); + AFS_GUNLOCK(); + return code; +} + +mp_afs_open(avcp, aflags, acred) + struct vcache **avcp; + afs_int32 aflags; + struct AFS_UCRED *acred; +{ + int code; + AFS_GLOCK(); + code = afs_open(avcp, aflags, acred); + AFS_GUNLOCK(); + return code; +} + +mp_afs_access(avc, amode, acred) + struct vcache *avc; + afs_int32 amode; + struct AFS_UCRED *acred; +{ + int code; + AFS_GLOCK(); + code = afs_access(avc, amode, acred); + AFS_GUNLOCK(); + return code; +} + +mp_afs_close(avc, flags, cred) + struct vnode *avc; + int flags; + struct ucred *cred; +{ + int code; + AFS_GLOCK(); + code = afs_close(avc, flags, cred); + AFS_GUNLOCK(); + return code; +} + +mp_afs_getattr(avc, attrs, acred) + struct vcache *avc; + struct vattr *attrs; + struct AFS_UCRED *acred; +{ + int code; + AFS_GLOCK(); + code = afs_getattr(avc, attrs, acred); + AFS_GUNLOCK(); + return code; +} + +mp_afs_setattr(avc, attrs, acred) + struct vcache *avc; + struct vattr *attrs; + struct AFS_UCRED *acred; +{ + int code; + AFS_GLOCK(); + code = afs_setattr(avc, attrs, acred); + AFS_GUNLOCK(); + return code; +} + +mp_afs_fsync(avc, fflags, acred, waitfor) + struct vcache *avc; + int fflags; + struct AFS_UCRED *acred; + int waitfor; +{ + int code; + AFS_GLOCK(); + code = afs_fsync(avc, fflags, acred, waitfor); + AFS_GUNLOCK(); + return code; +} + +mp_afs_remove(ndp) + struct nameidata *ndp; +{ + int code; + AFS_GLOCK(); + code = afs_remove(ndp); + AFS_GUNLOCK(); + return code; +} + +mp_afs_link(avc, ndp) + struct vcache *avc; + struct nameidata *ndp; +{ + int code; + AFS_GLOCK(); + code = afs_link(avc, ndp); + AFS_GUNLOCK(); + return code; +} + +mp_afs_rename(fndp, tndp) + struct nameidata *fndp, *tndp; +{ + int code; + AFS_GLOCK(); + code = afs_rename(fndp, tndp); + AFS_GUNLOCK(); + return code; +} + +mp_afs_mkdir(ndp, attrs) + struct nameidata *ndp; + struct vattr *attrs; +{ + int code; + AFS_GLOCK(); + code = afs_mkdir(ndp, attrs); + AFS_GUNLOCK(); + return code; +} + +mp_afs_rmdir(ndp) + struct nameidata *ndp; +{ + int code; + AFS_GLOCK(); + code = afs_rmdir(ndp); + AFS_GUNLOCK(); + return code; +} + +mp_afs_symlink(ndp, attrs, atargetName) + struct nameidata *ndp; + struct vattr *attrs; + register char *atargetName; +{ + int code; + AFS_GLOCK(); + code = afs_symlink(ndp, attrs, atargetName); + AFS_GUNLOCK(); + return code; +} + +mp_afs_readdir(avc, auio, acred, eofp) + struct vcache *avc; + struct uio *auio; + struct AFS_UCRED *acred; + int *eofp; +{ + int code; + AFS_GLOCK(); + code = afs_readdir(avc, auio, acred, eofp); + AFS_GUNLOCK(); + return code; +} + +mp_afs_readlink(avc, auio, acred) + struct vcache *avc; + struct uio *auio; + struct AFS_UCRED *acred; +{ + int code; + AFS_GLOCK(); + code = afs_readlink(avc, auio, acred); + AFS_GUNLOCK(); + return code; +} + +mp_afs_lockctl(avc, af, flag, acred, clid, offset) + struct vcache *avc; + struct eflock *af; + struct AFS_UCRED *acred; + int flag; + pid_t clid; + off_t offset; +{ + int code; + AFS_GLOCK(); + code = afs_lockctl(avc, af, flag, acred, clid, offset); + AFS_GUNLOCK(); + return code; +} + +mp_afs_closex(afd) + struct file *afd; +{ + int code; + AFS_GLOCK(); + code = afs_closex(afd); + AFS_GUNLOCK(); + return code; +} + +mp_afs_seek(avc, oldoff, newoff, cred) + struct vcache *avc; + off_t oldoff, newoff; + struct ucred *cred; +{ + if ((int)newoff < 0) + return (EINVAL); + else + return (0); +} + +mp_afs_abortop(ndp) + struct nameidata *ndp; +{ + return (0); +} + +mp_afs_inactive(avc, acred) + register struct vcache *avc; + struct AFS_UCRED *acred; +{ + AFS_GLOCK(); + afs_InactiveVCache(avc, acred); + AFS_GUNLOCK(); +} + + +mp_afs_reclaim(avc) + struct vcache *avc; +{ + return (0); +} + +mp_afs_print(avc) + struct vcache *avc; +{ + return (0); +} + +mp_afs_page_read(avc, uio, acred) + struct vcache *avc; + struct uio *uio; + struct ucred *acred; +{ + int error; + struct vrequest treq; + + AFS_GLOCK(); + error = afs_rdwr(avc, uio, UIO_READ, 0, acred); + afs_Trace3(afs_iclSetp, CM_TRACE_PAGE_READ, ICL_TYPE_POINTER, avc, + ICL_TYPE_INT32, error, ICL_TYPE_INT32, avc->states); + if (error) { + error = EIO; + } else if ((avc->states) == 0) { + afs_InitReq(&treq, acred); + ObtainWriteLock(&avc->lock, 161); + afs_Wire(avc, &treq); + ReleaseWriteLock(&avc->lock); + } + AFS_GUNLOCK(); + return (error); +} + + +mp_afs_page_write(avc, uio, acred, pager, offset) + struct vcache *avc; + struct uio *uio; + struct ucred *acred; + memory_object_t pager; + vm_offset_t offset; +{ + int error; + + AFS_GLOCK(); + error = afs_rdwr(avc, uio, UIO_WRITE, 0, acred); + afs_Trace3(afs_iclSetp, CM_TRACE_PAGE_WRITE, ICL_TYPE_POINTER, avc, + ICL_TYPE_INT32, error, ICL_TYPE_INT32, avc->states); + if (error) { + error = EIO; + } + AFS_GUNLOCK(); + return (error); +} + + +int DO_FLUSH = 1; +mp_afs_ubcrdwr(avc, uio, ioflag, cred) + struct vcache *avc; + struct uio *uio; + int ioflag; + struct ucred *cred; +{ + register afs_int32 code; + register char *data; + afs_int32 fileBase, size, cnt = 0; + afs_int32 pageBase; + register afs_int32 tsize; + register afs_int32 pageOffset; + int eof; + struct vrequest treq; + int rw = uio->uio_rw; + int rv, flags; + int newpage = 0; + vm_page_t page; + afs_int32 save_resid; + struct dcache *tdc; + int didFakeOpen = 0; + int counter = 0; + + AFS_GLOCK(); + afs_InitReq(&treq, cred); + if (AFS_NFSXLATORREQ(cred) && rw == UIO_READ) { + if (!afs_AccessOK + (avc, PRSFS_READ, &treq, + CHECK_MODE_BITS | CMB_ALLOW_EXEC_AS_READ)) { + AFS_GUNLOCK(); + return EACCES; + } + } + afs_Trace4(afs_iclSetp, CM_TRACE_VMRW, ICL_TYPE_POINTER, avc, + ICL_TYPE_INT32, (rw == UIO_WRITE ? 1 : 0), ICL_TYPE_LONG, + uio->uio_offset, ICL_TYPE_LONG, uio->uio_resid); + code = afs_VerifyVCache(avc, &treq); + if (code) { + code = afs_CheckCode(code, &treq, 35); + AFS_GUNLOCK(); + return code; + } + if (vType(avc) != VREG) { + AFS_GUNLOCK(); + return EISDIR; /* can't read or write other things */ + } + afs_BozonLock(&avc->pvnLock, avc); + osi_FlushPages(avc); /* hold bozon lock, but not basic vnode lock */ + ObtainWriteLock(&avc->lock, 162); + /* adjust parameters when appending files */ + if ((ioflag & IO_APPEND) && uio->uio_rw == UIO_WRITE) + uio->uio_offset = avc->m.Length; /* write at EOF position */ + if (uio->uio_rw == UIO_WRITE) { + avc->states |= CDirty; + afs_FakeOpen(avc); + didFakeOpen = 1; + /* + * before starting any I/O, we must ensure that the file is big enough + * to hold the results (since afs_putpage will be called to force + * the I/O. + */ + size = uio->afsio_resid + uio->afsio_offset; /* new file size */ + if (size > avc->m.Length) + avc->m.Length = size; /* file grew */ + avc->m.Date = osi_Time(); /* Set file date (for ranlib) */ + if (uio->afsio_resid > PAGE_SIZE) + cnt = uio->afsio_resid / PAGE_SIZE; + save_resid = uio->afsio_resid; + } + + while (1) { + /* + * compute the amount of data to move into this block, + * based on uio->afsio_resid. + */ + size = uio->afsio_resid; /* transfer size */ + fileBase = uio->afsio_offset; /* start file position */ + pageBase = fileBase & ~(PAGE_SIZE - 1); /* file position of the page */ + pageOffset = fileBase & (PAGE_SIZE - 1); /* start offset within page */ + tsize = PAGE_SIZE - pageOffset; /* amount left in this page */ + /* + * we'll read tsize bytes, + * but first must make sure tsize isn't too big + */ + if (tsize > size) + tsize = size; /* don't read past end of request */ + eof = 0; /* flag telling us if we hit the EOF on the read */ + if (uio->uio_rw == UIO_READ) { /* we're doing a read operation */ + /* don't read past EOF */ + if (tsize + fileBase > avc->m.Length) { + tsize = avc->m.Length - fileBase; + eof = 1; /* we did hit the EOF */ + if (tsize < 0) + tsize = 0; /* better safe than sorry */ + } + } + if (tsize <= 0) + break; /* nothing to transfer, we're done */ + + /* Purge dirty chunks of file if there are too many dirty chunks. + * Inside the write loop, we only do this at a chunk boundary. + * Clean up partial chunk if necessary at end of loop. + */ + if (uio->uio_rw == UIO_WRITE && counter > 0 + && AFS_CHUNKOFFSET(fileBase) == 0) { + code = afs_DoPartialWrite(avc, &treq); + avc->states |= CDirty; + } + + if (code) { + break; + } + + flags = 0; + ReleaseWriteLock(&avc->lock); + AFS_GUNLOCK(); + code = + ubc_lookup(((struct vnode *)avc)->v_object, pageBase, PAGE_SIZE, + PAGE_SIZE, &page, &flags); + AFS_GLOCK(); + ObtainWriteLock(&avc->lock, 163); + + if (code) { + break; + } + if (flags & B_NOCACHE) { + /* + * No page found. We should not read the page in if + * 1. the write starts on a page edge (ie, pageoffset == 0) + * and either + * 1. we will fill the page (ie, size == PAGESIZE), or + * 2. we are writing past eof + */ + if ((uio->uio_rw == UIO_WRITE) + && + ((pageOffset == 0 + && (size == PAGE_SIZE || fileBase >= avc->m.Length)))) { + struct vnode *vp = (struct vnode *)avc; + /* we're doing a write operation past eof; no need to read it */ + newpage = 1; + AFS_GUNLOCK(); + ubc_page_zero(page, 0, PAGE_SIZE); + ubc_page_release(page, B_DONE); + AFS_GLOCK(); + } else { + /* page wasn't cached, read it in. */ + struct buf *bp; + + AFS_GUNLOCK(); + bp = ubc_bufalloc(page, 1, PAGE_SIZE, 1, B_READ); + AFS_GLOCK(); + bp->b_dev = 0; + bp->b_vp = (struct vnode *)avc; + bp->b_blkno = btodb(pageBase); + ReleaseWriteLock(&avc->lock); + code = afs_ustrategy(bp, cred); /* do the I/O */ + ObtainWriteLock(&avc->lock, 164); + AFS_GUNLOCK(); + ubc_sync_iodone(bp); + AFS_GLOCK(); + if (code) { + AFS_GUNLOCK(); + ubc_page_release(page, 0); + AFS_GLOCK(); + break; + } + } + } + AFS_GUNLOCK(); + ubc_page_wait(page); + data = (char *)page->pg_addr; /* DUX 4.0D */ + if (data == 0) + data = (char *)PHYS_TO_KSEG(page->pg_phys_addr); /* DUX 4.0E */ + AFS_GLOCK(); + ReleaseWriteLock(&avc->lock); /* uiomove may page fault */ + AFS_GUNLOCK(); + code = uiomove(data + pageOffset, tsize, uio); + ubc_unload(page, pageOffset, page_size); + if (uio->uio_rw == UIO_WRITE) { + vm_offset_t toffset; + + /* Mark the page dirty and release it to avoid a deadlock + * in ubc_dirty_kluster when more than one process writes + * this page at the same time. */ + toffset = page->pg_offset; + flags |= B_DIRTY; + ubc_page_release(page, flags); + + if (cnt > 10) { + vm_page_t pl; + int kpcnt; + struct buf *bp; + + /* We released the page, so we can get a null page + * list if another thread calls the strategy routine. + */ + pl = ubc_dirty_kluster(((struct vnode *)avc)->v_object, NULL, + toffset, 0, B_WANTED, FALSE, &kpcnt); + if (pl) { + bp = ubc_bufalloc(pl, 1, PAGE_SIZE, 1, B_WRITE); + bp->b_dev = 0; + bp->b_vp = (struct vnode *)avc; + bp->b_blkno = btodb(pageBase); + AFS_GLOCK(); + code = afs_ustrategy(bp, cred); /* do the I/O */ + AFS_GUNLOCK(); + ubc_sync_iodone(bp); + if (code) { + AFS_GLOCK(); + ObtainWriteLock(&avc->lock, 415); + break; + } + } + } + } else { + ubc_page_release(page, flags); + } + AFS_GLOCK(); + ObtainWriteLock(&avc->lock, 165); + /* + * If reading at a chunk boundary, start prefetch of next chunk. + */ + if (uio->uio_rw == UIO_READ + && (counter == 0 || AFS_CHUNKOFFSET(fileBase) == 0)) { + tdc = afs_FindDCache(avc, fileBase); + if (tdc) { + if (!(tdc->mflags & DFNextStarted)) + afs_PrefetchChunk(avc, tdc, cred, &treq); + afs_PutDCache(tdc); + } + } + counter++; + if (code) + break; + } + if (didFakeOpen) + afs_FakeClose(avc, cred); + if (uio->uio_rw == UIO_WRITE && code == 0 && (avc->states & CDirty)) { + code = afs_DoPartialWrite(avc, &treq); + } + ReleaseWriteLock(&avc->lock); + afs_BozonUnlock(&avc->pvnLock, avc); + if (DO_FLUSH || (!newpage && (cnt < 10))) { + AFS_GUNLOCK(); + ubc_flush_dirty(((struct vnode *)avc)->v_object, flags); + AFS_GLOCK(); + } + + ObtainSharedLock(&avc->lock, 409); + if (!code) { + if (avc->vc_error) { + code = avc->vc_error; + } + } + /* This is required since we may still have dirty pages after the write. + * I could just let close do the right thing, but stat's before the close + * return the wrong length. + */ + if (code == EDQUOT || code == ENOSPC) { + uio->uio_resid = save_resid; + UpgradeSToWLock(&avc->lock, 410); + osi_ReleaseVM(avc, cred); + ConvertWToSLock(&avc->lock); + } + ReleaseSharedLock(&avc->lock); + + if (!code && (ioflag & IO_SYNC) && (uio->uio_rw == UIO_WRITE) + && !AFS_NFSXLATORREQ(cred)) { + code = afs_fsync(avc, 0, cred, 0); + } + out: + code = afs_CheckCode(code, &treq, 36); + AFS_GUNLOCK(); + return code; +} + + +/* + * Now for some bad news. Since we artificially hold on to vnodes by doing + * and extra VNHOLD in afs_NewVCache(), there is no way for us to know + * when we need to flush the pages when a program exits. Particularly + * if it closes the file after mapping it R/W. + * + */ + +mp_afs_mmap(avc, offset, map, addrp, len, prot, maxprot, flags, cred) + register struct vcache *avc; + vm_offset_t offset; + vm_map_t map; + vm_offset_t *addrp; + vm_size_t len; + vm_prot_t prot; + vm_prot_t maxprot; + int flags; + struct ucred *cred; +{ + struct vp_mmap_args args; + register struct vp_mmap_args *ap = &args; + struct vnode *vp = (struct vnode *)avc; + int code; + struct vrequest treq; +#if !defined(DYNEL) + extern kern_return_t u_vp_create(); +#endif + + AFS_GLOCK(); + afs_InitReq(&treq, cred); + code = afs_VerifyVCache(avc, &treq); + if (code) { + code = afs_CheckCode(code, &treq, 37); + AFS_GUNLOCK(); + return code; + } + afs_BozonLock(&avc->pvnLock, avc); + osi_FlushPages(avc); /* ensure old pages are gone */ + afs_BozonUnlock(&avc->pvnLock, avc); + ObtainWriteLock(&avc->lock, 166); + avc->states |= CMAPPED; + ReleaseWriteLock(&avc->lock); + ap->a_offset = offset; + ap->a_vaddr = addrp; + ap->a_size = len; + ap->a_prot = prot, ap->a_maxprot = maxprot; + ap->a_flags = flags; + AFS_GUNLOCK(); + code = u_vp_create(map, vp->v_object, (vm_offset_t) ap); + AFS_GLOCK(); + code = afs_CheckCode(code, &treq, 38); + AFS_GUNLOCK(); + return code; +} + + +int +mp_afs_getpage(vop, offset, len, protp, pl, plsz, mape, addr, rw, cred) + vm_ubc_object_t vop; + vm_offset_t offset; + vm_size_t len; + vm_prot_t *protp; + vm_page_t *pl; + int plsz; + vm_map_entry_t mape; + vm_offset_t addr; + int rw; + struct ucred *cred; +{ + register afs_int32 code; + struct vrequest treq; + int flags = 0; + int i, pages = (len + PAGE_SIZE - 1) >> page_shift; + vm_page_t *pagep; + vm_offset_t off; + + struct vcache *avc = VTOAFS(vop->vu_vp); + + /* first, obtain the proper lock for the VM system */ + + AFS_GLOCK(); + afs_InitReq(&treq, cred); + code = afs_VerifyVCache(avc, &treq); + if (code) { + *pl = VM_PAGE_NULL; + code = afs_CheckCode(code, &treq, 39); /* failed to get it */ + AFS_GUNLOCK(); + return code; + } + + /* clean all dirty pages for this vnode */ + AFS_GUNLOCK(); + ubc_flush_dirty(vop, 0); + AFS_GLOCK(); + + afs_BozonLock(&avc->pvnLock, avc); + ObtainWriteLock(&avc->lock, 167); + afs_Trace4(afs_iclSetp, CM_TRACE_PAGEIN, ICL_TYPE_POINTER, avc, + ICL_TYPE_LONG, offset, ICL_TYPE_LONG, len, ICL_TYPE_INT32, + (int)rw); + for (i = 0; i < pages; i++) { + pagep = &pl[i]; + off = offset + PAGE_SIZE * i; + if (protp) + protp[i] = 0; + flags = 0; + ReleaseWriteLock(&avc->lock); + AFS_GUNLOCK(); + code = + ubc_lookup(((struct vnode *)avc)->v_object, off, PAGE_SIZE, + PAGE_SIZE, pagep, &flags); + AFS_GLOCK(); + ObtainWriteLock(&avc->lock, 168); + if (code) { + goto out; + } + if (flags & B_NOCACHE) { /* if (page) */ + if ((rw & B_WRITE) && (offset + len >= avc->m.Length)) { + struct vnode *vp = (struct vnode *)avc; + /* we're doing a write operation past eof; no need to read it */ + AFS_GUNLOCK(); + ubc_page_zero(*pagep, 0, PAGE_SIZE); + ubc_page_release(*pagep, B_DONE); + AFS_GLOCK(); + } else { + /* page wasn't cached, read it in. */ + struct buf *bp; + + AFS_GUNLOCK(); + bp = ubc_bufalloc(*pagep, 1, PAGE_SIZE, 1, B_READ); + AFS_GLOCK(); + bp->b_dev = 0; + bp->b_vp = (struct vnode *)avc; + bp->b_blkno = btodb(off); + ReleaseWriteLock(&avc->lock); + code = afs_ustrategy(bp, cred); /* do the I/O */ + ObtainWriteLock(&avc->lock, 169); + AFS_GUNLOCK(); + ubc_sync_iodone(bp); + AFS_GLOCK(); + if (code) { + AFS_GUNLOCK(); + ubc_page_release(pl[i], 0); + AFS_GLOCK(); + goto out; + } + } + } + if ((rw & B_READ) == 0) { + AFS_GUNLOCK(); + ubc_page_dirty(pl[i]); + AFS_GLOCK(); + } else { + if (protp && (flags & B_DIRTY) == 0) { + protp[i] = VM_PROT_WRITE; + } + } + } + out: + pl[i] = VM_PAGE_NULL; + ReleaseWriteLock(&avc->lock); + afs_BozonUnlock(&avc->pvnLock, avc); + afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_INT32, code, + ICL_TYPE_POINTER, *pagep, ICL_TYPE_INT32, flags); + code = afs_CheckCode(code, &treq, 40); + AFS_GUNLOCK(); + return code; +} + + +int +mp_afs_putpage(vop, pl, pcnt, flags, cred) + vm_ubc_object_t vop; + vm_page_t *pl; + int pcnt; + int flags; + struct ucred *cred; +{ + register afs_int32 code = 0; + struct vcache *avc = VTOAFS(vop->vu_vp); + struct vnode *vp = (struct vnode *)avc; + int i; + + AFS_GLOCK(); + afs_Trace4(afs_iclSetp, CM_TRACE_PAGEOUT, ICL_TYPE_POINTER, avc, + ICL_TYPE_INT32, pcnt, ICL_TYPE_INT32, vp->v_flag, + ICL_TYPE_INT32, flags); + if (flags & B_UBC) { + AFS_GUNLOCK(); + VN_LOCK(vp); + if (vp->v_flag & VXLOCK) { + VN_UNLOCK(vp); + for (i = 0; i < pcnt; i++) { + ubc_page_release(pl[i], B_DONE | B_DIRTY); + pl[i] = VM_PAGE_NULL; + } + return (0); + } else { + VN_UNLOCK(vp); + } + AFS_GLOCK(); + } + + /* first, obtain the proper lock for the VM system */ + afs_BozonLock(&avc->pvnLock, avc); + ObtainWriteLock(&avc->lock, 170); + for (i = 0; i < pcnt; i++) { + vm_page_t page = pl[i]; + struct buf *bp; + + /* write it out */ + AFS_GUNLOCK(); + bp = ubc_bufalloc(page, 1, PAGE_SIZE, 1, B_WRITE); + AFS_GLOCK(); + bp->b_dev = 0; + bp->b_vp = (struct vnode *)avc; + bp->b_blkno = btodb(page->pg_offset); + ReleaseWriteLock(&avc->lock); + code = afs_ustrategy(bp, cred); /* do the I/O */ + ObtainWriteLock(&avc->lock, 171); + AFS_GUNLOCK(); + ubc_sync_iodone(bp); + AFS_GLOCK(); + if (code) { + goto done; + } else { + pl[i] = VM_PAGE_NULL; + } + } + done: + ReleaseWriteLock(&avc->lock); + afs_BozonUnlock(&avc->pvnLock, avc); + afs_Trace2(afs_iclSetp, CM_TRACE_PAGEOUTDONE, ICL_TYPE_INT32, code, + ICL_TYPE_INT32, avc->m.Length); + AFS_GUNLOCK(); + return code; +} + + +int +mp_afs_swap(avc, swapop, argp) + struct vcache *avc; + vp_swap_op_t swapop; + vm_offset_t argp; +{ + return EIO; +} + +int +mp_afs_syncdata(avc, flag, offset, length, cred) + struct vcache *avc; + int flag; + vm_offset_t offset; + vm_size_t length; + struct ucred *cred; +{ + /* NFS V3 makes this call, ignore it. We'll sync the data in afs_fsync. */ + if (AFS_NFSXLATORREQ(cred)) + return 0; + else + return EINVAL; +} + +/* a freelist of one */ +struct buf *afs_bread_freebp = 0; + +/* + * Only rfs_read calls this, and it only looks at bp->b_un.b_addr. + * Thus we can use fake bufs (ie not from the real buffer pool). + */ +mp_afs_bread(vp, lbn, bpp, cred) + struct ucred *cred; + struct vnode *vp; + daddr_t lbn; + struct buf **bpp; +{ + int offset, fsbsize, error; + struct buf *bp; + struct iovec iov; + struct uio uio; + + AFS_GLOCK(); + AFS_STATCNT(afs_bread); + fsbsize = vp->v_vfsp->vfs_bsize; + offset = lbn * fsbsize; + if (afs_bread_freebp) { + bp = afs_bread_freebp; + afs_bread_freebp = 0; + } else { + bp = (struct buf *)AFS_KALLOC(sizeof(*bp)); + bp->b_un.b_addr = (caddr_t) AFS_KALLOC(fsbsize); + } + + iov.iov_base = bp->b_un.b_addr; + iov.iov_len = fsbsize; + uio.afsio_iov = &iov; + uio.afsio_iovcnt = 1; + uio.afsio_seg = AFS_UIOSYS; + uio.afsio_offset = offset; + uio.afsio_resid = fsbsize; + *bpp = 0; + error = afs_read(VTOAFS(vp), &uio, cred, lbn, bpp, 0); + if (error) { + afs_bread_freebp = bp; + AFS_GUNLOCK(); + return error; + } + if (*bpp) { + afs_bread_freebp = bp; + } else { + *(struct buf **)&bp->b_vp = bp; /* mark as fake */ + *bpp = bp; + } + AFS_GUNLOCK(); + return 0; +} + + +mp_afs_brelse(vp, bp) + struct vnode *vp; + struct buf *bp; +{ + AFS_GLOCK(); + AFS_STATCNT(afs_brelse); + if ((struct buf *)bp->b_vp != bp) { /* not fake */ + brelse(bp); + } else if (afs_bread_freebp) { + AFS_KFREE(bp->b_un.b_addr, vp->v_vfsp->vfs_bsize); + AFS_KFREE(bp, sizeof(*bp)); + } else { + afs_bread_freebp = bp; + } + AFS_GUNLOCK(); +} + + +mp_afs_bmap(avc, abn, anvp, anbn) + register struct vcache *avc; + afs_int32 abn, *anbn; + struct vcache **anvp; +{ + AFS_GLOCK(); + AFS_STATCNT(afs_bmap); + if (anvp) + *anvp = avc; + if (anbn) + *anbn = abn * (8192 / DEV_BSIZE); /* in 512 byte units */ + AFS_GUNLOCK(); + return 0; +} + + +/* real strategy */ +mp_afs_strategy(abp) + register struct buf *abp; +{ + register afs_int32 code; + + AFS_GLOCK(); + AFS_STATCNT(afs_strategy); + code = afs_osi_MapStrategy(afs_ustrategy, abp); + AFS_GUNLOCK(); + return code; +} + + +mp_afs_refer(vm_ubc_object_t vop) +{ + VREF(vop->vu_vp); +} + + +mp_afs_release(vm_ubc_object_t vop) +{ + vrele(vop->vu_vp); +} + + +mp_afs_write_check(vm_ubc_object_t vop, vm_page_t pp) +{ + return TRUE; +} + + + +struct vfs_ubcops afs_ubcops = { + mp_afs_refer, /* refer vnode */ + mp_afs_release, /* release vnode */ + mp_afs_getpage, /* get page */ + mp_afs_putpage, /* put page */ + mp_afs_write_check, /* check writablity */ +}; +#endif /* 0 */ + +/* + * Cover function for lookup name using OSF equivalent, namei() + * + * Note, the result vnode (ni_vp) in the namei data structure is remains + * locked after return. + */ +lookupname(namep, seg, follow, dvpp, cvpp) + char *namep; /* path name */ + int seg; /* address space containing name */ + int follow; /* follow symbolic links */ + struct vnode **dvpp; /* result, containing parent vnode */ + struct vnode **cvpp; /* result, containing final component vnode */ +{ + /* Should I use free-bee in u-area? */ + struct nameidata *ndp = &u.u_nd; + int error; + + ndp->ni_nameiop = ((follow) ? (LOOKUP | FOLLOW) : (LOOKUP)); + ndp->ni_segflg = seg; + ndp->ni_dirp = namep; + error = namei(ndp); + if (dvpp != NULL) + *dvpp = ndp->ni_dvp; + if (cvpp != NULL) + *cvpp = ndp->ni_vp; + return (error); +} diff --git a/src/afs/NTMakefile b/src/afs/NTMakefile new file mode 100644 index 000000000..281707459 --- /dev/null +++ b/src/afs/NTMakefile @@ -0,0 +1,21 @@ +# Copyright 2000, International Business Machines Corporation and others. +# All Rights Reserved. +# +# This software has been released under the terms of the IBM Public +# License. For details, see the LICENSE file in the top-level source +# directory or online at http://www.openafs.org/dl/license10.html + +!MESSAGE Processing afs\NTMakefile +RELDIR=afs +!INCLUDE ..\config\NTMakefile.$(SYS_NAME) + +################################################ +# compile_et to get unified_afs.h + +$(DESTDIR)\include\afs\unified_afs.c $(DESTDIR)\include\afs\unified_afs.h: unified_afs.et unified_afs.p.h + $(DEL) unified_afs.c unified_afs.h + $(COMPILE_ET) unified_afs -h unified_afs + $(COPY) unified_afs.h $(DESTDIR)\include\afs + +install: $(DESTDIR)\include\afs\unified_afs.c + diff --git a/src/afs/OBSD/osi_file.c b/src/afs/OBSD/osi_file.c new file mode 100644 index 000000000..a7aa9153c --- /dev/null +++ b/src/afs/OBSD/osi_file.c @@ -0,0 +1,229 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +#include +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/OBSD/osi_file.c,v 1.10 2004/03/10 23:01:52 rees Exp $"); + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ + + +int afs_osicred_initialized; +struct AFS_UCRED afs_osi_cred; +afs_lock_t afs_xosi; /* lock is for tvattr */ +extern struct osi_dev cacheDev; +extern struct mount *afs_cacheVfsp; + + +void * +osi_UFSOpen(afs_int32 ainode) +{ + struct osi_file *afile; + struct vnode *vp; + extern int cacheDiskType; + afs_int32 code; + + AFS_STATCNT(osi_UFSOpen); + if (cacheDiskType != AFS_FCACHE_TYPE_UFS) + osi_Panic("UFSOpen called for non-UFS cache\n"); + afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file)); + AFS_GUNLOCK(); + code = VFS_VGET(cacheDev.mp, (ino_t) ainode, &vp); + AFS_GLOCK(); + if (code == 0 && vp->v_type == VNON) + code = ENOENT; + if (code) { + osi_FreeSmallSpace(afile); + osi_Panic("UFSOpen: igetinode failed"); + } + VOP_UNLOCK(vp, 0, curproc); + afile->vnode = vp; + afile->size = VTOI(vp)->i_ffs_size; + afile->offset = 0; + afile->proc = NULL; + afile->inum = ainode; /* for hint validity checking */ + return (void *)afile; +} + +int +afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat) +{ + afs_int32 code; + struct vattr tvattr; + + AFS_STATCNT(osi_Stat); + MObtainWriteLock(&afs_xosi, 320); + AFS_GUNLOCK(); + code = VOP_GETATTR(afile->vnode, &tvattr, afs_osi_credp, curproc); + AFS_GLOCK(); + if (code == 0) { + astat->size = afile->size = tvattr.va_size; + astat->blksize = tvattr.va_blocksize; + astat->mtime = tvattr.va_mtime.tv_sec; + astat->atime = tvattr.va_atime.tv_sec; + } + MReleaseWriteLock(&afs_xosi); + return code; +} + +int +osi_UFSClose(struct osi_file *afile) +{ + AFS_STATCNT(osi_Close); + + if (afile->vnode) + AFS_RELE(afile->vnode); + + osi_FreeSmallSpace(afile); + return 0; +} + +int +osi_UFSTruncate(struct osi_file *afile, afs_int32 asize) +{ + struct vattr tvattr; + afs_int32 code; + struct osi_stat tstat; + + AFS_STATCNT(osi_Truncate); + + /* + * This routine only shrinks files, and most systems + * have very slow truncates, even when the file is already + * small enough. Check now and save some time. + */ + code = afs_osi_Stat(afile, &tstat); + if (code || tstat.size <= asize) + return code; + + MObtainWriteLock(&afs_xosi, 321); + VATTR_NULL(&tvattr); + tvattr.va_size = asize; + AFS_GUNLOCK(); + VOP_LOCK(afile->vnode, LK_EXCLUSIVE | LK_RETRY, curproc); + code = VOP_SETATTR(afile->vnode, &tvattr, afs_osi_credp, curproc); + VOP_UNLOCK(afile->vnode, 0, curproc); + AFS_GLOCK(); + if (code == 0) + afile->size = asize; + MReleaseWriteLock(&afs_xosi); + return code; +} + +void +osi_DisableAtimes(struct vnode *avp) +{ +#if 0 + VTOI(avp)->i_flag &= ~IN_ACCESS; +#endif +} + + +/* Generic read interface */ +int +afs_osi_Read(struct osi_file *afile, int offset, void *aptr, afs_int32 asize) +{ + unsigned int resid; + afs_int32 code; + + AFS_STATCNT(osi_Read); + + /* + * If the osi_file passed in is NULL, panic only if AFS is not shutting + * down. No point in crashing when we are already shutting down + */ + if (!afile) { + if (!afs_shuttingdown) + osi_Panic("osi_Read called with null param"); + else + return EIO; + } + + if (offset != -1) + afile->offset = offset; + AFS_GUNLOCK(); + code = + vn_rdwr(UIO_READ, afile->vnode, aptr, asize, afile->offset, + AFS_UIOSYS, IO_UNIT, afs_osi_credp, &resid, curproc); + AFS_GLOCK(); + if (code == 0) { + code = asize - resid; + afile->offset += code; + osi_DisableAtimes(afile->vnode); + } else { + afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid, + ICL_TYPE_INT32, code); + code = -1; + } + return code; +} + +/* Generic write interface */ +int +afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr, + afs_int32 asize) +{ + unsigned int resid; + afs_int32 code; + + AFS_STATCNT(osi_Write); + if (!afile) + osi_Panic("afs_osi_Write called with null afile"); + if (offset != -1) + afile->offset = offset; + + AFS_GUNLOCK(); + VOP_LOCK(afile->vnode, LK_EXCLUSIVE | LK_RETRY, curproc); + code = + vn_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, afile->offset, + AFS_UIOSYS, IO_UNIT, afs_osi_credp, &resid, curproc); + VOP_UNLOCK(afile->vnode, 0, curproc); + AFS_GLOCK(); + + if (code == 0) { + code = asize - resid; + afile->offset += code; + if (afile->offset > afile->size) + afile->size = afile->offset; + } else + code = -1; + + if (afile->proc) + (*afile->proc) (afile, code); + + return code; +} + +/* + * This work should be handled by physstrat in ca/machdep.c. This routine + * written from the RT NFS port strategy routine. It has been generalized a + * bit, but should still be pretty clear. + */ +int +afs_osi_MapStrategy(int (*aproc) (), struct buf *bp) +{ + afs_int32 returnCode; + + AFS_STATCNT(osi_MapStrategy); + returnCode = (*aproc) (bp); + + return returnCode; +} + +void +shutdown_osifile(void) +{ + AFS_STATCNT(shutdown_osifile); + if (afs_cold_shutdown) + afs_osicred_initialized = 0; +} diff --git a/src/afs/OBSD/osi_groups.c b/src/afs/OBSD/osi_groups.c new file mode 100644 index 000000000..c6c4247a5 --- /dev/null +++ b/src/afs/OBSD/osi_groups.c @@ -0,0 +1,139 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* + * osi_groups.c + * + * Implements: + * Afs_xsetgroups (syscall) + * setpag + * + */ +#include +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/OBSD/osi_groups.c,v 1.5 2003/07/15 23:14:25 shadow Exp $"); + +#include "afs/sysincludes.h" +#include "afs/afsincludes.h" +#include "afs/afs_stats.h" /* statistics */ +#include "sys/syscallargs.h" + +#define NOUID ((uid_t) -1) +#define NOGID ((gid_t) -1) + + +static int + afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset); + +static int + afs_setgroups(struct proc *proc, struct ucred **cred, int ngroups, + gid_t * gidset, int change_parent); + +int +Afs_xsetgroups(p, args, retval) + struct proc *p; + void *args; + int *retval; +{ + int code = 0; + struct vrequest treq; + + AFS_STATCNT(afs_xsetgroups); + AFS_GLOCK(); + + code = afs_InitReq(&treq, p->p_rcred); + AFS_GUNLOCK(); + if (code) + return code; + + code = setgroups(p, args, retval); + /* + * Note that if there is a pag already in the new groups we don't + * overwrite it with the old pag. + */ + if (PagInCred(p->p_rcred) == NOPAG) { + if (((treq.uid >> 24) & 0xff) == 'A') { + AFS_GLOCK(); + /* we've already done a setpag, so now we redo it */ + AddPag(p, treq.uid, &p->p_rcred); + AFS_GUNLOCK(); + } + } + return code; +} + + +int +setpag(struct proc *proc, struct ucred **cred, afs_uint32 pagvalue, + afs_uint32 * newpag, int change_parent) +{ + gid_t gidset[NGROUPS]; + int ngroups, code; + int j; + + AFS_STATCNT(setpag); + ngroups = afs_getgroups(*cred, NGROUPS, gidset); + if (afs_get_pag_from_groups(gidset[1], gidset[2]) == NOPAG) { + /* We will have to shift grouplist to make room for pag */ + if (ngroups + 2 > NGROUPS) { + return (E2BIG); + } + for (j = ngroups - 1; j >= 0; j--) { + gidset[j + 2] = gidset[j]; + } + ngroups += 2; + } + *newpag = (pagvalue == -1 ? genpag() : pagvalue); + afs_get_groups_from_pag(*newpag, &gidset[1], &gidset[2]); + code = afs_setgroups(proc, cred, ngroups, gidset, change_parent); + return code; +} + + +static int +afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) +{ + int ngrps, savengrps; + gid_t *gp; + + AFS_STATCNT(afs_getgroups); + savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); + gp = cred->cr_groups; + while (ngrps--) + *gidset++ = *gp++; + return savengrps; +} + + +static int +afs_setgroups(struct proc *proc, struct ucred **cred, int ngroups, + gid_t * gidset, int change_parent) +{ + struct ucred *cr = *cred; + int i; + + AFS_STATCNT(afs_setgroups); + + if (ngroups > NGROUPS) + return EINVAL; + + if (!change_parent) + cr = crcopy(cr); + + for (i = 0; i < ngroups; i++) + cr->cr_groups[i] = gidset[i]; + for (i = ngroups; i < NGROUPS; i++) + cr->cr_groups[i] = NOGROUP; + cr->cr_ngroups = ngroups; + + *cred = cr; + return (0); +} diff --git a/src/afs/OBSD/osi_inode.h b/src/afs/OBSD/osi_inode.h new file mode 100644 index 000000000..9ea3b16cc --- /dev/null +++ b/src/afs/OBSD/osi_inode.h @@ -0,0 +1,10 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* $Id: osi_inode.h,v 1.2 2002/11/15 17:19:40 rees Exp $ */ diff --git a/src/afs/OBSD/osi_machdep.h b/src/afs/OBSD/osi_machdep.h new file mode 100644 index 000000000..b01e6653c --- /dev/null +++ b/src/afs/OBSD/osi_machdep.h @@ -0,0 +1,155 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* + * + * OpenBSD OSI header file. Extends afs_osi.h. + * + * afs_osi.h includes this file, which is the only way this file should + * be included in a source file. This file can redefine macros declared in + * afs_osi.h. + */ + +/* $Id: osi_machdep.h,v 1.15 2004/03/25 17:04:44 rees Exp $ */ + +#ifndef _OSI_MACHDEP_H_ +#define _OSI_MACHDEP_H_ + +#include + +extern struct simplelock afs_rxglobal_lock; + +#define M_AFSFID (M_TEMP-1) +#define M_AFSBUFHDR (M_TEMP-2) +#define M_AFSBUFFER (M_TEMP-3) +#define M_AFSGENERIC (M_TEMP-4) + +/* vfs */ +#define osi_vfs mount +#define osi_vfs_bsize mnt_stat.f_bsize +#define osi_vfs_fsid mnt_stat.f_fsid +#define vfs_bsize mnt_stat.f_bsize +#define vfs_fsid mnt_stat.f_fsid +#define vfs_vnodecovered mnt_vnodecovered +#define v_vfsp v_mount + +/* vnode */ +#define SetAfsVnode(vn) /* nothing; done in getnewvnode() */ +#define IsAfsVnode(vn) ((vn)->v_op == afs_vnodeop_p) +#define VN_HOLD(vp) afs_vget((vp), 0) +#define VN_RELE(vp) vrele(vp) +#define osi_vnhold(avc, r) afs_vget(AFSTOV(avc), 0) +#define va_nodeid va_fileid +#define vnode_t struct vnode +#define vSetType(vc, type) AFSTOV(vc)->v_type = (type) +#define vSetVfsp(vc, vfsp) AFSTOV(vc)->v_mount = (vfsp) +#define vType(vc) (vc)->v->v_type + +/* uio */ +#define afsio_iov uio_iov +#define afsio_iovcnt uio_iovcnt +#define afsio_offset uio_offset +#define afsio_resid uio_resid +#define afsio_seg uio_segflg +#define AFS_UIOSYS UIO_SYSSPACE +#define AFS_UIOUSER UIO_USERSPACE + +/* malloc */ +#define AFS_KALLOC(s) afs_nbsd_Alloc(s) +#define AFS_KFREE(p, s) afs_nbsd_Free((p), (s)) + +/* proc, cred */ +#define AFS_PROC struct proc +#define AFS_UCRED ucred +#define afs_suser() afs_osi_suser(osi_curcred()) +#define getpid() curproc +#define osi_curcred() (curproc->p_cred->pc_ucred) +#define osi_curproc() curproc +#define p_rcred p_ucred + +/* time */ +extern struct timeval time; +#define afs_hz hz +#define osi_GetTime(x) microtime(x) +#define osi_Time() (time.tv_sec) + +/* str */ +#define afs_strcasecmp(s1, s2) strncasecmp((s1), (s2), 65535) +#ifdef AFS_OBSD34_ENV +#define strcpy(s1, s2) afs_strcpy((s1), (s2)) +#define strcat(s1, s2) afs_strcat((s1), (s2)) +#else +#define afs_strcat(s1, s2) strcat((s1), (s2)) +#endif + +/* other */ +#define afs_bufferpages bufpages +#ifndef iodone +#define iodone biodone +#endif +#define PAGESIZE 8192 +#define printk printf /* for RX version of xdr_* */ +#define setgroups sys_setgroups +#define UVM + +/* This is not always in scope yet */ +struct vcache; + +extern int afs_nbsd_lookupname(char *fnamep, enum uio_seg segflg, + int followlink, struct vnode **dirvpp, + struct vnode **compvpp); +extern void afs_nbsd_getnewvnode(struct vcache *tvc); +extern void *afs_nbsd_Alloc(size_t asize); +extern void afs_nbsd_Free(void *p, size_t asize); +extern int afs_vget(); + +#define gop_lookupname(fnamep, segflg, followlink, dirvpp, compvpp) \ + afs_nbsd_lookupname((fnamep), (segflg), (followlink), (dirvpp), (compvpp)) + +#ifdef KERNEL +extern int (**afs_vnodeop_p) (); + +#ifdef AFS_GLOBAL_SUNLOCK +extern struct proc *afs_global_owner; +extern struct lock afs_global_lock; +#define AFS_GLOCK() \ + do { \ + osi_Assert(curproc); \ + lockmgr(&afs_global_lock, LK_EXCLUSIVE, 0, curproc); \ + osi_Assert(afs_global_owner == NULL); \ + afs_global_owner = curproc; \ + } while (0) +#define AFS_GUNLOCK() \ + do { \ + osi_Assert(curproc); \ + osi_Assert(afs_global_owner == curproc); \ + afs_global_owner = NULL; \ + lockmgr(&afs_global_lock, LK_RELEASE, 0, curproc); \ + } while(0) +#define ISAFS_GLOCK() (afs_global_owner == curproc && curproc) +#else +extern struct simplelock afs_global_lock; +#define AFS_GLOCK() +#define AFS_GUNLOCK() +#define AFS_ASSERT_GLOCK() +#define ISAFS_GLOCK() 1 +#endif +#define AFS_RXGLOCK() +#define AFS_RXGUNLOCK() +#define ISAFS_RXGLOCK() 1 + +#undef SPLVAR +#define SPLVAR int splvar +#undef NETPRI +#define NETPRI splvar=splnet() +#undef USERPRI +#define USERPRI splx(splvar) +#endif /* KERNEL */ + +#endif /* _OSI_MACHDEP_H_ */ diff --git a/src/afs/OBSD/osi_misc.c b/src/afs/OBSD/osi_misc.c new file mode 100644 index 000000000..4b816bb15 --- /dev/null +++ b/src/afs/OBSD/osi_misc.c @@ -0,0 +1,113 @@ +/* + * osi_misc.c + * + * $Id: osi_misc.c,v 1.4 2003/10/09 16:13:16 rees Exp $ + */ + +/* +copyright 2002 +the regents of the university of michigan +all rights reserved + +permission is granted to use, copy, create derivative works +and redistribute this software and such derivative works +for any purpose, so long as the name of the university of +michigan is not used in any advertising or publicity +pertaining to the use or distribution of this software +without specific, written prior authorization. if the +above copyright notice or any other identification of the +university of michigan is included in any copy of any +portion of this software, then the disclaimer below must +also be included. + +this software is provided as is, without representation +from the university of michigan as to its fitness for any +purpose, and without warranty by the university of +michigan of any kind, either express or implied, including +without limitation the implied warranties of +merchantability and fitness for a particular purpose. the +regents of the university of michigan shall not be liable +for any damages, including special, indirect, incidental, or +consequential damages, with respect to any claim arising +out of or in connection with the use of the software, even +if it has been or is hereafter advised of the possibility of +such damages. +*/ + +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +#include +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/OBSD/osi_misc.c,v 1.4 2003/10/09 16:13:16 rees Exp $"); + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/afsincludes.h" /* Afs-based standard headers */ + +/* + * afs_suser() returns true if the caller is superuser, false otherwise. + * + * Note that it must NOT set errno. + */ + +/* + * OpenBSD version of afs_osi_suser() by Jim Rees. + * See osi_machdep.h for afs_suser macro. It simply calls afs_osi_suser() + * with the creds of the current process. + */ + +int +afs_osi_suser(void *credp) +{ +#ifdef AFS_OBSD35_ENV + return (suser_ucred((struct ucred *)credp) ? 0 : 1); +#else + return (suser((struct ucred *)credp, &curproc->p_acflag) ? 0 : 1); +#endif +} + +void * +afs_nbsd_Alloc(size_t asize) +{ + void *p; + + MALLOC(p, void *, asize, M_AFSGENERIC, M_WAITOK); + return p; +} + +void +afs_nbsd_Free(void *p, size_t asize) +{ + FREE(p, M_AFSGENERIC); +} + +int +afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, retval) + long *retval; + long dev, near_inode, param1, param2, param3, param4; +{ + return EINVAL; +} + +int +afs_syscall_iopen(dev, inode, usrmod, retval) + long *retval; + int dev, inode, usrmod; +{ + return EINVAL; +} + +int +afs_syscall_iincdec(dev, inode, inode_p1, amount) + int dev, inode, inode_p1, amount; +{ + return EINVAL; +} diff --git a/src/afs/OBSD/osi_prototypes.h b/src/afs/OBSD/osi_prototypes.h new file mode 100644 index 000000000..4bc45e9e8 --- /dev/null +++ b/src/afs/OBSD/osi_prototypes.h @@ -0,0 +1,12 @@ +/* + * osi_prototypes.h + * + * Exported macos support routines. + */ +#ifndef _OSI_PROTO_H_ +#define _OSI_PROTO_H_ + +/* osi_file.c */ +extern afs_rwlock_t afs_xosi; + +#endif /* _OSI_PROTO_H_ */ diff --git a/src/afs/OBSD/osi_sleep.c b/src/afs/OBSD/osi_sleep.c new file mode 100644 index 000000000..20caa89fe --- /dev/null +++ b/src/afs/OBSD/osi_sleep.c @@ -0,0 +1,144 @@ +/* + * $Id: osi_sleep.c,v 1.7 2003/07/15 23:14:25 shadow Exp $ + */ + +/* +copyright 2002 +the regents of the university of michigan +all rights reserved + +permission is granted to use, copy, create derivative works +and redistribute this software and such derivative works +for any purpose, so long as the name of the university of +michigan is not used in any advertising or publicity +pertaining to the use or distribution of this software +without specific, written prior authorization. if the +above copyright notice or any other identification of the +university of michigan is included in any copy of any +portion of this software, then the disclaimer below must +also be included. + +this software is provided as is, without representation +from the university of michigan as to its fitness for any +purpose, and without warranty by the university of +michigan of any kind, either express or implied, including +without limitation the implied warranties of +merchantability and fitness for a particular purpose. the +regents of the university of michigan shall not be liable +for any damages, including special, indirect, incidental, or +consequential damages, with respect to any claim arising +out of or in connection with the use of the software, even +if it has been or is hereafter advised of the possibility of +such damages. +*/ + +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +#include +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/OBSD/osi_sleep.c,v 1.7 2003/07/15 23:14:25 shadow Exp $"); + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ + +static char waitV; + + +void +afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) +{ + AFS_STATCNT(osi_InitWaitHandle); + achandle->proc = NULL; +} + +/* cancel osi_Wait */ +void +afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) +{ + caddr_t proc; + + AFS_STATCNT(osi_CancelWait); + proc = achandle->proc; + if (proc == NULL) + return; + achandle->proc = NULL; + wakeup(&waitV); +} + +/* afs_osi_Wait + * Waits for data on ahandle, or ams ms later. ahandle may be null. + * Returns 0 if timeout and EINTR if signalled. + */ +int +afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) +{ + int timo, code = 0; + struct timeval atv, endTime; + + AFS_STATCNT(osi_Wait); + + atv.tv_sec = ams / 1000; + atv.tv_usec = (ams % 1000) * 1000; + timeradd(&atv, &time, &endTime); + + if (ahandle) + ahandle->proc = (caddr_t) curproc; + AFS_ASSERT_GLOCK(); + AFS_GUNLOCK(); + + do { + timersub(&endTime, &time, &atv); + timo = atv.tv_sec * hz + atv.tv_usec * hz / 1000000 + 1; + if (aintok) { + code = tsleep(&waitV, PCATCH | PVFS, "afs_W1", timo); + if (code) + code = (code == EWOULDBLOCK) ? 0 : EINTR; + } else + tsleep(&waitV, PVFS, "afs_W2", timo); + + /* if we were cancelled, quit now */ + if (ahandle && (ahandle->proc == NULL)) { + /* we've been signalled */ + break; + } + } while (timercmp(&time, &endTime, <)); + + AFS_GLOCK(); + return code; +} + +void +afs_osi_Sleep(void *event) +{ + AFS_ASSERT_GLOCK(); + AFS_GUNLOCK(); + tsleep(event, PVFS, "afs", 0); + AFS_GLOCK(); +} + +int +afs_osi_SleepSig(void *event) +{ + AFS_ASSERT_GLOCK(); + AFS_GUNLOCK(); + tsleep(event, PVFS, "afs", 0); + AFS_GLOCK(); + return 0; +} + +int +afs_osi_Wakeup(void *event) +{ + wakeup(event); + return 1; +} diff --git a/src/afs/OBSD/osi_vfsops.c b/src/afs/OBSD/osi_vfsops.c new file mode 100644 index 000000000..595d22b23 --- /dev/null +++ b/src/afs/OBSD/osi_vfsops.c @@ -0,0 +1,510 @@ +/* + * OpenBSD specific assistance routines & VFS ops + * Original NetBSD version for Transarc afs by John Kohl + * OpenBSD version by Jim Rees + * + * $Id: osi_vfsops.c,v 1.18 2004/03/25 17:04:44 rees Exp $ + */ + +/* +copyright 2002 +the regents of the university of michigan +all rights reserved + +permission is granted to use, copy, create derivative works +and redistribute this software and such derivative works +for any purpose, so long as the name of the university of +michigan is not used in any advertising or publicity +pertaining to the use or distribution of this software +without specific, written prior authorization. if the +above copyright notice or any other identification of the +university of michigan is included in any copy of any +portion of this software, then the disclaimer below must +also be included. + +this software is provided as is, without representation +from the university of michigan as to its fitness for any +purpose, and without warranty by the university of +michigan of any kind, either express or implied, including +without limitation the implied warranties of +merchantability and fitness for a particular purpose. the +regents of the university of michigan shall not be liable +for any damages, including special, indirect, incidental, or +consequential damages, with respect to any claim arising +out of or in connection with the use of the software, even +if it has been or is hereafter advised of the possibility of +such damages. +*/ + +/* +Copyright 1995 Massachusetts Institute of Technology. All Rights +Reserved. + +You are hereby granted a worldwide, irrevocable, paid-up, right and +license to use, execute, display, modify, copy and distribute MIT's +Modifications, provided that (i) you abide by the terms and conditions +of the OpenAFS License Agreement, and (ii) you do not use the name +of MIT in any advertising or publicity without the prior written consent +of MIT. MIT disclaims all liability for your use of MIT's +Modifications. MIT's Modifications are provided "AS IS" WITHOUT +WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, +ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR +NONINFRINGEMENT. +*/ + +/* + * Some code cribbed from ffs_vfsops and other NetBSD sources, which + * are marked: + */ +/* + * Copyright (c) 1989, 1991, 1993, 1994 + * The Regents of the University of California. 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 University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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 +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/OBSD/osi_vfsops.c,v 1.18 2004/03/25 17:04:44 rees Exp $"); + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ + +#include +#include +#include +#include +#include +#include + +/* from /usr/src/sys/kern/vfs_subr.c */ +extern void insmntque(struct vnode *, struct mount *); + +extern int sys_lkmnosys(), afs3_syscall(), afs_xioctl(), Afs_xsetgroups(); + +static int lkmid = -1; +static int afs_badcall(struct proc *p, void *xx, register_t * yy); +static struct sysent old_sysent; + +char afs_NetBSD_osname[] = "OpenBSD"; +struct osi_vfs *afs_globalVFS; +struct vcache *afs_globalVp; + +int afs_quotactl(); +int afs_fhtovp(); +int afs_vptofh(); +int afsinit(); +int afs_start(); +int afs_mount(); +int afs_unmount(); +int afs_root(); +int afs_statfs(); +int afs_sync(); +int afs_vget(); +int afs_sysctl(); +int afs_checkexp(); + +struct vfsops afs_vfsops = { + afs_mount, + afs_start, + afs_unmount, + afs_root, + afs_quotactl, + afs_statfs, + afs_sync, + afs_vget, + afs_fhtovp, + afs_vptofh, + afsinit, + afs_sysctl, + afs_checkexp, +}; + +int +afs_nbsd_lookupname(char *fnamep, enum uio_seg segflg, int followlink, + struct vnode **dirvpp, struct vnode **compvpp) +{ + struct nameidata nd; + int niflag; + int error; + + /* + * Lookup pathname "fnamep", returning parent directory in + * *dirvpp (if non-null) and leaf in *compvpp. segflg says whether the + * pathname is user or system space. + */ + /* XXX LOCKLEAF ? */ + niflag = followlink ? FOLLOW : NOFOLLOW; + if (dirvpp) + niflag |= WANTPARENT; /* XXX LOCKPARENT? */ + NDINIT(&nd, LOOKUP, niflag, segflg, fnamep, osi_curproc()); + if ((error = namei(&nd))) + return error; + *compvpp = nd.ni_vp; + if (dirvpp) + *dirvpp = nd.ni_dvp; + return error; +} + +int +afs_quotactl() +{ + return EOPNOTSUPP; +} + +int +afs_sysctl() +{ + return EOPNOTSUPP; +} + +int +afs_checkexp() +{ + return EOPNOTSUPP; +} + +int +afs_fhtovp(mp, fhp, vpp) + struct mount *mp; + struct fid *fhp; + struct vnode **vpp; +{ + + return (EINVAL); +} + +int +afs_vptofh(vp, fhp) + struct vnode *vp; + struct fid *fhp; +{ + + return (EINVAL); +} + +int +afs_start(mp, flags, p) + struct mount *mp; + int flags; + struct proc *p; +{ + return (0); /* nothing to do. ? */ +} + +int +afs_mount(mp, path, data, ndp, p) + register struct mount *mp; + char *path; + caddr_t data; + struct nameidata *ndp; + struct proc *p; +{ + /* ndp contains the mounted-from device. Just ignore it. + * we also don't care about our proc struct. */ + int size; + + if (mp->mnt_flag & MNT_UPDATE) + return EINVAL; + + if (afs_globalVFS) { + /* Don't allow remounts */ + return EBUSY; + } + + AFS_STATCNT(afs_mount); + AFS_GLOCK(); + +#ifdef AFS_DISCON_ENV + /* initialize the vcache entries before we start using them */ + + /* XXX find a better place for this if possible */ + init_vcache_entries(); +#endif + afs_globalVFS = mp; + mp->osi_vfs_bsize = 8192; + mp->osi_vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */ + mp->osi_vfs_fsid.val[1] = (int)AFS_VFSFSID; + + (void)copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); + bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size); + bzero(mp->mnt_stat.f_mntfromname, MNAMELEN); + strcpy(mp->mnt_stat.f_mntfromname, "AFS"); + /* null terminated string "AFS" will fit, just leave it be. */ + strcpy(mp->mnt_stat.f_fstypename, MOUNT_AFS); + AFS_GUNLOCK(); + (void)afs_statfs(mp, &mp->mnt_stat); + + return 0; +} + +int +afs_unmount(afsp, flags, p) + struct mount *afsp; + int flags; + struct proc *p; +{ + extern int sys_ioctl(), sys_setgroups(); + + AFS_STATCNT(afs_unmount); +#ifdef AFS_DISCON_ENV + give_up_cbs(); +#endif + if (afs_globalVFS == NULL) { + printf("afs already unmounted\n"); + return 0; + } + if (afs_globalVp) + vrele(AFSTOV(afs_globalVp)); + afs_globalVp = NULL; + + vflush(afsp, NULLVP, 0); /* don't support forced */ + afsp->mnt_data = NULL; + AFS_GLOCK(); + afs_globalVFS = 0; + afs_cold_shutdown = 1; + afs_shutdown(); /* XXX */ + AFS_GUNLOCK(); + + /* give up syscall entries for ioctl & setgroups, which we've stolen */ + sysent[SYS_ioctl].sy_call = sys_ioctl; + sysent[SYS_setgroups].sy_call = sys_setgroups; + + /* give up the stolen syscall entry */ + sysent[AFS_SYSCALL].sy_narg = 0; + sysent[AFS_SYSCALL].sy_argsize = 0; + sysent[AFS_SYSCALL].sy_call = afs_badcall; + printf + ("AFS unmounted--use `/sbin/modunload -i %d' to unload before restarting AFS\n", + lkmid); + return 0; +} + +static int +afs_badcall(struct proc *p, void *xx, register_t * yy) +{ + return ENOSYS; +} + +void +afs_nbsd_getnewvnode(struct vcache *tvc) +{ + while (getnewvnode(VT_AFS, afs_globalVFS, afs_vnodeop_p, &tvc->v)) { + /* no vnodes available, force an alloc (limits be damned)! */ + desiredvnodes++; + } + tvc->v->v_data = (void *)tvc; +} + +int +afs_root(struct mount *mp, struct vnode **vpp) +{ + struct vrequest treq; + struct vcache *tvp; + int code; + + AFS_STATCNT(afs_root); + + AFS_GLOCK(); + if (!(code = afs_InitReq(&treq, osi_curcred())) + && !(code = afs_CheckInit())) { + tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL); + if (tvp) { + /* There is really no reason to over-hold this bugger--it's held + * by the root filesystem reference. */ + if (afs_globalVp != tvp) { +#ifdef AFS_DONT_OVERHOLD_GLOBALVP + if (afs_globalVp) + AFS_RELE(AFSTOV(afs_globalVp)); +#endif + afs_globalVp = tvp; + VREF(AFSTOV(afs_globalVp)); + } + AFSTOV(tvp)->v_flag |= VROOT; + afs_globalVFS = mp; + *vpp = AFSTOV(tvp); + } else + code = ENOENT; + } + AFS_GUNLOCK(); + + if (!code) + vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curproc); /* return it locked */ + return code; +} + +int +afs_statfs(struct osi_vfs *afsp, struct statfs *abp) +{ + AFS_STATCNT(afs_statfs); + abp->f_bsize = afsp->osi_vfs_bsize; + + /* + * Fake a high number below to satisfy programs that use the ustat (for + * * AIX), or statfs (for the rest) call to make sure that there's + * enough * space in the device partition before storing something there + * (like * ed(1)) + */ + abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files = + abp->f_ffree = 9000000; + abp->f_fsid.val[0] = AFS_VFSMAGIC; /* magic */ + abp->f_fsid.val[1] = (int)AFS_VFSFSID; + return 0; +} + +int +afs_sync(struct osi_vfs *afsp) +{ + AFS_STATCNT(afs_sync); +#if defined(AFS_DISCON_ENV) && !defined(AFS_OBSD_ENV) + /* Can't do this in OpenBSD 2.7, it faults when called from apm_suspend() */ + store_dirty_vcaches(); +#endif + return 0; +} + +int +afs_vget(vp, lfl) + struct vnode *vp; + int lfl; +{ + int error; + + if (vp->v_usecount < 0) { + vprint("bad usecount", vp); + panic("afs_vget"); + } + error = vget(vp, lfl, curproc); + if (!error && vp->v_usecount == 1) { + /* vget() took it off the freelist; put it on our mount queue */ + insmntque(vp, afs_globalVFS); + } + return error; +} + +extern struct vfsops afs_vfsops; +extern struct vnodeopv_desc afs_vnodeop_opv_desc; + +static struct vfsconf afs_vfsconf = { + &afs_vfsops, + "afs", + 0, + 0, + 0, + NULL, + NULL, +}; + +MOD_VFS("afs", 0, &afs_vfsconf); + +static char afsgenmem[] = "afsgenmem"; +static char afsfidmem[] = "afsfidmem"; +static char afsbhdrmem[] = "afsbhdrmem"; +static char afsbfrmem[] = "afsbfrmem"; + +int +afsinit() +{ + old_sysent = sysent[AFS_SYSCALL]; + + sysent[AFS_SYSCALL].sy_call = afs3_syscall; + sysent[AFS_SYSCALL].sy_narg = 6; + sysent[AFS_SYSCALL].sy_argsize = 6 * sizeof(long); + sysent[SYS_ioctl].sy_call = afs_xioctl; + sysent[SYS_setgroups].sy_call = Afs_xsetgroups; + osi_Init(); + + return 0; +} + +int +afs_vfs_load(struct lkm_table *lkmtp, int cmd) +{ + extern char *memname[]; + + vfs_opv_init_explicit(&afs_vnodeop_opv_desc); + vfs_opv_init_default(&afs_vnodeop_opv_desc); + if (memname[M_AFSGENERIC] == NULL) + memname[M_AFSGENERIC] = afsgenmem; + if (memname[M_AFSFID] == NULL) + memname[M_AFSFID] = afsfidmem; + if (memname[M_AFSBUFHDR] == NULL) + memname[M_AFSBUFHDR] = afsbhdrmem; + if (memname[M_AFSBUFFER] == NULL) + memname[M_AFSBUFFER] = afsbfrmem; + lkmid = lkmtp->id; + printf("OpenAFS ($Revision: 1.18 $) lkm loaded\n"); + return 0; +} + +int +afs_vfs_unload(struct lkm_table *lktmp, int cmd) +{ + extern char *memname[]; + + if (afs_globalVp) + return EBUSY; + if (sysent[SYS_ioctl].sy_call != sys_ioctl) + return EBUSY; + + if (memname[M_AFSGENERIC] == afsgenmem) + memname[M_AFSGENERIC] = NULL; + if (memname[M_AFSFID] == afsfidmem) + memname[M_AFSFID] = NULL; + if (memname[M_AFSBUFHDR] == afsbhdrmem) + memname[M_AFSBUFHDR] = NULL; + if (memname[M_AFSBUFFER] == afsbfrmem) + memname[M_AFSBUFFER] = NULL; + + sysent[AFS_SYSCALL] = old_sysent; + printf("OpenAFS unloaded\n"); + return 0; +} + +int +libafs_lkmentry(struct lkm_table *lkmtp, int cmd, int ver) +{ + if (cmd == LKM_E_LOAD) { + if (strcmp(ostype, afs_NetBSD_osname)) { + printf("This is %s version %s\n", ostype, osrelease); + printf("This version of AFS is only for %s\n", afs_NetBSD_osname); + return EPROGMISMATCH; + } + if (sysent[AFS_SYSCALL].sy_call == afs3_syscall + || sysent[AFS_SYSCALL].sy_call == afs_badcall) { + printf("AFS already loaded\n"); + return EINVAL; + } + } + DISPATCH(lkmtp, cmd, ver, afs_vfs_load, afs_vfs_unload, lkm_nofunc); +} diff --git a/src/afs/OBSD/osi_vm.c b/src/afs/OBSD/osi_vm.c new file mode 100644 index 000000000..51746e1fb --- /dev/null +++ b/src/afs/OBSD/osi_vm.c @@ -0,0 +1,98 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + + +/* osi_vm.c implements: + * + * osi_VM_FlushVCache(avc, slept) + * osi_ubc_flush_dirty_and_wait(vp, flags) + * osi_VM_StoreAllSegments(avc) + * osi_VM_TryToSmush(avc, acred, sync) + * osi_VM_FlushPages(avc, credp) + * osi_VM_Truncate(avc, alen, acred) + */ + +#include +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/OBSD/osi_vm.c,v 1.2 2003/07/15 23:14:25 shadow Exp $"); + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +/* #include */ +#include +#include + +/* Try to discard pages, in order to recycle a vcache entry. + * + * We also make some sanity checks: ref count, open count, held locks. + * + * We also do some non-VM-related chores, such as releasing the cred pointer + * (for AIX and Solaris) and releasing the gnode (for AIX). + * + * Locking: afs_xvcache lock is held. If it is dropped and re-acquired, + * *slept should be set to warn the caller. + * + * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it + * is not dropped and re-acquired for any platform. It may be that *slept is + * therefore obsolescent. + * + * OSF/1 Locking: VN_LOCK has been called. + */ +int +osi_VM_FlushVCache(struct vcache *avc, int *slept) +{ + return 0; +} + +/* Try to store pages to cache, in order to store a file back to the server. + * + * Locking: the vcache entry's lock is held. It will usually be dropped and + * re-obtained. + */ +void +osi_VM_StoreAllSegments(struct vcache *avc) +{ +} + +/* Try to invalidate pages, for "fs flush" or "fs flushv"; or + * try to free pages, when deleting a file. + * + * Locking: the vcache entry's lock is held. It may be dropped and + * re-obtained. + * + * Since we drop and re-obtain the lock, we can't guarantee that there won't + * be some pages around when we return, newly created by concurrent activity. + */ +void +osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync) +{ +} + +/* Purge VM for a file when its callback is revoked. + * + * Locking: No lock is held, not even the global lock. + */ +void +osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) +{ +} + +/* Purge pages beyond end-of-file, when truncating a file. + * + * Locking: no lock is held, not even the global lock. + * activeV is raised. This is supposed to block pageins, but at present + * it only works on Solaris. + */ +void +osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) +{ +} diff --git a/src/afs/OBSD/osi_vnodeops.c b/src/afs/OBSD/osi_vnodeops.c new file mode 100644 index 000000000..9413bfb0b --- /dev/null +++ b/src/afs/OBSD/osi_vnodeops.c @@ -0,0 +1,1085 @@ +/* + * OpenBSD specific vnodeops + other misc interface glue + * Original NetBSD version for Transarc afs by John Kohl + * OpenBSD version by Jim Rees + * + * $Id: osi_vnodeops.c,v 1.17 2004/03/19 16:38:29 rees Exp $ + */ + +/* +copyright 2002 +the regents of the university of michigan +all rights reserved + +permission is granted to use, copy, create derivative works +and redistribute this software and such derivative works +for any purpose, so long as the name of the university of +michigan is not used in any advertising or publicity +pertaining to the use or distribution of this software +without specific, written prior authorization. if the +above copyright notice or any other identification of the +university of michigan is included in any copy of any +portion of this software, then the disclaimer below must +also be included. + +this software is provided as is, without representation +from the university of michigan as to its fitness for any +purpose, and without warranty by the university of +michigan of any kind, either express or implied, including +without limitation the implied warranties of +merchantability and fitness for a particular purpose. the +regents of the university of michigan shall not be liable +for any damages, including special, indirect, incidental, or +consequential damages, with respect to any claim arising +out of or in connection with the use of the software, even +if it has been or is hereafter advised of the possibility of +such damages. +*/ + +/* +Copyright 1995 Massachusetts Institute of Technology. All Rights +Reserved. + +You are hereby granted a worldwide, irrevocable, paid-up, right and +license to use, execute, display, modify, copy and distribute MIT's +Modifications, provided that (i) you abide by the terms and conditions +of your OpenAFS License Agreement, and (ii) you do not use the name +of MIT in any advertising or publicity without the prior written consent +of MIT. MIT disclaims all liability for your use of MIT's +Modifications. MIT's Modifications are provided "AS IS" WITHOUT +WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, +ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR +NONINFRINGEMENT. +*/ + +/* + * A bunch of code cribbed from NetBSD ufs_vnops.c, ffs_vnops.c, and + * nfs_vnops.c which carry this copyright: + */ +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * 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 University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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 +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/OBSD/osi_vnodeops.c,v 1.17 2004/03/19 16:38:29 rees Exp $"); + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ + +#include +#include + +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" + +#ifdef AFS_DISCON_ENV +extern int afs_FlushVS(struct vcache *tvc); +#endif + +#define M_AFSNODE (M_TEMP-1) /* XXX */ + +int afs_nbsd_lookup(void *); +int afs_nbsd_create(void *); +int afs_nbsd_mknod(void *); +int afs_nbsd_open(void *); +int afs_nbsd_close(void *); +int afs_nbsd_access(void *); +int afs_nbsd_getattr(void *); +int afs_nbsd_setattr(void *); +int afs_nbsd_read(void *); +int afs_nbsd_write(void *); +int afs_nbsd_ioctl(void *); +int afs_nbsd_select(void *); +int afs_nbsd_fsync(void *); +int afs_nbsd_remove(void *); +int afs_nbsd_link(void *); +int afs_nbsd_rename(void *); +int afs_nbsd_mkdir(void *); +int afs_nbsd_rmdir(void *); +int afs_nbsd_symlink(void *); +int afs_nbsd_readdir(void *); +int afs_nbsd_readlink(void *); +int afs_nbsd_inactive(void *); +int afs_nbsd_reclaim(void *); +int afs_nbsd_lock(void *); +int afs_nbsd_unlock(void *); +int afs_nbsd_bmap(void *); +int afs_nbsd_strategy(void *); +int afs_nbsd_print(void *); +int afs_nbsd_islocked(void *); +int afs_nbsd_pathconf(void *); +int afs_nbsd_advlock(void *); + +#define afs_nbsd_opnotsupp \ + ((int (*) __P((void *)))eopnotsupp) +#define afs_nbsd_reallocblks afs_nbsd_opnotsupp + +/* Global vfs data structures for AFS. */ +int (**afs_vnodeop_p) __P((void *)); +struct vnodeopv_entry_desc afs_vnodeop_entries[] = { + {&vop_default_desc, vn_default_error}, + {&vop_lookup_desc, afs_nbsd_lookup}, /* lookup */ + {&vop_create_desc, afs_nbsd_create}, /* create */ + {&vop_mknod_desc, afs_nbsd_mknod}, /* mknod */ + {&vop_open_desc, afs_nbsd_open}, /* open */ + {&vop_close_desc, afs_nbsd_close}, /* close */ + {&vop_access_desc, afs_nbsd_access}, /* access */ + {&vop_getattr_desc, afs_nbsd_getattr}, /* getattr */ + {&vop_setattr_desc, afs_nbsd_setattr}, /* setattr */ + {&vop_read_desc, afs_nbsd_read}, /* read */ + {&vop_write_desc, afs_nbsd_write}, /* write */ + {&vop_ioctl_desc, afs_nbsd_ioctl}, /* XXX ioctl */ +#ifdef AFS_OBSD35_ENV + {&vop_poll_desc, afs_nbsd_select}, /* select */ +#else + {&vop_select_desc, afs_nbsd_select}, /* select */ +#endif + {&vop_fsync_desc, afs_nbsd_fsync}, /* fsync */ + {&vop_remove_desc, afs_nbsd_remove}, /* remove */ + {&vop_link_desc, afs_nbsd_link}, /* link */ + {&vop_rename_desc, afs_nbsd_rename}, /* rename */ + {&vop_mkdir_desc, afs_nbsd_mkdir}, /* mkdir */ + {&vop_rmdir_desc, afs_nbsd_rmdir}, /* rmdir */ + {&vop_symlink_desc, afs_nbsd_symlink}, /* symlink */ + {&vop_readdir_desc, afs_nbsd_readdir}, /* readdir */ + {&vop_readlink_desc, afs_nbsd_readlink}, /* readlink */ + {&vop_abortop_desc, vop_generic_abortop}, /* abortop */ + {&vop_inactive_desc, afs_nbsd_inactive}, /* inactive */ + {&vop_reclaim_desc, afs_nbsd_reclaim}, /* reclaim */ + {&vop_lock_desc, afs_nbsd_lock}, /* lock */ + {&vop_unlock_desc, afs_nbsd_unlock}, /* unlock */ + {&vop_bmap_desc, afs_nbsd_bmap}, /* bmap */ + {&vop_strategy_desc, afs_nbsd_strategy}, /* strategy */ + {&vop_print_desc, afs_nbsd_print}, /* print */ + {&vop_islocked_desc, afs_nbsd_islocked}, /* islocked */ + {&vop_pathconf_desc, afs_nbsd_pathconf}, /* pathconf */ + {&vop_advlock_desc, afs_nbsd_advlock}, /* advlock */ + {&vop_reallocblks_desc, afs_nbsd_reallocblks}, /* reallocblks */ + {&vop_bwrite_desc, vop_generic_bwrite}, + {(struct vnodeop_desc *)NULL, (int (*)__P((void *)))NULL} +}; +struct vnodeopv_desc afs_vnodeop_opv_desc = + { &afs_vnodeop_p, afs_vnodeop_entries }; + +#define GETNAME() \ + struct componentname *cnp = ap->a_cnp; \ + char *name; \ + MALLOC(name, char *, cnp->cn_namelen+1, M_TEMP, M_WAITOK); \ + bcopy(cnp->cn_nameptr, name, cnp->cn_namelen); \ + name[cnp->cn_namelen] = '\0' + +#define DROPNAME() FREE(name, M_TEMP) + +int afs_debug; + +int +afs_nbsd_lookup(void *v) +{ + struct vop_lookup_args /* { + * struct vnodeop_desc * a_desc; + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * } */ *ap = v; + int code; + struct vcache *vcp; + struct vnode *vp, *dvp; + int flags = ap->a_cnp->cn_flags; + int lockparent; /* 1 => lockparent flag is set */ + int wantparent; /* 1 => wantparent or lockparent flag */ + + GETNAME(); + lockparent = flags & LOCKPARENT; + wantparent = flags & (LOCKPARENT | WANTPARENT); +#ifdef PDIRUNLOCK + cnp->cn_flags &= ~PDIRUNLOCK; +#endif + + if (ap->a_dvp->v_type != VDIR) { + *ap->a_vpp = NULL; + DROPNAME(); + return ENOTDIR; + } + dvp = ap->a_dvp; + if (afs_debug & AFSDEB_VNLAYER && !(dvp->v_flag & VROOT)) + printf("nbsd_lookup dvp %p flags %x name %s cnt %d\n", dvp, flags, + name, dvp->v_usecount); + AFS_GLOCK(); + code = afs_lookup(VTOAFS(dvp), name, &vcp, cnp->cn_cred); + AFS_GUNLOCK(); + if (code) { + if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME) + && (flags & ISLASTCN) && code == ENOENT) + code = EJUSTRETURN; + if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) + cnp->cn_flags |= SAVENAME; + DROPNAME(); + *ap->a_vpp = NULL; + return (code); + } + vp = AFSTOV(vcp); /* always get a node if no error */ + + /* + * The parent directory comes in locked. We unlock it on return + * unless the caller wants it left locked. + * we also always return the vnode locked. + */ + + if (vp == dvp) { + /* they're the same; afs_lookup() already ref'ed the leaf. + * It came in locked, so we don't need to ref OR lock it */ + if (afs_debug & AFSDEB_VNLAYER) + printf("ref'ed %p as .\n", dvp); + } else { + if (!lockparent || !(flags & ISLASTCN)) { + VOP_UNLOCK(dvp, 0, curproc); /* done with parent. */ +#ifdef PDIRUNLOCK + cnp->cn_flags |= PDIRUNLOCK; +#endif + } + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curproc); /* always return the child locked */ + if (afs_debug & AFSDEB_VNLAYER) + printf("locked ret %p from lookup\n", vp); + } + *ap->a_vpp = vp; + + if (((cnp->cn_nameiop == RENAME && wantparent && (flags & ISLASTCN)) + || (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)))) + cnp->cn_flags |= SAVENAME; + + DROPNAME(); + if (afs_debug & AFSDEB_VNLAYER && !(dvp->v_flag & VROOT)) + printf("nbsd_lookup done dvp %p cnt %d\n", dvp, dvp->v_usecount); + return code; +} + +int +afs_nbsd_create(void *v) +{ + struct vop_create_args /* { + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * struct vattr *a_vap; + * } */ *ap = v; + int code = 0; + struct vcache *vcp; + struct vnode *dvp = ap->a_dvp; + GETNAME(); + + if (afs_debug & AFSDEB_VNLAYER) + printf("nbsd_create dvp %p cnt %d\n", dvp, dvp->v_usecount); + + /* vnode layer handles excl/nonexcl */ + + AFS_GLOCK(); + code = + afs_create(VTOAFS(dvp), name, ap->a_vap, NONEXCL, ap->a_vap->va_mode, + &vcp, cnp->cn_cred); + AFS_GUNLOCK(); + if (code) { + VOP_ABORTOP(dvp, cnp); + vput(dvp); + DROPNAME(); + return (code); + } + + if (vcp) { + *ap->a_vpp = AFSTOV(vcp); + vn_lock(AFSTOV(vcp), LK_EXCLUSIVE | LK_RETRY, curproc); + } else + *ap->a_vpp = 0; + + if ((cnp->cn_flags & SAVESTART) == 0) + FREE(cnp->cn_pnbuf, M_NAMEI); + vput(dvp); + DROPNAME(); + if (afs_debug & AFSDEB_VNLAYER) + printf("nbsd_create done dvp %p cnt %d\n", dvp, dvp->v_usecount); + return code; +} + +int +afs_nbsd_mknod(void *v) +{ + struct vop_mknod_args /* { + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * struct vattr *a_vap; + * } */ *ap = v; + free(ap->a_cnp->cn_pnbuf, M_NAMEI); + vput(ap->a_dvp); + return (ENODEV); +} + +int +afs_nbsd_open(void *v) +{ + struct vop_open_args /* { + * struct vnode *a_vp; + * int a_mode; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap = v; + int code; + struct vcache *vc = VTOAFS(ap->a_vp); + + AFS_GLOCK(); + code = afs_open(&vc, ap->a_mode, ap->a_cred); +#ifdef DIAGNOSTIC + if (AFSTOV(vc) != ap->a_vp) + panic("AFS open changed vnode!"); +#endif + AFS_GUNLOCK(); + return code; +} + +int +afs_nbsd_close(void *v) +{ + struct vop_close_args /* { + * struct vnode *a_vp; + * int a_fflag; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap = v; + int code; + + AFS_GLOCK(); + code = afs_close(VTOAFS(ap->a_vp), ap->a_fflag, ap->a_cred, ap->a_p); + AFS_GUNLOCK(); + return code; +} + +int +afs_nbsd_access(void *v) +{ + struct vop_access_args /* { + * struct vnode *a_vp; + * int a_mode; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap = v; + int code; + + AFS_GLOCK(); + code = afs_access(VTOAFS(ap->a_vp), ap->a_mode, ap->a_cred); + AFS_GUNLOCK(); + return code; +} + +int +afs_nbsd_getattr(void *v) +{ + struct vop_getattr_args /* { + * struct vnode *a_vp; + * struct vattr *a_vap; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap = v; + int code; + + AFS_GLOCK(); + code = afs_getattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred); + AFS_GUNLOCK(); + return code; +} + +int +afs_nbsd_setattr(void *v) +{ + struct vop_setattr_args /* { + * struct vnode *a_vp; + * struct vattr *a_vap; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap = v; + int code; + + AFS_GLOCK(); + code = afs_setattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred); + AFS_GUNLOCK(); + return code; +} + +int +afs_nbsd_read(void *v) +{ + struct vop_read_args /* { + * struct vnode *a_vp; + * struct uio *a_uio; + * int a_ioflag; + * struct ucred *a_cred; + * } */ *ap = v; + int code; + + AFS_GLOCK(); + code = + afs_read(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred, (daddr_t) 0, NULL, + 0); + AFS_GUNLOCK(); + return code; +} + +int +afs_nbsd_write(void *v) +{ + struct vop_write_args /* { + * struct vnode *a_vp; + * struct uio *a_uio; + * int a_ioflag; + * struct ucred *a_cred; + * } */ *ap = v; + int code; + +#ifdef UVM + (void)uvm_vnp_uncache(ap->a_vp); /* toss stale pages */ +#else + vnode_pager_uncache(ap->a_vp); +#endif + AFS_GLOCK(); + code = + afs_write(VTOAFS(ap->a_vp), ap->a_uio, ap->a_ioflag, ap->a_cred, 0); + AFS_GUNLOCK(); + return code; +} + +int +afs_nbsd_ioctl(void *v) +{ + struct vop_ioctl_args /* { + * struct vnode *a_vp; + * int a_command; + * caddr_t a_data; + * int a_fflag; + * struct ucred *a_cred; + * struct proc *a_p; + * } */ *ap = v; + int code; + + /* in case we ever get in here... */ + + AFS_STATCNT(afs_ioctl); + AFS_GLOCK(); + if (((ap->a_command >> 8) & 0xff) == 'V') + /* This is a VICEIOCTL call */ + code = + HandleIoctl(VTOAFS(ap->a_vp), ap->a_command, + (struct afs_ioctl *)ap->a_data); + else + /* No-op call; just return. */ + code = ENOTTY; + AFS_GUNLOCK(); + return code; +} + +int +afs_nbsd_select(void *v) +{ + return 1; +} + +int +afs_nbsd_fsync(void *v) +{ + struct vop_fsync_args /* { + * struct vnode *a_vp; + * struct ucred *a_cred; + * int a_waitfor; + * struct proc *a_p; + * } */ *ap = v; + int wait = ap->a_waitfor == MNT_WAIT; + struct vnode *vp = ap->a_vp; + int code; + + AFS_GLOCK(); + vflushbuf(vp, wait); + code = afs_fsync(VTOAFS(vp), ap->a_cred); + AFS_GUNLOCK(); + return code; +} + +int +afs_nbsd_remove(void *v) +{ + struct vop_remove_args /* { + * struct vnode *a_dvp; + * struct vnode *a_vp; + * struct componentname *a_cnp; + * } */ *ap = v; + int code; + struct vnode *vp = ap->a_vp; + struct vnode *dvp = ap->a_dvp; + + GETNAME(); + AFS_GLOCK(); + code = afs_remove(VTOAFS(dvp), name, cnp->cn_cred); + AFS_GUNLOCK(); + if (dvp == vp) + vrele(vp); + else + vput(vp); + vput(dvp); + FREE(cnp->cn_pnbuf, M_NAMEI); + DROPNAME(); + return code; +} + +int +afs_nbsd_link(void *v) +{ + struct vop_link_args /* { + * struct vnode *a_vp; + * struct vnode *a_tdvp; + * struct componentname *a_cnp; + * } */ *ap = v; + int code; + struct vnode *dvp = ap->a_dvp; + struct vnode *vp = ap->a_vp; + + GETNAME(); + if (dvp->v_mount != vp->v_mount) { + VOP_ABORTOP(vp, cnp); + code = EXDEV; + goto out; + } + if (vp->v_type == VDIR) { + VOP_ABORTOP(vp, cnp); + code = EISDIR; + goto out; + } + if ((code = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curproc))) { + VOP_ABORTOP(dvp, cnp); + goto out; + } + + AFS_GLOCK(); + code = afs_link(VTOAFS(vp), VTOAFS(dvp), name, cnp->cn_cred); + AFS_GUNLOCK(); + FREE(cnp->cn_pnbuf, M_NAMEI); + if (dvp != vp) + VOP_UNLOCK(vp, 0, curproc); + + out: + vput(dvp); + DROPNAME(); + return code; +} + +int +afs_nbsd_rename(void *v) +{ + struct vop_rename_args /* { + * struct vnode *a_fdvp; + * struct vnode *a_fvp; + * struct componentname *a_fcnp; + * struct vnode *a_tdvp; + * struct vnode *a_tvp; + * struct componentname *a_tcnp; + * } */ *ap = v; + int code = 0; + struct componentname *fcnp = ap->a_fcnp; + char *fname; + struct componentname *tcnp = ap->a_tcnp; + char *tname; + struct vnode *tvp = ap->a_tvp; + struct vnode *tdvp = ap->a_tdvp; + struct vnode *fvp = ap->a_fvp; + struct vnode *fdvp = ap->a_fdvp; + + /* + * Check for cross-device rename. + */ + if ((fvp->v_mount != tdvp->v_mount) + || (tvp && (fvp->v_mount != tvp->v_mount))) { + code = EXDEV; + abortit: + VOP_ABORTOP(tdvp, tcnp); /* XXX, why not in NFS? */ + if (tdvp == tvp) + vrele(tdvp); + else + vput(tdvp); + if (tvp) + vput(tvp); + VOP_ABORTOP(fdvp, fcnp); /* XXX, why not in NFS? */ + vrele(fdvp); + vrele(fvp); + return (code); + } + /* + * if fvp == tvp, we're just removing one name of a pair of + * directory entries for the same element. convert call into rename. + ( (pinched from NetBSD 1.0's ufs_rename()) + */ + if (fvp == tvp) { + if (fvp->v_type == VDIR) { + code = EINVAL; + goto abortit; + } + + /* Release destination completely. */ + VOP_ABORTOP(tdvp, tcnp); + vput(tdvp); + vput(tvp); + + /* Delete source. */ + vrele(fdvp); + vrele(fvp); + fcnp->cn_flags &= ~MODMASK; + fcnp->cn_flags |= LOCKPARENT | LOCKLEAF; + if ((fcnp->cn_flags & SAVESTART) == 0) + panic("afs_rename: lost from startdir"); + fcnp->cn_nameiop = DELETE; + (void)relookup(fdvp, &fvp, fcnp); + return (VOP_REMOVE(fdvp, fvp, fcnp)); + } + + if ((code = vn_lock(fvp, LK_EXCLUSIVE | LK_RETRY, curproc))) + goto abortit; + + MALLOC(fname, char *, fcnp->cn_namelen + 1, M_TEMP, M_WAITOK); + bcopy(fcnp->cn_nameptr, fname, fcnp->cn_namelen); + fname[fcnp->cn_namelen] = '\0'; + MALLOC(tname, char *, tcnp->cn_namelen + 1, M_TEMP, M_WAITOK); + bcopy(tcnp->cn_nameptr, tname, tcnp->cn_namelen); + tname[tcnp->cn_namelen] = '\0'; + + + AFS_GLOCK(); + /* XXX use "from" or "to" creds? NFS uses "to" creds */ + code = + afs_rename(VTOAFS(fdvp), fname, VTOAFS(tdvp), tname, tcnp->cn_cred); + AFS_GUNLOCK(); + + VOP_UNLOCK(fvp, 0, curproc); + FREE(fname, M_TEMP); + FREE(tname, M_TEMP); + if (code) + goto abortit; /* XXX */ + if (tdvp == tvp) + vrele(tdvp); + else + vput(tdvp); + if (tvp) + vput(tvp); + vrele(fdvp); + vrele(fvp); + return code; +} + +int +afs_nbsd_mkdir(void *v) +{ + struct vop_mkdir_args /* { + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * struct vattr *a_vap; + * } */ *ap = v; + struct vnode *dvp = ap->a_dvp; + struct vattr *vap = ap->a_vap; + int code; + struct vcache *vcp; + + GETNAME(); +#ifdef DIAGNOSTIC + if ((cnp->cn_flags & HASBUF) == 0) + panic("afs_nbsd_mkdir: no name"); +#endif + AFS_GLOCK(); + code = afs_mkdir(VTOAFS(dvp), name, vap, &vcp, cnp->cn_cred); + AFS_GUNLOCK(); + if (code) { + VOP_ABORTOP(dvp, cnp); + vput(dvp); + DROPNAME(); + return (code); + } + if (vcp) { + *ap->a_vpp = AFSTOV(vcp); + vn_lock(AFSTOV(vcp), LK_EXCLUSIVE | LK_RETRY, curproc); + } else + *ap->a_vpp = 0; + DROPNAME(); + FREE(cnp->cn_pnbuf, M_NAMEI); + vput(dvp); + return code; +} + +int +afs_nbsd_rmdir(void *v) +{ + struct vop_rmdir_args /* { + * struct vnode *a_dvp; + * struct vnode *a_vp; + * struct componentname *a_cnp; + * } */ *ap = v; + int code; + struct vnode *vp = ap->a_vp; + struct vnode *dvp = ap->a_dvp; + + GETNAME(); + if (dvp == vp) { + vrele(dvp); + vput(vp); + FREE(cnp->cn_pnbuf, M_NAMEI); + DROPNAME(); + return (EINVAL); + } + + AFS_GLOCK(); + code = afs_rmdir(VTOAFS(dvp), name, cnp->cn_cred); + AFS_GUNLOCK(); + DROPNAME(); + vput(dvp); + vput(vp); + return code; +} + +int +afs_nbsd_symlink(void *v) +{ + struct vop_symlink_args /* { + * struct vnode *a_dvp; + * struct vnode **a_vpp; + * struct componentname *a_cnp; + * struct vattr *a_vap; + * char *a_target; + * } */ *ap = v; + struct vnode *dvp = ap->a_dvp; + int code; + /* NFS ignores a_vpp; so do we. */ + + GETNAME(); + AFS_GLOCK(); + code = + afs_symlink(VTOAFS(dvp), name, ap->a_vap, ap->a_target, cnp->cn_cred); + AFS_GUNLOCK(); + DROPNAME(); + FREE(cnp->cn_pnbuf, M_NAMEI); + vput(dvp); + return code; +} + +int +afs_nbsd_readdir(void *v) +{ + struct vop_readdir_args /* { + * struct vnode *a_vp; + * struct uio *a_uio; + * struct ucred *a_cred; + * int *a_eofflag; + * int *a_ncookies; + * u_long **a_cookies; + * } */ *ap = v; + int code; + + AFS_GLOCK(); +#ifdef AFS_HAVE_COOKIES + printf("readdir %p cookies %p ncookies %d\n", ap->a_vp, ap->a_cookies, + ap->a_ncookies); + code = + afs_readdir(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred, ap->a_eofflag, + ap->a_ncookies, ap->a_cookies); +#else + code = + afs_readdir(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred, ap->a_eofflag); +#endif + AFS_GUNLOCK(); + return code; +} + +int +afs_nbsd_readlink(void *v) +{ + struct vop_readlink_args /* { + * struct vnode *a_vp; + * struct uio *a_uio; + * struct ucred *a_cred; + * } */ *ap = v; + int code; + + AFS_GLOCK(); + code = afs_readlink(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred); + AFS_GUNLOCK(); + return code; +} + +extern int prtactive; + +int +afs_nbsd_inactive(void *v) +{ + struct vop_inactive_args /* { + * struct vnode *a_vp; + * } */ *ap = v; + struct vnode *vp = ap->a_vp; + struct vcache *vc = VTOAFS(vp); + int haveGlock = ISAFS_GLOCK(); + + AFS_STATCNT(afs_inactive); + + if (prtactive && vp->v_usecount != 0) + vprint("afs_nbsd_inactive(): pushing active", vp); + + if (!haveGlock) + AFS_GLOCK(); + afs_InactiveVCache(vc, 0); /* decrs ref counts */ + if (!haveGlock) + AFS_GUNLOCK(); + + lockinit(&vc->rwlock, PINOD, "vcache", 0, 0); + return 0; +} + +int +afs_nbsd_reclaim(void *v) +{ + struct vop_reclaim_args /* { + * struct vnode *a_vp; + * } */ *ap = v; + int code, slept; + struct vnode *vp = ap->a_vp; + struct vcache *avc = VTOAFS(vp); + int haveGlock = ISAFS_GLOCK(); + int haveVlock = CheckLock(&afs_xvcache); + + if (!haveGlock) + AFS_GLOCK(); + if (!haveVlock) + ObtainWriteLock(&afs_xvcache, 901); +#ifndef AFS_DISCON_ENV + code = afs_FlushVCache(avc, &slept); /* tosses our stuff from vnode */ +#else + /* reclaim the vnode and the in-memory vcache, but keep the on-disk vcache */ + code = afs_FlushVS(avc); +#endif + if (!haveVlock) + ReleaseWriteLock(&afs_xvcache); + if (!haveGlock) + AFS_GUNLOCK(); + return code; +} + +int +afs_nbsd_lock(void *v) +{ + struct vop_lock_args /* { + * struct vnode *a_vp; + * int a_flags; + * sturct proc *a_p; + * } */ *ap = v; + struct vnode *vp = ap->a_vp; + struct vcache *vc = VTOAFS(vp); + + if (!vc) + panic("afs_nbsd_lock: null vcache"); + return lockmgr(&vc->rwlock, ap->a_flags | LK_CANRECURSE, &vp->v_interlock, + ap->a_p); +} + +int +afs_nbsd_unlock(void *v) +{ + struct vop_unlock_args /* { + * struct vnode *a_vp; + * int a_flags; + * struct proc *a_p; + * } */ *ap = v; + struct vnode *vp = ap->a_vp; + struct vcache *vc = VTOAFS(vp); + + if (!vc) + panic("afs_nbsd_unlock: null vcache"); + return lockmgr(&vc->rwlock, ap->a_flags | LK_RELEASE, &vp->v_interlock, + ap->a_p); +} + +int +afs_nbsd_bmap(void *v) +{ + struct vop_bmap_args /* { + * struct vnode *a_vp; + * daddr_t a_bn; + * struct vnode **a_vpp; + * daddr_t *a_bnp; + * int *a_runp; + * } */ *ap = v; + struct vcache *vcp = VTOAFS(ap->a_vp); + + AFS_STATCNT(afs_bmap); + if (ap->a_bnp) + ap->a_bnp = (daddr_t *) (ap->a_bn * (8192 / DEV_BSIZE)); + if (ap->a_vpp) + *ap->a_vpp = (vcp) ? AFSTOV(vcp) : NULL; + return 0; +} + +int +afs_nbsd_strategy(void *v) +{ + struct vop_strategy_args /* { + * struct buf *a_bp; + * } */ *ap = v; + struct buf *abp = ap->a_bp; + struct uio tuio; + struct iovec tiovec[1]; + struct vcache *tvc = VTOAFS(abp->b_vp); + struct ucred *credp = osi_curcred(); + long len = abp->b_bcount; + int code; + + AFS_STATCNT(afs_strategy); + + tuio.afsio_iov = tiovec; + tuio.afsio_iovcnt = 1; + tuio.afsio_seg = AFS_UIOSYS; + tuio.afsio_resid = len; + tiovec[0].iov_base = abp->b_un.b_addr; + tiovec[0].iov_len = len; + + AFS_GLOCK(); + if ((abp->b_flags & B_READ) == B_READ) { + code = afs_rdwr(tvc, &tuio, UIO_READ, 0, credp); + if (code == 0 && tuio.afsio_resid > 0) + bzero(abp->b_un.b_addr + len - tuio.afsio_resid, + tuio.afsio_resid); + } else + code = afs_rdwr(tvc, &tuio, UIO_WRITE, 0, credp); + AFS_GUNLOCK(); + + ReleaseWriteLock(&tvc->lock); + AFS_RELE(AFSTOV(tvc)); + return code; +} + +int +afs_nbsd_print(void *v) +{ + struct vop_print_args /* { + * struct vnode *a_vp; + * } */ *ap = v; + struct vnode *vp = ap->a_vp; + struct vcache *vc = VTOAFS(ap->a_vp); + + printf("tag %d, fid: %d.%x.%x.%x, ", vp->v_tag, vc->fid.Cell, + (int)vc->fid.Fid.Volume, (int)vc->fid.Fid.Vnode, + (int)vc->fid.Fid.Unique); + lockmgr_printinfo(&vc->rwlock); + printf("\n"); + return 0; +} + +int +afs_nbsd_islocked(void *v) +{ + struct vop_islocked_args /* { + * struct vnode *a_vp; + * } */ *ap = v; + return lockstatus(&VTOAFS(ap->a_vp)->rwlock); +} + +/* + * Return POSIX pathconf information applicable to ufs filesystems. + */ +int +afs_nbsd_pathconf(void *v) +{ + struct vop_pathconf_args /* { + * struct vnode *a_vp; + * int a_name; + * int *a_retval; + * } */ *ap = v; + AFS_STATCNT(afs_cntl); + switch (ap->a_name) { + case _PC_LINK_MAX: + *ap->a_retval = LINK_MAX; + break; + case _PC_NAME_MAX: + *ap->a_retval = NAME_MAX; + break; + case _PC_PATH_MAX: + *ap->a_retval = PATH_MAX; + break; + case _PC_CHOWN_RESTRICTED: + *ap->a_retval = 1; + break; + case _PC_NO_TRUNC: + *ap->a_retval = 1; + break; + case _PC_PIPE_BUF: + return EINVAL; + break; + default: + return EINVAL; + } + return 0; +} + +extern int + afs_lockctl(struct vcache *avc, struct AFS_FLOCK *af, int acmd, + struct AFS_UCRED *acred, pid_t clid); + +/* + * Advisory record locking support (fcntl() POSIX style) + */ +int +afs_nbsd_advlock(void *v) +{ + struct vop_advlock_args /* { + * struct vnode *a_vp; + * caddr_t a_id; + * int a_op; + * struct flock *a_fl; + * int a_flags; + * } */ *ap = v; + int code; + + AFS_GLOCK(); + code = + afs_lockctl(VTOAFS(ap->a_vp), ap->a_fl, ap->a_op, osi_curcred(), + (int)ap->a_id); + AFS_GUNLOCK(); + return code; +} diff --git a/src/afs/SOLARIS/osi_file.c b/src/afs/SOLARIS/osi_file.c index 13295789f..657e68f43 100644 --- a/src/afs/SOLARIS/osi_file.c +++ b/src/afs/SOLARIS/osi_file.c @@ -8,18 +8,19 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_file.c,v 1.1.1.9 2002/12/11 02:36:19 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_file.c,v 1.12 2003/07/15 23:14:26 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ -#include "../afs/osi_inode.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ +#include "afs/osi_inode.h" -int afs_osicred_initialized=0; -struct AFS_UCRED afs_osi_cred; +int afs_osicred_initialized = 0; +struct AFS_UCRED afs_osi_cred; afs_lock_t afs_xosi; /* lock is for tvattr */ extern struct osi_dev cacheDev; extern struct vfs *afs_cacheVfsp; @@ -35,17 +36,18 @@ extern struct vfs *afs_cacheVfsp; int afs_CacheFSType = -1; /* pointer to VXFS routine to access vnodes by inode number */ -int (*vxfs_vx_vp_byino)(); +int (*vxfs_vx_vp_byino) (); /* Initialize the cache operations. Called while initializing cache files. */ -void afs_InitDualFSCacheOps(struct vnode *vp) +void +afs_InitDualFSCacheOps(struct vnode *vp) { int code; static int inited = 0; struct vfs *vfsp; #ifdef AFS_SUN56_ENV struct statvfs64 vfst; -#else /* AFS_SUN56_ENV */ +#else /* AFS_SUN56_ENV */ struct statvfs vfst; #endif /* AFS_SUN56_ENV */ @@ -66,7 +68,8 @@ void afs_InitDualFSCacheOps(struct vnode *vp) if (strcmp(vfst.f_basetype, "vxfs") == 0) { vxfs_vx_vp_byino = (int (*)())modlookup("vxfs", "vx_vp_byino"); if (vxfs_vx_vp_byino == NULL) - osi_Panic("afs_InitDualFSCacheOps: modlookup(vx_vp_byino) failed"); + osi_Panic + ("afs_InitDualFSCacheOps: modlookup(vx_vp_byino) failed"); afs_CacheFSType = AFS_SUN_VXFS_CACHE; return; @@ -76,12 +79,13 @@ void afs_InitDualFSCacheOps(struct vnode *vp) return; } -ino_t VnodeToIno(vnode_t *vp) +ino_t +VnodeToIno(vnode_t * vp) { int code; struct vattr vattr; - vattr.va_mask = AT_FSID|AT_NODEID; /* quick return using this mask. */ + vattr.va_mask = AT_FSID | AT_NODEID; /* quick return using this mask. */ code = VOP_GETATTR(vp, &vattr, 0, &afs_osi_cred); if (code) { osi_Panic("VnodeToIno"); @@ -89,22 +93,24 @@ ino_t VnodeToIno(vnode_t *vp) return vattr.va_nodeid; } -dev_t VnodeToDev(vnode_t *vp) +dev_t +VnodeToDev(vnode_t * vp) { int code; struct vattr vattr; - vattr.va_mask = AT_FSID|AT_NODEID; /* quick return using this mask. */ + vattr.va_mask = AT_FSID | AT_NODEID; /* quick return using this mask. */ AFS_GUNLOCK(); code = VOP_GETATTR(vp, &vattr, 0, &afs_osi_cred); AFS_GLOCK(); if (code) { osi_Panic("VnodeToDev"); } - return (dev_t)vattr.va_fsid; + return (dev_t) vattr.va_fsid; } -afs_int32 VnodeToSize(vnode_t *vp) +afs_int32 +VnodeToSize(vnode_t * vp) { int code; struct vattr vattr; @@ -112,8 +118,8 @@ afs_int32 VnodeToSize(vnode_t *vp) /* * We lock xosi in osi_Stat, so we probably should * lock it here too - RWH. - */ - MObtainWriteLock(&afs_xosi,578); + */ + MObtainWriteLock(&afs_xosi, 578); vattr.va_mask = AT_SIZE; AFS_GUNLOCK(); code = VOP_GETATTR(vp, &vattr, 0, &afs_osi_cred); @@ -122,19 +128,19 @@ afs_int32 VnodeToSize(vnode_t *vp) osi_Panic("VnodeToSize"); } MReleaseWriteLock(&afs_xosi); - return (afs_int32)(vattr.va_size); + return (afs_int32) (vattr.va_size); } -void *osi_VxfsOpen(ainode) - afs_int32 ainode; +void * +osi_VxfsOpen(afs_int32 ainode) { struct vnode *vp; register struct osi_file *afile = NULL; afs_int32 code = 0; int dummy; - afile = (struct osi_file *) osi_AllocSmallSpace(sizeof(struct osi_file)); + afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file)); AFS_GUNLOCK(); - code = (*vxfs_vx_vp_byino)(afs_cacheVfsp, &vp, (unsigned int)ainode); + code = (*vxfs_vx_vp_byino) (afs_cacheVfsp, &vp, (unsigned int)ainode); AFS_GLOCK(); if (code) { osi_FreeSmallSpace(afile); @@ -143,25 +149,29 @@ void *osi_VxfsOpen(ainode) afile->vnode = vp; afile->size = VnodeToSize(afile->vnode); afile->offset = 0; - afile->proc = (int (*)()) 0; - afile->inum = ainode; /* for hint validity checking */ + afile->proc = (int (*)())0; + afile->inum = ainode; /* for hint validity checking */ return (void *)afile; } #endif /* AFS_HAVE_VXFS */ #if defined(AFS_SUN57_64BIT_ENV) -void *osi_UfsOpen(ino_t ainode) +void * +osi_UfsOpen(ino_t ainode) #else -void *osi_UfsOpen(afs_int32 ainode) +void * +osi_UfsOpen(afs_int32 ainode) #endif { struct inode *ip; register struct osi_file *afile = NULL; afs_int32 code = 0; int dummy; - afile = (struct osi_file *) osi_AllocSmallSpace(sizeof(struct osi_file)); + afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file)); AFS_GUNLOCK(); - code = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t)ainode, &ip, CRED(),&dummy); + code = + igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t) ainode, &ip, + CRED(), &dummy); AFS_GLOCK(); if (code) { osi_FreeSmallSpace(afile); @@ -170,8 +180,8 @@ void *osi_UfsOpen(afs_int32 ainode) afile->vnode = ITOV(ip); afile->size = VTOI(afile->vnode)->i_size; afile->offset = 0; - afile->proc = (int (*)()) 0; - afile->inum = ainode; /* for hint validity checking */ + afile->proc = (int (*)())0; + afile->inum = ainode; /* for hint validity checking */ return (void *)afile; } @@ -179,15 +189,16 @@ void *osi_UfsOpen(afs_int32 ainode) * In Solaris 7 we use 64 bit inode numbers */ #if defined(AFS_SUN57_64BIT_ENV) -void *osi_UFSOpen(ino_t ainode) +void * +osi_UFSOpen(ino_t ainode) #else -void *osi_UFSOpen(ainode) - afs_int32 ainode; +void * +osi_UFSOpen(afs_int32 ainode) #endif { extern int cacheDiskType; AFS_STATCNT(osi_UFSOpen); - if(cacheDiskType != AFS_FCACHE_TYPE_UFS) { + if (cacheDiskType != AFS_FCACHE_TYPE_UFS) { osi_Panic("UFSOpen called for non-UFS cache\n"); } if (!afs_osicred_initialized) { @@ -203,13 +214,13 @@ void *osi_UFSOpen(ainode) return osi_UfsOpen(ainode); } -afs_osi_Stat(afile, astat) - register struct osi_file *afile; - register struct osi_stat *astat; { +int +afs_osi_Stat(register struct osi_file *afile, register struct osi_stat *astat) +{ register afs_int32 code; struct vattr tvattr; AFS_STATCNT(osi_Stat); - MObtainWriteLock(&afs_xosi,320); + MObtainWriteLock(&afs_xosi, 320); /* Ufs doesn't seem to care about the flags so we pass 0 for now */ tvattr.va_mask = AT_ALL; AFS_GUNLOCK(); @@ -225,21 +236,21 @@ afs_osi_Stat(afile, astat) return code; } -osi_UFSClose(afile) - register struct osi_file *afile; - { - AFS_STATCNT(osi_Close); - if(afile->vnode) { +int +osi_UFSClose(register struct osi_file *afile) +{ + AFS_STATCNT(osi_Close); + if (afile->vnode) { AFS_RELE(afile->vnode); - } - - osi_FreeSmallSpace(afile); - return 0; - } - -osi_UFSTruncate(afile, asize) - register struct osi_file *afile; - afs_int32 asize; { + } + + osi_FreeSmallSpace(afile); + return 0; +} + +int +osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize) +{ struct AFS_UCRED *oldCred; struct vattr tvattr; register afs_int32 code; @@ -251,8 +262,9 @@ osi_UFSTruncate(afile, asize) * small enough. Check now and save some time. */ code = afs_osi_Stat(afile, &tstat); - if (code || tstat.size <= asize) return code; - MObtainWriteLock(&afs_xosi,321); + if (code || tstat.size <= asize) + return code; + MObtainWriteLock(&afs_xosi, 321); tvattr.va_mask = AT_SIZE; tvattr.va_size = asize; /* @@ -265,26 +277,25 @@ osi_UFSTruncate(afile, asize) return code; } -void osi_DisableAtimes(avp) -struct vnode *avp; +void +osi_DisableAtimes(struct vnode *avp) { - if (afs_CacheFSType == AFS_SUN_UFS_CACHE) { - struct inode *ip = VTOI(avp); - rw_enter(&ip->i_contents, RW_READER); - mutex_enter(&ip->i_tlock); - ip->i_flag &= ~IACC; - mutex_exit(&ip->i_tlock); - rw_exit(&ip->i_contents); - } + if (afs_CacheFSType == AFS_SUN_UFS_CACHE) { + struct inode *ip = VTOI(avp); + rw_enter(&ip->i_contents, RW_READER); + mutex_enter(&ip->i_tlock); + ip->i_flag &= ~IACC; + mutex_exit(&ip->i_tlock); + rw_exit(&ip->i_contents); + } } /* Generic read interface */ -afs_osi_Read(afile, offset, aptr, asize) - register struct osi_file *afile; - int offset; - char *aptr; - afs_int32 asize; { +int +afs_osi_Read(register struct osi_file *afile, int offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; #if defined(AFS_SUN57_ENV) ssize_t resid; @@ -292,69 +303,70 @@ afs_osi_Read(afile, offset, aptr, asize) int resid; #endif register afs_int32 code; - register afs_int32 cnt1=0; + register afs_int32 cnt1 = 0; AFS_STATCNT(osi_Read); /** * If the osi_file passed in is NULL, panic only if AFS is not shutting * down. No point in crashing when we are already shutting down */ - if ( !afile ) { - if ( !afs_shuttingdown ) - osi_Panic("osi_Read called with null param"); + if (!afile) { + if (!afs_shuttingdown) + osi_Panic("osi_Read called with null param"); else return EIO; } - if (offset != -1) afile->offset = offset; + if (offset != -1) + afile->offset = offset; AFS_GUNLOCK(); - code = gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset, - AFS_UIOSYS, 0, 0, &afs_osi_cred, &resid); + code = + gop_rdwr(UIO_READ, afile->vnode, (caddr_t) aptr, asize, afile->offset, + AFS_UIOSYS, 0, 0, &afs_osi_cred, &resid); AFS_GLOCK(); if (code == 0) { code = asize - resid; afile->offset += code; osi_DisableAtimes(afile->vnode); - } - else { + } else { afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid, - ICL_TYPE_INT32, code); + ICL_TYPE_INT32, code); code = -1; } return code; } /* Generic write interface */ -afs_osi_Write(afile, offset, aptr, asize) - register struct osi_file *afile; - char *aptr; - afs_int32 offset; - afs_int32 asize; { +int +afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr, + afs_int32 asize) +{ struct AFS_UCRED *oldCred; #if defined(AFS_SUN57_ENV) ssize_t resid; #else - int resid; + int resid; #endif register afs_int32 code; AFS_STATCNT(osi_Write); - if ( !afile ) - osi_Panic("afs_osi_Write called with null param"); - if (offset != -1) afile->offset = offset; + if (!afile) + osi_Panic("afs_osi_Write called with null param"); + if (offset != -1) + afile->offset = offset; AFS_GUNLOCK(); - code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, - afile->offset, AFS_UIOSYS, 0, RLIM64_INFINITY, - &afs_osi_cred, &resid); + code = + gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, + afile->offset, AFS_UIOSYS, 0, RLIM64_INFINITY, &afs_osi_cred, + &resid); AFS_GLOCK(); if (code == 0) { code = asize - resid; afile->offset += code; - } - else { + } else { code = -1; } if (afile->proc) { - (*afile->proc)(afile, code); + (*afile->proc) (afile, code); } return code; } @@ -363,9 +375,8 @@ afs_osi_Write(afile, offset, aptr, asize) /* This work should be handled by physstrat in ca/machdep.c. This routine written from the RT NFS port strategy routine. It has been generalized a bit, but should still be pretty clear. */ -int afs_osi_MapStrategy(aproc, bp) - int (*aproc)(); - register struct buf *bp; +int +afs_osi_MapStrategy(int (*aproc) (), register struct buf *bp) { afs_int32 returnCode; @@ -378,13 +389,12 @@ int afs_osi_MapStrategy(aproc, bp) void -shutdown_osifile() +shutdown_osifile(void) { - extern int afs_cold_shutdown; + extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); - if (afs_cold_shutdown) { - afs_osicred_initialized = 0; - } + AFS_STATCNT(shutdown_osifile); + if (afs_cold_shutdown) { + afs_osicred_initialized = 0; + } } - diff --git a/src/afs/SOLARIS/osi_groups.c b/src/afs/SOLARIS/osi_groups.c index 0dff3c4e4..a85659832 100644 --- a/src/afs/SOLARIS/osi_groups.c +++ b/src/afs/SOLARIS/osi_groups.c @@ -14,42 +14,38 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_groups.c,v 1.1.1.5 2002/05/10 23:44:11 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_groups.c,v 1.7 2003/07/15 23:14:26 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/afs_stats.h" /* statistics */ static int -afs_getgroups( - struct cred *cred, - gid_t *gidset); + afs_getgroups(struct cred *cred, gid_t * gidset); static int -afs_setgroups( - struct cred **cred, - int ngroups, - gid_t *gidset, - int change_parent); + afs_setgroups(struct cred **cred, int ngroups, gid_t * gidset, + int change_parent); #if defined(AFS_SUN55_ENV) int afs_xsetgroups(uap, rvp) -u_int uap; /* this is gidsetsize */ -gid_t *rvp; /* this is gidset */ -#else + u_int uap; /* this is gidsetsize */ + gid_t *rvp; /* this is gidset */ +#else struct setgroupsa { u_int gidsetsize; gid_t *gidset; }; -afs_xsetgroups(uap, rvp) - struct setgroupsa *uap; - rval_t *rvp; +afs_xsetgroups(uap, rvp) + struct setgroupsa *uap; + rval_t *rvp; #endif { int code = 0; @@ -60,7 +56,8 @@ afs_xsetgroups(uap, rvp) AFS_GLOCK(); code = afs_InitReq(&treq, proc->p_cred); AFS_GUNLOCK(); - if (code) return code; + if (code) + return code; code = setgroups(uap, rvp); /* Note that if there is a pag already in the new groups we don't @@ -79,10 +76,10 @@ afs_xsetgroups(uap, rvp) int setpag(cred, pagvalue, newpag, change_parent) - struct cred **cred; - afs_uint32 pagvalue; - afs_uint32 *newpag; - afs_uint32 change_parent; + struct cred **cred; + afs_uint32 pagvalue; + afs_uint32 *newpag; + afs_uint32 change_parent; { gid_t *gidset; int ngroups, code; @@ -97,16 +94,16 @@ setpag(cred, pagvalue, newpag, change_parent) if (afs_get_pag_from_groups(gidset[0], gidset[1]) == NOPAG) { /* We will have to shift grouplist to make room for pag */ - if ((sizeof gidset[0])*(ngroups + 2) > AFS_SMALLOCSIZ) { + if ((sizeof gidset[0]) * (ngroups + 2) > AFS_SMALLOCSIZ) { osi_FreeSmallSpace((char *)gidset); return (E2BIG); } - for (j = ngroups -1; j >= 0; j--) { - gidset[j+2] = gidset[j]; - } + for (j = ngroups - 1; j >= 0; j--) { + gidset[j + 2] = gidset[j]; + } ngroups += 2; } - *newpag = (pagvalue == -1 ? genpag(): pagvalue); + *newpag = (pagvalue == -1 ? genpag() : pagvalue); afs_get_groups_from_pag(*newpag, &gidset[0], &gidset[1]); /* afs_setgroups will release curproc->p_crlock */ if (code = afs_setgroups(cred, ngroups, gidset, change_parent)) { @@ -119,9 +116,7 @@ setpag(cred, pagvalue, newpag, change_parent) static int -afs_getgroups( - struct cred *cred, - gid_t *gidset) +afs_getgroups(struct cred *cred, gid_t * gidset) { int ngrps, savengrps; gid_t *gp; @@ -132,18 +127,15 @@ afs_getgroups( savengrps = ngrps = cred->cr_ngroups; gp = cred->cr_groups; while (ngrps--) - *gidset++ = *gp++; + *gidset++ = *gp++; return savengrps; } static int -afs_setgroups( - struct cred **cred, - int ngroups, - gid_t *gidset, - int change_parent) +afs_setgroups(struct cred **cred, int ngroups, gid_t * gidset, + int change_parent) { int ngrps; int i; @@ -163,6 +155,6 @@ afs_setgroups( *gp++ = *gidset++; mutex_exit(&curproc->p_crlock); if (!change_parent) - crset(curproc, *cred); /* broadcast to all threads */ + crset(curproc, *cred); /* broadcast to all threads */ return (0); } diff --git a/src/afs/SOLARIS/osi_inode.c b/src/afs/SOLARIS/osi_inode.c index 98fd765a3..a7b66bcf7 100644 --- a/src/afs/SOLARIS/osi_inode.c +++ b/src/afs/SOLARIS/osi_inode.c @@ -14,17 +14,18 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_inode.c,v 1.1.1.8 2002/05/10 23:44:12 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_inode.c,v 1.14 2003/07/15 23:14:26 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/osi_inode.h" -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/osi_inode.h" +#include "afs/afs_stats.h" /* statistics stuff */ -extern int (*ufs_iallocp)(), (*ufs_iupdatp)(), (*ufs_igetp)(), - (*ufs_itimes_nolockp)(); +extern int (*ufs_iallocp) (), (*ufs_iupdatp) (), (*ufs_igetp) (), + (*ufs_itimes_nolockp) (); #define AFS_ITIMES(ip) { \ mutex_enter(&(ip)->i_tlock); \ @@ -35,7 +36,7 @@ extern int (*ufs_iallocp)(), (*ufs_iupdatp)(), (*ufs_igetp)(), #define AFS_ITIMES_NOLOCK(ip) \ (*ufs_itimes_nolockp)(ip); -getinode(vfsp, dev, inode, ipp, credp,perror) +getinode(vfsp, dev, inode, ipp, credp, perror) struct vfs *vfsp; struct AFS_UCRED *credp; struct inode **ipp; @@ -49,16 +50,16 @@ getinode(vfsp, dev, inode, ipp, credp,perror) struct fs *fs; struct inode *pip; struct ufsvfs *ufsvfsp; - + AFS_STATCNT(getinode); - + *perror = 0; - - if (!vfsp + + if (!vfsp #if !defined(AFS_SUN58_ENV) && !(vfsp = vfs_devsearch(dev)) #else - && !(vfsp = vfs_dev2vfsp(dev)) + && !(vfsp = vfs_dev2vfsp(dev)) #endif ) { return (ENODEV); @@ -68,7 +69,7 @@ getinode(vfsp, dev, inode, ipp, credp,perror) #ifdef HAVE_VFS_DQRWLOCK rw_enter(&ufsvfsp->vfs_dqrwlock, RW_READER); #endif - code = (*ufs_igetp)(vfsp, inode, &ip, credp); + code = (*ufs_igetp) (vfsp, inode, &ip, credp); #ifdef HAVE_VFS_DQRWLOCK rw_exit(&ufsvfsp->vfs_dqrwlock); #endif @@ -82,7 +83,7 @@ getinode(vfsp, dev, inode, ipp, credp,perror) } /* get an existing inode. Common code for iopen, iread/write, iinc/dec. */ -igetinode(vfsp, dev, inode, ipp, credp,perror) +igetinode(vfsp, dev, inode, ipp, credp, perror) struct AFS_UCRED *credp; struct inode **ipp; struct vfs *vfsp; @@ -93,44 +94,44 @@ igetinode(vfsp, dev, inode, ipp, credp,perror) struct inode *pip, *ip; extern struct osi_dev cacheDev; register int code = 0; - + *perror = 0; - + AFS_STATCNT(igetinode); - - code = getinode(vfsp, dev, inode, &ip, credp,perror); - if (code) + + code = getinode(vfsp, dev, inode, &ip, credp, perror); + if (code) return code; - + rw_enter(&ip->i_contents, RW_READER); - + if (ip->i_mode == 0) { /* Not an allocated inode */ rw_exit(&ip->i_contents); VN_RELE(ITOV(ip)); return (ENOENT); } - - if (ip->i_nlink == 0 || (ip->i_mode&IFMT) != IFREG) { + + if (ip->i_nlink == 0 || (ip->i_mode & IFMT) != IFREG) { AFS_ITIMES(ip); rw_exit(&ip->i_contents); VN_RELE(ITOV(ip)); return (ENOENT); } - + /* On VFS40 systems, iput does major synchronous write action, but only - when the reference count on the vnode goes to 0. Normally, Sun users - don't notice this because the DNLC keep references for them, but we - notice 'cause we don't. So, we make a fake dnlc entry which gets - cleaned up by iget when it needs the space. */ + * when the reference count on the vnode goes to 0. Normally, Sun users + * don't notice this because the DNLC keep references for them, but we + * notice 'cause we don't. So, we make a fake dnlc entry which gets + * cleaned up by iget when it needs the space. */ if (dev != cacheDev.dev) { /* * Don't call dnlc for the cm inodes since it's a big performance * penalty there! */ - dnlc_enter(ITOV(ip), "a", ITOV(ip), (struct AFS_UCRED *) 0); + dnlc_enter(ITOV(ip), "a", ITOV(ip), (struct AFS_UCRED *)0); } - + *ipp = ip; rw_exit(&ip->i_contents); return (code); @@ -138,34 +139,35 @@ igetinode(vfsp, dev, inode, ipp, credp,perror) int CrSync = 1; -afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp, credp) +afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp, + credp) rval_t *rvp; struct AFS_UCRED *credp; long near_inode, param1, param2, param3, param4; dev_t dev; { - int dummy, err=0; + int dummy, err = 0; struct inode *ip, *newip; register int code; dev_t newdev; struct ufsvfs *ufsvfsp; AFS_STATCNT(afs_syscall_icreate); - + if (!afs_suser(credp)) return (EPERM); - + /** Code to convert a 32 bit dev_t into a 64 bit dev_t * This conversion is needed only for the 64 bit OS. */ - + #ifdef AFS_SUN57_64BIT_ENV - newdev = expldev( (dev32_t) dev); + newdev = expldev((dev32_t) dev); #else newdev = dev; #endif - code = getinode(0, (dev_t)newdev, 2, &ip, credp,&dummy); + code = getinode(0, (dev_t) newdev, 2, &ip, credp, &dummy); if (code) { return (code); } @@ -176,7 +178,7 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp, credp) rw_enter(&ufsvfsp->vfs_dqrwlock, RW_READER); #endif rw_enter(&ip->i_contents, RW_WRITER); - code = (*ufs_iallocp)(ip, near_inode, 0, &newip, credp); + code = (*ufs_iallocp) (ip, near_inode, 0, &newip, credp); AFS_ITIMES_NOLOCK(ip); rw_exit(&ip->i_contents); #ifdef HAVE_VFS_DQRWLOCK @@ -189,7 +191,7 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp, credp) return (code); } rw_enter(&newip->i_contents, RW_WRITER); - newip->i_flag |= IACC|IUPD|ICHG; + newip->i_flag |= IACC | IUPD | ICHG; #if defined(AFS_SUN56_ENV) newip->i_vicemagic = VICEMAGIC; @@ -200,15 +202,15 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp, credp) newip->i_nlink = 1; newip->i_mode = IFREG; newip->i_vnode.v_type = VREG; - + newip->i_vicep1 = param1; - if (param2 == 0x1fffffff/*INODESPECIAL*/) { + if (param2 == 0x1fffffff /*INODESPECIAL*/) { newip->i_vicep2 = ((0x1fffffff << 3) + (param4 & 0x3)); newip->i_vicep3 = param3; } else { - newip->i_vicep2 = (((param2 >> 16) & 0x1f) << 27) + - (((param4 >> 16) & 0x1f) << 22) + - (param3 & 0x3fffff); + newip->i_vicep2 = + (((param2 >> 16) & 0x1f) << 27) + + (((param4 >> 16) & 0x1f) << 22) + (param3 & 0x3fffff); newip->i_vicep3 = ((param4 << 16) + (param2 & 0xffff)); } #ifdef AFS_SUN57_64BIT_ENV @@ -216,12 +218,12 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp, credp) #else rvp->r_val1 = newip->i_number; #endif - + /* * We're being conservative and sync to the disk */ if (CrSync) - (*ufs_iupdatp)(newip, 1); + (*ufs_iupdatp) (newip, 1); AFS_ITIMES_NOLOCK(newip); rw_exit(&newip->i_contents); VN_RELE(ITOV(newip)); @@ -231,12 +233,12 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp, credp) afs_syscall_iopen(dev, inode, usrmod, rvp, credp) rval_t *rvp; struct AFS_UCRED *credp; - int inode, usrmod; + int inode, usrmod; dev_t dev; { struct file *fp; struct inode *ip; - struct vnode *vp = (struct vnode *)0; + struct vnode *vp = NULL; int dummy; int fd; register int code; @@ -250,18 +252,18 @@ afs_syscall_iopen(dev, inode, usrmod, rvp, credp) /** Code to convert a 32 bit dev_t into a 64 bit dev_t * This conversion is needed only for the 64 bit OS. */ - + #ifdef AFS_SUN57_64BIT_ENV - newdev = expldev( (dev32_t) dev); + newdev = expldev((dev32_t) dev); #else newdev = dev; #endif - code = igetinode(0, (dev_t)newdev, (ino_t)inode, &ip, credp,&dummy); + code = igetinode(0, (dev_t) newdev, (ino_t) inode, &ip, credp, &dummy); if (code) { return (code); } - code = falloc((struct vnode *)NULL, FWRITE|FREAD, &fp, &fd); + code = falloc((struct vnode *)NULL, FWRITE | FREAD, &fp, &fd); if (code) { rw_enter(&ip->i_contents, RW_READER); AFS_ITIMES(ip); @@ -269,14 +271,14 @@ afs_syscall_iopen(dev, inode, usrmod, rvp, credp) VN_RELE(ITOV(ip)); return (code); } - + /* fp->f_count, f_audit_data are set by falloc */ fp->f_vnode = ITOV(ip); - - fp->f_flag = (usrmod+1) & (FMASK); - + + fp->f_flag = (usrmod + 1) & (FMASK); + /* fp->f_count, f_msgcount are set by falloc */ - + /* fp->f_offset zeroed by falloc */ /* f_cred set by falloc */ /* @@ -312,17 +314,17 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount, rvp, credp) if (!afs_suser(credp)) return (EPERM); - /** Code to convert a 32 bit dev_t into a 64 bit dev_t + /** Code to convert a 32 bit dev_t into a 64 bit dev_t * This conversion is needed only for the 64 bit OS. */ - + #ifdef AFS_SUN57_64BIT_ENV - newdev = expldev( (dev32_t) dev); + newdev = expldev((dev32_t) dev); #else newdev = dev; #endif - code = igetinode(0, (dev_t)newdev, (ino_t)inode, &ip, credp,&dummy); + code = igetinode(0, (dev_t) newdev, (ino_t) inode, &ip, credp, &dummy); if (code) { return (code); } @@ -343,11 +345,10 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount, rvp, credp) ip->i_flag |= ICHG; /* We may want to force the inode to the disk in case of crashes, other references, etc. */ if (IncSync) - (*ufs_iupdatp)(ip, 1); + (*ufs_iupdatp) (ip, 1); AFS_ITIMES_NOLOCK(ip); rw_exit(&ip->i_contents); VN_RELE(ITOV(ip)); } return (code); } - diff --git a/src/afs/SOLARIS/osi_inode.h b/src/afs/SOLARIS/osi_inode.h index 2a5cffac5..e131651d8 100644 --- a/src/afs/SOLARIS/osi_inode.h +++ b/src/afs/SOLARIS/osi_inode.h @@ -40,8 +40,8 @@ #endif #if defined(AFS_SUN56_ENV) -#define IS_VICEMAGIC(ip) ((ip)->i_vicemagic == VICEMAGIC) -#define IS_DVICEMAGIC(dp) ((dp)->di_vicemagic == VICEMAGIC) +#define IS_VICEMAGIC(ip) ((ip)->i_vicemagic == VICEMAGIC) +#define IS_DVICEMAGIC(dp) ((dp)->di_vicemagic == VICEMAGIC) #define CLEAR_VICEMAGIC(ip) (ip)->i_vicemagic = (ip)->i_vicep3 = 0 #define CLEAR_DVICEMAGIC(dp) (dp)->di_vicemagic = (dp)->di_vicep3 = 0 diff --git a/src/afs/SOLARIS/osi_machdep.h b/src/afs/SOLARIS/osi_machdep.h index 09403c6b8..a7d051b1a 100644 --- a/src/afs/SOLARIS/osi_machdep.h +++ b/src/afs/SOLARIS/osi_machdep.h @@ -19,7 +19,7 @@ #define _OSI_MACHDEP_H_ #ifdef AFS_SUN57_64BIT_ENV -#include /* for get_udatamodel() */ +#include /* for get_udatamodel() */ #endif #define getpid() curproc->p_pid @@ -45,9 +45,9 @@ extern void gethrestime(timespec_t *); static int local_osi_Time() { - timespec_t start; - gethrestime(&start); - return start.tv_sec; + timespec_t start; + gethrestime(&start); + return start.tv_sec; } #else #define osi_Time() (hrestime.tv_sec) @@ -71,7 +71,7 @@ extern void *afs_osi_Alloc_NoSleep(size_t size); extern kmutex_t afs_global_lock; extern kmutex_t afs_rxglobal_lock; -#define AFS_GLOCK() mutex_enter(&afs_global_lock); +#define AFS_GLOCK() mutex_enter(&afs_global_lock); #define AFS_GUNLOCK() mutex_exit(&afs_global_lock); #define ISAFS_GLOCK() mutex_owned(&afs_global_lock) @@ -82,10 +82,10 @@ extern kmutex_t afs_rxglobal_lock; /* Associate the Berkley signal equivalent lock types to System V's */ -#define LOCK_SH 1 /* F_RDLCK */ -#define LOCK_EX 2 /* F_WRLCK */ -#define LOCK_NB 4 /* XXX */ -#define LOCK_UN 8 /* F_UNLCK */ +#define LOCK_SH 1 /* F_RDLCK */ +#define LOCK_EX 2 /* F_WRLCK */ +#define LOCK_NB 4 /* XXX */ +#define LOCK_UN 8 /* F_UNLCK */ #ifndef IO_APPEND #define IO_APPEND FAPPEND @@ -106,4 +106,3 @@ extern kmutex_t afs_rxglobal_lock; #endif #endif /* _OSI_MACHDEP_H_ */ - diff --git a/src/afs/SOLARIS/osi_prototypes.h b/src/afs/SOLARIS/osi_prototypes.h index 6219269c0..a4e260958 100644 --- a/src/afs/SOLARIS/osi_prototypes.h +++ b/src/afs/SOLARIS/osi_prototypes.h @@ -10,19 +10,22 @@ #ifndef _OSI_PROTOTYPES_H_ #define _OSI_PROTOTYPES_H_ +/* osi_file.c */ +extern afs_rwlock_t afs_xosi; + /* osi_vnodeops.c */ int afs_putapage(struct vnode *vp, struct page *pages, #if defined(AFS_SUN56_ENV) - u_offset_t *offp, + u_offset_t * offp, #else - u_int *offp, + u_int * offp, #endif #if defined(AFS_SUN58_ENV) - size_t *lenp, + size_t * lenp, #else - u_int *lenp, + u_int * lenp, #endif - int flags, struct AFS_UCRED *credp); + int flags, struct AFS_UCRED *credp); diff --git a/src/afs/SOLARIS/osi_sleep.c b/src/afs/SOLARIS/osi_sleep.c index fd174b1fb..9836d3840 100644 --- a/src/afs/SOLARIS/osi_sleep.c +++ b/src/afs/SOLARIS/osi_sleep.c @@ -8,35 +8,37 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_sleep.c,v 1.1.1.4 2001/07/14 22:19:51 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_sleep.c,v 1.9 2003/07/15 23:14:26 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok); -void afs_osi_Wakeup(char *event); -void afs_osi_Sleep(char *event); static char waitV; -void afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) +void +afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle) { AFS_STATCNT(osi_InitWaitHandle); achandle->proc = (caddr_t) 0; } /* cancel osi_Wait */ -void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) +void +afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) { caddr_t proc; AFS_STATCNT(osi_CancelWait); proc = achandle->proc; - if (proc == 0) return; - achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ + if (proc == 0) + return; + achandle->proc = (caddr_t) 0; /* so dude can figure out he was signalled */ afs_osi_Wakeup(&waitV); } @@ -44,13 +46,14 @@ void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle) * Waits for data on ahandle, or ams ms later. ahandle may be null. * Returns 0 if timeout and EINTR if signalled. */ -int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) +int +afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) { int code; afs_int32 endTime, tid; AFS_STATCNT(osi_Wait); - endTime = osi_Time() + (ams/1000); + endTime = osi_Time() + (ams / 1000); if (ahandle) ahandle->proc = (caddr_t) curthread; do { @@ -58,7 +61,8 @@ int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) code = 0; code = osi_TimedSleep(&waitV, ams, aintok); - if (code) break; /* if something happened, quit now */ + if (code) + break; /* if something happened, quit now */ /* if we we're cancelled, quit now */ if (ahandle && (ahandle->proc == (caddr_t) 0)) { /* we've been signalled */ @@ -76,19 +80,20 @@ typedef struct afs_event { char *event; /* lwp event: an address */ int refcount; /* Is it in use? */ int seq; /* Sequence number: this is incremented - by wakeup calls; wait will not return until - it changes */ + * by wakeup calls; wait will not return until + * it changes */ kcondvar_t cond; /* Currently associated condition variable */ } afs_event_t; #define HASHSIZE 128 -afs_event_t *afs_evhasht[HASHSIZE];/* Hash table for events */ +afs_event_t *afs_evhasht[HASHSIZE]; /* Hash table for events */ #define afs_evhash(event) (afs_uint32) ((((long)event)>>2) & (HASHSIZE-1)); int afs_evhashcnt = 0; /* Get and initialize event structure corresponding to lwp event (i.e. address) * */ -static afs_event_t *afs_getevent(char *event) +static afs_event_t * +afs_getevent(char *event) { afs_event_t *evp, *newp = 0; int hashcode; @@ -106,7 +111,7 @@ static afs_event_t *afs_getevent(char *event) evp = evp->next; } if (!newp) { - newp = (afs_event_t *) osi_AllocSmallSpace(sizeof (afs_event_t)); + newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t)); afs_evhashcnt++; newp->next = afs_evhasht[hashcode]; afs_evhasht[hashcode] = newp; @@ -122,7 +127,8 @@ static afs_event_t *afs_getevent(char *event) #define relevent(evp) ((evp)->refcount--) -void afs_osi_Sleep(char *event) +void +afs_osi_Sleep(void *event) { struct afs_event *evp; int seq; @@ -136,6 +142,25 @@ void afs_osi_Sleep(char *event) relevent(evp); } +int +afs_osi_SleepSig(void *event) +{ + struct afs_event *evp; + int seq, code = 0; + + evp = afs_getevent(event); + seq = evp->seq; + while (seq == evp->seq) { + AFS_ASSERT_GLOCK(); + if (cv_wait_sig(&evp->cond, &afs_global_lock) == 0) { + code = EINTR; + break; + } + } + relevent(evp); + return code; +} + /* osi_TimedSleep * * Arguments: @@ -145,38 +170,43 @@ void afs_osi_Sleep(char *event) * * Returns 0 if timeout and EINTR if signalled. */ -static int osi_TimedSleep(char *event, afs_int32 ams, int aintok) +static int +osi_TimedSleep(char *event, afs_int32 ams, int aintok) { int code = 0; struct afs_event *evp; clock_t ticks; - ticks = ( ams * afs_hz )/1000; - ticks = ticks + lbolt; + ticks = (ams * afs_hz) / 1000; + ticks = ticks + lbolt; evp = afs_getevent(event); AFS_ASSERT_GLOCK(); if (aintok) { - if (cv_timedwait_sig(&evp->cond, &afs_global_lock, ticks) == -1) + if (cv_timedwait_sig(&evp->cond, &afs_global_lock, ticks) == 0) code = EINTR; } else { cv_timedwait(&evp->cond, &afs_global_lock, ticks); } - + relevent(evp); return code; } -void afs_osi_Wakeup(char *event) +int +afs_osi_Wakeup(void *event) { + int ret = 1; struct afs_event *evp; evp = afs_getevent(event); if (evp->refcount > 1) { - evp->seq++; + evp->seq++; cv_broadcast(&evp->cond); + ret = 0; } relevent(evp); + return 0; } diff --git a/src/afs/SOLARIS/osi_vfsops.c b/src/afs/SOLARIS/osi_vfsops.c index 337eca28b..371241824 100644 --- a/src/afs/SOLARIS/osi_vfsops.c +++ b/src/afs/SOLARIS/osi_vfsops.c @@ -11,15 +11,16 @@ * osi_vfsops.c for SOLARIS */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_vfsops.c,v 1.1.1.11 2003/07/30 17:08:11 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vfsops.c,v 1.17 2003/07/15 23:14:26 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics stuff */ -#include "../h/modctl.h" -#include "../h/syscall.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics stuff */ +#include "h/modctl.h" +#include "h/syscall.h" #include @@ -33,7 +34,8 @@ extern struct sysent sysent32[]; int afsfstype = 0; -int afs_mount(struct vfs *afsp, struct vnode *amvp, struct mounta *uap, +int +afs_mount(struct vfs *afsp, struct vnode *amvp, struct mounta *uap, struct AFS_UCRED *credp) { @@ -47,15 +49,15 @@ int afs_mount(struct vfs *afsp, struct vnode *amvp, struct mounta *uap, } afsp->vfs_fstype = afsfstype; - if (afs_globalVFS) { /* Don't allow remounts. */ + if (afs_globalVFS) { /* Don't allow remounts. */ AFS_GUNLOCK(); return EBUSY; } afs_globalVFS = afsp; afsp->vfs_bsize = 8192; - afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */ - afsp->vfs_fsid.val[1] = AFS_VFSFSID; + afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */ + afsp->vfs_fsid.val[1] = AFS_VFSFSID; afsp->vfs_dev = AFS_VFSMAGIC; AFS_GUNLOCK(); @@ -63,9 +65,11 @@ int afs_mount(struct vfs *afsp, struct vnode *amvp, struct mounta *uap, } #if defined(AFS_SUN58_ENV) -int afs_unmount (struct vfs *afsp, int flag, struct AFS_UCRED *credp) +int +afs_unmount(struct vfs *afsp, int flag, struct AFS_UCRED *credp) #else -int afs_unmount (struct vfs *afsp, struct AFS_UCRED *credp) +int +afs_unmount(struct vfs *afsp, struct AFS_UCRED *credp) #endif { AFS_GLOCK(); @@ -82,11 +86,12 @@ int afs_unmount (struct vfs *afsp, struct AFS_UCRED *credp) return 0; } -int afs_root (struct vfs *afsp, struct vnode **avpp) +int +afs_root(struct vfs *afsp, struct vnode **avpp) { register afs_int32 code = 0; struct vrequest treq; - register struct vcache *tvp=0; + register struct vcache *tvp = 0; struct proc *proc = ttoproc(curthread); struct vnode *vp = afsp->vfs_vnodecovered; int locked = 0; @@ -110,10 +115,15 @@ int afs_root (struct vfs *afsp, struct vnode **avpp) locked = 1; mutex_exit(&vp->v_lock); } - if (!(code = afs_InitReq(&treq, proc->p_cred)) && - !(code = afs_CheckInit())) { - tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); + + if (afs_globalVp) { + afs_PutVCache(afs_globalVp); + afs_globalVp = NULL; + } + + if (!(code = afs_InitReq(&treq, proc->p_cred)) + && !(code = afs_CheckInit())) { + tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL); /* we really want this to stay around */ if (tvp) { afs_globalVp = tvp; @@ -148,9 +158,11 @@ int afs_root (struct vfs *afsp, struct vnode **avpp) } #ifdef AFS_SUN56_ENV -int afs_statvfs(struct vfs *afsp, struct statvfs64 *abp) +int +afs_statvfs(struct vfs *afsp, struct statvfs64 *abp) #else -int afs_statvfs(struct vfs *afsp, struct statvfs *abp) +int +afs_statvfs(struct vfs *afsp, struct statvfs *abp) #endif { AFS_GLOCK(); @@ -158,22 +170,24 @@ int afs_statvfs(struct vfs *afsp, struct statvfs *abp) AFS_STATCNT(afs_statfs); abp->f_frsize = 1024; - abp->f_favail = 9000000; + abp->f_favail = 9000000; abp->f_bsize = afsp->vfs_bsize; abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files = - abp->f_ffree = 9000000; + abp->f_ffree = 9000000; abp->f_fsid = (AFS_VFSMAGIC << 16) || AFS_VFSFSID; AFS_GUNLOCK(); return 0; } -int afs_sync(struct vfs *afsp, short flags, struct AFS_UCRED *credp) +int +afs_sync(struct vfs *afsp, short flags, struct AFS_UCRED *credp) { return 0; } -int afs_vget(struct vfs *afsp, struct vnode **avcp, struct fid *fidp) +int +afs_vget(struct vfs *afsp, struct vnode **avcp, struct fid *fidp) { cred_t *credp = CRED(); struct vrequest treq; @@ -185,7 +199,7 @@ int afs_vget(struct vfs *afsp, struct vnode **avcp, struct fid *fidp) *avcp = NULL; if (!(code = afs_InitReq(&treq, credp))) { - code = afs_osi_vget((struct vcache**)avcp, fidp, &treq); + code = afs_osi_vget((struct vcache **)avcp, fidp, &treq); } afs_Trace3(afs_iclSetp, CM_TRACE_VGET, ICL_TYPE_POINTER, *avcp, @@ -199,7 +213,7 @@ int afs_vget(struct vfs *afsp, struct vnode **avcp, struct fid *fidp) /* This is only called by vfs_mount when afs is going to be mounted as root. * Since we don't support diskless clients we shouldn't come here. */ -int afsmountroot=0; +int afsmountroot = 0; afs_mountroot(struct vfs *afsp, whymountroot_t why) { AFS_GLOCK(); @@ -212,7 +226,7 @@ afs_mountroot(struct vfs *afsp, whymountroot_t why) /* afs_swapvp is called to setup swapping over the net for diskless clients. * Again not for us. */ -int afsswapvp=0; +int afsswapvp = 0; afs_swapvp(struct vfs *afsp, struct vnode **avpp, char *nm) { AFS_GLOCK(); @@ -241,13 +255,13 @@ struct vfsops Afs_vfsops = { /* * afsinit - intialize VFS */ -int (*ufs_iallocp)(); -void (*ufs_iupdatp)(); -int (*ufs_igetp)(); -void (*ufs_itimes_nolockp)(); +int (*ufs_iallocp) (); +void (*ufs_iupdatp) (); +int (*ufs_igetp) (); +void (*ufs_itimes_nolockp) (); -int (*afs_orig_ioctl)(), (*afs_orig_ioctl32)(); -int (*afs_orig_setgroups)(), (*afs_orig_setgroups32)(); +int (*afs_orig_ioctl) (), (*afs_orig_ioctl32) (); +int (*afs_orig_setgroups) (), (*afs_orig_setgroups32) (); struct streamtab *udp_infop = 0; struct ill_s *ill_g_headp = 0; @@ -255,12 +269,12 @@ struct ill_s *ill_g_headp = 0; int afs_sinited = 0; #if !defined(AFS_NONFSTRANS) -int (*nfs_rfsdisptab_v2)(); -int (*nfs_rfsdisptab_v3)(); -int (*nfs_acldisptab_v2)(); -int (*nfs_acldisptab_v3)(); +int (*nfs_rfsdisptab_v2) (); +int (*nfs_rfsdisptab_v3) (); +int (*nfs_acldisptab_v2) (); +int (*nfs_acldisptab_v3) (); -int (*nfs_checkauth)(); +int (*nfs_checkauth) (); #endif extern Afs_syscall(); @@ -289,45 +303,44 @@ afsinit(struct vfssw *vfsswp, int fstype) #if !defined(AFS_NONFSTRANS) - nfs_rfsdisptab_v2 = (int (*)()) modlookup("nfssrv", "rfsdisptab_v2"); - if ( !nfs_rfsdisptab_v2 ) { + nfs_rfsdisptab_v2 = (int (*)())modlookup("nfssrv", "rfsdisptab_v2"); + if (!nfs_rfsdisptab_v2) { afs_warn("warning : rfsdisptab_v2 NOT FOUND\n"); } if (nfs_rfsdisptab_v2) { - nfs_acldisptab_v2 = (int (*)()) modlookup("nfssrv", "acldisptab_v2"); - if ( !nfs_acldisptab_v2 ) { + nfs_acldisptab_v2 = (int (*)())modlookup("nfssrv", "acldisptab_v2"); + if (!nfs_acldisptab_v2) { afs_warn("warning : acldisptab_v2 NOT FOUND\n"); - } - else { + } else { afs_xlatorinit_v2(nfs_rfsdisptab_v2, nfs_acldisptab_v2); } } - nfs_rfsdisptab_v3 = (int (*)()) modlookup("nfssrv", "rfsdisptab_v3"); - if ( !nfs_rfsdisptab_v3 ) { + nfs_rfsdisptab_v3 = (int (*)())modlookup("nfssrv", "rfsdisptab_v3"); + if (!nfs_rfsdisptab_v3) { afs_warn("warning : rfsdisptab_v3 NOT FOUND\n"); } if (nfs_rfsdisptab_v3) { - nfs_acldisptab_v3 = (int (*)()) modlookup("nfssrv", "acldisptab_v3"); - if ( !nfs_acldisptab_v3 ) { + nfs_acldisptab_v3 = (int (*)())modlookup("nfssrv", "acldisptab_v3"); + if (!nfs_acldisptab_v3) { afs_warn("warning : acldisptab_v3 NOT FOUND\n"); - } - else { + } else { afs_xlatorinit_v3(nfs_rfsdisptab_v3, nfs_acldisptab_v3); } } - nfs_checkauth = (int (*)()) modlookup("nfssrv", "checkauth"); - if ( !nfs_checkauth ) afs_warn("nfs_checkauth not initialised"); + nfs_checkauth = (int (*)())modlookup("nfssrv", "checkauth"); + if (!nfs_checkauth) + afs_warn("nfs_checkauth not initialised"); #endif - ufs_iallocp = (int (*)()) modlookup("ufs", "ufs_ialloc"); - ufs_iupdatp = (void (*)()) modlookup("ufs", "ufs_iupdat"); - ufs_igetp = (int (*)()) modlookup("ufs", "ufs_iget"); - ufs_itimes_nolockp = (void (*)()) modlookup("ufs", "ufs_itimes_nolock"); - udp_infop = (struct streamtab *) modlookup("udp", "udpinfo"); - ill_g_headp = (struct ill_s *) modlookup("ip", "ill_g_head"); - - if ( !ufs_iallocp || !ufs_iupdatp || !ufs_itimes_nolockp || - !ufs_igetp || !udp_infop || !ill_g_headp ) + ufs_iallocp = (int (*)())modlookup("ufs", "ufs_ialloc"); + ufs_iupdatp = (void (*)())modlookup("ufs", "ufs_iupdat"); + ufs_igetp = (int (*)())modlookup("ufs", "ufs_iget"); + ufs_itimes_nolockp = (void (*)())modlookup("ufs", "ufs_itimes_nolock"); + udp_infop = (struct streamtab *)modlookup("udp", "udpinfo"); + ill_g_headp = (struct ill_s *)modlookup("ip", "ill_g_head"); + + if (!ufs_iallocp || !ufs_iupdatp || !ufs_itimes_nolockp || !ufs_igetp + || !udp_infop || !ill_g_headp) afs_warn("AFS to UFS mapping cannot be fully initialised\n"); afs_sinited = 1; @@ -340,13 +353,13 @@ static struct vfssw afs_vfw = { afsinit, &Afs_vfsops, 0 - }; +}; static struct sysent afssysent = { 6, 0, Afs_syscall - }; +}; /* inter-module dependencies */ char _depends_on[] = "drv/ip drv/udp strmod/rpcmod"; @@ -361,13 +374,13 @@ static struct modlfs afsmodlfs = { &mod_fsops, "afs filesystem", &afs_vfw - }; +}; static struct modlsys afsmodlsys = { &mod_syscallops, "afs syscall interface", &afssysent - }; +}; /** The two structures afssysent32 and afsmodlsys32 are being added * for supporting 32 bit syscalls. In Solaris 7 there are two system @@ -397,7 +410,7 @@ static struct modlinkage afs_modlinkage = { #endif (void *)&afsmodlfs, NULL - }; +}; /** This is the function that modload calls when loading the afs kernel * extensions. The solaris modload program searches for the _init @@ -415,29 +428,38 @@ _init() if (afs_sinited) return EBUSY; - if ((!(mp = mod_find_by_filename("fs", "ufs")) && - !(mp = mod_find_by_filename(NULL, "/kernel/fs/ufs")) && - !(mp = mod_find_by_filename(NULL, "sys/ufs"))) || - (mp && !mp->mod_installed)) { - printf("ufs module must be loaded before loading afs; use modload /kernel/fs/ufs\n"); + if ((!(mp = mod_find_by_filename("fs", "ufs")) + && !(mp = mod_find_by_filename(NULL, "/kernel/fs/ufs")) + && !(mp = mod_find_by_filename(NULL, "sys/ufs"))) || (mp + && !mp-> + mod_installed)) + { + printf + ("ufs module must be loaded before loading afs; use modload /kernel/fs/ufs\n"); return (ENOSYS); } #ifndef AFS_NONFSTRANS #if defined(AFS_SUN55_ENV) - if ((!(mp = mod_find_by_filename("misc", "nfssrv")) && - !(mp = mod_find_by_filename(NULL, NFSSRV)) && - !(mp = mod_find_by_filename(NULL, NFSSRV_V9))) || - (mp && !mp->mod_installed)) { - printf("misc/nfssrv module must be loaded before loading afs with nfs-xlator\n"); - return (ENOSYS); + if ((!(mp = mod_find_by_filename("misc", "nfssrv")) + && !(mp = mod_find_by_filename(NULL, NFSSRV)) + && !(mp = mod_find_by_filename(NULL, NFSSRV_V9))) || (mp + && !mp-> + mod_installed)) + { + printf + ("misc/nfssrv module must be loaded before loading afs with nfs-xlator\n"); + return (ENOSYS); } #else /* !AFS_SUN55_ENV */ #if defined(AFS_SUN52_ENV) - if ((!(mp = mod_find_by_filename("fs", "nfs")) && - !(mp = mod_find_by_filename(NULL, "/kernel/fs/nfs")) && - !(mp = mod_find_by_filename(NULL, "sys/nfs"))) || - (mp && !mp->mod_installed)) { - printf("fs/nfs module must be loaded before loading afs with nfs-xlator\n"); + if ((!(mp = mod_find_by_filename("fs", "nfs")) + && !(mp = mod_find_by_filename(NULL, "/kernel/fs/nfs")) + && !(mp = mod_find_by_filename(NULL, "sys/nfs"))) || (mp + && !mp-> + mod_installed)) + { + printf + ("fs/nfs module must be loaded before loading afs with nfs-xlator\n"); return (ENOSYS); } #endif /* AFS_SUN52_ENV */ @@ -466,25 +488,25 @@ _init() if (sysent[AFS_SYSCALL].sy_call == nosys) { if ((sysn = mod_getsysname(AFS_SYSCALL)) != NULL) { sysent[AFS_SYSCALL].sy_lock = - (krwlock_t *) kobj_zalloc(sizeof (krwlock_t), KM_SLEEP); + (krwlock_t *) kobj_zalloc(sizeof(krwlock_t), KM_SLEEP); rw_init(sysent[AFS_SYSCALL].sy_lock, "afs_syscall", #ifdef AFS_SUN57_ENV RW_DEFAULT, NULL); #else /* !AFS_SUN57_ENV */ - RW_DEFAULT, DEFAULT_WT); + RW_DEFAULT, DEFAULT_WT); #endif /* AFS_SUN57_ENV */ } } #endif /* !AFS_SUN58_ENV */ - osi_Init(); /* initialize global lock, etc */ + osi_Init(); /* initialize global lock, etc */ code = mod_install(&afs_modlinkage); return code; } _info(modp) - struct modinfo *modp; + struct modinfo *modp; { int code; diff --git a/src/afs/SOLARIS/osi_vm.c b/src/afs/SOLARIS/osi_vm.c index 4817ab43f..691c8951a 100644 --- a/src/afs/SOLARIS/osi_vm.c +++ b/src/afs/SOLARIS/osi_vm.c @@ -8,14 +8,15 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_vm.c,v 1.1.1.5 2002/05/10 23:44:14 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vm.c,v 1.8 2003/07/15 23:14:26 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/nfsclient.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/nfsclient.h" #if defined(AFS_SUN5_ENV) /* This file contains Solaris VM-related code for the cache manager. */ @@ -43,17 +44,14 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_vm.c,v 1.1.1.5 2002/05/ * Locking: only the global lock is held on entry. */ int -osi_VM_GetDownD(avc, adc) - struct vcache *avc; - struct dcache *adc; +osi_VM_GetDownD(struct vcache *avc, struct dcache *adc) { int code; AFS_GUNLOCK(); - code = afs_putpage(AFSTOV(avc), - (offset_t) AFS_CHUNKTOBASE(adc->f.chunk), - AFS_CHUNKTOSIZE(adc->f.chunk), - B_INVAL, CRED()); + code = + afs_putpage(AFSTOV(avc), (offset_t) AFS_CHUNKTOBASE(adc->f.chunk), + AFS_CHUNKTOSIZE(adc->f.chunk), B_INVAL, CRED()); AFS_GLOCK(); return code; @@ -74,9 +72,7 @@ osi_VM_GetDownD(avc, adc) * therefore obsolescent. */ int -osi_VM_FlushVCache(avc, slept) - struct vcache *avc; - int *slept; +osi_VM_FlushVCache(struct vcache *avc, int *slept) { if (avc->vrefCount != 0) return EBUSY; @@ -91,12 +87,12 @@ osi_VM_FlushVCache(avc, slept) return EBUSY; AFS_GUNLOCK(); - pvn_vplist_dirty(AFSTOV(avc), 0, NULL, B_TRUNC|B_INVAL, CRED()); + pvn_vplist_dirty(AFSTOV(avc), 0, NULL, B_TRUNC | B_INVAL, CRED()); AFS_GLOCK(); /* Might as well make the obvious check */ if (AFSTOV(avc)->v_pages) - return EBUSY; /* should be all gone still */ + return EBUSY; /* should be all gone still */ rw_destroy(&avc->rwlock); if (avc->credp) { @@ -114,15 +110,14 @@ osi_VM_FlushVCache(avc, slept) * re-obtained. */ void -osi_VM_StoreAllSegments(avc) - struct vcache *avc; +osi_VM_StoreAllSegments(struct vcache *avc) { AFS_GUNLOCK(); #if defined(AFS_SUN56_ENV) - (void) pvn_vplist_dirty(AFSTOV(avc), (u_offset_t)0, afs_putapage, - 0, CRED()); + (void)pvn_vplist_dirty(AFSTOV(avc), (u_offset_t) 0, afs_putapage, 0, + CRED()); #else - (void) pvn_vplist_dirty(AFSTOV(avc), 0, afs_putapage, 0, CRED()); + (void)pvn_vplist_dirty(AFSTOV(avc), 0, afs_putapage, 0, CRED()); #endif AFS_GLOCK(); } @@ -134,18 +129,15 @@ osi_VM_StoreAllSegments(avc) * re-obtained. */ void -osi_VM_TryToSmush(avc, acred, sync) - struct vcache *avc; - struct AFS_UCRED *acred; - int sync; +osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync) { AFS_GUNLOCK(); #if defined(AFS_SUN56_ENV) - (void) pvn_vplist_dirty(AFSTOV(avc), (u_offset_t)0, afs_putapage, - (sync ? B_INVAL : B_FREE), acred); + (void)pvn_vplist_dirty(AFSTOV(avc), (u_offset_t) 0, afs_putapage, + (sync ? B_INVAL : B_FREE), acred); #else - (void) pvn_vplist_dirty(AFSTOV(avc), 0, afs_putapage, - (sync ? B_INVAL : B_FREE), acred); + (void)pvn_vplist_dirty(AFSTOV(avc), 0, afs_putapage, + (sync ? B_INVAL : B_FREE), acred); #endif AFS_GLOCK(); } @@ -155,15 +147,12 @@ osi_VM_TryToSmush(avc, acred, sync) * Locking: No lock is held, not even the global lock. */ void -osi_VM_FlushPages(avc, credp) - struct vcache *avc; - struct AFS_UCRED *credp; +osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) { extern int afs_pvn_vptrunc; afs_pvn_vptrunc++; - (void) afs_putpage(AFSTOV(avc), (offset_t)0, 0, - B_TRUNC|B_INVAL, credp); + (void)afs_putpage(AFSTOV(avc), (offset_t) 0, 0, B_TRUNC | B_INVAL, credp); } /* Zero no-longer-used part of last page, when truncating a file @@ -175,10 +164,7 @@ osi_VM_FlushPages(avc, credp) * be called first, since it causes a pagein. */ void -osi_VM_PreTruncate(avc, alen, acred) - struct vcache *avc; - int alen; - struct AFS_UCRED *acred; +osi_VM_PreTruncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) { page_t *pp; int pageOffset = (alen & PAGEOFFSET); @@ -195,7 +181,7 @@ osi_VM_PreTruncate(avc, alen, acred) page_unlock(pp); } AFS_GLOCK(); - ObtainWriteLock(&avc->lock,563); + ObtainWriteLock(&avc->lock, 563); } /* Purge pages beyond end-of-file, when truncating a file. @@ -204,16 +190,13 @@ osi_VM_PreTruncate(avc, alen, acred) * Pageins are blocked (activeV is raised). */ void -osi_VM_Truncate(avc, alen, acred) - struct vcache *avc; - int alen; - struct AFS_UCRED *acred; +osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) { /* * It's OK to specify afs_putapage here, even though we aren't holding * the vcache entry lock, because it isn't going to get called. */ - pvn_vplist_dirty(AFSTOV(avc), alen, afs_putapage, B_TRUNC|B_INVAL, + pvn_vplist_dirty(AFSTOV(avc), alen, afs_putapage, B_TRUNC | B_INVAL, acred); } diff --git a/src/afs/SOLARIS/osi_vnodeops.c b/src/afs/SOLARIS/osi_vnodeops.c index d06ca8284..752e92b3f 100644 --- a/src/afs/SOLARIS/osi_vnodeops.c +++ b/src/afs/SOLARIS/osi_vnodeops.c @@ -8,9 +8,10 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.1.1.11 2002/12/11 02:36:21 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.19 2003/07/15 23:14:26 shadow Exp $"); #if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) /* @@ -32,10 +33,10 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.1.1.11 2 * Variables: Afs_vnodeops * */ -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/nfsclient.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/nfsclient.h" #include @@ -47,7 +48,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.1.1.11 2 #include #include #include -#if defined(AFS_SUN5_ENV) +#if defined(AFS_SUN5_ENV) #include #include #else @@ -100,9 +101,9 @@ afs_fc2errno(faultcode_t fc) } -extern struct as kas; /* kernel addr space */ -extern unsigned char *afs_indexFlags; -extern afs_lock_t afs_xdcache; +extern struct as kas; /* kernel addr space */ +extern unsigned char *afs_indexFlags; +extern afs_lock_t afs_xdcache; /* Additional vnodeops for SunOS 4.0.x */ int afs_nfsrdwr(), afs_getpage(), afs_putpage(), afs_map(); @@ -112,35 +113,38 @@ int afs_pvn_vptrunc; #ifdef AFS_SUN5_ENV -int afs_addmap(avp, offset, asp, addr, length, prot, maxprot, flags, credp) - register struct vnode *avp; - offset_t offset; - struct as *asp; - caddr_t addr; - int length, prot, maxprot, flags; - struct AFS_UCRED *credp; +int +afs_addmap(avp, offset, asp, addr, length, prot, maxprot, flags, credp) + register struct vnode *avp; + offset_t offset; + struct as *asp; + caddr_t addr; + int length, prot, maxprot, flags; + struct AFS_UCRED *credp; { /* XXX What should we do here?? XXX */ return (0); } -int afs_delmap(avp, offset, asp, addr, length, prot, maxprot, flags, credp) - register struct vnode *avp; - offset_t offset; - struct as *asp; - caddr_t addr; - int length, prot, maxprot, flags; - struct AFS_UCRED *credp; +int +afs_delmap(avp, offset, asp, addr, length, prot, maxprot, flags, credp) + register struct vnode *avp; + offset_t offset; + struct as *asp; + caddr_t addr; + int length, prot, maxprot, flags; + struct AFS_UCRED *credp; { /* XXX What should we do here?? XXX */ return (0); } -int afs_vmread(avp, auio, ioflag, acred) - register struct vnode *avp; - struct uio *auio; - int ioflag; - struct AFS_UCRED *acred; +int +afs_vmread(avp, auio, ioflag, acred) + register struct vnode *avp; + struct uio *auio; + int ioflag; + struct AFS_UCRED *acred; { register int code; @@ -153,11 +157,12 @@ int afs_vmread(avp, auio, ioflag, acred) } -int afs_vmwrite(avp, auio, ioflag, acred) - register struct vnode *avp; - struct uio *auio; - int ioflag; - struct AFS_UCRED *acred; +int +afs_vmwrite(avp, auio, ioflag, acred) + register struct vnode *avp; + struct uio *auio; + int ioflag; + struct AFS_UCRED *acred; { register int code; @@ -169,31 +174,29 @@ int afs_vmwrite(avp, auio, ioflag, acred) return code; } -#endif /* AFS_SUN5_ENV */ +#endif /* AFS_SUN5_ENV */ -int afs_getpage(vp, off, len, protp, pl, plsz, seg, addr, rw, acred) -struct vnode *vp; -u_int len; -u_int *protp; -struct page *pl[]; -u_int plsz; -struct seg *seg; +int +afs_getpage(vp, off, len, protp, pl, plsz, seg, addr, rw, acred) + struct vnode *vp; + u_int len; + u_int *protp; + struct page *pl[]; + u_int plsz; + struct seg *seg; #ifdef AFS_SUN5_ENV -offset_t off; -caddr_t addr; + offset_t off; + caddr_t addr; #else -u_int off; -addr_t addr; + u_int off; + addr_t addr; #endif -enum seg_rw rw; -struct AFS_UCRED *acred; + enum seg_rw rw; + struct AFS_UCRED *acred; { register afs_int32 code = 0; -#if defined(AFS_SUN56_ENV) - u_offset_t toff = (u_offset_t)off; -#endif - AFS_STATCNT(afs_getpage); + #ifdef AFS_SUN5_ENV if (vp->v_flag & VNOMAP) /* File doesn't allow mapping */ return (ENOSYS); @@ -203,17 +206,18 @@ struct AFS_UCRED *acred; #if defined(AFS_SUN56_ENV) if (len <= PAGESIZE) - code = afs_GetOnePage(vp, toff, len, protp, pl, plsz, - seg, addr, rw, acred); + code = + afs_GetOnePage(vp, off, len, protp, pl, plsz, seg, addr, rw, + acred); #else #ifdef AFS_SUN5_ENV if (len <= PAGESIZE) - code = afs_GetOnePage(vp, (u_int)off, len, protp, pl, plsz, - seg, addr, rw, acred); + code = + afs_GetOnePage(vp, (u_int) off, len, protp, pl, plsz, seg, addr, + rw, acred); #else if (len == PAGESIZE) - code = afs_GetOnePage(vp, off, protp, pl, plsz, - seg, addr, rw, acred); + code = afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred); #endif #endif else { @@ -225,11 +229,13 @@ struct AFS_UCRED *acred; #endif afs_BozonLock(&vcp->pvnLock, vcp); #if defined(AFS_SUN56_ENV) - code = pvn_getpages(afs_GetOnePage, vp, toff, - len, protp, pl, plsz, seg, addr, rw, acred); + code = + pvn_getpages(afs_GetOnePage, vp, off, len, protp, pl, plsz, seg, + addr, rw, acred); #else - code = pvn_getpages(afs_GetOnePage, vp, (u_int)off, - len, protp, pl, plsz, seg, addr, rw, acred); + code = + pvn_getpages(afs_GetOnePage, vp, (u_int) off, len, protp, pl, + plsz, seg, addr, rw, acred); #endif afs_BozonUnlock(&vcp->pvnLock, vcp); #ifdef AFS_SUN5_ENV @@ -244,28 +250,30 @@ struct AFS_UCRED *acred; /* Return all the pages from [off..off+len) in file */ #ifdef AFS_SUN5_ENV -int afs_GetOnePage(vp, off, alen, protp, pl, plsz, seg, addr, rw, acred) -u_int alen; +int +afs_GetOnePage(vp, off, alen, protp, pl, plsz, seg, addr, rw, acred) + u_int alen; #else -int afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) +int +afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred) #endif -struct vnode *vp; + struct vnode *vp; #if defined(AFS_SUN56_ENV) -u_offset_t off; + u_offset_t off; #else -u_int off; + u_int off; #endif -u_int *protp; -struct page *pl[]; -u_int plsz; -struct seg *seg; + u_int *protp; + struct page *pl[]; + u_int plsz; + struct seg *seg; #ifdef AFS_SUN5_ENV -caddr_t addr; + caddr_t addr; #else -addr_t addr; + addr_t addr; #endif -enum seg_rw rw; -struct AFS_UCRED *acred; + enum seg_rw rw; + struct AFS_UCRED *acred; { register struct page *page; register afs_int32 code = 0; @@ -275,49 +283,93 @@ struct AFS_UCRED *acred; register struct vcache *avc; register struct dcache *tdc; int i, s, pexists; - int slot, offset, nlen; + int slot; + afs_size_t offset, nlen; struct vrequest treq; - afs_int32 mapForRead = 0, Code=0; + afs_int32 mapForRead = 0, Code = 0; #if defined(AFS_SUN56_ENV) - u_offset_t toffset; + u_offset_t toffset; #else - afs_int32 toffset; + afs_int32 toffset; #endif - if (!acred) + if (!acred) #ifdef AFS_SUN5_ENV osi_Panic("GetOnePage: !acred"); #else - acred = u.u_cred; /* better than nothing */ + acred = u.u_cred; /* better than nothing */ #endif - avc = VTOAFS(vp); /* cast to afs vnode */ + avc = VTOAFS(vp); /* cast to afs vnode */ #ifdef AFS_SUN5_ENV - if (avc->credp /*&& AFS_NFSXLATORREQ(acred)*/ && AFS_NFSXLATORREQ(avc->credp)) { + if (avc->credp /*&& AFS_NFSXLATORREQ(acred) */ + && AFS_NFSXLATORREQ(avc->credp)) { acred = avc->credp; } #endif - if (code = afs_InitReq(&treq, acred)) return code; + if (code = afs_InitReq(&treq, acred)) + return code; if (!pl) { - /* - * This is a read-ahead request, e.g. due to madvise. - */ - tdc = afs_GetDCache(avc, (afs_int32)off, &treq, &offset, &nlen, 1); - if (!tdc) return 0; + /* This is a read-ahead request, e.g. due to madvise. */ +#ifdef AFS_SUN5_ENV + int plen = alen; +#else + int plen = PAGESIZE; +#endif + ObtainReadLock(&avc->lock); - if (!(tdc->flags & DFNextStarted)) { - ObtainReadLock(&avc->lock); - afs_PrefetchChunk(avc, tdc, acred, &treq); - ReleaseReadLock(&avc->lock); + while (plen > 0 && !afs_BBusy()) { + /* Obtain a dcache entry at off. 2 means don't fetch data. */ + tdc = + afs_GetDCache(avc, (afs_offs_t) off, &treq, &offset, &nlen, + 2); + if (!tdc) + break; + + /* Write-lock the dcache entry, if we don't succeed, just go on */ + if (0 != NBObtainWriteLock(&tdc->lock, 642)) { + afs_PutDCache(tdc); + goto next_prefetch; + } + + /* If we aren't already fetching this dcache entry, queue it */ + if (!(tdc->mflags & DFFetchReq)) { + struct brequest *bp; + + tdc->mflags |= DFFetchReq; + bp = afs_BQueue(BOP_FETCH, avc, B_DONTWAIT, 0, acred, + (afs_size_t) off, (afs_size_t) 1, tdc); + if (!bp) { + /* Unable to start background fetch; might as well stop */ + tdc->mflags &= ~DFFetchReq; + ReleaseWriteLock(&tdc->lock); + afs_PutDCache(tdc); + break; + } + ReleaseWriteLock(&tdc->lock); + } else { + ReleaseWriteLock(&tdc->lock); + afs_PutDCache(tdc); + } + + next_prefetch: + /* Adjust our offset and remaining length values */ + off += nlen; + plen -= nlen; + + /* If we aren't making progress for some reason, bail out */ + if (nlen <= 0) + break; } - afs_PutDCache(tdc); + + ReleaseReadLock(&avc->lock); return 0; } len = PAGESIZE; - pl[0] = NULL; /* Make sure it's empty */ + pl[0] = NULL; /* Make sure it's empty */ /* first, obtain the proper lock for the VM system */ @@ -328,42 +380,46 @@ struct AFS_UCRED *acred; * pages for the range covered by a chunk when we swap out the * chunk. */ - if (rw == S_READ || rw == S_EXEC) + if (rw == S_READ || rw == S_EXEC) mapForRead = 1; - if (protp) *protp = PROT_ALL; + if (protp) + *protp = PROT_ALL; #ifndef AFS_SUN5_ENV if (AFS_NFSXLATORREQ(acred)) { if (rw == S_READ) { - if (!afs_AccessOK(avc, PRSFS_READ, &treq, - CHECK_MODE_BITS|CMB_ALLOW_EXEC_AS_READ)) { + if (!afs_AccessOK + (avc, PRSFS_READ, &treq, + CHECK_MODE_BITS | CMB_ALLOW_EXEC_AS_READ)) { return EACCES; } } } #endif -retry: + + retry: #ifdef AFS_SUN5_ENV if (rw == S_WRITE || rw == S_CREATE) - tdc = afs_GetDCache(avc, (afs_int32)off, &treq, &offset, &nlen, 5); + tdc = afs_GetDCache(avc, (afs_offs_t) off, &treq, &offset, &nlen, 5); else - tdc = afs_GetDCache(avc, (afs_int32)off, &treq, &offset, &nlen, 1); - if (!tdc) return EINVAL; + tdc = afs_GetDCache(avc, (afs_offs_t) off, &treq, &offset, &nlen, 1); + if (!tdc) + return EINVAL; #endif code = afs_VerifyVCache(avc, &treq); if (code) { #ifdef AFS_SUN5_ENV afs_PutDCache(tdc); -#endif - return afs_CheckCode(code, &treq, 44); /* failed to get it */ +#endif + return afs_CheckCode(code, &treq, 44); /* failed to get it */ } afs_BozonLock(&avc->pvnLock, avc); ObtainReadLock(&avc->lock); afs_Trace4(afs_iclSetp, CM_TRACE_PAGEIN, ICL_TYPE_POINTER, (afs_int32) vp, - ICL_TYPE_LONG, (afs_int32) off, ICL_TYPE_LONG, (afs_int32) len, - ICL_TYPE_LONG, (int) rw); + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(off), ICL_TYPE_LONG, len, + ICL_TYPE_LONG, (int)rw); tlen = len; slot = 0; @@ -373,10 +429,10 @@ retry: * the locks and try again when the VM purge is done. */ ObtainWriteLock(&avc->vlock, 550); if (avc->activeV) { - ReleaseReadLock(&avc->lock); - ReleaseWriteLock(&avc->vlock); + ReleaseReadLock(&avc->lock); + ReleaseWriteLock(&avc->vlock); afs_BozonUnlock(&avc->pvnLock, avc); - afs_PutDCache(tdc); + afs_PutDCache(tdc); /* Check activeV again, it may have been turned off * while we were waiting for a lock in afs_PutDCache */ ObtainWriteLock(&avc->vlock, 574); @@ -389,28 +445,33 @@ retry: } goto retry; } - ReleaseWriteLock(&avc->vlock); + ReleaseWriteLock(&avc->vlock); #endif + /* We're about to do stuff with our dcache entry.. Lock it. */ + ObtainReadLock(&tdc->lock); + /* Check to see whether the cache entry is still valid */ if (!(avc->states & CStatd) || !hsame(avc->m.DataVersion, tdc->f.versionNo)) { - ReleaseReadLock(&avc->lock); + ReleaseReadLock(&tdc->lock); + ReleaseReadLock(&avc->lock); afs_BozonUnlock(&avc->pvnLock, avc); afs_PutDCache(tdc); goto retry; } AFS_GUNLOCK(); - while (1) { /* loop over all pages */ + while (1) { /* loop over all pages */ /* now, try to find the page in memory (it may already be intransit or laying - around the free list */ - page = page_lookup( vp, toffset, (rw == S_CREATE ? SE_EXCL : SE_SHARED) ); - if (page) + * around the free list */ + page = + page_lookup(vp, toffset, (rw == S_CREATE ? SE_EXCL : SE_SHARED)); + if (page) goto nextpage; /* if we make it here, we can't find the page in memory. Do a real disk read - from the cache to get the data */ + * from the cache to get the data */ Code |= 0x200; /* XXX */ #ifdef AFS_SUN5_ENV #if defined(AFS_SUN54_ENV) @@ -420,9 +481,13 @@ retry: * in case someone tries to relax all the serialization of read and write * operations with harmless things like stat. */ #if defined(AFS_SUN58_ENV) - page = page_create_va(vp, toffset, PAGESIZE, PG_WAIT|PG_EXCL, seg, addr); + page = + page_create_va(vp, toffset, PAGESIZE, PG_WAIT | PG_EXCL, seg, + addr); #else - page = page_create_va(vp, toffset, PAGESIZE, PG_WAIT|PG_EXCL, seg->s_as, addr); + page = + page_create_va(vp, toffset, PAGESIZE, PG_WAIT | PG_EXCL, + seg->s_as, addr); #endif #else page = page_create(vp, toffset, PAGESIZE, PG_WAIT); @@ -431,37 +496,40 @@ retry: continue; } if (alen < PAGESIZE) - pagezero(page, alen, PAGESIZE-alen); + pagezero(page, alen, PAGESIZE - alen); #else page = rm_allocpage(seg, addr, PAGESIZE, 1); /* can't fail */ - if (!page) osi_Panic("afs_getpage alloc page"); + if (!page) + osi_Panic("afs_getpage alloc page"); /* we get a circularly-linked list of pages back, but we expect only - one, since that's what we asked for */ - if (page->p_next != page) osi_Panic("afs_getpage list"); + * one, since that's what we asked for */ + if (page->p_next != page) + osi_Panic("afs_getpage list"); /* page enter returns a locked page; we'll drop the lock as a side-effect - of the pvn_done done by afs_ustrategy. If we decide not to call - strategy, we must be sure to call pvn_fail, at least, to release the - page locks and otherwise reset the pages. The page, while locked, is - not held, for what it is worth */ + * of the pvn_done done by afs_ustrategy. If we decide not to call + * strategy, we must be sure to call pvn_fail, at least, to release the + * page locks and otherwise reset the pages. The page, while locked, is + * not held, for what it is worth */ page->p_intrans = 1; /* set appropriate flags */ page->p_pagein = 1; /* next call shouldn't fail, since we have pvnLock set */ - if (page_enter(page, vp, toffset)) osi_Panic("afs_getpage enter race"); -#endif /* AFS_SUN5_ENV */ + if (page_enter(page, vp, toffset)) + osi_Panic("afs_getpage enter race"); +#endif /* AFS_SUN5_ENV */ #ifdef AFS_SUN5_ENV - if (rw == S_CREATE) { + if (rw == S_CREATE) { /* XXX Don't read from AFS in write only cases XXX */ page_io_unlock(page); - } else + } else #else if (0) { /* XXX Don't read from AFS in write only cases XXX */ page->p_intrans = page->p_pagein = 0; page_unlock(page); /* XXX */ - } else + } else #endif - { + { #ifndef AFS_SUN5_ENV PAGE_HOLD(page); #endif @@ -472,20 +540,23 @@ retry: #endif buf->b_dev = 0; buf->b_blkno = btodb(toffset); - bp_mapin(buf); /* map it in to our address space */ -#ifndef AFS_SUN5_ENV - ReleaseReadLock(&avc->lock); -#endif + bp_mapin(buf); /* map it in to our address space */ + #if defined(AFS_SUN5_ENV) AFS_GLOCK(); + /* afs_ustrategy will want to lock the dcache entry */ + ReleaseReadLock(&tdc->lock); code = afs_ustrategy(buf, acred); /* do the I/O */ + ObtainReadLock(&tdc->lock); AFS_GUNLOCK(); #else + ReleaseReadLock(&tdc->lock); + ReleaseReadLock(&avc->lock); code = afs_ustrategy(buf); /* do the I/O */ -#endif -#ifndef AFS_SUN5_ENV ObtainReadLock(&avc->lock); + ObtainReadLock(&tdc->lock); #endif + #ifdef AFS_SUN5_ENV /* Before freeing unmap the buffer */ bp_mapout(buf); @@ -508,9 +579,9 @@ retry: #ifdef AFS_SUN5_ENV /* The p_selock must be downgraded to a shared lock after the page is read */ #if defined(AFS_SUN56_ENV) - if ((rw != S_CREATE) && !(PAGE_SHARED(page))) + if ((rw != S_CREATE) && !(PAGE_SHARED(page))) #else - if ((rw != S_CREATE) && !(se_shared_assert(&page->p_selock))) + if ((rw != S_CREATE) && !(se_shared_assert(&page->p_selock))) #endif { page_downgrade(page); @@ -524,20 +595,23 @@ retry: toffset += PAGESIZE; addr += PAGESIZE; tlen -= PAGESIZE; - if (tlen <= 0) break; /* done all the pages */ - } /* while (1) ... */ + if (tlen <= 0) + break; /* done all the pages */ + } /* while (1) ... */ AFS_GLOCK(); - pl[slot] = (struct page *) 0; - /* - * XXX This seems kind-of wrong: we shouldn't be modifying - * avc->states while not holding the write lock (even - * though nothing really uses CHasPages..) - */ - avc->states |= CHasPages; + pl[slot] = NULL; + ReleaseReadLock(&tdc->lock); + + /* Prefetch next chunk if we're at a chunk boundary */ + if (AFS_CHUNKOFFSET(off) == 0) { + if (!(tdc->mflags & DFNextStarted)) + afs_PrefetchChunk(avc, tdc, acred, &treq); + } + ReleaseReadLock(&avc->lock); #ifdef AFS_SUN5_ENV - ObtainWriteLock(&afs_xdcache,246); + ObtainWriteLock(&afs_xdcache, 246); if (!mapForRead) { /* track that we have dirty (or dirty-able) pages for this chunk. */ afs_indexFlags[tdc->index] |= IFDirtyPages; @@ -549,37 +623,39 @@ retry: #ifdef AFS_SUN5_ENV afs_PutDCache(tdc); #endif - afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_LONG, code, ICL_TYPE_LONG, (int)page, - ICL_TYPE_LONG, Code); + afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_LONG, code, + ICL_TYPE_LONG, (int)page, ICL_TYPE_LONG, Code); return 0; bad: AFS_GLOCK(); - afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_LONG, code, ICL_TYPE_LONG, (int)page, - ICL_TYPE_LONG, Code); + afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_LONG, code, + ICL_TYPE_LONG, (int)page, ICL_TYPE_LONG, Code); /* release all pages, drop locks, return code */ #ifdef AFS_SUN5_ENV - if (page) + if (page) pvn_read_done(page, B_ERROR); #else - for(i=0; ilock); afs_BozonUnlock(&avc->pvnLock, avc); #ifdef AFS_SUN5_ENV + ReleaseReadLock(&tdc->lock); afs_PutDCache(tdc); #endif return code; } #ifdef AFS_SUN5_ENV -int afs_putpage(vp, off, len, flags, cred) - struct vnode *vp; - offset_t off; - u_int len; - int flags; - struct AFS_UCRED *cred; +int +afs_putpage(vp, off, len, flags, cred) + struct vnode *vp; + offset_t off; + u_int len; + int flags; + struct AFS_UCRED *cred; { struct vcache *avc; struct page *pages; @@ -589,43 +665,53 @@ int afs_putpage(vp, off, len, flags, cred) #else afs_int32 tlen; #endif - afs_int32 endPos, NPages=0; + afs_offs_t endPos; + afs_int32 NPages = 0; #if defined(AFS_SUN56_ENV) u_offset_t toff = off; #else int toff = (int)off; #endif + int didWriteLock; AFS_STATCNT(afs_putpage); - if (vp->v_flag & VNOMAP) /* file doesn't allow mapping */ + if (vp->v_flag & VNOMAP) /* file doesn't allow mapping */ return (ENOSYS); /* * Putpage (ASYNC) is called every sec to flush out dirty vm pages */ AFS_GLOCK(); - afs_Trace4(afs_iclSetp, CM_TRACE_PAGEOUT, ICL_TYPE_POINTER, (afs_int32) vp, - ICL_TYPE_LONG, (afs_int32) off, ICL_TYPE_LONG, (afs_int32) len, - ICL_TYPE_LONG, (int) flags); + afs_Trace4(afs_iclSetp, CM_TRACE_PAGEOUT, ICL_TYPE_POINTER, + (afs_int32) vp, ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(off), + ICL_TYPE_INT32, (afs_int32) len, ICL_TYPE_LONG, (int)flags); avc = VTOAFS(vp); afs_BozonLock(&avc->pvnLock, avc); - ObtainWriteLock(&avc->lock,247); + ObtainSharedLock(&avc->lock, 247); + didWriteLock = 0; /* Get a list of modified (or whatever) pages */ if (len) { - endPos = (int)off + len; /* position we're supposed to write up to */ - while ((afs_int32)toff < endPos && (afs_int32)toff < avc->m.Length) { + endPos = (afs_offs_t) off + len; /* position we're supposed to write up to */ + while ((afs_offs_t) toff < endPos + && (afs_offs_t) toff < avc->m.Length) { /* If not invalidating pages use page_lookup_nowait to avoid reclaiming * them from the free list */ AFS_GUNLOCK(); - if (flags & (B_FREE|B_INVAL)) + if (flags & (B_FREE | B_INVAL)) pages = page_lookup(vp, toff, SE_EXCL); else pages = page_lookup_nowait(vp, toff, SE_SHARED); - if (!pages || !pvn_getdirty(pages, flags)) + if (!pages || !pvn_getdirty(pages, flags)) tlen = PAGESIZE; else { + if (!didWriteLock) { + AFS_GLOCK(); + didWriteLock = 1; + UpgradeSToWLock(&avc->lock, 671); + AFS_GUNLOCK(); + } NPages++; code = afs_putapage(vp, pages, &toff, &tlen, flags, cred); if (code) { @@ -637,56 +723,70 @@ int afs_putpage(vp, off, len, flags, cred) AFS_GLOCK(); } } else { + if (!didWriteLock) { + UpgradeSToWLock(&avc->lock, 670); + didWriteLock = 1; + } + AFS_GUNLOCK(); -#if defined(AFS_SUN56_ENV) +#if defined(AFS_SUN56_ENV) code = pvn_vplist_dirty(vp, toff, afs_putapage, flags, cred); #else - code = pvn_vplist_dirty(vp, (u_int)off, afs_putapage, flags, cred); + code = pvn_vplist_dirty(vp, (u_int) off, afs_putapage, flags, cred); #endif AFS_GLOCK(); } - if (code && !avc->vc_error) + if (code && !avc->vc_error) { + if (!didWriteLock) { + UpgradeSToWLock(&avc->lock, 669); + didWriteLock = 1; + } avc->vc_error = code; + } - ReleaseWriteLock(&avc->lock); + if (didWriteLock) + ReleaseWriteLock(&avc->lock); + else + ReleaseSharedLock(&avc->lock); afs_BozonUnlock(&avc->pvnLock, avc); - afs_Trace2(afs_iclSetp, CM_TRACE_PAGEOUTDONE, ICL_TYPE_LONG, code, ICL_TYPE_LONG, NPages); + afs_Trace2(afs_iclSetp, CM_TRACE_PAGEOUTDONE, ICL_TYPE_LONG, code, + ICL_TYPE_LONG, NPages); AFS_GUNLOCK(); return (code); } -int afs_putapage(struct vnode *vp, struct page *pages, +int +afs_putapage(struct vnode *vp, struct page *pages, #if defined(AFS_SUN56_ENV) - u_offset_t *offp, + u_offset_t * offp, #else - u_int *offp, + u_int * offp, #endif #if defined(AFS_SUN58_ENV) - size_t *lenp, + size_t * lenp, #else - u_int *lenp, + u_int * lenp, #endif - int flags, struct AFS_UCRED *credp) + int flags, struct AFS_UCRED *credp) { struct buf *tbuf; struct vcache *avc = VTOAFS(vp); afs_int32 code = 0; - u_int toff, tlen = PAGESIZE, off = (pages->p_offset/PAGESIZE)*PAGESIZE; - u_int poff = pages->p_offset; + u_int tlen = PAGESIZE; + afs_offs_t off = (pages->p_offset / PAGESIZE) * PAGESIZE; /* * Now we've got the modified pages. All pages are locked and held * XXX Find a kluster that fits in one block (or page). We also * adjust the i/o if the file space is less than a while page. XXX */ - toff = off; - if (tlen+toff > avc->m.Length) { - tlen = avc->m.Length - toff; + if (off + tlen > avc->m.Length) { + tlen = avc->m.Length - off; } /* can't call mapout with 0 length buffers (rmfree panics) */ - if (((tlen>>24)&0xff) == 0xff) { + if (((tlen >> 24) & 0xff) == 0xff) { tlen = 0; } if ((int)tlen > 0) { @@ -694,36 +794,41 @@ int afs_putapage(struct vnode *vp, struct page *pages, * Can't call mapout with 0 length buffers since we'll get rmfree panics */ tbuf = pageio_setup(pages, tlen, vp, B_WRITE | flags); - if (!tbuf) return (ENOMEM); + if (!tbuf) + return (ENOMEM); tbuf->b_dev = 0; tbuf->b_blkno = btodb(pages->p_offset); bp_mapin(tbuf); AFS_GLOCK(); - afs_Trace4(afs_iclSetp, CM_TRACE_PAGEOUTONE, ICL_TYPE_LONG, avc, ICL_TYPE_LONG, pages, - ICL_TYPE_LONG, tlen, ICL_TYPE_LONG, toff); + afs_Trace4(afs_iclSetp, CM_TRACE_PAGEOUTONE, ICL_TYPE_LONG, avc, + ICL_TYPE_LONG, pages, ICL_TYPE_LONG, tlen, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(off)); code = afs_ustrategy(tbuf, credp); /* unlocks page */ AFS_GUNLOCK(); bp_mapout(tbuf); } - pvn_write_done(pages, ((code) ? B_ERROR:0) | B_WRITE | flags); + pvn_write_done(pages, ((code) ? B_ERROR : 0) | B_WRITE | flags); if ((int)tlen > 0) pageio_done(tbuf); - if (offp) *offp = toff; - if (lenp) *lenp = tlen; + if (offp) + *offp = off; + if (lenp) + *lenp = tlen; return code; } -#else AFS_SUN5_ENV +#else /* AFS_SUN5_ENV */ -int afs_putpage(vp, off, len, flags, cred) -struct vnode *vp; -u_int off; -u_int len; -int flags; -struct AFS_UCRED *cred; +int +afs_putpage(vp, off, len, flags, cred) + struct vnode *vp; + u_int off; + u_int len; + int flags; + struct AFS_UCRED *cred; { - int wholeEnchilada; /* true if we must get all of the pages */ + int wholeEnchilada; /* true if we must get all of the pages */ struct vcache *avc; struct page *pages; struct page *tpage; @@ -734,44 +839,49 @@ struct AFS_UCRED *cred; afs_int32 clusterStart, clusterEnd, endPos; /* In the wholeEnchilada case, we must ensure that we get all of the pages - from the system, since we're doing this to shutdown the use of a vnode */ + * from the system, since we're doing this to shutdown the use of a vnode */ AFS_STATCNT(afs_putpage); - wholeEnchilada = (off == 0 && len == 0 && (flags & (B_INVAL|B_ASYNC)) == B_INVAL); + wholeEnchilada = (off == 0 && len == 0 + && (flags & (B_INVAL | B_ASYNC)) == B_INVAL); avc = VTOAFS(vp); afs_BozonLock(&avc->pvnLock, avc); - ObtainWriteLock(&avc->lock,248); + ObtainWriteLock(&avc->lock, 248); while (1) { /* in whole enchilada case, loop until call to pvn_getdirty can't find - any more modified pages */ + * any more modified pages */ /* first we try to get a list of modified (or whatever) pages */ if (len == 0) { pages = pvn_vplist_dirty(vp, off, flags); - } - else { + } else { endPos = off + len; /* position we're supposed to write up to */ - if (endPos > avc->m.Length) endPos = avc->m.Length; /* bound by this */ - clusterStart = off & ~(PAGESIZE-1); /* round down to nearest page */ - clusterEnd = ((endPos-1) | (PAGESIZE-1))+1; /* round up to nearest page */ - pages = pvn_range_dirty(vp, off, endPos, clusterStart, clusterEnd, flags); + if (endPos > avc->m.Length) + endPos = avc->m.Length; /* bound by this */ + clusterStart = off & ~(PAGESIZE - 1); /* round down to nearest page */ + clusterEnd = ((endPos - 1) | (PAGESIZE - 1)) + 1; /* round up to nearest page */ + pages = + pvn_range_dirty(vp, off, endPos, clusterStart, clusterEnd, + flags); } - + /* Now we've got the modified pages. All pages are locked and held */ rcode = 0; /* return code */ - while(pages) { /* look over all pages in the returned set */ + while (pages) { /* look over all pages in the returned set */ tpage = pages; /* get first page in the list */ /* write out the page */ poffset = tpage->p_offset; /* where the page starts in the file */ /* tlen will represent the end of the range to write, for a while */ - tlen = PAGESIZE+poffset; /* basic place to end tpage write */ + tlen = PAGESIZE + poffset; /* basic place to end tpage write */ /* but we also don't want to write past end of off..off+len range */ - if (len != 0 && tlen > off+len) tlen = off+len; + if (len != 0 && tlen > off + len) + tlen = off + len; /* and we don't want to write past the end of the file */ - if (tlen > avc->m.Length) tlen = avc->m.Length; + if (tlen > avc->m.Length) + tlen = avc->m.Length; /* and we don't want to write at all if page starts after end */ if (poffset >= tlen) { pvn_fail(pages, B_WRITE | flags); @@ -782,28 +892,29 @@ struct AFS_UCRED *cred; page_sub(&pages, tpage); /* remove tpage from "pages" list */ tbuf = pageio_setup(tpage, tlen, vp, B_WRITE | flags); if (!tbuf) { - pvn_fail(tpage, B_WRITE|flags); - pvn_fail(pages, B_WRITE|flags); + pvn_fail(tpage, B_WRITE | flags); + pvn_fail(pages, B_WRITE | flags); goto done; } tbuf->b_dev = 0; tbuf->b_blkno = btodb(tpage->p_offset); bp_mapin(tbuf); ReleaseWriteLock(&avc->lock); /* can't hold during strategy call */ - code = afs_ustrategy(tbuf); /* unlocks page */ - ObtainWriteLock(&avc->lock,249); /* re-obtain */ + code = afs_ustrategy(tbuf); /* unlocks page */ + ObtainWriteLock(&avc->lock, 249); /* re-obtain */ if (code) { /* unlocking of tpage is done by afs_ustrategy */ rcode = code; if (pages) /* may have already removed last page */ - pvn_fail(pages, B_WRITE|flags); + pvn_fail(pages, B_WRITE | flags); goto done; } - } /* for (tpage=pages....) */ + } /* for (tpage=pages....) */ /* see if we've gotten all of the pages in the whole enchilada case */ - if (!wholeEnchilada || !vp->v_pages) break; - } /* while(1) obtaining all pages */ + if (!wholeEnchilada || !vp->v_pages) + break; + } /* while(1) obtaining all pages */ /* * If low on chunks, and if writing the last byte of a chunk, try to @@ -811,14 +922,15 @@ struct AFS_UCRED *cred; * calls afs_putpage, so this is recursion. It stops there because we * insist on len being non-zero. */ - if (afs_stats_cmperf.cacheCurrDirtyChunks > afs_stats_cmperf.cacheMaxDirtyChunks - && len != 0 && AFS_CHUNKOFFSET((off + len)) == 0) { + if (afs_stats_cmperf.cacheCurrDirtyChunks > + afs_stats_cmperf.cacheMaxDirtyChunks && len != 0 + && AFS_CHUNKOFFSET((off + len)) == 0) { struct vrequest treq; if (!afs_InitReq(&treq, cred ? cred : u.u_cred)) { rcode = afs_DoPartialWrite(avc, &treq); /* XXX */ } } - + done: if (rcode && !avc->vc_error) @@ -830,14 +942,15 @@ struct AFS_UCRED *cred; return rcode; } -#endif /* AFS_SUN5_ENV */ +#endif /* AFS_SUN5_ENV */ -int afs_nfsrdwr(avc, auio, arw, ioflag, acred) -register struct vcache *avc; -struct uio *auio; -enum uio_rw arw; -int ioflag; -struct AFS_UCRED *acred; +int +afs_nfsrdwr(avc, auio, arw, ioflag, acred) + register struct vcache *avc; + struct uio *auio; + enum uio_rw arw; + int ioflag; + struct AFS_UCRED *acred; { register afs_int32 code; afs_int32 code2; @@ -845,13 +958,13 @@ struct AFS_UCRED *acred; afs_int32 mode, sflags; register char *data; struct dcache *dcp, *dcp_newpage; - afs_int32 fileBase, size; - afs_int32 pageBase; + afs_size_t fileBase, size; + afs_size_t pageBase; register afs_int32 tsize; - register afs_int32 pageOffset, extraResid=0; - register long origLength; /* length when reading/writing started */ - register long appendLength; /* length when this call will finish */ - int created; /* created pages instead of faulting them */ + register afs_int32 pageOffset, extraResid = 0; + register afs_size_t origLength; /* length when reading/writing started */ + register long appendLength; /* length when this call will finish */ + int created; /* created pages instead of faulting them */ int lockCode; int didFakeOpen, eof; struct vrequest treq; @@ -861,34 +974,40 @@ struct AFS_UCRED *acred; AFS_STATCNT(afs_nfsrdwr); /* can't read or write other things */ - if (vType(avc) != VREG) return EISDIR; + if (vType(avc) != VREG) + return EISDIR; if (auio->uio_resid == 0) return (0); - afs_Trace4(afs_iclSetp, CM_TRACE_VMRW, ICL_TYPE_POINTER, (afs_int32)avc, - ICL_TYPE_LONG, (arw==UIO_WRITE? 1 : 0), - ICL_TYPE_LONG, auio->uio_offset, - ICL_TYPE_LONG, auio->uio_resid); + afs_Trace4(afs_iclSetp, CM_TRACE_VMRW, ICL_TYPE_POINTER, (afs_int32) avc, + ICL_TYPE_LONG, (arw == UIO_WRITE ? 1 : 0), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(auio->uio_offset), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(auio->uio_resid)); - if ( AfsLargeFileUio(auio) ) /* file is larger than 2 GB */ +#ifndef AFS_64BIT_CLIENT + if (AfsLargeFileUio(auio)) /* file is larger than 2 GB */ return (EFBIG); - +#endif + #ifdef AFS_SUN5_ENV - if (!acred) osi_Panic("rdwr: !acred"); + if (!acred) + osi_Panic("rdwr: !acred"); #else - if (!acred) acred = u.u_cred; + if (!acred) + acred = u.u_cred; #endif - if (code = afs_InitReq(&treq, acred)) return code; + if (code = afs_InitReq(&treq, acred)) + return code; /* It's not really possible to know if a write cause a growth in the * cache size, we we wait for a cache drain for any write. */ afs_MaybeWakeupTruncateDaemon(); - while ((arw == UIO_WRITE) && - (afs_blocksUsed > (CM_WAITFORDRAINPCT*afs_cacheBlocks)/100)) { + while ((arw == UIO_WRITE) + && (afs_blocksUsed > (CM_WAITFORDRAINPCT * afs_cacheBlocks) / 100)) { if (afs_blocksUsed - afs_blocksDiscarded > - (CM_WAITFORDRAINPCT*afs_cacheBlocks)/100) { + (CM_WAITFORDRAINPCT * afs_cacheBlocks) / 100) { afs_WaitForCacheDrain = 1; afs_osi_Sleep(&afs_WaitForCacheDrain); } @@ -896,58 +1015,59 @@ struct AFS_UCRED *acred; afs_MaybeWakeupTruncateDaemon(); } code = afs_VerifyVCache(avc, &treq); - if (code) return afs_CheckCode(code, &treq, 45); + if (code) + return afs_CheckCode(code, &treq, 45); afs_BozonLock(&avc->pvnLock, avc); osi_FlushPages(avc, acred); /* hold bozon lock, but not basic vnode lock */ - ObtainWriteLock(&avc->lock,250); + ObtainWriteLock(&avc->lock, 250); /* adjust parameters when appending files */ - if ((ioflag & IO_APPEND) && arw == UIO_WRITE) - { + if ((ioflag & IO_APPEND) && arw == UIO_WRITE) { #if defined(AFS_SUN56_ENV) auio->uio_loffset = 0; #endif auio->uio_offset = avc->m.Length; /* write at EOF position */ } if (auio->uio_offset < 0 || (auio->uio_offset + auio->uio_resid) < 0) { - ReleaseWriteLock(&avc->lock); + ReleaseWriteLock(&avc->lock); afs_BozonUnlock(&avc->pvnLock, avc); return EINVAL; } - - /* file is larger than 2GB */ - if ( AfsLargeFileSize(auio->uio_offset, auio->uio_resid) ) { - ReleaseWriteLock(&avc->lock); +#ifndef AFS_64BIT_CLIENT + /* file is larger than 2GB */ + if (AfsLargeFileSize(auio->uio_offset, auio->uio_resid)) { + ReleaseWriteLock(&avc->lock); afs_BozonUnlock(&avc->pvnLock, avc); return EFBIG; } +#endif - didFakeOpen=0; /* keep track of open so we can do close */ + didFakeOpen = 0; /* keep track of open so we can do close */ if (arw == UIO_WRITE) { /* do ulimit processing; shrink resid or fail */ #if defined(AFS_SUN56_ENV) if (auio->uio_loffset + auio->afsio_resid > auio->uio_llimit) { if (auio->uio_llimit >= auio->uio_llimit) { - ReleaseWriteLock(&avc->lock); - afs_BozonUnlock(&avc->pvnLock, avc); - return EFBIG; - } else { - /* track # of bytes we should write, but won't because of - * ulimit; we must add this into the final resid value - * so caller knows we punted some data. - */ - extraResid = auio->uio_resid; - auio->uio_resid = auio->uio_llimit - auio->uio_loffset; - extraResid -= auio->uio_resid; - } - } + ReleaseWriteLock(&avc->lock); + afs_BozonUnlock(&avc->pvnLock, avc); + return EFBIG; + } else { + /* track # of bytes we should write, but won't because of + * ulimit; we must add this into the final resid value + * so caller knows we punted some data. + */ + extraResid = auio->uio_resid; + auio->uio_resid = auio->uio_llimit - auio->uio_loffset; + extraResid -= auio->uio_resid; + } + } #else -#ifdef AFS_SUN52_ENV +#ifdef AFS_SUN52_ENV if (auio->afsio_offset + auio->afsio_resid > auio->uio_limit) { if (auio->afsio_offset >= auio->uio_limit) { - ReleaseWriteLock(&avc->lock); + ReleaseWriteLock(&avc->lock); afs_BozonUnlock(&avc->pvnLock, avc); return EFBIG; } else { @@ -964,27 +1084,33 @@ struct AFS_UCRED *acred; #endif /* SUN56 */ mode = S_WRITE; /* segment map-in mode */ afs_FakeOpen(avc); /* do this for writes, so data gets put back - when we want it to be put back */ + * when we want it to be put back */ didFakeOpen = 1; /* we'll be doing a fake open */ /* before starting any I/O, we must ensure that the file is big enough - to hold the results (since afs_putpage will be called to force the I/O */ + * to hold the results (since afs_putpage will be called to force the I/O */ size = auio->afsio_resid + auio->afsio_offset; /* new file size */ - appendLength = size; + appendLength = size; origLength = avc->m.Length; - if (size > avc->m.Length) + if (size > avc->m.Length) { + afs_Trace4(afs_iclSetp, CM_TRACE_SETLENGTH, ICL_TYPE_STRING, + __FILE__, ICL_TYPE_LONG, __LINE__, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(size)); avc->m.Length = size; /* file grew */ - avc->states |= CDirty; /* Set the dirty bit */ + } + avc->states |= CDirty; /* Set the dirty bit */ avc->m.Date = osi_Time(); /* Set file date (for ranlib) */ } else { - mode = S_READ; /* map-in read-only */ + mode = S_READ; /* map-in read-only */ origLength = avc->m.Length; } if (acred && AFS_NFSXLATORREQ(acred)) { if (arw == UIO_READ) { - if (!afs_AccessOK(avc, PRSFS_READ, &treq, - CHECK_MODE_BITS|CMB_ALLOW_EXEC_AS_READ)) { - ReleaseWriteLock(&avc->lock); + if (!afs_AccessOK + (avc, PRSFS_READ, &treq, + CHECK_MODE_BITS | CMB_ALLOW_EXEC_AS_READ)) { + ReleaseWriteLock(&avc->lock); afs_BozonUnlock(&avc->pvnLock, avc); return EACCES; } @@ -997,59 +1123,59 @@ struct AFS_UCRED *acred; avc->credp = acred; #endif } - counter = 0; /* don't call afs_DoPartialWrite first time through. */ + counter = 0; /* don't call afs_DoPartialWrite first time through. */ while (1) { /* compute the amount of data to move into this block, - based on auio->afsio_resid. Note that we copy data in units of - MAXBSIZE, not PAGESIZE. This is because segmap_getmap panics if you - call it with an offset based on blocks smaller than MAXBSIZE - (implying that it should be named BSIZE, since it is clearly both a - max and a min). */ - size = auio->afsio_resid; /* transfer size */ - fileBase = auio->afsio_offset; /* start file position for xfr */ - pageBase = fileBase & ~(MAXBSIZE-1); /* file position of the page */ - pageOffset = fileBase & (MAXBSIZE-1); /* xfr start's offset within page */ - tsize = MAXBSIZE-pageOffset; /* how much more fits in this page */ + * based on auio->afsio_resid. Note that we copy data in units of + * MAXBSIZE, not PAGESIZE. This is because segmap_getmap panics if you + * call it with an offset based on blocks smaller than MAXBSIZE + * (implying that it should be named BSIZE, since it is clearly both a + * max and a min). */ + size = auio->afsio_resid; /* transfer size */ + fileBase = auio->afsio_offset; /* start file position for xfr */ + pageBase = fileBase & ~(MAXBSIZE - 1); /* file position of the page */ + pageOffset = fileBase & (MAXBSIZE - 1); /* xfr start's offset within page */ + tsize = MAXBSIZE - pageOffset; /* how much more fits in this page */ /* we'll read tsize bytes, but first must make sure tsize isn't too big */ - if (tsize > size) tsize = size; /* don't read past end of request */ - eof = 0; /* flag telling us if we hit the EOF on the read */ - if (arw == UIO_READ) { /* we're doing a read operation */ + if (tsize > size) + tsize = size; /* don't read past end of request */ + eof = 0; /* flag telling us if we hit the EOF on the read */ + if (arw == UIO_READ) { /* we're doing a read operation */ /* don't read past EOF */ - if (tsize + fileBase > origLength) { + if (fileBase + tsize > origLength) { tsize = origLength - fileBase; - eof = 1; /* we did hit the EOF */ - if (tsize < 0) tsize = 0; /* better safe than sorry */ + eof = 1; /* we did hit the EOF */ + if (tsize < 0) + tsize = 0; /* better safe than sorry */ } sflags = 0; - } - else { + } else { #ifdef AFS_SUN5_ENV /* Purge dirty chunks of file if there are too many dirty * chunks. Inside the write loop, we only do this at a chunk * boundary. Clean up partial chunk if necessary at end of loop. */ - if (counter > 0 && code == 0 && AFS_CHUNKOFFSET(fileBase) == 0) - { - code = afs_DoPartialWrite(avc, &treq); - if (code) - break; - } -#endif /* AFS_SUN5_ENV */ + if (counter > 0 && code == 0 && AFS_CHUNKOFFSET(fileBase) == 0) { + code = afs_DoPartialWrite(avc, &treq); + if (code) + break; + } +#endif /* AFS_SUN5_ENV */ /* write case, we ask segmap_release to call putpage. Really, we - don't have to do this on every page mapin, but for now we're - lazy, and don't modify the rest of AFS to scan for modified - pages on a close or other "synchronize with file server" - operation. This makes things a little cleaner, but probably - hurts performance. */ + * don't have to do this on every page mapin, but for now we're + * lazy, and don't modify the rest of AFS to scan for modified + * pages on a close or other "synchronize with file server" + * operation. This makes things a little cleaner, but probably + * hurts performance. */ sflags = SM_WRITE; } if (tsize <= 0) { code = 0; - break; /* nothing to transfer, we're done */ + break; /* nothing to transfer, we're done */ } #ifdef AFS_SUN5_ENV if (arw == UIO_WRITE) - avc->states |= CDirty; /* may have been cleared by DoPartialWrite*/ + avc->states |= CDirty; /* may have been cleared by DoPartialWrite */ /* Before dropping lock, hold the chunk (create it if necessary). This * serves two purposes: (1) Ensure Cache Truncate Daemon doesn't try @@ -1073,10 +1199,10 @@ struct AFS_UCRED *acred; } ReleaseWriteLock(&avc->vlock); { - int toff, tlen; + afs_size_t toff, tlen; dcp = afs_GetDCache(avc, fileBase, &treq, &toff, &tlen, 2); if (!dcp) { - code = ENOENT; + code = ENOENT; break; } } @@ -1084,30 +1210,32 @@ struct AFS_UCRED *acred; ReleaseWriteLock(&avc->lock); /* uiomove may page fault */ AFS_GUNLOCK(); #if defined(AFS_SUN56_ENV) - data = segmap_getmap(segkmap,AFSTOV(avc),(u_offset_t)pageBase); + data = segmap_getmap(segkmap, AFSTOV(avc), (u_offset_t) pageBase); #else data = segmap_getmap(segkmap, AFSTOV(avc), pageBase); #endif #ifndef AFS_SUN5_ENV - code = afs_fc2errno(as_fault(&kas, data+pageOffset, tsize, - F_SOFTLOCK, mode)); + code = + afs_fc2errno(as_fault + (&kas, data + pageOffset, tsize, F_SOFTLOCK, mode)); if (code == 0) { - AFS_UIOMOVE(data+pageOffset, tsize, arw, auio, code); - as_fault(&kas, data+pageOffset, tsize, F_SOFTUNLOCK, mode); + AFS_UIOMOVE(data + pageOffset, tsize, arw, auio, code); + as_fault(&kas, data + pageOffset, tsize, F_SOFTUNLOCK, mode); code2 = segmap_release(segkmap, data, sflags); if (!code) code = code2; - } - else { - (void) segmap_release(segkmap, data, 0); + } else { + (void)segmap_release(segkmap, data, 0); } #else #if defined(AFS_SUN56_ENV) - raddr = (caddr_t) (((uintptr_t)data +pageOffset) & PAGEMASK); + raddr = (caddr_t) (((uintptr_t) data + pageOffset) & PAGEMASK); #else - raddr = (caddr_t) (((u_int)data +pageOffset) & PAGEMASK); + raddr = (caddr_t) (((u_int) data + pageOffset) & PAGEMASK); #endif - rsize = (((u_int)data+pageOffset+tsize+PAGEOFFSET) & PAGEMASK)-(u_int)raddr; + rsize = + (((u_int) data + pageOffset + tsize + PAGEOFFSET) & PAGEMASK) - + (u_int) raddr; if (code == 0) { /* if we're doing a write, and we're starting at the rounded * down page base, and we're writing enough data to cover all @@ -1115,9 +1243,8 @@ struct AFS_UCRED *acred; * in this MAXBSIZE window that we're creating. */ created = 0; - if (arw == UIO_WRITE - && ((long)raddr == (long)data+pageOffset) - && tsize >= rsize) { + if (arw == UIO_WRITE && ((long)raddr == (long)data + pageOffset) + && tsize >= rsize) { /* probably the dcache backing this guy is around, but if * not, we can't do this optimization, since we're creating * writable pages, which must be backed by a chunk. @@ -1126,71 +1253,67 @@ struct AFS_UCRED *acred; dcp_newpage = afs_FindDCache(avc, pageBase); if (dcp_newpage && hsame(avc->m.DataVersion, dcp_newpage->f.versionNo)) { - ObtainWriteLock(&avc->lock,251); - ObtainWriteLock(&avc->vlock,576); + ObtainWriteLock(&avc->lock, 251); + ObtainWriteLock(&avc->vlock, 576); + ObtainReadLock(&dcp_newpage->lock); if ((avc->activeV == 0) && hsame(avc->m.DataVersion, dcp_newpage->f.versionNo) - && !(dcp_newpage->flags & (DFFetching))) { + && !(dcp_newpage->dflags & (DFFetching))) { AFS_GUNLOCK(); segmap_pagecreate(segkmap, raddr, rsize, 1); AFS_GLOCK(); - ObtainWriteLock(&afs_xdcache,252); + ObtainWriteLock(&afs_xdcache, 252); /* Mark the pages as created and dirty */ afs_indexFlags[dcp_newpage->index] |= (IFAnyPages | IFDirtyPages); - ReleaseWriteLock(&afs_xdcache); - avc->states |= CHasPages; + ReleaseWriteLock(&afs_xdcache); created = 1; } + ReleaseReadLock(&dcp_newpage->lock); afs_PutDCache(dcp_newpage); ReleaseWriteLock(&avc->vlock); ReleaseWriteLock(&avc->lock); - } - else if ( dcp_newpage ) + } else if (dcp_newpage) afs_PutDCache(dcp_newpage); AFS_GUNLOCK(); } if (!created) - code = afs_fc2errno(segmap_fault(kas.a_hat, segkmap, raddr, - rsize, F_SOFTLOCK, mode)); + code = + afs_fc2errno(segmap_fault + (kas.a_hat, segkmap, raddr, rsize, + F_SOFTLOCK, mode)); } if (code == 0) { - AFS_UIOMOVE(data+pageOffset, tsize, arw, auio, code); - segmap_fault(kas.a_hat, segkmap, raddr, rsize, F_SOFTUNLOCK, mode); + AFS_UIOMOVE(data + pageOffset, tsize, arw, auio, code); + segmap_fault(kas.a_hat, segkmap, raddr, rsize, F_SOFTUNLOCK, + mode); } if (code == 0) { code = segmap_release(segkmap, data, sflags); } else { - (void) segmap_release(segkmap, data, 0); + (void)segmap_release(segkmap, data, 0); } -#endif /* AFS_SUN5_ENV */ +#endif /* AFS_SUN5_ENV */ AFS_GLOCK(); - ObtainWriteLock(&avc->lock,253); + ObtainWriteLock(&avc->lock, 253); #ifdef AFS_SUN5_ENV - /* - * If at a chunk boundary, start prefetch of next chunk. - */ - if (counter == 0 || AFS_CHUNKOFFSET(fileBase) == 0) { - if (!(dcp->flags & DFNextStarted)) - afs_PrefetchChunk(avc, dcp, acred, &treq); - } counter++; - if (dcp) - afs_PutDCache(dcp); -#endif /* AFS_SUN5_ENV */ - if (code) break; + if (dcp) + afs_PutDCache(dcp); +#endif /* AFS_SUN5_ENV */ + if (code) + break; } if (didFakeOpen) { afs_FakeClose(avc, acred); } - #ifdef AFS_SUN5_ENV if (arw == UIO_WRITE && (avc->states & CDirty)) { code2 = afs_DoPartialWrite(avc, &treq); if (!code) code = code2; } -#endif /* AFS_SUN5_ENV */ +#endif /* AFS_SUN5_ENV */ if (!code && avc->vc_error) { code = avc->vc_error; @@ -1199,7 +1322,8 @@ struct AFS_UCRED *acred; afs_BozonUnlock(&avc->pvnLock, avc); if (!code) { #ifdef AFS_SUN53_ENV - if ((ioflag & FSYNC) && (arw == UIO_WRITE) && !AFS_NFSXLATORREQ(acred)) + if ((ioflag & FSYNC) && (arw == UIO_WRITE) + && !AFS_NFSXLATORREQ(acred)) code = afs_fsync(avc, 0, acred); #else if ((ioflag & IO_SYNC) && (arw == UIO_WRITE) @@ -1207,7 +1331,7 @@ struct AFS_UCRED *acred; code = afs_fsync(avc, acred); #endif } -#ifdef AFS_SUN52_ENV +#ifdef AFS_SUN52_ENV /* * If things worked, add in as remaining in request any bytes * we didn't write due to file size ulimit. @@ -1219,112 +1343,114 @@ struct AFS_UCRED *acred; } afs_map(vp, off, as, addr, len, prot, maxprot, flags, cred) -struct vnode *vp; -struct as *as; + struct vnode *vp; + struct as *as; #ifdef AFS_SUN5_ENV -offset_t off; -caddr_t *addr; + offset_t off; + caddr_t *addr; #else -u_int off; -addr_t *addr; + u_int off; + addr_t *addr; #endif -u_int len; + u_int len; #ifdef AFS_SUN5_ENV -u_char prot, maxprot; + u_char prot, maxprot; #else -u_int prot, maxprot; + u_int prot, maxprot; #endif -u_int flags; -struct AFS_UCRED *cred; + u_int flags; + struct AFS_UCRED *cred; { - struct segvn_crargs crargs; - register afs_int32 code; - struct vrequest treq; - register struct vcache *avc = VTOAFS(vp); + struct segvn_crargs crargs; + register afs_int32 code; + struct vrequest treq; + register struct vcache *avc = VTOAFS(vp); - AFS_STATCNT(afs_map); + AFS_STATCNT(afs_map); - /* check for reasonableness on segment bounds; apparently len can be < 0 */ - if ((int)off < 0 || (int)(off + len) < 0) { - return (EINVAL); - } - if ( AfsLargeFileSize(off, len) ) /* file is larger than 2 GB */ - { - code = EFBIG; - goto out; - } + /* check for reasonableness on segment bounds; apparently len can be < 0 */ + if (off < 0 || off + len < 0) { + return (EINVAL); + } +#ifndef AFS_64BIT_CLIENT + if (AfsLargeFileSize(off, len)) { /* file is larger than 2 GB */ + code = EFBIG; + goto out; + } +#endif #if defined(AFS_SUN5_ENV) - if (vp->v_flag & VNOMAP) /* File isn't allowed to be mapped */ - return (ENOSYS); + if (vp->v_flag & VNOMAP) /* File isn't allowed to be mapped */ + return (ENOSYS); - if (vp->v_filocks) /* if locked, disallow mapping */ - return (EAGAIN); + if (vp->v_filocks) /* if locked, disallow mapping */ + return (EAGAIN); #endif - AFS_GLOCK(); - if (code = afs_InitReq(&treq, cred)) goto out; + AFS_GLOCK(); + if (code = afs_InitReq(&treq, cred)) + goto out; - if (vp->v_type != VREG) { - code = ENODEV; - goto out; - } + if (vp->v_type != VREG) { + code = ENODEV; + goto out; + } - code = afs_VerifyVCache(avc, &treq); - if (code) { - goto out; - } - afs_BozonLock(&avc->pvnLock, avc); - osi_FlushPages(avc, cred); /* ensure old pages are gone */ - avc->states |= CMAPPED; /* flag cleared at afs_inactive */ - afs_BozonUnlock(&avc->pvnLock, avc); + code = afs_VerifyVCache(avc, &treq); + if (code) { + goto out; + } + afs_BozonLock(&avc->pvnLock, avc); + osi_FlushPages(avc, cred); /* ensure old pages are gone */ + avc->states |= CMAPPED; /* flag cleared at afs_inactive */ + afs_BozonUnlock(&avc->pvnLock, avc); - AFS_GUNLOCK(); + AFS_GUNLOCK(); #ifdef AFS_SUN5_ENV - as_rangelock(as); + as_rangelock(as); #endif - if ((flags & MAP_FIXED) == 0) { + if ((flags & MAP_FIXED) == 0) { #if defined(AFS_SUN57_ENV) - map_addr(addr, len, off, 1, flags); + map_addr(addr, len, off, 1, flags); #elif defined(AFS_SUN56_ENV) - map_addr(addr, len, off, 1); + map_addr(addr, len, off, 1); #else - map_addr(addr, len, (off_t)off, 1); + map_addr(addr, len, (off_t) off, 1); #endif - if (*addr == NULL) { + if (*addr == NULL) { #ifdef AFS_SUN5_ENV - as_rangeunlock(as); + as_rangeunlock(as); #endif - code = ENOMEM; - goto out1; - } - } else - (void) as_unmap(as, *addr, len); /* unmap old address space use */ - /* setup the create parameter block for the call */ - crargs.vp = AFSTOV(avc); - crargs.offset = (u_int)off; - crargs.cred = cred; - crargs.type = flags&MAP_TYPE; - crargs.prot = prot; - crargs.maxprot = maxprot; - crargs.amp = (struct anon_map *) 0; + code = ENOMEM; + goto out1; + } + } else + (void)as_unmap(as, *addr, len); /* unmap old address space use */ + /* setup the create parameter block for the call */ + crargs.vp = AFSTOV(avc); + crargs.offset = (u_int) off; + crargs.cred = cred; + crargs.type = flags & MAP_TYPE; + crargs.prot = prot; + crargs.maxprot = maxprot; + crargs.amp = (struct anon_map *)0; #if defined(AFS_SUN5_ENV) - crargs.flags = flags & ~MAP_TYPE; + crargs.flags = flags & ~MAP_TYPE; #endif - code = as_map(as, *addr, len, segvn_create, (char *) &crargs); + code = as_map(as, *addr, len, segvn_create, (char *)&crargs); #ifdef AFS_SUN5_ENV - as_rangeunlock(as); + as_rangeunlock(as); #endif -out1: - AFS_GLOCK(); - code = afs_CheckCode(code, &treq, 47); - AFS_GUNLOCK(); - return code; -out: - code = afs_CheckCode(code, &treq, 48); - AFS_GUNLOCK(); - return code; + out1: + AFS_GLOCK(); + code = afs_CheckCode(code, &treq, 47); + AFS_GUNLOCK(); + return code; + out: + code = afs_CheckCode(code, &treq, 48); + AFS_GUNLOCK(); + return code; } /* Sun 4.0.X-specific code. It computes the number of bytes that need @@ -1333,16 +1459,19 @@ out: will be passed to pvn_vptrunc by the truncate code */ #ifndef AFS_SUN5_ENV /* Not good for Solaris */ afs_PageLeft(alen) -register afs_int32 alen; { + register afs_int32 alen; +{ register afs_int32 nbytes; AFS_STATCNT(afs_PageLeft); - nbytes = PAGESIZE - (alen & PAGEOFFSET); /* amount to zap in last page */ + nbytes = PAGESIZE - (alen & PAGEOFFSET); /* amount to zap in last page */ /* now check if we'd zero the entire last page. Don't need to do this - since pvn_vptrunc will handle this case properly (it will invalidate - this page) */ - if (nbytes == PAGESIZE) nbytes = 0; - if (nbytes < 0) nbytes = 0; /* just in case */ + * since pvn_vptrunc will handle this case properly (it will invalidate + * this page) */ + if (nbytes == PAGESIZE) + nbytes = 0; + if (nbytes < 0) + nbytes = 0; /* just in case */ return nbytes; } #endif @@ -1354,45 +1483,45 @@ register afs_int32 alen; { */ #if defined(AFS_SUN5_ENV) afs_pathconf(vp, cmd, outdatap, credp) - register struct AFS_UCRED *credp; + register struct AFS_UCRED *credp; #else afs_cntl(vp, cmd, indatap, outdatap, inflag, outflag) - int inflag, outflag; - char *indatap; + int inflag, outflag; + char *indatap; #endif - struct vnode *vp; - int cmd; - u_long *outdatap; + struct vnode *vp; + int cmd; + u_long *outdatap; { AFS_STATCNT(afs_cntl); switch (cmd) { - case _PC_LINK_MAX: + case _PC_LINK_MAX: *outdatap = MAXLINK; break; - case _PC_NAME_MAX: + case _PC_NAME_MAX: *outdatap = MAXNAMLEN; break; - case _PC_PATH_MAX: + case _PC_PATH_MAX: *outdatap = MAXPATHLEN; break; - case _PC_CHOWN_RESTRICTED: + case _PC_CHOWN_RESTRICTED: *outdatap = 1; break; - case _PC_NO_TRUNC: + case _PC_NO_TRUNC: *outdatap = 1; break; #if !defined(AFS_SUN5_ENV) - case _PC_MAX_CANON: + case _PC_MAX_CANON: *outdatap = CANBSIZ; break; - case _PC_VDISABLE: + case _PC_VDISABLE: *outdatap = VDISABLE; break; - case _PC_PIPE_BUF: + case _PC_PIPE_BUF: return EINVAL; break; #endif - default: + default: return EINVAL; } return 0; @@ -1403,25 +1532,27 @@ afs_cntl(vp, cmd, indatap, outdatap, inflag, outflag) #if defined(AFS_SUN5_ENV) afs_ioctl(vnp, com, arg, flag, credp, rvalp) - struct vnode *vnp; - int com, arg, flag; - cred_t *credp; - int *rvalp; + struct vnode *vnp; + int com, arg, flag; + cred_t *credp; + int *rvalp; { return (ENOTTY); } -void afs_rwlock(vnp, wlock) - struct vnode *vnp; - int wlock; +void +afs_rwlock(vnp, wlock) + struct vnode *vnp; + int wlock; { rw_enter(&(VTOAFS(vnp))->rwlock, (wlock ? RW_WRITER : RW_READER)); } -void afs_rwunlock(vnp, wlock) - struct vnode *vnp; - int wlock; +void +afs_rwunlock(vnp, wlock) + struct vnode *vnp; + int wlock; { rw_exit(&(VTOAFS(vnp))->rwlock); } @@ -1429,9 +1560,9 @@ void afs_rwunlock(vnp, wlock) /* NOT SUPPORTED */ afs_seek(vnp, ooff, noffp) - struct vnode *vnp; - offset_t ooff; - offset_t *noffp; + struct vnode *vnp; + offset_t ooff; + offset_t *noffp; { register int code = 0; @@ -1440,24 +1571,25 @@ afs_seek(vnp, ooff, noffp) return code; } -int afs_frlock(vnp, cmd, ap, flag, off, +int +afs_frlock(vnp, cmd, ap, flag, off, #ifdef AFS_SUN59_ENV - flkcb, + flkcb, #endif - credp) - struct vnode *vnp; - int cmd; + credp) + struct vnode *vnp; + int cmd; #if defined(AFS_SUN56_ENV) - struct flock64 *ap; + struct flock64 *ap; #else - struct flock *ap; + struct flock *ap; #endif - int flag; - offset_t off; + int flag; + offset_t off; #ifdef AFS_SUN59_ENV - struct flk_callback *flkcb; + struct flk_callback *flkcb; #endif - struct AFS_UCRED *credp; + struct AFS_UCRED *credp; { register afs_int32 code = 0; /* @@ -1468,7 +1600,8 @@ int afs_frlock(vnp, cmd, ap, flag, off, if (flkcb) afs_warn("Don't know how to deal with flk_callback's!\n"); #endif - if ((cmd == F_GETLK) || (cmd == F_O_GETLK) || (cmd == F_SETLK) || (cmd == F_SETLKW)) { + if ((cmd == F_GETLK) || (cmd == F_O_GETLK) || (cmd == F_SETLK) + || (cmd == F_SETLKW)) { #ifdef AFS_SUN53_ENV ap->l_pid = ttoproc(curthread)->p_pid; ap->l_sysid = 0; @@ -1481,9 +1614,10 @@ int afs_frlock(vnp, cmd, ap, flag, off, #ifdef AFS_SUN56_ENV code = convoff(vnp, ap, 0, off); #else - code = convoff(vnp, ap, 0, (off_t)off); + code = convoff(vnp, ap, 0, (off_t) off); #endif - if (code) return code; + if (code) + return code; AFS_GLOCK(); } @@ -1493,17 +1627,18 @@ int afs_frlock(vnp, cmd, ap, flag, off, } -int afs_space(vnp, cmd, ap, flag, off, credp) - struct vnode *vnp; - int cmd; +int +afs_space(vnp, cmd, ap, flag, off, credp) + struct vnode *vnp; + int cmd; #if defined(AFS_SUN56_ENV) - struct flock64 *ap; + struct flock64 *ap; #else - struct flock *ap; + struct flock *ap; #endif - int flag; - offset_t off; - struct AFS_UCRED *credp; + int flag; + offset_t off; + struct AFS_UCRED *credp; { register afs_int32 code = EINVAL; struct vattr vattr; @@ -1512,14 +1647,14 @@ int afs_space(vnp, cmd, ap, flag, off, credp) #ifdef AFS_SUN56_ENV && ((code = convoff(vnp, ap, 0, off)) == 0)) { #else - && ((code = convoff(vnp, ap, 0, (off_t)off)) == 0)) { + && ((code = convoff(vnp, ap, 0, (off_t) off)) == 0)) { #endif AFS_GLOCK(); if (!ap->l_len) { vattr.va_mask = AT_SIZE; vattr.va_size = ap->l_start; code = afs_setattr(VTOAFS(vnp), &vattr, 0, credp); - } + } AFS_GUNLOCK(); } return (code); @@ -1528,10 +1663,11 @@ int afs_space(vnp, cmd, ap, flag, off, credp) #endif -int afs_dump(vp, addr, i1, i2) -struct vnode *vp; -caddr_t addr; -int i1, i2; +int +afs_dump(vp, addr, i1, i2) + struct vnode *vp; + caddr_t addr; + int i1, i2; { AFS_STATCNT(afs_dump); afs_warn("AFS_DUMP. MUST IMPLEMENT THIS!!!\n"); @@ -1540,40 +1676,44 @@ int i1, i2; /* Nothing fancy here; just compare if vnodes are identical ones */ -afs_cmp(vp1, vp2) -struct vnode *vp1, *vp2; +afs_cmp(vp1, vp2) + struct vnode *vp1, *vp2; { AFS_STATCNT(afs_cmp); - return(vp1 == vp2); + return (vp1 == vp2); } -int afs_realvp(struct vnode *vp, struct vnode **vpp) { +int +afs_realvp(struct vnode *vp, struct vnode **vpp) +{ AFS_STATCNT(afs_realvp); return EINVAL; } -int afs_pageio(vp, pp, ui1, ui2, i1, credp) -struct vnode *vp; -struct page *pp; -u_int ui1, ui2; -int i1; -struct cred *credp; +int +afs_pageio(vp, pp, ui1, ui2, i1, credp) + struct vnode *vp; + struct page *pp; + u_int ui1, ui2; + int i1; + struct cred *credp; { afs_warn("afs_pageio: Not implemented\n"); return EINVAL; } -int afs_dumpctl(vp, i +int +afs_dumpctl(vp, i #ifdef AFS_SUN59_ENV - , blkp + , blkp #endif - ) -struct vnode *vp; -int i; + ) + struct vnode *vp; + int i; #ifdef AFS_SUN59_ENV -int *blkp; + int *blkp; #endif { afs_warn("afs_dumpctl: Not implemented\n"); @@ -1581,29 +1721,32 @@ int *blkp; } #ifdef AFS_SUN54_ENV -extern void afs_dispose(vp, p, fl, dn, cr) - struct vnode *vp; - struct page *p; - int fl, dn; - struct cred *cr; +extern void +afs_dispose(vp, p, fl, dn, cr) + struct vnode *vp; + struct page *p; + int fl, dn; + struct cred *cr; { fs_dispose(vp, p, fl, dn, cr); } -int afs_setsecattr(vp, vsecattr, flag, creds) -struct vnode *vp; -vsecattr_t *vsecattr; -int flag; -struct cred *creds; +int +afs_setsecattr(vp, vsecattr, flag, creds) + struct vnode *vp; + vsecattr_t *vsecattr; + int flag; + struct cred *creds; { return ENOSYS; } -int afs_getsecattr(vp, vsecattr, flag, creds) -struct vnode *vp; -vsecattr_t *vsecattr; -int flag; -struct cred *creds; +int +afs_getsecattr(vp, vsecattr, flag, creds) + struct vnode *vp; + vsecattr_t *vsecattr; + int flag; + struct cred *creds; { return fs_fab_acl(vp, vsecattr, flag, creds); } @@ -1619,52 +1762,52 @@ extern int afs_lockctl(); extern void gafs_inactive(); struct vnodeops Afs_vnodeops = { - gafs_open, - gafs_close, - afs_vmread, - afs_vmwrite, - afs_ioctl, - fs_setfl, - gafs_getattr, - gafs_setattr, - gafs_access, - gafs_lookup, - gafs_create, - gafs_remove, - gafs_link, - gafs_rename, - gafs_mkdir, - gafs_rmdir, - gafs_readdir, - gafs_symlink, - gafs_readlink, - gafs_fsync, - gafs_inactive, - gafs_fid, - afs_rwlock, - afs_rwunlock, - afs_seek, - afs_cmp, - afs_frlock, - afs_space, - afs_realvp, - afs_getpage, - afs_putpage, - afs_map, - afs_addmap, - afs_delmap, - fs_poll, - afs_dump, - afs_pathconf, - afs_pageio, - afs_dumpctl, + gafs_open, + gafs_close, + afs_vmread, + afs_vmwrite, + afs_ioctl, + fs_setfl, + gafs_getattr, + gafs_setattr, + gafs_access, + gafs_lookup, + gafs_create, + gafs_remove, + gafs_link, + gafs_rename, + gafs_mkdir, + gafs_rmdir, + gafs_readdir, + gafs_symlink, + gafs_readlink, + gafs_fsync, + gafs_inactive, + gafs_fid, + afs_rwlock, + afs_rwunlock, + afs_seek, + afs_cmp, + afs_frlock, + afs_space, + afs_realvp, + afs_getpage, + afs_putpage, + afs_map, + afs_addmap, + afs_delmap, + fs_poll, + afs_dump, + afs_pathconf, + afs_pageio, + afs_dumpctl, #ifdef AFS_SUN54_ENV - afs_dispose, - afs_setsecattr, - afs_getsecattr, + afs_dispose, + afs_setsecattr, + afs_getsecattr, #endif #if defined(AFS_SUN56_ENV) - fs_shrlock, + fs_shrlock, #endif }; struct vnodeops *afs_ops = &Afs_vnodeops; @@ -1672,9 +1815,9 @@ struct vnodeops *afs_ops = &Afs_vnodeops; gafs_open(avcp, aflags, acred) - register struct vcache **avcp; - afs_int32 aflags; - struct AFS_UCRED *acred; + register struct vcache **avcp; + afs_int32 aflags; + struct AFS_UCRED *acred; { register int code; @@ -1686,11 +1829,11 @@ gafs_open(avcp, aflags, acred) gafs_close(avc, aflags, count, offset, acred) - offset_t offset; - int count; - register struct vcache *avc; - afs_int32 aflags; - struct AFS_UCRED *acred; + offset_t offset; + int count; + register struct vcache *avc; + afs_int32 aflags; + struct AFS_UCRED *acred; { register int code; @@ -1702,10 +1845,10 @@ gafs_close(avc, aflags, count, offset, acred) gafs_getattr(avc, attrs, flags, acred) - int flags; - register struct vcache *avc; - register struct vattr *attrs; - struct AFS_UCRED *acred; + int flags; + register struct vcache *avc; + register struct vattr *attrs; + struct AFS_UCRED *acred; { register int code; @@ -1717,10 +1860,10 @@ gafs_getattr(avc, attrs, flags, acred) gafs_setattr(avc, attrs, flags, acred) - int flags; - register struct vcache *avc; - register struct vattr *attrs; - struct AFS_UCRED *acred; + int flags; + register struct vcache *avc; + register struct vattr *attrs; + struct AFS_UCRED *acred; { register int code; @@ -1732,10 +1875,10 @@ gafs_setattr(avc, attrs, flags, acred) gafs_access(avc, amode, flags, acred) - int flags; - register struct vcache *avc; - register afs_int32 amode; - struct AFS_UCRED *acred; + int flags; + register struct vcache *avc; + register afs_int32 amode; + struct AFS_UCRED *acred; { register int code; @@ -1747,12 +1890,12 @@ gafs_access(avc, amode, flags, acred) gafs_lookup(adp, aname, avcp, pnp, flags, rdir, acred) - struct pathname *pnp; - int flags; - struct vnode *rdir; - register struct vcache *adp, **avcp; - char *aname; - struct AFS_UCRED *acred; + struct pathname *pnp; + int flags; + struct vnode *rdir; + register struct vcache *adp, **avcp; + char *aname; + struct AFS_UCRED *acred; { register int code; @@ -1764,13 +1907,13 @@ gafs_lookup(adp, aname, avcp, pnp, flags, rdir, acred) gafs_create(adp, aname, attrs, aexcl, amode, avcp, acred) - register struct vcache *adp; - char *aname; - struct vattr *attrs; - enum vcexcl aexcl; - int amode; - struct vcache **avcp; - struct AFS_UCRED *acred; + register struct vcache *adp; + char *aname; + struct vattr *attrs; + enum vcexcl aexcl; + int amode; + struct vcache **avcp; + struct AFS_UCRED *acred; { register int code; @@ -1781,9 +1924,9 @@ gafs_create(adp, aname, attrs, aexcl, amode, avcp, acred) } gafs_remove(adp, aname, acred) - register struct vcache *adp; - char *aname; - struct AFS_UCRED *acred; + register struct vcache *adp; + char *aname; + struct AFS_UCRED *acred; { register int code; @@ -1794,10 +1937,10 @@ gafs_remove(adp, aname, acred) } gafs_link(adp, avc, aname, acred) - register struct vcache *avc; - register struct vcache *adp; - char *aname; - struct AFS_UCRED *acred; + register struct vcache *avc; + register struct vcache *adp; + char *aname; + struct AFS_UCRED *acred; { register int code; @@ -1808,9 +1951,9 @@ gafs_link(adp, avc, aname, acred) } gafs_rename(aodp, aname1, andp, aname2, acred) - register struct vcache *aodp, *andp; - char *aname1, *aname2; - struct AFS_UCRED *acred; + register struct vcache *aodp, *andp; + char *aname1, *aname2; + struct AFS_UCRED *acred; { register int code; @@ -1821,11 +1964,11 @@ gafs_rename(aodp, aname1, andp, aname2, acred) } gafs_mkdir(adp, aname, attrs, avcp, acred) - register struct vcache *adp; - register struct vcache **avcp; - char *aname; - struct vattr *attrs; - struct AFS_UCRED *acred; + register struct vcache *adp; + register struct vcache **avcp; + char *aname; + struct vattr *attrs; + struct AFS_UCRED *acred; { register int code; @@ -1837,10 +1980,10 @@ gafs_mkdir(adp, aname, attrs, avcp, acred) gafs_rmdir(adp, aname, cdirp, acred) - struct vnode *cdirp; - register struct vcache *adp; - char *aname; - struct AFS_UCRED *acred; + struct vnode *cdirp; + register struct vcache *adp; + char *aname; + struct AFS_UCRED *acred; { register int code; @@ -1852,25 +1995,25 @@ gafs_rmdir(adp, aname, cdirp, acred) gafs_readdir(avc, auio, acred, eofp) - int *eofp; - register struct vcache *avc; - struct uio *auio; - struct AFS_UCRED *acred; + int *eofp; + register struct vcache *avc; + struct uio *auio; + struct AFS_UCRED *acred; { register int code; AFS_GLOCK(); code = afs_readdir(avc, auio, acred, eofp); AFS_GUNLOCK(); - return (code); + return (code); } gafs_symlink(adp, aname, attrs, atargetName, acred) - register struct vcache *adp; - register char *atargetName; - char *aname; - struct vattr *attrs; - struct AFS_UCRED *acred; + register struct vcache *adp; + register char *atargetName; + char *aname; + struct vattr *attrs; + struct AFS_UCRED *acred; { register int code; @@ -1882,9 +2025,9 @@ gafs_symlink(adp, aname, attrs, atargetName, acred) gafs_readlink(avc, auio, acred) - register struct vcache *avc; - struct uio *auio; - struct AFS_UCRED *acred; + register struct vcache *avc; + struct uio *auio; + struct AFS_UCRED *acred; { register int code; @@ -1896,12 +2039,12 @@ gafs_readlink(avc, auio, acred) #ifdef AFS_SUN53_ENV gafs_fsync(avc, flag, acred) - int flag; + int flag; #else gafs_fsync(avc, acred) #endif - register struct vcache *avc; - struct AFS_UCRED *acred; + register struct vcache *avc; + struct AFS_UCRED *acred; { register int code; @@ -1915,26 +2058,29 @@ gafs_fsync(avc, acred) return (code); } -void afs_inactive(struct vcache *avc, struct AFS_UCRED *acred) +void +afs_inactive(struct vcache *avc, struct AFS_UCRED *acred) { struct vnode *vp = AFSTOV(avc); - if (afs_shuttingdown) return ; + if (afs_shuttingdown) + return; /* * In Solaris and HPUX s800 and HP-UX10.0 they actually call us with * v_count 1 on last reference! */ mutex_enter(&vp->v_lock); - if (avc->vrefCount <= 0) osi_Panic("afs_inactive : v_count <=0\n"); + if (avc->vrefCount <= 0) + osi_Panic("afs_inactive : v_count <=0\n"); /* * If more than 1 don't unmap the vnode but do decrement the ref count */ vp->v_count--; if (vp->v_count > 0) { - mutex_exit(&vp->v_lock); - return; - } + mutex_exit(&vp->v_lock); + return; + } mutex_exit(&vp->v_lock); /* @@ -1951,9 +2097,10 @@ void afs_inactive(struct vcache *avc, struct AFS_UCRED *acred) afs_InactiveVCache(avc, acred); } -void gafs_inactive(avc, acred) - register struct vcache *avc; - struct AFS_UCRED *acred; +void +gafs_inactive(avc, acred) + register struct vcache *avc; + struct AFS_UCRED *acred; { AFS_GLOCK(); afs_inactive(avc, acred); @@ -1962,8 +2109,8 @@ void gafs_inactive(avc, acred) gafs_fid(avc, fidpp) -struct vcache *avc; -struct fid **fidpp; + struct vcache *avc; + struct fid **fidpp; { register int code; @@ -1973,4 +2120,4 @@ struct fid **fidpp; return (code); } -#endif /* AFS_GLOBAL_SUNLOCK */ +#endif /* AFS_GLOBAL_SUNLOCK */ diff --git a/src/afs/SUNOS/osi_inode.h b/src/afs/SUNOS/osi_inode.h index a55f44dba..09b38b09a 100644 --- a/src/afs/SUNOS/osi_inode.h +++ b/src/afs/SUNOS/osi_inode.h @@ -1 +1 @@ -#error kernel code not supported on SunOS 4 +#error kernel code not supported on SunOS 4 diff --git a/src/afs/UKERNEL/afs_usrops.c b/src/afs/UKERNEL/afs_usrops.c index 966b52074..410713fa9 100644 --- a/src/afs/UKERNEL/afs_usrops.c +++ b/src/afs/UKERNEL/afs_usrops.c @@ -12,24 +12,25 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/UKERNEL/afs_usrops.c,v 1.1.1.10 2003/04/13 19:02:48 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/UKERNEL/afs_usrops.c,v 1.26 2004/05/10 13:51:16 shadow Exp $"); #ifdef UKERNEL -#include "../afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ #include -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_usrops.h" -#include "../afs/afs_stats.h" -#include "../afs/auth.h" -#include "../afs/cellconfig.h" -#include "../afs/vice.h" -#include "../afs/kautils.h" -#include "../afs/afsutil.h" -#include "../rx/rx_globals.h" +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs_usrops.h" +#include "afs/afs_stats.h" +#include "afs/auth.h" +#include "afs/cellconfig.h" +#include "afs/vice.h" +#include "afs/kautils.h" +#include "afs/afsutil.h" +#include "rx/rx_globals.h" #define VFS 1 #undef VIRTUE @@ -39,6 +40,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/UKERNEL/afs_usrops.c,v 1.1.1.10 200 #define AFSLOGFILE "AFSLog" #define DCACHEFILE "CacheItems" #define VOLINFOFILE "VolumeItems" +#define CELLINFOFILE "CellItems" #define MAXIPADDRS 64 #ifndef MIN @@ -62,40 +64,41 @@ struct usr_vfs afs_RootVfs; struct usr_vnode *afs_RootVnode = NULL; struct usr_vnode *afs_CurrentDir = NULL; -afs_int32 cacheBlocks; /* Num blocks in cache */ -afs_int32 cacheFiles = 1000; /* Num files in workstation cache */ -afs_int32 cacheStatEntries = 300; /* Num of stat cache entries */ -char cacheBaseDir[1024]; /* AFS cache directory */ -char confDir[1024]; /* AFS configuration directory */ -char afs_mountDir[1024]; /* AFS mount point */ -int afs_mountDirLen; /* strlen of AFS mount point */ -char fullpn_DCacheFile[1024]; /* Full pathname of DCACHEFILE */ -char fullpn_VolInfoFile[1024]; /* Full pathname of VOLINFOFILE */ -char fullpn_AFSLogFile[1024]; /* Full pathname of AFSLOGFILE */ -char fullpn_CacheInfo[1024]; /* Full pathname of CACHEINFO */ -char fullpn_VFile[1024]; /* Full pathname of data cache files */ -char *vFileNumber; /* Ptr to number in file pathname */ +afs_int32 cacheBlocks; /* Num blocks in cache */ +afs_int32 cacheFiles = 1000; /* Num files in workstation cache */ +afs_int32 cacheStatEntries = 300; /* Num of stat cache entries */ +char cacheBaseDir[1024]; /* AFS cache directory */ +char confDir[1024]; /* AFS configuration directory */ +char afs_mountDir[1024]; /* AFS mount point */ +int afs_mountDirLen; /* strlen of AFS mount point */ +char fullpn_DCacheFile[1024]; /* Full pathname of DCACHEFILE */ +char fullpn_VolInfoFile[1024]; /* Full pathname of VOLINFOFILE */ +char fullpn_CellInfoFile[1024]; /* Full pathname of CELLINFOFILE */ +char fullpn_AFSLogFile[1024]; /* Full pathname of AFSLOGFILE */ +char fullpn_CacheInfo[1024]; /* Full pathname of CACHEINFO */ +char fullpn_VFile[1024]; /* Full pathname of data cache files */ +char *vFileNumber; /* Ptr to number in file pathname */ char rootVolume[64] = "root.afs"; /* AFS root volume name */ -afs_int32 isHomeCell; /* Is current cell info for home cell */ -afs_int32 lookingForHomeCell; /* Are we still looking for home cell */ -int createAndTrunc = O_CREAT | O_TRUNC; /* Create & truncate on open */ -int ownerRWmode = 0600; /* Read/write OK by owner */ -static int nDaemons = 2; /* Number of background daemons */ -static int chunkSize = 0; /* 2^chunkSize bytes per chunk */ -static int dCacheSize = 300; /* # of dcache entries */ -static int vCacheSize = 50; /* # of volume cache entries */ -static int cacheFlags = 0; /* Flags to cache manager */ -static int preallocs = 400; /* Def # of allocated memory blocks */ -int afsd_verbose = 0; /* Are we being chatty? */ -int afsd_debug = 0; /* Are we printing debugging info? */ -int afsd_CloseSynch = 0; /* Are closes synchronous or not? */ +afs_int32 isHomeCell; /* Is current cell info for home cell */ +int createAndTrunc = O_CREAT | O_TRUNC; /* Create & truncate on open */ +int ownerRWmode = 0600; /* Read/write OK by owner */ +static int nDaemons = 2; /* Number of background daemons */ +static int chunkSize = 0; /* 2^chunkSize bytes per chunk */ +static int dCacheSize = 300; /* # of dcache entries */ +static int vCacheSize = 50; /* # of volume cache entries */ +static int cacheFlags = 0; /* Flags to cache manager */ +static int preallocs = 400; /* Def # of allocated memory blocks */ +int afsd_verbose = 0; /* Are we being chatty? */ +int afsd_debug = 0; /* Are we printing debugging info? */ +int afsd_CloseSynch = 0; /* Are closes synchronous or not? */ #define AFSD_INO_T afs_uint32 -char **pathname_for_V; /* Array of cache file pathnames */ -int missing_DCacheFile = 1; /* Is the DCACHEFILE missing? */ -int missing_VolInfoFile = 1; /* Is the VOLINFOFILE missing? */ -struct afs_cacheParams cparams; /* params passed to cache manager */ -struct afsconf_dir *afs_cdir; /* config dir */ +char **pathname_for_V; /* Array of cache file pathnames */ +int missing_DCacheFile = 1; /* Is the DCACHEFILE missing? */ +int missing_VolInfoFile = 1; /* Is the VOLINFOFILE missing? */ +int missing_CellInfoFile = 1; +struct afs_cacheParams cparams; /* params passed to cache manager */ +struct afsconf_dir *afs_cdir; /* config dir */ static int HandleMTab(); @@ -114,7 +117,7 @@ char V = 'V'; long V = 'V'; #endif /* AFS_USR_OSF_ENV */ -struct usr_ucred afs_osi_cred; +struct usr_ucred afs_osi_cred, *afs_osi_credp; usr_mutex_t afs_global_lock; usr_thread_t afs_global_owner; usr_mutex_t rx_global_lock; @@ -128,7 +131,7 @@ afs_lock_t osi_fsplock; void *vnodefops; #ifndef NETSCAPE_NSAPI - + /* * Mutex and condition variable used to implement sleep */ @@ -145,14 +148,14 @@ int call_syscall(long, long, long, long, long, long); * osi_Sleep/osi_Wakeup and osi_Wait/osi_Wakeup */ typedef struct osi_wait { - caddr_t addr; - usr_cond_t cond; - int flag; - struct osi_wait *next; - struct osi_wait *prev; - time_t expiration; - struct osi_wait *timedNext; - struct osi_wait *timedPrev; + caddr_t addr; + usr_cond_t cond; + int flag; + struct osi_wait *next; + struct osi_wait *prev; + time_t expiration; + struct osi_wait *timedNext; + struct osi_wait *timedPrev; } osi_wait_t; /* @@ -169,16 +172,15 @@ osi_wait_t *osi_timedwait_head; osi_wait_t *osi_timedwait_tail; struct { - osi_wait_t *head; - osi_wait_t *tail; + osi_wait_t *head; + osi_wait_t *tail; } osi_waithash_table[OSI_WAITHASH_SIZE]; /* * Never call afs_brelse */ -int ufs_brelse(vp, bp) -struct usr_vnode *vp; -struct usr_buf *bp; +int +ufs_brelse(struct usr_vnode *vp, struct usr_buf *bp) { usr_assert(0); } @@ -186,14 +188,14 @@ struct usr_buf *bp; /* * I am not sure what to do with these, they assert for now */ -int iodone(bp) -struct usr_buf *bp; +int +iodone(struct usr_buf *bp) { usr_assert(0); } -struct usr_file *getf(fd) -int fd; +struct usr_file * +getf(int fd) { usr_assert(0); } @@ -201,14 +203,14 @@ int fd; /* * Every user is a super user */ -int afs_osi_suser(credp) -struct usr_ucred *credp; +int +afs_osi_suser(void *credp) { return 1; } -int afs_suser(credp) -struct usr_ucred *credp; +int +afs_suser(void *credp) { return 1; } @@ -217,17 +219,18 @@ struct usr_ucred *credp; * These are no-ops in user space */ -int afs_osi_SetTime(atv) -osi_timeval_t *atv; +void +afs_osi_SetTime(osi_timeval_t * atv) { - return 0; + return; } /* * xflock should never fall through, the only files we know * about are AFS files */ -int usr_flock() +int +usr_flock(void) { usr_assert(0); } @@ -236,7 +239,8 @@ int usr_flock() * ioctl should never fall through, the only files we know * about are AFS files */ -int usr_ioctl() +int +usr_ioctl(void) { usr_assert(0); } @@ -244,22 +248,26 @@ int usr_ioctl() /* * We do not support the inode related system calls */ -int afs_syscall_icreate() +int +afs_syscall_icreate(void) { usr_assert(0); } -int afs_syscall_iincdec() +int +afs_syscall_iincdec(void) { usr_assert(0); } -int afs_syscall_iopen() +int +afs_syscall_iopen(void) { usr_assert(0); } -int afs_syscall_ireadwrite() +int +afs_syscall_ireadwrite(void) { usr_assert(0); } @@ -268,22 +276,26 @@ int afs_syscall_ireadwrite() * these routines are referenced in the vfsops structure, but * should never get called */ -int vno_close() +int +vno_close(void) { usr_assert(0); } -int vno_ioctl() +int +vno_ioctl(void) { usr_assert(0); } -int vno_rw() +int +vno_rw(void) { usr_assert(0); } -int vno_select() +int +vno_select(void) { usr_assert(0); } @@ -291,11 +303,8 @@ int vno_select() /* * uiomove copies data between kernel buffers and uio buffers */ -int usr_uiomove(kbuf, n, rw, uio) -char *kbuf; -int n; -int rw; -struct usr_uio *uio; +int +usr_uiomove(char *kbuf, int n, int rw, struct usr_uio *uio) { int nio; int len; @@ -312,7 +321,7 @@ struct usr_uio *uio; * copy the data */ ptr = kbuf; - while(nio > 0 && n > 0) { + while (nio > 0 && n > 0) { len = MIN(n, iovp->iov_len); if (rw == UIO_READ) { memcpy(iovp->iov_base, ptr, len); @@ -337,8 +346,8 @@ struct usr_uio *uio; /* * routines to manage user credentials */ -struct usr_ucred *usr_crcopy(credp) -struct usr_ucred *credp; +struct usr_ucred * +usr_crcopy(struct usr_ucred *credp) { struct usr_ucred *newcredp; @@ -348,7 +357,8 @@ struct usr_ucred *credp; return newcredp; } -struct usr_ucred *usr_crget() +struct usr_ucred * +usr_crget(void) { struct usr_ucred *newcredp; @@ -357,8 +367,8 @@ struct usr_ucred *usr_crget() return newcredp; } -int usr_crfree(credp) -struct usr_ucred *credp; +int +usr_crfree(struct usr_ucred *credp) { credp->cr_ref--; if (credp->cr_ref == 0) { @@ -366,18 +376,18 @@ struct usr_ucred *credp; } } -int usr_crhold(credp) -struct usr_ucred *credp; +int +usr_crhold(struct usr_ucred *credp) { credp->cr_ref++; } -void usr_vattr_null(vap) -struct usr_vattr *vap; +void +usr_vattr_null(struct usr_vattr *vap) { int n; char *cp; - + n = sizeof(struct usr_vattr); cp = (char *)vap; while (n--) { @@ -390,7 +400,8 @@ struct usr_vattr *vap; * kernel environment for each thread. The user structure * is stored in the thread specific data. */ -void uafs_InitThread() +void +uafs_InitThread(void) { int st; struct usr_user *uptr; @@ -400,13 +411,14 @@ void uafs_InitThread() * allocate the data block, so pthread_finish can free the buffer * when this thread terminates. */ - uptr = (struct usr_user *)malloc(sizeof(struct usr_user) + - sizeof(struct usr_ucred)); + uptr = + (struct usr_user *)malloc(sizeof(struct usr_user) + + sizeof(struct usr_ucred)); usr_assert(uptr != NULL); uptr->u_error = 0; uptr->u_prio = 0; uptr->u_procp = afs_global_procp; - uptr->u_cred = (struct usr_ucred *)(uptr+1); + uptr->u_cred = (struct usr_ucred *)(uptr + 1); *uptr->u_cred = *afs_global_ucredp; st = usr_setspecific(afs_global_u_key, (void *)uptr); usr_assert(st == 0); @@ -417,13 +429,14 @@ void uafs_InitThread() * this routine is used to implement the global 'u' structure. Initializes * the thread if needed. */ -struct usr_user *get_user_struct() +struct usr_user * +get_user_struct(void) { struct usr_user *uptr; int st; st = usr_getspecific(afs_global_u_key, (void **)&uptr); usr_assert(st == 0); - if(uptr == NULL) { + if (uptr == NULL) { uafs_InitThread(); st = usr_getspecific(afs_global_u_key, (void **)&uptr); usr_assert(st == 0); @@ -441,8 +454,8 @@ struct usr_user *get_user_struct() /* * Sleep on an event */ -int afs_osi_Sleep(x) -caddr_t x; +void +afs_osi_Sleep(void *x) { int index; osi_wait_t *waitp; @@ -458,7 +471,7 @@ caddr_t x; } index = WAITHASH(x); if (osi_waithash_avail == NULL) { - waitp = (osi_wait_t *)afs_osi_Alloc(sizeof(osi_wait_t)); + waitp = (osi_wait_t *) afs_osi_Alloc(sizeof(osi_wait_t)); usr_cond_init(&waitp->cond); } else { waitp = osi_waithash_avail; @@ -487,8 +500,15 @@ caddr_t x; } } -int afs_osi_Wakeup(x) -caddr_t x; +int +afs_osi_SleepSig(void *x) +{ + afs_osi_Sleep(x); + return 0; +} + +int +afs_osi_Wakeup(void *x) { int index; osi_wait_t *waitp; @@ -506,10 +526,8 @@ caddr_t x; usr_mutex_unlock(&osi_waitq_lock); } -int afs_osi_Wait(msec, handle, intok) -afs_int32 msec; -struct afs_osi_WaitHandle *handle; -int intok; +int +afs_osi_Wait(afs_int32 msec, struct afs_osi_WaitHandle *handle, int intok) { int index; osi_wait_t *waitp; @@ -531,7 +549,7 @@ int intok; ret = 0; if (glockOwner) { AFS_GLOCK(); - } + } if (rxGlockOwner) { AFS_RXGLOCK(); } @@ -543,22 +561,22 @@ int intok; if (rxGlockOwner) { AFS_RXGUNLOCK(); } - index = WAITHASH((caddr_t)handle); + index = WAITHASH((caddr_t) handle); if (osi_waithash_avail == NULL) { - waitp = (osi_wait_t *)afs_osi_Alloc(sizeof(osi_wait_t)); + waitp = (osi_wait_t *) afs_osi_Alloc(sizeof(osi_wait_t)); usr_cond_init(&waitp->cond); } else { waitp = osi_waithash_avail; osi_waithash_avail = osi_waithash_avail->next; } - waitp->addr = (caddr_t)handle; + waitp->addr = (caddr_t) handle; waitp->flag = 0; DLL_INSERT_TAIL(waitp, osi_waithash_table[index].head, osi_waithash_table[index].tail, next, prev); tv.tv_sec += time(NULL); - waitp->expiration = tv.tv_sec + ((tv.tv_nsec == 0)?0:1); + waitp->expiration = tv.tv_sec + ((tv.tv_nsec == 0) ? 0 : 1); DLL_INSERT_TAIL(waitp, osi_timedwait_head, osi_timedwait_tail, - timedNext, timedPrev); + timedNext, timedPrev); usr_cond_wait(&waitp->cond, &osi_waitq_lock); if (waitp->flag) { ret = 2; @@ -567,8 +585,8 @@ int intok; } DLL_DELETE(waitp, osi_waithash_table[index].head, osi_waithash_table[index].tail, next, prev); - DLL_DELETE(waitp, osi_timedwait_head, osi_timedwait_tail, - timedNext, timedPrev); + DLL_DELETE(waitp, osi_timedwait_head, osi_timedwait_tail, timedNext, + timedPrev); waitp->next = osi_waithash_avail; osi_waithash_avail = waitp; usr_mutex_unlock(&osi_waitq_lock); @@ -582,17 +600,18 @@ int intok; return ret; } -void afs_osi_CancelWait(handle) -struct afs_osi_WaitHandle *handle; +void +afs_osi_CancelWait(struct afs_osi_WaitHandle *handle) { - afs_osi_Wakeup((caddr_t)handle); + afs_osi_Wakeup(handle); } /* * Netscape NSAPI doesn't have a cond_timed_wait, so we need * to explicitly signal cond_timed_waits when their timers expire */ -int afs_osi_CheckTimedWaits() +int +afs_osi_CheckTimedWaits(void) { time_t curTime; osi_wait_t *waitp; @@ -629,19 +648,16 @@ int max_osi_files = 0; * Allocate a slot in the file table if there is not one there already, * copy in the file name and kludge up the vnode and inode structures */ -int lookupname(fnamep, segflg, followlink, dirvpp, compvpp) -char *fnamep; -int segflg; -int followlink; -struct usr_vnode **dirvpp; -struct usr_vnode **compvpp; +int +lookupname(char *fnamep, int segflg, int followlink, + struct usr_vnode **dirvpp, struct usr_vnode **compvpp) { int i; int code; struct usr_inode *ip; struct usr_vnode *vp; - /*usr_assert(followlink == 0);*/ + /*usr_assert(followlink == 0); */ usr_assert(dirvpp == NULL); /* @@ -656,7 +672,7 @@ struct usr_vnode **compvpp; usr_mutex_lock(&osi_inode_lock); - for (i = 0 ; i < n_osi_files ; i++) { + for (i = 0; i < n_osi_files; i++) { if (strcmp(fnamep, osi_file_table[i].name) == 0) { *compvpp = &osi_file_table[i].i_node.i_vnode; (*compvpp)->v_count++; @@ -670,12 +686,12 @@ struct usr_vnode **compvpp; return ENOSPC; } - osi_file_table[n_osi_files].name = afs_osi_Alloc(strlen(fnamep)+1); + osi_file_table[n_osi_files].name = afs_osi_Alloc(strlen(fnamep) + 1); usr_assert(osi_file_table[n_osi_files].name != NULL); strcpy(osi_file_table[n_osi_files].name, fnamep); ip = &osi_file_table[i].i_node; vp = &ip->i_vnode; - vp->v_data = (caddr_t)ip; + vp->v_data = (caddr_t) ip; ip->i_dev = -1; n_osi_files++; ip->i_number = n_osi_files; @@ -688,8 +704,8 @@ struct usr_vnode **compvpp; /* * open a file given its i-node number */ -void *osi_UFSOpen(ino) -int ino; +void * +osi_UFSOpen(afs_int32 ino) { int rc; struct osi_file *fp; @@ -705,7 +721,7 @@ int ino; AFS_GUNLOCK(); fp = (struct osi_file *)afs_osi_Alloc(sizeof(struct osi_file)); usr_assert(fp != NULL); - fp->fd = open(osi_file_table[ino-1].name, O_RDWR|O_CREAT, 0); + fp->fd = open(osi_file_table[ino - 1].name, O_RDWR | O_CREAT, 0); if (fp->fd < 0) { u.u_error = errno; afs_osi_Free((char *)fp, sizeof(struct osi_file)); @@ -728,8 +744,8 @@ int ino; return fp; } -int osi_UFSClose(fp) -struct osi_file *fp; +int +osi_UFSClose(struct osi_file *fp) { int rc; @@ -748,9 +764,8 @@ struct osi_file *fp; return 0; } -int osi_UFSTruncate(fp, len) -struct osi_file *fp; -int len; +int +osi_UFSTruncate(struct osi_file *fp, afs_int32 len) { int rc; @@ -768,11 +783,8 @@ int len; return 0; } -int afs_osi_Read(fp, offset, buf, len) -struct osi_file *fp; -int offset; -char *buf; -int len; +int +afs_osi_Read(struct osi_file *fp, int offset, void *buf, afs_int32 len) { int rc, ret; int code; @@ -810,11 +822,8 @@ int len; return ret; } -int afs_osi_Write(fp, offset, buf, len) -struct osi_file *fp; -int offset; -char *buf; -int len; +int +afs_osi_Write(struct osi_file *fp, afs_int32 offset, void *buf, afs_int32 len) { int rc, ret; int code; @@ -852,9 +861,8 @@ int len; return ret; } -int afs_osi_Stat(fp, stp) -struct osi_file *fp; -struct osi_stat *stp; +int +afs_osi_Stat(struct osi_file *fp, struct osi_stat *stp) { int rc; struct stat st; @@ -864,7 +872,7 @@ struct osi_stat *stp; if (rc < 0) { u.u_error = errno; AFS_GLOCK(); - return -1; + return -1; } stp->size = st.st_size; stp->blksize = st.st_blksize; @@ -877,12 +885,9 @@ struct osi_stat *stp; /* * VOP_RDWR routine */ -int afs_osi_VOP_RDWR( - struct usr_vnode *vnodeP, - struct usr_uio *uioP, - int rw, - int flags, - struct usr_ucred* credP) +int +afs_osi_VOP_RDWR(struct usr_vnode *vnodeP, struct usr_uio *uioP, int rw, + int flags, struct usr_ucred *credP) { int rc; struct osi_file *fp = (struct osi_file *)vnodeP; @@ -895,13 +900,11 @@ int afs_osi_VOP_RDWR( if (rw == UIO_WRITE) { usr_assert(uioP->uio_fmode == FWRITE); - rc = afs_osi_Write(fp, uioP->uio_offset, - uioP->uio_iov[0].iov_base, + rc = afs_osi_Write(fp, uioP->uio_offset, uioP->uio_iov[0].iov_base, uioP->uio_iov[0].iov_len); } else { usr_assert(uioP->uio_fmode == FREAD); - rc = afs_osi_Read(fp, uioP->uio_offset, - uioP->uio_iov[0].iov_base, + rc = afs_osi_Read(fp, uioP->uio_offset, uioP->uio_iov[0].iov_base, uioP->uio_iov[0].iov_len); } if (rc < 0) { @@ -922,126 +925,138 @@ int afs_osi_VOP_RDWR( static char *afs_check_string1 = "UAFS"; static char *afs_check_string2 = "AFS_OSI_"; -void *afs_osi_Alloc(size_t size) +void * +afs_osi_Alloc(size_t size) { return malloc(size); } -void afs_osi_Free(void *ptr, size_t size) +void +afs_osi_Free(void *ptr, size_t size) { free(ptr); } -void afs_osi_FreeStr(char *ptr) +void +afs_osi_FreeStr(char *ptr) { free(ptr); } -void *osi_AllocLargeSpace(size_t size) +void * +osi_AllocLargeSpace(size_t size) { AFS_STATCNT(osi_AllocLargeSpace); return afs_osi_Alloc(size); } -void osi_FreeLargeSpace(void *ptr) +void +osi_FreeLargeSpace(void *ptr) { AFS_STATCNT(osi_FreeLargeSpace); afs_osi_Free(ptr, 0); } -void *osi_AllocSmallSpace(size_t size) +void * +osi_AllocSmallSpace(size_t size) { AFS_STATCNT(osi_AllocSmallSpace); return afs_osi_Alloc(size); } -void osi_FreeSmallSpace(void *ptr) +void +osi_FreeSmallSpace(void *ptr) { AFS_STATCNT(osi_FreeSmallSpace); afs_osi_Free(ptr, 0); } -void shutdown_osi() +void +shutdown_osi(void) { AFS_STATCNT(shutdown_osi); return; } -void shutdown_osinet() +void +shutdown_osinet(void) { AFS_STATCNT(shutdown_osinet); return; } -void shutdown_osifile() +void +shutdown_osifile(void) { AFS_STATCNT(shutdown_osifile); return; } -int afs_nfsclient_init() +int +afs_nfsclient_init(void) { return 0; } -void shutdown_nfsclnt() +void +shutdown_nfsclnt(void) { return; } -int afs_osi_Invisible() +void +afs_osi_Invisible(void) { - return 0; + return; } -int osi_GetTime(tv) -struct timeval *tv; +int +osi_GetTime(struct timeval *tv) { gettimeofday(tv, NULL); return 0; } -int osi_SetTime(tv) -struct timeval *tv; +int +osi_SetTime(struct timeval *tv) { return 0; } -int osi_Active(avc) -struct vcache *avc; +int +osi_Active(struct vcache *avc) { AFS_STATCNT(osi_Active); - if (avc->opens > 0) return(1); + if (avc->opens > 0) + return (1); return 0; } -int afs_osi_MapStrategy(aproc, bp) -int (*aproc)(); -struct usr_buf *bp; +int +afs_osi_MapStrategy(int (*aproc) (), struct usr_buf *bp) { afs_int32 returnCode; - returnCode = (*aproc)(bp); + returnCode = (*aproc) (bp); return returnCode; } -osi_FlushPages(avc, credp) - register struct vcache *avc; - struct AFS_UCRED *credp; +void +osi_FlushPages(register struct vcache *avc, struct AFS_UCRED *credp) { - ObtainSharedLock(&avc->lock,555); - if ((hcmp((avc->m.DataVersion), (avc->mapDV)) <= 0) || - ((avc->execsOrWriters > 0) && afs_DirtyPages(avc))) { + ObtainSharedLock(&avc->lock, 555); + if ((hcmp((avc->m.DataVersion), (avc->mapDV)) <= 0) + || ((avc->execsOrWriters > 0) && afs_DirtyPages(avc))) { ReleaseSharedLock(&avc->lock); return; } - UpgradeSToWLock(&avc->lock,565); + UpgradeSToWLock(&avc->lock, 565); hset(avc->mapDV, avc->m.DataVersion); ReleaseWriteLock(&avc->lock); return; } -osi_FlushText_really(vp) - register struct vcache *vp; +void +osi_FlushText_really(register struct vcache *vp) { if (hcmp(vp->m.DataVersion, vp->flushDV) > 0) { hset(vp->flushDV, vp->m.DataVersion); @@ -1049,21 +1064,20 @@ osi_FlushText_really(vp) return; } -int osi_SyncVM(avc) -struct vcache *avc; +int +osi_SyncVM(struct vcache *avc) { return 0; } -void osi_ReleaseVM(avc, len, credp) -struct vcache *avc; -int len; -struct usr_ucred *credp; +void +osi_ReleaseVM(struct vcache *avc, int len, struct usr_ucred *credp) { return; } -void osi_Init() +void +osi_Init(void) { int i; int rc; @@ -1074,7 +1088,7 @@ void osi_Init() */ max_osi_files = cacheFiles + 100; osi_file_table = (osi_file_table_t *) - afs_osi_Alloc(max_osi_files * sizeof(osi_file_table_t)); + afs_osi_Alloc(max_osi_files * sizeof(osi_file_table_t)); usr_assert(osi_file_table != NULL); #ifndef NETSCAPE_NSAPI @@ -1089,7 +1103,7 @@ void osi_Init() /* * Initialize the hash table used for sleep/wakeup */ - for (i = 0 ; i < OSI_WAITHASH_SIZE ; i++) { + for (i = 0; i < OSI_WAITHASH_SIZE; i++) { DLL_INIT_LIST(osi_waithash_table[i].head, osi_waithash_table[i].tail); } DLL_INIT_LIST(osi_timedwait_head, osi_timedwait_tail); @@ -1098,7 +1112,7 @@ void osi_Init() /* * Initialize the AFS file table */ - for (i = 0 ; i < MAX_OSI_FILES ; i++) { + for (i = 0; i < MAX_OSI_FILES; i++) { afs_FileTable[i] = NULL; } @@ -1115,6 +1129,7 @@ void osi_Init() * Initialize the AFS OSI credentials */ afs_osi_cred = *afs_global_ucredp; + afs_osi_credp = &afs_osi_cred; } /* ParseArgs is now obsolete, being handled by cmd */ @@ -1142,12 +1157,12 @@ void osi_Init() * None. *------------------------------------------------------------------------*/ -int GetVFileNumber(fname) - char *fname; +int +GetVFileNumber(char *fname) { - int computedVNumber; /*The computed file number we return*/ - int filenameLen; /*Number of chars in filename*/ - int currDigit; /*Current digit being processed*/ + int computedVNumber; /*The computed file number we return */ + int filenameLen; /*Number of chars in filename */ + int currDigit; /*Current digit being processed */ /* * The filename must have at least two characters, the first of which must be a ``V'' @@ -1155,11 +1170,11 @@ int GetVFileNumber(fname) */ filenameLen = strlen(fname); if (filenameLen < 2) - return(-1); + return (-1); if (fname[0] != 'V') - return(-1); + return (-1); if ((filenameLen > 2) && (fname[1] == '0')) - return(-1); + return (-1); /* * Scan through the characters in the given filename, failing immediately if a non-digit @@ -1167,7 +1182,7 @@ int GetVFileNumber(fname) */ for (currDigit = 1; currDigit < filenameLen; currDigit++) if (isdigit(fname[currDigit]) == 0) - return(-1); + return (-1); /* * All relevant characters are digits. Pull out the decimal number they represent. @@ -1175,9 +1190,9 @@ int GetVFileNumber(fname) */ computedVNumber = atoi(++fname); if (computedVNumber < cacheFiles) - return(computedVNumber); + return (computedVNumber); else - return(-1); + return (-1); } /*--------------------------------------------------------------------- @@ -1201,30 +1216,30 @@ int GetVFileNumber(fname) * As described. *------------------------------------------------------------------------*/ -int CreateCacheFile(fname) - char *fname; +int +CreateCacheFile(char *fname) { - static char rn[] = "CreateCacheFile"; /*Routine name*/ - int cfd; /*File descriptor to AFS cache file*/ - int closeResult; /*Result of close()*/ + static char rn[] = "CreateCacheFile"; /*Routine name */ + int cfd; /*File descriptor to AFS cache file */ + int closeResult; /*Result of close() */ if (afsd_verbose) - printf("%s: Creating cache file '%s'\n", - rn, fname); + printf("%s: Creating cache file '%s'\n", rn, fname); cfd = open(fname, createAndTrunc, ownerRWmode); - if (cfd <= 0) { - printf("%s: Can't create '%s', error return is %d (%d)\n", - rn, fname, cfd, errno); - return(-1); + if (cfd <= 0) { + printf("%s: Can't create '%s', error return is %d (%d)\n", rn, fname, + cfd, errno); + return (-1); } closeResult = close(cfd); - if (closeResult) { - printf("%s: Can't close newly-created AFS cache file '%s' (code %d)\n", - rn, fname, errno); - return(-1); + if (closeResult) { + printf + ("%s: Can't close newly-created AFS cache file '%s' (code %d)\n", + rn, fname, errno); + return (-1); } - return(0); + return (0); } /*--------------------------------------------------------------------- @@ -1255,38 +1270,37 @@ int CreateCacheFile(fname) * delete files as explained above. *------------------------------------------------------------------------*/ -int SweepAFSCache(vFilesFound) - int *vFilesFound; +int +SweepAFSCache(int *vFilesFound) { - static char rn[] = "SweepAFSCache"; /*Routine name*/ - char fullpn_FileToDelete[1024]; /*File to be deleted from cache*/ - char *fileToDelete; /*Ptr to last component of above*/ - DIR *cdirp; /*Ptr to cache directory structure*/ + static char rn[] = "SweepAFSCache"; /*Routine name */ + char fullpn_FileToDelete[1024]; /*File to be deleted from cache */ + char *fileToDelete; /*Ptr to last component of above */ + DIR *cdirp; /*Ptr to cache directory structure */ #undef dirent - struct dirent *currp; /*Current directory entry*/ - int vFileNum; /*Data cache file's associated number*/ + struct dirent *currp; /*Current directory entry */ + int vFileNum; /*Data cache file's associated number */ if (cacheFlags & AFSCALL_INIT_MEMCACHE) { if (afsd_debug) - printf("%s: Memory Cache, no cache sweep done\n"); + printf("%s: Memory Cache, no cache sweep done\n", rn); *vFilesFound = 0; return 0; } if (afsd_debug) - printf("%s: Opening cache directory '%s'\n", - rn, cacheBaseDir); + printf("%s: Opening cache directory '%s'\n", rn, cacheBaseDir); - if (chmod(cacheBaseDir, 0700)) { /* force it to be 700 */ - printf("%s: Can't 'chmod 0700' the cache dir, '%s'.\n", - rn, cacheBaseDir); + if (chmod(cacheBaseDir, 0700)) { /* force it to be 700 */ + printf("%s: Can't 'chmod 0700' the cache dir, '%s'.\n", rn, + cacheBaseDir); return (-1); } cdirp = opendir(cacheBaseDir); - if (cdirp == (DIR *)0) { - printf("%s: Can't open AFS cache directory, '%s'.\n", - rn, cacheBaseDir); - return(-1); + if (cdirp == (DIR *) 0) { + printf("%s: Can't open AFS cache directory, '%s'.\n", rn, + cacheBaseDir); + return (-1); } /* @@ -1297,13 +1311,11 @@ int SweepAFSCache(vFilesFound) sprintf(fullpn_FileToDelete, "%s/", cacheBaseDir); fileToDelete = fullpn_FileToDelete + strlen(fullpn_FileToDelete); - for (currp = readdir(cdirp); currp; currp = readdir(cdirp)) - { + for (currp = readdir(cdirp); currp; currp = readdir(cdirp)) { if (afsd_debug) { - printf("%s: Current directory entry:\n", - rn); - printf("\tinode=%d, reclen=%d, name='%s'\n", - currp->d_ino, currp->d_reclen, currp->d_name); + printf("%s: Current directory entry:\n", rn); + printf("\tinode=%d, reclen=%d, name='%s'\n", currp->d_ino, + currp->d_reclen, currp->d_name); } /* @@ -1315,43 +1327,41 @@ int SweepAFSCache(vFilesFound) * Found a valid data cache filename. Remember this file's name * and bump the number of files found. */ - pathname_for_V[vFileNum] = afs_osi_Alloc(strlen(currp->d_name) + - strlen(cacheBaseDir) + 2); + pathname_for_V[vFileNum] = + afs_osi_Alloc(strlen(currp->d_name) + strlen(cacheBaseDir) + + 2); usr_assert(pathname_for_V[vFileNum] != NULL); - sprintf(pathname_for_V[vFileNum], "%s/%s", - cacheBaseDir, currp->d_name); + sprintf(pathname_for_V[vFileNum], "%s/%s", cacheBaseDir, + currp->d_name); (*vFilesFound)++; - } - else if (strcmp(currp->d_name, DCACHEFILE) == 0) { + } else if (strcmp(currp->d_name, DCACHEFILE) == 0) { /* * Found the file holding the dcache entries. */ missing_DCacheFile = 0; - } - else if (strcmp(currp->d_name, VOLINFOFILE) == 0) { + } else if (strcmp(currp->d_name, VOLINFOFILE) == 0) { /* * Found the file holding the volume info. */ missing_VolInfoFile = 0; - } - else if ((strcmp(currp->d_name, ".") == 0) || - (strcmp(currp->d_name, "..") == 0) || - (strcmp(currp->d_name, "lost+found") == 0)) { + } else if (strcmp(currp->d_name, CELLINFOFILE) == 0) { + missing_CellInfoFile = 0; + } else if ((strcmp(currp->d_name, ".") == 0) + || (strcmp(currp->d_name, "..") == 0) + || (strcmp(currp->d_name, "lost+found") == 0)) { /* * Don't do anything - this file is legit, and is to be left alone. */ - } - else { + } else { /* * This file doesn't belong in the cache. Nuke it. */ sprintf(fileToDelete, "%s", currp->d_name); if (afsd_verbose) - printf("%s: Deleting '%s'\n", - rn, fullpn_FileToDelete); + printf("%s: Deleting '%s'\n", rn, fullpn_FileToDelete); if (unlink(fullpn_FileToDelete)) { - printf("%s: Can't unlink '%s', errno is %d\n", - rn, fullpn_FileToDelete, errno); + printf("%s: Can't unlink '%s', errno is %d\n", rn, + fullpn_FileToDelete, errno); } } } @@ -1361,19 +1371,21 @@ int SweepAFSCache(vFilesFound) */ if (missing_DCacheFile) { if (afsd_verbose) - printf("%s: Creating '%s'\n", - rn, fullpn_DCacheFile); + printf("%s: Creating '%s'\n", rn, fullpn_DCacheFile); if (CreateCacheFile(fullpn_DCacheFile)) - printf("%s: Can't create '%s'\n", - rn, fullpn_DCacheFile); + printf("%s: Can't create '%s'\n", rn, fullpn_DCacheFile); } if (missing_VolInfoFile) { if (afsd_verbose) - printf("%s: Creating '%s'\n", - rn, fullpn_VolInfoFile); + printf("%s: Creating '%s'\n", rn, fullpn_VolInfoFile); if (CreateCacheFile(fullpn_VolInfoFile)) - printf("%s: Can't create '%s'\n", - rn, fullpn_VolInfoFile); + printf("%s: Can't create '%s'\n", rn, fullpn_VolInfoFile); + } + if (missing_CellInfoFile) { + if (afsd_verbose) + printf("%s: Creating '%s'\n", rn, fullpn_CellInfoFile); + if (CreateCacheFile(fullpn_CellInfoFile)) + printf("%s: Can't create '%s'\n", rn, fullpn_CellInfoFile); } if (*vFilesFound < cacheFiles) { @@ -1382,14 +1394,12 @@ int SweepAFSCache(vFilesFound) * list and create all missing files. */ for (vFileNum = 0; vFileNum < cacheFiles; vFileNum++) - if (pathname_for_V[vFileNum] == (AFSD_INO_T)0) { + if (pathname_for_V[vFileNum] == (AFSD_INO_T) 0) { sprintf(vFileNumber, "%d", vFileNum); if (afsd_verbose) - printf("%s: Creating '%s'\n", - rn, fullpn_VFile); + printf("%s: Creating '%s'\n", rn, fullpn_VFile); if (CreateCacheFile(fullpn_VFile)) - printf("%s: Can't create '%s'\n", - rn, fullpn_VFile); + printf("%s: Can't create '%s'\n", rn, fullpn_VFile); } } @@ -1397,52 +1407,57 @@ int SweepAFSCache(vFilesFound) * Close the directory, return success. */ if (afsd_debug) - printf("%s: Closing cache directory.\n", - rn); + printf("%s: Closing cache directory.\n", rn); closedir(cdirp); - return(0); + return (0); } -static ConfigCell(aci, arock, adir) -register struct afsconf_cell *aci; -char *arock; -struct afsconf_dir *adir; { +static +ConfigCell(register struct afsconf_cell *aci, char *arock, + struct afsconf_dir *adir) +{ register int isHomeCell; register int i; - afs_int32 cellFlags; + afs_int32 cellFlags = 0; afs_int32 hosts[MAXHOSTSPERCELL]; /* figure out if this is the home cell */ isHomeCell = (strcmp(aci->name, afs_LclCellName) == 0); - if (isHomeCell) { - lookingForHomeCell = 0; - cellFlags = 1; /* home cell, suid is ok */ - } - else { - cellFlags = 2; /* not home, suid is forbidden */ - } + if (!isHomeCell) + cellFlags = 2; /* not home, suid is forbidden */ /* build address list */ - for(i=0;ihostAddr[i].sin_addr, sizeof(afs_int32)); - if (aci->linkedCell) cellFlags |= 4; /* Flag that linkedCell arg exists, - for upwards compatibility */ + if (aci->linkedCell) + cellFlags |= 4; /* Flag that linkedCell arg exists, + * for upwards compatibility */ /* configure one cell */ - call_syscall(AFSCALL_CALL, AFSOP_ADDCELL2, - (long)hosts, /* server addresses */ - (long)aci->name, /* cell name */ - (long)cellFlags, /* is this the home cell? */ - (long)aci->linkedCell); /* Linked cell, if any */ + call_syscall(AFSCALL_CALL, AFSOP_ADDCELL2, (long)hosts, /* server addresses */ + (long)aci->name, /* cell name */ + (long)cellFlags, /* is this the home cell? */ + (long)aci->linkedCell); /* Linked cell, if any */ return 0; } +static int +ConfigCellAlias(aca, arock, adir) + struct afsconf_cellalias *aca; + char *arock; + struct afsconf_dir *adir; +{ + call_syscall(AFSOP_ADDCELLALIAS, (long)aca->aliasName, + (long)aca->realName, 0, 0, 0); + return 0; +} + /* * Set the UDP port number RX uses for UDP datagrams */ -void uafs_SetRxPort( - int port) +void +uafs_SetRxPort(int port) { usr_assert(usr_rx_port == 0); usr_rx_port = port; @@ -1452,32 +1467,22 @@ void uafs_SetRxPort( /* * Initialize the user space client. */ -void uafs_Init( - char *rn, - char *mountDirParam, - char *confDirParam, - char *cacheBaseDirParam, - int cacheBlocksParam, - int cacheFilesParam, - int cacheStatEntriesParam, - int dCacheSizeParam, - int vCacheSizeParam, - int chunkSizeParam, - int closeSynchParam, - int debugParam, - int nDaemonsParam, - int cacheFlagsParam, - char *logFile) +void +uafs_Init(char *rn, char *mountDirParam, char *confDirParam, + char *cacheBaseDirParam, int cacheBlocksParam, int cacheFilesParam, + int cacheStatEntriesParam, int dCacheSizeParam, int vCacheSizeParam, + int chunkSizeParam, int closeSynchParam, int debugParam, + int nDaemonsParam, int cacheFlagsParam, char *logFile) { int st; struct usr_proc *procp; struct usr_ucred *ucredp; int i; int rc; - int currVFile; /* Current AFS cache file number */ - int lookupResult; /* Result of GetLocalCellName() */ - int cacheIteration; /* cache verification loop counter */ - int vFilesFound; /* Num data cache files found in sweep */ + int currVFile; /* Current AFS cache file number */ + int lookupResult; /* Result of GetLocalCellName() */ + int cacheIteration; /* cache verification loop counter */ + int vFilesFound; /* Num data cache files found in sweep */ FILE *logfd; afs_int32 vfs1_type = -1; struct afs_ioctl iob; @@ -1497,7 +1502,7 @@ void uafs_Init( * Initialize the global ucred structure */ afs_global_ucredp = (struct usr_ucred *) - afs_osi_Alloc(sizeof(struct usr_ucred)); + afs_osi_Alloc(sizeof(struct usr_ucred)); usr_assert(afs_global_ucredp != NULL); afs_global_ucredp->cr_ref = 1; afs_global_ucredp->cr_uid = geteuid(); @@ -1509,7 +1514,7 @@ void uafs_Init( st = getgroups(NGROUPS, &afs_global_ucredp->cr_groups[0]); usr_assert(st >= 0); afs_global_ucredp->cr_ngroups = (unsigned long)st; - for (i = st ; i < NGROUPS ; i++) { + for (i = st; i < NGROUPS; i++) { afs_global_ucredp->cr_groups[i] = NOGROUP; } @@ -1517,10 +1522,10 @@ void uafs_Init( * Initialize the global process structure */ afs_global_procp = (struct usr_proc *) - afs_osi_Alloc(sizeof(struct usr_proc)); + afs_osi_Alloc(sizeof(struct usr_proc)); usr_assert(afs_global_procp != NULL); afs_global_procp->p_pid = getpid(); - afs_global_procp->p_ppid = (pid_t)1; + afs_global_procp->p_ppid = (pid_t) 1; afs_global_procp->p_ucred = afs_global_ucredp; /* @@ -1535,7 +1540,7 @@ void uafs_Init( } afs_mountDir[0] = '/'; afs_mountDirLen = 1; - for (lastchar = '/', p = &tbuffer[0] ; *p != '\0' ; p++) { + for (lastchar = '/', p = &tbuffer[0]; *p != '\0'; p++) { if (lastchar != '/' || *p != '/') { afs_mountDir[afs_mountDirLen++] = lastchar = *p; } @@ -1553,7 +1558,7 @@ void uafs_Init( if (cacheFilesParam != 0) { cacheFiles = cacheFilesParam; } else { - cacheFiles = cacheBlocks/10; + cacheFiles = cacheBlocks / 10; } if (cacheStatEntriesParam != 0) { cacheStatEntries = cacheStatEntriesParam; @@ -1570,7 +1575,7 @@ void uafs_Init( if (dCacheSizeParam != 0) { dCacheSize = dCacheSizeParam; } else { - dCacheSize = cacheFiles/2; + dCacheSize = cacheFiles / 2; } if (vCacheSizeParam != 0) { vCacheSize = vCacheSizeParam; @@ -1581,12 +1586,12 @@ void uafs_Init( cacheFlags = cacheFlagsParam; } if (cacheFlags & AFSCALL_INIT_MEMCACHE) { - cacheFiles = dCacheSize; + cacheFiles = dCacheSize; } - sprintf(fullpn_CacheInfo, "%s/%s", confDir, CACHEINFOFILE); + sprintf(fullpn_CacheInfo, "%s/%s", confDir, CACHEINFOFILE); if (logFile == NULL) { - sprintf(fullpn_AFSLogFile, "%s/%s", confDir, AFSLOGFILE); + sprintf(fullpn_AFSLogFile, "%s/%s", confDir, AFSLOGFILE); } else { strcpy(fullpn_AFSLogFile, logFile); } @@ -1624,22 +1629,29 @@ void uafs_Init( exit(1); } - lookupResult = afsconf_GetLocalCell(afs_cdir, afs_LclCellName, - sizeof(afs_LclCellName)); + lookupResult = + afsconf_GetLocalCell(afs_cdir, afs_LclCellName, + sizeof(afs_LclCellName)); if (lookupResult) { - printf("%s: Can't get my home cell name! [Error is %d]\n", - rn, lookupResult); - } - else { + printf("%s: Can't get my home cell name! [Error is %d]\n", rn, + lookupResult); + } else { if (afsd_verbose) - printf("%s: My home cell is '%s'\n", - rn, afs_LclCellName); + printf("%s: My home cell is '%s'\n", rn, afs_LclCellName); } - if ((logfd = fopen(fullpn_AFSLogFile,"r+")) == 0) { - if (afsd_verbose) printf("%s: Creating '%s'\n", rn, fullpn_AFSLogFile); + /* + * Set the primary cell name. + */ + call_syscall(AFSOP_SET_THISCELL, (long)afs_LclCellName, 0, 0, 0, 0); + + if ((logfd = fopen(fullpn_AFSLogFile, "r+")) == 0) { + if (afsd_verbose) + printf("%s: Creating '%s'\n", rn, fullpn_AFSLogFile); if (CreateCacheFile(fullpn_AFSLogFile)) { - printf("%s: Can't create '%s' (You may want to use the -logfile option)\n", rn, fullpn_AFSLogFile); + printf + ("%s: Can't create '%s' (You may want to use the -logfile option)\n", + rn, fullpn_AFSLogFile); exit(1); } } else @@ -1656,29 +1668,30 @@ void uafs_Init( } memset(pathname_for_V, 0, (cacheFiles * sizeof(char *))); if (afsd_debug) - printf("%s: %d pathname_for_V entries at 0x%x, %d bytes\n", - rn, cacheFiles, (cacheFiles * sizeof(AFSD_INO_T))); + printf("%s: %d pathname_for_V entries at 0x%x, %d bytes\n", rn, + cacheFiles, pathname_for_V, (cacheFiles * sizeof(AFSD_INO_T))); /* * Set up all the pathnames we'll need for later. */ - sprintf(fullpn_DCacheFile, "%s/%s", cacheBaseDir, DCACHEFILE); + sprintf(fullpn_DCacheFile, "%s/%s", cacheBaseDir, DCACHEFILE); sprintf(fullpn_VolInfoFile, "%s/%s", cacheBaseDir, VOLINFOFILE); - sprintf(fullpn_VFile, "%s/V", cacheBaseDir); + sprintf(fullpn_CellInfoFile, "%s/%s", cacheBaseDir, CELLINFOFILE); + sprintf(fullpn_VFile, "%s/V", cacheBaseDir); vFileNumber = fullpn_VFile + strlen(fullpn_VFile); /* * Start the RX listener. */ if (afsd_debug) - printf("%s: Calling AFSOP_RXLISTENER_DAEMON\n", rn); - fork_syscall(AFSCALL_CALL, AFSOP_RXLISTENER_DAEMON, FALSE); + printf("%s: Calling AFSOP_RXLISTENER_DAEMON\n", rn); + fork_syscall(AFSCALL_CALL, AFSOP_RXLISTENER_DAEMON, FALSE, FALSE, FALSE); /* * Start the RX event handler. */ if (afsd_debug) - printf("%s: Calling AFSOP_RXEVENT_DAEMON\n", rn); + printf("%s: Calling AFSOP_RXEVENT_DAEMON\n", rn); fork_syscall(AFSCALL_CALL, AFSOP_RXEVENT_DAEMON, FALSE); /* @@ -1687,61 +1700,32 @@ void uafs_Init( /* initialize AFS callback interface */ { - /* parse multihomed address files */ - char reason[1024]; - st=parseNetFiles(buffer,maskbuffer,mtubuffer,MAXIPADDRS,reason, - AFSDIR_CLIENT_NETINFO_FILEPATH, - AFSDIR_CLIENT_NETRESTRICT_FILEPATH); - if(st>0) - call_syscall(AFSCALL_CALL, AFSOP_ADVISEADDR, st, (long) (&buffer[0]), - (long) (&maskbuffer[0]), (long) (&mtubuffer[0])); - else { - printf("ADVISEADDR: Error in specifying interface addresses:%s\n",reason); - exit(1); - } + /* parse multihomed address files */ + char reason[1024]; + st = parseNetFiles(buffer, maskbuffer, mtubuffer, MAXIPADDRS, reason, + AFSDIR_CLIENT_NETINFO_FILEPATH, + AFSDIR_CLIENT_NETRESTRICT_FILEPATH); + if (st > 0) + call_syscall(AFSCALL_CALL, AFSOP_ADVISEADDR, st, + (long)(&buffer[0]), (long)(&maskbuffer[0]), + (long)(&mtubuffer[0])); + else { + printf("ADVISEADDR: Error in specifying interface addresses:%s\n", + reason); + exit(1); + } } if (afsd_verbose) printf("%s: Forking rx callback listener.\n", rn); /* Child */ - if (preallocs < cacheStatEntries+50) - preallocs = cacheStatEntries+50; + if (preallocs < cacheStatEntries + 50) + preallocs = cacheStatEntries + 50; fork_syscall(AFSCALL_CALL, AFSOP_START_RXCALLBACK, preallocs); if (afsd_verbose) - printf("%s: Forking AFS daemon.\n", rn); - fork_syscall(AFSCALL_CALL, AFSOP_START_AFS); - - if (afsd_verbose) - printf("%s: Forking check server daemon.\n", rn); - fork_syscall(AFSCALL_CALL, AFSOP_START_CS); - - if (afsd_verbose) - printf("%s: Forking %d background daemons.\n", rn, nDaemons); - for (i=0;icr_suid = getuid(); crp->cr_groups[0] = getgid(); crp->cr_ngroups = 1; - for (i = 1 ; i < NGROUPS ; i++) { + for (i = 1; i < NGROUPS; i++) { crp->cr_groups[i] = NOGROUP; } - call_syscall(sysArgsP->syscall, sysArgsP->afscall, - sysArgsP->param1, sysArgsP->param2, - sysArgsP->param3, sysArgsP->param4); + call_syscall(sysArgsP->syscall, sysArgsP->afscall, sysArgsP->param1, + sysArgsP->param2, sysArgsP->param3, sysArgsP->param4); afs_osi_Free(argp, -1); } fork_syscall(syscall, afscall, param1, param2, param3, param4) -long syscall, afscall, param1, param2, param3, param4; + long syscall, afscall, param1, param2, param3, param4; { usr_thread_t tid; struct syscallThreadArgs *sysArgsP; sysArgsP = (struct syscallThreadArgs *) - afs_osi_Alloc(sizeof(struct syscallThreadArgs)); + afs_osi_Alloc(sizeof(struct syscallThreadArgs)); usr_assert(sysArgsP != NULL); sysArgsP->syscall = syscall; sysArgsP->afscall = afscall; @@ -2014,7 +2026,7 @@ long syscall, afscall, param1, param2, param3, param4; } call_syscall(syscall, afscall, param1, param2, param3, param4) -long syscall, afscall, param1, param2, param3, param4; + long syscall, afscall, param1, param2, param3, param4; { int code = 0; struct a { @@ -2040,7 +2052,8 @@ long syscall, afscall, param1, param2, param3, param4; return code; } -int uafs_SetTokens(char *tbuffer, int tlen) +int +uafs_SetTokens(char *tbuffer, int tlen) { int rc; struct afs_ioctl iob; @@ -2058,7 +2071,8 @@ int uafs_SetTokens(char *tbuffer, int tlen) return 0; } -int uafs_RPCStatsEnableProc() +int +uafs_RPCStatsEnableProc(void) { int rc; struct afs_ioctl iob; @@ -2077,7 +2091,8 @@ int uafs_RPCStatsEnableProc() return rc; } -int uafs_RPCStatsDisableProc() +int +uafs_RPCStatsDisableProc(void) { int rc; struct afs_ioctl iob; @@ -2096,7 +2111,8 @@ int uafs_RPCStatsDisableProc() return rc; } -int uafs_RPCStatsClearProc() +int +uafs_RPCStatsClearProc(void) { int rc; struct afs_ioctl iob; @@ -2115,7 +2131,8 @@ int uafs_RPCStatsClearProc() return rc; } -int uafs_RPCStatsEnablePeer() +int +uafs_RPCStatsEnablePeer(void) { int rc; struct afs_ioctl iob; @@ -2134,7 +2151,8 @@ int uafs_RPCStatsEnablePeer() return rc; } -int uafs_RPCStatsDisablePeer() +int +uafs_RPCStatsDisablePeer(void) { int rc; struct afs_ioctl iob; @@ -2153,7 +2171,8 @@ int uafs_RPCStatsDisablePeer() return rc; } -int uafs_RPCStatsClearPeer() +int +uafs_RPCStatsClearPeer(void) { int rc; struct afs_ioctl iob; @@ -2179,12 +2198,9 @@ int uafs_RPCStatsClearPeer() * * Note: Caller must hold the AFS global lock. */ -int uafs_LookupName( - char *path, - struct usr_vnode *parentVp, - struct usr_vnode **vpp, - int follow, - int no_eval_mtpt) +int +uafs_LookupName(char *path, struct usr_vnode *parentVp, + struct usr_vnode **vpp, int follow, int no_eval_mtpt) { int code; int linkCount; @@ -2213,7 +2229,7 @@ int uafs_LookupName( /* * Loop through the path looking for the new directory */ - tmpPath = afs_osi_Alloc(strlen(path)+1); + tmpPath = afs_osi_Alloc(strlen(path) + 1); usr_assert(tmpPath != NULL); strcpy(tmpPath, path); VN_HOLD(vp); @@ -2236,7 +2252,7 @@ int uafs_LookupName( */ if (vp->v_type != VDIR) { VN_RELE(vp); - afs_osi_Free(tmpPath, strlen(path)+1); + afs_osi_Free(tmpPath, strlen(path) + 1); return ENOTDIR; } @@ -2252,7 +2268,7 @@ int uafs_LookupName( code = afs_access(vp, VEXEC, u.u_cred); if (code != 0) { VN_RELE(vp); - afs_osi_Free(tmpPath, strlen(path)+1); + afs_osi_Free(tmpPath, strlen(path) + 1); return code; } @@ -2262,16 +2278,18 @@ int uafs_LookupName( */ nextVp = NULL; #ifdef AFS_WEB_ENHANCEMENTS - if ((nextPathP != NULL && *nextPathP != '\0') || !no_eval_mtpt) - code = afs_lookup(vp, pathP, &nextVp, u.u_cred, 0); - else - code = afs_lookup(vp, pathP, &nextVp, u.u_cred, AFS_LOOKUP_NOEVAL); + if ((nextPathP != NULL && *nextPathP != '\0') || !no_eval_mtpt) + code = afs_lookup(vp, pathP, &nextVp, u.u_cred, 0); + else + code = + afs_lookup(vp, pathP, &nextVp, u.u_cred, + AFS_LOOKUP_NOEVAL); #else - code = afs_lookup(vp, pathP, &nextVp, u.u_cred, 0); + code = afs_lookup(vp, pathP, &nextVp, u.u_cred, 0); #endif /* AFS_WEB_ENHANCEMENTS */ if (code != 0) { VN_RELE(vp); - afs_osi_Free(tmpPath, strlen(path)+1); + afs_osi_Free(tmpPath, strlen(path) + 1); return code; } } @@ -2282,18 +2300,18 @@ int uafs_LookupName( */ if ((nextPathP != NULL && *nextPathP != '\0') || follow) { linkCount = 0; - while(nextVp->v_type == VLNK) { + while (nextVp->v_type == VLNK) { if (++linkCount > MAX_OSI_LINKS) { VN_RELE(vp); VN_RELE(nextVp); - afs_osi_Free(tmpPath, strlen(path)+1); + afs_osi_Free(tmpPath, strlen(path) + 1); return code; } code = uafs_LookupLink(nextVp, vp, &linkVp); if (code) { VN_RELE(vp); VN_RELE(nextVp); - afs_osi_Free(tmpPath, strlen(path)+1); + afs_osi_Free(tmpPath, strlen(path) + 1); return code; } VN_RELE(nextVp); @@ -2311,11 +2329,11 @@ int uafs_LookupName( */ if (nextPathP != NULL && vp->v_type != VDIR) { VN_RELE(vp); - afs_osi_Free(tmpPath, strlen(path)+1); + afs_osi_Free(tmpPath, strlen(path) + 1); return ENOTDIR; } - afs_osi_Free(tmpPath, strlen(path)+1); + afs_osi_Free(tmpPath, strlen(path) + 1); *vpp = vp; return 0; } @@ -2327,10 +2345,9 @@ int uafs_LookupName( * * Note: Caller must hold the AFS global lock. */ -int uafs_LookupLink( - struct usr_vnode *vp, - struct usr_vnode *parentVp, - struct usr_vnode **vpp) +int +uafs_LookupLink(struct usr_vnode *vp, struct usr_vnode *parentVp, + struct usr_vnode **vpp) { int code; int len; @@ -2341,27 +2358,27 @@ int uafs_LookupLink( AFS_ASSERT_GLOCK(); - pathP = afs_osi_Alloc(MAX_OSI_PATH+1); + pathP = afs_osi_Alloc(MAX_OSI_PATH + 1); usr_assert(pathP != NULL); /* * set up the uio buffer */ iov[0].iov_base = pathP; - iov[0].iov_len = MAX_OSI_PATH+1; + iov[0].iov_len = MAX_OSI_PATH + 1; uio.uio_iov = &iov[0]; uio.uio_iovcnt = 1; uio.uio_offset = 0; uio.uio_segflg = 0; uio.uio_fmode = FREAD; - uio.uio_resid = MAX_OSI_PATH+1; + uio.uio_resid = MAX_OSI_PATH + 1; /* * Read the link data */ code = afs_readlink(vp, &uio, u.u_cred); if (code) { - afs_osi_Free(pathP, MAX_OSI_PATH+1); + afs_osi_Free(pathP, MAX_OSI_PATH + 1); return code; } len = MAX_OSI_PATH + 1 - uio.uio_resid; @@ -2372,11 +2389,11 @@ int uafs_LookupLink( */ code = uafs_LookupName(pathP, parentVp, &linkVp, 1, 0); if (code) { - afs_osi_Free(pathP, MAX_OSI_PATH+1); + afs_osi_Free(pathP, MAX_OSI_PATH + 1); return code; } - afs_osi_Free(pathP, MAX_OSI_PATH+1); + afs_osi_Free(pathP, MAX_OSI_PATH + 1); *vpp = linkVp; return 0; } @@ -2388,9 +2405,8 @@ int uafs_LookupLink( * * Note: Caller must hold the AFS global lock. */ -int uafs_LookupParent( - char *path, - struct usr_vnode **vpp) +int +uafs_LookupParent(char *path, struct usr_vnode **vpp) { int len; int code; @@ -2413,13 +2429,13 @@ int uafs_LookupParent( * Find the length of the parent path */ len = strlen(path); - while(len > 0 && path[len-1] == '/') { + while (len > 0 && path[len - 1] == '/') { len--; } if (len == 0) { return EINVAL; } - while(len > 0 && path[len-1] != '/') { + while (len > 0 && path[len - 1] != '/') { len--; } if (len == 0) { @@ -2428,8 +2444,8 @@ int uafs_LookupParent( pathP = afs_osi_Alloc(len); usr_assert(pathP != NULL); - memcpy(pathP, path, len-1); - pathP[len-1] = '\0'; + memcpy(pathP, path, len - 1); + pathP[len - 1] = '\0'; /* * look up the parent @@ -2452,15 +2468,16 @@ int uafs_LookupParent( * Return a pointer to the first character in the last component * of a pathname */ -char *uafs_LastPath(char *path) +char * +uafs_LastPath(char *path) { int len; len = strlen(path); - while (len > 0 && path[len-1] == '/') { + while (len > 0 && path[len - 1] == '/') { len--; } - while (len > 0 && path[len-1] != '/') { + while (len > 0 && path[len - 1] != '/') { len--; } if (len == 0) { @@ -2472,8 +2489,8 @@ char *uafs_LastPath(char *path) /* * Set the working directory. */ -int uafs_chdir( - char *path) +int +uafs_chdir(char *path) { int retval; AFS_GLOCK(); @@ -2482,8 +2499,8 @@ int uafs_chdir( return retval; } -int uafs_chdir_r( - char *path) +int +uafs_chdir_r(char *path) { int code; struct vnode *dirP; @@ -2506,9 +2523,8 @@ int uafs_chdir_r( /* * Create a directory. */ -int uafs_mkdir( - char *path, - int mode) +int +uafs_mkdir(char *path, int mode) { int retval; AFS_GLOCK(); @@ -2517,9 +2533,8 @@ int uafs_mkdir( return retval; } -int uafs_mkdir_r( - char *path, - int mode) +int +uafs_mkdir_r(char *path, int mode) { int code; char *nameP; @@ -2578,9 +2593,10 @@ int uafs_mkdir_r( /* * Return 1 if path is the AFS root, otherwise return 0 */ -int uafs_IsRoot(char *path) +int +uafs_IsRoot(char *path) { - while(*path == '/' && *(path+1) == '/') { + while (*path == '/' && *(path + 1) == '/') { path++; } if (strncmp(path, afs_mountDir, afs_mountDirLen) != 0) { @@ -2600,10 +2616,8 @@ int uafs_IsRoot(char *path) * Open a file * Note: file name may not end in a slash. */ -int uafs_open( - char *path, - int flags, - int mode) +int +uafs_open(char *path, int flags, int mode) { int retval; AFS_GLOCK(); @@ -2612,10 +2626,8 @@ int uafs_open( return retval; } -int uafs_open_r( - char *path, - int flags, - int mode) +int +uafs_open_r(char *path, int flags, int mode) { int fd; int code; @@ -2668,13 +2680,14 @@ int uafs_open_r( attrs.va_size = 0; } fileP = NULL; - code = afs_create(dirP, nameP, &attrs, - (flags & O_EXCL)?usr_EXCL:usr_NONEXCL, - mode, &fileP, u.u_cred); + code = + afs_create(dirP, nameP, &attrs, + (flags & O_EXCL) ? usr_EXCL : usr_NONEXCL, mode, + &fileP, u.u_cred); VN_RELE(dirP); if (code != 0) { - errno = code; - return -1; + errno = code; + return -1; } } else { fileP = NULL; @@ -2689,13 +2702,14 @@ int uafs_open_r( * Check whether we have access to this file */ fileMode = 0; - if (flags & (O_RDONLY|O_RDWR)) { + if (flags & (O_RDONLY | O_RDWR)) { fileMode |= VREAD; } - if (flags & (O_WRONLY|O_RDWR)) { + if (flags & (O_WRONLY | O_RDWR)) { fileMode |= VWRITE; } - if (!fileMode) fileMode = VREAD; /* since O_RDONLY is 0 */ + if (!fileMode) + fileMode = VREAD; /* since O_RDONLY is 0 */ code = afs_access(fileP, fileMode, u.u_cred); if (code != 0) { VN_RELE(fileP); @@ -2731,10 +2745,10 @@ int uafs_open_r( if (flags & O_SYNC) { openFlags |= FSYNC; } - if (flags & (O_RDONLY|O_RDWR)) { + if (flags & (O_RDONLY | O_RDWR)) { openFlags |= FREAD; } - if (flags & (O_WRONLY|O_RDWR)) { + if (flags & (O_WRONLY | O_RDWR)) { openFlags |= FWRITE; } @@ -2765,7 +2779,7 @@ int uafs_open_r( /* * Put the vnode pointer into the file table */ - for (fd = 0 ; fd < MAX_OSI_FILES ; fd++) { + for (fd = 0; fd < MAX_OSI_FILES; fd++) { if (afs_FileTable[fd] == NULL) { afs_FileTable[fd] = fileP; afs_FileFlags[fd] = openFlags; @@ -2789,31 +2803,27 @@ int uafs_open_r( /* * Create a file */ -int uafs_creat( - char *path, - int mode) +int +uafs_creat(char *path, int mode) { int rc; - rc = uafs_open(path, O_CREAT|O_WRONLY|O_TRUNC, mode); + rc = uafs_open(path, O_CREAT | O_WRONLY | O_TRUNC, mode); return rc; } -int uafs_creat_r( - char *path, - int mode) +int +uafs_creat_r(char *path, int mode) { int rc; - rc = uafs_open_r(path, O_CREAT|O_WRONLY|O_TRUNC, mode); + rc = uafs_open_r(path, O_CREAT | O_WRONLY | O_TRUNC, mode); return rc; } /* * Write to a file */ -int uafs_write( - int fd, - char *buf, - int len) +int +uafs_write(int fd, char *buf, int len) { int retval; AFS_GLOCK(); @@ -2822,10 +2832,8 @@ int uafs_write( return retval; } -int uafs_write_r( - int fd, - char *buf, - int len) +int +uafs_write_r(int fd, char *buf, int len) { int code; struct usr_uio uio; @@ -2864,16 +2872,14 @@ int uafs_write_r( } afs_FileOffsets[fd] = uio.uio_offset; - return(len - uio.uio_resid); + return (len - uio.uio_resid); } /* * Read from a file */ -int uafs_read( - int fd, - char *buf, - int len) +int +uafs_read(int fd, char *buf, int len) { int retval; AFS_GLOCK(); @@ -2882,10 +2888,8 @@ int uafs_read( return retval; } -int uafs_read_r( - int fd, - char *buf, - int len) +int +uafs_read_r(int fd, char *buf, int len) { int code; struct usr_uio uio; @@ -2924,7 +2928,7 @@ int uafs_read_r( } afs_FileOffsets[fd] = uio.uio_offset; - return(len - uio.uio_resid); + return (len - uio.uio_resid); } /* @@ -2932,9 +2936,8 @@ int uafs_read_r( * * NOTE: Caller must hold the global AFS lock. */ -int uafs_GetAttr( - struct usr_vnode *vp, - struct stat *stats) +int +uafs_GetAttr(struct usr_vnode *vp, struct stat *stats) { int code; struct usr_vattr attrs; @@ -2973,9 +2976,8 @@ int uafs_GetAttr( /* * Get the attributes of a file, do follow links */ -int uafs_stat( - char *path, - struct stat *buf) +int +uafs_stat(char *path, struct stat *buf) { int retval; AFS_GLOCK(); @@ -2984,9 +2986,8 @@ int uafs_stat( return retval; } -int uafs_stat_r( - char *path, - struct stat *buf) +int +uafs_stat_r(char *path, struct stat *buf) { int code; struct vnode *vp; @@ -3008,9 +3009,8 @@ int uafs_stat_r( /* * Get the attributes of a file, don't follow links */ -int uafs_lstat( - char *path, - struct stat *buf) +int +uafs_lstat(char *path, struct stat *buf) { int retval; AFS_GLOCK(); @@ -3019,9 +3019,8 @@ int uafs_lstat( return retval; } -int uafs_lstat_r( - char *path, - struct stat *buf) +int +uafs_lstat_r(char *path, struct stat *buf) { int code; struct vnode *vp; @@ -3043,9 +3042,8 @@ int uafs_lstat_r( /* * Get the attributes of an open file */ -int uafs_fstat( - int fd, - struct stat *buf) +int +uafs_fstat(int fd, struct stat *buf) { int retval; AFS_GLOCK(); @@ -3054,9 +3052,8 @@ int uafs_fstat( return retval; } -int uafs_fstat_r( - int fd, - struct stat *buf) +int +uafs_fstat_r(int fd, struct stat *buf) { int code; struct vnode *vp; @@ -3078,9 +3075,8 @@ int uafs_fstat_r( /* * change the permissions on a file */ -int uafs_chmod( - char *path, - int mode) +int +uafs_chmod(char *path, int mode) { int retval; AFS_GLOCK(); @@ -3089,9 +3085,8 @@ int uafs_chmod( return retval; } -int uafs_chmod_r( - char *path, - int mode) +int +uafs_chmod_r(char *path, int mode) { int code; struct vnode *vp; @@ -3116,9 +3111,8 @@ int uafs_chmod_r( /* * change the permissions on an open file */ -int uafs_fchmod( - int fd, - int mode) +int +uafs_fchmod(int fd, int mode) { int retval; AFS_GLOCK(); @@ -3127,9 +3121,8 @@ int uafs_fchmod( return retval; } -int uafs_fchmod_r( - int fd, - int mode) +int +uafs_fchmod_r(int fd, int mode) { int code; struct vnode *vp; @@ -3153,9 +3146,8 @@ int uafs_fchmod_r( /* * truncate a file */ -int uafs_truncate( - char *path, - int length) +int +uafs_truncate(char *path, int length) { int retval; AFS_GLOCK(); @@ -3164,9 +3156,8 @@ int uafs_truncate( return retval; } -int uafs_truncate_r( - char *path, - int length) +int +uafs_truncate_r(char *path, int length) { int code; struct vnode *vp; @@ -3191,9 +3182,8 @@ int uafs_truncate_r( /* * truncate an open file */ -int uafs_ftruncate( - int fd, - int length) +int +uafs_ftruncate(int fd, int length) { int retval; AFS_GLOCK(); @@ -3202,9 +3192,8 @@ int uafs_ftruncate( return retval; } -int uafs_ftruncate_r( - int fd, - int length) +int +uafs_ftruncate_r(int fd, int length) { int code; struct vnode *vp; @@ -3228,10 +3217,8 @@ int uafs_ftruncate_r( /* * set the read/write file pointer of an open file */ -int uafs_lseek( - int fd, - int offset, - int whence) +int +uafs_lseek(int fd, int offset, int whence) { int retval; AFS_GLOCK(); @@ -3240,10 +3227,8 @@ int uafs_lseek( return retval; } -int uafs_lseek_r( - int fd, - int offset, - int whence) +int +uafs_lseek_r(int fd, int offset, int whence) { int code; int newpos; @@ -3256,13 +3241,13 @@ int uafs_lseek_r( return -1; } switch (whence) { - case SEEK_CUR: + case SEEK_CUR: newpos = afs_FileOffsets[fd] + offset; break; - case SEEK_SET: + case SEEK_SET: newpos = offset; break; - case SEEK_END: + case SEEK_END: code = afs_getattr(vp, &attrs, u.u_cred); if (code != 0) { errno = code; @@ -3270,7 +3255,7 @@ int uafs_lseek_r( } newpos = attrs.va_size + offset; break; - default: + default: errno = EINVAL; return -1; } @@ -3285,8 +3270,8 @@ int uafs_lseek_r( /* * sync a file */ -int uafs_fsync( - int fd) +int +uafs_fsync(int fd) { int retval; AFS_GLOCK(); @@ -3295,8 +3280,8 @@ int uafs_fsync( return retval; } -int uafs_fsync_r( - int fd) +int +uafs_fsync_r(int fd) { int code; struct usr_vnode *fileP; @@ -3314,14 +3299,14 @@ int uafs_fsync_r( return -1; } - return 0; + return 0; } /* * Close a file */ -int uafs_close( - int fd) +int +uafs_close(int fd) { int retval; AFS_GLOCK(); @@ -3330,8 +3315,8 @@ int uafs_close( return retval; } -int uafs_close_r( - int fd) +int +uafs_close_r(int fd) { int code; struct usr_vnode *fileP; @@ -3350,16 +3335,15 @@ int uafs_close_r( return -1; } - return 0; + return 0; } /* * Create a hard link from the source to the target * Note: file names may not end in a slash. */ -int uafs_link( - char *existing, - char *new) +int +uafs_link(char *existing, char *new) { int retval; AFS_GLOCK(); @@ -3368,9 +3352,8 @@ int uafs_link( return retval; } -int uafs_link_r( - char *existing, - char *new) +int +uafs_link_r(char *existing, char *new) { int code; struct usr_vnode *existP; @@ -3434,9 +3417,8 @@ int uafs_link_r( * Create a symbolic link from the source to the target * Note: file names may not end in a slash. */ -int uafs_symlink( - char *target, - char *source) +int +uafs_symlink(char *target, char *source) { int retval; AFS_GLOCK(); @@ -3445,9 +3427,8 @@ int uafs_symlink( return retval; } -int uafs_symlink_r( - char *target, - char *source) +int +uafs_symlink_r(char *target, char *source) { int code; struct usr_vnode *dirP; @@ -3503,10 +3484,8 @@ int uafs_symlink_r( /* * Read a symbolic link into the buffer */ -int uafs_readlink( - char *path, - char *buf, - int len) +int +uafs_readlink(char *path, char *buf, int len) { int retval; AFS_GLOCK(); @@ -3515,10 +3494,8 @@ int uafs_readlink( return retval; } -int uafs_readlink_r( - char *path, - char *buf, - int len) +int +uafs_readlink_r(char *path, char *buf, int len) { int code; struct usr_vnode *vp; @@ -3555,7 +3532,7 @@ int uafs_readlink_r( code = afs_readlink(vp, &uio, u.u_cred); VN_RELE(vp); if (code) { - errno = code; + errno = code; return -1; } @@ -3569,8 +3546,8 @@ int uafs_readlink_r( * Remove a file (or directory) * Note: file name may not end in a slash. */ -int uafs_unlink( - char *path) +int +uafs_unlink(char *path) { int retval; AFS_GLOCK(); @@ -3579,8 +3556,8 @@ int uafs_unlink( return retval; } -int uafs_unlink_r( - char *path) +int +uafs_unlink_r(char *path) { int code; int openFlags; @@ -3633,9 +3610,8 @@ int uafs_unlink_r( /* * Rename a file (or directory) */ -int uafs_rename( - char *old, - char *new) +int +uafs_rename(char *old, char *new) { int retval; AFS_GLOCK(); @@ -3644,9 +3620,8 @@ int uafs_rename( return retval; } -int uafs_rename_r( - char *old, - char *new) +int +uafs_rename_r(char *old, char *new) { int code; char *onameP; @@ -3714,8 +3689,8 @@ int uafs_rename_r( * Remove a or directory * Note: file name may not end in a slash. */ -int uafs_rmdir( - char *path) +int +uafs_rmdir(char *path) { int retval; AFS_GLOCK(); @@ -3724,8 +3699,8 @@ int uafs_rmdir( return retval; } -int uafs_rmdir_r( - char *path) +int +uafs_rmdir_r(char *path) { int code; int openFlags; @@ -3778,8 +3753,8 @@ int uafs_rmdir_r( /* * Flush a file from the AFS cache */ -int uafs_FlushFile( - char *path) +int +uafs_FlushFile(char *path) { int code; struct afs_ioctl iob; @@ -3789,8 +3764,9 @@ int uafs_FlushFile( iob.out = NULL; iob.out_size = 0; - code = call_syscall(AFSCALL_PIOCTL, (long)path, _VICEIOCTL(6), - (long)&iob, 0, 0); + code = + call_syscall(AFSCALL_PIOCTL, (long)path, _VICEIOCTL(6), (long)&iob, 0, + 0); if (code != 0) { errno = code; return -1; @@ -3798,8 +3774,9 @@ int uafs_FlushFile( return 0; } -int uafs_FlushFile_r( - char *path) + +int +uafs_FlushFile_r(char *path) { int retval; AFS_GUNLOCK(); @@ -3811,8 +3788,8 @@ int uafs_FlushFile_r( /* * open a directory */ -usr_DIR *uafs_opendir( - char *path) +usr_DIR * +uafs_opendir(char *path) { usr_DIR *retval; AFS_GLOCK(); @@ -3821,8 +3798,8 @@ usr_DIR *uafs_opendir( return retval; } -usr_DIR *uafs_opendir_r( - char *path) +usr_DIR * +uafs_opendir_r(char *path) { usr_DIR *dirp; struct usr_vnode *fileP; @@ -3838,22 +3815,23 @@ usr_DIR *uafs_opendir_r( fileP = afs_FileTable[fd]; if (fileP == NULL) { - return NULL; + return NULL; } if (fileP->v_type != VDIR) { - uafs_close_r(fd); - errno = ENOTDIR; - return NULL; + uafs_close_r(fd); + errno = ENOTDIR; + return NULL; } /* * Set up the directory structures */ - dirp = (usr_DIR *)afs_osi_Alloc(sizeof(usr_DIR) + USR_DIRSIZE + - sizeof(struct usr_dirent)); + dirp = + (usr_DIR *) afs_osi_Alloc(sizeof(usr_DIR) + USR_DIRSIZE + + sizeof(struct usr_dirent)); usr_assert(dirp != NULL); - dirp->dd_buf = (char *)(dirp+1); + dirp->dd_buf = (char *)(dirp + 1); dirp->dd_fd = fd; dirp->dd_loc = 0; dirp->dd_size = 0; @@ -3867,10 +3845,8 @@ usr_DIR *uafs_opendir_r( * This routine was developed to support AFS cache consistency testing. * You should use uafs_readdir instead. */ -int uafs_getdents( - int fd, - struct min_direct *buf, - int len) +int +uafs_getdents(int fd, struct min_direct *buf, int len) { int retval; AFS_GLOCK(); @@ -3879,10 +3855,8 @@ int uafs_getdents( return retval; } -int uafs_getdents_r( - int fd, - struct min_direct *buf, - int len) +int +uafs_getdents_r(int fd, struct min_direct *buf, int len) { int code; struct usr_uio uio; @@ -3921,14 +3895,14 @@ int uafs_getdents_r( } afs_FileOffsets[fd] = uio.uio_offset; - return(len - uio.uio_resid); + return (len - uio.uio_resid); } /* * read from a directory (names only) */ -struct usr_dirent *uafs_readdir( - usr_DIR *dirp) +struct usr_dirent * +uafs_readdir(usr_DIR * dirp) { struct usr_dirent *retval; AFS_GLOCK(); @@ -3937,8 +3911,8 @@ struct usr_dirent *uafs_readdir( return retval; } -struct usr_dirent *uafs_readdir_r( - usr_DIR *dirp) +struct usr_dirent * +uafs_readdir_r(usr_DIR * dirp) { int rc; int code; @@ -3962,7 +3936,7 @@ struct usr_dirent *uafs_readdir_r( * If there are no entries in the stream buffer * then read another chunk */ - directP = (struct min_direct *)(dirp->dd_buf+dirp->dd_loc); + directP = (struct min_direct *)(dirp->dd_buf + dirp->dd_loc); if (dirp->dd_size == 0 || directP->d_fileno == 0) { /* * set up the uio buffer @@ -3988,7 +3962,7 @@ struct usr_dirent *uafs_readdir_r( dirp->dd_size = USR_DIRSIZE - iov[0].iov_len; dirp->dd_loc = 0; - directP = (struct min_direct *)(dirp->dd_buf+dirp->dd_loc); + directP = (struct min_direct *)(dirp->dd_buf + dirp->dd_loc); } /* @@ -3998,18 +3972,18 @@ struct usr_dirent *uafs_readdir_r( errno = 0; return NULL; } - len = ((sizeof(struct min_direct)+directP->d_namlen+4) & (~3)); + len = ((sizeof(struct min_direct) + directP->d_namlen + 4) & (~3)); usr_assert(len <= dirp->dd_size); /* * Copy the next entry into the usr_dirent structure and advance */ - direntP = (struct usr_dirent *)(dirp->dd_buf+USR_DIRSIZE); + direntP = (struct usr_dirent *)(dirp->dd_buf + USR_DIRSIZE); direntP->d_ino = directP->d_fileno; direntP->d_off = direntP->d_reclen; - direntP->d_reclen = sizeof(struct usr_dirent) - MAXNAMLEN + - directP->d_namlen + 1; - memcpy(&direntP->d_name[0], (void *)(directP+1), directP->d_namlen); + direntP->d_reclen = + sizeof(struct usr_dirent) - MAXNAMLEN + directP->d_namlen + 1; + memcpy(&direntP->d_name[0], (void *)(directP + 1), directP->d_namlen); direntP->d_name[directP->d_namlen] = '\0'; dirp->dd_loc += len; dirp->dd_size -= len; @@ -4020,8 +3994,8 @@ struct usr_dirent *uafs_readdir_r( /* * Close a directory */ -int uafs_closedir( - usr_DIR *dirp) +int +uafs_closedir(usr_DIR * dirp) { int retval; AFS_GLOCK(); @@ -4030,8 +4004,8 @@ int uafs_closedir( return retval; } -int uafs_closedir_r( - usr_DIR *dirp) +int +uafs_closedir_r(usr_DIR * dirp) { int fd; int rc; @@ -4046,29 +4020,23 @@ int uafs_closedir_r( /* * Do AFS authentication */ -int uafs_klog( - char *user, - char *cell, - char *passwd, - char **reason) +int +uafs_klog(char *user, char *cell, char *passwd, char **reason) { int code; afs_int32 password_expires = -1; usr_mutex_lock(&osi_authenticate_lock); - code = ka_UserAuthenticateGeneral( - KA_USERAUTH_VERSION+KA_USERAUTH_DOSETPAG2, user, - NULL, cell, passwd, 0, &password_expires, - 0, reason); + code = + ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION + + KA_USERAUTH_DOSETPAG2, user, NULL, cell, + passwd, 0, &password_expires, 0, reason); usr_mutex_unlock(&osi_authenticate_lock); return code; } -int uafs_klog_r( - char *user, - char *cell, - char *passwd, - char **reason) +int +uafs_klog_r(char *user, char *cell, char *passwd, char **reason) { int retval; AFS_GUNLOCK(); @@ -4080,7 +4048,8 @@ int uafs_klog_r( /* * Destroy AFS credentials from the kernel cache */ -int uafs_unlog() +int +uafs_unlog(void) { int code; @@ -4090,7 +4059,8 @@ int uafs_unlog() return code; } -int uafs_unlog_r() +int +uafs_unlog_r(void) { int retval; AFS_GUNLOCK(); @@ -4104,7 +4074,8 @@ int uafs_unlog_r() * NULL if the path is a relative pathname or if the path * doesn't start with the AFS mount point string. */ -char *uafs_afsPathName(char *path) +char * +uafs_afsPathName(char *path) { char *p; char lastchar; @@ -4113,7 +4084,7 @@ char *uafs_afsPathName(char *path) if (path[0] != '/') return NULL; lastchar = '/'; - for (i = 1, p = path+1; *p != '\0' ; p++) { + for (i = 1, p = path + 1; *p != '\0'; p++) { /* Ignore duplicate slashes */ if (*p == '/' && lastchar == '/') continue; @@ -4142,20 +4113,17 @@ char *uafs_afsPathName(char *path) * uafs_klog_nopag * klog but don't allocate a new pag */ -int uafs_klog_nopag( - char *user, - char *cell, - char *passwd, - char **reason) +int +uafs_klog_nopag(char *user, char *cell, char *passwd, char **reason) { int code; afs_int32 password_expires = -1; usr_mutex_lock(&osi_authenticate_lock); - code = ka_UserAuthenticateGeneral( - KA_USERAUTH_VERSION /*+KA_USERAUTH_DOSETPAG2*/, user, - NULL, cell, passwd, 0, &password_expires, - 0, reason); + code = ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION + /*+KA_USERAUTH_DOSETPAG2 */ , user, + NULL, cell, passwd, 0, + &password_expires, 0, reason); usr_mutex_unlock(&osi_authenticate_lock); return code; } @@ -4164,88 +4132,91 @@ int uafs_klog_nopag( * uafs_getcellstatus * get the cell status */ -int uafs_getcellstatus(char *cell, afs_int32 *status) +int +uafs_getcellstatus(char *cell, afs_int32 * status) { - int rc; - struct afs_ioctl iob; + int rc; + struct afs_ioctl iob; - iob.in = cell; - iob.in_size = strlen(cell)+1; - iob.out = 0; - iob.out_size = 0; + iob.in = cell; + iob.in_size = strlen(cell) + 1; + iob.out = 0; + iob.out_size = 0; - rc = call_syscall(AFSCALL_PIOCTL, /*path*/0, _VICEIOCTL(35), - (long)&iob, 0, 0); + rc = call_syscall(AFSCALL_PIOCTL, /*path */ 0, _VICEIOCTL(35), + (long)&iob, 0, 0); - if (rc < 0) { - errno = rc; - return -1; - } + if (rc < 0) { + errno = rc; + return -1; + } - *status = iob.out; - return 0; + *status = (afs_int32) iob.out; + return 0; } /* * uafs_getvolquota * Get quota of volume associated with path */ -int uafs_getvolquota(char *path, afs_int32 *BlocksInUse, afs_int32 *MaxQuota) +int +uafs_getvolquota(char *path, afs_int32 * BlocksInUse, afs_int32 * MaxQuota) { - int rc; - struct afs_ioctl iob; - VolumeStatus *status; - char buf[1024]; + int rc; + struct afs_ioctl iob; + VolumeStatus *status; + char buf[1024]; - iob.in = 0; - iob.in_size = 0; - iob.out = buf; - iob.out_size = 1024; + iob.in = 0; + iob.in_size = 0; + iob.out = buf; + iob.out_size = 1024; - rc = call_syscall(AFSCALL_PIOCTL, path, _VICEIOCTL(4), - (long)&iob, 0, 0); + rc = call_syscall(AFSCALL_PIOCTL, (long)path, _VICEIOCTL(4), (long)&iob, + 0, 0); - if (rc != 0) { - errno = rc; - return -1; - } + if (rc != 0) { + errno = rc; + return -1; + } - status = (VolumeStatus *) buf; - *BlocksInUse = status->BlocksInUse; - *MaxQuota = status->MaxQuota; - return 0; + status = (VolumeStatus *) buf; + *BlocksInUse = status->BlocksInUse; + *MaxQuota = status->MaxQuota; + return 0; } /* * uafs_setvolquota * Set quota of volume associated with path */ -int uafs_setvolquota(char *path, afs_int32 MaxQuota) +int +uafs_setvolquota(char *path, afs_int32 MaxQuota) { - int rc; - struct afs_ioctl iob; - VolumeStatus *status; - char buf[1024]; + int rc; + struct afs_ioctl iob; + VolumeStatus *status; + char buf[1024]; - iob.in = buf; - iob.in_size = 1024; - iob.out = 0; - iob.out_size = 0; + iob.in = buf; + iob.in_size = 1024; + iob.out = 0; + iob.out_size = 0; - memset(buf, 0, sizeof(VolumeStatus)); - status = (VolumeStatus *) buf; - status->MaxQuota = MaxQuota; - status->MinQuota = -1; + memset(buf, 0, sizeof(VolumeStatus)); + status = (VolumeStatus *) buf; + status->MaxQuota = MaxQuota; + status->MinQuota = -1; - rc = call_syscall(AFSCALL_PIOCTL, path, _VICEIOCTL(5), - (long)&iob, 0, 0); + rc = call_syscall(AFSCALL_PIOCTL, (long)path, _VICEIOCTL(5), (long)&iob, + 0, 0); - if (rc != 0) { - errno = rc; - return -1; - } + if (rc != 0) { + errno = rc; + return -1; + } - return 0; + return 0; } /* @@ -4253,7 +4224,8 @@ int uafs_setvolquota(char *path, afs_int32 MaxQuota) * Determine whether a dir. is a mount point or not * return 1 if mount point, 0 if not */ -int uafs_statmountpoint(char *path) +int +uafs_statmountpoint(char *path) { int retval; int code; @@ -4265,7 +4237,8 @@ int uafs_statmountpoint(char *path) return retval; } -int uafs_statmountpoint_r(char *path) +int +uafs_statmountpoint_r(char *path) { int code; struct vnode *vp; @@ -4275,8 +4248,8 @@ int uafs_statmountpoint_r(char *path) code = uafs_LookupName(path, afs_CurrentDir, &vp, 0, 1); if (code != 0) { - errno = code; - return -1; + errno = code; + return -1; } avc = VTOAFS(vp); @@ -4290,7 +4263,8 @@ int uafs_statmountpoint_r(char *path) * uafs_getRights * Get a list of rights for the current user on path. */ -int uafs_getRights(char *path) +int +uafs_getRights(char *path) { int code, rc; struct vnode *vp; @@ -4299,20 +4273,16 @@ int uafs_getRights(char *path) AFS_GLOCK(); code = uafs_LookupName(path, afs_CurrentDir, &vp, 1, 0); if (code != 0) { - errno = code; - AFS_GUNLOCK(); - return -1; + errno = code; + AFS_GUNLOCK(); + return -1; } - afs_rights = PRSFS_READ | - PRSFS_WRITE | - PRSFS_INSERT | - PRSFS_LOOKUP | - PRSFS_DELETE | - PRSFS_LOCK | - PRSFS_ADMINISTER; + afs_rights = + PRSFS_READ | PRSFS_WRITE | PRSFS_INSERT | PRSFS_LOOKUP | PRSFS_DELETE + | PRSFS_LOCK | PRSFS_ADMINISTER; - afs_rights = afs_getRights (vp, afs_rights, u.u_cred); + afs_rights = afs_getRights(vp, afs_rights, u.u_cred); AFS_GUNLOCK(); return afs_rights; diff --git a/src/afs/UKERNEL/afs_usrops.h b/src/afs/UKERNEL/afs_usrops.h index 0ef5fe6e4..a806e5a09 100644 --- a/src/afs/UKERNEL/afs_usrops.h +++ b/src/afs/UKERNEL/afs_usrops.h @@ -68,14 +68,14 @@ extern int afs_mountDirLen; extern void uafs_InitClient(void); extern void uafs_InitThread(void); -extern void uafs_Init(char *, char *, char *, char *, int, int, int, int, - int, int, int, int, int, int, char *); +extern void uafs_Init(char *, char *, char *, char *, int, int, int, int, int, + int, int, int, int, int, char *); extern void uafs_RxServerProc(void); extern int uafs_LookupLink(struct usr_vnode *vp, struct usr_vnode *parentP, struct usr_vnode **vpp); extern int uafs_LookupName(char *path, struct usr_vnode *parentP, struct usr_vnode **vpp, int follow, - int no_eval_mtpt); + int no_eval_mtpt); extern int uafs_LookupParent(char *path, struct usr_vnode **vpp); extern int uafs_GetAttr(struct usr_vnode *vp, struct stat *stats); @@ -107,6 +107,8 @@ extern int uafs_truncate(char *path, int len); extern int uafs_truncate_r(char *path, int len); extern int uafs_ftruncate(int fd, int len); extern int uafs_ftruncate_r(int fd, int len); +extern int uafs_lseek(int fd, int offset, int whence); +extern int uafs_lseek_r(int fd, int offset, int whence); extern int uafs_chmod(char *path, int mode); extern int uafs_chmod_r(char *path, int mode); extern int uafs_fchmod(int fd, int mode); @@ -127,16 +129,16 @@ extern int uafs_FlushFile(char *path); extern int uafs_FlushFile_r(char *path); extern usr_DIR *uafs_opendir(char *path); extern usr_DIR *uafs_opendir_r(char *path); -extern struct usr_dirent *uafs_readdir(usr_DIR *dirp); -extern struct usr_dirent *uafs_readdir_r(usr_DIR *dirp); +extern struct usr_dirent *uafs_readdir(usr_DIR * dirp); +extern struct usr_dirent *uafs_readdir_r(usr_DIR * dirp); extern int uafs_getdents(int fd, struct min_direct *buf, int len); extern int uafs_getdents_r(int fd, struct min_direct *buf, int len); -extern int uafs_closedir(usr_DIR *dirp); -extern int uafs_closedir_r(usr_DIR *dirp); +extern int uafs_closedir(usr_DIR * dirp); +extern int uafs_closedir_r(usr_DIR * dirp); extern void uafs_ThisCell(char *namep); extern void uafs_ThisCell_r(char *namep); -extern int uafs_klog(char *user,char *cell,char *passwd,char **reason); -extern int uafs_klog_r(char *user,char *cell,char *passwd,char **reason); +extern int uafs_klog(char *user, char *cell, char *passwd, char **reason); +extern int uafs_klog_r(char *user, char *cell, char *passwd, char **reason); extern int uafs_unlog(void); extern int uafs_unlog_r(void); extern void uafs_SetRxPort(int); diff --git a/src/afs/UKERNEL/afsincludes.h b/src/afs/UKERNEL/afsincludes.h index d14af1567..049475d21 100644 --- a/src/afs/UKERNEL/afsincludes.h +++ b/src/afs/UKERNEL/afsincludes.h @@ -8,20 +8,21 @@ */ /* AFS based headers */ -#include "../afs/stds.h" -#include "../afs/afs_osi.h" -#include "../rx/rx.h" -#include "../afs/lock.h" -#include "../afs/volerrors.h" -#include "../afs/voldefs.h" -#include "../afsint/afsint.h" -#include "../afs/exporter.h" -#include "../afsint/vldbint.h" -#include "../afs/afs.h" -#include "../afs/afs_chunkops.h" -#include "../afs/rxkad.h" -#include "../afs/prs_fs.h" -#include "../afs/dir.h" -#include "../afs/afs_axscache.h" -#include "../afs/icl.h" -#include "../afs/afs_prototypes.h" +#include "afs/stds.h" +#include "rx/rx.h" +#include "afs/afs_osi.h" +#include "afs/lock.h" +#include "afs/volerrors.h" +#include "afs/voldefs.h" +#include "afsint.h" +#include "afs/exporter.h" +#include "vldbint.h" +#include "afs/afs.h" +#include "afs/afs_chunkops.h" +#include "rx/rxkad.h" +#include "afs/prs_fs.h" +#include "afs/dir.h" +#include "afs/afs_axscache.h" +#include "afs/icl.h" +#include "afs/afs_stats.h" +#include "afs/afs_prototypes.h" diff --git a/src/afs/UKERNEL/osi_groups.c b/src/afs/UKERNEL/osi_groups.c index 8ea5a4c38..5a485920f 100644 --- a/src/afs/UKERNEL/osi_groups.c +++ b/src/afs/UKERNEL/osi_groups.c @@ -12,24 +12,24 @@ * setpag (aliased to use_setpag in sysincludes.h) */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/UKERNEL/osi_groups.c,v 1.1.1.4 2001/07/14 22:19:52 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/UKERNEL/osi_groups.c,v 1.7 2003/07/15 23:14:28 shadow Exp $"); -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/afs_stats.h" /* statistics */ -int afs_xsetgroups() +int +afs_xsetgroups() { usr_assert(0); } static int -afs_getgroups( - struct AFS_UCRED *cred, - gid_t *gidset) +afs_getgroups(struct AFS_UCRED *cred, gid_t * gidset) { int ngrps, savengrps; gid_t *gp; @@ -40,18 +40,15 @@ afs_getgroups( savengrps = ngrps = cred->cr_ngroups; gp = cred->cr_groups; while (ngrps--) - *gidset++ = *gp++; + *gidset++ = *gp++; return savengrps; } static int -afs_setgroups( - struct AFS_UCRED **cred, - int ngroups, - gid_t *gidset, - int change_parent) +afs_setgroups(struct AFS_UCRED **cred, int ngroups, gid_t * gidset, + int change_parent) { int ngrps; int i; @@ -70,11 +67,9 @@ afs_setgroups( return (0); } -int usr_setpag( - struct usr_ucred **cred, - afs_uint32 pagvalue, - afs_uint32 *newpag, - int change_parent) +int +usr_setpag(struct usr_ucred **cred, afs_uint32 pagvalue, afs_uint32 * newpag, + int change_parent) { gid_t *gidset; int ngroups, code; @@ -87,18 +82,18 @@ int usr_setpag( if (afs_get_pag_from_groups(gidset[0], gidset[1]) == NOPAG) { /* We will have to shift grouplist to make room for pag */ - if ((sizeof gidset[0])*(ngroups + 2) > AFS_SMALLOCSIZ) { + if ((sizeof gidset[0]) * (ngroups + 2) > AFS_SMALLOCSIZ) { osi_FreeSmallSpace((char *)gidset); return (E2BIG); } - for (j = ngroups -1; j >= 0; j--) { - gidset[j+2] = gidset[j]; - } + for (j = ngroups - 1; j >= 0; j--) { + gidset[j + 2] = gidset[j]; + } ngroups += 2; } - *newpag = (pagvalue == -1 ? genpag(): pagvalue); + *newpag = (pagvalue == -1 ? genpag() : pagvalue); afs_get_groups_from_pag(*newpag, &gidset[0], &gidset[1]); - if (code = afs_setgroups(cred, ngroups, gidset, change_parent)) { + if ((code = afs_setgroups(cred, ngroups, gidset, change_parent))) { osi_FreeSmallSpace((char *)gidset); return (code); } diff --git a/src/afs/UKERNEL/osi_machdep.h b/src/afs/UKERNEL/osi_machdep.h index e6d95950d..be85d6f61 100644 --- a/src/afs/UKERNEL/osi_machdep.h +++ b/src/afs/UKERNEL/osi_machdep.h @@ -18,12 +18,12 @@ #ifndef _OSI_MACHDEP_H_ #define _OSI_MACHDEP_H_ -#include "../afs/sysincludes.h" +#include "afs/sysincludes.h" #define MAX_OSI_PATH 1024 #define MAX_OSI_FILES 1024 #define MAX_OSI_LINKS 25 -#define OSI_WAITHASH_SIZE 128 /* must be power of two */ +#define OSI_WAITHASH_SIZE 128 /* must be power of two */ #define MAX_HOSTADDR 32 #define AFS_UCRED usr_ucred @@ -65,4 +65,3 @@ extern usr_mutex_t afs_global_lock; extern int afs_bufferpages; #endif /* _OSI_MACHDEP_H_ */ - diff --git a/src/afs/UKERNEL/osi_vfsops.c b/src/afs/UKERNEL/osi_vfsops.c index dcc39bd07..b0c26711b 100644 --- a/src/afs/UKERNEL/osi_vfsops.c +++ b/src/afs/UKERNEL/osi_vfsops.c @@ -8,13 +8,14 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/UKERNEL/osi_vfsops.c,v 1.1.1.6 2002/05/10 23:44:18 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/UKERNEL/osi_vfsops.c,v 1.10 2003/07/15 23:14:29 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics stuff */ int afs_mount(); @@ -36,52 +37,58 @@ struct vcache *afs_globalVp = 0; int afs_rootCellIndex = 0; #if !defined(AFS_USR_AIX_ENV) -#include "../sys/syscall.h" +#include "sys/syscall.h" #endif afs_mount(afsp, path, data) - char *path; - caddr_t data; - struct vfs *afsp; + char *path; + caddr_t data; + struct vfs *afsp; { AFS_STATCNT(afs_mount); if (afs_globalVFS) { /* Don't allow remounts since some system (like AIX) don't handle it well */ - return (setuerror(EBUSY)); + return (setuerror(EBUSY)); } afs_globalVFS = afsp; afsp->vfs_bsize = 8192; - afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */ - afsp->vfs_fsid.val[1] = (afs_int32) AFS_VFSFSID; + afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */ + afsp->vfs_fsid.val[1] = (afs_int32) AFS_VFSFSID; return 0; } -afs_unmount (afsp) - struct vfs *afsp; { +afs_unmount(afsp) + struct vfs *afsp; +{ AFS_STATCNT(afs_unmount); afs_globalVFS = 0; afs_shutdown(); return 0; } -afs_root (OSI_VFS_ARG(afsp), avpp) +afs_root(OSI_VFS_ARG(afsp), avpp) OSI_VFS_DECL(afsp); - struct vnode **avpp; { + struct vnode **avpp; +{ register afs_int32 code = 0; struct vrequest treq; - register struct vcache *tvp=0; + register struct vcache *tvp = 0; OSI_VFS_CONVERT(afsp) - AFS_STATCNT(afs_root); + AFS_STATCNT(afs_root); if (afs_globalVp && (afs_globalVp->states & CStatd)) { tvp = afs_globalVp; } else { - if (!(code = afs_InitReq(&treq, u.u_cred)) && - !(code = afs_CheckInit())) { - tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); + if (afs_globalVp) { + afs_PutVCache(afs_globalVp); + afs_globalVp = NULL; + } + + if (!(code = afs_InitReq(&treq, u.u_cred)) + && !(code = afs_CheckInit())) { + tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL); /* we really want this to stay around */ if (tvp) { afs_globalVp = tvp; @@ -92,7 +99,7 @@ afs_root (OSI_VFS_ARG(afsp), avpp) if (tvp) { VN_HOLD(AFSTOV(tvp)); - AFSTOV(tvp)->v_flag |= VROOT; /* No-op on Ultrix 2.2 */ + AFSTOV(tvp)->v_flag |= VROOT; /* No-op on Ultrix 2.2 */ afs_globalVFS = afsp; *avpp = AFSTOV(tvp); } @@ -103,32 +110,32 @@ afs_root (OSI_VFS_ARG(afsp), avpp) } afs_sync(afsp) - struct vfs *afsp; + struct vfs *afsp; { AFS_STATCNT(afs_sync); return 0; } afs_statfs(afsp, abp) - register struct vfs *afsp; - struct statfs *abp; - { - AFS_STATCNT(afs_statfs); - abp->f_type = 0; - abp->f_bsize = afsp->vfs_bsize; - abp->f_fsid.val[0] = AFS_VFSMAGIC; /* magic */ - abp->f_fsid.val[1] = (afs_int32) AFS_VFSFSID; - return 0; + register struct vfs *afsp; + struct statfs *abp; +{ + AFS_STATCNT(afs_statfs); + abp->f_type = 0; + abp->f_bsize = afsp->vfs_bsize; + abp->f_fsid.val[0] = AFS_VFSMAGIC; /* magic */ + abp->f_fsid.val[1] = (afs_int32) AFS_VFSFSID; + return 0; } afs_mountroot() { AFS_STATCNT(afs_mountroot); - return(EINVAL); + return (EINVAL); } -afs_swapvp() +afs_swapvp() { AFS_STATCNT(afs_swapvp); - return(EINVAL); + return (EINVAL); } diff --git a/src/afs/UKERNEL/osi_vm.c b/src/afs/UKERNEL/osi_vm.c index 13624bad8..df5eca986 100644 --- a/src/afs/UKERNEL/osi_vm.c +++ b/src/afs/UKERNEL/osi_vm.c @@ -8,46 +8,41 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/UKERNEL/osi_vm.c,v 1.1.1.4 2001/07/14 22:19:52 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/UKERNEL/osi_vm.c,v 1.7 2003/07/15 23:14:29 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ -void osi_VM_Truncate(avc, alen, acred) - struct vcache *avc; - int alen; - struct AFS_UCRED *acred; +void +osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) { return; } -int osi_VM_FlushVCache(avc, slept) - struct vcache *avc; - int *slept; +int +osi_VM_FlushVCache(struct vcache *avc, int *slept) { return 0; } -void osi_VM_StoreAllSegments(avc) - struct vcache *avc; +void +osi_VM_StoreAllSegments(struct vcache *avc) { return; } -void osi_VM_TryToSmush(avc, acred, sync) - struct vcache *avc; - struct AFS_UCRED *acred; - int sync; +void +osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync) { return; } -void osi_VM_FlushPages(avc, credp) - struct vcache *avc; - struct AFS_UCRED *credp; +void +osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) { return; } diff --git a/src/afs/UKERNEL/osi_vnodeops.c b/src/afs/UKERNEL/osi_vnodeops.c index fc0a1e537..875098a9f 100644 --- a/src/afs/UKERNEL/osi_vnodeops.c +++ b/src/afs/UKERNEL/osi_vnodeops.c @@ -8,13 +8,14 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/UKERNEL/osi_vnodeops.c,v 1.1.1.5 2002/05/10 23:44:19 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/UKERNEL/osi_vnodeops.c,v 1.7 2003/07/15 23:14:29 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ extern int afs_noop(); extern int afs_badop(); @@ -38,12 +39,9 @@ extern int afs_fsync(); extern int afs_lockctl(); extern int afs_fid(); -int afs_vrdwr( - struct usr_vnode *avc, - struct usr_uio *uio, - int rw, - int io, - struct usr_ucred* cred) +int +afs_vrdwr(struct usr_vnode *avc, struct usr_uio *uio, int rw, int io, + struct usr_ucred *cred) { int rc; @@ -56,42 +54,44 @@ int afs_vrdwr( return rc; } -int afs_inactive(struct vcache *avc, struct AFS_UCRED *acred) +int +afs_inactive(struct vcache *avc, struct AFS_UCRED *acred) { struct vnode *vp = AFSTOV(avc); - if (afs_shuttingdown) return ; + if (afs_shuttingdown) + return; usr_assert(avc->vrefCount == 0); afs_InactiveVCache(avc, acred); } struct usr_vnodeops Afs_vnodeops = { - afs_open, - afs_close, - afs_vrdwr, - afs_badop, /* ioctl */ - afs_noop, /* select */ - afs_getattr, - afs_setattr, - afs_access, - afs_lookup, - afs_create, - afs_remove, - afs_link, - afs_rename, - afs_mkdir, - afs_rmdir, - afs_readdir, - afs_symlink, - afs_readlink, - afs_fsync, - afs_inactive, - afs_badop, /* bmap */ - afs_badop, /* strategy */ - afs_badop, /* bread */ - afs_badop, /* brelse */ - afs_lockctl, - afs_fid + afs_open, + afs_close, + afs_vrdwr, + afs_badop, /* ioctl */ + afs_noop, /* select */ + afs_getattr, + afs_setattr, + afs_access, + afs_lookup, + afs_create, + afs_remove, + afs_link, + afs_rename, + afs_mkdir, + afs_rmdir, + afs_readdir, + afs_symlink, + afs_readlink, + afs_fsync, + afs_inactive, + afs_badop, /* bmap */ + afs_badop, /* strategy */ + afs_badop, /* bread */ + afs_badop, /* brelse */ + afs_lockctl, + afs_fid }; struct usr_vnodeops *afs_ops = &Afs_vnodeops; diff --git a/src/afs/UKERNEL/sysincludes.h b/src/afs/UKERNEL/sysincludes.h index 73db66ab7..54f078beb 100644 --- a/src/afs/UKERNEL/sysincludes.h +++ b/src/afs/UKERNEL/sysincludes.h @@ -11,7 +11,7 @@ #define __AFS_SYSINCLUDESH__ 1 #include -#if !defined(AFS_USR_DARWIN_ENV) && !defined(AFS_USR_FBSD_ENV) /* must be included after KERNEL undef'd */ +#if !defined(AFS_USR_DARWIN_ENV) && !defined(AFS_USR_FBSD_ENV) /* must be included after KERNEL undef'd */ #include #endif #include @@ -98,9 +98,9 @@ #endif /* AFS_USR_OSF_ENV */ #ifdef AFS_USR_LINUX22_ENV -#include /* _IOW() */ -#include /* struct iovec */ -#include /* struct timeval */ +#include /* _IOW() */ +#include /* struct iovec */ +#include /* struct timeval */ #include #include #include @@ -143,11 +143,11 @@ #endif /* AFS_AFSDB_ENV */ /* glibc 2.2 has pthread_attr_setstacksize */ -#if defined(AFS_LINUX22_ENV) || defined(AFS_USR_LINUX22_ENV) && (__GLIBC_MINOR__ < 2) +#if (defined(AFS_LINUX22_ENV) && !defined(AFS_USR_LINUX22_ENV)) || (defined(AFS_USR_LINUX22_ENV) && (__GLIBC_MINOR__ < 2)) #define pthread_attr_setstacksize(a,b) 0 #endif -#include /* afs_usrops.h uses struct stat in prototypes */ +#include /* afs_usrops.h uses struct stat in prototypes */ #ifdef NETSCAPE_NSAPI @@ -631,7 +631,7 @@ typedef int usr_vtype_t; #ifdef IO_SYNC #undef IO_SYNC #endif - + #define FAPPEND 0x0100 #define IO_APPEND FAPPEND #define FSYNC 0x0200 @@ -840,9 +840,9 @@ enum usr_uio_rw { USR_UIO_READ, USR_UIO_WRITE }; * waking when we do the signal. */ typedef struct { - int waiters; - CRITICAL lock; - CONDVAR cond; + int waiters; + CRITICAL lock; + CONDVAR cond; } usr_cond_t; #define usr_mutex_t CRITICAL @@ -973,6 +973,9 @@ extern pthread_cond_t usr_sleep_cond; #define uprintf printf #define usr_getpid() (int)(usr_thread_self()) +#ifdef ISAFS_GLOCK +#undef ISAFS_GLOCK +#endif #define ISAFS_GLOCK() (usr_thread_self() == afs_global_owner) #endif /* NETSCAPE_NSAPI */ @@ -988,7 +991,7 @@ extern pthread_cond_t usr_sleep_cond; { \ (vp)->v_count++; \ } - + #define VN_RELE(vp) \ do { \ AFS_ASSERT_GLOCK(); \ @@ -998,40 +1001,40 @@ do { \ } while(0) struct usr_statfs { - unsigned long f_type; - unsigned long f_bsize; - unsigned long f_frsize; - unsigned long f_ffree; - unsigned long f_favail; - struct { - unsigned long val[2]; - } f_fsid; - char f_basetype[FSTYPSZ]; - unsigned long f_flag; - unsigned long f_namemax; - unsigned long f_blocks; - unsigned long f_bfree; - unsigned long f_bavail; - unsigned long f_files; + unsigned long f_type; + unsigned long f_bsize; + unsigned long f_frsize; + unsigned long f_ffree; + unsigned long f_favail; + struct { + unsigned long val[2]; + } f_fsid; + char f_basetype[FSTYPSZ]; + unsigned long f_flag; + unsigned long f_namemax; + unsigned long f_blocks; + unsigned long f_bfree; + unsigned long f_bavail; + unsigned long f_files; }; struct usr_vattr { - long va_mask; - usr_vtype_t va_type; - unsigned short va_mode; - long va_uid; - long va_gid; - unsigned long va_fsid; - unsigned long va_nodeid; - unsigned long va_nlink; - unsigned long va_size; - struct timeval va_atime; - struct timeval va_mtime; - struct timeval va_ctime; - unsigned long va_rdev; - unsigned long va_blocksize; - unsigned long va_blocks; - unsigned long va_vcode; + long va_mask; + usr_vtype_t va_type; + unsigned short va_mode; + long va_uid; + long va_gid; + unsigned long va_fsid; + unsigned long va_nodeid; + unsigned long va_nlink; + unsigned long va_size; + struct timeval va_atime; + struct timeval va_mtime; + struct timeval va_ctime; + unsigned long va_rdev; + unsigned long va_blocksize; + unsigned long va_blocks; + unsigned long va_vcode; }; #ifdef VSUID @@ -1053,7 +1056,7 @@ struct usr_vattr { #undef VEXEC #endif -#define VSUID 04000 +#define VSUID 04000 #define VSGID 02000 #define VSVTX 01000 #define VREAD 00400 @@ -1062,99 +1065,99 @@ struct usr_vattr { struct usr_vnode { - unsigned short v_flag; - unsigned long v_count; - struct usr_vnodeops *v_op; - struct usr_vfs * v_vfsp; - long v_type; - unsigned long v_rdev; - char * v_data; + unsigned short v_flag; + unsigned long v_count; + struct usr_vnodeops *v_op; + struct usr_vfs *v_vfsp; + long v_type; + unsigned long v_rdev; + char *v_data; }; -struct usr_inode { - daddr_t i_db[NDADDR]; - struct usr_vnode *i_devvp; - unsigned long i_dev; - long i_flag; - struct usr_inode *i_freef; - struct usr_inode **i_freeb; - long i_gid; - daddr_t i_ib[NIADDR]; - unsigned short i_mode; - short i_nlink; - unsigned long i_number; - long i_size; - long i_uid; - struct usr_vnode i_vnode; - struct { - unsigned long ic_spare[4]; - } i_ic; +struct usr_inode { + daddr_t i_db[NDADDR]; + struct usr_vnode *i_devvp; + unsigned long i_dev; + long i_flag; + struct usr_inode *i_freef; + struct usr_inode **i_freeb; + long i_gid; + daddr_t i_ib[NIADDR]; + unsigned short i_mode; + short i_nlink; + unsigned long i_number; + long i_size; + long i_uid; + struct usr_vnode i_vnode; + struct { + unsigned long ic_spare[4]; + } i_ic; }; extern struct usr_inode *iget(); struct usr_fileops { - int (*vno_rw)(); - int (*vno_ioctl)(); - int (*vno_select)(); - int (*vno_closex)(); + int (*vno_rw) (void); + int (*vno_ioctl) (void); + int (*vno_select) (void); + int (*vno_closex) (void); }; struct usr_file { - unsigned short f_flag; - offset_t f_offset; - struct usr_ucred *f_cred; - struct usr_fileops *f_ops; - char * f_data; - long f_type; + unsigned short f_flag; + offset_t f_offset; + struct usr_ucred *f_cred; + struct usr_fileops *f_ops; + char *f_data; + long f_type; }; extern struct usr_file *falloc(); extern struct usr_file *getf(int); -#ifdef fid_len -#undef fid_len +#ifdef fid_len +#undef fid_len #endif #ifdef fid_data #undef fid_data #endif struct usr_fid { - unsigned short fid_len; - unsigned short fid_reserved; - char fid_data[MAXFIDSZ]; + unsigned short fid_len; + unsigned short fid_reserved; + char fid_data[MAXFIDSZ]; }; struct usr_flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - long l_sysid; - pid_t l_pid; + short l_type; + short l_whence; + off_t l_start; + off_t l_len; + long l_sysid; + pid_t l_pid; }; -extern struct usr_ucred *usr_crget(); +extern struct usr_ucred *usr_crget(void); extern struct usr_ucred *usr_crcopy(struct usr_ucred *); extern int usr_crhold(struct usr_ucred *); extern int usr_crfree(struct usr_ucred *); extern struct usr_ucred *afs_global_ucredp; -struct usr_proc { - unsigned long p_flag; - pid_t p_pid; - pid_t p_ppid; - struct usr_ucred *p_ucred; - char p_cursig; +struct usr_proc { + unsigned long p_flag; + pid_t p_pid; + pid_t p_ppid; + struct usr_ucred *p_ucred; + char p_cursig; }; -struct usr_a { - int fd; - int syscall; - int parm1; - int parm2; - int parm3; - int parm4; - int parm5; - int parm6; +struct usr_a { + int fd; + int syscall; + int parm1; + int parm2; + int parm3; + int parm4; + int parm5; + int parm6; }; #ifdef uio_offset @@ -1162,12 +1165,12 @@ struct usr_a { #endif struct usr_uio { - struct iovec *uio_iov; - int uio_iovcnt; - long uio_offset; - int uio_segflg; - short uio_fmode; - int uio_resid; + struct iovec *uio_iov; + int uio_iovcnt; + long uio_offset; + int uio_segflg; + short uio_fmode; + int uio_resid; }; #ifdef b_blkno @@ -1177,111 +1180,110 @@ struct usr_uio { #undef b_vp #endif -struct usr_buf { - int b_flags; - short b_dev; - unsigned b_bcount; - struct { - char * b_addr; - struct usr_fs *b_fs; - } b_un; - long b_blkno; - unsigned int b_resid; - struct usr_vnode *b_vp; +struct usr_buf { + int b_flags; + short b_dev; + unsigned b_bcount; + struct { + char *b_addr; + struct usr_fs *b_fs; + } b_un; + long b_blkno; + unsigned int b_resid; + struct usr_vnode *b_vp; }; struct usr_socket { - int sock; - short port; + int sock; + short port; }; #define NDIRSIZ_LEN(len) \ ((sizeof (struct usr_dirent)+4 - (MAXNAMLEN+1)) + (((len)+1 + 3) &~ 3)) struct usr_vnodeops { - int (*vn_open)(); - int (*vn_close)(); - int (*vn_rdwr)(); - int (*vn_ioctl)(); - int (*vn_select)(); - int (*vn_getattr)(); - int (*vn_setattr)(); - int (*vn_access)(); - int (*vn_lookup)(); - int (*vn_create)(); - int (*vn_remove)(); - int (*vn_link)(); - int (*vn_rename)(); - int (*vn_mkdir)(); - int (*vn_rmdir)(); - int (*vn_readdir)(); - int (*vn_symlink)(); - int (*vn_readlink)(); - int (*vn_fsync)(); - int (*vn_inactive)(); - int (*vn_bmap)(); - int (*vn_strategy)(); - int (*vn_bread)(); - int (*vn_brelse)(); - int (*vn_lockctl)(); - int (*vn_fid)(); + int (*vn_open) (char *path, int flags, int mode); + int (*vn_close) (int fd); + int (*vn_rdwr) (); + int (*vn_ioctl) (void); + int (*vn_select) (void); + int (*vn_getattr) (); + int (*vn_setattr) (); + int (*vn_access) (); + int (*vn_lookup) (); + int (*vn_create) (); + int (*vn_remove) (); + int (*vn_link) (); + int (*vn_rename) (); + int (*vn_mkdir) (); + int (*vn_rmdir) (); + int (*vn_readdir) (); + int (*vn_symlink) (); + int (*vn_readlink) (); + int (*vn_fsync) (); + int (*vn_inactive) (); + int (*vn_bmap) (); + int (*vn_strategy) (); + int (*vn_bread) (); + int (*vn_brelse) (); + int (*vn_lockctl) (); + int (*vn_fid) (); }; struct usr_fs { - int dummy; + int dummy; }; -struct usr_mount -{ - char m_flags; - unsigned long m_dev; - struct usr_inode *m_inodp; - struct usr_buf *m_bufp; - struct usr_vnode *m_mount; +struct usr_mount { + char m_flags; + unsigned long m_dev; + struct usr_inode *m_inodp; + struct usr_buf *m_bufp; + struct usr_vnode *m_mount; }; extern struct usr_mount *getmp(unsigned long); typedef long usr_whymountroot_t; struct usr_vfsops { - int (*vfs_mount)(); - int (*vfs_unmount)(); - int (*vfs_root)(); - int (*vfs_statfs)(); - int (*vfs_mountroot)(); - int (*vfs_swapvp)(); + int (*vfs_mount) (); + int (*vfs_unmount) (); + int (*vfs_root) (); + int (*vfs_statfs) (); + int (*vfs_mountroot) (); + int (*vfs_swapvp) (); }; struct usr_vfs { - struct usr_vnode *vfs_vnodecovered; - struct { - unsigned long val[2]; - } vfs_fsid; - char * vfs_data; - unsigned long vfs_bsize; - struct usr_mount *vfs_mount; - struct usr_vfsops *vfs_op; + struct usr_vnode *vfs_vnodecovered; + struct { + unsigned long val[2]; + } vfs_fsid; + char *vfs_data; + unsigned long vfs_bsize; + struct usr_mount *vfs_mount; + struct usr_vfsops *vfs_op; }; struct usr_sysent { - char sy_narg; - int (*sy_call)(); + char sy_narg; + int (*sy_call) (); }; extern struct usr_sysent usr_sysent[]; struct usr_ifnet { - struct usr_ifnet *if_next; - short if_flags; - u_int if_mtu; - u_int if_metric; - struct usr_ifaddr *if_addrlist; + struct usr_ifnet *if_next; + short if_flags; + u_int if_mtu; + u_int if_metric; + struct usr_ifaddr *if_addrlist; }; extern struct usr_ifnet *usr_ifnet; struct usr_ifaddr { - struct usr_ifaddr *ifa_next; - struct usr_ifnet *ifa_ifp; - struct sockaddr ifa_addr; + struct usr_ifaddr *ifa_next; + struct usr_ifnet *ifa_ifp; + struct sockaddr ifa_addr; }; #ifdef ia_ifp @@ -1292,14 +1294,14 @@ struct usr_ifaddr { #endif struct usr_in_ifaddr { - struct usr_in_ifaddr *ia_next; - struct usr_ifnet *ia_ifp; - struct sockaddr_in ia_addr; - unsigned long ia_net; - unsigned long ia_netmask; - unsigned long ia_subnet; - unsigned long ia_subnetmask; - struct in_addr ia_netbroadcast; + struct usr_in_ifaddr *ia_next; + struct usr_ifnet *ia_ifp; + struct sockaddr_in ia_addr; + unsigned long ia_net; + unsigned long ia_netmask; + unsigned long ia_subnet; + unsigned long ia_subnetmask; + struct in_addr ia_netbroadcast; }; extern struct usr_in_ifaddr *usr_in_ifaddr; @@ -1315,12 +1317,12 @@ extern long V; struct min_direct { #if defined(AFS_OFS_ENV) || defined(AFS_USR_OSF_ENV) - unsigned int d_fileno; -#else /* AFS_OFS_ENV || AFS_USR_OSF_ENV */ - unsigned long d_fileno; -#endif /* AFS_OFS_ENV || AFS_USR_OSF_ENV */ - unsigned short d_reclen; - unsigned short d_namlen; + unsigned int d_fileno; +#else /* AFS_OFS_ENV || AFS_USR_OSF_ENV */ + unsigned long d_fileno; +#endif /* AFS_OFS_ENV || AFS_USR_OSF_ENV */ + unsigned short d_reclen; + unsigned short d_namlen; }; #ifndef NGROUPS @@ -1329,58 +1331,59 @@ struct min_direct { #ifndef NOGROUP #define NOGROUP (-1) #endif +#ifdef cr_gid +#undef cr_gid +#endif struct usr_ucred { - unsigned long cr_ref; - long cr_uid; -#if !defined(AFS_USR_FBSD_ENV) - long cr_gid; -#endif - long cr_ruid; - long cr_rgid; - long cr_suid; - long cr_sgid; - long cr_ngroups; - gid_t cr_groups[NGROUPS]; + unsigned long cr_ref; + long cr_uid; + long cr_gid; + long cr_ruid; + long cr_rgid; + long cr_suid; + long cr_sgid; + long cr_ngroups; + gid_t cr_groups[NGROUPS]; }; #ifdef u_rval1 #undef u_rval1 #endif -struct usr_user { - int u_error; - int u_prio; - char * u_ap; - int u_rval1; - long u_viceid; - unsigned long u_expiration; - struct usr_proc *u_procp; - struct usr_ucred *u_cred; - struct { - int r_val1; - } u_r; +struct usr_user { + int u_error; + int u_prio; + char *u_ap; + int u_rval1; + long u_viceid; + unsigned long u_expiration; + struct usr_proc *u_procp; + struct usr_ucred *u_cred; + struct { + int r_val1; + } u_r; }; #define u_rval1 u_r.r_val1 #define u (*(get_user_struct())) -extern struct usr_user *get_user_struct(); +extern struct usr_user *get_user_struct(void); #define USR_DIRSIZE 2048 struct usr_dirent { - unsigned long d_ino; - unsigned long d_off; - unsigned short d_reclen; - char d_name[MAXNAMLEN+1]; + unsigned long d_ino; + unsigned long d_off; + unsigned short d_reclen; + char d_name[MAXNAMLEN + 1]; }; typedef struct { - int dd_fd; - int dd_loc; - int dd_size; - int dd_reserved; - char *dd_buf; + int dd_fd; + int dd_loc; + int dd_size; + int dd_reserved; + char *dd_buf; } usr_DIR; extern unsigned short usr_rx_port; diff --git a/src/afs/VNOPS/afs_vnop_access.c b/src/afs/VNOPS/afs_vnop_access.c index 5a19f3dcb..81a0d111b 100644 --- a/src/afs/VNOPS/afs_vnop_access.c +++ b/src/afs/VNOPS/afs_vnop_access.c @@ -20,19 +20,20 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_access.c,v 1.1.1.6 2002/08/02 04:29:00 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_access.c,v 1.10 2003/07/15 23:14:29 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" #ifndef ANONYMOUSID -#define ANONYMOUSID 32766 /* make sure this is same as in ptserver.h */ +#define ANONYMOUSID 32766 /* make sure this is same as in ptserver.h */ #endif @@ -51,10 +52,9 @@ static char fileModeMap[8] = { }; /* avc must be held. Returns bit map of mode bits. Ignores file mode bits */ -afs_int32 afs_GetAccessBits (avc, arights, areq) - register struct vcache *avc; - register afs_int32 arights; - register struct vrequest *areq; +afs_int32 +afs_GetAccessBits(register struct vcache *avc, register afs_int32 arights, + register struct vrequest *areq) { AFS_STATCNT(afs_GetAccessBits); /* see if anyuser has the required access bits */ @@ -63,41 +63,40 @@ afs_int32 afs_GetAccessBits (avc, arights, areq) } /* look in per-pag cache */ - if (avc->Access) { /* not beautiful, but Sun's cc will tolerate it */ - struct axscache *ac; + if (avc->Access) { /* not beautiful, but Sun's cc will tolerate it */ + struct axscache *ac; - ac = afs_FindAxs(avc->Access, areq->uid); - if (ac) { - return (arights & ac->axess); - } + ac = afs_FindAxs(avc->Access, areq->uid); + if (ac) { + return (arights & ac->axess); + } } - if (!(avc->states & CForeign)) { - /* If there aren't any bits cached for this user (but the vnode - * _is_ cached, obviously), make sure this user has valid tokens - * before bothering with the RPC. */ - struct unixuser *tu; - extern struct unixuser *afs_FindUser(); - tu = afs_FindUser( areq->uid, avc->fid.Cell, READ_LOCK ); - if (!tu) { - return (arights & avc->anyAccess); - } - if ((tu->vid == UNDEFVID) || !(tu->states & UHasTokens) || - (tu->states & UTokensBad)) { - afs_PutUser(tu, READ_LOCK); - return (arights & avc->anyAccess); - } - else { - afs_PutUser(tu, READ_LOCK); - } + if (!(avc->states & CForeign)) { + /* If there aren't any bits cached for this user (but the vnode + * _is_ cached, obviously), make sure this user has valid tokens + * before bothering with the RPC. */ + struct unixuser *tu; + extern struct unixuser *afs_FindUser(); + tu = afs_FindUser(areq->uid, avc->fid.Cell, READ_LOCK); + if (!tu) { + return (arights & avc->anyAccess); + } + if ((tu->vid == UNDEFVID) || !(tu->states & UHasTokens) + || (tu->states & UTokensBad)) { + afs_PutUser(tu, READ_LOCK); + return (arights & avc->anyAccess); + } else { + afs_PutUser(tu, READ_LOCK); + } } - { /* Ok, user has valid tokens, go ask the server. */ - struct AFSFetchStatus OutStatus; - afs_int32 code; - - code = afs_FetchStatus(avc, &avc->fid, areq, &OutStatus); - return (code ? 0 : OutStatus.CallerAccess & arights); + { /* Ok, user has valid tokens, go ask the server. */ + struct AFSFetchStatus OutStatus; + afs_int32 code; + + code = afs_FetchStatus(avc, &avc->fid, areq, &OutStatus); + return (code ? 0 : OutStatus.CallerAccess & arights); } } @@ -105,10 +104,10 @@ afs_int32 afs_GetAccessBits (avc, arights, areq) /* the new access ok function. AVC must be held but not locked. if avc is a * file, its parent need not be held, and should not be locked. */ -afs_AccessOK(avc, arights, areq, check_mode_bits) -struct vcache *avc; -afs_int32 arights, check_mode_bits; -struct vrequest *areq; { +int +afs_AccessOK(struct vcache *avc, afs_int32 arights, struct vrequest *areq, + afs_int32 check_mode_bits) +{ register struct vcache *tvc; struct VenusFid dirFid; register afs_int32 mask; @@ -118,10 +117,9 @@ struct vrequest *areq; { AFS_STATCNT(afs_AccessOK); if ((vType(avc) == VDIR) || (avc->states & CForeign)) { - /* rights are just those from acl */ - return (arights == afs_GetAccessBits(avc, arights, areq)); - } - else { + /* rights are just those from acl */ + return (arights == afs_GetAccessBits(avc, arights, areq)); + } else { /* some rights come from dir and some from file. Specifically, you * have "a" rights to a file if you are its owner, which comes * back as "a" rights to the file. You have other rights just @@ -136,14 +134,12 @@ struct vrequest *areq; { dirFid.Fid.Vnode = avc->parentVnode; dirFid.Fid.Unique = avc->parentUnique; /* Avoid this GetVCache call */ - tvc = afs_GetVCache(&dirFid, areq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); + tvc = afs_GetVCache(&dirFid, areq, NULL, NULL); if (tvc) { dirBits = afs_GetAccessBits(tvc, arights, areq); - afs_PutVCache(tvc, WRITE_LOCK); + afs_PutVCache(tvc); } - } - else + } else dirBits = 0xffffffff; /* assume OK; this is a race condition */ if (arights & PRSFS_ADMINISTER) fileBits = afs_GetAccessBits(avc, arights, areq); @@ -151,25 +147,28 @@ struct vrequest *areq; { fileBits = 0; /* don't make call if results don't matter */ /* compute basic rights in fileBits, taking A from file bits */ - fileBits = (fileBits & PRSFS_ADMINISTER) | (dirBits & ~PRSFS_ADMINISTER); + fileBits = + (fileBits & PRSFS_ADMINISTER) | (dirBits & ~PRSFS_ADMINISTER); /* for files, throw in R and W if have I and A (owner). This makes - insert-only dirs work properly */ - if (vType(avc) != VDIR && (fileBits & (PRSFS_ADMINISTER | PRSFS_INSERT)) == + * insert-only dirs work properly */ + if (vType(avc) != VDIR + && (fileBits & (PRSFS_ADMINISTER | PRSFS_INSERT)) == (PRSFS_ADMINISTER | PRSFS_INSERT)) fileBits |= (PRSFS_READ | PRSFS_WRITE); if (check_mode_bits & CHECK_MODE_BITS) { /* owner mode bits are further restrictions on the access mode - * The mode bits are mapped to protection bits through the - * fileModeMap. If CMB_ALLOW_EXEC_AS_READ is set, it's from the - * NFS translator and we don't know if it's a read or execute - * on the NFS client, but both need to read the data. - */ + * The mode bits are mapped to protection bits through the + * fileModeMap. If CMB_ALLOW_EXEC_AS_READ is set, it's from the + * NFS translator and we don't know if it's a read or execute + * on the NFS client, but both need to read the data. + */ mask = (avc->m.Mode & 0700) >> 6; /* file restrictions to use */ fileBits &= ~fileModeMap[mask]; if (check_mode_bits & CMB_ALLOW_EXEC_AS_READ) { - if (avc->m.Mode & 0100) fileBits |= PRSFS_READ; + if (avc->m.Mode & 0100) + fileBits |= PRSFS_READ; } } return ((fileBits & arights) == arights); /* true if all rights bits are on */ @@ -177,45 +176,48 @@ struct vrequest *areq; { } -#if defined(AFS_SUN5_ENV) || (defined(AFS_SGI_ENV) && !defined(AFS_SGI65_ENV)) -afs_access(OSI_VC_ARG(avc), amode, flags, acred) - int flags; +#if defined(AFS_SUN5_ENV) || (defined(AFS_SGI_ENV) && !defined(AFS_SGI65_ENV)) +int +afs_access(OSI_VC_DECL(avc), register afs_int32 amode, int flags, + struct AFS_UCRED *acred) #else -afs_access(OSI_VC_ARG(avc), amode, acred) +int +afs_access(OSI_VC_DECL(avc), register afs_int32 amode, + struct AFS_UCRED *acred) #endif - OSI_VC_DECL(avc); - register afs_int32 amode; - struct AFS_UCRED *acred; { +{ register afs_int32 code; struct vrequest treq; struct afs_fakestat_state fakestate; OSI_VC_CONVERT(avc) - AFS_STATCNT(afs_access); - afs_Trace3(afs_iclSetp, CM_TRACE_ACCESS, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, amode, ICL_TYPE_INT32, avc->m.Length); + AFS_STATCNT(afs_access); + afs_Trace3(afs_iclSetp, CM_TRACE_ACCESS, ICL_TYPE_POINTER, avc, + ICL_TYPE_INT32, amode, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length)); afs_InitFakeStat(&fakestate); - if (code = afs_InitReq(&treq, acred)) return code; + if ((code = afs_InitReq(&treq, acred))) + return code; code = afs_EvalFakeStat(&avc, &fakestate, &treq); if (code) { - afs_PutFakeStat(&fakestate); - return code; + afs_PutFakeStat(&fakestate); + return code; } code = afs_VerifyVCache(avc, &treq); if (code) { - afs_PutFakeStat(&fakestate); - code = afs_CheckCode(code, &treq, 16); - return code; + afs_PutFakeStat(&fakestate); + code = afs_CheckCode(code, &treq, 16); + return code; } /* if we're looking for write access and we have a read-only file system, report it */ if ((amode & VWRITE) && (avc->states & CRO)) { - afs_PutFakeStat(&fakestate); + afs_PutFakeStat(&fakestate); return EROFS; } - code = 1; /* Default from here on in is access ok. */ + code = 1; /* Default from here on in is access ok. */ if (avc->states & CForeign) { /* In the dfs xlator the EXEC bit is mapped to LOOKUP */ if (amode & VEXEC) @@ -224,24 +226,33 @@ afs_access(OSI_VC_ARG(avc), amode, acred) code = afs_AccessOK(avc, PRSFS_WRITE, &treq, CHECK_MODE_BITS); if (code && (vType(avc) == VDIR)) { if (code) - code = afs_AccessOK(avc, PRSFS_INSERT, &treq, CHECK_MODE_BITS); - if (!code) - code = afs_AccessOK(avc, PRSFS_DELETE, &treq, CHECK_MODE_BITS); - } - } - if (code && (amode & VREAD)) + code = + afs_AccessOK(avc, PRSFS_INSERT, &treq, + CHECK_MODE_BITS); + if (!code) + code = + afs_AccessOK(avc, PRSFS_DELETE, &treq, + CHECK_MODE_BITS); + } + } + if (code && (amode & VREAD)) code = afs_AccessOK(avc, PRSFS_READ, &treq, CHECK_MODE_BITS); } else { if (vType(avc) == VDIR) { - if (amode & VEXEC) - code = afs_AccessOK(avc, PRSFS_LOOKUP, &treq, CHECK_MODE_BITS); + if (amode & VEXEC) + code = + afs_AccessOK(avc, PRSFS_LOOKUP, &treq, CHECK_MODE_BITS); if (code && (amode & VWRITE)) { - code = afs_AccessOK(avc, PRSFS_INSERT, &treq, CHECK_MODE_BITS); - if (!code) - code = afs_AccessOK(avc, PRSFS_DELETE, &treq, CHECK_MODE_BITS); + code = + afs_AccessOK(avc, PRSFS_INSERT, &treq, CHECK_MODE_BITS); + if (!code) + code = + afs_AccessOK(avc, PRSFS_DELETE, &treq, + CHECK_MODE_BITS); } if (code && (amode & VREAD)) - code = afs_AccessOK(avc, PRSFS_LOOKUP, &treq, CHECK_MODE_BITS); + code = + afs_AccessOK(avc, PRSFS_LOOKUP, &treq, CHECK_MODE_BITS); } else { if (amode & VEXEC) { code = afs_AccessOK(avc, PRSFS_READ, &treq, CHECK_MODE_BITS); @@ -258,32 +269,36 @@ afs_access(OSI_VC_ARG(avc), amode, acred) */ if (!((amode & VREAD) && AFS_NFSXLATORREQ(acred))) #endif - if ((avc->m.Mode & 0100) == 0) code = 0; - } else if (avc->m.Mode & 0100) code = 1; + if ((avc->m.Mode & 0100) == 0) + code = 0; + } else if (avc->m.Mode & 0100) + code = 1; } - if (code && (amode & VWRITE)) - { - code = afs_AccessOK(avc, PRSFS_WRITE, &treq, CHECK_MODE_BITS); - - /* The above call fails when the NFS translator tries to copy - ** a file with r--r--r-- permissions into a directory which - ** has system:anyuser acl. This is because the destination file - ** file is first created with r--r--r-- permissions through an - ** unauthenticated connectin. hence, the above afs_AccessOK - ** call returns failure. hence, we retry without any file - ** mode bit checking */ - if ( !code && AFS_NFSXLATORREQ(acred) && avc->m.Owner == ANONYMOUSID) - code=afs_AccessOK(avc,PRSFS_WRITE, &treq, DONT_CHECK_MODE_BITS); + if (code && (amode & VWRITE)) { + code = afs_AccessOK(avc, PRSFS_WRITE, &treq, CHECK_MODE_BITS); + + /* The above call fails when the NFS translator tries to copy + ** a file with r--r--r-- permissions into a directory which + ** has system:anyuser acl. This is because the destination file + ** file is first created with r--r--r-- permissions through an + ** unauthenticated connectin. hence, the above afs_AccessOK + ** call returns failure. hence, we retry without any file + ** mode bit checking */ + if (!code && AFS_NFSXLATORREQ(acred) + && avc->m.Owner == ANONYMOUSID) + code = + afs_AccessOK(avc, PRSFS_WRITE, &treq, + DONT_CHECK_MODE_BITS); } - if (code && (amode & VREAD)) - code = afs_AccessOK(avc, PRSFS_READ, &treq, CHECK_MODE_BITS); + if (code && (amode & VREAD)) + code = afs_AccessOK(avc, PRSFS_READ, &treq, CHECK_MODE_BITS); } } afs_PutFakeStat(&fakestate); if (code) { return 0; /* if access is ok */ } else { - code = afs_CheckCode(EACCES, &treq, 17); /* failure code */ + code = afs_CheckCode(EACCES, &treq, 17); /* failure code */ return code; } } @@ -293,21 +308,21 @@ afs_access(OSI_VC_ARG(avc), amode, acred) * afs_getRights * This function is just an interface to afs_GetAccessBits */ -int afs_getRights(OSI_VC_ARG(avc), arights, acred) - OSI_VC_DECL(avc); - register afs_int32 arights; - struct AFS_UCRED *acred; +int +afs_getRights(OSI_VC_DECL(avc), register afs_int32 arights, + struct AFS_UCRED *acred) { register afs_int32 code; struct vrequest treq; OSI_VC_CONVERT(avc) - if (code = afs_InitReq(&treq, acred)) return code; + if (code = afs_InitReq(&treq, acred)) + return code; code = afs_VerifyVCache(avc, &treq); if (code) { - code = afs_CheckCode(code, &treq, 16); - return code; + code = afs_CheckCode(code, &treq, 16); + return code; } return afs_GetAccessBits(avc, arights, &treq); diff --git a/src/afs/VNOPS/afs_vnop_attrs.c b/src/afs/VNOPS/afs_vnop_attrs.c index f6c00f2b1..682c1d565 100644 --- a/src/afs/VNOPS/afs_vnop_attrs.c +++ b/src/afs/VNOPS/afs_vnop_attrs.c @@ -21,16 +21,17 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.1.1.13 2004/01/10 20:52:57 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.27 2003/10/24 06:26:04 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" extern afs_rwlock_t afs_xcbhash; struct afs_exporter *afs_nfsexporter; @@ -40,38 +41,37 @@ extern struct vfs *afs_globalVFS; #endif /* copy out attributes from cache entry */ -afs_CopyOutAttrs(avc, attrs) - register struct vattr *attrs; - register struct vcache *avc; +int +afs_CopyOutAttrs(register struct vcache *avc, register struct vattr *attrs) { register struct volume *tvp; register struct cell *tcell; - register afs_int32 i; int fakedir = 0; AFS_STATCNT(afs_CopyOutAttrs); if (afs_fakestat_enable && avc->mvstat == 1) fakedir = 1; #if defined(AFS_MACH_ENV ) - attrs->va_mode = fakedir ? VDIR | 0755 : vType(avc) | (avc->m.Mode&~VFMT); + attrs->va_mode = + fakedir ? VDIR | 0755 : vType(avc) | (avc->m.Mode & ~VFMT); #else /* AFS_MACH_ENV */ attrs->va_type = fakedir ? VDIR : vType(avc); #if defined(AFS_SGI_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) - attrs->va_mode = fakedir ? 0755 : (mode_t)(avc->m.Mode & 0xffff); + attrs->va_mode = fakedir ? 0755 : (mode_t) (avc->m.Mode & 0xffff); #else attrs->va_mode = fakedir ? VDIR | 0755 : avc->m.Mode; #endif #endif /* AFS_MACH_ENV */ - if (avc->m.Mode & (VSUID|VSGID)) { + if (avc->m.Mode & (VSUID | VSGID)) { /* setuid or setgid, make sure we're allowed to run them from this cell */ tcell = afs_GetCell(avc->fid.Cell, 0); if (tcell && (tcell->states & CNoSUID)) - attrs->va_mode &= ~(VSUID|VSGID); + attrs->va_mode &= ~(VSUID | VSGID); } #if defined(AFS_DARWIN_ENV) { - extern u_int32_t afs_darwin_realmodes; + extern u_int32_t afs_darwin_realmodes; if (!afs_darwin_realmodes) { /* Mac OS X uses the mode bits to determine whether a file or * directory is accessible, and believes them, even though under @@ -80,20 +80,20 @@ afs_CopyOutAttrs(avc, attrs) * conservatively. */ if (S_ISDIR(attrs->va_mode)) { - /* all access bits need to be set for directories, since even - * a mode 0 directory can still be used normally. - */ - attrs->va_mode |= ACCESSPERMS; + /* all access bits need to be set for directories, since even + * a mode 0 directory can still be used normally. + */ + attrs->va_mode |= ACCESSPERMS; } else { - /* for other files, replicate the user bits to group and other */ - mode_t ubits = (attrs->va_mode & S_IRWXU) >> 6; - attrs->va_mode |= ubits | (ubits << 3); + /* for other files, replicate the user bits to group and other */ + mode_t ubits = (attrs->va_mode & S_IRWXU) >> 6; + attrs->va_mode |= ubits | (ubits << 3); } } } #endif /* AFS_DARWIN_ENV */ attrs->va_uid = fakedir ? 0 : avc->m.Owner; - attrs->va_gid = fakedir ? 0 : avc->m.Group; /* yeah! */ + attrs->va_gid = fakedir ? 0 : avc->m.Group; /* yeah! */ #if defined(AFS_SUN56_ENV) attrs->va_fsid = avc->v.v_vfsp->vfs_fsid.val[0]; #else @@ -102,7 +102,7 @@ afs_CopyOutAttrs(avc, attrs) attrs->va_fsid = 1; #else #ifdef AFS_OSF_ENV - attrs->va_fsid = avc->v.v_mount->m_stat.f_fsid.val[0]; + attrs->va_fsid = avc->v.v_mount->m_stat.f_fsid.val[0]; #else #ifdef AFS_DARWIN70_ENV attrs->va_fsid = avc->v.v_mount->mnt_stat.f_fsid.val[0]; @@ -115,16 +115,16 @@ afs_CopyOutAttrs(avc, attrs) if (avc->mvstat == 2) { tvp = afs_GetVolume(&avc->fid, 0, READ_LOCK); /* The mount point's vnode. */ - if (tvp) { + if (tvp) { attrs->va_nodeid = tvp->mtpoint.Fid.Vnode + (tvp->mtpoint.Fid.Volume << 16); if (FidCmp(&afs_rootFid, &avc->fid) && !attrs->va_nodeid) attrs->va_nodeid = 2; afs_PutVolume(tvp, READ_LOCK); - } - else attrs->va_nodeid = 2; - } - else attrs->va_nodeid = avc->fid.Fid.Vnode + (avc->fid.Fid.Volume << 16); + } else + attrs->va_nodeid = 2; + } else + attrs->va_nodeid = avc->fid.Fid.Vnode + (avc->fid.Fid.Volume << 16); attrs->va_nodeid &= 0x7fffffff; /* Saber C hates negative inode #s! */ attrs->va_nlink = fakedir ? 100 : avc->m.LinkCount; attrs->va_size = fakedir ? 4096 : avc->m.Length; @@ -139,29 +139,26 @@ afs_CopyOutAttrs(avc, attrs) */ #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) /* nfs on these systems puts an 0 in nsec and stores the nfs usec (aka - dataversion) in va_gen */ + * dataversion) in va_gen */ attrs->va_atime.tv_nsec = attrs->va_mtime.tv_nsec = - attrs->va_ctime.tv_nsec =0; - attrs->va_blocksize = PAGESIZE; /* XXX Was 8192 XXX */ + attrs->va_ctime.tv_nsec = 0; attrs->va_gen = hgetlo(avc->m.DataVersion); - attrs->va_flags = 0; -#else -#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) +#elif defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_OBSD_ENV) attrs->va_atime.tv_nsec = attrs->va_mtime.tv_nsec = attrs->va_ctime.tv_nsec = - (hgetlo(avc->m.DataVersion) & 0x7ffff) * 1000; -#if defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - attrs->va_blocksize = PAGESIZE; /* XXX Was 8192 XXX */ -#else - attrs->va_blksize = PAGESIZE; /* XXX Was 8192 XXX */ -#endif + (hgetlo(avc->m.DataVersion) & 0x7ffff) * 1000; #else attrs->va_atime.tv_usec = attrs->va_mtime.tv_usec = - attrs->va_ctime.tv_usec = - (hgetlo(avc->m.DataVersion) & 0x7ffff); - attrs->va_blocksize = PAGESIZE; /* XXX Was 8192 XXX */ + attrs->va_ctime.tv_usec = (hgetlo(avc->m.DataVersion) & 0x7ffff); +#endif +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_OSF_ENV) + attrs->va_flags = 0; #endif +#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) + attrs->va_blksize = PAGESIZE; /* XXX Was 8192 XXX */ +#else + attrs->va_blocksize = PAGESIZE; /* XXX Was 8192 XXX */ #endif #ifdef AFS_DEC_ENV /* Have to use real device #s in Ultrix, since that's how FS type is @@ -172,51 +169,59 @@ afs_CopyOutAttrs(avc, attrs) attrs->va_rdev = ((struct mount *)(afs_globalVFS->vfs_data))->m_dev; else attrs->va_rdev = 1; /* better than nothing */ -#else +#else attrs->va_rdev = 1; #endif - #if defined(AFS_HPUX110_ENV) - if (afs_globalVFS) attrs->va_fstype = afs_globalVFS->vfs_mtype; + if (afs_globalVFS) + attrs->va_fstype = afs_globalVFS->vfs_mtype; #endif /* * Below return 0 (and not 1) blocks if the file is zero length. This conforms - * better with the other filesystems that do return 0. + * better with the other filesystems that do return 0. */ -#if defined(AFS_OSF_ENV) -#ifdef va_size_rsv - attrs->va_size_rsv = 0; -#endif -/* XXX do this */ -/* attrs->va_gen = avc->m.DataVersion;*/ - attrs->va_flags = 0; -#endif /* AFS_OSF_ENV */ - -#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) +#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) #if !defined(AFS_HPUX_ENV) #ifdef AFS_SUN5_ENV - attrs->va_nblocks = (attrs->va_size? ((attrs->va_size + 1023)>>10) << 1 : 0); -#else -#if defined(AFS_SGI_ENV) + attrs->va_nblocks = + (attrs->va_size ? ((attrs->va_size + 1023) >> 10) << 1 : 0); +#elif defined(AFS_SGI_ENV) attrs->va_blocks = BTOBB(attrs->va_size); #else - attrs->va_blocks = (attrs->va_size? ((attrs->va_size + 1023)>>10) << 1 : 0); -#endif + attrs->va_blocks = + (attrs->va_size ? ((attrs->va_size + 1023) >> 10) << 1 : 0); #endif #else /* !defined(AFS_HPUX_ENV) */ - attrs->va_blocks = (attrs->va_size? ((attrs->va_size + 1023)>>10) : 0); + attrs->va_blocks = (attrs->va_size ? ((attrs->va_size + 1023) >> 10) : 0); #endif /* !defined(AFS_HPUX_ENV) */ -#else /* ! AFS_OSF_ENV && !AFS_FBSD_ENV */ - attrs->va_bytes = (attrs->va_size? (attrs->va_size + 1023) : 1024); +#else /* ! AFS_OSF_ENV && !AFS_DARWIN_ENV && !AFS_XBSD_ENV */ + attrs->va_bytes = (attrs->va_size ? (attrs->va_size + 1023) : 1024); #ifdef va_bytes_rsv attrs->va_bytes_rsv = -1; #endif -#endif /* ! AFS_OSF_ENV */ +#endif /* ! AFS_OSF_ENV && !AFS_DARWIN_ENV && !AFS_XBSD_ENV */ #ifdef AFS_LINUX22_ENV - /* And linux has it's own stash as well. */ + /* And linux has its own stash as well. */ vattr2inode(AFSTOV(avc), attrs); +#endif +#ifdef notdef +#ifdef AFS_AIX51_ENV + afs_Trace2(afs_iclSetp, CM_TRACE_STATACLX, ICL_TYPE_POINTER, + attrs->va_acl, ICL_TYPE_INT32, attrs->va_aclsiz); + if (attrs->va_acl && attrs->va_aclsiz >= 12) { + struct acl *ap; + + ap = (struct acl *)attrs->va_acl; + ap->acl_len = 8; + ap->acl_mode = ACL_MODE; + ap->acl_rsvd = 0; + ap->u_access = 7; + } + /* temporary fix ? */ + attrs->va_aclsiz = 1; +#endif #endif return 0; } @@ -224,14 +229,13 @@ afs_CopyOutAttrs(avc, attrs) #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) -afs_getattr(OSI_VC_ARG(avc), attrs, flags, acred) - int flags; +int +afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, int flags, + struct AFS_UCRED *acred) #else -afs_getattr(OSI_VC_ARG(avc), attrs, acred) +int +afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, struct AFS_UCRED *acred) #endif - OSI_VC_DECL(avc); - struct vattr *attrs; - struct AFS_UCRED *acred; { afs_int32 code; struct vrequest treq; @@ -240,15 +244,16 @@ afs_getattr(OSI_VC_ARG(avc), attrs, acred) int inited = 0; OSI_VC_CONVERT(avc) - AFS_STATCNT(afs_getattr); - afs_Trace2(afs_iclSetp, CM_TRACE_GETATTR, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->m.Length); + AFS_STATCNT(afs_getattr); + afs_Trace2(afs_iclSetp, CM_TRACE_GETATTR, ICL_TYPE_POINTER, avc, + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length)); if (afs_fakestat_enable && avc->mvstat == 1) { struct afs_fakestat_state fakestat; code = afs_InitReq(&treq, acred); - if (code) return code; + if (code) + return code; afs_InitFakeStat(&fakestat); code = afs_TryEvalFakeStat(&avc, &fakestat, &treq); if (code) { @@ -260,17 +265,16 @@ afs_getattr(OSI_VC_ARG(avc), attrs, acred) afs_PutFakeStat(&fakestat); return code; } - #if defined(AFS_SUN5_ENV) if (flags & ATTR_HINT) { - code = afs_CopyOutAttrs(avc, attrs); - return code; + code = afs_CopyOutAttrs(avc, attrs); + return code; } #endif #if defined(AFS_DARWIN_ENV) if (avc->states & CUBCinit) { - code = afs_CopyOutAttrs(avc, attrs); - return code; + code = afs_CopyOutAttrs(avc, attrs); + return code; } #endif @@ -278,104 +282,107 @@ afs_getattr(OSI_VC_ARG(avc), attrs, acred) afs_BozonLock(&avc->pvnLock, avc); #endif - if (afs_shuttingdown) return EIO; + if (afs_shuttingdown) + return EIO; if (!(avc->states & CStatd)) { - if (!(code = afs_InitReq(&treq, acred))) { - code = afs_VerifyVCache2(avc, &treq); - inited = 1; - } - } - else code = 0; + if (!(code = afs_InitReq(&treq, acred))) { + code = afs_VerifyVCache2(avc, &treq); + inited = 1; + } + } else + code = 0; #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) - if (code == 0) osi_FlushPages(avc, acred); + if (code == 0) + osi_FlushPages(avc, acred); afs_BozonUnlock(&avc->pvnLock, avc); #endif if (code == 0) { - osi_FlushText(avc); /* only needed to flush text if text locked last time */ + osi_FlushText(avc); /* only needed to flush text if text locked last time */ code = afs_CopyOutAttrs(avc, attrs); if (afs_nfsexporter) { - if (!inited) { - if (code = afs_InitReq(&treq, acred)) - return code; - inited = 1; - } - if (AFS_NFSXLATORREQ(acred)) { - if ((vType(avc) != VDIR) && - !afs_AccessOK(avc, PRSFS_READ, &treq, - CHECK_MODE_BITS|CMB_ALLOW_EXEC_AS_READ)) { - return EACCES; - } - if (avc->mvstat == 2) { -#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - attrs->va_mtime.tv_nsec += ((++avc->xlatordv) * 1000); + if (!inited) { + if ((code = afs_InitReq(&treq, acred))) + return code; + inited = 1; + } + if (AFS_NFSXLATORREQ(acred)) { + if ((vType(avc) != VDIR) + && !afs_AccessOK(avc, PRSFS_READ, &treq, + CHECK_MODE_BITS | + CMB_ALLOW_EXEC_AS_READ)) { + return EACCES; + } + if (avc->mvstat == 2) { +#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + attrs->va_mtime.tv_nsec += ((++avc->xlatordv) * 1000); #else - attrs->va_mtime.tv_usec += ++avc->xlatordv; -#endif - } - } - if (au = afs_FindUser(treq.uid, -1, READ_LOCK)) { - register struct afs_exporter *exporter = au->exporter; - - if (exporter && !(afs_nfsexporter->exp_states & EXP_UNIXMODE)) { - unsigned int ubits; - /* - * If the remote user wishes to enforce default Unix mode semantics, - * like in the nfs exporter case, we OR in the user bits - * into the group and other bits. We need to do this - * because there is no RFS_ACCESS call and thus nfs - * clients implement nfs_access by interpreting the - * mode bits in the traditional way, which of course - * loses with afs. - */ - ubits = (attrs->va_mode & 0700) >> 6; - attrs->va_mode = attrs->va_mode | ubits | (ubits << 3); - /* If it's the root of AFS, replace the inode number with the - * inode number of the mounted on directory; otherwise this - * confuses getwd()... */ -#ifdef AFS_LINUX22_ENV - if (avc == afs_globalVp) { - struct inode *ip = avc->v.i_sb->s_root->d_inode; - attrs->va_nodeid = ip->i_ino; + attrs->va_mtime.tv_usec += ++avc->xlatordv; +#endif } + } + if ((au = afs_FindUser(treq.uid, -1, READ_LOCK))) { + register struct afs_exporter *exporter = au->exporter; + + if (exporter && !(afs_nfsexporter->exp_states & EXP_UNIXMODE)) { + unsigned int ubits; + /* + * If the remote user wishes to enforce default Unix mode semantics, + * like in the nfs exporter case, we OR in the user bits + * into the group and other bits. We need to do this + * because there is no RFS_ACCESS call and thus nfs + * clients implement nfs_access by interpreting the + * mode bits in the traditional way, which of course + * loses with afs. + */ + ubits = (attrs->va_mode & 0700) >> 6; + attrs->va_mode = attrs->va_mode | ubits | (ubits << 3); + /* If it's the root of AFS, replace the inode number with the + * inode number of the mounted on directory; otherwise this + * confuses getwd()... */ +#ifdef AFS_LINUX22_ENV + if (avc == afs_globalVp) { + struct inode *ip = avc->v.i_sb->s_root->d_inode; + attrs->va_nodeid = ip->i_ino; + } #else - if (AFSTOV(avc)->v_flag & VROOT) { - struct vnode *vp = AFSTOV(avc); + if (AFSTOV(avc)->v_flag & VROOT) { + struct vnode *vp = AFSTOV(avc); - vp = vp->v_vfsp->vfs_vnodecovered; - if (vp) { /* Ignore weird failures */ + vp = vp->v_vfsp->vfs_vnodecovered; + if (vp) { /* Ignore weird failures */ #ifdef AFS_SGI62_ENV - attrs->va_nodeid = VnodeToIno(vp); + attrs->va_nodeid = VnodeToIno(vp); #else - struct inode *ip; - - ip = (struct inode *) VTOI(vp); - if (ip) /* Ignore weird failures */ - attrs->va_nodeid = ip->i_number; + struct inode *ip; + + ip = (struct inode *)VTOI(vp); + if (ip) /* Ignore weird failures */ + attrs->va_nodeid = ip->i_number; #endif + } } - } #endif /* AFS_LINUX22_ENV */ - } - afs_PutUser(au, READ_LOCK); - } + } + afs_PutUser(au, READ_LOCK); + } } } if (!code) - return 0; + return 0; code = afs_CheckCode(code, &treq, 14); return code; } /* convert a Unix request into a status store request */ -afs_VAttrToAS(avc, av, as) -register struct vcache *avc; -register struct vattr *av; -register struct AFSStoreStatus *as; { +int +afs_VAttrToAS(register struct vcache *avc, register struct vattr *av, + register struct AFSStoreStatus *as) +{ register int mask; mask = 0; AFS_STATCNT(afs_VAttrToAS); @@ -392,12 +399,11 @@ register struct AFSStoreStatus *as; { mask |= AFS_SETMODE; as->UnixModeBits = av->va_mode & 0xffff; if (avc->states & CForeign) { - ObtainWriteLock(&avc->lock,127); + ObtainWriteLock(&avc->lock, 127); afs_FreeAllAxs(&(avc->Access)); ReleaseWriteLock(&avc->lock); } } - #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV) if (av->va_mask & AT_GID) { #else @@ -414,7 +420,6 @@ register struct AFSStoreStatus *as; { mask |= AFS_SETGROUP; as->Group = av->va_gid; } - #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV) if (av->va_mask & AT_UID) { #else @@ -438,7 +443,7 @@ register struct AFSStoreStatus *as; { #endif mask |= AFS_SETMODTIME; #ifndef AFS_SGI_ENV -#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) if (av->va_mtime.tv_nsec == -1) #else if (av->va_mtime.tv_usec == -1) @@ -455,33 +460,44 @@ register struct AFSStoreStatus *as; { /* We don't set CDirty bit in avc->states because setattr calls WriteVCache * synchronously, therefore, it's not needed. */ -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) -afs_setattr(OSI_VC_ARG(avc), attrs, flags, acred) - int flags; +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) +int +afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs, int flags, + struct AFS_UCRED *acred) #else -afs_setattr(avc, attrs, acred) +int +afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs, + struct AFS_UCRED *acred) #endif - OSI_VC_DECL(avc); - register struct vattr *attrs; - struct AFS_UCRED *acred; { +{ struct vrequest treq; struct AFSStoreStatus astat; register afs_int32 code; struct afs_fakestat_state fakestate; OSI_VC_CONVERT(avc) - AFS_STATCNT(afs_setattr); - afs_Trace2(afs_iclSetp, CM_TRACE_SETATTR, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->m.Length); - if (code = afs_InitReq(&treq, acred)) return code; + AFS_STATCNT(afs_setattr); +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV) + afs_Trace4(afs_iclSetp, CM_TRACE_SETATTR, ICL_TYPE_POINTER, avc, + ICL_TYPE_INT32, attrs->va_mask, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(attrs->va_size), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length)); +#else + afs_Trace4(afs_iclSetp, CM_TRACE_SETATTR, ICL_TYPE_POINTER, avc, + ICL_TYPE_INT32, attrs->va_mode, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(attrs->va_size), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length)); +#endif + if ((code = afs_InitReq(&treq, acred))) + return code; afs_InitFakeStat(&fakestate); code = afs_EvalFakeStat(&avc, &fakestate, &treq); if (code) - goto done; + goto done; if (avc->states & CRO) { - code=EROFS; + code = EROFS; goto done; } #if defined(AFS_SGI_ENV) @@ -533,20 +549,21 @@ afs_setattr(avc, attrs, acred) #endif #if defined(AFS_SGI_ENV) - AFS_RWLOCK((vnode_t *)avc, VRWLOCK_WRITE); + AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE); #endif #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX22_ENV) if (attrs->va_mask & AT_SIZE) { #else #if defined(AFS_OSF_ENV) if (attrs->va_size != VNOVAL) { -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ if (attrs->va_size != -1) { #endif #endif - ObtainWriteLock(&avc->lock,128); + afs_size_t tsize = attrs->va_size; + ObtainWriteLock(&avc->lock, 128); avc->states |= CDirty; - code = afs_TruncateAllSegments(avc, (afs_int32)attrs->va_size, &treq, acred); + code = afs_TruncateAllSegments(avc, tsize, &treq, acred); /* if date not explicitly set by this call, set it ourselves, since we * changed the data */ if (!(astat.Mask & AFS_SETMODTIME)) { @@ -554,14 +571,14 @@ afs_setattr(avc, attrs, acred) astat.ClientModTime = osi_Time(); } if (code == 0) { - if ( ( (avc->execsOrWriters <= 0 ) && (avc->states & CCreating) == 0) - || ( avc->execsOrWriters == 1 && AFS_NFSXLATORREQ(acred)) ) { - code = afs_StoreAllSegments(avc, &treq, AFS_ASYNC); - if (!code) - avc->states &= ~CDirty; - } + if (((avc->execsOrWriters <= 0) && (avc->states & CCreating) == 0) + || (avc->execsOrWriters == 1 && AFS_NFSXLATORREQ(acred))) { + code = afs_StoreAllSegments(avc, &treq, AFS_ASYNC); + if (!code) + avc->states &= ~CDirty; + } } else - avc->states &= ~CDirty; + avc->states &= ~CDirty; ReleaseWriteLock(&avc->lock); hzero(avc->flushDV); @@ -572,20 +589,19 @@ afs_setattr(avc, attrs, acred) #endif } if (code == 0) { - ObtainSharedLock(&avc->lock,16); /* lock entry */ - code = afs_WriteVCache(avc, &astat, &treq); /* send request */ + ObtainSharedLock(&avc->lock, 16); /* lock entry */ + code = afs_WriteVCache(avc, &astat, &treq); /* send request */ ReleaseSharedLock(&avc->lock); /* release lock */ } if (code) { - ObtainWriteLock(&afs_xcbhash, 487); - afs_DequeueCallback(avc); - avc->states &= ~CStatd; - ReleaseWriteLock(&afs_xcbhash); - if (avc->fid.Fid.Vnode & 1 || (vType(avc) == VDIR)) - osi_dnlc_purgedp(avc); - /* error? erase any changes we made to vcache entry */ - } - + ObtainWriteLock(&afs_xcbhash, 487); + afs_DequeueCallback(avc); + avc->states &= ~CStatd; + ReleaseWriteLock(&afs_xcbhash); + if (avc->fid.Fid.Vnode & 1 || (vType(avc) == VDIR)) + osi_dnlc_purgedp(avc); + /* error? erase any changes we made to vcache entry */ + } #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) if (AFS_NFSXLATORREQ(acred)) { avc->execsOrWriters--; @@ -595,9 +611,9 @@ afs_setattr(avc, attrs, acred) afs_BozonUnlock(&avc->pvnLock, avc); #endif #if defined(AFS_SGI_ENV) - AFS_RWUNLOCK((vnode_t *)avc, VRWLOCK_WRITE); + AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_WRITE); #endif -done: + done: afs_PutFakeStat(&fakestate); code = afs_CheckCode(code, &treq, 15); return code; diff --git a/src/afs/VNOPS/afs_vnop_create.c b/src/afs/VNOPS/afs_vnop_create.c index 9bd9c7b5d..f3f0334c6 100644 --- a/src/afs/VNOPS/afs_vnop_create.c +++ b/src/afs/VNOPS/afs_vnop_create.c @@ -14,49 +14,47 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_create.c,v 1.1.1.9 2002/12/11 02:36:23 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_create.c,v 1.16 2003/07/15 23:14:30 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" - -extern afs_rwlock_t afs_xvcache; -extern afs_rwlock_t afs_xcbhash; +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" /* question: does afs_create need to set CDirty in the adp or the avc? * I think we can get away without it, but I'm not sure. Note that * afs_setattr is called in here for truncation. */ #ifdef AFS_OSF_ENV -afs_create(ndp, attrs) - struct nameidata *ndp; - struct vattr *attrs; { +int +afs_create(struct nameidata *ndp, struct vattr *attrs) +#else /* AFS_OSF_ENV */ +#ifdef AFS_SGI64_ENV +int +afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, int flags, + int amode, struct vcache **avcp, struct AFS_UCRED *acred) +#else /* AFS_SGI64_ENV */ +int +afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, + enum vcexcl aexcl, int amode, struct vcache **avcp, + struct AFS_UCRED *acred) +#endif /* AFS_SGI64_ENV */ +#endif /* AFS_OSF_ENV */ +{ +#ifdef AFS_OSF_ENV register struct vcache *adp = VTOAFS(ndp->ni_dvp); char *aname = ndp->ni_dent.d_name; - enum vcexcl aexcl = NONEXCL; /* XXX - create called properly */ - int amode = 0; /* XXX - checked in higher level */ + enum vcexcl aexcl = NONEXCL; /* XXX - create called properly */ + int amode = 0; /* XXX - checked in higher level */ struct vcache **avcp = (struct vcache **)&(ndp->ni_vp); struct ucred *acred = ndp->ni_cred; -#else /* AFS_OSF_ENV */ -#ifdef AFS_SGI64_ENV -afs_create(OSI_VC_ARG(adp), aname, attrs, flags, amode, avcp, acred) - int flags; -#else /* AFS_SGI64_ENV */ -afs_create(OSI_VC_ARG(adp), aname, attrs, aexcl, amode, avcp, acred) - enum vcexcl aexcl; -#endif /* AFS_SGI64_ENV */ - OSI_VC_DECL(adp); - char *aname; - struct vattr *attrs; - int amode; - struct vcache **avcp; - struct AFS_UCRED *acred; { -#endif /* AFS_OSF_ENV */ +#endif + afs_int32 origCBs, origZaps, finalZaps; struct vrequest treq; register afs_int32 code; @@ -68,17 +66,16 @@ afs_create(OSI_VC_ARG(adp), aname, attrs, aexcl, amode, avcp, acred) struct AFSCallBack CallBack; afs_int32 now; struct dcache *tdc; - afs_int32 offset, len; - struct server *hostp=0; + afs_size_t offset, len; + struct server *hostp = 0; struct vcache *tvc; - struct volume* volp = 0; + struct volume *volp = 0; struct afs_fakestat_state fakestate; - XSTATS_DECLS - OSI_VC_CONVERT(adp) + XSTATS_DECLS OSI_VC_CONVERT(adp) - AFS_STATCNT(afs_create); - if (code = afs_InitReq(&treq, acred)) + AFS_STATCNT(afs_create); + if ((code = afs_InitReq(&treq, acred))) goto done2; afs_Trace3(afs_iclSetp, CM_TRACE_CREATE, ICL_TYPE_POINTER, adp, @@ -114,27 +111,31 @@ afs_create(OSI_VC_ARG(adp), aname, attrs, aexcl, amode, avcp, acred) #endif case VFIFO: /* We don't support special devices or FIFOs */ - code = EINVAL; + code = EINVAL; goto done; default: ; } code = afs_EvalFakeStat(&adp, &fakestate, &treq); - if (code) goto done; -tagain: + if (code) + goto done; + tagain: code = afs_VerifyVCache(adp, &treq); - if (code) goto done; + if (code) + goto done; /** If the volume is read-only, return error without making an RPC to the * fileserver */ - if ( adp->states & CRO ) { - code = EROFS; + if (adp->states & CRO) { + code = EROFS; goto done; } - tdc = afs_GetDCache(adp, 0, &treq, &offset, &len, 1); - ObtainWriteLock(&adp->lock,135); + tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1); + ObtainWriteLock(&adp->lock, 135); + if (tdc) + ObtainSharedLock(&tdc->lock, 630); /* * Make sure that the data in the cache is current. We may have @@ -143,15 +144,18 @@ tagain: if (!(adp->states & CStatd) || (tdc && !hsame(adp->m.DataVersion, tdc->f.versionNo))) { ReleaseWriteLock(&adp->lock); - if (tdc) + if (tdc) { + ReleaseSharedLock(&tdc->lock); afs_PutDCache(tdc); + } goto tagain; } if (tdc) { /* see if file already exists. If it does, we only set * the size attributes (to handle O_TRUNC) */ - code = afs_dir_Lookup(&tdc->f.inode, aname, &newFid.Fid); /* use dnlc first xxx */ + code = afs_dir_Lookup(&tdc->f.inode, aname, &newFid.Fid); /* use dnlc first xxx */ if (code == 0) { + ReleaseSharedLock(&tdc->lock); afs_PutDCache(tdc); ReleaseWriteLock(&adp->lock); #ifdef AFS_SGI64_ENV @@ -159,20 +163,18 @@ tagain: #else if (aexcl != NONEXCL) { #endif - code = EEXIST; /* file exists in excl mode open */ + code = EEXIST; /* file exists in excl mode open */ goto done; } /* found the file, so use it */ newFid.Cell = adp->fid.Cell; newFid.Fid.Volume = adp->fid.Fid.Volume; - tvc = (struct vcache *)0; + tvc = NULL; if (newFid.Fid.Unique == 0) { - tvc = afs_LookupVCache(&newFid, &treq, (afs_int32 *)0, - WRITE_LOCK, adp, aname); + tvc = afs_LookupVCache(&newFid, &treq, NULL, adp, aname); } - if (!tvc) /* lookup failed or wasn't called */ - tvc = afs_GetVCache(&newFid, &treq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); + if (!tvc) /* lookup failed or wasn't called */ + tvc = afs_GetVCache(&newFid, &treq, NULL, NULL); if (tvc) { /* if the thing exists, we need the right access to open it. @@ -183,38 +185,38 @@ tagain: * We used to check always for READ access before; the * problem is that we will fail if the existing file * has mode -w-w-w, which is wrong. - */ - if ((amode & VREAD) && - !afs_AccessOK(tvc, PRSFS_READ, &treq, CHECK_MODE_BITS)) { - afs_PutVCache(tvc, READ_LOCK); - code = EACCES; - goto done; + */ + if ((amode & VREAD) + && !afs_AccessOK(tvc, PRSFS_READ, &treq, CHECK_MODE_BITS)) { + afs_PutVCache(tvc); + code = EACCES; + goto done; } - #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) - if ((amode & VWRITE) || (attrs->va_mask & AT_SIZE)) + if ((amode & VWRITE) || (attrs->va_mask & AT_SIZE)) #else - if ((amode & VWRITE) || len != 0xffffffff) + if ((amode & VWRITE) || len != 0xffffffff) #endif - { + { /* needed for write access check */ tvc->parentVnode = adp->fid.Fid.Vnode; tvc->parentUnique = adp->fid.Fid.Unique; /* need write mode for these guys */ - if (!afs_AccessOK(tvc, PRSFS_WRITE, &treq, CHECK_MODE_BITS)) { - afs_PutVCache(tvc, READ_LOCK); + if (!afs_AccessOK + (tvc, PRSFS_WRITE, &treq, CHECK_MODE_BITS)) { + afs_PutVCache(tvc); code = EACCES; goto done; } } #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) - if (attrs->va_mask & AT_SIZE) + if (attrs->va_mask & AT_SIZE) #else - if (len != 0xffffffff) + if (len != 0xffffffff) #endif - { + { if (vType(tvc) != VREG) { - afs_PutVCache(tvc, READ_LOCK); + afs_PutVCache(tvc); code = EISDIR; goto done; } @@ -225,30 +227,31 @@ tagain: VATTR_NULL(attrs); #endif attrs->va_size = len; - ObtainWriteLock(&tvc->lock,136); + ObtainWriteLock(&tvc->lock, 136); tvc->states |= CCreating; ReleaseWriteLock(&tvc->lock); #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) #if defined(AFS_SGI64_ENV) - code = afs_setattr(VNODE_TO_FIRST_BHV((vnode_t*)tvc), - attrs, 0, acred); + code = + afs_setattr(VNODE_TO_FIRST_BHV((vnode_t *) tvc), + attrs, 0, acred); #else code = afs_setattr(tvc, attrs, 0, acred); #endif /* AFS_SGI64_ENV */ #else /* SUN5 || SGI */ code = afs_setattr(tvc, attrs, acred); #endif /* SUN5 || SGI */ - ObtainWriteLock(&tvc->lock,137); + ObtainWriteLock(&tvc->lock, 137); tvc->states &= ~CCreating; ReleaseWriteLock(&tvc->lock); if (code) { - afs_PutVCache(tvc, 0); + afs_PutVCache(tvc); goto done; } } *avcp = tvc; - } - else code = ENOENT; /* shouldn't get here */ + } else + code = ENOENT; /* shouldn't get here */ /* make sure vrefCount bumped only if code == 0 */ goto done; } @@ -257,84 +260,86 @@ tagain: /* if we create the file, we don't do any access checks, since * that's how O_CREAT is supposed to work */ if (adp->states & CForeign) { - origCBs = afs_allCBs; - origZaps = afs_allZaps; + origCBs = afs_allCBs; + origZaps = afs_allZaps; } else { - origCBs = afs_evenCBs; /* if changes, we don't really have a callback */ - origZaps = afs_evenZaps; /* number of even numbered vnodes discarded */ + origCBs = afs_evenCBs; /* if changes, we don't really have a callback */ + origZaps = afs_evenZaps; /* number of even numbered vnodes discarded */ } InStatus.Mask = AFS_SETMODTIME | AFS_SETMODE | AFS_SETGROUP; InStatus.ClientModTime = osi_Time(); - InStatus.Group = (afs_int32)acred->cr_gid; + InStatus.Group = (afs_int32) acred->cr_gid; if (AFS_NFSXLATORREQ(acred)) { /* * XXX The following is mainly used to fix a bug in the HP-UX * nfs client where they create files with mode of 0 without * doing any setattr later on to fix it. * XXX - */ + */ #if defined(AFS_AIX_ENV) if (attrs->va_mode != -1) { #else #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) - if (attrs->va_mask & AT_MODE) { + if (attrs->va_mask & AT_MODE) { #else if (attrs->va_mode != ((unsigned short)-1)) { #endif #endif if (!attrs->va_mode) - attrs->va_mode = 0x1b6; /* XXX default mode: rw-rw-rw XXX */ + attrs->va_mode = 0x1b6; /* XXX default mode: rw-rw-rw XXX */ } } - InStatus.UnixModeBits = attrs->va_mode & 0xffff; /* only care about protection bits */ + InStatus.UnixModeBits = attrs->va_mode & 0xffff; /* only care about protection bits */ do { tc = afs_Conn(&adp->fid, &treq, SHARED_LOCK); if (tc) { - hostp = tc->srvr->server; /* remember for callback processing */ + hostp = tc->srvr->server; /* remember for callback processing */ now = osi_Time(); XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_CREATEFILE); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_CreateFile(tc->id, (struct AFSFid *) &adp->fid.Fid, - aname, &InStatus, (struct AFSFid *) - &newFid.Fid, &OutFidStatus, - &OutDirStatus, &CallBack, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); + code = + RXAFS_CreateFile(tc->id, (struct AFSFid *)&adp->fid.Fid, + aname, &InStatus, (struct AFSFid *) + &newFid.Fid, &OutFidStatus, &OutDirStatus, + &CallBack, &tsync); + RX_AFS_GLOCK(); XSTATS_END_TIME; CallBack.ExpirationTime += now; - } - else code = -1; - } while - (afs_Analyze(tc, code, &adp->fid, &treq, - AFS_STATS_FS_RPCIDX_CREATEFILE, SHARED_LOCK, (struct cell *)0)); + } else + code = -1; + } while (afs_Analyze + (tc, code, &adp->fid, &treq, AFS_STATS_FS_RPCIDX_CREATEFILE, + SHARED_LOCK, NULL)); #if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) if (code == EEXIST && aexcl == NONEXCL) { /* This lookup was handled in the common vn_open code in the - vnode layer */ - if (tdc) afs_PutDCache(tdc); + * vnode layer */ + if (tdc) { + ReleaseSharedLock(&tdc->lock); + afs_PutDCache(tdc); + } ReleaseWriteLock(&adp->lock); goto done; } -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ #ifdef AFS_SGI64_ENV if (code == EEXIST && !(flags & VEXCL)) { #else /* AFS_SGI64_ENV */ if (code == EEXIST && aexcl == NONEXCL) { #endif /* AFS_SGI64_ENV */ /* if we get an EEXIST in nonexcl mode, just do a lookup */ - if (tdc) afs_PutDCache(tdc); + if (tdc) { + ReleaseSharedLock(&tdc->lock); + afs_PutDCache(tdc); + } ReleaseWriteLock(&adp->lock); #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) #if defined(AFS_SGI64_ENV) - code = afs_lookup(VNODE_TO_FIRST_BHV((vnode_t*)adp), aname, avcp, - (struct pathname *)0, 0, - (struct vnode *)0, acred); + code = + afs_lookup(VNODE_TO_FIRST_BHV((vnode_t *) adp), aname, avcp, NULL, + 0, NULL, acred); #else - code = afs_lookup(adp, aname, avcp, (struct pathname *)0, 0, - (struct vnode *)0, acred); + code = afs_lookup(adp, aname, avcp, NULL, 0, NULL, acred); #endif /* AFS_SGI64_ENV */ #else /* SUN5 || SGI */ code = afs_lookup(adp, aname, avcp, acred); @@ -344,26 +349,32 @@ tagain: #endif /* AFS_OSF_ENV */ if (code) { if (code < 0) { - ObtainWriteLock(&afs_xcbhash, 488); - afs_DequeueCallback(adp); - adp->states &= ~CStatd; - ReleaseWriteLock(&afs_xcbhash); - osi_dnlc_purgedp(adp); + ObtainWriteLock(&afs_xcbhash, 488); + afs_DequeueCallback(adp); + adp->states &= ~CStatd; + ReleaseWriteLock(&afs_xcbhash); + osi_dnlc_purgedp(adp); } ReleaseWriteLock(&adp->lock); - if (tdc) afs_PutDCache(tdc); + if (tdc) { + ReleaseSharedLock(&tdc->lock); + afs_PutDCache(tdc); + } goto done; } /* otherwise, we should see if we can make the change to the dir locally */ + if (tdc) + UpgradeSToWLock(&tdc->lock, 631); if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) { /* we can do it locally */ code = afs_dir_Create(&tdc->f.inode, aname, &newFid.Fid); if (code) { - ZapDCE(tdc); - DZap(&tdc->f.inode); + ZapDCE(tdc); + DZap(&tdc->f.inode); } } if (tdc) { + ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); } newFid.Cell = adp->fid.Cell; @@ -372,39 +383,38 @@ tagain: volp = afs_FindVolume(&newFid, READ_LOCK); /* New tricky optimistic callback handling algorithm for file creation works - as follows. We create the file essentially with no locks set at all. File - server may thus handle operations from others cache managers as well as from - this very own cache manager that reference the file in question before - we managed to create the cache entry. However, if anyone else changes - any of the status information for a file, we'll see afs_evenCBs increase - (files always have even fids). If someone on this workstation manages - to do something to the file, they'll end up having to create a cache - entry for the new file. Either we'll find it once we've got the afs_xvcache - lock set, or it was also *deleted* the vnode before we got there, in which case - we will find evenZaps has changed, too. Thus, we only assume we have the right - status information if no callbacks or vnode removals have occurred to even - numbered files from the time the call started until the time that we got the xvcache - lock set. Of course, this also assumes that any call that modifies a file first - gets a write lock on the file's vnode, but if that weren't true, the whole cache manager - would fail, since no call would be able to update the local vnode status after modifying - a file on a file server. */ - ObtainWriteLock(&afs_xvcache,138); - if (adp->states & CForeign) - finalZaps = afs_allZaps; /* do this before calling newvcache */ + * as follows. We create the file essentially with no locks set at all. File + * server may thus handle operations from others cache managers as well as from + * this very own cache manager that reference the file in question before + * we managed to create the cache entry. However, if anyone else changes + * any of the status information for a file, we'll see afs_evenCBs increase + * (files always have even fids). If someone on this workstation manages + * to do something to the file, they'll end up having to create a cache + * entry for the new file. Either we'll find it once we've got the afs_xvcache + * lock set, or it was also *deleted* the vnode before we got there, in which case + * we will find evenZaps has changed, too. Thus, we only assume we have the right + * status information if no callbacks or vnode removals have occurred to even + * numbered files from the time the call started until the time that we got the xvcache + * lock set. Of course, this also assumes that any call that modifies a file first + * gets a write lock on the file's vnode, but if that weren't true, the whole cache manager + * would fail, since no call would be able to update the local vnode status after modifying + * a file on a file server. */ + ObtainWriteLock(&afs_xvcache, 138); + if (adp->states & CForeign) + finalZaps = afs_allZaps; /* do this before calling newvcache */ else - finalZaps = afs_evenZaps; /* do this before calling newvcache */ + finalZaps = afs_evenZaps; /* do this before calling newvcache */ /* don't need to call RemoveVCB, since only path leaving a callback is the - one where we pass through afs_NewVCache. Can't have queued a VCB unless - we created and freed an entry between file creation time and here, and the - freeing of the vnode will change evenZaps. Don't need to update the VLRU - queue, since the find will only succeed in the event of a create race, and - then the vcache will be at the front of the VLRU queue anyway... */ - if (!(tvc = afs_FindVCache(&newFid, 0, WRITE_LOCK, - 0, DO_STATS))) { - tvc = afs_NewVCache(&newFid, hostp, 0, WRITE_LOCK); + * one where we pass through afs_NewVCache. Can't have queued a VCB unless + * we created and freed an entry between file creation time and here, and the + * freeing of the vnode will change evenZaps. Don't need to update the VLRU + * queue, since the find will only succeed in the event of a create race, and + * then the vcache will be at the front of the VLRU queue anyway... */ + if (!(tvc = afs_FindVCache(&newFid, 0, DO_STATS))) { + tvc = afs_NewVCache(&newFid, hostp); if (tvc) { int finalCBs; - ObtainWriteLock(&tvc->lock,139); + ObtainWriteLock(&tvc->lock, 139); ObtainWriteLock(&afs_xcbhash, 489); finalCBs = afs_evenCBs; @@ -414,42 +424,40 @@ tagain: finalCBs = afs_allCBs; } if (origCBs == finalCBs && origZaps == finalZaps) { - tvc->states |= CStatd; /* we've fake entire thing, so don't stat */ + tvc->states |= CStatd; /* we've fake entire thing, so don't stat */ tvc->states &= ~CBulkFetching; tvc->cbExpires = CallBack.ExpirationTime; afs_QueueCallback(tvc, CBHash(CallBack.ExpirationTime), volp); - } - else { - afs_DequeueCallback(tvc); - tvc->states &= ~(CStatd | CUnique); - tvc->callback = 0; - if (tvc->fid.Fid.Vnode & 1 || (vType(tvc) == VDIR)) - osi_dnlc_purgedp(tvc); + } else { + afs_DequeueCallback(tvc); + tvc->states &= ~(CStatd | CUnique); + tvc->callback = 0; + if (tvc->fid.Fid.Vnode & 1 || (vType(tvc) == VDIR)) + osi_dnlc_purgedp(tvc); } ReleaseWriteLock(&afs_xcbhash); afs_ProcessFS(tvc, &OutFidStatus, &treq); ReleaseWriteLock(&tvc->lock); *avcp = tvc; code = 0; - } - else code = ENOENT; - } - else { - /* otherwise cache entry already exists, someone else must - * have created it. Comments used to say: "don't need write - * lock to *clear* these flags" but we should do it anyway. - * Code used to clear stat bit and callback, but I don't see - * the point -- we didn't have a create race, somebody else just - * snuck into NewVCache before we got here, probably a racing - * lookup. - */ + } else + code = ENOENT; + } else { + /* otherwise cache entry already exists, someone else must + * have created it. Comments used to say: "don't need write + * lock to *clear* these flags" but we should do it anyway. + * Code used to clear stat bit and callback, but I don't see + * the point -- we didn't have a create race, somebody else just + * snuck into NewVCache before we got here, probably a racing + * lookup. + */ *avcp = tvc; code = 0; } ReleaseWriteLock(&afs_xvcache); -done: - if ( volp ) + done: + if (volp) afs_PutVolume(volp, READ_LOCK); if (code == 0) { @@ -457,7 +465,6 @@ done: /* return the new status in vattr */ afs_CopyOutAttrs(*avcp, attrs); } - #ifdef AFS_OSF_ENV if (!code && !strcmp(aname, "core")) tvc->states |= CCore1; @@ -466,10 +473,10 @@ done: afs_PutFakeStat(&fakestate); code = afs_CheckCode(code, &treq, 20); -done2: + done2: #ifdef AFS_OSF_ENV - afs_PutVCache(adp, 0); -#endif /* AFS_OSF_ENV */ + afs_PutVCache(adp); +#endif /* AFS_OSF_ENV */ return code; } @@ -482,13 +489,13 @@ done2: * data and stat cache entries. This routine returns 1 if we should * do the operation locally, and 0 otherwise. * - * This routine must be called with the stat cache entry write-locked. + * This routine must be called with the stat cache entry write-locked, + * and dcache entry write-locked. */ -afs_LocalHero(avc, adc, astat, aincr) - register struct vcache *avc; - register AFSFetchStatus *astat; - register struct dcache *adc; - register int aincr; { +int +afs_LocalHero(register struct vcache *avc, register struct dcache *adc, + register AFSFetchStatus * astat, register int aincr) +{ register afs_int32 ok; afs_hyper_t avers; @@ -496,29 +503,31 @@ afs_LocalHero(avc, adc, astat, aincr) hset64(avers, astat->dataVersionHigh, astat->DataVersion); /* this *is* the version number, no matter what */ if (adc) { - ok = (hsame(avc->m.DataVersion, adc->f.versionNo) && avc->callback + ok = (hsame(avc->m.DataVersion, adc->f.versionNo) && avc->callback && (avc->states & CStatd) && avc->cbExpires >= osi_Time()); - } - else { + } else { ok = 0; } #if defined(AFS_SGI_ENV) - osi_Assert(avc->v.v_type == VDIR); + osi_Assert(avc->v.v_type == VDIR); #endif /* The bulk status code used the length as a sequence number. */ /* Don't update the vcache entry unless the stats are current. */ if (avc->states & CStatd) { hset(avc->m.DataVersion, avers); +#ifdef AFS_64BIT_CLIENT + FillInt64(avc->m.Length, astat->Length_hi, astat->Length); +#else /* AFS_64BIT_ENV */ avc->m.Length = astat->Length; +#endif /* AFS_64BIT_ENV */ avc->m.Date = astat->ClientModTime; } if (ok) { /* we've been tracking things correctly */ - adc->flags |= DFEntryMod; + adc->dflags |= DFEntryMod; adc->f.versionNo = avers; return 1; - } - else { + } else { if (adc) { ZapDCE(adc); DZap(&adc->f.inode); diff --git a/src/afs/VNOPS/afs_vnop_dirops.c b/src/afs/VNOPS/afs_vnop_dirops.c index cb473ff47..bae4c0113 100644 --- a/src/afs/VNOPS/afs_vnop_dirops.c +++ b/src/afs/VNOPS/afs_vnop_dirops.c @@ -18,44 +18,48 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_dirops.c,v 1.1.1.6 2002/08/02 04:29:01 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_dirops.c,v 1.14 2003/08/29 22:00:04 rees Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" extern afs_rwlock_t afs_xvcache; extern afs_rwlock_t afs_xcbhash; /* don't set CDirty in here because RPC is called synchronously */ +int #ifdef AFS_OSF_ENV afs_mkdir(ndp, attrs) - struct nameidata *ndp; - struct vattr *attrs; { + struct nameidata *ndp; + struct vattr *attrs; +{ register struct vcache *adp = VTOAFS(ndp->ni_dvp); char *aname = ndp->ni_dent.d_name; register struct vcache **avcp = (struct vcache **)&(ndp->ni_vp); struct ucred *acred = ndp->ni_cred; -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ afs_mkdir(OSI_VC_ARG(adp), aname, attrs, avcp, acred) OSI_VC_DECL(adp); - register struct vcache **avcp; - char *aname; - struct vattr *attrs; - struct AFS_UCRED *acred; { + register struct vcache **avcp; + char *aname; + struct vattr *attrs; + struct AFS_UCRED *acred; +{ #endif struct vrequest treq; register afs_int32 code; register struct conn *tc; struct VenusFid newFid; register struct dcache *tdc; - afs_int32 offset, len; + afs_size_t offset, len; register struct vcache *tvc; struct AFSStoreStatus InStatus; struct AFSFetchStatus OutFidStatus, OutDirStatus; @@ -63,14 +67,13 @@ afs_mkdir(OSI_VC_ARG(adp), aname, attrs, avcp, acred) struct AFSVolSync tsync; afs_int32 now; struct afs_fakestat_state fakestate; - XSTATS_DECLS - OSI_VC_CONVERT(adp) + XSTATS_DECLS OSI_VC_CONVERT(adp) - AFS_STATCNT(afs_mkdir); + AFS_STATCNT(afs_mkdir); afs_Trace2(afs_iclSetp, CM_TRACE_MKDIR, ICL_TYPE_POINTER, adp, ICL_TYPE_STRING, aname); - if (code = afs_InitReq(&treq, acred)) + if ((code = afs_InitReq(&treq, acred))) goto done2; afs_InitFakeStat(&fakestate); @@ -84,69 +87,73 @@ afs_mkdir(OSI_VC_ARG(adp), aname, attrs, avcp, acred) goto done; } code = afs_EvalFakeStat(&adp, &fakestate, &treq); - if (code) goto done; + if (code) + goto done; code = afs_VerifyVCache(adp, &treq); - if (code) goto done; + if (code) + goto done; /** If the volume is read-only, return error without making an RPC to the * fileserver */ - if ( adp->states & CRO ) { - code = EROFS; - goto done; + if (adp->states & CRO) { + code = EROFS; + goto done; } InStatus.Mask = AFS_SETMODTIME | AFS_SETMODE | AFS_SETGROUP; InStatus.ClientModTime = osi_Time(); - InStatus.UnixModeBits = attrs->va_mode & 0xffff; /* only care about protection bits */ - InStatus.Group = (afs_int32)acred->cr_gid; - tdc = afs_GetDCache(adp, 0, &treq, &offset, &len, 1); - ObtainWriteLock(&adp->lock,153); + InStatus.UnixModeBits = attrs->va_mode & 0xffff; /* only care about protection bits */ + InStatus.Group = (afs_int32) acred->cr_gid; + tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1); + ObtainWriteLock(&adp->lock, 153); do { tc = afs_Conn(&adp->fid, &treq, SHARED_LOCK); if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_MAKEDIR); - now = osi_Time(); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_MakeDir(tc->id, (struct AFSFid *) &adp->fid.Fid, aname, - &InStatus, (struct AFSFid *) &newFid.Fid, - &OutFidStatus, &OutDirStatus, &CallBack, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_MAKEDIR); + now = osi_Time(); + RX_AFS_GUNLOCK(); + code = + RXAFS_MakeDir(tc->id, (struct AFSFid *)&adp->fid.Fid, aname, + &InStatus, (struct AFSFid *)&newFid.Fid, + &OutFidStatus, &OutDirStatus, &CallBack, + &tsync); + RX_AFS_GLOCK(); + XSTATS_END_TIME; CallBack.ExpirationTime += now; /* DON'T forget to Set the callback value... */ - } - else code = -1; - } while - (afs_Analyze(tc, code, &adp->fid, &treq, - AFS_STATS_FS_RPCIDX_MAKEDIR, SHARED_LOCK, (struct cell *)0)); + } else + code = -1; + } while (afs_Analyze + (tc, code, &adp->fid, &treq, AFS_STATS_FS_RPCIDX_MAKEDIR, + SHARED_LOCK, NULL)); if (code) { if (code < 0) { - ObtainWriteLock(&afs_xcbhash, 490); - afs_DequeueCallback(adp); - adp->states &= ~CStatd; - ReleaseWriteLock(&afs_xcbhash); - osi_dnlc_purgedp(adp); + ObtainWriteLock(&afs_xcbhash, 490); + afs_DequeueCallback(adp); + adp->states &= ~CStatd; + ReleaseWriteLock(&afs_xcbhash); + osi_dnlc_purgedp(adp); } ReleaseWriteLock(&adp->lock); - if (tdc) afs_PutDCache(tdc); + if (tdc) + afs_PutDCache(tdc); goto done; } /* otherwise, we should see if we can make the change to the dir locally */ + if (tdc) + ObtainWriteLock(&tdc->lock, 632); if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) { - /* we can do it locally */ - code = afs_dir_Create(&tdc->f.inode, aname, &newFid.Fid); - if (code) { + /* we can do it locally */ + code = afs_dir_Create(&tdc->f.inode, aname, &newFid.Fid); + if (code) { ZapDCE(tdc); /* surprise error -- use invalid value */ DZap(&tdc->f.inode); } } if (tdc) { + ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); } adp->m.LinkCount = OutDirStatus.LinkCount; @@ -154,59 +161,61 @@ afs_mkdir(OSI_VC_ARG(adp), aname, attrs, avcp, acred) newFid.Fid.Volume = adp->fid.Fid.Volume; ReleaseWriteLock(&adp->lock); /* now we're done with parent dir, create the real dir's cache entry */ - tvc = afs_GetVCache(&newFid, &treq, (afs_int32 *)0, (struct vcache*)0, 0); + tvc = afs_GetVCache(&newFid, &treq, NULL, NULL); if (tvc) { code = 0; *avcp = tvc; - } - else code = ENOENT; -done: + } else + code = ENOENT; + done: afs_PutFakeStat(&fakestate); code = afs_CheckCode(code, &treq, 26); -done2: + done2: #ifdef AFS_OSF_ENV AFS_RELE(ndp->ni_dvp); -#endif /* AFS_OSF_ENV */ +#endif /* AFS_OSF_ENV */ return code; } +int #ifdef AFS_OSF_ENV afs_rmdir(ndp) - struct nameidata *ndp; { + struct nameidata *ndp; +{ register struct vcache *adp = VTOAFS(ndp->ni_dvp); char *aname = ndp->ni_dent.d_name; struct ucred *acred = ndp->ni_cred; -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ /* don't set CDirty in here because RPC is called synchronously */ #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) afs_rmdir(OSI_VC_ARG(adp), aname, cdirp, acred) - struct vnode *cdirp; + struct vnode *cdirp; #else afs_rmdir(adp, aname, acred) #endif OSI_VC_DECL(adp); - char *aname; - struct AFS_UCRED *acred; { + char *aname; + struct AFS_UCRED *acred; +{ #endif struct vrequest treq; register struct dcache *tdc; - register struct vcache *tvc = (struct vcache *)0; + register struct vcache *tvc = NULL; register afs_int32 code; register struct conn *tc; - afs_int32 offset, len; + afs_size_t offset, len; struct AFSFetchStatus OutDirStatus; struct AFSVolSync tsync; struct afs_fakestat_state fakestate; - XSTATS_DECLS - OSI_VC_CONVERT(adp) + XSTATS_DECLS OSI_VC_CONVERT(adp) - AFS_STATCNT(afs_rmdir); + AFS_STATCNT(afs_rmdir); - afs_Trace2(afs_iclSetp, CM_TRACE_RMDIR, ICL_TYPE_POINTER, adp, + afs_Trace2(afs_iclSetp, CM_TRACE_RMDIR, ICL_TYPE_POINTER, adp, ICL_TYPE_STRING, aname); - if (code = afs_InitReq(&treq, acred)) + if ((code = afs_InitReq(&treq, acred))) goto done2; afs_InitFakeStat(&fakestate); @@ -218,36 +227,39 @@ afs_rmdir(adp, aname, acred) code = afs_EvalFakeStat(&adp, &fakestate, &treq); if (code) goto done; + code = afs_VerifyVCache(adp, &treq); - if (code) goto done; + if (code) + goto done; /** If the volume is read-only, return error without making an RPC to the * fileserver */ - if ( adp->states & CRO ) { - code = EROFS; - goto done; + if (adp->states & CRO) { + code = EROFS; + goto done; } - tdc = afs_GetDCache(adp, 0, &treq, &offset, &len, 1); /* test for error below */ - ObtainWriteLock(&adp->lock,154); + tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1); /* test for error below */ + ObtainWriteLock(&adp->lock, 154); + if (tdc) + ObtainSharedLock(&tdc->lock, 633); if (tdc && (adp->states & CForeign)) { struct VenusFid unlinkFid; unlinkFid.Fid.Vnode = 0; code = afs_dir_Lookup(&tdc->f.inode, aname, &unlinkFid.Fid); - if (code == 0) { - afs_int32 cached=0; + if (code == 0) { + afs_int32 cached = 0; unlinkFid.Cell = adp->fid.Cell; unlinkFid.Fid.Volume = adp->fid.Fid.Volume; if (unlinkFid.Fid.Unique == 0) { - tvc = afs_LookupVCache(&unlinkFid, &treq, &cached, - WRITE_LOCK, adp, aname); + tvc = + afs_LookupVCache(&unlinkFid, &treq, &cached, adp, aname); } else { ObtainReadLock(&afs_xvcache); - tvc = afs_FindVCache(&unlinkFid, 1, WRITE_LOCK, - 0, 1/* do xstats */); + tvc = afs_FindVCache(&unlinkFid, 0, 1 /* do xstats */ ); ReleaseReadLock(&afs_xvcache); } } @@ -256,72 +268,75 @@ afs_rmdir(adp, aname, acred) do { tc = afs_Conn(&adp->fid, &treq, SHARED_LOCK); if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_REMOVEDIR); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_RemoveDir(tc->id, (struct AFSFid *) &adp->fid.Fid, - aname, &OutDirStatus, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } - else code = -1; - } while - (afs_Analyze(tc, code, &adp->fid, &treq, - AFS_STATS_FS_RPCIDX_REMOVEDIR, SHARED_LOCK, (struct cell *)0)); + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_REMOVEDIR); + RX_AFS_GUNLOCK(); + code = + RXAFS_RemoveDir(tc->id, (struct AFSFid *)&adp->fid.Fid, aname, + &OutDirStatus, &tsync); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tc, code, &adp->fid, &treq, AFS_STATS_FS_RPCIDX_REMOVEDIR, + SHARED_LOCK, NULL)); if (code) { - if (tdc) afs_PutDCache(tdc); + if (tdc) { + ReleaseSharedLock(&tdc->lock); + afs_PutDCache(tdc); + } if (code < 0) { - ObtainWriteLock(&afs_xcbhash, 491); - afs_DequeueCallback(adp); - adp->states &= ~CStatd; - ReleaseWriteLock(&afs_xcbhash); - osi_dnlc_purgedp(adp); + ObtainWriteLock(&afs_xcbhash, 491); + afs_DequeueCallback(adp); + adp->states &= ~CStatd; + ReleaseWriteLock(&afs_xcbhash); + osi_dnlc_purgedp(adp); } ReleaseWriteLock(&adp->lock); goto done; } /* here if rpc worked; update the in-core link count */ adp->m.LinkCount = OutDirStatus.LinkCount; + if (tdc) + UpgradeSToWLock(&tdc->lock, 634); if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) { /* we can do it locally */ code = afs_dir_Delete(&tdc->f.inode, aname); - if (code) { + if (code) { ZapDCE(tdc); /* surprise error -- invalid value */ DZap(&tdc->f.inode); } } if (tdc) { + ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); /* drop ref count */ } if (tvc) { - osi_dnlc_purgedp (tvc); /* get rid of any entries for this directory */ + osi_dnlc_purgedp(tvc); /* get rid of any entries for this directory */ afs_symhint_inval(tvc); } else - osi_dnlc_remove (adp, aname, 0); + osi_dnlc_remove(adp, aname, 0); if (tvc) { - ObtainWriteLock(&tvc->lock,155); - tvc->states &= ~CUnique; /* For the dfs xlator */ + ObtainWriteLock(&tvc->lock, 155); + tvc->states &= ~CUnique; /* For the dfs xlator */ ReleaseWriteLock(&tvc->lock); - afs_PutVCache(tvc, WRITE_LOCK); + afs_PutVCache(tvc); } ReleaseWriteLock(&adp->lock); /* don't worry about link count since dirs can not be hardlinked */ code = 0; -done: + done: afs_PutFakeStat(&fakestate); - code = afs_CheckCode(code, &treq, 27); -done2: + code = afs_CheckCode(code, &treq, 27); + done2: #ifdef AFS_OSF_ENV - afs_PutVCache(adp, 0); - afs_PutVCache(ndp->ni_vp, 0); -#endif /* AFS_OSF_ENV */ + afs_PutVCache(adp); + afs_PutVCache(ndp->ni_vp); +#endif /* AFS_OSF_ENV */ return code; } diff --git a/src/afs/VNOPS/afs_vnop_fid.c b/src/afs/VNOPS/afs_vnop_fid.c index e35af21fa..67aa15f7e 100644 --- a/src/afs/VNOPS/afs_vnop_fid.c +++ b/src/afs/VNOPS/afs_vnop_fid.c @@ -15,21 +15,22 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_fid.c,v 1.1.1.7 2002/05/10 23:44:21 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_fid.c,v 1.11 2003/07/15 23:14:30 shadow Exp $"); -#if !defined(AFS_DUX40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#if !defined(AFS_DUX40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_OBSD_ENV) +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" -int afs_fid_vnodeoverflow=0, afs_fid_uniqueoverflow=0; +int afs_fid_vnodeoverflow = 0, afs_fid_uniqueoverflow = 0; /* * afs_fid @@ -64,19 +65,21 @@ int afs_iauth_initd = 0; #endif -extern int afs_NFSRootOnly; /* 1 => only allow NFS mounts of /afs. */ +extern int afs_NFSRootOnly; /* 1 => only allow NFS mounts of /afs. */ + +int #if !defined(AFS_DEC_ENV) && !defined(AFS_ATHENA_ENV) #ifdef AFS_AIX41_ENV afs_fid(OSI_VC_ARG(avc), fidpp, credp) - struct ucred *credp ; + struct ucred *credp; #else afs_fid(OSI_VC_ARG(avc), fidpp) -#endif /* AFS_AIX41_ENV */ +#endif /* AFS_AIX41_ENV */ OSI_VC_DECL(avc); #if defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN54_ENV) -struct fid *fidpp; + struct fid *fidpp; #else -struct fid **fidpp; + struct fid **fidpp; #endif { struct SmallFid Sfid; @@ -87,11 +90,13 @@ struct fid **fidpp; int rootvp = 0; OSI_VC_CONVERT(avc) - AFS_STATCNT(afs_fid); + AFS_STATCNT(afs_fid); - if (afs_shuttingdown) return EIO; + if (afs_shuttingdown) + return EIO; - if (afs_NFSRootOnly && (avc == afs_globalVp)) rootvp = 1; + if (afs_NFSRootOnly && (avc == afs_globalVp)) + rootvp = 1; if (!afs_NFSRootOnly || rootvp #ifdef AFS_AIX41_ENV || USE_SMALLFID(credp) @@ -99,9 +104,9 @@ struct fid **fidpp; ) { tcell = afs_GetCell(avc->fid.Cell, READ_LOCK); Sfid.Volume = avc->fid.Fid.Volume; - Sfid.Vnode = avc->fid.Fid.Vnode; - Sfid.CellAndUnique = ((tcell->cellIndex << 24) + - (avc->fid.Fid.Unique & 0xffffff)); + Sfid.Vnode = avc->fid.Fid.Vnode; + Sfid.CellAndUnique = + ((tcell->cellIndex << 24) + (avc->fid.Fid.Unique & 0xffffff)); afs_PutCell(tcell, READ_LOCK); if (avc->fid.Fid.Vnode > 0xffff) afs_fid_vnodeoverflow++; @@ -109,7 +114,7 @@ struct fid **fidpp; afs_fid_uniqueoverflow++; } else { #if defined(AFS_SUN57_64BIT_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZPTR == 64)) - addr[1] = (long)AFS_XLATOR_MAGIC << 48 ; + addr[1] = (long)AFS_XLATOR_MAGIC << 48; #else /* defined(AFS_SGI61_ENV) && (_MIPS_SZPTR == 64) */ addr[1] = AFS_XLATOR_MAGIC; SizeOfSmallFid = sizeof(addr); @@ -127,25 +132,25 @@ struct fid **fidpp; if (afs_NFSRootOnly) { if (rootvp #ifdef AFS_AIX41_ENV - || USE_SMALLFID(credp) + || USE_SMALLFID(credp) #endif ) { - memcpy(fidpp->fid_data, (caddr_t)&Sfid, SizeOfSmallFid); + memcpy(fidpp->fid_data, (caddr_t) & Sfid, SizeOfSmallFid); } else { - memcpy(fidpp->fid_data, (caddr_t)addr, SizeOfSmallFid); + memcpy(fidpp->fid_data, (caddr_t) addr, SizeOfSmallFid); } } else { - memcpy(fidpp->fid_data, (caddr_t)&Sfid, SizeOfSmallFid); + memcpy(fidpp->fid_data, (caddr_t) & Sfid, SizeOfSmallFid); } #else /* malloc a fid pointer ourselves. */ - *fidpp = (struct fid *) AFS_KALLOC(SizeOfSmallFid+2); + *fidpp = (struct fid *)AFS_KALLOC(SizeOfSmallFid + 2); (*fidpp)->fid_len = SizeOfSmallFid; if (afs_NFSRootOnly) { if (rootvp) { memcpy((*fidpp)->fid_data, (char *)&Sfid, SizeOfSmallFid); } else { - memcpy((*fidpp)->fid_data, (char *)addr, SizeOfSmallFid); + memcpy((*fidpp)->fid_data, (char *)addr, SizeOfSmallFid); } } else { memcpy((*fidpp)->fid_data, (char *)&Sfid, SizeOfSmallFid); diff --git a/src/afs/VNOPS/afs_vnop_flock.c b/src/afs/VNOPS/afs_vnop_flock.c index 23e8685c2..ea9e0572d 100644 --- a/src/afs/VNOPS/afs_vnop_flock.c +++ b/src/afs/VNOPS/afs_vnop_flock.c @@ -13,38 +13,36 @@ */ #include -#include "../afs/param.h" - -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.1.1.11 2002/09/26 18:58:22 hartmans Exp $"); - -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" - -#if defined(AFS_HPUX102_ENV) -#define AFS_FLOCK k_flock -#else -#if defined(AFS_SUN56_ENV) || defined(AFS_LINUX24_ENV) -#define AFS_FLOCK flock64 -#else -#define AFS_FLOCK flock -#endif /* AFS_SUN65_ENV */ -#endif /* AFS_HPUX102_ENV */ - +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.24 2003/07/15 23:14:30 shadow Exp $"); + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" + +/* Static prototypes */ +static int HandleGetLock(register struct vcache *avc, + register struct AFS_FLOCK *af, + register struct vrequest *areq, int clid); static int GetFlockCount(struct vcache *avc, struct vrequest *areq); - -void lockIdSet(flock, slp, clid) - int clid; /* non-zero on SGI, OSF, SunOS, Darwin, xBSD *//* XXX ptr type */ - struct SimpleLocks *slp; - struct AFS_FLOCK *flock; +static int lockIdcmp2(struct AFS_FLOCK *flock1, struct vcache *vp, + register struct SimpleLocks *alp, int onlymine, + int clid); +static void DoLockWarning(void); + +/* int clid; * non-zero on SGI, OSF, SunOS, Darwin, xBSD ** XXX ptr type */ +void +lockIdSet(struct AFS_FLOCK *flock, struct SimpleLocks *slp, int clid) { #if defined(AFS_SUN5_ENV) - register proc_t *procp = ttoproc(curthread); + register proc_t *procp = ttoproc(curthread); #else -#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) +#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) #ifdef AFS_SGI_ENV struct proc *procp = OSI_GET_CURRENT_PROCP(); #else @@ -80,17 +78,17 @@ void lockIdSet(flock, slp, clid) #ifdef AFS_SGI65_ENV slp->sysid = flid.fl_sysid; #else - slp->sysid = OSI_GET_CURRENT_SYSID(); + slp->sysid = OSI_GET_CURRENT_SYSID(); #endif - slp->pid = clid; + slp->pid = clid; #else -#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) slp->pid = clid; #else #if defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV) slp->pid = getpid(); #else - slp->pid = u.u_procp->p_pid; + slp->pid = u.u_procp->p_pid; #endif #endif #endif /* AFS_AIX_ENV */ @@ -119,11 +117,11 @@ void lockIdSet(flock, slp, clid) #ifdef AFS_SGI65_ENV flock->l_sysid = flid.fl_sysid; #else - flock->l_sysid = OSI_GET_CURRENT_SYSID(); + flock->l_sysid = OSI_GET_CURRENT_SYSID(); #endif - flock->l_pid = clid; + flock->l_pid = clid; #else -#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) flock->l_pid = clid; #else #if defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV) @@ -135,8 +133,8 @@ void lockIdSet(flock, slp, clid) #endif #endif /* AFS_AIX_ENV */ #endif /* AFS_AIX32_ENV */ - } -} + } +} /* return 1 (true) if specified flock does not match alp (if * specified), or any of the slp structs (if alp == 0) @@ -146,19 +144,18 @@ void lockIdSet(flock, slp, clid) * to p_ppid? Especially in the context of the lower loop, where * the repeated comparison doesn't make much sense... */ -static int lockIdcmp2(flock1, vp, alp, onlymine, clid) - struct AFS_FLOCK *flock1; - struct vcache *vp; - register struct SimpleLocks *alp; - int onlymine; /* don't match any locks which are held by my */ - /* parent */ - int clid; /* Only Irix 6.5 for now. */ +/* onlymine - don't match any locks which are held by my parent */ +/* clid - only irix 6.5 */ + +static int +lockIdcmp2(struct AFS_FLOCK *flock1, struct vcache *vp, + register struct SimpleLocks *alp, int onlymine, int clid) { register struct SimpleLocks *slp; #if defined(AFS_SUN5_ENV) - register proc_t *procp = ttoproc(curthread); + register proc_t *procp = ttoproc(curthread); #else -#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) +#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) #ifdef AFS_SGI64_ENV struct proc *procp = curprocp; #else /* AFS_SGI64_ENV */ @@ -166,42 +163,41 @@ static int lockIdcmp2(flock1, vp, alp, onlymine, clid) #endif /* AFS_SGI64_ENV */ #endif #endif - int code = 0; if (alp) { #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) - if (flock1->l_sysid != alp->sysid) { - return 1; - } + if (flock1->l_sysid != alp->sysid) { + return 1; + } #endif - if ((flock1->l_pid == alp->pid) || + if ((flock1->l_pid == alp->pid) || #if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV) - (!onlymine && (flock1->l_pid == getppid())) + (!onlymine && (flock1->l_pid == getppid())) #else -#if defined(AFS_SGI65_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - /* XXX check this. used to be *only* irix for some reason. */ - (!onlymine && (flock1->l_pid == clid)) +#if defined(AFS_SGI65_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + /* XXX check this. used to be *only* irix for some reason. */ + (!onlymine && (flock1->l_pid == clid)) #else - (!onlymine && (flock1->l_pid == procp->p_ppid)) + (!onlymine && (flock1->l_pid == procp->p_ppid)) #endif #endif - ) { - return 0; - } - return 1; + ) { + return 0; + } + return 1; } for (slp = vp->slocks; slp; slp = slp->next) { -#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) +#if defined(AFS_HAVE_FLOCK_SYSID) if (flock1->l_sysid != slp->sysid) { - continue; + continue; } #endif if (flock1->l_pid == slp->pid) { return 0; - } + } } - return (1); /* failure */ + return (1); /* failure */ } @@ -219,115 +215,105 @@ static int lockIdcmp2(flock1, vp, alp, onlymine, clid) file, I guess we'll permit it. however, we don't want simple, innocent closes by children to unlock files in the parent process. */ -HandleFlock(avc, acom, areq, clid, onlymine) - pid_t clid; /* non-zero on SGI, SunOS, OSF1 only */ - register struct vcache *avc; - struct vrequest *areq; - int onlymine; - int acom; { +/* clid - nonzero on sgi sunos osf1 only */ +int +HandleFlock(register struct vcache *avc, int acom, struct vrequest *areq, + pid_t clid, int onlymine) +{ struct conn *tc; struct SimpleLocks *slp, *tlp, **slpp; afs_int32 code; struct AFSVolSync tsync; afs_int32 lockType; struct AFS_FLOCK flock; - XSTATS_DECLS - - AFS_STATCNT(HandleFlock); - code = 0; /* default when we don't make any network calls */ - lockIdSet(&flock, (struct SimpleLocks *)0, clid); + XSTATS_DECLS AFS_STATCNT(HandleFlock); + code = 0; /* default when we don't make any network calls */ + lockIdSet(&flock, NULL, clid); #if defined(AFS_SGI_ENV) osi_Assert(valusema(&avc->vc_rwlock) <= 0); osi_Assert(OSI_GET_LOCKID() == avc->vc_rwlockid); #endif - ObtainWriteLock(&avc->lock,118); + ObtainWriteLock(&avc->lock, 118); if (acom & LOCK_UN) { /* defect 3083 */ #ifdef AFS_AIX_ENV /* If the lock is held exclusive, then only the owning process - * or a child can unlock it. Use pid and ppid because they are - * unique identifiers. + * or a child can unlock it. Use pid and ppid because they are + * unique identifiers. */ if ((avc->flockCount < 0) && (getpid() != avc->ownslock)) { #ifdef AFS_AIX41_ENV - if (onlymine || (getppid() != avc->ownslock)) { + if (onlymine || (getppid() != avc->ownslock)) { #else - if (onlymine || (u.u_procp->p_ppid != avc->ownslock)) { + if (onlymine || (u.u_procp->p_ppid != avc->ownslock)) { +#endif + ReleaseWriteLock(&avc->lock); + return 0; + } + } #endif + if (lockIdcmp2(&flock, avc, NULL, onlymine, clid)) { ReleaseWriteLock(&avc->lock); return 0; - } } -#endif - if (lockIdcmp2(&flock, avc, (struct SimpleLocks *)0, onlymine, clid)) { - ReleaseWriteLock(&avc->lock); - return 0; - } #ifdef AFS_AIX_ENV - avc->ownslock = 0; -#endif - if (avc->flockCount == 0) { - ReleaseWriteLock(&avc->lock); - return 0 /*ENOTTY*/; - /* no lock held */ - } - /* unlock the lock */ + avc->ownslock = 0; +#endif + if (avc->flockCount == 0) { + ReleaseWriteLock(&avc->lock); + return 0 /*ENOTTY*/; + /* no lock held */ + } + /* unlock the lock */ if (avc->flockCount > 0) { - slpp = &avc->slocks; - for (slp = *slpp; slp;) { - if (!lockIdcmp2(&flock, avc, slp, onlymine, clid)) { - avc->flockCount--; - tlp = *slpp = slp->next; - osi_FreeSmallSpace(slp); - slp = tlp; - } else { - slpp = &slp->next; - slp = *slpp; - } - } - } - else if (avc->flockCount == -1) { - afs_StoreAllSegments(avc, areq, AFS_ASYNC); /* fsync file early */ - avc->flockCount = 0; - /* And remove the (only) exclusive lock entry from the list... */ - osi_FreeSmallSpace(avc->slocks); - avc->slocks = 0; - } - if (avc->flockCount == 0) { - do { - tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); - if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_RELEASELOCK); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_ReleaseLock(tc->id, (struct AFSFid *) - &avc->fid.Fid, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; + slpp = &avc->slocks; + for (slp = *slpp; slp;) { + if (!lockIdcmp2(&flock, avc, slp, onlymine, clid)) { + avc->flockCount--; + tlp = *slpp = slp->next; + osi_FreeSmallSpace(slp); + slp = tlp; + } else { + slpp = &slp->next; + slp = *slpp; } - else code = -1; - } while - (afs_Analyze(tc, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_RELEASELOCK, - SHARED_LOCK, (struct cell *)0)); + } + } else if (avc->flockCount == -1) { + afs_StoreAllSegments(avc, areq, AFS_ASYNC); /* fsync file early */ + avc->flockCount = 0; + /* And remove the (only) exclusive lock entry from the list... */ + osi_FreeSmallSpace(avc->slocks); + avc->slocks = 0; } - } - else { - while (1) { /* set a new lock */ + if (avc->flockCount == 0) { + do { + tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); + if (tc) { + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_RELEASELOCK); + RX_AFS_GUNLOCK(); + code = RXAFS_ReleaseLock(tc->id, (struct AFSFid *) + &avc->fid.Fid, &tsync); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tc, code, &avc->fid, areq, + AFS_STATS_FS_RPCIDX_RELEASELOCK, SHARED_LOCK, NULL)); + } + } else { + while (1) { /* set a new lock */ /* * Upgrading from shared locks to Exclusive and vice versa - * is a bit tricky and we don't really support it yet. But - * we try to support the common used one which is upgrade - * a shared lock to an exclusive for the same process... - */ - if ((avc->flockCount > 0 && (acom & LOCK_EX)) || - (avc->flockCount == -1 && (acom & LOCK_SH))) { + * is a bit tricky and we don't really support it yet. But + * we try to support the common used one which is upgrade + * a shared lock to an exclusive for the same process... + */ + if ((avc->flockCount > 0 && (acom & LOCK_EX)) + || (avc->flockCount == -1 && (acom & LOCK_SH))) { /* * Upgrading from shared locks to an exclusive one: * For now if all the shared locks belong to the @@ -340,7 +326,8 @@ HandleFlock(avc, acom, areq, clid, onlymine) */ slpp = &avc->slocks; for (slp = *slpp; slp;) { - if (!lockIdcmp2(&flock, avc, slp, 1/*!onlymine*/, clid)) { + if (!lockIdcmp2 + (&flock, avc, slp, 1 /*!onlymine */ , clid)) { if (acom & LOCK_EX) avc->flockCount--; else @@ -354,77 +341,73 @@ HandleFlock(avc, acom, areq, clid, onlymine) slp = *slpp; } } - if (!code && avc->flockCount == 0) { + if (!code && avc->flockCount == 0) { do { tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_RELEASELOCK); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_ReleaseLock(tc->id, - (struct AFSFid *) &avc->fid.Fid, - &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } - else code = -1; - } while - (afs_Analyze(tc, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_RELEASELOCK, - SHARED_LOCK, (struct cell *)0)); + XSTATS_START_TIME + (AFS_STATS_FS_RPCIDX_RELEASELOCK); + RX_AFS_GUNLOCK(); + code = + RXAFS_ReleaseLock(tc->id, + (struct AFSFid *)&avc->fid. + Fid, &tsync); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tc, code, &avc->fid, areq, + AFS_STATS_FS_RPCIDX_RELEASELOCK, SHARED_LOCK, + NULL)); } } else if (avc->flockCount == -1 && (acom & LOCK_EX)) { - if (lockIdcmp2(&flock, avc, (struct SimpleLocks *)0, 1, clid)) { + if (lockIdcmp2(&flock, avc, NULL, 1, clid)) { code = EWOULDBLOCK; } else code = 0; } if (code == 0) { /* compatible here, decide if needs to go to file server. If - we've already got the file locked (and thus read-locked, since - we've already checked for compatibility), we shouldn't send - the call through to the server again */ + * we've already got the file locked (and thus read-locked, since + * we've already checked for compatibility), we shouldn't send + * the call through to the server again */ if (avc->flockCount == 0) { /* we're the first on our block, send the call through */ - lockType = ((acom & LOCK_EX)? LockWrite : LockRead); + lockType = ((acom & LOCK_EX) ? LockWrite : LockRead); do { tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_SETLOCK); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_SetLock(tc->id, (struct AFSFid *) - &avc->fid.Fid, lockType, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } - else code = -1; - } while - (afs_Analyze(tc, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_SETLOCK, - SHARED_LOCK, (struct cell *)0)); - } - else code = 0; /* otherwise, pretend things worked */ + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_SETLOCK); + RX_AFS_GUNLOCK(); + code = RXAFS_SetLock(tc->id, (struct AFSFid *) + &avc->fid.Fid, lockType, + &tsync); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tc, code, &avc->fid, areq, + AFS_STATS_FS_RPCIDX_SETLOCK, SHARED_LOCK, + NULL)); + } else + code = 0; /* otherwise, pretend things worked */ } if (code == 0) { - slp = (struct SimpleLocks *) osi_AllocSmallSpace(sizeof(struct SimpleLocks)); + slp = (struct SimpleLocks *) + osi_AllocSmallSpace(sizeof(struct SimpleLocks)); if (acom & LOCK_EX) { /* defect 3083 */ #ifdef AFS_AIX_ENV - /* Record unique id of process owning exclusive lock. */ - avc->ownslock = getpid(); + /* Record unique id of process owning exclusive lock. */ + avc->ownslock = getpid(); #endif slp->type = LockWrite; - slp->next = (struct SimpleLocks *)0; + slp->next = NULL; avc->slocks = slp; avc->flockCount = -1; } else { @@ -438,66 +421,64 @@ HandleFlock(avc, acom, areq, clid, onlymine) break; } /* now, if we got EWOULDBLOCK, and we're supposed to wait, we do */ - if(((code == EWOULDBLOCK)||(code == EAGAIN)) && !(acom & LOCK_NB)) { + if (((code == EWOULDBLOCK) || (code == EAGAIN)) + && !(acom & LOCK_NB)) { /* sleep for a second, allowing interrupts */ ReleaseWriteLock(&avc->lock); #if defined(AFS_SGI_ENV) - AFS_RWUNLOCK((vnode_t *)avc, VRWLOCK_WRITE); + AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_WRITE); #endif - code = afs_osi_Wait(1000, (struct afs_osi_WaitHandle *) 0, 1); + code = afs_osi_Wait(1000, NULL, 1); #if defined(AFS_SGI_ENV) - AFS_RWLOCK((vnode_t *)avc, VRWLOCK_WRITE); + AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE); #endif - ObtainWriteLock(&avc->lock,120); + ObtainWriteLock(&avc->lock, 120); if (code) { code = EINTR; /* return this if ^C typed */ break; } - } - else break; - } /* while loop */ + } else + break; + } /* while loop */ } ReleaseWriteLock(&avc->lock); - code = afs_CheckCode(code, areq, 1); /* defeat a buggy AIX optimization */ + code = afs_CheckCode(code, areq, 1); /* defeat a buggy AIX optimization */ return code; } /* warn a user that a lock has been ignored */ -afs_int32 lastWarnTime = 0; -static void DoLockWarning() { +afs_int32 lastWarnTime = 0; /* this is used elsewhere */ +static void +DoLockWarning(void) +{ register afs_int32 now; now = osi_Time(); AFS_STATCNT(DoLockWarning); /* check if we've already warned someone recently */ - if (now < lastWarnTime + 120) return; + if (now < lastWarnTime + 120) + return; /* otherwise, it is time to nag the user */ lastWarnTime = now; - afs_warn("afs: byte-range lock/unlock ignored; make sure no one else is running this program.\n"); + afs_warn + ("afs: byte-range lock/unlock ignored; make sure no one else is running this program.\n"); } #ifdef AFS_OSF_ENV -afs_lockctl(avc, af, flag, acred, clid, offset) -struct eflock *af; -int flag; -pid_t clid; -off_t offset; -#else -#if defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) -afs_lockctl(avc, af, acmd, acred, clid) -pid_t clid; +afs_lockctl(struct vcache * avc, struct eflock * af, int flag, + struct AFS_UCRED * acred, pid_t clid, off_t offset) +#elif defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, + struct AFS_UCRED * acred, pid_t clid) #else -u_int clid=0; -afs_lockctl(avc, af, acmd, acred) +u_int clid = 0; +afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, + struct AFS_UCRED * acred) #endif -struct AFS_FLOCK *af; -int acmd; -#endif -struct vcache *avc; -struct AFS_UCRED *acred; { +{ struct vrequest treq; afs_int32 code; #ifdef AFS_OSF_ENV @@ -506,7 +487,8 @@ struct AFS_UCRED *acred; { struct afs_fakestat_state fakestate; AFS_STATCNT(afs_lockctl); - if (code = afs_InitReq(&treq, acred)) return code; + if ((code = afs_InitReq(&treq, acred))) + return code; afs_InitFakeStat(&fakestate); code = afs_EvalFakeStat(&avc, &fakestate, &treq); if (code) { @@ -514,7 +496,7 @@ struct AFS_UCRED *acred; { return code; } #ifdef AFS_OSF_ENV - if (flag & VNOFLCK) { + if (flag & VNOFLCK) { afs_PutFakeStat(&fakestate); return 0; } @@ -535,69 +517,69 @@ struct AFS_UCRED *acred; { afs_PutFakeStat(&fakestate); return 0; } -#ifndef AFS_OSF_ENV /* getlock is a no-op for osf (for now) */ +#ifndef AFS_OSF_ENV /* getlock is a no-op for osf (for now) */ code = HandleGetLock(avc, af, &treq, clid); #endif - code = afs_CheckCode(code, &treq, 2); /* defeat buggy AIX optimz */ + code = afs_CheckCode(code, &treq, 2); /* defeat buggy AIX optimz */ afs_PutFakeStat(&fakestate); return code; - } - else if ((acmd == F_SETLK) || (acmd == F_SETLKW) + } else if ((acmd == F_SETLK) || (acmd == F_SETLKW) #if (defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV) - || (acmd == F_RSETLK)|| (acmd == F_RSETLKW)) { + || (acmd == F_RSETLK) || (acmd == F_RSETLKW)) { #else ) { #endif - /* this next check is safer when left out, but more applications work - with it in. However, they fail in race conditions. The question is - what to do for people who don't have source to their application; - this way at least, they can get work done */ + /* this next check is safer when left out, but more applications work + * with it in. However, they fail in race conditions. The question is + * what to do for people who don't have source to their application; + * this way at least, they can get work done */ #ifdef AFS_LINUX24_ENV - if (af->l_len == OFFSET_MAX) - af->l_len = 0; /* since some systems indicate it as EOF */ + if (af->l_len == OFFSET_MAX) + af->l_len = 0; /* since some systems indicate it as EOF */ #else - if (af->l_len == 0x7fffffff) - af->l_len = 0; /* since some systems indicate it as EOF */ + if (af->l_len == 0x7fffffff) + af->l_len = 0; /* since some systems indicate it as EOF */ #ifdef AFS_LINUX_64BIT_KERNEL - if (af->l_len == LONG_MAX) - af->l_len = 0; /* since some systems indicate it as EOF */ + if (af->l_len == LONG_MAX) + af->l_len = 0; /* since some systems indicate it as EOF */ #endif #endif - /* next line makes byte range locks always succeed, - even when they should block */ - if (af->l_whence != 0 || af->l_start != 0 || af->l_len != 0) { - DoLockWarning(); - afs_PutFakeStat(&fakestate); - return 0; - } - /* otherwise we can turn this into a whole-file flock */ - if (af->l_type == F_RDLCK) code = LOCK_SH; - else if (af->l_type == F_WRLCK) code = LOCK_EX; - else if (af->l_type == F_UNLCK) code = LOCK_UN; - else { - afs_PutFakeStat(&fakestate); - return EINVAL; /* unknown lock type */ - } - if (((acmd == F_SETLK) + /* next line makes byte range locks always succeed, + * even when they should block */ + if (af->l_whence != 0 || af->l_start != 0 || af->l_len != 0) { + DoLockWarning(); + afs_PutFakeStat(&fakestate); + return 0; + } + /* otherwise we can turn this into a whole-file flock */ + if (af->l_type == F_RDLCK) + code = LOCK_SH; + else if (af->l_type == F_WRLCK) + code = LOCK_EX; + else if (af->l_type == F_UNLCK) + code = LOCK_UN; + else { + afs_PutFakeStat(&fakestate); + return EINVAL; /* unknown lock type */ + } + if (((acmd == F_SETLK) #if (defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV)) && !defined(AFS_SUN58_ENV) - || (acmd == F_RSETLK) + || (acmd == F_RSETLK) #endif ) && code != LOCK_UN) - code |= LOCK_NB; /* non-blocking, s.v.p. */ -#if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) - code = HandleFlock(avc, code, &treq, clid, 0/*!onlymine*/); -#else -#if defined(AFS_SGI_ENV) - AFS_RWLOCK((vnode_t *)avc, VRWLOCK_WRITE); - code = HandleFlock(avc, code, &treq, clid, 0/*!onlymine*/); - AFS_RWUNLOCK((vnode_t *)avc, VRWLOCK_WRITE); + code |= LOCK_NB; /* non-blocking, s.v.p. */ +#if (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_OSF_ENV) + code = HandleFlock(avc, code, &treq, clid, 0 /*!onlymine */ ); +#elif defined(AFS_SGI_ENV) + AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE); + code = HandleFlock(avc, code, &treq, clid, 0 /*!onlymine */ ); + AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_WRITE); #else - code = HandleFlock(avc, code, &treq, 0, 0/*!onlymine*/); + code = HandleFlock(avc, code, &treq, 0, 0 /*!onlymine */ ); #endif -#endif - code = afs_CheckCode(code, &treq, 3); /* defeat AIX -O bug */ - afs_PutFakeStat(&fakestate); - return code; + code = afs_CheckCode(code, &treq, 3); /* defeat AIX -O bug */ + afs_PutFakeStat(&fakestate); + return code; } afs_PutFakeStat(&fakestate); return EINVAL; @@ -615,22 +597,22 @@ struct AFS_UCRED *acred; { * 2. Asking for write lock, and only the current * PID has the file read locked. */ -#ifndef AFS_OSF_ENV /* getlock is a no-op for osf (for now) */ -HandleGetLock(avc, af, areq, clid) - int clid; /* not used by some OSes */ - register struct vcache *avc; - register struct vrequest *areq; - register struct AFS_FLOCK *af; +#ifndef AFS_OSF_ENV /* getlock is a no-op for osf (for now) */ +static int +HandleGetLock(register struct vcache *avc, register struct AFS_FLOCK *af, + register struct vrequest *areq, int clid) { register afs_int32 code; struct AFS_FLOCK flock; - lockIdSet(&flock, (struct SimpleLocks *)0, clid); + lockIdSet(&flock, NULL, clid); - ObtainWriteLock(&avc->lock,122); + ObtainWriteLock(&avc->lock, 122); if (avc->flockCount == 0) { - /* We don't know ourselves, so ask the server. Unfortunately, we don't know the pid. - * Not even the server knows the pid. Besides, the process with the lock is on another machine + /* + * We don't know ourselves, so ask the server. Unfortunately, we + * don't know the pid. Not even the server knows the pid. Besides, + * the process with the lock is on another machine */ code = GetFlockCount(avc, areq); if (code == 0 || (af->l_type == F_RDLCK && code > 0)) { @@ -643,7 +625,7 @@ HandleGetLock(avc, af, areq, clid) af->l_type = F_WRLCK; af->l_pid = 0; -#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) +#if defined(AFS_HAVE_FLOCK_SYSID) af->l_sysid = 0; #endif goto done; @@ -655,22 +637,22 @@ HandleGetLock(avc, af, areq, clid) * read locks, or we are the one with the * write lock, say it is unlocked. */ - if (avc->flockCount > 0 || /* only read locks */ - !lockIdcmp2(&flock, avc, (struct SimpleLocks *)0, 1, clid)) { + if (avc->flockCount > 0 || /* only read locks */ + !lockIdcmp2(&flock, avc, NULL, 1, clid)) { af->l_type = F_UNLCK; goto unlck_leave; } /* one write lock, but who? */ - af->l_type = F_WRLCK; /* not us, so lock would block */ - if (avc->slocks) { /* we know who, so tell */ + af->l_type = F_WRLCK; /* not us, so lock would block */ + if (avc->slocks) { /* we know who, so tell */ af->l_pid = avc->slocks->pid; -#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) +#if defined(AFS_HAVE_FLOCK_SYSID) af->l_sysid = avc->slocks->sysid; #endif } else { - af->l_pid = 0; /* XXX can't happen?? */ -#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) + af->l_pid = 0; /* XXX can't happen?? */ +#if defined(AFS_HAVE_FLOCK_SYSID) af->l_sysid = 0; #endif } @@ -682,22 +664,22 @@ HandleGetLock(avc, af, areq, clid) * already, and it is not this process, we fail. */ if (avc->flockCount < 0) { - if (lockIdcmp2(&flock, avc, (struct SimpleLocks *)0, 1, clid)) { + if (lockIdcmp2(&flock, avc, NULL, 1, clid)) { af->l_type = F_WRLCK; if (avc->slocks) { af->l_pid = avc->slocks->pid; -#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) +#if defined(AFS_HAVE_FLOCK_SYSID) af->l_sysid = avc->slocks->sysid; #endif } else { - af->l_pid = 0; /* XXX can't happen?? */ -#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) + af->l_pid = 0; /* XXX can't happen?? */ +#if defined(AFS_HAVE_FLOCK_SYSID) af->l_sysid = 0; #endif } goto done; } - /* we are the one with the write lock */ + /* we are the one with the write lock */ af->l_type = F_UNLCK; goto unlck_leave; } @@ -707,104 +689,104 @@ HandleGetLock(avc, af, areq, clid) * If there is more than one, or it isn't us, we cannot lock. */ if ((avc->flockCount > 1) - || lockIdcmp2(&flock, avc, (struct SimpleLocks *)0, 1, clid)) { + || lockIdcmp2(&flock, avc, NULL, 1, clid)) { struct SimpleLocks *slp; - + af->l_type = F_RDLCK; af->l_pid = 0; -#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) +#if defined(AFS_HAVE_FLOCK_SYSID) af->l_sysid = 0; #endif /* find a pid that isn't our own */ for (slp = avc->slocks; slp; slp = slp->next) { - if (lockIdcmp2(&flock, (struct vcache *)0, slp, 1, clid)) { - af->l_pid = slp->pid; -#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) - af->l_sysid = avc->slocks->sysid; + if (lockIdcmp2(&flock, NULL, slp, 1, clid)) { + af->l_pid = slp->pid; +#if defined(AFS_HAVE_FLOCK_SYSID) + af->l_sysid = avc->slocks->sysid; #endif break; - } - } + } + } goto done; } - /* - * Ok, we want a write lock. If there is a write lock - * already, and it is not this process, we fail. - */ - if (avc->flockCount < 0) { - if (lockIdcmp2(&flock, avc, (struct SimpleLocks *)0, 1, clid)) { - af->l_type = F_WRLCK; - if (avc->slocks) { - af->l_pid = avc->slocks->pid; -#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) - af->l_sysid = avc->slocks->sysid; + /* + * Ok, we want a write lock. If there is a write lock + * already, and it is not this process, we fail. + */ + if (avc->flockCount < 0) { + if (lockIdcmp2(&flock, avc, NULL, 1, clid)) { + af->l_type = F_WRLCK; + if (avc->slocks) { + af->l_pid = avc->slocks->pid; +#if defined(AFS_HAVE_FLOCK_SYSID) + af->l_sysid = avc->slocks->sysid; #endif - } else { - af->l_pid = 0; /* XXX can't happen?? */ -#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) - af->l_sysid = 0; + } else { + af->l_pid = 0; /* XXX can't happen?? */ +#if defined(AFS_HAVE_FLOCK_SYSID) + af->l_sysid = 0; #endif - } - goto done; } - /* we are the one with the write lock */ - af->l_type = F_UNLCK; - goto unlck_leave; + goto done; } + /* we are the one with the write lock */ + af->l_type = F_UNLCK; + goto unlck_leave; + } - /* - * Want a write lock, and we know there are read locks. - * If there is more than one, or it isn't us, we cannot lock. - */ - if ((avc->flockCount > 1) - || lockIdcmp2(&flock, avc, (struct SimpleLocks *)0, 1, clid)) { - struct SimpleLocks *slp; - af->l_type = F_RDLCK; - af->l_pid = 0; -#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) - af->l_sysid = 0; + /* + * Want a write lock, and we know there are read locks. + * If there is more than one, or it isn't us, we cannot lock. + */ + if ((avc->flockCount > 1) + || lockIdcmp2(&flock, avc, NULL, 1, clid)) { + struct SimpleLocks *slp; + af->l_type = F_RDLCK; + af->l_pid = 0; +#if defined(AFS_HAVE_FLOCK_SYSID) + af->l_sysid = 0; #endif - /* find a pid that isn't our own */ - for (slp = avc->slocks; slp; slp = slp->next) { - if (lockIdcmp2(&flock, (struct vcache *)0, slp, 1, clid)) { - af->l_pid = slp->pid; -#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) - af->l_sysid = avc->slocks->sysid; + /* find a pid that isn't our own */ + for (slp = avc->slocks; slp; slp = slp->next) { + if (lockIdcmp2(&flock, NULL, slp, 1, clid)) { + af->l_pid = slp->pid; +#if defined(AFS_HAVE_FLOCK_SYSID) + af->l_sysid = avc->slocks->sysid; #endif - break; - } + break; } - goto done; - } - - /* - * Want a write lock, and there is just one read lock, and it - * is this process with a read lock. Ask the server if there - * are any more processes with the file locked. - */ - code = GetFlockCount(avc, areq); - if (code == 0 || code == 1) { - af->l_type = F_UNLCK; - goto unlck_leave; } - if (code > 0) - af->l_type = F_RDLCK; - else - af->l_type = F_WRLCK; - af->l_pid = 0; -#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) - af->l_sysid = 0; + goto done; + } + + /* + * Want a write lock, and there is just one read lock, and it + * is this process with a read lock. Ask the server if there + * are any more processes with the file locked. + */ + code = GetFlockCount(avc, areq); + if (code == 0 || code == 1) { + af->l_type = F_UNLCK; + goto unlck_leave; + } + if (code > 0) + af->l_type = F_RDLCK; + else + af->l_type = F_WRLCK; + af->l_pid = 0; +#if defined(AFS_HAVE_FLOCK_SYSID) + af->l_sysid = 0; #endif -done: - af->l_whence = 0; - af->l_start = 0; - af->l_len = 0; /* to end of file */ + done: + af->l_whence = 0; + af->l_start = 0; + af->l_len = 0; /* to end of file */ -unlck_leave: - ReleaseWriteLock(&avc->lock); - return 0; + unlck_leave: + ReleaseWriteLock(&avc->lock); + return 0; } /* Get the 'flock' count from the server. This comes back in a 'spare' @@ -813,7 +795,8 @@ unlck_leave: * the spare field will be a zero, saying the file is unlocked. This is * OK, as a further 'lock' request will do the right thing. */ -static int GetFlockCount(struct vcache *avc, struct vrequest *areq) +static int +GetFlockCount(struct vcache *avc, struct vrequest *areq) { register struct conn *tc; register afs_int32 code; @@ -821,54 +804,49 @@ static int GetFlockCount(struct vcache *avc, struct vrequest *areq) struct AFSCallBack CallBack; struct AFSVolSync tsync; int temp; - XSTATS_DECLS - - temp = areq->flags & O_NONBLOCK; + XSTATS_DECLS temp = areq->flags & O_NONBLOCK; areq->flags |= O_NONBLOCK; do { - tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); - if (tc){ - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHSTATUS); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_FetchStatus(tc->id, (struct AFSFid *) &avc->fid.Fid, - &OutStatus, &CallBack, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } else code = -1; - } while - (afs_Analyze(tc, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_FETCHSTATUS, - SHARED_LOCK, (struct cell *)0)); + tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); + if (tc) { + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHSTATUS); + RX_AFS_GUNLOCK(); + code = + RXAFS_FetchStatus(tc->id, (struct AFSFid *)&avc->fid.Fid, + &OutStatus, &CallBack, &tsync); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tc, code, &avc->fid, areq, AFS_STATS_FS_RPCIDX_FETCHSTATUS, + SHARED_LOCK, NULL)); if (temp) areq->flags &= ~O_NONBLOCK; if (code) { - return(0); /* failed, say it is 'unlocked' */ + return (0); /* failed, say it is 'unlocked' */ } else { - return((int)OutStatus.lockCount); + return ((int)OutStatus.lockCount); } } #endif -#if !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(UKERNEL) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) +#if !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(UKERNEL) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) /* Flock not support on System V systems */ #ifdef AFS_OSF_ENV extern struct fileops afs_fileops; -afs_xflock (p, args, retval) - struct proc *p; - void *args; - int *retval; -{ + +int +afs_xflock(struct proc *p, void *args, int *retval) #else /* AFS_OSF_ENV */ -afs_xflock () { +int +afs_xflock(void) #endif +{ int code = 0; struct a { int fd; @@ -909,7 +887,7 @@ afs_xflock () { /* find real vcache entry; shouldn't be null if gnode ref count * is greater than 0. */ - tvc = VTOAFS(afs_gntovn)(tvc); + tvc = VTOAFS(afs_gntovn) (tvc); if (!tvc) { u.u_error = ENOENT; afs_PutFakeStat(&fakestate); @@ -924,19 +902,21 @@ afs_xflock () { if ((fd->f_flag & (FEXLOCK | FSHLOCK)) && !(uap->com & LOCK_UN)) { /* First, if fd already has lock, release it for relock path */ #if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) - HandleFlock(tvc, LOCK_UN, &treq, u.u_procp->p_pid, 0/*!onlymine*/); + HandleFlock(tvc, LOCK_UN, &treq, u.u_procp->p_pid, + 0 /*!onlymine */ ); #else - HandleFlock(tvc, LOCK_UN, &treq, 0, 0/*!onlymine*/); + HandleFlock(tvc, LOCK_UN, &treq, 0, 0 /*!onlymine */ ); #endif fd->f_flag &= ~(FEXLOCK | FSHLOCK); } /* now try the requested operation */ #if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) - code = HandleFlock(tvc, uap->com, &treq, - u.u_procp->p_pid, 0/*!onlymine*/); + code = + HandleFlock(tvc, uap->com, &treq, u.u_procp->p_pid, + 0 /*!onlymine */ ); #else - code = HandleFlock(tvc, uap->com, &treq, 0, 0/*!onlymine*/); + code = HandleFlock(tvc, uap->com, &treq, 0, 0 /*!onlymine */ ); #endif #ifndef AFS_OSF_ENV u.u_error = code; @@ -945,15 +925,16 @@ afs_xflock () { if (uap->com & LOCK_UN) { /* gave up lock */ fd->f_flag &= ~(FEXLOCK | FSHLOCK); - } - else { + } else { #ifdef AFS_OSF_ENV if (!code) { #else /* AFS_OSF_ENV */ if (!u.u_error) { #endif - if (uap->com & LOCK_SH) fd->f_flag |= FSHLOCK; - else if (uap->com & LOCK_EX) fd->f_flag |= FEXLOCK; + if (uap->com & LOCK_SH) + fd->f_flag |= FSHLOCK; + else if (uap->com & LOCK_EX) + fd->f_flag |= FEXLOCK; } } flockDone = 1; @@ -970,16 +951,15 @@ afs_xflock () { #endif afs_PutFakeStat(&fakestate); return code; -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ if (!flockDone) #ifdef DYNEL - (*afs_longcall_procs.LC_flock)(); + (*afs_longcall_procs.LC_flock) (); #else - flock(); + flock(); #endif afs_PutFakeStat(&fakestate); return; #endif } #endif /* !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(UKERNEL) && !defined(AFS_LINUX20_ENV) */ - diff --git a/src/afs/VNOPS/afs_vnop_link.c b/src/afs/VNOPS/afs_vnop_link.c index c6602dfbe..db500430b 100644 --- a/src/afs/VNOPS/afs_vnop_link.c +++ b/src/afs/VNOPS/afs_vnop_link.c @@ -14,67 +14,72 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_link.c,v 1.1.1.6 2002/08/02 04:29:02 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_link.c,v 1.15 2003/08/29 22:00:04 rees Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" extern afs_rwlock_t afs_xcbhash; /* Note that we don't set CDirty here, this is OK because the link * RPC is called synchronously. */ +int #ifdef AFS_OSF_ENV afs_link(avc, ndp) - struct vcache *avc; - struct nameidata *ndp; { + struct vcache *avc; + struct nameidata *ndp; +{ struct vcache *adp = VTOAFS(ndp->ni_dvp); char *aname = ndp->ni_dent.d_name; struct ucred *acred = ndp->ni_cred; -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) afs_link(OSI_VC_ARG(adp), avc, aname, acred) #else afs_link(avc, OSI_VC_ARG(adp), aname, acred) #endif OSI_VC_DECL(adp); - struct vcache *avc; - char *aname; - struct AFS_UCRED *acred; + struct vcache *avc; + char *aname; + struct AFS_UCRED *acred; { #endif struct vrequest treq; register struct dcache *tdc; register afs_int32 code; register struct conn *tc; - afs_int32 offset, len; + afs_size_t offset, len; struct AFSFetchStatus OutFidStatus, OutDirStatus; struct AFSVolSync tsync; struct afs_fakestat_state vfakestate, dfakestate; - XSTATS_DECLS - OSI_VC_CONVERT(adp) + XSTATS_DECLS OSI_VC_CONVERT(adp) - AFS_STATCNT(afs_link); + AFS_STATCNT(afs_link); afs_Trace3(afs_iclSetp, CM_TRACE_LINK, ICL_TYPE_POINTER, adp, ICL_TYPE_POINTER, avc, ICL_TYPE_STRING, aname); /* create a hard link; new entry is aname in dir adp */ - if (code = afs_InitReq(&treq, acred)) + if ((code = afs_InitReq(&treq, acred))) goto done2; afs_InitFakeStat(&vfakestate); afs_InitFakeStat(&dfakestate); code = afs_EvalFakeStat(&avc, &vfakestate, &treq); - if (code) goto done; + if (code) + goto done; code = afs_EvalFakeStat(&adp, &dfakestate, &treq); - if (code) goto done; + if (code) + goto done; - if (avc->fid.Cell != adp->fid.Cell || avc->fid.Fid.Volume != adp->fid.Fid.Volume) { + if (avc->fid.Cell != adp->fid.Cell + || avc->fid.Fid.Volume != adp->fid.Fid.Volume) { code = EXDEV; goto done; } @@ -83,51 +88,52 @@ afs_link(avc, OSI_VC_ARG(adp), aname, acred) goto done; } code = afs_VerifyVCache(adp, &treq); - if (code) goto done; + if (code) + goto done; /** If the volume is read-only, return error without making an RPC to the * fileserver */ - if ( adp->states & CRO ) { - code = EROFS; + if (adp->states & CRO) { + code = EROFS; goto done; } - tdc = afs_GetDCache(adp, 0, &treq, &offset, &len, 1); /* test for error below */ - ObtainWriteLock(&adp->lock,145); + tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1); /* test for error below */ + ObtainWriteLock(&adp->lock, 145); do { tc = afs_Conn(&adp->fid, &treq, SHARED_LOCK); if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_LINK); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_Link(tc->id, (struct AFSFid *) &adp->fid.Fid, aname, - (struct AFSFid *) &avc->fid.Fid, &OutFidStatus, - &OutDirStatus, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - - } - else code = -1; - } while - (afs_Analyze(tc, code, &adp->fid, &treq, - AFS_STATS_FS_RPCIDX_LINK, SHARED_LOCK, (struct cell *)0)); + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_LINK); + RX_AFS_GUNLOCK(); + code = + RXAFS_Link(tc->id, (struct AFSFid *)&adp->fid.Fid, aname, + (struct AFSFid *)&avc->fid.Fid, &OutFidStatus, + &OutDirStatus, &tsync); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + + } else + code = -1; + } while (afs_Analyze + (tc, code, &adp->fid, &treq, AFS_STATS_FS_RPCIDX_LINK, + SHARED_LOCK, NULL)); if (code) { - if (tdc) afs_PutDCache(tdc); + if (tdc) + afs_PutDCache(tdc); if (code < 0) { - ObtainWriteLock(&afs_xcbhash, 492); - afs_DequeueCallback(adp); - adp->states &= ~CStatd; - ReleaseWriteLock(&afs_xcbhash); - osi_dnlc_purgedp(adp); + ObtainWriteLock(&afs_xcbhash, 492); + afs_DequeueCallback(adp); + adp->states &= ~CStatd; + ReleaseWriteLock(&afs_xcbhash); + osi_dnlc_purgedp(adp); } ReleaseWriteLock(&adp->lock); goto done; } + if (tdc) + ObtainWriteLock(&tdc->lock, 635); if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) { /* we can do it locally */ code = afs_dir_Create(&tdc->f.inode, aname, &avc->fid.Fid); @@ -137,10 +143,11 @@ afs_link(avc, OSI_VC_ARG(adp), aname, acred) } } if (tdc) { + ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); /* drop ref count */ } ReleaseWriteLock(&adp->lock); - ObtainWriteLock(&avc->lock,146); /* correct link count */ + ObtainWriteLock(&avc->lock, 146); /* correct link count */ /* we could lock both dir and file; since we get the new fid * status back, you'd think we could put it in the cache status @@ -151,20 +158,19 @@ afs_link(avc, OSI_VC_ARG(adp), aname, acred) ObtainWriteLock(&afs_xcbhash, 493); afs_DequeueCallback(avc); - avc->states &= ~CStatd; /* don't really know new link count */ + avc->states &= ~CStatd; /* don't really know new link count */ ReleaseWriteLock(&afs_xcbhash); if (avc->fid.Fid.Vnode & 1 || (vType(avc) == VDIR)) osi_dnlc_purgedp(avc); ReleaseWriteLock(&avc->lock); code = 0; -done: + done: code = afs_CheckCode(code, &treq, 24); afs_PutFakeStat(&vfakestate); afs_PutFakeStat(&dfakestate); -done2: + done2: #ifdef AFS_OSF_ENV - afs_PutVCache(adp, WRITE_LOCK); -#endif /* AFS_OSF_ENV */ + afs_PutVCache(adp); +#endif /* AFS_OSF_ENV */ return code; } - diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index dbbff792c..8987c9820 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -12,46 +12,31 @@ * afs_lookup * EvalMountPoint * afs_DoBulkStat - * - * Locals: - * afs_strcat - * AFS_EQ_ATSYS (macro) - * afs_index */ #include -#include "../afs/param.h" - -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.1.1.16 2003/04/13 19:02:49 hartmans Exp $"); +#include "afs/param.h" -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/exporter.h" -#include "../afs/afs_osidnlc.h" +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.50 2004/03/17 06:43:36 shadow Exp $"); +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/exporter.h" +#include "afs/afs_osidnlc.h" -/** - * A few definitions. This is until we have a proper header file - * which has prototypes for all functions - */ -extern struct DirEntry * afs_dir_GetBlob(); +extern struct DirEntry *afs_dir_GetBlob(); -extern afs_rwlock_t afs_xvcache; -extern afs_rwlock_t afs_xcbhash; -extern struct afs_exporter *afs_nfsexporter; -extern char *afs_sysname; -extern char *afs_sysnamelist[]; -extern int afs_sysnamecount; -extern struct afs_q VLRU; /*vcache LRU*/ #ifdef AFS_LINUX22_ENV extern struct inode_operations afs_symlink_iops, afs_dir_iops; #endif +afs_int32 afs_bkvolpref = 0; afs_int32 afs_bulkStatsDone; static int bulkStatCounter = 0; /* counter for bulk stat seq. numbers */ int afs_fakestat_enable = 0; /* 1: fakestat-all, 2: fakestat-crosscell */ @@ -62,34 +47,6 @@ int afs_fakestat_enable = 0; /* 1: fakestat-all, 2: fakestat-crosscell */ * what "@sys" is in binary... */ #define AFS_EQ_ATSYS(name) (((name)[0]=='@')&&((name)[1]=='s')&&((name)[2]=='y')&&((name)[3]=='s')&&(!(name)[4])) -char * -afs_strcat(s1, s2) - register char *s1, *s2; -{ - register char *os1; - - AFS_STATCNT(strcat); - os1 = s1; - while (*s1++) - ; - --s1; - while (*s1++ = *s2++) - ; - return (os1); -} - - -char *afs_index(a, c) - register char *a, c; { - register char tc; - AFS_STATCNT(afs_index); - while (tc = *a) { - if (tc == c) return a; - else a++; - } - return (char *) 0; -} - /* call under write lock, evaluate mvid field from a mt pt. * avc is the vnode of the mount point object; must be write-locked. * advc is the vnode of the containing directory (optional; if NULL and @@ -99,101 +56,115 @@ char *afs_index(a, c) * * NOTE: this function returns a held volume structure in *volpp if it returns 0! */ -EvalMountPoint(avc, advc, avolpp, areq) - register struct vcache *avc; - struct volume **avolpp; - struct vcache *advc; /* the containing dir */ - register struct vrequest *areq; +int +EvalMountPoint(register struct vcache *avc, struct vcache *advc, + struct volume **avolpp, register struct vrequest *areq) { - afs_int32 code; + afs_int32 code; struct volume *tvp = 0; struct VenusFid tfid; struct cell *tcell; - char *cpos, *volnamep; - char type, *buf; - afs_int32 prefetchRO; /* 1=>No 2=>Yes */ - afs_int32 mtptCell, assocCell, hac=0; - afs_int32 samecell, roname, len; + char *cpos, *volnamep; + char type, *buf; + afs_int32 prefetch; /* 1=>None 2=>RO 3=>BK */ + afs_int32 mtptCell, assocCell, hac = 0; + afs_int32 samecell, roname, len; AFS_STATCNT(EvalMountPoint); #ifdef notdef - if (avc->mvid && (avc->states & CMValid)) return 0; /* done while racing */ + if (avc->mvid && (avc->states & CMValid)) + return 0; /* done while racing */ #endif - *avolpp = (struct volume *)0; + *avolpp = NULL; code = afs_HandleLink(avc, areq); - if (code) return code; + if (code) + return code; /* Determine which cell and volume the mointpoint goes to */ - type = avc->linkData[0]; /* '#'=>Regular '%'=>RW */ - cpos = afs_index(&avc->linkData[1], ':'); /* if cell name present */ + type = avc->linkData[0]; /* '#'=>Regular '%'=>RW */ + cpos = afs_strchr(&avc->linkData[1], ':'); /* if cell name present */ if (cpos) { - volnamep = cpos+1; - *cpos = 0; - tcell = afs_GetCellByName(&avc->linkData[1], READ_LOCK); - *cpos = ':'; + volnamep = cpos + 1; + *cpos = 0; + tcell = afs_GetCellByName(&avc->linkData[1], READ_LOCK); + *cpos = ':'; } else { - volnamep = &avc->linkData[1]; - tcell = afs_GetCell(avc->fid.Cell, READ_LOCK); + volnamep = &avc->linkData[1]; + tcell = afs_GetCell(avc->fid.Cell, READ_LOCK); } - if (!tcell) return ENODEV; + if (!tcell) + return ENODEV; - mtptCell = tcell->cellNum; /* The cell for the mountpoint */ + mtptCell = tcell->cellNum; /* The cell for the mountpoint */ if (tcell->lcellp) { - hac = 1; /* has associated cell */ - assocCell = tcell->lcellp->cellNum; /* The associated cell */ + hac = 1; /* has associated cell */ + assocCell = tcell->lcellp->cellNum; /* The associated cell */ } - afs_PutCell(tcell, READ_LOCK); + afs_PutCell(tcell, READ_LOCK); /* Is volume name a ".backup" or ".readonly" name */ len = strlen(volnamep); - roname = ((len > 9) && (strcmp(&volnamep[len - 9],".readonly") == 0)) || - ((len > 7) && (strcmp(&volnamep[len - 7],".backup") == 0)); + roname = ((len > 9) && (strcmp(&volnamep[len - 9], ".readonly") == 0)) + || ((len > 7) && (strcmp(&volnamep[len - 7], ".backup") == 0)); /* When we cross mountpoint, do we stay in the same cell */ - samecell = (avc->fid.Cell == mtptCell) || (hac && (avc->fid.Cell == assocCell)); - - /* Decide whether to prefetch the RO. Also means we want the RO. - * If this is a regular mountpoint with a RW volume name and - * we cross a cell boundary -or- start from a RO volume, then we will - * want to prefetch the RO volume when we get the RW below. + samecell = (avc->fid.Cell == mtptCell) || (hac + && (avc->fid.Cell == + assocCell)); + + /* Decide whether to prefetch the BK, or RO. Also means we want the BK or + * RO. + * If this is a regular mountpoint with a RW volume name + * - If BK preference is enabled AND we remain within the same cell AND + * start from a BK volume, then we will want to prefetch the BK volume. + * - If we cross a cell boundary OR start from a RO volume, then we will + * want to prefetch the RO volume. */ - if ( (type == '#') && !roname && (!samecell || (avc->states & CRO)) ) { - prefetchRO = 2; /* Yes, prefetch the RO */ + if ((type == '#') && !roname) { + if (afs_bkvolpref && samecell && (avc->states & CBackup)) + prefetch = 3; /* Prefetch the BK */ + else if (!samecell || (avc->states & CRO)) + prefetch = 2; /* Prefetch the RO */ + else + prefetch = 1; /* Do not prefetch */ } else { - prefetchRO = 1; /* No prefetch of the RO */ + prefetch = 1; /* Do not prefetch */ } /* Get the volume struct. Unless this volume name has ".readonly" or * ".backup" in it, this will get the volume struct for the RW volume. * The RO volume will be prefetched if requested (but not returned). */ - tvp = afs_GetVolumeByName(volnamep, mtptCell, prefetchRO, areq, WRITE_LOCK); + tvp = afs_GetVolumeByName(volnamep, mtptCell, prefetch, areq, WRITE_LOCK); /* If no volume was found in this cell, try the associated linked cell */ if (!tvp && hac && areq->volumeError) { - tvp = afs_GetVolumeByName(volnamep, assocCell, prefetchRO, areq, WRITE_LOCK); + tvp = + afs_GetVolumeByName(volnamep, assocCell, prefetch, areq, + WRITE_LOCK); } /* Still not found. If we are looking for the RO, then perhaps the RW * doesn't exist? Try adding ".readonly" to volname and look for that. * Don't know why we do this. Would have still found it in above call - jpm. */ - if (!tvp && (prefetchRO == 2)) { - buf = (char *)osi_AllocSmallSpace(strlen(volnamep)+10); + if (!tvp && (prefetch == 2) && len < AFS_SMALLOCSIZ - 10) { + buf = (char *)osi_AllocSmallSpace(len + 10); strcpy(buf, volnamep); afs_strcat(buf, ".readonly"); tvp = afs_GetVolumeByName(buf, mtptCell, 1, areq, WRITE_LOCK); - + /* Try the associated linked cell if failed */ if (!tvp && hac && areq->volumeError) { tvp = afs_GetVolumeByName(buf, assocCell, 1, areq, WRITE_LOCK); } osi_FreeSmallSpace(buf); } - - if (!tvp) return ENODEV; /* Couldn't find the volume */ + + if (!tvp) + return ENODEV; /* Couldn't find the volume */ /* Don't cross mountpoint from a BK to a BK volume */ if ((avc->states & CBackup) && (tvp->states & VBackup)) { @@ -201,19 +172,31 @@ EvalMountPoint(avc, advc, avolpp, areq) return ENODEV; } - /* If we want (prefetched) the RO and it exists, then drop the - * RW volume and get the RO. Othewise, go with the RW. + /* If we want (prefetched) the BK and it exists, then drop the RW volume + * and get the BK. + * Otherwise, if we want (prefetched0 the RO and it exists, then drop the + * RW volume and get the RO. + * Otherwise, go with the RW. */ - if ((prefetchRO == 2) && tvp->roVol) { - tfid.Fid.Volume = tvp->roVol; /* remember RO volume */ - tfid.Cell = tvp->cell; - afs_PutVolume(tvp, WRITE_LOCK); /* release old volume */ - tvp = afs_GetVolume(&tfid, areq, WRITE_LOCK); /* get the new one */ - if (!tvp) return ENODEV; /* oops, can't do it */ + if ((prefetch == 3) && tvp->backVol) { + tfid.Fid.Volume = tvp->backVol; /* remember BK volume */ + tfid.Cell = tvp->cell; + afs_PutVolume(tvp, WRITE_LOCK); /* release old volume */ + tvp = afs_GetVolume(&tfid, areq, WRITE_LOCK); /* get the new one */ + if (!tvp) + return ENODEV; /* oops, can't do it */ + } else if ((prefetch >= 2) && tvp->roVol) { + tfid.Fid.Volume = tvp->roVol; /* remember RO volume */ + tfid.Cell = tvp->cell; + afs_PutVolume(tvp, WRITE_LOCK); /* release old volume */ + tvp = afs_GetVolume(&tfid, areq, WRITE_LOCK); /* get the new one */ + if (!tvp) + return ENODEV; /* oops, can't do it */ } if (avc->mvid == 0) - avc->mvid = (struct VenusFid *) osi_AllocSmallSpace(sizeof(struct VenusFid)); + avc->mvid = + (struct VenusFid *)osi_AllocSmallSpace(sizeof(struct VenusFid)); avc->mvid->Cell = tvp->cell; avc->mvid->Fid.Volume = tvp->volume; avc->mvid->Fid.Vnode = 1; @@ -236,7 +219,8 @@ EvalMountPoint(avc, advc, avolpp, areq) * to the new path. */ tvp->mtpoint = avc->fid; /* setup back pointer to mtpoint */ - if (advc) tvp->dotdot = advc->fid; + if (advc) + tvp->dotdot = advc->fid; *avolpp = tvp; return 0; @@ -250,10 +234,8 @@ EvalMountPoint(avc, advc, avolpp, areq) * without calling afs_EvalFakeStat is legal, as long as this * function is called. */ - void -afs_InitFakeStat(state) - struct afs_fakestat_state *state; +afs_InitFakeStat(struct afs_fakestat_state *state) { if (!afs_fakestat_enable) return; @@ -271,8 +253,9 @@ afs_InitFakeStat(state) * * Only issues RPCs if canblock is non-zero. */ -int afs_EvalFakeStat_int(struct vcache **avcp, struct afs_fakestat_state *state, - struct vrequest *areq, int canblock) +int +afs_EvalFakeStat_int(struct vcache **avcp, struct afs_fakestat_state *state, + struct vrequest *areq, int canblock) { struct vcache *tvc, *root_vp; struct volume *tvolp = NULL; @@ -312,15 +295,15 @@ int afs_EvalFakeStat_int(struct vcache **avcp, struct afs_fakestat_state *state, do { retry = 0; ObtainWriteLock(&afs_xvcache, 597); - root_vp = afs_FindVCache(tvc->mvid, 0, 0, &retry, 0); + root_vp = afs_FindVCache(tvc->mvid, &retry, 0); if (root_vp && retry) { ReleaseWriteLock(&afs_xvcache); - afs_PutVCache(root_vp, 0); + afs_PutVCache(root_vp); } } while (root_vp && retry); ReleaseWriteLock(&afs_xvcache); } else { - root_vp = afs_GetVCache(tvc->mvid, areq, NULL, NULL, WRITE_LOCK); + root_vp = afs_GetVCache(tvc->mvid, areq, NULL, NULL); } if (!root_vp) { code = canblock ? ENOENT : 0; @@ -344,7 +327,7 @@ int afs_EvalFakeStat_int(struct vcache **avcp, struct afs_fakestat_state *state, code = canblock ? ENOENT : 0; } -done: + done: if (tvolp) afs_PutVolume(tvolp, WRITE_LOCK); return code; @@ -364,10 +347,8 @@ done: * something goes wrong and the error code should be returned to the user. */ int -afs_EvalFakeStat(avcp, state, areq) - struct vcache **avcp; - struct afs_fakestat_state *state; - struct vrequest *areq; +afs_EvalFakeStat(struct vcache **avcp, struct afs_fakestat_state *state, + struct vrequest *areq) { return afs_EvalFakeStat_int(avcp, state, areq, 1); } @@ -383,10 +364,8 @@ afs_EvalFakeStat(avcp, state, areq) * vcache entry (possibly evaluated). */ int -afs_TryEvalFakeStat(avcp, state, areq) - struct vcache **avcp; - struct afs_fakestat_state *state; - struct vrequest *areq; +afs_TryEvalFakeStat(struct vcache **avcp, struct afs_fakestat_state *state, + struct vrequest *areq) { return afs_EvalFakeStat_int(avcp, state, areq, 0); } @@ -398,113 +377,145 @@ afs_TryEvalFakeStat(avcp, state, areq) * afs_InitFakeStat was previously called with this state. */ void -afs_PutFakeStat(state) - struct afs_fakestat_state *state; +afs_PutFakeStat(struct afs_fakestat_state *state) { if (!afs_fakestat_enable) return; osi_Assert(state->valid == 1); if (state->need_release) - afs_PutVCache(state->root_vp, 0); + afs_PutVCache(state->root_vp); state->valid = 0; } - -afs_ENameOK(aname) - register char *aname; { - register char tc; + +int +afs_ENameOK(register char *aname) +{ register int tlen; AFS_STATCNT(ENameOK); tlen = strlen(aname); - if (tlen >= 4 && strcmp(aname+tlen-4, "@sys") == 0) return 0; + if (tlen >= 4 && strcmp(aname + tlen - 4, "@sys") == 0) + return 0; return 1; } -afs_getsysname(areq, adp, bufp) - register struct vrequest *areq; - register struct vcache *adp; - register char *bufp; +static int +afs_getsysname(register struct vrequest *areq, register struct vcache *adp, + register char *bufp, int *num, char **sysnamelist[]) { - static char sysname[MAXSYSNAME]; register struct unixuser *au; register afs_int32 error; - if (!afs_nfsexporter) { - strcpy(bufp, afs_sysname); - return 0; - } AFS_STATCNT(getsysname); - au = afs_GetUser(areq->uid, adp->fid.Cell, 0); - afs_PutUser(au, 0); - if (au->exporter) { - error = EXP_SYSNAME(au->exporter, (char *)0, bufp); - if (error) - strcpy(bufp, "@sys"); - return -1; - } else { - strcpy(bufp, afs_sysname); - return 0; + + *sysnamelist = afs_sysnamelist; + + if (!afs_nfsexporter) + strcpy(bufp, (*sysnamelist)[0]); + else { + au = afs_GetUser(areq->uid, adp->fid.Cell, 0); + if (au->exporter) { + error = EXP_SYSNAME(au->exporter, (char *)0, sysnamelist, num); + if (error) { + strcpy(bufp, "@sys"); + afs_PutUser(au, 0); + return -1; + } else { + strcpy(bufp, (*sysnamelist)[0]); + } + } else + strcpy(bufp, afs_sysname); + afs_PutUser(au, 0); } + return 0; } -Check_AtSys(avc, aname, state, areq) - register struct vcache *avc; - char *aname; - struct sysname_info *state; - struct vrequest *areq; +void +Check_AtSys(register struct vcache *avc, char *aname, + struct sysname_info *state, struct vrequest *areq) { + int num = 0; + char **sysnamelist[MAXSYSNAME]; + if (AFS_EQ_ATSYS(aname)) { - state->offset = 0; - state->name = (char *) osi_AllocLargeSpace(AFS_SMALLOCSIZ); - state->allocked = 1; - state->index = afs_getsysname(areq, avc, state->name); + state->offset = 0; + state->name = (char *)osi_AllocLargeSpace(AFS_SMALLOCSIZ); + state->allocked = 1; + state->index = afs_getsysname(areq, avc, state->name, &num, sysnamelist); } else { - state->offset = -1; - state->allocked = 0; - state->index = 0; - state->name = aname; + state->offset = -1; + state->allocked = 0; + state->index = 0; + state->name = aname; } } -Next_AtSys(avc, areq, state) - register struct vcache *avc; - struct vrequest *areq; - struct sysname_info *state; +int +Next_AtSys(register struct vcache *avc, struct vrequest *areq, + struct sysname_info *state) { - if (state->index == -1) - return 0; /* No list */ - - /* Check for the initial state of aname != "@sys" in Check_AtSys*/ - if (state->offset == -1 && state->allocked == 0) { - register char *tname; - /* Check for .*@sys */ - for (tname=state->name; *tname; tname++) - /*Move to the end of the string*/; - if ((tname > state->name + 4) && (AFS_EQ_ATSYS(tname-4))) { - state->offset = (tname - 4) - state->name; - tname = (char *) osi_AllocLargeSpace(AFS_LRALLOCSIZ); - strncpy(tname, state->name, state->offset); - state->name = tname; - state->allocked = 1; - state->index = afs_getsysname(areq, avc, state->name+state->offset); - return 1; - } else - return 0; /* .*@sys doesn't match either */ - } else if (++(state->index) >= afs_sysnamecount - || !afs_sysnamelist[state->index]) - return 0; /* end of list */ - strcpy(state->name+state->offset, afs_sysnamelist[state->index]); - return 1; + int num = afs_sysnamecount; + char **sysnamelist[MAXSYSNAME]; + + if (state->index == -1) + return 0; /* No list */ + + /* Check for the initial state of aname != "@sys" in Check_AtSys*/ + if (state->offset == -1 && state->allocked == 0) { + register char *tname; + + /* Check for .*@sys */ + for (tname=state->name; *tname; tname++) + /*Move to the end of the string*/; + + if ((tname > state->name + 4) && (AFS_EQ_ATSYS(tname-4))) { + state->offset = (tname - 4) - state->name; + tname = (char *) osi_AllocLargeSpace(AFS_LRALLOCSIZ); + strncpy(tname, state->name, state->offset); + state->name = tname; + state->allocked = 1; + num = 0; + state->index = afs_getsysname(areq, avc, state->name+state->offset, + &num, sysnamelist); + return 1; + } else + return 0; /* .*@sys doesn't match either */ + } else { + register struct unixuser *au; + register afs_int32 error; + + *sysnamelist = afs_sysnamelist; + + if (afs_nfsexporter) { + au = afs_GetUser(areq->uid, avc->fid.Cell, 0); + if (au->exporter) { + error = EXP_SYSNAME(au->exporter, (char *)0, sysnamelist, num); + if (error) { + return 0; + } + } + afs_PutUser(au, 0); + } + if (++(state->index) >= num || !(*sysnamelist)[state->index]) + return 0; /* end of list */ + } + strcpy(state->name+state->offset, (*sysnamelist)[state->index]); + return 1; } #if (defined(AFS_SGI62_ENV) || defined(AFS_SUN57_64BIT_ENV)) -extern int BlobScan(ino64_t *afile, afs_int32 ablob); +extern int BlobScan(ino64_t * afile, afs_int32 ablob); +#else +#if defined(AFS_HPUX1123_ENV) +/* DEE should use the new afs_inode_t for all */ +extern int BlobScan(ino_t *afile, afs_int32 ablob); #else #if defined AFS_LINUX_64BIT_KERNEL extern int BlobScan(long *afile, afs_int32 ablob); #else -extern int BlobScan(afs_int32 *afile, afs_int32 ablob); +extern int BlobScan(afs_int32 * afile, afs_int32 ablob); +#endif #endif #endif @@ -525,11 +536,10 @@ extern int BlobScan(afs_int32 *afile, afs_int32 ablob); * ensure that vcaches created for failed RPC's to older servers have the * CForeign bit set. */ -struct vcache * BStvc = (struct vcache *) 0; -int afs_DoBulkStat(adp, dirCookie, areqp) - struct vcache *adp; - long dirCookie; - struct vrequest *areqp; +static struct vcache *BStvc = NULL; + +int +afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp) { int nentries; /* # of entries to prefetch */ int nskip; /* # of slots in the LRU queue to skip */ @@ -537,7 +547,7 @@ int afs_DoBulkStat(adp, dirCookie, areqp) struct dcache *dcp; /* chunk containing the dir block */ char *statMemp; /* status memory block */ char *cbfMemp; /* callback and fid memory block */ - long temp; /* temp for holding chunk length, &c. */ + afs_size_t temp; /* temp for holding chunk length, &c. */ struct AFSFid *fidsp; /* file IDs were collecting */ struct AFSCallBack *cbsp; /* call back pointers */ struct AFSCallBack *tcbp; /* temp callback ptr */ @@ -551,53 +561,51 @@ int afs_DoBulkStat(adp, dirCookie, areqp) struct conn *tcp; /* conn for call */ AFSCBs cbParm; /* callback parm for bulk stat */ struct server *hostp = 0; /* host we got callback from */ - long origEvenCBs; /* original # of callbacks for even-fid files */ - long origOddCBs; /* original # of callbacks for odd-fid files */ - long origEvenZaps; /* original # of recycles for even-fid files */ - long origOddZaps; /* original # of recycles for odd-fid files */ long startTime; /* time we started the call, * for callback expiration base */ - int statSeqNo; /* Valued of file size to detect races */ + afs_size_t statSeqNo; /* Valued of file size to detect races */ int code; /* error code */ long newIndex; /* new index in the dir */ struct DirEntry *dirEntryp; /* dir entry we are examining */ int i; struct VenusFid afid; /* file ID we are using now */ struct VenusFid tfid; /* another temp. file ID */ - afs_int32 retry; /* handle low-level SGI MP race conditions */ + afs_int32 retry; /* handle low-level SGI MP race conditions */ long volStates; /* flags from vol structure */ - struct volume *volp=0; /* volume ptr */ + struct volume *volp = 0; /* volume ptr */ struct VenusFid dotdot; - int flagIndex; /* First file with bulk fetch flag set */ - int inlinebulk=0; /* Did we use InlineBulk RPC or not? */ + int flagIndex; /* First file with bulk fetch flag set */ + int inlinebulk = 0; /* Did we use InlineBulk RPC or not? */ XSTATS_DECLS - - /* first compute some basic parameters. We dont want to prefetch more - * than a fraction of the cache in any given call, and we want to preserve - * a portion of the LRU queue in any event, so as to avoid thrashing - * the entire stat cache (we will at least leave some of it alone). - * presently dont stat more than 1/8 the cache in any one call. */ - nentries = afs_cacheStats / 8; + /* first compute some basic parameters. We dont want to prefetch more + * than a fraction of the cache in any given call, and we want to preserve + * a portion of the LRU queue in any event, so as to avoid thrashing + * the entire stat cache (we will at least leave some of it alone). + * presently dont stat more than 1/8 the cache in any one call. */ + nentries = afs_cacheStats / 8; /* dont bother prefetching more than one calls worth of info */ - if (nentries > AFSCBMAX) nentries = AFSCBMAX; + if (nentries > AFSCBMAX) + nentries = AFSCBMAX; /* heuristic to make sure that things fit in 4K. This means that * we shouldnt make it any bigger than 47 entries. I am typically * going to keep it a little lower, since we don't want to load * too much of the stat cache. */ - if (nentries > 30) nentries = 30; + if (nentries > 30) + nentries = 30; /* now, to reduce the stack size, well allocate two 4K blocks, * one for fids and callbacks, and one for stat info. Well set * up our pointers to the memory from there, too. */ statMemp = osi_AllocLargeSpace(nentries * sizeof(AFSFetchStatus)); - statsp = (struct AFSFetchStatus *) statMemp; - cbfMemp = osi_AllocLargeSpace(nentries * - (sizeof(AFSCallBack) + sizeof(AFSFid))); + statsp = (struct AFSFetchStatus *)statMemp; + cbfMemp = + osi_AllocLargeSpace(nentries * + (sizeof(AFSCallBack) + sizeof(AFSFid))); fidsp = (AFSFid *) cbfMemp; cbsp = (AFSCallBack *) (cbfMemp + nentries * sizeof(AFSFid)); @@ -606,11 +614,12 @@ int afs_DoBulkStat(adp, dirCookie, areqp) * We skip files that already have stat cache entries, since we * dont want to bulk stat files that are already in the cache. */ -tagain: + tagain: code = afs_VerifyVCache(adp, areqp); - if (code) goto done; + if (code) + goto done; - dcp = afs_GetDCache(adp, 0, areqp, &temp, &temp, 1); + dcp = afs_GetDCache(adp, (afs_size_t) 0, areqp, &temp, &temp, 1); if (!dcp) { code = ENOENT; goto done; @@ -618,6 +627,7 @@ tagain: /* lock the directory cache entry */ ObtainReadLock(&adp->lock); + ObtainReadLock(&dcp->lock); /* * Make sure that the data in the cache is current. There are two @@ -626,15 +636,20 @@ tagain: * 2. The cache data is no longer valid */ while ((adp->states & CStatd) - && (dcp->flags & DFFetching) + && (dcp->dflags & DFFetching) && hsame(adp->m.DataVersion, dcp->f.versionNo)) { - dcp->flags |= DFWaiting; + afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAIT, ICL_TYPE_STRING, + __FILE__, ICL_TYPE_INT32, __LINE__, ICL_TYPE_POINTER, dcp, + ICL_TYPE_INT32, dcp->dflags); + ReleaseReadLock(&dcp->lock); ReleaseReadLock(&adp->lock); afs_osi_Sleep(&dcp->validPos); ObtainReadLock(&adp->lock); + ObtainReadLock(&dcp->lock); } if (!(adp->states & CStatd) || !hsame(adp->m.DataVersion, dcp->f.versionNo)) { + ReleaseReadLock(&dcp->lock); ReleaseReadLock(&adp->lock); afs_PutDCache(dcp); goto tagain; @@ -652,24 +667,27 @@ tagain: /* now we have dir data in the cache, so scan the dir page */ fidIndex = 0; flagIndex = 0; - while (1) { /* Should probably have some constant bound */ + while (1) { /* Should probably have some constant bound */ /* look for first safe entry to examine in the directory. BlobScan * looks for a the 1st allocated dir after the dirCookie slot. */ - newIndex = BlobScan(&dcp->f.inode, (dirCookie>>5)); - if (newIndex == 0) break; + newIndex = BlobScan(&dcp->f.inode, (dirCookie >> 5)); + if (newIndex == 0) + break; /* remember the updated directory cookie */ dirCookie = newIndex << 5; /* get a ptr to the dir entry */ - dirEntryp =(struct DirEntry *)afs_dir_GetBlob(&dcp->f.inode, newIndex); - if (!dirEntryp) break; + dirEntryp = + (struct DirEntry *)afs_dir_GetBlob(&dcp->f.inode, newIndex); + if (!dirEntryp) + break; /* dont copy more than we have room for */ if (fidIndex >= nentries) { - DRelease((char *) dirEntryp, 0); - break; + DRelease((struct buffer *)dirEntryp, 0); + break; } /* now, if the dir entry looks good, copy it out to our list. Vnode @@ -685,25 +703,25 @@ tagain: tfid.Fid.Vnode = ntohl(dirEntryp->fid.vnode); tfid.Fid.Unique = ntohl(dirEntryp->fid.vunique); do { - retry = 0; - ObtainWriteLock(&afs_xvcache, 130); - tvcp = afs_FindVCache(&tfid, 0, 0, &retry, 0 /* no stats | LRU */); - if (tvcp && retry) { - ReleaseWriteLock(&afs_xvcache); - afs_PutVCache(tvcp); - } + retry = 0; + ObtainWriteLock(&afs_xvcache, 130); + tvcp = afs_FindVCache(&tfid, &retry, 0 /* no stats | LRU */ ); + if (tvcp && retry) { + ReleaseWriteLock(&afs_xvcache); + afs_PutVCache(tvcp); + } } while (tvcp && retry); - if (!tvcp) { /* otherwise, create manually */ - tvcp = afs_NewVCache(&tfid, hostp, 0, 0); - ObtainWriteLock(&tvcp->lock, 505); - ReleaseWriteLock(&afs_xvcache); - afs_RemoveVCB(&tfid); - ReleaseWriteLock(&tvcp->lock); + if (!tvcp) { /* otherwise, create manually */ + tvcp = afs_NewVCache(&tfid, hostp); + ObtainWriteLock(&tvcp->lock, 505); + ReleaseWriteLock(&afs_xvcache); + afs_RemoveVCB(&tfid); + ReleaseWriteLock(&tvcp->lock); } else { - ReleaseWriteLock(&afs_xvcache); + ReleaseWriteLock(&afs_xvcache); } if (!tvcp) - goto done; /* can't happen at present, more's the pity */ + goto done; /* can't happen at present, more's the pity */ /* WARNING: afs_DoBulkStat uses the Length field to store a * sequence number for each bulk status request. Under no @@ -711,14 +729,14 @@ tagain: * if the new length will be ignored when afs_ProcessFS is * called with new stats. */ #ifdef AFS_SGI_ENV - if (!(tvcp->states & (CStatd|CBulkFetching)) - && (tvcp->execsOrWriters <= 0) - && !afs_DirtyPages(tvcp) - && !AFS_VN_MAPPED((vnode_t*)tvcp)) + if (!(tvcp->states & (CStatd | CBulkFetching)) + && (tvcp->execsOrWriters <= 0) + && !afs_DirtyPages(tvcp) + && !AFS_VN_MAPPED((vnode_t *) tvcp)) #else - if (!(tvcp->states & (CStatd|CBulkFetching)) - && (tvcp->execsOrWriters <= 0) - && !afs_DirtyPages(tvcp)) + if (!(tvcp->states & (CStatd | CBulkFetching)) + && (tvcp->execsOrWriters <= 0) + && !afs_DirtyPages(tvcp)) #endif { @@ -736,31 +754,36 @@ tagain: * preserve the value of the file size. We could * flush the pages, but it wouldn't be worthwhile. */ - memcpy((char *)(fidsp+fidIndex), (char *) &tfid.Fid, sizeof(*fidsp)); + memcpy((char *)(fidsp + fidIndex), (char *)&tfid.Fid, + sizeof(*fidsp)); tvcp->states |= CBulkFetching; tvcp->m.Length = statSeqNo; fidIndex++; } afs_PutVCache(tvcp); - } /* if dir vnode has non-zero entry */ + } + /* if dir vnode has non-zero entry */ /* move to the next dir entry by adding in the # of entries * used by this dir entry. */ temp = afs_dir_NameBlobs(dirEntryp->name) << 5; - DRelease((char *) dirEntryp, 0); - if (temp <= 0) break; + DRelease((struct buffer *)dirEntryp, 0); + if (temp <= 0) + break; dirCookie += temp; - } /* while loop over all dir entries */ + } /* while loop over all dir entries */ /* now release the dir lock and prepare to make the bulk RPC */ + ReleaseReadLock(&dcp->lock); ReleaseReadLock(&adp->lock); /* release the chunk */ afs_PutDCache(dcp); /* dont make a null call */ - if (fidIndex == 0) goto done; + if (fidIndex == 0) + goto done; do { /* setup the RPC parm structures */ @@ -778,34 +801,37 @@ tagain: if (tcp) { hostp = tcp->srvr->server; XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_BULKSTATUS); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ -#ifdef notdef - code = RXAFS_InlineBulkStatus(tcp->id, &fidParm, &statParm, - &cbParm, &volSync); - if (code == RXGEN_OPCODE) { -#endif - code = RXAFS_BulkStatus(tcp->id, &fidParm, &statParm, &cbParm, - &volSync); - inlinebulk=0; -#ifdef notdef + RX_AFS_GUNLOCK(); + + if (!(tcp->srvr->server->flags & SNO_INLINEBULK)) { + code = + RXAFS_InlineBulkStatus(tcp->id, &fidParm, &statParm, + &cbParm, &volSync); + if (code == RXGEN_OPCODE) { + tcp->srvr->server->flags |= SNO_INLINEBULK; + inlinebulk = 0; + code = + RXAFS_BulkStatus(tcp->id, &fidParm, &statParm, + &cbParm, &volSync); + } else + inlinebulk = 1; } else { - inlinebulk=1; + inlinebulk = 0; + code = + RXAFS_BulkStatus(tcp->id, &fidParm, &statParm, &cbParm, + &volSync); } -#endif - -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); XSTATS_END_TIME; - } - else code = -1; - } while (afs_Analyze(tcp, code, &adp->fid, areqp, - AFS_STATS_FS_RPCIDX_BULKSTATUS, SHARED_LOCK, (struct cell *)0)); + } else + code = -1; + } while (afs_Analyze + (tcp, code, &adp->fid, areqp, AFS_STATS_FS_RPCIDX_BULKSTATUS, + SHARED_LOCK, NULL)); /* now, if we didnt get the info, bail out. */ - if (code) goto done; + if (code) + goto done; /* we need vol flags to create the entries properly */ dotdot.Fid.Volume = 0; @@ -814,8 +840,8 @@ tagain: volStates = volp->states; if (volp->dotdot.Fid.Volume != 0) dotdot = volp->dotdot; - } - else volStates = 0; + } else + volStates = 0; /* find the place to merge the info into We do this by skipping * nskip entries in the LRU queue. The more we skip, the more @@ -823,27 +849,30 @@ tagain: * referenced file. */ reskip: - nskip = afs_cacheStats / 2; /* preserved fraction of the cache */ + nskip = afs_cacheStats / 2; /* preserved fraction of the cache */ ObtainReadLock(&afs_xvcache); if (QEmpty(&VLRU)) { - /* actually a serious error, probably should panic. Probably will - * panic soon, oh well. */ - ReleaseReadLock(&afs_xvcache); - afs_warnuser("afs_DoBulkStat: VLRU empty!"); - goto done; + /* actually a serious error, probably should panic. Probably will + * panic soon, oh well. */ + ReleaseReadLock(&afs_xvcache); + afs_warnuser("afs_DoBulkStat: VLRU empty!"); + goto done; } if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { - refpanic ("Bulkstat VLRU inconsistent"); + refpanic("Bulkstat VLRU inconsistent"); } - for(tq = VLRU.next; tq != &VLRU; tq = QNext(tq)) { - if (--nskip <= 0) break; + for (tq = VLRU.next; tq != &VLRU; tq = QNext(tq)) { + if (--nskip <= 0) + break; else if (QNext(QPrev(tq)) != tq) { - BStvc = QTOV(tq); - refpanic ("BulkStat VLRU inconsistent"); + BStvc = QTOV(tq); + refpanic("BulkStat VLRU inconsistent"); } } - if (tq != &VLRU) lruvcp = QTOV(tq); - else lruvcp = QTOV(VLRU.next); + if (tq != &VLRU) + lruvcp = QTOV(tq); + else + lruvcp = QTOV(VLRU.next); /* now we have to hold this entry, so that it does not get moved * into the free list while we're running. It could still get @@ -852,9 +881,9 @@ tagain: */ retry = 0; osi_vnhold(lruvcp, &retry); - ReleaseReadLock(&afs_xvcache); /* could be read lock */ + ReleaseReadLock(&afs_xvcache); /* could be read lock */ if (retry) - goto reskip; + goto reskip; /* otherwise, merge in the info. We have to be quite careful here, * since we need to ensure that we don't merge old info over newer @@ -865,18 +894,18 @@ tagain: * * We also have to take into account racing token revocations. */ - for(i=0; ierrorCode) + for (i = 0; i < fidIndex; i++) { + if ((&statsp[i])->errorCode) continue; afid.Cell = adp->fid.Cell; afid.Fid.Volume = adp->fid.Fid.Volume; afid.Fid.Vnode = fidsp[i].Vnode; afid.Fid.Unique = fidsp[i].Unique; do { - retry = 0; - ObtainReadLock(&afs_xvcache); - tvcp = afs_FindVCache(&afid, 1, 0, &retry, 0/* !stats&!lru*/); - ReleaseReadLock(&afs_xvcache); + retry = 0; + ObtainReadLock(&afs_xvcache); + tvcp = afs_FindVCache(&afid, &retry, 0 /* !stats&!lru */ ); + ReleaseReadLock(&afs_xvcache); } while (tvcp && retry); /* The entry may no longer exist */ @@ -885,7 +914,7 @@ tagain: } /* now we have the entry held, but we need to fill it in */ - ObtainWriteLock(&tvcp->lock,131); + ObtainWriteLock(&tvcp->lock, 131); /* if CBulkFetching is not set, or if the file size no longer * matches the value we placed there when we set the CBulkFetching @@ -901,37 +930,42 @@ tagain: } /* now copy ".." entry back out of volume structure, if necessary */ - if (tvcp->mvstat == 2 && (dotdot.Fid.Volume != 0)) { + if (tvcp->mvstat == 2 && (dotdot.Fid.Volume != 0)) { if (!tvcp->mvid) - tvcp->mvid = (struct VenusFid *) osi_AllocSmallSpace(sizeof(struct VenusFid)); + tvcp->mvid = (struct VenusFid *) + osi_AllocSmallSpace(sizeof(struct VenusFid)); *tvcp->mvid = dotdot; } - ObtainWriteLock(&afs_xvcache,132); + ObtainWriteLock(&afs_xvcache, 132); if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { - refpanic ("Bulkstat VLRU inconsistent2"); + refpanic("Bulkstat VLRU inconsistent2"); + } + if ((QNext(QPrev(&tvcp->vlruq)) != &tvcp->vlruq) + || (QPrev(QNext(&tvcp->vlruq)) != &tvcp->vlruq)) { + refpanic("Bulkstat VLRU inconsistent4"); + } + if ((QNext(QPrev(&lruvcp->vlruq)) != &lruvcp->vlruq) + || (QPrev(QNext(&lruvcp->vlruq)) != &lruvcp->vlruq)) { + refpanic("Bulkstat VLRU inconsistent5"); } - if ((QNext(QPrev(&tvcp->vlruq)) != &tvcp->vlruq) - || (QPrev(QNext(&tvcp->vlruq)) != &tvcp->vlruq)) - refpanic ("Bulkstat VLRU inconsistent4"); - if ((QNext(QPrev(&lruvcp->vlruq)) != &lruvcp->vlruq) - || (QPrev(QNext(&lruvcp->vlruq)) != &lruvcp->vlruq)) - refpanic ("Bulkstat VLRU inconsistent5"); - - if (tvcp != lruvcp) { /* if they are == don't move it, don't corrupt vlru */ - QRemove(&tvcp->vlruq); - QAdd(&lruvcp->vlruq, &tvcp->vlruq); + + if (tvcp != lruvcp) { /* if they are == don't move it, don't corrupt vlru */ + QRemove(&tvcp->vlruq); + QAdd(&lruvcp->vlruq, &tvcp->vlruq); } if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { - refpanic ("Bulkstat VLRU inconsistent3"); + refpanic("Bulkstat VLRU inconsistent3"); + } + if ((QNext(QPrev(&tvcp->vlruq)) != &tvcp->vlruq) + || (QPrev(QNext(&tvcp->vlruq)) != &tvcp->vlruq)) { + refpanic("Bulkstat VLRU inconsistent5"); + } + if ((QNext(QPrev(&lruvcp->vlruq)) != &lruvcp->vlruq) + || (QPrev(QNext(&lruvcp->vlruq)) != &lruvcp->vlruq)) { + refpanic("Bulkstat VLRU inconsistent6"); } - if ((QNext(QPrev(&tvcp->vlruq)) != &tvcp->vlruq) - || (QPrev(QNext(&tvcp->vlruq)) != &tvcp->vlruq)) - refpanic ("Bulkstat VLRU inconsistent5"); - if ((QNext(QPrev(&lruvcp->vlruq)) != &lruvcp->vlruq) - || (QPrev(QNext(&lruvcp->vlruq)) != &lruvcp->vlruq)) - refpanic ("Bulkstat VLRU inconsistent6"); ReleaseWriteLock(&afs_xvcache); ObtainWriteLock(&afs_xcbhash, 494); @@ -969,9 +1003,12 @@ tagain: afs_bulkStatsDone++; /* merge in vol info */ - if (volStates & VRO) tvcp->states |= CRO; - if (volStates & VBackup) tvcp->states |= CBackup; - if (volStates & VForeign) tvcp->states |= CForeign; + if (volStates & VRO) + tvcp->states |= CRO; + if (volStates & VBackup) + tvcp->states |= CBackup; + if (volStates & VForeign) + tvcp->states |= CForeign; /* merge in the callback info */ tvcp->states |= CTruth; @@ -980,66 +1017,62 @@ tagain: tcbp = cbsp + i; if (tcbp->ExpirationTime != 0) { - tvcp->cbExpires = tcbp->ExpirationTime+startTime; + tvcp->cbExpires = tcbp->ExpirationTime + startTime; tvcp->callback = hostp; tvcp->states |= CStatd; afs_QueueCallback(tvcp, CBHash(tcbp->ExpirationTime), volp); - } - else if (tvcp->states & CRO) { + } else if (tvcp->states & CRO) { /* ordinary callback on a read-only volume -- AFS 3.2 style */ - tvcp->cbExpires = 3600+startTime; + tvcp->cbExpires = 3600 + startTime; tvcp->callback = hostp; tvcp->states |= CStatd; afs_QueueCallback(tvcp, CBHash(3600), volp); - } - else { + } else { tvcp->callback = 0; - tvcp->states &= ~(CStatd|CUnique); + tvcp->states &= ~(CStatd | CUnique); afs_DequeueCallback(tvcp); - if ((tvcp->states & CForeign) || (vType(tvcp) == VDIR)) - osi_dnlc_purgedp (tvcp); /* if it (could be) a directory */ + if ((tvcp->states & CForeign) || (vType(tvcp) == VDIR)) + osi_dnlc_purgedp(tvcp); /* if it (could be) a directory */ } ReleaseWriteLock(&afs_xcbhash); ReleaseWriteLock(&tvcp->lock); /* finally, we're done with the entry */ afs_PutVCache(tvcp); - } /* for all files we got back */ + } /* for all files we got back */ /* finally return the pointer into the LRU queue */ afs_PutVCache(lruvcp); done: /* Be sure to turn off the CBulkFetching flags */ - for(i=flagIndex; ifid.Cell; afid.Fid.Volume = adp->fid.Fid.Volume; afid.Fid.Vnode = fidsp[i].Vnode; afid.Fid.Unique = fidsp[i].Unique; do { - retry = 0; - ObtainReadLock(&afs_xvcache); - tvcp = afs_FindVCache(&afid, 1, 0, &retry, 0/* !stats&!lru*/); - ReleaseReadLock(&afs_xvcache); + retry = 0; + ObtainReadLock(&afs_xvcache); + tvcp = afs_FindVCache(&afid, &retry, 0 /* !stats&!lru */ ); + ReleaseReadLock(&afs_xvcache); } while (tvcp && retry); - if (tvcp != NULL - && (tvcp->states & CBulkFetching) + if (tvcp != NULL && (tvcp->states & CBulkFetching) && (tvcp->m.Length == statSeqNo)) { - tvcp->states &= ~CBulkFetching; + tvcp->states &= ~CBulkFetching; } if (tvcp != NULL) { - afs_PutVCache(tvcp); + afs_PutVCache(tvcp); } } - if ( volp ) + if (volp) afs_PutVolume(volp, READ_LOCK); - + /* If we did the InlineBulk RPC pull out the return code */ if (inlinebulk) { if ((&statsp[0])->errorCode) { - afs_Analyze(tcp, (&statsp[0])->errorCode, &adp->fid, areqp, - AFS_STATS_FS_RPCIDX_BULKSTATUS, SHARED_LOCK, - (struct cell *)0); + afs_Analyze(tcp, (&statsp[0])->errorCode, &adp->fid, areqp, + AFS_STATS_FS_RPCIDX_BULKSTATUS, SHARED_LOCK, NULL); code = (&statsp[0])->errorCode; } } else { @@ -1051,48 +1084,51 @@ tagain: } /* was: (AFS_DEC_ENV) || defined(AFS_OSF30_ENV) || defined(AFS_NCR_ENV) */ -int AFSDOBULK = 1; +static int AFSDOBULK = 1; +int #ifdef AFS_OSF_ENV afs_lookup(adp, ndp) - struct vcache *adp; - struct nameidata *ndp; { - char aname[MAXNAMLEN+1]; /* XXX */ + struct vcache *adp; + struct nameidata *ndp; +{ + char aname[MAXNAMLEN + 1]; /* XXX */ struct vcache **avcp = (struct vcache **)&(ndp->ni_vp); struct ucred *acred = ndp->ni_cred; int wantparent = ndp->ni_nameiop & WANTPARENT; int opflag = ndp->ni_nameiop & OPFLAG; -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) afs_lookup(OSI_VC_ARG(adp), aname, avcp, pnp, flags, rdir, acred) - struct pathname *pnp; - int flags; - struct vnode *rdir; + struct pathname *pnp; + int flags; + struct vnode *rdir; #else #if defined(UKERNEL) afs_lookup(adp, aname, avcp, acred, flags) - int flags; -#else + int flags; +#else afs_lookup(adp, aname, avcp, acred) -#endif /* UKERNEL */ -#endif /* SUN5 || SGI */ - OSI_VC_DECL(adp); - struct vcache **avcp; - char *aname; - struct AFS_UCRED *acred; { +#endif /* UKERNEL */ +#endif /* SUN5 || SGI */ +OSI_VC_DECL(adp); + struct vcache **avcp; + char *aname; + struct AFS_UCRED *acred; +{ #endif struct vrequest treq; - char *tname = (char *)0; - register struct vcache *tvc=0; + char *tname = NULL; + register struct vcache *tvc = 0; register afs_int32 code; register afs_int32 bulkcode = 0; int pass = 0, hit = 0; long dirCookie; - extern afs_int32 afs_mariner; /*Writing activity to log?*/ + extern afs_int32 afs_mariner; /*Writing activity to log? */ OSI_VC_CONVERT(adp) afs_hyper_t versionNo; int no_read_access = 0; - struct sysname_info sysState; /* used only for @sys checking */ + struct sysname_info sysState; /* used only for @sys checking */ int dynrootRetry = 1; struct afs_fakestat_state fakestate; int tryEvalOnly = 0; @@ -1100,14 +1136,14 @@ afs_lookup(adp, aname, avcp, acred) AFS_STATCNT(afs_lookup); afs_InitFakeStat(&fakestate); - if (code = afs_InitReq(&treq, acred)) + if ((code = afs_InitReq(&treq, acred))) goto done; #ifdef AFS_OSF_ENV ndp->ni_dvp = AFSTOV(adp); memcpy(aname, ndp->ni_ptr, ndp->ni_namelen); aname[ndp->ni_namelen] = '\0'; -#endif /* AFS_OSF_ENV */ +#endif /* AFS_OSF_ENV */ #if defined(AFS_DARWIN_ENV) /* Workaround for MacOSX Finder, which tries to look for @@ -1130,26 +1166,26 @@ afs_lookup(adp, aname, avcp, acred) if (code) goto done; - *avcp = (struct vcache *) 0; /* Since some callers don't initialize it */ + *avcp = NULL; /* Since some callers don't initialize it */ /* come back to here if we encounter a non-existent object in a read-only - volume's directory */ + * volume's directory */ redo: - *avcp = (struct vcache *) 0; /* Since some callers don't initialize it */ + *avcp = NULL; /* Since some callers don't initialize it */ bulkcode = 0; if (!(adp->states & CStatd)) { - if (code = afs_VerifyVCache2(adp, &treq)) { + if ((code = afs_VerifyVCache2(adp, &treq))) { goto done; } - } - else code = 0; + } else + code = 0; /* watch for ".." in a volume root */ if (adp->mvstat == 2 && aname[0] == '.' && aname[1] == '.' && !aname[2]) { /* looking up ".." in root via special hacks */ - if (adp->mvid == (struct VenusFid *) 0 || adp->mvid->Fid.Volume == 0) { + if (adp->mvid == (struct VenusFid *)0 || adp->mvid->Fid.Volume == 0) { #ifdef AFS_OSF_ENV extern struct vcache *afs_globalVp; if (adp == afs_globalVp) { @@ -1167,11 +1203,9 @@ afs_lookup(adp, aname, avcp, acred) goto done; } /* otherwise we have the fid here, so we use it */ - tvc = afs_GetVCache(adp->mvid, &treq, (afs_int32 *)0, - (struct vcache*)0, 0); - afs_Trace3(afs_iclSetp, CM_TRACE_GETVCDOTDOT, - ICL_TYPE_FID, adp->mvid, ICL_TYPE_POINTER, tvc, - ICL_TYPE_INT32, code); + tvc = afs_GetVCache(adp->mvid, &treq, NULL, NULL); + afs_Trace3(afs_iclSetp, CM_TRACE_GETVCDOTDOT, ICL_TYPE_FID, adp->mvid, + ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, code); *avcp = tvc; code = (tvc ? 0 : ENOENT); hit = 1; @@ -1179,23 +1213,23 @@ afs_lookup(adp, aname, avcp, acred) osi_Panic("TT1"); } if (code) { - /*printf("LOOKUP GETVCDOTDOT -> %d\n", code);*/ + /*printf("LOOKUP GETVCDOTDOT -> %d\n", code); */ } goto done; } /* now check the access */ - if (treq.uid != adp->last_looker) { - if (!afs_AccessOK(adp, PRSFS_LOOKUP, &treq, CHECK_MODE_BITS)) { - *avcp = (struct vcache *)0; - code = EACCES; - goto done; - } - else adp->last_looker = treq.uid; - } + if (treq.uid != adp->last_looker) { + if (!afs_AccessOK(adp, PRSFS_LOOKUP, &treq, CHECK_MODE_BITS)) { + *avcp = NULL; + code = EACCES; + goto done; + } else + adp->last_looker = treq.uid; + } /* Check for read access as well. We need read access in order to - stat files, but not to stat subdirectories. */ + * stat files, but not to stat subdirectories. */ if (!afs_AccessOK(adp, PRSFS_LOOKUP, &treq, CHECK_MODE_BITS)) no_read_access = 1; @@ -1204,10 +1238,10 @@ afs_lookup(adp, aname, avcp, acred) * I'm not fiddling with the LRUQ here, either, perhaps I should, or else * invent a lightweight version of GetVCache. */ - if (aname[0] == '.' && !aname[1]) { /* special case */ - ObtainReadLock(&afs_xvcache); + if (aname[0] == '.' && !aname[1]) { /* special case */ + ObtainReadLock(&afs_xvcache); osi_vnhold(adp, 0); - ReleaseReadLock(&afs_xvcache); + ReleaseReadLock(&afs_xvcache); code = 0; *avcp = tvc = adp; hit = 1; @@ -1221,28 +1255,27 @@ afs_lookup(adp, aname, avcp, acred) tname = sysState.name; /* 1st Check_AtSys and lookup by tname is required here, for now, - because the dnlc is *not* told to remove entries for the parent - dir of file/dir op that afs_LocalHero likes, but dnlc is informed - if the cached entry for the parent dir is invalidated for a - non-local change. - Otherwise, we'd be able to do a dnlc lookup on an entry ending - w/@sys and know the dnlc was consistent with reality. */ - tvc = osi_dnlc_lookup (adp, tname, WRITE_LOCK); - *avcp = tvc; /* maybe wasn't initialized, but it is now */ + * because the dnlc is *not* told to remove entries for the parent + * dir of file/dir op that afs_LocalHero likes, but dnlc is informed + * if the cached entry for the parent dir is invalidated for a + * non-local change. + * Otherwise, we'd be able to do a dnlc lookup on an entry ending + * w/@sys and know the dnlc was consistent with reality. */ + tvc = osi_dnlc_lookup(adp, tname, WRITE_LOCK); + *avcp = tvc; /* maybe wasn't initialized, but it is now */ if (tvc) { if (no_read_access && vType(tvc) != VDIR && vType(tvc) != VLNK) { /* need read access on dir to stat non-directory / non-link */ - afs_PutVCache(tvc, WRITE_LOCK); - *avcp = (struct vcache *)0; + afs_PutVCache(tvc); + *avcp = NULL; code = EACCES; goto done; } #ifdef AFS_LINUX22_ENV - if (tvc->mvstat == 2) { /* we don't trust the dnlc for root vcaches */ + if (tvc->mvstat == 2) { /* we don't trust the dnlc for root vcaches */ AFS_RELE(tvc); *avcp = 0; - } - else { + } else { code = 0; hit = 1; goto done; @@ -1254,154 +1287,164 @@ afs_lookup(adp, aname, avcp, acred) #endif /* linux22 */ } - { - register struct dcache *tdc; - afs_int32 dirOffset, dirLen; - ino_t theDir; - struct VenusFid tfid; - - /* now we have to lookup the next fid */ - tdc = afs_GetDCache(adp, 0, &treq, &dirOffset, &dirLen, 1); - if (!tdc) { - *avcp = (struct vcache *)0; /* redundant, but harmless */ - code = EIO; - goto done; - } - - /* now we will just call dir package with appropriate inode. - Dirs are always fetched in their entirety for now */ - ObtainReadLock(&adp->lock); + { /* sub-block just to reduce stack usage */ + register struct dcache *tdc; + afs_size_t dirOffset, dirLen; + ino_t theDir; + struct VenusFid tfid; + + /* now we have to lookup the next fid */ + tdc = + afs_GetDCache(adp, (afs_size_t) 0, &treq, &dirOffset, &dirLen, 1); + if (!tdc) { + *avcp = NULL; /* redundant, but harmless */ + code = EIO; + goto done; + } - /* - * Make sure that the data in the cache is current. There are two - * cases we need to worry about: - * 1. The cache data is being fetched by another process. - * 2. The cache data is no longer valid - */ - while ((adp->states & CStatd) - && (tdc->flags & DFFetching) - && hsame(adp->m.DataVersion, tdc->f.versionNo)) { - tdc->flags |= DFWaiting; - ReleaseReadLock(&adp->lock); - afs_osi_Sleep(&tdc->validPos); + /* now we will just call dir package with appropriate inode. + * Dirs are always fetched in their entirety for now */ ObtainReadLock(&adp->lock); - } - if (!(adp->states & CStatd) - || !hsame(adp->m.DataVersion, tdc->f.versionNo)) { - ReleaseReadLock(&adp->lock); - afs_PutDCache(tdc); - goto redo; - } - - /* Save the version number for when we call osi_dnlc_enter */ - hset(versionNo, tdc->f.versionNo); - - /* - * check for, and handle "@sys" if it's there. We should be able - * to avoid the alloc and the strcpy with a little work, but it's - * not pressing. If there aren't any remote users (ie, via the - * NFS translator), we have a slightly easier job. - * the faster way to do this is to check for *aname == '@' and if - * it's there, check for @sys, otherwise, assume there's no @sys - * then, if the lookup fails, check for .*@sys... - */ - /* above now implemented by Check_AtSys and Next_AtSys */ + ObtainReadLock(&tdc->lock); - /* lookup the name in the appropriate dir, and return a cache entry - on the resulting fid */ - theDir = tdc->f.inode; - code = afs_dir_LookupOffset(&theDir, sysState.name, &tfid.Fid, &dirCookie); - - /* If the first lookup doesn't succeed, maybe it's got @sys in the name */ - while (code == ENOENT && Next_AtSys(adp, &treq, &sysState)) { - code = afs_dir_LookupOffset(&theDir, sysState.name, &tfid.Fid, &dirCookie); - } - tname = sysState.name; + /* + * Make sure that the data in the cache is current. There are two + * cases we need to worry about: + * 1. The cache data is being fetched by another process. + * 2. The cache data is no longer valid + */ + while ((adp->states & CStatd) + && (tdc->dflags & DFFetching) + && hsame(adp->m.DataVersion, tdc->f.versionNo)) { + ReleaseReadLock(&tdc->lock); + ReleaseReadLock(&adp->lock); + afs_osi_Sleep(&tdc->validPos); + ObtainReadLock(&adp->lock); + ObtainReadLock(&tdc->lock); + } + if (!(adp->states & CStatd) + || !hsame(adp->m.DataVersion, tdc->f.versionNo)) { + ReleaseReadLock(&tdc->lock); + ReleaseReadLock(&adp->lock); + afs_PutDCache(tdc); + if (tname && tname != aname) + osi_FreeLargeSpace(tname); + goto redo; + } - afs_PutDCache(tdc); + /* Save the version number for when we call osi_dnlc_enter */ + hset(versionNo, tdc->f.versionNo); + + /* + * check for, and handle "@sys" if it's there. We should be able + * to avoid the alloc and the strcpy with a little work, but it's + * not pressing. If there aren't any remote users (ie, via the + * NFS translator), we have a slightly easier job. + * the faster way to do this is to check for *aname == '@' and if + * it's there, check for @sys, otherwise, assume there's no @sys + * then, if the lookup fails, check for .*@sys... + */ + /* above now implemented by Check_AtSys and Next_AtSys */ + + /* lookup the name in the appropriate dir, and return a cache entry + * on the resulting fid */ + theDir = tdc->f.inode; + code = + afs_dir_LookupOffset(&theDir, sysState.name, &tfid.Fid, + &dirCookie); + + /* If the first lookup doesn't succeed, maybe it's got @sys in the name */ + while (code == ENOENT && Next_AtSys(adp, &treq, &sysState)) + code = + afs_dir_LookupOffset(&theDir, sysState.name, &tfid.Fid, + &dirCookie); + tname = sysState.name; + + ReleaseReadLock(&tdc->lock); + afs_PutDCache(tdc); - if (code == ENOENT && afs_IsDynroot(adp) && dynrootRetry) { - ReleaseReadLock(&adp->lock); - dynrootRetry = 0; - if (tname[0] == '.') - afs_LookupAFSDB(tname + 1); - else - afs_LookupAFSDB(tname); - if (tname && tname != aname) osi_FreeLargeSpace(tname); - goto redo; - } else { - ReleaseReadLock(&adp->lock); - } + if (code == ENOENT && afs_IsDynroot(adp) && dynrootRetry) { + ReleaseReadLock(&adp->lock); + dynrootRetry = 0; + if (tname[0] == '.') + afs_LookupAFSDB(tname + 1); + else + afs_LookupAFSDB(tname); + if (tname && tname != aname) + osi_FreeLargeSpace(tname); + goto redo; + } else { + ReleaseReadLock(&adp->lock); + } - /* new fid has same cell and volume */ - tfid.Cell = adp->fid.Cell; - tfid.Fid.Volume = adp->fid.Fid.Volume; - afs_Trace4(afs_iclSetp, CM_TRACE_LOOKUP, ICL_TYPE_POINTER, adp, - ICL_TYPE_STRING, tname, - ICL_TYPE_FID, &tfid, ICL_TYPE_INT32, code); + /* new fid has same cell and volume */ + tfid.Cell = adp->fid.Cell; + tfid.Fid.Volume = adp->fid.Fid.Volume; + afs_Trace4(afs_iclSetp, CM_TRACE_LOOKUP, ICL_TYPE_POINTER, adp, + ICL_TYPE_STRING, tname, ICL_TYPE_FID, &tfid, + ICL_TYPE_INT32, code); - if (code) { - if (code != ENOENT) { - printf("LOOKUP dirLookupOff -> %d\n", code); + if (code) { + if (code != ENOENT) { + printf("LOOKUP dirLookupOff -> %d\n", code); + } + goto done; } - goto done; - } - /* prefetch some entries, if the dir is currently open. The variable - * dirCookie tells us where to start prefetching from. - */ - if (AFSDOBULK && adp->opens > 0 && !(adp->states & CForeign) && !afs_IsDynroot(adp)) { - afs_int32 retry; - /* if the entry is not in the cache, or is in the cache, - * but hasn't been statd, then do a bulk stat operation. + /* prefetch some entries, if the dir is currently open. The variable + * dirCookie tells us where to start prefetching from. */ - do { - retry = 0; - ObtainReadLock(&afs_xvcache); - tvc = afs_FindVCache(&tfid, 1, 0, &retry, 0/* !stats,!lru */); - ReleaseReadLock(&afs_xvcache); - } while (tvc && retry); - - if (!tvc || !(tvc->states & CStatd)) - bulkcode = afs_DoBulkStat(adp, dirCookie, &treq); - else + if (AFSDOBULK && adp->opens > 0 && !(adp->states & CForeign) + && !afs_IsDynroot(adp)) { + afs_int32 retry; + /* if the entry is not in the cache, or is in the cache, + * but hasn't been statd, then do a bulk stat operation. + */ + do { + retry = 0; + ObtainReadLock(&afs_xvcache); + tvc = afs_FindVCache(&tfid, &retry, 0 /* !stats,!lru */ ); + ReleaseReadLock(&afs_xvcache); + } while (tvc && retry); + + if (!tvc || !(tvc->states & CStatd)) + bulkcode = afs_DoBulkStat(adp, dirCookie, &treq); + else + bulkcode = 0; + + /* if the vcache isn't usable, release it */ + if (tvc && !(tvc->states & CStatd)) { + afs_PutVCache(tvc); + tvc = NULL; + } + } else { + tvc = NULL; bulkcode = 0; - - /* if the vcache isn't usable, release it */ - if (tvc && !(tvc->states & CStatd)) { - afs_PutVCache(tvc); - tvc = (struct vcache *) 0; } - } else { - tvc = (struct vcache *) 0; - bulkcode = 0; - } - /* now get the status info, if we don't already have it */ - /* This is kind of weird, but we might wind up accidentally calling - * RXAFS_Lookup because we happened upon a file which legitimately - * has a 0 uniquifier. That is the result of allowing unique to wrap - * to 0. This was fixed in AFS 3.4. For CForeign, Unique == 0 means that - * the file has not yet been looked up. - */ - if (!tvc) { - afs_int32 cached = 0; - if (!tfid.Fid.Unique && (adp->states & CForeign)) { - tvc = afs_LookupVCache(&tfid, &treq, &cached, WRITE_LOCK, - adp, tname); - } - if (!tvc && !bulkcode) { /* lookup failed or wasn't called */ - tvc = afs_GetVCache(&tfid, &treq, &cached, (struct vcache*)0, - WRITE_LOCK); - } - } /* if !tvc */ - } /* sub-block just to reduce stack usage */ + /* now get the status info, if we don't already have it */ + /* This is kind of weird, but we might wind up accidentally calling + * RXAFS_Lookup because we happened upon a file which legitimately + * has a 0 uniquifier. That is the result of allowing unique to wrap + * to 0. This was fixed in AFS 3.4. For CForeign, Unique == 0 means that + * the file has not yet been looked up. + */ + if (!tvc) { + afs_int32 cached = 0; + if (!tfid.Fid.Unique && (adp->states & CForeign)) { + tvc = afs_LookupVCache(&tfid, &treq, &cached, adp, tname); + } + if (!tvc && !bulkcode) { /* lookup failed or wasn't called */ + tvc = afs_GetVCache(&tfid, &treq, &cached, NULL); + } + } /* if !tvc */ + } /* sub-block just to reduce stack usage */ if (tvc) { int force_eval = afs_fakestat_enable ? 0 : 1; if (adp->states & CForeign) - tvc->states |= CForeign; + tvc->states |= CForeign; tvc->parentVnode = adp->fid.Fid.Vnode; tvc->parentUnique = adp->fid.Fid.Unique; tvc->states &= ~CBulkStat; @@ -1420,88 +1463,89 @@ afs_lookup(adp, aname, avcp, acred) force_eval = 1; ReleaseReadLock(&tvc->lock); } - #if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS) - if (!(flags & AFS_LOOKUP_NOEVAL)) - /* don't eval mount points */ + if (!(flags & AFS_LOOKUP_NOEVAL)) + /* don't eval mount points */ #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */ - if (tvc->mvstat == 1 && force_eval) { - /* a mt point, possibly unevaluated */ - struct volume *tvolp; + if (tvc->mvstat == 1 && force_eval) { + /* a mt point, possibly unevaluated */ + struct volume *tvolp; - ObtainWriteLock(&tvc->lock,133); - code = EvalMountPoint(tvc, adp, &tvolp, &treq); - ReleaseWriteLock(&tvc->lock); - - if (code) { - afs_PutVCache(tvc, WRITE_LOCK); - if (tvolp) afs_PutVolume(tvolp, WRITE_LOCK); - goto done; - } + ObtainWriteLock(&tvc->lock, 133); + code = EvalMountPoint(tvc, adp, &tvolp, &treq); + ReleaseWriteLock(&tvc->lock); - /* next, we want to continue using the target of the mt point */ - if (tvc->mvid && (tvc->states & CMValid)) { - struct vcache *uvc; - /* now lookup target, to set .. pointer */ - afs_Trace2(afs_iclSetp, CM_TRACE_LOOKUP1, - ICL_TYPE_POINTER, tvc, ICL_TYPE_FID, &tvc->fid); - uvc = tvc; /* remember for later */ - - if (tvolp && (tvolp->states & VForeign)) { - /* XXXX tvolp has ref cnt on but not locked! XXX */ - tvc = afs_GetRootVCache(tvc->mvid, &treq, (afs_int32 *)0, tvolp, WRITE_LOCK); - } else { - tvc = afs_GetVCache(tvc->mvid, &treq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); + if (code) { + afs_PutVCache(tvc); + if (tvolp) + afs_PutVolume(tvolp, WRITE_LOCK); + goto done; } - afs_PutVCache(uvc, WRITE_LOCK); /* we're done with it */ - if (!tvc) { - code = ENOENT; + /* next, we want to continue using the target of the mt point */ + if (tvc->mvid && (tvc->states & CMValid)) { + struct vcache *uvc; + /* now lookup target, to set .. pointer */ + afs_Trace2(afs_iclSetp, CM_TRACE_LOOKUP1, + ICL_TYPE_POINTER, tvc, ICL_TYPE_FID, + &tvc->fid); + uvc = tvc; /* remember for later */ + + if (tvolp && (tvolp->states & VForeign)) { + /* XXXX tvolp has ref cnt on but not locked! XXX */ + tvc = + afs_GetRootVCache(tvc->mvid, &treq, NULL, tvolp); + } else { + tvc = afs_GetVCache(tvc->mvid, &treq, NULL, NULL); + } + afs_PutVCache(uvc); /* we're done with it */ + + if (!tvc) { + code = ENOENT; + if (tvolp) { + afs_PutVolume(tvolp, WRITE_LOCK); + } + goto done; + } + + /* now, if we came via a new mt pt (say because of a new + * release of a R/O volume), we must reevaluate the .. + * ptr to point back to the appropriate place */ if (tvolp) { + ObtainWriteLock(&tvc->lock, 134); + if (tvc->mvid == NULL) { + tvc->mvid = (struct VenusFid *) + osi_AllocSmallSpace(sizeof(struct VenusFid)); + } + /* setup backpointer */ + *tvc->mvid = tvolp->dotdot; + ReleaseWriteLock(&tvc->lock); afs_PutVolume(tvolp, WRITE_LOCK); } + } else { + afs_PutVCache(tvc); + code = ENOENT; + if (tvolp) + afs_PutVolume(tvolp, WRITE_LOCK); goto done; } - - /* now, if we came via a new mt pt (say because of a new - * release of a R/O volume), we must reevaluate the .. - * ptr to point back to the appropriate place */ - if (tvolp) { - ObtainWriteLock(&tvc->lock,134); - if (tvc->mvid == (struct VenusFid *) 0) { - tvc->mvid = (struct VenusFid *) osi_AllocSmallSpace(sizeof(struct VenusFid)); - } - /* setup backpointer */ - *tvc->mvid = tvolp->dotdot; - ReleaseWriteLock(&tvc->lock); - afs_PutVolume(tvolp, WRITE_LOCK); - } } - else { - afs_PutVCache(tvc, WRITE_LOCK); - code = ENOENT; - if (tvolp) afs_PutVolume(tvolp, WRITE_LOCK); - goto done; - } - } *avcp = tvc; if (tvc && !VREFCOUNT(tvc)) { osi_Panic("TT3"); } code = 0; - } - else { + } else { /* if we get here, we found something in a directory that couldn't - be located (a Multics "connection failure"). If the volume is - read-only, we try flushing this entry from the cache and trying - again. */ + * be located (a Multics "connection failure"). If the volume is + * read-only, we try flushing this entry from the cache and trying + * again. */ if (pass == 0) { struct volume *tv; tv = afs_GetVolume(&adp->fid, &treq, READ_LOCK); if (tv) { if (tv->states & VRO) { - pass = 1; /* try this *once* */ + pass = 1; /* try this *once* */ ObtainWriteLock(&afs_xcbhash, 495); afs_DequeueCallback(adp); /* re-stat to get later version */ @@ -1517,52 +1561,54 @@ afs_lookup(adp, aname, avcp, acred) code = ENOENT; } -done: + done: /* put the network buffer back, if need be */ - if (tname != aname && tname) osi_FreeLargeSpace(tname); + if (tname != aname && tname) + osi_FreeLargeSpace(tname); if (code == 0) { #ifdef AFS_OSF_ENV /* Handle RENAME; only need to check rename "." */ if (opflag == RENAME && wantparent && *ndp->ni_next == 0) { - if (!FidCmp(&(tvc->fid), &(adp->fid))) { - afs_PutVCache(*avcp, WRITE_LOCK); + if (!FidCmp(&(tvc->fid), &(adp->fid))) { + afs_PutVCache(*avcp); *avcp = NULL; afs_PutFakeStat(&fakestate); return afs_CheckCode(EISDIR, &treq, 18); } } -#endif /* AFS_OSF_ENV */ +#endif /* AFS_OSF_ENV */ if (afs_mariner) - afs_AddMarinerName(aname, tvc); + afs_AddMarinerName(aname, tvc); #if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS) - if (!(flags & AFS_LOOKUP_NOEVAL)) - /* Here we don't enter the name into the DNLC because we want the - evaluated mount dir to be there (the vcache for the mounted volume) - rather than the vc of the mount point itself. we can still find the - mount point's vc in the vcache by its fid. */ + if (!(flags & AFS_LOOKUP_NOEVAL)) + /* Here we don't enter the name into the DNLC because we want the + * evaluated mount dir to be there (the vcache for the mounted volume) + * rather than the vc of the mount point itself. we can still find the + * mount point's vc in the vcache by its fid. */ #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */ - if (!hit) { - osi_dnlc_enter (adp, aname, tvc, &versionNo); - } - else { + if (!hit) { + osi_dnlc_enter(adp, aname, tvc, &versionNo); + } else { #ifdef AFS_LINUX20_ENV - /* So Linux inode cache is up to date. */ - code = afs_VerifyVCache(tvc, &treq); + /* So Linux inode cache is up to date. */ + code = afs_VerifyVCache(tvc, &treq); #else - afs_PutFakeStat(&fakestate); - return 0; /* can't have been any errors if hit and !code */ + afs_PutFakeStat(&fakestate); + return 0; /* can't have been any errors if hit and !code */ #endif - } + } } - if (bulkcode) code = bulkcode; else - code = afs_CheckCode(code, &treq, 19); + if (bulkcode) + code = bulkcode; + else + code = afs_CheckCode(code, &treq, 19); if (code) { - /* If there is an error, make sure *avcp is null. - * Alphas panic otherwise - defect 10719. - */ - *avcp = (struct vcache *)0; + /* If there is an error, make sure *avcp is null. + * Alphas panic otherwise - defect 10719. + */ + *avcp = NULL; } afs_PutFakeStat(&fakestate); diff --git a/src/afs/VNOPS/afs_vnop_open.c b/src/afs/VNOPS/afs_vnop_open.c index 30b0de0eb..4e5f41f26 100644 --- a/src/afs/VNOPS/afs_vnop_open.c +++ b/src/afs/VNOPS/afs_vnop_open.c @@ -15,16 +15,17 @@ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_open.c,v 1.1.1.6 2002/08/02 04:29:02 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_open.c,v 1.10 2003/07/15 23:14:30 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" @@ -32,24 +33,23 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_open.c,v 1.1.1.6 200 * checks are done here, instead they're done by afs_create or afs_access, * both called by the vn_open call. */ +int #ifdef AFS_SGI64_ENV -afs_open(bhv, avcp, aflags, acred) - bhv_desc_t *bhv; +afs_open(bhv_desc_t * bhv, struct vcache **avcp, afs_int32 aflags, + struct AFS_UCRED *acred) #else -afs_open(avcp, aflags, acred) +afs_open(struct vcache **avcp, afs_int32 aflags, struct AFS_UCRED *acred) #endif - register struct vcache **avcp; - afs_int32 aflags; - struct AFS_UCRED *acred; { register afs_int32 code; struct vrequest treq; struct vcache *tvc; int writing; struct afs_fakestat_state fakestate; - + AFS_STATCNT(afs_open); - if (code = afs_InitReq(&treq, acred)) return code; + if ((code = afs_InitReq(&treq, acred))) + return code; #ifdef AFS_SGI64_ENV /* avcpp can be, but is not necesarily, bhp's vnode. */ tvc = VTOAFS(BHV_TO_VNODE(bhv)); @@ -60,31 +60,34 @@ afs_open(avcp, aflags, acred) ICL_TYPE_INT32, aflags); afs_InitFakeStat(&fakestate); code = afs_EvalFakeStat(&tvc, &fakestate, &treq); - if (code) goto done; + if (code) + goto done; code = afs_VerifyVCache(tvc, &treq); - if (code) goto done; - if (aflags & (FWRITE | FTRUNC)) writing = 1; - else writing = 0; + if (code) + goto done; + if (aflags & (FWRITE | FTRUNC)) + writing = 1; + else + writing = 0; if (vType(tvc) == VDIR) { /* directory */ if (writing) { code = EISDIR; goto done; - } - else { - if (!afs_AccessOK(tvc, - ((tvc->states & CForeign) ? PRSFS_READ: PRSFS_LOOKUP), - &treq, CHECK_MODE_BITS)) { + } else { + if (!afs_AccessOK + (tvc, ((tvc->states & CForeign) ? PRSFS_READ : PRSFS_LOOKUP), + &treq, CHECK_MODE_BITS)) { code = EACCES; goto done; } } - } - else { + } else { #ifdef AFS_SUN5_ENV - if (AFS_NFSXLATORREQ(acred) && (aflags & FREAD)) { - if (!afs_AccessOK(tvc, PRSFS_READ, &treq, - CHECK_MODE_BITS|CMB_ALLOW_EXEC_AS_READ)) { + if (AFS_NFSXLATORREQ(acred) && (aflags & FREAD)) { + if (!afs_AccessOK + (tvc, PRSFS_READ, &treq, + CHECK_MODE_BITS | CMB_ALLOW_EXEC_AS_READ)) { code = EACCES; goto done; } @@ -94,32 +97,32 @@ afs_open(avcp, aflags, acred) if (aflags & FRSHARE) { /* * Hack for AIX 4.1: - * Apparently it is possible for a file to get mapped without - * either VNOP_MAP or VNOP_RDWR being called, if (1) it is a - * sharable library, and (2) it has already been loaded. We must - * ensure that the credp is up to date. We detect the situation - * by checking for O_RSHARE at open time. + * Apparently it is possible for a file to get mapped without + * either VNOP_MAP or VNOP_RDWR being called, if (1) it is a + * sharable library, and (2) it has already been loaded. We must + * ensure that the credp is up to date. We detect the situation + * by checking for O_RSHARE at open time. */ /* * We keep the caller's credentials since an async daemon will * handle the request at some point. We assume that the same * credentials will be used. */ - ObtainWriteLock(&tvc->lock,140); + ObtainWriteLock(&tvc->lock, 140); if (!tvc->credp || (tvc->credp != acred)) { - crhold(acred); - if (tvc->credp) { - struct ucred *crp = tvc->credp; - tvc->credp = (struct ucred *)0; - crfree(crp); - } - tvc->credp = acred; + crhold(acred); + if (tvc->credp) { + struct ucred *crp = tvc->credp; + tvc->credp = NULL; + crfree(crp); + } + tvc->credp = acred; } ReleaseWriteLock(&tvc->lock); } #endif /* normal file or symlink */ - osi_FlushText(tvc); /* only needed to flush text if text locked last time */ + osi_FlushText(tvc); /* only needed to flush text if text locked last time */ #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) afs_BozonLock(&tvc->pvnLock, tvc); #endif @@ -131,13 +134,14 @@ afs_open(avcp, aflags, acred) /* set date on file if open in O_TRUNC mode */ if (aflags & FTRUNC) { /* this fixes touch */ - ObtainWriteLock(&tvc->lock,123); + ObtainWriteLock(&tvc->lock, 123); tvc->m.Date = osi_Time(); tvc->states |= CDirty; ReleaseWriteLock(&tvc->lock); } ObtainReadLock(&tvc->lock); - if (writing) tvc->execsOrWriters++; + if (writing) + tvc->execsOrWriters++; tvc->opens++; #if defined(AFS_SGI_ENV) if (writing && tvc->cred == NULL) { @@ -146,9 +150,9 @@ afs_open(avcp, aflags, acred) } #endif ReleaseReadLock(&tvc->lock); -done: + done: afs_PutFakeStat(&fakestate); - code = afs_CheckCode(code, &treq, 4); /* avoid AIX -O bug */ + code = afs_CheckCode(code, &treq, 4); /* avoid AIX -O bug */ afs_Trace2(afs_iclSetp, CM_TRACE_OPEN, ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, 999999); diff --git a/src/afs/VNOPS/afs_vnop_read.c b/src/afs/VNOPS/afs_vnop_read.c index 12e7f4260..960d2aadf 100644 --- a/src/afs/VNOPS/afs_vnop_read.c +++ b/src/afs/VNOPS/afs_vnop_read.c @@ -11,57 +11,56 @@ * Implements: * afs_MemRead * afs_PrefetchChunk - * afs_UFSReadFast * afs_UFSRead * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_read.c,v 1.1.1.7 2002/09/26 18:58:24 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_read.c,v 1.25 2003/08/27 21:43:19 rees Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" extern char afs_zeros[AFS_ZEROS]; afs_int32 maxIHint; -afs_int32 nihints; /* # of above actually in-use */ +afs_int32 nihints; /* # of above actually in-use */ afs_int32 usedihint; /* Imported variables */ extern afs_rwlock_t afs_xdcache; extern unsigned char *afs_indexFlags; -extern afs_hyper_t *afs_indexTimes; /* Dcache entry Access times */ -extern afs_hyper_t afs_indexCounter; /* Fake time for marking index */ +extern afs_hyper_t *afs_indexTimes; /* Dcache entry Access times */ +extern afs_hyper_t afs_indexCounter; /* Fake time for marking index */ /* Forward declarations */ void afs_PrefetchChunk(struct vcache *avc, struct dcache *adc, - struct AFS_UCRED *acred, struct vrequest *areq); - -afs_MemRead(avc, auio, acred, albn, abpp, noLock) - register struct vcache *avc; - struct uio *auio; - struct AFS_UCRED *acred; - daddr_t albn; - int noLock; - struct buf **abpp; { - afs_int32 totalLength; - afs_int32 transferLength; - afs_int32 filePos; - struct dcache *tdc=0; - afs_int32 offset, len, error, trybusy=1; + struct AFS_UCRED *acred, struct vrequest *areq); + +int +afs_MemRead(register struct vcache *avc, struct uio *auio, + struct AFS_UCRED *acred, daddr_t albn, struct buf **abpp, + int noLock) +{ + afs_size_t totalLength; + afs_size_t transferLength; + afs_size_t filePos; + afs_size_t offset, len, tlen; + afs_int32 trimlen; + struct dcache *tdc = 0; + afs_int32 error, trybusy = 1; struct uio tuio; struct iovec *tvec; - char *tfile; afs_int32 code; struct vrequest treq; @@ -70,30 +69,32 @@ afs_MemRead(avc, auio, acred, albn, abpp, noLock) return EIO; /* check that we have the latest status info in the vnode cache */ - if (code = afs_InitReq(&treq, acred)) return code; + if ((code = afs_InitReq(&treq, acred))) + return code; if (!noLock) { code = afs_VerifyVCache(avc, &treq); if (code) { - code = afs_CheckCode(code, &treq, 8); /* failed to get it */ - return code; + code = afs_CheckCode(code, &treq, 8); /* failed to get it */ + return code; } } - #ifndef AFS_VM_RDWR_ENV if (AFS_NFSXLATORREQ(acred)) { - if (!afs_AccessOK(avc, PRSFS_READ, &treq, - CHECK_MODE_BITS|CMB_ALLOW_EXEC_AS_READ)) { + if (!afs_AccessOK + (avc, PRSFS_READ, &treq, + CHECK_MODE_BITS | CMB_ALLOW_EXEC_AS_READ)) { return afs_CheckCode(EACCES, &treq, 9); } } #endif - tvec = (struct iovec *) osi_AllocSmallSpace(sizeof(struct iovec)); + tvec = (struct iovec *)osi_AllocSmallSpace(sizeof(struct iovec)); totalLength = auio->afsio_resid; filePos = auio->afsio_offset; - afs_Trace4(afs_iclSetp, CM_TRACE_READ, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, filePos, ICL_TYPE_INT32, totalLength, - ICL_TYPE_INT32, avc->m.Length); + afs_Trace4(afs_iclSetp, CM_TRACE_READ, ICL_TYPE_POINTER, avc, + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(filePos), ICL_TYPE_INT32, + totalLength, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length)); error = 0; transferLength = 0; if (!noLock) @@ -103,142 +104,217 @@ afs_MemRead(avc, auio, acred, albn, abpp, noLock) hset(avc->flushDV, avc->m.DataVersion); } #endif + + /* + * Locks held: + * avc->lock(R) + */ while (totalLength > 0) { /* read all of the cached info */ - if (filePos >= avc->m.Length) break; /* all done */ + if (filePos >= avc->m.Length) + break; /* all done */ if (noLock) { - if (tdc) afs_PutDCache(tdc); + if (tdc) { + ReleaseReadLock(&tdc->lock); + afs_PutDCache(tdc); + } tdc = afs_FindDCache(avc, filePos); if (tdc) { + ObtainReadLock(&tdc->lock); offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk); len = tdc->f.chunkBytes - offset; } } else { /* a tricky question: does the presence of the DFFetching flag - mean that we're fetching the latest version of the file? No. - The server could update the file as soon as the fetch responsible - for the setting of the DFFetching flag completes. - - However, the presence of the DFFetching flag (visible under a - read lock since it is set and cleared only under a write lock) - means that we're fetching as good a version as was known to this - client at the time of the last call to afs_VerifyVCache, since - the latter updates the stat cache's m.DataVersion field under a - write lock, and from the time that the DFFetching flag goes on - (before the fetch starts), to the time it goes off (after the - fetch completes), afs_GetDCache keeps at least a read lock - (actually it keeps an S lock) on the cache entry. - - This means that if the DFFetching flag is set, we can use that - data for any reads that must come from the current version of - the file (current == m.DataVersion). - - Another way of looking at this same point is this: if we're - fetching some data and then try do an afs_VerifyVCache, the - VerifyVCache operation will not complete until after the - DFFetching flag is turned off and the dcache entry's f.versionNo - field is updated. - - Note, by the way, that if DFFetching is set, - m.DataVersion > f.versionNo (the latter is not updated until - after the fetch completes). + * mean that we're fetching the latest version of the file? No. + * The server could update the file as soon as the fetch responsible + * for the setting of the DFFetching flag completes. + * + * However, the presence of the DFFetching flag (visible under + * a dcache read lock since it is set and cleared only under a + * dcache write lock) means that we're fetching as good a version + * as was known to this client at the time of the last call to + * afs_VerifyVCache, since the latter updates the stat cache's + * m.DataVersion field under a vcache write lock, and from the + * time that the DFFetching flag goes on in afs_GetDCache (before + * the fetch starts), to the time it goes off (after the fetch + * completes), afs_GetDCache keeps at least a read lock on the + * vcache entry. + * + * This means that if the DFFetching flag is set, we can use that + * data for any reads that must come from the current version of + * the file (current == m.DataVersion). + * + * Another way of looking at this same point is this: if we're + * fetching some data and then try do an afs_VerifyVCache, the + * VerifyVCache operation will not complete until after the + * DFFetching flag is turned off and the dcache entry's f.versionNo + * field is updated. + * + * Note, by the way, that if DFFetching is set, + * m.DataVersion > f.versionNo (the latter is not updated until + * after the fetch completes). */ - if (tdc) afs_PutDCache(tdc); /* before reusing tdc */ + if (tdc) { + ReleaseReadLock(&tdc->lock); + afs_PutDCache(tdc); /* before reusing tdc */ + } tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 2); + ObtainReadLock(&tdc->lock); /* now, first try to start transfer, if we'll need the data. If * data already coming, we don't need to do this, obviously. Type * 2 requests never return a null dcache entry, btw. */ - if (!(tdc->flags & DFFetching) + if (!(tdc->dflags & DFFetching) && !hsame(avc->m.DataVersion, tdc->f.versionNo)) { /* have cache entry, it is not coming in now, * and we'll need new data */ -tagain: + tagain: if (trybusy && !afs_BBusy()) { struct brequest *bp; /* daemon is not busy */ - if (!(tdc->flags & DFFetchReq)) { + ObtainSharedLock(&tdc->mflock, 665); + if (!(tdc->mflags & DFFetchReq)) { /* start the daemon (may already be running, however) */ - tdc->flags |= DFFetchReq; + UpgradeSToWLock(&tdc->mflock, 666); + tdc->mflags |= DFFetchReq; bp = afs_BQueue(BOP_FETCH, avc, B_DONTWAIT, 0, acred, - (long)filePos, (long) tdc, 0L, 0L); + (afs_size_t) filePos, (afs_size_t) 0, + tdc); if (!bp) { - tdc->flags &= ~DFFetchReq; + tdc->mflags &= ~DFFetchReq; trybusy = 0; /* Avoid bkg daemon since they're too busy */ + ReleaseWriteLock(&tdc->mflock); goto tagain; } + ConvertWToSLock(&tdc->mflock); /* don't use bp pointer! */ } - while (tdc->flags & DFFetchReq) { + code = 0; + ConvertSToRLock(&tdc->mflock); + while (!code && tdc->mflags & DFFetchReq) { + afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAIT, + ICL_TYPE_STRING, __FILE__, ICL_TYPE_INT32, + __LINE__, ICL_TYPE_POINTER, tdc, + ICL_TYPE_INT32, tdc->dflags); /* don't need waiting flag on this one */ + ReleaseReadLock(&tdc->mflock); + ReleaseReadLock(&tdc->lock); ReleaseReadLock(&avc->lock); - afs_osi_Sleep(&tdc->validPos); + code = afs_osi_SleepSig(&tdc->validPos); ObtainReadLock(&avc->lock); + ObtainReadLock(&tdc->lock); + ObtainReadLock(&tdc->mflock); + } + ReleaseReadLock(&tdc->mflock); + if (code) { + error = code; + break; } } } /* now data may have started flowing in (if DFFetching is on). If - * data is now streaming in, then wait for some interesting stuff. */ - while ((tdc->flags & DFFetching) && tdc->validPos <= filePos) { - /* too early: wait for DFFetching flag to vanish, or data to appear */ - tdc->flags |= DFWaiting; + * data is now streaming in, then wait for some interesting stuff. + */ + code = 0; + while (!code && (tdc->dflags & DFFetching) + && tdc->validPos <= filePos) { + /* too early: wait for DFFetching flag to vanish, + * or data to appear */ + afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAIT, ICL_TYPE_STRING, + __FILE__, ICL_TYPE_INT32, __LINE__, + ICL_TYPE_POINTER, tdc, ICL_TYPE_INT32, + tdc->dflags); + ReleaseReadLock(&tdc->lock); ReleaseReadLock(&avc->lock); - afs_osi_Sleep(&tdc->validPos); + code = afs_osi_SleepSig(&tdc->validPos); ObtainReadLock(&avc->lock); + ObtainReadLock(&tdc->lock); } - /* fetching flag gone, data is here, or we never tried (BBusy for instance) */ - if (tdc->flags & DFFetching) { - /* still fetching, some new data is here: compute length and offset */ + if (code) { + error = code; + break; + } + /* fetching flag gone, data is here, or we never tried + * (BBusy for instance) */ + if (tdc->dflags & DFFetching) { + /* still fetching, some new data is here: + * compute length and offset */ offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk); len = tdc->validPos - filePos; - } - else { - /* no longer fetching, verify data version (avoid new GetDCache call) */ - if (hsame(avc->m.DataVersion, tdc->f.versionNo)) { + } else { + /* no longer fetching, verify data version + * (avoid new GetDCache call) */ + if (hsame(avc->m.DataVersion, tdc->f.versionNo) + && ((len = tdc->validPos - filePos) > 0)) { offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk); - len = tdc->f.chunkBytes - offset; - } - else { + } else { /* don't have current data, so get it below */ + afs_Trace3(afs_iclSetp, CM_TRACE_VERSIONNO, + ICL_TYPE_INT64, ICL_HANDLE_OFFSET(filePos), + ICL_TYPE_HYPER, &avc->m.DataVersion, + ICL_TYPE_HYPER, &tdc->f.versionNo); + ReleaseReadLock(&tdc->lock); afs_PutDCache(tdc); - tdc = (struct dcache *) 0; + tdc = NULL; } } if (!tdc) { + /* If we get, it was not possible to start the + * background daemon. With flag == 1 afs_GetDCache + * does the FetchData rpc synchronously. + */ ReleaseReadLock(&avc->lock); tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 1); ObtainReadLock(&avc->lock); + if (tdc) + ObtainReadLock(&tdc->lock); } } + afs_Trace3(afs_iclSetp, CM_TRACE_VNODEREAD, ICL_TYPE_POINTER, tdc, + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(offset), + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(len)); if (!tdc) { error = EIO; break; } - if (len > totalLength) len = totalLength; /* will read len bytes */ - if (len <= 0) { /* shouldn't get here if DFFetching is on */ + + /* + * Locks held: + * avc->lock(R) + * tdc->lock(R) + */ + + if (len > totalLength) + len = totalLength; /* will read len bytes */ + if (len <= 0) { /* shouldn't get here if DFFetching is on */ /* read past the end of a chunk, may not be at next chunk yet, and yet - also not at eof, so may have to supply fake zeros */ - len = AFS_CHUNKTOSIZE(tdc->f.chunk) - offset; /* bytes left in chunk addr space */ - if (len > totalLength) len = totalLength; /* and still within xfr request */ - code = avc->m.Length - offset; /* and still within file */ - if (len > code) len = code; - if (len > AFS_ZEROS) len = sizeof(afs_zeros); /* and in 0 buffer */ + * also not at eof, so may have to supply fake zeros */ + len = AFS_CHUNKTOSIZE(tdc->f.chunk) - offset; /* bytes left in chunk addr space */ + if (len > totalLength) + len = totalLength; /* and still within xfr request */ + tlen = avc->m.Length - offset; /* and still within file */ + if (len > tlen) + len = tlen; + if (len > AFS_ZEROS) + len = sizeof(afs_zeros); /* and in 0 buffer */ afsio_copy(auio, &tuio, tvec); - afsio_trim(&tuio, len); - AFS_UIOMOVE(afs_zeros, len, UIO_READ, &tuio, code); + trimlen = len; + afsio_trim(&tuio, trimlen); + AFS_UIOMOVE(afs_zeros, trimlen, UIO_READ, &tuio, code); if (code) { error = code; break; } - } - else { + } else { /* get the data from the mem cache */ /* mung uio structure to be right for this transfer */ afsio_copy(auio, &tuio, tvec); - afsio_trim(&tuio, len); + trimlen = len; + afsio_trim(&tuio, trimlen); tuio.afsio_offset = offset; code = afs_MemReadUIO(tdc->f.inode, &tuio); @@ -249,23 +325,32 @@ tagain: } } /* otherwise we've read some, fixup length, etc and continue with next seg */ - len = len - tuio.afsio_resid; /* compute amount really transferred */ - afsio_skip(auio, len); /* update input uio structure */ + len = len - tuio.afsio_resid; /* compute amount really transferred */ + trimlen = len; + afsio_skip(auio, trimlen); /* update input uio structure */ totalLength -= len; transferLength += len; filePos += len; - if (len <= 0) break; /* surprise eof */ - } /* the whole while loop */ + if (len <= 0) + break; /* surprise eof */ + } /* the whole while loop */ + + /* + * Locks held: + * avc->lock(R) + * tdc->lock(R) if tdc + */ /* if we make it here with tdc non-zero, then it is the last chunk we * dealt with, and we have to release it when we're done. We hold on * to it in case we need to do a prefetch. */ if (tdc) { -#ifndef AFS_VM_RDWR_ENV + ReleaseReadLock(&tdc->lock); +#if !defined(AFS_VM_RDWR_ENV) /* try to queue prefetch, if needed */ - if (!(tdc->flags & DFNextStarted) && !noLock) { + if (!noLock) { afs_PrefetchChunk(avc, tdc, acred, &treq); } #endif @@ -284,217 +369,89 @@ tagain: * flag in the prefetched block, so that the next call to read knows to wait * for the daemon to start doing things. * - * This function must be called with the vnode at least read-locked - * because it plays around with dcache entries. + * This function must be called with the vnode at least read-locked, and + * no locks on the dcache, because it plays around with dcache entries. */ -void afs_PrefetchChunk(struct vcache *avc, struct dcache *adc, - struct AFS_UCRED *acred, struct vrequest *areq) +void +afs_PrefetchChunk(struct vcache *avc, struct dcache *adc, + struct AFS_UCRED *acred, struct vrequest *areq) { register struct dcache *tdc; - register afs_int32 offset; - afs_int32 j1, j2; /* junk vbls for GetDCache to trash */ - - offset = adc->f.chunk+1; /* next chunk we'll need */ - offset = AFS_CHUNKTOBASE(offset); /* base of next chunk */ - if (offset < avc->m.Length && !afs_BBusy()) { + afs_size_t offset; + afs_size_t j1, j2; /* junk vbls for GetDCache to trash */ + + offset = adc->f.chunk + 1; /* next chunk we'll need */ + offset = AFS_CHUNKTOBASE(offset); /* base of next chunk */ + ObtainReadLock(&adc->lock); + ObtainSharedLock(&adc->mflock, 662); + if (offset < avc->m.Length && !(adc->mflags & DFNextStarted) + && !afs_BBusy()) { struct brequest *bp; - adc->flags |= DFNextStarted; /* we've tried to prefetch for this guy */ + + UpgradeSToWLock(&adc->mflock, 663); + adc->mflags |= DFNextStarted; /* we've tried to prefetch for this guy */ + ReleaseWriteLock(&adc->mflock); + ReleaseReadLock(&adc->lock); + tdc = afs_GetDCache(avc, offset, areq, &j1, &j2, 2); /* type 2 never returns 0 */ - if (!(tdc->flags & DFFetchReq)) { + ObtainSharedLock(&tdc->mflock, 651); + if (!(tdc->mflags & DFFetchReq)) { /* ask the daemon to do the work */ - tdc->flags |= DFFetchReq; /* guaranteed to be cleared by BKG or GetDCache */ + UpgradeSToWLock(&tdc->mflock, 652); + tdc->mflags |= DFFetchReq; /* guaranteed to be cleared by BKG or GetDCache */ /* last parm (1) tells bkg daemon to do an afs_PutDCache when it is done, * since we don't want to wait for it to finish before doing so ourselves. */ -#ifdef AFS_SUN5_ENVX - mutex_exit(&tdc->lock); -#endif - bp = afs_BQueue(BOP_FETCH, avc, B_DONTWAIT, 0, acred, (long)offset, - (long) tdc, 1L, 0L, 0L); + bp = afs_BQueue(BOP_FETCH, avc, B_DONTWAIT, 0, acred, + (afs_size_t) offset, (afs_size_t) 1, tdc); if (!bp) { /* Bkg table full; just abort non-important prefetching to avoid deadlocks */ - tdc->flags &= ~(DFNextStarted | DFFetchReq); + tdc->mflags &= ~DFFetchReq; + ReleaseWriteLock(&tdc->mflock); afs_PutDCache(tdc); - return; - } - } - else - afs_PutDCache(tdc); - } -} - - -/* if the vcache is up-to-date, and the request fits entirely into the chunk - * that the hint here references, then we just use it quickly, otherwise we - * have to call the slow read. - * - * This could be generalized in several ways to take advantage of partial - * state even when all the chips don't fall the right way. For instance, - * if the hint is good and the first part of the read request can be - * satisfied from the chunk, then just do the read. After the read has - * completed, check to see if there's more. (Chances are there won't be.) - * If there is more, then just call afs_UFSReadSlow and let it do the rest. - * - * For the time being, I'm ignoring quick.f, but it should be used at - * some future date. - * do this in the future avc->quick.f = tfile; but I think it - * has to be done under a write lock, but don't want to wait on the - * write lock - */ - /* everywhere that a dcache can be freed (look for NULLIDX) - * probably does it under a write lock on xdcache. Need to invalidate - * stamp there, too. - * Also need to worry about DFFetching, and IFFree, I think. */ -static struct dcache *savedc = 0; - -afs_UFSReadFast(avc, auio, acred, albn, abpp, noLock) - register struct vcache *avc; - struct uio *auio; - struct AFS_UCRED *acred; - int noLock; - daddr_t albn; - struct buf **abpp; { - struct vrequest treq; - int offDiff; - struct dcache *tdc; - struct vnode *vp; - struct osi_file *tfile; - afs_int32 code = 0; - - if (!noLock) - ObtainReadLock(&avc->lock); - ObtainReadLock(&afs_xdcache); - - if ((avc->states & CStatd) /* up to date */ - && (tdc = avc->quick.dc) && (tdc->index != NULLIDX) - && !(afs_indexFlags[tdc->index] & IFFree)) { - - tdc->refCount++; - ReleaseReadLock(&afs_xdcache); - - if ((tdc->stamp == avc->quick.stamp) /* hint matches */ - && ((offDiff = (auio->afsio_offset - avc->quick.minLoc)) >= 0) - && (tdc->f.chunkBytes >= auio->afsio_resid + offDiff) - && !(tdc->flags & DFFetching)) { /* fits in chunk */ - auio->afsio_offset -= avc->quick.minLoc; - - tfile = (struct osi_file *)osi_UFSOpen(tdc->f.inode); - -#ifdef AFS_AIX_ENV -#ifdef AFS_AIX41_ENV - AFS_GUNLOCK(); - code = VNOP_RDWR(tfile->vnode, UIO_READ, FREAD, auio, NULL, NULL, NULL, &afs_osi_cred); - AFS_GLOCK(); -#else -#ifdef AFS_AIX32_ENV - code = VNOP_RDWR(tfile->vnode, UIO_READ, FREAD, auio, NULL, NULL); -#else - code = VNOP_RDWR(tfile->vnode, UIO_READ, FREAD, (off_t)&auio->afsio_offset, auio, NULL, NULL, -1); -#endif -#endif -#else -#ifdef AFS_SUN5_ENV - AFS_GUNLOCK(); - VOP_RWLOCK(tfile->vnode, 0); - code = VOP_READ(tfile->vnode, auio, 0, &afs_osi_cred); - VOP_RWUNLOCK(tfile->vnode, 0); - AFS_GLOCK(); -#else -#if defined(AFS_SGI_ENV) - AFS_GUNLOCK(); - AFS_VOP_RWLOCK(tfile->vnode, VRWLOCK_READ); - AFS_VOP_READ(tfile->vnode, auio, IO_ISLOCKED, &afs_osi_cred, code); - AFS_VOP_RWUNLOCK(tfile->vnode, VRWLOCK_READ); - AFS_GLOCK(); -#else -#ifdef AFS_OSF_ENV - auio->uio_rw = UIO_READ; - AFS_GUNLOCK(); - VOP_READ(tfile->vnode, auio, 0, &afs_osi_cred, code); - AFS_GLOCK(); -#else /* AFS_OSF_ENV */ -#if defined(AFS_HPUX100_ENV) - AFS_GUNLOCK(); - code = VOP_RDWR(tfile->vnode, auio, UIO_READ, 0, &afs_osi_cred); - AFS_GLOCK(); -#else -#if defined(AFS_LINUX20_ENV) - AFS_GUNLOCK(); - code = osi_file_uio_rdwr(tfile, auio, UIO_READ); - AFS_GLOCK(); -#else -#if defined(AFS_DARWIN_ENV) - AFS_GUNLOCK(); - VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc()); - code = VOP_READ(tfile->vnode, auio, 0, &afs_osi_cred); - VOP_UNLOCK(tfile->vnode, 0, current_proc()); - AFS_GLOCK(); -#else -#if defined(AFS_FBSD_ENV) - AFS_GUNLOCK(); - VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curproc); - code = VOP_READ(tfile->vnode, auio, 0, &afs_osi_cred); - VOP_UNLOCK(tfile->vnode, 0, curproc); - AFS_GLOCK(); -#else - code = VOP_RDWR(tfile->vnode, auio, UIO_READ, 0, &afs_osi_cred); -#endif -#endif -#endif -#endif -#endif -#endif -#endif -#endif - auio->afsio_offset += avc->quick.minLoc; - osi_UFSClose(tfile); - /* Fix up LRU info */ - hset(afs_indexTimes[tdc->index], afs_indexCounter); - hadd32(afs_indexCounter, 1); - - if (!noLock) { -#ifndef AFS_VM_RDWR_ENV - if (!(code = afs_InitReq(&treq, acred))&& (!(tdc->flags & DFNextStarted))) - afs_PrefetchChunk(avc, tdc, acred, &treq); -#endif - ReleaseReadLock(&avc->lock); + /* + * DCLOCKXXX: This is a little sketchy, since someone else + * could have already started a prefetch.. In practice, + * this probably doesn't matter; at most it would cause an + * extra slot in the BKG table to be used up when someone + * prefetches this for the second time. + */ + ObtainReadLock(&adc->lock); + ObtainWriteLock(&adc->mflock, 664); + adc->mflags &= ~DFNextStarted; + ReleaseWriteLock(&adc->mflock); + ReleaseReadLock(&adc->lock); + } else { + ReleaseWriteLock(&tdc->mflock); } - tdc->refCount--; - return (code); - } - if (!tdc->f.chunkBytes) { /* debugging f.chunkBytes == 0 problem */ - savedc = tdc; + } else { + ReleaseSharedLock(&tdc->mflock); + afs_PutDCache(tdc); } - tdc->refCount--; } else { - ReleaseReadLock(&afs_xdcache); + ReleaseSharedLock(&adc->mflock); + ReleaseReadLock(&adc->lock); } - - /* come here if fast path doesn't work for some reason or other */ - if (!noLock) - ReleaseReadLock(&avc->lock); - return afs_UFSRead(avc, auio, acred, albn, abpp, noLock); } -afs_UFSRead(avc, auio, acred, albn, abpp, noLock) - struct vcache *avc; - struct uio *auio; - struct AFS_UCRED *acred; - daddr_t albn; - int noLock; - struct buf **abpp; { - afs_int32 totalLength; - afs_int32 transferLength; - afs_int32 filePos; - struct dcache *tdc=0; - afs_int32 offset, len, error; +int +afs_UFSRead(register struct vcache *avc, struct uio *auio, + struct AFS_UCRED *acred, daddr_t albn, struct buf **abpp, + int noLock) +{ + afs_size_t totalLength; + afs_size_t transferLength; + afs_size_t filePos; + afs_size_t offset, len, tlen; + afs_int32 trimlen; + struct dcache *tdc = 0; + afs_int32 error; struct uio tuio; struct iovec *tvec; struct osi_file *tfile; afs_int32 code; - int munlocked, trybusy=1; - struct vnode *vp; + int trybusy = 1; struct vrequest treq; AFS_STATCNT(afs_UFSRead); @@ -502,34 +459,36 @@ afs_UFSRead(avc, auio, acred, albn, abpp, noLock) return EIO; /* check that we have the latest status info in the vnode cache */ - if (code = afs_InitReq(&treq, acred)) return code; + if ((code = afs_InitReq(&treq, acred))) + return code; if (!noLock) { - if (!avc) - osi_Panic ("null avc in afs_UFSRead"); - else { - code = afs_VerifyVCache(avc, &treq); - if (code) { - code = afs_CheckCode(code, &treq, 11); /* failed to get it */ - return code; + if (!avc) + osi_Panic("null avc in afs_UFSRead"); + else { + code = afs_VerifyVCache(avc, &treq); + if (code) { + code = afs_CheckCode(code, &treq, 11); /* failed to get it */ + return code; + } } - } } - #ifndef AFS_VM_RDWR_ENV if (AFS_NFSXLATORREQ(acred)) { - if (!afs_AccessOK(avc, PRSFS_READ, &treq, - CHECK_MODE_BITS|CMB_ALLOW_EXEC_AS_READ)) { + if (!afs_AccessOK + (avc, PRSFS_READ, &treq, + CHECK_MODE_BITS | CMB_ALLOW_EXEC_AS_READ)) { return afs_CheckCode(EACCES, &treq, 12); } } #endif - tvec = (struct iovec *) osi_AllocSmallSpace(sizeof(struct iovec)); + tvec = (struct iovec *)osi_AllocSmallSpace(sizeof(struct iovec)); totalLength = auio->afsio_resid; filePos = auio->afsio_offset; - afs_Trace4(afs_iclSetp, CM_TRACE_READ, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, filePos, ICL_TYPE_INT32, totalLength, - ICL_TYPE_INT32, avc->m.Length); + afs_Trace4(afs_iclSetp, CM_TRACE_READ, ICL_TYPE_POINTER, avc, + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(filePos), ICL_TYPE_INT32, + totalLength, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length)); error = 0; transferLength = 0; if (!noLock) @@ -539,118 +498,165 @@ afs_UFSRead(avc, auio, acred, albn, abpp, noLock) hset(avc->flushDV, avc->m.DataVersion); } #endif - + while (totalLength > 0) { /* read all of the cached info */ - if (filePos >= avc->m.Length) break; /* all done */ + if (filePos >= avc->m.Length) + break; /* all done */ if (noLock) { - if (tdc) afs_PutDCache(tdc); + if (tdc) { + ReleaseReadLock(&tdc->lock); + afs_PutDCache(tdc); + } tdc = afs_FindDCache(avc, filePos); if (tdc) { + ObtainReadLock(&tdc->lock); offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk); - len = tdc->f.chunkBytes - offset; + len = tdc->validPos - filePos; } } else { /* a tricky question: does the presence of the DFFetching flag - mean that we're fetching the latest version of the file? No. - The server could update the file as soon as the fetch responsible - for the setting of the DFFetching flag completes. - - However, the presence of the DFFetching flag (visible under a - read lock since it is set and cleared only under a write lock) - means that we're fetching as good a version as was known to this - client at the time of the last call to afs_VerifyVCache, since - the latter updates the stat cache's m.DataVersion field under a - write lock, and from the time that the DFFetching flag goes on - (before the fetch starts), to the time it goes off (after the - fetch completes), afs_GetDCache keeps at least a read lock - (actually it keeps an S lock) on the cache entry. - - This means that if the DFFetching flag is set, we can use that - data for any reads that must come from the current version of - the file (current == m.DataVersion). - - Another way of looking at this same point is this: if we're - fetching some data and then try do an afs_VerifyVCache, the - VerifyVCache operation will not complete until after the - DFFetching flag is turned off and the dcache entry's f.versionNo - field is updated. - - Note, by the way, that if DFFetching is set, - m.DataVersion > f.versionNo (the latter is not updated until - after the fetch completes). + * mean that we're fetching the latest version of the file? No. + * The server could update the file as soon as the fetch responsible + * for the setting of the DFFetching flag completes. + * + * However, the presence of the DFFetching flag (visible under + * a dcache read lock since it is set and cleared only under a + * dcache write lock) means that we're fetching as good a version + * as was known to this client at the time of the last call to + * afs_VerifyVCache, since the latter updates the stat cache's + * m.DataVersion field under a vcache write lock, and from the + * time that the DFFetching flag goes on in afs_GetDCache (before + * the fetch starts), to the time it goes off (after the fetch + * completes), afs_GetDCache keeps at least a read lock on the + * vcache entry. + * + * This means that if the DFFetching flag is set, we can use that + * data for any reads that must come from the current version of + * the file (current == m.DataVersion). + * + * Another way of looking at this same point is this: if we're + * fetching some data and then try do an afs_VerifyVCache, the + * VerifyVCache operation will not complete until after the + * DFFetching flag is turned off and the dcache entry's f.versionNo + * field is updated. + * + * Note, by the way, that if DFFetching is set, + * m.DataVersion > f.versionNo (the latter is not updated until + * after the fetch completes). */ - if (tdc) afs_PutDCache(tdc); /* before reusing tdc */ - munlocked = 0; - tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 2); - if (tdc == savedc) { - savedc = 0; + if (tdc) { + ReleaseReadLock(&tdc->lock); + afs_PutDCache(tdc); /* before reusing tdc */ } + tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 2); + ObtainReadLock(&tdc->lock); /* now, first try to start transfer, if we'll need the data. If * data already coming, we don't need to do this, obviously. Type * 2 requests never return a null dcache entry, btw. */ - if (!(tdc->flags & DFFetching) + if (!(tdc->dflags & DFFetching) && !hsame(avc->m.DataVersion, tdc->f.versionNo)) { /* have cache entry, it is not coming in now, and we'll need new data */ -tagain: + tagain: if (trybusy && !afs_BBusy()) { struct brequest *bp; /* daemon is not busy */ - if (!(tdc->flags & DFFetchReq)) { - tdc->flags |= DFFetchReq; -#ifdef AFS_SUN5_ENVX - mutex_exit(&tdc->lock); - munlocked = 1; -#endif + ObtainSharedLock(&tdc->mflock, 667); + if (!(tdc->mflags & DFFetchReq)) { + UpgradeSToWLock(&tdc->mflock, 668); + tdc->mflags |= DFFetchReq; bp = afs_BQueue(BOP_FETCH, avc, B_DONTWAIT, 0, acred, - (long)filePos, (long) tdc, 0L, 0L); + (afs_size_t) filePos, (afs_size_t) 0, + tdc); if (!bp) { /* Bkg table full; retry deadlocks */ - tdc->flags &= ~DFFetchReq; + tdc->mflags &= ~DFFetchReq; trybusy = 0; /* Avoid bkg daemon since they're too busy */ + ReleaseWriteLock(&tdc->mflock); goto tagain; } + ConvertWToSLock(&tdc->mflock); } - while (tdc->flags & DFFetchReq) { + code = 0; + ConvertSToRLock(&tdc->mflock); + while (!code && tdc->mflags & DFFetchReq) { + afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAIT, + ICL_TYPE_STRING, __FILE__, ICL_TYPE_INT32, + __LINE__, ICL_TYPE_POINTER, tdc, + ICL_TYPE_INT32, tdc->dflags); /* don't need waiting flag on this one */ + ReleaseReadLock(&tdc->mflock); + ReleaseReadLock(&tdc->lock); ReleaseReadLock(&avc->lock); - afs_osi_Sleep(&tdc->validPos); + code = afs_osi_SleepSig(&tdc->validPos); ObtainReadLock(&avc->lock); + ObtainReadLock(&tdc->lock); + ObtainReadLock(&tdc->mflock); + } + ReleaseReadLock(&tdc->mflock); + if (code) { + error = code; + break; } } } /* now data may have started flowing in (if DFFetching is on). If - * data is now streaming in, then wait for some interesting stuff. */ - while ((tdc->flags & DFFetching) && tdc->validPos <= filePos) { - /* too early: wait for DFFetching flag to vanish, or data to appear */ - tdc->flags |= DFWaiting; + * data is now streaming in, then wait for some interesting stuff. + */ + code = 0; + while (!code && (tdc->dflags & DFFetching) + && tdc->validPos <= filePos) { + /* too early: wait for DFFetching flag to vanish, + * or data to appear */ + afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAIT, ICL_TYPE_STRING, + __FILE__, ICL_TYPE_INT32, __LINE__, + ICL_TYPE_POINTER, tdc, ICL_TYPE_INT32, + tdc->dflags); + ReleaseReadLock(&tdc->lock); ReleaseReadLock(&avc->lock); - afs_osi_Sleep(&tdc->validPos); + code = afs_osi_SleepSig(&tdc->validPos); ObtainReadLock(&avc->lock); + ObtainReadLock(&tdc->lock); } - /* fetching flag gone, data is here, or we never tried (BBusy for instance) */ - if (tdc->flags & DFFetching) { - /* still fetching, some new data is here: compute length and offset */ + if (code) { + error = code; + break; + } + /* fetching flag gone, data is here, or we never tried + * (BBusy for instance) */ + if (tdc->dflags & DFFetching) { + /* still fetching, some new data is here: + * compute length and offset */ offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk); len = tdc->validPos - filePos; - } - else { - /* no longer fetching, verify data version (avoid new GetDCache call) */ - if (hsame(avc->m.DataVersion, tdc->f.versionNo)) { + } else { + /* no longer fetching, verify data version (avoid new + * GetDCache call) */ + if (hsame(avc->m.DataVersion, tdc->f.versionNo) + && ((len = tdc->validPos - filePos) > 0)) { offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk); - len = tdc->f.chunkBytes - offset; - } - else { + } else { /* don't have current data, so get it below */ + afs_Trace3(afs_iclSetp, CM_TRACE_VERSIONNO, + ICL_TYPE_INT64, ICL_HANDLE_OFFSET(filePos), + ICL_TYPE_HYPER, &avc->m.DataVersion, + ICL_TYPE_HYPER, &tdc->f.versionNo); + ReleaseReadLock(&tdc->lock); afs_PutDCache(tdc); - tdc = (struct dcache *) 0; + tdc = NULL; } } if (!tdc) { + /* If we get, it was not possible to start the + * background daemon. With flag == 1 afs_GetDCache + * does the FetchData rpc synchronously. + */ ReleaseReadLock(&avc->lock); tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 1); ObtainReadLock(&avc->lock); + if (tdc) + ObtainReadLock(&tdc->lock); } } @@ -658,59 +664,71 @@ tagain: error = EIO; break; } - if (len > totalLength) len = totalLength; /* will read len bytes */ - if (len <= 0) { /* shouldn't get here if DFFetching is on */ + len = tdc->validPos - filePos; + afs_Trace3(afs_iclSetp, CM_TRACE_VNODEREAD, ICL_TYPE_POINTER, tdc, + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(offset), + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(len)); + if (len > totalLength) + len = totalLength; /* will read len bytes */ + if (len <= 0) { /* shouldn't get here if DFFetching is on */ + afs_Trace4(afs_iclSetp, CM_TRACE_VNODEREAD2, ICL_TYPE_POINTER, + tdc, ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(tdc->validPos), + ICL_TYPE_INT32, tdc->f.chunkBytes, ICL_TYPE_INT32, + tdc->dflags); /* read past the end of a chunk, may not be at next chunk yet, and yet - also not at eof, so may have to supply fake zeros */ - len = AFS_CHUNKTOSIZE(tdc->f.chunk) - offset; /* bytes left in chunk addr space */ - if (len > totalLength) len = totalLength; /* and still within xfr request */ - code = avc->m.Length - offset; /* and still within file */ - if (len > code) len = code; - if (len > AFS_ZEROS) len = sizeof(afs_zeros); /* and in 0 buffer */ + * also not at eof, so may have to supply fake zeros */ + len = AFS_CHUNKTOSIZE(tdc->f.chunk) - offset; /* bytes left in chunk addr space */ + if (len > totalLength) + len = totalLength; /* and still within xfr request */ + tlen = avc->m.Length - offset; /* and still within file */ + if (len > tlen) + len = tlen; + if (len > AFS_ZEROS) + len = sizeof(afs_zeros); /* and in 0 buffer */ afsio_copy(auio, &tuio, tvec); - afsio_trim(&tuio, len); - AFS_UIOMOVE(afs_zeros, len, UIO_READ, &tuio, code); + trimlen = len; + afsio_trim(&tuio, trimlen); + AFS_UIOMOVE(afs_zeros, trimlen, UIO_READ, &tuio, code); if (code) { error = code; break; } - } - else { + } else { /* get the data from the file */ #ifdef IHINT - if (tfile = tdc->ihint) { - if (tdc->f.inode != tfile->inum){ - afs_warn( "afs_UFSRead: %x hint mismatch tdc %d inum %d\n", - tdc, tdc->f.inode, tfile->inum ); - osi_UFSClose(tfile); + if (tfile = tdc->ihint) { + if (tdc->f.inode != tfile->inum) { + afs_warn("afs_UFSRead: %x hint mismatch tdc %d inum %d\n", + tdc, tdc->f.inode, tfile->inum); + osi_UFSClose(tfile); tdc->ihint = tfile = 0; nihints--; - } - } - if (tfile != 0) { - usedihint++; - } - else + } + } + if (tfile != 0) { + usedihint++; + } else #endif /* IHINT */ - tfile = (struct osi_file *)osi_UFSOpen(tdc->f.inode); + tfile = (struct osi_file *)osi_UFSOpen(tdc->f.inode); /* mung uio structure to be right for this transfer */ afsio_copy(auio, &tuio, tvec); - afsio_trim(&tuio, len); + trimlen = len; + afsio_trim(&tuio, trimlen); tuio.afsio_offset = offset; -#ifdef AFS_AIX_ENV -#ifdef AFS_AIX41_ENV - AFS_GUNLOCK(); - code = VNOP_RDWR(tfile->vnode, UIO_READ, FREAD, &tuio, NULL, NULL, - NULL, &afs_osi_cred); - AFS_GLOCK(); -#else -#ifdef AFS_AIX32_ENV - code = VNOP_RDWR(tfile->vnode, UIO_READ, FREAD, &tuio, NULL, NULL); - /* Flush all JFS pages now for big performance gain in big file cases - * If we do something like this, must check to be sure that AFS file - * isn't mmapped... see afs_gn_map() for why. - */ +#if defined(AFS_AIX41_ENV) + AFS_GUNLOCK(); + code = + VNOP_RDWR(tfile->vnode, UIO_READ, FREAD, &tuio, NULL, NULL, + NULL, afs_osi_credp); + AFS_GLOCK(); +#elif defined(AFS_AIX32_ENV) + code = + VNOP_RDWR(tfile->vnode, UIO_READ, FREAD, &tuio, NULL, NULL); + /* Flush all JFS pages now for big performance gain in big file cases + * If we do something like this, must check to be sure that AFS file + * isn't mmapped... see afs_gn_map() for why. + */ /* if (tfile->vnode->v_gnode && tfile->vnode->v_gnode->gn_seg) { many different ways to do similar things: @@ -731,78 +749,67 @@ tagain: (len + PAGESIZE-1)/PAGESIZE); } */ -#else - code = VNOP_RDWR(tfile->vnode, UIO_READ, FREAD, (off_t)&offset, &tuio, NULL, NULL, -1); -#endif -#endif -#else -#ifdef AFS_SUN5_ENV - AFS_GUNLOCK(); +#elif defined(AFS_AIX_ENV) + code = + VNOP_RDWR(tfile->vnode, UIO_READ, FREAD, (off_t) & offset, + &tuio, NULL, NULL, -1); +#elif defined(AFS_SUN5_ENV) + AFS_GUNLOCK(); VOP_RWLOCK(tfile->vnode, 0); - code = VOP_READ(tfile->vnode, &tuio, 0, &afs_osi_cred); + code = VOP_READ(tfile->vnode, &tuio, 0, afs_osi_credp); VOP_RWUNLOCK(tfile->vnode, 0); - AFS_GLOCK(); -#else -#if defined(AFS_SGI_ENV) + AFS_GLOCK(); +#elif defined(AFS_SGI_ENV) AFS_GUNLOCK(); AFS_VOP_RWLOCK(tfile->vnode, VRWLOCK_READ); - AFS_VOP_READ(tfile->vnode, &tuio, IO_ISLOCKED, &afs_osi_cred, + AFS_VOP_READ(tfile->vnode, &tuio, IO_ISLOCKED, afs_osi_credp, code); AFS_VOP_RWUNLOCK(tfile->vnode, VRWLOCK_READ); AFS_GLOCK(); -#else -#ifdef AFS_OSF_ENV +#elif defined(AFS_OSF_ENV) tuio.uio_rw = UIO_READ; AFS_GUNLOCK(); - VOP_READ(tfile->vnode, &tuio, 0, &afs_osi_cred, code); + VOP_READ(tfile->vnode, &tuio, 0, afs_osi_credp, code); AFS_GLOCK(); -#else /* AFS_OSF_ENV */ -#ifdef AFS_SUN_ENV - code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, &afs_osi_cred); -#else -#if defined(AFS_HPUX100_ENV) +#elif defined(AFS_SUN_ENV) + code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, afs_osi_credp); +#elif defined(AFS_HPUX100_ENV) AFS_GUNLOCK(); - code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, &afs_osi_cred); + code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, afs_osi_credp); AFS_GLOCK(); -#else -#if defined(AFS_LINUX20_ENV) +#elif defined(AFS_LINUX20_ENV) AFS_GUNLOCK(); code = osi_file_uio_rdwr(tfile, &tuio, UIO_READ); AFS_GLOCK(); +#elif defined(AFS_DARWIN_ENV) + AFS_GUNLOCK(); + VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc()); + code = VOP_READ(tfile->vnode, &tuio, 0, afs_osi_credp); + VOP_UNLOCK(tfile->vnode, 0, current_proc()); + AFS_GLOCK(); +#elif defined(AFS_FBSD50_ENV) + AFS_GUNLOCK(); + VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curthread); + code = VOP_READ(tfile->vnode, &tuio, 0, afs_osi_credp); + VOP_UNLOCK(tfile->vnode, 0, curthread); + AFS_GLOCK(); +#elif defined(AFS_XBSD_ENV) + AFS_GUNLOCK(); + VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curproc); + code = VOP_READ(tfile->vnode, &tuio, 0, afs_osi_credp); + VOP_UNLOCK(tfile->vnode, 0, curproc); + AFS_GLOCK(); #else -#if defined(AFS_DARWIN_ENV) - AFS_GUNLOCK(); - VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc()); - code = VOP_READ(tfile->vnode, &tuio, 0, &afs_osi_cred); - VOP_UNLOCK(tfile->vnode, 0, current_proc()); - AFS_GLOCK(); -#else -#if defined(AFS_FBSD_ENV) - AFS_GUNLOCK(); - VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curproc); - code = VOP_READ(tfile->vnode, &tuio, 0, &afs_osi_cred); - VOP_UNLOCK(tfile->vnode, 0, curproc); - AFS_GLOCK(); -#else - code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, &afs_osi_cred); -#endif -#endif -#endif -#endif -#endif -#endif -#endif -#endif + code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, afs_osi_credp); #endif #ifdef IHINT - if (!tdc->ihint && nihints < maxIHint) { - tdc->ihint = tfile; - nihints++; - } - else + if (!tdc->ihint && nihints < maxIHint) { + tdc->ihint = tfile; + nihints++; + } else #endif /* IHINT */ - osi_UFSClose(tfile); + osi_UFSClose(tfile); if (code) { error = code; @@ -810,12 +817,14 @@ tagain: } } /* otherwise we've read some, fixup length, etc and continue with next seg */ - len = len - tuio.afsio_resid; /* compute amount really transferred */ - afsio_skip(auio, len); /* update input uio structure */ + len = len - tuio.afsio_resid; /* compute amount really transferred */ + trimlen = len; + afsio_skip(auio, trimlen); /* update input uio structure */ totalLength -= len; transferLength += len; filePos += len; - if (len <= 0) break; /* surprise eof */ + if (len <= 0) + break; /* surprise eof */ } /* if we make it here with tdc non-zero, then it is the last chunk we @@ -823,10 +832,12 @@ tagain: * to it in case we need to do a prefetch, obviously. */ if (tdc) { -#ifndef AFS_VM_RDWR_ENV + ReleaseReadLock(&tdc->lock); +#if !defined(AFS_VM_RDWR_ENV) /* try to queue prefetch, if needed */ - if (!(tdc->flags & DFNextStarted) && !noLock) { - afs_PrefetchChunk(avc, tdc, acred, &treq); + if (!noLock) { + if (!(tdc->mflags & DFNextStarted)) + afs_PrefetchChunk(avc, tdc, acred, &treq); } #endif afs_PutDCache(tdc); diff --git a/src/afs/VNOPS/afs_vnop_readdir.c b/src/afs/VNOPS/afs_vnop_readdir.c index 38fa79210..3320b0442 100644 --- a/src/afs/VNOPS/afs_vnop_readdir.c +++ b/src/afs/VNOPS/afs_vnop_readdir.c @@ -20,29 +20,30 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.1.1.11 2003/07/30 17:08:14 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.23 2003/11/27 01:17:40 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" -#if defined(AFS_HPUX1122_ENV) + +#if defined(AFS_HPUX1122_ENV) #define DIRPAD 7 #else #define DIRPAD 3 #endif - /** * A few definitions. This is until we have a proper header file * which ahs prototypes for all functions */ - -extern struct DirEntry * afs_dir_GetBlob(); + +extern struct DirEntry *afs_dir_GetBlob(); /* * AFS readdir vnodeop and bulk stat support. */ @@ -66,12 +67,21 @@ extern struct DirEntry * afs_dir_GetBlob(); become static. */ #if defined(AFS_SGI62_ENV) || defined(AFS_SUN57_64BIT_ENV) -int BlobScan(ino64_t *afile, afs_int32 ablob) +int +BlobScan(ino64_t * afile, afs_int32 ablob) +#else +#if defined(AFS_HPUX1123_ENV) +/*DEE should use afs_inode_t for all */ +int +BlobScan(ino_t *afile, afs_int32 ablob) #else #ifdef AFS_LINUX_64BIT_KERNEL -int BlobScan(long *afile, afs_int32 ablob) +int +BlobScan(long *afile, afs_int32 ablob) #else -int BlobScan(afs_int32 *afile, afs_int32 ablob) +int +BlobScan(afs_int32 * afile, afs_int32 ablob) +#endif #endif #endif { @@ -83,27 +93,31 @@ int BlobScan(afs_int32 *afile, afs_int32 ablob) AFS_STATCNT(BlobScan); /* advance ablob over free and header blobs */ while (1) { - pageBlob = ablob & ~(EPP-1); /* base blob in same page */ - tpe = (struct PageHeader *) afs_dir_GetBlob(afile, pageBlob); - if (!tpe) return 0; /* we've past the end */ - relativeBlob = ablob - pageBlob; /* relative to page's first blob */ + pageBlob = ablob & ~(EPP - 1); /* base blob in same page */ + tpe = (struct PageHeader *)afs_dir_GetBlob(afile, pageBlob); + if (!tpe) + return 0; /* we've past the end */ + relativeBlob = ablob - pageBlob; /* relative to page's first blob */ /* first watch for headers */ - if (pageBlob == 0) { /* first dir page has extra-big header */ + if (pageBlob == 0) { /* first dir page has extra-big header */ /* first page */ - if (relativeBlob < DHE+1) relativeBlob = DHE+1; - } - else { /* others have one header blob */ - if (relativeBlob == 0) relativeBlob = 1; + if (relativeBlob < DHE + 1) + relativeBlob = DHE + 1; + } else { /* others have one header blob */ + if (relativeBlob == 0) + relativeBlob = 1; } /* make sure blob is allocated */ - for(i = relativeBlob; i < EPP; i++) { - if (tpe->freebitmap[i>>3] & (1<<(i&7))) break; + for (i = relativeBlob; i < EPP; i++) { + if (tpe->freebitmap[i >> 3] & (1 << (i & 7))) + break; } /* now relativeBlob is the page-relative first allocated blob, - or EPP (if there are none in this page). */ - DRelease(tpe, 0); - if (i != EPP) return i+pageBlob; - ablob = pageBlob + EPP; /* go around again */ + * or EPP (if there are none in this page). */ + DRelease((struct buffer *)tpe, 0); + if (i != EPP) + return i + pageBlob; + ablob = pageBlob + EPP; /* go around again */ } /* never get here */ } @@ -122,18 +136,18 @@ int BlobScan(afs_int32 *afile, afs_int32 ablob) #if !defined(UKERNEL) #if defined(AFS_SGI_ENV) /* Long form for 64 bit apps and kernel requests. */ -struct min_dirent { /* miniature dirent structure */ - /* If struct dirent changes, this must too */ - ino_t d_fileno; /* This is 32 bits for 3.5, 64 for 6.2+ */ - off64_t d_off; - u_short d_reclen; +struct min_dirent { /* miniature dirent structure */ + /* If struct dirent changes, this must too */ + ino_t d_fileno; /* This is 32 bits for 3.5, 64 for 6.2+ */ + off64_t d_off; + u_short d_reclen; }; /* Short form for 32 bit apps. */ -struct irix5_min_dirent { /* miniature dirent structure */ - /* If struct dirent changes, this must too */ - afs_uint32 d_fileno; - afs_int32 d_off; - u_short d_reclen; +struct irix5_min_dirent { /* miniature dirent structure */ + /* If struct dirent changes, this must too */ + afs_uint32 d_fileno; + afs_int32 d_off; + u_short d_reclen; }; #ifdef AFS_SGI62_ENV #define AFS_DIRENT32BASESIZE IRIX5_DIRENTBASESIZE @@ -143,28 +157,29 @@ struct irix5_min_dirent { /* miniature dirent structure */ #define AFS_DIRENT64BASESIZE DIRENTBASESIZE #endif /* AFS_SGI62_ENV */ #else -struct min_direct { /* miniature direct structure */ - /* If struct direct changes, this must too */ -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - afs_uint32 d_fileno; - u_short d_reclen; - u_char d_type; - u_char d_namlen; -#else +struct min_direct { /* miniature direct structure */ + /* If struct direct changes, this must too */ +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + afs_uint32 d_fileno; + u_short d_reclen; + u_char d_type; + u_char d_namlen; +#else #ifdef AFS_SUN5_ENV - afs_uint32 d_fileno; - afs_int32 d_off; - u_short d_reclen; + afs_uint32 d_fileno; + afs_int32 d_off; + u_short d_reclen; #else #if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) - afs_int32 d_off; + afs_int32 d_off; + afs_uint32 d_fileno; #endif #if defined(AFS_HPUX100_ENV) unsigned long long d_off; + afs_uint32 d_fileno; #endif - afs_uint32 d_fileno; - u_short d_reclen; - u_short d_namlen; + u_short d_reclen; + u_short d_namlen; #endif #endif }; @@ -172,10 +187,10 @@ struct min_direct { /* miniature direct structure */ #if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV) struct minnfs_direct { - afs_int32 d_off; /* XXX */ - afs_uint32 d_fileno; - u_short d_reclen; - u_short d_namlen; + afs_int32 d_off; /* XXX */ + afs_uint32 d_fileno; + u_short d_reclen; + u_short d_namlen; }; #define NDIRSIZ_LEN(len) ((sizeof (struct dirent)+4 - (MAXNAMLEN+1)) + (((len)+1 + DIRPAD) &~ DIRPAD)) #endif @@ -190,8 +205,8 @@ struct minnfs_direct { */ #define READDIR_STASH AFSCBMAX -struct AFSFid afs_readdir_stash[READDIR_STASH]; -int afs_rd_stash_i = 0; +struct AFSFid afs_readdir_stash[READDIR_STASH]; +int afs_rd_stash_i = 0; /* *------------------------------------------------------------------------------ @@ -203,6 +218,7 @@ int afs_rd_stash_i = 0; * * */ + #if defined(AFS_HPUX100_ENV) #define DIRSIZ_LEN(len) \ ((sizeof (struct __dirent) - (_MAXNAMLEN+1)) + (((len)+1 + DIRPAD) &~ DIRPAD)) @@ -229,42 +245,42 @@ int afs_rd_stash_i = 0; #endif /* AFS_DIRENT */ #endif /* AFS_SUN5_ENV */ #endif /* AFS_SUN56_ENV */ -#endif /* AFS_HPUX100_ENV */ +#endif /* AFS_HPUX100_ENV */ -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) -int afs_readdir_type(avc, ade) -struct DirEntry * ade; -struct vcache * avc; +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +int +afs_readdir_type(avc, ade) + struct DirEntry *ade; + struct vcache *avc; { - struct VenusFid tfid; - struct vcache *tvc; - int vtype; - tfid.Cell=avc->fid.Cell; - tfid.Fid.Volume=avc->fid.Fid.Volume; - tfid.Fid.Vnode=ntohl(ade->fid.vnode); - tfid.Fid.Unique=ntohl(ade->fid.vunique); - if ((avc->states & CForeign) == 0 && - (ntohl(ade->fid.vnode) & 1)) { - return DT_DIR; - } else if ((tvc=afs_FindVCache(&tfid,0,0,0,0))) { - if (tvc->mvstat) { - afs_PutVCache(tvc, WRITE_LOCK); - return DT_DIR; - } else if (((tvc->states) & (CStatd|CTruth))) { - /* CTruth will be set if the object has - *ever* been statd */ - vtype=vType(tvc); - afs_PutVCache(tvc, WRITE_LOCK); - if (vtype == VDIR) - return DT_DIR; - else if (vtype == VREG) - return DT_REG; - /* Don't do this until we're sure it can't be a mtpt */ - /* else if (vtype == VLNK) - type=DT_LNK; */ - /* what other types does AFS support? */ - } else - afs_PutVCache(tvc, WRITE_LOCK); + struct VenusFid tfid; + struct vcache *tvc; + int vtype; + tfid.Cell = avc->fid.Cell; + tfid.Fid.Volume = avc->fid.Fid.Volume; + tfid.Fid.Vnode = ntohl(ade->fid.vnode); + tfid.Fid.Unique = ntohl(ade->fid.vunique); + if ((avc->states & CForeign) == 0 && (ntohl(ade->fid.vnode) & 1)) { + return DT_DIR; + } else if ((tvc = afs_FindVCache(&tfid, 0, 0))) { + if (tvc->mvstat) { + afs_PutVCache(tvc); + return DT_DIR; + } else if (((tvc->states) & (CStatd | CTruth))) { + /* CTruth will be set if the object has + *ever* been statd */ + vtype = vType(tvc); + afs_PutVCache(tvc); + if (vtype == VDIR) + return DT_DIR; + else if (vtype == VREG) + return DT_REG; + /* Don't do this until we're sure it can't be a mtpt */ + /* else if (vtype == VLNK) + * type=DT_LNK; */ + /* what other types does AFS support? */ + } else + afs_PutVCache(tvc); } return DT_UNKNOWN; } @@ -277,24 +293,26 @@ struct vcache * avc; #define AFS_MOVE_LOCK() #define AFS_MOVE_UNLOCK() #endif -char bufofzeros[64]; /* gotta fill with something */ -afs_readdir_move (de, vc, auio, slen, rlen, off) -struct DirEntry * de; -struct vcache * vc; -struct uio * auio; -int slen; +char bufofzeros[64]; /* gotta fill with something */ + +int +afs_readdir_move(de, vc, auio, slen, rlen, off) + struct DirEntry *de; + struct vcache *vc; + struct uio *auio; + int slen; #ifdef AFS_SGI65_ENV -ssize_t rlen; + ssize_t rlen; #else -int rlen; + int rlen; #endif -int off; + afs_size_t off; { - int code = 0; + int code = 0; #if defined(AFS_SUN56_ENV) struct dirent64 *direntp; #else -#ifdef AFS_SUN5_ENV +#if defined(AFS_SUN5_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) struct dirent *direntp; #endif #endif /* AFS_SUN56_ENV */ @@ -304,85 +322,100 @@ int off; AFS_STATCNT(afs_readdir_move); #ifdef AFS_SGI53_ENV -{ - afs_int32 use64BitDirent; + { + afs_int32 use64BitDirent; #ifdef AFS_SGI61_ENV #ifdef AFS_SGI62_ENV - use64BitDirent = ABI_IS(ABI_IRIX5_64, - GETDENTS_ABI(OSI_GET_CURRENT_ABI(), auio)); + use64BitDirent = + ABI_IS(ABI_IRIX5_64, GETDENTS_ABI(OSI_GET_CURRENT_ABI(), auio)); #else - use64BitDirent = (auio->uio_segflg != UIO_USERSPACE) ? ABI_IRIX5_64 : - (ABI_IS(ABI_IRIX5_64 | ABI_IRIX5_N32, u.u_procp->p_abi)); + use64BitDirent = + (auio->uio_segflg != + UIO_USERSPACE) ? ABI_IRIX5_64 : (ABI_IS(ABI_IRIX5_64 | + ABI_IRIX5_N32, + u.u_procp->p_abi)); #endif #else /* AFS_SGI61_ENV */ - use64BitDirent = (auio->uio_segflg != UIO_USERSPACE) ? ABI_IRIX5_64 : - (ABI_IS(ABI_IRIX5_64, u.u_procp->p_abi)); + use64BitDirent = + (auio->uio_segflg != + UIO_USERSPACE) ? ABI_IRIX5_64 : (ABI_IS(ABI_IRIX5_64, + u.u_procp->p_abi)); #endif /* AFS_SGI61_ENV */ - if (use64BitDirent) { - struct min_dirent sdirEntry; - sdirEntry.d_fileno = (vc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode); - FIXUPSTUPIDINODE(sdirEntry.d_fileno); - sdirEntry.d_reclen = rlen; - sdirEntry.d_off = (off_t)off; - AFS_UIOMOVE(&sdirEntry, AFS_DIRENT64BASESIZE, UIO_READ, auio, code); - if (code == 0) - AFS_UIOMOVE(de->name, slen-1, UIO_READ, auio, code); - if (code == 0) - AFS_UIOMOVE(bufofzeros, - DIRENTSIZE(slen) - (AFS_DIRENT64BASESIZE + slen - 1), - UIO_READ, auio, code); - if (DIRENTSIZE(slen) < rlen) { - while(DIRENTSIZE(slen) < rlen) { - int minLen = rlen - DIRENTSIZE(slen); - if (minLen > sizeof(bufofzeros)) minLen = sizeof(bufofzeros); - AFS_UIOMOVE(bufofzeros, minLen, UIO_READ, auio, code); - rlen -= minLen; + if (use64BitDirent) { + struct min_dirent sdirEntry; + sdirEntry.d_fileno = + (vc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode); + FIXUPSTUPIDINODE(sdirEntry.d_fileno); + sdirEntry.d_reclen = rlen; + sdirEntry.d_off = (off_t) off; + AFS_UIOMOVE(&sdirEntry, AFS_DIRENT64BASESIZE, UIO_READ, auio, + code); + if (code == 0) + AFS_UIOMOVE(de->name, slen - 1, UIO_READ, auio, code); + if (code == 0) + AFS_UIOMOVE(bufofzeros, + DIRENTSIZE(slen) - (AFS_DIRENT64BASESIZE + slen - + 1), UIO_READ, auio, code); + if (DIRENTSIZE(slen) < rlen) { + while (DIRENTSIZE(slen) < rlen) { + int minLen = rlen - DIRENTSIZE(slen); + if (minLen > sizeof(bufofzeros)) + minLen = sizeof(bufofzeros); + AFS_UIOMOVE(bufofzeros, minLen, UIO_READ, auio, code); + rlen -= minLen; + } } - } - } else { - struct irix5_min_dirent sdirEntry; - sdirEntry.d_fileno = (vc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode); - FIXUPSTUPIDINODE(sdirEntry.d_fileno); - sdirEntry.d_reclen = rlen; - sdirEntry.d_off = (afs_int32)off; - AFS_UIOMOVE(&sdirEntry, AFS_DIRENT32BASESIZE, UIO_READ, auio, code); - if (code == 0) - AFS_UIOMOVE(de->name, slen-1, UIO_READ, auio, code); - if (code == 0) - AFS_UIOMOVE(bufofzeros, - IRIX5_DIRENTSIZE(slen) - - (AFS_DIRENT32BASESIZE + slen - 1), - UIO_READ, auio, code); - if (IRIX5_DIRENTSIZE(slen) < rlen) { - while(IRIX5_DIRENTSIZE(slen) < rlen) { - int minLen = rlen - IRIX5_DIRENTSIZE(slen); - if (minLen > sizeof(bufofzeros)) minLen = sizeof(bufofzeros); - AFS_UIOMOVE(bufofzeros, minLen, UIO_READ, auio, code); - rlen -= minLen; + } else { + struct irix5_min_dirent sdirEntry; + sdirEntry.d_fileno = + (vc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode); + FIXUPSTUPIDINODE(sdirEntry.d_fileno); + sdirEntry.d_reclen = rlen; + sdirEntry.d_off = (afs_int32) off; + AFS_UIOMOVE(&sdirEntry, AFS_DIRENT32BASESIZE, UIO_READ, auio, + code); + if (code == 0) + AFS_UIOMOVE(de->name, slen - 1, UIO_READ, auio, code); + if (code == 0) + AFS_UIOMOVE(bufofzeros, + IRIX5_DIRENTSIZE(slen) - (AFS_DIRENT32BASESIZE + + slen - 1), UIO_READ, + auio, code); + if (IRIX5_DIRENTSIZE(slen) < rlen) { + while (IRIX5_DIRENTSIZE(slen) < rlen) { + int minLen = rlen - IRIX5_DIRENTSIZE(slen); + if (minLen > sizeof(bufofzeros)) + minLen = sizeof(bufofzeros); + AFS_UIOMOVE(bufofzeros, minLen, UIO_READ, auio, code); + rlen -= minLen; + } } } } -} #else /* AFS_SGI53_ENV */ -#ifdef AFS_SUN5_ENV +#if defined(AFS_SUN5_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) #if defined(AFS_SUN56_ENV) - direntp = (struct dirent64 *) osi_AllocLargeSpace(AFS_LRALLOCSIZ); + direntp = (struct dirent64 *)osi_AllocLargeSpace(AFS_LRALLOCSIZ); #else - direntp = (struct dirent *) osi_AllocLargeSpace(AFS_LRALLOCSIZ); + direntp = (struct dirent *)osi_AllocLargeSpace(AFS_LRALLOCSIZ); #endif - direntp->d_ino = (vc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode); + direntp->d_ino = (vc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode); FIXUPSTUPIDINODE(direntp->d_ino); +#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) + direntp->d_offset = off; + direntp->d_namlen = slen; +#else direntp->d_off = off; +#endif direntp->d_reclen = rlen; strcpy(direntp->d_name, de->name); - AFS_UIOMOVE((caddr_t)direntp, rlen, UIO_READ, auio, code); + AFS_UIOMOVE((caddr_t) direntp, rlen, UIO_READ, auio, code); osi_FreeLargeSpace((char *)direntp); #else /* AFS_SUN5_ENV */ /* Note the odd mechanism for building the inode number */ - sdirEntry.d_fileno = (vc->fid.Fid.Volume << 16) + - ntohl(de->fid.vnode); + sdirEntry.d_fileno = (vc->fid.Fid.Volume << 16) + ntohl(de->fid.vnode); FIXUPSTUPIDINODE(sdirEntry.d_fileno); sdirEntry.d_reclen = rlen; #if !defined(AFS_SGI_ENV) @@ -391,16 +424,18 @@ int off; #if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) sdirEntry.d_off = off; #endif -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - sdirEntry.d_type=afs_readdir_type(vc, de); +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + sdirEntry.d_type = afs_readdir_type(vc, de); #endif #if defined(AFS_SGI_ENV) AFS_UIOMOVE(&sdirEntry, DIRENTBASESIZE, UIO_READ, auio, code); if (code == 0) - AFS_UIOMOVE(de->name, slen-1, UIO_READ, auio, code); + AFS_UIOMOVE(de->name, slen - 1, UIO_READ, auio, code); if (code == 0) - AFS_UIOMOVE(bufofzeros, DIRSIZ_LEN(slen) - (DIRENTBASESIZE + slen - 1), UIO_READ, auio, code); + AFS_UIOMOVE(bufofzeros, + DIRSIZ_LEN(slen) - (DIRENTBASESIZE + slen - 1), UIO_READ, + auio, code); #else /* AFS_SGI_ENV */ AFS_MOVE_UNLOCK(); AFS_UIOMOVE((char *)&sdirEntry, sizeof(sdirEntry), UIO_READ, auio, code); @@ -410,30 +445,28 @@ int off; } /* pad out the remaining characters with zeros */ - if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((slen + 1 + DIRPAD) & ~DIRPAD) - slen, UIO_READ, - auio, code); + if (code == 0) { + AFS_UIOMOVE(bufofzeros, ((slen + 1 + DIRPAD) & ~DIRPAD) - slen, + UIO_READ, auio, code); } AFS_MOVE_LOCK(); #endif /* AFS_SGI_ENV */ /* pad out the difference between rlen and slen... */ - if (DIRSIZ_LEN(slen) < rlen) - { + if (DIRSIZ_LEN(slen) < rlen) { AFS_MOVE_UNLOCK(); - while(DIRSIZ_LEN(slen) < rlen) - { - int minLen = rlen - DIRSIZ_LEN(slen); - if (minLen > sizeof(bufofzeros)) - minLen = sizeof(bufofzeros); - AFS_UIOMOVE(bufofzeros, minLen, UIO_READ, auio, code); - rlen -= minLen; - } - AFS_MOVE_LOCK(); + while (DIRSIZ_LEN(slen) < rlen) { + int minLen = rlen - DIRSIZ_LEN(slen); + if (minLen > sizeof(bufofzeros)) + minLen = sizeof(bufofzeros); + AFS_UIOMOVE(bufofzeros, minLen, UIO_READ, auio, code); + rlen -= minLen; } -#endif /* AFS_SUN5_ENV */ -#endif /* AFS_SGI53_ENV */ - return(code); + AFS_MOVE_LOCK(); + } +#endif /* AFS_SUN5_ENV */ +#endif /* AFS_SGI53_ENV */ + return (code); } @@ -453,11 +486,11 @@ int off; * This routine encodes knowledge of Vice dirs. */ -void afs_bulkstat_send( avc, req ) - struct vcache * avc; - struct vrequest * req; +void +afs_bulkstat_send(avc, req) + struct vcache *avc; + struct vrequest *req; { - XSTATS_DECLS afs_rd_stash_i = 0; } @@ -466,73 +499,82 @@ void afs_bulkstat_send( avc, req ) * It has to do with 'offset' (seek locations). */ -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +int +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) afs_readdir(OSI_VC_ARG(avc), auio, acred, eofp) - int *eofp; + int *eofp; #else -#if defined(AFS_HPUX100_ENV) +#if defined(AFS_HPUX100_ENV) afs_readdir2(OSI_VC_ARG(avc), auio, acred) #else afs_readdir(OSI_VC_ARG(avc), auio, acred) -#endif +#endif #endif OSI_VC_DECL(avc); - struct uio *auio; - struct AFS_UCRED *acred; { + struct uio *auio; + struct AFS_UCRED *acred; +{ struct vrequest treq; register struct dcache *tdc; - afs_int32 origOffset, len, dirsiz; + afs_size_t origOffset, tlen; + afs_int32 len; int code = 0; struct DirEntry *ode = 0, *nde = 0; int o_slen = 0, n_slen = 0; afs_uint32 us; struct afs_fakestat_state fakestate; #if defined(AFS_SGI53_ENV) - afs_int32 use64BitDirent; + afs_int32 use64BitDirent, dirsiz; #endif /* defined(AFS_SGI53_ENV) */ OSI_VC_CONVERT(avc) #ifdef AFS_HPUX_ENV - /* - * XXX All the hacks for alloced sdirEntry and inlining of afs_readdir_move instead of calling - * it is necessary for hpux due to stack problems that seem to occur when coming thru the nfs - * translator side XXX - */ - struct min_direct *sdirEntry = (struct min_direct *)osi_AllocSmallSpace(sizeof(struct min_direct)); + /* + * XXX All the hacks for alloced sdirEntry and inlining of afs_readdir_move instead of calling + * it is necessary for hpux due to stack problems that seem to occur when coming thru the nfs + * translator side XXX + */ + struct min_direct *sdirEntry = + (struct min_direct *)osi_AllocSmallSpace(sizeof(struct min_direct)); afs_int32 rlen; #endif /* opaque value is pointer into a vice dir; use bit map to decide - if the entries are in use. Always assumed to be valid. 0 is - special, means start of a new dir. Int32 inode, followed by - short reclen and short namelen. Namelen does not include - the null byte. Followed by null-terminated string. - */ + * if the entries are in use. Always assumed to be valid. 0 is + * special, means start of a new dir. Int32 inode, followed by + * short reclen and short namelen. Namelen does not include + * the null byte. Followed by null-terminated string. + */ AFS_STATCNT(afs_readdir); #if defined(AFS_SGI53_ENV) #ifdef AFS_SGI61_ENV #ifdef AFS_SGI62_ENV - use64BitDirent = ABI_IS(ABI_IRIX5_64, - GETDENTS_ABI(OSI_GET_CURRENT_ABI(), auio)); + use64BitDirent = + ABI_IS(ABI_IRIX5_64, GETDENTS_ABI(OSI_GET_CURRENT_ABI(), auio)); #else - use64BitDirent = (auio->uio_segflg != UIO_USERSPACE) ? ABI_IRIX5_64 : - (ABI_IS(ABI_IRIX5_64 | ABI_IRIX5_N32, u.u_procp->p_abi)); + use64BitDirent = + (auio->uio_segflg != + UIO_USERSPACE) ? ABI_IRIX5_64 : (ABI_IS(ABI_IRIX5_64 | ABI_IRIX5_N32, + u.u_procp->p_abi)); #endif /* AFS_SGI62_ENV */ #else /* AFS_SGI61_ENV */ - use64BitDirent = (auio->uio_segflg != UIO_USERSPACE) ? ABI_IRIX5_64 : - (ABI_IS(ABI_IRIX5_64, u.u_procp->p_abi)); + use64BitDirent = + (auio->uio_segflg != + UIO_USERSPACE) ? ABI_IRIX5_64 : (ABI_IS(ABI_IRIX5_64, + u.u_procp->p_abi)); #endif /* AFS_SGI61_ENV */ #endif /* defined(AFS_SGI53_ENV) */ -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) /* Not really used by the callee so we ignore it for now */ - if (eofp) *eofp = 0; + if (eofp) + *eofp = 0; #endif - if ( AfsLargeFileUio(auio) /* file is large than 2 GB */ - || AfsLargeFileSize(auio->uio_offset, auio->uio_resid) ) + if (AfsLargeFileUio(auio) /* file is large than 2 GB */ + ||AfsLargeFileSize(auio->uio_offset, auio->uio_resid)) return EFBIG; - if (code = afs_InitReq(&treq, acred)) { + if ((code = afs_InitReq(&treq, acred))) { #ifdef AFS_HPUX_ENV osi_FreeSmallSpace((char *)sdirEntry); #endif @@ -541,17 +583,21 @@ afs_readdir(OSI_VC_ARG(avc), auio, acred) /* update the cache entry */ afs_InitFakeStat(&fakestate); code = afs_EvalFakeStat(&avc, &fakestate, &treq); - if (code) goto done; -tagain: + if (code) + goto done; + tagain: code = afs_VerifyVCache(avc, &treq); - if (code) goto done; + if (code) + goto done; /* get a reference to the entire directory */ - tdc = afs_GetDCache(avc, 0, &treq, &origOffset, &len, 1); + tdc = afs_GetDCache(avc, (afs_size_t) 0, &treq, &origOffset, &tlen, 1); + len = tlen; if (!tdc) { code = ENOENT; goto done; } ObtainReadLock(&avc->lock); + ObtainReadLock(&tdc->lock); /* * Make sure that the data in the cache is current. There are two @@ -560,76 +606,85 @@ tagain: * 2. The cache data is no longer valid */ while ((avc->states & CStatd) - && (tdc->flags & DFFetching) + && (tdc->dflags & DFFetching) && hsame(avc->m.DataVersion, tdc->f.versionNo)) { - tdc->flags |= DFWaiting; + afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAIT, ICL_TYPE_STRING, + __FILE__, ICL_TYPE_INT32, __LINE__, ICL_TYPE_POINTER, tdc, + ICL_TYPE_INT32, tdc->dflags); + ReleaseReadLock(&tdc->lock); ReleaseReadLock(&avc->lock); afs_osi_Sleep(&tdc->validPos); ObtainReadLock(&avc->lock); + ObtainReadLock(&tdc->lock); } if (!(avc->states & CStatd) || !hsame(avc->m.DataVersion, tdc->f.versionNo)) { + ReleaseReadLock(&tdc->lock); ReleaseReadLock(&avc->lock); afs_PutDCache(tdc); goto tagain; } /* - * iterator for the directory reads. Takes the AFS DirEntry - * structure and slams them into UFS direct structures. - * uses afs_readdir_move to get the struct to the user space. + * iterator for the directory reads. Takes the AFS DirEntry + * structure and slams them into UFS direct structures. + * uses afs_readdir_move to get the struct to the user space. * - * The routine works by looking ahead one AFS directory entry. - * That's because the AFS entry we are currenly working with - * may not fit into the buffer the user has provided. If it - * doesn't we have to change the size of the LAST AFS directory - * entry, so that it will FIT perfectly into the block the - * user has provided. - * - * The 'forward looking' of the code makes it a bit tough to read. - * Remember we need to get an entry, see if it it fits, then - * set it up as the LAST entry, and find the next one. + * The routine works by looking ahead one AFS directory entry. + * That's because the AFS entry we are currenly working with + * may not fit into the buffer the user has provided. If it + * doesn't we have to change the size of the LAST AFS directory + * entry, so that it will FIT perfectly into the block the + * user has provided. + * + * The 'forward looking' of the code makes it a bit tough to read. + * Remember we need to get an entry, see if it it fits, then + * set it up as the LAST entry, and find the next one. * - * Tough to take: We give out an EINVAL if we don't have enough - * space in the buffer, and at the same time, don't have an entry - * to put into the buffer. This CAN happen if the first AFS entry - * we get can't fit into the 512 character buffer provided. Seems - * it ought not happen... + * Tough to take: We give out an EINVAL if we don't have enough + * space in the buffer, and at the same time, don't have an entry + * to put into the buffer. This CAN happen if the first AFS entry + * we get can't fit into the 512 character buffer provided. Seems + * it ought not happen... * - * Assumption: don't need to use anything but one dc entry: - * this means the directory ought not be greater than 64k. + * Assumption: don't need to use anything but one dc entry: + * this means the directory ought not be greater than 64k. */ len = 0; #ifdef AFS_HPUX_ENV auio->uio_fpflags = 0; #endif - while (code==0) { + while (code == 0) { origOffset = auio->afsio_offset; /* scan for the next interesting entry scan for in-use blob otherwise up point at * this blob note that ode, if non-zero, also represents a held dir page */ - if (!(us = BlobScan(&tdc->f.inode, (origOffset >> 5)) ) - || !(nde = (struct DirEntry *) afs_dir_GetBlob(&tdc->f.inode, us) ) ) { + if (!(us = BlobScan(&tdc->f.inode, (origOffset >> 5))) + || !(nde = (struct DirEntry *)afs_dir_GetBlob(&tdc->f.inode, us))) { /* failed to setup nde, return what we've got, and release ode */ if (len) { /* something to hand over. */ #ifdef AFS_HPUX_ENV - sdirEntry->d_fileno = (avc->fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); + sdirEntry->d_fileno = + (avc->fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); FIXUPSTUPIDINODE(sdirEntry->d_fileno); sdirEntry->d_reclen = rlen = auio->afsio_resid; sdirEntry->d_namlen = o_slen; #if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV) sdirEntry->d_off = origOffset; #endif - AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, auio, code); + AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, + auio, code); if (code == 0) AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); /* pad out the remaining characters with zeros */ if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, UIO_READ, auio, code); + AFS_UIOMOVE(bufofzeros, + ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, + UIO_READ, auio, code); } /* pad out the difference between rlen and slen... */ if (DIRSIZ_LEN(o_slen) < rlen) { - while(DIRSIZ_LEN(o_slen) < rlen) { + while (DIRSIZ_LEN(o_slen) < rlen) { int minLen = rlen - DIRSIZ_LEN(o_slen); if (minLen > sizeof(bufofzeros)) minLen = sizeof(bufofzeros); @@ -640,7 +695,7 @@ tagain: #else code = afs_readdir_move(ode, avc, auio, o_slen, #if defined(AFS_SUN5_ENV) - len, origOffset); + len, origOffset); #else auio->afsio_resid, origOffset); #endif @@ -651,10 +706,12 @@ tagain: } else { /* nothin to hand over */ } -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - if (eofp) *eofp = 1; /* Set it properly */ +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + if (eofp) + *eofp = 1; /* Set it properly */ #endif - if (ode) DRelease(ode, 0); + if (ode) + DRelease((struct buffer *)ode, 0); goto dirend; } /* by here nde is set */ @@ -666,33 +723,37 @@ tagain: n_slen = strlen(nde->name); #endif #ifdef AFS_SGI53_ENV - dirsiz = use64BitDirent ? DIRENTSIZE(n_slen) : - IRIX5_DIRENTSIZE(n_slen); - if (dirsiz >= (auio->afsio_resid-len)) { + dirsiz = + use64BitDirent ? DIRENTSIZE(n_slen) : IRIX5_DIRENTSIZE(n_slen); + if (dirsiz >= (auio->afsio_resid - len)) { #else - if (DIRSIZ_LEN(n_slen) >= (auio->afsio_resid-len)) { + if (DIRSIZ_LEN(n_slen) >= (auio->afsio_resid - len)) { #endif /* AFS_SGI53_ENV */ /* No can do no more now; ya know... at this time */ - DRelease (nde, 0); /* can't use this one. */ + DRelease((struct buffer *)nde, 0); /* can't use this one. */ if (len) { #ifdef AFS_HPUX_ENV - sdirEntry->d_fileno = (avc->fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); + sdirEntry->d_fileno = + (avc->fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); FIXUPSTUPIDINODE(sdirEntry->d_fileno); sdirEntry->d_reclen = rlen = auio->afsio_resid; sdirEntry->d_namlen = o_slen; #if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV) sdirEntry->d_off = origOffset; #endif - AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, auio, code); + AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, + auio, code); if (code == 0) AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); /* pad out the remaining characters with zeros */ if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, UIO_READ, auio, code); + AFS_UIOMOVE(bufofzeros, + ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, + UIO_READ, auio, code); } /* pad out the difference between rlen and slen... */ if (DIRSIZ_LEN(o_slen) < rlen) { - while(DIRSIZ_LEN(o_slen) < rlen) { + while (DIRSIZ_LEN(o_slen) < rlen) { int minLen = rlen - DIRSIZ_LEN(o_slen); if (minLen > sizeof(bufofzeros)) minLen = sizeof(bufofzeros); @@ -701,21 +762,23 @@ tagain: } } #else /* AFS_HPUX_ENV */ - code = afs_readdir_move(ode, avc, auio, o_slen, - auio->afsio_resid, origOffset); + code = + afs_readdir_move(ode, avc, auio, o_slen, + auio->afsio_resid, origOffset); #endif /* AFS_HPUX_ENV */ /* this next line used to be AFSVFS40 or AIX 3.1, but is * really generic */ auio->afsio_offset = origOffset; - auio->afsio_resid = 0; - } else { /* trouble, can't give anything to the user! */ + auio->afsio_resid = 0; + } else { /* trouble, can't give anything to the user! */ /* even though he has given us a buffer, * even though we have something to give us, * Looks like we lost something somewhere. */ code = EINVAL; } - if (ode) DRelease(ode, 0); + if (ode) + DRelease((struct buffer *)ode, 0); goto dirend; } @@ -733,18 +796,19 @@ tagain: #if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV) sdirEntry->d_off = origOffset; #endif - AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, - auio, code); + AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, auio, + code); if (code == 0) AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); /* pad out the remaining characters with zeros */ if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, + AFS_UIOMOVE(bufofzeros, + ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, UIO_READ, auio, code); } /* pad out the difference between rlen and slen... */ if (DIRSIZ_LEN(o_slen) < rlen) { - while(DIRSIZ_LEN(o_slen) < rlen) { + while (DIRSIZ_LEN(o_slen) < rlen) { int minLen = rlen - DIRSIZ_LEN(o_slen); if (minLen > sizeof(bufofzeros)) minLen = sizeof(bufofzeros); @@ -753,26 +817,31 @@ tagain: } } #else /* AFS_HPUX_ENV */ - code = afs_readdir_move (ode, avc, auio, o_slen, len, origOffset); + code = afs_readdir_move(ode, avc, auio, o_slen, len, origOffset); #endif /* AFS_HPUX_ENV */ } #ifdef AFS_SGI53_ENV - len = use64BitDirent ? DIRENTSIZE(o_slen = n_slen) : - IRIX5_DIRENTSIZE(o_slen = n_slen); + len = use64BitDirent ? DIRENTSIZE(o_slen = + n_slen) : IRIX5_DIRENTSIZE(o_slen = + n_slen); #else - len = DIRSIZ_LEN( o_slen = n_slen ); + len = DIRSIZ_LEN(o_slen = n_slen); #endif /* AFS_SGI53_ENV */ - if (ode) DRelease(ode, 0); + if (ode) + DRelease((struct buffer *)ode, 0); ode = nde; - auio->afsio_offset = (afs_int32)((us + afs_dir_NameBlobs(nde->name)) << 5); + auio->afsio_offset = + (afs_int32) ((us + afs_dir_NameBlobs(nde->name)) << 5); } - if (ode) DRelease(ode, 0); + if (ode) + DRelease((struct buffer *)ode, 0); -dirend: + dirend: + ReleaseReadLock(&tdc->lock); afs_PutDCache(tdc); ReleaseReadLock(&avc->lock); -done: + done: #ifdef AFS_HPUX_ENV osi_FreeSmallSpace((char *)sdirEntry); #endif @@ -784,16 +853,17 @@ done: #if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV) #ifdef AFS_OSF_ENV afs1_readdir(avc, auio, acred, eofp) - int *eofp; + int *eofp; #else afs1_readdir(avc, auio, acred) #endif - struct vcache *avc; - struct uio *auio; - struct AFS_UCRED *acred; { + struct vcache *avc; + struct uio *auio; + struct AFS_UCRED *acred; +{ struct vrequest treq; register struct dcache *tdc; - afs_int32 origOffset, len; + afs_size_t origOffset, len; int code = 0; struct DirEntry *ode = 0, *nde = 0; int o_slen = 0, n_slen = 0; @@ -804,14 +874,16 @@ afs1_readdir(avc, auio, acred) * it is necessary for hpux due to stack problems that seem to occur when coming thru the nfs * translator side XXX */ - struct minnfs_direct *sdirEntry = (struct minnfs_direct *)osi_AllocSmallSpace(sizeof(struct min_direct)); + struct minnfs_direct *sdirEntry = (struct minnfs_direct *) + osi_AllocSmallSpace(sizeof(struct min_direct)); afs_int32 rlen; #endif struct afs_fakestat_state fakestate; AFS_STATCNT(afs_readdir); #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) - if (eofp) *eofp = 0; + if (eofp) + *eofp = 0; #endif if (code = afs_InitReq(&treq, acred)) { #ifdef AFS_HPUX_ENV @@ -829,16 +901,18 @@ afs1_readdir(avc, auio, acred) return code; } /* update the cache entry */ -tagain: + tagain: code = afs_VerifyVCache(avc, &treq); - if (code) goto done; + if (code) + goto done; /* get a reference to the entire directory */ - tdc = afs_GetDCache(avc, 0, &treq, &origOffset, &len, 1); + tdc = afs_GetDCache(avc, (afs_size_t) 0, &treq, &origOffset, &len, 1); if (!tdc) { code = ENOENT; goto done; } ObtainReadLock(&avc->lock); + ObtainReadLock(&tdc->lock); /* * Make sure that the data in the cache is current. There are two @@ -847,15 +921,20 @@ tagain: * 2. The cache data is no longer valid */ while ((avc->states & CStatd) - && (tdc->flags & DFFetching) + && (tdc->dflags & DFFetching) && hsame(avc->m.DataVersion, tdc->f.versionNo)) { - tdc->flags |= DFWaiting; + afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAIT, ICL_TYPE_STRING, + __FILE__, ICL_TYPE_INT32, __LINE__, ICL_TYPE_POINTER, tdc, + ICL_TYPE_INT32, tdc->dflags); + ReleaseReadLock(&tdc->lock); ReleaseReadLock(&avc->lock); afs_osi_Sleep(&tdc->validPos); ObtainReadLock(&avc->lock); + ObtainReadLock(&tdc->lock); } if (!(avc->states & CStatd) || !hsame(avc->m.DataVersion, tdc->f.versionNo)) { + ReleaseReadLock(&tdc->lock); ReleaseReadLock(&avc->lock); afs_PutDCache(tdc); goto tagain; @@ -865,34 +944,38 @@ tagain: #ifdef AFS_HPUX_ENV auio->uio_fpflags = 0; #endif - while (code==0) { + while (code == 0) { origOffset = auio->afsio_offset; /* scan for the next interesting entry scan for in-use blob otherwise up point at * this blob note that ode, if non-zero, also represents a held dir page */ - if (!(us = BlobScan(&tdc->f.inode, (origOffset >> 5)) ) - || !(nde = (struct DirEntry *) afs_dir_GetBlob(&tdc->f.inode, us) ) ) { + if (!(us = BlobScan(&tdc->f.inode, (origOffset >> 5))) + || !(nde = (struct DirEntry *)afs_dir_GetBlob(&tdc->f.inode, us))) { /* failed to setup nde, return what we've got, and release ode */ if (len) { /* something to hand over. */ #if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV) - sdirEntry->d_fileno = (avc->fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); + sdirEntry->d_fileno = + (avc->fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); FIXUPSTUPIDINODE(sdirEntry->d_fileno); sdirEntry->d_reclen = rlen = auio->afsio_resid; sdirEntry->d_namlen = o_slen; sdirEntry->d_off = origOffset; - AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, auio, code); + AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, + auio, code); if (code == 0) { AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); } /* pad out the remaining characters with zeros */ if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, UIO_READ, auio, code); + AFS_UIOMOVE(bufofzeros, + ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, + UIO_READ, auio, code); } /* pad out the difference between rlen and slen... */ if (NDIRSIZ_LEN(o_slen) < rlen) { - while(NDIRSIZ_LEN(o_slen) < rlen) { - int minLen = rlen - NDIRSIZ_LEN(o_slen); + while (NDIRSIZ_LEN(o_slen) < rlen) { + int minLen = rlen - NDIRSIZ_LEN(o_slen); if (minLen > sizeof(bufofzeros)) minLen = sizeof(bufofzeros); AFS_UIOMOVE(bufofzeros, minLen, UIO_READ, auio, code); @@ -900,17 +983,20 @@ tagain: } } #else - code = afs_readdir_move(ode, avc, auio, o_slen, - auio->afsio_resid, origOffset); + code = + afs_readdir_move(ode, avc, auio, o_slen, + auio->afsio_resid, origOffset); #endif /* AFS_HPUX_ENV */ - auio->afsio_resid = 0; + auio->afsio_resid = 0; } else { /* nothin to hand over */ } #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) - if (eofp) *eofp = 1; + if (eofp) + *eofp = 1; #endif - if (ode) DRelease(ode, 0); + if (ode) + DRelease(ode, 0); goto dirend; } /* by here nde is set */ @@ -921,26 +1007,30 @@ tagain: #else n_slen = strlen(nde->name); #endif - if (NDIRSIZ_LEN(n_slen) >= (auio->afsio_resid-len)) { + if (NDIRSIZ_LEN(n_slen) >= (auio->afsio_resid - len)) { /* No can do no more now; ya know... at this time */ - DRelease (nde, 0); /* can't use this one. */ + DRelease(nde, 0); /* can't use this one. */ if (len) { #if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV) - sdirEntry->d_fileno = (avc->fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); + sdirEntry->d_fileno = + (avc->fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); FIXUPSTUPIDINODE(sdirEntry->d_fileno); sdirEntry->d_reclen = rlen = auio->afsio_resid; sdirEntry->d_namlen = o_slen; sdirEntry->d_off = origOffset; - AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, auio, code); + AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, + auio, code); if (code == 0) AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); /* pad out the remaining characters with zeros */ if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, UIO_READ, auio, code); + AFS_UIOMOVE(bufofzeros, + ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, + UIO_READ, auio, code); } /* pad out the difference between rlen and slen... */ if (NDIRSIZ_LEN(o_slen) < rlen) { - while(NDIRSIZ_LEN(o_slen) < rlen) { + while (NDIRSIZ_LEN(o_slen) < rlen) { int minLen = rlen - NDIRSIZ_LEN(o_slen); if (minLen > sizeof(bufofzeros)) minLen = sizeof(bufofzeros); @@ -949,20 +1039,22 @@ tagain: } } #else - code = afs_readdir_move(ode, avc, auio, o_slen, - auio->afsio_resid, origOffset); + code = + afs_readdir_move(ode, avc, auio, o_slen, + auio->afsio_resid, origOffset); #endif /* AFS_HPUX_ENV */ /* this next line used to be AFSVFS40 or AIX 3.1, but is really generic */ auio->afsio_offset = origOffset; - auio->afsio_resid = 0; - } else { /* trouble, can't give anything to the user! */ + auio->afsio_resid = 0; + } else { /* trouble, can't give anything to the user! */ /* even though he has given us a buffer, * even though we have something to give us, * Looks like we lost something somewhere. */ code = EINVAL; } - if (ode) DRelease(ode, 0); + if (ode) + DRelease(ode, 0); goto dirend; } @@ -972,21 +1064,25 @@ tagain: */ if (len) { #if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV) - sdirEntry->d_fileno = (avc->fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); + sdirEntry->d_fileno = + (avc->fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); FIXUPSTUPIDINODE(sdirEntry->d_fileno); sdirEntry->d_reclen = rlen = len; sdirEntry->d_namlen = o_slen; sdirEntry->d_off = origOffset; - AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, auio, code); + AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, auio, + code); if (code == 0) AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); /* pad out the remaining characters with zeros */ if (code == 0) { - AFS_UIOMOVE(bufofzeros, ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, UIO_READ, auio, code); + AFS_UIOMOVE(bufofzeros, + ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, + UIO_READ, auio, code); } /* pad out the difference between rlen and slen... */ if (NDIRSIZ_LEN(o_slen) < rlen) { - while(NDIRSIZ_LEN(o_slen) < rlen) { + while (NDIRSIZ_LEN(o_slen) < rlen) { int minLen = rlen - NDIRSIZ_LEN(o_slen); if (minLen > sizeof(bufofzeros)) minLen = sizeof(bufofzeros); @@ -995,21 +1091,24 @@ tagain: } } #else - code = afs_readdir_move (ode, avc, auio, o_slen, len, origOffset); + code = afs_readdir_move(ode, avc, auio, o_slen, len, origOffset); #endif /* AFS_HPUX_ENV */ } - len = NDIRSIZ_LEN( o_slen = n_slen ); - if (ode) DRelease(ode, 0); + len = NDIRSIZ_LEN(o_slen = n_slen); + if (ode) + DRelease(ode, 0); ode = nde; auio->afsio_offset = ((us + afs_dir_NameBlobs(nde->name)) << 5); } - if (ode) DRelease(ode, 0); + if (ode) + DRelease(ode, 0); -dirend: + dirend: + ReleaseReadLock(&tdc->lock); afs_PutDCache(tdc); ReleaseReadLock(&avc->lock); -done: + done: #if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV) osi_FreeSmallSpace((char *)sdirEntry); #endif diff --git a/src/afs/VNOPS/afs_vnop_remove.c b/src/afs/VNOPS/afs_vnop_remove.c index 39e680eb3..55c060eaf 100644 --- a/src/afs/VNOPS/afs_vnop_remove.c +++ b/src/afs/VNOPS/afs_vnop_remove.c @@ -20,16 +20,17 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.1.1.9 2002/08/02 04:29:03 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.28 2004/04/05 06:26:17 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" extern afs_rwlock_t afs_xvcache; @@ -45,36 +46,41 @@ extern afs_rwlock_t afs_xcbhash; * afs_IsWired notices that the file is no longer Active. */ afs_Wire(avc, areq) -#else /* AFS_OSF_ENV */ -static void FetchWholeEnchilada(avc, areq) +#else /* AFS_OSF_ENV */ +static void +FetchWholeEnchilada(avc, areq) #endif -struct vrequest *areq; -register struct vcache *avc; { - register afs_int32 nextChunk, pos; + struct vrequest *areq; + register struct vcache *avc; +{ + register afs_int32 nextChunk; register struct dcache *tdc; - afs_int32 offset, len; + afs_size_t pos, offset, len; AFS_STATCNT(FetchWholeEnchilada); - if ((avc->states & CStatd) == 0) return; /* don't know size */ - for(nextChunk=0;nextChunk<1024;nextChunk++) { /* sanity check on N chunks */ + if ((avc->states & CStatd) == 0) + return; /* don't know size */ + for (nextChunk = 0; nextChunk < 1024; nextChunk++) { /* sanity check on N chunks */ pos = AFS_CHUNKTOBASE(nextChunk); #if defined(AFS_OSF_ENV) - if (pos >= avc->m.Length) break; /* all done */ -#else /* AFS_OSF_ENV */ - if (pos >= avc->m.Length) return; /* all done */ + if (pos >= avc->m.Length) + break; /* all done */ +#else /* AFS_OSF_ENV */ + if (pos >= avc->m.Length) + return; /* all done */ #endif tdc = afs_GetDCache(avc, pos, areq, &offset, &len, 0); - if (!tdc) + if (!tdc) #if defined(AFS_OSF_ENV) break; -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ return; #endif afs_PutDCache(tdc); } #if defined(AFS_OSF_ENV) avc->states |= CWired; -#endif /* AFS_OSF_ENV */ +#endif /* AFS_OSF_ENV */ } #if defined(AFS_OSF_ENV) @@ -83,7 +89,8 @@ register struct vcache *avc; { * is found to be inactive (ie not open and not being paged from). */ afs_IsWired(avc) - register struct vcache *avc; { + register struct vcache *avc; +{ if (avc->states & CWired) { if (osi_Active(avc)) { return 1; @@ -92,59 +99,59 @@ afs_IsWired(avc) } return 0; } -#endif /* AFS_OSF_ENV */ +#endif /* AFS_OSF_ENV */ -afsremove(adp, tdc, tvc, aname, acred, treqp) - register struct vcache *adp; - register struct dcache *tdc; - register struct vcache *tvc; - char *aname; - struct vrequest *treqp; - struct AFS_UCRED *acred; { +int +afsremove(register struct vcache *adp, register struct dcache *tdc, + register struct vcache *tvc, char *aname, struct AFS_UCRED *acred, + struct vrequest *treqp) +{ register afs_int32 code; register struct conn *tc; - afs_int32 offset, len; struct AFSFetchStatus OutDirStatus; struct AFSVolSync tsync; XSTATS_DECLS - do { tc = afs_Conn(&adp->fid, treqp, SHARED_LOCK); if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_REMOVEFILE); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_RemoveFile(tc->id, (struct AFSFid *) &adp->fid.Fid, - aname, &OutDirStatus, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } - else code = -1; - } while - (afs_Analyze(tc, code, &adp->fid, treqp, - AFS_STATS_FS_RPCIDX_REMOVEFILE, SHARED_LOCK, (struct cell *)0)); - - osi_dnlc_remove (adp, aname, tvc); - if (tvc) afs_symhint_inval(tvc); /* XXX: don't really need to be so extreme */ + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_REMOVEFILE); + RX_AFS_GUNLOCK(); + code = + RXAFS_RemoveFile(tc->id, (struct AFSFid *)&adp->fid.Fid, + aname, &OutDirStatus, &tsync); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tc, code, &adp->fid, treqp, AFS_STATS_FS_RPCIDX_REMOVEFILE, + SHARED_LOCK, NULL)); + + osi_dnlc_remove(adp, aname, tvc); + if (tvc) + afs_symhint_inval(tvc); /* XXX: don't really need to be so extreme */ if (code) { - if (tdc) afs_PutDCache(tdc); - if (tvc) afs_PutVCache(tvc, WRITE_LOCK); + if (tdc) { + ReleaseSharedLock(&tdc->lock); + afs_PutDCache(tdc); + } + if (tvc) + afs_PutVCache(tvc); if (code < 0) { - ObtainWriteLock(&afs_xcbhash, 497); - afs_DequeueCallback(adp); - adp->states &= ~CStatd; - ReleaseWriteLock(&afs_xcbhash); - osi_dnlc_purgedp(adp); + ObtainWriteLock(&afs_xcbhash, 497); + afs_DequeueCallback(adp); + adp->states &= ~CStatd; + ReleaseWriteLock(&afs_xcbhash); + osi_dnlc_purgedp(adp); } ReleaseWriteLock(&adp->lock); code = afs_CheckCode(code, treqp, 21); return code; } + if (tdc) + UpgradeSToWLock(&tdc->lock, 637); if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) { /* we can do it locally */ code = afs_dir_Delete(&tdc->f.inode, aname); @@ -154,6 +161,7 @@ afsremove(adp, tdc, tvc, aname, acred, treqp) } } if (tdc) { + ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); /* drop ref count */ } ReleaseWriteLock(&adp->lock); @@ -164,34 +172,38 @@ afsremove(adp, tdc, tvc, aname, acred, treqp) * gone, we won't be able to fetch the status info anyway. */ if (tvc) { #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) - afs_BozonLock(&tvc->pvnLock, tvc); + afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */ #endif - ObtainWriteLock(&tvc->lock,141); + ObtainWriteLock(&tvc->lock, 141); /* note that callback will be broken on the deleted file if there are * still >0 links left to it, so we'll get the stat right */ tvc->m.LinkCount--; - tvc->states &= ~CUnique; /* For the dfs xlator */ + tvc->states &= ~CUnique; /* For the dfs xlator */ if (tvc->m.LinkCount == 0 && !osi_Active(tvc)) { - if (!AFS_NFSXLATORREQ(acred)) afs_TryToSmush(tvc, acred, 0); - } + if (!AFS_NFSXLATORREQ(acred)) + afs_TryToSmush(tvc, acred, 0); + } ReleaseWriteLock(&tvc->lock); #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) afs_BozonUnlock(&tvc->pvnLock, tvc); #endif - afs_PutVCache(tvc, WRITE_LOCK); + afs_PutVCache(tvc); } return (0); } -static char *newname() { +static char * +newname(void) +{ char *name, *sp, *p = ".__afs"; afs_int32 rd = afs_random() & 0xffff; sp = name = osi_AllocSmallSpace(AFS_SMALLOCSIZ); - while (*p != '\0') *sp++ = *p++; + while (*p != '\0') + *sp++ = *p++; while (rd) { - *sp++= "0123456789ABCDEF"[rd & 0x0f]; + *sp++ = "0123456789ABCDEF"[rd & 0x0f]; rd >>= 4; } *sp = '\0'; @@ -199,51 +211,51 @@ static char *newname() { } /* these variables appear to exist for debugging purposes */ -struct vcache * Tadp1, * Ttvc; +struct vcache *Tadp1, *Ttvc; int Tadpr, Ttvcr; char *Tnam; char *Tnam1; /* Note that we don't set CDirty here, this is OK because the unlink * RPC is called synchronously */ +int #ifdef AFS_OSF_ENV afs_remove(ndp) - struct nameidata *ndp; { + struct nameidata *ndp; +{ register struct vcache *adp = VTOAFS(ndp->ni_dvp); char *aname = ndp->ni_dent.d_name; struct ucred *acred = ndp->ni_cred; -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ afs_remove(OSI_VC_ARG(adp), aname, acred) - OSI_VC_DECL(adp); - char *aname; - struct AFS_UCRED *acred; { +OSI_VC_DECL(adp); + char *aname; + struct AFS_UCRED *acred; +{ #endif struct vrequest treq; register struct dcache *tdc; struct VenusFid unlinkFid; register afs_int32 code; register struct vcache *tvc; - afs_int32 offset, len; - struct AFSFetchStatus OutDirStatus; - struct AFSVolSync tsync; + afs_size_t offset, len; struct afs_fakestat_state fakestate; - XSTATS_DECLS OSI_VC_CONVERT(adp) - AFS_STATCNT(afs_remove); + AFS_STATCNT(afs_remove); afs_Trace2(afs_iclSetp, CM_TRACE_REMOVE, ICL_TYPE_POINTER, adp, ICL_TYPE_STRING, aname); #ifdef AFS_OSF_ENV - tvc = (struct vcache *)ndp->ni_vp; /* should never be null */ + tvc = (struct vcache *)ndp->ni_vp; /* should never be null */ #endif - if (code = afs_InitReq(&treq, acred)) { + if ((code = afs_InitReq(&treq, acred))) { #ifdef AFS_OSF_ENV - afs_PutVCache(adp, 0); - afs_PutVCache(tvc, 0); + afs_PutVCache(adp); + afs_PutVCache(tvc); #endif - return code; + return code; } afs_InitFakeStat(&fakestate); @@ -251,8 +263,8 @@ afs_remove(OSI_VC_ARG(adp), aname, acred) if (code) { afs_PutFakeStat(&fakestate); #ifdef AFS_OSF_ENV - afs_PutVCache(adp, 0); - afs_PutVCache(tvc, 0); + afs_PutVCache(adp); + afs_PutVCache(tvc); #endif return code; } @@ -262,31 +274,43 @@ afs_remove(OSI_VC_ARG(adp), aname, acred) code = afs_DynrootVOPRemove(adp, acred, aname); afs_PutFakeStat(&fakestate); #ifdef AFS_OSF_ENV - afs_PutVCache(adp, 0); - afs_PutVCache(tvc, 0); + afs_PutVCache(adp); + afs_PutVCache(tvc); #endif return code; } + +#if 0 + if (adp->mvstat == 2) { + afs_PutFakeStat(&fakestate); +#ifdef AFS_OSF_ENV + afs_PutVCache(adp); + afs_PutVCache(tvc); +#endif + return EISDIR; + } +#endif + if (strlen(aname) > AFSNAMEMAX) { afs_PutFakeStat(&fakestate); #ifdef AFS_OSF_ENV - afs_PutVCache(adp, 0); - afs_PutVCache(tvc, 0); + afs_PutVCache(adp); + afs_PutVCache(tvc); #endif return ENAMETOOLONG; } -tagain: + tagain: code = afs_VerifyVCache(adp, &treq); #ifdef AFS_OSF_ENV - tvc = VTOAFS(ndp->ni_vp); /* should never be null */ + tvc = VTOAFS(ndp->ni_vp); /* should never be null */ if (code) { - afs_PutVCache(adp, 0); - afs_PutVCache(tvc, 0); + afs_PutVCache(adp); + afs_PutVCache(tvc); afs_PutFakeStat(&fakestate); return afs_CheckCode(code, &treq, 22); } -#else /* AFS_OSF_ENV */ - tvc = (struct vcache *) 0; +#else /* AFS_OSF_ENV */ + tvc = NULL; if (code) { code = afs_CheckCode(code, &treq, 23); afs_PutFakeStat(&fakestate); @@ -297,18 +321,20 @@ tagain: /** If the volume is read-only, return error without making an RPC to the * fileserver */ - if ( adp->states & CRO ) { + if (adp->states & CRO) { #ifdef AFS_OSF_ENV - afs_PutVCache(adp, 0); - afs_PutVCache(tvc, 0); + afs_PutVCache(adp); + afs_PutVCache(tvc); #endif - code = EROFS; + code = EROFS; afs_PutFakeStat(&fakestate); return code; } - tdc = afs_GetDCache(adp, 0, &treq, &offset, &len, 1); /* test for error below */ - ObtainWriteLock(&adp->lock,142); + tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1); /* test for error below */ + ObtainWriteLock(&adp->lock, 142); + if (tdc) + ObtainSharedLock(&tdc->lock, 638); /* * Make sure that the data in the cache is current. We may have @@ -317,63 +343,75 @@ tagain: if (!(adp->states & CStatd) || (tdc && !hsame(adp->m.DataVersion, tdc->f.versionNo))) { ReleaseWriteLock(&adp->lock); - if (tdc) + if (tdc) { + ReleaseSharedLock(&tdc->lock); afs_PutDCache(tdc); + } goto tagain; } unlinkFid.Fid.Vnode = 0; if (!tvc) { - tvc = osi_dnlc_lookup (adp, aname, WRITE_LOCK); + tvc = osi_dnlc_lookup(adp, aname, WRITE_LOCK); } /* This should not be necessary since afs_lookup() has already * done the work */ if (!tvc) - if (tdc) { - code = afs_dir_Lookup(&tdc->f.inode, aname, &unlinkFid.Fid); - if (code == 0) { - afs_int32 cached=0; - - unlinkFid.Cell = adp->fid.Cell; - unlinkFid.Fid.Volume = adp->fid.Fid.Volume; - if (unlinkFid.Fid.Unique == 0) { - tvc = afs_LookupVCache(&unlinkFid, &treq, &cached, - WRITE_LOCK, adp, aname); - } else { - ObtainReadLock(&afs_xvcache); - tvc = afs_FindVCache(&unlinkFid, 1, WRITE_LOCK, - 0 , DO_STATS ); - ReleaseReadLock(&afs_xvcache); + if (tdc) { + code = afs_dir_Lookup(&tdc->f.inode, aname, &unlinkFid.Fid); + if (code == 0) { + afs_int32 cached = 0; + + unlinkFid.Cell = adp->fid.Cell; + unlinkFid.Fid.Volume = adp->fid.Fid.Volume; + if (unlinkFid.Fid.Unique == 0) { + tvc = + afs_LookupVCache(&unlinkFid, &treq, &cached, adp, + aname); + } else { + ObtainReadLock(&afs_xvcache); + tvc = afs_FindVCache(&unlinkFid, 0, DO_STATS); + ReleaseReadLock(&afs_xvcache); + } } } - } if (tvc && osi_Active(tvc)) { /* about to delete whole file, prefetch it first */ ReleaseWriteLock(&adp->lock); - ObtainWriteLock(&tvc->lock,143); + ObtainWriteLock(&tvc->lock, 143); #if defined(AFS_OSF_ENV) afs_Wire(tvc, &treq); -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ FetchWholeEnchilada(tvc, &treq); #endif ReleaseWriteLock(&tvc->lock); - ObtainWriteLock(&adp->lock,144); + ObtainWriteLock(&adp->lock, 144); } - osi_dnlc_remove ( adp, aname, tvc); - if (tvc) afs_symhint_inval(tvc); - - Tadp1 = adp; Tadpr = VREFCOUNT(adp); Ttvc = tvc; Tnam = aname; Tnam1 = 0; - if (tvc) Ttvcr = VREFCOUNT(tvc); + osi_dnlc_remove(adp, aname, tvc); + if (tvc) + afs_symhint_inval(tvc); + + Tadp1 = adp; + Tadpr = VREFCOUNT(adp); + Ttvc = tvc; + Tnam = aname; + Tnam1 = 0; + if (tvc) + Ttvcr = VREFCOUNT(tvc); #ifdef AFS_AIX_ENV - if (tvc && (VREFCOUNT(tvc) > 2) && tvc->opens > 0 && !(tvc->states & CUnlinked)) { + if (tvc && (VREFCOUNT(tvc) > 2) && tvc->opens > 0 + && !(tvc->states & CUnlinked)) { #else - if (tvc && (VREFCOUNT(tvc) > 1) && tvc->opens > 0 && !(tvc->states & CUnlinked)) { + if (tvc && (VREFCOUNT(tvc) > 1) && tvc->opens > 0 + && !(tvc->states & CUnlinked)) { #endif char *unlname = newname(); ReleaseWriteLock(&adp->lock); + if (tdc) + ReleaseSharedLock(&tdc->lock); code = afsrename(adp, aname, adp, unlname, acred, &treq); Tnam1 = unlname; if (!code) { @@ -385,17 +423,17 @@ tagain: tvc->uncred = acred; tvc->states |= CUnlinked; } else { - osi_FreeSmallSpace(unlname); + osi_FreeSmallSpace(unlname); } - if ( tdc ) - afs_PutDCache(tdc); - afs_PutVCache(tvc, WRITE_LOCK); + if (tdc) + afs_PutDCache(tdc); + afs_PutVCache(tvc); } else { code = afsremove(adp, tdc, tvc, aname, acred, &treq); } #ifdef AFS_OSF_ENV - afs_PutVCache(adp, WRITE_LOCK); -#endif /* AFS_OSF_ENV */ + afs_PutVCache(adp); +#endif /* AFS_OSF_ENV */ afs_PutFakeStat(&fakestate); return code; } @@ -406,9 +444,8 @@ tagain: * * CAUTION -- may be called with avc unheld. */ -afs_remunlink(avc, doit) - register struct vcache *avc; - register int doit; +int +afs_remunlink(register struct vcache *avc, register int doit) { struct AFS_UCRED *cred; char *unlname; @@ -416,16 +453,15 @@ afs_remunlink(avc, doit) struct vrequest treq; struct VenusFid dirFid; register struct dcache *tdc; - afs_int32 offset, len, code=0; + afs_int32 code = 0; if (NBObtainWriteLock(&avc->lock, 423)) return 0; if (avc->mvid && (doit || (avc->states & CUnlinkedDel))) { - if (code = afs_InitReq(&treq, avc->uncred)) { + if ((code = afs_InitReq(&treq, avc->uncred))) { ReleaseWriteLock(&avc->lock); - } - else { + } else { /* Must bump the refCount because GetVCache may block. * Also clear mvid so no other thread comes here if we block. */ @@ -435,22 +471,22 @@ afs_remunlink(avc, doit) avc->uncred = NULL; #ifdef AFS_DARWIN_ENV - /* this is called by vrele (via VOP_INACTIVE) when the refcount - is 0. we can't just call VN_HOLD since vref will panic. - we can't just call osi_vnhold because a later AFS_RELE will call - vrele again, which will try to call VOP_INACTIVE again after - vn_locking the vnode. which would be fine except that our vrele - caller also locked the vnode... So instead, we just gimmick the - refcounts and hope nobody else can touch the file now */ + /* this is called by vrele (via VOP_INACTIVE) when the refcount + * is 0. we can't just call VN_HOLD since vref will panic. + * we can't just call osi_vnhold because a later AFS_RELE will call + * vrele again, which will try to call VOP_INACTIVE again after + * vn_locking the vnode. which would be fine except that our vrele + * caller also locked the vnode... So instead, we just gimmick the + * refcounts and hope nobody else can touch the file now */ osi_Assert(VREFCOUNT(avc) == 0); VREFCOUNT_SET(avc, 1); #endif - VN_HOLD(&avc->v); + VN_HOLD(AFSTOV(avc)); /* We'll only try this once. If it fails, just release the vnode. * Clear after doing hold so that NewVCache doesn't find us yet. */ - avc->states &= ~(CUnlinked | CUnlinkedDel); + avc->states &= ~(CUnlinked | CUnlinkedDel); ReleaseWriteLock(&avc->lock); @@ -458,19 +494,20 @@ afs_remunlink(avc, doit) dirFid.Fid.Volume = avc->fid.Fid.Volume; dirFid.Fid.Vnode = avc->parentVnode; dirFid.Fid.Unique = avc->parentUnique; - adp = afs_GetVCache(&dirFid, &treq, (afs_int32 *)0, - (struct vcache *)0, WRITE_LOCK); - + adp = afs_GetVCache(&dirFid, &treq, NULL, NULL); + if (adp) { - tdc = afs_FindDCache(adp, 0); + tdc = afs_FindDCache(adp, (afs_size_t) 0); ObtainWriteLock(&adp->lock, 159); + if (tdc) + ObtainSharedLock(&tdc->lock, 639); - /* afsremove releases the adp lock, and does vn_rele(avc) */ + /* afsremove releases the adp & tdc locks, and does vn_rele(avc) */ code = afsremove(adp, tdc, avc, unlname, cred, &treq); - afs_PutVCache(adp, WRITE_LOCK); + afs_PutVCache(adp); } else { /* we failed - and won't be back to try again. */ - afs_PutVCache(avc, WRITE_LOCK); + afs_PutVCache(avc); } osi_FreeSmallSpace(unlname); crfree(cred); @@ -478,9 +515,8 @@ afs_remunlink(avc, doit) osi_Assert(VREFCOUNT(avc) == 1); VREFCOUNT_SET(avc, 0); #endif - } - } - else { + } + } else { ReleaseWriteLock(&avc->lock); } diff --git a/src/afs/VNOPS/afs_vnop_rename.c b/src/afs/VNOPS/afs_vnop_rename.c index 90b5fd14e..419e68554 100644 --- a/src/afs/VNOPS/afs_vnop_rename.c +++ b/src/afs/VNOPS/afs_vnop_rename.c @@ -15,42 +15,39 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.1.1.6 2002/08/02 04:29:03 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.16 2003/08/29 22:00:04 rees Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" extern afs_rwlock_t afs_xcbhash; /* Note that we don't set CDirty here, this is OK because the rename * RPC is called synchronously. */ -afsrename(aodp, aname1, andp, aname2, acred, areq) - struct vcache *aodp, *andp; - char *aname1, *aname2; - struct AFS_UCRED *acred; - struct vrequest *areq; +int +afsrename(struct vcache *aodp, char *aname1, struct vcache *andp, + char *aname2, struct AFS_UCRED *acred, struct vrequest *areq) { register struct conn *tc; register afs_int32 code; afs_int32 returnCode; int oneDir, doLocally; - afs_int32 offset, len; + afs_size_t offset, len; struct VenusFid unlinkFid, fileFid; struct vcache *tvc; struct dcache *tdc1, *tdc2; struct AFSFetchStatus OutOldDirStatus, OutNewDirStatus; struct AFSVolSync tsync; - XSTATS_DECLS - - AFS_STATCNT(afs_rename); - afs_Trace4(afs_iclSetp, CM_TRACE_RENAME, ICL_TYPE_POINTER, aodp, + XSTATS_DECLS AFS_STATCNT(afs_rename); + afs_Trace4(afs_iclSetp, CM_TRACE_RENAME, ICL_TYPE_POINTER, aodp, ICL_TYPE_STRING, aname1, ICL_TYPE_POINTER, andp, ICL_TYPE_STRING, aname2); @@ -60,18 +57,22 @@ afsrename(aodp, aname1, andp, aname2, acred, areq) } /* verify the latest versions of the stat cache entries */ -tagain: + tagain: code = afs_VerifyVCache(aodp, areq); - if (code) goto done; + if (code) + goto done; code = afs_VerifyVCache(andp, areq); - if (code) goto done; - + if (code) + goto done; + /* lock in appropriate order, after some checks */ - if (aodp->fid.Cell != andp->fid.Cell || aodp->fid.Fid.Volume != andp->fid.Fid.Volume) { + if (aodp->fid.Cell != andp->fid.Cell + || aodp->fid.Fid.Volume != andp->fid.Fid.Volume) { code = EXDEV; goto done; } oneDir = 0; + code = 0; if (andp->fid.Fid.Vnode == aodp->fid.Fid.Vnode) { if (!strcmp(aname1, aname2)) { /* Same directory and same name; this is a noop and just return success @@ -80,94 +81,113 @@ tagain: code = 0; goto done; } - ObtainWriteLock(&andp->lock,147); - oneDir = 1; /* only one dude locked */ - } - else if ((andp->states & CRO) || (aodp->states & CRO)) { - code = EROFS; - goto done; - } - else if (andp->fid.Fid.Vnode < aodp->fid.Fid.Vnode) { - ObtainWriteLock(&andp->lock,148); /* lock smaller one first */ - ObtainWriteLock(&aodp->lock,149); - } - else { - ObtainWriteLock(&aodp->lock,150); /* lock smaller one first */ - ObtainWriteLock(&andp->lock,557); + ObtainWriteLock(&andp->lock, 147); + tdc1 = afs_GetDCache(aodp, (afs_size_t) 0, areq, &offset, &len, 0); + if (!tdc1) { + code = ENOENT; + } else { + ObtainWriteLock(&tdc1->lock, 643); + } + tdc2 = tdc1; + oneDir = 1; /* only one dude locked */ + } else if ((andp->states & CRO) || (aodp->states & CRO)) { + code = EROFS; + goto done; + } else if (andp->fid.Fid.Vnode < aodp->fid.Fid.Vnode) { + ObtainWriteLock(&andp->lock, 148); /* lock smaller one first */ + ObtainWriteLock(&aodp->lock, 149); + tdc2 = afs_FindDCache(andp, (afs_size_t) 0); + if (tdc2) + ObtainWriteLock(&tdc2->lock, 644); + tdc1 = afs_GetDCache(aodp, (afs_size_t) 0, areq, &offset, &len, 0); + if (tdc1) + ObtainWriteLock(&tdc1->lock, 645); + else + code = ENOENT; + } else { + ObtainWriteLock(&aodp->lock, 150); /* lock smaller one first */ + ObtainWriteLock(&andp->lock, 557); + tdc1 = afs_GetDCache(aodp, (afs_size_t) 0, areq, &offset, &len, 0); + if (tdc1) + ObtainWriteLock(&tdc1->lock, 646); + else + code = ENOENT; + tdc2 = afs_FindDCache(andp, (afs_size_t) 0); + if (tdc2) + ObtainWriteLock(&tdc2->lock, 647); } - osi_dnlc_remove (aodp, aname1, 0); - osi_dnlc_remove (andp, aname2, 0); - afs_symhint_inval(aodp); + osi_dnlc_remove(aodp, aname1, 0); + osi_dnlc_remove(andp, aname2, 0); + afs_symhint_inval(aodp); afs_symhint_inval(andp); - /* before doing the rename, lookup the fileFid, just in case we - * don't make it down the path below that looks it up. We always need - * fileFid in order to handle ".." invalidation at the very end. - */ - code = 0; - tdc1 = afs_GetDCache(aodp, 0, areq, &offset, &len, 0); - if (!tdc1) { - code = ENOENT; - } /* * Make sure that the data in the cache is current. We may have * received a callback while we were waiting for the write lock. */ - else if (!(aodp->states & CStatd) - || !hsame(aodp->m.DataVersion, tdc1->f.versionNo)) { - ReleaseWriteLock(&aodp->lock); - if (!oneDir) ReleaseWriteLock(&andp->lock); - afs_PutDCache(tdc1); - goto tagain; + if (tdc1) { + if (!(aodp->states & CStatd) + || !hsame(aodp->m.DataVersion, tdc1->f.versionNo)) { + + ReleaseWriteLock(&aodp->lock); + if (!oneDir) { + if (tdc2) { + ReleaseWriteLock(&tdc2->lock); + afs_PutDCache(tdc2); + } + ReleaseWriteLock(&andp->lock); + } + ReleaseWriteLock(&tdc1->lock); + afs_PutDCache(tdc1); + goto tagain; + } } if (code == 0) code = afs_dir_Lookup(&tdc1->f.inode, aname1, &fileFid.Fid); if (code) { - if (tdc1) afs_PutDCache(tdc1); + if (tdc1) { + ReleaseWriteLock(&tdc1->lock); + afs_PutDCache(tdc1); + } ReleaseWriteLock(&aodp->lock); - if (!oneDir) ReleaseWriteLock(&andp->lock); + if (!oneDir) { + if (tdc2) { + ReleaseWriteLock(&tdc2->lock); + afs_PutDCache(tdc2); + } + ReleaseWriteLock(&andp->lock); + } goto done; } - afs_PutDCache(tdc1); /* locks are now set, proceed to do the real work */ do { tc = afs_Conn(&aodp->fid, areq, SHARED_LOCK); if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_RENAME); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_Rename(tc->id, (struct AFSFid *) &aodp->fid.Fid, aname1, - (struct AFSFid *) &andp->fid.Fid, aname2, - &OutOldDirStatus, &OutNewDirStatus, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } else code = -1; + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_RENAME); + RX_AFS_GUNLOCK(); + code = + RXAFS_Rename(tc->id, (struct AFSFid *)&aodp->fid.Fid, aname1, + (struct AFSFid *)&andp->fid.Fid, aname2, + &OutOldDirStatus, &OutNewDirStatus, &tsync); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; - } while - (afs_Analyze(tc, code, &andp->fid, areq, - AFS_STATS_FS_RPCIDX_RENAME, SHARED_LOCK, (struct cell *)0)); + } while (afs_Analyze + (tc, code, &andp->fid, areq, AFS_STATS_FS_RPCIDX_RENAME, + SHARED_LOCK, NULL)); + + returnCode = code; /* remember for later */ - returnCode = code; /* remember for later */ - /* Now we try to do things locally. This is really loathsome code. */ unlinkFid.Fid.Vnode = 0; if (code == 0) { - tdc1 = tdc2 = 0; - /* don't use GetDCache because we don't want to worry about what happens if - we have to stat the file (updating the stat block) before finishing - local hero stuff (which may put old (from rename) data version number - back in the cache entry). - In any event, we don't really care if the data is not - in the cache; if it isn't, we won't do the update locally. */ - tdc1 = afs_FindDCache(aodp, 0); - if (!oneDir) tdc2 = afs_FindDCache(andp, 0); - else tdc2 = tdc1; + /* In any event, we don't really care if the data (tdc2) is not + * in the cache; if it isn't, we won't do the update locally. */ /* see if version numbers increased properly */ doLocally = 1; if (oneDir) { @@ -175,8 +195,7 @@ tagain: if (!afs_LocalHero(aodp, tdc1, &OutOldDirStatus, 1)) { doLocally = 0; } - } - else { + } else { /* two separate dirs, each increasing by 1 */ if (!afs_LocalHero(aodp, tdc1, &OutOldDirStatus, 1)) doLocally = 0; @@ -202,8 +221,9 @@ tagain: code = afs_dir_Delete(&tdc1->f.inode, aname1); } /* first see if target is there */ - if (code == 0 && - afs_dir_Lookup(&tdc2->f.inode, aname2, &unlinkFid.Fid) == 0) { + if (code == 0 + && afs_dir_Lookup(&tdc2->f.inode, aname2, + &unlinkFid.Fid) == 0) { /* target already exists, and will be unlinked by server */ code = afs_dir_Delete(&tdc2->f.inode, aname2); } @@ -219,81 +239,88 @@ tagain: } } } - if (tdc1) afs_PutDCache(tdc1); - if ((!oneDir) && tdc2) afs_PutDCache(tdc2); /* update dir link counts */ aodp->m.LinkCount = OutOldDirStatus.LinkCount; if (!oneDir) andp->m.LinkCount = OutNewDirStatus.LinkCount; - } - else { /* operation failed (code != 0) */ - if (code < 0) { + } else { /* operation failed (code != 0) */ + if (code < 0) { /* if failed, server might have done something anyway, and * assume that we know about it */ - ObtainWriteLock(&afs_xcbhash, 498); - afs_DequeueCallback(aodp); - afs_DequeueCallback(andp); - andp->states &= ~CStatd; - aodp->states &= ~CStatd; - ReleaseWriteLock(&afs_xcbhash); - osi_dnlc_purgedp(andp); - osi_dnlc_purgedp(aodp); + ObtainWriteLock(&afs_xcbhash, 498); + afs_DequeueCallback(aodp); + afs_DequeueCallback(andp); + andp->states &= ~CStatd; + aodp->states &= ~CStatd; + ReleaseWriteLock(&afs_xcbhash); + osi_dnlc_purgedp(andp); + osi_dnlc_purgedp(aodp); } } /* release locks */ + if (tdc1) { + ReleaseWriteLock(&tdc1->lock); + afs_PutDCache(tdc1); + } + + if ((!oneDir) && tdc2) { + ReleaseWriteLock(&tdc2->lock); + afs_PutDCache(tdc2); + } + ReleaseWriteLock(&aodp->lock); - if (!oneDir) ReleaseWriteLock(&andp->lock); - + if (!oneDir) + ReleaseWriteLock(&andp->lock); + if (returnCode) { code = returnCode; goto done; } /* now, some more details. if unlinkFid.Fid.Vnode then we should decrement - the link count on this file. Note that if fileFid is a dir, then we don't - have to invalidate its ".." entry, since its DataVersion # should have - changed. However, interface is not good enough to tell us the - *file*'s new DataVersion, so we're stuck. Our hack: delete mark - the data as having an "unknown" version (effectively discarding the ".." - entry */ + * the link count on this file. Note that if fileFid is a dir, then we don't + * have to invalidate its ".." entry, since its DataVersion # should have + * changed. However, interface is not good enough to tell us the + * *file*'s new DataVersion, so we're stuck. Our hack: delete mark + * the data as having an "unknown" version (effectively discarding the ".." + * entry */ if (unlinkFid.Fid.Vnode) { unlinkFid.Fid.Volume = aodp->fid.Fid.Volume; unlinkFid.Cell = aodp->fid.Cell; - tvc = (struct vcache *)0; + tvc = NULL; if (!unlinkFid.Fid.Unique) { - tvc = afs_LookupVCache(&unlinkFid, areq, (afs_int32 *)0, WRITE_LOCK, - aodp, aname1); + tvc = afs_LookupVCache(&unlinkFid, areq, NULL, aodp, aname1); } - if (!tvc) /* lookup failed or wasn't called */ - tvc = afs_GetVCache(&unlinkFid, areq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); + if (!tvc) /* lookup failed or wasn't called */ + tvc = afs_GetVCache(&unlinkFid, areq, NULL, NULL); if (tvc) { #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */ #endif - ObtainWriteLock(&tvc->lock,151); + ObtainWriteLock(&tvc->lock, 151); tvc->m.LinkCount--; - tvc->states &= ~CUnique; /* For the dfs xlator */ + tvc->states &= ~CUnique; /* For the dfs xlator */ if (tvc->m.LinkCount == 0 && !osi_Active(tvc)) { /* if this was last guy (probably) discard from cache. - * We have to be careful to not get rid of the stat - * information, since otherwise operations will start - * failing even if the file was still open (or - * otherwise active), and the server no longer has the - * info. If the file still has valid links, we'll get - * a break-callback msg from the server, so it doesn't - * matter that we don't discard the status info */ - if (!AFS_NFSXLATORREQ(acred)) afs_TryToSmush(tvc, acred, 0); + * We have to be careful to not get rid of the stat + * information, since otherwise operations will start + * failing even if the file was still open (or + * otherwise active), and the server no longer has the + * info. If the file still has valid links, we'll get + * a break-callback msg from the server, so it doesn't + * matter that we don't discard the status info */ + if (!AFS_NFSXLATORREQ(acred)) + afs_TryToSmush(tvc, acred, 0); } ReleaseWriteLock(&tvc->lock); #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) afs_BozonUnlock(&tvc->pvnLock, tvc); #endif - afs_PutVCache(tvc, WRITE_LOCK); + afs_PutVCache(tvc); } } @@ -302,52 +329,56 @@ tagain: fileFid.Fid.Volume = aodp->fid.Fid.Volume; fileFid.Cell = aodp->fid.Cell; if (!fileFid.Fid.Unique) - tvc = afs_LookupVCache(&fileFid, areq, (afs_int32 *)0, WRITE_LOCK, andp, aname2); + tvc = afs_LookupVCache(&fileFid, areq, NULL, andp, aname2); else - tvc = afs_GetVCache(&fileFid, areq, (afs_int32 *)0, - (struct vcache*)0, WRITE_LOCK); + tvc = afs_GetVCache(&fileFid, areq, NULL, (struct vcache *)0); if (tvc && (vType(tvc) == VDIR)) { - ObtainWriteLock(&tvc->lock,152); - tdc1 = afs_FindDCache(tvc, 0); + ObtainWriteLock(&tvc->lock, 152); + tdc1 = afs_FindDCache(tvc, (afs_size_t) 0); if (tdc1) { + ObtainWriteLock(&tdc1->lock, 648); ZapDCE(tdc1); /* mark as unknown */ DZap(&tdc1->f.inode); + ReleaseWriteLock(&tdc1->lock); afs_PutDCache(tdc1); /* put it back */ } osi_dnlc_remove(tvc, "..", 0); ReleaseWriteLock(&tvc->lock); - afs_PutVCache(tvc, WRITE_LOCK); + afs_PutVCache(tvc); } else if (tvc) { /* True we shouldn't come here since tvc SHOULD be a dir, but we * 'syntactically' need to unless we change the 'if' above... */ - afs_PutVCache(tvc, WRITE_LOCK); + afs_PutVCache(tvc); } } code = returnCode; -done: + done: return code; } +int #ifdef AFS_OSF_ENV afs_rename(fndp, tndp) - struct nameidata *fndp, *tndp; { + struct nameidata *fndp, *tndp; +{ struct vcache *aodp = VTOAFS(fndp->ni_dvp); char *aname1 = fndp->ni_dent.d_name; struct vcache *andp = VTOAFS(tndp->ni_dvp); char *aname2 = tndp->ni_dent.d_name; struct ucred *acred = tndp->ni_cred; -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ #if defined(AFS_SGI_ENV) afs_rename(OSI_VC_ARG(aodp), aname1, andp, aname2, npnp, acred) - struct pathname *npnp; + struct pathname *npnp; #else afs_rename(OSI_VC_ARG(aodp), aname1, andp, aname2, acred) #endif OSI_VC_DECL(aodp); - struct vcache *andp; - char *aname1, *aname2; - struct AFS_UCRED *acred; { + struct vcache *andp; + char *aname1, *aname2; + struct AFS_UCRED *acred; +{ #endif register afs_int32 code; struct afs_fakestat_state ofakestate; @@ -355,16 +386,19 @@ afs_rename(OSI_VC_ARG(aodp), aname1, andp, aname2, acred) struct vrequest treq; OSI_VC_CONVERT(aodp) - code = afs_InitReq(&treq, acred); - if (code) return code; + code = afs_InitReq(&treq, acred); + if (code) + return code; afs_InitFakeStat(&ofakestate); afs_InitFakeStat(&nfakestate); code = afs_EvalFakeStat(&aodp, &ofakestate, &treq); - if (code) goto done; + if (code) + goto done; code = afs_EvalFakeStat(&andp, &nfakestate, &treq); - if (code) goto done; + if (code) + goto done; code = afsrename(aodp, aname1, andp, aname2, acred, &treq); -done: + done: afs_PutFakeStat(&ofakestate); afs_PutFakeStat(&nfakestate); #ifdef AFS_OSF_ENV @@ -374,7 +408,7 @@ done: } AFS_RELE(fndp->ni_dvp); AFS_RELE(fndp->ni_vp); -#endif /* AFS_OSF_ENV */ +#endif /* AFS_OSF_ENV */ code = afs_CheckCode(code, &treq, 25); return code; } diff --git a/src/afs/VNOPS/afs_vnop_strategy.c b/src/afs/VNOPS/afs_vnop_strategy.c index 84765b8b3..4f32e17a8 100644 --- a/src/afs/VNOPS/afs_vnop_strategy.c +++ b/src/afs/VNOPS/afs_vnop_strategy.c @@ -13,42 +13,41 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_strategy.c,v 1.1.1.9 2002/09/26 18:58:25 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_strategy.c,v 1.18 2003/08/29 22:00:04 rees Exp $"); #if !defined(AFS_HPUX_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV) -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" - -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +int +#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) afs_ustrategy(abp, credp) - struct AFS_UCRED *credp; + struct AFS_UCRED *credp; #else afs_ustrategy(abp) #endif - register struct buf *abp; { + register struct buf *abp; +{ register afs_int32 code; struct uio tuio; register struct vcache *tvc = VTOAFS(abp->b_vp); register afs_int32 len = abp->b_bcount; -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) +#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) #ifdef AFS_AIX41_ENV struct ucred *credp; #else struct AFS_UCRED *credp = u.u_cred; #endif -#endif -#if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - int async = abp->b_flags & B_ASYNC; #endif struct iovec tiovec[1]; @@ -58,7 +57,7 @@ afs_ustrategy(abp) * So that it won't change while reading it */ ObtainReadLock(&tvc->lock); - if (tvc->credp) { + if (tvc->credp) { credp = tvc->credp; crhold(credp); } else { @@ -67,19 +66,27 @@ afs_ustrategy(abp) ReleaseReadLock(&tvc->lock); osi_Assert(credp); #endif +#ifdef AFS_FBSD50_ENV + if (abp->b_iocmd == BIO_READ) { +#else if ((abp->b_flags & B_READ) == B_READ) { +#endif /* read b_bcount bytes into kernel address b_un.b_addr starting - at byte DEV_BSIZE * b_blkno. Bzero anything we can't read, - and finally call iodone(abp). File is in abp->b_vp. Credentials - are from u area?? - */ + * at byte DEV_BSIZE * b_blkno. Bzero anything we can't read, + * and finally call iodone(abp). File is in abp->b_vp. Credentials + * are from u area?? + */ tuio.afsio_iov = tiovec; tuio.afsio_iovcnt = 1; -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_XBSD_ENV) +#ifdef AFS_64BIT_CLIENT + tuio.afsio_offset = (afs_offs_t) dbtob(abp->b_blkno); +#else /* AFS_64BIT_CLIENT */ tuio.afsio_offset = (u_int) dbtob(abp->b_blkno); #if defined(AFS_SUN5_ENV) tuio._uio_offset._p._u = 0; #endif +#endif /* AFS_64BIT_CLIENT */ #else tuio.afsio_offset = DEV_BSIZE * abp->b_blkno; #endif @@ -88,14 +95,14 @@ afs_ustrategy(abp) tuio.afsio_fmode = 0; #endif tuio.afsio_resid = abp->b_bcount; -#if defined(AFS_FBSD_ENV) +#if defined(AFS_XBSD_ENV) tiovec[0].iov_base = abp->b_saveaddr; #else tiovec[0].iov_base = abp->b_un.b_addr; -#endif /* AFS_FBSD_ENV */ +#endif /* AFS_XBSD_ENV */ tiovec[0].iov_len = abp->b_bcount; /* are user's credentials valid here? probably, but this - sure seems like the wrong things to do. */ + * sure seems like the wrong things to do. */ #if defined(AFS_SUN5_ENV) code = afs_nlrdwr(VTOAFS(abp->b_vp), &tuio, UIO_READ, 0, credp); #else @@ -103,11 +110,13 @@ afs_ustrategy(abp) #endif if (code == 0) { if (tuio.afsio_resid > 0) -#if defined(AFS_FBSD_ENV) - memset(abp->b_saveaddr + abp->b_bcount - tuio.afsio_resid, 0, tuio.afsio_resid); +#if defined(AFS_XBSD_ENV) + memset(abp->b_saveaddr + abp->b_bcount - tuio.afsio_resid, 0, + tuio.afsio_resid); #else - memset(abp->b_un.b_addr + abp->b_bcount - tuio.afsio_resid, 0, tuio.afsio_resid); -#endif /* AFS_FBSD_ENV */ + memset(abp->b_un.b_addr + abp->b_bcount - tuio.afsio_resid, 0, + tuio.afsio_resid); +#endif /* AFS_XBSD_ENV */ #ifdef AFS_AIX32_ENV /* * If we read a block that is past EOF and the user was not storing @@ -117,21 +126,26 @@ afs_ustrategy(abp) if (dbtob(abp->b_blkno) + abp->b_bcount > tvc->m.Length) { if ((abp->b_flags & B_PFSTORE) == 0) { AFS_GUNLOCK(); - vm_protectp(tvc->vmh, dbtob(abp->b_blkno)/PAGESIZE, - abp->b_bcount/PAGESIZE, RDONLY); + vm_protectp(tvc->segid, dbtob(abp->b_blkno) / PAGESIZE, + abp->b_bcount / PAGESIZE, RDONLY); AFS_GLOCK(); } } #endif } - } - else { + } else { tuio.afsio_iov = tiovec; tuio.afsio_iovcnt = 1; #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#ifdef AFS_64BIT_CLIENT + tuio.afsio_offset = (afs_offs_t) dbtob(abp->b_blkno); +#else /* AFS_64BIT_CLIENT */ tuio.afsio_offset = (u_int) dbtob(abp->b_blkno); #ifdef AFS_SUN5_ENV tuio._uio_offset._p._u = 0; +#endif +#endif /* AFS_64BIT_CLIENT */ +#ifdef AFS_SUN5_ENV #ifdef AFS_SUN59_ENV tuio.uio_limit = curproc->p_fsz_ctl.rlim_cur; #else @@ -145,25 +159,27 @@ afs_ustrategy(abp) #ifdef AFS_UIOFMODE tuio.afsio_fmode = 0; #endif -#ifdef AFS_AIX32_ENV +#ifdef AFS_AIX32_ENV /* * XXX It this really right? Ideally we should always write block size multiple * and not any arbitrary size, right? XXX */ len = MIN(len, tvc->m.Length - dbtob(abp->b_blkno)); #endif -#ifdef AFS_ALPHA_ENV - len = MIN(abp->b_bcount, (VTOAFS(abp->b_vp))->m.Length - dbtob(abp->b_blkno)); -#endif /* AFS_ALPHA_ENV */ +#ifdef AFS_ALPHA_ENV + len = + MIN(abp->b_bcount, + (VTOAFS(abp->b_vp))->m.Length - dbtob(abp->b_blkno)); +#endif /* AFS_ALPHA_ENV */ tuio.afsio_resid = len; -#if defined(AFS_FBSD_ENV) +#if defined(AFS_XBSD_ENV) tiovec[0].iov_base = abp->b_saveaddr; #else tiovec[0].iov_base = abp->b_un.b_addr; -#endif /* AFS_FBSD_ENV */ +#endif /* AFS_XBSD_ENV */ tiovec[0].iov_len = len; /* are user's credentials valid here? probably, but this - sure seems like the wrong things to do. */ + * sure seems like the wrong things to do. */ #if defined(AFS_SUN5_ENV) code = afs_nlrdwr(VTOAFS(abp->b_vp), &tuio, UIO_WRITE, 0, credp); #else @@ -171,7 +187,7 @@ afs_ustrategy(abp) #endif } #if !defined(AFS_AIX32_ENV) && !defined(AFS_SUN5_ENV) -#if defined(AFS_DUX40_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_DUX40_ENV) || (defined (AFS_XBSD_ENV) && !defined (AFS_FBSD50_ENV)) if (code) { abp->b_error = code; abp->b_flags |= B_ERROR; @@ -182,21 +198,21 @@ afs_ustrategy(abp) /* prevent ubc from retrying writes */ AFS_GUNLOCK(); ubc_invalidate(AFSTOV(tvc)->v_object, - (vm_offset_t)dbtob(abp->b_blkno), - PAGE_SIZE, B_INVAL); + (vm_offset_t) dbtob(abp->b_blkno), PAGE_SIZE, B_INVAL); AFS_GLOCK(); } #endif -#else /* AFS_DUX40_ENV || AFS_FBSD_ENV */ +#elif defined(AFS_FBSD50_ENV) + biodone(&abp->b_io); +#else /* AFS_DUX40_ENV */ iodone(abp); -#endif /* AFS_DUX40_ENV || AFS_FBSD_ENV */ +#endif /* AFS_DUX40_ENV */ #endif #ifdef AFS_AIX32_ENV crfree(credp); #endif afs_Trace3(afs_iclSetp, CM_TRACE_STRATEGYDONE, ICL_TYPE_POINTER, tvc, - ICL_TYPE_INT32, code, - ICL_TYPE_LONG, tuio.afsio_resid); + ICL_TYPE_INT32, code, ICL_TYPE_LONG, tuio.afsio_resid); return code; } diff --git a/src/afs/VNOPS/afs_vnop_symlink.c b/src/afs/VNOPS/afs_vnop_symlink.c index 1fd305117..4078925b5 100644 --- a/src/afs/VNOPS/afs_vnop_symlink.c +++ b/src/afs/VNOPS/afs_vnop_symlink.c @@ -19,16 +19,17 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.1.1.7 2002/08/02 04:29:04 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.19 2003/08/26 15:09:28 rees Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" extern afs_rwlock_t afs_xvcache; extern afs_rwlock_t afs_xcbhash; @@ -40,46 +41,49 @@ extern afs_rwlock_t afs_xcbhash; /* don't set CDirty in here because RPC is called synchronously */ +int afs_symlink #ifdef AFS_OSF_ENV (ndp, attrs, atargetName) - struct nameidata *ndp; - struct vattr *attrs; - register char *atargetName; { + struct nameidata *ndp; + struct vattr *attrs; + register char *atargetName; +{ register struct vcache *adp = VTOAFS(ndp->ni_dvp); char *aname = ndp->ni_dent.d_name; struct ucred *acred = ndp->ni_cred; -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ (OSI_VC_ARG(adp), aname, attrs, atargetName, acred) - OSI_VC_DECL(adp); - char *atargetName; - char *aname; - struct vattr *attrs; - struct AFS_UCRED *acred; { + OSI_VC_DECL(adp); + char *atargetName; + char *aname; + struct vattr *attrs; + struct AFS_UCRED *acred; +{ #endif - afs_uint32 now; + afs_uint32 now = 0; struct vrequest treq; afs_int32 code; struct conn *tc; struct VenusFid newFid; struct dcache *tdc; - afs_int32 offset, len, alen; - struct server *hostp=0; + afs_size_t offset, len; + afs_int32 alen; + struct server *hostp = 0; struct vcache *tvc; struct AFSStoreStatus InStatus; struct AFSFetchStatus OutFidStatus, OutDirStatus; struct AFSCallBack CallBack; struct AFSVolSync tsync; - struct volume* volp=0; + struct volume *volp = 0; struct afs_fakestat_state fakestate; - XSTATS_DECLS - OSI_VC_CONVERT(adp) - + XSTATS_DECLS OSI_VC_CONVERT(adp) + AFS_STATCNT(afs_symlink); afs_Trace2(afs_iclSetp, CM_TRACE_SYMLINK, ICL_TYPE_POINTER, adp, - ICL_TYPE_STRING, aname); + ICL_TYPE_STRING, aname); - if (code = afs_InitReq(&treq, acred)) + if ((code = afs_InitReq(&treq, acred))) goto done2; afs_InitFakeStat(&fakestate); @@ -89,42 +93,45 @@ afs_symlink if (strlen(aname) > AFSNAMEMAX || strlen(atargetName) > AFSPATHMAX) { code = ENAMETOOLONG; - goto done2; + goto done; } if (afs_IsDynroot(adp)) { code = afs_DynrootVOPSymlink(adp, acred, aname, atargetName); - goto done2; + goto done; } code = afs_VerifyVCache(adp, &treq); - if (code) { - code = afs_CheckCode(code, &treq, 30); - goto done2; + if (code) { + code = afs_CheckCode(code, &treq, 30); + goto done; } /** If the volume is read-only, return error without making an RPC to the * fileserver */ - if ( adp->states & CRO ) { - code = EROFS; - goto done2; + if (adp->states & CRO) { + code = EROFS; + goto done; } InStatus.Mask = AFS_SETMODTIME | AFS_SETMODE; InStatus.ClientModTime = osi_Time(); - alen = strlen(atargetName); /* we want it to include the null */ + alen = strlen(atargetName); /* we want it to include the null */ if (*atargetName == '#' || *atargetName == '%') { InStatus.UnixModeBits = 0644; /* mt pt: null from "." at end */ - if (alen == 1) alen++; /* Empty string */ + if (alen == 1) + alen++; /* Empty string */ } else { InStatus.UnixModeBits = 0755; - alen++; /* add in the null */ + alen++; /* add in the null */ } - tdc = afs_GetDCache(adp, 0, &treq, &offset, &len, 1); - volp = afs_FindVolume(&adp->fid, READ_LOCK); /*parent is also in same vol*/ - ObtainWriteLock(&adp->lock,156); - ObtainSharedLock(&afs_xvcache,17); /* prevent others from creating this entry */ + tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1); + volp = afs_FindVolume(&adp->fid, READ_LOCK); /*parent is also in same vol */ + ObtainWriteLock(&adp->lock, 156); + if (tdc) + ObtainWriteLock(&tdc->lock, 636); + ObtainSharedLock(&afs_xvcache, 17); /* prevent others from creating this entry */ /* XXX Pay attention to afs_xvcache around the whole thing!! XXX */ do { tc = afs_Conn(&adp->fid, &treq, SHARED_LOCK); @@ -133,57 +140,58 @@ afs_symlink XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_SYMLINK); if (adp->states & CForeign) { now = osi_Time(); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_DFSSymlink(tc->id, (struct AFSFid *) &adp->fid.Fid, aname, - atargetName, &InStatus, (struct AFSFid *) &newFid.Fid, - &OutFidStatus, &OutDirStatus, &CallBack, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); + code = + RXAFS_DFSSymlink(tc->id, (struct AFSFid *)&adp->fid.Fid, + aname, atargetName, &InStatus, + (struct AFSFid *)&newFid.Fid, + &OutFidStatus, &OutDirStatus, &CallBack, + &tsync); + RX_AFS_GLOCK(); } else { -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_Symlink(tc->id, (struct AFSFid *) &adp->fid.Fid, aname, - atargetName, &InStatus, (struct AFSFid *) &newFid.Fid, - &OutFidStatus, &OutDirStatus, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); + code = + RXAFS_Symlink(tc->id, (struct AFSFid *)&adp->fid.Fid, + aname, atargetName, &InStatus, + (struct AFSFid *)&newFid.Fid, &OutFidStatus, + &OutDirStatus, &tsync); + RX_AFS_GLOCK(); } - XSTATS_END_TIME; - } - else code = -1; - } while - (afs_Analyze(tc, code, &adp->fid, &treq, - AFS_STATS_FS_RPCIDX_SYMLINK, SHARED_LOCK, (struct cell *)0)); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tc, code, &adp->fid, &treq, AFS_STATS_FS_RPCIDX_SYMLINK, + SHARED_LOCK, NULL)); - UpgradeSToWLock(&afs_xvcache,40); + UpgradeSToWLock(&afs_xvcache, 40); if (code) { if (code < 0) { - ObtainWriteLock(&afs_xcbhash, 499); - afs_DequeueCallback(adp); - adp->states &= ~CStatd; - ReleaseWriteLock(&afs_xcbhash); - osi_dnlc_purgedp(adp); + ObtainWriteLock(&afs_xcbhash, 499); + afs_DequeueCallback(adp); + adp->states &= ~CStatd; + ReleaseWriteLock(&afs_xcbhash); + osi_dnlc_purgedp(adp); } ReleaseWriteLock(&adp->lock); ReleaseWriteLock(&afs_xvcache); - if (tdc) afs_PutDCache(tdc); + if (tdc) { + ReleaseWriteLock(&tdc->lock); + afs_PutDCache(tdc); + } goto done; } /* otherwise, we should see if we can make the change to the dir locally */ if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) { /* we can do it locally */ code = afs_dir_Create(&tdc->f.inode, aname, &newFid.Fid); - if (code) { + if (code) { ZapDCE(tdc); /* surprise error -- use invalid value */ DZap(&tdc->f.inode); } } if (tdc) { + ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); } newFid.Cell = adp->fid.Cell; @@ -193,10 +201,10 @@ afs_symlink /* now we're done with parent dir, create the link's entry. Note that * no one can get a pointer to the new cache entry until we release * the xvcache lock. */ - tvc = afs_NewVCache(&newFid, hostp, 1, WRITE_LOCK); - ObtainWriteLock(&tvc->lock,157); + tvc = afs_NewVCache(&newFid, hostp); + ObtainWriteLock(&tvc->lock, 157); ObtainWriteLock(&afs_xcbhash, 500); - tvc->states |= CStatd; /* have valid info */ + tvc->states |= CStatd; /* have valid info */ tvc->states &= ~CBulkFetching; if (adp->states & CForeign) { @@ -204,95 +212,105 @@ afs_symlink /* We don't have to worry about losing the callback since we're doing it * under the afs_xvcache lock actually, afs_NewVCache may drop the * afs_xvcache lock, if it calls afs_FlushVCache */ - tvc->cbExpires = CallBack.ExpirationTime + now; - afs_QueueCallback(tvc, CBHash(CallBack.ExpirationTime), volp); + tvc->cbExpires = CallBack.ExpirationTime + now; + afs_QueueCallback(tvc, CBHash(CallBack.ExpirationTime), volp); } else { tvc->cbExpires = 0x7fffffff; /* never expires, they can't change */ - /* since it never expires, we don't have to queue the callback */ + /* since it never expires, we don't have to queue the callback */ } ReleaseWriteLock(&afs_xcbhash); afs_ProcessFS(tvc, &OutFidStatus, &treq); if (!tvc->linkData) { - tvc->linkData = (char *) afs_osi_Alloc(alen); - strncpy(tvc->linkData, atargetName, alen-1); - tvc->linkData[alen-1] = 0; + tvc->linkData = (char *)afs_osi_Alloc(alen); + strncpy(tvc->linkData, atargetName, alen - 1); + tvc->linkData[alen - 1] = 0; } ReleaseWriteLock(&tvc->lock); ReleaseWriteLock(&afs_xvcache); - afs_PutVCache(tvc, WRITE_LOCK); + afs_PutVCache(tvc); code = 0; -done: + done: afs_PutFakeStat(&fakestate); - if ( volp ) + if (volp) afs_PutVolume(volp, READ_LOCK); code = afs_CheckCode(code, &treq, 31); -done2: + done2: #ifdef AFS_OSF_ENV AFS_RELE(ndp->ni_dvp); -#endif /* AFS_OSF_ENV */ +#endif /* AFS_OSF_ENV */ return code; } -afs_MemHandleLink(avc, areq) - register struct vcache *avc; - struct vrequest *areq; - { - register struct dcache *tdc; - register char *tp, *rbuf; - afs_int32 offset, len, alen; - register afs_int32 code; +int +afs_MemHandleLink(register struct vcache *avc, struct vrequest *areq) +{ + register struct dcache *tdc; + register char *tp, *rbuf; + afs_size_t offset, len; + afs_int32 tlen, alen; + register afs_int32 code; - AFS_STATCNT(afs_MemHandleLink); - /* two different formats, one for links protected 644, have a "." at - the end of the file name, which we turn into a null. Others, - protected 755, we add a null to the end of */ - if (!avc->linkData) { - void *addr; - tdc = afs_GetDCache(avc, 0, areq, &offset, &len, 0); - if (!tdc) { - return EIO; - } - /* otherwise we have the data loaded, go for it */ - if (len > 1024) { - afs_PutDCache(tdc); - return EFAULT; - } - if (avc->m.Mode & 0111) alen = len+1; /* regular link */ - else alen = len; /* mt point */ - rbuf = (char *) osi_AllocLargeSpace(AFS_LRALLOCSIZ); - addr = afs_MemCacheOpen(tdc->f.inode); - code = afs_MemReadBlk(addr, 0, rbuf, len); - rbuf[alen-1] = '\0'; - alen = strlen(rbuf) + 1; - tp = afs_osi_Alloc(alen); /* make room for terminating null */ - memcpy(tp, rbuf, alen); - osi_FreeLargeSpace(rbuf); - afs_PutDCache(tdc); - if (code != len) { - afs_osi_Free(tp, alen); - return EIO; - } - avc->linkData = tp; - } - return 0; - } + AFS_STATCNT(afs_MemHandleLink); + /* two different formats, one for links protected 644, have a "." at + * the end of the file name, which we turn into a null. Others, + * protected 755, we add a null to the end of */ + if (!avc->linkData) { + void *addr; + tdc = afs_GetDCache(avc, (afs_size_t) 0, areq, &offset, &len, 0); + if (!tdc) { + return EIO; + } + /* otherwise we have the data loaded, go for it */ + if (len > 1024) { + afs_PutDCache(tdc); + return EFAULT; + } + if (avc->m.Mode & 0111) + alen = len + 1; /* regular link */ + else + alen = len; /* mt point */ + rbuf = (char *)osi_AllocLargeSpace(AFS_LRALLOCSIZ); + ObtainReadLock(&tdc->lock); + addr = afs_MemCacheOpen(tdc->f.inode); + tlen = len; + code = afs_MemReadBlk(addr, 0, rbuf, tlen); + afs_MemCacheClose(addr); + ReleaseReadLock(&tdc->lock); + afs_PutDCache(tdc); + rbuf[alen - 1] = 0; + alen = strlen(rbuf) + 1; + tp = afs_osi_Alloc(alen); /* make room for terminating null */ + memcpy(tp, rbuf, alen); + osi_FreeLargeSpace(rbuf); + if (code != len) { + afs_osi_Free(tp, alen); + return EIO; + } + avc->linkData = tp; + } + return 0; +} -afs_UFSHandleLink(avc, areq) - register struct vcache *avc; - struct vrequest *areq; { +int +afs_UFSHandleLink(register struct vcache *avc, struct vrequest *areq) +{ register struct dcache *tdc; register char *tp, *rbuf; - char *tfile; - afs_int32 offset, len, alen; + void *tfile; + afs_size_t offset, len; + afs_int32 tlen, alen; register afs_int32 code; - /* two different formats, one for links protected 644, have a "." at the end - of the file name, which we turn into a null. Others, protected 755, - we add a null to the end of */ - AFS_STATCNT(afs_UFSHandleLink); + /* two different formats, one for links protected 644, have a "." at the + * end of the file name, which we turn into a null. Others, protected + * 755, we add a null to the end of */ + AFS_STATCNT(afs_UFSHandleLink); if (!avc->linkData) { - tdc = afs_GetDCache(avc, 0, areq, &offset, &len, 0); + tdc = afs_GetDCache(avc, (afs_size_t) 0, areq, &offset, &len, 0); + afs_Trace3(afs_iclSetp, CM_TRACE_UFSLINK, ICL_TYPE_POINTER, avc, + ICL_TYPE_POINTER, tdc, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length)); if (!tdc) { return EIO; } @@ -301,19 +319,24 @@ afs_UFSHandleLink(avc, areq) afs_PutDCache(tdc); return EFAULT; } - tfile = osi_UFSOpen (tdc->f.inode); - if (avc->m.Mode & 0111) alen = len+1; /* regular link */ - else alen = len; /* mt point */ - rbuf = (char *) osi_AllocLargeSpace(AFS_LRALLOCSIZ); - code = afs_osi_Read(tfile, -1, rbuf, len); - rbuf[alen-1] = '\0'; + if (avc->m.Mode & 0111) + alen = len + 1; /* regular link */ + else + alen = len; /* mt point */ + rbuf = (char *)osi_AllocLargeSpace(AFS_LRALLOCSIZ); + tlen = len; + ObtainReadLock(&tdc->lock); + tfile = osi_UFSOpen(tdc->f.inode); + code = afs_osi_Read(tfile, -1, rbuf, tlen); osi_UFSClose(tfile); + ReleaseReadLock(&tdc->lock); afs_PutDCache(tdc); + rbuf[alen - 1] = '\0'; alen = strlen(rbuf) + 1; tp = afs_osi_Alloc(alen); /* make room for terminating null */ memcpy(tp, rbuf, alen); osi_FreeLargeSpace(rbuf); - if (code != len) { + if (code != tlen) { afs_osi_Free(tp, alen); return EIO; } @@ -322,10 +345,12 @@ afs_UFSHandleLink(avc, areq) return 0; } +int afs_readlink(OSI_VC_ARG(avc), auio, acred) - OSI_VC_DECL(avc); - struct uio *auio; - struct AFS_UCRED *acred; { + OSI_VC_DECL(avc); + struct uio *auio; + struct AFS_UCRED *acred; +{ register afs_int32 code; struct vrequest treq; register char *tp; @@ -334,28 +359,32 @@ afs_readlink(OSI_VC_ARG(avc), auio, acred) AFS_STATCNT(afs_readlink); afs_Trace1(afs_iclSetp, CM_TRACE_READLINK, ICL_TYPE_POINTER, avc); - if (code = afs_InitReq(&treq, acred)) return code; + if ((code = afs_InitReq(&treq, acred))) + return code; afs_InitFakeStat(&fakestat); code = afs_EvalFakeStat(&avc, &fakestat, &treq); - if (code) goto done; + if (code) + goto done; code = afs_VerifyVCache(avc, &treq); - if (code) goto done; + if (code) + goto done; if (vType(avc) != VLNK) { code = EINVAL; goto done; } - ObtainWriteLock(&avc->lock,158); + ObtainWriteLock(&avc->lock, 158); code = afs_HandleLink(avc, &treq); /* finally uiomove it to user-land */ if (code == 0) { tp = avc->linkData; - if (tp) AFS_UIOMOVE(tp, strlen(tp), UIO_READ, auio, code); + if (tp) + AFS_UIOMOVE(tp, strlen(tp), UIO_READ, auio, code); else { code = EIO; } } ReleaseWriteLock(&avc->lock); -done: + done: afs_PutFakeStat(&fakestat); code = afs_CheckCode(code, &treq, 32); return code; diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c index 933cc4dcf..57b702f76 100644 --- a/src/afs/VNOPS/afs_vnop_write.c +++ b/src/afs/VNOPS/afs_vnop_write.c @@ -18,16 +18,17 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.1.1.12 2002/09/26 18:58:25 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.35 2003/08/29 22:00:04 rees Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" extern unsigned char *afs_indexFlags; @@ -37,12 +38,12 @@ extern unsigned char *afs_indexFlags; * afs_FlushActiveVCaches routine (when CCORE is on). * avc->lock must be write-locked. */ -afs_StoreOnLastReference(avc, treq) -register struct vcache *avc; -register struct vrequest *treq; +int +afs_StoreOnLastReference(register struct vcache *avc, + register struct vrequest *treq) { int code = 0; - + AFS_STATCNT(afs_StoreOnLastReference); /* if CCore flag is set, we clear it and do the extra decrement * ourselves now. If we're called by the CCore clearer, the CCore @@ -59,9 +60,9 @@ register struct vrequest *treq; * top level code. */ avc->opens--; avc->execsOrWriters--; - AFS_RELE(AFSTOV(avc)); /* VN_HOLD at set CCore(afs_FakeClose)*/ + AFS_RELE(AFSTOV(avc)); /* VN_HOLD at set CCore(afs_FakeClose) */ crfree((struct AFS_UCRED *)avc->linkData); /* "crheld" in afs_FakeClose */ - avc->linkData = (char *)0; + avc->linkData = NULL; } /* Now, send the file back. Used to require 0 writers left, but now do * it on every close for write, since two closes in a row are harmless @@ -70,7 +71,7 @@ register struct vrequest *treq; * inadvertently, since with old system, writes to the server would never * happen again. */ - code = afs_StoreAllSegments(avc, treq, AFS_LASTSTORE/*!sync-to-disk*/); + code = afs_StoreAllSegments(avc, treq, AFS_LASTSTORE /*!sync-to-disk */ ); /* * We have to do these after the above store in done: in some systems like * aix they'll need to flush all the vm dirty pages to the disk via the @@ -88,58 +89,60 @@ register struct vrequest *treq; -afs_MemWrite(avc, auio, aio, acred, noLock) - register struct vcache *avc; - struct uio *auio; - int aio, noLock; - struct AFS_UCRED *acred; { - afs_int32 totalLength; - afs_int32 transferLength; - afs_int32 filePos; +int +afs_MemWrite(register struct vcache *avc, struct uio *auio, int aio, + struct AFS_UCRED *acred, int noLock) +{ + afs_size_t totalLength; + afs_size_t transferLength; + afs_size_t filePos; + afs_size_t offset, len; + afs_int32 tlen, trimlen; afs_int32 startDate; afs_int32 max; register struct dcache *tdc; #ifdef _HIGHC_ volatile #endif - afs_int32 offset, len, error; + afs_int32 error; struct uio tuio; - struct iovec *tvec; /* again, should have define */ - char *tfile; + struct iovec *tvec; /* again, should have define */ register afs_int32 code; struct vrequest treq; AFS_STATCNT(afs_MemWrite); if (avc->vc_error) - return avc->vc_error; + return avc->vc_error; startDate = osi_Time(); - if (code = afs_InitReq(&treq, acred)) return code; + if ((code = afs_InitReq(&treq, acred))) + return code; /* otherwise we read */ totalLength = auio->afsio_resid; filePos = auio->afsio_offset; error = 0; transferLength = 0; - afs_Trace4(afs_iclSetp, CM_TRACE_WRITE, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, filePos, ICL_TYPE_INT32, totalLength, - ICL_TYPE_INT32, avc->m.Length); + afs_Trace4(afs_iclSetp, CM_TRACE_WRITE, ICL_TYPE_POINTER, avc, + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(filePos), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(totalLength), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length)); if (!noLock) { afs_MaybeWakeupTruncateDaemon(); - ObtainWriteLock(&avc->lock,126); + ObtainWriteLock(&avc->lock, 126); } #if defined(AFS_SGI_ENV) { - off_t diff; - /* - * afs_xwrite handles setting m.Length - * and handles APPEND mode. - * Since we are called via strategy, we need to trim the write to - * the actual size of the file - */ - osi_Assert(filePos <= avc->m.Length); - diff = avc->m.Length - filePos; - auio->afsio_resid = MIN(totalLength, diff); - totalLength = auio->afsio_resid; + off_t diff; + /* + * afs_xwrite handles setting m.Length + * and handles APPEND mode. + * Since we are called via strategy, we need to trim the write to + * the actual size of the file + */ + osi_Assert(filePos <= avc->m.Length); + diff = avc->m.Length - filePos; + auio->afsio_resid = MIN(totalLength, diff); + totalLength = auio->afsio_resid; } #else if (aio & IO_APPEND) { @@ -154,11 +157,12 @@ afs_MemWrite(avc, auio, aio, acred, noLock) * Note that we use startDate rather than calling osi_Time() here. * This is to avoid counting lock-waiting time in file date (for ranlib). */ - avc->m.Date = startDate; + avc->m.Date = startDate; #if defined(AFS_HPUX_ENV) || defined(AFS_GFS_ENV) #if defined(AFS_HPUX101_ENV) - if ((totalLength + filePos) >> 9 > (p_rlimit(u.u_procp))[RLIMIT_FSIZE].rlim_cur) { + if ((totalLength + filePos) >> 9 > + (p_rlimit(u.u_procp))[RLIMIT_FSIZE].rlim_cur) { #else #ifdef AFS_HPUX_ENV if ((totalLength + filePos) >> 9 > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) { @@ -177,13 +181,14 @@ afs_MemWrite(avc, auio, aio, acred, noLock) * high-level write op. */ if (avc->execsOrWriters <= 0) { - printf("WARNING: afs_ufswr vp=%x, exOrW=%d\n", avc, avc->execsOrWriters); + printf("WARNING: afs_ufswr vp=%x, exOrW=%d\n", avc, + avc->execsOrWriters); } #else afs_FakeOpen(avc); #endif avc->states |= CDirty; - tvec = (struct iovec *) osi_AllocSmallSpace(sizeof(struct iovec)); + tvec = (struct iovec *)osi_AllocSmallSpace(sizeof(struct iovec)); while (totalLength > 0) { /* Read the cached info. If we call GetDCache while the cache * truncate daemon is running we risk overflowing the disk cache. @@ -193,96 +198,113 @@ afs_MemWrite(avc, auio, aio, acred, noLock) */ if (noLock) { tdc = afs_FindDCache(avc, filePos); - if (tdc) { - offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk); - len = tdc->f.chunkBytes - offset; - } - } else if (afs_blocksUsed > (CM_WAITFORDRAINPCT*afs_cacheBlocks)/100) { + if (tdc) + ObtainWriteLock(&tdc->lock, 653); + } else if (afs_blocksUsed > + (CM_WAITFORDRAINPCT * afs_cacheBlocks) / 100) { tdc = afs_FindDCache(avc, filePos); if (tdc) { - if (!hsame(tdc->f.versionNo, avc->m.DataVersion) || - (tdc->flags & DFFetching)) { + ObtainWriteLock(&tdc->lock, 654); + if (!hsame(tdc->f.versionNo, avc->m.DataVersion) + || (tdc->dflags & DFFetching)) { + ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); tdc = NULL; - } else { - offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk); - len = tdc->f.chunkBytes - offset; } } if (!tdc) { afs_MaybeWakeupTruncateDaemon(); while (afs_blocksUsed > - (CM_WAITFORDRAINPCT*afs_cacheBlocks)/100) { + (CM_WAITFORDRAINPCT * afs_cacheBlocks) / 100) { ReleaseWriteLock(&avc->lock); if (afs_blocksUsed - afs_blocksDiscarded > - (CM_WAITFORDRAINPCT*afs_cacheBlocks)/100) { + (CM_WAITFORDRAINPCT * afs_cacheBlocks) / 100) { afs_WaitForCacheDrain = 1; afs_osi_Sleep(&afs_WaitForCacheDrain); } afs_MaybeFreeDiscardedDCache(); afs_MaybeWakeupTruncateDaemon(); - ObtainWriteLock(&avc->lock,506); + ObtainWriteLock(&avc->lock, 506); } avc->states |= CDirty; tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 4); + if (tdc) + ObtainWriteLock(&tdc->lock, 655); } } else { tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 4); + if (tdc) + ObtainWriteLock(&tdc->lock, 656); } if (!tdc) { error = EIO; break; } if (!(afs_indexFlags[tdc->index] & IFDataMod)) { - afs_stats_cmperf.cacheCurrDirtyChunks++; - afs_indexFlags[tdc->index] |= IFDataMod; /* so it doesn't disappear */ + afs_stats_cmperf.cacheCurrDirtyChunks++; + afs_indexFlags[tdc->index] |= IFDataMod; /* so it doesn't disappear */ } if (!(tdc->f.states & DWriting)) { /* don't mark entry as mod if we don't have to */ tdc->f.states |= DWriting; - tdc->flags |= DFEntryMod; + tdc->dflags |= DFEntryMod; } len = totalLength; /* write this amount by default */ + offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk); max = AFS_CHUNKTOSIZE(tdc->f.chunk); /* max size of this chunk */ - if (max <= len + offset) { /*if we'd go past the end of this chunk */ + if (max <= len + offset) { /*if we'd go past the end of this chunk */ /* it won't all fit in this chunk, so write as much - as will fit */ + * as will fit */ len = max - offset; } /* mung uio structure to be right for this transfer */ afsio_copy(auio, &tuio, tvec); - afsio_trim(&tuio, len); + trimlen = len; + afsio_trim(&tuio, trimlen); tuio.afsio_offset = offset; code = afs_MemWriteUIO(tdc->f.inode, &tuio); if (code) { - void *mep; /* XXX in prototype world is struct memCacheEntry * */ + void *mep; /* XXX in prototype world is struct memCacheEntry * */ error = code; - ZapDCE(tdc); /* bad data */ + ZapDCE(tdc); /* bad data */ mep = afs_MemCacheOpen(tdc->f.inode); afs_MemCacheTruncate(mep, 0); afs_MemCacheClose(mep); afs_stats_cmperf.cacheCurrDirtyChunks--; - afs_indexFlags[tdc->index] &= ~IFDataMod; /* so it does disappear */ + afs_indexFlags[tdc->index] &= ~IFDataMod; /* so it does disappear */ + ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); break; } /* otherwise we've written some, fixup length, etc and continue with next seg */ - len = len - tuio.afsio_resid; /* compute amount really transferred */ - afsio_skip(auio, len); /* advance auio over data written */ + len = len - tuio.afsio_resid; /* compute amount really transferred */ + tlen = len; + afsio_skip(auio, tlen); /* advance auio over data written */ /* compute new file size */ - if (offset + len > tdc->f.chunkBytes) - afs_AdjustSize(tdc, offset+len); + if (offset + len > tdc->f.chunkBytes) { + afs_int32 tlength = offset + len; + afs_AdjustSize(tdc, tlength); + if (tdc->validPos < filePos + len) + tdc->validPos = filePos + len; + } totalLength -= len; transferLength += len; filePos += len; #if defined(AFS_SGI_ENV) - /* afs_xwrite handles setting m.Length */ - osi_Assert(filePos <= avc->m.Length); + /* afs_xwrite handles setting m.Length */ + osi_Assert(filePos <= avc->m.Length); #else - if (filePos > avc->m.Length) + if (filePos > avc->m.Length) { + afs_Trace4(afs_iclSetp, CM_TRACE_SETLENGTH, ICL_TYPE_STRING, + __FILE__, ICL_TYPE_LONG, __LINE__, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(filePos)); avc->m.Length = filePos; + } #endif + ReleaseWriteLock(&tdc->lock); + afs_PutDCache(tdc); #if !defined(AFS_VM_RDWR_ENV) /* * If write is implemented via VM, afs_DoPartialWrite() is called from @@ -292,12 +314,10 @@ afs_MemWrite(avc, auio, aio, acred, noLock) code = afs_DoPartialWrite(avc, &treq); if (code) { error = code; - afs_PutDCache(tdc); break; } } #endif - afs_PutDCache(tdc); } #ifndef AFS_VM_RDWR_ENV afs_FakeClose(avc, acred); @@ -309,8 +329,8 @@ afs_MemWrite(avc, auio, aio, acred, noLock) osi_FreeSmallSpace(tvec); #ifdef AFS_DEC_ENV /* next, on GFS systems, we update g_size so that lseek's relative to EOF will - work. GFS is truly a poorly-designed interface! */ - afs_gfshack((struct gnode *) avc); + * work. GFS is truly a poorly-designed interface! */ + afs_gfshack((struct gnode *)avc); #endif error = afs_CheckCode(error, &treq, 6); return error; @@ -318,65 +338,68 @@ afs_MemWrite(avc, auio, aio, acred, noLock) /* called on writes */ -afs_UFSWrite(avc, auio, aio, acred, noLock) - register struct vcache *avc; - struct uio *auio; - int aio, noLock; - struct AFS_UCRED *acred; { - afs_int32 totalLength; - afs_int32 transferLength; - afs_int32 filePos; +int +afs_UFSWrite(register struct vcache *avc, struct uio *auio, int aio, + struct AFS_UCRED *acred, int noLock) +{ + afs_size_t totalLength; + afs_size_t transferLength; + afs_size_t filePos; + afs_size_t offset, len; + afs_int32 tlen; + afs_int32 trimlen; afs_int32 startDate; afs_int32 max; register struct dcache *tdc; #ifdef _HIGHC_ volatile #endif - afs_int32 offset, len, error; + afs_int32 error; struct uio tuio; - struct iovec *tvec; /* again, should have define */ + struct iovec *tvec; /* again, should have define */ struct osi_file *tfile; register afs_int32 code; - struct vnode *vp; struct vrequest treq; AFS_STATCNT(afs_UFSWrite); if (avc->vc_error) - return avc->vc_error; + return avc->vc_error; startDate = osi_Time(); - if (code = afs_InitReq(&treq, acred)) return code; + if ((code = afs_InitReq(&treq, acred))) + return code; /* otherwise we read */ totalLength = auio->afsio_resid; filePos = auio->afsio_offset; error = 0; transferLength = 0; - afs_Trace4(afs_iclSetp, CM_TRACE_WRITE, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, filePos, ICL_TYPE_INT32, totalLength, - ICL_TYPE_INT32, avc->m.Length); + afs_Trace4(afs_iclSetp, CM_TRACE_WRITE, ICL_TYPE_POINTER, avc, + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(filePos), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(totalLength), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length)); if (!noLock) { afs_MaybeWakeupTruncateDaemon(); - ObtainWriteLock(&avc->lock,556); + ObtainWriteLock(&avc->lock, 556); } #if defined(AFS_SGI_ENV) { - off_t diff; - /* - * afs_xwrite handles setting m.Length - * and handles APPEND mode. - * Since we are called via strategy, we need to trim the write to - * the actual size of the file - */ - osi_Assert(filePos <= avc->m.Length); - diff = avc->m.Length - filePos; - auio->afsio_resid = MIN(totalLength, diff); - totalLength = auio->afsio_resid; + off_t diff; + /* + * afs_xwrite handles setting m.Length + * and handles APPEND mode. + * Since we are called via strategy, we need to trim the write to + * the actual size of the file + */ + osi_Assert(filePos <= avc->m.Length); + diff = avc->m.Length - filePos; + auio->afsio_resid = MIN(totalLength, diff); + totalLength = auio->afsio_resid; } #else if (aio & IO_APPEND) { /* append mode, start it at the right spot */ #if defined(AFS_SUN56_ENV) - auio->uio_loffset = 0; + auio->uio_loffset = 0; #endif filePos = auio->afsio_offset = avc->m.Length; } @@ -385,11 +408,12 @@ afs_UFSWrite(avc, auio, aio, acred, noLock) * Note that we use startDate rather than calling osi_Time() here. * This is to avoid counting lock-waiting time in file date (for ranlib). */ - avc->m.Date = startDate; + avc->m.Date = startDate; #if defined(AFS_HPUX_ENV) || defined(AFS_GFS_ENV) #if defined(AFS_HPUX101_ENV) - if ((totalLength + filePos) >> 9 > p_rlimit(u.u_procp)[RLIMIT_FSIZE].rlim_cur) { + if ((totalLength + filePos) >> 9 > + p_rlimit(u.u_procp)[RLIMIT_FSIZE].rlim_cur) { #else #ifdef AFS_HPUX_ENV if ((totalLength + filePos) >> 9 > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) { @@ -408,186 +432,204 @@ afs_UFSWrite(avc, auio, aio, acred, noLock) * high-level write op. */ if (avc->execsOrWriters <= 0) { - printf("WARNING: afs_ufswr vp=%x, exOrW=%d\n", avc, avc->execsOrWriters); + printf("WARNING: afs_ufswr vcp=%x, exOrW=%d\n", avc, + avc->execsOrWriters); } #else afs_FakeOpen(avc); #endif avc->states |= CDirty; - tvec = (struct iovec *) osi_AllocSmallSpace(sizeof(struct iovec)); + tvec = (struct iovec *)osi_AllocSmallSpace(sizeof(struct iovec)); while (totalLength > 0) { + /* + * The following line is necessary because afs_GetDCache with + * flag == 4 expects the length field to be filled. It decides + * from this whether it's necessary to fetch data into the chunk + * before writing or not (when the whole chunk is overwritten!). + */ + len = totalLength; /* write this amount by default */ /* read the cached info */ if (noLock) { tdc = afs_FindDCache(avc, filePos); - if (tdc) { - offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk); - len = tdc->f.chunkBytes - offset; - } - } else if (afs_blocksUsed > (CM_WAITFORDRAINPCT*afs_cacheBlocks)/100) { + if (tdc) + ObtainWriteLock(&tdc->lock, 657); + } else if (afs_blocksUsed > + (CM_WAITFORDRAINPCT * afs_cacheBlocks) / 100) { tdc = afs_FindDCache(avc, filePos); if (tdc) { - if (!hsame(tdc->f.versionNo, avc->m.DataVersion) || - (tdc->flags & DFFetching)) { + ObtainWriteLock(&tdc->lock, 658); + if (!hsame(tdc->f.versionNo, avc->m.DataVersion) + || (tdc->dflags & DFFetching)) { + ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); tdc = NULL; - } else { - offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk); - len = tdc->f.chunkBytes - offset; } } if (!tdc) { afs_MaybeWakeupTruncateDaemon(); while (afs_blocksUsed > - (CM_WAITFORDRAINPCT*afs_cacheBlocks)/100) { + (CM_WAITFORDRAINPCT * afs_cacheBlocks) / 100) { ReleaseWriteLock(&avc->lock); if (afs_blocksUsed - afs_blocksDiscarded > - (CM_WAITFORDRAINPCT*afs_cacheBlocks)/100) { + (CM_WAITFORDRAINPCT * afs_cacheBlocks) / 100) { afs_WaitForCacheDrain = 1; afs_osi_Sleep(&afs_WaitForCacheDrain); } afs_MaybeFreeDiscardedDCache(); afs_MaybeWakeupTruncateDaemon(); - ObtainWriteLock(&avc->lock,509); + ObtainWriteLock(&avc->lock, 509); } avc->states |= CDirty; tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 4); + if (tdc) + ObtainWriteLock(&tdc->lock, 659); } } else { tdc = afs_GetDCache(avc, filePos, &treq, &offset, &len, 4); + if (tdc) + ObtainWriteLock(&tdc->lock, 660); } if (!tdc) { error = EIO; break; } if (!(afs_indexFlags[tdc->index] & IFDataMod)) { - afs_stats_cmperf.cacheCurrDirtyChunks++; - afs_indexFlags[tdc->index] |= IFDataMod; /* so it doesn't disappear */ + afs_stats_cmperf.cacheCurrDirtyChunks++; + afs_indexFlags[tdc->index] |= IFDataMod; /* so it doesn't disappear */ } if (!(tdc->f.states & DWriting)) { /* don't mark entry as mod if we don't have to */ tdc->f.states |= DWriting; - tdc->flags |= DFEntryMod; + tdc->dflags |= DFEntryMod; } tfile = (struct osi_file *)osi_UFSOpen(tdc->f.inode); len = totalLength; /* write this amount by default */ + offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk); max = AFS_CHUNKTOSIZE(tdc->f.chunk); /* max size of this chunk */ - if (max <= len + offset) { /*if we'd go past the end of this chunk */ + if (max <= len + offset) { /*if we'd go past the end of this chunk */ /* it won't all fit in this chunk, so write as much - as will fit */ + * as will fit */ len = max - offset; } /* mung uio structure to be right for this transfer */ afsio_copy(auio, &tuio, tvec); - afsio_trim(&tuio, len); + trimlen = len; + afsio_trim(&tuio, trimlen); tuio.afsio_offset = offset; -#ifdef AFS_AIX_ENV -#ifdef AFS_AIX41_ENV +#if defined(AFS_AIX41_ENV) AFS_GUNLOCK(); - code = VNOP_RDWR(tfile->vnode, UIO_WRITE, FWRITE, &tuio, NULL, NULL, NULL, &afs_osi_cred); + code = + VNOP_RDWR(tfile->vnode, UIO_WRITE, FWRITE, &tuio, NULL, NULL, + NULL, afs_osi_credp); AFS_GLOCK(); -#else -#ifdef AFS_AIX32_ENV +#elif defined(AFS_AIX32_ENV) code = VNOP_RDWR(tfile->vnode, UIO_WRITE, FWRITE, &tuio, NULL, NULL); -#else - code = VNOP_RDWR(tfile->vnode, UIO_WRITE, FWRITE, (off_t)&offset, &tuio, NULL, NULL, -1); -#endif -#endif /* AFS_AIX41_ENV */ -#else /* AFS_AIX_ENV */ -#ifdef AFS_SUN5_ENV +#elif defined(AFS_AIX_ENV) + code = + VNOP_RDWR(tfile->vnode, UIO_WRITE, FWRITE, (off_t) & offset, + &tuio, NULL, NULL, -1); +#elif defined(AFS_SUN5_ENV) AFS_GUNLOCK(); VOP_RWLOCK(tfile->vnode, 1); - code = VOP_WRITE(tfile->vnode, &tuio, 0, &afs_osi_cred); + code = VOP_WRITE(tfile->vnode, &tuio, 0, afs_osi_credp); VOP_RWUNLOCK(tfile->vnode, 1); AFS_GLOCK(); - if (code == ENOSPC) afs_warnuser("\n\n\n*** Cache partition is full - decrease cachesize!!! ***\n\n\n"); -#else -#if defined(AFS_SGI_ENV) + if (code == ENOSPC) + afs_warnuser + ("\n\n\n*** Cache partition is full - decrease cachesize!!! ***\n\n\n"); +#elif defined(AFS_SGI_ENV) AFS_GUNLOCK(); - avc->states |= CWritingUFS; + avc->states |= CWritingUFS; AFS_VOP_RWLOCK(tfile->vnode, VRWLOCK_WRITE); - AFS_VOP_WRITE(tfile->vnode, &tuio, IO_ISLOCKED, &afs_osi_cred, code); + AFS_VOP_WRITE(tfile->vnode, &tuio, IO_ISLOCKED, afs_osi_credp, code); AFS_VOP_RWUNLOCK(tfile->vnode, VRWLOCK_WRITE); - avc->states &= ~CWritingUFS; + avc->states &= ~CWritingUFS; AFS_GLOCK(); -#else -#ifdef AFS_OSF_ENV - { - struct ucred *tmpcred = u.u_cred; - u.u_cred = &afs_osi_cred; - tuio.uio_rw = UIO_WRITE; +#elif defined(AFS_OSF_ENV) + { + struct ucred *tmpcred = u.u_cred; + u.u_cred = afs_osi_credp; + tuio.uio_rw = UIO_WRITE; + AFS_GUNLOCK(); + VOP_WRITE(tfile->vnode, &tuio, 0, afs_osi_credp, code); + AFS_GLOCK(); + u.u_cred = tmpcred; + } +#elif defined(AFS_HPUX100_ENV) + { + AFS_GUNLOCK(); + code = VOP_RDWR(tfile->vnode, &tuio, UIO_WRITE, 0, afs_osi_credp); + AFS_GLOCK(); + } +#elif defined(AFS_LINUX20_ENV) AFS_GUNLOCK(); - VOP_WRITE(tfile->vnode, &tuio, 0, &afs_osi_cred, code); + code = osi_file_uio_rdwr(tfile, &tuio, UIO_WRITE); AFS_GLOCK(); - u.u_cred = tmpcred; - } -#else /* AFS_OSF_ENV */ -#if defined(AFS_HPUX100_ENV) - { +#elif defined(AFS_DARWIN_ENV) AFS_GUNLOCK(); - code = VOP_RDWR(tfile->vnode, &tuio, UIO_WRITE, 0, &afs_osi_cred); + VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc()); + code = VOP_WRITE(tfile->vnode, &tuio, 0, afs_osi_credp); + VOP_UNLOCK(tfile->vnode, 0, current_proc()); + AFS_GLOCK(); +#elif defined(AFS_FBSD50_ENV) + AFS_GUNLOCK(); + VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curthread); + code = VOP_WRITE(tfile->vnode, &tuio, 0, afs_osi_credp); + VOP_UNLOCK(tfile->vnode, 0, curthread); + AFS_GLOCK(); +#elif defined(AFS_XBSD_ENV) + AFS_GUNLOCK(); + VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curproc); + code = VOP_WRITE(tfile->vnode, &tuio, 0, afs_osi_credp); + VOP_UNLOCK(tfile->vnode, 0, curproc); AFS_GLOCK(); - } #else #ifdef AFS_HPUX_ENV tuio.uio_fpflags &= ~FSYNCIO; /* don't do sync io */ #endif -#if defined(AFS_LINUX20_ENV) - AFS_GUNLOCK(); - code = osi_file_uio_rdwr(tfile, &tuio, UIO_WRITE); - AFS_GLOCK(); -#else -#if defined(AFS_DARWIN_ENV) - AFS_GUNLOCK(); - VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc()); - code = VOP_WRITE(tfile->vnode, &tuio, 0, &afs_osi_cred); - VOP_UNLOCK(tfile->vnode, 0, current_proc()); - AFS_GLOCK(); -#else -#if defined(AFS_FBSD_ENV) - AFS_GUNLOCK(); - VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curproc); - code = VOP_WRITE(tfile->vnode, &tuio, 0, &afs_osi_cred); - VOP_UNLOCK(tfile->vnode, 0, curproc); - AFS_GLOCK(); -#else - code = VOP_RDWR(tfile->vnode, &tuio, UIO_WRITE, 0, &afs_osi_cred); -#endif /* AFS_FBSD_ENV */ -#endif /* AFS_DARWIN_ENV */ -#endif /* AFS_LINUX20_ENV */ -#endif /* AFS_HPUX100_ENV */ -#endif /* AFS_OSF_ENV */ -#endif /* AFS_SGI_ENV */ -#endif /* AFS_SUN5_ENV */ -#endif /* AFS_AIX41_ENV */ + code = VOP_RDWR(tfile->vnode, &tuio, UIO_WRITE, 0, afs_osi_credp); +#endif if (code) { error = code; - ZapDCE(tdc); /* bad data */ - osi_UFSTruncate(tfile,0); /* fake truncate the segment */ - afs_AdjustSize(tdc, 0); /* sets f.chunkSize to 0 */ + ZapDCE(tdc); /* bad data */ + osi_UFSTruncate(tfile, 0); /* fake truncate the segment */ + afs_AdjustSize(tdc, 0); /* sets f.chunkSize to 0 */ afs_stats_cmperf.cacheCurrDirtyChunks--; - afs_indexFlags[tdc->index] &= ~IFDataMod; /* so it does disappear */ - afs_PutDCache(tdc); + afs_indexFlags[tdc->index] &= ~IFDataMod; /* so it does disappear */ afs_CFileClose(tfile); + ReleaseWriteLock(&tdc->lock); + afs_PutDCache(tdc); break; } /* otherwise we've written some, fixup length, etc and continue with next seg */ - len = len - tuio.afsio_resid; /* compute amount really transferred */ - afsio_skip(auio, len); /* advance auio over data written */ + len = len - tuio.afsio_resid; /* compute amount really transferred */ + tlen = len; + afsio_skip(auio, tlen); /* advance auio over data written */ /* compute new file size */ - if (offset + len > tdc->f.chunkBytes) - afs_AdjustSize(tdc, offset+len); + if (offset + len > tdc->f.chunkBytes) { + afs_int32 tlength = offset + len; + afs_AdjustSize(tdc, tlength); + if (tdc->validPos < filePos + len) + tdc->validPos = filePos + len; + } totalLength -= len; transferLength += len; filePos += len; #if defined(AFS_SGI_ENV) - /* afs_xwrite handles setting m.Length */ - osi_Assert(filePos <= avc->m.Length); + /* afs_xwrite handles setting m.Length */ + osi_Assert(filePos <= avc->m.Length); #else if (filePos > avc->m.Length) { + afs_Trace4(afs_iclSetp, CM_TRACE_SETLENGTH, ICL_TYPE_STRING, + __FILE__, ICL_TYPE_LONG, __LINE__, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(filePos)); avc->m.Length = filePos; } #endif osi_UFSClose(tfile); + ReleaseWriteLock(&tdc->lock); + afs_PutDCache(tdc); #if !defined(AFS_VM_RDWR_ENV) /* * If write is implemented via VM, afs_DoPartialWrite() is called from @@ -597,12 +639,10 @@ afs_UFSWrite(avc, auio, aio, acred, noLock) code = afs_DoPartialWrite(avc, &treq); if (code) { error = code; - afs_PutDCache(tdc); break; } } #endif - afs_PutDCache(tdc); } #ifndef AFS_VM_RDWR_ENV afs_FakeClose(avc, acred); @@ -616,23 +656,23 @@ afs_UFSWrite(avc, auio, aio, acred, noLock) osi_FreeSmallSpace(tvec); #ifdef AFS_DEC_ENV /* next, on GFS systems, we update g_size so that lseek's relative to EOF will - work. GFS is truly a poorly-designed interface! */ - afs_gfshack((struct gnode *) avc); + * work. GFS is truly a poorly-designed interface! */ + afs_gfshack((struct gnode *)avc); #endif #ifndef AFS_VM_RDWR_ENV /* * If write is implemented via VM, afs_fsync() is called from the high-level * write op. */ -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - if (noLock && (aio & IO_SYNC)) { -#else +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + if (noLock && (aio & IO_SYNC)) { +#else #ifdef AFS_HPUX_ENV /* On hpux on synchronous writes syncio will be set to IO_SYNC. If * we're doing them because the file was opened with O_SYNCIO specified, * we have to look in the u area. No single mechanism here!! */ - if (noLock && ((aio & IO_SYNC) | (auio->uio_fpflags & FSYNCIO))) { + if (noLock && ((aio & IO_SYNC) | (auio->uio_fpflags & FSYNCIO))) { #else if (noLock && (aio & FSYNC)) { #endif @@ -645,16 +685,17 @@ afs_UFSWrite(avc, auio, aio, acred, noLock) } /* do partial write if we're low on unmodified chunks */ -afs_DoPartialWrite(avc, areq) -register struct vcache *avc; -struct vrequest *areq; { +int +afs_DoPartialWrite(register struct vcache *avc, struct vrequest *areq) +{ register afs_int32 code; - if (afs_stats_cmperf.cacheCurrDirtyChunks <= afs_stats_cmperf.cacheMaxDirtyChunks) - return 0; /* nothing to do */ + if (afs_stats_cmperf.cacheCurrDirtyChunks <= + afs_stats_cmperf.cacheMaxDirtyChunks) + return 0; /* nothing to do */ /* otherwise, call afs_StoreDCache (later try to do this async, if possible) */ afs_Trace2(afs_iclSetp, CM_TRACE_PARTIALWRITE, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->m.Length); + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length)); #if defined(AFS_SUN5_ENV) code = afs_StoreAllSegments(avc, areq, AFS_ASYNC | AFS_VMSYNC_INVAL); #else @@ -665,7 +706,7 @@ struct vrequest *areq; { -#if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) && !defined (AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) +#if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) && !defined (AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) #ifdef AFS_DUX50_ENV #define vno_close(X) vn_close((X), 0, NOCRED) #elif defined(AFS_DUX40_ENV) @@ -686,8 +727,9 @@ struct vrequest *areq; { * N.B: Intercepting close syscall doesn't trap aborts or exit system * calls. */ -afs_closex(afd) - register struct file *afd; { +int +afs_closex(register struct file *afd) +{ struct vrequest treq; struct vcache *tvc; afs_int32 flags; @@ -697,7 +739,8 @@ afs_closex(afd) AFS_STATCNT(afs_closex); /* setup the credentials */ - if (code = afs_InitReq(&treq, u.u_cred)) return code; + if ((code = afs_InitReq(&treq, u.u_cred))) + return code; afs_InitFakeStat(&fakestat); closeDone = 0; @@ -709,22 +752,22 @@ afs_closex(afd) if (IsAfsVnode(AFSTOV(tvc))) { code = afs_EvalFakeStat(&tvc, &fakestat, &treq); if (code) { - afs_PutFakeStat(&fakestat); - return code; + afs_PutFakeStat(&fakestat); + return code; } VN_HOLD(AFSTOV(tvc)); flags = afd->f_flag & (FSHLOCK | FEXLOCK); afd->f_flag &= ~(FSHLOCK | FEXLOCK); code = vno_close(afd); - if (flags) + if (flags) #if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV) - HandleFlock(tvc, LOCK_UN, &treq, - u.u_procp->p_pid, 1/*onlymine*/); + HandleFlock(tvc, LOCK_UN, &treq, u.u_procp->p_pid, + 1 /*onlymine */ ); #else - HandleFlock(tvc, LOCK_UN, &treq, 0, 1/*onlymine*/); + HandleFlock(tvc, LOCK_UN, &treq, 0, 1 /*onlymine */ ); #endif #ifdef AFS_DEC_ENV - grele((struct gnode *) tvc); + grele((struct gnode *)tvc); #else AFS_RELE(AFSTOV(tvc)); #endif @@ -736,12 +779,13 @@ afs_closex(afd) code = vno_close(afd); } afs_PutFakeStat(&fakestat); - return code; /* return code from vnode layer */ + return code; /* return code from vnode layer */ } #endif /* handle any closing cleanup stuff */ +int #ifdef AFS_SGI_ENV afs_close(OSI_VC_ARG(avc), aflags, lastclose, #if !defined(AFS_SGI65_ENV) @@ -751,30 +795,28 @@ afs_close(OSI_VC_ARG(avc), aflags, lastclose, #if defined(AFS_SGI64_ENV) && !defined(AFS_SGI65_ENV) , flp #endif - ) -lastclose_t lastclose; + ) + lastclose_t lastclose; #if !defined(AFS_SGI65_ENV) -off_t offset; + off_t offset; #if defined(AFS_SGI64_ENV) -struct flid *flp; + struct flid *flp; #endif #endif -#else /* SGI */ -#if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) +#elif defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) #ifdef AFS_SUN5_ENV afs_close(OSI_VC_ARG(avc), aflags, count, offset, acred) - offset_t offset; + offset_t offset; #else afs_close(OSI_VC_ARG(avc), aflags, count, acred) #endif -int count; + int count; #else afs_close(OSI_VC_ARG(avc), aflags, acred) #endif -#endif - OSI_VC_DECL(avc); - afs_int32 aflags; - struct AFS_UCRED *acred; +OSI_VC_DECL(avc); + afs_int32 aflags; + struct AFS_UCRED *acred; { register afs_int32 code; register struct brequest *tb; @@ -785,11 +827,12 @@ afs_close(OSI_VC_ARG(avc), aflags, acred) struct afs_fakestat_state fakestat; OSI_VC_CONVERT(avc) - AFS_STATCNT(afs_close); + AFS_STATCNT(afs_close); afs_Trace2(afs_iclSetp, CM_TRACE_CLOSE, ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, aflags); code = afs_InitReq(&treq, acred); - if (code) return code; + if (code) + return code; afs_InitFakeStat(&fakestat); code = afs_EvalFakeStat(&avc, &fakestat, &treq); if (code) { @@ -798,69 +841,67 @@ afs_close(OSI_VC_ARG(avc), aflags, acred) } #ifdef AFS_SUN5_ENV if (avc->flockCount) { - HandleFlock(avc, LOCK_UN, &treq, 0, 1/*onlymine*/); + HandleFlock(avc, LOCK_UN, &treq, 0, 1 /*onlymine */ ); } #endif #if defined(AFS_SGI_ENV) if (!lastclose) { afs_PutFakeStat(&fakestat); - return 0; + return 0; } -#else -#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) +#elif defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) if (count > 1) { /* The vfs layer may call this repeatedly with higher "count"; only on the last close (i.e. count = 1) we should actually proceed with the close. */ afs_PutFakeStat(&fakestat); return 0; } #endif -#endif #ifndef AFS_SUN5_ENV #if defined(AFS_SGI_ENV) /* unlock any locks for pid - could be wrong for child .. */ - AFS_RWLOCK((vnode_t *)avc, VRWLOCK_WRITE); + AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE); #ifdef AFS_SGI65_ENV get_current_flid(&flid); - cleanlocks((vnode_t *)avc, flid.fl_pid, flid.fl_sysid); - HandleFlock(avc, LOCK_UN, &treq, flid.fl_pid, 1/*onlymine*/); + cleanlocks((vnode_t *) avc, flid.fl_pid, flid.fl_sysid); + HandleFlock(avc, LOCK_UN, &treq, flid.fl_pid, 1 /*onlymine */ ); #else #ifdef AFS_SGI64_ENV - cleanlocks((vnode_t *)avc, flp); + cleanlocks((vnode_t *) avc, flp); #else /* AFS_SGI64_ENV */ - cleanlocks((vnode_t *)avc, u.u_procp->p_epid, u.u_procp->p_sysid); + cleanlocks((vnode_t *) avc, u.u_procp->p_epid, u.u_procp->p_sysid); #endif /* AFS_SGI64_ENV */ - HandleFlock(avc, LOCK_UN, &treq, OSI_GET_CURRENT_PID(), 1/*onlymine*/); + HandleFlock(avc, LOCK_UN, &treq, OSI_GET_CURRENT_PID(), 1 /*onlymine */ ); #endif /* AFS_SGI65_ENV */ /* afs_chkpgoob will drop and re-acquire the global lock. */ afs_chkpgoob(&avc->v, btoc(avc->m.Length)); -#else - if (avc->flockCount) { /* Release Lock */ +#else /* AFS_SGI_ENV */ + if (avc->flockCount) { /* Release Lock */ #if defined(AFS_OSF_ENV) || defined(AFS_SUN_ENV) - HandleFlock(avc, LOCK_UN, &treq, u.u_procp->p_pid, 1/*onlymine*/); + HandleFlock(avc, LOCK_UN, &treq, u.u_procp->p_pid, 1 /*onlymine */ ); #else - HandleFlock(avc, LOCK_UN, &treq, 0, 1/*onlymine*/); + HandleFlock(avc, LOCK_UN, &treq, 0, 1 /*onlymine */ ); #endif } -#endif -#endif +#endif /* AFS_SGI_ENV */ +#endif /* AFS_SUN5_ENV */ if (aflags & (FWRITE | FTRUNC)) { if (afs_BBusy()) { /* do it yourself if daemons are all busy */ - ObtainWriteLock(&avc->lock,124); + ObtainWriteLock(&avc->lock, 124); code = afs_StoreOnLastReference(avc, &treq); ReleaseWriteLock(&avc->lock); #if defined(AFS_SGI_ENV) - AFS_RWUNLOCK((vnode_t *)avc, VRWLOCK_WRITE); + AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_WRITE); #endif - } - else { + } else { #if defined(AFS_SGI_ENV) - AFS_RWUNLOCK((vnode_t *)avc, VRWLOCK_WRITE); + AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_WRITE); #endif /* at least one daemon is idle, so ask it to do the store. - Also, note that we don't lock it any more... */ - tb = afs_BQueue(BOP_STORE, avc, 0, 1, acred, (long)acred->cr_uid, - 0L, 0L, 0L); + * Also, note that we don't lock it any more... */ + tb = afs_BQueue(BOP_STORE, avc, 0, 1, acred, + (afs_size_t) acred->cr_uid, (afs_size_t) 0, + (void *)0); /* sleep waiting for the store to start, then retrieve error code */ while ((tb->flags & BUVALID) == 0) { tb->flags |= BUWAIT; @@ -871,16 +912,16 @@ afs_close(OSI_VC_ARG(avc), aflags, acred) } /* VNOVNODE is "acceptable" error code from close, since - may happen when deleting a file on another machine while - it is open here. We do the same for ENOENT since in afs_CheckCode we map VNOVNODE -> ENOENT */ + * may happen when deleting a file on another machine while + * it is open here. We do the same for ENOENT since in afs_CheckCode we map VNOVNODE -> ENOENT */ if (code == VNOVNODE || code == ENOENT) code = 0; - + /* Ensure last closer gets the error. If another thread caused * DoPartialWrite and this thread does not actually store the data, * it may not see the quota error. */ - ObtainWriteLock(&avc->lock,406); + ObtainWriteLock(&avc->lock, 406); if (avc->vc_error) { #ifdef AFS_AIX32_ENV osi_ReleaseVM(avc, acred); @@ -896,13 +937,13 @@ afs_close(OSI_VC_ARG(avc), aflags, acred) } #ifdef AFS_SUN5_ENV else if (code == ENOSPC) { - afs_warnuser("afs: failed to store file (over quota or partition full)\n"); + afs_warnuser + ("afs: failed to store file (over quota or partition full)\n"); } #else else if (code == ENOSPC) { afs_warnuser("afs: failed to store file (partition full)\n"); - } - else if (code == EDQUOT) { + } else if (code == EDQUOT) { afs_warnuser("afs: failed to store file (over quota)\n"); } #endif @@ -912,10 +953,9 @@ afs_close(OSI_VC_ARG(avc), aflags, acred) /* finally, we flush any text pages lying around here */ hzero(avc->flushDV); osi_FlushText(avc); - } - else { + } else { #if defined(AFS_SGI_ENV) - AFS_RWUNLOCK((vnode_t *)avc, VRWLOCK_WRITE); + AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_WRITE); osi_Assert(avc->opens > 0); #endif /* file open for read */ @@ -941,28 +981,28 @@ afs_close(OSI_VC_ARG(avc), aflags, acred) } - +int #ifdef AFS_OSF_ENV afs_fsync(avc, fflags, acred, waitfor) -int fflags; -int waitfor; -#else /* AFS_OSF_ENV */ + int fflags; + int waitfor; +#else /* AFS_OSF_ENV */ #if defined(AFS_SGI_ENV) || defined(AFS_SUN53_ENV) afs_fsync(OSI_VC_ARG(avc), flag, acred #ifdef AFS_SGI65_ENV - , start, stop + , start, stop #endif - ) + ) #else afs_fsync(avc, acred) #endif #endif - OSI_VC_DECL(avc); +OSI_VC_DECL(avc); struct AFS_UCRED *acred; #if defined(AFS_SGI_ENV) || defined(AFS_SUN53_ENV) -int flag; + int flag; #ifdef AFS_SGI65_ENV -off_t start, stop; + off_t start, stop; #endif #endif { @@ -970,41 +1010,41 @@ off_t start, stop; struct vrequest treq; OSI_VC_CONVERT(avc) - if (avc->vc_error) + if (avc->vc_error) return avc->vc_error; #if defined(AFS_SUN5_ENV) - /* back out if called from NFS server */ + /* back out if called from NFS server */ if (curthread->t_flag & T_DONTPEND) return 0; #endif AFS_STATCNT(afs_fsync); afs_Trace1(afs_iclSetp, CM_TRACE_FSYNC, ICL_TYPE_POINTER, avc); - if (code = afs_InitReq(&treq, acred)) return code; + if ((code = afs_InitReq(&treq, acred))) + return code; #if defined(AFS_SGI_ENV) - AFS_RWLOCK((vnode_t *)avc, VRWLOCK_WRITE); + AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE); if (flag & FSYNC_INVAL) osi_VM_FSyncInval(avc); #endif /* AFS_SGI_ENV */ - ObtainSharedLock(&avc->lock,18); + ObtainSharedLock(&avc->lock, 18); code = 0; if (avc->execsOrWriters > 0) { /* put the file back */ - UpgradeSToWLock(&avc->lock,41); + UpgradeSToWLock(&avc->lock, 41); code = afs_StoreAllSegments(avc, &treq, AFS_SYNC); ConvertWToSLock(&avc->lock); } - #if defined(AFS_SGI_ENV) - AFS_RWUNLOCK((vnode_t *)avc, VRWLOCK_WRITE); + AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_WRITE); if (code == VNOVNODE) { /* syncing an unlinked file! - non-informative to pass an errno * 102 (== VNOVNODE) to user */ - code = ENOENT; + code = ENOENT; } #endif diff --git a/src/afs/afs.h b/src/afs/afs.h index 8f93de5c4..355a29345 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -15,7 +15,7 @@ #ifdef KDUMP_KERNEL #include #else -#include "../afs/afs_args.h" +#include "afs/afs_args.h" #endif @@ -39,6 +39,17 @@ extern int afs_shuttingdown; #endif #endif +/* Moved from VNOPS/afs_vnop_flocks so can be used in prototypes */ +#if defined(AFS_HPUX102_ENV) +#define AFS_FLOCK k_flock +#else +#if defined(AFS_SUN56_ENV) || defined(AFS_LINUX24_ENV) +#define AFS_FLOCK flock64 +#else +#define AFS_FLOCK flock +#endif /* AFS_SUN65_ENV */ +#endif /* AFS_HPUX102_ENV */ + /* The following are various levels of afs debugging */ #define AFSDEB_GENERAL 1 /* Standard debugging */ #define AFSDEB_NETWORK 2 /* low level afs networking */ @@ -50,39 +61,43 @@ extern int afs_shuttingdown; /* The basic defines for the Andrew file system better keep things powers of two so "& (foo-1)" hack works for masking bits */ -#define MAXHOSTS 13 /* max hosts per single volume */ -#define OMAXHOSTS 8 /* backwards compatibility */ -#define MAXCELLHOSTS 8 /* max vldb servers per cell */ -#define NBRS 15 /* max number of queued daemon requests */ -#define NUSERS 16 /* hash table size for unixuser table */ -#define NSERVERS 16 /* hash table size for server table */ -#define NVOLS 64 /* hash table size for volume table */ -#define NFENTRIES 256 /* hash table size for disk volume table */ -#define VCSIZE 1024 /* stat cache hash table size */ -#define DCSIZE 512 /* disk cache hash table size */ -#define PIGGYSIZE 1350 /* max piggyback size */ -#define MAXVOLS 128 /* max vols we can store */ -#define MAXSYSNAME 128 /* max sysname (i.e. @sys) size */ -#define MAXNUMSYSNAMES 16 /* max that current constants allow */ -#define NOTOKTIMEOUT (2*3600) /* time after which to timeout conns sans tokens */ +#define MAXHOSTS 13 /* max hosts per single volume */ +#define OMAXHOSTS 8 /* backwards compatibility */ +#define MAXCELLHOSTS 8 /* max vldb servers per cell */ +#define NBRS 15 /* max number of queued daemon requests */ +#define NUSERS 16 /* hash table size for unixuser table */ +#define NSERVERS 16 /* hash table size for server table */ +#define NVOLS 64 /* hash table size for volume table */ +#define NFENTRIES 256 /* hash table size for disk volume table */ +#define VCSIZE 1024 /* stat cache hash table size */ +#define DCSIZE 512 /* disk cache hash table size */ +#define CBRSIZE 512 /* call back returns hash table size */ +#define PIGGYSIZE 1350 /* max piggyback size */ +#define MAXVOLS 128 /* max vols we can store */ +#define MAXSYSNAME 128 /* max sysname (i.e. @sys) size */ +#define MAXNUMSYSNAMES 16 /* max that current constants allow */ +#define NOTOKTIMEOUT (2*3600) /* time after which to timeout conns sans tokens */ #define NOPAG 0xffffffff -#define AFS_NCBRS 300 /* max # of call back return entries */ -#define AFS_MAXCBRSCALL 16 /* max to return in a given call */ -#define AFS_SALLOC_LOW_WATER 250 /* Min free blocks before allocating more */ -#define AFS_LRALLOCSIZ 4096 /* "Large" allocated size */ +#define AFS_NCBRS 300 /* max # of call back return entries */ +#define AFS_MAXCBRSCALL 16 /* max to return in a given call */ +#define AFS_SALLOC_LOW_WATER 250 /* Min free blocks before allocating more */ +#define AFS_LRALLOCSIZ 4096 /* "Large" allocated size */ #define VCACHE_FREE 5 #define AFS_NRXPACKETS 80 #define AFS_RXDEADTIME 50 -#define AFS_HARDDEADTIME 120 +#define AFS_HARDDEADTIME 120 + +extern afs_int32 afs_rx_deadtime; +extern afs_int32 afs_rx_harddead; struct sysname_info { - char *name; - short offset; - char index, allocked; + char *name; + short offset; + char index, allocked; }; /* flags to use with AFSOP_CACHEINIT */ -#define AFSCALL_INIT_MEMCACHE 0x1 /* use a memory-based cache */ +#define AFSCALL_INIT_MEMCACHE 0x1 /* use a memory-based cache */ /* below here used only for kernel procedures */ #ifdef KERNEL @@ -97,12 +112,12 @@ struct sysname_info { /* background request structure */ #define BPARMS 4 -#define BOP_NOOP 0 /* leave 0 unused */ -#define BOP_FETCH 1 /* parm1 is chunk to get */ -#define BOP_STORE 2 /* parm1 is chunk to store */ -#define BOP_PATH 3 /* parm1 is path, parm2 is chunk to fetch */ +#define BOP_NOOP 0 /* leave 0 unused */ +#define BOP_FETCH 1 /* parm1 is chunk to get */ +#define BOP_STORE 2 /* parm1 is chunk to store */ +#define BOP_PATH 3 /* parm1 is path, parm2 is chunk to fetch */ -#define B_DONTWAIT 1 /* On failure return; don't wait */ +#define B_DONTWAIT 1 /* On failure return; don't wait */ /* protocol is: refCount is incremented by user to take block out of free pool. Next, BSTARTED is set when daemon finds request. This prevents @@ -110,19 +125,19 @@ struct sysname_info { request is done, refCount is zeroed. BDONE and BWAIT are used by dudes waiting for operation to proceed to a certain point before returning. */ -#define BSTARTED 1 /* request picked up by a daemon */ -#define BUVALID 2 /* code is valid (store) */ -#define BUWAIT 4 /* someone is waiting for BUVALID */ +#define BSTARTED 1 /* request picked up by a daemon */ +#define BUVALID 2 /* code is valid (store) */ +#define BUWAIT 4 /* someone is waiting for BUVALID */ struct brequest { - struct vcache *vnode; /* vnode to use, with vrefcount bumped */ - struct AFS_UCRED *cred; /* credentials to use for operation */ - long parm[BPARMS]; /* random parameters - long's work for - * both 32 and 64 bit platforms. - */ - afs_int32 code; /* return code */ - short refCount; /* use counter for this structure */ - char opcode; /* what to do (store, fetch, etc) */ - char flags; /* free, etc */ + struct vcache *vc; /* vnode to use, with vrefcount bumped */ + struct AFS_UCRED *cred; /* credentials to use for operation */ + afs_size_t size_parm[BPARMS]; /* random parameters */ + void *ptr_parm[BPARMS]; /* pointer parameters */ + afs_int32 code; /* return code */ + short refCount; /* use counter for this structure */ + char opcode; /* what to do (store, fetch, etc) */ + char flags; /* free, etc */ + afs_int32 ts; /* counter "timestamp" */ }; struct SecretToken { @@ -130,15 +145,15 @@ struct SecretToken { }; struct ClearToken { - afs_int32 AuthHandle; - char HandShakeKey[8]; - afs_int32 ViceId; - afs_int32 BeginTimestamp; - afs_int32 EndTimestamp; + afs_int32 AuthHandle; + char HandShakeKey[8]; + afs_int32 ViceId; + afs_int32 BeginTimestamp; + afs_int32 EndTimestamp; }; struct VenusFid { - afs_int32 Cell; /* better sun packing if at end of structure */ + afs_int32 Cell; /* better sun packing if at end of structure */ struct AFSFid Fid; }; @@ -161,9 +176,9 @@ struct afs_q { }; struct vrequest { - afs_int32 uid; /* user id making the request */ - afs_int32 busyCount; /* how many busies we've seen so far */ - afs_int32 flags; /* things like O_SYNC, O_NONBLOCK go here */ + afs_int32 uid; /* user id making the request */ + afs_int32 busyCount; /* how many busies we've seen so far */ + afs_int32 flags; /* things like O_SYNC, O_NONBLOCK go here */ char initd; /* if non-zero, non-uid fields meaningful */ char accessError; /* flags for overriding error return code */ char volumeError; /* encountered a missing or busy volume */ @@ -177,7 +192,12 @@ struct vrequest { * callbacks. Sent asynchronously when we run a little low on free dudes. */ struct afs_cbr { + struct afs_cbr **pprev; struct afs_cbr *next; + + struct afs_cbr **hash_pprev; + struct afs_cbr *hash_next; + struct AFSFid fid; }; @@ -192,18 +212,18 @@ struct afs_cbr { #define CLinkedCell 0x20 /* has a linked cell in lcellp */ struct cell { - struct afs_q lruq; /* lru q next and prev */ - char *cellName; /* char string name of cell */ - afs_int32 cellIndex; /* sequence number */ - afs_int32 cellNum; /* semi-permanent cell number */ - struct server *cellHosts[MAXCELLHOSTS]; /* volume *location* hosts */ - struct cell *lcellp; /* Associated linked cell */ - u_short fsport; /* file server port */ - u_short vlport; /* volume server port */ - short states; /* state flags */ - time_t timeout; /* data expire time, if non-zero */ - struct cell_name *cnamep; /* pointer to our cell_name */ - afs_rwlock_t lock; /* protects cell data */ + struct afs_q lruq; /* lru q next and prev */ + char *cellName; /* char string name of cell */ + afs_int32 cellIndex; /* sequence number */ + afs_int32 cellNum; /* semi-permanent cell number */ + struct server *cellHosts[MAXCELLHOSTS]; /* volume *location* hosts */ + struct cell *lcellp; /* Associated linked cell */ + u_short fsport; /* file server port */ + u_short vlport; /* volume server port */ + short states; /* state flags */ + time_t timeout; /* data expire time, if non-zero */ + struct cell_name *cnamep; /* pointer to our cell_name */ + afs_rwlock_t lock; /* protects cell data */ }; struct cell_name { @@ -223,11 +243,11 @@ struct cell_alias { #define afs_PutCell(cellp, locktype) /* the unixuser flag bit definitions */ -#define UHasTokens 1 /* are the st and ct fields valid (ever set)? */ -#define UTokensBad 2 /* are tokens bad? */ -#define UPrimary 4 /* on iff primary identity */ -#define UNeedsReset 8 /* needs afs_ResetAccessCache call done */ -#define UPAGCounted 16 /* entry seen during PAG search (for stats) */ +#define UHasTokens 1 /* are the st and ct fields valid (ever set)? */ +#define UTokensBad 2 /* are tokens bad? */ +#define UPrimary 4 /* on iff primary identity */ +#define UNeedsReset 8 /* needs afs_ResetAccessCache call done */ +#define UPAGCounted 16 /* entry seen during PAG search (for stats) */ /* A flag used by afs_GCPAGs to keep track of * which entries in afs_users need to be deleted. * The lifetime of its presence in the table is the @@ -236,47 +256,40 @@ struct cell_alias { #define TMP_UPAGNotReferenced 128 /* values for afs_gcpags */ -enum -{ AFS_GCPAGS_NOTCOMPILED = 0 -, AFS_GCPAGS_OK = 1 -, AFS_GCPAGS_USERDISABLED -, AFS_GCPAGS_EPROC0 -, AFS_GCPAGS_EPROCN -, AFS_GCPAGS_EEQPID -, AFS_GCPAGS_EINEXACT -, AFS_GCPAGS_EPROCEND -, AFS_GCPAGS_EPROCWALK -, AFS_GCPAGS_ECREDWALK -, AFS_GCPAGS_EPIDCHECK -, AFS_GCPAGS_ENICECHECK +enum { AFS_GCPAGS_NOTCOMPILED = 0, AFS_GCPAGS_OK = + 1, AFS_GCPAGS_USERDISABLED, AFS_GCPAGS_EPROC0, AFS_GCPAGS_EPROCN, + AFS_GCPAGS_EEQPID, AFS_GCPAGS_EINEXACT, AFS_GCPAGS_EPROCEND, + AFS_GCPAGS_EPROCWALK, AFS_GCPAGS_ECREDWALK, AFS_GCPAGS_EPIDCHECK, + AFS_GCPAGS_ENICECHECK }; extern afs_int32 afs_gcpags; extern afs_int32 afs_gcpags_procsize; +extern afs_int32 afs_bkvolpref; struct unixuser { - struct unixuser *next; /* next hash pointer */ - afs_int32 uid; /* search based on uid and cell */ + struct unixuser *next; /* next hash pointer */ + afs_int32 uid; /* search based on uid and cell */ afs_int32 cell; - afs_int32 vid; /* corresponding vice id in specified cell */ - short refCount; /* reference count for allocation */ - char states; /* flag info */ - afs_int32 tokenTime; /* last time tokens were set, used for timing out conn data */ - afs_int32 stLen; /* ticket length (if kerberos, includes kvno at head) */ - char *stp; /* pointer to ticket itself */ + afs_int32 vid; /* corresponding vice id in specified cell */ + short refCount; /* reference count for allocation */ + char states; /* flag info */ + afs_int32 tokenTime; /* last time tokens were set, used for timing out conn data */ + afs_int32 stLen; /* ticket length (if kerberos, includes kvno at head) */ + char *stp; /* pointer to ticket itself */ struct ClearToken ct; - struct afs_exporter *exporter; /* more info about the exporter for the remote user */ + struct afs_exporter *exporter; /* more info about the exporter for the remote user */ }; struct conn { /* Per-connection block. */ - struct conn *next; /* Next dude same server. */ - struct unixuser *user; /* user validated with respect to. */ - struct rx_connection *id; /* RPC connid. */ - struct srvAddr *srvr; /* server associated with this conn */ - short refCount; /* reference count for allocation */ - unsigned short port; /* port associated with this connection */ - char forceConnectFS; /* Should we try again with these tokens? */ + struct conn *next; /* Next dude same server. */ + struct unixuser *user; /* user validated with respect to. */ + struct rx_connection *id; /* RPC connid. */ + struct srvAddr *srvr; /* server associated with this conn */ + short refCount; /* reference count for allocation */ + unsigned short port; /* port associated with this connection */ + char forceConnectFS; /* Should we try again with these tokens? */ }; @@ -319,13 +332,13 @@ struct conn { #define SRVADDR_MH 1 #define SRVADDR_ISDOWN 0x20 /* same as SRVR_ISDOWN */ -#define SRVADDR_NOUSE 0x40 /* Don't use this srvAddr */ +#define SRVADDR_NOUSE 0x40 /* Don't use this srvAddr */ struct srvAddr { - struct srvAddr *next_bkt; /* next item in hash bucket */ - struct srvAddr *next_sa; /* another interface on same host */ + struct srvAddr *next_bkt; /* next item in hash bucket */ + struct srvAddr *next_sa; /* another interface on same host */ struct server *server; /* back to parent */ - struct conn *conns; /* All user connections to this server */ - afs_int32 sa_ip; /* Host addr in network byte order */ + struct conn *conns; /* All user connections to this server */ + afs_int32 sa_ip; /* Host addr in network byte order */ u_short sa_iprank; /* indiv ip address priority */ u_short sa_portal; /* port addr in network byte order */ u_char sa_flags; @@ -344,6 +357,11 @@ struct srvAddr { #define SRVR_ISDOWN 0x20 #define SRVR_MULTIHOMED 0x40 #define SRVR_ISGONE 0x80 +#define SNO_INLINEBULK 0x100 +#define SNO_64BIT 0x200 + +#define afs_serverSetNo64Bit(s) ((s)->srvr->server->flags |= SNO_64BIT) +#define afs_serverHasNo64Bit(s) ((s)->srvr->server->flags & SNO_64BIT) struct server { union { @@ -352,9 +370,9 @@ struct server { afs_int32 addr_uniquifier; afs_int32 spares[2]; } _srvUuid; - struct { + struct { struct srvAddr haddr; - } _srvId; + } _srvId; } _suid; #define sr_uuid _suid._srvUuid.suuid #define sr_addr_uniquifier _suid._srvUuid.addr_uniquifier @@ -364,112 +382,109 @@ struct server { #define sr_flags _suid._srvId.haddr.flags #define sr_conns _suid._srvId.haddr.conns struct server *next; /* Ptr to next server in hash chain */ - struct cell *cell; /* Cell in which this host resides */ + struct cell *cell; /* Cell in which this host resides */ struct afs_cbr *cbrs; /* Return list of callbacks */ afs_int32 activationTime; /* Time when this record was first activated */ afs_int32 lastDowntimeStart; /* Time when last downtime incident began */ afs_int32 numDowntimeIncidents; /* # (completed) downtime incidents */ afs_int32 sumOfDowntimes; /* Total downtime experienced, in seconds */ struct srvAddr *addr; - char flags; /* Misc flags*/ + afs_uint32 flags; /* Misc flags */ }; -#define afs_PutServer(servp, locktype) +#define afs_PutServer(servp, locktype) /* structs for some pioctls - these are (or should be) * also in venus.h */ struct spref { - struct in_addr host; - unsigned short rank; + struct in_addr host; + unsigned short rank; }; struct sprefrequest_33 { - unsigned short offset; - unsigned short num_servers; + unsigned short offset; + unsigned short num_servers; }; -struct sprefrequest { /* new struct for 3.4 */ - unsigned short offset; - unsigned short num_servers; - unsigned short flags; +struct sprefrequest { /* new struct for 3.4 */ + unsigned short offset; + unsigned short num_servers; + unsigned short flags; }; #define DBservers 1 struct sprefinfo { - unsigned short next_offset; - unsigned short num_servers; - struct spref servers[1]; /* we overrun this array intentionally...*/ + unsigned short next_offset; + unsigned short num_servers; + struct spref servers[1]; /* we overrun this array intentionally... */ }; struct setspref { - unsigned short flags; - unsigned short num_servers; - struct spref servers[1]; /* we overrun this array intentionally...*/ + unsigned short flags; + unsigned short num_servers; + struct spref servers[1]; /* we overrun this array intentionally... */ }; /* struct for GAG pioctl */ struct gaginfo { - afs_uint32 showflags, logflags, logwritethruflag, spare[3]; - unsigned char spare2[128]; + afs_uint32 showflags, logflags, logwritethruflag, spare[3]; + unsigned char spare2[128]; }; #define GAGUSER 1 #define GAGCONSOLE 2 #define logwritethruON 1 struct rxparams { - afs_int32 rx_initReceiveWindow, rx_maxReceiveWindow, - rx_initSendWindow, rx_maxSendWindow, rxi_nSendFrags, - rxi_nRecvFrags, rxi_OrphanFragSize; - afs_int32 rx_maxReceiveSize, rx_MyMaxSendSize; - afs_uint32 spare[21]; - }; + afs_int32 rx_initReceiveWindow, rx_maxReceiveWindow, rx_initSendWindow, + rx_maxSendWindow, rxi_nSendFrags, rxi_nRecvFrags, rxi_OrphanFragSize; + afs_int32 rx_maxReceiveSize, rx_MyMaxSendSize; + afs_uint32 spare[21]; +}; /* struct for checkservers */ -struct chservinfo -{ - int magic; - char tbuffer[128]; - int tsize; - afs_int32 tinterval; - afs_int32 tflags; -} -; +struct chservinfo { + int magic; + char tbuffer[128]; + int tsize; + afs_int32 tinterval; + afs_int32 tflags; +}; /* state bits for volume */ -#define VRO 1 /* volume is readonly */ -#define VRecheck 2 /* recheck volume info with server */ -#define VBackup 4 /* is this a backup volume? */ -#define VForeign 8 /* this is a non-afs volume */ -#define VResort 16 /* server order was rearranged, sort when able */ -#define VMoreReps 32 /* This volume has more replicas than we are */ - /* keeping track of now -- check with VLDB */ +#define VRO 1 /* volume is readonly */ +#define VRecheck 2 /* recheck volume info with server */ +#define VBackup 4 /* is this a backup volume? */ +#define VForeign 8 /* this is a non-afs volume */ +#define VResort 16 /* server order was rearranged, sort when able */ +#define VMoreReps 32 /* This volume has more replicas than we are */ + /* keeping track of now -- check with VLDB */ - enum repstate { not_busy, end_not_busy = 6, rd_busy, rdwr_busy, offline }; +enum repstate { not_busy, end_not_busy = 6, rd_busy, rdwr_busy, offline }; struct volume { /* One structure per volume, describing where the volume is located - and where its mount points are. */ + * and where its mount points are. */ struct volume *next; /* Next volume in hash list. */ - afs_int32 cell; /* the cell in which the volume resides */ + afs_int32 cell; /* the cell in which the volume resides */ afs_rwlock_t lock; /* the lock for this structure */ afs_int32 volume; /* This volume's ID number. */ char *name; /* This volume's name, or 0 if unknown */ - struct server *serverHost[MAXHOSTS]; /* servers serving this volume */ - enum repstate status[MAXHOSTS]; /* busy, offline, etc */ + struct server *serverHost[MAXHOSTS]; /* servers serving this volume */ + enum repstate status[MAXHOSTS]; /* busy, offline, etc */ struct VenusFid dotdot; /* dir to access as .. */ struct VenusFid mtpoint; /* The mount point for this volume. */ afs_int32 rootVnode, rootUnique; /* Volume's root fid */ afs_int32 roVol; afs_int32 backVol; - afs_int32 rwVol; /* For r/o vols, original read/write volume. */ - afs_int32 accessTime; /* last time we used it */ - afs_int32 vtix; /* volume table index */ + afs_int32 rwVol; /* For r/o vols, original read/write volume. */ + afs_int32 accessTime; /* last time we used it */ + afs_int32 vtix; /* volume table index */ afs_int32 copyDate; /* copyDate field, for tracking vol releases */ - afs_int32 expireTime; /* for per-volume callbacks... */ + afs_int32 expireTime; /* for per-volume callbacks... */ short refCount; /* reference count for allocation */ char states; /* here for alignment reasons */ }; @@ -478,9 +493,9 @@ struct volume { /* format of an entry in volume info file */ struct fvolume { - afs_int32 cell; /* cell for this entry */ + afs_int32 cell; /* cell for this entry */ afs_int32 volume; /* volume */ - afs_int32 next; /* has index */ + afs_int32 next; /* has index */ struct VenusFid dotdot; /* .. value */ struct VenusFid mtpoint; /* mt point's fid */ afs_int32 rootVnode, rootUnique; /* Volume's root fid */ @@ -519,7 +534,6 @@ struct SimpleLocks { #endif #define CUnique 0x00001000 /* vc's uniquifier - latest unifiquier for fid */ #define CForeign 0x00002000 /* this is a non-afs vcache */ -#define CHasPages 0x00004000 #define CUnlinked 0x00010000 #define CBulkStat 0x00020000 /* loaded by a bulk stat, and not ref'd since */ #define CUnlinkedDel 0x00040000 @@ -537,13 +551,13 @@ struct SimpleLocks { #define VPageCleaning 0x2 /* Solaris - Cache Trunc Daemon sez keep out */ #define CPSIZE 2 -#if !defined(AFS_FBSD_ENV) -#define vrefCount v.v_count +#if defined(AFS_XBSD_ENV) +#define vrefCount v->v_usecount #else -#define vrefCount v.v_usecount -#endif /* AFS_FBSD_ENV */ +#define vrefCount v.v_count +#endif /* AFS_XBSD_ENV */ -#ifdef AFS_LINUX24_ENV +#if defined(AFS_LINUX24_ENV) #define VREFCOUNT(v) atomic_read(&((vnode_t *) v)->v_count) #define VREFCOUNT_SET(v, c) atomic_set(&((vnode_t *) v)->v_count, c) #define VREFCOUNT_DEC(v) atomic_dec(&((vnode_t *) v)->v_count) @@ -563,28 +577,37 @@ struct SimpleLocks { #define DCOUNT(d) ((d)->d_count) #endif -#define AFS_MAXDV 0x7fffffff /* largest dataversion number */ -#define AFS_NOTRUNC 0x7fffffff /* largest dataversion number */ +#define AFS_MAXDV 0x7fffffff /* largest dataversion number */ +#ifdef AFS_64BIT_CLIENT +#define AFS_NOTRUNC 0x7fffffffffffffffLL /* largest positive int64 number */ +#else /* AFS_64BIT_CLIENT */ +#define AFS_NOTRUNC 0x7fffffff /* largest dataversion number */ +#endif /* AFS_64BIT_CLIENT */ -extern afs_int32 vmPageHog; /* counter for # of vnodes which are page hogs. */ +extern afs_int32 vmPageHog; /* counter for # of vnodes which are page hogs. */ /* * Fast map from vcache to dcache */ -struct vtodc - { - struct dcache * dc; - afs_uint32 stamp; - struct osi_file * f; - afs_uint32 minLoc; /* smallest offset into dc. */ - afs_uint32 len; /* largest offset into dc. */ - }; - -extern afs_uint32 afs_stampValue; /* stamp for pair's usage */ +struct vtodc { + struct dcache *dc; + afs_uint32 stamp; + struct osi_file *f; + afs_offs_t minLoc; /* smallest offset into dc. */ + afs_offs_t len; /* largest offset into dc. */ +}; + +extern afs_uint32 afs_stampValue; /* stamp for pair's usage */ #define MakeStamp() (++afs_stampValue) -#define VTOAFS(V) ((struct vcache*)(V)) +#if defined(AFS_XBSD_ENV) +#define VTOAFS(v) ((struct vcache *)(v)->v_data) +#define AFSTOV(vc) ((vc)->v) +#else +#define VTOAFS(V) ((struct vcache *)(V)) #define AFSTOV(V) (&(V)->v) +#endif + #ifdef AFS_LINUX22_ENV #define ITOAFS(V) ((struct vcache*)(V)) #define AFSTOI(V) (struct inode *)(&(V)->v) @@ -595,27 +618,31 @@ extern afs_uint32 afs_stampValue; /* stamp for pair's usage */ * !(avc->nextfree) && !avc->vlruq.next => (FreeVCList == avc->nextfree) */ struct vcache { - struct vnode v; /* Has reference count in v.v_count */ - struct afs_q vlruq; /* lru q next and prev */ - struct vcache *nextfree; /* next on free list (if free) */ - struct vcache *hnext; /* Hash next */ +#if defined(AFS_XBSD_ENV) + struct vnode *v; +#else + struct vnode v; /* Has reference count in v.v_count */ +#endif + struct afs_q vlruq; /* lru q next and prev */ + struct vcache *nextfree; /* next on free list (if free) */ + struct vcache *hnext; /* Hash next */ struct VenusFid fid; struct mstat { - afs_uint32 Length; - afs_hyper_t DataVersion; - afs_uint32 Date; - afs_uint32 Owner; + afs_size_t Length; + afs_hyper_t DataVersion; + afs_uint32 Date; + afs_uint32 Owner; afs_uint32 Group; - ushort Mode; /* XXXX Should be afs_int32 XXXX */ - ushort LinkCount; + ushort Mode; /* XXXX Should be afs_int32 XXXX */ + ushort LinkCount; /* vnode type is in v.v_type */ } m; - afs_rwlock_t lock; /* The lock on the vcache contents. */ + afs_rwlock_t lock; /* The lock on the vcache contents. */ #if defined(AFS_SUN5_ENV) /* Lock used to protect the activeV, multipage, and vstates fields. * Do not try to get the vcache lock when the vlock is held */ afs_rwlock_t vlock; -#endif /* defined(AFS_SUN5_ENV) */ +#endif /* defined(AFS_SUN5_ENV) */ #if defined(AFS_SUN5_ENV) krwlock_t rwlock; struct cred *credp; @@ -626,73 +653,77 @@ struct vcache { #ifdef AFS_AIX32_ENV afs_lock_t pvmlock; vmhandle_t vmh; - int segid; +#if defined(AFS_AIX51_ENV) + vmid_t segid; +#else + int segid; +#endif struct ucred *credp; #endif #ifdef AFS_AIX_ENV - int ownslock; /* pid of owner of excl lock, else 0 - defect 3083 */ + int ownslock; /* pid of owner of excl lock, else 0 - defect 3083 */ #endif #ifdef AFS_DARWIN_ENV - struct lock__bsd__ rwlock; + struct lock__bsd__ rwlock; #endif -#ifdef AFS_FBSD_ENV - struct lock rwlock; +#ifdef AFS_XBSD_ENV + struct lock rwlock; #endif - afs_int32 parentVnode; /* Parent dir, if a file. */ + afs_int32 parentVnode; /* Parent dir, if a file. */ afs_int32 parentUnique; - struct VenusFid *mvid; /* Either parent dir (if root) or root (if mt pt) */ - char *linkData; /* Link data if a symlink. */ - afs_hyper_t flushDV; /* data version last flushed from text */ - afs_hyper_t mapDV; /* data version last flushed from map */ - afs_uint32 truncPos; /* truncate file to this position at next store */ - struct server *callback; /* The callback host, if any */ - afs_uint32 cbExpires; /* time the callback expires */ - struct afs_q callsort; /* queue in expiry order, sort of */ - struct axscache *Access; /* a list of cached access bits */ - afs_int32 anyAccess; /* System:AnyUser's access to this. */ - afs_int32 last_looker; /* pag/uid from last lookup here */ + struct VenusFid *mvid; /* Either parent dir (if root) or root (if mt pt) */ + char *linkData; /* Link data if a symlink. */ + afs_hyper_t flushDV; /* data version last flushed from text */ + afs_hyper_t mapDV; /* data version last flushed from map */ + afs_size_t truncPos; /* truncate file to this position at next store */ + struct server *callback; /* The callback host, if any */ + afs_uint32 cbExpires; /* time the callback expires */ + struct afs_q callsort; /* queue in expiry order, sort of */ + struct axscache *Access; /* a list of cached access bits */ + afs_int32 anyAccess; /* System:AnyUser's access to this. */ + afs_int32 last_looker; /* pag/uid from last lookup here */ #if defined(AFS_SUN5_ENV) afs_int32 activeV; -#endif /* defined(AFS_SUN5_ENV) */ +#endif /* defined(AFS_SUN5_ENV) */ struct SimpleLocks *slocks; - short opens; /* The numbers of opens, read or write, on this file. */ - short execsOrWriters; /* The number of execs (if < 0) or writers (if > 0) of - this file. */ - short flockCount; /* count of flock readers, or -1 if writer */ - char mvstat; /* 0->normal, 1->mt pt, 2->root. */ - afs_uint32 states; /* state bits */ + short opens; /* The numbers of opens, read or write, on this file. */ + short execsOrWriters; /* The number of execs (if < 0) or writers (if > 0) of + * this file. */ + short flockCount; /* count of flock readers, or -1 if writer */ + char mvstat; /* 0->normal, 1->mt pt, 2->root. */ + afs_uint32 states; /* state bits */ #if defined(AFS_SUN5_ENV) - afs_uint32 vstates; /* vstate bits */ -#endif /* defined(AFS_SUN5_ENV) */ + afs_uint32 vstates; /* vstate bits */ +#endif /* defined(AFS_SUN5_ENV) */ struct vtodc quick; afs_uint32 symhintstamp; union { - struct vcache *symhint; - struct dcache *dchint; + struct vcache *symhint; + struct dcache *dchint; } h1; #ifdef AFS_LINUX22_ENV - u_short flushcnt; /* Number of flushes which haven't released yet. */ - u_short mapcnt; /* Number of mappings of this file. */ + u_short flushcnt; /* Number of flushes which haven't released yet. */ + u_short mapcnt; /* Number of mappings of this file. */ #endif #if defined(AFS_SGI_ENV) - daddr_t lastr; /* for read-ahead */ + daddr_t lastr; /* for read-ahead */ #ifdef AFS_SGI64_ENV - uint64_t vc_rwlockid; /* kthread owning rwlock */ + uint64_t vc_rwlockid; /* kthread owning rwlock */ #else - short vc_rwlockid; /* pid of process owning rwlock */ + short vc_rwlockid; /* pid of process owning rwlock */ #endif - short vc_locktrips; /* # of rwlock reacquisitions */ - sema_t vc_rwlock; /* vop_rwlock for afs */ - pgno_t mapcnt; /* # of pages mapped */ - struct cred *cred; /* last writer's cred */ + short vc_locktrips; /* # of rwlock reacquisitions */ + sema_t vc_rwlock; /* vop_rwlock for afs */ + pgno_t mapcnt; /* # of pages mapped */ + struct cred *cred; /* last writer's cred */ #ifdef AFS_SGI64_ENV struct bhv_desc vc_bhv_desc; /* vnode's behavior data. */ #endif -#endif /* AFS_SGI_ENV */ - afs_int32 vc_error; /* stash write error for this vnode. */ - int xlatordv; /* Used by nfs xlator */ +#endif /* AFS_SGI_ENV */ + afs_int32 vc_error; /* stash write error for this vnode. */ + int xlatordv; /* Used by nfs xlator */ struct AFS_UCRED *uncred; - int asynchrony; /* num kbytes to store behind */ + int asynchrony; /* num kbytes to store behind */ #ifdef AFS_SUN5_ENV short multiPage; /* count of multi-page getpages in progress */ #endif @@ -703,7 +734,7 @@ struct vcache { #define DONT_CHECK_MODE_BITS 0 #define CHECK_MODE_BITS 1 -#define CMB_ALLOW_EXEC_AS_READ 2 /* For the NFS xlator */ +#define CMB_ALLOW_EXEC_AS_READ 2 /* For the NFS xlator */ #if defined(AFS_SGI_ENV) #define AVCRWLOCK(avc) (valusema(&(avc)->vc_rwlock) <= 0) @@ -719,7 +750,7 @@ struct vcache { #ifdef AFS_SGI53_ENV #ifdef AFS_SGI62_ENV #define AFS_RWLOCK_T vrwlock_t -#else +#else #define AFS_RWLOCK_T int #endif /* AFS_SGI62_ENV */ #ifdef AFS_SGI64_ENV @@ -743,7 +774,7 @@ struct vcxstat { struct VenusFid fid; afs_hyper_t DataVersion; afs_rwlock_t lock; - afs_int32 parentVnode; + afs_int32 parentVnode; afs_int32 parentUnique; afs_hyper_t flushDV; afs_hyper_t mapDV; @@ -761,14 +792,14 @@ struct vcxstat { }; struct sbstruct { - int sb_thisfile; - int sb_default; + int sb_thisfile; + int sb_default; }; /* CM inititialization parameters. What CM actually used after calculations * based on passed in arguments. */ -#define CMI_VERSION 1 /* increment when adding new fields. */ +#define CMI_VERSION 1 /* increment when adding new fields. */ struct cm_initparams { int cmi_version; int cmi_nChunkFiles; @@ -777,10 +808,10 @@ struct cm_initparams { int cmi_nVolumeCaches; int cmi_firstChunkSize; int cmi_otherChunkSize; - int cmi_cacheSize; /* The original cache size, in 1K blocks. */ + int cmi_cacheSize; /* The original cache size, in 1K blocks. */ unsigned cmi_setTime:1; unsigned cmi_memCache:1; - int spare[16-9]; /* size of struct is 16 * 4 = 64 bytes */ + int spare[16 - 9]; /* size of struct is 16 * 4 = 64 bytes */ }; @@ -806,28 +837,29 @@ struct cm_initparams { /* struct dcache states bits */ #define DWriting 8 /* file being written (used for cache validation) */ -/* dcache flags */ -#define DFNextStarted 1 /* next chunk has been prefetched already */ -#define DFEntryMod 2 /* has entry itself been modified? */ -#define DFFetching 4 /* file is currently being fetched */ -#define DFWaiting 8 /* someone waiting for file */ +/* dcache data flags */ +#define DFEntryMod 0x02 /* has entry itself been modified? */ +#define DFFetching 0x04 /* file is currently being fetched */ + +/* dcache meta flags */ +#define DFNextStarted 0x01 /* next chunk has been prefetched already */ #define DFFetchReq 0x10 /* someone is waiting for DFFetching to go on */ /* flags in afs_indexFlags array */ -#define IFEverUsed 1 /* index entry has >= 1 byte of data */ -#define IFFree 2 /* index entry in freeDCList */ -#define IFDataMod 4 /* file needs to be written out */ -#define IFFlag 8 /* utility flag */ +#define IFEverUsed 1 /* index entry has >= 1 byte of data */ +#define IFFree 2 /* index entry in freeDCList */ +#define IFDataMod 4 /* file needs to be written out */ +#define IFFlag 8 /* utility flag */ #define IFDirtyPages 16 #define IFAnyPages 32 -#define IFDiscarded 64 /* index entry in discardDCList */ +#define IFDiscarded 64 /* index entry in discardDCList */ struct afs_ioctl { - char *in; /* input buffer */ - char *out; /* output buffer */ - short in_size; /* Size of input buffer <= 2K */ - short out_size; /* Maximum size of output buffer, <= 2K */ + char *in; /* input buffer */ + char *out; /* output buffer */ + short in_size; /* Size of input buffer <= 2K */ + short out_size; /* Maximum size of output buffer, <= 2K */ }; /* @@ -850,7 +882,7 @@ struct afs_ioctl32 { * instead of using it. */ struct afs_fheader { -#define AFS_FHMAGIC 0x7635abaf /* uses version number */ +#define AFS_FHMAGIC 0x7635abaf /* uses version number */ afs_int32 magic; #if defined(AFS_SUN57_64BIT_ENV) #define AFS_CI_VERSION 3 @@ -862,25 +894,31 @@ struct afs_fheader { afs_int32 otherCSize; }; -/* kept on disk and in dcache entries */ -struct fcache { - struct VenusFid fid; /* Fid for this file */ - afs_int32 modTime; /* last time this entry was modified */ - afs_hyper_t versionNo; /* Associated data version number */ - afs_int32 chunk; /* Relative chunk number */ #if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_64BIT_ENV) - /* Using ino64_t here so that user level debugging programs compile - * the size correctly. - */ - ino64_t inode; /* Unix inode for this chunk */ +/* Using ino64_t here so that user level debugging programs compile + * the size correctly. + */ +#define afs_inode_t ino64_t #else #if defined(AFS_LINUX_64BIT_KERNEL) - long inode; /* Unix inode for this chunk */ +#define afs_inode_t long #else - afs_int32 inode; /* Unix inode for this chunk */ +#if defined(AFS_AIX51_ENV) || defined(AFS_HPUX1123_ENV) +#define afs_inode_t ino_t +#else +#define afs_inode_t afs_int32 +#endif #endif #endif - afs_int32 chunkBytes; /* Num bytes in this chunk */ + +/* kept on disk and in dcache entries */ +struct fcache { + struct VenusFid fid; /* Fid for this file */ + afs_int32 modTime; /* last time this entry was modified */ + afs_hyper_t versionNo; /* Associated data version number */ + afs_int32 chunk; /* Relative chunk number */ + afs_inode_t inode; /* Unix inode for this chunk */ + afs_int32 chunkBytes; /* Num bytes in this chunk */ char states; /* Has this chunk been modified? */ }; @@ -894,31 +932,60 @@ struct fcache { /* kept in memory */ struct dcache { struct afs_q lruq; /* Free queue for in-memory images */ - afs_rwlock_t lock; /* XXX */ + struct afs_q dirty; /* Queue of dirty entries that need written */ + afs_rwlock_t lock; /* Protects validPos, some f */ + afs_rwlock_t tlock; /* Atomizes updates to refCount */ + afs_rwlock_t mflock; /* Atomizes accesses/updates to mflags */ + afs_size_t validPos; /* number of valid bytes during fetch */ + afs_int32 index; /* The index in the CacheInfo file */ short refCount; /* Associated reference count. */ - afs_int32 index; /* The index in the CacheInfo file*/ - short flags; /* more flags bits */ - afs_int32 validPos; /* number of valid bytes during fetch */ + char dflags; /* Data flags */ + char mflags; /* Meta flags */ struct fcache f; /* disk image */ - afs_int32 stamp; /* used with vtodc struct for hints */ + afs_int32 stamp; /* used with vtodc struct for hints */ + + /* + * Locking rules: + * + * dcache.lock protects the actual contents of the cache file (in + * f.inode), subfields of f except those noted below, dflags and + * validPos. + * + * dcache.tlock is used to make atomic updates to refCount. Zero + * refCount dcache entries are protected by afs_xdcache instead of + * tlock. + * + * dcache.mflock is used to access and update mflags. It cannot be + * held without holding the corresponding dcache.lock. Updating + * mflags requires holding dcache.lock(R) and dcache.mflock(W), and + * checking for mflags requires dcache.lock(R) and dcache.mflock(R). + * Note that dcache.lock(W) gives you the right to update mflags, + * as dcache.mflock(W) can only be held with dcache.lock(R). + * + * dcache.stamp is protected by the associated vcache lock, because + * it's only purpose is to establish correspondence between vcache + * and dcache entries. + * + * dcache.index, dcache.f.fid, dcache.f.chunk and dcache.f.inode are + * write-protected by afs_xdcache and read-protected by refCount. + * Once an entry is referenced, these values cannot change, and if + * it's on the free list (with refCount=0), it can be reused for a + * different file/chunk. These values can only be written while + * holding afs_xdcache(W) and allocating this dcache entry (thereby + * ensuring noone else has a refCount on it). + */ }; /* this is obsolete and should be removed */ -#define ihint stamp +#define ihint stamp /* macro to mark a dcache entry as bad */ #define ZapDCE(x) \ do { \ (x)->f.fid.Fid.Unique = 0; \ afs_indexUnique[(x)->index] = 0; \ - (x)->flags |= DFEntryMod; \ + (x)->dflags |= DFEntryMod; \ } while(0) -/* - * Convenient release macro for use when afs_PutDCache would cause - * deadlock on afs_xdcache lock - */ -#define lockedPutDCache(ad) ((ad)->refCount--) - /* FakeOpen and Fake Close used to be real subroutines. They're only used in * sun_subr and afs_vnodeops, and they're very frequently called, so I made * them into macros. They do: @@ -951,9 +1018,9 @@ struct dcache { avc->opens--; \ avc->execsOrWriters--; \ } \ -} +} -#define AFS_ZEROS 64 /* zero buffer */ +#define AFS_ZEROS 64 /* zero buffer */ /*#define afs_DirtyPages(avc) (((avc)->states & CDirty) || osi_VMDirty_p((avc)))*/ #define afs_DirtyPages(avc) ((avc)->states & CDirty) @@ -964,87 +1031,37 @@ struct dcache { */ /* extern int afs_dhashsize; */ #define DCHash(v, c) ((((v)->Fid.Vnode + (v)->Fid.Volume + (c))) & (afs_dhashsize-1)) - /*Vnode, Chunk -> Hash table index*/ + /*Vnode, Chunk -> Hash table index */ #define DVHash(v) ((((v)->Fid.Vnode + (v)->Fid.Volume )) & (afs_dhashsize-1)) - /*Vnode -> Other hash table index*/ + /*Vnode -> Other hash table index */ /* don't hash on the cell, our callback-breaking code sometimes fails to compute the cell correctly, and only scans one hash bucket */ #define VCHash(fid) (((fid)->Fid.Volume + (fid)->Fid.Vnode) & (VCSIZE-1)) -extern struct dcache **afs_indexTable; /*Pointers to in-memory dcache entries*/ -extern afs_int32 *afs_indexUnique; /*dcache entry Fid.Unique */ -extern afs_int32 *afs_dvnextTbl; /*Dcache hash table links */ -extern afs_int32 *afs_dcnextTbl; /*Dcache hash table links */ -extern afs_int32 afs_cacheFiles; /*Size of afs_indexTable*/ -extern afs_int32 afs_cacheBlocks; /*1K blocks in cache*/ -extern afs_int32 afs_cacheStats; /*Stat entries in cache*/ -extern struct vcache *afs_vhashT[VCSIZE]; /*Stat cache hash table*/ -extern afs_int32 afs_initState; /*Initialization state*/ -extern afs_int32 afs_termState; /* Termination state */ -extern struct VenusFid afs_rootFid; /*Root for whole file system*/ -extern afs_int32 afs_allCBs; /* Count of callbacks*/ -extern afs_int32 afs_oddCBs; /* Count of odd callbacks*/ -extern afs_int32 afs_evenCBs; /* Count of even callbacks*/ -extern afs_int32 afs_allZaps; /* Count of fid deletes */ -extern afs_int32 afs_oddZaps; /* Count of odd fid deletes */ -extern afs_int32 afs_evenZaps; /* Count of even fid deletes */ -extern struct brequest afs_brs[NBRS]; /* request structures */ +extern struct dcache **afs_indexTable; /*Pointers to in-memory dcache entries */ +extern afs_int32 *afs_indexUnique; /*dcache entry Fid.Unique */ +extern afs_int32 *afs_dvnextTbl; /*Dcache hash table links */ +extern afs_int32 *afs_dcnextTbl; /*Dcache hash table links */ +extern afs_int32 afs_cacheFiles; /*Size of afs_indexTable */ +extern afs_int32 afs_cacheBlocks; /*1K blocks in cache */ +extern afs_int32 afs_cacheStats; /*Stat entries in cache */ +extern struct vcache *afs_vhashT[VCSIZE]; /*Stat cache hash table */ +extern afs_int32 afs_initState; /*Initialization state */ +extern afs_int32 afs_termState; /* Termination state */ +extern struct VenusFid afs_rootFid; /*Root for whole file system */ +extern afs_int32 afs_allCBs; /* Count of callbacks */ +extern afs_int32 afs_oddCBs; /* Count of odd callbacks */ +extern afs_int32 afs_evenCBs; /* Count of even callbacks */ +extern afs_int32 afs_allZaps; /* Count of fid deletes */ +extern afs_int32 afs_oddZaps; /* Count of odd fid deletes */ +extern afs_int32 afs_evenZaps; /* Count of even fid deletes */ +extern struct brequest afs_brs[NBRS]; /* request structures */ #define UHash(auid) ((auid) & (NUSERS-1)) #define VHash(avol) ((avol)&(NVOLS-1)) #define SHash(aserv) ((ntohl(aserv)) & (NSERVERS-1)) #define FVHash(acell,avol) (((avol)+(acell)) & (NFENTRIES-1)) -extern struct cell *afs_GetCell(); -extern struct cell *afs_GetCellNoLock(); -extern struct cell *afs_GetCellByName(); -extern struct cell *afs_GetCellByName2(); -extern struct cell *afs_GetCellByIndex(); -extern struct unixuser *afs_GetUser(); -extern struct volume *afs_GetVolume(); -extern struct volume *afs_GetVolumeByName(); -extern struct conn *afs_Conn(); -extern struct conn *afs_ConnByHost(); -extern struct conn *afs_ConnByMHosts(); -extern struct dcache *afs_GetDCache(); -extern struct dcache *afs_FindDCache(); -extern struct dcache *afs_NewDCache(); -extern struct dcache *afs_GetDSlot(); -extern struct vcache *afs_GetVCache(); -extern struct brequest *afs_BQueue(); - -/* afs_cache.c */ -extern int afs_CacheInit(); -extern void afs_StoreWarn(); -extern void afs_AdjustSize(); -extern void afs_ComputeCacheParms(); -extern void afs_FlushDCache(); -extern void afs_FlushActiveVcaches(); -extern void afs_StuffVcache(); -extern void afs_PutVCache(); -extern void afs_TryToSmush(); -extern void afs_ProcessFS(); -extern void afs_WriteThroughDSlots(); -extern void shutdown_cache(); -/* afs_call.c */ -extern void afs_shutdown(); -/* afs_osifile.c */ -extern void shutdown_osifile(); - -/* afs_dynroot.c */ -extern int afs_IsDynrootFid(); -extern void afs_GetDynrootFid(); -extern int afs_IsDynroot(); -extern void afs_RefreshDynroot(); -extern void afs_GetDynroot(); -extern void afs_PutDynroot(); -extern int afs_DynrootNewVnode(); -extern int afs_SetDynrootEnable(); -extern int afs_GetDynrootEnable(); -extern int afs_DynrootVOPSymlink(); -extern int afs_DynrootVOPRemove(); - - /* Performance hack - we could replace VerifyVCache2 with the appropriate * GetVCache incantation, and could eliminate even this code from afs_UFSRead * by making intentionally invalidating quick.stamp in the various callbacks @@ -1064,7 +1081,7 @@ extern int afs_DynrootVOPRemove(); #endif #endif -#define DO_STATS 1 /* bits used by FindVCache */ +#define DO_STATS 1 /* bits used by FindVCache */ #define DO_VLRU 2 /* values for flag param of afs_CheckVolumeNames */ @@ -1088,11 +1105,6 @@ extern int afs_DynrootVOPRemove(); #define afs_nlrdwr(avc, uio, rw, io, cred) \ (((rw) == UIO_WRITE) ? afs_write(avc, uio, io, cred, 1) : afs_read(avc, uio, cred, 0, 0, 1)) -extern afs_int32 afs_blocksUsed, afs_blocksDiscarded; -extern afs_int32 afs_discardDCCount, afs_freeDCCount; -extern afs_int32 afs_bulkStatsDone, afs_bulkStatsLost; -extern int afs_TruncateDaemonRunning; -extern int afs_CacheTooFull; /* Cache size truncation uses the following low and high water marks: * If the cache is more than 95% full (CM_DCACHECOUNTFREEPCT), the cache * truncation daemon is awakened and will free up space until the cache is 85% @@ -1102,15 +1114,12 @@ extern int afs_CacheTooFull; * afs_GetDownD wakes those processes once the cache is 95% full * (CM_CACHESIZEDRAINEDPCT). */ -extern void afs_MaybeWakeupTruncateDaemon(); -extern void afs_CacheTruncateDaemon(); -extern int afs_WaitForCacheDrain; -#define CM_MAXDISCARDEDCHUNKS 16 /* # of chunks */ -#define CM_DCACHECOUNTFREEPCT 95 /* max pct of chunks in use */ -#define CM_DCACHESPACEFREEPCT 90 /* max pct of space in use */ -#define CM_DCACHEEXTRAPCT 5 /* extra to get when freeing */ -#define CM_CACHESIZEDRAINEDPCT 95 /* wakeup processes when down to here.*/ -#define CM_WAITFORDRAINPCT 98 /* sleep if cache is this full. */ +#define CM_MAXDISCARDEDCHUNKS 16 /* # of chunks */ +#define CM_DCACHECOUNTFREEPCT 95 /* max pct of chunks in use */ +#define CM_DCACHESPACEFREEPCT 90 /* max pct of space in use */ +#define CM_DCACHEEXTRAPCT 5 /* extra to get when freeing */ +#define CM_CACHESIZEDRAINEDPCT 95 /* wakeup processes when down to here. */ +#define CM_WAITFORDRAINPCT 98 /* sleep if cache is this full. */ #define afs_CacheIsTooFull() \ (afs_blocksUsed - afs_blocksDiscarded > \ @@ -1119,14 +1128,11 @@ extern int afs_WaitForCacheDrain; ((100-CM_DCACHECOUNTFREEPCT)*afs_cacheFiles)/100) /* Handy max length of a numeric string. */ -#define CVBS 12 /* max afs_int32 is 2^32 ~ 4*10^9, +1 for NULL, +luck */ +#define CVBS 12 /* max afs_int32 is 2^32 ~ 4*10^9, +1 for NULL, +luck */ -extern int afs_norefpanic; #define refpanic(foo) if (afs_norefpanic) \ { printf( foo ); afs_norefpanic++;} else osi_Panic( foo ) - - /* ** these are defined in the AIX source code sys/fs_locks.h but are not ** defined anywhere in the /usr/include directory @@ -1153,13 +1159,27 @@ extern int afs_norefpanic; #ifndef afs_vnodeToDev #if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV) #define afs_vnodeToDev(V) VnodeToDev(V) -#else -#ifdef AFS_DECOSF_ENV +#elif defined(AFS_DECOSF_ENV) #define afs_vnodeToDev(V) osi_vnodeToDev(V) #else #define afs_vnodeToDev(V) (VTOI(V)->i_dev) -#endif /* AFS_DECOSF_ENV */ -#endif /* AFS_SGI62_ENV */ +#endif +#endif + + +/* Note: this should agree with the definition in kdump.c */ +#if defined(AFS_OSF_ENV) +#if !defined(UKERNEL) +#define AFS_USEBUFFERS 1 +#endif +#endif + +#if !defined(UKERNEL) && !defined(HAVE_STRUCT_BUF) +/* declare something so that prototypes don't flip out */ +/* appears struct buf stuff is only actually passed around as a pointer, + except with libuafs, in which case it is actually defined */ + +struct buf; #endif /* fakestat support: opaque storage for afs_EvalFakeStat to remember @@ -1174,5 +1194,32 @@ struct afs_fakestat_state { extern int afs_fakestat_enable; -#endif /* _AFS_H_ */ +struct buffer { + ino_t fid[1]; /* Unique cache key + i/o addressing */ + afs_int32 page; + afs_int32 accesstime; + struct buffer *hashNext; + char *data; + char lockers; + char dirty; + char hashIndex; +#if AFS_USEBUFFERS + struct buf *bufp; +#endif + afs_rwlock_t lock; /* the lock for this structure */ +}; + +/* afs_memcache.c */ +struct memCacheEntry { + int size; /* # of valid bytes in this entry */ + int dataSize; /* size of allocated data area */ + afs_lock_t afs_memLock; + char *data; /* bytes */ +}; + +/* First 32 bits of capabilities */ +#define CAPABILITY_ERRORTRANS (1<<0) + +#define CAPABILITY_BITS 1 +#endif /* _AFS_H_ */ diff --git a/src/afs/afs_analyze.c b/src/afs/afs_analyze.c index 106cdf964..1f0559004 100644 --- a/src/afs/afs_analyze.c +++ b/src/afs/afs_analyze.c @@ -11,12 +11,13 @@ * Implements: */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_analyze.c,v 1.1.1.11 2003/07/30 17:07:57 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_analyze.c,v 1.22 2003/08/27 21:43:16 rees Exp $"); -#include "../afs/stds.h" -#include "../afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/stds.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ #ifndef UKERNEL #if !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV) @@ -25,17 +26,17 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_analyze.c,v 1.1.1.11 2003/07/30 #endif #ifdef AFS_SGI62_ENV -#include "../h/hashing.h" +#include "h/hashing.h" #endif #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN60_ENV) #include #endif #endif /* !UKERNEL */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ -#include "../afs/afs_util.h" -#include "../afs/afs_prototypes.h" +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ +#include "afs/afs_util.h" +#include "afs/unified_afs.h" #if defined(AFS_SUN56_ENV) #include @@ -52,6 +53,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_analyze.c,v 1.1.1.11 2003/07/30 #define ERROR_TABLE_BASE_U (5376L) #endif /* ubik error base define */ +/* shouldn't do it this way, but for now will do */ +#ifndef ERROR_TABLE_BASE_uae +#define ERROR_TABLE_BASE_uae (49733376L) +#endif /* unified afs error base define */ + /* same hack for vlserver error base as for ubik error base */ #ifndef ERROR_TABLE_BASE_VL #define ERROR_TABLE_BASE_VL (363520L) @@ -59,17 +65,155 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_analyze.c,v 1.1.1.11 2003/07/30 #endif /* vlserver error base define */ -int afs_BusyWaitPeriod = 15; /* poll every 15 seconds */ +int afs_BusyWaitPeriod = 15; /* poll every 15 seconds */ +afs_int32 hm_retry_RO = 0; /* don't wait */ +afs_int32 hm_retry_RW = 0; /* don't wait */ +afs_int32 hm_retry_int = 0; /* don't wait */ -afs_int32 hm_retry_RO=0; /* don't wait */ -afs_int32 hm_retry_RW=0; /* don't wait */ -afs_int32 hm_retry_int=0; /* don't wait */ - -void afs_CopyError(afrom, ato) - register struct vrequest *afrom; - register struct vrequest *ato; +static int et2sys[512]; +void +init_et_to_sys_error(void) +{ + memset(&et2sys, 0, sizeof(et2sys)); + et2sys[(UAEPERM - ERROR_TABLE_BASE_uae)] = EPERM; + et2sys[(UAENOENT - ERROR_TABLE_BASE_uae)] = ENOENT; + et2sys[(UAESRCH - ERROR_TABLE_BASE_uae)] = ESRCH; + et2sys[(UAEINTR - ERROR_TABLE_BASE_uae)] = EINTR; + et2sys[(UAEIO - ERROR_TABLE_BASE_uae)] = EIO; + et2sys[(UAENXIO - ERROR_TABLE_BASE_uae)] = ENXIO; + et2sys[(UAE2BIG - ERROR_TABLE_BASE_uae)] = E2BIG; + et2sys[(UAENOEXEC - ERROR_TABLE_BASE_uae)] = ENOEXEC; + et2sys[(UAEBADF - ERROR_TABLE_BASE_uae)] = EBADF; + et2sys[(UAECHILD - ERROR_TABLE_BASE_uae)] = ECHILD; + et2sys[(UAEAGAIN - ERROR_TABLE_BASE_uae)] = EAGAIN; + et2sys[(UAENOMEM - ERROR_TABLE_BASE_uae)] = ENOMEM; + et2sys[(UAEACCES - ERROR_TABLE_BASE_uae)] = EACCES; + et2sys[(UAEFAULT - ERROR_TABLE_BASE_uae)] = EFAULT; + et2sys[(UAENOTBLK - ERROR_TABLE_BASE_uae)] = ENOTBLK; + et2sys[(UAEBUSY - ERROR_TABLE_BASE_uae)] = EBUSY; + et2sys[(UAEEXIST - ERROR_TABLE_BASE_uae)] = EEXIST; + et2sys[(UAEXDEV - ERROR_TABLE_BASE_uae)] = EXDEV; + et2sys[(UAENODEV - ERROR_TABLE_BASE_uae)] = ENODEV; + et2sys[(UAENOTDIR - ERROR_TABLE_BASE_uae)] = ENOTDIR; + et2sys[(UAEISDIR - ERROR_TABLE_BASE_uae)] = EISDIR; + et2sys[(UAEINVAL - ERROR_TABLE_BASE_uae)] = EINVAL; + et2sys[(UAENFILE - ERROR_TABLE_BASE_uae)] = ENFILE; + et2sys[(UAEMFILE - ERROR_TABLE_BASE_uae)] = EMFILE; + et2sys[(UAENOTTY - ERROR_TABLE_BASE_uae)] = ENOTTY; + et2sys[(UAETXTBSY - ERROR_TABLE_BASE_uae)] = ETXTBSY; + et2sys[(UAEFBIG - ERROR_TABLE_BASE_uae)] = EFBIG; + et2sys[(UAENOSPC - ERROR_TABLE_BASE_uae)] = ENOSPC; + et2sys[(UAESPIPE - ERROR_TABLE_BASE_uae)] = ESPIPE; + et2sys[(UAEROFS - ERROR_TABLE_BASE_uae)] = EROFS; + et2sys[(UAEMLINK - ERROR_TABLE_BASE_uae)] = EMLINK; + et2sys[(UAEPIPE - ERROR_TABLE_BASE_uae)] = EPIPE; + et2sys[(UAEDOM - ERROR_TABLE_BASE_uae)] = EDOM; + et2sys[(UAERANGE - ERROR_TABLE_BASE_uae)] = ERANGE; + et2sys[(UAEDEADLK - ERROR_TABLE_BASE_uae)] = EDEADLK; + et2sys[(UAENAMETOOLONG - ERROR_TABLE_BASE_uae)] = ENAMETOOLONG; + et2sys[(UAENOLCK - ERROR_TABLE_BASE_uae)] = ENOLCK; + et2sys[(UAENOSYS - ERROR_TABLE_BASE_uae)] = ENOSYS; + et2sys[(UAENOTEMPTY - ERROR_TABLE_BASE_uae)] = ENOTEMPTY; + et2sys[(UAELOOP - ERROR_TABLE_BASE_uae)] = ELOOP; + et2sys[(UAEWOULDBLOCK - ERROR_TABLE_BASE_uae)] = EWOULDBLOCK; + et2sys[(UAENOMSG - ERROR_TABLE_BASE_uae)] = ENOMSG; + et2sys[(UAEIDRM - ERROR_TABLE_BASE_uae)] = EIDRM; + et2sys[(UAECHRNG - ERROR_TABLE_BASE_uae)] = ECHRNG; + et2sys[(UAEL2NSYNC - ERROR_TABLE_BASE_uae)] = EL2NSYNC; + et2sys[(UAEL3HLT - ERROR_TABLE_BASE_uae)] = EL3HLT; + et2sys[(UAEL3RST - ERROR_TABLE_BASE_uae)] = EL3RST; + et2sys[(UAELNRNG - ERROR_TABLE_BASE_uae)] = ELNRNG; + et2sys[(UAEUNATCH - ERROR_TABLE_BASE_uae)] = EUNATCH; + et2sys[(UAENOCSI - ERROR_TABLE_BASE_uae)] = ENOCSI; + et2sys[(UAEL2HLT - ERROR_TABLE_BASE_uae)] = EL2HLT; + et2sys[(UAEBADE - ERROR_TABLE_BASE_uae)] = EBADE; + et2sys[(UAEBADR - ERROR_TABLE_BASE_uae)] = EBADR; + et2sys[(UAEXFULL - ERROR_TABLE_BASE_uae)] = EXFULL; + et2sys[(UAENOANO - ERROR_TABLE_BASE_uae)] = ENOANO; + et2sys[(UAEBADRQC - ERROR_TABLE_BASE_uae)] = EBADRQC; + et2sys[(UAEBADSLT - ERROR_TABLE_BASE_uae)] = EBADSLT; + et2sys[(UAEBFONT - ERROR_TABLE_BASE_uae)] = EBFONT; + et2sys[(UAENOSTR - ERROR_TABLE_BASE_uae)] = ENOSTR; + et2sys[(UAENODATA - ERROR_TABLE_BASE_uae)] = ENODATA; + et2sys[(UAETIME - ERROR_TABLE_BASE_uae)] = ETIME; + et2sys[(UAENOSR - ERROR_TABLE_BASE_uae)] = ENOSR; + et2sys[(UAENONET - ERROR_TABLE_BASE_uae)] = ENONET; + et2sys[(UAENOPKG - ERROR_TABLE_BASE_uae)] = ENOPKG; + et2sys[(UAEREMOTE - ERROR_TABLE_BASE_uae)] = EREMOTE; + et2sys[(UAENOLINK - ERROR_TABLE_BASE_uae)] = ENOLINK; + et2sys[(UAEADV - ERROR_TABLE_BASE_uae)] = EADV; + et2sys[(UAESRMNT - ERROR_TABLE_BASE_uae)] = ESRMNT; + et2sys[(UAECOMM - ERROR_TABLE_BASE_uae)] = ECOMM; + et2sys[(UAEPROTO - ERROR_TABLE_BASE_uae)] = EPROTO; + et2sys[(UAEMULTIHOP - ERROR_TABLE_BASE_uae)] = EMULTIHOP; + et2sys[(UAEDOTDOT - ERROR_TABLE_BASE_uae)] = EDOTDOT; + et2sys[(UAEBADMSG - ERROR_TABLE_BASE_uae)] = EBADMSG; + et2sys[(UAEOVERFLOW - ERROR_TABLE_BASE_uae)] = EOVERFLOW; + et2sys[(UAENOTUNIQ - ERROR_TABLE_BASE_uae)] = ENOTUNIQ; + et2sys[(UAEBADFD - ERROR_TABLE_BASE_uae)] = EBADFD; + et2sys[(UAEREMCHG - ERROR_TABLE_BASE_uae)] = EREMCHG; + et2sys[(UAELIBACC - ERROR_TABLE_BASE_uae)] = ELIBACC; + et2sys[(UAELIBBAD - ERROR_TABLE_BASE_uae)] = ELIBBAD; + et2sys[(UAELIBSCN - ERROR_TABLE_BASE_uae)] = ELIBSCN; + et2sys[(UAELIBMAX - ERROR_TABLE_BASE_uae)] = ELIBMAX; + et2sys[(UAELIBEXEC - ERROR_TABLE_BASE_uae)] = ELIBEXEC; + et2sys[(UAEILSEQ - ERROR_TABLE_BASE_uae)] = EILSEQ; + et2sys[(UAERESTART - ERROR_TABLE_BASE_uae)] = ERESTART; + et2sys[(UAESTRPIPE - ERROR_TABLE_BASE_uae)] = ESTRPIPE; + et2sys[(UAEUSERS - ERROR_TABLE_BASE_uae)] = EUSERS; + et2sys[(UAENOTSOCK - ERROR_TABLE_BASE_uae)] = ENOTSOCK; + et2sys[(UAEDESTADDRREQ - ERROR_TABLE_BASE_uae)] = EDESTADDRREQ; + et2sys[(UAEMSGSIZE - ERROR_TABLE_BASE_uae)] = EMSGSIZE; + et2sys[(UAEPROTOTYPE - ERROR_TABLE_BASE_uae)] = EPROTOTYPE; + et2sys[(UAENOPROTOOPT - ERROR_TABLE_BASE_uae)] = ENOPROTOOPT; + et2sys[(UAEPROTONOSUPPORT - ERROR_TABLE_BASE_uae)] = EPROTONOSUPPORT; + et2sys[(UAESOCKTNOSUPPORT - ERROR_TABLE_BASE_uae)] = ESOCKTNOSUPPORT; + et2sys[(UAEOPNOTSUPP - ERROR_TABLE_BASE_uae)] = EOPNOTSUPP; + et2sys[(UAEPFNOSUPPORT - ERROR_TABLE_BASE_uae)] = EPFNOSUPPORT; + et2sys[(UAEAFNOSUPPORT - ERROR_TABLE_BASE_uae)] = EAFNOSUPPORT; + et2sys[(UAEADDRINUSE - ERROR_TABLE_BASE_uae)] = EADDRINUSE; + et2sys[(UAEADDRNOTAVAIL - ERROR_TABLE_BASE_uae)] = EADDRNOTAVAIL; + et2sys[(UAENETDOWN - ERROR_TABLE_BASE_uae)] = ENETDOWN; + et2sys[(UAENETUNREACH - ERROR_TABLE_BASE_uae)] = ENETUNREACH; + et2sys[(UAENETRESET - ERROR_TABLE_BASE_uae)] = ENETRESET; + et2sys[(UAECONNABORTED - ERROR_TABLE_BASE_uae)] = ECONNABORTED; + et2sys[(UAECONNRESET - ERROR_TABLE_BASE_uae)] = ECONNRESET; + et2sys[(UAENOBUFS - ERROR_TABLE_BASE_uae)] = ENOBUFS; + et2sys[(UAEISCONN - ERROR_TABLE_BASE_uae)] = EISCONN; + et2sys[(UAENOTCONN - ERROR_TABLE_BASE_uae)] = ENOTCONN; + et2sys[(UAESHUTDOWN - ERROR_TABLE_BASE_uae)] = ESHUTDOWN; + et2sys[(UAETOOMANYREFS - ERROR_TABLE_BASE_uae)] = ETOOMANYREFS; + et2sys[(UAETIMEDOUT - ERROR_TABLE_BASE_uae)] = ETIMEDOUT; + et2sys[(UAECONNREFUSED - ERROR_TABLE_BASE_uae)] = ECONNREFUSED; + et2sys[(UAEHOSTDOWN - ERROR_TABLE_BASE_uae)] = EHOSTDOWN; + et2sys[(UAEHOSTUNREACH - ERROR_TABLE_BASE_uae)] = EHOSTUNREACH; + et2sys[(UAEALREADY - ERROR_TABLE_BASE_uae)] = EALREADY; + et2sys[(UAEINPROGRESS - ERROR_TABLE_BASE_uae)] = EINPROGRESS; + et2sys[(UAESTALE - ERROR_TABLE_BASE_uae)] = ESTALE; + et2sys[(UAEUCLEAN - ERROR_TABLE_BASE_uae)] = EUCLEAN; + et2sys[(UAENOTNAM - ERROR_TABLE_BASE_uae)] = ENOTNAM; + et2sys[(UAENAVAIL - ERROR_TABLE_BASE_uae)] = ENAVAIL; + et2sys[(UAEISNAM - ERROR_TABLE_BASE_uae)] = EISNAM; + et2sys[(UAEREMOTEIO - ERROR_TABLE_BASE_uae)] = EREMOTEIO; + et2sys[(UAEDQUOT - ERROR_TABLE_BASE_uae)] = EDQUOT; + et2sys[(UAENOMEDIUM - ERROR_TABLE_BASE_uae)] = ENOMEDIUM; + et2sys[(UAEMEDIUMTYPE - ERROR_TABLE_BASE_uae)] = EMEDIUMTYPE; +} + +static afs_int32 +et_to_sys_error(afs_int32 in) +{ + if (in < ERROR_TABLE_BASE_uae || in >= ERROR_TABLE_BASE_uae + 512) + return in; + if (et2sys[in - ERROR_TABLE_BASE_uae] != 0) + return et2sys[in - ERROR_TABLE_BASE_uae]; + return in; +} + +void +afs_CopyError(register struct vrequest *afrom, register struct vrequest *ato) { AFS_STATCNT(afs_CopyError); if (!afrom->initd) @@ -84,12 +228,10 @@ void afs_CopyError(afrom, ato) if (afrom->permWriteError) ato->permWriteError = 1; -} /*afs_CopyError*/ - - -void afs_FinalizeReq(areq) - register struct vrequest *areq; +} +void +afs_FinalizeReq(register struct vrequest *areq) { AFS_STATCNT(afs_FinalizeReq); if (areq->initd) @@ -101,20 +243,18 @@ void afs_FinalizeReq(areq) areq->permWriteError = 0; areq->initd = 1; -} /*afs_FinalizeReq*/ - - -afs_CheckCode(acode, areq, where) - afs_int32 acode; - struct vrequest *areq; - int where; +} +int +afs_CheckCode(afs_int32 acode, struct vrequest *areq, int where) { AFS_STATCNT(afs_CheckCode); - if (acode) { - afs_Trace2(afs_iclSetp, CM_TRACE_CHECKCODE, - ICL_TYPE_INT32, acode, ICL_TYPE_INT32, where); + if (acode) { + afs_Trace2(afs_iclSetp, CM_TRACE_CHECKCODE, ICL_TYPE_INT32, acode, + ICL_TYPE_INT32, where); } + if ((acode & ~0xff) == ERROR_TABLE_BASE_uae) + acode = et_to_sys_error(acode); if (!areq || !areq->initd) return acode; if (areq->networkError) @@ -142,7 +282,7 @@ afs_CheckCode(acode, areq, where) return acode; -} /*afs_CheckCode*/ +} /*afs_CheckCode */ #define VSleep(at) afs_osi_Wait((at)*1000, 0, 0) @@ -163,93 +303,74 @@ int lastcode; #define DIFFERENT 0 #define SAME 1 #define DUNNO 2 -static int VLDB_Same (afid, areq) - struct VenusFid *afid; - struct vrequest *areq; +static int +VLDB_Same(struct VenusFid *afid, struct vrequest *areq) { struct vrequest treq; struct conn *tconn; - int i, type=0; - union { - struct vldbentry tve; - struct nvldbentry ntve; - struct uvldbentry utve; - } v; + int i, type = 0; + union { + struct vldbentry tve; + struct nvldbentry ntve; + struct uvldbentry utve; + } *v; struct volume *tvp; struct cell *tcell; - char *bp, tbuf[CVBS]; /* biggest volume id is 2^32, ~ 4*10^9 */ + char *bp, tbuf[CVBS]; /* biggest volume id is 2^32, ~ 4*10^9 */ unsigned int changed; struct server *(oldhosts[NMAXNSERVERS]); AFS_STATCNT(CheckVLDB); afs_FinalizeReq(areq); - if (i = afs_InitReq(&treq, &afs_osi_cred)) return DUNNO; + if ((i = afs_InitReq(&treq, afs_osi_credp))) + return DUNNO; + v = afs_osi_Alloc(sizeof(*v)); tcell = afs_GetCell(afid->Cell, READ_LOCK); bp = afs_cv2string(&tbuf[CVBS], afid->Fid.Volume); do { - VSleep(2); /* Better safe than sorry. */ - tconn = afs_ConnByMHosts(tcell->cellHosts, tcell->vlport, - tcell->cellNum, &treq, SHARED_LOCK); + VSleep(2); /* Better safe than sorry. */ + tconn = + afs_ConnByMHosts(tcell->cellHosts, tcell->vlport, tcell->cellNum, + &treq, SHARED_LOCK); if (tconn) { if (tconn->srvr->server->flags & SNO_LHOSTS) { type = 0; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - i = VL_GetEntryByNameO(tconn->id, bp, &v.tve); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); + i = VL_GetEntryByNameO(tconn->id, bp, &v->tve); + RX_AFS_GLOCK(); } else if (tconn->srvr->server->flags & SYES_LHOSTS) { type = 1; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - i = VL_GetEntryByNameN(tconn->id, bp, &v.ntve); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); + i = VL_GetEntryByNameN(tconn->id, bp, &v->ntve); + RX_AFS_GLOCK(); } else { type = 2; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - i = VL_GetEntryByNameU(tconn->id, bp, &v.utve); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); + i = VL_GetEntryByNameU(tconn->id, bp, &v->utve); + RX_AFS_GLOCK(); if (!(tconn->srvr->server->flags & SVLSRV_UUID)) { if (i == RXGEN_OPCODE) { type = 1; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - i = VL_GetEntryByNameN(tconn->id, bp, &v.ntve); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); + i = VL_GetEntryByNameN(tconn->id, bp, &v->ntve); + RX_AFS_GLOCK(); if (i == RXGEN_OPCODE) { type = 0; tconn->srvr->server->flags |= SNO_LHOSTS; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - i = VL_GetEntryByNameO(tconn->id, bp, &v.tve); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); + i = VL_GetEntryByNameO(tconn->id, bp, &v->tve); + RX_AFS_GLOCK(); } else if (!i) tconn->srvr->server->flags |= SYES_LHOSTS; } else if (!i) - tconn->srvr->server->flags |= SVLSRV_UUID; + tconn->srvr->server->flags |= SVLSRV_UUID; } - lastcode = i; + lastcode = i; } } else i = -1; - } while (afs_Analyze(tconn, i, (struct VenusFid *) 0, &treq, - -1, /* no op code for this */ + } while (afs_Analyze(tconn, i, NULL, &treq, -1, /* no op code for this */ SHARED_LOCK, tcell)); afs_PutCell(tcell, READ_LOCK); @@ -257,50 +378,52 @@ static int VLDB_Same (afid, areq) ICL_TYPE_INT32, i); if (i) { + afs_osi_Free(v, sizeof(*v)); return DUNNO; } /* have info, copy into serverHost array */ changed = 0; tvp = afs_FindVolume(afid, WRITE_LOCK); if (tvp) { - ObtainWriteLock(&tvp->lock,107); - for (i=0; i < NMAXNSERVERS && tvp->serverHost[i]; i++) { - oldhosts[i] = tvp->serverHost[i]; - } - - if (type == 2) { - InstallUVolumeEntry(tvp, &v.utve, afid->Cell, tcell, &treq); - } - else if (type == 1) { - InstallNVolumeEntry(tvp, &v.ntve, afid->Cell); - } - else { - InstallVolumeEntry(tvp, &v.tve, afid->Cell); - } - - if (i < NMAXNSERVERS && tvp->serverHost[i]) { + ObtainWriteLock(&tvp->lock, 107); + for (i = 0; i < NMAXNSERVERS && tvp->serverHost[i]; i++) { + oldhosts[i] = tvp->serverHost[i]; + } + + if (type == 2) { + InstallUVolumeEntry(tvp, &v->utve, afid->Cell, tcell, &treq); + } else if (type == 1) { + InstallNVolumeEntry(tvp, &v->ntve, afid->Cell); + } else { + InstallVolumeEntry(tvp, &v->tve, afid->Cell); + } + + if (i < NMAXNSERVERS && tvp->serverHost[i]) { changed = 1; - } - for (--i;!changed && i >= 0; i--) { - if (tvp->serverHost[i] != oldhosts[i]) { - changed = 1; /* also happens if prefs change. big deal. */ - } - } - - ReleaseWriteLock(&tvp->lock); - afs_PutVolume(tvp, WRITE_LOCK); - } - else { /* can't find volume */ - tvp = afs_GetVolume(afid, &treq, WRITE_LOCK); - if (tvp) { + } + for (--i; !changed && i >= 0; i--) { + if (tvp->serverHost[i] != oldhosts[i]) { + changed = 1; /* also happens if prefs change. big deal. */ + } + } + + ReleaseWriteLock(&tvp->lock); afs_PutVolume(tvp, WRITE_LOCK); - return DIFFERENT; - } - else return DUNNO; + } else { /* can't find volume */ + tvp = afs_GetVolume(afid, &treq, WRITE_LOCK); + if (tvp) { + afs_PutVolume(tvp, WRITE_LOCK); + afs_osi_Free(v, sizeof(*v)); + return DIFFERENT; + } else { + afs_osi_Free(v, sizeof(*v)); + return DUNNO; + } } + afs_osi_Free(v, sizeof(*v)); return (changed ? DIFFERENT : SAME); -} /*VLDB_Same */ +} /*VLDB_Same */ /*------------------------------------------------------------------------ @@ -335,98 +458,95 @@ static int VLDB_Same (afid, areq) * The retry return value is used by afs_StoreAllSegments to determine * if this is a temporary or permanent error. *------------------------------------------------------------------------*/ -int afs_Analyze(aconn, acode, afid, areq, op, locktype, cellp) - register struct conn *aconn; - afs_int32 acode; - register struct vrequest *areq; - struct VenusFid *afid; - int op; - afs_int32 locktype; - struct cell *cellp; -{ /*afs_Analyze*/ - - afs_int32 i, code; - struct srvAddr *sa; - struct server *tsp; - struct volume *tvp; - afs_int32 shouldRetry = 0; - struct afs_stats_RPCErrors *aerrP; - XSTATS_DECLS; +int +afs_Analyze(register struct conn *aconn, afs_int32 acode, + struct VenusFid *afid, register struct vrequest *areq, int op, + afs_int32 locktype, struct cell *cellp) +{ + afs_int32 i; + struct srvAddr *sa; + struct server *tsp; + struct volume *tvp; + afs_int32 shouldRetry = 0; + struct afs_stats_RPCErrors *aerrP; AFS_STATCNT(afs_Analyze); afs_Trace4(afs_iclSetp, CM_TRACE_ANALYZE, ICL_TYPE_INT32, op, - ICL_TYPE_POINTER, aconn, - ICL_TYPE_INT32, acode, ICL_TYPE_LONG, areq->uid); + ICL_TYPE_POINTER, aconn, ICL_TYPE_INT32, acode, ICL_TYPE_LONG, + areq->uid); - aerrP = (struct afs_stats_RPCErrors *) 0; + aerrP = (struct afs_stats_RPCErrors *)0; if ((op >= 0) && (op < AFS_STATS_NUM_FS_RPC_OPS)) - aerrP = &(afs_stats_cmfullperf.rpc.fsRPCErrors[op]); + aerrP = &(afs_stats_cmfullperf.rpc.fsRPCErrors[op]); afs_FinalizeReq(areq); - if (!aconn && areq->busyCount) { /* one RPC or more got VBUSY/VRESTARTING */ - - tvp = afs_FindVolume(afid, READ_LOCK); - if (tvp) { - afs_warnuser("afs: Waiting for busy volume %u (%s) in cell %s\n", - (afid ? afid->Fid.Volume : 0), - (tvp->name ? tvp->name : ""), - ((tvp->serverHost[0] && tvp->serverHost[0]->cell) ? - tvp->serverHost[0]->cell->cellName : "")); - - for (i=0; i < MAXHOSTS; i++) { - if (tvp->status[i] != not_busy && tvp->status[i] != offline) { - tvp->status[i] = not_busy; + if (!aconn && areq->busyCount) { /* one RPC or more got VBUSY/VRESTARTING */ + + tvp = afs_FindVolume(afid, READ_LOCK); + if (tvp) { + afs_warnuser("afs: Waiting for busy volume %u (%s) in cell %s\n", + (afid ? afid->Fid.Volume : 0), + (tvp->name ? tvp->name : ""), + ((tvp->serverHost[0] + && tvp->serverHost[0]->cell) ? tvp->serverHost[0]-> + cell->cellName : "")); + + for (i = 0; i < MAXHOSTS; i++) { + if (tvp->status[i] != not_busy && tvp->status[i] != offline) { + tvp->status[i] = not_busy; + } + if (tvp->status[i] == not_busy) + shouldRetry = 1; } - if (tvp->status[i] == not_busy) - shouldRetry = 1; - } - afs_PutVolume(tvp, READ_LOCK); - } else { - afs_warnuser("afs: Waiting for busy volume %u\n", - (afid ? afid->Fid.Volume : 0)); - } - - if (areq->busyCount > 100) { - if (aerrP) - (aerrP->err_Volume)++; - areq->volumeError = VOLBUSY; - shouldRetry = 0; - } else { - VSleep(afs_BusyWaitPeriod); /* poll periodically */ - } - if (shouldRetry != 0) - areq->busyCount++; + afs_PutVolume(tvp, READ_LOCK); + } else { + afs_warnuser("afs: Waiting for busy volume %u\n", + (afid ? afid->Fid.Volume : 0)); + } + + if (areq->busyCount > 100) { + if (aerrP) + (aerrP->err_Volume)++; + areq->volumeError = VOLBUSY; + shouldRetry = 0; + } else { + VSleep(afs_BusyWaitPeriod); /* poll periodically */ + } + if (shouldRetry != 0) + areq->busyCount++; - return shouldRetry; /* should retry */ + return shouldRetry; /* should retry */ } - + if (!aconn) { if (!areq->volumeError) { if (aerrP) (aerrP->err_Network)++; - if (hm_retry_int && !(areq->flags & O_NONBLOCK) && /* "hard" mount */ - ((afid && afs_IsPrimaryCellNum(afid->Cell)) || - (cellp && afs_IsPrimaryCell(cellp)))) { + if (hm_retry_int && !(areq->flags & O_NONBLOCK) && /* "hard" mount */ + ((afid && afs_IsPrimaryCellNum(afid->Cell)) + || (cellp && afs_IsPrimaryCell(cellp)))) { if (!afid) { - afs_warnuser("afs: hard-mount waiting for a vlserver to return to service\n"); + afs_warnuser + ("afs: hard-mount waiting for a vlserver to return to service\n"); VSleep(hm_retry_int); - afs_CheckServers(1,cellp); - shouldRetry=1; + afs_CheckServers(1, cellp); + shouldRetry = 1; } else { tvp = afs_FindVolume(afid, READ_LOCK); if (!tvp || (tvp->states & VRO)) { - shouldRetry = hm_retry_RO; - } else { - shouldRetry = hm_retry_RW; + shouldRetry = hm_retry_RO; + } else { + shouldRetry = hm_retry_RW; } if (tvp) afs_PutVolume(tvp, READ_LOCK); if (shouldRetry) { - afs_warnuser("afs: hard-mount waiting for volume %u\n", - afid->Fid.Volume); - VSleep(hm_retry_int); - afs_CheckServers(1,cellp); + afs_warnuser + ("afs: hard-mount waiting for volume %u\n", + afid->Fid.Volume); + VSleep(hm_retry_int); + afs_CheckServers(1, cellp); } } } /* if (hm_retry_int ... */ @@ -441,61 +561,69 @@ int afs_Analyze(aconn, acode, afid, areq, op, locktype, cellp) sa = aconn->srvr; tsp = sa->server; + /* Before we do anything with acode, make sure we translate it back to + * a system error */ + if ((acode & ~0xff) == ERROR_TABLE_BASE_uae) + acode = et_to_sys_error(acode); + if (acode == 0) { - /* If we previously took an error, mark this volume not busy */ - if (areq->volumeError) { - tvp = afs_FindVolume(afid, READ_LOCK); - if (tvp) { - for (i=0; iserverHost[i] == tsp) { - tvp->status[i] = not_busy ; + /* If we previously took an error, mark this volume not busy */ + if (areq->volumeError) { + tvp = afs_FindVolume(afid, READ_LOCK); + if (tvp) { + for (i = 0; i < MAXHOSTS; i++) { + if (tvp->serverHost[i] == tsp) { + tvp->status[i] = not_busy; + } } - } - afs_PutVolume(tvp, READ_LOCK); - } - } + afs_PutVolume(tvp, READ_LOCK); + } + } - afs_PutConn(aconn, locktype); - return 0; + afs_PutConn(aconn, locktype); + return 0; } /* If network troubles, mark server as having bogued out again. */ /* VRESTARTING is < 0 because of backward compatibility issues * with 3.4 file servers and older cache managers */ - if ((acode < 0) && (acode != VRESTARTING)) { +#ifdef AFS_64BIT_CLIENT + if (acode == -455) + acode = 455; +#endif /* AFS_64BIT_CLIENT */ + if ((acode < 0) && (acode != VRESTARTING)) { afs_ServerDown(sa); - ForceNewConnections(sa); /*multi homed clients lock:afs_xsrvAddr?*/ + ForceNewConnections(sa); /*multi homed clients lock:afs_xsrvAddr? */ if (aerrP) (aerrP->err_Server)++; } if (acode == VBUSY || acode == VRESTARTING) { if (acode == VBUSY) { - areq->busyCount++; - if (aerrP) - (aerrP->err_VolumeBusies)++; - } - else areq->busyCount = 1; + areq->busyCount++; + if (aerrP) + (aerrP->err_VolumeBusies)++; + } else + areq->busyCount = 1; tvp = afs_FindVolume(afid, READ_LOCK); if (tvp) { - for (i=0; i < MAXHOSTS ; i++ ) { - if (tvp->serverHost[i] == tsp) { - tvp->status[i] = rdwr_busy ; /* can't tell which yet */ - /* to tell which, have to look at the op code. */ + for (i = 0; i < MAXHOSTS; i++) { + if (tvp->serverHost[i] == tsp) { + tvp->status[i] = rdwr_busy; /* can't tell which yet */ + /* to tell which, have to look at the op code. */ + } } - } - afs_PutVolume(tvp, READ_LOCK); - } - else { - afs_warnuser("afs: Waiting for busy volume %u in cell %s\n", - (afid? afid->Fid.Volume : 0), tsp->cell->cellName); - VSleep(afs_BusyWaitPeriod); /* poll periodically */ + afs_PutVolume(tvp, READ_LOCK); + } else { + afs_warnuser("afs: Waiting for busy volume %u in cell %s\n", + (afid ? afid->Fid.Volume : 0), tsp->cell->cellName); + VSleep(afs_BusyWaitPeriod); /* poll periodically */ } shouldRetry = 1; acode = 0; - } - else if (acode == VICETOKENDEAD || (acode & ~0xff) == ERROR_TABLE_BASE_RXK) { + } else if (acode == VICETOKENDEAD + || (acode & ~0xff) == ERROR_TABLE_BASE_RXK) { /* any rxkad error is treated as token expiration */ struct unixuser *tu; @@ -509,24 +637,28 @@ int afs_Analyze(aconn, acode, afid, areq, op, locktype, cellp) tu = afs_FindUser(areq->uid, tsp->cell->cellNum, READ_LOCK); if (tu) { if ((acode == VICETOKENDEAD) || (acode == RXKADEXPIRED)) - afs_warnuser("afs: Tokens for user of AFS id %d for cell %s have expired\n", - tu->vid, aconn->srvr->server->cell->cellName); + afs_warnuser + ("afs: Tokens for user of AFS id %d for cell %s have expired\n", + tu->vid, aconn->srvr->server->cell->cellName); else - afs_warnuser("afs: Tokens for user of AFS id %d for cell %s are discarded (rxkad error=%d)\n", - tu->vid, aconn->srvr->server->cell->cellName, acode); - afs_PutUser(tu, READ_LOCK); + afs_warnuser + ("afs: Tokens for user of AFS id %d for cell %s are discarded (rxkad error=%d)\n", + tu->vid, aconn->srvr->server->cell->cellName, acode); + afs_PutUser(tu, READ_LOCK); } else { /* The else case shouldn't be possible and should probably be replaced by a panic? */ if ((acode == VICETOKENDEAD) || (acode == RXKADEXPIRED)) - afs_warnuser("afs: Tokens for user %d for cell %s have expired\n", - areq->uid, aconn->srvr->server->cell->cellName); + afs_warnuser + ("afs: Tokens for user %d for cell %s have expired\n", + areq->uid, aconn->srvr->server->cell->cellName); else - afs_warnuser("afs: Tokens for user %d for cell %s are discarded (rxkad error = %d)\n", - areq->uid, aconn->srvr->server->cell->cellName, acode); + afs_warnuser + ("afs: Tokens for user %d for cell %s are discarded (rxkad error = %d)\n", + areq->uid, aconn->srvr->server->cell->cellName, acode); } - aconn->forceConnectFS = 0; /* don't check until new tokens set */ + aconn->forceConnectFS = 0; /* don't check until new tokens set */ aconn->user->states |= UTokensBad; - shouldRetry = 1; /* Try again (as root). */ + shouldRetry = 1; /* Try again (as root). */ } /* Check for access violation. */ else if (acode == EACCES) { @@ -539,62 +671,58 @@ int afs_Analyze(aconn, acode, afid, areq, op, locktype, cellp) shouldRetry = 0; } /* check for ubik errors; treat them like crashed servers */ - else if (acode >= ERROR_TABLE_BASE_U && acode < ERROR_TABLE_BASE_U+255) { + else if (acode >= ERROR_TABLE_BASE_U && acode < ERROR_TABLE_BASE_U + 255) { afs_ServerDown(sa); if (aerrP) (aerrP->err_Server)++; - shouldRetry = 1; /* retryable (maybe one is working) */ - VSleep(1); /* just in case */ + shouldRetry = 1; /* retryable (maybe one is working) */ + VSleep(1); /* just in case */ } /* Check for bad volume data base / missing volume. */ - else if (acode == VSALVAGE || acode == VOFFLINE - || acode == VNOVOL || acode == VNOSERVICE || acode == VMOVED) { + else if (acode == VSALVAGE || acode == VOFFLINE || acode == VNOVOL + || acode == VNOSERVICE || acode == VMOVED) { struct cell *tcell; - int same; + int same; shouldRetry = 1; areq->volumeError = VOLMISSING; if (aerrP) - (aerrP->err_Volume)++; + (aerrP->err_Volume)++; if (afid && (tcell = afs_GetCell(afid->Cell, 0))) { - same = VLDB_Same(afid, areq); - tvp = afs_FindVolume(afid, READ_LOCK); - if (tvp) { - for (i=0; i < MAXHOSTS && tvp->serverHost[i]; i++ ) { - if (tvp->serverHost[i] == tsp) { - if (tvp->status[i] == end_not_busy) - tvp->status[i] = offline ; - else - tvp->status[i]++; - } - else if (!same) { - tvp->status[i] = not_busy; /* reset the others */ - } - } - afs_PutVolume(tvp, READ_LOCK); - } + same = VLDB_Same(afid, areq); + tvp = afs_FindVolume(afid, READ_LOCK); + if (tvp) { + for (i = 0; i < MAXHOSTS && tvp->serverHost[i]; i++) { + if (tvp->serverHost[i] == tsp) { + if (tvp->status[i] == end_not_busy) + tvp->status[i] = offline; + else + tvp->status[i]++; + } else if (!same) { + tvp->status[i] = not_busy; /* reset the others */ + } + } + afs_PutVolume(tvp, READ_LOCK); + } } - } - else if (acode >= ERROR_TABLE_BASE_VL - && acode <= ERROR_TABLE_BASE_VL + 255) /* vlserver errors */ { - shouldRetry = 0; - areq->volumeError = VOLMISSING; - } - else if (acode >= 0) { + } else if (acode >= ERROR_TABLE_BASE_VL && acode <= ERROR_TABLE_BASE_VL + 255) { /* vlserver errors */ + shouldRetry = 0; + areq->volumeError = VOLMISSING; + } else if (acode >= 0) { if (aerrP) (aerrP->err_Other)++; if (op == AFS_STATS_FS_RPCIDX_STOREDATA) areq->permWriteError = 1; - shouldRetry = 0; /* Other random Vice error. */ - } else if (acode == RX_MSGSIZE) { /* same meaning as EMSGSIZE... */ - VSleep(1); /* Just a hack for desperate times. */ + shouldRetry = 0; /* Other random Vice error. */ + } else if (acode == RX_MSGSIZE) { /* same meaning as EMSGSIZE... */ + VSleep(1); /* Just a hack for desperate times. */ if (aerrP) (aerrP->err_Other)++; - shouldRetry = 1; /* packet was too big, please retry call */ - } + shouldRetry = 1; /* packet was too big, please retry call */ + } - if (acode < 0 && acode != RX_MSGSIZE && acode != VRESTARTING) { - /* If we get here, code < 0 and we have network/Server troubles. + if (acode < 0 && acode != RX_MSGSIZE && acode != VRESTARTING) { + /* If we get here, code < 0 and we have network/Server troubles. * areq->networkError is not set here, since we always * retry in case there is another server. However, if we find * no connection (aconn == 0) we set the networkError flag. @@ -605,9 +733,8 @@ int afs_Analyze(aconn, acode, afid, areq, op, locktype, cellp) VSleep(1); /* Just a hack for desperate times. */ shouldRetry = 1; } - + /* now unlock the connection and return */ afs_PutConn(aconn, locktype); return (shouldRetry); -} /*afs_Analyze*/ - +} /*afs_Analyze */ diff --git a/src/afs/afs_axscache.c b/src/afs/afs_axscache.c index 54354f2b9..f0f7131b0 100644 --- a/src/afs/afs_axscache.c +++ b/src/afs/afs_axscache.c @@ -8,70 +8,74 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_axscache.c,v 1.1.1.4 2001/07/14 22:19:17 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_axscache.c,v 1.7 2003/07/15 23:14:11 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ #include "afs/stds.h" static struct axscache *afs_axsfreelist = NULL; -static struct xfreelist { struct xfreelist *next; } *xfreemallocs = 0, *xsp = 0; -int afs_xaxscnt = 0; +static struct xfreelist { + struct xfreelist *next; +} *xfreemallocs = 0; +static int afs_xaxscnt = 0; afs_rwlock_t afs_xaxs; /* takes an address of an access cache & uid, returns ptr */ /* PRECONDITION: first field has been checked and doesn't match! * INVARIANT: isparent(i,j) ^ isparent(j,i) (ie, they switch around) */ -struct axscache *afs_SlowFindAxs(cachep,id) - struct axscache **cachep; - afs_int32 id; +struct axscache * +afs_SlowFindAxs(struct axscache **cachep, afs_int32 id) { - register struct axscache *i,*j; + register struct axscache *i, *j; - j=(*cachep); - i=j->next; + j = (*cachep); + i = j->next; while (i) { if (i->uid == id) { - axs_Front(cachep,j,i); /* maintain LRU queue */ - return(i); + axs_Front(cachep, j, i); /* maintain LRU queue */ + return (i); } - if (j=i->next) { /* ASSIGNMENT HERE! */ + if ((j = i->next)) { /* ASSIGNMENT HERE! */ if (j->uid == id) { - axs_Front(cachep,i,j); - return(j); + axs_Front(cachep, i, j); + return (j); } - } else - return ((struct axscache *) NULL); - i=j->next; + } else + return ((struct axscache *)NULL); + i = j->next; } - return ((struct axscache *) NULL); + return ((struct axscache *)NULL); } #define NAXSs (1000 / sizeof(struct axscache)) -struct axscache *axs_Alloc() +struct axscache * +axs_Alloc(void) { register struct axscache *i, *j, *xsp; struct axscache *h; int k; - ObtainWriteLock(&afs_xaxs,174); - if (h = afs_axsfreelist) { + ObtainWriteLock(&afs_xaxs, 174); + if ((h = afs_axsfreelist)) { afs_axsfreelist = h->next; } else { - h=i=j= (struct axscache *) afs_osi_Alloc(NAXSs * sizeof(struct axscache)); + h = i = j = + (struct axscache *)afs_osi_Alloc(NAXSs * sizeof(struct axscache)); afs_xaxscnt++; xsp = (struct axscache *)xfreemallocs; xfreemallocs = (struct xfreelist *)h; xfreemallocs->next = (struct xfreelist *)xsp; - for (k = 0; k < NAXSs-1; k++, i++) { + for (k = 0; k < NAXSs - 1; k++, i++) { i->uid = -2; i->axess = 0; - i->next = ++j; /* need j because order of evaluation not defined */ + i->next = ++j; /* need j because order of evaluation not defined */ } i->uid = -2; i->axess = 0; @@ -79,8 +83,8 @@ struct axscache *axs_Alloc() afs_axsfreelist = h->next; } ReleaseWriteLock(&afs_xaxs); - return(h); -} + return (h); +} #define axs_Free(axsp) { \ @@ -93,36 +97,36 @@ struct axscache *axs_Alloc() /* I optimize for speed on lookup, and don't give a RIP about delete. */ -void afs_RemoveAxs(headp, axsp) - struct axscache **headp, *axsp; +void +afs_RemoveAxs(struct axscache **headp, struct axscache *axsp) { struct axscache *i, *j; - if (*headp && axsp) { /* is bullet-proofing really neccessary? */ - if (*headp == axsp) { /* most common case, I think */ + if (*headp && axsp) { /* is bullet-proofing really neccessary? */ + if (*headp == axsp) { /* most common case, I think */ *headp = axsp->next; axs_Free(axsp); return; } - i= *headp; - j=i->next; - + i = *headp; + j = i->next; + while (j) { if (j == axsp) { i->next = j->next; axs_Free(axsp); return; } - if (i = j->next) { /* ASSIGNMENT HERE! */ + if ((i = j->next)) { /* ASSIGNMENT HERE! */ j->next = i->next; axs_Free(axsp); return; } } - } /* end of "if neither pointer is NULL" */ - - return; /* !#@ FAILED to find it! */ + } + /* end of "if neither pointer is NULL" */ + return; /* !#@ FAILED to find it! */ } @@ -130,44 +134,47 @@ void afs_RemoveAxs(headp, axsp) * Takes an entire list of access cache structs and prepends them, lock, stock, * and barrel, to the front of the freelist. */ -void afs_FreeAllAxs(headp) - struct axscache **headp; +void +afs_FreeAllAxs(struct axscache **headp) { - struct axscache *i,*j; + struct axscache *i, *j; - i= *headp; - j=NULL; + i = *headp; + j = NULL; - while (i) { /* chase down the list 'til we reach the end */ - j=i->next; + while (i) { /* chase down the list 'til we reach the end */ + j = i->next; if (!j) { - ObtainWriteLock (&afs_xaxs,176); - i->next = afs_axsfreelist; /* tack on the freelist to the end */ + ObtainWriteLock(&afs_xaxs, 176); + i->next = afs_axsfreelist; /* tack on the freelist to the end */ afs_axsfreelist = *headp; - ReleaseWriteLock (&afs_xaxs); + ReleaseWriteLock(&afs_xaxs); *headp = NULL; return; } - i=j->next; + i = j->next; } - if (j) { /* we ran off the end of the list... */ - ObtainWriteLock (&afs_xaxs,177); - j->next = afs_axsfreelist; /* tack on the freelist to the end */ + if (j) { /* we ran off the end of the list... */ + ObtainWriteLock(&afs_xaxs, 177); + j->next = afs_axsfreelist; /* tack on the freelist to the end */ afs_axsfreelist = *headp; - ReleaseWriteLock (&afs_xaxs); - } + ReleaseWriteLock(&afs_xaxs); + } *headp = NULL; return; } - -void shutdown_xscache() + +/* doesn't appear to be used at all */ +#if 0 +static void +shutdown_xscache(void) { struct xfreelist *xp, *nxp; RWLOCK_INIT(&afs_xaxs, "afs_xaxs"); - xp = xfreemallocs; + xp = xfreemallocs; while (xp) { nxp = xp->next; afs_osi_Free((char *)xp, NAXSs * sizeof(struct axscache)); @@ -176,3 +183,4 @@ void shutdown_xscache() afs_axsfreelist = NULL; xfreemallocs = NULL; } +#endif diff --git a/src/afs/afs_axscache.h b/src/afs/afs_axscache.h index cb271f5a6..370d3a993 100644 --- a/src/afs/afs_axscache.h +++ b/src/afs/afs_axscache.h @@ -26,29 +26,24 @@ */ struct axscache { - afs_int32 uid; /* most frequently used field, I think */ - afs_int32 axess; - struct axscache * next; + afs_int32 uid; /* most frequently used field, I think */ + afs_int32 axess; + struct axscache *next; }; -extern struct axscache *axs_Alloc(), *afs_SlowFindAxs(); -extern void afs_RemoveAxs(), afs_FreeAllAxs(); -extern afs_rwlock_t afs_xaxs; - /* DON'T use this with a NULL pointer! * the quick check should cover 99.9% of the cases */ -#define afs_FindAxs(cachep,id) (((cachep)->uid == id) ? cachep : afs_SlowFindAxs(&(cachep),id)) +#define afs_FindAxs(cachep,id) (((cachep)->uid == id) ? (cachep) : afs_SlowFindAxs(&(cachep),(id))) #define axs_Front(head,pp,p) {(pp)->next = (p)->next; (p)->next= *(head);*(head)=(p);} #define afs_AddAxs(cachep,id,bits) { \ struct axscache *ac; \ - if (ac = axs_Alloc()) { \ - ac->uid = id; \ - ac->axess = (afs_int32)bits; \ - ac->next = cachep; \ + if ((ac = axs_Alloc())) { \ + ac->uid = (id); \ + ac->axess = (afs_int32)(bits); \ + ac->next = (cachep); \ cachep = ac; }} #endif - diff --git a/src/afs/afs_buffer.c b/src/afs/afs_buffer.c index b950c3faf..5783f25bf 100644 --- a/src/afs/afs_buffer.c +++ b/src/afs/afs_buffer.c @@ -8,40 +8,43 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_buffer.c,v 1.1.1.7 2002/09/26 18:57:48 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_buffer.c,v 1.16 2004/01/23 16:53:35 rees Exp $"); -#include "../afs/sysincludes.h" +#include "afs/sysincludes.h" +#include "afsincludes.h" #if !defined(UKERNEL) -#include "../h/param.h" -#include "../h/types.h" -#include "../h/time.h" +#include "h/param.h" +#include "h/types.h" +#include "h/time.h" #if defined(AFS_AIX31_ENV) || defined(AFS_DEC_ENV) -#include "../h/limits.h" +#include "h/limits.h" #endif #if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV) -#include "../h/kernel.h" /* Doesn't needed, so it should go */ +#include "h/kernel.h" /* Doesn't needed, so it should go */ #endif #endif /* !defined(UKERNEL) */ -#include "../afs/afs_osi.h" -#include "../afsint/afsint.h" -#include "../afs/lock.h" +#include "afs/afs_osi.h" +#include "afsint.h" +#include "afs/lock.h" #if !defined(UKERNEL) && !defined(AFS_LINUX20_ENV) -#include "../h/buf.h" +#include "h/buf.h" #endif /* !defined(UKERNEL) */ -#include "../afs/stds.h" -#include "../afs/volerrors.h" -#include "../afs/exporter.h" -#include "../afs/prs_fs.h" -#include "../afs/afs_chunkops.h" -#include "../afs/dir.h" +#include "afs/stds.h" +#include "afs/volerrors.h" +#include "afs/exporter.h" +#include "afs/prs_fs.h" +#include "afs/afs_chunkops.h" +#include "afs/dir.h" -#include "../afs/afs_stats.h" -#include "../afs/longc_procs.h" +#include "afs/afs_stats.h" +#include "afs/longc_procs.h" +#include "afs/afs.h" #ifndef BUF_TIME_MAX #define BUF_TIME_MAX 0x7fffffff @@ -63,33 +66,12 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_buffer.c,v 1.1.1.7 2002/09/26 1 #define pHash(fid,page) ((((afs_int32)((fid)[0])) & PHFIDMASK) \ | (page & PHPAGEMASK)) -/* Note: this should agree with the definition in kdump.c */ -#if defined(AFS_OSF_ENV) -#if !defined(UKERNEL) -#define AFS_USEBUFFERS 1 -#endif -#endif - #ifdef dirty -#undef dirty /* XXX */ +#undef dirty /* XXX */ #endif -struct buffer { - ino_t fid[1]; /* Unique cache key + i/o addressing */ - afs_int32 page; - afs_int32 accesstime; - struct buffer *hashNext; - char *data; - char lockers; - char dirty; - char hashIndex; -#if AFS_USEBUFFERS - struct buf *bufp; -#endif - afs_rwlock_t lock; /* the lock for this structure */ -} *Buffers = 0; - -char *BufferData; +static struct buffer *Buffers = 0; +static char *BufferData; #ifdef AFS_AIX_ENV extern struct buf *geteblk(); @@ -102,77 +84,82 @@ extern struct buf *geteblk(); */ static afs_lock_t afs_bufferLock; static struct buffer *phTable[PHSIZE]; /* page hash table */ -int nbuffers; -afs_int32 timecounter; +static int nbuffers; +static afs_int32 timecounter; -static struct buffer *afs_newslot(); +/* Prototypes for static routines */ +static struct buffer *afs_newslot(afs_inode_t * afid, afs_int32 apage, + register struct buffer *lp); static int dinit_flag = 0; -void DInit (abuffers) - int abuffers; { +void +DInit(int abuffers) +{ /* Initialize the venus buffer system. */ register int i; register struct buffer *tb; #if AFS_USEBUFFERS - struct buf *tub; /* unix buffer for allocation */ + struct buf *tub; /* unix buffer for allocation */ #endif AFS_STATCNT(DInit); - if (dinit_flag) return; + if (dinit_flag) + return; dinit_flag = 1; #if AFS_USEBUFFERS /* round up to next multiple of NPB, since we allocate multiple pages per chunk */ - abuffers = ((abuffers-1) | (NPB-1)) + 1; + abuffers = ((abuffers - 1) | (NPB - 1)) + 1; #endif LOCK_INIT(&afs_bufferLock, "afs_bufferLock"); - Buffers = (struct buffer *) afs_osi_Alloc(abuffers * sizeof(struct buffer)); + Buffers = + (struct buffer *)afs_osi_Alloc(abuffers * sizeof(struct buffer)); #if !AFS_USEBUFFERS - BufferData = (char *) afs_osi_Alloc(abuffers * AFS_BUFFER_PAGESIZE); + BufferData = (char *)afs_osi_Alloc(abuffers * AFS_BUFFER_PAGESIZE); #endif timecounter = 1; afs_stats_cmperf.bufAlloced = nbuffers = abuffers; - for(i=0;ib_un.b_addr; + tub = geteblk(AFS_BUFFER_PAGESIZE * NPB); + BufferData = (char *)tub->b_un.b_addr; } #endif - /* Fill in each buffer with an empty indication. */ + /* Fill in each buffer with an empty indication. */ tb = &Buffers[i]; - dirp_Zap(tb->fid); - tb->accesstime = 0; + dirp_Zap(tb->fid); + tb->accesstime = 0; tb->lockers = 0; #if AFS_USEBUFFERS - if ((i & (NPB-1)) == 0) + if ((i & (NPB - 1)) == 0) tb->bufp = tub; else tb->bufp = 0; - tb->data = &BufferData[AFS_BUFFER_PAGESIZE * (i&(NPB-1))]; + tb->data = &BufferData[AFS_BUFFER_PAGESIZE * (i & (NPB - 1))]; #else - tb->data = &BufferData[AFS_BUFFER_PAGESIZE*i]; + tb->data = &BufferData[AFS_BUFFER_PAGESIZE * i]; #endif tb->hashIndex = 0; - tb->dirty = 0; + tb->dirty = 0; RWLOCK_INIT(&tb->lock, "buffer lock"); } return; } -char *DRead(fid,page) - register ino_t *fid; - register int page; { +void * +DRead(register afs_inode_t * fid, register int page) +{ /* Read a page from the disk. */ register struct buffer *tb, *tb2; - void *tfile; - register afs_int32 code, *sizep; + struct osi_file *tfile; + int code; AFS_STATCNT(DRead); - MObtainWriteLock(&afs_bufferLock,256); + MObtainWriteLock(&afs_bufferLock, 256); -/* some new code added 1/1/92 */ #define bufmatch(tb) (tb->page == page && dirp_Eq(tb->fid, fid)) #define buf_Front(head,parent,p) {(parent)->hashNext = (p)->hashNext; (p)->hashNext= *(head);*(head)=(p);} @@ -182,47 +169,46 @@ char *DRead(fid,page) * of larger code size. This could be simplified by better use of * macros. */ - if ( tb = phTable[pHash(fid,page)] ) { /* ASSMT HERE */ + if ((tb = phTable[pHash(fid, page)])) { if (bufmatch(tb)) { - MObtainWriteLock(&tb->lock,257); + MObtainWriteLock(&tb->lock, 257); ReleaseWriteLock(&afs_bufferLock); tb->lockers++; tb->accesstime = timecounter++; AFS_STATS(afs_stats_cmperf.bufHits++); MReleaseWriteLock(&tb->lock); return tb->data; - } - else { - register struct buffer **bufhead; - bufhead = &( phTable[pHash(fid,page)] ); - while (tb2 = tb->hashNext) { - if (bufmatch(tb2)) { - buf_Front(bufhead,tb,tb2); - MObtainWriteLock(&tb2->lock,258); - ReleaseWriteLock(&afs_bufferLock); - tb2->lockers++; - tb2->accesstime = timecounter++; - AFS_STATS(afs_stats_cmperf.bufHits++); - MReleaseWriteLock(&tb2->lock); - return tb2->data; - } - if (tb = tb2->hashNext) { /* ASSIGNMENT HERE! */ - if (bufmatch(tb)) { - buf_Front(bufhead,tb2,tb); - MObtainWriteLock(&tb->lock,259); - ReleaseWriteLock(&afs_bufferLock); - tb->lockers++; - tb->accesstime = timecounter++; - AFS_STATS(afs_stats_cmperf.bufHits++); - MReleaseWriteLock(&tb->lock); - return tb->data; - } + } else { + register struct buffer **bufhead; + bufhead = &(phTable[pHash(fid, page)]); + while ((tb2 = tb->hashNext)) { + if (bufmatch(tb2)) { + buf_Front(bufhead, tb, tb2); + MObtainWriteLock(&tb2->lock, 258); + ReleaseWriteLock(&afs_bufferLock); + tb2->lockers++; + tb2->accesstime = timecounter++; + AFS_STATS(afs_stats_cmperf.bufHits++); + MReleaseWriteLock(&tb2->lock); + return tb2->data; + } + if ((tb = tb2->hashNext)) { + if (bufmatch(tb)) { + buf_Front(bufhead, tb2, tb); + MObtainWriteLock(&tb->lock, 259); + ReleaseWriteLock(&afs_bufferLock); + tb->lockers++; + tb->accesstime = timecounter++; + AFS_STATS(afs_stats_cmperf.bufHits++); + MReleaseWriteLock(&tb->lock); + return tb->data; + } + } else + break; } - else break; - } } - } - else tb2 = NULL; + } else + tb2 = NULL; AFS_STATS(afs_stats_cmperf.bufMisses++); /* can't find it */ @@ -232,29 +218,29 @@ char *DRead(fid,page) */ tb = afs_newslot(fid, page, (tb ? tb : tb2)); if (!tb) { - MReleaseWriteLock(&afs_bufferLock); - return 0; + MReleaseWriteLock(&afs_bufferLock); + return NULL; } - MObtainWriteLock(&tb->lock,260); + MObtainWriteLock(&tb->lock, 260); MReleaseWriteLock(&afs_bufferLock); tb->lockers++; tfile = afs_CFileOpen(fid[0]); - sizep = (afs_int32 *)tfile; - if (page * AFS_BUFFER_PAGESIZE >= *sizep) { + if (page * AFS_BUFFER_PAGESIZE >= tfile->size) { dirp_Zap(tb->fid); tb->lockers--; MReleaseWriteLock(&tb->lock); afs_CFileClose(tfile); - return 0; + return NULL; } - code = afs_CFileRead(tfile, tb->page * AFS_BUFFER_PAGESIZE, - tb->data, AFS_BUFFER_PAGESIZE); + code = + afs_CFileRead(tfile, tb->page * AFS_BUFFER_PAGESIZE, tb->data, + AFS_BUFFER_PAGESIZE); afs_CFileClose(tfile); if (code < AFS_BUFFER_PAGESIZE) { dirp_Zap(tb->fid); tb->lockers--; MReleaseWriteLock(&tb->lock); - return 0; + return NULL; } /* Note that findslot sets the page field in the buffer equal to * what it is searching for. */ @@ -262,8 +248,9 @@ char *DRead(fid,page) return tb->data; } -static void FixupBucket(ap) - register struct buffer *ap; { +static void +FixupBucket(register struct buffer *ap) +{ register struct buffer **lp, *tp; register int i; /* first try to get it out of its current hash bucket, in which it @@ -271,7 +258,7 @@ static void FixupBucket(ap) AFS_STATCNT(FixupBucket); i = ap->hashIndex; lp = &phTable[i]; - for(tp = *lp; tp; tp=tp->hashNext) { + for (tp = *lp; tp; tp = tp->hashNext) { if (tp == ap) { *lp = tp->hashNext; break; @@ -279,22 +266,21 @@ static void FixupBucket(ap) lp = &tp->hashNext; } /* now figure the new hash bucket */ - i = pHash(ap->fid,ap->page); + i = pHash(ap->fid, ap->page); ap->hashIndex = i; /* remember where we are for deletion */ ap->hashNext = phTable[i]; /* add us to the list */ - phTable[i] = ap; /* at the front, since it's LRU */ + phTable[i] = ap; /* at the front, since it's LRU */ } -static struct buffer *afs_newslot (afid,apage,lp) - ino_t *afid; - afs_int32 apage; - register struct buffer *lp; /* pointer to a fairly-old buffer */ +/* lp is pointer to a fairly-old buffer */ +static struct buffer * +afs_newslot(afs_inode_t * afid, afs_int32 apage, register struct buffer *lp) { /* Find a usable buffer slot */ register afs_int32 i; afs_int32 lt; register struct buffer *tp; - void *tfile; + struct osi_file *tfile; AFS_STATCNT(afs_newslot); /* we take a pointer here to a buffer which was at the end of an @@ -304,11 +290,10 @@ static struct buffer *afs_newslot (afid,apage,lp) * case" for loop below. */ if (lp && (lp->lockers == 0)) { - lt = lp->accesstime; - } - else { - lp = 0; - lt = BUF_TIME_MAX; + lt = lp->accesstime; + } else { + lp = 0; + lt = BUF_TIME_MAX; } /* timecounter might have wrapped, if machine is very very busy @@ -326,44 +311,43 @@ static struct buffer *afs_newslot (afid,apage,lp) * themselves back out after just a few more DReads. */ if (timecounter < 0) { - timecounter = 1; - tp = Buffers; - for (i=0;iaccesstime = 0; - if (!lp && !tp->lockers) /* one is as good as the rest, I guess */ - lp = tp; - } - } - else { - /* this is the typical case */ - tp = Buffers; - for (i=0;ilockers == 0) { - if (tp->accesstime < lt) { - lp = tp; - lt = tp->accesstime; - } + timecounter = 1; + tp = Buffers; + for (i = 0; i < nbuffers; i++, tp++) { + tp->accesstime = 0; + if (!lp && !tp->lockers) /* one is as good as the rest, I guess */ + lp = tp; + } + } else { + /* this is the typical case */ + tp = Buffers; + for (i = 0; i < nbuffers; i++, tp++) { + if (tp->lockers == 0) { + if (tp->accesstime < lt) { + lp = tp; + lt = tp->accesstime; + } + } } - } } if (lp == 0) { - /* There are no unlocked buffers -- this used to panic, but that - * seems extreme. To the best of my knowledge, all the callers - * of DRead are prepared to handle a zero return. Some of them - * just panic directly, but not all of them. */ - afs_warn ("all buffers locked"); - return 0; + /* There are no unlocked buffers -- this used to panic, but that + * seems extreme. To the best of my knowledge, all the callers + * of DRead are prepared to handle a zero return. Some of them + * just panic directly, but not all of them. */ + afs_warn("all buffers locked"); + return 0; } if (lp->dirty) { tfile = afs_CFileOpen(lp->fid[0]); - afs_CFileWrite(tfile, lp->page * AFS_BUFFER_PAGESIZE, - lp->data, AFS_BUFFER_PAGESIZE); - lp->dirty = 0; + afs_CFileWrite(tfile, lp->page * AFS_BUFFER_PAGESIZE, lp->data, + AFS_BUFFER_PAGESIZE); + lp->dirty = 0; afs_CFileClose(tfile); AFS_STATS(afs_stats_cmperf.bufFlushDirty++); - } + } /* Now fill in the header. */ dirp_Cpy(lp->fid, afid); /* set this */ @@ -374,9 +358,9 @@ static struct buffer *afs_newslot (afid,apage,lp) return lp; } -void DRelease (bp,flag) - register struct buffer *bp; - int flag; { +void +DRelease(register struct buffer *bp, int flag) +{ /* Release a buffer, specifying whether or not the buffer has been * modified by the locker. */ register int index; @@ -385,30 +369,34 @@ void DRelease (bp,flag) #endif AFS_STATCNT(DRelease); - if (!bp) return; + if (!bp) + return; #if AFS_USEBUFFERS /* look for buffer by scanning Unix buffers for appropriate address */ tp = Buffers; - for(index = 0; index < nbuffers; index += NPB, tp += NPB) { - if ((afs_int32)bp >= (afs_int32)tp->data - && (afs_int32)bp < (afs_int32)tp->data + AFS_BUFFER_PAGESIZE*NPB) { + for (index = 0; index < nbuffers; index += NPB, tp += NPB) { + if ((afs_int32) bp >= (afs_int32) tp->data + && (afs_int32) bp < + (afs_int32) tp->data + AFS_BUFFER_PAGESIZE * NPB) { /* we found the right range */ - index += ((afs_int32)bp - (afs_int32)tp->data) >> LOGPS; + index += ((afs_int32) bp - (afs_int32) tp->data) >> LOGPS; break; } } #else - index = (((char *)bp)-((char *)BufferData))>>LOGPS; + index = (((char *)bp) - ((char *)BufferData)) >> LOGPS; #endif bp = &(Buffers[index]); - MObtainWriteLock(&bp->lock,261); + MObtainWriteLock(&bp->lock, 261); bp->lockers--; - if (flag) bp->dirty=1; + if (flag) + bp->dirty = 1; MReleaseWriteLock(&bp->lock); } -DVOffset (ap) - register void *ap; { +int +DVOffset(register void *ap) +{ /* Return the byte within a file represented by a buffer pointer. */ register struct buffer *bp; register int index; @@ -416,23 +404,26 @@ DVOffset (ap) register struct buffer *tp; #endif AFS_STATCNT(DVOffset); - bp=ap; + bp = ap; #if AFS_USEBUFFERS /* look for buffer by scanning Unix buffers for appropriate address */ tp = Buffers; - for(index = 0; index < nbuffers; index += NPB, tp += NPB) { - if ((afs_int32)bp >= (afs_int32)tp->data && (afs_int32)bp < (afs_int32)tp->data + AFS_BUFFER_PAGESIZE*NPB) { + for (index = 0; index < nbuffers; index += NPB, tp += NPB) { + if ((afs_int32) bp >= (afs_int32) tp->data + && (afs_int32) bp < + (afs_int32) tp->data + AFS_BUFFER_PAGESIZE * NPB) { /* we found the right range */ - index += ((afs_int32)bp - (afs_int32)tp->data) >> LOGPS; + index += ((afs_int32) bp - (afs_int32) tp->data) >> LOGPS; break; } } #else - index = (((char *)bp)-((char *)BufferData))>>LOGPS; + index = (((char *)bp) - ((char *)BufferData)) >> LOGPS; #endif - if (index<0 || index >= nbuffers) return -1; + if (index < 0 || index >= nbuffers) + return -1; bp = &(Buffers[index]); - return AFS_BUFFER_PAGESIZE*bp->page+(int)(((char *)ap)-bp->data); + return AFS_BUFFER_PAGESIZE * bp->page + (int)(((char *)ap) - bp->data); } /* 1/1/91 - I've modified the hash function to take the page as well @@ -441,39 +432,41 @@ DVOffset (ap) * of the hash function. Oh well. This should use the list traversal * method of DRead... */ -void DZap (fid) - ino_t *fid; +void +DZap(afs_inode_t * fid) { register int i; /* Destroy all buffers pertaining to a particular fid. */ register struct buffer *tb; - + AFS_STATCNT(DZap); MObtainReadLock(&afs_bufferLock); - for (i=0;i<=PHPAGEMASK;i++) - for(tb=phTable[pHash(fid,i)]; tb; tb=tb->hashNext) - if (dirp_Eq(tb->fid,fid)) { - MObtainWriteLock(&tb->lock,262); - dirp_Zap(tb->fid); - tb->dirty = 0; - MReleaseWriteLock(&tb->lock); - } + for (i = 0; i <= PHPAGEMASK; i++) + for (tb = phTable[pHash(fid, i)]; tb; tb = tb->hashNext) + if (dirp_Eq(tb->fid, fid)) { + MObtainWriteLock(&tb->lock, 262); + dirp_Zap(tb->fid); + tb->dirty = 0; + MReleaseWriteLock(&tb->lock); + } MReleaseReadLock(&afs_bufferLock); } -void DFlush () { +void +DFlush(void) +{ /* Flush all the modified buffers. */ - register int i, code; + register int i; register struct buffer *tb; - void *tfile; + struct osi_file *tfile; AFS_STATCNT(DFlush); tb = Buffers; MObtainReadLock(&afs_bufferLock); - for(i=0;idirty) { - MObtainWriteLock(&tb->lock,263); + for (i = 0; i < nbuffers; i++, tb++) { + if (tb->dirty) { + MObtainWriteLock(&tb->lock, 263); tb->lockers++; MReleaseReadLock(&afs_bufferLock); if (tb->dirty) { @@ -491,26 +484,27 @@ void DFlush () { MReleaseReadLock(&afs_bufferLock); } -char *DNew (fid,page) - register int page; - register ino_t *fid; +void * +DNew(register afs_inode_t * fid, register int page) { /* Same as read, only do *not* even try to read the page, since it probably doesn't exist. */ register struct buffer *tb; AFS_STATCNT(DNew); - MObtainWriteLock(&afs_bufferLock,264); - if ((tb = afs_newslot(fid,page,NULL)) == 0) { + MObtainWriteLock(&afs_bufferLock, 264); + if ((tb = afs_newslot(fid, page, NULL)) == 0) { MReleaseWriteLock(&afs_bufferLock); return 0; } - MObtainWriteLock(&tb->lock,265); + MObtainWriteLock(&tb->lock, 265); MReleaseWriteLock(&afs_bufferLock); tb->lockers++; MReleaseWriteLock(&tb->lock); return tb->data; } -void shutdown_bufferpackage() { +void +shutdown_bufferpackage(void) +{ #if AFS_USEBUFFERS register struct buffer *tp; #endif @@ -521,25 +515,27 @@ void shutdown_bufferpackage() { /* Free all allocated Buffers and associated buffer pages */ DFlush(); if (afs_cold_shutdown) { - dinit_flag = 0; + dinit_flag = 0; #if !AFS_USEBUFFERS - afs_osi_Free(BufferData, nbuffers * AFS_BUFFER_PAGESIZE); + afs_osi_Free(BufferData, nbuffers * AFS_BUFFER_PAGESIZE); #else - tp = Buffers; - for (i=0; i < nbuffers; i+= NPB, tp += NPB) { - /* The following check shouldn't be necessary and it will be removed soon */ - if (!tp->bufp) - afs_warn("shutdown_bufferpackage: bufp == 0!! Shouldn't happen\n"); - else { - brelse(tp->bufp); - tp->bufp = 0; + tp = Buffers; + for (i = 0; i < nbuffers; i += NPB, tp += NPB) { + /* The following check shouldn't be necessary and it will be removed soon */ + if (!tp->bufp) + afs_warn + ("shutdown_bufferpackage: bufp == 0!! Shouldn't happen\n"); + else { + brelse(tp->bufp); + tp->bufp = 0; + } } - } #endif - afs_osi_Free(Buffers, nbuffers * sizeof(struct buffer)); - nbuffers = 0; - timecounter = 1; - for(i=0;i -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_call.c,v 1.1.1.17 2003/07/30 17:07:58 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.66 2004/04/12 16:04:31 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" -#include "../rx/rx_globals.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" +#include "rx/rx_globals.h" #if !defined(UKERNEL) && !defined(AFS_LINUX20_ENV) #include "net/if.h" #ifdef AFS_SGI62_ENV -#include "../h/hashing.h" +#include "h/hashing.h" #endif #if !defined(AFS_HPUX110_ENV) && !defined(AFS_DARWIN60_ENV) #include "netinet/in_var.h" #endif #endif /* !defined(UKERNEL) */ #ifdef AFS_LINUX22_ENV -#include "../h/smp_lock.h" +#include "h/smp_lock.h" #endif @@ -42,28 +43,35 @@ struct afsop_cell { }; char afs_zeros[AFS_ZEROS]; -char afs_rootVolumeName[64]=""; -struct afs_icl_set *afs_iclSetp = (struct afs_icl_set*)0; -struct afs_icl_set *afs_iclLongTermSetp = (struct afs_icl_set*)0; - -#if defined(AFS_GLOBAL_SUNLOCK) && !defined(AFS_HPUX_ENV) && !defined(AFS_AIX41_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) +char afs_rootVolumeName[64] = ""; +struct afs_icl_set *afs_iclSetp = (struct afs_icl_set *)0; +struct afs_icl_set *afs_iclLongTermSetp = (struct afs_icl_set *)0; +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) kmutex_t afs_global_lock; kmutex_t afs_rxglobal_lock; +#endif #if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV) long afs_global_owner; #endif -#endif #if defined(AFS_OSF_ENV) simple_lock_data_t afs_global_lock; -#elif defined(AFS_DARWIN_ENV) +#endif + +#if defined(AFS_DARWIN_ENV) struct lock__bsd__ afs_global_lock; -#elif defined(AFS_FBSD_ENV) +#endif + +#if defined(AFS_XBSD_ENV) && !defined(AFS_FBSD50_ENV) struct lock afs_global_lock; struct proc *afs_global_owner; #endif +#ifdef AFS_FBSD50_ENV +struct mtx afs_global_mtx; +#endif + #if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) thread_t afs_global_owner; #endif /* AFS_OSF_ENV */ @@ -85,8 +93,11 @@ extern struct interfaceAddr afs_cb_interface; static int afs_RX_Running = 0; static int afs_InitSetup_done = 0; +afs_int32 afs_rx_deadtime = AFS_RXDEADTIME; +afs_int32 afs_rx_harddead = AFS_HARDDEADTIME; + static int -Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval); + Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval); #if defined(AFS_HPUX_ENV) extern int afs_vfs_mount(); @@ -95,13 +106,14 @@ extern int afs_vfs_mount(); /* This is code which needs to be called once when the first daemon enters * the client. A non-zero return means an error and AFS should not start. */ -static int afs_InitSetup(int preallocs) +static int +afs_InitSetup(int preallocs) { extern void afs_InitStats(); int code; if (afs_InitSetup_done) - return; + return EAGAIN; #ifndef AFS_NOSTATS /* @@ -111,7 +123,7 @@ static int afs_InitSetup(int preallocs) */ afs_InitStats(); #endif /* AFS_NOSTATS */ - + memset(afs_zeros, 0, AFS_ZEROS); /* start RX */ @@ -121,7 +133,7 @@ static int afs_InitSetup(int preallocs) printf("AFS: RX failed to initialize.\n"); return code; } - rx_SetRxDeadTime(AFS_RXDEADTIME); + rx_SetRxDeadTime(afs_rx_deadtime); /* resource init creates the services */ afs_ResourceInit(preallocs); @@ -130,239 +142,268 @@ static int afs_InitSetup(int preallocs) return code; } + #if defined(AFS_LINUX24_ENV) && defined(COMPLETION_H_EXISTS) struct afsd_thread_info { unsigned long parm; struct completion *complete; }; -static int afsd_thread(void *rock) { - struct afsd_thread_info *arg=rock; - unsigned long parm=arg->parm; +static int +afsd_thread(void *rock) +{ + struct afsd_thread_info *arg = rock; + unsigned long parm = arg->parm; #ifdef SYS_SETPRIORITY_EXPORTED - int (*sys_setpriority)(int,int,int) = sys_call_table[__NR_setpriority]; -#endif - daemonize(); /* doesn't do much, since we were forked from keventd, but - does call mm_release, which wakes up our parent (since it - used CLONE_VFORK) */ - reparent_to_init(); - afs_osi_MaskSignals(); - switch (parm) { - case AFSOP_START_RXCALLBACK: - sprintf(current->comm, "afs_cbstart"); - AFS_GLOCK(); - complete(arg->complete); - afs_CB_Running = 1; - while (afs_RX_Running != 2) - afs_osi_Sleep(&afs_RX_Running); - sprintf(current->comm, "afs_callback"); - afs_RXCallBackServer(); - AFS_GUNLOCK(); - complete_and_exit(0,0); - break; - case AFSOP_START_AFS: - sprintf(current->comm, "afs_afsstart"); - AFS_GLOCK(); - complete(arg->complete); - AFS_Running = 1; - while (afs_initState < AFSOP_START_AFS) - afs_osi_Sleep(&afs_initState); - DInit(AFS_MINBUFFERS); - afs_initState = AFSOP_START_BKG; - afs_osi_Wakeup(&afs_initState); - sprintf(current->comm, "afsd"); - afs_Daemon(); - AFS_GUNLOCK(); - complete_and_exit(0,0); - break; - case AFSOP_START_BKG: - sprintf(current->comm, "afs_bkgstart"); - AFS_GLOCK(); - complete(arg->complete); - while (afs_initState < AFSOP_START_BKG) - afs_osi_Sleep(&afs_initState); - if (afs_initState < AFSOP_GO) { - afs_initState = AFSOP_GO; - afs_osi_Wakeup(&afs_initState); - } - sprintf(current->comm, "afs_background"); - afs_BackgroundDaemon(); - AFS_GUNLOCK(); - complete_and_exit(0,0); - break; - case AFSOP_START_TRUNCDAEMON: - sprintf(current->comm, "afs_trimstart"); - AFS_GLOCK(); - complete(arg->complete); - while (afs_initState < AFSOP_GO) - afs_osi_Sleep(&afs_initState); - sprintf(current->comm, "afs_cachetrim"); - afs_CacheTruncateDaemon(); - AFS_GUNLOCK(); - complete_and_exit(0,0); - break; - case AFSOP_START_CS: - sprintf(current->comm, "afs_checkserver"); - AFS_GLOCK(); - complete(arg->complete); - afs_CheckServerDaemon(); - AFS_GUNLOCK(); - complete_and_exit(0,0); - break; - case AFSOP_RXEVENT_DAEMON: - sprintf(current->comm, "afs_evtstart"); + int (*sys_setpriority) (int, int, int) = sys_call_table[__NR_setpriority]; +#endif +#if defined(AFS_LINUX26_ENV) + daemonize("afsd"); +#else + daemonize(); +#endif + /* doesn't do much, since we were forked from keventd, but + * does call mm_release, which wakes up our parent (since it + * used CLONE_VFORK) */ +#if !defined(AFS_LINUX26_ENV) + reparent_to_init(); +#endif + afs_osi_MaskSignals(); + switch (parm) { + case AFSOP_START_RXCALLBACK: + sprintf(current->comm, "afs_cbstart"); + AFS_GLOCK(); + complete(arg->complete); + afs_CB_Running = 1; + while (afs_RX_Running != 2) + afs_osi_Sleep(&afs_RX_Running); + sprintf(current->comm, "afs_callback"); + afs_RXCallBackServer(); + AFS_GUNLOCK(); + complete_and_exit(0, 0); + break; + case AFSOP_START_AFS: + sprintf(current->comm, "afs_afsstart"); + AFS_GLOCK(); + complete(arg->complete); + AFS_Running = 1; + while (afs_initState < AFSOP_START_AFS) + afs_osi_Sleep(&afs_initState); + afs_initState = AFSOP_START_BKG; + afs_osi_Wakeup(&afs_initState); + sprintf(current->comm, "afsd"); + afs_Daemon(); + AFS_GUNLOCK(); + complete_and_exit(0, 0); + break; + case AFSOP_START_BKG: + sprintf(current->comm, "afs_bkgstart"); + AFS_GLOCK(); + complete(arg->complete); + while (afs_initState < AFSOP_START_BKG) + afs_osi_Sleep(&afs_initState); + if (afs_initState < AFSOP_GO) { + afs_initState = AFSOP_GO; + afs_osi_Wakeup(&afs_initState); + } + sprintf(current->comm, "afs_background"); + afs_BackgroundDaemon(); + AFS_GUNLOCK(); + complete_and_exit(0, 0); + break; + case AFSOP_START_TRUNCDAEMON: + sprintf(current->comm, "afs_trimstart"); + AFS_GLOCK(); + complete(arg->complete); + while (afs_initState < AFSOP_GO) + afs_osi_Sleep(&afs_initState); + sprintf(current->comm, "afs_cachetrim"); + afs_CacheTruncateDaemon(); + AFS_GUNLOCK(); + complete_and_exit(0, 0); + break; + case AFSOP_START_CS: + sprintf(current->comm, "afs_checkserver"); + AFS_GLOCK(); + complete(arg->complete); + afs_CheckServerDaemon(); + AFS_GUNLOCK(); + complete_and_exit(0, 0); + break; + case AFSOP_RXEVENT_DAEMON: + sprintf(current->comm, "afs_evtstart"); #ifdef SYS_SETPRIORITY_EXPORTED - sys_setpriority(PRIO_PROCESS,0,-10); + sys_setpriority(PRIO_PROCESS, 0, -10); #else #ifdef CURRENT_INCLUDES_NICE - current->nice=-10; -#endif -#endif - AFS_GLOCK(); - complete(arg->complete); - while (afs_initState < AFSOP_START_BKG) - afs_osi_Sleep(&afs_initState); - sprintf(current->comm, "afs_rxevent"); - afs_rxevent_daemon(); - AFS_GUNLOCK(); - complete_and_exit(0,0); - break; - case AFSOP_RXLISTENER_DAEMON: - sprintf(current->comm, "afs_lsnstart"); + current->nice = -10; +#endif +#endif + AFS_GLOCK(); + complete(arg->complete); + while (afs_initState < AFSOP_START_BKG) + afs_osi_Sleep(&afs_initState); + sprintf(current->comm, "afs_rxevent"); + afs_rxevent_daemon(); + AFS_GUNLOCK(); + complete_and_exit(0, 0); + break; + case AFSOP_RXLISTENER_DAEMON: + sprintf(current->comm, "afs_lsnstart"); #ifdef SYS_SETPRIORITY_EXPORTED - sys_setpriority(PRIO_PROCESS,0,-10); + sys_setpriority(PRIO_PROCESS, 0, -10); #else #ifdef CURRENT_INCLUDES_NICE - current->nice=-10; -#endif -#endif - AFS_GLOCK(); - complete(arg->complete); - afs_initState = AFSOP_START_AFS; - afs_osi_Wakeup(&afs_initState); - afs_RX_Running = 2; - afs_osi_Wakeup(&afs_RX_Running); - afs_osi_RxkRegister(); - sprintf(current->comm, "afs_rxlistener"); - rxk_Listener(); - AFS_GUNLOCK(); - complete_and_exit(0,0); - break; - default: - printf("Unknown op %d in StartDaemon()\n"); - break; - } - return 0; + current->nice = -10; +#endif +#endif + AFS_GLOCK(); + complete(arg->complete); + afs_initState = AFSOP_START_AFS; + afs_osi_Wakeup(&afs_initState); + afs_RX_Running = 2; + afs_osi_Wakeup(&afs_RX_Running); + afs_osi_RxkRegister(); + sprintf(current->comm, "afs_rxlistener"); + rxk_Listener(); + AFS_GUNLOCK(); + complete_and_exit(0, 0); + break; + default: + printf("Unknown op %d in StartDaemon()\n"); + break; + } + return 0; } -void afsd_launcher(void *rock) { - if (!kernel_thread(afsd_thread,rock, CLONE_VFORK|SIGCHLD)) +void +afsd_launcher(void *rock) +{ + if (!kernel_thread(afsd_thread, rock, CLONE_VFORK | SIGCHLD)) printf("kernel_thread failed. afs startup will not complete\n"); } -void afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5, - long parm6) +void +afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5, + long parm6) { - int code; - DECLARE_COMPLETION(c); - struct tq_struct tq; - struct afsd_thread_info info; - if (parm == AFSOP_START_RXCALLBACK) { - if (afs_CB_Running) return; - } else if (parm == AFSOP_RXLISTENER_DAEMON) { - if (afs_RX_Running) return; - afs_RX_Running=1; - code = afs_InitSetup(parm2); - if (parm3) { - rx_enablePeerRPCStats(); - } - if (parm4) { - rx_enableProcessRPCStats(); - } - if (code) - return; - } else if (parm == AFSOP_START_AFS) { - if (AFS_Running) return; - } /* other functions don't need setup in the parent */ - info.complete=&c; - info.parm=parm; - tq.sync=0; - INIT_LIST_HEAD(&tq.list); - tq.routine=afsd_launcher; - tq.data=&info; - schedule_task(&tq); - AFS_GUNLOCK(); - /* we need to wait cause we passed stack pointers around.... */ - wait_for_completion(&c); - AFS_GLOCK(); + int code; + DECLARE_COMPLETION(c); +#if defined(AFS_LINUX26_ENV) + struct work_struct tq; +#else + struct tq_struct tq; +#endif + struct afsd_thread_info info; + if (parm == AFSOP_START_RXCALLBACK) { + if (afs_CB_Running) + return; + } else if (parm == AFSOP_RXLISTENER_DAEMON) { + if (afs_RX_Running) + return; + afs_RX_Running = 1; + code = afs_InitSetup(parm2); + if (parm3) { + rx_enablePeerRPCStats(); + } + if (parm4) { + rx_enableProcessRPCStats(); + } + if (code) + return; + } else if (parm == AFSOP_START_AFS) { + if (AFS_Running) + return; + } /* other functions don't need setup in the parent */ + info.complete = &c; + info.parm = parm; +#if defined(AFS_LINUX26_ENV) + INIT_WORK(&tq, afsd_launcher, &info); + schedule_work(&tq); +#else + tq.sync = 0; + INIT_LIST_HEAD(&tq.list); + tq.routine = afsd_launcher; + tq.data = &info; + schedule_task(&tq); +#endif + AFS_GUNLOCK(); + /* we need to wait cause we passed stack pointers around.... */ + wait_for_completion(&c); + AFS_GLOCK(); } #endif +/* leaving as is, probably will barf if we add prototypes here since it's likely being called +with partial list */ +int afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6) -long parm, parm2, parm3, parm4, parm5, parm6; + long parm, parm2, parm3, parm4, parm5, parm6; { afs_int32 code = 0; -#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - size_t bufferSize; +#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + size_t bufferSize; #else /* AFS_SGI61_ENV */ - u_int bufferSize; + u_int bufferSize; #endif /* AFS_SGI61_ENV */ AFS_STATCNT(afs_syscall_call); #ifdef AFS_SUN5_ENV - if (!afs_suser(CRED()) && (parm != AFSOP_GETMTU) + if (!afs_suser(CRED()) && (parm != AFSOP_GETMTU) && (parm != AFSOP_GETMASK)) { - /* only root can run this code */ + /* only root can run this code */ return (EACCES); #else if (!afs_suser() && (parm != AFSOP_GETMTU) && (parm != AFSOP_GETMASK)) { - /* only root can run this code */ -#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) + /* only root can run this code */ +#if defined(KERNEL_HAVE_UERROR) setuerror(EACCES); - return(EACCES); + return (EACCES); #else -#if defined(AFS_OSF_ENV) +#if defined(AFS_OSF_ENV) return EACCES; -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ return EPERM; -#endif +#endif /* AFS_OSF_ENV */ #endif #endif } AFS_GLOCK(); #if defined(AFS_LINUX24_ENV) && defined(COMPLETION_H_EXISTS) && !defined(UKERNEL) if (parm < AFSOP_ADDCELL || parm == AFSOP_RXEVENT_DAEMON - || parm == AFSOP_RXLISTENER_DAEMON) { - afs_DaemonOp(parm,parm2,parm3,parm4,parm5,parm6); + || parm == AFSOP_RXLISTENER_DAEMON) { + afs_DaemonOp(parm, parm2, parm3, parm4, parm5, parm6); } -#else +#else /* !(AFS_LINUX24_ENV && !UKERNEL) */ if (parm == AFSOP_START_RXCALLBACK) { - if (afs_CB_Running) goto out; + if (afs_CB_Running) + goto out; afs_CB_Running = 1; #ifndef RXK_LISTENER_ENV code = afs_InitSetup(parm2); - if (!code) -#endif /* RXK_LISTENER_ENV */ - { + if (!code) +#endif /* !RXK_LISTENER_ENV */ + { #ifdef RXK_LISTENER_ENV - while (afs_RX_Running != 2) - afs_osi_Sleep(&afs_RX_Running); -#else - afs_initState = AFSOP_START_AFS; - afs_osi_Wakeup(&afs_initState); + while (afs_RX_Running != 2) + afs_osi_Sleep(&afs_RX_Running); +#else /* !RXK_LISTENER_ENV */ + afs_initState = AFSOP_START_AFS; + afs_osi_Wakeup(&afs_initState); #endif /* RXK_LISTENER_ENV */ - afs_osi_Invisible(); - afs_RXCallBackServer(); - } -#ifdef AFS_SGI_ENV + afs_osi_Invisible(); + afs_RXCallBackServer(); + } +#ifdef AFS_SGI_ENV AFS_GUNLOCK(); exit(CLD_EXITED, code); -#endif +#endif /* AFS_SGI_ENV */ } #ifdef RXK_LISTENER_ENV else if (parm == AFSOP_RXLISTENER_DAEMON) { - if (afs_RX_Running) goto out; + if (afs_RX_Running) + goto out; afs_RX_Running = 1; code = afs_InitSetup(parm2); if (parm3) { @@ -379,20 +420,21 @@ long parm, parm2, parm3, parm4, parm5, parm6; afs_osi_Wakeup(&afs_RX_Running); #ifndef UKERNEL afs_osi_RxkRegister(); -#endif +#endif /* !UKERNEL */ rxk_Listener(); } #ifdef AFS_SGI_ENV AFS_GUNLOCK(); exit(CLD_EXITED, code); -#endif +#endif /* AFS_SGI_ENV */ } -#endif +#endif /* RXK_LISTENER_ENV */ else if (parm == AFSOP_START_AFS) { /* afs daemon */ - if (AFS_Running) goto out; + if (AFS_Running) + goto out; AFS_Running = 1; - while (afs_initState < AFSOP_START_AFS) + while (afs_initState < AFSOP_START_AFS) afs_osi_Sleep(&afs_initState); afs_initState = AFSOP_START_BKG; @@ -402,18 +444,16 @@ long parm, parm2, parm3, parm4, parm5, parm6; #ifdef AFS_SGI_ENV AFS_GUNLOCK(); exit(CLD_EXITED, 0); -#endif - } - else if (parm == AFSOP_START_CS) { +#endif /* AFS_SGI_ENV */ + } else if (parm == AFSOP_START_CS) { afs_osi_Invisible(); afs_CheckServerDaemon(); #ifdef AFS_SGI_ENV AFS_GUNLOCK(); exit(CLD_EXITED, 0); -#endif - } - else if (parm == AFSOP_START_BKG) { - while (afs_initState < AFSOP_START_BKG) +#endif /* AFS_SGI_ENV */ + } else if (parm == AFSOP_START_BKG) { + while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState); if (afs_initState < AFSOP_GO) { afs_initState = AFSOP_GO; @@ -421,19 +461,18 @@ long parm, parm2, parm3, parm4, parm5, parm6; } /* start the bkg daemon */ afs_osi_Invisible(); -#ifdef AFS_AIX32_ENV +#ifdef AFS_AIX32_ENV if (parm2) afs_BioDaemon(parm2); else -#endif +#endif /* AFS_AIX32_ENV */ afs_BackgroundDaemon(); #ifdef AFS_SGI_ENV AFS_GUNLOCK(); exit(CLD_EXITED, 0); -#endif - } - else if (parm == AFSOP_START_TRUNCDAEMON) { - while (afs_initState < AFSOP_GO) +#endif /* AFS_SGI_ENV */ + } else if (parm == AFSOP_START_TRUNCDAEMON) { + while (afs_initState < AFSOP_GO) afs_osi_Sleep(&afs_initState); /* start the bkg daemon */ afs_osi_Invisible(); @@ -441,87 +480,94 @@ long parm, parm2, parm3, parm4, parm5, parm6; #ifdef AFS_SGI_ENV AFS_GUNLOCK(); exit(CLD_EXITED, 0); -#endif +#endif /* AFS_SGI_ENV */ } #if defined(AFS_SUN5_ENV) || defined(RXK_LISTENER_ENV) else if (parm == AFSOP_RXEVENT_DAEMON) { - while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState); + while (afs_initState < AFSOP_START_BKG) + afs_osi_Sleep(&afs_initState); afs_osi_Invisible(); afs_rxevent_daemon(); #ifdef AFS_SGI_ENV AFS_GUNLOCK(); exit(CLD_EXITED, 0); -#endif +#endif /* AFS_SGI_ENV */ } -#endif -#endif +#endif /* AFS_SUN5_ENV || RXK_LISTENER_ENV */ +#endif /* AFS_LINUX24_ENV && !UKERNEL */ else if (parm == AFSOP_BASIC_INIT) { afs_int32 temp; while (!afs_InitSetup_done) afs_osi_Sleep(&afs_InitSetup_done); -#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - temp = AFS_MINBUFFERS; /* Should fix this soon */ +#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + temp = AFS_MINBUFFERS; /* Should fix this soon */ #else /* number of 2k buffers we could get from all of the buffer space */ - temp = ((afs_bufferpages * NBPG)>>11); - temp = temp>>2; /* don't take more than 25% (our magic parameter) */ + temp = ((afs_bufferpages * NBPG) >> 11); + temp = temp >> 2; /* don't take more than 25% (our magic parameter) */ if (temp < AFS_MINBUFFERS) - temp = AFS_MINBUFFERS; /* though we really should have this many */ + temp = AFS_MINBUFFERS; /* though we really should have this many */ #endif DInit(temp); afs_rootFid.Fid.Volume = 0; code = 0; - } - else if (parm == AFSOP_ADDCELL) { + } else if (parm == AFSOP_ADDCELL) { /* add a cell. Parameter 2 is 8 hosts (in net order), parm 3 is the null-terminated - name. Parameter 4 is the length of the name, including the null. Parm 5 is the - home cell flag (0x1 bit) and the nosuid flag (0x2 bit) */ - struct afsop_cell tcell; + * name. Parameter 4 is the length of the name, including the null. Parm 5 is the + * home cell flag (0x1 bit) and the nosuid flag (0x2 bit) */ + struct afsop_cell *tcell = afs_osi_Alloc(sizeof(struct afsop_cell)); - AFS_COPYIN((char *)parm2, (char *)tcell.hosts, sizeof(tcell.hosts), code); + AFS_COPYIN((char *)parm2, (char *)tcell->hosts, sizeof(tcell->hosts), + code); if (!code) { - if (parm4 > sizeof(tcell.cellName)) + if (parm4 > sizeof(tcell->cellName)) code = EFAULT; else { - AFS_COPYIN((char *)parm3, tcell.cellName, parm4, code); - if (!code) - afs_NewCell(tcell.cellName, tcell.hosts, parm5, - NULL, 0, 0, 0); + AFS_COPYIN((char *)parm3, tcell->cellName, parm4, code); + if (!code) + afs_NewCell(tcell->cellName, tcell->hosts, parm5, NULL, 0, + 0, 0); } } + afs_osi_Free(tcell, sizeof(struct afsop_cell)); } else if (parm == AFSOP_ADDCELL2) { - struct afsop_cell tcell; + struct afsop_cell *tcell = afs_osi_Alloc(sizeof(struct afsop_cell)); char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *lcnamep = 0; - char *tbuffer1 = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *cnamep = 0; + char *tbuffer1 = osi_AllocSmallSpace(AFS_SMALLOCSIZ); int cflags = parm4; #if 0 /* wait for basic init - XXX can't find any reason we need this? */ - while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState); + while (afs_initState < AFSOP_START_BKG) + afs_osi_Sleep(&afs_initState); #endif - AFS_COPYIN((char *)parm2, (char *)tcell.hosts, sizeof(tcell.hosts), code); + AFS_COPYIN((char *)parm2, (char *)tcell->hosts, sizeof(tcell->hosts), + code); if (!code) { - AFS_COPYINSTR((char *)parm3, tbuffer1, AFS_SMALLOCSIZ, &bufferSize, code); + AFS_COPYINSTR((char *)parm3, tbuffer1, AFS_SMALLOCSIZ, + &bufferSize, code); if (!code) { if (parm4 & 4) { - AFS_COPYINSTR((char *)parm5, tbuffer, AFS_SMALLOCSIZ, &bufferSize, code); + AFS_COPYINSTR((char *)parm5, tbuffer, AFS_SMALLOCSIZ, + &bufferSize, code); if (!code) { lcnamep = tbuffer; cflags |= CLinkedCell; } } if (!code) - afs_NewCell(tbuffer1, tcell.hosts, cflags, - lcnamep, 0, 0, 0); + code = + afs_NewCell(tbuffer1, tcell->hosts, cflags, lcnamep, + 0, 0, 0); } } + afs_osi_Free(tcell, sizeof(struct afsop_cell)); osi_FreeSmallSpace(tbuffer); osi_FreeSmallSpace(tbuffer1); - } - else if (parm == AFSOP_ADDCELLALIAS) { + } else if (parm == AFSOP_ADDCELLALIAS) { /* * Call arguments: * parm2 is the alias name @@ -530,103 +576,98 @@ long parm, parm2, parm3, parm4, parm5, parm6; char *aliasName = osi_AllocSmallSpace(AFS_SMALLOCSIZ); char *cellName = osi_AllocSmallSpace(AFS_SMALLOCSIZ); - AFS_COPYINSTR((char *)parm2, aliasName, AFS_SMALLOCSIZ, &bufferSize, code); - if (!code) AFS_COPYINSTR((char *)parm3, cellName, AFS_SMALLOCSIZ, &bufferSize, code); - if (!code) afs_NewCellAlias(aliasName, cellName); - + AFS_COPYINSTR((char *)parm2, aliasName, AFS_SMALLOCSIZ, &bufferSize, + code); + if (!code) + AFS_COPYINSTR((char *)parm3, cellName, AFS_SMALLOCSIZ, + &bufferSize, code); + if (!code) + afs_NewCellAlias(aliasName, cellName); osi_FreeSmallSpace(aliasName); osi_FreeSmallSpace(cellName); - } - else if (parm == AFSOP_SET_THISCELL) { + } else if (parm == AFSOP_SET_THISCELL) { /* * Call arguments: * parm2 is the primary cell name */ char *cell = osi_AllocSmallSpace(AFS_SMALLOCSIZ); - AFS_COPYINSTR((char *) parm2, cell, AFS_SMALLOCSIZ, &bufferSize, code); + AFS_COPYINSTR((char *)parm2, cell, AFS_SMALLOCSIZ, &bufferSize, code); if (!code) afs_SetPrimaryCell(cell); osi_FreeSmallSpace(cell); - } - else if (parm == AFSOP_CACHEINIT) { + } else if (parm == AFSOP_CACHEINIT) { struct afs_cacheParams cparms; - if (afs_CacheInit_Done) goto out; + if (afs_CacheInit_Done) + goto out; - AFS_COPYIN((char *)parm2, (caddr_t) &cparms, sizeof(cparms), code); + AFS_COPYIN((char *)parm2, (caddr_t) & cparms, sizeof(cparms), code); if (code) { -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined (AFS_SGI64_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - goto out; -#else +#if defined(KERNEL_HAVE_UERROR) setuerror(code); code = -1; - goto out; #endif + goto out; } afs_CacheInit_Done = 1; - { - struct afs_icl_log *logp; - /* initialize the ICL system */ - code = afs_icl_CreateLog("cmfx", 60*1024, &logp); - if (code == 0) - code = afs_icl_CreateSetWithFlags("cm", logp, - (struct icl_log *) 0, - ICL_CRSET_FLAG_DEFAULT_OFF, - &afs_iclSetp); - code = afs_icl_CreateSet("cmlongterm", logp, (struct icl_log*) 0, - &afs_iclLongTermSetp); - } + { + struct afs_icl_log *logp; + /* initialize the ICL system */ + code = afs_icl_CreateLog("cmfx", 60 * 1024, &logp); + if (code == 0) + code = + afs_icl_CreateSetWithFlags("cm", logp, NULL, + ICL_CRSET_FLAG_DEFAULT_OFF, + &afs_iclSetp); + code = + afs_icl_CreateSet("cmlongterm", logp, NULL, + &afs_iclLongTermSetp); + } afs_setTime = cparms.setTimeFlag; - code = afs_CacheInit(cparms.cacheScaches, - cparms.cacheFiles, - cparms.cacheBlocks, - cparms.cacheDcaches, - cparms.cacheVolumes, - cparms.chunkSize, - cparms.memCacheFlag, - cparms.inodes, - cparms.users); + code = + afs_CacheInit(cparms.cacheScaches, cparms.cacheFiles, + cparms.cacheBlocks, cparms.cacheDcaches, + cparms.cacheVolumes, cparms.chunkSize, + cparms.memCacheFlag, cparms.inodes, cparms.users); - } - else if (parm == AFSOP_CACHEINODE) { + } else if (parm == AFSOP_CACHEINODE) { ino_t ainode = parm2; /* wait for basic init */ - while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState); + while (afs_initState < AFSOP_START_BKG) + afs_osi_Sleep(&afs_initState); /* do it by inode */ #ifdef AFS_SGI62_ENV ainode = (ainode << 32) | (parm3 & 0xffffffff); #endif - code = afs_InitCacheFile((char *) 0, ainode); - } - else if (parm == AFSOP_ROOTVOLUME) { + code = afs_InitCacheFile(NULL, ainode); + } else if (parm == AFSOP_ROOTVOLUME) { /* wait for basic init */ - while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState); + while (afs_initState < AFSOP_START_BKG) + afs_osi_Sleep(&afs_initState); if (parm2) { - AFS_COPYINSTR((char *)parm2, afs_rootVolumeName, sizeof(afs_rootVolumeName), &bufferSize, code); - afs_rootVolumeName[sizeof(afs_rootVolumeName)-1] = 0; - } - else code = 0; - } - else if (parm == AFSOP_CACHEFILE || - parm == AFSOP_CACHEINFO || - parm == AFSOP_VOLUMEINFO || - parm == AFSOP_AFSLOG || - parm == AFSOP_CELLINFO) { + AFS_COPYINSTR((char *)parm2, afs_rootVolumeName, + sizeof(afs_rootVolumeName), &bufferSize, code); + afs_rootVolumeName[sizeof(afs_rootVolumeName) - 1] = 0; + } else + code = 0; + } else if (parm == AFSOP_CACHEFILE || parm == AFSOP_CACHEINFO + || parm == AFSOP_VOLUMEINFO || parm == AFSOP_AFSLOG + || parm == AFSOP_CELLINFO) { char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ); code = 0; - AFS_COPYINSTR((char *) parm2, tbuffer, AFS_SMALLOCSIZ, - &bufferSize, code); + AFS_COPYINSTR((char *)parm2, tbuffer, AFS_SMALLOCSIZ, &bufferSize, + code); if (code) { osi_FreeSmallSpace(tbuffer); goto out; } if (!code) { - tbuffer[AFS_SMALLOCSIZ-1] = '\0'; /* null-terminate the name */ + tbuffer[AFS_SMALLOCSIZ - 1] = '\0'; /* null-terminate the name */ /* We have the cache dir copied in. Call the cache init routine */ if (parm == AFSOP_CACHEFILE) code = afs_InitCacheFile(tbuffer, 0); @@ -638,85 +679,95 @@ long parm, parm2, parm3, parm4, parm5, parm6; code = afs_InitCellInfo(tbuffer); } osi_FreeSmallSpace(tbuffer); - } - else if (parm == AFSOP_GO) { + } else if (parm == AFSOP_GO) { /* the generic initialization calls come here. One parameter: should we do the - set-time operation on this workstation */ - if (afs_Go_Done) goto out; + * set-time operation on this workstation */ + if (afs_Go_Done) + goto out; afs_Go_Done = 1; - while (afs_initState < AFSOP_GO) afs_osi_Sleep(&afs_initState); + while (afs_initState < AFSOP_GO) + afs_osi_Sleep(&afs_initState); afs_initState = 101; afs_setTime = parm2; afs_osi_Wakeup(&afs_initState); #if (!defined(AFS_NONFSTRANS) && !defined(AFS_DEC_ENV)) || defined(AFS_AIX_IAUTH_ENV) afs_nfsclient_init(); #endif - printf("found %d non-empty cache files (%d%%).\n", afs_stats_cmperf.cacheFilesReused, - (100*afs_stats_cmperf.cacheFilesReused) / - (afs_stats_cmperf.cacheNumEntries?afs_stats_cmperf.cacheNumEntries : 1)); - } - else if (parm == AFSOP_ADVISEADDR) { + printf("found %d non-empty cache files (%d%%).\n", + afs_stats_cmperf.cacheFilesReused, + (100 * afs_stats_cmperf.cacheFilesReused) / + (afs_stats_cmperf.cacheNumEntries ? afs_stats_cmperf. + cacheNumEntries : 1)); + } else if (parm == AFSOP_ADVISEADDR) { /* pass in the host address to the rx package */ - afs_int32 count = parm2; - afs_int32 buffer[AFS_MAX_INTERFACE_ADDR]; - afs_int32 maskbuffer[AFS_MAX_INTERFACE_ADDR]; - afs_int32 mtubuffer[AFS_MAX_INTERFACE_ADDR]; - int i; - int code; - - if ( count > AFS_MAX_INTERFACE_ADDR ) { - code = ENOMEM; - count = AFS_MAX_INTERFACE_ADDR; + afs_int32 count = parm2; + afs_int32 *buffer = + afs_osi_Alloc(sizeof(afs_int32) * AFS_MAX_INTERFACE_ADDR); + afs_int32 *maskbuffer = + afs_osi_Alloc(sizeof(afs_int32) * AFS_MAX_INTERFACE_ADDR); + afs_int32 *mtubuffer = + afs_osi_Alloc(sizeof(afs_int32) * AFS_MAX_INTERFACE_ADDR); + int i; + int code; + + if (count > AFS_MAX_INTERFACE_ADDR) { + code = ENOMEM; + count = AFS_MAX_INTERFACE_ADDR; } - - AFS_COPYIN( (char *)parm3, (char *)buffer, count*sizeof(afs_int32), code); + + AFS_COPYIN((char *)parm3, (char *)buffer, count * sizeof(afs_int32), + code); if (parm4) - AFS_COPYIN((char *)parm4, (char *)maskbuffer, count*sizeof(afs_int32), code); + AFS_COPYIN((char *)parm4, (char *)maskbuffer, + count * sizeof(afs_int32), code); if (parm5) - AFS_COPYIN((char *)parm5, (char *)mtubuffer, count*sizeof(afs_int32), code); + AFS_COPYIN((char *)parm5, (char *)mtubuffer, + count * sizeof(afs_int32), code); afs_cb_interface.numberOfInterfaces = count; - for (i=0; i < count ; i++) { - afs_cb_interface.addr_in[i] = buffer[i]; -#ifdef AFS_USERSPACE_IP_ADDR - /* AFS_USERSPACE_IP_ADDR means we have no way of finding the - * machines IP addresses when in the kernel (the in_ifaddr - * struct is not available), so we pass the info in at - * startup. We also pass in the subnetmask and mtu size. The - * subnetmask is used when setting the rank: - * afsi_SetServerIPRank(); and the mtu size is used when - * finding the best mtu size. rxi_FindIfnet() is replaced - * with rxi_Findcbi(). - */ - afs_cb_interface.subnetmask[i] = (parm4 ? maskbuffer[i] : 0xffffffff); - afs_cb_interface.mtu[i] = (parm5 ? mtubuffer[i] : htonl(1500)); + for (i = 0; i < count; i++) { + afs_cb_interface.addr_in[i] = buffer[i]; +#ifdef AFS_USERSPACE_IP_ADDR + /* AFS_USERSPACE_IP_ADDR means we have no way of finding the + * machines IP addresses when in the kernel (the in_ifaddr + * struct is not available), so we pass the info in at + * startup. We also pass in the subnetmask and mtu size. The + * subnetmask is used when setting the rank: + * afsi_SetServerIPRank(); and the mtu size is used when + * finding the best mtu size. rxi_FindIfnet() is replaced + * with rxi_Findcbi(). + */ + afs_cb_interface.subnetmask[i] = + (parm4 ? maskbuffer[i] : 0xffffffff); + afs_cb_interface.mtu[i] = (parm5 ? mtubuffer[i] : htonl(1500)); #endif } afs_uuid_create(&afs_cb_interface.uuid); rxi_setaddr(buffer[0]); + afs_osi_Free(buffer, sizeof(afs_int32) * AFS_MAX_INTERFACE_ADDR); + afs_osi_Free(maskbuffer, sizeof(afs_int32) * AFS_MAX_INTERFACE_ADDR); + afs_osi_Free(mtubuffer, sizeof(afs_int32) * AFS_MAX_INTERFACE_ADDR); } - #ifdef AFS_SGI53_ENV else if (parm == AFSOP_NFSSTATICADDR) { - extern int (*nfs_rfsdisptab_v2)(); + extern int (*nfs_rfsdisptab_v2) (); nfs_rfsdisptab_v2 = (int (*)())parm2; - } - else if (parm == AFSOP_NFSSTATICADDR2) { - extern int (*nfs_rfsdisptab_v2)(); + } else if (parm == AFSOP_NFSSTATICADDR2) { + extern int (*nfs_rfsdisptab_v2) (); #ifdef _K64U64 - nfs_rfsdisptab_v2 = (int (*)())((parm2<<32) | (parm3 & 0xffffffff)); + nfs_rfsdisptab_v2 = (int (*)())((parm2 << 32) | (parm3 & 0xffffffff)); #else /* _K64U64 */ nfs_rfsdisptab_v2 = (int (*)())(parm3 & 0xffffffff); #endif /* _K64U64 */ } #if defined(AFS_SGI62_ENV) && !defined(AFS_SGI65_ENV) else if (parm == AFSOP_SBLOCKSTATICADDR2) { - extern int (*afs_sblockp)(); - extern void (*afs_sbunlockp)(); + extern int (*afs_sblockp) (); + extern void (*afs_sbunlockp) (); #ifdef _K64U64 - afs_sblockp = (int (*)())((parm2<<32) | (parm3 & 0xffffffff)); - afs_sbunlockp = (void (*)())((parm4<<32) | (parm5 & 0xffffffff)); -#else + afs_sblockp = (int (*)())((parm2 << 32) | (parm3 & 0xffffffff)); + afs_sbunlockp = (void (*)())((parm4 << 32) | (parm5 & 0xffffffff)); +#else afs_sblockp = (int (*)())(parm3 & 0xffffffff); afs_sbunlockp = (void (*)())(parm5 & 0xffffffff); #endif /* _K64U64 */ @@ -724,60 +775,45 @@ long parm, parm2, parm3, parm4, parm5, parm6; #endif /* AFS_SGI62_ENV && !AFS_SGI65_ENV */ #endif /* AFS_SGI53_ENV */ else if (parm == AFSOP_SHUTDOWN) { -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - extern struct mount *afs_globalVFS; -#else /* AFS_OSF_ENV */ - extern struct vfs *afs_globalVFS; -#endif afs_cold_shutdown = 0; - if (parm == 1) afs_cold_shutdown = 1; + if (parm == 1) + afs_cold_shutdown = 1; #ifndef AFS_DARWIN_ENV - if (afs_globalVFS != 0) { + if (afs_globalVFS != 0) { afs_warn("AFS isn't unmounted yet! Call aborted\n"); - code = EACCES; - } else + code = EACCES; + } else #endif - afs_shutdown(); - } - -#if ! defined(AFS_HPUX90_ENV) || defined(AFS_HPUX100_ENV) - else if (parm == AFSOP_AFS_VFSMOUNT) { + afs_shutdown(); + } else if (parm == AFSOP_AFS_VFSMOUNT) { #ifdef AFS_HPUX_ENV -#if defined(AFS_HPUX100_ENV) vfsmount(parm2, parm3, parm4, parm5); -#else - afs_vfs_mount(parm2, parm3, parm4, parm5); -#endif /* AFS_HPUX100_ENV */ #else /* defined(AFS_HPUX_ENV) */ -#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - code = EINVAL; +#if defined(KERNEL_HAVE_UERROR) + setuerror(EINVAL); #else - setuerror(EINVAL); + code = EINVAL; #endif #endif /* defined(AFS_HPUX_ENV) */ - } -#endif - else if (parm == AFSOP_CLOSEWAIT) { + } else if (parm == AFSOP_CLOSEWAIT) { afs_SynchronousCloses = 'S'; - } - else if (parm == AFSOP_GETMTU) { - afs_uint32 mtu = 0; + } else if (parm == AFSOP_GETMTU) { + afs_uint32 mtu = 0; #if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) #ifdef AFS_USERSPACE_IP_ADDR - afs_int32 i; - i = rxi_Findcbi(parm2); - mtu = ((i == -1) ? htonl(1500) : afs_cb_interface.mtu[i]); + afs_int32 i; + i = rxi_Findcbi(parm2); + mtu = ((i == -1) ? htonl(1500) : afs_cb_interface.mtu[i]); #else /* AFS_USERSPACE_IP_ADDR */ - struct ifnet *tifnp; - struct in_ifaddr *tifadp = (struct in_ifaddr *) 0; - extern struct ifnet *rxi_FindIfnet(); - - tifnp = rxi_FindIfnet(parm2, &tifadp); /* make iterative */ - mtu = (tifnp ? tifnp->if_mtu : htonl(1500)); + struct ifnet *tifnp; + + tifnp = rxi_FindIfnet(parm2, NULL); /* make iterative */ + mtu = (tifnp ? tifnp->if_mtu : htonl(1500)); #endif /* else AFS_USERSPACE_IP_ADDR */ #endif /* !AFS_SUN5_ENV */ - if (!code) - AFS_COPYOUT ((caddr_t)&mtu, (caddr_t)parm3, sizeof(afs_int32), code); + if (!code) + AFS_COPYOUT((caddr_t) & mtu, (caddr_t) parm3, sizeof(afs_int32), + code); #ifdef AFS_AIX32_ENV /* this is disabled for now because I can't figure out how to get access * to these kernel variables. It's only for supporting user-mode rx @@ -794,40 +830,28 @@ long parm, parm2, parm3, parm4, parm5, parm6; } } */ #endif /* AFS_AIX32_ENV */ - } - else if (parm == AFSOP_GETMASK) { /* parm2 == addr in net order */ - afs_uint32 mask = 0; + } else if (parm == AFSOP_GETMASK) { /* parm2 == addr in net order */ + afs_uint32 mask = 0; #if !defined(AFS_SUN5_ENV) #ifdef AFS_USERSPACE_IP_ADDR - afs_int32 i; - i = rxi_Findcbi(parm2); - if (i != -1) { - mask = afs_cb_interface.subnetmask[i]; - } else { - code = -1; - } + afs_int32 i; + i = rxi_Findcbi(parm2); + if (i != -1) { + mask = afs_cb_interface.subnetmask[i]; + } else { + code = -1; + } #else /* AFS_USERSPACE_IP_ADDR */ - struct ifnet *tifnp; -#ifdef AFS_DARWIN60_ENV - struct ifaddr *tifadp = (struct ifaddr *) 0; -#else - struct in_ifaddr *tifadp = (struct in_ifaddr *) 0; -#endif - extern struct ifnet *rxi_FindIfnet(); - tifnp = rxi_FindIfnet(parm2, &tifadp); /* make iterative */ - if (tifnp && tifadp) { -#ifdef AFS_DARWIN60_ENV - mask = ((struct sockaddr_in *)tifadp->ifa_netmask)->sin_addr.s_addr; -#else - mask = tifadp->ia_subnetmask; -#endif - } else { - code = -1; - } + struct ifnet *tifnp; + + tifnp = rxi_FindIfnet(parm2, &mask); /* make iterative */ + if (!tifnp) + code = -1; #endif /* else AFS_USERSPACE_IP_ADDR */ #endif /* !AFS_SUN5_ENV */ - if (!code) - AFS_COPYOUT ((caddr_t)&mask, (caddr_t)parm3, sizeof(afs_int32), code); + if (!code) + AFS_COPYOUT((caddr_t) & mask, (caddr_t) parm3, sizeof(afs_int32), + code); } #ifdef AFS_AFSDB_ENV else if (parm == AFSOP_AFSDB_HANDLER) { @@ -840,37 +864,39 @@ long parm, parm2, parm3, parm4, parm5, parm6; #ifndef UKERNEL afs_osi_MaskSignals(); #endif - AFS_COPYIN((afs_int32 *)parm2, cellname, cellLen, code); - AFS_COPYIN((afs_int32 *)parm3, kmsg, kmsgLen, code); + AFS_COPYIN((afs_int32 *) parm2, cellname, cellLen, code); + AFS_COPYIN((afs_int32 *) parm3, kmsg, kmsgLen, code); if (!code) { code = afs_AFSDBHandler(cellname, cellLen, kmsg); - if (*cellname == 1) *cellname = 0; + if (*cellname == 1) + *cellname = 0; if (code == -2) { /* Shutting down? */ *cellname = 1; code = 0; } } - if (!code) AFS_COPYOUT(cellname, (char *)parm2, cellLen, code); + if (!code) + AFS_COPYOUT(cellname, (char *)parm2, cellLen, code); afs_osi_Free(kmsg, kmsgLen); afs_osi_Free(cellname, cellLen); } #endif else if (parm == AFSOP_SET_DYNROOT) { code = afs_SetDynrootEnable(parm2); - } - else if (parm == AFSOP_SET_FAKESTAT) { - afs_fakestat_enable = parm2; - code = 0; - } - else - code = EINVAL; + } else if (parm == AFSOP_SET_FAKESTAT) { + afs_fakestat_enable = parm2; + code = 0; + } else if (parm == AFSOP_SET_BACKUPTREE) { + afs_bkvolpref = parm2; + } else + code = EINVAL; -out: - AFS_GUNLOCK(); + out: + AFS_GUNLOCK(); #ifdef AFS_LINUX20_ENV - return -code; + return -code; #else - return code; + return code; #endif } @@ -885,76 +911,80 @@ out: * THIS SHOULD BE CHANGED TO afs_syscall(), but requires * all the user-level calls to `syscall' to change. */ -syscall(syscall, p1, p2, p3, p4, p5, p6) { - register rval1=0, code; - register monster; - int retval=0; +syscall(syscall, p1, p2, p3, p4, p5, p6) +{ + register rval1 = 0, code; + register monster; + int retval = 0; #ifndef AFS_AIX41_ENV - extern lock_t kernel_lock; - monster = lockl(&kernel_lock, LOCK_SHORT); + extern lock_t kernel_lock; + monster = lockl(&kernel_lock, LOCK_SHORT); #endif /* !AFS_AIX41_ENV */ - AFS_STATCNT(syscall); - setuerror(0); - switch (syscall) { - case AFSCALL_CALL: - rval1 = afs_syscall_call(p1, p2, p3, p4, p5, p6); - break; + AFS_STATCNT(syscall); + setuerror(0); + switch (syscall) { + case AFSCALL_CALL: + rval1 = afs_syscall_call(p1, p2, p3, p4, p5, p6); + break; - case AFSCALL_SETPAG: - AFS_GLOCK(); - rval1 = afs_setpag(); - AFS_GUNLOCK(); - break; + case AFSCALL_SETPAG: + AFS_GLOCK(); + rval1 = afs_setpag(); + AFS_GUNLOCK(); + break; - case AFSCALL_PIOCTL: - AFS_GLOCK(); - rval1 = afs_syscall_pioctl(p1, p2, p3, p4); - AFS_GUNLOCK(); - break; + case AFSCALL_PIOCTL: + AFS_GLOCK(); + rval1 = afs_syscall_pioctl(p1, p2, p3, p4); + AFS_GUNLOCK(); + break; - case AFSCALL_ICREATE: - rval1 = afs_syscall_icreate(p1, p2, p3, p4, p5, p6); - break; + case AFSCALL_ICREATE: + rval1 = afs_syscall_icreate(p1, p2, p3, p4, p5, p6); + break; - case AFSCALL_IOPEN: - rval1 = afs_syscall_iopen(p1, p2, p3); - break; + case AFSCALL_IOPEN: + rval1 = afs_syscall_iopen(p1, p2, p3); + break; - case AFSCALL_IDEC: - rval1 = afs_syscall_iincdec(p1, p2, p3, -1); - break; + case AFSCALL_IDEC: + rval1 = afs_syscall_iincdec(p1, p2, p3, -1); + break; - case AFSCALL_IINC: - rval1 = afs_syscall_iincdec(p1, p2, p3, 1); - break; + case AFSCALL_IINC: + rval1 = afs_syscall_iincdec(p1, p2, p3, 1); + break; - case AFSCALL_ICL: - AFS_GLOCK(); - code = Afscall_icl(p1, p2, p3, p4, p5, &retval); - AFS_GUNLOCK(); - if (!code) rval1 = retval; - if (!rval1) rval1 = code; - break; + case AFSCALL_ICL: + AFS_GLOCK(); + code = Afscall_icl(p1, p2, p3, p4, p5, &retval); + AFS_GUNLOCK(); + if (!code) + rval1 = retval; + if (!rval1) + rval1 = code; + break; - default: - rval1 = EINVAL; - setuerror(EINVAL); - break; - } + default: + rval1 = EINVAL; + setuerror(EINVAL); + break; + } - out: + out: #ifndef AFS_AIX41_ENV - if (monster != LOCK_NEST) - unlockl(&kernel_lock); + if (monster != LOCK_NEST) + unlockl(&kernel_lock); #endif /* !AFS_AIX41_ENV */ - return getuerror() ? -1 : rval1; + return getuerror()? -1 : rval1; } /* * lsetpag - interface to afs_setpag(). */ -lsetpag() { +lsetpag() +{ AFS_STATCNT(lsetpag); return syscall(AFSCALL_SETPAG, 0, 0, 0, 0, 0); @@ -964,57 +994,63 @@ lsetpag() { * lpioctl - interface to pioctl() */ lpioctl(path, cmd, cmarg, follow) -char *path, *cmarg; { + char *path, *cmarg; +{ AFS_STATCNT(lpioctl); return syscall(AFSCALL_PIOCTL, path, cmd, cmarg, follow); } -#else /* !AFS_AIX32_ENV */ +#else /* !AFS_AIX32_ENV */ #if defined(AFS_SGI_ENV) -struct afsargs -{ - sysarg_t syscall; - sysarg_t parm1; - sysarg_t parm2; - sysarg_t parm3; - sysarg_t parm4; - sysarg_t parm5; +struct afsargs { + sysarg_t syscall; + sysarg_t parm1; + sysarg_t parm2; + sysarg_t parm3; + sysarg_t parm4; + sysarg_t parm5; }; int -Afs_syscall (struct afsargs *uap, rval_t *rvp) +Afs_syscall(struct afsargs *uap, rval_t * rvp) { int error; long retval; AFS_STATCNT(afs_syscall); - switch(uap->syscall) { + switch (uap->syscall) { case AFSCALL_ICL: retval = 0; AFS_GLOCK(); - error=Afscall_icl(uap->parm1,uap->parm2,uap->parm3,uap->parm4,uap->parm5, &retval); + error = + Afscall_icl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, + uap->parm5, &retval); AFS_GUNLOCK(); rvp->r_val1 = retval; break; #ifdef AFS_SGI_XFS_IOPS_ENV case AFSCALL_IDEC64: - error = afs_syscall_idec64(uap->parm1, uap->parm2, uap->parm3, - uap->parm4, uap->parm5); + error = + afs_syscall_idec64(uap->parm1, uap->parm2, uap->parm3, uap->parm4, + uap->parm5); break; case AFSCALL_IINC64: - error = afs_syscall_iinc64(uap->parm1, uap->parm2, uap->parm3, - uap->parm4, uap->parm5); + error = + afs_syscall_iinc64(uap->parm1, uap->parm2, uap->parm3, uap->parm4, + uap->parm5); break; case AFSCALL_ILISTINODE64: - error = afs_syscall_ilistinode64(uap->parm1, uap->parm2, uap->parm3, - uap->parm4, uap->parm5); + error = + afs_syscall_ilistinode64(uap->parm1, uap->parm2, uap->parm3, + uap->parm4, uap->parm5); break; case AFSCALL_ICREATENAME64: - error = afs_syscall_icreatename64(uap->parm1, uap->parm2, uap->parm3, - uap->parm4, uap->parm5); + error = + afs_syscall_icreatename64(uap->parm1, uap->parm2, uap->parm3, + uap->parm4, uap->parm5); break; #endif #ifdef AFS_SGI_VNODE_GLUE @@ -1023,8 +1059,9 @@ Afs_syscall (struct afsargs *uap, rval_t *rvp) break; #endif default: - error = afs_syscall_call(uap->syscall, uap->parm1, uap->parm2, - uap->parm3, uap->parm4, uap->parm5); + error = + afs_syscall_call(uap->syscall, uap->parm1, uap->parm2, uap->parm3, + uap->parm4, uap->parm5); } return error; } @@ -1049,10 +1086,10 @@ struct iparam32 { static void iparam32_to_iparam(const struct iparam32 *src, struct iparam *dst) { - dst->param1 = src->param1; - dst->param2 = src->param2; - dst->param3 = src->param3; - dst->param4 = src->param4; + dst->param1 = src->param1; + dst->param2 = src->param2; + dst->param3 = src->param3; + dst->param4 = src->param4; } /* @@ -1063,53 +1100,54 @@ iparam32_to_iparam(const struct iparam32 *src, struct iparam *dst) static int copyin_iparam(caddr_t cmarg, struct iparam *dst) { - int code; + int code; #if defined(AFS_HPUX_64BIT_ENV) - struct iparam32 dst32; + struct iparam32 dst32; - if (is_32bit(u.u_procp)) /* is_32bit() in proc_iface.h */ - { - AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code); - if (!code) - iparam32_to_iparam(&dst32, dst); - return code; - } + if (is_32bit(u.u_procp)) { /* is_32bit() in proc_iface.h */ + AFS_COPYIN(cmarg, (caddr_t) & dst32, sizeof dst32, code); + if (!code) + iparam32_to_iparam(&dst32, dst); + return code; + } #endif /* AFS_HPUX_64BIT_ENV */ #if defined(AFS_SUN57_64BIT_ENV) - struct iparam32 dst32; + struct iparam32 dst32; - if (get_udatamodel() == DATAMODEL_ILP32) { - AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code); - if (!code) - iparam32_to_iparam(&dst32, dst); - return code; - } + if (get_udatamodel() == DATAMODEL_ILP32) { + AFS_COPYIN(cmarg, (caddr_t) & dst32, sizeof dst32, code); + if (!code) + iparam32_to_iparam(&dst32, dst); + return code; + } #endif /* AFS_SUN57_64BIT_ENV */ -#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) - struct iparam32 dst32; +#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV) + struct iparam32 dst32; #ifdef AFS_SPARC64_LINUX24_ENV - if (current->thread.flags & SPARC_FLAG_32BIT) + if (current->thread.flags & SPARC_FLAG_32BIT) #elif defined(AFS_SPARC64_LINUX20_ENV) - if (current->tss.flags & SPARC_FLAG_32BIT) + if (current->tss.flags & SPARC_FLAG_32BIT) #elif defined(AFS_AMD64_LINUX20_ENV) - if (current->thread.flags & THREAD_IA32) + if (current->thread.flags & THREAD_IA32) +#elif defined(AFS_PPC64_LINUX20_ENV) + if (current->thread.flags & PPC_FLAG_32BIT) #else #error Not done for this linux version -#endif - { - AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code); - if (!code) - iparam32_to_iparam(&dst32, dst); - return code; - } +#endif + { + AFS_COPYIN(cmarg, (caddr_t) & dst32, sizeof dst32, code); + if (!code) + iparam32_to_iparam(&dst32, dst); + return code; + } #endif /* AFS_LINUX_64BIT_KERNEL */ - AFS_COPYIN(cmarg, (caddr_t) dst, sizeof *dst, code); - return code; + AFS_COPYIN(cmarg, (caddr_t) dst, sizeof *dst, code); + return code; } /* Main entry of all afs system calls */ @@ -1143,28 +1181,31 @@ struct afssysa { }; #endif -Afs_syscall (uap, rvp) - register struct afssysa *uap; - rval_t *rvp; +Afs_syscall(register struct afssysa *uap, rval_t * rvp) { int *retval = &rvp->r_val1; #else /* AFS_SUN5_ENV */ -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +int afs3_syscall(p, args, retval) - struct proc *p; - void *args; - int *retval; +#ifdef AFS_FBSD50_ENV + struct thread *p; +#else + struct proc *p; +#endif + void *args; + int *retval; { register struct a { - long syscall; - long parm1; - long parm2; - long parm3; - long parm4; - long parm5; - long parm6; - } *uap = (struct a *)args; -#else /* AFS_OSF_ENV */ + long syscall; + long parm1; + long parm2; + long parm3; + long parm4; + long parm5; + long parm6; + } *uap = (struct a *)args; +#else /* AFS_OSF_ENV */ #ifdef AFS_LINUX20_ENV struct afssysargs { long syscall; @@ -1173,59 +1214,58 @@ struct afssysargs { long parm3; long parm4; long parm5; - long parm6; /* not actually used - should be removed */ + long parm6; /* not actually used - should be removed */ }; /* Linux system calls only set up for 5 arguments. */ -asmlinkage long afs_syscall(long syscall, long parm1, long parm2, long parm3, - long parm4) +asmlinkage long +afs_syscall(long syscall, long parm1, long parm2, long parm3, long parm4) { struct afssysargs args, *uap = &args; - long linux_ret=0; + long linux_ret = 0; long *retval = &linux_ret; - long eparm[4]; /* matches AFSCALL_ICL in fstrace.c */ + long eparm[4]; /* matches AFSCALL_ICL in fstrace.c */ #ifdef AFS_SPARC64_LINUX24_ENV afs_int32 eparm32[4]; #endif /* eparm is also used by AFSCALL_CALL in afsd.c */ #else #if defined(UKERNEL) -Afs_syscall () +Afs_syscall() { register struct a { - long syscall; - long parm1; - long parm2; - long parm3; - long parm4; - long parm5; - long parm6; - } *uap = (struct a *)u.u_ap; + long syscall; + long parm1; + long parm2; + long parm3; + long parm4; + long parm5; + long parm6; + } *uap = (struct a *)u.u_ap; #else /* UKERNEL */ +int #if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV) -afs_syscall () +afs_syscall() #else -Afs_syscall () -#endif /* SUN && !SUN5 */ +Afs_syscall() +#endif /* SUN && !SUN5 */ { register struct a { - long syscall; - long parm1; - long parm2; - long parm3; - long parm4; - long parm5; - long parm6; - } *uap = (struct a *)u.u_ap; + long syscall; + long parm1; + long parm2; + long parm3; + long parm4; + long parm5; + long parm6; + } *uap = (struct a *)u.u_ap; #endif /* UKERNEL */ #if defined(AFS_DEC_ENV) int *retval = &u.u_r.r_val1; -#else -#if defined(AFS_HPUX_ENV) +#elif defined(AFS_HPUX_ENV) long *retval = &u.u_rval1; #else int *retval = &u.u_rval1; #endif -#endif #endif /* AFS_LINUX20_ENV */ #endif /* AFS_OSF_ENV */ #endif /* AFS_SUN5_ENV */ @@ -1260,19 +1300,18 @@ Afs_syscall () if (current->thread.flags & SPARC_FLAG_32BIT) { - AFS_COPYIN((char*)parm4, (char*)eparm32, sizeof(eparm32), code); - eparm[0]=AA(eparm32[0]); - eparm[1]=AA(eparm32[1]); - eparm[2]=AA(eparm32[2]); + AFS_COPYIN((char *)parm4, (char *)eparm32, sizeof(eparm32), code); + eparm[0] = AA(eparm32[0]); + eparm[1] = AA(eparm32[1]); + eparm[2] = AA(eparm32[2]); #undef AA -} else + } else #endif - AFS_COPYIN((char*)parm4, (char*)eparm, sizeof(eparm), code); + AFS_COPYIN((char *)parm4, (char *)eparm, sizeof(eparm), code); uap->parm4 = eparm[0]; uap->parm5 = eparm[1]; uap->parm6 = eparm[2]; - } - else { + } else { uap->parm4 = parm4; uap->parm5 = 0; uap->parm6 = 0; @@ -1290,10 +1329,13 @@ Afs_syscall () #endif if (uap->syscall == AFSCALL_CALL) { #ifdef AFS_SUN5_ENV - code = afs_syscall_call(uap->parm1, uap->parm2, uap->parm3, - uap->parm4, uap->parm5, uap->parm6, rvp, CRED()); + code = + afs_syscall_call(uap->parm1, uap->parm2, uap->parm3, uap->parm4, + uap->parm5, uap->parm6, rvp, CRED()); #else - code = afs_syscall_call(uap->parm1, uap->parm2, uap->parm3, uap->parm4, uap->parm5, uap->parm6); + code = + afs_syscall_call(uap->parm1, uap->parm2, uap->parm3, uap->parm4, + uap->parm5, uap->parm6); #endif } else if (uap->syscall == AFSCALL_SETPAG) { #ifdef AFS_SUN5_ENV @@ -1301,27 +1343,35 @@ Afs_syscall () procp = ttoproc(curthread); AFS_GLOCK(); - code = afs_setpag(&procp->p_cred); + code = afs_setpag(&procp->p_cred); AFS_GUNLOCK(); #else AFS_GLOCK(); -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) code = afs_setpag(p, args, retval); -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ code = afs_setpag(); #endif AFS_GUNLOCK(); #endif } else if (uap->syscall == AFSCALL_PIOCTL) { AFS_GLOCK(); -#ifdef AFS_SUN5_ENV - code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, rvp, CRED()); -#else -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, p->p_cred->pc_ucred); +#if defined(AFS_SUN5_ENV) + code = + afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, + rvp, CRED()); +#elif defined(AFS_FBSD50_ENV) + code = + afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, + p->td_ucred); +#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + code = + afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, + p->p_cred->pc_ucred); #else - code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4); -#endif + code = + afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, + uap->parm4); #endif AFS_GUNLOCK(); } else if (uap->syscall == AFSCALL_ICREATE) { @@ -1329,67 +1379,79 @@ Afs_syscall () code = copyin_iparam((char *)uap->parm3, &iparams); if (code) { -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) +#if defined(KERNEL_HAVE_UERROR) setuerror(code); #endif } else #ifdef AFS_SUN5_ENV - code = afs_syscall_icreate(uap->parm1, uap->parm2, iparams.param1, iparams.param2, - iparams.param3, iparams.param4, rvp, CRED()); + code = + afs_syscall_icreate(uap->parm1, uap->parm2, iparams.param1, + iparams.param2, iparams.param3, + iparams.param4, rvp, CRED()); #else - code = afs_syscall_icreate(uap->parm1, uap->parm2, iparams.param1, iparams.param2, -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - iparams.param3, iparams.param4, retval); + code = + afs_syscall_icreate(uap->parm1, uap->parm2, iparams.param1, + iparams.param2, +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + iparams.param3, iparams.param4, retval); #else - iparams.param3, iparams.param4); + iparams.param3, iparams.param4); #endif -#endif /* AFS_SUN5_ENV */ +#endif /* AFS_SUN5_ENV */ } else if (uap->syscall == AFSCALL_IOPEN) { #ifdef AFS_SUN5_ENV - code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3, rvp, CRED()); + code = + afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3, rvp, + CRED()); #else -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3, retval); #else code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3); #endif -#endif /* AFS_SUN5_ENV */ +#endif /* AFS_SUN5_ENV */ } else if (uap->syscall == AFSCALL_IDEC) { #ifdef AFS_SUN5_ENV - code = afs_syscall_iincdec(uap->parm1, uap->parm2, uap->parm3, -1, rvp, CRED()); + code = + afs_syscall_iincdec(uap->parm1, uap->parm2, uap->parm3, -1, rvp, + CRED()); #else code = afs_syscall_iincdec(uap->parm1, uap->parm2, uap->parm3, -1); -#endif /* AFS_SUN5_ENV */ +#endif /* AFS_SUN5_ENV */ } else if (uap->syscall == AFSCALL_IINC) { #ifdef AFS_SUN5_ENV - code = afs_syscall_iincdec(uap->parm1, uap->parm2, uap->parm3, 1, rvp, CRED()); + code = + afs_syscall_iincdec(uap->parm1, uap->parm2, uap->parm3, 1, rvp, + CRED()); #else code = afs_syscall_iincdec(uap->parm1, uap->parm2, uap->parm3, 1); -#endif /* AFS_SUN5_ENV */ +#endif /* AFS_SUN5_ENV */ } else if (uap->syscall == AFSCALL_ICL) { AFS_GLOCK(); - code = Afscall_icl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, uap->parm5, retval); + code = + Afscall_icl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, + uap->parm5, retval); AFS_GUNLOCK(); #ifdef AFS_LINUX20_ENV if (!code) { /* ICL commands can return values. */ - code = -linux_ret; /* Gets negated again at exit below */ + code = -linux_ret; /* Gets negated again at exit below */ } #else - if (code) { -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) + if (code) { +#if defined(KERNEL_HAVE_UERROR) setuerror(code); #endif - } + } #endif /* !AFS_LINUX20_ENV */ } else { -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - code = EINVAL; +#if defined(KERNEL_HAVE_UERROR) + setuerror(EINVAL); #else - setuerror(EINVAL); -#endif /* AFS_SUN5_ENV */ + code = EINVAL; +#endif } -out: + #ifdef AFS_LINUX20_ENV code = -code; unlock_kernel(); @@ -1397,7 +1459,7 @@ out: return code; } #endif /* AFS_SGI_ENV */ -#endif /* !AFS_AIX32_ENV */ +#endif /* !AFS_AIX32_ENV */ /* * Initstate in the range 0 < x < 100 are early initialization states. @@ -1409,22 +1471,25 @@ out: * incorrectly. * Initstate of 300 means that the volume has been *successfully* looked up. */ -afs_CheckInit() { +int +afs_CheckInit(void) +{ register int code = 0; AFS_STATCNT(afs_CheckInit); if (afs_initState <= 100) - code = ENXIO; /* never finished init phase */ + code = ENXIO; /* never finished init phase */ else if (afs_initState == 101) { /* init done, wait for afs_daemon */ - while (afs_initState < 200) afs_osi_Sleep(&afs_initState); - } else if (afs_initState == 200) - code = ETIMEDOUT; /* didn't find root volume */ + while (afs_initState < 200) + afs_osi_Sleep(&afs_initState); + } else if (afs_initState == 200) + code = ETIMEDOUT; /* didn't find root volume */ return code; } -int afs_shuttingdown = 0; +int afs_shuttingdown = 0; void -afs_shutdown() +afs_shutdown(void) { extern short afs_brsDaemons; extern afs_int32 afs_CheckServerDaemonStarted; @@ -1432,11 +1497,14 @@ afs_shutdown() extern struct osi_file *afs_cacheInodep; AFS_STATCNT(afs_shutdown); - if (afs_shuttingdown) return; + if (afs_shuttingdown) + return; afs_shuttingdown = 1; - if (afs_cold_shutdown) afs_warn("COLD "); - else afs_warn("WARM "); - afs_warn("shutting down of: CB... "); + if (afs_cold_shutdown) + afs_warn("COLD "); + else + afs_warn("WARM "); + afs_warn("shutting down of: CB... "); afs_termState = AFSOP_STOP_RXCALLBACK; rx_WakeupServerProcs(); @@ -1464,7 +1532,7 @@ afs_shutdown() afs_warn("CTrunc... "); /* Cancel cache truncate daemon. */ while (afs_termState == AFSOP_STOP_TRUNCDAEMON) { - afs_osi_Wakeup((char*)&afs_CacheTruncateDaemon); + afs_osi_Wakeup((char *)&afs_CacheTruncateDaemon); afs_osi_Sleep(&afs_termState); } #ifdef AFS_AFSDB_ENV @@ -1475,38 +1543,40 @@ afs_shutdown() #endif #if defined(AFS_SUN5_ENV) || defined(RXK_LISTENER_ENV) afs_warn("RxEvent... "); - /* cancel rx event deamon */ - while (afs_termState == AFSOP_STOP_RXEVENT) + /* cancel rx event daemon */ + while (afs_termState == AFSOP_STOP_RXEVENT) afs_osi_Sleep(&afs_termState); #if defined(RXK_LISTENER_ENV) - afs_warn("RxListener... "); #ifndef UKERNEL + afs_warn("UnmaskRxkSignals... "); afs_osi_UnmaskRxkSignals(); #endif /* cancel rx listener */ - osi_StopListener(); /* This closes rx_socket. */ - while (afs_termState == AFSOP_STOP_RXK_LISTENER) + afs_warn("RxListener... "); + osi_StopListener(); /* This closes rx_socket. */ + while (afs_termState == AFSOP_STOP_RXK_LISTENER) { + afs_warn("Sleep... "); afs_osi_Sleep(&afs_termState); + } #endif #else - afs_termState = AFSOP_STOP_COMPLETE; + afs_termState = AFSOP_STOP_COMPLETE; #endif afs_warn("\n"); /* Close file only after daemons which can write to it are stopped. */ - if (afs_cacheInodep) /* memcache won't set this */ - { - osi_UFSClose(afs_cacheInodep); /* Since we always leave it open */ + if (afs_cacheInodep) { /* memcache won't set this */ + osi_UFSClose(afs_cacheInodep); /* Since we always leave it open */ afs_cacheInodep = 0; } - return; /* Just kill daemons for now */ + return; /* Just kill daemons for now */ #ifdef notdef - shutdown_CB(); + shutdown_CB(); shutdown_AFS(); shutdown_rxkernel(); - shutdown_rxevent(); + shutdown_rxevent(); shutdown_rx(); - afs_shutdown_BKG(); + afs_shutdown_BKG(); shutdown_bufferpackage(); shutdown_daemons(); shutdown_cache(); @@ -1535,21 +1605,25 @@ afs_shutdown() #endif } -shutdown_afstest() +void +shutdown_afstest(void) { AFS_STATCNT(shutdown_afstest); afs_initState = afs_termState = afs_setTime = 0; AFS_Running = afs_CB_Running = 0; afs_CacheInit_Done = afs_Go_Done = 0; if (afs_cold_shutdown) { - *afs_rootVolumeName = 0; + *afs_rootVolumeName = 0; } } /* In case there is a bunch of dynamically build bkg daemons to free */ -afs_shutdown_BKG() -{ AFS_STATCNT(shutdown_BKG); } +void +afs_shutdown_BKG(void) +{ + AFS_STATCNT(shutdown_BKG); +} #if defined(AFS_ALPHA_ENV) || defined(AFS_SGI61_ENV) @@ -1560,13 +1634,18 @@ int afs_icl_sizeofLong = 1; int afs_icl_sizeofLong = 2; #endif /* SGI62 */ #else +#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) +int afs_icl_sizeofLong = 2; +#else int afs_icl_sizeofLong = 1; #endif +#endif int afs_icl_inited = 0; /* init function, called once, under afs_icl_lock */ -afs_icl_Init() +int +afs_icl_Init(void) { afs_icl_inited = 1; return 0; @@ -1579,15 +1658,18 @@ extern struct afs_icl_set *afs_icl_FindSet(); static int Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval) { - register int i; afs_int32 *lp, elts, flags; register afs_int32 code; struct afs_icl_log *logp; struct afs_icl_set *setp; -#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) size_t temp; #else /* AFS_SGI61_ENV */ +#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) + afs_uint64 temp; +#else afs_uint32 temp; +#endif #endif /* AFS_SGI61_ENV */ char tname[65]; afs_int32 startCookie; @@ -1599,8 +1681,8 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval) return (EACCES); } #else - if (!afs_suser()) { /* only root can run this code */ -#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) + if (!afs_suser()) { /* only root can run this code */ +#if defined(KERNEL_HAVE_UERROR) setuerror(EACCES); return EACCES; #else @@ -1617,98 +1699,123 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval) * skip some records. */ AFS_COPYINSTR((char *)p1, tname, sizeof(tname), &temp, code); - if (code) return code; + if (code) + return code; AFS_COPYIN((char *)p4, (char *)&startCookie, sizeof(afs_int32), code); - if (code) return code; + if (code) + return code; logp = afs_icl_FindLog(tname); - if (!logp) return ENOENT; + if (!logp) + return ENOENT; #define BUFFERSIZE AFS_LRALLOCSIZ lp = (afs_int32 *) osi_AllocLargeSpace(AFS_LRALLOCSIZ); elts = BUFFERSIZE / sizeof(afs_int32); - if (p3 < elts) elts = p3; + if (p3 < elts) + elts = p3; flags = (opcode == ICL_OP_COPYOUT) ? 0 : ICL_COPYOUTF_CLRAFTERREAD; - code = afs_icl_CopyOut(logp, lp, &elts, (afs_uint32 *) &startCookie, - &flags); + code = + afs_icl_CopyOut(logp, lp, &elts, (afs_uint32 *) & startCookie, + &flags); if (code) { - osi_FreeLargeSpace((struct osi_buffer *) lp); + osi_FreeLargeSpace((struct osi_buffer *)lp); break; } AFS_COPYOUT((char *)lp, (char *)p2, elts * sizeof(afs_int32), code); - if (code) goto done; - AFS_COPYOUT((char *) &startCookie, (char *)p4, sizeof(afs_int32), code); - if (code) goto done; - *retval = (flags<<24) | (elts & 0xffffff); + if (code) + goto done; + AFS_COPYOUT((char *)&startCookie, (char *)p4, sizeof(afs_int32), + code); + if (code) + goto done; +#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) + if (!(IS64U)) + *retval = ((long)((flags << 24) | (elts & 0xffffff))) << 32; + else +#endif + *retval = (flags << 24) | (elts & 0xffffff); done: afs_icl_LogRele(logp); - osi_FreeLargeSpace((struct osi_buffer *) lp); + osi_FreeLargeSpace((struct osi_buffer *)lp); break; case ICL_OP_ENUMLOGS: /* enumerate logs */ /* enumerate logs: p1=index, p2=&name, p3=sizeof(name), p4=&size. * return 0 for success, otherwise error. */ - for(tlp = afs_icl_allLogs; tlp; tlp=tlp->nextp) { - if (p1-- == 0) break; + for (tlp = afs_icl_allLogs; tlp; tlp = tlp->nextp) { + if (p1-- == 0) + break; } - if (!tlp) return ENOENT; /* past the end of file */ - temp = strlen(tlp->name)+1; - if (temp > p3) return EINVAL; - AFS_COPYOUT(tlp->name, (char *) p2, temp, code); - if (!code) /* copy out size of log */ - AFS_COPYOUT((char *)&tlp->logSize, (char *)p4, sizeof (afs_int32), code); + if (!tlp) + return ENOENT; /* past the end of file */ + temp = strlen(tlp->name) + 1; + if (temp > p3) + return EINVAL; + AFS_COPYOUT(tlp->name, (char *)p2, temp, code); + if (!code) /* copy out size of log */ + AFS_COPYOUT((char *)&tlp->logSize, (char *)p4, sizeof(afs_int32), + code); break; case ICL_OP_ENUMLOGSBYSET: /* enumerate logs by set name */ /* enumerate logs: p1=setname, p2=index, p3=&name, p4=sizeof(name). * return 0 for success, otherwise error. */ - AFS_COPYINSTR((char *)p1, tname, sizeof (tname), &temp, code); - if (code) return code; + AFS_COPYINSTR((char *)p1, tname, sizeof(tname), &temp, code); + if (code) + return code; setp = afs_icl_FindSet(tname); - if (!setp) return ENOENT; + if (!setp) + return ENOENT; if (p2 > ICL_LOGSPERSET) return EINVAL; if (!(tlp = setp->logs[p2])) return EBADF; - temp = strlen(tlp->name)+1; - if (temp > p4) return EINVAL; + temp = strlen(tlp->name) + 1; + if (temp > p4) + return EINVAL; AFS_COPYOUT(tlp->name, (char *)p3, temp, code); break; - case ICL_OP_CLRLOG: /* clear specified log */ + case ICL_OP_CLRLOG: /* clear specified log */ /* zero out the specified log: p1=logname */ - AFS_COPYINSTR((char *)p1, tname, sizeof (tname), &temp, code); - if (code) return code; + AFS_COPYINSTR((char *)p1, tname, sizeof(tname), &temp, code); + if (code) + return code; logp = afs_icl_FindLog(tname); - if (!logp) return ENOENT; + if (!logp) + return ENOENT; code = afs_icl_ZeroLog(logp); afs_icl_LogRele(logp); break; - case ICL_OP_CLRSET: /* clear specified set */ + case ICL_OP_CLRSET: /* clear specified set */ /* zero out the specified set: p1=setname */ - AFS_COPYINSTR((char *)p1, tname, sizeof (tname), &temp, code); - if (code) return code; + AFS_COPYINSTR((char *)p1, tname, sizeof(tname), &temp, code); + if (code) + return code; setp = afs_icl_FindSet(tname); - if (!setp) return ENOENT; + if (!setp) + return ENOENT; code = afs_icl_ZeroSet(setp); afs_icl_SetRele(setp); break; - case ICL_OP_CLRALL: /* clear all logs */ + case ICL_OP_CLRALL: /* clear all logs */ /* zero out all logs -- no args */ code = 0; - ObtainWriteLock(&afs_icl_lock,178); - for(tlp = afs_icl_allLogs; tlp; tlp=tlp->nextp) { + ObtainWriteLock(&afs_icl_lock, 178); + for (tlp = afs_icl_allLogs; tlp; tlp = tlp->nextp) { tlp->refCount++; /* hold this guy */ ReleaseWriteLock(&afs_icl_lock); /* don't clear persistent logs */ if ((tlp->states & ICL_LOGF_PERSISTENT) == 0) code = afs_icl_ZeroLog(tlp); - ObtainWriteLock(&afs_icl_lock,179); + ObtainWriteLock(&afs_icl_lock, 179); if (--tlp->refCount == 0) afs_icl_ZapLog(tlp); - if (code) break; + if (code) + break; } ReleaseWriteLock(&afs_icl_lock); break; @@ -1717,23 +1824,29 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval) /* enumerate sets: p1=index, p2=&name, p3=sizeof(name), p4=&states. * return 0 for success, otherwise error. */ - for(setp = afs_icl_allSets; setp; setp = setp->nextp) { - if (p1-- == 0) break; + for (setp = afs_icl_allSets; setp; setp = setp->nextp) { + if (p1-- == 0) + break; } - if (!setp) return ENOENT; /* past the end of file */ - temp = strlen(setp->name)+1; - if (temp > p3) return EINVAL; + if (!setp) + return ENOENT; /* past the end of file */ + temp = strlen(setp->name) + 1; + if (temp > p3) + return EINVAL; AFS_COPYOUT(setp->name, (char *)p2, temp, code); - if (!code) /* copy out size of log */ - AFS_COPYOUT((char *)&setp->states,(char *)p4, sizeof (afs_int32), code); + if (!code) /* copy out size of log */ + AFS_COPYOUT((char *)&setp->states, (char *)p4, sizeof(afs_int32), + code); break; case ICL_OP_SETSTAT: /* set status on a set */ /* activate the specified set: p1=setname, p2=op */ AFS_COPYINSTR((char *)p1, tname, sizeof(tname), &temp, code); - if (code) return code; + if (code) + return code; setp = afs_icl_FindSet(tname); - if (!setp) return ENOENT; + if (!setp) + return ENOENT; code = afs_icl_SetSetStat(setp, p2); afs_icl_SetRele(setp); break; @@ -1741,51 +1854,61 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval) case ICL_OP_SETSTATALL: /* set status on all sets */ /* activate the specified set: p1=op */ code = 0; - ObtainWriteLock(&afs_icl_lock,180); - for(setp = afs_icl_allSets; setp; setp=setp->nextp) { + ObtainWriteLock(&afs_icl_lock, 180); + for (setp = afs_icl_allSets; setp; setp = setp->nextp) { setp->refCount++; /* hold this guy */ ReleaseWriteLock(&afs_icl_lock); /* don't set states on persistent sets */ if ((setp->states & ICL_SETF_PERSISTENT) == 0) code = afs_icl_SetSetStat(setp, p1); - ObtainWriteLock(&afs_icl_lock,181); + ObtainWriteLock(&afs_icl_lock, 181); if (--setp->refCount == 0) afs_icl_ZapSet(setp); - if (code) break; + if (code) + break; } ReleaseWriteLock(&afs_icl_lock); break; - case ICL_OP_SETLOGSIZE: /* set size of log */ + case ICL_OP_SETLOGSIZE: /* set size of log */ /* set the size of the specified log: p1=logname, p2=size (in words) */ AFS_COPYINSTR((char *)p1, tname, sizeof(tname), &temp, code); - if (code) return code; + if (code) + return code; logp = afs_icl_FindLog(tname); - if (!logp) return ENOENT; + if (!logp) + return ENOENT; code = afs_icl_LogSetSize(logp, p2); afs_icl_LogRele(logp); break; - case ICL_OP_GETLOGINFO: /* get size of log */ + case ICL_OP_GETLOGINFO: /* get size of log */ /* zero out the specified log: p1=logname, p2=&logSize, p3=&allocated */ AFS_COPYINSTR((char *)p1, tname, sizeof(tname), &temp, code); - if (code) return code; + if (code) + return code; logp = afs_icl_FindLog(tname); - if (!logp) return ENOENT; + if (!logp) + return ENOENT; allocated = !!logp->datap; - AFS_COPYOUT((char *)&logp->logSize, (char *) p2, sizeof(afs_int32), code); + AFS_COPYOUT((char *)&logp->logSize, (char *)p2, sizeof(afs_int32), + code); if (!code) - AFS_COPYOUT((char *)&allocated, (char *) p3, sizeof(afs_int32), code); + AFS_COPYOUT((char *)&allocated, (char *)p3, sizeof(afs_int32), + code); afs_icl_LogRele(logp); break; - case ICL_OP_GETSETINFO: /* get state of set */ + case ICL_OP_GETSETINFO: /* get state of set */ /* zero out the specified set: p1=setname, p2=&state */ AFS_COPYINSTR((char *)p1, tname, sizeof(tname), &temp, code); - if (code) return code; + if (code) + return code; setp = afs_icl_FindSet(tname); - if (!setp) return ENOENT; - AFS_COPYOUT((char *)&setp->states, (char *) p2, sizeof(afs_int32), code); + if (!setp) + return ENOENT; + AFS_COPYOUT((char *)&setp->states, (char *)p2, sizeof(afs_int32), + code); afs_icl_SetRele(setp); break; @@ -1800,75 +1923,70 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval) afs_lock_t afs_icl_lock; /* exported routine: a 4 parameter event */ -afs_icl_Event4(setp, eventID, lAndT, p1, p2, p3, p4) - register struct afs_icl_set *setp; - afs_int32 eventID; - afs_int32 lAndT; - long p1, p2, p3, p4; +int +afs_icl_Event4(register struct afs_icl_set *setp, afs_int32 eventID, + afs_int32 lAndT, long p1, long p2, long p3, long p4) { - register struct afs_icl_log *logp; afs_int32 mask; register int i; register afs_int32 tmask; int ix; /* If things aren't init'ed yet (or the set is inactive), don't panic */ - if (!ICL_SETACTIVE(setp)) return; + if (!ICL_SETACTIVE(setp)) + return 0; AFS_ASSERT_GLOCK(); - mask = lAndT>>24 & 0xff; /* mask of which logs to log to */ + mask = lAndT >> 24 & 0xff; /* mask of which logs to log to */ ix = ICL_EVENTBYTE(eventID); ObtainReadLock(&setp->lock); if (setp->eventFlags[ix] & ICL_EVENTMASK(eventID)) { - for(i=0, tmask = 1; ilogs[i], eventID, lAndT & 0xffffff, - p1, p2, p3, p4); + p1, p2, p3, p4); } mask &= ~tmask; - if (mask == 0) break; /* break early */ + if (mask == 0) + break; /* break early */ } } ReleaseReadLock(&setp->lock); + return 0; } /* Next 4 routines should be implemented via var-args or something. * Whole purpose is to avoid compiler warnings about parameter # mismatches. * Otherwise, could call afs_icl_Event4 directly. */ -afs_icl_Event3(setp, eventID, lAndT, p1, p2, p3) - register struct afs_icl_set *setp; - afs_int32 eventID; - afs_int32 lAndT; - long p1, p2, p3; +int +afs_icl_Event3(register struct afs_icl_set *setp, afs_int32 eventID, + afs_int32 lAndT, long p1, long p2, long p3) { return afs_icl_Event4(setp, eventID, lAndT, p1, p2, p3, (long)0); } -afs_icl_Event2(setp, eventID, lAndT, p1, p2) - register struct afs_icl_set *setp; - afs_int32 eventID; - afs_int32 lAndT; - long p1, p2; +int +afs_icl_Event2(register struct afs_icl_set *setp, afs_int32 eventID, + afs_int32 lAndT, long p1, long p2) { return afs_icl_Event4(setp, eventID, lAndT, p1, p2, (long)0, (long)0); } -afs_icl_Event1(setp, eventID, lAndT, p1) - register struct afs_icl_set *setp; - afs_int32 eventID; - afs_int32 lAndT; - long p1; +int +afs_icl_Event1(register struct afs_icl_set *setp, afs_int32 eventID, + afs_int32 lAndT, long p1) { - return afs_icl_Event4(setp, eventID, lAndT, p1, (long)0, (long)0, (long)0); + return afs_icl_Event4(setp, eventID, lAndT, p1, (long)0, (long)0, + (long)0); } -afs_icl_Event0(setp, eventID, lAndT) - register struct afs_icl_set *setp; - afs_int32 eventID; - afs_int32 lAndT; +int +afs_icl_Event0(register struct afs_icl_set *setp, afs_int32 eventID, + afs_int32 lAndT) { - return afs_icl_Event4(setp, eventID, lAndT, (long)0, (long)0, (long)0, (long)0); + return afs_icl_Event4(setp, eventID, lAndT, (long)0, (long)0, (long)0, + (long)0); } struct afs_icl_log *afs_icl_allLogs = 0; @@ -1879,9 +1997,8 @@ struct afs_icl_log *afs_icl_allLogs = 0; * * Log must be write-locked. */ -static afs_icl_GetLogSpace(logp, minSpace) - register struct afs_icl_log *logp; - afs_int32 minSpace; +static void +afs_icl_GetLogSpace(register struct afs_icl_log *logp, afs_int32 minSpace) { register unsigned int tsize; @@ -1901,16 +2018,15 @@ static afs_icl_GetLogSpace(logp, minSpace) * log must be write-locked. */ #define ICL_CHARSPERLONG 4 -static afs_int32 afs_icl_AppendString(logp, astr) - struct afs_icl_log *logp; - char *astr; +static void +afs_icl_AppendString(struct afs_icl_log *logp, char *astr) { - char *op; /* ptr to char to write */ + char *op; /* ptr to char to write */ int tc; - register int bib; /* bytes in buffer */ + register int bib; /* bytes in buffer */ bib = 0; - op = (char *) &(logp->datap[logp->firstFree]); + op = (char *)&(logp->datap[logp->firstFree]); while (1) { tc = *astr++; *op++ = tc; @@ -1919,11 +2035,12 @@ static afs_int32 afs_icl_AppendString(logp, astr) bib = 0; if (++(logp->firstFree) >= logp->logSize) { logp->firstFree = 0; - op = (char *) &(logp->datap[0]); + op = (char *)&(logp->datap[0]); } logp->logElements++; } - if (tc == 0) break; + if (tc == 0) + break; } if (bib > 0) { /* if we've used this word at all, allocate it */ @@ -1935,7 +2052,6 @@ static afs_int32 afs_icl_AppendString(logp, astr) } /* add a long to the log, ignoring overflow (checked already) */ -#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) #define ICL_APPENDINT32(lp, x) \ MACRO_BEGIN \ (lp)->datap[(lp)->firstFree] = (x); \ @@ -1945,6 +2061,7 @@ static afs_int32 afs_icl_AppendString(logp, astr) (lp)->logElements++; \ MACRO_END +#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) #define ICL_APPENDLONG(lp, x) \ MACRO_BEGIN \ ICL_APPENDINT32((lp), ((x) >> 32) & 0xffffffffL); \ @@ -1952,25 +2069,17 @@ static afs_int32 afs_icl_AppendString(logp, astr) MACRO_END #else /* AFS_ALPHA_ENV */ -#define ICL_APPENDLONG(lp, x) \ - MACRO_BEGIN \ - (lp)->datap[(lp)->firstFree] = (x); \ - if (++((lp)->firstFree) >= (lp)->logSize) { \ - (lp)->firstFree = 0; \ - } \ - (lp)->logElements++; \ - MACRO_END -#define ICL_APPENDINT32(lp, x) ICL_APPENDLONG((lp), (x)) +#define ICL_APPENDLONG(lp, x) ICL_APPENDINT32((lp), (x)) #endif /* AFS_ALPHA_ENV */ /* routine to tell whether we're dealing with the address or the * object itself */ -afs_icl_UseAddr(type) - int type; +int +afs_icl_UseAddr(int type) { if (type == ICL_TYPE_HYPER || type == ICL_TYPE_STRING - || type == ICL_TYPE_FID) + || type == ICL_TYPE_FID || type == ICL_TYPE_INT64) return 1; else return 0; @@ -1981,11 +2090,9 @@ afs_icl_UseAddr(type) * pretty soon, anyway. The log must be unlocked. */ -afs_icl_AppendRecord(logp, op, types, p1, p2, p3, p4) - register struct afs_icl_log *logp; - afs_int32 op; - afs_int32 types; - long p1, p2, p3, p4; +void +afs_icl_AppendRecord(register struct afs_icl_log *logp, afs_int32 op, + afs_int32 types, long p1, long p2, long p3, long p4) { int rsize; /* record size in longs */ register int tsize; /* temp size */ @@ -2001,7 +2108,7 @@ afs_icl_AppendRecord(logp, op, types, p1, p2, p3, p4) t1 = types & 0x3f; osi_GetTime(&tv); /* It panics for solaris if inside */ - ObtainWriteLock(&logp->lock,182); + ObtainWriteLock(&logp->lock, 182); if (!logp->datap) { ReleaseWriteLock(&logp->lock); return; @@ -2011,23 +2118,24 @@ afs_icl_AppendRecord(logp, op, types, p1, p2, p3, p4) * change that often. This algorithm ticks over every 20 minutes * or so (1000 seconds). Write a timestamp record if it has. */ - if (tv.tv_sec - logp->lastTS > 1024) - { + if (tv.tv_sec - logp->lastTS > 1024) { /* the timer has wrapped -- write a timestamp record */ if (logp->logSize - logp->logElements <= 5) afs_icl_GetLogSpace(logp, 5); - ICL_APPENDINT32(logp, (afs_int32)(5<<24) + (ICL_TYPE_UNIXDATE<<18)); - ICL_APPENDINT32(logp, (afs_int32)ICL_INFO_TIMESTAMP); - ICL_APPENDINT32(logp, (afs_int32)0); /* use thread ID zero for clocks */ ICL_APPENDINT32(logp, - (afs_int32)(tv.tv_sec & 0x3ff) * 1000000 + tv.tv_usec); - ICL_APPENDINT32(logp, (afs_int32)tv.tv_sec); + (afs_int32) (5 << 24) + (ICL_TYPE_UNIXDATE << 18)); + ICL_APPENDINT32(logp, (afs_int32) ICL_INFO_TIMESTAMP); + ICL_APPENDINT32(logp, (afs_int32) 0); /* use thread ID zero for clocks */ + ICL_APPENDINT32(logp, + (afs_int32) (tv.tv_sec & 0x3ff) * 1000000 + + tv.tv_usec); + ICL_APPENDINT32(logp, (afs_int32) tv.tv_sec); logp->lastTS = tv.tv_sec; } - rsize = 4; /* base case */ + rsize = 4; /* base case */ if (t1) { /* compute size of parameter p1. Only tricky case is string. * In that case, we have to call strlen to get the string length. @@ -2060,95 +2168,179 @@ afs_icl_AppendRecord(logp, op, types, p1, p2, p3, p4) */ if (rsize > 255) { ReleaseWriteLock(&logp->lock); - return; /* log record too big to express */ + return; /* log record too big to express */ } if (logp->logSize - logp->logElements <= rsize) afs_icl_GetLogSpace(logp, rsize); ICL_APPENDINT32(logp, - (afs_int32)(rsize<<24) + (t1<<18) + (t2<<12) + (t3<<6) + t4); - ICL_APPENDINT32(logp, (afs_int32)op); - ICL_APPENDINT32(logp, (afs_int32)osi_ThreadUnique()); - ICL_APPENDINT32(logp, (afs_int32)(tv.tv_sec & 0x3ff) * 1000000 + tv.tv_usec); + (afs_int32) (rsize << 24) + (t1 << 18) + (t2 << 12) + + (t3 << 6) + t4); + ICL_APPENDINT32(logp, (afs_int32) op); + ICL_APPENDINT32(logp, (afs_int32) osi_ThreadUnique()); + ICL_APPENDINT32(logp, + (afs_int32) (tv.tv_sec & 0x3ff) * 1000000 + tv.tv_usec); if (t1) { /* marshall parameter 1 now */ if (t1 == ICL_TYPE_STRING) { - afs_icl_AppendString(logp, (char *) p1); - } - else if (t1 == ICL_TYPE_HYPER) { - ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p1)->high); - ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p1)->low); - } - else if (t1 == ICL_TYPE_FID) { - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p1)[0]); - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p1)[1]); - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p1)[2]); - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p1)[3]); + afs_icl_AppendString(logp, (char *)p1); + } else if (t1 == ICL_TYPE_HYPER) { + ICL_APPENDINT32(logp, + (afs_int32) ((struct afs_hyper_t *)p1)->high); + ICL_APPENDINT32(logp, + (afs_int32) ((struct afs_hyper_t *)p1)->low); + } else if (t1 == ICL_TYPE_INT64) { +#ifdef AFSLITTLE_ENDIAN +#ifdef AFS_64BIT_CLIENT + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[1]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[0]); +#else /* AFS_64BIT_CLIENT */ + ICL_APPENDINT32(logp, (afs_int32) p1); + ICL_APPENDINT32(logp, (afs_int32) 0); +#endif /* AFS_64BIT_CLIENT */ +#else /* AFSLITTLE_ENDIAN */ +#ifdef AFS_64BIT_CLIENT + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[0]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[1]); +#else /* AFS_64BIT_CLIENT */ + ICL_APPENDINT32(logp, (afs_int32) 0); + ICL_APPENDINT32(logp, (afs_int32) p1); +#endif /* AFS_64BIT_CLIENT */ +#endif /* AFSLITTLE_ENDIAN */ + } else if (t1 == ICL_TYPE_FID) { + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[0]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[1]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[2]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[3]); } -#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) +#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) else if (t1 == ICL_TYPE_INT32) - ICL_APPENDINT32(logp, (afs_int32)p1); + ICL_APPENDINT32(logp, (afs_int32) p1); #endif /* AFS_ALPHA_ENV */ - else ICL_APPENDLONG(logp, p1); + else + ICL_APPENDLONG(logp, p1); } if (t2) { /* marshall parameter 2 now */ - if (t2 == ICL_TYPE_STRING) afs_icl_AppendString(logp, (char *) p2); + if (t2 == ICL_TYPE_STRING) + afs_icl_AppendString(logp, (char *)p2); else if (t2 == ICL_TYPE_HYPER) { - ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p2)->high); - ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p2)->low); - } - else if (t2 == ICL_TYPE_FID) { - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p2)[0]); - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p2)[1]); - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p2)[2]); - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p2)[3]); + ICL_APPENDINT32(logp, + (afs_int32) ((struct afs_hyper_t *)p2)->high); + ICL_APPENDINT32(logp, + (afs_int32) ((struct afs_hyper_t *)p2)->low); + } else if (t2 == ICL_TYPE_INT64) { +#ifdef AFSLITTLE_ENDIAN +#ifdef AFS_64BIT_CLIENT + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[1]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[0]); +#else /* AFS_64BIT_CLIENT */ + ICL_APPENDINT32(logp, (afs_int32) p2); + ICL_APPENDINT32(logp, (afs_int32) 0); +#endif /* AFS_64BIT_CLIENT */ +#else /* AFSLITTLE_ENDIAN */ +#ifdef AFS_64BIT_CLIENT + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[0]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[1]); +#else /* AFS_64BIT_CLIENT */ + ICL_APPENDINT32(logp, (afs_int32) 0); + ICL_APPENDINT32(logp, (afs_int32) p2); +#endif /* AFS_64BIT_CLIENT */ +#endif /* AFSLITTLE_ENDIAN */ + } else if (t2 == ICL_TYPE_FID) { + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[0]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[1]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[2]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[3]); } -#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) +#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) else if (t2 == ICL_TYPE_INT32) - ICL_APPENDINT32(logp, (afs_int32)p2); + ICL_APPENDINT32(logp, (afs_int32) p2); #endif /* AFS_ALPHA_ENV */ - else ICL_APPENDLONG(logp, p2); + else + ICL_APPENDLONG(logp, p2); } if (t3) { /* marshall parameter 3 now */ - if (t3 == ICL_TYPE_STRING) afs_icl_AppendString(logp, (char *) p3); + if (t3 == ICL_TYPE_STRING) + afs_icl_AppendString(logp, (char *)p3); else if (t3 == ICL_TYPE_HYPER) { - ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p3)->high); - ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p3)->low); + ICL_APPENDINT32(logp, + (afs_int32) ((struct afs_hyper_t *)p3)->high); + ICL_APPENDINT32(logp, + (afs_int32) ((struct afs_hyper_t *)p3)->low); + } else if (t3 == ICL_TYPE_INT64) { +#ifdef AFSLITTLE_ENDIAN +#ifdef AFS_64BIT_CLIENT + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[1]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[0]); +#else /* AFS_64BIT_CLIENT */ + ICL_APPENDINT32(logp, (afs_int32) p3); + ICL_APPENDINT32(logp, (afs_int32) 0); +#endif /* AFS_64BIT_CLIENT */ +#else /* AFSLITTLE_ENDIAN */ +#ifdef AFS_64BIT_CLIENT + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[0]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[1]); +#else /* AFS_64BIT_CLIENT */ + ICL_APPENDINT32(logp, (afs_int32) 0); + ICL_APPENDINT32(logp, (afs_int32) p3); +#endif /* AFS_64BIT_CLIENT */ +#endif /* AFSLITTLE_ENDIAN */ + } else if (t3 == ICL_TYPE_FID) { + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[0]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[1]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[2]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[3]); } - else if (t3 == ICL_TYPE_FID) { - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p3)[0]); - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p3)[1]); - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p3)[2]); - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p3)[3]); - } -#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) +#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) else if (t3 == ICL_TYPE_INT32) - ICL_APPENDINT32(logp, (afs_int32)p3); + ICL_APPENDINT32(logp, (afs_int32) p3); #endif /* AFS_ALPHA_ENV */ - else ICL_APPENDLONG(logp, p3); + else + ICL_APPENDLONG(logp, p3); } if (t4) { /* marshall parameter 4 now */ - if (t4 == ICL_TYPE_STRING) afs_icl_AppendString(logp, (char *) p4); + if (t4 == ICL_TYPE_STRING) + afs_icl_AppendString(logp, (char *)p4); else if (t4 == ICL_TYPE_HYPER) { - ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p4)->high); - ICL_APPENDINT32(logp, (afs_int32)((struct afs_hyper_t *)p4)->low); - } - else if (t4 == ICL_TYPE_FID) { - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p4)[0]); - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p4)[1]); - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p4)[2]); - ICL_APPENDINT32(logp, (afs_int32)((afs_int32 *)p4)[3]); + ICL_APPENDINT32(logp, + (afs_int32) ((struct afs_hyper_t *)p4)->high); + ICL_APPENDINT32(logp, + (afs_int32) ((struct afs_hyper_t *)p4)->low); + } else if (t4 == ICL_TYPE_INT64) { +#ifdef AFSLITTLE_ENDIAN +#ifdef AFS_64BIT_CLIENT + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[1]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[0]); +#else /* AFS_64BIT_CLIENT */ + ICL_APPENDINT32(logp, (afs_int32) p4); + ICL_APPENDINT32(logp, (afs_int32) 0); +#endif /* AFS_64BIT_CLIENT */ +#else /* AFSLITTLE_ENDIAN */ +#ifdef AFS_64BIT_CLIENT + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[0]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[1]); +#else /* AFS_64BIT_CLIENT */ + ICL_APPENDINT32(logp, (afs_int32) 0); + ICL_APPENDINT32(logp, (afs_int32) p4); +#endif /* AFS_64BIT_CLIENT */ +#endif /* AFSLITTLE_ENDIAN */ + } else if (t4 == ICL_TYPE_FID) { + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[0]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[1]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[2]); + ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[3]); } -#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) +#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) else if (t4 == ICL_TYPE_INT32) - ICL_APPENDINT32(logp, (afs_int32)p4); + ICL_APPENDINT32(logp, (afs_int32) p4); #endif /* AFS_ALPHA_ENV */ - else ICL_APPENDLONG(logp, p4); + else + ICL_APPENDLONG(logp, p4); } ReleaseWriteLock(&logp->lock); } @@ -2156,37 +2348,34 @@ afs_icl_AppendRecord(logp, op, types, p1, p2, p3, p4) /* create a log with size logSize; return it in *outLogpp and tag * it with name "name." */ -afs_icl_CreateLog(name, logSize, outLogpp) - char *name; - afs_int32 logSize; - struct afs_icl_log **outLogpp; +int +afs_icl_CreateLog(char *name, afs_int32 logSize, + struct afs_icl_log **outLogpp) { - return afs_icl_CreateLogWithFlags(name, logSize, /*flags*/0, outLogpp); + return afs_icl_CreateLogWithFlags(name, logSize, /*flags */ 0, outLogpp); } /* create a log with size logSize; return it in *outLogpp and tag * it with name "name." 'flags' can be set to make the log unclearable. */ -afs_icl_CreateLogWithFlags(name, logSize, flags, outLogpp) - char *name; - afs_int32 logSize; - afs_uint32 flags; - struct afs_icl_log **outLogpp; +int +afs_icl_CreateLogWithFlags(char *name, afs_int32 logSize, afs_uint32 flags, + struct afs_icl_log **outLogpp) { register struct afs_icl_log *logp; /* add into global list under lock */ - ObtainWriteLock(&afs_icl_lock,183); - if (!afs_icl_inited) afs_icl_Init(); + ObtainWriteLock(&afs_icl_lock, 183); + if (!afs_icl_inited) + afs_icl_Init(); - for (logp = afs_icl_allLogs; logp; logp=logp->nextp) { + for (logp = afs_icl_allLogs; logp; logp = logp->nextp) { if (strcmp(logp->name, name) == 0) { /* found it already created, just return it */ logp->refCount++; *outLogpp = logp; - if (flags & ICL_CRLOG_FLAG_PERSISTENT) - { - ObtainWriteLock(&logp->lock,184); + if (flags & ICL_CRLOG_FLAG_PERSISTENT) { + ObtainWriteLock(&logp->lock, 184); logp->states |= ICL_LOGF_PERSISTENT; ReleaseWriteLock(&logp->lock); } @@ -2194,17 +2383,17 @@ afs_icl_CreateLogWithFlags(name, logSize, flags, outLogpp) return 0; } } - + logp = (struct afs_icl_log *) osi_AllocSmallSpace(sizeof(struct afs_icl_log)); - memset((caddr_t)logp, 0, sizeof(*logp)); + memset((caddr_t) logp, 0, sizeof(*logp)); logp->refCount = 1; - logp->name = osi_AllocSmallSpace(strlen(name)+1); + logp->name = osi_AllocSmallSpace(strlen(name) + 1); strcpy(logp->name, name); LOCK_INIT(&logp->lock, "logp lock"); logp->logSize = logSize; - logp->datap = (afs_int32 *)0; /* don't allocate it until we need it */ + logp->datap = NULL; /* don't allocate it until we need it */ if (flags & ICL_CRLOG_FLAG_PERSISTENT) logp->states |= ICL_LOGF_PERSISTENT; @@ -2223,20 +2412,17 @@ afs_icl_CreateLogWithFlags(name, logSize, flags, outLogpp) * in *flagsp. The flag ICL_COPYOUTF_MISSEDSOME is set if we can't * find the record with cookie value cookie. */ -afs_icl_CopyOut(logp, bufferp, bufSizep, cookiep, flagsp) - register struct afs_icl_log *logp; - afs_int32 *bufferp; - afs_int32 *bufSizep; - afs_uint32 *cookiep; - afs_int32 *flagsp; +int +afs_icl_CopyOut(register struct afs_icl_log *logp, afs_int32 * bufferp, + afs_int32 * bufSizep, afs_uint32 * cookiep, + afs_int32 * flagsp) { afs_int32 nwords; /* number of words to copy out */ afs_uint32 startCookie; /* first cookie to use */ - register afs_int32 i; afs_int32 outWords; /* words we've copied out */ afs_int32 inWords; /* max words to copy out */ - afs_int32 code; /* return code */ - afs_int32 ix; /* index we're copying from */ + afs_int32 code; /* return code */ + afs_int32 ix; /* index we're copying from */ afs_int32 outFlags; /* return flags */ afs_int32 inFlags; /* flags passed in */ afs_int32 end; @@ -2248,7 +2434,7 @@ afs_icl_CopyOut(logp, bufferp, bufSizep, cookiep, flagsp) inFlags = *flagsp; code = 0; - ObtainWriteLock(&logp->lock,185); + ObtainWriteLock(&logp->lock, 185); if (!logp->datap) { ReleaseWriteLock(&logp->lock); goto done; @@ -2258,7 +2444,7 @@ afs_icl_CopyOut(logp, bufferp, bufSizep, cookiep, flagsp) while (1) { /* (re-)compute where we should start */ if (startCookie < logp->baseCookie) { - if (startCookie) /* missed some output */ + if (startCookie) /* missed some output */ outFlags |= ICL_COPYOUTF_MISSEDSOME; /* skip to the first available record */ startCookie = logp->baseCookie; @@ -2267,14 +2453,15 @@ afs_icl_CopyOut(logp, bufferp, bufSizep, cookiep, flagsp) /* compute where we find the first element to copy out */ ix = logp->firstUsed + startCookie - logp->baseCookie; - if (ix >= logp->logSize) ix -= logp->logSize; + if (ix >= logp->logSize) + ix -= logp->logSize; /* if have some data now, break out and process it */ - if (startCookie - logp->baseCookie < logp->logElements) break; + if (startCookie - logp->baseCookie < logp->logElements) + break; /* At end of log, so clear it if we need to */ - if (inFlags & ICL_COPYOUTF_CLRAFTERREAD) - { + if (inFlags & ICL_COPYOUTF_CLRAFTERREAD) { logp->firstUsed = logp->firstFree = 0; logp->logElements = 0; } @@ -2287,7 +2474,7 @@ afs_icl_CopyOut(logp, bufferp, bufSizep, cookiep, flagsp) logp->states |= ICL_LOGF_WAITING; ReleaseWriteLock(&logp->lock); afs_osi_Sleep(&logp->lock); - ObtainWriteLock(&logp->lock,186); + ObtainWriteLock(&logp->lock, 186); } /* copy out data from ix to logSize or firstFree, depending * upon whether firstUsed <= firstFree (no wrap) or otherwise. @@ -2303,7 +2490,8 @@ afs_icl_CopyOut(logp, bufferp, bufSizep, cookiep, flagsp) if (end - ix < nwords) nwords = end - ix; if (nwords > 0) { - memcpy((char *) bufferp, (char *) &logp->datap[ix], sizeof(afs_int32) * nwords); + memcpy((char *)bufferp, (char *)&logp->datap[ix], + sizeof(afs_int32) * nwords); outWords += nwords; inWords -= nwords; bufferp += nwords; @@ -2314,8 +2502,8 @@ afs_icl_CopyOut(logp, bufferp, bufSizep, cookiep, flagsp) /* now, if active part of the log has wrapped, there's more stuff * starting at the head of the log. Copy out more from there. */ - if (logp->firstUsed > logp->firstFree - && ix < logp->firstFree && inWords > 0) { + if (logp->firstUsed > logp->firstFree && ix < logp->firstFree + && inWords > 0) { /* (more to) copy out from the wrapped section at the * start of the log. May get here even if didn't copy any * above, if the cookie points directly into the wrapped section. @@ -2323,7 +2511,8 @@ afs_icl_CopyOut(logp, bufferp, bufSizep, cookiep, flagsp) nwords = inWords; if (logp->firstFree - ix < nwords) nwords = logp->firstFree - ix; - memcpy((char *) bufferp, (char *) &logp->datap[ix], sizeof(afs_int32) * nwords); + memcpy((char *)bufferp, (char *)&logp->datap[ix], + sizeof(afs_int32) * nwords); outWords += nwords; inWords -= nwords; bufferp += nwords; @@ -2340,10 +2529,9 @@ afs_icl_CopyOut(logp, bufferp, bufSizep, cookiep, flagsp) } /* return basic parameter information about a log */ -afs_icl_GetLogParms(logp, maxSizep, curSizep) - struct afs_icl_log *logp; - afs_int32 *maxSizep; - afs_int32 *curSizep; +int +afs_icl_GetLogParms(struct afs_icl_log *logp, afs_int32 * maxSizep, + afs_int32 * curSizep) { ObtainReadLock(&logp->lock); *maxSizep = logp->logSize; @@ -2354,36 +2542,37 @@ afs_icl_GetLogParms(logp, maxSizep, curSizep) /* hold and release logs */ -afs_icl_LogHold(logp) - register struct afs_icl_log *logp; +int +afs_icl_LogHold(register struct afs_icl_log *logp) { - ObtainWriteLock(&afs_icl_lock,187); + ObtainWriteLock(&afs_icl_lock, 187); logp->refCount++; ReleaseWriteLock(&afs_icl_lock); return 0; } /* hold and release logs, called with lock already held */ -afs_icl_LogHoldNL(logp) - register struct afs_icl_log *logp; +int +afs_icl_LogHoldNL(register struct afs_icl_log *logp) { logp->refCount++; return 0; } /* keep track of how many sets believe the log itself is allocated */ -afs_icl_LogUse(logp) - register struct afs_icl_log *logp; +int +afs_icl_LogUse(register struct afs_icl_log *logp) { - ObtainWriteLock(&logp->lock,188); + ObtainWriteLock(&logp->lock, 188); if (logp->setCount == 0) { /* this is the first set actually using the log -- allocate it */ - if (logp->logSize == 0) { + if (logp->logSize == 0) { /* we weren't passed in a hint and it wasn't set */ logp->logSize = ICL_DEFAULT_LOGSIZE; } - logp->datap = (afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * logp->logSize); -#ifdef AFS_AIX32_ENV + logp->datap = + (afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * logp->logSize); +#ifdef KERNEL_HAVE_PIN pin((char *)logp->datap, sizeof(afs_int32) * logp->logSize); #endif } @@ -2393,46 +2582,45 @@ afs_icl_LogUse(logp) } /* decrement the number of real users of the log, free if possible */ -afs_icl_LogFreeUse(logp) - register struct afs_icl_log *logp; +int +afs_icl_LogFreeUse(register struct afs_icl_log *logp) { - ObtainWriteLock(&logp->lock,189); + ObtainWriteLock(&logp->lock, 189); if (--logp->setCount == 0) { - /* no more users -- free it (but keep log structure around)*/ + /* no more users -- free it (but keep log structure around) */ afs_osi_Free(logp->datap, sizeof(afs_int32) * logp->logSize); -#ifdef AFS_AIX32_ENV +#ifdef KERNEL_HAVE_PIN unpin((char *)logp->datap, sizeof(afs_int32) * logp->logSize); #endif logp->firstUsed = logp->firstFree = 0; logp->logElements = 0; - logp->datap = (afs_int32 *)0; + logp->datap = NULL; } ReleaseWriteLock(&logp->lock); return 0; } /* set the size of the log to 'logSize' */ -afs_icl_LogSetSize(logp, logSize) - register struct afs_icl_log *logp; - afs_int32 logSize; -{ - ObtainWriteLock(&logp->lock,190); +int +afs_icl_LogSetSize(register struct afs_icl_log *logp, afs_int32 logSize) +{ + ObtainWriteLock(&logp->lock, 190); if (!logp->datap) { /* nothing to worry about since it's not allocated */ logp->logSize = logSize; - } - else { + } else { /* reset log */ logp->firstUsed = logp->firstFree = 0; logp->logElements = 0; /* free and allocate a new one */ afs_osi_Free(logp->datap, sizeof(afs_int32) * logp->logSize); -#ifdef AFS_AIX32_ENV +#ifdef KERNEL_HAVE_PIN unpin((char *)logp->datap, sizeof(afs_int32) * logp->logSize); #endif - logp->datap = (afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * logSize); -#ifdef AFS_AIX32_ENV + logp->datap = + (afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * logSize); +#ifdef KERNEL_HAVE_PIN pin((char *)logp->datap, sizeof(afs_int32) * logSize); #endif logp->logSize = logSize; @@ -2443,29 +2631,29 @@ afs_icl_LogSetSize(logp, logSize) } /* free a log. Called with afs_icl_lock locked. */ -afs_icl_ZapLog(logp) - register struct afs_icl_log *logp; +int +afs_icl_ZapLog(register struct afs_icl_log *logp) { register struct afs_icl_log **lpp, *tp; - for(lpp = &afs_icl_allLogs, tp = *lpp; tp; lpp = &tp->nextp, tp = *lpp) { + for (lpp = &afs_icl_allLogs, tp = *lpp; tp; lpp = &tp->nextp, tp = *lpp) { if (tp == logp) { /* found the dude we want to remove */ *lpp = logp->nextp; osi_FreeSmallSpace(logp->name); osi_FreeSmallSpace(logp->datap); osi_FreeSmallSpace(logp); - break; /* won't find it twice */ + break; /* won't find it twice */ } } return 0; } /* do the release, watching for deleted entries */ -afs_icl_LogRele(logp) - register struct afs_icl_log *logp; +int +afs_icl_LogRele(register struct afs_icl_log *logp) { - ObtainWriteLock(&afs_icl_lock,191); + ObtainWriteLock(&afs_icl_lock, 191); if (--logp->refCount == 0 && (logp->states & ICL_LOGF_DELETED)) { afs_icl_ZapLog(logp); /* destroys logp's lock! */ } @@ -2474,8 +2662,8 @@ afs_icl_LogRele(logp) } /* do the release, watching for deleted entries, log already held */ -afs_icl_LogReleNL(logp) - register struct afs_icl_log *logp; +int +afs_icl_LogReleNL(register struct afs_icl_log *logp) { if (--logp->refCount == 0 && (logp->states & ICL_LOGF_DELETED)) { afs_icl_ZapLog(logp); /* destroys logp's lock! */ @@ -2484,10 +2672,10 @@ afs_icl_LogReleNL(logp) } /* zero out the log */ -afs_icl_ZeroLog(logp) - register struct afs_icl_log *logp; +int +afs_icl_ZeroLog(register struct afs_icl_log *logp) { - ObtainWriteLock(&logp->lock,192); + ObtainWriteLock(&logp->lock, 192); logp->firstUsed = logp->firstFree = 0; logp->logElements = 0; logp->baseCookie = 0; @@ -2496,10 +2684,10 @@ afs_icl_ZeroLog(logp) } /* free a log entry, and drop its reference count */ -afs_icl_LogFree(logp) - register struct afs_icl_log *logp; +int +afs_icl_LogFree(register struct afs_icl_log *logp) { - ObtainWriteLock(&logp->lock,193); + ObtainWriteLock(&logp->lock, 193); logp->states |= ICL_LOGF_DELETED; ReleaseWriteLock(&logp->lock); afs_icl_LogRele(logp); @@ -2507,12 +2695,12 @@ afs_icl_LogFree(logp) } /* find a log by name, returning it held */ -struct afs_icl_log *afs_icl_FindLog(name) - char *name; +struct afs_icl_log * +afs_icl_FindLog(char *name) { register struct afs_icl_log *tp; - ObtainWriteLock(&afs_icl_lock,194); - for(tp = afs_icl_allLogs; tp; tp=tp->nextp) { + ObtainWriteLock(&afs_icl_lock, 194); + for (tp = afs_icl_allLogs; tp; tp = tp->nextp) { if (strcmp(tp->name, name) == 0) { /* this is the dude we want */ tp->refCount++; @@ -2523,25 +2711,27 @@ struct afs_icl_log *afs_icl_FindLog(name) return tp; } -afs_icl_EnumerateLogs(aproc, arock) - int (*aproc)(); - char *arock; +int +afs_icl_EnumerateLogs(int (*aproc) + (char *name, char *arock, struct afs_icl_log * tp), + char *arock) { register struct afs_icl_log *tp; register afs_int32 code; code = 0; - ObtainWriteLock(&afs_icl_lock,195); - for(tp = afs_icl_allLogs; tp; tp=tp->nextp) { - tp->refCount++; /* hold this guy */ + ObtainWriteLock(&afs_icl_lock, 195); + for (tp = afs_icl_allLogs; tp; tp = tp->nextp) { + tp->refCount++; /* hold this guy */ ReleaseWriteLock(&afs_icl_lock); ObtainReadLock(&tp->lock); - code = (*aproc)(tp->name, arock, tp); + code = (*aproc) (tp->name, arock, tp); ReleaseReadLock(&tp->lock); - ObtainWriteLock(&afs_icl_lock,196); + ObtainWriteLock(&afs_icl_lock, 196); if (--tp->refCount == 0) afs_icl_ZapLog(tp); - if (code) break; + if (code) + break; } ReleaseWriteLock(&afs_icl_lock); return code; @@ -2549,14 +2739,13 @@ afs_icl_EnumerateLogs(aproc, arock) struct afs_icl_set *afs_icl_allSets = 0; -afs_icl_CreateSet(name, baseLogp, fatalLogp, outSetpp) - char *name; - struct afs_icl_log *baseLogp; - struct afs_icl_log *fatalLogp; - struct afs_icl_set **outSetpp; +int +afs_icl_CreateSet(char *name, struct afs_icl_log *baseLogp, + struct afs_icl_log *fatalLogp, + struct afs_icl_set **outSetpp) { return afs_icl_CreateSetWithFlags(name, baseLogp, fatalLogp, - /*flags*/0, outSetpp); + /*flags */ 0, outSetpp); } /* create a set, given pointers to base and fatal logs, if any. @@ -2565,27 +2754,25 @@ afs_icl_CreateSet(name, baseLogp, fatalLogp, outSetpp) * addds references from the new afs_icl_set. When the set is destroyed, * those references will be released. */ -afs_icl_CreateSetWithFlags(name, baseLogp, fatalLogp, flags, outSetpp) - char *name; - struct afs_icl_log *baseLogp; - struct afs_icl_log *fatalLogp; - afs_uint32 flags; - struct afs_icl_set **outSetpp; +int +afs_icl_CreateSetWithFlags(char *name, struct afs_icl_log *baseLogp, + struct afs_icl_log *fatalLogp, afs_uint32 flags, + struct afs_icl_set **outSetpp) { register struct afs_icl_set *setp; register int i; afs_int32 states = ICL_DEFAULT_SET_STATES; - ObtainWriteLock(&afs_icl_lock,197); - if (!afs_icl_inited) afs_icl_Init(); + ObtainWriteLock(&afs_icl_lock, 197); + if (!afs_icl_inited) + afs_icl_Init(); for (setp = afs_icl_allSets; setp; setp = setp->nextp) { if (strcmp(setp->name, name) == 0) { setp->refCount++; *outSetpp = setp; - if (flags & ICL_CRSET_FLAG_PERSISTENT) - { - ObtainWriteLock(&setp->lock,198); + if (flags & ICL_CRSET_FLAG_PERSISTENT) { + ObtainWriteLock(&setp->lock, 198); setp->states |= ICL_SETF_PERSISTENT; ReleaseWriteLock(&setp->lock); } @@ -2593,7 +2780,7 @@ afs_icl_CreateSetWithFlags(name, baseLogp, fatalLogp, flags, outSetpp) return 0; } } - + /* determine initial state */ if (flags & ICL_CRSET_FLAG_DEFAULT_ON) states = ICL_SETF_ACTIVE; @@ -2602,8 +2789,8 @@ afs_icl_CreateSetWithFlags(name, baseLogp, fatalLogp, flags, outSetpp) if (flags & ICL_CRSET_FLAG_PERSISTENT) states |= ICL_SETF_PERSISTENT; - setp = (struct afs_icl_set *) afs_osi_Alloc(sizeof(struct afs_icl_set)); - memset((caddr_t)setp, 0, sizeof(*setp)); + setp = (struct afs_icl_set *)afs_osi_Alloc(sizeof(struct afs_icl_set)); + memset((caddr_t) setp, 0, sizeof(*setp)); setp->refCount = 1; if (states & ICL_SETF_FREED) states &= ~ICL_SETF_ACTIVE; /* if freed, can't be active */ @@ -2614,15 +2801,15 @@ afs_icl_CreateSetWithFlags(name, baseLogp, fatalLogp, flags, outSetpp) * it doesn't matter, since no one can find this lock yet, since * the afs_icl_lock is still held, and thus the obtain can't block. */ - ObtainWriteLock(&setp->lock,199); - setp->name = osi_AllocSmallSpace(strlen(name)+1); + ObtainWriteLock(&setp->lock, 199); + setp->name = osi_AllocSmallSpace(strlen(name) + 1); strcpy(setp->name, name); setp->nevents = ICL_DEFAULTEVENTS; setp->eventFlags = afs_osi_Alloc(ICL_DEFAULTEVENTS); -#ifdef AFS_AIX32_ENV +#ifdef KERNEL_HAVE_PIN pin((char *)setp->eventFlags, ICL_DEFAULTEVENTS); #endif - for(i=0; ieventFlags[i] = 0xff; /* default to enabled */ /* update this global info under the afs_icl_lock */ @@ -2650,14 +2837,12 @@ afs_icl_CreateSetWithFlags(name, baseLogp, fatalLogp, flags, outSetpp) } /* function to change event enabling information for a particular set */ -afs_icl_SetEnable(setp, eventID, setValue) - struct afs_icl_set *setp; - afs_int32 eventID; - int setValue; +int +afs_icl_SetEnable(struct afs_icl_set *setp, afs_int32 eventID, int setValue) { char *tp; - ObtainWriteLock(&setp->lock,200); + ObtainWriteLock(&setp->lock, 200); if (!ICL_EVENTOK(setp, eventID)) { ReleaseWriteLock(&setp->lock); return -1; @@ -2675,10 +2860,8 @@ afs_icl_SetEnable(setp, eventID, setValue) * for tracing. If *getValuep is set to 0, the event is disabled, * otherwise it is enabled. All events start out enabled by default. */ -afs_icl_GetEnable(setp, eventID, getValuep) - struct afs_icl_set *setp; - afs_int32 eventID; - int *getValuep; +int +afs_icl_GetEnable(struct afs_icl_set *setp, afs_int32 eventID, int *getValuep) { ObtainReadLock(&setp->lock); if (!ICL_EVENTOK(setp, eventID)) { @@ -2694,48 +2877,48 @@ afs_icl_GetEnable(setp, eventID, getValuep) } /* hold and release event sets */ -afs_icl_SetHold(setp) - register struct afs_icl_set *setp; +int +afs_icl_SetHold(register struct afs_icl_set *setp) { - ObtainWriteLock(&afs_icl_lock,201); + ObtainWriteLock(&afs_icl_lock, 201); setp->refCount++; ReleaseWriteLock(&afs_icl_lock); return 0; } /* free a set. Called with afs_icl_lock locked */ -afs_icl_ZapSet(setp) - register struct afs_icl_set *setp; +int +afs_icl_ZapSet(register struct afs_icl_set *setp) { register struct afs_icl_set **lpp, *tp; int i; register struct afs_icl_log *tlp; - for(lpp = &afs_icl_allSets, tp = *lpp; tp; lpp = &tp->nextp, tp = *lpp) { + for (lpp = &afs_icl_allSets, tp = *lpp; tp; lpp = &tp->nextp, tp = *lpp) { if (tp == setp) { /* found the dude we want to remove */ *lpp = setp->nextp; osi_FreeSmallSpace(setp->name); afs_osi_Free(setp->eventFlags, ICL_DEFAULTEVENTS); -#ifdef AFS_AIX32_ENV +#ifdef KERNEL_HAVE_PIN unpin((char *)setp->eventFlags, ICL_DEFAULTEVENTS); #endif - for(i=0; i < ICL_LOGSPERSET; i++) { - if (tlp = setp->logs[i]) + for (i = 0; i < ICL_LOGSPERSET; i++) { + if ((tlp = setp->logs[i])) afs_icl_LogReleNL(tlp); } osi_FreeSmallSpace(setp); - break; /* won't find it twice */ + break; /* won't find it twice */ } } return 0; } /* do the release, watching for deleted entries */ -afs_icl_SetRele(setp) - register struct afs_icl_set *setp; +int +afs_icl_SetRele(register struct afs_icl_set *setp) { - ObtainWriteLock(&afs_icl_lock,202); + ObtainWriteLock(&afs_icl_lock, 202); if (--setp->refCount == 0 && (setp->states & ICL_SETF_DELETED)) { afs_icl_ZapSet(setp); /* destroys setp's lock! */ } @@ -2744,10 +2927,10 @@ afs_icl_SetRele(setp) } /* free a set entry, dropping its reference count */ -afs_icl_SetFree(setp) - register struct afs_icl_set *setp; +int +afs_icl_SetFree(register struct afs_icl_set *setp) { - ObtainWriteLock(&setp->lock,203); + ObtainWriteLock(&setp->lock, 203); setp->states |= ICL_SETF_DELETED; ReleaseWriteLock(&setp->lock); afs_icl_SetRele(setp); @@ -2755,12 +2938,12 @@ afs_icl_SetFree(setp) } /* find a set by name, returning it held */ -struct afs_icl_set *afs_icl_FindSet(name) - char *name; +struct afs_icl_set * +afs_icl_FindSet(char *name) { register struct afs_icl_set *tp; - ObtainWriteLock(&afs_icl_lock,204); - for(tp = afs_icl_allSets; tp; tp=tp->nextp) { + ObtainWriteLock(&afs_icl_lock, 204); + for (tp = afs_icl_allSets; tp; tp = tp->nextp) { if (strcmp(tp->name, name) == 0) { /* this is the dude we want */ tp->refCount++; @@ -2772,21 +2955,22 @@ struct afs_icl_set *afs_icl_FindSet(name) } /* zero out all the logs in the set */ -afs_icl_ZeroSet(setp) - struct afs_icl_set *setp; +int +afs_icl_ZeroSet(struct afs_icl_set *setp) { register int i; int code = 0; int tcode; struct afs_icl_log *logp; - + ObtainReadLock(&setp->lock); - for(i = 0; i < ICL_LOGSPERSET; i++) { + for (i = 0; i < ICL_LOGSPERSET; i++) { logp = setp->logs[i]; if (logp) { afs_icl_LogHold(logp); tcode = afs_icl_ZeroLog(logp); - if (tcode != 0) code = tcode; /* save the last bad one */ + if (tcode != 0) + code = tcode; /* save the last bad one */ afs_icl_LogRele(logp); } } @@ -2794,39 +2978,39 @@ afs_icl_ZeroSet(setp) return code; } -afs_icl_EnumerateSets(aproc, arock) - int (*aproc)(); - char *arock; +int +afs_icl_EnumerateSets(int (*aproc) + (char *name, char *arock, struct afs_icl_log * tp), + char *arock) { register struct afs_icl_set *tp, *np; register afs_int32 code; code = 0; - ObtainWriteLock(&afs_icl_lock,205); - for(tp = afs_icl_allSets; tp; tp=np) { - tp->refCount++; /* hold this guy */ + ObtainWriteLock(&afs_icl_lock, 205); + for (tp = afs_icl_allSets; tp; tp = np) { + tp->refCount++; /* hold this guy */ ReleaseWriteLock(&afs_icl_lock); - code = (*aproc)(tp->name, arock, tp); - ObtainWriteLock(&afs_icl_lock,206); - np = tp->nextp; /* tp may disappear next, but not np */ + code = (*aproc) (tp->name, arock, tp); + ObtainWriteLock(&afs_icl_lock, 206); + np = tp->nextp; /* tp may disappear next, but not np */ if (--tp->refCount == 0 && (tp->states & ICL_SETF_DELETED)) afs_icl_ZapSet(tp); - if (code) break; + if (code) + break; } ReleaseWriteLock(&afs_icl_lock); return code; } -afs_icl_AddLogToSet(setp, newlogp) - struct afs_icl_set *setp; - struct afs_icl_log *newlogp; +int +afs_icl_AddLogToSet(struct afs_icl_set *setp, struct afs_icl_log *newlogp) { register int i; int code = -1; - struct afs_icl_log *logp; - - ObtainWriteLock(&setp->lock,207); - for(i = 0; i < ICL_LOGSPERSET; i++) { + + ObtainWriteLock(&setp->lock, 207); + for (i = 0; i < ICL_LOGSPERSET; i++) { if (!setp->logs[i]) { setp->logs[i] = newlogp; code = i; @@ -2842,16 +3026,15 @@ afs_icl_AddLogToSet(setp, newlogp) return code; } -afs_icl_SetSetStat(setp, op) - struct afs_icl_set *setp; - int op; +int +afs_icl_SetSetStat(struct afs_icl_set *setp, int op) { int i; afs_int32 code; struct afs_icl_log *logp; - ObtainWriteLock(&setp->lock,208); - switch(op) { + ObtainWriteLock(&setp->lock, 208); + switch (op) { case ICL_OP_SS_ACTIVATE: /* activate a log */ /* * If we are not already active, see if we have released @@ -2861,7 +3044,7 @@ afs_icl_SetSetStat(setp, op) if (!(setp->states & ICL_SETF_ACTIVE)) { if (setp->states & ICL_SETF_FREED) { /* have to reassert desire for logs */ - for(i = 0; i < ICL_LOGSPERSET; i++) { + for (i = 0; i < ICL_LOGSPERSET; i++) { logp = setp->logs[i]; if (logp) { afs_icl_LogHold(logp); @@ -2891,7 +3074,7 @@ afs_icl_SetSetStat(setp, op) code = EINVAL; else { if (!(setp->states & ICL_SETF_FREED)) { - for(i = 0; i < ICL_LOGSPERSET; i++) { + for (i = 0; i < ICL_LOGSPERSET; i++) { logp = setp->logs[i]; if (logp) { afs_icl_LogHold(logp); @@ -2911,4 +3094,3 @@ afs_icl_SetSetStat(setp, op) ReleaseWriteLock(&setp->lock); return code; } - diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c index 9608523c6..dba98a250 100644 --- a/src/afs/afs_callback.c +++ b/src/afs/afs_callback.c @@ -14,36 +14,23 @@ */ #include -#include "../afs/param.h" - -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_callback.c,v 1.1.1.10 2003/04/13 19:02:34 hartmans Exp $"); - -#include "../afs/sysincludes.h" /*Standard vendor system headers*/ -#include "../afs/afsincludes.h" /*AFS-based standard headers*/ -#include "../afs/afs_stats.h" /*Cache Manager stats*/ -#include "../afs/afs_args.h" - -extern struct volume *afs_volumes[NVOLS]; /* volume hash table */ -extern void afs_DequeueCallback(); -extern void afs_ComputePAGStats(); -afs_int32 afs_allCBs = 0; /*Break callbacks on all objects */ -afs_int32 afs_oddCBs = 0; /*Break callbacks on dirs*/ -afs_int32 afs_evenCBs = 0; /*Break callbacks received on files*/ -afs_int32 afs_allZaps = 0; /*Objects entries deleted */ -afs_int32 afs_oddZaps = 0; /*Dir cache entries deleted*/ -afs_int32 afs_evenZaps = 0; /*File cache entries deleted*/ +#include "afs/param.h" + +RCSID + ("$Header: /cvs/openafs/src/afs/afs_callback.c,v 1.26 2004/04/16 04:57:01 kolya Exp $"); + +#include "afs/sysincludes.h" /*Standard vendor system headers */ +#include "afsincludes.h" /*AFS-based standard headers */ +#include "afs/afs_stats.h" /*Cache Manager stats */ +#include "afs/afs_args.h" + +afs_int32 afs_allCBs = 0; /*Break callbacks on all objects */ +afs_int32 afs_oddCBs = 0; /*Break callbacks on dirs */ +afs_int32 afs_evenCBs = 0; /*Break callbacks received on files */ +afs_int32 afs_allZaps = 0; /*Objects entries deleted */ +afs_int32 afs_oddZaps = 0; /*Dir cache entries deleted */ +afs_int32 afs_evenZaps = 0; /*File cache entries deleted */ afs_int32 afs_connectBacks = 0; -extern struct rx_service *afs_server; - -extern afs_lock_t afs_xvcb, afs_xbrs, afs_xdcache; -extern afs_rwlock_t afs_xvcache, afs_xserver, afs_xcell, afs_xuser; -extern afs_rwlock_t afs_xvolume, afs_puttofileLock, afs_ftf, afs_xinterface; -extern afs_rwlock_t afs_xconn; -extern struct afs_lock afs_xaxs; -extern afs_lock_t afs_xcbhash; -extern struct srvAddr *afs_srvAddrs[NSERVERS]; -extern struct afs_q CellLRU; -extern struct cm_initparams cm_initParams; /* * Some debugging aids. @@ -51,25 +38,32 @@ extern struct cm_initparams cm_initParams; static struct ltable { char *name; char *addr; -} ltable []= { - "afs_xvcache", (char *)&afs_xvcache, - "afs_xdcache", (char *)&afs_xdcache, - "afs_xserver", (char *)&afs_xserver, - "afs_xvcb", (char *)&afs_xvcb, - "afs_xbrs", (char *)&afs_xbrs, - "afs_xcell", (char *)&afs_xcell, - "afs_xconn", (char *)&afs_xconn, - "afs_xuser", (char *)&afs_xuser, - "afs_xvolume", (char *)&afs_xvolume, - "puttofile", (char *)&afs_puttofileLock, - "afs_ftf", (char *)&afs_ftf, - "afs_xcbhash", (char *)&afs_xcbhash, - "afs_xaxs", (char *)&afs_xaxs, - "afs_xinterface", (char *)&afs_xinterface, +} ltable[] = { + { + "afs_xvcache", (char *)&afs_xvcache}, { + "afs_xdcache", (char *)&afs_xdcache}, { + "afs_xserver", (char *)&afs_xserver}, { + "afs_xvcb", (char *)&afs_xvcb}, { + "afs_xbrs", (char *)&afs_xbrs}, { + "afs_xcell", (char *)&afs_xcell}, { + "afs_xconn", (char *)&afs_xconn}, { + "afs_xuser", (char *)&afs_xuser}, { + "afs_xvolume", (char *)&afs_xvolume}, { + "puttofile", (char *)&afs_puttofileLock}, { + "afs_ftf", (char *)&afs_ftf}, { + "afs_xcbhash", (char *)&afs_xcbhash}, { + "afs_xaxs", (char *)&afs_xaxs}, { + "afs_xinterface", (char *)&afs_xinterface}, +#ifndef UKERNEL + { + "afs_xosi", (char *)&afs_xosi}, +#endif + { + "afs_xsrvAddr", (char *)&afs_xsrvAddr} }; -unsigned long lastCallBack_vnode; -unsigned int lastCallBack_dv; -osi_timeval_t lastCallBack_time; +unsigned long lastCallBack_vnode; +unsigned int lastCallBack_dv; +osi_timeval_t lastCallBack_time; /* these are for storing alternate interface addresses */ struct interfaceAddr afs_cb_interface; @@ -97,21 +91,17 @@ struct interfaceAddr afs_cb_interface; * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_GetCE(a_call, a_index, a_result) - struct rx_call *a_call; - afs_int32 a_index; - struct AFSDBCacheEntry *a_result; - -{ /*SRXAFSCB_GetCE*/ +int +SRXAFSCB_GetCE(struct rx_call *a_call, afs_int32 a_index, + struct AFSDBCacheEntry *a_result) +{ - register int i; /*Loop variable*/ - register struct vcache *tvc; /*Ptr to current cache entry*/ - int code; /*Return code*/ + register int i; /*Loop variable */ + register struct vcache *tvc; /*Ptr to current cache entry */ + int code; /*Return code */ XSTATS_DECLS; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_GETCE); @@ -121,12 +111,12 @@ int SRXAFSCB_GetCE(a_call, a_index, a_result) if (a_index == 0) goto searchDone; a_index--; - } /*Zip through current hash chain*/ - } /*Zip through hash chains*/ + } /*Zip through current hash chain */ + } /*Zip through hash chains */ searchDone: - if (tvc == (struct vcache *) 0) { - /*Past EOF*/ + if (tvc == NULL) { + /*Past EOF */ code = 1; goto fcnDone; } @@ -153,9 +143,13 @@ int SRXAFSCB_GetCE(a_call, a_index, a_result) a_result->lock.pid_writer = 0; a_result->lock.src_indicator = 0; #endif /* AFS_OSF20_ENV */ +#ifdef AFS_64BIT_CLIENT + a_result->Length = (afs_int32) tvc->m.Length & 0xffffffff; +#else /* AFS_64BIT_CLIENT */ a_result->Length = tvc->m.Length; +#endif /* AFS_64BIT_CLIENT */ a_result->DataVersion = hgetlo(tvc->m.DataVersion); - a_result->callback = afs_data_pointer_to_int32(tvc->callback); /* XXXX Now a pointer; change it XXXX */ + a_result->callback = afs_data_pointer_to_int32(tvc->callback); /* XXXX Now a pointer; change it XXXX */ a_result->cbExpires = tvc->cbExpires; a_result->refCount = VREFCOUNT(tvc); a_result->opens = tvc->opens; @@ -167,16 +161,97 @@ int SRXAFSCB_GetCE(a_call, a_index, a_result) /* * Return our results. */ -fcnDone: + fcnDone: XSTATS_END_TIME; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); - return(code); + return (code); -} /*SRXAFSCB_GetCE*/ +} /*SRXAFSCB_GetCE */ + +int +SRXAFSCB_GetCE64(struct rx_call *a_call, afs_int32 a_index, + struct AFSDBCacheEntry64 *a_result) +{ + register int i; /*Loop variable */ + register struct vcache *tvc; /*Ptr to current cache entry */ + int code; /*Return code */ + XSTATS_DECLS; + + RX_AFS_GLOCK(); + + XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_GETCE); + + AFS_STATCNT(SRXAFSCB_GetCE64); + for (i = 0; i < VCSIZE; i++) { + for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { + if (a_index == 0) + goto searchDone; + a_index--; + } /*Zip through current hash chain */ + } /*Zip through hash chains */ + + searchDone: + if (tvc == NULL) { + /*Past EOF */ + code = 1; + goto fcnDone; + } + + /* + * Copy out the located entry. + */ + a_result->addr = afs_data_pointer_to_int32(tvc); + a_result->cell = tvc->fid.Cell; + a_result->netFid.Volume = tvc->fid.Fid.Volume; + a_result->netFid.Vnode = tvc->fid.Fid.Vnode; + a_result->netFid.Unique = tvc->fid.Fid.Unique; + a_result->lock.waitStates = tvc->lock.wait_states; + a_result->lock.exclLocked = tvc->lock.excl_locked; + a_result->lock.readersReading = tvc->lock.readers_reading; + a_result->lock.numWaiting = tvc->lock.num_waiting; +#if defined(INSTRUMENT_LOCKS) + a_result->lock.pid_last_reader = tvc->lock.pid_last_reader; + a_result->lock.pid_writer = tvc->lock.pid_writer; + a_result->lock.src_indicator = tvc->lock.src_indicator; +#else + /* On osf20 , the vcache does not maintain these three fields */ + a_result->lock.pid_last_reader = 0; + a_result->lock.pid_writer = 0; + a_result->lock.src_indicator = 0; +#endif /* AFS_OSF20_ENV */ +#ifdef AFS_64BIT_ENV + a_result->Length = tvc->m.Length; +#else /* AFS_64BIT_ENV */ +#ifdef AFS_64BIT_CLIENT + a_result->Length = tvc->m.Length; +#else /* AFS_64BIT_CLIENT */ + a_result->Length.high = 0; + a_result->Length.low = tvc->m.Length; +#endif /* AFS_64BIT_CLIENT */ +#endif /* AFS_64BIT_ENV */ + a_result->DataVersion = hgetlo(tvc->m.DataVersion); + a_result->callback = afs_data_pointer_to_int32(tvc->callback); /* XXXX Now a pointer; change it XXXX */ + a_result->cbExpires = tvc->cbExpires; + a_result->refCount = VREFCOUNT(tvc); + a_result->opens = tvc->opens; + a_result->writers = tvc->execsOrWriters; + a_result->mvstat = tvc->mvstat; + a_result->states = tvc->states; + code = 0; + + /* + * Return our results. + */ + fcnDone: + XSTATS_END_TIME; + + RX_AFS_GUNLOCK(); + + return (code); + +} /*SRXAFSCB_GetCE64 */ /*------------------------------------------------------------------------ @@ -203,46 +278,47 @@ fcnDone: * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_GetLock (a_call, a_index, a_result) - struct rx_call *a_call; - afs_int32 a_index; - struct AFSDBLock *a_result; - -{ /*SRXAFSCB_GetLock*/ - - struct ltable *tl; /*Ptr to lock table entry*/ - int nentries; /*Num entries in table*/ - int code; /*Return code*/ +int +SRXAFSCB_GetLock(struct rx_call *a_call, afs_int32 a_index, + struct AFSDBLock *a_result) +{ + struct ltable *tl; /*Ptr to lock table entry */ + int nentries; /*Num entries in table */ + int code; /*Return code */ XSTATS_DECLS; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_GETLOCK); - + AFS_STATCNT(SRXAFSCB_GetLock); - nentries = sizeof(ltable)/sizeof(struct ltable); + nentries = sizeof(ltable) / sizeof(struct ltable); if (a_index < 0 || a_index >= nentries) { /* - * Past EOF - */ + * Past EOF + */ code = 1; - } - else { + } else { /* * Found it - copy out its contents. */ tl = <able[a_index]; strcpy(a_result->name, tl->name); - a_result->lock.waitStates = ((struct afs_lock *)(tl->addr))->wait_states; - a_result->lock.exclLocked = ((struct afs_lock *)(tl->addr))->excl_locked; - a_result->lock.readersReading = ((struct afs_lock *)(tl->addr))->readers_reading; - a_result->lock.numWaiting = ((struct afs_lock *)(tl->addr))->num_waiting; + a_result->lock.waitStates = + ((struct afs_lock *)(tl->addr))->wait_states; + a_result->lock.exclLocked = + ((struct afs_lock *)(tl->addr))->excl_locked; + a_result->lock.readersReading = + ((struct afs_lock *)(tl->addr))->readers_reading; + a_result->lock.numWaiting = + ((struct afs_lock *)(tl->addr))->num_waiting; #ifdef INSTRUMENT_LOCKS - a_result->lock.pid_last_reader = ((struct afs_lock *)(tl->addr))->pid_last_reader; - a_result->lock.pid_writer = ((struct afs_lock *)(tl->addr))->pid_writer; - a_result->lock.src_indicator = ((struct afs_lock *)(tl->addr))->src_indicator; + a_result->lock.pid_last_reader = + ((struct afs_lock *)(tl->addr))->pid_last_reader; + a_result->lock.pid_writer = + ((struct afs_lock *)(tl->addr))->pid_writer; + a_result->lock.src_indicator = + ((struct afs_lock *)(tl->addr))->src_indicator; #else a_result->lock.pid_last_reader = 0; a_result->lock.pid_writer = 0; @@ -253,13 +329,11 @@ int SRXAFSCB_GetLock (a_call, a_index, a_result) XSTATS_END_TIME; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); - return(code); + return (code); -} /*SRXAFSCB_GetLock*/ +} /*SRXAFSCB_GetLock */ /*------------------------------------------------------------------------ @@ -283,21 +357,24 @@ int SRXAFSCB_GetLock (a_call, a_index, a_result) * * Side Effects: * As advertised. - *------------------------------------------------------------------------*/ -static ClearCallBack(a_conn, a_fid) - register struct rx_connection *a_conn; - register struct AFSFid *a_fid; +Appears to need to be called with GLOCK held, as the icl_Event4 stuff asserts otherwise -{ /*ClearCallBack*/ + *------------------------------------------------------------------------*/ +static int +ClearCallBack(register struct rx_connection *a_conn, + register struct AFSFid *a_fid) +{ register struct vcache *tvc; register int i; struct VenusFid localFid; - struct volume * tv; + struct volume *tv; AFS_STATCNT(ClearCallBack); + AFS_ASSERT_GLOCK(); + /* * XXXX Don't hold any server locks here because of callback protocol XXX */ @@ -307,8 +384,8 @@ static ClearCallBack(a_conn, a_fid) localFid.Fid.Unique = a_fid->Unique; /* - * Volume ID of zero means don't do anything. - */ + * Volume ID of zero means don't do anything. + */ if (a_fid->Volume != 0) { if (a_fid->Vnode == 0) { /* @@ -318,27 +395,28 @@ static ClearCallBack(a_conn, a_fid) for (i = 0; i < VCSIZE; i++) for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { if (tvc->fid.Fid.Volume == a_fid->Volume) { - tvc->callback = (struct server *)0; - tvc->quick.stamp = 0; + tvc->callback = NULL; + tvc->quick.stamp = 0; if (!localFid.Cell) localFid.Cell = tvc->fid.Cell; - tvc->h1.dchint = NULL; /* invalidate hints */ + tvc->h1.dchint = NULL; /* invalidate hints */ ObtainWriteLock(&afs_xcbhash, 449); afs_DequeueCallback(tvc); tvc->states &= ~(CStatd | CUnique | CBulkFetching); afs_allCBs++; if (tvc->fid.Fid.Vnode & 1) - afs_oddCBs++; + afs_oddCBs++; else - afs_evenCBs++; + afs_evenCBs++; ReleaseWriteLock(&afs_xcbhash); if (tvc->fid.Fid.Vnode & 1 || (vType(tvc) == VDIR)) osi_dnlc_purgedp(tvc); afs_Trace3(afs_iclSetp, CM_TRACE_CALLBACK, - ICL_TYPE_POINTER, tvc, - ICL_TYPE_INT32, tvc->states, - ICL_TYPE_INT32, a_fid->Volume); - } else if ((tvc->states & CMValid) && (tvc->mvid->Fid.Volume == a_fid->Volume)) { + ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, + tvc->states, ICL_TYPE_INT32, + a_fid->Volume); + } else if ((tvc->states & CMValid) + && (tvc->mvid->Fid.Volume == a_fid->Volume)) { tvc->states &= ~CMValid; if (!localFid.Cell) localFid.Cell = tvc->mvid->Cell; @@ -350,28 +428,28 @@ static ClearCallBack(a_conn, a_fid) */ tv = afs_FindVolume(&localFid, 0); if (tv) { - afs_ResetVolumeInfo(tv); - afs_PutVolume(tv, 0); - /* invalidate mtpoint? */ + afs_ResetVolumeInfo(tv); + afs_PutVolume(tv, 0); + /* invalidate mtpoint? */ } - } /*Clear callbacks for whole volume*/ + } /*Clear callbacks for whole volume */ else { /* * Clear callbacks just for the one file. */ afs_allCBs++; if (a_fid->Vnode & 1) - afs_oddCBs++; /*Could do this on volume basis, too*/ + afs_oddCBs++; /*Could do this on volume basis, too */ else - afs_evenCBs++; /*A particular fid was specified*/ + afs_evenCBs++; /*A particular fid was specified */ i = VCHash(&localFid); for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { if (tvc->fid.Fid.Vnode == a_fid->Vnode && tvc->fid.Fid.Volume == a_fid->Volume - && tvc->fid.Fid.Unique == a_fid->Unique ) { - tvc->callback = (struct server *)0; - tvc->quick.stamp = 0; - tvc->h1.dchint = NULL; /* invalidate hints */ + && tvc->fid.Fid.Unique == a_fid->Unique) { + tvc->callback = NULL; + tvc->quick.stamp = 0; + tvc->h1.dchint = NULL; /* invalidate hints */ ObtainWriteLock(&afs_xcbhash, 450); afs_DequeueCallback(tvc); tvc->states &= ~(CStatd | CUnique | CBulkFetching); @@ -379,24 +457,25 @@ static ClearCallBack(a_conn, a_fid) if (a_fid->Vnode & 1 || (vType(tvc) == VDIR)) osi_dnlc_purgedp(tvc); afs_Trace3(afs_iclSetp, CM_TRACE_CALLBACK, - ICL_TYPE_POINTER, tvc, - ICL_TYPE_INT32, tvc->states, ICL_TYPE_LONG, 0); + ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, + tvc->states, ICL_TYPE_LONG, 0); #ifdef CBDEBUG lastCallBack_vnode = afid->Vnode; lastCallBack_dv = tvc->mstat.DataVersion.low; osi_GetuTime(&lastCallBack_time); #endif /* CBDEBUG */ } - } /*Walk through hash table*/ - } /*Clear callbacks for one file*/ - } /*Fid has non-zero volume ID*/ + } /*Walk through hash table */ + } /*Clear callbacks for one file */ + } + /*Fid has non-zero volume ID */ /* * Always return a predictable value. */ - return(0); + return (0); -} /*ClearCallBack*/ +} /*ClearCallBack */ /*------------------------------------------------------------------------ @@ -422,45 +501,39 @@ static ClearCallBack(a_conn, a_fid) * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_CallBack(a_call, a_fids, a_callbacks) - struct rx_call *a_call; - register struct AFSCBFids *a_fids; - struct AFSCBs *a_callbacks; - -{ /*SRXAFSCB_CallBack*/ - - register int i; /*Loop variable*/ - struct AFSFid *tfid; /*Ptr to current fid*/ - register struct rx_connection *tconn; /*Call's connection*/ - int code=0; +int +SRXAFSCB_CallBack(struct rx_call *a_call, register struct AFSCBFids *a_fids, + struct AFSCBs *a_callbacks) +{ + register int i; /*Loop variable */ + struct AFSFid *tfid; /*Ptr to current fid */ + register struct rx_connection *tconn; /*Call's connection */ + int code = 0; XSTATS_DECLS; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_CALLBACK); AFS_STATCNT(SRXAFSCB_CallBack); - if (!(tconn = rx_ConnectionOf(a_call))) return; - tfid = (struct AFSFid *) a_fids->AFSCBFids_val; - + if (!(tconn = rx_ConnectionOf(a_call))) + return (0); + tfid = (struct AFSFid *)a_fids->AFSCBFids_val; + /* * For now, we ignore callbacks, since the File Server only *breaks* * callbacks at present. */ - for (i = 0; i < a_fids->AFSCBFids_len; i++) + for (i = 0; i < a_fids->AFSCBFids_len; i++) ClearCallBack(tconn, &tfid[i]); XSTATS_END_TIME; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - - return(0); + RX_AFS_GUNLOCK(); + + return (0); -} /*SRXAFSCB_CallBack*/ +} /*SRXAFSCB_CallBack */ /*------------------------------------------------------------------------ @@ -484,28 +557,23 @@ int SRXAFSCB_CallBack(a_call, a_fids, a_callbacks) * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_Probe(a_call) - struct rx_call *a_call; - -{ /*SRXAFSCB_Probe*/ +int +SRXAFSCB_Probe(struct rx_call *a_call) +{ int code = 0; XSTATS_DECLS; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); AFS_STATCNT(SRXAFSCB_Probe); XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_PROBE); XSTATS_END_TIME; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); - return(0); + return (0); -} /*SRXAFSCB_Probe*/ +} /*SRXAFSCB_Probe */ /*------------------------------------------------------------------------ @@ -528,23 +596,18 @@ int SRXAFSCB_Probe(a_call) * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_InitCallBackState(a_call) - struct rx_call *a_call; - -{ /*SRXAFSCB_InitCallBackState*/ - +int +SRXAFSCB_InitCallBackState(struct rx_call *a_call) +{ register int i; register struct vcache *tvc; register struct rx_connection *tconn; register struct rx_peer *peer; struct server *ts; int code = 0; - extern int osi_dnlc_purge(); XSTATS_DECLS; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_INITCALLBACKSTATE); AFS_STATCNT(SRXAFSCB_InitCallBackState); @@ -555,49 +618,48 @@ int SRXAFSCB_InitCallBackState(a_call) if ((tconn = rx_ConnectionOf(a_call)) && (peer = rx_PeerOf(tconn))) { afs_allCBs++; - afs_oddCBs++; /*Including any missed via create race*/ - afs_evenCBs++; /*Including any missed via create race*/ + afs_oddCBs++; /*Including any missed via create race */ + afs_evenCBs++; /*Including any missed via create race */ - ts = afs_FindServer(rx_HostOf(peer), rx_PortOf(peer), (afsUUID *)0, 0); + ts = afs_FindServer(rx_HostOf(peer), rx_PortOf(peer), (afsUUID *) 0, + 0); if (ts) { for (i = 0; i < VCSIZE; i++) for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { if (tvc->callback == ts) { ObtainWriteLock(&afs_xcbhash, 451); afs_DequeueCallback(tvc); - tvc->callback = (struct server *)0; + tvc->callback = NULL; tvc->states &= ~(CStatd | CUnique | CBulkFetching); ReleaseWriteLock(&afs_xcbhash); } } } - - + + /* find any volumes residing on this server and flush their state */ { register struct volume *tv; register int j; - - for (i=0;inext) { - for (j=0; jnext) { + for (j = 0; j < MAXHOSTS; j++) if (tv->serverHost[j] == ts) afs_ResetVolumeInfo(tv); } } - osi_dnlc_purge(); /* may be a little bit extreme */ + osi_dnlc_purge(); /* may be a little bit extreme */ } XSTATS_END_TIME; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); - return(0); + return (0); -} /*SRXAFSCB_InitCallBackState*/ +} /*SRXAFSCB_InitCallBackState */ /*------------------------------------------------------------------------ @@ -621,30 +683,24 @@ int SRXAFSCB_InitCallBackState(a_call) * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_XStatsVersion(a_call, a_versionP) - struct rx_call *a_call; - afs_int32 *a_versionP; - -{ /*SRXAFSCB_XStatsVersion*/ - int code=0; +int +SRXAFSCB_XStatsVersion(struct rx_call *a_call, afs_int32 * a_versionP) +{ + int code = 0; XSTATS_DECLS; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_XSTATSVERSION); *a_versionP = AFSCB_XSTAT_VERSION; XSTATS_END_TIME; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); - return(0); -} /*SRXAFSCB_XStatsVersion*/ + return (0); +} /*SRXAFSCB_XStatsVersion */ /*------------------------------------------------------------------------ @@ -674,24 +730,17 @@ int SRXAFSCB_XStatsVersion(a_call, a_versionP) * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVersionNumP, a_timeP, a_dataP) - struct rx_call *a_call; - afs_int32 a_clientVersionNum; - afs_int32 a_collectionNumber; - afs_int32 *a_srvVersionNumP; - afs_int32 *a_timeP; - AFSCB_CollData *a_dataP; - -{ /*SRXAFSCB_GetXStats*/ - - register int code; /*Return value*/ - afs_int32 *dataBuffP; /*Ptr to data to be returned*/ - afs_int32 dataBytes; /*Bytes in data buffer*/ +int +SRXAFSCB_GetXStats(struct rx_call *a_call, afs_int32 a_clientVersionNum, + afs_int32 a_collectionNumber, afs_int32 * a_srvVersionNumP, + afs_int32 * a_timeP, AFSCB_CollData * a_dataP) +{ + register int code; /*Return value */ + afs_int32 *dataBuffP; /*Ptr to data to be returned */ + afs_int32 dataBytes; /*Bytes in data buffer */ XSTATS_DECLS; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_GETXSTATS); @@ -712,10 +761,10 @@ int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVers * no data. */ a_dataP->AFSCB_CollData_len = 0; - a_dataP->AFSCB_CollData_val = (afs_int32 *)0; + a_dataP->AFSCB_CollData_val = NULL; #else - switch(a_collectionNumber) { - case AFSCB_XSTATSCOLL_CALL_INFO: + switch (a_collectionNumber) { + case AFSCB_XSTATSCOLL_CALL_INFO: /* * Pass back all the call-count-related data. * @@ -724,13 +773,13 @@ int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVers * >>> will be freed at the tail end of the server stub code. */ dataBytes = sizeof(struct afs_CMStats); - dataBuffP = (afs_int32 *)afs_osi_Alloc(dataBytes); + dataBuffP = (afs_int32 *) afs_osi_Alloc(dataBytes); memcpy((char *)dataBuffP, (char *)&afs_cmstats, dataBytes); - a_dataP->AFSCB_CollData_len = dataBytes>>2; + a_dataP->AFSCB_CollData_len = dataBytes >> 2; a_dataP->AFSCB_CollData_val = dataBuffP; break; - case AFSCB_XSTATSCOLL_PERF_INFO: + case AFSCB_XSTATSCOLL_PERF_INFO: /* * Update and then pass back all the performance-related data. * Note: the only performance fields that need to be computed @@ -744,13 +793,13 @@ int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVers afs_stats_cmperf.numPerfCalls++; afs_CountServers(); dataBytes = sizeof(afs_stats_cmperf); - dataBuffP = (afs_int32 *)afs_osi_Alloc(dataBytes); + dataBuffP = (afs_int32 *) afs_osi_Alloc(dataBytes); memcpy((char *)dataBuffP, (char *)&afs_stats_cmperf, dataBytes); - a_dataP->AFSCB_CollData_len = dataBytes>>2; + a_dataP->AFSCB_CollData_len = dataBytes >> 2; a_dataP->AFSCB_CollData_val = dataBuffP; break; - case AFSCB_XSTATSCOLL_FULL_PERF_INFO: + case AFSCB_XSTATSCOLL_FULL_PERF_INFO: /* * Pass back the full range of performance and statistical * data available. We have to bring the normal performance @@ -763,35 +812,34 @@ int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVers */ afs_stats_cmperf.numPerfCalls++; afs_CountServers(); - memcpy((char *)(&(afs_stats_cmfullperf.perf)), (char *)(&afs_stats_cmperf), sizeof(struct afs_stats_CMPerf)); + memcpy((char *)(&(afs_stats_cmfullperf.perf)), + (char *)(&afs_stats_cmperf), sizeof(struct afs_stats_CMPerf)); afs_stats_cmfullperf.numFullPerfCalls++; dataBytes = sizeof(afs_stats_cmfullperf); - dataBuffP = (afs_int32 *)afs_osi_Alloc(dataBytes); + dataBuffP = (afs_int32 *) afs_osi_Alloc(dataBytes); memcpy((char *)dataBuffP, (char *)(&afs_stats_cmfullperf), dataBytes); - a_dataP->AFSCB_CollData_len = dataBytes>>2; + a_dataP->AFSCB_CollData_len = dataBytes >> 2; a_dataP->AFSCB_CollData_val = dataBuffP; break; - default: + default: /* * Illegal collection number. */ a_dataP->AFSCB_CollData_len = 0; - a_dataP->AFSCB_CollData_val = (afs_int32 *)0; + a_dataP->AFSCB_CollData_val = NULL; code = 1; - } /*Switch on collection number*/ + } /*Switch on collection number */ #endif /* AFS_NOSTATS */ XSTATS_END_TIME; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); - return(code); + return (code); -} /*SRXAFSCB_GetXStats*/ +} /*SRXAFSCB_GetXStats */ /*------------------------------------------------------------------------ @@ -813,9 +861,9 @@ int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVers * As advertised. *------------------------------------------------------------------------*/ -int afs_RXCallBackServer() - -{ /*afs_RXCallBackServer*/ +int +afs_RXCallBackServer(void) +{ AFS_STATCNT(afs_RXCallBackServer); while (1) { @@ -828,9 +876,9 @@ int afs_RXCallBackServer() * Donate this process to Rx. */ rx_ServerProc(); - return(0); + return (0); -} /*afs_RXCallBackServer*/ +} /*afs_RXCallBackServer */ /*------------------------------------------------------------------------ @@ -852,22 +900,19 @@ int afs_RXCallBackServer() * As advertised. *------------------------------------------------------------------------*/ -int shutdown_CB() - -{ /*shutdown_CB*/ - - extern int afs_cold_shutdown; - - AFS_STATCNT(shutdown_CB); +int +shutdown_CB(void) +{ + AFS_STATCNT(shutdown_CB); - if (afs_cold_shutdown) { - afs_oddCBs = afs_evenCBs = afs_allCBs = afs_allZaps = afs_oddZaps = afs_evenZaps = - afs_connectBacks = 0; - } + if (afs_cold_shutdown) { + afs_oddCBs = afs_evenCBs = afs_allCBs = afs_allZaps = afs_oddZaps = + afs_evenZaps = afs_connectBacks = 0; + } - return(0); + return (0); -} /*shutdown_CB*/ +} /*shutdown_CB */ /*------------------------------------------------------------------------ * EXPORTED SRXAFSCB_InitCallBackState2 @@ -889,11 +934,11 @@ int shutdown_CB() * None *------------------------------------------------------------------------*/ -int SRXAFSCB_InitCallBackState2(a_call, addr) -struct rx_call *a_call; -struct interfaceAddr * addr; +int +SRXAFSCB_InitCallBackState2(struct rx_call *a_call, + struct interfaceAddr *addr) { - return RXGEN_OPCODE; + return RXGEN_OPCODE; } /*------------------------------------------------------------------------ @@ -920,26 +965,24 @@ struct interfaceAddr * addr; * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_WhoAreYou(a_call, addr) -struct rx_call *a_call; -struct interfaceAddr *addr; +int +SRXAFSCB_WhoAreYou(struct rx_call *a_call, struct interfaceAddr *addr) { int i; int code = 0; - XSTATS_DECLS; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); AFS_STATCNT(SRXAFSCB_WhoAreYou); + memset(addr, 0, sizeof(*addr)); + ObtainReadLock(&afs_xinterface); /* return all network interface addresses */ addr->numberOfInterfaces = afs_cb_interface.numberOfInterfaces; addr->uuid = afs_cb_interface.uuid; - for ( i=0; i < afs_cb_interface.numberOfInterfaces; i++) { + for (i = 0; i < afs_cb_interface.numberOfInterfaces; i++) { addr->addr_in[i] = ntohl(afs_cb_interface.addr_in[i]); addr->subnetmask[i] = ntohl(afs_cb_interface.subnetmask[i]); addr->mtu[i] = ntohl(afs_cb_interface.mtu[i]); @@ -947,9 +990,7 @@ struct interfaceAddr *addr; ReleaseReadLock(&afs_xinterface); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); return code; } @@ -975,9 +1016,8 @@ struct interfaceAddr *addr; * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_InitCallBackState3(a_call, a_uuid) -struct rx_call *a_call; -afsUUID *a_uuid; +int +SRXAFSCB_InitCallBackState3(struct rx_call *a_call, afsUUID * a_uuid) { int code; @@ -988,7 +1028,7 @@ afsUUID *a_uuid; return code; } - + /*------------------------------------------------------------------------ * EXPORTED SRXAFSCB_ProbeUuid @@ -1013,30 +1053,25 @@ afsUUID *a_uuid; * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_ProbeUuid(a_call, a_uuid) -struct rx_call *a_call; -afsUUID *a_uuid; +int +SRXAFSCB_ProbeUuid(struct rx_call *a_call, afsUUID * a_uuid) { int code = 0; XSTATS_DECLS; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); AFS_STATCNT(SRXAFSCB_Probe); XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_PROBE); if (!afs_uuid_equal(a_uuid, &afs_cb_interface.uuid)) - code = 1; /* failure */ + code = 1; /* failure */ XSTATS_END_TIME; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); return code; } - + /*------------------------------------------------------------------------ * EXPORTED SRXAFSCB_GetServerPrefs @@ -1061,18 +1096,14 @@ afsUUID *a_uuid; * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_GetServerPrefs( - struct rx_call *a_call, - afs_int32 a_index, - afs_int32 *a_srvr_addr, - afs_int32 *a_srvr_rank) +int +SRXAFSCB_GetServerPrefs(struct rx_call *a_call, afs_int32 a_index, + afs_int32 * a_srvr_addr, afs_int32 * a_srvr_rank) { int i, j; struct srvAddr *sa; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); AFS_STATCNT(SRXAFSCB_GetServerPrefs); ObtainReadLock(&afs_xserver); @@ -1080,7 +1111,7 @@ int SRXAFSCB_GetServerPrefs( /* Search the hash table for the server with this index */ *a_srvr_addr = 0xffffffff; *a_srvr_rank = 0xffffffff; - for (i=0, j=0; j < NSERVERS && i <= a_index; j++) { + for (i = 0, j = 0; j < NSERVERS && i <= a_index; j++) { for (sa = afs_srvAddrs[j]; sa && i <= a_index; sa = sa->next_bkt, i++) { if (i == a_index) { *a_srvr_addr = ntohl(sa->sa_ip); @@ -1091,13 +1122,11 @@ int SRXAFSCB_GetServerPrefs( ReleaseReadLock(&afs_xserver); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); return 0; } - + /*------------------------------------------------------------------------ * EXPORTED SRXAFSCB_GetCellServDB @@ -1121,46 +1150,40 @@ int SRXAFSCB_GetServerPrefs( * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_GetCellServDB( - struct rx_call *a_call, - afs_int32 a_index, - char **a_name, - serverList *a_hosts) +int +SRXAFSCB_GetCellServDB(struct rx_call *a_call, afs_int32 a_index, + char **a_name, serverList * a_hosts) { - afs_int32 i, j; + afs_int32 i, j = 0; struct cell *tcell; - struct afs_q *cq, *tq; char *t_name, *p_name = NULL; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); AFS_STATCNT(SRXAFSCB_GetCellServDB); tcell = afs_GetCellByIndex(a_index, READ_LOCK); if (!tcell) { - i = 0; - a_hosts->serverList_val = 0; - a_hosts->serverList_len = 0; + i = 0; + a_hosts->serverList_val = 0; + a_hosts->serverList_len = 0; } else { - p_name = tcell->cellName; - for (j = 0 ; j < AFSMAXCELLHOSTS && tcell->cellHosts[j] ; j++) - ; - i = strlen(p_name); - a_hosts->serverList_val = (afs_int32 *)afs_osi_Alloc(j*sizeof(afs_int32)); - a_hosts->serverList_len = j; - for (j = 0 ; j < AFSMAXCELLHOSTS && tcell->cellHosts[j] ; j++) - a_hosts->serverList_val[j] = ntohl(tcell->cellHosts[j]->addr->sa_ip); - afs_PutCell(tcell, READ_LOCK); + p_name = tcell->cellName; + for (j = 0; j < AFSMAXCELLHOSTS && tcell->cellHosts[j]; j++); + i = strlen(p_name); + a_hosts->serverList_val = + (afs_int32 *) afs_osi_Alloc(j * sizeof(afs_int32)); + a_hosts->serverList_len = j; + for (j = 0; j < AFSMAXCELLHOSTS && tcell->cellHosts[j]; j++) + a_hosts->serverList_val[j] = + ntohl(tcell->cellHosts[j]->addr->sa_ip); + afs_PutCell(tcell, READ_LOCK); } - t_name = (char *)afs_osi_Alloc(i+1); + t_name = (char *)afs_osi_Alloc(i + 1); if (t_name == NULL) { - afs_osi_Free(a_hosts->serverList_val, (j*sizeof(afs_int32))); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + afs_osi_Free(a_hosts->serverList_val, (j * sizeof(afs_int32))); + RX_AFS_GUNLOCK(); return ENOMEM; } @@ -1168,14 +1191,12 @@ int SRXAFSCB_GetCellServDB( if (p_name) memcpy(t_name, p_name, i); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); *a_name = t_name; return 0; } - + /*------------------------------------------------------------------------ * EXPORTED SRXAFSCB_GetLocalCell @@ -1197,17 +1218,14 @@ int SRXAFSCB_GetCellServDB( * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_GetLocalCell( - struct rx_call *a_call, - char **a_name) +int +SRXAFSCB_GetLocalCell(struct rx_call *a_call, char **a_name) { int plen; struct cell *tcell; char *t_name, *p_name = NULL; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); AFS_STATCNT(SRXAFSCB_GetLocalCell); /* Search the list for the primary cell. Cell number 1 is only @@ -1220,12 +1238,11 @@ int SRXAFSCB_GetLocalCell( plen = strlen(p_name); else plen = 0; - t_name = (char *)afs_osi_Alloc(plen+1); + t_name = (char *)afs_osi_Alloc(plen + 1); if (t_name == NULL) { - if (tcell) afs_PutCell(tcell, READ_LOCK); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + if (tcell) + afs_PutCell(tcell, READ_LOCK); + RX_AFS_GUNLOCK(); return ENOMEM; } @@ -1233,12 +1250,11 @@ int SRXAFSCB_GetLocalCell( if (p_name) memcpy(t_name, p_name, plen); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); *a_name = t_name; - if (tcell) afs_PutCell(tcell, READ_LOCK); + if (tcell) + afs_PutCell(tcell, READ_LOCK); return 0; } @@ -1258,10 +1274,9 @@ int SRXAFSCB_GetLocalCell( * * Returns void. */ -static void afs_MarshallCacheConfig( - afs_uint32 callerVersion, - cm_initparams_v1 *config, - afs_uint32 *ptr) +static void +afs_MarshallCacheConfig(afs_uint32 callerVersion, cm_initparams_v1 * config, + afs_uint32 * ptr) { AFS_STATCNT(afs_MarshallCacheConfig); /* @@ -1276,9 +1291,8 @@ static void afs_MarshallCacheConfig( *(ptr++) = config->cacheSize; *(ptr++) = config->setTime; *(ptr++) = config->memCache; - } - + /*------------------------------------------------------------------------ * EXPORTED SRXAFSCB_GetCacheConfig @@ -1305,31 +1319,25 @@ static void afs_MarshallCacheConfig( * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_GetCacheConfig( - struct rx_call *a_call, - afs_uint32 callerVersion, - afs_uint32 *serverVersion, - afs_uint32 *configCount, - cacheConfig *config) +int +SRXAFSCB_GetCacheConfig(struct rx_call *a_call, afs_uint32 callerVersion, + afs_uint32 * serverVersion, afs_uint32 * configCount, + cacheConfig * config) { afs_uint32 *t_config; size_t allocsize; cm_initparams_v1 cm_config; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); AFS_STATCNT(SRXAFSCB_GetCacheConfig); /* * Currently only support version 1 */ allocsize = sizeof(cm_initparams_v1); - t_config = (afs_uint32 *)afs_osi_Alloc(allocsize); + t_config = (afs_uint32 *) afs_osi_Alloc(allocsize); if (t_config == NULL) { -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); return ENOMEM; } @@ -1348,15 +1356,78 @@ int SRXAFSCB_GetCacheConfig( *serverVersion = AFS_CLIENT_RETRIEVAL_FIRST_EDITION; *configCount = allocsize; config->cacheConfig_val = t_config; - config->cacheConfig_len = allocsize/sizeof(afs_uint32); + config->cacheConfig_len = allocsize / sizeof(afs_uint32); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); return 0; } +/*------------------------------------------------------------------------ + * EXPORTED SRXAFSCB_FetchData + * + * Description: + * Routine to do third party move from a remioserver to the original + * issuer of an ArchiveData request. Presently supported only by the + * "fs" command, not by the AFS client. + * + * Arguments: + * rxcall: Ptr to Rx call on which this request came in. + * Fid: pointer to AFSFid structure. + * Fd: File descriptor inside fs command. + * Position: Offset in the file. + * Length: Data length to transfer. + * TotalLength: Pointer to total file length field + * + * Returns: + * 0 on success + * + * Environment: + * Nothing interesting. + * + * Side Effects: + *------------------------------------------------------------------------*/ +int +SRXAFSCB_FetchData(struct rx_call *rxcall, struct AFSFid *Fid, afs_int32 Fd, + afs_int64 Position, afs_int64 Length, + afs_int64 * TotalLength) +{ + return ENOSYS; +} + +/*------------------------------------------------------------------------ + * EXPORTED SRXAFSCB_StoreData + * + * Description: + * Routine to do third party move from a remioserver to the original + * issuer of a RetrieveData request. Presently supported only by the + * "fs" command, not by the AFS client. + * + * Arguments: + * rxcall: Ptr to Rx call on which this request came in. + * Fid: pointer to AFSFid structure. + * Fd: File descriptor inside fs command. + * Position: Offset in the file. + * Length: Data length to transfer. + * TotalLength: Pointer to total file length field + * + * Returns: + * 0 on success + * + * Environment: + * Nothing interesting. + * + * Side Effects: + * As advertised. + *------------------------------------------------------------------------*/ +int +SRXAFSCB_StoreData(struct rx_call *rxcall, struct AFSFid *Fid, afs_int32 Fd, + afs_int64 Position, afs_int64 Length, + afs_int64 * TotalLength) +{ + return ENOSYS; +} + /*------------------------------------------------------------------------ * EXPORTED SRXAFSCB_GetCellByNum * @@ -1380,15 +1451,14 @@ int SRXAFSCB_GetCacheConfig( * As advertised. *------------------------------------------------------------------------*/ -int SRXAFSCB_GetCellByNum(struct rx_call *a_call, afs_int32 a_cellnum, - char **a_name, serverList *a_hosts) +int +SRXAFSCB_GetCellByNum(struct rx_call *a_call, afs_int32 a_cellnum, + char **a_name, serverList * a_hosts) { afs_int32 i, sn; struct cell *tcell; -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); AFS_STATCNT(SRXAFSCB_GetCellByNum); a_hosts->serverList_val = 0; @@ -1397,28 +1467,61 @@ int SRXAFSCB_GetCellByNum(struct rx_call *a_call, afs_int32 a_cellnum, tcell = afs_GetCellStale(a_cellnum, READ_LOCK); if (!tcell) { *a_name = afs_strdup(""); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); return 0; } ObtainReadLock(&tcell->lock); *a_name = afs_strdup(tcell->cellName); - for (sn = 0; sn < AFSMAXCELLHOSTS && tcell->cellHosts[sn]; sn++) - ; + for (sn = 0; sn < AFSMAXCELLHOSTS && tcell->cellHosts[sn]; sn++); a_hosts->serverList_len = sn; - a_hosts->serverList_val = (afs_int32 *) afs_osi_Alloc(sn*sizeof(afs_int32)); + a_hosts->serverList_val = + (afs_int32 *) afs_osi_Alloc(sn * sizeof(afs_int32)); for (i = 0; i < sn; i++) a_hosts->serverList_val[i] = ntohl(tcell->cellHosts[i]->addr->sa_ip); ReleaseReadLock(&tcell->lock); afs_PutCell(tcell, READ_LOCK); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); return 0; } - + +int +SRXAFSCB_TellMeAboutYourself(struct rx_call *a_call, + struct interfaceAddr *addr, + Capabilities * capabilities) +{ + int i; + int code = 0; + afs_int32 *dataBuffP; + afs_int32 dataBytes; + + RX_AFS_GLOCK(); + + AFS_STATCNT(SRXAFSCB_WhoAreYou); + + ObtainReadLock(&afs_xinterface); + + /* return all network interface addresses */ + addr->numberOfInterfaces = afs_cb_interface.numberOfInterfaces; + addr->uuid = afs_cb_interface.uuid; + for (i = 0; i < afs_cb_interface.numberOfInterfaces; i++) { + addr->addr_in[i] = ntohl(afs_cb_interface.addr_in[i]); + addr->subnetmask[i] = ntohl(afs_cb_interface.subnetmask[i]); + addr->mtu[i] = ntohl(afs_cb_interface.mtu[i]); + } + + ReleaseReadLock(&afs_xinterface); + + RX_AFS_GUNLOCK(); + + dataBytes = 1 * sizeof(afs_int32); + dataBuffP = (afs_int32 *) afs_osi_Alloc(dataBytes); + dataBuffP[0] = CAPABILITY_ERRORTRANS; + capabilities->Capabilities_len = dataBytes / sizeof(afs_int32); + capabilities->Capabilities_val = dataBuffP; + + return code; +} diff --git a/src/afs/afs_cbqueue.c b/src/afs/afs_cbqueue.c index e4b3ac654..44c52f1b7 100644 --- a/src/afs/afs_cbqueue.c +++ b/src/afs/afs_cbqueue.c @@ -72,30 +72,27 @@ * granted with a shorter expiration time. */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cbqueue.c,v 1.1.1.5 2001/09/11 14:24:37 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_cbqueue.c,v 1.9 2003/07/15 23:14:11 shadow Exp $"); -#include "../afs/sysincludes.h" /*Standard vendor system headers*/ -#include "../afs/afsincludes.h" /*AFS-based standard headers*/ -#include "../afs/afs_cbqueue.h" +#include "afs/sysincludes.h" /*Standard vendor system headers */ +#include "afsincludes.h" /*AFS-based standard headers */ +#include "afs/afs_cbqueue.h" #include "afs/afs.h" -#include "../afs/lock.h" -#include "../afs/afs_stats.h" +#include "afs/lock.h" +#include "afs/afs_stats.h" static unsigned int base = 0; static unsigned int basetime = 0; -static struct vcache *debugvc; /* used only for post-mortem debugging */ +static struct vcache *debugvc; /* used only for post-mortem debugging */ struct bucket { - struct afs_q head; - /* struct afs_lock lock; only if you want lots of locks... */ + struct afs_q head; + /* struct afs_lock lock; only if you want lots of locks... */ }; -struct bucket cbHashT[CBHTSIZE]; +static struct bucket cbHashT[CBHTSIZE]; struct afs_lock afs_xcbhash; -extern afs_int32 afs_cacheStats; -extern struct volume * afs_FindVolume(); -extern unsigned int afs_paniconwarn; -void afs_FlushCBs(); /* afs_QueueCallback * Takes a write-locked vcache pointer and a callback expiration time @@ -112,22 +109,18 @@ void afs_FlushCBs(); * NOTE: The caller must hold a write lock on afs_xcbhash */ -void afs_QueueCallback(avc, atime, avp) -struct vcache *avc; -unsigned int atime; -struct volume *avp; +void +afs_QueueCallback(struct vcache *avc, unsigned int atime, struct volume *avp) { -struct vcache *list; - -if (avp && (avp->expireTime < avc->cbExpires)) - avp->expireTime = avc->cbExpires; -if (!(avc->callsort.next)) { - atime = (atime + base) % CBHTSIZE; - QAdd(&(cbHashT[atime].head), &(avc->callsort)); -} + if (avp && (avp->expireTime < avc->cbExpires)) + avp->expireTime = avc->cbExpires; + if (!(avc->callsort.next)) { + atime = (atime + base) % CBHTSIZE; + QAdd(&(cbHashT[atime].head), &(avc->callsort)); + } -return ; -} /* afs_QueueCallback */ + return; +} /* afs_QueueCallback */ /* afs_DequeueCallback * Takes a write-locked vcache pointer and removes it from the callback @@ -141,20 +134,19 @@ return ; * * NOTE: The caller must hold a write lock on afs_xcbhash */ -void afs_DequeueCallback(avc) -struct vcache *avc; +void +afs_DequeueCallback(struct vcache *avc) { - debugvc=avc; - if (avc->callsort.prev) { - QRemove(&(avc->callsort)); - avc->callsort.prev = avc->callsort.next = NULL; - } - else ; /* must have got dequeued in a race */ - afs_symhint_inval(avc); + debugvc = avc; + if (avc->callsort.prev) { + QRemove(&(avc->callsort)); + avc->callsort.prev = avc->callsort.next = NULL; + } else; /* must have got dequeued in a race */ + afs_symhint_inval(avc); - return; -} /* afs_DequeueCallback */ + return; +} /* afs_DequeueCallback */ /* afs_CheckCallbacks * called periodically to determine which callbacks are likely to @@ -191,97 +183,97 @@ struct vcache *avc; /* Sanity check on the callback queue. Allow for slop in the computation. */ #ifdef AFS_OSF_ENV -extern afs_int32 afs_maxvcount; #define CBQ_LIMIT (afs_maxvcount + 10) #else #define CBQ_LIMIT (afs_cacheStats + afs_stats_cmperf.vcacheXAllocs + 10) #endif -void afs_CheckCallbacks(secs) -unsigned int secs; +void +afs_CheckCallbacks(unsigned int secs) { - struct vcache *tvc; - register struct afs_q *tq; - struct afs_q *uq; - afs_uint32 now; - struct volume *tvp; - register int safety; - - ObtainWriteLock(&afs_xcbhash,85); /* pretty likely I'm going to remove something */ - now=osi_Time(); - for(safety = 0, tq = cbHashT[base].head.prev; - (safety <= CBQ_LIMIT) && (tq != &(cbHashT[base].head)); - tq = uq, safety++) { - - uq = QPrev(tq); - tvc = CBQTOV(tq); - if (tvc->cbExpires < now + secs) { /* race #1 here */ - /* Get the volume, and if its callback expiration time is more than secs - * seconds into the future, update this vcache entry and requeue it below - */ - if ((tvc->states & CRO) && (tvp=afs_FindVolume(&(tvc->fid), READ_LOCK))) { - if (tvp->expireTime > now + secs) { - tvc->cbExpires = tvp->expireTime; /* XXX race here */ - } - else { - int i; - for (i=0; i < MAXHOSTS && tvp->serverHost[i]; i++) { - if (!(tvp->serverHost[i]->flags & SRVR_ISDOWN)) { - /* What about locking xvcache or vrefcount++ or - * write locking tvc? */ - QRemove(tq); - tq->prev = tq->next = NULL; - tvc->states &= ~(CStatd | CMValid | CUnique); - if ((tvc->fid.Fid.Vnode & 1) || (vType(tvc) == VDIR)) - osi_dnlc_purgedp(tvc); - tvc->quick.stamp = 0; - tvc->h1.dchint = NULL;/*invalidate em */ - afs_ResetVolumeInfo(tvp); - break; + struct vcache *tvc; + register struct afs_q *tq; + struct afs_q *uq; + afs_uint32 now; + struct volume *tvp; + register int safety; + + ObtainWriteLock(&afs_xcbhash, 85); /* pretty likely I'm going to remove something */ + now = osi_Time(); + for (safety = 0, tq = cbHashT[base].head.prev; + (safety <= CBQ_LIMIT) && (tq != &(cbHashT[base].head)); + tq = uq, safety++) { + + uq = QPrev(tq); + tvc = CBQTOV(tq); + if (tvc->cbExpires < now + secs) { /* race #1 here */ + /* Get the volume, and if its callback expiration time is more than secs + * seconds into the future, update this vcache entry and requeue it below + */ + if ((tvc->states & CRO) + && (tvp = afs_FindVolume(&(tvc->fid), READ_LOCK))) { + if (tvp->expireTime > now + secs) { + tvc->cbExpires = tvp->expireTime; /* XXX race here */ + } else { + int i; + for (i = 0; i < MAXHOSTS && tvp->serverHost[i]; i++) { + if (!(tvp->serverHost[i]->flags & SRVR_ISDOWN)) { + /* What about locking xvcache or vrefcount++ or + * write locking tvc? */ + QRemove(tq); + tq->prev = tq->next = NULL; + tvc->states &= ~(CStatd | CMValid | CUnique); + if ((tvc->fid.Fid.Vnode & 1) + || (vType(tvc) == VDIR)) + osi_dnlc_purgedp(tvc); + tvc->quick.stamp = 0; + tvc->h1.dchint = NULL; /*invalidate em */ + afs_ResetVolumeInfo(tvp); + break; + } + } } - } - } - afs_PutVolume(tvp, READ_LOCK); - } - else { - /* Do I need to worry about things like execsorwriters? - * What about locking xvcache or vrefcount++ or write locking tvc? - */ - QRemove(tq); - tq->prev = tq->next = NULL; - tvc->states &= ~(CStatd | CMValid | CUnique); - if ((tvc->fid.Fid.Vnode & 1) || (vType(tvc) == VDIR)) - osi_dnlc_purgedp(tvc); - } - } - - if ((tvc->cbExpires > basetime) && CBHash(tvc->cbExpires - basetime)) { - /* it's been renewed on us. Have to be careful not to put it back - * into this slot, or we may never get out of here. - */ - int slot; - slot = (CBHash(tvc->cbExpires - basetime)+base)%CBHTSIZE ; - if (slot != base) { - if (QPrev(tq)) - QRemove(&(tvc->callsort)); - QAdd( &(cbHashT[slot].head), &(tvc->callsort) ); - /* XXX remember to update volume expiration time */ - /* -- not needed for correctness, though */ - } + afs_PutVolume(tvp, READ_LOCK); + } else { + /* Do I need to worry about things like execsorwriters? + * What about locking xvcache or vrefcount++ or write locking tvc? + */ + QRemove(tq); + tq->prev = tq->next = NULL; + tvc->states &= ~(CStatd | CMValid | CUnique); + if ((tvc->fid.Fid.Vnode & 1) || (vType(tvc) == VDIR)) + osi_dnlc_purgedp(tvc); + } + } + + if ((tvc->cbExpires > basetime) && CBHash(tvc->cbExpires - basetime)) { + /* it's been renewed on us. Have to be careful not to put it back + * into this slot, or we may never get out of here. + */ + int slot; + slot = (CBHash(tvc->cbExpires - basetime) + base) % CBHTSIZE; + if (slot != base) { + if (QPrev(tq)) + QRemove(&(tvc->callsort)); + QAdd(&(cbHashT[slot].head), &(tvc->callsort)); + /* XXX remember to update volume expiration time */ + /* -- not needed for correctness, though */ + } + } } - } - if (safety > CBQ_LIMIT) { - afs_stats_cmperf.cbloops++; - if (afs_paniconwarn) - osi_Panic ("CheckCallbacks"); + if (safety > CBQ_LIMIT) { + afs_stats_cmperf.cbloops++; + if (afs_paniconwarn) + osi_Panic("CheckCallbacks"); - afs_warn("AFS Internal Error (minor): please contact AFS Product Support.\n"); - ReleaseWriteLock(&afs_xcbhash); - afs_FlushCBs(); - return; - } - else ReleaseWriteLock(&afs_xcbhash); + afs_warn + ("AFS Internal Error (minor): please contact AFS Product Support.\n"); + ReleaseWriteLock(&afs_xcbhash); + afs_FlushCBs(); + return; + } else + ReleaseWriteLock(&afs_xcbhash); /* XXX future optimization: @@ -289,39 +281,42 @@ unsigned int secs; { struct dcache * adc; + ObtainReadLock(&afs_xdcache); if ((adc = tvc->quick.dc) && (adc->stamp == tvc->quick.stamp) && (afs_indexTimes[adc->index] > afs_indexCounter - 20)) { queue up the stat request } + ReleaseReadLock(&afs_xdcache); } */ -return; -} /* afs_CheckCallback */ + return; +} /* afs_CheckCallback */ /* afs_FlushCBs * to be used only in dire circumstances, this drops all callbacks on * the floor, without giving them back to the server. It's ok, the server can * deal with it, but it is a little bit rude. */ -void afs_FlushCBs() +void +afs_FlushCBs(void) { - register int i; - register struct vcache *tvc; - - ObtainWriteLock(&afs_xcbhash,86); /* pretty likely I'm going to remove something */ - - for (i = 0; i < VCSIZE; i++) /* reset all the vnodes */ - for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { - tvc->callback = 0; - tvc->quick.stamp = 0; - tvc->h1.dchint = NULL; /* invalidate hints */ - tvc->states &= ~(CStatd); - if ((tvc->fid.Fid.Vnode & 1) || (vType(tvc) == VDIR)) - osi_dnlc_purgedp(tvc); - tvc->callsort.prev = tvc->callsort.next = NULL; - } - + register int i; + register struct vcache *tvc; + + ObtainWriteLock(&afs_xcbhash, 86); /* pretty likely I'm going to remove something */ + + for (i = 0; i < VCSIZE; i++) /* reset all the vnodes */ + for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { + tvc->callback = 0; + tvc->quick.stamp = 0; + tvc->h1.dchint = NULL; /* invalidate hints */ + tvc->states &= ~(CStatd); + if ((tvc->fid.Fid.Vnode & 1) || (vType(tvc) == VDIR)) + osi_dnlc_purgedp(tvc); + tvc->callsort.prev = tvc->callsort.next = NULL; + } + afs_InitCBQueue(0); ReleaseWriteLock(&afs_xcbhash); @@ -332,51 +327,51 @@ void afs_FlushCBs() * the floor for a specific server, without giving them back to the server. * It's ok, the server can deal with it, but it is a little bit rude. */ -void afs_FlushServerCBs(srvp) -struct server *srvp; +void +afs_FlushServerCBs(struct server *srvp) { - register int i; - register struct vcache *tvc; - - ObtainWriteLock(&afs_xcbhash,86); /* pretty likely I'm going to remove something */ - - for (i=0; ihnext) { - if (tvc->callback == srvp) { - tvc->callback = 0; - tvc->quick.stamp = 0; - tvc->h1.dchint = NULL; /* invalidate hints */ - tvc->states &= ~(CStatd); - if ((tvc->fid.Fid.Vnode & 1) || (vType(tvc) == VDIR)) { - osi_dnlc_purgedp(tvc); - } - afs_DequeueCallback(tvc); - } - } - } - - ReleaseWriteLock(&afs_xcbhash); + register int i; + register struct vcache *tvc; + + ObtainWriteLock(&afs_xcbhash, 86); /* pretty likely I'm going to remove something */ + + for (i = 0; i < VCSIZE; i++) { /* reset all the vnodes */ + for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { + if (tvc->callback == srvp) { + tvc->callback = 0; + tvc->quick.stamp = 0; + tvc->h1.dchint = NULL; /* invalidate hints */ + tvc->states &= ~(CStatd); + if ((tvc->fid.Fid.Vnode & 1) || (vType(tvc) == VDIR)) { + osi_dnlc_purgedp(tvc); + } + afs_DequeueCallback(tvc); + } + } + } + + ReleaseWriteLock(&afs_xcbhash); } /* afs_InitCBQueue * called to initialize static and global variables associated with * the Callback expiration management mechanism. */ -void afs_InitCBQueue(doLockInit) -int doLockInit; +void +afs_InitCBQueue(int doLockInit) { -register int i; - -memset((char *)cbHashT, 0, CBHTSIZE*sizeof(struct bucket)); -for (i=0;i>7) - -extern int afs_BumpBase(); -extern void afs_InitCBQueue(); -extern void afs_CheckCallbacks(); -extern void afs_DequeueCallback(); -extern void afs_QueueCallback(); +#define CBHash(t) ((t)>>7) #define CBQTOV(e) ((struct vcache *)(((char *) (e)) - (((char *)(&(((struct vcache *)(e))->callsort))) - ((char *)(e))))) - - - - - - - - - - - - - - - diff --git a/src/afs/afs_cell.c b/src/afs/afs_cell.c index 159281b8e..3a783bfeb 100644 --- a/src/afs/afs_cell.c +++ b/src/afs/afs_cell.c @@ -13,12 +13,13 @@ #include #include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cell.c,v 1.1.1.13 2003/07/30 17:07:58 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_cell.c,v 1.30 2004/05/08 04:22:19 shadow Exp $"); #include "afs/stds.h" #include "afs/sysincludes.h" /* Standard vendor system headers */ #include "afsincludes.h" /* Afs-based standard headers */ -#include "afs/afs_stats.h" /* afs statistics */ +#include "afs/afs_stats.h" /* afs statistics */ #include "afs/afs_osi.h" /* Local variables. */ @@ -48,7 +49,8 @@ static struct { char **realname; } afsdb_req; -void afs_StopAFSDB() +void +afs_StopAFSDB() { if (afsdb_handler_running) { afs_osi_Wakeup(&afsdb_req); @@ -58,9 +60,11 @@ void afs_StopAFSDB() } } -int afs_AFSDBHandler(char *acellName, int acellNameLen, afs_int32 *kernelMsg) +int +afs_AFSDBHandler(char *acellName, int acellNameLen, afs_int32 * kernelMsg) { - if (afsdb_handler_shutdown) return -2; + if (afsdb_handler_shutdown) + return -2; afsdb_handler_running = 1; ObtainSharedLock(&afsdb_req.lock, 683); @@ -70,14 +74,15 @@ int afs_AFSDBHandler(char *acellName, int acellNameLen, afs_int32 *kernelMsg) UpgradeSToWLock(&afsdb_req.lock, 684); hostCount = kernelMsg[0]; *afsdb_req.timeout = kernelMsg[1]; - if (*afsdb_req.timeout) *afsdb_req.timeout += osi_Time(); + if (*afsdb_req.timeout) + *afsdb_req.timeout += osi_Time(); *afsdb_req.realname = afs_strdup(acellName); - for (i=0; i= hostCount) afsdb_req.cellhosts[i] = 0; else - afsdb_req.cellhosts[i] = kernelMsg[2+i]; + afsdb_req.cellhosts[i] = kernelMsg[2 + i]; } /* Request completed, wake up the relevant thread */ @@ -109,17 +114,19 @@ int afs_AFSDBHandler(char *acellName, int acellNameLen, afs_int32 *kernelMsg) return -2; } - /* Return the lookup request to userspace */ + /* Return the lookup request to userspace */ strncpy(acellName, afsdb_req.cellname, acellNameLen); ReleaseReadLock(&afsdb_req.lock); return 0; } -static int afs_GetCellHostsAFSDB(char *acellName, afs_int32 *acellHosts, - int *timeout, char **realName) +static int +afs_GetCellHostsAFSDB(char *acellName, afs_int32 * acellHosts, int *timeout, + char **realName) { AFS_ASSERT_GLOCK(); - if (!afsdb_handler_running) return ENOENT; + if (!afsdb_handler_running) + return ENOENT; ObtainWriteLock(&afsdb_client_lock, 685); ObtainWriteLock(&afsdb_req.lock, 686); @@ -150,23 +157,26 @@ static int afs_GetCellHostsAFSDB(char *acellName, afs_int32 *acellHosts, } #endif -void afs_LookupAFSDB(char *acellName) +void +afs_LookupAFSDB(char *acellName) { #ifdef AFS_AFSDB_ENV afs_int32 cellHosts[MAXCELLHOSTS]; char *realName = NULL; int code, timeout; - + code = afs_GetCellHostsAFSDB(acellName, cellHosts, &timeout, &realName); - if (code) goto done; + if (code) + goto done; code = afs_NewCell(realName, cellHosts, CNoSUID, NULL, 0, 0, timeout); - if (code && code != EEXIST) goto done; + if (code && code != EEXIST) + goto done; /* If we found an alias, create it */ if (afs_strcasecmp(acellName, realName)) afs_NewCellAlias(acellName, realName); -done: + done: if (realName) afs_osi_FreeStr(realName); #endif @@ -189,14 +199,15 @@ static int afs_cellname_inode_set; static int afs_cellname_dirty; static afs_int32 afs_cellnum_next; -static struct cell_name *afs_cellname_new(char *name, afs_int32 cellnum) +static struct cell_name * +afs_cellname_new(char *name, afs_int32 cellnum) { struct cell_name *cn; if (cellnum == 0) cellnum = afs_cellnum_next; - cn = (struct cell_name *) afs_osi_Alloc(sizeof(*cn)); + cn = (struct cell_name *)afs_osi_Alloc(sizeof(*cn)); cn->next = afs_cellname_head; cn->cellnum = cellnum; cn->cellname = afs_strdup(name); @@ -209,7 +220,8 @@ static struct cell_name *afs_cellname_new(char *name, afs_int32 cellnum) return cn; } -static struct cell_name *afs_cellname_lookup_id(afs_int32 cellnum) +static struct cell_name * +afs_cellname_lookup_id(afs_int32 cellnum) { struct cell_name *cn; @@ -220,7 +232,8 @@ static struct cell_name *afs_cellname_lookup_id(afs_int32 cellnum) return NULL; } -static struct cell_name *afs_cellname_lookup_name(char *name) +static struct cell_name * +afs_cellname_lookup_name(char *name) { struct cell_name *cn; @@ -231,7 +244,8 @@ static struct cell_name *afs_cellname_lookup_name(char *name) return NULL; } -static void afs_cellname_ref(struct cell_name *cn) +static void +afs_cellname_ref(struct cell_name *cn) { if (!cn->used) { cn->used = 1; @@ -239,7 +253,8 @@ static void afs_cellname_ref(struct cell_name *cn) } } -int afs_cellname_init(ino_t inode, int lookupcode) +int +afs_cellname_init(ino_t inode, int lookupcode) { struct osi_file *tfile; int cc, off = 0; @@ -301,8 +316,8 @@ int afs_cellname_init(ino_t inode, int lookupcode) off += cc; cellname[clen] = '\0'; - if (afs_cellname_lookup_name(cellname) || - afs_cellname_lookup_id(cellnum)) { + if (afs_cellname_lookup_name(cellname) + || afs_cellname_lookup_id(cellnum)) { afs_osi_Free(cellname, clen + 1); break; } @@ -316,7 +331,8 @@ int afs_cellname_init(ino_t inode, int lookupcode) return 0; } -int afs_cellname_write() +int +afs_cellname_write(void) { struct osi_file *tfile; struct cell_name *cn; @@ -383,9 +399,10 @@ int afs_cellname_write() struct cell_alias *afs_cellalias_head; /* Export for kdump */ static afs_int32 afs_cellalias_index; -static int afs_CellOrAliasExists_nl(char *aname); /* Forward declaration */ +static int afs_CellOrAliasExists_nl(char *aname); /* Forward declaration */ -static struct cell_alias *afs_FindCellAlias(char *alias) +static struct cell_alias * +afs_FindCellAlias(char *alias) { struct cell_alias *tc; @@ -395,7 +412,8 @@ static struct cell_alias *afs_FindCellAlias(char *alias) return tc; } -struct cell_alias *afs_GetCellAlias(int index) +struct cell_alias * +afs_GetCellAlias(int index) { struct cell_alias *tc; @@ -408,12 +426,14 @@ struct cell_alias *afs_GetCellAlias(int index) return tc; } -void afs_PutCellAlias(struct cell_alias *a) +void +afs_PutCellAlias(struct cell_alias *a) { return; } -afs_int32 afs_NewCellAlias(char *alias, char *cell) +afs_int32 +afs_NewCellAlias(char *alias, char *cell) { struct cell_alias *tc; @@ -424,7 +444,7 @@ afs_int32 afs_NewCellAlias(char *alias, char *cell) } UpgradeSToWLock(&afs_xcell, 682); - tc = (struct cell_alias *) afs_osi_Alloc(sizeof(struct cell_alias)); + tc = (struct cell_alias *)afs_osi_Alloc(sizeof(struct cell_alias)); tc->alias = afs_strdup(alias); tc->cell = afs_strdup(cell); tc->next = afs_cellalias_head; @@ -463,9 +483,10 @@ afs_int32 afs_NewCellAlias(char *alias, char *cell) struct afs_q CellLRU; /* Export for kdump */ static char *afs_thiscell; -static afs_int32 afs_cellindex; +afs_int32 afs_cellindex; /* Export for kdump */ -static void afs_UpdateCellLRU(struct cell *c) +static void +afs_UpdateCellLRU(struct cell *c) { ObtainWriteLock(&afs_xcell, 100); QRemove(&c->lruq); @@ -473,7 +494,8 @@ static void afs_UpdateCellLRU(struct cell *c) ReleaseWriteLock(&afs_xcell); } -static void afs_RefreshCell(struct cell *ac) +static void +afs_RefreshCell(struct cell *ac) { if (ac->states & CNoAFSDB) return; @@ -481,22 +503,33 @@ static void afs_RefreshCell(struct cell *ac) afs_LookupAFSDB(ac->cellName); } -static void *afs_TraverseCells_nl(void *(*cb)(struct cell *, void *), void *arg) +static void * +afs_TraverseCells_nl(void *(*cb) (struct cell *, void *), void *arg) { struct afs_q *cq, *tq; struct cell *tc; void *ret = NULL; for (cq = CellLRU.next; cq != &CellLRU; cq = tq) { - tc = QTOC(cq); tq = QNext(cq); + tc = QTOC(cq); + + /* This is assuming that a NULL return is acceptable. */ + if (cq) { + tq = QNext(cq); + } else { + return NULL; + } + ret = cb(tc, arg); - if (ret) break; + if (ret) + break; } return ret; } -void *afs_TraverseCells(void *(*cb)(struct cell *, void *), void *arg) +void * +afs_TraverseCells(void *(*cb) (struct cell *, void *), void *arg) { void *ret; @@ -507,32 +540,43 @@ void *afs_TraverseCells(void *(*cb)(struct cell *, void *), void *arg) return ret; } -static void *afs_choose_cell_by_name(struct cell *cell, void *arg) +static void * +afs_choose_cell_by_name(struct cell *cell, void *arg) { - return strcmp(cell->cellName, (char *) arg) ? NULL : cell; + if (!arg) { + /* Safety net */ + return cell; + } else { + return strcmp(cell->cellName, (char *)arg) ? NULL : cell; + } } -static void *afs_choose_cell_by_num(struct cell *cell, void *arg) +static void * +afs_choose_cell_by_num(struct cell *cell, void *arg) { return (cell->cellNum == *((afs_int32 *) arg)) ? cell : NULL; } -static void *afs_choose_cell_by_index(struct cell *cell, void *arg) +static void * +afs_choose_cell_by_index(struct cell *cell, void *arg) { return (cell->cellIndex == *((afs_int32 *) arg)) ? cell : NULL; } -static struct cell *afs_FindCellByName_nl(char *acellName, afs_int32 locktype) +static struct cell * +afs_FindCellByName_nl(char *acellName, afs_int32 locktype) { return afs_TraverseCells_nl(&afs_choose_cell_by_name, acellName); } -static struct cell *afs_FindCellByName(char *acellName, afs_int32 locktype) +static struct cell * +afs_FindCellByName(char *acellName, afs_int32 locktype) { return afs_TraverseCells(&afs_choose_cell_by_name, acellName); } -struct cell *afs_GetCellByName(char *acellName, afs_int32 locktype) +struct cell * +afs_GetCellByName(char *acellName, afs_int32 locktype) { struct cell *tc; @@ -550,7 +594,8 @@ struct cell *afs_GetCellByName(char *acellName, afs_int32 locktype) return tc; } -struct cell *afs_GetCell(afs_int32 cellnum, afs_int32 locktype) +struct cell * +afs_GetCell(afs_int32 cellnum, afs_int32 locktype) { struct cell *tc; struct cell_name *cn; @@ -568,7 +613,8 @@ struct cell *afs_GetCell(afs_int32 cellnum, afs_int32 locktype) return tc; } -struct cell *afs_GetCellStale(afs_int32 cellnum, afs_int32 locktype) +struct cell * +afs_GetCellStale(afs_int32 cellnum, afs_int32 locktype) { struct cell *tc; @@ -580,7 +626,8 @@ struct cell *afs_GetCellStale(afs_int32 cellnum, afs_int32 locktype) return tc; } -struct cell *afs_GetCellByIndex(afs_int32 index, afs_int32 locktype) +struct cell * +afs_GetCellByIndex(afs_int32 index, afs_int32 locktype) { struct cell *tc; @@ -590,17 +637,31 @@ struct cell *afs_GetCellByIndex(afs_int32 index, afs_int32 locktype) return tc; } -struct cell *afs_GetPrimaryCell(afs_int32 locktype) +struct cell * +afs_GetPrimaryCell(afs_int32 locktype) { return afs_GetCellByName(afs_thiscell, locktype); } -int afs_IsPrimaryCell(struct cell *cell) +int +afs_IsPrimaryCell(struct cell *cell) { - return strcmp(cell->cellName, afs_thiscell) ? 0 : 1; + /* Simple safe checking */ + if (!cell) { + return 0; + } else if (!afs_thiscell) { + /* This is simply a safety net to avoid seg faults especially when + * using a user-space library. afs_SetPrimaryCell() should be set + * prior to this call. */ + afs_SetPrimaryCell(cell->cellName); + return 1; + } else { + return strcmp(cell->cellName, afs_thiscell) ? 0 : 1; + } } -int afs_IsPrimaryCellNum(afs_int32 cellnum) +int +afs_IsPrimaryCellNum(afs_int32 cellnum) { struct cell *tc; int primary = 0; @@ -614,7 +675,8 @@ int afs_IsPrimaryCellNum(afs_int32 cellnum) return primary; } -afs_int32 afs_SetPrimaryCell(char *acellName) +afs_int32 +afs_SetPrimaryCell(char *acellName) { ObtainWriteLock(&afs_xcell, 691); if (afs_thiscell) @@ -624,11 +686,12 @@ afs_int32 afs_SetPrimaryCell(char *acellName) return 0; } -afs_int32 afs_NewCell(char *acellName, afs_int32 *acellHosts, int aflags, - char *linkedcname, u_short fsport, u_short vlport, int timeout) +afs_int32 +afs_NewCell(char *acellName, afs_int32 * acellHosts, int aflags, + char *linkedcname, u_short fsport, u_short vlport, int timeout) { - struct cell *tc, *tcl=0; - afs_int32 i, newc=0, code=0; + struct cell *tc, *tcl = 0; + afs_int32 i, newc = 0, code = 0; AFS_STATCNT(afs_NewCell); @@ -638,8 +701,8 @@ afs_int32 afs_NewCell(char *acellName, afs_int32 *acellHosts, int aflags, if (tc) { aflags &= ~CNoSUID; } else { - tc = (struct cell *) afs_osi_Alloc(sizeof(struct cell)); - memset((char *) tc, 0, sizeof(*tc)); + tc = (struct cell *)afs_osi_Alloc(sizeof(struct cell)); + memset((char *)tc, 0, sizeof(*tc)); tc->cellName = afs_strdup(acellName); tc->fsport = AFS_FSPORT; tc->vlport = AFS_VLPORT; @@ -657,21 +720,24 @@ afs_int32 afs_NewCell(char *acellName, afs_int32 *acellHosts, int aflags, * it must get servers from AFSDB. */ if (timeout && !tc->timeout && tc->cellHosts[0]) { - code = EEXIST; /* This code is checked for in afs_LookupAFSDB */ + code = EEXIST; /* This code is checked for in afs_LookupAFSDB */ goto bad; } /* we don't want to keep pinging old vlservers which were down, * since they don't matter any more. It's easier to do this than * to remove the server from its various hash tables. */ - for (i=0; icellHosts[i]) break; + for (i = 0; i < MAXCELLHOSTS; i++) { + if (!tc->cellHosts[i]) + break; tc->cellHosts[i]->flags &= ~SRVR_ISDOWN; tc->cellHosts[i]->flags |= SRVR_ISGONE; } - if (fsport) tc->fsport = fsport; - if (vlport) tc->vlport = vlport; + if (fsport) + tc->fsport = fsport; + if (vlport) + tc->vlport = vlport; if (aflags & CLinkedCell) { if (!linkedcname) { @@ -694,10 +760,11 @@ afs_int32 afs_NewCell(char *acellName, afs_int32 *acellHosts, int aflags, tc->timeout = timeout; memset((char *)tc->cellHosts, 0, sizeof(tc->cellHosts)); - for (i=0; ivlport, WRITE_LOCK, NULL, 0); ts->cell = tc; ts->flags &= ~SRVR_ISGONE; @@ -726,7 +793,7 @@ afs_int32 afs_NewCell(char *acellName, afs_int32 *acellHosts, int aflags, afs_DynrootInvalidate(); return 0; -bad: + bad: if (newc) { afs_osi_FreeStr(tc->cellName); afs_osi_Free(tc, sizeof(struct cell)); @@ -747,7 +814,8 @@ bad: * afs_CellNumValid: check if a cell number is valid (also set the used flag) */ -void afs_CellInit() +void +afs_CellInit() { RWLOCK_INIT(&afs_xcell, "afs_xcell"); #ifdef AFS_AFSDB_ENV @@ -759,7 +827,8 @@ void afs_CellInit() afs_cellalias_index = 0; } -void shutdown_cell() +void +shutdown_cell() { struct afs_q *cq, *tq; struct cell *tc; @@ -767,25 +836,42 @@ void shutdown_cell() RWLOCK_INIT(&afs_xcell, "afs_xcell"); for (cq = CellLRU.next; cq != &CellLRU; cq = tq) { - tc = QTOC(cq); tq = QNext(cq); - if (tc->cellName) afs_osi_FreeStr(tc->cellName); + tc = QTOC(cq); + tq = QNext(cq); + if (tc->cellName) + afs_osi_FreeStr(tc->cellName); afs_osi_Free(tc, sizeof(struct cell)); } QInit(&CellLRU); + +{ + struct cell_name *cn = afs_cellname_head; + + while (cn) { + struct cell_name *next = cn->next; + + afs_osi_FreeStr(cn->cellname); + afs_osi_Free(cn, sizeof(struct cell_name)); + cn = next; + } +} } -void afs_RemoveCellEntry(struct server *srvp) +void +afs_RemoveCellEntry(struct server *srvp) { struct cell *tc; afs_int32 j, k; tc = srvp->cell; - if (!tc) return; + if (!tc) + return; /* Remove the server structure from the cell list - if there */ ObtainWriteLock(&tc->lock, 200); - for (j=k=0; jcellHosts[j]) break; + for (j = k = 0; j < MAXCELLHOSTS; j++) { + if (!tc->cellHosts[j]) + break; if (tc->cellHosts[j] != srvp) { tc->cellHosts[k++] = tc->cellHosts[j]; } @@ -793,13 +879,14 @@ void afs_RemoveCellEntry(struct server *srvp) if (k == 0) { /* What do we do if we remove the last one? */ } - for (; kcellHosts[k] = 0; } ReleaseWriteLock(&tc->lock); } -static int afs_CellOrAliasExists_nl(char *aname) +static int +afs_CellOrAliasExists_nl(char *aname) { struct cell *c; struct cell_alias *ca; @@ -819,7 +906,8 @@ static int afs_CellOrAliasExists_nl(char *aname) return 0; } -int afs_CellOrAliasExists(char *aname) +int +afs_CellOrAliasExists(char *aname) { int ret; @@ -830,7 +918,8 @@ int afs_CellOrAliasExists(char *aname) return ret; } -int afs_CellNumValid(afs_int32 cellnum) +int +afs_CellNumValid(afs_int32 cellnum) { struct cell_name *cn; diff --git a/src/afs/afs_chunk.c b/src/afs/afs_chunk.c index 749045afb..8d8e3131e 100644 --- a/src/afs/afs_chunk.c +++ b/src/afs/afs_chunk.c @@ -8,14 +8,15 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_chunk.c,v 1.1.1.4 2001/07/14 22:19:18 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_chunk.c,v 1.6 2003/07/15 23:14:11 shadow Exp $"); -#include "../afs/stds.h" -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" +#include "afs/stds.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* * Chunk module. @@ -26,20 +27,22 @@ afs_int32 afs_OtherCSize = AFS_DEFAULTCSIZE; afs_int32 afs_LogChunk = AFS_DEFAULTLSIZE; #ifdef notdef -int afs_ChunkOffset(offset) - afs_int32 offset; +int +afs_ChunkOffset(offset) + afs_int32 offset; { AFS_STATCNT(afs_ChunkOffset); - if (offset < afs_FirstCSize) + if (offset < afs_FirstCSize) return offset; else return ((offset - afs_FirstCSize) & (afs_OtherCSize - 1)); } -int afs_Chunk(offset) - afs_int32 offset; +int +afs_Chunk(offset) + afs_int32 offset; { AFS_STATCNT(afs_Chunk); if (offset < afs_FirstCSize) @@ -49,19 +52,22 @@ int afs_Chunk(offset) } -int afs_ChunkBase(offset) - int offset; +int +afs_ChunkBase(offset) + int offset; { AFS_STATCNT(afs_ChunkBase); if (offset < afs_FirstCSize) return 0; else - return (((offset - afs_FirstCSize) & ~(afs_OtherCSize - 1)) + afs_FirstCSize); + return (((offset - afs_FirstCSize) & ~(afs_OtherCSize - 1)) + + afs_FirstCSize); } -int afs_ChunkSize(offset) - afs_int32 offset; +int +afs_ChunkSize(offset) + afs_int32 offset; { AFS_STATCNT(afs_ChunkSize); if (offset < afs_FirstCSize) @@ -71,19 +77,21 @@ int afs_ChunkSize(offset) } -int afs_ChunkToBase(chunk) - afs_int32 chunk; +int +afs_ChunkToBase(chunk) + afs_int32 chunk; { AFS_STATCNT(afs_ChunkToBase); if (chunk == 0) return 0; - else + else return (afs_FirstCSize + ((chunk - 1) << afs_LogChunk)); } -int afs_ChunkToSize(chunk) - afs_int32 chunk; +int +afs_ChunkToSize(chunk) + afs_int32 chunk; { AFS_STATCNT(afs_ChunkToSize); if (chunk == 0) @@ -93,12 +101,13 @@ int afs_ChunkToSize(chunk) } /* sizes are a power of two */ -int afs_SetChunkSize(chunk) +int +afs_SetChunkSize(chunk) afs_int32 chunk; - { - AFS_STATCNT(afs_SetChunkSize); - afs_LogChunk = chunk; - afs_FirstCSize = afs_OtherCSize = (1 << chunk); - } +{ + AFS_STATCNT(afs_SetChunkSize); + afs_LogChunk = chunk; + afs_FirstCSize = afs_OtherCSize = (1 << chunk); +} #endif /* notdef */ diff --git a/src/afs/afs_chunkops.h b/src/afs/afs_chunkops.h index caff5665a..9a482dc3f 100644 --- a/src/afs/afs_chunkops.h +++ b/src/afs/afs_chunkops.h @@ -26,8 +26,6 @@ #else /* AFS_NOCHUNKING */ -extern afs_int32 afs_OtherCSize, afs_LogChunk, afs_FirstCSize; - #define AFS_OTHERCSIZE (afs_OtherCSize) #define AFS_LOGCHUNK (afs_LogChunk) #define AFS_FIRSTCSIZE (afs_FirstCSize) @@ -37,21 +35,8 @@ extern afs_int32 afs_OtherCSize, afs_LogChunk, afs_FirstCSize; #endif /* AFS_NOCHUNKING */ -#define AFS_MINCHUNK 13 /* 8k is minimum */ -#define AFS_MAXCHUNK 18 /* 256K is maximum */ - -#ifdef notdef -extern int afs_ChunkOffset(), afs_Chunk(), afs_ChunkBase(), afs_ChunkSize(), - afs_ChunkToBase(), afs_ChunkToSize(); - -/* macros */ -#define AFS_CHUNKOFFSET(x) afs_ChunkOffset(x) -#define AFS_CHUNK(x) afs_Chunk(x) -#define AFS_CHUNKBASE(x) afs_ChunkBase(x) -#define AFS_CHUNKSIZE(x) afs_ChunkSize(x) -#define AFS_CHUNKTOBASE(x) afs_ChunkToBase(x) -#define AFS_CHUNKTOSIZE(x) afs_ChunkToSize(x) -#endif +#define AFS_MINCHUNK 13 /* 8k is minimum */ +#define AFS_MAXCHUNK 18 /* 256K is maximum */ #define AFS_CHUNKOFFSET(offset) ((offset < afs_FirstCSize) ? offset : \ ((offset - afs_FirstCSize) & (afs_OtherCSize - 1))) @@ -66,7 +51,7 @@ extern int afs_ChunkOffset(), afs_Chunk(), afs_ChunkBase(), afs_ChunkSize(), afs_OtherCSize) #define AFS_CHUNKTOBASE(chunk) ((chunk == 0) ? 0 : \ - (afs_FirstCSize + ((chunk - 1) << afs_LogChunk))) + ((afs_size_t) afs_FirstCSize + ((afs_size_t) (chunk - 1) << afs_LogChunk))) #define AFS_CHUNKTOSIZE(chunk) ((chunk == 0) ? afs_FirstCSize : afs_OtherCSize) @@ -74,28 +59,40 @@ extern int afs_ChunkOffset(), afs_Chunk(), afs_ChunkBase(), afs_ChunkSize(), #define AFS_SETCHUNKSIZE(chunk) { afs_LogChunk = chunk; \ afs_FirstCSize = afs_OtherCSize = (1 << chunk); } - -extern void afs_CacheTruncateDaemon(); - /* * Functions exported by a cache type */ -extern struct afs_cacheOps *afs_cacheType; - struct afs_cacheOps { - void *(*open)(); - int (*truncate)(); - int (*fread)(); - int (*fwrite)(); - int (*close)(); - int (*vread)(); - int (*vwrite)(); - int (*FetchProc)(); - int (*StoreProc)(); - struct dcache *(*GetDSlot)(); - struct volume *(*GetVolSlot)(); - int (*HandleLink)(); +#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_SGI62_ENV) + void *(*open) (ino_t ainode); +#else + void *(*open) (afs_int32 ainode); +#endif + int (*truncate) (struct osi_file * fp, afs_int32 len); + int (*fread) (struct osi_file * fp, int offset, void *buf, afs_int32 len); + int (*fwrite) (struct osi_file * fp, afs_int32 offset, void *buf, + afs_int32 len); + int (*close) (struct osi_file * fp); + int (*vread) (register struct vcache * avc, struct uio * auio, + struct AFS_UCRED * acred, daddr_t albn, struct buf ** abpp, + int noLock); + int (*vwrite) (register struct vcache * avc, struct uio * auio, int aio, + struct AFS_UCRED * acred, int noLock); + int (*FetchProc) (register struct rx_call * acall, + struct osi_file * afile, afs_size_t abase, + struct dcache * adc, struct vcache * avc, + afs_size_t * abytesToXferP, afs_size_t * abytesXferredP, + afs_int32 lengthFound); + int (*StoreProc) (register struct rx_call * acall, + struct osi_file * afile, register afs_int32 alen, + struct vcache * avc, int *shouldWake, + afs_size_t * abytesToXferP, + afs_size_t * abytesXferredP); + struct dcache *(*GetDSlot) (register afs_int32 aslot, + register struct dcache * tmpdc); + struct volume *(*GetVolSlot) (void); + int (*HandleLink) (register struct vcache * avc, struct vrequest * areq); }; /* Ideally we should have used consistent naming - like COP_OPEN, COP_TRUNCATE, etc. */ @@ -108,12 +105,9 @@ struct afs_cacheOps { #define afs_GetVolSlot() (*(afs_cacheType->GetVolSlot))() #define afs_HandleLink(avc, areq) (*(afs_cacheType->HandleLink))(avc, areq) -#define afs_CacheFetchProc(call, file, base, adc, avc, toxfer, xfered) \ - (*(afs_cacheType->FetchProc))(call, file, base, adc, avc, toxfer, xfered) +#define afs_CacheFetchProc(call, file, base, adc, avc, toxfer, xfered, length) \ + (*(afs_cacheType->FetchProc))(call, file, (afs_size_t)base, adc, avc, (afs_size_t *)toxfer, (afs_size_t *)xfered, length) #define afs_CacheStoreProc(call, file, bytes, avc, wake, toxfer, xfered) \ (*(afs_cacheType->StoreProc))(call, file, bytes, avc, wake, toxfer, xfered) #endif /* AFS_CHUNKOPS */ - - - diff --git a/src/afs/afs_conn.c b/src/afs/afs_conn.c index d8aeb9a04..404dda10a 100644 --- a/src/afs/afs_conn.c +++ b/src/afs/afs_conn.c @@ -11,12 +11,13 @@ * Implements: */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_conn.c,v 1.1.1.9 2003/07/30 17:07:59 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_conn.c,v 1.13 2003/07/15 23:14:11 shadow Exp $"); -#include "../afs/stds.h" -#include "../afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/stds.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ #if !defined(UKERNEL) #if !defined(AFS_LINUX20_ENV) @@ -25,15 +26,15 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_conn.c,v 1.1.1.9 2003/07/30 17: #include #ifdef AFS_SGI62_ENV -#include "../h/hashing.h" +#include "h/hashing.h" #endif #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV) #include #endif /* ! AFS_HPUX110_ENV */ #endif /* !defined(UKERNEL) */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ #if defined(AFS_SUN56_ENV) #include @@ -44,147 +45,135 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_conn.c,v 1.1.1.9 2003/07/30 17: #include #endif -/* Imported variables */ -/* these are for storing alternate interface addresses - from afs_callback.c */ -extern struct interfaceAddr afs_cb_interface; - - -/* Imported functions. */ -struct rx_securityClass *rxnull_NewClientSecurityObject(); -struct rx_securityClass *rxkad_NewClientSecurityObject(); - /* Exported variables */ -afs_rwlock_t afs_xconn; /* allocation lock for new things */ -afs_rwlock_t afs_xinterface; /* for multiple client address */ - -/* Local variables */ -afs_int32 cryptall = 0; +afs_rwlock_t afs_xconn; /* allocation lock for new things */ +afs_rwlock_t afs_xinterface; /* for multiple client address */ +afs_int32 cryptall = 0; /* encrypt all communications */ unsigned int VNOSERVERS = 0; -struct conn *afs_Conn(afid, areq, locktype) - register struct VenusFid *afid; - register struct vrequest *areq; - afs_int32 locktype; +struct conn * +afs_Conn(register struct VenusFid *afid, register struct vrequest *areq, + afs_int32 locktype) { - u_short fsport=AFS_FSPORT; - struct volume *tv; - struct conn *tconn = (struct conn *)0; - struct srvAddr *lowp= (struct srvAddr *)0; - struct unixuser *tu; - int notbusy; - int i; - struct srvAddr *sa1p; - - AFS_STATCNT(afs_Conn); - tv = afs_GetVolume(afid, areq, READ_LOCK); - if (!tv) { - if (areq) { - afs_FinalizeReq(areq); - areq->volumeError = 1; - } - return (struct conn *) 0; - } - - if (tv->serverHost[0] && tv->serverHost[0]->cell) { - fsport = tv->serverHost[0]->cell->fsport; - } - else { - VNOSERVERS++; - } - - /* First is always lowest rank, if it's up */ - if ((tv->status[0] == not_busy) && tv->serverHost[0] && - !(tv->serverHost[0]->addr->sa_flags & SRVR_ISDOWN)) - lowp = tv->serverHost[0]->addr; - - /* Otherwise we look at all of them. There are seven levels of - * not_busy. This means we will check a volume seven times before it - * is marked offline. Ideally, we only need two levels, but this - * serves a second purpose of waiting some number of seconds before - * the client decides the volume is offline (ie: a clone could finish - * in this time). - */ - for (notbusy = not_busy; (!lowp && (notbusy <= end_not_busy)); notbusy++) { - for (i=0 ;iserverHost[i];i++) { - if (tv->status[i] != notbusy) { - if (tv->status[i] == rd_busy || tv->status[i] == rdwr_busy) { - if (!areq->busyCount) - areq->busyCount++; - } else if (tv->status[i] == offline) { - if (!areq->volumeError) - areq->volumeError = VOLMISSING; + u_short fsport = AFS_FSPORT; + struct volume *tv; + struct conn *tconn = NULL; + struct srvAddr *lowp = NULL; + struct unixuser *tu; + int notbusy; + int i; + struct srvAddr *sa1p; + + AFS_STATCNT(afs_Conn); + tv = afs_GetVolume(afid, areq, READ_LOCK); + if (!tv) { + if (areq) { + afs_FinalizeReq(areq); + areq->volumeError = 1; + } + return NULL; + } + + if (tv->serverHost[0] && tv->serverHost[0]->cell) { + fsport = tv->serverHost[0]->cell->fsport; + } else { + VNOSERVERS++; + } + + /* First is always lowest rank, if it's up */ + if ((tv->status[0] == not_busy) && tv->serverHost[0] + && !(tv->serverHost[0]->addr->sa_flags & SRVR_ISDOWN)) + lowp = tv->serverHost[0]->addr; + + /* Otherwise we look at all of them. There are seven levels of + * not_busy. This means we will check a volume seven times before it + * is marked offline. Ideally, we only need two levels, but this + * serves a second purpose of waiting some number of seconds before + * the client decides the volume is offline (ie: a clone could finish + * in this time). + */ + for (notbusy = not_busy; (!lowp && (notbusy <= end_not_busy)); notbusy++) { + for (i = 0; i < MAXHOSTS && tv->serverHost[i]; i++) { + if (tv->status[i] != notbusy) { + if (tv->status[i] == rd_busy || tv->status[i] == rdwr_busy) { + if (!areq->busyCount) + areq->busyCount++; + } else if (tv->status[i] == offline) { + if (!areq->volumeError) + areq->volumeError = VOLMISSING; + } + continue; } - continue; - } - for (sa1p = tv->serverHost[i]->addr; sa1p; sa1p = sa1p->next_sa) { - if (sa1p->sa_flags & SRVR_ISDOWN) - continue; - if (!lowp || (lowp->sa_iprank > sa1p->sa_iprank)) - lowp = sa1p; - } - } - } - afs_PutVolume(tv, READ_LOCK); - - if (lowp) { - tu = afs_GetUser(areq->uid, afid->Cell, SHARED_LOCK); - tconn = afs_ConnBySA(lowp, fsport, afid->Cell, tu, - 0/*!force*/, 1/*create*/, locktype); - - afs_PutUser(tu, SHARED_LOCK); - } - - return tconn; -} /*afs_Conn*/ - - -struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport, - afs_int32 acell, struct unixuser *tu, - int force_if_down, afs_int32 create, afs_int32 locktype) + for (sa1p = tv->serverHost[i]->addr; sa1p; sa1p = sa1p->next_sa) { + if (sa1p->sa_flags & SRVR_ISDOWN) + continue; + if (!lowp || (lowp->sa_iprank > sa1p->sa_iprank)) + lowp = sa1p; + } + } + } + afs_PutVolume(tv, READ_LOCK); + + if (lowp) { + tu = afs_GetUser(areq->uid, afid->Cell, SHARED_LOCK); + tconn = afs_ConnBySA(lowp, fsport, afid->Cell, tu, 0 /*!force */ , + 1 /*create */ , locktype); + + afs_PutUser(tu, SHARED_LOCK); + } + + return tconn; +} /*afs_Conn */ + + +struct conn * +afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell, + struct unixuser *tu, int force_if_down, afs_int32 create, + afs_int32 locktype) { - struct conn *tc=0; - struct rx_securityClass *csec; /*Security class object*/ - int isec; /*Security index*/ + struct conn *tc = 0; + struct rx_securityClass *csec; /*Security class object */ + int isec; /*Security index */ int service; if (!sap || ((sap->sa_flags & SRVR_ISDOWN) && !force_if_down)) { /* sa is known down, and we don't want to force it. */ - return (struct conn *)0; + return NULL; } - ObtainSharedLock(&afs_xconn,15); - for (tc = sap->conns; tc; tc=tc->next) { - if (tc->user == tu && tc->port == aport) { - break; - } - } + ObtainSharedLock(&afs_xconn, 15); + for (tc = sap->conns; tc; tc = tc->next) { + if (tc->user == tu && tc->port == aport) { + break; + } + } if (!tc && !create) { - ReleaseSharedLock(&afs_xconn); - return (struct conn *)0; + ReleaseSharedLock(&afs_xconn); + return NULL; } if (!tc) { - /* No such connection structure exists. Create one and splice it in. - * Make sure the server record has been marked as used (for the purposes - * of calculating up & down times, it's now considered to be an - * ``active'' server). Also make sure the server's lastUpdateEvalTime - * gets set, marking the time of its ``birth''. - */ - UpgradeSToWLock(&afs_xconn,37); - tc = (struct conn *) afs_osi_Alloc(sizeof(struct conn)); + /* No such connection structure exists. Create one and splice it in. + * Make sure the server record has been marked as used (for the purposes + * of calculating up & down times, it's now considered to be an + * ``active'' server). Also make sure the server's lastUpdateEvalTime + * gets set, marking the time of its ``birth''. + */ + UpgradeSToWLock(&afs_xconn, 37); + tc = (struct conn *)afs_osi_Alloc(sizeof(struct conn)); memset((char *)tc, 0, sizeof(struct conn)); tc->user = tu; tc->port = aport; tc->srvr = sap; - tc->refCount = 0; /* bumped below */ + tc->refCount = 0; /* bumped below */ tc->forceConnectFS = 1; - tc->id = (struct rx_connection *) 0; + tc->id = (struct rx_connection *)0; tc->next = sap->conns; sap->conns = tc; - afs_ActivateServer(sap); + afs_ActivateServer(sap); ConvertWToSLock(&afs_xconn); } @@ -192,21 +181,21 @@ struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport, if (tu->states & UTokensBad) { /* we may still have an authenticated RPC connection here, - * we'll have to create a new, unauthenticated, connection. - * Perhaps a better way to do this would be to set - * conn->forceConnectFS on all conns when the token first goes - * bad, but that's somewhat trickier, due to locking - * constraints (though not impossible). - */ + * we'll have to create a new, unauthenticated, connection. + * Perhaps a better way to do this would be to set + * conn->forceConnectFS on all conns when the token first goes + * bad, but that's somewhat trickier, due to locking + * constraints (though not impossible). + */ if (tc->id && (rx_SecurityClassOf(tc->id) != 0)) { - tc->forceConnectFS = 1; /* force recreation of connection */ + tc->forceConnectFS = 1; /* force recreation of connection */ } tu->vid = UNDEFVID; /* forcibly disconnect the authentication info */ } - if (tc->forceConnectFS) { - UpgradeSToWLock(&afs_xconn,38); - csec = (struct rx_securityClass *) 0; + if (tc->forceConnectFS) { + UpgradeSToWLock(&afs_xconn, 38); + csec = (struct rx_securityClass *)0; if (tc->id) { AFS_GUNLOCK(); rx_DestroyConnection(tc->id); @@ -222,29 +211,28 @@ struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport, service = 1; isec = 0; if (tu->vid != UNDEFVID) { - int level; - - if (cryptall) { - level=rxkad_crypt; - } else { - level=rxkad_clear; - } - isec=2; - /* kerberos tickets on channel 2 */ - csec = rxkad_NewClientSecurityObject(level, tu->ct.HandShakeKey, - /* kvno */ - tu->ct.AuthHandle, - tu->stLen, tu->stp); + int level; + + if (cryptall) { + level = rxkad_crypt; + } else { + level = rxkad_clear; + } + isec = 2; + /* kerberos tickets on channel 2 */ + csec = rxkad_NewClientSecurityObject(level, tu->ct.HandShakeKey, + /* kvno */ + tu->ct.AuthHandle, tu->stLen, + tu->stp); } if (isec == 0) csec = rxnull_NewClientSecurityObject(); AFS_GUNLOCK(); tc->id = rx_NewConnection(sap->sa_ip, aport, service, csec, isec); AFS_GLOCK(); - if (service == 52) { - rx_SetConnHardDeadTime(tc->id, AFS_HARDDEADTIME); - } - + if (service == 52) { + rx_SetConnHardDeadTime(tc->id, afs_rx_harddead); + } tc->forceConnectFS = 0; /* apparently we're appropriately connected now */ if (csec) @@ -255,6 +243,7 @@ struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport, ReleaseSharedLock(&afs_xconn); return tc; } + /* * afs_ConnByHost * @@ -264,18 +253,13 @@ struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport, * Having force... true and UTokensBad true simultaneously means that the tokens * went bad and we're supposed to create a new, unauthenticated, connection. */ -struct conn *afs_ConnByHost(aserver, aport, acell, areq, aforce, locktype) - struct server *aserver; - afs_int32 acell; - unsigned short aport; - struct vrequest *areq; - int aforce; - afs_int32 locktype; -{ /*afs_ConnByHost*/ - +struct conn * +afs_ConnByHost(struct server *aserver, unsigned short aport, afs_int32 acell, + struct vrequest *areq, int aforce, afs_int32 locktype) +{ struct unixuser *tu; - struct conn *tc=0; - struct srvAddr *sa=0; + struct conn *tc = 0; + struct srvAddr *sa = 0; AFS_STATCNT(afs_ConnByHost); /* @@ -286,36 +270,34 @@ struct conn *afs_ConnByHost(aserver, aport, acell, areq, aforce, locktype) tu = afs_GetUser(areq->uid, acell, SHARED_LOCK); - for (sa = aserver->addr; sa; sa = sa->next_sa) { - tc = afs_ConnBySA(sa, aport, acell, tu, aforce, - 0/*don't create one*/, - locktype); - if (tc) + for (sa = aserver->addr; sa; sa = sa->next_sa) { + tc = afs_ConnBySA(sa, aport, acell, tu, aforce, + 0 /*don't create one */ , + locktype); + if (tc) break; } if (!tc) { - for (sa = aserver->addr; sa; sa = sa->next_sa) { - tc = afs_ConnBySA(sa, aport, acell, tu, aforce, - 1/*create one*/, - locktype); - if (tc) - break; - } + for (sa = aserver->addr; sa; sa = sa->next_sa) { + tc = afs_ConnBySA(sa, aport, acell, tu, aforce, + 1 /*create one */ , + locktype); + if (tc) + break; + } } afs_PutUser(tu, SHARED_LOCK); return tc; -} /*afs_ConnByHost*/ +} /*afs_ConnByHost */ -struct conn *afs_ConnByMHosts(ahosts, aport, acell, areq, locktype) - struct server *ahosts[]; - afs_int32 acell; - unsigned short aport; - register struct vrequest *areq; - afs_int32 locktype; +struct conn * +afs_ConnByMHosts(struct server *ahosts[], unsigned short aport, + afs_int32 acell, register struct vrequest *areq, + afs_int32 locktype) { register afs_int32 i; register struct conn *tconn; @@ -323,50 +305,49 @@ struct conn *afs_ConnByMHosts(ahosts, aport, acell, areq, locktype) /* try to find any connection from the set */ AFS_STATCNT(afs_ConnByMHosts); - for (i=0;irefCount--; -} /*afs_PutConn*/ +} /*afs_PutConn */ /* for multi homed clients, an RPC may timeout because of a client network interface going down. We need to reopen new connections in this case */ -ForceNewConnections(sap) -struct srvAddr *sap; +void +ForceNewConnections(struct srvAddr *sap) { - struct conn *tc=0; + struct conn *tc = 0; - if ( !sap) return; /* defensive check */ + if (!sap) + return; /* defensive check */ - /* if client is not multihomed, do nothing */ - ObtainReadLock(&afs_xinterface); - if ( afs_cb_interface.numberOfInterfaces <= 1 ) - { - ReleaseReadLock(&afs_xinterface); - return; - } + /* if client is not multihomed, do nothing */ + ObtainReadLock(&afs_xinterface); + if (afs_cb_interface.numberOfInterfaces <= 1) { ReleaseReadLock(&afs_xinterface); - - ObtainWriteLock(&afs_xconn,413); - for (tc = sap->conns; tc; tc=tc->next) - tc->forceConnectFS=1; - ReleaseWriteLock(&afs_xconn); + return; + } + ReleaseReadLock(&afs_xinterface); + + ObtainWriteLock(&afs_xconn, 413); + for (tc = sap->conns; tc; tc = tc->next) + tc->forceConnectFS = 1; + ReleaseWriteLock(&afs_xconn); } diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c index d091eeb1e..87848b035 100644 --- a/src/afs/afs_daemons.c +++ b/src/afs/afs_daemons.c @@ -8,14 +8,20 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_daemons.c,v 1.1.1.9 2003/04/13 19:02:35 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_daemons.c,v 1.28 2004/03/11 19:14:46 rees Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics gathering code */ -#include "../afs/afs_cbqueue.h" +#ifdef AFS_AIX51_ENV +#define __FULL_PROTO +#include +#endif + +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics gathering code */ +#include "afs/afs_cbqueue.h" #ifdef AFS_AIX_ENV #include /* for vm_att(), vm_det() */ #endif @@ -26,46 +32,42 @@ afs_lock_t afs_xbrs; /* lock for brs */ static int brsInit = 0; short afs_brsWaiters = 0; /* number of users waiting for brs buffers */ short afs_brsDaemons = 0; /* number of daemons waiting for brs requests */ -struct brequest afs_brs[NBRS]; /* request structures */ +struct brequest afs_brs[NBRS]; /* request structures */ struct afs_osi_WaitHandle AFS_WaitHandler, AFS_CSWaitHandler; +static int afs_brs_count = 0; /* request counter, to service reqs in order */ -static int rxepoch_checked=0; +static int rxepoch_checked = 0; #define afs_CheckRXEpoch() {if (rxepoch_checked == 0 && rxkad_EpochWasSet) { \ rxepoch_checked = 1; afs_GCUserData(/* force flag */ 1); } } -extern char afs_rootVolumeName[]; -extern struct vcache *afs_globalVp; -extern struct VenusFid afs_rootFid; -extern struct osi_dev cacheDev; -extern char *afs_indexFlags; -extern afs_rwlock_t afs_xvcache; -extern struct afs_exporter *afs_nfsexporter; -extern int cacheDiskType; -extern int afs_BumpBase(); -extern void afs_CheckCallbacks(); - /* PAG garbage collection */ /* We induce a compile error if param.h does not define AFS_GCPAGS */ -afs_int32 afs_gcpags=AFS_GCPAGS; -afs_int32 afs_gcpags_procsize; +afs_int32 afs_gcpags = AFS_GCPAGS; +afs_int32 afs_gcpags_procsize = 0; afs_int32 afs_CheckServerDaemonStarted = 0; -afs_int32 PROBE_INTERVAL=180; /* default to 3 min */ +#ifdef DEFAULT_PROBE_INTERVAL +afs_int32 PROBE_INTERVAL = DEFAULT_PROBE_INTERVAL; /* overridding during compile */ +#else +afs_int32 PROBE_INTERVAL = 180; /* default to 3 min */ +#endif #define PROBE_WAIT() (1000 * (PROBE_INTERVAL - ((afs_random() & 0x7fffffff) \ % (PROBE_INTERVAL/2)))) -afs_CheckServerDaemon() +void +afs_CheckServerDaemon(void) { afs_int32 now, delay, lastCheck, last10MinCheck; afs_CheckServerDaemonStarted = 1; - while (afs_initState < 101) afs_osi_Sleep(&afs_initState); - afs_osi_Wait(PROBE_WAIT(), &AFS_CSWaitHandler, 0); - + while (afs_initState < 101) + afs_osi_Sleep(&afs_initState); + afs_osi_Wait(PROBE_WAIT(), &AFS_CSWaitHandler, 0); + last10MinCheck = lastCheck = osi_Time(); - while ( 1 ) { + while (1) { if (afs_termState == AFSOP_STOP_CS) { afs_termState = AFSOP_STOP_BKG; afs_osi_Wakeup(&afs_termState); @@ -74,13 +76,13 @@ afs_CheckServerDaemon() now = osi_Time(); if (PROBE_INTERVAL + lastCheck <= now) { - afs_CheckServers(1, (struct cell *) 0); /* check down servers */ + afs_CheckServers(1, NULL); /* check down servers */ lastCheck = now = osi_Time(); } if (600 + last10MinCheck <= now) { afs_Trace1(afs_iclSetp, CM_TRACE_PROBEUP, ICL_TYPE_INT32, 600); - afs_CheckServers(0, (struct cell *) 0); + afs_CheckServers(0, NULL); last10MinCheck = now = osi_Time(); } /* shutdown check. */ @@ -97,14 +99,15 @@ afs_CheckServerDaemon() delay -= now; if (delay < 1) delay = 1; - afs_osi_Wait(delay * 1000, &AFS_CSWaitHandler, 0); + afs_osi_Wait(delay * 1000, &AFS_CSWaitHandler, 0); } afs_CheckServerDaemonStarted = 0; } -void afs_Daemon() { +void +afs_Daemon(void) +{ afs_int32 code; - extern struct afs_exporter *root_exported; struct afs_exporter *exporter; afs_int32 now; afs_int32 last3MinCheck, last10MinCheck, last60MinCheck, lastNMinCheck; @@ -113,10 +116,12 @@ void afs_Daemon() { char cs_warned = 0; AFS_STATCNT(afs_Daemon); - last1MinCheck = last3MinCheck = last60MinCheck = last10MinCheck = lastNMinCheck = 0; + last1MinCheck = last3MinCheck = last60MinCheck = last10MinCheck = + lastNMinCheck = 0; afs_rootFid.Fid.Volume = 0; - while (afs_initState < 101) afs_osi_Sleep(&afs_initState); + while (afs_initState < 101) + afs_osi_Sleep(&afs_initState); now = osi_Time(); lastCBSlotBump = now; @@ -124,22 +129,22 @@ void afs_Daemon() { /* when a lot of clients are booted simultaneously, they develop * annoying synchronous VL server bashing behaviors. So we stagger them. */ - last1MinCheck = now + ((afs_random() & 0x7fffffff) % 60); /* an extra 30 */ + last1MinCheck = now + ((afs_random() & 0x7fffffff) % 60); /* an extra 30 */ last3MinCheck = now - 90 + ((afs_random() & 0x7fffffff) % 180); last60MinCheck = now - 1800 + ((afs_random() & 0x7fffffff) % 3600); last10MinCheck = now - 300 + ((afs_random() & 0x7fffffff) % 600); lastNMinCheck = now - 90 + ((afs_random() & 0x7fffffff) % 180); /* start off with afs_initState >= 101 (basic init done) */ - while(1) { - afs_CheckCallbacks(20); /* unstat anything which will expire soon */ - + while (1) { + afs_CheckCallbacks(20); /* unstat anything which will expire soon */ + /* things to do every 20 seconds or less - required by protocol spec */ - if (afs_nfsexporter) + if (afs_nfsexporter) afs_FlushActiveVcaches(0); /* flush NFS writes */ - afs_FlushVCBs(1); /* flush queued callbacks */ + afs_FlushVCBs(1); /* flush queued callbacks */ afs_MaybeWakeupTruncateDaemon(); /* free cache space if have too */ - rx_CheckPackets(); /* Does RX need more packets? */ + rx_CheckPackets(); /* Does RX need more packets? */ #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV) /* * Hack: We always want to make sure there are plenty free @@ -147,34 +152,39 @@ void afs_Daemon() { * worry about rx (with disabled interrupts) to have to call * malloc). So we do the dummy call below... */ - if (((afs_stats_cmperf.SmallBlocksAlloced - afs_stats_cmperf.SmallBlocksActive) + if (((afs_stats_cmperf.SmallBlocksAlloced - + afs_stats_cmperf.SmallBlocksActive) <= AFS_SALLOC_LOW_WATER)) osi_FreeSmallSpace(osi_AllocSmallSpace(AFS_SMALLOCSIZ)); - if (((afs_stats_cmperf.MediumBlocksAlloced - afs_stats_cmperf.MediumBlocksActive) - <= AFS_MALLOC_LOW_WATER+50)) - osi_AllocMoreMSpace(AFS_MALLOC_LOW_WATER * 2); + if (((afs_stats_cmperf.MediumBlocksAlloced - + afs_stats_cmperf.MediumBlocksActive) + <= AFS_MALLOC_LOW_WATER + 50)) + osi_AllocMoreMSpace(AFS_MALLOC_LOW_WATER * 2); #endif - + now = osi_Time(); - if (lastCBSlotBump + CBHTSLOTLEN < now) { /* pretty time-dependant */ + if (lastCBSlotBump + CBHTSLOTLEN < now) { /* pretty time-dependant */ lastCBSlotBump = now; if (afs_BumpBase()) { - afs_CheckCallbacks(20); /* unstat anything which will expire soon */ + afs_CheckCallbacks(20); /* unstat anything which will expire soon */ } } - + if (last1MinCheck + 60 < now) { /* things to do every minute */ - DFlush(); /* write out dir buffers */ + DFlush(); /* write out dir buffers */ afs_WriteThroughDSlots(); /* write through cacheinfo entries */ - afs_FlushActiveVcaches(1);/* keep flocks held & flush nfs writes */ + afs_FlushActiveVcaches(1); /* keep flocks held & flush nfs writes */ +#ifdef AFS_DISCON_ENV + afs_StoreDirtyVcaches(); +#endif afs_CheckRXEpoch(); last1MinCheck = now; } - + if (last3MinCheck + 180 < now) { afs_CheckTokenCache(); /* check for access cache resets due to expired - tickets */ + * tickets */ last3MinCheck = now; } if (!afs_CheckServerDaemonStarted) { @@ -185,34 +195,34 @@ void afs_Daemon() { } if (lastNMinCheck + PROBE_INTERVAL < now) { /* only check down servers */ - afs_CheckServers(1, (struct cell *) 0); + afs_CheckServers(1, NULL); lastNMinCheck = now; } } if (last10MinCheck + 600 < now) { -#ifdef AFS_USERSPACE_IP_ADDR +#ifdef AFS_USERSPACE_IP_ADDR extern int rxi_GetcbiInfo(void); #endif - afs_Trace1(afs_iclSetp, CM_TRACE_PROBEUP, - ICL_TYPE_INT32, 600); -#ifdef AFS_USERSPACE_IP_ADDR - if (rxi_GetcbiInfo()) { /* addresses changed from last time */ + afs_Trace1(afs_iclSetp, CM_TRACE_PROBEUP, ICL_TYPE_INT32, 600); +#ifdef AFS_USERSPACE_IP_ADDR + if (rxi_GetcbiInfo()) { /* addresses changed from last time */ afs_FlushCBs(); } -#else /* AFS_USERSPACE_IP_ADDR */ - if (rxi_GetIFInfo()) { /* addresses changed from last time */ +#else /* AFS_USERSPACE_IP_ADDR */ + if (rxi_GetIFInfo()) { /* addresses changed from last time */ afs_FlushCBs(); } #endif /* else AFS_USERSPACE_IP_ADDR */ if (!afs_CheckServerDaemonStarted) - afs_CheckServers(0, (struct cell *) 0); - afs_GCUserData(0); /* gc old conns */ + afs_CheckServers(0, NULL); + afs_GCUserData(0); /* gc old conns */ /* This is probably the wrong way of doing GC for the various exporters but it will suffice for a while */ - for (exporter = root_exported; exporter; exporter = exporter->exp_next) { - (void) EXP_GC(exporter, 0); /* Generalize params */ + for (exporter = root_exported; exporter; + exporter = exporter->exp_next) { + (void)EXP_GC(exporter, 0); /* Generalize params */ } { - static int cnt=0; + static int cnt = 0; if (++cnt < 12) { afs_CheckVolumeNames(AFS_VOLCHECK_EXPIRED | AFS_VOLCHECK_BUSY); @@ -226,12 +236,12 @@ void afs_Daemon() { last10MinCheck = now; } if (last60MinCheck + 3600 < now) { - afs_Trace1(afs_iclSetp, CM_TRACE_PROBEVOLUME, - ICL_TYPE_INT32, 3600); + afs_Trace1(afs_iclSetp, CM_TRACE_PROBEVOLUME, ICL_TYPE_INT32, + 3600); afs_CheckRootVolume(); #if AFS_GCPAGS if (afs_gcpags == AFS_GCPAGS_OK) { - afs_int32 didany; + afs_int32 didany; afs_GCPAGs(&didany); } #endif @@ -239,11 +249,13 @@ void afs_Daemon() { } if (afs_initState < 300) { /* while things ain't rosy */ code = afs_CheckRootVolume(); - if (code == 0) afs_initState = 300; /* succeeded */ - if (afs_initState < 200) afs_initState = 200; /* tried once */ + if (code == 0) + afs_initState = 300; /* succeeded */ + if (afs_initState < 200) + afs_initState = 200; /* tried once */ afs_osi_Wakeup(&afs_initState); } - + /* 18285 is because we're trying to divide evenly into 128, that is, * CBSlotLen, while staying just under 20 seconds. If CBSlotLen * changes, should probably change this interval, too. @@ -251,9 +263,9 @@ void afs_Daemon() { * might not want to wait the entire interval */ now = 18285 - (osi_Time() - now); if (now > 0) { - afs_osi_Wait(now, &AFS_WaitHandler, 0); + afs_osi_Wait(now, &AFS_WaitHandler, 0); } - + if (afs_termState == AFSOP_STOP_AFS) { if (afs_CheckServerDaemonStarted) afs_termState = AFSOP_STOP_CS; @@ -265,9 +277,11 @@ void afs_Daemon() { } } -int afs_CheckRootVolume (void) { +int +afs_CheckRootVolume(void) +{ char rootVolName[32]; - struct volume *tvp; + struct volume *tvp = NULL; int usingDynroot = afs_GetDynrootEnable(); int localcell; @@ -279,111 +293,114 @@ int afs_CheckRootVolume (void) { } if (!usingDynroot) { - struct cell *lc = afs_GetPrimaryCell(READ_LOCK); + struct cell *lc = afs_GetPrimaryCell(READ_LOCK); - if (!lc) - return ENOENT; - localcell = lc->cellNum; - afs_PutCell(lc, READ_LOCK); + if (!lc) + return ENOENT; + localcell = lc->cellNum; + afs_PutCell(lc, READ_LOCK); } if (usingDynroot) { - afs_GetDynrootFid(&afs_rootFid); - tvp = afs_GetVolume(&afs_rootFid, NULL, READ_LOCK); + afs_GetDynrootFid(&afs_rootFid); + tvp = afs_GetVolume(&afs_rootFid, NULL, READ_LOCK); } else { - tvp = afs_GetVolumeByName(rootVolName, localcell, 1, NULL, READ_LOCK); + tvp = afs_GetVolumeByName(rootVolName, localcell, 1, NULL, READ_LOCK); } if (!tvp && !usingDynroot) { - char buf[128]; - int len = strlen(rootVolName); - - if ((len < 9) || strcmp(&rootVolName[len - 9], ".readonly")) { - strcpy(buf, rootVolName); - afs_strcat(buf, ".readonly"); - tvp = afs_GetVolumeByName(buf, localcell, 1, NULL, READ_LOCK); - } + char buf[128]; + int len = strlen(rootVolName); + + if ((len < 9) || strcmp(&rootVolName[len - 9], ".readonly")) { + strcpy(buf, rootVolName); + afs_strcat(buf, ".readonly"); + tvp = afs_GetVolumeByName(buf, localcell, 1, NULL, READ_LOCK); + } } if (tvp) { - if (!usingDynroot) { - int volid = (tvp->roVol? tvp->roVol : tvp->volume); - afs_rootFid.Cell = localcell; - if (afs_rootFid.Fid.Volume && afs_rootFid.Fid.Volume != volid - && afs_globalVp) { - /* If we had a root fid before and it changed location we reset - * the afs_globalVp so that it will be reevaluated. - * Just decrement the reference count. This only occurs during - * initial cell setup and can panic the machine if we set the - * count to zero and fs checkv is executed when the current - * directory is /afs. - */ - AFS_FAST_RELE(afs_globalVp); - afs_globalVp = 0; - } - afs_rootFid.Fid.Volume = volid; - afs_rootFid.Fid.Vnode = 1; - afs_rootFid.Fid.Unique = 1; - } - afs_initState = 300; /* won */ - afs_osi_Wakeup(&afs_initState); - afs_PutVolume(tvp, READ_LOCK); + if (!usingDynroot) { + int volid = (tvp->roVol ? tvp->roVol : tvp->volume); + afs_rootFid.Cell = localcell; + if (afs_rootFid.Fid.Volume && afs_rootFid.Fid.Volume != volid + && afs_globalVp) { + /* If we had a root fid before and it changed location we reset + * the afs_globalVp so that it will be reevaluated. + * Just decrement the reference count. This only occurs during + * initial cell setup and can panic the machine if we set the + * count to zero and fs checkv is executed when the current + * directory is /afs. + */ + AFS_FAST_RELE(afs_globalVp); + afs_globalVp = 0; + } + afs_rootFid.Fid.Volume = volid; + afs_rootFid.Fid.Vnode = 1; + afs_rootFid.Fid.Unique = 1; + } + afs_initState = 300; /* won */ + afs_osi_Wakeup(&afs_initState); + afs_PutVolume(tvp, READ_LOCK); } #ifdef AFS_DEC_ENV /* This is to make sure that we update the root gnode */ /* every time root volume gets released */ { - extern struct vfs *afs_globalVFS; - extern int afs_root(); struct gnode *rootgp; struct mount *mp; int code; /* Only do this if afs_globalVFS is properly set due to race conditions - this routine could be called before the gfs_mount is performed! - Furthermore, afs_root (called below) *waits* until - initState >= 200, so we don't try this until we've gotten - at least that far */ + * this routine could be called before the gfs_mount is performed! + * Furthermore, afs_root (called below) *waits* until + * initState >= 200, so we don't try this until we've gotten + * at least that far */ if (afs_globalVFS && afs_initState >= 200) { if (code = afs_root(afs_globalVFS, &rootgp)) return code; - mp = (struct mount *) afs_globalVFS->vfs_data ; + mp = (struct mount *)afs_globalVFS->vfs_data; mp->m_rootgp = gget(mp, 0, 0, (char *)rootgp); afs_unlock(mp->m_rootgp); /* unlock basic gnode */ - afs_vrele(VTOAFS(rootgp)); /* zap afs_root's vnode hold */ + afs_vrele(VTOAFS(rootgp)); /* zap afs_root's vnode hold */ } } #endif - if (afs_rootFid.Fid.Volume) return 0; - else return ENOENT; + if (afs_rootFid.Fid.Volume) + return 0; + else + return ENOENT; } -/* parm 0 is the pathname, parm 1 to the fetch is the chunk number */ -void BPath(ab) - register struct brequest *ab; { - register struct dcache *tdc; - struct vcache *tvc; - struct vnode *tvn; +/* ptr_parm 0 is the pathname, size_parm 0 to the fetch is the chunk number */ +static void +BPath(register struct brequest *ab) +{ + register struct dcache *tdc = NULL; + struct vcache *tvc = NULL; + struct vnode *tvn = NULL; #ifdef AFS_LINUX22_ENV struct dentry *dp = NULL; #endif - afs_int32 offset, len; + afs_size_t offset, len; struct vrequest treq; afs_int32 code; AFS_STATCNT(BPath); - if (code = afs_InitReq(&treq, ab->cred)) return; + if ((code = afs_InitReq(&treq, ab->cred))) + return; AFS_GUNLOCK(); #ifdef AFS_LINUX22_ENV - code = gop_lookupname((char *)ab->parm[0], AFS_UIOSYS, 1, (struct vnode **) 0, &dp); + code = gop_lookupname((char *)ab->ptr_parm[0], AFS_UIOSYS, 1, NULL, &dp); if (dp) - tvn = (struct vnode*)dp->d_inode; + tvn = (struct vnode *)dp->d_inode; #else - code = gop_lookupname((char *)ab->parm[0], AFS_UIOSYS, 1, (struct vnode **) 0, (struct vnode **)&tvn); + code = gop_lookupname((char *)ab->ptr_parm[0], AFS_UIOSYS, 1, NULL, &tvn); #endif AFS_GLOCK(); - osi_FreeLargeSpace((char *)ab->parm[0]); /* free path name buffer here */ - if (code) return; + osi_FreeLargeSpace((char *)ab->ptr_parm[0]); /* free path name buffer here */ + if (code) + return; /* now path may not have been in afs, so check that before calling our cache manager */ - if (!tvn || !IsAfsVnode((struct vnode *) tvn)) { + if (!tvn || !IsAfsVnode(tvn)) { /* release it and give up */ if (tvn) { #ifdef AFS_DEC_ENV @@ -392,7 +409,7 @@ void BPath(ab) #ifdef AFS_LINUX22_ENV dput(dp); #else - AFS_RELE((struct vnode *) tvn); + AFS_RELE(tvn); #endif #endif } @@ -404,7 +421,7 @@ void BPath(ab) tvc = VTOAFS(tvn); #endif /* here we know its an afs vnode, so we can get the data for the chunk */ - tdc = afs_GetDCache(tvc, ab->parm[1], &treq, &offset, &len, 1); + tdc = afs_GetDCache(tvc, ab->size_parm[0], &treq, &offset, &len, 1); if (tdc) { afs_PutDCache(tdc); } @@ -414,25 +431,28 @@ void BPath(ab) #ifdef AFS_LINUX22_ENV dput(dp); #else - AFS_RELE((struct vnode *) tvn); + AFS_RELE(tvn); #endif #endif } -/* parm 0 to the fetch is the chunk number; parm 1 is the dcache entry to wakeup, - * parm 2 is true iff we should release the dcache entry here. +/* size_parm 0 to the fetch is the chunk number, + * ptr_parm 0 is the dcache entry to wakeup, + * size_parm 1 is true iff we should release the dcache entry here. */ -void BPrefetch(ab) - register struct brequest *ab; { +static void +BPrefetch(register struct brequest *ab) +{ register struct dcache *tdc; register struct vcache *tvc; - afs_int32 offset, len; + afs_size_t offset, len; struct vrequest treq; AFS_STATCNT(BPrefetch); - if (len = afs_InitReq(&treq, ab->cred)) return; - tvc = ab->vnode; - tdc = afs_GetDCache(tvc, (afs_int32)ab->parm[0], &treq, &offset, &len, 1); + if ((len = afs_InitReq(&treq, ab->cred))) + return; + tvc = ab->vc; + tdc = afs_GetDCache(tvc, ab->size_parm[0], &treq, &offset, &len, 1); if (tdc) { afs_PutDCache(tdc); } @@ -440,23 +460,25 @@ void BPrefetch(ab) * use tdc from GetDCache since afs_GetDCache may fail, but someone may * be waiting for our wakeup anyway. */ - tdc = (struct dcache *) (ab->parm[1]); - tdc->flags &= ~DFFetchReq; + tdc = (struct dcache *)(ab->ptr_parm[0]); + ObtainSharedLock(&tdc->lock, 640); + if (tdc->mflags & DFFetchReq) { + UpgradeSToWLock(&tdc->lock, 641); + tdc->mflags &= ~DFFetchReq; + ReleaseWriteLock(&tdc->lock); + } else { + ReleaseSharedLock(&tdc->lock); + } afs_osi_Wakeup(&tdc->validPos); - if (ab->parm[2]) { -#ifdef AFS_SUN5_ENVX - mutex_enter(&tdc->lock); - tdc->refCount--; - mutex_exit(&tdc->lock); -#else + if (ab->size_parm[1]) { afs_PutDCache(tdc); /* put this one back, too */ -#endif } } -void BStore(ab) - register struct brequest *ab; { +static void +BStore(register struct brequest *ab) +{ register struct vcache *tvc; register afs_int32 code; struct vrequest treq; @@ -465,9 +487,10 @@ void BStore(ab) #endif AFS_STATCNT(BStore); - if (code = afs_InitReq(&treq, ab->cred)) return; + if ((code = afs_InitReq(&treq, ab->cred))) + return; code = 0; - tvc = ab->vnode; + tvc = ab->vc; #if defined(AFS_SGI_ENV) /* * Since StoreOnLastReference can end up calling osi_SyncVM which @@ -482,18 +505,18 @@ void BStore(ab) * operations, we hold the VOP_RWLOCK across this transaction as * do the other callers of StoreOnLastReference */ - AFS_RWLOCK((vnode_t *)tvc, 1); + AFS_RWLOCK((vnode_t *) tvc, 1); #endif - ObtainWriteLock(&tvc->lock,209); + ObtainWriteLock(&tvc->lock, 209); code = afs_StoreOnLastReference(tvc, &treq); ReleaseWriteLock(&tvc->lock); #if defined(AFS_SGI_ENV) OSI_SET_CURRENT_CRED(tmpcred); - AFS_RWUNLOCK((vnode_t *)tvc, 1); + AFS_RWUNLOCK((vnode_t *) tvc, 1); #endif /* now set final return code, and wakeup anyone waiting */ if ((ab->flags & BUVALID) == 0) { - ab->code = afs_CheckCode(code, &treq, 43); /* set final code, since treq doesn't go across processes */ + ab->code = afs_CheckCode(code, &treq, 43); /* set final code, since treq doesn't go across processes */ ab->flags |= BUVALID; if (ab->flags & BUWAIT) { ab->flags &= ~BUWAIT; @@ -503,47 +526,50 @@ void BStore(ab) } /* release a held request buffer */ -void afs_BRelease(ab) - register struct brequest *ab; { +void +afs_BRelease(register struct brequest *ab) +{ AFS_STATCNT(afs_BRelease); - MObtainWriteLock(&afs_xbrs,294); + MObtainWriteLock(&afs_xbrs, 294); if (--ab->refCount <= 0) { ab->flags = 0; } - if (afs_brsWaiters) afs_osi_Wakeup(&afs_brsWaiters); + if (afs_brsWaiters) + afs_osi_Wakeup(&afs_brsWaiters); MReleaseWriteLock(&afs_xbrs); } /* return true if bkg fetch daemons are all busy */ -int afs_BBusy() { +int +afs_BBusy(void) +{ AFS_STATCNT(afs_BBusy); - if (afs_brsDaemons > 0) return 0; + if (afs_brsDaemons > 0) + return 0; return 1; } -struct brequest *afs_BQueue(aopcode, avc, dontwait, ause, acred, aparm0, aparm1, aparm2, aparm3) - register short aopcode; - afs_int32 ause, dontwait; - register struct vcache *avc; - struct AFS_UCRED *acred; - /* On 64 bit platforms, "long" does the right thing. */ - long aparm0, aparm1, aparm2, aparm3; +struct brequest * +afs_BQueue(register short aopcode, register struct vcache *avc, + afs_int32 dontwait, afs_int32 ause, struct AFS_UCRED *acred, + afs_size_t asparm0, afs_size_t asparm1, void *apparm0) { register int i; register struct brequest *tb; AFS_STATCNT(afs_BQueue); - MObtainWriteLock(&afs_xbrs,296); + MObtainWriteLock(&afs_xbrs, 296); while (1) { tb = afs_brs; - for(i=0;irefCount == 0) break; + for (i = 0; i < NBRS; i++, tb++) { + if (tb->refCount == 0) + break; } if (i < NBRS) { /* found a buffer */ tb->opcode = aopcode; - tb->vnode = avc; + tb->vc = avc; tb->cred = acred; crhold(tb->cred); if (avc) { @@ -553,13 +579,13 @@ struct brequest *afs_BQueue(aopcode, avc, dontwait, ause, acred, aparm0, aparm1, VN_HOLD(AFSTOV(avc)); #endif } - tb->refCount = ause+1; - tb->parm[0] = aparm0; - tb->parm[1] = aparm1; - tb->parm[2] = aparm2; - tb->parm[3] = aparm3; + tb->refCount = ause + 1; + tb->size_parm[0] = asparm0; + tb->size_parm[1] = asparm1; + tb->ptr_parm[0] = apparm0; tb->flags = 0; tb->code = 0; + tb->ts = afs_brs_count++; /* if daemons are waiting for work, wake them up */ if (afs_brsDaemons > 0) { afs_osi_Wakeup(&afs_brsDaemons); @@ -567,15 +593,15 @@ struct brequest *afs_BQueue(aopcode, avc, dontwait, ause, acred, aparm0, aparm1, MReleaseWriteLock(&afs_xbrs); return tb; } - if (dontwait) { + if (dontwait) { MReleaseWriteLock(&afs_xbrs); - return (struct brequest *)0; + return NULL; } /* no free buffers, sleep a while */ afs_brsWaiters++; MReleaseWriteLock(&afs_xbrs); afs_osi_Sleep(&afs_brsWaiters); - MObtainWriteLock(&afs_xbrs,301); + MObtainWriteLock(&afs_xbrs, 301); afs_brsWaiters--; } } @@ -585,8 +611,8 @@ struct brequest *afs_BQueue(aopcode, avc, dontwait, ause, acred, aparm0, aparm1, /* AIX 4.1 has a much different sleep/wakeup mechanism available for use. * The modifications here will work for either a UP or MP machine. */ -struct buf *afs_asyncbuf = (struct buf*)0; -afs_int32 afs_asyncbuf_cv = EVENT_NULL; +struct buf *afs_asyncbuf = (struct buf *)0; +tid_t afs_asyncbuf_cv = EVENT_NULL; afs_int32 afs_biodcnt = 0; /* in implementing this, I assumed that all external linked lists were @@ -616,47 +642,48 @@ afs_int32 afs_biodcnt = 0; * process and interrupts. */ Simple_lock afs_asyncbuf_lock; -/*static*/ struct buf *afs_get_bioreq() +/*static*/ struct buf * +afs_get_bioreq() { - struct buf *bp = (struct buf *) 0; + struct buf *bp = NULL; struct buf *bestbp; struct buf **bestlbpP, **lbpP; - int bestage, stop; - struct buf *t1P, *t2P; /* temp pointers for list manipulation */ + long bestage, stop; + struct buf *t1P, *t2P; /* temp pointers for list manipulation */ int oldPriority; afs_uint32 wait_ret; struct afs_bioqueue *s; /* ??? Does the forward pointer of the returned buffer need to be NULL? - */ - + */ + /* Disable interrupts from the strategy function, and save the * prior priority level and lock access to the afs_asyncbuf. */ AFS_GUNLOCK(); - oldPriority = disable_lock(INTMAX, &afs_asyncbuf_lock) ; + oldPriority = disable_lock(INTMAX, &afs_asyncbuf_lock); - while(1) { + while (1) { if (afs_asyncbuf) { /* look for oldest buffer */ bp = bestbp = afs_asyncbuf; - bestage = (int) bestbp->av_back; + bestage = (long)bestbp->av_back; bestlbpP = &afs_asyncbuf; while (1) { lbpP = &bp->av_forw; bp = *lbpP; - if (!bp) break; - if ((int) bp->av_back - bestage < 0) { + if (!bp) + break; + if ((long)bp->av_back - bestage < 0) { bestbp = bp; bestlbpP = lbpP; - bestage = (int) bp->av_back; + bestage = (long)bp->av_back; } } bp = bestbp; *bestlbpP = bp->av_forw; break; - } - else { + } else { /* If afs_asyncbuf is null, it is necessary to go to sleep. * e_wakeup_one() ensures that only one thread wakes. */ @@ -664,20 +691,20 @@ Simple_lock afs_asyncbuf_lock; /* The LOCK_HANDLER indicates to e_sleep_thread to only drop the * lock on an MP machine. */ - interrupted = e_sleep_thread(&afs_asyncbuf_cv, - &afs_asyncbuf_lock, - LOCK_HANDLER|INTERRUPTIBLE); - if (interrupted==THREAD_INTERRUPTED) { + interrupted = + e_sleep_thread(&afs_asyncbuf_cv, &afs_asyncbuf_lock, + LOCK_HANDLER | INTERRUPTIBLE); + if (interrupted == THREAD_INTERRUPTED) { /* re-enable interrupts from strategy */ unlock_enable(oldPriority, &afs_asyncbuf_lock); AFS_GLOCK(); - return(NULL); + return (NULL); } - } /* end of "else asyncbuf is empty" */ - } /* end of "inner loop" */ - - /*assert (bp);*/ - + } /* end of "else asyncbuf is empty" */ + } /* end of "inner loop" */ + + /*assert (bp); */ + unlock_enable(oldPriority, &afs_asyncbuf_lock); AFS_GLOCK(); @@ -688,14 +715,14 @@ Simple_lock afs_asyncbuf_lock; * ??? what happens to the gnodes? They're not just cut loose, * are they? */ - for(t1P=bp;;) { - t2P = (struct buf *) t1P->b_work; - t1P->b_vp = ((struct gnode *) t1P->b_vp)->gn_vnode; - if (!t2P) + for (t1P = bp;;) { + t2P = (struct buf *)t1P->b_work; + t1P->b_vp = ((struct gnode *)t1P->b_vp)->gn_vnode; + if (!t2P) break; - t1P = (struct buf *) t2P->b_work; - t2P->b_vp = ((struct gnode *) t2P->b_vp)->gn_vnode; + t1P = (struct buf *)t2P->b_work; + t2P->b_vp = ((struct gnode *)t2P->b_vp)->gn_vnode; if (!t1P) break; } @@ -707,12 +734,12 @@ Simple_lock afs_asyncbuf_lock; * violation, rather than a request for I/O. The remainder * of the outer loop handles the case where the B_PFPROT bit is clear. */ - if (bp->b_flags & B_PFPROT) { + if (bp->b_flags & B_PFPROT) { return (bp); } return (bp); -} /* end of function get_bioreq() */ +} /* end of function get_bioreq() */ /* afs_BioDaemon @@ -724,14 +751,14 @@ Simple_lock afs_asyncbuf_lock; * each making the appropriate syscall, which will cause this * function to be invoked. */ -static int afs_initbiod = 0; /* this is self-initializing code */ +static int afs_initbiod = 0; /* this is self-initializing code */ int DOvmlock = 0; -afs_BioDaemon (nbiods) - afs_int32 nbiods; +int +afs_BioDaemon(afs_int32 nbiods) { afs_int32 code, s, pflg = 0; label_t jmpbuf; - struct buf *bp, *bp1, *tbp1, *tbp2; /* temp pointers only */ + struct buf *bp, *bp1, *tbp1, *tbp2; /* temp pointers only */ caddr_t tmpaddr; struct vnode *vp; struct vcache *vcp; @@ -742,26 +769,20 @@ afs_BioDaemon (nbiods) /* pin lock, since we'll be using it in an interrupt. */ lock_alloc(&afs_asyncbuf_lock, LOCK_ALLOC_PIN, 2, 1); simple_lock_init(&afs_asyncbuf_lock); - pin (&afs_asyncbuf, sizeof(struct buf*)); - pin (&afs_asyncbuf_cv, sizeof(afs_int32)); + pin(&afs_asyncbuf, sizeof(struct buf *)); + pin(&afs_asyncbuf_cv, sizeof(afs_int32)); } /* Ignore HUP signals... */ -#ifdef AFS_AIX41_ENV { - sigset_t sigbits, osigbits; - /* - * add SIGHUP to the set of already masked signals - */ - SIGFILLSET(sigbits); /* allow all signals */ - SIGDELSET(sigbits, SIGHUP); /* except SIGHUP */ - limit_sigs(&sigbits, &osigbits); /* and already masked */ + sigset_t sigbits, osigbits; + /* + * add SIGHUP to the set of already masked signals + */ + SIGFILLSET(sigbits); /* allow all signals */ + SIGDELSET(sigbits, SIGHUP); /* except SIGHUP */ + limit_sigs(&sigbits, &osigbits); /* and already masked */ } -#else - SIGDELSET(u.u_procp->p_sig, SIGHUP); - SIGADDSET(u.u_procp->p_sigignore, SIGHUP); - SIGDELSET(u.u_procp->p_sigcatch, SIGHUP); -#endif /* Main body starts here -- this is an intentional infinite loop, and * should NEVER exit * @@ -771,14 +792,14 @@ afs_BioDaemon (nbiods) while (1) { bp = afs_get_bioreq(); if (!bp) - break; /* we were interrupted */ + break; /* we were interrupted */ if (code = setjmpx(&jmpbuf)) { /* This should not have happend, maybe a lack of resources */ AFS_GUNLOCK(); s = disable_lock(INTMAX, &afs_asyncbuf_lock); - for (bp1 = bp; bp ; bp = bp1) { + for (bp1 = bp; bp; bp = bp1) { if (bp1) - bp1 = (struct buf *) bp1->b_work; + bp1 = (struct buf *)bp1->b_work; bp->b_actf = 0; bp->b_error = code; bp->b_flags |= B_ERROR; @@ -790,23 +811,31 @@ afs_BioDaemon (nbiods) } vcp = VTOAFS(bp->b_vp); if (bp->b_flags & B_PFSTORE) { /* XXXX */ - ObtainWriteLock(&vcp->lock,404); + ObtainWriteLock(&vcp->lock, 404); if (vcp->v.v_gnode->gn_mwrcnt) { - if (vcp->m.Length < bp->b_bcount + (u_int)dbtob(bp->b_blkno)) - vcp->m.Length = bp->b_bcount + (u_int)dbtob(bp->b_blkno); + afs_offs_t newlength = + (afs_offs_t) dbtob(bp->b_blkno) + bp->b_bcount; + if (vcp->m.Length < newlength) { + afs_Trace4(afs_iclSetp, CM_TRACE_SETLENGTH, + ICL_TYPE_STRING, __FILE__, ICL_TYPE_LONG, + __LINE__, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(vcp->m.Length), + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(newlength)); + vcp->m.Length = newlength; + } } ReleaseWriteLock(&vcp->lock); } /* If the buffer represents a protection violation, rather than * an actual request for I/O, no special action need be taken. */ - if ( bp->b_flags & B_PFPROT ) { - iodone (bp); /* Notify all users of the buffer that we're done */ + if (bp->b_flags & B_PFPROT) { + iodone(bp); /* Notify all users of the buffer that we're done */ clrjmpx(&jmpbuf); continue; - } -if (DOvmlock) - ObtainWriteLock(&vcp->pvmlock,211); + } + if (DOvmlock) + ObtainWriteLock(&vcp->pvmlock, 211); /* * First map its data area to a region in the current address space * by calling vm_att with the subspace identifier, and a pointer to @@ -814,17 +843,17 @@ if (DOvmlock) * also want to hang onto the old one. */ tmpaddr = bp->b_baddr; - bp->b_baddr = vm_att (bp->b_xmemd.subspace_id, tmpaddr); + bp->b_baddr = (caddr_t) vm_att(bp->b_xmemd.subspace_id, tmpaddr); tmperr = afs_ustrategy(bp); /* temp variable saves offset calculation */ - if (tmperr) { /* in non-error case */ - bp->b_flags |= B_ERROR; /* should other flags remain set ??? */ + if (tmperr) { /* in non-error case */ + bp->b_flags |= B_ERROR; /* should other flags remain set ??? */ bp->b_error = tmperr; } /* Unmap the buffer's data area by calling vm_det. Reset data area * to the value that we saved above. */ - vm_det(bp->b_un.b_addr); + vm_det(bp->b_baddr); bp->b_baddr = tmpaddr; /* @@ -834,22 +863,22 @@ if (DOvmlock) * using it by calling iodone. * assumes iodone can modify the b_work field. */ - for(tbp1=bp;;) { - tbp2 = (struct buf *) tbp1->b_work; + for (tbp1 = bp;;) { + tbp2 = (struct buf *)tbp1->b_work; iodone(tbp1); - if (!tbp2) + if (!tbp2) break; - tbp1 = (struct buf *) tbp2->b_work; + tbp1 = (struct buf *)tbp2->b_work; iodone(tbp2); if (!tbp1) break; } -if (DOvmlock) - ReleaseWriteLock(&vcp->pvmlock); /* Unlock the vnode. */ + if (DOvmlock) + ReleaseWriteLock(&vcp->pvmlock); /* Unlock the vnode. */ clrjmpx(&jmpbuf); - } /* infinite loop (unless we're interrupted) */ -} /* end of afs_BioDaemon() */ + } /* infinite loop (unless we're interrupted) */ +} /* end of afs_BioDaemon() */ #else /* AFS_AIX41_ENV */ @@ -899,167 +928,165 @@ afs_int32 afs_biodcnt = 0; * The list of sleepers is variable afs_bioqueue. The unique address * on which to sleep is passed to get_bioreq as its parameter. */ -/*static*/ struct buf *afs_get_bioreq(self) - struct afs_bioqueue *self; /* address on which to sleep */ +/*static*/ struct buf * +afs_get_bioreq(self) + struct afs_bioqueue *self; /* address on which to sleep */ { - struct buf *bp = (struct buf *) 0; + struct buf *bp = NULL; struct buf *bestbp; struct buf **bestlbpP, **lbpP; int bestage, stop; - struct buf *t1P, *t2P; /* temp pointers for list manipulation */ + struct buf *t1P, *t2P; /* temp pointers for list manipulation */ int oldPriority; afs_uint32 wait_ret; -struct afs_bioqueue *s; + struct afs_bioqueue *s; /* ??? Does the forward pointer of the returned buffer need to be NULL? - */ - - /* Disable interrupts from the strategy function, and save the - * prior priority level - */ - oldPriority = i_disable ( INTMAX ) ; + */ - /* Each iteration of following loop either pulls - * a buffer off afs_asyncbuf, or sleeps. - */ - while (1) { /* inner loop */ - if (afs_asyncbuf) { - /* look for oldest buffer */ - bp = bestbp = afs_asyncbuf; - bestage = (int) bestbp->av_back; - bestlbpP = &afs_asyncbuf; - while (1) { - lbpP = &bp->av_forw; - bp = *lbpP; - if (!bp) break; - if ((int) bp->av_back - bestage < 0) { - bestbp = bp; - bestlbpP = lbpP; - bestage = (int) bp->av_back; - } - } - bp = bestbp; - *bestlbpP = bp->av_forw; - break; - } - else { - int interrupted; - - /* If afs_asyncbuf is null, it is necessary to go to sleep. - * There are two possibilities: either there is already a - * daemon that is sleeping on the address of afs_asyncbuf, - * or there isn't. - */ - if (afs_bioqueue.sleeper) { - /* enqueue */ - QAdd (&(afs_bioqueue.lruq), &(self->lruq)); - interrupted = sleep ((caddr_t) self, PCATCH|(PZERO + 1)); - if (self->lruq.next != &self->lruq) { /* XXX ##3 XXX */ - QRemove (&(self->lruq)); /* dequeue */ - } -self->cnt++; - afs_bioqueue.sleeper = FALSE; - if (interrupted) { - /* re-enable interrupts from strategy */ - i_enable (oldPriority); - return(NULL); - } - continue; - } else { - afs_bioqueue.sleeper = TRUE; - interrupted = sleep ((caddr_t) &afs_asyncbuf, PCATCH|(PZERO + 1)); - afs_bioqueue.sleeper = FALSE; - if (interrupted) - { - /* - * We need to wakeup another daemon if present - * since we were waiting on afs_asyncbuf. - */ -#ifdef notdef /* The following doesn't work as advertised */ - if (afs_bioqueue.lruq.next != &afs_bioqueue.lruq) - { - struct squeue *bq = afs_bioqueue.lruq.next; - QRemove (bq); - wakeup (bq); - } -#endif - /* re-enable interrupts from strategy */ - i_enable (oldPriority); - return(NULL); - } - continue; - } - - } /* end of "else asyncbuf is empty" */ - } /* end of "inner loop" */ - - /*assert (bp);*/ - - i_enable (oldPriority); /* re-enable interrupts from strategy */ - - /* For the convenience of other code, replace the gnodes in - * the b_vp field of bp and the other buffers on the b_work - * chain with the corresponding vnodes. - * - * ??? what happens to the gnodes? They're not just cut loose, - * are they? - */ - for(t1P=bp;;) { - t2P = (struct buf *) t1P->b_work; - t1P->b_vp = ((struct gnode *) t1P->b_vp)->gn_vnode; - if (!t2P) - break; - - t1P = (struct buf *) t2P->b_work; - t2P->b_vp = ((struct gnode *) t2P->b_vp)->gn_vnode; - if (!t1P) - break; - } + /* Disable interrupts from the strategy function, and save the + * prior priority level + */ + oldPriority = i_disable(INTMAX); - /* If the buffer does not specify I/O, it may immediately - * be returned to the caller. This condition is detected - * by examining the buffer's flags (the b_flags field). If - * the B_PFPROT bit is set, the buffer represents a protection - * violation, rather than a request for I/O. The remainder - * of the outer loop handles the case where the B_PFPROT bit is clear. - */ - if (bp->b_flags & B_PFPROT) { - return (bp); + /* Each iteration of following loop either pulls + * a buffer off afs_asyncbuf, or sleeps. + */ + while (1) { /* inner loop */ + if (afs_asyncbuf) { + /* look for oldest buffer */ + bp = bestbp = afs_asyncbuf; + bestage = (int)bestbp->av_back; + bestlbpP = &afs_asyncbuf; + while (1) { + lbpP = &bp->av_forw; + bp = *lbpP; + if (!bp) + break; + if ((int)bp->av_back - bestage < 0) { + bestbp = bp; + bestlbpP = lbpP; + bestage = (int)bp->av_back; + } } + bp = bestbp; + *bestlbpP = bp->av_forw; + break; + } else { + int interrupted; - /* wake up another process to handle the next buffer, and return - * bp to the caller. - */ - oldPriority = i_disable ( INTMAX ) ; - - /* determine where to find the sleeping process. - * There are two cases: either it is sleeping on - * afs_asyncbuf, or it is sleeping on its own unique - * address. These cases are distinguished by examining - * the sleeper field of afs_bioqueue. - */ - if (afs_bioqueue.sleeper) { - wakeup (&afs_asyncbuf); + /* If afs_asyncbuf is null, it is necessary to go to sleep. + * There are two possibilities: either there is already a + * daemon that is sleeping on the address of afs_asyncbuf, + * or there isn't. + */ + if (afs_bioqueue.sleeper) { + /* enqueue */ + QAdd(&(afs_bioqueue.lruq), &(self->lruq)); + interrupted = sleep((caddr_t) self, PCATCH | (PZERO + 1)); + if (self->lruq.next != &self->lruq) { /* XXX ##3 XXX */ + QRemove(&(self->lruq)); /* dequeue */ + } + self->cnt++; + afs_bioqueue.sleeper = FALSE; + if (interrupted) { + /* re-enable interrupts from strategy */ + i_enable(oldPriority); + return (NULL); } - else { - if (afs_bioqueue.lruq.next == &afs_bioqueue.lruq) { - /* queue is empty, what now? ???*/ - /* Should this be impossible, or does */ - /* it just mean that nobody is sleeping? */; - } - else { + continue; + } else { + afs_bioqueue.sleeper = TRUE; + interrupted = + sleep((caddr_t) & afs_asyncbuf, PCATCH | (PZERO + 1)); + afs_bioqueue.sleeper = FALSE; + if (interrupted) { + /* + * We need to wakeup another daemon if present + * since we were waiting on afs_asyncbuf. + */ +#ifdef notdef /* The following doesn't work as advertised */ + if (afs_bioqueue.lruq.next != &afs_bioqueue.lruq) { struct squeue *bq = afs_bioqueue.lruq.next; - QRemove (bq); - QInit (bq); - wakeup (bq); - afs_bioqueue.sleeper = TRUE; - } + QRemove(bq); + wakeup(bq); + } +#endif + /* re-enable interrupts from strategy */ + i_enable(oldPriority); + return (NULL); } - i_enable (oldPriority); /* re-enable interrupts from strategy */ + continue; + } + + } /* end of "else asyncbuf is empty" */ + } /* end of "inner loop" */ + + /*assert (bp); */ + + i_enable(oldPriority); /* re-enable interrupts from strategy */ + + /* For the convenience of other code, replace the gnodes in + * the b_vp field of bp and the other buffers on the b_work + * chain with the corresponding vnodes. + * + * ??? what happens to the gnodes? They're not just cut loose, + * are they? + */ + for (t1P = bp;;) { + t2P = (struct buf *)t1P->b_work; + t1P->b_vp = ((struct gnode *)t1P->b_vp)->gn_vnode; + if (!t2P) + break; + + t1P = (struct buf *)t2P->b_work; + t2P->b_vp = ((struct gnode *)t2P->b_vp)->gn_vnode; + if (!t1P) + break; + } + + /* If the buffer does not specify I/O, it may immediately + * be returned to the caller. This condition is detected + * by examining the buffer's flags (the b_flags field). If + * the B_PFPROT bit is set, the buffer represents a protection + * violation, rather than a request for I/O. The remainder + * of the outer loop handles the case where the B_PFPROT bit is clear. + */ + if (bp->b_flags & B_PFPROT) { return (bp); + } -} /* end of function get_bioreq() */ + /* wake up another process to handle the next buffer, and return + * bp to the caller. + */ + oldPriority = i_disable(INTMAX); + + /* determine where to find the sleeping process. + * There are two cases: either it is sleeping on + * afs_asyncbuf, or it is sleeping on its own unique + * address. These cases are distinguished by examining + * the sleeper field of afs_bioqueue. + */ + if (afs_bioqueue.sleeper) { + wakeup(&afs_asyncbuf); + } else { + if (afs_bioqueue.lruq.next == &afs_bioqueue.lruq) { + /* queue is empty, what now? ??? */ + /* Should this be impossible, or does */ + /* it just mean that nobody is sleeping? */ ; + } else { + struct squeue *bq = afs_bioqueue.lruq.next; + QRemove(bq); + QInit(bq); + wakeup(bq); + afs_bioqueue.sleeper = TRUE; + } + } + i_enable(oldPriority); /* re-enable interrupts from strategy */ + return (bp); + +} /* end of function get_bioreq() */ /* afs_BioDaemon @@ -1071,15 +1098,15 @@ self->cnt++; * each making the appropriate syscall, which will cause this * function to be invoked. */ -static int afs_initbiod = 0; /* this is self-initializing code */ +static int afs_initbiod = 0; /* this is self-initializing code */ int DOvmlock = 0; -afs_BioDaemon (nbiods) - afs_int32 nbiods; +afs_BioDaemon(nbiods) + afs_int32 nbiods; { struct afs_bioqueue *self; afs_int32 code, s, pflg = 0; label_t jmpbuf; - struct buf *bp, *bp1, *tbp1, *tbp2; /* temp pointers only */ + struct buf *bp, *bp1, *tbp1, *tbp2; /* temp pointers only */ caddr_t tmpaddr; struct vnode *vp; struct vcache *vcp; @@ -1088,35 +1115,23 @@ afs_BioDaemon (nbiods) /* XXX ###1 XXX */ afs_initbiod = 1; /* Initialize the queue of waiting processes, afs_bioqueue. */ - QInit (&(afs_bioqueue.lruq)); + QInit(&(afs_bioqueue.lruq)); } /* establish ourself as a kernel process so shutdown won't kill us */ /* u.u_procp->p_flag |= SKPROC;*/ /* Initialize a token (self) to use in the queue of sleeping processes. */ - self = (struct afs_bioqueue *) afs_osi_Alloc (sizeof (struct afs_bioqueue)); - pin (self, sizeof (struct afs_bioqueue)); /* fix in memory */ + self = (struct afs_bioqueue *)afs_osi_Alloc(sizeof(struct afs_bioqueue)); + pin(self, sizeof(struct afs_bioqueue)); /* fix in memory */ memset(self, 0, sizeof(*self)); - QInit (&(self->lruq)); /* initialize queue entry pointers */ + QInit(&(self->lruq)); /* initialize queue entry pointers */ /* Ignore HUP signals... */ -#ifdef AFS_AIX41_ENV - { - sigset_t sigbits, osigbits; - /* - * add SIGHUP to the set of already masked signals - */ - SIGFILLSET(sigbits); /* allow all signals */ - SIGDELSET(sigbits, SIGHUP); /* except SIGHUP */ - limit_sigs(&sigbits, &osigbits); /* and already masked */ - } -#else SIGDELSET(u.u_procp->p_sig, SIGHUP); SIGADDSET(u.u_procp->p_sigignore, SIGHUP); SIGDELSET(u.u_procp->p_sigcatch, SIGHUP); -#endif /* Main body starts here -- this is an intentional infinite loop, and * should NEVER exit * @@ -1126,11 +1141,11 @@ afs_BioDaemon (nbiods) while (1) { bp = afs_get_bioreq(self); if (!bp) - break; /* we were interrupted */ + break; /* we were interrupted */ if (code = setjmpx(&jmpbuf)) { /* This should not have happend, maybe a lack of resources */ s = splimp(); - for (bp1 = bp; bp ; bp = bp1) { + for (bp1 = bp; bp; bp = bp1) { if (bp1) bp1 = bp1->b_work; bp->b_actf = 0; @@ -1143,22 +1158,30 @@ afs_BioDaemon (nbiods) } vcp = VTOAFS(bp->b_vp); if (bp->b_flags & B_PFSTORE) { - ObtainWriteLock(&vcp->lock,210); + ObtainWriteLock(&vcp->lock, 210); if (vcp->v.v_gnode->gn_mwrcnt) { - if (vcp->m.Length < bp->b_bcount + (u_int)dbtob(bp->b_blkno)) - vcp->m.Length = bp->b_bcount + (u_int)dbtob(bp->b_blkno); + afs_offs_t newlength = + (afs_offs_t) dbtob(bp->b_blkno) + bp->b_bcount; + if (vcp->m.Length < newlength) { + afs_Trace4(afs_iclSetp, CM_TRACE_SETLENGTH, + ICL_TYPE_STRING, __FILE__, ICL_TYPE_LONG, + __LINE__, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(vcp->m.Length), + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(newlength)); + vcp->m.Length = newlength; + } } ReleaseWriteLock(&vcp->lock); } /* If the buffer represents a protection violation, rather than * an actual request for I/O, no special action need be taken. */ - if ( bp->b_flags & B_PFPROT ) { - iodone (bp); /* Notify all users of the buffer that we're done */ + if (bp->b_flags & B_PFPROT) { + iodone(bp); /* Notify all users of the buffer that we're done */ continue; - } -if (DOvmlock) - ObtainWriteLock(&vcp->pvmlock,558); + } + if (DOvmlock) + ObtainWriteLock(&vcp->pvmlock, 558); /* * First map its data area to a region in the current address space * by calling vm_att with the subspace identifier, and a pointer to @@ -1166,10 +1189,10 @@ if (DOvmlock) * also want to hang onto the old one. */ tmpaddr = bp->b_baddr; - bp->b_baddr = vm_att (bp->b_xmemd.subspace_id, tmpaddr); + bp->b_baddr = vm_att(bp->b_xmemd.subspace_id, tmpaddr); tmperr = afs_ustrategy(bp); /* temp variable saves offset calculation */ - if (tmperr) { /* in non-error case */ - bp->b_flags |= B_ERROR; /* should other flags remain set ??? */ + if (tmperr) { /* in non-error case */ + bp->b_flags |= B_ERROR; /* should other flags remain set ??? */ bp->b_error = tmperr; } @@ -1186,33 +1209,34 @@ if (DOvmlock) * using it by calling iodone. * assumes iodone can modify the b_work field. */ - for(tbp1=bp;;) { - tbp2 = (struct buf *) tbp1->b_work; + for (tbp1 = bp;;) { + tbp2 = (struct buf *)tbp1->b_work; iodone(tbp1); - if (!tbp2) + if (!tbp2) break; - tbp1 = (struct buf *) tbp2->b_work; + tbp1 = (struct buf *)tbp2->b_work; iodone(tbp2); if (!tbp1) break; } -if (DOvmlock) - ReleaseWriteLock(&vcp->pvmlock); /* Unlock the vnode. */ + if (DOvmlock) + ReleaseWriteLock(&vcp->pvmlock); /* Unlock the vnode. */ clrjmpx(&jmpbuf); - } /* infinite loop (unless we're interrupted) */ - unpin (self, sizeof (struct afs_bioqueue)); - afs_osi_Free (self, sizeof (struct afs_bioqueue)); -} /* end of afs_BioDaemon() */ -#endif /* AFS_AIX41_ENV */ + } /* infinite loop (unless we're interrupted) */ + unpin(self, sizeof(struct afs_bioqueue)); + afs_osi_Free(self, sizeof(struct afs_bioqueue)); +} /* end of afs_BioDaemon() */ +#endif /* AFS_AIX41_ENV */ #endif /* AFS_AIX32_ENV */ int afs_nbrs = 0; -void afs_BackgroundDaemon() { +void +afs_BackgroundDaemon(void) +{ struct brequest *tb; int i, foundAny; - afs_int32 pid; AFS_STATCNT(afs_BackgroundDaemon); /* initialize subsystem */ @@ -1221,19 +1245,22 @@ void afs_BackgroundDaemon() { memset((char *)afs_brs, 0, sizeof(afs_brs)); brsInit = 1; #if defined (AFS_SGI_ENV) && defined(AFS_SGI_SHORTSTACK) - /* - * steal the first daemon for doing delayed DSlot flushing - * (see afs_GetDownDSlot) - */ + /* + * steal the first daemon for doing delayed DSlot flushing + * (see afs_GetDownDSlot) + */ AFS_GUNLOCK(); - afs_sgidaemon(); - return; + afs_sgidaemon(); + return; #endif } afs_nbrs++; - MObtainWriteLock(&afs_xbrs,302); + MObtainWriteLock(&afs_xbrs, 302); while (1) { + int min_ts = 0; + struct brequest *min_tb = NULL; + if (afs_termState == AFSOP_STOP_BKG) { if (--afs_nbrs <= 0) afs_termState = AFSOP_STOP_TRUNCDAEMON; @@ -1241,80 +1268,85 @@ void afs_BackgroundDaemon() { afs_osi_Wakeup(&afs_termState); return; } - + /* find a request */ tb = afs_brs; foundAny = 0; - for(i=0;irefCount > 0) && !(tb->flags & BSTARTED)) { /* new request, not yet picked up */ - tb->flags |= BSTARTED; - MReleaseWriteLock(&afs_xbrs); - foundAny = 1; - afs_Trace1(afs_iclSetp, CM_TRACE_BKG1, - ICL_TYPE_INT32, tb->opcode); - if (tb->opcode == BOP_FETCH) - BPrefetch(tb); - else if (tb->opcode == BOP_STORE) - BStore(tb); - else if (tb->opcode == BOP_PATH) - BPath(tb); - else panic("background bop"); - if (tb->vnode) { + if ((min_tb && (min_ts - tb->ts > 0)) || !min_tb) { + min_tb = tb; + min_ts = tb->ts; + } + } + } + if ((tb = min_tb)) { + /* claim and process this request */ + tb->flags |= BSTARTED; + MReleaseWriteLock(&afs_xbrs); + foundAny = 1; + afs_Trace1(afs_iclSetp, CM_TRACE_BKG1, ICL_TYPE_INT32, + tb->opcode); + if (tb->opcode == BOP_FETCH) + BPrefetch(tb); + else if (tb->opcode == BOP_STORE) + BStore(tb); + else if (tb->opcode == BOP_PATH) + BPath(tb); + else + panic("background bop"); + if (tb->vc) { #ifdef AFS_DEC_ENV - tb->vnode->vrefCount--; /* fix up reference count */ + tb->vc->vrefCount--; /* fix up reference count */ #else - AFS_RELE((struct vnode *)(tb->vnode)); /* MUST call vnode layer or could lose vnodes */ + AFS_RELE(AFSTOV(tb->vc)); /* MUST call vnode layer or could lose vnodes */ #endif - tb->vnode = (struct vcache *) 0; - } - if (tb->cred) { - crfree(tb->cred); - tb->cred = (struct AFS_UCRED *) 0; - } - afs_BRelease(tb); /* this grabs and releases afs_xbrs lock */ - MObtainWriteLock(&afs_xbrs,305); + tb->vc = NULL; + } + if (tb->cred) { + crfree(tb->cred); + tb->cred = (struct AFS_UCRED *)0; } + afs_BRelease(tb); /* this grabs and releases afs_xbrs lock */ + MObtainWriteLock(&afs_xbrs, 305); } if (!foundAny) { /* wait for new request */ afs_brsDaemons++; MReleaseWriteLock(&afs_xbrs); afs_osi_Sleep(&afs_brsDaemons); - MObtainWriteLock(&afs_xbrs,307); + MObtainWriteLock(&afs_xbrs, 307); afs_brsDaemons--; } } } -void shutdown_daemons() +void +shutdown_daemons(void) { - extern int afs_cold_shutdown; - register int i; - register struct brequest *tb; - - AFS_STATCNT(shutdown_daemons); - if (afs_cold_shutdown) { - afs_brsDaemons = brsInit = 0; - rxepoch_checked = afs_nbrs = 0; - memset((char *)afs_brs, 0, sizeof(afs_brs)); - memset((char *)&afs_xbrs, 0, sizeof(afs_lock_t)); - afs_brsWaiters = 0; + AFS_STATCNT(shutdown_daemons); + if (afs_cold_shutdown) { + afs_brsDaemons = brsInit = 0; + rxepoch_checked = afs_nbrs = 0; + memset((char *)afs_brs, 0, sizeof(afs_brs)); + memset((char *)&afs_xbrs, 0, sizeof(afs_lock_t)); + afs_brsWaiters = 0; #ifdef AFS_AIX32_ENV #ifdef AFS_AIX41_ENV - lock_free(&afs_asyncbuf_lock); - unpin(&afs_asyncbuf, sizeof(struct buf*)); - pin (&afs_asyncbuf_cv, sizeof(afs_int32)); + lock_free(&afs_asyncbuf_lock); + unpin(&afs_asyncbuf, sizeof(struct buf *)); + pin(&afs_asyncbuf_cv, sizeof(afs_int32)); #else /* AFS_AIX41_ENV */ - afs_busyq = NULL; - afs_biodcnt = 0; - memset((char *)&afs_bioqueue, 0, sizeof(struct afs_bioqueue)); + afs_busyq = NULL; + afs_biodcnt = 0; + memset((char *)&afs_bioqueue, 0, sizeof(struct afs_bioqueue)); #endif - afs_initbiod = 0; + afs_initbiod = 0; #endif - } + } } #if defined(AFS_SGI_ENV) && defined(AFS_SGI_SHORTSTACK) @@ -1334,36 +1366,35 @@ struct dcache *afs_sgibklist; int afs_sgidaemon(void) { - int s; - struct dcache *tdc; + int s; + struct dcache *tdc; - if (afs_sgibklock == NULL) { - SV_INIT(&afs_sgibksync, "bksync", 0, 0); - SV_INIT(&afs_sgibkwait, "bkwait", 0, 0); - SPINLOCK_INIT(&afs_sgibklock, "bklock"); - } - s = SPLOCK(afs_sgibklock); - for (;;) { - /* wait for something to do */ - SP_WAIT(afs_sgibklock, s, &afs_sgibksync, PINOD); - osi_Assert(afs_sgibklist); - - /* XX will probably need to generalize to real list someday */ - s = SPLOCK(afs_sgibklock); - while (afs_sgibklist) { - tdc = afs_sgibklist; - afs_sgibklist = NULL; - SPUNLOCK(afs_sgibklock, s); - AFS_GLOCK(); - tdc->flags &= ~DFEntryMod; - afs_WriteDCache(tdc, 1); - AFS_GUNLOCK(); - s = SPLOCK(afs_sgibklock); - } + if (afs_sgibklock == NULL) { + SV_INIT(&afs_sgibksync, "bksync", 0, 0); + SV_INIT(&afs_sgibkwait, "bkwait", 0, 0); + SPINLOCK_INIT(&afs_sgibklock, "bklock"); + } + s = SPLOCK(afs_sgibklock); + for (;;) { + /* wait for something to do */ + SP_WAIT(afs_sgibklock, s, &afs_sgibksync, PINOD); + osi_Assert(afs_sgibklist); - /* done all the work - wake everyone up */ - while (SV_SIGNAL(&afs_sgibkwait)) - ; + /* XX will probably need to generalize to real list someday */ + s = SPLOCK(afs_sgibklock); + while (afs_sgibklist) { + tdc = afs_sgibklist; + afs_sgibklist = NULL; + SPUNLOCK(afs_sgibklock, s); + AFS_GLOCK(); + tdc->dflags &= ~DFEntryMod; + afs_WriteDCache(tdc, 1); + AFS_GUNLOCK(); + s = SPLOCK(afs_sgibklock); } + + /* done all the work - wake everyone up */ + while (SV_SIGNAL(&afs_sgibkwait)); + } } #endif diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index 4e72d16bf..0a4743e0a 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -1,6 +1,6 @@ /* * Copyright 2000, International Business Machines Corporation and others. - * All Rights Reserved. + *$All Rights Reserved. * * This software has been released under the terms of the IBM Public * License. For details, see the LICENSE file in the top-level source @@ -11,61 +11,67 @@ * Implements: */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_dcache.c,v 1.1.1.10 2003/07/30 17:07:59 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_dcache.c,v 1.42 2004/05/08 04:33:07 shadow Exp $"); -#include "../afs/sysincludes.h" /*Standard vendor system headers*/ -#include "../afs/afsincludes.h" /*AFS-based standard headers*/ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /*Standard vendor system headers */ +#include "afsincludes.h" /*AFS-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/afs_osidnlc.h" /* Forward declarations. */ static void afs_GetDownD(int anumber, int *aneedSpace); static void afs_FreeDiscardedDCache(void); static void afs_DiscardDCache(struct dcache *); - -/* Imported variables */ -extern afs_rwlock_t afs_xvcache; -extern afs_rwlock_t afs_xcbhash; -extern afs_int32 afs_mariner; -extern afs_int32 cacheInfoModTime; /*Last time cache info modified*/ - +static void afs_FreeDCache(struct dcache *); /* * --------------------- Exported definitions --------------------- */ -afs_lock_t afs_xdcache; /*Lock: alloc new disk cache entries*/ -afs_int32 afs_freeDCList; /*Free list for disk cache entries*/ -afs_int32 afs_freeDCCount; /*Count of elts in freeDCList*/ -afs_int32 afs_discardDCList; /*Discarded disk cache entries*/ -afs_int32 afs_discardDCCount; /*Count of elts in discardDCList*/ -struct dcache *afs_freeDSList; /*Free list for disk slots */ -struct dcache *afs_Initial_freeDSList; /*Initial list for above*/ -ino_t cacheInode; /*Inode for CacheItems file*/ +afs_lock_t afs_xdcache; /*Lock: alloc new disk cache entries */ +afs_int32 afs_freeDCList; /*Free list for disk cache entries */ +afs_int32 afs_freeDCCount; /*Count of elts in freeDCList */ +afs_int32 afs_discardDCList; /*Discarded disk cache entries */ +afs_int32 afs_discardDCCount; /*Count of elts in discardDCList */ +struct dcache *afs_freeDSList; /*Free list for disk slots */ +struct dcache *afs_Initial_freeDSList; /*Initial list for above */ +ino_t cacheInode; /*Inode for CacheItems file */ struct osi_file *afs_cacheInodep = 0; /* file for CacheItems inode */ -struct afs_q afs_DLRU; /*dcache LRU*/ +struct afs_q afs_DLRU; /*dcache LRU */ afs_int32 afs_dhashsize = 1024; -afs_int32 *afs_dvhashTbl; /*Data cache hash table*/ -afs_int32 *afs_dchashTbl; /*Data cache hash table*/ -afs_int32 *afs_dvnextTbl; /*Dcache hash table links */ -afs_int32 *afs_dcnextTbl; /*Dcache hash table links */ -struct dcache **afs_indexTable; /*Pointers to dcache entries*/ -afs_hyper_t *afs_indexTimes; /*Dcache entry Access times*/ -afs_int32 *afs_indexUnique; /*dcache entry Fid.Unique */ -unsigned char *afs_indexFlags; /*(only one) Is there data there?*/ -afs_hyper_t afs_indexCounter; /*Fake time for marking index - entries*/ -afs_int32 afs_cacheFiles =0; /*Size of afs_indexTable*/ -afs_int32 afs_cacheBlocks; /*1K blocks in cache*/ -afs_int32 afs_cacheStats; /*Stat entries in cache*/ -afs_int32 afs_blocksUsed; /*Number of blocks in use*/ -afs_int32 afs_blocksDiscarded; /*Blocks freed but not truncated */ -afs_int32 afs_fsfragsize = 1023; /*Underlying Filesystem minimum unit +afs_int32 *afs_dvhashTbl; /*Data cache hash table */ +afs_int32 *afs_dchashTbl; /*Data cache hash table */ +afs_int32 *afs_dvnextTbl; /*Dcache hash table links */ +afs_int32 *afs_dcnextTbl; /*Dcache hash table links */ +struct dcache **afs_indexTable; /*Pointers to dcache entries */ +afs_hyper_t *afs_indexTimes; /*Dcache entry Access times */ +afs_int32 *afs_indexUnique; /*dcache entry Fid.Unique */ +unsigned char *afs_indexFlags; /*(only one) Is there data there? */ +afs_hyper_t afs_indexCounter; /*Fake time for marking index + * entries */ +afs_int32 afs_cacheFiles = 0; /*Size of afs_indexTable */ +afs_int32 afs_cacheBlocks; /*1K blocks in cache */ +afs_int32 afs_cacheStats; /*Stat entries in cache */ +afs_int32 afs_blocksUsed; /*Number of blocks in use */ +afs_int32 afs_blocksDiscarded; /*Blocks freed but not truncated */ +afs_int32 afs_fsfragsize = 1023; /*Underlying Filesystem minimum unit *of disk allocation usually 1K *this value is (truefrag -1 ) to *save a bunch of subtracts... */ +#ifdef AFS_64BIT_CLIENT +#ifdef AFS_VM_RDWR_ENV +afs_size_t afs_vmMappingEnd; /* for large files (>= 2GB) the VM + * mapping an 32bit addressing machines + * can only be used below the 2 GB + * line. From this point upwards we + * must do direct I/O into the cache + * files. The value should be on a + * chunk boundary. */ +#endif /* AFS_VM_RDWR_ENV */ +#endif /* AFS_64BIT_CLIENT */ /* The following is used to ensure that new dcache's aren't obtained when * the cache is nearly full. @@ -74,17 +80,12 @@ int afs_WaitForCacheDrain = 0; int afs_TruncateDaemonRunning = 0; int afs_CacheTooFull = 0; -afs_int32 afs_dcentries; /* In-memory dcache entries */ +afs_int32 afs_dcentries; /* In-memory dcache entries */ int dcacheDisabled = 0; -extern struct dcache *afs_UFSGetDSlot(); -extern struct volume *afs_UFSGetVolSlot(); -extern int osi_UFSTruncate(), afs_osi_Read(), afs_osi_Write(), osi_UFSClose(); -extern int afs_UFSRead(), afs_UFSWrite(); static int afs_UFSCacheFetchProc(), afs_UFSCacheStoreProc(); -extern int afs_UFSHandleLink(); struct afs_cacheOps afs_UfsCacheOps = { osi_UFSOpen, osi_UFSTruncate, @@ -100,12 +101,6 @@ struct afs_cacheOps afs_UfsCacheOps = { afs_UFSHandleLink, }; -extern void *afs_MemCacheOpen(); -extern struct dcache *afs_MemGetDSlot(); -extern struct volume *afs_MemGetVolSlot(); -extern int afs_MemCacheTruncate(), afs_MemReadBlk(), afs_MemWriteBlk(), afs_MemCacheClose(); -extern int afs_MemRead(), afs_MemWrite(), afs_MemCacheFetchProc(), afs_MemCacheStoreProc(); -extern int afs_MemHandleLink(); struct afs_cacheOps afs_MemCacheOps = { afs_MemCacheOpen, afs_MemCacheTruncate, @@ -121,7 +116,7 @@ struct afs_cacheOps afs_MemCacheOps = { afs_MemHandleLink, }; -int cacheDiskType; /*Type of backing disk for cache*/ +int cacheDiskType; /*Type of backing disk for cache */ struct afs_cacheOps *afs_cacheType; @@ -145,72 +140,77 @@ struct afs_cacheOps *afs_cacheType; */ void -afs_StoreWarn(acode, avolume, aflags) - register afs_int32 acode; - afs_int32 avolume; - register afs_int32 aflags; - -{ /*afs_StoreWarn*/ - +afs_StoreWarn(register afs_int32 acode, afs_int32 avolume, + register afs_int32 aflags) +{ static char problem_fmt[] = "afs: failed to store file in volume %d (%s)\n"; static char problem_fmt_w_error[] = "afs: failed to store file in volume %d (error %d)\n"; static char netproblems[] = "network problems"; - static char partfull[] = "partition full"; - static char overquota[] = "over quota"; - static char unknownerr[] = "unknown error"; + static char partfull[] = "partition full"; + static char overquota[] = "over quota"; AFS_STATCNT(afs_StoreWarn); if (acode < 0) { - /* + /* * Network problems */ - if (aflags & 1) + if (aflags & 1) afs_warn(problem_fmt, avolume, netproblems); - if (aflags & 2) + if (aflags & 2) afs_warnuser(problem_fmt, avolume, netproblems); - } - else - if (acode == ENOSPC) { - /* - * Partition full - */ - if (aflags & 1) - afs_warn(problem_fmt, avolume, partfull); - if (aflags & 2) - afs_warnuser(problem_fmt, avolume, partfull); - } - else + } else if (acode == ENOSPC) { + /* + * Partition full + */ + if (aflags & 1) + afs_warn(problem_fmt, avolume, partfull); + if (aflags & 2) + afs_warnuser(problem_fmt, avolume, partfull); + } else #ifdef EDQUOT - /* EDQUOT doesn't exist on solaris and won't be sent by the server. - * Instead ENOSPC will be sent... - */ - if (acode == EDQUOT) { - /* - * Quota exceeded - */ - if (aflags & 1) - afs_warn(problem_fmt, avolume, overquota); - if (aflags & 2) - afs_warnuser(problem_fmt, avolume, overquota); - } else + /* EDQUOT doesn't exist on solaris and won't be sent by the server. + * Instead ENOSPC will be sent... + */ + if (acode == EDQUOT) { + /* + * Quota exceeded + */ + if (aflags & 1) + afs_warn(problem_fmt, avolume, overquota); + if (aflags & 2) + afs_warnuser(problem_fmt, avolume, overquota); + } else #endif - { - /* - * Unknown error - */ - if (aflags & 1) - afs_warn(problem_fmt_w_error, avolume, acode); - if (aflags & 2) - afs_warnuser(problem_fmt_w_error, avolume, acode); - } -} /*afs_StoreWarn*/ + { + /* + * Unknown error + */ + if (aflags & 1) + afs_warn(problem_fmt_w_error, avolume, acode); + if (aflags & 2) + afs_warnuser(problem_fmt_w_error, avolume, acode); + } +} /*afs_StoreWarn */ + +void +afs_MaybeWakeupTruncateDaemon(void) +{ + if (!afs_CacheTooFull && afs_CacheIsTooFull()) { + afs_CacheTooFull = 1; + if (!afs_TruncateDaemonRunning) + afs_osi_Wakeup((int *)afs_CacheTruncateDaemon); + } else if (!afs_TruncateDaemonRunning + && afs_blocksDiscarded > CM_MAXDISCARDEDCHUNKS) { + afs_osi_Wakeup((int *)afs_CacheTruncateDaemon); + } +} /* Keep statistics on run time for afs_CacheTruncateDaemon. This is a * struct so we need only export one symbol for AIX. */ -struct CTD_stats { +static struct CTD_stats { osi_timeval_t CTD_beforeSleep; osi_timeval_t CTD_afterSleep; osi_timeval_t CTD_sleepTime; @@ -218,38 +218,34 @@ struct CTD_stats { int CTD_nSleeps; } CTD_stats; -void afs_MaybeWakeupTruncateDaemon() { - if (!afs_CacheTooFull && afs_CacheIsTooFull()) { - afs_CacheTooFull = 1; - if (!afs_TruncateDaemonRunning) - afs_osi_Wakeup((char *)afs_CacheTruncateDaemon); - } else if (!afs_TruncateDaemonRunning && - afs_blocksDiscarded > CM_MAXDISCARDEDCHUNKS) { - afs_osi_Wakeup((char *)afs_CacheTruncateDaemon); - } -} - u_int afs_min_cache = 0; -void afs_CacheTruncateDaemon() { +void +afs_CacheTruncateDaemon(void) +{ osi_timeval_t CTD_tmpTime; u_int counter; u_int cb_lowat; - u_int dc_hiwat = (100-CM_DCACHECOUNTFREEPCT+CM_DCACHEEXTRAPCT)*afs_cacheFiles/100; - afs_min_cache = (((10 * AFS_CHUNKSIZE(0)) + afs_fsfragsize) & ~afs_fsfragsize)>>10; + u_int dc_hiwat = + (100 - CM_DCACHECOUNTFREEPCT + + CM_DCACHEEXTRAPCT) * afs_cacheFiles / 100; + afs_min_cache = + (((10 * AFS_CHUNKSIZE(0)) + afs_fsfragsize) & ~afs_fsfragsize) >> 10; osi_GetuTime(&CTD_stats.CTD_afterSleep); afs_TruncateDaemonRunning = 1; while (1) { - cb_lowat = ((CM_DCACHESPACEFREEPCT-CM_DCACHEEXTRAPCT) - * afs_cacheBlocks) / 100; - MObtainWriteLock(&afs_xdcache,266); + cb_lowat = ((CM_DCACHESPACEFREEPCT - CM_DCACHEEXTRAPCT) + * afs_cacheBlocks) / 100; + MObtainWriteLock(&afs_xdcache, 266); if (afs_CacheTooFull) { - int space_needed, slots_needed; + int space_needed, slots_needed; /* if we get woken up, we should try to clean something out */ for (counter = 0; counter < 10; counter++) { - space_needed = afs_blocksUsed - afs_blocksDiscarded - cb_lowat; - slots_needed = dc_hiwat - afs_freeDCCount - afs_discardDCCount; - afs_GetDownD(slots_needed, &space_needed); + space_needed = + afs_blocksUsed - afs_blocksDiscarded - cb_lowat; + slots_needed = + dc_hiwat - afs_freeDCCount - afs_discardDCCount; + afs_GetDownD(slots_needed, &space_needed); if ((space_needed <= 0) && (slots_needed <= 0)) { break; } @@ -268,26 +264,24 @@ void afs_CacheTruncateDaemon() { * any cache files then give up the global lock so other * threads get a chance to run. */ - if ((afs_termState!=AFSOP_STOP_TRUNCDAEMON) && afs_CacheTooFull && - (!afs_blocksDiscarded || afs_WaitForCacheDrain)) { - afs_osi_Wait(100, 0, 0); /* 100 milliseconds */ + if ((afs_termState != AFSOP_STOP_TRUNCDAEMON) && afs_CacheTooFull + && (!afs_blocksDiscarded || afs_WaitForCacheDrain)) { + afs_osi_Wait(100, 0, 0); /* 100 milliseconds */ } /* * This is where we free the discarded cache elements. */ - while(afs_blocksDiscarded && !afs_WaitForCacheDrain && - (afs_termState!=AFSOP_STOP_TRUNCDAEMON)) - { + while (afs_blocksDiscarded && !afs_WaitForCacheDrain + && (afs_termState != AFSOP_STOP_TRUNCDAEMON)) { afs_FreeDiscardedDCache(); } /* See if we need to continue to run. Someone may have * signalled us while we were executing. */ - if (!afs_WaitForCacheDrain && !afs_CacheTooFull && - (afs_termState!=AFSOP_STOP_TRUNCDAEMON)) - { + if (!afs_WaitForCacheDrain && !afs_CacheTooFull + && (afs_termState != AFSOP_STOP_TRUNCDAEMON)) { /* Collect statistics on truncate daemon. */ CTD_stats.CTD_nSleeps++; osi_GetuTime(&CTD_stats.CTD_beforeSleep); @@ -296,7 +290,7 @@ void afs_CacheTruncateDaemon() { afs_stats_AddTo(CTD_stats.CTD_runTime, CTD_tmpTime); afs_TruncateDaemonRunning = 0; - afs_osi_Sleep((char *)afs_CacheTruncateDaemon); + afs_osi_Sleep((int *)afs_CacheTruncateDaemon); afs_TruncateDaemonRunning = 1; osi_GetuTime(&CTD_stats.CTD_afterSleep); @@ -334,30 +328,25 @@ void afs_CacheTruncateDaemon() { */ void -afs_AdjustSize(adc, anewSize) - register struct dcache *adc; - register afs_int32 anewSize; - -{ /*afs_AdjustSize*/ - +afs_AdjustSize(register struct dcache *adc, register afs_int32 newSize) +{ register afs_int32 oldSize; AFS_STATCNT(afs_AdjustSize); - adc->flags |= DFEntryMod; - oldSize = ((adc->f.chunkBytes + afs_fsfragsize)^afs_fsfragsize)>>10;/* round up */ - adc->f.chunkBytes = anewSize; - anewSize = ((anewSize + afs_fsfragsize)^afs_fsfragsize)>>10;/* round up */ - if (anewSize > oldSize) { + + adc->dflags |= DFEntryMod; + oldSize = ((adc->f.chunkBytes + afs_fsfragsize) ^ afs_fsfragsize) >> 10; /* round up */ + adc->f.chunkBytes = newSize; + if (!newSize) + adc->validPos = 0; + newSize = ((newSize + afs_fsfragsize) ^ afs_fsfragsize) >> 10; /* round up */ + if (newSize > oldSize) { /* We're growing the file, wakeup the daemon */ afs_MaybeWakeupTruncateDaemon(); } - afs_blocksUsed += (anewSize - oldSize); + afs_blocksUsed += (newSize - oldSize); afs_stats_cmperf.cacheBlocksInUse = afs_blocksUsed; /* XXX */ - -} /*afs_AdjustSize*/ - - - +} /* @@ -373,7 +362,7 @@ afs_AdjustSize(adc, anewSize) * * Environment: * The anumber parameter is just a hint; at least one entry MUST be - * moved, of we'll panic. We must be called with afs_xdcache + * moved, or we'll panic. We must be called with afs_xdcache * write-locked. We should try to satisfy both anumber and aneedspace, * whichever is more demanding - need to do several things: * 1. only grab up to anumber victims if aneedSpace <= 0, not @@ -386,21 +375,22 @@ afs_AdjustSize(adc, anewSize) */ #define MAXATONCE 16 /* max we can obtain at once */ -static void afs_GetDownD(int anumber, int *aneedSpace) +static void +afs_GetDownD(int anumber, int *aneedSpace) { struct dcache *tdc; struct VenusFid *afid; - afs_int32 i, j, k; + afs_int32 i, j; afs_hyper_t vtime; int skip, phase; register struct vcache *tvc; afs_uint32 victims[MAXATONCE]; struct dcache *victimDCs[MAXATONCE]; - afs_hyper_t victimTimes[MAXATONCE];/* youngest (largest LRU time) first */ - afs_uint32 victimPtr; /* next free item in victim arrays */ - afs_hyper_t maxVictimTime; /* youngest (largest LRU time) victim */ - afs_uint32 maxVictimPtr; /* where it is */ + afs_hyper_t victimTimes[MAXATONCE]; /* youngest (largest LRU time) first */ + afs_uint32 victimPtr; /* next free item in victim arrays */ + afs_hyper_t maxVictimTime; /* youngest (largest LRU time) victim */ + afs_uint32 maxVictimPtr; /* where it is */ int discard; AFS_STATCNT(afs_GetDownD); @@ -411,11 +401,12 @@ static void afs_GetDownD(int anumber, int *aneedSpace) * because we should try to free space even if anumber <=0 */ if (!aneedSpace || *aneedSpace <= 0) { anumber -= afs_freeDCCount; - if (anumber <= 0) return; /* enough already free */ + if (anumber <= 0) + return; /* enough already free */ } /* bounds check parameter */ - if (anumber > MAXATONCE) - anumber = MAXATONCE; /* all we can do */ + if (anumber > MAXATONCE) + anumber = MAXATONCE; /* all we can do */ /* * The phase variable manages reclaims. Set to 0, the first pass, @@ -427,25 +418,26 @@ static void afs_GetDownD(int anumber, int *aneedSpace) /* turn off all flags */ afs_indexFlags[i] &= ~IFFlag; - while (anumber > 0 || (aneedSpace && *aneedSpace >0)) { + while (anumber > 0 || (aneedSpace && *aneedSpace > 0)) { /* find oldest entries for reclamation */ maxVictimPtr = victimPtr = 0; hzero(maxVictimTime); /* select victims from access time array */ for (i = 0; i < afs_cacheFiles; i++) { if (afs_indexFlags[i] & (IFDataMod | IFFree | IFDiscarded)) { - /* skip if dirty or already free */ - continue; + /* skip if dirty or already free */ + continue; } tdc = afs_indexTable[i]; if (tdc && (tdc->refCount != 0)) { - /* Referenced; can't use it! */ - continue; + /* Referenced; can't use it! */ + continue; } hset(vtime, afs_indexTimes[i]); /* if we've already looked at this one, skip it */ - if (afs_indexFlags[i] & IFFlag) continue; + if (afs_indexFlags[i] & IFFlag) + continue; if (victimPtr < MAXATONCE) { /* if there's at least one free victim slot left */ @@ -456,35 +448,44 @@ static void afs_GetDownD(int anumber, int *aneedSpace) maxVictimPtr = victimPtr; } victimPtr++; - } - else if (hcmp(vtime, maxVictimTime) < 0) { + } else if (hcmp(vtime, maxVictimTime) < 0) { /* * We're older than youngest victim, so we replace at * least one victim */ /* find youngest (largest LRU) victim */ - j = maxVictimPtr; - if (j == victimPtr) osi_Panic("getdownd local"); + j = maxVictimPtr; + if (j == victimPtr) + osi_Panic("getdownd local"); victims[j] = i; hset(victimTimes[j], vtime); /* recompute maxVictimTime */ hset(maxVictimTime, vtime); - for(j = 0; j < victimPtr; j++) + for (j = 0; j < victimPtr; j++) if (hcmp(maxVictimTime, victimTimes[j]) < 0) { hset(maxVictimTime, victimTimes[j]); maxVictimPtr = j; } } - } /* big for loop */ + } /* big for loop */ /* now really reclaim the victims */ - j = 0; /* flag to track if we actually got any of the victims */ + j = 0; /* flag to track if we actually got any of the victims */ /* first, hold all the victims, since we're going to release the lock * during the truncate operation. */ - for(i=0; i < victimPtr; i++) - victimDCs[i] = afs_GetDSlot(victims[i], 0); - for(i = 0; i < victimPtr; i++) { + for (i = 0; i < victimPtr; i++) { + tdc = afs_GetDSlot(victims[i], 0); + /* We got tdc->tlock(R) here */ + if (tdc->refCount == 1) + victimDCs[i] = tdc; + else + victimDCs[i] = 0; + ReleaseReadLock(&tdc->tlock); + if (!victimDCs[i]) + afs_PutDCache(tdc); + } + for (i = 0; i < victimPtr; i++) { /* q is first elt in dcache entry */ tdc = victimDCs[i]; /* now, since we're dropping the afs_xdcache lock below, we @@ -493,28 +494,34 @@ static void afs_GetDownD(int anumber, int *aneedSpace) * compare with 1, since we bumped it above when we called * afs_GetDSlot to preserve the entry's identity. */ - if (tdc->refCount == 1) { + if (tdc && tdc->refCount == 1) { unsigned char chunkFlags; - afid = &tdc->f.fid; + afs_size_t tchunkoffset = 0; + afid = &tdc->f.fid; /* xdcache is lower than the xvcache lock */ MReleaseWriteLock(&afs_xdcache); MObtainReadLock(&afs_xvcache); - tvc = afs_FindVCache(afid, 0,0, 0, 0 /* no stats, no vlru */ ); + tvc = afs_FindVCache(afid, 0, 0 /* no stats, no vlru */ ); MReleaseReadLock(&afs_xvcache); MObtainWriteLock(&afs_xdcache, 527); skip = 0; - if (tdc->refCount > 1) skip = 1; + if (tdc->refCount > 1) + skip = 1; if (tvc) { + tchunkoffset = AFS_CHUNKTOBASE(tdc->f.chunk); chunkFlags = afs_indexFlags[tdc->index]; - if (phase == 0 && osi_Active(tvc)) skip = 1; - if (phase > 0 && osi_Active(tvc) && (tvc->states & CDCLock) - && (chunkFlags & IFAnyPages)) skip = 1; - if (chunkFlags & IFDataMod) skip = 1; + if (phase == 0 && osi_Active(tvc)) + skip = 1; + if (phase > 0 && osi_Active(tvc) + && (tvc->states & CDCLock) + && (chunkFlags & IFAnyPages)) + skip = 1; + if (chunkFlags & IFDataMod) + skip = 1; afs_Trace4(afs_iclSetp, CM_TRACE_GETDOWND, ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, skip, - ICL_TYPE_INT32, - (afs_int32)(chunkFlags & IFDirtyPages), - ICL_TYPE_INT32, AFS_CHUNKTOBASE(tdc->f.chunk)); + ICL_TYPE_INT32, tdc->index, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(tchunkoffset)); #if defined(AFS_SUN5_ENV) /* @@ -540,10 +547,9 @@ static void afs_GetDownD(int anumber, int *aneedSpace) /* One last recheck */ MObtainWriteLock(&afs_xdcache, 333); chunkFlags = afs_indexFlags[tdc->index]; - if (tdc->refCount > 1 - || (chunkFlags & IFDataMod) + if (tdc->refCount > 1 || (chunkFlags & IFDataMod) || (osi_Active(tvc) && (tvc->states & CDCLock) - && (chunkFlags & IFAnyPages))) { + && (chunkFlags & IFAnyPages))) { skip = 1; MReleaseWriteLock(&afs_xdcache); goto endputpage; @@ -552,16 +558,18 @@ static void afs_GetDownD(int anumber, int *aneedSpace) code = osi_VM_GetDownD(tvc, tdc); - MObtainWriteLock(&afs_xdcache,269); + MObtainWriteLock(&afs_xdcache, 269); /* we actually removed all pages, clean and dirty */ if (code == 0) { - afs_indexFlags[tdc->index] &= ~(IFDirtyPages| IFAnyPages); + afs_indexFlags[tdc->index] &= + ~(IFDirtyPages | IFAnyPages); } else skip = 1; MReleaseWriteLock(&afs_xdcache); -endputpage: + endputpage: MObtainWriteLock(&tvc->vlock, 544); - if (--tvc->activeV == 0 && (tvc->vstates & VRevokeWait)) { + if (--tvc->activeV == 0 + && (tvc->vstates & VRevokeWait)) { tvc->vstates &= ~VRevokeWait; afs_osi_Wakeup((char *)&tvc->vstates); @@ -570,10 +578,10 @@ endputpage: tvc->vstates &= ~VPageCleaning; afs_osi_Wakeup((char *)&tvc->vstates); } -endmultipage: + endmultipage: MReleaseWriteLock(&tvc->vlock); } else -#endif /* AFS_SUN5_ENV */ +#endif /* AFS_SUN5_ENV */ { MReleaseWriteLock(&afs_xdcache); } @@ -581,8 +589,10 @@ endmultipage: AFS_FAST_RELE(tvc); MObtainWriteLock(&afs_xdcache, 528); if (afs_indexFlags[tdc->index] & - (IFDataMod | IFDirtyPages | IFAnyPages)) skip = 1; - if (tdc->refCount > 1) skip = 1; + (IFDataMod | IFDirtyPages | IFAnyPages)) + skip = 1; + if (tdc->refCount > 1) + skip = 1; } #if defined(AFS_SUN5_ENV) else { @@ -593,20 +603,28 @@ endmultipage: * Hold vcache lock to prevent vnode from being * created while we're clearing IFDirtyPages. */ - afs_indexFlags[tdc->index] &= ~(IFDirtyPages | IFAnyPages); + afs_indexFlags[tdc->index] &= + ~(IFDirtyPages | IFAnyPages); } #endif if (skip) { /* skip this guy and mark him as recently used */ afs_indexFlags[tdc->index] |= IFFlag; - } - else { + afs_Trace4(afs_iclSetp, CM_TRACE_GETDOWND, + ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, 2, + ICL_TYPE_INT32, tdc->index, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(tchunkoffset)); + } else { /* flush this dude from the data cache and reclaim; - * first, make sure no one will care that we damage - * it, by removing it from all hash tables. Then, - * melt it down for parts. Note that any concurrent - * (new possibility!) calls to GetDownD won't touch - * this guy because his reference count is > 0. */ + * first, make sure no one will care that we damage + * it, by removing it from all hash tables. Then, + * melt it down for parts. Note that any concurrent + * (new possibility!) calls to GetDownD won't touch + * this guy because his reference count is > 0. */ + afs_Trace4(afs_iclSetp, CM_TRACE_GETDOWND, + ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, 3, + ICL_TYPE_INT32, tdc->index, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(tchunkoffset)); #ifndef AFS_DEC_ENV AFS_STATCNT(afs_gget); #endif @@ -614,7 +632,8 @@ endmultipage: if (tdc->f.chunkBytes != 0) { discard = 1; if (aneedSpace) - *aneedSpace -= (tdc->f.chunkBytes + afs_fsfragsize) >> 10; + *aneedSpace -= + (tdc->f.chunkBytes + afs_fsfragsize) >> 10; } else { discard = 0; } @@ -627,13 +646,9 @@ endmultipage: j = 1; /* we reclaimed at least one victim */ } } -#ifdef AFS_SUN5_ENVX afs_PutDCache(tdc); -#else - tdc->refCount--; /* put it back */ -#endif } - + if (phase == 0) { /* Phase is 0 and no one was found, so try phase 1 (ignore * osi_Active flag) */ @@ -643,15 +658,15 @@ endmultipage: /* turn off all flags */ afs_indexFlags[i] &= ~IFFlag; } - } - else { + } else { /* found no one in phase 1, we're hosed */ - if (victimPtr == 0) break; + if (victimPtr == 0) + break; } - } /* big while loop */ + } /* big while loop */ return; -} /*afs_GetDownD*/ +} /*afs_GetDownD */ /* @@ -662,11 +677,9 @@ endmultipage: * * Locks: Must have the afs_xdcache lock write-locked to call this function. */ -afs_HashOutDCache(adc) - struct dcache *adc; - -{ /*afs_HashOutDCache*/ - +int +afs_HashOutDCache(struct dcache *adc) +{ int i, us; #ifndef AFS_DEC_ENV @@ -682,8 +695,7 @@ afs_HashOutDCache(adc) if (us == adc->index) { /* first dude in the list */ afs_dchashTbl[i] = afs_dcnextTbl[adc->index]; - } - else { + } else { /* somewhere on the chain */ while (us != NULLIDX) { if (afs_dcnextTbl[us] == adc->index) { @@ -693,7 +705,8 @@ afs_HashOutDCache(adc) } us = afs_dcnextTbl[us]; } - if (us == NULLIDX) osi_Panic("dcache hc"); + if (us == NULLIDX) + osi_Panic("dcache hc"); } /* remove entry from *other* hash chain */ i = DVHash(&adc->f.fid); @@ -701,8 +714,7 @@ afs_HashOutDCache(adc) if (us == adc->index) { /* first dude in the list */ afs_dvhashTbl[i] = afs_dvnextTbl[adc->index]; - } - else { + } else { /* somewhere on the chain */ while (us != NULLIDX) { if (afs_dvnextTbl[us] == adc->index) { @@ -712,7 +724,8 @@ afs_HashOutDCache(adc) } us = afs_dvnextTbl[us]; } - if (us == NULLIDX) osi_Panic("dcache hv"); + if (us == NULLIDX) + osi_Panic("dcache hv"); } } @@ -723,11 +736,11 @@ afs_HashOutDCache(adc) adc->f.fid.Fid.Volume = 0; /* invalid */ /* mark entry as modified */ - adc->flags |= DFEntryMod; + adc->dflags |= DFEntryMod; /* all done */ return 0; -} /*afs_HashOutDCache */ +} /*afs_HashOutDCache */ /* @@ -746,10 +759,8 @@ afs_HashOutDCache(adc) */ void -afs_FlushDCache(adc) -register struct dcache *adc; -{ /*afs_FlushDCache*/ - +afs_FlushDCache(register struct dcache *adc) +{ AFS_STATCNT(afs_FlushDCache); /* * Bump the number of cache files flushed. @@ -773,12 +784,12 @@ register struct dcache *adc; if (afs_WaitForCacheDrain) { if (afs_blocksUsed <= - (CM_CACHESIZEDRAINEDPCT*afs_cacheBlocks)/100) { + (CM_CACHESIZEDRAINEDPCT * afs_cacheBlocks) / 100) { afs_WaitForCacheDrain = 0; afs_osi_Wakeup(&afs_WaitForCacheDrain); } } -} /*afs_FlushDCache*/ +} /*afs_FlushDCache */ /* @@ -790,8 +801,9 @@ register struct dcache *adc; * * Environment: called with afs_xdcache lock write-locked. */ -afs_FreeDCache(adc) -register struct dcache *adc; { +static void +afs_FreeDCache(register struct dcache *adc) +{ /* Thread on free list, update free list count and mark entry as * freed in its indexFlags element. Also, ensure DCache entry gets * written out (set DFEntryMod). @@ -801,16 +813,15 @@ register struct dcache *adc; { afs_freeDCList = adc->index; afs_freeDCCount++; afs_indexFlags[adc->index] |= IFFree; - adc->flags |= DFEntryMod; + adc->dflags |= DFEntryMod; if (afs_WaitForCacheDrain) { if ((afs_blocksUsed - afs_blocksDiscarded) <= - (CM_CACHESIZEDRAINEDPCT*afs_cacheBlocks)/100) { + (CM_CACHESIZEDRAINEDPCT * afs_cacheBlocks) / 100) { afs_WaitForCacheDrain = 0; afs_osi_Wakeup(&afs_WaitForCacheDrain); } } - return 0; } /* @@ -828,18 +839,21 @@ register struct dcache *adc; { * * Parameters: * adc : Ptr to dcache entry. + * + * Environment: + * Must be called with afs_xdcache write-locked. */ static void -afs_DiscardDCache(adc) - register struct dcache *adc; - -{ /*afs_DiscardDCache*/ - +afs_DiscardDCache(register struct dcache *adc) +{ register afs_int32 size; AFS_STATCNT(afs_DiscardDCache); - size = ((adc->f.chunkBytes + afs_fsfragsize)^afs_fsfragsize)>>10;/* round up */ + + osi_Assert(adc->refCount == 1); + + size = ((adc->f.chunkBytes + afs_fsfragsize) ^ afs_fsfragsize) >> 10; /* round up */ afs_blocksDiscarded += size; afs_stats_cmperf.cacheBlocksDiscarded = afs_blocksDiscarded; @@ -848,18 +862,18 @@ afs_DiscardDCache(adc) afs_discardDCCount++; adc->f.fid.Fid.Volume = 0; - adc->flags |= DFEntryMod; + adc->dflags |= DFEntryMod; afs_indexFlags[adc->index] |= IFDiscarded; if (afs_WaitForCacheDrain) { if ((afs_blocksUsed - afs_blocksDiscarded) <= - (CM_CACHESIZEDRAINEDPCT*afs_cacheBlocks)/100) { + (CM_CACHESIZEDRAINEDPCT * afs_cacheBlocks) / 100) { afs_WaitForCacheDrain = 0; afs_osi_Wakeup(&afs_WaitForCacheDrain); } } -} /*afs_DiscardDCache*/ +} /*afs_DiscardDCache */ /* * afs_FreeDiscardedDCache @@ -868,15 +882,15 @@ afs_DiscardDCache(adc) * Free the next element on the list of discarded cache elements. */ static void -afs_FreeDiscardedDCache() +afs_FreeDiscardedDCache(void) { register struct dcache *tdc; - register struct osi_file *tfile; + register struct osi_file *tfile; register afs_int32 size; AFS_STATCNT(afs_FreeDiscardedDCache); - MObtainWriteLock(&afs_xdcache,510); + MObtainWriteLock(&afs_xdcache, 510); if (!afs_blocksDiscarded) { MReleaseWriteLock(&afs_xdcache); return; @@ -886,12 +900,17 @@ afs_FreeDiscardedDCache() * Get an entry from the list of discarded cache elements */ tdc = afs_GetDSlot(afs_discardDCList, 0); + osi_Assert(tdc->refCount == 1); + ReleaseReadLock(&tdc->tlock); + afs_discardDCList = afs_dvnextTbl[tdc->index]; afs_dvnextTbl[tdc->index] = NULLIDX; afs_discardDCCount--; - size = ((tdc->f.chunkBytes + afs_fsfragsize)^afs_fsfragsize)>>10;/* round up */ + size = ((tdc->f.chunkBytes + afs_fsfragsize) ^ afs_fsfragsize) >> 10; /* round up */ afs_blocksDiscarded -= size; afs_stats_cmperf.cacheBlocksDiscarded = afs_blocksDiscarded; + /* We can lock because we just took it off the free list */ + ObtainWriteLock(&tdc->lock, 626); MReleaseWriteLock(&afs_xdcache); /* @@ -905,10 +924,11 @@ afs_FreeDiscardedDCache() /* * Free the element we just truncated */ - MObtainWriteLock(&afs_xdcache,511); + MObtainWriteLock(&afs_xdcache, 511); afs_indexFlags[tdc->index] &= ~IFDiscarded; afs_FreeDCache(tdc); - tdc->refCount--; + ReleaseWriteLock(&tdc->lock); + afs_PutDCache(tdc); MReleaseWriteLock(&afs_xdcache); } @@ -922,13 +942,15 @@ afs_FreeDiscardedDCache() * Parameters: * None */ -afs_MaybeFreeDiscardedDCache() +int +afs_MaybeFreeDiscardedDCache(void) { AFS_STATCNT(afs_MaybeFreeDiscardedDCache); - while (afs_blocksDiscarded && - (afs_blocksUsed > (CM_WAITFORDRAINPCT*afs_cacheBlocks)/100)) { + while (afs_blocksDiscarded + && (afs_blocksUsed > + (CM_WAITFORDRAINPCT * afs_cacheBlocks) / 100)) { afs_FreeDiscardedDCache(); } return 0; @@ -942,24 +964,16 @@ afs_MaybeFreeDiscardedDCache() * * Parameters: * anumber : Targeted number of disk slots to free up. + * + * Environment: + * Must be called with afs_xdcache write-locked. */ -#if defined(AFS_SGI_ENV) && defined(AFS_SGI_SHORTSTACK) -extern SV_TYPE afs_sgibksync; -extern SV_TYPE afs_sgibkwait; -extern lock_t afs_sgibklock; -extern struct dcache *afs_sgibklist; -#endif - static void -afs_GetDownDSlot(anumber) - int anumber; - -{ /*afs_GetDownDSlot*/ - +afs_GetDownDSlot(int anumber) +{ struct afs_q *tq, *nq; struct dcache *tdc; int ix; - unsigned int i=0; unsigned int cnt; AFS_STATCNT(afs_GetDownDSlot); @@ -970,27 +984,28 @@ afs_GetDownDSlot(anumber) osi_Panic("getdowndslot nolock"); /* decrement anumber first for all dudes in free list */ - for(tdc = afs_freeDSList; tdc; tdc = (struct dcache *)tdc->lruq.next) + for (tdc = afs_freeDSList; tdc; tdc = (struct dcache *)tdc->lruq.next) anumber--; - if (anumber <= 0) - return; /* enough already free */ + if (anumber <= 0) + return; /* enough already free */ - for(cnt=0, tq = afs_DLRU.prev; tq != &afs_DLRU && anumber > 0; - tq = nq, cnt++) { - tdc = (struct dcache *) tq; /* q is first elt in dcache entry */ - nq = QPrev(tq); /* in case we remove it */ + for (cnt = 0, tq = afs_DLRU.prev; tq != &afs_DLRU && anumber > 0; + tq = nq, cnt++) { + tdc = (struct dcache *)tq; /* q is first elt in dcache entry */ + nq = QPrev(tq); /* in case we remove it */ if (tdc->refCount == 0) { - if ((ix=tdc->index) == NULLIDX) osi_Panic("getdowndslot"); + if ((ix = tdc->index) == NULLIDX) + osi_Panic("getdowndslot"); /* pull the entry out of the lruq and put it on the free list */ QRemove(&tdc->lruq); /* write-through if modified */ - if (tdc->flags & DFEntryMod) { + if (tdc->dflags & DFEntryMod) { #if defined(AFS_SGI_ENV) && defined(AFS_SGI_SHORTSTACK) /* * ask proxy to do this for us - we don't have the stack space */ - while (tdc->flags & DFEntryMod) { + while (tdc->dflags & DFEntryMod) { int s; AFS_GUNLOCK(); s = SPLOCK(afs_sgibklock); @@ -1004,34 +1019,60 @@ afs_GetDownDSlot(anumber) AFS_GLOCK(); } #else - tdc->flags &= ~DFEntryMod; + tdc->dflags &= ~DFEntryMod; afs_WriteDCache(tdc, 1); #endif } tdc->stamp = 0; #ifdef IHINT - if (tdc->ihint) { - struct osi_file * f = (struct osi_file *)tdc->ihint; - tdc->ihint = 0; - afs_UFSClose(f); - nihints--; - } + if (tdc->ihint) { + struct osi_file *f = (struct osi_file *)tdc->ihint; + tdc->ihint = 0; + afs_UFSClose(f); + nihints--; + } #endif /* IHINT */ /* finally put the entry in the free list */ - afs_indexTable[ix] = (struct dcache *) 0; + afs_indexTable[ix] = NULL; afs_indexFlags[ix] &= ~IFEverUsed; tdc->index = NULLIDX; - tdc->lruq.next = (struct afs_q *) afs_freeDSList; + tdc->lruq.next = (struct afs_q *)afs_freeDSList; afs_freeDSList = tdc; anumber--; } } -} /*afs_GetDownDSlot*/ +} /*afs_GetDownDSlot */ +/* + * afs_RefDCache + * + * Description: + * Increment the reference count on a disk cache entry, + * which already has a non-zero refcount. In order to + * increment the refcount of a zero-reference entry, you + * have to hold afs_xdcache. + * + * Parameters: + * adc : Pointer to the dcache entry to increment. + * + * Environment: + * Nothing interesting. + */ +int +afs_RefDCache(struct dcache *adc) +{ + ObtainWriteLock(&adc->tlock, 627); + if (adc->refCount < 0) + osi_Panic("RefDCache: negative refcount"); + adc->refCount++; + ReleaseWriteLock(&adc->tlock); + return 0; +} + /* * afs_PutDCache @@ -1045,25 +1086,17 @@ afs_GetDownDSlot(anumber) * Environment: * Nothing interesting. */ -afs_PutDCache(ad) - register struct dcache *ad; - -{ /*afs_PutDCache*/ +int +afs_PutDCache(register struct dcache *adc) +{ AFS_STATCNT(afs_PutDCache); -#ifndef AFS_SUN5_ENVX - MObtainWriteLock(&afs_xdcache,276); -#endif - if (ad->refCount <= 0) + ObtainWriteLock(&adc->tlock, 276); + if (adc->refCount <= 0) osi_Panic("putdcache"); - --ad->refCount; -#ifdef AFS_SUN5_ENVX - MReleaseWriteLock(&ad->lock); -#else - MReleaseWriteLock(&afs_xdcache); -#endif + --adc->refCount; + ReleaseWriteLock(&adc->tlock); return 0; - -} /*afs_PutDCache*/ +} /* @@ -1080,23 +1113,19 @@ afs_PutDCache(ad) * Both pvnLock and lock are write held. */ void -afs_TryToSmush(avc, acred, sync) - register struct vcache *avc; - struct AFS_UCRED *acred; - int sync; -{ /*afs_TryToSmush*/ - +afs_TryToSmush(register struct vcache *avc, struct AFS_UCRED *acred, int sync) +{ register struct dcache *tdc; register int index; register int i; AFS_STATCNT(afs_TryToSmush); afs_Trace2(afs_iclSetp, CM_TRACE_TRYTOSMUSH, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->m.Length); - sync = 1; /* XX Temp testing XX*/ + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length)); + sync = 1; /* XX Temp testing XX */ #if defined(AFS_SUN5_ENV) ObtainWriteLock(&avc->vlock, 573); - avc->activeV++; /* block new getpages */ + avc->activeV++; /* block new getpages */ ReleaseWriteLock(&avc->vlock); #endif @@ -1106,23 +1135,28 @@ afs_TryToSmush(avc, acred, sync) /* * Get the hash chain containing all dce's for this fid */ - i = DVHash(&avc->fid); - MObtainWriteLock(&afs_xdcache,277); - for(index = afs_dvhashTbl[i]; index != NULLIDX; index=i) { - i = afs_dvnextTbl[index]; /* next pointer this hash table */ - if (afs_indexUnique[index] == avc->fid.Fid.Unique) { - tdc = afs_GetDSlot(index, (struct dcache *)0); - if (!FidCmp(&tdc->f.fid, &avc->fid)) { - if (sync) { - if ((afs_indexFlags[index] & IFDataMod) == 0 && - tdc->refCount == 1) { - afs_FlushDCache(tdc); - } - } else - afs_indexTable[index] = 0; + i = DVHash(&avc->fid); + MObtainWriteLock(&afs_xdcache, 277); + for (index = afs_dvhashTbl[i]; index != NULLIDX; index = i) { + i = afs_dvnextTbl[index]; /* next pointer this hash table */ + if (afs_indexUnique[index] == avc->fid.Fid.Unique) { + int releaseTlock = 1; + tdc = afs_GetDSlot(index, NULL); + if (!FidCmp(&tdc->f.fid, &avc->fid)) { + if (sync) { + if ((afs_indexFlags[index] & IFDataMod) == 0 + && tdc->refCount == 1) { + ReleaseReadLock(&tdc->tlock); + releaseTlock = 0; + afs_FlushDCache(tdc); + } + } else + afs_indexTable[index] = 0; + } + if (releaseTlock) + ReleaseReadLock(&tdc->tlock); + afs_PutDCache(tdc); } - lockedPutDCache(tdc); - } } #if defined(AFS_SUN5_ENV) ObtainWriteLock(&avc->vlock, 545); @@ -1138,7 +1172,7 @@ afs_TryToSmush(avc, acred, sync) * trytoSmush occured during the lookup call */ afs_allCBs++; -} /*afs_TryToSmush*/ +} /* * afs_FindDCache @@ -1160,12 +1194,9 @@ afs_TryToSmush(avc, acred, sync) * The vcache entry is held upon entry. */ -struct dcache *afs_FindDCache(avc, abyte) - register struct vcache *avc; - afs_int32 abyte; - -{ /*afs_FindDCache*/ - +struct dcache * +afs_FindDCache(register struct vcache *avc, afs_size_t abyte) +{ afs_int32 chunk; register afs_int32 i, index; register struct dcache *tdc; @@ -1178,27 +1209,27 @@ struct dcache *afs_FindDCache(avc, abyte) * after write-locking the dcache. */ i = DCHash(&avc->fid, chunk); - MObtainWriteLock(&afs_xdcache,278); - for(index = afs_dchashTbl[i]; index != NULLIDX;) { - if (afs_indexUnique[index] == avc->fid.Fid.Unique) { - tdc = afs_GetDSlot(index, (struct dcache *)0); - if (!FidCmp(&tdc->f.fid, &avc->fid) && chunk == tdc->f.chunk) { - break; /* leaving refCount high for caller */ + MObtainWriteLock(&afs_xdcache, 278); + for (index = afs_dchashTbl[i]; index != NULLIDX;) { + if (afs_indexUnique[index] == avc->fid.Fid.Unique) { + tdc = afs_GetDSlot(index, NULL); + ReleaseReadLock(&tdc->tlock); + if (!FidCmp(&tdc->f.fid, &avc->fid) && chunk == tdc->f.chunk) { + break; /* leaving refCount high for caller */ + } + afs_PutDCache(tdc); } - lockedPutDCache(tdc); - } - index = afs_dcnextTbl[index]; + index = afs_dcnextTbl[index]; } MReleaseWriteLock(&afs_xdcache); if (index != NULLIDX) { hset(afs_indexTimes[tdc->index], afs_indexCounter); hadd32(afs_indexCounter, 1); return tdc; - } - else - return(struct dcache *) 0; + } else + return NULL; -} /*afs_FindDCache*/ +} /*afs_FindDCache */ /* @@ -1223,17 +1254,12 @@ struct dcache *afs_FindDCache(avc, abyte) * Environment: * Nothing interesting. */ -static int afs_UFSCacheStoreProc(acall, afile, alen, avc, shouldWake, - abytesToXferP, abytesXferredP) - register struct rx_call *acall; - struct osi_file *afile; - register afs_int32 alen; - struct vcache *avc; - int *shouldWake; - afs_int32 *abytesToXferP; - afs_int32 *abytesXferredP; -{ /* afs_UFSCacheStoreProc*/ - +static int +afs_UFSCacheStoreProc(register struct rx_call *acall, struct osi_file *afile, + register afs_int32 alen, struct vcache *avc, + int *shouldWake, afs_size_t * abytesToXferP, + afs_size_t * abytesXferredP) +{ afs_int32 code, got; register char *tbuffer; register int tlen; @@ -1245,33 +1271,32 @@ static int afs_UFSCacheStoreProc(acall, afile, alen, avc, shouldWake, * In this case, alen is *always* the amount of data we'll be trying * to ship here. */ - (*abytesToXferP) = alen; + (*abytesToXferP) = alen; (*abytesXferredP) = 0; #endif /* AFS_NOSTATS */ - afs_Trace3(afs_iclSetp, CM_TRACE_STOREPROC, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->m.Length, ICL_TYPE_INT32, alen); + afs_Trace4(afs_iclSetp, CM_TRACE_STOREPROC, ICL_TYPE_POINTER, avc, + ICL_TYPE_FID, &(avc->fid), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length), ICL_TYPE_INT32, alen); tbuffer = osi_AllocLargeSpace(AFS_LRALLOCSIZ); while (alen > 0) { tlen = (alen > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : alen); got = afs_osi_Read(afile, -1, tbuffer, tlen); - if ((got < 0) -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) + if ((got < 0) +#if defined(KERNEL_HAVE_UERROR) || (got != tlen && getuerror()) #endif ) { osi_FreeLargeSpace(tbuffer); return EIO; } -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = rx_Write(acall, tbuffer, got); /* writing 0 bytes will - * push a short packet. Is that really what we want, just because the - * data didn't come back from the disk yet? Let's try it and see. */ -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + afs_Trace2(afs_iclSetp, CM_TRACE_STOREPROC2, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(*tbuffer), ICL_TYPE_INT32, got); + RX_AFS_GUNLOCK(); + code = rx_Write(acall, tbuffer, got); /* writing 0 bytes will + * push a short packet. Is that really what we want, just because the + * data didn't come back from the disk yet? Let's try it and see. */ + RX_AFS_GLOCK(); #ifndef AFS_NOSTATS (*abytesXferredP) += code; #endif /* AFS_NOSTATS */ @@ -1285,14 +1310,17 @@ static int afs_UFSCacheStoreProc(acall, afile, alen, avc, shouldWake, * to continue. */ if (shouldWake && *shouldWake && (rx_GetRemoteStatus(acall) & 1)) { - *shouldWake = 0; /* only do this once */ + *shouldWake = 0; /* only do this once */ afs_wakeup(avc); } } + afs_Trace4(afs_iclSetp, CM_TRACE_STOREPROC, ICL_TYPE_POINTER, avc, + ICL_TYPE_FID, &(avc->fid), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length), ICL_TYPE_INT32, alen); osi_FreeLargeSpace(tbuffer); return 0; -} /* afs_UFSCacheStoreProc*/ +} /* afs_UFSCacheStoreProc */ /* @@ -1306,7 +1334,7 @@ static int afs_UFSCacheStoreProc(acall, afile, alen, avc, shouldWake, * acall : Ptr to the Rx call structure. * afile : File descriptor for the cache file. * abase : Base offset to fetch. - * adc : Ptr to the dcache entry for the file. + * adc : Ptr to the dcache entry for the file, write-locked. * avc : Ptr to the vcache entry for the file. * abytesToXferP : Set to the number of bytes to xfer. * NOTE: This parameter is only used if AFS_NOSTATS @@ -1319,45 +1347,40 @@ static int afs_UFSCacheStoreProc(acall, afile, alen, avc, shouldWake, * Nothing interesting. */ -static int afs_UFSCacheFetchProc(acall, afile, abase, adc, avc, - abytesToXferP, abytesXferredP) - register struct rx_call *acall; - afs_int32 abase; - struct dcache *adc; - struct vcache *avc; - struct osi_file *afile; - afs_int32 *abytesToXferP; - afs_int32 *abytesXferredP; - -{ /*UFS_CacheFetchProc*/ - +static int +afs_UFSCacheFetchProc(register struct rx_call *acall, struct osi_file *afile, + afs_size_t abase, struct dcache *adc, + struct vcache *avc, afs_size_t * abytesToXferP, + afs_size_t * abytesXferredP, afs_int32 lengthFound) +{ afs_int32 length; register afs_int32 code; register char *tbuffer; register int tlen; - int moredata; + int moredata = 0; AFS_STATCNT(UFS_CacheFetchProc); - afile->offset = 0; /* Each time start from the beginning */ + osi_Assert(WriteLocked(&adc->lock)); + afile->offset = 0; /* Each time start from the beginning */ + length = lengthFound; #ifndef AFS_NOSTATS - (*abytesToXferP) = 0; + (*abytesToXferP) = 0; (*abytesXferredP) = 0; #endif /* AFS_NOSTATS */ tbuffer = osi_AllocLargeSpace(AFS_LRALLOCSIZ); + adc->validPos = abase; do { -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = rx_Read(acall, (char *)&length, sizeof(afs_int32)); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - if (code != sizeof(afs_int32)) { - osi_FreeLargeSpace(tbuffer); - code = rx_Error(acall); - return (code?code:-1); /* try to return code, not -1 */ + if (moredata) { + RX_AFS_GUNLOCK(); + code = rx_Read(acall, (char *)&length, sizeof(afs_int32)); + RX_AFS_GLOCK(); + length = ntohl(length); + if (code != sizeof(afs_int32)) { + osi_FreeLargeSpace(tbuffer); + code = rx_Error(acall); + return (code ? code : -1); /* try to return code, not -1 */ + } } - length = ntohl(length); /* * The fetch protocol is extended for the AFS/DFS translator * to allow multiple blocks of data, each with its own length, @@ -1375,21 +1398,28 @@ static int afs_UFSCacheFetchProc(acall, afile, abase, adc, avc, } #ifndef AFS_NOSTATS (*abytesToXferP) += length; -#endif /* AFS_NOSTATS */ +#endif /* AFS_NOSTATS */ while (length > 0) { tlen = (length > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : length); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ +#ifdef RX_KERNEL_TRACE + afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP, ICL_TYPE_STRING, + "before rx_Read"); +#endif + RX_AFS_GUNLOCK(); code = rx_Read(acall, tbuffer, tlen); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); +#ifdef RX_KERNEL_TRACE + afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP, ICL_TYPE_STRING, + "after rx_Read"); +#endif #ifndef AFS_NOSTATS (*abytesXferredP) += code; -#endif /* AFS_NOSTATS */ +#endif /* AFS_NOSTATS */ if (code != tlen) { osi_FreeLargeSpace(tbuffer); + afs_Trace3(afs_iclSetp, CM_TRACE_FETCH64READ, + ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, code, + ICL_TYPE_INT32, length); return -34; } code = afs_osi_Write(afile, -1, tbuffer, tlen); @@ -1400,16 +1430,17 @@ static int afs_UFSCacheFetchProc(acall, afile, abase, adc, avc, abase += tlen; length -= tlen; adc->validPos = abase; - if (adc->flags & DFWaiting) { - adc->flags &= ~DFWaiting; - afs_osi_Wakeup(&adc->validPos); - } + if (afs_osi_Wakeup(&adc->validPos) == 0) + afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAKE, ICL_TYPE_STRING, + __FILE__, ICL_TYPE_INT32, __LINE__, + ICL_TYPE_POINTER, adc, ICL_TYPE_INT32, + adc->dflags); } } while (moredata); osi_FreeLargeSpace(tbuffer); return 0; -} /* afs_UFSCacheFetchProc*/ +} /* afs_UFSCacheFetchProc */ /* * afs_GetDCache @@ -1428,6 +1459,8 @@ static int afs_UFSCacheFetchProc(acall, afile, abase, adc, avc, * aflags : Settings as follows: * 1 : Set locks * 2 : Return after creating entry. + * 4 : called from afs_vnop_write.c + * *alen contains length of data to be written. * OUT: * aoffset : Set to the offset within the chunk where the resident * byte is located. @@ -1445,10 +1478,14 @@ struct tlocal1 { struct AFSCallBack CallBack; }; -/* these fields are protected by the lock on the vcache and luck - * on the dcache */ -void updateV2DC(int l, struct vcache *v, struct dcache *d, int src) { - if (!l || 0 == NBObtainWriteLock(&(v->lock),src)) { +/* + * Update the vnode-to-dcache hint if we can get the vnode lock + * right away. Assumes dcache entry is at least read-locked. + */ +void +updateV2DC(int lockVc, struct vcache *v, struct dcache *d, int src) +{ + if (!lockVc || 0 == NBObtainWriteLock(&v->lock, src)) { if (hsame(v->m.DataVersion, d->f.versionNo) && v->callback) { v->quick.dc = d; v->quick.stamp = d->stamp = MakeStamp(); @@ -1457,43 +1494,57 @@ void updateV2DC(int l, struct vcache *v, struct dcache *d, int src) { v->quick.len = d->f.chunkBytes; v->h1.dchint = d; } - if(l) ReleaseWriteLock(&((v)->lock)); + if (lockVc) + ReleaseWriteLock(&v->lock); } } -struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags) - register struct vcache *avc; /*Held*/ - afs_int32 abyte; - int aflags; - afs_int32 *aoffset, *alen; - register struct vrequest *areq; - -{ /*afs_GetDCache*/ - - register afs_int32 i, code, code1, shortcut , adjustsize=0; +/* avc - Write-locked unless aflags & 1 */ +struct dcache * +afs_GetDCache(register struct vcache *avc, afs_size_t abyte, + register struct vrequest *areq, afs_size_t * aoffset, + afs_size_t * alen, int aflags) +{ + register afs_int32 i, code, code1 = 0, shortcut; +#if defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) + register afs_int32 adjustsize = 0; +#endif int setLocks; afs_int32 index; afs_int32 us; afs_int32 chunk; - afs_int32 maxGoodLength; /* amount of good data at server */ + afs_size_t maxGoodLength; /* amount of good data at server */ struct rx_call *tcall; - afs_int32 Position = 0; - afs_int32 size; /* size of segment to transfer */ - struct tlocal1 *tsmall; + afs_size_t Position = 0; +#ifdef AFS_64BIT_CLIENT + afs_size_t tsize; + afs_size_t lengthFound; /* as returned from server */ +#endif /* AFS_64BIT_CLIENT */ + afs_int32 size, tlen; /* size of segment to transfer */ + struct tlocal1 *tsmall = 0; register struct dcache *tdc; register struct osi_file *file; register struct conn *tc; int downDCount = 0; + struct server *newCallback; + char setNewCallback; + char setVcacheStatus; + char doVcacheUpdate; + char slowPass = 0; + int doAdjustSize = 0; + int doReallyAdjustSize = 0; + int overWriteWholeChunk = 0; + XSTATS_DECLS #ifndef AFS_NOSTATS struct afs_stats_xferData *xferP; /* Ptr to this op's xfer struct */ - osi_timeval_t xferStartTime, /*FS xfer start time*/ - xferStopTime; /*FS xfer stop time*/ - afs_int32 bytesToXfer; /* # bytes to xfer*/ - afs_int32 bytesXferred; /* # bytes actually xferred*/ - struct afs_stats_AccessInfo *accP; /*Ptr to access record in stats*/ - int fromReplica; /*Are we reading from a replica?*/ - int numFetchLoops; /*# times around the fetch/analyze loop*/ + osi_timeval_t xferStartTime, /*FS xfer start time */ + xferStopTime; /*FS xfer stop time */ + afs_size_t bytesToXfer; /* # bytes to xfer */ + afs_size_t bytesXferred; /* # bytes actually xferred */ + struct afs_stats_AccessInfo *accP; /*Ptr to access record in stats */ + int fromReplica; /*Are we reading from a replica? */ + int numFetchLoops; /*# times around the fetch/analyze loop */ #endif /* AFS_NOSTATS */ AFS_STATCNT(afs_GetDCache); @@ -1501,177 +1552,272 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags) if (dcacheDisabled) return NULL; + setLocks = aflags & 1; + /* * Determine the chunk number and offset within the chunk corresponding * to the desired byte. */ - if (vType(avc) == VDIR) { + if (avc->fid.Fid.Vnode & 1) { /* if (vType(avc) == VDIR) */ chunk = 0; - } - else { + } else { chunk = AFS_CHUNK(abyte); } - setLocks = aflags & 1; - /* come back to here if we waited for the cache to drain. */ - RetryGetDCache: + RetryGetDCache: + + setNewCallback = setVcacheStatus = 0; + + if (setLocks) { + if (slowPass) + ObtainWriteLock(&avc->lock, 616); + else + ObtainReadLock(&avc->lock); + } + + /* + * Locks held: + * avc->lock(R) if setLocks && !slowPass + * avc->lock(W) if !setLocks || slowPass + */ + shortcut = 0; /* check hints first! (might could use bcmp or some such...) */ + if ((tdc = avc->h1.dchint)) { + int dcLocked; - if (tdc = avc->h1.dchint) { + /* + * The locking order between afs_xdcache and dcache lock matters. + * The hint dcache entry could be anywhere, even on the free list. + * Locking afs_xdcache ensures that noone is trying to pull dcache + * entries from the free list, and thereby assuming them to be not + * referenced and not locked. + */ MObtainReadLock(&afs_xdcache); - if ( (tdc->index != NULLIDX) && !FidCmp(&tdc->f.fid, &avc->fid) && - chunk == tdc->f.chunk && - !(afs_indexFlags[tdc->index] & (IFFree|IFDiscarded))) { + dcLocked = (0 == NBObtainSharedLock(&tdc->lock, 601)); + + if (dcLocked && (tdc->index != NULLIDX) + && !FidCmp(&tdc->f.fid, &avc->fid) && chunk == tdc->f.chunk + && !(afs_indexFlags[tdc->index] & (IFFree | IFDiscarded))) { /* got the right one. It might not be the right version, and it * might be fetching, but it's the right dcache entry. */ /* All this code should be integrated better with what follows: * I can save a good bit more time under a write lock if I do.. */ - /* does avc need to be locked? */ - /* Note that the race labeled LOCKXXX is inconsequential: the xdcache - * lock protects both the dcache slots AND the DLRU list. While - * the slots and hash table and DLRU list all may change in the race, - * THIS particular dcache structure cannot be recycled and its LRU - * pointers must still be valid once we get the lock again. Still - * we should either create another lock or invent a new method of - * managing dcache structs -- CLOCK or something. */ - shortcut = 1; -#ifdef AFS_SUN5_ENVX - MObtainWriteLock(&tdc->lock,279); -#endif + ObtainWriteLock(&tdc->tlock, 603); tdc->refCount++; - if (hsame(tdc->f.versionNo, avc->m.DataVersion) - && !(tdc->flags & DFFetching)) { - afs_stats_cmperf.dcacheHits++; - MReleaseReadLock(&afs_xdcache); + ReleaseWriteLock(&tdc->tlock); + + MReleaseReadLock(&afs_xdcache); + shortcut = 1; + + if (hsame(tdc->f.versionNo, avc->m.DataVersion) + && !(tdc->dflags & DFFetching)) { - MObtainWriteLock(&afs_xdcache, 559); /* LOCKXXX */ + afs_stats_cmperf.dcacheHits++; + MObtainWriteLock(&afs_xdcache, 559); QRemove(&tdc->lruq); QAdd(&afs_DLRU, &tdc->lruq); MReleaseWriteLock(&afs_xdcache); + + /* Locks held: + * avc->lock(R) if setLocks && !slowPass + * avc->lock(W) if !setLocks || slowPass + * tdc->lock(S) + */ goto done; } -#ifdef AFS_SUN5_ENVX - MReleaseWriteLock(&tdc->lock); -#endif + } else { + if (dcLocked) + ReleaseSharedLock(&tdc->lock); + MReleaseReadLock(&afs_xdcache); } - MReleaseReadLock(&afs_xdcache); - } - if (!shortcut) - { - /* - * Hash on the [fid, chunk] and get the corresponding dcache index - * after write-locking the dcache. - */ - RetryLookup: - i = DCHash(&avc->fid, chunk); - afs_MaybeWakeupTruncateDaemon(); /* check to make sure our space is fine */ - MObtainWriteLock(&afs_xdcache,280); - us = NULLIDX; - for(index = afs_dchashTbl[i]; index != NULLIDX;) { - if (afs_indexUnique[index] == avc->fid.Fid.Unique) { - tdc = afs_GetDSlot(index, (struct dcache *)0); - if (!FidCmp(&tdc->f.fid, &avc->fid) && chunk == tdc->f.chunk) { - /* Move it up in the beginning of the list */ - if (afs_dchashTbl[i] != index) { - afs_dcnextTbl[us] = afs_dcnextTbl[index]; - afs_dcnextTbl[index] = afs_dchashTbl[i]; - afs_dchashTbl[i] = index; - } - MReleaseWriteLock(&afs_xdcache); - break; /* leaving refCount high for caller */ - } - lockedPutDCache(tdc); - } - us = index; - index = afs_dcnextTbl[index]; + if (!shortcut) + tdc = 0; } - /* - * If we didn't find the entry, we'll create one. + + /* Locks held: + * avc->lock(R) if setLocks && !slowPass + * avc->lock(W) if !setLocks || slowPass + * tdc->lock(S) if tdc */ - if (index == NULLIDX) { - afs_Trace2(afs_iclSetp, CM_TRACE_GETDCACHE1, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, chunk); - - if (afs_discardDCList == NULLIDX && afs_freeDCList == NULLIDX) { - while (1) { - if (!setLocks) avc->states |= CDCLock; - afs_GetDownD(5, (int*)0); /* just need slots */ - if (!setLocks) avc->states &= (~CDCLock); - if (afs_discardDCList != NULLIDX || afs_freeDCList != NULLIDX) - break; - /* If we can't get space for 5 mins we give up and panic */ - if (++downDCount > 300) - osi_Panic("getdcache"); - MReleaseWriteLock(&afs_xdcache); - afs_osi_Wait(1000, 0, 0); - goto RetryLookup; - } - } - if (afs_discardDCList == NULLIDX || - ((aflags & 2) && afs_freeDCList != NULLIDX)) { - afs_indexFlags[afs_freeDCList] &= ~IFFree; - tdc = afs_GetDSlot(afs_freeDCList, 0); - afs_freeDCList = afs_dvnextTbl[tdc->index]; - afs_freeDCCount--; - } else { - afs_indexFlags[afs_discardDCList] &= ~IFDiscarded; - tdc = afs_GetDSlot(afs_discardDCList, 0); - afs_discardDCList = afs_dvnextTbl[tdc->index]; - afs_discardDCCount--; - size = ((tdc->f.chunkBytes + afs_fsfragsize)^afs_fsfragsize)>>10; - afs_blocksDiscarded -= size; - afs_stats_cmperf.cacheBlocksDiscarded = afs_blocksDiscarded; - if (aflags & 2) { - /* Truncate the chunk so zeroes get filled properly */ - file = afs_CFileOpen(tdc->f.inode); - afs_CFileTruncate(file, 0); - afs_CFileClose(file); - afs_AdjustSize(tdc, 0); - } - } + if (!tdc) { /* If the hint wasn't the right dcache entry */ /* - * Fill in the newly-allocated dcache record. + * Hash on the [fid, chunk] and get the corresponding dcache index + * after write-locking the dcache. */ - afs_indexFlags[tdc->index] &= ~(IFDirtyPages | IFAnyPages); - tdc->f.fid = avc->fid; - afs_indexUnique[tdc->index] = tdc->f.fid.Fid.Unique; - hones(tdc->f.versionNo); /* invalid value */ - tdc->f.chunk = chunk; - /* XXX */ - if (tdc->lruq.prev == &tdc->lruq) osi_Panic("lruq 1"); - /* - * Now add to the two hash chains - note that i is still set - * from the above DCHash call. + RetryLookup: + + /* Locks held: + * avc->lock(R) if setLocks && !slowPass + * avc->lock(W) if !setLocks || slowPass */ - afs_dcnextTbl[tdc->index] = afs_dchashTbl[i]; - afs_dchashTbl[i] = tdc->index; - i = DVHash(&avc->fid); - afs_dvnextTbl[tdc->index] = afs_dvhashTbl[i]; - afs_dvhashTbl[i] = tdc->index; - tdc->flags = DFEntryMod; - tdc->f.states = 0; + + i = DCHash(&avc->fid, chunk); + /* check to make sure our space is fine */ afs_MaybeWakeupTruncateDaemon(); - MReleaseWriteLock(&afs_xdcache); + + MObtainWriteLock(&afs_xdcache, 280); + us = NULLIDX; + for (index = afs_dchashTbl[i]; index != NULLIDX;) { + if (afs_indexUnique[index] == avc->fid.Fid.Unique) { + tdc = afs_GetDSlot(index, NULL); + ReleaseReadLock(&tdc->tlock); + /* + * Locks held: + * avc->lock(R) if setLocks && !slowPass + * avc->lock(W) if !setLocks || slowPass + * afs_xdcache(W) + */ + if (!FidCmp(&tdc->f.fid, &avc->fid) && chunk == tdc->f.chunk) { + /* Move it up in the beginning of the list */ + if (afs_dchashTbl[i] != index) { + afs_dcnextTbl[us] = afs_dcnextTbl[index]; + afs_dcnextTbl[index] = afs_dchashTbl[i]; + afs_dchashTbl[i] = index; + } + MReleaseWriteLock(&afs_xdcache); + ObtainSharedLock(&tdc->lock, 606); + break; /* leaving refCount high for caller */ + } + afs_PutDCache(tdc); + tdc = 0; + } + us = index; + index = afs_dcnextTbl[index]; + } + + /* + * If we didn't find the entry, we'll create one. + */ + if (index == NULLIDX) { + /* + * Locks held: + * avc->lock(R) if setLocks + * avc->lock(W) if !setLocks + * afs_xdcache(W) + */ + afs_Trace2(afs_iclSetp, CM_TRACE_GETDCACHE1, ICL_TYPE_POINTER, + avc, ICL_TYPE_INT32, chunk); + + /* Make sure there is a free dcache entry for us to use */ + if (afs_discardDCList == NULLIDX && afs_freeDCList == NULLIDX) { + while (1) { + if (!setLocks) + avc->states |= CDCLock; + afs_GetDownD(5, (int *)0); /* just need slots */ + if (!setLocks) + avc->states &= ~CDCLock; + if (afs_discardDCList != NULLIDX + || afs_freeDCList != NULLIDX) + break; + /* If we can't get space for 5 mins we give up and panic */ + if (++downDCount > 300) + osi_Panic("getdcache"); + MReleaseWriteLock(&afs_xdcache); + /* + * Locks held: + * avc->lock(R) if setLocks + * avc->lock(W) if !setLocks + */ + afs_osi_Wait(1000, 0, 0); + goto RetryLookup; + } + } + + if (afs_discardDCList == NULLIDX + || ((aflags & 2) && afs_freeDCList != NULLIDX)) { + + afs_indexFlags[afs_freeDCList] &= ~IFFree; + tdc = afs_GetDSlot(afs_freeDCList, 0); + osi_Assert(tdc->refCount == 1); + ReleaseReadLock(&tdc->tlock); + ObtainWriteLock(&tdc->lock, 604); + afs_freeDCList = afs_dvnextTbl[tdc->index]; + afs_freeDCCount--; + } else { + afs_indexFlags[afs_discardDCList] &= ~IFDiscarded; + tdc = afs_GetDSlot(afs_discardDCList, 0); + osi_Assert(tdc->refCount == 1); + ReleaseReadLock(&tdc->tlock); + ObtainWriteLock(&tdc->lock, 605); + afs_discardDCList = afs_dvnextTbl[tdc->index]; + afs_discardDCCount--; + size = + ((tdc->f.chunkBytes + + afs_fsfragsize) ^ afs_fsfragsize) >> 10; + afs_blocksDiscarded -= size; + afs_stats_cmperf.cacheBlocksDiscarded = afs_blocksDiscarded; + if (aflags & 2) { + /* Truncate the chunk so zeroes get filled properly */ + file = afs_CFileOpen(tdc->f.inode); + afs_CFileTruncate(file, 0); + afs_CFileClose(file); + afs_AdjustSize(tdc, 0); + } + } + + /* + * Locks held: + * avc->lock(R) if setLocks + * avc->lock(W) if !setLocks + * tdc->lock(W) + * afs_xdcache(W) + */ + + /* + * Fill in the newly-allocated dcache record. + */ + afs_indexFlags[tdc->index] &= ~(IFDirtyPages | IFAnyPages); + tdc->f.fid = avc->fid; + afs_indexUnique[tdc->index] = tdc->f.fid.Fid.Unique; + hones(tdc->f.versionNo); /* invalid value */ + tdc->f.chunk = chunk; + tdc->validPos = AFS_CHUNKTOBASE(chunk); + /* XXX */ + if (tdc->lruq.prev == &tdc->lruq) + osi_Panic("lruq 1"); + + /* + * Now add to the two hash chains - note that i is still set + * from the above DCHash call. + */ + afs_dcnextTbl[tdc->index] = afs_dchashTbl[i]; + afs_dchashTbl[i] = tdc->index; + i = DVHash(&avc->fid); + afs_dvnextTbl[tdc->index] = afs_dvhashTbl[i]; + afs_dvhashTbl[i] = tdc->index; + tdc->dflags = DFEntryMod; + tdc->mflags = 0; + tdc->f.states = 0; + afs_MaybeWakeupTruncateDaemon(); + MReleaseWriteLock(&afs_xdcache); + ConvertWToSLock(&tdc->lock); + } } - } /* else hint failed... */ + + /* vcache->dcache hint failed */ + /* + * Locks held: + * avc->lock(R) if setLocks && !slowPass + * avc->lock(W) if !setLocks || slowPass + * tdc->lock(S) + */ afs_Trace4(afs_iclSetp, CM_TRACE_GETDCACHE2, ICL_TYPE_POINTER, avc, - ICL_TYPE_POINTER, tdc, - ICL_TYPE_INT32, hgetlo(tdc->f.versionNo), - ICL_TYPE_INT32, hgetlo(avc->m.DataVersion)); + ICL_TYPE_POINTER, tdc, ICL_TYPE_INT32, + hgetlo(tdc->f.versionNo), ICL_TYPE_INT32, + hgetlo(avc->m.DataVersion)); /* - * Here we have the unlocked entry in tdc, with its refCount - * incremented. Note: we don't use the S-lock; it costs concurrency - * when storing a file back to the server. + * Here we have the entry in tdc, with its refCount incremented. + * Note: we don't use the S-lock on avc; it costs concurrency when + * storing a file back to the server. */ - if (setLocks) ObtainReadLock(&avc->lock); /* * Not a newly created file so we need to check the file's length and @@ -1680,79 +1826,111 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags) * read rpcs on newly created files (dv of 0) since only then we guarantee * that this chunk's data hasn't been filled by another client. */ - if (!hiszero(avc->m.DataVersion)) - aflags &= ~4; + size = AFS_CHUNKSIZE(abyte); + if (aflags & 4) /* called from write */ + tlen = *alen; + else /* called from read */ + tlen = tdc->validPos - abyte; + Position = AFS_CHUNKTOBASE(chunk); + afs_Trace4(afs_iclSetp, CM_TRACE_GETDCACHE3, ICL_TYPE_INT32, tlen, + ICL_TYPE_INT32, aflags, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(abyte), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(Position)); + if ((aflags & 4) && (hiszero(avc->m.DataVersion))) + doAdjustSize = 1; + if ((aflags & 4) && (abyte == Position) && (tlen >= size)) + overWriteWholeChunk = 1; + if (doAdjustSize || overWriteWholeChunk) { #if defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) #ifdef AFS_SGI_ENV #ifdef AFS_SGI64_ENV - if (aflags & 4) adjustsize = NBPP; -#else - if (aflags & 4) adjustsize = 8192; -#endif -#else - if (aflags & 4) adjustsize = 4096; -#endif - if (AFS_CHUNKTOBASE(chunk)+adjustsize >= avc->m.Length && -#else -#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) - if (((aflags & 4) || (AFS_CHUNKTOBASE(chunk) >= avc->m.Length)) && -#else - if (AFS_CHUNKTOBASE(chunk) >= avc->m.Length && -#endif -#endif - !hsame(avc->m.DataVersion, tdc->f.versionNo)) { - /* no data in file to read at this position */ - if (setLocks) { - ReleaseReadLock(&avc->lock); - ObtainWriteLock(&avc->lock,64); - } - /* check again, now that we have a write lock */ -#if defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) - if (AFS_CHUNKTOBASE(chunk)+adjustsize >= avc->m.Length && -#else + if (doAdjustSize) + adjustsize = NBPP; +#else /* AFS_SGI64_ENV */ + if (doAdjustSize) + adjustsize = 8192; +#endif /* AFS_SGI64_ENV */ +#else /* AFS_SGI_ENV */ + if (doAdjustSize) + adjustsize = 4096; +#endif /* AFS_SGI_ENV */ + if (AFS_CHUNKTOBASE(chunk) + adjustsize >= avc->m.Length && +#else /* defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) */ #if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) - if (((aflags & 4) || (AFS_CHUNKTOBASE(chunk) >= avc->m.Length)) && + if ((doAdjustSize || (AFS_CHUNKTOBASE(chunk) >= avc->m.Length)) && #else if (AFS_CHUNKTOBASE(chunk) >= avc->m.Length && #endif -#endif - !hsame(avc->m.DataVersion, tdc->f.versionNo)) { +#endif /* defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) */ + !hsame(avc->m.DataVersion, tdc->f.versionNo)) + doReallyAdjustSize = 1; + + if (doReallyAdjustSize || overWriteWholeChunk) { + /* no data in file to read at this position */ + UpgradeSToWLock(&tdc->lock, 607); + file = afs_CFileOpen(tdc->f.inode); afs_CFileTruncate(file, 0); afs_CFileClose(file); afs_AdjustSize(tdc, 0); hset(tdc->f.versionNo, avc->m.DataVersion); - tdc->flags |= DFEntryMod; - } - if (setLocks) { - ReleaseWriteLock(&avc->lock); - ObtainReadLock(&avc->lock); + tdc->dflags |= DFEntryMod; + + ConvertWToSLock(&tdc->lock); } } - if (setLocks) ReleaseReadLock(&avc->lock); /* - * We must read in the whole chunk iff the version number doesn't + * We must read in the whole chunk if the version number doesn't * match. */ if (aflags & 2) { /* don't need data, just a unique dcache entry */ + ObtainWriteLock(&afs_xdcache, 608); hset(afs_indexTimes[tdc->index], afs_indexCounter); hadd32(afs_indexCounter, 1); - updateV2DC(setLocks,avc,tdc,567); - return tdc; /* check if we're done */ + ReleaseWriteLock(&afs_xdcache); + + updateV2DC(setLocks, avc, tdc, 553); + if (vType(avc) == VDIR) + *aoffset = abyte; + else + *aoffset = AFS_CHUNKOFFSET(abyte); + if (tdc->validPos < abyte) + *alen = (afs_size_t) 0; + else + *alen = tdc->validPos - abyte; + ReleaseSharedLock(&tdc->lock); + if (setLocks) { + if (slowPass) + ReleaseWriteLock(&avc->lock); + else + ReleaseReadLock(&avc->lock); + } + return tdc; /* check if we're done */ } - osi_Assert(setLocks || WriteLocked(&avc->lock)); - if (setLocks) ObtainReadLock(&avc->lock); - if (!hsame(avc->m.DataVersion, tdc->f.versionNo)) { + /* + * Locks held: + * avc->lock(R) if setLocks && !slowPass + * avc->lock(W) if !setLocks || slowPass + * tdc->lock(S) + */ + osi_Assert((setLocks && !slowPass) || WriteLocked(&avc->lock)); + + setNewCallback = setVcacheStatus = 0; + + /* + * Locks held: + * avc->lock(R) if setLocks && !slowPass + * avc->lock(W) if !setLocks || slowPass + * tdc->lock(S) + */ + if (!hsame(avc->m.DataVersion, tdc->f.versionNo) && !overWriteWholeChunk) { /* * Version number mismatch. */ - if (setLocks) { - ReleaseReadLock(&avc->lock); - ObtainWriteLock(&avc->lock,65); - } + UpgradeSToWLock(&tdc->lock, 609); /* * If data ever existed for this vnode, and this is a text object, @@ -1772,45 +1950,67 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags) /* * By here, the cache entry is always write-locked. We can * deadlock if we call osi_Flush with the cache entry locked... + * Unlock the dcache too. */ - ReleaseWriteLock(&avc->lock); + ReleaseWriteLock(&tdc->lock); + if (setLocks && !slowPass) + ReleaseReadLock(&avc->lock); + else + ReleaseWriteLock(&avc->lock); + osi_FlushText(avc); /* * Call osi_FlushPages in open, read/write, and map, since it * is too hard here to figure out if we should lock the * pvnLock. */ - ObtainWriteLock(&avc->lock,66); + if (setLocks && !slowPass) + ObtainReadLock(&avc->lock); + else + ObtainWriteLock(&avc->lock, 66); + ObtainWriteLock(&tdc->lock, 610); } - /* Watch for standard race condition */ + /* + * Locks held: + * avc->lock(R) if setLocks && !slowPass + * avc->lock(W) if !setLocks || slowPass + * tdc->lock(W) + */ + + /* Watch for standard race condition around osi_FlushText */ if (hsame(avc->m.DataVersion, tdc->f.versionNo)) { - updateV2DC(0,avc,tdc,569); /* set hint */ - if (setLocks) ReleaseWriteLock(&avc->lock); + updateV2DC(setLocks, avc, tdc, 569); /* set hint */ afs_stats_cmperf.dcacheHits++; + ConvertWToSLock(&tdc->lock); goto done; } /* Sleep here when cache needs to be drained. */ - if (setLocks && - (afs_blocksUsed > (CM_WAITFORDRAINPCT*afs_cacheBlocks)/100)) { + if (setLocks && !slowPass + && (afs_blocksUsed > + (CM_WAITFORDRAINPCT * afs_cacheBlocks) / 100)) { /* Make sure truncate daemon is running */ afs_MaybeWakeupTruncateDaemon(); - tdc->refCount--; /* we'll re-obtain the dcache when we re-try. */ - ReleaseWriteLock(&avc->lock); - while ((afs_blocksUsed-afs_blocksDiscarded) > - (CM_WAITFORDRAINPCT*afs_cacheBlocks)/100) { + ObtainWriteLock(&tdc->tlock, 614); + tdc->refCount--; /* we'll re-obtain the dcache when we re-try. */ + ReleaseWriteLock(&tdc->tlock); + ReleaseWriteLock(&tdc->lock); + ReleaseReadLock(&avc->lock); + while ((afs_blocksUsed - afs_blocksDiscarded) > + (CM_WAITFORDRAINPCT * afs_cacheBlocks) / 100) { afs_WaitForCacheDrain = 1; afs_osi_Sleep(&afs_WaitForCacheDrain); } afs_MaybeFreeDiscardedDCache(); /* need to check if someone else got the chunk first. */ goto RetryGetDCache; - } + } /* Do not fetch data beyond truncPos. */ maxGoodLength = avc->m.Length; - if (avc->truncPos < maxGoodLength) maxGoodLength = avc->truncPos; + if (avc->truncPos < maxGoodLength) + maxGoodLength = avc->truncPos; Position = AFS_CHUNKBASE(abyte); if (vType(avc) == VDIR) { size = avc->m.Length; @@ -1818,51 +2018,56 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags) /* pre-reserve space for file */ afs_AdjustSize(tdc, size); } - size = 999999999; /* max size for transfer */ - } - else { + size = 999999999; /* max size for transfer */ + } else { size = AFS_CHUNKSIZE(abyte); /* expected max size */ /* don't read past end of good data on server */ if (Position + size > maxGoodLength) size = maxGoodLength - Position; - if (size < 0) size = 0; /* Handle random races */ + if (size < 0) + size = 0; /* Handle random races */ if (size > tdc->f.chunkBytes) { /* pre-reserve space for file */ afs_AdjustSize(tdc, size); /* changes chunkBytes */ /* max size for transfer still in size */ } } - if (afs_mariner && !tdc->f.chunk) - afs_MarinerLog("fetch$Fetching", avc); /* , Position, size, afs_indexCounter );*/ + if (afs_mariner && !tdc->f.chunk) + afs_MarinerLog("fetch$Fetching", avc); /* , Position, size, afs_indexCounter ); */ /* * Right now, we only have one tool, and it's a hammer. So, we * fetch the whole file. */ DZap(&tdc->f.inode); /* pages in cache may be old */ #ifdef IHINT - if (file = tdc->ihint) { - if (tdc->f.inode == file->inum ) - usedihint++; - else { - tdc->ihint = 0; - afs_UFSClose(file); - file = 0; - nihints--; - file = osi_UFSOpen(tdc->f.inode); - } - } - else + if (file = tdc->ihint) { + if (tdc->f.inode == file->inum) + usedihint++; + else { + tdc->ihint = 0; + afs_UFSClose(file); + file = 0; + nihints--; + file = osi_UFSOpen(tdc->f.inode); + } + } else #endif /* IHINT */ - file = afs_CFileOpen(tdc->f.inode); + file = afs_CFileOpen(tdc->f.inode); afs_RemoveVCB(&avc->fid); tdc->f.states |= DWriting; - tdc->flags |= DFFetching; - tdc->validPos = Position; /*Last valid position in this chunk*/ - if (tdc->flags & DFFetchReq) { - tdc->flags &= ~DFFetchReq; - afs_osi_Wakeup(&tdc->validPos); + tdc->dflags |= DFFetching; + tdc->validPos = Position; /* which is AFS_CHUNKBASE(abyte) */ + if (tdc->mflags & DFFetchReq) { + tdc->mflags &= ~DFFetchReq; + if (afs_osi_Wakeup(&tdc->validPos) == 0) + afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAKE, ICL_TYPE_STRING, + __FILE__, ICL_TYPE_INT32, __LINE__, + ICL_TYPE_POINTER, tdc, ICL_TYPE_INT32, + tdc->dflags); } - tsmall = (struct tlocal1 *) osi_AllocLargeSpace(sizeof(struct tlocal1)); + tsmall = + (struct tlocal1 *)osi_AllocLargeSpace(sizeof(struct tlocal1)); + setVcacheStatus = 0; #ifndef AFS_NOSTATS /* * Remember if we are doing the reading from a replicated volume, @@ -1877,10 +2082,13 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags) (accP->unreplicatedRefs)++; #endif /* AFS_NOSTATS */ /* this is a cache miss */ - afs_stats_cmperf.dcacheMisses++; - afs_Trace3(afs_iclSetp, CM_TRACE_FETCHPROC, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, Position, ICL_TYPE_INT32, size); + afs_Trace4(afs_iclSetp, CM_TRACE_FETCHPROC, ICL_TYPE_POINTER, avc, + ICL_TYPE_FID, &(avc->fid), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(Position), ICL_TYPE_INT32, size); + if (size) + afs_stats_cmperf.dcacheMisses++; + code = 0; /* * Dynamic root support: fetch data from local memory. */ @@ -1894,7 +2102,8 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags) dynrootLen -= Position; if (size > dynrootLen) size = dynrootLen; - if (size < 0) size = 0; + if (size < 0) + size = 0; code = afs_CFileWrite(file, 0, dynrootDir, size); afs_PutDynroot(); @@ -1904,155 +2113,276 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags) code = -1; tdc->validPos = Position + size; - afs_CFileTruncate(file, size); /* prune it */ + afs_CFileTruncate(file, size); /* prune it */ } else - /* - * Not a dynamic vnode: do the real fetch. - */ - do { - tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); - if (tc) { + /* + * Not a dynamic vnode: do the real fetch. + */ + do { + /* + * Locks held: + * avc->lock(R) if setLocks && !slowPass + * avc->lock(W) if !setLocks || slowPass + * tdc->lock(W) + */ + + tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); + if (tc) { + afs_int32 length_hi, length, bytes; #ifndef AFS_NOSTATS - numFetchLoops++; - if (fromReplica) - (accP->numReplicasAccessed)++; - + numFetchLoops++; + if (fromReplica) + (accP->numReplicasAccessed)++; + #endif /* AFS_NOSTATS */ - avc->callback = tc->srvr->server; - ConvertWToSLock(&avc->lock); - i = osi_Time(); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - tcall = rx_NewCall(tc->id); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - - - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHDATA); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = StartRXAFS_FetchData(tcall, - (struct AFSFid *) &avc->fid.Fid, - Position, size); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - if (code == 0) { + if (!setLocks || slowPass) { + avc->callback = tc->srvr->server; + } else { + newCallback = tc->srvr->server; + setNewCallback = 1; + } + i = osi_Time(); + RX_AFS_GUNLOCK(); + tcall = rx_NewCall(tc->id); + RX_AFS_GLOCK(); + + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHDATA); +#ifdef AFS_64BIT_CLIENT + length_hi = code = 0; + if (!afs_serverHasNo64Bit(tc)) { + tsize = size; + RX_AFS_GUNLOCK(); + code = + StartRXAFS_FetchData64(tcall, + (struct AFSFid *)&avc->fid. + Fid, Position, tsize); + if (code != 0) { + RX_AFS_GLOCK(); + afs_Trace2(afs_iclSetp, CM_TRACE_FETCH64CODE, + ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, + code); + } else { + bytes = + rx_Read(tcall, (char *)&length_hi, + sizeof(afs_int32)); + RX_AFS_GLOCK(); + if (bytes == sizeof(afs_int32)) { + length_hi = ntohl(length_hi); + } else { + length_hi = 0; + code = rx_Error(tcall); + RX_AFS_GUNLOCK(); + code1 = rx_EndCall(tcall, code); + RX_AFS_GLOCK(); + tcall = (struct rx_call *)0; + } + } + } + if (code == RXGEN_OPCODE || afs_serverHasNo64Bit(tc)) { + if (Position > 0x7FFFFFFF) { + code = EFBIG; + } else { + afs_int32 pos; + pos = Position; + RX_AFS_GUNLOCK(); + if (!tcall) + tcall = rx_NewCall(tc->id); + code = + StartRXAFS_FetchData(tcall, (struct AFSFid *) + &avc->fid.Fid, pos, + size); + RX_AFS_GLOCK(); + } + afs_serverSetNo64Bit(tc); + } + if (code == 0) { + RX_AFS_GUNLOCK(); + bytes = + rx_Read(tcall, (char *)&length, + sizeof(afs_int32)); + RX_AFS_GLOCK(); + if (bytes == sizeof(afs_int32)) { + length = ntohl(length); + } else { + code = rx_Error(tcall); + } + } + FillInt64(lengthFound, length_hi, length); + afs_Trace3(afs_iclSetp, CM_TRACE_FETCH64LENG, + ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, code, + ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(lengthFound)); +#else /* AFS_64BIT_CLIENT */ + RX_AFS_GUNLOCK(); + code = + StartRXAFS_FetchData(tcall, + (struct AFSFid *)&avc->fid.Fid, + Position, size); + RX_AFS_GLOCK(); + if (code == 0) { + RX_AFS_GUNLOCK(); + bytes = + rx_Read(tcall, (char *)&length, + sizeof(afs_int32)); + RX_AFS_GLOCK(); + if (bytes == sizeof(afs_int32)) { + length = ntohl(length); + } else { + code = rx_Error(tcall); + } + } +#endif /* AFS_64BIT_CLIENT */ + if (code == 0) { #ifndef AFS_NOSTATS - xferP = &(afs_stats_cmfullperf.rpc.fsXferTimes[AFS_STATS_FS_XFERIDX_FETCHDATA]); - osi_GetuTime(&xferStartTime); - - code = afs_CacheFetchProc(tcall, file, Position, tdc, avc, - &bytesToXfer, &bytesXferred); - - osi_GetuTime(&xferStopTime); - (xferP->numXfers)++; - if (!code) { - (xferP->numSuccesses)++; - afs_stats_XferSumBytes[AFS_STATS_FS_XFERIDX_FETCHDATA] += bytesXferred; - (xferP->sumBytes) += (afs_stats_XferSumBytes[AFS_STATS_FS_XFERIDX_FETCHDATA] >> 10); - afs_stats_XferSumBytes[AFS_STATS_FS_XFERIDX_FETCHDATA] &= 0x3FF; - if (bytesXferred < xferP->minBytes) - xferP->minBytes = bytesXferred; - if (bytesXferred > xferP->maxBytes) - xferP->maxBytes = bytesXferred; - - /* - * Tally the size of the object. Note: we tally the actual size, - * NOT the number of bytes that made it out over the wire. - */ - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET0) - (xferP->count[0])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET1) - (xferP->count[1])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET2) - (xferP->count[2])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET3) - (xferP->count[3])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET4) - (xferP->count[4])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET5) - (xferP->count[5])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET6) - (xferP->count[6])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET7) - (xferP->count[7])++; - else - (xferP->count[8])++; - - afs_stats_GetDiff(elapsedTime, xferStartTime, xferStopTime); - afs_stats_AddTo((xferP->sumTime), elapsedTime); - afs_stats_SquareAddTo((xferP->sqrTime), elapsedTime); - if (afs_stats_TimeLessThan(elapsedTime, (xferP->minTime))) { - afs_stats_TimeAssign((xferP->minTime), elapsedTime); - } - if (afs_stats_TimeGreaterThan(elapsedTime, (xferP->maxTime))) { - afs_stats_TimeAssign((xferP->maxTime), elapsedTime); - } - } + xferP = + &(afs_stats_cmfullperf.rpc. + fsXferTimes[AFS_STATS_FS_XFERIDX_FETCHDATA]); + osi_GetuTime(&xferStartTime); + + code = + afs_CacheFetchProc(tcall, file, + (afs_size_t) Position, tdc, + avc, &bytesToXfer, + &bytesXferred, length); + + osi_GetuTime(&xferStopTime); + (xferP->numXfers)++; + if (!code) { + (xferP->numSuccesses)++; + afs_stats_XferSumBytes + [AFS_STATS_FS_XFERIDX_FETCHDATA] += + bytesXferred; + (xferP->sumBytes) += + (afs_stats_XferSumBytes + [AFS_STATS_FS_XFERIDX_FETCHDATA] >> 10); + afs_stats_XferSumBytes + [AFS_STATS_FS_XFERIDX_FETCHDATA] &= 0x3FF; + if (bytesXferred < xferP->minBytes) + xferP->minBytes = bytesXferred; + if (bytesXferred > xferP->maxBytes) + xferP->maxBytes = bytesXferred; + + /* + * Tally the size of the object. Note: we tally the actual size, + * NOT the number of bytes that made it out over the wire. + */ + if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET0) + (xferP->count[0])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET1) + (xferP->count[1])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET2) + (xferP->count[2])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET3) + (xferP->count[3])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET4) + (xferP->count[4])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET5) + (xferP->count[5])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET6) + (xferP->count[6])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET7) + (xferP->count[7])++; + else + (xferP->count[8])++; + + afs_stats_GetDiff(elapsedTime, xferStartTime, + xferStopTime); + afs_stats_AddTo((xferP->sumTime), elapsedTime); + afs_stats_SquareAddTo((xferP->sqrTime), + elapsedTime); + if (afs_stats_TimeLessThan + (elapsedTime, (xferP->minTime))) { + afs_stats_TimeAssign((xferP->minTime), + elapsedTime); + } + if (afs_stats_TimeGreaterThan + (elapsedTime, (xferP->maxTime))) { + afs_stats_TimeAssign((xferP->maxTime), + elapsedTime); + } + } #else - code = afs_CacheFetchProc(tcall, file, Position, tdc, avc, 0, 0); + code = + afs_CacheFetchProc(tcall, file, Position, tdc, + avc, 0, 0, length); #endif /* AFS_NOSTATS */ + } + if (code == 0) { + RX_AFS_GUNLOCK(); + code = + EndRXAFS_FetchData(tcall, &tsmall->OutStatus, + &tsmall->CallBack, + &tsmall->tsync); + RX_AFS_GLOCK(); + } + XSTATS_END_TIME; + RX_AFS_GUNLOCK(); + if (tcall) + code1 = rx_EndCall(tcall, code); + RX_AFS_GLOCK(); + } else { + code = -1; } + if (!code && code1) + code = code1; + if (code == 0) { -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = EndRXAFS_FetchData(tcall, - &tsmall->OutStatus, - &tsmall->CallBack, - &tsmall->tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + /* callback could have been broken (or expired) in a race here, + * but we return the data anyway. It's as good as we knew about + * when we started. */ + /* + * validPos is updated by CacheFetchProc, and can only be + * modifed under a dcache write lock, which we've blocked out + */ + size = tdc->validPos - Position; /* actual segment size */ + if (size < 0) + size = 0; + afs_CFileTruncate(file, size); /* prune it */ + } else { + if (!setLocks || slowPass) { + ObtainWriteLock(&afs_xcbhash, 453); + afs_DequeueCallback(avc); + avc->states &= ~(CStatd | CUnique); + avc->callback = NULL; + ReleaseWriteLock(&afs_xcbhash); + if (avc->fid.Fid.Vnode & 1 || (vType(avc) == VDIR)) + osi_dnlc_purgedp(avc); + } else { + /* Something lost. Forget about performance, and go + * back with a vcache write lock. + */ + afs_CFileTruncate(file, 0); + afs_AdjustSize(tdc, 0); + afs_CFileClose(file); + osi_FreeLargeSpace(tsmall); + tsmall = 0; + ReleaseWriteLock(&tdc->lock); + afs_PutDCache(tdc); + tdc = 0; + ReleaseReadLock(&avc->lock); + slowPass = 1; + goto RetryGetDCache; + } } - XSTATS_END_TIME; - code1 = rx_EndCall(tcall, code); - UpgradeSToWLock(&avc->lock,27); - } - else { - code = -1; - } - if ( !code && code1 ) - code = code1; - - if (code == 0) { - /* callback could have been broken (or expired) in a race here, - * but we return the data anyway. It's as good as we knew about - * when we started. */ - /* - * validPos is updated by CacheFetchProc, and can only be - * modifed under an S or W lock, which we've blocked out - */ - size = tdc->validPos - Position; /* actual segment size */ - if (size < 0) size = 0; - afs_CFileTruncate(file, size); /* prune it */ - } - else { - ObtainWriteLock(&afs_xcbhash, 453); - afs_DequeueCallback(avc); - avc->states &= ~(CStatd | CUnique); - avc->callback = (struct server *)0; - ReleaseWriteLock(&afs_xcbhash); - if (avc->fid.Fid.Vnode & 1 || (vType(avc) == VDIR)) - osi_dnlc_purgedp(avc); - } - - } while - (afs_Analyze(tc, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_FETCHDATA, - SHARED_LOCK, (struct cell *)0)); + + } while (afs_Analyze + (tc, code, &avc->fid, areq, + AFS_STATS_FS_RPCIDX_FETCHDATA, SHARED_LOCK, NULL)); + + /* + * Locks held: + * avc->lock(R) if setLocks && !slowPass + * avc->lock(W) if !setLocks || slowPass + * tdc->lock(W) + */ #ifndef AFS_NOSTATS /* @@ -2067,14 +2397,18 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags) } #endif /* AFS_NOSTATS */ - tdc->flags &= ~DFFetching; - if (tdc->flags & DFWaiting) { - tdc->flags &= ~DFWaiting; - afs_osi_Wakeup(&tdc->validPos); - } - if (avc->execsOrWriters == 0) tdc->f.states &= ~DWriting; - - /* now, if code != 0, we have an error and should punt */ + tdc->dflags &= ~DFFetching; + if (afs_osi_Wakeup(&tdc->validPos) == 0) + afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAKE, ICL_TYPE_STRING, + __FILE__, ICL_TYPE_INT32, __LINE__, ICL_TYPE_POINTER, + tdc, ICL_TYPE_INT32, tdc->dflags); + if (avc->execsOrWriters == 0) + tdc->f.states &= ~DWriting; + + /* now, if code != 0, we have an error and should punt. + * note that we have the vcache write lock, either because + * !setLocks or slowPass. + */ if (code) { afs_CFileTruncate(file, 0); afs_AdjustSize(tdc, 0); @@ -2083,48 +2417,57 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags) if (vType(avc) == VDIR) { DZap(&tdc->f.inode); } -#ifdef AFS_SUN5_ENVX + ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); -#else - tdc->refCount--; -#endif ObtainWriteLock(&afs_xcbhash, 454); afs_DequeueCallback(avc); - avc->states &= ~( CStatd | CUnique ); + avc->states &= ~(CStatd | CUnique); ReleaseWriteLock(&afs_xcbhash); if (avc->fid.Fid.Vnode & 1 || (vType(avc) == VDIR)) osi_dnlc_purgedp(avc); - if (setLocks) ReleaseWriteLock(&avc->lock); - osi_FreeLargeSpace(tsmall); - tdc = (struct dcache *) 0; - goto done; + /* + * Locks held: + * avc->lock(W); assert(!setLocks || slowPass) + */ + osi_Assert(!setLocks || slowPass); + tdc = NULL; + goto done; } /* otherwise we copy in the just-fetched info */ afs_CFileClose(file); - afs_AdjustSize(tdc, size); /* new size */ + afs_AdjustSize(tdc, size); /* new size */ /* - * Copy appropriate fields into vcache + * Copy appropriate fields into vcache. Status is + * copied later where we selectively acquire the + * vcache write lock. */ - afs_ProcessFS(avc, &tsmall->OutStatus, areq); - hset64(tdc->f.versionNo, tsmall->OutStatus.dataVersionHigh, tsmall->OutStatus.DataVersion); - tdc->flags |= DFEntryMod; + if (slowPass) + afs_ProcessFS(avc, &tsmall->OutStatus, areq); + else + setVcacheStatus = 1; + hset64(tdc->f.versionNo, tsmall->OutStatus.dataVersionHigh, + tsmall->OutStatus.DataVersion); + tdc->dflags |= DFEntryMod; afs_indexFlags[tdc->index] |= IFEverUsed; - if (setLocks) ReleaseWriteLock(&avc->lock); - osi_FreeLargeSpace(tsmall); - } /*Data version numbers don't match*/ + ConvertWToSLock(&tdc->lock); + } /*Data version numbers don't match */ else { /* - * Data version numbers match. Release locks if we locked - * them, and remember we've had a cache hit. + * Data version numbers match. */ - if (setLocks) - ReleaseReadLock(&avc->lock); afs_stats_cmperf.dcacheHits++; - } /*Data version numbers match*/ + } /*Data version numbers match */ + + updateV2DC(setLocks, avc, tdc, 335); /* set hint */ + done: + /* + * Locks held: + * avc->lock(R) if setLocks && !slowPass + * avc->lock(W) if !setLocks || slowPass + * tdc->lock(S) if tdc + */ - updateV2DC(setLocks,avc,tdc,332); /* set hint */ -done: /* * See if this was a reference to a file in the local cell. */ @@ -2136,20 +2479,89 @@ done: /* Fix up LRU info */ if (tdc) { - hset(afs_indexTimes[tdc->index], afs_indexCounter); - hadd32(afs_indexCounter, 1); + MObtainWriteLock(&afs_xdcache, 602); + hset(afs_indexTimes[tdc->index], afs_indexCounter); + hadd32(afs_indexCounter, 1); + MReleaseWriteLock(&afs_xdcache); - /* return the data */ - if (vType(avc) == VDIR) + /* return the data */ + if (vType(avc) == VDIR) *aoffset = abyte; - else + else *aoffset = AFS_CHUNKOFFSET(abyte); - *alen = (tdc->f.chunkBytes - *aoffset); + *alen = (tdc->f.chunkBytes - *aoffset); + ReleaseSharedLock(&tdc->lock); } - return tdc; + /* + * Locks held: + * avc->lock(R) if setLocks && !slowPass + * avc->lock(W) if !setLocks || slowPass + */ -} /*afs_GetDCache*/ + /* Fix up the callback and status values in the vcache */ + doVcacheUpdate = 0; + if (setLocks && !slowPass) { + /* DCLOCKXXX + * + * This is our dirty little secret to parallel fetches. + * We don't write-lock the vcache while doing the fetch, + * but potentially we'll need to update the vcache after + * the fetch is done. + * + * Drop the read lock and try to re-obtain the write + * lock. If the vcache still has the same DV, it's + * ok to go ahead and install the new data. + */ + afs_hyper_t currentDV, statusDV; + + hset(currentDV, avc->m.DataVersion); + + if (setNewCallback && avc->callback != newCallback) + doVcacheUpdate = 1; + + if (tsmall) { + hset64(statusDV, tsmall->OutStatus.dataVersionHigh, + tsmall->OutStatus.DataVersion); + + if (setVcacheStatus && avc->m.Length != tsmall->OutStatus.Length) + doVcacheUpdate = 1; + if (setVcacheStatus && !hsame(currentDV, statusDV)) + doVcacheUpdate = 1; + } + + ReleaseReadLock(&avc->lock); + + if (doVcacheUpdate) { + ObtainWriteLock(&avc->lock, 615); + if (!hsame(avc->m.DataVersion, currentDV)) { + /* We lose. Someone will beat us to it. */ + doVcacheUpdate = 0; + ReleaseWriteLock(&avc->lock); + } + } + } + + /* With slow pass, we've already done all the updates */ + if (slowPass) { + ReleaseWriteLock(&avc->lock); + } + + /* Check if we need to perform any last-minute fixes with a write-lock */ + if (!setLocks || doVcacheUpdate) { + if (setNewCallback) + avc->callback = newCallback; + if (tsmall && setVcacheStatus) + afs_ProcessFS(avc, &tsmall->OutStatus, areq); + if (setLocks) + ReleaseWriteLock(&avc->lock); + } + + if (tsmall) + osi_FreeLargeSpace(tsmall); + + return tdc; +} /*afs_GetDCache */ /* @@ -2166,26 +2578,72 @@ done: * The afs_xdcache is write-locked through this whole affair. */ void -afs_WriteThroughDSlots() - -{ /*afs_WriteThroughDSlots*/ - +afs_WriteThroughDSlots(void) +{ register struct dcache *tdc; - register afs_int32 i, touchedit=0; + register afs_int32 i, touchedit = 0; + + struct afs_q DirtyQ, *tq; AFS_STATCNT(afs_WriteThroughDSlots); - MObtainWriteLock(&afs_xdcache,283); - for(i = 0; i < afs_cacheFiles; i++) { + + /* + * Because of lock ordering, we can't grab dcache locks while + * holding afs_xdcache. So we enter xdcache, get a reference + * for every dcache entry, and exit xdcache. + */ + MObtainWriteLock(&afs_xdcache, 283); + QInit(&DirtyQ); + for (i = 0; i < afs_cacheFiles; i++) { tdc = afs_indexTable[i]; - if (tdc && (tdc->flags & DFEntryMod)) { - tdc->flags &= ~DFEntryMod; - afs_WriteDCache(tdc, 1); - touchedit = 1; + + /* Grab tlock in case the existing refcount isn't zero */ + if (tdc && !(afs_indexFlags[i] & (IFFree | IFDiscarded))) { + ObtainWriteLock(&tdc->tlock, 623); + tdc->refCount++; + ReleaseWriteLock(&tdc->tlock); + + QAdd(&DirtyQ, &tdc->dirty); } } + MReleaseWriteLock(&afs_xdcache); + + /* + * Now, for each dcache entry we found, check if it's dirty. + * If so, get write-lock, get afs_xdcache, which protects + * afs_cacheInodep, and flush it. Don't forget to put back + * the refcounts. + */ + +#define DQTODC(q) ((struct dcache *)(((char *) (q)) - sizeof(struct afs_q))) + + for (tq = DirtyQ.prev; tq != &DirtyQ; tq = QPrev(tq)) { + tdc = DQTODC(tq); + if (tdc->dflags & DFEntryMod) { + int wrLock; + + wrLock = (0 == NBObtainWriteLock(&tdc->lock, 619)); + + /* Now that we have the write lock, double-check */ + if (wrLock && (tdc->dflags & DFEntryMod)) { + tdc->dflags &= ~DFEntryMod; + MObtainWriteLock(&afs_xdcache, 620); + afs_WriteDCache(tdc, 1); + MReleaseWriteLock(&afs_xdcache); + touchedit = 1; + } + if (wrLock) + ReleaseWriteLock(&tdc->lock); + } + + afs_PutDCache(tdc); + } + + MObtainWriteLock(&afs_xdcache, 617); if (!touchedit && (cacheDiskType != AFS_FCACHE_TYPE_MEM)) { - /* Touch the file to make sure that the mtime on the file is kept up-to-date - * to avoid losing cached files on cold starts because their mtime seems old... + /* Touch the file to make sure that the mtime on the file is kept + * up-to-date to avoid losing cached files on cold starts because + * their mtime seems old... */ struct afs_fheader theader; @@ -2196,82 +2654,96 @@ afs_WriteThroughDSlots() afs_osi_Write(afs_cacheInodep, 0, &theader, sizeof(theader)); } MReleaseWriteLock(&afs_xdcache); - -} /*afs_WriteThroughDSlots*/ +} /* * afs_MemGetDSlot * * Description: * Return a pointer to an freshly initialized dcache entry using - * a memory-based cache. + * a memory-based cache. The tlock will be read-locked. * * Parameters: * aslot : Dcache slot to look at. * tmpdc : Ptr to dcache entry. * * Environment: - * Nothing interesting. + * Must be called with afs_xdcache write-locked. */ -struct dcache *afs_MemGetDSlot(aslot, tmpdc) - register afs_int32 aslot; - register struct dcache *tmpdc; - -{ /*afs_MemGetDSlot*/ - - register afs_int32 code; +struct dcache * +afs_MemGetDSlot(register afs_int32 aslot, register struct dcache *tmpdc) +{ register struct dcache *tdc; - register char *tfile; + int existing = 0; AFS_STATCNT(afs_MemGetDSlot); - if (CheckLock(&afs_xdcache) != -1) osi_Panic("getdslot nolock"); - if (aslot < 0 || aslot >= afs_cacheFiles) osi_Panic("getdslot slot"); + if (CheckLock(&afs_xdcache) != -1) + osi_Panic("getdslot nolock"); + if (aslot < 0 || aslot >= afs_cacheFiles) + osi_Panic("getdslot slot"); tdc = afs_indexTable[aslot]; if (tdc) { - QRemove(&tdc->lruq); /* move to queue head */ + QRemove(&tdc->lruq); /* move to queue head */ QAdd(&afs_DLRU, &tdc->lruq); + /* We're holding afs_xdcache, but get tlock in case refCount != 0 */ + ObtainWriteLock(&tdc->tlock, 624); tdc->refCount++; + ConvertWToRLock(&tdc->tlock); return tdc; } - if (tmpdc == (struct dcache *)0) { - if (!afs_freeDSList) afs_GetDownDSlot(4); + if (tmpdc == NULL) { + if (!afs_freeDSList) + afs_GetDownDSlot(4); if (!afs_freeDSList) { /* none free, making one is better than a panic */ afs_stats_cmperf.dcacheXAllocs++; /* count in case we have a leak */ - tdc = (struct dcache *) afs_osi_Alloc(sizeof (struct dcache)); -#ifdef AFS_AIX32_ENV + tdc = (struct dcache *)afs_osi_Alloc(sizeof(struct dcache)); +#ifdef KERNEL_HAVE_PIN pin((char *)tdc, sizeof(struct dcache)); /* XXX */ #endif } else { tdc = afs_freeDSList; - afs_freeDSList = (struct dcache *) tdc->lruq.next; + afs_freeDSList = (struct dcache *)tdc->lruq.next; + existing = 1; } - tdc->flags = 0; /* up-to-date, not in free q */ + tdc->dflags = 0; /* up-to-date, not in free q */ + tdc->mflags = 0; QAdd(&afs_DLRU, &tdc->lruq); - if (tdc->lruq.prev == &tdc->lruq) osi_Panic("lruq 3"); - } - else { + if (tdc->lruq.prev == &tdc->lruq) + osi_Panic("lruq 3"); + } else { tdc = tmpdc; tdc->f.states = 0; } - + /* initialize entry */ tdc->f.fid.Cell = 0; tdc->f.fid.Fid.Volume = 0; tdc->f.chunk = -1; hones(tdc->f.versionNo); tdc->f.inode = aslot; - tdc->flags |= DFEntryMod; + tdc->dflags |= DFEntryMod; tdc->refCount = 1; tdc->index = aslot; afs_indexUnique[aslot] = tdc->f.fid.Fid.Unique; - - if (tmpdc == (struct dcache *)0) + + if (existing) { + osi_Assert(0 == NBObtainWriteLock(&tdc->lock, 674)); + osi_Assert(0 == NBObtainWriteLock(&tdc->mflock, 675)); + osi_Assert(0 == NBObtainWriteLock(&tdc->tlock, 676)); + } + + RWLOCK_INIT(&tdc->lock, "dcache lock"); + RWLOCK_INIT(&tdc->tlock, "dcache tlock"); + RWLOCK_INIT(&tdc->mflock, "dcache flock"); + ObtainReadLock(&tdc->tlock); + + if (tmpdc == NULL) afs_indexTable[aslot] = tdc; return tdc; -} /*afs_MemGetDSlot*/ +} /*afs_MemGetDSlot */ unsigned int last_error = 0, lasterrtime = 0; @@ -2280,7 +2752,7 @@ unsigned int last_error = 0, lasterrtime = 0; * * Description: * Return a pointer to an freshly initialized dcache entry using - * a UFS-based disk cache. + * a UFS-based disk cache. The dcache tlock will be read-locked. * * Parameters: * aslot : Dcache slot to look at. @@ -2289,27 +2761,27 @@ unsigned int last_error = 0, lasterrtime = 0; * Environment: * afs_xdcache lock write-locked. */ -struct dcache *afs_UFSGetDSlot(aslot, tmpdc) - register afs_int32 aslot; - register struct dcache *tmpdc; - -{ /*afs_UFSGetDSlot*/ - +struct dcache * +afs_UFSGetDSlot(register afs_int32 aslot, register struct dcache *tmpdc) +{ register afs_int32 code; register struct dcache *tdc; + int existing = 0; int entryok; AFS_STATCNT(afs_UFSGetDSlot); - if (CheckLock(&afs_xdcache) != -1) osi_Panic("getdslot nolock"); - if (aslot < 0 || aslot >= afs_cacheFiles) osi_Panic("getdslot slot"); + if (CheckLock(&afs_xdcache) != -1) + osi_Panic("getdslot nolock"); + if (aslot < 0 || aslot >= afs_cacheFiles) + osi_Panic("getdslot slot"); tdc = afs_indexTable[aslot]; if (tdc) { -#ifdef AFS_SUN5_ENVX - mutex_enter(&tdc->lock); -#endif - QRemove(&tdc->lruq); /* move to queue head */ + QRemove(&tdc->lruq); /* move to queue head */ QAdd(&afs_DLRU, &tdc->lruq); + /* Grab tlock in case refCount != 0 */ + ObtainWriteLock(&tdc->tlock, 625); tdc->refCount++; + ConvertWToRLock(&tdc->tlock); return tdc; } /* otherwise we should read it in from the cache file */ @@ -2317,38 +2789,40 @@ struct dcache *afs_UFSGetDSlot(aslot, tmpdc) * If we weren't passed an in-memory region to place the file info, * we have to allocate one. */ - if (tmpdc == (struct dcache *)0) { - if (!afs_freeDSList) afs_GetDownDSlot(4); + if (tmpdc == NULL) { + if (!afs_freeDSList) + afs_GetDownDSlot(4); if (!afs_freeDSList) { /* none free, making one is better than a panic */ afs_stats_cmperf.dcacheXAllocs++; /* count in case we have a leak */ - tdc = (struct dcache *) afs_osi_Alloc(sizeof (struct dcache)); -#ifdef AFS_AIX32_ENV + tdc = (struct dcache *)afs_osi_Alloc(sizeof(struct dcache)); +#ifdef KERNEL_HAVE_PIN pin((char *)tdc, sizeof(struct dcache)); /* XXX */ #endif } else { tdc = afs_freeDSList; - afs_freeDSList = (struct dcache *) tdc->lruq.next; + afs_freeDSList = (struct dcache *)tdc->lruq.next; + existing = 1; } - tdc->flags = 0; /* up-to-date, not in free q */ + tdc->dflags = 0; /* up-to-date, not in free q */ + tdc->mflags = 0; QAdd(&afs_DLRU, &tdc->lruq); - if (tdc->lruq.prev == &tdc->lruq) osi_Panic("lruq 3"); - } - else { + if (tdc->lruq.prev == &tdc->lruq) + osi_Panic("lruq 3"); + } else { tdc = tmpdc; tdc->f.states = 0; tdc->ihint = 0; } -#ifdef AFS_SUN5_ENVX - mutex_enter(&tdc->lock); -#endif /* - * Seek to the aslot'th entry and read it in. - */ - code = afs_osi_Read(afs_cacheInodep, sizeof(struct fcache) * aslot + - sizeof(struct afs_fheader), - (char *)(&tdc->f), sizeof(struct fcache)); + * Seek to the aslot'th entry and read it in. + */ + code = + afs_osi_Read(afs_cacheInodep, + sizeof(struct fcache) * aslot + + sizeof(struct afs_fheader), (char *)(&tdc->f), + sizeof(struct fcache)); entryok = 1; if (code != sizeof(struct fcache)) entryok = 0; @@ -2360,8 +2834,8 @@ struct dcache *afs_UFSGetDSlot(aslot, tmpdc) tdc->f.fid.Fid.Volume = 0; tdc->f.chunk = -1; hones(tdc->f.versionNo); - tdc->flags |= DFEntryMod; -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) + tdc->dflags |= DFEntryMod; +#if defined(KERNEL_HAVE_UERROR) last_error = getuerror(); #endif lasterrtime = osi_Time(); @@ -2369,16 +2843,31 @@ struct dcache *afs_UFSGetDSlot(aslot, tmpdc) } tdc->refCount = 1; tdc->index = aslot; + if (tdc->f.chunk >= 0) + tdc->validPos = AFS_CHUNKTOBASE(tdc->f.chunk) + tdc->f.chunkBytes; + else + tdc->validPos = 0; + + if (existing) { + osi_Assert(0 == NBObtainWriteLock(&tdc->lock, 674)); + osi_Assert(0 == NBObtainWriteLock(&tdc->mflock, 675)); + osi_Assert(0 == NBObtainWriteLock(&tdc->tlock, 676)); + } + + RWLOCK_INIT(&tdc->lock, "dcache lock"); + RWLOCK_INIT(&tdc->tlock, "dcache tlock"); + RWLOCK_INIT(&tdc->mflock, "dcache flock"); + ObtainReadLock(&tdc->tlock); /* * If we didn't read into a temporary dcache region, update the * slot pointer table. */ - if (tmpdc == (struct dcache *)0) + if (tmpdc == NULL) afs_indexTable[aslot] = tdc; return tdc; -} /*afs_UFSGetDSlot*/ +} /*afs_UFSGetDSlot */ @@ -2394,20 +2883,18 @@ struct dcache *afs_UFSGetDSlot(aslot, tmpdc) * atime : If true, set the modtime on the file to the current time. * * Environment: - * Must be called with the afs_xdcache lock at least read-locked. + * Must be called with the afs_xdcache lock at least read-locked, + * and dcache entry at least read-locked. * The reference count is not changed. */ -afs_WriteDCache(adc, atime) - int atime; - register struct dcache *adc; - -{ /*afs_WriteDCache*/ - - register struct osi_file *tfile; +int +afs_WriteDCache(register struct dcache *adc, int atime) +{ register afs_int32 code; - if (cacheDiskType == AFS_FCACHE_TYPE_MEM) return 0; + if (cacheDiskType == AFS_FCACHE_TYPE_MEM) + return 0; AFS_STATCNT(afs_WriteDCache); if (atime) adc->f.modTime = osi_Time(); @@ -2415,13 +2902,15 @@ afs_WriteDCache(adc, atime) * Seek to the right dcache slot and write the in-memory image out to disk. */ afs_cellname_write(); - code = afs_osi_Write(afs_cacheInodep, sizeof(struct fcache) * adc->index + - sizeof(struct afs_fheader), - (char *)(&adc->f), sizeof(struct fcache)); - if (code != sizeof(struct fcache)) return EIO; + code = + afs_osi_Write(afs_cacheInodep, + sizeof(struct fcache) * adc->index + + sizeof(struct afs_fheader), (char *)(&adc->f), + sizeof(struct fcache)); + if (code != sizeof(struct fcache)) + return EIO; return 0; - -} /*afs_WriteDCache*/ +} @@ -2439,18 +2928,16 @@ afs_WriteDCache(adc, atime) * Nothing interesting. */ -afs_wakeup(avc) - register struct vcache *avc; - -{ /*afs_wakeup*/ - +int +afs_wakeup(register struct vcache *avc) +{ register int i; register struct brequest *tb; tb = afs_brs; AFS_STATCNT(afs_wakeup); for (i = 0; i < NBRS; i++, tb++) { /* if request is valid and for this file, we've found it */ - if (tb->refCount > 0 && avc == tb->vnode) { + if (tb->refCount > 0 && avc == tb->vc) { /* * If CSafeStore is on, then we don't awaken the guy @@ -2473,8 +2960,7 @@ afs_wakeup(avc) } } return 0; - -} /*afs_wakeup*/ +} /* @@ -2493,14 +2979,11 @@ afs_wakeup(avc) * This function is called only during initialization. */ -int afs_InitCacheFile(afile, ainode) - ino_t ainode; - char *afile; - -{ /*afs_InitCacheFile*/ - +int +afs_InitCacheFile(char *afile, ino_t ainode) +{ register afs_int32 code; -#ifdef AFS_LINUX22_ENV +#if defined(AFS_LINUX22_ENV) struct dentry *filevp; #else struct vnode *filevp; @@ -2513,18 +2996,21 @@ int afs_InitCacheFile(afile, ainode) AFS_STATCNT(afs_InitCacheFile); index = afs_stats_cmperf.cacheNumEntries; - if (index >= afs_cacheFiles) return EINVAL; + if (index >= afs_cacheFiles) + return EINVAL; - MObtainWriteLock(&afs_xdcache,282); - tdc = afs_GetDSlot(index, (struct dcache *)0); + MObtainWriteLock(&afs_xdcache, 282); + tdc = afs_GetDSlot(index, NULL); + ReleaseReadLock(&tdc->tlock); MReleaseWriteLock(&afs_xdcache); + + ObtainWriteLock(&tdc->lock, 621); + MObtainWriteLock(&afs_xdcache, 622); if (afile) { - code = gop_lookupname(afile, - AFS_UIOSYS, - 0, - (struct vnode **) 0, - &filevp); + code = gop_lookupname(afile, AFS_UIOSYS, 0, NULL, &filevp); if (code) { + ReleaseWriteLock(&afs_xdcache); + ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); return code; } @@ -2541,24 +3027,25 @@ int afs_InitCacheFile(afile, ainode) #ifdef AFS_DEC_ENV grele(filevp); #else - AFS_RELE((struct vnode *)filevp); + AFS_RELE(filevp); #endif #endif /* AFS_LINUX22_ENV */ - } - else { + } else { tdc->f.inode = ainode; } fileIsBad = 0; - if ((tdc->f.states & DWriting) || - tdc->f.fid.Fid.Volume == 0) fileIsBad = 1; + if ((tdc->f.states & DWriting) || tdc->f.fid.Fid.Volume == 0) + fileIsBad = 1; tfile = osi_UFSOpen(tdc->f.inode); code = afs_osi_Stat(tfile, &tstat); - if (code) osi_Panic("initcachefile stat"); + if (code) + osi_Panic("initcachefile stat"); /* * If file size doesn't match the cache info file, it's probably bad. */ - if (tdc->f.chunkBytes != tstat.size) fileIsBad = 1; + if (tdc->f.chunkBytes != tstat.size) + fileIsBad = 1; tdc->f.chunkBytes = 0; /* @@ -2567,14 +3054,17 @@ int afs_InitCacheFile(afile, ainode) * the cache info file may be incorrectly identified, and so slot * may be bad. */ - if (cacheInfoModTime < tstat.mtime + 120) fileIsBad = 1; - if (cacheInfoModTime < tdc->f.modTime + 120) fileIsBad = 1; + if (cacheInfoModTime < tstat.mtime + 120) + fileIsBad = 1; + if (cacheInfoModTime < tdc->f.modTime + 120) + fileIsBad = 1; /* In case write through is behind, make sure cache items entry is * at least as new as the chunk. */ - if (tdc->f.modTime < tstat.mtime) fileIsBad = 1; + if (tdc->f.modTime < tstat.mtime) + fileIsBad = 1; if (fileIsBad) { - tdc->f.fid.Fid.Volume = 0; /* not in the hash table */ + tdc->f.fid.Fid.Volume = 0; /* not in the hash table */ if (tstat.size != 0) osi_UFSTruncate(tfile, 0); /* put entry in free cache slot list */ @@ -2583,19 +3073,18 @@ int afs_InitCacheFile(afile, ainode) afs_freeDCCount++; afs_indexFlags[index] |= IFFree; afs_indexUnique[index] = 0; - } - else { + } else { /* * We must put this entry in the appropriate hash tables. * Note that i is still set from the above DCHash call */ code = DCHash(&tdc->f.fid, tdc->f.chunk); - afs_dcnextTbl[tdc->index] = afs_dchashTbl[code]; + afs_dcnextTbl[tdc->index] = afs_dchashTbl[code]; afs_dchashTbl[code] = tdc->index; code = DVHash(&tdc->f.fid); afs_dvnextTbl[tdc->index] = afs_dvhashTbl[code]; afs_dvhashTbl[code] = tdc->index; - afs_AdjustSize(tdc, tstat.size); /* adjust to new size */ + afs_AdjustSize(tdc, tstat.size); /* adjust to new size */ if (tstat.size > 0) /* has nontrivial amt of data */ afs_indexFlags[index] |= IFEverUsed; @@ -2609,18 +3098,19 @@ int afs_InitCacheFile(afile, ainode) hset32(afs_indexCounter, tstat.atime); } afs_indexUnique[index] = tdc->f.fid.Fid.Unique; - } /*File is not bad*/ + } /*File is not bad */ osi_UFSClose(tfile); tdc->f.states &= ~DWriting; - tdc->flags &= ~DFEntryMod; + tdc->dflags &= ~DFEntryMod; /* don't set f.modTime; we're just cleaning up */ afs_WriteDCache(tdc, 0); + ReleaseWriteLock(&afs_xdcache); + ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); afs_stats_cmperf.cacheNumEntries++; return 0; - -} /*afs_InitCacheFile*/ +} /*Max # of struct dcache's resident at any time*/ @@ -2636,8 +3126,8 @@ int afs_InitCacheFile(afile, ainode) * Description: * Initialize dcache related variables. */ -void afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk, - int aflags) +void +afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk, int aflags) { register struct dcache *tdp; int i; @@ -2646,110 +3136,114 @@ void afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk, afs_freeDCList = NULLIDX; afs_discardDCList = NULLIDX; afs_freeDCCount = 0; - afs_freeDSList = (struct dcache *)0; + afs_freeDSList = NULL; hzero(afs_indexCounter); LOCK_INIT(&afs_xdcache, "afs_xdcache"); - + /* * Set chunk size */ if (achunk) { if (achunk < 0 || achunk > 30) - achunk = 13; /* Use default */ + achunk = 13; /* Use default */ AFS_SETCHUNKSIZE(achunk); } - - if(!aDentries) + + if (!aDentries) aDentries = DDSIZE; - - if(aflags & AFSCALL_INIT_MEMCACHE) { + + if (aflags & AFSCALL_INIT_MEMCACHE) { /* * Use a memory cache instead of a disk cache */ cacheDiskType = AFS_FCACHE_TYPE_MEM; afs_cacheType = &afs_MemCacheOps; - afiles = (afiles < aDentries) ? afiles : aDentries; /* min */ - ablocks = afiles * (AFS_FIRSTCSIZE/1024); + afiles = (afiles < aDentries) ? afiles : aDentries; /* min */ + ablocks = afiles * (AFS_FIRSTCSIZE / 1024); /* ablocks is reported in 1K blocks */ - code = afs_InitMemCache(afiles * AFS_FIRSTCSIZE, AFS_FIRSTCSIZE, aflags); + code = afs_InitMemCache(afiles, AFS_FIRSTCSIZE, aflags); if (code != 0) { printf("afsd: memory cache too large for available memory.\n"); printf("afsd: AFS files cannot be accessed.\n\n"); dcacheDisabled = 1; afiles = ablocks = 0; - } - else - printf("Memory cache: Allocating %d dcache entries...", aDentries); + } else + printf("Memory cache: Allocating %d dcache entries...", + aDentries); } else { cacheDiskType = AFS_FCACHE_TYPE_UFS; afs_cacheType = &afs_UfsCacheOps; } - if (aDentries > 512) + if (aDentries > 512) afs_dhashsize = 2048; /* initialize hash tables */ - afs_dvhashTbl = (afs_int32 *) afs_osi_Alloc(afs_dhashsize * sizeof(afs_int32)); - afs_dchashTbl = (afs_int32 *) afs_osi_Alloc(afs_dhashsize * sizeof(afs_int32)); - for(i=0;i< afs_dhashsize;i++) { + afs_dvhashTbl = + (afs_int32 *) afs_osi_Alloc(afs_dhashsize * sizeof(afs_int32)); + afs_dchashTbl = + (afs_int32 *) afs_osi_Alloc(afs_dhashsize * sizeof(afs_int32)); + for (i = 0; i < afs_dhashsize; i++) { afs_dvhashTbl[i] = NULLIDX; afs_dchashTbl[i] = NULLIDX; } afs_dvnextTbl = (afs_int32 *) afs_osi_Alloc(afiles * sizeof(afs_int32)); afs_dcnextTbl = (afs_int32 *) afs_osi_Alloc(afiles * sizeof(afs_int32)); - for(i=0;i< afiles;i++) { + for (i = 0; i < afiles; i++) { afs_dvnextTbl[i] = NULLIDX; afs_dcnextTbl[i] = NULLIDX; } - + /* Allocate and zero the pointer array to the dcache entries */ afs_indexTable = (struct dcache **) afs_osi_Alloc(sizeof(struct dcache *) * afiles); memset((char *)afs_indexTable, 0, sizeof(struct dcache *) * afiles); - afs_indexTimes = (afs_hyper_t *) afs_osi_Alloc(afiles * sizeof(afs_hyper_t)); + afs_indexTimes = + (afs_hyper_t *) afs_osi_Alloc(afiles * sizeof(afs_hyper_t)); memset((char *)afs_indexTimes, 0, afiles * sizeof(afs_hyper_t)); - afs_indexUnique = (afs_int32 *) afs_osi_Alloc(afiles * sizeof(afs_uint32)); + afs_indexUnique = + (afs_int32 *) afs_osi_Alloc(afiles * sizeof(afs_uint32)); memset((char *)afs_indexUnique, 0, afiles * sizeof(afs_uint32)); afs_indexFlags = (u_char *) afs_osi_Alloc(afiles * sizeof(u_char)); memset((char *)afs_indexFlags, 0, afiles * sizeof(char)); - + /* Allocate and thread the struct dcache entries themselves */ tdp = afs_Initial_freeDSList = - (struct dcache *) afs_osi_Alloc(aDentries * sizeof(struct dcache)); + (struct dcache *)afs_osi_Alloc(aDentries * sizeof(struct dcache)); memset((char *)tdp, 0, aDentries * sizeof(struct dcache)); -#ifdef AFS_AIX32_ENV - pin((char *)afs_indexTable, sizeof(struct dcache *) * afiles);/* XXX */ - pin((char *)afs_indexTimes, sizeof(afs_hyper_t) * afiles); /* XXX */ - pin((char *)afs_indexFlags, sizeof(char) * afiles); /* XXX */ - pin((char *)afs_indexUnique, sizeof(afs_int32) * afiles); /* XXX */ - pin((char *)tdp, aDentries * sizeof(struct dcache)); /* XXX */ - pin((char *)afs_dvhashTbl, sizeof(afs_int32) * afs_dhashsize); /* XXX */ - pin((char *)afs_dchashTbl, sizeof(afs_int32) * afs_dhashsize); /* XXX */ - pin((char *)afs_dcnextTbl, sizeof(afs_int32) * afiles); /* XXX */ - pin((char *)afs_dvnextTbl, sizeof(afs_int32) * afiles); /* XXX */ +#ifdef KERNEL_HAVE_PIN + pin((char *)afs_indexTable, sizeof(struct dcache *) * afiles); /* XXX */ + pin((char *)afs_indexTimes, sizeof(afs_hyper_t) * afiles); /* XXX */ + pin((char *)afs_indexFlags, sizeof(char) * afiles); /* XXX */ + pin((char *)afs_indexUnique, sizeof(afs_int32) * afiles); /* XXX */ + pin((char *)tdp, aDentries * sizeof(struct dcache)); /* XXX */ + pin((char *)afs_dvhashTbl, sizeof(afs_int32) * afs_dhashsize); /* XXX */ + pin((char *)afs_dchashTbl, sizeof(afs_int32) * afs_dhashsize); /* XXX */ + pin((char *)afs_dcnextTbl, sizeof(afs_int32) * afiles); /* XXX */ + pin((char *)afs_dvnextTbl, sizeof(afs_int32) * afiles); /* XXX */ #endif afs_freeDSList = &tdp[0]; - for(i=0; i < aDentries-1; i++) { - tdp[i].lruq.next = (struct afs_q *) (&tdp[i+1]); + for (i = 0; i < aDentries - 1; i++) { + tdp[i].lruq.next = (struct afs_q *)(&tdp[i + 1]); } - tdp[aDentries-1].lruq.next = (struct afs_q *) 0; + tdp[aDentries - 1].lruq.next = (struct afs_q *)0; - afs_stats_cmperf.cacheBlocksOrig = afs_stats_cmperf.cacheBlocksTotal = afs_cacheBlocks = ablocks; + afs_stats_cmperf.cacheBlocksOrig = afs_stats_cmperf.cacheBlocksTotal = + afs_cacheBlocks = ablocks; afs_ComputeCacheParms(); /* compute parms based on cache size */ afs_dcentries = aDentries; afs_blocksUsed = 0; QInit(&afs_DLRU); - - } /* * shutdown_dcache * */ -void shutdown_dcache(void) +void +shutdown_dcache(void) { int i; @@ -2759,28 +3253,31 @@ void shutdown_dcache(void) afs_osi_Free(afs_indexTimes, afs_cacheFiles * sizeof(afs_hyper_t)); afs_osi_Free(afs_indexUnique, afs_cacheFiles * sizeof(afs_uint32)); afs_osi_Free(afs_indexFlags, afs_cacheFiles * sizeof(u_char)); - afs_osi_Free(afs_Initial_freeDSList, afs_dcentries * sizeof(struct dcache)); -#ifdef AFS_AIX32_ENV + afs_osi_Free(afs_Initial_freeDSList, + afs_dcentries * sizeof(struct dcache)); +#ifdef KERNEL_HAVE_PIN unpin((char *)afs_dcnextTbl, afs_cacheFiles * sizeof(afs_int32)); unpin((char *)afs_dvnextTbl, afs_cacheFiles * sizeof(afs_int32)); unpin((char *)afs_indexTable, afs_cacheFiles * sizeof(struct dcache *)); unpin((char *)afs_indexTimes, afs_cacheFiles * sizeof(afs_hyper_t)); unpin((char *)afs_indexUnique, afs_cacheFiles * sizeof(afs_uint32)); - unpin((u_char *)afs_indexFlags, afs_cacheFiles * sizeof(u_char)); + unpin((u_char *) afs_indexFlags, afs_cacheFiles * sizeof(u_char)); unpin(afs_Initial_freeDSList, afs_dcentries * sizeof(struct dcache)); #endif - for(i=0;i< afs_dhashsize;i++) { + for (i = 0; i < afs_dhashsize; i++) { afs_dvhashTbl[i] = NULLIDX; afs_dchashTbl[i] = NULLIDX; } + afs_osi_Free(afs_dvhashTbl, afs_dhashsize * sizeof(afs_int32)); + afs_osi_Free(afs_dchashTbl, afs_dhashsize * sizeof(afs_int32)); afs_blocksUsed = afs_dcentries = 0; hzero(afs_indexCounter); - afs_freeDCCount = 0; + afs_freeDCCount = 0; afs_freeDCList = NULLIDX; afs_discardDCList = NULLIDX; afs_freeDSList = afs_Initial_freeDSList = 0; diff --git a/src/afs/afs_dynroot.c b/src/afs/afs_dynroot.c index 724116625..a55949663 100644 --- a/src/afs/afs_dynroot.c +++ b/src/afs/afs_dynroot.c @@ -26,17 +26,17 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -#include "../afs/stds.h" -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" -#include "../afs/afs_osi.h" -#include "../afsint/afsint.h" -#include "../afs/lock.h" +#include "afs/stds.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" +#include "afs/afs_osi.h" +#include "afsint.h" +#include "afs/lock.h" -#include "../afs/prs_fs.h" -#include "../afs/dir.h" +#include "afs/prs_fs.h" +#include "afs/dir.h" #define AFS_DYNROOT_CELLNAME "dynroot" #define AFS_DYNROOT_VOLUME 1 @@ -91,22 +91,21 @@ static struct afs_dynSymlink *afs_dynSymlinkBase = NULL; static int afs_dynSymlinkIndex = 0; /* End of variables protected by afs_dynSymlinkLock */ -extern afs_int32 afs_cellindex; -extern afs_rwlock_t afs_xvcache; - /* * Set up a cell for dynroot if it's not there yet. */ -static int afs_dynrootCellInit() +static int +afs_dynrootCellInit() { if (afs_dynrootEnable && !afs_dynrootCell) { afs_int32 cellHosts[MAXCELLHOSTS]; struct cell *tc; int code; - + memset(cellHosts, 0, sizeof(cellHosts)); - code = afs_NewCell(AFS_DYNROOT_CELLNAME, cellHosts, CNoSUID | CNoAFSDB, - NULL, 0, 0, 0); + code = + afs_NewCell(AFS_DYNROOT_CELLNAME, cellHosts, CNoSUID | CNoAFSDB, + NULL, 0, 0, 0); if (code) return code; tc = afs_GetCellByName(AFS_DYNROOT_CELLNAME, READ_LOCK); @@ -115,6 +114,7 @@ static int afs_dynrootCellInit() afs_dynrootCell = tc->cellNum; afs_PutCell(tc, READ_LOCK); } + return 0; } @@ -124,23 +124,21 @@ static int afs_dynrootCellInit() int afs_IsDynrootFid(struct VenusFid *fid) { - return - (afs_dynrootEnable && - fid->Cell == afs_dynrootCell && - fid->Fid.Volume == AFS_DYNROOT_VOLUME && - fid->Fid.Vnode == AFS_DYNROOT_VNODE && - fid->Fid.Unique == AFS_DYNROOT_UNIQUE); + return (afs_dynrootEnable && fid->Cell == afs_dynrootCell + && fid->Fid.Volume == AFS_DYNROOT_VOLUME + && fid->Fid.Vnode == AFS_DYNROOT_VNODE + && fid->Fid.Unique == AFS_DYNROOT_UNIQUE); } /* * Obtain the magic dynroot volume Fid. */ void -afs_GetDynrootFid(struct VenusFid *fid) +afs_GetDynrootFid(struct VenusFid *fid) { - fid->Cell = afs_dynrootCell; + fid->Cell = afs_dynrootCell; fid->Fid.Volume = AFS_DYNROOT_VOLUME; - fid->Fid.Vnode = AFS_DYNROOT_VNODE; + fid->Fid.Vnode = AFS_DYNROOT_VNODE; fid->Fid.Unique = AFS_DYNROOT_UNIQUE; } @@ -148,8 +146,7 @@ afs_GetDynrootFid(struct VenusFid *fid) * Returns non-zero iff avc is a pointer to the dynroot /afs vnode. */ int -afs_IsDynroot(avc) - struct vcache *avc; +afs_IsDynroot(struct vcache *avc) { return afs_IsDynrootFid(&avc->fid); } @@ -159,7 +156,8 @@ afs_IsDynroot(avc) * appropriately so that the given file name can be appended. Used for * computing the size of a directory. */ -static void afs_dynroot_computeDirEnt(char *name, int *curPageP, int *curChunkP) +static void +afs_dynroot_computeDirEnt(char *name, int *curPageP, int *curChunkP) { int esize; @@ -177,14 +175,10 @@ static void afs_dynroot_computeDirEnt(char *name, int *curPageP, int *curChunkP) * the necessary entry. */ static void -afs_dynroot_addDirEnt(dirHeader, curPageP, curChunkP, name, vnode) - struct DirHeader *dirHeader; - int *curPageP; - int *curChunkP; - char *name; - int vnode; +afs_dynroot_addDirEnt(struct DirHeader *dirHeader, int *curPageP, + int *curChunkP, char *name, int vnode) { - char *dirBase = (char *) dirHeader; + char *dirBase = (char *)dirHeader; struct PageHeader *pageHeader; struct DirEntry *dirEntry; int sizeOfEntry, i, t1, t2; @@ -202,23 +196,23 @@ afs_dynroot_addDirEnt(dirHeader, curPageP, curChunkP, name, vnode) didNewPage = 1; } - pageHeader = (struct PageHeader *) (dirBase + curPage * AFS_PAGESIZE); + pageHeader = (struct PageHeader *)(dirBase + curPage * AFS_PAGESIZE); if (didNewPage) { pageHeader->pgcount = 0; pageHeader->tag = htons(1234); pageHeader->freecount = 0; pageHeader->freebitmap[0] = 0x01; - for (i = 1; i < EPP/8; i++) + for (i = 1; i < EPP / 8; i++) pageHeader->freebitmap[i] = 0; dirHeader->alloMap[curPage] = EPP - 1; } - dirEntry = (struct DirEntry *) (pageHeader + curChunk); - dirEntry->flag = 1; - dirEntry->length = 0; - dirEntry->next = 0; - dirEntry->fid.vnode = htonl(vnode); + dirEntry = (struct DirEntry *)(pageHeader + curChunk); + dirEntry->flag = 1; + dirEntry->length = 0; + dirEntry->next = 0; + dirEntry->fid.vnode = htonl(vnode); dirEntry->fid.vunique = htonl(1); strcpy(dirEntry->name, name); @@ -246,25 +240,26 @@ afs_dynroot_addDirEnt(dirHeader, curPageP, curChunkP, name, vnode) * Invalidate the /afs vnode for dynroot; called when the underlying * directory has changed and needs to be re-read. */ -void afs_DynrootInvalidate(void) +void +afs_DynrootInvalidate(void) { afs_int32 retry; struct vcache *tvc; struct VenusFid tfid; - + if (!afs_dynrootEnable) return; - + ObtainWriteLock(&afs_dynrootDirLock, 687); afs_dynrootVersion++; afs_dynrootVersionHigh = osi_Time(); ReleaseWriteLock(&afs_dynrootDirLock); - + afs_GetDynrootFid(&tfid); do { retry = 0; ObtainReadLock(&afs_xvcache); - tvc = afs_FindVCache(&tfid, 0, 0, &retry, 0); + tvc = afs_FindVCache(&tfid, &retry, 0); ReleaseReadLock(&afs_xvcache); } while (retry); if (tvc) { @@ -279,17 +274,17 @@ void afs_DynrootInvalidate(void) * cells. Useful when the list of cells has changed due to * an AFSDB lookup, for instance. */ -static void afs_RebuildDynroot(void) +static void +afs_RebuildDynroot(void) { int cellidx, maxcellidx, i; int aliasidx, maxaliasidx; struct cell *c; struct cell_alias *ca; int curChunk, curPage; - int dirSize, sizeOfCurEntry, dotLen; + int dirSize, dotLen; char *newDir, *dotCell; struct DirHeader *dirHeader; - struct DirEntry *dirEntry; int linkCount = 0; struct afs_dynSymlink *ts; int newVersion; @@ -307,55 +302,40 @@ static void afs_RebuildDynroot(void) /* Reserve space for "." and ".." */ curChunk += 2; - for (cellidx = 0; ; cellidx++) { + for (cellidx = 0;; cellidx++) { c = afs_GetCellByIndex(cellidx, READ_LOCK); - if (!c) break; - if (c->cellNum == afs_dynrootCell) continue; - - sizeOfCurEntry = afs_dir_NameBlobs(c->cellName); - if (curChunk + sizeOfCurEntry > EPP) { - curPage++; - curChunk = 1; - } - curChunk += sizeOfCurEntry; + if (!c) + break; + if (c->cellNum == afs_dynrootCell) + continue; dotLen = strlen(c->cellName) + 2; dotCell = afs_osi_Alloc(dotLen); strcpy(dotCell, "."); - strcat(dotCell, c->cellName); - sizeOfCurEntry = afs_dir_NameBlobs(dotCell); - if (curChunk + sizeOfCurEntry > EPP) { - curPage++; - curChunk = 1; - } - curChunk += sizeOfCurEntry; + afs_strcat(dotCell, c->cellName); + + afs_dynroot_computeDirEnt(c->cellName, &curPage, &curChunk); + afs_dynroot_computeDirEnt(dotCell, &curPage, &curChunk); afs_osi_Free(dotCell, dotLen); afs_PutCell(c, READ_LOCK); } maxcellidx = cellidx; - for (aliasidx = 0; ; aliasidx++) { + for (aliasidx = 0;; aliasidx++) { ca = afs_GetCellAlias(aliasidx); - if (!ca) break; - - sizeOfCurEntry = afs_dir_NameBlobs(ca->alias); - if (curChunk + sizeOfCurEntry > EPP) { - curPage++; - curChunk = 1; - } - curChunk += sizeOfCurEntry; + if (!ca) + break; - dotCell = afs_osi_Alloc(strlen(ca->alias) + 2); + dotLen = strlen(ca->alias) + 2; + dotCell = afs_osi_Alloc(dotLen); strcpy(dotCell, "."); - strcat(dotCell, ca->alias); - sizeOfCurEntry = afs_dir_NameBlobs(dotCell); - if (curChunk + sizeOfCurEntry > EPP) { - curPage++; - curChunk = 1; - } - curChunk += sizeOfCurEntry; + afs_strcat(dotCell, ca->alias); + + afs_dynroot_computeDirEnt(ca->alias, &curPage, &curChunk); + afs_dynroot_computeDirEnt(dotCell, &curPage, &curChunk); + afs_osi_Free(dotCell, dotLen); afs_PutCellAlias(ca); } maxaliasidx = aliasidx; @@ -363,12 +343,7 @@ static void afs_RebuildDynroot(void) ObtainReadLock(&afs_dynSymlinkLock); ts = afs_dynSymlinkBase; while (ts) { - sizeOfCurEntry = afs_dir_NameBlobs(ts->name); - if (curChunk + sizeOfCurEntry > EPP) { - curPage++; - curChunk = 1; - } - curChunk += sizeOfCurEntry; + afs_dynroot_computeDirEnt(ts->name, &curPage, &curChunk); ts = ts->next; } @@ -380,7 +355,7 @@ static void afs_RebuildDynroot(void) */ curChunk = 13; curPage = 0; - dirHeader = (struct DirHeader *) newDir; + dirHeader = (struct DirHeader *)newDir; dirHeader->header.pgcount = 0; dirHeader->header.tag = htons(1234); @@ -388,7 +363,7 @@ static void afs_RebuildDynroot(void) dirHeader->header.freebitmap[0] = 0xff; dirHeader->header.freebitmap[1] = 0x1f; - for (i = 2; i < EPP/8; i++) + for (i = 2; i < EPP / 8; i++) dirHeader->header.freebitmap[i] = 0; dirHeader->alloMap[0] = EPP - DHE - 1; for (i = 1; i < MAXPAGES; i++) @@ -403,54 +378,58 @@ static void afs_RebuildDynroot(void) for (cellidx = 0; cellidx < maxcellidx; cellidx++) { c = afs_GetCellByIndex(cellidx, READ_LOCK); - if (!c) continue; - if (c->cellNum == afs_dynrootCell) continue; + if (!c) + continue; + if (c->cellNum == afs_dynrootCell) + continue; dotLen = strlen(c->cellName) + 2; dotCell = afs_osi_Alloc(dotLen); strcpy(dotCell, "."); - strcat(dotCell, c->cellName); - afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk, - c->cellName, VNUM_FROM_CIDX_RW(cellidx, 0)); - afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk, - dotCell, VNUM_FROM_CIDX_RW(cellidx, 1)); + afs_strcat(dotCell, c->cellName); + afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk, c->cellName, + VNUM_FROM_CIDX_RW(cellidx, 0)); + afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk, dotCell, + VNUM_FROM_CIDX_RW(cellidx, 1)); + afs_osi_Free(dotCell, dotLen); linkCount += 2; - - afs_osi_Free(dotCell, dotLen); afs_PutCell(c, READ_LOCK); } for (aliasidx = 0; aliasidx < maxaliasidx; aliasidx++) { ca = afs_GetCellAlias(aliasidx); - if (!ca) continue; - - dotCell = afs_osi_Alloc(strlen(ca->alias) + 2); + if (!ca) + continue; + + dotLen = strlen(ca->alias) + 2; + dotCell = afs_osi_Alloc(dotLen); strcpy(dotCell, "."); - strcat(dotCell, ca->alias); - afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk, - ca->alias, VNUM_FROM_CAIDX_RW(aliasidx, 0)); - afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk, - dotCell, VNUM_FROM_CAIDX_RW(aliasidx, 1)); + afs_strcat(dotCell, ca->alias); + afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk, ca->alias, + VNUM_FROM_CAIDX_RW(aliasidx, 0)); + afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk, dotCell, + VNUM_FROM_CAIDX_RW(aliasidx, 1)); + afs_osi_Free(dotCell, dotLen); afs_PutCellAlias(ca); } - + ts = afs_dynSymlinkBase; while (ts) { int vnum = VNUM_FROM_TYPEID(VN_TYPE_SYMLINK, ts->index); - afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk, - ts->name, vnum); + afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk, ts->name, vnum); ts = ts->next; } ReleaseReadLock(&afs_dynSymlinkLock); ObtainWriteLock(&afs_dynrootDirLock, 549); - if (afs_dynrootDir) afs_osi_Free(afs_dynrootDir, afs_dynrootDirLen); + if (afs_dynrootDir) + afs_osi_Free(afs_dynrootDir, afs_dynrootDirLen); afs_dynrootDir = newDir; afs_dynrootDirLen = dirSize; afs_dynrootDirLinkcnt = linkCount; - afs_dynrootVersion = newVersion; + afs_dynrootDirVersion = newVersion; ReleaseWriteLock(&afs_dynrootDirLock); } @@ -458,8 +437,9 @@ static void afs_RebuildDynroot(void) * Returns a pointer to the base of the dynroot directory in memory, * length thereof, and a FetchStatus. */ -void afs_GetDynroot(char **dynrootDir, int *dynrootLen, - struct AFSFetchStatus *status) +void +afs_GetDynroot(char **dynrootDir, int *dynrootLen, + struct AFSFetchStatus *status) { ObtainReadLock(&afs_dynrootDirLock); if (!afs_dynrootDir || afs_dynrootDirVersion != afs_dynrootVersion) { @@ -468,20 +448,22 @@ void afs_GetDynroot(char **dynrootDir, int *dynrootLen, ObtainReadLock(&afs_dynrootDirLock); } - if (dynrootDir) *dynrootDir = afs_dynrootDir; - if (dynrootLen) *dynrootLen = afs_dynrootDirLen; + if (dynrootDir) + *dynrootDir = afs_dynrootDir; + if (dynrootLen) + *dynrootLen = afs_dynrootDirLen; if (status) { memset(status, 0, sizeof(struct AFSFetchStatus)); - status->FileType = Directory; - status->LinkCount = afs_dynrootDirLinkcnt; - status->Length = afs_dynrootDirLen; - status->DataVersion = afs_dynrootVersion; - status->CallerAccess = PRSFS_LOOKUP | PRSFS_READ; + status->FileType = Directory; + status->LinkCount = afs_dynrootDirLinkcnt; + status->Length = afs_dynrootDirLen; + status->DataVersion = afs_dynrootVersion; + status->CallerAccess = PRSFS_LOOKUP | PRSFS_READ; status->AnonymousAccess = PRSFS_LOOKUP | PRSFS_READ; - status->UnixModeBits = 0755; - status->ParentVnode = 1; - status->ParentUnique = 1; + status->UnixModeBits = 0755; + status->ParentVnode = 1; + status->ParentUnique = 1; status->dataVersionHigh = afs_dynrootVersionHigh; } } @@ -490,7 +472,7 @@ void afs_GetDynroot(char **dynrootDir, int *dynrootLen, * Puts back the dynroot read lock. */ void -afs_PutDynroot() +afs_PutDynroot(void) { ReleaseReadLock(&afs_dynrootDirLock); } @@ -501,11 +483,10 @@ afs_PutDynroot() * FetchStatus will be filled in. */ int -afs_DynrootNewVnode(avc, status) - struct vcache *avc; - struct AFSFetchStatus *status; +afs_DynrootNewVnode(struct vcache *avc, struct AFSFetchStatus *status) { - if (!afs_dynrootEnable) return 0; + if (!afs_dynrootEnable) + return 0; if (afs_IsDynroot(avc)) { afs_GetDynroot(0, 0, status); @@ -516,8 +497,8 @@ afs_DynrootNewVnode(avc, status) /* * Check if this is an entry under /afs, e.g. /afs/cellname. */ - if (avc->fid.Cell == afs_dynrootCell && - avc->fid.Fid.Volume == AFS_DYNROOT_VOLUME) { + if (avc->fid.Cell == afs_dynrootCell + && avc->fid.Fid.Volume == AFS_DYNROOT_VOLUME) { struct cell *c; struct cell_alias *ca; @@ -525,13 +506,13 @@ afs_DynrootNewVnode(avc, status) memset(status, 0, sizeof(struct AFSFetchStatus)); - status->FileType = SymbolicLink; - status->LinkCount = 1; - status->DataVersion = 1; - status->CallerAccess = PRSFS_LOOKUP | PRSFS_READ; + status->FileType = SymbolicLink; + status->LinkCount = 1; + status->DataVersion = 1; + status->CallerAccess = PRSFS_LOOKUP | PRSFS_READ; status->AnonymousAccess = PRSFS_LOOKUP | PRSFS_READ; - status->ParentVnode = 1; - status->ParentUnique = 1; + status->ParentVnode = 1; + status->ParentUnique = 1; if (VNUM_TO_VNTYPE(avc->fid.Fid.Vnode) == VN_TYPE_SYMLINK) { struct afs_dynSymlink *ts; @@ -540,7 +521,8 @@ afs_DynrootNewVnode(avc, status) ObtainReadLock(&afs_dynSymlinkLock); ts = afs_dynSymlinkBase; while (ts) { - if (ts->index == index) break; + if (ts->index == index) + break; ts = ts->next; } @@ -549,7 +531,7 @@ afs_DynrootNewVnode(avc, status) avc->linkData = afs_osi_Alloc(linklen + 1); strcpy(avc->linkData, ts->target); - status->Length = linklen; + status->Length = linklen; status->UnixModeBits = 0755; } ReleaseReadLock(&afs_dynSymlinkLock); @@ -557,8 +539,8 @@ afs_DynrootNewVnode(avc, status) return ts ? 1 : 0; } - if (VNUM_TO_VNTYPE(avc->fid.Fid.Vnode) != VN_TYPE_CELL && - VNUM_TO_VNTYPE(avc->fid.Fid.Vnode) != VN_TYPE_ALIAS) { + if (VNUM_TO_VNTYPE(avc->fid.Fid.Vnode) != VN_TYPE_CELL + && VNUM_TO_VNTYPE(avc->fid.Fid.Vnode) != VN_TYPE_ALIAS) { afs_warn("dynroot vnode inconsistency, unknown VNTYPE %d\n", VNUM_TO_VNTYPE(avc->fid.Fid.Vnode)); return 0; @@ -592,7 +574,7 @@ afs_DynrootNewVnode(avc, status) linklen = rw + namelen; avc->linkData = afs_osi_Alloc(linklen + 1); strcpy(avc->linkData, rw ? "." : ""); - strcat(avc->linkData, realName); + afs_strcat(avc->linkData, realName); } status->UnixModeBits = 0755; @@ -612,8 +594,8 @@ afs_DynrootNewVnode(avc, status) linklen = 1 + namelen + 10; avc->linkData = afs_osi_Alloc(linklen + 1); strcpy(avc->linkData, rw ? "%" : "#"); - strcat(avc->linkData, c->cellName); - strcat(avc->linkData, ":root.cell"); + afs_strcat(avc->linkData, c->cellName); + afs_strcat(avc->linkData, ":root.cell"); status->UnixModeBits = 0644; afs_PutCell(c, READ_LOCK); @@ -630,8 +612,7 @@ afs_DynrootNewVnode(avc, status) * Enable or disable dynroot. Returns 0 if successful. */ int -afs_SetDynrootEnable(enable) - int enable; +afs_SetDynrootEnable(int enable) { afs_dynrootEnable = enable; return afs_dynrootCellInit(); @@ -641,7 +622,7 @@ afs_SetDynrootEnable(enable) * Check if dynroot support is enabled. */ int -afs_GetDynrootEnable() +afs_GetDynrootEnable(void) { return afs_dynrootEnable; } @@ -650,8 +631,7 @@ afs_GetDynrootEnable() * Remove a temporary symlink entry from /afs. */ int -afs_DynrootVOPRemove(struct vcache *avc, struct AFS_UCRED *acred, - char *aname) +afs_DynrootVOPRemove(struct vcache *avc, struct AFS_UCRED *acred, char *aname) { struct afs_dynSymlink **tpps; struct afs_dynSymlink *tps; @@ -683,7 +663,7 @@ afs_DynrootVOPRemove(struct vcache *avc, struct AFS_UCRED *acred, if (afs_CellOrAliasExists(aname)) return EROFS; - else + else return ENOENT; } @@ -691,19 +671,15 @@ afs_DynrootVOPRemove(struct vcache *avc, struct AFS_UCRED *acred, * Create a temporary symlink entry in /afs. */ int -afs_DynrootVOPSymlink(avc, acred, aname, atargetName) - struct vcache *avc; - struct AFS_UCRED *acred; - char *aname; - char *atargetName; +afs_DynrootVOPSymlink(struct vcache *avc, struct AFS_UCRED *acred, + char *aname, char *atargetName) { struct afs_dynSymlink *tps; if (acred->cr_uid) return EPERM; - if (afs_CellOrAliasExists(aname)) - return EEXIST; + return EEXIST; /* Check if it's already a symlink */ ObtainWriteLock(&afs_dynSymlinkLock, 91); diff --git a/src/afs/afs_exporter.c b/src/afs/afs_exporter.c index 8e7b48935..7d75c94f1 100644 --- a/src/afs/afs_exporter.c +++ b/src/afs/afs_exporter.c @@ -8,24 +8,25 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_exporter.c,v 1.1.1.5 2001/09/11 14:24:40 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_exporter.c,v 1.8 2003/07/15 23:14:12 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics gathering code */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics gathering code */ -struct afs_exporter *root_exported=0; /* Head of "exporters" link list */ -afs_lock_t afs_xexp; +struct afs_exporter *root_exported = 0; /* Head of "exporters" link list */ +afs_lock_t afs_xexp; /* Add a new "afs exporter" entry to the table of exporters. The default initial values of the entry are passed in as parameters. */ static afs_int32 init_xexported = 0; -struct afs_exporter *exporter_add(size, ops, state, type, data) -afs_int32 size, state, type; -struct exporterops *ops; -char *data; + +struct afs_exporter * +exporter_add(afs_int32 size, struct exporterops *ops, afs_int32 state, + afs_int32 type, char *data) { struct afs_exporter *ex, *op; afs_int32 length; @@ -36,14 +37,14 @@ char *data; LOCK_INIT(&afs_xexp, "afs_xexp"); } length = (size ? size : sizeof(struct afs_exporter)); - ex = (struct afs_exporter *) afs_osi_Alloc(length); + ex = (struct afs_exporter *)afs_osi_Alloc(length); memset((char *)ex, 0, length); - MObtainWriteLock(&afs_xexp,308); + MObtainWriteLock(&afs_xexp, 308); for (op = root_exported; op; op = op->exp_next) { if (!op->exp_next) break; } - if (op) + if (op) op->exp_next = ex; else root_exported = ex; @@ -58,8 +59,8 @@ char *data; /* Returns the "afs exporter" structure of type, "type". NULL is returned if not found */ -struct afs_exporter *exporter_find(type) -int type; +struct afs_exporter * +exporter_find(int type) { struct afs_exporter *op; @@ -76,7 +77,8 @@ int type; } -shutdown_exporter() +void +shutdown_exporter(void) { struct afs_exporter *ex, *op; diff --git a/src/afs/afs_init.c b/src/afs/afs_init.c index aa4a3458e..956a9778f 100644 --- a/src/afs/afs_init.c +++ b/src/afs/afs_init.c @@ -14,113 +14,36 @@ */ #include -#include "../afs/param.h" - -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_init.c,v 1.1.1.10 2003/04/13 19:02:36 hartmans Exp $"); - -#include "../afs/stds.h" -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ - - -/* Imported variables */ -extern afs_int32 afs_waitForever; -extern short afs_waitForeverCount; -extern afs_int32 afs_FVIndex; -extern struct server *afs_setTimeHost; -extern struct server *afs_servers[NSERVERS]; -extern struct unixuser *afs_users[NUSERS]; -extern struct volume *afs_freeVolList; -extern struct volume *afs_volumes[NVOLS]; -extern afs_int32 afs_volCounter; - -extern afs_rwlock_t afs_xaxs; -extern afs_rwlock_t afs_xvolume; -extern afs_rwlock_t afs_xuser; -extern afs_rwlock_t afs_xserver; -extern afs_rwlock_t afs_xsrvAddr; -#ifndef AFS_AIX41_ENV -extern afs_lock_t osi_fsplock; -#endif -extern afs_lock_t osi_flplock; -extern afs_int32 fvTable[NFENTRIES]; - -/* afs_cell.c */ -extern afs_rwlock_t afs_xcell; -extern struct afs_q CellLRU; -extern afs_int32 afs_cellindex; -extern afs_int32 afs_nextCellNum; - -/* afs_conn.c */ -extern afs_rwlock_t afs_xconn; -extern afs_rwlock_t afs_xinterface; - -/* afs_mariner.c */ -extern struct rx_service *afs_server; - - -/* afs_mariner.c */ -extern afs_int32 afs_mariner; -extern afs_int32 afs_marinerHost; - -/* afs_volume.c */ -extern ino_t volumeInode; - -/* afs_osi_pag.c */ -extern afs_uint32 pag_epoch; - -/* afs_dcache.c */ -extern afs_rwlock_t afs_xdcache; -extern int cacheDiskType; -extern afs_int32 afs_fsfragsize; -extern ino_t cacheInode; -extern struct osi_file *afs_cacheInodep; -extern afs_int32 afs_freeDCList; /*Free list for disk cache entries*/ - +#include "afs/param.h" -/* afs_vcache.c */ -extern afs_rwlock_t afs_xvcache; -extern afs_rwlock_t afs_xvcb; +RCSID + ("$Header: /cvs/openafs/src/afs/afs_init.c,v 1.28 2004/05/08 04:23:56 shadow Exp $"); -/* VNOPS/afs_vnop_read.c */ -extern afs_int32 maxIHint; -extern afs_int32 nihints; /* # of above actually in-use */ -extern afs_int32 usedihint; - -/* afs_server.c */ -extern afs_int32 afs_setTime; -extern afs_rwlock_t afs_xsrvAddr; - -/* Imported functions. */ -extern struct rx_securityClass *rxnull_NewServerSecurityObject(); -extern int RXAFSCB_ExecuteRequest(); -extern int RXSTATS_ExecuteRequest(); - - -/* afs_osi.c */ -extern afs_lock_t afs_ftf; +#include "afs/stds.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ /* Exported variables */ -struct osi_dev cacheDev; /*Cache device*/ -afs_int32 cacheInfoModTime; /*Last time cache info modified*/ +struct osi_dev cacheDev; /*Cache device */ +afs_int32 cacheInfoModTime; /*Last time cache info modified */ #if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) -struct mount *afs_cacheVfsp=0; +struct mount *afs_cacheVfsp = 0; #elif defined(AFS_LINUX20_ENV) struct super_block *afs_cacheSBp = 0; #else -struct vfs *afs_cacheVfsp=0; +struct vfs *afs_cacheVfsp = 0; #endif -afs_rwlock_t afs_puttofileLock; /* not used */ -char *afs_sysname = 0; /* So that superuser may change the - * local value of @sys */ +afs_rwlock_t afs_puttofileLock; /* not used */ +char *afs_sysname = 0; /* So that superuser may change the + * local value of @sys */ char *afs_sysnamelist[MAXNUMSYSNAMES]; /* For support of a list of sysname */ int afs_sysnamecount = 0; struct volume *Initialafs_freeVolList; int afs_memvolumes = 0; - -/* Local variables */ - +#if defined(AFS_XBSD_ENV) +static struct vnode *volumeVnode; +#endif /* * Initialization order is important. Must first call afs_CacheInit, @@ -156,17 +79,12 @@ int afs_memvolumes = 0; struct cm_initparams cm_initParams; static int afs_cacheinit_flag = 0; int -afs_CacheInit(astatSize, afiles, ablocks, aDentries, aVolumes, achunk, aflags, - ninodes, nusers) - afs_int32 afiles; - afs_int32 astatSize, ablocks; - afs_int32 achunk, aflags, ninodes, nusers; - afs_int32 aDentries; -{ /*afs_CacheInit*/ - extern int afs_memvolumes; - register afs_int32 i, preallocs; +afs_CacheInit(afs_int32 astatSize, afs_int32 afiles, afs_int32 ablocks, + afs_int32 aDentries, afs_int32 aVolumes, afs_int32 achunk, + afs_int32 aflags, afs_int32 ninodes, afs_int32 nusers) +{ + register afs_int32 i; register struct volume *tv; - long code; AFS_STATCNT(afs_CacheInit); /* @@ -195,29 +113,36 @@ afs_CacheInit(astatSize, afiles, ablocks, aDentries, aVolumes, achunk, aflags, #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV) - /* - * We want to also reserve space for the gnode struct which is associated - * with each vnode (vcache) one; we want to use the pinned pool for them - * since they're referenced at interrupt level. - */ - if (afs_stats_cmperf.SmallBlocksAlloced + astatSize < 3600) - preallocs = astatSize; - else { - preallocs = 3600 - afs_stats_cmperf.SmallBlocksAlloced; - if (preallocs <= 0) preallocs = 10; + { + afs_int32 preallocs; + + /* + * We want to also reserve space for the gnode struct which is associated + * with each vnode (vcache) one; we want to use the pinned pool for them + * since they're referenced at interrupt level. + */ + if (afs_stats_cmperf.SmallBlocksAlloced + astatSize < 3600) + preallocs = astatSize; + else { + preallocs = 3600 - afs_stats_cmperf.SmallBlocksAlloced; + if (preallocs <= 0) + preallocs = 10; + } + osi_AllocMoreSSpace(preallocs); } - osi_AllocMoreSSpace(preallocs); #endif /* * create volume list structure */ - if ( aVolumes < 50 ) aVolumes = 50; - if (aVolumes > 3000) aVolumes = 3000; - - tv = (struct volume *) afs_osi_Alloc(aVolumes * sizeof(struct volume)); - for (i=0;i 3000) + aVolumes = 3000; + + tv = (struct volume *)afs_osi_Alloc(aVolumes * sizeof(struct volume)); + for (i = 0; i < aVolumes - 1; i++) + tv[i].next = &tv[i + 1]; + tv[aVolumes - 1].next = NULL; afs_freeVolList = Initialafs_freeVolList = tv; afs_memvolumes = aVolumes; @@ -225,8 +150,13 @@ afs_CacheInit(astatSize, afiles, ablocks, aDentries, aVolumes, achunk, aflags, afs_cacheStats = astatSize; afs_vcacheInit(astatSize); afs_dcacheInit(afiles, ablocks, aDentries, achunk, aflags); +#ifdef AFS_64BIT_CLIENT +#ifdef AFS_VM_RDWR_ENV + afs_vmMappingEnd = AFS_CHUNKBASE(0x7fffffff); +#endif /* AFS_VM_RDWR_ENV */ +#endif /* AFS_64BIT_CLIENT */ -#if defined(AFS_AIX_ENV) +#if defined(AFS_AIX_ENV) && !defined(AFS_AIX51_ENV) { static void afs_procsize_init(void); @@ -242,13 +172,13 @@ afs_CacheInit(astatSize, afiles, ablocks, aDentries, aVolumes, achunk, aflags, cm_initParams.cmi_nVolumeCaches = aVolumes; cm_initParams.cmi_firstChunkSize = AFS_FIRSTCSIZE; cm_initParams.cmi_otherChunkSize = AFS_OTHERCSIZE; - cm_initParams.cmi_cacheSize = ablocks; + cm_initParams.cmi_cacheSize = afs_cacheBlocks; cm_initParams.cmi_setTime = afs_setTime; cm_initParams.cmi_memCache = (aflags & AFSCALL_INIT_MEMCACHE) ? 1 : 0; return 0; -} /*afs_CacheInit*/ +} /*afs_CacheInit */ /* @@ -262,17 +192,15 @@ afs_CacheInit(astatSize, afiles, ablocks, aDentries, aVolumes, achunk, aflags, */ void -afs_ComputeCacheParms() - -{ /*afs_ComputeCacheParms*/ - +afs_ComputeCacheParms(void) +{ register afs_int32 i; afs_int32 afs_maxCacheDirty; /* * Don't allow more than 2/3 of the files in the cache to be dirty. */ - afs_maxCacheDirty = (2*afs_cacheFiles) / 3; + afs_maxCacheDirty = (2 * afs_cacheFiles) / 3; /* * Also, don't allow more than 2/3 of the total space get filled @@ -283,84 +211,115 @@ afs_ComputeCacheParms() */ if (afs_cacheBlocks & 0xffe00000) { i = afs_cacheBlocks / (AFS_FIRSTCSIZE >> 10); - } - else { + } else { i = (afs_cacheBlocks << 10) / AFS_FIRSTCSIZE; } - i = (2*i) / 3; + i = (2 * i) / 3; if (afs_maxCacheDirty > i) afs_maxCacheDirty = i; if (afs_maxCacheDirty < 1) afs_maxCacheDirty = 1; afs_stats_cmperf.cacheMaxDirtyChunks = afs_maxCacheDirty; -} /*afs_ComputeCacheParms*/ +} /*afs_ComputeCacheParms */ /* - * afs_InitVolumeInfo - * - * Description: - * Set up the volume info storage file. + * LookupInodeByPath * - * Parameters: - * afile : the file to be declared to be the volume info storage - * file for AFS. It must be already truncated to 0 length. - * - * Environment: - * This function is called only during initialization. - * - * WARNING: Data will be written to this file over time by AFS. + * Look up inode given a file name. + * Optionally return the vnode too. + * If the vnode is not returned, we rele it. */ - -static int LookupInodeByPath(char *filename, ino_t *inode) +static int +LookupInodeByPath(char *filename, ino_t * inode, struct vnode **fvpp) { afs_int32 code; - + #ifdef AFS_LINUX22_ENV struct dentry *dp; code = gop_lookupname(filename, AFS_UIOSYS, 0, NULL, &dp); - if (code) return code; + if (code) + return code; *inode = dp->d_inode->i_ino; dput(dp); #else struct vnode *filevp; code = gop_lookupname(filename, AFS_UIOSYS, 0, NULL, &filevp); - if (code) return code; + if (code) + return code; *inode = afs_vnodeToInumber(filevp); -#ifdef AFS_DEC_ENV - grele(filevp); + if (fvpp) + *fvpp = filevp; + else { +#if defined(AFS_DEC_ENV) + grele(filevp); #else - AFS_RELE((struct vnode *)filevp); + AFS_RELE(filevp); #endif + } #endif /* AFS_LINUX22_ENV */ - + return 0; - } - -int afs_InitCellInfo(char *afile) +} + +int +afs_InitCellInfo(char *afile) { ino_t inode; int code; - - code = LookupInodeByPath(afile, &inode); + + code = LookupInodeByPath(afile, &inode, NULL); return afs_cellname_init(inode, code); } - -int afs_InitVolumeInfo(char *afile) + +/* + * afs_InitVolumeInfo + * + * Description: + * Set up the volume info storage file. + * + * Parameters: + * afile : the file to be declared to be the volume info storage + * file for AFS. It must be already truncated to 0 length. + * + * Environment: + * This function is called only during initialization. + * + * WARNING: Data will be written to this file over time by AFS. + */ + +int +afs_InitVolumeInfo(char *afile) { int code; struct osi_file *tfile; - struct vnode *filevp; - + AFS_STATCNT(afs_InitVolumeInfo); - code = LookupInodeByPath(afile, &volumeInode); - if (code) return code; +#if defined(AFS_XBSD_ENV) + /* + * On Open/Free/NetBSD, we can get into big trouble if we don't hold the volume file + * vnode. SetupVolume holds afs_xvolume lock exclusive. + * SetupVolume->GetVolSlot->UFSGetVolSlot->{GetVolCache or WriteVolCache} + * ->osi_UFSOpen->VFS_VGET()->ffs_vget->getnewvnode->vgone on some vnode. + * If it's AFS, then ->vclean->afs_nbsd_reclaim->FlushVCache->QueueVCB-> + * GetVolume->FindVolume-> waits on afs_xvolume lock ! + * + * In general, anything that's called with afs_xvolume locked must not + * end up calling getnewvnode(). The only cases I've found so far + * are things which try to get the volumeInode, and since we keep + * it in the cache... + */ + code = LookupInodeByPath(afile, &volumeInode, &volumeVnode); +#else + code = LookupInodeByPath(afile, &volumeInode, NULL); +#endif + if (code) + return code; tfile = afs_CFileOpen(volumeInode); afs_CFileTruncate(tfile, 0); afs_CFileClose(tfile); return 0; - -} /*afs_InitVolumeInfo*/ +} /* * afs_InitCacheInfo @@ -385,11 +344,9 @@ int afs_InitVolumeInfo(char *afile) * code. * */ -afs_InitCacheInfo(afile) - register char *afile; - -{ /*afs_InitCacheInfo*/ - +int +afs_InitCacheInfo(register char *afile) +{ register afs_int32 code; struct osi_stat tstat; register struct osi_file *tfile; @@ -398,86 +355,80 @@ afs_InitCacheInfo(afile) int goodFile; AFS_STATCNT(afs_InitCacheInfo); - if(cacheDiskType != AFS_FCACHE_TYPE_UFS) + if (cacheDiskType != AFS_FCACHE_TYPE_UFS) osi_Panic("afs_InitCacheInfo --- called for non-ufs cache!"); #ifdef AFS_LINUX22_ENV code = osi_InitCacheInfo(afile); - if (code) return code; + if (code) + return code; #else - code = gop_lookupname(afile, AFS_UIOSYS, 0, (struct vnode **) 0, &filevp); - if (code || !filevp) return ENOENT; + code = gop_lookupname(afile, AFS_UIOSYS, 0, NULL, &filevp); + if (code || !filevp) + return ENOENT; { #if defined(AFS_SUN56_ENV) - struct statvfs64 st; -#else -#if defined(AFS_HPUX102_ENV) - struct k_statvfs st; + struct statvfs64 st; +#elif defined(AFS_HPUX102_ENV) + struct k_statvfs st; +#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) ||defined(AFS_HPUX100_ENV) + struct statvfs st; +#elif defined(AFS_DUX40_ENV) + struct nstatfs st; #else -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) ||defined(AFS_HPUX100_ENV) - struct statvfs st; -#else -#if defined(AFS_DUX40_ENV) - struct nstatfs st; -#else - struct statfs st; -#endif /* DUX40 */ -#endif /* SUN5 SGI */ -#endif /* HP 10.20 */ + struct statfs st; #endif /* SUN56 */ #if defined(AFS_SGI_ENV) #ifdef AFS_SGI65_ENV - VFS_STATVFS(filevp->v_vfsp, &st, (struct vnode *)0, code); - if (!code) + VFS_STATVFS(filevp->v_vfsp, &st, NULL, code); + if (!code) #else - if (!VFS_STATFS(filevp->v_vfsp, &st, (struct vnode *)0)) + if (!VFS_STATFS(filevp->v_vfsp, &st, NULL)) #endif /* AFS_SGI65_ENV */ -#else /* AFS_SGI_ENV */ -#if defined(AFS_SUN5_ENV) || defined(AFS_HPUX100_ENV) - if (!VFS_STATVFS(filevp->v_vfsp, &st)) -#else -#ifdef AFS_OSF_ENV - - VFS_STATFS(filevp->v_vfsp, code); - /* struct copy */ - st = filevp->v_vfsp->m_stat; - if (code == 0) -#else /* AFS_OSF_ENV */ -#ifdef AFS_AIX41_ENV - if (!VFS_STATFS(filevp->v_vfsp, &st, &afs_osi_cred)) -#else -#ifdef AFS_LINUX20_ENV - { - KERNEL_SPACE_DECL; - TO_USER_SPACE(); - - VFS_STATFS(filevp->v_vfsp, &st); - TO_KERNEL_SPACE(); - } +#elif defined(AFS_SUN5_ENV) || defined(AFS_HPUX100_ENV) + if (!VFS_STATVFS(filevp->v_vfsp, &st)) +#elif defined(AFS_OSF_ENV) + + VFS_STATFS(filevp->v_vfsp, code); + /* struct copy */ + st = filevp->v_vfsp->m_stat; + if (code == 0) +#elif defined(AFS_AIX41_ENV) + if (!VFS_STATFS(filevp->v_vfsp, &st, &afs_osi_cred)) +#elif defined(AFS_LINUX20_ENV) + { + KERNEL_SPACE_DECL; + TO_USER_SPACE(); + + VFS_STATFS(filevp->v_vfsp, &st); + TO_KERNEL_SPACE(); + } +#elif defined(AFS_DARWIN_ENV) + if (!VFS_STATFS(filevp->v_mount, &st, current_proc())) +#elif defined(AFS_FBSD50_ENV) + if (!VFS_STATFS(filevp->v_mount, &st, curthread)) +#elif defined(AFS_XBSD_ENV) + if (!VFS_STATFS(filevp->v_mount, &st, curproc)) #else -#if defined(AFS_DARWIN_ENV) - if (!VFS_STATFS(filevp->v_mount, &st, current_proc())) -#else -#if defined(AFS_FBSD_ENV) - if (!VFS_STATFS(filevp->v_mount, &st, curproc)) -#else - if (!VFS_STATFS(filevp->v_vfsp, &st)) -#endif /* AFS_FBSD_ENV */ -#endif /* AFS_DARWIN_ENV */ -#endif /* AFS_LINUX20_ENV */ -#endif /* AIX41 */ -#endif /* OSF */ -#endif /* SUN5 HP10 */ -#endif /* SGI */ + if (!VFS_STATFS(filevp->v_vfsp, &st)) +#endif /* SGI... */ #if defined(AFS_SUN5_ENV) || defined(AFS_HPUX100_ENV) - afs_fsfragsize = st.f_frsize - 1; + afs_fsfragsize = st.f_frsize - 1; #else - afs_fsfragsize = st.f_bsize - 1; + afs_fsfragsize = st.f_bsize - 1; #endif } -#ifdef AFS_LINUX20_ENV +#if defined(AFS_LINUX20_ENV) cacheInode = filevp->i_ino; afs_cacheSBp = filevp->i_sb; +#elif defined(AFS_XBSD_ENV) + cacheInode = VTOI(filevp)->i_number; + cacheDev.mp = filevp->v_mount; + cacheDev.held_vnode = filevp; + vref(filevp); /* Make sure mount point stays busy. XXX */ +#if !defined(AFS_OBSD_ENV) + afs_cacheVfsp = filevp->v_vfsp; +#endif #else #if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV) afs_InitDualFSCacheOps(filevp); @@ -486,7 +437,7 @@ afs_InitCacheInfo(afile) cacheDev.dev = afs_vnodeToDev(filevp); afs_cacheVfsp = filevp->v_vfsp; #endif /* AFS_LINUX20_ENV */ - AFS_RELE((struct vnode *)filevp); + AFS_RELE(filevp); #endif /* AFS_LINUX22_ENV */ tfile = osi_UFSOpen(cacheInode); afs_osi_Stat(tfile, &tstat); @@ -495,11 +446,10 @@ afs_InitCacheInfo(afile) goodFile = 0; if (code == sizeof(theader)) { /* read the header correctly */ - if (theader.magic == AFS_FHMAGIC && - theader.firstCSize == AFS_FIRSTCSIZE && - theader.otherCSize == AFS_OTHERCSIZE && - theader.version == AFS_CI_VERSION - ) + if (theader.magic == AFS_FHMAGIC + && theader.firstCSize == AFS_FIRSTCSIZE + && theader.otherCSize == AFS_OTHERCSIZE + && theader.version == AFS_CI_VERSION) goodFile = 1; } if (!goodFile) { @@ -522,12 +472,11 @@ afs_InitCacheInfo(afile) */ afs_cacheInodep = (struct osi_file *)tfile; return 0; - -} /*afs_InitCacheInfo*/ +} int afs_resourceinit_flag = 0; -afs_ResourceInit(preallocs) - int preallocs; +int +afs_ResourceInit(int preallocs) { register afs_int32 i; static struct rx_securityClass *secobj; @@ -540,35 +489,37 @@ afs_ResourceInit(preallocs) RWLOCK_INIT(&afs_icl_lock, "afs_icl_lock"); RWLOCK_INIT(&afs_xinterface, "afs_xinterface"); LOCK_INIT(&afs_puttofileLock, "afs_puttofileLock"); +#ifndef AFS_FBSD_ENV #ifndef AFS_AIX32_ENV LOCK_INIT(&osi_fsplock, "osi_fsplock"); #endif LOCK_INIT(&osi_flplock, "osi_flplock"); +#endif RWLOCK_INIT(&afs_xconn, "afs_xconn"); afs_CellInit(); - afs_InitCBQueue(1); /* initialize callback queues */ + afs_InitCBQueue(1); /* initialize callback queues */ if (afs_resourceinit_flag == 0) { afs_resourceinit_flag = 1; - for (i=0;i 256) && (preallocs < 3600)) - afs_preallocs = preallocs; - osi_AllocMoreSSpace(afs_preallocs); - osi_AllocMoreMSpace(100); - } + if ((preallocs > 256) && (preallocs < 3600)) + afs_preallocs = preallocs; + osi_AllocMoreSSpace(afs_preallocs); + osi_AllocMoreMSpace(100); + } #endif } - + secobj = rxnull_NewServerSecurityObject(); afs_server = rx_NewService(0, 1, "afs", &secobj, 1, RXAFSCB_ExecuteRequest); @@ -579,9 +530,9 @@ afs_ResourceInit(preallocs) afs_osi_Wakeup(&afs_server); /* wakeup anyone waiting for it */ return 0; -} /*afs_ResourceInit*/ +} /*afs_ResourceInit */ -#if defined(AFS_AIX_ENV) +#if defined(AFS_AIX_ENV) && !defined(AFS_AIX51_ENV) /* * AIX dynamic sizeof(struct proc) @@ -626,8 +577,11 @@ afs_ResourceInit(preallocs) static void afs_procsize_init(void) { - struct proc *p0; /* pointer to process 0 */ - struct proc *pN; /* pointer to process 0's first child */ + struct proc *p0; /* pointer to process 0 */ + struct proc *pN; /* pointer to process 0's first child */ +#ifdef AFS_AIX51_ENV + struct pvproc *pV; +#endif int pN_index; ptrdiff_t pN_offset; int procsize; @@ -637,8 +591,17 @@ afs_procsize_init(void) afs_gcpags = AFS_GCPAGS_EPROC0; return; } - +#ifdef AFS_AIX51_ENV + pN = (struct proc *)0; + pV = p0->p_pvprocp; + if (pV) { + pV = pV->pv_child; + if (pV) + pN = pV->pv_procp; + } +#else pN = p0->p_child; +#endif if (!pN) { afs_gcpags = AFS_GCPAGS_EPROCN; return; @@ -675,7 +638,6 @@ afs_procsize_init(void) afs_gcpags_procsize = procsize; } - #endif /* @@ -691,184 +653,181 @@ afs_procsize_init(void) * Nothing interesting. */ void -shutdown_cache() - -{ /*shutdown_cache*/ - register struct afs_cbr *tsp, *nsp; - extern int afs_cold_shutdown; - extern int pagCounter; - int i; - - AFS_STATCNT(shutdown_cache); - afs_WriteThroughDSlots(); - if (afs_cold_shutdown) { - afs_cacheinit_flag = 0; - shutdown_dcache(); - shutdown_vcache(); - - afs_cacheStats = 0; - afs_cacheFiles = afs_cacheBlocks = 0; - pag_epoch = maxIHint = nihints = usedihint = 0; - pagCounter = 0; - cacheInode = volumeInode = (ino_t)0; - +shutdown_cache(void) +{ + AFS_STATCNT(shutdown_cache); + afs_WriteThroughDSlots(); + if (afs_cold_shutdown) { + afs_cacheinit_flag = 0; + shutdown_dcache(); + shutdown_vcache(); + + afs_cacheStats = 0; + afs_cacheFiles = afs_cacheBlocks = 0; + pag_epoch = maxIHint = nihints = usedihint = 0; + pagCounter = 0; +#if defined(AFS_XBSD_ENV) + vrele(volumeVnode); /* let it go, finally. */ + volumeVnode = NULL; + if (cacheDev.held_vnode) { + vrele(cacheDev.held_vnode); + cacheDev.held_vnode = NULL; + } +#endif + cacheInode = volumeInode = (ino_t) 0; - cacheInfoModTime = 0; + cacheInfoModTime = 0; - afs_fsfragsize = 1023; - memset((char *)&afs_stats_cmperf, 0, sizeof(afs_stats_cmperf)); - memset((char *)&cacheDev, 0, sizeof(struct osi_dev)); - osi_dnlc_shutdown(); - } -} /*shutdown_cache*/ + afs_fsfragsize = 1023; + memset((char *)&afs_stats_cmperf, 0, sizeof(afs_stats_cmperf)); + memset((char *)&cacheDev, 0, sizeof(struct osi_dev)); + osi_dnlc_shutdown(); + } +} /*shutdown_cache */ -void shutdown_vnodeops() +void +shutdown_vnodeops(void) { - extern int afs_cold_shutdown; -#ifndef AFS_LINUX20_ENV - extern int afs_rd_stash_i; -#endif -#ifndef AFS_SUN5_ENV - extern int lastWarnTime; -#endif #if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV) struct buf *afs_bread_freebp = 0; #endif - + AFS_STATCNT(shutdown_vnodeops); if (afs_cold_shutdown) { -#ifndef AFS_SUN5_ENV /* XXX */ - lastWarnTime = 0; +#ifndef AFS_SUN5_ENV /* XXX */ + lastWarnTime = 0; #endif #ifndef AFS_LINUX20_ENV - afs_rd_stash_i = 0; + afs_rd_stash_i = 0; #endif #if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV) - afs_bread_freebp = 0; + afs_bread_freebp = 0; #endif - shutdown_mariner(); - } + shutdown_mariner(); + } } -void shutdown_AFS() - +void +shutdown_AFS(void) { int i; register struct srvAddr *sa; - extern int afs_cold_shutdown; AFS_STATCNT(shutdown_AFS); if (afs_cold_shutdown) { - afs_resourceinit_flag = 0; - /* - * Free Volumes table allocations - */ - { - struct volume *tv; - for (i = 0; i < NVOLS; i++) { - for (tv = afs_volumes[i]; tv; tv = tv->next) { - if (tv->name) { - afs_osi_Free(tv->name, strlen(tv->name)+1); - tv->name = 0; + afs_resourceinit_flag = 0; + /* + * Free Volumes table allocations + */ + { + struct volume *tv; + for (i = 0; i < NVOLS; i++) { + for (tv = afs_volumes[i]; tv; tv = tv->next) { + if (tv->name) { + afs_osi_Free(tv->name, strlen(tv->name) + 1); + tv->name = 0; + } } + afs_volumes[i] = 0; } - afs_volumes[i] = 0; } - } - - /* - * Free FreeVolList allocations - */ - afs_osi_Free(Initialafs_freeVolList, afs_memvolumes * sizeof(struct volume)); - afs_freeVolList = Initialafs_freeVolList = 0; - - /* XXX HACK fort MEM systems XXX - * - * For -memcache cache managers when we run out of free in memory volumes - * we simply malloc more; we won't be able to free those additional volumes. - */ - - - - /* - * Free Users table allocation - */ - { - struct unixuser *tu, *ntu; - for (i=0; i < NUSERS; i++) { - for (tu=afs_users[i]; tu; tu = ntu) { - ntu = tu->next; - if (tu->stp) - afs_osi_Free(tu->stp, tu->stLen); - if (tu->exporter) - EXP_RELE(tu->exporter); - afs_osi_Free(tu, sizeof(struct unixuser)); + + /* + * Free FreeVolList allocations + */ + afs_osi_Free(Initialafs_freeVolList, + afs_memvolumes * sizeof(struct volume)); + afs_freeVolList = Initialafs_freeVolList = 0; + + /* XXX HACK fort MEM systems XXX + * + * For -memcache cache managers when we run out of free in memory volumes + * we simply malloc more; we won't be able to free those additional volumes. + */ + + + + /* + * Free Users table allocation + */ + { + struct unixuser *tu, *ntu; + for (i = 0; i < NUSERS; i++) { + for (tu = afs_users[i]; tu; tu = ntu) { + ntu = tu->next; + if (tu->stp) + afs_osi_Free(tu->stp, tu->stLen); + if (tu->exporter) + EXP_RELE(tu->exporter); + afs_osi_Free(tu, sizeof(struct unixuser)); + } + afs_users[i] = 0; } - afs_users[i] = 0; } - } - - /* - * Free Servers table allocation - */ - { - struct server *ts, *nts; - struct conn *tc, *ntc; - register struct afs_cbr *tcbrp, *tbrp; - struct afs_cbr **lcbrpp; - - for (i=0; i < NSERVERS; i++) { - for (ts = afs_servers[i]; ts; ts = nts) { - nts = ts->next; - for (sa = ts->addr; sa; sa = sa->next_sa) { - if (sa->conns) { + + /* + * Free Servers table allocation + */ + { + struct server *ts, *nts; + struct conn *tc, *ntc; + register struct afs_cbr *tcbrp, *tbrp; + + for (i = 0; i < NSERVERS; i++) { + for (ts = afs_servers[i]; ts; ts = nts) { + nts = ts->next; + for (sa = ts->addr; sa; sa = sa->next_sa) { + if (sa->conns) { + /* + * Free all server's connection structs + */ + tc = sa->conns; + while (tc) { + ntc = tc->next; + AFS_GUNLOCK(); + rx_DestroyConnection(tc->id); + AFS_GLOCK(); + afs_osi_Free(tc, sizeof(struct conn)); + tc = ntc; + } + } + } + for (tcbrp = ts->cbrs; tcbrp; tcbrp = tbrp) { /* - * Free all server's connection structs + * Free all server's callback structs */ - tc = sa->conns; - while (tc) { - ntc = tc->next; - AFS_GUNLOCK(); - rx_DestroyConnection(tc->id); - AFS_GLOCK(); - afs_osi_Free(tc, sizeof(struct conn)); - tc = ntc; - } + tbrp = tcbrp->next; + afs_FreeCBR(tcbrp); } + afs_osi_Free(ts, sizeof(struct server)); } - for (tcbrp = ts->cbrs; tcbrp; tcbrp = tbrp) { - /* - * Free all server's callback structs - */ - tbrp = tcbrp->next; - afs_FreeCBR(tcbrp); - } - afs_osi_Free(ts, sizeof(struct server)); + afs_servers[i] = 0; } - afs_servers[i] = 0; } - } - for (i=0; i -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_lock.c,v 1.1.1.4 2001/07/14 22:19:22 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_lock.c,v 1.9 2003/07/15 23:14:12 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ - -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef TRUE -#define TRUE 1 -#endif - -int afs_trclock=0; +/* probably needed if lock_trace is enabled - should ifdef */ +int afs_trclock = 0; void Lock_Obtain(); void Lock_ReleaseR(); void Lock_ReleaseW(); -void Lock_Init(lock) - register struct afs_lock *lock; +void +Lock_Init(register struct afs_lock *lock) { AFS_STATCNT(Lock_Init); - lock -> readers_reading = 0; - lock -> excl_locked = 0; - lock -> wait_states = 0; - lock -> num_waiting = 0; + lock->readers_reading = 0; + lock->excl_locked = 0; + lock->wait_states = 0; + lock->num_waiting = 0; #if defined(INSTRUMENT_LOCKS) lock->pid_last_reader = 0; lock->pid_writer = 0; @@ -63,24 +57,23 @@ void Lock_Init(lock) lock->time_waiting.tv_usec = 0; } -void ObtainLock(lock, how, src_indicator) - register struct afs_lock *lock; - int how; - unsigned int src_indicator; +void +ObtainLock(register struct afs_lock *lock, int how, + unsigned int src_indicator) { switch (how) { - case READ_LOCK: + case READ_LOCK: if (!((lock)->excl_locked & WRITE_LOCK)) - (lock) -> readers_reading++; + (lock)->readers_reading++; else Afs_Lock_Obtain(lock, READ_LOCK); #if defined(INSTRUMENT_LOCKS) (lock)->pid_last_reader = MyPidxx; #endif /* INSTRUMENT_LOCKS */ break; - case WRITE_LOCK: + case WRITE_LOCK: if (!(lock)->excl_locked && !(lock)->readers_reading) - (lock) -> excl_locked = WRITE_LOCK; + (lock)->excl_locked = WRITE_LOCK; else Afs_Lock_Obtain(lock, WRITE_LOCK); #if defined(INSTRUMENT_LOCKS) @@ -88,9 +81,9 @@ void ObtainLock(lock, how, src_indicator) (lock)->src_indicator = src_indicator; #endif /* INSTRUMENT_LOCKS */ break; - case SHARED_LOCK: + case SHARED_LOCK: if (!(lock)->excl_locked) - (lock) -> excl_locked = SHARED_LOCK; + (lock)->excl_locked = SHARED_LOCK; else Afs_Lock_Obtain(lock, SHARED_LOCK); #if defined(INSTRUMENT_LOCKS) @@ -98,126 +91,130 @@ void ObtainLock(lock, how, src_indicator) (lock)->src_indicator = src_indicator; #endif /* INSTRUMENT_LOCKS */ break; - } + } } -void ReleaseLock(lock, how) - register struct afs_lock *lock; - int how; +void +ReleaseLock(register struct afs_lock *lock, int how) { if (how == READ_LOCK) { - if (!--lock->readers_reading && lock->wait_states) - { + if (!--lock->readers_reading && lock->wait_states) { #if defined(INSTRUMENT_LOCKS) - if ( lock->pid_last_reader == MyPidxx ) + if (lock->pid_last_reader == MyPidxx) lock->pid_last_reader = 0; #endif /* INSTRUMENT_LOCKS */ - Afs_Lock_ReleaseW(lock); + Afs_Lock_ReleaseW(lock); } } else if (how == WRITE_LOCK) { lock->excl_locked &= ~WRITE_LOCK; #if defined(INSTRUMENT_LOCKS) lock->pid_writer = 0; #endif /* INSTRUMENT_LOCKS */ - if (lock->wait_states) Afs_Lock_ReleaseR(lock); + if (lock->wait_states) + Afs_Lock_ReleaseR(lock); } else if (how == SHARED_LOCK) { lock->excl_locked &= ~(SHARED_LOCK | WRITE_LOCK); #if defined(INSTRUMENT_LOCKS) lock->pid_writer = 0; #endif /* INSTRUMENT_LOCKS */ - if (lock->wait_states) Afs_Lock_ReleaseR(lock); + if (lock->wait_states) + Afs_Lock_ReleaseR(lock); } } -Afs_Lock_Obtain(lock, how) - register struct afs_lock *lock; - int how; +void +Afs_Lock_Obtain(register struct afs_lock *lock, int how) { osi_timeval_t tt1, tt2, et; + afs_uint32 us; AFS_STATCNT(Lock_Obtain); - + AFS_ASSERT_GLOCK(); osi_GetuTime(&tt1); - + switch (how) { - case READ_LOCK: lock->num_waiting++; - do { - lock -> wait_states |= READ_LOCK; - afs_osi_Sleep(&lock->readers_reading); - } while (lock->excl_locked & WRITE_LOCK); - lock->num_waiting--; - lock->readers_reading++; - break; - - case WRITE_LOCK: lock->num_waiting++; - do { - lock -> wait_states |= WRITE_LOCK; - afs_osi_Sleep(&lock->excl_locked); - } while (lock->excl_locked || lock->readers_reading); - lock->num_waiting--; - lock->excl_locked = WRITE_LOCK; - break; - - case SHARED_LOCK: lock->num_waiting++; - do { - lock->wait_states |= SHARED_LOCK; - afs_osi_Sleep(&lock->excl_locked); - } while (lock->excl_locked); - lock->num_waiting--; - lock->excl_locked = SHARED_LOCK; - break; - - case BOOSTED_LOCK: lock->num_waiting++; - do { - lock->wait_states |= WRITE_LOCK; - afs_osi_Sleep(&lock->excl_locked); - } while (lock->readers_reading); - lock->num_waiting--; - lock->excl_locked = WRITE_LOCK; - break; - - default: osi_Panic("afs locktype"); + case READ_LOCK: + lock->num_waiting++; + do { + lock->wait_states |= READ_LOCK; + afs_osi_Sleep(&lock->readers_reading); + } while (lock->excl_locked & WRITE_LOCK); + lock->num_waiting--; + lock->readers_reading++; + break; + + case WRITE_LOCK: + lock->num_waiting++; + do { + lock->wait_states |= WRITE_LOCK; + afs_osi_Sleep(&lock->excl_locked); + } while (lock->excl_locked || lock->readers_reading); + lock->num_waiting--; + lock->excl_locked = WRITE_LOCK; + break; + + case SHARED_LOCK: + lock->num_waiting++; + do { + lock->wait_states |= SHARED_LOCK; + afs_osi_Sleep(&lock->excl_locked); + } while (lock->excl_locked); + lock->num_waiting--; + lock->excl_locked = SHARED_LOCK; + break; + + case BOOSTED_LOCK: + lock->num_waiting++; + do { + lock->wait_states |= WRITE_LOCK; + afs_osi_Sleep(&lock->excl_locked); + } while (lock->readers_reading); + lock->num_waiting--; + lock->excl_locked = WRITE_LOCK; + break; + + default: + osi_Panic("afs locktype"); } osi_GetuTime(&tt2); afs_stats_GetDiff(et, tt1, tt2); afs_stats_AddTo((lock->time_waiting), et); + us = (et.tv_sec << 20) + et.tv_usec; if (afs_trclock) { - afs_Trace2(afs_iclSetp, CM_TRACE_LOCKSLEPT, ICL_TYPE_POINTER, lock, - ICL_TYPE_INT32, how); + afs_Trace3(afs_iclSetp, CM_TRACE_LOCKSLEPT, ICL_TYPE_INT32, us, + ICL_TYPE_POINTER, lock, ICL_TYPE_INT32, how); } } /* release a lock, giving preference to new readers */ -Afs_Lock_ReleaseR(lock) - register struct afs_lock *lock; +void +Afs_Lock_ReleaseR(register struct afs_lock *lock) { AFS_STATCNT(Lock_ReleaseR); AFS_ASSERT_GLOCK(); if (lock->wait_states & READ_LOCK) { lock->wait_states &= ~READ_LOCK; afs_osi_Wakeup(&lock->readers_reading); - } - else { + } else { lock->wait_states &= ~EXCL_LOCKS; afs_osi_Wakeup(&lock->excl_locked); } } /* release a lock, giving preference to new writers */ -Afs_Lock_ReleaseW(lock) - register struct afs_lock *lock; +void +Afs_Lock_ReleaseW(register struct afs_lock *lock) { AFS_STATCNT(Lock_ReleaseW); AFS_ASSERT_GLOCK(); if (lock->wait_states & EXCL_LOCKS) { lock->wait_states &= ~EXCL_LOCKS; afs_osi_Wakeup(&lock->excl_locked); - } - else { + } else { lock->wait_states &= ~READ_LOCK; afs_osi_Wakeup(&lock->readers_reading); } @@ -225,8 +222,8 @@ Afs_Lock_ReleaseW(lock) /* Wait for some change in the lock status. -Lock_Wait(lock) - register struct afs_lock *lock; { +void Lock_Wait(register struct afs_lock *lock) +{ AFS_STATCNT(Lock_Wait); if (lock->readers_reading || lock->excl_locked) return 1; lock->wait_states |= READ_LOCK; @@ -240,27 +237,27 @@ Lock_Wait(lock) */ /* release a write lock and sleep on an address, atomically */ -afs_osi_SleepR(addr, alock) -register char *addr; -register struct afs_lock *alock; { +void +afs_osi_SleepR(register char *addr, register struct afs_lock *alock) +{ AFS_STATCNT(osi_SleepR); ReleaseReadLock(alock); afs_osi_Sleep(addr); } /* release a write lock and sleep on an address, atomically */ -afs_osi_SleepW(addr, alock) -register char *addr; -register struct afs_lock *alock; { +void +afs_osi_SleepW(register char *addr, register struct afs_lock *alock) +{ AFS_STATCNT(osi_SleepW); ReleaseWriteLock(alock); afs_osi_Sleep(addr); } /* release a write lock and sleep on an address, atomically */ -afs_osi_SleepS(addr, alock) -register char *addr; -register struct afs_lock *alock; { +void +afs_osi_SleepS(register char *addr, register struct afs_lock *alock) +{ AFS_STATCNT(osi_SleepS); ReleaseSharedLock(alock); afs_osi_Sleep(addr); @@ -271,40 +268,39 @@ register struct afs_lock *alock; { /* operations on locks that don't mind if we lock the same thing twice. I'd like to dedicate this function to Sun Microsystems' Version 4.0 virtual memory system, without which this wouldn't have been necessary */ -void afs_BozonLock(alock, avc) -struct vcache *avc; -struct afs_bozoLock *alock; { +void +afs_BozonLock(struct afs_bozoLock *alock, struct vcache *avc) +{ AFS_STATCNT(afs_BozonLock); while (1) { if (alock->count == 0) { /* lock not held, we win */ #ifdef AFS_SUN5_ENV - alock->proc = (char *) ttoproc(curthread); + alock->proc = (char *)ttoproc(curthread); #else #ifdef AFS_64BITPOINTER_ENV /* To shut up SGI compiler on remark(1413) warnings. */ - alock->proc = (char *) (long)MyPidxx; + alock->proc = (char *)(long)MyPidxx; #else /* AFS_64BITPOINTER_ENV */ - alock->proc = (char *) MyPidxx; + alock->proc = (char *)MyPidxx; #endif /* AFS_64BITPOINTER_ENV */ #endif alock->count = 1; return; #ifdef AFS_SUN5_ENV - } else if (alock->proc == (char *) ttoproc(curthread)) { + } else if (alock->proc == (char *)ttoproc(curthread)) { #else #ifdef AFS_64BITPOINTER_ENV - /* To shut up SGI compiler on remark(1413) warnings. */ - } else if (alock->proc == (char *) (long)MyPidxx) { + /* To shut up SGI compiler on remark(1413) warnings. */ + } else if (alock->proc == (char *)(long)MyPidxx) { #else /* AFS_64BITPOINTER_ENV */ - } else if (alock->proc == (char *) MyPidxx) { + } else if (alock->proc == (char *)MyPidxx) { #endif /* AFS_64BITPOINTER_ENV */ #endif /* lock is held, but by us, so we win anyway */ alock->count++; return; - } - else { + } else { /* lock is held, and not by us; we wait */ alock->flags |= AFS_BOZONWAITING; afs_osi_Sleep(alock); @@ -313,9 +309,9 @@ struct afs_bozoLock *alock; { } /* releasing the same type of lock as defined above */ -void afs_BozonUnlock(alock, avc) -struct vcache *avc; -struct afs_bozoLock *alock; { +void +afs_BozonUnlock(struct afs_bozoLock *alock, struct vcache *avc) +{ AFS_STATCNT(afs_BozonUnlock); if (alock->count <= 0) osi_Panic("BozoUnlock"); @@ -327,38 +323,71 @@ struct afs_bozoLock *alock; { } } -void afs_BozonInit(alock, avc) -struct vcache *avc; -struct afs_bozoLock *alock; { +void +afs_BozonInit(struct afs_bozoLock *alock, struct vcache *avc) +{ AFS_STATCNT(afs_BozonInit); alock->count = 0; alock->flags = 0; - alock->proc = (char *) 0; + alock->proc = NULL; } -afs_CheckBozonLock(alock) -struct afs_bozoLock *alock; { +int +afs_CheckBozonLock(struct afs_bozoLock *alock) +{ AFS_STATCNT(afs_CheckBozonLock); if (alock->count || (alock->flags & AFS_BOZONWAITING)) return 1; return 0; } -afs_CheckBozonLockBlocking(alock) -struct afs_bozoLock *alock; { +int +afs_CheckBozonLockBlocking(struct afs_bozoLock *alock) +{ AFS_STATCNT(afs_CheckBozonLockBlocking); if (alock->count || (alock->flags & AFS_BOZONWAITING)) #ifdef AFS_SUN5_ENV - if (alock->proc != (char *) ttoproc(curthread)) + if (alock->proc != (char *)ttoproc(curthread)) #else #ifdef AFS_64BITPOINTER_ENV - /* To shut up SGI compiler on remark(1413) warnings. */ - if (alock->proc != (char *) (long)MyPidxx) + /* To shut up SGI compiler on remark(1413) warnings. */ + if (alock->proc != (char *)(long)MyPidxx) #else /* AFS_64BITPOINTER_ENV */ - if (alock->proc != (char *) MyPidxx) + if (alock->proc != (char *)MyPidxx) #endif /* AFS_64BITPOINTER_ENV */ #endif return 1; return 0; } #endif + +/* Not static - used conditionally if lock tracing is enabled */ +int +Afs_Lock_Trace(int op, struct afs_lock *alock, int type, char *file, int line) +{ + int traceok; + struct afs_icl_log *tlp; + struct afs_icl_set *tsp; + + if (!afs_trclock) + return 1; + if ((alock) == &afs_icl_lock) + return 1; + + ObtainReadLock(&afs_icl_lock); + traceok = 1; + for (tlp = afs_icl_allLogs; tlp; tlp = tlp->nextp) + if ((alock) == &tlp->lock) + traceok = 0; + for (tsp = afs_icl_allSets; tsp; tsp = tsp->nextp) + if ((alock) == &tsp->lock) + traceok = 0; + ReleaseReadLock(&afs_icl_lock); + if (!traceok) + return 1; + + afs_Trace4(afs_iclSetp, op, ICL_TYPE_STRING, (long)file, ICL_TYPE_INT32, + (long)line, ICL_TYPE_POINTER, (long)alock, ICL_TYPE_LONG, + (long)type); + return 0; +} diff --git a/src/afs/afs_mariner.c b/src/afs/afs_mariner.c index e414700be..03ed409e1 100644 --- a/src/afs/afs_mariner.c +++ b/src/afs/afs_mariner.c @@ -14,20 +14,21 @@ * Implements: */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_mariner.c,v 1.1.1.5 2002/09/26 18:57:52 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_mariner.c,v 1.8 2003/07/15 23:14:12 shadow Exp $"); -#include "../afs/sysincludes.h" /*Standard vendor system headers*/ -#include "../afs/afsincludes.h" /*AFS-based standard headers*/ -#include "../afs/afs_stats.h" /* statistics */ +#include "afs/sysincludes.h" /*Standard vendor system headers */ +#include "afsincludes.h" /*AFS-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ /* Exported variables */ struct rx_service *afs_server; -#define SMAR 20 /* size of a mariner name */ -#define NMAR 10 /* number of mariner names */ +#define SMAR 20 /* size of a mariner name */ +#define NMAR 10 /* number of mariner names */ static char marinerNames[NMAR][SMAR]; static struct vcache *marinerVCs[NMAR]; static int marinerPtr = 0; /* pointer to next mariner slot to use */ @@ -36,9 +37,9 @@ static int marinerPtr = 0; /* pointer to next mariner slot to use */ afs_int32 afs_mariner = 0; afs_int32 afs_marinerHost = 0; -afs_AddMarinerName(aname, avc) - register char *aname; - register struct vcache *avc; { +int +afs_AddMarinerName(register char *aname, register struct vcache *avc) +{ register int i; register char *tp; @@ -50,16 +51,17 @@ afs_AddMarinerName(aname, avc) } tp = marinerNames[i]; strncpy(tp, aname, SMAR); - tp[SMAR-1] = 0; + tp[SMAR - 1] = 0; marinerVCs[i] = avc; return 0; } -char *afs_GetMariner(avc) - register struct vcache *avc; { +char * +afs_GetMariner(register struct vcache *avc) +{ register int i; AFS_STATCNT(afs_GetMariner); - for(i=0; isocket, &taddr, &dvec, 1, len, 0); + (void)osi_NetSend(afs_server->socket, &taddr, &dvec, 1, len, 0); AFS_GLOCK(); osi_FreeSmallSpace(tp1); -} /*afs_MarinerLogFetch*/ +} /*afs_MarinerLogFetch */ -void afs_MarinerLog(astring, avc) - register struct vcache *avc; - register char *astring; +void +afs_MarinerLog(register char *astring, register struct vcache *avc) { struct sockaddr_in taddr; register char *tp, *tp1, *buf; @@ -116,8 +117,8 @@ void afs_MarinerLog(astring, avc) taddr.sin_port = htons(2106); #ifdef STRUCT_SOCKADDR_HAS_SA_LEN taddr.sin_len = sizeof(taddr); -#endif /* STRUCT_SOCKADDR_HAS_SA_LEN */ - tp = buf = (char *) osi_AllocSmallSpace(AFS_SMALLOCSIZ); +#endif /* AFS_OSF_ENV */ + tp = buf = (char *)osi_AllocSmallSpace(AFS_SMALLOCSIZ); strcpy(tp, astring); tp += strlen(astring); @@ -129,46 +130,21 @@ void afs_MarinerLog(astring, avc) /* note, console doesn't want a terminating null */ /* I don't care if mariner packets fail to be sent */ dvec.iov_base = buf; - dvec.iov_len = tp-buf; + dvec.iov_len = tp - buf; AFS_GUNLOCK(); - (void) osi_NetSend(afs_server->socket, &taddr, &dvec, 1, tp-buf, 0); + (void)osi_NetSend(afs_server->socket, &taddr, &dvec, 1, tp - buf, 0); AFS_GLOCK(); osi_FreeSmallSpace(buf); -} /*afs_MarinerLog*/ +} /*afs_MarinerLog */ -void shutdown_mariner(void) +void +shutdown_mariner(void) { int i; marinerPtr = 0; afs_mariner = 0; - for (i=0; i -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_memcache.c,v 1.1.1.5 2001/09/11 14:24:41 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_memcache.c,v 1.15 2003/07/15 23:14:12 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ #ifndef AFS_LINUX22_ENV -#include "../rpc/types.h" +#include "rpc/types.h" #endif #ifdef AFS_ALPHA_ENV #undef kmem_alloc @@ -22,19 +23,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_memcache.c,v 1.1.1.5 2001/09/11 #undef mem_alloc #undef mem_free #undef register -#endif /* AFS_ALPHA_ENV */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ +#endif /* AFS_ALPHA_ENV */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ /* memory cache routines */ - -struct memCacheEntry { - int size; /* # of valid bytes in this entry */ - int dataSize; /* size of allocated data area */ - afs_lock_t afs_memLock; - char *data; /* bytes */ -}; - static struct memCacheEntry *memCache; static int memCacheBlkSize = 8192; static int memMaxBlkNumber = 0; @@ -42,468 +35,477 @@ static int memAllocMaySleep = 0; extern int cacheDiskType; -afs_InitMemCache(size, blkSize, flags) - int size; - int blkSize; - int flags; - { - int index; - - AFS_STATCNT(afs_InitMemCache); - if(blkSize) - memCacheBlkSize = blkSize; - - memMaxBlkNumber = size / memCacheBlkSize; - memCache = (struct memCacheEntry *) - afs_osi_Alloc(memMaxBlkNumber * sizeof(struct memCacheEntry)); - if (flags & AFSCALL_INIT_MEMCACHE_SLEEP) { - memAllocMaySleep = 1; - } - - for(index = 0; index < memMaxBlkNumber; index++) { - char *blk; - (memCache+index)->size = 0; - (memCache+index)->dataSize = memCacheBlkSize; - LOCK_INIT(&((memCache+index)->afs_memLock), "afs_memLock"); - if (memAllocMaySleep) { - blk = afs_osi_Alloc(memCacheBlkSize); - } else { - blk = afs_osi_Alloc_NoSleep(memCacheBlkSize); - } - if (blk == NULL) - goto nomem; - (memCache+index)->data = blk; - memset((memCache+index)->data, 0, memCacheBlkSize); - } +int +afs_InitMemCache(int blkCount, int blkSize, int flags) +{ + int index; + + AFS_STATCNT(afs_InitMemCache); + if (blkSize) + memCacheBlkSize = blkSize; + + memMaxBlkNumber = blkCount; + memCache = (struct memCacheEntry *) + afs_osi_Alloc(memMaxBlkNumber * sizeof(struct memCacheEntry)); + if (flags & AFSCALL_INIT_MEMCACHE_SLEEP) { + memAllocMaySleep = 1; + } + + for (index = 0; index < memMaxBlkNumber; index++) { + char *blk; + (memCache + index)->size = 0; + (memCache + index)->dataSize = memCacheBlkSize; + LOCK_INIT(&((memCache + index)->afs_memLock), "afs_memLock"); + if (memAllocMaySleep) { + blk = afs_osi_Alloc(memCacheBlkSize); + } else { + blk = afs_osi_Alloc_NoSleep(memCacheBlkSize); + } + if (blk == NULL) + goto nomem; + (memCache + index)->data = blk; + memset((memCache + index)->data, 0, memCacheBlkSize); + } #if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) - afs_InitDualFSCacheOps((struct vnode*)0); + afs_InitDualFSCacheOps((struct vnode *)0); #endif - return 0; + return 0; -nomem: - printf("afsd: memCache allocation failure at %d KB.\n", - (index * memCacheBlkSize) / 1024); - while(--index >= 0) { - afs_osi_Free((memCache+index)->data, memCacheBlkSize); - (memCache+index)->data = NULL; - } - return ENOMEM; + nomem: + printf("afsd: memCache allocation failure at %d KB.\n", + (index * memCacheBlkSize) / 1024); + while (--index >= 0) { + afs_osi_Free((memCache + index)->data, memCacheBlkSize); + (memCache + index)->data = NULL; + } + return ENOMEM; - } +} -afs_MemCacheClose(file) - char *file; +int +afs_MemCacheClose(char *file) { return 0; } -void *afs_MemCacheOpen(ino_t blkno) - { - struct memCacheEntry *mep; +void * +afs_MemCacheOpen(ino_t blkno) +{ + struct memCacheEntry *mep; - if (blkno < 0 || blkno > memMaxBlkNumber) { - osi_Panic("afs_MemCacheOpen: invalid block #"); - } - mep = (memCache + blkno); - return (void *) mep; - } + if (blkno < 0 || blkno > memMaxBlkNumber) { + osi_Panic("afs_MemCacheOpen: invalid block #"); + } + mep = (memCache + blkno); + afs_Trace4(afs_iclSetp, CM_TRACE_MEMOPEN, ICL_TYPE_INT32, blkno, + ICL_TYPE_POINTER, mep, ICL_TYPE_POINTER, mep->data, + ICL_TYPE_STRING, mep->data); + return (void *)mep; +} /* * this routine simulates a read in the Memory Cache */ -afs_MemReadBlk(mceP, offset, dest, size) - int offset; - register struct memCacheEntry *mceP; - char *dest; - int size; - { - int bytesRead; - - MObtainReadLock(&mceP->afs_memLock); - AFS_STATCNT(afs_MemReadBlk); - if (offset < 0) { - MReleaseReadLock(&mceP->afs_memLock); - return 0; - } - /* use min of bytes in buffer or requested size */ - bytesRead = (size < mceP->size - offset) ? size : - mceP->size - offset; - - if(bytesRead > 0) { - AFS_GUNLOCK(); - memcpy(dest, mceP->data + offset, bytesRead); - AFS_GLOCK(); - } - else - bytesRead = 0; - - MReleaseReadLock(&mceP->afs_memLock); - return bytesRead; - } +int +afs_MemReadBlk(register struct memCacheEntry *mceP, int offset, char *dest, + int size) +{ + int bytesRead; + + MObtainReadLock(&mceP->afs_memLock); + AFS_STATCNT(afs_MemReadBlk); + if (offset < 0) { + MReleaseReadLock(&mceP->afs_memLock); + return 0; + } + /* use min of bytes in buffer or requested size */ + bytesRead = (size < mceP->size - offset) ? size : mceP->size - offset; + + if (bytesRead > 0) { + AFS_GUNLOCK(); + memcpy(dest, mceP->data + offset, bytesRead); + AFS_GLOCK(); + } else + bytesRead = 0; + + MReleaseReadLock(&mceP->afs_memLock); + return bytesRead; +} /* * this routine simulates a readv in the Memory Cache */ -afs_MemReadvBlk(mceP, offset, iov, nio, size) - int offset; - register struct memCacheEntry *mceP; - struct iovec *iov; - int nio; - int size; - { - int i; - int bytesRead; - int bytesToRead; - - MObtainReadLock(&mceP->afs_memLock); - AFS_STATCNT(afs_MemReadBlk); - if (offset < 0) { - MReleaseReadLock(&mceP->afs_memLock); - return 0; - } - /* use min of bytes in buffer or requested size */ - bytesRead = (size < mceP->size - offset) ? size : - mceP->size - offset; - - if(bytesRead > 0) { - for (i = 0 , size = bytesRead ; i < nio && size > 0 ; i++) { - bytesToRead = (size < iov[i].iov_len) ? size : iov[i].iov_len; - AFS_GUNLOCK(); - memcpy(iov[i].iov_base, mceP->data + offset, bytesToRead); - AFS_GLOCK(); - offset += bytesToRead; - size -= bytesToRead; - } - bytesRead -= size; - } else - bytesRead = 0; - - MReleaseReadLock(&mceP->afs_memLock); - return bytesRead; - } - -afs_MemReadUIO(blkno, uioP) - ino_t blkno; - struct uio *uioP; - { - register struct memCacheEntry *mceP = (struct memCacheEntry *)afs_MemCacheOpen(blkno); - int length = mceP->size - uioP->uio_offset; - afs_int32 code; - - AFS_STATCNT(afs_MemReadUIO); - MObtainReadLock(&mceP->afs_memLock); - length = (length < uioP->uio_resid) ? length : uioP->uio_resid; - AFS_UIOMOVE(mceP->data + uioP->uio_offset, length, UIO_READ, uioP, code); - MReleaseReadLock(&mceP->afs_memLock); - return code; - } +int +afs_MemReadvBlk(register struct memCacheEntry *mceP, int offset, + struct iovec *iov, int nio, int size) +{ + int i; + int bytesRead; + int bytesToRead; + + MObtainReadLock(&mceP->afs_memLock); + AFS_STATCNT(afs_MemReadBlk); + if (offset < 0) { + MReleaseReadLock(&mceP->afs_memLock); + return 0; + } + /* use min of bytes in buffer or requested size */ + bytesRead = (size < mceP->size - offset) ? size : mceP->size - offset; + + if (bytesRead > 0) { + for (i = 0, size = bytesRead; i < nio && size > 0; i++) { + bytesToRead = (size < iov[i].iov_len) ? size : iov[i].iov_len; + AFS_GUNLOCK(); + memcpy(iov[i].iov_base, mceP->data + offset, bytesToRead); + AFS_GLOCK(); + offset += bytesToRead; + size -= bytesToRead; + } + bytesRead -= size; + } else + bytesRead = 0; + + MReleaseReadLock(&mceP->afs_memLock); + return bytesRead; +} + +int +afs_MemReadUIO(ino_t blkno, struct uio *uioP) +{ + register struct memCacheEntry *mceP = + (struct memCacheEntry *)afs_MemCacheOpen(blkno); + int length = mceP->size - uioP->uio_offset; + afs_int32 code; + + AFS_STATCNT(afs_MemReadUIO); + MObtainReadLock(&mceP->afs_memLock); + length = (length < uioP->uio_resid) ? length : uioP->uio_resid; + AFS_UIOMOVE(mceP->data + uioP->uio_offset, length, UIO_READ, uioP, code); + MReleaseReadLock(&mceP->afs_memLock); + return code; +} /*XXX: this extends a block arbitrarily to support big directories */ -afs_MemWriteBlk(mceP, offset, src, size) - register struct memCacheEntry *mceP; - int offset; - char *src; - int size; - { - AFS_STATCNT(afs_MemWriteBlk); - MObtainWriteLock(&mceP->afs_memLock,560); - if (size + offset > mceP->dataSize) { - char *oldData = mceP->data; - - if (memAllocMaySleep) { - mceP->data = afs_osi_Alloc(size+offset); - } else { - mceP->data = afs_osi_Alloc_NoSleep(size+offset); - } - if ( mceP->data == NULL ) /* no available memory */ - { - mceP->data = oldData; /* revert back change that was made */ - MReleaseWriteLock(&mceP->afs_memLock); - afs_warn("afs: afs_MemWriteBlk mem alloc failure (%d bytes)\n", - size+offset); - return -ENOMEM; - } - - /* may overlap, but this is OK */ - AFS_GUNLOCK(); - memcpy(mceP->data, oldData, mceP->size); - AFS_GLOCK(); - afs_osi_Free(oldData,mceP->dataSize); - mceP->dataSize = size+offset; - } - AFS_GUNLOCK(); - if (mceP->size < offset) - memset(mceP->data+mceP->size, 0, offset-mceP->size); - memcpy(mceP->data + offset, src, size); - AFS_GLOCK(); - mceP->size = (size+offset < mceP->size) ? mceP->size : - size + offset; - - MReleaseWriteLock(&mceP->afs_memLock); - return size; - } +int +afs_MemWriteBlk(register struct memCacheEntry *mceP, int offset, char *src, + int size) +{ + AFS_STATCNT(afs_MemWriteBlk); + MObtainWriteLock(&mceP->afs_memLock, 560); + if (size + offset > mceP->dataSize) { + char *oldData = mceP->data; + + if (memAllocMaySleep) { + mceP->data = afs_osi_Alloc(size + offset); + } else { + mceP->data = afs_osi_Alloc_NoSleep(size + offset); + } + if (mceP->data == NULL) { /* no available memory */ + mceP->data = oldData; /* revert back change that was made */ + MReleaseWriteLock(&mceP->afs_memLock); + afs_warn("afs: afs_MemWriteBlk mem alloc failure (%d bytes)\n", + size + offset); + return -ENOMEM; + } + + /* may overlap, but this is OK */ + AFS_GUNLOCK(); + memcpy(mceP->data, oldData, mceP->size); + AFS_GLOCK(); + afs_osi_Free(oldData, mceP->dataSize); + mceP->dataSize = size + offset; + } + AFS_GUNLOCK(); + if (mceP->size < offset) + memset(mceP->data + mceP->size, 0, offset - mceP->size); + memcpy(mceP->data + offset, src, size); + AFS_GLOCK(); + mceP->size = (size + offset < mceP->size) ? mceP->size : size + offset; + + MReleaseWriteLock(&mceP->afs_memLock); + return size; +} /*XXX: this extends a block arbitrarily to support big directories */ -afs_MemWritevBlk(mceP, offset, iov, nio, size) - register struct memCacheEntry *mceP; - int offset; - struct iovec *iov; - int nio; - int size; - { - int i; - int bytesWritten; - int bytesToWrite; - AFS_STATCNT(afs_MemWriteBlk); - MObtainWriteLock(&mceP->afs_memLock,561); - if (size + offset > mceP->dataSize) { - char *oldData = mceP->data; - - mceP->data = afs_osi_Alloc(size+offset); - - /* may overlap, but this is OK */ - AFS_GUNLOCK(); - memcpy(mceP->data, oldData, mceP->size); - AFS_GLOCK(); - afs_osi_Free(oldData,mceP->dataSize); - mceP->dataSize = size+offset; - } - if (mceP->size < offset) - memset(mceP->data+mceP->size, 0, offset-mceP->size); - for (bytesWritten = 0, i = 0 ; i < nio && size > 0 ; i++) { - bytesToWrite = (size < iov[i].iov_len) ? size : iov[i].iov_len; - AFS_GUNLOCK(); - memcpy(mceP->data + offset, iov[i].iov_base, bytesToWrite); - AFS_GLOCK(); - offset += bytesToWrite; - bytesWritten += bytesToWrite; - size -= bytesToWrite; - } - mceP->size = (offset < mceP->size) ? mceP->size : offset; - - MReleaseWriteLock(&mceP->afs_memLock); - return bytesWritten; - } - -afs_MemWriteUIO(blkno, uioP) - ino_t blkno; - struct uio *uioP; - { - register struct memCacheEntry *mceP = (struct memCacheEntry *)afs_MemCacheOpen(blkno); - afs_int32 code; - - AFS_STATCNT(afs_MemWriteUIO); - MObtainWriteLock(&mceP->afs_memLock,312); - if(uioP->uio_resid + uioP->uio_offset > mceP->dataSize) { - char *oldData = mceP->data; - - mceP->data = afs_osi_Alloc(uioP->uio_resid + uioP->uio_offset); - - AFS_GUNLOCK(); - memcpy(mceP->data, oldData, mceP->size); - AFS_GLOCK(); - - afs_osi_Free(oldData,mceP->dataSize); - mceP->dataSize = uioP->uio_resid + uioP->uio_offset; - } - if (mceP->size < uioP->uio_offset) - memset(mceP->data+mceP->size, 0, (int)(uioP->uio_offset-mceP->size)); - AFS_UIOMOVE(mceP->data+uioP->uio_offset, uioP->uio_resid, UIO_WRITE, uioP, code); - if (uioP->uio_offset > mceP->size) - mceP->size = uioP->uio_offset; - - MReleaseWriteLock(&mceP->afs_memLock); - return code; - } - -afs_MemCacheTruncate(mceP, size) - register struct memCacheEntry *mceP; - int size; - { - AFS_STATCNT(afs_MemCacheTruncate); - - MObtainWriteLock(&mceP->afs_memLock,313); - /* old directory entry; g.c. */ - if(size == 0 && mceP->dataSize > memCacheBlkSize) { - afs_osi_Free(mceP->data, mceP->dataSize); - mceP->data = afs_osi_Alloc(memCacheBlkSize); - mceP->dataSize = memCacheBlkSize; - } - - if (size < mceP->size) - mceP->size = size; - - MReleaseWriteLock(&mceP->afs_memLock); - return 0; - } - -afs_MemCacheStoreProc(acall, mceP, alen, avc, shouldWake, abytesToXferP, abytesXferredP) - register struct memCacheEntry *mceP; - register struct rx_call *acall; - register afs_int32 alen; - struct vcache *avc; - int *shouldWake; - afs_int32 *abytesToXferP; - afs_int32 *abytesXferredP; - - { - - register afs_int32 code; - register int tlen; - int offset = 0; - struct iovec *tiov; /* no data copying with iovec */ - int tnio; /* temp for iovec size */ - - AFS_STATCNT(afs_MemCacheStoreProc); +int +afs_MemWritevBlk(register struct memCacheEntry *mceP, int offset, + struct iovec *iov, int nio, int size) +{ + int i; + int bytesWritten; + int bytesToWrite; + AFS_STATCNT(afs_MemWriteBlk); + MObtainWriteLock(&mceP->afs_memLock, 561); + if (offset + size > mceP->dataSize) { + char *oldData = mceP->data; + + mceP->data = afs_osi_Alloc(size + offset); + + /* may overlap, but this is OK */ + AFS_GUNLOCK(); + memcpy(mceP->data, oldData, mceP->size); + AFS_GLOCK(); + afs_osi_Free(oldData, mceP->dataSize); + mceP->dataSize = size + offset; + } + AFS_GUNLOCK(); + if (mceP->size < offset) + memset(mceP->data + mceP->size, 0, offset - mceP->size); + for (bytesWritten = 0, i = 0; i < nio && size > 0; i++) { + bytesToWrite = (size < iov[i].iov_len) ? size : iov[i].iov_len; + memcpy(mceP->data + offset, iov[i].iov_base, bytesToWrite); + offset += bytesToWrite; + bytesWritten += bytesToWrite; + size -= bytesToWrite; + } + mceP->size = (offset < mceP->size) ? mceP->size : offset; + AFS_GLOCK(); + + MReleaseWriteLock(&mceP->afs_memLock); + return bytesWritten; +} + +int +afs_MemWriteUIO(ino_t blkno, struct uio *uioP) +{ + register struct memCacheEntry *mceP = + (struct memCacheEntry *)afs_MemCacheOpen(blkno); + afs_int32 code; + + AFS_STATCNT(afs_MemWriteUIO); + MObtainWriteLock(&mceP->afs_memLock, 312); + if (uioP->uio_resid + uioP->uio_offset > mceP->dataSize) { + char *oldData = mceP->data; + + mceP->data = afs_osi_Alloc(uioP->uio_resid + uioP->uio_offset); + + AFS_GUNLOCK(); + memcpy(mceP->data, oldData, mceP->size); + AFS_GLOCK(); + + afs_osi_Free(oldData, mceP->dataSize); + mceP->dataSize = uioP->uio_resid + uioP->uio_offset; + } + if (mceP->size < uioP->uio_offset) + memset(mceP->data + mceP->size, 0, + (int)(uioP->uio_offset - mceP->size)); + AFS_UIOMOVE(mceP->data + uioP->uio_offset, uioP->uio_resid, UIO_WRITE, + uioP, code); + if (uioP->uio_offset > mceP->size) + mceP->size = uioP->uio_offset; + + MReleaseWriteLock(&mceP->afs_memLock); + return code; +} + +int +afs_MemCacheTruncate(register struct memCacheEntry *mceP, int size) +{ + AFS_STATCNT(afs_MemCacheTruncate); + + MObtainWriteLock(&mceP->afs_memLock, 313); + /* old directory entry; g.c. */ + if (size == 0 && mceP->dataSize > memCacheBlkSize) { + afs_osi_Free(mceP->data, mceP->dataSize); + mceP->data = afs_osi_Alloc(memCacheBlkSize); + mceP->dataSize = memCacheBlkSize; + } + + if (size < mceP->size) + mceP->size = size; + + MReleaseWriteLock(&mceP->afs_memLock); + return 0; +} + +int +afs_MemCacheStoreProc(register struct rx_call *acall, + register struct memCacheEntry *mceP, + register afs_int32 alen, struct vcache *avc, + int *shouldWake, afs_size_t * abytesToXferP, + afs_size_t * abytesXferredP, afs_int32 length) +{ + + register afs_int32 code; + register int tlen; + int offset = 0; + struct iovec *tiov; /* no data copying with iovec */ + int tnio; /* temp for iovec size */ + + AFS_STATCNT(afs_MemCacheStoreProc); #ifndef AFS_NOSTATS - /* - * In this case, alen is *always* the amount of data we'll be trying - * to ship here. - */ - *(abytesToXferP) = alen; - *(abytesXferredP) = 0; + /* + * In this case, alen is *always* the amount of data we'll be trying + * to ship here. + */ + *(abytesToXferP) = alen; + *(abytesXferredP) = 0; #endif /* AFS_NOSTATS */ - /* - * We need to alloc the iovecs on the heap so that they are "pinned" rather than - * declare them on the stack - defect 11272 - */ - tiov = (struct iovec *) osi_AllocSmallSpace(sizeof(struct iovec)*RX_MAXIOVECS); - if(!tiov) { - osi_Panic("afs_MemCacheFetchProc: osi_AllocSmallSpace for iovecs returned NULL\n"); - } - + /* + * We need to alloc the iovecs on the heap so that they are "pinned" rather than + * declare them on the stack - defect 11272 + */ + tiov = + (struct iovec *)osi_AllocSmallSpace(sizeof(struct iovec) * + RX_MAXIOVECS); + if (!tiov) { + osi_Panic + ("afs_MemCacheStoreProc: osi_AllocSmallSpace for iovecs returned NULL\n"); + } #ifdef notdef /* do this at a higher level now -- it's a parameter */ - /* for now, only do 'continue from close' code if file fits in one - chunk. Could clearly do better: if only one modified chunk - then can still do this. can do this on *last* modified chunk */ - tlen = avc->m.Length-1; /* byte position of last byte we'll store */ - if (shouldWake) { - if (AFS_CHUNK(tlen) != 0) *shouldWake = 0; - else *shouldWake = 1; - } + /* for now, only do 'continue from close' code if file fits in one + * chunk. Could clearly do better: if only one modified chunk + * then can still do this. can do this on *last* modified chunk */ + tlen = avc->m.Length - 1; /* byte position of last byte we'll store */ + if (shouldWake) { + if (AFS_CHUNK(tlen) != 0) + *shouldWake = 0; + else + *shouldWake = 1; + } #endif /* notdef */ - while (alen > 0) { - tlen = (alen > AFS_LRALLOCSIZ? AFS_LRALLOCSIZ : alen); - code = rx_WritevAlloc(acall, tiov, &tnio, RX_MAXIOVECS, tlen); - if (code <= 0) { - osi_FreeSmallSpace(tiov); - return -33; - } - tlen = code; - code = afs_MemReadvBlk(mceP, offset, tiov, tnio, tlen); - if (code != tlen) { - osi_FreeSmallSpace(tiov); - return -33; - } - code = rx_Writev(acall, tiov, tnio, tlen); + while (alen > 0) { + tlen = (alen > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : alen); + RX_AFS_GUNLOCK(); + code = rx_WritevAlloc(acall, tiov, &tnio, RX_MAXIOVECS, tlen); + RX_AFS_GLOCK(); + if (code <= 0) { + osi_FreeSmallSpace(tiov); + return -33; + } + tlen = code; + code = afs_MemReadvBlk(mceP, offset, tiov, tnio, tlen); + if (code != tlen) { + osi_FreeSmallSpace(tiov); + return -33; + } + RX_AFS_GUNLOCK(); + code = rx_Writev(acall, tiov, tnio, tlen); + RX_AFS_GLOCK(); #ifndef AFS_NOSTATS - (*abytesXferredP) += code; + (*abytesXferredP) += code; #endif /* AFS_NOSTATS */ - if (code != tlen) { - osi_FreeSmallSpace(tiov); - return -33; - } - offset += tlen; - alen -= tlen; - /* if file has been locked on server, can allow store to continue */ - if (shouldWake && *shouldWake && (rx_GetRemoteStatus(acall) & 1)) { - *shouldWake = 0; /* only do this once */ - afs_wakeup(avc); - } - } - osi_FreeSmallSpace(tiov); - return 0; - } - -afs_MemCacheFetchProc(acall, mceP, abase, adc, avc, abytesToXferP, abytesXferredP) - register struct rx_call *acall; - afs_int32 abase; - struct dcache *adc; - struct vcache *avc; - register struct memCacheEntry *mceP; - afs_int32 *abytesToXferP; - afs_int32 *abytesXferredP; - - { - afs_int32 length; - register afs_int32 code; - register int tlen, offset=0; - int moredata; - struct iovec *tiov; /* no data copying with iovec */ - int tnio; /* temp for iovec size */ - - AFS_STATCNT(afs_MemCacheFetchProc); + if (code != tlen) { + osi_FreeSmallSpace(tiov); + return -33; + } + offset += tlen; + alen -= tlen; + /* if file has been locked on server, can allow store to continue */ + if (shouldWake && *shouldWake && (rx_GetRemoteStatus(acall) & 1)) { + *shouldWake = 0; /* only do this once */ + afs_wakeup(avc); + } + } + osi_FreeSmallSpace(tiov); + return 0; +} + +int +afs_MemCacheFetchProc(register struct rx_call *acall, + register struct memCacheEntry *mceP, afs_size_t abase, + struct dcache *adc, struct vcache *avc, + afs_size_t * abytesToXferP, afs_size_t * abytesXferredP, + afs_int32 lengthFound) +{ + register afs_int32 code; + afs_int32 length; + int moredata = 0; + struct iovec *tiov; /* no data copying with iovec */ + register int tlen, offset = 0; + int tnio; /* temp for iovec size */ + + AFS_STATCNT(afs_MemCacheFetchProc); + length = lengthFound; + afs_Trace4(afs_iclSetp, CM_TRACE_MEMFETCH, ICL_TYPE_POINTER, avc, + ICL_TYPE_POINTER, mceP, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(abase), ICL_TYPE_INT32, length); #ifndef AFS_NOSTATS - (*abytesToXferP) = 0; - (*abytesXferredP) = 0; + (*abytesToXferP) = 0; + (*abytesXferredP) = 0; #endif /* AFS_NOSTATS */ - /* - * We need to alloc the iovecs on the heap so that they are "pinned" rather than - * declare them on the stack - defect 11272 - */ - tiov = (struct iovec *) osi_AllocSmallSpace(sizeof(struct iovec)*RX_MAXIOVECS); - if(!tiov) { - osi_Panic("afs_MemCacheFetchProc: osi_AllocSmallSpace for iovecs returned NULL\n"); - } - do { - code = rx_Read(acall, (char *)&length, sizeof(afs_int32)); - if (code != sizeof(afs_int32)) { - code = rx_Error(acall); - osi_FreeSmallSpace(tiov); - return (code?code:-1); /* try to return code, not -1 */ - } - length = ntohl(length); - /* - * The fetch protocol is extended for the AFS/DFS translator - * to allow multiple blocks of data, each with its own length, - * to be returned. As long as the top bit is set, there are more - * blocks expected. - * - * We do not do this for AFS file servers because they sometimes - * return large negative numbers as the transfer size. - */ - if (avc->states & CForeign) { - moredata = length & 0x80000000; - length &= ~0x80000000; - } else { - moredata = 0; - } + /* + * We need to alloc the iovecs on the heap so that they are "pinned" rather than + * declare them on the stack - defect 11272 + */ + tiov = + (struct iovec *)osi_AllocSmallSpace(sizeof(struct iovec) * + RX_MAXIOVECS); + if (!tiov) { + osi_Panic + ("afs_MemCacheFetchProc: osi_AllocSmallSpace for iovecs returned NULL\n"); + } + adc->validPos = abase; + do { + if (moredata) { + RX_AFS_GUNLOCK(); + code = rx_Read(acall, (char *)&length, sizeof(afs_int32)); + length = ntohl(length); + RX_AFS_GLOCK(); + if (code != sizeof(afs_int32)) { + code = rx_Error(acall); + osi_FreeSmallSpace(tiov); + return (code ? code : -1); /* try to return code, not -1 */ + } + } + /* + * The fetch protocol is extended for the AFS/DFS translator + * to allow multiple blocks of data, each with its own length, + * to be returned. As long as the top bit is set, there are more + * blocks expected. + * + * We do not do this for AFS file servers because they sometimes + * return large negative numbers as the transfer size. + */ + if (avc->states & CForeign) { + moredata = length & 0x80000000; + length &= ~0x80000000; + } else { + moredata = 0; + } #ifndef AFS_NOSTATS - (*abytesToXferP) += length; -#endif /* AFS_NOSTATS */ - while (length > 0) { - tlen = (length > AFS_LRALLOCSIZ? AFS_LRALLOCSIZ : length); - code = rx_Readv(acall, tiov, &tnio, RX_MAXIOVECS, tlen); + (*abytesToXferP) += length; +#endif /* AFS_NOSTATS */ + while (length > 0) { + tlen = (length > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : length); + RX_AFS_GUNLOCK(); + code = rx_Readv(acall, tiov, &tnio, RX_MAXIOVECS, tlen); + RX_AFS_GLOCK(); #ifndef AFS_NOSTATS - (*abytesXferredP) += code; -#endif /* AFS_NOSTATS */ - if (code <= 0) { - osi_FreeSmallSpace(tiov); - return -34; - } - tlen = code; - afs_MemWritevBlk(mceP, offset, tiov, tnio, tlen); - offset += tlen; - abase += tlen; - length -= tlen; - adc->validPos = abase; - if (adc->flags & DFWaiting) { - adc->flags &= ~DFWaiting; - afs_osi_Wakeup(&adc->validPos); - } - } - } while (moredata); - /* max of two sizes */ - osi_FreeSmallSpace(tiov); - return 0; - } - - -void shutdown_memcache() + (*abytesXferredP) += code; +#endif /* AFS_NOSTATS */ + if (code <= 0) { + afs_Trace3(afs_iclSetp, CM_TRACE_FETCH64READ, + ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, code, + ICL_TYPE_INT32, length); + osi_FreeSmallSpace(tiov); + return -34; + } + tlen = code; + afs_MemWritevBlk(mceP, offset, tiov, tnio, tlen); + offset += tlen; + abase += tlen; + length -= tlen; + adc->validPos = abase; + if (afs_osi_Wakeup(&adc->validPos) == 0) + afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAKE, ICL_TYPE_STRING, + __FILE__, ICL_TYPE_INT32, __LINE__, + ICL_TYPE_POINTER, adc, ICL_TYPE_INT32, + adc->dflags); + } + } while (moredata); + /* max of two sizes */ + osi_FreeSmallSpace(tiov); + return 0; +} + + +void +shutdown_memcache(void) { register int index; @@ -511,9 +513,10 @@ void shutdown_memcache() return; memCacheBlkSize = 8192; for (index = 0; index < memMaxBlkNumber; index++) { - LOCK_INIT(&((memCache+index)->afs_memLock), "afs_memLock"); - afs_osi_Free((memCache+index)->data, (memCache+index)->dataSize); + LOCK_INIT(&((memCache + index)->afs_memLock), "afs_memLock"); + afs_osi_Free((memCache + index)->data, (memCache + index)->dataSize); } - afs_osi_Free((char *)memCache, memMaxBlkNumber * sizeof(struct memCacheEntry)); + afs_osi_Free((char *)memCache, + memMaxBlkNumber * sizeof(struct memCacheEntry)); memMaxBlkNumber = 0; } diff --git a/src/afs/afs_nfsclnt.c b/src/afs/afs_nfsclnt.c index 3d240a712..23ae86880 100644 --- a/src/afs/afs_nfsclnt.c +++ b/src/afs/afs_nfsclnt.c @@ -8,16 +8,17 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_nfsclnt.c,v 1.1.1.6 2002/09/26 18:57:52 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_nfsclnt.c,v 1.12 2004/03/17 06:43:34 shadow Exp $"); #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV) #ifndef AFS_DEC_ENV -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/nfsclient.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/nfsclient.h" int afs_nfsclient_reqhandler(), afs_nfsclient_hold(), afs_PutNfsClientPag(); int afs_nfsclient_sysname(), afs_nfsclient_GC(), afs_nfsclient_stats(); @@ -29,20 +30,21 @@ int afs_allnfsreqs, afs_nfscalls; struct exporterops nfs_exportops = { afs_nfsclient_reqhandler, afs_nfsclient_hold, - afs_PutNfsClientPag, /* Used to be afs_nfsclient_rele */ + afs_PutNfsClientPag, /* Used to be afs_nfsclient_rele */ afs_nfsclient_sysname, afs_nfsclient_GC, afs_nfsclient_stats, }; -struct nfsclientpag *afs_nfspags[NNFSCLIENTS]; -afs_lock_t afs_xnfspag /*, afs_xnfsreq */; -extern struct afs_exporter *afs_nfsexporter; +struct nfsclientpag *afs_nfspags[NNFSCLIENTS]; +afs_lock_t afs_xnfspag /*, afs_xnfsreq */ ; +extern struct afs_exporter *afs_nfsexporter; /* Creates an nfsclientpag structure for the (uid, host) pair if one doesn't exist. RefCount is incremented and it's time stamped. */ -static struct nfsclientpag *afs_GetNfsClientPag(uid, host) -register afs_int32 uid, host; +static struct nfsclientpag * +afs_GetNfsClientPag(uid, host) + register afs_int32 uid, host; { register struct nfsclientpag *np; register afs_int32 i, now; @@ -53,7 +55,7 @@ register afs_int32 uid, host; AFS_STATCNT(afs_GetNfsClientPag); i = NHash(host); now = osi_Time(); - MObtainWriteLock(&afs_xnfspag,314); + MObtainWriteLock(&afs_xnfspag, 314); for (np = afs_nfspags[i]; np; np = np->next) { if (np->uid == uid && np->host == host) { np->refCount++; @@ -71,7 +73,7 @@ register afs_int32 uid, host; return np; } } - np = (struct nfsclientpag *) afs_osi_Alloc(sizeof (struct nfsclientpag)); + np = (struct nfsclientpag *)afs_osi_Alloc(sizeof(struct nfsclientpag)); memset((char *)np, 0, sizeof(struct nfsclientpag)); /* Copy the necessary afs_exporter fields */ memcpy((char *)np, (char *)afs_nfsexporter, sizeof(struct afs_exporter)); @@ -88,8 +90,9 @@ register afs_int32 uid, host; /* Decrement refCount; must always match a previous afs_FindNfsClientPag/afs_GetNfsClientPag call . It's also called whenever a unixuser structure belonging to the remote user associated with the nfsclientpag structure, np, is garbage collected. */ -int afs_PutNfsClientPag(np) -register struct nfsclientpag *np; +int +afs_PutNfsClientPag(np) + register struct nfsclientpag *np; { #if defined(AFS_SGIMP_ENV) osi_Assert(ISAFS_GLOCK()); @@ -100,8 +103,9 @@ register struct nfsclientpag *np; /* Return the nfsclientpag structure associated with the (uid, host) or {pag, host} pair, if pag is nonzero. RefCount is incremented and it's time stamped. */ -static struct nfsclientpag *afs_FindNfsClientPag(uid, host, pag) -register afs_int32 uid, host, pag; +static struct nfsclientpag * +afs_FindNfsClientPag(uid, host, pag) + register afs_int32 uid, host, pag; { register struct nfsclientpag *np; register afs_int32 i; @@ -111,30 +115,30 @@ register afs_int32 uid, host, pag; #endif AFS_STATCNT(afs_FindNfsClientPag); i = NHash(host); - MObtainWriteLock(&afs_xnfspag,315); + MObtainWriteLock(&afs_xnfspag, 315); for (np = afs_nfspags[i]; np; np = np->next) { if (np->host == host) { - if ((pag && pag == np->pag) || (!pag && (uid == np->uid))) { - np->refCount++; - np->lastcall = osi_Time(); - MReleaseWriteLock(&afs_xnfspag); - return np; - } + if ((pag && pag == np->pag) || (!pag && (uid == np->uid))) { + np->refCount++; + np->lastcall = osi_Time(); + MReleaseWriteLock(&afs_xnfspag); + return np; + } } } /* still not there, try looking for a wildcard dude */ for (np = afs_nfspags[i]; np; np = np->next) { if (np->host == host) { - if (np->uid == NOPAG) { - np->refCount++; - np->lastcall = osi_Time(); - MReleaseWriteLock(&afs_xnfspag); - return np; - } + if (np->uid == NOPAG) { + np->refCount++; + np->lastcall = osi_Time(); + MReleaseWriteLock(&afs_xnfspag); + return np; + } } } MReleaseWriteLock(&afs_xnfspag); - return (struct nfsclientpag *) 0; + return NULL; } @@ -143,7 +147,8 @@ register afs_int32 uid, host, pag; */ struct afs_exporter *afs_nfsexported = 0; static afs_int32 init_nfsexporter = 0; -afs_nfsclient_init() { +afs_nfsclient_init() +{ #if defined(AFS_SGIMP_ENV) osi_Assert(ISAFS_GLOCK()); #endif @@ -152,7 +157,8 @@ afs_nfsclient_init() { init_nfsexporter = 1; LOCK_INIT(&afs_xnfspag, "afs_xnfspag"); - afs_nfsexported = exporter_add(0, &nfs_exportops, EXP_EXPORTED, EXP_NFS, (char *)0); + afs_nfsexported = + exporter_add(0, &nfs_exportops, EXP_EXPORTED, EXP_NFS, NULL); } } @@ -160,11 +166,12 @@ afs_nfsclient_init() { /* Main handler routine for the NFS exporter. It's called in the early * phases of any remote call (via the NFS server or pioctl). */ -int afs_nfsclient_reqhandler(exporter, cred, host, pagparam, outexporter) -register struct afs_exporter *exporter, **outexporter; -struct AFS_UCRED **cred; -register afs_int32 host; -afs_int32 *pagparam; +int +afs_nfsclient_reqhandler(exporter, cred, host, pagparam, outexporter) + register struct afs_exporter *exporter, **outexporter; + struct AFS_UCRED **cred; + register afs_int32 host; + afs_int32 *pagparam; { register struct nfsclientpag *np, *tnp; extern struct unixuser *afs_FindUser(), *afs_GetUser(); @@ -173,8 +180,9 @@ afs_int32 *pagparam; AFS_ASSERT_GLOCK(); AFS_STATCNT(afs_nfsclient_reqhandler); - if (!afs_nfsexporter) afs_nfsexporter = afs_nfsexported; - + if (!afs_nfsexporter) + afs_nfsexporter = afs_nfsexported; + afs_nfsexporter->exp_stats.calls++; if (!(afs_nfsexporter->exp_states & EXP_EXPORTED)) { /* No afs requests accepted as long as EXPORTED flag is turned 'off'. Set/Reset via a pioctl call (fs exportafs). Note that this is on top of the /etc/exports nfs requirement (i.e. /afs must be exported to all or whomever there too!) @@ -187,15 +195,15 @@ afs_int32 *pagparam; if (pag != NOPAG) { /* Do some minimal pag verification */ if (pag > getpag()) { - pag = NOPAG; /* treat it as not paged since couldn't be good */ + pag = NOPAG; /* treat it as not paged since couldn't be good */ } else { if (au = afs_FindUser(pag, -1, READ_LOCK)) { if (!au->exporter) { pag = NOPAG; afs_PutUser(au, READ_LOCK); - au = (struct unixuser *)0; + au = NULL; } - } else + } else pag = NOPAG; /* No unixuser struct so pag not trusted */ } } @@ -210,9 +218,10 @@ afs_int32 *pagparam; #else if (code = setpag(cred, -1, &pag, 1)) { #endif - if (au) afs_PutUser(au, READ_LOCK); + if (au) + afs_PutUser(au, READ_LOCK); /* ReleaseWriteLock(&afs_xnfsreq); */ -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) +#if defined(KERNEL_HAVE_UERROR) setuerror(code); #endif return (code); @@ -228,14 +237,15 @@ afs_int32 *pagparam; #endif afs_PutNfsClientPag(np); /* ReleaseWriteLock(&afs_xnfsreq); */ -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) +#if defined(KERNEL_HAVE_UERROR) setuerror(code); #endif return (code); } - } else if (au->exporter && ((struct afs_exporter *)np != au->exporter)) { + } else if (au->exporter + && ((struct afs_exporter *)np != au->exporter)) { tnp = (struct nfsclientpag *)au->exporter; - if (tnp->uid && (tnp->uid != (afs_int32)-2)) { /* allow "root" initiators */ + if (tnp->uid && (tnp->uid != (afs_int32) - 2)) { /* allow "root" initiators */ /* Pag doesn't belong to caller; treat it as an unpaged call too */ #ifdef AFS_OSF_ENV if (code = setpag(u.u_procp, cred, np->pag, &pag, 1)) { /* XXX u.u_procp is a no-op XXX */ @@ -244,8 +254,8 @@ afs_int32 *pagparam; #endif afs_PutNfsClientPag(np); afs_PutUser(au, READ_LOCK); - /* ReleaseWriteLock(&afs_xnfsreq); */ -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) + /* ReleaseWriteLock(&afs_xnfsreq); */ +#if defined(KERNEL_HAVE_UERROR) setuerror(code); #endif return (code); @@ -254,7 +264,8 @@ afs_int32 *pagparam; } } } - if (au) afs_PutUser(au, READ_LOCK); + if (au) + afs_PutUser(au, READ_LOCK); au = afs_GetUser(pag, -1, WRITE_LOCK); if (!(au->exporter)) { /* Created new unixuser struct */ np->refCount++; /* so it won't disappear */ @@ -264,9 +275,9 @@ afs_int32 *pagparam; *outexporter = (struct afs_exporter *)np; afs_PutUser(au, WRITE_LOCK); #ifdef AFS_OSF_ENV - (*cred)->cr_ruid = NFSXLATOR_CRED; /* Identify it as nfs xlator call */ + (*cred)->cr_ruid = NFSXLATOR_CRED; /* Identify it as nfs xlator call */ #else - (*cred)->cr_rgid = NFSXLATOR_CRED; /* Identify it as nfs xlator call */ + (*cred)->cr_rgid = NFSXLATOR_CRED; /* Identify it as nfs xlator call */ #endif /* ReleaseWriteLock(&afs_xnfsreq); */ return 0; @@ -274,8 +285,9 @@ afs_int32 *pagparam; /* It's called whenever a new unixuser structure is created for the remote user associated with the nfsclientpag structure, np */ -int afs_nfsclient_hold(np) -register struct nfsclientpag *np; +int +afs_nfsclient_hold(np) + register struct nfsclientpag *np; { #if defined(AFS_SGIMP_ENV) osi_Assert(ISAFS_GLOCK()); @@ -286,31 +298,46 @@ register struct nfsclientpag *np; /* if inname is non-null, a new system name value is set for the remote user (inname contains the new sysname). In all cases, outname returns the current sysname value for this remote user */ -int afs_nfsclient_sysname(np, inname, outname) -register struct nfsclientpag *np; -char *inname, *outname; +int +afs_nfsclient_sysname(register struct nfsclientpag *np, char *inname, + char **outname[], int *num) { + char *cp; + int count, t; #if defined(AFS_SGIMP_ENV) osi_Assert(ISAFS_GLOCK()); #endif AFS_STATCNT(afs_nfsclient_sysname); if (inname) { - if (!np->sysname) { - np->sysname = afs_osi_Alloc(MAXSYSNAME); + if (np->sysname) { + for(count=0; count < np->sysnamecount;++count) { + afs_osi_Free(np->sysname[count], MAXSYSNAME); + } + } + for(count=0; count < *num;++count) { + np->sysname[count]= afs_osi_Alloc(MAXSYSNAME); } - strcpy(np->sysname, inname); + cp = inname; + for(count=0; count < *num;++count) { + t = strlen(cp); + memcpy(np->sysname[count], cp, t+1); /* include null */ + cp += t+1; + } + np->sysnamecount = *num; } else if (!np->sysname) { - return ENODEV; /* XXX */ + return ENODEV; /* XXX */ } - strcpy(outname, np->sysname); + *outname = np->sysname; + *num = np->sysnamecount; return 0; } /* Garbage collect routine for the nfs exporter. When pag is -1 then all entries are removed (used by the nfsclient_shutdown routine); else if it's non zero then only the entry with that pag is removed, else all "timedout" entries are removed. TimedOut entries are those who have no "unixuser" structures associated with them (i.e. unixusercnt == 0) and they haven't had any activity the last NFSCLIENTGC seconds */ -int afs_nfsclient_GC(exporter, pag) -register struct afs_exporter *exporter; -register afs_int32 pag; +int +afs_nfsclient_GC(exporter, pag) + register struct afs_exporter *exporter; + register afs_int32 pag; { register struct nfsclientpag *np, **tnp, *nnp; register afs_int32 i, delflag; @@ -319,17 +346,19 @@ register afs_int32 pag; osi_Assert(ISAFS_GLOCK()); #endif AFS_STATCNT(afs_nfsclient_GC); - MObtainWriteLock(&afs_xnfspag,316); + MObtainWriteLock(&afs_xnfspag, 316); for (i = 0; i < NNFSCLIENTS; i++) { for (tnp = &afs_nfspags[i], np = *tnp; np; np = nnp) { nnp = np->next; delflag = 0; if (np->refCount == 0 && np->lastcall < osi_Time() - NFSCLIENTGC) delflag = 1; - if ((pag == -1) || (!pag && delflag) || (pag && (np->refCount == 0) && (np->pag == pag))) { + if ((pag == -1) || (!pag && delflag) + || (pag && (np->refCount == 0) && (np->pag == pag))) { *tnp = np->next; - if (np->sysname) afs_osi_Free(np->sysname, MAXSYSNAME); - afs_osi_Free(np, sizeof(struct nfsclientpag)); + if (np->sysname) + afs_osi_Free(np->sysname, MAXSYSNAME); + afs_osi_Free(np, sizeof(struct nfsclientpag)); } else { tnp = &np->next; } @@ -339,8 +368,9 @@ register afs_int32 pag; } -int afs_nfsclient_stats(export) -register struct afs_exporter *export; +int +afs_nfsclient_stats(export) + register struct afs_exporter *export; { /* Nothing much to do here yet since most important stats are collected directly in the afs_exporter structure itself */ AFS_STATCNT(afs_nfsclient_stats); @@ -359,37 +389,39 @@ char *afs_nfs_id = "AFSNFSTRANS"; /* afs_iauth_verify is the AFS authenticator for NFS. * * always returns 0. - */ -int afs_iauth_verify(long id, fsid_t *fsidp, long host, - int uid, struct AFS_UCRED *credp, struct exportinfo *exp) + */ +int +afs_iauth_verify(long id, fsid_t * fsidp, long host, int uid, + struct AFS_UCRED *credp, struct exportinfo *exp) { int code; struct nfsclientpag *nfs_pag; afs_int32 dummypag; struct afs_exporter *outexporter = 0; - + /* Still needs basic test to see if exporter is on. And need to check the * whole no submounts bit. */ if (id != (long)id) - return 0; /* not us. */ + return 0; /* not us. */ /* Only care if it's AFS */ if ((fsidp->val[0] != AFS_VFSMAGIC) || (fsidp->val[1] != AFS_VFSFSID)) { - return 0; + return 0; } AFS_GLOCK(); - code = afs_nfsclient_reqhandler((struct afs_exporter *)0, &credp, - host, &dummypag, &outexporter); + code = + afs_nfsclient_reqhandler((struct afs_exporter *)0, &credp, host, + &dummypag, &outexporter); if (!code && outexporter) EXP_RELE(outexporter); if (code) { /* ensure anonymous cred. */ - credp->cr_uid = credp->cr_ruid = (uid_t)-2; /* anonymous */ + credp->cr_uid = credp->cr_ruid = (uid_t) - 2; /* anonymous */ } /* Mark this thread as an NFS translator thread. */ @@ -402,7 +434,8 @@ int afs_iauth_verify(long id, fsid_t *fsidp, long host, /* afs_iauth_register - register the iauth verify routine. Returns 0 on success * and -1 on failure. Can fail because DFS has already registered. */ -int afs_iauth_register() +int +afs_iauth_register() { if (nfs_iauth_register((unsigned long)afs_nfs_id, afs_iauth_verify)) return -1; @@ -414,7 +447,8 @@ int afs_iauth_register() /* afs_iauth_unregister - unregister the iauth verify routine. Called on shutdown. */ -void afs_iauth_unregister() +void +afs_iauth_unregister() { if (afs_iauth_initd) nfs_iauth_unregister((unsigned long)afs_nfs_id); @@ -424,7 +458,8 @@ void afs_iauth_unregister() -shutdown_nfsclnt() { +shutdown_nfsclnt() +{ #if 0 extern int afs_allnfsreqs, afs_nfscalls; #endif @@ -432,7 +467,7 @@ shutdown_nfsclnt() { #if defined(AFS_SGIMP_ENV) osi_Assert(ISAFS_GLOCK()); #endif - AFS_STATCNT(afs_nfsclient_shutdown); + AFS_STATCNT(afs_nfsclient_shutdown); #ifdef AFS_AIX_IAUTH_ENV afs_iauth_register(); #endif @@ -445,4 +480,3 @@ shutdown_nfsclnt() { } #endif /* AFS_DEC_ENV */ #endif /* AFS_NONFSTRANS */ - diff --git a/src/afs/afs_nfsdisp.c b/src/afs/afs_nfsdisp.c index 5dcbee60c..b4e93b47b 100644 --- a/src/afs/afs_nfsdisp.c +++ b/src/afs/afs_nfsdisp.c @@ -8,54 +8,55 @@ * Implements: */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_nfsdisp.c,v 1.1.1.6 2003/04/13 19:02:36 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_nfsdisp.c,v 1.18 2003/07/15 23:14:12 shadow Exp $"); /* Ugly Ugly Ugly but precludes conflicting XDR macros; We want kernel xdr */ #define __XDR_INCLUDE__ -#include "../afs/stds.h" -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#if defined(AFS_SUN55_ENV) && !defined(AFS_NONFSTRANS) -#include "../rpc/types.h" -#include "../rpc/auth.h" -#include "../rpc/auth_unix.h" -#include "../rpc/auth_des.h" +#include "afs/stds.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#if defined(AFS_SUN55_ENV) && !defined(AFS_NONFSTRANS) +#include "rpc/types.h" +#include "rpc/auth.h" +#include "rpc/auth_unix.h" +#include "rpc/auth_des.h" #if !defined(AFS_SUN58_ENV) -#include "../rpc/auth_kerb.h" +#include "rpc/auth_kerb.h" #endif -#include "../sys/tiuser.h" -#include "../rpc/xdr.h" -#include "../rpc/svc.h" -#include "../nfs/nfs.h" -#include "../nfs/export.h" -#include "../nfs/nfs_clnt.h" -#include "../nfs/nfs_acl.h" -#include "../afs/afsincludes.h" -#include "../afs/afs_stats.h" -#include "../afs/exporter.h" - -static int xlatorinit_v2_done=0; -static int xlatorinit_v3_done=0; +#include "sys/tiuser.h" +#include "rpc/xdr.h" +#include "rpc/svc.h" +#include "nfs/nfs.h" +#include "nfs/export.h" +#include "nfs/nfs_clnt.h" +#include "nfs/nfs_acl.h" +#include "afs/afsincludes.h" +#include "afs/afs_stats.h" +#include "afs/exporter.h" + +static int xlatorinit_v2_done = 0; +static int xlatorinit_v3_done = 0; extern int afs_nobody; extern int afs_NFSRootOnly; struct rfs_disp_tbl { - void (*dis_proc)(); + void (*dis_proc) (); xdrproc_t dis_xdrargs; xdrproc_t dis_fastxdrargs; - int dis_argsz; - xdrproc_t dis_xdrres; - xdrproc_t dis_fastxdrres; - int dis_ressz; - void (*dis_resfree)(); - int dis_flags; - fhandle_t (*dis_getfh)(); + int dis_argsz; + xdrproc_t dis_xdrres; + xdrproc_t dis_fastxdrres; + int dis_ressz; + void (*dis_resfree) (); + int dis_flags; + fhandle_t(*dis_getfh) (); }; struct afs_nfs_disp_tbl { - void (*afs_proc)(); - void (*orig_proc)(); + void (*afs_proc) (); + void (*orig_proc) (); }; struct afs_nfs2_resp { enum nfsstat status; @@ -68,106 +69,109 @@ struct afs_nfs_disp_tbl afs_rfs_disp_tbl[RFS_NPROC]; struct afs_nfs_disp_tbl afs_acl_disp_tbl[ACL2_NPROC]; static int -is_afs_fh(fhandle_t *fhp) { - if ((fhp->fh_fsid.val[0] == AFS_VFSMAGIC) && - (fhp->fh_fsid.val[1] == AFS_VFSFSID)) +is_afs_fh(fhandle_t * fhp) +{ + if ((fhp->fh_fsid.val[0] == AFS_VFSMAGIC) + && (fhp->fh_fsid.val[1] == AFS_VFSFSID)) return 1; return 0; } afs_int32 -nfs2_to_afs_call(int which, caddr_t *args, fhandle_t **fhpp, fhandle_t **fh2pp) +nfs2_to_afs_call(int which, caddr_t * args, fhandle_t ** fhpp, + fhandle_t ** fh2pp) { struct vnode *vp; - fhandle_t *fhp1=0; - fhandle_t *fhp2=0; + fhandle_t *fhp1 = 0; + fhandle_t *fhp2 = 0; int errorcode; - - *fh2pp = (fhandle_t *)0; + + afs_Trace1(afs_iclSetp, CM_TRACE_NFSIN, ICL_TYPE_INT32, which); + *fh2pp = (fhandle_t *) 0; switch (which) { case RFS_GETATTR: case RFS_READLINK: case RFS_STATFS: - fhp1 = (fhandle_t *)args; + fhp1 = (fhandle_t *) args; break; case RFS_SETATTR: - { - struct nfssaargs *sargs = (struct nfssaargs *)args; - fhp1 = (fhandle_t *)&sargs->saa_fh; - break; - } + { + struct nfssaargs *sargs = (struct nfssaargs *)args; + fhp1 = (fhandle_t *) & sargs->saa_fh; + break; + } case RFS_LOOKUP: - { - struct nfsdiropargs *sargs = (struct nfsdiropargs *)args; - fhp1 = sargs->da_fhandle; - break; - } + { + struct nfsdiropargs *sargs = (struct nfsdiropargs *)args; + fhp1 = sargs->da_fhandle; + break; + } case RFS_READ: - { - struct nfsreadargs *sargs = (struct nfsreadargs *)args; - fhp1 = (fhandle_t *)&sargs->ra_fhandle; - break; - } + { + struct nfsreadargs *sargs = (struct nfsreadargs *)args; + fhp1 = (fhandle_t *) & sargs->ra_fhandle; + break; + } case RFS_WRITE: - { - struct nfswriteargs *sargs = (struct nfswriteargs *)args; - fhp1 = (fhandle_t *)&sargs->wa_fhandle; - break; - } + { + struct nfswriteargs *sargs = (struct nfswriteargs *)args; + fhp1 = (fhandle_t *) & sargs->wa_fhandle; + break; + } case RFS_CREATE: - { - struct nfscreatargs *sargs = (struct nfscreatargs *)args; - fhp1 = sargs->ca_da.da_fhandle; - break; - } + { + struct nfscreatargs *sargs = (struct nfscreatargs *)args; + fhp1 = sargs->ca_da.da_fhandle; + break; + } case RFS_REMOVE: - { - struct nfsdiropargs *sargs = (struct nfsdiropargs *)args; - fhp1 = sargs->da_fhandle; - break; - } + { + struct nfsdiropargs *sargs = (struct nfsdiropargs *)args; + fhp1 = sargs->da_fhandle; + break; + } case RFS_RENAME: - { - struct nfsrnmargs *sargs = (struct nfsrnmargs *)args; - fhp1 = sargs->rna_from.da_fhandle; - fhp2 = sargs->rna_to.da_fhandle; - break; - } + { + struct nfsrnmargs *sargs = (struct nfsrnmargs *)args; + fhp1 = sargs->rna_from.da_fhandle; + fhp2 = sargs->rna_to.da_fhandle; + break; + } case RFS_LINK: - { - struct nfslinkargs *sargs = (struct nfslinkargs *)args; - fhp1 = sargs->la_from; - fhp2 = sargs->la_to.da_fhandle; - break; - } + { + struct nfslinkargs *sargs = (struct nfslinkargs *)args; + fhp1 = sargs->la_from; + fhp2 = sargs->la_to.da_fhandle; + break; + } case RFS_SYMLINK: - { - struct nfsslargs *sargs = (struct nfsslargs *)args; - fhp1 = sargs->sla_from.da_fhandle; - break; - } + { + struct nfsslargs *sargs = (struct nfsslargs *)args; + fhp1 = sargs->sla_from.da_fhandle; + break; + } case RFS_MKDIR: - { - struct nfscreatargs *sargs = (struct nfscreatargs *)args; - fhp1 = sargs->ca_da.da_fhandle; - break; - } + { + struct nfscreatargs *sargs = (struct nfscreatargs *)args; + fhp1 = sargs->ca_da.da_fhandle; + break; + } case RFS_RMDIR: - { - struct nfsdiropargs *sargs = (struct nfsdiropargs *)args; - fhp1 = sargs->da_fhandle; - break; - } + { + struct nfsdiropargs *sargs = (struct nfsdiropargs *)args; + fhp1 = sargs->da_fhandle; + break; + } case RFS_READDIR: - { - struct nfsrddirargs *sargs = (struct nfsrddirargs *)args; - fhp1 = (fhandle_t *)&sargs->rda_fh; - break; - } + { + struct nfsrddirargs *sargs = (struct nfsrddirargs *)args; + fhp1 = (fhandle_t *) & sargs->rda_fh; + break; + } default: return NULL; } - + /* Ok if arg 1 is in AFS or if 2 args and arg 2 is in AFS */ if (is_afs_fh(fhp1)) { *fhpp = fhp1; @@ -184,70 +188,70 @@ nfs2_to_afs_call(int which, caddr_t *args, fhandle_t **fhpp, fhandle_t **fh2pp) } afs_int32 -acl2_to_afs_call(int which, caddr_t *args, fhandle_t **fhpp) +acl2_to_afs_call(int which, caddr_t * args, fhandle_t ** fhpp) { fhandle_t *fhp; - - switch(which) { + + switch (which) { case ACLPROC2_NULL: - { - return NULL; - } + { + return NULL; + } case ACLPROC2_GETACL: - { - struct GETACL2args *sargs = (struct GETACL2args *) args; - fhp = &sargs->fh; - break; - } + { + struct GETACL2args *sargs = (struct GETACL2args *)args; + fhp = &sargs->fh; + break; + } case ACLPROC2_SETACL: - { - struct SETACL2args *sargs = (struct SETACL2args *) args; - fhp = &sargs->fh; - break; - } + { + struct SETACL2args *sargs = (struct SETACL2args *)args; + fhp = &sargs->fh; + break; + } case ACLPROC2_GETATTR: - { - struct GETATTR2args *sargs = (struct GETATTR2args *) args; - fhp = &sargs->fh; - break; - } + { + struct GETATTR2args *sargs = (struct GETATTR2args *)args; + fhp = &sargs->fh; + break; + } case ACLPROC2_ACCESS: - { - struct ACCESS2args *sargs = (struct ACCESS2args *) args; - fhp = &sargs->fh; - break; - } + { + struct ACCESS2args *sargs = (struct ACCESS2args *)args; + fhp = &sargs->fh; + break; + } default: return NULL; } - + if (is_afs_fh(fhp)) { *fhpp = fhp; return 1; } - + return NULL; } int afs_nfs2_dispatcher(int type, afs_int32 which, char *argp, - struct exportinfo **expp, - struct svc_req *rp, struct AFS_UCRED *crp) + struct exportinfo **expp, struct svc_req *rp, + struct AFS_UCRED *crp) { afs_int32 call = 0; afs_int32 code = 0; afs_int32 client = 0; struct sockaddr *sa; - fhandle_t *fh = (fhandle_t *)argp; - fhandle_t *fh2 = (fhandle_t *)0; - + fhandle_t *fh = (fhandle_t *) argp; + fhandle_t *fh2 = (fhandle_t *) 0; + if (!xlatorinit_v2_done) return 2; - + sa = (struct sockaddr *)svc_getrpccaller(rp->rq_xprt)->buf; if (sa->sa_family == AF_INET) client = ((struct sockaddr_in *)sa)->sin_addr.s_addr; - + AFS_GLOCK(); code = 0; switch (type) { @@ -260,17 +264,16 @@ afs_nfs2_dispatcher(int type, afs_int32 which, char *argp, default: break; } - + if (code) { struct afs_exporter *out = 0; afs_int32 dummy; static int once = 0; struct SmallFid Sfid; - + memcpy((char *)&Sfid, fh->fh_data, SIZEOF_SMALLFID); - - afs_Trace2(afs_iclSetp, CM_TRACE_NFSIN1, - ICL_TYPE_POINTER, client, + + afs_Trace2(afs_iclSetp, CM_TRACE_NFSIN1, ICL_TYPE_POINTER, client, ICL_TYPE_FID, &Sfid); /* We ran */ @@ -279,16 +282,17 @@ afs_nfs2_dispatcher(int type, afs_int32 which, char *argp, afs_nobody = (*expp)->exi_export.ex_anon; once = 1; } - code = afs_nfsclient_reqhandler((struct afs_exporter *)0, &crp, - client, &dummy, &out); - + code = + afs_nfsclient_reqhandler((struct afs_exporter *)0, &crp, client, + &dummy, &out); + if (!code && out) EXP_RELE(out); - + if (code == EINVAL) call = 2; } - + AFS_GUNLOCK(); return call; } @@ -296,41 +300,40 @@ afs_nfs2_dispatcher(int type, afs_int32 which, char *argp, void afs_nfs2_smallfidder(struct nfsdiropres *dr) { - register fhandle_t *fhp = (fhandle_t *)&dr->dr_fhandle; + register fhandle_t *fhp = (fhandle_t *) & dr->dr_fhandle; afs_int32 addr[2]; struct vcache *vcp; - + #if defined(AFS_SUN57_64BIT_ENV) - /* See also afs_fid() */ + /* See also afs_fid() */ memcpy((char *)addr, fhp->fh_data, SIZEOF_SMALLFID); addr[1] = (addr[1] >> 48) & 0xffff; -#else +#else memcpy((char *)addr, fhp->fh_data, 2 * sizeof(long)); #endif - + AFS_GLOCK(); - vcp = VTOAFS((struct vnode*)addr[0]); - - if (addr[1] == AFS_XLATOR_MAGIC) - { + vcp = VTOAFS((struct vnode *)addr[0]); + + if (addr[1] == AFS_XLATOR_MAGIC) { if (dr->dr_status == NFS_OK) { struct SmallFid Sfid; struct cell *tcell; - + /* Make up and copy out a SmallFid */ tcell = afs_GetCell(vcp->fid.Cell, READ_LOCK); Sfid.Volume = vcp->fid.Fid.Volume; - Sfid.CellAndUnique = ((tcell->cellIndex << 24) | - (vcp->fid.Fid.Unique & 0xffffff)); + Sfid.CellAndUnique = + ((tcell->cellIndex << 24) | (vcp->fid.Fid.Unique & 0xffffff)); afs_PutCell(tcell, READ_LOCK); - Sfid.Vnode = (u_short)(vcp->fid.Fid.Vnode & 0xffff); + Sfid.Vnode = (u_short) (vcp->fid.Fid.Vnode & 0xffff); fhp->fh_len = SIZEOF_SMALLFID; - memcpy(dr->dr_fhandle.fh_data, (char*)&Sfid, fhp->fh_len); + memcpy(dr->dr_fhandle.fh_data, (char *)&Sfid, fhp->fh_len); afs_Trace3(afs_iclSetp, CM_TRACE_NFSOUT, ICL_TYPE_INT32, 0, - ICL_TYPE_POINTER, vcp, ICL_TYPE_FID, &Sfid); + ICL_TYPE_POINTER, vcp, ICL_TYPE_FID, &Sfid); } - + /* If we have a ref, release it */ if (vcp->vrefCount >= 1) AFS_RELE(AFSTOV(vcp)); @@ -344,7 +347,8 @@ afs_nfs2_noaccess(struct afs_nfs2_resp *resp) resp->status = NFSERR_ACCES; } -void afs_nfs2_null(char *args, char *xp, char *exp, char *rp, char *crp) +void +afs_nfs2_null(char *args, char *xp, char *exp, char *rp, char *crp) { } @@ -358,262 +362,353 @@ afs_nfs2_writecache(char *args, char *xp, char *exp, char *rp, char *crp) { } -void afs_nfs2_getattr(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_GETATTR, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_rfs_disp_tbl[RFS_GETATTR].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs2_getattr(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_GETATTR, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_rfs_disp_tbl[RFS_GETATTR].orig_proc) (args, xp, exp, rp, crp); + curthread->t_cred = svcred; + return; } -void afs_nfs2_setattr(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_SETATTR, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_rfs_disp_tbl[RFS_SETATTR].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs2_setattr(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_SETATTR, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_rfs_disp_tbl[RFS_SETATTR].orig_proc) (args, xp, exp, rp, crp); + curthread->t_cred = svcred; + return; } -void afs_nfs2_lookup(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_LOOKUP, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else { (*afs_rfs_disp_tbl[RFS_LOOKUP].orig_proc)(args, xp, exp, rp, crp); - if (afs_NFSRootOnly && call) afs_nfs2_smallfidder(xp); } - curthread->t_cred = svcred; - return; +void +afs_nfs2_lookup(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_LOOKUP, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else { + (*afs_rfs_disp_tbl[RFS_LOOKUP].orig_proc) (args, xp, exp, rp, crp); + if (afs_NFSRootOnly && call) + afs_nfs2_smallfidder(xp); + } + curthread->t_cred = svcred; + return; } -void afs_nfs2_readlink(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_READLINK, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_rfs_disp_tbl[RFS_READLINK].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs2_readlink(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_READLINK, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_rfs_disp_tbl[RFS_READLINK].orig_proc) (args, xp, exp, rp, crp); + curthread->t_cred = svcred; + return; } -void afs_nfs2_read(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_READ, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_rfs_disp_tbl[RFS_READ].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs2_read(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_READ, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_rfs_disp_tbl[RFS_READ].orig_proc) (args, xp, exp, rp, crp); + curthread->t_cred = svcred; + return; } -void afs_nfs2_write(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_WRITE, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_rfs_disp_tbl[RFS_WRITE].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs2_write(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_WRITE, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_rfs_disp_tbl[RFS_WRITE].orig_proc) (args, xp, exp, rp, crp); + curthread->t_cred = svcred; + return; } -void afs_nfs2_create(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_CREATE, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else { (*afs_rfs_disp_tbl[RFS_CREATE].orig_proc)(args, xp, exp, rp, crp); - if (afs_NFSRootOnly && call) afs_nfs2_smallfidder(xp); } - curthread->t_cred = svcred; - return; +void +afs_nfs2_create(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_CREATE, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else { + (*afs_rfs_disp_tbl[RFS_CREATE].orig_proc) (args, xp, exp, rp, crp); + if (afs_NFSRootOnly && call) + afs_nfs2_smallfidder(xp); + } + curthread->t_cred = svcred; + return; } -void afs_nfs2_remove(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_REMOVE, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_rfs_disp_tbl[RFS_REMOVE].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs2_remove(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_REMOVE, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_rfs_disp_tbl[RFS_REMOVE].orig_proc) (args, xp, exp, rp, crp); + curthread->t_cred = svcred; + return; } -void afs_nfs2_rename(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_RENAME, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_rfs_disp_tbl[RFS_RENAME].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs2_rename(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_RENAME, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_rfs_disp_tbl[RFS_RENAME].orig_proc) (args, xp, exp, rp, crp); + curthread->t_cred = svcred; + return; } -void afs_nfs2_link(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_LINK, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_rfs_disp_tbl[RFS_LINK].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs2_link(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_LINK, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_rfs_disp_tbl[RFS_LINK].orig_proc) (args, xp, exp, rp, crp); + curthread->t_cred = svcred; + return; } -void afs_nfs2_symlink(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_SYMLINK, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_rfs_disp_tbl[RFS_SYMLINK].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs2_symlink(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_SYMLINK, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_rfs_disp_tbl[RFS_SYMLINK].orig_proc) (args, xp, exp, rp, crp); + curthread->t_cred = svcred; + return; } -void afs_nfs2_mkdir(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_MKDIR, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else { (*afs_rfs_disp_tbl[RFS_MKDIR].orig_proc)(args, xp, exp, rp, crp); - if (afs_NFSRootOnly && call) afs_nfs2_smallfidder(xp); } - curthread->t_cred = svcred; - return; +void +afs_nfs2_mkdir(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_MKDIR, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else { + (*afs_rfs_disp_tbl[RFS_MKDIR].orig_proc) (args, xp, exp, rp, crp); + if (afs_NFSRootOnly && call) + afs_nfs2_smallfidder(xp); + } + curthread->t_cred = svcred; + return; } -void afs_nfs2_rmdir(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_RMDIR, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_rfs_disp_tbl[RFS_RMDIR].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs2_rmdir(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_RMDIR, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_rfs_disp_tbl[RFS_RMDIR].orig_proc) (args, xp, exp, rp, crp); + curthread->t_cred = svcred; + return; } -void afs_nfs2_readdir(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_READDIR, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_rfs_disp_tbl[RFS_READDIR].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs2_readdir(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_READDIR, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_rfs_disp_tbl[RFS_READDIR].orig_proc) (args, xp, exp, rp, crp); + curthread->t_cred = svcred; + return; } -void afs_nfs2_statfs(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(0, RFS_STATFS, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_rfs_disp_tbl[RFS_STATFS].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs2_statfs(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs2_dispatcher(0, RFS_STATFS, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_rfs_disp_tbl[RFS_STATFS].orig_proc) (args, xp, exp, rp, crp); + curthread->t_cred = svcred; + return; } struct afs_nfs_disp_tbl afs_rfs_disp_tbl[RFS_NPROC] = { - { afs_nfs2_null }, - { afs_nfs2_getattr }, - { afs_nfs2_setattr }, - { afs_nfs2_root }, - { afs_nfs2_lookup }, - { afs_nfs2_readlink }, - { afs_nfs2_read }, - { afs_nfs2_writecache }, - { afs_nfs2_write }, - { afs_nfs2_create }, - { afs_nfs2_remove }, - { afs_nfs2_rename }, - { afs_nfs2_link }, - { afs_nfs2_symlink }, - { afs_nfs2_mkdir }, - { afs_nfs2_rmdir }, - { afs_nfs2_readdir }, - { afs_nfs2_statfs } + {afs_nfs2_null}, + {afs_nfs2_getattr}, + {afs_nfs2_setattr}, + {afs_nfs2_root}, + {afs_nfs2_lookup}, + {afs_nfs2_readlink}, + {afs_nfs2_read}, + {afs_nfs2_writecache}, + {afs_nfs2_write}, + {afs_nfs2_create}, + {afs_nfs2_remove}, + {afs_nfs2_rename}, + {afs_nfs2_link}, + {afs_nfs2_symlink}, + {afs_nfs2_mkdir}, + {afs_nfs2_rmdir}, + {afs_nfs2_readdir}, + {afs_nfs2_statfs} }; -void afs_acl2_getacl(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(1, ACLPROC2_GETACL, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_acl_disp_tbl[ACLPROC2_GETACL].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_acl2_getacl(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs2_dispatcher(1, ACLPROC2_GETACL, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_acl_disp_tbl[ACLPROC2_GETACL].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_acl2_setacl(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(1, ACLPROC2_SETACL, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_acl_disp_tbl[ACLPROC2_SETACL].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_acl2_setacl(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs2_dispatcher(1, ACLPROC2_SETACL, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_acl_disp_tbl[ACLPROC2_SETACL].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_acl2_getattr(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(1, ACLPROC2_GETATTR, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_acl_disp_tbl[ACLPROC2_GETATTR].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_acl2_getattr(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs2_dispatcher(1, ACLPROC2_GETATTR, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_acl_disp_tbl[ACLPROC2_GETATTR].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_acl2_access(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs2_dispatcher(1, ACLPROC2_ACCESS, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); - else (*afs_acl_disp_tbl[ACLPROC2_ACCESS].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_acl2_access(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs2_dispatcher(1, ACLPROC2_ACCESS, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); + else + (*afs_acl_disp_tbl[ACLPROC2_ACCESS].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } struct afs_nfs_disp_tbl afs_acl_disp_tbl[5] = { - { afs_nfs2_null }, - { afs_acl2_getacl }, - { afs_acl2_setacl }, - { afs_acl2_getattr }, - { afs_acl2_access } + {afs_nfs2_null}, + {afs_acl2_getacl}, + {afs_acl2_setacl}, + {afs_acl2_getattr}, + {afs_acl2_access} }; /* Munge the dispatch tables to link us in first */ void afs_xlatorinit_v2(struct rfs_disp_tbl *_rfs_tbl, - struct rfs_disp_tbl *_acl_tbl) + struct rfs_disp_tbl *_acl_tbl) { int i; - - if (xlatorinit_v2_done++) return; - - for (i=0; i < RFS_NPROC; i++) { + + if (xlatorinit_v2_done++) + return; + + for (i = 0; i < RFS_NPROC; i++) { afs_rfs_disp_tbl[i].orig_proc = _rfs_tbl[i].dis_proc; _rfs_tbl[i].dis_proc = afs_rfs_disp_tbl[i].afs_proc; } - - for (i=0; i < 5; i++) { + + for (i = 0; i < 5; i++) { afs_acl_disp_tbl[i].orig_proc = _acl_tbl[i].dis_proc; _acl_tbl[i].dis_proc = afs_acl_disp_tbl[i].afs_proc; } @@ -637,9 +732,10 @@ struct afs_nfs3_resp { typedef struct afs_nfs3_resp afs_nfs3_resp; static int -is_afs_fh3(nfs_fh3 *fhp) { - if ((fhp->fh3_fsid.val[0] == AFS_VFSMAGIC) && - (fhp->fh3_fsid.val[1] == AFS_VFSFSID)) +is_afs_fh3(nfs_fh3 * fhp) +{ + if ((fhp->fh3_fsid.val[0] == AFS_VFSMAGIC) + && (fhp->fh3_fsid.val[1] == AFS_VFSFSID)) return 1; return 0; } @@ -652,152 +748,152 @@ afs_nfs3_noaccess(struct afs_nfs3_resp *resp) } afs_int32 -nfs3_to_afs_call(int which, caddr_t *args, nfs_fh3 **fhpp, nfs_fh3 **fh2pp) +nfs3_to_afs_call(int which, caddr_t * args, nfs_fh3 ** fhpp, nfs_fh3 ** fh2pp) { struct vnode *vp; - nfs_fh3 *fhp1=0; - nfs_fh3 *fhp2=0; + nfs_fh3 *fhp1 = 0; + nfs_fh3 *fhp2 = 0; int errorcode; - + afs_Trace1(afs_iclSetp, CM_TRACE_NFS3IN, ICL_TYPE_INT32, which); - *fh2pp = (nfs_fh3 *)0; + *fh2pp = (nfs_fh3 *) 0; switch (which) { case NFSPROC3_GETATTR: - { - GETATTR3args *arg = (GETATTR3args *)args; - fhp1 = (nfs_fh3 *) &arg->object; - break; - } + { + GETATTR3args *arg = (GETATTR3args *) args; + fhp1 = (nfs_fh3 *) & arg->object; + break; + } case NFSPROC3_SETATTR: - { - SETATTR3args *arg = (SETATTR3args *)args; - fhp1 = (nfs_fh3 *) &arg->object; - break; - } + { + SETATTR3args *arg = (SETATTR3args *) args; + fhp1 = (nfs_fh3 *) & arg->object; + break; + } case NFSPROC3_LOOKUP: - { - LOOKUP3args *arg = (LOOKUP3args *)args; + { + LOOKUP3args *arg = (LOOKUP3args *) args; #ifdef AFS_SUN58_ENV - fhp1 = (nfs_fh3 *) &arg->what.dirp; + fhp1 = (nfs_fh3 *) arg->what.dirp; #else - fhp1 = (nfs_fh3 *) &arg->what.dir; + fhp1 = (nfs_fh3 *) & arg->what.dir; #endif - break; - } + break; + } case NFSPROC3_ACCESS: - { - ACCESS3args *arg = (ACCESS3args *)args; - fhp1 = (nfs_fh3 *) &arg->object; - break; - } + { + ACCESS3args *arg = (ACCESS3args *) args; + fhp1 = (nfs_fh3 *) & arg->object; + break; + } case NFSPROC3_READLINK: - { - READLINK3args *arg = (READLINK3args *)args; - fhp1 = (nfs_fh3 *) &arg->symlink; - break; - } + { + READLINK3args *arg = (READLINK3args *) args; + fhp1 = (nfs_fh3 *) & arg->symlink; + break; + } case NFSPROC3_READ: - { - READ3args *arg = (READ3args *)args; - fhp1 = (nfs_fh3 *) &arg->file; - break; - } + { + READ3args *arg = (READ3args *) args; + fhp1 = (nfs_fh3 *) & arg->file; + break; + } case NFSPROC3_WRITE: - { - WRITE3args *arg = (WRITE3args *)args; - fhp1 = (nfs_fh3 *) &arg->file; - break; - } + { + WRITE3args *arg = (WRITE3args *) args; + fhp1 = (nfs_fh3 *) & arg->file; + break; + } case NFSPROC3_CREATE: - { - CREATE3args *arg = (CREATE3args *)args; - fhp1 = (nfs_fh3 *) &arg->where.dir; - break; - } + { + CREATE3args *arg = (CREATE3args *) args; + fhp1 = (nfs_fh3 *) & arg->where.dir; + break; + } case NFSPROC3_MKDIR: - { - MKDIR3args *arg = (MKDIR3args *)args; - fhp1 = (nfs_fh3 *) &arg->where.dir; - break; - } + { + MKDIR3args *arg = (MKDIR3args *) args; + fhp1 = (nfs_fh3 *) & arg->where.dir; + break; + } case NFSPROC3_SYMLINK: - { - SYMLINK3args *arg = (SYMLINK3args *)args; - fhp1 = (nfs_fh3 *) &arg->where.dir; - break; - } + { + SYMLINK3args *arg = (SYMLINK3args *) args; + fhp1 = (nfs_fh3 *) & arg->where.dir; + break; + } case NFSPROC3_MKNOD: - { - MKNOD3args *arg = (MKNOD3args *)args; - fhp1 = (nfs_fh3 *) &arg->where.dir; - break; - } + { + MKNOD3args *arg = (MKNOD3args *) args; + fhp1 = (nfs_fh3 *) & arg->where.dir; + break; + } case NFSPROC3_REMOVE: - { - REMOVE3args *arg = (REMOVE3args *)args; - fhp1 = (nfs_fh3 *) &arg->object.dir; - break; - } + { + REMOVE3args *arg = (REMOVE3args *) args; + fhp1 = (nfs_fh3 *) & arg->object.dir; + break; + } case NFSPROC3_RMDIR: - { - RMDIR3args *arg = (RMDIR3args *)args; - fhp1 = (nfs_fh3 *) &arg->object.dir; - break; - } + { + RMDIR3args *arg = (RMDIR3args *) args; + fhp1 = (nfs_fh3 *) & arg->object.dir; + break; + } case NFSPROC3_RENAME: - { - RENAME3args *arg = (RENAME3args *)args; - fhp1 = (nfs_fh3 *) &arg->from.dir; - fhp2 = (nfs_fh3 *) &arg->to.dir; - break; - } + { + RENAME3args *arg = (RENAME3args *) args; + fhp1 = (nfs_fh3 *) & arg->from.dir; + fhp2 = (nfs_fh3 *) & arg->to.dir; + break; + } case NFSPROC3_LINK: - { - LINK3args *arg = (LINK3args *)args; - fhp1 = (nfs_fh3 *) &arg->file; - fhp2 = (nfs_fh3 *) &arg->link.dir; - break; - } + { + LINK3args *arg = (LINK3args *) args; + fhp1 = (nfs_fh3 *) & arg->file; + fhp2 = (nfs_fh3 *) & arg->link.dir; + break; + } case NFSPROC3_READDIR: - { - READDIR3args *arg = (READDIR3args *)args; - fhp1 = (nfs_fh3 *) &arg->dir; - break; - } + { + READDIR3args *arg = (READDIR3args *) args; + fhp1 = (nfs_fh3 *) & arg->dir; + break; + } case NFSPROC3_READDIRPLUS: - { - READDIRPLUS3args *arg = (READDIRPLUS3args *)args; - fhp1 = (nfs_fh3 *) &arg->dir; - break; - } + { + READDIRPLUS3args *arg = (READDIRPLUS3args *) args; + fhp1 = (nfs_fh3 *) & arg->dir; + break; + } case NFSPROC3_FSSTAT: - { - FSSTAT3args *arg = (FSSTAT3args *)args; - fhp1 = (nfs_fh3 *) &arg->fsroot; - break; - } + { + FSSTAT3args *arg = (FSSTAT3args *) args; + fhp1 = (nfs_fh3 *) & arg->fsroot; + break; + } case NFSPROC3_FSINFO: - { - FSINFO3args *arg = (FSINFO3args *)args; - fhp1 = (nfs_fh3 *) &arg->fsroot; - break; - } + { + FSINFO3args *arg = (FSINFO3args *) args; + fhp1 = (nfs_fh3 *) & arg->fsroot; + break; + } case NFSPROC3_PATHCONF: - { - PATHCONF3args *arg = (PATHCONF3args *)args; - fhp1 = (nfs_fh3 *) &arg->object; - break; - } + { + PATHCONF3args *arg = (PATHCONF3args *) args; + fhp1 = (nfs_fh3 *) & arg->object; + break; + } case NFSPROC3_COMMIT: - { - COMMIT3args *arg = (COMMIT3args *)args; - fhp1 = (nfs_fh3 *) &arg->file; - break; - } + { + COMMIT3args *arg = (COMMIT3args *) args; + fhp1 = (nfs_fh3 *) & arg->file; + break; + } default: return NULL; } - + if (is_afs_fh3(fhp1)) { *fhpp = fhp1; if (fhp2) @@ -813,54 +909,54 @@ nfs3_to_afs_call(int which, caddr_t *args, nfs_fh3 **fhpp, nfs_fh3 **fh2pp) } afs_int32 -acl3_to_afs_call(int which, caddr_t *args, nfs_fh3 **fhpp) +acl3_to_afs_call(int which, caddr_t * args, nfs_fh3 ** fhpp) { nfs_fh3 *fhp; - - switch(which) { + + switch (which) { case ACLPROC3_GETACL: - { - struct GETACL3args *sargs = (struct GETACL3args *) args; - fhp = &sargs->fh; - break; - } + { + struct GETACL3args *sargs = (struct GETACL3args *)args; + fhp = &sargs->fh; + break; + } case ACLPROC3_SETACL: - { - struct SETACL3args *sargs = (struct SETACL3args *) args; - fhp = &sargs->fh; - break; - } + { + struct SETACL3args *sargs = (struct SETACL3args *)args; + fhp = &sargs->fh; + break; + } default: return NULL; } - + if (is_afs_fh3(fhp)) { *fhpp = fhp; return 1; } - + return NULL; } int afs_nfs3_dispatcher(int type, afs_int32 which, char *argp, - struct exportinfo **expp, - struct svc_req *rp, struct AFS_UCRED *crp) + struct exportinfo **expp, struct svc_req *rp, + struct AFS_UCRED *crp) { afs_int32 call = 0; afs_int32 code = 0; afs_int32 client = 0; struct sockaddr *sa; - nfs_fh3 *fh = (nfs_fh3 *)argp; - nfs_fh3 *fh2 = (nfs_fh3 *)0; - + nfs_fh3 *fh = (nfs_fh3 *) argp; + nfs_fh3 *fh2 = (nfs_fh3 *) 0; + if (!xlatorinit_v3_done) return 2; - + sa = (struct sockaddr *)svc_getrpccaller(rp->rq_xprt)->buf; - if (sa->sa_family == AF_INET) + if (sa->sa_family == AF_INET) client = ((struct sockaddr_in *)sa)->sin_addr.s_addr; - + AFS_GLOCK(); code = 0; switch (type) { @@ -873,17 +969,16 @@ afs_nfs3_dispatcher(int type, afs_int32 which, char *argp, default: break; } - + if (code) { struct afs_exporter *out = 0; afs_int32 dummy; static int once = 0; struct SmallFid Sfid; - + memcpy((char *)&Sfid, fh->fh3_data, SIZEOF_SMALLFID); - - afs_Trace2(afs_iclSetp, CM_TRACE_NFS3IN1, - ICL_TYPE_INT32, client, + + afs_Trace2(afs_iclSetp, CM_TRACE_NFS3IN1, ICL_TYPE_INT32, client, ICL_TYPE_FID, &Sfid); call = 1; @@ -891,17 +986,18 @@ afs_nfs3_dispatcher(int type, afs_int32 which, char *argp, afs_nobody = (*expp)->exi_export.ex_anon; once = 1; } - code = afs_nfsclient_reqhandler((struct afs_exporter *)0, &crp, - client, &dummy, &out); - + code = + afs_nfsclient_reqhandler((struct afs_exporter *)0, &crp, client, + &dummy, &out); + if (!code && out) EXP_RELE(out); - - + + if (code == EINVAL) call = 2; } - + AFS_GUNLOCK(); return call; } @@ -911,39 +1007,38 @@ afs_nfs3_smallfidder(struct nfs_fh3 *fhp, int status) { afs_int32 addr[2]; struct vcache *vcp; - + #if defined(AFS_SUN57_64BIT_ENV) - /* See also afs_fid() */ + /* See also afs_fid() */ memcpy((char *)addr, fhp->fh3_data, 10); addr[1] = (addr[1] >> 48) & 0xffff; -#else +#else memcpy((char *)addr, fhp->fh3_data, 2 * sizeof(long)); #endif - + AFS_GLOCK(); - vcp = VTOAFS((struct vnode*)addr[0]); - + vcp = VTOAFS((struct vnode *)addr[0]); + /* See also afs_osi_vget */ - if (addr[1] == AFS_XLATOR_MAGIC) - { + if (addr[1] == AFS_XLATOR_MAGIC) { if (status == NFS_OK) { struct SmallFid Sfid; struct cell *tcell; - - /* Make up and copy out a SmallFid */ + + /* Make up and copy out a SmallFid */ tcell = afs_GetCell(vcp->fid.Cell, READ_LOCK); Sfid.Volume = vcp->fid.Fid.Volume; - Sfid.CellAndUnique = ((tcell->cellIndex << 24) | - (vcp->fid.Fid.Unique & 0xffffff)); + Sfid.CellAndUnique = + ((tcell->cellIndex << 24) | (vcp->fid.Fid.Unique & 0xffffff)); afs_PutCell(tcell, READ_LOCK); - Sfid.Vnode = (u_short)(vcp->fid.Fid.Vnode & 0xffff); + Sfid.Vnode = (u_short) (vcp->fid.Fid.Vnode & 0xffff); fhp->fh3_len = SIZEOF_SMALLFID; - memcpy(fhp->fh3_data, (char*)&Sfid, fhp->fh3_len); + memcpy(fhp->fh3_data, (char *)&Sfid, fhp->fh3_len); afs_Trace3(afs_iclSetp, CM_TRACE_NFS3OUT, ICL_TYPE_INT32, status, ICL_TYPE_POINTER, vcp, ICL_TYPE_FID, &Sfid); } - + /* If we have a ref, release it */ if (vcp->vrefCount >= 1) AFS_RELE(AFSTOV(vcp)); @@ -951,340 +1046,491 @@ afs_nfs3_smallfidder(struct nfs_fh3 *fhp, int status) AFS_GUNLOCK(); } -void afs_nfs3_getattr(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_GETATTR, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_GETATTR].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_getattr(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_GETATTR, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_GETATTR].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_setattr(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_SETATTR, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_SETATTR].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_setattr(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_SETATTR, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_SETATTR].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_lookup(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_LOOKUP, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else { (*afs_rfs3_disp_tbl[NFSPROC3_LOOKUP].orig_proc)(args, xp, exp, rp, crp); - if (afs_NFSRootOnly && call) { - LOOKUP3res *resp = ( LOOKUP3res *)xp; - afs_nfs3_smallfidder( &resp->resok.object , resp->status); } } - curthread->t_cred = svcred; - return; +void +afs_nfs3_lookup(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_LOOKUP, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else { + (*afs_rfs3_disp_tbl[NFSPROC3_LOOKUP].orig_proc) (args, xp, exp, rp, + crp); + if (afs_NFSRootOnly && call) { + LOOKUP3res *resp = (LOOKUP3res *) xp; + afs_nfs3_smallfidder(&resp->resok.object, resp->status); + } + } + curthread->t_cred = svcred; + return; } -void afs_nfs3_access(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_ACCESS, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_ACCESS].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_access(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_ACCESS, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_ACCESS].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_readlink(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_READLINK, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_READLINK].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_readlink(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_READLINK, (char *)args, &exp, rp, + crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_READLINK].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_read(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_READ, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_READ].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_read(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs3_dispatcher(0, NFSPROC3_READ, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_READ].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_write(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_WRITE, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_WRITE].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_write(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_WRITE, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_WRITE].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_create(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_CREATE, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else { (*afs_rfs3_disp_tbl[NFSPROC3_CREATE].orig_proc)(args, xp, exp, rp, crp); - if (afs_NFSRootOnly && call) { - CREATE3res *resp = ( CREATE3res *)xp; - afs_nfs3_smallfidder( &resp->resok.obj.handle , resp->status); } } - curthread->t_cred = svcred; - return; + +void +afs_nfs3_create(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_CREATE, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else { + (*afs_rfs3_disp_tbl[NFSPROC3_CREATE].orig_proc) (args, xp, exp, rp, + crp); + if (afs_NFSRootOnly && call) { + CREATE3res *resp = (CREATE3res *) xp; + afs_nfs3_smallfidder(&resp->resok.obj.handle, resp->status); + } + } + curthread->t_cred = svcred; + return; } -void afs_nfs3_mkdir(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_MKDIR, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else { (*afs_rfs3_disp_tbl[NFSPROC3_MKDIR].orig_proc)(args, xp, exp, rp, crp); - if (afs_NFSRootOnly && call) { - MKDIR3res *resp = ( MKDIR3res *)xp; - afs_nfs3_smallfidder( &resp->resok.obj.handle , resp->status); } } - curthread->t_cred = svcred; - return; +void +afs_nfs3_mkdir(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_MKDIR, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else { + (*afs_rfs3_disp_tbl[NFSPROC3_MKDIR].orig_proc) (args, xp, exp, rp, + crp); + if (afs_NFSRootOnly && call) { + MKDIR3res *resp = (MKDIR3res *) xp; + afs_nfs3_smallfidder(&resp->resok.obj.handle, resp->status); + } + } + curthread->t_cred = svcred; + return; } -void afs_nfs3_symlink(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_SYMLINK, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else { (*afs_rfs3_disp_tbl[NFSPROC3_SYMLINK].orig_proc)(args, xp, exp, rp, crp); - if (afs_NFSRootOnly && call) { - SYMLINK3res *resp = ( SYMLINK3res *)xp; - afs_nfs3_smallfidder( &resp->resok.obj.handle , resp->status); } } - curthread->t_cred = svcred; - return; +void +afs_nfs3_symlink(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_SYMLINK, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else { + (*afs_rfs3_disp_tbl[NFSPROC3_SYMLINK].orig_proc) (args, xp, exp, rp, + crp); + if (afs_NFSRootOnly && call) { + SYMLINK3res *resp = (SYMLINK3res *) xp; + afs_nfs3_smallfidder(&resp->resok.obj.handle, resp->status); + } + } + curthread->t_cred = svcred; + return; } -void afs_nfs3_mknod(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_MKNOD, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else { (*afs_rfs3_disp_tbl[NFSPROC3_MKNOD].orig_proc)(args, xp, exp, rp, crp); - if (afs_NFSRootOnly && call) { - MKNOD3res *resp = ( MKNOD3res *)xp; - afs_nfs3_smallfidder( &resp->resok.obj.handle , resp->status); } } - curthread->t_cred = svcred; - return; +void +afs_nfs3_mknod(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_MKNOD, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else { + (*afs_rfs3_disp_tbl[NFSPROC3_MKNOD].orig_proc) (args, xp, exp, rp, + crp); + if (afs_NFSRootOnly && call) { + MKNOD3res *resp = (MKNOD3res *) xp; + afs_nfs3_smallfidder(&resp->resok.obj.handle, resp->status); + } + } + curthread->t_cred = svcred; + return; } -void afs_nfs3_remove(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_REMOVE, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_REMOVE].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_remove(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_REMOVE, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_REMOVE].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_rmdir(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_RMDIR, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_RMDIR].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_rmdir(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_RMDIR, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_RMDIR].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_rename(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_RENAME, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_RENAME].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_rename(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_RENAME, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_RENAME].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_link(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_LINK, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_LINK].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_link(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = afs_nfs3_dispatcher(0, NFSPROC3_LINK, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_LINK].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_readdir(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_READDIR, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_READDIR].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_readdir(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_READDIR, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_READDIR].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_readdirplus(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_READDIRPLUS, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_READDIRPLUS].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_readdirplus(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_READDIRPLUS, (char *)args, &exp, rp, + crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_READDIRPLUS].orig_proc) (args, xp, exp, + rp, crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_fsstat(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_FSSTAT, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_FSSTAT].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_fsstat(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_FSSTAT, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_FSSTAT].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_fsinfo(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_FSINFO, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_FSINFO].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_fsinfo(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_FSINFO, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_FSINFO].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_pathconf(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_PATHCONF, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_PATHCONF].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_pathconf(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_PATHCONF, (char *)args, &exp, rp, + crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_PATHCONF].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_nfs3_commit(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - afs_nfs3_resp dummy; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(0, NFSPROC3_COMMIT, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_rfs3_disp_tbl[NFSPROC3_COMMIT].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_nfs3_commit(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + afs_nfs3_resp dummy; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(0, NFSPROC3_COMMIT, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_rfs3_disp_tbl[NFSPROC3_COMMIT].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } struct afs_nfs_disp_tbl afs_rfs3_disp_tbl[22] = { - { afs_nfs2_null }, - { afs_nfs3_getattr }, - { afs_nfs3_setattr }, - { afs_nfs3_lookup }, - { afs_nfs3_access }, - { afs_nfs3_readlink }, - { afs_nfs3_read }, - { afs_nfs3_write }, - { afs_nfs3_create }, - { afs_nfs3_mkdir }, - { afs_nfs3_symlink }, - { afs_nfs3_mknod }, - { afs_nfs3_remove }, - { afs_nfs3_rmdir }, - { afs_nfs3_rename }, - { afs_nfs3_link }, - { afs_nfs3_readdir }, - { afs_nfs3_readdirplus }, - { afs_nfs3_fsstat }, - { afs_nfs3_fsinfo }, - { afs_nfs3_pathconf }, - { afs_nfs3_commit } + {afs_nfs2_null}, + {afs_nfs3_getattr}, + {afs_nfs3_setattr}, + {afs_nfs3_lookup}, + {afs_nfs3_access}, + {afs_nfs3_readlink}, + {afs_nfs3_read}, + {afs_nfs3_write}, + {afs_nfs3_create}, + {afs_nfs3_mkdir}, + {afs_nfs3_symlink}, + {afs_nfs3_mknod}, + {afs_nfs3_remove}, + {afs_nfs3_rmdir}, + {afs_nfs3_rename}, + {afs_nfs3_link}, + {afs_nfs3_readdir}, + {afs_nfs3_readdirplus}, + {afs_nfs3_fsstat}, + {afs_nfs3_fsinfo}, + {afs_nfs3_pathconf}, + {afs_nfs3_commit} }; -void afs_acl3_getacl(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(1, ACLPROC3_GETACL, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_acl3_disp_tbl[ACLPROC3_GETACL].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_acl3_getacl(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(1, ACLPROC3_GETACL, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_acl3_disp_tbl[ACLPROC3_GETACL].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } -void afs_acl3_setacl(char *args, char *xp, char *exp, char *rp, char *crp) { - u_int call; - struct cred *svcred = curthread->t_cred; - curthread->t_cred = (struct cred*)crp; - call=afs_nfs3_dispatcher(1, ACLPROC3_SETACL, (char *)args, &exp, rp, crp); - if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); - else (*afs_acl3_disp_tbl[ACLPROC3_SETACL].orig_proc)(args, xp, exp, rp, crp); - curthread->t_cred = svcred; - return; +void +afs_acl3_setacl(char *args, char *xp, char *exp, char *rp, char *crp) +{ + u_int call; + struct cred *svcred = curthread->t_cred; + curthread->t_cred = (struct cred *)crp; + call = + afs_nfs3_dispatcher(1, ACLPROC3_SETACL, (char *)args, &exp, rp, crp); + if (call > 1) + afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); + else + (*afs_acl3_disp_tbl[ACLPROC3_SETACL].orig_proc) (args, xp, exp, rp, + crp); + curthread->t_cred = svcred; + return; } struct afs_nfs_disp_tbl afs_acl3_disp_tbl[3] = { - { afs_nfs2_null }, - { afs_acl3_getacl }, - { afs_acl3_setacl }, + {afs_nfs2_null}, + {afs_acl3_getacl}, + {afs_acl3_setacl}, }; /* Munge the dispatch tables to link us in first */ void afs_xlatorinit_v3(struct rfs_disp_tbl *_rfs_tbl, - struct rfs_disp_tbl *_acl_tbl) + struct rfs_disp_tbl *_acl_tbl) { int i; - - if (xlatorinit_v3_done++) return; - - for (i=0; i < 22; i++) { + + if (xlatorinit_v3_done++) + return; + + for (i = 0; i < 22; i++) { afs_rfs3_disp_tbl[i].orig_proc = _rfs_tbl[i].dis_proc; _rfs_tbl[i].dis_proc = afs_rfs3_disp_tbl[i].afs_proc; } - - for (i=0; i < 3; i++) { + + for (i = 0; i < 3; i++) { afs_acl3_disp_tbl[i].orig_proc = _acl_tbl[i].dis_proc; _acl_tbl[i].dis_proc = afs_acl3_disp_tbl[i].afs_proc; } diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c index 6936ff39b..145d6e465 100644 --- a/src/afs/afs_osi.c +++ b/src/afs/afs_osi.c @@ -1,26 +1,26 @@ /* * Copyright 2000, International Business Machines Corporation and others. * All Rights Reserved. - * + * * This software has been released under the terms of the IBM Public * License. For details, see the LICENSE file in the top-level source * directory or online at http://www.openafs.org/dl/license10.html */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi.c,v 1.1.1.14 2003/07/30 17:08:00 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_osi.c,v 1.44 2004/04/21 02:20:21 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ #ifdef AFS_AIX_ENV #include /* for vm_att(), vm_det() */ #endif -static char memZero; /* address of 0 bytes for kmem_alloc */ -extern int afs_osicred_initialized; +static char memZero; /* address of 0 bytes for kmem_alloc */ struct osimem { struct osimem *next; @@ -40,63 +40,76 @@ lock_t afs_event_lock; flid_t osi_flid; #endif -void osi_Init() +struct AFS_UCRED *afs_osi_credp; + +void +osi_Init(void) { static int once = 0; - if (once++ > 0) /* just in case */ + if (once++ > 0) /* just in case */ return; #if defined(AFS_HPUX_ENV) osi_InitGlock(); -#else /* AFS_HPUX_ENV */ +#else /* AFS_HPUX_ENV */ #if defined(AFS_GLOBAL_SUNLOCK) #if defined(AFS_SGI62_ENV) mutex_init(&afs_global_lock, MUTEX_DEFAULT, "afs_global_lock"); #elif defined(AFS_OSF_ENV) usimple_lock_init(&afs_global_lock); - afs_global_owner = (thread_t)0; -#elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + afs_global_owner = (thread_t) 0; +#elif defined(AFS_FBSD50_ENV) + mtx_init(&afs_global_mtx, "AFS global lock", NULL, MTX_DEF); +#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) lockinit(&afs_global_lock, PLOCK, "afs global lock", 0, 0); afs_global_owner = 0; #elif defined(AFS_AIX41_ENV) - lock_alloc((void*)&afs_global_lock, LOCK_ALLOC_PIN, 1, 1); + lock_alloc((void *)&afs_global_lock, LOCK_ALLOC_PIN, 1, 1); simple_lock_init((void *)&afs_global_lock); -#else -#ifndef AFS_LINUX22_ENV - /* Linux initialization in osi directory. Should move the others. */ +#elif !defined(AFS_LINUX22_ENV) + /* Linux initialization in osi directory. Should move the others. */ mutex_init(&afs_global_lock, "afs_global_lock", MUTEX_DEFAULT, NULL); -#endif #endif /* afs_rxglobal_lock is initialized in rx_Init. */ +#endif /* AFS_GLOBAL_SUNLOCK */ +#endif /* AFS_HPUX_ENV */ + + if (!afs_osicred_initialized) { +#if defined(AFS_LINUX26_ENV) + afs_osi_credp = crref(); +#elif defined(AFS_XBSD_ENV) + /* Can't just invent one, must use crget() because of mutex */ + afs_osi_credp = crdup(osi_curcred()); +#else + memset(&afs_osi_cred, 0, sizeof(struct AFS_UCRED)); + crhold(&afs_osi_cred); /* don't let it evaporate */ + afs_osi_credp = &afs_osi_cred; #endif -#endif /* AFS_HPUX_ENV */ - - if ( !afs_osicred_initialized ) - { - memset((char *)&afs_osi_cred, 0, sizeof(struct AFS_UCRED)); - crhold(&afs_osi_cred); /* don't let it evaporate */ - afs_osicred_initialized = 1; - } + afs_osicred_initialized = 1; + } #ifdef AFS_SGI64_ENV - osi_flid.fl_pid = osi_flid.fl_sysid = 0; + osi_flid.fl_pid = osi_flid.fl_sysid = 0; #endif + + init_et_to_sys_error(); } -osi_Active(avc) -register struct vcache *avc; { +int +osi_Active(register struct vcache *avc) +{ AFS_STATCNT(osi_Active); -#if defined(AFS_SUN_ENV) || defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - if ((avc->opens > 0) || (avc->states & CMAPPED)) return 1; /* XXX: Warning, verify this XXX */ -#else -#if defined(AFS_MACH_ENV) - if (avc->opens > 0 || ((avc->v.v_flag & VTEXT) && !inode_uncache_try(avc))) return 1; -#else -#if defined(AFS_SGI_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + if ((avc->opens > 0) || (avc->states & CMAPPED)) + return 1; /* XXX: Warning, verify this XXX */ +#elif defined(AFS_MACH_ENV) + if (avc->opens > 0 + || ((avc->v.v_flag & VTEXT) && !inode_uncache_try(avc))) + return 1; +#elif defined(AFS_SGI_ENV) if ((avc->opens > 0) || AFS_VN_MAPPED(AFSTOV(avc))) - return 1; + return 1; #else - if (avc->opens > 0 || (AFSTOV(avc)->v_flag & VTEXT)) return(1); -#endif -#endif /* AFS_MACH_ENV */ + if (avc->opens > 0 || (AFSTOV(avc)->v_flag & VTEXT)) + return (1); #endif return 0; } @@ -110,25 +123,24 @@ register struct vcache *avc; { avc->pvnLock is already held, avc->lock is guaranteed not to be held (by us, of course). */ -void osi_FlushPages(avc, credp) - register struct vcache *avc; - struct AFS_UCRED *credp; +void +osi_FlushPages(register struct vcache *avc, struct AFS_UCRED *credp) { afs_hyper_t origDV; ObtainReadLock(&avc->lock); /* If we've already purged this version, or if we're the ones - writing this version, don't flush it (could lose the - data we're writing). */ - if ((hcmp((avc->m.DataVersion), (avc->mapDV)) <= 0) || - ((avc->execsOrWriters > 0) && afs_DirtyPages(avc))) { + * writing this version, don't flush it (could lose the + * data we're writing). */ + if ((hcmp((avc->m.DataVersion), (avc->mapDV)) <= 0) + || ((avc->execsOrWriters > 0) && afs_DirtyPages(avc))) { ReleaseReadLock(&avc->lock); return; } ReleaseReadLock(&avc->lock); - ObtainWriteLock(&avc->lock,10); + ObtainWriteLock(&avc->lock, 10); /* Check again */ - if ((hcmp((avc->m.DataVersion), (avc->mapDV)) <= 0) || - ((avc->execsOrWriters > 0) && afs_DirtyPages(avc))) { + if ((hcmp((avc->m.DataVersion), (avc->mapDV)) <= 0) + || ((avc->execsOrWriters > 0) && afs_DirtyPages(avc))) { ReleaseWriteLock(&avc->lock); return; } @@ -141,16 +153,16 @@ void osi_FlushPages(avc, credp) AFS_STATCNT(osi_FlushPages); hset(origDV, avc->m.DataVersion); afs_Trace3(afs_iclSetp, CM_TRACE_FLUSHPAGES, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, origDV.low, ICL_TYPE_INT32, avc->m.Length); + ICL_TYPE_INT32, origDV.low, ICL_TYPE_INT32, avc->m.Length); ReleaseWriteLock(&avc->lock); AFS_GUNLOCK(); osi_VM_FlushPages(avc, credp); AFS_GLOCK(); - ObtainWriteLock(&avc->lock,88); + ObtainWriteLock(&avc->lock, 88); /* do this last, and to original version, since stores may occur - while executing above PUTPAGE call */ + * while executing above PUTPAGE call */ hset(avc->mapDV, origDV); ReleaseWriteLock(&avc->lock); } @@ -166,30 +178,32 @@ afs_lock_t afs_ftf; /* flush text lock */ * shouldn't do anything that would discard newly written data before * it is written to the file system. */ -void osi_FlushText_really(vp) - register struct vcache *vp; { - afs_hyper_t fdv; /* version before which we'll flush */ +void +osi_FlushText_really(register struct vcache *vp) +{ + afs_hyper_t fdv; /* version before which we'll flush */ AFS_STATCNT(osi_FlushText); /* see if we've already flushed this data version */ - if (hcmp(vp->m.DataVersion, vp->flushDV) <= 0) return; + if (hcmp(vp->m.DataVersion, vp->flushDV) <= 0) + return; -#ifdef AFS_DEC_ENV +#ifdef AFS_DEC_ENV { - void afs_gfs_FlushText(); - afs_gfs_FlushText(vp); - return; + void afs_gfs_FlushText(); + afs_gfs_FlushText(vp); + return; } #else - MObtainWriteLock(&afs_ftf,317); + MObtainWriteLock(&afs_ftf, 317); hset(fdv, vp->m.DataVersion); - /* why this disgusting code below? - * xuntext, called by xrele, doesn't notice when it is called + /* why this disgusting code below? + * xuntext, called by xrele, doesn't notice when it is called * with a freed text object. Sun continually calls xrele or xuntext * without any locking, as long as VTEXT is set on the - * corresponding vnode. + * corresponding vnode. * But, if the text object is locked when you check the VTEXT * flag, several processes can wait in xuntext, waiting for the * text lock; when the second one finally enters xuntext's @@ -208,7 +222,7 @@ void osi_FlushText_really(vp) #if defined (AFS_HPUX_ENV) if (vp->v.v_flag & VTEXT) { - xrele(vp); + xrele(vp); if (vp->v.v_flag & VTEXT) { /* still has a text object? */ MReleaseWriteLock(&afs_ftf); @@ -235,36 +249,36 @@ void osi_FlushText_really(vp) * into some middle ground... */ static void -afs_gfs_FlushText(vp) - register struct vcache *vp; { - afs_hyper_t fdv; /* version before which we'll flush */ +afs_gfs_FlushText(register struct vcache *vp) +{ + afs_hyper_t fdv; /* version before which we'll flush */ register struct text *xp; - struct gnode * gp; + struct gnode *gp; - MObtainWriteLock(&afs_ftf,318); + MObtainWriteLock(&afs_ftf, 318); hset(fdv, vp->m.DataVersion); gp = afs_vntogn(vp); if (!gp) { - /* this happens frequently after cores are created. */ - MReleaseWriteLock(&afs_ftf); - return; + /* this happens frequently after cores are created. */ + MReleaseWriteLock(&afs_ftf); + return; } if (gp->g_flag & GTEXT) { if (gp->g_textp) { - xp = (struct text *) gp->g_textp ; - /* if text object is locked, give up */ - if (xp && (xp->x_flag & XLOCK)) { - MReleaseWriteLock(&afs_ftf); - return; - } - } - else xp = (struct text *) 0; + xp = (struct text *)gp->g_textp; + /* if text object is locked, give up */ + if (xp && (xp->x_flag & XLOCK)) { + MReleaseWriteLock(&afs_ftf); + return; + } + } else + xp = NULL; - if (gp->g_flag & GTEXT) {/* still has a text object? */ - xinval(gp); - } + if (gp->g_flag & GTEXT) { /* still has a text object? */ + xinval(gp); + } } /* next do the stuff that need not check for deadlock problems */ @@ -281,68 +295,68 @@ afs_gfs_FlushText(vp) #endif /* AFS_TEXT_ENV */ /* mask signals in afsds */ -void afs_osi_MaskSignals(){ +void +afs_osi_MaskSignals(void) +{ #ifdef AFS_LINUX22_ENV osi_linux_mask(); #endif } - + /* unmask signals in rxk listener */ -void afs_osi_UnmaskRxkSignals(){ +void +afs_osi_UnmaskRxkSignals(void) +{ } - + /* register rxk listener proc info */ -void afs_osi_RxkRegister(){ +void +afs_osi_RxkRegister(void) +{ #ifdef AFS_LINUX22_ENV osi_linux_rxkreg(); #endif } /* procedure for making our processes as invisible as we can */ -void afs_osi_Invisible() { +void +afs_osi_Invisible(void) +{ #ifdef AFS_LINUX22_ENV afs_osi_MaskSignals(); -#endif -#ifdef AFS_DEC_ENV +#elif defined(AFS_DEC_ENV) u.u_procp->p_type |= SSYS; -#endif -#if AFS_SUN5_ENV +#elif defined(AFS_SUN5_ENV) curproc->p_flag |= SSYS; -#endif -#if AFS_HPUX101_ENV +#elif defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV) set_system_proc(u.u_procp); -#endif -#if defined(AFS_DARWIN_ENV) +#elif defined(AFS_DARWIN_ENV) /* maybe call init_process instead? */ current_proc()->p_flag |= P_SYSTEM; -#endif -#if defined(AFS_FBSD_ENV) +#elif defined(AFS_XBSD_ENV) curproc->p_flag |= P_SYSTEM; -#endif -#if defined(AFS_SGI_ENV) +#elif defined(AFS_SGI_ENV) vrelvm(); -#endif /* AFS_SGI_ENV */ +#endif AFS_STATCNT(osi_Invisible); } -#ifndef AFS_LINUX20_ENV /* Linux version in osi_misc.c */ +#if !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV) /* set the real time */ -afs_osi_SetTime(atv) - register osi_timeval_t *atv; { - -#ifdef AFS_AIX32_ENV +void +afs_osi_SetTime(osi_timeval_t * atv) +{ +#if defined(AFS_AIX32_ENV) struct timestruc_t t; - t.tv_sec = atv->tv_sec; + t.tv_sec = atv->tv_sec; t.tv_nsec = atv->tv_usec * 1000; ksettimer(&t); /* Was -> settimer(TIMEOFDAY, &t); */ -#else -#ifdef AFS_SUN55_ENV +#elif defined(AFS_SUN55_ENV) stime(atv->tv_sec); -#else -#ifdef AFS_SUN5_ENV +#elif defined(AFS_SUN5_ENV) /* * To get more than second resolution we can use adjtime. The problem * is that the usecs from the server are wrong (by now) so it isn't @@ -351,44 +365,20 @@ afs_osi_SetTime(atv) struct stimea { time_t time; } sta; - extern int stime(struct stimea *time, rval_t *rvp); sta.time = atv->tv_sec; stime(&sta, NULL); -#else -#if defined(AFS_SGI_ENV) +#elif defined(AFS_SGI_ENV) struct stimea { sysarg_t time; } sta; - extern int stime(struct stimea *time); AFS_GUNLOCK(); sta.time = atv->tv_sec; stime(&sta); AFS_GLOCK(); -#else -#if defined(AFS_FBSD_ENV) - /* does not impliment security features of kern_time.c:settime() */ - struct timespec ts; - struct timeval tv,delta; - extern void (*lease_updatetime)(); - int s; - AFS_GUNLOCK(); - s=splclock(); - microtime(&tv); - delta=*atv; - timevalsub(&delta, &tv); - ts.tv_sec=atv->tv_sec; - ts.tv_nsec=atv->tv_usec * 1000; - set_timecounter(&ts); - (void) splsoftclock(); - lease_updatetime(delta.tv_sec); - splx(s); - resettodr(); - AFS_GLOCK(); -#else -#if defined(AFS_DARWIN_ENV) +#elif defined(AFS_DARWIN_ENV) AFS_GUNLOCK(); setthetime(atv); AFS_GLOCK(); @@ -400,115 +390,121 @@ afs_osi_SetTime(atv) #ifdef AFS_HPUX_ENV { #if !defined(AFS_HPUX1122_ENV) - /* drop the setting of the clock for now. spl7 is not - * known on hpux11.22 - */ - - register ulong_t s; - struct timeval t; - t.tv_sec = atv->tv_sec; - t.tv_usec = atv->tv_usec; - s = spl7(); time = t; (void) splx(s); - resettodr(atv); + /* drop the setting of the clock for now. spl7 is not + * known on hpux11.22 + */ + register ulong_t s; + struct timeval t; + t.tv_sec = atv->tv_sec; + t.tv_usec = atv->tv_usec; + s = spl7(); + time = t; + (void)splx(s); + resettodr(atv); #endif } #else { - register int s; - s = splclock(); time = *atv; (void) splx(s); + register int s; + s = splclock(); + time = *atv; + (void)splx(s); } resettodr(); #endif #ifdef AFS_AUX_ENV logtchg(atv->tv_sec); #endif -#endif /* AFS_DARWIN_ENV */ -#endif /* AFS_FBSD_ENV */ -#endif /* AFS_SGI_ENV */ -#endif /* AFS_SUN55_ENV */ -#endif /* AFS_SUN5_ENV */ -#endif /* AFS_AIX32_ENV */ +#endif /* AFS_DARWIN_ENV */ AFS_STATCNT(osi_SetTime); - return 0; } #endif /* AFS_LINUX20_ENV */ -void *afs_osi_Alloc(size_t x) +void * +afs_osi_Alloc(size_t x) { register struct osimem *tm = NULL; register int size; AFS_STATCNT(osi_Alloc); /* 0-length allocs may return NULL ptr from AFS_KALLOC, so we special-case - things so that NULL returned iff an error occurred */ - if (x == 0) return &memZero; + * things so that NULL returned iff an error occurred */ + if (x == 0) + return &memZero; AFS_STATS(afs_stats_cmperf.OutStandingAllocs++); AFS_STATS(afs_stats_cmperf.OutStandingMemUsage += x); #ifdef AFS_LINUX20_ENV return osi_linux_alloc(x, 1); +#elif defined(AFS_FBSD_ENV) + return osi_fbsd_alloc(x, 1); #else size = x; - tm = (struct osimem *) AFS_KALLOC(size); + tm = (struct osimem *)AFS_KALLOC(size); #ifdef AFS_SUN_ENV if (!tm) osi_Panic("osi_Alloc: Couldn't allocate %d bytes; out of memory!\n", size); #endif - return (char *) tm; + return (void *)tm; #endif } #if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) -void *afs_osi_Alloc_NoSleep(size_t x) +void * +afs_osi_Alloc_NoSleep(size_t x) { register struct osimem *tm; register int size; AFS_STATCNT(osi_Alloc); /* 0-length allocs may return NULL ptr from AFS_KALLOC, so we special-case - things so that NULL returned iff an error occurred */ - if (x == 0) return &memZero; + * things so that NULL returned iff an error occurred */ + if (x == 0) + return &memZero; size = x; AFS_STATS(afs_stats_cmperf.OutStandingAllocs++); AFS_STATS(afs_stats_cmperf.OutStandingMemUsage += x); - tm = (struct osimem *) AFS_KALLOC_NOSLEEP(size); - return (char *) tm; + tm = (struct osimem *)AFS_KALLOC_NOSLEEP(size); + return (void *)tm; } -#endif /* SUN || SGI */ +#endif /* SUN || SGI */ -void afs_osi_Free(void *x, size_t asize) +void +afs_osi_Free(void *x, size_t asize) { - register struct osimem *tm, **lm, *um; - AFS_STATCNT(osi_Free); - if (x == &memZero) return; /* check for putting memZero back */ + if (x == &memZero) + return; /* check for putting memZero back */ AFS_STATS(afs_stats_cmperf.OutStandingAllocs--); AFS_STATS(afs_stats_cmperf.OutStandingMemUsage -= asize); -#ifdef AFS_LINUX20_ENV +#if defined(AFS_LINUX20_ENV) osi_linux_free(x); +#elif defined(AFS_FBSD_ENV) + osi_fbsd_free(x); #else AFS_KFREE((struct osimem *)x, asize); #endif } -void afs_osi_FreeStr(char *x) +void +afs_osi_FreeStr(char *x) { afs_osi_Free(x, strlen(x) + 1); } -/* ? is it moderately likely that there are dirty VM pages associated with +/* ? is it moderately likely that there are dirty VM pages associated with * this vnode? * * Prereqs: avc must be write-locked * - * System Dependencies: - *must* support each type of system for which - * memory mapped files are supported, even if all + * System Dependencies: - *must* support each type of system for which + * memory mapped files are supported, even if all * it does is return TRUE; * * NB: this routine should err on the side of caution for ProcessFS to work @@ -516,39 +512,37 @@ void afs_osi_FreeStr(char *x) */ #ifdef notdef int -osi_VMDirty_p(avc) - struct vcache *avc; +osi_VMDirty_p(struct vcache *avc) { int dirtyPages; if (avc->execsOrWriters <= 0) - return 0; /* can't be many dirty pages here, I guess */ - -#if defined (AFS_AIX32_ENV) + return 0; /* can't be many dirty pages here, I guess */ + +#if defined (AFS_AIX32_ENV) #ifdef notdef /* because of the level of hardware involvment with VM and all the * warnings about "This routine must be called at VMM interrupt * level", I thought it would be safest to disable interrupts while * looking at the software page fault table. */ - /* convert vm handle into index into array: I think that stoinio is + /* convert vm handle into index into array: I think that stoinio is * always zero... Look into this XXX */ #define VMHASH(handle) ( \ ( ((handle) & ~vmker.stoinio) \ ^ ((((handle) & ~vmker.stoinio) & vmker.stoimask) << vmker.stoihash) \ - ) & 0x000fffff) + ) & 0x000fffff) - if (avc->vmh) { + if (avc->segid) { unsigned int pagef, pri, index, next; - extern struct vmkerdata vmker; - index = VMHASH(avc->vmh); - if (scb_valid(index)) { /* could almost be an ASSERT */ + index = VMHASH(avc->segid); + if (scb_valid(index)) { /* could almost be an ASSERT */ pri = disable_ints(); for (pagef = scb_sidlist(index); pagef >= 0; pagef = next) { next = pft_sidfwd(pagef); - if (pft_modbit(pagef)) { /* has page frame been modified? */ + if (pft_modbit(pagef)) { /* has page frame been modified? */ enable_ints(pri); return 1; } @@ -562,15 +556,15 @@ osi_VMDirty_p(avc) #if defined (AFS_SUN_ENV) if (avc->states & CMAPPED) { - struct page * pg; - for (pg = avc->v.v_s.v_Pages ; pg ; pg = pg->p_vpnext) { + struct page *pg; + for (pg = avc->v.v_s.v_Pages; pg; pg = pg->p_vpnext) { if (pg->p_mod) { return 1; } } } #endif -return 0; + return 0; } #endif /* notdef */ @@ -590,9 +584,7 @@ return 0; * Locking: the vcache entry lock is held. It is dropped and re-obtained. */ void -osi_ReleaseVM(avc, acred) - struct vcache *avc; - struct AFS_UCRED *acred; +osi_ReleaseVM(struct vcache *avc, struct AFS_UCRED *acred) { #ifdef AFS_SUN5_ENV AFS_GUNLOCK(); @@ -608,25 +600,26 @@ osi_ReleaseVM(avc, acred) } -void shutdown_osi() +void +shutdown_osi(void) { - extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osi); if (afs_cold_shutdown) { - LOCK_INIT(&afs_ftf, "afs_ftf"); - } + LOCK_INIT(&afs_ftf, "afs_ftf"); + } } -afs_osi_suser(credp) - void * credp; +#ifndef AFS_OBSD_ENV +int +afs_osi_suser(void *credp) { -#ifdef AFS_SUN5_ENV - return afs_suser(credp); +#if defined(AFS_SUN5_ENV) + return afs_suser(credp); #else - return afs_suser(); + return afs_suser(); #endif } +#endif #if AFS_GCPAGS @@ -635,7 +628,8 @@ afs_osi_suser(credp) */ #if defined(AFS_SUN5_ENV) -void afs_osi_TraverseProcTable() +void +afs_osi_TraverseProcTable(void) { struct proc *prp; for (prp = practive; prp != NULL; prp = prp->p_next) { @@ -657,7 +651,8 @@ void afs_osi_TraverseProcTable() * changes. To be safe, we use both. */ -void afs_osi_TraverseProcTable() +void +afs_osi_TraverseProcTable(void) { register proc_t *p; int endchain = 0; @@ -675,7 +670,7 @@ void afs_osi_TraverseProcTable() * consistent view of the current set of creds. */ - for(p = proc; endchain == 0; p = &proc[p->p_fandx]) { + for (p = proc; endchain == 0; p = &proc[p->p_fandx]) { if (p->p_fandx == 0) { endchain = 1; } @@ -683,9 +678,9 @@ void afs_osi_TraverseProcTable() if (system_proc(p)) continue; - mp_mtproc_lock(p); + mp_mtproc_lock(p); afs_GCPAGs_perproc_func(p); - mp_mtproc_unlock(p); + mp_mtproc_unlock(p); } pcred_unlock(); @@ -698,34 +693,41 @@ void afs_osi_TraverseProcTable() #ifdef AFS_SGI65_ENV /* TODO: Fix this later. */ -static int SGI_ProcScanFunc(void *p, void *arg, int mode) +static int +SGI_ProcScanFunc(void *p, void *arg, int mode) { return 0; } -#else /* AFS_SGI65_ENV */ -static int SGI_ProcScanFunc(proc_t *p, void *arg, int mode) +#else /* AFS_SGI65_ENV */ +static int +SGI_ProcScanFunc(proc_t * p, void *arg, int mode) { - afs_int32 (*perproc_func)(struct proc *) = arg; - int code=0; + afs_int32(*perproc_func) (struct proc *) = arg; + int code = 0; /* we pass in the function pointer for arg, - * mode ==0 for startup call, ==1 for each valid proc, + * mode ==0 for startup call, ==1 for each valid proc, * and ==2 for terminate call. */ - if(mode == 1) { + if (mode == 1) { code = perproc_func(p); } return code; } -#endif /* AFS_SGI65_ENV */ +#endif /* AFS_SGI65_ENV */ -void afs_osi_TraverseProcTable() +void +afs_osi_TraverseProcTable(void) { procscan(SGI_ProcScanFunc, afs_GCPAGs_perproc_func); } -#endif /* AFS_SGI_ENV */ +#endif /* AFS_SGI_ENV */ #if defined(AFS_AIX_ENV) -void afs_osi_TraverseProcTable() +#ifdef AFS_AIX51_ENV +#define max_proc v.ve_proc +#endif +void +afs_osi_TraverseProcTable(void) { struct proc *p; int i; @@ -738,17 +740,27 @@ void afs_osi_TraverseProcTable() if (!afs_gcpags_procsize) return; +#ifndef AFS_AIX51_ENV simple_lock(&proc_tbl_lock); - for (p = (struct proc *)v.vb_proc, i = 0; - p < max_proc; +#endif + for (p = (struct proc *)v.vb_proc, i = 0; p < max_proc; p = (struct proc *)((char *)p + afs_gcpags_procsize), i++) { +#ifdef AFS_AIX51_ENV + if (p->p_pvprocp->pv_stat == SNONE) + continue; + if (p->p_pvprocp->pv_stat == SIDL) + continue; + if (p->p_pvprocp->pv_stat == SEXIT) + continue; +#else if (p->p_stat == SNONE) continue; if (p->p_stat == SIDL) continue; if (p->p_stat == SEXIT) continue; +#endif /* sanity check */ @@ -766,49 +778,52 @@ void afs_osi_TraverseProcTable() afs_GCPAGs_perproc_func(p); } +#ifndef AFS_AIX51_ENV simple_unlock(&proc_tbl_lock); +#endif } #endif #if defined(AFS_OSF_ENV) -void afs_osi_TraverseProcTable() +void +afs_osi_TraverseProcTable(void) { struct pid_entry *pe; #ifdef AFS_DUX50_ENV -extern struct pid_entry *pidtab; -extern int npid; #define pidNPID (pidtab + npid) #define PID_LOCK() #define PID_UNLOCK() #endif PID_LOCK(); for (pe = pidtab; pe < pidNPID; ++pe) { - if (pe->pe_proc != PROC_NULL) - afs_GCPAGs_perproc_func(pe->pe_proc); + if (pe->pe_proc != PROC_NULL) + afs_GCPAGs_perproc_func(pe->pe_proc); } PID_UNLOCK(); } #endif #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) -void afs_osi_TraverseProcTable() -{ +void +afs_osi_TraverseProcTable(void) +{ struct proc *p; LIST_FOREACH(p, &allproc, p_list) { - if (p->p_stat == SIDL) - continue; - if (p->p_stat == SZOMB) - continue; - if (p->p_flag & P_SYSTEM) - continue; - afs_GCPAGs_perproc_func(p); + if (p->p_stat == SIDL) + continue; + if (p->p_stat == SZOMB) + continue; + if (p->p_flag & P_SYSTEM) + continue; + afs_GCPAGs_perproc_func(p); } -} +} #endif #if defined(AFS_LINUX22_ENV) -void afs_osi_TraverseProcTable() -{ +void +afs_osi_TraverseProcTable() +{ struct task_struct *p; #ifdef EXPORTED_TASKLIST_LOCK @@ -816,21 +831,21 @@ void afs_osi_TraverseProcTable() #endif #ifdef DEFINED_FOR_EACH_PROCESS for_each_process(p) if (p->pid) { - if (p->state & TASK_ZOMBIE) - continue; + if (p->state & TASK_ZOMBIE) + continue; afs_GCPAGs_perproc_func(p); } #else for_each_task(p) if (p->pid) { - if (p->state & TASK_ZOMBIE) - continue; + if (p->state & TASK_ZOMBIE) + continue; afs_GCPAGs_perproc_func(p); } #endif #ifdef EXPORTED_TASKLIST_LOCK read_unlock(&tasklist_lock); #endif -} +} #endif /* return a pointer (sometimes a static copy ) to the cred for a @@ -839,12 +854,14 @@ void afs_osi_TraverseProcTable() */ #if defined(AFS_SGI65_ENV) -const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr) +const struct AFS_UCRED * +afs_osi_proc2cred(AFS_PROC * p) { return NULL; } #elif defined(AFS_HPUX_ENV) -const struct AFS_UCRED *afs_osi_proc2cred(proc_t *p) +const struct AFS_UCRED * +afs_osi_proc2cred(AFS_PROC * p) { if (!p) return; @@ -861,9 +878,6 @@ const struct AFS_UCRED *afs_osi_proc2cred(proc_t *p) /* GLOBAL DECLARATIONS */ -extern int xmattach(); /* fills out cross memory descriptor */ -extern int xmdetach(); /* decrements reference count to segment */ - /* * LOCKS: the caller must do * simple_lock(&proc_tbl_lock); @@ -871,7 +885,8 @@ extern int xmdetach(); /* decrements reference count to segment */ * around calls to this function. */ -const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pproc) +const struct AFS_UCRED * +afs_osi_proc2cred(AFS_PROC * pproc) { struct AFS_UCRED *pcred = 0; @@ -893,7 +908,7 @@ const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pproc) int xm; /* xmem result */ if (!pproc) { - return pcred; + return pcred; } /* @@ -914,46 +929,61 @@ const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pproc) xmem_userp = NULL; xm = XMEM_FAIL; /* simple_lock(&proc_tbl_lock); */ +#ifdef __64BIT__ + if (pproc->p_adspace != vm_handle(NULLSEGID, (int32long64_t) 0)) { +#else if (pproc->p_adspace != NULLSEGVAL) { +#endif +#ifdef AFS_AIX51_ENV + simple_lock(&pproc->p_pvprocp->pv_lock); +#else simple_lock(&pproc->p_lock); +#endif if (pproc->p_threadcount && +#ifdef AFS_AIX51_ENV + pproc->p_pvprocp->pv_threadlist) { +#else pproc->p_threadlist) { +#endif /* * arbitrarily pick the first thread in pproc */ struct thread *pproc_thread = +#ifdef AFS_AIX51_ENV + pproc->p_pvprocp->pv_threadlist; +#else pproc->p_threadlist; +#endif /* * location of 'struct user' in pproc's * address space */ - struct user *pproc_userp = - pproc_thread->t_userp; + struct user *pproc_userp = pproc_thread->t_userp; /* * create a pointer valid in my own address space */ - xmem_userp = - (struct user *)vm_att(pproc->p_adspace, - pproc_userp); + xmem_userp = (struct user *)vm_att(pproc->p_adspace, pproc_userp); dp.aspace_id = XMEM_INVAL; - xm = xmattach(xmem_userp, - sizeof(*xmem_userp), - &dp, SYS_ADSPACE); + xm = xmattach(xmem_userp, sizeof(*xmem_userp), &dp, SYS_ADSPACE); } +#ifdef AFS_AIX51_ENV + simple_unlock(&pproc->p_pvprocp->pv_lock); +#else simple_unlock(&pproc->p_lock); +#endif } /* simple_unlock(&proc_tbl_lock); */ if (xm == XMEM_SUCC) { - static struct AFS_UCRED cred; + static struct AFS_UCRED cred; /* * What locking should we use to protect access to the user @@ -974,81 +1004,87 @@ const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pproc) } #elif defined(AFS_OSF_ENV) -const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr) +const struct AFS_UCRED * +afs_osi_proc2cred(AFS_PROC * pr) { - struct AFS_UCRED *rv=NULL; + struct AFS_UCRED *rv = NULL; - if(pr == NULL) { - return NULL; + if (pr == NULL) { + return NULL; } - if((pr->p_stat == SSLEEP) || - (pr->p_stat == SRUN) || - (pr->p_stat == SSTOP)) - rv = pr->p_rcred; + if ((pr->p_stat == SSLEEP) || (pr->p_stat == SRUN) + || (pr->p_stat == SSTOP)) + rv = pr->p_rcred; return rv; } #elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) -const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr) -{ - struct AFS_UCRED *rv=NULL; +const struct AFS_UCRED * +afs_osi_proc2cred(AFS_PROC * pr) +{ + struct AFS_UCRED *rv = NULL; static struct AFS_UCRED cr; - if(pr == NULL) { - return NULL; + if (pr == NULL) { + return NULL; } - - if((pr->p_stat == SSLEEP) || - (pr->p_stat == SRUN) || - (pr->p_stat == SSTOP)) { - pcred_readlock(pr); - cr.cr_ref=1; - cr.cr_uid=pr->p_cred->pc_ucred->cr_uid; - cr.cr_ngroups=pr->p_cred->pc_ucred->cr_ngroups; - memcpy(cr.cr_groups, pr->p_cred->pc_ucred->cr_groups, NGROUPS * - sizeof(gid_t)); - pcred_unlock(pr); - rv = &cr; + + if ((pr->p_stat == SSLEEP) || (pr->p_stat == SRUN) + || (pr->p_stat == SSTOP)) { + pcred_readlock(pr); + cr.cr_ref = 1; + cr.cr_uid = pr->p_cred->pc_ucred->cr_uid; + cr.cr_ngroups = pr->p_cred->pc_ucred->cr_ngroups; + memcpy(cr.cr_groups, pr->p_cred->pc_ucred->cr_groups, + NGROUPS * sizeof(gid_t)); + pcred_unlock(pr); + rv = &cr; } - + return rv; -} +} #elif defined(AFS_LINUX22_ENV) -const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr) -{ - struct AFS_UCRED *rv=NULL; +const struct AFS_UCRED * +afs_osi_proc2cred(AFS_PROC * pr) +{ + struct AFS_UCRED *rv = NULL; static struct AFS_UCRED cr; - if(pr == NULL) { - return NULL; + if (pr == NULL) { + return NULL; } - - if ((pr->state == TASK_RUNNING) || - (pr->state == TASK_INTERRUPTIBLE) || - (pr->state == TASK_UNINTERRUPTIBLE) || - (pr->state == TASK_STOPPED)) { - cr.cr_ref=1; - cr.cr_uid=pr->uid; - cr.cr_ngroups=pr->ngroups; + + if ((pr->state == TASK_RUNNING) || (pr->state == TASK_INTERRUPTIBLE) + || (pr->state == TASK_UNINTERRUPTIBLE) + || (pr->state == TASK_STOPPED)) { + cr.cr_ref = 1; + cr.cr_uid = pr->uid; +#if defined(AFS_LINUX26_ENV) + get_group_info(pr->group_info); + cr.cr_group_info = pr->group_info; +#else + cr.cr_ngroups = pr->ngroups; memcpy(cr.cr_groups, pr->groups, NGROUPS * sizeof(gid_t)); +#endif rv = &cr; } - + return rv; -} +} #else -const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr) +const struct AFS_UCRED * +afs_osi_proc2cred(AFS_PROC * pr) { - struct AFS_UCRED *rv=NULL; + struct AFS_UCRED *rv = NULL; - if(pr == NULL) { - return NULL; + if (pr == NULL) { + return NULL; } - rv = pr->p_cred; + rv = pr->p_cred; return rv; } #endif -#endif /* AFS_GCPAGS */ +#endif /* AFS_GCPAGS */ diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index e708f4dd4..a573e8978 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -10,21 +10,27 @@ #ifndef _AFS_OSI_ #define _AFS_OSI_ -#include "../h/types.h" -#include "../h/param.h" +#include "h/types.h" +#include "h/param.h" + +#ifdef AFS_FBSD50_ENV +#include +#endif #ifdef AFS_LINUX20_ENV #ifndef _LINUX_CODA_FS_I #define _LINUX_CODA_FS_I #define _CODA_HEADER_ -struct coda_inode_info {}; +struct coda_inode_info { +}; #endif #ifndef _LINUX_XFS_FS_I #define _LINUX_XFS_FS_I -struct xfs_inode_info {}; +struct xfs_inode_info { +}; #endif -#include "../h/fs.h" -#include "../h/mm.h" +#include "h/fs.h" +#include "h/mm.h" #endif @@ -34,39 +40,55 @@ struct osi_socket { }; struct osi_stat { - afs_int32 size; /* file size in bytes */ - afs_int32 blksize; /* optimal transfer size in bytes */ - afs_int32 mtime; /* modification date */ - afs_int32 atime; /* access time */ + afs_int32 size; /* file size in bytes */ + afs_int32 blksize; /* optimal transfer size in bytes */ + afs_int32 mtime; /* modification date */ + afs_int32 atime; /* access time */ }; struct osi_file { - afs_int32 size; /* file size in bytes XXX Must be first field XXX */ + afs_int32 size; /* file size in bytes XXX Must be first field XXX */ #ifdef AFS_LINUX22_ENV - struct dentry dentry; /* merely to hold the pointer to the inode. */ - struct file file; /* May need this if we really open the file. */ + struct dentry dentry; /* merely to hold the pointer to the inode. */ + struct file file; /* May need this if we really open the file. */ #else struct vnode *vnode; #endif #if defined(AFS_HPUX102_ENV) k_off_t offset; +#else +#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) + afs_offs_t offset; #else afs_int32 offset; #endif - int (*proc)(); /* proc, which, if not null, is called on writes */ - char *rock; /* rock passed to proc */ - ino_t inum; /* guarantee validity of hint */ +#endif + int (*proc) (struct osi_file * afile, afs_int32 code); /* proc, which, if not null, is called on writes */ + char *rock; /* rock passed to proc */ + ino_t inum; /* guarantee validity of hint */ #if defined(UKERNEL) - int fd; /* file descriptor for user space files */ -#endif /* defined(UKERNEL) */ + int fd; /* file descriptor for user space files */ +#endif /* defined(UKERNEL) */ }; struct osi_dev { +#if defined(AFS_XBSD_ENV) + struct mount *mp; + struct vnode *held_vnode; +#elif defined(AFS_AIX42_ENV) + dev_t dev; +#else afs_int32 dev; +#endif }; struct afs_osi_WaitHandle { - caddr_t proc; /* process waiting */ +#ifdef AFS_FBSD50_ENV + struct cv wh_condvar; + int wh_inited; /* XXX */ +#else + caddr_t proc; /* process waiting */ +#endif }; #define osi_SetFileProc(x,p) ((x)->proc=(p)) @@ -82,34 +104,24 @@ struct afs_osi_WaitHandle { #endif -#define AFSOP_STOP_RXEVENT 214 /* stop rx event deamon */ -#define AFSOP_STOP_COMPLETE 215 /* afs has been shutdown */ -#define AFSOP_STOP_RXK_LISTENER 217 /* stop rx listener daemon */ - +#define AFSOP_STOP_RXEVENT 214 /* stop rx event deamon */ +#define AFSOP_STOP_COMPLETE 215 /* afs has been shutdown */ +#define AFSOP_STOP_RXK_LISTENER 217 /* stop rx listener daemon */ -#define osi_NPACKETS 20 /* number of cluster pkts to alloc */ -extern struct osi_socket *osi_NewSocket(); +#define osi_NPACKETS 20 /* number of cluster pkts to alloc */ /* * Alloc declarations. */ -extern void *afs_osi_Alloc(size_t size); -extern void afs_osi_Free(void *x, size_t size); #define afs_osi_Alloc_NoSleep afs_osi_Alloc -extern void *osi_AllocSmallSpace(size_t size); -extern void osi_FreeSmallSpace(void *x); -extern void *osi_AllocMediumSpace(size_t size); -extern void osi_FreeMediumSpace(void *x); -extern void *osi_AllocLargeSpace(size_t size); -extern void osi_FreeLargeSpace(void *x); - /* * Vnode related macros */ +#ifndef AFS_OBSD_ENV #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) -extern int (**afs_vnodeop_p)(); +extern int (**afs_vnodeop_p) (); #define IsAfsVnode(vc) ((vc)->v_op == afs_vnodeop_p) #define SetAfsVnode(vc) (vc)->v_op = afs_vnodeop_p #else @@ -120,15 +132,18 @@ extern struct vnodeops *afs_ops; #define vType(vc) (vc)->v.v_type #define vSetType(vc,type) (vc)->v.v_type = (type) #define vSetVfsp(vc,vfsp) (vc)->v.v_vfsp = (vfsp) +#endif #ifdef AFS_SGI65_ENV #define gop_lookupname(fnamep,segflg,followlink,dirvpp,compvpp) \ lookupname((fnamep),(segflg),(followlink),(dirvpp),(compvpp),\ NULL) #else +#ifndef AFS_OBSD_ENV #define gop_lookupname(fnamep,segflg,followlink,dirvpp,compvpp) \ lookupname((fnamep),(segflg),(followlink),(dirvpp),(compvpp)) #endif +#endif /* * In IRIX 6.5 we cannot have DEBUG turned on since certain @@ -141,7 +156,7 @@ extern struct vnodeops *afs_ops; */ #if !defined(AFS_SGI65_ENV) #ifndef DEBUG -#define DEBUG 1 /* Default is to enable debugging/logging */ +#define DEBUG 1 /* Default is to enable debugging/logging */ #endif #endif @@ -183,17 +198,30 @@ typedef struct timeval osi_timeval_t; * is going on in the system. So if ps cannot show thread IDs it is * likely to be the process ID instead. */ +#ifdef AFS_FBSD50_ENV +/* should use curthread, but 'ps' can't display it */ +#define osi_ThreadUnique() curproc +#else #define osi_ThreadUnique() getpid() +#endif #ifdef AFS_GLOBAL_SUNLOCK #define AFS_ASSERT_GLOCK() \ - (ISAFS_GLOCK() || (osi_Panic("afs global lock not held"), 0)) + (ISAFS_GLOCK() || (osi_Panic("afs global lock not held at %s:%d\n", __FILE__, __LINE__), 0)) #define AFS_ASSERT_RXGLOCK() \ - (ISAFS_RXGLOCK() || (osi_Panic("rx global lock not held"), 0)) + (ISAFS_RXGLOCK() || (osi_Panic("rx global lock not held at %s:%d\n", __FILE__, __LINE__), 0)) #endif /* AFS_GLOBAL_SUNLOCK */ +#ifdef RX_ENABLE_LOCKS +#define RX_AFS_GLOCK() AFS_GLOCK() +#define RX_AFS_GUNLOCK() AFS_GUNLOCK() +#else +#define RX_AFS_GLOCK() +#define RX_AFS_GUNLOCK() +#endif + #ifndef KERNEL @@ -227,6 +255,7 @@ typedef struct timeval osi_timeval_t; #else /* defined(UKERNEL) */ #define AFS_RELE(vp) do { AFS_GUNLOCK(); VN_RELE(vp); AFS_GLOCK(); } while (0) #endif /* defined(UKERNEL) */ + /* * For some reason we do bare refcount manipulation in some places, for some * platforms. The assumption is apparently that either we wouldn't call @@ -235,14 +264,14 @@ typedef struct timeval osi_timeval_t; * (Also, of course, the vnode is assumed to be one of ours. Can't use this * macro for V-file vnodes.) */ -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) /* Bare refcount manipulation would probably work on this platform, but just calling VREF does not */ #define AFS_FAST_HOLD(vp) osi_vnhold((vp),0) #else #define AFS_FAST_HOLD(vp) VN_HOLD(&(vp)->v) #endif -#define AFS_FAST_RELE(vp) AFS_RELE(&(vp)->v) +#define AFS_FAST_RELE(vp) AFS_RELE(AFSTOV(vp)) /* * MP safe versions of routines to copy memory between user space @@ -281,7 +310,7 @@ typedef struct timeval osi_timeval_t; AFS_GLOCK(); \ } while(0) -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) #define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \ do { \ int haveGlock = ISAFS_GLOCK(); \ @@ -292,7 +321,7 @@ typedef struct timeval osi_timeval_t; if (haveGlock) \ AFS_GLOCK(); \ } while(0) -#else /* AFS_OSF_ENV || AFS_FBSD_ENV */ +#else #define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \ do { \ int haveGlock = ISAFS_GLOCK(); \ @@ -302,7 +331,7 @@ typedef struct timeval osi_timeval_t; if (haveGlock) \ AFS_GLOCK(); \ } while(0) -#endif /* AFS_OSF_ENV || AFS_FBSD_ENV */ +#endif #else /* AFS_GLOBAL_SUNLOCK */ @@ -321,7 +350,7 @@ typedef struct timeval osi_timeval_t; CODE = copyout((SRC),(DST),(LEN)); \ } while(0) -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) #define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \ do { \ (UIO)->uio_rw = (RW); \ @@ -364,34 +393,18 @@ typedef struct timeval osi_timeval_t; #define AfsLargeFileUio(uio) 0 #define AfsLargeFileSize(pos, off) 0 - -/* VM function prototypes. - */ -#if defined(AFS_SUN5_ENV) -extern int osi_VM_GetDownD(); -extern void osi_VM_PreTruncate(); -#endif -#if defined(AFS_SGI_ENV) -extern void osi_VM_FSyncInval(); -#endif -extern int osi_VM_FlushVCache(); -extern void osi_VM_StoreAllSegments(); -extern void osi_VM_TryToSmush(); -extern void osi_VM_FlushPages(); -extern void osi_VM_Truncate(); - -extern void osi_ReleaseVM(); - /* Now include system specific OSI header file. It will redefine macros * defined here as required by the OS. */ -#include "../afs/osi_machdep.h" +#include "osi_machdep.h" /* Declare any structures which use these macros after the OSI implementation * has had the opportunity to redefine them. */ -extern struct AFS_UCRED afs_osi_cred; - -#endif /* _AFS_OSI_ */ +extern struct AFS_UCRED afs_osi_cred, *afs_osi_credp; +#ifndef osi_curcred +#define osi_curcred() (u.u_cred) +#endif +#endif /* _AFS_OSI_ */ diff --git a/src/afs/afs_osi_alloc.c b/src/afs/afs_osi_alloc.c index d0065eded..ae342cb54 100644 --- a/src/afs/afs_osi_alloc.c +++ b/src/afs/afs_osi_alloc.c @@ -8,16 +8,18 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi_alloc.c,v 1.1.1.4 2001/07/14 22:19:22 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_osi_alloc.c,v 1.10 2004/03/10 23:01:51 rees Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ +#ifndef AFS_FBSD_ENV #ifdef AFS_AIX41_ENV #include "sys/lockl.h" #include "sys/sleep.h" @@ -32,29 +34,29 @@ afs_lock_t osi_fsplock; static struct osi_packet { struct osi_packet *next; -} *freePacketList = 0, *freeSmallList, *freeMediumList; +} *freePacketList = NULL, *freeSmallList; afs_lock_t osi_flplock; afs_int32 afs_preallocs = 512; /* Reserve space for all small allocs! */ -void osi_AllocMoreSSpace(preallocs) - register afs_int32 preallocs; +void +osi_AllocMoreSSpace(register afs_int32 preallocs) { register int i; char *p; - p = (char *) afs_osi_Alloc(AFS_SMALLOCSIZ * preallocs); -#ifdef AFS_AIX32_ENV + p = (char *)afs_osi_Alloc(AFS_SMALLOCSIZ * preallocs); +#ifdef KERNEL_HAVE_PIN pin(p, AFS_SMALLOCSIZ * preallocs); /* XXXX */ #endif - for (i=0; i < preallocs; i++, p += AFS_SMALLOCSIZ) { + for (i = 0; i < preallocs; i++, p += AFS_SMALLOCSIZ) { #ifdef AFS_AIX32_ENV - *p = '\0'; /* page fault it in. */ + *p = '\0'; /* page fault it in. */ #endif - osi_FreeSmallSpace((char *) p); + osi_FreeSmallSpace((char *)p); } afs_stats_cmperf.SmallBlocksAlloced += preallocs; - afs_stats_cmperf.SmallBlocksActive += preallocs; + afs_stats_cmperf.SmallBlocksActive += preallocs; } @@ -70,7 +72,7 @@ osi_FreeLargeSpace(void *adata) AFS_STATCNT(osi_FreeLargeSpace); afs_stats_cmperf.LargeBlocksActive--; - MObtainWriteLock(&osi_flplock,322); + MObtainWriteLock(&osi_flplock, 322); ((struct osi_packet *)adata)->next = freePacketList; freePacketList = adata; MReleaseWriteLock(&osi_flplock); @@ -92,42 +94,44 @@ osi_FreeSmallSpace(void *adata) AFS_STATCNT(osi_FreeSmallSpace); afs_stats_cmperf.SmallBlocksActive--; #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV) - x = splnet(); /*lockl(&osi_fsplock, LOCK_SHORT);*/ + x = splnet(); /*lockl(&osi_fsplock, LOCK_SHORT); */ #else - MObtainWriteLock(&osi_fsplock,323); + MObtainWriteLock(&osi_fsplock, 323); #endif ((struct osi_packet *)adata)->next = freeSmallList; freeSmallList = adata; #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV) - splx(x); /*unlockl(&osi_fsplock);*/ + splx(x); /*unlockl(&osi_fsplock); */ #else MReleaseWriteLock(&osi_fsplock); #endif } #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV) -osi_AllocMoreMSpace(preallocs) - register afs_int32 preallocs; +static struct osi_packet *freeMediumList; + +osi_AllocMoreMSpace(register afs_int32 preallocs) { register int i; char *p; - p = (char *) afs_osi_Alloc(AFS_MDALLOCSIZ * preallocs); -#ifdef AFS_AIX32_ENV + p = (char *)afs_osi_Alloc(AFS_MDALLOCSIZ * preallocs); +#ifdef KERNEL_HAVE_PIN pin(p, AFS_MDALLOCSIZ * preallocs); /* XXXX */ #endif - for (i=0; i < preallocs; i++, p += AFS_MDALLOCSIZ) { + for (i = 0; i < preallocs; i++, p += AFS_MDALLOCSIZ) { #ifdef AFS_AIX32_ENV - *p = '\0'; /* page fault it in. */ + *p = '\0'; /* page fault it in. */ #endif - osi_FreeMediumSpace((char *) p); + osi_FreeMediumSpace((char *)p); } afs_stats_cmperf.MediumBlocksAlloced += preallocs; - afs_stats_cmperf.MediumBlocksActive += preallocs; + afs_stats_cmperf.MediumBlocksActive += preallocs; } -void *osi_AllocMediumSpace(size_t size) +void * +osi_AllocMediumSpace(size_t size) { register struct osi_packet *tp; #if defined(AFS_AIX32_ENV) @@ -138,13 +142,14 @@ void *osi_AllocMediumSpace(size_t size) #endif afs_stats_cmperf.MediumBlocksActive++; - retry: + retry: x = splnet(); tp = freeMediumList; - if ( tp ) freeMediumList = tp->next; + if (tp) + freeMediumList = tp->next; splx(x); if (!tp) { - osi_AllocMoreMSpace(AFS_MALLOC_LOW_WATER); + osi_AllocMoreMSpace(AFS_MALLOC_LOW_WATER); goto retry; } return tp; @@ -171,7 +176,8 @@ osi_FreeMediumSpace(void *adata) /* allocate space for sender */ -void *osi_AllocLargeSpace(size_t size) +void * +osi_AllocLargeSpace(size_t size) { register struct osi_packet *tp; @@ -185,22 +191,23 @@ void *osi_AllocLargeSpace(size_t size) char *p; afs_stats_cmperf.LargeBlocksAlloced++; - p = (char *) afs_osi_Alloc(AFS_LRALLOCSIZ); -#ifdef AFS_AIX32_ENV + p = (char *)afs_osi_Alloc(AFS_LRALLOCSIZ); +#ifdef KERNEL_HAVE_PIN /* * Need to pin this memory since under heavy conditions this memory - * could be swapped out; the problem is that we could inside rx where - * interrupts are disabled and thus we would panic if we don't pin it. - */ - pin(p, AFS_LRALLOCSIZ); + * could be swapped out; the problem is that we could inside rx where + * interrupts are disabled and thus we would panic if we don't pin it. + */ + pin(p, AFS_LRALLOCSIZ); #endif return p; } - MObtainWriteLock(&osi_flplock,324); + MObtainWriteLock(&osi_flplock, 324); tp = freePacketList; - if ( tp ) freePacketList = tp->next; + if (tp) + freePacketList = tp->next; MReleaseWriteLock(&osi_flplock); - return (char *) tp; + return (char *)tp; } #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV) @@ -208,9 +215,9 @@ void *osi_AllocLargeSpace(size_t size) * XXX We could have used a macro around osi_AllocSmallSpace but it's * probably better like this so that we can remove this at some point. */ -char *osi_AllocSmall(size, morespace) - register afs_int32 morespace; /* 1 - means we called at splnet level */ - register afs_int32 size; +/* morespace 1 - means we called at splnet level */ +char * +osi_AllocSmall(register afs_int32 size, register afs_int32 morespace) { register struct osi_packet *tp; #if defined(AFS_AIX32_ENV) @@ -223,32 +230,37 @@ char *osi_AllocSmall(size, morespace) AFS_ASSERT_GLOCK(); AFS_STATCNT(osi_AllocSmallSpace); - if (size > AFS_SMALLOCSIZ) osi_Panic("osi_AllocSmall, size=%d", size); - if ((!morespace && - ((afs_stats_cmperf.SmallBlocksAlloced - afs_stats_cmperf.SmallBlocksActive) - <= AFS_SALLOC_LOW_WATER)) + if (size > AFS_SMALLOCSIZ) + osi_Panic("osi_AllocSmall, size=%d", size); + if ((!morespace + && + ((afs_stats_cmperf.SmallBlocksAlloced - + afs_stats_cmperf.SmallBlocksActive) + <= AFS_SALLOC_LOW_WATER)) || !freeSmallList) { osi_AllocMoreSSpace(AFS_SALLOC_LOW_WATER * 2); } afs_stats_cmperf.SmallBlocksActive++; #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV) - x = splnet(); /*lockl(&osi_fsplock, LOCK_SHORT);*/ + x = splnet(); /*lockl(&osi_fsplock, LOCK_SHORT); */ #else - MObtainWriteLock(&osi_fsplock,325); + MObtainWriteLock(&osi_fsplock, 325); #endif tp = freeSmallList; - if ( tp ) freeSmallList = tp->next; + if (tp) + freeSmallList = tp->next; #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV) - splx(x); /*unlockl(&osi_fsplock);*/ + splx(x); /*unlockl(&osi_fsplock); */ #else MReleaseWriteLock(&osi_fsplock); #endif - return (char *) tp; + return (char *)tp; } -osi_FreeSmall(adata) - register struct osi_packet *adata; { +int +osi_FreeSmall(register struct osi_packet *adata) +{ #if defined(AFS_AIX32_ENV) int x; #endif @@ -259,14 +271,14 @@ osi_FreeSmall(adata) AFS_STATCNT(osi_FreeSmallSpace); afs_stats_cmperf.SmallBlocksActive--; #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV) - x = splnet(); /*lockl(&osi_fsplock, LOCK_SHORT);*/ + x = splnet(); /*lockl(&osi_fsplock, LOCK_SHORT); */ #else - MObtainWriteLock(&osi_fsplock,326); + MObtainWriteLock(&osi_fsplock, 326); #endif adata->next = freeSmallList; freeSmallList = adata; #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV) - splx(x); /*unlockl(&osi_fsplock);*/ + splx(x); /*unlockl(&osi_fsplock); */ #else MReleaseWriteLock(&osi_fsplock); #endif @@ -275,7 +287,8 @@ osi_FreeSmall(adata) #endif /* AFS_AIX32_ENV || AFS_HPUX_ENV */ /* allocate space for sender */ -void *osi_AllocSmallSpace(size_t size) +void * +osi_AllocSmallSpace(size_t size) { register struct osi_packet *tp; #if defined(AFS_AIX32_ENV) @@ -286,15 +299,17 @@ void *osi_AllocSmallSpace(size_t size) #endif AFS_STATCNT(osi_AllocSmallSpace); - if (size > AFS_SMALLOCSIZ) osi_Panic("osi_AllocSmallS: size=%d\n", size); + if (size > AFS_SMALLOCSIZ) + osi_Panic("osi_AllocSmallS: size=%d\n", size); #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV) /* * We're running out of free blocks (< 50); get some more ourselves so that * when we don't run out of them when called under splnet() (from rx); */ - if (((afs_stats_cmperf.SmallBlocksAlloced - afs_stats_cmperf.SmallBlocksActive) - <= AFS_SALLOC_LOW_WATER) || !freeSmallList) { + if (((afs_stats_cmperf.SmallBlocksAlloced - + afs_stats_cmperf.SmallBlocksActive) + <= AFS_SALLOC_LOW_WATER) || !freeSmallList) { osi_AllocMoreSSpace(AFS_SALLOC_LOW_WATER * 2); } #else @@ -306,50 +321,52 @@ void *osi_AllocSmallSpace(size_t size) #endif afs_stats_cmperf.SmallBlocksActive++; #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV) - x = splnet(); /*lockl(&osi_fsplock, LOCK_SHORT);*/ + x = splnet(); /*lockl(&osi_fsplock, LOCK_SHORT); */ #else - MObtainWriteLock(&osi_fsplock,327); + MObtainWriteLock(&osi_fsplock, 327); #endif tp = freeSmallList; - if ( tp ) freeSmallList = tp->next; + if (tp) + freeSmallList = tp->next; #if defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV) - splx(x); /*unlockl(&osi_fsplock);*/ + splx(x); /*unlockl(&osi_fsplock); */ #else MReleaseWriteLock(&osi_fsplock); #endif - return (char *) tp; + return (char *)tp; } -void shutdown_osinet() -{ - extern int afs_cold_shutdown; +void +shutdown_osinet(void) +{ + extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osinet); - if (afs_cold_shutdown) { - struct osi_packet *tp; + AFS_STATCNT(shutdown_osinet); + if (afs_cold_shutdown) { + struct osi_packet *tp; - while (tp = freePacketList) { - freePacketList = tp->next; - afs_osi_Free(tp, AFS_LRALLOCSIZ); -#ifdef AFS_AIX32_ENV - unpin(tp, AFS_LRALLOCSIZ); + while ((tp = freePacketList)) { + freePacketList = tp->next; + afs_osi_Free(tp, AFS_LRALLOCSIZ); +#ifdef KERNEL_HAVE_PIN + unpin(tp, AFS_LRALLOCSIZ); #endif - } + } - while (tp = freeSmallList) { - freeSmallList = tp->next; - afs_osi_Free(tp, AFS_SMALLOCSIZ); -#ifdef AFS_AIX32_ENV - unpin(tp, AFS_SMALLOCSIZ); + while ((tp = freeSmallList)) { + freeSmallList = tp->next; + afs_osi_Free(tp, AFS_SMALLOCSIZ); +#ifdef KERNEL_HAVE_PIN + unpin(tp, AFS_SMALLOCSIZ); #endif - } - afs_preallocs = 512; + } + afs_preallocs = 512; #ifndef AFS_AIX32_ENV - LOCK_INIT(&osi_fsplock, "osi_fsplock"); + LOCK_INIT(&osi_fsplock, "osi_fsplock"); #endif - LOCK_INIT(&osi_flplock, "osi_flplock"); - } + LOCK_INIT(&osi_flplock, "osi_flplock"); + } } - +#endif diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index ed80eef36..036d33e89 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -20,16 +20,17 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi_pag.c,v 1.1.1.7 2003/04/13 19:02:37 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_osi_pag.c,v 1.20 2004/04/21 02:20:21 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" /* Imported variables */ @@ -70,7 +71,9 @@ afs_uint32 pagCounter = 0; * secure (although of course not absolutely secure). */ #if !defined(UKERNEL) || !defined(AFS_WEB_ENHANCEMENTS) -afs_uint32 genpag(void) { +afs_uint32 +genpag(void) +{ AFS_STATCNT(genpag); #ifdef AFS_LINUX20_ENV /* Ensure unique PAG's (mod 200 days) when reloading the client. */ @@ -80,7 +83,9 @@ afs_uint32 genpag(void) { #endif /* AFS_LINUX20_ENV */ } -afs_uint32 getpag(void) { +afs_uint32 +getpag(void) +{ AFS_STATCNT(getpag); #ifdef AFS_LINUX20_ENV /* Ensure unique PAG's (mod 200 days) when reloading the client. */ @@ -95,7 +100,9 @@ afs_uint32 getpag(void) { /* Web enhancement: we don't need to restrict pags to 41XXXXXX since * we are not sharing the space with anyone. So we use the full 32 bits. */ -afs_uint32 genpag(void) { +afs_uint32 +genpag(void) +{ AFS_STATCNT(genpag); #ifdef AFS_LINUX20_ENV return (pag_epoch + pagCounter++); @@ -104,7 +111,9 @@ afs_uint32 genpag(void) { #endif /* AFS_LINUX20_ENV */ } -afs_uint32 getpag(void) { +afs_uint32 +getpag(void) +{ AFS_STATCNT(getpag); #ifdef AFS_LINUX20_ENV /* Ensure unique PAG's (mod 200 days) when reloading the client. */ @@ -132,11 +141,11 @@ afs_uint32 getpag(void) { int #if defined(AFS_SUN5_ENV) -afs_setpag (struct AFS_UCRED **credpp) -#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) -afs_setpag (struct proc *p, void *args, int *retval) +afs_setpag(struct AFS_UCRED **credpp) +#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +afs_setpag(struct proc *p, void *args, int *retval) #else -afs_setpag (void) +afs_setpag(void) #endif { int code = 0; @@ -144,29 +153,30 @@ afs_setpag (void) #if defined(AFS_SGI53_ENV) && defined(MP) /* This is our first chance to get the global lock. */ AFS_GLOCK(); -#endif /* defined(AFS_SGI53_ENV) && defined(MP) */ +#endif /* defined(AFS_SGI53_ENV) && defined(MP) */ AFS_STATCNT(afs_setpag); -#ifdef AFS_SUN5_ENV +#if defined(AFS_SUN5_ENV) if (!afs_suser(*credpp)) +#elif defined(AFS_OBSD_ENV) + if (!afs_osi_suser(p->p_ucred)) #else if (!afs_suser()) #endif { - while (osi_Time() - pag_epoch < pagCounter ) { - afs_osi_Wait(1000, (struct afs_osi_WaitHandle *) 0, 0); - } + while (osi_Time() - pag_epoch < pagCounter) { + afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0); + } } - #if defined(AFS_SUN5_ENV) code = AddPag(genpag(), credpp); -#elif defined(AFS_OSF_ENV) || defined(AFS_FBSD_ENV) +#elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV) code = AddPag(p, genpag(), &p->p_rcred); #elif defined(AFS_AIX41_ENV) { struct ucred *credp; struct ucred *credp0; - + credp = crref(); credp0 = credp; code = AddPag(genpag(), &credp); @@ -192,27 +202,25 @@ afs_setpag (void) code = AddPag(genpag(), &credp); crfree(credp); } -#elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#elif defined(AFS_DARWIN_ENV) { - struct ucred *credp=crdup(p->p_cred->pc_ucred); - code=AddPag(p, genpag(), &credp); - crfree(credp); + struct ucred *credp = crdup(p->p_cred->pc_ucred); + code = AddPag(p, genpag(), &credp); + crfree(credp); } #else code = AddPag(genpag(), &u.u_cred); #endif afs_Trace1(afs_iclSetp, CM_TRACE_SETPAG, ICL_TYPE_INT32, code); -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(KERNEL_HAVE_UERROR) + if (!getuerror()) + setuerror(code); +#endif #if defined(AFS_SGI53_ENV) && defined(MP) AFS_GUNLOCK(); -#endif /* defined(AFS_SGI53_ENV) && defined(MP) */ - return (code); -#else - if (!getuerror()) - setuerror(code); +#endif /* defined(AFS_SGI53_ENV) && defined(MP) */ return (code); -#endif } #if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS) @@ -225,11 +233,11 @@ afs_setpag (void) */ int #if defined(AFS_SUN5_ENV) -afs_setpag_val (struct AFS_UCRED **credpp, int pagval) -#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) -afs_setpag_val (struct proc *p, void *args, int *retval, int pagval) +afs_setpag_val(struct AFS_UCRED **credpp, int pagval) +#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +afs_setpag_val(struct proc *p, void *args, int *retval, int pagval) #else -afs_setpag_val (int pagval) +afs_setpag_val(int pagval) #endif { int code = 0; @@ -237,7 +245,7 @@ afs_setpag_val (int pagval) #if defined(AFS_SGI53_ENV) && defined(MP) /* This is our first chance to get the global lock. */ AFS_GLOCK(); -#endif /* defined(AFS_SGI53_ENV) && defined(MP) */ +#endif /* defined(AFS_SGI53_ENV) && defined(MP) */ AFS_STATCNT(afs_setpag); #ifdef AFS_SUN5_ENV @@ -246,20 +254,19 @@ afs_setpag_val (int pagval) if (!afs_suser()) #endif { - while (osi_Time() - pag_epoch < pagCounter ) { - afs_osi_Wait(1000, (struct afs_osi_WaitHandle *) 0, 0); - } + while (osi_Time() - pag_epoch < pagCounter) { + afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0); + } } - #if defined(AFS_SUN5_ENV) code = AddPag(pagval, credpp); -#elif defined(AFS_OSF_ENV) || defined(AFS_FBSD_ENV) +#elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV) code = AddPag(p, pagval, &p->p_rcred); #elif defined(AFS_AIX41_ENV) { struct ucred *credp; struct ucred *credp0; - + credp = crref(); credp0 = credp; code = AddPag(pagval, &credp); @@ -285,85 +292,88 @@ afs_setpag_val (int pagval) code = AddPag(pagval, &credp); crfree(credp); } -#elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#elif defined(AFS_DARWIN_ENV) { - struct ucred *credp=crdup(p->p_cred->pc_ucred); - code=AddPag(p, pagval, &credp); - crfree(credp); + struct ucred *credp = crdup(p->p_cred->pc_ucred); + code = AddPag(p, pagval, &credp); + crfree(credp); } #else code = AddPag(pagval, &u.u_cred); #endif afs_Trace1(afs_iclSetp, CM_TRACE_SETPAG, ICL_TYPE_INT32, code); -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(KERNEL_HAVE_UERROR) + if (!getuerror()) + setuerror(code); +#endif #if defined(AFS_SGI53_ENV) && defined(MP) AFS_GUNLOCK(); -#endif /* defined(AFS_SGI53_ENV) && defined(MP) */ - return (code); -#else - if (!getuerror()) - setuerror(code); +#endif /* defined(AFS_SGI53_ENV) && defined(MP) */ return (code); -#endif } -#endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */ -#if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS) -int afs_getpag_val() +int +afs_getpag_val() { - int pagvalue; - struct AFS_UCRED *credp = u.u_cred; - int gidset0, gidset1; - - gidset0 = credp->cr_groups[0]; - gidset1 = credp->cr_groups[1]; - pagvalue=afs_get_pag_from_groups(gidset0, gidset1); - return pagvalue; + int pagvalue; + struct AFS_UCRED *credp = u.u_cred; + int gidset0, gidset1; + + gidset0 = credp->cr_groups[0]; + gidset1 = credp->cr_groups[1]; + pagvalue = afs_get_pag_from_groups(gidset0, gidset1); + return pagvalue; } #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */ -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) -int AddPag(struct proc *p, afs_int32 aval, struct AFS_UCRED **credpp) -#else /* AFS_OSF_ENV || AFS_FBSD_ENV */ -int AddPag(afs_int32 aval, struct AFS_UCRED **credpp) +/* Note - needs to be available on AIX, others can be static - rework this */ +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +int +AddPag(struct proc *p, afs_int32 aval, struct AFS_UCRED **credpp) +#else +int +AddPag(afs_int32 aval, struct AFS_UCRED **credpp) #endif { afs_int32 newpag, code; + AFS_STATCNT(AddPag); -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - if (code = setpag(p, credpp, aval, &newpag, 0)) -#else /* AFS_OSF_ENV */ - if (code = setpag(credpp, aval, &newpag, 0)) -#endif -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - return (code); +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + if ((code = setpag(p, credpp, aval, &newpag, 0))) #else + if ((code = setpag(credpp, aval, &newpag, 0))) +#endif +#if defined(KERNEL_HAVE_UERROR) return (setuerror(code), code); +#else + return (code); #endif return 0; } -afs_InitReq(av, acred) - register struct vrequest *av; - struct AFS_UCRED *acred; { - +int +afs_InitReq(register struct vrequest *av, struct AFS_UCRED *acred) +{ AFS_STATCNT(afs_InitReq); - if (afs_shuttingdown) return EIO; + if (afs_shuttingdown) + return EIO; av->uid = PagInCred(acred); if (av->uid == NOPAG) { /* Afs doesn't use the unix uid for anuthing except a handle * with which to find the actual authentication tokens so I * think it's ok to use the real uid to make setuid - * programs (without setpag) to work properly. - */ -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - av->uid = acred->cr_uid; /* default when no pag is set */ - /* bsd creds don't have ruid */ + * programs (without setpag) to work properly. + */ +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + if (acred == NOCRED) + av->uid = -2; /* XXX nobody... ? */ + else + av->uid = acred->cr_uid; /* bsd creds don't have ruid */ #else - av->uid = acred->cr_ruid; /* default when no pag is set */ + av->uid = acred->cr_ruid; /* default when no pag is set */ #endif } av->initd = 0; @@ -372,7 +382,8 @@ afs_InitReq(av, acred) -afs_uint32 afs_get_pag_from_groups(gid_t g0a, gid_t g1a) +afs_uint32 +afs_get_pag_from_groups(gid_t g0a, gid_t g1a) { afs_uint32 g0 = g0a; afs_uint32 g1 = g1a; @@ -400,7 +411,8 @@ afs_uint32 afs_get_pag_from_groups(gid_t g0a, gid_t g1a) } -void afs_get_groups_from_pag(afs_uint32 pag, gid_t *g0p, gid_t *g1p) +void +afs_get_groups_from_pag(afs_uint32 pag, gid_t * g0p, gid_t * g1p) { unsigned short g0, g1; @@ -418,7 +430,8 @@ void afs_get_groups_from_pag(afs_uint32 pag, gid_t *g0p, gid_t *g1p) } -afs_int32 PagInCred(const struct AFS_UCRED *cred) +afs_int32 +PagInCred(const struct AFS_UCRED *cred) { afs_int32 pag; gid_t g0, g1; @@ -427,27 +440,42 @@ afs_int32 PagInCred(const struct AFS_UCRED *cred) if (cred == NULL) { return NOPAG; } -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) if (cred == NOCRED || cred == FSCRED) { - return NOPAG; + return NOPAG; } - if (cred->cr_ngroups < 3) return NOPAG; + if (cred->cr_ngroups < 3) + return NOPAG; /* gid is stored in cr_groups[0] */ g0 = cred->cr_groups[1]; g1 = cred->cr_groups[2]; #else -#ifdef AFS_AIX_ENV +#if defined(AFS_AIX51_ENV) + if (kcred_getpag(cred, PAG_AFS, &pag) < 0 || pag == 0) + pag = NOPAG; + return pag; +#elif defined(AFS_AIX_ENV) if (cred->cr_ngrps < 2) { return NOPAG; } -#else -#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_FBSD_ENV) - if (cred->cr_ngroups < 2) return NOPAG; -#endif +#elif defined(AFS_LINUX26_ENV) + if (cred->cr_group_info->ngroups < 2) + return NOPAG; +#elif defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_XBSD_ENV) + if (cred->cr_ngroups < 2) + return NOPAG; #endif +#if defined(AFS_AIX51_ENV) + g0 = cred->cr_groupset.gs_union.un_groups[0]; + g1 = cred->cr_groupset.gs_union.un_groups[1]; +#elif defined(AFS_LINUX26_ENV) + g0 = GROUP_AT(cred->cr_group_info, 0); + g1 = GROUP_AT(cred->cr_group_info, 1); +#else g0 = cred->cr_groups[0]; g1 = cred->cr_groups[1]; #endif - pag = (afs_int32)afs_get_pag_from_groups(g0, g1); +#endif + pag = (afs_int32) afs_get_pag_from_groups(g0, g1); return pag; } diff --git a/src/afs/afs_osi_uio.c b/src/afs/afs_osi_uio.c index ee17fa622..f3cf5a0ed 100644 --- a/src/afs/afs_osi_uio.c +++ b/src/afs/afs_osi_uio.c @@ -8,16 +8,17 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi_uio.c,v 1.1.1.5 2001/09/11 14:24:42 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_osi_uio.c,v 1.8 2003/07/15 23:14:12 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/nfsclient.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/nfsclient.h" +#include "afs/afs_osidnlc.h" /* @@ -25,29 +26,31 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi_uio.c,v 1.1.1.5 2001/09/11 */ /* routine to make copy of uio structure in ainuio, using aoutvec for space */ -afsio_copy(ainuio, aoutuio, aoutvec) -struct uio *ainuio, *aoutuio; -register struct iovec *aoutvec; { +int +afsio_copy(struct uio *ainuio, struct uio *aoutuio, + register struct iovec *aoutvec) +{ register int i; register struct iovec *tvec; AFS_STATCNT(afsio_copy); - if (ainuio->afsio_iovcnt > AFS_MAXIOVCNT) return EINVAL; + if (ainuio->afsio_iovcnt > AFS_MAXIOVCNT) + return EINVAL; memcpy((char *)aoutuio, (char *)ainuio, sizeof(struct uio)); tvec = ainuio->afsio_iov; aoutuio->afsio_iov = aoutvec; - for(i=0;iafsio_iovcnt;i++){ + for (i = 0; i < ainuio->afsio_iovcnt; i++) { memcpy((char *)aoutvec, (char *)tvec, sizeof(struct iovec)); - tvec++; /* too many compiler bugs to do this as one expr */ + tvec++; /* too many compiler bugs to do this as one expr */ aoutvec++; } return 0; } /* trim the uio structure to the specified size */ -afsio_trim(auio, asize) -register struct uio *auio; -register afs_int32 asize; { +int +afsio_trim(register struct uio *auio, register afs_int32 asize) +{ register int i; register struct iovec *tv; @@ -55,19 +58,19 @@ register afs_int32 asize; { auio->afsio_resid = asize; tv = auio->afsio_iov; /* It isn't clear that multiple iovecs work ok (hasn't been tested!) */ - for(i=0;;i++,tv++) { + for (i = 0;; i++, tv++) { if (i >= auio->afsio_iovcnt || asize <= 0) { /* we're done */ auio->afsio_iovcnt = i; break; } - if (tv->iov_len <= asize) + if (tv->iov_len <= asize) /* entire iovec is included */ - asize -= tv->iov_len; /* this many fewer bytes */ + asize -= tv->iov_len; /* this many fewer bytes */ else { /* this is the last one */ tv->iov_len = asize; - auio->afsio_iovcnt = i+1; + auio->afsio_iovcnt = i + 1; break; } } @@ -75,14 +78,14 @@ register afs_int32 asize; { } /* skip asize bytes in the current uio structure */ -afsio_skip(auio, asize) -register struct uio *auio; -register afs_int32 asize; { +int +afsio_skip(register struct uio *auio, register afs_int32 asize) +{ register struct iovec *tv; /* pointer to current iovec */ register int cnt; AFS_STATCNT(afsio_skip); - /* It isn't guaranteed that multiple iovecs work ok (hasn't been tested!) */ + /* It isn't guaranteed that multiple iovecs work ok (hasn't been tested!) */ while (asize > 0 && auio->afsio_resid) { tv = auio->afsio_iov; cnt = tv->iov_len; @@ -101,4 +104,3 @@ register afs_int32 asize; { } return 0; } - diff --git a/src/afs/afs_osi_vget.c b/src/afs/afs_osi_vget.c index d099028fa..8f6cdd7ab 100644 --- a/src/afs/afs_osi_vget.c +++ b/src/afs/afs_osi_vget.c @@ -12,20 +12,21 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi_vget.c,v 1.1.1.7 2003/04/13 19:02:37 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_osi_vget.c,v 1.10 2003/07/15 23:14:12 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* statistics stuff */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* statistics stuff */ #if !defined(AFS_LINUX20_ENV) /* This is the common part of the vget VFS call. */ -int afs_osi_vget(struct vcache **avcpp, struct fid *afidp, - struct vrequest *areqp) +int +afs_osi_vget(struct vcache **avcpp, struct fid *afidp, struct vrequest *areqp) { struct VenusFid vfid; struct SmallFid Sfid; @@ -58,16 +59,15 @@ int afs_osi_vget(struct vcache **avcpp, struct fid *afidp, * afs_GetVCache. */ - ret = afs_NFSFindVCache(avcpp, &vfid, 1); + ret = afs_NFSFindVCache(avcpp, &vfid); if (ret > 1) { /* More than one entry matches. */ code = ENOENT; - } - else if (ret == 0) { + } else if (ret == 0) { /* didn't find an entry. */ - *avcpp = afs_GetVCache(&vfid, &treq, (afs_int32 *)0, (struct vcache*)0, 0); + *avcpp = afs_GetVCache(&vfid, &treq, NULL, NULL); } - if (! *avcpp) { + if (!*avcpp) { code = ENOENT; } diff --git a/src/afs/afs_osidnlc.c b/src/afs/afs_osidnlc.c index bfeed8ef7..cabe4886f 100644 --- a/src/afs/afs_osidnlc.c +++ b/src/afs/afs_osidnlc.c @@ -8,16 +8,17 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osidnlc.c,v 1.1.1.5 2001/09/11 14:24:43 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_osidnlc.c,v 1.8 2003/07/15 23:14:12 shadow Exp $"); -#include "../afs/sysincludes.h" /*Standard vendor system headers*/ -#include "../afs/afsincludes.h" /*AFS-based standard headers*/ +#include "afs/sysincludes.h" /*Standard vendor system headers */ +#include "afsincludes.h" /*AFS-based standard headers */ #include "afs/afs.h" -#include "../afs/lock.h" -#include "../afs/afs_stats.h" -#include "../afs/afs_osidnlc.h" +#include "afs/lock.h" +#include "afs/afs_stats.h" +#include "afs/afs_osidnlc.h" /* Things to do: * also cache failed lookups. @@ -34,8 +35,8 @@ extern struct afs_lock afs_xvcache; dnlcstats_t dnlcstats; #define NCSIZE 300 -#define NHSIZE 256 /* must be power of 2. == NHASHENT in dir package */ -struct nc *ncfreelist = (struct nc *)0; +#define NHSIZE 256 /* must be power of 2. == NHASHENT in dir package */ +struct nc *ncfreelist = NULL; static struct nc nameCache[NCSIZE]; struct nc *nameHash[NHSIZE]; /* Hash table invariants: @@ -43,460 +44,441 @@ struct nc *nameHash[NHSIZE]; * 2. A single element in a hash bucket has itself as prev and next. */ -typedef enum {osi_dnlc_enterT, InsertEntryT, osi_dnlc_lookupT, ScavengeEntryT, osi_dnlc_removeT, RemoveEntryT, osi_dnlc_purgedpT, osi_dnlc_purgevpT, osi_dnlc_purgeT } traceevt; +typedef enum { osi_dnlc_enterT, InsertEntryT, osi_dnlc_lookupT, + ScavengeEntryT, osi_dnlc_removeT, RemoveEntryT, osi_dnlc_purgedpT, + osi_dnlc_purgevpT, osi_dnlc_purgeT +} traceevt; -int afs_usednlc = 1; +int afs_usednlc = 1; struct dt { - traceevt event; - unsigned char slot; + traceevt event; + unsigned char slot; }; -struct dt dnlctracetable[256]; +struct dt dnlctracetable[256]; int dnlct; -#define TRACE(e,s) /* if (dnlct == 256) dnlct = 0; dnlctracetable[dnlct].event = e; dnlctracetable[dnlct++].slot = s; */ +#define TRACE(e,s) /* if (dnlct == 256) dnlct = 0; dnlctracetable[dnlct].event = e; dnlctracetable[dnlct++].slot = s; */ #define dnlcHash(ts, hval) for (hval=0; *ts; ts++) { hval *= 173; hval += *ts; } -static struct nc * GetMeAnEntry() { - static unsigned int nameptr = 0; /* next bucket to pull something from */ - struct nc *tnc; - int j; - - if (ncfreelist) { - tnc = ncfreelist; - ncfreelist = tnc->next; - return tnc; - } - - for (j=0; j= NHSIZE) - nameptr =0; - if (nameHash[nameptr]) - break; - } - - TRACE(ScavengeEntryT, nameptr); - tnc = nameHash[nameptr]; - if (!tnc) /* May want to consider changing this to return 0 */ - osi_Panic("null tnc in GetMeAnEntry"); - - if (tnc->prev == tnc) { /* only thing in list, don't screw around */ - nameHash[nameptr] = (struct nc *) 0; - return (tnc); - } +static struct nc * +GetMeAnEntry(void) +{ + static unsigned int nameptr = 0; /* next bucket to pull something from */ + struct nc *tnc; + int j; + + if (ncfreelist) { + tnc = ncfreelist; + ncfreelist = tnc->next; + return tnc; + } + + for (j = 0; j < NHSIZE + 2; j++, nameptr++) { + if (nameptr >= NHSIZE) + nameptr = 0; + if (nameHash[nameptr]) + break; + } + + TRACE(ScavengeEntryT, nameptr); + tnc = nameHash[nameptr]; + if (!tnc) /* May want to consider changing this to return 0 */ + osi_Panic("null tnc in GetMeAnEntry"); - tnc = tnc->prev; /* grab oldest one in this bucket */ - /* remove it from list */ - tnc->next->prev = tnc->prev; - tnc->prev->next = tnc->next; + if (tnc->prev == tnc) { /* only thing in list, don't screw around */ + nameHash[nameptr] = NULL; + return (tnc); + } + + tnc = tnc->prev; /* grab oldest one in this bucket */ + /* remove it from list */ + tnc->next->prev = tnc->prev; + tnc->prev->next = tnc->next; - return (tnc); + return (tnc); } -static void InsertEntry(tnc) - struct nc *tnc; +static void +InsertEntry(struct nc *tnc) { - unsigned int key; - key = tnc->key & (NHSIZE -1); - - TRACE(InsertEntryT, key); - if(!nameHash[key]) { - nameHash[key] = tnc; - tnc->next = tnc->prev = tnc; - } - else { - tnc->next = nameHash[key]; - tnc->prev = tnc->next->prev; - tnc->next->prev = tnc; - tnc->prev->next = tnc; - nameHash[key] = tnc; - } + unsigned int key; + key = tnc->key & (NHSIZE - 1); + + TRACE(InsertEntryT, key); + if (!nameHash[key]) { + nameHash[key] = tnc; + tnc->next = tnc->prev = tnc; + } else { + tnc->next = nameHash[key]; + tnc->prev = tnc->next->prev; + tnc->next->prev = tnc; + tnc->prev->next = tnc; + nameHash[key] = tnc; + } } -int osi_dnlc_enter ( adp, aname, avc, avno ) - struct vcache *adp; - char *aname; - struct vcache *avc; - afs_hyper_t *avno; +int +osi_dnlc_enter(struct vcache *adp, char *aname, struct vcache *avc, + afs_hyper_t * avno) { - struct nc *tnc; - unsigned int key, skey; - char *ts = aname; - int safety; - - if (!afs_usednlc) - return 0; - - TRACE(osi_dnlc_enterT, 0); - dnlcHash( ts, key ); /* leaves ts pointing at the NULL */ - if (ts - aname >= AFSNCNAMESIZE) { - return 0; - } - skey = key & (NHSIZE -1); - dnlcstats.enters++; + struct nc *tnc; + unsigned int key, skey; + char *ts = aname; + int safety; + + if (!afs_usednlc) + return 0; + + TRACE(osi_dnlc_enterT, 0); + dnlcHash(ts, key); /* leaves ts pointing at the NULL */ + if (ts - aname >= AFSNCNAMESIZE) { + return 0; + } + skey = key & (NHSIZE - 1); + dnlcstats.enters++; -retry: - ObtainWriteLock(&afs_xdnlc,222); + retry: + ObtainWriteLock(&afs_xdnlc, 222); - /* Only cache entries from the latest version of the directory */ - if (!(adp->states & CStatd) || !hsame(*avno, adp->m.DataVersion)) { - ReleaseWriteLock(&afs_xdnlc); - return 0; - } - - /* - * Make sure each directory entry gets cached no more than once. - */ - for (tnc = nameHash[skey], safety=0; tnc; tnc = tnc->next, safety++ ) { - if ((tnc->dirp == adp) && (!strcmp((char *)tnc->name, aname))) { - /* duplicate entry */ - break; - } - else if (tnc->next == nameHash[skey]) { /* end of list */ - tnc = NULL; - break; + /* Only cache entries from the latest version of the directory */ + if (!(adp->states & CStatd) || !hsame(*avno, adp->m.DataVersion)) { + ReleaseWriteLock(&afs_xdnlc); + return 0; } - else if (safety >NCSIZE) { - afs_warn("DNLC cycle"); - dnlcstats.cycles++; - ReleaseWriteLock(&afs_xdnlc); - osi_dnlc_purge(); - goto retry; + + /* + * Make sure each directory entry gets cached no more than once. + */ + for (tnc = nameHash[skey], safety = 0; tnc; tnc = tnc->next, safety++) { + if ((tnc->dirp == adp) && (!strcmp((char *)tnc->name, aname))) { + /* duplicate entry */ + break; + } else if (tnc->next == nameHash[skey]) { /* end of list */ + tnc = NULL; + break; + } else if (safety > NCSIZE) { + afs_warn("DNLC cycle"); + dnlcstats.cycles++; + ReleaseWriteLock(&afs_xdnlc); + osi_dnlc_purge(); + goto retry; + } } - } - if (tnc == NULL) { - tnc = GetMeAnEntry(); + if (tnc == NULL) { + tnc = GetMeAnEntry(); - tnc->dirp = adp; - tnc->vp = avc; - tnc->key = key; - memcpy((char *)tnc->name, aname, ts-aname+1); /* include the NULL */ + tnc->dirp = adp; + tnc->vp = avc; + tnc->key = key; + memcpy((char *)tnc->name, aname, ts - aname + 1); /* include the NULL */ - InsertEntry(tnc); - } else { - /* duplicate */ - tnc->vp = avc; - } - ReleaseWriteLock(&afs_xdnlc); + InsertEntry(tnc); + } else { + /* duplicate */ + tnc->vp = avc; + } + ReleaseWriteLock(&afs_xdnlc); -return 0; + return 0; } struct vcache * -osi_dnlc_lookup ( adp, aname, locktype ) - struct vcache *adp; - char *aname; - int locktype; +osi_dnlc_lookup(struct vcache *adp, char *aname, int locktype) { - struct vcache * tvc; - int LRUme; - unsigned int key, skey; - char *ts = aname; - struct nc * tnc, *tnc1=0; - int safety; - - if (!afs_usednlc) - return 0; - - dnlcHash( ts, key ); /* leaves ts pointing at the NULL */ - if (ts - aname >= AFSNCNAMESIZE) { - return 0; - } - skey = key & (NHSIZE -1); - - TRACE(osi_dnlc_lookupT, skey); - dnlcstats.lookups++; - - ObtainReadLock(&afs_xvcache); - ObtainReadLock(&afs_xdnlc); - - for ( tvc = (struct vcache *) 0, tnc = nameHash[skey], safety=0; - tnc; tnc = tnc->next, safety++ ) { - if ( /* (tnc->key == key) && */ (tnc->dirp == adp) - && (!strcmp((char *)tnc->name, aname))) { - tvc = tnc->vp; - tnc1 = tnc; - break; - } - else if (tnc->next == nameHash[skey]) { /* end of list */ - break; + struct vcache *tvc; + int LRUme; + unsigned int key, skey; + char *ts = aname; + struct nc *tnc, *tnc1 = 0; + int safety; + + if (!afs_usednlc) + return 0; + + dnlcHash(ts, key); /* leaves ts pointing at the NULL */ + if (ts - aname >= AFSNCNAMESIZE) { + return 0; } - else if (safety >NCSIZE) { - afs_warn("DNLC cycle"); - dnlcstats.cycles++; - ReleaseReadLock(&afs_xdnlc); - ReleaseReadLock(&afs_xvcache); - osi_dnlc_purge(); - return(0); + skey = key & (NHSIZE - 1); + + TRACE(osi_dnlc_lookupT, skey); + dnlcstats.lookups++; + + ObtainReadLock(&afs_xvcache); + ObtainReadLock(&afs_xdnlc); + + for (tvc = NULL, tnc = nameHash[skey], safety = 0; tnc; + tnc = tnc->next, safety++) { + if ( /* (tnc->key == key) && */ (tnc->dirp == adp) + && (!strcmp((char *)tnc->name, aname))) { + tvc = tnc->vp; + tnc1 = tnc; + break; + } else if (tnc->next == nameHash[skey]) { /* end of list */ + break; + } else if (safety > NCSIZE) { + afs_warn("DNLC cycle"); + dnlcstats.cycles++; + ReleaseReadLock(&afs_xdnlc); + ReleaseReadLock(&afs_xvcache); + osi_dnlc_purge(); + return (0); + } } - } - LRUme = 0; /* (tnc != nameHash[skey]); */ - ReleaseReadLock(&afs_xdnlc); + LRUme = 0; /* (tnc != nameHash[skey]); */ + ReleaseReadLock(&afs_xdnlc); - if (!tvc) { - ReleaseReadLock(&afs_xvcache); - dnlcstats.misses++; - } - else { + if (!tvc) { + ReleaseReadLock(&afs_xvcache); + dnlcstats.misses++; + } else { #ifdef AFS_OSF_ENV - VN_HOLD((vnode_t *)tvc); + VN_HOLD((vnode_t *) tvc); #else - osi_vnhold(tvc, 0); + osi_vnhold(tvc, 0); #endif - ReleaseReadLock(&afs_xvcache); + ReleaseReadLock(&afs_xvcache); #ifdef notdef - /* - * XX If LRUme ever is non-zero change the if statement around because - * aix's cc with optimizer on won't necessarily check things in order XX - */ - if (LRUme && (0 == NBObtainWriteLock(&afs_xdnlc))) { - /* don't block to do this */ - /* tnc might have been moved during race condition, */ - /* but it's always in a legit hash chain when a lock is granted, - * or else it's on the freelist so prev == NULL, - * so at worst this is redundant */ - /* Now that we've got it held, and a lock on the dnlc, we - * should check to be sure that there was no race, and - * bail out if there was. */ - if (tnc->prev) { - /* special case for only two elements on list - relative ordering - * doesn't change */ - if (tnc->prev != tnc->next) { - /* remove from old location */ - tnc->prev->next = tnc->next; - tnc->next->prev = tnc->prev; - /* insert into new location */ - tnc->next = nameHash[skey]; - tnc->prev = tnc->next->prev; - tnc->next->prev = tnc; - tnc->prev->next = tnc; + /* + * XX If LRUme ever is non-zero change the if statement around because + * aix's cc with optimizer on won't necessarily check things in order XX + */ + if (LRUme && (0 == NBObtainWriteLock(&afs_xdnlc))) { + /* don't block to do this */ + /* tnc might have been moved during race condition, */ + /* but it's always in a legit hash chain when a lock is granted, + * or else it's on the freelist so prev == NULL, + * so at worst this is redundant */ + /* Now that we've got it held, and a lock on the dnlc, we + * should check to be sure that there was no race, and + * bail out if there was. */ + if (tnc->prev) { + /* special case for only two elements on list - relative ordering + * doesn't change */ + if (tnc->prev != tnc->next) { + /* remove from old location */ + tnc->prev->next = tnc->next; + tnc->next->prev = tnc->prev; + /* insert into new location */ + tnc->next = nameHash[skey]; + tnc->prev = tnc->next->prev; + tnc->next->prev = tnc; + tnc->prev->next = tnc; + } + nameHash[skey] = tnc; + } + ReleaseWriteLock(&afs_xdnlc); } - nameHash[skey] = tnc; - } - ReleaseWriteLock(&afs_xdnlc); - } #endif - } + } -return tvc; + return tvc; } static void -RemoveEntry (tnc, key) - struct nc *tnc; - unsigned int key; +RemoveEntry(struct nc *tnc, unsigned int key) { - if (!tnc->prev) /* things on freelist always have null prev ptrs */ - osi_Panic("bogus free list"); - - TRACE(RemoveEntryT, key); - if (tnc == tnc->next) { /* only one in list */ - nameHash[key] = (struct nc *) 0; - } - else { - if (tnc == nameHash[key]) - nameHash[key] = tnc->next; - tnc->prev->next = tnc->next; - tnc->next->prev = tnc->prev; - } + if (!tnc->prev) /* things on freelist always have null prev ptrs */ + osi_Panic("bogus free list"); + + TRACE(RemoveEntryT, key); + if (tnc == tnc->next) { /* only one in list */ + nameHash[key] = NULL; + } else { + if (tnc == nameHash[key]) + nameHash[key] = tnc->next; + tnc->prev->next = tnc->next; + tnc->next->prev = tnc->prev; + } - tnc->prev = (struct nc *) 0; /* everything not in hash table has 0 prev */ - tnc->key = 0; /* just for safety's sake */ + tnc->prev = NULL; /* everything not in hash table has 0 prev */ + tnc->key = 0; /* just for safety's sake */ } -int -osi_dnlc_remove ( adp, aname, avc ) - struct vcache *adp; - char *aname; - struct vcache *avc; +int +osi_dnlc_remove(struct vcache *adp, char *aname, struct vcache *avc) { - unsigned int key, skey; - char *ts = aname; - struct nc *tnc; - - if (!afs_usednlc) - return 0; + unsigned int key, skey; + char *ts = aname; + struct nc *tnc; - TRACE( osi_dnlc_removeT, skey); - dnlcHash( ts, key ); /* leaves ts pointing at the NULL */ - if (ts - aname >= AFSNCNAMESIZE) { - return 0; - } - skey = key & (NHSIZE -1); - TRACE( osi_dnlc_removeT, skey); - dnlcstats.removes++; - ObtainReadLock(&afs_xdnlc); - - for (tnc = nameHash[skey]; tnc; tnc = tnc->next) { - if ((tnc->dirp == adp) && (tnc->key == key) - && (!strcmp((char *)tnc->name, aname))) { - tnc->dirp = (struct vcache *) 0; /* now it won't match anything */ - break; + if (!afs_usednlc) + return 0; + + TRACE(osi_dnlc_removeT, skey); + dnlcHash(ts, key); /* leaves ts pointing at the NULL */ + if (ts - aname >= AFSNCNAMESIZE) { + return 0; } - else if (tnc->next == nameHash[skey]) { /* end of list */ - tnc = (struct nc *) 0; - break; + skey = key & (NHSIZE - 1); + TRACE(osi_dnlc_removeT, skey); + dnlcstats.removes++; + ObtainReadLock(&afs_xdnlc); + + for (tnc = nameHash[skey]; tnc; tnc = tnc->next) { + if ((tnc->dirp == adp) && (tnc->key == key) + && (!strcmp((char *)tnc->name, aname))) { + tnc->dirp = NULL; /* now it won't match anything */ + break; + } else if (tnc->next == nameHash[skey]) { /* end of list */ + tnc = NULL; + break; + } } - } - ReleaseReadLock(&afs_xdnlc); + ReleaseReadLock(&afs_xdnlc); - if (!tnc) - return 0; + if (!tnc) + return 0; - /* there is a little race condition here, but it's relatively - * harmless. At worst, I wind up removing a mapping that I just - * created. */ - if (EWOULDBLOCK == NBObtainWriteLock(&afs_xdnlc,1)) { - return 0; /* no big deal, tnc will get recycled eventually */ - } - RemoveEntry(tnc, skey); - tnc->next = ncfreelist; - ncfreelist = tnc; - ReleaseWriteLock(&afs_xdnlc); - -return 0; + /* there is a little race condition here, but it's relatively + * harmless. At worst, I wind up removing a mapping that I just + * created. */ + if (EWOULDBLOCK == NBObtainWriteLock(&afs_xdnlc, 1)) { + return 0; /* no big deal, tnc will get recycled eventually */ + } + RemoveEntry(tnc, skey); + tnc->next = ncfreelist; + ncfreelist = tnc; + ReleaseWriteLock(&afs_xdnlc); + + return 0; } /* remove anything pertaining to this directory. I can invalidate * things without the lock, since I am just looking through the array, * but to move things off the lists or into the freelist, I need the * write lock */ -int -osi_dnlc_purgedp (adp) - struct vcache *adp; +int +osi_dnlc_purgedp(struct vcache *adp) { - int i; - int writelocked; - - if (!afs_usednlc) - return 0; - - dnlcstats.purgeds++; - TRACE( osi_dnlc_purgedpT, 0); - writelocked = (0 == NBObtainWriteLock(&afs_xdnlc,2)); - - for (i=0; i -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_pioctl.c,v 1.1.1.18 2003/07/30 17:08:01 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.78 2004/04/18 06:13:47 kolya Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ -#include "../afs/vice.h" -#include "../rx/rx_globals.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ +#ifdef AFS_OBSD_ENV +#include "h/syscallargs.h" +#endif +#ifdef AFS_FBSD50_ENV +#include "h/sysproto.h" +#endif +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ +#include "afs/vice.h" +#include "rx/rx_globals.h" -extern void afs_ComputePAGStats(); -extern struct vcache *afs_LookupVCache(); struct VenusFid afs_rootFid; -afs_int32 afs_waitForever=0; +afs_int32 afs_waitForever = 0; short afs_waitForeverCount = 0; -afs_int32 afs_showflags = GAGUSER | GAGCONSOLE; /* show all messages */ -extern afs_int32 PROBE_INTERVAL; - -extern int cacheDiskType; -extern afs_int32 afs_cacheBlocks; -extern struct afs_q CellLRU; -extern char *afs_indexFlags; /* only one: is there data there? */ -extern afs_int32 afs_blocksUsed; -extern struct unixuser *afs_users[NUSERS]; -extern struct server *afs_servers[NSERVERS]; -extern struct interfaceAddr afs_cb_interface; /* client interface addresses */ -extern afs_rwlock_t afs_xserver; -extern afs_rwlock_t afs_xinterface; -extern afs_rwlock_t afs_xcell; -extern afs_rwlock_t afs_xuser; -#ifndef AFS_FINEG_SUNLOCK -extern afs_rwlock_t afs_xconn; -#endif -extern afs_rwlock_t afs_xvolume; -extern afs_lock_t afs_xdcache; /* lock: alloc new disk cache entries */ -extern afs_rwlock_t afs_xvcache; -extern afs_rwlock_t afs_xcbhash; -extern afs_int32 afs_mariner, afs_marinerHost; -extern struct srvAddr *afs_srvAddrs[NSERVERS]; -extern int afs_resourceinit_flag; -extern afs_int32 cryptall; - -static int PBogus(), PSetAcl(), PGetAcl(), PSetTokens(), PGetVolumeStatus(); -static int PSetVolumeStatus(), PFlush(), PNewStatMount(), PGetTokens(), PUnlog(); -static int PCheckServers(), PCheckVolNames(), PCheckAuth(), PFindVolume(); -static int PViceAccess(), PSetCacheSize(), Prefetch(); -static int PRemoveCallBack(), PNewCell(), PListCells(), PRemoveMount(); -static int PMariner(), PGetUserCell(), PGetWSCell(), PGetFileCell(); -static int PVenusLogging(), PNoop(), PSetCellStatus(), PGetCellStatus(); -static int PFlushVolumeData(), PGetCacheSize(); -static int PSetSysName(),PGetFID(); -static int PGetVnodeXStatus(); -static int PSetSPrefs(), PGetSPrefs(), PGag(), PTwiddleRx(); -static int PSetSPrefs33(), PStoreBehind(), PGCPAGs(); -static int PGetCPrefs(), PSetCPrefs(); /* client network addresses */ -static int PGetInitParams(), PFlushMount(), PRxStatProc(), PRxStatPeer(); -static int PGetRxkcrypt(), PSetRxkcrypt(); -static int PPrefetchFromTape(), PResidencyCmd(); -static int PNewAlias(), PListAliases(); -int PExportAfs(); - -static int HandleClientContext(struct afs_ioctl *ablob, int *com, struct AFS_UCRED **acred, struct AFS_UCRED *credp); - -extern struct cm_initparams cm_initParams; - -static int (*(VpioctlSw[]))() = { - PBogus, /* 0 */ - PSetAcl, /* 1 */ - PGetAcl, /* 2 */ - PSetTokens, /* 3 */ - PGetVolumeStatus, /* 4 */ - PSetVolumeStatus, /* 5 */ - PFlush, /* 6 */ - PBogus, /* 7 */ - PGetTokens, /* 8 */ - PUnlog, /* 9 */ - PCheckServers, /* 10 */ - PCheckVolNames, /* 11 */ - PCheckAuth, /* 12 */ - PBogus, /* 13 -- used to be quick check time */ - PFindVolume, /* 14*/ - PBogus, /* 15 -- prefetch is now special-cased; see pioctl code! */ - PBogus, /* 16 -- used to be testing code */ - PNoop, /* 17 -- used to be enable group */ - PNoop, /* 18 -- used to be disable group */ - PBogus, /* 19 -- used to be list group */ - PViceAccess, /* 20 */ - PUnlog, /* 21 -- unlog *is* unpag in this system */ - PGetFID, /* 22 -- get file ID */ - PBogus, /* 23 -- used to be waitforever */ - PSetCacheSize, /* 24 */ - PRemoveCallBack, /* 25 -- flush only the callback */ - PNewCell, /* 26 */ - PListCells, /* 27 */ - PRemoveMount, /* 28 -- delete mount point */ - PNewStatMount, /* 29 -- new style mount point stat */ - PGetFileCell, /* 30 -- get cell name for input file */ - PGetWSCell, /* 31 -- get cell name for workstation */ - PMariner, /* 32 - set/get mariner host */ - PGetUserCell, /* 33 -- get cell name for user */ - PVenusLogging, /* 34 -- Enable/Disable logging */ - PGetCellStatus, /* 35 */ - PSetCellStatus, /* 36 */ - PFlushVolumeData, /* 37 -- flush all data from a volume */ - PSetSysName, /* 38 - Set system name */ - PExportAfs, /* 39 - Export Afs to remote nfs clients */ - PGetCacheSize, /* 40 - get cache size and usage */ - PGetVnodeXStatus, /* 41 - get vcache's special status */ - PSetSPrefs33, /* 42 - Set CM Server preferences... */ - PGetSPrefs, /* 43 - Get CM Server preferences... */ - PGag, /* 44 - turn off/on all CM messages */ - PTwiddleRx, /* 45 - adjust some RX params */ - PSetSPrefs, /* 46 - Set CM Server preferences... */ - PStoreBehind, /* 47 - set degree of store behind to be done */ - PGCPAGs, /* 48 - disable automatic pag gc-ing */ - PGetInitParams, /* 49 - get initial cm params */ - PGetCPrefs, /* 50 - get client interface addresses */ - PSetCPrefs, /* 51 - set client interface addresses */ - PFlushMount, /* 52 - flush mount symlink data */ - PRxStatProc, /* 53 - control process RX statistics */ - PRxStatPeer, /* 54 - control peer RX statistics */ - PGetRxkcrypt, /* 55 -- Get rxkad encryption flag */ - PSetRxkcrypt, /* 56 -- Set rxkad encryption flag */ - PBogus, /* 57 -- arla: set file prio */ - PBogus, /* 58 -- arla: fallback getfh */ - PBogus, /* 59 -- arla: fallback fhopen */ - PBogus, /* 60 -- arla: controls xfsdebug */ - PBogus, /* 61 -- arla: controls arla debug */ - PBogus, /* 62 -- arla: debug interface */ - PBogus, /* 63 -- arla: print xfs status */ - PBogus, /* 64 -- arla: force cache check */ - PBogus, /* 65 -- arla: break callback */ - PPrefetchFromTape, /* 66 -- MR-AFS: prefetch file from tape */ - PResidencyCmd, /* 67 -- MR-AFS: generic commnd interface */ - PBogus, /* 68 -- arla: fetch stats */ +afs_int32 afs_showflags = GAGUSER | GAGCONSOLE; /* show all messages */ + +#define DECL_PIOCTL(x) static int x(struct vcache *avc, int afun, struct vrequest *areq, \ + char *ain, char *aout, afs_int32 ainSize, afs_int32 *aoutSize, \ + struct AFS_UCRED **acred) + +/* Prototypes for pioctl routines */ +DECL_PIOCTL(PGetFID); +DECL_PIOCTL(PSetAcl); +DECL_PIOCTL(PStoreBehind); +DECL_PIOCTL(PGCPAGs); +DECL_PIOCTL(PGetAcl); +DECL_PIOCTL(PNoop); +DECL_PIOCTL(PBogus); +DECL_PIOCTL(PGetFileCell); +DECL_PIOCTL(PGetWSCell); +DECL_PIOCTL(PGetUserCell); +DECL_PIOCTL(PSetTokens); +DECL_PIOCTL(PGetVolumeStatus); +DECL_PIOCTL(PSetVolumeStatus); +DECL_PIOCTL(PFlush); +DECL_PIOCTL(PNewStatMount); +DECL_PIOCTL(PGetTokens); +DECL_PIOCTL(PUnlog); +DECL_PIOCTL(PMariner); +DECL_PIOCTL(PCheckServers); +DECL_PIOCTL(PCheckVolNames); +DECL_PIOCTL(PCheckAuth); +DECL_PIOCTL(PFindVolume); +DECL_PIOCTL(PViceAccess); +DECL_PIOCTL(PSetCacheSize); +DECL_PIOCTL(PGetCacheSize); +DECL_PIOCTL(PRemoveCallBack); +DECL_PIOCTL(PNewCell); +DECL_PIOCTL(PNewAlias); +DECL_PIOCTL(PListCells); +DECL_PIOCTL(PListAliases); +DECL_PIOCTL(PRemoveMount); +DECL_PIOCTL(PVenusLogging); +DECL_PIOCTL(PGetCellStatus); +DECL_PIOCTL(PSetCellStatus); +DECL_PIOCTL(PFlushVolumeData); +DECL_PIOCTL(PGetVnodeXStatus); +DECL_PIOCTL(PSetSysName); +DECL_PIOCTL(PSetSPrefs); +DECL_PIOCTL(PSetSPrefs33); +DECL_PIOCTL(PGetSPrefs); +DECL_PIOCTL(PExportAfs); +DECL_PIOCTL(PGag); +DECL_PIOCTL(PTwiddleRx); +DECL_PIOCTL(PGetInitParams); +DECL_PIOCTL(PGetRxkcrypt); +DECL_PIOCTL(PSetRxkcrypt); +DECL_PIOCTL(PGetCPrefs); +DECL_PIOCTL(PSetCPrefs); +DECL_PIOCTL(PFlushMount); +DECL_PIOCTL(PRxStatProc); +DECL_PIOCTL(PRxStatPeer); +DECL_PIOCTL(PPrefetchFromTape); +DECL_PIOCTL(PResidencyCmd); + +/* + * A macro that says whether we're going to need HandleClientContext(). + * This is currently used only by the nfs translator. + */ +#if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV) +#define AFS_NEED_CLIENTCONTEXT +#endif + +/* Prototypes for private routines */ +#ifdef AFS_NEED_CLIENTCONTEXT +static int HandleClientContext(struct afs_ioctl *ablob, int *com, + struct AFS_UCRED **acred, + struct AFS_UCRED *credp); +#endif +int HandleIoctl(register struct vcache *avc, register afs_int32 acom, + struct afs_ioctl *adata); +int afs_HandlePioctl(struct vnode *avp, afs_int32 acom, + register struct afs_ioctl *ablob, int afollow, + struct AFS_UCRED **acred); +static int Prefetch(char *apath, struct afs_ioctl *adata, int afollow, + struct AFS_UCRED *acred); + + +static int (*(VpioctlSw[])) () = { + PBogus, /* 0 */ + PSetAcl, /* 1 */ + PGetAcl, /* 2 */ + PSetTokens, /* 3 */ + PGetVolumeStatus, /* 4 */ + PSetVolumeStatus, /* 5 */ + PFlush, /* 6 */ + PBogus, /* 7 */ + PGetTokens, /* 8 */ + PUnlog, /* 9 */ + PCheckServers, /* 10 */ + PCheckVolNames, /* 11 */ + PCheckAuth, /* 12 */ + PBogus, /* 13 -- used to be quick check time */ + PFindVolume, /* 14 */ + PBogus, /* 15 -- prefetch is now special-cased; see pioctl code! */ + PBogus, /* 16 -- used to be testing code */ + PNoop, /* 17 -- used to be enable group */ + PNoop, /* 18 -- used to be disable group */ + PBogus, /* 19 -- used to be list group */ + PViceAccess, /* 20 */ + PUnlog, /* 21 -- unlog *is* unpag in this system */ + PGetFID, /* 22 -- get file ID */ + PBogus, /* 23 -- used to be waitforever */ + PSetCacheSize, /* 24 */ + PRemoveCallBack, /* 25 -- flush only the callback */ + PNewCell, /* 26 */ + PListCells, /* 27 */ + PRemoveMount, /* 28 -- delete mount point */ + PNewStatMount, /* 29 -- new style mount point stat */ + PGetFileCell, /* 30 -- get cell name for input file */ + PGetWSCell, /* 31 -- get cell name for workstation */ + PMariner, /* 32 - set/get mariner host */ + PGetUserCell, /* 33 -- get cell name for user */ + PVenusLogging, /* 34 -- Enable/Disable logging */ + PGetCellStatus, /* 35 */ + PSetCellStatus, /* 36 */ + PFlushVolumeData, /* 37 -- flush all data from a volume */ + PSetSysName, /* 38 - Set system name */ + PExportAfs, /* 39 - Export Afs to remote nfs clients */ + PGetCacheSize, /* 40 - get cache size and usage */ + PGetVnodeXStatus, /* 41 - get vcache's special status */ + PSetSPrefs33, /* 42 - Set CM Server preferences... */ + PGetSPrefs, /* 43 - Get CM Server preferences... */ + PGag, /* 44 - turn off/on all CM messages */ + PTwiddleRx, /* 45 - adjust some RX params */ + PSetSPrefs, /* 46 - Set CM Server preferences... */ + PStoreBehind, /* 47 - set degree of store behind to be done */ + PGCPAGs, /* 48 - disable automatic pag gc-ing */ + PGetInitParams, /* 49 - get initial cm params */ + PGetCPrefs, /* 50 - get client interface addresses */ + PSetCPrefs, /* 51 - set client interface addresses */ + PFlushMount, /* 52 - flush mount symlink data */ + PRxStatProc, /* 53 - control process RX statistics */ + PRxStatPeer, /* 54 - control peer RX statistics */ + PGetRxkcrypt, /* 55 -- Get rxkad encryption flag */ + PSetRxkcrypt, /* 56 -- Set rxkad encryption flag */ + PBogus, /* 57 -- arla: set file prio */ + PBogus, /* 58 -- arla: fallback getfh */ + PBogus, /* 59 -- arla: fallback fhopen */ + PBogus, /* 60 -- arla: controls xfsdebug */ + PBogus, /* 61 -- arla: controls arla debug */ + PBogus, /* 62 -- arla: debug interface */ + PBogus, /* 63 -- arla: print xfs status */ + PBogus, /* 64 -- arla: force cache check */ + PBogus, /* 65 -- arla: break callback */ + PPrefetchFromTape, /* 66 -- MR-AFS: prefetch file from tape */ + PResidencyCmd, /* 67 -- MR-AFS: generic commnd interface */ + PBogus, /* 68 -- arla: fetch stats */ }; -static int (*(CpioctlSw[]))() = { - PBogus, /* 0 */ - PNewAlias, /* 1 -- create new cell alias */ - PListAliases, /* 2 -- list cell aliases */ +static int (*(CpioctlSw[])) () = { + PBogus, /* 0 */ + PNewAlias, /* 1 -- create new cell alias */ + PListAliases, /* 2 -- list cell aliases */ }; #define PSetClientContext 99 /* Special pioctl to setup caller's creds */ @@ -157,10 +196,10 @@ int afs_nobody = NFS_NOBODY; static void afs_ioctl32_to_afs_ioctl(const struct afs_ioctl32 *src, struct afs_ioctl *dst) { - dst->in = (char *)(unsigned long)src->in; - dst->out = (char *)(unsigned long)src->out; - dst->in_size = src->in_size; - dst->out_size = src->out_size; + dst->in = (char *)(unsigned long)src->in; + dst->out = (char *)(unsigned long)src->out; + dst->in_size = src->in_size; + dst->out_size = src->out_size; } /* @@ -171,190 +210,201 @@ afs_ioctl32_to_afs_ioctl(const struct afs_ioctl32 *src, struct afs_ioctl *dst) static int copyin_afs_ioctl(caddr_t cmarg, struct afs_ioctl *dst) { - int code; + int code; +#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) + struct afs_ioctl32 dst32; + + if (!(IS64U)) { + AFS_COPYIN(cmarg, (caddr_t) & dst32, sizeof dst32, code); + if (!code) + afs_ioctl32_to_afs_ioctl(&dst32, dst); + return code; + } +#endif /* defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) */ + #if defined(AFS_HPUX_64BIT_ENV) - struct afs_ioctl32 dst32; + struct afs_ioctl32 dst32; - if (is_32bit(u.u_procp)) /* is_32bit() in proc_iface.h */ - { - AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code); - if (!code) - afs_ioctl32_to_afs_ioctl(&dst32, dst); - return code; - } + if (is_32bit(u.u_procp)) { /* is_32bit() in proc_iface.h */ + AFS_COPYIN(cmarg, (caddr_t) & dst32, sizeof dst32, code); + if (!code) + afs_ioctl32_to_afs_ioctl(&dst32, dst); + return code; + } #endif /* defined(AFS_HPUX_64BIT_ENV) */ #if defined(AFS_SUN57_64BIT_ENV) - struct afs_ioctl32 dst32; + struct afs_ioctl32 dst32; - if (get_udatamodel() == DATAMODEL_ILP32) { - AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code); - if (!code) - afs_ioctl32_to_afs_ioctl(&dst32, dst); - return code; - } + if (get_udatamodel() == DATAMODEL_ILP32) { + AFS_COPYIN(cmarg, (caddr_t) & dst32, sizeof dst32, code); + if (!code) + afs_ioctl32_to_afs_ioctl(&dst32, dst); + return code; + } #endif /* defined(AFS_SUN57_64BIT_ENV) */ #if defined(AFS_SGI_ENV) && (_MIPS_SZLONG==64) - struct afs_ioctl32 dst32; + struct afs_ioctl32 dst32; - if (!ABI_IS_64BIT(get_current_abi())) - { - AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code); - if (!code) - afs_ioctl32_to_afs_ioctl(&dst32, dst); - return code; - } + if (!ABI_IS_64BIT(get_current_abi())) { + AFS_COPYIN(cmarg, (caddr_t) & dst32, sizeof dst32, code); + if (!code) + afs_ioctl32_to_afs_ioctl(&dst32, dst); + return code; + } #endif /* defined(AFS_SGI_ENV) && (_MIPS_SZLONG==64) */ -#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) - struct afs_ioctl32 dst32; +#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV) + struct afs_ioctl32 dst32; #ifdef AFS_SPARC64_LINUX24_ENV - if (current->thread.flags & SPARC_FLAG_32BIT) + if (current->thread.flags & SPARC_FLAG_32BIT) #elif defined(AFS_SPARC64_LINUX20_ENV) - if (current->tss.flags & SPARC_FLAG_32BIT) + if (current->tss.flags & SPARC_FLAG_32BIT) #elif defined(AFS_AMD64_LINUX20_ENV) - if (current->thread.flags & THREAD_IA32) + if (current->thread.flags & THREAD_IA32) +#elif defined(AFS_PPC64_LINUX20_ENV) + if (current->thread.flags & PPC_FLAG_32BIT) #else #error Not done for this linux type -#endif - { - AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code); - if (!code) - afs_ioctl32_to_afs_ioctl(&dst32, dst); - return code; - } +#endif + { + AFS_COPYIN(cmarg, (caddr_t) & dst32, sizeof dst32, code); + if (!code) + afs_ioctl32_to_afs_ioctl(&dst32, dst); + return code; + } #endif /* defined(AFS_LINUX_64BIT_KERNEL) */ - AFS_COPYIN(cmarg, (caddr_t) dst, sizeof *dst, code); - return code; + AFS_COPYIN(cmarg, (caddr_t) dst, sizeof *dst, code); + return code; } -HandleIoctl(avc, acom, adata) - register struct vcache *avc; - register afs_int32 acom; - struct afs_ioctl *adata; { - register afs_int32 code; - - code = 0; - AFS_STATCNT(HandleIoctl); - - switch(acom & 0xff) { - case 1: - avc->states |= CSafeStore; - avc->asynchrony = 0; - break; - - /* case 2 used to be abort store, but this is no longer provided, - since it is impossible to implement under normal Unix. - */ - - case 3: { - /* return the name of the cell this file is open on */ - register struct cell *tcell; - register afs_int32 i; - - tcell = afs_GetCell(avc->fid.Cell, READ_LOCK); - if (tcell) { - i = strlen(tcell->cellName) + 1; /* bytes to copy out */ - - if (i > adata->out_size) { - /* 0 means we're not interested in the output */ - if (adata->out_size != 0) code = EFAULT; - } - else { - /* do the copy */ - AFS_COPYOUT(tcell->cellName, adata->out, i, code); - } - afs_PutCell(tcell, READ_LOCK); - } - else code = ENOTTY; - } - break; - - case 49: /* VIOC_GETINITPARAMS */ - if (adata->out_size < sizeof(struct cm_initparams)) { - code = EFAULT; - } - else { - AFS_COPYOUT(&cm_initParams, adata->out, - sizeof(struct cm_initparams), code); - } - break; - - default: - - code = EINVAL; - break; - } - return code; /* so far, none implemented */ - } - - +int +HandleIoctl(register struct vcache *avc, register afs_int32 acom, + struct afs_ioctl *adata) +{ + register afs_int32 code; + + code = 0; + AFS_STATCNT(HandleIoctl); + + switch (acom & 0xff) { + case 1: + avc->states |= CSafeStore; + avc->asynchrony = 0; + break; + + /* case 2 used to be abort store, but this is no longer provided, + * since it is impossible to implement under normal Unix. + */ + + case 3:{ + /* return the name of the cell this file is open on */ + register struct cell *tcell; + register afs_int32 i; + + tcell = afs_GetCell(avc->fid.Cell, READ_LOCK); + if (tcell) { + i = strlen(tcell->cellName) + 1; /* bytes to copy out */ + + if (i > adata->out_size) { + /* 0 means we're not interested in the output */ + if (adata->out_size != 0) + code = EFAULT; + } else { + /* do the copy */ + AFS_COPYOUT(tcell->cellName, adata->out, i, code); + } + afs_PutCell(tcell, READ_LOCK); + } else + code = ENOTTY; + } + break; + + case 49: /* VIOC_GETINITPARAMS */ + if (adata->out_size < sizeof(struct cm_initparams)) { + code = EFAULT; + } else { + AFS_COPYOUT(&cm_initParams, adata->out, + sizeof(struct cm_initparams), code); + } + break; + + default: + + code = EINVAL; +#ifdef AFS_AIX51_ENV + code = ENOSYS; +#endif + break; + } + return code; /* so far, none implemented */ +} + + #ifdef AFS_AIX_ENV /* For aix we don't temporarily bypass ioctl(2) but rather do our * thing directly in the vnode layer call, VNOP_IOCTL; thus afs_ioctl * is now called from afs_gn_ioctl. */ -afs_ioctl(tvc, cmd, arg) - struct vcache *tvc; - int cmd; - int arg; -{ - struct afs_ioctl data; - int error = 0; - - AFS_STATCNT(afs_ioctl); - if (((cmd >> 8) & 0xff) == 'V') { - /* This is a VICEIOCTL call */ - AFS_COPYIN(arg, (caddr_t) &data, sizeof(data), error); - if (error) - return(error); - error = HandleIoctl(tvc, cmd, &data); - return(error); - } else { - /* No-op call; just return. */ - return(ENOTTY); - } +int +afs_ioctl(struct vcache *tvc, int cmd, int arg) +{ + struct afs_ioctl data; + int error = 0; + + AFS_STATCNT(afs_ioctl); + if (((cmd >> 8) & 0xff) == 'V') { + /* This is a VICEIOCTL call */ + AFS_COPYIN(arg, (caddr_t) & data, sizeof(data), error); + if (error) + return (error); + error = HandleIoctl(tvc, cmd, &data); + return (error); + } else { + /* No-op call; just return. */ + return (ENOTTY); + } } #endif /* AFS_AIX_ENV */ #if defined(AFS_SGI_ENV) -afs_ioctl(OSI_VN_DECL(tvc), int cmd, void * arg, int flag, cred_t *cr, rval_t *rvalp +afs_ioctl(OSI_VN_DECL(tvc), int cmd, void *arg, int flag, cred_t * cr, + rval_t * rvalp #ifdef AFS_SGI65_ENV - , struct vopbd *vbds -#endif - ) -{ - struct afs_ioctl data; - int error = 0; - int locked; - - OSI_VN_CONVERT(tvc); - - AFS_STATCNT(afs_ioctl); - if (((cmd >> 8) & 0xff) == 'V') { - /* This is a VICEIOCTL call */ - error = copyin_afs_ioctl(arg, &data); - if (error) - return(error); - locked = ISAFS_GLOCK(); - if (!locked) - AFS_GLOCK(); - error = HandleIoctl(tvc, cmd, &data); - if (!locked) - AFS_GUNLOCK(); - return(error); - } else { - /* No-op call; just return. */ - return(ENOTTY); - } + , struct vopbd * vbds +#endif + ) +{ + struct afs_ioctl data; + int error = 0; + int locked; + + OSI_VN_CONVERT(tvc); + + AFS_STATCNT(afs_ioctl); + if (((cmd >> 8) & 0xff) == 'V') { + /* This is a VICEIOCTL call */ + error = copyin_afs_ioctl(arg, &data); + if (error) + return (error); + locked = ISAFS_GLOCK(); + if (!locked) + AFS_GLOCK(); + error = HandleIoctl(tvc, cmd, &data); + if (!locked) + AFS_GUNLOCK(); + return (error); + } else { + /* No-op call; just return. */ + return (ENOTTY); + } } #endif /* AFS_SGI_ENV */ - /* unlike most calls here, this one uses u.u_error to return error conditions, since this is really an intercepted chapter 2 call, rather than a vnode interface call. @@ -363,16 +413,28 @@ afs_ioctl(OSI_VN_DECL(tvc), int cmd, void * arg, int flag, cred_t *cr, rval_t *r #ifndef AFS_HPUX102_ENV #if !defined(AFS_SGI_ENV) #ifdef AFS_AIX32_ENV +#ifdef AFS_AIX51_ENV +#ifdef __64BIT__ +kioctl(fdes, com, arg, ext, arg2, arg3) +#else /* __64BIT__ */ +kioctl32(fdes, com, arg, ext, arg2, arg3) +#endif /* __64BIT__ */ + caddr_t arg2, arg3; +#else kioctl(fdes, com, arg, ext) +#endif int fdes, com; caddr_t arg, ext; { - struct a { - int fd, com; - caddr_t arg, ext; - } u_uap, *uap = &u_uap; + struct a { + int fd, com; + caddr_t arg, ext; +#ifdef AFS_AIX51_ENV + caddr_t arg2, arg3; +#endif + } u_uap, *uap = &u_uap; #else -#ifdef AFS_SUN5_ENV +#if defined(AFS_SUN5_ENV) struct afs_ioctl_sys { int fd; @@ -380,295 +442,304 @@ struct afs_ioctl_sys { int arg; }; -afs_xioctl (uap, rvp) - struct afs_ioctl_sys *uap; - rval_t *rvp; +afs_xioctl(uap, rvp) + struct afs_ioctl_sys *uap; + rval_t *rvp; { -#else -#ifdef AFS_OSF_ENV -afs_xioctl (p, args, retval) - struct proc *p; - void *args; - long *retval; +#elif defined(AFS_OSF_ENV) +afs_xioctl(p, args, retval) + struct proc *p; + void *args; + long *retval; { struct a { - long fd; - u_long com; - caddr_t arg; + long fd; + u_long com; + caddr_t arg; } *uap = (struct a *)args; -#else /* AFS_OSF_ENV */ -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#elif defined(AFS_FBSD50_ENV) +#define arg data +int +afs_xioctl(td, uap, retval) + struct thread *td; + register struct ioctl_args *uap; + register_t *retval; +{ + struct proc *p = td->td_proc; +#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) struct ioctl_args { - int fd; - u_long com; - caddr_t arg; + int fd; + u_long com; + caddr_t arg; }; -afs_xioctl(p, uap, retval) - struct proc *p; - register struct ioctl_args *uap; - register_t *retval; + +int +afs_xioctl(p, uap, retval) + struct proc *p; + register struct ioctl_args *uap; + register_t *retval; { -#else -#ifdef AFS_LINUX22_ENV +#elif defined(AFS_LINUX22_ENV) struct afs_ioctl_sys { unsigned int com; unsigned long arg; }; -asmlinkage int afs_xioctl(struct inode *ip, struct file *fp, - unsigned int com, unsigned long arg) +asmlinkage int +afs_xioctl(struct inode *ip, struct file *fp, unsigned int com, + unsigned long arg) { struct afs_ioctl_sys ua, *uap = &ua; #else -afs_xioctl () - { - register struct a { +int +afs_xioctl(void) +{ + register struct a { int fd; int com; caddr_t arg; - } *uap = (struct a *)u.u_ap; -#endif /* AFS_LINUX22_ENV */ -#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */ -#endif /* AFS_OSF_ENV */ -#endif /* AFS_SUN5_ENV */ + } *uap = (struct a *)u.u_ap; +#endif /* AFS_SUN5_ENV */ #endif -#ifndef AFS_LINUX22_ENV -#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) - struct file *fd; -#else - register struct file *fd; -#endif -#endif -#if defined(AFS_FBSD_ENV) - register struct filedesc *fdp; -#endif - register struct vcache *tvc; - register int ioctlDone = 0, code = 0; - - AFS_STATCNT(afs_xioctl); -#if defined(AFS_FBSD_ENV) - fdp=p->p_fd; - if ((u_int)uap->fd >= fdp->fd_nfiles || - (fd = fdp->fd_ofiles[uap->fd]) == NULL) - return EBADF; - if ((fd->f_flag & (FREAD | FWRITE)) == 0) - return EBADF; -#else -#if defined(AFS_DARWIN_ENV) - if ((code=fdgetf(p, uap->fd, &fd))) - return code; -#else -#ifdef AFS_LINUX22_ENV +#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) + struct file *fd; +#elif !defined(AFS_LINUX22_ENV) + register struct file *fd; +#endif +#if defined(AFS_XBSD_ENV) + register struct filedesc *fdp; +#endif + register struct vcache *tvc; + register int ioctlDone = 0, code = 0; + + AFS_STATCNT(afs_xioctl); +#if defined(AFS_XBSD_ENV) + fdp = p->p_fd; + if ((u_int) uap->fd >= fdp->fd_nfiles + || (fd = fdp->fd_ofiles[uap->fd]) == NULL) + return EBADF; + if ((fd->f_flag & (FREAD | FWRITE)) == 0) + return EBADF; +#elif defined(AFS_DARWIN_ENV) + if ((code = fdgetf(p, uap->fd, &fd))) + return code; +#elif defined(AFS_LINUX22_ENV) ua.com = com; ua.arg = arg; -#else -#ifdef AFS_AIX32_ENV - uap->fd = fdes; - uap->com = com; - uap->arg = arg; - if (setuerror(getf(uap->fd, &fd))) { +#elif defined(AFS_AIX32_ENV) + uap->fd = fdes; + uap->com = com; + uap->arg = arg; +#ifdef AFS_AIX51_ENV + uap->arg2 = arg2; + uap->arg3 = arg3; +#endif + if (setuerror(getf(uap->fd, &fd))) { return -1; } -#else -#ifdef AFS_OSF_ENV +#elif defined(AFS_OSF_ENV) fd = NULL; if (code = getf(&fd, uap->fd, FILE_FLAGS_NULL, &u.u_file_state)) - return code; -#else /* AFS_OSF_ENV */ -#ifdef AFS_SUN5_ENV -#if defined(AFS_SUN57_ENV) - fd = getf(uap->fd); - if (!fd) return(EBADF); -#elif defined(AFS_SUN54_ENV) - fd = GETF(uap->fd); - if (!fd) return(EBADF); -#else - if (code = getf(uap->fd, &fd)) { - return (code); - } -#endif + return code; +#elif defined(AFS_SUN5_ENV) +# if defined(AFS_SUN57_ENV) + fd = getf(uap->fd); + if (!fd) + return (EBADF); +# elif defined(AFS_SUN54_ENV) + fd = GETF(uap->fd); + if (!fd) + return (EBADF); +# else + if (code = getf(uap->fd, &fd)) { + return (code); + } +# endif /* AFS_SUN57_ENV */ #else - fd = getf(uap->fd); - if (!fd) return; + fd = getf(uap->fd); + if (!fd) + return (EBADF); #endif -#endif -#endif -#endif -#endif -#endif - - /* first determine whether this is any sort of vnode */ -#ifdef AFS_LINUX22_ENV - tvc = VTOAFS(ip); - { + /* first determine whether this is any sort of vnode */ +#if defined(AFS_LINUX22_ENV) + tvc = VTOAFS(ip); + { #else -#ifdef AFS_SUN5_ENV - if (fd->f_vnode->v_type == VREG || fd->f_vnode->v_type == VDIR) { +#ifdef AFS_SUN5_ENV + if (fd->f_vnode->v_type == VREG || fd->f_vnode->v_type == VDIR) { #else - if (fd->f_type == DTYPE_VNODE) { + if (fd->f_type == DTYPE_VNODE) { #endif /* good, this is a vnode; next see if it is an AFS vnode */ #if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) tvc = VTOAFS(fd->f_vnode); /* valid, given a vnode */ +#elif defined(AFS_OBSD_ENV) + tvc = + IsAfsVnode((struct vnode *)fd-> + f_data) ? VTOAFS((struct vnode *)fd->f_data) : NULL; #else - tvc = VTOAFS((struct vnode*)fd->f_data); /* valid, given a vnode */ + tvc = VTOAFS((struct vnode *)fd->f_data); /* valid, given a vnode */ #endif #endif /* AFS_LINUX22_ENV */ if (tvc && IsAfsVnode(AFSTOV(tvc))) { #ifdef AFS_DEC_ENV - tvc = VTOAFS(afs_gntovn((struct gnode *) tvc)); - if (!tvc) { /* shouldn't happen with held gnodes */ - u.u_error = ENOENT; - return; - } -#endif - /* This is an AFS vnode */ - if (((uap->com >> 8) & 0xff) == 'V') { - register struct afs_ioctl *datap; - AFS_GLOCK(); - datap = (struct afs_ioctl *) osi_AllocSmallSpace(AFS_SMALLOCSIZ); - AFS_COPYIN((char *)uap->arg, (caddr_t) datap, sizeof (struct afs_ioctl), code); - if (code) { - osi_FreeSmallSpace(datap); - AFS_GUNLOCK(); -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - return code; -#else + tvc = VTOAFS(afs_gntovn((struct gnode *)tvc)); + if (!tvc) { /* shouldn't happen with held gnodes */ + u.u_error = ENOENT; + return; + } +#endif + /* This is an AFS vnode */ + if (((uap->com >> 8) & 0xff) == 'V') { + register struct afs_ioctl *datap; + AFS_GLOCK(); + datap = + (struct afs_ioctl *)osi_AllocSmallSpace(AFS_SMALLOCSIZ); + AFS_COPYIN((char *)uap->arg, (caddr_t) datap, + sizeof(struct afs_ioctl), code); + if (code) { + osi_FreeSmallSpace(datap); + AFS_GUNLOCK(); +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + return code; +#else #if defined(AFS_SUN5_ENV) #ifdef AFS_SUN54_ENV - releasef(uap->fd); + releasef(uap->fd); #else - releasef(fd); + releasef(fd); #endif - return (EFAULT); + return (EFAULT); #else #ifdef AFS_OSF_ENV #ifdef AFS_OSF30_ENV - FP_UNREF_ALWAYS(fd); + FP_UNREF_ALWAYS(fd); #else - FP_UNREF(fd); + FP_UNREF(fd); #endif - return code; -#else /* AFS_OSF_ENV */ + return code; +#else /* AFS_OSF_ENV */ #ifdef AFS_AIX41_ENV - ufdrele(uap->fd); + ufdrele(uap->fd); #endif #ifdef AFS_LINUX22_ENV - return -code; + return -code; #else - setuerror(code); - return; + setuerror(code); + return; #endif #endif #endif #endif - } - code = HandleIoctl(tvc, uap->com, datap); - osi_FreeSmallSpace(datap); - AFS_GUNLOCK(); - ioctlDone = 1; + } + code = HandleIoctl(tvc, uap->com, datap); + osi_FreeSmallSpace(datap); + AFS_GUNLOCK(); + ioctlDone = 1; #ifdef AFS_AIX41_ENV - ufdrele(uap->fd); + ufdrele(uap->fd); #endif #ifdef AFS_OSF_ENV #ifdef AFS_OSF30_ENV - FP_UNREF_ALWAYS(fd); + FP_UNREF_ALWAYS(fd); #else - FP_UNREF(fd); + FP_UNREF(fd); #endif #endif - } + } #if defined(AFS_LINUX22_ENV) - else - code = EINVAL; + else + code = EINVAL; #endif } - } + } - if (!ioctlDone) { + if (!ioctlDone) { #ifdef AFS_AIX41_ENV - ufdrele(uap->fd); - code = okioctl(fdes, com, arg, ext); - return code; -#else + ufdrele(uap->fd); +#ifdef AFS_AIX51_ENV +#ifdef __64BIT__ + code = okioctl(fdes, com, arg, ext, arg2, arg3); +#else /* __64BIT__ */ + code = okioctl32(fdes, com, arg, ext, arg2, arg3); +#endif /* __64BIT__ */ +#else /* !AFS_AIX51_ENV */ + code = okioctl(fdes, com, arg, ext); +#endif /* AFS_AIX51_ENV */ + return code; +#else /* !AFS_AIX41_ENV */ #ifdef AFS_AIX32_ENV - okioctl(fdes, com, arg, ext); -#else -#if defined(AFS_SUN5_ENV) + okioctl(fdes, com, arg, ext); +#elif defined(AFS_SUN5_ENV) #if defined(AFS_SUN57_ENV) releasef(uap->fd); #elif defined(AFS_SUN54_ENV) - RELEASEF(uap->fd); -#else - releasef(fd); -#endif - code = ioctl(uap, rvp); -#else -#if defined(AFS_FBSD_ENV) - return ioctl(p, uap); -#else -#if defined(AFS_DARWIN_ENV) - return ioctl(p, uap, retval); -#else -#ifdef AFS_OSF_ENV - code = ioctl(p, args, retval); + RELEASEF(uap->fd); +#else + releasef(fd); +#endif + code = ioctl(uap, rvp); +#elif defined(AFS_FBSD50_ENV) + return ioctl(td, uap); +#elif defined(AFS_FBSD_ENV) + return ioctl(p, uap); +#elif defined(AFS_OBSD_ENV) + code = sys_ioctl(p, uap, retval); +#elif defined(AFS_DARWIN_ENV) + return ioctl(p, uap, retval); +#elif defined(AFS_OSF_ENV) + code = ioctl(p, args, retval); #ifdef AFS_OSF30_ENV - FP_UNREF_ALWAYS(fd); + FP_UNREF_ALWAYS(fd); #else - FP_UNREF(fd); -#endif - return code; -#else /* AFS_OSF_ENV */ -#ifndef AFS_LINUX22_ENV - ioctl(); -#endif -#endif -#endif -#endif + FP_UNREF(fd); #endif + return code; +#elif !defined(AFS_LINUX22_ENV) + ioctl(); #endif #endif - } + } #ifdef AFS_SUN5_ENV - if (ioctlDone) + if (ioctlDone) #ifdef AFS_SUN54_ENV - releasef(uap->fd); + releasef(uap->fd); #else - releasef(fd); + releasef(fd); #endif - return (code); + return (code); #else #ifdef AFS_LINUX22_ENV - return -code; + return -code; #else -#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) - if (!getuerror()) - setuerror(code); +#if defined(KERNEL_HAVE_UERROR) + if (!getuerror()) + setuerror(code); #if defined(AFS_AIX32_ENV) && !defined(AFS_AIX41_ENV) - return (getuerror() ? -1 : u.u_ioctlrv); + return (getuerror()? -1 : u.u_ioctlrv); #else - return getuerror() ? -1 : 0; + return getuerror()? -1 : 0; #endif #endif #endif /* AFS_LINUX22_ENV */ -#endif /* AFS_SUN5_ENV */ -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - return (code); +#endif /* AFS_SUN5_ENV */ +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + return (code); #endif - } +} #endif /* AFS_SGI_ENV */ #endif /* AFS_HPUX102_ENV */ - + #if defined(AFS_SGI_ENV) /* "pioctl" system call entry point; just pass argument to the parameterized - call below */ + * call below */ struct pioctlargs { - char *path; - sysarg_t cmd; - caddr_t cmarg; - sysarg_t follow; + char *path; + sysarg_t cmd; + caddr_t cmarg; + sysarg_t follow; }; int -afs_pioctl(struct pioctlargs *uap, rval_t *rvp) +afs_pioctl(struct pioctlargs *uap, rval_t * rvp) { int code; @@ -682,48 +753,63 @@ afs_pioctl(struct pioctlargs *uap, rval_t *rvp) return u.u_error; #endif } -#endif /* AFS_SGI_ENV */ -#ifdef AFS_OSF_ENV +#elif defined(AFS_OSF_ENV) afs_pioctl(p, args, retval) - struct proc *p; - void *args; - int *retval; + struct proc *p; + void *args; + int *retval; { struct a { - char *path; - int cmd; - caddr_t cmarg; - int follow; - } *uap = (struct a *) args; + char *path; + int cmd; + caddr_t cmarg; + int follow; + } *uap = (struct a *)args; AFS_STATCNT(afs_pioctl); return (afs_syscall_pioctl(uap->path, uap->cmd, uap->cmarg, uap->follow)); } -extern struct mount *afs_globalVFS; -#else /* AFS_OSF_ENV */ -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#elif defined(AFS_FBSD50_ENV) +int +afs_pioctl(td, args, retval) + struct thread *td; + void *args; + int *retval; +{ + struct a { + char *path; + int cmd; + caddr_t cmarg; + int follow; + } *uap = (struct a *)args; + + AFS_STATCNT(afs_pioctl); + return (afs_syscall_pioctl + (uap->path, uap->cmd, uap->cmarg, uap->follow, td->td_ucred)); +} + +#elif defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +int afs_pioctl(p, args, retval) - struct proc *p; - void *args; - int *retval; + struct proc *p; + void *args; + int *retval; { struct a { - char *path; - int cmd; - caddr_t cmarg; - int follow; - } *uap = (struct a *) args; - + char *path; + int cmd; + caddr_t cmarg; + int follow; + } *uap = (struct a *)args; + AFS_STATCNT(afs_pioctl); - return (afs_syscall_pioctl(uap->path, uap->cmd, uap->cmarg, uap->follow, p->p_cred->pc_ucred)); -} + return (afs_syscall_pioctl + (uap->path, uap->cmd, uap->cmarg, uap->follow, + p->p_cred->pc_ucred)); +} -extern struct mount *afs_globalVFS; -#else /* AFS_OSF_ENV */ -extern struct vfs *afs_globalVFS; -#endif #endif /* macro to avoid adding any more #ifdef's to pioctl code. */ @@ -733,331 +819,260 @@ extern struct vfs *afs_globalVFS; #define PIOCTL_FREE_CRED() #endif +int #ifdef AFS_SUN5_ENV afs_syscall_pioctl(path, com, cmarg, follow, rvp, credp) - rval_t *rvp; - struct AFS_UCRED *credp; + rval_t *rvp; + struct AFS_UCRED *credp; #else -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) afs_syscall_pioctl(path, com, cmarg, follow, credp) - struct AFS_UCRED *credp; + struct AFS_UCRED *credp; #else afs_syscall_pioctl(path, com, cmarg, follow) #endif #endif - char *path; - unsigned int com; - caddr_t cmarg; - int follow; + char *path; + unsigned int com; + caddr_t cmarg; + int follow; { struct afs_ioctl data; - struct AFS_UCRED *tmpcred, *foreigncreds = 0; + struct AFS_UCRED *tmpcred, *foreigncreds = NULL; register afs_int32 code = 0; struct vnode *vp; #ifdef AFS_DEC_ENV struct vnode *gp; #endif #ifdef AFS_AIX41_ENV - struct ucred *credp = crref(); /* don't free until done! */ + struct ucred *credp = crref(); /* don't free until done! */ #endif #ifdef AFS_LINUX22_ENV - cred_t *credp = crref(); /* don't free until done! */ + cred_t *credp = crref(); /* don't free until done! */ struct dentry *dp; - #endif + AFS_STATCNT(afs_syscall_pioctl); - if (follow) follow = 1; /* compat. with old venus */ + if (follow) + follow = 1; /* compat. with old venus */ code = copyin_afs_ioctl(cmarg, &data); if (code) { PIOCTL_FREE_CRED(); -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - return (code); -#else +#if defined(KERNEL_HAVE_UERROR) setuerror(code); - return code; #endif - } + return (code); + } if ((com & 0xff) == PSetClientContext) { -#if defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - return EINVAL; /* Not handling these yet. */ -#else -#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_LINUX22_ENV) +#ifdef AFS_NEED_CLIENTCONTEXT +#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) code = HandleClientContext(&data, &com, &foreigncreds, credp); #else -#if defined(AFS_HPUX101_ENV) - code=HandleClientContext(&data, &com, &foreigncreds, p_cred(u.u_procp)); -#else -#ifdef AFS_SGI_ENV - code = HandleClientContext(&data, &com, &foreigncreds, OSI_GET_CURRENT_CRED()); -#else - code = HandleClientContext(&data, &com, &foreigncreds, u.u_cred); -#endif /* AFS_SGI_ENV */ -#endif + code = HandleClientContext(&data, &com, &foreigncreds, osi_curcred()); #endif -#endif - if (code) { - if (foreigncreds) { - crfree(foreigncreds); - } - PIOCTL_FREE_CRED(); -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - return (code); + if (code) { + if (foreigncreds) { + crfree(foreigncreds); + } + PIOCTL_FREE_CRED(); +#if defined(KERNEL_HAVE_UERROR) + return (setuerror(code), code); #else - return (setuerror(code), code); + return (code); #endif - } - } -#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) + } +#else /* AFS_NEED_CLIENTCONTEXT */ + return EINVAL; +#endif /* AFS_NEED_CLIENTCONTEXT */ + } +#ifdef AFS_NEED_CLIENTCONTEXT if (foreigncreds) { - /* - * We could have done without temporary setting the u.u_cred below - * (foreigncreds could be passed as param the pioctl modules) - * but calls such as afs_osi_suser() doesn't allow that since it - * references u.u_cred directly. We could, of course, do something - * like afs_osi_suser(cred) which, I think, is better since it - * generalizes and supports multi cred environments... - */ + /* + * We could have done without temporary setting the u.u_cred below + * (foreigncreds could be passed as param the pioctl modules) + * but calls such as afs_osi_suser() doesn't allow that since it + * references u.u_cred directly. We could, of course, do something + * like afs_osi_suser(cred) which, I think, is better since it + * generalizes and supports multi cred environments... + */ #ifdef AFS_SUN5_ENV tmpcred = credp; credp = foreigncreds; -#else -#ifdef AFS_AIX41_ENV +#elif defined(AFS_AIX41_ENV) tmpcred = crref(); /* XXX */ crset(foreigncreds); -#else -#if defined(AFS_HPUX101_ENV) +#elif defined(AFS_HPUX101_ENV) tmpcred = p_cred(u.u_procp); set_p_cred(u.u_procp, foreigncreds); +#elif defined(AFS_SGI_ENV) + tmpcred = OSI_GET_CURRENT_CRED(); + OSI_SET_CURRENT_CRED(foreigncreds); #else -#ifdef AFS_SGI_ENV - tmpcred = OSI_GET_CURRENT_CRED(); - OSI_SET_CURRENT_CRED(foreigncreds); -#else - tmpcred = u.u_cred; - u.u_cred = foreigncreds; -#endif /* AFS_SGI64_ENV */ -#endif /* AFS_HPUX101_ENV */ -#endif + tmpcred = u.u_cred; + u.u_cred = foreigncreds; #endif } -#endif +#endif /* AFS_NEED_CLIENTCONTEXT */ if ((com & 0xff) == 15) { - /* special case prefetch so entire pathname eval occurs in helper process. - otherwise, the pioctl call is essentially useless */ -#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - code = Prefetch(path, &data, follow, - foreigncreds ? foreigncreds : credp); -#else -#if defined(AFS_HPUX101_ENV) - code = Prefetch(path, &data, follow, p_cred(u.u_procp)); + /* special case prefetch so entire pathname eval occurs in helper process. + * otherwise, the pioctl call is essentially useless */ +#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + code = + Prefetch(path, &data, follow, + foreigncreds ? foreigncreds : credp); #else -#ifdef AFS_SGI_ENV - code = Prefetch(path, &data, follow, OSI_GET_CURRENT_CRED()); -#else - code = Prefetch(path, &data, follow, u.u_cred); -#endif /* AFS_SGI64_ENV */ -#endif /* AFS_HPUX101_ENV */ + code = Prefetch(path, &data, follow, osi_curcred()); #endif -#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) - if (foreigncreds) { -#ifdef AFS_AIX41_ENV - crset(tmpcred); /* restore original credentials */ -#else -#if defined(AFS_HPUX101_ENV) - set_p_cred(u.u_procp, tmpcred); /* restore original credentials */ -#else -#ifndef AFS_SUN5_ENV -#ifdef AFS_SGI_ENV - OSI_SET_CURRENT_CRED(tmpcred); /* restore original credentials */ -#else - u.u_cred = tmpcred; /* restore original credentials */ -#endif -#endif -#endif /* AFS_HPUX101_ENV */ - crfree(foreigncreds); -#endif - } -#endif /* AFS_LINUX22_ENV */ - PIOCTL_FREE_CRED(); -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - return (code); -#else - return (setuerror(code), code); + vp = NULL; +#if defined(KERNEL_HAVE_UERROR) + setuerror(code); #endif + goto rescred; } if (path) { AFS_GUNLOCK(); #ifdef AFS_AIX41_ENV - code = lookupname(path, USR, follow, NULL, &vp, - foreigncreds ? foreigncreds : credp); + code = + lookupname(path, USR, follow, NULL, &vp, + foreigncreds ? foreigncreds : credp); #else #ifdef AFS_LINUX22_ENV - code = gop_lookupname(path, AFS_UIOUSER, follow, (struct vnode **) 0, &dp); + code = gop_lookupname(path, AFS_UIOUSER, follow, NULL, &dp); if (!code) vp = (struct vnode *)dp->d_inode; #else - code = gop_lookupname(path, AFS_UIOUSER, follow, (struct vnode **) 0, &vp); + code = gop_lookupname(path, AFS_UIOUSER, follow, NULL, &vp); #endif /* AFS_LINUX22_ENV */ #endif /* AFS_AIX41_ENV */ AFS_GLOCK(); if (code) { -#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) - if (foreigncreds) { -#ifdef AFS_AIX41_ENV - crset(tmpcred); /* restore original credentials */ -#else -#if defined(AFS_HPUX101_ENV) - set_p_cred(u.u_procp, tmpcred); /* restore original credentials */ -#else -#if !defined(AFS_SUN5_ENV) -#ifdef AFS_SGI_ENV - OSI_SET_CURRENT_CRED(tmpcred); /* restore original credentials */ -#else - u.u_cred = tmpcred; /* restore original credentials */ -#endif /* AFS_SGI64_ENV */ -#endif -#endif /* AFS_HPUX101_ENV */ - crfree(foreigncreds); -#endif - } -#endif /* AFS_LINUX22_ENV */ - PIOCTL_FREE_CRED(); -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - return (code); -#else - return(setuerror(code), code); + vp = NULL; +#if defined(KERNEL_HAVE_UERROR) + setuerror(code); #endif + goto rescred; } - } - else vp = (struct vnode *) 0; - + } else + vp = NULL; + /* now make the call if we were passed no file, or were passed an AFS file */ if (!vp || IsAfsVnode(vp)) { -#ifdef AFS_DEC_ENV - /* Ultrix 4.0: can't get vcache entry unless we've got an AFS gnode. - * So, we must test in this part of the code. Also, must arrange to - * GRELE the original gnode pointer when we're done, since in Ultrix 4.0, - * we hold gnodes, whose references hold our vcache entries. - */ - if (vp) { - gp = vp; /* remember for "put" */ - vp = (struct vnode *) afs_gntovn(vp); /* get vcache from gp */ - } - else gp = (struct vnode *) 0; -#endif -#ifdef AFS_SUN5_ENV - code = afs_HandlePioctl(vp, com, &data, follow, &credp); -#else -#ifdef AFS_AIX41_ENV - { - struct ucred *cred1, *cred2; - - if (foreigncreds) { - cred1 = cred2 = foreigncreds; - } else { - cred1 = cred2 = credp; - } - code = afs_HandlePioctl(vp, com, &data, follow, &cred1); - if (cred1 != cred2) { - /* something changed the creds */ - crset(cred1); - } - } -#else -#if defined(AFS_HPUX101_ENV) - { - struct ucred *cred = p_cred(u.u_procp); - code = afs_HandlePioctl(vp, com, &data, follow, &cred); - } -#else -#ifdef AFS_SGI_ENV - { - struct cred *credp; - credp = OSI_GET_CURRENT_CRED(); - code = afs_HandlePioctl(vp, com, &data, follow, &credp); - } -#else -#if defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - code = afs_HandlePioctl(vp, com, &data, follow, &credp); +#if defined(AFS_DEC_ENV) + /* Ultrix 4.0: can't get vcache entry unless we've got an AFS gnode. + * So, we must test in this part of the code. Also, must arrange to + * GRELE the original gnode pointer when we're done, since in Ultrix 4.0, + * we hold gnodes, whose references hold our vcache entries. + */ + if (vp) { + gp = vp; /* remember for "put" */ + vp = (struct vnode *)afs_gntovn(vp); /* get vcache from gp */ + } else + gp = NULL; +#elif defined(AFS_SUN5_ENV) + code = afs_HandlePioctl(vp, com, &data, follow, &credp); +#elif defined(AFS_AIX41_ENV) + { + struct ucred *cred1, *cred2; + + if (foreigncreds) { + cred1 = cred2 = foreigncreds; + } else { + cred1 = cred2 = credp; + } + code = afs_HandlePioctl(vp, com, &data, follow, &cred1); + if (cred1 != cred2) { + /* something changed the creds */ + crset(cred1); + } + } +#elif defined(AFS_HPUX101_ENV) + { + struct ucred *cred = p_cred(u.u_procp); + code = afs_HandlePioctl(vp, com, &data, follow, &cred); + } +#elif defined(AFS_SGI_ENV) + { + struct cred *credp; + credp = OSI_GET_CURRENT_CRED(); + code = afs_HandlePioctl(vp, com, &data, follow, &credp); + } +#elif defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + code = afs_HandlePioctl(vp, com, &data, follow, &credp); #else - code = afs_HandlePioctl(vp, com, &data, follow, &u.u_cred); + code = afs_HandlePioctl(vp, com, &data, follow, &u.u_cred); #endif -#endif /* AFS_SGI_ENV */ -#endif /* AFS_HPUX101_ENV */ -#endif /* AFS_AIX41_ENV */ -#endif /* AFS_SUN5_ENV */ } else { -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - code = EINVAL; /* not in /afs */ -#else +#if defined(KERNEL_HAVE_UERROR) setuerror(EINVAL); +#else + code = EINVAL; /* not in /afs */ #endif #ifdef AFS_DEC_ENV if (vp) { GRELE(vp); - vp = (struct vnode *) 0; + vp = NULL; } #endif } -#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) + rescred: +#if defined(AFS_NEED_CLIENTCONTEXT) if (foreigncreds) { #ifdef AFS_AIX41_ENV - crset(tmpcred); + crset(tmpcred); /* restore original credentials */ #else #if defined(AFS_HPUX101_ENV) - set_p_cred(u.u_procp, tmpcred); /* restore original credentials */ -#else -#ifndef AFS_SUN5_ENV -#ifdef AFS_SGI_ENV - OSI_SET_CURRENT_CRED(tmpcred); /* restore original credentials */ -#else - u.u_cred = tmpcred; /* restore original credentials */ -#endif /* ASF_SGI64_ENV */ -#endif + set_p_cred(u.u_procp, tmpcred); /* restore original credentials */ +#elif defined(AFS_SGI_ENV) + OSI_SET_CURRENT_CRED(tmpcred); /* restore original credentials */ +#elif !defined(AFS_SUN5_ENV) + osi_curcred() = tmpcred; /* restore original credentials */ #endif /* AFS_HPUX101_ENV */ crfree(foreigncreds); -#endif +#endif /* AIX41 */ } -#endif /* AFS_LINUX22_ENV */ +#endif /* AFS_NEED_CLIENTCONTEXT */ if (vp) { #ifdef AFS_LINUX22_ENV dput(dp); #else - AFS_RELE(vp); /* put vnode back */ + AFS_RELE(vp); /* put vnode back */ #endif } PIOCTL_FREE_CRED(); -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - return (code); -#else - if (!getuerror()) - setuerror(code); +#if defined(KERNEL_HAVE_UERROR) + if (!getuerror()) + setuerror(code); return (getuerror()); +#else + return (code); #endif } - - -afs_HandlePioctl(avc, acom, ablob, afollow, acred) - struct vcache *avc; - afs_int32 acom; - struct AFS_UCRED **acred; - register struct afs_ioctl *ablob; - int afollow; + +#define MAXPIOCTLTOKENLEN \ +(3*sizeof(afs_int32)+MAXKTCTICKETLEN+sizeof(struct ClearToken)+MAXKTCREALMLEN) + +int +afs_HandlePioctl(struct vnode *avp, afs_int32 acom, + register struct afs_ioctl *ablob, int afollow, + struct AFS_UCRED **acred) { + struct vcache *avc; struct vrequest treq; register afs_int32 code; register afs_int32 function, device; - afs_int32 inSize, outSize; + afs_int32 inSize, outSize, outSizeMax; char *inData, *outData; - int (*(*pioctlSw))(); + int (*(*pioctlSw)) (); int pioctlSwSize; struct afs_fakestat_state fakestate; + avc = avp ? VTOAFS(avp) : NULL; afs_Trace3(afs_iclSetp, CM_TRACE_PIOCTL, ICL_TYPE_INT32, acom & 0xff, ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, afollow); AFS_STATCNT(HandlePioctl); - if (code = afs_InitReq(&treq, *acred)) return code; + if ((code = afs_InitReq(&treq, *acred))) + return code; afs_InitFakeStat(&fakestate); if (avc) { code = afs_EvalFakeStat(&avc, &fakestate, &treq); @@ -1068,115 +1083,131 @@ afs_HandlePioctl(avc, acom, ablob, afollow, acred) } device = (acom & 0xff00) >> 8; switch (device) { - case 'V': /* Original pioctl's */ - pioctlSw = VpioctlSw; - pioctlSwSize = sizeof(VpioctlSw); - break; - case 'C': /* Coordinated/common pioctl's */ - pioctlSw = CpioctlSw; - pioctlSwSize = sizeof(CpioctlSw); - break; - default: - afs_PutFakeStat(&fakestate); - return EINVAL; + case 'V': /* Original pioctls */ + pioctlSw = VpioctlSw; + pioctlSwSize = sizeof(VpioctlSw); + break; + case 'C': /* Coordinated/common pioctls */ + pioctlSw = CpioctlSw; + pioctlSwSize = sizeof(CpioctlSw); + break; + default: + afs_PutFakeStat(&fakestate); + return EINVAL; } function = acom & 0xff; if (function >= (pioctlSwSize / sizeof(char *))) { afs_PutFakeStat(&fakestate); - return EINVAL; /* out of range */ + return EINVAL; /* out of range */ } inSize = ablob->in_size; /* Do all range checking before continuing */ - if (inSize >= PIGGYSIZE || inSize < 0 || ablob->out_size < 0) + if (inSize > MAXPIOCTLTOKENLEN || inSize < 0 || ablob->out_size < 0) return E2BIG; - inData = osi_AllocLargeSpace(AFS_LRALLOCSIZ); - if (inSize > 0) { - AFS_COPYIN(ablob->in, inData, inSize, code); - inData[inSize]='\0'; + if (inSize > AFS_LRALLOCSIZ) { + inData = osi_AllocLargeSpace(inSize+1); + } else { + inData = osi_AllocLargeSpace(AFS_LRALLOCSIZ); } - else code = 0; + if (!inData) + return ENOMEM; + if (inSize > 0) { + AFS_COPYIN(ablob->in, inData, inSize, code); + inData[inSize] = '\0'; + } else + code = 0; if (code) { - osi_FreeLargeSpace(inData); - afs_PutFakeStat(&fakestate); - return code; + if (inSize > AFS_LRALLOCSIZ) { + osi_Free(inData, inSize+1); + } else { + osi_FreeLargeSpace(inData); + } + afs_PutFakeStat(&fakestate); + return code; + } + if (function == 8 && device == 'V') { /* PGetTokens */ + outSizeMax = MAXPIOCTLTOKENLEN; + outData = osi_Alloc(outSizeMax); + } else { + outSizeMax = AFS_LRALLOCSIZ; + outData = osi_AllocLargeSpace(AFS_LRALLOCSIZ); + } + if (!outData) { + if (inSize > AFS_LRALLOCSIZ) { + osi_Free(inData, inSize+1); + } else { + osi_FreeLargeSpace(inData); + } + return ENOMEM; } - outData = osi_AllocLargeSpace(AFS_LRALLOCSIZ); outSize = 0; - if (function == 3 && device == 'V') /* PSetTokens */ - code = (*pioctlSw[function])(avc, function, &treq, inData, outData, inSize, &outSize, acred); - else - code = (*pioctlSw[function])(avc, function, &treq, inData, outData, inSize, &outSize, *acred); - osi_FreeLargeSpace(inData); + code = + (*pioctlSw[function]) (avc, function, &treq, inData, outData, inSize, + &outSize, acred); + if (inSize > AFS_LRALLOCSIZ) { + osi_Free(inData, inSize+1); + } else { + osi_FreeLargeSpace(inData); + } if (code == 0 && ablob->out_size > 0) { - if (outSize > ablob->out_size) outSize = ablob->out_size; - if (outSize >= PIGGYSIZE) code = E2BIG; - else if (outSize) { - outData[outSize]='\0'; - AFS_COPYOUT(outData, ablob->out, outSize, code); - } - } - osi_FreeLargeSpace(outData); + if (outSize > ablob->out_size) { + code = E2BIG; /* data wont fit in user buffer */ + } else if (outSize) { + AFS_COPYOUT(outData, ablob->out, outSize, code); + } + } + if (outSizeMax > AFS_LRALLOCSIZ) { + osi_Free(outData, outSizeMax); + } else { + osi_FreeLargeSpace(outData); + } afs_PutFakeStat(&fakestate); return afs_CheckCode(code, &treq, 41); - } - -static PGetFID(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { - register afs_int32 code; - +} + +DECL_PIOCTL(PGetFID) +{ AFS_STATCNT(PGetFID); - if (!avc) return EINVAL; + if (!avc) + return EINVAL; memcpy(aout, (char *)&avc->fid, sizeof(struct VenusFid)); *aoutSize = sizeof(struct VenusFid); return 0; - } - -static PSetAcl(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +} + +DECL_PIOCTL(PSetAcl) +{ register afs_int32 code; struct conn *tconn; struct AFSOpaque acl; struct AFSVolSync tsync; struct AFSFetchStatus OutStatus; XSTATS_DECLS; - + AFS_STATCNT(PSetAcl); if (!avc) - return EINVAL; - if ((acl.AFSOpaque_len = strlen(ain)+1) > 1000) - return EINVAL; + return EINVAL; + if ((acl.AFSOpaque_len = strlen(ain) + 1) > 1000) + return EINVAL; acl.AFSOpaque_val = ain; do { - tconn = afs_Conn(&avc->fid, areq, SHARED_LOCK); - if (tconn) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STOREACL); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_StoreACL(tconn->id, (struct AFSFid *) &avc->fid.Fid, - &acl, &OutStatus, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } - else code = -1; - } while - (afs_Analyze(tconn, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_STOREACL, SHARED_LOCK, (struct cell *)0)); + tconn = afs_Conn(&avc->fid, areq, SHARED_LOCK); + if (tconn) { + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STOREACL); + RX_AFS_GUNLOCK(); + code = + RXAFS_StoreACL(tconn->id, (struct AFSFid *)&avc->fid.Fid, + &acl, &OutStatus, &tsync); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tconn, code, &avc->fid, areq, AFS_STATS_FS_RPCIDX_STOREACL, + SHARED_LOCK, NULL)); /* now we've forgotten all of the access info */ ObtainWriteLock(&afs_xcbhash, 455); @@ -1187,69 +1218,52 @@ static PSetAcl(avc, afun, areq, ain, aout, ainSize, aoutSize) if (avc->fid.Fid.Vnode & 1 || (vType(avc) == VDIR)) osi_dnlc_purgedp(avc); return code; - } +} int afs_defaultAsynchrony = 0; -static PStoreBehind(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ - struct AFS_UCRED *acred; -{ - afs_int32 code = 0; - struct sbstruct *sbr; - - sbr = (struct sbstruct *)ain; - if (sbr->sb_default != -1) { - if (afs_osi_suser(acred)) - afs_defaultAsynchrony = sbr->sb_default; - else code = EPERM; - } - - if (avc && (sbr->sb_thisfile != -1)) { - if (afs_AccessOK(avc, PRSFS_WRITE | PRSFS_ADMINISTER, - areq, DONT_CHECK_MODE_BITS)) - avc->asynchrony = sbr->sb_thisfile; - else code = EACCES; - } - - *aoutSize = sizeof(struct sbstruct); - sbr = (struct sbstruct *)aout; - sbr->sb_default = afs_defaultAsynchrony; - if (avc) { - sbr->sb_thisfile = avc->asynchrony; - } - - return code; -} - -static PGCPAGs(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ - struct AFS_UCRED *acred; -{ - if (!afs_osi_suser(acred)) { - return EACCES; - } - afs_gcpags = AFS_GCPAGS_USERDISABLED; - return 0; -} - - static PGetAcl(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PStoreBehind) +{ + afs_int32 code = 0; + struct sbstruct *sbr; + + sbr = (struct sbstruct *)ain; + if (sbr->sb_default != -1) { + if (afs_osi_suser(*acred)) + afs_defaultAsynchrony = sbr->sb_default; + else + code = EPERM; + } + + if (avc && (sbr->sb_thisfile != -1)) { + if (afs_AccessOK + (avc, PRSFS_WRITE | PRSFS_ADMINISTER, areq, DONT_CHECK_MODE_BITS)) + avc->asynchrony = sbr->sb_thisfile; + else + code = EACCES; + } + + *aoutSize = sizeof(struct sbstruct); + sbr = (struct sbstruct *)aout; + sbr->sb_default = afs_defaultAsynchrony; + if (avc) { + sbr->sb_thisfile = avc->asynchrony; + } + + return code; +} + +DECL_PIOCTL(PGCPAGs) +{ + if (!afs_osi_suser(*acred)) { + return EACCES; + } + afs_gcpags = AFS_GCPAGS_USERDISABLED; + return 0; +} + +DECL_PIOCTL(PGetAcl) +{ struct AFSOpaque acl; struct AFSVolSync tsync; struct AFSFetchStatus OutStatus; @@ -1259,7 +1273,8 @@ static PGCPAGs(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) XSTATS_DECLS; AFS_STATCNT(PGetAcl); - if (!avc) return EINVAL; + if (!avc) + return EINVAL; Fid.Volume = avc->fid.Fid.Volume; Fid.Vnode = avc->fid.Fid.Vnode; Fid.Unique = avc->fid.Fid.Unique; @@ -1270,146 +1285,117 @@ static PGCPAGs(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) * we currently use the top 2-bytes (vals 0-4) to tell which * type of acl to bring back. Horrible hack but this will * cause the least number of changes to code size and interfaces. - */ + */ if (Fid.Vnode & 0xc0000000) return ERANGE; Fid.Vnode |= (ainSize << 30); } acl.AFSOpaque_val = aout; do { - tconn = afs_Conn(&avc->fid, areq, SHARED_LOCK); - if (tconn) { - *aout = 0; - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHACL); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_FetchACL(tconn->id, &Fid, - &acl, &OutStatus, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } - else code = -1; - } while - (afs_Analyze(tconn, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_FETCHACL, - SHARED_LOCK, (struct cell *)0)); + tconn = afs_Conn(&avc->fid, areq, SHARED_LOCK); + if (tconn) { + *aout = 0; + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHACL); + RX_AFS_GUNLOCK(); + code = RXAFS_FetchACL(tconn->id, &Fid, &acl, &OutStatus, &tsync); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tconn, code, &avc->fid, areq, AFS_STATS_FS_RPCIDX_FETCHACL, + SHARED_LOCK, NULL)); if (code == 0) { - *aoutSize = (acl.AFSOpaque_len == 0 ? 1 : acl.AFSOpaque_len); + *aoutSize = (acl.AFSOpaque_len == 0 ? 1 : acl.AFSOpaque_len); } return code; - } - - static PNoop() { +} + +DECL_PIOCTL(PNoop) +{ AFS_STATCNT(PNoop); return 0; - } - - static PBogus() { +} + +DECL_PIOCTL(PBogus) +{ AFS_STATCNT(PBogus); return EINVAL; - } - - static PGetFileCell(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - register char *ain; - char *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +} + +DECL_PIOCTL(PGetFileCell) +{ register struct cell *tcell; - + AFS_STATCNT(PGetFileCell); - if (!avc) return EINVAL; + if (!avc) + return EINVAL; tcell = afs_GetCell(avc->fid.Cell, READ_LOCK); - if (!tcell) return ESRCH; + if (!tcell) + return ESRCH; strcpy(aout, tcell->cellName); afs_PutCell(tcell, READ_LOCK); *aoutSize = strlen(aout) + 1; return 0; - } - -static PGetWSCell(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - register char *ain; - char *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ +} + +DECL_PIOCTL(PGetWSCell) { struct cell *tcell = NULL; - + AFS_STATCNT(PGetWSCell); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ tcell = afs_GetPrimaryCell(READ_LOCK); - if (!tcell) /* no primary cell? */ + if (!tcell) /* no primary cell? */ return ESRCH; strcpy(aout, tcell->cellName); *aoutSize = strlen(aout) + 1; afs_PutCell(tcell, READ_LOCK); return 0; } - - static PGetUserCell(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - register char *ain; - char *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { + +DECL_PIOCTL(PGetUserCell) +{ register afs_int32 i; register struct unixuser *tu; register struct cell *tcell; - + AFS_STATCNT(PGetUserCell); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ /* return the cell name of the primary cell for this user */ i = UHash(areq->uid); - ObtainWriteLock(&afs_xuser,224); - for(tu = afs_users[i]; tu; tu = tu->next) { - if (tu->uid == areq->uid && (tu->states & UPrimary)) { - tu->refCount++; - ReleaseWriteLock(&afs_xuser); - break; - } + ObtainWriteLock(&afs_xuser, 224); + for (tu = afs_users[i]; tu; tu = tu->next) { + if (tu->uid == areq->uid && (tu->states & UPrimary)) { + tu->refCount++; + ReleaseWriteLock(&afs_xuser); + break; + } } if (tu) { - tcell = afs_GetCell(tu->cell, READ_LOCK); - afs_PutUser(tu, WRITE_LOCK); - if (!tcell) return ESRCH; - else { - strcpy(aout, tcell->cellName); - afs_PutCell(tcell, READ_LOCK); - *aoutSize = strlen(aout)+1; /* 1 for the null */ - } - } - else { - ReleaseWriteLock(&afs_xuser); - *aout = 0; - *aoutSize = 1; + tcell = afs_GetCell(tu->cell, READ_LOCK); + afs_PutUser(tu, WRITE_LOCK); + if (!tcell) + return ESRCH; + else { + strcpy(aout, tcell->cellName); + afs_PutCell(tcell, READ_LOCK); + *aoutSize = strlen(aout) + 1; /* 1 for the null */ + } + } else { + ReleaseWriteLock(&afs_xuser); + *aout = 0; + *aoutSize = 1; } return 0; - } - - static PSetTokens(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - struct vcache *avc; - int afun; - struct vrequest *areq; - register char *ain; - char *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ - struct AFS_UCRED **acred; +} + +DECL_PIOCTL(PSetTokens) { afs_int32 i; register struct unixuser *tu; @@ -1419,59 +1405,61 @@ static PGetWSCell(avc, afun, areq, ain, aout, ainSize, aoutSize) int stLen; struct vrequest treq; afs_int32 flag, set_parent_pag = 0; - + AFS_STATCNT(PSetTokens); if (!afs_resourceinit_flag) { - return EIO; + return EIO; } memcpy((char *)&i, ain, sizeof(afs_int32)); ain += sizeof(afs_int32); - stp = ain; /* remember where the ticket is */ - if (i < 0 || i > 2000) return EINVAL; /* malloc may fail */ - if (i > MAXKTCTICKETLEN) return EINVAL; + stp = ain; /* remember where the ticket is */ + if (i < 0 || i > MAXKTCTICKETLEN) + return EINVAL; /* malloc may fail */ stLen = i; - ain += i; /* skip over ticket */ + ain += i; /* skip over ticket */ memcpy((char *)&i, ain, sizeof(afs_int32)); ain += sizeof(afs_int32); if (i != sizeof(struct ClearToken)) { - return EINVAL; + return EINVAL; } memcpy((char *)&clear, ain, sizeof(struct ClearToken)); - if (clear.AuthHandle == -1) clear.AuthHandle = 999; /* more rxvab compat stuff */ + if (clear.AuthHandle == -1) + clear.AuthHandle = 999; /* more rxvab compat stuff */ ain += sizeof(struct ClearToken); - if (ainSize != 2*sizeof(afs_int32) + stLen + sizeof(struct ClearToken)) { - /* still stuff left? we've got primary flag and cell name. Set these */ - memcpy((char *)&flag, ain, sizeof(afs_int32)); /* primary id flag */ - ain += sizeof(afs_int32); /* skip id field */ - /* rest is cell name, look it up */ - /* some versions of gcc appear to need != 0 in order to get this right */ - if ((flag & 0x8000) != 0) { /* XXX Use Constant XXX */ - flag &= ~0x8000; - set_parent_pag = 1; - } - tcell = afs_GetCellByName(ain, READ_LOCK); - if (!tcell) goto nocell; - } - else { - /* default to primary cell, primary id */ - flag = 1; /* primary id */ - tcell = afs_GetPrimaryCell(READ_LOCK); - if (!tcell) goto nocell; + if (ainSize != 2 * sizeof(afs_int32) + stLen + sizeof(struct ClearToken)) { + /* still stuff left? we've got primary flag and cell name. Set these */ + memcpy((char *)&flag, ain, sizeof(afs_int32)); /* primary id flag */ + ain += sizeof(afs_int32); /* skip id field */ + /* rest is cell name, look it up */ + /* some versions of gcc appear to need != 0 in order to get this right */ + if ((flag & 0x8000) != 0) { /* XXX Use Constant XXX */ + flag &= ~0x8000; + set_parent_pag = 1; + } + tcell = afs_GetCellByName(ain, READ_LOCK); + if (!tcell) + goto nocell; + } else { + /* default to primary cell, primary id */ + flag = 1; /* primary id */ + tcell = afs_GetPrimaryCell(READ_LOCK); + if (!tcell) + goto nocell; } i = tcell->cellNum; afs_PutCell(tcell, READ_LOCK); if (set_parent_pag) { - int pag; -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + afs_int32 pag; +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) #if defined(AFS_DARWIN_ENV) - struct proc *p=current_proc(); /* XXX */ + struct proc *p = current_proc(); /* XXX */ #else - struct proc *p=curproc; /* XXX */ + struct proc *p = curproc; /* XXX */ #endif - uprintf("Process %d (%s) tried to change pags in PSetTokens\n", - p->p_pid, p->p_comm); - if (!setpag(p, acred, -1, &pag, 1)) { -#else + uprintf("Process %d (%s) tried to change pags in PSetTokens\n", + p->p_pid, p->p_comm); + if (!setpag(p, acred, -1, &pag, 1)) { +#else #ifdef AFS_OSF_ENV if (!setpag(u.u_procp, acred, -1, &pag, 1)) { /* XXX u.u_procp is a no-op XXX */ #else @@ -1483,12 +1471,12 @@ static PGetWSCell(avc, afun, areq, ain, aout, ainSize, aoutSize) } } /* now we just set the tokens */ - tu = afs_GetUser(areq->uid, i, WRITE_LOCK); /* i has the cell # */ + tu = afs_GetUser(areq->uid, i, WRITE_LOCK); /* i has the cell # */ tu->vid = clear.ViceId; - if (tu->stp != (char *) 0) { - afs_osi_Free(tu->stp, tu->stLen); + if (tu->stp != NULL) { + afs_osi_Free(tu->stp, tu->stLen); } - tu->stp = (char *) afs_osi_Alloc(stLen); + tu->stp = (char *)afs_osi_Alloc(stLen); tu->stLen = stLen; memcpy(tu->stp, stp, stLen); tu->ct = clear; @@ -1499,7 +1487,7 @@ static PGetWSCell(avc, afun, areq, ain, aout, ainSize, aoutSize) tu->states |= UHasTokens; tu->states &= ~UTokensBad; afs_SetPrimary(tu, flag); - tu->tokenTime =osi_Time(); + tu->tokenTime = osi_Time(); afs_ResetUserConns(tu); afs_PutUser(tu, WRITE_LOCK); @@ -1507,84 +1495,77 @@ static PGetWSCell(avc, afun, areq, ain, aout, ainSize, aoutSize) nocell: { - int t1; - t1 = afs_initState; - if (t1 < 101) - return EIO; - else - return ESRCH; - } -} + int t1; + t1 = afs_initState; + if (t1 < 101) + return EIO; + else + return ESRCH; + } +} -static PGetVolumeStatus(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PGetVolumeStatus) +{ char volName[32]; - char offLineMsg[256]; - char motd[256]; + char *offLineMsg = afs_osi_Alloc(256); + char *motd = afs_osi_Alloc(256); register struct conn *tc; - register afs_int32 code; + register afs_int32 code = 0; struct VolumeStatus volstat; register char *cp; char *Name, *OfflineMsg, *MOTD; XSTATS_DECLS; AFS_STATCNT(PGetVolumeStatus); - if (!avc) return EINVAL; + if (!avc) { + code = EINVAL; + goto out; + } Name = volName; OfflineMsg = offLineMsg; MOTD = motd; do { - tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); - if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GETVOLUMESTATUS); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_GetVolumeStatus(tc->id, avc->fid.Fid.Volume, &volstat, - &Name, &OfflineMsg, &MOTD); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } - else code = -1; - } while - (afs_Analyze(tc, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_GETVOLUMESTATUS, - SHARED_LOCK, (struct cell *)0)); - - if (code) return code; + tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); + if (tc) { + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GETVOLUMESTATUS); + RX_AFS_GUNLOCK(); + code = + RXAFS_GetVolumeStatus(tc->id, avc->fid.Fid.Volume, &volstat, + &Name, &OfflineMsg, &MOTD); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tc, code, &avc->fid, areq, AFS_STATS_FS_RPCIDX_GETVOLUMESTATUS, + SHARED_LOCK, NULL)); + + if (code) + goto out; /* Copy all this junk into msg->im_data, keeping track of the lengths. */ cp = aout; memcpy(cp, (char *)&volstat, sizeof(VolumeStatus)); cp += sizeof(VolumeStatus); strcpy(cp, volName); - cp += strlen(volName)+1; + cp += strlen(volName) + 1; strcpy(cp, offLineMsg); - cp += strlen(offLineMsg)+1; + cp += strlen(offLineMsg) + 1; strcpy(cp, motd); - cp += strlen(motd)+1; + cp += strlen(motd) + 1; *aoutSize = (cp - aout); - return 0; + out: + afs_osi_Free(offLineMsg, 256); + afs_osi_Free(motd, 256); + return code; } -static PSetVolumeStatus(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PSetVolumeStatus) +{ char volName[32]; - char offLineMsg[256]; - char motd[256]; + char *offLineMsg = afs_osi_Alloc(256); + char *motd = afs_osi_Alloc(256); register struct conn *tc; - register afs_int32 code; + register afs_int32 code = 0; struct AFSFetchVolumeStatus volstat; struct AFSStoreVolumeStatus storeStat; register struct volume *tvp; @@ -1592,31 +1573,43 @@ static PSetVolumeStatus(avc, afun, areq, ain, aout, ainSize, aoutSize) XSTATS_DECLS; AFS_STATCNT(PSetVolumeStatus); - if (!avc) return EINVAL; + if (!avc) { + code = EINVAL; + goto out; + } - tvp = afs_GetVolume(&avc->fid, areq, READ_LOCK); + tvp = afs_GetVolume(&avc->fid, areq, READ_LOCK); if (tvp) { if (tvp->states & (VRO | VBackup)) { afs_PutVolume(tvp, READ_LOCK); - return EROFS; + code = EROFS; + goto out; } afs_PutVolume(tvp, READ_LOCK); - } else - return ENODEV; + } else { + code = ENODEV; + goto out; + } /* Copy the junk out, using cp as a roving pointer. */ cp = ain; memcpy((char *)&volstat, cp, sizeof(AFSFetchVolumeStatus)); cp += sizeof(AFSFetchVolumeStatus); - if (strlen(cp) >= sizeof(volName)) - return E2BIG; + if (strlen(cp) >= sizeof(volName)) { + code = E2BIG; + goto out; + } strcpy(volName, cp); - cp += strlen(volName)+1; - if (strlen(cp) >= sizeof(offLineMsg)) - return E2BIG; + cp += strlen(volName) + 1; + if (strlen(cp) >= sizeof(offLineMsg)) { + code = E2BIG; + goto out; + } strcpy(offLineMsg, cp); - cp += strlen(offLineMsg)+1; - if (strlen(cp) >= sizeof(motd)) - return E2BIG; + cp += strlen(offLineMsg) + 1; + if (strlen(cp) >= sizeof(motd)) { + code = E2BIG; + goto out; + } strcpy(motd, cp); storeStat.Mask = 0; if (volstat.MinQuota != -1) { @@ -1630,66 +1623,59 @@ static PSetVolumeStatus(avc, afun, areq, ain, aout, ainSize, aoutSize) do { tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_SETVOLUMESTATUS); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_SetVolumeStatus(tc->id, avc->fid.Fid.Volume, - &storeStat, volName, offLineMsg, motd); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } - else code = -1; - } while - (afs_Analyze(tc, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_SETVOLUMESTATUS, - SHARED_LOCK, (struct cell *)0)); - - if (code) return code; + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_SETVOLUMESTATUS); + RX_AFS_GUNLOCK(); + code = + RXAFS_SetVolumeStatus(tc->id, avc->fid.Fid.Volume, &storeStat, + volName, offLineMsg, motd); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tc, code, &avc->fid, areq, AFS_STATS_FS_RPCIDX_SETVOLUMESTATUS, + SHARED_LOCK, NULL)); + + if (code) + goto out; /* we are sending parms back to make compat. with prev system. should - change interface later to not ask for current status, just set new status */ + * change interface later to not ask for current status, just set new status */ cp = aout; memcpy(cp, (char *)&volstat, sizeof(VolumeStatus)); cp += sizeof(VolumeStatus); strcpy(cp, volName); - cp += strlen(volName)+1; + cp += strlen(volName) + 1; strcpy(cp, offLineMsg); - cp += strlen(offLineMsg)+1; + cp += strlen(offLineMsg) + 1; strcpy(cp, motd); - cp += strlen(motd)+1; + cp += strlen(motd) + 1; *aoutSize = cp - aout; - return 0; + out: + afs_osi_Free(offLineMsg, 256); + afs_osi_Free(motd, 256); + return code; } -static PFlush(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - register struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ - struct AFS_UCRED *acred; +DECL_PIOCTL(PFlush) { - AFS_STATCNT(PFlush); - if (!avc) return EINVAL; + if (!avc) + return EINVAL; #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) afs_BozonLock(&avc->pvnLock, avc); /* Since afs_TryToSmush will do a pvn_vptrunc */ #endif - ObtainWriteLock(&avc->lock,225); + ObtainWriteLock(&avc->lock, 225); ObtainWriteLock(&afs_xcbhash, 456); afs_DequeueCallback(avc); - avc->states &= ~(CStatd | CDirty); /* next reference will re-stat cache entry */ + avc->states &= ~(CStatd | CDirty); /* next reference will re-stat cache entry */ ReleaseWriteLock(&afs_xcbhash); /* now find the disk cache entries */ - afs_TryToSmush(avc, acred, 1); + afs_TryToSmush(avc, *acred, 1); osi_dnlc_purgedp(avc); afs_symhint_inval(avc); if (avc->linkData && !(avc->states & CCore)) { - afs_osi_Free(avc->linkData, strlen(avc->linkData)+1); - avc->linkData = (char *) 0; + afs_osi_Free(avc->linkData, strlen(avc->linkData) + 1); + avc->linkData = NULL; } ReleaseWriteLock(&avc->lock); #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) @@ -1698,85 +1684,79 @@ static PFlush(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) return 0; } -static PNewStatMount(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PNewStatMount) +{ register afs_int32 code; register struct vcache *tvc; register struct dcache *tdc; struct VenusFid tfid; char *bufp; struct sysname_info sysState; - afs_int32 offset, len; + afs_size_t offset, len; AFS_STATCNT(PNewStatMount); - if (!avc) return EINVAL; + if (!avc) + return EINVAL; code = afs_VerifyVCache(avc, areq); - if (code) return code; + if (code) + return code; if (vType(avc) != VDIR) { return ENOTDIR; } - tdc = afs_GetDCache(avc, 0, areq, &offset, &len, 1); - if (!tdc) return ENOENT; + tdc = afs_GetDCache(avc, (afs_size_t) 0, areq, &offset, &len, 1); + if (!tdc) + return ENOENT; Check_AtSys(avc, ain, &sysState, areq); + ObtainReadLock(&tdc->lock); do { - code = afs_dir_Lookup(&tdc->f.inode, sysState.name, &tfid.Fid); + code = afs_dir_Lookup(&tdc->f.inode, sysState.name, &tfid.Fid); } while (code == ENOENT && Next_AtSys(avc, areq, &sysState)); + ReleaseReadLock(&tdc->lock); + afs_PutDCache(tdc); /* we're done with the data */ bufp = sysState.name; if (code) { - afs_PutDCache(tdc); goto out; } tfid.Cell = avc->fid.Cell; tfid.Fid.Volume = avc->fid.Fid.Volume; - afs_PutDCache(tdc); /* we're done with the data */ if (!tfid.Fid.Unique && (avc->states & CForeign)) { - tvc = afs_LookupVCache(&tfid, areq, (afs_int32 *)0, WRITE_LOCK, avc, bufp); + tvc = afs_LookupVCache(&tfid, areq, NULL, avc, bufp); } else { - tvc = afs_GetVCache(&tfid, areq, (afs_int32 *)0, (struct vcache*)0, - WRITE_LOCK); + tvc = afs_GetVCache(&tfid, areq, NULL, NULL); } if (!tvc) { code = ENOENT; goto out; } if (tvc->mvstat != 1) { - afs_PutVCache(tvc, WRITE_LOCK); + afs_PutVCache(tvc); code = EINVAL; goto out; } - ObtainWriteLock(&tvc->lock,226); + ObtainWriteLock(&tvc->lock, 226); code = afs_HandleLink(tvc, areq); if (code == 0) { if (tvc->linkData) { if ((tvc->linkData[0] != '#') && (tvc->linkData[0] != '%')) - code = EINVAL; + code = EINVAL; else { /* we have the data */ strcpy(aout, tvc->linkData); - *aoutSize = strlen(tvc->linkData)+1; + *aoutSize = strlen(tvc->linkData) + 1; } - } else + } else code = EIO; } ReleaseWriteLock(&tvc->lock); - afs_PutVCache(tvc, WRITE_LOCK); -out: - if (sysState.allocked) osi_FreeLargeSpace(bufp); + afs_PutVCache(tvc); + out: + if (sysState.allocked) + osi_FreeLargeSpace(bufp); return code; } -static PGetTokens(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PGetTokens) +{ register struct cell *tcell; register afs_int32 i; register struct unixuser *tu; @@ -1785,36 +1765,37 @@ static PGetTokens(avc, afun, areq, ain, aout, ainSize, aoutSize) int newStyle; AFS_STATCNT(PGetTokens); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ /* weird interface. If input parameter is present, it is an integer and - we're supposed to return the parm'th tokens for this unix uid. - If not present, we just return tokens for cell 1. - If counter out of bounds, return EDOM. - If no tokens for the particular cell, return ENOTCONN. - Also, if this mysterious parm is present, we return, along with the - tokens, the primary cell indicator (an afs_int32 0) and the cell name - at the end, in that order. - */ - if (newStyle = (ainSize > 0)) { + * we're supposed to return the parm'th tokens for this unix uid. + * If not present, we just return tokens for cell 1. + * If counter out of bounds, return EDOM. + * If no tokens for the particular cell, return ENOTCONN. + * Also, if this mysterious parm is present, we return, along with the + * tokens, the primary cell indicator (an afs_int32 0) and the cell name + * at the end, in that order. + */ + if ((newStyle = (ainSize > 0))) { memcpy((char *)&iterator, ain, sizeof(afs_int32)); } i = UHash(areq->uid); ObtainReadLock(&afs_xuser); - for(tu = afs_users[i]; tu; tu=tu->next) { + for (tu = afs_users[i]; tu; tu = tu->next) { if (newStyle) { if (tu->uid == areq->uid && (tu->states & UHasTokens)) { - if (iterator-- == 0) break; /* are we done yet? */ + if (iterator-- == 0) + break; /* are we done yet? */ } - } - else { - if (tu->uid == areq->uid && afs_IsPrimaryCellNum(tu->cell)) break; + } else { + if (tu->uid == areq->uid && afs_IsPrimaryCellNum(tu->cell)) + break; } } if (tu) { /* - * No need to hold a read lock on each user entry + * No need to hold a read lock on each user entry */ tu->refCount++; } @@ -1823,7 +1804,8 @@ static PGetTokens(avc, afun, areq, ain, aout, ainSize, aoutSize) if (!tu) { return EDOM; } - if (((tu->states & UHasTokens) == 0) || (tu->ct.EndTimestamp < osi_Time())) { + if (((tu->states & UHasTokens) == 0) + || (tu->ct.EndTimestamp < osi_Time())) { tu->states |= (UTokensBad | UNeedsReset); afs_PutUser(tu, READ_LOCK); return ENOTCONN; @@ -1831,7 +1813,8 @@ static PGetTokens(avc, afun, areq, ain, aout, ainSize, aoutSize) /* use iterator for temp */ cp = aout; iterator = tu->stLen; /* for compat, we try to return 56 byte tix if they fit */ - if (iterator < 56) iterator = 56; /* # of bytes we're returning */ + if (iterator < 56) + iterator = 56; /* # of bytes we're returning */ memcpy(cp, (char *)&iterator, sizeof(afs_int32)); cp += sizeof(afs_int32); memcpy(cp, tu->stp, tu->stLen); /* copy out st */ @@ -1849,33 +1832,28 @@ static PGetTokens(avc, afun, areq, ain, aout, ainSize, aoutSize) tcell = afs_GetCell(tu->cell, READ_LOCK); if (tcell) { strcpy(cp, tcell->cellName); - cp += strlen(tcell->cellName)+1; + cp += strlen(tcell->cellName) + 1; afs_PutCell(tcell, READ_LOCK); - } - else *cp++ = 0; + } else + *cp++ = 0; } *aoutSize = cp - aout; afs_PutUser(tu, READ_LOCK); return 0; } -static PUnlog(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PUnlog) +{ register afs_int32 i; register struct unixuser *tu; AFS_STATCNT(PUnlog); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ i = UHash(areq->uid); - ObtainWriteLock(&afs_xuser,227); - for(tu=afs_users[i]; tu; tu=tu->next) { + ObtainWriteLock(&afs_xuser, 227); + for (tu = afs_users[i]; tu; tu = tu->next) { if (tu->uid == areq->uid) { tu->vid = UNDEFVID; tu->states &= ~UHasTokens; @@ -1893,42 +1871,37 @@ static PUnlog(avc, afun, areq, ain, aout, ainSize, aoutSize) */ afs_ResetUserConns(tu); tu->refCount--; - ObtainWriteLock(&afs_xuser,228); + ObtainWriteLock(&afs_xuser, 228); #ifdef UKERNEL - /* set the expire times to 0, causes - * afs_GCUserData to remove this entry - */ - tu->ct.EndTimestamp = 0; - tu->tokenTime = 0; -#endif /* UKERNEL */ + /* set the expire times to 0, causes + * afs_GCUserData to remove this entry + */ + tu->ct.EndTimestamp = 0; + tu->tokenTime = 0; +#endif /* UKERNEL */ } } ReleaseWriteLock(&afs_xuser); return 0; } -static PMariner(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PMariner) +{ afs_int32 newHostAddr; afs_int32 oldHostAddr; - + AFS_STATCNT(PMariner); if (afs_mariner) - memcpy((char *)&oldHostAddr, (char *)&afs_marinerHost, sizeof(afs_int32)); + memcpy((char *)&oldHostAddr, (char *)&afs_marinerHost, + sizeof(afs_int32)); else - oldHostAddr = 0xffffffff; /* disabled */ - + oldHostAddr = 0xffffffff; /* disabled */ + memcpy((char *)&newHostAddr, ain, sizeof(afs_int32)); if (newHostAddr == 0xffffffff) { /* disable mariner operations */ afs_mariner = 0; - } - else if (newHostAddr) { + } else if (newHostAddr) { afs_mariner = 1; afs_marinerHost = newHostAddr; } @@ -1937,141 +1910,127 @@ static PMariner(avc, afun, areq, ain, aout, ainSize, aoutSize) return 0; } -static PCheckServers(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ - struct AFS_UCRED *acred; +DECL_PIOCTL(PCheckServers) { register char *cp = 0; register int i; register struct server *ts; - afs_int32 temp, *lp = (afs_int32 *)ain, havecell=0; + afs_int32 temp, *lp = (afs_int32 *) ain, havecell = 0; struct cell *cellp; struct chservinfo *pcheck; AFS_STATCNT(PCheckServers); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ if (*lp == 0x12345678) { /* For afs3.3 version */ - pcheck=(struct chservinfo *)ain; + pcheck = (struct chservinfo *)ain; if (pcheck->tinterval >= 0) { - cp = aout; + cp = aout; memcpy(cp, (char *)&PROBE_INTERVAL, sizeof(afs_int32)); *aoutSize = sizeof(afs_int32); if (pcheck->tinterval > 0) { - if (!afs_osi_suser(acred)) + if (!afs_osi_suser(*acred)) return EACCES; - PROBE_INTERVAL=pcheck->tinterval; + PROBE_INTERVAL = pcheck->tinterval; } return 0; } if (pcheck->tsize) havecell = 1; - temp=pcheck->tflags; + temp = pcheck->tflags; cp = pcheck->tbuffer; - } else { /* For pre afs3.3 versions */ + } else { /* For pre afs3.3 versions */ memcpy((char *)&temp, ain, sizeof(afs_int32)); - cp = ain+sizeof(afs_int32); - if (ainSize > sizeof(afs_int32)) + cp = ain + sizeof(afs_int32); + if (ainSize > sizeof(afs_int32)) havecell = 1; } - /* + /* * 1: fast check, don't contact servers. * 2: local cell only. */ if (havecell) { /* have cell name, too */ cellp = afs_GetCellByName(cp, READ_LOCK); - if (!cellp) return ENOENT; - } - else cellp = (struct cell *) 0; + if (!cellp) + return ENOENT; + } else + cellp = NULL; if (!cellp && (temp & 2)) { /* use local cell */ cellp = afs_GetPrimaryCell(READ_LOCK); } - if (!(temp & 1)) { /* if not fast, call server checker routine */ + if (!(temp & 1)) { /* if not fast, call server checker routine */ afs_CheckServers(1, cellp); /* check down servers */ afs_CheckServers(0, cellp); /* check up servers */ } /* now return the current down server list */ cp = aout; ObtainReadLock(&afs_xserver); - for(i=0;inext) { - if (cellp && ts->cell != cellp) continue; /* cell spec'd and wrong */ - if ((ts->flags & SRVR_ISDOWN) && ts->addr->sa_portal != ts->cell->vlport) { + for (i = 0; i < NSERVERS; i++) { + for (ts = afs_servers[i]; ts; ts = ts->next) { + if (cellp && ts->cell != cellp) + continue; /* cell spec'd and wrong */ + if ((ts->flags & SRVR_ISDOWN) + && ts->addr->sa_portal != ts->cell->vlport) { memcpy(cp, (char *)&ts->addr->sa_ip, sizeof(afs_int32)); cp += sizeof(afs_int32); } } } ReleaseReadLock(&afs_xserver); - if (cellp) afs_PutCell(cellp, READ_LOCK); + if (cellp) + afs_PutCell(cellp, READ_LOCK); *aoutSize = cp - aout; return 0; } -static PCheckVolNames(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PCheckVolNames) +{ AFS_STATCNT(PCheckVolNames); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ afs_CheckRootVolume(); - afs_CheckVolumeNames(AFS_VOLCHECK_FORCE | - AFS_VOLCHECK_EXPIRED | - AFS_VOLCHECK_BUSY | - AFS_VOLCHECK_MTPTS); + afs_CheckVolumeNames(AFS_VOLCHECK_FORCE | AFS_VOLCHECK_EXPIRED | + AFS_VOLCHECK_BUSY | AFS_VOLCHECK_MTPTS); return 0; } -static PCheckAuth(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { - int i; - struct srvAddr *sa; - struct conn *tc; - struct unixuser *tu; - afs_int32 retValue; - extern afs_rwlock_t afs_xsrvAddr; +DECL_PIOCTL(PCheckAuth) +{ + int i; + struct srvAddr *sa; + struct conn *tc; + struct unixuser *tu; + afs_int32 retValue; AFS_STATCNT(PCheckAuth); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ retValue = 0; - tu = afs_GetUser(areq->uid, 1, READ_LOCK); /* check local cell authentication */ - if (!tu) retValue = EACCES; + tu = afs_GetUser(areq->uid, 1, READ_LOCK); /* check local cell authentication */ + if (!tu) + retValue = EACCES; else { /* we have a user */ - ObtainReadLock(&afs_xsrvAddr); + ObtainReadLock(&afs_xsrvAddr); ObtainReadLock(&afs_xconn); /* any tokens set? */ - if ((tu->states & UHasTokens) == 0) retValue = EACCES; + if ((tu->states & UHasTokens) == 0) + retValue = EACCES; /* all connections in cell 1 working? */ - for(i=0;inext_bkt) { - for (tc = sa->conns; tc; tc=tc->next) { - if (tc->user == tu && (tu->states & UTokensBad)) - retValue = EACCES; - } + for (i = 0; i < NSERVERS; i++) { + for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) { + for (tc = sa->conns; tc; tc = tc->next) { + if (tc->user == tu && (tu->states & UTokensBad)) + retValue = EACCES; + } } } ReleaseReadLock(&afs_xsrvAddr); @@ -2083,60 +2042,57 @@ static PCheckAuth(avc, afun, areq, ain, aout, ainSize, aoutSize) return 0; } -static Prefetch(apath, adata, afollow, acred) -char *apath; -struct afs_ioctl *adata; -int afollow; -struct AFS_UCRED *acred; +static int +Prefetch(char *apath, struct afs_ioctl *adata, int afollow, + struct AFS_UCRED *acred) { register char *tp; register afs_int32 code; -#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) size_t bufferSize; #else u_int bufferSize; #endif AFS_STATCNT(Prefetch); - if (!apath) return EINVAL; + if (!apath) + return EINVAL; tp = osi_AllocLargeSpace(1024); AFS_COPYINSTR(apath, tp, 1024, &bufferSize, code); if (code) { osi_FreeLargeSpace(tp); return code; } - if (afs_BBusy()) { /* do this as late as possible */ + if (afs_BBusy()) { /* do this as late as possible */ osi_FreeLargeSpace(tp); return EWOULDBLOCK; /* pretty close */ } - afs_BQueue(BOP_PATH, (struct vcache*)0, 0, 0, acred, (long)tp, 0L, 0L, 0L); + afs_BQueue(BOP_PATH, (struct vcache *)0, 0, 0, acred, (afs_size_t) 0, + (afs_size_t) 0, tp); return 0; } -static PFindVolume(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PFindVolume) +{ register struct volume *tvp; register struct server *ts; register afs_int32 i; register char *cp; - + AFS_STATCNT(PFindVolume); - if (!avc) return EINVAL; + if (!avc) + return EINVAL; tvp = afs_GetVolume(&avc->fid, areq, READ_LOCK); if (tvp) { cp = aout; - for(i=0;iserverHost[i]; - if (!ts) break; + if (!ts) + break; memcpy(cp, (char *)&ts->addr->sa_ip, sizeof(afs_int32)); cp += sizeof(afs_int32); } - if (istates & CRO) return 0; /* read-only-ness can't change */ - ObtainWriteLock(&avc->lock,229); + if (!avc) + return EINVAL; + if (avc->states & CRO) + return 0; /* read-only-ness can't change */ + ObtainWriteLock(&avc->lock, 229); theFids.AFSCBFids_len = 1; theCBs.AFSCBs_len = 1; - theFids.AFSCBFids_val = (struct AFSFid *) &avc->fid.Fid; + theFids.AFSCBFids_val = (struct AFSFid *)&avc->fid.Fid; theCBs.AFSCBs_val = CallBacks_Array; CallBacks_Array[0].CallBackType = CB_DROPPED; if (avc->callback) { do { tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_GiveUpCallBacks(tc->id, &theFids, &theCBs); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS); + RX_AFS_GUNLOCK(); + code = RXAFS_GiveUpCallBacks(tc->id, &theFids, &theCBs); + RX_AFS_GLOCK(); + XSTATS_END_TIME; } /* don't set code on failure since we wouldn't use it */ - } while - (afs_Analyze(tc, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS, - SHARED_LOCK, (struct cell *)0)); + } while (afs_Analyze + (tc, code, &avc->fid, areq, + AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS, SHARED_LOCK, NULL)); ObtainWriteLock(&afs_xcbhash, 457); afs_DequeueCallback(avc); @@ -2279,83 +2215,71 @@ static PRemoveCallBack(avc, afun, areq, ain, aout, ainSize, aoutSize) return 0; } -static PNewCell(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - struct vcache *avc; - int afun; - struct vrequest *areq; - register char *ain; - char *aout; - afs_int32 ainSize; - struct AFS_UCRED *acred; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PNewCell) +{ /* create a new cell */ - afs_int32 cellHosts[MAXCELLHOSTS], *lp, magic=0; - register struct cell *tcell; - char *newcell=0, *linkedcell=0, *tp= ain; - register afs_int32 code, linkedstate=0, ls; + afs_int32 cellHosts[MAXCELLHOSTS], *lp, magic = 0; + char *newcell = 0, *linkedcell = 0, *tp = ain; + register afs_int32 code, linkedstate = 0, ls; u_short fsport = 0, vlport = 0; afs_int32 scount; - + AFS_STATCNT(PNewCell); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ - if (!afs_osi_suser(acred)) + if (!afs_osi_suser(*acred)) return EACCES; memcpy((char *)&magic, tp, sizeof(afs_int32)); tp += sizeof(afs_int32); if (magic != 0x12345678) - return EINVAL; + return EINVAL; /* A 3.4 fs newcell command will pass an array of MAXCELLHOSTS * server addresses while the 3.5 fs newcell command passes * MAXHOSTS. To figure out which is which, check if the cellname * is good. */ - newcell = tp + (MAXCELLHOSTS+3)*sizeof(afs_int32); + newcell = tp + (MAXCELLHOSTS + 3) * sizeof(afs_int32); scount = ((newcell[0] != '\0') ? MAXCELLHOSTS : MAXHOSTS); /* MAXCELLHOSTS (=8) is less than MAXHOSTS (=13) */ memcpy((char *)cellHosts, tp, MAXCELLHOSTS * sizeof(afs_int32)); tp += (scount * sizeof(afs_int32)); - lp = (afs_int32 *)tp; + lp = (afs_int32 *) tp; fsport = *lp++; vlport = *lp++; - if (fsport < 1024) fsport = 0; /* Privileged ports not allowed */ - if (vlport < 1024) vlport = 0; /* Privileged ports not allowed */ + if (fsport < 1024) + fsport = 0; /* Privileged ports not allowed */ + if (vlport < 1024) + vlport = 0; /* Privileged ports not allowed */ tp += (3 * sizeof(afs_int32)); newcell = tp; if ((ls = *lp) & 1) { - linkedcell = tp + strlen(newcell)+1; - linkedstate |= CLinkedCell; + linkedcell = tp + strlen(newcell) + 1; + linkedstate |= CLinkedCell; } - linkedstate |= CNoSUID; /* setuid is disabled by default for fs newcell */ - code = afs_NewCell(newcell, cellHosts, linkedstate, linkedcell, fsport, vlport, (int)0); + linkedstate |= CNoSUID; /* setuid is disabled by default for fs newcell */ + code = + afs_NewCell(newcell, cellHosts, linkedstate, linkedcell, fsport, + vlport, (int)0); return code; } -static PNewAlias(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - struct vcache *avc; - int afun; - struct vrequest *areq; - register char *ain; - char *aout; - afs_int32 ainSize; - struct AFS_UCRED *acred; - afs_int32 *aoutSize; /* set this */ +DECL_PIOCTL(PNewAlias) { /* create a new cell alias */ char *tp = ain; register afs_int32 code; char *realName, *aliasName; - - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ - if (!afs_osi_suser(acred)) + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ + + if (!afs_osi_suser(*acred)) return EACCES; aliasName = tp; @@ -2367,21 +2291,16 @@ static PNewAlias(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) return code; } -static PListCells(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PListCells) +{ afs_int32 whichCell; - register struct cell *tcell=0; + register struct cell *tcell = 0; register afs_int32 i; register char *cp, *tp = ain; AFS_STATCNT(PListCells); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ memcpy((char *)&whichCell, tp, sizeof(afs_int32)); tp += sizeof(afs_int32); @@ -2389,35 +2308,33 @@ static PListCells(avc, afun, areq, ain, aout, ainSize, aoutSize) if (tcell) { cp = aout; memset(cp, 0, MAXCELLHOSTS * sizeof(afs_int32)); - for(i=0;icellHosts[i] == 0) break; - memcpy(cp, (char *)&tcell->cellHosts[i]->addr->sa_ip, sizeof(afs_int32)); + for (i = 0; i < MAXCELLHOSTS; i++) { + if (tcell->cellHosts[i] == 0) + break; + memcpy(cp, (char *)&tcell->cellHosts[i]->addr->sa_ip, + sizeof(afs_int32)); cp += sizeof(afs_int32); } cp = aout + MAXCELLHOSTS * sizeof(afs_int32); strcpy(cp, tcell->cellName); - cp += strlen(tcell->cellName)+1; + cp += strlen(tcell->cellName) + 1; *aoutSize = cp - aout; afs_PutCell(tcell, READ_LOCK); } - if (tcell) return 0; - else return EDOM; + if (tcell) + return 0; + else + return EDOM; } -static PListAliases(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ +DECL_PIOCTL(PListAliases) { afs_int32 whichAlias; - register struct cell_alias *tcalias=0; + register struct cell_alias *tcalias = 0; register char *cp, *tp = ain; - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ if (ainSize < sizeof(afs_int32)) return EINVAL; @@ -2425,31 +2342,27 @@ static PListAliases(avc, afun, areq, ain, aout, ainSize, aoutSize) tp += sizeof(afs_int32); tcalias = afs_GetCellAlias(whichAlias); - if (tcalias) { + if (tcalias) { cp = aout; strcpy(cp, tcalias->alias); - cp += strlen(tcalias->alias)+1; + cp += strlen(tcalias->alias) + 1; strcpy(cp, tcalias->cell); - cp += strlen(tcalias->cell)+1; + cp += strlen(tcalias->cell) + 1; *aoutSize = cp - aout; afs_PutCellAlias(tcalias); } - if (tcalias) return 0; - else return EDOM; + if (tcalias) + return 0; + else + return EDOM; } -static PRemoveMount(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - register char *ain; - char *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PRemoveMount) +{ register afs_int32 code; char *bufp; struct sysname_info sysState; - afs_int32 offset, len; + afs_size_t offset, len; register struct conn *tc; register struct dcache *tdc; register struct vcache *tvc; @@ -2462,17 +2375,23 @@ static PRemoveMount(avc, afun, areq, ain, aout, ainSize, aoutSize) /* "ain" is the name of the file in this dir to remove */ AFS_STATCNT(PRemoveMount); - if (!avc) return EINVAL; + if (!avc) + return EINVAL; code = afs_VerifyVCache(avc, areq); - if (code) return code; - if (vType(avc) != VDIR) return ENOTDIR; + if (code) + return code; + if (vType(avc) != VDIR) + return ENOTDIR; - tdc = afs_GetDCache(avc, 0, areq, &offset, &len, 1); /* test for error below */ - if (!tdc) return ENOENT; + tdc = afs_GetDCache(avc, (afs_size_t) 0, areq, &offset, &len, 1); /* test for error below */ + if (!tdc) + return ENOENT; Check_AtSys(avc, ain, &sysState, areq); + ObtainReadLock(&tdc->lock); do { - code = afs_dir_Lookup(&tdc->f.inode, sysState.name, &tfid.Fid); + code = afs_dir_Lookup(&tdc->f.inode, sysState.name, &tfid.Fid); } while (code == ENOENT && Next_AtSys(avc, areq, &sysState)); + ReleaseReadLock(&tdc->lock); bufp = sysState.name; if (code) { afs_PutDCache(tdc); @@ -2480,11 +2399,10 @@ static PRemoveMount(avc, afun, areq, ain, aout, ainSize, aoutSize) } tfid.Cell = avc->fid.Cell; tfid.Fid.Volume = avc->fid.Fid.Volume; - if (!tfid.Fid.Unique && (avc->states & CForeign)) { - tvc = afs_LookupVCache(&tfid, areq, (afs_int32 *)0, WRITE_LOCK, avc, bufp); + if (!tfid.Fid.Unique && (avc->states & CForeign)) { + tvc = afs_LookupVCache(&tfid, areq, NULL, avc, bufp); } else { - tvc = afs_GetVCache(&tfid, areq, (afs_int32 *)0, - (struct vcache*)0/*xxx avc?*/, WRITE_LOCK); + tvc = afs_GetVCache(&tfid, areq, NULL, NULL); } if (!tvc) { code = ENOENT; @@ -2493,55 +2411,53 @@ static PRemoveMount(avc, afun, areq, ain, aout, ainSize, aoutSize) } if (tvc->mvstat != 1) { afs_PutDCache(tdc); - afs_PutVCache(tvc, WRITE_LOCK); + afs_PutVCache(tvc); code = EINVAL; goto out; } - ObtainWriteLock(&tvc->lock,230); + ObtainWriteLock(&tvc->lock, 230); code = afs_HandleLink(tvc, areq); if (!code) { if (tvc->linkData) { if ((tvc->linkData[0] != '#') && (tvc->linkData[0] != '%')) - code = EINVAL; - } else + code = EINVAL; + } else code = EIO; } ReleaseWriteLock(&tvc->lock); osi_dnlc_purgedp(tvc); - afs_PutVCache(tvc, WRITE_LOCK); + afs_PutVCache(tvc); if (code) { afs_PutDCache(tdc); goto out; } - ObtainWriteLock(&avc->lock,231); + ObtainWriteLock(&avc->lock, 231); osi_dnlc_remove(avc, bufp, tvc); do { tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_REMOVEFILE); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_RemoveFile(tc->id, (struct AFSFid *) &avc->fid.Fid, - bufp, &OutDirStatus, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } - else code = -1; - } while - (afs_Analyze(tc, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_REMOVEFILE, - SHARED_LOCK, (struct cell *)0)); + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_REMOVEFILE); + RX_AFS_GUNLOCK(); + code = + RXAFS_RemoveFile(tc->id, (struct AFSFid *)&avc->fid.Fid, bufp, + &OutDirStatus, &tsync); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tc, code, &avc->fid, areq, AFS_STATS_FS_RPCIDX_REMOVEFILE, + SHARED_LOCK, NULL)); if (code) { - if (tdc) afs_PutDCache(tdc); + if (tdc) + afs_PutDCache(tdc); ReleaseWriteLock(&avc->lock); goto out; } if (tdc) { /* we have the thing in the cache */ + ObtainWriteLock(&tdc->lock, 661); if (afs_LocalHero(avc, tdc, &OutDirStatus, 1)) { /* we can do it locally */ code = afs_dir_Delete(&tdc->f.inode, bufp); @@ -2550,44 +2466,35 @@ static PRemoveMount(avc, afun, areq, ain, aout, ainSize, aoutSize) DZap(&tdc->f.inode); } } + ReleaseWriteLock(&tdc->lock); afs_PutDCache(tdc); /* drop ref count */ } - avc->states &= ~CUnique; /* For the dfs xlator */ + avc->states &= ~CUnique; /* For the dfs xlator */ ReleaseWriteLock(&avc->lock); code = 0; -out: - if (sysState.allocked) osi_FreeLargeSpace(bufp); - return code; + out: + if (sysState.allocked) + osi_FreeLargeSpace(bufp); + return code; } -static PVenusLogging(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - struct vcache *avc; - int afun; - struct vrequest *areq; - register char *ain; - char *aout; - afs_int32 ainSize; - struct AFS_UCRED *acred; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PVenusLogging) +{ return EINVAL; /* OBSOLETE */ } -static PGetCellStatus(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PGetCellStatus) +{ register struct cell *tcell; afs_int32 temp; AFS_STATCNT(PGetCellStatus); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ tcell = afs_GetCellByName(ain, READ_LOCK); - if (!tcell) return ENOENT; + if (!tcell) + return ENOENT; temp = tcell->states; afs_PutCell(tcell, READ_LOCK); memcpy(aout, (char *)&temp, sizeof(afs_int32)); @@ -2595,24 +2502,19 @@ static PGetCellStatus(avc, afun, areq, ain, aout, ainSize, aoutSize) return 0; } -static PSetCellStatus(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - struct AFS_UCRED *acred; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PSetCellStatus) +{ register struct cell *tcell; afs_int32 temp; - - if (!afs_osi_suser(acred)) + + if (!afs_osi_suser(*acred)) return EACCES; - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ - tcell = afs_GetCellByName(ain+2*sizeof(afs_int32), WRITE_LOCK); - if (!tcell) return ENOENT; + tcell = afs_GetCellByName(ain + 2 * sizeof(afs_int32), WRITE_LOCK); + if (!tcell) + return ENOENT; memcpy((char *)&temp, ain, sizeof(afs_int32)); if (temp & CNoSUID) tcell->states |= CNoSUID; @@ -2622,16 +2524,8 @@ static PSetCellStatus(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) return 0; } -static PFlushVolumeData(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) -struct vcache *avc; -int afun; -struct vrequest *areq; -char *ain, *aout; -afs_int32 ainSize; -afs_int32 *aoutSize; /* set this */ -struct AFS_UCRED *acred; +DECL_PIOCTL(PFlushVolumeData) { - extern struct volume *afs_volumes[NVOLS]; register afs_int32 i; register struct dcache *tdc; register struct vcache *tvc; @@ -2641,24 +2535,24 @@ struct AFS_UCRED *acred; AFS_STATCNT(PFlushVolumeData); if (!avc) return EINVAL; - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ - volume = avc->fid.Fid.Volume; /* who to zap */ + volume = avc->fid.Fid.Volume; /* who to zap */ cell = avc->fid.Cell; - /* + /* * Clear stat'd flag from all vnodes from this volume; this will invalidate all * the vcaches associated with the volume. */ ObtainReadLock(&afs_xvcache); - for(i = 0; i < VCSIZE; i++) { - for(tvc = afs_vhashT[i]; tvc; tvc=tvc->hnext) { + for (i = 0; i < VCSIZE; i++) { + for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { if (tvc->fid.Fid.Volume == volume && tvc->fid.Cell == cell) { #if defined(AFS_SGI_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) VN_HOLD(AFSTOV(tvc)); #else -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) osi_vnhold(tvc, 0); #else VREFCOUNT_INC(tvc); @@ -2668,7 +2562,7 @@ struct AFS_UCRED *acred; #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */ #endif - ObtainWriteLock(&tvc->lock,232); + ObtainWriteLock(&tvc->lock, 232); ObtainWriteLock(&afs_xcbhash, 458); afs_DequeueCallback(tvc); @@ -2676,7 +2570,7 @@ struct AFS_UCRED *acred; ReleaseWriteLock(&afs_xcbhash); if (tvc->fid.Fid.Vnode & 1 || (vType(tvc) == VDIR)) osi_dnlc_purgedp(tvc); - afs_TryToSmush(tvc, acred, 1); + afs_TryToSmush(tvc, *acred, 1); ReleaseWriteLock(&tvc->lock); #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) afs_BozonUnlock(&tvc->pvnLock, tvc); @@ -2690,31 +2584,35 @@ struct AFS_UCRED *acred; ReleaseReadLock(&afs_xvcache); - MObtainWriteLock(&afs_xdcache,328); /* needed if you're going to flush any stuff */ - for(i=0;irefCount <= 1) { /* too high, in use by running sys call */ + MObtainWriteLock(&afs_xdcache, 328); /* needed if you're going to flush any stuff */ + for (i = 0; i < afs_cacheFiles; i++) { + if (!(afs_indexFlags[i] & IFEverUsed)) + continue; /* never had any data */ + tdc = afs_GetDSlot(i, NULL); + if (tdc->refCount <= 1) { /* too high, in use by running sys call */ + ReleaseReadLock(&tdc->tlock); if (tdc->f.fid.Fid.Volume == volume && tdc->f.fid.Cell == cell) { - if (! (afs_indexFlags[i] & IFDataMod)) { + if (!(afs_indexFlags[i] & IFDataMod)) { /* if the file is modified, but has a ref cnt of only 1, then - someone probably has the file open and is writing into it. - Better to skip flushing such a file, it will be brought back - immediately on the next write anyway. - - If we *must* flush, then this code has to be rearranged to call - afs_storeAllSegments() first */ - afs_FlushDCache(tdc); + * someone probably has the file open and is writing into it. + * Better to skip flushing such a file, it will be brought back + * immediately on the next write anyway. + * + * If we *must* flush, then this code has to be rearranged to call + * afs_storeAllSegments() first */ + afs_FlushDCache(tdc); } } + } else { + ReleaseReadLock(&tdc->tlock); } - tdc->refCount--; /* bumped by getdslot */ + afs_PutDCache(tdc); /* bumped by getdslot */ } MReleaseWriteLock(&afs_xdcache); ObtainReadLock(&afs_xvolume); - for (i=0;inext) { + for (i = 0; i < NVOLS; i++) { + for (tv = afs_volumes[i]; tv; tv = tv->next) { if (tv->volume == volume) { afs_ResetVolumeInfo(tv); break; @@ -2723,35 +2621,32 @@ struct AFS_UCRED *acred; } ReleaseReadLock(&afs_xvolume); - /* probably, a user is doing this, probably, because things are screwed up. + /* probably, a user is doing this, probably, because things are screwed up. * maybe it's the dnlc's fault? */ - osi_dnlc_purge(); + osi_dnlc_purge(); return 0; } -static PGetVnodeXStatus(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ { +DECL_PIOCTL(PGetVnodeXStatus) +{ register afs_int32 code; struct vcxstat stat; afs_int32 mode, i; - + /* AFS_STATCNT(PGetVnodeXStatus); */ - if (!avc) return EINVAL; + if (!avc) + return EINVAL; code = afs_VerifyVCache(avc, areq); - if (code) return code; + if (code) + return code; if (vType(avc) == VDIR) mode = PRSFS_LOOKUP; else mode = PRSFS_READ; if (!afs_AccessOK(avc, mode, areq, CHECK_MODE_BITS)) - return EACCES; + return EACCES; stat.fid = avc->fid; hset32(stat.DataVersion, hgetlo(avc->m.DataVersion)); stat.lock = avc->lock; @@ -2760,13 +2655,13 @@ static PGetVnodeXStatus(avc, afun, areq, ain, aout, ainSize, aoutSize) hset(stat.flushDV, avc->flushDV); hset(stat.mapDV, avc->mapDV); stat.truncPos = avc->truncPos; - { /* just grab the first two - won't break anything... */ - struct axscache *ac; + { /* just grab the first two - won't break anything... */ + struct axscache *ac; - for (i=0, ac=avc->Access; ac && i < CPSIZE; i++, ac=ac->next) { - stat.randomUid[i] = ac->uid; - stat.randomAccess[i] = ac->axess; - } + for (i = 0, ac = avc->Access; ac && i < CPSIZE; i++, ac = ac->next) { + stat.randomUid[i] = ac->uid; + stat.randomAccess[i] = ac->axess; + } } stat.callback = afs_data_pointer_to_int32(avc->callback); stat.cbExpires = avc->cbExpires; @@ -2786,34 +2681,23 @@ static PGetVnodeXStatus(avc, afun, areq, ain, aout, ainSize, aoutSize) /* (since we don't really believe remote uids anyway) */ /* outname[] shouldn't really be needed- this is left as an excercise */ /* for the reader. */ -static PSetSysName(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) -struct vcache *avc; -int afun; -struct vrequest *areq; -char *ain, *aout; -afs_int32 ainSize; -afs_int32 *aoutSize; /* set this */ -register struct AFS_UCRED *acred; -{ - char *cp, inname[MAXSYSNAME], outname[MAXSYSNAME]; - int setsysname, foundname=0; +DECL_PIOCTL(PSetSysName) +{ + char *cp, *cp2, inname[MAXSYSNAME], outname[MAXSYSNAME]; + int setsysname, foundname = 0; register struct afs_exporter *exporter; - extern struct unixuser *afs_FindUser(); - extern char *afs_sysname; - extern char *afs_sysnamelist[]; - extern int afs_sysnamecount; register struct unixuser *au; register afs_int32 pag, error; - int t, count; - + int t, count, num = 0; + char **sysnamelist[MAXSYSNAME]; AFS_STATCNT(PSetSysName); if (!afs_globalVFS) { - /* Afsd is NOT running; disable it */ -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) - return (EINVAL); -#else + /* Afsd is NOT running; disable it */ +#if defined(KERNEL_HAVE_UERROR) return (setuerror(EINVAL), EINVAL); +#else + return (EINVAL); #endif } memset(inname, 0, MAXSYSNAME); @@ -2821,92 +2705,100 @@ register struct AFS_UCRED *acred; ain += sizeof(afs_int32); if (setsysname) { - /* Check my args */ - if (setsysname < 0 || setsysname > MAXNUMSYSNAMES) - return EINVAL; - for(cp = ain,count = 0;count < setsysname;count++) { - /* won't go past end of ain since maxsysname*num < ain length */ - t = strlen(cp); - if (t >= MAXSYSNAME || t <= 0) - return EINVAL; - /* check for names that can shoot us in the foot */ - if (*cp == '.' && (cp[1] == 0 || (cp[1] == '.' && cp[2] == 0))) - return EINVAL; - cp += t+1; - } - /* args ok */ - - /* inname gets first entry in case we're being a translater */ - t = strlen(ain); - memcpy(inname, ain, t+1); /* include terminating null */ - ain += t + 1; - } - if (acred->cr_gid == RMTUSER_REQ) { /* Handles all exporters */ - pag = PagInCred(acred); + /* Check my args */ + if (setsysname < 0 || setsysname > MAXNUMSYSNAMES) + return EINVAL; + cp2 = ain; + for (cp = ain, count = 0; count < setsysname; count++) { + /* won't go past end of ain since maxsysname*num < ain length */ + t = strlen(cp); + if (t >= MAXSYSNAME || t <= 0) + return EINVAL; + /* check for names that can shoot us in the foot */ + if (*cp == '.' && (cp[1] == 0 || (cp[1] == '.' && cp[2] == 0))) + return EINVAL; + cp += t + 1; + } + /* args ok */ + + /* inname gets first entry in case we're being a translator */ + t = strlen(ain); + memcpy(inname, ain, t + 1); /* include terminating null */ + ain += t + 1; + num = count; + } + if ((*acred)->cr_gid == RMTUSER_REQ) { /* Handles all exporters */ + pag = PagInCred(*acred); if (pag == NOPAG) { - return EINVAL; /* Better than panicing */ + return EINVAL; /* Better than panicing */ } if (!(au = afs_FindUser(pag, -1, READ_LOCK))) { - return EINVAL; /* Better than panicing */ + return EINVAL; /* Better than panicing */ } if (!(exporter = au->exporter)) { afs_PutUser(au, READ_LOCK); - return EINVAL; /* Better than panicing */ + return EINVAL; /* Better than panicing */ } - error = EXP_SYSNAME(exporter, (setsysname? inname : (char *)0), outname); + error = EXP_SYSNAME(exporter, (setsysname ? cp2 : NULL), sysnamelist, + &num); if (error) { - if (error == ENODEV) foundname = 0; /* sysname not set yet! */ + if (error == ENODEV) + foundname = 0; /* sysname not set yet! */ else { afs_PutUser(au, READ_LOCK); return error; } + } else { + foundname = num; + strcpy(outname, (*sysnamelist)[0]); } - else foundname = 1; afs_PutUser(au, READ_LOCK); } else { - - /* Not xlating, so local case */ - if (!afs_sysname) osi_Panic("PSetSysName: !afs_sysname\n"); + /* Not xlating, so local case */ + if (!afs_sysname) + osi_Panic("PSetSysName: !afs_sysname\n"); if (!setsysname) { /* user just wants the info */ strcpy(outname, afs_sysname); foundname = afs_sysnamecount; - } else { /* Local guy; only root can change sysname */ - if (!afs_osi_suser(acred)) + *sysnamelist = afs_sysnamelist; + } else { /* Local guy; only root can change sysname */ + if (!afs_osi_suser(*acred)) return EACCES; - + /* clear @sys entries from the dnlc, once afs_lookup can - do lookups of @sys entries and thinks it can trust them */ + * do lookups of @sys entries and thinks it can trust them */ /* privs ok, store the entry, ... */ strcpy(afs_sysname, inname); - if (setsysname > 1) { /* ... or list */ - cp = ain; - for(count=1; count < setsysname;++count) { - if (!afs_sysnamelist[count]) - osi_Panic("PSetSysName: no afs_sysnamelist entry to write\n"); - t = strlen(cp); - memcpy(afs_sysnamelist[count], cp, t+1); /* include null */ - cp += t+1; - } + if (setsysname > 1) { /* ... or list */ + cp = ain; + for (count = 1; count < setsysname; ++count) { + if (!afs_sysnamelist[count]) + osi_Panic + ("PSetSysName: no afs_sysnamelist entry to write\n"); + t = strlen(cp); + memcpy(afs_sysnamelist[count], cp, t + 1); /* include null */ + cp += t + 1; + } } afs_sysnamecount = setsysname; } } if (!setsysname) { - cp = aout; /* not changing so report back the count and ... */ + cp = aout; /* not changing so report back the count and ... */ memcpy(cp, (char *)&foundname, sizeof(afs_int32)); cp += sizeof(afs_int32); if (foundname) { - strcpy(cp, outname); /* ... the entry, ... */ - cp += strlen(outname)+1; - for(count=1; count < foundname; ++count) { /* ... or list. */ - /* Note: we don't support @sys lists for exporters */ - if (!afs_sysnamelist[count]) - osi_Panic("PSetSysName: no afs_sysnamelist entry to read\n"); - t = strlen(afs_sysnamelist[count]); - if (t >= MAXSYSNAME) - osi_Panic("PSetSysName: sysname entry garbled\n"); - strcpy(cp, afs_sysnamelist[count]); - cp += t + 1; + strcpy(cp, outname); /* ... the entry, ... */ + cp += strlen(outname) + 1; + for (count = 1; count < foundname; ++count) { /* ... or list. */ + if (!(*sysnamelist)[count]) + osi_Panic + ("PSetSysName: no afs_sysnamelist entry to read\n"); + t = strlen((*sysnamelist)[count]); + if (t >= MAXSYSNAME) + osi_Panic("PSetSysName: sysname entry garbled\n"); + strcpy(cp, (*sysnamelist)[count]); + cp += t + 1; } } *aoutSize = cp - aout; @@ -2918,285 +2810,262 @@ register struct AFS_UCRED *acred; * long-term solution here. For small n, though, it should be just * fine. Should consider special-casing the local cell for large n. * Likewise for PSetSPrefs. + * + * s - number of ids in array l[] -- NOT index of last id + * l - array of cell ids which have volumes that need to be sorted + * vlonly - sort vl servers or file servers? */ -static void *ReSortCells_cb(struct cell *cell, void *arg) +static void * +ReSortCells_cb(struct cell *cell, void *arg) { afs_int32 *p = (afs_int32 *) arg; afs_int32 *l = p + 1; int i, s = p[0]; - - for (i=0; icellNum) { ObtainWriteLock(&cell->lock, 690); afs_SortServers(cell->cellHosts, MAXCELLHOSTS); ReleaseWriteLock(&cell->lock); } } + + return NULL; } -static void ReSortCells(int s, afs_int32 *l, int vlonly) -{ - extern struct volume *afs_volumes[NVOLS]; /* volume hash table */ - - int i; - struct volume *j; - register int k; - - if (vlonly) { - afs_int32 *p; - p = (afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * (s+1)); - p[0] = s; - memcpy(p+1, l, s * sizeof(afs_int32)); - afs_TraverseCells(&ReSortCells_cb, p); - afs_osi_Free(p, sizeof(afs_int32) * (s+1)); - return; - } - - ObtainReadLock(&afs_xvolume); - for (i= 0; i< NVOLS; i++) { - for (j=afs_volumes[i];j;j=j->next) { - for (k=0;kcell == l[k]) { - ObtainWriteLock(&j->lock,233); - afs_SortServers(j->serverHost, MAXHOSTS); - ReleaseWriteLock(&j->lock); - break; - } - } - } - ReleaseReadLock(&afs_xvolume); -} - -int debugsetsp = 0; - -static int afs_setsprefs(sp, num, vlonly) - struct spref *sp; - unsigned int num; - unsigned int vlonly; -{ - struct srvAddr *sa; - int i,j,k,matches,touchedSize; - struct server *srvr = NULL; - afs_int32 touched[34]; - int isfs; - - touchedSize=0; - for (k=0; k < num; sp++, k++) { - if (debugsetsp) { - printf ("sp host=%x, rank=%d\n",sp->host.s_addr, sp->rank); - } - matches=0; - ObtainReadLock(&afs_xserver); - - i = SHash(sp->host.s_addr); - for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) { - if (sa->sa_ip == sp->host.s_addr) { - srvr = sa->server; - isfs = (srvr->cell && (sa->sa_portal == srvr->cell->fsport)) - || (sa->sa_portal == AFS_FSPORT); - if ((!vlonly && isfs) || (vlonly && !isfs)) { - matches++; - break; +static void +ReSortCells(int s, afs_int32 * l, int vlonly) +{ + int i; + struct volume *j; + register int k; + + if (vlonly) { + afs_int32 *p; + p = (afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * (s + 1)); + p[0] = s; + memcpy(p + 1, l, s * sizeof(afs_int32)); + afs_TraverseCells(&ReSortCells_cb, p); + afs_osi_Free(p, sizeof(afs_int32) * (s + 1)); + return; + } + + ObtainReadLock(&afs_xvolume); + for (i = 0; i < NVOLS; i++) { + for (j = afs_volumes[i]; j; j = j->next) { + for (k = 0; k < s; k++) + if (j->cell == l[k]) { + ObtainWriteLock(&j->lock, 233); + afs_SortServers(j->serverHost, MAXHOSTS); + ReleaseWriteLock(&j->lock); + break; + } + } + } + ReleaseReadLock(&afs_xvolume); +} + + +static int debugsetsp = 0; +static int +afs_setsprefs(sp, num, vlonly) + struct spref *sp; + unsigned int num; + unsigned int vlonly; +{ + struct srvAddr *sa; + int i, j, k, matches, touchedSize; + struct server *srvr = NULL; + afs_int32 touched[34]; + int isfs; + + touchedSize = 0; + for (k = 0; k < num; sp++, k++) { + if (debugsetsp) { + printf("sp host=%x, rank=%d\n", sp->host.s_addr, sp->rank); + } + matches = 0; + ObtainReadLock(&afs_xserver); + + i = SHash(sp->host.s_addr); + for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) { + if (sa->sa_ip == sp->host.s_addr) { + srvr = sa->server; + isfs = (srvr->cell && (sa->sa_portal == srvr->cell->fsport)) + || (sa->sa_portal == AFS_FSPORT); + if ((!vlonly && isfs) || (vlonly && !isfs)) { + matches++; + break; + } + } + } + + if (sa && matches) { /* found one! */ + if (debugsetsp) { + printf("sa ip=%x, ip_rank=%d\n", sa->sa_ip, sa->sa_iprank); + } + sa->sa_iprank = sp->rank + afs_randomMod15(); + afs_SortOneServer(sa->server); + + if (srvr->cell) { + /* if we don't know yet what cell it's in, this is moot */ + for (j = touchedSize - 1; + j >= 0 && touched[j] != srvr->cell->cellNum; j--) + /* is it in our list of touched cells ? */ ; + if (j < 0) { /* no, it's not */ + touched[touchedSize++] = srvr->cell->cellNum; + if (touchedSize >= 32) { /* watch for ovrflow */ + ReleaseReadLock(&afs_xserver); + ReSortCells(touchedSize, touched, vlonly); + touchedSize = 0; + ObtainReadLock(&afs_xserver); + } + } } - } - } - - if (sa && matches) { /* found one! */ - if (debugsetsp) { - printf ("sa ip=%x, ip_rank=%d\n",sa->sa_ip, sa->sa_iprank); - } - sa->sa_iprank = sp->rank + afs_randomMod15(); - afs_SortOneServer(sa->server); - - if (srvr->cell) { - /* if we don't know yet what cell it's in, this is moot */ - for (j=touchedSize-1; j>=0 && touched[j] != srvr->cell->cellNum; j--) - /* is it in our list of touched cells ? */ ; - if (j < 0) { /* no, it's not */ - touched[touchedSize++] = srvr->cell->cellNum; - if (touchedSize >= 32) { /* watch for ovrflow */ - ReleaseReadLock(&afs_xserver); - ReSortCells(touchedSize, touched, vlonly); - touchedSize=0; - ObtainReadLock(&afs_xserver); - } - } - } - } - - ReleaseReadLock(&afs_xserver); - /* if we didn't find one, start to create one. */ - /* Note that it doesn't have a cell yet... */ - if (!matches) { - afs_uint32 temp = sp->host.s_addr; - srvr = afs_GetServer(&temp, 1, 0, (vlonly ? AFS_VLPORT : AFS_FSPORT), - WRITE_LOCK, (afsUUID *)0,0); - srvr->addr->sa_iprank = sp->rank + afs_randomMod15(); - afs_PutServer(srvr, WRITE_LOCK); - } - } /* for all cited preferences */ - - ReSortCells(touchedSize, touched, vlonly); - return 0; + } + + ReleaseReadLock(&afs_xserver); + /* if we didn't find one, start to create one. */ + /* Note that it doesn't have a cell yet... */ + if (!matches) { + afs_uint32 temp = sp->host.s_addr; + srvr = + afs_GetServer(&temp, 1, 0, (vlonly ? AFS_VLPORT : AFS_FSPORT), + WRITE_LOCK, (afsUUID *) 0, 0); + srvr->addr->sa_iprank = sp->rank + afs_randomMod15(); + afs_PutServer(srvr, WRITE_LOCK); + } + } /* for all cited preferences */ + + ReSortCells(touchedSize, touched, vlonly); + return 0; } /* Note that this may only be performed by the local root user. - */ -static int -PSetSPrefs(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - struct AFS_UCRED *acred; - afs_int32 *aoutSize; -{ - struct setspref *ssp; - AFS_STATCNT(PSetSPrefs); - - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ - - if (!afs_osi_suser(acred)) - return EACCES; - - if (ainSize < sizeof(struct setspref)) - return EINVAL; + */ +DECL_PIOCTL(PSetSPrefs) +{ + struct setspref *ssp; + AFS_STATCNT(PSetSPrefs); - ssp = (struct setspref *)ain; - if (ainSize < sizeof(struct spref)*ssp->num_servers) - return EINVAL; + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ + + if (!afs_osi_suser(*acred)) + return EACCES; + + if (ainSize < sizeof(struct setspref)) + return EINVAL; - afs_setsprefs(&(ssp->servers[0]), ssp->num_servers, - (ssp->flags & DBservers)); - return 0; + ssp = (struct setspref *)ain; + if (ainSize < sizeof(struct spref) * ssp->num_servers) + return EINVAL; + + afs_setsprefs(&(ssp->servers[0]), ssp->num_servers, + (ssp->flags & DBservers)); + return 0; } -static int -PSetSPrefs33(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - struct AFS_UCRED *acred; - afs_int32 *aoutSize; +DECL_PIOCTL(PSetSPrefs33) { - struct spref *sp; - AFS_STATCNT(PSetSPrefs); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + struct spref *sp; + AFS_STATCNT(PSetSPrefs); + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ - if (!afs_osi_suser(acred)) - return EACCES; + if (!afs_osi_suser(*acred)) + return EACCES; - sp = (struct spref *)ain; - afs_setsprefs(sp, ainSize/(sizeof(struct spref)), 0 /*!vlonly*/); - return 0; + sp = (struct spref *)ain; + afs_setsprefs(sp, ainSize / (sizeof(struct spref)), 0 /*!vlonly */ ); + return 0; } /* some notes on the following code... * in the hash table of server structs, all servers with the same IP address - * will be on the same overflow chain. - * This could be sped slightly in some circumstances by having it cache the + * will be on the same overflow chain. + * This could be sped slightly in some circumstances by having it cache the * immediately previous slot in the hash table and some supporting information * Only reports file servers now. */ -static int - PGetSPrefs(avc, afun, areq, ain, aout, ainSize, aoutSize) -struct vcache *avc; -int afun; -struct vrequest *areq; -char *ain, *aout; -afs_int32 ainSize; -afs_int32 *aoutSize; -{ - struct sprefrequest *spin; /* input */ - struct sprefinfo *spout; /* output */ - struct spref *srvout; /* one output component */ - int i,j; /* counters for hash table traversal */ - struct server *srvr; /* one of CM's server structs */ - struct srvAddr *sa; - afs_uint32 prevh; - int vlonly; /* just return vlservers ? */ - int isfs; - - AFS_STATCNT(PGetSPrefs); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ - - - if (ainSize < sizeof (struct sprefrequest_33)) { - return ENOENT; - } - else { - spin = ((struct sprefrequest *) ain); - } - - if (ainSize > sizeof (struct sprefrequest_33)) { - vlonly = (spin->flags & DBservers); - } - else vlonly = 0; - - /* struct sprefinfo includes 1 server struct... that size gets added - * in during the loop that follows. - */ - *aoutSize = sizeof(struct sprefinfo) - sizeof (struct spref); - spout = (struct sprefinfo *) aout; - spout->next_offset = spin->offset; - spout->num_servers = 0; - srvout = spout->servers; - - ObtainReadLock(&afs_xserver); - for (i=0, j=0; j < NSERVERS; j++) { /* sift through hash table */ - for (sa = afs_srvAddrs[j]; sa; sa = sa->next_bkt, i++) { - if (spin->offset > (unsigned short)i) { - continue; /* catch up to where we left off */ - } +DECL_PIOCTL(PGetSPrefs) +{ + struct sprefrequest *spin; /* input */ + struct sprefinfo *spout; /* output */ + struct spref *srvout; /* one output component */ + int i, j; /* counters for hash table traversal */ + struct server *srvr; /* one of CM's server structs */ + struct srvAddr *sa; + int vlonly; /* just return vlservers ? */ + int isfs; + + AFS_STATCNT(PGetSPrefs); + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ + + + if (ainSize < sizeof(struct sprefrequest_33)) { + return ENOENT; + } else { + spin = ((struct sprefrequest *)ain); + } + + if (ainSize > sizeof(struct sprefrequest_33)) { + vlonly = (spin->flags & DBservers); + } else + vlonly = 0; + + /* struct sprefinfo includes 1 server struct... that size gets added + * in during the loop that follows. + */ + *aoutSize = sizeof(struct sprefinfo) - sizeof(struct spref); + spout = (struct sprefinfo *)aout; + spout->next_offset = spin->offset; + spout->num_servers = 0; + srvout = spout->servers; + + ObtainReadLock(&afs_xserver); + for (i = 0, j = 0; j < NSERVERS; j++) { /* sift through hash table */ + for (sa = afs_srvAddrs[j]; sa; sa = sa->next_bkt, i++) { + if (spin->offset > (unsigned short)i) { + continue; /* catch up to where we left off */ + } spout->next_offset++; - + srvr = sa->server; - isfs = (srvr->cell && (sa->sa_portal == srvr->cell->fsport)) - || (sa->sa_portal == AFS_FSPORT); - + isfs = (srvr->cell && (sa->sa_portal == srvr->cell->fsport)) + || (sa->sa_portal == AFS_FSPORT); + if ((vlonly && isfs) || (!vlonly && !isfs)) { - /* only report ranks for vl servers */ - continue; + /* only report ranks for vl servers */ + continue; } - - srvout->host.s_addr = sa->sa_ip; - srvout->rank = sa->sa_iprank; - *aoutSize += sizeof(struct spref); - spout->num_servers++; - srvout++; - - if (*aoutSize > (PIGGYSIZE - sizeof(struct spref))) { - ReleaseReadLock(&afs_xserver); /* no more room! */ - return 0; - } - } - } - ReleaseReadLock(&afs_xserver); - - spout->next_offset = 0; /* start over from the beginning next time */ - return 0; + + srvout->host.s_addr = sa->sa_ip; + srvout->rank = sa->sa_iprank; + *aoutSize += sizeof(struct spref); + spout->num_servers++; + srvout++; + + if (*aoutSize > (PIGGYSIZE - sizeof(struct spref))) { + ReleaseReadLock(&afs_xserver); /* no more room! */ + return 0; + } + } + } + ReleaseReadLock(&afs_xserver); + + spout->next_offset = 0; /* start over from the beginning next time */ + return 0; } /* Enable/Disable the specified exporter. Must be root to disable an exporter */ -int afs_NFSRootOnly = 1; -/*static*/ PExportAfs(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) -struct vcache *avc; -int afun; -struct vrequest *areq; -char *ain, *aout; -afs_int32 ainSize; -afs_int32 *aoutSize; /* set this */ -struct AFS_UCRED *acred; -{ - afs_int32 export, newint=0, type, changestate, handleValue, convmode, pwsync, smounts; - extern struct afs_exporter *exporter_find(); +int afs_NFSRootOnly = 1; +DECL_PIOCTL(PExportAfs) +{ + afs_int32 export, newint = + 0, type, changestate, handleValue, convmode, pwsync, smounts; register struct afs_exporter *exporter; AFS_STATCNT(PExportAfs); @@ -3204,7 +3073,7 @@ struct AFS_UCRED *acred; type = handleValue >> 24; if (type == 0x71) { newint = 1; - type = 1; /* nfs */ + type = 1; /* nfs */ } exporter = exporter_find(type); if (newint) { @@ -3229,8 +3098,8 @@ struct AFS_UCRED *acred; memcpy(aout, (char *)&handleValue, sizeof(afs_int32)); *aoutSize = sizeof(afs_int32); } else { - if (!afs_osi_suser(acred)) - return EACCES; /* Only superuser can do this */ + if (!afs_osi_suser(*acred)) + return EACCES; /* Only superuser can do this */ if (newint) { if (export & 2) { if (export & 1) @@ -3288,94 +3157,71 @@ struct AFS_UCRED *acred; return 0; } -static int -PGag(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) -struct vcache *avc; -int afun; -struct vrequest *areq; -char *ain, *aout; -afs_int32 ainSize; -struct AFS_UCRED *acred; -afs_int32 *aoutSize; /* set this */ +DECL_PIOCTL(PGag) { -struct gaginfo *gagflags; + struct gaginfo *gagflags; - if (!afs_osi_suser(acred)) - return EACCES; + if (!afs_osi_suser(*acred)) + return EACCES; - gagflags = (struct gaginfo *) ain; - afs_showflags = gagflags->showflags; + gagflags = (struct gaginfo *)ain; + afs_showflags = gagflags->showflags; - return 0; + return 0; } -static int -PTwiddleRx(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) -struct vcache *avc; -int afun; -struct vrequest *areq; -char *ain, *aout; -afs_int32 ainSize; -struct AFS_UCRED *acred; -afs_int32 *aoutSize; -{ - struct rxparams *rxp; - - if (!afs_osi_suser(acred)) - return EACCES; - - rxp = (struct rxparams *) ain; - - if (rxp->rx_initReceiveWindow) - rx_initReceiveWindow = rxp->rx_initReceiveWindow; - if (rxp->rx_maxReceiveWindow) - rx_maxReceiveWindow = rxp->rx_maxReceiveWindow; - if (rxp->rx_initSendWindow) - rx_initSendWindow = rxp->rx_initSendWindow; - if (rxp->rx_maxSendWindow) - rx_maxSendWindow = rxp->rx_maxSendWindow; - if (rxp->rxi_nSendFrags) - rxi_nSendFrags = rxp->rxi_nSendFrags; - if (rxp->rxi_nRecvFrags) - rxi_nRecvFrags = rxp->rxi_nRecvFrags; - if (rxp->rxi_OrphanFragSize) - rxi_OrphanFragSize = rxp->rxi_OrphanFragSize; - if (rxp->rx_maxReceiveSize) - { - rx_maxReceiveSize = rxp->rx_maxReceiveSize; - rx_maxReceiveSizeUser = rxp->rx_maxReceiveSize; - } - if (rxp->rx_MyMaxSendSize) - rx_MyMaxSendSize = rxp->rx_MyMaxSendSize; - - return 0; -} - -static int PGetInitParams(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - register char *ain; - char *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ +DECL_PIOCTL(PTwiddleRx) +{ + struct rxparams *rxp; + + if (!afs_osi_suser(*acred)) + return EACCES; + + rxp = (struct rxparams *)ain; + + if (rxp->rx_initReceiveWindow) + rx_initReceiveWindow = rxp->rx_initReceiveWindow; + if (rxp->rx_maxReceiveWindow) + rx_maxReceiveWindow = rxp->rx_maxReceiveWindow; + if (rxp->rx_initSendWindow) + rx_initSendWindow = rxp->rx_initSendWindow; + if (rxp->rx_maxSendWindow) + rx_maxSendWindow = rxp->rx_maxSendWindow; + if (rxp->rxi_nSendFrags) + rxi_nSendFrags = rxp->rxi_nSendFrags; + if (rxp->rxi_nRecvFrags) + rxi_nRecvFrags = rxp->rxi_nRecvFrags; + if (rxp->rxi_OrphanFragSize) + rxi_OrphanFragSize = rxp->rxi_OrphanFragSize; + if (rxp->rx_maxReceiveSize) { + rx_maxReceiveSize = rxp->rx_maxReceiveSize; + rx_maxReceiveSizeUser = rxp->rx_maxReceiveSize; + } + if (rxp->rx_MyMaxSendSize) + rx_MyMaxSendSize = rxp->rx_MyMaxSendSize; + + return 0; +} + +DECL_PIOCTL(PGetInitParams) { if (sizeof(struct cm_initparams) > PIGGYSIZE) return E2BIG; - memcpy(aout, (char*)&cm_initParams, sizeof(struct cm_initparams)); + memcpy(aout, (char *)&cm_initParams, sizeof(struct cm_initparams)); *aoutSize = sizeof(struct cm_initparams); return 0; } #ifdef AFS_SGI65_ENV /* They took crget() from us, so fake it. */ -static cred_t *crget(void) +static cred_t * +crget(void) { cred_t *cr; cr = crdup(get_current_cred()); - memset((char*)cr, 0, sizeof(cred_t)); + memset((char *)cr, 0, sizeof(cred_t)); #if CELL || CELL_PREPARE cr->cr_id = -1; #endif @@ -3383,45 +3229,30 @@ static cred_t *crget(void) } #endif -static int -PGetRxkcrypt(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) -struct vcache *avc; -int afun; -struct vrequest *areq; -char *ain, *aout; -afs_int32 ainSize; -afs_int32 *aoutSize; -struct AFS_UCRED *acred; +DECL_PIOCTL(PGetRxkcrypt) { memcpy(aout, (char *)&cryptall, sizeof(afs_int32)); - *aoutSize=sizeof(afs_int32); + *aoutSize = sizeof(afs_int32); return 0; } -static int -PSetRxkcrypt(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) -struct vcache *avc; -int afun; -struct vrequest *areq; -char *ain, *aout; -afs_int32 ainSize; -afs_int32 *aoutSize; -struct AFS_UCRED *acred; +DECL_PIOCTL(PSetRxkcrypt) { afs_int32 tmpval; - if (!afs_osi_suser(acred)) - return EPERM; + if (!afs_osi_suser(*acred)) + return EPERM; if (ainSize != sizeof(afs_int32) || ain == NULL) - return EINVAL; + return EINVAL; memcpy((char *)&tmpval, ain, sizeof(afs_int32)); /* if new mappings added later this will need to be changed */ if (tmpval != 0 && tmpval != 1) - return EINVAL; + return EINVAL; cryptall = tmpval; return 0; } +#ifdef AFS_NEED_CLIENTCONTEXT /* * Create new credentials to correspond to a remote user with given * . This allows a server running as root to @@ -3430,46 +3261,44 @@ struct AFS_UCRED *acred; */ #define PSETPAG 110 #define PIOCTL_HEADER 6 -static int HandleClientContext(struct afs_ioctl *ablob, int *com, struct AFS_UCRED **acred, struct AFS_UCRED *credp) +static int +HandleClientContext(struct afs_ioctl *ablob, int *com, + struct AFS_UCRED **acred, struct AFS_UCRED *credp) { char *ain, *inData; afs_uint32 hostaddr; afs_int32 uid, g0, g1, i, code, pag, exporter_type; - extern struct afs_exporter *exporter_find(); struct afs_exporter *exporter, *outexporter; struct AFS_UCRED *newcred; struct unixuser *au; -#if defined(AFS_DEC_ENV) || (defined(AFS_NONFSTRANS) && !defined(AFS_AIX_IAUTH_ENV)) - return EINVAL; /* NFS trans not supported for Ultrix */ -#else #if defined(AFS_SGIMP_ENV) osi_Assert(ISAFS_GLOCK()); #endif AFS_STATCNT(HandleClientContext); - if (ablob->in_size < PIOCTL_HEADER*sizeof(afs_int32)) { + if (ablob->in_size < PIOCTL_HEADER * sizeof(afs_int32)) { /* Must at least include the PIOCTL_HEADER header words required by the protocol */ - return EINVAL; /* Too small to be good */ + return EINVAL; /* Too small to be good */ } ain = inData = osi_AllocLargeSpace(AFS_LRALLOCSIZ); - AFS_COPYIN(ablob->in, ain, PIOCTL_HEADER*sizeof(afs_int32), code); + AFS_COPYIN(ablob->in, ain, PIOCTL_HEADER * sizeof(afs_int32), code); if (code) { osi_FreeLargeSpace(inData); return code; } /* Extract information for remote user */ - hostaddr = *((afs_uint32 *)ain); + hostaddr = *((afs_uint32 *) ain); ain += sizeof(hostaddr); - uid = *((afs_uint32 *)ain); + uid = *((afs_uint32 *) ain); ain += sizeof(uid); - g0 = *((afs_uint32 *)ain); + g0 = *((afs_uint32 *) ain); ain += sizeof(g0); - g1 = *((afs_uint32 *)ain); + g1 = *((afs_uint32 *) ain); ain += sizeof(g1); - *com = *((afs_uint32 *)ain); + *com = *((afs_uint32 *) ain); ain += sizeof(afs_int32); - exporter_type = *((afs_uint32 *)ain); /* In case we support more than NFS */ + exporter_type = *((afs_uint32 *) ain); /* In case we support more than NFS */ /* * Of course, one must be root for most of these functions, but @@ -3478,46 +3307,49 @@ static int HandleClientContext(struct afs_ioctl *ablob, int *com, struct AFS_UCR */ i = (*com) & 0xff; if (!afs_osi_suser(credp)) { -#ifdef AFS_SGI_ENV -#ifndef AFS_SGI64_ENV +#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV) /* Since SGI's suser() returns explicit failure after the call.. */ - u.u_error = 0; -#endif + u.u_error = 0; #endif /* check for acceptable opcodes for normal folks, which are, so far, * set tokens and unlog. */ - if (i != 9 && i != 3 && i != 38 && i != 8) { + if (i != 9 && i != 3 && i != 38 && i != 8) { osi_FreeLargeSpace(inData); return EACCES; } } - ablob->in_size -= PIOCTL_HEADER*sizeof(afs_int32); - ablob->in += PIOCTL_HEADER*sizeof(afs_int32); + ablob->in_size -= PIOCTL_HEADER * sizeof(afs_int32); + ablob->in += PIOCTL_HEADER * sizeof(afs_int32); osi_FreeLargeSpace(inData); if (uid == 0) { - /* - * We map uid 0 to nobody to match the mapping that the nfs - * server does and to ensure that the suser() calls in the afs - * code fails for remote client roots. - */ + /* + * We map uid 0 to nobody to match the mapping that the nfs + * server does and to ensure that the suser() calls in the afs + * code fails for remote client roots. + */ uid = afs_nobody; /* NFS_NOBODY == -2 */ } newcred = crget(); #ifdef AFS_AIX41_ENV - setuerror(0); + setuerror(0); #endif newcred->cr_gid = RMTUSER_REQ; +#ifdef AFS_AIX51_ENV + newcred->cr_groupset.gs_union.un_groups[0] = g0; + newcred->cr_groupset.gs_union.un_groups[1] = g1; +#else newcred->cr_groups[0] = g0; newcred->cr_groups[1] = g1; +#endif #ifdef AFS_AIX_ENV newcred->cr_ngrps = 2; #else #if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) newcred->cr_ngroups = 2; #else - for (i=2; icr_groups[i] = NOGROUP; #endif #endif @@ -3526,8 +3358,8 @@ static int HandleClientContext(struct afs_ioctl *ablob, int *com, struct AFS_UCR #endif if (!(exporter = exporter_find(exporter_type))) { /* Exporter wasn't initialized or an invalid exporter type */ - crfree(newcred); - return EINVAL; + crfree(newcred); + return EINVAL; } if (exporter->exp_states & EXP_PWSYNC) { if (uid != credp->cr_uid) { @@ -3535,212 +3367,191 @@ static int HandleClientContext(struct afs_ioctl *ablob, int *com, struct AFS_UCR return ENOEXEC; /* XXX Find a better errno XXX */ } } - newcred->cr_uid = uid; /* Only temporary */ + newcred->cr_uid = uid; /* Only temporary */ code = EXP_REQHANDLER(exporter, &newcred, hostaddr, &pag, &outexporter); /* The client's pag is the only unique identifier for it */ newcred->cr_uid = pag; *acred = newcred; if (!code && *com == PSETPAG) { - /* Special case for 'setpag' */ - afs_uint32 pagvalue = genpag(); - - au = afs_GetUser(pagvalue, -1, WRITE_LOCK); /* a new unixuser struct */ - /* - * Note that we leave the 'outexporter' struct held so it won't - * dissappear on us - */ - au->exporter = outexporter; - if (ablob->out_size >= 4) { - AFS_COPYOUT((char *)&pagvalue, ablob->out, sizeof(afs_int32), code); - } - afs_PutUser(au, WRITE_LOCK); - if (code) return code; - return PSETPAG; /* Special return for setpag */ + /* Special case for 'setpag' */ + afs_uint32 pagvalue = genpag(); + + au = afs_GetUser(pagvalue, -1, WRITE_LOCK); /* a new unixuser struct */ + /* + * Note that we leave the 'outexporter' struct held so it won't + * dissappear on us + */ + au->exporter = outexporter; + if (ablob->out_size >= 4) { + AFS_COPYOUT((char *)&pagvalue, ablob->out, sizeof(afs_int32), + code); + } + afs_PutUser(au, WRITE_LOCK); + if (code) + return code; + return PSETPAG; /* Special return for setpag */ } else if (!code) { EXP_RELE(outexporter); } return code; -#endif /*defined(AFS_DEC_ENV) || defined(AFS_NONFSTRANS)*/ } +#endif /* AFS_NEED_CLIENTCONTEXT */ /* get all interface addresses of this client */ -static int -PGetCPrefs(avc, afun, areq, ain, aout, ainSize, aoutSize) -struct vcache *avc; -int afun; -struct vrequest *areq; -char *ain, *aout; -afs_int32 ainSize; -afs_int32 *aoutSize; -{ - struct sprefrequest *spin; /* input */ - struct sprefinfo *spout; /* output */ - struct spref *srvout; /* one output component */ - int maxNumber; - int i,j; - - AFS_STATCNT(PGetCPrefs); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ - - if ( ainSize < sizeof (struct sprefrequest )) - return EINVAL; - - spin = (struct sprefrequest *) ain; - spout = (struct sprefinfo *) aout; - - maxNumber = spin->num_servers; /* max addrs this time */ - srvout = spout->servers; - - ObtainReadLock(&afs_xinterface); - - /* copy out the client interface information from the - ** kernel data structure "interface" to the output buffer - */ - for ( i=spin->offset, j=0; (i < afs_cb_interface.numberOfInterfaces) - && ( j< maxNumber) ; i++, j++, srvout++) - srvout->host.s_addr = afs_cb_interface.addr_in[i]; - - spout->num_servers = j; - *aoutSize = sizeof(struct sprefinfo) +(j-1)* sizeof (struct spref); - - if ( i >= afs_cb_interface.numberOfInterfaces ) - spout->next_offset = 0; /* start from beginning again */ - else - spout->next_offset = spin->offset + j; - - ReleaseReadLock(&afs_xinterface); - return 0; +DECL_PIOCTL(PGetCPrefs) +{ + struct sprefrequest *spin; /* input */ + struct sprefinfo *spout; /* output */ + struct spref *srvout; /* one output component */ + int maxNumber; + int i, j; + + AFS_STATCNT(PGetCPrefs); + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ + + if (ainSize < sizeof(struct sprefrequest)) + return EINVAL; + + spin = (struct sprefrequest *)ain; + spout = (struct sprefinfo *)aout; + + maxNumber = spin->num_servers; /* max addrs this time */ + srvout = spout->servers; + + ObtainReadLock(&afs_xinterface); + + /* copy out the client interface information from the + ** kernel data structure "interface" to the output buffer + */ + for (i = spin->offset, j = 0; (i < afs_cb_interface.numberOfInterfaces) + && (j < maxNumber); i++, j++, srvout++) + srvout->host.s_addr = afs_cb_interface.addr_in[i]; + + spout->num_servers = j; + *aoutSize = sizeof(struct sprefinfo) + (j - 1) * sizeof(struct spref); + + if (i >= afs_cb_interface.numberOfInterfaces) + spout->next_offset = 0; /* start from beginning again */ + else + spout->next_offset = spin->offset + j; + + ReleaseReadLock(&afs_xinterface); + return 0; } -static int -PSetCPrefs(avc, afun, areq, ain, aout, ainSize, aoutSize) -struct vcache *avc; -int afun; -struct vrequest *areq; -char *ain, *aout; -afs_int32 ainSize; -afs_int32 *aoutSize; +DECL_PIOCTL(PSetCPrefs) { - struct setspref *sin; - int i; + struct setspref *sin; + int i; - AFS_STATCNT(PSetCPrefs); - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + AFS_STATCNT(PSetCPrefs); + if (!afs_resourceinit_flag) /* afs daemons haven't started yet */ + return EIO; /* Inappropriate ioctl for device */ - sin = (struct setspref *)ain; + sin = (struct setspref *)ain; - if ( ainSize < sizeof(struct setspref) ) - return EINVAL; -#if 0 /* num_servers is unsigned */ - if ( sin->num_servers < 0 ) - return EINVAL; + if (ainSize < sizeof(struct setspref)) + return EINVAL; +#if 0 /* num_servers is unsigned */ + if (sin->num_servers < 0) + return EINVAL; #endif - if ( sin->num_servers > AFS_MAX_INTERFACE_ADDR) - return ENOMEM; + if (sin->num_servers > AFS_MAX_INTERFACE_ADDR) + return ENOMEM; - ObtainWriteLock(&afs_xinterface, 412); - afs_cb_interface.numberOfInterfaces = sin->num_servers; - for ( i=0; (unsigned short)i < sin->num_servers; i++) - afs_cb_interface.addr_in[i] = sin->servers[i].host.s_addr; + ObtainWriteLock(&afs_xinterface, 412); + afs_cb_interface.numberOfInterfaces = sin->num_servers; + for (i = 0; (unsigned short)i < sin->num_servers; i++) + afs_cb_interface.addr_in[i] = sin->servers[i].host.s_addr; - ReleaseWriteLock(&afs_xinterface); - return 0; + ReleaseWriteLock(&afs_xinterface); + return 0; } -static PFlushMount(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; - struct AFS_UCRED *acred; { +DECL_PIOCTL(PFlushMount) +{ register afs_int32 code; register struct vcache *tvc; register struct dcache *tdc; struct VenusFid tfid; char *bufp; struct sysname_info sysState; - afs_int32 offset, len; + afs_size_t offset, len; AFS_STATCNT(PFlushMount); - if (!avc) return EINVAL; + if (!avc) + return EINVAL; code = afs_VerifyVCache(avc, areq); - if (code) return code; + if (code) + return code; if (vType(avc) != VDIR) { return ENOTDIR; } - tdc = afs_GetDCache(avc, 0, areq, &offset, &len, 1); - if (!tdc) return ENOENT; + tdc = afs_GetDCache(avc, (afs_size_t) 0, areq, &offset, &len, 1); + if (!tdc) + return ENOENT; Check_AtSys(avc, ain, &sysState, areq); + ObtainReadLock(&tdc->lock); do { - code = afs_dir_Lookup(&tdc->f.inode, sysState.name, &tfid.Fid); + code = afs_dir_Lookup(&tdc->f.inode, sysState.name, &tfid.Fid); } while (code == ENOENT && Next_AtSys(avc, areq, &sysState)); + ReleaseReadLock(&tdc->lock); + afs_PutDCache(tdc); /* we're done with the data */ bufp = sysState.name; if (code) { - afs_PutDCache(tdc); goto out; } tfid.Cell = avc->fid.Cell; tfid.Fid.Volume = avc->fid.Fid.Volume; - afs_PutDCache(tdc); /* we're done with the data */ if (!tfid.Fid.Unique && (avc->states & CForeign)) { - tvc = afs_LookupVCache(&tfid, areq, (afs_int32 *)0, WRITE_LOCK, avc, bufp); + tvc = afs_LookupVCache(&tfid, areq, NULL, avc, bufp); } else { - tvc = afs_GetVCache(&tfid, areq, (afs_int32 *)0, (struct vcache*)0, - WRITE_LOCK); + tvc = afs_GetVCache(&tfid, areq, NULL, NULL); } if (!tvc) { code = ENOENT; goto out; } if (tvc->mvstat != 1) { - afs_PutVCache(tvc, WRITE_LOCK); + afs_PutVCache(tvc); code = EINVAL; goto out; } #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */ #endif - ObtainWriteLock(&tvc->lock,645); - ObtainWriteLock(&afs_xcbhash, 646); + ObtainWriteLock(&tvc->lock, 649); + ObtainWriteLock(&afs_xcbhash, 650); afs_DequeueCallback(tvc); - tvc->states &= ~(CStatd | CDirty); /* next reference will re-stat cache entry */ + tvc->states &= ~(CStatd | CDirty); /* next reference will re-stat cache entry */ ReleaseWriteLock(&afs_xcbhash); /* now find the disk cache entries */ - afs_TryToSmush(tvc, acred, 1); + afs_TryToSmush(tvc, *acred, 1); osi_dnlc_purgedp(tvc); afs_symhint_inval(tvc); if (tvc->linkData && !(tvc->states & CCore)) { - afs_osi_Free(tvc->linkData, strlen(tvc->linkData)+1); - tvc->linkData = (char *) 0; + afs_osi_Free(tvc->linkData, strlen(tvc->linkData) + 1); + tvc->linkData = NULL; } ReleaseWriteLock(&tvc->lock); #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) afs_BozonUnlock(&tvc->pvnLock, tvc); #endif - afs_PutVCache(tvc, WRITE_LOCK); -out: - if (sysState.allocked) osi_FreeLargeSpace(bufp); + afs_PutVCache(tvc); + out: + if (sysState.allocked) + osi_FreeLargeSpace(bufp); return code; } -static PRxStatProc(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; - struct AFS_UCRED *acred; +DECL_PIOCTL(PRxStatProc) { int code = 0; afs_int32 flags; - if (!afs_osi_suser(acred)) { + if (!afs_osi_suser(*acred)) { code = EACCES; goto out; } @@ -3762,25 +3573,18 @@ static PRxStatProc(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) if (flags & AFSCALL_RXSTATS_CLEAR) { rx_clearProcessRPCStats(AFS_RX_STATS_CLEAR_ALL); } -out: + out: *aoutSize = 0; return code; } -static PRxStatPeer(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; - struct AFS_UCRED *acred; +DECL_PIOCTL(PRxStatPeer) { int code = 0; afs_int32 flags; - if (!afs_osi_suser(acred)) { + if (!afs_osi_suser(*acred)) { code = EACCES; goto out; } @@ -3802,18 +3606,12 @@ static PRxStatPeer(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) if (flags & AFSCALL_RXSTATS_CLEAR) { rx_clearPeerRPCStats(AFS_RX_STATS_CLEAR_ALL); } -out: + out: *aoutSize = 0; return code; } -static PPrefetchFromTape(avc, afun, areq, ain, aout, ainSize, aoutSize) - struct vcache *avc; - int afun; - struct vrequest *areq; - char *ain, *aout; - afs_int32 ainSize; - afs_int32 *aoutSize; /* set this */ +DECL_PIOCTL(PPrefetchFromTape) { register afs_int32 code, code1; afs_int32 bytes; @@ -3825,76 +3623,61 @@ static PPrefetchFromTape(avc, afun, areq, ain, aout, ainSize, aoutSize) struct VenusFid tfid; struct AFSFid *Fid; struct vcache *tvc; - XSTATS_DECLS; AFS_STATCNT(PSetAcl); if (!avc) - return EINVAL; + return EINVAL; if (ain && (ainSize == 3 * sizeof(afs_int32))) - Fid = (struct AFSFid *) ain; + Fid = (struct AFSFid *)ain; else - Fid = &avc->fid.Fid; + Fid = &avc->fid.Fid; tfid.Cell = avc->fid.Cell; tfid.Fid.Volume = Fid->Volume; tfid.Fid.Vnode = Fid->Vnode; tfid.Fid.Unique = Fid->Unique; - tvc = afs_GetVCache(&tfid, areq, (afs_int32 *)0, (struct vcache *)0, - WRITE_LOCK); + tvc = afs_GetVCache(&tfid, areq, NULL, NULL); if (!tvc) { - afs_Trace3(afs_iclSetp, CM_TRACE_PREFETCHCMD, - ICL_TYPE_POINTER, tvc, - ICL_TYPE_FID, &tfid, - ICL_TYPE_FID, &avc->fid); - return ENOENT; + afs_Trace3(afs_iclSetp, CM_TRACE_PREFETCHCMD, ICL_TYPE_POINTER, tvc, + ICL_TYPE_FID, &tfid, ICL_TYPE_FID, &avc->fid); + return ENOENT; } - afs_Trace3(afs_iclSetp, CM_TRACE_PREFETCHCMD, - ICL_TYPE_POINTER, tvc, - ICL_TYPE_FID, &tfid, - ICL_TYPE_FID, &tvc->fid); + afs_Trace3(afs_iclSetp, CM_TRACE_PREFETCHCMD, ICL_TYPE_POINTER, tvc, + ICL_TYPE_FID, &tfid, ICL_TYPE_FID, &tvc->fid); do { - tc = afs_Conn(&tvc->fid, areq, SHARED_LOCK); - if (tc) { - -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - tcall = rx_NewCall(tc->id); - code = StartRXAFS_FetchData(tcall, - (struct AFSFid *) &tvc->fid.Fid, 0, 0); - if (!code) { - bytes = rx_Read(tcall, (char *) aout, sizeof(afs_int32)); - code = EndRXAFS_FetchData(tcall, &OutStatus, &CallBack, &tsync); - } - code1 = rx_EndCall(tcall, code); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - } else - code = -1; - } while - (afs_Analyze(tc, code, &tvc->fid, areq, - AFS_STATS_FS_RPCIDX_RESIDENCYRPCS, SHARED_LOCK, - (struct cell *)0)); + tc = afs_Conn(&tvc->fid, areq, SHARED_LOCK); + if (tc) { + + RX_AFS_GUNLOCK(); + tcall = rx_NewCall(tc->id); + code = + StartRXAFS_FetchData(tcall, (struct AFSFid *)&tvc->fid.Fid, 0, + 0); + if (!code) { + bytes = rx_Read(tcall, (char *)aout, sizeof(afs_int32)); + code = + EndRXAFS_FetchData(tcall, &OutStatus, &CallBack, &tsync); + } + code1 = rx_EndCall(tcall, code); + RX_AFS_GLOCK(); + } else + code = -1; + } while (afs_Analyze + (tc, code, &tvc->fid, areq, AFS_STATS_FS_RPCIDX_RESIDENCYRPCS, + SHARED_LOCK, NULL)); /* This call is done only to have the callback things handled correctly */ afs_FetchStatus(tvc, &tfid, areq, &OutStatus); - afs_PutVCache(tvc, WRITE_LOCK); + afs_PutVCache(tvc); if (!code) { - *aoutSize = sizeof(afs_int32); + *aoutSize = sizeof(afs_int32); } return code; } -static PResidencyCmd(avc, afun, areq, ain, aout, ainSize, aoutSize) -struct vcache *avc; -int afun; -struct vrequest *areq; -char *ain, *aout; -afs_int32 ainSize; -afs_int32 *aoutSize; /* set this */ +DECL_PIOCTL(PResidencyCmd) { register afs_int32 code; struct conn *tc; @@ -3904,66 +3687,60 @@ afs_int32 *aoutSize; /* set this */ struct VenusFid tfid; struct AFSFid *Fid; - Inputs = (struct ResidencyCmdInputs *) ain; - Outputs = (struct ResidencyCmdOutputs *) aout; - if (!avc) return EINVAL; - if (!ain || ainSize != sizeof(struct ResidencyCmdInputs)) return EINVAL; + Inputs = (struct ResidencyCmdInputs *)ain; + Outputs = (struct ResidencyCmdOutputs *)aout; + if (!avc) + return EINVAL; + if (!ain || ainSize != sizeof(struct ResidencyCmdInputs)) + return EINVAL; Fid = &Inputs->fid; if (!Fid->Volume) - Fid = &avc->fid.Fid; + Fid = &avc->fid.Fid; tfid.Cell = avc->fid.Cell; tfid.Fid.Volume = Fid->Volume; tfid.Fid.Vnode = Fid->Vnode; tfid.Fid.Unique = Fid->Unique; - tvc = afs_GetVCache(&tfid, areq, (afs_int32 *)0, (struct vcache *)0, - WRITE_LOCK); - afs_Trace3(afs_iclSetp, CM_TRACE_RESIDCMD, - ICL_TYPE_POINTER, tvc, - ICL_TYPE_INT32, Inputs->command, - ICL_TYPE_FID, &tfid); + tvc = afs_GetVCache(&tfid, areq, NULL, NULL); + afs_Trace3(afs_iclSetp, CM_TRACE_RESIDCMD, ICL_TYPE_POINTER, tvc, + ICL_TYPE_INT32, Inputs->command, ICL_TYPE_FID, &tfid); if (!tvc) - return ENOENT; + return ENOENT; if (Inputs->command) { - do { - tc = afs_Conn(&tvc->fid, areq, SHARED_LOCK); - if (tc) { -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_ResidencyCmd(tc->id, Fid, - Inputs, - (struct ResidencyCmdOutputs *) aout); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - } else - code = -1; - } while - (afs_Analyze(tc, code, &tvc->fid, areq, - AFS_STATS_FS_RPCIDX_RESIDENCYRPCS, SHARED_LOCK, - (struct cell *)0)); - /* This call is done to have the callback things handled correctly */ - afs_FetchStatus(tvc, &tfid, areq, &Outputs->status); - } else { /* just a status request, return also link data */ - code = 0; - Outputs->code = afs_FetchStatus(tvc, &tfid, areq, &Outputs->status); - Outputs->chars[0] = 0; - if (vType(tvc) == VLNK) { - ObtainWriteLock(&tvc->lock,555); - if (afs_HandleLink(tvc, areq) == 0) - strncpy((char *) &Outputs->chars, tvc->linkData, MAXCMDCHARS); - ReleaseWriteLock(&tvc->lock); - } + do { + tc = afs_Conn(&tvc->fid, areq, SHARED_LOCK); + if (tc) { + RX_AFS_GUNLOCK(); + code = + RXAFS_ResidencyCmd(tc->id, Fid, Inputs, + (struct ResidencyCmdOutputs *)aout); + RX_AFS_GLOCK(); + } else + code = -1; + } while (afs_Analyze + (tc, code, &tvc->fid, areq, + AFS_STATS_FS_RPCIDX_RESIDENCYRPCS, SHARED_LOCK, NULL)); + /* This call is done to have the callback things handled correctly */ + afs_FetchStatus(tvc, &tfid, areq, &Outputs->status); + } else { /* just a status request, return also link data */ + code = 0; + Outputs->code = afs_FetchStatus(tvc, &tfid, areq, &Outputs->status); + Outputs->chars[0] = 0; + if (vType(tvc) == VLNK) { + ObtainWriteLock(&tvc->lock, 555); + if (afs_HandleLink(tvc, areq) == 0) + strncpy((char *)&Outputs->chars, tvc->linkData, MAXCMDCHARS); + ReleaseWriteLock(&tvc->lock); + } } - afs_PutVCache(tvc, WRITE_LOCK); + afs_PutVCache(tvc); if (!code) { - *aoutSize = sizeof(struct ResidencyCmdOutputs); + *aoutSize = sizeof(struct ResidencyCmdOutputs); } return code; -} +} diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index a10062325..43aa28236 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -11,20 +11,197 @@ #define _AFS_PROTOTYPES_H_ /* afs_analyze.c */ +extern void init_et_to_sys_error(void); extern void afs_FinalizeReq(struct vrequest *areq); +extern int afs_Analyze(register struct conn *aconn, afs_int32 acode, + struct VenusFid *afid, register struct vrequest *areq, + int op, afs_int32 locktype, struct cell *cellp); +extern int afs_CheckCode(afs_int32 acode, struct vrequest *areq, int where); +extern void afs_CopyError(register struct vrequest *afrom, + register struct vrequest *ato); +extern void init_sys_error_to_et(void); -extern int afs_Analyze(struct conn *aconn, afs_int32 acode, struct VenusFid *afid, - register struct vrequest *areq, int op, afs_int32 locktype, - struct cell *cellp); +/* afs_axscache.c */ +extern afs_rwlock_t afs_xaxs; +extern struct axscache *afs_SlowFindAxs(struct axscache **cachep, + afs_int32 id); +extern struct axscache *axs_Alloc(void); +extern void afs_RemoveAxs(struct axscache **headp, struct axscache *axsp); +extern void afs_FreeAllAxs(struct axscache **headp); + +/* afs_buffer.c */ +extern void DInit(int abuffers); +extern void *DRead(register afs_inode_t * fid, register int page); +extern void DRelease(register struct buffer *bp, int flag); +extern int DVOffset(register void *ap); +extern void DZap(afs_inode_t * fid); +extern void DFlush(void); +extern void *DNew(register afs_inode_t * fid, register int page); +extern void shutdown_bufferpackage(void); + +/* afs_call.c */ +extern int afs_cold_shutdown; +extern afs_int32 afs_setTime; +extern char afs_rootVolumeName[64]; +extern void afs_shutdown(void); +extern void afs_FlushCBs(void); +extern struct afs_icl_set *afs_icl_allSets; +extern int afs_icl_CreateLog(char *name, afs_int32 logSize, + struct afs_icl_log **outLogpp); +extern int afs_icl_CreateLogWithFlags(char *name, afs_int32 logSize, + afs_uint32 flags, + struct afs_icl_log **outLogpp); +extern int afs_icl_CopyOut(register struct afs_icl_log *logp, + afs_int32 * bufferp, afs_int32 * bufSizep, + afs_uint32 * cookiep, afs_int32 * flagsp); +extern int afs_icl_GetLogParms(struct afs_icl_log *logp, afs_int32 * maxSizep, + afs_int32 * curSizep); +extern int afs_icl_LogHold(register struct afs_icl_log *logp); +extern int afs_icl_LogHoldNL(register struct afs_icl_log *logp); +extern int afs_icl_LogUse(register struct afs_icl_log *logp); +extern int afs_icl_LogFreeUse(register struct afs_icl_log *logp); +extern int afs_icl_LogSetSize(register struct afs_icl_log *logp, + afs_int32 logSize); +extern int afs_icl_ZapLog(register struct afs_icl_log *logp); +extern int afs_icl_LogRele(register struct afs_icl_log *logp); +extern int afs_icl_LogReleNL(register struct afs_icl_log *logp); +extern int afs_icl_ZeroLog(register struct afs_icl_log *logp); +extern int afs_icl_LogFree(register struct afs_icl_log *logp); +extern struct afs_icl_log *afs_icl_FindLog(char *name); +extern int + afs_icl_EnumerateLogs(int (*aproc) + + (char *name, char *arock, struct afs_icl_log * tp), + char *arock); +extern int afs_icl_CreateSet(char *name, struct afs_icl_log *baseLogp, + struct afs_icl_log *fatalLogp, + struct afs_icl_set **outSetpp); +extern int afs_icl_CreateSetWithFlags(char *name, + struct afs_icl_log *baseLogp, + struct afs_icl_log *fatalLogp, + afs_uint32 flags, + struct afs_icl_set **outSetpp); +extern int afs_icl_SetEnable(struct afs_icl_set *setp, afs_int32 eventID, + int setValue); +extern int afs_icl_GetEnable(struct afs_icl_set *setp, afs_int32 eventID, + int *getValuep); +extern int afs_icl_ZeroSet(struct afs_icl_set *setp); +extern int + afs_icl_EnumerateSets(int (*aproc) + + (char *name, char *arock, struct afs_icl_log * tp), + char *arock); +extern int afs_icl_AddLogToSet(struct afs_icl_set *setp, + struct afs_icl_log *newlogp); +extern int afs_icl_SetSetStat(struct afs_icl_set *setp, int op); +extern int afs_icl_SetHold(register struct afs_icl_set *setp); +extern int afs_icl_ZapSet(register struct afs_icl_set *setp); +extern int afs_icl_SetRele(register struct afs_icl_set *setp); +extern int afs_icl_SetFree(register struct afs_icl_set *setp); +extern struct afs_icl_set *afs_icl_FindSet(char *name); + +extern int afs_icl_Event4(register struct afs_icl_set *setp, + afs_int32 eventID, afs_int32 lAndT, long p1, + long p2, long p3, long p4); +extern int afs_icl_Event3(register struct afs_icl_set *setp, + afs_int32 eventID, afs_int32 lAndT, long p1, + long p2, long p3); +extern int afs_icl_Event2(register struct afs_icl_set *setp, + afs_int32 eventID, afs_int32 lAndT, long p1, + long p2); +extern int afs_icl_Event1(register struct afs_icl_set *setp, + afs_int32 eventID, afs_int32 lAndT, long p1); +extern int afs_icl_Event0(register struct afs_icl_set *setp, + afs_int32 eventID, afs_int32 lAndT); +extern void afs_icl_AppendRecord(register struct afs_icl_log *logp, + afs_int32 op, afs_int32 types, long p1, + long p2, long p3, long p4); + +extern int afs_CheckInit(void); +extern void afs_shutdown(void); +extern void shutdown_afstest(void); +extern void afs_shutdown_BKG(void); + + +/* afs_callback.c */ +extern afs_int32 afs_allCBs; +extern afs_int32 afs_oddCBs; +extern afs_int32 afs_evenCBs; +extern afs_int32 afs_allZaps; +extern afs_int32 afs_oddZaps; +extern afs_int32 afs_evenZaps; +extern afs_int32 afs_connectBacks; +extern unsigned long lastCallBack_vnode; +extern unsigned int lastCallBack_dv; +extern osi_timeval_t lastCallBack_time; +extern struct interfaceAddr afs_cb_interface; + +extern int afs_RXCallBackServer(void); +extern int SRXAFSCB_GetCE(struct rx_call *a_call, afs_int32 a_index, + struct AFSDBCacheEntry *a_result); +extern int SRXAFSCB_GetCE64(struct rx_call *a_call, afs_int32 a_index, + struct AFSDBCacheEntry64 *a_result); +extern int SRXAFSCB_GetLock(struct rx_call *a_call, afs_int32 a_index, + struct AFSDBLock *a_result); +extern int SRXAFSCB_CallBack(struct rx_call *a_call, + register struct AFSCBFids *a_fids, + struct AFSCBs *a_callbacks); +extern int SRXAFSCB_Probe(struct rx_call *a_call); +extern int SRXAFSCB_InitCallBackState(struct rx_call *a_call); +extern int SRXAFSCB_XStatsVersion(struct rx_call *a_call, + afs_int32 * a_versionP); +extern int SRXAFSCB_GetXStats(struct rx_call *a_call, + afs_int32 a_clientVersionNum, + afs_int32 a_collectionNumber, + afs_int32 * a_srvVersionNumP, + afs_int32 * a_timeP, AFSCB_CollData * a_dataP); +extern int afs_RXCallBackServer(void); +extern int shutdown_CB(void); +extern int SRXAFSCB_InitCallBackState2(struct rx_call *a_call, + struct interfaceAddr *addr); +extern int SRXAFSCB_WhoAreYou(struct rx_call *a_call, + struct interfaceAddr *addr); +extern int SRXAFSCB_InitCallBackState3(struct rx_call *a_call, + afsUUID * a_uuid); +extern int SRXAFSCB_ProbeUuid(struct rx_call *a_call, afsUUID * a_uuid); +extern int SRXAFSCB_GetServerPrefs(struct rx_call *a_call, afs_int32 a_index, + afs_int32 * a_srvr_addr, + afs_int32 * a_srvr_rank); +extern int SRXAFSCB_GetCellServDB(struct rx_call *a_call, afs_int32 a_index, + char **a_name, serverList * a_hosts); +extern int SRXAFSCB_GetLocalCell(struct rx_call *a_call, char **a_name); +extern int SRXAFSCB_GetCacheConfig(struct rx_call *a_call, + afs_uint32 callerVersion, + afs_uint32 * serverVersion, + afs_uint32 * configCount, + cacheConfig * config); +extern int SRXAFSCB_FetchData(struct rx_call *rxcall, struct AFSFid *Fid, + afs_int32 Fd, afs_int64 Position, + afs_int64 Length, afs_int64 * TotalLength); +extern int SRXAFSCB_StoreData(struct rx_call *rxcall, struct AFSFid *Fid, + afs_int32 Fd, afs_int64 Position, + afs_int64 Length, afs_int64 * TotalLength); + + +/* afs_cbqueue.c */ +extern afs_rwlock_t afs_xcbhash; +extern void afs_QueueCallback(struct vcache *avc, unsigned int atime, + struct volume *avp); +extern void afs_CheckCallbacks(unsigned int secs); +extern void afs_FlushCBs(void); +extern void afs_FlushServerCBs(struct server *srvp); +extern int afs_BumpBase(void); +extern void afs_InitCBQueue(int doLockInit); +extern void afs_DequeueCallback(struct vcache *avc); /* afs_cell.c */ extern afs_rwlock_t afs_xcell; extern void afs_CellInit(void); extern void shutdown_cell(void); extern int afs_cellname_init(ino_t inode, int lookupcode); -extern int afs_cellname_write(); -extern afs_int32 afs_NewCell(char *acellName, afs_int32 *acellHosts, - int aflags, char *linkedcname, u_short fsport, +extern int afs_cellname_write(void); +extern afs_int32 afs_NewCell(char *acellName, afs_int32 * acellHosts, + int aflags, char *linkedcname, u_short fsport, u_short vlport, int timeout); extern afs_int32 afs_SetPrimaryCell(char *acellName); extern struct cell *afs_GetCell(afs_int32 acell, afs_int32 locktype); @@ -34,127 +211,880 @@ extern struct cell *afs_GetCellByName(char *acellName, afs_int32 locktype); extern struct cell *afs_GetPrimaryCell(afs_int32 locktype); extern int afs_IsPrimaryCellNum(afs_int32 cellnum); extern int afs_IsPrimaryCell(struct cell *cell); -extern void *afs_TraverseCells(void *(*cb)(struct cell *, void *), void *arg); +extern void *afs_TraverseCells(void *(*cb) (struct cell *, void *), + void *arg); extern int afs_CellOrAliasExists(char *aname); extern int afs_CellNumValid(afs_int32 cellnum); extern afs_int32 afs_NewCellAlias(char *alias, char *cell); extern struct cell_alias *afs_GetCellAlias(int index); +extern void afs_PutCellAlias(struct cell_alias *a); extern int afs_AFSDBHandler(char *acellName, int acellNameLen, - afs_int32 *kernelMsg); + afs_int32 * kernelMsg); extern void afs_LookupAFSDB(char *acellName); extern void afs_StopAFSDB(void); extern void afs_RemoveCellEntry(struct server *srvp); +/* afs_chunk.c */ +extern afs_int32 afs_FirstCSize; +extern afs_int32 afs_OtherCSize; +extern afs_int32 afs_LogChunk; + +/* afs_cell.c */ +extern struct cell *afs_GetRealCellByIndex(register afs_int32 cellindex, + afs_int32 locktype, + afs_int32 refresh); + /* afs_conn.c */ +extern afs_int32 cryptall; +extern afs_rwlock_t afs_xinterface; +extern afs_rwlock_t afs_xconn; +extern struct conn *afs_Conn(register struct VenusFid *afid, + register struct vrequest *areq, + afs_int32 locktype); extern struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport, - afs_int32 acell, struct unixuser *tu, - int force_if_down, afs_int32 create, afs_int32 locktype); + afs_int32 acell, struct unixuser *tu, + int force_if_down, afs_int32 create, + afs_int32 locktype); +extern struct conn *afs_ConnByMHosts(struct server *ahosts[], + unsigned short aport, afs_int32 acell, + register struct vrequest *areq, + afs_int32 locktype); +extern struct conn *afs_ConnByHost(struct server *aserver, + unsigned short aport, afs_int32 acell, + struct vrequest *areq, int aforce, + afs_int32 locktype); +extern void afs_PutConn(register struct conn *ac, afs_int32 locktype); +extern void ForceNewConnections(struct srvAddr *sap); + + +/* afs_daemons.c */ +extern afs_lock_t afs_xbrs; +extern short afs_brsWaiters; +extern short afs_brsDaemons; +extern struct brequest afs_brs[NBRS]; +extern struct afs_osi_WaitHandle AFS_WaitHandler, AFS_CSWaitHandler; +extern afs_int32 afs_gcpags; +extern afs_int32 afs_gcpags_procsize; +extern afs_int32 afs_CheckServerDaemonStarted; +extern afs_int32 PROBE_INTERVAL; + +extern void afs_Daemon(void); +extern struct brequest *afs_BQueue(register short aopcode, + register struct vcache *avc, + afs_int32 dontwait, afs_int32 ause, + struct AFS_UCRED *acred, + afs_size_t asparm0, afs_size_t asparm1, + void *apparm0); +extern void afs_CheckServerDaemon(void); +extern int afs_CheckRootVolume(void); +extern void afs_BRelease(register struct brequest *ab); +extern int afs_BBusy(void); +extern int afs_BioDaemon(afs_int32 nbiods); +extern void afs_BackgroundDaemon(void); +extern void shutdown_daemons(void); +extern int afs_sgidaemon(void); + /* afs_dcache.c */ +extern u_int afs_min_cache; +extern afs_int32 *afs_dvhashTbl; +extern afs_int32 afs_dhashsize; +extern afs_rwlock_t afs_xdcache; +extern afs_size_t afs_vmMappingEnd; +extern afs_int32 afs_blocksUsed; +extern afs_int32 afs_blocksDiscarded; +extern int afs_WaitForCacheDrain; extern int cacheDiskType; +extern unsigned char *afs_indexFlags; +extern struct afs_cacheOps *afs_cacheType; +extern ino_t cacheInode; +extern struct osi_file *afs_cacheInodep; extern void afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk, int aflags); +extern int afs_PutDCache(register struct dcache *adc); +extern void afs_FlushDCache(register struct dcache *adc); +extern void shutdown_dcache(void); +extern void afs_CacheTruncateDaemon(void); +extern afs_int32 afs_fsfragsize; +extern struct dcache *afs_MemGetDSlot(register afs_int32 aslot, + register struct dcache *tmpdc); +extern struct dcache *afs_GetDCache(register struct vcache *avc, + afs_size_t abyte, + register struct vrequest *areq, + afs_size_t * aoffset, afs_size_t * alen, + int aflags); +extern struct dcache *afs_FindDCache(register struct vcache *avc, + afs_size_t abyte); +extern void afs_StoreWarn(register afs_int32 acode, afs_int32 avolume, + register afs_int32 aflags); +extern void afs_MaybeWakeupTruncateDaemon(void); +extern void afs_CacheTruncateDaemon(void); +extern void afs_AdjustSize(register struct dcache *adc, + register afs_int32 newSize); +extern int afs_HashOutDCache(struct dcache *adc); +extern int afs_MaybeFreeDiscardedDCache(void); +extern int afs_RefDCache(struct dcache *adc); +extern void afs_TryToSmush(register struct vcache *avc, + struct AFS_UCRED *acred, int sync); +extern void updateV2DC(int lockVc, struct vcache *v, struct dcache *d, + int src); +extern void afs_WriteThroughDSlots(void); +extern struct dcache *afs_UFSGetDSlot(register afs_int32 aslot, + register struct dcache *tmpdc); +extern int afs_WriteDCache(register struct dcache *adc, int atime); +extern int afs_wakeup(register struct vcache *avc); +extern int afs_InitCacheFile(char *afile, ino_t ainode); + + +/* afs_dynroot.c */ +extern int afs_IsDynrootFid(struct VenusFid *fid); +extern void afs_GetDynrootFid(struct VenusFid *fid); +extern int afs_IsDynroot(struct vcache *avc); +extern void afs_DynrootInvalidate(void); +extern void afs_GetDynroot(char **dynrootDir, int *dynrootLen, + struct AFSFetchStatus *status); +extern void afs_PutDynroot(void); +extern int afs_DynrootNewVnode(struct vcache *avc, + struct AFSFetchStatus *status); +extern int afs_SetDynrootEnable(int enable); +extern int afs_GetDynrootEnable(void); +extern int afs_DynrootVOPRemove(struct vcache *avc, struct AFS_UCRED *acred, + char *aname); +extern int afs_DynrootVOPSymlink(struct vcache *avc, struct AFS_UCRED *acred, + char *aname, char *atargetName); + +/* afs_exporter.c */ +extern struct afs_exporter *root_exported; +extern struct afs_exporter *exporter_find(int type); + +/* afs_init.c */ +extern struct cm_initparams cm_initParams; +extern int afs_resourceinit_flag; +extern afs_rwlock_t afs_puttofileLock; +extern char *afs_sysname; +extern char *afs_sysnamelist[MAXNUMSYSNAMES]; +extern int afs_sysnamecount; +extern afs_int32 cacheInfoModTime; +extern int afs_CacheInit(afs_int32 astatSize, afs_int32 afiles, + afs_int32 ablocks, afs_int32 aDentries, + afs_int32 aVolumes, afs_int32 achunk, + afs_int32 aflags, afs_int32 ninodes, + afs_int32 nusers); +extern void afs_ComputeCacheParms(void); +extern int afs_InitCacheInfo(register char *afile); +extern int afs_InitVolumeInfo(char *afile); +extern int afs_InitCellInfo(char *afile); +extern int afs_ResourceInit(int preallocs); +extern void shutdown_cache(void); +extern void shutdown_vnodeops(void); +extern void shutdown_AFS(void); + +/* afs_lock.c */ +extern void Lock_Init(register struct afs_lock *lock); +extern void ObtainLock(register struct afs_lock *lock, int how, + unsigned int src_indicator); +extern void ReleaseLock(register struct afs_lock *lock, int how); +extern int Afs_Lock_Trace(int op, struct afs_lock *alock, int type, + char *file, int line); +extern void Afs_Lock_Obtain(register struct afs_lock *lock, int how); +extern void Afs_Lock_ReleaseR(register struct afs_lock *lock); +extern void Afs_Lock_ReleaseW(register struct afs_lock *lock); +extern void afs_osi_SleepR(register char *addr, + register struct afs_lock *alock); +extern void afs_osi_SleepW(register char *addr, + register struct afs_lock *alock); +extern void afs_osi_SleepS(register char *addr, + register struct afs_lock *alock); +#ifndef AFS_NOBOZO_LOCK +extern void afs_BozonLock(struct afs_bozoLock *alock, struct vcache *avc); +extern void afs_BozonUnlock(struct afs_bozoLock *alock, struct vcache *avc); +extern void afs_BozonInit(struct afs_bozoLock *alock, struct vcache *avc); +extern int afs_CheckBozonLock(struct afs_bozoLock *alock); +extern int afs_CheckBozonLockBlocking(struct afs_bozoLock *alock); +#endif + + + + +/* afs_mariner.c */ +extern afs_int32 afs_mariner; +extern afs_int32 afs_marinerHost; +extern struct rx_service *afs_server; +extern int afs_AddMarinerName(register char *aname, + register struct vcache *avc); +extern char *afs_GetMariner(register struct vcache *avc); +extern void afs_MarinerLogFetch(register struct vcache *avc, + register afs_int32 off, + register afs_int32 bytes, + register afs_int32 idx); +extern void afs_MarinerLog(register char *astring, + register struct vcache *avc); +extern void shutdown_mariner(void); + /* afs_memcache.c */ +extern int afs_InitMemCache(int blkCount, int blkSize, int flags); +extern int afs_MemCacheClose(char *file); extern void *afs_MemCacheOpen(ino_t blkno); +extern int afs_MemReadBlk(register struct memCacheEntry *mceP, int offset, + char *dest, int size); +extern int afs_MemReadvBlk(register struct memCacheEntry *mceP, int offset, + struct iovec *iov, int nio, int size); +extern int afs_MemReadUIO(ino_t blkno, struct uio *uioP); +extern int afs_MemWriteBlk(register struct memCacheEntry *mceP, int offset, + char *src, int size); +extern int afs_MemWritevBlk(register struct memCacheEntry *mceP, int offset, + struct iovec *iov, int nio, int size); +extern int afs_MemWriteUIO(ino_t blkno, struct uio *uioP); +extern int afs_MemCacheTruncate(register struct memCacheEntry *mceP, + int size); +extern int afs_MemCacheStoreProc(register struct rx_call *acall, + register struct memCacheEntry *mceP, + register afs_int32 alen, struct vcache *avc, + int *shouldWake, afs_size_t * abytesToXferP, + afs_size_t * abytesXferredP, + afs_int32 length); +extern int afs_MemCacheFetchProc(register struct rx_call *acall, + register struct memCacheEntry *mceP, + afs_size_t abase, struct dcache *adc, + struct vcache *avc, + afs_size_t * abytesToXferP, + afs_size_t * abytesXferredP, + afs_int32 lengthFound); +extern void shutdown_memcache(void); + + +/* afs_nfsclnt.c */ +extern struct afs_exporter *afs_nfsexported; +extern struct afs_exporter *afs_nfsexporter; /* afs_osi.c */ -#if AFS_GCPAGS -extern const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr); +extern afs_lock_t afs_ftf; +extern void afs_osi_Invisible(void); +extern void afs_osi_RxkRegister(void); +extern void afs_osi_MaskSignals(void); +extern void afs_osi_UnmaskRxkSignals(void); +extern void *afs_osi_Alloc_debug(size_t x, char *func, int line); +#ifndef afs_osi_Alloc_NoSleep +extern void *afs_osi_Alloc_NoSleep(size_t x); +#endif +#ifndef afs_osi_Free +extern void afs_osi_Free(void *x, size_t asize); +#endif +extern void afs_osi_FreeStr(char *x); +extern void osi_Init(void); +extern int osi_Active(register struct vcache *avc); +extern void osi_FlushPages(register struct vcache *avc, + struct AFS_UCRED *credp); +extern void osi_FlushText_really(register struct vcache *vp); +extern void afs_osi_MaskSignals(void); +extern void afs_osi_UnmaskRxkSignals(void); +extern void afs_osi_RxkRegister(void); +extern void afs_osi_Invisible(void); +extern int osi_VMDirty_p(struct vcache *avc); +#ifndef UKERNEL +extern void osi_ReleaseVM(struct vcache *avc, struct AFS_UCRED *acred); +#endif +extern void shutdown_osi(void); +extern int afs_osi_suser(void *credp); extern void afs_osi_TraverseProcTable(void); -#endif /* AFS_GCPAGS */ +#if defined(KERNEL) && !defined(UKERNEL) && defined(AFS_PROC) +extern const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC * pr); +#endif /* afs_osi_pag.c */ +extern int afs_setpag(); extern afs_uint32 genpag(void); extern afs_uint32 getpag(void); -#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) extern int AddPag(struct proc *p, afs_int32 aval, struct AFS_UCRED **credpp); -#else /* AFS_OSF_ENV || AFS_FBSD_ENV */ +#else extern int AddPag(afs_int32 aval, struct AFS_UCRED **credpp); #endif -extern afs_uint32 afs_get_pag_from_groups(gid_t g0, gid_t g1); -extern void afs_get_groups_from_pag(afs_uint32 pag, gid_t *g0p, gid_t *g1p); +extern int afs_InitReq(register struct vrequest *av, struct AFS_UCRED *acred); +extern afs_uint32 afs_get_pag_from_groups(gid_t g0a, gid_t g1a); +extern void afs_get_groups_from_pag(afs_uint32 pag, gid_t * g0p, gid_t * g1p); extern afs_int32 PagInCred(const struct AFS_UCRED *cred); -/* OS/osi_sleep.c */ +/* afs_osi_alloc.c */ +#ifndef AFS_FBSD_ENV +extern afs_int32 afs_preallocs; +extern afs_lock_t osi_fsplock; +extern afs_lock_t osi_flplock; +#endif +extern void osi_FreeLargeSpace(void *adata); +extern void osi_FreeMediumSpace(void *adata); +extern void osi_FreeSmallSpace(void *adata); +extern void *osi_AllocLargeSpace(size_t size); +extern void *osi_AllocMediumSpace(size_t size); +extern void *osi_AllocSmallSpace(size_t size); +#ifndef osi_AllocSmall +extern char *osi_AllocSmall(register afs_int32 size, + register afs_int32 morespace); +#endif + +/* afs_osi_uio.c */ +extern int afsio_copy(struct uio *ainuio, struct uio *aoutuio, + struct iovec *aoutvec); +extern int afsio_trim(struct uio *auio, afs_int32 asize); +extern int afsio_skip(struct uio *auio, afs_int32 asize); + + + +/* ARCH/osi_misc.c */ +extern void osi_iput(struct inode *ip); +extern void afs_osi_SetTime(osi_timeval_t * atv); + +/* LINUX/osi_misc.c */ +#ifdef AFS_LINUX20_ENV +#ifdef AFS_LINUX24_ENV +extern int osi_lookupname(char *aname, uio_seg_t seg, int followlink, + vnode_t ** dirvpp, struct dentry **dpp); +extern int osi_InitCacheInfo(char *aname); +extern int osi_rdwr(int rw, struct osi_file *file, caddr_t addrp, + size_t asize, size_t * resid); +extern int osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw); +extern void setup_uio(uio_t * uiop, struct iovec *iovecp, char *buf, + afs_offs_t pos, int count, uio_flag_t flag, + uio_seg_t seg); +extern int uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop); +extern void osi_linux_free_inode_pages(void); +extern void osi_clear_inode(struct inode *ip); +extern void check_bad_parent(struct dentry *dp); +#endif +extern void osi_linux_mask(void); +extern void osi_linux_unmask(void); +extern void osi_linux_rxkreg(void); +extern int setpag(cred_t ** cr, afs_uint32 pagvalue, afs_uint32 * newpag, + int change_parent); +#endif + + +/* ARCH/osi_sleep.c */ extern void afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle); extern void afs_osi_CancelWait(struct afs_osi_WaitHandle *achandle); -extern int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok); +extern int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, + int aintok); +#ifndef afs_osi_Wakeup +extern int afs_osi_Wakeup(void *event); +#endif +#ifndef afs_osi_Sleep +extern void afs_osi_Sleep(void *event); +#endif +#ifndef afs_osi_SleepSig +extern int afs_osi_SleepSig(void *event); +#endif + + +/* ARCH/osi_inode.c */ +extern int afs_syscall_icreate(); +extern int afs_syscall_iopen(); +extern int afs_syscall_iincdec(); + + +/* ARCH/osi_file.c */ +extern int afs_osicred_initialized; +#if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_SGI62_ENV) +extern void *osi_UFSOpen(ino_t ainode); +#else +extern void *osi_UFSOpen(afs_int32 ainode); +#endif +extern int afs_osi_Stat(register struct osi_file *afile, + register struct osi_stat *astat); +extern int osi_UFSClose(register struct osi_file *afile); +extern int osi_UFSTruncate(register struct osi_file *afile, afs_int32 asize); +extern void osi_DisableAtimes(struct vnode *avp); +extern int afs_osi_Read(register struct osi_file *afile, int offset, + void *aptr, afs_int32 asize); +extern int afs_osi_Write(register struct osi_file *afile, afs_int32 offset, + void *aptr, afs_int32 asize); +extern int afs_osi_MapStrategy(int (*aproc) (struct buf * bp), + register struct buf *bp); +extern void shutdown_osifile(void); + + +/* ARCH/osi_groups.c */ +#ifdef AFS_XBSD_ENV +extern int setpag(struct proc *proc, struct ucred **cred, afs_uint32 pagvalue, + afs_uint32 * newpag, int change_parent); +#endif + + +/* ARCH/osi_vm.c */ +extern int osi_VM_FlushVCache(struct vcache *avc, int *slept); +extern void osi_VM_StoreAllSegments(struct vcache *avc); +extern void osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, + int sync); +extern void osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp); +extern void osi_VM_Truncate(struct vcache *avc, int alen, + struct AFS_UCRED *acred); +extern void osi_VM_TryReclaim(struct vcache *avc, int *slept); +extern void osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size); +extern int osi_VM_Setup(struct vcache *avc, int force); + +#ifdef AFS_SUN5_ENV +extern int osi_VM_GetDownD(struct vcache *avc, struct dcache *adc); +extern void osi_VM_PreTruncate(struct vcache *avc, int alen, + struct AFS_UCRED *acred); +#endif + + +/* ARCH/osi_vnodeops.c */ +extern struct vnodeops Afs_vnodeops; +#if defined(AFS_OSF_ENV) +#if defined(AFS_OSF30_ENV) +extern int max_vnodes; /* number of total system vnodes */ +#else +extern int nvnode; /* number of total system vnodes */ +extern int numvnodes; /* number vnodes in use now */ +#endif +#ifdef AFS_DUX40_ENV +extern struct vfs_ubcops afs_ubcops; +#endif +#endif /* afs_osifile.c */ -#ifdef AFS_SGI62_ENV -extern void *osi_UFSOpen(ino_t); + +/* afs_osi_pag.c */ +extern afs_uint32 pag_epoch; +extern afs_uint32 pagCounter; + +/* OS/osi_vfsops.c */ +#if defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV) +extern struct mount *afs_globalVFS; #else -extern void *osi_UFSOpen(); +extern struct vfs *afs_globalVFS; +#endif +extern struct vcache *afs_globalVp; +#ifdef AFS_LINUX20_ENV +extern void vcache2inode(struct vcache *avc); #endif +/* afs_pioctl.c */ +extern struct VenusFid afs_rootFid; +extern afs_int32 afs_waitForever; +extern short afs_waitForeverCount; +extern afs_int32 afs_showflags; +extern int afs_defaultAsynchrony; +extern int afs_syscall_pioctl(); + +/* afs_segments.c */ +extern int afs_StoreMini(register struct vcache *avc, struct vrequest *areq); +extern int afs_StoreAllSegments(register struct vcache *avc, + struct vrequest *areq, int sync); +extern int afs_InvalidateAllSegments(struct vcache *avc); +extern int afs_TruncateAllSegments(register struct vcache *avc, + afs_size_t alen, struct vrequest *areq, + struct AFS_UCRED *acred); + /* afs_server.c */ -extern struct server *afs_FindServer (afs_int32 aserver, ushort aport, - afsUUID *uuidp, afs_int32 locktype); -extern struct server *afs_GetServer(afs_uint32 *aserver, afs_int32 nservers, +extern afs_rwlock_t afs_xsrvAddr; +extern afs_rwlock_t afs_xserver; +extern afs_rwlock_t afs_icl_lock; +extern struct srvAddr *afs_srvAddrs[NSERVERS]; +extern struct server *afs_servers[NSERVERS]; +extern int afs_totalServers; +extern struct server *afs_setTimeHost; +extern struct server *afs_FindServer(afs_int32 aserver, ushort aport, + afsUUID * uuidp, afs_int32 locktype); +extern struct server *afs_GetServer(afs_uint32 * aserver, afs_int32 nservers, afs_int32 acell, u_short aport, - afs_int32 locktype, afsUUID *uuidp, + afs_int32 locktype, afsUUID * uuidp, afs_int32 addr_uniquifier); extern void afs_MarkServerUpOrDown(struct srvAddr *sa, int a_isDown); extern void afs_ServerDown(struct srvAddr *sa); +extern void afs_CountServers(void); +extern void afs_CheckServers(int adown, struct cell *acellp); +extern unsigned int afs_random(void); +extern int afs_randomMod15(void); +extern int afs_randomMod127(void); +extern void afs_SortOneServer(struct server *asp); +extern void afs_SortServers(struct server *aservers[], int count); +extern void afs_FlushServer(struct server *srvp); +extern void afs_RemoveSrvAddr(struct srvAddr *sap); +extern void afs_ActivateServer(struct srvAddr *sap); +#ifdef AFS_USERSPACE_IP_ADDR +extern int afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr, + afs_uint32 subnetmask); +#else +#if (!defined(AFS_SUN5_ENV)) && defined(USEIFADDR) +void afsi_SetServerIPRank(struct srvAddr *sa, struct in_ifaddr *ifa); +#endif +#endif + + + +/* afs_osidnlc.c */ +extern int osi_dnlc_enter(struct vcache *adp, char *aname, struct vcache *avc, + afs_hyper_t * avno); +extern struct vcache *osi_dnlc_lookup(struct vcache *adp, char *aname, + int locktype); +extern int osi_dnlc_remove(struct vcache *adp, char *aname, + struct vcache *avc); +extern int osi_dnlc_purgedp(struct vcache *adp); +extern int osi_dnlc_purgevp(struct vcache *avc); +extern int osi_dnlc_purge(void); +extern int osi_dnlc_purgevol(struct VenusFid *fidp); +extern int osi_dnlc_init(void); +extern int osi_dnlc_shutdown(void); + + +/* afs_stat.c */ +extern struct afs_CMStats afs_cmstats; +extern struct afs_stats_CMPerf afs_stats_cmperf; +extern struct afs_stats_CMFullPerf afs_stats_cmfullperf; +extern afs_int32 afs_stats_XferSumBytes[AFS_STATS_NUM_FS_XFER_OPS]; +extern void afs_InitStats(void); +extern void afs_GetCMStat(char **ptr, unsigned *size); +#ifndef AFS_NOSTATS +extern void afs_AddToMean(struct afs_MeanStats *oldMean, afs_int32 newValue); +#endif + + +/* UKERNEL/afs_usrops.c */ +#ifdef UKERNEL +extern void uafs_Shutdown(void); +extern void osi_ReleaseVM(struct vcache *avc, int len, + struct usr_ucred *credp); +extern int osi_GetTime(struct timeval *tv); +#endif + + /* afs_user.c */ -extern struct unixuser *afs_FindUser(afs_int32 auid, afs_int32 acell, afs_int32 locktype); +extern afs_rwlock_t afs_xuser; +extern struct unixuser *afs_users[NUSERS]; +extern struct unixuser *afs_FindUser(afs_int32 auid, afs_int32 acell, + afs_int32 locktype); +extern struct unixuser *afs_GetUser(register afs_int32 auid, afs_int32 acell, + afs_int32 locktype); #if AFS_GCPAGS -extern afs_int32 afs_GCPAGs(afs_int32 *ReleasedCount); -extern void afs_GCPAGs_perproc_func(AFS_PROC *pproc); +extern afs_int32 afs_GCPAGs(afs_int32 * ReleasedCount); +extern void afs_GCPAGs_perproc_func(AFS_PROC * pproc); #endif /* AFS_GCPAGS */ +extern void afs_ComputePAGStats(void); +extern void afs_PutUser(register struct unixuser *au, afs_int32 locktype); +extern void afs_GCUserData(int aforce); +extern void afs_CheckTokenCache(void); +extern void afs_ResetAccessCache(afs_int32 uid, int alock); +extern void afs_ResetUserConns(register struct unixuser *auser); +extern void afs_SetPrimary(register struct unixuser *au, register int aflag); + /* afs_util.c */ +#ifndef afs_cv2string extern char *afs_cv2string(char *ttp, afs_uint32 aval); +#endif +#ifndef afs_strcasecmp extern int afs_strcasecmp(char *s1, char *s2); +#endif +#ifndef afs_strcat +extern char *afs_strcat(char *s1, char *s2); +#endif +#ifdef AFS_OBSD34_ENV +extern char *afs_strcpy(char *s1, char *s2); +#endif +#ifndef afs_strchr extern char *afs_strchr(char *s, int c); +#endif extern char *afs_strdup(char *s); extern void print_internet_address(char *preamble, struct srvAddr *sa, - char *postamble, int flag); + char *postamble, int flag); +extern afs_int32 afs_data_pointer_to_int32(const void *p); + +#if 0 /* problems - need to change to varargs, right now is incorrect usage + * throughout code */ +extern void afs_warn(char *a, long b, long c, long d, long e, long f, long g, + long h, long i, long j); +extern void afs_warnuser(char *a, long b, long c, long d, long e, long f, + long g, long h, long i, long j); +#else +extern void afs_warn(); +extern void afs_warnuser(); +#endif +extern void afs_CheckLocks(void); +extern int afs_badop(void); +extern int afs_noop(void); extern afs_int32 afs_data_pointer_to_int32(const void *p); + /* afs_vcache.c */ +extern afs_int32 afs_maxvcount; +extern afs_int32 afs_vcount; +extern int afsvnumbers; +extern afs_rwlock_t afs_xvcache; +extern afs_lock_t afs_xvcb; +extern struct vcache *freeVCList; +extern struct vcache *Initial_freeVCList; +extern struct afs_q VLRU; +extern afs_int32 vcachegen; +extern unsigned int afs_paniconwarn; +extern struct vcache *afs_vhashT[VCSIZE]; +extern afs_int32 afs_bulkStatsLost; +extern int afs_norefpanic; + void afs_vcacheInit(int astatSize); -extern struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 lockit, - afs_int32 locktype, afs_int32 *retry, afs_int32 flag); +extern struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 * retry, + afs_int32 flag); extern afs_int32 afs_FetchStatus(struct vcache *avc, struct VenusFid *afid, - struct vrequest *areq, - struct AFSFetchStatus *Outsp); + struct vrequest *areq, + struct AFSFetchStatus *Outsp); extern afs_int32 afs_FlushVCBs(afs_int32 lockit); extern void afs_InactiveVCache(struct vcache *avc, struct AFS_UCRED *acred); extern struct vcache *afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq, - afs_int32 *cached, afs_int32 locktype, - struct vcache *adp, char *aname); + afs_int32 * cached, struct vcache *adp, + char *aname); extern int afs_FlushVCache(struct vcache *avc, int *slept); extern struct vcache *afs_GetRootVCache(struct VenusFid *afid, - struct vrequest *areq, afs_int32 *cached, - struct volume *tvolp, afs_int32 locktype); + struct vrequest *areq, + afs_int32 * cached, + struct volume *tvolp); extern struct vcache *afs_NewVCache(struct VenusFid *afid, - struct server *serverp, - afs_int32 lockit, afs_int32 locktype); + struct server *serverp); extern int afs_VerifyVCache2(struct vcache *avc, struct vrequest *areq); +extern struct vcache *afs_GetVCache(register struct VenusFid *afid, + struct vrequest *areq, afs_int32 * cached, + struct vcache *avc); +extern void afs_PutVCache(register struct vcache *avc); +extern void afs_ProcessFS(register struct vcache *avc, + register struct AFSFetchStatus *astat, + struct vrequest *areq); +extern struct afs_cbr *afs_AllocCBR(void); +extern int afs_FreeCBR(register struct afs_cbr *asp); +extern void afs_RemoveVCB(register struct VenusFid *afid); +extern void afs_FlushActiveVcaches(register afs_int32 doflocks); +extern int afs_WriteVCache(register struct vcache *avc, + register struct AFSStoreStatus *astatus, + struct vrequest *areq); +extern int afs_RemoteLookup(register struct VenusFid *afid, + struct vrequest *areq, char *name, + struct VenusFid *nfid, + struct AFSFetchStatus *OutStatusp, + struct AFSCallBack *CallBackp, + struct server **serverp, + struct AFSVolSync *tsyncp); +extern afs_int32 afs_NFSFindVCache(struct vcache **avcp, + struct VenusFid *afid); +extern void afs_vcacheInit(int astatSize); +extern void shutdown_vcache(void); +/* VNOPS/afs_vnop_access.c */ +extern afs_int32 afs_GetAccessBits(register struct vcache *avc, + register afs_int32 arights, + register struct vrequest *areq); +extern int afs_AccessOK(struct vcache *avc, afs_int32 arights, + struct vrequest *areq, afs_int32 check_mode_bits); +#if defined(AFS_SUN5_ENV) || (defined(AFS_SGI_ENV) && !defined(AFS_SGI65_ENV)) +extern int afs_access(OSI_VC_DECL(avc), register afs_int32 amode, int flags, + struct AFS_UCRED *acred); +#else +extern int afs_access(OSI_VC_DECL(avc), register afs_int32 amode, + struct AFS_UCRED *acred); +#endif +extern int afs_getRights(OSI_VC_DECL(avc), register afs_int32 arights, + struct AFS_UCRED *acred); + +/* VNOPS/afs_vnop_attrs.c */ +extern int afs_CopyOutAttrs(register struct vcache *avc, + register struct vattr *attrs); +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) +extern int afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, int flags, + struct AFS_UCRED *acred); +#else +extern int afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, + struct AFS_UCRED *acred); +#endif +extern int afs_VAttrToAS(register struct vcache *avc, + register struct vattr *av, + register struct AFSStoreStatus *as); +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) +extern int afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs, + int flags, struct AFS_UCRED *acred); +#else +extern int afs_setattr(OSI_VC_DECL(avc), register struct vattr *attrs, + struct AFS_UCRED *acred); +#endif + +/* VNOPS/afs_vnop_create.c */ +#ifdef AFS_OSF_ENV +extern int afs_create(struct nameidata *ndp, struct vattr *attrs); +#else /* AFS_OSF_ENV */ +#ifdef AFS_SGI64_ENV +extern int afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, + int flags, int amode, struct vcache **avcp, + struct AFS_UCRED *acred); +#else /* AFS_SGI64_ENV */ +extern int afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, + enum vcexcl aexcl, int amode, struct vcache **avcp, + struct AFS_UCRED *acred); +#endif /* AFS_SGI64_ENV */ +#endif /* AFS_OSF_ENV */ +extern int afs_LocalHero(register struct vcache *avc, + register struct dcache *adc, + register AFSFetchStatus * astat, register int aincr); + + +/* VNOPS/afs_vnop_flock.c */ +extern void lockIdSet(struct AFS_FLOCK *flock, struct SimpleLocks *slp, + int clid); +extern int HandleFlock(register struct vcache *avc, int acom, + struct vrequest *areq, pid_t clid, int onlymine); + + + +/* VNOPS/afs_vnop_lookup.c */ +extern int EvalMountPoint(register struct vcache *avc, struct vcache *advc, + struct volume **avolpp, + register struct vrequest *areq); +extern void afs_InitFakeStat(struct afs_fakestat_state *state); +extern int afs_EvalFakeStat(struct vcache **avcp, + struct afs_fakestat_state *state, + struct vrequest *areq); +extern int afs_TryEvalFakeStat(struct vcache **avcp, + struct afs_fakestat_state *state, + struct vrequest *areq); +extern void afs_PutFakeStat(struct afs_fakestat_state *state); +extern int afs_ENameOK(register char *aname); +extern void Check_AtSys(register struct vcache *avc, char *aname, + struct sysname_info *state, struct vrequest *areq); +extern int Next_AtSys(register struct vcache *avc, struct vrequest *areq, + struct sysname_info *state); +extern int afs_DoBulkStat(struct vcache *adp, long dirCookie, + struct vrequest *areqp); +extern int afs_lookup(); + + +/* VNOPS/afs_vnop_open.c */ +#ifdef AFS_SGI64_ENV +extern int afs_open(bhv_desc_t * bhv, struct vcache **avcp, afs_int32 aflags, + struct AFS_UCRED *acred); +#else +extern int afs_open(struct vcache **avcp, afs_int32 aflags, + struct AFS_UCRED *acred); +#endif + + +/* VNOPS/afs_vnop_read.c */ +extern afs_int32 maxIHint; +extern afs_int32 nihints; +extern afs_int32 usedihint; +extern int afs_MemRead(register struct vcache *avc, struct uio *auio, + struct AFS_UCRED *acred, daddr_t albn, + struct buf **abpp, int noLock); +extern int afs_UFSRead(register struct vcache *avc, struct uio *auio, + struct AFS_UCRED *acred, daddr_t albn, + struct buf **abpp, int noLock); + + +/* VNOPS/afs_vnop_readdir.c */ +extern int afs_rd_stash_i; + + +/* VNOPS/afs_vnop_remove.c */ +extern int afsremove(register struct vcache *adp, register struct dcache *tdc, + register struct vcache *tvc, char *aname, + struct AFS_UCRED *acred, struct vrequest *treqp); +extern int afs_remunlink(register struct vcache *avc, register int doit); + + +/* VNOPS/afs_vnop_rename.c */ +extern int afsrename(struct vcache *aodp, char *aname1, struct vcache *andp, + char *aname2, struct AFS_UCRED *acred, + struct vrequest *areq); + + +/* VNOPS/afs_vnop_symlink.c */ +extern int afs_MemHandleLink(register struct vcache *avc, + struct vrequest *areq); +extern int afs_UFSHandleLink(register struct vcache *avc, + struct vrequest *areq); + +/* VNOPS/afs_vnop_flock.c */ +extern afs_int32 lastWarnTime; + +/* VNOPS/afs_vnop_write.c */ +extern int afs_MemWrite(register struct vcache *avc, struct uio *auio, + int aio, struct AFS_UCRED *acred, int noLock); +extern int afs_StoreOnLastReference(register struct vcache *avc, + register struct vrequest *treq); +extern int afs_UFSWrite(register struct vcache *avc, struct uio *auio, + int aio, struct AFS_UCRED *acred, int noLock); +extern int afs_DoPartialWrite(register struct vcache *avc, + struct vrequest *areq); +extern int afs_closex(register struct file *afd); + +/* other VNOPS (please fix these) */ +extern int afs_close(); +extern int HandleIoctl(); +extern int afs_fsync(); +extern int afs_remove(); +extern int afs_link(); +extern int afs_rename(); +extern int afs_mkdir(); +extern int afs_rmdir(); +extern int afs_symlink(); +extern int afs_readdir(); +extern int afs_readlink(); +extern int afs_ustrategy(); +extern int afs_lockctl(); + /* afs_volume.c */ -extern struct volume *afs_FindVolume(struct VenusFid *afid, afs_int32 locktype); +extern afs_int32 afs_FVIndex; +extern afs_int32 afs_volCounter; +extern afs_rwlock_t afs_xvolume; +extern struct volume *afs_volumes[NVOLS]; +extern ino_t volumeInode; +extern struct volume *afs_FindVolume(struct VenusFid *afid, + afs_int32 locktype); +extern struct volume *afs_freeVolList; +extern afs_int32 fvTable[NFENTRIES]; extern void InstallVolumeEntry(struct volume *av, struct vldbentry *ve, int acell); extern void InstallNVolumeEntry(struct volume *av, struct nvldbentry *ve, - int acell); + int acell); extern void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, - int acell, struct cell *tcell, struct vrequest *areq); + int acell, struct cell *tcell, + struct vrequest *areq); extern void afs_ResetVolumeInfo(struct volume *tv); +extern struct volume *afs_MemGetVolSlot(void); +extern void afs_ResetVolumes(struct server *srvp); +extern struct volume *afs_GetVolume(struct VenusFid *afid, + struct vrequest *areq, + afs_int32 locktype); +extern struct volume *afs_GetVolumeByName(register char *aname, + afs_int32 acell, int agood, + struct vrequest *areq, + afs_int32 locktype); +extern struct volume *afs_UFSGetVolSlot(void); +extern void afs_CheckVolumeNames(int flags); -#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) -#include "../afs/osi_prototypes.h" -#endif +/* Prototypes for generated files that aren't really in src/afs/ */ + +/* afs_uuid.c */ +extern afs_int32 afs_uuid_equal(afsUUID * u1, afsUUID * u2); +extern afs_int32 afs_uuid_is_nil(afsUUID * u1); +extern void afs_htonuuid(afsUUID * uuidp); +extern void afs_ntohuuid(afsUUID * uuidp); +extern afs_int32 afs_uuid_create(afsUUID * uuid); +extern u_short afs_uuid_hash(afsUUID * uuid); + + +/* MISC PROTOTYPES - THESE SHOULD NOT BE HERE */ +/* MOVE THEM TO APPROPRIATE LOCATIONS */ +extern afs_int32 RXAFSCB_ExecuteRequest(struct rx_call *acall); +extern afs_int32 RXSTATS_ExecuteRequest(struct rx_call *acall); -#endif /* _AFS_PROTOTYPES_H_ */ + +#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SGI62_ENV) +#include "osi_prototypes.h" +#endif + +#endif /* _AFS_PROTOTYPES_H_ */ diff --git a/src/afs/afs_segments.c b/src/afs/afs_segments.c index 5140df4d3..b1f212a3c 100644 --- a/src/afs/afs_segments.c +++ b/src/afs/afs_segments.c @@ -11,30 +11,18 @@ * --------------------- Required definitions --------------------- */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_segments.c,v 1.1.1.8 2004/01/10 20:52:47 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_segments.c,v 1.16 2003/07/15 23:14:13 shadow Exp $"); -#include "../afs/sysincludes.h" /*Standard vendor system headers*/ -#include "../afs/afsincludes.h" /*AFS-based standard headers*/ -#include "../afs/afs_stats.h" /* statistics */ -#include "../afs/afs_cbqueue.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /*Standard vendor system headers */ +#include "afsincludes.h" /*AFS-based standard headers */ +#include "afs/afs_stats.h" /* statistics */ +#include "afs/afs_cbqueue.h" +#include "afs/afs_osidnlc.h" - - -/* Imported variables */ -extern afs_rwlock_t afs_xserver; -extern afs_rwlock_t afs_xdcache; -extern afs_rwlock_t afs_xcbhash; -extern afs_lock_t afs_ftf; -extern struct server *afs_servers[NSERVERS]; -extern afs_int32 afs_dhashsize; -extern afs_int32 *afs_dvhashTbl; -extern unsigned char *afs_indexFlags; /*(only one) Is there data there?*/ -extern int cacheDiskType; - -afs_uint32 afs_stampValue=0; +afs_uint32 afs_stampValue = 0; /* * afs_StoreMini @@ -49,80 +37,98 @@ afs_uint32 afs_stampValue=0; * We're write-locked upon entry. */ -int afs_StoreMini(avc, areq) - register struct vcache *avc; - struct vrequest *areq; - -{ /*afs_StoreMini*/ +int +afs_StoreMini(register struct vcache *avc, struct vrequest *areq) +{ register struct conn *tc; struct AFSStoreStatus InStatus; struct AFSFetchStatus OutStatus; struct AFSVolSync tsync; register afs_int32 code; register struct rx_call *tcall; - afs_int32 tlen; - XSTATS_DECLS - - AFS_STATCNT(afs_StoreMini); + afs_size_t tlen, xlen = 0; + XSTATS_DECLS AFS_STATCNT(afs_StoreMini); afs_Trace2(afs_iclSetp, CM_TRACE_STOREMINI, ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, avc->m.Length); tlen = avc->m.Length; - if (avc->truncPos < tlen) tlen = avc->truncPos; + if (avc->truncPos < tlen) + tlen = avc->truncPos; avc->truncPos = AFS_NOTRUNC; avc->states &= ~CExtendedFile; do { tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); if (tc) { -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); + retry: tcall = rx_NewCall(tc->id); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); /* Set the client mod time since we always want the file - * to have the client's mod time and not the server's one - * (to avoid problems with make, etc.) It almost always - * works fine with standard afs because them server/client - * times are in sync and more importantly this storemini - * it's a special call that would typically be followed by - * the proper store-data or store-status calls. - */ + * to have the client's mod time and not the server's one + * (to avoid problems with make, etc.) It almost always + * works fine with standard afs because them server/client + * times are in sync and more importantly this storemini + * it's a special call that would typically be followed by + * the proper store-data or store-status calls. + */ InStatus.Mask = AFS_SETMODTIME; InStatus.ClientModTime = avc->m.Date; XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STOREDATA); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = StartRXAFS_StoreData(tcall, - (struct AFSFid *)&avc->fid.Fid, - &InStatus, avc->m.Length, 0, tlen); + afs_Trace4(afs_iclSetp, CM_TRACE_STOREDATA64, ICL_TYPE_FID, + &avc->fid.Fid, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(avc->m.Length), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(xlen), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(tlen)); + RX_AFS_GUNLOCK(); +#ifdef AFS_64BIT_CLIENT + if (!afs_serverHasNo64Bit(tc)) { + code = + StartRXAFS_StoreData64(tcall, + (struct AFSFid *)&avc->fid.Fid, + &InStatus, avc->m.Length, + (afs_size_t) 0, tlen); + } else { + afs_int32 l1, l2; + l1 = avc->m.Length; + l2 = tlen; + code = + StartRXAFS_StoreData(tcall, + (struct AFSFid *)&avc->fid.Fid, + &InStatus, l1, 0, l2); + } +#else /* AFS_64BIT_CLIENT */ + code = + StartRXAFS_StoreData(tcall, (struct AFSFid *)&avc->fid.Fid, + &InStatus, avc->m.Length, 0, tlen); +#endif /* AFS_64BIT_CLIENT */ if (code == 0) { code = EndRXAFS_StoreData(tcall, &OutStatus, &tsync); +#ifdef AFS_64BIT_CLIENT + if (code == RXGEN_OPCODE) { + afs_serverSetNo64Bit(tc); + code = rx_EndCall(tcall, code); + goto retry; + } +#endif /* AFS_64BIT_CLIENT */ } code = rx_EndCall(tcall, code); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); XSTATS_END_TIME; - } - else code = -1; - } while - (afs_Analyze(tc, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_STOREDATA, - SHARED_LOCK, (struct cell *)0)); + } else + code = -1; + } while (afs_Analyze + (tc, code, &avc->fid, areq, AFS_STATS_FS_RPCIDX_STOREDATA, + SHARED_LOCK, NULL)); if (code == 0) { afs_ProcessFS(avc, &OutStatus, areq); - } - else { + } else { /* blew it away */ - afs_InvalidateAllSegments(avc, 1); + afs_InvalidateAllSegments(avc); } return code; -} /*afs_StoreMini*/ +} /*afs_StoreMini */ unsigned int storeallmissing = 0; #define lmin(a,b) (((a) < (b)) ? (a) : (b)) @@ -142,52 +148,50 @@ unsigned int storeallmissing = 0; #if defined (AFS_HPUX_ENV) || defined(AFS_ULTRIX_ENV) int NCHUNKSATONCE = 3; #else -int NCHUNKSATONCE = 64 ; +int NCHUNKSATONCE = 64; #endif -int afs_dvhack=0; +int afs_dvhack = 0; -afs_StoreAllSegments(avc, areq, sync) - register struct vcache *avc; - struct vrequest *areq; - int sync; - -{ /*afs_StoreAllSegments*/ +int +afs_StoreAllSegments(register struct vcache *avc, struct vrequest *areq, + int sync) +{ register struct dcache *tdc; - register afs_int32 code=0; + register afs_int32 code = 0; register afs_int32 index; - register afs_int32 origCBs, foreign=0; + register afs_int32 origCBs, foreign = 0; int hash, stored; afs_hyper_t newDV, oldDV; /* DV when we start, and finish, respectively */ struct dcache **dcList, **dclist; - unsigned int i, j, minj, maxj, moredata, high, off; - unsigned long tlen; + unsigned int i, j, minj, moredata, high, off; + afs_size_t tlen; + afs_size_t maxStoredLength; /* highest offset we've written to server. */ int safety; - int maxStoredLength; /* highest offset we've written to server. */ #ifndef AFS_NOSTATS struct afs_stats_xferData *xferP; /* Ptr to this op's xfer struct */ - osi_timeval_t xferStartTime, /*FS xfer start time*/ - xferStopTime; /*FS xfer stop time*/ - afs_int32 bytesToXfer; /* # bytes to xfer*/ - afs_int32 bytesXferred; /* # bytes actually xferred*/ + osi_timeval_t xferStartTime, /*FS xfer start time */ + xferStopTime; /*FS xfer stop time */ + afs_size_t bytesToXfer; /* # bytes to xfer */ + afs_size_t bytesXferred; /* # bytes actually xferred */ #endif /* AFS_NOSTATS */ AFS_STATCNT(afs_StoreAllSegments); - + hset(oldDV, avc->m.DataVersion); hset(newDV, avc->m.DataVersion); hash = DVHash(&avc->fid); foreign = (avc->states & CForeign); - dcList = (struct dcache **) osi_AllocLargeSpace(AFS_LRALLOCSIZ); + dcList = (struct dcache **)osi_AllocLargeSpace(AFS_LRALLOCSIZ); afs_Trace2(afs_iclSetp, CM_TRACE_STOREALL, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->m.Length); + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length)); #if !defined(AFS_AIX32_ENV) && !defined(AFS_SGI65_ENV) /* In the aix vm implementation we need to do the vm_writep even * on the memcache case since that's we adjust the file's size * and finish flushing partial vm pages. */ - if (cacheDiskType != AFS_FCACHE_TYPE_MEM) + if (cacheDiskType != AFS_FCACHE_TYPE_MEM) #endif /* !AFS_AIX32_ENV && !AFS_SGI65_ENV */ { /* If we're not diskless, reading a file may stress the VM @@ -201,422 +205,557 @@ afs_StoreAllSegments(avc, areq, sync) * space. */ #if defined(AFS_SUN5_ENV) - if ( sync & AFS_VMSYNC_INVAL) /* invalidate VM pages */ - osi_VM_TryToSmush(avc, CRED() , 1 ); + if (sync & AFS_VMSYNC_INVAL) /* invalidate VM pages */ + osi_VM_TryToSmush(avc, CRED(), 1); else #endif osi_VM_StoreAllSegments(avc); } ConvertWToSLock(&avc->lock); - - /* - * Subsequent code expects a sorted list, and it expects all the - * chunks in the list to be contiguous, so we need a sort and a - * while loop in here, too - but this will work for a first pass... - * 92.10.05 - OK, there's a sort in here now. It's kind of a modified - * bin sort, I guess. Chunk numbers start with 0 - * - * - Have to get a write lock on xdcache because GetDSlot might need it (if - * the chunk doesn't have a dcache struct). - * This seems like overkill in most cases. - * - I'm not sure that it's safe to do "index = .hvNextp", then unlock - * xdcache, then relock xdcache and try to use index. It is done - * a lot elsewhere in the CM, but I'm not buying that argument. - * - should be able to check IFDataMod without doing the GetDSlot (just - * hold afs_xdcache). That way, it's easy to do this without the - * writelock on afs_xdcache, and we save unneccessary disk - * operations. I don't think that works, 'cuz the next pointers - * are still on disk. - */ + + /* + * Subsequent code expects a sorted list, and it expects all the + * chunks in the list to be contiguous, so we need a sort and a + * while loop in here, too - but this will work for a first pass... + * 92.10.05 - OK, there's a sort in here now. It's kind of a modified + * bin sort, I guess. Chunk numbers start with 0 + * + * - Have to get a write lock on xdcache because GetDSlot might need it (if + * the chunk doesn't have a dcache struct). + * This seems like overkill in most cases. + * - I'm not sure that it's safe to do "index = .hvNextp", then unlock + * xdcache, then relock xdcache and try to use index. It is done + * a lot elsewhere in the CM, but I'm not buying that argument. + * - should be able to check IFDataMod without doing the GetDSlot (just + * hold afs_xdcache). That way, it's easy to do this without the + * writelock on afs_xdcache, and we save unneccessary disk + * operations. I don't think that works, 'cuz the next pointers + * are still on disk. + */ origCBs = afs_allCBs; retry: maxStoredLength = 0; tlen = avc->m.Length; - minj = 0 ; + minj = 0; do { - memset((char *)dcList, 0, NCHUNKSATONCE * sizeof(struct dcache *)); - high = 0; - moredata = FALSE; - - /* lock and start over from beginning of hash chain - * in order to avoid a race condition. */ - MObtainWriteLock(&afs_xdcache,284); - index = afs_dvhashTbl[hash]; - - for(j=0; index != NULLIDX;) { - if ((afs_indexFlags[index] & IFDataMod) && - (afs_indexUnique[index] == avc->fid.Fid.Unique)) { - tdc = afs_GetDSlot(index, 0); /* refcount+1. */ - if (!FidCmp( &tdc->f.fid, &avc->fid ) && tdc->f.chunk >= minj ) { - - off = tdc->f.chunk - minj; - if (off < NCHUNKSATONCE) { - if ( dcList[ off ] ) - osi_Panic("dclist slot already in use!"); - dcList[ off ] = tdc; - if (off > high) - high = off; - tlen -= tdc->f.chunkBytes; /* shortcut: big win for little files */ - j++; - if (tlen <= 0) - break; - } - else { - moredata = TRUE; - lockedPutDCache(tdc); - if (j == NCHUNKSATONCE) - break; + memset((char *)dcList, 0, NCHUNKSATONCE * sizeof(struct dcache *)); + high = 0; + moredata = FALSE; + + /* lock and start over from beginning of hash chain + * in order to avoid a race condition. */ + MObtainWriteLock(&afs_xdcache, 284); + index = afs_dvhashTbl[hash]; + + for (j = 0; index != NULLIDX;) { + if ((afs_indexFlags[index] & IFDataMod) + && (afs_indexUnique[index] == avc->fid.Fid.Unique)) { + tdc = afs_GetDSlot(index, 0); /* refcount+1. */ + ReleaseReadLock(&tdc->tlock); + if (!FidCmp(&tdc->f.fid, &avc->fid) && tdc->f.chunk >= minj) { + off = tdc->f.chunk - minj; + if (off < NCHUNKSATONCE) { + if (dcList[off]) + osi_Panic("dclist slot already in use!"); + dcList[off] = tdc; + if (off > high) + high = off; + j++; + /* DCLOCKXXX: chunkBytes is protected by tdc->lock which we + * can't grab here, due to lock ordering with afs_xdcache. + * So, disable this shortcut for now. -- kolya 2001-10-13 + */ + /* shortcut: big win for little files */ + /* tlen -= tdc->f.chunkBytes; + * if (tlen <= 0) + * break; + */ + } else { + moredata = TRUE; + afs_PutDCache(tdc); + if (j == NCHUNKSATONCE) + break; + } + } else { + afs_PutDCache(tdc); + } } - } else { - lockedPutDCache(tdc); - } + index = afs_dvnextTbl[index]; } - index = afs_dvnextTbl[index]; - } - - MReleaseWriteLock(&afs_xdcache); - /* this guy writes chunks, puts back dcache structs, and bumps newDV */ - /* "moredata" just says "there are more dirty chunks yet to come". - */ - if (j) { - static afs_uint32 lp1 = 10000, lp2 = 10000; - struct AFSStoreStatus InStatus; - struct AFSFetchStatus OutStatus; - int doProcessFS = 0; - afs_uint32 base, bytes, nchunks; - int nomore; - unsigned int first; - int *shouldwake; - struct conn * tc; - struct osi_file * tfile; - struct rx_call * tcall; - extern int afs_defaultAsynchrony; - XSTATS_DECLS - - for (bytes = 0, j = 0; !code && j<=high; j++) { - if (dcList[j]) { - if (!bytes) - first = j; - bytes += dcList[j]->f.chunkBytes; - if ((dcList[j]->f.chunkBytes < afs_OtherCSize) - && (dcList[j]->f.chunk - minj < high) - && dcList[j+1]) { - int sbytes = afs_OtherCSize - dcList[j]->f.chunkBytes; - bytes += sbytes; - + MReleaseWriteLock(&afs_xdcache); - - } - } - if (bytes && (j==high || !dcList[j+1])) { - /* base = AFS_CHUNKTOBASE(dcList[first]->f.chunk); */ - base = AFS_CHUNKTOBASE(first + minj) ; - /* - * - * take a list of dcache structs and send them all off to the server - * the list must be in order, and the chunks contiguous. - * Note - there is no locking done by this code currently. For - * safety's sake, xdcache could be locked over the entire call. - * However, that pretty well ties up all the threads. Meantime, all - * the chunks _MUST_ have their refcounts bumped. - * The writes done before a store back will clear setuid-ness - * in cache file. - * We can permit CacheStoreProc to wake up the user process IFF we - * are doing the last RPC for this close, ie, storing back the last - * set of contiguous chunks of a file. - */ - - dclist = &dcList[first]; - nchunks = 1+j-first; - nomore = !(moredata || (j!=high)); - InStatus.ClientModTime = avc->m.Date; - InStatus.Mask = AFS_SETMODTIME; - if (sync & AFS_SYNC) { - InStatus.Mask |= AFS_FSYNC; - } - tlen = lmin(avc->m.Length, avc->truncPos); - - do { - stored = 0; - tc = afs_Conn(&avc->fid, areq); - if (tc) { -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - tcall = rx_NewCall(tc->id); - code = StartRXAFS_StoreData(tcall, (struct AFSFid *) &avc->fid.Fid, - &InStatus, base, bytes, tlen); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - } else { - code = -1; - tcall = NULL; - } - if (!code) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STOREDATA); - avc->truncPos = AFS_NOTRUNC; + /* this guy writes chunks, puts back dcache structs, and bumps newDV */ + /* "moredata" just says "there are more dirty chunks yet to come". + */ + if (j) { +#ifdef AFS_NOSTATS + static afs_uint32 lp1 = 10000, lp2 = 10000; +#endif + struct AFSStoreStatus InStatus; + struct AFSFetchStatus OutStatus; + int doProcessFS = 0; + afs_size_t base, bytes; + afs_uint32 nchunks; + int nomore; + unsigned int first; + int *shouldwake; + struct conn *tc; + struct osi_file *tfile; + struct rx_call *tcall; + XSTATS_DECLS for (bytes = 0, j = 0; !code && j <= high; j++) { + if (dcList[j]) { + ObtainSharedLock(&(dcList[j]->lock), 629); + if (!bytes) + first = j; + bytes += dcList[j]->f.chunkBytes; + if ((dcList[j]->f.chunkBytes < afs_OtherCSize) + && (dcList[j]->f.chunk - minj < high) + && dcList[j + 1]) { + int sbytes = afs_OtherCSize - dcList[j]->f.chunkBytes; + bytes += sbytes; + } } - for (i = 0; if.chunk); */ + base = AFS_CHUNKTOBASE(first + minj); + /* + * + * take a list of dcache structs and send them all off to the server + * the list must be in order, and the chunks contiguous. + * Note - there is no locking done by this code currently. For + * safety's sake, xdcache could be locked over the entire call. + * However, that pretty well ties up all the threads. Meantime, all + * the chunks _MUST_ have their refcounts bumped. + * The writes done before a store back will clear setuid-ness + * in cache file. + * We can permit CacheStoreProc to wake up the user process IFF we + * are doing the last RPC for this close, ie, storing back the last + * set of contiguous chunks of a file. + */ + + dclist = &dcList[first]; + nchunks = 1 + j - first; + nomore = !(moredata || (j != high)); + InStatus.ClientModTime = avc->m.Date; + InStatus.Mask = AFS_SETMODTIME; + if (sync & AFS_SYNC) { + InStatus.Mask |= AFS_FSYNC; } - shouldwake = 0; - if (nomore) { - if (avc->asynchrony == -1) { - if (afs_defaultAsynchrony > (bytes-stored)) { - shouldwake = &nomore; - } - } else if ((afs_uint32)avc->asynchrony >= (bytes-stored)) { - shouldwake = &nomore; - } - } - tfile = afs_CFileOpen(tdc->f.inode); + tlen = lmin(avc->m.Length, avc->truncPos); + afs_Trace4(afs_iclSetp, CM_TRACE_STOREDATA64, + ICL_TYPE_FID, &avc->fid.Fid, ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(base), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(bytes), ICL_TYPE_OFFSET, + ICL_HANDLE_OFFSET(tlen)); + + do { + stored = 0; + tc = afs_Conn(&avc->fid, areq, 0); + if (tc) { + restart: + RX_AFS_GUNLOCK(); + tcall = rx_NewCall(tc->id); +#ifdef AFS_64BIT_CLIENT + if (!afs_serverHasNo64Bit(tc)) { + code = + StartRXAFS_StoreData64(tcall, + (struct AFSFid *) + &avc->fid.Fid, + &InStatus, base, + bytes, tlen); + } else { + if (tlen > 0xFFFFFFFF) { + code = EFBIG; + } else { + afs_int32 t1, t2, t3; + t1 = base; + t2 = bytes; + t3 = tlen; + code = + StartRXAFS_StoreData(tcall, + (struct AFSFid *) + &avc->fid.Fid, + &InStatus, t1, + t2, t3); + } + } +#else /* AFS_64BIT_CLIENT */ + code = + StartRXAFS_StoreData(tcall, + (struct AFSFid *)&avc-> + fid.Fid, &InStatus, base, + bytes, tlen); +#endif /* AFS_64BIT_CLIENT */ + RX_AFS_GLOCK(); + } else { + code = -1; + tcall = NULL; + } + if (!code) { + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STOREDATA); + avc->truncPos = AFS_NOTRUNC; + } + for (i = 0; i < nchunks && !code; i++) { + tdc = dclist[i]; + if (!tdc) { + afs_warn("afs: missing dcache!\n"); + storeallmissing++; + continue; /* panic? */ + } + afs_Trace4(afs_iclSetp, CM_TRACE_STOREALL2, + ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, + tdc->f.chunk, ICL_TYPE_INT32, + tdc->index, ICL_TYPE_INT32, + tdc->f.inode); + shouldwake = 0; + if (nomore) { + if (avc->asynchrony == -1) { + if (afs_defaultAsynchrony > + (bytes - stored)) { + shouldwake = &nomore; + } + } else if ((afs_uint32) avc->asynchrony >= + (bytes - stored)) { + shouldwake = &nomore; + } + } + tfile = afs_CFileOpen(tdc->f.inode); #ifndef AFS_NOSTATS - xferP = &(afs_stats_cmfullperf.rpc.fsXferTimes[AFS_STATS_FS_XFERIDX_STOREDATA]); - osi_GetuTime(&xferStartTime); - - code = afs_CacheStoreProc(tcall, tfile, tdc->f.chunkBytes, - avc, shouldwake, &bytesToXfer, - &bytesXferred); - - osi_GetuTime(&xferStopTime); - (xferP->numXfers)++; - if (!code) { - (xferP->numSuccesses)++; - afs_stats_XferSumBytes[AFS_STATS_FS_XFERIDX_STOREDATA] += bytesXferred; - (xferP->sumBytes) += (afs_stats_XferSumBytes[AFS_STATS_FS_XFERIDX_STOREDATA] >> 10); - afs_stats_XferSumBytes[AFS_STATS_FS_XFERIDX_STOREDATA] &= 0x3FF; - if (bytesXferred < xferP->minBytes) - xferP->minBytes = bytesXferred; - if (bytesXferred > xferP->maxBytes) - xferP->maxBytes = bytesXferred; - - /* - * Tally the size of the object. Note: we tally the actual size, - * NOT the number of bytes that made it out over the wire. - */ - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET0) - (xferP->count[0])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET1) - (xferP->count[1])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET2) - (xferP->count[2])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET3) - (xferP->count[3])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET4) - (xferP->count[4])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET5) - (xferP->count[5])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET6) - (xferP->count[6])++; - else - if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET7) - (xferP->count[7])++; - else - (xferP->count[8])++; - - afs_stats_GetDiff(elapsedTime, xferStartTime, xferStopTime); - afs_stats_AddTo((xferP->sumTime), elapsedTime); - afs_stats_SquareAddTo((xferP->sqrTime), elapsedTime); - if (afs_stats_TimeLessThan(elapsedTime, (xferP->minTime))) { - afs_stats_TimeAssign((xferP->minTime), elapsedTime); - } - if (afs_stats_TimeGreaterThan(elapsedTime, (xferP->maxTime))) { - afs_stats_TimeAssign((xferP->maxTime), elapsedTime); - } - } + xferP = + &(afs_stats_cmfullperf.rpc. + fsXferTimes + [AFS_STATS_FS_XFERIDX_STOREDATA]); + osi_GetuTime(&xferStartTime); + + code = + afs_CacheStoreProc(tcall, tfile, + tdc->f.chunkBytes, avc, + shouldwake, &bytesToXfer, + &bytesXferred); + + osi_GetuTime(&xferStopTime); + (xferP->numXfers)++; + if (!code) { + (xferP->numSuccesses)++; + afs_stats_XferSumBytes + [AFS_STATS_FS_XFERIDX_STOREDATA] += + bytesXferred; + (xferP->sumBytes) += + (afs_stats_XferSumBytes + [AFS_STATS_FS_XFERIDX_STOREDATA] >> 10); + afs_stats_XferSumBytes + [AFS_STATS_FS_XFERIDX_STOREDATA] &= 0x3FF; + if (bytesXferred < xferP->minBytes) + xferP->minBytes = bytesXferred; + if (bytesXferred > xferP->maxBytes) + xferP->maxBytes = bytesXferred; + + /* + * Tally the size of the object. Note: we tally the actual size, + * NOT the number of bytes that made it out over the wire. + */ + if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET0) + (xferP->count[0])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET1) + (xferP->count[1])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET2) + (xferP->count[2])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET3) + (xferP->count[3])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET4) + (xferP->count[4])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET5) + (xferP->count[5])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET6) + (xferP->count[6])++; + else if (bytesToXfer <= + AFS_STATS_MAXBYTES_BUCKET7) + (xferP->count[7])++; + else + (xferP->count[8])++; + + afs_stats_GetDiff(elapsedTime, xferStartTime, + xferStopTime); + afs_stats_AddTo((xferP->sumTime), + elapsedTime); + afs_stats_SquareAddTo((xferP->sqrTime), + elapsedTime); + if (afs_stats_TimeLessThan + (elapsedTime, (xferP->minTime))) { + afs_stats_TimeAssign((xferP->minTime), + elapsedTime); + } + if (afs_stats_TimeGreaterThan + (elapsedTime, (xferP->maxTime))) { + afs_stats_TimeAssign((xferP->maxTime), + elapsedTime); + } + } #else - code = afs_CacheStoreProc(tcall, tfile, tdc->f.chunkBytes, avc, - shouldwake, &lp1, &lp2); + code = + afs_CacheStoreProc(tcall, tfile, + tdc->f.chunkBytes, avc, + shouldwake, &lp1, &lp2); #endif /* AFS_NOSTATS */ - afs_CFileClose(tfile); - if ((tdc->f.chunkBytes < afs_OtherCSize) && - (i < (nchunks-1))) { - int bsent, tlen, tlen1=0, sbytes = afs_OtherCSize - tdc->f.chunkBytes; - char *tbuffer = osi_AllocLargeSpace(AFS_LRALLOCSIZ); - - while (sbytes > 0) { - tlen = (sbytes > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : sbytes); - memset(tbuffer, 0, tlen); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - bsent = rx_Write(tcall, tbuffer, tlen); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - - if (bsent != tlen) { - code = -33; /* XXX */ - break; - } - sbytes -= tlen; - } - osi_FreeLargeSpace(tbuffer); - } - stored += tdc->f.chunkBytes; - - /* ideally, I'd like to unlock the dcache and turn - * off the writing bit here, but that would - * require being able to retry StoreAllSegments in - * the event of a failure. It only really matters - * if user can't read from a 'locked' dcache or - * one which has the writing bit turned on. */ - } - if (!code) { - struct AFSVolSync tsync; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = EndRXAFS_StoreData(tcall, &OutStatus, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - hadd32(newDV, 1); - XSTATS_END_TIME; - if (!code) doProcessFS = 1; /* Flag to run afs_ProcessFS() later on */ - } - if (tcall) { -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = rx_EndCall(tcall, code, avc, base); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - } - } while (afs_Analyze(tc, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_STOREDATA, - SHARED_LOCK, (struct cell *)0)); - - /* put back all remaining locked dcache entries */ - for (i=0; iindex] & IFDataMod) { - afs_indexFlags[tdc->index] &= ~IFDataMod; - afs_stats_cmperf.cacheCurrDirtyChunks--; - afs_indexFlags[tdc->index] &= ~IFDirtyPages; - if ( sync & AFS_VMSYNC_INVAL ) - { - /* since we have invalidated all the pages of this - ** vnode by calling osi_VM_TryToSmush, we can - ** safely mark this dcache entry as not having - ** any pages. This vnode now becomes eligible for - ** reclamation by getDownD. - */ - afs_indexFlags[tdc->index] &= ~IFAnyPages; - } + afs_CFileClose(tfile); +#ifdef AFS_64BIT_CLIENT + if (code == RXGEN_OPCODE) { + afs_serverSetNo64Bit(tc); + goto restart; + } +#endif /* AFS_64BIT_CLIENT */ + if ((tdc->f.chunkBytes < afs_OtherCSize) + && (i < (nchunks - 1))) { + int bsent, tlen, sbytes = + afs_OtherCSize - tdc->f.chunkBytes; + char *tbuffer = + osi_AllocLargeSpace(AFS_LRALLOCSIZ); + + while (sbytes > 0) { + tlen = + (sbytes > + AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : + sbytes); + memset(tbuffer, 0, tlen); + RX_AFS_GUNLOCK(); + bsent = rx_Write(tcall, tbuffer, tlen); + RX_AFS_GLOCK(); + + if (bsent != tlen) { + code = -33; /* XXX */ + break; + } + sbytes -= tlen; + } + osi_FreeLargeSpace(tbuffer); + } + stored += tdc->f.chunkBytes; + + /* ideally, I'd like to unlock the dcache and turn + * off the writing bit here, but that would + * require being able to retry StoreAllSegments in + * the event of a failure. It only really matters + * if user can't read from a 'locked' dcache or + * one which has the writing bit turned on. */ + } + if (!code) { + struct AFSVolSync tsync; + RX_AFS_GUNLOCK(); + code = + EndRXAFS_StoreData(tcall, &OutStatus, &tsync); + RX_AFS_GLOCK(); + hadd32(newDV, 1); + XSTATS_END_TIME; + if (!code) + doProcessFS = 1; /* Flag to run afs_ProcessFS() later on */ + } + if (tcall) { + afs_int32 code2; + RX_AFS_GUNLOCK(); + code2 = rx_EndCall(tcall, code); + RX_AFS_GLOCK(); + if (code2) + code = code2; + } + } while (afs_Analyze + (tc, code, &avc->fid, areq, + AFS_STATS_FS_RPCIDX_STOREDATA, SHARED_LOCK, + NULL)); + + /* put back all remaining locked dcache entries */ + for (i = 0; i < nchunks; i++) { + tdc = dclist[i]; + if (!code) { + if (afs_indexFlags[tdc->index] & IFDataMod) { + /* + * LOCKXXX -- should hold afs_xdcache(W) when + * modifying afs_indexFlags. + */ + afs_indexFlags[tdc->index] &= ~IFDataMod; + afs_stats_cmperf.cacheCurrDirtyChunks--; + afs_indexFlags[tdc->index] &= ~IFDirtyPages; + if (sync & AFS_VMSYNC_INVAL) { + /* since we have invalidated all the pages of this + ** vnode by calling osi_VM_TryToSmush, we can + ** safely mark this dcache entry as not having + ** any pages. This vnode now becomes eligible for + ** reclamation by getDownD. + */ + afs_indexFlags[tdc->index] &= ~IFAnyPages; + } + } + } + UpgradeSToWLock(&tdc->lock, 628); + tdc->f.states &= ~DWriting; /* correct? */ + tdc->dflags |= DFEntryMod; + ReleaseWriteLock(&tdc->lock); + afs_PutDCache(tdc); + /* Mark the entry as released */ + dclist[i] = NULL; + } + + if (doProcessFS) { + /* Now copy out return params */ + UpgradeSToWLock(&avc->lock, 28); /* keep out others for a while */ + afs_ProcessFS(avc, &OutStatus, areq); + /* Keep last (max) size of file on server to see if + * we need to call afs_StoreMini to extend the file. + */ + if (!moredata) + maxStoredLength = OutStatus.Length; + ConvertWToSLock(&avc->lock); + doProcessFS = 0; } + + if (code) { + for (j++; j <= high; j++) { + if (dcList[j]) { + ReleaseSharedLock(&(dcList[j]->lock)); + afs_PutDCache(dcList[j]); + /* Releasing entry */ + dcList[j] = NULL; + } + } + } + + afs_Trace2(afs_iclSetp, CM_TRACE_STOREALLDCDONE, + ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, code); + bytes = 0; } - tdc->f.states &= ~DWriting; /* correct?*/ - tdc->flags |= DFEntryMod; - lockedPutDCache(tdc); } - if (doProcessFS) { - /* Now copy out return params */ - UpgradeSToWLock(&avc->lock,28); /* keep out others for a while */ - afs_ProcessFS(avc, &OutStatus, areq); - /* Keep last (max) size of file on server to see if - * we need to call afs_StoreMini to extend the file. - */ - if (!moredata) - maxStoredLength = OutStatus.Length; - ConvertWToSLock(&avc->lock); - doProcessFS = 0; + /* Release any zero-length dcache entries in our interval + * that we locked but didn't store back above. + */ + for (j = 0; j <= high; j++) { + tdc = dcList[j]; + if (tdc) { + osi_Assert(tdc->f.chunkBytes == 0); + ReleaseSharedLock(&tdc->lock); + afs_PutDCache(tdc); + } } + } + /* if (j) */ + minj += NCHUNKSATONCE; + } while (!code && moredata); - if (code) { - for (j++; j<=high; j++) - if ( dcList[j] ) - lockedPutDCache(dcList[j]); - } + UpgradeSToWLock(&avc->lock, 29); - afs_Trace2(afs_iclSetp, CM_TRACE_STOREALLDCDONE, - ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, code); - bytes = 0; - } + /* send a trivial truncation store if did nothing else */ + if (code == 0) { + /* + * Call StoreMini if we haven't written enough data to extend the + * file at the fileserver to the client's notion of the file length. + */ + if ((avc->truncPos != AFS_NOTRUNC) || ((avc->states & CExtendedFile) + && (maxStoredLength < + avc->m.Length))) { + code = afs_StoreMini(avc, areq); + if (code == 0) + hadd32(newDV, 1); /* just bumped here, too */ } - } /* if (j) */ - - minj += NCHUNKSATONCE; - } while ( !code && moredata ); - - UpgradeSToWLock(&avc->lock,29); + avc->states &= ~CExtendedFile; + } - /* send a trivial truncation store if did nothing else */ - if (code == 0) { /* - * Call StoreMini if we haven't written enough data to extend the - * file at the fileserver to the client's notion of the file length. + * Finally, turn off DWriting, turn on DFEntryMod, + * update f.versionNo. + * A lot of this could be integrated into the loop above */ - if ((avc->truncPos != AFS_NOTRUNC) || - ((avc->states & CExtendedFile) && (maxStoredLength < avc->m.Length))) { - code = afs_StoreMini(avc, areq); - if (code == 0) - hadd32(newDV, 1); /* just bumped here, too */ - } - avc->states &= ~CExtendedFile; - } - - /* - * Finally, turn off DWriting, turn on DFEntryMod, - * update f.versionNo. - * A lot of this could be integrated into the loop above - */ if (!code) { afs_hyper_t h_unset; hones(h_unset); - MObtainWriteLock(&afs_xdcache,285); /* overkill, but it gets the - * lock in case GetDSlot needs it */ - for(safety = 0, index = afs_dvhashTbl[hash]; - index != NULLIDX && safety < afs_cacheFiles+2;) { - if (afs_indexUnique[index] == avc->fid.Fid.Unique) { - tdc = afs_GetDSlot(index, 0); + minj = 0; + + do { + moredata = FALSE; + memset((char *)dcList, 0, + NCHUNKSATONCE * sizeof(struct dcache *)); + + /* overkill, but it gets the lock in case GetDSlot needs it */ + MObtainWriteLock(&afs_xdcache, 285); + + for (j = 0, safety = 0, index = afs_dvhashTbl[hash]; + index != NULLIDX && safety < afs_cacheFiles + 2;) { + + if (afs_indexUnique[index] == avc->fid.Fid.Unique) { + tdc = afs_GetDSlot(index, 0); + ReleaseReadLock(&tdc->tlock); + + if (!FidCmp(&tdc->f.fid, &avc->fid) + && tdc->f.chunk >= minj) { + off = tdc->f.chunk - minj; + if (off < NCHUNKSATONCE) { + /* this is the file, and the correct chunk range */ + if (j >= NCHUNKSATONCE) + osi_Panic + ("Too many dcache entries in range\n"); + dcList[j++] = tdc; + } else { + moredata = TRUE; + afs_PutDCache(tdc); + if (j == NCHUNKSATONCE) + break; + } + } else { + afs_PutDCache(tdc); + } + } - if (!FidCmp(&tdc->f.fid, &avc->fid)) { - /* this is the file */ - /* was code here to clear IFDataMod, but it should only be done - * in storedcache and storealldcache. - */ - /* Only increase DV if we had up-to-date data to start with. - * Otherwise, we could be falsely upgrading an old chunk - * (that we never read) into one labelled with the current - * DV #. Also note that we check that no intervening stores - * occurred, otherwise we might mislabel cache information - * for a chunk that we didn't store this time - */ - /* Don't update the version number if it's not yet set. */ - if (code == 0 && (!hsame(tdc->f.versionNo, h_unset)) - && (hcmp(tdc->f.versionNo, oldDV) >= 0)) { - if ((!(afs_dvhack || foreign) && hsame(avc->m.DataVersion, newDV)) - || ((afs_dvhack || foreign) && (origCBs == afs_allCBs)) ) { - /* no error, this is the DV */ - hset(tdc->f.versionNo, avc->m.DataVersion); - tdc->flags |= DFEntryMod; - } + index = afs_dvnextTbl[index]; } - } - lockedPutDCache(tdc); - } - index = afs_dvnextTbl[index]; - } - MReleaseWriteLock(&afs_xdcache); + MReleaseWriteLock(&afs_xdcache); + + for (i = 0; i < j; i++) { + /* Iterate over the dcache entries we collected above */ + tdc = dcList[i]; + ObtainSharedLock(&tdc->lock, 677); + + /* was code here to clear IFDataMod, but it should only be done + * in storedcache and storealldcache. + */ + /* Only increase DV if we had up-to-date data to start with. + * Otherwise, we could be falsely upgrading an old chunk + * (that we never read) into one labelled with the current + * DV #. Also note that we check that no intervening stores + * occurred, otherwise we might mislabel cache information + * for a chunk that we didn't store this time + */ + /* Don't update the version number if it's not yet set. */ + if (!hsame(tdc->f.versionNo, h_unset) + && hcmp(tdc->f.versionNo, oldDV) >= 0) { + + if ((!(afs_dvhack || foreign) + && hsame(avc->m.DataVersion, newDV)) + || ((afs_dvhack || foreign) + && (origCBs == afs_allCBs))) { + /* no error, this is the DV */ + + UpgradeSToWLock(&tdc->lock, 678); + hset(tdc->f.versionNo, avc->m.DataVersion); + tdc->dflags |= DFEntryMod; + ConvertWToSLock(&tdc->lock); + } + } + + ReleaseSharedLock(&tdc->lock); + afs_PutDCache(tdc); + } + + minj += NCHUNKSATONCE; + + } while (moredata); } if (code) { @@ -627,20 +766,20 @@ afs_StoreAllSegments(avc, areq, sync) * fileserver. */ if (areq->permWriteError || (avc->states & (CCore1 | CCore))) { - afs_InvalidateAllSegments(avc, 1); + afs_InvalidateAllSegments(avc); } } afs_Trace3(afs_iclSetp, CM_TRACE_STOREALLDONE, ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, avc->m.Length, ICL_TYPE_INT32, code); - /* would like a Trace5, but it doesn't exist...*/ + /* would like a Trace5, but it doesn't exist... */ afs_Trace3(afs_iclSetp, CM_TRACE_AVCLOCKER, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->lock.wait_states, - ICL_TYPE_INT32, avc->lock.excl_locked); + ICL_TYPE_INT32, avc->lock.wait_states, ICL_TYPE_INT32, + avc->lock.excl_locked); afs_Trace4(afs_iclSetp, CM_TRACE_AVCLOCKEE, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->lock.wait_states, - ICL_TYPE_INT32, avc->lock.readers_reading, - ICL_TYPE_INT32, avc->lock.num_waiting ); - + ICL_TYPE_INT32, avc->lock.wait_states, ICL_TYPE_INT32, + avc->lock.readers_reading, ICL_TYPE_INT32, + avc->lock.num_waiting); + /* * Finally, if updated DataVersion matches newDV, we did all of the * stores. If mapDV indicates that the page cache was flushed up @@ -649,11 +788,11 @@ afs_StoreAllSegments(avc, areq, sync) * Turn off CDirty bit because the stored data is now in sync with server. */ if (code == 0 && hcmp(avc->mapDV, oldDV) >= 0) { - if ((!(afs_dvhack || foreign) && hsame(avc->m.DataVersion, newDV)) - || ((afs_dvhack || foreign) && (origCBs == afs_allCBs)) ) { - hset(avc->mapDV, newDV); - avc->states &= ~CDirty; - } + if ((!(afs_dvhack || foreign) && hsame(avc->m.DataVersion, newDV)) + || ((afs_dvhack || foreign) && (origCBs == afs_allCBs))) { + hset(avc->mapDV, newDV); + avc->states &= ~CDirty; + } } osi_FreeLargeSpace(dcList); @@ -662,8 +801,8 @@ afs_StoreAllSegments(avc, areq, sync) code = 0; return code; - -} /*afs_StoreAllSegments (new 03/02/94)*/ + +} /*afs_StoreAllSegments (new 03/02/94) */ /* @@ -674,33 +813,30 @@ afs_StoreAllSegments(avc, areq, sync) * * Parameters: * avc : Pointer to vcache entry. - * asetLock : If true, we are to set the afs_xdcache lock; otherwise, - * the caller has already done it. * * Environment: * For example, called after an error has been detected. Called - * with avc write-locked. + * with avc write-locked, and afs_xdcache unheld. */ - -afs_InvalidateAllSegments(avc, asetLock) - struct vcache *avc; - int asetLock; - -{ /*afs_InvalidateAllSegments*/ +int +afs_InvalidateAllSegments(struct vcache *avc) +{ struct dcache *tdc; afs_int32 hash; afs_int32 index; + struct dcache **dcList; + int i, dcListMax, dcListCount; AFS_STATCNT(afs_InvalidateAllSegments); afs_Trace2(afs_iclSetp, CM_TRACE_INVALL, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->m.Length); + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length)); hash = DVHash(&avc->fid); - avc->truncPos = AFS_NOTRUNC; /* don't truncate later */ - avc->states &= ~CExtendedFile; /* not any more */ + avc->truncPos = AFS_NOTRUNC; /* don't truncate later */ + avc->states &= ~CExtendedFile; /* not any more */ ObtainWriteLock(&afs_xcbhash, 459); afs_DequeueCallback(avc); - avc->states &= ~(CStatd|CDirty); /* mark status information as bad, too */ + avc->states &= ~(CStatd | CDirty); /* mark status information as bad, too */ ReleaseWriteLock(&afs_xcbhash); if (avc->fid.Fid.Vnode & 1 || (vType(avc) == VDIR)) osi_dnlc_purgedp(avc); @@ -713,31 +849,62 @@ afs_InvalidateAllSegments(avc, asetLock) * Block out others from screwing with this table; is a read lock * sufficient? */ - if (asetLock) MObtainWriteLock(&afs_xdcache,286); - for(index = afs_dvhashTbl[hash]; index != NULLIDX;) { - if (afs_indexUnique[index] == avc->fid.Fid.Unique) { - tdc = afs_GetDSlot(index, 0); - if (!FidCmp(&tdc->f.fid, &avc->fid)) { - /* same file? we'll zap it */ - if (afs_indexFlags[index] & IFDataMod) { - afs_stats_cmperf.cacheCurrDirtyChunks--; - /* don't write it back */ - afs_indexFlags[index] &= ~IFDataMod; - } - afs_indexFlags[index] &= ~IFAnyPages; - ZapDCE(tdc); - if (vType(avc) == VDIR) { - DZap(&tdc->f.inode); + MObtainWriteLock(&afs_xdcache, 286); + dcListMax = 0; + + for (index = afs_dvhashTbl[hash]; index != NULLIDX;) { + if (afs_indexUnique[index] == avc->fid.Fid.Unique) { + tdc = afs_GetDSlot(index, 0); + ReleaseReadLock(&tdc->tlock); + if (!FidCmp(&tdc->f.fid, &avc->fid)) + dcListMax++; + afs_PutDCache(tdc); + } + index = afs_dvnextTbl[index]; + } + + dcList = osi_Alloc(dcListMax * sizeof(struct dcache *)); + dcListCount = 0; + + for (index = afs_dvhashTbl[hash]; index != NULLIDX;) { + if (afs_indexUnique[index] == avc->fid.Fid.Unique) { + tdc = afs_GetDSlot(index, 0); + ReleaseReadLock(&tdc->tlock); + if (!FidCmp(&tdc->f.fid, &avc->fid)) { + /* same file? we'll zap it */ + if (afs_indexFlags[index] & IFDataMod) { + afs_stats_cmperf.cacheCurrDirtyChunks--; + /* don't write it back */ + afs_indexFlags[index] &= ~IFDataMod; + } + afs_indexFlags[index] &= ~IFAnyPages; + if (dcListCount < dcListMax) + dcList[dcListCount++] = tdc; + else + afs_PutDCache(tdc); + } else { + afs_PutDCache(tdc); } } - lockedPutDCache(tdc); - } - index = afs_dvnextTbl[index]; + index = afs_dvnextTbl[index]; } - if (asetLock) MReleaseWriteLock(&afs_xdcache); - return 0; + MReleaseWriteLock(&afs_xdcache); -} /*afs_InvalidateAllSegments*/ + for (i = 0; i < dcListCount; i++) { + tdc = dcList[i]; + + ObtainWriteLock(&tdc->lock, 679); + ZapDCE(tdc); + if (vType(avc) == VDIR) + DZap(&tdc->f.inode); + ReleaseWriteLock(&tdc->lock); + afs_PutDCache(tdc); + } + + osi_Free(dcList, dcListMax * sizeof(struct dcache *)); + + return 0; +} /* @@ -755,20 +922,23 @@ afs_InvalidateAllSegments(avc, asetLock) * Called with avc write-locked; in VFS40 systems, pvnLock is also * held. */ -afs_TruncateAllSegments(avc, alen, areq, acred) - afs_int32 alen; - register struct vcache *avc; - struct vrequest *areq; - struct AFS_UCRED *acred; -{ /*afs_TruncateAllSegments*/ - +int +afs_TruncateAllSegments(register struct vcache *avc, afs_size_t alen, + struct vrequest *areq, struct AFS_UCRED *acred) +{ register struct dcache *tdc; register afs_int32 code; register afs_int32 index; afs_int32 newSize; + int dcCount, dcPos; + struct dcache **tdcArray; + AFS_STATCNT(afs_TruncateAllSegments); avc->m.Date = osi_Time(); + afs_Trace3(afs_iclSetp, CM_TRACE_TRUNCALL, ICL_TYPE_POINTER, avc, + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length), + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(alen)); if (alen >= avc->m.Length) { /* * Special speedup since Sun's vm extends the file this way; @@ -781,14 +951,8 @@ afs_TruncateAllSegments(avc, alen, areq, acred) */ avc->states |= CExtendedFile; avc->m.Length = alen; - afs_Trace3(afs_iclSetp, CM_TRACE_TRUNCALL1, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->m.Length, ICL_TYPE_INT32, alen); return 0; } - - afs_Trace3(afs_iclSetp, CM_TRACE_TRUNCALL2, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->m.Length, ICL_TYPE_INT32, alen); - #if (defined(AFS_SUN5_ENV)) /* Zero unused portion of last page */ @@ -809,33 +973,80 @@ afs_TruncateAllSegments(avc, alen, areq, acred) osi_VM_Truncate(avc, alen, acred); AFS_GLOCK(); - ObtainWriteLock(&avc->lock,79); + ObtainWriteLock(&avc->lock, 79); avc->m.Length = alen; - - if (alen < avc->truncPos) avc->truncPos = alen; + + if (alen < avc->truncPos) + avc->truncPos = alen; code = DVHash(&avc->fid); + /* block out others from screwing with this table */ - MObtainWriteLock(&afs_xdcache,287); - for(index = afs_dvhashTbl[code]; index != NULLIDX;) { - if (afs_indexUnique[index] == avc->fid.Fid.Unique) { - tdc = afs_GetDSlot(index, 0); - if (!FidCmp(&tdc->f.fid, &avc->fid)) { - /* same file, and modified, we'll store it back */ - newSize = alen - AFS_CHUNKTOBASE(tdc->f.chunk); - if (newSize < 0) newSize = 0; - if (newSize < tdc->f.chunkBytes) { - register struct osi_file *tfile; - tfile = afs_CFileOpen(tdc->f.inode); - afs_CFileTruncate(tfile, newSize); - afs_CFileClose(tfile); - afs_AdjustSize(tdc, newSize); + MObtainWriteLock(&afs_xdcache, 287); + + dcCount = 0; + for (index = afs_dvhashTbl[code]; index != NULLIDX;) { + if (afs_indexUnique[index] == avc->fid.Fid.Unique) { + tdc = afs_GetDSlot(index, 0); + ReleaseReadLock(&tdc->tlock); + if (!FidCmp(&tdc->f.fid, &avc->fid)) + dcCount++; + afs_PutDCache(tdc); + } + index = afs_dvnextTbl[index]; + } + + /* Now allocate space where we can save those dcache entries, and + * do a second pass over them.. Since we're holding xdcache, it + * shouldn't be changing. + */ + tdcArray = osi_Alloc(dcCount * sizeof(struct dcache *)); + dcPos = 0; + + for (index = afs_dvhashTbl[code]; index != NULLIDX;) { + if (afs_indexUnique[index] == avc->fid.Fid.Unique) { + tdc = afs_GetDSlot(index, 0); + ReleaseReadLock(&tdc->tlock); + if (!FidCmp(&tdc->f.fid, &avc->fid)) { + /* same file, and modified, we'll store it back */ + if (dcPos < dcCount) { + tdcArray[dcPos++] = tdc; + } else { + afs_PutDCache(tdc); + } + } else { + afs_PutDCache(tdc); } } - lockedPutDCache(tdc); - } - index = afs_dvnextTbl[index]; + index = afs_dvnextTbl[index]; } + + MReleaseWriteLock(&afs_xdcache); + + /* Now we loop over the array of dcache entries and truncate them */ + for (index = 0; index < dcPos; index++) { + struct osi_file *tfile; + + tdc = tdcArray[index]; + + newSize = alen - AFS_CHUNKTOBASE(tdc->f.chunk); + if (newSize < 0) + newSize = 0; + ObtainSharedLock(&tdc->lock, 672); + if (newSize < tdc->f.chunkBytes) { + UpgradeSToWLock(&tdc->lock, 673); + tfile = afs_CFileOpen(tdc->f.inode); + afs_CFileTruncate(tfile, newSize); + afs_CFileClose(tfile); + afs_AdjustSize(tdc, newSize); + ConvertWToSLock(&tdc->lock); + } + ReleaseSharedLock(&tdc->lock); + afs_PutDCache(tdc); + } + + osi_Free(tdcArray, dcCount * sizeof(struct dcache *)); + #if (defined(AFS_SUN5_ENV)) ObtainWriteLock(&avc->vlock, 547); if (--avc->activeV == 0 && (avc->vstates & VRevokeWait)) { @@ -844,9 +1055,5 @@ afs_TruncateAllSegments(avc, alen, areq, acred) } ReleaseWriteLock(&avc->vlock); #endif - MReleaseWriteLock(&afs_xdcache); return 0; - -} /*afs_TruncateAllSegments*/ - - +} diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index a40a8acc6..4688ac977 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -30,12 +30,13 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_server.c,v 1.1.1.15 2003/07/30 17:08:01 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_server.c,v 1.29 2004/05/08 04:23:56 shadow Exp $"); -#include "../afs/stds.h" -#include "../afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/stds.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ #if !defined(UKERNEL) #if !defined(AFS_LINUX20_ENV) @@ -44,7 +45,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_server.c,v 1.1.1.15 2003/07/30 #include #ifdef AFS_SGI62_ENV -#include "../h/hashing.h" +#include "h/hashing.h" #endif #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV) #include @@ -54,8 +55,9 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_server.c,v 1.1.1.15 2003/07/30 #endif #endif /* !defined(UKERNEL) */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ +#include "rx/rx_multi.h" #if defined(AFS_SUN56_ENV) #include @@ -70,24 +72,18 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_server.c,v 1.1.1.15 2003/07/30 #include #endif -/* Imported variables */ -extern afs_int32 afs_setTime; -extern afs_int32 afs_waitForever; -extern short afs_waitForeverCount; - - /* Exported variables */ -afs_rwlock_t afs_xserver; /* allocation lock for servers */ -struct server *afs_setTimeHost=0; /* last host we used for time */ -struct server *afs_servers[NSERVERS]; /* Hashed by server`s uuid & 1st ip */ -afs_rwlock_t afs_xsrvAddr; /* allocation lock for srvAddrs */ -struct srvAddr *afs_srvAddrs[NSERVERS]; /* Hashed by server's ip */ +afs_rwlock_t afs_xserver; /* allocation lock for servers */ +struct server *afs_setTimeHost = 0; /* last host we used for time */ +struct server *afs_servers[NSERVERS]; /* Hashed by server`s uuid & 1st ip */ +afs_rwlock_t afs_xsrvAddr; /* allocation lock for srvAddrs */ +struct srvAddr *afs_srvAddrs[NSERVERS]; /* Hashed by server's ip */ /* debugging aids - number of alloc'd server and srvAddr structs. */ -int afs_reuseServers = 0; +int afs_reuseServers = 0; int afs_reuseSrvAddrs = 0; -int afs_totalServers = 0; +int afs_totalServers = 0; int afs_totalSrvAddrs = 0; @@ -133,20 +129,21 @@ GetUpDownStats(struct server *srv) * As advertised. *------------------------------------------------------------------------*/ -void afs_MarkServerUpOrDown(struct srvAddr *sa, int a_isDown) +void +afs_MarkServerUpOrDown(struct srvAddr *sa, int a_isDown) { register struct server *a_serverP = sa->server; register struct srvAddr *sap; - osi_timeval_t currTime, *currTimeP; /*Current time*/ - afs_int32 downTime; /*Computed downtime, in seconds*/ - struct afs_stats_SrvUpDownInfo *upDownP; /*Ptr to up/down info record*/ + osi_timeval_t currTime, *currTimeP; /*Current time */ + afs_int32 downTime; /*Computed downtime, in seconds */ + struct afs_stats_SrvUpDownInfo *upDownP; /*Ptr to up/down info record */ /* * If the server record is marked the same as the new status we've * been fed, then there isn't much to be done. */ - if (( a_isDown && (sa->sa_flags & SRVADDR_ISDOWN)) || - (!a_isDown && !(sa->sa_flags & SRVADDR_ISDOWN))) + if ((a_isDown && (sa->sa_flags & SRVADDR_ISDOWN)) + || (!a_isDown && !(sa->sa_flags & SRVADDR_ISDOWN))) return; if (a_isDown) { @@ -157,7 +154,7 @@ void afs_MarkServerUpOrDown(struct srvAddr *sa, int a_isDown) * server's up/down stats */ return; } - } + } /* * All ips are down we treat the whole server down */ @@ -169,7 +166,7 @@ void afs_MarkServerUpOrDown(struct srvAddr *sa, int a_isDown) afs_setTimeHost = 0; } else { sa->sa_flags &= ~SRVADDR_ISDOWN; - /* If any ips are up, the server is also marked up */ + /* If any ips are up, the server is also marked up */ a_serverP->flags &= ~SRVR_ISDOWN; for (sap = a_serverP->addr; sap; sap = sap->next_sa) { if (sap->sa_flags & SRVADDR_ISDOWN) { @@ -177,7 +174,7 @@ void afs_MarkServerUpOrDown(struct srvAddr *sa, int a_isDown) * server's up/down stats */ return; } - } + } } #ifndef AFS_NOSTATS /* @@ -198,7 +195,7 @@ void afs_MarkServerUpOrDown(struct srvAddr *sa, int a_isDown) (upDownP->numDownRecords)++; (upDownP->numUpRecords)--; - } /*Server being marked down*/ + } /*Server being marked down */ else { /* * Server going down -> up; remember everything about this @@ -214,70 +211,65 @@ void afs_MarkServerUpOrDown(struct srvAddr *sa, int a_isDown) if (a_serverP->numDowntimeIncidents == 1) (upDownP->numRecordsNeverDown)--; upDownP->sumOfDowntimes += downTime; - if ((upDownP->shortestDowntime == 0) || - (downTime < upDownP->shortestDowntime)) + if ((upDownP->shortestDowntime == 0) + || (downTime < upDownP->shortestDowntime)) upDownP->shortestDowntime = downTime; - if ((upDownP->longestDowntime == 0) || - (downTime > upDownP->longestDowntime)) + if ((upDownP->longestDowntime == 0) + || (downTime > upDownP->longestDowntime)) upDownP->longestDowntime = downTime; if (downTime <= AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET0) (upDownP->downDurations[0])++; - else - if (downTime <= AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET1) - (upDownP->downDurations[1])++; - else - if (downTime <= AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET2) - (upDownP->downDurations[2])++; - else - if (downTime <= AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET3) - (upDownP->downDurations[3])++; - else - if (downTime <= AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET4) - (upDownP->downDurations[4])++; - else - if (downTime <= AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET5) - (upDownP->downDurations[5])++; + else if (downTime <= AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET1) + (upDownP->downDurations[1])++; + else if (downTime <= AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET2) + (upDownP->downDurations[2])++; + else if (downTime <= AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET3) + (upDownP->downDurations[3])++; + else if (downTime <= AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET4) + (upDownP->downDurations[4])++; + else if (downTime <= AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET5) + (upDownP->downDurations[5])++; else (upDownP->downDurations[6])++; - } /*Server being marked up*/ + } /*Server being marked up */ #endif -} /*MarkServerUpOrDown*/ +} /*MarkServerUpOrDown */ -void afs_ServerDown(struct srvAddr *sa) +void +afs_ServerDown(struct srvAddr *sa) { register struct server *aserver = sa->server; - register struct srvAddr *sap; AFS_STATCNT(ServerDown); if (aserver->flags & SRVR_ISDOWN || sa->sa_flags & SRVADDR_ISDOWN) return; afs_MarkServerUpOrDown(sa, SRVR_ISDOWN); if (sa->sa_portal == aserver->cell->vlport) - print_internet_address("afs: Lost contact with volume location server ", - sa, "", 1); + print_internet_address + ("afs: Lost contact with volume location server ", sa, "", 1); else - print_internet_address("afs: Lost contact with file server ", sa, "", 1); + print_internet_address("afs: Lost contact with file server ", sa, "", + 1); -} /*ServerDown*/ +} /*ServerDown */ /* return true if we have any callback promises from this server */ -static HaveCallBacksFrom(aserver) - struct server *aserver; - +static int +HaveCallBacksFrom(struct server *aserver) { register afs_int32 now; register int i; register struct vcache *tvc; AFS_STATCNT(HaveCallBacksFrom); - now = osi_Time(); /* for checking for expired callbacks */ - for(i=0;ihnext) { + now = osi_Time(); /* for checking for expired callbacks */ + for (i = 0; i < VCSIZE; i++) { /* for all guys in the hash table */ + for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { /* * Check to see if this entry has an unexpired callback promise * from the required host @@ -289,12 +281,11 @@ static HaveCallBacksFrom(aserver) } return 0; -} /*HaveCallBacksFrom*/ +} /*HaveCallBacksFrom */ -static void CheckVLServer(sa, areq) - struct vrequest *areq; - register struct srvAddr *sa; +static void +CheckVLServer(register struct srvAddr *sa, struct vrequest *areq) { register struct server *aserver = sa->server; register struct conn *tc; @@ -302,25 +293,22 @@ static void CheckVLServer(sa, areq) AFS_STATCNT(CheckVLServer); /* Ping dead servers to see if they're back */ - if (!((aserver->flags & SRVR_ISDOWN) || (sa->sa_flags & SRVADDR_ISDOWN)) || (aserver->flags & SRVR_ISGONE)) + if (!((aserver->flags & SRVR_ISDOWN) || (sa->sa_flags & SRVADDR_ISDOWN)) + || (aserver->flags & SRVR_ISGONE)) return; if (!aserver->cell) - return; /* can't do much */ + return; /* can't do much */ - tc = afs_ConnByHost(aserver, aserver->cell->vlport, + tc = afs_ConnByHost(aserver, aserver->cell->vlport, aserver->cell->cellNum, areq, 1, SHARED_LOCK); if (!tc) return; rx_SetConnDeadTime(tc->id, 3); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); code = VL_ProbeServer(tc->id); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - rx_SetConnDeadTime(tc->id, AFS_RXDEADTIME); + RX_AFS_GLOCK(); + rx_SetConnDeadTime(tc->id, afs_rx_deadtime); afs_PutConn(tc, SHARED_LOCK); /* * If probe worked, or probe call not yet defined (for compatibility @@ -329,15 +317,15 @@ static void CheckVLServer(sa, areq) if (code == 0 || (code <= -450 && code >= -470)) { if (tc->srvr == sa) { afs_MarkServerUpOrDown(sa, 0); - print_internet_address("afs: volume location server ", - sa, " is back up", 2); + print_internet_address("afs: volume location server ", sa, + " is back up", 2); } } -} /*CheckVLServer*/ +} /*CheckVLServer */ -#ifndef AFS_MINCHANGE /* So that some can increase it in param.h */ +#ifndef AFS_MINCHANGE /* So that some can increase it in param.h */ #define AFS_MINCHANGE 2 /* min change we'll bother with */ #endif #ifndef AFS_MAXCHANGEBACK @@ -368,18 +356,17 @@ static void CheckVLServer(sa, areq) * entries. *------------------------------------------------------------------------*/ -void afs_CountServers() - -{ /*afs_CountServers*/ - - int currIdx; /*Curr idx into srv table*/ - struct server *currSrvP; /*Ptr to curr server record*/ - afs_int32 currChainLen; /*Length of curr hash chain*/ - osi_timeval_t currTime; /*Current time*/ - osi_timeval_t *currTimeP; /*Ptr to above*/ - afs_int32 srvRecordAge; /*Age of server record, in secs*/ +void +afs_CountServers(void) +{ + int currIdx; /*Curr idx into srv table */ + struct server *currSrvP; /*Ptr to curr server record */ + afs_int32 currChainLen; /*Length of curr hash chain */ + osi_timeval_t currTime; /*Current time */ + osi_timeval_t *currTimeP; /*Ptr to above */ + afs_int32 srvRecordAge; /*Age of server record, in secs */ struct afs_stats_SrvUpDownInfo *upDownP; /*Ptr to current up/down - info being manipulated*/ + * info being manipulated */ /* * Write-lock the server table so we don't get any interference. @@ -393,25 +380,29 @@ void afs_CountServers() */ afs_stats_cmperf.srvMaxChainLength = 0; - afs_stats_cmperf.fs_UpDown[0].sumOfRecordAges = 0; + afs_stats_cmperf.fs_UpDown[0].sumOfRecordAges = 0; afs_stats_cmperf.fs_UpDown[0].ageOfYoungestRecord = 0; - afs_stats_cmperf.fs_UpDown[0].ageOfOldestRecord = 0; - memset((char *) afs_stats_cmperf.fs_UpDown[0].downIncidents, 0, AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32)); + afs_stats_cmperf.fs_UpDown[0].ageOfOldestRecord = 0; + memset((char *)afs_stats_cmperf.fs_UpDown[0].downIncidents, 0, + AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32)); - afs_stats_cmperf.fs_UpDown[1].sumOfRecordAges = 0; + afs_stats_cmperf.fs_UpDown[1].sumOfRecordAges = 0; afs_stats_cmperf.fs_UpDown[1].ageOfYoungestRecord = 0; - afs_stats_cmperf.fs_UpDown[1].ageOfOldestRecord = 0; - memset((char *) afs_stats_cmperf.fs_UpDown[1].downIncidents, 0, AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32)); + afs_stats_cmperf.fs_UpDown[1].ageOfOldestRecord = 0; + memset((char *)afs_stats_cmperf.fs_UpDown[1].downIncidents, 0, + AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32)); - afs_stats_cmperf.vl_UpDown[0].sumOfRecordAges = 0; + afs_stats_cmperf.vl_UpDown[0].sumOfRecordAges = 0; afs_stats_cmperf.vl_UpDown[0].ageOfYoungestRecord = 0; - afs_stats_cmperf.vl_UpDown[0].ageOfOldestRecord = 0; - memset((char *) afs_stats_cmperf.vl_UpDown[0].downIncidents, 0, AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32)); + afs_stats_cmperf.vl_UpDown[0].ageOfOldestRecord = 0; + memset((char *)afs_stats_cmperf.vl_UpDown[0].downIncidents, 0, + AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32)); - afs_stats_cmperf.vl_UpDown[1].sumOfRecordAges = 0; + afs_stats_cmperf.vl_UpDown[1].sumOfRecordAges = 0; afs_stats_cmperf.vl_UpDown[1].ageOfYoungestRecord = 0; - afs_stats_cmperf.vl_UpDown[1].ageOfOldestRecord = 0; - memset((char *) afs_stats_cmperf.vl_UpDown[1].downIncidents, 0, AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32)); + afs_stats_cmperf.vl_UpDown[1].ageOfOldestRecord = 0; + memset((char *)afs_stats_cmperf.vl_UpDown[1].downIncidents, 0, + AFS_STATS_NUM_DOWNTIME_INCIDENTS_BUCKETS * sizeof(afs_int32)); /* * Compute the current time, used to figure out server record ages. @@ -424,7 +415,8 @@ void afs_CountServers() */ for (currIdx = 0; currIdx < NSERVERS; currIdx++) { currChainLen = 0; - for (currSrvP = afs_servers[currIdx]; currSrvP; currSrvP = currSrvP->next) { + for (currSrvP = afs_servers[currIdx]; currSrvP; + currSrvP = currSrvP->next) { /* * Bump the current chain length. */ @@ -434,8 +426,8 @@ void afs_CountServers() * Any further tallying for this record will only be done if it has * been activated. */ - if ( (currSrvP->flags & AFS_SERVER_FLAG_ACTIVATED) && - currSrvP->addr && currSrvP->cell ) { + if ((currSrvP->flags & AFS_SERVER_FLAG_ACTIVATED) + && currSrvP->addr && currSrvP->cell) { /* * Compute the current server record's age, then remember it @@ -444,38 +436,34 @@ void afs_CountServers() srvRecordAge = currTime.tv_sec - currSrvP->activationTime; upDownP = GetUpDownStats(currSrvP); upDownP->sumOfRecordAges += srvRecordAge; - if ((upDownP->ageOfYoungestRecord == 0) || - (srvRecordAge < upDownP->ageOfYoungestRecord)) + if ((upDownP->ageOfYoungestRecord == 0) + || (srvRecordAge < upDownP->ageOfYoungestRecord)) upDownP->ageOfYoungestRecord = srvRecordAge; - if ((upDownP->ageOfOldestRecord == 0) || - (srvRecordAge > upDownP->ageOfOldestRecord)) + if ((upDownP->ageOfOldestRecord == 0) + || (srvRecordAge > upDownP->ageOfOldestRecord)) upDownP->ageOfOldestRecord = srvRecordAge; - if (currSrvP->numDowntimeIncidents <= - AFS_STATS_MAX_DOWNTIME_INCIDENTS_BUCKET0) - (upDownP->downIncidents[0])++; - else - if (currSrvP->numDowntimeIncidents <= - AFS_STATS_MAX_DOWNTIME_INCIDENTS_BUCKET1) - (upDownP->downIncidents[1])++; - else - if (currSrvP->numDowntimeIncidents <= - AFS_STATS_MAX_DOWNTIME_INCIDENTS_BUCKET2) - (upDownP->downIncidents[2])++; - else - if (currSrvP->numDowntimeIncidents <= - AFS_STATS_MAX_DOWNTIME_INCIDENTS_BUCKET3) - (upDownP->downIncidents[3])++; - else - if (currSrvP->numDowntimeIncidents <= - AFS_STATS_MAX_DOWNTIME_INCIDENTS_BUCKET4) - (upDownP->downIncidents[4])++; - else - (upDownP->downIncidents[5])++; - - - } /*Current server has been active*/ - } /*Walk this chain*/ + if (currSrvP->numDowntimeIncidents <= + AFS_STATS_MAX_DOWNTIME_INCIDENTS_BUCKET0) + (upDownP->downIncidents[0])++; + else if (currSrvP->numDowntimeIncidents <= + AFS_STATS_MAX_DOWNTIME_INCIDENTS_BUCKET1) + (upDownP->downIncidents[1])++; + else if (currSrvP->numDowntimeIncidents <= + AFS_STATS_MAX_DOWNTIME_INCIDENTS_BUCKET2) + (upDownP->downIncidents[2])++; + else if (currSrvP->numDowntimeIncidents <= + AFS_STATS_MAX_DOWNTIME_INCIDENTS_BUCKET3) + (upDownP->downIncidents[3])++; + else if (currSrvP->numDowntimeIncidents <= + AFS_STATS_MAX_DOWNTIME_INCIDENTS_BUCKET4) + (upDownP->downIncidents[4])++; + else + (upDownP->downIncidents[5])++; + + + } /*Current server has been active */ + } /*Walk this chain */ /* * Before advancing to the next chain, remember facts about this one. @@ -489,22 +477,20 @@ void afs_CountServers() afs_stats_cmperf.srvMaxChainLength = currChainLen; if (currChainLen > afs_stats_cmperf.srvMaxChainLengthHWM) afs_stats_cmperf.srvMaxChainLengthHWM = currChainLen; - } /*Update chain length maximum*/ - } /*For each hash chain*/ + } /*Update chain length maximum */ + } /*For each hash chain */ /* * We're done. Unlock the server table before returning to our caller. */ ReleaseReadLock(&afs_xserver); -} /*afs_CountServers*/ +} /*afs_CountServers */ /* check down servers (if adown), or running servers (if !adown) */ -void afs_CheckServers(adown, acellp) - struct cell *acellp; - int adown; - +void +afs_CheckServers(int adown, struct cell *acellp) { struct vrequest treq; struct server *ts; @@ -519,33 +505,52 @@ void afs_CheckServers(adown, acellp) char tbuffer[CVBS]; int srvAddrCount; struct srvAddr **addrs; + struct conn **conns; + int nconns; + struct rx_connection **rxconns; + int nrxconns; + afs_int32 *conntimer, *deltas; XSTATS_DECLS; AFS_STATCNT(afs_CheckServers); - if (code = afs_InitReq(&treq, &afs_osi_cred)) return; - ObtainReadLock(&afs_xserver); /* Necessary? */ - ObtainReadLock(&afs_xsrvAddr); + + conns = (struct conn **)0; + rxconns = (struct rx_connection **) 0; + conntimer = 0; + nconns = 0; + + if ((code = afs_InitReq(&treq, afs_osi_credp))) + return; + ObtainReadLock(&afs_xserver); /* Necessary? */ + ObtainReadLock(&afs_xsrvAddr); srvAddrCount = 0; - for (i=0;inext_bkt) { + for (i = 0; i < NSERVERS; i++) { + for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) { srvAddrCount++; } } addrs = afs_osi_Alloc(srvAddrCount * sizeof(*addrs)); j = 0; - for (i=0;inext_bkt) { - if (j >= srvAddrCount) break; + for (i = 0; i < NSERVERS; i++) { + for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) { + if (j >= srvAddrCount) + break; addrs[j++] = sa; } } - ReleaseReadLock(&afs_xsrvAddr); + ReleaseReadLock(&afs_xsrvAddr); ReleaseReadLock(&afs_xserver); - for (i=0; iserver; if (!ts) @@ -557,8 +562,8 @@ void afs_CheckServers(adown, acellp) if (acellp && acellp != ts->cell) continue; - if ((!adown && (sa->sa_flags & SRVADDR_ISDOWN)) || - (adown && !(sa->sa_flags & SRVADDR_ISDOWN))) + if ((!adown && (sa->sa_flags & SRVADDR_ISDOWN)) + || (adown && !(sa->sa_flags & SRVADDR_ISDOWN))) continue; /* check vlserver with special code */ @@ -567,115 +572,150 @@ void afs_CheckServers(adown, acellp) continue; } - if (!ts->cell) /* not really an active server, anyway, it must */ - continue; /* have just been added by setsprefs */ + if (!ts->cell) /* not really an active server, anyway, it must */ + continue; /* have just been added by setsprefs */ /* get a connection, even if host is down; bumps conn ref count */ tu = afs_GetUser(treq.uid, ts->cell->cellNum, SHARED_LOCK); tc = afs_ConnBySA(sa, ts->cell->fsport, ts->cell->cellNum, tu, - 1/*force*/, 1/*create*/, SHARED_LOCK); + 1 /*force */ , 1 /*create */ , SHARED_LOCK); afs_PutUser(tu, SHARED_LOCK); - if (!tc) continue; + if (!tc) + continue; - if ((sa->sa_flags & SRVADDR_ISDOWN) || HaveCallBacksFrom(ts) || - (tc->srvr->server == afs_setTimeHost)) { + if ((sa->sa_flags & SRVADDR_ISDOWN) || HaveCallBacksFrom(sa->server) + || (tc->srvr->server == afs_setTimeHost)) { + conns[nconns]=tc; + rxconns[nconns]=tc->id; if (sa->sa_flags & SRVADDR_ISDOWN) { rx_SetConnDeadTime(tc->id, 3); - setTimer = 1; + conntimer[nconns]=1; } else { - setTimer = 0; + conntimer[nconns]=0; } + nconns++; + } + } /* Outer loop over addrs */ - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GETTIME); - start = osi_Time(); /* time the gettimeofday call */ -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_GetTime(tc->id, &tv.tv_sec, &tv.tv_usec); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + start = osi_Time(); /* time the gettimeofday call */ + AFS_GUNLOCK(); + multi_Rx(rxconns,nconns) + { + tv.tv_sec = tv.tv_usec = 0; + multi_RXAFS_GetTime(&tv.tv_sec, &tv.tv_usec); + tc = conns[multi_i]; + sa = tc->srvr; + if (conntimer[multi_i] == 0) + rx_SetConnDeadTime(tc->id, AFS_RXDEADTIME); end = osi_Time(); - XSTATS_END_TIME; - /* - * If we're supposed to set the time, and the call worked - * quickly (same second response) and this is the host we - * use for the time and the time is really different, then - * really set the time - */ - if (code == 0 && start == end && afs_setTime != 0 && - (tc->srvr->server == afs_setTimeHost || - /* Sync only to a server in the local cell */ - (afs_setTimeHost == (struct server *)0 && - afs_IsPrimaryCell(ts->cell)))) { - - char msgbuf[90]; /* strlen("afs: setting clock...") + slop */ + if ((start == end) && !multi_error) + deltas[multi_i] = end - tv.tv_sec; + if (( multi_error >= 0 ) && (sa->sa_flags & SRVADDR_ISDOWN) && (tc->srvr == sa)) { + /* server back up */ + print_internet_address("afs: file server ", sa, " is back up", 2); + + ObtainWriteLock(&afs_xserver, 244); + ObtainWriteLock(&afs_xsrvAddr, 245); + afs_MarkServerUpOrDown(sa, 0); + ReleaseWriteLock(&afs_xsrvAddr); + ReleaseWriteLock(&afs_xserver); + + if (afs_waitForeverCount) { + afs_osi_Wakeup(&afs_waitForever); + } + } else { + if (multi_error < 0) { + /* server crashed */ + afs_ServerDown(sa); + ForceNewConnections(sa); /* multi homed clients */ + } + } + + } multi_End; + AFS_GLOCK(); + + /* + * If we're supposed to set the time, and the call worked + * quickly (same second response) and this is the host we + * use for the time and the time is really different, then + * really set the time + */ + if (afs_setTime != 0) { + for (i=0; isrvr; + + if ((tc->srvr->server == afs_setTimeHost || + /* Sync only to a server in the local cell */ + (afs_setTimeHost == (struct server *)0 && + afs_IsPrimaryCell(sa->server->cell)))) { /* set the time */ + char msgbuf[90]; /* strlen("afs: setting clock...") + slop */ delta = end - tv.tv_sec; /* how many secs fast we are */ + + afs_setTimeHost = tc->srvr->server; /* see if clock has changed enough to make it worthwhile */ if (delta >= AFS_MINCHANGE || delta <= -AFS_MINCHANGE) { + end = osi_Time(); if (delta > AFS_MAXCHANGEBACK) { /* setting clock too far back, just do it a little */ tv.tv_sec = end - AFS_MAXCHANGEBACK; + } else { + tv.tv_sec = end - delta; } afs_osi_SetTime(&tv); if (delta > 0) { strcpy(msgbuf, "afs: setting clock back "); if (delta > AFS_MAXCHANGEBACK) { - afs_strcat(msgbuf, afs_cv2string(&tbuffer[CVBS], AFS_MAXCHANGEBACK)); + afs_strcat(msgbuf, + afs_cv2string(&tbuffer[CVBS], + AFS_MAXCHANGEBACK)); afs_strcat(msgbuf, " seconds (of "); - afs_strcat(msgbuf, afs_cv2string(&tbuffer[CVBS], delta - AFS_MAXCHANGEBACK)); + afs_strcat(msgbuf, + afs_cv2string(&tbuffer[CVBS], + delta - + AFS_MAXCHANGEBACK)); afs_strcat(msgbuf, ", via "); - print_internet_address(msgbuf, sa, "); clock is still fast.", 0); + print_internet_address(msgbuf, sa, + "); clock is still fast.", + 0); } else { - afs_strcat(msgbuf, afs_cv2string(&tbuffer[CVBS], delta)); + afs_strcat(msgbuf, + afs_cv2string(&tbuffer[CVBS], delta)); afs_strcat(msgbuf, " seconds (via "); print_internet_address(msgbuf, sa, ").", 0); } } else { strcpy(msgbuf, "afs: setting clock ahead "); - afs_strcat(msgbuf, afs_cv2string(&tbuffer[CVBS], -delta)); + afs_strcat(msgbuf, + afs_cv2string(&tbuffer[CVBS], -delta)); afs_strcat(msgbuf, " seconds (via "); print_internet_address(msgbuf, sa, ").", 0); } - } - afs_setTimeHost = tc->srvr->server; - } - if (setTimer) - rx_SetConnDeadTime(tc->id, AFS_RXDEADTIME); - if (code >= 0 && (sa->sa_flags & SRVADDR_ISDOWN) && (tc->srvr == sa)) { - /* server back up */ - print_internet_address("afs: file server ", sa, " is back up", 2); - - ObtainWriteLock(&afs_xserver, 244); - ObtainWriteLock(&afs_xsrvAddr, 245); - afs_MarkServerUpOrDown(sa, 0); - ReleaseWriteLock(&afs_xsrvAddr); - ReleaseWriteLock(&afs_xserver); - - if (afs_waitForeverCount) { - afs_osi_Wakeup(&afs_waitForever); - } - } else { - if (code < 0) { - /* server crashed */ - afs_ServerDown(sa); - ForceNewConnections(sa); /* multi homed clients */ + /* We're only going to set it once; why bother looping? */ + break; } } } - - afs_PutConn(tc, SHARED_LOCK); /* done with it now */ - } /* Outer loop over addrs */ - + } + for (i = 0; i < nconns; i++) { + afs_PutConn(conns[i], SHARED_LOCK); /* done with it now */ + } + afs_osi_Free(addrs, srvAddrCount * sizeof(*addrs)); - + afs_osi_Free(conns, j * sizeof(struct conn *)); + afs_osi_Free(rxconns, j * sizeof(struct rx_connection *)); + afs_osi_Free(conntimer, j * sizeof(afs_int32)); + afs_osi_Free(deltas, j * sizeof(afs_int32)); + } /*afs_CheckServers*/ /* find a server structure given the host address */ -struct server *afs_FindServer (afs_int32 aserver, ushort aport, - afsUUID *uuidp, afs_int32 locktype) +struct server * +afs_FindServer(afs_int32 aserver, ushort aport, afsUUID * uuidp, + afs_int32 locktype) { struct server *ts; struct srvAddr *sa; @@ -685,22 +725,23 @@ struct server *afs_FindServer (afs_int32 aserver, ushort aport, if (uuidp) { i = afs_uuid_hash(uuidp) % NSERVERS; for (ts = afs_servers[i]; ts; ts = ts->next) { - if ( (ts->flags & SRVR_MULTIHOMED) && - (memcmp((char *)uuidp, (char *)&ts->sr_uuid, sizeof(*uuidp)) == 0) && - (!ts->addr || (ts->addr->sa_portal == aport)) ) + if ((ts->flags & SRVR_MULTIHOMED) + && + (memcmp((char *)uuidp, (char *)&ts->sr_uuid, sizeof(*uuidp)) + == 0) && (!ts->addr || (ts->addr->sa_portal == aport))) return ts; } } else { i = SHash(aserver); for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) { if ((sa->sa_ip == aserver) && (sa->sa_portal == aport)) { - return sa->server; + return sa->server; } } } - return (struct server *)0; + return NULL; -} /*afs_FindServer*/ +} /*afs_FindServer */ /* some code for creating new server structs and setting preferences follows @@ -732,25 +773,24 @@ NB: Has to be unsigned, since shifts on signed quantities may preserve */ #define ranstage(x) (x)= (afs_uint32) (3141592621U*((afs_uint32)x)+1) -extern afs_int32 rxi_getaddr(); - -unsigned int afs_random() +unsigned int +afs_random(void) { static afs_int32 state = 0; register int i; AFS_STATCNT(afs_random); if (!state) { - osi_timeval_t t; + osi_timeval_t t; osi_GetTime(&t); /* * 0xfffffff0 was changed to (~0 << 4) since it works no matter how many * bits are in a tv_usec */ - state = (t.tv_usec & (~0 << 4) ) + (rxi_getaddr() & 0xff); + state = (t.tv_usec & (~0 << 4)) + (rxi_getaddr() & 0xff); state += (t.tv_sec & 0xff); - for (i=0;i<30;i++) { + for (i = 0; i < 30; i++) { ranstage(state); } } @@ -758,7 +798,7 @@ unsigned int afs_random() ranstage(state); return (state); -} /*afs_random*/ +} /*afs_random */ /* returns int 0..14 using the high bits of a pseudo-random number instead of the low bits, as the low bits are "less random" than the high ones... @@ -766,85 +806,90 @@ unsigned int afs_random() need to multiply by something with lots of ones in it, so multiply by 8 or 16 is right out. */ -int afs_randomMod15() +int +afs_randomMod15(void) { -afs_uint32 temp; + afs_uint32 temp; -temp = afs_random() >> 4; -temp = (temp *15) >> 28; + temp = afs_random() >> 4; + temp = (temp * 15) >> 28; -return temp; + return temp; } -int afs_randomMod127() +int +afs_randomMod127(void) { -afs_uint32 temp; + afs_uint32 temp; -temp = afs_random() >> 7; -temp = (temp *127) >> 25; + temp = afs_random() >> 7; + temp = (temp * 127) >> 25; -return temp; + return temp; } /* afs_SortOneServer() * Sort all of the srvAddrs, of a server struct, by rank from low to high. */ -void afs_SortOneServer(struct server *asp) +void +afs_SortOneServer(struct server *asp) { - struct srvAddr **rootsa, *lowsa, *tsa, *lowprev; - int lowrank, rank; - - for (rootsa=&(asp->addr); *rootsa; rootsa=&(lowsa->next_sa)) { - lowprev = (struct srvAddr *)0; - lowsa = *rootsa; /* lowest sa is the first one */ - lowrank = lowsa->sa_iprank; - - for (tsa=*rootsa; tsa->next_sa; tsa=tsa->next_sa) { - rank = tsa->next_sa->sa_iprank; - if (rank < lowrank) { - lowprev = tsa; - lowsa = tsa->next_sa; - lowrank = lowsa->sa_iprank; - } - } - if (lowprev) { /* found one lower, so rearrange them */ - lowprev->next_sa = lowsa->next_sa; - lowsa->next_sa = *rootsa; - *rootsa = lowsa; - } - } + struct srvAddr **rootsa, *lowsa, *tsa, *lowprev; + int lowrank, rank; + + for (rootsa = &(asp->addr); *rootsa; rootsa = &(lowsa->next_sa)) { + lowprev = NULL; + lowsa = *rootsa; /* lowest sa is the first one */ + lowrank = lowsa->sa_iprank; + + for (tsa = *rootsa; tsa->next_sa; tsa = tsa->next_sa) { + rank = tsa->next_sa->sa_iprank; + if (rank < lowrank) { + lowprev = tsa; + lowsa = tsa->next_sa; + lowrank = lowsa->sa_iprank; + } + } + if (lowprev) { /* found one lower, so rearrange them */ + lowprev->next_sa = lowsa->next_sa; + lowsa->next_sa = *rootsa; + *rootsa = lowsa; + } + } } - + /* afs_SortServer() * Sort the pointer to servers by the server's rank (its lowest rank). * It is assumed that the server already has its IP addrs sorted (the * first being its lowest rank: afs_GetServer() calls afs_SortOneServer()). */ -void afs_SortServers(struct server *aservers[], int count) +void +afs_SortServers(struct server *aservers[], int count) { struct server *ts; int i, j, low; AFS_STATCNT(afs_SortServers); - for (i=0; iaddr)) - break; - if ((!aservers[low]) || (!aservers[low]->addr)) - break; - if (aservers[j]->addr->sa_iprank < aservers[low]->addr->sa_iprank) { - low = j; - } - } - if (low != i) { - ts = aservers[i]; - aservers[i] = aservers[low]; - aservers[low] = ts; - } + for (i = 0; i < count; i++) { + if (!aservers[i]) + break; + for (low = i, j = i + 1; j <= count; j++) { + if ((!aservers[j]) || (!aservers[j]->addr)) + break; + if ((!aservers[low]) || (!aservers[low]->addr)) + break; + if (aservers[j]->addr->sa_iprank < aservers[low]->addr->sa_iprank) { + low = j; + } + } + if (low != i) { + ts = aservers[i]; + aservers[i] = aservers[low]; + aservers[low] = ts; + } } -} /*afs_SortServers*/ +} /*afs_SortServers */ /* afs_SetServerPrefs is rather system-dependent. It pokes around in kernel data structures to determine what the local IP addresses and subnet masks @@ -891,111 +936,105 @@ void afs_SortServers(struct server *aservers[], int count) #define USEIFADDR - + #if defined(AFS_SUN5_ENV) && ! defined(AFS_SUN56_ENV) #include /* IP interface structure, one per local address */ -typedef struct ipif_s { /**/ - struct ipif_s * ipif_next; - struct ill_s * ipif_ill; /* Back pointer to our ill */ - long ipif_id; /* Logical unit number */ - u_int ipif_mtu; /* Starts at ipif_ill->ill_max_frag */ - afs_int32 ipif_local_addr; /* Local IP address for this if. */ - afs_int32 ipif_net_mask; /* Net mask for this interface. */ - afs_int32 ipif_broadcast_addr; /* Broadcast addr for this interface. */ - afs_int32 ipif_pp_dst_addr; /* Point-to-point dest address. */ - u_int ipif_flags; /* Interface flags. */ - u_int ipif_metric; /* BSD if metric, for compatibility. */ - u_int ipif_ire_type; /* LOCAL or LOOPBACK */ - mblk_t * ipif_arp_down_mp; /* Allocated at time arp comes up to - * prevent awkward out of mem condition - * later - */ - mblk_t * ipif_saved_ire_mp; /* Allocated for each extra IRE_SUBNET/ - * RESOLVER on this interface so that - * they can survive ifconfig down. - */ - /* - * The packet counts in the ipif contain the sum of the - * packet counts in dead IREs that were affiliated with - * this ipif. - */ - u_long ipif_fo_pkt_count; /* Forwarded thru our dead IREs */ - u_long ipif_ib_pkt_count; /* Inbound packets for our dead IREs */ - u_long ipif_ob_pkt_count; /* Outbound packets to our dead IREs */ - unsigned int - ipif_multicast_up : 1, /* We have joined the allhosts group */ - : 0; +typedef struct ipif_s { + /**/ struct ipif_s *ipif_next; + struct ill_s *ipif_ill; /* Back pointer to our ill */ + long ipif_id; /* Logical unit number */ + u_int ipif_mtu; /* Starts at ipif_ill->ill_max_frag */ + afs_int32 ipif_local_addr; /* Local IP address for this if. */ + afs_int32 ipif_net_mask; /* Net mask for this interface. */ + afs_int32 ipif_broadcast_addr; /* Broadcast addr for this interface. */ + afs_int32 ipif_pp_dst_addr; /* Point-to-point dest address. */ + u_int ipif_flags; /* Interface flags. */ + u_int ipif_metric; /* BSD if metric, for compatibility. */ + u_int ipif_ire_type; /* LOCAL or LOOPBACK */ + mblk_t *ipif_arp_down_mp; /* Allocated at time arp comes up to + * prevent awkward out of mem condition + * later + */ + mblk_t *ipif_saved_ire_mp; /* Allocated for each extra IRE_SUBNET/ + * RESOLVER on this interface so that + * they can survive ifconfig down. + */ + /* + * The packet counts in the ipif contain the sum of the + * packet counts in dead IREs that were affiliated with + * this ipif. + */ + u_long ipif_fo_pkt_count; /* Forwarded thru our dead IREs */ + u_long ipif_ib_pkt_count; /* Inbound packets for our dead IREs */ + u_long ipif_ob_pkt_count; /* Outbound packets to our dead IREs */ + unsigned int + ipif_multicast_up:1, /* We have joined the allhosts group */ + : 0; } ipif_t; -typedef struct ipfb_s { /**/ - struct ipf_s * ipfb_ipf; /* List of ... */ - kmutex_t ipfb_lock; /* Protect all ipf in list */ +typedef struct ipfb_s { + /**/ struct ipf_s *ipfb_ipf; /* List of ... */ + kmutex_t ipfb_lock; /* Protect all ipf in list */ } ipfb_t; -typedef struct ilm_s { /**/ - afs_int32 ilm_addr; - int ilm_refcnt; - u_int ilm_timer; /* IGMP */ - struct ipif_s * ilm_ipif; /* Back pointer to ipif */ - struct ilm_s * ilm_next; /* Linked list for each ill */ +typedef struct ilm_s { + /**/ afs_int32 ilm_addr; + int ilm_refcnt; + u_int ilm_timer; /* IGMP */ + struct ipif_s *ilm_ipif; /* Back pointer to ipif */ + struct ilm_s *ilm_next; /* Linked list for each ill */ } ilm_t; -typedef struct ill_s { /**/ - struct ill_s * ill_next; /* Chained in at ill_g_head. */ - struct ill_s ** ill_ptpn; /* Pointer to previous next. */ - queue_t * ill_rq; /* Read queue. */ - queue_t * ill_wq; /* Write queue. */ - - int ill_error; /* Error value sent up by device. */ - - ipif_t * ill_ipif; /* Interface chain for this ILL. */ - u_int ill_ipif_up_count; /* Number of IPIFs currently up. */ - u_int ill_max_frag; /* Max IDU. */ - char * ill_name; /* Our name. */ - u_int ill_name_length; /* Name length, incl. terminator. */ - u_int ill_subnet_type; /* IRE_RESOLVER or IRE_SUBNET. */ - u_int ill_ppa; /* Physical Point of Attachment num. */ - u_long ill_sap; - int ill_sap_length; /* Including sign (for position) */ - u_int ill_phys_addr_length; /* Excluding the sap. */ - mblk_t * ill_frag_timer_mp; /* Reassembly timer state. */ - ipfb_t * ill_frag_hash_tbl; /* Fragment hash list head. */ - - queue_t * ill_bind_pending_q; /* Queue waiting for DL_BIND_ACK. */ - ipif_t * ill_ipif_pending; /* IPIF waiting for DL_BIND_ACK. */ - - /* ill_hdr_length and ill_hdr_mp will be non zero if - * the underlying device supports the M_DATA fastpath - */ - int ill_hdr_length; +typedef struct ill_s { + /**/ struct ill_s *ill_next; /* Chained in at ill_g_head. */ + struct ill_s **ill_ptpn; /* Pointer to previous next. */ + queue_t *ill_rq; /* Read queue. */ + queue_t *ill_wq; /* Write queue. */ + + int ill_error; /* Error value sent up by device. */ + + ipif_t *ill_ipif; /* Interface chain for this ILL. */ + u_int ill_ipif_up_count; /* Number of IPIFs currently up. */ + u_int ill_max_frag; /* Max IDU. */ + char *ill_name; /* Our name. */ + u_int ill_name_length; /* Name length, incl. terminator. */ + u_int ill_subnet_type; /* IRE_RESOLVER or IRE_SUBNET. */ + u_int ill_ppa; /* Physical Point of Attachment num. */ + u_long ill_sap; + int ill_sap_length; /* Including sign (for position) */ + u_int ill_phys_addr_length; /* Excluding the sap. */ + mblk_t *ill_frag_timer_mp; /* Reassembly timer state. */ + ipfb_t *ill_frag_hash_tbl; /* Fragment hash list head. */ + + queue_t *ill_bind_pending_q; /* Queue waiting for DL_BIND_ACK. */ + ipif_t *ill_ipif_pending; /* IPIF waiting for DL_BIND_ACK. */ + + /* ill_hdr_length and ill_hdr_mp will be non zero if + * the underlying device supports the M_DATA fastpath + */ + int ill_hdr_length; - ilm_t * ill_ilm; /* Multicast mebership for lower ill */ + ilm_t *ill_ilm; /* Multicast mebership for lower ill */ - /* All non-nil cells between 'ill_first_mp_to_free' and - * 'ill_last_mp_to_free' are freed in ill_delete. - */ + /* All non-nil cells between 'ill_first_mp_to_free' and + * 'ill_last_mp_to_free' are freed in ill_delete. + */ #define ill_first_mp_to_free ill_hdr_mp - mblk_t * ill_hdr_mp; /* Contains fastpath template */ - mblk_t * ill_bcast_mp; /* DLPI header for broadcasts. */ - mblk_t * ill_bind_pending; /* T_BIND_REQ awaiting completion. */ - mblk_t * ill_resolver_mp; /* Resolver template. */ - mblk_t * ill_attach_mp; - mblk_t * ill_bind_mp; - mblk_t * ill_unbind_mp; - mblk_t * ill_detach_mp; + mblk_t *ill_hdr_mp; /* Contains fastpath template */ + mblk_t *ill_bcast_mp; /* DLPI header for broadcasts. */ + mblk_t *ill_bind_pending; /* T_BIND_REQ awaiting completion. */ + mblk_t *ill_resolver_mp; /* Resolver template. */ + mblk_t *ill_attach_mp; + mblk_t *ill_bind_mp; + mblk_t *ill_unbind_mp; + mblk_t *ill_detach_mp; #define ill_last_mp_to_free ill_detach_mp - u_int - ill_frag_timer_running : 1, - ill_needs_attach : 1, - ill_is_ptp : 1, - ill_priv_stream : 1, - ill_unbind_pending : 1, - - ill_pad_to_bit_31 : 27; - MI_HRT_DCL(ill_rtime) - MI_HRT_DCL(ill_rtmp) + u_int ill_frag_timer_running:1, ill_needs_attach:1, ill_is_ptp:1, + ill_priv_stream:1, ill_unbind_pending:1, ill_pad_to_bit_31:27; + MI_HRT_DCL(ill_rtime) + MI_HRT_DCL(ill_rtmp) } ill_t; #endif @@ -1008,178 +1047,187 @@ typedef struct ill_s { /**/ * passed into the kernel at startup time through the AFSOP_ADVISEADDR * system call. These are stored in the data structure * called 'afs_cb_interface'. + * + * struct srvAddr *sa; remote server + * afs_int32 addr; one of my local addr in net order + * afs_uint32 subnetmask; subnet mask of local addr in net order + * */ -afsi_SetServerIPRank(sa, addr, subnetmask) - struct srvAddr *sa; /* remote server */ - afs_int32 addr; /* one of my local addr in net order */ - afs_uint32 subnetmask; /* subnet mask of local addr in net order */ +int +afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr, + afs_uint32 subnetmask) { - afs_uint32 myAddr, myNet, mySubnet, netMask; - afs_uint32 serverAddr ; - - myAddr = ntohl(addr); /* one of my IP addr in host order */ - serverAddr = ntohl(sa->sa_ip); /* server's IP addr in host order */ - subnetmask = ntohl(subnetmask);/* subnet mask in host order */ - - if ( IN_CLASSA(myAddr) ) netMask = IN_CLASSA_NET; - else if ( IN_CLASSB(myAddr) ) netMask = IN_CLASSB_NET; - else if ( IN_CLASSC(myAddr) ) netMask = IN_CLASSC_NET; - else netMask = 0; - - myNet = myAddr & netMask; - mySubnet = myAddr & subnetmask; - - if ( (serverAddr & netMask ) == myNet ) { - if ( (serverAddr & subnetmask ) == mySubnet) { - if ( serverAddr == myAddr ) { /* same machine */ - sa->sa_iprank = afs_min(sa->sa_iprank, TOPR); - } else { /* same subnet */ - sa->sa_iprank = afs_min(sa->sa_iprank, HI); - } - } else { /* same net */ - sa->sa_iprank = afs_min(sa->sa_iprank, MED); - } - } + afs_uint32 myAddr, myNet, mySubnet, netMask; + afs_uint32 serverAddr; + + myAddr = ntohl(addr); /* one of my IP addr in host order */ + serverAddr = ntohl(sa->sa_ip); /* server's IP addr in host order */ + subnetmask = ntohl(subnetmask); /* subnet mask in host order */ + + if (IN_CLASSA(myAddr)) + netMask = IN_CLASSA_NET; + else if (IN_CLASSB(myAddr)) + netMask = IN_CLASSB_NET; + else if (IN_CLASSC(myAddr)) + netMask = IN_CLASSC_NET; + else + netMask = 0; + + myNet = myAddr & netMask; + mySubnet = myAddr & subnetmask; + + if ((serverAddr & netMask) == myNet) { + if ((serverAddr & subnetmask) == mySubnet) { + if (serverAddr == myAddr) { /* same machine */ + sa->sa_iprank = afs_min(sa->sa_iprank, TOPR); + } else { /* same subnet */ + sa->sa_iprank = afs_min(sa->sa_iprank, HI); + } + } else { /* same net */ + sa->sa_iprank = afs_min(sa->sa_iprank, MED); + } + } } #else /* AFS_USERSPACE_IP_ADDR */ #if (! defined(AFS_SUN5_ENV)) && !defined(AFS_DARWIN60_ENV) && defined(USEIFADDR) void -afsi_SetServerIPRank(sa, ifa) - struct srvAddr *sa; - struct in_ifaddr *ifa; +afsi_SetServerIPRank(struct srvAddr *sa, struct in_ifaddr *ifa) { struct sockaddr_in *sin; int t; - + if ((ntohl(sa->sa_ip) & ifa->ia_netmask) == ifa->ia_net) { if ((ntohl(sa->sa_ip) & ifa->ia_subnetmask) == ifa->ia_subnet) { - sin=IA_SIN(ifa); - if ( SA2ULONG(sin) == ntohl(sa->sa_ip)) { /* ie, ME!!! */ + sin = IA_SIN(ifa); + if (SA2ULONG(sin) == ntohl(sa->sa_ip)) { /* ie, ME!!! */ sa->sa_iprank = TOPR; - } else { - t = HI + ifa->ia_ifp->if_metric; /* case #2 */ + } else { + t = HI + ifa->ia_ifp->if_metric; /* case #2 */ if (sa->sa_iprank > t) sa->sa_iprank = t; } } else { - t = MED + ifa->ia_ifp->if_metric;/* case #3 */ + t = MED + ifa->ia_ifp->if_metric; /* case #3 */ if (sa->sa_iprank > t) sa->sa_iprank = t; } } #ifdef IFF_POINTTOPOINT /* check for case #4 -- point-to-point link */ - if ((ifa->ia_ifp->if_flags & IFF_POINTOPOINT) && - (SA2ULONG(IA_DST(ifa)) == ntohl(sa->sa_ip))) { - if (ifa->ia_ifp->if_metric >= (MAXDEFRANK - MED)/PPWEIGHT) + if ((ifa->ia_ifp->if_flags & IFF_POINTOPOINT) + && (SA2ULONG(IA_DST(ifa)) == ntohl(sa->sa_ip))) { + if (ifa->ia_ifp->if_metric >= (MAXDEFRANK - MED) / PPWEIGHT) t = MAXDEFRANK; - else + else t = MED + (PPWEIGHT << ifa->ia_ifp->if_metric); if (sa->sa_iprank > t) sa->sa_iprank = t; } #endif /* IFF_POINTTOPOINT */ } -#endif /*(!defined(AFS_SUN5_ENV)) && defined(USEIFADDR)*/ +#endif /*(!defined(AFS_SUN5_ENV)) && defined(USEIFADDR) */ #if defined(AFS_DARWIN60_ENV) && defined(USEIFADDR) #ifndef afs_min #define afs_min(A,B) ((A)<(B)) ? (A) : (B) #endif void afsi_SetServerIPRank(sa, ifa) - struct srvAddr *sa; - struct ifaddr *ifa; + struct srvAddr *sa; + struct ifaddr *ifa; { struct sockaddr_in *sin; int t; - - afs_uint32 subnetmask, myAddr, myNet, myDstaddr, mySubnet, netMask; - afs_uint32 serverAddr ; - - if (ifa->ifa_addr->sa_family != AF_INET) - return; - sin=(struct sockaddr_in *)ifa->ifa_addr; - myAddr = ntohl(sin->sin_addr.s_addr); /* one of my IP addr in host order */ - serverAddr = ntohl(sa->sa_ip); /* server's IP addr in host order */ - sin=(struct sockaddr_in *)ifa->ifa_netmask; - subnetmask = ntohl(sin->sin_addr.s_addr);/* subnet mask in host order */ - sin=(struct sockaddr_in *)ifa->ifa_dstaddr; - if (sin) - myDstaddr=sin->sin_addr.s_addr; - - if ( IN_CLASSA(myAddr) ) netMask = IN_CLASSA_NET; - else if ( IN_CLASSB(myAddr) ) netMask = IN_CLASSB_NET; - else if ( IN_CLASSC(myAddr) ) netMask = IN_CLASSC_NET; - else netMask = 0; - - myNet = myAddr & netMask; - mySubnet = myAddr & subnetmask; - - if ( (serverAddr & netMask ) == myNet ) { - if ( (serverAddr & subnetmask ) == mySubnet) { - if ( serverAddr == myAddr ) { /* same machine */ - sa->sa_iprank = afs_min(sa->sa_iprank, TOPR); - } else { /* same subnet */ - sa->sa_iprank = afs_min(sa->sa_iprank, HI + ifa->ifa_metric); - } - } else { /* same net */ - sa->sa_iprank = afs_min(sa->sa_iprank, MED + ifa->ifa_metric); - } - } + + afs_uint32 subnetmask, myAddr, myNet, myDstaddr, mySubnet, netMask; + afs_uint32 serverAddr; + + if (ifa->ifa_addr->sa_family != AF_INET) + return; + sin = (struct sockaddr_in *)ifa->ifa_addr; + myAddr = ntohl(sin->sin_addr.s_addr); /* one of my IP addr in host order */ + serverAddr = ntohl(sa->sa_ip); /* server's IP addr in host order */ + sin = (struct sockaddr_in *)ifa->ifa_netmask; + subnetmask = ntohl(sin->sin_addr.s_addr); /* subnet mask in host order */ + sin = (struct sockaddr_in *)ifa->ifa_dstaddr; + if (sin) + myDstaddr = sin->sin_addr.s_addr; + + if (IN_CLASSA(myAddr)) + netMask = IN_CLASSA_NET; + else if (IN_CLASSB(myAddr)) + netMask = IN_CLASSB_NET; + else if (IN_CLASSC(myAddr)) + netMask = IN_CLASSC_NET; + else + netMask = 0; + + myNet = myAddr & netMask; + mySubnet = myAddr & subnetmask; + + if ((serverAddr & netMask) == myNet) { + if ((serverAddr & subnetmask) == mySubnet) { + if (serverAddr == myAddr) { /* same machine */ + sa->sa_iprank = afs_min(sa->sa_iprank, TOPR); + } else { /* same subnet */ + sa->sa_iprank = afs_min(sa->sa_iprank, HI + ifa->ifa_metric); + } + } else { /* same net */ + sa->sa_iprank = afs_min(sa->sa_iprank, MED + ifa->ifa_metric); + } + } #ifdef IFF_POINTTOPOINT /* check for case #4 -- point-to-point link */ - if ((ifa->ia_ifp->if_flags & IFF_POINTOPOINT) && - (myDstaddr == serverAddr))) { - if (ifa->ia_ifp->if_metric >= (MAXDEFRANK - MED)/PPWEIGHT) + if ((ifa->ia_ifp->if_flags & IFF_POINTOPOINT) + && (myDstaddr == serverAddr)) + ) { + if (ifa->ia_ifp->if_metric >= (MAXDEFRANK - MED) / PPWEIGHT) t = MAXDEFRANK; - else + else t = MED + (PPWEIGHT << ifa->->ifa_metric); if (sa->sa_iprank > t) sa->sa_iprank = t; - } + } #endif /* IFF_POINTTOPOINT */ } -#endif /*(!defined(AFS_SUN5_ENV)) && defined(USEIFADDR)*/ +#endif /*(!defined(AFS_SUN5_ENV)) && defined(USEIFADDR) */ #endif /* else AFS_USERSPACE_IP_ADDR */ #ifdef AFS_SGI62_ENV static int -afsi_enum_set_rank(struct hashbucket *h, caddr_t mkey, caddr_t arg1, - caddr_t arg2) -{ - afsi_SetServerIPRank((struct srvAddr *)arg1, (struct in_ifaddr*)h); - return 0; /* Never match, so we enumerate everyone */ -} -#endif /* AFS_SGI62_ENV */ -static afs_SetServerPrefs(sa) - struct srvAddr *sa; -{ + afsi_enum_set_rank(struct hashbucket *h, caddr_t mkey, caddr_t arg1, + caddr_t arg2) { + afsi_SetServerIPRank((struct srvAddr *)arg1, (struct in_ifaddr *)h); + return 0; /* Never match, so we enumerate everyone */ +} +#endif /* AFS_SGI62_ENV */ +static int afs_SetServerPrefs(struct srvAddr *sa) { #if defined(AFS_USERSPACE_IP_ADDR) - extern interfaceAddr afs_cb_interface; int i; - sa->sa_iprank = LO; - for (i=0; isa_iprank = LO; + for (i = 0; i < afs_cb_interface.numberOfInterfaces; i++) { + afsi_SetServerIPRank(sa, afs_cb_interface.addr_in[i], + afs_cb_interface.subnetmask[i]); } -#else /* AFS_USERSPACE_IP_ADDR */ +#else /* AFS_USERSPACE_IP_ADDR */ #if defined(AFS_SUN5_ENV) extern struct ill_s *ill_g_headp; ill_t *ill; - ipif_t * ipif; + ipif_t *ipif; int subnet, subnetmask, net, netmask; - long *addr = (long *) ill_g_headp; - extern struct ifnet *rxi_FindIfnet(); + long *addr = (long *)ill_g_headp; - if (sa) sa->sa_iprank= 0; - for (ill = (struct ill_s *)*addr /*ill_g_headp*/; ill; ill = ill->ill_next ) { + if (sa) + sa->sa_iprank = 0; + for (ill = (struct ill_s *)*addr /*ill_g_headp */ ; ill; + ill = ill->ill_next) { #ifdef AFS_SUN58_ENV /* Make sure this is an IPv4 ILL */ - if (ill->ill_isv6) continue; + if (ill->ill_isv6) + continue; #endif - for (ipif = ill->ill_ipif; ipif; ipif = ipif->ipif_next ) { + for (ipif = ill->ill_ipif; ipif; ipif = ipif->ipif_next) { subnet = ipif->ipif_local_addr & ipif->ipif_net_mask; subnetmask = ipif->ipif_net_mask; /* @@ -1196,37 +1244,38 @@ static afs_SetServerPrefs(sa) netmask = 0; } net = ipif->ipif_local_addr & netmask; -#ifdef notdef +#ifdef notdef if (!s) { - if (ipif->ipif_local_addr != 0x7f000001) { /* ignore loopback */ + if (ipif->ipif_local_addr != 0x7f000001) { /* ignore loopback */ *cnt += 1; - if (*cnt > 16) return; + if (*cnt > 16) + return; *addrp++ = ipif->ipif_local_addr; } } else #endif /* notdef */ - { + { /* XXXXXX Do the individual ip ranking below XXXXX */ if ((sa->sa_ip & netmask) == net) { if ((sa->sa_ip & subnetmask) == subnet) { - if (ipif->ipif_local_addr == sa->sa_ip) { /* ie, ME! */ + if (ipif->ipif_local_addr == sa->sa_ip) { /* ie, ME! */ sa->sa_iprank = TOPR; - } else { - sa->sa_iprank = HI + ipif->ipif_metric; /* case #2 */ + } else { + sa->sa_iprank = HI + ipif->ipif_metric; /* case #2 */ } - } else { - sa->sa_iprank = MED + ipif->ipif_metric; /* case #3 */ + } else { + sa->sa_iprank = MED + ipif->ipif_metric; /* case #3 */ } } else { sa->sa_iprank = LO + ipif->ipif_metric; /* case #4 */ } /* check for case #5 -- point-to-point link */ - if ((ipif->ipif_flags & IFF_POINTOPOINT) && - (ipif->ipif_pp_dst_addr == sa->sa_ip )) { + if ((ipif->ipif_flags & IFF_POINTOPOINT) + && (ipif->ipif_pp_dst_addr == sa->sa_ip)) { - if (ipif->ipif_metric >= (MAXDEFRANK - MED)/PPWEIGHT) + if (ipif->ipif_metric >= (MAXDEFRANK - MED) / PPWEIGHT) sa->sa_iprank = MAXDEFRANK; - else + else sa->sa_iprank = MED + (PPWEIGHT << ipif->ipif_metric); } } @@ -1234,105 +1283,109 @@ static afs_SetServerPrefs(sa) } #else #ifndef USEIFADDR - struct ifnet *ifn = (struct ifnet *)0; - struct in_ifaddr *ifad = (struct in_ifaddr *) 0; + struct ifnet *ifn = NULL; + struct in_ifaddr *ifad = (struct in_ifaddr *)0; struct sockaddr_in *sin; if (!sa) { -#ifdef notdef /* clean up, remove this */ +#ifdef notdef /* clean up, remove this */ for (ifn = ifnet; ifn != NULL; ifn = ifn->if_next) { - for (ifad = ifn->if_addrlist; ifad != NULL; ifad = ifad->ifa_next){ - if ((IFADDR2SA(ifad)->sa_family == AF_INET) - && !(ifn->if_flags & IFF_LOOPBACK)) { - *cnt += 1; - if (*cnt > 16) return; - *addrp++ = ((struct sockaddr_in *) IFADDR2SA(ifad))->sin_addr.s_addr; + for (ifad = ifn->if_addrlist; ifad != NULL; ifad = ifad->ifa_next) { + if ((IFADDR2SA(ifad)->sa_family == AF_INET) + && !(ifn->if_flags & IFF_LOOPBACK)) { + *cnt += 1; + if (*cnt > 16) + return; + *addrp++ = + ((struct sockaddr_in *)IFADDR2SA(ifad))->sin_addr. + s_addr; } - } - } -#endif /* notdef */ + }} +#endif /* notdef */ return; } - sa->sa_iprank= 0; + sa->sa_iprank = 0; #ifdef ADAPT_MTU ifn = rxi_FindIfnet(sa->sa_ip, &ifad); #endif - if (ifn) { /* local, more or less */ + if (ifn) { /* local, more or less */ #ifdef IFF_LOOPBACK - if (ifn->if_flags & IFF_LOOPBACK) { - sa->sa_iprank = TOPR; - goto end; - } + if (ifn->if_flags & IFF_LOOPBACK) { + sa->sa_iprank = TOPR; + goto end; + } #endif /* IFF_LOOPBACK */ - sin = (struct sockaddr_in *) IA_SIN(ifad); - if (SA2ULONG(sin) == sa->sa_ip) { - sa->sa_iprank = TOPR; - goto end; - } -#ifdef IFF_BROADCAST - if (ifn->if_flags & IFF_BROADCAST) { - if (sa->sa_ip == (sa->sa_ip & SA2ULONG(IA_BROAD(ifad)))) { - sa->sa_iprank = HI; + sin = (struct sockaddr_in *)IA_SIN(ifad); + if (SA2ULONG(sin) == sa->sa_ip) { + sa->sa_iprank = TOPR; goto end; - } - } + } +#ifdef IFF_BROADCAST + if (ifn->if_flags & IFF_BROADCAST) { + if (sa->sa_ip == (sa->sa_ip & SA2ULONG(IA_BROAD(ifad)))) { + sa->sa_iprank = HI; + goto end; + } + } #endif /* IFF_BROADCAST */ #ifdef IFF_POINTOPOINT - if (ifn->if_flags & IFF_POINTOPOINT) { - if (sa->sa_ip == SA2ULONG(IA_DST(ifad))) { - if (ifn->if_metric > 4) { - sa->sa_iprank = LO; - goto end; - } - else sa->sa_iprank = ifn->if_metric; + if (ifn->if_flags & IFF_POINTOPOINT) { + if (sa->sa_ip == SA2ULONG(IA_DST(ifad))) { + if (ifn->if_metric > 4) { + sa->sa_iprank = LO; + goto end; + } else + sa->sa_iprank = ifn->if_metric; + } } - } #endif /* IFF_POINTOPOINT */ - sa->sa_iprank += MED + ifn->if_metric; /* couldn't find anything better */ + sa->sa_iprank += MED + ifn->if_metric; /* couldn't find anything better */ } - -#else /* USEIFADDR */ - - if (sa) sa->sa_iprank= LO; +#else /* USEIFADDR */ + + if (sa) + sa->sa_iprank = LO; #ifdef AFS_SGI62_ENV - (void) hash_enum(&hashinfo_inaddr, afsi_enum_set_rank, HTF_INET, NULL, - (caddr_t)sa, NULL); + (void)hash_enum(&hashinfo_inaddr, afsi_enum_set_rank, HTF_INET, NULL, + (caddr_t) sa, NULL); #elif defined(AFS_DARWIN60_ENV) { - struct ifnet *ifn; - struct ifaddr *ifa; - TAILQ_FOREACH(ifn , &ifnet, if_link) { - TAILQ_FOREACH(ifa , &ifn->if_addrhead, ifa_link) { - afsi_SetServerIPRank(sa, ifa); - } - } - } + struct ifnet *ifn; + struct ifaddr *ifa; + TAILQ_FOREACH(ifn, &ifnet, if_link) { + TAILQ_FOREACH(ifa, &ifn->if_addrhead, ifa_link) { + afsi_SetServerIPRank(sa, ifa); + }}} #elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) { - struct in_ifaddr *ifa; - TAILQ_FOREACH(ifa , &in_ifaddrhead, ia_link) { - afsi_SetServerIPRank(sa, ifa); - } + struct in_ifaddr *ifa; + TAILQ_FOREACH(ifa, &in_ifaddrhead, ia_link) { + afsi_SetServerIPRank(sa, ifa); + }} +#elif defined(AFS_OBSD_ENV) + { + extern struct in_ifaddrhead in_ifaddr; + struct in_ifaddr *ifa; + for (ifa = in_ifaddr.tqh_first; ifa; ifa = ifa->ia_list.tqe_next) + afsi_SetServerIPRank(sa, ifa); } #else { - extern struct in_ifaddr *in_ifaddr; struct in_ifaddr *ifa; - for ( ifa = in_ifaddr; ifa; ifa = ifa->ia_next ) { + for (ifa = in_ifaddr; ifa; ifa = ifa->ia_next) { afsi_SetServerIPRank(sa, ifa); - } - } + }} #endif + end: +#endif /* USEIFADDR */ +#endif /* AFS_SUN5_ENV */ +#endif /* else AFS_USERSPACE_IP_ADDR */ + if (sa) + sa->sa_iprank += afs_randomMod15(); -#endif /* USEIFADDR */ -#endif /* AFS_SUN5_ENV */ -#endif /* else AFS_USERSPACE_IP_ADDR */ - - end: - if (sa) sa->sa_iprank += afs_randomMod15(); + return 0; +} /* afs_SetServerPrefs */ -return 0; -} /* afs_SetServerPrefs */ #undef TOPR #undef HI #undef MED @@ -1344,52 +1397,51 @@ return 0; * clean up all other structures that may reference it. * The afs_xserver and afs_xsrvAddr locks are assumed taken. */ -void afs_FlushServer(srvp) - struct server *srvp; -{ - afs_int32 i; - struct server *ts, **pts; - - /* Find any volumes residing on this server and flush their state */ - afs_ResetVolumes(srvp); - - /* Flush all callbacks in the all vcaches for this specific server */ - afs_FlushServerCBs(srvp); - - /* Remove all the callbacks structs */ - if (srvp->cbrs) { - struct afs_cbr *cb, *cbnext; - extern afs_lock_t afs_xvcb; - - MObtainWriteLock(&afs_xvcb, 300); - for (cb=srvp->cbrs; cb; cb=cbnext) { - cbnext = cb->next; - afs_FreeCBR(cb); - } - srvp->cbrs = (struct afs_cbr *)0; - ReleaseWriteLock(&afs_xvcb); - } - - /* If no more srvAddr structs hanging off of this server struct, - * then clean it up. - */ - if (!srvp->addr) { - /* Remove the server structure from the cell list - if there */ - afs_RemoveCellEntry(srvp); - - /* Remove from the afs_servers hash chain */ - for (i=0; inext), ts=*pts) { - if (ts == srvp) break; +void afs_FlushServer(struct server *srvp) { + afs_int32 i; + struct server *ts, **pts; + + /* Find any volumes residing on this server and flush their state */ + afs_ResetVolumes(srvp); + + /* Flush all callbacks in the all vcaches for this specific server */ + afs_FlushServerCBs(srvp); + + /* Remove all the callbacks structs */ + if (srvp->cbrs) { + struct afs_cbr *cb, *cbnext; + + MObtainWriteLock(&afs_xvcb, 300); + for (cb = srvp->cbrs; cb; cb = cbnext) { + cbnext = cb->next; + afs_FreeCBR(cb); + } srvp->cbrs = (struct afs_cbr *)0; + ReleaseWriteLock(&afs_xvcb); + } + + /* If no more srvAddr structs hanging off of this server struct, + * then clean it up. + */ + if (!srvp->addr) { + /* Remove the server structure from the cell list - if there */ + afs_RemoveCellEntry(srvp); + + /* Remove from the afs_servers hash chain */ + for (i = 0; i < NSERVERS; i++) { + for (pts = &(afs_servers[i]), ts = *pts; ts; + pts = &(ts->next), ts = *pts) { + if (ts == srvp) + break; + } + if (ts) + break; + } + if (ts) { + *pts = ts->next; /* Found it. Remove it */ + afs_osi_Free(ts, sizeof(struct server)); /* Free it */ + afs_totalServers--; } - if (ts) break; - } - if (ts) { - *pts = ts->next; /* Found it. Remove it */ - afs_osi_Free(ts, sizeof(struct server)); /* Free it */ - afs_totalServers--; - } - } + } } /* afs_RemoveSrvAddr() @@ -1400,27 +1452,26 @@ void afs_FlushServer(srvp) * The afs_xserver and afs_xsrvAddr locks are assumed taken. * It is not removed from the afs_srvAddrs hash chain. */ -void afs_RemoveSrvAddr(sap) - struct srvAddr *sap; -{ - struct srvAddr **psa, *sa; - struct server *srv; - - if (!sap) return; - srv = sap->server; - - /* Find the srvAddr in the server's list and remove it */ - for (psa=&(srv->addr), sa=*psa; sa; psa=&(sa->next_sa), sa=*psa) { - if (sa == sap) break; - } - if (sa) { - *psa = sa->next_sa; - sa->next_sa = 0; - sa->server = 0; - - /* Flush the server struct since it's IP address has changed */ - afs_FlushServer(srv); - } +void afs_RemoveSrvAddr(struct srvAddr *sap) { + struct srvAddr **psa, *sa; + struct server *srv; + + if (!sap) + return; + srv = sap->server; + + /* Find the srvAddr in the server's list and remove it */ + for (psa = &(srv->addr), sa = *psa; sa; psa = &(sa->next_sa), sa = *psa) { + if (sa == sap) + break; + } if (sa) { + *psa = sa->next_sa; + sa->next_sa = 0; + sa->server = 0; + + /* Flush the server struct since it's IP address has changed */ + afs_FlushServer(srv); + } } /* afs_GetServer() @@ -1429,217 +1480,257 @@ void afs_RemoveSrvAddr(sap) * If one does not exist, then one will be created. * aserver and aport must be in NET byte order. */ -struct server *afs_GetServer(afs_uint32 *aserverp, afs_int32 nservers, +struct server *afs_GetServer(afs_uint32 * aserverp, afs_int32 nservers, afs_int32 acell, u_short aport, - afs_int32 locktype, afsUUID *uuidp, - afs_int32 addr_uniquifier) -{ - struct server *oldts=0, *ts, *newts, *orphts=0; - struct srvAddr *oldsa, *sa, *newsa, *nextsa, *orphsa; + afs_int32 locktype, afsUUID * uuidp, + afs_int32 addr_uniquifier) { + struct server *oldts = 0, *ts, *newts, *orphts = 0; + struct srvAddr *oldsa, *newsa, *nextsa, *orphsa; u_short fsport; - afs_int32 iphash, k, srvcount=0; + afs_int32 iphash, k, srvcount = 0; unsigned int srvhash; AFS_STATCNT(afs_GetServer); - ObtainSharedLock(&afs_xserver,13); + ObtainSharedLock(&afs_xserver, 13); /* Check if the server struct exists and is up to date */ if (!uuidp) { - if (nservers != 1) panic("afs_GetServer: incorect count of servers"); - ObtainReadLock(&afs_xsrvAddr); - ts = afs_FindServer(aserverp[0], aport, NULL, locktype); - ReleaseReadLock(&afs_xsrvAddr); - if (ts && !(ts->flags & SRVR_MULTIHOMED)) { - /* Found a server struct that is not multihomed and has the - * IP address associated with it. A correct match. - */ - ReleaseSharedLock(&afs_xserver); - return(ts); - } + if (nservers != 1) + panic("afs_GetServer: incorect count of servers"); + ObtainReadLock(&afs_xsrvAddr); + ts = afs_FindServer(aserverp[0], aport, NULL, locktype); + ReleaseReadLock(&afs_xsrvAddr); + if (ts && !(ts->flags & SRVR_MULTIHOMED)) { + /* Found a server struct that is not multihomed and has the + * IP address associated with it. A correct match. + */ + ReleaseSharedLock(&afs_xserver); + return (ts); + } } else { - if (nservers <= 0) panic("afs_GetServer: incorrect count of servers"); - ts = afs_FindServer(0, aport, uuidp, locktype); - if (ts && (ts->sr_addr_uniquifier == addr_uniquifier) && ts->addr) { - /* Found a server struct that is multihomed and same - * uniqufier (same IP addrs). The above if statement is the - * same as in InstallUVolumeEntry(). - */ - ReleaseSharedLock(&afs_xserver); - return ts; - } - if (ts) oldts = ts; /* Will reuse if same uuid */ + if (nservers <= 0) + panic("afs_GetServer: incorrect count of servers"); + ts = afs_FindServer(0, aport, uuidp, locktype); + if (ts && (ts->sr_addr_uniquifier == addr_uniquifier) && ts->addr) { + /* Found a server struct that is multihomed and same + * uniqufier (same IP addrs). The above if statement is the + * same as in InstallUVolumeEntry(). + */ + ReleaseSharedLock(&afs_xserver); + return ts; + } + if (ts) + oldts = ts; /* Will reuse if same uuid */ } - UpgradeSToWLock(&afs_xserver,36); - ObtainWriteLock(&afs_xsrvAddr,116); + UpgradeSToWLock(&afs_xserver, 36); + ObtainWriteLock(&afs_xsrvAddr, 116); srvcount = afs_totalServers; /* Reuse/allocate a new server structure */ if (oldts) { - newts = oldts; + newts = oldts; } else { - newts = (struct server *) afs_osi_Alloc(sizeof(struct server)); - if (!newts) panic("malloc of server struct"); - afs_totalServers++; - memset((char *)newts, 0, sizeof(struct server)); - - /* Add the server struct to the afs_servers[] hash chain */ - srvhash = (uuidp ? (afs_uuid_hash(uuidp)%NSERVERS) : SHash(aserverp[0])); - newts->next = afs_servers[srvhash]; - afs_servers[srvhash] = newts; + newts = (struct server *)afs_osi_Alloc(sizeof(struct server)); + if (!newts) + panic("malloc of server struct"); + afs_totalServers++; + memset((char *)newts, 0, sizeof(struct server)); + + /* Add the server struct to the afs_servers[] hash chain */ + srvhash = + (uuidp ? (afs_uuid_hash(uuidp) % NSERVERS) : SHash(aserverp[0])); + newts->next = afs_servers[srvhash]; + afs_servers[srvhash] = newts; } /* Initialize the server structure */ - if (uuidp) { /* Multihomed */ - newts->sr_uuid = *uuidp; - newts->sr_addr_uniquifier = addr_uniquifier; - newts->flags |= SRVR_MULTIHOMED; + if (uuidp) { /* Multihomed */ + newts->sr_uuid = *uuidp; + newts->sr_addr_uniquifier = addr_uniquifier; + newts->flags |= SRVR_MULTIHOMED; } - if (acell) newts->cell = afs_GetCell(acell, 0); + if (acell) + newts->cell = afs_GetCell(acell, 0); fsport = (newts->cell ? newts->cell->fsport : AFS_FSPORT); /* For each IP address we are registering */ - for (k=0; knext_bkt) { - if ( (oldsa->sa_ip == aserverp[k]) && (oldsa->sa_portal == aport) ) break; - } - if (oldsa && (oldsa->server != newts)) { - afs_RemoveSrvAddr(oldsa); /* Remove from its server struct */ - oldsa->next_sa = newts->addr; /* Add to the new server struct */ - newts->addr = oldsa; - } - - /* Reuse/allocate a new srvAddr structure */ - if (oldsa) { - newsa = oldsa; - } else { - newsa = (struct srvAddr *) afs_osi_Alloc(sizeof(struct srvAddr)); - if (!newsa) panic("malloc of srvAddr struct"); - afs_totalSrvAddrs++; - memset((char *)newsa, 0, sizeof(struct srvAddr)); - - /* Add the new srvAddr to the afs_srvAddrs[] hash chain */ - newsa->next_bkt = afs_srvAddrs[iphash]; - afs_srvAddrs[iphash] = newsa; - - /* Hang off of the server structure */ - newsa->next_sa = newts->addr; - newts->addr = newsa; - - /* Initialize the srvAddr Structure */ - newsa->sa_ip = aserverp[k]; - newsa->sa_portal = aport; - } - - /* Update the srvAddr Structure */ - newsa->server = newts; - if (newts->flags & SRVR_ISDOWN) - newsa->sa_flags |= SRVADDR_ISDOWN; - if (uuidp) newsa->sa_flags |= SRVADDR_MH; - else newsa->sa_flags &= ~SRVADDR_MH; - - /* Compute preference values and resort */ - if (!newsa->sa_iprank) { - if (aport == fsport) { - afs_SetServerPrefs(newsa); /* new fileserver rank */ - } else { - newsa->sa_iprank = 10000 + afs_randomMod127(); /* new vlserver rank */ - } - } + for (k = 0; k < nservers; k++) { + iphash = SHash(aserverp[k]); + + /* Check if the srvAddr structure already exists. If so, remove + * it from its server structure and add it to the new one. + */ + for (oldsa = afs_srvAddrs[iphash]; oldsa; oldsa = oldsa->next_bkt) { + if ((oldsa->sa_ip == aserverp[k]) && (oldsa->sa_portal == aport)) + break; + } + if (oldsa && (oldsa->server != newts)) { + afs_RemoveSrvAddr(oldsa); /* Remove from its server struct */ + oldsa->next_sa = newts->addr; /* Add to the new server struct */ + newts->addr = oldsa; + } + + /* Reuse/allocate a new srvAddr structure */ + if (oldsa) { + newsa = oldsa; + } else { + newsa = (struct srvAddr *)afs_osi_Alloc(sizeof(struct srvAddr)); + if (!newsa) + panic("malloc of srvAddr struct"); + afs_totalSrvAddrs++; + memset((char *)newsa, 0, sizeof(struct srvAddr)); + + /* Add the new srvAddr to the afs_srvAddrs[] hash chain */ + newsa->next_bkt = afs_srvAddrs[iphash]; + afs_srvAddrs[iphash] = newsa; + + /* Hang off of the server structure */ + newsa->next_sa = newts->addr; + newts->addr = newsa; + + /* Initialize the srvAddr Structure */ + newsa->sa_ip = aserverp[k]; + newsa->sa_portal = aport; + } + + /* Update the srvAddr Structure */ + newsa->server = newts; + if (newts->flags & SRVR_ISDOWN) + newsa->sa_flags |= SRVADDR_ISDOWN; + if (uuidp) + newsa->sa_flags |= SRVADDR_MH; + else + newsa->sa_flags &= ~SRVADDR_MH; + + /* Compute preference values and resort */ + if (!newsa->sa_iprank) { + if (aport == fsport) { + afs_SetServerPrefs(newsa); /* new fileserver rank */ + } else { + newsa->sa_iprank = 10000 + afs_randomMod127(); /* new vlserver rank */ + } + } } - afs_SortOneServer(newts); /* Sort by rank */ + afs_SortOneServer(newts); /* Sort by rank */ /* If we reused the server struct, remove any of its srvAddr * structs that will no longer be associated with this server. */ - if (oldts) { /* reused the server struct */ - for (orphsa=newts->addr; orphsa; orphsa=nextsa) { - nextsa = orphsa->next_sa; - for (k=0; ksa_ip == aserverp[k]) break; /* belongs */ - } - if (k < nservers) continue; /* belongs */ - - /* Have a srvAddr struct. Now get a server struct (if not already) */ - if (!orphts) { - orphts = (struct server *) afs_osi_Alloc(sizeof(struct server)); - if (!orphts) panic("malloc of lo server struct"); - memset((char *)orphts, 0, sizeof(struct server)); - afs_totalServers++; - - /* Add the orphaned server to the afs_servers[] hash chain. - * Its iphash does not matter since we never look up the server - * in the afs_servers table by its ip address (only by uuid - - * which this has none). - */ - iphash = SHash(aserverp[k]); - orphts->next = afs_servers[iphash]; - afs_servers[iphash] = orphts; - - if (acell) orphts->cell = afs_GetCell(acell, 0); - } - - /* Hang the srvAddr struct off of the server structure. The server - * may have multiple srvAddrs, but it won't be marked multihomed. - */ - afs_RemoveSrvAddr(orphsa); /* remove */ - orphsa->next_sa = orphts->addr; /* hang off server struct */ - orphts->addr = orphsa; - orphsa->server = orphts; - orphsa->sa_flags |= SRVADDR_NOUSE; /* flag indicating not in use */ - orphsa->sa_flags &= ~SRVADDR_MH; /* Not multihomed */ - } + if (oldts) { /* reused the server struct */ + for (orphsa = newts->addr; orphsa; orphsa = nextsa) { + nextsa = orphsa->next_sa; + for (k = 0; k < nservers; k++) { + if (orphsa->sa_ip == aserverp[k]) + break; /* belongs */ + } + if (k < nservers) + continue; /* belongs */ + + /* Have a srvAddr struct. Now get a server struct (if not already) */ + if (!orphts) { + orphts = + (struct server *)afs_osi_Alloc(sizeof(struct server)); + if (!orphts) + panic("malloc of lo server struct"); + memset((char *)orphts, 0, sizeof(struct server)); + afs_totalServers++; + + /* Add the orphaned server to the afs_servers[] hash chain. + * Its iphash does not matter since we never look up the server + * in the afs_servers table by its ip address (only by uuid - + * which this has none). + */ + iphash = SHash(aserverp[k]); + orphts->next = afs_servers[iphash]; + afs_servers[iphash] = orphts; + + if (acell) + orphts->cell = afs_GetCell(acell, 0); + } + + /* Hang the srvAddr struct off of the server structure. The server + * may have multiple srvAddrs, but it won't be marked multihomed. + */ + afs_RemoveSrvAddr(orphsa); /* remove */ + orphsa->next_sa = orphts->addr; /* hang off server struct */ + orphts->addr = orphsa; + orphsa->server = orphts; + orphsa->sa_flags |= SRVADDR_NOUSE; /* flag indicating not in use */ + orphsa->sa_flags &= ~SRVADDR_MH; /* Not multihomed */ + } } - srvcount = afs_totalServers - srvcount; /* # servers added and removed */ + srvcount = afs_totalServers - srvcount; /* # servers added and removed */ if (srvcount) { - struct afs_stats_SrvUpDownInfo *upDownP; - /* With the introduction of this new record, we need to adjust the - * proper individual & global server up/down info. - */ - upDownP = GetUpDownStats(newts); - upDownP->numTtlRecords += srvcount; - afs_stats_cmperf.srvRecords += srvcount; - if (afs_stats_cmperf.srvRecords > afs_stats_cmperf.srvRecordsHWM) - afs_stats_cmperf.srvRecordsHWM = afs_stats_cmperf.srvRecords; + struct afs_stats_SrvUpDownInfo *upDownP; + /* With the introduction of this new record, we need to adjust the + * proper individual & global server up/down info. + */ + upDownP = GetUpDownStats(newts); + upDownP->numTtlRecords += srvcount; + afs_stats_cmperf.srvRecords += srvcount; + if (afs_stats_cmperf.srvRecords > afs_stats_cmperf.srvRecordsHWM) + afs_stats_cmperf.srvRecordsHWM = afs_stats_cmperf.srvRecords; } - ReleaseWriteLock(&afs_xsrvAddr); + ReleaseWriteLock(&afs_xsrvAddr); ReleaseWriteLock(&afs_xserver); - return(newts); -} /* afs_GetServer */ + return (newts); +} /* afs_GetServer */ + +void afs_ActivateServer(struct srvAddr *sap) { + osi_timeval_t currTime; /*Filled with current time */ + osi_timeval_t *currTimeP; /*Ptr to above */ + struct afs_stats_SrvUpDownInfo *upDownP; /*Ptr to up/down info record */ + struct server *aserver = sap->server; + + if (!(aserver->flags & AFS_SERVER_FLAG_ACTIVATED)) { + /* + * This server record has not yet been activated. Go for it, + * recording its ``birth''. + */ + aserver->flags |= AFS_SERVER_FLAG_ACTIVATED; + currTimeP = &currTime; + osi_GetuTime(currTimeP); + aserver->activationTime = currTime.tv_sec; + upDownP = GetUpDownStats(aserver); + if (aserver->flags & SRVR_ISDOWN) { + upDownP->numDownRecords++; + } else { + upDownP->numUpRecords++; + upDownP->numRecordsNeverDown++; + } + } +} + -void afs_ActivateServer(sap) - struct srvAddr *sap; +void shutdown_server() { - osi_timeval_t currTime; /*Filled with current time*/ - osi_timeval_t *currTimeP; /*Ptr to above*/ - struct afs_stats_SrvUpDownInfo *upDownP; /*Ptr to up/down info record*/ - struct server *aserver = sap->server; - - if (!(aserver->flags & AFS_SERVER_FLAG_ACTIVATED)) { - /* - * This server record has not yet been activated. Go for it, - * recording its ``birth''. - */ - aserver->flags |= AFS_SERVER_FLAG_ACTIVATED; - currTimeP = &currTime; - osi_GetuTime(currTimeP); - aserver->activationTime = currTime.tv_sec; - upDownP = GetUpDownStats(aserver); - if (aserver->flags & SRVR_ISDOWN) { - upDownP->numDownRecords++; - } else { - upDownP->numUpRecords++; - upDownP->numRecordsNeverDown++; - } - } + int i; + + for (i = 0; i < NSERVERS; i++) { + struct server *ts, *next; + + ts = afs_servers[i]; + while(ts) { + next = ts->next; + afs_osi_Free(ts, sizeof(struct server)); + ts = next; + } + } + + for (i = 0; i < NSERVERS; i++) { + struct srvAddr *sa, *next; + + sa = afs_srvAddrs[i]; + while(sa) { + next = sa->next_bkt; + afs_osi_Free(sa, sizeof(struct srvAddr)); + sa = next; + } + } } diff --git a/src/afs/afs_stat.c b/src/afs/afs_stat.c index 537cf8122..c2665af01 100644 --- a/src/afs/afs_stat.c +++ b/src/afs/afs_stat.c @@ -10,12 +10,13 @@ /* statistics-gathering package */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_stat.c,v 1.1.1.5 2001/09/11 14:24:46 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_stat.c,v 1.9 2003/07/15 23:14:13 shadow Exp $"); -#include "../afs/sysincludes.h" /*Standard vendor system headers*/ -#include "../afs/afsincludes.h" /*AFS-based standard headers*/ +#include "afs/sysincludes.h" /*Standard vendor system headers */ +#include "afsincludes.h" /*AFS-based standard headers */ #include "afs_stats.h" struct afs_CMStats afs_cmstats; @@ -37,20 +38,20 @@ afs_int32 afs_stats_XferSumBytes[AFS_STATS_NUM_FS_XFER_OPS]; * Environment: * This routine should only be called once, at initialization time. */ -void afs_InitStats() - -{ /*afs_InitStats*/ - - struct afs_stats_opTimingData *opTimeP; /*Ptr to curr timing struct*/ - struct afs_stats_xferData *xferP; /*Ptr to curr xfer struct*/ - int currIdx; /*Current index*/ +void +afs_InitStats(void) +{ + struct afs_stats_opTimingData *opTimeP; /*Ptr to curr timing struct */ + struct afs_stats_xferData *xferP; /*Ptr to curr xfer struct */ + int currIdx; /*Current index */ /* * First step is to zero everything out. */ memset((char *)(&afs_cmstats), 0, sizeof(struct afs_CMStats)); memset((char *)(&afs_stats_cmperf), 0, sizeof(struct afs_stats_CMPerf)); - memset((char *)(&afs_stats_cmfullperf), 0, sizeof(struct afs_stats_CMFullPerf)); + memset((char *)(&afs_stats_cmfullperf), 0, + sizeof(struct afs_stats_CMFullPerf)); /* * Some fields really should be non-zero at the start, so set 'em up. @@ -58,11 +59,13 @@ void afs_InitStats() afs_stats_cmperf.srvNumBuckets = NSERVERS; opTimeP = &(afs_stats_cmfullperf.rpc.fsRPCTimes[0]); - for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_RPC_OPS; currIdx++, opTimeP++) + for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_RPC_OPS; + currIdx++, opTimeP++) opTimeP->minTime.tv_sec = 999999; opTimeP = &(afs_stats_cmfullperf.rpc.cmRPCTimes[0]); - for (currIdx = 0; currIdx < AFS_STATS_NUM_CM_RPC_OPS; currIdx++, opTimeP++) + for (currIdx = 0; currIdx < AFS_STATS_NUM_CM_RPC_OPS; + currIdx++, opTimeP++) opTimeP->minTime.tv_sec = 999999; xferP = &(afs_stats_cmfullperf.rpc.fsXferTimes[0]); @@ -70,25 +73,20 @@ void afs_InitStats() xferP->minTime.tv_sec = 999999; xferP->minBytes = 999999999; } - -} /*afs_InitStats*/ - - +} -afs_GetCMStat(ptr, size) - char **ptr; /* memory area */ - unsigned *size; /* # of bytes */ - { +void +afs_GetCMStat(char **ptr, unsigned *size) +{ #ifndef AFS_NOSTATS - AFS_STATCNT(afs_GetCMStat); - *ptr = (char *)&afs_cmstats; - *size = sizeof(afs_cmstats); + AFS_STATCNT(afs_GetCMStat); + *ptr = (char *)&afs_cmstats; + *size = sizeof(afs_cmstats); #endif /* AFS_NOSTATS */ - } +} -afs_AddToMean(oldMean, newValue) - struct afs_MeanStats *oldMean; - afs_int32 newValue; - { - AFS_STATCNT(afs_AddToMean); - } +void +afs_AddToMean(struct afs_MeanStats *oldMean, afs_int32 newValue) +{ + AFS_STATCNT(afs_AddToMean); +} diff --git a/src/afs/afs_stats.h b/src/afs/afs_stats.h index 39dfcd0d0..35f6575a1 100644 --- a/src/afs/afs_stats.h +++ b/src/afs/afs_stats.h @@ -14,10 +14,10 @@ * The remainder of this file contains the statistics gathering stuff. */ -#ifndef __TRANSARC_AFS_STATS_H__ -#define __TRANSARC_AFS_STATS_H__ +#ifndef __OPENAFS_AFS_STATS_H__ +#define __OPENAFS_AFS_STATS_H__ -#include "../afs/param.h" +#include "afs/param.h" /* the following is to work around a VAX compiler limitation */ #if defined(vax) @@ -46,7 +46,7 @@ typedef struct timeval osi_timeval_t; #endif /* !KERNEL */ #define XSTATS_DECLS struct afs_stats_opTimingData *opP; \ - osi_timeval_t opStartTime, opStopTime, elapsedTime; + osi_timeval_t opStartTime, opStopTime, elapsedTime; #define XSTATS_START_TIME(arg) \ opP = &(afs_stats_cmfullperf.rpc.fsRPCTimes[arg]); \ @@ -82,567 +82,567 @@ struct afs_MeanStats { * function call. */ struct afs_CMCallStats { - afs_int32 C_afs_init; /* afs_aix_subr.c*/ - afs_int32 C_gop_rdwr; /* afs_aix_subr.c*/ - afs_int32 C_aix_gnode_rele; /* afs_aix_subr.c*/ - afs_int32 C_gettimeofday; /* afs_aix_subr.c*/ - afs_int32 C_m_cpytoc; /* afs_aix_subr.c*/ - afs_int32 C_aix_vattr_null; /* afs_aix_subr.c*/ - afs_int32 C_afs_gn_ftrunc; /* afs_aixops.c*/ - afs_int32 C_afs_gn_rdwr; /* afs_aixops.c*/ - afs_int32 C_afs_gn_ioctl; /* afs_aixops.c*/ - afs_int32 C_afs_gn_lockctl; /* afs_aixops.c*/ - afs_int32 C_afs_gn_readlink; /* afs_aixops.c*/ - afs_int32 C_afs_gn_readdir; /* afs_aixops.c*/ - afs_int32 C_afs_gn_select; /* afs_aixops.c*/ - afs_int32 C_afs_gn_strategy; /* afs_aixops.c*/ - afs_int32 C_afs_gn_symlink; /* afs_aixops.c*/ - afs_int32 C_afs_gn_revoke; /* afs_aixops.c*/ - afs_int32 C_afs_gn_link; /* afs_aixops.c*/ - afs_int32 C_afs_gn_mkdir; /* afs_aixops.c*/ - afs_int32 C_afs_gn_mknod; /* afs_aixops.c*/ - afs_int32 C_afs_gn_remove; /* afs_aixops.c*/ - afs_int32 C_afs_gn_rename; /* afs_aixops.c*/ - afs_int32 C_afs_gn_rmdir; /* afs_aixops.c*/ - afs_int32 C_afs_gn_fid; /* afs_aixops.c*/ - afs_int32 C_afs_gn_lookup; /* afs_aixops.c*/ - afs_int32 C_afs_gn_open; /* afs_aixops.c*/ - afs_int32 C_afs_gn_create; /* afs_aixops.c*/ - afs_int32 C_afs_gn_hold; /* afs_aixops.c*/ - afs_int32 C_afs_gn_close; /* afs_aixops.c*/ - afs_int32 C_afs_gn_map; /* afs_aixops.c*/ - afs_int32 C_afs_gn_rele; /* afs_aixops.c*/ - afs_int32 C_afs_gn_unmap; /* afs_aixops.c*/ - afs_int32 C_afs_gn_access; /* afs_aixops.c*/ - afs_int32 C_afs_gn_getattr; /* afs_aixops.c*/ - afs_int32 C_afs_gn_setattr; /* afs_aixops.c*/ - afs_int32 C_afs_gn_fclear; /* afs_aixops.c*/ - afs_int32 C_afs_gn_fsync; /* afs_aixops.c*/ - afs_int32 C_pHash; /* afs_buffer.c*/ - afs_int32 C_DInit; /* afs_buffer.c*/ - afs_int32 C_DRead; /* afs_buffer.c*/ - afs_int32 C_FixupBucket; /* afs_buffer.c*/ - afs_int32 C_afs_newslot; /* afs_buffer.c*/ - afs_int32 C_DRelease; /* afs_buffer.c*/ - afs_int32 C_DFlush; /* afs_buffer.c*/ - afs_int32 C_DFlushEntry; /* afs_buffer.c*/ - afs_int32 C_DVOffset; /* afs_buffer.c*/ - afs_int32 C_DZap; /* afs_buffer.c*/ - afs_int32 C_DNew; /* afs_buffer.c*/ - afs_int32 C_shutdown_bufferpackage; /* afs_buffer.c*/ - afs_int32 C_afs_CheckKnownBad; /* afs_cache.c*/ - afs_int32 C_afs_RemoveVCB; /* afs_cache.c*/ - afs_int32 C_afs_NewVCache; /* afs_cache.c*/ - afs_int32 C_afs_FlushActiveVcaches; /* afs_cache.c*/ - afs_int32 C_afs_VerifyVCache; /* afs_cache.c*/ - afs_int32 C_afs_WriteVCache; /* afs_cache.c*/ - afs_int32 C_afs_GetVCache; /* afs_cache.c*/ - afs_int32 C_afs_StuffVcache; /* afs_cache.c*/ - afs_int32 C_afs_FindVCache; /* afs_cache.c*/ - afs_int32 C_afs_PutDCache; /* afs_cache.c*/ - afs_int32 C_afs_PutVCache; /* afs_cache.c*/ - afs_int32 C_CacheStoreProc; /* afs_cache.c*/ - afs_int32 C_afs_FindDCache; /* afs_cache.c*/ - afs_int32 C_afs_TryToSmush; /* afs_cache.c*/ - afs_int32 C_afs_AdjustSize; /* afs_cache.c*/ - afs_int32 C_afs_CheckSize; /* afs_cache.c*/ - afs_int32 C_afs_StoreWarn; /* afs_cache.c*/ - afs_int32 C_CacheFetchProc; /* afs_cache.c*/ - afs_int32 C_UFS_CacheStoreProc; /* afs_cache.c*/ - afs_int32 C_UFS_CacheFetchProc; /* afs_cache.c*/ - afs_int32 C_afs_GetDCache; /* afs_cache.c*/ - afs_int32 C_afs_SimpleVStat; /* afs_cache.c*/ - afs_int32 C_afs_ProcessFS; /* afs_cache.c*/ - afs_int32 C_afs_InitCacheInfo; /* afs_cache.c*/ - afs_int32 C_afs_InitVolumeInfo; /* afs_cache.c*/ - afs_int32 C_afs_InitCacheFile; /* afs_cache.c*/ - afs_int32 C_afs_CacheInit; /* afs_cache.c*/ - afs_int32 C_afs_GetDSlot; /* afs_cache.c*/ - afs_int32 C_afs_WriteThroughDSlots; /* afs_cache.c*/ - afs_int32 C_afs_MemGetDSlot; /* afs_cache.c*/ - afs_int32 C_afs_UFSGetDSlot; /* afs_cache.c*/ - afs_int32 C_afs_StoreDCache; /* afs_cache.c*/ - afs_int32 C_afs_StoreMini; /* afs_cache.c*/ - afs_int32 C_shutdown_cache; /* afs_cache.c*/ - afs_int32 C_afs_StoreAllSegments; /* afs_cache.c*/ - afs_int32 C_afs_InvalidateAllSegments; /* afs_cache.c*/ - afs_int32 C_afs_TruncateAllSegments; /* afs_cache.c*/ - afs_int32 C_afs_CheckVolSync; /* afs_cache.c*/ - afs_int32 C_afs_wakeup; /* afs_cache.c*/ - afs_int32 C_afs_CFileOpen; /* afs_cache.c*/ - afs_int32 C_afs_CFileTruncate; /* afs_cache.c*/ - afs_int32 C_afs_GetDownD; /* afs_cache.c*/ - afs_int32 C_afs_WriteDCache; /* afs_cache.c*/ - afs_int32 C_afs_FlushDCache; /* afs_cache.c*/ - afs_int32 C_afs_GetDownDSlot; /* afs_cache.c*/ - afs_int32 C_afs_FlushVCache; /* afs_cache.c*/ - afs_int32 C_afs_GetDownV; /* afs_cache.c*/ - afs_int32 C_afs_QueueVCB; /* afs_cache.c*/ - afs_int32 C_afs_call; /* afs_call.c */ - afs_int32 C_afs_syscall_call; /* afs_call.c*/ - afs_int32 C_syscall; /* afs_call.c*/ - afs_int32 C_lpioctl; /* afs_call.c*/ - afs_int32 C_lsetpag; /* afs_call.c*/ - afs_int32 C_afs_syscall; /* afs_call.c*/ - afs_int32 C_afs_CheckInit; /* afs_call.c*/ - afs_int32 C_afs_shutdown; /* afs_call.c*/ - afs_int32 C_shutdown_BKG; /* afs_call.c*/ - afs_int32 C_shutdown_afstest; /* afs_call.c*/ - afs_int32 C_SRXAFSCB_GetCE; /* afs_callback.c*/ - afs_int32 C_ClearCallBack; /* afs_callback.c*/ - afs_int32 C_SRXAFSCB_GetLock; /* afs_callback.c*/ - afs_int32 C_SRXAFSCB_CallBack; /* afs_callback.c*/ - afs_int32 C_SRXAFSCB_InitCallBackState; /* afs_callback.c*/ - afs_int32 C_SRXAFSCB_Probe; /* afs_callback.c*/ - afs_int32 C_afs_RXCallBackServer; /* afs_callback.c*/ - afs_int32 C_shutdown_CB; /* afs_callback.c*/ - afs_int32 C_afs_Chunk; /* afs_chunk.c*/ - afs_int32 C_afs_ChunkBase; /* afs_chunk.c*/ - afs_int32 C_afs_ChunkOffset; /* afs_chunk.c*/ - afs_int32 C_afs_ChunkSize; /* afs_chunk.c*/ - afs_int32 C_afs_ChunkToBase; /* afs_chunk.c*/ - afs_int32 C_afs_ChunkToSize; /* afs_chunk.c*/ - afs_int32 C_afs_SetChunkSize; /* afs_chunk.c*/ - - afs_int32 C_afs_config; /* afs_config.c*/ - afs_int32 C_mem_freebytes; /* afs_config.c*/ - afs_int32 C_mem_getbytes; /* afs_config.c*/ - afs_int32 C_fpalloc; /* afs_config.c*/ - afs_int32 C_kluge_init; /* afs_config.c*/ - afs_int32 C_ufdalloc; /* afs_config.c*/ - afs_int32 C_ufdfree; /* afs_config.c*/ - afs_int32 C_commit; /* afs_config.c*/ - afs_int32 C_dev_ialloc; /* afs_config.c*/ - afs_int32 C_ffree; /* afs_config.c*/ - afs_int32 C_iget; /* afs_config.c*/ - afs_int32 C_iptovp; /* afs_config.c*/ - afs_int32 C_ilock; /* afs_config.c*/ - afs_int32 C_irele; /* afs_config.c*/ - afs_int32 C_iput; /* afs_config.c*/ - - afs_int32 C_afs_Daemon; /* afs_daemons.c*/ - afs_int32 C_afs_CheckRootVolume; /* afs_daemons.c*/ - afs_int32 C_BPath; /* afs_daemons.c*/ - afs_int32 C_BPrefetch; /* afs_daemons.c*/ - afs_int32 C_BStore; /* afs_daemons.c*/ - afs_int32 C_afs_BBusy; /* afs_daemons.c*/ - afs_int32 C_afs_BQueue; /* afs_daemons.c*/ - afs_int32 C_afs_BRelease; /* afs_daemons.c*/ - afs_int32 C_afs_BackgroundDaemon; /* afs_daemons.c*/ - afs_int32 C_shutdown_daemons; /* afs_daemons.c*/ - afs_int32 C_exporter_add; /* afs_exporter.c*/ - afs_int32 C_exporter_find; /* afs_exporter.c*/ - afs_int32 C_afs_gfs_kalloc; /* afs_gfs_subr.c*/ - afs_int32 C_IsAfsVnode; /* afs_gfs_subr.c*/ - afs_int32 C_SetAfsVnode; /* afs_gfs_subr.c*/ - afs_int32 C_afs_gfs_kfree; /* afs_gfs_subr.c*/ - afs_int32 C_gop_lookupname; /* afs_gfs_subr.c*/ - afs_int32 C_gfsvop_getattr; /* afs_gfs_subr.c*/ - afs_int32 C_gfsvop_rdwr; /* afs_gfs_subr.c*/ - afs_int32 C_afs_uniqtime; /* afs_gfs_subr.c*/ - afs_int32 C_gfs_vattr_null; /* afs_gfs_subr.c*/ - afs_int32 C_afs_lock; /* afs_gfsops.c*/ - afs_int32 C_afs_unlock; /* afs_gfsops.c*/ - afs_int32 C_afs_update; /* afs_gfsops.c*/ - afs_int32 C_afs_gclose; /* afs_gfsops.c*/ - afs_int32 C_afs_gopen; /* afs_gfsops.c*/ - afs_int32 C_afs_greadlink; /* afs_gfsops.c*/ - afs_int32 C_afs_select; /* afs_gfsops.c*/ - afs_int32 C_afs_gbmap; /* afs_gfsops.c*/ - afs_int32 C_afs_getfsdata; /* afs_gfsops.c*/ - afs_int32 C_afs_gsymlink; /* afs_gfsops.c*/ - afs_int32 C_afs_namei; /* afs_gfsops.c*/ - afs_int32 C_printgnode; /* afs_gfsops.c*/ - afs_int32 C_HaveGFSLock; /* afs_gfsops.c*/ - afs_int32 C_afs_gmount; /* afs_gfsops.c*/ - afs_int32 C_AddGFSLock; /* afs_gfsops.c*/ - afs_int32 C_RemoveGFSLock; /* afs_gfsops.c*/ - afs_int32 C_afs_grlock; /* afs_gfsops.c*/ - afs_int32 C_afs_gumount; /* afs_gfsops.c*/ - afs_int32 C_afs_gget; /* afs_gfsops.c*/ - afs_int32 C_afs_glink; /* afs_gfsops.c*/ - afs_int32 C_afs_gmkdir; /* afs_gfsops.c*/ - afs_int32 C_afs_sbupdate; /* afs_gfsops.c*/ - afs_int32 C_afs_unlink; /* afs_gfsops.c*/ - afs_int32 C_afs_grmdir; /* afs_gfsops.c*/ - afs_int32 C_afs_makenode; /* afs_gfsops.c*/ - afs_int32 C_afs_grename; /* afs_gfsops.c*/ - afs_int32 C_afs_rele; /* afs_gfsops.c*/ - afs_int32 C_afs_syncgp; /* afs_gfsops.c*/ - afs_int32 C_afs_getval; /* afs_gfsops.c*/ - afs_int32 C_afs_gfshack; /* afs_gfsops.c*/ - afs_int32 C_afs_trunc; /* afs_gfsops.c*/ - afs_int32 C_afs_rwgp; /* afs_gfsops.c*/ - afs_int32 C_afs_stat; /* afs_gfsops.c*/ - afs_int32 C_afsc_link; /* afs_hp_subr.c*/ - afs_int32 C_hpsobind; /* afs_hp_subr.c*/ - afs_int32 C_hpsoclose; /* afs_hp_subr.c*/ - afs_int32 C_hpsocreate; /* afs_hp_subr.c*/ - afs_int32 C_hpsoreserve; /* afs_hp_subr.c*/ - afs_int32 C_afs_vfs_mount; /* afs_hp_subr.c*/ - afs_int32 C_devtovfs; /* afs_istuff.c*/ - afs_int32 C_igetinode; /* afs_istuff.c*/ - afs_int32 C_afs_syscall_iopen; /* afs_istuff.c*/ - afs_int32 C_iopen; /* afs_istuff.c*/ - afs_int32 C_afs_syscall_iincdec; /* afs_istuff.c*/ - afs_int32 C_afs_syscall_ireadwrite; /* afs_istuff.c*/ - afs_int32 C_iincdec; /* afs_istuff.c*/ - afs_int32 C_ireadwrite; /* afs_istuff.c*/ - afs_int32 C_oiread; /* afs_istuff.c*/ - afs_int32 C_AHash; /* afs_istuff.c*/ - afs_int32 C_QTOA; /* afs_istuff.c*/ - afs_int32 C_afs_FindPartByDev; /* afs_istuff.c*/ - afs_int32 C_aux_init; /* afs_istuff.c*/ - afs_int32 C_afs_GetNewPart; /* afs_istuff.c*/ - afs_int32 C_afs_InitAuxVolFile; /* afs_istuff.c*/ - afs_int32 C_afs_CreateAuxEntry; /* afs_istuff.c*/ - afs_int32 C_afs_GetAuxSlot; /* afs_istuff.c*/ - afs_int32 C_afs_GetDownAux; /* afs_istuff.c*/ - afs_int32 C_afs_FlushAuxCache; /* afs_istuff.c*/ - afs_int32 C_afs_GetAuxInode; /* afs_istuff.c*/ - afs_int32 C_afs_PutAuxInode; /* afs_istuff.c*/ - afs_int32 C_afs_ReadAuxInode; /* afs_istuff.c*/ - afs_int32 C_afs_WriteAuxInode; /* afs_istuff.c*/ - afs_int32 C_afs_auxcall; /* afs_istuff.c*/ - afs_int32 C_tmpdbg_auxtbl; /* afs_istuff.c*/ - afs_int32 C_tmpdbg_parttbl; /* afs_istuff.c*/ - afs_int32 C_idec; /* afs_istuff.c*/ - afs_int32 C_iinc; /* afs_istuff.c*/ - afs_int32 C_iread; /* afs_istuff.c*/ - afs_int32 C_iwrite; /* afs_istuff.c*/ - afs_int32 C_getinode; /* afs_istuff.c*/ - afs_int32 C_trygetfs; /* afs_istuff.c*/ - afs_int32 C_iforget; /* afs_istuff.c*/ - afs_int32 C_afs_syscall_icreate; /* afs_istuff.c*/ - afs_int32 C_icreate; /* afs_istuff.c*/ - afs_int32 C_Lock_Init; /* afs_lock.c*/ - afs_int32 C_Lock_Obtain; /* afs_lock.c*/ - afs_int32 C_Lock_ReleaseR; /* afs_lock.c*/ - afs_int32 C_Lock_ReleaseW; /* afs_lock.c*/ - afs_int32 C_afs_BozonLock; /* afs_lock.c*/ - afs_int32 C_afs_BozonUnlock; /* afs_lock.c*/ - afs_int32 C_osi_SleepR; /* afs_lock.c*/ - afs_int32 C_osi_SleepS; /* afs_lock.c*/ - afs_int32 C_osi_SleepW; /* afs_lock.c*/ - afs_int32 C_osi_Sleep; /* afs_lock */ - afs_int32 C_afs_BozonInit; /* afs_lock.c*/ - afs_int32 C_afs_CheckBozonLock; /* afs_lock.c*/ - afs_int32 C_afs_CheckBozonLockBlocking; /* afs_lock.c*/ - afs_int32 C_xxxinit; /* afs_main.c*/ - afs_int32 C_KernelEntry; /* afs_main.c*/ - afs_int32 C_afs_InitMemCache; /* afs_memcache.c*/ - afs_int32 C_afs_LookupMCE; /* afs_memcache.c*/ - afs_int32 C_afs_MemReadBlk; /* afs_memcache.c*/ - afs_int32 C_afs_MemReadUIO; /* afs_memcache.c*/ - afs_int32 C_afs_MemWriteBlk; /* afs_memcache.c*/ - afs_int32 C_afs_MemCacheStoreProc; /* afs_memcache.c*/ - afs_int32 C_afs_MemCacheTruncate; /* afs_memcache.c*/ - afs_int32 C_afs_MemWriteUIO; /* afs_memcache.c*/ - afs_int32 C_afs_MemCacheFetchProc; /* afs_memcache.c*/ - afs_int32 C_afs_vnode_pager_create; /* afs_next_aux.c*/ - afs_int32 C_next_KernelEntry; /* afs_next_subr.c*/ - afs_int32 C_afs_GetNfsClientPag; /* afs_nfsclnt.c*/ - afs_int32 C_afs_FindNfsClientPag; /* afs_nfsclnt.c*/ - afs_int32 C_afs_PutNfsClientPag; /* afs_nfsclnt.c*/ - afs_int32 C_afs_nfsclient_reqhandler; /* afs_nfsclnt.c*/ - afs_int32 C_afs_nfsclient_GC; /* afs_nfsclnt.c*/ - afs_int32 C_afs_nfsclient_hold; /* afs_nfsclnt.c*/ - afs_int32 C_afs_nfsclient_stats; /* afs_nfsclnt.c*/ - afs_int32 C_afs_nfsclient_sysname; /* afs_nfsclnt.c*/ - afs_int32 C_afs_nfsclient_shutdown; /* afs_nfsclnt.c*/ + afs_int32 C_afs_init; /* afs_aix_subr.c */ + afs_int32 C_gop_rdwr; /* afs_aix_subr.c */ + afs_int32 C_aix_gnode_rele; /* afs_aix_subr.c */ + afs_int32 C_gettimeofday; /* afs_aix_subr.c */ + afs_int32 C_m_cpytoc; /* afs_aix_subr.c */ + afs_int32 C_aix_vattr_null; /* afs_aix_subr.c */ + afs_int32 C_afs_gn_ftrunc; /* afs_aixops.c */ + afs_int32 C_afs_gn_rdwr; /* afs_aixops.c */ + afs_int32 C_afs_gn_ioctl; /* afs_aixops.c */ + afs_int32 C_afs_gn_lockctl; /* afs_aixops.c */ + afs_int32 C_afs_gn_readlink; /* afs_aixops.c */ + afs_int32 C_afs_gn_readdir; /* afs_aixops.c */ + afs_int32 C_afs_gn_select; /* afs_aixops.c */ + afs_int32 C_afs_gn_strategy; /* afs_aixops.c */ + afs_int32 C_afs_gn_symlink; /* afs_aixops.c */ + afs_int32 C_afs_gn_revoke; /* afs_aixops.c */ + afs_int32 C_afs_gn_link; /* afs_aixops.c */ + afs_int32 C_afs_gn_mkdir; /* afs_aixops.c */ + afs_int32 C_afs_gn_mknod; /* afs_aixops.c */ + afs_int32 C_afs_gn_remove; /* afs_aixops.c */ + afs_int32 C_afs_gn_rename; /* afs_aixops.c */ + afs_int32 C_afs_gn_rmdir; /* afs_aixops.c */ + afs_int32 C_afs_gn_fid; /* afs_aixops.c */ + afs_int32 C_afs_gn_lookup; /* afs_aixops.c */ + afs_int32 C_afs_gn_open; /* afs_aixops.c */ + afs_int32 C_afs_gn_create; /* afs_aixops.c */ + afs_int32 C_afs_gn_hold; /* afs_aixops.c */ + afs_int32 C_afs_gn_close; /* afs_aixops.c */ + afs_int32 C_afs_gn_map; /* afs_aixops.c */ + afs_int32 C_afs_gn_rele; /* afs_aixops.c */ + afs_int32 C_afs_gn_unmap; /* afs_aixops.c */ + afs_int32 C_afs_gn_access; /* afs_aixops.c */ + afs_int32 C_afs_gn_getattr; /* afs_aixops.c */ + afs_int32 C_afs_gn_setattr; /* afs_aixops.c */ + afs_int32 C_afs_gn_fclear; /* afs_aixops.c */ + afs_int32 C_afs_gn_fsync; /* afs_aixops.c */ + afs_int32 C_pHash; /* afs_buffer.c */ + afs_int32 C_DInit; /* afs_buffer.c */ + afs_int32 C_DRead; /* afs_buffer.c */ + afs_int32 C_FixupBucket; /* afs_buffer.c */ + afs_int32 C_afs_newslot; /* afs_buffer.c */ + afs_int32 C_DRelease; /* afs_buffer.c */ + afs_int32 C_DFlush; /* afs_buffer.c */ + afs_int32 C_DFlushEntry; /* afs_buffer.c */ + afs_int32 C_DVOffset; /* afs_buffer.c */ + afs_int32 C_DZap; /* afs_buffer.c */ + afs_int32 C_DNew; /* afs_buffer.c */ + afs_int32 C_shutdown_bufferpackage; /* afs_buffer.c */ + afs_int32 C_afs_CheckKnownBad; /* afs_cache.c */ + afs_int32 C_afs_RemoveVCB; /* afs_cache.c */ + afs_int32 C_afs_NewVCache; /* afs_cache.c */ + afs_int32 C_afs_FlushActiveVcaches; /* afs_cache.c */ + afs_int32 C_afs_VerifyVCache; /* afs_cache.c */ + afs_int32 C_afs_WriteVCache; /* afs_cache.c */ + afs_int32 C_afs_GetVCache; /* afs_cache.c */ + afs_int32 C_afs_StuffVcache; /* afs_cache.c */ + afs_int32 C_afs_FindVCache; /* afs_cache.c */ + afs_int32 C_afs_PutDCache; /* afs_cache.c */ + afs_int32 C_afs_PutVCache; /* afs_cache.c */ + afs_int32 C_CacheStoreProc; /* afs_cache.c */ + afs_int32 C_afs_FindDCache; /* afs_cache.c */ + afs_int32 C_afs_TryToSmush; /* afs_cache.c */ + afs_int32 C_afs_AdjustSize; /* afs_cache.c */ + afs_int32 C_afs_CheckSize; /* afs_cache.c */ + afs_int32 C_afs_StoreWarn; /* afs_cache.c */ + afs_int32 C_CacheFetchProc; /* afs_cache.c */ + afs_int32 C_UFS_CacheStoreProc; /* afs_cache.c */ + afs_int32 C_UFS_CacheFetchProc; /* afs_cache.c */ + afs_int32 C_afs_GetDCache; /* afs_cache.c */ + afs_int32 C_afs_SimpleVStat; /* afs_cache.c */ + afs_int32 C_afs_ProcessFS; /* afs_cache.c */ + afs_int32 C_afs_InitCacheInfo; /* afs_cache.c */ + afs_int32 C_afs_InitVolumeInfo; /* afs_cache.c */ + afs_int32 C_afs_InitCacheFile; /* afs_cache.c */ + afs_int32 C_afs_CacheInit; /* afs_cache.c */ + afs_int32 C_afs_GetDSlot; /* afs_cache.c */ + afs_int32 C_afs_WriteThroughDSlots; /* afs_cache.c */ + afs_int32 C_afs_MemGetDSlot; /* afs_cache.c */ + afs_int32 C_afs_UFSGetDSlot; /* afs_cache.c */ + afs_int32 C_afs_StoreDCache; /* afs_cache.c */ + afs_int32 C_afs_StoreMini; /* afs_cache.c */ + afs_int32 C_shutdown_cache; /* afs_cache.c */ + afs_int32 C_afs_StoreAllSegments; /* afs_cache.c */ + afs_int32 C_afs_InvalidateAllSegments; /* afs_cache.c */ + afs_int32 C_afs_TruncateAllSegments; /* afs_cache.c */ + afs_int32 C_afs_CheckVolSync; /* afs_cache.c */ + afs_int32 C_afs_wakeup; /* afs_cache.c */ + afs_int32 C_afs_CFileOpen; /* afs_cache.c */ + afs_int32 C_afs_CFileTruncate; /* afs_cache.c */ + afs_int32 C_afs_GetDownD; /* afs_cache.c */ + afs_int32 C_afs_WriteDCache; /* afs_cache.c */ + afs_int32 C_afs_FlushDCache; /* afs_cache.c */ + afs_int32 C_afs_GetDownDSlot; /* afs_cache.c */ + afs_int32 C_afs_FlushVCache; /* afs_cache.c */ + afs_int32 C_afs_GetDownV; /* afs_cache.c */ + afs_int32 C_afs_QueueVCB; /* afs_cache.c */ + afs_int32 C_afs_call; /* afs_call.c */ + afs_int32 C_afs_syscall_call; /* afs_call.c */ + afs_int32 C_syscall; /* afs_call.c */ + afs_int32 C_lpioctl; /* afs_call.c */ + afs_int32 C_lsetpag; /* afs_call.c */ + afs_int32 C_afs_syscall; /* afs_call.c */ + afs_int32 C_afs_CheckInit; /* afs_call.c */ + afs_int32 C_afs_shutdown; /* afs_call.c */ + afs_int32 C_shutdown_BKG; /* afs_call.c */ + afs_int32 C_shutdown_afstest; /* afs_call.c */ + afs_int32 C_SRXAFSCB_GetCE; /* afs_callback.c */ + afs_int32 C_ClearCallBack; /* afs_callback.c */ + afs_int32 C_SRXAFSCB_GetLock; /* afs_callback.c */ + afs_int32 C_SRXAFSCB_CallBack; /* afs_callback.c */ + afs_int32 C_SRXAFSCB_InitCallBackState; /* afs_callback.c */ + afs_int32 C_SRXAFSCB_Probe; /* afs_callback.c */ + afs_int32 C_afs_RXCallBackServer; /* afs_callback.c */ + afs_int32 C_shutdown_CB; /* afs_callback.c */ + afs_int32 C_afs_Chunk; /* afs_chunk.c */ + afs_int32 C_afs_ChunkBase; /* afs_chunk.c */ + afs_int32 C_afs_ChunkOffset; /* afs_chunk.c */ + afs_int32 C_afs_ChunkSize; /* afs_chunk.c */ + afs_int32 C_afs_ChunkToBase; /* afs_chunk.c */ + afs_int32 C_afs_ChunkToSize; /* afs_chunk.c */ + afs_int32 C_afs_SetChunkSize; /* afs_chunk.c */ + + afs_int32 C_afs_config; /* afs_config.c */ + afs_int32 C_mem_freebytes; /* afs_config.c */ + afs_int32 C_mem_getbytes; /* afs_config.c */ + afs_int32 C_fpalloc; /* afs_config.c */ + afs_int32 C_kluge_init; /* afs_config.c */ + afs_int32 C_ufdalloc; /* afs_config.c */ + afs_int32 C_ufdfree; /* afs_config.c */ + afs_int32 C_commit; /* afs_config.c */ + afs_int32 C_dev_ialloc; /* afs_config.c */ + afs_int32 C_ffree; /* afs_config.c */ + afs_int32 C_iget; /* afs_config.c */ + afs_int32 C_iptovp; /* afs_config.c */ + afs_int32 C_ilock; /* afs_config.c */ + afs_int32 C_irele; /* afs_config.c */ + afs_int32 C_iput; /* afs_config.c */ + + afs_int32 C_afs_Daemon; /* afs_daemons.c */ + afs_int32 C_afs_CheckRootVolume; /* afs_daemons.c */ + afs_int32 C_BPath; /* afs_daemons.c */ + afs_int32 C_BPrefetch; /* afs_daemons.c */ + afs_int32 C_BStore; /* afs_daemons.c */ + afs_int32 C_afs_BBusy; /* afs_daemons.c */ + afs_int32 C_afs_BQueue; /* afs_daemons.c */ + afs_int32 C_afs_BRelease; /* afs_daemons.c */ + afs_int32 C_afs_BackgroundDaemon; /* afs_daemons.c */ + afs_int32 C_shutdown_daemons; /* afs_daemons.c */ + afs_int32 C_exporter_add; /* afs_exporter.c */ + afs_int32 C_exporter_find; /* afs_exporter.c */ + afs_int32 C_afs_gfs_kalloc; /* afs_gfs_subr.c */ + afs_int32 C_IsAfsVnode; /* afs_gfs_subr.c */ + afs_int32 C_SetAfsVnode; /* afs_gfs_subr.c */ + afs_int32 C_afs_gfs_kfree; /* afs_gfs_subr.c */ + afs_int32 C_gop_lookupname; /* afs_gfs_subr.c */ + afs_int32 C_gfsvop_getattr; /* afs_gfs_subr.c */ + afs_int32 C_gfsvop_rdwr; /* afs_gfs_subr.c */ + afs_int32 C_afs_uniqtime; /* afs_gfs_subr.c */ + afs_int32 C_gfs_vattr_null; /* afs_gfs_subr.c */ + afs_int32 C_afs_lock; /* afs_gfsops.c */ + afs_int32 C_afs_unlock; /* afs_gfsops.c */ + afs_int32 C_afs_update; /* afs_gfsops.c */ + afs_int32 C_afs_gclose; /* afs_gfsops.c */ + afs_int32 C_afs_gopen; /* afs_gfsops.c */ + afs_int32 C_afs_greadlink; /* afs_gfsops.c */ + afs_int32 C_afs_select; /* afs_gfsops.c */ + afs_int32 C_afs_gbmap; /* afs_gfsops.c */ + afs_int32 C_afs_getfsdata; /* afs_gfsops.c */ + afs_int32 C_afs_gsymlink; /* afs_gfsops.c */ + afs_int32 C_afs_namei; /* afs_gfsops.c */ + afs_int32 C_printgnode; /* afs_gfsops.c */ + afs_int32 C_HaveGFSLock; /* afs_gfsops.c */ + afs_int32 C_afs_gmount; /* afs_gfsops.c */ + afs_int32 C_AddGFSLock; /* afs_gfsops.c */ + afs_int32 C_RemoveGFSLock; /* afs_gfsops.c */ + afs_int32 C_afs_grlock; /* afs_gfsops.c */ + afs_int32 C_afs_gumount; /* afs_gfsops.c */ + afs_int32 C_afs_gget; /* afs_gfsops.c */ + afs_int32 C_afs_glink; /* afs_gfsops.c */ + afs_int32 C_afs_gmkdir; /* afs_gfsops.c */ + afs_int32 C_afs_sbupdate; /* afs_gfsops.c */ + afs_int32 C_afs_unlink; /* afs_gfsops.c */ + afs_int32 C_afs_grmdir; /* afs_gfsops.c */ + afs_int32 C_afs_makenode; /* afs_gfsops.c */ + afs_int32 C_afs_grename; /* afs_gfsops.c */ + afs_int32 C_afs_rele; /* afs_gfsops.c */ + afs_int32 C_afs_syncgp; /* afs_gfsops.c */ + afs_int32 C_afs_getval; /* afs_gfsops.c */ + afs_int32 C_afs_gfshack; /* afs_gfsops.c */ + afs_int32 C_afs_trunc; /* afs_gfsops.c */ + afs_int32 C_afs_rwgp; /* afs_gfsops.c */ + afs_int32 C_afs_stat; /* afs_gfsops.c */ + afs_int32 C_afsc_link; /* afs_hp_subr.c */ + afs_int32 C_hpsobind; /* afs_hp_subr.c */ + afs_int32 C_hpsoclose; /* afs_hp_subr.c */ + afs_int32 C_hpsocreate; /* afs_hp_subr.c */ + afs_int32 C_hpsoreserve; /* afs_hp_subr.c */ + afs_int32 C_afs_vfs_mount; /* afs_hp_subr.c */ + afs_int32 C_devtovfs; /* afs_istuff.c */ + afs_int32 C_igetinode; /* afs_istuff.c */ + afs_int32 C_afs_syscall_iopen; /* afs_istuff.c */ + afs_int32 C_iopen; /* afs_istuff.c */ + afs_int32 C_afs_syscall_iincdec; /* afs_istuff.c */ + afs_int32 C_afs_syscall_ireadwrite; /* afs_istuff.c */ + afs_int32 C_iincdec; /* afs_istuff.c */ + afs_int32 C_ireadwrite; /* afs_istuff.c */ + afs_int32 C_oiread; /* afs_istuff.c */ + afs_int32 C_AHash; /* afs_istuff.c */ + afs_int32 C_QTOA; /* afs_istuff.c */ + afs_int32 C_afs_FindPartByDev; /* afs_istuff.c */ + afs_int32 C_aux_init; /* afs_istuff.c */ + afs_int32 C_afs_GetNewPart; /* afs_istuff.c */ + afs_int32 C_afs_InitAuxVolFile; /* afs_istuff.c */ + afs_int32 C_afs_CreateAuxEntry; /* afs_istuff.c */ + afs_int32 C_afs_GetAuxSlot; /* afs_istuff.c */ + afs_int32 C_afs_GetDownAux; /* afs_istuff.c */ + afs_int32 C_afs_FlushAuxCache; /* afs_istuff.c */ + afs_int32 C_afs_GetAuxInode; /* afs_istuff.c */ + afs_int32 C_afs_PutAuxInode; /* afs_istuff.c */ + afs_int32 C_afs_ReadAuxInode; /* afs_istuff.c */ + afs_int32 C_afs_WriteAuxInode; /* afs_istuff.c */ + afs_int32 C_afs_auxcall; /* afs_istuff.c */ + afs_int32 C_tmpdbg_auxtbl; /* afs_istuff.c */ + afs_int32 C_tmpdbg_parttbl; /* afs_istuff.c */ + afs_int32 C_idec; /* afs_istuff.c */ + afs_int32 C_iinc; /* afs_istuff.c */ + afs_int32 C_iread; /* afs_istuff.c */ + afs_int32 C_iwrite; /* afs_istuff.c */ + afs_int32 C_getinode; /* afs_istuff.c */ + afs_int32 C_trygetfs; /* afs_istuff.c */ + afs_int32 C_iforget; /* afs_istuff.c */ + afs_int32 C_afs_syscall_icreate; /* afs_istuff.c */ + afs_int32 C_icreate; /* afs_istuff.c */ + afs_int32 C_Lock_Init; /* afs_lock.c */ + afs_int32 C_Lock_Obtain; /* afs_lock.c */ + afs_int32 C_Lock_ReleaseR; /* afs_lock.c */ + afs_int32 C_Lock_ReleaseW; /* afs_lock.c */ + afs_int32 C_afs_BozonLock; /* afs_lock.c */ + afs_int32 C_afs_BozonUnlock; /* afs_lock.c */ + afs_int32 C_osi_SleepR; /* afs_lock.c */ + afs_int32 C_osi_SleepS; /* afs_lock.c */ + afs_int32 C_osi_SleepW; /* afs_lock.c */ + afs_int32 C_osi_Sleep; /* afs_lock */ + afs_int32 C_afs_BozonInit; /* afs_lock.c */ + afs_int32 C_afs_CheckBozonLock; /* afs_lock.c */ + afs_int32 C_afs_CheckBozonLockBlocking; /* afs_lock.c */ + afs_int32 C_xxxinit; /* afs_main.c */ + afs_int32 C_KernelEntry; /* afs_main.c */ + afs_int32 C_afs_InitMemCache; /* afs_memcache.c */ + afs_int32 C_afs_LookupMCE; /* afs_memcache.c */ + afs_int32 C_afs_MemReadBlk; /* afs_memcache.c */ + afs_int32 C_afs_MemReadUIO; /* afs_memcache.c */ + afs_int32 C_afs_MemWriteBlk; /* afs_memcache.c */ + afs_int32 C_afs_MemCacheStoreProc; /* afs_memcache.c */ + afs_int32 C_afs_MemCacheTruncate; /* afs_memcache.c */ + afs_int32 C_afs_MemWriteUIO; /* afs_memcache.c */ + afs_int32 C_afs_MemCacheFetchProc; /* afs_memcache.c */ + afs_int32 C_afs_vnode_pager_create; /* afs_next_aux.c */ + afs_int32 C_next_KernelEntry; /* afs_next_subr.c */ + afs_int32 C_afs_GetNfsClientPag; /* afs_nfsclnt.c */ + afs_int32 C_afs_FindNfsClientPag; /* afs_nfsclnt.c */ + afs_int32 C_afs_PutNfsClientPag; /* afs_nfsclnt.c */ + afs_int32 C_afs_nfsclient_reqhandler; /* afs_nfsclnt.c */ + afs_int32 C_afs_nfsclient_GC; /* afs_nfsclnt.c */ + afs_int32 C_afs_nfsclient_hold; /* afs_nfsclnt.c */ + afs_int32 C_afs_nfsclient_stats; /* afs_nfsclnt.c */ + afs_int32 C_afs_nfsclient_sysname; /* afs_nfsclnt.c */ + afs_int32 C_afs_nfsclient_shutdown; /* afs_nfsclnt.c */ afs_int32 C_afs_rfs_readdir_fixup; /* afs_nfssrv.c */ - afs_int32 C_afs_rfs_dispatch; /* afs_nfssrv.c*/ - afs_int32 C_afs_xnfs_svc; /* afs_nfssrv.c*/ - afs_int32 C_afs_xdr_putrddirres; /* afs_nfssrv.c*/ - afs_int32 C_afs_rfs_readdir; /* afs_nfssrv.c*/ - afs_int32 C_afs_rfs_rddirfree; /* afs_nfssrv.c*/ - afs_int32 C_rfs_dupcreate; /* afs_nfssrv.c*/ - afs_int32 C_rfs_dupsetattr; /* afs_nfssrv.c*/ - afs_int32 C_Nfs2AfsCall; /* afs_nfssrv.c*/ - afs_int32 C_afs_sun_xuntext; /* afs_osi.c*/ - afs_int32 C_osi_Active; /* afs_osi.c*/ - afs_int32 C_osi_FlushPages; /* afs_osi.c*/ - afs_int32 C_osi_FlushText; /* afs_osi.c*/ - afs_int32 C_osi_CallProc; /* afs_osi.c*/ - afs_int32 C_osi_CancelProc; /* afs_osi.c*/ - afs_int32 C_osi_Invisible; /* afs_osi.c*/ - afs_int32 C_osi_Time; /* afs_osi.c*/ - afs_int32 C_osi_Alloc; /* afs_osi.c*/ - afs_int32 C_osi_SetTime; /* afs_osi.c*/ - afs_int32 C_osi_Dump; /* afs_osi.c*/ - afs_int32 C_osi_Free; /* afs_osi.c*/ - afs_int32 C_shutdown_osi; /* afs_osi.c*/ - afs_int32 C_osi_UFSOpen; /* afs_osifile.c*/ - afs_int32 C_osi_Close; /* afs_osifile.c*/ - afs_int32 C_osi_Stat; /* afs_osifile.c*/ - afs_int32 C_osi_Truncate; /* afs_osifile.c*/ - afs_int32 C_osi_Read; /* afs_osifile.c*/ - afs_int32 C_osi_Write; /* afs_osifile.c*/ - afs_int32 C_osi_MapStrategy; /* afs_osifile.c*/ - afs_int32 C_shutdown_osifile; /* afs_osifile.c*/ - afs_int32 C_osi_FreeLargeSpace; /* afs_osinet.c*/ - afs_int32 C_osi_FreeSmallSpace; /* afs_osinet.c*/ - afs_int32 C_pkt_iodone; /* afs_osinet.c*/ - afs_int32 C_shutdown_osinet; /* afs_osinet.c*/ - afs_int32 C_afs_cs; /* afs_osinet.c*/ - afs_int32 C_osi_AllocLargeSpace; /* afs_osinet.c*/ - afs_int32 C_osi_AllocSmallSpace; /* afs_osinet.c*/ - afs_int32 C_osi_CloseToTheEdge; /* afs_osinet.c*/ - afs_int32 C_osi_xgreedy; /* afs_osinet.c*/ - afs_int32 C_osi_FreeSocket; /* afs_osinet.c*/ - afs_int32 C_osi_NewSocket; /* afs_osinet.c*/ - afs_int32 C_trysblock; /* afs_osinet.c*/ - afs_int32 C_osi_NetSend; /* afs_osinet.c*/ - afs_int32 C_WaitHack; /* afs_osinet.c*/ - afs_int32 C_osi_CancelWait; /* afs_osinet.c*/ - afs_int32 C_osi_InitWaitHandle; /* afs_osinet.c*/ - afs_int32 C_osi_Wakeup; /* afs_osinet.c*/ - afs_int32 C_osi_Wait; /* afs_osinet.c*/ - afs_int32 C_dirp_Read; /* afs_physio.c*/ - afs_int32 C_dirp_SetCacheDev; /* afs_physio.c*/ - afs_int32 C_Die; /* afs_physio.c*/ - afs_int32 C_dirp_Cpy; /* afs_physio.c*/ - afs_int32 C_dirp_Eq; /* afs_physio.c*/ - afs_int32 C_dirp_Write; /* afs_physio.c*/ - afs_int32 C_dirp_Zap; /* afs_physio.c*/ - afs_int32 C_PSetVolumeStatus; /* afs_pioctl.c*/ - afs_int32 C_PFlush; /* afs_pioctl.c*/ - afs_int32 C_PNewStatMount; /* afs_pioctl.c*/ - afs_int32 C_PGetTokens; /* afs_pioctl.c*/ - afs_int32 C_PUnlog; /* afs_pioctl.c*/ - afs_int32 C_PCheckServers; /* afs_pioctl.c*/ - afs_int32 C_PMariner; /* afs_pioctl.c*/ - afs_int32 C_PCheckAuth; /* afs_pioctl.c*/ - afs_int32 C_PCheckVolNames; /* afs_pioctl.c*/ - afs_int32 C_PFindVolume; /* afs_pioctl.c*/ - afs_int32 C_Prefetch; /* afs_pioctl.c*/ - afs_int32 C_PGetCacheSize; /* afs_pioctl.c*/ - afs_int32 C_PRemoveCallBack; /* afs_pioctl.c*/ - afs_int32 C_PSetCacheSize; /* afs_pioctl.c*/ - afs_int32 C_PViceAccess; /* afs_pioctl.c*/ - afs_int32 C_PListCells; /* afs_pioctl.c*/ - afs_int32 C_PNewCell; /* afs_pioctl.c*/ - afs_int32 C_PRemoveMount; /* afs_pioctl.c*/ - afs_int32 C_HandleIoctl; /* afs_pioctl.c*/ - afs_int32 C__AFSIOCTL; /* afs_pioctl.c*/ - afs_int32 C__VALIDAFSIOCTL; /* afs_pioctl.c*/ - afs_int32 C_PGetCellStatus; /* afs_pioctl.c*/ - afs_int32 C_PSetCellStatus; /* afs_pioctl.c*/ - afs_int32 C_PVenusLogging; /* afs_pioctl.c*/ - afs_int32 C_PFlushVolumeData; /* afs_pioctl.c*/ - afs_int32 C_PSetSysName; /* afs_pioctl.c*/ - afs_int32 C_PExportAfs; /* afs_pioctl.c*/ - afs_int32 C_HandleClientContext; /* afs_pioctl.c*/ - afs_int32 C_afs_ioctl; /* afs_pioctl.c*/ - afs_int32 C_afs_xioctl; /* afs_pioctl.c*/ - afs_int32 C_afs_pioctl; /* afs_pioctl.c*/ - afs_int32 C_afs_syscall_pioctl; /* afs_pioctl.c*/ - afs_int32 C_HandlePioctl; /* afs_pioctl.c*/ - afs_int32 C_PGetAcl; /* afs_pioctl.c*/ - afs_int32 C_PGetFID; /* afs_pioctl.c*/ - afs_int32 C_PSetAcl; /* afs_pioctl.c*/ - afs_int32 C_PBogus; /* afs_pioctl.c*/ - afs_int32 C_PGetFileCell; /* afs_pioctl.c*/ - afs_int32 C_PGetWSCell; /* afs_pioctl.c*/ - afs_int32 C_PNoop; /* afs_pioctl.c*/ - afs_int32 C_PGetUserCell; /* afs_pioctl.c*/ - afs_int32 C_PSetTokens; /* afs_pioctl.c*/ - afs_int32 C_PGetVolumeStatus; /* afs_pioctl.c*/ - afs_int32 C_afs_ResetAccessCache; /* afs_resource.c*/ - afs_int32 C_afs_FindUser; /* afs_resource.c*/ - afs_int32 C_afs_ResetUserConns; /* afs_resource.c*/ - afs_int32 C_afs_ResourceInit; /* afs_resource.c*/ - afs_int32 C_afs_GetCell; /* afs_resource.c*/ - afs_int32 C_afs_GetCellByIndex; /* afs_resource.c*/ - afs_int32 C_afs_GetCellByName; /* afs_resource.c*/ - afs_int32 C_afs_GetRealCellByIndex; /* afs_resource.c*/ - afs_int32 C_afs_NewCell; /* afs_resource.c*/ - afs_int32 C_afs_GetUser; /* afs_resource.c*/ - afs_int32 C_afs_PutUser; /* afs_resource.c*/ - afs_int32 C_afs_SetPrimary; /* afs_resource.c*/ - afs_int32 C_CheckVLDB; /* afs_resource.c*/ - afs_int32 C_afs_GetVolume; /* afs_resource.c*/ - afs_int32 C_afs_GetVolumeByName; /* afs_resource.c*/ - afs_int32 C_InstallVolumeEntry; /* afs_resource.c*/ - afs_int32 C_InstallVolumeInfo; /* afs_resource.c*/ - afs_int32 C_afs_FindServer; /* afs_resource.c*/ - afs_int32 C_afs_PutVolume; /* afs_resource.c*/ - afs_int32 C_afs_random; /* afs_resource.c*/ - afs_int32 C_ranstage; /* afs_resource.c*/ - afs_int32 C_RemoveUserConns; /* afs_resource.c*/ - afs_int32 C_afs_MarinerLog; /* afs_resource.c*/ - afs_int32 C_afs_vtoi; /* afs_resource.c*/ - afs_int32 C_afs_GetServer; /* afs_resource.c*/ - afs_int32 C_afs_SortServers; /* afs_resource.c*/ - afs_int32 C_afs_Conn; /* afs_resource.c*/ - afs_int32 C_afs_ConnByHost; /* afs_resource.c*/ - afs_int32 C_afs_ConnByMHosts; /* afs_resource.c*/ - afs_int32 C_afs_Analyze; /* afs_resource.c*/ - afs_int32 C_afs_PutConn; /* afs_resource.c*/ - afs_int32 C_afs_ResetVolumeInfo; /* afs_resource.c*/ - afs_int32 C_StartLogFile; /* afs_resource.c*/ - afs_int32 C_afs_SetLogFile; /* afs_resource.c*/ - afs_int32 C_EndLogFile; /* afs_resource.c*/ - afs_int32 C_afs_dp; /* afs_resource.c*/ - afs_int32 C_fprf; /* afs_resource.c*/ - afs_int32 C_fprint; /* afs_resource.c*/ - afs_int32 C_fprintn; /* afs_resource.c*/ - afs_int32 C_afs_CheckLocks; /* afs_resource.c*/ - afs_int32 C_puttofile; /* afs_resource.c*/ - afs_int32 C_shutdown_AFS; /* afs_resource.c*/ - afs_int32 C_afs_CheckCacheResets; /* afs_resource.c*/ - afs_int32 C_afs_GCUserData; /* afs_resource.c*/ - afs_int32 C_VSleep; /* afs_resource.c*/ - afs_int32 C_afs_CheckCode; /* afs_resource.c*/ - afs_int32 C_afs_CopyError; /* afs_resource.c*/ - afs_int32 C_afs_FinalizeReq; /* afs_resource.c*/ - afs_int32 C_afs_cv2string; /* afs_resource.c*/ - afs_int32 C_afs_FindVolCache; /* afs_resource.c*/ - afs_int32 C_afs_GetVolCache; /* afs_resource.c*/ - afs_int32 C_afs_GetVolSlot; /* afs_resource.c*/ - afs_int32 C_afs_WriteVolCache; /* afs_resource.c*/ - afs_int32 C_afs_UFSGetVolSlot; /* afs_resource.c*/ - afs_int32 C_afs_CheckVolumeNames; /* afs_resource.c*/ - afs_int32 C_afs_MemGetVolSlot; /* afs_resource.c*/ - afs_int32 C_print_internet_address; /* afs_resource.c*/ - afs_int32 C_CheckVLServer; /* afs_resource.c*/ - afs_int32 C_HaveCallBacksFrom; /* afs_resource.c*/ - afs_int32 C_ServerDown; /* afs_resource.c*/ - afs_int32 C_afs_CheckServers; /* afs_resource.c*/ - afs_int32 C_afs_AddToMean; /* afs_stat.c*/ - afs_int32 C_afs_GetCMStat; /* afs_stat.c*/ - afs_int32 C_afs_getpage; /* afs_sun_subr.c*/ - afs_int32 C_afs_putpage; /* afs_sun_subr.c*/ - afs_int32 C_afs_nfsrdwr; /* afs_sun_subr.c*/ - afs_int32 C_afs_map; /* afs_sun_subr.c*/ - afs_int32 C_afs_cmp; /* afs_sun_subr.c*/ - afs_int32 C_afs_cntl; /* afs_sun_subr.c*/ - afs_int32 C_afs_dump; /* afs_sun_subr.c*/ - afs_int32 C_afs_realvp; /* afs_sun_subr.c*/ - afs_int32 C_afs_PageLeft; /* afs_sun_subr.c*/ - afs_int32 C_afsinit; /* afs_vfsops.c*/ - afs_int32 C_afs_mount; /* afs_vfsops.c*/ - afs_int32 C_afs_unmount; /* afs_vfsops.c*/ - afs_int32 C_afs_root; /* afs_vfsops.c*/ - afs_int32 C_afs_statfs; /* afs_vfsops.c*/ - afs_int32 C_afs_sync; /* afs_vfsops.c*/ - afs_int32 C_afs_vget; /* afs_vfsops.c*/ - afs_int32 C_afs_mountroot; /* afs_vfsops.c*/ - afs_int32 C_afs_swapvp; /* afs_vfsops.c*/ - afs_int32 C_afs_AddMarinerName; /* afs_vnodeops.c*/ - afs_int32 C_afs_setpag; /* afs_vnodeops.c*/ - afs_int32 C_genpag; /* afs_vnodeops.c*/ - afs_int32 C_getpag; /* afs_vnodeops.c*/ - afs_int32 C_afs_GetMariner; /* afs_vnodeops.c*/ - afs_int32 C_afs_badop; /* afs_vnodeops.c*/ - afs_int32 C_afs_index; /* afs_vnodeops.c*/ - afs_int32 C_afs_noop; /* afs_vnodeops.c*/ - afs_int32 C_afs_open; /* afs_vnodeops.c*/ - afs_int32 C_afs_closex; /* afs_vnodeops.c*/ - afs_int32 C_afs_close; /* afs_vnodeops.c*/ - afs_int32 C_afs_MemWrite; /* afs_vnodeops.c*/ - afs_int32 C_afs_write; /* afs_vnodeops.c*/ - afs_int32 C_afs_UFSWrite; /* afs_vnodeops.c*/ - afs_int32 C_afs_rdwr; /* afs_vnodeops.c*/ - afs_int32 C_afs_MemRead; /* afs_vnodeops.c*/ - afs_int32 C_afs_read; /* afs_vnodeops.c*/ - afs_int32 C_FIXUPSTUPIDINODE; /* afs_vnodeops.c*/ - afs_int32 C_afs_UFSRead; /* afs_vnodeops.c*/ - afs_int32 C_afs_CopyOutAttrs; /* afs_vnodeops.c*/ - afs_int32 C_afs_getattr; /* afs_vnodeops.c*/ - afs_int32 C_afs_VAttrToAS; /* afs_vnodeops.c*/ - afs_int32 C_afs_setattr; /* afs_vnodeops.c*/ - afs_int32 C_EvalMountPoint; /* afs_vnodeops.c*/ - afs_int32 C_afs_access; /* afs_vnodeops.c*/ - afs_int32 C_ENameOK; /* afs_vnodeops.c*/ - afs_int32 C_HandleAtName; /* afs_vnodeops.c*/ - afs_int32 C_getsysname; /* afs_vnodeops.c*/ - afs_int32 C_strcat; /* afs_vnodeops.c*/ - afs_int32 C_afs_lookup; /* afs_vnodeops.c*/ - afs_int32 C_afs_create; /* afs_vnodeops.c*/ - afs_int32 C_afs_LocalHero; /* afs_vnodeops.c*/ - afs_int32 C_FetchWholeEnchilada; /* afs_vnodeops.c*/ - afs_int32 C_afs_remove; /* afs_vnodeops.c*/ - afs_int32 C_afs_link; /* afs_vnodeops.c*/ - afs_int32 C_afs_rename; /* afs_vnodeops.c*/ - afs_int32 C_afs_InitReq; /* afs_vnodeops.c*/ - afs_int32 C_afs_mkdir; /* afs_vnodeops.c*/ - afs_int32 C_BlobScan; /* afs_vnodeops.c*/ - afs_int32 C_afs_rmdir; /* afs_vnodeops.c*/ - afs_int32 C_RecLen; /* afs_vnodeops.c*/ - afs_int32 C_RoundToInt; /* afs_vnodeops.c*/ - afs_int32 C_afs_readdir_with_offlist; /* afs_vnodeops.c*/ - afs_int32 C_DIRSIZ_LEN; /* afs_vnodeops.c*/ - afs_int32 C_afs_readdir_move; /* afs_vnodeops.c*/ - afs_int32 C_afs_readdir_iter; /* afs_vnodeops.c*/ - afs_int32 C_HandleFlock; /* afs_vnodeops.c*/ - afs_int32 C_afs_readdir; /* afs_vnodeops.c*/ - afs_int32 C_afs_symlink; /* afs_vnodeops.c*/ - afs_int32 C_afs_HandleLink; /* afs_vnodeops.c*/ - afs_int32 C_afs_MemHandleLink; /* afs_vnodeops.c*/ - afs_int32 C_afs_UFSHandleLink; /* afs_vnodeops.c*/ - afs_int32 C_afs_readlink; /* afs_vnodeops.c*/ - afs_int32 C_afs_fsync; /* afs_vnodeops.c*/ - afs_int32 C_afs_inactive; /* afs_vnodeops.c*/ - afs_int32 C_afs_ustrategy; /* afs_vnodeops.c*/ - afs_int32 C_afs_bread; /* afs_vnodeops.c*/ - afs_int32 C_afs_brelse; /* afs_vnodeops.c*/ - afs_int32 C_afs_bmap; /* afs_vnodeops.c*/ - afs_int32 C_afs_fid; /* afs_vnodeops.c*/ - afs_int32 C_afs_strategy; /* afs_vnodeops.c*/ - afs_int32 C_afs_FakeClose; /* afs_vnodeops.c*/ - afs_int32 C_afs_FakeOpen; /* afs_vnodeops.c*/ - afs_int32 C_afs_StoreOnLastReference; /* afs_vnodeops.c*/ - afs_int32 C_afs_GetAccessBits; /* afs_vnodeops.c*/ - afs_int32 C_afs_AccessOK; /* afs_vnodeops.c*/ - afs_int32 C_shutdown_vnodeops; /* afs_vnodeops.c*/ - afs_int32 C_afsio_copy; /* afs_vnodeops.c*/ - afs_int32 C_afsio_trim; /* afs_vnodeops.c*/ - afs_int32 C_afs_page_read; /* afs_vnodeops.c*/ - afs_int32 C_afs_page_write; /* afs_vnodeops.c*/ - afs_int32 C_afsio_skip; /* afs_vnodeops.c*/ - afs_int32 C_afs_read1dir; /* afs_vnodeops.c*/ - afs_int32 C_afs_get_groups_from_pag; /* afs_vnodeops.c*/ - afs_int32 C_afs_get_pag_from_groups; /* afs_vnodeops.c*/ - afs_int32 C_PagInCred; /* afs_vnodeops.c*/ - afs_int32 C_afs_getgroups; /* afs_vnodeops.c*/ - afs_int32 C_setpag; /* afs_vnodeops.c*/ - afs_int32 C_afs_setgroups; /* afs_vnodeops.c*/ - afs_int32 C_afs_page_in; /* afs_vnodeops.c*/ - afs_int32 C_afs_page_out; /* afs_vnodeops.c*/ - afs_int32 C_AddPag; /* afs_vnodeops.c*/ - afs_int32 C_afs_AdvanceFD; /* afs_vnodeops.c*/ - afs_int32 C_afs_lockf; /* afs_vnodeops.c*/ - afs_int32 C_afs_xsetgroups; /* afs_vnodeops.c*/ - afs_int32 C_afs_nlinks; /* afs_vnodeops.c*/ - afs_int32 C_DoLockWarning; /* afs_vnodeops.c*/ - afs_int32 C_afs_lockctl; /* afs_vnodeops.c*/ - afs_int32 C_afs_xflock; /* afs_vnodeops.c*/ - afs_int32 C_PSetSPrefs; /* afs_pioctl.c*/ - afs_int32 C_PGetSPrefs; /* afs_pioctl.c*/ - afs_int32 C_afs_warn; /* afs_resource.c */ - afs_int32 C_afs_warnuser; /* afs_resource.c */ - afs_int32 C_afs_pagein; /* afs_hp_subr.c*/ - afs_int32 C_afs_pageout; /* afs_hp_subr.c*/ - afs_int32 C_afs_hp_strategy; /* afs_hp_subr.c*/ - afs_int32 C_PGetCPrefs; /* afs_pioctl.c */ - afs_int32 C_PSetCPrefs; /* afs_pioctl.c */ - afs_int32 C_SRXAFSCB_WhoAreYou; /* afs_callback.c*/ - afs_int32 C_afs_DiscardDCache; /* afs_dcache.c*/ - afs_int32 C_afs_FreeDiscardedDCache; /* afs_dcache.c*/ - afs_int32 C_afs_MaybeFreeDiscardedDCache; /* afs_dcache.c*/ + afs_int32 C_afs_rfs_dispatch; /* afs_nfssrv.c */ + afs_int32 C_afs_xnfs_svc; /* afs_nfssrv.c */ + afs_int32 C_afs_xdr_putrddirres; /* afs_nfssrv.c */ + afs_int32 C_afs_rfs_readdir; /* afs_nfssrv.c */ + afs_int32 C_afs_rfs_rddirfree; /* afs_nfssrv.c */ + afs_int32 C_rfs_dupcreate; /* afs_nfssrv.c */ + afs_int32 C_rfs_dupsetattr; /* afs_nfssrv.c */ + afs_int32 C_Nfs2AfsCall; /* afs_nfssrv.c */ + afs_int32 C_afs_sun_xuntext; /* afs_osi.c */ + afs_int32 C_osi_Active; /* afs_osi.c */ + afs_int32 C_osi_FlushPages; /* afs_osi.c */ + afs_int32 C_osi_FlushText; /* afs_osi.c */ + afs_int32 C_osi_CallProc; /* afs_osi.c */ + afs_int32 C_osi_CancelProc; /* afs_osi.c */ + afs_int32 C_osi_Invisible; /* afs_osi.c */ + afs_int32 C_osi_Time; /* afs_osi.c */ + afs_int32 C_osi_Alloc; /* afs_osi.c */ + afs_int32 C_osi_SetTime; /* afs_osi.c */ + afs_int32 C_osi_Dump; /* afs_osi.c */ + afs_int32 C_osi_Free; /* afs_osi.c */ + afs_int32 C_shutdown_osi; /* afs_osi.c */ + afs_int32 C_osi_UFSOpen; /* afs_osifile.c */ + afs_int32 C_osi_Close; /* afs_osifile.c */ + afs_int32 C_osi_Stat; /* afs_osifile.c */ + afs_int32 C_osi_Truncate; /* afs_osifile.c */ + afs_int32 C_osi_Read; /* afs_osifile.c */ + afs_int32 C_osi_Write; /* afs_osifile.c */ + afs_int32 C_osi_MapStrategy; /* afs_osifile.c */ + afs_int32 C_shutdown_osifile; /* afs_osifile.c */ + afs_int32 C_osi_FreeLargeSpace; /* afs_osinet.c */ + afs_int32 C_osi_FreeSmallSpace; /* afs_osinet.c */ + afs_int32 C_pkt_iodone; /* afs_osinet.c */ + afs_int32 C_shutdown_osinet; /* afs_osinet.c */ + afs_int32 C_afs_cs; /* afs_osinet.c */ + afs_int32 C_osi_AllocLargeSpace; /* afs_osinet.c */ + afs_int32 C_osi_AllocSmallSpace; /* afs_osinet.c */ + afs_int32 C_osi_CloseToTheEdge; /* afs_osinet.c */ + afs_int32 C_osi_xgreedy; /* afs_osinet.c */ + afs_int32 C_osi_FreeSocket; /* afs_osinet.c */ + afs_int32 C_osi_NewSocket; /* afs_osinet.c */ + afs_int32 C_trysblock; /* afs_osinet.c */ + afs_int32 C_osi_NetSend; /* afs_osinet.c */ + afs_int32 C_WaitHack; /* afs_osinet.c */ + afs_int32 C_osi_CancelWait; /* afs_osinet.c */ + afs_int32 C_osi_InitWaitHandle; /* afs_osinet.c */ + afs_int32 C_osi_Wakeup; /* afs_osinet.c */ + afs_int32 C_osi_Wait; /* afs_osinet.c */ + afs_int32 C_dirp_Read; /* afs_physio.c */ + afs_int32 C_dirp_SetCacheDev; /* afs_physio.c */ + afs_int32 C_Die; /* afs_physio.c */ + afs_int32 C_dirp_Cpy; /* afs_physio.c */ + afs_int32 C_dirp_Eq; /* afs_physio.c */ + afs_int32 C_dirp_Write; /* afs_physio.c */ + afs_int32 C_dirp_Zap; /* afs_physio.c */ + afs_int32 C_PSetVolumeStatus; /* afs_pioctl.c */ + afs_int32 C_PFlush; /* afs_pioctl.c */ + afs_int32 C_PNewStatMount; /* afs_pioctl.c */ + afs_int32 C_PGetTokens; /* afs_pioctl.c */ + afs_int32 C_PUnlog; /* afs_pioctl.c */ + afs_int32 C_PCheckServers; /* afs_pioctl.c */ + afs_int32 C_PMariner; /* afs_pioctl.c */ + afs_int32 C_PCheckAuth; /* afs_pioctl.c */ + afs_int32 C_PCheckVolNames; /* afs_pioctl.c */ + afs_int32 C_PFindVolume; /* afs_pioctl.c */ + afs_int32 C_Prefetch; /* afs_pioctl.c */ + afs_int32 C_PGetCacheSize; /* afs_pioctl.c */ + afs_int32 C_PRemoveCallBack; /* afs_pioctl.c */ + afs_int32 C_PSetCacheSize; /* afs_pioctl.c */ + afs_int32 C_PViceAccess; /* afs_pioctl.c */ + afs_int32 C_PListCells; /* afs_pioctl.c */ + afs_int32 C_PNewCell; /* afs_pioctl.c */ + afs_int32 C_PRemoveMount; /* afs_pioctl.c */ + afs_int32 C_HandleIoctl; /* afs_pioctl.c */ + afs_int32 C__AFSIOCTL; /* afs_pioctl.c */ + afs_int32 C__VALIDAFSIOCTL; /* afs_pioctl.c */ + afs_int32 C_PGetCellStatus; /* afs_pioctl.c */ + afs_int32 C_PSetCellStatus; /* afs_pioctl.c */ + afs_int32 C_PVenusLogging; /* afs_pioctl.c */ + afs_int32 C_PFlushVolumeData; /* afs_pioctl.c */ + afs_int32 C_PSetSysName; /* afs_pioctl.c */ + afs_int32 C_PExportAfs; /* afs_pioctl.c */ + afs_int32 C_HandleClientContext; /* afs_pioctl.c */ + afs_int32 C_afs_ioctl; /* afs_pioctl.c */ + afs_int32 C_afs_xioctl; /* afs_pioctl.c */ + afs_int32 C_afs_pioctl; /* afs_pioctl.c */ + afs_int32 C_afs_syscall_pioctl; /* afs_pioctl.c */ + afs_int32 C_HandlePioctl; /* afs_pioctl.c */ + afs_int32 C_PGetAcl; /* afs_pioctl.c */ + afs_int32 C_PGetFID; /* afs_pioctl.c */ + afs_int32 C_PSetAcl; /* afs_pioctl.c */ + afs_int32 C_PBogus; /* afs_pioctl.c */ + afs_int32 C_PGetFileCell; /* afs_pioctl.c */ + afs_int32 C_PGetWSCell; /* afs_pioctl.c */ + afs_int32 C_PNoop; /* afs_pioctl.c */ + afs_int32 C_PGetUserCell; /* afs_pioctl.c */ + afs_int32 C_PSetTokens; /* afs_pioctl.c */ + afs_int32 C_PGetVolumeStatus; /* afs_pioctl.c */ + afs_int32 C_afs_ResetAccessCache; /* afs_resource.c */ + afs_int32 C_afs_FindUser; /* afs_resource.c */ + afs_int32 C_afs_ResetUserConns; /* afs_resource.c */ + afs_int32 C_afs_ResourceInit; /* afs_resource.c */ + afs_int32 C_afs_GetCell; /* afs_resource.c */ + afs_int32 C_afs_GetCellByIndex; /* afs_resource.c */ + afs_int32 C_afs_GetCellByName; /* afs_resource.c */ + afs_int32 C_afs_GetRealCellByIndex; /* afs_resource.c */ + afs_int32 C_afs_NewCell; /* afs_resource.c */ + afs_int32 C_afs_GetUser; /* afs_resource.c */ + afs_int32 C_afs_PutUser; /* afs_resource.c */ + afs_int32 C_afs_SetPrimary; /* afs_resource.c */ + afs_int32 C_CheckVLDB; /* afs_resource.c */ + afs_int32 C_afs_GetVolume; /* afs_resource.c */ + afs_int32 C_afs_GetVolumeByName; /* afs_resource.c */ + afs_int32 C_InstallVolumeEntry; /* afs_resource.c */ + afs_int32 C_InstallVolumeInfo; /* afs_resource.c */ + afs_int32 C_afs_FindServer; /* afs_resource.c */ + afs_int32 C_afs_PutVolume; /* afs_resource.c */ + afs_int32 C_afs_random; /* afs_resource.c */ + afs_int32 C_ranstage; /* afs_resource.c */ + afs_int32 C_RemoveUserConns; /* afs_resource.c */ + afs_int32 C_afs_MarinerLog; /* afs_resource.c */ + afs_int32 C_afs_vtoi; /* afs_resource.c */ + afs_int32 C_afs_GetServer; /* afs_resource.c */ + afs_int32 C_afs_SortServers; /* afs_resource.c */ + afs_int32 C_afs_Conn; /* afs_resource.c */ + afs_int32 C_afs_ConnByHost; /* afs_resource.c */ + afs_int32 C_afs_ConnByMHosts; /* afs_resource.c */ + afs_int32 C_afs_Analyze; /* afs_resource.c */ + afs_int32 C_afs_PutConn; /* afs_resource.c */ + afs_int32 C_afs_ResetVolumeInfo; /* afs_resource.c */ + afs_int32 C_StartLogFile; /* afs_resource.c */ + afs_int32 C_afs_SetLogFile; /* afs_resource.c */ + afs_int32 C_EndLogFile; /* afs_resource.c */ + afs_int32 C_afs_dp; /* afs_resource.c */ + afs_int32 C_fprf; /* afs_resource.c */ + afs_int32 C_fprint; /* afs_resource.c */ + afs_int32 C_fprintn; /* afs_resource.c */ + afs_int32 C_afs_CheckLocks; /* afs_resource.c */ + afs_int32 C_puttofile; /* afs_resource.c */ + afs_int32 C_shutdown_AFS; /* afs_resource.c */ + afs_int32 C_afs_CheckCacheResets; /* afs_resource.c */ + afs_int32 C_afs_GCUserData; /* afs_resource.c */ + afs_int32 C_VSleep; /* afs_resource.c */ + afs_int32 C_afs_CheckCode; /* afs_resource.c */ + afs_int32 C_afs_CopyError; /* afs_resource.c */ + afs_int32 C_afs_FinalizeReq; /* afs_resource.c */ + afs_int32 C_afs_cv2string; /* afs_resource.c */ + afs_int32 C_afs_FindVolCache; /* afs_resource.c */ + afs_int32 C_afs_GetVolCache; /* afs_resource.c */ + afs_int32 C_afs_GetVolSlot; /* afs_resource.c */ + afs_int32 C_afs_WriteVolCache; /* afs_resource.c */ + afs_int32 C_afs_UFSGetVolSlot; /* afs_resource.c */ + afs_int32 C_afs_CheckVolumeNames; /* afs_resource.c */ + afs_int32 C_afs_MemGetVolSlot; /* afs_resource.c */ + afs_int32 C_print_internet_address; /* afs_resource.c */ + afs_int32 C_CheckVLServer; /* afs_resource.c */ + afs_int32 C_HaveCallBacksFrom; /* afs_resource.c */ + afs_int32 C_ServerDown; /* afs_resource.c */ + afs_int32 C_afs_CheckServers; /* afs_resource.c */ + afs_int32 C_afs_AddToMean; /* afs_stat.c */ + afs_int32 C_afs_GetCMStat; /* afs_stat.c */ + afs_int32 C_afs_getpage; /* afs_sun_subr.c */ + afs_int32 C_afs_putpage; /* afs_sun_subr.c */ + afs_int32 C_afs_nfsrdwr; /* afs_sun_subr.c */ + afs_int32 C_afs_map; /* afs_sun_subr.c */ + afs_int32 C_afs_cmp; /* afs_sun_subr.c */ + afs_int32 C_afs_cntl; /* afs_sun_subr.c */ + afs_int32 C_afs_dump; /* afs_sun_subr.c */ + afs_int32 C_afs_realvp; /* afs_sun_subr.c */ + afs_int32 C_afs_PageLeft; /* afs_sun_subr.c */ + afs_int32 C_afsinit; /* afs_vfsops.c */ + afs_int32 C_afs_mount; /* afs_vfsops.c */ + afs_int32 C_afs_unmount; /* afs_vfsops.c */ + afs_int32 C_afs_root; /* afs_vfsops.c */ + afs_int32 C_afs_statfs; /* afs_vfsops.c */ + afs_int32 C_afs_sync; /* afs_vfsops.c */ + afs_int32 C_afs_vget; /* afs_vfsops.c */ + afs_int32 C_afs_mountroot; /* afs_vfsops.c */ + afs_int32 C_afs_swapvp; /* afs_vfsops.c */ + afs_int32 C_afs_AddMarinerName; /* afs_vnodeops.c */ + afs_int32 C_afs_setpag; /* afs_vnodeops.c */ + afs_int32 C_genpag; /* afs_vnodeops.c */ + afs_int32 C_getpag; /* afs_vnodeops.c */ + afs_int32 C_afs_GetMariner; /* afs_vnodeops.c */ + afs_int32 C_afs_badop; /* afs_vnodeops.c */ + afs_int32 C_afs_index; /* afs_vnodeops.c */ + afs_int32 C_afs_noop; /* afs_vnodeops.c */ + afs_int32 C_afs_open; /* afs_vnodeops.c */ + afs_int32 C_afs_closex; /* afs_vnodeops.c */ + afs_int32 C_afs_close; /* afs_vnodeops.c */ + afs_int32 C_afs_MemWrite; /* afs_vnodeops.c */ + afs_int32 C_afs_write; /* afs_vnodeops.c */ + afs_int32 C_afs_UFSWrite; /* afs_vnodeops.c */ + afs_int32 C_afs_rdwr; /* afs_vnodeops.c */ + afs_int32 C_afs_MemRead; /* afs_vnodeops.c */ + afs_int32 C_afs_read; /* afs_vnodeops.c */ + afs_int32 C_FIXUPSTUPIDINODE; /* afs_vnodeops.c */ + afs_int32 C_afs_UFSRead; /* afs_vnodeops.c */ + afs_int32 C_afs_CopyOutAttrs; /* afs_vnodeops.c */ + afs_int32 C_afs_getattr; /* afs_vnodeops.c */ + afs_int32 C_afs_VAttrToAS; /* afs_vnodeops.c */ + afs_int32 C_afs_setattr; /* afs_vnodeops.c */ + afs_int32 C_EvalMountPoint; /* afs_vnodeops.c */ + afs_int32 C_afs_access; /* afs_vnodeops.c */ + afs_int32 C_ENameOK; /* afs_vnodeops.c */ + afs_int32 C_HandleAtName; /* afs_vnodeops.c */ + afs_int32 C_getsysname; /* afs_vnodeops.c */ + afs_int32 C_strcat; /* afs_vnodeops.c */ + afs_int32 C_afs_lookup; /* afs_vnodeops.c */ + afs_int32 C_afs_create; /* afs_vnodeops.c */ + afs_int32 C_afs_LocalHero; /* afs_vnodeops.c */ + afs_int32 C_FetchWholeEnchilada; /* afs_vnodeops.c */ + afs_int32 C_afs_remove; /* afs_vnodeops.c */ + afs_int32 C_afs_link; /* afs_vnodeops.c */ + afs_int32 C_afs_rename; /* afs_vnodeops.c */ + afs_int32 C_afs_InitReq; /* afs_vnodeops.c */ + afs_int32 C_afs_mkdir; /* afs_vnodeops.c */ + afs_int32 C_BlobScan; /* afs_vnodeops.c */ + afs_int32 C_afs_rmdir; /* afs_vnodeops.c */ + afs_int32 C_RecLen; /* afs_vnodeops.c */ + afs_int32 C_RoundToInt; /* afs_vnodeops.c */ + afs_int32 C_afs_readdir_with_offlist; /* afs_vnodeops.c */ + afs_int32 C_DIRSIZ_LEN; /* afs_vnodeops.c */ + afs_int32 C_afs_readdir_move; /* afs_vnodeops.c */ + afs_int32 C_afs_readdir_iter; /* afs_vnodeops.c */ + afs_int32 C_HandleFlock; /* afs_vnodeops.c */ + afs_int32 C_afs_readdir; /* afs_vnodeops.c */ + afs_int32 C_afs_symlink; /* afs_vnodeops.c */ + afs_int32 C_afs_HandleLink; /* afs_vnodeops.c */ + afs_int32 C_afs_MemHandleLink; /* afs_vnodeops.c */ + afs_int32 C_afs_UFSHandleLink; /* afs_vnodeops.c */ + afs_int32 C_afs_readlink; /* afs_vnodeops.c */ + afs_int32 C_afs_fsync; /* afs_vnodeops.c */ + afs_int32 C_afs_inactive; /* afs_vnodeops.c */ + afs_int32 C_afs_ustrategy; /* afs_vnodeops.c */ + afs_int32 C_afs_bread; /* afs_vnodeops.c */ + afs_int32 C_afs_brelse; /* afs_vnodeops.c */ + afs_int32 C_afs_bmap; /* afs_vnodeops.c */ + afs_int32 C_afs_fid; /* afs_vnodeops.c */ + afs_int32 C_afs_strategy; /* afs_vnodeops.c */ + afs_int32 C_afs_FakeClose; /* afs_vnodeops.c */ + afs_int32 C_afs_FakeOpen; /* afs_vnodeops.c */ + afs_int32 C_afs_StoreOnLastReference; /* afs_vnodeops.c */ + afs_int32 C_afs_GetAccessBits; /* afs_vnodeops.c */ + afs_int32 C_afs_AccessOK; /* afs_vnodeops.c */ + afs_int32 C_shutdown_vnodeops; /* afs_vnodeops.c */ + afs_int32 C_afsio_copy; /* afs_vnodeops.c */ + afs_int32 C_afsio_trim; /* afs_vnodeops.c */ + afs_int32 C_afs_page_read; /* afs_vnodeops.c */ + afs_int32 C_afs_page_write; /* afs_vnodeops.c */ + afs_int32 C_afsio_skip; /* afs_vnodeops.c */ + afs_int32 C_afs_read1dir; /* afs_vnodeops.c */ + afs_int32 C_afs_get_groups_from_pag; /* afs_vnodeops.c */ + afs_int32 C_afs_get_pag_from_groups; /* afs_vnodeops.c */ + afs_int32 C_PagInCred; /* afs_vnodeops.c */ + afs_int32 C_afs_getgroups; /* afs_vnodeops.c */ + afs_int32 C_setpag; /* afs_vnodeops.c */ + afs_int32 C_afs_setgroups; /* afs_vnodeops.c */ + afs_int32 C_afs_page_in; /* afs_vnodeops.c */ + afs_int32 C_afs_page_out; /* afs_vnodeops.c */ + afs_int32 C_AddPag; /* afs_vnodeops.c */ + afs_int32 C_afs_AdvanceFD; /* afs_vnodeops.c */ + afs_int32 C_afs_lockf; /* afs_vnodeops.c */ + afs_int32 C_afs_xsetgroups; /* afs_vnodeops.c */ + afs_int32 C_afs_nlinks; /* afs_vnodeops.c */ + afs_int32 C_DoLockWarning; /* afs_vnodeops.c */ + afs_int32 C_afs_lockctl; /* afs_vnodeops.c */ + afs_int32 C_afs_xflock; /* afs_vnodeops.c */ + afs_int32 C_PSetSPrefs; /* afs_pioctl.c */ + afs_int32 C_PGetSPrefs; /* afs_pioctl.c */ + afs_int32 C_afs_warn; /* afs_resource.c */ + afs_int32 C_afs_warnuser; /* afs_resource.c */ + afs_int32 C_afs_pagein; /* afs_hp_subr.c */ + afs_int32 C_afs_pageout; /* afs_hp_subr.c */ + afs_int32 C_afs_hp_strategy; /* afs_hp_subr.c */ + afs_int32 C_PGetCPrefs; /* afs_pioctl.c */ + afs_int32 C_PSetCPrefs; /* afs_pioctl.c */ + afs_int32 C_SRXAFSCB_WhoAreYou; /* afs_callback.c */ + afs_int32 C_afs_DiscardDCache; /* afs_dcache.c */ + afs_int32 C_afs_FreeDiscardedDCache; /* afs_dcache.c */ + afs_int32 C_afs_MaybeFreeDiscardedDCache; /* afs_dcache.c */ afs_int32 C_PFlushMount; /* afs_pioctl.c */ - afs_int32 C_SRXAFSCB_GetServerPrefs; /* afs_callback.c*/ - afs_int32 C_SRXAFSCB_GetCellServDB; /* afs_callback.c*/ - afs_int32 C_SRXAFSCB_GetLocalCell; /* afs_callback.c*/ - afs_int32 C_afs_MarshallCacheConfig; /* afs_callback.c*/ - afs_int32 C_SRXAFSCB_GetCacheConfig; /* afs_callback.c*/ - afs_int32 C_SRXAFSCB_GetCE64; /* afs_callback.c*/ - afs_int32 C_SRXAFSCB_GetCellByNum; /* afs_callback.c*/ + afs_int32 C_SRXAFSCB_GetServerPrefs; /* afs_callback.c */ + afs_int32 C_SRXAFSCB_GetCellServDB; /* afs_callback.c */ + afs_int32 C_SRXAFSCB_GetLocalCell; /* afs_callback.c */ + afs_int32 C_afs_MarshallCacheConfig; /* afs_callback.c */ + afs_int32 C_SRXAFSCB_GetCacheConfig; /* afs_callback.c */ + afs_int32 C_SRXAFSCB_GetCE64; /* afs_callback.c */ + afs_int32 C_SRXAFSCB_GetCellByNum; /* afs_callback.c */ }; struct afs_CMMeanStats { - struct afs_MeanStats something; /* fill this in */ + struct afs_MeanStats something; /* fill this in */ }; struct afs_CMStats { @@ -668,12 +668,12 @@ extern struct afs_CMStats afs_cmstats; */ #define AFS_STATS_NUM_DOWNTIME_DURATION_BUCKETS 7 -#define AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET0 600 /*10 minutes*/ -#define AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET1 1800 /*30 minutes*/ -#define AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET2 3600 /*60 minutes*/ -#define AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET3 7200 /*2 hours*/ -#define AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET4 14400 /*4 hours*/ -#define AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET5 28800 /*8 hours*/ +#define AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET0 600 /*10 minutes */ +#define AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET1 1800 /*30 minutes */ +#define AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET2 3600 /*60 minutes */ +#define AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET3 7200 /*2 hours */ +#define AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET4 14400 /*4 hours */ +#define AFS_STATS_MAX_DOWNTIME_DURATION_BUCKET5 28800 /*8 hours */ /* * Constants to track downtime incidents: @@ -699,18 +699,18 @@ extern struct afs_CMStats afs_cmstats; * and those outside the client's cell. */ struct afs_stats_SrvUpDownInfo { - afs_int32 numTtlRecords; /*# records, active or inactive*/ - afs_int32 numUpRecords; /*# (active) records currently marked up*/ - afs_int32 numDownRecords; /*# (active) records currently marked down*/ - afs_int32 sumOfRecordAges; /*Sum of server record lifetimes*/ - afs_int32 ageOfYoungestRecord; /*Age of youngest server record*/ - afs_int32 ageOfOldestRecord; /*Age of oldest server record*/ - afs_int32 numDowntimeIncidents; /*Number of (completed) downtime incidents*/ - afs_int32 numRecordsNeverDown; /*Number of server records never marked down*/ - afs_int32 maxDowntimesInARecord; /*Max downtimes seen by any record*/ - afs_int32 sumOfDowntimes; /*Sum of all (completed) downtimes, in seconds*/ - afs_int32 shortestDowntime; /*Shortest downtime, in seconds*/ - afs_int32 longestDowntime; /*Longest downtime, in seconds*/ + afs_int32 numTtlRecords; /*# records, active or inactive */ + afs_int32 numUpRecords; /*# (active) records currently marked up */ + afs_int32 numDownRecords; /*# (active) records currently marked down */ + afs_int32 sumOfRecordAges; /*Sum of server record lifetimes */ + afs_int32 ageOfYoungestRecord; /*Age of youngest server record */ + afs_int32 ageOfOldestRecord; /*Age of oldest server record */ + afs_int32 numDowntimeIncidents; /*Number of (completed) downtime incidents */ + afs_int32 numRecordsNeverDown; /*Number of server records never marked down */ + afs_int32 maxDowntimesInARecord; /*Max downtimes seen by any record */ + afs_int32 sumOfDowntimes; /*Sum of all (completed) downtimes, in seconds */ + afs_int32 shortestDowntime; /*Shortest downtime, in seconds */ + afs_int32 longestDowntime; /*Longest downtime, in seconds */ /* * Arrays keeping distributions on downtime durations and number of * downtime incidents. @@ -729,39 +729,39 @@ struct afs_stats_SrvUpDownInfo { * Performance numbers for the Cache Manager. */ struct afs_stats_CMPerf { - afs_int32 numPerfCalls; /*# of performance calls rcvd*/ - - afs_int32 epoch; /*Cache Manager epoch time*/ - afs_int32 numCellsVisible; /*# cells we know about*/ - afs_int32 numCellsContacted; /*# cells corresponded with*/ - afs_int32 dlocalAccesses; /*# data accesses to files within cell*/ - afs_int32 vlocalAccesses; /*# stat accesses to files within cell*/ - afs_int32 dremoteAccesses; /*# data accesses to files outside of cell*/ - afs_int32 vremoteAccesses; /*# stat accesses to files outside of cell*/ - afs_int32 cacheNumEntries; /*# cache entries*/ - afs_int32 cacheBlocksTotal; /*# (1K) blocks configured for cache*/ - afs_int32 cacheBlocksInUse; /*# cache blocks actively in use*/ - afs_int32 cacheBlocksOrig; /*# cache blocks at bootup*/ - afs_int32 cacheMaxDirtyChunks; /*Max # dirty cache chunks tolerated*/ - afs_int32 cacheCurrDirtyChunks; /*Current # dirty cache chunks*/ - afs_int32 dcacheHits; /*# data files found in local cache*/ - afs_int32 vcacheHits; /*# stat entries found in local cache*/ - afs_int32 dcacheMisses; /*# data files NOT found in local cache*/ - afs_int32 vcacheMisses; /*# stat entries NOT found in local cache*/ - afs_int32 cacheFlushes; /*# files flushed from cache*/ - afs_int32 cacheFilesReused; /*# cache files reused*/ - afs_int32 ProtServerAddr; /*Addr of Protection Server used*/ - afs_int32 vcacheXAllocs; /* Additionally allocated vcaches */ - afs_int32 dcacheXAllocs; /* Additionally allocated dcaches */ + afs_int32 numPerfCalls; /*# of performance calls rcvd */ + + afs_int32 epoch; /*Cache Manager epoch time */ + afs_int32 numCellsVisible; /*# cells we know about */ + afs_int32 numCellsContacted; /*# cells corresponded with */ + afs_int32 dlocalAccesses; /*# data accesses to files within cell */ + afs_int32 vlocalAccesses; /*# stat accesses to files within cell */ + afs_int32 dremoteAccesses; /*# data accesses to files outside of cell */ + afs_int32 vremoteAccesses; /*# stat accesses to files outside of cell */ + afs_int32 cacheNumEntries; /*# cache entries */ + afs_int32 cacheBlocksTotal; /*# (1K) blocks configured for cache */ + afs_int32 cacheBlocksInUse; /*# cache blocks actively in use */ + afs_int32 cacheBlocksOrig; /*# cache blocks at bootup */ + afs_int32 cacheMaxDirtyChunks; /*Max # dirty cache chunks tolerated */ + afs_int32 cacheCurrDirtyChunks; /*Current # dirty cache chunks */ + afs_int32 dcacheHits; /*# data files found in local cache */ + afs_int32 vcacheHits; /*# stat entries found in local cache */ + afs_int32 dcacheMisses; /*# data files NOT found in local cache */ + afs_int32 vcacheMisses; /*# stat entries NOT found in local cache */ + afs_int32 cacheFlushes; /*# files flushed from cache */ + afs_int32 cacheFilesReused; /*# cache files reused */ + afs_int32 ProtServerAddr; /*Addr of Protection Server used */ + afs_int32 vcacheXAllocs; /* Additionally allocated vcaches */ + afs_int32 dcacheXAllocs; /* Additionally allocated dcaches */ /* * Some stats related to our buffer package */ - afs_int32 bufAlloced; /* # of buffers allocated by afs */ + afs_int32 bufAlloced; /* # of buffers allocated by afs */ afs_int32 bufHits; /* # of pages found on buffer cache */ - afs_int32 bufMisses; /* # of pages NOT found on buffer cache */ - afs_int32 bufFlushDirty; /* # of cached dirty bufs flushed because all busy */ - + afs_int32 bufMisses; /* # of pages NOT found on buffer cache */ + afs_int32 bufFlushDirty; /* # of cached dirty bufs flushed because all busy */ + /* * Stats that keep track of all allocated/used objects in CM */ @@ -779,9 +779,9 @@ struct afs_stats_CMPerf { /* * Accounting stats having to do with the server table & records. */ - afs_int32 srvRecords; /*# of servers currently on record*/ - afs_int32 srvRecordsHWM; /* Server record high water mark */ - afs_int32 srvNumBuckets; /* Num server hash chain buckets */ + afs_int32 srvRecords; /*# of servers currently on record */ + afs_int32 srvRecordsHWM; /* Server record high water mark */ + afs_int32 srvNumBuckets; /* Num server hash chain buckets */ afs_int32 srvMaxChainLength; /* Max server hash chain length */ afs_int32 srvMaxChainLengthHWM; /* Server hash chain high water mark */ @@ -789,7 +789,7 @@ struct afs_stats_CMPerf { * Stats having to do with the systype upon which the Cache Manager * is running. */ - afs_int32 sysName_ID; /*Sysname ID for host hardware*/ + afs_int32 sysName_ID; /*Sysname ID for host hardware */ /* * Stats recording downtime characteristics for each File Server and Volume @@ -805,7 +805,7 @@ struct afs_stats_CMPerf { /* * Spares for future expansion. */ - afs_int32 spare[13]; /*Spares*/ + afs_int32 spare[13]; /*Spares */ }; @@ -865,12 +865,12 @@ struct afs_stats_CMPerf { * Record to track timing numbers for each Cache Manager RPC operation. */ struct afs_stats_opTimingData { - afs_int32 numOps; /*Number of operations executed*/ - afs_int32 numSuccesses; /*Number of successful ops*/ - osi_timeval_t sumTime; /*Sum of sample timings*/ - osi_timeval_t sqrTime; /*Sum of squares of sample timings */ - osi_timeval_t minTime; /*Minimum timing value observed*/ - osi_timeval_t maxTime; /*Minimum timing value observed*/ + afs_int32 numOps; /*Number of operations executed */ + afs_int32 numSuccesses; /*Number of successful ops */ + osi_timeval_t sumTime; /*Sum of sample timings */ + osi_timeval_t sqrTime; /*Sum of squares of sample timings */ + osi_timeval_t minTime; /*Minimum timing value observed */ + osi_timeval_t maxTime; /*Minimum timing value observed */ }; /* @@ -891,16 +891,16 @@ struct afs_stats_opTimingData { * Record to track timings and byte sizes for data transfers. */ struct afs_stats_xferData { - afs_int32 numXfers; /*Number of successful xfers*/ - afs_int32 numSuccesses; /*Number of successful xfers*/ - osi_timeval_t sumTime; /*Sum of timing values*/ - osi_timeval_t sqrTime; /*Sum of squares of timing values */ - osi_timeval_t minTime; /*Minimum xfer time recorded*/ - osi_timeval_t maxTime; /*Maximum xfer time recorded*/ - afs_int32 sumBytes; /*Sum of KBytes transferred*/ - afs_int32 minBytes; /*Minimum value observed*/ - afs_int32 maxBytes; /*Maximum value observed*/ - afs_int32 count[AFS_STATS_NUM_XFER_BUCKETS]; /*Tally for each range of bytes*/ + afs_int32 numXfers; /*Number of successful xfers */ + afs_int32 numSuccesses; /*Number of successful xfers */ + osi_timeval_t sumTime; /*Sum of timing values */ + osi_timeval_t sqrTime; /*Sum of squares of timing values */ + osi_timeval_t minTime; /*Minimum xfer time recorded */ + osi_timeval_t maxTime; /*Maximum xfer time recorded */ + afs_int32 sumBytes; /*Sum of KBytes transferred */ + afs_int32 minBytes; /*Minimum value observed */ + afs_int32 maxBytes; /*Maximum value observed */ + afs_int32 count[AFS_STATS_NUM_XFER_BUCKETS]; /*Tally for each range of bytes */ }; /* @@ -1047,12 +1047,12 @@ struct afs_stats_xferData { * Structure recording RPC outcomes. */ struct afs_stats_RPCErrors { - afs_int32 err_Server; /*Server down error*/ - afs_int32 err_Network; /*Network error*/ - afs_int32 err_Protection; /*Protection violation*/ - afs_int32 err_Volume; /*Volume-related error*/ - afs_int32 err_VolumeBusies; /*"Volume busy conditions encountered*/ - afs_int32 err_Other; /*Misc other errors*/ + afs_int32 err_Server; /*Server down error */ + afs_int32 err_Network; /*Network error */ + afs_int32 err_Protection; /*Protection violation */ + afs_int32 err_Volume; /*Volume-related error */ + afs_int32 err_VolumeBusies; /*"Volume busy conditions encountered */ + afs_int32 err_Other; /*Misc other errors */ }; @@ -1061,13 +1061,13 @@ struct afs_stats_RPCErrors { */ struct afs_stats_RPCOpInfo { struct afs_stats_opTimingData - fsRPCTimes[AFS_STATS_NUM_FS_RPC_OPS]; /*Individual FS RPC op timings*/ + fsRPCTimes[AFS_STATS_NUM_FS_RPC_OPS]; /*Individual FS RPC op timings */ struct afs_stats_RPCErrors - fsRPCErrors[AFS_STATS_NUM_FS_RPC_OPS]; /*Individual FS RPC op errors*/ + fsRPCErrors[AFS_STATS_NUM_FS_RPC_OPS]; /*Individual FS RPC op errors */ struct afs_stats_xferData - fsXferTimes[AFS_STATS_NUM_FS_XFER_OPS]; /*Individual FS RPC xfer timings*/ + fsXferTimes[AFS_STATS_NUM_FS_XFER_OPS]; /*Individual FS RPC xfer timings */ struct afs_stats_opTimingData - cmRPCTimes[AFS_STATS_NUM_CM_RPC_OPS]; /*Individual CM RPC op timings*/ + cmRPCTimes[AFS_STATS_NUM_CM_RPC_OPS]; /*Individual CM RPC op timings */ }; /* @@ -1078,25 +1078,25 @@ struct afs_stats_AuthentInfo { * This first set of fields don't have any history - they are simply * snapshots of the system at the time of the probe. */ - afs_int32 curr_PAGs; /*Current number of PAGs*/ - afs_int32 curr_Records; /*Current # of records in table*/ + afs_int32 curr_PAGs; /*Current number of PAGs */ + afs_int32 curr_Records; /*Current # of records in table */ afs_int32 curr_AuthRecords; /*Current # of authenticated - records (w/valid ticket)*/ + * records (w/valid ticket) */ afs_int32 curr_UnauthRecords; /*Current # of unauthenticated - records (w/o any ticket at all)*/ - afs_int32 curr_MaxRecordsInPAG; /*Max records for a single PAG*/ - afs_int32 curr_LongestChain; /*Length of longest current hash chain*/ + * records (w/o any ticket at all) */ + afs_int32 curr_MaxRecordsInPAG; /*Max records for a single PAG */ + afs_int32 curr_LongestChain; /*Length of longest current hash chain */ /* * This second set of fields are values accumulated over the lifetme * of the current CM incarnation. */ - afs_int32 PAGCreations; /*# PAG creations*/ - afs_int32 TicketUpdates; /*# ticket additions/refreshes*/ - afs_int32 HWM_PAGs; /*High water mark - # PAGs*/ - afs_int32 HWM_Records; /* " - # records*/ - afs_int32 HWM_MaxRecordsInPAG; /* " - max records for a single PAG*/ - afs_int32 HWM_LongestChain; /* " - longest hash chain*/ + afs_int32 PAGCreations; /*# PAG creations */ + afs_int32 TicketUpdates; /*# ticket additions/refreshes */ + afs_int32 HWM_PAGs; /*High water mark - # PAGs */ + afs_int32 HWM_Records; /* " - # records */ + afs_int32 HWM_MaxRecordsInPAG; /* " - max records for a single PAG */ + afs_int32 HWM_LongestChain; /* " - longest hash chain */ }; /* @@ -1105,11 +1105,11 @@ struct afs_stats_AuthentInfo { * case of failure. */ struct afs_stats_AccessInfo { - afs_int32 unreplicatedRefs; /*# references to unreplicated data*/ - afs_int32 replicatedRefs; /*# references to replicated data*/ - afs_int32 numReplicasAccessed; /*# replicas accessed*/ - afs_int32 maxReplicasPerRef; /*Max # replicas accessed per ref*/ - afs_int32 refFirstReplicaOK; /*# references satisfied by 1st replica*/ + afs_int32 unreplicatedRefs; /*# references to unreplicated data */ + afs_int32 replicatedRefs; /*# references to replicated data */ + afs_int32 numReplicasAccessed; /*# replicas accessed */ + afs_int32 maxReplicasPerRef; /*Max # replicas accessed per ref */ + afs_int32 refFirstReplicaOK; /*# references satisfied by 1st replica */ }; /* @@ -1118,31 +1118,31 @@ struct afs_stats_AccessInfo { * Results cover all objects in the cache uniformly. */ struct afs_stats_AuthorInfo { - afs_int32 fileSameAuthor; /*File write by same author*/ - afs_int32 fileDiffAuthor; /*File write by diff author*/ - afs_int32 dirSameAuthor; /*Directory write by same author*/ - afs_int32 dirDiffAuthor; /*Directory write by diff author*/ + afs_int32 fileSameAuthor; /*File write by same author */ + afs_int32 fileDiffAuthor; /*File write by diff author */ + afs_int32 dirSameAuthor; /*Directory write by same author */ + afs_int32 dirDiffAuthor; /*Directory write by diff author */ }; /* * Structure holding ``full'' CM peformance measurements. */ struct afs_stats_CMFullPerf { - afs_int32 numFullPerfCalls; /*Number of accesses*/ - struct afs_stats_CMPerf perf; /*General performance stats*/ - struct afs_stats_RPCOpInfo rpc; /*RPC op stats*/ - struct afs_stats_AuthentInfo authent; /*Authentication stats*/ - struct afs_stats_AccessInfo accessinf; /*Access stats*/ - struct afs_stats_AuthorInfo author; /*Authorship stats*/ + afs_int32 numFullPerfCalls; /*Number of accesses */ + struct afs_stats_CMPerf perf; /*General performance stats */ + struct afs_stats_RPCOpInfo rpc; /*RPC op stats */ + struct afs_stats_AuthentInfo authent; /*Authentication stats */ + struct afs_stats_AccessInfo accessinf; /*Access stats */ + struct afs_stats_AuthorInfo author; /*Authorship stats */ }; /* * These are the storage declarations for the structures accessible * via the xstat package. */ -extern struct afs_stats_CMPerf afs_stats_cmperf; -extern struct afs_stats_CMFullPerf afs_stats_cmfullperf; -extern afs_int32 afs_stats_XferSumBytes[]; +/* extern struct afs_stats_CMPerf afs_stats_cmperf; */ +/* extern struct afs_stats_CMFullPerf afs_stats_cmfullperf; */ +/* extern afs_int32 afs_stats_XferSumBytes[]; */ #ifndef AFS_NOSTATS /* @@ -1159,4 +1159,4 @@ extern afs_int32 afs_stats_XferSumBytes[]; #endif /* AFS_NOSTATS */ -#endif /* __TRANSARC_AFS_STATS_H__ */ +#endif /* __OPENAFS_AFS_STATS_H__ */ diff --git a/src/afs/afs_trace.et b/src/afs/afs_trace.et index 24817af5a..854ea23ff 100644 --- a/src/afs/afs_trace.et +++ b/src/afs/afs_trace.et @@ -1,32 +1,31 @@ # Copyright 2000, International Business Machines Corporation and others. # All Rights Reserved. -# +# # This software has been released under the terms of the IBM Public # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html error_table 2 ZCM ec CM_TRACE_NULL, "dummy" - ec CM_TRACE_PAGEIN, "getapage vp 0x%lx off 0x%x len 0x%x rw=0x%x" + ec CM_TRACE_PAGEIN, "getapage vp 0x%lx off (0x%x, 0x%x) len 0x%x rw=0x%x" ec CM_TRACE_PAGEINDONE, "getapage done code 0x%x pg 0x%lx (0x%x)" - ec CM_TRACE_PAGEOUT, "putpage vp 0x%lx off 0x%x len 0x%x flags=0x%x" + ec CM_TRACE_PAGEOUT, "putpage vp 0x%lx off (0x%x, 0x%x) len 0x%x flags=0x%x" ec CM_TRACE_PAGEOUTDONE, "putpage done code 0x%x #dirty 0x%x" - ec CM_TRACE_PAGEOUTONE, "putApage vp 0x%lx pag 0x%lx len 0x%x off 0x%x" - ec CM_TRACE_VMRW, "vmrw vp 0x%lx, write=0x%x, off=0x%x, len=0x%x" + ec CM_TRACE_PAGEOUTONE, "putApage vp 0x%lx pag 0x%lx len 0x%x off (0x%x, 0x%x)" + ec CM_TRACE_VMRW, "vmrw vp 0x%lx, write=0x%x, off=(0x%x, 0x%x), len=(0x%x, 0x%x)" ec CM_TRACE_STRATEGYDONE, "strategy done vp 0x%lx code 0x%x left 0x%x" ec CM_TRACE_FLUSHV, "flushv vp 0x%lx states 0x%x" - ec CM_TRACE_GETDOWND, "getdownd vp 0x%lx skip 0x%x idxf 0x%x coff 0x%x" + ec CM_TRACE_GETDOWND, "getdownd vp 0x%lx skip 0x%x index %d coff (0x%x, 0x%x)" ec CM_TRACE_ACTCCORE, "ActiveCore vp 0x%lx XoW 0x%x" - ec CM_TRACE_WVCACHE, "RXAFS_StoreStatus vp 0x%lx len 0x%x" + ec CM_TRACE_WVCACHE, "RXAFS_StoreStatus vp 0x%lx len (0x%x, 0x%x)" ec CM_TRACE_TRYTOSMUSH, "TryToSmush vp 0x%lx len 0x%x" - ec CM_TRACE_STOREPROC, "StoreProc vp 0x%lx tlen 0x%x alen 0x%x" - ec CM_TRACE_FETCHPROC, "FetchProc vp 0x%lx pos 0x%x size 0x%x" - ec CM_TRACE_SIMPLEVSTAT, "SimpleVStat vp 0x%lx old len 0x%x new len 0x%x" - ec CM_TRACE_PROCESSFS, "ProcessFS vp 0x%lx old len 0x%x new len 0x%x" - ec CM_TRACE_STOREALL, "StoreAll vp 0x%lx len 0x%x" + ec CM_TRACE_STOREPROC, "StoreProc vp 0x%lx fid (%x:%d.%d.%d) m.Length (0x%x, 0x%x) alen 0x%x" + ec CM_TRACE_FETCHPROC, "FetchProc vp 0x%lx fid (%x:%d.%d.%d) pos (0x%x, 0x%x) size 0x%x" + ec CM_TRACE_SIMPLEVSTAT, "SimpleVStat vp 0x%lx old len (0x%x, 0x%x) new len (0x%x, 0x%x)" + ec CM_TRACE_PROCESSFS, "ProcessFS vp 0x%lx old len (0x%x, 0x%x) new len (0x%x, 0x%x)" + ec CM_TRACE_STOREALL, "StoreAll vp 0x%lx len (0x%x, 0x%x)" ec CM_TRACE_INVALL, "InvalAll vp 0x%lx len 0x%x" - ec CM_TRACE_TRUNCALL1, "TruncAll vp 0x%lx old len 0x%x new len 0x%x" - ec CM_TRACE_TRUNCALL2,"TruncAll vp 0x%lx vlen 0x%x len 0x%x" + ec CM_TRACE_TRUNCALL, "TruncAll vp 0x%lx old len (0x%x, 0x%x) new len (0x%x, 0x%x)" ec CM_TRACE_GNLINK, "Gn_link vp 0x%lx name %s (returns 0x%x)" ec CM_TRACE_GMKDIR, "Gn_mkdir vp 0x%lx name %s mode 0x%x (returns 0x%x)" @@ -45,7 +44,7 @@ error_table 2 ZCM ec CM_TRACE_GSETATTR, "Gn_setattr vp 0x%lx (returns 0x%x)" ec CM_TRACE_GFCLEAR, "Gn_fclear vp 0x%lx offset 0x%x len 0x%x (returns 0x%x)" ec CM_TRACE_GFSYNC, "Gn_fsync vp 0x%lx flags 0x%x (returns 0x%x)" - ec CM_TRACE_GFTRUNC, "Gn_ftrunc vp 0x%lx flags 0x%x len 0x%x (returns 0x%x)" + ec CM_TRACE_GFTRUNC, "Gn_ftrunc vp 0x%lx flags 0x%x len (0x%x, 0x%x) (returns 0x%x)" ec CM_TRACE_GRDWR, "Gn_rdwr vp 0x%lx flags 0x%x op 0x%x (returns 0x%x)" ec CM_TRACE_GLOCKCTL, "Gn_locktl vp 0x%lx cmd 0x%x (returns 0x%x)" ec CM_TRACE_GIOCTL, "Gn_ioctl vp 0x%lx cmd 0x%x (returns 0x%x)" @@ -56,7 +55,8 @@ error_table 2 ZCM ec CM_TRACE_STUFFVCACHE, "StuffVcache 0x%lx callback host 0x%lx expires %u (in %u secs)" ec CM_TRACE_GETDCACHE1, "Getdcache vp 0x%lx failed to find chunk 0x%x" ec CM_TRACE_GETDCACHE2, "GetdCache vp 0x%lx dcache 0x%lx dcache low-version 0x%x, vcache low-version 0x%x" - ec CM_TRACE_STOREMINI, "storemini vp 0x%lx length 0x%x" + ec CM_TRACE_GETDCACHE3, "GetdCache tlen 0x%x flags 0x%x abyte (0x%x, 0x%x) Position (0x%x, 0x%x)" + ec CM_TRACE_STOREMINI, "storemini vp 0x%lx length (0x%x, 0x%x)" ec CM_TRACE_STOREDCACHE, "StoreDCache vp 0x%lx chunk 0x%x length 0x%x at position 0x%x" ec CM_TRACE_STOREDCACHEDONE, "StoreDCache Done for vp 0x%lx (returns 0x%x)" ec CM_TRACE_STOREALLDONE, "StoreAll Done vp 0x%lx length 0x%x (returns 0x%x)" @@ -71,7 +71,7 @@ error_table 2 ZCM ec CM_TRACE_NFSOUT, "NfsOut op 0x%x vp 0x%lx fid (%x:%d.%d.%d)" ec CM_TRACE_NFSIN, "NfsIn op 0x%x" ec CM_TRACE_NFSIN1, "Nfs Root fid client 0x%lx fid (%x:%d.%d.%d)" - ec CM_TRACE_FLUSHPAGES, "flushpages vp 0x%x data version low 0x%x length 0x%x" + ec CM_TRACE_FLUSHPAGES, "flushpages vp 0x%lx data version low 0x%x length 0x%x" ec CM_TRACE_SYNCVM, "SyncVM vp 0x%lx length 0x%x" ec CM_TRACE_PIOCTL, "Pioctl command 0x%x for vp 0x%lx, follow=%d" ec CM_TRACE_CHECKCODE, "Returning code %d from %d" @@ -81,17 +81,17 @@ error_table 2 ZCM ec CM_TRACE_SETPAG, "Setpag returns 0x%x" ec CM_TRACE_OPEN, "Open 0x%x flags 0x%x" ec CM_TRACE_CLOSE, "Close 0x%lx flags 0x%x" - ec CM_TRACE_WRITE, "Write vp 0x%lx off 0x%x resid 0x%x file length 0x%x" - ec CM_TRACE_READ, "Read vp 0x%lx off 0x%x resid 0x%x file length 0x%x" - ec CM_TRACE_PARTIALWRITE, "Partial write vp 0x%lx length 0x%x" - ec CM_TRACE_GETATTR, "Getattr vp 0x%lx len 0x%x" - ec CM_TRACE_SETATTR, "Setattr vp 0x%lx len 0x%x" - ec CM_TRACE_ACCESS, "Access vp 0x%lx mode 0x%x len 0x%x" + ec CM_TRACE_WRITE, "Write vp 0x%lx off (0x%x, 0x%x) resid (0x%x, 0x%x) file length (0x%x, 0x%x)" + ec CM_TRACE_READ, "Read vp 0x%lx off (0x%x, 0x%x) resid 0x%x file length (0x%x, 0x%x)" + ec CM_TRACE_PARTIALWRITE, "Partial write vp 0x%lx length (0x%x, 0x%x)" + ec CM_TRACE_GETATTR, "Getattr vp 0x%lx len (0x%x, 0x%x)" + ec CM_TRACE_SETATTR, "Setattr vp 0x%lx mask 0x%x newlen (0x%x, 0x%x) oldlen (0x%x, 0x%x)" + ec CM_TRACE_ACCESS, "Access vp 0x%lx mode 0x%x len (0x%x, 0x%x)" ec CM_TRACE_LOOKUP, "Lookup adp 0x%lx name %s fid (%d:%d.%d.%d), code=%d" ec CM_TRACE_LOOKUP1, "Mount point is to vp 0x%lx fid (%d:%d.%d.%d)" ec CM_TRACE_CREATE, "create file in vp 0x%lx name %s mode 0x%x" ec CM_TRACE_REMOVE, "remove dir 0x%lx name %s" - ec CM_TRACE_LINK, "hard link dir 0x%lx vp %lx name %s" + ec CM_TRACE_LINK, "hard link dir 0x%lx vp 0x%lx name %s" ec CM_TRACE_RENAME, "Rename d1 0x%lx name %s to d2 0x%lx name %s" ec CM_TRACE_MKDIR, "Mkdir parent 0x%lx entry %s" ec CM_TRACE_RMDIR, "Rmdir parent 0x%lx entry %s" @@ -99,10 +99,10 @@ error_table 2 ZCM ec CM_TRACE_READLINK, "readlink 0x%lx" ec CM_TRACE_FSYNC, "fsync 0x%lx" - ec CM_TRACE_LOCKDONE, "Released lock 0x%lx level %d" - ec CM_TRACE_LOCKDOWN, "Downgraded lock 0x%lx to %d" - ec CM_TRACE_LOCKOBTAIN,"Obtained lock 0x%lx level %d" - ec CM_TRACE_LOCKSLEPT, "Slept for lock 0x%lx level %d" + ec CM_TRACE_LOCKDONE, "%s line %d: Released lock 0x%lx level %d" + ec CM_TRACE_LOCKDOWN, "%s line %d: Downgraded lock 0x%lx to %d" + ec CM_TRACE_LOCKOBTAIN,"%s line %d: Obtained lock 0x%lx level %d" + ec CM_TRACE_LOCKSLEPT, "Slept %lu us for lock 0x%lx level %d" ec CM_TRACE_PAGE_READ, "0x%lx called page_read (returned %d) states 0x%x" ec CM_TRACE_PAGE_WRITE, "0x%lx called page_write (returned %d) states 0x%x" @@ -122,15 +122,55 @@ error_table 2 ZCM ec CM_TRACE_NFS3IN1, "Nfs3 Root fid client 0x%lx fid (%x:%d.%d.%d)" ec CM_TRACE_VGET, "Vget vp 0x%lx uid %x fid (%x:%d.%d.%d)" ec CM_TRACE_VFSROOT, "vfs root vp 0x%lx, code %d" - ec CM_TRACE_READOP, "Iread ip 0x%lx pos 0x%x count 0x%x code %x" - ec CM_TRACE_WRITEOP, "Iwrite ip 0x%lx pos 0x%x count 0x%x code %x" + ec CM_TRACE_READOP, "Iread ip x%lx pos (0x%x, 0x%x) count 0x%x code %x" + ec CM_TRACE_WRITEOP, "Iwrite ip 0x%lx pos (0x%x, 0x%x) count 0x%x code %x" ec CM_TRACE_READPAGE, "Ireadpage ip 0x%lx pp 0x%x count 0x%x code %x" ec CM_TRACE_UPDATEPAGE, "Iupdatepage ip 0x%lx pp 0x%x count 0x%x code %d" ec CM_TRACE_VM_CLOSE, "VMclose ip 0x%lx mapcnt %d opens %d XoW %d" - ec CM_TRACE_PREFETCHCMD, "PrefetchCmd tvc 0x%x tfid (%d:%d.%d.%d) fid (%d:%d.%d.%d)" - ec CM_TRACE_RESIDCMD, "ResidencyCmd tvc 0x%x command %d fid (%d:%d.%d.%d)" - ec CM_TRACE_DENTRYDELETE, "d_delete inode 0x%x d_name %s/%s" + ec CM_TRACE_FETCH64, "FetchProc for vp = 0x%lx oldserver was %d, found length (0x%x, 0x%x)" + ec CM_TRACE_UFSLINK, "UFSHandleLink: vp = 0x%lx, tdc 0x%lx, len (0x%x, 0x%x)" + ec CM_TRACE_VMRDWR, "afs_vm_rdwr: vp = 0x%lx, xfrSize 0x%lx, toffset 0x%x" + ec CM_TRACE_READFAST, "ReadFast vp 0x%lx off (0x%x, 0x%x) resid 0x%x file length (0x%x, 0x%x)" + ec CM_TRACE_FETCH64CODE, "StartRX_FetchData64 for vp 0x%lx returned %d" + ec CM_TRACE_FETCH64LENG, "FetchData64 for vp 0xl%x code = %d, length = (0x%x, 0x%x)" + ec CM_TRACE_FETCH64READ, "FetchData64 for vp 0xl%x code = %d, length = 0x%x" + ec CM_TRACE_VMWRITE, "afs_vm_rdwr: vp 0x%lx offset (0x%x, 0x%x) length (0x%x, 0x%x)" + ec CM_TRACE_VMWRITE2, "afs_vm_rdwr: vp 0x%lx first page 0x%x pages %d" + ec CM_TRACE_VMSTOREALL, "osi_VM_StoreAllSegments for vp 0x%lx call %d" + ec CM_TRACE_PARTIALWRITE0, "Partial write currDirty %d maxDirty %d" + ec CM_TRACE_DIRECTRDWR, "direct_rdwr: vp 0x%lx offset (0x%x, 0x%x) resid 0x%x" + ec CM_TRACE_GOPRDWR, "gop_rdwr: offset (0x%x, 0x%x) len 0x%x resid 0x%x code %d" + ec CM_TRACE_GRDWR1, "Gn_rdwr error vp 0x%lx returns %d" + ec CM_TRACE_READTDC, "UFSRead: vp 0x%lx tdc 0x%lx at %d refcount 0x%x" + ec CM_TRACE_MEMFETCH, "MemFetch: vp 0x%lx mceP 0x%lx offset (0x%x, 0x%x) length 0x%x" + ec CM_TRACE_VMWRITE3, "afs_vm_rdwr: vp 0x%lx code %d" + ec CM_TRACE_STOREALL2, "StoreAll 2 vp 0x%lx chunk 0x%x index %d inode %d" + ec CM_TRACE_MEMOPEN, "MemOpen blkno %d mceP 0x%x data 0x%x = %s" + ec CM_TRACE_VCACHE2INODE, "vcache2inode: avc 0x%x event %d" + ec CM_TRACE_STOREDATA64, "StoreData64: fid (%d:%d.%d.%d) offs (0x%x, 0x%x) len (0x%x, 0x%x) file length (0x%x, 0x%x)" + ec CM_TRACE_RESIDCMD, "ResidencyCmd tvc 0x%x command %d fid (%d:%d.%d.%d)" + ec CM_TRACE_PREFETCHCMD, "PrefetchCmd tvc 0x%x tfid (%d:%d.%d.%d) fid (%d:%d.%d.%d)" + ec CM_TRACE_STOREPROC2, "StoreProc got (0x%x, 0x%x) length 0x%x" + ec CM_TRACE_ADJUSTSIZE, "AdjustSize index %d oldSize %d newSize %d blocksUsed %d" + ec CM_TRACE_SETLENGTH, "%s line %d: m.Length was (0x%x, 0x%x), now (0x%x, 0x%x)" + ec CM_TRACE_DCACHEWAIT, "%s line %d: waiting for 0x%x flags 0x%x" + ec CM_TRACE_VNODEREAD, "UFSRead: tdc 0x%lx, offset (0x%x, 0x%x) len (0x%x 0x%x)" + ec CM_TRACE_SLEEP, "Sleep: evp 0x%lx, count %d seq 0x%x evp->seq 0x%x" + ec CM_TRACE_WAKE, "Wakeup: evp 0x%lx, evp->seq 0x%x" + ec CM_TRACE_DENTRYDELETE, "d_delete inode 0x%x d_name %s/%s" ec CM_TRACE_DENTRYIPUT, "d_iput inode 0x%x d_name %s/%s" ec CM_TRACE_TRYFLUSHDCACHECHILDREN, "TryFlushDcacheChildren ip 0x%x name %s parent %s" + ec CM_TRACE_DCACHEWAKE, "%s line %d: waking up waiters for 0x%x flags 0x%x" + ec CM_TRACE_VERSIONNO, "At offset (0x%x, 0x%x) vc shows (0x%x, 0x%x), dc (0x%x, 0x%x)" + ec CM_TRACE_TIMESTAMP, "%s" + ec CM_TRACE_RXSLEEP, "osi_rxSleep() at %s line %d" + ec CM_TRACE_RXWAKE, "osi_rxWakeup() at %s line %d" + ec CM_TRACE_GNGETACL, "Gn_getacl vp 0x%lx (returns 0x%x)" + ec CM_TRACE_EINVAL, "EINVAL in %s at line %d" + ec CM_TRACE_VNODEREAD2, "negative length tdc 0x%lx validPos (0x%x, 0x%x) chunkBytes 0x%x dflags 0x%x" + ec CM_TRACE_WASHERE, "Was here: %s line %d, code = %d" + ec CM_TRACE_LOCKWAIT,"%s line %d: Waiting for lock 0x%lx level %d" + ec CM_TRACE_WRITEFAILED, "osi_Write failed len %ld resid %ld err %ld" + ec CM_TRACE_ADJUSTSIZE2, "AdjustSize dc = 0x%lx, chunkBytes = 0x%x used = %ld, diff = %ld" end diff --git a/src/afs/afs_user.c b/src/afs/afs_user.c index 27e70f086..c40c09a75 100644 --- a/src/afs/afs_user.c +++ b/src/afs/afs_user.c @@ -11,12 +11,13 @@ * Implements: */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_user.c,v 1.1.1.9 2003/07/30 17:08:02 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_user.c,v 1.15 2003/07/15 23:14:13 shadow Exp $"); -#include "../afs/stds.h" -#include "../afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/stds.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ #if !defined(UKERNEL) #if !defined(AFS_LINUX20_ENV) @@ -25,15 +26,15 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_user.c,v 1.1.1.9 2003/07/30 17: #include #ifdef AFS_SGI62_ENV -#include "../h/hashing.h" +#include "h/hashing.h" #endif #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV) #include #endif /* ! AFS_HPUX110_ENV */ #endif /* !defined(UKERNEL) */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ #if defined(AFS_SUN56_ENV) #include @@ -45,14 +46,6 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_user.c,v 1.1.1.9 2003/07/30 17: #endif -/* Imported variables */ -extern afs_rwlock_t afs_xserver; -extern afs_rwlock_t afs_xsrvAddr; -extern afs_rwlock_t afs_xconn; -extern afs_rwlock_t afs_xvcache; -extern struct srvAddr *afs_srvAddrs[NSERVERS]; /* Hashed by server's ip */ -extern struct server *afs_servers[NSERVERS]; - /* Exported variables */ afs_rwlock_t afs_xuser; struct unixuser *afs_users[NUSERS]; @@ -65,8 +58,8 @@ void afs_ResetAccessCache(afs_int32 uid, int alock); * Called with afs_xuser, afs_xserver and afs_xconn locks held, to delete * appropriate conn structures for au */ -static void RemoveUserConns(au) - register struct unixuser *au; +static void +RemoveUserConns(register struct unixuser *au) { register int i; register struct server *ts; @@ -74,9 +67,9 @@ static void RemoveUserConns(au) register struct conn *tc, **lc; AFS_STATCNT(RemoveUserConns); - for (i=0;inext) { - for (sa = ts->addr; sa; sa = sa->next_sa) { + for (i = 0; i < NSERVERS; i++) { + for (ts = afs_servers[i]; ts; ts = ts->next) { + for (sa = ts->addr; sa; sa = sa->next_sa) { lc = &sa->conns; for (tc = *lc; tc; lc = &tc->next, tc = *lc) { if (tc->user == au && tc->refCount == 0) { @@ -85,14 +78,14 @@ static void RemoveUserConns(au) rx_DestroyConnection(tc->id); AFS_GLOCK(); afs_osi_Free(tc, sizeof(struct conn)); - break; /* at most one instance per server */ - } /*Found unreferenced connection for user*/ - } /*For each connection on the server*/ + break; /* at most one instance per server */ + } /*Found unreferenced connection for user */ + } /*For each connection on the server */ } - } /*For each server on chain*/ - } /*For each chain*/ + } /*For each server on chain */ + } /*For each chain */ -} /*RemoveUserConns*/ +} /*RemoveUserConns */ /* Called from afs_Daemon to garbage collect unixusers no longer using system, @@ -102,18 +95,20 @@ static void RemoveUserConns(au) * other epochs as soon as possible (old file servers act bizarrely when they * see epoch changes). */ -void afs_GCUserData(aforce) { +void +afs_GCUserData(int aforce) +{ register struct unixuser *tu, **lu, *nu; register int i; afs_int32 now, delFlag; AFS_STATCNT(afs_GCUserData); /* Obtain locks in valid order */ - ObtainWriteLock(&afs_xuser,95); + ObtainWriteLock(&afs_xuser, 95); ObtainReadLock(&afs_xserver); - ObtainWriteLock(&afs_xconn,96); + ObtainWriteLock(&afs_xconn, 96); now = osi_Time(); - for (i=0;ict.EndTimestamp < now - NOTOKTIMEOUT) delFlag = 1; - } - else { + } else { if (aforce || (tu->tokenTime < now - NOTOKTIMEOUT)) delFlag = 1; } @@ -140,8 +134,7 @@ void afs_GCUserData(aforce) { if (tu->exporter) EXP_RELE(tu->exporter); afs_osi_Free(tu, sizeof(struct unixuser)); - } - else { + } else { lu = &tu->next; } } @@ -150,7 +143,7 @@ void afs_GCUserData(aforce) { ReleaseWriteLock(&afs_xuser); ReleaseReadLock(&afs_xserver); -} /*afs_GCUserData*/ +} /*afs_GCUserData */ /* @@ -158,20 +151,19 @@ void afs_GCUserData(aforce) { * cache for these guys. Can't do this when token expiration detected, * since too many locks are set then. */ -void afs_CheckTokenCache() - +void +afs_CheckTokenCache(void) { register int i; register struct unixuser *tu; afs_int32 now; - register struct cell *tcell; AFS_STATCNT(afs_CheckCacheResets); ObtainReadLock(&afs_xvcache); ObtainReadLock(&afs_xuser); now = osi_Time(); - for (i=0;inext) { + for (i = 0; i < NUSERS; i++) { + for (tu = afs_users[i]; tu; tu = tu->next) { register afs_int32 uid; /* @@ -185,10 +177,10 @@ void afs_CheckTokenCache() * cache. */ #ifdef notdef - tcell = afs_GetCell(tu->cell); /* I really hate this message - MLK */ - afs_warn("afs: Tokens for user of AFS id %d for cell %s expired now\n", - tu->vid, tcell->cellName); + afs_warn + ("afs: Tokens for user of AFS id %d for cell %s expired now\n", + tu->vid, afs_GetCell(tu->cell)->cellName); #endif tu->states |= (UTokensBad | UNeedsReset); } @@ -203,57 +195,56 @@ void afs_CheckTokenCache() ReleaseReadLock(&afs_xuser); ReleaseReadLock(&afs_xvcache); -} /*afs_CheckTokenCache*/ +} /*afs_CheckTokenCache */ -void afs_ResetAccessCache(afs_int32 uid, int alock) +void +afs_ResetAccessCache(afs_int32 uid, int alock) { - register int i, j; + register int i; register struct vcache *tvc; struct axscache *ac; AFS_STATCNT(afs_ResetAccessCache); if (alock) ObtainReadLock(&afs_xvcache); - for(i=0;ihnext) { - /* really should do this under cache write lock, but that. - is hard to under locking hierarchy */ - if (tvc->Access && (ac = afs_FindAxs(tvc->Access, uid))) { - afs_RemoveAxs (&tvc->Access, ac); - } + for (i = 0; i < VCSIZE; i++) { + for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { + /* really should do this under cache write lock, but that. + * is hard to under locking hierarchy */ + if (tvc->Access && (ac = afs_FindAxs(tvc->Access, uid))) { + afs_RemoveAxs(&tvc->Access, ac); + } } } if (alock) ReleaseReadLock(&afs_xvcache); -} /*afs_ResetAccessCache*/ +} /*afs_ResetAccessCache */ /* * Ensure all connections make use of new tokens. Discard incorrectly-cached * access info. */ -void afs_ResetUserConns (auser) - register struct unixuser *auser; - +void +afs_ResetUserConns(register struct unixuser *auser) { int i; - struct server *ts; struct srvAddr *sa; struct conn *tc; - + AFS_STATCNT(afs_ResetUserConns); ObtainReadLock(&afs_xsrvAddr); - ObtainWriteLock(&afs_xconn,98); + ObtainWriteLock(&afs_xconn, 98); - for (i=0;inext_bkt) { - for (tc = sa->conns; tc; tc=tc->next) { - if (tc->user == auser) { - tc->forceConnectFS = 1; - } + for (i = 0; i < NSERVERS; i++) { + for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) { + for (tc = sa->conns; tc; tc = tc->next) { + if (tc->user == auser) { + tc->forceConnectFS = 1; } + } } } @@ -261,18 +252,19 @@ void afs_ResetUserConns (auser) ReleaseReadLock(&afs_xsrvAddr); afs_ResetAccessCache(auser->uid, 1); auser->states &= ~UNeedsReset; -} /*afs_ResetUserConns*/ +} /*afs_ResetUserConns */ -struct unixuser *afs_FindUser(afs_int32 auid, afs_int32 acell, afs_int32 locktype) +struct unixuser * +afs_FindUser(afs_int32 auid, afs_int32 acell, afs_int32 locktype) { register struct unixuser *tu; register afs_int32 i; AFS_STATCNT(afs_FindUser); i = UHash(auid); - ObtainWriteLock(&afs_xuser,99); - for(tu = afs_users[i]; tu; tu = tu->next) { + ObtainWriteLock(&afs_xuser, 99); + for (tu = afs_users[i]; tu; tu = tu->next) { if (tu->uid == auid && ((tu->cell == acell) || (acell == -1))) { tu->refCount++; ReleaseWriteLock(&afs_xuser); @@ -280,9 +272,9 @@ struct unixuser *afs_FindUser(afs_int32 auid, afs_int32 acell, afs_int32 locktyp } } ReleaseWriteLock(&afs_xuser); - return (struct unixuser *) 0; + return NULL; -} /*afs_FindUser*/ +} /*afs_FindUser */ /*------------------------------------------------------------------------ @@ -307,17 +299,16 @@ struct unixuser *afs_FindUser(afs_int32 auid, afs_int32 acell, afs_int32 locktyp * As advertised. *------------------------------------------------------------------------*/ -void afs_ComputePAGStats() - -{ /*afs_ComputePAGStats*/ - - register struct unixuser *currPAGP; /*Ptr to curr PAG*/ - register struct unixuser *cmpPAGP; /*Ptr to PAG being compared*/ - register struct afs_stats_AuthentInfo *authP; /*Ptr to stats area*/ - int curr_Record; /*Curr record */ - int currChain; /*Curr hash chain*/ - int currChainLen; /*Length of curr hash chain*/ - int currPAGRecords; /*# records in curr PAG*/ +void +afs_ComputePAGStats(void) +{ + register struct unixuser *currPAGP; /*Ptr to curr PAG */ + register struct unixuser *cmpPAGP; /*Ptr to PAG being compared */ + register struct afs_stats_AuthentInfo *authP; /*Ptr to stats area */ + int curr_Record; /*Curr record */ + int currChain; /*Curr hash chain */ + int currChainLen; /*Length of curr hash chain */ + int currPAGRecords; /*# records in curr PAG */ /* * Lock out everyone else from scribbling on the PAG entries. @@ -331,18 +322,17 @@ void afs_ComputePAGStats() */ curr_Record = 0; authP = &(afs_stats_cmfullperf.authent); - authP->curr_PAGs = 0; - authP->curr_Records = 0; - authP->curr_AuthRecords = 0; - authP->curr_UnauthRecords = 0; - authP->curr_MaxRecordsInPAG = 0; - authP->curr_LongestChain = 0; + authP->curr_PAGs = 0; + authP->curr_Records = 0; + authP->curr_AuthRecords = 0; + authP->curr_UnauthRecords = 0; + authP->curr_MaxRecordsInPAG = 0; + authP->curr_LongestChain = 0; for (currChain = 0; currChain < NUSERS; currChain++) { currChainLen = 0; for (currPAGP = afs_users[currChain]; currPAGP; - currPAGP = currPAGP->next) - { + currPAGP = currPAGP->next) { /* * Bump the number of records on this current chain, along with * the total number of records in existence. @@ -360,14 +350,15 @@ void afs_ComputePAGStats() * If this PAG record has already been ``counted', namely * associated with a PAG and tallied, clear its bit and move on. */ - (authP->curr_Records)++; + (authP->curr_Records)++; if (currPAGP->states & UPAGCounted) { currPAGP->states &= ~UPAGCounted; continue; - } /*We've counted this one already*/ + } + /*We've counted this one already */ /* * Jot initial info down, then sweep down the rest of the hash * chain, looking for matching PAG entries. Note: to properly @@ -386,13 +377,13 @@ void afs_ComputePAGStats() */ cmpPAGP->states |= UPAGCounted; currPAGRecords++; - if ((cmpPAGP->states & UHasTokens) && - !(cmpPAGP->states & UTokensBad)) + if ((cmpPAGP->states & UHasTokens) + && !(cmpPAGP->states & UTokensBad)) (authP->curr_AuthRecords)++; else (authP->curr_UnauthRecords)++; - } /*Records belong to same PAG*/ - } /*Compare to rest of PAG records in chain*/ + } /*Records belong to same PAG */ + } /*Compare to rest of PAG records in chain */ /* * In the above comparisons, the current PAG record has been @@ -412,7 +403,7 @@ void afs_ComputePAGStats() if (currPAGRecords > authP->HWM_MaxRecordsInPAG) authP->HWM_MaxRecordsInPAG = currPAGRecords; } - } /*Sweep a hash chain*/ + } /*Sweep a hash chain */ /* * If the chain we just finished zipping through is the longest we've @@ -424,7 +415,7 @@ void afs_ComputePAGStats() authP->HWM_LongestChain = currChainLen; } - } /*For each hash chain in afs_user*/ + } /*For each hash chain in afs_user */ /* * Now that we've counted everything up, we can consider all-time @@ -440,25 +431,23 @@ void afs_ComputePAGStats() */ ReleaseReadLock(&afs_xuser); -} /*afs_ComputePAGStats*/ +} /*afs_ComputePAGStats */ -struct unixuser *afs_GetUser(auid, acell, locktype) - afs_int32 acell; - register afs_int32 auid; - afs_int32 locktype; +struct unixuser * +afs_GetUser(register afs_int32 auid, afs_int32 acell, afs_int32 locktype) { - register struct unixuser *tu, *pu=0; + register struct unixuser *tu, *pu = 0; register afs_int32 i; register afs_int32 RmtUser = 0; AFS_STATCNT(afs_GetUser); i = UHash(auid); - ObtainWriteLock(&afs_xuser,104); + ObtainWriteLock(&afs_xuser, 104); for (tu = afs_users[i]; tu; tu = tu->next) { if (tu->uid == auid) { RmtUser = 0; - pu = (struct unixuser *)0; + pu = NULL; if (tu->exporter) { RmtUser = 1; pu = tu; @@ -469,15 +458,14 @@ struct unixuser *afs_GetUser(auid, acell, locktype) tu->refCount++; ReleaseWriteLock(&afs_xuser); return tu; - } else - if (tu->cell == acell || acell == -1) { - tu->refCount++; - ReleaseWriteLock(&afs_xuser); - return tu; - } + } else if (tu->cell == acell || acell == -1) { + tu->refCount++; + ReleaseWriteLock(&afs_xuser); + return tu; + } } } - tu = (struct unixuser *) afs_osi_Alloc(sizeof(struct unixuser)); + tu = (struct unixuser *)afs_osi_Alloc(sizeof(struct unixuser)); #ifndef AFS_NOSTATS afs_stats_cmfullperf.authent.PAGCreations++; #endif /* AFS_NOSTATS */ @@ -491,8 +479,8 @@ struct unixuser *afs_GetUser(auid, acell, locktype) * we simply rerecord relevant information from the original * structure */ - if (pu && pu->exporter) { - (void) EXP_HOLD(tu->exporter = pu->exporter); + if (pu && pu->exporter) { + (void)EXP_HOLD(tu->exporter = pu->exporter); } } tu->uid = auid; @@ -503,26 +491,23 @@ struct unixuser *afs_GetUser(auid, acell, locktype) ReleaseWriteLock(&afs_xuser); return tu; -} /*afs_GetUser*/ +} /*afs_GetUser */ -void afs_PutUser(au, locktype) - register struct unixuser *au; - afs_int32 locktype; +void +afs_PutUser(register struct unixuser *au, afs_int32 locktype) { AFS_STATCNT(afs_PutUser); --au->refCount; -} /*afs_PutUser*/ +} /*afs_PutUser */ /* * Set the primary flag on a unixuser structure, ensuring that exactly one * dude has the flag set at any time for a particular unix uid. */ -void afs_SetPrimary(au, aflag) - register struct unixuser *au; - register int aflag; - +void +afs_SetPrimary(register struct unixuser *au, register int aflag) { register struct unixuser *tu; register int i; @@ -530,13 +515,13 @@ void afs_SetPrimary(au, aflag) AFS_STATCNT(afs_SetPrimary); i = UHash(au->uid); - pu = (struct unixuser *) 0; - ObtainWriteLock(&afs_xuser,105); + pu = NULL; + ObtainWriteLock(&afs_xuser, 105); /* * See if anyone is this uid's primary cell yet; recording in pu the * corresponding user */ - for (tu=afs_users[i]; tu; tu=tu->next) { + for (tu = afs_users[i]; tu; tu = tu->next) { if (tu->uid == au->uid && (tu->states & UPrimary)) { pu = tu; } @@ -548,25 +533,23 @@ void afs_SetPrimary(au, aflag) * people see a primary identity until now. */ pu->states &= ~UPrimary; - pu = (struct unixuser *) 0; + pu = NULL; } if (aflag == 1) { /* setting au to be primary */ - if (pu) pu->states &= ~UPrimary; + if (pu) + pu->states &= ~UPrimary; au->states |= UPrimary; - } - else - if (aflag == 0) { - /* we don't know if we're supposed to be primary or not */ - if (!pu || au == pu) { - au->states |= UPrimary; - } - else - au->states &= ~UPrimary; + } else if (aflag == 0) { + /* we don't know if we're supposed to be primary or not */ + if (!pu || au == pu) { + au->states |= UPrimary; + } else + au->states &= ~UPrimary; } ReleaseWriteLock(&afs_xuser); -} /*afs_SetPrimary*/ +} /*afs_SetPrimary */ #if AFS_GCPAGS @@ -584,7 +567,7 @@ void afs_SetPrimary(au, aflag) * the per process loop in GCPAGs doesn't have to * check processes without pags against the afs_users table. */ -static afs_int32 afs_GCPAGs_UIDBaseTokenCount=0; +static afs_int32 afs_GCPAGs_UIDBaseTokenCount = 0; /* * These variables keep track of the number of times @@ -592,13 +575,14 @@ static afs_int32 afs_GCPAGs_UIDBaseTokenCount=0; * walking the process table, there is something wrong and we should not * prematurely expire any tokens. */ -static size_t afs_GCPAGs_perproc_count=0; -static size_t afs_GCPAGs_cred_count=0; +static size_t afs_GCPAGs_perproc_count = 0; +static size_t afs_GCPAGs_cred_count = 0; /* * LOCKS: afs_GCPAGs_perproc_func requires write lock on afs_xuser */ -void afs_GCPAGs_perproc_func(AFS_PROC *pproc) +void +afs_GCPAGs_perproc_func(AFS_PROC * pproc) { afs_int32 pag, hash, uid; const struct AFS_UCRED *pcred; @@ -606,7 +590,7 @@ void afs_GCPAGs_perproc_func(AFS_PROC *pproc) afs_GCPAGs_perproc_count++; pcred = afs_osi_proc2cred(pproc); - if(!pcred) + if (!pcred) return; afs_GCPAGs_cred_count++; @@ -620,22 +604,22 @@ void afs_GCPAGs_perproc_func(AFS_PROC *pproc) hash = UHash(uid); /* if this token is PAG based, or it's UID based and - UID-based tokens exist */ - if((pag != NOPAG) || (afs_GCPAGs_UIDBaseTokenCount)) { + * UID-based tokens exist */ + if ((pag != NOPAG) || (afs_GCPAGs_UIDBaseTokenCount)) { /* find the entries for this uid in all cells and clear the not * referenced flag. Can't use afs_FindUser, because it just returns - * the specific cell asked for, or the first one found. - */ + * the specific cell asked for, or the first one found. + */ struct unixuser *pu; - for(pu = afs_users[hash]; pu; pu = pu->next) { + for (pu = afs_users[hash]; pu; pu = pu->next) { if (pu->uid == uid) { - if(pu->states & TMP_UPAGNotReferenced) { + if (pu->states & TMP_UPAGNotReferenced) { /* clear the 'deleteme' flag for this entry */ pu->states &= ~TMP_UPAGNotReferenced; - if(pag == NOPAG) { + if (pag == NOPAG) { /* This is a uid based token that hadn't - previously been cleared, so decrement the - outstanding uid based token count */ + * previously been cleared, so decrement the + * outstanding uid based token count */ afs_GCPAGs_UIDBaseTokenCount--; } } @@ -657,7 +641,8 @@ void afs_GCPAGs_perproc_func(AFS_PROC *pproc) * an entry in the login cache, so this routine is not needed. */ -afs_int32 afs_GCPAGs(afs_int32 *ReleasedCount) +afs_int32 +afs_GCPAGs(afs_int32 * ReleasedCount) { struct unixuser *pu; int i; @@ -669,10 +654,10 @@ afs_int32 afs_GCPAGs(afs_int32 *ReleasedCount) *ReleasedCount = 0; /* first, loop through afs_users, setting the temporary 'deleteme' flag */ - ObtainWriteLock(&afs_xuser,419); - afs_GCPAGs_UIDBaseTokenCount=0; - for(i=0; i < NUSERS; i++) { - for(pu = afs_users[i]; pu; pu = pu->next) { + ObtainWriteLock(&afs_xuser, 419); + afs_GCPAGs_UIDBaseTokenCount = 0; + for (i = 0; i < NUSERS; i++) { + for (pu = afs_users[i]; pu; pu = pu->next) { pu->states |= TMP_UPAGNotReferenced; if (((pu->uid >> 24) & 0xff) != 'A') { /* this is a uid-based token, */ @@ -686,8 +671,8 @@ afs_int32 afs_GCPAGs(afs_int32 *ReleasedCount) * for each process, mark it's PAGs (if any) in use. * i.e. clear the temporary deleteme flag. */ - afs_GCPAGs_perproc_count=0; - afs_GCPAGs_cred_count=0; + afs_GCPAGs_perproc_count = 0; + afs_GCPAGs_cred_count = 0; afs_osi_TraverseProcTable(); @@ -707,24 +692,24 @@ afs_int32 afs_GCPAGs(afs_int32 *ReleasedCount) * (temp deleteme flag still set) will be marked for later deletion, * by setting their expire times to 0. */ - for(i=0; i < NUSERS; i++) { - for(pu = afs_users[i]; pu; pu = pu->next) { - if(pu->states & TMP_UPAGNotReferenced) { - + for (i = 0; i < NUSERS; i++) { + for (pu = afs_users[i]; pu; pu = pu->next) { + if (pu->states & TMP_UPAGNotReferenced) { + /* clear the temp flag */ pu->states &= ~TMP_UPAGNotReferenced; - + /* Is this entry on behalf of a 'remote' user ? * i.e. nfs translator, etc. */ - if(!pu->exporter && afs_gcpags == AFS_GCPAGS_OK) { + if (!pu->exporter && afs_gcpags == AFS_GCPAGS_OK) { /* set the expire times to 0, causes * afs_GCUserData to remove this entry */ pu->ct.EndTimestamp = 0; pu->tokenTime = 0; - - (*ReleasedCount)++; /* remember how many we marked (info only) */ + + (*ReleasedCount)++; /* remember how many we marked (info only) */ } } } @@ -735,4 +720,4 @@ afs_int32 afs_GCPAGs(afs_int32 *ReleasedCount) return 0; } -#endif /* AFS_GCPAGS */ +#endif /* AFS_GCPAGS */ diff --git a/src/afs/afs_util.c b/src/afs/afs_util.c index 80428e244..a8ee024c5 100644 --- a/src/afs/afs_util.c +++ b/src/afs/afs_util.c @@ -13,12 +13,13 @@ * Implements: */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_util.c,v 1.1.1.10 2003/07/30 17:08:02 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_util.c,v 1.17 2003/07/15 23:14:13 shadow Exp $"); -#include "../afs/stds.h" -#include "../afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/stds.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ #if !defined(UKERNEL) #if !defined(AFS_LINUX20_ENV) @@ -27,15 +28,15 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_util.c,v 1.1.1.10 2003/07/30 17 #include #ifdef AFS_SGI62_ENV -#include "../h/hashing.h" +#include "h/hashing.h" #endif #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV) #include #endif /* ! AFS_HPUX110_ENV */ #endif /* !defined(UKERNEL) */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ #if defined(AFS_SUN56_ENV) #include @@ -50,14 +51,14 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_util.c,v 1.1.1.10 2003/07/30 17 #include #endif -extern struct volume *afs_volumes[NVOLS]; - -char *afs_cv2string(char *ttp, afs_uint32 aval) +#ifndef afs_cv2string +char * +afs_cv2string(char *ttp, afs_uint32 aval) { register char *tp = ttp; - register int i; + register int i; int any; - + AFS_STATCNT(afs_cv2string); any = 0; *(--tp) = 0; @@ -71,74 +72,113 @@ char *afs_cv2string(char *ttp, afs_uint32 aval) *(--tp) = '0'; return tp; -} /*afs_cv2string*/ - -char *afs_strchr(char *s, int c) -{ - char *p; - - for (p = s; *p; p++) - if (*p == c) - return p; - return NULL; -} +} /*afs_cv2string */ +#endif -int afs_strcasecmp(char *s1, char *s2) +#ifndef afs_strcasecmp +int +afs_strcasecmp(char *s1, char *s2) { while (*s1 && *s2) { char c1, c2; c1 = *s1++; c2 = *s2++; - if (c1 >= 'A' && c1 <= 'Z') c1 += 0x20; - if (c2 >= 'A' && c2 <= 'Z') c2 += 0x20; + if (c1 >= 'A' && c1 <= 'Z') + c1 += 0x20; + if (c2 >= 'A' && c2 <= 'Z') + c2 += 0x20; if (c1 != c2) - return c1-c2; + return c1 - c2; } return *s1 - *s2; } +#endif + +#ifndef afs_strcat +char * +afs_strcat(char *s1, char *s2) +{ + char *os1; + + os1 = s1; + while (*s1++); + --s1; + while ((*s1++ = *s2++)); + return (os1); +} +#endif + +#ifdef AFS_OBSD34_ENV +char * +afs_strcpy(char *s1, char *s2) +{ + char *os1; + + os1 = s1; + while ((*s1++ = *s2++) != '\0'); + return os1; +} +#endif -char *afs_strdup(char *s) +#ifndef afs_strchr +char * +afs_strchr(char *s, int c) +{ + char *p; + + for (p = s; *p; p++) + if (*p == c) + return p; + return NULL; +} +#endif + +char * +afs_strdup(char *s) { char *n; int cc; cc = strlen(s) + 1; - n = (char *) afs_osi_Alloc(cc); + n = (char *)afs_osi_Alloc(cc); if (n) memcpy(n, s, cc); return n; } -void print_internet_address(char *preamble, struct srvAddr *sa, - char *postamble, int flag) +void +print_internet_address(char *preamble, struct srvAddr *sa, char *postamble, + int flag) { register struct server *aserver = sa->server; char *ptr = "\n"; afs_uint32 address; - + AFS_STATCNT(print_internet_address); address = ntohl(sa->sa_ip); if (aserver->flags & SRVR_MULTIHOMED) { if (flag == 1) { /* server down mesg */ if (!(aserver->flags & SRVR_ISDOWN)) - ptr = " (multi-homed address; other same-host interfaces maybe up)\n"; + ptr = + " (multi-homed address; other same-host interfaces maybe up)\n"; else ptr = " (all multi-homed ip addresses down for the server)\n"; } else if (flag == 2) { /* server up mesg */ - ptr = " (multi-homed address; other same-host interfaces may still be down)\n"; + ptr = + " (multi-homed address; other same-host interfaces may still be down)\n"; } } - afs_warn("%s%d.%d.%d.%d in cell %s%s%s", - preamble, (address >> 24), (address >> 16) & 0xff, (address >> 8) & 0xff, (address) & 0xff, - aserver->cell->cellName, postamble, ptr); - afs_warnuser("%s%d.%d.%d.%d in cell %s%s%s", - preamble, (address >> 24), (address >> 16) & 0xff, (address >> 8) & 0xff, (address) & 0xff, - aserver->cell->cellName, postamble, ptr); + afs_warn("%s%d.%d.%d.%d in cell %s%s%s", preamble, (address >> 24), + (address >> 16) & 0xff, (address >> 8) & 0xff, (address) & 0xff, + aserver->cell->cellName, postamble, ptr); + afs_warnuser("%s%d.%d.%d.%d in cell %s%s%s", preamble, (address >> 24), + (address >> 16) & 0xff, (address >> 8) & 0xff, + (address) & 0xff, aserver->cell->cellName, postamble, ptr); -} /*print_internet_address*/ +} /*print_internet_address */ @@ -146,55 +186,66 @@ void print_internet_address(char *preamble, struct srvAddr *sa, * this code badly needs to be cleaned up... too many ugly ifdefs. * XXX */ -extern afs_int32 afs_showflags; - -afs_warn(a,b,c,d,e,f,g,h,i,j) -char *a; -#if defined(AFS_USE_VOID_PTR) -void *b, *c, *d, *e, *f, *g, *h, *i, *j; +#if 0 +void +afs_warn(char *a, long b, long c, long d, long e, long f, long g, long h, + long i, long j) +#else +void +afs_warn(a, b, c, d, e, f, g, h, i, j) + char *a; +#if defined( AFS_USE_VOID_PTR) + void *b, *c, *d, *e, *f, *g, *h, *i, *j; #else -long b,c,d,e,f,g,h,i,j; + long b, c, d, e, f, g, h, i, j; +#endif #endif { AFS_STATCNT(afs_warn); - - if (afs_showflags & GAGCONSOLE) - { + + if (afs_showflags & GAGCONSOLE) { #if defined(AFS_AIX_ENV) struct file *fd; /* cf. console_printf() in oncplus/kernext/nfs/serv/shared.c */ - if (fp_open("/dev/console",O_WRONLY|O_NOCTTY|O_NDELAY, - 0666,0,FP_SYS,&fd) == 0) { + if (fp_open + ("/dev/console", O_WRONLY | O_NOCTTY | O_NDELAY, 0666, 0, FP_SYS, + &fd) == 0) { char buf[1024]; ssize_t len; ssize_t count; - sprintf(buf, a,b,c,d,e,f,g,h,i,j); + sprintf(buf, a, b, c, d, e, f, g, h, i, j); len = strlen(buf); fp_write(fd, buf, len, 0, UIO_SYSSPACE, &count); fp_close(fd); } #else - printf(a,b,c,d,e,f,g,h,i,j); + printf(a, b, c, d, e, f, g, h, i, j); #endif } } -afs_warnuser(a,b,c,d,e,f,g,h,i,j) -char *a; -long b,c,d,e,f,g,h,i,j; +#if 0 +void +afs_warnuser(char *a, long b, long c, long d, long e, long f, long g, long h, + long i, long j) +#else +void +afs_warnuser(a, b, c, d, e, f, g, h, i, j) + char *a; + long b, c, d, e, f, g, h, i, j; +#endif { AFS_STATCNT(afs_warnuser); - if (afs_showflags & GAGUSER) - { + if (afs_showflags & GAGUSER) { #ifdef AFS_GLOBAL_SUNLOCK int haveGlock = ISAFS_GLOCK(); if (haveGlock) AFS_GUNLOCK(); #endif /* AFS_GLOBAL_SUNLOCK */ - uprintf(a,b,c,d,e,f,g,h,i,j); + uprintf(a, b, c, d, e, f, g, h, i, j); #ifdef AFS_GLOBAL_SUNLOCK if (haveGlock) @@ -205,69 +256,66 @@ long b,c,d,e,f,g,h,i,j; /* run everywhere, checking locks */ -void afs_CheckLocks() - +void +afs_CheckLocks(void) { - extern afs_rwlock_t afs_xconn, afs_xvolume, afs_xuser, afs_xcell; - extern afs_rwlock_t afs_xserver; - extern struct server *afs_servers[NSERVERS]; - extern struct unixuser *afs_users[NUSERS]; - extern unsigned char *afs_indexFlags; register int i; afs_warn("Looking for locked data structures.\n"); - afs_warn("conn %x, volume %x, user %x, cell %x, server %x\n", - afs_xconn, afs_xvolume, afs_xuser, afs_xcell, afs_xserver); + afs_warn("conn %x, volume %x, user %x, cell %x, server %x\n", afs_xconn, + afs_xvolume, afs_xuser, afs_xcell, afs_xserver); { register struct vcache *tvc; AFS_STATCNT(afs_CheckLocks); - for(i=0;ihnext) { + for (i = 0; i < VCSIZE; i++) { + for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { #ifdef AFS_OSF_ENV if (VREFCOUNT(tvc) > 1) -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ if (VREFCOUNT(tvc)) #endif afs_warn("Stat cache entry at %x is held\n", tvc); if (CheckLock(&tvc->lock)) - afs_warn("Stat entry at %x is locked\n", tvc); + afs_warn("Stat entry at %x is locked\n", tvc); } } } { register struct dcache *tdc; - for (i=0;irefCount) afs_warn("Disk entry %d at %x is held\n", i, tdc); } if (afs_indexFlags[i] & IFDataMod) - afs_warn("Disk entry %d at %x has IFDataMod flag set.\n", i, tdc); + afs_warn("Disk entry %d at %x has IFDataMod flag set.\n", i, + tdc); } } { - struct srvAddr *sa; - struct server *ts; - struct conn *tc; - for (i=0;inext) { + struct srvAddr *sa; + struct server *ts; + struct conn *tc; + for (i = 0; i < NSERVERS; i++) { + for (ts = afs_servers[i]; ts; ts = ts->next) { if (ts->flags & SRVR_ISDOWN) printf("Server entry %x is marked down\n", ts); - for (sa = ts->addr; sa; sa = sa->next_sa) { - for (tc = sa->conns; tc; tc=tc->next) { - if (tc->refCount) - afs_warn("conn at %x (server %x) is held\n", tc, sa->sa_ip); + for (sa = ts->addr; sa; sa = sa->next_sa) { + for (tc = sa->conns; tc; tc = tc->next) { + if (tc->refCount) + afs_warn("conn at %x (server %x) is held\n", tc, + sa->sa_ip); } } } } } { - struct volume *tv; - for (i=0;inext) { + struct volume *tv; + for (i = 0; i < NVOLS; i++) { + for (tv = afs_volumes[i]; tv; tv = tv->next) { if (CheckLock(&tv->lock)) afs_warn("volume at %x is locked\n", tv); if (tv->refCount) @@ -276,11 +324,12 @@ void afs_CheckLocks() } } { - struct unixuser *tu; + struct unixuser *tu; - for (i=0;inext) { - if (tu->refCount) printf("user at %x is held\n", tu); + for (i = 0; i < NUSERS; i++) { + for (tu = afs_users[i]; tu; tu = tu->next) { + if (tu->refCount) + printf("user at %x is held\n", tu); } } } @@ -288,7 +337,9 @@ void afs_CheckLocks() } -int afs_noop() { +int +afs_noop(void) +{ AFS_STATCNT(afs_noop); #ifdef AFS_OSF30_ENV return (EOPNOTSUPP); @@ -297,10 +348,12 @@ int afs_noop() { #endif } -int afs_badop() { +int +afs_badop(void) +{ AFS_STATCNT(afs_badop); osi_Panic("afs bad vnode op"); - return 0; /* make SGI C compiler happy */ + return 0; } /* @@ -314,33 +367,33 @@ int afs_badop() { afs_int32 afs_data_pointer_to_int32(const void *p) { - union { - afs_int32 i32[sizeof(void *)/sizeof(afs_int32)]; - const void *p; - } ip; + union { + afs_int32 i32[sizeof(void *) / sizeof(afs_int32)]; + const void *p; + } ip; - int i32_sub; /* subscript of least significant afs_int32 in ip.i32[] */ + int i32_sub; /* subscript of least significant afs_int32 in ip.i32[] */ - /* set i32_sub */ + /* set i32_sub */ - { - /* used to determine the byte order of the system */ - - union { - char c[sizeof(int)/sizeof(char)]; - int i; - } ci; + { + /* used to determine the byte order of the system */ - ci.i = 1; - if (ci.c[0] == 1) { - /* little-endian system */ - i32_sub = 0; - } else { - /* big-endian system */ - i32_sub = (sizeof ip.i32 / sizeof ip.i32[0]) - 1; - } + union { + char c[sizeof(int) / sizeof(char)]; + int i; + } ci; + + ci.i = 1; + if (ci.c[0] == 1) { + /* little-endian system */ + i32_sub = 0; + } else { + /* big-endian system */ + i32_sub = (sizeof ip.i32 / sizeof ip.i32[0]) - 1; } + } - ip.p = p; - return ip.i32[i32_sub]; + ip.p = p; + return ip.i32[i32_sub]; } diff --git a/src/afs/afs_util.h b/src/afs/afs_util.h index d67fc5eb0..d5188df01 100644 --- a/src/afs/afs_util.h +++ b/src/afs/afs_util.h @@ -14,6 +14,6 @@ #define _AFS_UTIL_H_ /* Handy max length of a numeric string. */ -#define CVBS 12 /* max afs_int32 is 2^32 ~ 4*10^9, +1 for NULL, +luck */ +#define CVBS 12 /* max afs_int32 is 2^32 ~ 4*10^9, +1 for NULL, +luck */ #endif /* _AFS_UTIL_H_ */ diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 05608e79a..5fde338b3 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -1,7 +1,7 @@ /* * Copyright 2000, International Business Machines Corporation and others. * All Rights Reserved. - * + * * This software has been released under the terms of the IBM Public * License. For details, see the LICENSE file in the top-level source * directory or online at http://www.openafs.org/dl/license10.html @@ -36,70 +36,73 @@ * */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_vcache.c,v 1.1.1.17 2003/07/30 17:08:02 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_vcache.c,v 1.62 2004/05/08 04:20:39 shadow Exp $"); -#include "../afs/sysincludes.h" /*Standard vendor system headers*/ -#include "../afs/afsincludes.h" /*AFS-based standard headers*/ -#include "../afs/afs_stats.h" -#include "../afs/afs_cbqueue.h" -#include "../afs/afs_osidnlc.h" +#include "afs/sysincludes.h" /*Standard vendor system headers */ +#include "afsincludes.h" /*AFS-based standard headers */ +#include "afs/afs_stats.h" +#include "afs/afs_cbqueue.h" +#include "afs/afs_osidnlc.h" #ifdef AFS_OSF_ENV -afs_int32 afs_maxvcount = 0; /* max number of vcache entries */ -afs_int32 afs_vcount = 0; /* number of vcache in use now */ -#if defined(AFS_OSF30_ENV) -extern int max_vnodes; /* number of total system vnodes */ -#else -extern int nvnode; /* number of total system vnodes */ -#endif -#ifndef AFS_OSF30_ENV -extern int numvnodes; /* number vnodes in use now */ -#endif +afs_int32 afs_maxvcount = 0; /* max number of vcache entries */ +afs_int32 afs_vcount = 0; /* number of vcache in use now */ #endif /* AFS_OSF_ENV */ + #ifdef AFS_SGI_ENV int afsvnumbers = 0; #endif -/* Imported variables */ -extern struct server *afs_servers[NSERVERS]; -extern afs_rwlock_t afs_xserver; -extern afs_rwlock_t afs_xcbhash; -extern struct vcache *afs_globalVp; -#ifdef AFS_OSF_ENV -extern struct mount *afs_globalVFS; -extern struct vnodeops Afs_vnodeops; -#elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) -extern struct mount *afs_globalVFS; -#else -extern struct vfs *afs_globalVFS; -#endif /* AFS_OSF_ENV */ -#if defined(AFS_DUX40_ENV) -extern struct vfs_ubcops afs_ubcops; -#endif -#ifdef AFS_SGI62_ENV -extern struct vnodeops Afs_vnodeops; -#endif #ifdef AFS_SGI64_ENV char *makesname(); #endif /* AFS_SGI64_ENV */ - + /* Exported variables */ -afs_rwlock_t afs_xvcache; /*Lock: alloc new stat cache entries*/ -afs_lock_t afs_xvcb; /*Lock: fids on which there are callbacks*/ -struct vcache *freeVCList; /*Free list for stat cache entries*/ -struct vcache *Initial_freeVCList; /*Initial list for above*/ -struct afs_q VLRU; /*vcache LRU*/ +afs_rwlock_t afs_xvcache; /*Lock: alloc new stat cache entries */ +afs_lock_t afs_xvcb; /*Lock: fids on which there are callbacks */ +struct vcache *freeVCList; /*Free list for stat cache entries */ +struct vcache *Initial_freeVCList; /*Initial list for above */ +struct afs_q VLRU; /*vcache LRU */ afs_int32 vcachegen = 0; unsigned int afs_paniconwarn = 0; struct vcache *afs_vhashT[VCSIZE]; +static struct afs_cbr *afs_cbrHashT[CBRSIZE]; afs_int32 afs_bulkStatsLost; int afs_norefpanic = 0; /* Forward declarations */ static afs_int32 afs_QueueVCB(struct vcache *avc); +/* + * afs_HashCBRFid + * + * Generate an index into the hash table for a given Fid. + */ +static int +afs_HashCBRFid(struct AFSFid *fid) { + return (fid->Volume + fid->Vnode + fid->Unique) % CBRSIZE; +} + +/* + * afs_InsertHashCBR + * + * Insert a CBR entry into the hash table. + * Must be called with afs_xvcb held. + */ +static void +afs_InsertHashCBR(struct afs_cbr *cbr) { + int slot = afs_HashCBRFid(&cbr->fid); + + cbr->hash_next = afs_cbrHashT[slot]; + if (afs_cbrHashT[slot]) + afs_cbrHashT[slot]->hash_pprev = &cbr->hash_next; + + cbr->hash_pprev = &afs_cbrHashT[slot]; + afs_cbrHashT[slot] = cbr; +} /* * afs_FlushVCache @@ -115,16 +118,17 @@ static afs_int32 afs_QueueVCB(struct vcache *avc); * afs_xvcache lock must be held for writing upon entry to * prevent people from changing the vrefCount field, and to * protect the lruq and hnext fields. - * LOCK: afs_FlushVCache afs_xvcache W + * LOCK: afs_FlushVCache afs_xvcache W * REFCNT: vcache ref count must be zero on entry except for osf1 * RACE: lock is dropped and reobtained, permitting race in caller */ -int afs_FlushVCache(struct vcache *avc, int *slept) -{ /*afs_FlushVCache*/ +int +afs_FlushVCache(struct vcache *avc, int *slept) +{ /*afs_FlushVCache */ register afs_int32 i, code; - register struct vcache **uvc, *wvc, *tvc; + register struct vcache **uvc, *wvc; *slept = 0; AFS_STATCNT(afs_FlushVCache); @@ -144,13 +148,13 @@ int afs_FlushVCache(struct vcache *avc, int *slept) code = EBUSY; goto bad; } - if (avc->nextfree || !avc->vlruq.prev || !avc->vlruq.next) { /* qv afs.h */ - refpanic ("LRU vs. Free inconsistency"); + if (avc->nextfree || !avc->vlruq.prev || !avc->vlruq.next) { /* qv afs.h */ + refpanic("LRU vs. Free inconsistency"); } avc->states |= CVFlushed; /* pull the entry out of the lruq and put it on the free list */ QRemove(&avc->vlruq); - avc->vlruq.prev = avc->vlruq.next = (struct afs_q *) 0; + avc->vlruq.prev = avc->vlruq.next = (struct afs_q *)0; /* keep track of # of files that we bulk stat'd, but never used * before they got recycled. @@ -161,23 +165,33 @@ int afs_FlushVCache(struct vcache *avc, int *slept) /* remove entry from the hash chain */ i = VCHash(&avc->fid); uvc = &afs_vhashT[i]; - for(wvc = *uvc; wvc; uvc = &wvc->hnext, wvc = *uvc) { + for (wvc = *uvc; wvc; uvc = &wvc->hnext, wvc = *uvc) { if (avc == wvc) { *uvc = avc->hnext; - avc->hnext = (struct vcache *) NULL; + avc->hnext = (struct vcache *)NULL; break; } } - if (!wvc) osi_Panic("flushvcache"); /* not in correct hash bucket */ - if (avc->mvid) osi_FreeSmallSpace(avc->mvid); - avc->mvid = (struct VenusFid*)0; + if (!wvc) + osi_Panic("flushvcache"); /* not in correct hash bucket */ + if (avc->mvid) + osi_FreeSmallSpace(avc->mvid); + avc->mvid = (struct VenusFid *)0; if (avc->linkData) { - afs_osi_Free(avc->linkData, strlen(avc->linkData)+1); - avc->linkData = NULL; + afs_osi_Free(avc->linkData, strlen(avc->linkData) + 1); + avc->linkData = NULL; + } +#if defined(AFS_XBSD_ENV) + /* OK, there are no internal vrefCounts, so there shouldn't + * be any more refs here. */ + if (avc->v) { + avc->v->v_data = NULL; /* remove from vnode */ + avc->v = NULL; /* also drop the ptr to vnode */ } +#endif afs_FreeAllAxs(&(avc->Access)); - /* we can't really give back callbacks on RO files, since the + /* we can't really give back callbacks on RO files, since the * server only tracks them on a per-volume basis, and we don't * know whether we still have some other files from the same * volume. */ @@ -185,58 +199,60 @@ int afs_FlushVCache(struct vcache *avc, int *slept) afs_QueueVCB(avc); } ObtainWriteLock(&afs_xcbhash, 460); - afs_DequeueCallback(avc); /* remove it from queued callbacks list */ + afs_DequeueCallback(avc); /* remove it from queued callbacks list */ avc->states &= ~(CStatd | CUnique); ReleaseWriteLock(&afs_xcbhash); afs_symhint_inval(avc); - if ((avc->states & CForeign) || (avc->fid.Fid.Vnode & 1)) - osi_dnlc_purgedp (avc); /* if it (could be) a directory */ - else - osi_dnlc_purgevp (avc); + if ((avc->states & CForeign) || (avc->fid.Fid.Vnode & 1)) + osi_dnlc_purgedp(avc); /* if it (could be) a directory */ + else + osi_dnlc_purgevp(avc); /* * Next, keep track of which vnodes we've deleted for create's * optimistic synchronization algorithm */ afs_allZaps++; - if (avc->fid.Fid.Vnode & 1) afs_oddZaps++; - else afs_evenZaps++; + if (avc->fid.Fid.Vnode & 1) + afs_oddZaps++; + else + afs_evenZaps++; #if !defined(AFS_OSF_ENV) /* put the entry in the free list */ avc->nextfree = freeVCList; freeVCList = avc; if (avc->vlruq.prev || avc->vlruq.next) { - refpanic ("LRU vs. Free inconsistency"); + refpanic("LRU vs. Free inconsistency"); } -#else +#else /* This should put it back on the vnode free list since usecount is 1 */ afs_vcount--; vSetType(avc, VREG); if (VREFCOUNT(avc) > 0) { - VN_UNLOCK(AFSTOV(avc)); - AFS_RELE(AFSTOV(avc)); + VN_UNLOCK(AFSTOV(avc)); + AFS_RELE(AFSTOV(avc)); } else { - if (afs_norefpanic) { - printf ("flush vc refcnt < 1"); - afs_norefpanic++; - (void) vgone(avc, VX_NOSLEEP, (struct vnodeops *) 0); - AFS_GLOCK(); - VN_UNLOCK(AFSTOV(avc)); - } - else osi_Panic ("flush vc refcnt < 1"); - } -#endif /* AFS_OSF_ENV */ + if (afs_norefpanic) { + printf("flush vc refcnt < 1"); + afs_norefpanic++; + (void)vgone(avc, VX_NOSLEEP, NULL); + AFS_GLOCK(); + VN_UNLOCK(AFSTOV(avc)); + } else + osi_Panic("flush vc refcnt < 1"); + } +#endif /* AFS_OSF_ENV */ avc->states |= CVFlushed; return 0; -bad: + bad: #ifdef AFS_OSF_ENV VN_UNLOCK(AFSTOV(avc)); #endif return code; -} /*afs_FlushVCache*/ +} /*afs_FlushVCache */ #ifndef AFS_SGI_ENV /* @@ -244,21 +260,20 @@ bad: * * The core of the inactive vnode op for all but IRIX. */ -void afs_InactiveVCache(struct vcache *avc, struct AFS_UCRED *acred) +void +afs_InactiveVCache(struct vcache *avc, struct AFS_UCRED *acred) { - extern afs_rwlock_t afs_xdcache, afs_xvcache; - AFS_STATCNT(afs_inactive); if (avc->states & CDirty) { - /* we can't keep trying to push back dirty data forever. Give up. */ - afs_InvalidateAllSegments(avc, 1/*set lock*/); /* turns off dirty bit */ + /* we can't keep trying to push back dirty data forever. Give up. */ + afs_InvalidateAllSegments(avc); /* turns off dirty bit */ } - avc->states &= ~CMAPPED; /* mainly used by SunOS 4.0.x */ - avc->states &= ~CDirty; /* Turn it off */ + avc->states &= ~CMAPPED; /* mainly used by SunOS 4.0.x */ + avc->states &= ~CDirty; /* Turn it off */ if (avc->states & CUnlinked) { - if (CheckLock(&afs_xvcache) || CheckLock(&afs_xdcache)) { + if (CheckLock(&afs_xvcache) || CheckLock(&afs_xdcache)) { avc->states |= CUnlinkedDel; - return; + return; } afs_remunlink(avc, 1); /* ignore any return code */ } @@ -276,7 +291,9 @@ void afs_InactiveVCache(struct vcache *avc, struct AFS_UCRED *acred) * held, so we don't have to worry about blocking in osi_Alloc. */ static struct afs_cbr *afs_cbrSpace = 0; -struct afs_cbr *afs_AllocCBR() { +struct afs_cbr * +afs_AllocCBR(void) +{ register struct afs_cbr *tsp; int i; @@ -285,14 +302,15 @@ struct afs_cbr *afs_AllocCBR() { /* don't allocate more than 2 * AFS_NCBRS for now */ afs_FlushVCBs(0); afs_stats_cmperf.CallBackFlushes++; - } - else { + } else { /* try allocating */ - tsp = (struct afs_cbr *) afs_osi_Alloc(AFS_NCBRS * sizeof(struct afs_cbr)); - for(i=0; i < AFS_NCBRS-1; i++) { - tsp[i].next = &tsp[i+1]; + tsp = + (struct afs_cbr *)afs_osi_Alloc(AFS_NCBRS * + sizeof(struct afs_cbr)); + for (i = 0; i < AFS_NCBRS - 1; i++) { + tsp[i].next = &tsp[i + 1]; } - tsp[AFS_NCBRS-1].next = 0; + tsp[AFS_NCBRS - 1].next = 0; afs_cbrSpace = tsp; afs_stats_cmperf.CallBackAlloced++; } @@ -305,15 +323,24 @@ struct afs_cbr *afs_AllocCBR() { /* * afs_FreeCBR * - * Description: free a callback return structure. + * Description: free a callback return structure, removing it from all lists. * * Parameters: * asp -- the address of the structure to free. * * Environment: the xvcb lock is held over these calls. */ -afs_FreeCBR(asp) -register struct afs_cbr *asp; { +int +afs_FreeCBR(register struct afs_cbr *asp) +{ + *(asp->pprev) = asp->next; + if (asp->next) + asp->next->pprev = asp->pprev; + + *(asp->hash_pprev) = asp->hash_next; + if (asp->hash_next) + asp->hash_next->hash_pprev = asp->hash_pprev; + asp->next = afs_cbrSpace; afs_cbrSpace = asp; return 0; @@ -329,9 +356,10 @@ register struct afs_cbr *asp; { * Environment: holds xvcb lock over RPC to guard against race conditions * when a new callback is granted for the same file later on. */ -afs_int32 afs_FlushVCBs (afs_int32 lockit) +afs_int32 +afs_FlushVCBs(afs_int32 lockit) { - struct AFSFid tfids[AFS_MAXCBRSCALL]; + struct AFSFid *tfids; struct AFSCallBack callBacks[1]; struct AFSCBFids fidArray; struct AFSCBs cbArray; @@ -343,89 +371,99 @@ afs_int32 afs_FlushVCBs (afs_int32 lockit) struct vrequest treq; struct conn *tc; int safety1, safety2, safety3; - extern int afs_totalServers; - XSTATS_DECLS - - if (code = afs_InitReq(&treq, &afs_osi_cred)) return code; + XSTATS_DECLS if ((code = afs_InitReq(&treq, afs_osi_credp))) + return code; treq.flags |= O_NONBLOCK; + tfids = afs_osi_Alloc(sizeof(struct AFSFid) * AFS_MAXCBRSCALL); - if (lockit) MObtainWriteLock(&afs_xvcb,273); + if (lockit) + MObtainWriteLock(&afs_xvcb, 273); ObtainReadLock(&afs_xserver); - for(i=0; inext, safety1++) { + for (i = 0; i < NSERVERS; i++) { + for (safety1 = 0, tsp = afs_servers[i]; + tsp && safety1 < afs_totalServers + 10; + tsp = tsp->next, safety1++) { /* don't have any */ - if (tsp->cbrs == (struct afs_cbr *) 0) continue; + if (tsp->cbrs == (struct afs_cbr *)0) + continue; /* otherwise, grab a block of AFS_MAXCBRSCALL from the list * and make an RPC, over and over again. */ - tcount = 0; /* number found so far */ - for (safety2 = 0; safety2 < afs_cacheStats ; safety2++) { + tcount = 0; /* number found so far */ + for (safety2 = 0; safety2 < afs_cacheStats; safety2++) { if (tcount >= AFS_MAXCBRSCALL || !tsp->cbrs) { /* if buffer is full, or we've queued all we're going * to from this server, we should flush out the * callbacks. */ fidArray.AFSCBFids_len = tcount; - fidArray.AFSCBFids_val = (struct AFSFid *) tfids; + fidArray.AFSCBFids_val = (struct AFSFid *)tfids; cbArray.AFSCBs_len = 1; cbArray.AFSCBs_val = callBacks; + memset(&callBacks[0], 0, sizeof(callBacks[0])); callBacks[0].CallBackType = CB_EXCLUSIVE; - for (safety3 = 0; safety3 < MAXHOSTS*2; safety3++) { + for (safety3 = 0; safety3 < MAXHOSTS * 2; safety3++) { tc = afs_ConnByHost(tsp, tsp->cell->fsport, tsp->cell->cellNum, &treq, 0, SHARED_LOCK); if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_GiveUpCallBacks(tc->id, &fidArray, - &cbArray); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } - else code = -1; - if (!afs_Analyze(tc, code, 0, &treq, - AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS, - SHARED_LOCK, tsp->cell)) { - break; + XSTATS_START_TIME + (AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS); + RX_AFS_GUNLOCK(); + code = + RXAFS_GiveUpCallBacks(tc->id, &fidArray, + &cbArray); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + if (!afs_Analyze + (tc, code, 0, &treq, + AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS, SHARED_LOCK, + tsp->cell)) { + break; } } /* ignore return code, since callbacks may have - * been returned anyway, we shouldn't leave them - * around to be returned again. - * - * Next, see if we are done with this server, and if so, - * break to deal with the next one. - */ - if (!tsp->cbrs) break; + * been returned anyway, we shouldn't leave them + * around to be returned again. + * + * Next, see if we are done with this server, and if so, + * break to deal with the next one. + */ + if (!tsp->cbrs) + break; tcount = 0; - } /* if to flush full buffer */ + } + /* if to flush full buffer */ /* if we make it here, we have an entry at the head of cbrs, * which we should copy to the file ID array and then free. */ tcbrp = tsp->cbrs; tfids[tcount++] = tcbrp->fid; - tsp->cbrs = tcbrp->next; + + /* Freeing the CBR will unlink it from the server's CBR list */ afs_FreeCBR(tcbrp); - } /* while loop for this one server */ + } /* while loop for this one server */ if (safety2 > afs_cacheStats) { - afs_warn("possible internal error afs_flushVCBs (%d)\n", safety2); + afs_warn("possible internal error afs_flushVCBs (%d)\n", + safety2); } - } /* for loop for this hash chain */ - } /* loop through all hash chains */ - if (safety1 > afs_totalServers+2) { - afs_warn("AFS internal error (afs_flushVCBs) (%d > %d), continuing...\n", safety1, afs_totalServers+2); - if (afs_paniconwarn) - osi_Panic("afs_flushVCBS safety1"); + } /* for loop for this hash chain */ + } /* loop through all hash chains */ + if (safety1 > afs_totalServers + 2) { + afs_warn + ("AFS internal error (afs_flushVCBs) (%d > %d), continuing...\n", + safety1, afs_totalServers + 2); + if (afs_paniconwarn) + osi_Panic("afs_flushVCBS safety1"); } ReleaseReadLock(&afs_xserver); - if (lockit) MReleaseWriteLock(&afs_xvcb); + if (lockit) + MReleaseWriteLock(&afs_xvcb); + afs_osi_Free(tfids, sizeof(struct AFSFid) * AFS_MAXCBRSCALL); return 0; } @@ -443,10 +481,11 @@ afs_int32 afs_FlushVCBs (afs_int32 lockit) * Called when the xvcache lock is already held. */ -static afs_int32 afs_QueueVCB(struct vcache *avc) +static afs_int32 +afs_QueueVCB(struct vcache *avc) { - register struct server *tsp; - register struct afs_cbr *tcbp; + struct server *tsp; + struct afs_cbr *tcbp; AFS_STATCNT(afs_QueueVCB); /* The callback is really just a struct server ptr. */ @@ -455,89 +494,139 @@ static afs_int32 afs_QueueVCB(struct vcache *avc) /* we now have a pointer to the server, so we just allocate * a queue entry and queue it. */ - MObtainWriteLock(&afs_xvcb,274); + MObtainWriteLock(&afs_xvcb, 274); tcbp = afs_AllocCBR(); tcbp->fid = avc->fid.Fid; + tcbp->next = tsp->cbrs; + if (tsp->cbrs) + tsp->cbrs->pprev = &tcbp->next; + tsp->cbrs = tcbp; + tcbp->pprev = &tsp->cbrs; + + afs_InsertHashCBR(tcbp); /* now release locks and return */ MReleaseWriteLock(&afs_xvcb); return 0; } -#ifdef AFS_LINUX22_ENV -static void __shrink_dcache_parent(struct dentry * parent) +/* + * afs_RemoveVCB + * + * Description: + * Remove a queued callback for a given Fid. + * + * Parameters: + * afid: The fid we want cleansed of queued callbacks. + * + * Environment: + * Locks xvcb and xserver locks. + * Typically called with xdcache, xvcache and/or individual vcache + * entries locked. + */ + +void +afs_RemoveVCB(struct VenusFid *afid) { - struct dentry *this_parent = parent; - struct list_head *next; - int found = 0; - LIST_HEAD(afs_dentry_unused); - -repeat: - next = this_parent->d_subdirs.next; -resume: - while (next != &this_parent->d_subdirs) { - struct list_head *tmp = next; - struct dentry *dentry = list_entry(tmp, struct dentry, d_child); - next = tmp->next; - if (!DCOUNT(dentry)) { - list_del(&dentry->d_lru); - list_add(&dentry->d_lru, afs_dentry_unused.prev); - found++; - } - /* - * Descend a level if the d_subdirs list is non-empty. - */ - if (!list_empty(&dentry->d_subdirs)) { - this_parent = dentry; - goto repeat; - } + int slot; + struct afs_cbr *cbr, *ncbr; + + AFS_STATCNT(afs_RemoveVCB); + MObtainWriteLock(&afs_xvcb, 275); + + slot = afs_HashCBRFid(&afid->Fid); + ncbr = afs_cbrHashT[slot]; + + while (ncbr) { + cbr = ncbr; + ncbr = cbr->hash_next; + + if (afid->Fid.Volume == cbr->fid.Volume && + afid->Fid.Vnode == cbr->fid.Vnode && + afid->Fid.Unique == cbr->fid.Unique) { + afs_FreeCBR(cbr); + } + } + + MReleaseWriteLock(&afs_xvcb); +} + +#if defined(AFS_LINUX22_ENV) && !defined(AFS_LINUX26_ENV) + +static void +__shrink_dcache_parent(struct dentry *parent) +{ + struct dentry *this_parent = parent; + struct list_head *next; + int found = 0; + LIST_HEAD(afs_dentry_unused); + + repeat: + next = this_parent->d_subdirs.next; + resume: + while (next != &this_parent->d_subdirs) { + struct list_head *tmp = next; + struct dentry *dentry = list_entry(tmp, struct dentry, d_child); + next = tmp->next; + if (!DCOUNT(dentry)) { + list_del(&dentry->d_lru); + list_add(&dentry->d_lru, afs_dentry_unused.prev); + found++; } /* - * All done at this level ... ascend and resume the search. + * Descend a level if the d_subdirs list is non-empty. */ - if (this_parent != parent) { - next = this_parent->d_child.next; - this_parent = this_parent->d_parent; - goto resume; + if (!list_empty(&dentry->d_subdirs)) { + this_parent = dentry; + goto repeat; } + } + /* + * All done at this level ... ascend and resume the search. + */ + if (this_parent != parent) { + next = this_parent->d_child.next; + this_parent = this_parent->d_parent; + goto resume; + } - for (;;) { - struct dentry *dentry; - struct list_head *tmp; + for (;;) { + struct dentry *dentry; + struct list_head *tmp; - tmp = afs_dentry_unused.prev; + tmp = afs_dentry_unused.prev; - if (tmp == &afs_dentry_unused) - break; + if (tmp == &afs_dentry_unused) + break; #ifdef AFS_LINUX24_ENV - list_del_init(tmp); + list_del_init(tmp); #else - list_del(tmp); - INIT_LIST_HEAD(tmp); + list_del(tmp); + INIT_LIST_HEAD(tmp); #endif /* AFS_LINUX24_ENV */ - dentry = list_entry(tmp, struct dentry, d_lru); + dentry = list_entry(tmp, struct dentry, d_lru); #ifdef AFS_LINUX24_ENV - /* Unused dentry with a count? */ - if (DCOUNT(dentry)) - BUG(); + /* Unused dentry with a count? */ + if (DCOUNT(dentry)) + BUG(); #endif - DGET(dentry); + DGET(dentry); #ifdef AFS_LINUX24_ENV - list_del_init(&dentry->d_hash); /* d_drop */ + list_del_init(&dentry->d_hash); /* d_drop */ #else - list_del(&dentry->d_hash); - INIT_LIST_HEAD(&dentry->d_hash); + list_del(&dentry->d_hash); + INIT_LIST_HEAD(&dentry->d_hash); #endif /* AFS_LINUX24_ENV */ - DUNLOCK(); - dput(dentry); - DLOCK(); - if (!--found) - break; - } + DUNLOCK(); + dput(dentry); + DLOCK(); + if (!--found) + break; + } } /* afs_TryFlushDcacheChildren -- Shakes loose vcache references held by @@ -549,7 +638,8 @@ resume: * * Tree traversal algorithm from fs/dcache.c: select_parent() */ -static void afs_TryFlushDcacheChildren(struct vcache *tvc) +static void +afs_TryFlushDcacheChildren(struct vcache *tvc) { struct inode *ip = AFSTOI(tvc); struct dentry *this_parent; @@ -557,9 +647,9 @@ static void afs_TryFlushDcacheChildren(struct vcache *tvc) struct list_head *cur; struct list_head *head = &ip->i_dentry; struct dentry *dentry; - + AFS_GUNLOCK(); -restart: + restart: #ifndef old_vcache_scheme DLOCK(); cur = head; @@ -567,39 +657,39 @@ restart: dentry = list_entry(cur, struct dentry, d_alias); afs_Trace3(afs_iclSetp, CM_TRACE_TRYFLUSHDCACHECHILDREN, - ICL_TYPE_POINTER, ip, - ICL_TYPE_STRING, dentry->d_parent->d_name.name, - ICL_TYPE_STRING, dentry->d_name.name); + ICL_TYPE_POINTER, ip, ICL_TYPE_STRING, + dentry->d_parent->d_name.name, ICL_TYPE_STRING, + dentry->d_name.name); - if (!list_empty(&dentry->d_hash) && !list_empty(&dentry->d_subdirs)) - __shrink_dcache_parent(dentry); + if (!list_empty(&dentry->d_hash) && !list_empty(&dentry->d_subdirs)) + __shrink_dcache_parent(dentry); - if (!DCOUNT(dentry)) { - DGET(dentry); -#ifdef AFS_LINUX24_ENV - list_del_init(&dentry->d_hash); /* d_drop */ + if (!DCOUNT(dentry)) { + DGET(dentry); +#ifdef AFS_LINUX24_ENV + list_del_init(&dentry->d_hash); /* d_drop */ #else list_del(&dentry->d_hash); INIT_LIST_HEAD(&dentry->d_hash); #endif /* AFS_LINUX24_ENV */ - DUNLOCK(); - dput(dentry); - goto restart; - } + DUNLOCK(); + dput(dentry); + goto restart; + } } DUNLOCK(); AFS_GLOCK(); #else -restart: + restart: DLOCK(); cur = head; while ((cur = cur->next) != head) { - dentry = list_entry(cur, struct dentry, d_alias); + dentry = list_entry(cur, struct dentry, d_alias); - afs_Trace3(afs_iclSetp, CM_TRACE_TRYFLUSHDCACHECHILDREN, - ICL_TYPE_POINTER, ip, - ICL_TYPE_STRING, dentry->d_parent->d_name.name, - ICL_TYPE_STRING, dentry->d_name.name); + afs_Trace3(afs_iclSetp, CM_TRACE_TRYFLUSHDCACHECHILDREN, + ICL_TYPE_POINTER, ip, ICL_TYPE_STRING, + dentry->d_parent->d_name.name, ICL_TYPE_STRING, + dentry->d_name.name); if (!DCOUNT(dentry)) { AFS_GUNLOCK(); @@ -614,63 +704,7 @@ restart: DUNLOCK(); #endif } -#endif /* AFS_LINUX22_ENV */ - -/* - * afs_RemoveVCB - * - * Description: - * Remove a queued callback by looking through all the servers - * to see if any have this callback queued. - * - * Parameters: - * afid: The fid we want cleansed of queued callbacks. - * - * Environment: - * Locks xvcb and xserver locks. - * Typically called with xdcache, xvcache and/or individual vcache - * entries locked. - */ - -afs_RemoveVCB(struct VenusFid *afid) -{ /*afs_RemoveVCB*/ - - register int i, j; - register struct server *tsp; - register struct afs_cbr *tcbrp; - struct afs_cbr **lcbrpp; - - AFS_STATCNT(afs_RemoveVCB); - MObtainWriteLock(&afs_xvcb,275); - ObtainReadLock(&afs_xserver); - for(i=0;inext) { - /* if cell is known, and is wrong, then skip this server */ - if (tsp->cell && tsp->cell->cellNum != afid->Cell) continue; - - /* - * Otherwise, iterate through file IDs we're sending to the - * server. - */ - lcbrpp = &tsp->cbrs; /* first queued return callback */ - for(tcbrp = *lcbrpp; tcbrp; lcbrpp = &tcbrp->next, tcbrp = *lcbrpp) { - if (afid->Fid.Volume == tcbrp->fid.Volume && - afid->Fid.Unique == tcbrp->fid.Unique && - afid->Fid.Vnode == tcbrp->fid.Vnode) { - *lcbrpp = tcbrp->next; /* unthread from list */ - afs_FreeCBR(tcbrp); - goto done; - } - } - } - } - done: - ReleaseReadLock(&afs_xserver); - MReleaseWriteLock(&afs_xvcb); - return 0; - -} /*afs_RemoveVCB*/ - +#endif /* AFS_LINUX22_ENV && !AFS_LINUX26_ENV */ /* * afs_NewVCache @@ -686,9 +720,9 @@ afs_RemoveVCB(struct VenusFid *afid) * afid : The file id of the file whose cache entry is being * created. */ -/* LOCK: afs_NewVCache afs_xvcache W */ -struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, - afs_int32 lockit, afs_int32 locktype) +/* LOCK: afs_NewVCache afs_xvcache W */ +struct vcache * +afs_NewVCache(struct VenusFid *afid, struct server *serverp) { struct vcache *tvc; afs_int32 i; @@ -697,131 +731,151 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, struct gnode *gnodepnt; #endif #ifdef AFS_MACH_ENV - struct vm_info * vm_info_ptr; + struct vm_info *vm_info_ptr; #endif /* AFS_MACH_ENV */ #ifdef AFS_OSF_ENV struct vcache *nvc; -#endif /* AFS_OSF_ENV */ +#endif /* AFS_OSF_ENV */ struct afs_q *tq, *uq; int code, fv_slept; AFS_STATCNT(afs_NewVCache); #ifdef AFS_OSF_ENV #ifdef AFS_OSF30_ENV - if (afs_vcount >= afs_maxvcount) + if (afs_vcount >= afs_maxvcount) { #else /* * If we are using > 33 % of the total system vnodes for AFS vcache * entries or we are using the maximum number of vcache entries, * then free some. (if our usage is > 33% we should free some, if - * our usage is > afs_maxvcount, set elsewhere to 0.5*nvnode, + * our usage is > afs_maxvcount, set elsewhere to 0.5*nvnode, * we _must_ free some -- no choice). */ - if ( (( 3 * afs_vcount ) > nvnode) || ( afs_vcount >= afs_maxvcount )) + if (((3 * afs_vcount) > nvnode) || (afs_vcount >= afs_maxvcount)) { #endif - { - struct afs_q *tq, *uq; - int i; char *panicstr; + struct afs_q *tq, *uq; + int i; + char *panicstr; - i = 0; - for(tq = VLRU.prev; tq != &VLRU && anumber > 0; tq = uq) { + i = 0; + for (tq = VLRU.prev; tq != &VLRU && anumber > 0; tq = uq) { tvc = QTOV(tq); uq = QPrev(tq); - if (tvc->states & CVFlushed) - refpanic ("CVFlushed on VLRU"); + if (tvc->states & CVFlushed) + refpanic("CVFlushed on VLRU"); else if (i++ > afs_maxvcount) - refpanic ("Exceeded pool of AFS vnodes(VLRU cycle?)"); + refpanic("Exceeded pool of AFS vnodes(VLRU cycle?)"); else if (QNext(uq) != tq) - refpanic ("VLRU inconsistent"); - else if (VREFCOUNT(tvc) < 1) - refpanic ("refcnt 0 on VLRU"); + refpanic("VLRU inconsistent"); + else if (VREFCOUNT(tvc) < 1) + refpanic("refcnt 0 on VLRU"); - if ( VREFCOUNT(tvc) == 1 && tvc->opens == 0 + if (VREFCOUNT(tvc) == 1 && tvc->opens == 0 && (tvc->states & CUnlinkedDel) == 0) { code = afs_FlushVCache(tvc, &fv_slept); if (code == 0) { - anumber--; + anumber--; } if (fv_slept) { - uq = VLRU.prev; - i = 0; - continue; /* start over - may have raced. */ + uq = VLRU.prev; + i = 0; + continue; /* start over - may have raced. */ } } - if (tq == uq) break; - } - if (anumber == VCACHE_FREE) { - printf("NewVCache: warning none freed, using %d of %d\n", + if (tq == uq) + break; + } + if (anumber == VCACHE_FREE) { + printf("NewVCache: warning none freed, using %d of %d\n", afs_vcount, afs_maxvcount); if (afs_vcount >= afs_maxvcount) { osi_Panic("NewVCache - none freed"); - /* XXX instead of panicing, should do afs_maxvcount++ - and magic up another one */ + /* XXX instead of panicing, should do afs_maxvcount++ + * and magic up another one */ } - } - } + } + } AFS_GUNLOCK(); if (getnewvnode(MOUNT_AFS, &Afs_vnodeops, &nvc)) { - /* What should we do ???? */ - osi_Panic("afs_NewVCache: no more vnodes"); + /* What should we do ???? */ + osi_Panic("afs_NewVCache: no more vnodes"); } AFS_GLOCK(); tvc = nvc; - tvc->nextfree = (struct vcache *)0; + tvc->nextfree = NULL; afs_vcount++; -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ /* pull out a free cache entry */ if (!freeVCList) { i = 0; - for(tq = VLRU.prev; (anumber > 0) && (tq != &VLRU); tq = uq) { - tvc = QTOV(tq); - uq = QPrev(tq); + for (tq = VLRU.prev; (anumber > 0) && (tq != &VLRU); tq = uq) { + tvc = QTOV(tq); + uq = QPrev(tq); - if (tvc->states & CVFlushed) + if (tvc->states & CVFlushed) { refpanic("CVFlushed on VLRU"); - else if (i++ > 2*afs_cacheStats) /* even allowing for a few xallocs...*/ + } else if (i++ > 2 * afs_cacheStats) { /* even allowing for a few xallocs... */ refpanic("Increase -stat parameter of afsd(VLRU cycle?)"); - else if (QNext(uq) != tq) + } else if (QNext(uq) != tq) { refpanic("VLRU inconsistent"); - + } #ifdef AFS_DARWIN_ENV - if (tvc->opens == 0 && ((tvc->states & CUnlinkedDel) == 0) && - VREFCOUNT(tvc) == 1 && UBCINFOEXISTS(&tvc->v)) { - osi_VM_TryReclaim(tvc, &fv_slept); - if (fv_slept) { - uq = VLRU.prev; - i = 0; - continue; /* start over - may have raced. */ - } - } -#endif -#if defined(AFS_LINUX22_ENV) - if (tvc != afs_globalVp && VREFCOUNT(tvc) && tvc->opens == 0) + if (tvc->opens == 0 && ((tvc->states & CUnlinkedDel) == 0) + && VREFCOUNT(tvc) == 1 && UBCINFOEXISTS(&tvc->v)) { + osi_VM_TryReclaim(tvc, &fv_slept); + if (fv_slept) { + uq = VLRU.prev; + i = 0; + continue; /* start over - may have raced. */ + } + } +#elif defined(AFS_LINUX22_ENV) + if (tvc != afs_globalVp && VREFCOUNT(tvc) && tvc->opens == 0) { +#if defined(AFS_LINUX26_ENV) + AFS_GUNLOCK(); + d_prune_aliases(AFSTOI(tvc)); + AFS_GLOCK(); +#else afs_TryFlushDcacheChildren(tvc); #endif + } +#endif - if (VREFCOUNT(tvc) == 0 && tvc->opens == 0 - && (tvc->states & CUnlinkedDel) == 0) { + if (VREFCOUNT(tvc) == 0 && tvc->opens == 0 + && (tvc->states & CUnlinkedDel) == 0) { +#if defined(AFS_XBSD_ENV) + /* + * vgone() reclaims the vnode, which calls afs_FlushVCache(), + * then it puts the vnode on the free list. + * If we don't do this we end up with a cleaned vnode that's + * not on the free list. + * XXX assume FreeBSD is the same for now. + */ + vgone(AFSTOV(tvc)); + code = fv_slept = 0; +#else code = afs_FlushVCache(tvc, &fv_slept); +#endif if (code == 0) { - anumber--; + anumber--; } if (fv_slept) { - uq = VLRU.prev; - i = 0; - continue; /* start over - may have raced. */ + uq = VLRU.prev; + i = 0; + continue; /* start over - may have raced. */ } - } - if (tq == uq ) break; + } + if (tq == uq) + break; } } if (!freeVCList) { /* none free, making one is better than a panic */ afs_stats_cmperf.vcacheXAllocs++; /* count in case we have a leak */ - tvc = (struct vcache *) afs_osi_Alloc(sizeof (struct vcache)); -#ifdef AFS_AIX32_ENV + tvc = (struct vcache *)afs_osi_Alloc(sizeof(struct vcache)); +#ifdef KERNEL_HAVE_PIN pin((char *)tvc, sizeof(struct vcache)); /* XXX */ #endif #ifdef AFS_MACH_ENV @@ -833,31 +887,39 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, */ #endif /* AFS_MACH_ENV */ #if defined(AFS_SGI_ENV) - { char name[METER_NAMSZ]; - memset(tvc, 0, sizeof(struct vcache)); - tvc->v.v_number = ++afsvnumbers; - tvc->vc_rwlockid = OSI_NO_LOCKID; - initnsema(&tvc->vc_rwlock, 1, makesname(name, "vrw", tvc->v.v_number)); + { + char name[METER_NAMSZ]; + memset(tvc, 0, sizeof(struct vcache)); + tvc->v.v_number = ++afsvnumbers; + tvc->vc_rwlockid = OSI_NO_LOCKID; + initnsema(&tvc->vc_rwlock, 1, + makesname(name, "vrw", tvc->v.v_number)); #ifndef AFS_SGI53_ENV - initnsema(&tvc->v.v_sync, 0, makesname(name, "vsy", tvc->v.v_number)); + initnsema(&tvc->v.v_sync, 0, + makesname(name, "vsy", tvc->v.v_number)); #endif #ifndef AFS_SGI62_ENV - initnlock(&tvc->v.v_lock, makesname(name, "vlk", tvc->v.v_number)); + initnlock(&tvc->v.v_lock, + makesname(name, "vlk", tvc->v.v_number)); #endif } #endif /* AFS_SGI_ENV */ - } - else { - tvc = freeVCList; /* take from free list */ + } else { + tvc = freeVCList; /* take from free list */ freeVCList = tvc->nextfree; - tvc->nextfree = (struct vcache *)0; + tvc->nextfree = NULL; } -#endif /* AFS_OSF_ENV */ +#endif /* AFS_OSF_ENV */ #ifdef AFS_MACH_ENV vm_info_ptr = tvc->v.v_vm_info; #endif /* AFS_MACH_ENV */ +#if defined(AFS_XBSD_ENV) + if (tvc->v) + panic("afs_NewVCache(): free vcache with vnode attached"); +#endif + #if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) memset((char *)tvc, 0, sizeof(struct vcache)); #else @@ -873,9 +935,45 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, tvc->v.v_vm_info = vm_info_ptr; tvc->v.v_vm_info->pager = MEMORY_OBJECT_NULL; #endif /* AFS_MACH_ENV */ +#ifdef AFS_OBSD_ENV + AFS_GUNLOCK(); + afs_nbsd_getnewvnode(tvc); /* includes one refcount */ + AFS_GLOCK(); + lockinit(&tvc->rwlock, PINOD, "vcache", 0, 0); +#endif +#ifdef AFS_FBSD_ENV + { + struct vnode *vp; + + AFS_GUNLOCK(); +#ifdef AFS_FBSD50_ENV + if (getnewvnode(MOUNT_AFS, afs_globalVFS, afs_vnodeop_p, &vp)) +#else + if (getnewvnode(VT_AFS, afs_globalVFS, afs_vnodeop_p, &vp)) +#endif + panic("afs getnewvnode"); /* can't happen */ + AFS_GLOCK(); + if (tvc->v != NULL) { + /* I'd like to know if this ever happens... + We don't drop global for the rest of this function, + so if we do lose the race, the other thread should + have found the same vnode and finished initializing + the vcache entry. Is it conceivable that this vcache + entry could be recycled during this interval? If so, + then there probably needs to be some sort of additional + mutual exclusion (an Embryonic flag would suffice). + -GAW */ + printf("afs_NewVCache: lost the race\n"); + return (tvc); + } + tvc->v = vp; + tvc->v->v_data = tvc; + lockinit(&tvc->rwlock, PINOD, "vcache", 0, 0); + } +#endif tvc->parentVnode = 0; - tvc->mvid = (struct VenusFid *) 0; - tvc->linkData = (char *) 0; + tvc->mvid = NULL; + tvc->linkData = NULL; tvc->cbExpires = 0; tvc->opens = 0; tvc->execsOrWriters = 0; @@ -888,17 +986,85 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, tvc->vc_error = 0; afs_symhint_inval(tvc); #ifdef AFS_TEXT_ENV - tvc->flushDV.low = tvc->flushDV.high = AFS_MAXDV; + tvc->flushDV.low = tvc->flushDV.high = AFS_MAXDV; #endif hzero(tvc->mapDV); tvc->truncPos = AFS_NOTRUNC; /* don't truncate until we need to */ - hzero(tvc->m.DataVersion); /* in case we copy it into flushDV */ + hzero(tvc->m.DataVersion); /* in case we copy it into flushDV */ +#if defined(AFS_LINUX22_ENV) +{ + struct inode *ip = AFSTOI(tvc); + struct address_space *mapping = &ip->i_data; + +#if defined(AFS_LINUX26_ENV) + inode_init_once(ip); +#else + sema_init(&ip->i_sem, 1); + INIT_LIST_HEAD(&ip->i_hash); + INIT_LIST_HEAD(&ip->i_dentry); +#if defined(AFS_LINUX24_ENV) + sema_init(&ip->i_zombie, 1); + init_waitqueue_head(&ip->i_wait); + spin_lock_init(&ip->i_data.i_shared_lock); +#ifdef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK + spin_lock_init(&ip->i_data.page_lock); +#endif + INIT_LIST_HEAD(&ip->i_data.clean_pages); + INIT_LIST_HEAD(&ip->i_data.dirty_pages); + INIT_LIST_HEAD(&ip->i_data.locked_pages); + INIT_LIST_HEAD(&ip->i_dirty_buffers); +#ifdef STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS + INIT_LIST_HEAD(&ip->i_dirty_data_buffers); +#endif +#ifdef STRUCT_INODE_HAS_I_DEVICES + INIT_LIST_HEAD(&ip->i_devices); +#endif +#ifdef STRUCT_INODE_HAS_I_TRUNCATE_SEM + init_rwsem(&ip->i_truncate_sem); +#endif +#ifdef STRUCT_INODE_HAS_I_ALLOC_SEM + init_rwsem(&ip->i_alloc_sem); +#endif + +#else /* AFS_LINUX22_ENV */ + sema_init(&ip->i_atomic_write, 1); + init_waitqueue(&ip->i_wait); +#endif +#endif + +#if defined(AFS_LINUX24_ENV) + mapping->host = ip; + ip->i_mapping = mapping; +#ifdef STRUCT_ADDRESS_SPACE_HAS_GFP_MASK + ip->i_data.gfp_mask = GFP_HIGHUSER; +#endif +#if defined(AFS_LINUX26_ENV) + mapping_set_gfp_mask(mapping, GFP_HIGHUSER); +{ + extern struct backing_dev_info afs_backing_dev_info; + + mapping->backing_dev_info = &afs_backing_dev_info; +} +#endif +#endif + +#if !defined(AFS_LINUX26_ENV) + if (afs_globalVFS) + ip->i_dev = afs_globalVFS->s_dev; +#endif + ip->i_sb = afs_globalVFS; + put_inode_on_dummy_list(ip); +} +#endif + #ifdef AFS_OSF_ENV /* Hold it for the LRU (should make count 2) */ VN_HOLD(AFSTOV(tvc)); -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV */ +#if !defined(AFS_XBSD_ENV) VREFCOUNT_SET(tvc, 1); /* us */ -#endif /* AFS_OSF_ENV */ +#endif /* AFS_XBSD_ENV */ +#endif /* AFS_OSF_ENV */ #ifdef AFS_AIX32_ENV LOCK_INIT(&tvc->pvmlock, "vcache pvmlock"); tvc->vmh = tvc->segid = NULL; @@ -909,17 +1075,17 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, rw_init(&tvc->rwlock, "vcache rwlock", RW_DEFAULT, NULL); #if defined(AFS_SUN55_ENV) - /* This is required if the kaio (kernel aynchronous io) - ** module is installed. Inside the kernel, the function - ** check_vp( common/os/aio.c) checks to see if the kernel has - ** to provide asynchronous io for this vnode. This - ** function extracts the device number by following the - ** v_data field of the vnode. If we do not set this field - ** then the system panics. The value of the v_data field - ** is not really important for AFS vnodes because the kernel - ** does not do asynchronous io for regular files. Hence, - ** for the time being, we fill up the v_data field with the - ** vnode pointer itself. */ + /* This is required if the kaio (kernel aynchronous io) + ** module is installed. Inside the kernel, the function + ** check_vp( common/os/aio.c) checks to see if the kernel has + ** to provide asynchronous io for this vnode. This + ** function extracts the device number by following the + ** v_data field of the vnode. If we do not set this field + ** then the system panics. The value of the v_data field + ** is not really important for AFS vnodes because the kernel + ** does not do asynchronous io for regular files. Hence, + ** for the time being, we fill up the v_data field with the + ** vnode pointer itself. */ tvc->v.v_data = (char *)tvc; #endif /* AFS_SUN55_ENV */ #endif @@ -928,15 +1094,16 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, tvc->Access = NULL; tvc->callback = serverp; /* to minimize chance that clear - request is lost */ + * request is lost */ /* initialize vnode data, note vrefCount is v.v_count */ #ifdef AFS_AIX_ENV /* Don't forget to free the gnode space */ - tvc->v.v_gnode = gnodepnt = (struct gnode *) osi_AllocSmallSpace(sizeof(struct gnode)); + tvc->v.v_gnode = gnodepnt = + (struct gnode *)osi_AllocSmallSpace(sizeof(struct gnode)); memset((char *)gnodepnt, 0, sizeof(struct gnode)); #endif #ifdef AFS_SGI64_ENV - memset((void*)&(tvc->vc_bhv_desc), 0, sizeof(tvc->vc_bhv_desc)); + memset((void *)&(tvc->vc_bhv_desc), 0, sizeof(tvc->vc_bhv_desc)); bhv_desc_init(&(tvc->vc_bhv_desc), tvc, tvc, &Afs_vnodeops); #ifdef AFS_SGI65_ENV vn_bhv_head_init(&(tvc->v.v_bh), "afsvp"); @@ -946,7 +1113,7 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, bhv_insert_initial(&(tvc->v.v_bh), &(tvc->vc_bhv_desc)); #endif #ifdef AFS_SGI65_ENV - tvc->v.v_mreg = tvc->v.v_mregb = (struct pregion*)tvc; + tvc->v.v_mreg = tvc->v.v_mregb = (struct pregion *)tvc; #ifdef VNODE_TRACING tvc->v.v_trace = ktrace_alloc(VNODE_TRACE_SIZE, 0); #endif @@ -961,7 +1128,7 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, init_bitlock(&(tvc->v.v_flag, VLOCK, "vnode", tvc->v.v_number); #endif #ifdef INTR_KTHREADS - AFS_VN_INIT_BUF_LOCK(&(tvc->v)); + AFS_VN_INIT_BUF_LOCK(&(tvc->v)); #endif #else SetAfsVnode(AFSTOV(tvc)); @@ -969,38 +1136,31 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, #ifdef AFS_DARWIN_ENV tvc->v.v_ubcinfo = UBC_INFO_NULL; lockinit(&tvc->rwlock, PINOD, "vcache rwlock", 0, 0); - cache_purge(AFSTOV(tvc)); - tvc->v.v_data=tvc; - tvc->v.v_tag=VT_AFS; + cache_purge(AFSTOV(tvc)); + tvc->v.v_data = tvc; + tvc->v.v_tag = VT_AFS; /* VLISTNONE(&tvc->v); */ - tvc->v.v_freelist.tqe_next=0; - tvc->v.v_freelist.tqe_prev=(struct vnode **)0xdeadb; - /*tvc->vrefCount++;*/ -#endif -#ifdef AFS_FBSD_ENV - lockinit(&tvc->rwlock, PINOD, "vcache rwlock", 0, 0); - cache_purge(AFSTOV(tvc)); - tvc->v.v_data=tvc; - tvc->v.v_tag=VT_AFS; - tvc->v.v_usecount++; /* steal an extra ref for now so vfree never happens */ - /* This extra ref is dealt with above... */ + tvc->v.v_freelist.tqe_next = 0; + tvc->v.v_freelist.tqe_prev = (struct vnode **)0xdeadb; + /*tvc->vrefCount++; */ #endif /* * The proper value for mvstat (for root fids) is setup by the caller. */ - tvc->mvstat = 0; + tvc->mvstat = 0; if (afid->Fid.Vnode == 1 && afid->Fid.Unique == 1) - tvc->mvstat = 2; - if (afs_globalVFS == 0) osi_Panic("afs globalvfs"); + tvc->mvstat = 2; + if (afs_globalVFS == 0) + osi_Panic("afs globalvfs"); vSetVfsp(tvc, afs_globalVFS); vSetType(tvc, VREG); #ifdef AFS_AIX_ENV - tvc->v.v_vfsnext = afs_globalVFS->vfs_vnodes; /* link off vfs */ + tvc->v.v_vfsnext = afs_globalVFS->vfs_vnodes; /* link off vfs */ tvc->v.v_vfsprev = NULL; afs_globalVFS->vfs_vnodes = &tvc->v; if (tvc->v.v_vfsnext != NULL) tvc->v.v_vfsnext->v_vfsprev = &tvc->v; - tvc->v.v_next = gnodepnt->gn_vnode; /*Single vnode per gnode for us!*/ + tvc->v.v_next = gnodepnt->gn_vnode; /*Single vnode per gnode for us! */ gnodepnt->gn_vnode = &tvc->v; #endif #ifdef AFS_DEC_ENV @@ -1012,10 +1172,10 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, #ifdef AFS_OSF_ENV /* Is this needed??? */ insmntque(tvc, afs_globalVFS); -#endif /* AFS_OSF_ENV */ -#endif /* AFS_DUX40_ENV */ +#endif /* AFS_OSF_ENV */ +#endif /* AFS_DUX40_ENV */ #if defined(AFS_SGI_ENV) - VN_SET_DPAGES(&(tvc->v), (struct pfdat*)NULL); + VN_SET_DPAGES(&(tvc->v), (struct pfdat *)NULL); osi_Assert((tvc->v.v_flag & VINACT) == 0); tvc->v.v_flag = 0; osi_Assert(VN_GET_PGCNT(&(tvc->v)) == 0); @@ -1033,77 +1193,33 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, vn_initlist((struct vnlist *)&tvc->v); tvc->lastr = 0; #endif /* AFS_SGI_ENV */ -#if defined(AFS_LINUX22_ENV) - { - struct inode *ip = AFSTOI(tvc); - sema_init(&ip->i_sem, 1); -#if defined(AFS_LINUX24_ENV) - sema_init(&ip->i_zombie, 1); - init_waitqueue_head(&ip->i_wait); - spin_lock_init(&ip->i_data.i_shared_lock); -#ifdef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK - spin_lock_init(&ip->i_data.page_lock); -#endif - INIT_LIST_HEAD(&ip->i_data.clean_pages); - INIT_LIST_HEAD(&ip->i_data.dirty_pages); - INIT_LIST_HEAD(&ip->i_data.locked_pages); - INIT_LIST_HEAD(&ip->i_dirty_buffers); -#ifdef STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS - INIT_LIST_HEAD(&ip->i_dirty_data_buffers); -#endif -#ifdef STRUCT_INODE_HAS_I_DEVICES - INIT_LIST_HEAD(&ip->i_devices); -#endif - ip->i_data.host = (void*) ip; -#ifdef STRUCT_ADDRESS_SPACE_HAS_GFP_MASK - ip->i_data.gfp_mask = GFP_HIGHUSER; -#endif - ip->i_mapping = &ip->i_data; -#ifdef STRUCT_INODE_HAS_I_TRUNCATE_SEM - init_rwsem(&ip->i_truncate_sem); -#endif -#ifdef STRUCT_INODE_HAS_I_ALLOC_SEM - init_rwsem(&ip->i_alloc_sem); -#endif -#else - sema_init(&ip->i_atomic_write, 1); - init_waitqueue(&ip->i_wait); -#endif - INIT_LIST_HEAD(&ip->i_hash); - INIT_LIST_HEAD(&ip->i_dentry); - if (afs_globalVFS) { - ip->i_dev = afs_globalVFS->s_dev; - ip->i_sb = afs_globalVFS; - } - } -#endif tvc->h1.dchint = 0; - osi_dnlc_purgedp(tvc); /* this may be overkill */ + osi_dnlc_purgedp(tvc); /* this may be overkill */ memset((char *)&(tvc->quick), 0, sizeof(struct vtodc)); memset((char *)&(tvc->callsort), 0, sizeof(struct afs_q)); - tvc->slocks = (struct SimpleLocks *)0; + tvc->slocks = NULL; i = VCHash(afid); tvc->hnext = afs_vhashT[i]; afs_vhashT[i] = tvc; if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { - refpanic ("NewVCache VLRU inconsistent"); + refpanic("NewVCache VLRU inconsistent"); } - QAdd(&VLRU, &tvc->vlruq); /* put in lruq */ + QAdd(&VLRU, &tvc->vlruq); /* put in lruq */ if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { - refpanic ("NewVCache VLRU inconsistent2"); + refpanic("NewVCache VLRU inconsistent2"); } if (tvc->vlruq.next->prev != &(tvc->vlruq)) { - refpanic ("NewVCache VLRU inconsistent3"); + refpanic("NewVCache VLRU inconsistent3"); } if (tvc->vlruq.prev->next != &(tvc->vlruq)) { - refpanic ("NewVCache VLRU inconsistent4"); + refpanic("NewVCache VLRU inconsistent4"); } vcachegen++; return tvc; -} /*afs_NewVCache*/ +} /*afs_NewVCache */ /* @@ -1117,54 +1233,44 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, */ /* LOCK: afs_FlushActiveVcaches afs_xvcache N */ void -afs_FlushActiveVcaches(doflocks) - register afs_int32 doflocks; - -{ /*afs_FlushActiveVcaches*/ - +afs_FlushActiveVcaches(register afs_int32 doflocks) +{ register struct vcache *tvc; register int i; register struct conn *tc; register afs_int32 code; - register struct AFS_UCRED *cred; + register struct AFS_UCRED *cred = NULL; struct vrequest treq, ureq; struct AFSVolSync tsync; int didCore; - XSTATS_DECLS - - AFS_STATCNT(afs_FlushActiveVcaches); + XSTATS_DECLS AFS_STATCNT(afs_FlushActiveVcaches); ObtainReadLock(&afs_xvcache); - for(i=0;ihnext) { + for (i = 0; i < VCSIZE; i++) { + for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { if (doflocks && tvc->flockCount != 0) { /* if this entry has an flock, send a keep-alive call out */ - osi_vnhold(tvc, 0); + osi_vnhold(tvc, 0); ReleaseReadLock(&afs_xvcache); - ObtainWriteLock(&tvc->lock,51); + ObtainWriteLock(&tvc->lock, 51); do { - afs_InitReq(&treq, &afs_osi_cred); + afs_InitReq(&treq, afs_osi_credp); treq.flags |= O_NONBLOCK; tc = afs_Conn(&tvc->fid, &treq, SHARED_LOCK); if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_EXTENDLOCK); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_EXTENDLOCK); + RX_AFS_GUNLOCK(); + code = RXAFS_ExtendLock(tc->id, - (struct AFSFid *) &tvc->fid.Fid, + (struct AFSFid *)&tvc->fid.Fid, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } - else code = -1; - } while - (afs_Analyze(tc, code, &tvc->fid, &treq, - AFS_STATS_FS_RPCIDX_EXTENDLOCK, - SHARED_LOCK, (struct cell *)0)); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tc, code, &tvc->fid, &treq, + AFS_STATS_FS_RPCIDX_EXTENDLOCK, SHARED_LOCK, NULL)); ReleaseWriteLock(&tvc->lock); ObtainReadLock(&afs_xvcache); @@ -1177,9 +1283,9 @@ afs_FlushActiveVcaches(doflocks) * this code. Also, drop the afs_xvcache lock while * getting vcache locks. */ - osi_vnhold(tvc,0); + osi_vnhold(tvc, 0); ReleaseReadLock(&afs_xvcache); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) afs_BozonLock(&tvc->pvnLock, tvc); #endif #if defined(AFS_SGI_ENV) @@ -1187,21 +1293,21 @@ afs_FlushActiveVcaches(doflocks) * That's because if we come in via the CUnlinkedDel bit state path we'll be have 0 refcnt */ osi_Assert(VREFCOUNT(tvc) > 0); - AFS_RWLOCK((vnode_t *)tvc, VRWLOCK_WRITE); + AFS_RWLOCK((vnode_t *) tvc, VRWLOCK_WRITE); #endif - ObtainWriteLock(&tvc->lock,52); + ObtainWriteLock(&tvc->lock, 52); if (tvc->states & CCore) { tvc->states &= ~CCore; /* XXXX Find better place-holder for cred XXXX */ - cred = (struct AFS_UCRED *) tvc->linkData; - tvc->linkData = (char *) 0; /* XXX */ + cred = (struct AFS_UCRED *)tvc->linkData; + tvc->linkData = NULL; /* XXX */ afs_InitReq(&ureq, cred); afs_Trace2(afs_iclSetp, CM_TRACE_ACTCCORE, - ICL_TYPE_POINTER, tvc, - ICL_TYPE_INT32, tvc->execsOrWriters); + ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, + tvc->execsOrWriters); code = afs_StoreOnLastReference(tvc, &ureq); ReleaseWriteLock(&tvc->lock); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) afs_BozonUnlock(&tvc->pvnLock, tvc); #endif hzero(tvc->flushDV); @@ -1213,21 +1319,20 @@ afs_FlushActiveVcaches(doflocks) } } else if (tvc->states & CUnlinkedDel) { /* - * Ignore errors + * Ignore errors */ ReleaseWriteLock(&tvc->lock); -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) afs_BozonUnlock(&tvc->pvnLock, tvc); #endif #if defined(AFS_SGI_ENV) - AFS_RWUNLOCK((vnode_t *)tvc, VRWLOCK_WRITE); + AFS_RWUNLOCK((vnode_t *) tvc, VRWLOCK_WRITE); #endif afs_remunlink(tvc, 0); #if defined(AFS_SGI_ENV) - AFS_RWLOCK((vnode_t *)tvc, VRWLOCK_WRITE); + AFS_RWLOCK((vnode_t *) tvc, VRWLOCK_WRITE); #endif - } - else { + } else { /* lost (or won, perhaps) the race condition */ ReleaseWriteLock(&tvc->lock); #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) @@ -1235,7 +1340,7 @@ afs_FlushActiveVcaches(doflocks) #endif } #if defined(AFS_SGI_ENV) - AFS_RWUNLOCK((vnode_t *)tvc, VRWLOCK_WRITE); + AFS_RWUNLOCK((vnode_t *) tvc, VRWLOCK_WRITE); #endif ObtainReadLock(&afs_xvcache); AFS_FAST_RELE(tvc); @@ -1248,18 +1353,18 @@ afs_FlushActiveVcaches(doflocks) /* Matches write code setting CCore flag */ crfree(cred); } - } + } #ifdef AFS_DARWIN_ENV - if (VREFCOUNT(tvc) == 1 && UBCINFOEXISTS(&tvc->v)) { - if (tvc->opens) panic("flushactive open, hasubc, but refcnt 1"); - osi_VM_TryReclaim(tvc,0); + if (VREFCOUNT(tvc) == 1 && UBCINFOEXISTS(&tvc->v)) { + if (tvc->opens) + panic("flushactive open, hasubc, but refcnt 1"); + osi_VM_TryReclaim(tvc, 0); } #endif } } ReleaseReadLock(&afs_xvcache); - -} /*afs_FlushActiveVcaches*/ +} /* @@ -1267,12 +1372,12 @@ afs_FlushActiveVcaches(doflocks) * * Description: * Make sure a cache entry is up-to-date status-wise. - * + * * NOTE: everywhere that calls this can potentially be sped up * by checking CStatd first, and avoiding doing the InitReq * if this is up-to-date. * - * Anymore, the only places that call this KNOW already that the + * Anymore, the only places that call this KNOW already that the * vcache is not up-to-date, so we don't screw around. * * Parameters: @@ -1280,7 +1385,8 @@ afs_FlushActiveVcaches(doflocks) * areq : ??? */ -int afs_VerifyVCache2(struct vcache *avc, struct vrequest *areq) +int +afs_VerifyVCache2(struct vcache *avc, struct vrequest *areq) { register struct vcache *tvc; @@ -1289,42 +1395,43 @@ int afs_VerifyVCache2(struct vcache *avc, struct vrequest *areq) #if defined(AFS_OSF_ENV) ObtainReadLock(&avc->lock); if (afs_IsWired(avc)) { - ReleaseReadLock(&avc->lock); - return 0; + ReleaseReadLock(&avc->lock); + return 0; } ReleaseReadLock(&avc->lock); #endif /* AFS_OSF_ENV */ /* otherwise we must fetch the status info */ - ObtainWriteLock(&avc->lock,53); + ObtainWriteLock(&avc->lock, 53); if (avc->states & CStatd) { ReleaseWriteLock(&avc->lock); return 0; } ObtainWriteLock(&afs_xcbhash, 461); - avc->states &= ~( CStatd | CUnique ); - avc->callback = (struct server *)0; + avc->states &= ~(CStatd | CUnique); + avc->callback = NULL; afs_DequeueCallback(avc); ReleaseWriteLock(&afs_xcbhash); ReleaseWriteLock(&avc->lock); - /* since we've been called back, or the callback has expired, - * it's possible that the contents of this directory, or this + /* since we've been called back, or the callback has expired, + * it's possible that the contents of this directory, or this * file's name have changed, thus invalidating the dnlc contents. */ - if ((avc->states & CForeign) || (avc->fid.Fid.Vnode & 1)) - osi_dnlc_purgedp (avc); + if ((avc->states & CForeign) || (avc->fid.Fid.Vnode & 1)) + osi_dnlc_purgedp(avc); else - osi_dnlc_purgevp (avc); - + osi_dnlc_purgevp(avc); + /* fetch the status info */ - tvc = afs_GetVCache(&avc->fid, areq, (afs_int32*)0, avc, READ_LOCK); - if (!tvc) return ENOENT; + tvc = afs_GetVCache(&avc->fid, areq, NULL, avc); + if (!tvc) + return ENOENT; /* Put it back; caller has already incremented vrefCount */ - afs_PutVCache(tvc, READ_LOCK); + afs_PutVCache(tvc); return 0; -} /*afs_VerifyVCache*/ +} /*afs_VerifyVCache */ /* @@ -1343,88 +1450,84 @@ int afs_VerifyVCache2(struct vcache *avc, struct vrequest *areq) * Callers: as of 1992-04-29, only called by WriteVCache */ static void -afs_SimpleVStat(avc, astat, areq) - register struct vcache *avc; - register struct AFSFetchStatus *astat; - struct vrequest *areq; -{ /*afs_SimpleVStat*/ - +afs_SimpleVStat(register struct vcache *avc, + register struct AFSFetchStatus *astat, struct vrequest *areq) +{ + afs_size_t length; AFS_STATCNT(afs_SimpleVStat); #ifdef AFS_SGI_ENV if ((avc->execsOrWriters <= 0) && !afs_DirtyPages(avc) - && !AFS_VN_MAPPED((vnode_t*)avc)) + && !AFS_VN_MAPPED((vnode_t *) avc)) { #else - if ((avc->execsOrWriters <= 0) && !afs_DirtyPages(avc)) + if ((avc->execsOrWriters <= 0) && !afs_DirtyPages(avc)) { #endif - - { +#ifdef AFS_64BIT_CLIENT + FillInt64(length, astat->Length_hi, astat->Length); +#else /* AFS_64BIT_CLIENT */ + length = astat->Length; +#endif /* AFS_64BIT_CLIENT */ #if defined(AFS_SGI_ENV) - osi_Assert((valusema(&avc->vc_rwlock) <= 0) && - (OSI_GET_LOCKID() == avc->vc_rwlockid)); - if (astat->Length < avc->m.Length) { - vnode_t *vp = (vnode_t *)avc; - - osi_Assert(WriteLocked(&avc->lock)); - ReleaseWriteLock(&avc->lock); - AFS_GUNLOCK(); - PTOSSVP(vp, (off_t)astat->Length, (off_t)MAXLONG); - AFS_GLOCK(); - ObtainWriteLock(&avc->lock,67); - } -#endif - /* if writing the file, don't fetch over this value */ - afs_Trace3(afs_iclSetp, CM_TRACE_SIMPLEVSTAT, - ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->m.Length, - ICL_TYPE_INT32, astat->Length); - avc->m.Length = astat->Length; - avc->m.Date = astat->ClientModTime; + osi_Assert((valusema(&avc->vc_rwlock) <= 0) + && (OSI_GET_LOCKID() == avc->vc_rwlockid)); + if (length < avc->m.Length) { + vnode_t *vp = (vnode_t *) avc; + + osi_Assert(WriteLocked(&avc->lock)); + ReleaseWriteLock(&avc->lock); + AFS_GUNLOCK(); + PTOSSVP(vp, (off_t) length, (off_t) MAXLONG); + AFS_GLOCK(); + ObtainWriteLock(&avc->lock, 67); } +#endif + /* if writing the file, don't fetch over this value */ + afs_Trace3(afs_iclSetp, CM_TRACE_SIMPLEVSTAT, ICL_TYPE_POINTER, avc, + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length), + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(length)); + avc->m.Length = length; + avc->m.Date = astat->ClientModTime; + } avc->m.Owner = astat->Owner; avc->m.Group = astat->Group; avc->m.Mode = astat->UnixModeBits; if (vType(avc) == VREG) { avc->m.Mode |= S_IFREG; - } - else if (vType(avc) == VDIR) { + } else if (vType(avc) == VDIR) { avc->m.Mode |= S_IFDIR; - } - else if (vType(avc) == VLNK) { - - - + } else if (vType(avc) == VLNK) { avc->m.Mode |= S_IFLNK; - if ((avc->m.Mode & 0111) == 0) avc->mvstat = 1; + if ((avc->m.Mode & 0111) == 0) + avc->mvstat = 1; } if (avc->states & CForeign) { - struct axscache *ac; + struct axscache *ac; avc->anyAccess = astat->AnonymousAccess; #ifdef badidea - if ((astat->CallerAccess & ~astat->AnonymousAccess)) - /* USED TO SAY : - * Caller has at least one bit not covered by anonymous, and - * thus may have interesting rights. - * - * HOWEVER, this is a really bad idea, because any access query - * for bits which aren't covered by anonymous, on behalf of a user - * who doesn't have any special rights, will result in an answer of - * the form "I don't know, lets make a FetchStatus RPC and find out!" - * It's an especially bad idea under Ultrix, since (due to the lack of - * a proper access() call) it must perform several afs_access() calls - * in order to create magic mode bits that vary according to who makes - * the call. In other words, _every_ stat() generates a test for - * writeability... - */ + if ((astat->CallerAccess & ~astat->AnonymousAccess)) + /* USED TO SAY : + * Caller has at least one bit not covered by anonymous, and + * thus may have interesting rights. + * + * HOWEVER, this is a really bad idea, because any access query + * for bits which aren't covered by anonymous, on behalf of a user + * who doesn't have any special rights, will result in an answer of + * the form "I don't know, lets make a FetchStatus RPC and find out!" + * It's an especially bad idea under Ultrix, since (due to the lack of + * a proper access() call) it must perform several afs_access() calls + * in order to create magic mode bits that vary according to who makes + * the call. In other words, _every_ stat() generates a test for + * writeability... + */ #endif /* badidea */ - if (avc->Access && (ac = afs_FindAxs(avc->Access, areq->uid))) - ac->axess = astat->CallerAccess; - else /* not found, add a new one if possible */ - afs_AddAxs(avc->Access, areq->uid, astat->CallerAccess); + if (avc->Access && (ac = afs_FindAxs(avc->Access, areq->uid))) + ac->axess = astat->CallerAccess; + else /* not found, add a new one if possible */ + afs_AddAxs(avc->Access, areq->uid, astat->CallerAccess); } -} /*afs_SimpleVStat*/ +} /*afs_SimpleVStat */ /* @@ -1443,44 +1546,36 @@ afs_SimpleVStat(avc, astat, areq) * Must be called with a shared lock held on the vnode. */ -afs_WriteVCache(avc, astatus, areq) - register struct vcache *avc; - register struct AFSStoreStatus *astatus; - struct vrequest *areq; - -{ /*afs_WriteVCache*/ - afs_int32 code; - struct conn *tc; +int +afs_WriteVCache(register struct vcache *avc, + register struct AFSStoreStatus *astatus, + struct vrequest *areq) +{ + afs_int32 code; + struct conn *tc; struct AFSFetchStatus OutStatus; struct AFSVolSync tsync; - XSTATS_DECLS - - AFS_STATCNT(afs_WriteVCache); + XSTATS_DECLS AFS_STATCNT(afs_WriteVCache); afs_Trace2(afs_iclSetp, CM_TRACE_WVCACHE, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->m.Length); + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length)); do { tc = afs_Conn(&avc->fid, areq, SHARED_LOCK); if (tc) { - XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STORESTATUS); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_StoreStatus(tc->id, - (struct AFSFid *) &avc->fid.Fid, - astatus, &OutStatus, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ - XSTATS_END_TIME; - } - else code = -1; - } while - (afs_Analyze(tc, code, &avc->fid, areq, - AFS_STATS_FS_RPCIDX_STORESTATUS, - SHARED_LOCK, (struct cell *)0)); + XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STORESTATUS); + RX_AFS_GUNLOCK(); + code = + RXAFS_StoreStatus(tc->id, (struct AFSFid *)&avc->fid.Fid, + astatus, &OutStatus, &tsync); + RX_AFS_GLOCK(); + XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tc, code, &avc->fid, areq, AFS_STATS_FS_RPCIDX_STORESTATUS, + SHARED_LOCK, NULL)); - UpgradeSToWLock(&avc->lock,20); + UpgradeSToWLock(&avc->lock, 20); if (code == 0) { /* success, do the changes locally */ afs_SimpleVStat(avc, &OutStatus, areq); @@ -1490,20 +1585,19 @@ afs_WriteVCache(avc, astatus, areq) * over a file being written. */ avc->m.Date = OutStatus.ClientModTime; - } - else { + } else { /* failure, set up to check with server next time */ ObtainWriteLock(&afs_xcbhash, 462); - afs_DequeueCallback(avc); - avc->states &= ~( CStatd | CUnique); /* turn off stat valid flag */ + afs_DequeueCallback(avc); + avc->states &= ~(CStatd | CUnique); /* turn off stat valid flag */ ReleaseWriteLock(&afs_xcbhash); - if ((avc->states & CForeign) || (avc->fid.Fid.Vnode & 1)) - osi_dnlc_purgedp (avc); /* if it (could be) a directory */ + if ((avc->states & CForeign) || (avc->fid.Fid.Vnode & 1)) + osi_dnlc_purgedp(avc); /* if it (could be) a directory */ } ConvertWToSLock(&avc->lock); return code; -} /*afs_WriteVCache*/ +} /*afs_WriteVCache */ /* * afs_ProcessFS @@ -1524,16 +1618,17 @@ afs_WriteVCache(avc, astatus, areq) * it sufficiently to be certain that it is adequate. */ void -afs_ProcessFS(avc, astat, areq) - register struct vcache *avc; - struct vrequest *areq; - register struct AFSFetchStatus *astat; - -{ /*afs_ProcessFS*/ - - register int i; +afs_ProcessFS(register struct vcache *avc, + register struct AFSFetchStatus *astat, struct vrequest *areq) +{ + afs_size_t length; AFS_STATCNT(afs_ProcessFS); +#ifdef AFS_64BIT_CLIENT + FillInt64(length, astat->Length_hi, astat->Length); +#else /* AFS_64BIT_CLIENT */ + length = astat->Length; +#endif /* AFS_64BIT_CLIENT */ /* WARNING: afs_DoBulkStat uses the Length field to store a sequence * number for each bulk status request. Under no circumstances * should afs_DoBulkStat store a sequence number if the new @@ -1542,20 +1637,19 @@ afs_ProcessFS(avc, astat, areq) * also need to change the conditional in afs_DoBulkStat. */ #ifdef AFS_SGI_ENV if ((avc->execsOrWriters <= 0) && !afs_DirtyPages(avc) - && !AFS_VN_MAPPED((vnode_t*)avc)) + && !AFS_VN_MAPPED((vnode_t *) avc)) { #else - if ((avc->execsOrWriters <= 0) && !afs_DirtyPages(avc)) + if ((avc->execsOrWriters <= 0) && !afs_DirtyPages(avc)) { #endif - { - /* if we're writing or mapping this file, don't fetch over these - * values. - */ - afs_Trace3(afs_iclSetp, CM_TRACE_PROCESSFS, ICL_TYPE_POINTER, avc, - ICL_TYPE_INT32, avc->m.Length, - ICL_TYPE_INT32, astat->Length); - avc->m.Length = astat->Length; - avc->m.Date = astat->ClientModTime; - } + /* if we're writing or mapping this file, don't fetch over these + * values. + */ + afs_Trace3(afs_iclSetp, CM_TRACE_PROCESSFS, ICL_TYPE_POINTER, avc, + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length), + ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(length)); + avc->m.Length = length; + avc->m.Date = astat->ClientModTime; + } hset64(avc->m.DataVersion, astat->dataVersionHigh, astat->DataVersion); avc->m.Owner = astat->Owner; avc->m.Mode = astat->UnixModeBits; @@ -1564,12 +1658,10 @@ afs_ProcessFS(avc, astat, areq) if (astat->FileType == File) { vSetType(avc, VREG); avc->m.Mode |= S_IFREG; - } - else if (astat->FileType == Directory) { + } else if (astat->FileType == Directory) { vSetType(avc, VDIR); avc->m.Mode |= S_IFDIR; - } - else if (astat->FileType == SymbolicLink) { + } else if (astat->FileType == SymbolicLink) { if (afs_fakestat_enable && (avc->m.Mode & 0111) == 0) { vSetType(avc, VDIR); avc->m.Mode |= S_IFDIR; @@ -1583,81 +1675,71 @@ afs_ProcessFS(avc, astat, areq) } avc->anyAccess = astat->AnonymousAccess; #ifdef badidea - if ((astat->CallerAccess & ~astat->AnonymousAccess)) - /* USED TO SAY : - * Caller has at least one bit not covered by anonymous, and - * thus may have interesting rights. - * - * HOWEVER, this is a really bad idea, because any access query - * for bits which aren't covered by anonymous, on behalf of a user - * who doesn't have any special rights, will result in an answer of - * the form "I don't know, lets make a FetchStatus RPC and find out!" - * It's an especially bad idea under Ultrix, since (due to the lack of - * a proper access() call) it must perform several afs_access() calls - * in order to create magic mode bits that vary according to who makes - * the call. In other words, _every_ stat() generates a test for - * writeability... - */ + if ((astat->CallerAccess & ~astat->AnonymousAccess)) + /* USED TO SAY : + * Caller has at least one bit not covered by anonymous, and + * thus may have interesting rights. + * + * HOWEVER, this is a really bad idea, because any access query + * for bits which aren't covered by anonymous, on behalf of a user + * who doesn't have any special rights, will result in an answer of + * the form "I don't know, lets make a FetchStatus RPC and find out!" + * It's an especially bad idea under Ultrix, since (due to the lack of + * a proper access() call) it must perform several afs_access() calls + * in order to create magic mode bits that vary according to who makes + * the call. In other words, _every_ stat() generates a test for + * writeability... + */ #endif /* badidea */ - { + { struct axscache *ac; if (avc->Access && (ac = afs_FindAxs(avc->Access, areq->uid))) - ac->axess = astat->CallerAccess; - else /* not found, add a new one if possible */ - afs_AddAxs(avc->Access, areq->uid, astat->CallerAccess); - } - + ac->axess = astat->CallerAccess; + else /* not found, add a new one if possible */ + afs_AddAxs(avc->Access, areq->uid, astat->CallerAccess); + } #ifdef AFS_LINUX22_ENV - vcache2inode(avc); /* Set the inode attr cache */ + vcache2inode(avc); /* Set the inode attr cache */ #endif #ifdef AFS_DARWIN_ENV - osi_VM_Setup(avc,1); + osi_VM_Setup(avc, 1); #endif -} /*afs_ProcessFS*/ +} /*afs_ProcessFS */ -afs_RemoteLookup(afid, areq, name, nfid, OutStatusp, CallBackp, serverp, tsyncp) - register struct VenusFid *afid; - struct vrequest *areq; - char *name; - struct VenusFid *nfid; - struct AFSFetchStatus *OutStatusp; - struct AFSCallBack *CallBackp; - struct server **serverp; - struct AFSVolSync *tsyncp; +int +afs_RemoteLookup(register struct VenusFid *afid, struct vrequest *areq, + char *name, struct VenusFid *nfid, + struct AFSFetchStatus *OutStatusp, + struct AFSCallBack *CallBackp, struct server **serverp, + struct AFSVolSync *tsyncp) { - afs_int32 code, i; - register struct vcache *tvc; - struct volume *tvp; + afs_int32 code; afs_uint32 start; register struct conn *tc; struct AFSFetchStatus OutDirStatus; - XSTATS_DECLS - - if (!name) name = ""; /* XXX */ + XSTATS_DECLS if (!name) + name = ""; /* XXX */ do { tc = afs_Conn(afid, areq, SHARED_LOCK); if (tc) { - if (serverp) *serverp = tc->srvr->server; + if (serverp) + *serverp = tc->srvr->server; start = osi_Time(); XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_XLOOKUP); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_Lookup(tc->id, (struct AFSFid *) &afid->Fid, name, - (struct AFSFid *) &nfid->Fid, - OutStatusp, &OutDirStatus, CallBackp, tsyncp); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); + code = + RXAFS_Lookup(tc->id, (struct AFSFid *)&afid->Fid, name, + (struct AFSFid *)&nfid->Fid, OutStatusp, + &OutDirStatus, CallBackp, tsyncp); + RX_AFS_GLOCK(); XSTATS_END_TIME; - } else + } else code = -1; - } while - (afs_Analyze(tc, code, afid, areq, - AFS_STATS_FS_RPCIDX_XLOOKUP, - SHARED_LOCK, (struct cell *)0)); + } while (afs_Analyze + (tc, code, afid, areq, AFS_STATS_FS_RPCIDX_XLOOKUP, SHARED_LOCK, + NULL)); return code; } @@ -1674,7 +1756,7 @@ afs_RemoteLookup(afid, areq, name, nfid, OutStatusp, CallBackp, serverp, tsyncp) * afid : File ID. * areq : Ptr to associated vrequest structure, specifying the * user whose authentication tokens will be used. - * avc : caller may already have a vcache for this file, which is + * avc : caller may already have a vcache for this file, which is * already held. * * Environment: @@ -1688,56 +1770,58 @@ afs_RemoteLookup(afid, areq, name, nfid, OutStatusp, CallBackp, serverp, tsyncp) * * 1. Lock all files first, then directories. * 2. Within a particular type, lock entries in Fid.Vnode order. - * + * * This locking hierarchy is convenient because it allows locking * of a parent dir cache entry, given a file (to check its access * control list). It also allows renames to be handled easily by * locking directories in a constant order. * NB. NewVCache -> FlushVCache presently (4/10/95) drops the xvcache lock. */ -struct vcache *afs_GetVCache(afid, areq, cached, avc, locktype) - register struct VenusFid *afid; - struct vrequest *areq; - afs_int32 *cached; - afs_int32 locktype; - struct vcache *avc; /* might have a vcache structure already, which must - * already be held by the caller */ -{ /*afs_GetVCache*/ - - afs_int32 code, i, newvcache=0; + /* might have a vcache structure already, which must + * already be held by the caller */ + +struct vcache * +afs_GetVCache(register struct VenusFid *afid, struct vrequest *areq, + afs_int32 * cached, struct vcache *avc) +{ + + afs_int32 code, newvcache = 0; register struct vcache *tvc; struct volume *tvp; afs_int32 retry; AFS_STATCNT(afs_GetVCache); - if (cached) *cached = 0; /* Init just in case */ + if (cached) + *cached = 0; /* Init just in case */ + +#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV) + loop: +#endif -loop: - ObtainSharedLock(&afs_xvcache,5); + ObtainSharedLock(&afs_xvcache, 5); - tvc = afs_FindVCache(afid, 0, 0, &retry, DO_STATS | DO_VLRU ); + tvc = afs_FindVCache(afid, &retry, DO_STATS | DO_VLRU); if (tvc && retry) { #if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV) ReleaseSharedLock(&afs_xvcache); spunlock_psema(tvc->v.v_lock, retry, &tvc->v.v_sync, PINOD); goto loop; #endif - } - - if (tvc) { - if (cached) - *cached = 1; - if (tvc->states & CStatd) { - ReleaseSharedLock(&afs_xvcache); - return tvc; - } } - else { - UpgradeSToWLock(&afs_xvcache,21); + + if (tvc) { + if (cached) + *cached = 1; + if (tvc->states & CStatd) { + ReleaseSharedLock(&afs_xvcache); + return tvc; + } + } else { + UpgradeSToWLock(&afs_xvcache, 21); /* no cache entry, better grab one */ - tvc = afs_NewVCache(afid, (struct server *)0, 1, WRITE_LOCK); + tvc = afs_NewVCache(afid, NULL); newvcache = 1; ConvertWToSLock(&afs_xvcache); @@ -1746,7 +1830,7 @@ loop: ReleaseSharedLock(&afs_xvcache); - ObtainWriteLock(&tvc->lock,54); + ObtainWriteLock(&tvc->lock, 54); if (tvc->states & CStatd) { #ifdef AFS_LINUX22_ENV @@ -1754,39 +1838,80 @@ loop: #endif ReleaseWriteLock(&tvc->lock); #ifdef AFS_DARWIN_ENV - osi_VM_Setup(tvc,0); + osi_VM_Setup(tvc, 0); #endif return tvc; } - #if defined(AFS_OSF_ENV) - if (afs_IsWired(tvc)) { - ReleaseWriteLock(&tvc->lock); - return tvc; - } + if (afs_IsWired(tvc)) { + ReleaseWriteLock(&tvc->lock); + return tvc; + } #endif /* AFS_OSF_ENV */ +#ifdef AFS_OBSD_ENV + VOP_LOCK(AFSTOV(tvc), LK_EXCLUSIVE | LK_RETRY, curproc); + uvm_vnp_uncache(AFSTOV(tvc)); + VOP_UNLOCK(AFSTOV(tvc), 0, curproc); +#endif +#ifdef AFS_FBSD_ENV + /* + * XXX - I really don't like this. Should try to understand better. + * It seems that sometimes, when we get called, we already hold the + * lock on the vnode (e.g., from afs_getattr via afs_VerifyVCache). + * We can't drop the vnode lock, because that could result in a race. + * Sometimes, though, we get here and don't hold the vnode lock. + * I hate code paths that sometimes hold locks and sometimes don't. + * In any event, the dodge we use here is to check whether the vnode + * is locked, and if it isn't, then we gain and drop it around the call + * to vinvalbuf; otherwise, we leave it alone. + */ + { + struct vnode *vp; + int iheldthelock; + + vp = AFSTOV(tvc); +#ifdef AFS_FBSD50_ENV + iheldthelock = VOP_ISLOCKED(vp, curthread); + if (!iheldthelock) + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); + vinvalbuf(vp, V_SAVE, osi_curcred(), curthread, PINOD, 0); + if (!iheldthelock) + VOP_UNLOCK(vp, LK_EXCLUSIVE, curthread); +#else + iheldthelock = VOP_ISLOCKED(vp, curproc); + if (!iheldthelock) + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curproc); + vinvalbuf(vp, V_SAVE, osi_curcred(), curproc, PINOD, 0); + if (!iheldthelock) + VOP_UNLOCK(vp, LK_EXCLUSIVE, curproc); +#endif + } +#endif ObtainWriteLock(&afs_xcbhash, 464); - tvc->states &= ~CUnique; + tvc->states &= ~CUnique; tvc->callback = 0; afs_DequeueCallback(tvc); ReleaseWriteLock(&afs_xcbhash); /* It is always appropriate to throw away all the access rights? */ afs_FreeAllAxs(&(tvc->Access)); - tvp = afs_GetVolume(afid, areq, READ_LOCK); /* copy useful per-volume info */ + tvp = afs_GetVolume(afid, areq, READ_LOCK); /* copy useful per-volume info */ if (tvp) { if ((tvp->states & VForeign)) { - if (newvcache) tvc->states |= CForeign; - if (newvcache && (tvp->rootVnode == afid->Fid.Vnode) + if (newvcache) + tvc->states |= CForeign; + if (newvcache && (tvp->rootVnode == afid->Fid.Vnode) && (tvp->rootUnique == afid->Fid.Unique)) { tvc->mvstat = 2; - } + } } - if (tvp->states & VRO) tvc->states |= CRO; - if (tvp->states & VBackup) tvc->states |= CBackup; + if (tvp->states & VRO) + tvc->states |= CRO; + if (tvp->states & VBackup) + tvc->states |= CBackup; /* now copy ".." entry back out of volume structure, if necessary */ - if (tvc->mvstat == 2 && tvp->dotdot.Fid.Volume != 0) { + if (tvc->mvstat == 2 && tvp->dotdot.Fid.Volume != 0) { if (!tvc->mvid) tvc->mvid = (struct VenusFid *) osi_AllocSmallSpace(sizeof(struct VenusFid)); @@ -1815,21 +1940,21 @@ loop: ObtainReadLock(&afs_xvcache); AFS_FAST_RELE(tvc); ReleaseReadLock(&afs_xvcache); - return (struct vcache *) 0; + return NULL; } ReleaseWriteLock(&tvc->lock); return tvc; -} /*afs_GetVCache*/ +} /*afs_GetVCache */ -struct vcache *afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq, - afs_int32 *cached, afs_int32 locktype, - struct vcache *adp, char *aname) +struct vcache * +afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq, + afs_int32 * cached, struct vcache *adp, char *aname) { - afs_int32 code, now, newvcache=0, hash; + afs_int32 code, now, newvcache = 0; struct VenusFid nfid; register struct vcache *tvc; struct volume *tvp; @@ -1841,81 +1966,92 @@ struct vcache *afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq, afs_int32 retry; AFS_STATCNT(afs_GetVCache); - if (cached) *cached = 0; /* Init just in case */ + if (cached) + *cached = 0; /* Init just in case */ +#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV) loop1: +#endif + ObtainReadLock(&afs_xvcache); - tvc = afs_FindVCache(afid, 0, 0, &retry, DO_STATS /* no vlru */); + tvc = afs_FindVCache(afid, &retry, DO_STATS /* no vlru */ ); if (tvc) { - ReleaseReadLock(&afs_xvcache); - if (retry) { + ReleaseReadLock(&afs_xvcache); + if (retry) { #if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV) - spunlock_psema(tvc->v.v_lock, retry, &tvc->v.v_sync, PINOD); - goto loop1; + spunlock_psema(tvc->v.v_lock, retry, &tvc->v.v_sync, PINOD); + goto loop1; #endif - } - ObtainReadLock(&tvc->lock); + } + ObtainReadLock(&tvc->lock); - if (tvc->states & CStatd) { - if (cached) { - *cached = 1; + if (tvc->states & CStatd) { + if (cached) { + *cached = 1; + } + ReleaseReadLock(&tvc->lock); + return tvc; } - ReleaseReadLock(&tvc->lock); - return tvc; - } - tvc->states &= ~CUnique; + tvc->states &= ~CUnique; ReleaseReadLock(&tvc->lock); ObtainReadLock(&afs_xvcache); AFS_FAST_RELE(tvc); - } /* if (tvc) */ - + } + /* if (tvc) */ ReleaseReadLock(&afs_xvcache); /* lookup the file */ nfid = *afid; now = osi_Time(); origCBs = afs_allCBs; /* if anything changes, we don't have a cb */ - code = afs_RemoteLookup(&adp->fid, areq, aname, &nfid, &OutStatus, &CallBack, - &serverp, &tsync); + code = + afs_RemoteLookup(&adp->fid, areq, aname, &nfid, &OutStatus, &CallBack, + &serverp, &tsync); +#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV) loop2: - ObtainSharedLock(&afs_xvcache,6); - tvc = afs_FindVCache(&nfid, 0, 0, &retry, DO_VLRU /* no xstats now*/); +#endif + + ObtainSharedLock(&afs_xvcache, 6); + tvc = afs_FindVCache(&nfid, &retry, DO_VLRU /* no xstats now */ ); if (tvc && retry) { #if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV) - ReleaseSharedLock(&afs_xvcache); - spunlock_psema(tvc->v.v_lock, retry, &tvc->v.v_sync, PINOD); - goto loop2; + ReleaseSharedLock(&afs_xvcache); + spunlock_psema(tvc->v.v_lock, retry, &tvc->v.v_sync, PINOD); + goto loop2; #endif } if (!tvc) { - /* no cache entry, better grab one */ - UpgradeSToWLock(&afs_xvcache,22); - tvc = afs_NewVCache(&nfid, (struct server *)0, 1, WRITE_LOCK); + /* no cache entry, better grab one */ + UpgradeSToWLock(&afs_xvcache, 22); + tvc = afs_NewVCache(&nfid, serverp); newvcache = 1; - ConvertWToSLock(&afs_xvcache); + ConvertWToSLock(&afs_xvcache); } ReleaseSharedLock(&afs_xvcache); - ObtainWriteLock(&tvc->lock,55); - + ObtainWriteLock(&tvc->lock, 55); + /* It is always appropriate to throw away all the access rights? */ afs_FreeAllAxs(&(tvc->Access)); - tvp = afs_GetVolume(afid, areq, READ_LOCK); /* copy useful per-vol info */ + tvp = afs_GetVolume(afid, areq, READ_LOCK); /* copy useful per-vol info */ if (tvp) { if ((tvp->states & VForeign)) { - if (newvcache) tvc->states |= CForeign; + if (newvcache) + tvc->states |= CForeign; if (newvcache && (tvp->rootVnode == afid->Fid.Vnode) && (tvp->rootUnique == afid->Fid.Unique)) tvc->mvstat = 2; } - if (tvp->states & VRO) tvc->states |= CRO; - if (tvp->states & VBackup) tvc->states |= CBackup; + if (tvp->states & VRO) + tvc->states |= CRO; + if (tvp->states & VBackup) + tvc->states |= CBackup; /* now copy ".." entry back out of volume structure, if necessary */ - if (tvc->mvstat == 2 && tvp->dotdot.Fid.Volume != 0) { + if (tvc->mvstat == 2 && tvp->dotdot.Fid.Volume != 0) { if (!tvc->mvid) tvc->mvid = (struct VenusFid *) osi_AllocSmallSpace(sizeof(struct VenusFid)); @@ -1926,50 +2062,50 @@ struct vcache *afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq, if (code) { ObtainWriteLock(&afs_xcbhash, 465); afs_DequeueCallback(tvc); - tvc->states &= ~( CStatd | CUnique ); + tvc->states &= ~(CStatd | CUnique); ReleaseWriteLock(&afs_xcbhash); - if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) - osi_dnlc_purgedp (tvc); /* if it (could be) a directory */ - if ( tvp ) - afs_PutVolume(tvp, READ_LOCK); + if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) + osi_dnlc_purgedp(tvc); /* if it (could be) a directory */ + if (tvp) + afs_PutVolume(tvp, READ_LOCK); ReleaseWriteLock(&tvc->lock); ObtainReadLock(&afs_xvcache); AFS_FAST_RELE(tvc); ReleaseReadLock(&afs_xvcache); - return (struct vcache *) 0; + return NULL; } ObtainWriteLock(&afs_xcbhash, 466); if (origCBs == afs_allCBs) { if (CallBack.ExpirationTime) { tvc->callback = serverp; - tvc->cbExpires = CallBack.ExpirationTime+now; + tvc->cbExpires = CallBack.ExpirationTime + now; tvc->states |= CStatd | CUnique; tvc->states &= ~CBulkFetching; afs_QueueCallback(tvc, CBHash(CallBack.ExpirationTime), tvp); } else if (tvc->states & CRO) { /* adapt gives us an hour. */ - tvc->cbExpires = 3600+osi_Time(); /*XXX*/ - tvc->states |= CStatd | CUnique; + tvc->cbExpires = 3600 + osi_Time(); + /*XXX*/ tvc->states |= CStatd | CUnique; tvc->states &= ~CBulkFetching; - afs_QueueCallback(tvc, CBHash(3600), tvp); + afs_QueueCallback(tvc, CBHash(3600), tvp); } else { - tvc->callback = (struct server *)0; + tvc->callback = NULL; afs_DequeueCallback(tvc); - tvc->states &= ~(CStatd | CUnique); - if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) - osi_dnlc_purgedp (tvc); /* if it (could be) a directory */ + tvc->states &= ~(CStatd | CUnique); + if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) + osi_dnlc_purgedp(tvc); /* if it (could be) a directory */ } } else { afs_DequeueCallback(tvc); - tvc->states &= ~CStatd; - tvc->states &= ~CUnique; - tvc->callback = (struct server *)0; - if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) - osi_dnlc_purgedp (tvc); /* if it (could be) a directory */ - } + tvc->states &= ~CStatd; + tvc->states &= ~CUnique; + tvc->callback = NULL; + if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) + osi_dnlc_purgedp(tvc); /* if it (could be) a directory */ + } ReleaseWriteLock(&afs_xcbhash); - if ( tvp ) + if (tvp) afs_PutVolume(tvp, READ_LOCK); afs_ProcessFS(tvc, &OutStatus, areq); @@ -1978,11 +2114,11 @@ struct vcache *afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq, } -struct vcache *afs_GetRootVCache(struct VenusFid *afid, - struct vrequest *areq, afs_int32 *cached, - struct volume *tvolp, afs_int32 locktype) +struct vcache * +afs_GetRootVCache(struct VenusFid *afid, struct vrequest *areq, + afs_int32 * cached, struct volume *tvolp) { - afs_int32 code, i, newvcache = 0, haveStatus = 0; + afs_int32 code = 0, i, newvcache = 0, haveStatus = 0; afs_int32 getNewFid = 0; afs_uint32 start; struct VenusFid nfid; @@ -1991,50 +2127,51 @@ struct vcache *afs_GetRootVCache(struct VenusFid *afid, struct AFSFetchStatus OutStatus; struct AFSCallBack CallBack; struct AFSVolSync tsync; - int origCBs; + int origCBs = 0; start = osi_Time(); - newmtpt: + newmtpt: if (!tvolp->rootVnode || getNewFid) { struct VenusFid tfid; tfid = *afid; tfid.Fid.Vnode = 0; /* Means get rootfid of volume */ - origCBs = afs_allCBs; /* ignore InitCallBackState */ - code = afs_RemoteLookup(&tfid, areq, (char *)0, &nfid, - &OutStatus, &CallBack, &serverp, &tsync); + origCBs = afs_allCBs; /* ignore InitCallBackState */ + code = + afs_RemoteLookup(&tfid, areq, NULL, &nfid, &OutStatus, &CallBack, + &serverp, &tsync); if (code) { - return (struct vcache *)0; + return NULL; } /* ReleaseReadLock(&tvolp->lock); */ - ObtainWriteLock(&tvolp->lock,56); + ObtainWriteLock(&tvolp->lock, 56); tvolp->rootVnode = afid->Fid.Vnode = nfid.Fid.Vnode; tvolp->rootUnique = afid->Fid.Unique = nfid.Fid.Unique; - ReleaseWriteLock(&tvolp->lock); + ReleaseWriteLock(&tvolp->lock); /* ObtainReadLock(&tvolp->lock);*/ haveStatus = 1; } else { afid->Fid.Vnode = tvolp->rootVnode; afid->Fid.Unique = tvolp->rootUnique; - } - - ObtainSharedLock(&afs_xvcache,7); + } + + ObtainSharedLock(&afs_xvcache, 7); i = VCHash(afid); for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { - if (!FidCmp(&(tvc->fid), afid)) { + if (!FidCmp(&(tvc->fid), afid)) { #ifdef AFS_OSF_ENV /* Grab this vnode, possibly reactivating from the free list */ - /* for the present (95.05.25) everything on the hash table is + /* for the present (95.05.25) everything on the hash table is * definitively NOT in the free list -- at least until afs_reclaim * can be safely implemented */ int vg; AFS_GUNLOCK(); - vg = vget(AFSTOV(tvc)); /* this bumps ref count */ + vg = vget(AFSTOV(tvc)); /* this bumps ref count */ AFS_GLOCK(); if (vg) - continue; -#endif /* AFS_OSF_ENV */ + continue; +#endif /* AFS_OSF_ENV */ break; } } @@ -2043,49 +2180,49 @@ struct vcache *afs_GetRootVCache(struct VenusFid *afid, /* Mount point no longer stat'd or unknown. FID may have changed. */ #ifdef AFS_OSF_ENV if (tvc) - AFS_RELE(tvc); + AFS_RELE(AFSTOV(tvc)); #endif - tvc = (struct vcache*)0; + tvc = NULL; getNewFid = 1; ReleaseSharedLock(&afs_xvcache); goto newmtpt; } if (!tvc) { - UpgradeSToWLock(&afs_xvcache,23); + UpgradeSToWLock(&afs_xvcache, 23); /* no cache entry, better grab one */ - tvc = afs_NewVCache(afid, (struct server *)0, 1, WRITE_LOCK); + tvc = afs_NewVCache(afid, NULL); newvcache = 1; afs_stats_cmperf.vcacheMisses++; - } - else { - if (cached) *cached = 1; + } else { + if (cached) + *cached = 1; afs_stats_cmperf.vcacheHits++; #ifdef AFS_OSF_ENV /* we already bumped the ref count in the for loop above */ -#else /* AFS_OSF_ENV */ - osi_vnhold(tvc,0); +#else /* AFS_OSF_ENV */ + osi_vnhold(tvc, 0); #endif - UpgradeSToWLock(&afs_xvcache,24); + UpgradeSToWLock(&afs_xvcache, 24); if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { - refpanic ("GRVC VLRU inconsistent0"); + refpanic("GRVC VLRU inconsistent0"); } if (tvc->vlruq.next->prev != &(tvc->vlruq)) { - refpanic ("GRVC VLRU inconsistent1"); + refpanic("GRVC VLRU inconsistent1"); } if (tvc->vlruq.prev->next != &(tvc->vlruq)) { - refpanic ("GRVC VLRU inconsistent2"); + refpanic("GRVC VLRU inconsistent2"); } - QRemove(&tvc->vlruq); /* move to lruq head */ + QRemove(&tvc->vlruq); /* move to lruq head */ QAdd(&VLRU, &tvc->vlruq); if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { - refpanic ("GRVC VLRU inconsistent3"); + refpanic("GRVC VLRU inconsistent3"); } if (tvc->vlruq.next->prev != &(tvc->vlruq)) { - refpanic ("GRVC VLRU inconsistent4"); + refpanic("GRVC VLRU inconsistent4"); } if (tvc->vlruq.prev->next != &(tvc->vlruq)) { - refpanic ("GRVC VLRU inconsistent5"); + refpanic("GRVC VLRU inconsistent5"); } vcachegen++; } @@ -2094,30 +2231,34 @@ struct vcache *afs_GetRootVCache(struct VenusFid *afid, if (tvc->states & CStatd) { return tvc; - } else { + } else { - ObtainReadLock(&tvc->lock); - tvc->states &= ~CUnique; - tvc->callback = (struct server *)0; /* redundant, perhaps */ - ReleaseReadLock(&tvc->lock); + ObtainReadLock(&tvc->lock); + tvc->states &= ~CUnique; + tvc->callback = NULL; /* redundant, perhaps */ + ReleaseReadLock(&tvc->lock); } - ObtainWriteLock(&tvc->lock,57); + ObtainWriteLock(&tvc->lock, 57); /* It is always appropriate to throw away all the access rights? */ afs_FreeAllAxs(&(tvc->Access)); - if (newvcache) tvc->states |= CForeign; - if (tvolp->states & VRO) tvc->states |= CRO; - if (tvolp->states & VBackup) tvc->states |= CBackup; + if (newvcache) + tvc->states |= CForeign; + if (tvolp->states & VRO) + tvc->states |= CRO; + if (tvolp->states & VBackup) + tvc->states |= CBackup; /* now copy ".." entry back out of volume structure, if necessary */ - if (newvcache && (tvolp->rootVnode == afid->Fid.Vnode) + if (newvcache && (tvolp->rootVnode == afid->Fid.Vnode) && (tvolp->rootUnique == afid->Fid.Unique)) { tvc->mvstat = 2; } - if (tvc->mvstat == 2 && tvolp->dotdot.Fid.Volume != 0) { + if (tvc->mvstat == 2 && tvolp->dotdot.Fid.Volume != 0) { if (!tvc->mvid) - tvc->mvid = (struct VenusFid *)osi_AllocSmallSpace(sizeof(struct VenusFid)); + tvc->mvid = (struct VenusFid *) + osi_AllocSmallSpace(sizeof(struct VenusFid)); *tvc->mvid = tvolp->dotdot; } @@ -2129,52 +2270,53 @@ struct vcache *afs_GetRootVCache(struct VenusFid *afid, tfid = *afid; tfid.Fid.Vnode = 0; /* Means get rootfid of volume */ - origCBs = afs_allCBs; /* ignore InitCallBackState */ - code = afs_RemoteLookup(&tfid, areq, (char *)0, &nfid, &OutStatus, - &CallBack, &serverp, &tsync); + origCBs = afs_allCBs; /* ignore InitCallBackState */ + code = + afs_RemoteLookup(&tfid, areq, NULL, &nfid, &OutStatus, &CallBack, + &serverp, &tsync); } if (code) { ObtainWriteLock(&afs_xcbhash, 467); afs_DequeueCallback(tvc); - tvc->callback = (struct server *)0; - tvc->states &= ~(CStatd|CUnique); + tvc->callback = NULL; + tvc->states &= ~(CStatd | CUnique); ReleaseWriteLock(&afs_xcbhash); - if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) - osi_dnlc_purgedp (tvc); /* if it (could be) a directory */ + if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) + osi_dnlc_purgedp(tvc); /* if it (could be) a directory */ ReleaseWriteLock(&tvc->lock); ObtainReadLock(&afs_xvcache); AFS_FAST_RELE(tvc); ReleaseReadLock(&afs_xvcache); - return (struct vcache *) 0; + return NULL; } - + ObtainWriteLock(&afs_xcbhash, 468); if (origCBs == afs_allCBs) { tvc->states |= CTruth; tvc->callback = serverp; - if (CallBack.ExpirationTime != 0) { - tvc->cbExpires = CallBack.ExpirationTime+start; + if (CallBack.ExpirationTime != 0) { + tvc->cbExpires = CallBack.ExpirationTime + start; tvc->states |= CStatd; tvc->states &= ~CBulkFetching; afs_QueueCallback(tvc, CBHash(CallBack.ExpirationTime), tvolp); } else if (tvc->states & CRO) { /* adapt gives us an hour. */ - tvc->cbExpires = 3600+osi_Time(); /*XXX*/ - tvc->states |= CStatd; + tvc->cbExpires = 3600 + osi_Time(); + /*XXX*/ tvc->states |= CStatd; tvc->states &= ~CBulkFetching; afs_QueueCallback(tvc, CBHash(3600), tvolp); } } else { afs_DequeueCallback(tvc); - tvc->callback = (struct server *)0; + tvc->callback = NULL; tvc->states &= ~(CStatd | CUnique); - if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) - osi_dnlc_purgedp (tvc); /* if it (could be) a directory */ + if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) + osi_dnlc_purgedp(tvc); /* if it (could be) a directory */ } ReleaseWriteLock(&afs_xcbhash); afs_ProcessFS(tvc, &OutStatus, areq); - + ReleaseWriteLock(&tvc->lock); return tvc; } @@ -2182,100 +2324,92 @@ struct vcache *afs_GetRootVCache(struct VenusFid *afid, /* - * must be called with avc write-locked - * don't absolutely have to invalidate the hint unless the dv has + * must be called with avc write-locked + * don't absolutely have to invalidate the hint unless the dv has * changed, but be sure to get it right else there will be consistency bugs. */ -afs_int32 afs_FetchStatus(struct vcache *avc, struct VenusFid *afid, - struct vrequest *areq, struct AFSFetchStatus *Outsp) +afs_int32 +afs_FetchStatus(struct vcache * avc, struct VenusFid * afid, + struct vrequest * areq, struct AFSFetchStatus * Outsp) { - int code; - afs_uint32 start; - register struct conn *tc; - struct AFSCallBack CallBack; - struct AFSVolSync tsync; - struct volume* volp; - XSTATS_DECLS - + int code; + afs_uint32 start = 0; + register struct conn *tc; + struct AFSCallBack CallBack; + struct AFSVolSync tsync; + struct volume *volp; + XSTATS_DECLS do { tc = afs_Conn(afid, areq, SHARED_LOCK); - avc->quick.stamp = 0; avc->h1.dchint = NULL; /* invalidate hints */ + avc->quick.stamp = 0; + avc->h1.dchint = NULL; /* invalidate hints */ if (tc) { avc->callback = tc->srvr->server; start = osi_Time(); XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHSTATUS); -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = RXAFS_FetchStatus(tc->id, - (struct AFSFid *) &afid->Fid, - Outsp, &CallBack, &tsync); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); + code = + RXAFS_FetchStatus(tc->id, (struct AFSFid *)&afid->Fid, Outsp, + &CallBack, &tsync); + RX_AFS_GLOCK(); XSTATS_END_TIME; + } else + code = -1; + } while (afs_Analyze + (tc, code, afid, areq, AFS_STATS_FS_RPCIDX_FETCHSTATUS, + SHARED_LOCK, NULL)); + + if (!code) { + afs_ProcessFS(avc, Outsp, areq); + volp = afs_GetVolume(afid, areq, READ_LOCK); + ObtainWriteLock(&afs_xcbhash, 469); + avc->states |= CTruth; + if (avc->callback /* check for race */ ) { + if (CallBack.ExpirationTime != 0) { + avc->cbExpires = CallBack.ExpirationTime + start; + avc->states |= CStatd; + avc->states &= ~CBulkFetching; + afs_QueueCallback(avc, CBHash(CallBack.ExpirationTime), volp); + } else if (avc->states & CRO) { /* ordinary callback on a read-only volume -- AFS 3.2 style */ + avc->cbExpires = 3600 + start; + avc->states |= CStatd; + avc->states &= ~CBulkFetching; + afs_QueueCallback(avc, CBHash(3600), volp); + } else { + afs_DequeueCallback(avc); + avc->callback = NULL; + avc->states &= ~(CStatd | CUnique); + if ((avc->states & CForeign) || (avc->fid.Fid.Vnode & 1)) + osi_dnlc_purgedp(avc); /* if it (could be) a directory */ + } + } else { + afs_DequeueCallback(avc); + avc->callback = NULL; + avc->states &= ~(CStatd | CUnique); + if ((avc->states & CForeign) || (avc->fid.Fid.Vnode & 1)) + osi_dnlc_purgedp(avc); /* if it (could be) a directory */ } - else code = -1; - } while - (afs_Analyze(tc, code, afid, areq, - AFS_STATS_FS_RPCIDX_FETCHSTATUS, - SHARED_LOCK, (struct cell *)0)); - -if (!code) { - afs_ProcessFS(avc, Outsp, areq); - volp = afs_GetVolume(afid, areq, READ_LOCK); - ObtainWriteLock(&afs_xcbhash, 469); - avc->states |= CTruth; - if (avc->callback /* check for race */) { - if (CallBack.ExpirationTime != 0) { - avc->cbExpires = CallBack.ExpirationTime+start; - avc->states |= CStatd; - avc->states &= ~CBulkFetching; - afs_QueueCallback(avc, CBHash(CallBack.ExpirationTime), volp); - } - else if (avc->states & CRO) - { /* ordinary callback on a read-only volume -- AFS 3.2 style */ - avc->cbExpires = 3600+start; - avc->states |= CStatd; - avc->states &= ~CBulkFetching; - afs_QueueCallback(avc, CBHash(3600), volp); - } - else { - afs_DequeueCallback(avc); - avc->callback = (struct server *)0; - avc->states &= ~(CStatd|CUnique); - if ((avc->states & CForeign) || (avc->fid.Fid.Vnode & 1)) - osi_dnlc_purgedp (avc); /* if it (could be) a directory */ - } - } - else { - afs_DequeueCallback(avc); - avc->callback = (struct server *)0; - avc->states &= ~(CStatd|CUnique); - if ((avc->states & CForeign) || (avc->fid.Fid.Vnode & 1)) - osi_dnlc_purgedp (avc); /* if it (could be) a directory */ - } - ReleaseWriteLock(&afs_xcbhash); - if ( volp ) - afs_PutVolume(volp, READ_LOCK); -} -else { /* used to undo the local callback, but that's too extreme. - * There are plenty of good reasons that fetchstatus might return - * an error, such as EPERM. If we have the vnode cached, statd, - * with callback, might as well keep track of the fact that we - * don't have access... - */ - if (code == EPERM || code == EACCES) { - struct axscache *ac; - if (avc->Access && (ac = afs_FindAxs(avc->Access, areq->uid))) - ac->axess = 0; - else /* not found, add a new one if possible */ - afs_AddAxs(avc->Access, areq->uid, 0); - } -} -return code; + ReleaseWriteLock(&afs_xcbhash); + if (volp) + afs_PutVolume(volp, READ_LOCK); + } else { + /* used to undo the local callback, but that's too extreme. + * There are plenty of good reasons that fetchstatus might return + * an error, such as EPERM. If we have the vnode cached, statd, + * with callback, might as well keep track of the fact that we + * don't have access... + */ + if (code == EPERM || code == EACCES) { + struct axscache *ac; + if (avc->Access && (ac = afs_FindAxs(avc->Access, areq->uid))) + ac->axess = 0; + else /* not found, add a new one if possible */ + afs_AddAxs(avc->Access, areq->uid, 0); + } + } + return code; } #if 0 @@ -2296,16 +2430,12 @@ return code; * Nothing interesting. */ void -afs_StuffVcache(afid, OutStatus, CallBack, tc, areq) - register struct VenusFid *afid; - struct AFSFetchStatus *OutStatus; - struct AFSCallBack *CallBack; - register struct conn *tc; - struct vrequest *areq; - -{ /*afs_StuffVcache*/ - - register afs_int32 code, i, newvcache=0; +afs_StuffVcache(register struct VenusFid *afid, + struct AFSFetchStatus *OutStatus, + struct AFSCallBack *CallBack, register struct conn *tc, + struct vrequest *areq) +{ + register afs_int32 code, i, newvcache = 0; register struct vcache *tvc; struct AFSVolSync tsync; struct volume *tvp; @@ -2318,48 +2448,52 @@ afs_StuffVcache(afid, OutStatus, CallBack, tc, areq) #endif loop: - ObtainSharedLock(&afs_xvcache,8); + ObtainSharedLock(&afs_xvcache, 8); - tvc = afs_FindVCache(afid, 0, 0, &retry, DO_VLRU /* no stats */); + tvc = afs_FindVCache(afid, &retry, DO_VLRU /* no stats */ ); if (tvc && retry) { #if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV) ReleaseSharedLock(&afs_xvcache); spunlock_psema(tvc->v.v_lock, retry, &tvc->v.v_sync, PINOD); goto loop; #endif - } + } if (!tvc) { /* no cache entry, better grab one */ - UpgradeSToWLock(&afs_xvcache,25); - tvc = afs_NewVCache(afid, (struct server *)0, 1, WRITE_LOCK); + UpgradeSToWLock(&afs_xvcache, 25); + tvc = afs_NewVCache(afid, NULL); newvcache = 1; ConvertWToSLock(&afs_xvcache); } ReleaseSharedLock(&afs_xvcache); - ObtainWriteLock(&tvc->lock,58); + ObtainWriteLock(&tvc->lock, 58); tvc->states &= ~CStatd; - if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) - osi_dnlc_purgedp (tvc); /* if it (could be) a directory */ + if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) + osi_dnlc_purgedp(tvc); /* if it (could be) a directory */ /* Is it always appropriate to throw away all the access rights? */ afs_FreeAllAxs(&(tvc->Access)); - /*Copy useful per-volume info*/ - tvp = afs_GetVolume(afid, areq, READ_LOCK); + /*Copy useful per-volume info */ + tvp = afs_GetVolume(afid, areq, READ_LOCK); if (tvp) { - if (newvcache && (tvp->states & VForeign)) tvc->states |= CForeign; - if (tvp->states & VRO) tvc->states |= CRO; - if (tvp->states & VBackup) tvc->states |= CBackup; + if (newvcache && (tvp->states & VForeign)) + tvc->states |= CForeign; + if (tvp->states & VRO) + tvc->states |= CRO; + if (tvp->states & VBackup) + tvc->states |= CBackup; /* * Now, copy ".." entry back out of volume structure, if * necessary */ - if (tvc->mvstat == 2 && tvp->dotdot.Fid.Volume != 0) { - if (!tvc->mvid) tvc->mvid = - (struct VenusFid *) osi_AllocSmallSpace(sizeof(struct VenusFid)); + if (tvc->mvstat == 2 && tvp->dotdot.Fid.Volume != 0) { + if (!tvc->mvid) + tvc->mvid = (struct VenusFid *) + osi_AllocSmallSpace(sizeof(struct VenusFid)); *tvc->mvid = tvp->dotdot; } } @@ -2368,55 +2502,53 @@ afs_StuffVcache(afid, OutStatus, CallBack, tc, areq) afs_ProcessFS(tvc, OutStatus, areq); tvc->callback = tc->srvr->server; - /* we use osi_Time twice below. Ideally, we would use the time at which + /* we use osi_Time twice below. Ideally, we would use the time at which * the FetchStatus call began, instead, but we don't have it here. So we - * make do with "now". In the CRO case, it doesn't really matter. In - * the other case, we hope that the difference between "now" and when the + * make do with "now". In the CRO case, it doesn't really matter. In + * the other case, we hope that the difference between "now" and when the * call actually began execution on the server won't be larger than the - * padding which the server keeps. Subtract 1 second anyway, to be on + * padding which the server keeps. Subtract 1 second anyway, to be on * the safe side. Can't subtract more because we don't know how big * ExpirationTime is. Possible consistency problems may arise if the call * timeout period becomes longer than the server's expiration padding. */ ObtainWriteLock(&afs_xcbhash, 470); if (CallBack->ExpirationTime != 0) { - tvc->cbExpires = CallBack->ExpirationTime+osi_Time()-1; + tvc->cbExpires = CallBack->ExpirationTime + osi_Time() - 1; tvc->states |= CStatd; tvc->states &= ~CBulkFetching; afs_QueueCallback(tvc, CBHash(CallBack->ExpirationTime), tvp); - } - else if (tvc->states & CRO) { - /* old-fashioned AFS 3.2 style */ - tvc->cbExpires = 3600+osi_Time(); /*XXX*/ - tvc->states |= CStatd; - tvc->states &= ~CBulkFetching; - afs_QueueCallback(tvc, CBHash(3600), tvp); - } - else { - afs_DequeueCallback(tvc); - tvc->callback = (struct server *)0; - tvc->states &= ~(CStatd|CUnique); - if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) - osi_dnlc_purgedp (tvc); /* if it (could be) a directory */ + } else if (tvc->states & CRO) { + /* old-fashioned AFS 3.2 style */ + tvc->cbExpires = 3600 + osi_Time(); + /*XXX*/ tvc->states |= CStatd; + tvc->states &= ~CBulkFetching; + afs_QueueCallback(tvc, CBHash(3600), tvp); + } else { + afs_DequeueCallback(tvc); + tvc->callback = NULL; + tvc->states &= ~(CStatd | CUnique); + if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1)) + osi_dnlc_purgedp(tvc); /* if it (could be) a directory */ } ReleaseWriteLock(&afs_xcbhash); - if ( tvp ) + if (tvp) afs_PutVolume(tvp, READ_LOCK); - + /* look in per-pag cache */ - if (tvc->Access && (ac = afs_FindAxs(tvc->Access, areq->uid))) - ac->axess = OutStatus->CallerAccess; /* substitute pags */ - else /* not found, add a new one if possible */ - afs_AddAxs(tvc->Access, areq->uid, OutStatus->CallerAccess); + if (tvc->Access && (ac = afs_FindAxs(tvc->Access, areq->uid))) + ac->axess = OutStatus->CallerAccess; /* substitute pags */ + else /* not found, add a new one if possible */ + afs_AddAxs(tvc->Access, areq->uid, OutStatus->CallerAccess); ReleaseWriteLock(&tvc->lock); afs_Trace4(afs_iclSetp, CM_TRACE_STUFFVCACHE, ICL_TYPE_POINTER, tvc, - ICL_TYPE_POINTER, tvc->callback, ICL_TYPE_INT32, tvc->cbExpires, - ICL_TYPE_INT32, tvc->cbExpires-osi_Time()); + ICL_TYPE_POINTER, tvc->callback, ICL_TYPE_INT32, + tvc->cbExpires, ICL_TYPE_INT32, tvc->cbExpires - osi_Time()); /* * Release ref count... hope this guy stays around... */ - afs_PutVCache(tvc, WRITE_LOCK); -} /*afs_StuffVcache*/ + afs_PutVCache(tvc); +} /*afs_StuffVcache */ #endif /* @@ -2432,11 +2564,8 @@ afs_StuffVcache(afid, OutStatus, CallBack, tc, areq) * Nothing interesting. */ void -afs_PutVCache(avc, locktype) - register struct vcache *avc; - afs_int32 locktype; -{ /*afs_PutVCache*/ - +afs_PutVCache(register struct vcache *avc) +{ AFS_STATCNT(afs_PutVCache); /* * Can we use a read lock here? @@ -2444,7 +2573,7 @@ afs_PutVCache(avc, locktype) ObtainReadLock(&afs_xvcache); AFS_FAST_RELE(avc); ReleaseReadLock(&afs_xvcache); -} /*afs_PutVCache*/ +} /*afs_PutVCache */ /* * afs_FindVCache @@ -2454,7 +2583,7 @@ afs_PutVCache(avc, locktype) * * Parameters: * afid : Pointer to the fid whose cache entry we desire. - * retry: (SGI-specific) tell the caller to drop the lock on xvcache, + * retry: (SGI-specific) tell the caller to drop the lock on xvcache, * unlock the vnode, and try again. * flags: bit 1 to specify whether to compute hit statistics. Not * set if FindVCache is called as part of internal bookkeeping. @@ -2465,8 +2594,8 @@ afs_PutVCache(avc, locktype) * must be shared-- we upgrade it here. */ -struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 lockit, - afs_int32 locktype, afs_int32 *retry, afs_int32 flag) +struct vcache * +afs_FindVCache(struct VenusFid *afid, afs_int32 * retry, afs_int32 flag) { register struct vcache *tvc; @@ -2475,78 +2604,80 @@ struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 lockit, AFS_STATCNT(afs_FindVCache); i = VCHash(afid); - for(tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { - if (FidMatches(afid, tvc)) { + for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { + if (FidMatches(afid, tvc)) { #ifdef AFS_OSF_ENV - /* Grab this vnode, possibly reactivating from the free list */ + /* Grab this vnode, possibly reactivating from the free list */ int vg; AFS_GUNLOCK(); - vg = vget(AFSTOV(tvc)); + vg = vget(AFSTOV(tvc)); AFS_GLOCK(); if (vg) - continue; -#endif /* AFS_OSF_ENV */ + continue; +#endif /* AFS_OSF_ENV */ break; } } /* should I have a read lock on the vnode here? */ if (tvc) { - if (retry) *retry = 0; + if (retry) + *retry = 0; #if !defined(AFS_OSF_ENV) - osi_vnhold(tvc, retry); /* already held, above */ - if (retry && *retry) - return 0; + osi_vnhold(tvc, retry); /* already held, above */ + if (retry && *retry) + return 0; #endif /* * only move to front of vlru if we have proper vcache locking) */ if (flag & DO_VLRU) { - if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { - refpanic ("FindVC VLRU inconsistent1"); - } - if (tvc->vlruq.next->prev != &(tvc->vlruq)) { - refpanic ("FindVC VLRU inconsistent1"); - } - if (tvc->vlruq.prev->next != &(tvc->vlruq)) { - refpanic ("FindVC VLRU inconsistent2"); - } - UpgradeSToWLock(&afs_xvcache,26); + if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { + refpanic("FindVC VLRU inconsistent1"); + } + if (tvc->vlruq.next->prev != &(tvc->vlruq)) { + refpanic("FindVC VLRU inconsistent1"); + } + if (tvc->vlruq.prev->next != &(tvc->vlruq)) { + refpanic("FindVC VLRU inconsistent2"); + } + UpgradeSToWLock(&afs_xvcache, 26); QRemove(&tvc->vlruq); QAdd(&VLRU, &tvc->vlruq); ConvertWToSLock(&afs_xvcache); - if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { - refpanic ("FindVC VLRU inconsistent1"); - } - if (tvc->vlruq.next->prev != &(tvc->vlruq)) { - refpanic ("FindVC VLRU inconsistent2"); - } - if (tvc->vlruq.prev->next != &(tvc->vlruq)) { - refpanic ("FindVC VLRU inconsistent3"); - } + if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { + refpanic("FindVC VLRU inconsistent1"); + } + if (tvc->vlruq.next->prev != &(tvc->vlruq)) { + refpanic("FindVC VLRU inconsistent2"); + } + if (tvc->vlruq.prev->next != &(tvc->vlruq)) { + refpanic("FindVC VLRU inconsistent3"); + } } vcachegen++; - } + } if (flag & DO_STATS) { - if (tvc) afs_stats_cmperf.vcacheHits++; - else afs_stats_cmperf.vcacheMisses++; - if (afs_IsPrimaryCellNum(afid->Cell)) - afs_stats_cmperf.vlocalAccesses++; - else - afs_stats_cmperf.vremoteAccesses++; + if (tvc) + afs_stats_cmperf.vcacheHits++; + else + afs_stats_cmperf.vcacheMisses++; + if (afs_IsPrimaryCellNum(afid->Cell)) + afs_stats_cmperf.vlocalAccesses++; + else + afs_stats_cmperf.vremoteAccesses++; } - #ifdef AFS_LINUX22_ENV if (tvc && (tvc->states & CStatd)) - vcache2inode(tvc); /* mainly to reset i_nlink */ + vcache2inode(tvc); /* mainly to reset i_nlink */ #endif #ifdef AFS_DARWIN_ENV if (tvc) - osi_VM_Setup(tvc, 0); + osi_VM_Setup(tvc, 0); #endif return tvc; -} /*afs_FindVCache*/ +} /*afs_FindVCache */ /* * afs_NFSFindVCache @@ -2558,7 +2689,7 @@ struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 lockit, * Parameters: * avcp : Fill in pointer if we found one and only one. * afid : Pointer to the fid whose cache entry we desire. - * retry: (SGI-specific) tell the caller to drop the lock on xvcache, + * retry: (SGI-specific) tell the caller to drop the lock on xvcache, * unlock the vnode, and try again. * flags: bit 1 to specify whether to compute hit statistics. Not * set if FindVCache is called as part of internal bookkeeping. @@ -2572,45 +2703,43 @@ struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 lockit, * number of matches found. */ -int afs_duplicate_nfs_fids=0; - -afs_int32 afs_NFSFindVCache(avcp, afid, lockit) - struct vcache **avcp; - struct VenusFid *afid; - afs_int32 lockit; -{ /*afs_FindVCache*/ +int afs_duplicate_nfs_fids = 0; +afs_int32 +afs_NFSFindVCache(struct vcache **avcp, struct VenusFid *afid) +{ register struct vcache *tvc; afs_int32 i; - afs_int32 retry = 0; afs_int32 count = 0; struct vcache *found_tvc = NULL; AFS_STATCNT(afs_FindVCache); - loop: +#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV) + loop: +#endif - ObtainSharedLock(&afs_xvcache,331); + ObtainSharedLock(&afs_xvcache, 331); i = VCHash(afid); - for(tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { + for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { /* Match only on what we have.... */ - if (((tvc->fid.Fid.Vnode & 0xffff) == afid->Fid.Vnode) + if (((tvc->fid.Fid.Vnode & 0xffff) == afid->Fid.Vnode) && (tvc->fid.Fid.Volume == afid->Fid.Volume) && ((tvc->fid.Fid.Unique & 0xffffff) == afid->Fid.Unique) && (tvc->fid.Cell == afid->Cell)) { #ifdef AFS_OSF_ENV - /* Grab this vnode, possibly reactivating from the free list */ + /* Grab this vnode, possibly reactivating from the free list */ int vg; AFS_GUNLOCK(); - vg = vget(AFSTOV(tvc)); + vg = vget(AFSTOV(tvc)); AFS_GLOCK(); if (vg) { /* This vnode no longer exists. */ - continue; + continue; } -#endif /* AFS_OSF_ENV */ - count ++; +#endif /* AFS_OSF_ENV */ + count++; if (found_tvc) { /* Duplicates */ #ifdef AFS_OSF_ENV @@ -2630,60 +2759,63 @@ afs_int32 afs_NFSFindVCache(avcp, afid, lockit) /* should I have a read lock on the vnode here? */ if (tvc) { #if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV) - osi_vnhold(tvc, &retry); + afs_int32 retry = 0; + osi_vnhold(tvc, &retry); if (retry) { count = 0; - found_tvc = (struct vcache*)0; + found_tvc = (struct vcache *)0; ReleaseSharedLock(&afs_xvcache); spunlock_psema(tvc->v.v_lock, retry, &tvc->v.v_sync, PINOD); goto loop; } #else #if !defined(AFS_OSF_ENV) - osi_vnhold(tvc, (int*)0); /* already held, above */ + osi_vnhold(tvc, (int *)0); /* already held, above */ #endif #endif /* * We obtained the xvcache lock above. */ if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { - refpanic ("FindVC VLRU inconsistent1"); + refpanic("FindVC VLRU inconsistent1"); } if (tvc->vlruq.next->prev != &(tvc->vlruq)) { - refpanic ("FindVC VLRU inconsistent1"); + refpanic("FindVC VLRU inconsistent1"); } if (tvc->vlruq.prev->next != &(tvc->vlruq)) { - refpanic ("FindVC VLRU inconsistent2"); + refpanic("FindVC VLRU inconsistent2"); } - UpgradeSToWLock(&afs_xvcache,568); + UpgradeSToWLock(&afs_xvcache, 568); QRemove(&tvc->vlruq); QAdd(&VLRU, &tvc->vlruq); ConvertWToSLock(&afs_xvcache); if ((VLRU.next->prev != &VLRU) || (VLRU.prev->next != &VLRU)) { - refpanic ("FindVC VLRU inconsistent1"); + refpanic("FindVC VLRU inconsistent1"); } if (tvc->vlruq.next->prev != &(tvc->vlruq)) { - refpanic ("FindVC VLRU inconsistent2"); + refpanic("FindVC VLRU inconsistent2"); } if (tvc->vlruq.prev->next != &(tvc->vlruq)) { - refpanic ("FindVC VLRU inconsistent3"); + refpanic("FindVC VLRU inconsistent3"); } } vcachegen++; - if (tvc) afs_stats_cmperf.vcacheHits++; - else afs_stats_cmperf.vcacheMisses++; + if (tvc) + afs_stats_cmperf.vcacheHits++; + else + afs_stats_cmperf.vcacheMisses++; if (afs_IsPrimaryCellNum(afid->Cell)) - afs_stats_cmperf.vlocalAccesses++; + afs_stats_cmperf.vlocalAccesses++; else - afs_stats_cmperf.vremoteAccesses++; + afs_stats_cmperf.vremoteAccesses++; - *avcp = tvc; /* May be null */ + *avcp = tvc; /* May be null */ ReleaseSharedLock(&afs_xvcache); return (tvc ? 1 : 0); -} /*afs_NFSFindVCache*/ +} /*afs_NFSFindVCache */ @@ -2693,23 +2825,24 @@ afs_int32 afs_NFSFindVCache(avcp, afid, lockit) * * Initialize vcache related variables */ -void afs_vcacheInit(int astatSize) +void +afs_vcacheInit(int astatSize) { register struct vcache *tvp; int i; #if defined(AFS_OSF_ENV) if (!afs_maxvcount) { #if defined(AFS_OSF30_ENV) - afs_maxvcount = max_vnodes/2; /* limit ourselves to half the total */ + afs_maxvcount = max_vnodes / 2; /* limit ourselves to half the total */ #else - afs_maxvcount = nvnode/2; /* limit ourselves to half the total */ -#endif - if (astatSize < afs_maxvcount) { - afs_maxvcount = astatSize; - } + afs_maxvcount = nvnode / 2; /* limit ourselves to half the total */ +#endif + if (astatSize < afs_maxvcount) { + afs_maxvcount = astatSize; + } } -#else /* AFS_OSF_ENV */ - freeVCList = (struct vcache *)0; +#else /* AFS_OSF_ENV */ + freeVCList = NULL; #endif RWLOCK_INIT(&afs_xvcache, "afs_xvcache"); @@ -2717,29 +2850,30 @@ void afs_vcacheInit(int astatSize) #if !defined(AFS_OSF_ENV) /* Allocate and thread the struct vcache entries */ - tvp = (struct vcache *) afs_osi_Alloc(astatSize * sizeof(struct vcache)); - memset((char *)tvp, 0, sizeof(struct vcache)*astatSize); + tvp = (struct vcache *)afs_osi_Alloc(astatSize * sizeof(struct vcache)); + memset((char *)tvp, 0, sizeof(struct vcache) * astatSize); Initial_freeVCList = tvp; freeVCList = &(tvp[0]); - for(i=0; i < astatSize-1; i++) { - tvp[i].nextfree = &(tvp[i+1]); - } - tvp[astatSize-1].nextfree = (struct vcache *) 0; -#ifdef AFS_AIX32_ENV - pin((char *)tvp, astatSize * sizeof(struct vcache)); /* XXX */ + for (i = 0; i < astatSize - 1; i++) { + tvp[i].nextfree = &(tvp[i + 1]); + } + tvp[astatSize - 1].nextfree = NULL; +#ifdef KERNEL_HAVE_PIN + pin((char *)tvp, astatSize * sizeof(struct vcache)); /* XXX */ #endif #endif #if defined(AFS_SGI_ENV) - for(i=0; i < astatSize; i++) { + for (i = 0; i < astatSize; i++) { char name[METER_NAMSZ]; struct vcache *tvc = &tvp[i]; tvc->v.v_number = ++afsvnumbers; tvc->vc_rwlockid = OSI_NO_LOCKID; - initnsema(&tvc->vc_rwlock, 1, makesname(name, "vrw", tvc->v.v_number)); + initnsema(&tvc->vc_rwlock, 1, + makesname(name, "vrw", tvc->v.v_number)); #ifndef AFS_SGI53_ENV initnsema(&tvc->v.v_sync, 0, makesname(name, "vsy", tvc->v.v_number)); #endif @@ -2758,7 +2892,8 @@ void afs_vcacheInit(int astatSize) * shutdown_vcache * */ -void shutdown_vcache(void) +void +shutdown_vcache(void) { int i; struct afs_cbr *tsp, *nsp; @@ -2767,12 +2902,6 @@ void shutdown_vcache(void) * free vcache entries and all the vcache entries are active ones then we allocate * an additional one - admittedly we almost never had that occur. */ -#if !defined(AFS_OSF_ENV) - afs_osi_Free(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache)); -#endif -#ifdef AFS_AIX32_ENV - unpin(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache)); -#endif { register struct afs_q *tq, *uq; @@ -2782,24 +2911,24 @@ void shutdown_vcache(void) uq = QPrev(tq); if (tvc->mvid) { osi_FreeSmallSpace(tvc->mvid); - tvc->mvid = (struct VenusFid*)0; + tvc->mvid = (struct VenusFid *)0; } #ifdef AFS_AIX_ENV aix_gnode_rele(AFSTOV(tvc)); #endif if (tvc->linkData) { - afs_osi_Free(tvc->linkData, strlen(tvc->linkData)+1); + afs_osi_Free(tvc->linkData, strlen(tvc->linkData) + 1); tvc->linkData = 0; } } - /* - * Also free the remaining ones in the Cache + /* + * Also free the remaining ones in the Cache */ - for (i=0; i < VCSIZE; i++) { + for (i = 0; i < VCSIZE; i++) { for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { if (tvc->mvid) { osi_FreeSmallSpace(tvc->mvid); - tvc->mvid = (struct VenusFid*)0; + tvc->mvid = (struct VenusFid *)0; } #ifdef AFS_AIX_ENV if (tvc->v.v_gnode) @@ -2810,7 +2939,8 @@ void shutdown_vcache(void) vms_delete(tvc->segid); AFS_GLOCK(); tvc->segid = tvc->vmh = NULL; - if (VREFCOUNT(tvc)) osi_Panic("flushVcache: vm race"); + if (VREFCOUNT(tvc)) + osi_Panic("flushVcache: vm race"); } if (tvc->credp) { crfree(tvc->credp); @@ -2825,7 +2955,7 @@ void shutdown_vcache(void) } #endif if (tvc->linkData) { - afs_osi_Free(tvc->linkData, strlen(tvc->linkData)+1); + afs_osi_Free(tvc->linkData, strlen(tvc->linkData) + 1); tvc->linkData = 0; } @@ -2837,12 +2967,18 @@ void shutdown_vcache(void) /* * Free any leftover callback queue */ - for (tsp = afs_cbrSpace; tsp; tsp = nsp ) { + for (tsp = afs_cbrSpace; tsp; tsp = nsp) { nsp = tsp->next; afs_osi_Free((char *)tsp, AFS_NCBRS * sizeof(struct afs_cbr)); } afs_cbrSpace = 0; +#if !defined(AFS_OSF_ENV) + afs_osi_Free(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache)); +#endif +#ifdef KERNEL_HAVE_PIN + unpin(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache)); +#endif #if !defined(AFS_OSF_ENV) freeVCList = Initial_freeVCList = 0; #endif diff --git a/src/afs/afs_volume.c b/src/afs/afs_volume.c index 45734c716..dc5321645 100644 --- a/src/afs/afs_volume.c +++ b/src/afs/afs_volume.c @@ -16,12 +16,13 @@ * afs_FindVolume */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_volume.c,v 1.1.1.13 2003/07/30 17:08:02 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afs/afs_volume.c,v 1.26 2003/08/27 21:43:16 rees Exp $"); -#include "../afs/stds.h" -#include "../afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/stds.h" +#include "afs/sysincludes.h" /* Standard vendor system headers */ #if !defined(UKERNEL) #if !defined(AFS_LINUX20_ENV) @@ -30,15 +31,15 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_volume.c,v 1.1.1.13 2003/07/30 #include #ifdef AFS_SGI62_ENV -#include "../h/hashing.h" +#include "h/hashing.h" #endif #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV) #include #endif /* ! AFS_HPUX110_ENV */ #endif /* !defined(UKERNEL) */ -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" /* afs statistics */ +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" /* afs statistics */ #if defined(AFS_SUN56_ENV) #include @@ -49,14 +50,6 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_volume.c,v 1.1.1.13 2003/07/30 #include #endif -/* Imported variables */ -extern afs_rwlock_t afs_xserver; -extern afs_rwlock_t afs_xsrvAddr; -extern afs_rwlock_t afs_xvcache; -extern afs_rwlock_t afs_xcbhash; -extern struct srvAddr *afs_srvAddrs[NSERVERS]; /* Hashed by server's ip */ -extern int afs_totalSrvAddrs; - /* In case we don't have the vl error table yet. */ #ifndef ERROR_TABLE_BASE_VL #define ERROR_TABLE_BASE_VL (363520L) @@ -64,38 +57,39 @@ extern int afs_totalSrvAddrs; #endif /* vlserver error base define */ /* Exported variables */ -ino_t volumeInode; /*Inode for VolumeItems file*/ -afs_rwlock_t afs_xvolume; /* allocation lock for volumes */ +ino_t volumeInode; /*Inode for VolumeItems file */ +afs_rwlock_t afs_xvolume; /* allocation lock for volumes */ struct volume *afs_freeVolList; struct volume *afs_volumes[NVOLS]; -afs_int32 afs_volCounter = 1; /* for allocating volume indices */ +afs_int32 afs_volCounter = 1; /* for allocating volume indices */ afs_int32 fvTable[NFENTRIES]; /* Forward declarations */ -static struct volume *afs_NewVolumeByName(char *aname, afs_int32 acell, int agood, - struct vrequest *areq, afs_int32 locktype); +static struct volume *afs_NewVolumeByName(char *aname, afs_int32 acell, + int agood, struct vrequest *areq, + afs_int32 locktype); static struct volume *afs_NewDynrootVolume(struct VenusFid *fid); -static inVolList(); +static int inVolList(struct VenusFid *fid, afs_int32 nvols, afs_int32 * vID, + afs_int32 * cID); /* Convert a volume name to a #; return 0 if can't parse as a number */ -static int afs_vtoi(aname) - register char *aname; - +static int +afs_vtoi(register char *aname) { register afs_int32 temp; register int tc; temp = 0; AFS_STATCNT(afs_vtoi); - while(tc = *aname++) { - if (tc > '9' || tc < '0') - return 0; /* invalid name */ + while ((tc = *aname++)) { + if (tc > '9' || tc < '0') + return 0; /* invalid name */ temp *= 10; temp += tc - '0'; } return temp; -} /*afs_vtoi*/ +} /*afs_vtoi */ /* @@ -110,8 +104,8 @@ afs_int32 afs_FVIndex = -1; /* UFS specific version of afs_GetVolSlot */ -struct volume *afs_UFSGetVolSlot() - +struct volume * +afs_UFSGetVolSlot(void) { register struct volume *tv, **lv; struct osi_file *tfile; @@ -125,11 +119,11 @@ struct volume *afs_UFSGetVolSlot() bestTime = 0x7fffffff; bestVp = 0; bestLp = 0; - for (i=0;inext, tv = *lv) { - if (tv->refCount == 0) { /* is this one available? */ - if (tv->accessTime < bestTime) { /* best one available? */ + if (tv->refCount == 0) { /* is this one available? */ + if (tv->accessTime < bestTime) { /* best one available? */ bestTime = tv->accessTime; bestLp = lv; bestVp = tv; @@ -142,25 +136,25 @@ struct volume *afs_UFSGetVolSlot() tv = bestVp; *bestLp = tv->next; if (tv->name) - afs_osi_Free(tv->name, strlen(tv->name)+1); - tv->name = (char *) 0; + afs_osi_Free(tv->name, strlen(tv->name) + 1); + tv->name = NULL; /* now write out volume structure to file */ if (tv->vtix < 0) { tv->vtix = afs_volCounter++; /* now put on hash chain */ i = FVHash(tv->cell, tv->volume); staticFVolume.next = fvTable[i]; - fvTable[i]=tv->vtix; - } - else { + fvTable[i] = tv->vtix; + } else { /* * Haul the guy in from disk so we don't overwrite hash table * next chain */ if (afs_FVIndex != tv->vtix) { tfile = osi_UFSOpen(volumeInode); - code = afs_osi_Read(tfile, sizeof(struct fvolume) * tv->vtix, - &staticFVolume, sizeof(struct fvolume)); + code = + afs_osi_Read(tfile, sizeof(struct fvolume) * tv->vtix, + &staticFVolume, sizeof(struct fvolume)); if (code != sizeof(struct fvolume)) osi_Panic("read volumeinfo"); osi_UFSClose(tfile); @@ -175,74 +169,71 @@ struct volume *afs_UFSGetVolSlot() staticFVolume.rootVnode = tv->rootVnode; staticFVolume.rootUnique = tv->rootUnique; tfile = osi_UFSOpen(volumeInode); - code = afs_osi_Write(tfile, sizeof(struct fvolume) * afs_FVIndex, - &staticFVolume, sizeof(struct fvolume)); + code = + afs_osi_Write(tfile, sizeof(struct fvolume) * afs_FVIndex, + &staticFVolume, sizeof(struct fvolume)); if (code != sizeof(struct fvolume)) osi_Panic("write volumeinfo"); - osi_UFSClose(tfile); - } - else { + osi_UFSClose(tfile); + } else { tv = afs_freeVolList; afs_freeVolList = tv->next; } return tv; -} /*afs_UFSGetVolSlot*/ - +} /*afs_UFSGetVolSlot */ -struct volume *afs_MemGetVolSlot() +struct volume * +afs_MemGetVolSlot(void) { - register struct volume *tv, **lv; - register afs_int32 i; - afs_int32 bestTime; - struct volume *bestVp, **bestLp; + register struct volume *tv; AFS_STATCNT(afs_MemGetVolSlot); if (!afs_freeVolList) { struct volume *newVp; - newVp = (struct volume *) afs_osi_Alloc(sizeof(struct volume)); + newVp = (struct volume *)afs_osi_Alloc(sizeof(struct volume)); - newVp->next = (struct volume *)0; + newVp->next = NULL; afs_freeVolList = newVp; } tv = afs_freeVolList; afs_freeVolList = tv->next; return tv; -} /*afs_MemGetVolSlot*/ +} /*afs_MemGetVolSlot */ /* afs_ResetVolumes() * Reset volume inforamation for all volume structs that * point to a speicific server. */ -void afs_ResetVolumes(struct server *srvp) +void +afs_ResetVolumes(struct server *srvp) { - int j, k; - struct volume *vp; - - /* Find any volumes residing on this server and flush their state */ - for (j=0; jnext) { - for (k=0; kserverHost[k] == srvp)) { - vp->serverHost[k] = 0; - afs_ResetVolumeInfo(vp); - break; - } + int j, k; + struct volume *vp; + + /* Find any volumes residing on this server and flush their state */ + for (j = 0; j < NVOLS; j++) { + for (vp = afs_volumes[j]; vp; vp = vp->next) { + for (k = 0; k < MAXHOSTS; k++) { + if (!srvp || (vp->serverHost[k] == srvp)) { + vp->serverHost[k] = 0; + afs_ResetVolumeInfo(vp); + break; + } + } } - } - } + } } /* reset volume name to volume id mapping cache */ -void afs_CheckVolumeNames(flags) - int flags; +void +afs_CheckVolumeNames(int flags) { - afs_int32 i,j; - extern int osi_dnlc_purge(); + afs_int32 i, j; struct volume *tv; unsigned int now; struct vcache *tvc; @@ -251,38 +242,38 @@ void afs_CheckVolumeNames(flags) nvols = 0; volumeID = cellID = NULL; - vsize=0; + vsize = 0; ObtainReadLock(&afs_xvolume); if (flags & AFS_VOLCHECK_EXPIRED) { /* * allocate space to hold the volumeIDs and cellIDs, only if * we will be invalidating the mountpoints later on */ - for (i=0; i< NVOLS; i++) - for (tv = afs_volumes[i]; tv; tv=tv->next) + for (i = 0; i < NVOLS; i++) + for (tv = afs_volumes[i]; tv; tv = tv->next) ++vsize; volumeID = (afs_int32 *) afs_osi_Alloc(2 * vsize * sizeof(*volumeID)); - cellID = (volumeID) ? volumeID + vsize : 0; + cellID = (volumeID) ? volumeID + vsize : 0; } now = osi_Time(); - for (i=0;inext) { + for (i = 0; i < NVOLS; i++) { + for (tv = afs_volumes[i]; tv; tv = tv->next) { if (flags & AFS_VOLCHECK_EXPIRED) { - if ( ((tv->expireTime<(now+10)) && (tv->states & VRO)) || - (flags & AFS_VOLCHECK_FORCE)){ - afs_ResetVolumeInfo(tv); /* also resets status */ + if (((tv->expireTime < (now + 10)) && (tv->states & VRO)) + || (flags & AFS_VOLCHECK_FORCE)) { + afs_ResetVolumeInfo(tv); /* also resets status */ if (volumeID) { volumeID[nvols] = tv->volume; - cellID[nvols] = tv->cell; + cellID[nvols] = tv->cell; } ++nvols; continue; } } if (flags & (AFS_VOLCHECK_BUSY | AFS_VOLCHECK_FORCE)) { - for (j=0; jstatus[j] = not_busy; } @@ -294,31 +285,32 @@ void afs_CheckVolumeNames(flags) /* next ensure all mt points are re-evaluated */ if (nvols || (flags & (AFS_VOLCHECK_FORCE | AFS_VOLCHECK_MTPTS))) { ObtainReadLock(&afs_xvcache); - for(i=0;ihnext) { + for (i = 0; i < VCSIZE; i++) { + for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { /* if the volume of "mvid" of the vcache entry is among the - * ones we found earlier, then we re-evaluate it. Also, if the - * force bit is set or we explicitly asked to reevaluate the - * mt-pts, we clean the cmvalid bit */ + * ones we found earlier, then we re-evaluate it. Also, if the + * force bit is set or we explicitly asked to reevaluate the + * mt-pts, we clean the cmvalid bit */ - if ((flags & (AFS_VOLCHECK_FORCE | AFS_VOLCHECK_MTPTS)) || - (tvc->mvid && - inVolList(tvc->mvid, nvols, volumeID, cellID))) + if ((flags & (AFS_VOLCHECK_FORCE | AFS_VOLCHECK_MTPTS)) + || (tvc->mvid + && inVolList(tvc->mvid, nvols, volumeID, cellID))) tvc->states &= ~CMValid; /* If the volume that this file belongs to was reset earlier, * then we should remove its callback. * Again, if forced, always do it. */ - if ((tvc->states & CRO) && - (inVolList(&tvc->fid, nvols, volumeID, cellID) || - (flags & AFS_VOLCHECK_FORCE))) { + if ((tvc->states & CRO) + && (inVolList(&tvc->fid, nvols, volumeID, cellID) + || (flags & AFS_VOLCHECK_FORCE))) { AFS_FAST_HOLD(tvc); ReleaseReadLock(&afs_xvcache); ObtainWriteLock(&afs_xcbhash, 485); + /* LOCKXXX: We aren't holding tvc write lock? */ afs_DequeueCallback(tvc); tvc->states &= ~CStatd; ReleaseWriteLock(&afs_xcbhash); @@ -332,27 +324,27 @@ void afs_CheckVolumeNames(flags) } } } - osi_dnlc_purge (); /* definitely overkill, but it's safer this way. */ + osi_dnlc_purge(); /* definitely overkill, but it's safer this way. */ ReleaseReadLock(&afs_xvcache); } if (volumeID) afs_osi_Free(volumeID, 2 * vsize * sizeof(*volumeID)); -} /*afs_CheckVolumeNames*/ +} /*afs_CheckVolumeNames */ -static inVolList(fid, nvols, vID, cID) - struct VenusFid *fid; - afs_int32 nvols, *vID, *cID; +static int +inVolList(struct VenusFid *fid, afs_int32 nvols, afs_int32 * vID, + afs_int32 * cID) { afs_int32 i; /* if no arrays present, be conservative and return true */ - if ( nvols && (!vID || !cID)) + if (nvols && (!vID || !cID)) return 1; - for (i=0; i< nvols; ++i) { + for (i = 0; i < nvols; ++i) { if (fid->Fid.Volume == vID[i] && fid->Cell == cID[i]) return 1; } @@ -368,7 +360,8 @@ static inVolList(fid, nvols, vID, cID) * * Environment: Must be called with afs_xvolume unlocked. */ -struct volume *afs_FindVolume(struct VenusFid *afid, afs_int32 locktype) +struct volume * +afs_FindVolume(struct VenusFid *afid, afs_int32 locktype) { struct volume *tv; afs_int32 i; @@ -377,17 +370,17 @@ struct volume *afs_FindVolume(struct VenusFid *afid, afs_int32 locktype) return NULL; i = VHash(afid->Fid.Volume); - ObtainWriteLock(&afs_xvolume,106); - for (tv = afs_volumes[i]; tv; tv=tv->next) { + ObtainWriteLock(&afs_xvolume, 106); + for (tv = afs_volumes[i]; tv; tv = tv->next) { if (tv->volume == afid->Fid.Volume && tv->cell == afid->Cell && (tv->states & VRecheck) == 0) { tv->refCount++; break; - } + } } ReleaseWriteLock(&afs_xvolume); - return tv; /* NULL if we didn't find it */ -} /*afs_FindVolume*/ + return tv; /* NULL if we didn't find it */ +} /*afs_FindVolume */ @@ -395,10 +388,9 @@ struct volume *afs_FindVolume(struct VenusFid *afid, afs_int32 locktype) * Note that areq may be null, in which case we don't bother to set any * request status information. */ -struct volume *afs_GetVolume(afid, areq, locktype) - struct vrequest *areq; - struct VenusFid *afid; - afs_int32 locktype; +struct volume * +afs_GetVolume(struct VenusFid *afid, struct vrequest *areq, + afs_int32 locktype) { struct volume *tv; char *bp, tbuf[CVBS]; @@ -406,42 +398,39 @@ struct volume *afs_GetVolume(afid, areq, locktype) tv = afs_FindVolume(afid, locktype); if (!tv) { - if (afs_IsDynrootFid(afid)) { - tv = afs_NewDynrootVolume(afid); - } else { - bp = afs_cv2string(&tbuf[CVBS], afid->Fid.Volume); - tv = afs_NewVolumeByName(bp, afid->Cell, 0, areq, locktype); - } + if (afs_IsDynrootFid(afid)) { + tv = afs_NewDynrootVolume(afid); + } else { + bp = afs_cv2string(&tbuf[CVBS], afid->Fid.Volume); + tv = afs_NewVolumeByName(bp, afid->Cell, 0, areq, locktype); + } } return tv; -} /*afs_GetVolume*/ +} /*afs_GetVolume */ -static struct volume *afs_SetupVolume(volid, aname, ve, tcell, agood, type, areq) - char *aname; - char *ve; - afs_int32 volid, agood, type; - struct cell *tcell; - struct vrequest *areq; +static struct volume * +afs_SetupVolume(afs_int32 volid, char *aname, char *ve, struct cell *tcell, + afs_int32 agood, afs_int32 type, struct vrequest *areq) { struct volume *tv; struct vldbentry *ove = (struct vldbentry *)ve; struct nvldbentry *nve = (struct nvldbentry *)ve; struct uvldbentry *uve = (struct uvldbentry *)ve; - int whichType; /* which type of volume to look for */ - int i, j, err=0; + int whichType; /* which type of volume to look for */ + int i, j, err = 0; if (!volid) { - int len; + int len; /* special hint from file server to use vlserver */ len = strlen(aname); - if (len >= 8 && strcmp(aname+len-7, ".backup") == 0) + if (len >= 8 && strcmp(aname + len - 7, ".backup") == 0) whichType = BACKVOL; - else if (len >= 10 && strcmp(aname+len-9, ".readonly")==0) + else if (len >= 10 && strcmp(aname + len - 9, ".readonly") == 0) whichType = ROVOL; - else + else whichType = RWVOL; /* figure out which one we're really interested in (a set is returned) */ @@ -449,26 +438,24 @@ static struct volume *afs_SetupVolume(volid, aname, ve, tcell, agood, type, areq if (volid == 0) { if (type == 2) { volid = uve->volumeId[whichType]; - } - else if (type == 1) { + } else if (type == 1) { volid = nve->volumeId[whichType]; - } - else { + } else { volid = ove->volumeId[whichType]; } } } - - ObtainWriteLock(&afs_xvolume,108); + + ObtainWriteLock(&afs_xvolume, 108); i = VHash(volid); - for (tv = afs_volumes[i]; tv; tv=tv->next) { + for (tv = afs_volumes[i]; tv; tv = tv->next) { if (tv->volume == volid && tv->cell == tcell->cellNum) { break; } } if (!tv) { - struct fvolume *tf=0; + struct fvolume *tf = 0; tv = afs_GetVolSlot(); memset((char *)tv, 0, sizeof(struct volume)); @@ -477,11 +464,13 @@ static struct volume *afs_SetupVolume(volid, aname, ve, tcell, agood, type, areq tv->next = afs_volumes[i]; /* thread into list */ afs_volumes[i] = tv; tv->volume = volid; - for (j=fvTable[FVHash(tv->cell,volid)]; j!=0; j=tf->next) { + for (j = fvTable[FVHash(tv->cell, volid)]; j != 0; j = tf->next) { if (afs_FVIndex != j) { struct osi_file *tfile; tfile = osi_UFSOpen(volumeInode); - err = afs_osi_Read(tfile, sizeof(struct fvolume) * j, &staticFVolume, sizeof(struct fvolume)); + err = + afs_osi_Read(tfile, sizeof(struct fvolume) * j, + &staticFVolume, sizeof(struct fvolume)); if (err != sizeof(struct fvolume)) osi_Panic("read volumeinfo2"); osi_UFSClose(tfile); @@ -495,22 +484,21 @@ static struct volume *afs_SetupVolume(volid, aname, ve, tcell, agood, type, areq tv->vtix = afs_FVIndex; tv->mtpoint = tf->mtpoint; tv->dotdot = tf->dotdot; - tv->rootVnode = tf->rootVnode; - tv->rootUnique = tf->rootUnique; + tv->rootVnode = tf->rootVnode; + tv->rootUnique = tf->rootUnique; } else { tv->vtix = -1; tv->rootVnode = tv->rootUnique = 0; } } tv->refCount++; - tv->states &= ~VRecheck; /* just checked it */ + tv->states &= ~VRecheck; /* just checked it */ tv->accessTime = osi_Time(); ReleaseWriteLock(&afs_xvolume); - ObtainWriteLock(&tv->lock,111); + ObtainWriteLock(&tv->lock, 111); if (type == 2) { InstallUVolumeEntry(tv, uve, tcell->cellNum, tcell, areq); - } - else if (type == 1) + } else if (type == 1) InstallNVolumeEntry(tv, nve, tcell->cellNum); else InstallVolumeEntry(tv, ove, tcell->cellNum); @@ -520,30 +508,27 @@ static struct volume *afs_SetupVolume(volid, aname, ve, tcell, agood, type, areq strcpy(tv->name, aname); } } - for (i=0; istatus[i] = not_busy; + for (i = 0; i < NMAXNSERVERS; i++) { + tv->status[i] = not_busy; } ReleaseWriteLock(&tv->lock); return tv; } -struct volume *afs_GetVolumeByName(aname, acell, agood, areq, locktype) - struct vrequest *areq; - afs_int32 acell; - int agood; - register char *aname; - afs_int32 locktype; +struct volume * +afs_GetVolumeByName(register char *aname, afs_int32 acell, int agood, + struct vrequest *areq, afs_int32 locktype) { - afs_int32 i; - struct volume *tv; + afs_int32 i; + struct volume *tv; AFS_STATCNT(afs_GetVolumeByName); - ObtainWriteLock(&afs_xvolume,112); - for (i=0;inext) { - if (tv->name && !strcmp(aname,tv->name) && tv->cell == acell - && (tv->states&VRecheck) == 0) { + ObtainWriteLock(&afs_xvolume, 112); + for (i = 0; i < NVOLS; i++) { + for (tv = afs_volumes[i]; tv; tv = tv->next) { + if (tv->name && !strcmp(aname, tv->name) && tv->cell == acell + && (tv->states & VRecheck) == 0) { tv->refCount++; ReleaseWriteLock(&afs_xvolume); return tv; @@ -553,38 +538,43 @@ struct volume *afs_GetVolumeByName(aname, acell, agood, areq, locktype) ReleaseWriteLock(&afs_xvolume); - tv = afs_NewVolumeByName(aname, acell, agood, areq, locktype); - return(tv); + tv = afs_NewVolumeByName(aname, acell, agood, areq, locktype); + return (tv); } -static struct volume *afs_NewDynrootVolume(struct VenusFid *fid) { +static struct volume * +afs_NewDynrootVolume(struct VenusFid *fid) +{ struct cell *tcell; struct volume *tv; - struct vldbentry tve; + struct vldbentry *tve; char *bp, tbuf[CVBS]; tcell = afs_GetCell(fid->Cell, READ_LOCK); if (!tcell) - return (struct volume *) 0; + return NULL; + tve = afs_osi_Alloc(sizeof(*tve)); if (!(tcell->states & CHasVolRef)) tcell->states |= CHasVolRef; bp = afs_cv2string(&tbuf[CVBS], fid->Fid.Volume); - memset(&tve, 0, sizeof(tve)); - strcpy(tve.name, "local-dynroot"); - tve.volumeId[ROVOL] = fid->Fid.Volume; - tve.flags = VLF_ROEXISTS; + memset(tve, 0, sizeof(*tve)); + strcpy(tve->name, "local-dynroot"); + tve->volumeId[ROVOL] = fid->Fid.Volume; + tve->flags = VLF_ROEXISTS; - tv = afs_SetupVolume(0, bp, (char *) &tve, tcell, 0, 0, 0); + tv = afs_SetupVolume(0, bp, tve, tcell, 0, 0, 0); afs_PutCell(tcell, READ_LOCK); + afs_osi_Free(tve, sizeof(*tve)); return tv; } int lastnvcode; -static struct volume *afs_NewVolumeByName(char *aname, afs_int32 acell, int agood, - struct vrequest *areq, afs_int32 locktype) +static struct volume * +afs_NewVolumeByName(char *aname, afs_int32 acell, int agood, + struct vrequest *areq, afs_int32 locktype) { - afs_int32 code, i, type=0; + afs_int32 code, type = 0; struct volume *tv, *tv1; struct vldbentry *tve; struct nvldbentry *ntve; @@ -593,91 +583,70 @@ static struct volume *afs_NewVolumeByName(char *aname, afs_int32 acell, int agoo char *tbuffer, *ve; struct conn *tconn; struct vrequest treq; - XSTATS_DECLS; if (strlen(aname) > VL_MAXNAMELEN) /* Invalid volume name */ - return (struct volume *) 0; + return NULL; tcell = afs_GetCell(acell, READ_LOCK); if (!tcell) { - return (struct volume *) 0; + return NULL; } /* allow null request if we don't care about ENODEV/ETIMEDOUT distinction */ - if (!areq) areq = &treq; + if (!areq) + areq = &treq; afs_Trace2(afs_iclSetp, CM_TRACE_GETVOL, ICL_TYPE_STRING, aname, - ICL_TYPE_POINTER, aname); + ICL_TYPE_POINTER, aname); tbuffer = osi_AllocLargeSpace(AFS_LRALLOCSIZ); - tve = (struct vldbentry *) (tbuffer+1024); + tve = (struct vldbentry *)(tbuffer + 1024); ntve = (struct nvldbentry *)tve; utve = (struct uvldbentry *)tve; - afs_InitReq(&treq, &afs_osi_cred); /* *must* be unauth for vldb */ + afs_InitReq(&treq, afs_osi_credp); /* *must* be unauth for vldb */ do { - tconn = afs_ConnByMHosts(tcell->cellHosts, tcell->vlport, - tcell->cellNum, &treq, SHARED_LOCK); + tconn = + afs_ConnByMHosts(tcell->cellHosts, tcell->vlport, tcell->cellNum, + &treq, SHARED_LOCK); if (tconn) { if (tconn->srvr->server->flags & SNO_LHOSTS) { type = 0; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); code = VL_GetEntryByNameO(tconn->id, aname, tve); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); } else if (tconn->srvr->server->flags & SYES_LHOSTS) { type = 1; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); code = VL_GetEntryByNameN(tconn->id, aname, ntve); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); } else { type = 2; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); code = VL_GetEntryByNameU(tconn->id, aname, utve); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); if (!(tconn->srvr->server->flags & SVLSRV_UUID)) { if (code == RXGEN_OPCODE) { type = 1; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = VL_GetEntryByNameN(tconn->id, aname, ntve); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); + code = VL_GetEntryByNameN(tconn->id, aname, ntve); + RX_AFS_GLOCK(); if (code == RXGEN_OPCODE) { type = 0; tconn->srvr->server->flags |= SNO_LHOSTS; -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); code = VL_GetEntryByNameO(tconn->id, aname, tve); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GLOCK(); } else if (!code) tconn->srvr->server->flags |= SYES_LHOSTS; } else if (!code) - tconn->srvr->server->flags |= SVLSRV_UUID; + tconn->srvr->server->flags |= SVLSRV_UUID; } lastnvcode = code; } } else code = -1; - } while - (afs_Analyze(tconn, code, (struct VenusFid *) 0, &treq, - -1, /* no op code for this */ - SHARED_LOCK, tcell)); + } while (afs_Analyze(tconn, code, NULL, &treq, -1, /* no op code for this */ + SHARED_LOCK, tcell)); if (code) { /* If the client has yet to contact this cell and contact failed due @@ -689,8 +658,9 @@ static struct volume *afs_NewVolumeByName(char *aname, afs_int32 acell, int agoo int i; struct server *sp; struct srvAddr *sap; - for (i=0; icellHosts[i]) == (struct server *) 0) break; + for (i = 0; i < MAXCELLHOSTS; i++) { + if ((sp = tcell->cellHosts[i]) == NULL) + break; for (sap = sp->addr; sap; sap = sap->next_sa) afs_MarkServerUpOrDown(sap, 0); } @@ -698,7 +668,7 @@ static struct volume *afs_NewVolumeByName(char *aname, afs_int32 acell, int agoo afs_CopyError(&treq, areq); osi_FreeLargeSpace(tbuffer); afs_PutCell(tcell, READ_LOCK); - return (struct volume *) 0; + return NULL; } /* * Check to see if this cell has not yet referenced a volume. If @@ -709,8 +679,8 @@ static struct volume *afs_NewVolumeByName(char *aname, afs_int32 acell, int agoo if (!(tcell->states & CHasVolRef)) { tcell->states |= CHasVolRef; afs_stats_cmperf.numCellsContacted++; - } /*First time a volume in this cell has been referenced*/ - + } + /*First time a volume in this cell has been referenced */ if (type == 2) ve = (char *)utve; else if (type == 1) @@ -718,24 +688,34 @@ static struct volume *afs_NewVolumeByName(char *aname, afs_int32 acell, int agoo else ve = (char *)tve; tv = afs_SetupVolume(0, aname, ve, tcell, agood, type, areq); - if ((agood == 2) && tv->roVol) { + if ((agood == 3) && tv->backVol) { + /* + * This means that very soon we'll ask for the BK volume so + * we'll prefetch it (well we did already.) + */ + tv1 = + afs_SetupVolume(tv->backVol, (char *)0, ve, tcell, 0, type, areq); + tv1->refCount--; + } + if ((agood >= 2) && tv->roVol) { /* * This means that very soon we'll ask for the RO volume so * we'll prefetch it (well we did already.) */ - tv1 = afs_SetupVolume(tv->roVol, (char *)0, ve, tcell, 0, type, areq); + tv1 = afs_SetupVolume(tv->roVol, NULL, ve, tcell, 0, type, areq); tv1->refCount--; } osi_FreeLargeSpace(tbuffer); afs_PutCell(tcell, READ_LOCK); return tv; -} /*afs_NewVolumeByName*/ +} /*afs_NewVolumeByName */ /* call this with the volume structure locked; used for new-style vldb requests */ -void InstallVolumeEntry(struct volume *av, struct vldbentry *ve, int acell) +void +InstallVolumeEntry(struct volume *av, struct vldbentry *ve, int acell) { register struct server *ts; struct cell *cellp; @@ -747,24 +727,23 @@ void InstallVolumeEntry(struct volume *av, struct vldbentry *ve, int acell) /* Determine the type of volume we want */ if ((ve->flags & VLF_RWEXISTS) && (av->volume == ve->volumeId[RWVOL])) { - mask = VLSF_RWVOL; - } - else if ((ve->flags & VLF_ROEXISTS) && (av->volume == ve->volumeId[ROVOL])) { - mask = VLSF_ROVOL; - av->states |= VRO; - } - else if ((ve->flags & VLF_BACKEXISTS) && (av->volume == ve->volumeId[BACKVOL])) { - /* backup always is on the same volume as parent */ - mask = VLSF_RWVOL; - av->states |= (VRO|VBackup); - } - else { - mask = 0; /* Can't find volume in vldb entry */ + mask = VLSF_RWVOL; + } else if ((ve->flags & VLF_ROEXISTS) + && (av->volume == ve->volumeId[ROVOL])) { + mask = VLSF_ROVOL; + av->states |= VRO; + } else if ((ve->flags & VLF_BACKEXISTS) + && (av->volume == ve->volumeId[BACKVOL])) { + /* backup always is on the same volume as parent */ + mask = VLSF_RWVOL; + av->states |= (VRO | VBackup); + } else { + mask = 0; /* Can't find volume in vldb entry */ } /* fill in volume types */ - av->rwVol = ((ve->flags & VLF_RWEXISTS) ? ve->volumeId[RWVOL] : 0); - av->roVol = ((ve->flags & VLF_ROEXISTS) ? ve->volumeId[ROVOL] : 0); + av->rwVol = ((ve->flags & VLF_RWEXISTS) ? ve->volumeId[RWVOL] : 0); + av->roVol = ((ve->flags & VLF_ROEXISTS) ? ve->volumeId[ROVOL] : 0); av->backVol = ((ve->flags & VLF_BACKEXISTS) ? ve->volumeId[BACKVOL] : 0); if (ve->flags & VLF_DFSFILESET) @@ -772,14 +751,25 @@ void InstallVolumeEntry(struct volume *av, struct vldbentry *ve, int acell) cellp = afs_GetCell(acell, 0); + /* This volume, av, is locked. Zero out the serverHosts[] array + * so that if afs_GetServer() decides to replace the server + * struct, we don't deadlock trying to afs_ResetVolumeInfo() + * this volume. + */ + for (j = 0; j < MAXHOSTS; j++) { + av->serverHost[j] = 0; + } + /* Step through the VLDB entry making sure each server listed is there */ - for (i=0,j=0; inServers; i++) { - if ( ((ve->serverFlags[i] & mask) == 0) || (ve->serverFlags[i] & VLSF_DONTUSE) ) { - continue; /* wrong volume or don't use this volume */ + for (i = 0, j = 0; i < ve->nServers; i++) { + if (((ve->serverFlags[i] & mask) == 0) + || (ve->serverFlags[i] & VLSF_DONTUSE)) { + continue; /* wrong volume or don't use this volume */ } temp = htonl(ve->serverNumber[i]); - ts = afs_GetServer(&temp, 1, acell, cellp->fsport, WRITE_LOCK, (afsUUID *)0, 0); + ts = afs_GetServer(&temp, 1, acell, cellp->fsport, WRITE_LOCK, + (afsUUID *) 0, 0); av->serverHost[j] = ts; /* @@ -789,7 +779,7 @@ void InstallVolumeEntry(struct volume *av, struct vldbentry *ve, int acell) * follows later on it will find the server entry thus it will * simply return without setting any fields, so we set the * field ourselves below. - */ + */ if (!ts->cell) ts->cell = cellp; afs_PutServer(ts, WRITE_LOCK); @@ -799,10 +789,11 @@ void InstallVolumeEntry(struct volume *av, struct vldbentry *ve, int acell) av->serverHost[j++] = 0; } afs_SortServers(av->serverHost, MAXHOSTS); -} /*InstallVolumeEntry*/ +} /*InstallVolumeEntry */ -void InstallNVolumeEntry(struct volume *av, struct nvldbentry *ve, int acell) +void +InstallNVolumeEntry(struct volume *av, struct nvldbentry *ve, int acell) { register struct server *ts; struct cell *cellp; @@ -814,24 +805,23 @@ void InstallNVolumeEntry(struct volume *av, struct nvldbentry *ve, int acell) /* Determine type of volume we want */ if ((ve->flags & VLF_RWEXISTS) && (av->volume == ve->volumeId[RWVOL])) { - mask = VLSF_RWVOL; - } - else if ((ve->flags & VLF_ROEXISTS) && (av->volume == ve->volumeId[ROVOL])) { - mask = VLSF_ROVOL; - av->states |= VRO; - } - else if ((ve->flags&VLF_BACKEXISTS) && (av->volume == ve->volumeId[BACKVOL])) { - /* backup always is on the same volume as parent */ - mask = VLSF_RWVOL; - av->states |= (VRO|VBackup); - } - else { - mask = 0; /* Can't find volume in vldb entry */ + mask = VLSF_RWVOL; + } else if ((ve->flags & VLF_ROEXISTS) + && (av->volume == ve->volumeId[ROVOL])) { + mask = VLSF_ROVOL; + av->states |= VRO; + } else if ((ve->flags & VLF_BACKEXISTS) + && (av->volume == ve->volumeId[BACKVOL])) { + /* backup always is on the same volume as parent */ + mask = VLSF_RWVOL; + av->states |= (VRO | VBackup); + } else { + mask = 0; /* Can't find volume in vldb entry */ } /* fill in volume types */ - av->rwVol = ((ve->flags & VLF_RWEXISTS) ? ve->volumeId[RWVOL] : 0); - av->roVol = ((ve->flags & VLF_ROEXISTS) ? ve->volumeId[ROVOL] : 0); + av->rwVol = ((ve->flags & VLF_RWEXISTS) ? ve->volumeId[RWVOL] : 0); + av->roVol = ((ve->flags & VLF_ROEXISTS) ? ve->volumeId[ROVOL] : 0); av->backVol = ((ve->flags & VLF_BACKEXISTS) ? ve->volumeId[BACKVOL] : 0); if (ve->flags & VLF_DFSFILESET) @@ -839,14 +829,25 @@ void InstallNVolumeEntry(struct volume *av, struct nvldbentry *ve, int acell) cellp = afs_GetCell(acell, 0); + /* This volume, av, is locked. Zero out the serverHosts[] array + * so that if afs_GetServer() decides to replace the server + * struct, we don't deadlock trying to afs_ResetVolumeInfo() + * this volume. + */ + for (j = 0; j < MAXHOSTS; j++) { + av->serverHost[j] = 0; + } + /* Step through the VLDB entry making sure each server listed is there */ - for (i=0,j=0; inServers; i++) { - if ( ((ve->serverFlags[i] & mask) == 0) || (ve->serverFlags[i] & VLSF_DONTUSE) ) { - continue; /* wrong volume or don't use this volume */ + for (i = 0, j = 0; i < ve->nServers; i++) { + if (((ve->serverFlags[i] & mask) == 0) + || (ve->serverFlags[i] & VLSF_DONTUSE)) { + continue; /* wrong volume or don't use this volume */ } temp = htonl(ve->serverNumber[i]); - ts = afs_GetServer(&temp, 1, acell, cellp->fsport, WRITE_LOCK, (afsUUID *)0,0); + ts = afs_GetServer(&temp, 1, acell, cellp->fsport, WRITE_LOCK, + (afsUUID *) 0, 0); av->serverHost[j] = ts; /* * The cell field could be 0 if the server entry was created @@ -855,7 +856,7 @@ void InstallNVolumeEntry(struct volume *av, struct nvldbentry *ve, int acell) * follows later on it will find the server entry thus it will * simply return without setting any fields, so we set the * field ourselves below. - */ + */ if (!ts->cell) ts->cell = cellp; afs_PutServer(ts, WRITE_LOCK); @@ -865,43 +866,42 @@ void InstallNVolumeEntry(struct volume *av, struct nvldbentry *ve, int acell) av->serverHost[j++] = 0; } afs_SortServers(av->serverHost, MAXHOSTS); -} /*InstallNVolumeEntry*/ +} /*InstallNVolumeEntry */ -void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, - int acell, struct cell *tcell, struct vrequest *areq) +void +InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, int acell, + struct cell *tcell, struct vrequest *areq) { - register struct srvAddr *sa; register struct server *ts; struct conn *tconn; struct cell *cellp; register int i, j; afs_uint32 serverid; afs_int32 mask; - int hash, k; + int k; AFS_STATCNT(InstallVolumeEntry); /* Determine type of volume we want */ if ((ve->flags & VLF_RWEXISTS) && (av->volume == ve->volumeId[RWVOL])) { - mask = VLSF_RWVOL; - } - else if ((ve->flags & VLF_ROEXISTS) && av->volume == ve->volumeId[ROVOL]) { - mask = VLSF_ROVOL; - av->states |= VRO; - } - else if ((ve->flags & VLF_BACKEXISTS) && (av->volume == ve->volumeId[BACKVOL])) { - /* backup always is on the same volume as parent */ - mask = VLSF_RWVOL; - av->states |= (VRO|VBackup); - } - else { - mask = 0; /* Can't find volume in vldb entry */ + mask = VLSF_RWVOL; + } else if ((ve->flags & VLF_ROEXISTS) + && av->volume == ve->volumeId[ROVOL]) { + mask = VLSF_ROVOL; + av->states |= VRO; + } else if ((ve->flags & VLF_BACKEXISTS) + && (av->volume == ve->volumeId[BACKVOL])) { + /* backup always is on the same volume as parent */ + mask = VLSF_RWVOL; + av->states |= (VRO | VBackup); + } else { + mask = 0; /* Can't find volume in vldb entry */ } /* fill in volume types */ - av->rwVol = ((ve->flags & VLF_RWEXISTS) ? ve->volumeId[RWVOL] : 0); - av->roVol = ((ve->flags & VLF_ROEXISTS) ? ve->volumeId[ROVOL] : 0); + av->rwVol = ((ve->flags & VLF_RWEXISTS) ? ve->volumeId[RWVOL] : 0); + av->roVol = ((ve->flags & VLF_ROEXISTS) ? ve->volumeId[ROVOL] : 0); av->backVol = ((ve->flags & VLF_BACKEXISTS) ? ve->volumeId[BACKVOL] : 0); if (ve->flags & VLF_DFSFILESET) @@ -914,8 +914,8 @@ void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, * struct, we don't deadlock trying to afs_ResetVolumeInfo() * this volume. */ - for (j=0; jserverHost[j] = 0; + for (j = 0; j < MAXHOSTS; j++) { + av->serverHost[j] = 0; } /* Gather the list of servers the VLDB says the volume is on @@ -923,19 +923,22 @@ void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, * is not found, then get the list of addresses for the * server, VL_GetAddrsU(), and create a server struct, afs_GetServer(). */ - for (i=0,j=0; inServers; i++) { - if ( ((ve->serverFlags[i] & mask) == 0) || (ve->serverFlags[i] & VLSF_DONTUSE) ) { - continue; /* wrong volume don't use this volume */ + for (i = 0, j = 0; i < ve->nServers; i++) { + if (((ve->serverFlags[i] & mask) == 0) + || (ve->serverFlags[i] & VLSF_DONTUSE)) { + continue; /* wrong volume don't use this volume */ } if (!(ve->serverFlags[i] & VLSERVER_FLAG_UUID)) { /* The server has no uuid */ serverid = htonl(ve->serverNumber[i].time_low); - ts = afs_GetServer(&serverid, 1, acell, cellp->fsport, WRITE_LOCK, (afsUUID *)0,0); + ts = afs_GetServer(&serverid, 1, acell, cellp->fsport, WRITE_LOCK, + (afsUUID *) 0, 0); } else { ts = afs_FindServer(0, cellp->fsport, &ve->serverNumber[i], 0); - if (ts && (ts->sr_addr_uniquifier == ve->serverUnique[i]) && ts->addr) { - /* uuid, uniquifier, and portal are the same */ + if (ts && (ts->sr_addr_uniquifier == ve->serverUnique[i]) + && ts->addr) { + /* uuid, uniquifier, and portal are the same */ } else { afs_uint32 *addrp, nentries, code, unique; bulkaddrs addrs; @@ -948,16 +951,15 @@ void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, memset((char *)&uuid, 0, sizeof(uuid)); memset((char *)&addrs, 0, sizeof(addrs)); do { - tconn = afs_ConnByMHosts(tcell->cellHosts, tcell->vlport, - tcell->cellNum, areq, SHARED_LOCK); + tconn = + afs_ConnByMHosts(tcell->cellHosts, tcell->vlport, + tcell->cellNum, areq, SHARED_LOCK); if (tconn) { -#ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS */ - code = VL_GetAddrsU(tconn->id, &attrs, &uuid, &unique, &nentries, &addrs); -#ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); -#endif /* RX_ENABLE_LOCKS */ + RX_AFS_GUNLOCK(); + code = + VL_GetAddrsU(tconn->id, &attrs, &uuid, &unique, + &nentries, &addrs); + RX_AFS_GLOCK(); } else { code = -1; } @@ -966,8 +968,8 @@ void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, if (code == 0 && nentries == 0) code = VL_NOENT; - } while (afs_Analyze(tconn, code, (struct VenusFid *) 0, areq, - -1, SHARED_LOCK, tcell)); + } while (afs_Analyze + (tconn, code, NULL, areq, -1, SHARED_LOCK, tcell)); if (code) { /* Better handing of such failures; for now we'll simply retry this call */ areq->volumeError = 1; @@ -976,12 +978,13 @@ void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, addrp = addrs.bulkaddrs_val; for (k = 0; k < nentries; k++) { - addrp[k] = htonl(addrp[k]); + addrp[k] = htonl(addrp[k]); } ts = afs_GetServer(addrp, nentries, acell, cellp->fsport, WRITE_LOCK, &ve->serverNumber[i], ve->serverUnique[i]); - afs_osi_Free(addrs.bulkaddrs_val, addrs.bulkaddrs_len*sizeof(*addrp)); + afs_osi_Free(addrs.bulkaddrs_val, + addrs.bulkaddrs_len * sizeof(*addrp)); } } av->serverHost[j] = ts; @@ -992,7 +995,7 @@ void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, * follows later on it will find the server entry thus it will * simply return without setting any fields, so we set the * field ourselves below. - */ + */ if (!ts->cell) ts->cell = cellp; afs_PutServer(ts, WRITE_LOCK); @@ -1000,21 +1003,22 @@ void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, } afs_SortServers(av->serverHost, MAXHOSTS); -} /*InstallVolumeEntry*/ +} /*InstallVolumeEntry */ -void afs_ResetVolumeInfo(struct volume *tv) +void +afs_ResetVolumeInfo(struct volume *tv) { int i; AFS_STATCNT(afs_ResetVolumeInfo); - ObtainWriteLock(&tv->lock,117); + ObtainWriteLock(&tv->lock, 117); tv->states |= VRecheck; - for (i=0; istatus[i] = not_busy; + for (i = 0; i < MAXHOSTS; i++) + tv->status[i] = not_busy; if (tv->name) { - afs_osi_Free(tv->name, strlen(tv->name)+1); - tv->name = (char *) 0; - } + afs_osi_Free(tv->name, strlen(tv->name) + 1); + tv->name = NULL; + } ReleaseWriteLock(&tv->lock); -} /*afs_ResetVolumeInfo*/ +} diff --git a/src/afs/afsincludes.h b/src/afs/afsincludes.h index 613d996f1..98bb63351 100644 --- a/src/afs/afsincludes.h +++ b/src/afs/afsincludes.h @@ -7,30 +7,34 @@ * directory or online at http://www.openafs.org/dl/license10.html */ +#ifdef UKERNEL +#include +#else + #include /* AFS based headers */ -#include "../afs/stds.h" +#include "afs/stds.h" #ifdef AFS_AIX_ENV -#include "../afs/osi_vfs.h" +#include "osi_vfs.h" #else #ifdef AFS_DEC_ENV -#include "../afs/gfs_vfs.h" -#include "../afs/gfs_vnode.h" +#include "afs/gfs_vfs.h" +#include "afs/gfs_vnode.h" #else #ifdef AFS_HPUX_ENV -#include "../afs/osi_vfs.h" +#include "osi_vfs.h" #endif /* AFS_HPUX_ENV */ #endif /* AFS_DEC_ENV */ #endif /* AFS_AIX_ENV */ #if defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) -#include "../afs/osi_vfs.h" +#include "osi_vfs.h" #endif -#include "../afs/afs_osi.h" -#include "../rx/rx.h" -#include "../afs/lock.h" -#include "../afs/volerrors.h" -#include "../afs/voldefs.h" +#include "rx/rx.h" +#include "afs/afs_osi.h" +#include "afs/lock.h" +#include "afs/volerrors.h" +#include "afs/voldefs.h" #ifdef AFS_LINUX20_ENV #ifdef TRUE #undef TRUE @@ -41,18 +45,21 @@ #undef __NFDBITS #undef __FDMASK #endif -#include "../afsint/afsint.h" -#include "../afs/exporter.h" -#include "../afsint/vldbint.h" -#include "../afs/afs.h" -#include "../afs/afs_chunkops.h" -/*#include "../afs/auxinode.h" -- used only in afs_istuff.c */ -#include "../afs/rxkad.h" -#include "../afs/prs_fs.h" -#include "../afs/dir.h" -#include "../afs/afs_axscache.h" -#include "../afs/icl.h" -#include "../afs/afs_prototypes.h" +#include "afsint.h" +#include "afs/exporter.h" +#include "vldbint.h" +#include "afs/afs.h" +#include "afs/afs_chunkops.h" +/*#include "afs/auxinode.h" -- used only in afs_istuff.c */ +#include "rx/rxkad.h" +#include "afs/prs_fs.h" +#include "afs/dir.h" +#include "afs/afs_axscache.h" +#include "afs/icl.h" +#include "afs/afs_stats.h" +#include "afs/afs_prototypes.h" #if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) -#include "../afs/osi_machdep.h" +#include "osi_machdep.h" +#endif + #endif diff --git a/src/afs/exporter.h b/src/afs/exporter.h index fa3745cac..61371b46a 100644 --- a/src/afs/exporter.h +++ b/src/afs/exporter.h @@ -34,12 +34,12 @@ */ #if defined(AFS_SUN57_64BIT_ENV) || defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZPTR==64)) || defined(AFS_LINUX_64BIT_KERNEL) -#define AFS_XLATOR_MAGIC 0x8765 /* XXX */ +#define AFS_XLATOR_MAGIC 0x8765 /* XXX */ #else #define AFS_XLATOR_MAGIC 0x87654321 #endif -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) #define AFS_NFSXLATORREQ(cred) 0 #else #ifdef AFS_OSF_ENV @@ -49,34 +49,34 @@ #endif #endif -struct exporterops { - int (*export_reqhandler)(); - int (*export_hold)(); - int (*export_rele)(); - int (*export_sysname)(); - int (*export_garbagecollect)(); - int (*export_statistics)(); +struct exporterops { + int (*export_reqhandler) (); + int (*export_hold) (); + int (*export_rele) (); + int (*export_sysname) (); + int (*export_garbagecollect) (); + int (*export_statistics) (); }; struct exporterstats { - afs_int32 calls; /* # of calls to the exporter */ - afs_int32 rejectedcalls; /* # of afs rejected calls */ - afs_int32 nopag; /* # of unpagged remote calls */ - afs_int32 invalidpag; /* # of invalid pag calls */ + afs_int32 calls; /* # of calls to the exporter */ + afs_int32 rejectedcalls; /* # of afs rejected calls */ + afs_int32 nopag; /* # of unpagged remote calls */ + afs_int32 invalidpag; /* # of invalid pag calls */ }; struct afs_exporter { - struct afs_exporter *exp_next; - struct exporterops *exp_op; - afs_int32 exp_states; - afs_int32 exp_type; - struct exporterstats exp_stats; - char *exp_data; + struct afs_exporter *exp_next; + struct exporterops *exp_op; + afs_int32 exp_states; + afs_int32 exp_type; + struct exporterstats exp_stats; + char *exp_data; }; /* exp_type values */ -#define EXP_NULL 0 /* Undefined */ -#define EXP_NFS 1 /* Nfs/Afs translator */ +#define EXP_NULL 0 /* Undefined */ +#define EXP_NFS 1 /* Nfs/Afs translator */ /* exp_states values */ #define EXP_EXPORTED 1 @@ -93,8 +93,8 @@ struct afs_exporter { (*(EXP)->exp_op->export_hold)(EXP) #define EXP_RELE(EXP) \ (*(EXP)->exp_op->export_rele)(EXP) -#define EXP_SYSNAME(EXP, INNAME, OUTNAME) \ - (*(EXP)->exp_op->export_sysname)(EXP, INNAME, OUTNAME) +#define EXP_SYSNAME(EXP, INNAME, OUTNAME, NUM) \ + (*(EXP)->exp_op->export_sysname)(EXP, INNAME, OUTNAME, NUM) #define EXP_GC(EXP, param) \ (*(EXP)->exp_op->export_garbagecollect)(EXP, param) #define EXP_STATISTICS(EXP) \ diff --git a/src/afs/libafsdep b/src/afs/libafsdep new file mode 100644 index 000000000..6c2baf272 --- /dev/null +++ b/src/afs/libafsdep @@ -0,0 +1,4 @@ +MKAFS_OSTYPE/*.[chs] +MKAFS_OSTYPE/*.hin +VNOPS/*.[chs] +*.[chs] diff --git a/src/afs/lock.h b/src/afs/lock.h index 02adc8629..4b449d7e1 100644 --- a/src/afs/lock.h +++ b/src/afs/lock.h @@ -10,42 +10,35 @@ #ifndef __AFSLOCK_INCLUDE__ #define __AFSLOCK_INCLUDE__ 1 +#if !defined(KERNEL) && !defined(KDUMP_KERNEL) +#error Do not include afs/lock.h except for kernel code. +#endif + /* * (C) COPYRIGHT IBM CORPORATION 1987 * LICENSED MATERIALS - PROPERTY OF IBM */ -/* The following macros allow multi statement macros to be defined safely, i.e. - - the multi statement macro can be the object of an if statement; - - the call to the multi statement macro may be legally followed by a semi-colon. - BEGINMAC and ENDMAC have been tested with both the portable C compiler and - Hi-C. Both compilers were from the Palo Alto 4.2BSD software releases, and - both optimized out the constant loop code. For an example of the use - of BEGINMAC and ENDMAC, see the definition for ReleaseWriteLock, below. - An alternative to this, using "if(1)" for BEGINMAC is not used because it - may generate worse code with pcc, and may generate warning messages with hi-C. -*/ - #if (defined(AFS_SUN5_ENV)) || defined(AFS_OSF_ENV) #define AFS_NOBOZO_LOCK #endif #if !defined(AFS_OSF20_ENV) || defined(AFS_OSF30_ENV) || defined(AFS_OSF32_ENV) /* We do not instrument locks on osf20 because the vcache structure - ** exceeds the maximim possible limit for a vnode. - */ + ** exceeds the maximim possible limit for a vnode. + */ #define INSTRUMENT_LOCKS /* This is the max lock number in use. Please update it if you add any new * lock numbers. */ -#define MAX_LOCK_NUMBER 572 -#endif +#define MAX_LOCK_NUMBER 700 +#endif struct afs_bozoLock { - short count; /* count of excl locks */ - char flags; /* bit 1: is anyone waiting? */ - char spare; /* for later */ - char *proc; /* process holding the lock, really a struct proc * */ + short count; /* count of excl locks */ + char flags; /* bit 1: is anyone waiting? */ + char spare; /* for later */ + char *proc; /* process holding the lock, really a struct proc * */ }; #ifndef AFS_NOBOZO_LOCK typedef struct afs_bozoLock afs_bozoLock_t; @@ -62,7 +55,7 @@ typedef struct afs_bozoLock afs_bozoLock_t; #define afs_CheckBozonLockBlocking(lock) 0 #endif -#define AFS_BOZONWAITING 1 /* someone is waiting for this lock */ +#define AFS_BOZONWAITING 1 /* someone is waiting for this lock */ #undef MObtainWriteLock /* Defined also in ../rx/rx_machdep.h" */ #undef MReleaseWriteLock @@ -83,6 +76,17 @@ typedef struct afs_bozoLock afs_bozoLock_t; #undef LOCK_INIT #define LOCK_INIT(lock, nm) Lock_Init(lock) +/* The following macros allow multi statement macros to be defined safely, i.e. + - the multi statement macro can be the object of an if statement; + - the call to the multi statement macro may be legally followed by a semi-colon. + BEGINMAC and ENDMAC have been tested with both the portable C compiler and + Hi-C. Both compilers were from the Palo Alto 4.2BSD software releases, and + both optimized out the constant loop code. For an example of the use + of BEGINMAC and ENDMAC, see the definition for ReleaseWriteLock, below. + An alternative to this, using "if(1)" for BEGINMAC is not used because it + may generate worse code with pcc, and may generate warning messages with hi-C. +*/ + #define BEGINMAC do { #define ENDMAC } while (0) @@ -119,26 +123,26 @@ extern tid_t thread_self(); #endif /* AFS_SGI64_ENV */ #endif /* AFS_HPUX101_ENV */ #endif /* AFS_AIX41_ENV */ -#endif +#endif /* all locks wait on excl_locked except for READ_LOCK, which waits on readers_reading */ struct afs_lock { - unsigned char wait_states; /* type of lockers waiting */ - unsigned char excl_locked; /* anyone have boosted, shared or write lock? */ - unsigned short readers_reading;/* # readers actually with read locks */ - unsigned short num_waiting; /* probably need this soon */ - unsigned short spare; /* not used now */ - osi_timeval_t time_waiting; /* for statistics gathering */ + unsigned char wait_states; /* type of lockers waiting */ + unsigned char excl_locked; /* anyone have boosted, shared or write lock? */ + unsigned short readers_reading; /* # readers actually with read locks */ + unsigned short num_waiting; /* probably need this soon */ + unsigned short spare; /* not used now */ + osi_timeval_t time_waiting; /* for statistics gathering */ #if defined(INSTRUMENT_LOCKS) /* the following are useful for debugging - ** the field 'src_indicator' is updated only by ObtainLock() and - ** only for writes/shared locks. Hence, it indictes where in the - ** source code the shared/write lock was set. - */ - unsigned int pid_last_reader;/* proceess id of last reader */ - unsigned int pid_writer; /* process id of writer, else 0 */ - unsigned int src_indicator; /* third param to ObtainLock()*/ -#endif /* INSTRUMENT_LOCKS */ + ** the field 'src_indicator' is updated only by ObtainLock() and + ** only for writes/shared locks. Hence, it indictes where in the + ** source code the shared/write lock was set. + */ + unsigned int pid_last_reader; /* proceess id of last reader */ + unsigned int pid_writer; /* process id of writer, else 0 */ + unsigned int src_indicator; /* third param to ObtainLock() */ +#endif /* INSTRUMENT_LOCKS */ }; typedef struct afs_lock afs_lock_t; typedef struct afs_lock afs_rwlock_t; @@ -156,11 +160,20 @@ typedef struct afs_lock afs_rwlock_t; #include "icl.h" extern int afs_trclock; + +#define AFS_LOCK_TRACE_ENABLE 0 +#if AFS_LOCK_TRACE_ENABLE +#define AFS_LOCK_TRACE(op, lock, type) \ + if (afs_trclock) Afs_Lock_Trace(op, lock, type, __FILE__, __LINE__); +#else +#define AFS_LOCK_TRACE(op, lock, type) +#endif + #if defined(INSTRUMENT_LOCKS) #define ObtainReadLock(lock)\ BEGINMAC \ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKOBTAIN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)READ_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKOBTAIN, lock, READ_LOCK);\ if (!((lock)->excl_locked & WRITE_LOCK)) \ ((lock)->readers_reading)++; \ else \ @@ -170,7 +183,7 @@ extern int afs_trclock; #define ObtainWriteLock(lock, src)\ BEGINMAC \ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKOBTAIN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)WRITE_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKOBTAIN, lock, WRITE_LOCK);\ if (!(lock)->excl_locked && !(lock)->readers_reading)\ (lock) -> excl_locked = WRITE_LOCK;\ else\ @@ -183,7 +196,7 @@ extern int afs_trclock; #define ObtainSharedLock(lock, src)\ BEGINMAC \ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKOBTAIN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)SHARED_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKOBTAIN, lock, SHARED_LOCK);\ if (!(lock)->excl_locked)\ (lock) -> excl_locked = SHARED_LOCK;\ else\ @@ -196,7 +209,7 @@ extern int afs_trclock; #define UpgradeSToWLock(lock, src)\ BEGINMAC \ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKOBTAIN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)BOOSTED_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKOBTAIN, lock, BOOSTED_LOCK);\ if (!(lock)->readers_reading)\ (lock)->excl_locked = WRITE_LOCK;\ else\ @@ -208,7 +221,7 @@ extern int afs_trclock; /* this must only be called with a WRITE or boosted SHARED lock! */ #define ConvertWToSLock(lock)\ BEGINMAC\ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKDOWN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)SHARED_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKDOWN, lock, SHARED_LOCK);\ (lock)->excl_locked = SHARED_LOCK; \ if((lock)->wait_states) \ Afs_Lock_ReleaseR(lock); \ @@ -216,7 +229,7 @@ extern int afs_trclock; #define ConvertWToRLock(lock) \ BEGINMAC\ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKDOWN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)READ_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKDOWN, lock, READ_LOCK);\ (lock)->excl_locked &= ~(SHARED_LOCK | WRITE_LOCK);\ ((lock)->readers_reading)++;\ (lock)->pid_last_reader = MyPidxx ; \ @@ -226,7 +239,7 @@ extern int afs_trclock; #define ConvertSToRLock(lock) \ BEGINMAC\ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKDOWN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)READ_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKDOWN, lock, READ_LOCK);\ (lock)->excl_locked &= ~(SHARED_LOCK | WRITE_LOCK);\ ((lock)->readers_reading)++;\ (lock)->pid_last_reader = MyPidxx ; \ @@ -236,7 +249,7 @@ extern int afs_trclock; #define ReleaseReadLock(lock)\ BEGINMAC\ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKDONE, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)READ_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKDONE, lock, READ_LOCK);\ if (!(--((lock)->readers_reading)) && (lock)->wait_states)\ Afs_Lock_ReleaseW(lock) ; \ if ( (lock)->pid_last_reader == MyPidxx ) \ @@ -245,7 +258,7 @@ extern int afs_trclock; #define ReleaseWriteLock(lock)\ BEGINMAC\ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKDONE, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)WRITE_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKDONE, lock, WRITE_LOCK);\ (lock)->excl_locked &= ~WRITE_LOCK;\ if ((lock)->wait_states) Afs_Lock_ReleaseR(lock);\ (lock)->pid_writer=0; \ @@ -254,7 +267,7 @@ extern int afs_trclock; /* can be used on shared or boosted (write) locks */ #define ReleaseSharedLock(lock)\ BEGINMAC\ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKDONE, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)SHARED_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKDONE, lock, SHARED_LOCK);\ (lock)->excl_locked &= ~(SHARED_LOCK | WRITE_LOCK);\ if ((lock)->wait_states) Afs_Lock_ReleaseR(lock);\ (lock)->pid_writer=0; \ @@ -264,7 +277,7 @@ extern int afs_trclock; #define ObtainReadLock(lock)\ BEGINMAC \ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKOBTAIN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)READ_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKOBTAIN, lock, READ_LOCK);\ if (!((lock)->excl_locked & WRITE_LOCK)) \ ((lock)->readers_reading)++; \ else \ @@ -273,7 +286,7 @@ extern int afs_trclock; #define ObtainWriteLock(lock, src)\ BEGINMAC \ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKOBTAIN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)WRITE_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKOBTAIN, lock, WRITE_LOCK);\ if (!(lock)->excl_locked && !(lock)->readers_reading)\ (lock) -> excl_locked = WRITE_LOCK;\ else\ @@ -284,7 +297,7 @@ extern int afs_trclock; #define ObtainSharedLock(lock, src)\ BEGINMAC \ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKOBTAIN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)SHARED_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKOBTAIN, lock, SHARED_LOCK);\ if (!(lock)->excl_locked)\ (lock) -> excl_locked = SHARED_LOCK;\ else\ @@ -292,10 +305,10 @@ extern int afs_trclock; ENDMAC #define NBObtainSharedLock(lock, src) (((lock)->excl_locked) ? EWOULDBLOCK : (((lock) -> excl_locked = SHARED_LOCK), 0)) - + #define UpgradeSToWLock(lock, src)\ BEGINMAC \ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKOBTAIN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)BOOSTED_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKOBTAIN, lock, BOOSTED_LOCK);\ if (!(lock)->readers_reading)\ (lock)->excl_locked = WRITE_LOCK;\ else\ @@ -305,7 +318,7 @@ extern int afs_trclock; /* this must only be called with a WRITE or boosted SHARED lock! */ #define ConvertWToSLock(lock)\ BEGINMAC\ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKDOWN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)SHARED_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKDOWN, lock, SHARED_LOCK);\ (lock)->excl_locked = SHARED_LOCK; \ if((lock)->wait_states) \ Afs_Lock_ReleaseR(lock); \ @@ -313,7 +326,7 @@ extern int afs_trclock; #define ConvertWToRLock(lock) \ BEGINMAC\ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKDOWN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)READ_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKDOWN, lock, READ_LOCK);\ (lock)->excl_locked &= ~(SHARED_LOCK | WRITE_LOCK);\ ((lock)->readers_reading)++;\ Afs_Lock_ReleaseR(lock);\ @@ -321,7 +334,7 @@ extern int afs_trclock; #define ConvertSToRLock(lock) \ BEGINMAC\ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKDOWN, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)READ_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKDOWN, lock, READ_LOCK);\ (lock)->excl_locked &= ~(SHARED_LOCK | WRITE_LOCK);\ ((lock)->readers_reading)++;\ Afs_Lock_ReleaseR(lock);\ @@ -329,14 +342,14 @@ extern int afs_trclock; #define ReleaseReadLock(lock)\ BEGINMAC\ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKDONE, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)READ_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKDONE, lock, READ_LOCK);\ if (!(--((lock)->readers_reading)) && (lock)->wait_states)\ Afs_Lock_ReleaseW(lock) ; \ ENDMAC #define ReleaseWriteLock(lock)\ BEGINMAC\ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKDONE, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)WRITE_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKDONE, lock, WRITE_LOCK);\ (lock)->excl_locked &= ~WRITE_LOCK;\ if ((lock)->wait_states) Afs_Lock_ReleaseR(lock);\ ENDMAC @@ -344,7 +357,7 @@ extern int afs_trclock; /* can be used on shared or boosted (write) locks */ #define ReleaseSharedLock(lock)\ BEGINMAC\ -/* if (afs_trclock) {icl_Trace2(cm_iclSetp, CM_TRACE_LOCKDONE, ICL_TYPE_POINTER, (long)lock, ICL_TYPE_LONG, (long)SHARED_LOCK);} */ \ + AFS_LOCK_TRACE(CM_TRACE_LOCKDONE, lock, SHARED_LOCK);\ (lock)->excl_locked &= ~(SHARED_LOCK | WRITE_LOCK);\ if ((lock)->wait_states) Afs_Lock_ReleaseR(lock);\ ENDMAC diff --git a/src/afs/longc_procs.h b/src/afs/longc_procs.h index 758d7e94b..6f8d24212 100644 --- a/src/afs/longc_procs.h +++ b/src/afs/longc_procs.h @@ -35,12 +35,12 @@ struct afs_longcall_procs { int (*LC_strncpy) (); int (*LC_flock) (); int (*LC_setgroups) (); - struct ucred * (*LC_crcopy) (); - struct ucred * (*LC_crget) (); + struct ucred *(*LC_crcopy) (); + struct ucred *(*LC_crget) (); int (*LC_crhold) (); int (*LC_ip_stripoptions) (); int (*LC_in_cksum) (); - struct mbuf * (*LC_m_pullup) (); + struct mbuf *(*LC_m_pullup) (); int (*LC_resettodr) (); int (*LC_untimeout) (); int (*LC_timeout) (); @@ -52,13 +52,13 @@ struct afs_longcall_procs { int (*LC_m_freem) (); int (*LC_soclose) (); int (*LC_sobind) (); - struct mbuf * (*LC_m_get) (); + struct mbuf *(*LC_m_get) (); int (*LC_socreate) (); int (*LC_soreserve) (); #if defined(AFS_DECOSF_ENV) int (*LC_getf) (); -#else /* AFS_DECOSF_ENV */ - struct file * (*LC_getf) (); +#else /* AFS_DECOSF_ENV */ + struct file *(*LC_getf) (); #endif int (*LC_splx) (); int (*LC_microtime) (); @@ -72,7 +72,7 @@ struct afs_longcall_procs { int (*LC_gfs_unlock) (); int (*LC_gfs_lock) (); int (*LC_gput) (); - struct inode * (*LC_ufs_galloc) (); + struct inode *(*LC_ufs_galloc) (); int (*LC_gno_close) (); int (*LC_km_alloc) (); int (*LC_km_free) (); @@ -80,14 +80,14 @@ struct afs_longcall_procs { int (*LC_nuxi_l) (); int (*LC_nuxi_s) (); - struct inode * (*LC_gfs_gget) (); + struct inode *(*LC_gfs_gget) (); int (*LC_binval) (); int (*LC_splclock) (); int (*LC_xumount) (); int (*LC_bflush) (); int (*LC_blkclr) (); int (*LC_vmaccess) (); - struct gnode * (*LC_gfs_namei) (); + struct gnode *(*LC_gfs_namei) (); int (*LC_getpdev) (); int (*LC_check_mountp) (); int (*LC_access) (); @@ -96,7 +96,7 @@ struct afs_longcall_procs { int (*LC_imin) (); int (*LC_setjmp) (); - struct gnode * (*LC_gget) (); + struct gnode *(*LC_gget) (); void (*LC_grele) (); void (*LC_gref) (); int (*LC_xdr_char) (); @@ -107,13 +107,13 @@ struct afs_longcall_procs { int (*LC_smp_owner) (); int (*LC_xinval) (); int (*LC_cacheinvalall) (); - int (*LC_psignal)(); - int (*LC_ufs_rwgp_lock)(); + int (*LC_psignal) (); + int (*LC_ufs_rwgp_lock) (); #else int (*LC_iunlock) (); int (*LC_ilock) (); int (*LC_iput) (); - struct inode * (*LC_ialloc) (); + struct inode *(*LC_ialloc) (); int (*LC_vno_close) (); int (*LC_kmem_alloc) (); int (*LC_kmem_free) (); @@ -125,22 +125,22 @@ struct afs_longcall_procs { int (*LC_vn_rele) (); int (*LC_vn_rdwr) (); int (*LC_mapout) (); - struct mount * (*LC_getmp) (); - struct inode * (*LC_iget) (); - struct mbuf * (*LC_m_more) (); + struct mount *(*LC_getmp) (); + struct inode *(*LC_iget) (); + struct mbuf *(*LC_m_more) (); int (*LC__spl1) (); #endif int (*LC_rdwri) (); - struct file * (*LC_falloc) (); + struct file *(*LC_falloc) (); int (*LC_rmfree) (); int (*LC_mapin) (); long (*LC_rmalloc) (); - struct pte * (*LC_vtopte) (); + struct pte *(*LC_vtopte) (); int (*LC_vattr_null) (); int (*LC_strlen) (); int (*LC_bcopy) (); int (*LC_brelse) (); - struct buf * (*LC_geteblk) (); + struct buf *(*LC_geteblk) (); int (*LC_panic) (); int (*LC_strcpy) (); int (*LC_printf) (); @@ -159,16 +159,16 @@ struct afs_longcall_procs { int (*LC_closef) (); int (*LC_fake_inode_init) (); int (*LC_getnewvnode) (); - struct mount * (*LC_getvfs) (); + struct mount *(*LC_getvfs) (); int (*LC_idrop) (); int (*LC_insmntque) (); int (*LC_ioctl_base) (); - caddr_t (*LC_kalloc) (); + caddr_t(*LC_kalloc) (); void (*LC_kfree) (); void (*LC_lock_done) (); - struct mbuf * (*LC_m_getclr) (); - struct mbuf * (*LC_m_retry) (); - struct mbuf * (*LC_m_retryhdr) (); + struct mbuf *(*LC_m_getclr) (); + struct mbuf *(*LC_m_retry) (); + struct mbuf *(*LC_m_retryhdr) (); int (*LC_mpsleep) (); int (*LC_namei) (); unsigned int (*LC_nuxi_32) (); @@ -197,7 +197,7 @@ struct afs_longcall_procs { */ void (*LC_vrele) (); int (*LC_xdr_char) (); -#endif /* AFS_DECOSF_ENV */ +#endif /* AFS_DECOSF_ENV */ }; extern struct afs_longcall_procs afs_longcall_procs; @@ -206,7 +206,7 @@ extern struct afs_longcall_procs afs_longcall_procs; #if defined(AFS_DECOSF_ENV) #undef kmem_alloc #undef kmem_free -#endif /* AFS_DECOSF_ENV */ +#endif /* AFS_DECOSF_ENV */ #define crfree (*afs_longcall_procs.LC_crfree) #define suser (*afs_longcall_procs.LC_suser) @@ -398,7 +398,7 @@ extern struct afs_longcall_procs afs_longcall_procs; */ #define vrele (*afs_longcall_procs.LC_vrele) #define xdr_char (*afs_longcall_procs.LC_xdr_char) -#endif /* AFS_DECOSF_ENV */ +#endif /* AFS_DECOSF_ENV */ #endif /* LONGCALL_NO_MACROS */ diff --git a/src/afs/nfsclient.h b/src/afs/nfsclient.h index e4e4d1d22..0db9d3cda 100644 --- a/src/afs/nfsclient.h +++ b/src/afs/nfsclient.h @@ -12,26 +12,26 @@ #define NNFSCLIENTS 32 /* Hash table size for afs_nfspags table */ #define NHash(host) ((host) & (NNFSCLIENTS-1)) -#define NFSCLIENTGC (24*3600) /* time after which to GC nfsclientpag structs */ +#define NFSCLIENTGC (24*3600) /* time after which to GC nfsclientpag structs */ #define NFSXLATOR_CRED 0xaaaa struct nfsclientpag { /* From here to .... */ - struct nfsclientpag *next; /* Next hash pointer */ - struct exporterops *nfs_ops; + struct nfsclientpag *next; /* Next hash pointer */ + struct exporterops *nfs_ops; afs_int32 states; afs_int32 type; struct exporterstats nfs_stats; /* .... here is also an overlay to the afs_exporter structure */ afs_int32 refCount; /* Ref count for packages using this */ - afs_int32 uid; /* search based on uid and ... */ - afs_int32 host; /* ... nfs client's host ip address */ - afs_int32 pag; /* active pag for all (uid, host) "unpaged" conns */ - char *sysname; /* user's "@sys" value; also kept in unixuser */ + afs_int32 uid; /* search based on uid and ... */ + afs_int32 host; /* ... nfs client's host ip address */ + afs_int32 pag; /* active pag for all (uid, host) "unpaged" conns */ + char *sysname[MAXNUMSYSNAMES];/* user's "@sys" value; also kept in unixuser */ + int sysnamecount; /* number of sysnames */ afs_int32 lastcall; /* Used for timing out nfsclientpag structs */ }; #endif /* __NFSCLIENT__ */ - diff --git a/src/afs/sysincludes.h b/src/afs/sysincludes.h index 4539cf9d2..2146b7e58 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -7,6 +7,10 @@ * directory or online at http://www.openafs.org/dl/license10.html */ +#ifdef UKERNEL +#include +#else + #ifndef __AFS_SYSINCLUDESH__ #define __AFS_SYSINCLUDESH__ 1 @@ -19,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -36,12 +39,15 @@ #include #include #include +#include #include +#ifndef MLEN #include +#include +#endif #include -#include -#include -#include +#include +#include #else /* AFS_OBSD_ENV */ #ifdef AFS_LINUX22_ENV #include @@ -54,14 +60,21 @@ #include #include #include +#if defined(AFS_LINUX26_ENV) +#include +#include +#include +#endif /* Avoid conflicts with coda overloading AFS type namespace. Must precede * inclusion of uaccess.h. */ #define _LINUX_CODA_FS_I #define _CFS_HEADER_ -struct coda_inode_info {}; +struct coda_inode_info { +}; #define _LINUX_XFS_FS_I -struct xfs_inode_info {}; +struct xfs_inode_info { +}; #include #include #include @@ -78,33 +91,38 @@ struct xfs_inode_info {}; #else /* AFS_LINUX22_ENV */ #if defined(AFS_DARWIN_ENV) -#define _MACH_ETAP_H_ -typedef unsigned short etap_event_t; +#ifndef _MACH_ETAP_H_ +#define _MACH_ETAP_H_ +typedef unsigned short etap_event_t; +#endif #endif #if !defined(AFS_OSF_ENV) -#include "../h/errno.h" -#include "../h/types.h" -#include "../h/param.h" +#include "h/errno.h" +#include "h/types.h" +#include "h/param.h" #ifdef AFS_AUX_ENV #ifdef PAGING -#include "../h/mmu.h" -#include "../h/seg.h" -#include "../h/page.h" -#include "../h/region.h" +#include "h/mmu.h" +#include "h/seg.h" +#include "h/page.h" +#include "h/region.h" #endif /* PAGING */ -#include "../h/sysmacros.h" -#include "../h/signal.h" -#include "../h/var.h" +#include "h/sysmacros.h" +#include "h/signal.h" +#include "h/var.h" #endif /* AFS_AUX_ENV */ -#include "../h/systm.h" -#include "../h/time.h" +#include "h/systm.h" +#include "h/time.h" #ifdef AFS_AIX_ENV #ifdef AFS_AIX41_ENV #include "sys/statfs.h" #endif +#ifdef AFS_AIX51_ENV +#include "sys/acl.h" +#endif #include "../h/file.h" #include "../h/fullstat.h" #include "../h/vattr.h" @@ -114,18 +132,18 @@ typedef unsigned short etap_event_t; #if defined(AFS_SGI_ENV) #include "values.h" -#include "../sys/sema.h" -#include "../sys/cmn_err.h" +#include "sys/sema.h" +#include "sys/cmn_err.h" #ifdef AFS_SGI64_ENV #include #endif /* AFS_SGI64_ENV */ -#include "../fs/efs_inode.h" +#include "fs/efs_inode.h" #ifdef AFS_SGI_EFS_IOPS_ENV -#include "../sgiefs/efs.h" +#include "sgiefs/efs.h" #endif -#include "../sys/kmem.h" -#include "../sys/cred.h" -#include "../sys/resource.h" +#include "sys/kmem.h" +#include "sys/cred.h" +#include "sys/resource.h" /* * ../sys/debug.h defines ASSERT(), but it is nontrivial only if DEBUG @@ -138,20 +156,20 @@ typedef unsigned short etap_event_t; */ #if defined(AFS_SGI65_ENV) && !defined(DEBUG) #define DEBUG -#include "../sys/debug.h" +#include "sys/debug.h" #undef DEBUG #else -#include "../sys/debug.h" +#include "sys/debug.h" #endif -#include "../sys/statvfs.h" -#include "../sys/sysmacros.h" -#include "../sys/fs_subr.h" -#include "../sys/siginfo.h" -#endif /* AFS_SGI_ENV */ +#include "sys/statvfs.h" +#include "sys/sysmacros.h" +#include "sys/fs_subr.h" +#include "sys/siginfo.h" +#endif /* AFS_SGI_ENV */ #if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) -# include "../h/kernel.h" +# include "h/kernel.h" #endif /* !SUN5 && !SGI */ #ifdef AFS_SUN5_ENV @@ -159,45 +177,49 @@ typedef unsigned short etap_event_t; #endif #if defined(AFS_SUN56_ENV) -#include "../h/vfs.h" /* stops SUN56 socketvar.h warnings */ -#include "../h/stropts.h" /* stops SUN56 socketvar.h warnings */ -#include "../h/stream.h" /* stops SUN56 socketvar.h errors */ +#include "h/vfs.h" /* stops SUN56 socketvar.h warnings */ +#include "h/stropts.h" /* stops SUN56 socketvar.h warnings */ +#include "h/stream.h" /* stops SUN56 socketvar.h errors */ #endif -#include "../h/socket.h" -#include "../h/socketvar.h" -#include "../h/protosw.h" +#include "h/socket.h" +#include "h/socketvar.h" +#include "h/protosw.h" #if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV) -# include "../h/dirent.h" +# include "h/dirent.h" # ifdef AFS_SUN5_ENV -# include "../h/sysmacros.h" -# include "../h/fs/ufs_fsdir.h" +# include "h/sysmacros.h" +# include "h/fs/ufs_fsdir.h" # endif /* AFS_SUN5_ENV */ #else -# include "../h/dir.h" +# include "h/dir.h" #endif /* SGI || SUN || HPUX */ #ifdef AFS_DEC_ENV -# include "../h/smp_lock.h" +# include "h/smp_lock.h" #endif /* AFS_DEC_ENV */ #if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV) -#include "../h/user.h" +#include "h/user.h" #endif /* AFS_SGI64_ENV */ #define MACH_USER_API 1 -#include "../h/file.h" -#include "../h/uio.h" -#include "../h/buf.h" -#include "../h/stat.h" +#if defined(AFS_FBSD50_ENV) +#include "h/bio.h" +#include "h/filedesc.h" +#endif +#include "h/file.h" +#include "h/uio.h" +#include "h/buf.h" +#include "h/stat.h" /* ----- The following mainly deal with vnodes/inodes stuff ------ */ #ifdef AFS_DEC_ENV -# include "../h/mount.h" -# include "../machine/psl.h" -# include "../afs/gfs_vnode.h" +# include "h/mount.h" +# include "machine/psl.h" +# include "afs/gfs_vnode.h" #endif #ifdef AFS_MACH_ENV @@ -213,23 +235,30 @@ typedef unsigned short etap_event_t; #ifndef AFS_DEC_ENV # ifdef AFS_SUN5_ENV -# include "../h/statvfs.h" +# include "h/statvfs.h" # endif /* AFS_SUN5_ENV */ # ifdef AFS_HPUX_ENV struct vfspage; /* for vnode.h compiler warnings */ -# include "../h/swap.h" /* for struct swpdbd, for vnode.h compiler warnings */ -# include "../h/dbd.h" /* for union idbd, for vnode.h compiler warnings */ +# include "h/swap.h" /* for struct swpdbd, for vnode.h compiler warnings */ +# include "h/dbd.h" /* for union idbd, for vnode.h compiler warnings */ #ifdef AFS_HPUX110_ENV -# include "../h/resource.h" +# include "h/resource.h" +#endif +#ifdef AFS_HPUX1123_ENV +# include +# include #endif # endif /* AFS_HPUX_ENV */ -#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD40_ENV) +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +# if defined(AFS_FBSD50_ENV) +struct vop_getwritemount_args; +# endif # include -# include +# include # include -# include -# include -# include +# include +# include +# include #ifndef AFS_FBSD_ENV # include #define timeout_fcn_t mach_timeout_fcn_t @@ -251,16 +280,16 @@ MALLOC_DECLARE(M_AFS); # include # include #else -# include "../h/vfs.h" -# include "../h/vnode.h" +# include "h/vfs.h" +# include "h/vnode.h" # ifdef AFS_SUN5_ENV -# include "../h/fs/ufs_inode.h" -# include "../h/fs/ufs_mount.h" +# include "h/fs/ufs_inode.h" +# include "h/fs/ufs_mount.h" # else # if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) -# include "../ufs/inode.h" +# include "ufs/inode.h" # if !defined(AFS_SGI_ENV) && !defined(AFS_HPUX_ENV) -# include "../ufs/mount.h" +# include "ufs/mount.h" # endif /* !AFS_HPUX_ENV */ # endif /* !AFS_AIX32_ENV */ # endif /* AFS_SUN5_ENV */ @@ -268,57 +297,57 @@ MALLOC_DECLARE(M_AFS); #endif /* AFS_DEC_ENV */ /* These mainly deal with networking and rpc headers */ -#include "../netinet/in.h" -#undef MFREE /* defined at mount.h for AIX */ +#include "netinet/in.h" +#undef MFREE /* defined at mount.h for AIX */ #ifdef AFS_SUN5_ENV -# include "../h/time.h" +# include "h/time.h" #else #if !defined(AFS_HPUX_ENV) -# include "../h/mbuf.h" +# include "h/mbuf.h" #endif #endif /* AFS_SUN5_ENV */ -#include "../rpc/types.h" -#include "../rx/xdr.h" +#include "rpc/types.h" +#include "rx/xdr.h" #ifdef AFS_AIX32_ENV # include "net/spl.h" #endif /* Miscellaneous headers */ -#include "../h/proc.h" +#include "h/proc.h" #if !defined(AFS_FBSD_ENV) -#include "../h/ioctl.h" +#include "h/ioctl.h" #endif /* AFS_FBSD_ENV */ -#if defined(AFS_HPUX101_ENV) -#include "../h/proc_iface.h" -#include "../h/vas.h" +#if defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV) +#include "h/proc_iface.h" +#include "h/vas.h" #endif #if defined(AFS_HPUX102_ENV) -#include "../h/unistd.h" -#include "../h/tty.h" +#include "h/unistd.h" +#include "h/tty.h" #endif #if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_MACH_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) -# include "../h/text.h" -#endif +# include "h/text.h" +#endif #if defined(AFS_AIX_ENV) || defined(AFS_DEC_ENV) -# include "../h/flock.h" /* fcntl.h is a user-level include in aix */ +# include "h/flock.h" /* fcntl.h is a user-level include in aix */ #else -# include "../h/fcntl.h" +# include "h/fcntl.h" #endif /* AIX || DEC */ #if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) -# include "../h/unistd.h" +# include "h/unistd.h" #endif /* SGI || SUN */ #ifdef AFS_AIX32_ENV -# include "../h/vmuser.h" +# include "h/vmuser.h" #endif /* AFS_AIX32_ENV */ #if defined(AFS_SUN5_ENV) @@ -330,7 +359,7 @@ MALLOC_DECLARE(M_AFS); #include #endif -#else /* ! AFS_OSF_ENV */ +#else /* ! AFS_OSF_ENV */ /* All of the OSF/1 stuff is here */ #include #include @@ -372,14 +401,16 @@ MALLOC_DECLARE(M_AFS); #undef mem_alloc #undef mem_free #undef register -#endif /* AFS_ALPHA_ENV */ +#endif /* AFS_ALPHA_ENV */ #include #include #include -#endif /* AFS_OSF_ENV */ +#endif /* AFS_OSF_ENV */ #endif /* AFS_LINUX22_ENV */ #endif /* AFS_OBSD_ENV */ #endif /* __AFS_SYSINCLUDESH__ so idempotent */ + +#endif diff --git a/src/afs/unified_afs.et b/src/afs/unified_afs.et new file mode 100644 index 000000000..2b56483e6 --- /dev/null +++ b/src/afs/unified_afs.et @@ -0,0 +1,125 @@ +error_table uae + ec UAEPERM, "Operation not permitted" + ec UAENOENT, "No such file or directory" + ec UAESRCH, "No such process" + ec UAEINTR, "Interrupted system call" + ec UAEIO, "I/O error" + ec UAENXIO, "No such device or address" + ec UAE2BIG, "Arg list too long" + ec UAENOEXEC, "Exec format error" + ec UAEBADF, "Bad file number" + ec UAECHILD, "No child processes" + ec UAEAGAIN, "Try again" + ec UAENOMEM, "Out of memory" + ec UAEACCES, "Permission denied" + ec UAEFAULT, "Bad address" + ec UAENOTBLK, "Block device required" + ec UAEBUSY, "Device or resource busy" + ec UAEEXIST, "File exists" + ec UAEXDEV, "Cross-device link" + ec UAENODEV, "No such device" + ec UAENOTDIR, "Not a directory" + ec UAEISDIR, "Is a directory" + ec UAEINVAL, "Invalid argument" + ec UAENFILE, "File table overflow" + ec UAEMFILE, "Too many open files" + ec UAENOTTY, "Not a typewriter" + ec UAETXTBSY, "Text file busy" + ec UAEFBIG, "File too large" + ec UAENOSPC, "No space left on device" + ec UAESPIPE, "Illegal seek" + ec UAEROFS, "Read-only file system" + ec UAEMLINK, "Too many links" + ec UAEPIPE, "Broken pipe" + ec UAEDOM, "Math argument out of domain of func" + ec UAERANGE, "Math result not representable" + ec UAEDEADLK, "Resource deadlock would occur" + ec UAENAMETOOLONG, "File name too long" + ec UAENOLCK, "No record locks available" + ec UAENOSYS, "Function not implemented" + ec UAENOTEMPTY, "Directory not empty" + ec UAELOOP, "Too many symbolic links encountered" + ec UAEWOULDBLOCK, "Operation would block" + ec UAENOMSG, "No message of desired type" + ec UAEIDRM, "Identifier removed" + ec UAECHRNG, "Channel number out of range" + ec UAEL2NSYNC, "Level 2 not synchronized" + ec UAEL3HLT, "Level 3 halted" + ec UAEL3RST, "Level 3 reset" + ec UAELNRNG, "Link number out of range" + ec UAEUNATCH, "Protocol driver not attached" + ec UAENOCSI, "No CSI structure available" + ec UAEL2HLT, "Level 2 halted" + ec UAEBADE, "Invalid exchange" + ec UAEBADR, "Invalid request descriptor" + ec UAEXFULL, "Exchange full" + ec UAENOANO, "No anode" + ec UAEBADRQC, "Invalid request code" + ec UAEBADSLT, "Invalid slot" + ec UAEBFONT, "Bad font file format" + ec UAENOSTR, "Device not a stream" + ec UAENODATA, "No data available" + ec UAETIME, "Timer expired" + ec UAENOSR, "Out of streams resources" + ec UAENONET, "Machine is not on the network" + ec UAENOPKG, "Package not installed" + ec UAEREMOTE, "Object is remote" + ec UAENOLINK, "Link has been severed" + ec UAEADV, "Advertise error" + ec UAESRMNT, "Srmount error" + ec UAECOMM, "Communication error on send" + ec UAEPROTO, "Protocol error" + ec UAEMULTIHOP, "Multihop attempted" + ec UAEDOTDOT, "RFS specific error" + ec UAEBADMSG, "Not a data message" + ec UAEOVERFLOW, "Value too large for defined data type" + ec UAENOTUNIQ, "Name not unique on network" + ec UAEBADFD, "File descriptor in bad state" + ec UAEREMCHG, "Remote address changed" + ec UAELIBACC, "Can not access a needed shared library" + ec UAELIBBAD, "Accessing a corrupted shared library" + ec UAELIBSCN, ".lib section in a.out corrupted" + ec UAELIBMAX, "Attempting to link in too many shared libraries" + ec UAELIBEXEC, "Cannot exec a shared library directly" + ec UAEILSEQ, "Illegal byte sequence" + ec UAERESTART, "Interrupted system call should be restarted" + ec UAESTRPIPE, "Streams pipe error" + ec UAEUSERS, "Too many users" + ec UAENOTSOCK, "Socket operation on non-socket" + ec UAEDESTADDRREQ, "Destination address required" + ec UAEMSGSIZE, "Message too long" + ec UAEPROTOTYPE, "Protocol wrong type for socket" + ec UAENOPROTOOPT, "Protocol not available" + ec UAEPROTONOSUPPORT, "Protocol not supported" + ec UAESOCKTNOSUPPORT, "Socket type not supported" + ec UAEOPNOTSUPP, "Operation not supported on transport endpoint" + ec UAEPFNOSUPPORT, "Protocol family not supported" + ec UAEAFNOSUPPORT, "Address family not supported by protocol" + ec UAEADDRINUSE, "Address already in use" + ec UAEADDRNOTAVAIL, "Cannot assign requested address" + ec UAENETDOWN, "Network is down" + ec UAENETUNREACH, "Network is unreachable" + ec UAENETRESET, "Network dropped connection because of reset" + ec UAECONNABORTED, "Software caused connection abort" + ec UAECONNRESET, "Connection reset by peer" + ec UAENOBUFS, "No buffer space available" + ec UAEISCONN, "Transport endpoint is already connected" + ec UAENOTCONN, "Transport endpoint is not connected" + ec UAESHUTDOWN, "Cannot send after transport endpoint shutdown" + ec UAETOOMANYREFS, "Too many references: cannot splice" + ec UAETIMEDOUT, "Connection timed out" + ec UAECONNREFUSED, "Connection refused" + ec UAEHOSTDOWN, "Host is down" + ec UAEHOSTUNREACH, "No route to host" + ec UAEALREADY, "Operation already in progress" + ec UAEINPROGRESS, "Operation now in progress" + ec UAESTALE, "Stale NFS file handle" + ec UAEUCLEAN, "Structure needs cleaning" + ec UAENOTNAM, "Not a XENIX named type file" + ec UAENAVAIL, "No XENIX semaphores available" + ec UAEISNAM, "Is a named type file" + ec UAEREMOTEIO, "Remote I/O error" + ec UAEDQUOT, "Quota exceeded" + ec UAENOMEDIUM, "No medium found" + ec UAEMEDIUMTYPE, "Wrong medium type" +end diff --git a/src/afs/unified_afs.p.h b/src/afs/unified_afs.p.h new file mode 100644 index 000000000..41558f17a --- /dev/null +++ b/src/afs/unified_afs.p.h @@ -0,0 +1,369 @@ +#ifndef EPERM +#define EPERM 0 +#endif /* EPERM */ +#ifndef ENOENT +#define ENOENT 0 +#endif /* ENOENT */ +#ifndef ESRCH +#define ESRCH 0 +#endif /* ESRCH */ +#ifndef EINTR +#define EINTR 0 +#endif /* EINTR */ +#ifndef EIO +#define EIO 0 +#endif /* EIO */ +#ifndef ENXIO +#define ENXIO 0 +#endif /* ENXIO */ +#ifndef E2BIG +#define E2BIG 0 +#endif /* E2BIG */ +#ifndef ENOEXEC +#define ENOEXEC 0 +#endif /* ENOEXEC */ +#ifndef EBADF +#define EBADF 0 +#endif /* EBADF */ +#ifndef ECHILD +#define ECHILD 0 +#endif /* ECHILD */ +#ifndef EAGAIN +#define EAGAIN 0 +#endif /* EAGAIN */ +#ifndef ENOMEM +#define ENOMEM 0 +#endif /* ENOMEM */ +#ifndef EACCES +#define EACCES 0 +#endif /* EACCES */ +#ifndef EFAULT +#define EFAULT 0 +#endif /* EFAULT */ +#ifndef ENOTBLK +#define ENOTBLK 0 +#endif /* ENOTBLK */ +#ifndef EBUSY +#define EBUSY 0 +#endif /* EBUSY */ +#ifndef EEXIST +#define EEXIST 0 +#endif /* EEXIST */ +#ifndef EXDEV +#define EXDEV 0 +#endif /* EXDEV */ +#ifndef ENODEV +#define ENODEV 0 +#endif /* ENODEV */ +#ifndef ENOTDIR +#define ENOTDIR 0 +#endif /* ENOTDIR */ +#ifndef EISDIR +#define EISDIR 0 +#endif /* EISDIR */ +#ifndef EINVAL +#define EINVAL 0 +#endif /* EINVAL */ +#ifndef ENFILE +#define ENFILE 0 +#endif /* ENFILE */ +#ifndef EMFILE +#define EMFILE 0 +#endif /* EMFILE */ +#ifndef ENOTTY +#define ENOTTY 0 +#endif /* ENOTTY */ +#ifndef ETXTBSY +#define ETXTBSY 0 +#endif /* ETXTBSY */ +#ifndef EFBIG +#define EFBIG 0 +#endif /* EFBIG */ +#ifndef ENOSPC +#define ENOSPC 0 +#endif /* ENOSPC */ +#ifndef ESPIPE +#define ESPIPE 0 +#endif /* ESPIPE */ +#ifndef EROFS +#define EROFS 0 +#endif /* EROFS */ +#ifndef EMLINK +#define EMLINK 0 +#endif /* EMLINK */ +#ifndef EPIPE +#define EPIPE 0 +#endif /* EPIPE */ +#ifndef EDOM +#define EDOM 0 +#endif /* EDOM */ +#ifndef ERANGE +#define ERANGE 0 +#endif /* ERANGE */ +#ifndef EDEADLK +#define EDEADLK 0 +#endif /* EDEADLK */ +#ifndef ENAMETOOLONG +#define ENAMETOOLONG 0 +#endif /* ENAMETOOLONG */ +#ifndef ENOLCK +#define ENOLCK 0 +#endif /* ENOLCK */ +#ifndef ENOSYS +#define ENOSYS 0 +#endif /* ENOSYS */ +#ifndef ENOTEMPTY +#define ENOTEMPTY 0 +#endif /* ENOTEMPTY */ +#ifndef ELOOP +#define ELOOP 0 +#endif /* ELOOP */ +#ifndef EWOULDBLOCK +#define EWOULDBLOCK 0 +#endif /* EWOULDBLOCK */ +#ifndef ENOMSG +#define ENOMSG 0 +#endif /* ENOMSG */ +#ifndef EIDRM +#define EIDRM 0 +#endif /* EIDRM */ +#ifndef ECHRNG +#define ECHRNG 0 +#endif /* ECHRNG */ +#ifndef EL2NSYNC +#define EL2NSYNC 0 +#endif /* EL2NSYNC */ +#ifndef EL3HLT +#define EL3HLT 0 +#endif /* EL3HLT */ +#ifndef EL3RST +#define EL3RST 0 +#endif /* EL3RST */ +#ifndef ELNRNG +#define ELNRNG 0 +#endif /* ELNRNG */ +#ifndef EUNATCH +#define EUNATCH 0 +#endif /* EUNATCH */ +#ifndef ENOCSI +#define ENOCSI 0 +#endif /* ENOCSI */ +#ifndef EL2HLT +#define EL2HLT 0 +#endif /* EL2HLT */ +#ifndef EBADE +#define EBADE 0 +#endif /* EBADE */ +#ifndef EBADR +#define EBADR 0 +#endif /* EBADR */ +#ifndef EXFULL +#define EXFULL 0 +#endif /* EXFULL */ +#ifndef ENOANO +#define ENOANO 0 +#endif /* ENOANO */ +#ifndef EBADRQC +#define EBADRQC 0 +#endif /* EBADRQC */ +#ifndef EBADSLT +#define EBADSLT 0 +#endif /* EBADSLT */ +#ifndef EBFONT +#define EBFONT 0 +#endif /* EBFONT */ +#ifndef ENOSTR +#define ENOSTR 0 +#endif /* ENOSTR */ +#ifndef ENODATA +#define ENODATA 0 +#endif /* ENODATA */ +#ifndef ETIME +#define ETIME 0 +#endif /* ETIME */ +#ifndef ENOSR +#define ENOSR 0 +#endif /* ENOSR */ +#ifndef ENONET +#define ENONET 0 +#endif /* ENONET */ +#ifndef ENOPKG +#define ENOPKG 0 +#endif /* ENOPKG */ +#ifndef EREMOTE +#define EREMOTE 0 +#endif /* EREMOTE */ +#ifndef ENOLINK +#define ENOLINK 0 +#endif /* ENOLINK */ +#ifndef EADV +#define EADV 0 +#endif /* EADV */ +#ifndef ESRMNT +#define ESRMNT 0 +#endif /* ESRMNT */ +#ifndef ECOMM +#define ECOMM 0 +#endif /* ECOMM */ +#ifndef EPROTO +#define EPROTO 0 +#endif /* EPROTO */ +#ifndef EMULTIHOP +#define EMULTIHOP 0 +#endif /* EMULTIHOP */ +#ifndef EDOTDOT +#define EDOTDOT 0 +#endif /* EDOTDOT */ +#ifndef EBADMSG +#define EBADMSG 0 +#endif /* EBADMSG */ +#ifndef EOVERFLOW +#define EOVERFLOW 0 +#endif /* EOVERFLOW */ +#ifndef ENOTUNIQ +#define ENOTUNIQ 0 +#endif /* ENOTUNIQ */ +#ifndef EBADFD +#define EBADFD 0 +#endif /* EBADFD */ +#ifndef EREMCHG +#define EREMCHG 0 +#endif /* EREMCHG */ +#ifndef ELIBACC +#define ELIBACC 0 +#endif /* ELIBACC */ +#ifndef ELIBBAD +#define ELIBBAD 0 +#endif /* ELIBBAD */ +#ifndef ELIBSCN +#define ELIBSCN 0 +#endif /* ELIBSCN */ +#ifndef ELIBMAX +#define ELIBMAX 0 +#endif /* ELIBMAX */ +#ifndef ELIBEXEC +#define ELIBEXEC 0 +#endif /* ELIBEXEC */ +#ifndef EILSEQ +#define EILSEQ 0 +#endif /* EILSEQ */ +#ifndef ERESTART +#define ERESTART 0 +#endif /* ERESTART */ +#ifndef ESTRPIPE +#define ESTRPIPE 0 +#endif /* ESTRPIPE */ +#ifndef EUSERS +#define EUSERS 0 +#endif /* EUSERS */ +#ifndef ENOTSOCK +#define ENOTSOCK 0 +#endif /* ENOTSOCK */ +#ifndef EDESTADDRREQ +#define EDESTADDRREQ 0 +#endif /* EDESTADDRREQ */ +#ifndef EMSGSIZE +#define EMSGSIZE 0 +#endif /* EMSGSIZE */ +#ifndef EPROTOTYPE +#define EPROTOTYPE 0 +#endif /* EPROTOTYPE */ +#ifndef ENOPROTOOPT +#define ENOPROTOOPT 0 +#endif /* ENOPROTOOPT */ +#ifndef EPROTONOSUPPORT +#define EPROTONOSUPPORT 0 +#endif /* EPROTONOSUPPORT */ +#ifndef ESOCKTNOSUPPORT +#define ESOCKTNOSUPPORT 0 +#endif /* ESOCKTNOSUPPORT */ +#ifndef EOPNOTSUPP +#define EOPNOTSUPP 0 +#endif /* EOPNOTSUPP */ +#ifndef EPFNOSUPPORT +#define EPFNOSUPPORT 0 +#endif /* EPFNOSUPPORT */ +#ifndef EAFNOSUPPORT +#define EAFNOSUPPORT 0 +#endif /* EAFNOSUPPORT */ +#ifndef EADDRINUSE +#define EADDRINUSE 0 +#endif /* EADDRINUSE */ +#ifndef EADDRNOTAVAIL +#define EADDRNOTAVAIL 0 +#endif /* EADDRNOTAVAIL */ +#ifndef ENETDOWN +#define ENETDOWN 0 +#endif /* ENETDOWN */ +#ifndef ENETUNREACH +#define ENETUNREACH 0 +#endif /* ENETUNREACH */ +#ifndef ENETRESET +#define ENETRESET 0 +#endif /* ENETRESET */ +#ifndef ECONNABORTED +#define ECONNABORTED 0 +#endif /* ECONNABORTED */ +#ifndef ECONNRESET +#define ECONNRESET 0 +#endif /* ECONNRESET */ +#ifndef ENOBUFS +#define ENOBUFS 0 +#endif /* ENOBUFS */ +#ifndef EISCONN +#define EISCONN 0 +#endif /* EISCONN */ +#ifndef ENOTCONN +#define ENOTCONN 0 +#endif /* ENOTCONN */ +#ifndef ESHUTDOWN +#define ESHUTDOWN 0 +#endif /* ESHUTDOWN */ +#ifndef ETOOMANYREFS +#define ETOOMANYREFS 0 +#endif /* ETOOMANYREFS */ +#ifndef ETIMEDOUT +#define ETIMEDOUT 0 +#endif /* ETIMEDOUT */ +#ifndef ECONNREFUSED +#define ECONNREFUSED 0 +#endif /* ECONNREFUSED */ +#ifndef EHOSTDOWN +#define EHOSTDOWN 0 +#endif /* EHOSTDOWN */ +#ifndef EHOSTUNREACH +#define EHOSTUNREACH 0 +#endif /* EHOSTUNREACH */ +#ifndef EALREADY +#define EALREADY 0 +#endif /* EALREADY */ +#ifndef EINPROGRESS +#define EINPROGRESS 0 +#endif /* EINPROGRESS */ +#ifndef ESTALE +#define ESTALE 0 +#endif /* ESTALE */ +#ifndef EUCLEAN +#define EUCLEAN 0 +#endif /* EUCLEAN */ +#ifndef ENOTNAM +#define ENOTNAM 0 +#endif /* ENOTNAM */ +#ifndef ENAVAIL +#define ENAVAIL 0 +#endif /* ENAVAIL */ +#ifndef EISNAM +#define EISNAM 0 +#endif /* EISNAM */ +#ifndef EREMOTEIO +#define EREMOTEIO 0 +#endif /* EREMOTEIO */ +#ifndef EDQUOT +#define EDQUOT 0 +#endif /* EDQUOT */ +#ifndef ENOMEDIUM +#define ENOMEDIUM 0 +#endif /* ENOMEDIUM */ +#ifndef EMEDIUMTYPE +#define EMEDIUMTYPE 0 +#endif /* EMEDIUMTYPE */ diff --git a/src/afs/voldefs.h b/src/afs/voldefs.h index 4b9c3f2f2..633cd952f 100644 --- a/src/afs/voldefs.h +++ b/src/afs/voldefs.h @@ -28,7 +28,7 @@ /* All volumes will have a volume header name in this format */ #define VFORMAT "V%010lu.vol" #define VMAXPATHLEN 64 /* Maximum length (including null) of a volume - external path name */ + * external path name */ /* Values for connect parameter to VInitVolumePackage */ #define CONNECT_FS 1 diff --git a/src/afs/volerrors.h b/src/afs/volerrors.h index de88fa377..ee804c4a9 100644 --- a/src/afs/volerrors.h +++ b/src/afs/volerrors.h @@ -31,23 +31,23 @@ #define VSALVAGE 101 /* Volume needs salvage */ #define VNOVNODE 102 /* Bad vnode number quoted */ #define VNOVOL 103 /* Volume not attached, doesn't exist, - not created or not online */ + * not created or not online */ #define VVOLEXISTS 104 /* Volume already exists */ #define VNOSERVICE 105 /* Volume is not in service (i.e. it's - is out of funds, is obsolete, or somesuch) */ + * is out of funds, is obsolete, or somesuch) */ #define VOFFLINE 106 /* Volume is off line, for the reason - given in the offline message */ + * given in the offline message */ #define VONLINE 107 /* Volume is already on line */ -#define VDISKFULL 108 /* ENOSPC - Partition is "full", i.e. rougly within - n% of full */ +#define VDISKFULL 108 /* ENOSPC - Partition is "full", i.e. rougly within + * n% of full */ #define VOVERQUOTA 109 /* EDQUOT - Volume max quota exceeded */ #define VBUSY 110 /* Volume temporarily unavailable; try again. - The volume should be available again shortly; if - it isn't something is wrong. Not normally to be - propagated to the application level */ + * The volume should be available again shortly; if + * it isn't something is wrong. Not normally to be + * propagated to the application level */ #define VMOVED 111 /* Volume has moved to another server; do a VGetVolumeInfo - to THIS server to find out where */ + * to THIS server to find out where */ -#define VRESTARTING -100 /* server is restarting, otherwise similar to - VBUSY above. This is negative so that old - cache managers treat it as "server is down"*/ +#define VRESTARTING -100 /* server is restarting, otherwise similar to + * VBUSY above. This is negative so that old + * cache managers treat it as "server is down" */ diff --git a/src/afsd/Makefile.in b/src/afsd/Makefile.in index 53424ab2f..f729e2c38 100644 --- a/src/afsd/Makefile.in +++ b/src/afsd/Makefile.in @@ -5,37 +5,11 @@ # This software has been released under the terms of the IBM Public # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html -# -# Portions Copyright (c) 2003 Apple Computer, Inc. - -# afsd makefile -DEST=@DEST@ -TOP_INCDIR=@TOP_INCDIR@ -TOP_LIBDIR=@TOP_LIBDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -libdir=@libdir@ -includedir=@includedir@ -mandir=@mandir@ -afssrvbindir=@afssrvbindir@ -afssrvsbindir=@afssrvsbindir@ -afssrvlibexecdir=@afssrvlibexecdir@ -COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et -RXGEN=${TOP_SRCDIR}/rxgen/rxgen -TOP_SRCDIR=@TOP_SRCDIR@ -SYS_NAME=@AFS_SYSNAME@ - -SHELL = /bin/sh - -include ../config/Makefile.${SYS_NAME} - -CFLAGS=${DBG} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} -LDFLAGS = ${XLDFLAGS} -INSTALLex = ${INSTALL} -m 755 +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config + +LDFLAGS = ${XLDFLAGS} # # What to make @@ -48,20 +22,11 @@ all: afsd vsys AFSLIBS=${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/util.a ${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a -afsd: afsd.o $(AFSLIBS) - case ${SYS_NAME} in \ - sgi_61 | sgi_62 | sgi_63) \ - ${CC} ${CFLAGS} -o afsd afsd.o $(NON_SHARED) $(LDFLAGS) $(AFSLIBS) ${XLIBS} /usr/lib/libdwarf.a /usr/lib/libelf.a ;; \ - sgi_64 | sgi_65 ) \ - ${CC} ${CFLAGS} -o afsd afsd.o $(NON_SHARED) $(LDFLAGS) $(AFSLIBS) ${XLIBS} /usr/lib32/libdwarf.a /usr/lib32/libelf.a ;; \ - *_darwin_* ) \ - ${CC} ${CFLAGS} -o afsd afsd.o $(NON_SHARED) $(LDFLAGS) $(AFSLIBS) ${XLIBS} -F/System/Library/PrivateFrameworks -framework DiskArbitration ;; \ - * ) \ - ${CC} ${CFLAGS} -o afsd afsd.o $(NON_SHARED) $(LDFLAGS) $(AFSLIBS) ${XLIBS} ;; \ - esac +afsd: afsd.o $(AFSLIBS) $(AFSD_LIBS) + ${CC} ${CFLAGS} -o afsd afsd.o $(NON_SHARED) $(LDFLAGS) $(AFSD_LDFLAGS) $(AFSLIBS) ${XLIBS} ${AFSD_LIBS} vsys: vsys.o - $(CC) -o vsys vsys.o ${TOP_LIBDIR}/libsys.a $(LDFLAGS) ${XLIBS} + ${CC} ${CFLAGS} -o vsys vsys.o ${TOP_LIBDIR}/libsys.a $(LDFLAGS) ${XLIBS} # # Objects @@ -88,49 +53,49 @@ ${DESTDIR}${sbindir}/vsys: vsys dest: ${DEST}/root.client/usr/vice/etc/afsd ${DEST}/etc/vsys case ${SYS_NAME} in \ rs_aix*) \ - ${INSTALL} -f rc.afs.rs_aix ${DEST}/root.client/usr/vice/etc/dkload/rc.afs ; \ - ${INSTALL} -f rc.dkload.client.rs_aix ${DEST}/root.client/usr/vice/etc/dkload/rc.dkload.client ; \ - ${INSTALL} -f rc.dkload.server.rs_aix ${DEST}/root.client/usr/vice/etc/dkload/rc.dkload.server ;; \ + ${INSTALL} -f ${srcdir}/rc.afs.rs_aix ${DEST}/root.client/usr/vice/etc/dkload/rc.afs ; \ + ${INSTALL} -f ${srcdir}/rc.dkload.client.rs_aix ${DEST}/root.client/usr/vice/etc/dkload/rc.dkload.client ; \ + ${INSTALL} -f ${srcdir}/rc.dkload.server.rs_aix ${DEST}/root.client/usr/vice/etc/dkload/rc.dkload.server ;; \ sgi_65 ) \ - ${INSTALL} -f afs.rc.sgi_ipnos ${DEST}/root.client/usr/vice/etc/sgiload/afs.rc ;\ - ${INSTALL} -f afs.rc.sgi_ipnos ${DEST}/root.server/etc/init.d/afs.rc ;;\ + ${INSTALL} -f ${srcdir}/afs.rc.sgi_ipnos ${DEST}/root.client/usr/vice/etc/sgiload/afs.rc ;\ + ${INSTALL} -f ${srcdir}/afs.rc.sgi_ipnos ${DEST}/root.server/etc/init.d/afs.rc ;;\ sgi_* ) \ - ${INSTALL} -f afs.rc.sgi ${DEST}/root.client/usr/vice/etc/sgiload/afs.rc ;\ - ${INSTALL} -f afs.rc.sgi ${DEST}/root.server/etc/init.d/afs.rc ;\ + ${INSTALL} -f ${srcdir}/afs.rc.sgi ${DEST}/root.client/usr/vice/etc/sgiload/afs.rc ;\ + ${INSTALL} -f ${srcdir}/afs.rc.sgi ${DEST}/root.server/etc/init.d/afs.rc ;\ case ${SYS_NAME} in \ sgi_53 | sgi_61 ) \ - ${INSTALL} -f afs_rtsymtab.pl.${SYS_NAME} ${DEST}/root.client/usr/vice/etc/sgiload/afs_rtsymtab.pl ;;\ + ${INSTALL} -f ${srcdir}/afs_rtsymtab.pl.${SYS_NAME} ${DEST}/root.client/usr/vice/etc/sgiload/afs_rtsymtab.pl ;;\ esac;; \ sun4_52 | sun4_53 | sun4c_52 | sun4c_53 | sun4m_52 | sun4m_53 | sun4m_54 | sun4_54 | sun4c_54 | sunx86_54) \ - ${INSTALL} -f afs.rc.solaris ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\ + ${INSTALL} -f ${srcdir}/afs.rc.solaris ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\ sun*_57 ) \ - ${INSTALL} -f afs.rc.solaris.2.7 ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\ + ${INSTALL} -f ${srcdir}/afs.rc.solaris.2.7 ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\ sun*_58 ) \ - ${INSTALL} -f afs.rc.solaris.2.8 ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\ + ${INSTALL} -f ${srcdir}/afs.rc.solaris.2.8 ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\ sun*_59 ) \ - ${INSTALL} -f afs.rc.solaris.2.9 ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\ - sun*_5? ) \ - ${INSTALL} -f afs.rc.solaris.2_5 ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\ + ${INSTALL} -f ${srcdir}/afs.rc.solaris.2.9 ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\ + sun4x_5? ) \ + ${INSTALL} -f ${srcdir}/afs.rc.solaris.2_5 ${DEST}/root.client/usr/vice/etc/modload/afs.rc ;;\ alpha_osf* ) \ - ${INSTALL} -f afs.rc.alpha ${DEST}/root.client/usr/vice/etc/dkload/afs.rc ;;\ - ia64_hpux1122 ) \ - ${INSTALL} -f afs.rc.hpux10 ${DEST}/root.client/usr/vice/etc/dkload/afs.rc ;\ - ${INSTALL} -f afs.hpux1122.driver ${DEST}/root.client/usr/vice/etc/afs.driver ;;\ + ${INSTALL} -f ${srcdir}/afs.rc.alpha ${DEST}/root.client/usr/vice/etc/dkload/afs.rc ;;\ + hp_ux1122 ) \ + ${INSTALL} -f ${srcdir}/afs.rc.hpux10 ${DEST}/root.client/usr/vice/etc/dkload/afs.rc ;\ + ${INSTALL} -f ${srcdir}/afs.hpux1122.driver ${DEST}/root.client/usr/vice/etc/afs.driver ;;\ hp_ux10? | hp_ux11? ) \ - ${INSTALL} -f afs.rc.hpux10 ${DEST}/root.client/usr/vice/etc/dkload/afs.rc ;\ - ${INSTALL} -f afs.hpux102.driver ${DEST}/root.client/usr/vice/etc/afs.driver ;;\ + ${INSTALL} -f ${srcdir}/afs.rc.hpux10 ${DEST}/root.client/usr/vice/etc/dkload/afs.rc ;\ + ${INSTALL} -f ${srcdir}/afs.hpux102.driver ${DEST}/root.client/usr/vice/etc/afs.driver ;;\ alpha_dux* ) \ - ${INSTALL} -f afs.rc.alpha_dux40 ${DEST}/root.client/usr/vice/etc/dkload/afs.rc ;;\ + ${INSTALL} -f ${srcdir}/afs.rc.alpha_dux40 ${DEST}/root.client/usr/vice/etc/dkload/afs.rc ;;\ hp?00_ux10? ) \ - ${INSTALL} -f afs.rc.hpux10 ${DEST}/root.client/usr/vice/etc/dkload/afs.rc ;;\ + ${INSTALL} -f ${srcdir}/afs.rc.hpux10 ${DEST}/root.client/usr/vice/etc/dkload/afs.rc ;;\ *linux* ) \ - ${INSTALLex} -f afs.rc.linux ${DEST}/root.client/usr/vice/etc/afs.rc; \ - ${INSTALL} -f afs.conf.linux ${DEST}/root.client/usr/vice/etc/afs.conf ;; \ - *_darwin_*) \ - ${INSTALLex} -f afs.rc.darwin ${DEST}/root.client/usr/vice/etc/afs.rc ; \ - ${INSTALL} -f afs.rc.darwin.plist ${DEST}/root.client/usr/vice/etc/StartupParameters.plist ;; \ + ${INSTALL} -f ${srcdir}/afs.rc.linux -m 755 ${DEST}/root.client/usr/vice/etc/afs.rc; \ + ${INSTALL} -f ${srcdir}/afs.conf.linux ${DEST}/root.client/usr/vice/etc/afs.conf ;; \ + *_darwin*) \ + ${INSTALL} -f ${srcdir}/afs.rc.darwin -m 755 ${DEST}/root.client/usr/vice/etc/afs.rc ; \ + ${INSTALL} -f ${srcdir}/afs.rc.darwin.plist ${DEST}/root.client/usr/vice/etc/StartupParameters.plist ;; \ *fbsd*) \ - ${INSTALL} -f afs.rc.fbsd ${DEST}/root.client/usr/vice/etc/afs.rc.fbsd ;; \ + ${INSTALL} -f ${srcdir}/afs.rc.fbsd ${DEST}/root.client/usr/vice/etc/afs.rc.fbsd ;; \ * ) \ echo No rc scripts installed for ${SYS_NAME} ;; \ esac diff --git a/src/afsd/afs.conf.linux b/src/afsd/afs.conf.linux index f299203e7..affd1ee25 100644 --- a/src/afsd/afs.conf.linux +++ b/src/afsd/afs.conf.linux @@ -13,6 +13,12 @@ AFS_CLIENT=on AFS_SERVER=off +# ENABLE_AFSDB and ENABLE_DYNROOT determine whether AFSDB support and +# Dynroot support (dynamically generated /afs), respectively, should be +# enabled in the AFS client. +ENABLE_AFSDB=on +ENABLE_DYNROOT=off + # AFS client configuration options: XXLARGE="-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" XLARGE="-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" diff --git a/src/afsd/afs.hpux102.driver b/src/afsd/afs.hpux102.driver index aaf20f201..fc392661b 100644 --- a/src/afsd/afs.hpux102.driver +++ b/src/afsd/afs.hpux102.driver @@ -6,7 +6,7 @@ * directory or online at http://www.openafs.org/dl/license10.html * -* $Revision: 1.1.1.2 $ +* $Revision: 1.2 $ * * The following devices are those that can be specified in the system * description file. The name specified must agree with the name shown, diff --git a/src/afsd/afs.rc.linux b/src/afsd/afs.rc.linux index c93f32c27..e1534de67 100644 --- a/src/afsd/afs.rc.linux +++ b/src/afsd/afs.rc.linux @@ -177,9 +177,13 @@ load_client() { exit 1 fi - # use the prefix command if required - set_prefix - /sbin/insmod ${PREFIX:+-P $PREFIX} -f -m $MODLOADDIR/$LIBAFS > $MODLOADDIR/libafs.map 2>&1 + if [ -f $KSYMS_FILE ]; then + # use the prefix command if required + set_prefix + /sbin/insmod ${PREFIX:+-P $PREFIX} -f -m $MODLOADDIR/$LIBAFS > $MODLOADDIR/libafs.map 2>&1 + else + /sbin/insmod $MODLOADDIR/$LIBAFS > $MODLOADDIR/libafs.map 2>&1 + fi } generate_cacheinfo() { @@ -218,6 +222,12 @@ choose_afsdoptions() { fi fi AFSD_OPTIONS="$OPTIONS $VERBOSE" + if is_on $ENABLE_AFSDB; then + AFSD_OPTIONS="$AFSD_OPTIONS -afsdb" + fi + if is_on $ENABLE_DYNROOT; then + AFSD_OPTIONS="$AFSD_OPTIONS -dynroot" + fi } case "$1" in diff --git a/src/afsd/afs.rc.obsd b/src/afsd/afs.rc.obsd new file mode 100644 index 000000000..9f844dde1 --- /dev/null +++ b/src/afsd/afs.rc.obsd @@ -0,0 +1,9 @@ +# install this file as /usr/vice/etc/rc.securelevel.afs +# add the following line (without leading '# ') to /etc/rc.securelevel for OpenBSD +# . /usr/vice/etc/rc.securelevel.afs + +rm -f /usr/vice/etc/openbsd_afs +/sbin/modload -o /usr/vice/etc/openbsd_afs /usr/vice/etc/libafs.o + +/usr/vice/etc/afsd -nosettime +/usr/vice/bin/fs setcrypt on diff --git a/src/afsd/afs.rc.sgi b/src/afsd/afs.rc.sgi index e1566adda..96b9f2069 100644 --- a/src/afsd/afs.rc.sgi +++ b/src/afsd/afs.rc.sgi @@ -28,10 +28,15 @@ # These options should be given in /etc/config/afsd.options. # If afsd.options does not exist then $OPTIONS is used. # + +# EXTRAOPTS can be used to enable/disable AFSDB support (-afsdb) +# and Dynroot (dynamically-generated /afs) support (-dynroot). +EXTRAOPTS="-afsdb" + LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70" SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50" -OPTIONS=$MEDIUM +OPTIONS="$MEDIUM $EXTRAOPTS" CONFIG=/etc/config IS_ON=/etc/chkconfig diff --git a/src/afsd/afs.rc.solaris b/src/afsd/afs.rc.solaris index 416699411..9fef4f65f 100644 --- a/src/afsd/afs.rc.solaris +++ b/src/afsd/afs.rc.solaris @@ -17,6 +17,10 @@ CONFIG=/usr/vice/etc/config AFSDOPT=$CONFIG/afsd.options PACKAGE=$CONFIG/package.options +# EXTRAOPTS can be used to enable/disable AFSDB support (-afsdb) +# and Dynroot (dynamically-generated /afs) support (-dynroot). +EXTRAOPTS="-afsdb" + LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70" SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50" @@ -24,7 +28,7 @@ SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50" if [ -f $AFSDOPT ]; then OPTIONS=`cat $AFSDOPT` else - OPTIONS=$MEDIUM + OPTIONS="$MEDIUM $EXTRAOPTS" fi # Need the commands ps, awk, kill, sleep diff --git a/src/afsd/afs.rc.solaris.2.7 b/src/afsd/afs.rc.solaris.2.7 index c096da9bd..6cda6aa0c 100644 --- a/src/afsd/afs.rc.solaris.2.7 +++ b/src/afsd/afs.rc.solaris.2.7 @@ -18,6 +18,10 @@ CONFIG=/usr/vice/etc/config AFSDOPT=$CONFIG/afsd.options PACKAGE=$CONFIG/package.options +# EXTRAOPTS can be used to enable/disable AFSDB support (-afsdb) +# and Dynroot (dynamically-generated /afs) support (-dynroot). +EXTRAOPTS="-afsdb" + LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70" SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50" @@ -25,7 +29,7 @@ SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50" if [ -f $AFSDOPT ]; then OPTIONS=`cat $AFSDOPT` else - OPTIONS=$MEDIUM + OPTIONS="$MEDIUM $EXTRAOPTS" fi # Need the commands ps, awk, kill, sleep diff --git a/src/afsd/afs.rc.solaris.2.8 b/src/afsd/afs.rc.solaris.2.8 index 64e089f1c..e08e894bd 100755 --- a/src/afsd/afs.rc.solaris.2.8 +++ b/src/afsd/afs.rc.solaris.2.8 @@ -11,6 +11,10 @@ CONFIG=/usr/vice/etc/config AFSDOPT=$CONFIG/afsd.options PACKAGE=$CONFIG/package.options +# EXTRAOPTS can be used to enable/disable AFSDB support (-afsdb) +# and Dynroot (dynamically-generated /afs) support (-dynroot). +EXTRAOPTS="-afsdb" + LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70" SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50" @@ -18,7 +22,7 @@ SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50" if [ -f $AFSDOPT ]; then OPTIONS=`cat $AFSDOPT` else - OPTIONS=$MEDIUM + OPTIONS="$MEDIUM $EXTRAOPTS" fi # Need the commands ps, awk, kill, sleep diff --git a/src/afsd/afs.rc.solaris.2.9 b/src/afsd/afs.rc.solaris.2.9 index 00967eb9b..b4c91e0f5 100644 --- a/src/afsd/afs.rc.solaris.2.9 +++ b/src/afsd/afs.rc.solaris.2.9 @@ -11,14 +11,18 @@ CONFIG=/usr/vice/etc/config AFSDOPT=$CONFIG/afsd.options PACKAGE=$CONFIG/package.options -LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128 -afsdb" -MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70 -afsdb" -SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50 -afsdb" +# EXTRAOPTS can be used to enable/disable AFSDB support (-afsdb) +# and Dynroot (dynamically-generated /afs) support (-dynroot). +EXTRAOPTS="-afsdb" + +LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" +MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70" +SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50" if [ -f $AFSDOPT ]; then OPTIONS=`cat $AFSDOPT` else - OPTIONS=$MEDIUM + OPTIONS="$MEDIUM $EXTRAOPTS" fi # Need the commands ps, awk, kill, sleep diff --git a/src/afsd/afs.rc.solaris.2_5 b/src/afsd/afs.rc.solaris.2_5 index 499b32e6e..692be6380 100644 --- a/src/afsd/afs.rc.solaris.2_5 +++ b/src/afsd/afs.rc.solaris.2_5 @@ -17,6 +17,10 @@ CONFIG=/usr/vice/etc/config AFSDOPT=$CONFIG/afsd.options PACKAGE=$CONFIG/package.options +# EXTRAOPTS can be used to enable/disable AFSDB support (-afsdb) +# and Dynroot (dynamically-generated /afs) support (-dynroot). +EXTRAOPTS="-afsdb" + LARGE="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" MEDIUM="-stat 2000 -dcache 800 -daemons 3 -volumes 70" SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50" @@ -24,7 +28,7 @@ SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50" if [ -f $AFSDOPT ]; then OPTIONS=`cat $AFSDOPT` else - OPTIONS=$MEDIUM + OPTIONS="$MEDIUM $EXTRAOPTS" fi # Need the commands ps, awk, kill, sleep diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index b6b2c0ea6..8529cc3f2 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -55,7 +55,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/afsd.c,v 1.1.1.18 2003/07/30 17:11:08 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afsd/afsd.c,v 1.41 2004/05/08 04:12:27 shadow Exp $"); #define VFS 1 @@ -113,6 +114,10 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/afsd.c,v 1.1.1.18 2003/07/30 17:11 #include #endif +#ifdef HAVE_SYS_FSTYP_H +#include +#endif + #ifdef HAVE_UNISTD_H #include #endif @@ -148,24 +153,11 @@ void set_staticaddrs(void); #endif #ifdef AFS_DARWIN_ENV #include -/* Relevant definitions from DiskArbitration.h (not included with Mac OS X) */ -#ifndef __DISKARBITRATION_H -typedef char DiskArbDiskIdentifier[1024]; -typedef char DiskArbMountpoint[1024]; -kern_return_t DiskArbStart(mach_port_t * portPtr); -kern_return_t DiskArbDiskAppearedWithMountpointPing_auto( - DiskArbDiskIdentifier diskIdentifier, - unsigned flags, - DiskArbMountpoint mountpoint); -kern_return_t DiskArbDiskDisappearedPing_auto( - DiskArbDiskIdentifier diskIdentifier, - unsigned flags); -enum { - kDiskArbDiskAppearedNoFlags = 0x00000000, - kDiskArbDiskAppearedEjectableMask = 1 << 1, - kDiskArbDiskAppearedNetworkDiskMask = 1 << 3 -}; -#endif /* __DISKARBITRATION_H */ +/* Symbols from the DiskArbitration framework */ +kern_return_t DiskArbStart(mach_port_t *); +kern_return_t DiskArbDiskAppearedWithMountpointPing_auto(char *, unsigned int, + char *); +#define DISK_ARB_NETWORK_DISK_FLAG 8 #endif /* AFS_DARWIN_ENV */ #ifndef MOUNT_AFS @@ -204,11 +196,15 @@ char LclCellName[64]; * version of , since it's still useful. */ struct in_addr_42 { - union { - struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b; - struct { u_short s_w1,s_w2; } S_un_w; - afs_uint32 S_addr; - } S_un; + union { + struct { + u_char s_b1, s_b2, s_b3, s_b4; + } S_un_b; + struct { + u_short s_w1, s_w2; + } S_un_w; + afs_uint32 S_addr; + } S_un; #define s_host S_un.S_un_b.s_b2 /* host on imp */ #define s_net S_un.S_un_b.s_b1 /* network */ #define s_imp S_un.S_un_w.s_w2 /* imp */ @@ -226,54 +222,59 @@ struct in_addr_42 { * Global configuration variables. */ afs_int32 afs_shutdown = 0; -afs_int32 cacheBlocks; /*Num blocks in the cache*/ -afs_int32 cacheFiles = 1000; /*Optimal # of files in workstation cache*/ -afs_int32 cacheStatEntries = 300; /*Number of stat cache entries*/ -char cacheBaseDir[1024]; /*Where the workstation AFS cache lives*/ -char confDir[1024]; /*Where the workstation AFS configuration lives*/ -char fullpn_DCacheFile[1024]; /*Full pathname of DCACHEFILE*/ -char fullpn_VolInfoFile[1024]; /*Full pathname of VOLINFOFILE*/ -char fullpn_CellInfoFile[1024]; /*Full pathanem of CELLINFOFILE*/ -char fullpn_AFSLogFile[1024]; /*Full pathname of AFSLOGFILE*/ -char fullpn_CacheInfo[1024]; /*Full pathname of CACHEINFO*/ -char fullpn_VFile[1024]; /*Full pathname of data cache files*/ -char *vFilePtr; /*Ptr to the number part of above pathname*/ -int sawCacheMountDir = 0; /* from cmd line */ +afs_int32 cacheBlocks; /*Num blocks in the cache */ +afs_int32 cacheFiles = 1000; /*Optimal # of files in workstation cache */ +afs_int32 cacheStatEntries = 300; /*Number of stat cache entries */ +char cacheBaseDir[1024]; /*Where the workstation AFS cache lives */ +char confDir[1024]; /*Where the workstation AFS configuration lives */ +char fullpn_DCacheFile[1024]; /*Full pathname of DCACHEFILE */ +char fullpn_VolInfoFile[1024]; /*Full pathname of VOLINFOFILE */ +char fullpn_CellInfoFile[1024]; /*Full pathanem of CELLINFOFILE */ +char fullpn_AFSLogFile[1024]; /*Full pathname of AFSLOGFILE */ +char fullpn_CacheInfo[1024]; /*Full pathname of CACHEINFO */ +char fullpn_VFile[1024]; /*Full pathname of data cache files */ +char *vFilePtr; /*Ptr to the number part of above pathname */ +int sawCacheMountDir = 0; /* from cmd line */ int sawCacheBaseDir = 0; int sawCacheBlocks = 0; int sawDCacheSize = 0; int sawBiod = 0; -char cacheMountDir[1024]; /*Mount directory for AFS*/ -char rootVolume[64] = "root.afs"; /*AFS root volume name*/ -afs_int32 cacheSetTime = 1; /*Keep checking time to avoid drift?*/ -afs_int32 isHomeCell; /*Is current cell info for the home cell?*/ -int createAndTrunc = O_CREAT | O_TRUNC; /*Create & truncate on open*/ -int ownerRWmode = 0600; /*Read/write OK by owner*/ -static int filesSet = 0; /*True if number of files explicitly set*/ -static int nFilesPerDir = 2048; /* # files per cache dir */ -static int nDaemons = 2; /* Number of background daemons */ -static int chunkSize = 0; /* 2^chunkSize bytes per chunk */ -static int dCacheSize = 300; /* # of dcache entries */ -static int vCacheSize = 50; /* # of volume cache entries */ -static int rootVolSet = 0; /*True if root volume name explicitly set*/ -int addrNum; /*Cell server address index being printed*/ -static int cacheFlags = 0; /*Flags to cache manager*/ -static int nBiods = 5; /* AIX3.1 only */ -static int preallocs = 400; /* Def # of allocated memory blocks */ +char cacheMountDir[1024]; /*Mount directory for AFS */ +char rootVolume[64] = "root.afs"; /*AFS root volume name */ +afs_int32 cacheSetTime = 1; /*Keep checking time to avoid drift? */ +afs_int32 isHomeCell; /*Is current cell info for the home cell? */ +#ifdef AFS_XBSD_ENV +int createAndTrunc = O_RDWR | O_CREAT | O_TRUNC; /*Create & truncate on open */ +#else +int createAndTrunc = O_CREAT | O_TRUNC; /*Create & truncate on open */ +#endif +int ownerRWmode = 0600; /*Read/write OK by owner */ +static int filesSet = 0; /*True if number of files explicitly set */ +static int nFilesPerDir = 2048; /* # files per cache dir */ +static int nDaemons = 2; /* Number of background daemons */ +static int chunkSize = 0; /* 2^chunkSize bytes per chunk */ +static int dCacheSize = 300; /* # of dcache entries */ +static int vCacheSize = 50; /* # of volume cache entries */ +static int rootVolSet = 0; /*True if root volume name explicitly set */ +int addrNum; /*Cell server address index being printed */ +static int cacheFlags = 0; /*Flags to cache manager */ +static int nBiods = 5; /* AIX3.1 only */ +static int preallocs = 400; /* Def # of allocated memory blocks */ static int enable_peer_stats = 0; /* enable rx stats */ static int enable_process_stats = 0; /* enable rx stats */ #ifdef AFS_AFSDB_ENV -static int enable_afsdb = 0; /* enable AFSDB support */ +static int enable_afsdb = 0; /* enable AFSDB support */ #endif -static int enable_dynroot = 0; /* enable dynroot support */ -static int enable_fakestat = 0; /* enable fakestat support */ -static int enable_nomount = 0; /* do not mount */ +static int enable_dynroot = 0; /* enable dynroot support */ +static int enable_fakestat = 0; /* enable fakestat support */ +static int enable_backuptree = 0; /* enable backup tree support */ +static int enable_nomount = 0; /* do not mount */ #ifdef notdef -static int inodes = 60; /* VERY conservative, but has to be */ +static int inodes = 60; /* VERY conservative, but has to be */ #endif -int afsd_verbose = 0; /*Are we being chatty?*/ -int afsd_debug = 0; /*Are we printing debugging info?*/ -int afsd_CloseSynch = 0; /*Are closes synchronous or not? */ +int afsd_verbose = 0; /*Are we being chatty? */ +int afsd_debug = 0; /*Are we printing debugging info? */ +int afsd_CloseSynch = 0; /*Are closes synchronous or not? */ #ifdef AFS_SGI62_ENV #define AFSD_INO_T ino64_t @@ -281,23 +282,23 @@ int afsd_CloseSynch = 0; /*Are closes synchronous or not? */ #define AFSD_INO_T afs_uint32 #endif struct afsd_file_list { - int fileNum; - struct afsd_file_list *next; + int fileNum; + struct afsd_file_list *next; }; struct afsd_file_list **cache_dir_filelist = NULL; -int *cache_dir_list = NULL; /* Array of cache subdirs */ -int *dir_for_V = NULL; /* Array: dir of each cache file. - * -1: file does not exist - * -2: file exists in top-level - * >=0: file exists in Dxxx - */ -AFSD_INO_T *inode_for_V; /* Array of inodes for desired - * cache files */ -int missing_DCacheFile = 1; /*Is the DCACHEFILE missing?*/ -int missing_VolInfoFile = 1; /*Is the VOLINFOFILE missing?*/ -int missing_CellInfoFile = 1; /*Is the CELLINFOFILE missing?*/ -int afsd_rmtsys = 0; /* Default: don't support rmtsys */ -struct afs_cacheParams cparams; /* params passed to cache manager */ +int *cache_dir_list = NULL; /* Array of cache subdirs */ +int *dir_for_V = NULL; /* Array: dir of each cache file. + * -1: file does not exist + * -2: file exists in top-level + * >=0: file exists in Dxxx + */ +AFSD_INO_T *inode_for_V; /* Array of inodes for desired + * cache files */ +int missing_DCacheFile = 1; /*Is the DCACHEFILE missing? */ +int missing_VolInfoFile = 1; /*Is the VOLINFOFILE missing? */ +int missing_CellInfoFile = 1; /*Is the CELLINFOFILE missing? */ +int afsd_rmtsys = 0; /* Default: don't support rmtsys */ +struct afs_cacheParams cparams; /* params passed to cache manager */ static int HandleMTab(); @@ -326,23 +327,22 @@ static int HandleMTab(); * Sets globals. *---------------------------------------------------------------------------*/ -int ParseCacheInfoFile() +int +ParseCacheInfoFile() { - static char rn[]="ParseCacheInfoFile"; /*This routine's name*/ - FILE *cachefd; /*Descriptor for cache info file*/ - int parseResult; /*Result of our fscanf()*/ + static char rn[] = "ParseCacheInfoFile"; /*This routine's name */ + FILE *cachefd; /*Descriptor for cache info file */ + int parseResult; /*Result of our fscanf() */ afs_int32 tCacheBlocks; char tCacheBaseDir[1024], *tbd, tCacheMountDir[1024], *tmd; if (afsd_debug) - printf("%s: Opening cache info file '%s'...\n", - rn, fullpn_CacheInfo); + printf("%s: Opening cache info file '%s'...\n", rn, fullpn_CacheInfo); cachefd = fopen(fullpn_CacheInfo, "r"); if (!cachefd) { - printf("%s: Can't read cache info file '%s'\n", - rn, fullpn_CacheInfo); - return(1); + printf("%s: Can't read cache info file '%s'\n", rn, fullpn_CacheInfo); + return (1); } /* @@ -352,9 +352,9 @@ int ParseCacheInfoFile() * represent the number of blocks in the cache. */ tCacheMountDir[0] = tCacheBaseDir[0] = '\0'; - parseResult = fscanf(cachefd, - "%1024[^:]:%1024[^:]:%d", - tCacheMountDir, tCacheBaseDir, &tCacheBlocks); + parseResult = + fscanf(cachefd, "%1024[^:]:%1024[^:]:%d", tCacheMountDir, + tCacheBaseDir, &tCacheBlocks); /* * Regardless of how the parse went, we close the cache info file. @@ -362,37 +362,38 @@ int ParseCacheInfoFile() fclose(cachefd); if (parseResult == EOF || parseResult < 3) { - printf("%s: Format error in cache info file!\n", - rn); + printf("%s: Format error in cache info file!\n", rn); if (parseResult == EOF) printf("\tEOF encountered before any field parsed.\n"); else printf("\t%d out of 3 fields successfully parsed.\n", parseResult); - return(1); + return (1); } - for (tmd = tCacheMountDir; *tmd == '\n' || *tmd == ' ' || *tmd == '\t'; tmd++) ; - for (tbd = tCacheBaseDir; *tbd == '\n' || *tbd == ' ' || *tbd == '\t'; tbd++) ; + for (tmd = tCacheMountDir; *tmd == '\n' || *tmd == ' ' || *tmd == '\t'; + tmd++); + for (tbd = tCacheBaseDir; *tbd == '\n' || *tbd == ' ' || *tbd == '\t'; + tbd++); /* now copy in the fields not explicitly overridden by cmd args */ - if (!sawCacheMountDir) + if (!sawCacheMountDir) strcpy(cacheMountDir, tmd); if (!sawCacheBaseDir) strcpy(cacheBaseDir, tbd); - if (!sawCacheBlocks) + if (!sawCacheBlocks) cacheBlocks = tCacheBlocks; if (afsd_debug) { - printf("%s: Cache info file successfully parsed:\n", - rn); - printf("\tcacheMountDir: '%s'\n\tcacheBaseDir: '%s'\n\tcacheBlocks: %d\n", - tmd, tbd, tCacheBlocks); + printf("%s: Cache info file successfully parsed:\n", rn); + printf + ("\tcacheMountDir: '%s'\n\tcacheBaseDir: '%s'\n\tcacheBlocks: %d\n", + tmd, tbd, tCacheBlocks); } - if (! (cacheFlags & AFSCALL_INIT_MEMCACHE)) + if (!(cacheFlags & AFSCALL_INIT_MEMCACHE)) PartSizeOverflow(tbd, cacheBlocks); - return(0); + return (0); } /* @@ -402,15 +403,18 @@ int ParseCacheInfoFile() * advisory. ODS with over 2G partition also gives warning message. */ PartSizeOverflow(path, cs) -char *path; -int cs; + char *path; + int cs; { - int bsize=-1, totalblks, mint; + int bsize = -1, totalblks, mint; #if AFS_HAVE_STATVFS struct statvfs statbuf; - if (statvfs(path, &statbuf) != 0) { - if (afsd_debug) printf("statvfs failed on %s; skip checking for adequate partition space\n", path); + if (statvfs(path, &statbuf) != 0) { + if (afsd_debug) + printf + ("statvfs failed on %s; skip checking for adequate partition space\n", + path); return 0; } totalblks = statbuf.f_blocks; @@ -419,26 +423,31 @@ int cs; struct statfs statbuf; if (statfs(path, &statbuf) < 0) { - if (afsd_debug) printf("statfs failed on %s; skip checking for adequate partition space\n", path); + if (afsd_debug) + printf + ("statfs failed on %s; skip checking for adequate partition space\n", + path); return 0; } totalblks = statbuf.f_blocks; bsize = statbuf.f_bsize; #endif - if (bsize == -1) return 0; /* sucess */ + if (bsize == -1) + return 0; /* sucess */ /* now free and totalblks are in fragment units, but we want them in 1K units */ if (bsize >= 1024) { totalblks *= (bsize / 1024); } else { - totalblks /= (1024/bsize); + totalblks /= (1024 / bsize); } mint = totalblks - ((totalblks * 5) / 100); if (cs > mint) { - printf("Cache size (%d) must be less than 95%% of partition size (which is %d). Lower cache size\n", - cs, mint); - } + printf + ("Cache size (%d) must be less than 95%% of partition size (which is %d). Lower cache size\n", + cs, mint); + } } /*----------------------------------------------------------------------------- @@ -465,14 +474,15 @@ int cs; * None. *---------------------------------------------------------------------------*/ -static int doGetXFileNumber(fname, filechar, maxNum) - char *fname; - char filechar; - int maxNum; +static int +doGetXFileNumber(fname, filechar, maxNum) + char *fname; + char filechar; + int maxNum; { - int computedVNumber; /*The computed file number we return*/ - int filenameLen; /*Number of chars in filename*/ - int currDigit; /*Current digit being processed*/ + int computedVNumber; /*The computed file number we return */ + int filenameLen; /*Number of chars in filename */ + int currDigit; /*Current digit being processed */ /* * The filename must have at least two characters, the first of which must be a ``filechar'' @@ -480,11 +490,11 @@ static int doGetXFileNumber(fname, filechar, maxNum) */ filenameLen = strlen(fname); if (filenameLen < 2) - return(-1); + return (-1); if (fname[0] != filechar) - return(-1); + return (-1); if ((filenameLen > 2) && (fname[1] == '0')) - return(-1); + return (-1); /* * Scan through the characters in the given filename, failing immediately if a non-digit @@ -492,7 +502,7 @@ static int doGetXFileNumber(fname, filechar, maxNum) */ for (currDigit = 1; currDigit < filenameLen; currDigit++) if (isdigit(fname[currDigit]) == 0) - return(-1); + return (-1); /* * All relevant characters are digits. Pull out the decimal number they represent. @@ -500,21 +510,23 @@ static int doGetXFileNumber(fname, filechar, maxNum) */ computedVNumber = atoi(++fname); if (computedVNumber < cacheFiles) - return(computedVNumber); + return (computedVNumber); else - return(-1); + return (-1); } -int GetVFileNumber(fname, maxFile) - char *fname; - int maxFile; +int +GetVFileNumber(fname, maxFile) + char *fname; + int maxFile; { return doGetXFileNumber(fname, 'V', maxFile); } -int GetDDirNumber(fname, maxDir) - char *fname; - int maxDir; +int +GetDDirNumber(fname, maxDir) + char *fname; + int maxDir; { return doGetXFileNumber(fname, 'D', maxDir); } @@ -543,25 +555,25 @@ int GetDDirNumber(fname, maxDir) * As described. *---------------------------------------------------------------------------*/ -static int CreateCacheSubDir (basename, dirNum) +static int +CreateCacheSubDir(basename, dirNum) char *basename; int dirNum; { - static char rn[] = "CreateCacheSubDir"; /* Routine Name */ + static char rn[] = "CreateCacheSubDir"; /* Routine Name */ char dir[1024]; int ret; /* Build the new cache subdirectory */ - sprintf (dir, "%s/D%d", basename, dirNum); + sprintf(dir, "%s/D%d", basename, dirNum); if (afsd_verbose) - printf("%s: Creating cache subdir '%s'\n", - rn, dir); + printf("%s: Creating cache subdir '%s'\n", rn, dir); if ((ret = mkdir(dir, 0700)) != 0) { - printf("%s: Can't create '%s', error return is %d (%d)\n", - rn, dir, ret, errno); - if (errno != EEXIST) + printf("%s: Can't create '%s', error return is %d (%d)\n", rn, dir, + ret, errno); + if (errno != EEXIST) return (-1); } @@ -572,85 +584,89 @@ static int CreateCacheSubDir (basename, dirNum) return (0); } -static int MoveCacheFile (basename, fromDir, toDir, cacheFile, maxDir) +static int +MoveCacheFile(basename, fromDir, toDir, cacheFile, maxDir) char *basename; int fromDir, toDir, cacheFile, maxDir; { - static char rn[] = "MoveCacheFile"; - char from[1024], to[1024]; - int ret; - - if (cache_dir_list[toDir] < 0 && - (ret = CreateCacheSubDir(basename, toDir))) { - printf("%s: Can't create directory '%s/D%d'\n", rn, basename, toDir); - return ret; - } - - /* Build the from,to dir */ - if (fromDir < 0) { - /* old-style location */ - snprintf (from, sizeof(from), "%s/V%d", basename, cacheFile); - } else { - snprintf (from, sizeof(from), "%s/D%d/V%d", basename, fromDir, cacheFile); - } - - snprintf (to, sizeof(from), "%s/D%d/V%d", basename, toDir, cacheFile); - - if (afsd_verbose) - printf("%s: Moving cacheFile from '%s' to '%s'\n", - rn, from, to); - - if ((ret = rename (from, to)) != 0) { - printf("%s: Can't rename '%s' to '%s', error return is %d (%d)\n", - rn, from, to, ret, errno); - return -1; - } - - /* Reset directory pointer; fix file counts */ - dir_for_V[cacheFile] = toDir; - cache_dir_list[toDir]++; - if (fromDir < maxDir && fromDir >= 0) - cache_dir_list[fromDir]--; - - return 0; + static char rn[] = "MoveCacheFile"; + char from[1024], to[1024]; + int ret; + + if (cache_dir_list[toDir] < 0 + && (ret = CreateCacheSubDir(basename, toDir))) { + printf("%s: Can't create directory '%s/D%d'\n", rn, basename, toDir); + return ret; + } + + /* Build the from,to dir */ + if (fromDir < 0) { + /* old-style location */ + snprintf(from, sizeof(from), "%s/V%d", basename, cacheFile); + } else { + snprintf(from, sizeof(from), "%s/D%d/V%d", basename, fromDir, + cacheFile); + } + + snprintf(to, sizeof(from), "%s/D%d/V%d", basename, toDir, cacheFile); + + if (afsd_verbose) + printf("%s: Moving cacheFile from '%s' to '%s'\n", rn, from, to); + + if ((ret = rename(from, to)) != 0) { + printf("%s: Can't rename '%s' to '%s', error return is %d (%d)\n", rn, + from, to, ret, errno); + return -1; + } + + /* Reset directory pointer; fix file counts */ + dir_for_V[cacheFile] = toDir; + cache_dir_list[toDir]++; + if (fromDir < maxDir && fromDir >= 0) + cache_dir_list[fromDir]--; + + return 0; } -int CreateCacheFile(fname, statp) - char *fname; - struct stat *statp; +int +CreateCacheFile(fname, statp) + char *fname; + struct stat *statp; { - static char rn[] = "CreateCacheFile"; /*Routine name*/ - int cfd; /*File descriptor to AFS cache file*/ - int closeResult; /*Result of close()*/ + static char rn[] = "CreateCacheFile"; /*Routine name */ + int cfd; /*File descriptor to AFS cache file */ + int closeResult; /*Result of close() */ if (afsd_verbose) - printf("%s: Creating cache file '%s'\n", - rn, fname); + printf("%s: Creating cache file '%s'\n", rn, fname); cfd = open(fname, createAndTrunc, ownerRWmode); - if (cfd <= 0) { - printf("%s: Can't create '%s', error return is %d (%d)\n", - rn, fname, cfd, errno); - return(-1); + if (cfd <= 0) { + printf("%s: Can't create '%s', error return is %d (%d)\n", rn, fname, + cfd, errno); + return (-1); } if (statp != NULL) { - closeResult = fstat (cfd, statp); + closeResult = fstat(cfd, statp); if (closeResult) { - printf("%s: Can't stat newly-created AFS cache file '%s' (code %d)\n", - rn, fname, errno); - return(-1); + printf + ("%s: Can't stat newly-created AFS cache file '%s' (code %d)\n", + rn, fname, errno); + return (-1); } } closeResult = close(cfd); - if (closeResult) { - printf("%s: Can't close newly-created AFS cache file '%s' (code %d)\n", - rn, fname, errno); - return(-1); + if (closeResult) { + printf + ("%s: Can't close newly-created AFS cache file '%s' (code %d)\n", + rn, fname, errno); + return (-1); } - return(0); + return (0); } -static void CreateFileIfMissing(char *fullpn, int missing) +static void +CreateFileIfMissing(char *fullpn, int missing) { if (missing) { if (afsd_verbose) @@ -689,36 +705,38 @@ static void CreateFileIfMissing(char *fullpn, int missing) *---------------------------------------------------------------------------*/ -static int doSweepAFSCache(vFilesFound,directory,dirNum,maxDir) +static int +doSweepAFSCache(vFilesFound, directory, dirNum, maxDir) int *vFilesFound; char *directory; /* /path/to/cache/directory */ int dirNum; /* current directory number */ int maxDir; /* maximum directory number */ { - static char rn[] = "doSweepAFSCache"; /* Routine Name */ - char fullpn_FileToDelete[1024]; /*File to be deleted from cache*/ - char *fileToDelete; /*Ptr to last component of above*/ - DIR *cdirp; /*Ptr to cache directory structure*/ + static char rn[] = "doSweepAFSCache"; /* Routine Name */ + char fullpn_FileToDelete[1024]; /*File to be deleted from cache */ + char *fileToDelete; /*Ptr to last component of above */ + DIR *cdirp; /*Ptr to cache directory structure */ #ifdef AFS_SGI62_ENV - struct dirent64 *currp; /*Current directory entry*/ + struct dirent64 *currp; /*Current directory entry */ #else - struct dirent *currp; /*Current directory entry*/ + struct dirent *currp; /*Current directory entry */ #endif - int vFileNum; /*Data cache file's associated number*/ - int thisDir; /* A directory number */ + int vFileNum; /*Data cache file's associated number */ + int thisDir; /* A directory number */ int highDir = 0; if (afsd_debug) printf("%s: Opening cache directory '%s'\n", rn, directory); - if (chmod(directory, 0700)) { /* force it to be 700 */ - printf("%s: Can't 'chmod 0700' the cache dir, '%s'.\n", rn, directory); + if (chmod(directory, 0700)) { /* force it to be 700 */ + printf("%s: Can't 'chmod 0700' the cache dir, '%s'.\n", rn, + directory); return (-1); } cdirp = opendir(directory); - if (cdirp == (DIR *)0) { + if (cdirp == (DIR *) 0) { printf("%s: Can't open AFS cache directory, '%s'.\n", rn, directory); - return(-1); + return (-1); } /* @@ -736,16 +754,15 @@ static int doSweepAFSCache(vFilesFound,directory,dirNum,maxDir) #else for (currp = readdir(cdirp); currp; currp = readdir(cdirp)) #endif - { + { if (afsd_debug) { - printf("%s: Current directory entry:\n", - rn); + printf("%s: Current directory entry:\n", rn); #ifdef AFS_SGI62_ENV - printf("\tinode=%lld, reclen=%d, name='%s'\n", - currp->d_ino, currp->d_reclen, currp->d_name); + printf("\tinode=%lld, reclen=%d, name='%s'\n", currp->d_ino, + currp->d_reclen, currp->d_name); #else - printf("\tinode=%d, reclen=%d, name='%s'\n", - currp->d_ino, currp->d_reclen, currp->d_name); + printf("\tinode=%d, reclen=%d, name='%s'\n", currp->d_ino, + currp->d_reclen, currp->d_name); #endif } @@ -756,126 +773,124 @@ static int doSweepAFSCache(vFilesFound,directory,dirNum,maxDir) * valid if dirNum < 0. */ - if (*(currp->d_name) == 'V' && - ((vFileNum = GetVFileNumber(currp->d_name, cacheFiles)) >= 0)) { + if (*(currp->d_name) == 'V' + && ((vFileNum = GetVFileNumber(currp->d_name, cacheFiles)) >= + 0)) { /* * Found a valid data cache filename. Remember this * file's inode, directory, and bump the number of files found * total and in this directory. */ inode_for_V[vFileNum] = currp->d_ino; - dir_for_V[vFileNum] = dirNum; /* remember this directory */ + dir_for_V[vFileNum] = dirNum; /* remember this directory */ if (!maxDir) { - /* If we're in a real subdir, mark this file to be moved - * if we've already got too many files in this directory - */ - assert(dirNum >= 0); - cache_dir_list[dirNum]++; /* keep directory's file count */ - if (cache_dir_list[dirNum] > nFilesPerDir) { - /* Too many files -- add to filelist */ - struct afsd_file_list *tmp = (struct afsd_file_list *) - malloc(sizeof(*tmp)); - if (!tmp) - printf ("%s: MALLOC FAILED allocating file_list entry\n", - rn); - else { - tmp->fileNum = vFileNum; - tmp->next = cache_dir_filelist[dirNum]; - cache_dir_filelist[dirNum] = tmp; + /* If we're in a real subdir, mark this file to be moved + * if we've already got too many files in this directory + */ + assert(dirNum >= 0); + cache_dir_list[dirNum]++; /* keep directory's file count */ + if (cache_dir_list[dirNum] > nFilesPerDir) { + /* Too many files -- add to filelist */ + struct afsd_file_list *tmp = (struct afsd_file_list *) + malloc(sizeof(*tmp)); + if (!tmp) + printf + ("%s: MALLOC FAILED allocating file_list entry\n", + rn); + else { + tmp->fileNum = vFileNum; + tmp->next = cache_dir_filelist[dirNum]; + cache_dir_filelist[dirNum] = tmp; + } } - } } (*vFilesFound)++; - } - else if (dirNum < 0 && (*(currp->d_name) == 'D') && - GetDDirNumber(currp->d_name, 1<<30) >= 0) { - int retval = 0; - if ((vFileNum = GetDDirNumber(currp->d_name, maxDir)) >= 0) { - /* Found a valid cachefile sub-Directory. Remember this number - * and recurse into it. Note that subdirs cannot have subdirs. - */ - retval = 1; - } else if ((vFileNum = GetDDirNumber(currp->d_name, 1<<30)) >= 0) { - /* This directory is going away, but figure out if there - * are any cachefiles in here that should be saved by - * moving them to other cache directories. This directory - * will be removed later. - */ - retval = 2; - } - - /* Save the highest directory number we've seen */ - if (vFileNum > highDir) - highDir = vFileNum; - - /* If this directory is staying, be sure to mark it as 'found' */ - if (retval == 1) cache_dir_list[vFileNum] = 0; - - /* Print the dirname for recursion */ - sprintf(fileToDelete, "%s", currp->d_name); - - /* Note: vFileNum is the directory number */ - retval = doSweepAFSCache(vFilesFound, fullpn_FileToDelete, - vFileNum, (retval == 1 ? 0 : -1)); - if (retval) { - printf ("%s: Recursive sweep failed on directory %s\n", - rn, currp->d_name); - return retval; - } - } - else if (dirNum < 0 && strcmp(currp->d_name, DCACHEFILE) == 0) { + } else if (dirNum < 0 && (*(currp->d_name) == 'D') + && GetDDirNumber(currp->d_name, 1 << 30) >= 0) { + int retval = 0; + if ((vFileNum = GetDDirNumber(currp->d_name, maxDir)) >= 0) { + /* Found a valid cachefile sub-Directory. Remember this number + * and recurse into it. Note that subdirs cannot have subdirs. + */ + retval = 1; + } else if ((vFileNum = GetDDirNumber(currp->d_name, 1 << 30)) >= + 0) { + /* This directory is going away, but figure out if there + * are any cachefiles in here that should be saved by + * moving them to other cache directories. This directory + * will be removed later. + */ + retval = 2; + } + + /* Save the highest directory number we've seen */ + if (vFileNum > highDir) + highDir = vFileNum; + + /* If this directory is staying, be sure to mark it as 'found' */ + if (retval == 1) + cache_dir_list[vFileNum] = 0; + + /* Print the dirname for recursion */ + sprintf(fileToDelete, "%s", currp->d_name); + + /* Note: vFileNum is the directory number */ + retval = + doSweepAFSCache(vFilesFound, fullpn_FileToDelete, vFileNum, + (retval == 1 ? 0 : -1)); + if (retval) { + printf("%s: Recursive sweep failed on directory %s\n", rn, + currp->d_name); + return retval; + } + } else if (dirNum < 0 && strcmp(currp->d_name, DCACHEFILE) == 0) { /* * Found the file holding the dcache entries. */ missing_DCacheFile = 0; - } - else if (dirNum < 0 && strcmp(currp->d_name, VOLINFOFILE) == 0) { + } else if (dirNum < 0 && strcmp(currp->d_name, VOLINFOFILE) == 0) { /* * Found the file holding the volume info. */ missing_VolInfoFile = 0; - } - else if (dirNum < 0 && strcmp(currp->d_name, CELLINFOFILE) == 0) { + } else if (dirNum < 0 && strcmp(currp->d_name, CELLINFOFILE) == 0) { /* * Found the file holding the cell info. */ missing_CellInfoFile = 0; - } - else if ((strcmp(currp->d_name, ".") == 0) || - (strcmp(currp->d_name, "..") == 0) || + } else if ((strcmp(currp->d_name, ".") == 0) + || (strcmp(currp->d_name, "..") == 0) || #ifdef AFS_DECOSF_ENV - /* these are magic AdvFS files */ - (strcmp(currp->d_name, ".tags") == 0) || - (strcmp(currp->d_name, "quota.user") == 0) || - (strcmp(currp->d_name, "quota.group") == 0) || + /* these are magic AdvFS files */ + (strcmp(currp->d_name, ".tags") == 0) + || (strcmp(currp->d_name, "quota.user") == 0) + || (strcmp(currp->d_name, "quota.group") == 0) || #endif #ifdef AFS_LINUX22_ENV - /* this is the ext3 journal file */ - (strcmp(currp->d_name, ".journal") == 0) || + /* this is the ext3 journal file */ + (strcmp(currp->d_name, ".journal") == 0) || #endif - (strcmp(currp->d_name, "lost+found") == 0)) { + (strcmp(currp->d_name, "lost+found") == 0)) { /* * Don't do anything - this file is legit, and is to be left alone. */ - } - else { + } else { /* * This file/directory doesn't belong in the cache. Nuke it. */ sprintf(fileToDelete, "%s", currp->d_name); if (afsd_verbose) - printf("%s: Deleting '%s'\n", - rn, fullpn_FileToDelete); + printf("%s: Deleting '%s'\n", rn, fullpn_FileToDelete); if (unlink(fullpn_FileToDelete)) { - if (errno == EISDIR && *fileToDelete == 'D') { + if (errno == EISDIR && *fileToDelete == 'D') { if (rmdir(fullpn_FileToDelete)) { - printf("%s: Can't rmdir '%s', errno is %d\n", - rn, fullpn_FileToDelete, errno); + printf("%s: Can't rmdir '%s', errno is %d\n", rn, + fullpn_FileToDelete, errno); } } else - printf("%s: Can't unlink '%s', errno is %d\n", - rn, fullpn_FileToDelete, errno); + printf("%s: Can't unlink '%s', errno is %d\n", rn, + fullpn_FileToDelete, errno); } } } @@ -900,53 +915,57 @@ static int doSweepAFSCache(vFilesFound,directory,dirNum,maxDir) thisDir = 0; /* Keep track of which subdir has space */ for (vFileNum = 0; vFileNum < cacheFiles; vFileNum++) { - if (dir_for_V[vFileNum] == -1) { - /* This file does not exist. Create it in the first - * subdir that still has extra space. - */ - while (thisDir < maxDir && - cache_dir_list[thisDir] >= nFilesPerDir) - thisDir++; - if (thisDir >= maxDir) - printf("%s: can't find directory to create V%d\n", rn, vFileNum); - else { - struct stat statb; - assert (inode_for_V[vFileNum] == (AFSD_INO_T)0); - sprintf(vFilePtr, "D%d/V%d", thisDir, vFileNum); - if (afsd_verbose) - printf("%s: Creating '%s'\n", rn, fullpn_VFile); - if (cache_dir_list[thisDir] < 0 && - CreateCacheSubDir(directory, thisDir)) - printf("%s: Can't create directory for '%s'\n", - rn, fullpn_VFile); - if (CreateCacheFile(fullpn_VFile, &statb)) - printf("%s: Can't create '%s'\n", rn, fullpn_VFile); - else { - inode_for_V[vFileNum] = statb.st_ino; - dir_for_V[vFileNum] = thisDir; - cache_dir_list[thisDir]++; - (*vFilesFound)++; - } - } + if (dir_for_V[vFileNum] == -1) { + /* This file does not exist. Create it in the first + * subdir that still has extra space. + */ + while (thisDir < maxDir + && cache_dir_list[thisDir] >= nFilesPerDir) + thisDir++; + if (thisDir >= maxDir) + printf("%s: can't find directory to create V%d\n", rn, + vFileNum); + else { + struct stat statb; + assert(inode_for_V[vFileNum] == (AFSD_INO_T) 0); + sprintf(vFilePtr, "D%d/V%d", thisDir, vFileNum); + if (afsd_verbose) + printf("%s: Creating '%s'\n", rn, fullpn_VFile); + if (cache_dir_list[thisDir] < 0 + && CreateCacheSubDir(directory, thisDir)) + printf("%s: Can't create directory for '%s'\n", rn, + fullpn_VFile); + if (CreateCacheFile(fullpn_VFile, &statb)) + printf("%s: Can't create '%s'\n", rn, fullpn_VFile); + else { + inode_for_V[vFileNum] = statb.st_ino; + dir_for_V[vFileNum] = thisDir; + cache_dir_list[thisDir]++; + (*vFilesFound)++; + } + } - } else if (dir_for_V[vFileNum] >= maxDir || - dir_for_V[vFileNum] == -2) { - /* This file needs to move; move it to the first subdir - * that has extra space. (-2 means it's in the toplevel) - */ - while (thisDir < maxDir && cache_dir_list[thisDir] >= nFilesPerDir) - thisDir++; - if (thisDir >= maxDir) - printf("%s: can't find directory to move V%d\n", rn, vFileNum); - else { - if (MoveCacheFile (directory, dir_for_V[vFileNum], thisDir, - vFileNum, maxDir)) { - /* Cannot move. Ignore this file??? */ - /* XXX */ - } + } else if (dir_for_V[vFileNum] >= maxDir + || dir_for_V[vFileNum] == -2) { + /* This file needs to move; move it to the first subdir + * that has extra space. (-2 means it's in the toplevel) + */ + while (thisDir < maxDir + && cache_dir_list[thisDir] >= nFilesPerDir) + thisDir++; + if (thisDir >= maxDir) + printf("%s: can't find directory to move V%d\n", rn, + vFileNum); + else { + if (MoveCacheFile + (directory, dir_for_V[vFileNum], thisDir, vFileNum, + maxDir)) { + /* Cannot move. Ignore this file??? */ + /* XXX */ + } + } } - } - } /* for */ + } /* for */ /* At this point, we've moved all of the valid cache files * into the valid subdirs, and created all the extra @@ -957,56 +976,149 @@ static int doSweepAFSCache(vFilesFound,directory,dirNum,maxDir) */ for (dirNum = 0; dirNum < maxDir; dirNum++) { - struct afsd_file_list *thisFile; - - for (thisFile = cache_dir_filelist[dirNum]; - thisFile && cache_dir_list[dirNum] >= nFilesPerDir; - thisFile = thisFile->next) { - while (thisDir < maxDir && cache_dir_list[thisDir] >= nFilesPerDir) - thisDir++; - if (thisDir >= maxDir) - printf("%s: can't find directory to move V%d\n", rn, vFileNum); - else { - if (MoveCacheFile (directory, dirNum, thisDir, - thisFile->fileNum, maxDir)) { - /* Cannot move. Ignore this file??? */ - /* XXX */ - } - } - } /* for each file to move */ - } /* for each directory */ + struct afsd_file_list *thisFile; + + for (thisFile = cache_dir_filelist[dirNum]; + thisFile && cache_dir_list[dirNum] >= nFilesPerDir; + thisFile = thisFile->next) { + while (thisDir < maxDir + && cache_dir_list[thisDir] >= nFilesPerDir) + thisDir++; + if (thisDir >= maxDir) + printf("%s: can't find directory to move V%d\n", rn, + vFileNum); + else { + if (MoveCacheFile + (directory, dirNum, thisDir, thisFile->fileNum, + maxDir)) { + /* Cannot move. Ignore this file??? */ + /* XXX */ + } + } + } /* for each file to move */ + } /* for each directory */ /* Remove any directories >= maxDir -- they should be empty */ for (; highDir >= maxDir; highDir--) { - sprintf(fileToDelete, "D%d", highDir); - if (unlink(fullpn_FileToDelete)) { - if (errno == EISDIR && *fileToDelete == 'D') { - if (rmdir(fullpn_FileToDelete)) { - printf("%s: Can't rmdir '%s', errno is %d\n", - rn, fullpn_FileToDelete, errno); - } - } else - printf("%s: Can't unlink '%s', errno is %d\n", - rn, fullpn_FileToDelete, errno); - } + sprintf(fileToDelete, "D%d", highDir); + if (unlink(fullpn_FileToDelete)) { + if (errno == EISDIR && *fileToDelete == 'D') { + if (rmdir(fullpn_FileToDelete)) { + printf("%s: Can't rmdir '%s', errno is %d\n", rn, + fullpn_FileToDelete, errno); + } + } else + printf("%s: Can't unlink '%s', errno is %d\n", rn, + fullpn_FileToDelete, errno); + } } - } /* dirNum < 0 */ - + } + + /* dirNum < 0 */ /* * Close the directory, return success. */ if (afsd_debug) - printf("%s: Closing cache directory.\n", - rn); + printf("%s: Closing cache directory.\n", rn); closedir(cdirp); - return(0); + return (0); +} + +char * +CheckCacheBaseDir(char *dir) +{ + struct stat statbuf; + + if (!dir) { + return "cache base dir not specified"; + } + if (stat(dir, &statbuf) != 0) { + return "unable to stat cache base directory"; + } + + /* might want to check here for anything else goofy, like cache pointed at a non-dedicated directory, etc */ + +#ifdef AFS_LINUX24_ENV + { + int res; + struct statfs statfsbuf; + + res = statfs(dir, &statfsbuf); + if (res != 0) { + return "unable to statfs cache base directory"; + } + if (statfsbuf.f_type == 0x52654973) { /* REISERFS_SUPER_MAGIC */ + return "cannot use reiserfs as cache partition"; + } + } +#endif + +#ifdef AFS_HPUX_ENV + { + int res; + struct statfs statfsbuf; + char name[FSTYPSZ]; + + res = statfs(dir, &statfsbuf); + if (res != 0) { + return "unable to statfs cache base directory"; + } + + if (sysfs(GETFSTYP, statfsbuf.f_fsid[1], name) != 0) { + return "unable to determine filesystem type for cache base dir"; + } + + if (strcmp(name, "hfs")) { + return "can only use hfs filesystem for cache partition on hpux"; + } + } +#endif + +#ifdef AFS_SUN5_ENV + { + FILE *vfstab; + struct mnttab mnt; + struct stat statmnt, statci; + + if ((stat(dir, &statci) == 0) + && ((vfstab = fopen(MNTTAB, "r")) != NULL)) { + while (getmntent(vfstab, &mnt) == 0) { + if (strcmp(dir, mnt.mnt_mountp) != 0) { + char *cp; + int rdev = 0; + + if (cp = hasmntopt(&mnt, "dev=")) + rdev = + (int)strtol(cp + strlen("dev="), (char **)NULL, + 16); + + if ((rdev == 0) && (stat(mnt.mnt_mountp, &statmnt) == 0)) + rdev = statmnt.st_dev; + + if ((rdev == statci.st_dev) + && (hasmntopt(&mnt, "logging") != NULL)) { + + fclose(vfstab); + return + "mounting a multi-use partition which contains the AFS cache with the\n\"logging\" option may deadlock your system.\n\n"; + } + } + } + + fclose(vfstab); + } + } +#endif + + return NULL; } -int SweepAFSCache(vFilesFound) - int *vFilesFound; +int +SweepAFSCache(vFilesFound) + int *vFilesFound; { - static char rn[] = "SweepAFSCache"; /*Routine name*/ - int maxDir = (cacheFiles + nFilesPerDir - 1 ) / nFilesPerDir; + static char rn[] = "SweepAFSCache"; /*Routine name */ + int maxDir = (cacheFiles + nFilesPerDir - 1) / nFilesPerDir; int i; *vFilesFound = 0; @@ -1018,33 +1130,33 @@ int SweepAFSCache(vFilesFound) } if (cache_dir_list == NULL) { - cache_dir_list = (int *) malloc (maxDir * sizeof(*cache_dir_list)); + cache_dir_list = (int *)malloc(maxDir * sizeof(*cache_dir_list)); if (cache_dir_list == NULL) { printf("%s: Malloc Failed!\n", rn); return (-1); } - for (i=0; i < maxDir; i++) - cache_dir_list[i] = -1; /* Does not exist */ + for (i = 0; i < maxDir; i++) + cache_dir_list[i] = -1; /* Does not exist */ } if (cache_dir_filelist == NULL) { - cache_dir_filelist = (struct afsd_file_list **) - malloc (maxDir * sizeof(*cache_dir_filelist)); + cache_dir_filelist = (struct afsd_file_list **) + malloc(maxDir * sizeof(*cache_dir_filelist)); if (cache_dir_filelist == NULL) { printf("%s: Malloc Failed!\n", rn); return (-1); } - memset (cache_dir_filelist, 0, maxDir * sizeof(*cache_dir_filelist)); + memset(cache_dir_filelist, 0, maxDir * sizeof(*cache_dir_filelist)); } if (dir_for_V == NULL) { - dir_for_V = (int *) malloc (cacheFiles * sizeof(*dir_for_V)); + dir_for_V = (int *)malloc(cacheFiles * sizeof(*dir_for_V)); if (dir_for_V == NULL) { printf("%s: Malloc Failed!\n", rn); return (-1); } - for (i=0; i < cacheFiles; i++) - dir_for_V[i] = -1; /* Does not exist */ + for (i = 0; i < cacheFiles; i++) + dir_for_V[i] = -1; /* Does not exist */ } /* Note, setting dirNum to -2 here will cause cachefiles found in @@ -1054,45 +1166,48 @@ int SweepAFSCache(vFilesFound) * file into a subdirectory, we know it's in the top-level instead * of some other cache subdir. */ - return doSweepAFSCache (vFilesFound, cacheBaseDir, -2, maxDir); + return doSweepAFSCache(vFilesFound, cacheBaseDir, -2, maxDir); } -static ConfigCell(aci, arock, adir) -register struct afsconf_cell *aci; -char *arock; -struct afsconf_dir *adir; { +static +ConfigCell(aci, arock, adir) + register struct afsconf_cell *aci; + char *arock; + struct afsconf_dir *adir; +{ register int isHomeCell; register int i, code; afs_int32 cellFlags = 0; afs_int32 hosts[MAXHOSTSPERCELL]; - + /* figure out if this is the home cell */ isHomeCell = (strcmp(aci->name, LclCellName) == 0); if (!isHomeCell) - cellFlags = 2; /* not home, suid is forbidden */ - + cellFlags = 2; /* not home, suid is forbidden */ + /* build address list */ - for(i=0;ihostAddr[i].sin_addr, sizeof(afs_int32)); - if (aci->linkedCell) cellFlags |= 4; /* Flag that linkedCell arg exists, - for upwards compatibility */ + if (aci->linkedCell) + cellFlags |= 4; /* Flag that linkedCell arg exists, + * for upwards compatibility */ /* configure one cell */ - code = call_syscall(AFSOP_ADDCELL2, - hosts, /* server addresses */ - aci->name, /* cell name */ - cellFlags, /* is this the home cell? */ - aci->linkedCell); /* Linked cell, if any */ + code = call_syscall(AFSOP_ADDCELL2, hosts, /* server addresses */ + aci->name, /* cell name */ + cellFlags, /* is this the home cell? */ + aci->linkedCell); /* Linked cell, if any */ if (code) printf("Adding cell '%s': error %d\n", aci->name, code); return 0; } -static ConfigCellAlias(aca, arock, adir) - register struct afsconf_cellalias *aca; - char *arock; - struct afsconf_dir *adir; +static +ConfigCellAlias(aca, arock, adir) + register struct afsconf_cellalias *aca; + char *arock; + struct afsconf_dir *adir; { /* push the alias into the kernel */ call_syscall(AFSOP_ADDCELLALIAS, aca->aliasName, aca->realName); @@ -1100,7 +1215,8 @@ static ConfigCellAlias(aca, arock, adir) } #ifdef AFS_AFSDB_ENV -static AfsdbLookupHandler() +static +AfsdbLookupHandler() { afs_int32 kernelMsg[64]; char acellName[128]; @@ -1115,7 +1231,8 @@ static AfsdbLookupHandler() while (1) { /* On some platforms you only get 4 args to an AFS call */ int sizeArg = ((sizeof acellName) << 16) | (sizeof kernelMsg); - code = call_syscall(AFSOP_AFSDB_HANDLER, acellName, kernelMsg, sizeArg); + code = + call_syscall(AFSOP_AFSDB_HANDLER, acellName, kernelMsg, sizeArg); if (code) { /* Something is wrong? */ sleep(1); continue; @@ -1134,11 +1251,11 @@ static AfsdbLookupHandler() kernelMsg[1] = acellInfo.timeout - time(0); else kernelMsg[1] = 0; - for (i=0; iparms[1].items) { /* -files */ cacheFiles = atoi(as->parms[1].items->data); - filesSet = 1; /* set when spec'd on cmd line */ + filesSet = 1; /* set when spec'd on cmd line */ } if (as->parms[2].items) { /* -rootvol */ @@ -1279,7 +1397,8 @@ mainproc(as, arock) if (as->parms[15].items) { /* -biods */ #ifndef AFS_AIX32_ENV - printf("afsd: [-biods] currently only enabled for aix3.x VM supported systems\n"); + printf + ("afsd: [-biods] currently only enabled for aix3.x VM supported systems\n"); #else nBiods = atoi(as->parms[15].items->data); sawBiod = 1; @@ -1289,7 +1408,7 @@ mainproc(as, arock) /* -prealloc */ preallocs = atoi(as->parms[16].items->data); } -#ifdef notdef +#ifdef notdef if (as->parms[17].items) { /* -pininodes */ inodes = atoi(as->parms[17].items->data); @@ -1300,15 +1419,15 @@ mainproc(as, arock) /* -confdir */ strcpy(confDir, as->parms[17].items->data); } - sprintf(fullpn_CacheInfo, "%s/%s", confDir, CACHEINFOFILE); - sprintf(fullpn_AFSLogFile, "%s/%s", confDir, AFSLOGFILE); + sprintf(fullpn_CacheInfo, "%s/%s", confDir, CACHEINFOFILE); + sprintf(fullpn_AFSLogFile, "%s/%s", confDir, AFSLOGFILE); if (as->parms[18].items) { /* -logfile */ strcpy(fullpn_AFSLogFile, as->parms[18].items->data); } if (as->parms[19].items) { - /* -waitclose */ - afsd_CloseSynch = 1; + /* -waitclose */ + afsd_CloseSynch = 1; } if (as->parms[20].items) { /* -shutdown */ @@ -1345,10 +1464,12 @@ mainproc(as, arock) #endif } if (as->parms[25].items) { - /* -files_per_subdir */ - int res = atoi(as->parms[25].items->data); - if ( res < 10 || res > 2^30) { - printf("afsd:invalid number of files per subdir, \"%s\". Ignored\n", as->parms[25].items->data); + /* -files_per_subdir */ + int res = atoi(as->parms[25].items->data); + if (res < 10 || res > 2 ^ 30) { + printf + ("afsd:invalid number of files per subdir, \"%s\". Ignored\n", + as->parms[25].items->data); } else { nFilesPerDir = res; } @@ -1369,6 +1490,10 @@ mainproc(as, arock) /* -nomount */ enable_nomount = 1; } + if (as->parms[30].items) { + /* -backuptree */ + enable_backuptree = 1; + } /* * Pull out all the configuration info for the workstation's AFS cache and @@ -1380,15 +1505,14 @@ mainproc(as, arock) exit(1); } - lookupResult = afsconf_GetLocalCell(cdir, LclCellName, sizeof(LclCellName)); + lookupResult = + afsconf_GetLocalCell(cdir, LclCellName, sizeof(LclCellName)); if (lookupResult) { - printf("%s: Can't get my home cell name! [Error is %d]\n", - rn, lookupResult); - } - else { + printf("%s: Can't get my home cell name! [Error is %d]\n", rn, + lookupResult); + } else { if (afsd_verbose) - printf("%s: My home cell is '%s'\n", - rn, LclCellName); + printf("%s: My home cell is '%s'\n", rn, LclCellName); } /* parse cacheinfo file if this is a diskcache */ @@ -1396,10 +1520,13 @@ mainproc(as, arock) exit(1); } - if ((logfd = fopen(fullpn_AFSLogFile,"r+")) == 0) { - if (afsd_verbose) printf("%s: Creating '%s'\n", rn, fullpn_AFSLogFile); + if ((logfd = fopen(fullpn_AFSLogFile, "r+")) == 0) { + if (afsd_verbose) + printf("%s: Creating '%s'\n", rn, fullpn_AFSLogFile); if (CreateCacheFile(fullpn_AFSLogFile, NULL)) { - printf("%s: Can't create '%s' (You may want to use the -logfile option)\n", rn, fullpn_AFSLogFile); + printf + ("%s: Can't create '%s' (You may want to use the -logfile option)\n", + rn, fullpn_AFSLogFile); exit(1); } } else @@ -1414,23 +1541,24 @@ mainproc(as, arock) */ if (sawDCacheSize) { if (sawCacheBlocks) { - printf("%s: can't set cache blocks and dcache size simultaneously when diskless.\n", rn); + printf + ("%s: can't set cache blocks and dcache size simultaneously when diskless.\n", + rn); exit(1); } /* compute the cache size based on # of chunks times the chunk size */ - i = (chunkSize == 0? 13 : chunkSize); - i = (1< 10) { - dCacheSize = (cacheBlocks >> (i-10)); + dCacheSize = (cacheBlocks >> (i - 10)); } else if (i < 10) { - dCacheSize = (cacheBlocks << (10-i)); + dCacheSize = (cacheBlocks << (10 - i)); } else { dCacheSize = cacheBlocks; } @@ -1442,8 +1570,7 @@ mainproc(as, arock) * so we now make them equal. */ cacheFiles = dCacheSize; - } - else { + } else { /* Disk cache: * Compute the number of cache files based on cache size, * but only if -files isn't given on the command line. @@ -1452,13 +1579,15 @@ mainproc(as, arock) * average V-file is ~10K, according to tentative empirical studies. */ if (!filesSet) { - cacheFiles = cacheBlocks / 10; - if (cacheFiles < 100) cacheFiles = 100; + cacheFiles = cacheBlocks / 10; + if (cacheFiles < 100) + cacheFiles = 100; /* Always allow more files than chunks. Presume average V-file * is ~67% of a chunk... (another guess, perhaps Honeyman will * have a grad student write a paper). i is KILOBYTES. */ - i = 1 << (chunkSize == 0? 6 : (chunkSize<10 ? 0 : chunkSize -10)); + i = 1 << (chunkSize == + 0 ? 6 : (chunkSize < 10 ? 0 : chunkSize - 10)); cacheFiles = max(cacheFiles, 1.5 * (cacheBlocks / i)); /* never permit more files than blocks, while leaving space for * VolumeInfo and CacheItems files. VolumeInfo is usually 20K, @@ -1467,12 +1596,15 @@ mainproc(as, arock) #define VOLINFOSZ 20 #define CACHEITMSZ (cacheFiles / 20) #ifdef AFS_AIX_ENV - cacheFiles= min(cacheFiles,(cacheBlocks -VOLINFOSZ -CACHEITMSZ)/4); + cacheFiles = + min(cacheFiles, (cacheBlocks - VOLINFOSZ - CACHEITMSZ) / 4); #else - cacheFiles = min(cacheFiles, cacheBlocks - VOLINFOSZ - CACHEITMSZ); + cacheFiles = + min(cacheFiles, cacheBlocks - VOLINFOSZ - CACHEITMSZ); #endif - if (cacheFiles < 100) - fprintf (stderr, "%s: WARNING: cache probably too small!\n", rn); + if (cacheFiles < 100) + fprintf(stderr, "%s: WARNING: cache probably too small!\n", + rn); } if (!sawDCacheSize) { if ((cacheFiles / 2) > dCacheSize) @@ -1486,28 +1618,31 @@ mainproc(as, arock) * Create and zero the inode table for the desired cache files. */ inode_for_V = (AFSD_INO_T *) malloc(cacheFiles * sizeof(AFSD_INO_T)); - if (inode_for_V == (AFSD_INO_T *)0) { - printf("%s: malloc() failed for cache file inode table with %d entries.\n", - rn, cacheFiles); + if (inode_for_V == (AFSD_INO_T *) 0) { + printf + ("%s: malloc() failed for cache file inode table with %d entries.\n", + rn, cacheFiles); exit(1); } memset(inode_for_V, '\0', (cacheFiles * sizeof(AFSD_INO_T))); if (afsd_debug) - printf("%s: %d inode_for_V entries at 0x%x, %d bytes\n", - rn, cacheFiles, inode_for_V, - (cacheFiles * sizeof(AFSD_INO_T))); + printf("%s: %d inode_for_V entries at 0x%x, %d bytes\n", rn, + cacheFiles, inode_for_V, (cacheFiles * sizeof(AFSD_INO_T))); /* * Set up all the pathnames we'll need for later. */ - sprintf(fullpn_DCacheFile, "%s/%s", cacheBaseDir, DCACHEFILE); - sprintf(fullpn_VolInfoFile, "%s/%s", cacheBaseDir, VOLINFOFILE); + sprintf(fullpn_DCacheFile, "%s/%s", cacheBaseDir, DCACHEFILE); + sprintf(fullpn_VolInfoFile, "%s/%s", cacheBaseDir, VOLINFOFILE); sprintf(fullpn_CellInfoFile, "%s/%s", cacheBaseDir, CELLINFOFILE); - sprintf(fullpn_VFile, "%s/", cacheBaseDir); + sprintf(fullpn_VFile, "%s/", cacheBaseDir); vFilePtr = fullpn_VFile + strlen(fullpn_VFile); + if ((fsTypeMsg = CheckCacheBaseDir(cacheBaseDir))) { + printf("%s: WARNING: Cache dir check failed (%s)\n", rn, fsTypeMsg); + } #if 0 - fputs(AFS_GOVERNMENT_MESSAGE, stdout); + fputs(AFS_GOVERNMENT_MESSAGE, stdout); fflush(stdout); #endif @@ -1522,16 +1657,19 @@ mainproc(as, arock) /* initialize the rx random number generator from user space */ { - /* parse multihomed address files */ - afs_int32 addrbuf[MAXIPADDRS],maskbuf[MAXIPADDRS],mtubuf[MAXIPADDRS]; - char reason[1024]; - code=parseNetFiles(addrbuf,maskbuf,mtubuf,MAXIPADDRS,reason, - AFSDIR_CLIENT_NETINFO_FILEPATH, - AFSDIR_CLIENT_NETRESTRICT_FILEPATH); - if(code>0) - call_syscall(AFSOP_ADVISEADDR, code, addrbuf, maskbuf, mtubuf); - else - printf("ADVISEADDR: Error in specifying interface addresses:%s\n",reason); + /* parse multihomed address files */ + afs_int32 addrbuf[MAXIPADDRS], maskbuf[MAXIPADDRS], + mtubuf[MAXIPADDRS]; + char reason[1024]; + code = + parseNetFiles(addrbuf, maskbuf, mtubuf, MAXIPADDRS, reason, + AFSDIR_CLIENT_NETINFO_FILEPATH, + AFSDIR_CLIENT_NETRESTRICT_FILEPATH); + if (code > 0) + call_syscall(AFSOP_ADVISEADDR, code, addrbuf, maskbuf, mtubuf); + else + printf("ADVISEADDR: Error in specifying interface addresses:%s\n", + reason); } /* Set realtime priority for most threads to same as for biod's. */ @@ -1553,18 +1691,16 @@ mainproc(as, arock) * preallocs are passed for both listener and callback server. Only * the one which actually does the initialization uses them though. */ - if (preallocs < cacheStatEntries+50) - preallocs = cacheStatEntries+50; + if (preallocs < cacheStatEntries + 50) + preallocs = cacheStatEntries + 50; #ifdef RXK_LISTENER_ENV if (afsd_verbose) printf("%s: Forking rx listener daemon.\n", rn); code = fork(); if (code == 0) { /* Child */ - SET_RX_RTPRI(); /* max advised for non-interrupts */ - call_syscall(AFSOP_RXLISTENER_DAEMON, - preallocs, - enable_peer_stats, + SET_RX_RTPRI(); /* max advised for non-interrupts */ + call_syscall(AFSOP_RXLISTENER_DAEMON, preallocs, enable_peer_stats, enable_process_stats); exit(1); } @@ -1583,7 +1719,7 @@ mainproc(as, arock) code = fork(); if (code == 0) { /* Child */ - SET_RX_RTPRI(); /* max advised for non-interrupts */ + SET_RX_RTPRI(); /* max advised for non-interrupts */ call_syscall(AFSOP_RXEVENT_DAEMON); exit(1); } @@ -1609,9 +1745,10 @@ mainproc(as, arock) * Tell the kernel some basic information about the workstation's cache. */ if (afsd_verbose) - printf("%s: Calling AFSOP_CACHEINIT: %d stat cache entries, %d optimum cache files, %d blocks in the cache, flags = 0x%x, dcache entries %d\n", - rn, cacheStatEntries, cacheFiles, cacheBlocks, cacheFlags, - dCacheSize); + printf + ("%s: Calling AFSOP_CACHEINIT: %d stat cache entries, %d optimum cache files, %d blocks in the cache, flags = 0x%x, dcache entries %d\n", + rn, cacheStatEntries, cacheFiles, cacheBlocks, cacheFlags, + dCacheSize); memset(&cparams, '\0', sizeof(cparams)); cparams.cacheScaches = cacheStatEntries; cparams.cacheFiles = cacheFiles; @@ -1622,10 +1759,10 @@ mainproc(as, arock) cparams.setTimeFlag = cacheSetTime; cparams.memCacheFlag = cacheFlags; #ifdef notdef - cparams.inodes = inodes; + cparams.inodes = inodes; #endif call_syscall(AFSOP_CACHEINIT, &cparams); - if (afsd_CloseSynch) + if (afsd_CloseSynch) call_syscall(AFSOP_CLOSEWAIT); /* @@ -1638,11 +1775,10 @@ mainproc(as, arock) * CellItems, and thus must be ran before those are sent to the kernel. */ if (afsd_verbose) - printf("%s: Sweeping workstation's AFS cache directory.\n", - rn); + printf("%s: Sweeping workstation's AFS cache directory.\n", rn); cacheIteration = 0; /* Memory-cache based system doesn't need any of this */ - if(!(cacheFlags & AFSCALL_INIT_MEMCACHE)) { + if (!(cacheFlags & AFSCALL_INIT_MEMCACHE)) { do { cacheIteration++; if (SweepAFSCache(&vFilesFound)) { @@ -1651,11 +1787,12 @@ mainproc(as, arock) exit(1); } if (afsd_verbose) - printf("%s: %d out of %d data cache files found in sweep %d.\n", - rn, vFilesFound, cacheFiles, cacheIteration); - } while ((vFilesFound < cacheFiles) && - (cacheIteration < MAX_CACHE_LOOPS)); - } else if(afsd_verbose) + printf + ("%s: %d out of %d data cache files found in sweep %d.\n", + rn, vFilesFound, cacheFiles, cacheIteration); + } while ((vFilesFound < cacheFiles) + && (cacheIteration < MAX_CACHE_LOOPS)); + } else if (afsd_verbose) printf("%s: Using memory cache, not swept\n", rn); /* @@ -1663,10 +1800,10 @@ mainproc(as, arock) * dcache entries. */ if (afsd_debug) - printf("%s: Calling AFSOP_CACHEINFO: dcache file is '%s'\n", - rn, fullpn_DCacheFile); + printf("%s: Calling AFSOP_CACHEINFO: dcache file is '%s'\n", rn, + fullpn_DCacheFile); /* once again, meaningless for a memory-based cache. */ - if(!(cacheFlags & AFSCALL_INIT_MEMCACHE)) + if (!(cacheFlags & AFSCALL_INIT_MEMCACHE)) call_syscall(AFSOP_CACHEINFO, fullpn_DCacheFile); /* @@ -1674,8 +1811,8 @@ mainproc(as, arock) * cell information. */ if (afsd_debug) - printf("%s: Calling AFSOP_CELLINFO: cell info file is '%s'\n", - rn, fullpn_CellInfoFile); + printf("%s: Calling AFSOP_CELLINFO: cell info file is '%s'\n", rn, + fullpn_CellInfoFile); call_syscall(AFSOP_CELLINFO, fullpn_CellInfoFile); if (enable_dynroot) { @@ -1694,6 +1831,14 @@ mainproc(as, arock) printf("%s: Error enabling fakestat support.\n", rn); } + if (enable_backuptree) { + if (afsd_verbose) + printf("%s: Enabling backup tree support in kernel.\n", rn); + code = call_syscall(AFSOP_SET_BACKUPTREE, enable_backuptree); + if (code) + printf("%s: Error enabling backup tree support.\n", rn); + } + /* * Tell the kernel about each cell in the configuration. */ @@ -1734,7 +1879,7 @@ mainproc(as, arock) */ nDaemons++; #endif - for (i=0;iparms[18].items) #else - if (!(cacheFlags & AFSCALL_INIT_MEMCACHE)) /* ... nor this ... */ + if (!(cacheFlags & AFSCALL_INIT_MEMCACHE)) /* ... nor this ... */ #endif - call_syscall(AFSOP_AFSLOG,fullpn_AFSLogFile); + call_syscall(AFSOP_AFSLOG, fullpn_AFSLogFile); /* * Give the kernel the names of the AFS files cached on the workstation's * disk. */ if (afsd_debug) - printf("%s: Calling AFSOP_CACHEINODE for each of the %d files in '%s'\n", - rn, cacheFiles, cacheBaseDir); - if (!(cacheFlags & AFSCALL_INIT_MEMCACHE)) /* ... and again ... */ + printf + ("%s: Calling AFSOP_CACHEINODE for each of the %d files in '%s'\n", + rn, cacheFiles, cacheBaseDir); + if (!(cacheFlags & AFSCALL_INIT_MEMCACHE)) /* ... and again ... */ for (currVFile = 0; currVFile < cacheFiles; currVFile++) { #ifdef AFS_SGI62_ENV call_syscall(AFSOP_CACHEINODE, - (afs_uint32)(inode_for_V[currVFile]>>32), - (afs_uint32)(inode_for_V[currVFile] & 0xffffffff)); + (afs_uint32) (inode_for_V[currVFile] >> 32), + (afs_uint32) (inode_for_V[currVFile] & 0xffffffff)); #else call_syscall(AFSOP_CACHEINODE, inode_for_V[currVFile]); #endif - } /*end for*/ + } + /*end for */ /* * All the necessary info has been passed into the kernel to run an AFS * system. Give the kernel our go-ahead. */ if (afsd_debug) - printf("%s: Calling AFSOP_GO with cacheSetTime = %d\n", - rn, cacheSetTime); - call_syscall(AFSOP_GO, cacheSetTime); + printf("%s: Calling AFSOP_GO with cacheSetTime = %d\n", rn, + cacheSetTime); + call_syscall(AFSOP_GO, cacheSetTime); /* * At this point, we have finished passing the kernel all the info @@ -1839,12 +1986,12 @@ mainproc(as, arock) if (!enable_nomount) { - mountFlags = 0; /* Read/write file system, can do setuid() */ + mountFlags = 0; /* Read/write file system, can do setuid() */ #if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) #ifdef AFS_SUN5_ENV - mountFlags |= MS_DATA; + mountFlags |= MS_DATA; #else - mountFlags |= M_NEWTYPE; /* This searches by name in vfs_conf.c so don't need to recompile vfs.c because MOUNT_MAXTYPE has changed; it seems that Sun fixed this at last... */ + mountFlags |= M_NEWTYPE; /* This searches by name in vfs_conf.c so don't need to recompile vfs.c because MOUNT_MAXTYPE has changed; it seems that Sun fixed this at last... */ #endif #endif @@ -1852,59 +1999,63 @@ mainproc(as, arock) mountFlags |= MS_DATA; #endif - if (afsd_verbose) - printf("%s: Mounting the AFS root on '%s', flags: %d.\n", - rn, cacheMountDir, mountFlags); + if (afsd_verbose) + printf("%s: Mounting the AFS root on '%s', flags: %d.\n", rn, + cacheMountDir, mountFlags); #ifdef AFS_DEC_ENV - if ((mount("AFS",cacheMountDir,mountFlags,GT_AFS,(caddr_t) 0)) < 0) { + if ((mount("AFS", cacheMountDir, mountFlags, GT_AFS, (caddr_t) 0)) < + 0) { #else #ifdef AFS_FBSD_ENV - if ((mount("AFS",cacheMountDir,mountFlags,(caddr_t) 0)) < 0) { + if ((mount("AFS", cacheMountDir, mountFlags, (caddr_t) 0)) < 0) { #else #ifdef AFS_AUX_ENV - if ((fsmount(MOUNT_AFS,cacheMountDir,mountFlags,(caddr_t) 0)) < 0) { + if ((fsmount(MOUNT_AFS, cacheMountDir, mountFlags, (caddr_t) 0)) < 0) { #else #ifdef AFS_AIX_ENV - if (aix_vmount()) { + if (aix_vmount()) { #else #if defined(AFS_HPUX100_ENV) - if ((mount("",cacheMountDir,mountFlags,"afs", (char *)0, 0)) < 0) { + if ((mount("", cacheMountDir, mountFlags, "afs", NULL, 0)) < 0) { #else #ifdef AFS_HPUX_ENV #if defined(AFS_HPUX90_ENV) - { - char buffer[80]; - int code; - - strcpy(buffer, "afs"); - code = vfsmount(-1,cacheMountDir,mountFlags,(caddr_t) buffer); - sscanf(buffer, "%d", &vfs1_type); - if (code < 0) { - printf("Can't find 'afs' type in the registered filesystem table!\n"); - exit(1); + { + char buffer[80]; + int code; + + strcpy(buffer, "afs"); + code = vfsmount(-1, cacheMountDir, mountFlags, (caddr_t) buffer); + sscanf(buffer, "%d", &vfs1_type); + if (code < 0) { + printf + ("Can't find 'afs' type in the registered filesystem table!\n"); + exit(1); + } + sscanf(buffer, "%d", &vfs1_type); + if (afsd_verbose) + printf("AFS vfs slot number is %d\n", vfs1_type); } - sscanf(buffer, "%d", &vfs1_type); - if (afsd_verbose) - printf("AFS vfs slot number is %d\n", vfs1_type); - } - if ((vfsmount(vfs1_type,cacheMountDir,mountFlags,(caddr_t) 0)) < 0) { + if ((vfsmount(vfs1_type, cacheMountDir, mountFlags, (caddr_t) 0)) < 0) { #else - if (call_syscall(AFSOP_AFS_VFSMOUNT, MOUNT_AFS, cacheMountDir, - mountFlags, (caddr_t)NULL) < 0) { + if (call_syscall + (AFSOP_AFS_VFSMOUNT, MOUNT_AFS, cacheMountDir, mountFlags, + (caddr_t) NULL) < 0) { #endif #else #ifdef AFS_SUN5_ENV - if ((mount("AFS",cacheMountDir,mountFlags,"afs", (char *)0, 0)) < 0) { + if ((mount("AFS", cacheMountDir, mountFlags, "afs", NULL, 0)) < 0) { #else #if defined(AFS_SGI_ENV) - mountFlags = MS_FSS; - if ((mount(MOUNT_AFS,cacheMountDir,mountFlags,(caddr_t) MOUNT_AFS)) < 0) { + mountFlags = MS_FSS; + if ((mount(MOUNT_AFS, cacheMountDir, mountFlags, (caddr_t) MOUNT_AFS)) + < 0) { #else #ifdef AFS_LINUX20_ENV - if ((mount("AFS", cacheMountDir, MOUNT_AFS, 0, NULL))<0) { + if ((mount("AFS", cacheMountDir, MOUNT_AFS, 0, NULL)) < 0) { #else /* This is the standard mount used by the suns and rts */ - if ((mount(MOUNT_AFS,cacheMountDir,mountFlags,(caddr_t) 0)) < 0) { + if ((mount(MOUNT_AFS, cacheMountDir, mountFlags, (caddr_t) 0)) < 0) { #endif /* AFS_LINUX20_ENV */ #endif /* AFS_SGI_ENV */ #endif /* AFS_SUN5_ENV */ @@ -1914,12 +2065,12 @@ mainproc(as, arock) #endif /* AFS_AUX_ENV */ #endif /* AFS_FBSD_ENV */ #endif /* AFS_DEC_ENV */ - printf("%s: Can't mount AFS on %s(%d)\n", - rn, cacheMountDir, errno); - exit(1); - } + printf("%s: Can't mount AFS on %s(%d)\n", rn, cacheMountDir, + errno); + exit(1); + } - HandleMTab(); + HandleMTab(); } @@ -1944,49 +2095,77 @@ mainproc(as, arock) main(argc, argv) -int argc; -char **argv; { + int argc; + char **argv; +{ register struct cmd_syndesc *ts; - ts = cmd_CreateSyntax((char *) 0, mainproc, (char *) 0, "start AFS"); - cmd_AddParm(ts, "-blocks", CMD_SINGLE, CMD_OPTIONAL, "1024 byte blocks in cache"); + ts = cmd_CreateSyntax(NULL, mainproc, NULL, "start AFS"); + cmd_AddParm(ts, "-blocks", CMD_SINGLE, CMD_OPTIONAL, + "1024 byte blocks in cache"); cmd_AddParm(ts, "-files", CMD_SINGLE, CMD_OPTIONAL, "files in cache"); - cmd_AddParm(ts, "-rootvol", CMD_SINGLE, CMD_OPTIONAL, "name of AFS root volume"); - cmd_AddParm(ts, "-stat", CMD_SINGLE, CMD_OPTIONAL, "number of stat entries"); + cmd_AddParm(ts, "-rootvol", CMD_SINGLE, CMD_OPTIONAL, + "name of AFS root volume"); + cmd_AddParm(ts, "-stat", CMD_SINGLE, CMD_OPTIONAL, + "number of stat entries"); cmd_AddParm(ts, "-memcache", CMD_FLAG, CMD_OPTIONAL, "run diskless"); cmd_AddParm(ts, "-cachedir", CMD_SINGLE, CMD_OPTIONAL, "cache directory"); cmd_AddParm(ts, "-mountdir", CMD_SINGLE, CMD_OPTIONAL, "mount location"); - cmd_AddParm(ts, "-daemons", CMD_SINGLE, CMD_OPTIONAL, "number of daemons to use"); - cmd_AddParm(ts, "-nosettime", CMD_FLAG, CMD_OPTIONAL, "don't set the time"); - cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "display lots of information"); - cmd_AddParm(ts, "-rmtsys", CMD_FLAG, CMD_OPTIONAL, "start NFS rmtsysd program"); + cmd_AddParm(ts, "-daemons", CMD_SINGLE, CMD_OPTIONAL, + "number of daemons to use"); + cmd_AddParm(ts, "-nosettime", CMD_FLAG, CMD_OPTIONAL, + "don't set the time"); + cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, + "display lots of information"); + cmd_AddParm(ts, "-rmtsys", CMD_FLAG, CMD_OPTIONAL, + "start NFS rmtsysd program"); cmd_AddParm(ts, "-debug", CMD_FLAG, CMD_OPTIONAL, "display debug info"); - cmd_AddParm(ts, "-chunksize", CMD_SINGLE, CMD_OPTIONAL, "log(2) of chunk size"); - cmd_AddParm(ts, "-dcache", CMD_SINGLE, CMD_OPTIONAL, "number of dcache entries"); - cmd_AddParm(ts, "-volumes", CMD_SINGLE, CMD_OPTIONAL, "number of volume entries"); - cmd_AddParm(ts, "-biods", CMD_SINGLE, CMD_OPTIONAL, "number of bkg I/O daemons (aix vm)"); - - cmd_AddParm(ts, "-prealloc", CMD_SINGLE, CMD_OPTIONAL, "number of 'small' preallocated blocks"); + cmd_AddParm(ts, "-chunksize", CMD_SINGLE, CMD_OPTIONAL, + "log(2) of chunk size"); + cmd_AddParm(ts, "-dcache", CMD_SINGLE, CMD_OPTIONAL, + "number of dcache entries"); + cmd_AddParm(ts, "-volumes", CMD_SINGLE, CMD_OPTIONAL, + "number of volume entries"); + cmd_AddParm(ts, "-biods", CMD_SINGLE, CMD_OPTIONAL, + "number of bkg I/O daemons (aix vm)"); + + cmd_AddParm(ts, "-prealloc", CMD_SINGLE, CMD_OPTIONAL, + "number of 'small' preallocated blocks"); #ifdef notdef - cmd_AddParm(ts, "-pininodes", CMD_SINGLE, CMD_OPTIONAL, "number of inodes to hog"); + cmd_AddParm(ts, "-pininodes", CMD_SINGLE, CMD_OPTIONAL, + "number of inodes to hog"); #endif - cmd_AddParm(ts, "-confdir", CMD_SINGLE, CMD_OPTIONAL, "configuration directory"); - cmd_AddParm(ts, "-logfile", CMD_SINGLE, CMD_OPTIONAL, "Place to keep the CM log"); - cmd_AddParm(ts, "-waitclose", CMD_FLAG, CMD_OPTIONAL, "make close calls synchronous"); - cmd_AddParm(ts, "-shutdown", CMD_FLAG, CMD_OPTIONAL, "Shutdown all afs state"); - cmd_AddParm(ts, "-enable_peer_stats", CMD_FLAG, CMD_OPTIONAL|CMD_HIDE, "Collect rpc statistics by peer"); - cmd_AddParm(ts, "-enable_process_stats", CMD_FLAG, CMD_OPTIONAL|CMD_HIDE, "Collect rpc statistics for this process"); - cmd_AddParm(ts, "-mem_alloc_sleep", CMD_FLAG, (CMD_OPTIONAL | CMD_HIDE), "Allow sleeps when allocating memory cache"); + cmd_AddParm(ts, "-confdir", CMD_SINGLE, CMD_OPTIONAL, + "configuration directory"); + cmd_AddParm(ts, "-logfile", CMD_SINGLE, CMD_OPTIONAL, + "Place to keep the CM log"); + cmd_AddParm(ts, "-waitclose", CMD_FLAG, CMD_OPTIONAL, + "make close calls synchronous"); + cmd_AddParm(ts, "-shutdown", CMD_FLAG, CMD_OPTIONAL, + "Shutdown all afs state"); + cmd_AddParm(ts, "-enable_peer_stats", CMD_FLAG, CMD_OPTIONAL | CMD_HIDE, + "Collect rpc statistics by peer"); + cmd_AddParm(ts, "-enable_process_stats", CMD_FLAG, + CMD_OPTIONAL | CMD_HIDE, + "Collect rpc statistics for this process"); + cmd_AddParm(ts, "-mem_alloc_sleep", CMD_FLAG, (CMD_OPTIONAL | CMD_HIDE), + "Allow sleeps when allocating memory cache"); cmd_AddParm(ts, "-afsdb", CMD_FLAG, (CMD_OPTIONAL #ifndef AFS_AFSDB_ENV - | CMD_HIDE + | CMD_HIDE #endif ), "Enable AFSDB support"); - cmd_AddParm(ts, "-files_per_subdir", CMD_SINGLE, CMD_OPTIONAL, "log(2) of the number of cache files per cache subdirectory"); - cmd_AddParm(ts, "-dynroot", CMD_FLAG, CMD_OPTIONAL, "Enable dynroot support"); - cmd_AddParm(ts, "-fakestat", CMD_FLAG, CMD_OPTIONAL, "Enable fakestat support for cross-cell mounts"); - cmd_AddParm(ts, "-fakestat-all", CMD_FLAG, CMD_OPTIONAL, "Enable fakestat support for all mounts"); + cmd_AddParm(ts, "-files_per_subdir", CMD_SINGLE, CMD_OPTIONAL, + "log(2) of the number of cache files per cache subdirectory"); + cmd_AddParm(ts, "-dynroot", CMD_FLAG, CMD_OPTIONAL, + "Enable dynroot support"); + cmd_AddParm(ts, "-fakestat", CMD_FLAG, CMD_OPTIONAL, + "Enable fakestat support for cross-cell mounts"); + cmd_AddParm(ts, "-fakestat-all", CMD_FLAG, CMD_OPTIONAL, + "Enable fakestat support for all mounts"); cmd_AddParm(ts, "-nomount", CMD_FLAG, CMD_OPTIONAL, "Do not mount AFS"); + cmd_AddParm(ts, "-backuptree", CMD_FLAG, CMD_OPTIONAL, + "Prefer backup volumes for mointpoints in backup volumes"); return (cmd_Dispatch(argc, argv)); } @@ -2001,7 +2180,9 @@ char **argv; { #endif #endif -static int HandleMTab() { +static int +HandleMTab() +{ #if (defined (AFS_SUN_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV)) && !defined(AFS_SUN58_ENV) FILE *tfilep; #ifdef AFS_SUN5_ENV @@ -2018,7 +2199,7 @@ static int HandleMTab() { tmntent.mnt_mountp = cacheMountDir; tmntent.mnt_fstype = "xx"; tmntent.mnt_mntopts = "rw"; - sprintf(tbuf, "%ld", (long)time((time_t *)0)); + sprintf(tbuf, "%ld", (long)time((time_t *) 0)); tmntent.mnt_time = tbuf; putmntent(tfilep, &tmntent); fclose(tfilep); @@ -2052,22 +2233,25 @@ static int HandleMTab() { tmntent.mnt_freq = 1; tmntent.mnt_passno = 3; #ifdef AFS_HPUX_ENV + tmntent.mnt_type = "afs"; tmntent.mnt_time = time(0); tmntent.mnt_cnode = 0; #endif addmntent(tfilep, &tmntent); endmntent(tfilep); -#endif /* AFS_SGI_ENV */ -#endif /* AFS_SUN5_ENV */ -#endif /* unreasonable systems */ +#endif /* AFS_SGI_ENV */ +#endif /* AFS_SUN5_ENV */ +#endif /* unreasonable systems */ #ifdef AFS_DARWIN_ENV mach_port_t diskarb_port; kern_return_t status; status = DiskArbStart(&diskarb_port); if (status == KERN_SUCCESS) { - status = DiskArbDiskAppearedWithMountpointPing_auto("AFS", - kDiskArbDiskAppearedNetworkDiskMask, cacheMountDir); + status = + DiskArbDiskAppearedWithMountpointPing_auto("AFS", + DISK_ARB_NETWORK_DISK_FLAG, + cacheMountDir); } return status; @@ -2076,44 +2260,65 @@ static int HandleMTab() { } #if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) + call_syscall(param1, param2, param3, param4, param5, param6, param7) -long param1, param2, param3, param4, param5, param6, param7; + long param1, param2, param3, param4, param5, param6, param7; { int error; #ifdef AFS_LINUX20_ENV long eparm[4]; + struct afsprocdata syscall_data; + int fd = open(PROC_SYSCALL_FNAME,O_RDWR); eparm[0] = param4; eparm[1] = param5; eparm[2] = param6; eparm[3] = param7; - param4 = (long) eparm; + param4 = (long)eparm; + + syscall_data.syscall = AFSCALL_CALL; + syscall_data.param1 = param1; + syscall_data.param2 = param2; + syscall_data.param3 = param3; + syscall_data.param4 = param4; + if(fd > 0) { + error = ioctl(fd, VIOC_SYSCALL, &syscall_data); + close(fd); + } + else #endif + error = + syscall(AFS_SYSCALL, AFSCALL_CALL, param1, param2, param3, param4, + param5, param6, param7); - error = syscall(AFS_SYSCALL, AFSCALL_CALL, param1, param2, param3, param4, param5, param6, param7); - if (afsd_verbose) printf("SScall(%d, %d, %d)=%d ", AFS_SYSCALL, AFSCALL_CALL, param1, error); + if (afsd_verbose) + printf("SScall(%d, %d, %d)=%d ", AFS_SYSCALL, AFSCALL_CALL, param1, + error); return (error); } -#else /* AFS_AIX32_ENV */ +#else /* AFS_AIX32_ENV */ #if defined(AFS_SGI_ENV) call_syscall(call, parm0, parm1, parm2, parm3, parm4) { - int error; + int error; - error = afs_syscall(call, parm0, parm1, parm2, parm3, parm4); - if (afsd_verbose) printf("SScall(%d, %d)=%d ", call, parm0, error); + error = afs_syscall(call, parm0, parm1, parm2, parm3, parm4); + if (afsd_verbose) + printf("SScall(%d, %d)=%d ", call, parm0, error); - return error; + return error; } #else -call_syscall(call, parm0, parm1, parm2, parm3, parm4, parm5, parm6) { +call_syscall(call, parm0, parm1, parm2, parm3, parm4, parm5, parm6) +{ - return syscall(AFSCALL_CALL, call, parm0, parm1, parm2, parm3, parm4, parm5, parm6); + return syscall(AFSCALL_CALL, call, parm0, parm1, parm2, parm3, parm4, + parm5, parm6); } #endif /* AFS_SGI_ENV */ -#endif /* AFS_AIX32_ENV */ +#endif /* AFS_AIX32_ENV */ #ifdef AFS_AIX_ENV @@ -2122,88 +2327,89 @@ call_syscall(call, parm0, parm1, parm2, parm3, parm4, parm5, parm6) { #define ROUNDUP(x) (((x) + 3) & ~3) -aix_vmount() { - struct vmount *vmountp; +aix_vmount() +{ + struct vmount *vmountp; int size, error; - size = sizeof(struct vmount) + ROUNDUP(strlen(cacheMountDir)+1) + 5*4; + size = sizeof(struct vmount) + ROUNDUP(strlen(cacheMountDir) + 1) + 5 * 4; /* Malloc the vmount structure */ if ((vmountp = (struct vmount *)malloc(size)) == (struct vmount *)NULL) { - printf("Can't allocate space for the vmount structure (AIX)\n"); - exit(1); + printf("Can't allocate space for the vmount structure (AIX)\n"); + exit(1); } /* zero out the vmount structure */ memset(vmountp, '\0', size); - + /* transfer info into the vmount structure */ vmountp->vmt_revision = VMT_REVISION; vmountp->vmt_length = size; vmountp->vmt_fsid.fsid_dev = 0; vmountp->vmt_fsid.fsid_type = AFS_MOUNT_AFS; vmountp->vmt_vfsnumber = 0; - vmountp->vmt_time = 0;/* We'll put the time soon! */ + vmountp->vmt_time = 0; /* We'll put the time soon! */ vmountp->vmt_flags = VFS_DEVMOUNT; /* read/write permission */ vmountp->vmt_gfstype = AFS_MOUNT_AFS; vmountdata(vmountp, "AFS", cacheMountDir, "", "", "", "rw"); - + /* Do the actual mount system call */ error = vmount(vmountp, size); free(vmountp); - return(error); + return (error); } vmountdata(vmtp, obj, stub, host, hostsname, info, args) -struct vmount *vmtp; -char *obj, *stub, *host, *hostsname, *info, *args; + struct vmount *vmtp; + char *obj, *stub, *host, *hostsname, *info, *args; { - register struct data { - short vmt_off; - short vmt_size; - } *vdp, *vdprev; - register int size; - - vdp = (struct data *)vmtp->vmt_data; - vdp->vmt_off = sizeof(struct vmount); - size = ROUNDUP(strlen(obj) + 1); - vdp->vmt_size = size; - strcpy(vmt2dataptr(vmtp, VMT_OBJECT), obj); - - vdprev = vdp; - vdp++; - vdp->vmt_off = vdprev->vmt_off + size; - size = ROUNDUP(strlen(stub) + 1); - vdp->vmt_size = size; - strcpy(vmt2dataptr(vmtp, VMT_STUB), stub); - - vdprev = vdp; - vdp++; - vdp->vmt_off = vdprev->vmt_off + size; - size = ROUNDUP(strlen(host) + 1); - vdp->vmt_size = size; - strcpy(vmt2dataptr(vmtp, VMT_HOST), host); - - vdprev = vdp; - vdp++; - vdp->vmt_off = vdprev->vmt_off + size; - size = ROUNDUP(strlen(hostsname) + 1); - vdp->vmt_size = size; - strcpy(vmt2dataptr(vmtp, VMT_HOSTNAME), hostsname); - - - vdprev = vdp; - vdp++; - vdp->vmt_off = vdprev->vmt_off + size; - size = ROUNDUP(strlen(info) + 1); - vdp->vmt_size = size; - strcpy(vmt2dataptr(vmtp, VMT_INFO), info); - - vdprev = vdp; - vdp++; - vdp->vmt_off = vdprev->vmt_off + size; - size = ROUNDUP(strlen(args) + 1); - vdp->vmt_size = size; - strcpy(vmt2dataptr(vmtp, VMT_ARGS), args); + register struct data { + short vmt_off; + short vmt_size; + } *vdp, *vdprev; + register int size; + + vdp = (struct data *)vmtp->vmt_data; + vdp->vmt_off = sizeof(struct vmount); + size = ROUNDUP(strlen(obj) + 1); + vdp->vmt_size = size; + strcpy(vmt2dataptr(vmtp, VMT_OBJECT), obj); + + vdprev = vdp; + vdp++; + vdp->vmt_off = vdprev->vmt_off + size; + size = ROUNDUP(strlen(stub) + 1); + vdp->vmt_size = size; + strcpy(vmt2dataptr(vmtp, VMT_STUB), stub); + + vdprev = vdp; + vdp++; + vdp->vmt_off = vdprev->vmt_off + size; + size = ROUNDUP(strlen(host) + 1); + vdp->vmt_size = size; + strcpy(vmt2dataptr(vmtp, VMT_HOST), host); + + vdprev = vdp; + vdp++; + vdp->vmt_off = vdprev->vmt_off + size; + size = ROUNDUP(strlen(hostsname) + 1); + vdp->vmt_size = size; + strcpy(vmt2dataptr(vmtp, VMT_HOSTNAME), hostsname); + + + vdprev = vdp; + vdp++; + vdp->vmt_off = vdprev->vmt_off + size; + size = ROUNDUP(strlen(info) + 1); + vdp->vmt_size = size; + strcpy(vmt2dataptr(vmtp, VMT_INFO), info); + + vdprev = vdp; + vdp++; + vdp->vmt_off = vdprev->vmt_off + size; + size = ROUNDUP(strlen(args) + 1); + vdp->vmt_size = size; + strcpy(vmt2dataptr(vmtp, VMT_ARGS), args); } #endif /* AFS_AIX_ENV */ @@ -2216,13 +2422,13 @@ char *obj, *stub, *host, *hostsname, *info, *args; /* Contains list of names to find in given file. */ typedef struct { - char *name; /* Name of variable or function. */ - afs_hyper_t addr; /* Address of function, undefined if not found. */ - Dwarf_Half type; /* DW_AT_location for vars, DW_AT_lowpc for func's */ - char found; /* set if found. */ + char *name; /* Name of variable or function. */ + afs_hyper_t addr; /* Address of function, undefined if not found. */ + Dwarf_Half type; /* DW_AT_location for vars, DW_AT_lowpc for func's */ + char found; /* set if found. */ } staticAddrList; -typedef struct { +typedef struct { char *file; /* Name of file containing vars or funcs */ staticAddrList *addrList; /* List of vars and/or funcs. */ int nAddrs; /* # of addrList's */ @@ -2246,11 +2452,13 @@ void getElfAddress(Dwarf_Debug, Dwarf_Die, staticAddrList *); -void set_staticaddrs(void) +void +set_staticaddrs(void) { staticNameList fileList[AFS_N_FILELISTS]; - fileList[0].addrList = (staticAddrList*)calloc(1, sizeof(staticAddrList)); + fileList[0].addrList = + (staticAddrList *) calloc(1, sizeof(staticAddrList)); if (!fileList[0].addrList) { printf("set_staticaddrs: Can't calloc fileList[0].addrList\n"); return; @@ -2263,7 +2471,8 @@ void set_staticaddrs(void) fileList[0].addrList[0].found = 0; #if defined(AFS_SGI62_ENV) && !defined(AFS_SGI65_ENV) - fileList[1].addrList = (staticAddrList*)calloc(2, sizeof(staticAddrList)); + fileList[1].addrList = + (staticAddrList *) calloc(2, sizeof(staticAddrList)); if (!fileList[1].addrList) { printf("set_staticaddrs: Can't malloc fileList[1].addrList\n"); return; @@ -2287,8 +2496,7 @@ void set_staticaddrs(void) if (fileList[0].addrList[0].found) { call_syscall(AFSOP_NFSSTATICADDR2, fileList[0].addrList[0].addr.high, fileList[0].addrList[0].addr.low); - } - else { + } else { if (afsd_verbose) printf("NFS V2 is not present in the kernel.\n"); } @@ -2300,8 +2508,7 @@ void set_staticaddrs(void) fileList[1].addrList[0].addr.low, fileList[1].addrList[1].addr.high, fileList[1].addrList[1].addr.low); - } - else { + } else { if (!fileList[1].addrList[0].found) printf("Can't find %s in kernel. Exiting.\n", fileList[1].addrList[0].name); @@ -2324,7 +2531,7 @@ findDwarfStaticAddresses(staticNameList * nameList, int nLists) int found = 0; int code; char *s; - char *hname = (char*)0; + char *hname = (char *)0; Dwarf_Unsigned dwarf_access = O_RDONLY; Dwarf_Debug dwarf_debug; Dwarf_Error dwarf_error; @@ -2341,12 +2548,12 @@ findDwarfStaticAddresses(staticNameList * nameList, int nLists) return; } - if ((fd=open("/unix", O_RDONLY,0))<0) { + if ((fd = open("/unix", O_RDONLY, 0)) < 0) { printf("findDwarfStaticAddresses: Failed to open /unix.\n"); return; } - code = dwarf_init(fd, dwarf_access, NULL, NULL, &dwarf_debug, - &dwarf_error); + code = + dwarf_init(fd, dwarf_access, NULL, NULL, &dwarf_debug, &dwarf_error); if (code != DW_DLV_OK) { /* Nope hope for the elves and dwarves, try intermediate code. */ close(fd); @@ -2358,16 +2565,13 @@ findDwarfStaticAddresses(staticNameList * nameList, int nLists) /* Run through the headers until we find ones for files we've * specified in nameList. */ - code = dwarf_next_cu_header(dwarf_debug, - &dwarf_cu_header_length, NULL, - &dwarf_abbrev_offset, - &dwarf_address_size, - &next_cu_header, - &dwarf_error); + code = + dwarf_next_cu_header(dwarf_debug, &dwarf_cu_header_length, NULL, + &dwarf_abbrev_offset, &dwarf_address_size, + &next_cu_header, &dwarf_error); if (code == DW_DLV_NO_ENTRY) { break; - } - else if (code == DW_DLV_ERROR) { + } else if (code == DW_DLV_ERROR) { printf("findDwarfStaticAddresses: Error reading headers: %s\n", dwarf_errmsg(dwarf_error)); break; @@ -2384,28 +2588,28 @@ findDwarfStaticAddresses(staticNameList * nameList, int nLists) code = dwarf_diename(dwarf_die, &hname, &dwarf_error); if (code == DW_DLV_OK) { s = strrchr(hname, '/'); - for (i=0; i= nLists) { /* we're done */ + hname = (char *)0; + if (found >= nLists) { /* we're done */ break; } } - /* Frees up all allocated space. */ - (void) dwarf_finish(dwarf_debug, &dwarf_error); + /* Frees up all allocated space. */ + (void)dwarf_finish(dwarf_debug, &dwarf_error); close(fd); } @@ -2418,10 +2622,10 @@ findElfAddresses(Dwarf_Debug dwarf_debug, Dwarf_Die dwarf_die, Dwarf_Die dwarf_next_die; Dwarf_Die dwarf_child_die; Dwarf_Attribute dwarf_return_attr; - char *vname = (char*)0; + char *vname = (char *)0; int found = 0; int code; - + /* Drop into this die to find names in addrList. */ code = dwarf_child(dwarf_die, &dwarf_child_die, &dwarf_error); if (code != DW_DLV_OK) { @@ -2431,18 +2635,17 @@ findElfAddresses(Dwarf_Debug dwarf_debug, Dwarf_Die dwarf_die, } /* Try to find names in each sibling. */ - dwarf_next_die = (Dwarf_Die)0; + dwarf_next_die = (Dwarf_Die) 0; do { - code = dwarf_diename(dwarf_child_die, &vname, - &dwarf_error); + code = dwarf_diename(dwarf_child_die, &vname, &dwarf_error); /* It's possible that some siblings don't have names. */ if (code == DW_DLV_OK) { - for (i=0; inAddrs; i++) { + for (i = 0; i < nameList->nAddrs; i++) { if (!nameList->addrList[i].found) { if (!strcmp(vname, nameList->addrList[i].name)) { getElfAddress(dwarf_debug, dwarf_child_die, - &(nameList->addrList[i])); - found ++; + &(nameList->addrList[i])); + found++; break; } } @@ -2451,22 +2654,22 @@ findElfAddresses(Dwarf_Debug dwarf_debug, Dwarf_Die dwarf_die, if (dwarf_next_die) dwarf_dealloc(dwarf_debug, dwarf_next_die, DW_DLA_DIE); - if (found >= nameList->nAddrs) { /* we're done. */ + if (found >= nameList->nAddrs) { /* we're done. */ break; } dwarf_next_die = dwarf_child_die; - code = dwarf_siblingof(dwarf_debug, dwarf_next_die, - &dwarf_child_die, - &dwarf_error); - - } while(code == DW_DLV_OK); + code = + dwarf_siblingof(dwarf_debug, dwarf_next_die, &dwarf_child_die, + &dwarf_error); + + } while (code == DW_DLV_OK); } /* Get address out of current die. */ void -getElfAddress(Dwarf_Debug dwarf_debug, - Dwarf_Die dwarf_child_die, staticAddrList *addrList) +getElfAddress(Dwarf_Debug dwarf_debug, Dwarf_Die dwarf_child_die, + staticAddrList * addrList) { int i; Dwarf_Error dwarf_error; @@ -2474,19 +2677,21 @@ getElfAddress(Dwarf_Debug dwarf_debug, Dwarf_Bool dwarf_return_bool; Dwarf_Locdesc *llbuf = NULL; Dwarf_Signed listlen; - off64_t addr = (off64_t)0; + off64_t addr = (off64_t) 0; int code; - code = dwarf_hasattr(dwarf_child_die, addrList->type, - &dwarf_return_bool, &dwarf_error); - if ((code != DW_DLV_OK) || (!dwarf_return_bool)) { - printf("getElfAddress: no address given for %s. %s\n", - addrList->name, (code == DW_DLV_ERROR) ? dwarf_errmsg(dwarf_error) : ""); + code = + dwarf_hasattr(dwarf_child_die, addrList->type, &dwarf_return_bool, + &dwarf_error); + if ((code != DW_DLV_OK) || (!dwarf_return_bool)) { + printf("getElfAddress: no address given for %s. %s\n", addrList->name, + (code == DW_DLV_ERROR) ? dwarf_errmsg(dwarf_error) : ""); return; } - code = dwarf_attr(dwarf_child_die, addrList->type, - &dwarf_return_attr, &dwarf_error); - if (code != DW_DLV_OK) { + code = + dwarf_attr(dwarf_child_die, addrList->type, &dwarf_return_attr, + &dwarf_error); + if (code != DW_DLV_OK) { printf("getElfAddress: Can't get attribute. %s\n", (code == DW_DLV_ERROR) ? dwarf_errmsg(dwarf_error) : ""); return; @@ -2494,9 +2699,9 @@ getElfAddress(Dwarf_Debug dwarf_debug, switch (addrList->type) { case DW_AT_location: - code = dwarf_loclist(dwarf_return_attr, &llbuf, - &listlen, &dwarf_error); - if (code != DW_DLV_OK) { + code = + dwarf_loclist(dwarf_return_attr, &llbuf, &listlen, &dwarf_error); + if (code != DW_DLV_OK) { printf("getElfAddress: Can't get location for %s. %s\n", addrList->name, (code == DW_DLV_ERROR) ? dwarf_errmsg(dwarf_error) : ""); @@ -2511,22 +2716,23 @@ getElfAddress(Dwarf_Debug dwarf_debug, break; case DW_AT_low_pc: - code = dwarf_lowpc(dwarf_child_die, (Dwarf_Addr*)&addr, &dwarf_error); - if ( code != DW_DLV_OK) { + code = + dwarf_lowpc(dwarf_child_die, (Dwarf_Addr *) & addr, &dwarf_error); + if (code != DW_DLV_OK) { printf("getElfAddress: Can't get lowpc for %s. %s\n", addrList->name, (code == DW_DLV_ERROR) ? dwarf_errmsg(dwarf_error) : ""); return; } break; - + default: printf("getElfAddress: Bad case %d in switch.\n", addrList->type); return; } - addrList->addr.high = (addr>>32) & 0xffffffff; - addrList->addr.low = addr & 0xffffffff; + addrList->addr.high = (addr >> 32) & 0xffffffff; + addrList->addr.low = addr & 0xffffffff; addrList->found = 1; } @@ -2542,12 +2748,13 @@ getElfAddress(Dwarf_Debug dwarf_debug, * If found, sets the found bit and the address and returns 1. * Not found returns 0. */ -int SearchNameList(char *name, afs_uint32 addr, staticNameList *nameList, - int nLists) +int +SearchNameList(char *name, afs_uint32 addr, staticNameList * nameList, + int nLists) { - int i, j; - for (i=0; id_buf); + long *buf = (long *)(elf_getdata(scnp, NULL)->d_buf); u_long addr, mdoff = shdrp->sh_offset; HDRR *hdrp; SYMR *symbase, *symp, *symend; @@ -2574,39 +2781,37 @@ SearchMDebug(Elf_Scn *scnp, Elf32_Shdr *shdrp, staticNameList * nameList, char *strbase, *str; int ifd; int nFound = 0; - + /* get header */ - addr = (__psunsigned_t)buf; - hdrp = (HDRR *)addr; - + addr = (__psunsigned_t) buf; + hdrp = (HDRR *) addr; + /* setup base addresses */ - addr = (u_long)buf + (u_long)(hdrp->cbFdOffset - mdoff); - fdrbase = (FDR *)addr; - addr = (u_long)buf + (u_long)(hdrp->cbSymOffset - mdoff); - symbase = (SYMR *)addr; - addr = (u_long)buf + (u_long)(hdrp->cbSsOffset - mdoff); + addr = (u_long) buf + (u_long) (hdrp->cbFdOffset - mdoff); + fdrbase = (FDR *) addr; + addr = (u_long) buf + (u_long) (hdrp->cbSymOffset - mdoff); + symbase = (SYMR *) addr; + addr = (u_long) buf + (u_long) (hdrp->cbSsOffset - mdoff); strbase = (char *)addr; - + #define KEEPER(a,b) ((a == stStaticProc && b == scText) || \ (a == stStatic && (b == scData || b == scBss || \ b == scSBss || b == scSData))) - + for (fdrp = fdrbase; fdrp < &fdrbase[hdrp->ifdMax]; fdrp++) { str = strbase + fdrp->issBase + fdrp->rss; - + /* local symbols for each fd */ for (symp = &symbase[fdrp->isymBase]; - symp < &symbase[fdrp->isymBase+fdrp->csym]; - symp++) { + symp < &symbase[fdrp->isymBase + fdrp->csym]; symp++) { if (KEEPER(symp->st, symp->sc)) { if (symp->value == 0) continue; - + str = strbase + fdrp->issBase + symp->iss; /* Look for AFS symbols of interest */ - if (SearchNameList(str, symp->value, - nameList, nLists)) { - nFound ++; + if (SearchNameList(str, symp->value, nameList, nLists)) { + nFound++; if (nFound >= needed) return; } @@ -2614,37 +2819,38 @@ SearchMDebug(Elf_Scn *scnp, Elf32_Shdr *shdrp, staticNameList * nameList, } } } - + /* * returns section with the name of scn_name, & puts its header in shdr64 or * shdr32 based on elf's file type * */ Elf_Scn * -findMDebugSection(Elf *elf, char *scn_name) +findMDebugSection(Elf * elf, char *scn_name) { - Elf64_Ehdr *ehdr64; - Elf32_Ehdr *ehdr32; - Elf_Scn *scn = NULL; - Elf64_Shdr *shdr64; - Elf32_Shdr *shdr32; - - if ((ehdr32 = elf32_getehdr(elf)) == NULL) - return(NULL); - do { - if ((scn = elf_nextscn(elf, scn)) == NULL) - break; - if ((shdr32 = elf32_getshdr(scn)) == NULL) - return(NULL); - } while (strcmp(scn_name, elf_strptr(elf, ehdr32->e_shstrndx, - shdr32->sh_name))); + Elf64_Ehdr *ehdr64; + Elf32_Ehdr *ehdr32; + Elf_Scn *scn = NULL; + Elf64_Shdr *shdr64; + Elf32_Shdr *shdr32; + + if ((ehdr32 = elf32_getehdr(elf)) == NULL) + return (NULL); + do { + if ((scn = elf_nextscn(elf, scn)) == NULL) + break; + if ((shdr32 = elf32_getshdr(scn)) == NULL) + return (NULL); + } while (strcmp + (scn_name, + elf_strptr(elf, ehdr32->e_shstrndx, shdr32->sh_name))); - return(scn); + return (scn); } -void findMDebugStaticAddresses(staticNameList * nameList, int nLists, - int needed) +void +findMDebugStaticAddresses(staticNameList * nameList, int nLists, int needed) { int fd; Elf *elf; @@ -2658,8 +2864,9 @@ void findMDebugStaticAddresses(staticNameList * nameList, int nLists, } (void)elf_version(EV_CURRENT); - if((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { - printf("findMDebugStaticAddresses: /unix doesn't seem to be an elf file\n"); + if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { + printf + ("findMDebugStaticAddresses: /unix doesn't seem to be an elf file\n"); close(fd); return; } @@ -2674,9 +2881,9 @@ void findMDebugStaticAddresses(staticNameList * nameList, int nLists, goto find_end; } - (void) SearchMDebug(mdebug_scn, mdebug_shdr, nameList, nLists, needed); + (void)SearchMDebug(mdebug_scn, mdebug_shdr, nameList, nLists, needed); - find_end: + find_end: elf_end(elf); close(fd); } @@ -2684,30 +2891,31 @@ void findMDebugStaticAddresses(staticNameList * nameList, int nLists, #else /* AFS_SGI61_ENV */ #include -struct nlist nlunix[] = { - { "rfsdisptab_v2" }, - { 0 }, +struct nlist nlunix[] = { + {"rfsdisptab_v2"}, + {0}, }; -get_nfsstaticaddr() { +get_nfsstaticaddr() +{ int i, j, kmem, count; if ((kmem = open("/dev/kmem", O_RDONLY)) < 0) { printf("Warning: can't open /dev/kmem\n"); - return 0; + return 0; } if ((j = nlist("/unix", nlunix)) < 0) { printf("Warning: can't nlist /unix\n"); return 0; } i = nlunix[0].n_value; - if (lseek(kmem, i, L_SET/*0*/) != i) { - printf("Warning: can't lseek to %x\n", i); - return 0; + if (lseek(kmem, i, L_SET /*0 */ ) != i) { + printf("Warning: can't lseek to %x\n", i); + return 0; } if ((j = read(kmem, &count, sizeof count)) != sizeof count) { printf("WARNING: kmem read at %x failed\n", i); - return 0; + return 0; } return i; } diff --git a/src/afsd/rc.afs.rs_aix b/src/afsd/rc.afs.rs_aix index 665b0c15c..1fd8ba4c6 100644 --- a/src/afsd/rc.afs.rs_aix +++ b/src/afsd/rc.afs.rs_aix @@ -46,10 +46,26 @@ else RMTSYS="" fi +# find out whether we have 32 or 64 bit kernel + +kernel=32 +if [ -x /bin/w64 ]; then + /bin/w64 >/dev/null 2>&1 + if [ $? -eq 0 ]; then + kernel=64 + fi +fi + # Load AFS into the kernel + cd /usr/vice/etc/dkload -/usr/vice/etc/dkload/cfgexport -a /usr/vice/etc/dkload/export.ext${ExportExt} -/usr/vice/etc/dkload/cfgafs -a /usr/vice/etc/dkload/afs.ext${AFSExt} +if [ $kernel -eq 32 ]; then + echo "32-bit kernel found" + ./cfgexport -a export.ext${ExportExt} && ./cfgafs -a afs.ext.32 +else + echo "64-bit kernel assumed" + ./cfgexport64 -a export64.ext${ExportExt} && ./cfgafs64 -a afs.ext.64 +fi if [ $? -ne 0 ]; then /bin/echo "Unable to load AFS extensions into kernel. Not starting client." exit 1 diff --git a/src/afsd/rc.dkload.client.rs_aix b/src/afsd/rc.dkload.client.rs_aix index b8cc520de..b2fe37472 100644 --- a/src/afsd/rc.dkload.client.rs_aix +++ b/src/afsd/rc.dkload.client.rs_aix @@ -6,5 +6,19 @@ # directory or online at http://www.openafs.org/dl/license10.html echo 'Loading AFS ...'>/dev/console -/usr/vice/etc/dkload/cfgexport -a /usr/vice/etc/dkload/export.ext.nonfs -/usr/vice/etc/dkload/cfgafs -a /usr/vice/etc/dkload/afs.ext +# Load AFS into the kernel +cd /usr/vice/etc/dkload +./cfgexport -a /usr/vice/etc/dkload/export.ext.nonfs +if [ $? -eq 0 ]; then + echo "32-bit kernel found" + ./cfgafs -a /usr/vice/etc/dkload/afs.ext.32 +else + echo "64-bit kernel assumed" + ./cfgexport64 -a /usr/vice/etc/dkload/export64.ext.nonfs + ./cfgafs64 -a /usr/vice/etc/dkload/afs.ext.64 +fi +if [ $? -ne 0 ]; then + /bin/echo "Unable to load AFS extensions into kernel." + exit 1 +fi + diff --git a/src/afsd/vsys.c b/src/afsd/vsys.c index 999f484f6..3ff94e378 100644 --- a/src/afsd/vsys.c +++ b/src/afsd/vsys.c @@ -23,41 +23,47 @@ #include #endif -RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/vsys.c,v 1.1.1.5 2001/10/14 18:03:38 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afsd/vsys.c,v 1.6 2003/07/15 23:14:31 shadow Exp $"); #include #include "AFS_component_version_number.c" -main (argc, argv) - int argc; - char **argv; { +main(argc, argv) + int argc; + char **argv; +{ afs_int32 code; int i, counter; afs_int32 parms[6]; int numberFlag; - if (argc < 2) {printf("use: vsys \n"); exit(1); } + if (argc < 2) { + printf("use: vsys \n"); + exit(1); + } numberFlag = 1; counter = 0; - for(i=1;i #include -RCSID("$Header: /tmp/cvstemp/openafs/src/afsmonitor/afsmon-output.c,v 1.1.1.5 2001/07/14 22:20:18 hartmans Exp $"); - -#include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif + +RCSID + ("$Header: /cvs/openafs/src/afsmonitor/afsmon-output.c,v 1.9 2003/07/15 23:14:32 shadow Exp $"); + +#include #include @@ -34,8 +43,8 @@ extern char errMsg[256]; /* error message buffer */ extern int afsmon_Exit(); /* exit routine */ -static FILE *fs_outFD; /* fs output file descriptor */ -static FILE *cm_outFD; /* cm output file descriptor */ +static FILE *fs_outFD; /* fs output file descriptor */ +static FILE *cm_outFD; /* cm output file descriptor */ /* structures used by FS & CM stats print routines */ @@ -108,98 +117,127 @@ static char *xferOpNames[] = { * As advertised. *------------------------------------------------------------------------*/ -void Print_fs_OverallPerfInfo(a_ovP) - struct afs_PerfStats *a_ovP; +void +Print_fs_OverallPerfInfo(a_ovP) + struct afs_PerfStats *a_ovP; -{ /*Print_fs_OverallPerfInfo*/ +{ /*Print_fs_OverallPerfInfo */ - fprintf(fs_outFD,"\t%10d numPerfCalls\n\n", a_ovP->numPerfCalls); + fprintf(fs_outFD, "\t%10d numPerfCalls\n\n", a_ovP->numPerfCalls); /* * Vnode cache section. */ - fprintf(fs_outFD,"\t%10d vcache_L_Entries\n", a_ovP->vcache_L_Entries); - fprintf(fs_outFD,"\t%10d vcache_L_Allocs\n", a_ovP->vcache_L_Allocs); - fprintf(fs_outFD,"\t%10d vcache_L_Gets\n", a_ovP->vcache_L_Gets); - fprintf(fs_outFD,"\t%10d vcache_L_Reads\n", a_ovP->vcache_L_Reads); - fprintf(fs_outFD,"\t%10d vcache_L_Writes\n\n",a_ovP->vcache_L_Writes); - - fprintf(fs_outFD,"\t%10d vcache_S_Entries\n", a_ovP->vcache_S_Entries); - fprintf(fs_outFD,"\t%10d vcache_S_Allocs\n", a_ovP->vcache_S_Allocs); - fprintf(fs_outFD,"\t%10d vcache_S_Gets\n", a_ovP->vcache_S_Gets); - fprintf(fs_outFD,"\t%10d vcache_S_Reads\n", a_ovP->vcache_S_Reads); - fprintf(fs_outFD,"\t%10d vcache_S_Writes\n\n",a_ovP->vcache_S_Writes); - - fprintf(fs_outFD,"\t%10d vcache_H_Entries\n", a_ovP->vcache_H_Entries); - fprintf(fs_outFD,"\t%10d vcache_H_Gets\n", a_ovP->vcache_H_Gets); - fprintf(fs_outFD,"\t%10d vcache_H_Replacements\n\n",a_ovP->vcache_H_Replacements); + fprintf(fs_outFD, "\t%10d vcache_L_Entries\n", a_ovP->vcache_L_Entries); + fprintf(fs_outFD, "\t%10d vcache_L_Allocs\n", a_ovP->vcache_L_Allocs); + fprintf(fs_outFD, "\t%10d vcache_L_Gets\n", a_ovP->vcache_L_Gets); + fprintf(fs_outFD, "\t%10d vcache_L_Reads\n", a_ovP->vcache_L_Reads); + fprintf(fs_outFD, "\t%10d vcache_L_Writes\n\n", a_ovP->vcache_L_Writes); + + fprintf(fs_outFD, "\t%10d vcache_S_Entries\n", a_ovP->vcache_S_Entries); + fprintf(fs_outFD, "\t%10d vcache_S_Allocs\n", a_ovP->vcache_S_Allocs); + fprintf(fs_outFD, "\t%10d vcache_S_Gets\n", a_ovP->vcache_S_Gets); + fprintf(fs_outFD, "\t%10d vcache_S_Reads\n", a_ovP->vcache_S_Reads); + fprintf(fs_outFD, "\t%10d vcache_S_Writes\n\n", a_ovP->vcache_S_Writes); + + fprintf(fs_outFD, "\t%10d vcache_H_Entries\n", a_ovP->vcache_H_Entries); + fprintf(fs_outFD, "\t%10d vcache_H_Gets\n", a_ovP->vcache_H_Gets); + fprintf(fs_outFD, "\t%10d vcache_H_Replacements\n\n", + a_ovP->vcache_H_Replacements); /* * Directory package section. */ - fprintf(fs_outFD,"\t%10d dir_Buffers\n", a_ovP->dir_Buffers); - fprintf(fs_outFD,"\t%10d dir_Calls\n", a_ovP->dir_Calls); - fprintf(fs_outFD,"\t%10d dir_IOs\n\n", a_ovP->dir_IOs); + fprintf(fs_outFD, "\t%10d dir_Buffers\n", a_ovP->dir_Buffers); + fprintf(fs_outFD, "\t%10d dir_Calls\n", a_ovP->dir_Calls); + fprintf(fs_outFD, "\t%10d dir_IOs\n\n", a_ovP->dir_IOs); /* * Rx section. */ - fprintf(fs_outFD,"\t%10d rx_packetRequests\n", a_ovP->rx_packetRequests); - fprintf(fs_outFD,"\t%10d rx_noPackets_RcvClass\n", a_ovP->rx_noPackets_RcvClass); - fprintf(fs_outFD,"\t%10d rx_noPackets_SendClass\n", a_ovP->rx_noPackets_SendClass); - fprintf(fs_outFD,"\t%10d rx_noPackets_SpecialClass\n", a_ovP->rx_noPackets_SpecialClass); - fprintf(fs_outFD,"\t%10d rx_socketGreedy\n", a_ovP->rx_socketGreedy); - fprintf(fs_outFD,"\t%10d rx_bogusPacketOnRead\n", a_ovP->rx_bogusPacketOnRead); - fprintf(fs_outFD,"\t%10d rx_bogusHost\n", a_ovP->rx_bogusHost); - fprintf(fs_outFD,"\t%10d rx_noPacketOnRead\n", a_ovP->rx_noPacketOnRead); - fprintf(fs_outFD,"\t%10d rx_noPacketBuffersOnRead\n", a_ovP->rx_noPacketBuffersOnRead); - fprintf(fs_outFD,"\t%10d rx_selects\n", a_ovP->rx_selects); - fprintf(fs_outFD,"\t%10d rx_sendSelects\n", a_ovP->rx_sendSelects); - fprintf(fs_outFD,"\t%10d rx_packetsRead_RcvClass\n", a_ovP->rx_packetsRead_RcvClass); - fprintf(fs_outFD,"\t%10d rx_packetsRead_SendClass\n", a_ovP->rx_packetsRead_SendClass); - fprintf(fs_outFD,"\t%10d rx_packetsRead_SpecialClass\n", a_ovP->rx_packetsRead_SpecialClass); - fprintf(fs_outFD,"\t%10d rx_dataPacketsRead\n", a_ovP->rx_dataPacketsRead); - fprintf(fs_outFD,"\t%10d rx_ackPacketsRead\n", a_ovP->rx_ackPacketsRead); - fprintf(fs_outFD,"\t%10d rx_dupPacketsRead\n", a_ovP->rx_dupPacketsRead); - fprintf(fs_outFD,"\t%10d rx_spuriousPacketsRead\n", a_ovP->rx_spuriousPacketsRead); - fprintf(fs_outFD,"\t%10d rx_packetsSent_RcvClass\n", a_ovP->rx_packetsSent_RcvClass); - fprintf(fs_outFD,"\t%10d rx_packetsSent_SendClass\n", a_ovP->rx_packetsSent_SendClass); - fprintf(fs_outFD,"\t%10d rx_packetsSent_SpecialClass\n", a_ovP->rx_packetsSent_SpecialClass); - fprintf(fs_outFD,"\t%10d rx_ackPacketsSent\n", a_ovP->rx_ackPacketsSent); - fprintf(fs_outFD,"\t%10d rx_pingPacketsSent\n", a_ovP->rx_pingPacketsSent); - fprintf(fs_outFD,"\t%10d rx_abortPacketsSent\n",a_ovP->rx_abortPacketsSent); - fprintf(fs_outFD,"\t%10d rx_busyPacketsSent\n", a_ovP->rx_busyPacketsSent); - fprintf(fs_outFD,"\t%10d rx_dataPacketsSent\n", a_ovP->rx_dataPacketsSent); - fprintf(fs_outFD,"\t%10d rx_dataPacketsReSent\n", a_ovP->rx_dataPacketsReSent); - fprintf(fs_outFD,"\t%10d rx_dataPacketsPushed\n", a_ovP->rx_dataPacketsPushed); - fprintf(fs_outFD,"\t%10d rx_ignoreAckedPacket\n", a_ovP->rx_ignoreAckedPacket); - fprintf(fs_outFD,"\t%10d rx_totalRtt_Sec\n", a_ovP->rx_totalRtt_Sec); - fprintf(fs_outFD,"\t%10d rx_totalRtt_Usec\n", a_ovP->rx_totalRtt_Usec); - fprintf(fs_outFD,"\t%10d rx_minRtt_Sec\n", a_ovP->rx_minRtt_Sec); - fprintf(fs_outFD,"\t%10d rx_minRtt_Usec\n", a_ovP->rx_minRtt_Usec); - fprintf(fs_outFD,"\t%10d rx_maxRtt_Sec\n", a_ovP->rx_maxRtt_Sec); - fprintf(fs_outFD,"\t%10d rx_maxRtt_Usec\n", a_ovP->rx_maxRtt_Usec); - fprintf(fs_outFD,"\t%10d rx_nRttSamples\n", a_ovP->rx_nRttSamples); - fprintf(fs_outFD,"\t%10d rx_nServerConns\n", a_ovP->rx_nServerConns); - fprintf(fs_outFD,"\t%10d rx_nClientConns\n", a_ovP->rx_nClientConns); - fprintf(fs_outFD,"\t%10d rx_nPeerStructs\n", a_ovP->rx_nPeerStructs); - fprintf(fs_outFD,"\t%10d rx_nCallStructs\n", a_ovP->rx_nCallStructs); - fprintf(fs_outFD,"\t%10d rx_nFreeCallStructs\n\n", a_ovP->rx_nFreeCallStructs); + fprintf(fs_outFD, "\t%10d rx_packetRequests\n", a_ovP->rx_packetRequests); + fprintf(fs_outFD, "\t%10d rx_noPackets_RcvClass\n", + a_ovP->rx_noPackets_RcvClass); + fprintf(fs_outFD, "\t%10d rx_noPackets_SendClass\n", + a_ovP->rx_noPackets_SendClass); + fprintf(fs_outFD, "\t%10d rx_noPackets_SpecialClass\n", + a_ovP->rx_noPackets_SpecialClass); + fprintf(fs_outFD, "\t%10d rx_socketGreedy\n", a_ovP->rx_socketGreedy); + fprintf(fs_outFD, "\t%10d rx_bogusPacketOnRead\n", + a_ovP->rx_bogusPacketOnRead); + fprintf(fs_outFD, "\t%10d rx_bogusHost\n", a_ovP->rx_bogusHost); + fprintf(fs_outFD, "\t%10d rx_noPacketOnRead\n", a_ovP->rx_noPacketOnRead); + fprintf(fs_outFD, "\t%10d rx_noPacketBuffersOnRead\n", + a_ovP->rx_noPacketBuffersOnRead); + fprintf(fs_outFD, "\t%10d rx_selects\n", a_ovP->rx_selects); + fprintf(fs_outFD, "\t%10d rx_sendSelects\n", a_ovP->rx_sendSelects); + fprintf(fs_outFD, "\t%10d rx_packetsRead_RcvClass\n", + a_ovP->rx_packetsRead_RcvClass); + fprintf(fs_outFD, "\t%10d rx_packetsRead_SendClass\n", + a_ovP->rx_packetsRead_SendClass); + fprintf(fs_outFD, "\t%10d rx_packetsRead_SpecialClass\n", + a_ovP->rx_packetsRead_SpecialClass); + fprintf(fs_outFD, "\t%10d rx_dataPacketsRead\n", + a_ovP->rx_dataPacketsRead); + fprintf(fs_outFD, "\t%10d rx_ackPacketsRead\n", a_ovP->rx_ackPacketsRead); + fprintf(fs_outFD, "\t%10d rx_dupPacketsRead\n", a_ovP->rx_dupPacketsRead); + fprintf(fs_outFD, "\t%10d rx_spuriousPacketsRead\n", + a_ovP->rx_spuriousPacketsRead); + fprintf(fs_outFD, "\t%10d rx_packetsSent_RcvClass\n", + a_ovP->rx_packetsSent_RcvClass); + fprintf(fs_outFD, "\t%10d rx_packetsSent_SendClass\n", + a_ovP->rx_packetsSent_SendClass); + fprintf(fs_outFD, "\t%10d rx_packetsSent_SpecialClass\n", + a_ovP->rx_packetsSent_SpecialClass); + fprintf(fs_outFD, "\t%10d rx_ackPacketsSent\n", a_ovP->rx_ackPacketsSent); + fprintf(fs_outFD, "\t%10d rx_pingPacketsSent\n", + a_ovP->rx_pingPacketsSent); + fprintf(fs_outFD, "\t%10d rx_abortPacketsSent\n", + a_ovP->rx_abortPacketsSent); + fprintf(fs_outFD, "\t%10d rx_busyPacketsSent\n", + a_ovP->rx_busyPacketsSent); + fprintf(fs_outFD, "\t%10d rx_dataPacketsSent\n", + a_ovP->rx_dataPacketsSent); + fprintf(fs_outFD, "\t%10d rx_dataPacketsReSent\n", + a_ovP->rx_dataPacketsReSent); + fprintf(fs_outFD, "\t%10d rx_dataPacketsPushed\n", + a_ovP->rx_dataPacketsPushed); + fprintf(fs_outFD, "\t%10d rx_ignoreAckedPacket\n", + a_ovP->rx_ignoreAckedPacket); + fprintf(fs_outFD, "\t%10d rx_totalRtt_Sec\n", a_ovP->rx_totalRtt_Sec); + fprintf(fs_outFD, "\t%10d rx_totalRtt_Usec\n", a_ovP->rx_totalRtt_Usec); + fprintf(fs_outFD, "\t%10d rx_minRtt_Sec\n", a_ovP->rx_minRtt_Sec); + fprintf(fs_outFD, "\t%10d rx_minRtt_Usec\n", a_ovP->rx_minRtt_Usec); + fprintf(fs_outFD, "\t%10d rx_maxRtt_Sec\n", a_ovP->rx_maxRtt_Sec); + fprintf(fs_outFD, "\t%10d rx_maxRtt_Usec\n", a_ovP->rx_maxRtt_Usec); + fprintf(fs_outFD, "\t%10d rx_nRttSamples\n", a_ovP->rx_nRttSamples); + fprintf(fs_outFD, "\t%10d rx_nServerConns\n", a_ovP->rx_nServerConns); + fprintf(fs_outFD, "\t%10d rx_nClientConns\n", a_ovP->rx_nClientConns); + fprintf(fs_outFD, "\t%10d rx_nPeerStructs\n", a_ovP->rx_nPeerStructs); + fprintf(fs_outFD, "\t%10d rx_nCallStructs\n", a_ovP->rx_nCallStructs); + fprintf(fs_outFD, "\t%10d rx_nFreeCallStructs\n\n", + a_ovP->rx_nFreeCallStructs); /* * Host module fields. */ - fprintf(fs_outFD,"\t%10d host_NumHostEntries\n", a_ovP->host_NumHostEntries); - fprintf(fs_outFD,"\t%10d host_HostBlocks\n", a_ovP->host_HostBlocks); - fprintf(fs_outFD,"\t%10d host_NonDeletedHosts\n", a_ovP->host_NonDeletedHosts); - fprintf(fs_outFD,"\t%10d host_HostsInSameNetOrSubnet\n", a_ovP->host_HostsInSameNetOrSubnet); - fprintf(fs_outFD,"\t%10d host_HostsInDiffSubnet\n", a_ovP->host_HostsInDiffSubnet); - fprintf(fs_outFD,"\t%10d host_HostsInDiffNetwork\n",a_ovP->host_HostsInDiffNetwork); - fprintf(fs_outFD,"\t%10d host_NumClients\n", a_ovP->host_NumClients); - fprintf(fs_outFD,"\t%10d host_ClientBlocks\n\n", a_ovP->host_ClientBlocks); - -} /*Print_fs_OverallPerfInfo*/ + fprintf(fs_outFD, "\t%10d host_NumHostEntries\n", + a_ovP->host_NumHostEntries); + fprintf(fs_outFD, "\t%10d host_HostBlocks\n", a_ovP->host_HostBlocks); + fprintf(fs_outFD, "\t%10d host_NonDeletedHosts\n", + a_ovP->host_NonDeletedHosts); + fprintf(fs_outFD, "\t%10d host_HostsInSameNetOrSubnet\n", + a_ovP->host_HostsInSameNetOrSubnet); + fprintf(fs_outFD, "\t%10d host_HostsInDiffSubnet\n", + a_ovP->host_HostsInDiffSubnet); + fprintf(fs_outFD, "\t%10d host_HostsInDiffNetwork\n", + a_ovP->host_HostsInDiffNetwork); + fprintf(fs_outFD, "\t%10d host_NumClients\n", a_ovP->host_NumClients); + fprintf(fs_outFD, "\t%10d host_ClientBlocks\n\n", + a_ovP->host_ClientBlocks); + +} /*Print_fs_OverallPerfInfo */ /*------------------------------------------------------------------------ @@ -222,20 +260,21 @@ void Print_fs_OverallPerfInfo(a_ovP) * As advertised. *------------------------------------------------------------------------*/ -void Print_fs_OpTiming(a_opIdx, a_opTimeP) - int a_opIdx; - struct fs_stats_opTimingData *a_opTimeP; +void +Print_fs_OpTiming(a_opIdx, a_opTimeP) + int a_opIdx; + struct fs_stats_opTimingData *a_opTimeP; -{ /*Print_fs_OpTiming*/ +{ /*Print_fs_OpTiming */ - fprintf(fs_outFD,"%15s: %d ops (%d OK); sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", - fsOpNames[a_opIdx], - a_opTimeP->numOps, a_opTimeP->numSuccesses, - a_opTimeP->sumTime.tv_sec, a_opTimeP->sumTime.tv_usec, - a_opTimeP->minTime.tv_sec, a_opTimeP->minTime.tv_usec, - a_opTimeP->maxTime.tv_sec, a_opTimeP->maxTime.tv_usec); + fprintf(fs_outFD, + "%15s: %d ops (%d OK); sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", + fsOpNames[a_opIdx], a_opTimeP->numOps, a_opTimeP->numSuccesses, + a_opTimeP->sumTime.tv_sec, a_opTimeP->sumTime.tv_usec, + a_opTimeP->minTime.tv_sec, a_opTimeP->minTime.tv_usec, + a_opTimeP->maxTime.tv_sec, a_opTimeP->maxTime.tv_usec); -} /*Print_fs_OpTiming*/ +} /*Print_fs_OpTiming */ /*------------------------------------------------------------------------ @@ -258,32 +297,28 @@ void Print_fs_OpTiming(a_opIdx, a_opTimeP) * As advertised. *------------------------------------------------------------------------*/ -void Print_fs_XferTiming(a_opIdx, a_xferP) - int a_opIdx; - struct fs_stats_xferData *a_xferP; - -{ /*Print_fs_XferTiming*/ - - fprintf(fs_outFD,"%s: %d xfers (%d OK), time sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", - xferOpNames[a_opIdx], - a_xferP->numXfers, a_xferP->numSuccesses, - a_xferP->sumTime.tv_sec, a_xferP->sumTime.tv_usec, - a_xferP->minTime.tv_sec, a_xferP->minTime.tv_usec, - a_xferP->maxTime.tv_sec, a_xferP->maxTime.tv_usec); - fprintf(fs_outFD,"\t[bytes: sum=%d, min=%d, max=%d]\n", - a_xferP->sumBytes, a_xferP->minBytes, a_xferP->maxBytes); - fprintf(fs_outFD,"\t[buckets: 0: %d, 1: %d, 2: %d, 3: %d, 4: %d, 5: %d 6: %d, 7: %d, 8: %d]\n", - a_xferP->count[0], - a_xferP->count[1], - a_xferP->count[2], - a_xferP->count[3], - a_xferP->count[4], - a_xferP->count[5], - a_xferP->count[6], - a_xferP->count[7], - a_xferP->count[8]); - -} /*Print_fs_XferTiming*/ +void +Print_fs_XferTiming(a_opIdx, a_xferP) + int a_opIdx; + struct fs_stats_xferData *a_xferP; + +{ /*Print_fs_XferTiming */ + + fprintf(fs_outFD, + "%s: %d xfers (%d OK), time sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", + xferOpNames[a_opIdx], a_xferP->numXfers, a_xferP->numSuccesses, + a_xferP->sumTime.tv_sec, a_xferP->sumTime.tv_usec, + a_xferP->minTime.tv_sec, a_xferP->minTime.tv_usec, + a_xferP->maxTime.tv_sec, a_xferP->maxTime.tv_usec); + fprintf(fs_outFD, "\t[bytes: sum=%d, min=%d, max=%d]\n", + a_xferP->sumBytes, a_xferP->minBytes, a_xferP->maxBytes); + fprintf(fs_outFD, + "\t[buckets: 0: %d, 1: %d, 2: %d, 3: %d, 4: %d, 5: %d 6: %d, 7: %d, 8: %d]\n", + a_xferP->count[0], a_xferP->count[1], a_xferP->count[2], + a_xferP->count[3], a_xferP->count[4], a_xferP->count[5], + a_xferP->count[6], a_xferP->count[7], a_xferP->count[8]); + +} /*Print_fs_XferTiming */ /*------------------------------------------------------------------------ @@ -305,14 +340,15 @@ void Print_fs_XferTiming(a_opIdx, a_xferP) * As advertised. *------------------------------------------------------------------------*/ -void Print_fs_DetailedPerfInfo(a_detP) - struct fs_stats_DetailedStats *a_detP; +void +Print_fs_DetailedPerfInfo(a_detP) + struct fs_stats_DetailedStats *a_detP; -{ /*Print_fs_DetailedPerfInfo*/ +{ /*Print_fs_DetailedPerfInfo */ - int currIdx; /*Loop variable*/ + int currIdx; /*Loop variable */ - fprintf(fs_outFD,"\t%10d epoch\n", a_detP->epoch); + fprintf(fs_outFD, "\t%10d epoch\n", a_detP->epoch); for (currIdx = 0; currIdx < FS_STATS_NUM_RPC_OPS; currIdx++) Print_fs_OpTiming(currIdx, &(a_detP->rpcOpTimes[currIdx])); @@ -320,7 +356,7 @@ void Print_fs_DetailedPerfInfo(a_detP) for (currIdx = 0; currIdx < FS_STATS_NUM_XFER_OPS; currIdx++) Print_fs_XferTiming(currIdx, &(a_detP->xferOpTimes[currIdx])); -} /*Print_fs_DetailedPerfInfo*/ +} /*Print_fs_DetailedPerfInfo */ /*------------------------------------------------------------------------ @@ -343,40 +379,41 @@ void Print_fs_DetailedPerfInfo(a_detP) * As advertised. *------------------------------------------------------------------------*/ -void Print_fs_FullPerfInfo(a_fs_Results) -struct xstat_fs_ProbeResults *a_fs_Results; /* ptr to fs results */ -{ /*Print_fs_FullPerfInfo*/ +void +Print_fs_FullPerfInfo(a_fs_Results) + struct xstat_fs_ProbeResults *a_fs_Results; /* ptr to fs results */ +{ /*Print_fs_FullPerfInfo */ - static char rn[] = "Print_fs_FullPerfInfo"; /*Routine name*/ - static afs_int32 fullPerfLongs = - (sizeof(struct fs_stats_FullPerfStats) >> 2); /*Correct # longs to rcv*/ - afs_int32 numLongs; /*# longwords received*/ - struct fs_stats_FullPerfStats *fullPerfP; /*Ptr to full perf stats*/ - char *printableTime; /*Ptr to printable time string*/ + static char rn[] = "Print_fs_FullPerfInfo"; /*Routine name */ + static afs_int32 fullPerfLongs = (sizeof(struct fs_stats_FullPerfStats) >> 2); /*Correct # longs to rcv */ + afs_int32 numLongs; /*# longwords received */ + struct fs_stats_FullPerfStats *fullPerfP; /*Ptr to full perf stats */ + char *printableTime; /*Ptr to printable time string */ numLongs = a_fs_Results->data.AFS_CollData_len; if (numLongs != fullPerfLongs) { - fprintf(fs_outFD," ** Data size mismatch in full performance collection!\n"); - fprintf(fs_outFD," ** Expecting %d, got %d\n", fullPerfLongs, numLongs); + fprintf(fs_outFD, + " ** Data size mismatch in full performance collection!\n"); + fprintf(fs_outFD, " ** Expecting %d, got %d\n", fullPerfLongs, + numLongs); return; } - printableTime = ctime((time_t *)&(a_fs_Results->probeTime)); - printableTime[strlen(printableTime)-1] = '\0'; + printableTime = ctime((time_t *) & (a_fs_Results->probeTime)); + printableTime[strlen(printableTime) - 1] = '\0'; fullPerfP = (struct fs_stats_FullPerfStats *) (a_fs_Results->data.AFS_CollData_val); - fprintf(fs_outFD,"AFS_XSTATSCOLL_FULL_PERF_INFO (coll %d) for FS %s\n[Probe %d, %s]\n\n", - a_fs_Results->collectionNumber, - a_fs_Results->connP->hostName, - a_fs_Results->probeNum, - printableTime); + fprintf(fs_outFD, + "AFS_XSTATSCOLL_FULL_PERF_INFO (coll %d) for FS %s\n[Probe %d, %s]\n\n", + a_fs_Results->collectionNumber, a_fs_Results->connP->hostName, + a_fs_Results->probeNum, printableTime); Print_fs_OverallPerfInfo(&(fullPerfP->overall)); Print_fs_DetailedPerfInfo(&(fullPerfP->det)); -} /*Print_fs_FullPerfInfo*/ +} /*Print_fs_FullPerfInfo */ /*------------------------------------------------------------------------ @@ -401,69 +438,70 @@ struct xstat_fs_ProbeResults *a_fs_Results; /* ptr to fs results */ * As advertised. *------------------------------------------------------------------------*/ int -afsmon_fsOutput(a_outfile, a_detOutput) -char *a_outfile; /* ptr to output file name */ -int a_detOutput; /* detailed output ? */ +afsmon_fsOutput(a_outfile, a_detOutput) + char *a_outfile; /* ptr to output file name */ + int a_detOutput; /* detailed output ? */ { - static char rn[] = "afsmon_fsOutput"; /* routine name */ - char *printTime; /* ptr to time string */ - char *hostname; /* fileserner name */ - afs_int32 numLongs; /* longwords in result */ - afs_int32 *currLong; /* ptr to longwords in result */ - int i; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_outfile= %s, a_detOutput= %d\n", + static char rn[] = "afsmon_fsOutput"; /* routine name */ + char *printTime; /* ptr to time string */ + char *hostname; /* fileserner name */ + afs_int32 numLongs; /* longwords in result */ + afs_int32 *currLong; /* ptr to longwords in result */ + int i; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_outfile= %s, a_detOutput= %d\n", rn, a_outfile, a_detOutput); fflush(debugFD); - } + } - fs_outFD = fopen(a_outfile,"a"); - if (fs_outFD == (FILE *)0) { - sprintf(errMsg,"[ %s ] failed to open output file %s",rn,a_outfile); + fs_outFD = fopen(a_outfile, "a"); + if (fs_outFD == (FILE *) 0) { + sprintf(errMsg, "[ %s ] failed to open output file %s", rn, + a_outfile); afsmon_Exit(1); - } - - /* get the probe time and strip the \n at the end */ - printTime = ctime((time_t *)&(xstat_fs_Results.probeTime)); - printTime[strlen(printTime) - 1] = '\0'; - hostname = xstat_fs_Results.connP->hostName; - - /* print "time hostname FS" */ - fprintf(fs_outFD,"\n%s %s FS ",printTime,hostname); - - /* if probe failed print -1 and return */ - if (xstat_fs_Results.probeOK) { - fprintf(fs_outFD,"-1\n"); + } + + /* get the probe time and strip the \n at the end */ + printTime = ctime((time_t *) & (xstat_fs_Results.probeTime)); + printTime[strlen(printTime) - 1] = '\0'; + hostname = xstat_fs_Results.connP->hostName; + + /* print "time hostname FS" */ + fprintf(fs_outFD, "\n%s %s FS ", printTime, hostname); + + /* if probe failed print -1 and return */ + if (xstat_fs_Results.probeOK) { + fprintf(fs_outFD, "-1\n"); fclose(fs_outFD); - return(0); - } + return (0); + } - /* print out the probe information as long words */ - numLongs = xstat_fs_Results.data.AFS_CollData_len; - currLong = (afs_int32 *)(xstat_fs_Results.data.AFS_CollData_val); + /* print out the probe information as long words */ + numLongs = xstat_fs_Results.data.AFS_CollData_len; + currLong = (afs_int32 *) (xstat_fs_Results.data.AFS_CollData_val); - for(i=0; inumTtlRecords); - fprintf(cm_outFD,"\t\t%10d numUpRecords\n", a_upDownP->numUpRecords); - fprintf(cm_outFD,"\t\t%10d numDownRecords\n", a_upDownP->numDownRecords); - fprintf(cm_outFD,"\t\t%10d sumOfRecordAges\n", a_upDownP->sumOfRecordAges); - fprintf(cm_outFD,"\t\t%10d ageOfYoungestRecord\n", a_upDownP->ageOfYoungestRecord); - fprintf(cm_outFD,"\t\t%10d ageOfOldestRecord\n", a_upDownP->ageOfOldestRecord); - fprintf(cm_outFD,"\t\t%10d numDowntimeIncidents\n", a_upDownP->numDowntimeIncidents); - fprintf(cm_outFD,"\t\t%10d numRecordsNeverDown\n", a_upDownP->numRecordsNeverDown); - fprintf(cm_outFD,"\t\t%10d maxDowntimesInARecord\n", a_upDownP->maxDowntimesInARecord); - fprintf(cm_outFD,"\t\t%10d sumOfDowntimes\n", a_upDownP->sumOfDowntimes); - fprintf(cm_outFD,"\t\t%10d shortestDowntime\n", a_upDownP->shortestDowntime); - fprintf(cm_outFD,"\t\t%10d longestDowntime\n", a_upDownP->longestDowntime); + fprintf(cm_outFD, "\t\t%10d numTtlRecords\n", a_upDownP->numTtlRecords); + fprintf(cm_outFD, "\t\t%10d numUpRecords\n", a_upDownP->numUpRecords); + fprintf(cm_outFD, "\t\t%10d numDownRecords\n", a_upDownP->numDownRecords); + fprintf(cm_outFD, "\t\t%10d sumOfRecordAges\n", + a_upDownP->sumOfRecordAges); + fprintf(cm_outFD, "\t\t%10d ageOfYoungestRecord\n", + a_upDownP->ageOfYoungestRecord); + fprintf(cm_outFD, "\t\t%10d ageOfOldestRecord\n", + a_upDownP->ageOfOldestRecord); + fprintf(cm_outFD, "\t\t%10d numDowntimeIncidents\n", + a_upDownP->numDowntimeIncidents); + fprintf(cm_outFD, "\t\t%10d numRecordsNeverDown\n", + a_upDownP->numRecordsNeverDown); + fprintf(cm_outFD, "\t\t%10d maxDowntimesInARecord\n", + a_upDownP->maxDowntimesInARecord); + fprintf(cm_outFD, "\t\t%10d sumOfDowntimes\n", a_upDownP->sumOfDowntimes); + fprintf(cm_outFD, "\t\t%10d shortestDowntime\n", + a_upDownP->shortestDowntime); + fprintf(cm_outFD, "\t\t%10d longestDowntime\n", + a_upDownP->longestDowntime); /* * Now, print the array values. */ - fprintf(cm_outFD,"\t\tDowntime duration distribution:\n"); - fprintf(cm_outFD,"\t\t\t%8d: 0 min .. 10 min\n", a_upDownP->downDurations[0]); - fprintf(cm_outFD,"\t\t\t%8d: 10 min .. 30 min\n", a_upDownP->downDurations[1]); - fprintf(cm_outFD,"\t\t\t%8d: 30 min .. 1 hr\n", a_upDownP->downDurations[2]); - fprintf(cm_outFD,"\t\t\t%8d: 1 hr .. 2 hr\n", a_upDownP->downDurations[3]); - fprintf(cm_outFD,"\t\t\t%8d: 2 hr .. 4 hr\n", a_upDownP->downDurations[4]); - fprintf(cm_outFD,"\t\t\t%8d: 4 hr .. 8 hr\n", a_upDownP->downDurations[5]); - fprintf(cm_outFD,"\t\t\t%8d: > 8 hr\n", a_upDownP->downDurations[6]); - - fprintf(cm_outFD,"\t\tDowntime incident distribution:\n"); - fprintf(cm_outFD,"\t\t\t%8d: 0 times\n", a_upDownP->downIncidents[0]); - fprintf(cm_outFD,"\t\t\t%8d: 1 time\n", a_upDownP->downIncidents[1]); - fprintf(cm_outFD,"\t\t\t%8d: 2 .. 5 times\n", a_upDownP->downIncidents[2]); - fprintf(cm_outFD,"\t\t\t%8d: 6 .. 10 times\n", a_upDownP->downIncidents[3]); - fprintf(cm_outFD,"\t\t\t%8d: 10 .. 50 times\n", a_upDownP->downIncidents[4]); - fprintf(cm_outFD,"\t\t\t%8d: > 50 times\n", a_upDownP->downIncidents[5]); - -} /*Print_cm_UpDownStats*/ + fprintf(cm_outFD, "\t\tDowntime duration distribution:\n"); + fprintf(cm_outFD, "\t\t\t%8d: 0 min .. 10 min\n", + a_upDownP->downDurations[0]); + fprintf(cm_outFD, "\t\t\t%8d: 10 min .. 30 min\n", + a_upDownP->downDurations[1]); + fprintf(cm_outFD, "\t\t\t%8d: 30 min .. 1 hr\n", + a_upDownP->downDurations[2]); + fprintf(cm_outFD, "\t\t\t%8d: 1 hr .. 2 hr\n", + a_upDownP->downDurations[3]); + fprintf(cm_outFD, "\t\t\t%8d: 2 hr .. 4 hr\n", + a_upDownP->downDurations[4]); + fprintf(cm_outFD, "\t\t\t%8d: 4 hr .. 8 hr\n", + a_upDownP->downDurations[5]); + fprintf(cm_outFD, "\t\t\t%8d: > 8 hr\n", a_upDownP->downDurations[6]); + + fprintf(cm_outFD, "\t\tDowntime incident distribution:\n"); + fprintf(cm_outFD, "\t\t\t%8d: 0 times\n", a_upDownP->downIncidents[0]); + fprintf(cm_outFD, "\t\t\t%8d: 1 time\n", a_upDownP->downIncidents[1]); + fprintf(cm_outFD, "\t\t\t%8d: 2 .. 5 times\n", + a_upDownP->downIncidents[2]); + fprintf(cm_outFD, "\t\t\t%8d: 6 .. 10 times\n", + a_upDownP->downIncidents[3]); + fprintf(cm_outFD, "\t\t\t%8d: 10 .. 50 times\n", + a_upDownP->downIncidents[4]); + fprintf(cm_outFD, "\t\t\t%8d: > 50 times\n", a_upDownP->downIncidents[5]); + +} /*Print_cm_UpDownStats */ /*------------------------------------------------------------------------ @@ -553,68 +609,75 @@ void Print_cm_UpDownStats(a_upDownP) * As advertised. *------------------------------------------------------------------------*/ -void Print_cm_OverallPerfInfo(a_ovP) - struct afs_stats_CMPerf *a_ovP; - -{ /*Print_cm_OverallPerfInfo*/ - - fprintf(cm_outFD,"\t%10d numPerfCalls\n", a_ovP->numPerfCalls); - - fprintf(cm_outFD,"\t%10d epoch\n", a_ovP->epoch); - fprintf(cm_outFD,"\t%10d numCellsVisible\n", a_ovP->numCellsVisible); - fprintf(cm_outFD,"\t%10d numCellsContacted\n", a_ovP->numCellsContacted); - fprintf(cm_outFD,"\t%10d dlocalAccesses\n", a_ovP->dlocalAccesses); - fprintf(cm_outFD,"\t%10d vlocalAccesses\n", a_ovP->vlocalAccesses); - fprintf(cm_outFD,"\t%10d dremoteAccesses\n", a_ovP->dremoteAccesses); - fprintf(cm_outFD,"\t%10d vremoteAccesses\n", a_ovP->vremoteAccesses); - fprintf(cm_outFD,"\t%10d cacheNumEntries\n", a_ovP->cacheNumEntries); - fprintf(cm_outFD,"\t%10d cacheBlocksTotal\n", a_ovP->cacheBlocksTotal); - fprintf(cm_outFD,"\t%10d cacheBlocksInUse\n", a_ovP->cacheBlocksInUse); - fprintf(cm_outFD,"\t%10d cacheBlocksOrig\n", a_ovP->cacheBlocksOrig); - fprintf(cm_outFD,"\t%10d cacheMaxDirtyChunks\n",a_ovP->cacheMaxDirtyChunks); - fprintf(cm_outFD,"\t%10d cacheCurrDirtyChunks\n", a_ovP->cacheCurrDirtyChunks); - fprintf(cm_outFD,"\t%10d dcacheHits\n", a_ovP->dcacheHits); - fprintf(cm_outFD,"\t%10d vcacheHits\n", a_ovP->vcacheHits); - fprintf(cm_outFD,"\t%10d dcacheMisses\n", a_ovP->dcacheMisses); - fprintf(cm_outFD,"\t%10d vcacheMisses\n", a_ovP->vcacheMisses); - fprintf(cm_outFD,"\t%10d cacheFilesReused\n", a_ovP->cacheFilesReused); - fprintf(cm_outFD,"\t%10d vcacheXAllocs\n", a_ovP->vcacheXAllocs); - - fprintf(cm_outFD,"\t%10d bufAlloced\n", a_ovP->bufAlloced); - fprintf(cm_outFD,"\t%10d bufHits\n", a_ovP->bufHits); - fprintf(cm_outFD,"\t%10d bufMisses\n", a_ovP->bufMisses); - fprintf(cm_outFD,"\t%10d bufFlushDirty\n", a_ovP->bufFlushDirty); - - fprintf(cm_outFD,"\t%10d LargeBlocksActive\n", a_ovP->LargeBlocksActive); - fprintf(cm_outFD,"\t%10d LargeBlocksAlloced\n", a_ovP->LargeBlocksAlloced); - fprintf(cm_outFD,"\t%10d SmallBlocksActive\n", a_ovP->SmallBlocksActive); - fprintf(cm_outFD,"\t%10d SmallBlocksAlloced\n", a_ovP->SmallBlocksAlloced); - fprintf(cm_outFD,"\t%10d OutStandingMemUsage\n", a_ovP->OutStandingMemUsage); - fprintf(cm_outFD,"\t%10d OutStandingAllocs\n", a_ovP->OutStandingAllocs); - fprintf(cm_outFD,"\t%10d CallBackAlloced\n", a_ovP->CallBackAlloced); - fprintf(cm_outFD,"\t%10d CallBackFlushes\n", a_ovP->CallBackFlushes); - - fprintf(cm_outFD,"\t%10d srvRecords\n", a_ovP->srvRecords); - fprintf(cm_outFD,"\t%10d srvNumBuckets\n", a_ovP->srvNumBuckets); - fprintf(cm_outFD,"\t%10d srvMaxChainLength\n", a_ovP->srvMaxChainLength); - fprintf(cm_outFD,"\t%10d srvMaxChainLengthHWM\n", a_ovP->srvMaxChainLengthHWM); - fprintf(cm_outFD,"\t%10d srvRecordsHWM\n", a_ovP->srvRecordsHWM); - - fprintf(cm_outFD,"\t%10d sysName_ID\n", a_ovP->sysName_ID); - - fprintf(cm_outFD,"\tFile Server up/downtimes, same cell:\n"); +void +Print_cm_OverallPerfInfo(a_ovP) + struct afs_stats_CMPerf *a_ovP; + +{ /*Print_cm_OverallPerfInfo */ + + fprintf(cm_outFD, "\t%10d numPerfCalls\n", a_ovP->numPerfCalls); + + fprintf(cm_outFD, "\t%10d epoch\n", a_ovP->epoch); + fprintf(cm_outFD, "\t%10d numCellsVisible\n", a_ovP->numCellsVisible); + fprintf(cm_outFD, "\t%10d numCellsContacted\n", a_ovP->numCellsContacted); + fprintf(cm_outFD, "\t%10d dlocalAccesses\n", a_ovP->dlocalAccesses); + fprintf(cm_outFD, "\t%10d vlocalAccesses\n", a_ovP->vlocalAccesses); + fprintf(cm_outFD, "\t%10d dremoteAccesses\n", a_ovP->dremoteAccesses); + fprintf(cm_outFD, "\t%10d vremoteAccesses\n", a_ovP->vremoteAccesses); + fprintf(cm_outFD, "\t%10d cacheNumEntries\n", a_ovP->cacheNumEntries); + fprintf(cm_outFD, "\t%10d cacheBlocksTotal\n", a_ovP->cacheBlocksTotal); + fprintf(cm_outFD, "\t%10d cacheBlocksInUse\n", a_ovP->cacheBlocksInUse); + fprintf(cm_outFD, "\t%10d cacheBlocksOrig\n", a_ovP->cacheBlocksOrig); + fprintf(cm_outFD, "\t%10d cacheMaxDirtyChunks\n", + a_ovP->cacheMaxDirtyChunks); + fprintf(cm_outFD, "\t%10d cacheCurrDirtyChunks\n", + a_ovP->cacheCurrDirtyChunks); + fprintf(cm_outFD, "\t%10d dcacheHits\n", a_ovP->dcacheHits); + fprintf(cm_outFD, "\t%10d vcacheHits\n", a_ovP->vcacheHits); + fprintf(cm_outFD, "\t%10d dcacheMisses\n", a_ovP->dcacheMisses); + fprintf(cm_outFD, "\t%10d vcacheMisses\n", a_ovP->vcacheMisses); + fprintf(cm_outFD, "\t%10d cacheFilesReused\n", a_ovP->cacheFilesReused); + fprintf(cm_outFD, "\t%10d vcacheXAllocs\n", a_ovP->vcacheXAllocs); + + fprintf(cm_outFD, "\t%10d bufAlloced\n", a_ovP->bufAlloced); + fprintf(cm_outFD, "\t%10d bufHits\n", a_ovP->bufHits); + fprintf(cm_outFD, "\t%10d bufMisses\n", a_ovP->bufMisses); + fprintf(cm_outFD, "\t%10d bufFlushDirty\n", a_ovP->bufFlushDirty); + + fprintf(cm_outFD, "\t%10d LargeBlocksActive\n", a_ovP->LargeBlocksActive); + fprintf(cm_outFD, "\t%10d LargeBlocksAlloced\n", + a_ovP->LargeBlocksAlloced); + fprintf(cm_outFD, "\t%10d SmallBlocksActive\n", a_ovP->SmallBlocksActive); + fprintf(cm_outFD, "\t%10d SmallBlocksAlloced\n", + a_ovP->SmallBlocksAlloced); + fprintf(cm_outFD, "\t%10d OutStandingMemUsage\n", + a_ovP->OutStandingMemUsage); + fprintf(cm_outFD, "\t%10d OutStandingAllocs\n", a_ovP->OutStandingAllocs); + fprintf(cm_outFD, "\t%10d CallBackAlloced\n", a_ovP->CallBackAlloced); + fprintf(cm_outFD, "\t%10d CallBackFlushes\n", a_ovP->CallBackFlushes); + + fprintf(cm_outFD, "\t%10d srvRecords\n", a_ovP->srvRecords); + fprintf(cm_outFD, "\t%10d srvNumBuckets\n", a_ovP->srvNumBuckets); + fprintf(cm_outFD, "\t%10d srvMaxChainLength\n", a_ovP->srvMaxChainLength); + fprintf(cm_outFD, "\t%10d srvMaxChainLengthHWM\n", + a_ovP->srvMaxChainLengthHWM); + fprintf(cm_outFD, "\t%10d srvRecordsHWM\n", a_ovP->srvRecordsHWM); + + fprintf(cm_outFD, "\t%10d sysName_ID\n", a_ovP->sysName_ID); + + fprintf(cm_outFD, "\tFile Server up/downtimes, same cell:\n"); Print_cm_UpDownStats(&(a_ovP->fs_UpDown[0])); - fprintf(cm_outFD,"\tFile Server up/downtimes, diff cell:\n"); + fprintf(cm_outFD, "\tFile Server up/downtimes, diff cell:\n"); Print_cm_UpDownStats(&(a_ovP->fs_UpDown[1])); - fprintf(cm_outFD,"\tVL Server up/downtimes, same cell:\n"); + fprintf(cm_outFD, "\tVL Server up/downtimes, same cell:\n"); Print_cm_UpDownStats(&(a_ovP->vl_UpDown[0])); - fprintf(cm_outFD,"\tVL Server up/downtimes, diff cell:\n"); + fprintf(cm_outFD, "\tVL Server up/downtimes, diff cell:\n"); Print_cm_UpDownStats(&(a_ovP->vl_UpDown[1])); -} /*Print_cm_OverallPerfInfo*/ +} /*Print_cm_OverallPerfInfo */ /*------------------------------------------------------------------------ @@ -637,38 +700,38 @@ void Print_cm_OverallPerfInfo(a_ovP) * As advertised. *------------------------------------------------------------------------*/ -void Print_cm_PerfInfo() +void +Print_cm_PerfInfo() +{ /*Print_cm_PerfInfo */ -{ /*Print_cm_PerfInfo*/ - - static char rn[] = "Print_cm_PerfInfo"; /*Routine name*/ - static afs_int32 perfLongs = - (sizeof(struct afs_stats_CMPerf) >> 2); /*Correct # longs to rcv*/ - afs_int32 numLongs; /*# longwords received*/ - struct afs_stats_CMPerf *perfP; /*Ptr to performance stats*/ - char *printableTime; /*Ptr to printable time string*/ + static char rn[] = "Print_cm_PerfInfo"; /*Routine name */ + static afs_int32 perfLongs = (sizeof(struct afs_stats_CMPerf) >> 2); /*Correct # longs to rcv */ + afs_int32 numLongs; /*# longwords received */ + struct afs_stats_CMPerf *perfP; /*Ptr to performance stats */ + char *printableTime; /*Ptr to printable time string */ numLongs = xstat_cm_Results.data.AFSCB_CollData_len; if (numLongs != perfLongs) { - fprintf(cm_outFD," ** Data size mismatch in performance collection!\n"); - fprintf(cm_outFD,"** Expecting %d, got %d\n", perfLongs, numLongs); + fprintf(cm_outFD, + " ** Data size mismatch in performance collection!\n"); + fprintf(cm_outFD, "** Expecting %d, got %d\n", perfLongs, numLongs); return; } - printableTime = ctime((time_t *)&(xstat_cm_Results.probeTime)); - printableTime[strlen(printableTime)-1] = '\0'; + printableTime = ctime((time_t *) & (xstat_cm_Results.probeTime)); + printableTime[strlen(printableTime) - 1] = '\0'; perfP = (struct afs_stats_CMPerf *) (xstat_cm_Results.data.AFSCB_CollData_val); - fprintf(cm_outFD,"AFSCB_XSTATSCOLL_PERF_INFO (coll %d) for CM %s\n[Probe %d, %s]\n\n", - xstat_cm_Results.collectionNumber, - xstat_cm_Results.connP->hostName, - xstat_cm_Results.probeNum, - printableTime); + fprintf(cm_outFD, + "AFSCB_XSTATSCOLL_PERF_INFO (coll %d) for CM %s\n[Probe %d, %s]\n\n", + xstat_cm_Results.collectionNumber, + xstat_cm_Results.connP->hostName, xstat_cm_Results.probeNum, + printableTime); Print_cm_OverallPerfInfo(perfP); -} /*Print_cm_PerfInfo*/ +} /*Print_cm_PerfInfo */ /*------------------------------------------------------------------------ @@ -692,21 +755,22 @@ void Print_cm_PerfInfo() * As advertised. *------------------------------------------------------------------------*/ -void Print_cm_OpTiming(a_opIdx, a_opNames, a_opTimeP) - int a_opIdx; - char *a_opNames[]; - struct afs_stats_opTimingData *a_opTimeP; +void +Print_cm_OpTiming(a_opIdx, a_opNames, a_opTimeP) + int a_opIdx; + char *a_opNames[]; + struct afs_stats_opTimingData *a_opTimeP; -{ /*Print_cm_OpTiming*/ +{ /*Print_cm_OpTiming */ - fprintf(cm_outFD,"%15s: %d ops (%d OK); sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", - a_opNames[a_opIdx], - a_opTimeP->numOps, a_opTimeP->numSuccesses, - a_opTimeP->sumTime.tv_sec, a_opTimeP->sumTime.tv_usec, - a_opTimeP->minTime.tv_sec, a_opTimeP->minTime.tv_usec, - a_opTimeP->maxTime.tv_sec, a_opTimeP->maxTime.tv_usec); + fprintf(cm_outFD, + "%15s: %d ops (%d OK); sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", + a_opNames[a_opIdx], a_opTimeP->numOps, a_opTimeP->numSuccesses, + a_opTimeP->sumTime.tv_sec, a_opTimeP->sumTime.tv_usec, + a_opTimeP->minTime.tv_sec, a_opTimeP->minTime.tv_usec, + a_opTimeP->maxTime.tv_sec, a_opTimeP->maxTime.tv_usec); -} /*Print_cm_OpTiming*/ +} /*Print_cm_OpTiming */ /*------------------------------------------------------------------------ @@ -729,33 +793,29 @@ void Print_cm_OpTiming(a_opIdx, a_opNames, a_opTimeP) * As advertised. *------------------------------------------------------------------------*/ -void Print_cm_XferTiming(a_opIdx, a_opNames, a_xferP) - int a_opIdx; - char *a_opNames[]; - struct afs_stats_xferData *a_xferP; - -{ /*Print_cm_XferTiming*/ - - fprintf(cm_outFD,"%s: %d xfers (%d OK), time sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", - a_opNames[a_opIdx], - a_xferP->numXfers, a_xferP->numSuccesses, - a_xferP->sumTime.tv_sec, a_xferP->sumTime.tv_usec, - a_xferP->minTime.tv_sec, a_xferP->minTime.tv_usec, - a_xferP->maxTime.tv_sec, a_xferP->maxTime.tv_usec); - fprintf(cm_outFD,"\t[bytes: sum=%d, min=%d, max=%d]\n", - a_xferP->sumBytes, a_xferP->minBytes, a_xferP->maxBytes); - fprintf(cm_outFD,"\t[buckets: 0: %d, 1: %d, 2: %d, 3: %d, 4: %d, 5: %d 6: %d, 7: %d, 8: %d]\n", - a_xferP->count[0], - a_xferP->count[1], - a_xferP->count[2], - a_xferP->count[3], - a_xferP->count[4], - a_xferP->count[5], - a_xferP->count[6], - a_xferP->count[7], - a_xferP->count[8]); - -} /*Print_cm_XferTiming*/ +void +Print_cm_XferTiming(a_opIdx, a_opNames, a_xferP) + int a_opIdx; + char *a_opNames[]; + struct afs_stats_xferData *a_xferP; + +{ /*Print_cm_XferTiming */ + + fprintf(cm_outFD, + "%s: %d xfers (%d OK), time sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", + a_opNames[a_opIdx], a_xferP->numXfers, a_xferP->numSuccesses, + a_xferP->sumTime.tv_sec, a_xferP->sumTime.tv_usec, + a_xferP->minTime.tv_sec, a_xferP->minTime.tv_usec, + a_xferP->maxTime.tv_sec, a_xferP->maxTime.tv_usec); + fprintf(cm_outFD, "\t[bytes: sum=%d, min=%d, max=%d]\n", + a_xferP->sumBytes, a_xferP->minBytes, a_xferP->maxBytes); + fprintf(cm_outFD, + "\t[buckets: 0: %d, 1: %d, 2: %d, 3: %d, 4: %d, 5: %d 6: %d, 7: %d, 8: %d]\n", + a_xferP->count[0], a_xferP->count[1], a_xferP->count[2], + a_xferP->count[3], a_xferP->count[4], a_xferP->count[5], + a_xferP->count[6], a_xferP->count[7], a_xferP->count[8]); + +} /*Print_cm_XferTiming */ /*------------------------------------------------------------------------ @@ -779,23 +839,21 @@ void Print_cm_XferTiming(a_opIdx, a_opNames, a_xferP) * As advertised. *------------------------------------------------------------------------*/ -void Print_cm_ErrInfo(a_opIdx, a_opNames, a_opErrP) - int a_opIdx; - char *a_opNames[]; - struct afs_stats_RPCErrors *a_opErrP; +void +Print_cm_ErrInfo(a_opIdx, a_opNames, a_opErrP) + int a_opIdx; + char *a_opNames[]; + struct afs_stats_RPCErrors *a_opErrP; -{ /*Print_cm_ErrInfo*/ +{ /*Print_cm_ErrInfo */ - fprintf(cm_outFD,"%15s: %d server, %d network, %d prot, %d vol, %d busies, %d other\n", - a_opNames[a_opIdx], - a_opErrP->err_Server, - a_opErrP->err_Network, - a_opErrP->err_Protection, - a_opErrP->err_Volume, - a_opErrP->err_VolumeBusies, - a_opErrP->err_Other); + fprintf(cm_outFD, + "%15s: %d server, %d network, %d prot, %d vol, %d busies, %d other\n", + a_opNames[a_opIdx], a_opErrP->err_Server, a_opErrP->err_Network, + a_opErrP->err_Protection, a_opErrP->err_Volume, + a_opErrP->err_VolumeBusies, a_opErrP->err_Other); -} /*Print_cm_ErrInfo*/ +} /*Print_cm_ErrInfo */ /*------------------------------------------------------------------------ @@ -817,33 +875,35 @@ void Print_cm_ErrInfo(a_opIdx, a_opNames, a_opErrP) * As advertised. *------------------------------------------------------------------------*/ -void Print_cm_RPCPerfInfo(a_rpcP) - struct afs_stats_RPCOpInfo *a_rpcP; +void +Print_cm_RPCPerfInfo(a_rpcP) + struct afs_stats_RPCOpInfo *a_rpcP; -{ /*Print_cm_RPCPerfInfo*/ +{ /*Print_cm_RPCPerfInfo */ - int currIdx; /*Loop variable*/ + int currIdx; /*Loop variable */ /* * Print the contents of each of the opcode-related arrays. */ - fprintf(cm_outFD,"FS Operation Timings:\n---------------------\n"); + fprintf(cm_outFD, "FS Operation Timings:\n---------------------\n"); for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_RPC_OPS; currIdx++) Print_cm_OpTiming(currIdx, fsOpNames, &(a_rpcP->fsRPCTimes[currIdx])); - fprintf(cm_outFD,"\nError Info:\n-----------\n"); + fprintf(cm_outFD, "\nError Info:\n-----------\n"); for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_RPC_OPS; currIdx++) Print_cm_ErrInfo(currIdx, fsOpNames, &(a_rpcP->fsRPCErrors[currIdx])); - fprintf(cm_outFD,"\nTransfer timings:\n-----------------\n"); + fprintf(cm_outFD, "\nTransfer timings:\n-----------------\n"); for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_XFER_OPS; currIdx++) - Print_cm_XferTiming(currIdx, xferOpNames, &(a_rpcP->fsXferTimes[currIdx])); + Print_cm_XferTiming(currIdx, xferOpNames, + &(a_rpcP->fsXferTimes[currIdx])); - fprintf(cm_outFD,"\nCM Operation Timings:\n---------------------\n"); + fprintf(cm_outFD, "\nCM Operation Timings:\n---------------------\n"); for (currIdx = 0; currIdx < AFS_STATS_NUM_CM_RPC_OPS; currIdx++) Print_cm_OpTiming(currIdx, cmOpNames, &(a_rpcP->cmRPCTimes[currIdx])); -} /*Print_cm_RPCPerfInfo*/ +} /*Print_cm_RPCPerfInfo */ /*------------------------------------------------------------------------ @@ -865,78 +925,76 @@ void Print_cm_RPCPerfInfo(a_rpcP) * As advertised. *------------------------------------------------------------------------*/ -void Print_cm_FullPerfInfo() - -{ /*Print_cm_FullPerfInfo*/ +void +Print_cm_FullPerfInfo() +{ /*Print_cm_FullPerfInfo */ - static char rn[] = "Print_cm_FullPerfInfo"; /* routine name */ - struct afs_stats_AuthentInfo *authentP; /*Ptr to authentication stats*/ - struct afs_stats_AccessInfo *accessinfP; /*Ptr to access stats*/ - static afs_int32 fullPerfLongs = - (sizeof (struct afs_stats_CMFullPerf) >> 2); /*Correct #longs*/ - afs_int32 numLongs; /*# longs actually received*/ - struct afs_stats_CMFullPerf *fullP; /*Ptr to full perf info*/ + static char rn[] = "Print_cm_FullPerfInfo"; /* routine name */ + struct afs_stats_AuthentInfo *authentP; /*Ptr to authentication stats */ + struct afs_stats_AccessInfo *accessinfP; /*Ptr to access stats */ + static afs_int32 fullPerfLongs = (sizeof(struct afs_stats_CMFullPerf) >> 2); /*Correct #longs */ + afs_int32 numLongs; /*# longs actually received */ + struct afs_stats_CMFullPerf *fullP; /*Ptr to full perf info */ - char *printableTime; /*Ptr to printable time string*/ + char *printableTime; /*Ptr to printable time string */ numLongs = xstat_cm_Results.data.AFSCB_CollData_len; if (numLongs != fullPerfLongs) { - fprintf(cm_outFD," ** Data size mismatch in performance collection!\n"); - fprintf(cm_outFD," ** Expecting %d, got %d\n",fullPerfLongs, numLongs); + fprintf(cm_outFD, + " ** Data size mismatch in performance collection!\n"); + fprintf(cm_outFD, " ** Expecting %d, got %d\n", fullPerfLongs, + numLongs); return; } - printableTime = ctime((time_t *)&(xstat_cm_Results.probeTime)); - printableTime[strlen(printableTime)-1] = '\0'; + printableTime = ctime((time_t *) & (xstat_cm_Results.probeTime)); + printableTime[strlen(printableTime) - 1] = '\0'; fullP = (struct afs_stats_CMFullPerf *) (xstat_cm_Results.data.AFSCB_CollData_val); - fprintf(cm_outFD,"AFSCB_XSTATSCOLL_FULL_PERF_INFO (coll %d) for CM %s\n[Probe %d, %s]\n\n", - xstat_cm_Results.collectionNumber, - xstat_cm_Results.connP->hostName, - xstat_cm_Results.probeNum, - printableTime); + fprintf(cm_outFD, + "AFSCB_XSTATSCOLL_FULL_PERF_INFO (coll %d) for CM %s\n[Probe %d, %s]\n\n", + xstat_cm_Results.collectionNumber, + xstat_cm_Results.connP->hostName, xstat_cm_Results.probeNum, + printableTime); /* * Print the overall numbers first, followed by all of the RPC numbers, * then each of the other groupings. */ - fprintf(cm_outFD,"Overall Performance Info:\n-------------------------\n"); + fprintf(cm_outFD, + "Overall Performance Info:\n-------------------------\n"); Print_cm_OverallPerfInfo(&(fullP->perf)); - fprintf(cm_outFD,"\n"); + fprintf(cm_outFD, "\n"); Print_cm_RPCPerfInfo(&(fullP->rpc)); authentP = &(fullP->authent); - fprintf(cm_outFD,"\nAuthentication info:\n--------------------\n"); - fprintf(cm_outFD,"\t%d PAGS, %d records (%d auth, %d unauth), %d max in PAG, chain max: %d\n", - authentP->curr_PAGs, - authentP->curr_Records, - authentP->curr_AuthRecords, - authentP->curr_UnauthRecords, - authentP->curr_MaxRecordsInPAG, - authentP->curr_LongestChain); - fprintf(cm_outFD,"\t%d PAG creations, %d tkt updates\n", - authentP->PAGCreations, - authentP->TicketUpdates); - fprintf(cm_outFD,"\t[HWMs: %d PAGS, %d records, %d max in PAG, chain max: %d]\n", - authentP->HWM_PAGs, - authentP->HWM_Records, - authentP->HWM_MaxRecordsInPAG, - authentP->HWM_LongestChain); + fprintf(cm_outFD, "\nAuthentication info:\n--------------------\n"); + fprintf(cm_outFD, + "\t%d PAGS, %d records (%d auth, %d unauth), %d max in PAG, chain max: %d\n", + authentP->curr_PAGs, authentP->curr_Records, + authentP->curr_AuthRecords, authentP->curr_UnauthRecords, + authentP->curr_MaxRecordsInPAG, authentP->curr_LongestChain); + fprintf(cm_outFD, "\t%d PAG creations, %d tkt updates\n", + authentP->PAGCreations, authentP->TicketUpdates); + fprintf(cm_outFD, + "\t[HWMs: %d PAGS, %d records, %d max in PAG, chain max: %d]\n", + authentP->HWM_PAGs, authentP->HWM_Records, + authentP->HWM_MaxRecordsInPAG, authentP->HWM_LongestChain); accessinfP = &(fullP->accessinf); - fprintf(cm_outFD,"\n[Un]replicated accesses:\n------------------------\n"); - fprintf(cm_outFD,"\t%d unrep, %d rep, %d reps accessed, %d max reps/ref, %d first OK\n\n", - accessinfP->unreplicatedRefs, - accessinfP->replicatedRefs, - accessinfP->numReplicasAccessed, - accessinfP->maxReplicasPerRef, - accessinfP->refFirstReplicaOK); + fprintf(cm_outFD, + "\n[Un]replicated accesses:\n------------------------\n"); + fprintf(cm_outFD, + "\t%d unrep, %d rep, %d reps accessed, %d max reps/ref, %d first OK\n\n", + accessinfP->unreplicatedRefs, accessinfP->replicatedRefs, + accessinfP->numReplicasAccessed, accessinfP->maxReplicasPerRef, + accessinfP->refFirstReplicaOK); /* There really isn't any authorship info - authorP = &(fullP->author); */ + * authorP = &(fullP->author); */ -} /*Print_cm_FullPerfInfo*/ +} /*Print_cm_FullPerfInfo */ /*------------------------------------------------------------------------ * afsmon_cmOutput() @@ -960,66 +1018,67 @@ void Print_cm_FullPerfInfo() * As advertised. *------------------------------------------------------------------------*/ int -afsmon_cmOutput(a_outfile, a_detOutput) -char *a_outfile; /* ptr to output file name */ -int a_detOutput; /* detailed output ? */ +afsmon_cmOutput(a_outfile, a_detOutput) + char *a_outfile; /* ptr to output file name */ + int a_detOutput; /* detailed output ? */ { - static char rn[] = "afsmon_cmOutput"; /* routine name */ - char *printTime; /* ptr to time string */ - char *hostname; /* fileserner name */ - afs_int32 numLongs; /* longwords in result */ - afs_int32 *currLong; /* ptr to longwords in result */ - int i; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_outfile= %s, a_detOutput= %d\n", + static char rn[] = "afsmon_cmOutput"; /* routine name */ + char *printTime; /* ptr to time string */ + char *hostname; /* fileserner name */ + afs_int32 numLongs; /* longwords in result */ + afs_int32 *currLong; /* ptr to longwords in result */ + int i; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_outfile= %s, a_detOutput= %d\n", rn, a_outfile, a_detOutput); fflush(debugFD); - } + } - /* need to lock this file before writing */ - cm_outFD = fopen(a_outfile,"a"); - if (cm_outFD == (FILE *)0) { - sprintf(errMsg,"[ %s ] failed to open output file %s",rn,a_outfile); + /* need to lock this file before writing */ + cm_outFD = fopen(a_outfile, "a"); + if (cm_outFD == (FILE *) 0) { + sprintf(errMsg, "[ %s ] failed to open output file %s", rn, + a_outfile); afsmon_Exit(1); - } - - /* get the probe time and strip the \n at the end */ - printTime = ctime((time_t *)&(xstat_cm_Results.probeTime)); - printTime[strlen(printTime) - 1] = '\0'; - hostname = xstat_cm_Results.connP->hostName; - - /* print "time hostname CM" prefix */ - fprintf(cm_outFD,"\n%s %s CM ",printTime,hostname); - - /* if probe failed print -1 and vanish */ - if (xstat_cm_Results.probeOK) { - fprintf(cm_outFD,"-1\n"); + } + + /* get the probe time and strip the \n at the end */ + printTime = ctime((time_t *) & (xstat_cm_Results.probeTime)); + printTime[strlen(printTime) - 1] = '\0'; + hostname = xstat_cm_Results.connP->hostName; + + /* print "time hostname CM" prefix */ + fprintf(cm_outFD, "\n%s %s CM ", printTime, hostname); + + /* if probe failed print -1 and vanish */ + if (xstat_cm_Results.probeOK) { + fprintf(cm_outFD, "-1\n"); fclose(cm_outFD); - return(0); - } + return (0); + } - /* print out the probe information as long words */ - numLongs = xstat_cm_Results.data.AFSCB_CollData_len; - currLong = (afs_int32 *)(xstat_cm_Results.data.AFSCB_CollData_val); + /* print out the probe information as long words */ + numLongs = xstat_cm_Results.data.AFSCB_CollData_len; + currLong = (afs_int32 *) (xstat_cm_Results.data.AFSCB_CollData_val); - for(i=0; i #include -RCSID("$Header: /tmp/cvstemp/openafs/src/afsmonitor/afsmon-parselog.c,v 1.1.1.4 2001/07/14 22:20:18 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afsmonitor/afsmon-parselog.c,v 1.5 2003/07/15 23:14:32 shadow Exp $"); -#include +#include #include #include @@ -98,10 +99,11 @@ static char *xferOpNames[] = { * *------------------------------------------------------------------------*/ -void Print_fs_OverallPerfInfo(a_ovP) - struct afs_PerfStats *a_ovP; +void +Print_fs_OverallPerfInfo(a_ovP) + struct afs_PerfStats *a_ovP; -{ /*Print_fs_OverallPerfInfo*/ +{ /*Print_fs_OverallPerfInfo */ printf("\t%10d numPerfCalls\n\n", a_ovP->numPerfCalls); @@ -110,20 +112,20 @@ void Print_fs_OverallPerfInfo(a_ovP) * Vnode cache section. */ printf("\t%10d vcache_L_Entries\n", a_ovP->vcache_L_Entries); - printf("\t%10d vcache_L_Allocs\n", a_ovP->vcache_L_Allocs); - printf("\t%10d vcache_L_Gets\n", a_ovP->vcache_L_Gets); - printf("\t%10d vcache_L_Reads\n", a_ovP->vcache_L_Reads); - printf("\t%10d vcache_L_Writes\n\n",a_ovP->vcache_L_Writes); + printf("\t%10d vcache_L_Allocs\n", a_ovP->vcache_L_Allocs); + printf("\t%10d vcache_L_Gets\n", a_ovP->vcache_L_Gets); + printf("\t%10d vcache_L_Reads\n", a_ovP->vcache_L_Reads); + printf("\t%10d vcache_L_Writes\n\n", a_ovP->vcache_L_Writes); printf("\t%10d vcache_S_Entries\n", a_ovP->vcache_S_Entries); - printf("\t%10d vcache_S_Allocs\n", a_ovP->vcache_S_Allocs); - printf("\t%10d vcache_S_Gets\n", a_ovP->vcache_S_Gets); - printf("\t%10d vcache_S_Reads\n", a_ovP->vcache_S_Reads); - printf("\t%10d vcache_S_Writes\n\n",a_ovP->vcache_S_Writes); + printf("\t%10d vcache_S_Allocs\n", a_ovP->vcache_S_Allocs); + printf("\t%10d vcache_S_Gets\n", a_ovP->vcache_S_Gets); + printf("\t%10d vcache_S_Reads\n", a_ovP->vcache_S_Reads); + printf("\t%10d vcache_S_Writes\n\n", a_ovP->vcache_S_Writes); printf("\t%10d vcache_H_Entries\n", a_ovP->vcache_H_Entries); - printf("\t%10d vcache_H_Gets\n", a_ovP->vcache_H_Gets); - printf("\t%10d vcache_H_Replacements\n\n",a_ovP->vcache_H_Replacements); + printf("\t%10d vcache_H_Gets\n", a_ovP->vcache_H_Gets); + printf("\t%10d vcache_H_Replacements\n\n", a_ovP->vcache_H_Replacements); /* * Directory package section. @@ -137,59 +139,69 @@ void Print_fs_OverallPerfInfo(a_ovP) */ printf("\t%10d rx_packetRequests\n", a_ovP->rx_packetRequests); printf("\t%10d rx_noPackets_RcvClass\n", a_ovP->rx_noPackets_RcvClass); - printf("\t%10d rx_noPackets_SendClass\n", a_ovP->rx_noPackets_SendClass); - printf("\t%10d rx_noPackets_SpecialClass\n", a_ovP->rx_noPackets_SpecialClass); + printf("\t%10d rx_noPackets_SendClass\n", a_ovP->rx_noPackets_SendClass); + printf("\t%10d rx_noPackets_SpecialClass\n", + a_ovP->rx_noPackets_SpecialClass); printf("\t%10d rx_socketGreedy\n", a_ovP->rx_socketGreedy); printf("\t%10d rx_bogusPacketOnRead\n", a_ovP->rx_bogusPacketOnRead); - printf("\t%10d rx_bogusHost\n", a_ovP->rx_bogusHost); + printf("\t%10d rx_bogusHost\n", a_ovP->rx_bogusHost); printf("\t%10d rx_noPacketOnRead\n", a_ovP->rx_noPacketOnRead); - printf("\t%10d rx_noPacketBuffersOnRead\n", a_ovP->rx_noPacketBuffersOnRead); + printf("\t%10d rx_noPacketBuffersOnRead\n", + a_ovP->rx_noPacketBuffersOnRead); printf("\t%10d rx_selects\n", a_ovP->rx_selects); - printf("\t%10d rx_sendSelects\n", a_ovP->rx_sendSelects); - printf("\t%10d rx_packetsRead_RcvClass\n", a_ovP->rx_packetsRead_RcvClass); - printf("\t%10d rx_packetsRead_SendClass\n", a_ovP->rx_packetsRead_SendClass); - printf("\t%10d rx_packetsRead_SpecialClass\n", a_ovP->rx_packetsRead_SpecialClass); + printf("\t%10d rx_sendSelects\n", a_ovP->rx_sendSelects); + printf("\t%10d rx_packetsRead_RcvClass\n", + a_ovP->rx_packetsRead_RcvClass); + printf("\t%10d rx_packetsRead_SendClass\n", + a_ovP->rx_packetsRead_SendClass); + printf("\t%10d rx_packetsRead_SpecialClass\n", + a_ovP->rx_packetsRead_SpecialClass); printf("\t%10d rx_dataPacketsRead\n", a_ovP->rx_dataPacketsRead); printf("\t%10d rx_ackPacketsRead\n", a_ovP->rx_ackPacketsRead); printf("\t%10d rx_dupPacketsRead\n", a_ovP->rx_dupPacketsRead); - printf("\t%10d rx_spuriousPacketsRead\n", a_ovP->rx_spuriousPacketsRead); - printf("\t%10d rx_packetsSent_RcvClass\n", a_ovP->rx_packetsSent_RcvClass); - printf("\t%10d rx_packetsSent_SendClass\n", a_ovP->rx_packetsSent_SendClass); - printf("\t%10d rx_packetsSent_SpecialClass\n", a_ovP->rx_packetsSent_SpecialClass); + printf("\t%10d rx_spuriousPacketsRead\n", a_ovP->rx_spuriousPacketsRead); + printf("\t%10d rx_packetsSent_RcvClass\n", + a_ovP->rx_packetsSent_RcvClass); + printf("\t%10d rx_packetsSent_SendClass\n", + a_ovP->rx_packetsSent_SendClass); + printf("\t%10d rx_packetsSent_SpecialClass\n", + a_ovP->rx_packetsSent_SpecialClass); printf("\t%10d rx_ackPacketsSent\n", a_ovP->rx_ackPacketsSent); printf("\t%10d rx_pingPacketsSent\n", a_ovP->rx_pingPacketsSent); - printf("\t%10d rx_abortPacketsSent\n",a_ovP->rx_abortPacketsSent); + printf("\t%10d rx_abortPacketsSent\n", a_ovP->rx_abortPacketsSent); printf("\t%10d rx_busyPacketsSent\n", a_ovP->rx_busyPacketsSent); printf("\t%10d rx_dataPacketsSent\n", a_ovP->rx_dataPacketsSent); printf("\t%10d rx_dataPacketsReSent\n", a_ovP->rx_dataPacketsReSent); - printf("\t%10d rx_dataPacketsPushed\n", a_ovP->rx_dataPacketsPushed); - printf("\t%10d rx_ignoreAckedPacket\n", a_ovP->rx_ignoreAckedPacket); + printf("\t%10d rx_dataPacketsPushed\n", a_ovP->rx_dataPacketsPushed); + printf("\t%10d rx_ignoreAckedPacket\n", a_ovP->rx_ignoreAckedPacket); printf("\t%10d rx_totalRtt_Sec\n", a_ovP->rx_totalRtt_Sec); printf("\t%10d rx_totalRtt_Usec\n", a_ovP->rx_totalRtt_Usec); - printf("\t%10d rx_minRtt_Sec\n", a_ovP->rx_minRtt_Sec); - printf("\t%10d rx_minRtt_Usec\n", a_ovP->rx_minRtt_Usec); - printf("\t%10d rx_maxRtt_Sec\n", a_ovP->rx_maxRtt_Sec); - printf("\t%10d rx_maxRtt_Usec\n", a_ovP->rx_maxRtt_Usec); - printf("\t%10d rx_nRttSamples\n", a_ovP->rx_nRttSamples); - printf("\t%10d rx_nServerConns\n", a_ovP->rx_nServerConns); - printf("\t%10d rx_nClientConns\n", a_ovP->rx_nClientConns); - printf("\t%10d rx_nPeerStructs\n", a_ovP->rx_nPeerStructs); - printf("\t%10d rx_nCallStructs\n", a_ovP->rx_nCallStructs); - printf("\t%10d rx_nFreeCallStructs\n\n", a_ovP->rx_nFreeCallStructs); + printf("\t%10d rx_minRtt_Sec\n", a_ovP->rx_minRtt_Sec); + printf("\t%10d rx_minRtt_Usec\n", a_ovP->rx_minRtt_Usec); + printf("\t%10d rx_maxRtt_Sec\n", a_ovP->rx_maxRtt_Sec); + printf("\t%10d rx_maxRtt_Usec\n", a_ovP->rx_maxRtt_Usec); + printf("\t%10d rx_nRttSamples\n", a_ovP->rx_nRttSamples); + printf("\t%10d rx_nServerConns\n", a_ovP->rx_nServerConns); + printf("\t%10d rx_nClientConns\n", a_ovP->rx_nClientConns); + printf("\t%10d rx_nPeerStructs\n", a_ovP->rx_nPeerStructs); + printf("\t%10d rx_nCallStructs\n", a_ovP->rx_nCallStructs); + printf("\t%10d rx_nFreeCallStructs\n\n", a_ovP->rx_nFreeCallStructs); /* * Host module fields. */ - printf("\t%10d host_NumHostEntries\n", a_ovP->host_NumHostEntries); - printf("\t%10d host_HostBlocks\n", a_ovP->host_HostBlocks); - printf("\t%10d host_NonDeletedHosts\n", a_ovP->host_NonDeletedHosts); - printf("\t%10d host_HostsInSameNetOrSubnet\n", a_ovP->host_HostsInSameNetOrSubnet); - printf("\t%10d host_HostsInDiffSubnet\n", a_ovP->host_HostsInDiffSubnet); - printf("\t%10d host_HostsInDiffNetwork\n",a_ovP->host_HostsInDiffNetwork); - printf("\t%10d host_NumClients\n", a_ovP->host_NumClients); - printf("\t%10d host_ClientBlocks\n\n", a_ovP->host_ClientBlocks); + printf("\t%10d host_NumHostEntries\n", a_ovP->host_NumHostEntries); + printf("\t%10d host_HostBlocks\n", a_ovP->host_HostBlocks); + printf("\t%10d host_NonDeletedHosts\n", a_ovP->host_NonDeletedHosts); + printf("\t%10d host_HostsInSameNetOrSubnet\n", + a_ovP->host_HostsInSameNetOrSubnet); + printf("\t%10d host_HostsInDiffSubnet\n", a_ovP->host_HostsInDiffSubnet); + printf("\t%10d host_HostsInDiffNetwork\n", + a_ovP->host_HostsInDiffNetwork); + printf("\t%10d host_NumClients\n", a_ovP->host_NumClients); + printf("\t%10d host_ClientBlocks\n\n", a_ovP->host_ClientBlocks); -} /*Print_fs_OverallPerfInfo*/ +} /*Print_fs_OverallPerfInfo */ /*------------------------------------------------------------------------ @@ -204,20 +216,20 @@ void Print_fs_OverallPerfInfo(a_ovP) * *------------------------------------------------------------------------*/ -void Print_fs_OpTiming(a_opIdx, a_opTimeP) - int a_opIdx; - struct fs_stats_opTimingData *a_opTimeP; +void +Print_fs_OpTiming(a_opIdx, a_opTimeP) + int a_opIdx; + struct fs_stats_opTimingData *a_opTimeP; -{ /*Print_fs_OpTiming*/ +{ /*Print_fs_OpTiming */ printf("%15s: %d ops (%d OK); sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", - fsOpNames[a_opIdx], - a_opTimeP->numOps, a_opTimeP->numSuccesses, + fsOpNames[a_opIdx], a_opTimeP->numOps, a_opTimeP->numSuccesses, a_opTimeP->sumTime.tv_sec, a_opTimeP->sumTime.tv_usec, a_opTimeP->minTime.tv_sec, a_opTimeP->minTime.tv_usec, a_opTimeP->maxTime.tv_sec, a_opTimeP->maxTime.tv_usec); -} /*Print_fs_OpTiming*/ +} /*Print_fs_OpTiming */ /*------------------------------------------------------------------------ @@ -232,32 +244,28 @@ void Print_fs_OpTiming(a_opIdx, a_opTimeP) * *------------------------------------------------------------------------*/ -void Print_fs_XferTiming(a_opIdx, a_xferP) - int a_opIdx; - struct fs_stats_xferData *a_xferP; - -{ /*Print_fs_XferTiming*/ - - printf("%s: %d xfers (%d OK), time sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", - xferOpNames[a_opIdx], - a_xferP->numXfers, a_xferP->numSuccesses, - a_xferP->sumTime.tv_sec, a_xferP->sumTime.tv_usec, - a_xferP->minTime.tv_sec, a_xferP->minTime.tv_usec, - a_xferP->maxTime.tv_sec, a_xferP->maxTime.tv_usec); - printf("\t[bytes: sum=%d, min=%d, max=%d]\n", - a_xferP->sumBytes, a_xferP->minBytes, a_xferP->maxBytes); - printf("\t[buckets: 0: %d, 1: %d, 2: %d, 3: %d, 4: %d, 5: %d 6: %d 7:%d 8:%d]\n", - a_xferP->count[0], - a_xferP->count[1], - a_xferP->count[2], - a_xferP->count[3], - a_xferP->count[4], - a_xferP->count[5], - a_xferP->count[6], - a_xferP->count[7], - a_xferP->count[8]); - -} /*Print_fs_XferTiming*/ +void +Print_fs_XferTiming(a_opIdx, a_xferP) + int a_opIdx; + struct fs_stats_xferData *a_xferP; + +{ /*Print_fs_XferTiming */ + + printf + ("%s: %d xfers (%d OK), time sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", + xferOpNames[a_opIdx], a_xferP->numXfers, a_xferP->numSuccesses, + a_xferP->sumTime.tv_sec, a_xferP->sumTime.tv_usec, + a_xferP->minTime.tv_sec, a_xferP->minTime.tv_usec, + a_xferP->maxTime.tv_sec, a_xferP->maxTime.tv_usec); + printf("\t[bytes: sum=%d, min=%d, max=%d]\n", a_xferP->sumBytes, + a_xferP->minBytes, a_xferP->maxBytes); + printf + ("\t[buckets: 0: %d, 1: %d, 2: %d, 3: %d, 4: %d, 5: %d 6: %d 7:%d 8:%d]\n", + a_xferP->count[0], a_xferP->count[1], a_xferP->count[2], + a_xferP->count[3], a_xferP->count[4], a_xferP->count[5], + a_xferP->count[6], a_xferP->count[7], a_xferP->count[8]); + +} /*Print_fs_XferTiming */ /*------------------------------------------------------------------------ @@ -271,12 +279,13 @@ void Print_fs_XferTiming(a_opIdx, a_xferP) * *------------------------------------------------------------------------*/ -void Print_fs_DetailedPerfInfo(a_detP) - struct fs_stats_DetailedStats *a_detP; +void +Print_fs_DetailedPerfInfo(a_detP) + struct fs_stats_DetailedStats *a_detP; -{ /*Print_fs_DetailedPerfInfo*/ +{ /*Print_fs_DetailedPerfInfo */ - int currIdx; /*Loop variable*/ + int currIdx; /*Loop variable */ printf("\t%10d epoch\n", a_detP->epoch); @@ -286,7 +295,7 @@ void Print_fs_DetailedPerfInfo(a_detP) for (currIdx = 0; currIdx < FS_STATS_NUM_XFER_OPS; currIdx++) Print_fs_XferTiming(currIdx, &(a_detP->xferOpTimes[currIdx])); -} /*Print_fs_DetailedPerfInfo*/ +} /*Print_fs_DetailedPerfInfo */ /*------------------------------------------------------------------------ @@ -301,16 +310,16 @@ void Print_fs_DetailedPerfInfo(a_detP) * *------------------------------------------------------------------------*/ -void Print_fs_FullPerfInfo(a_fs_Results) -struct xstat_fs_ProbeResults *a_fs_Results; /* ptr to fs results */ -{ /*Print_fs_FullPerfInfo*/ +void +Print_fs_FullPerfInfo(a_fs_Results) + struct xstat_fs_ProbeResults *a_fs_Results; /* ptr to fs results */ +{ /*Print_fs_FullPerfInfo */ - static char rn[] = "Print_fs_FullPerfInfo"; /*Routine name*/ - static long fullPerfLongs = - (sizeof(struct fs_stats_FullPerfStats) >> 2); /*Correct # longs to rcv*/ - long numLongs; /*# longwords received*/ - struct fs_stats_FullPerfStats *fullPerfP; /*Ptr to full perf stats*/ - char *printableTime; /*Ptr to printable time string*/ + static char rn[] = "Print_fs_FullPerfInfo"; /*Routine name */ + static long fullPerfLongs = (sizeof(struct fs_stats_FullPerfStats) >> 2); /*Correct # longs to rcv */ + long numLongs; /*# longwords received */ + struct fs_stats_FullPerfStats *fullPerfP; /*Ptr to full perf stats */ + char *printableTime; /*Ptr to printable time string */ numLongs = a_fs_Results->data.AFS_CollData_len; @@ -321,23 +330,22 @@ struct xstat_fs_ProbeResults *a_fs_Results; /* ptr to fs results */ } printableTime = ctime(&(a_fs_Results->probeTime)); - printableTime[strlen(printableTime)-1] = '\0'; + printableTime[strlen(printableTime) - 1] = '\0'; fullPerfP = (struct fs_stats_FullPerfStats *) (a_fs_Results->data.AFS_CollData_val); - printf("AFS_XSTATSCOLL_FULL_PERF_INFO (coll %d) for FS %s\n[Probe %d, %s]\n\n", - a_fs_Results->collectionNumber, - a_fs_Results->connP->hostName, - a_fs_Results->probeNum, - printableTime); + printf + ("AFS_XSTATSCOLL_FULL_PERF_INFO (coll %d) for FS %s\n[Probe %d, %s]\n\n", + a_fs_Results->collectionNumber, a_fs_Results->connP->hostName, + a_fs_Results->probeNum, printableTime); Print_fs_OverallPerfInfo(&(fullPerfP->overall)); Print_fs_DetailedPerfInfo(&(fullPerfP->det)); -} /*Print_fs_FullPerfInfo*/ +} /*Print_fs_FullPerfInfo */ + - /*___________________________________________________________________________ CM STATS *__________________________________________________________________________*/ @@ -356,48 +364,51 @@ struct xstat_fs_ProbeResults *a_fs_Results; /* ptr to fs results */ * *------------------------------------------------------------------------*/ -void Print_cm_UpDownStats(a_upDownP) - struct afs_stats_SrvUpDownInfo *a_upDownP; /*Ptr to server up/down info*/ +void +Print_cm_UpDownStats(a_upDownP) + struct afs_stats_SrvUpDownInfo *a_upDownP; /*Ptr to server up/down info */ -{ /*Print_cm_UpDownStats*/ +{ /*Print_cm_UpDownStats */ /* * First, print the simple values. */ - printf("\t\t%10d numTtlRecords\n", a_upDownP->numTtlRecords); - printf("\t\t%10d numUpRecords\n", a_upDownP->numUpRecords); - printf("\t\t%10d numDownRecords\n", a_upDownP->numDownRecords); - printf("\t\t%10d sumOfRecordAges\n", a_upDownP->sumOfRecordAges); - printf("\t\t%10d ageOfYoungestRecord\n", a_upDownP->ageOfYoungestRecord); - printf("\t\t%10d ageOfOldestRecord\n", a_upDownP->ageOfOldestRecord); - printf("\t\t%10d numDowntimeIncidents\n", a_upDownP->numDowntimeIncidents); - printf("\t\t%10d numRecordsNeverDown\n", a_upDownP->numRecordsNeverDown); - printf("\t\t%10d maxDowntimesInARecord\n", a_upDownP->maxDowntimesInARecord); - printf("\t\t%10d sumOfDowntimes\n", a_upDownP->sumOfDowntimes); - printf("\t\t%10d shortestDowntime\n", a_upDownP->shortestDowntime); - printf("\t\t%10d longestDowntime\n", a_upDownP->longestDowntime); + printf("\t\t%10d numTtlRecords\n", a_upDownP->numTtlRecords); + printf("\t\t%10d numUpRecords\n", a_upDownP->numUpRecords); + printf("\t\t%10d numDownRecords\n", a_upDownP->numDownRecords); + printf("\t\t%10d sumOfRecordAges\n", a_upDownP->sumOfRecordAges); + printf("\t\t%10d ageOfYoungestRecord\n", a_upDownP->ageOfYoungestRecord); + printf("\t\t%10d ageOfOldestRecord\n", a_upDownP->ageOfOldestRecord); + printf("\t\t%10d numDowntimeIncidents\n", + a_upDownP->numDowntimeIncidents); + printf("\t\t%10d numRecordsNeverDown\n", a_upDownP->numRecordsNeverDown); + printf("\t\t%10d maxDowntimesInARecord\n", + a_upDownP->maxDowntimesInARecord); + printf("\t\t%10d sumOfDowntimes\n", a_upDownP->sumOfDowntimes); + printf("\t\t%10d shortestDowntime\n", a_upDownP->shortestDowntime); + printf("\t\t%10d longestDowntime\n", a_upDownP->longestDowntime); /* * Now, print the array values. */ printf("\t\tDowntime duration distribution:\n"); - printf("\t\t\t%8d: 0 min .. 10 min\n", a_upDownP->downDurations[0]); + printf("\t\t\t%8d: 0 min .. 10 min\n", a_upDownP->downDurations[0]); printf("\t\t\t%8d: 10 min .. 30 min\n", a_upDownP->downDurations[1]); - printf("\t\t\t%8d: 30 min .. 1 hr\n", a_upDownP->downDurations[2]); - printf("\t\t\t%8d: 1 hr .. 2 hr\n", a_upDownP->downDurations[3]); - printf("\t\t\t%8d: 2 hr .. 4 hr\n", a_upDownP->downDurations[4]); - printf("\t\t\t%8d: 4 hr .. 8 hr\n", a_upDownP->downDurations[5]); - printf("\t\t\t%8d: > 8 hr\n", a_upDownP->downDurations[6]); + printf("\t\t\t%8d: 30 min .. 1 hr\n", a_upDownP->downDurations[2]); + printf("\t\t\t%8d: 1 hr .. 2 hr\n", a_upDownP->downDurations[3]); + printf("\t\t\t%8d: 2 hr .. 4 hr\n", a_upDownP->downDurations[4]); + printf("\t\t\t%8d: 4 hr .. 8 hr\n", a_upDownP->downDurations[5]); + printf("\t\t\t%8d: > 8 hr\n", a_upDownP->downDurations[6]); printf("\t\tDowntime incident distribution:\n"); - printf("\t\t\t%8d: 0 times\n", a_upDownP->downIncidents[0]); - printf("\t\t\t%8d: 1 time\n", a_upDownP->downIncidents[1]); - printf("\t\t\t%8d: 2 .. 5 times\n", a_upDownP->downIncidents[2]); - printf("\t\t\t%8d: 6 .. 10 times\n", a_upDownP->downIncidents[3]); + printf("\t\t\t%8d: 0 times\n", a_upDownP->downIncidents[0]); + printf("\t\t\t%8d: 1 time\n", a_upDownP->downIncidents[1]); + printf("\t\t\t%8d: 2 .. 5 times\n", a_upDownP->downIncidents[2]); + printf("\t\t\t%8d: 6 .. 10 times\n", a_upDownP->downIncidents[3]); printf("\t\t\t%8d: 10 .. 50 times\n", a_upDownP->downIncidents[4]); - printf("\t\t\t%8d: > 50 times\n", a_upDownP->downIncidents[5]); + printf("\t\t\t%8d: > 50 times\n", a_upDownP->downIncidents[5]); -} /*Print_cm_UpDownStats*/ +} /*Print_cm_UpDownStats */ /*------------------------------------------------------------------------ @@ -411,54 +422,55 @@ void Print_cm_UpDownStats(a_upDownP) * *------------------------------------------------------------------------*/ -void Print_cm_OverallPerfInfo(a_ovP) - struct afs_stats_CMPerf *a_ovP; - -{ /*Print_cm_OverallPerfInfo*/ - - printf("\t%10d numPerfCalls\n", a_ovP->numPerfCalls); - - printf("\t%10d epoch\n", a_ovP->epoch); - printf("\t%10d numCellsVisible\n", a_ovP->numCellsVisible); - printf("\t%10d numCellsContacted\n", a_ovP->numCellsContacted); - printf("\t%10d dlocalAccesses\n", a_ovP->dlocalAccesses); - printf("\t%10d vlocalAccesses\n", a_ovP->vlocalAccesses); - printf("\t%10d dremoteAccesses\n", a_ovP->dremoteAccesses); - printf("\t%10d vremoteAccesses\n", a_ovP->vremoteAccesses); - printf("\t%10d cacheNumEntries\n", a_ovP->cacheNumEntries); - printf("\t%10d cacheBlocksTotal\n", a_ovP->cacheBlocksTotal); - printf("\t%10d cacheBlocksInUse\n", a_ovP->cacheBlocksInUse); - printf("\t%10d cacheBlocksOrig\n", a_ovP->cacheBlocksOrig); - printf("\t%10d cacheMaxDirtyChunks\n",a_ovP->cacheMaxDirtyChunks); - printf("\t%10d cacheCurrDirtyChunks\n", a_ovP->cacheCurrDirtyChunks); - printf("\t%10d dcacheHits\n", a_ovP->dcacheHits); - printf("\t%10d vcacheHits\n", a_ovP->vcacheHits); - printf("\t%10d dcacheMisses\n", a_ovP->dcacheMisses); - printf("\t%10d vcacheMisses\n", a_ovP->vcacheMisses); - printf("\t%10d cacheFilesReused\n", a_ovP->cacheFilesReused); - printf("\t%10d vcacheXAllocs\n", a_ovP->vcacheXAllocs); - - printf("\t%10d bufAlloced\n", a_ovP->bufAlloced); - printf("\t%10d bufHits\n", a_ovP->bufHits); - printf("\t%10d bufMisses\n", a_ovP->bufMisses); - printf("\t%10d bufFlushDirty\n", a_ovP->bufFlushDirty); - - printf("\t%10d LargeBlocksActive\n", a_ovP->LargeBlocksActive); - printf("\t%10d LargeBlocksAlloced\n", a_ovP->LargeBlocksAlloced); - printf("\t%10d SmallBlocksActive\n", a_ovP->SmallBlocksActive); - printf("\t%10d SmallBlocksAlloced\n", a_ovP->SmallBlocksAlloced); - printf("\t%10d OutStandingMemUsage\n", a_ovP->OutStandingMemUsage); - printf("\t%10d OutStandingAllocs\n", a_ovP->OutStandingAllocs); - printf("\t%10d CallBackAlloced\n", a_ovP->CallBackAlloced); - printf("\t%10d CallBackFlushes\n", a_ovP->CallBackFlushes); - - printf("\t%10d srvRecords\n", a_ovP->srvRecords); - printf("\t%10d srvNumBuckets\n", a_ovP->srvNumBuckets); - printf("\t%10d srvMaxChainLength\n", a_ovP->srvMaxChainLength); - printf("\t%10d srvMaxChainLengthHWM\n", a_ovP->srvMaxChainLengthHWM); - printf("\t%10d srvRecordsHWM\n", a_ovP->srvRecordsHWM); - - printf("\t%10d sysName_ID\n", a_ovP->sysName_ID); +void +Print_cm_OverallPerfInfo(a_ovP) + struct afs_stats_CMPerf *a_ovP; + +{ /*Print_cm_OverallPerfInfo */ + + printf("\t%10d numPerfCalls\n", a_ovP->numPerfCalls); + + printf("\t%10d epoch\n", a_ovP->epoch); + printf("\t%10d numCellsVisible\n", a_ovP->numCellsVisible); + printf("\t%10d numCellsContacted\n", a_ovP->numCellsContacted); + printf("\t%10d dlocalAccesses\n", a_ovP->dlocalAccesses); + printf("\t%10d vlocalAccesses\n", a_ovP->vlocalAccesses); + printf("\t%10d dremoteAccesses\n", a_ovP->dremoteAccesses); + printf("\t%10d vremoteAccesses\n", a_ovP->vremoteAccesses); + printf("\t%10d cacheNumEntries\n", a_ovP->cacheNumEntries); + printf("\t%10d cacheBlocksTotal\n", a_ovP->cacheBlocksTotal); + printf("\t%10d cacheBlocksInUse\n", a_ovP->cacheBlocksInUse); + printf("\t%10d cacheBlocksOrig\n", a_ovP->cacheBlocksOrig); + printf("\t%10d cacheMaxDirtyChunks\n", a_ovP->cacheMaxDirtyChunks); + printf("\t%10d cacheCurrDirtyChunks\n", a_ovP->cacheCurrDirtyChunks); + printf("\t%10d dcacheHits\n", a_ovP->dcacheHits); + printf("\t%10d vcacheHits\n", a_ovP->vcacheHits); + printf("\t%10d dcacheMisses\n", a_ovP->dcacheMisses); + printf("\t%10d vcacheMisses\n", a_ovP->vcacheMisses); + printf("\t%10d cacheFilesReused\n", a_ovP->cacheFilesReused); + printf("\t%10d vcacheXAllocs\n", a_ovP->vcacheXAllocs); + + printf("\t%10d bufAlloced\n", a_ovP->bufAlloced); + printf("\t%10d bufHits\n", a_ovP->bufHits); + printf("\t%10d bufMisses\n", a_ovP->bufMisses); + printf("\t%10d bufFlushDirty\n", a_ovP->bufFlushDirty); + + printf("\t%10d LargeBlocksActive\n", a_ovP->LargeBlocksActive); + printf("\t%10d LargeBlocksAlloced\n", a_ovP->LargeBlocksAlloced); + printf("\t%10d SmallBlocksActive\n", a_ovP->SmallBlocksActive); + printf("\t%10d SmallBlocksAlloced\n", a_ovP->SmallBlocksAlloced); + printf("\t%10d OutStandingMemUsage\n", a_ovP->OutStandingMemUsage); + printf("\t%10d OutStandingAllocs\n", a_ovP->OutStandingAllocs); + printf("\t%10d CallBackAlloced\n", a_ovP->CallBackAlloced); + printf("\t%10d CallBackFlushes\n", a_ovP->CallBackFlushes); + + printf("\t%10d srvRecords\n", a_ovP->srvRecords); + printf("\t%10d srvNumBuckets\n", a_ovP->srvNumBuckets); + printf("\t%10d srvMaxChainLength\n", a_ovP->srvMaxChainLength); + printf("\t%10d srvMaxChainLengthHWM\n", a_ovP->srvMaxChainLengthHWM); + printf("\t%10d srvRecordsHWM\n", a_ovP->srvRecordsHWM); + + printf("\t%10d sysName_ID\n", a_ovP->sysName_ID); printf("\tFile Server up/downtimes, same cell:\n"); Print_cm_UpDownStats(&(a_ovP->fs_UpDown[0])); @@ -472,7 +484,7 @@ void Print_cm_OverallPerfInfo(a_ovP) printf("\tVL Server up/downtimes, diff cell:\n"); Print_cm_UpDownStats(&(a_ovP->vl_UpDown[1])); -} /*Print_cm_OverallPerfInfo*/ +} /*Print_cm_OverallPerfInfo */ @@ -489,21 +501,21 @@ void Print_cm_OverallPerfInfo(a_ovP) * *------------------------------------------------------------------------*/ -void Print_cm_OpTiming(a_opIdx, a_opNames, a_opTimeP) - int a_opIdx; - char *a_opNames[]; - struct afs_stats_opTimingData *a_opTimeP; +void +Print_cm_OpTiming(a_opIdx, a_opNames, a_opTimeP) + int a_opIdx; + char *a_opNames[]; + struct afs_stats_opTimingData *a_opTimeP; -{ /*Print_cm_OpTiming*/ +{ /*Print_cm_OpTiming */ printf("%15s: %d ops (%d OK); sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", - a_opNames[a_opIdx], - a_opTimeP->numOps, a_opTimeP->numSuccesses, + a_opNames[a_opIdx], a_opTimeP->numOps, a_opTimeP->numSuccesses, a_opTimeP->sumTime.tv_sec, a_opTimeP->sumTime.tv_usec, a_opTimeP->minTime.tv_sec, a_opTimeP->minTime.tv_usec, a_opTimeP->maxTime.tv_sec, a_opTimeP->maxTime.tv_usec); -} /*Print_cm_OpTiming*/ +} /*Print_cm_OpTiming */ /*------------------------------------------------------------------------ @@ -518,33 +530,29 @@ void Print_cm_OpTiming(a_opIdx, a_opNames, a_opTimeP) * *------------------------------------------------------------------------*/ -void Print_cm_XferTiming(a_opIdx, a_opNames, a_xferP) - int a_opIdx; - char *a_opNames[]; - struct afs_stats_xferData *a_xferP; - -{ /*Print_cm_XferTiming*/ - - printf("%s: %d xfers (%d OK), time sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", - a_opNames[a_opIdx], - a_xferP->numXfers, a_xferP->numSuccesses, - a_xferP->sumTime.tv_sec, a_xferP->sumTime.tv_usec, - a_xferP->minTime.tv_sec, a_xferP->minTime.tv_usec, - a_xferP->maxTime.tv_sec, a_xferP->maxTime.tv_usec); - printf("\t[bytes: sum=%d, min=%d, max=%d]\n", - a_xferP->sumBytes, a_xferP->minBytes, a_xferP->maxBytes); - printf("\t[buckets: 0: %d, 1: %d, 2: %d, 3: %d, 4: %d, 5: %d, 6: %d, 7: %d, 8: %d]\n", - a_xferP->count[0], - a_xferP->count[1], - a_xferP->count[2], - a_xferP->count[3], - a_xferP->count[4], - a_xferP->count[5], - a_xferP->count[6], - a_xferP->count[7], - a_xferP->count[8]); - -} /*Print_cm_XferTiming*/ +void +Print_cm_XferTiming(a_opIdx, a_opNames, a_xferP) + int a_opIdx; + char *a_opNames[]; + struct afs_stats_xferData *a_xferP; + +{ /*Print_cm_XferTiming */ + + printf + ("%s: %d xfers (%d OK), time sum=%d.%06d, min=%d.%06d, max=%d.%06d\n", + a_opNames[a_opIdx], a_xferP->numXfers, a_xferP->numSuccesses, + a_xferP->sumTime.tv_sec, a_xferP->sumTime.tv_usec, + a_xferP->minTime.tv_sec, a_xferP->minTime.tv_usec, + a_xferP->maxTime.tv_sec, a_xferP->maxTime.tv_usec); + printf("\t[bytes: sum=%d, min=%d, max=%d]\n", a_xferP->sumBytes, + a_xferP->minBytes, a_xferP->maxBytes); + printf + ("\t[buckets: 0: %d, 1: %d, 2: %d, 3: %d, 4: %d, 5: %d, 6: %d, 7: %d, 8: %d]\n", + a_xferP->count[0], a_xferP->count[1], a_xferP->count[2], + a_xferP->count[3], a_xferP->count[4], a_xferP->count[5], + a_xferP->count[6], a_xferP->count[7], a_xferP->count[8]); + +} /*Print_cm_XferTiming */ /*------------------------------------------------------------------------ @@ -560,23 +568,21 @@ void Print_cm_XferTiming(a_opIdx, a_opNames, a_xferP) * *------------------------------------------------------------------------*/ -void Print_cm_ErrInfo(a_opIdx, a_opNames, a_opErrP) - int a_opIdx; - char *a_opNames[]; - struct afs_stats_RPCErrors *a_opErrP; +void +Print_cm_ErrInfo(a_opIdx, a_opNames, a_opErrP) + int a_opIdx; + char *a_opNames[]; + struct afs_stats_RPCErrors *a_opErrP; -{ /*Print_cm_ErrInfo*/ +{ /*Print_cm_ErrInfo */ - printf("%15s: %d server, %d network, %d prot, %d vol, %d busies, %d other\n", - a_opNames[a_opIdx], - a_opErrP->err_Server, - a_opErrP->err_Network, - a_opErrP->err_Protection, - a_opErrP->err_Volume, - a_opErrP->err_VolumeBusies, - a_opErrP->err_Other); + printf + ("%15s: %d server, %d network, %d prot, %d vol, %d busies, %d other\n", + a_opNames[a_opIdx], a_opErrP->err_Server, a_opErrP->err_Network, + a_opErrP->err_Protection, a_opErrP->err_Volume, + a_opErrP->err_VolumeBusies, a_opErrP->err_Other); -} /*Print_cm_ErrInfo*/ +} /*Print_cm_ErrInfo */ /*------------------------------------------------------------------------ @@ -590,12 +596,13 @@ void Print_cm_ErrInfo(a_opIdx, a_opNames, a_opErrP) * *------------------------------------------------------------------------*/ -void Print_cm_RPCPerfInfo(a_rpcP) - struct afs_stats_RPCOpInfo *a_rpcP; +void +Print_cm_RPCPerfInfo(a_rpcP) + struct afs_stats_RPCOpInfo *a_rpcP; -{ /*Print_cm_RPCPerfInfo*/ +{ /*Print_cm_RPCPerfInfo */ - int currIdx; /*Loop variable*/ + int currIdx; /*Loop variable */ /* * Print the contents of each of the opcode-related arrays. @@ -610,13 +617,14 @@ void Print_cm_RPCPerfInfo(a_rpcP) printf("\nTransfer timings:\n-----------------\n"); for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_XFER_OPS; currIdx++) - Print_cm_XferTiming(currIdx, xferOpNames, &(a_rpcP->fsXferTimes[currIdx])); + Print_cm_XferTiming(currIdx, xferOpNames, + &(a_rpcP->fsXferTimes[currIdx])); printf("\nCM Operation Timings:\n---------------------\n"); for (currIdx = 0; currIdx < AFS_STATS_NUM_CM_RPC_OPS; currIdx++) Print_cm_OpTiming(currIdx, cmOpNames, &(a_rpcP->cmRPCTimes[currIdx])); -} /*Print_cm_RPCPerfInfo*/ +} /*Print_cm_RPCPerfInfo */ /*------------------------------------------------------------------------ @@ -630,17 +638,17 @@ void Print_cm_RPCPerfInfo(a_rpcP) * *------------------------------------------------------------------------*/ -void Print_cm_FullPerfInfo(a_fullP) -struct afs_stats_CMFullPerf *a_fullP; -{ /*Print_cm_FullPerfInfo*/ - - static char rn[] = "Print_cm_FullPerfInfo"; /* routine name */ - struct afs_stats_AuthentInfo *authentP; /*Ptr to authentication stats*/ - struct afs_stats_AccessInfo *accessinfP; /*Ptr to access stats*/ - struct afs_stats_AuthorInfo *authorP; /*Ptr to authorship stats*/ - static long fullPerfLongs = - (sizeof (struct afs_stats_CMFullPerf) >> 2); /*Correct #longs*/ - long numLongs; /*# longs actually received*/ +void +Print_cm_FullPerfInfo(a_fullP) + struct afs_stats_CMFullPerf *a_fullP; +{ /*Print_cm_FullPerfInfo */ + + static char rn[] = "Print_cm_FullPerfInfo"; /* routine name */ + struct afs_stats_AuthentInfo *authentP; /*Ptr to authentication stats */ + struct afs_stats_AccessInfo *accessinfP; /*Ptr to access stats */ + struct afs_stats_AuthorInfo *authorP; /*Ptr to authorship stats */ + static long fullPerfLongs = (sizeof(struct afs_stats_CMFullPerf) >> 2); /*Correct #longs */ + long numLongs; /*# longs actually received */ struct afs_stats_CMFullPerf *fullP; fullP = a_fullP; @@ -656,160 +664,163 @@ struct afs_stats_CMFullPerf *a_fullP; authentP = &(fullP->authent); printf("\nAuthentication info:\n--------------------\n"); - printf("\t%d PAGS, %d records (%d auth, %d unauth), %d max in PAG, chain max: %d\n", - authentP->curr_PAGs, - authentP->curr_Records, - authentP->curr_AuthRecords, - authentP->curr_UnauthRecords, - authentP->curr_MaxRecordsInPAG, - authentP->curr_LongestChain); - printf("\t%d PAG creations, %d tkt updates\n", - authentP->PAGCreations, + printf + ("\t%d PAGS, %d records (%d auth, %d unauth), %d max in PAG, chain max: %d\n", + authentP->curr_PAGs, authentP->curr_Records, + authentP->curr_AuthRecords, authentP->curr_UnauthRecords, + authentP->curr_MaxRecordsInPAG, authentP->curr_LongestChain); + printf("\t%d PAG creations, %d tkt updates\n", authentP->PAGCreations, authentP->TicketUpdates); printf("\t[HWMs: %d PAGS, %d records, %d max in PAG, chain max: %d]\n", - authentP->HWM_PAGs, - authentP->HWM_Records, - authentP->HWM_MaxRecordsInPAG, - authentP->HWM_LongestChain); + authentP->HWM_PAGs, authentP->HWM_Records, + authentP->HWM_MaxRecordsInPAG, authentP->HWM_LongestChain); accessinfP = &(fullP->accessinf); printf("\n[Un]replicated accesses:\n------------------------\n"); - printf("\t%d unrep, %d rep, %d reps accessed, %d max reps/ref, %d first OK\n\n", - accessinfP->unreplicatedRefs, - accessinfP->replicatedRefs, - accessinfP->numReplicasAccessed, - accessinfP->maxReplicasPerRef, - accessinfP->refFirstReplicaOK); + printf + ("\t%d unrep, %d rep, %d reps accessed, %d max reps/ref, %d first OK\n\n", + accessinfP->unreplicatedRefs, accessinfP->replicatedRefs, + accessinfP->numReplicasAccessed, accessinfP->maxReplicasPerRef, + accessinfP->refFirstReplicaOK); /* There really isn't any authorship info - authorP = &(fullP->author); */ + * authorP = &(fullP->author); */ -} /*Print_cm_FullPerfInfo*/ +} /*Print_cm_FullPerfInfo */ -main(argc,argv) -int argc; -char *argv[]; +main(argc, argv) + int argc; + char *argv[]; { - static char rn[] = "main"; - FILE *inFD; - char *line, *charPtr; - long *longs, *longPtr; - int block_size, exitcode, i, numLongs, counter; - char day[5],month[5],date[5],time[10],year[5],hostname[80],hosttype[5]; - struct afs_stats_CMFullPerf *cmPerfP; - struct fs_stats_FullPerfStats *fsPerfP; - char tmpstr[20]; - - - if ((argc < 2) || (strcasecmp(argv[1],"-h")==0) || - (strcasecmp(argv[1],"-help")==0) || (strcasecmp(argv[1],"help")==0) ) { - fprintf(stderr,"\nUsage: %s \n",argv[0]); - fprintf(stderr,"\twhere is the output generated by AFSMonitor\n\n"); - exit(1); - } - - - - inFD = fopen(argv[1],"r"); - if (inFD == (FILE *)0) { - fprintf(stderr,"\n[ %s ] Unable to open input file %s. \n",rn,argv[1]); - exit(5); - } - - block_size = XSTAT_CM_FULLPERF_RESULTS_LEN * sizeof(long); - - /* Malloc two blocks of data, one for reading each line from the data file - and the other for coverting data to longs */ - - if ( (line = malloc(block_size+256)) == (char *)NULL) { - fprintf(stderr,"[ %s ] malloc %d bytes failed\n",rn,block_size+256); - exit(10); - } - - if ( (longs = malloc(block_size)) == (long *) NULL) { - fprintf(stderr,"[ %s ] malloc %d bytes failed\n",rn,block_size); - exit(20); - } - - /* Parse the data file */ - while (1) { - if (fgets(line, block_size, inFD) == NULL) { - exitcode = 0; - goto FINISH; - } - if (strlen(line) < 5) - continue; - - /* Parse the date, hostname, and hosttype (FS or CM) */ - - charPtr = line; - sscanf(charPtr,"%s %s %s %s %s %s %s", day,month,date,time, - year,hostname,hosttype); - charPtr += strlen(day) + strlen(month) + strlen(date) + strlen(time) + - strlen(year) + strlen(hostname) + strlen(hosttype) + 8; - - printf("\n\n%s %s %s %s %s %s %s \n\n", - day,month,date,time,year,hostname, hosttype); - - /* Check the first datum. If it is -1 the probe had failed */ - - sscanf(charPtr,"%s",tmpstr); - if ( atoi(tmpstr) == -1) { - printf("Probe failed, no data to process.\n"); - continue; - } - - /* Convert the data to longs */ - - if (strcmp(hosttype,"FS") == 0) numLongs = XSTAT_FS_FULLPERF_RESULTS_LEN; - else if (strcmp(hosttype,"CM") == 0) numLongs=XSTAT_CM_FULLPERF_RESULTS_LEN; - else { - fprintf(stderr, "Cannot determine hosttype %s\n",hosttype); - fprintf(stderr,"Skipping this entry\n"); - continue; - } - - longPtr = longs; - counter = 0; - for (i = 0; i < numLongs; i++) { - sscanf(charPtr,"%ld",longPtr); - sscanf(charPtr,"%s",tmpstr); - longPtr++; - charPtr += strlen(tmpstr) + 1; - counter++; - } - - /* Verify that we read the correct number of longs and print them */ - - if (strcmp(hosttype,"CM") == 0) { - if (counter == XSTAT_CM_FULLPERF_RESULTS_LEN) - Print_cm_FullPerfInfo( (struct afs_stats_CMFullPerf *) longs); - else - fprintf(stderr,"Data size mismatch error. Expected %d longs, found %d longs\n",numLongs,counter); - } - else { - if (counter == XSTAT_FS_FULLPERF_RESULTS_LEN) { - fsPerfP = (struct fs_stats_FullPerfStats *) longs; - Print_fs_OverallPerfInfo (&(fsPerfP->overall)); - Print_fs_DetailedPerfInfo (&(fsPerfP->det)); + static char rn[] = "main"; + FILE *inFD; + char *line, *charPtr; + long *longs, *longPtr; + int block_size, exitcode, i, numLongs, counter; + char day[5], month[5], date[5], time[10], year[5], hostname[80], + hosttype[5]; + struct afs_stats_CMFullPerf *cmPerfP; + struct fs_stats_FullPerfStats *fsPerfP; + char tmpstr[20]; + + + if ((argc < 2) || (strcasecmp(argv[1], "-h") == 0) + || (strcasecmp(argv[1], "-help") == 0) + || (strcasecmp(argv[1], "help") == 0)) { + fprintf(stderr, "\nUsage: %s \n", argv[0]); + fprintf(stderr, + "\twhere is the output generated by AFSMonitor\n\n"); + exit(1); } - else - fprintf(stderr,"Data size mismatch error. Expected %d longs, found %d longs\n",numLongs,counter); - - } - printf("\n-------------------------------------------------------------------------\n"); - } /* while */ - exitcode = 0; -FINISH: - fclose(inFD); - free(line); - free(longs); -} - + inFD = fopen(argv[1], "r"); + if (inFD == (FILE *) 0) { + fprintf(stderr, "\n[ %s ] Unable to open input file %s. \n", rn, + argv[1]); + exit(5); + } + + block_size = XSTAT_CM_FULLPERF_RESULTS_LEN * sizeof(long); + + /* Malloc two blocks of data, one for reading each line from the data file + * and the other for coverting data to longs */ + if ((line = malloc(block_size + 256)) == (char *)NULL) { + fprintf(stderr, "[ %s ] malloc %d bytes failed\n", rn, + block_size + 256); + exit(10); + } + + if ((longs = malloc(block_size)) == (long *)NULL) { + fprintf(stderr, "[ %s ] malloc %d bytes failed\n", rn, block_size); + exit(20); + } + + /* Parse the data file */ + while (1) { + if (fgets(line, block_size, inFD) == NULL) { + exitcode = 0; + goto FINISH; + } + if (strlen(line) < 5) + continue; + + /* Parse the date, hostname, and hosttype (FS or CM) */ + + charPtr = line; + sscanf(charPtr, "%s %s %s %s %s %s %s", day, month, date, time, year, + hostname, hosttype); + charPtr += + strlen(day) + strlen(month) + strlen(date) + strlen(time) + + strlen(year) + strlen(hostname) + strlen(hosttype) + 8; + + printf("\n\n%s %s %s %s %s %s %s \n\n", day, month, date, time, year, + hostname, hosttype); + + /* Check the first datum. If it is -1 the probe had failed */ + + sscanf(charPtr, "%s", tmpstr); + if (atoi(tmpstr) == -1) { + printf("Probe failed, no data to process.\n"); + continue; + } + + /* Convert the data to longs */ + + if (strcmp(hosttype, "FS") == 0) + numLongs = XSTAT_FS_FULLPERF_RESULTS_LEN; + else if (strcmp(hosttype, "CM") == 0) + numLongs = XSTAT_CM_FULLPERF_RESULTS_LEN; + else { + fprintf(stderr, "Cannot determine hosttype %s\n", hosttype); + fprintf(stderr, "Skipping this entry\n"); + continue; + } + + longPtr = longs; + counter = 0; + for (i = 0; i < numLongs; i++) { + sscanf(charPtr, "%ld", longPtr); + sscanf(charPtr, "%s", tmpstr); + longPtr++; + charPtr += strlen(tmpstr) + 1; + counter++; + } + + /* Verify that we read the correct number of longs and print them */ + + if (strcmp(hosttype, "CM") == 0) { + if (counter == XSTAT_CM_FULLPERF_RESULTS_LEN) + Print_cm_FullPerfInfo((struct afs_stats_CMFullPerf *)longs); + else + fprintf(stderr, + "Data size mismatch error. Expected %d longs, found %d longs\n", + numLongs, counter); + } else { + if (counter == XSTAT_FS_FULLPERF_RESULTS_LEN) { + fsPerfP = (struct fs_stats_FullPerfStats *)longs; + Print_fs_OverallPerfInfo(&(fsPerfP->overall)); + Print_fs_DetailedPerfInfo(&(fsPerfP->det)); + } else + fprintf(stderr, + "Data size mismatch error. Expected %d longs, found %d longs\n", + numLongs, counter); + + } + + printf + ("\n-------------------------------------------------------------------------\n"); + } /* while */ + + exitcode = 0; + + FINISH: + fclose(inFD); + free(line); + free(longs); +} diff --git a/src/afsmonitor/afsmon-win.c b/src/afsmonitor/afsmon-win.c index 30753a11b..0124b62a3 100644 --- a/src/afsmonitor/afsmon-win.c +++ b/src/afsmonitor/afsmon-win.c @@ -15,7 +15,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/afsmonitor/afsmon-win.c,v 1.1.1.5 2001/07/14 22:20:19 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afsmonitor/afsmon-win.c,v 1.10 2003/07/15 23:14:32 shadow Exp $"); #include #include @@ -27,20 +28,20 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afsmonitor/afsmon-win.c,v 1.1.1.5 2001/ #undef IN #include -#include /*Generic window package*/ -#include /*Object definitions*/ +#include /*Generic window package */ +#include /*Object definitions */ #if 0 -#include /*Text object circular buffer interface*/ -#include /*Text object interface*/ +#include /*Text object circular buffer interface */ +#include /*Text object interface */ #endif -#include /*Light object interface*/ -#include /*Curses window package*/ -#include /*Dumb terminal window package*/ -#include /*X11 window package*/ -#include /*Frame package*/ +#include /*Light object interface */ +#include /*Curses window package */ +#include /*Dumb terminal window package */ +#include /*X11 window package */ +#include /*Frame package */ -#include -#include +#include +#include #include "afsmonitor.h" @@ -54,8 +55,8 @@ static char afsmon_version[] = "1.0"; extern int afsmon_debug; /* debug info to file ? */ extern FILE *debugFD; /* debugging file descriptor */ -extern char errMsg[256]; /* buffers used to print error messages after*/ -extern char errMsg1[256]; /* gtx is initialized (stderr/stdout gone !) */ +extern char errMsg[256]; /* buffers used to print error messages after */ +extern char errMsg1[256]; /* gtx is initialized (stderr/stdout gone !) */ /* number of fileservers and cache managers to monitor */ extern int numFS; @@ -69,10 +70,10 @@ extern int numHosts_onfs_alerts; extern int num_cm_alerts; extern int numHosts_oncm_alerts; -/* ptr to array holding the results of FS probes in ascii format */ +/* ptr to array holding the results of FS probes in ascii format */ extern struct fs_Display_Data *prev_fsData; -/* ptr to array holding the results of CM probes in ascii format */ +/* ptr to array holding the results of CM probes in ascii format */ extern struct cm_Display_Data *prev_cmData; extern int afsmon_fs_curr_probeNum; /* current fs probe number */ @@ -80,17 +81,17 @@ extern int afsmon_fs_prev_probeNum; /* previous fs probe number */ extern int afsmon_cm_curr_probeNum; /* current cm probe number */ extern int afsmon_cm_prev_probeNum; /* previous cm probe number */ -extern int afsmon_probefreq; /* probe frequency */ +extern int afsmon_probefreq; /* probe frequency */ /* map of fs results items we must display. This array contains indices to the fs_varNames[] array corresponding to the stats we want to display. It is initialized while processing the config file */ extern short fs_Display_map[XSTAT_FS_FULLPERF_RESULTS_LEN]; -extern int fs_DisplayItems_count; /* number of items to display */ +extern int fs_DisplayItems_count; /* number of items to display */ extern short cm_Display_map[XSTAT_FS_FULLPERF_RESULTS_LEN]; -extern int cm_DisplayItems_count; /* number of items to display */ +extern int cm_DisplayItems_count; /* number of items to display */ /* GTX VARIABLES */ @@ -113,21 +114,21 @@ extern int cm_DisplayItems_count; /* number of items to display */ #define OVW_CMD_O_WIDTH (maxX/2) /* cmd line object */ #define OVW_NUMFS_O_WIDTH 40 /* num FSs monitored */ #define OVW_NUMCM_O_WIDTH 40 /* num CMs monitored */ -#define OVW_FSALERTS_O_WIDTH 40 /* num FS alerts */ -#define OVW_CMALERTS_O_WIDTH 40 /* num CM alerts */ -#define OVW_HOSTNAME_O_WIDTH (maxX / 2) /* FS & CM host names */ +#define OVW_FSALERTS_O_WIDTH 40 /* num FS alerts */ +#define OVW_CMALERTS_O_WIDTH 40 /* num CM alerts */ +#define OVW_HOSTNAME_O_WIDTH (maxX / 2) /* FS & CM host names */ #define OVW_HOSTNAME_O_WIDTH_HGL 30 /* cosmetic, atleast this many chars - will be highlightned */ + * will be highlightned */ /* widths of FS and CM frame objects */ #define FC_NUMHOSTS_O_WIDTH (maxX - 8) /* number of fs monitored. leave 4 - chars on either side for '<<','>>' */ + * chars on either side for '<<','>>' */ #define FC_PAGENUM_O_WIDTH 43 -#define FC_HOSTNAME_O_WIDTH 11 /* width of FS hostnames column */ -#define FC_CMD_O_WIDTH 55 /* width of cmd line */ -#define FC_PROBENUM_O_WIDTH 30 /* width of probe number object */ -#define FC_ARROWS_O_WIDTH 4 /* width of arrow indicators */ -#define FC_COLUMN_WIDTH 11 /* width of data columns */ +#define FC_HOSTNAME_O_WIDTH 11 /* width of FS hostnames column */ +#define FC_CMD_O_WIDTH 55 /* width of cmd line */ +#define FC_PROBENUM_O_WIDTH 30 /* width of probe number object */ +#define FC_ARROWS_O_WIDTH 4 /* width of arrow indicators */ +#define FC_COLUMN_WIDTH 11 /* width of data columns */ /* bit definitions for use in resolving command line */ /* these bits are set in the xx_pageType variables to indicate what commands @@ -141,13 +142,13 @@ are acceptable */ #define CMD_CM 32 /* cache managers frame exists ? */ -#define FC_NUM_FIXED_LINES 10 /* number of fixed lines */ -#define FC_FIRST_HOST_ROW 8 /* first host entry row number */ -#define FC_FIRST_LABEL_ROW 4 /* first label row number */ +#define FC_NUM_FIXED_LINES 10 /* number of fixed lines */ +#define FC_FIRST_HOST_ROW 8 /* first host entry row number */ +#define FC_FIRST_LABEL_ROW 4 /* first label row number */ /* number of fixed lines (that dont change) on the overview screen */ #define OVW_NUM_FIXED_LINES 7 -#define OVW_FIRST_HOST_ROW 5 /* row index of first host entry in ovw frame*/ +#define OVW_FIRST_HOST_ROW 5 /* row index of first host entry in ovw frame */ #define HIGHLIGHT 1 /* highlight object? */ @@ -162,20 +163,20 @@ int gtx_initialized = 0; /* Overview screen related definitions */ -struct gtx_frame *ovwFrame; /* overview screen frame */ +struct gtx_frame *ovwFrame; /* overview screen frame */ struct gwin_sizeparams frameDims; /* frame dimensions. all frames have - same dimensions */ + * same dimensions */ /* overview frame object names */ -struct onode *ovw_progName_o; /* program name object */ -struct onode *ovw_pageNum_o; /* page number onject */ -struct onode *ovw_cmd_o; /* command line object */ -struct onode *ovw_probeNum_o; /* probe number object */ -struct onode *ovw_numFS_o; /* num FS monitored */ -struct onode *ovw_numCM_o; /* num CM monitored */ -struct onode *ovw_FSalerts_o; /* nunber of FS alerts */ -struct onode *ovw_CMalerts_o; /* nunber of CM alerts */ -struct onode *initMsg_o; /* initialization message */ +struct onode *ovw_progName_o; /* program name object */ +struct onode *ovw_pageNum_o; /* page number onject */ +struct onode *ovw_cmd_o; /* command line object */ +struct onode *ovw_probeNum_o; /* probe number object */ +struct onode *ovw_numFS_o; /* num FS monitored */ +struct onode *ovw_numCM_o; /* num CM monitored */ +struct onode *ovw_FSalerts_o; /* nunber of FS alerts */ +struct onode *ovw_CMalerts_o; /* nunber of CM alerts */ +struct onode *initMsg_o; /* initialization message */ /* number of pages of data for the overview frame */ int ovw_numPages = 0; @@ -197,19 +198,19 @@ int ovw_update_info = 0; /* Variables needed to display an intialization message on startup */ static char *initMsg = "AFSMonitor Collecting Statistics ..."; -static int initMsg_on = 0; /* message on ? */ +static int initMsg_on = 0; /* message on ? */ /* FILE SERVER Screen related definitions */ -struct gtx_frame *fsFrame; /* File Server screen frame */ +struct gtx_frame *fsFrame; /* File Server screen frame */ -struct onode *fs_pageNum_o; /* fs page number object */ -struct onode *fs_cmd_o; /* fs command line object */ -struct onode *fs_probeNum_o; /* fs probe number object */ -struct onode *fs_numFS_o; /* fs number of FSs object */ -struct onode *fs_leftArrows_o; /* fs cols on left signal object */ -struct onode *fs_rightArrows_o; /* fs cols on right signal object */ -struct onode **fs_hostNames_o; /* ptr to host names objects */ +struct onode *fs_pageNum_o; /* fs page number object */ +struct onode *fs_cmd_o; /* fs command line object */ +struct onode *fs_probeNum_o; /* fs probe number object */ +struct onode *fs_numFS_o; /* fs number of FSs object */ +struct onode *fs_leftArrows_o; /* fs cols on left signal object */ +struct onode *fs_rightArrows_o; /* fs cols on right signal object */ +struct onode **fs_hostNames_o; /* ptr to host names objects */ /* bit-map to characterize page type and contents of command prompt */ static int fs_pageType = 0; @@ -220,19 +221,19 @@ static int fs_pageType = 0; numbers to navigate horizontally */ int fs_numHosts_perPage; /* number of file servers per page */ -int fs_cols_perPage; /* number of data columns per file server page*/ +int fs_cols_perPage; /* number of data columns per file server page */ int fs_currPage; /* current FS page number */ int fs_numPages; /* number of FS pages */ /* column numbers are index to the mapping structure fs_Display_map. this map contains the indices of datums that should be displayed */ -int fs_numCols; /* number of columns of FS data (excluding hostname)*/ +int fs_numCols; /* number of columns of FS data (excluding hostname) */ /* this is the same as fs_DisplayItems_count */ /* following column indices run from 1 to (fs_numCols -1) */ -int fs_curr_LCol = 0; /* column number of leftmost column on display */ -int fs_curr_RCol = 0; /* column number of rightmost column on display */ -int fs_Data_Available = 0; /* atleast one fs probe cycle completed ? */ +int fs_curr_LCol = 0; /* column number of leftmost column on display */ +int fs_curr_RCol = 0; /* column number of rightmost column on display */ +int fs_Data_Available = 0; /* atleast one fs probe cycle completed ? */ /* structure that defines a line of data in the fs/cm frames */ @@ -244,28 +245,28 @@ characters to be displayed - such fields may overflow to the second object placed below the first one. */ struct ServerInfo_line { - struct onode *host_o; /* hostname object */ - struct onode **data_o[2]; /* ptrs to two arrays of data objects.*/ - + struct onode *host_o; /* hostname object */ + struct onode **data_o[2]; /* ptrs to two arrays of data objects. */ + }; -struct ServerInfo_line *fs_lines; /* ptr to the file server data objects*/ +struct ServerInfo_line *fs_lines; /* ptr to the file server data objects */ /* file server label onodes - three rows of them */ struct onode **fsLabels_o[3]; /* CACHE MANAGER Screen related definitions */ -struct gtx_frame *cmFrame; /* Cache Manager screen frame */ +struct gtx_frame *cmFrame; /* Cache Manager screen frame */ -struct onode *cm_pageNum_o; /* cm page number object */ -struct onode *cm_cmd_o; /* cm command line object */ -struct onode *cm_probeNum_o; /* cm probe number object */ -struct onode *cm_numCM_o; /* cm number of FSs object */ -struct onode *cm_leftArrows_o; /* fs cols on left signal object */ -struct onode *cm_rightArrows_o; /* fs cols on right signal object */ +struct onode *cm_pageNum_o; /* cm page number object */ +struct onode *cm_cmd_o; /* cm command line object */ +struct onode *cm_probeNum_o; /* cm probe number object */ +struct onode *cm_numCM_o; /* cm number of FSs object */ +struct onode *cm_leftArrows_o; /* fs cols on left signal object */ +struct onode *cm_rightArrows_o; /* fs cols on right signal object */ -struct onode **cm_hostNames_o; /* ptr to host names objects */ +struct onode **cm_hostNames_o; /* ptr to host names objects */ /* bit-map to characterize page type and contents of command prompt */ static int cm_pageType = 0; @@ -276,23 +277,23 @@ static int cm_pageType = 0; numbers to navigate horizontally */ int cm_numHosts_perPage; /* number of cache managers per page */ -int cm_cols_perPage; /* number of data columns per file server page*/ +int cm_cols_perPage; /* number of data columns per file server page */ int cm_currPage; /* current CM page number */ int cm_numPages; /* number of CM pages */ /* column numbers are index to the mapping structure cm_Display_map. this map contains the indices of datums that should be displayed */ -int cm_numCols; /* number of columns of FS data (excluding hostname)*/ +int cm_numCols; /* number of columns of FS data (excluding hostname) */ /* this is the same as cm_DisplayItems_count */ /* following column indices run from 1 to (cm_numCols -1) */ -int cm_curr_LCol = 0; /* column number of leftmost column on display */ -int cm_curr_RCol = 0; /* column number of rightmost column on display */ -int cm_Data_Available = 0; /* atleast one cm probe cycle completed ? */ +int cm_curr_LCol = 0; /* column number of leftmost column on display */ +int cm_curr_RCol = 0; /* column number of rightmost column on display */ +int cm_Data_Available = 0; /* atleast one cm probe cycle completed ? */ /* structure that defines a line of data in the fs/cm frames */ -struct ServerInfo_line *cm_lines; /* ptr to the file server data objects*/ +struct ServerInfo_line *cm_lines; /* ptr to the file server data objects */ /* file server label onodes - three rows of them */ struct onode **cmLabels_o[3]; @@ -327,75 +328,76 @@ struct onode **cmLabels_o[3]; static struct onode * initLightObject(a_name, a_x, a_y, a_width, a_win) - char *a_name; - int a_x; - int a_y; - int a_width; - struct gwin *a_win; + char *a_name; + int a_x; + int a_y; + int a_width; + struct gwin *a_win; -{ /*initLightObject*/ +{ /*initLightObject */ - static char rn[] = "initLightObject"; /*Routine name*/ - struct onode *newlightp; /*Ptr to new light onode*/ - struct gator_light_crparams light_crparams; /*Light creation params*/ - char *truncname; /*Truncated name, if needed*/ - int name_len; /*True length of name*/ + static char rn[] = "initLightObject"; /*Routine name */ + struct onode *newlightp; /*Ptr to new light onode */ + struct gator_light_crparams light_crparams; /*Light creation params */ + char *truncname; /*Truncated name, if needed */ + int name_len; /*True length of name */ /* the following debug statement floods the debug file */ #ifdef DEBUG_DETAILED if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_name= %s, a_x= %d, a_y= %d, a_width= %d, a_win= %d\n", - rn, a_name, a_x, a_y, a_width, a_win); + fprintf(debugFD, + "[ %s ] Called, a_name= %s, a_x= %d, a_y= %d, a_width= %d, a_win= %d\n", + rn, a_name, a_x, a_y, a_width, a_win); fflush(debugFD); } #endif - newlightp = (struct onode *)0; + newlightp = NULL; /* - * Set up the creation parameters according to the information we've - * received. - */ + * Set up the creation parameters according to the information we've + * received. + */ light_crparams.onode_params.cr_type = GATOR_OBJ_LIGHT; name_len = strlen(a_name); if (name_len <= a_width) - sprintf(light_crparams.onode_params.cr_name, "%s", a_name); + sprintf(light_crparams.onode_params.cr_name, "%s", a_name); else { - /* - * We need to truncate the given name, leaving a `*' at the end to - * show us it's been truncated. - */ - truncname = light_crparams.onode_params.cr_name; - strncpy(truncname, a_name, a_width-1); - truncname[a_width-1] = '*'; - truncname[a_width] = 0; - } - light_crparams.onode_params.cr_x = a_x; - light_crparams.onode_params.cr_y = a_y; - light_crparams.onode_params.cr_width = a_width; - light_crparams.onode_params.cr_height = 1; - light_crparams.onode_params.cr_window = a_win; - light_crparams.onode_params.cr_home_obj = (struct onode *)0; - light_crparams.onode_params.cr_prev_obj = (struct onode *)0; - light_crparams.onode_params.cr_parent_obj = (struct onode *)0; - light_crparams.onode_params.cr_helpstring = (char *)0; + /* + * We need to truncate the given name, leaving a `*' at the end to + * show us it's been truncated. + */ + truncname = light_crparams.onode_params.cr_name; + strncpy(truncname, a_name, a_width - 1); + truncname[a_width - 1] = '*'; + truncname[a_width] = 0; + } + light_crparams.onode_params.cr_x = a_x; + light_crparams.onode_params.cr_y = a_y; + light_crparams.onode_params.cr_width = a_width; + light_crparams.onode_params.cr_height = 1; + light_crparams.onode_params.cr_window = a_win; + light_crparams.onode_params.cr_home_obj = NULL; + light_crparams.onode_params.cr_prev_obj = NULL; + light_crparams.onode_params.cr_parent_obj = NULL; + light_crparams.onode_params.cr_helpstring = NULL; light_crparams.appearance = 0; - light_crparams.flashfreq = 0; + light_crparams.flashfreq = 0; sprintf(light_crparams.label, "%s", a_name); light_crparams.label_x = 0; light_crparams.label_y = 0; newlightp = - gator_objects_create((struct onode_createparams *)(&light_crparams)); + gator_objects_create((struct onode_createparams *)(&light_crparams)); /* - * Return the news, happy or not. - */ - return(newlightp); + * Return the news, happy or not. + */ + return (newlightp); -} /*initLightObject*/ +} /*initLightObject */ @@ -426,28 +428,30 @@ initLightObject(a_name, a_x, a_y, a_width, a_win) * *------------------------------------------------------------------------*/ -int +int justify_light(a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc) - char *a_srcbuff; - char *a_dstbuff; - int a_dstwidth; - int a_justification; - int a_rightTrunc; + char *a_srcbuff; + char *a_dstbuff; + int a_dstwidth; + int a_justification; + int a_rightTrunc; -{ /*justify_light*/ +{ /*justify_light */ - static char rn[] = "justify_light"; /*Routine name*/ - int leftpad_chars; /*# of chars for left-padding*/ - int num_src_chars; /*# of chars in source*/ - int true_num_src_chars; /*# src chars before truncation*/ - int trunc_needed; /*Is truncation needed?*/ + static char rn[] = "justify_light"; /*Routine name */ + int leftpad_chars; /*# of chars for left-padding */ + int num_src_chars; /*# of chars in source */ + int true_num_src_chars; /*# src chars before truncation */ + int trunc_needed; /*Is truncation needed? */ /* the following debug statement floods the debug file */ #ifdef DEBUG_DETAILED if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_srcbuff= %s, a_dstbuff= %d, a_dstwidth= %d, a_justification= %d, a_rightTrunc= %d\n", - rn, a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc); + fprintf(debugFD, + "[ %s ] Called, a_srcbuff= %s, a_dstbuff= %d, a_dstwidth= %d, a_justification= %d, a_rightTrunc= %d\n", + rn, a_srcbuff, a_dstbuff, a_dstwidth, a_justification, + a_rightTrunc); fflush(debugFD); } #endif @@ -458,15 +462,15 @@ justify_light(a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc) * we automatically shorten up. */ if (a_dstwidth > GATOR_LABEL_CHARS) { - /* - if (afsmon_debug) { - fprintf(debugFD, - "[%s] Dest width (%d) > gtx buflen (%d), shrinking dest width\n", - rn, a_dstwidth, GATOR_LABEL_CHARS); - fflush(debugFD); - } - */ - a_dstwidth = GATOR_LABEL_CHARS; + /* + * if (afsmon_debug) { + * fprintf(debugFD, + * "[%s] Dest width (%d) > gtx buflen (%d), shrinking dest width\n", + * rn, a_dstwidth, GATOR_LABEL_CHARS); + * fflush(debugFD); + * } + */ + a_dstwidth = GATOR_LABEL_CHARS; } /* @@ -479,41 +483,40 @@ justify_light(a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc) leftpad_chars = 0; if (!a_rightTrunc) a_srcbuff += (true_num_src_chars - num_src_chars); - } - else { + } else { trunc_needed = 0; num_src_chars = true_num_src_chars; - + /* * Compute the necessary left-padding. */ switch (a_justification) { - - case RIGHT_JUSTIFY: + + case RIGHT_JUSTIFY: leftpad_chars = (a_dstwidth - 1) - num_src_chars; break; - - case LEFT_JUSTIFY: + + case LEFT_JUSTIFY: /* * This is the really easy one. */ leftpad_chars = 0; break; - - case CENTER: + + case CENTER: leftpad_chars = ((a_dstwidth - 1) - num_src_chars) / 2; break; - - default: + + default: if (afsmon_debug) { - fprintf(debugFD, "[%s] Illegal justification command: %d", - rn, a_justification); - fprintf(debugFD, "[%s] Called with '%s', dest width=%d\n", - rn, a_srcbuff, a_dstwidth); - fflush(debugFD); + fprintf(debugFD, "[%s] Illegal justification command: %d", rn, + a_justification); + fprintf(debugFD, "[%s] Called with '%s', dest width=%d\n", rn, + a_srcbuff, a_dstwidth); + fflush(debugFD); } - return(-1); - } /*Switch on justification type*/ + return (-1); + } /*Switch on justification type */ } /* @@ -524,22 +527,23 @@ justify_light(a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc) * the src buffer appropriately. */ strncpy(a_dstbuff, blankline, a_dstwidth); - strncpy(a_dstbuff+leftpad_chars, a_srcbuff, num_src_chars); - *(a_dstbuff+a_dstwidth-1) = '\0'; + strncpy(a_dstbuff + leftpad_chars, a_srcbuff, num_src_chars); + *(a_dstbuff + a_dstwidth - 1) = '\0'; if (trunc_needed) { if (a_rightTrunc) - *(a_dstbuff+a_dstwidth-2) = '*'; /*Truncate on the right*/ + *(a_dstbuff + a_dstwidth - 2) = '*'; /*Truncate on the right */ else { - *a_dstbuff = '*'; /*Truncate on the left, non-disk*/ + *a_dstbuff = '*'; /*Truncate on the left, non-disk */ } - } /*Handle truncations*/ + } + /*Handle truncations */ /* * Return the good news. */ - return(0); + return (0); -} /*justify_light*/ +} /*justify_light */ @@ -558,11 +562,11 @@ afsmonExit_gtx() static char rn[] = "afsmonExit_gtx"; if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); } - afsmon_Exit(0); + afsmon_Exit(0); } @@ -583,303 +587,313 @@ afsmonExit_gtx() int ovw_refresh(a_pageNum, a_updateType) -int a_pageNum; /* page to refresh overview display */ -int a_updateType; /* OVW_UPDATE_FS = update fs column only, - OVW_UPDATE_CM = update cm column only, - OVW_UPDATE_BOTH = update fs & cm columns. Note that - we do not want to update a column until the - corresponding probe cycle has completed */ -{ /* ovw_refresh */ - - static char rn[] = "ovw_refresh"; /* routine name */ - struct onode **tmp_fsNames_o; /* ptr to fsNames onodes */ - struct gator_lightobj *tmp_lightobj; /* ptr for object's display data */ - struct fs_Display_Data *fsDataP; /* ptr to FS display data array */ - struct onode **tmp_cmNames_o; /* ptr to fsNames onodes */ - struct cm_Display_Data *cmDataP; /* ptr to CM display data array */ - int fsIdx; /* for counting # of CM hosts */ - int cmIdx; /* for counting # of CM hosts */ - int next_page = 0; /* is there a next ovw page ? */ - int prev_page = 0; /* is there a previous ovw page */ - char cmdLine[80]; /* buffer for command line */ - char printBuf[256]; /* buffer to print to screen */ - int i; - int code; - int len; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_pageNum= %d, a_updateType= %d\n", + int a_pageNum; /* page to refresh overview display */ + int a_updateType; /* OVW_UPDATE_FS = update fs column only, + * OVW_UPDATE_CM = update cm column only, + * OVW_UPDATE_BOTH = update fs & cm columns. Note that + * we do not want to update a column until the + * corresponding probe cycle has completed */ +{ /* ovw_refresh */ + + static char rn[] = "ovw_refresh"; /* routine name */ + struct onode **tmp_fsNames_o; /* ptr to fsNames onodes */ + struct gator_lightobj *tmp_lightobj; /* ptr for object's display data */ + struct fs_Display_Data *fsDataP; /* ptr to FS display data array */ + struct onode **tmp_cmNames_o; /* ptr to fsNames onodes */ + struct cm_Display_Data *cmDataP; /* ptr to CM display data array */ + int fsIdx; /* for counting # of CM hosts */ + int cmIdx; /* for counting # of CM hosts */ + int next_page = 0; /* is there a next ovw page ? */ + int prev_page = 0; /* is there a previous ovw page */ + char cmdLine[80]; /* buffer for command line */ + char printBuf[256]; /* buffer to print to screen */ + int i; + int code; + int len; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_pageNum= %d, a_updateType= %d\n", rn, a_pageNum, a_updateType); fflush(debugFD); - } + } + + /* if the data is not yet available ie., not one probe cycle has + * completed, do nothing */ - /* if the data is not yet available ie., not one probe cycle has - completed, do nothing */ + if ((a_updateType & OVW_UPDATE_FS) && !fs_Data_Available) + return (0); + if ((a_updateType & OVW_UPDATE_CM) && !cm_Data_Available) + return (0); - if ( (a_updateType & OVW_UPDATE_FS) && !fs_Data_Available) - return(0); - if ( (a_updateType & OVW_UPDATE_CM) && !cm_Data_Available) - return(0); - - /* validate page number */ - if (a_pageNum < 1 || a_pageNum > ovw_numPages) { - sprintf(errMsg,"[ %s ] called with incorrect page number %d\n", - rn,a_pageNum); + /* validate page number */ + if (a_pageNum < 1 || a_pageNum > ovw_numPages) { + sprintf(errMsg, "[ %s ] called with incorrect page number %d\n", rn, + a_pageNum); afsmon_Exit(235); - } + } - /* set the current page number */ - ovw_currPage = a_pageNum; + /* set the current page number */ + ovw_currPage = a_pageNum; - /* turn off init message */ - if (initMsg_on) { + /* turn off init message */ + if (initMsg_on) { initMsg_on = 0; gtxframe_RemoveFromList(ovwFrame, initMsg_o); - } - - /* update the labels */ - - /* version label */ - tmp_lightobj=(struct gator_lightobj *) ovw_progName_o->o_data; - sprintf(printBuf,"AFSMonitor [Version %s]",afsmon_version); - justify_light(printBuf,tmp_lightobj->label,strlen(printBuf)+1, - LEFT_JUSTIFY,1); - gator_light_set(ovw_progName_o,1); - - /* page number label */ - tmp_lightobj=(struct gator_lightobj *) ovw_pageNum_o->o_data; - sprintf(printBuf,"[System Overview, p. %d of %d]",ovw_currPage,ovw_numPages); - justify_light(printBuf,tmp_lightobj->label, OVW_PAGENUM_O_WIDTH, - RIGHT_JUSTIFY,1); - gator_light_set(ovw_pageNum_o,1); - - /* file servers monitored label */ - tmp_lightobj=(struct gator_lightobj *) ovw_numFS_o->o_data; - sprintf(printBuf," %d File Servers monitored",numFS); - justify_light(printBuf,tmp_lightobj->label, strlen(printBuf)+1, - LEFT_JUSTIFY,1); - - /* cache managers monitored label */ - tmp_lightobj=(struct gator_lightobj *) ovw_numCM_o->o_data; - sprintf(printBuf," %d Cache Managers monitored",numCM); - justify_light(printBuf,tmp_lightobj->label, strlen(printBuf)+1, - LEFT_JUSTIFY,1); - - - /* no. of fs alerts label */ - tmp_lightobj=(struct gator_lightobj *) ovw_FSalerts_o->o_data; - sprintf(printBuf," %d alerts on %d machines", - num_fs_alerts,numHosts_onfs_alerts); - justify_light(printBuf,tmp_lightobj->label, strlen(printBuf)+1, - LEFT_JUSTIFY,1); - - /* no. of cm alerts label */ - tmp_lightobj=(struct gator_lightobj *) ovw_CMalerts_o->o_data; - sprintf(printBuf," %d alerts on %d machines", - num_cm_alerts,numHosts_oncm_alerts); - justify_light(printBuf,tmp_lightobj->label, strlen(printBuf)+1, - LEFT_JUSTIFY,1); - - /* command line */ - /* determine if we have fs/cm, more/previous pages of data to display */ - - ovw_pageType = 0; - if (numFS && fs_Data_Available) - ovw_pageType |= CMD_FS; /* we have an fs frame & data avail. */ - if (numCM && cm_Data_Available) - ovw_pageType |= CMD_CM; /* we have a cm frame & data avail. */ - if (ovw_currPage > 1) + } + + /* update the labels */ + + /* version label */ + tmp_lightobj = (struct gator_lightobj *)ovw_progName_o->o_data; + sprintf(printBuf, "AFSMonitor [Version %s]", afsmon_version); + justify_light(printBuf, tmp_lightobj->label, strlen(printBuf) + 1, + LEFT_JUSTIFY, 1); + gator_light_set(ovw_progName_o, 1); + + /* page number label */ + tmp_lightobj = (struct gator_lightobj *)ovw_pageNum_o->o_data; + sprintf(printBuf, "[System Overview, p. %d of %d]", ovw_currPage, + ovw_numPages); + justify_light(printBuf, tmp_lightobj->label, OVW_PAGENUM_O_WIDTH, + RIGHT_JUSTIFY, 1); + gator_light_set(ovw_pageNum_o, 1); + + /* file servers monitored label */ + tmp_lightobj = (struct gator_lightobj *)ovw_numFS_o->o_data; + sprintf(printBuf, " %d File Servers monitored", numFS); + justify_light(printBuf, tmp_lightobj->label, strlen(printBuf) + 1, + LEFT_JUSTIFY, 1); + + /* cache managers monitored label */ + tmp_lightobj = (struct gator_lightobj *)ovw_numCM_o->o_data; + sprintf(printBuf, " %d Cache Managers monitored", numCM); + justify_light(printBuf, tmp_lightobj->label, strlen(printBuf) + 1, + LEFT_JUSTIFY, 1); + + + /* no. of fs alerts label */ + tmp_lightobj = (struct gator_lightobj *)ovw_FSalerts_o->o_data; + sprintf(printBuf, " %d alerts on %d machines", num_fs_alerts, + numHosts_onfs_alerts); + justify_light(printBuf, tmp_lightobj->label, strlen(printBuf) + 1, + LEFT_JUSTIFY, 1); + + /* no. of cm alerts label */ + tmp_lightobj = (struct gator_lightobj *)ovw_CMalerts_o->o_data; + sprintf(printBuf, " %d alerts on %d machines", num_cm_alerts, + numHosts_oncm_alerts); + justify_light(printBuf, tmp_lightobj->label, strlen(printBuf) + 1, + LEFT_JUSTIFY, 1); + + /* command line */ + /* determine if we have fs/cm, more/previous pages of data to display */ + + ovw_pageType = 0; + if (numFS && fs_Data_Available) + ovw_pageType |= CMD_FS; /* we have an fs frame & data avail. */ + if (numCM && cm_Data_Available) + ovw_pageType |= CMD_CM; /* we have a cm frame & data avail. */ + if (ovw_currPage > 1) ovw_pageType |= CMD_PREV; /* got a previous page */ - if (ovw_currPage < ovw_numPages) + if (ovw_currPage < ovw_numPages) ovw_pageType |= CMD_NEXT; /* got a next page */ - strcpy(cmdLine,"Command ["); - if ( (ovw_pageType & CMD_FS) && (ovw_pageType & CMD_CM) ) - strcat(cmdLine,"fs, cm"); - else if (ovw_pageType & CMD_FS) - strcat(cmdLine,"fs"); - else if (ovw_pageType & CMD_CM) - strcat(cmdLine,"cm"); - - if (ovw_pageType & CMD_PREV) - strcat(cmdLine,", prev"); - if (ovw_pageType & CMD_NEXT) - strcat(cmdLine,", next"); - - strcat(cmdLine,"]? "); - - - - - /* display the command line */ - tmp_lightobj=(struct gator_lightobj *) ovw_cmd_o->o_data; - sprintf(printBuf,"%s", cmdLine); - justify_light(printBuf,tmp_lightobj->label, strlen(printBuf)+1, - LEFT_JUSTIFY,1); - gator_light_set(ovw_cmd_o, 1); - - /* display probe numbers line */ - tmp_lightobj=(struct gator_lightobj *) ovw_probeNum_o->o_data; - sprintf(printBuf,"[probes %d(fs) %d(cm), freq=%d sec]", - afsmon_fs_prev_probeNum, afsmon_cm_prev_probeNum,afsmon_probefreq); - justify_light(printBuf,tmp_lightobj->label, OVW_PROBENUM_O_WIDTH, - RIGHT_JUSTIFY,1); - gator_light_set(ovw_probeNum_o, 1); - - - - /* update the file server names column if we are asked to */ - - if (numFS && (a_updateType & OVW_UPDATE_FS)) { - - /* move to the right spot in the FS display data array */ - fsDataP = prev_fsData; - fsIdx = 0; - for(i=0; i < ((a_pageNum-1) * ovw_numHosts_perPage); i++) { - fsDataP++; - fsIdx++; - } - - /* get the address to the first FS name */ - tmp_fsNames_o = ovw_fsNames_o; + strcpy(cmdLine, "Command ["); + if ((ovw_pageType & CMD_FS) && (ovw_pageType & CMD_CM)) + strcat(cmdLine, "fs, cm"); + else if (ovw_pageType & CMD_FS) + strcat(cmdLine, "fs"); + else if (ovw_pageType & CMD_CM) + strcat(cmdLine, "cm"); + + if (ovw_pageType & CMD_PREV) + strcat(cmdLine, ", prev"); + if (ovw_pageType & CMD_NEXT) + strcat(cmdLine, ", next"); - for (i=0; i < ovw_numHosts_perPage; i++) { - if (fsIdx < numFS) { /* this could be the last & partial page */ + strcat(cmdLine, "]? "); + + + + + /* display the command line */ + tmp_lightobj = (struct gator_lightobj *)ovw_cmd_o->o_data; + sprintf(printBuf, "%s", cmdLine); + justify_light(printBuf, tmp_lightobj->label, strlen(printBuf) + 1, + LEFT_JUSTIFY, 1); + gator_light_set(ovw_cmd_o, 1); + + /* display probe numbers line */ + tmp_lightobj = (struct gator_lightobj *)ovw_probeNum_o->o_data; + sprintf(printBuf, "[probes %d(fs) %d(cm), freq=%d sec]", + afsmon_fs_prev_probeNum, afsmon_cm_prev_probeNum, + afsmon_probefreq); + justify_light(printBuf, tmp_lightobj->label, OVW_PROBENUM_O_WIDTH, + RIGHT_JUSTIFY, 1); + gator_light_set(ovw_probeNum_o, 1); + + + + /* update the file server names column if we are asked to */ + + if (numFS && (a_updateType & OVW_UPDATE_FS)) { + + /* move to the right spot in the FS display data array */ + fsDataP = prev_fsData; + fsIdx = 0; + for (i = 0; i < ((a_pageNum - 1) * ovw_numHosts_perPage); i++) { + fsDataP++; + fsIdx++; + } + + /* get the address to the first FS name */ + tmp_fsNames_o = ovw_fsNames_o; + + for (i = 0; i < ovw_numHosts_perPage; i++) { + if (fsIdx < numFS) { /* this could be the last & partial page */ if (fsDataP->hostName[0] == '\0') { - sprintf(errMsg,"[ %s ] empty fs display entry \n",rn); - afsmon_Exit(240); + sprintf(errMsg, "[ %s ] empty fs display entry \n", rn); + afsmon_Exit(240); } /* check if the probe succeeded. if it did check for thresholds - overflow. A failed probe is indicated by "PF" */ + * overflow. A failed probe is indicated by "PF" */ - if (! fsDataP->probeOK) { - sprintf(printBuf,"[ PF] %s", fsDataP->hostName); - } else if (fsDataP->ovfCount) /* thresholds overflow */ - sprintf(printBuf,"[%3d] %s", - fsDataP->ovfCount,fsDataP->hostName); + if (!fsDataP->probeOK) { + sprintf(printBuf, "[ PF] %s", fsDataP->hostName); + } else if (fsDataP->ovfCount) /* thresholds overflow */ + sprintf(printBuf, "[%3d] %s", fsDataP->ovfCount, + fsDataP->hostName); else { - sprintf(printBuf," %s",fsDataP->hostName); + sprintf(printBuf, " %s", fsDataP->hostName); } - if (afsmon_debug) - fprintf(debugFD,"[ %s ] to display %s\n",rn,printBuf); + if (afsmon_debug) + fprintf(debugFD, "[ %s ] to display %s\n", rn, printBuf); - tmp_lightobj=(struct gator_lightobj *) (*tmp_fsNames_o)->o_data; + tmp_lightobj = + (struct gator_lightobj *)(*tmp_fsNames_o)->o_data; - if (strlen(printBuf)+1 < OVW_HOSTNAME_O_WIDTH_HGL) - len = OVW_HOSTNAME_O_WIDTH_HGL; - else - len = strlen(printBuf)+1; + if (strlen(printBuf) + 1 < OVW_HOSTNAME_O_WIDTH_HGL) + len = OVW_HOSTNAME_O_WIDTH_HGL; + else + len = strlen(printBuf) + 1; - code = justify_light(printBuf,tmp_lightobj->label, - len, LEFT_JUSTIFY, 1); + code = + justify_light(printBuf, tmp_lightobj->label, len, + LEFT_JUSTIFY, 1); if (code) { - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] justify_code returned %d\n", - rn,code); - } + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] justify_code returned %d\n", + rn, code); + } } - + /* highlighten if overflowed or probe failed */ - if (fsDataP->ovfCount || ! fsDataP->probeOK) - code = gator_light_set(*tmp_fsNames_o,1); + if (fsDataP->ovfCount || !fsDataP->probeOK) + code = gator_light_set(*tmp_fsNames_o, 1); else - code = gator_light_set(*tmp_fsNames_o,0); + code = gator_light_set(*tmp_fsNames_o, 0); - } else { /* no more hosts, blank the rest of the entries */ - tmp_lightobj=(struct gator_lightobj *) (*tmp_fsNames_o)->o_data; - sprintf(tmp_lightobj->label,"%s",""); + } else { /* no more hosts, blank the rest of the entries */ + tmp_lightobj = + (struct gator_lightobj *)(*tmp_fsNames_o)->o_data; + sprintf(tmp_lightobj->label, "%s", ""); + } + + tmp_fsNames_o++; /* next onode */ + fsDataP++; /* next host's data */ + fsIdx++; /* host index */ } + } - tmp_fsNames_o++; /* next onode */ - fsDataP++; /* next host's data */ - fsIdx++; /* host index */ - } - } /* if numFS */ + /* if numFS */ + /* if we have any cache managers, update them if we are asked to */ + if (numCM && (a_updateType & OVW_UPDATE_CM)) { - /* if we have any cache managers, update them if we are asked to */ - if (numCM && (a_updateType & OVW_UPDATE_CM)){ + /* move to the right spot in the CM display data array */ + cmDataP = prev_cmData; + cmIdx = 0; + for (i = 0; i < ((a_pageNum - 1) * ovw_numHosts_perPage); i++) { + cmDataP++; + cmIdx++; + } - /* move to the right spot in the CM display data array */ - cmDataP = prev_cmData; - cmIdx = 0; - for(i=0; i < ((a_pageNum-1) * ovw_numHosts_perPage); i++) { - cmDataP++; - cmIdx++; - } - - /* get the address to the first CM name */ - tmp_cmNames_o = ovw_cmNames_o; + /* get the address to the first CM name */ + tmp_cmNames_o = ovw_cmNames_o; - for (i=0; i < ovw_numHosts_perPage; i++) { - if (cmIdx < numCM) { /* this could be the last & partial page */ + for (i = 0; i < ovw_numHosts_perPage; i++) { + if (cmIdx < numCM) { /* this could be the last & partial page */ if (cmDataP->hostName[0] == '\0') { - sprintf(errMsg,"[ %s ] empty cm display entry \n",rn); - afsmon_Exit(245); + sprintf(errMsg, "[ %s ] empty cm display entry \n", rn); + afsmon_Exit(245); } /* check if the probe succeeded. if it did check for thresholds - overflow. A failed probe is indicated by "PF" */ + * overflow. A failed probe is indicated by "PF" */ - if (! cmDataP->probeOK) { - sprintf(printBuf,"[ PF] %s", cmDataP->hostName); + if (!cmDataP->probeOK) { + sprintf(printBuf, "[ PF] %s", cmDataP->hostName); } else if (cmDataP->ovfCount) { /* thresholds overflow */ - sprintf(printBuf,"[%3d] %s", - cmDataP->ovfCount,cmDataP->hostName); - } else - sprintf(printBuf," %s",cmDataP->hostName); - + sprintf(printBuf, "[%3d] %s", cmDataP->ovfCount, + cmDataP->hostName); + } else + sprintf(printBuf, " %s", cmDataP->hostName); + if (afsmon_debug) - fprintf(debugFD,"[ %s ] to display %s\n",rn,printBuf); + fprintf(debugFD, "[ %s ] to display %s\n", rn, printBuf); - tmp_lightobj=(struct gator_lightobj *) (*tmp_cmNames_o)->o_data; + tmp_lightobj = + (struct gator_lightobj *)(*tmp_cmNames_o)->o_data; - if (strlen(printBuf)+1 < OVW_HOSTNAME_O_WIDTH_HGL) - len = OVW_HOSTNAME_O_WIDTH_HGL; - else - len = strlen(printBuf)+1; + if (strlen(printBuf) + 1 < OVW_HOSTNAME_O_WIDTH_HGL) + len = OVW_HOSTNAME_O_WIDTH_HGL; + else + len = strlen(printBuf) + 1; - code = justify_light(printBuf,tmp_lightobj->label, - len, LEFT_JUSTIFY, 1); + code = + justify_light(printBuf, tmp_lightobj->label, len, + LEFT_JUSTIFY, 1); if (code) { - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] justify_code returned %d\n", - rn,code); - } + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] justify_code returned %d\n", + rn, code); + } } /* highlighten if overflow or if probe failed */ - if (cmDataP->ovfCount || ! cmDataP->probeOK) - code = gator_light_set(*tmp_cmNames_o,1); - else - code = gator_light_set(*tmp_cmNames_o,0); + if (cmDataP->ovfCount || !cmDataP->probeOK) + code = gator_light_set(*tmp_cmNames_o, 1); + else + code = gator_light_set(*tmp_cmNames_o, 0); + + } else { /* no more hosts, blank the rest of the entries */ + tmp_lightobj = + (struct gator_lightobj *)(*tmp_cmNames_o)->o_data; + sprintf(tmp_lightobj->label, "%s", ""); + } - } else { /* no more hosts, blank the rest of the entries */ - tmp_lightobj=(struct gator_lightobj *) (*tmp_cmNames_o)->o_data; - sprintf(tmp_lightobj->label,"%s",""); + tmp_cmNames_o++; /* next onode */ + cmDataP++; /* next host's data */ + cmIdx++; /* host index */ } + } - tmp_cmNames_o++; /* next onode */ - cmDataP++; /* next host's data */ - cmIdx++; /* host index */ - } - } /* if numCM */ + /* if numCM */ + /* redraw the display if the overview screen is currently displayed */ + if (afsmon_win->w_frame == ovwFrame) + WOP_DISPLAY(afsmon_win); - /* redraw the display if the overview screen is currently displayed */ - if (afsmon_win->w_frame == ovwFrame) - WOP_DISPLAY(afsmon_win); + return (0); - return(0); +} /* ovw_refresh */ -} /* ovw_refresh */ - /*----------------------------------------------------------------------- @@ -891,17 +905,17 @@ int a_updateType; /* OVW_UPDATE_FS = update fs column only, int Switch_ovw_2_fs() { - static char rn[] = "Switch_ovw_2_fs"; + static char rn[] = "Switch_ovw_2_fs"; if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); } - /* bind the File Server frame to the window */ - if (ovw_pageType & CMD_FS) - gtxframe_SetFrame(afsmon_win,fsFrame); - return(0); + /* bind the File Server frame to the window */ + if (ovw_pageType & CMD_FS) + gtxframe_SetFrame(afsmon_win, fsFrame); + return (0); } /*----------------------------------------------------------------------- @@ -913,17 +927,17 @@ Switch_ovw_2_fs() int Switch_ovw_2_cm() { - static char rn[] = "Switch_ovw_2_cm"; + static char rn[] = "Switch_ovw_2_cm"; - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); - } + } - /* bind the Cache Managers frame to the window */ - if (ovw_pageType & CMD_CM) - gtxframe_SetFrame(afsmon_win,cmFrame); - return(0); + /* bind the Cache Managers frame to the window */ + if (ovw_pageType & CMD_CM) + gtxframe_SetFrame(afsmon_win, cmFrame); + return (0); } /*----------------------------------------------------------------------- @@ -935,19 +949,19 @@ Switch_ovw_2_cm() int Switch_ovw_next() { - static char rn[] = "Switch_ovw_next"; + static char rn[] = "Switch_ovw_next"; - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); - } + } - if (ovw_pageType & CMD_NEXT) { + if (ovw_pageType & CMD_NEXT) { /* call refresh with the next page number */ - ovw_refresh(ovw_currPage + 1,ovw_update_info); - } + ovw_refresh(ovw_currPage + 1, ovw_update_info); + } - return(0); + return (0); } /*----------------------------------------------------------------------- @@ -959,19 +973,19 @@ Switch_ovw_next() int Switch_ovw_last() { - static char rn[] = "Switch_ovw_last"; + static char rn[] = "Switch_ovw_last"; if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); } - if (ovw_pageType & CMD_NEXT) { + if (ovw_pageType & CMD_NEXT) { /* call refresh with the last page number */ ovw_refresh(ovw_numPages, ovw_update_info); - } + } - return(0); + return (0); } /*----------------------------------------------------------------------- @@ -983,18 +997,18 @@ Switch_ovw_last() int Switch_ovw_prev() { - static char rn[] = "Switch_ovw_prev"; + static char rn[] = "Switch_ovw_prev"; if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); } - if (ovw_pageType & CMD_PREV) { - /* call refresh with the previous page number */ - ovw_refresh(ovw_currPage - 1,ovw_update_info); - } - return(0); + if (ovw_pageType & CMD_PREV) { + /* call refresh with the previous page number */ + ovw_refresh(ovw_currPage - 1, ovw_update_info); + } + return (0); } /*----------------------------------------------------------------------- @@ -1006,18 +1020,18 @@ Switch_ovw_prev() int Switch_ovw_first() { - static char rn[] = "Switch_ovw_first"; + static char rn[] = "Switch_ovw_first"; if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); } - if (ovw_pageType & CMD_PREV) { - /* refresh with the first page number */ + if (ovw_pageType & CMD_PREV) { + /* refresh with the first page number */ ovw_refresh(1, ovw_update_info); - } - return(0); + } + return (0); } /*----------------------------------------------------------------------- @@ -1038,226 +1052,235 @@ Switch_ovw_first() int create_ovwFrame_objects() -{ /* create_ovwFrame_objects */ +{ /* create_ovwFrame_objects */ - static char rn[] = "create_ovwFrame_objects"; - int hostLines; /* number of lines of host names to display */ - struct onode **ovw_fsNames_o_Ptr; /* index to list of fs names onodes */ - struct onode **ovw_cmNames_o_Ptr; /* index to list of cm names onodes */ - int code; - int i; + static char rn[] = "create_ovwFrame_objects"; + int hostLines; /* number of lines of host names to display */ + struct onode **ovw_fsNames_o_Ptr; /* index to list of fs names onodes */ + struct onode **ovw_cmNames_o_Ptr; /* index to list of cm names onodes */ + int code; + int i; if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); } - /* get frame dimensions, it must be atleast 80x10 for any sensible output*/ - WOP_GETDIMENSIONS(ovwFrame->window,&frameDims); - maxX = frameDims.maxx; - maxY = frameDims.maxy; - if (maxX < MINX || maxY < MINY) { - sprintf(errMsg1,"[ %s ] Window size must be atleaset 80x12\n", - rn); - return(-1); - } - if (afsmon_debug) - fprintf(debugFD,"maxX = %d maxY = %d\n",maxX,maxY); - - - /* Print an Intial message to the screen. The init message is 36 chars - long */ - initMsg_o = initLightObject(initMsg, - maxX/2 - 18,maxY/3,sizeof(initMsg),afsmon_win); - if (initMsg_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create initMsg_o onode\n",rn); + /* get frame dimensions, it must be atleast MINXxMINY for any sensible output */ + WOP_GETDIMENSIONS(ovwFrame->window, &frameDims); + maxX = frameDims.maxx; + maxY = frameDims.maxy; + if (maxX + 1 < MINX || maxY + 1 < MINY) { + sprintf(errMsg1, "[ %s ] Window size %dx%d; must be at least %dx%d\n", + rn, maxX + 1, maxY + 1, MINX, MINY); + return (-1); + } + if (afsmon_debug) + fprintf(debugFD, "maxX = %d maxY = %d\n", maxX, maxY); + + + /* Print an Intial message to the screen. The init message is 36 chars + * long */ + initMsg_o = + initLightObject(initMsg, maxX / 2 - 18, maxY / 3, sizeof(initMsg), + afsmon_win); + if (initMsg_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create initMsg_o onode\n", rn); afsmon_Exit(250); - } - code = gtxframe_AddToList(ovwFrame,initMsg_o); - code = gator_light_set(initMsg_o,HIGHLIGHT); - initMsg_on = 1; + } + code = gtxframe_AddToList(ovwFrame, initMsg_o); + code = gator_light_set(initMsg_o, HIGHLIGHT); + initMsg_on = 1; - /* create the command line object */ + /* create the command line object */ - ovw_cmd_o = initLightObject("", - 0,maxY-1,OVW_CMD_O_WIDTH,afsmon_win); - if (ovw_cmd_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create command onode\n",rn); + ovw_cmd_o = initLightObject("", 0, maxY - 1, OVW_CMD_O_WIDTH, afsmon_win); + if (ovw_cmd_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create command onode\n", rn); afsmon_Exit(265); - } - code = gtxframe_AddToList(ovwFrame,ovw_cmd_o); - code = gator_light_set(ovw_cmd_o,HIGHLIGHT); + } + code = gtxframe_AddToList(ovwFrame, ovw_cmd_o); + code = gator_light_set(ovw_cmd_o, HIGHLIGHT); - /* create the program name object */ + /* create the program name object */ - ovw_progName_o = initLightObject("",0,0, - PROGNAME_O_WIDTH,afsmon_win); - if (ovw_progName_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create programName onode\n",rn); + ovw_progName_o = initLightObject("", 0, 0, PROGNAME_O_WIDTH, afsmon_win); + if (ovw_progName_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create programName onode\n", rn); afsmon_Exit(255); - } - code = gtxframe_AddToList(ovwFrame,ovw_progName_o); - code = gator_light_set(ovw_progName_o,HIGHLIGHT); + } + code = gtxframe_AddToList(ovwFrame, ovw_progName_o); + code = gator_light_set(ovw_progName_o, HIGHLIGHT); - /* create the page number object */ + /* create the page number object */ - ovw_pageNum_o = initLightObject("", - maxX-OVW_PAGENUM_O_WIDTH,0,OVW_PAGENUM_O_WIDTH,afsmon_win); - if (ovw_pageNum_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create pageNumber onode\n",rn); + ovw_pageNum_o = + initLightObject("", maxX - OVW_PAGENUM_O_WIDTH, 0, + OVW_PAGENUM_O_WIDTH, afsmon_win); + if (ovw_pageNum_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn); afsmon_Exit(260); - } - code = gtxframe_AddToList(ovwFrame,ovw_pageNum_o); - code = gator_light_set(ovw_pageNum_o,HIGHLIGHT); - - /* create the probe number object */ - ovw_probeNum_o = initLightObject("", - maxX-OVW_PROBENUM_O_WIDTH,maxY-1,OVW_PROBENUM_O_WIDTH,afsmon_win); - if (ovw_probeNum_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create probe number onode\n",rn); + } + code = gtxframe_AddToList(ovwFrame, ovw_pageNum_o); + code = gator_light_set(ovw_pageNum_o, HIGHLIGHT); + + /* create the probe number object */ + ovw_probeNum_o = + initLightObject("", maxX - OVW_PROBENUM_O_WIDTH, maxY - 1, + OVW_PROBENUM_O_WIDTH, afsmon_win); + if (ovw_probeNum_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create probe number onode\n", rn); afsmon_Exit(270); - } - code = gtxframe_AddToList(ovwFrame,ovw_probeNum_o); - code = gator_light_set(ovw_probeNum_o,HIGHLIGHT); - - /* create the numFS monitored object */ - ovw_numFS_o = initLightObject("", - 0,2,FC_NUMHOSTS_O_WIDTH,afsmon_win); - if (ovw_numFS_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create numFS onode\n",rn); + } + code = gtxframe_AddToList(ovwFrame, ovw_probeNum_o); + code = gator_light_set(ovw_probeNum_o, HIGHLIGHT); + + /* create the numFS monitored object */ + ovw_numFS_o = initLightObject("", 0, 2, FC_NUMHOSTS_O_WIDTH, afsmon_win); + if (ovw_numFS_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create numFS onode\n", rn); afsmon_Exit(275); - } - code = gtxframe_AddToList(ovwFrame,ovw_numFS_o); - - /* create the numCM monitored object */ - ovw_numCM_o = initLightObject("", - maxX/2,2,OVW_NUMCM_O_WIDTH,afsmon_win); - if (ovw_numCM_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create numCM_o onode\n",rn); + } + code = gtxframe_AddToList(ovwFrame, ovw_numFS_o); + + /* create the numCM monitored object */ + ovw_numCM_o = + initLightObject("", maxX / 2, 2, OVW_NUMCM_O_WIDTH, afsmon_win); + if (ovw_numCM_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create numCM_o onode\n", rn); afsmon_Exit(280); - } - code = gtxframe_AddToList(ovwFrame,ovw_numCM_o); - - /* create the number-of-FS-alerts object */ - ovw_FSalerts_o = initLightObject("", - 0,3,OVW_FSALERTS_O_WIDTH,afsmon_win); - if (ovw_FSalerts_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create FSalerts_o onode\n",rn); + } + code = gtxframe_AddToList(ovwFrame, ovw_numCM_o); + + /* create the number-of-FS-alerts object */ + ovw_FSalerts_o = + initLightObject("", 0, 3, OVW_FSALERTS_O_WIDTH, afsmon_win); + if (ovw_FSalerts_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create FSalerts_o onode\n", rn); afsmon_Exit(285); - } - code = gtxframe_AddToList(ovwFrame,ovw_FSalerts_o); - - /* create the number-of-CM-alerts object */ - ovw_CMalerts_o = initLightObject("", - maxX/2,3,OVW_CMALERTS_O_WIDTH,afsmon_win); - if (ovw_CMalerts_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create CMalerts_o onode\n",rn); + } + code = gtxframe_AddToList(ovwFrame, ovw_FSalerts_o); + + /* create the number-of-CM-alerts object */ + ovw_CMalerts_o = + initLightObject("", maxX / 2, 3, OVW_CMALERTS_O_WIDTH, afsmon_win); + if (ovw_CMalerts_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create CMalerts_o onode\n", rn); afsmon_Exit(290); - } - code = gtxframe_AddToList(ovwFrame,ovw_CMalerts_o); + } + code = gtxframe_AddToList(ovwFrame, ovw_CMalerts_o); - /* create file-server-name and cache-manager-names objects */ - ovw_numHosts_perPage = maxY - OVW_NUM_FIXED_LINES; + /* create file-server-name and cache-manager-names objects */ + ovw_numHosts_perPage = maxY - OVW_NUM_FIXED_LINES; - /* allocate memory for a list of onode pointers for file server names */ - ovw_fsNames_o = (struct onode **) malloc( - sizeof(struct onode *) * ovw_numHosts_perPage); - if (ovw_fsNames_o == (struct onode **)0) { - sprintf(errMsg,"[ %s ] Failed to allocate memory for FS onodes\n",rn); + /* allocate memory for a list of onode pointers for file server names */ + ovw_fsNames_o = + (struct onode **)malloc(sizeof(struct onode *) * + ovw_numHosts_perPage); + if (ovw_fsNames_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to allocate memory for FS onodes\n", + rn); afsmon_Exit(295); - } - - /* create file server name objects */ - ovw_fsNames_o_Ptr = ovw_fsNames_o; - for (i=0; i< ovw_numHosts_perPage; i++) { - *ovw_fsNames_o_Ptr = initLightObject("", - 0,OVW_FIRST_HOST_ROW+i,OVW_HOSTNAME_O_WIDTH,afsmon_win); - if (*ovw_fsNames_o_Ptr == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create an FS name onode\n",rn); - afsmon_Exit(300); - } - /* - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] fsName_o %d: %d\n", - rn,i,*ovw_fsNames_o_Ptr); - fflush(debugFD); + } + + /* create file server name objects */ + ovw_fsNames_o_Ptr = ovw_fsNames_o; + for (i = 0; i < ovw_numHosts_perPage; i++) { + *ovw_fsNames_o_Ptr = + initLightObject("", 0, OVW_FIRST_HOST_ROW + i, + OVW_HOSTNAME_O_WIDTH, afsmon_win); + if (*ovw_fsNames_o_Ptr == NULL) { + sprintf(errMsg, "[ %s ] Failed to create an FS name onode\n", rn); + afsmon_Exit(300); } - */ - code = gtxframe_AddToList(ovwFrame,*ovw_fsNames_o_Ptr); + /* + * if (afsmon_debug) { + * fprintf(debugFD,"[ %s ] fsName_o %d: %d\n", + * rn,i,*ovw_fsNames_o_Ptr); + * fflush(debugFD); + * } + */ + code = gtxframe_AddToList(ovwFrame, *ovw_fsNames_o_Ptr); ovw_fsNames_o_Ptr++; - } - - - /* allocate memory for a list of onode pointers for cache manager names */ - ovw_cmNames_o = (struct onode **) malloc( - sizeof(struct onode *) * ovw_numHosts_perPage); - if (ovw_cmNames_o == (struct onode **)0) { - sprintf(errMsg,"[ %s ] Failed to allocate memory for CM onodes\n",rn); + } + + + /* allocate memory for a list of onode pointers for cache manager names */ + ovw_cmNames_o = + (struct onode **)malloc(sizeof(struct onode *) * + ovw_numHosts_perPage); + if (ovw_cmNames_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to allocate memory for CM onodes\n", + rn); afsmon_Exit(305); - } - - /* create cache manager name objects */ - ovw_cmNames_o_Ptr = ovw_cmNames_o; - for (i=0; i< ovw_numHosts_perPage; i++) { - *ovw_cmNames_o_Ptr = initLightObject("", - maxX/2,OVW_FIRST_HOST_ROW+i,OVW_HOSTNAME_O_WIDTH,afsmon_win); - if (*ovw_cmNames_o_Ptr == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create a CM name onode\n",rn); - afsmon_Exit(310); - } - code = gtxframe_AddToList(ovwFrame,*ovw_cmNames_o_Ptr); + } + + /* create cache manager name objects */ + ovw_cmNames_o_Ptr = ovw_cmNames_o; + for (i = 0; i < ovw_numHosts_perPage; i++) { + *ovw_cmNames_o_Ptr = + initLightObject("", maxX / 2, OVW_FIRST_HOST_ROW + i, + OVW_HOSTNAME_O_WIDTH, afsmon_win); + if (*ovw_cmNames_o_Ptr == NULL) { + sprintf(errMsg, "[ %s ] Failed to create a CM name onode\n", rn); + afsmon_Exit(310); + } + code = gtxframe_AddToList(ovwFrame, *ovw_cmNames_o_Ptr); ovw_cmNames_o_Ptr++; - } + } - /* Calculate the number of pages of overview data to display */ - /* host information starts at the 6th line from top and stops at 3rd - line from bottom of screen */ + /* Calculate the number of pages of overview data to display */ + /* host information starts at the 6th line from top and stops at 3rd + * line from bottom of screen */ - if (numFS > numCM) hostLines = numFS; - else hostLines = numCM; + if (numFS > numCM) + hostLines = numFS; + else + hostLines = numCM; - ovw_numPages = hostLines / (maxY - OVW_NUM_FIXED_LINES); - if ( hostLines % (maxY - OVW_NUM_FIXED_LINES) ) + ovw_numPages = hostLines / (maxY - OVW_NUM_FIXED_LINES); + if (hostLines % (maxY - OVW_NUM_FIXED_LINES)) ovw_numPages++; - - if (afsmon_debug) - fprintf(debugFD,"[ %s ] number of ovw pages = %d\n",rn,ovw_numPages); - - /* When the ovw_refresh() routine is called by the keyboard handlers the - following variable is used to determine if fs/cm/fs&cm info must be - updated */ - ovw_update_info = 0; - if (numFS) - ovw_update_info |= OVW_UPDATE_FS; - if (numCM) - ovw_update_info |= OVW_UPDATE_CM; - - /* bind the overview frame to a keyboard input handler */ - - /* bind Q and  to exit */ - keymap_BindToString(ovwFrame->keymap,"Q",afsmonExit_gtx,(char *)0,(char *)0); - keymap_BindToString(ovwFrame->keymap,"",afsmonExit_gtx,(char *)0,(char *)0); - - /* f -> switch of fs frame */ - keymap_BindToString(ovwFrame->keymap,"f",Switch_ovw_2_fs,(char *)0,(char *)0); - /* c -> switch of cm frame */ - keymap_BindToString(ovwFrame->keymap,"c",Switch_ovw_2_cm,(char *)0,(char *)0); - /* n -> switch to next overview page */ - keymap_BindToString(ovwFrame->keymap,"n",Switch_ovw_next,(char *)0,(char *)0); - /* N -> switch to last overview page */ - keymap_BindToString(ovwFrame->keymap,"N",Switch_ovw_last,(char *)0,(char *)0); - /* p -> switch to previous overview page */ - keymap_BindToString(ovwFrame->keymap,"p",Switch_ovw_prev,(char *)0,(char *)0); - /* P -> switch to first overview page */ - keymap_BindToString(ovwFrame->keymap,"P",Switch_ovw_first,(char *)0,(char *)0); - - - return(0); -} /* create_ovwFrame_objects */ + + if (afsmon_debug) + fprintf(debugFD, "[ %s ] number of ovw pages = %d\n", rn, + ovw_numPages); + + /* When the ovw_refresh() routine is called by the keyboard handlers the + * following variable is used to determine if fs/cm/fs&cm info must be + * updated */ + ovw_update_info = 0; + if (numFS) + ovw_update_info |= OVW_UPDATE_FS; + if (numCM) + ovw_update_info |= OVW_UPDATE_CM; + + /* bind the overview frame to a keyboard input handler */ + + /* bind Q and  to exit */ + keymap_BindToString(ovwFrame->keymap, "Q", afsmonExit_gtx, NULL, NULL); + keymap_BindToString(ovwFrame->keymap, "", afsmonExit_gtx, NULL, NULL); + + /* f -> switch of fs frame */ + keymap_BindToString(ovwFrame->keymap, "f", Switch_ovw_2_fs, NULL, NULL); + /* c -> switch of cm frame */ + keymap_BindToString(ovwFrame->keymap, "c", Switch_ovw_2_cm, NULL, NULL); + /* n -> switch to next overview page */ + keymap_BindToString(ovwFrame->keymap, "n", Switch_ovw_next, NULL, NULL); + /* N -> switch to last overview page */ + keymap_BindToString(ovwFrame->keymap, "N", Switch_ovw_last, NULL, NULL); + /* p -> switch to previous overview page */ + keymap_BindToString(ovwFrame->keymap, "p", Switch_ovw_prev, NULL, NULL); + /* P -> switch to first overview page */ + keymap_BindToString(ovwFrame->keymap, "P", Switch_ovw_first, NULL, NULL); + + + return (0); +} /* create_ovwFrame_objects */ /*----------------------------------------------------------------------- @@ -1276,77 +1299,80 @@ create_ovwFrame_objects() *----------------------------------------------------------------------*/ int -resolve_CmdLine(a_buffer, a_currFrame, a_currPage, a_numPages, - a_numCols, a_curr_LCol, a_cols_perPage, a_Data_Available) -char *a_buffer; /* buffer to copy command line */ -int a_currFrame; /* current frame ovw, fs or cm? */ -int a_currPage; /* current page number */ -int a_numPages; /* number of pages of data */ -int a_numCols; /* number of columns of data to display */ -int a_curr_LCol; /* current number of leftmost column */ -int a_cols_perPage; /* number of columns per page */ - -{ /* resolve_CmdLine */ - static char rn[] = "resolve_CmdLine"; - int pageType; +resolve_CmdLine(a_buffer, a_currFrame, a_currPage, a_numPages, a_numCols, + a_curr_LCol, a_cols_perPage, a_Data_Available) + char *a_buffer; /* buffer to copy command line */ + int a_currFrame; /* current frame ovw, fs or cm? */ + int a_currPage; /* current page number */ + int a_numPages; /* number of pages of data */ + int a_numCols; /* number of columns of data to display */ + int a_curr_LCol; /* current number of leftmost column */ + int a_cols_perPage; /* number of columns per page */ + +{ /* resolve_CmdLine */ + static char rn[] = "resolve_CmdLine"; + int pageType; if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_buffer= %d, a_currFrame= %d, a_currPage= %d, a_numPages= %d, a_numCols= %d, a_curr_LCol= %d, a_cols_perPage= %d\n", - rn, a_buffer, a_currFrame, a_currPage, a_numPages, a_numCols, - a_curr_LCol, a_cols_perPage); + fprintf(debugFD, + "[ %s ] Called, a_buffer= %d, a_currFrame= %d, a_currPage= %d, a_numPages= %d, a_numCols= %d, a_curr_LCol= %d, a_cols_perPage= %d\n", + rn, a_buffer, a_currFrame, a_currPage, a_numPages, a_numCols, + a_curr_LCol, a_cols_perPage); fflush(debugFD); } - pageType = 0; - - /* determine if we have fs/cm frames. If we do, note that we should not - let the user seen the initial junk we have there until the probe - results are available */ - if (a_currFrame == 1) { /* in the fs frame */ - if (numCM && cm_Data_Available) pageType |= CMD_CM; - } else if (a_currFrame == 2) { /* in the cm frame */ - if (numFS && fs_Data_Available) pageType |= CMD_FS; - } else { + pageType = 0; + + /* determine if we have fs/cm frames. If we do, note that we should not + * let the user seen the initial junk we have there until the probe + * results are available */ + if (a_currFrame == 1) { /* in the fs frame */ + if (numCM && cm_Data_Available) + pageType |= CMD_CM; + } else if (a_currFrame == 2) { /* in the cm frame */ + if (numFS && fs_Data_Available) + pageType |= CMD_FS; + } else { if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Wrong frame type %d\n",rn,a_currFrame); - fflush(debugFD); + fprintf(debugFD, "[ %s ] Wrong frame type %d\n", rn, a_currFrame); + fflush(debugFD); } - return(-1); - } + return (-1); + } - /* do we have next/previous pages */ - if ( a_currPage < a_numPages ) + /* do we have next/previous pages */ + if (a_currPage < a_numPages) pageType |= CMD_NEXT; /* have a next page */ - if ( a_currPage > 1 ) + if (a_currPage > 1) pageType |= CMD_PREV; /* have a previous page */ - - if ( a_numCols > a_cols_perPage ) { - if ( a_curr_LCol > 0 ) - pageType |= CMD_LEFT; /* have columns on left */ - if ( (a_curr_LCol + a_cols_perPage ) < a_numCols ) - pageType |= CMD_RIGHT; /* have columns on right */ - } - - /* now build the command line */ - - strcpy(a_buffer,"Command [oview"); - if ( pageType & CMD_FS) - strcat(a_buffer,", fs"); - if ( pageType & CMD_CM) - strcat(a_buffer,", cm"); - if ( pageType & CMD_PREV ) - strcat(a_buffer,", prev"); - if ( pageType & CMD_NEXT ) - strcat(a_buffer,", next"); - if ( pageType & CMD_LEFT ) - strcat(a_buffer,", left"); - if ( pageType & CMD_RIGHT ) - strcat(a_buffer,", right"); - strcat(a_buffer,"]? "); - - return(pageType); - -} /* resolve_CmdLine */ + + if (a_numCols > a_cols_perPage) { + if (a_curr_LCol > 0) + pageType |= CMD_LEFT; /* have columns on left */ + if ((a_curr_LCol + a_cols_perPage) < a_numCols) + pageType |= CMD_RIGHT; /* have columns on right */ + } + + /* now build the command line */ + + strcpy(a_buffer, "Command [oview"); + if (pageType & CMD_FS) + strcat(a_buffer, ", fs"); + if (pageType & CMD_CM) + strcat(a_buffer, ", cm"); + if (pageType & CMD_PREV) + strcat(a_buffer, ", prev"); + if (pageType & CMD_NEXT) + strcat(a_buffer, ", next"); + if (pageType & CMD_LEFT) + strcat(a_buffer, ", left"); + if (pageType & CMD_RIGHT) + strcat(a_buffer, ", right"); + strcat(a_buffer, "]? "); + + return (pageType); + +} /* resolve_CmdLine */ /*----------------------------------------------------------------------- * display_Server_datum() @@ -1365,96 +1391,101 @@ int a_cols_perPage; /* number of columns per page */ * 0 always *----------------------------------------------------------------------*/ int -display_Server_datum(a_srcBuf, a_firstObj_o, a_secondObj_o, - a_probeOK, a_just, a_highlight) +display_Server_datum(a_srcBuf, a_firstObj_o, a_secondObj_o, a_probeOK, a_just, + a_highlight) -char *a_srcBuf; /* source buffer */ -struct onode *a_firstObj_o; /* first object */ -struct onode *a_secondObj_o; /* second object */ -int a_probeOK; /* probe OK ? */ -int a_just; /* justification */ -int a_highlight; /* highlight object ? */ + char *a_srcBuf; /* source buffer */ + struct onode *a_firstObj_o; /* first object */ + struct onode *a_secondObj_o; /* second object */ + int a_probeOK; /* probe OK ? */ + int a_just; /* justification */ + int a_highlight; /* highlight object ? */ -{ /* display_Server_datum */ +{ /* display_Server_datum */ static char rn[] = "display_Server_datum"; struct gator_lightobj *tmp_lightobj1; struct gator_lightobj *tmp_lightobj2; - char part1[FC_COLUMN_WIDTH+2]; - char part2[FC_COLUMN_WIDTH+2]; + char part1[FC_COLUMN_WIDTH + 2]; + char part2[FC_COLUMN_WIDTH + 2]; int code; if (afsmon_debug) { if (a_highlight) - fprintf(debugFD,"[ %s ] Called, a_srcBuf= %s, a_firstObj_o= %d, a_secondObj_o= %d, a_probeOK= %d, a_just= %d, a_highlight= %d\n", rn, - a_srcBuf, a_firstObj_o, a_secondObj_o, a_probeOK, a_just, a_highlight); + fprintf(debugFD, + "[ %s ] Called, a_srcBuf= %s, a_firstObj_o= %d, a_secondObj_o= %d, a_probeOK= %d, a_just= %d, a_highlight= %d\n", + rn, a_srcBuf, a_firstObj_o, a_secondObj_o, a_probeOK, + a_just, a_highlight); fflush(debugFD); } - tmp_lightobj1 = (struct gator_lightobj *) a_firstObj_o->o_data; - tmp_lightobj2 = (struct gator_lightobj *) a_secondObj_o->o_data; + tmp_lightobj1 = (struct gator_lightobj *)a_firstObj_o->o_data; + tmp_lightobj2 = (struct gator_lightobj *)a_secondObj_o->o_data; - if (a_probeOK) { /* probe is ok so fill in the data */ + if (a_probeOK) { /* probe is ok so fill in the data */ /* check if it would fit in one object */ if (strlen(a_srcBuf) < FC_COLUMN_WIDTH) { - strcpy(part1, a_srcBuf ); - strcpy(part2, ""); + strcpy(part1, a_srcBuf); + strcpy(part2, ""); } else { - /* break up the src string into 2 parts */ - /* note that column width includes terminator */ - strncpy(part1, a_srcBuf, FC_COLUMN_WIDTH-1); - part1[FC_COLUMN_WIDTH-1] = '\0'; - strncpy(part2, a_srcBuf+FC_COLUMN_WIDTH-1, FC_COLUMN_WIDTH-1); + /* break up the src string into 2 parts */ + /* note that column width includes terminator */ + strncpy(part1, a_srcBuf, FC_COLUMN_WIDTH - 1); + part1[FC_COLUMN_WIDTH - 1] = '\0'; + strncpy(part2, a_srcBuf + FC_COLUMN_WIDTH - 1, + FC_COLUMN_WIDTH - 1); } - } else { /* probe failed, enter "--"s */ - strcpy(part1,"--"); - strcpy(part2,""); - } + } else { /* probe failed, enter "--"s */ + strcpy(part1, "--"); + strcpy(part2, ""); + } - /* if (afsmon_debug) { - fprintf(debugFD,"[ %s ] %s split to %s & %s\n",rn,a_srcBuf,part1,part2); - fflush(debugFD); - } */ + /* if (afsmon_debug) { + * fprintf(debugFD,"[ %s ] %s split to %s & %s\n",rn,a_srcBuf,part1,part2); + * fflush(debugFD); + * } */ - /* initialize both the objects */ + /* initialize both the objects */ - code = justify_light(part1, tmp_lightobj1->label, - FC_COLUMN_WIDTH, a_just, 1); - if (code) { + code = + justify_light(part1, tmp_lightobj1->label, FC_COLUMN_WIDTH, a_just, + 1); + if (code) { if (afsmon_debug) { - fprintf(debugFD,"[ %s ] justify_light failed 1 \n",rn); - fflush(debugFD); + fprintf(debugFD, "[ %s ] justify_light failed 1 \n", rn); + fflush(debugFD); } - } + } - code = justify_light(part2, tmp_lightobj2->label, - FC_COLUMN_WIDTH, a_just, 1); - if (code) { + code = + justify_light(part2, tmp_lightobj2->label, FC_COLUMN_WIDTH, a_just, + 1); + if (code) { if (afsmon_debug) { - fprintf(debugFD,"[ %s ] justify_light failed 1 \n",rn); - fflush(debugFD); + fprintf(debugFD, "[ %s ] justify_light failed 1 \n", rn); + fflush(debugFD); } - } + } - /* highlight them */ - if (a_highlight && (part1[0] != '-')) + /* highlight them */ + if (a_highlight && (part1[0] != '-')) gator_light_set(a_firstObj_o, 1); - else + else gator_light_set(a_firstObj_o, 0); - if (a_highlight && (part2[0] != '\0')) + if (a_highlight && (part2[0] != '\0')) gator_light_set(a_secondObj_o, 1); - else + else gator_light_set(a_secondObj_o, 0); - - return(0); -} /* display_Server_datum */ + return (0); + +} /* display_Server_datum */ /*----------------------------------------------------------------------- @@ -1471,83 +1502,87 @@ int a_highlight; /* highlight object ? */ int display_Server_label(a_srcBuf, a_firstObj_o, a_secondObj_o, a_thirdObj_o) -char *a_srcBuf; -struct onode *a_firstObj_o; /* first object */ -struct onode *a_secondObj_o; /* second object */ -struct onode *a_thirdObj_o; /* third object */ - -{ /* display_Server_label */ - - static char rn[] = "display_Server_label"; - char part[3][20]; /* buffer for three parts of label */ - char *strPtr; - struct gator_lightobj *tmp_lightobj; - struct onode *objPtr_o[3]; - int code; - int strLen; - int len; - int i; - int j; + char *a_srcBuf; + struct onode *a_firstObj_o; /* first object */ + struct onode *a_secondObj_o; /* second object */ + struct onode *a_thirdObj_o; /* third object */ + +{ /* display_Server_label */ + + static char rn[] = "display_Server_label"; + char part[3][20]; /* buffer for three parts of label */ + char *strPtr; + struct gator_lightobj *tmp_lightobj; + struct onode *objPtr_o[3]; + int code; + int strLen; + int len; + int i; + int j; /* the following debug statement floods the debug file */ #ifdef DEBUG_DETAILED if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_srcBuf= %s, a_firstObj_o= %d, a_secondObj_o= %d, a_thirdObj_o= %d\n", - rn, a_srcBuf, a_firstObj_o, a_secondObj_o, a_thirdObj_o); + fprintf(debugFD, + "[ %s ] Called, a_srcBuf= %s, a_firstObj_o= %d, a_secondObj_o= %d, a_thirdObj_o= %d\n", + rn, a_srcBuf, a_firstObj_o, a_secondObj_o, a_thirdObj_o); fflush(debugFD); } #endif - /* break the label string into three parts */ + /* break the label string into three parts */ - part[0][0] = '\0'; part[1][0] = '\0'; part[2][0] = '\0'; - /* now for a dumb precaution */ + part[0][0] = '\0'; + part[1][0] = '\0'; + part[2][0] = '\0'; + /* now for a dumb precaution */ - strLen = strlen(a_srcBuf); - len = 0; - strPtr = a_srcBuf; - for(i=0; i < 3; i++) { + strLen = strlen(a_srcBuf); + len = 0; + strPtr = a_srcBuf; + for (i = 0; i < 3; i++) { j = 0; while (*strPtr != '\0' && (len++ <= strLen)) { - if (*strPtr == '/') { - strPtr++; - break; - } - else part[i][j] = *strPtr; + if (*strPtr == '/') { strPtr++; - j++; + break; + } else + part[i][j] = *strPtr; + strPtr++; + j++; } part[i][j] = '\0'; - } - - /* - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] LABELS %s -> %s %s %s\n", - rn, a_srcBuf, part[0], part[1], part[2]); - fflush(debugFD); - } - */ - - objPtr_o[0] = a_firstObj_o; - objPtr_o[1] = a_secondObj_o; - objPtr_o[2] = a_thirdObj_o; - - /* display each label justified CENTER */ - - for (i = 0; i < 3; i++) { - tmp_lightobj = (struct gator_lightobj *) objPtr_o[i]->o_data; - code = justify_light(part[i], tmp_lightobj->label, - FC_COLUMN_WIDTH, CENTER, 1); - if (code) { - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] justify_light %d failed \n",rn,i); + } + + /* + * if (afsmon_debug) { + * fprintf(debugFD,"[ %s ] LABELS %s -> %s %s %s\n", + * rn, a_srcBuf, part[0], part[1], part[2]); + * fflush(debugFD); + * } + */ + + objPtr_o[0] = a_firstObj_o; + objPtr_o[1] = a_secondObj_o; + objPtr_o[2] = a_thirdObj_o; + + /* display each label justified CENTER */ + + for (i = 0; i < 3; i++) { + tmp_lightobj = (struct gator_lightobj *)objPtr_o[i]->o_data; + code = + justify_light(part[i], tmp_lightobj->label, FC_COLUMN_WIDTH, + CENTER, 1); + if (code) { + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] justify_light %d failed \n", rn, i); fflush(debugFD); - } - } - } + } + } + } -} /* display_Server_label */ +} /* display_Server_label */ @@ -1572,312 +1607,313 @@ struct onode *a_thirdObj_o; /* third object */ int fs_refresh(a_pageNum, a_LcolNum) -int a_pageNum; /* page to display */ -int a_LcolNum; /* starting (leftmost) column number */ - -{ /* fs_refresh */ - - static char rn[] = "fs_refresh"; /* routine name */ - struct gator_lightobj *tmp_lightobj; /* ptr for object's display data */ - struct fs_Display_Data *fsDataP; /* ptr to FS display data array */ - struct ServerInfo_line *tmp_fs_lines_P; /* tmp ptr to fs_lines */ - struct onode **firstSlot_o_Ptr; /* ptr to first data slot of a datum */ - struct onode **secondSlot_o_Ptr; /* ptr to second data slot of a datum */ - struct onode **fsLabels_o_Ptr1; /* ptr to label row 0 */ - struct onode **fsLabels_o_Ptr2; /* ptr to label row 1 */ - struct onode **fsLabels_o_Ptr3; /* ptr to label row 2 */ - char cmdLine[80]; /* buffer for command line */ - char printBuf[256]; /* buffer to print to screen */ - int i; - int j; - int k; - int code; - int fsIdx; - int labelIdx; - int dataIndex; /* index to the data[] field of - struct fs_Display_Data */ - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called with row %d col %d \n", - rn, a_pageNum, a_LcolNum); + int a_pageNum; /* page to display */ + int a_LcolNum; /* starting (leftmost) column number */ + +{ /* fs_refresh */ + + static char rn[] = "fs_refresh"; /* routine name */ + struct gator_lightobj *tmp_lightobj; /* ptr for object's display data */ + struct fs_Display_Data *fsDataP; /* ptr to FS display data array */ + struct ServerInfo_line *tmp_fs_lines_P; /* tmp ptr to fs_lines */ + struct onode **firstSlot_o_Ptr; /* ptr to first data slot of a datum */ + struct onode **secondSlot_o_Ptr; /* ptr to second data slot of a datum */ + struct onode **fsLabels_o_Ptr1; /* ptr to label row 0 */ + struct onode **fsLabels_o_Ptr2; /* ptr to label row 1 */ + struct onode **fsLabels_o_Ptr3; /* ptr to label row 2 */ + char cmdLine[80]; /* buffer for command line */ + char printBuf[256]; /* buffer to print to screen */ + int i; + int j; + int k; + int code; + int fsIdx; + int labelIdx; + int dataIndex; /* index to the data[] field of + * struct fs_Display_Data */ + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called with row %d col %d \n", rn, a_pageNum, + a_LcolNum); fflush(debugFD); - } + } - /* if the data is not yet available, ie., not one probe cycle has - completed, do nothing */ + /* if the data is not yet available, ie., not one probe cycle has + * completed, do nothing */ - if (! fs_Data_Available) - return(0); + if (!fs_Data_Available) + return (0); - /* validate the page number & column number */ - if (a_pageNum < 1 || a_pageNum > fs_numPages) { + /* validate the page number & column number */ + if (a_pageNum < 1 || a_pageNum > fs_numPages) { if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called with wrong page # %d \n",rn, a_pageNum); - fflush(debugFD); + fprintf(debugFD, "[ %s ] Called with wrong page # %d \n", rn, + a_pageNum); + fflush(debugFD); } afsmon_Exit(315); - } - if (a_LcolNum < 0 || a_LcolNum > fs_numCols) { + } + if (a_LcolNum < 0 || a_LcolNum > fs_numCols) { if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called with wrong column #%d\n",rn, a_LcolNum); - fflush(debugFD); + fprintf(debugFD, "[ %s ] Called with wrong column #%d\n", rn, + a_LcolNum); + fflush(debugFD); } afsmon_Exit(320); - } - - - - /* update the fixed labels */ - - /* we reuse the ovw version lable and hence do not have to do anything - for it here */ - - /* page number label */ - tmp_lightobj=(struct gator_lightobj *) fs_pageNum_o->o_data; - sprintf(printBuf,"[File Servers, p. %d of %d, c. %d of %d]", - a_pageNum, fs_numPages, a_LcolNum +1, fs_numCols); - justify_light(printBuf,tmp_lightobj->label, FC_PAGENUM_O_WIDTH, - RIGHT_JUSTIFY,1); - gator_light_set(fs_pageNum_o,1); - - /* file servers monitored label */ - tmp_lightobj=(struct gator_lightobj *) fs_numFS_o->o_data; - sprintf(printBuf,"%d File Servers monitored, %d alerts on %d machines", - numFS, num_fs_alerts, numHosts_onfs_alerts); - justify_light(printBuf,tmp_lightobj->label, FC_NUMHOSTS_O_WIDTH, CENTER,1); - - - /* command line */ - - /* figure out what we need to show in the prompt & set the page type */ - /* the fs_pageType variable is in turn used by the keyboard handler - routines to call fs_refresh() with the correct parameters */ - - fs_pageType = resolve_CmdLine( cmdLine, 1 /* fs frame*/, a_pageNum, - fs_numPages, fs_numCols, a_LcolNum, fs_cols_perPage); - - /* display the command line */ - tmp_lightobj=(struct gator_lightobj *) fs_cmd_o->o_data; - sprintf(printBuf,"%s", cmdLine); - justify_light(printBuf,tmp_lightobj->label, strlen(printBuf)+1, - LEFT_JUSTIFY,1); - gator_light_set(fs_cmd_o, 1); - - /* update the probe number label */ - tmp_lightobj=(struct gator_lightobj *) fs_probeNum_o->o_data; - sprintf(printBuf,"[FS probes %d, freq=%d sec]", - afsmon_fs_prev_probeNum, afsmon_probefreq); - justify_light(printBuf,tmp_lightobj->label, FC_PROBENUM_O_WIDTH, - RIGHT_JUSTIFY,1); - gator_light_set(fs_probeNum_o, 1); - - /* update "columns on left" signal */ - tmp_lightobj=(struct gator_lightobj *) fs_leftArrows_o->o_data; - if (fs_pageType & CMD_LEFT) - strcpy(printBuf, "<<<"); - else - strcpy(printBuf,""); - justify_light(printBuf,tmp_lightobj->label, FC_ARROWS_O_WIDTH, - LEFT_JUSTIFY,1); - gator_light_set(fs_leftArrows_o, 0); - - /* update "columns on right" signal */ - tmp_lightobj=(struct gator_lightobj *) fs_rightArrows_o->o_data; - if (fs_pageType & CMD_RIGHT) - strcpy(printBuf, ">>>"); - else - strcpy(printBuf,""); - justify_light(printBuf,tmp_lightobj->label, FC_ARROWS_O_WIDTH, - RIGHT_JUSTIFY,1); - gator_light_set(fs_rightArrows_o, 0); - - - - /* UPDATE THE COLUMN LABELS */ - - /* the column index is also used to index the label arrays */ - labelIdx = a_LcolNum; - - /* get the pointers to the three arrays of label onodes */ - fsLabels_o_Ptr1 = fsLabels_o[0]; - fsLabels_o_Ptr2 = fsLabels_o[1]; - fsLabels_o_Ptr3 = fsLabels_o[2]; - - for(k=0; k < fs_cols_perPage; k++) { + } + + + + /* update the fixed labels */ + + /* we reuse the ovw version lable and hence do not have to do anything + * for it here */ + + /* page number label */ + tmp_lightobj = (struct gator_lightobj *)fs_pageNum_o->o_data; + sprintf(printBuf, "[File Servers, p. %d of %d, c. %d of %d]", a_pageNum, + fs_numPages, a_LcolNum + 1, fs_numCols); + justify_light(printBuf, tmp_lightobj->label, FC_PAGENUM_O_WIDTH, + RIGHT_JUSTIFY, 1); + gator_light_set(fs_pageNum_o, 1); + + /* file servers monitored label */ + tmp_lightobj = (struct gator_lightobj *)fs_numFS_o->o_data; + sprintf(printBuf, "%d File Servers monitored, %d alerts on %d machines", + numFS, num_fs_alerts, numHosts_onfs_alerts); + justify_light(printBuf, tmp_lightobj->label, FC_NUMHOSTS_O_WIDTH, CENTER, + 1); + + + /* command line */ + + /* figure out what we need to show in the prompt & set the page type */ + /* the fs_pageType variable is in turn used by the keyboard handler + * routines to call fs_refresh() with the correct parameters */ + + fs_pageType = resolve_CmdLine(cmdLine, 1 /* fs frame */ , a_pageNum, + fs_numPages, fs_numCols, a_LcolNum, + fs_cols_perPage); + + /* display the command line */ + tmp_lightobj = (struct gator_lightobj *)fs_cmd_o->o_data; + sprintf(printBuf, "%s", cmdLine); + justify_light(printBuf, tmp_lightobj->label, strlen(printBuf) + 1, + LEFT_JUSTIFY, 1); + gator_light_set(fs_cmd_o, 1); + + /* update the probe number label */ + tmp_lightobj = (struct gator_lightobj *)fs_probeNum_o->o_data; + sprintf(printBuf, "[FS probes %d, freq=%d sec]", afsmon_fs_prev_probeNum, + afsmon_probefreq); + justify_light(printBuf, tmp_lightobj->label, FC_PROBENUM_O_WIDTH, + RIGHT_JUSTIFY, 1); + gator_light_set(fs_probeNum_o, 1); + + /* update "columns on left" signal */ + tmp_lightobj = (struct gator_lightobj *)fs_leftArrows_o->o_data; + if (fs_pageType & CMD_LEFT) + strcpy(printBuf, "<<<"); + else + strcpy(printBuf, ""); + justify_light(printBuf, tmp_lightobj->label, FC_ARROWS_O_WIDTH, + LEFT_JUSTIFY, 1); + gator_light_set(fs_leftArrows_o, 0); + + /* update "columns on right" signal */ + tmp_lightobj = (struct gator_lightobj *)fs_rightArrows_o->o_data; + if (fs_pageType & CMD_RIGHT) + strcpy(printBuf, ">>>"); + else + strcpy(printBuf, ""); + justify_light(printBuf, tmp_lightobj->label, FC_ARROWS_O_WIDTH, + RIGHT_JUSTIFY, 1); + gator_light_set(fs_rightArrows_o, 0); + + + + /* UPDATE THE COLUMN LABELS */ + + /* the column index is also used to index the label arrays */ + labelIdx = a_LcolNum; + + /* get the pointers to the three arrays of label onodes */ + fsLabels_o_Ptr1 = fsLabels_o[0]; + fsLabels_o_Ptr2 = fsLabels_o[1]; + fsLabels_o_Ptr3 = fsLabels_o[2]; + + for (k = 0; k < fs_cols_perPage; k++) { if (labelIdx < fs_numCols) { - dataIndex = fs_Display_map[labelIdx]; - code = display_Server_label( fs_labels[dataIndex], - *fsLabels_o_Ptr1, - *fsLabels_o_Ptr2, - *fsLabels_o_Ptr3); + dataIndex = fs_Display_map[labelIdx]; + code = + display_Server_label(fs_labels[dataIndex], *fsLabels_o_Ptr1, + *fsLabels_o_Ptr2, *fsLabels_o_Ptr3); - labelIdx++; /* next label */ + labelIdx++; /* next label */ } else { - code = display_Server_label( "//", - *fsLabels_o_Ptr1, - *fsLabels_o_Ptr2, - *fsLabels_o_Ptr3); + code = + display_Server_label("//", *fsLabels_o_Ptr1, *fsLabels_o_Ptr2, + *fsLabels_o_Ptr3); } fsLabels_o_Ptr1++; /* next onode in label row 1 */ fsLabels_o_Ptr2++; /* next onode in label row 2 */ fsLabels_o_Ptr3++; /* next onode in label row 3 */ - } /* labels for each column */ + } /* labels for each column */ /* UPDATE THE FILE SERVER STATISTICS */ - /* move to the right spot in the FS display data array */ - fsDataP = prev_fsData; - fsIdx = 0; - for(i=0; i < ((a_pageNum-1) * fs_numHosts_perPage); i++) { + /* move to the right spot in the FS display data array */ + fsDataP = prev_fsData; + fsIdx = 0; + for (i = 0; i < ((a_pageNum - 1) * fs_numHosts_perPage); i++) { fsDataP++; fsIdx++; - } - - if (fsIdx >= numFS) { /* whoops! screwed up */ - sprintf(errMsg,"[ %s ] Programming error 1\n"); + } + + if (fsIdx >= numFS) { /* whoops! screwed up */ + sprintf(errMsg, "[ %s ] Programming error 1\n", rn); afsmon_Exit(325); - } + } - /* get the pointer to the first line of onodes of the file server frame */ - tmp_fs_lines_P = fs_lines; + /* get the pointer to the first line of onodes of the file server frame */ + tmp_fs_lines_P = fs_lines; - for (i=0; i < fs_numHosts_perPage; i++) { + for (i = 0; i < fs_numHosts_perPage; i++) { /* if this is the last page we may not have file servers to fill up - the page, so check the index */ - if (fsIdx < numFS) { + * the page, so check the index */ + if (fsIdx < numFS) { - if (fsDataP->hostName[0] == '\0') { - sprintf(errMsg,"[ %s ] empty fs display entry \n",rn); + if (fsDataP->hostName[0] == '\0') { + sprintf(errMsg, "[ %s ] empty fs display entry \n", rn); afsmon_Exit(330); - } + } + + /* display the hostname , first names only please! */ - /* display the hostname , first names only please! */ - - sprintf(printBuf, fsDataP->hostName); - for(j=0; jhostName); + for (j = 0; j < strlen(printBuf); j++) { if (printBuf[j] == '.') { - printBuf[j] = '\0'; - break; + printBuf[j] = '\0'; + break; } - } + } - tmp_lightobj=(struct gator_lightobj *)tmp_fs_lines_P->host_o->o_data; - code = justify_light(printBuf,tmp_lightobj->label, - FC_HOSTNAME_O_WIDTH, LEFT_JUSTIFY, 1); - if (code) { - fprintf(debugFD,"[ %s ] justify_code returned %d\n",rn, code); + tmp_lightobj = + (struct gator_lightobj *)tmp_fs_lines_P->host_o->o_data; + code = + justify_light(printBuf, tmp_lightobj->label, + FC_HOSTNAME_O_WIDTH, LEFT_JUSTIFY, 1); + if (code) { + fprintf(debugFD, "[ %s ] justify_code returned %d\n", rn, + code); fflush(debugFD); - } - - /* use the current column value to index into the fs_Display_map - array to obtain the index of the item to display. check if its - overflow flag is set and highlight if so. if the probe had failed - enter "--" is all columns */ - - /* each host has two rows of slots for datums. get the pointers to - both the arrays */ - - firstSlot_o_Ptr = tmp_fs_lines_P->data_o[0]; - secondSlot_o_Ptr = tmp_fs_lines_P->data_o[1]; - fs_curr_RCol = a_LcolNum; /* starting column number from which - we are asked to display data */ - - for(j=0; j < fs_cols_perPage; j++) { /* for each column */ - - /* if there is another column of data */ - if (fs_curr_RCol < fs_numCols) { - - dataIndex = fs_Display_map[fs_curr_RCol]; - - code = display_Server_datum( fsDataP->data[dataIndex], - *firstSlot_o_Ptr, - *secondSlot_o_Ptr, - fsDataP->probeOK, - RIGHT_JUSTIFY, - fsDataP->threshOvf[dataIndex]); - - fs_curr_RCol++; - } else { /* no more data, blank out columns */ - code = display_Server_datum( "", - *firstSlot_o_Ptr, - *secondSlot_o_Ptr, - 1, /* probe ok */ - RIGHT_JUSTIFY, - 0); /* no overflow */ + } + + /* use the current column value to index into the fs_Display_map + * array to obtain the index of the item to display. check if its + * overflow flag is set and highlight if so. if the probe had failed + * enter "--" is all columns */ + + /* each host has two rows of slots for datums. get the pointers to + * both the arrays */ + + firstSlot_o_Ptr = tmp_fs_lines_P->data_o[0]; + secondSlot_o_Ptr = tmp_fs_lines_P->data_o[1]; + fs_curr_RCol = a_LcolNum; /* starting column number from which + * we are asked to display data */ + + for (j = 0; j < fs_cols_perPage; j++) { /* for each column */ + + /* if there is another column of data */ + if (fs_curr_RCol < fs_numCols) { + + dataIndex = fs_Display_map[fs_curr_RCol]; + + code = + display_Server_datum(fsDataP->data[dataIndex], + *firstSlot_o_Ptr, + *secondSlot_o_Ptr, + fsDataP->probeOK, RIGHT_JUSTIFY, + fsDataP->threshOvf[dataIndex]); + + fs_curr_RCol++; + } else { /* no more data, blank out columns */ + code = display_Server_datum("", *firstSlot_o_Ptr, *secondSlot_o_Ptr, 1, /* probe ok */ + RIGHT_JUSTIFY, 0); /* no overflow */ } - firstSlot_o_Ptr++; /* onode of next column */ - secondSlot_o_Ptr++; /* onode of next column */ + firstSlot_o_Ptr++; /* onode of next column */ + secondSlot_o_Ptr++; /* onode of next column */ - } /* for each column */ + } /* for each column */ - /* the loop could have taken the right-column-index one over, - adjust it now */ - if (fs_curr_RCol == fs_numCols) + /* the loop could have taken the right-column-index one over, + * adjust it now */ + if (fs_curr_RCol == fs_numCols) fs_curr_RCol--; - - } /* if fdIdx < numFS */ - - /* if fsIdx >= numFS , blank out all succeding rows */ + } + + + /* if fdIdx < numFS */ + /* if fsIdx >= numFS , blank out all succeding rows */ if (fsIdx >= numFS) { - - /* blank out host name object */ - tmp_lightobj=(struct gator_lightobj *)tmp_fs_lines_P->host_o->o_data; - code = justify_light("",tmp_lightobj->label, - FC_HOSTNAME_O_WIDTH, LEFT_JUSTIFY, 1); - if (code) { - fprintf(debugFD,"[ %s ] justify_code returned %d\n",rn, code); - fflush(debugFD); - } - firstSlot_o_Ptr = tmp_fs_lines_P->data_o[0]; - secondSlot_o_Ptr = tmp_fs_lines_P->data_o[1]; + /* blank out host name object */ + tmp_lightobj = + (struct gator_lightobj *)tmp_fs_lines_P->host_o->o_data; + code = + justify_light("", tmp_lightobj->label, FC_HOSTNAME_O_WIDTH, + LEFT_JUSTIFY, 1); + if (code) { + fprintf(debugFD, "[ %s ] justify_code returned %d\n", rn, + code); + fflush(debugFD); + } - for (k=0; kdata_o[0]; + secondSlot_o_Ptr = tmp_fs_lines_P->data_o[1]; - firstSlot_o_Ptr++; - secondSlot_o_Ptr++; - } + for (k = 0; k < fs_cols_perPage; k++) { + code = display_Server_datum("", *firstSlot_o_Ptr, *secondSlot_o_Ptr, 1, /* probe OK */ + RIGHT_JUSTIFY, 0); /* dont highlight */ - } /* fsIDx >= numFS */ + firstSlot_o_Ptr++; + secondSlot_o_Ptr++; + } + } - tmp_fs_lines_P++; /* pointer to next line in the frame */ - fsDataP++; /* next host's data */ - fsIdx++; /* host index */ + /* fsIDx >= numFS */ + tmp_fs_lines_P++; /* pointer to next line in the frame */ + fsDataP++; /* next host's data */ + fsIdx++; /* host index */ - } /* for each row in the File Servers frame */ + } /* for each row in the File Servers frame */ - /* redraw the display if the File Servers screen is currently displayed */ - if(afsmon_win->w_frame == fsFrame) + /* redraw the display if the File Servers screen is currently displayed */ + if (afsmon_win->w_frame == fsFrame) WOP_DISPLAY(afsmon_win); - /* update the global page & column numbers to reflect the changes */ - fs_currPage = a_pageNum; - fs_curr_LCol = a_LcolNum;; + /* update the global page & column numbers to reflect the changes */ + fs_currPage = a_pageNum; + fs_curr_LCol = a_LcolNum;; - return(0); + return (0); -} /* fs_refresh */ +} /* fs_refresh */ @@ -1891,9 +1927,9 @@ int a_LcolNum; /* starting (leftmost) column number */ int Switch_fs_2_ovw() { - /* bind the overview frame to the window */ - gtxframe_SetFrame(afsmon_win,ovwFrame); - return(0); + /* bind the overview frame to the window */ + gtxframe_SetFrame(afsmon_win, ovwFrame); + return (0); } /*----------------------------------------------------------------------- @@ -1905,11 +1941,11 @@ Switch_fs_2_ovw() int Switch_fs_2_cm() { - if (fs_pageType & CMD_CM) { - /* bind the overview Cache Managers to the window */ - gtxframe_SetFrame(afsmon_win,cmFrame); - } - return(0); + if (fs_pageType & CMD_CM) { + /* bind the overview Cache Managers to the window */ + gtxframe_SetFrame(afsmon_win, cmFrame); + } + return (0); } /*----------------------------------------------------------------------- @@ -1921,14 +1957,14 @@ Switch_fs_2_cm() int Switch_fs_next() { - static char rn[] = "Switch_fs_next"; + static char rn[] = "Switch_fs_next"; - if (fs_pageType & CMD_NEXT) { + if (fs_pageType & CMD_NEXT) { /* we have a next page, refresh with next page number */ - fs_refresh(fs_currPage+1, fs_curr_LCol); - } + fs_refresh(fs_currPage + 1, fs_curr_LCol); + } - return(0); + return (0); } /*----------------------------------------------------------------------- @@ -1940,15 +1976,15 @@ Switch_fs_next() int Switch_fs_last() { - static char rn[] = "Switch_fs_last"; + static char rn[] = "Switch_fs_last"; - if (fs_pageType & CMD_NEXT) { + if (fs_pageType & CMD_NEXT) { /* we have a next page, refresh with the last page number */ fs_refresh(fs_numPages, fs_curr_LCol); - } + } - return(0); + return (0); } /*----------------------------------------------------------------------- @@ -1960,13 +1996,13 @@ Switch_fs_last() int Switch_fs_prev() { - static char rn[] = "Switch_fs_prev"; + static char rn[] = "Switch_fs_prev"; - if (fs_pageType & CMD_PREV) { + if (fs_pageType & CMD_PREV) { /* we have a previous page, refresh with the rpevious page number */ - fs_refresh(fs_currPage -1, fs_curr_LCol); - } - return(0); + fs_refresh(fs_currPage - 1, fs_curr_LCol); + } + return (0); } /*----------------------------------------------------------------------- @@ -1978,13 +2014,13 @@ Switch_fs_prev() int Switch_fs_first() { - static char rn[] = "Switch_fs_first"; + static char rn[] = "Switch_fs_first"; - if (fs_pageType & CMD_PREV) { + if (fs_pageType & CMD_PREV) { /* we have a previous page, got to first page */ - fs_refresh(1 , fs_curr_LCol); - } - return(0); + fs_refresh(1, fs_curr_LCol); + } + return (0); } /*----------------------------------------------------------------------- @@ -1996,13 +2032,13 @@ Switch_fs_first() int Switch_fs_left() { - static char rn[] = "Switch_fs_left"; + static char rn[] = "Switch_fs_left"; - if (fs_pageType & CMD_LEFT) { + if (fs_pageType & CMD_LEFT) { /* we have columns on left, refresh with new column number */ fs_refresh(fs_currPage, fs_curr_LCol - fs_cols_perPage); - } - return(0); + } + return (0); } @@ -2015,13 +2051,13 @@ Switch_fs_left() int Switch_fs_leftmost() { - static char rn[] = "Switch_fs_leftmost"; + static char rn[] = "Switch_fs_leftmost"; - if (fs_pageType & CMD_LEFT) { + if (fs_pageType & CMD_LEFT) { /* we have columns on left, go to the first */ fs_refresh(fs_currPage, 0); - } - return(0); + } + return (0); } /*----------------------------------------------------------------------- @@ -2033,13 +2069,13 @@ Switch_fs_leftmost() int Switch_fs_right() { - static char rn[] = "Switch_fs_right"; + static char rn[] = "Switch_fs_right"; - if (fs_pageType & CMD_RIGHT) { + if (fs_pageType & CMD_RIGHT) { /* we have columns on right, refresh with new column number */ fs_refresh(fs_currPage, fs_curr_LCol + fs_cols_perPage); - } - return(0); + } + return (0); } /*----------------------------------------------------------------------- @@ -2051,20 +2087,21 @@ Switch_fs_right() int Switch_fs_rightmost() { - static char rn[] = "Switch_fs_rightmost"; - int curr_LCol; + static char rn[] = "Switch_fs_rightmost"; + int curr_LCol; - if (fs_pageType & CMD_RIGHT) { + if (fs_pageType & CMD_RIGHT) { /* we have columns on right, go to the last column */ if (fs_numCols % fs_cols_perPage) - curr_LCol = (fs_numCols / fs_cols_perPage) * fs_cols_perPage; + curr_LCol = (fs_numCols / fs_cols_perPage) * fs_cols_perPage; else - curr_LCol = ((fs_numCols / fs_cols_perPage)-1) * fs_cols_perPage; + curr_LCol = + ((fs_numCols / fs_cols_perPage) - 1) * fs_cols_perPage; fs_refresh(fs_currPage, curr_LCol); - } - return(0); + } + return (0); } @@ -2086,252 +2123,272 @@ Switch_fs_rightmost() int create_FSframe_objects() -{ /* create_FSframe_objects */ - static char rn[] = "create_FSframe_objects"; - struct ServerInfo_line *fs_lines_Ptr; - struct onode **fs_data_o_Ptr; - struct onode **fsLabels_o_Ptr; - int x_pos; - int y_pos; - int code; - int i; - int j; - int numBytes; - int arrIdx; +{ /* create_FSframe_objects */ + static char rn[] = "create_FSframe_objects"; + struct ServerInfo_line *fs_lines_Ptr; + struct onode **fs_data_o_Ptr; + struct onode **fsLabels_o_Ptr; + int x_pos; + int y_pos; + int code; + int i; + int j; + int numBytes; + int arrIdx; if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); } - /* create the command line object */ - fs_cmd_o = initLightObject("Command [oview, cm, prev, next, left, right] ? ", - 0,maxY-1,FC_CMD_O_WIDTH,afsmon_win); - if (fs_cmd_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create fs command onode\n",rn); + /* create the command line object */ + fs_cmd_o = + initLightObject("Command [oview, cm, prev, next, left, right] ? ", 0, + maxY - 1, FC_CMD_O_WIDTH, afsmon_win); + if (fs_cmd_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create fs command onode\n", rn); afsmon_Exit(340); - } - code = gtxframe_AddToList(fsFrame,fs_cmd_o); - code = gator_light_set(fs_cmd_o,HIGHLIGHT); + } + code = gtxframe_AddToList(fsFrame, fs_cmd_o); + code = gator_light_set(fs_cmd_o, HIGHLIGHT); - /* we already have the dimensions for the frame - same as the ovw frame */ - /* use the ovw program name object for the fs screen too */ + /* we already have the dimensions for the frame - same as the ovw frame */ + /* use the ovw program name object for the fs screen too */ - code = gtxframe_AddToList(fsFrame, ovw_progName_o); + code = gtxframe_AddToList(fsFrame, ovw_progName_o); - /* create the page number object */ - fs_pageNum_o = initLightObject("[File Servers, p. X of X, c. Y of Y]", - maxX-FC_PAGENUM_O_WIDTH,0,FC_PAGENUM_O_WIDTH,afsmon_win); - if (fs_pageNum_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create pageNumber onode\n",rn); + /* create the page number object */ + fs_pageNum_o = + initLightObject("[File Servers, p. X of X, c. Y of Y]", + maxX - FC_PAGENUM_O_WIDTH, 0, FC_PAGENUM_O_WIDTH, + afsmon_win); + if (fs_pageNum_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn); afsmon_Exit(335); - } - code = gtxframe_AddToList(fsFrame,fs_pageNum_o); - code = gator_light_set(fs_pageNum_o,HIGHLIGHT); - - /* create the probe number object */ - fs_probeNum_o = initLightObject("[FS probes 1, freq=30 sec]", - maxX-FC_PROBENUM_O_WIDTH ,maxY-1, FC_PROBENUM_O_WIDTH, afsmon_win); - if (fs_probeNum_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create fs probeNum onode\n",rn); + } + code = gtxframe_AddToList(fsFrame, fs_pageNum_o); + code = gator_light_set(fs_pageNum_o, HIGHLIGHT); + + /* create the probe number object */ + fs_probeNum_o = + initLightObject("[FS probes 1, freq=30 sec]", + maxX - FC_PROBENUM_O_WIDTH, maxY - 1, + FC_PROBENUM_O_WIDTH, afsmon_win); + if (fs_probeNum_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create fs probeNum onode\n", rn); afsmon_Exit(345); - } - code = gtxframe_AddToList(fsFrame,fs_probeNum_o); - code = gator_light_set(fs_probeNum_o,HIGHLIGHT); - - - /* create the numFS monitored object */ - fs_numFS_o = initLightObject( - " 0 File Servers monitored, 0 alerts on 0 machines", - 4,2,FC_NUMHOSTS_O_WIDTH,afsmon_win); - if (fs_numFS_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create numFS onode for the fs frame\n", - rn); + } + code = gtxframe_AddToList(fsFrame, fs_probeNum_o); + code = gator_light_set(fs_probeNum_o, HIGHLIGHT); + + + /* create the numFS monitored object */ + fs_numFS_o = + initLightObject + (" 0 File Servers monitored, 0 alerts on 0 machines", 4, 2, + FC_NUMHOSTS_O_WIDTH, afsmon_win); + if (fs_numFS_o == NULL) { + sprintf(errMsg, + "[ %s ] Failed to create numFS onode for the fs frame\n", rn); afsmon_Exit(350); - } - code = gtxframe_AddToList(fsFrame,fs_numFS_o); - - /* create the "more columns to left" indicator */ - fs_leftArrows_o = initLightObject("<<<", 0,2,FC_ARROWS_O_WIDTH, afsmon_win); - if (fs_leftArrows_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create leftArrows onode for the fs frame\n", rn); + } + code = gtxframe_AddToList(fsFrame, fs_numFS_o); + + /* create the "more columns to left" indicator */ + fs_leftArrows_o = + initLightObject("<<<", 0, 2, FC_ARROWS_O_WIDTH, afsmon_win); + if (fs_leftArrows_o == NULL) { + sprintf(errMsg, + "[ %s ] Failed to create leftArrows onode for the fs frame\n", + rn); afsmon_Exit(355); - } - code = gtxframe_AddToList(fsFrame,fs_leftArrows_o); - - /* create the "more columns to right" indicator */ - fs_rightArrows_o = initLightObject(">>>", maxX-FC_ARROWS_O_WIDTH, 2, - FC_ARROWS_O_WIDTH, afsmon_win); - if (fs_rightArrows_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create rightArrows onode for the fs frame\n", rn); + } + code = gtxframe_AddToList(fsFrame, fs_leftArrows_o); + + /* create the "more columns to right" indicator */ + fs_rightArrows_o = + initLightObject(">>>", maxX - FC_ARROWS_O_WIDTH, 2, FC_ARROWS_O_WIDTH, + afsmon_win); + if (fs_rightArrows_o == NULL) { + sprintf(errMsg, + "[ %s ] Failed to create rightArrows onode for the fs frame\n", + rn); afsmon_Exit(360); - } - code = gtxframe_AddToList(fsFrame,fs_rightArrows_o); + } + code = gtxframe_AddToList(fsFrame, fs_rightArrows_o); - /* calculate the maximum number of hosts per page (2 rows per host) */ - fs_numHosts_perPage = (maxY - FC_NUM_FIXED_LINES) / 2; + /* calculate the maximum number of hosts per page (2 rows per host) */ + fs_numHosts_perPage = (maxY - FC_NUM_FIXED_LINES) / 2; - /* determine the number of data columns that can fit in a page */ - fs_cols_perPage = (maxX - FC_HOSTNAME_O_WIDTH ) / (FC_COLUMN_WIDTH); + /* determine the number of data columns that can fit in a page */ + fs_cols_perPage = (maxX - FC_HOSTNAME_O_WIDTH) / (FC_COLUMN_WIDTH); - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] fs_numHosts_perPage=%d fs_cols_perPage=%d\n", - rn,fs_numHosts_perPage, fs_cols_perPage); + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] fs_numHosts_perPage=%d fs_cols_perPage=%d\n", + rn, fs_numHosts_perPage, fs_cols_perPage); fflush(debugFD); - } + } - /* the above two variables give us the information needed to create - the objects for displaying the file server information */ + /* the above two variables give us the information needed to create + * the objects for displaying the file server information */ - /* allocate memory for all the onode pointers required to display - the file server statistics */ + /* allocate memory for all the onode pointers required to display + * the file server statistics */ - numBytes = fs_numHosts_perPage * sizeof(struct ServerInfo_line); - fs_lines = (struct ServerInfo_line *) malloc(numBytes); - if (fs_lines == (struct ServerInfo_line *)0) { - sprintf(errMsg,"[ %s ] Failed to allocate %d bytes for FS data lines\n", - rn, numBytes); + numBytes = fs_numHosts_perPage * sizeof(struct ServerInfo_line); + fs_lines = (struct ServerInfo_line *)malloc(numBytes); + if (fs_lines == (struct ServerInfo_line *)0) { + sprintf(errMsg, + "[ %s ] Failed to allocate %d bytes for FS data lines\n", rn, + numBytes); afsmon_Exit(365); - } - - /* for each line of server statistics allocate memory to store two arrays - of data onodes */ - - fs_lines_Ptr = fs_lines; - for(i=0; idata_o[arrIdx] = (struct onode **) malloc(numBytes); - if (fs_lines_Ptr->data_o[arrIdx] == (struct onode **)0) { - sprintf(errMsg,"[ %s ] Failed to allocate %d bytes for FS data onodes\n", - rn, numBytes); - afsmon_Exit(370); + } + + /* for each line of server statistics allocate memory to store two arrays + * of data onodes */ + + fs_lines_Ptr = fs_lines; + for (i = 0; i < fs_numHosts_perPage; i++) { + for (arrIdx = 0; arrIdx < 2; arrIdx++) { + numBytes = fs_cols_perPage * sizeof(struct onode *); + fs_lines_Ptr->data_o[arrIdx] = (struct onode **)malloc(numBytes); + if (fs_lines_Ptr->data_o[arrIdx] == NULL) { + sprintf(errMsg, + "[ %s ] Failed to allocate %d bytes for FS data onodes\n", + rn, numBytes); + afsmon_Exit(370); + } } - } - fs_lines_Ptr++; - } + fs_lines_Ptr++; + } - /* now allocate the onodes itself */ + /* now allocate the onodes itself */ - fs_lines_Ptr = fs_lines; - for(i=0; ihost_o = initLightObject("FSHostName", - 0,FC_FIRST_HOST_ROW + 2*i, FC_HOSTNAME_O_WIDTH, afsmon_win); - if (fs_lines_Ptr->host_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create an FS name onode\n",rn); - afsmon_Exit(375); - } - code = gtxframe_AddToList(fsFrame, fs_lines_Ptr->host_o); + fs_lines_Ptr->host_o = + initLightObject("FSHostName", 0, FC_FIRST_HOST_ROW + 2 * i, + FC_HOSTNAME_O_WIDTH, afsmon_win); + if (fs_lines_Ptr->host_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create an FS name onode\n", rn); + afsmon_Exit(375); + } + code = gtxframe_AddToList(fsFrame, fs_lines_Ptr->host_o); /* if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Addr of host_o = %d for line %d\n", - rn,fs_lines_Ptr->host_o,i); - fflush(debugFD); - } */ + * fprintf(debugFD,"[ %s ] Addr of host_o = %d for line %d\n", + * rn,fs_lines_Ptr->host_o,i); + * fflush(debugFD); + * } */ /* initialize data onodes for this host */ - for(arrIdx=0; arrIdx<2; arrIdx++) { /* for each array index */ + for (arrIdx = 0; arrIdx < 2; arrIdx++) { /* for each array index */ - fs_data_o_Ptr = fs_lines_Ptr->data_o[arrIdx]; - for(j=0; jdata_o[arrIdx]; + for (j = 0; j < fs_cols_perPage; j++) { /* for each column */ char tmpBuf[20]; /* determine x & y coordinate for this data object */ /* the 1's are for leaving a blank after each column */ x_pos = FC_HOSTNAME_O_WIDTH + (j * (FC_COLUMN_WIDTH)); - y_pos = FC_FIRST_HOST_ROW + 2*i + arrIdx; - - sprintf(tmpBuf,"-FSData %d-",arrIdx); - *fs_data_o_Ptr = initLightObject(tmpBuf, - x_pos, y_pos, FC_COLUMN_WIDTH, afsmon_win); - if (*fs_data_o_Ptr == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create an FS data onode\n",rn); - afsmon_Exit(380); + y_pos = FC_FIRST_HOST_ROW + 2 * i + arrIdx; + + sprintf(tmpBuf, "-FSData %d-", arrIdx); + *fs_data_o_Ptr = + initLightObject(tmpBuf, x_pos, y_pos, FC_COLUMN_WIDTH, + afsmon_win); + if (*fs_data_o_Ptr == NULL) { + sprintf(errMsg, + "[ %s ] Failed to create an FS data onode\n", rn); + afsmon_Exit(380); } - code = gtxframe_AddToList(fsFrame, *fs_data_o_Ptr); + code = gtxframe_AddToList(fsFrame, *fs_data_o_Ptr); fs_data_o_Ptr++; - } /* for each column */ - } /* for each onode array index */ + } /* for each column */ + } /* for each onode array index */ - fs_lines_Ptr++; - } /* for each host slot */ + fs_lines_Ptr++; + } /* for each host slot */ - /* INITIALIZE COLUMN LABELS */ + /* INITIALIZE COLUMN LABELS */ - /* allocate memory for two arrays of onode pointers for file server column - labels */ - for( arrIdx=0; arrIdx < 3; arrIdx++) { + /* allocate memory for two arrays of onode pointers for file server column + * labels */ + for (arrIdx = 0; arrIdx < 3; arrIdx++) { - fsLabels_o[arrIdx] = (struct onode **) malloc( - sizeof(struct onode *) * fs_cols_perPage); - if (fsLabels_o[arrIdx] == (struct onode **)0) { - sprintf(errMsg,"[ %s ] Failed to allocate memory for FS label onodes\n", - rn); - afsmon_Exit(385); - } - - /* create cache manager name objects */ - fsLabels_o_Ptr = fsLabels_o[arrIdx]; - for (i=0; i< fs_cols_perPage; i++) { - *fsLabels_o_Ptr = initLightObject("", - FC_HOSTNAME_O_WIDTH + i * FC_COLUMN_WIDTH, - FC_FIRST_LABEL_ROW + arrIdx, - FC_COLUMN_WIDTH,afsmon_win); - - if (*fsLabels_o_Ptr == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create a FS label onode\n",rn); + fsLabels_o[arrIdx] = + (struct onode **)malloc(sizeof(struct onode *) * fs_cols_perPage); + if (fsLabels_o[arrIdx] == NULL) { + sprintf(errMsg, + "[ %s ] Failed to allocate memory for FS label onodes\n", + rn); + afsmon_Exit(385); + } + + /* create cache manager name objects */ + fsLabels_o_Ptr = fsLabels_o[arrIdx]; + for (i = 0; i < fs_cols_perPage; i++) { + *fsLabels_o_Ptr = + initLightObject("", FC_HOSTNAME_O_WIDTH + i * FC_COLUMN_WIDTH, + FC_FIRST_LABEL_ROW + arrIdx, FC_COLUMN_WIDTH, + afsmon_win); + + if (*fsLabels_o_Ptr == NULL) { + sprintf(errMsg, "[ %s ] Failed to create a FS label onode\n", + rn); afsmon_Exit(390); - } - code = gtxframe_AddToList(fsFrame,*fsLabels_o_Ptr); - fsLabels_o_Ptr++; - } + } + code = gtxframe_AddToList(fsFrame, *fsLabels_o_Ptr); + fsLabels_o_Ptr++; + } - } + } - /* initialize the column & page counters */ + /* initialize the column & page counters */ - fs_currPage = 1; - fs_numCols = fs_DisplayItems_count; - fs_numPages = numFS / fs_numHosts_perPage; - if (numFS % fs_numHosts_perPage) + fs_currPage = 1; + fs_numCols = fs_DisplayItems_count; + fs_numPages = numFS / fs_numHosts_perPage; + if (numFS % fs_numHosts_perPage) fs_numPages++; - fs_curr_LCol = 0; /* leftmost col */ - fs_curr_RCol = 0; /* rightmost col */ + fs_curr_LCol = 0; /* leftmost col */ + fs_curr_RCol = 0; /* rightmost col */ - /* create keyboard bindings */ - /* bind Q and  to exit */ - keymap_BindToString(fsFrame->keymap,"Q",afsmonExit_gtx,(char *)0,(char *)0); - keymap_BindToString(fsFrame->keymap,"",afsmonExit_gtx,(char *)0,(char *)0); + /* create keyboard bindings */ + /* bind Q and  to exit */ + keymap_BindToString(fsFrame->keymap, "Q", afsmonExit_gtx, NULL, NULL); + keymap_BindToString(fsFrame->keymap, "", afsmonExit_gtx, NULL, NULL); - /* o = overview, c = cm, n = next, p = prev, l = left, r = right - N = last page, P = first page, L = leftmost col, R = rightmost col */ + /* o = overview, c = cm, n = next, p = prev, l = left, r = right + * N = last page, P = first page, L = leftmost col, R = rightmost col */ - keymap_BindToString(fsFrame->keymap,"o",Switch_fs_2_ovw,(char *)0,(char *)0); - keymap_BindToString(fsFrame->keymap,"c",Switch_fs_2_cm,(char *)0,(char *)0); - keymap_BindToString(fsFrame->keymap,"n",Switch_fs_next,(char *)0,(char *)0); - keymap_BindToString(fsFrame->keymap,"N",Switch_fs_last,(char *)0,(char *)0); - keymap_BindToString(fsFrame->keymap,"p",Switch_fs_prev,(char *)0,(char *)0); - keymap_BindToString(fsFrame->keymap,"P",Switch_fs_first,(char *)0,(char *)0); - keymap_BindToString(fsFrame->keymap,"l",Switch_fs_left,(char *)0,(char *)0); - keymap_BindToString(fsFrame->keymap,"L",Switch_fs_leftmost,(char *)0,(char *)0); - keymap_BindToString(fsFrame->keymap,"r",Switch_fs_right,(char *)0,(char *)0); - keymap_BindToString(fsFrame->keymap,"R",Switch_fs_rightmost,(char *)0,(char *)0); + keymap_BindToString(fsFrame->keymap, "o", Switch_fs_2_ovw, NULL, NULL); + keymap_BindToString(fsFrame->keymap, "c", Switch_fs_2_cm, NULL, NULL); + keymap_BindToString(fsFrame->keymap, "n", Switch_fs_next, NULL, NULL); + keymap_BindToString(fsFrame->keymap, "N", Switch_fs_last, NULL, NULL); + keymap_BindToString(fsFrame->keymap, "p", Switch_fs_prev, NULL, NULL); + keymap_BindToString(fsFrame->keymap, "P", Switch_fs_first, NULL, NULL); + keymap_BindToString(fsFrame->keymap, "l", Switch_fs_left, NULL, NULL); + keymap_BindToString(fsFrame->keymap, "L", Switch_fs_leftmost, NULL, NULL); + keymap_BindToString(fsFrame->keymap, "r", Switch_fs_right, NULL, NULL); + keymap_BindToString(fsFrame->keymap, "R", Switch_fs_rightmost, NULL, + NULL); - return(0); -} /* create_FSframe_objects */ + return (0); +} /* create_FSframe_objects */ /*----------------------------------------------------------------------- @@ -2352,312 +2409,313 @@ create_FSframe_objects() int cm_refresh(a_pageNum, a_LcolNum) -int a_pageNum; /* page to display */ -int a_LcolNum; /* starting (leftmost) column number */ - -{ /* cm_refresh */ - - static char rn[] = "cm_refresh"; /* routine name */ - struct gator_lightobj *tmp_lightobj; /* ptr for object's display data */ - struct cm_Display_Data *cmDataP; /* ptr to CM display data array */ - struct ServerInfo_line *tmp_cm_lines_P; /* tmp ptr to cm_lines */ - struct onode **firstSlot_o_Ptr; /* ptr to first data slot of a datum */ - struct onode **secondSlot_o_Ptr; /* ptr to second data slot of a datum */ - struct onode **cmLabels_o_Ptr1; /* ptr to label row 0 */ - struct onode **cmLabels_o_Ptr2; /* ptr to label row 1 */ - struct onode **cmLabels_o_Ptr3; /* ptr to label row 2 */ - char cmdLine[80]; /* buffer for command line */ - char printBuf[256]; /* buffer to print to screen */ - int i; - int j; - int k; - int code; - int cmIdx; - int labelIdx; - int dataIndex; /* index to the data[] field of - struct cm_Display_Data */ - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_pageNum= %d, a_LcolNum= %d \n", - rn, a_pageNum, a_LcolNum); + int a_pageNum; /* page to display */ + int a_LcolNum; /* starting (leftmost) column number */ + +{ /* cm_refresh */ + + static char rn[] = "cm_refresh"; /* routine name */ + struct gator_lightobj *tmp_lightobj; /* ptr for object's display data */ + struct cm_Display_Data *cmDataP; /* ptr to CM display data array */ + struct ServerInfo_line *tmp_cm_lines_P; /* tmp ptr to cm_lines */ + struct onode **firstSlot_o_Ptr; /* ptr to first data slot of a datum */ + struct onode **secondSlot_o_Ptr; /* ptr to second data slot of a datum */ + struct onode **cmLabels_o_Ptr1; /* ptr to label row 0 */ + struct onode **cmLabels_o_Ptr2; /* ptr to label row 1 */ + struct onode **cmLabels_o_Ptr3; /* ptr to label row 2 */ + char cmdLine[80]; /* buffer for command line */ + char printBuf[256]; /* buffer to print to screen */ + int i; + int j; + int k; + int code; + int cmIdx; + int labelIdx; + int dataIndex; /* index to the data[] field of + * struct cm_Display_Data */ + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_pageNum= %d, a_LcolNum= %d \n", rn, + a_pageNum, a_LcolNum); fflush(debugFD); - } + } - /* if the data is not yet available, ie., not one probe cycle has - completed, do nothing */ + /* if the data is not yet available, ie., not one probe cycle has + * completed, do nothing */ - if (! cm_Data_Available) - return(0); + if (!cm_Data_Available) + return (0); - /* validate the page number & column number */ - if (a_pageNum < 1 || a_pageNum > cm_numPages) { + /* validate the page number & column number */ + if (a_pageNum < 1 || a_pageNum > cm_numPages) { if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called with wrong page # %d \n",rn, a_pageNum); - fflush(debugFD); + fprintf(debugFD, "[ %s ] Called with wrong page # %d \n", rn, + a_pageNum); + fflush(debugFD); } afsmon_Exit(395); - } - if (a_LcolNum < 0 || a_LcolNum > cm_numCols) { + } + if (a_LcolNum < 0 || a_LcolNum > cm_numCols) { if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called with wrong column #%d\n",rn, a_LcolNum); - fflush(debugFD); + fprintf(debugFD, "[ %s ] Called with wrong column #%d\n", rn, + a_LcolNum); + fflush(debugFD); } afsmon_Exit(400); - } - - - - /* update the fixed labels */ - - /* we reuse the ovw version lable and hence do not have to do anything - for it here */ - - /* page number label */ - tmp_lightobj=(struct gator_lightobj *) cm_pageNum_o->o_data; - sprintf(printBuf,"[Cache Managers, p.%d of %d, c.%d of %d]", - a_pageNum, cm_numPages, a_LcolNum +1, cm_numCols); - justify_light(printBuf,tmp_lightobj->label, FC_PAGENUM_O_WIDTH, - RIGHT_JUSTIFY,1); - gator_light_set(cm_pageNum_o,1); - - /* file servers monitored label */ - tmp_lightobj=(struct gator_lightobj *) cm_numCM_o->o_data; - sprintf(printBuf,"%d Cache Managers monitored, %d alerts on %d machines", - numCM, num_cm_alerts, numHosts_oncm_alerts); - justify_light(printBuf,tmp_lightobj->label, FC_NUMHOSTS_O_WIDTH, CENTER,1); - - - /* command line */ - - /* figure out what we need to show in the prompt & set the page type */ - /* the cm_pageType variable is in turn used by the keyboard handler - routines to call cm_refresh() with the correct parameters */ - - cm_pageType = resolve_CmdLine( cmdLine, 2 /* cm frame */, a_pageNum, - cm_numPages, cm_numCols, a_LcolNum, cm_cols_perPage); - - /* display the command line */ - tmp_lightobj=(struct gator_lightobj *) cm_cmd_o->o_data; - sprintf(printBuf,"%s", cmdLine); - justify_light(printBuf,tmp_lightobj->label, strlen(printBuf)+1, - LEFT_JUSTIFY,1); - gator_light_set(cm_cmd_o, 1); - - /* update the probe number label */ - tmp_lightobj=(struct gator_lightobj *) cm_probeNum_o->o_data; - sprintf(printBuf,"[CM probes %d, freq=%d sec]", - afsmon_cm_prev_probeNum, afsmon_probefreq); - justify_light(printBuf,tmp_lightobj->label, FC_PROBENUM_O_WIDTH, - RIGHT_JUSTIFY,1); - gator_light_set(cm_cmd_o, 1); - - /* update "columns on left" signal */ - tmp_lightobj=(struct gator_lightobj *) cm_leftArrows_o->o_data; - if (cm_pageType & CMD_LEFT) - strcpy(printBuf, "<<<"); - else - strcpy(printBuf,""); - justify_light(printBuf,tmp_lightobj->label, FC_ARROWS_O_WIDTH, - LEFT_JUSTIFY,1); - gator_light_set(cm_leftArrows_o, 0); - - /* update "columns on right" signal */ - tmp_lightobj=(struct gator_lightobj *) cm_rightArrows_o->o_data; - if (cm_pageType & CMD_RIGHT) - strcpy(printBuf, ">>>"); - else - strcpy(printBuf,""); - justify_light(printBuf,tmp_lightobj->label, FC_ARROWS_O_WIDTH, - RIGHT_JUSTIFY,1); - gator_light_set(cm_rightArrows_o, 0); - - - - /* UPDATE THE COLUMN LABELS */ - - /* the column index is also used to index the label arrays */ - labelIdx = a_LcolNum; - - /* get the pointers to the three arrays of label onodes */ - cmLabels_o_Ptr1 = cmLabels_o[0]; - cmLabels_o_Ptr2 = cmLabels_o[1]; - cmLabels_o_Ptr3 = cmLabels_o[2]; - - for(k=0; k < cm_cols_perPage; k++) { + } + + + + /* update the fixed labels */ + + /* we reuse the ovw version lable and hence do not have to do anything + * for it here */ + + /* page number label */ + tmp_lightobj = (struct gator_lightobj *)cm_pageNum_o->o_data; + sprintf(printBuf, "[Cache Managers, p.%d of %d, c.%d of %d]", a_pageNum, + cm_numPages, a_LcolNum + 1, cm_numCols); + justify_light(printBuf, tmp_lightobj->label, FC_PAGENUM_O_WIDTH, + RIGHT_JUSTIFY, 1); + gator_light_set(cm_pageNum_o, 1); + + /* file servers monitored label */ + tmp_lightobj = (struct gator_lightobj *)cm_numCM_o->o_data; + sprintf(printBuf, "%d Cache Managers monitored, %d alerts on %d machines", + numCM, num_cm_alerts, numHosts_oncm_alerts); + justify_light(printBuf, tmp_lightobj->label, FC_NUMHOSTS_O_WIDTH, CENTER, + 1); + + + /* command line */ + + /* figure out what we need to show in the prompt & set the page type */ + /* the cm_pageType variable is in turn used by the keyboard handler + * routines to call cm_refresh() with the correct parameters */ + + cm_pageType = resolve_CmdLine(cmdLine, 2 /* cm frame */ , a_pageNum, + cm_numPages, cm_numCols, a_LcolNum, + cm_cols_perPage); + + /* display the command line */ + tmp_lightobj = (struct gator_lightobj *)cm_cmd_o->o_data; + sprintf(printBuf, "%s", cmdLine); + justify_light(printBuf, tmp_lightobj->label, strlen(printBuf) + 1, + LEFT_JUSTIFY, 1); + gator_light_set(cm_cmd_o, 1); + + /* update the probe number label */ + tmp_lightobj = (struct gator_lightobj *)cm_probeNum_o->o_data; + sprintf(printBuf, "[CM probes %d, freq=%d sec]", afsmon_cm_prev_probeNum, + afsmon_probefreq); + justify_light(printBuf, tmp_lightobj->label, FC_PROBENUM_O_WIDTH, + RIGHT_JUSTIFY, 1); + gator_light_set(cm_cmd_o, 1); + + /* update "columns on left" signal */ + tmp_lightobj = (struct gator_lightobj *)cm_leftArrows_o->o_data; + if (cm_pageType & CMD_LEFT) + strcpy(printBuf, "<<<"); + else + strcpy(printBuf, ""); + justify_light(printBuf, tmp_lightobj->label, FC_ARROWS_O_WIDTH, + LEFT_JUSTIFY, 1); + gator_light_set(cm_leftArrows_o, 0); + + /* update "columns on right" signal */ + tmp_lightobj = (struct gator_lightobj *)cm_rightArrows_o->o_data; + if (cm_pageType & CMD_RIGHT) + strcpy(printBuf, ">>>"); + else + strcpy(printBuf, ""); + justify_light(printBuf, tmp_lightobj->label, FC_ARROWS_O_WIDTH, + RIGHT_JUSTIFY, 1); + gator_light_set(cm_rightArrows_o, 0); + + + + /* UPDATE THE COLUMN LABELS */ + + /* the column index is also used to index the label arrays */ + labelIdx = a_LcolNum; + + /* get the pointers to the three arrays of label onodes */ + cmLabels_o_Ptr1 = cmLabels_o[0]; + cmLabels_o_Ptr2 = cmLabels_o[1]; + cmLabels_o_Ptr3 = cmLabels_o[2]; + + for (k = 0; k < cm_cols_perPage; k++) { if (labelIdx < cm_numCols) { - dataIndex = cm_Display_map[labelIdx]; - code = display_Server_label( cm_labels[dataIndex], - *cmLabels_o_Ptr1, - *cmLabels_o_Ptr2, - *cmLabels_o_Ptr3); + dataIndex = cm_Display_map[labelIdx]; + code = + display_Server_label(cm_labels[dataIndex], *cmLabels_o_Ptr1, + *cmLabels_o_Ptr2, *cmLabels_o_Ptr3); - labelIdx++; /* next label */ + labelIdx++; /* next label */ } else { - code = display_Server_label( "//", - *cmLabels_o_Ptr1, - *cmLabels_o_Ptr2, - *cmLabels_o_Ptr3); + code = + display_Server_label("//", *cmLabels_o_Ptr1, *cmLabels_o_Ptr2, + *cmLabels_o_Ptr3); } cmLabels_o_Ptr1++; /* next onode in label row 1 */ cmLabels_o_Ptr2++; /* next onode in label row 2 */ cmLabels_o_Ptr3++; /* next onode in label row 3 */ - } /* labels for each column */ + } /* labels for each column */ /* UPDATE THE FILE SERVER STATISTICS */ - /* move to the right spot in the CM display data array */ - cmDataP = prev_cmData; - cmIdx = 0; - for(i=0; i < ((a_pageNum-1) * cm_numHosts_perPage); i++) { + /* move to the right spot in the CM display data array */ + cmDataP = prev_cmData; + cmIdx = 0; + for (i = 0; i < ((a_pageNum - 1) * cm_numHosts_perPage); i++) { cmDataP++; cmIdx++; - } - - if (cmIdx >= numCM) { /* whoops! screwed up */ - sprintf(errMsg,"[ %s ] Programming error 1\n", rn); + } + + if (cmIdx >= numCM) { /* whoops! screwed up */ + sprintf(errMsg, "[ %s ] Programming error 1\n", rn); afsmon_Exit(405); - } + } - /* get the pointer to the first line of onodes of the file server frame */ - tmp_cm_lines_P = cm_lines; + /* get the pointer to the first line of onodes of the file server frame */ + tmp_cm_lines_P = cm_lines; - for (i=0; i < cm_numHosts_perPage; i++) { + for (i = 0; i < cm_numHosts_perPage; i++) { /* if this is the last page we may not have file servers to fill up - the page, so check the index */ - if (cmIdx < numCM) { + * the page, so check the index */ + if (cmIdx < numCM) { - if (cmDataP->hostName[0] == '\0') { - sprintf(errMsg,"[ %s ] empty cm display entry \n",rn); + if (cmDataP->hostName[0] == '\0') { + sprintf(errMsg, "[ %s ] empty cm display entry \n", rn); afsmon_Exit(410); - } + } + + /* display the hostname , first names only please! */ - /* display the hostname , first names only please! */ - - sprintf(printBuf, cmDataP->hostName); - for(j=0; jhostName); + for (j = 0; j < strlen(printBuf); j++) { if (printBuf[j] == '.') { - printBuf[j] = '\0'; - break; + printBuf[j] = '\0'; + break; } - } + } - tmp_lightobj=(struct gator_lightobj *)tmp_cm_lines_P->host_o->o_data; - code = justify_light(printBuf,tmp_lightobj->label, - FC_HOSTNAME_O_WIDTH, LEFT_JUSTIFY, 1); - if (code) { - fprintf(debugFD,"[ %s ] justify_code returned %d\n",rn, code); + tmp_lightobj = + (struct gator_lightobj *)tmp_cm_lines_P->host_o->o_data; + code = + justify_light(printBuf, tmp_lightobj->label, + FC_HOSTNAME_O_WIDTH, LEFT_JUSTIFY, 1); + if (code) { + fprintf(debugFD, "[ %s ] justify_code returned %d\n", rn, + code); fflush(debugFD); - } - - /* use the current column value to index into the cm_Display_map - array to obtain the index of the item to display. check if its - overflow flag is set and highlight if so. if the probe had failed - enter "--" is all columns */ - - /* each host has two rows of slots for datums. get the pointers to - both the arrays */ - - firstSlot_o_Ptr = tmp_cm_lines_P->data_o[0]; - secondSlot_o_Ptr = tmp_cm_lines_P->data_o[1]; - cm_curr_RCol = a_LcolNum; /* starting column number from which - we are asked to display data */ - - for(j=0; j < cm_cols_perPage; j++) { /* for each column */ - - /* if there is another column of data */ - if (cm_curr_RCol < cm_numCols) { - - dataIndex = cm_Display_map[cm_curr_RCol]; - - code = display_Server_datum( cmDataP->data[dataIndex], - *firstSlot_o_Ptr, - *secondSlot_o_Ptr, - cmDataP->probeOK, - RIGHT_JUSTIFY, - cmDataP->threshOvf[dataIndex]); - - cm_curr_RCol++; - } else { /* no more data, blank out columns */ - code = display_Server_datum( "", - *firstSlot_o_Ptr, - *secondSlot_o_Ptr, - 1, /* probe ok */ - RIGHT_JUSTIFY, - 0); /* no overflow */ + } + + /* use the current column value to index into the cm_Display_map + * array to obtain the index of the item to display. check if its + * overflow flag is set and highlight if so. if the probe had failed + * enter "--" is all columns */ + + /* each host has two rows of slots for datums. get the pointers to + * both the arrays */ + + firstSlot_o_Ptr = tmp_cm_lines_P->data_o[0]; + secondSlot_o_Ptr = tmp_cm_lines_P->data_o[1]; + cm_curr_RCol = a_LcolNum; /* starting column number from which + * we are asked to display data */ + + for (j = 0; j < cm_cols_perPage; j++) { /* for each column */ + + /* if there is another column of data */ + if (cm_curr_RCol < cm_numCols) { + + dataIndex = cm_Display_map[cm_curr_RCol]; + + code = + display_Server_datum(cmDataP->data[dataIndex], + *firstSlot_o_Ptr, + *secondSlot_o_Ptr, + cmDataP->probeOK, RIGHT_JUSTIFY, + cmDataP->threshOvf[dataIndex]); + + cm_curr_RCol++; + } else { /* no more data, blank out columns */ + code = display_Server_datum("", *firstSlot_o_Ptr, *secondSlot_o_Ptr, 1, /* probe ok */ + RIGHT_JUSTIFY, 0); /* no overflow */ } - firstSlot_o_Ptr++; /* onode of next column */ - secondSlot_o_Ptr++; /* onode of next column */ + firstSlot_o_Ptr++; /* onode of next column */ + secondSlot_o_Ptr++; /* onode of next column */ - } /* for each column */ + } /* for each column */ - /* the loop could have taken the right-column-index one over, - adjust it now */ - if (cm_curr_RCol == cm_numCols) + /* the loop could have taken the right-column-index one over, + * adjust it now */ + if (cm_curr_RCol == cm_numCols) cm_curr_RCol--; - - } /* if fdIdx < numCM */ - - /* if cmIdx >= numCM , blank out all succeding rows */ + } + + + /* if fdIdx < numCM */ + /* if cmIdx >= numCM , blank out all succeding rows */ if (cmIdx >= numCM) { - - /* blank out host name object */ - tmp_lightobj=(struct gator_lightobj *)tmp_cm_lines_P->host_o->o_data; - code = justify_light("",tmp_lightobj->label, - FC_HOSTNAME_O_WIDTH, LEFT_JUSTIFY, 1); - if (code) { - fprintf(debugFD,"[ %s ] justify_code returned %d\n",rn, code); - fflush(debugFD); - } - firstSlot_o_Ptr = tmp_cm_lines_P->data_o[0]; - secondSlot_o_Ptr = tmp_cm_lines_P->data_o[1]; + /* blank out host name object */ + tmp_lightobj = + (struct gator_lightobj *)tmp_cm_lines_P->host_o->o_data; + code = + justify_light("", tmp_lightobj->label, FC_HOSTNAME_O_WIDTH, + LEFT_JUSTIFY, 1); + if (code) { + fprintf(debugFD, "[ %s ] justify_code returned %d\n", rn, + code); + fflush(debugFD); + } - for (k=0; kdata_o[0]; + secondSlot_o_Ptr = tmp_cm_lines_P->data_o[1]; - firstSlot_o_Ptr++; - secondSlot_o_Ptr++; - } + for (k = 0; k < cm_cols_perPage; k++) { + code = display_Server_datum("", *firstSlot_o_Ptr, *secondSlot_o_Ptr, 1, /* probe OK */ + RIGHT_JUSTIFY, 0); /* dont highlight */ - } /* cmIDx >= numCM */ + firstSlot_o_Ptr++; + secondSlot_o_Ptr++; + } + } - tmp_cm_lines_P++; /* pointer to next line in the frame */ - cmDataP++; /* next host's data */ - cmIdx++; /* host index */ + /* cmIDx >= numCM */ + tmp_cm_lines_P++; /* pointer to next line in the frame */ + cmDataP++; /* next host's data */ + cmIdx++; /* host index */ - } /* for each row in the Cache Manager frame */ + } /* for each row in the Cache Manager frame */ - /* redraw the display if the Cache Managers screen is currently displayed*/ - if(afsmon_win->w_frame == cmFrame) + /* redraw the display if the Cache Managers screen is currently displayed */ + if (afsmon_win->w_frame == cmFrame) WOP_DISPLAY(afsmon_win); - /* update the global page & column numbers to reflect the changes */ - cm_currPage = a_pageNum; - cm_curr_LCol = a_LcolNum;; + /* update the global page & column numbers to reflect the changes */ + cm_currPage = a_pageNum; + cm_curr_LCol = a_LcolNum;; - return(0); + return (0); -} /* cm_refresh */ +} /* cm_refresh */ @@ -2670,9 +2728,9 @@ int a_LcolNum; /* starting (leftmost) column number */ int Switch_cm_2_ovw() { - /* bind the overview frame to the window */ - gtxframe_SetFrame(afsmon_win,ovwFrame); - return(0); + /* bind the overview frame to the window */ + gtxframe_SetFrame(afsmon_win, ovwFrame); + return (0); } /*----------------------------------------------------------------------- @@ -2684,11 +2742,11 @@ Switch_cm_2_ovw() int Switch_cm_2_fs() { - if (cm_pageType & CMD_FS) { - /* bind the file servers frame to the window */ - gtxframe_SetFrame(afsmon_win,fsFrame); - } - return(0); + if (cm_pageType & CMD_FS) { + /* bind the file servers frame to the window */ + gtxframe_SetFrame(afsmon_win, fsFrame); + } + return (0); } /*----------------------------------------------------------------------- @@ -2700,14 +2758,14 @@ Switch_cm_2_fs() int Switch_cm_next() { - static char rn[] = "Switch_cm_next"; + static char rn[] = "Switch_cm_next"; - if (cm_pageType & CMD_NEXT) { + if (cm_pageType & CMD_NEXT) { /* we have a next page, refresh with next page number */ - cm_refresh(cm_currPage+1, cm_curr_LCol); - } + cm_refresh(cm_currPage + 1, cm_curr_LCol); + } - return(0); + return (0); } /*----------------------------------------------------------------------- @@ -2719,15 +2777,15 @@ Switch_cm_next() int Switch_cm_last() { - static char rn[] = "Switch_cm_last"; + static char rn[] = "Switch_cm_last"; - if (cm_pageType & CMD_NEXT) { + if (cm_pageType & CMD_NEXT) { /* we have a next page, refresh with last page number */ cm_refresh(cm_numPages, cm_curr_LCol); - } + } - return(0); + return (0); } /*----------------------------------------------------------------------- @@ -2739,13 +2797,13 @@ Switch_cm_last() int Switch_cm_prev() { - static char rn[] = "Switch_cm_prev"; + static char rn[] = "Switch_cm_prev"; - if (cm_pageType & CMD_PREV) { + if (cm_pageType & CMD_PREV) { /* we have a previous page, refresh to previous page */ - cm_refresh(cm_currPage-1, cm_curr_LCol); - } - return(0); + cm_refresh(cm_currPage - 1, cm_curr_LCol); + } + return (0); } /*----------------------------------------------------------------------- @@ -2757,13 +2815,13 @@ Switch_cm_prev() int Switch_cm_first() { - static char rn[] = "Switch_cm_first"; + static char rn[] = "Switch_cm_first"; - if (cm_pageType & CMD_PREV) { + if (cm_pageType & CMD_PREV) { /* we have a previous page, refresh to first page */ cm_refresh(1, cm_curr_LCol); - } - return(0); + } + return (0); } /*----------------------------------------------------------------------- @@ -2775,13 +2833,13 @@ Switch_cm_first() int Switch_cm_left() { - static char rn[] = "Switch_cm_left"; + static char rn[] = "Switch_cm_left"; - if (cm_pageType & CMD_LEFT) { + if (cm_pageType & CMD_LEFT) { /* we have columns on left, refresh with new column number */ cm_refresh(cm_currPage, cm_curr_LCol - cm_cols_perPage); - } - return(0); + } + return (0); } @@ -2794,13 +2852,13 @@ Switch_cm_left() int Switch_cm_leftmost() { - static char rn[] = "Switch_cm_leftmost"; + static char rn[] = "Switch_cm_leftmost"; - if (cm_pageType & CMD_LEFT) { + if (cm_pageType & CMD_LEFT) { /* we have columns on left, go to the first column */ cm_refresh(cm_currPage, 0); - } - return(0); + } + return (0); } /*----------------------------------------------------------------------- @@ -2812,13 +2870,13 @@ Switch_cm_leftmost() int Switch_cm_right() { - static char rn[] = "Switch_cm_right"; + static char rn[] = "Switch_cm_right"; - if (cm_pageType & CMD_RIGHT) { + if (cm_pageType & CMD_RIGHT) { /* we have columns on right, refresh with new column number */ cm_refresh(cm_currPage, cm_curr_LCol + cm_cols_perPage); - } - return(0); + } + return (0); } /*----------------------------------------------------------------------- @@ -2830,19 +2888,20 @@ Switch_cm_right() int Switch_cm_rightmost() { - static char rn[] = "Switch_cm_rightmost"; - int curr_LCol; + static char rn[] = "Switch_cm_rightmost"; + int curr_LCol; - if (cm_pageType & CMD_RIGHT) { + if (cm_pageType & CMD_RIGHT) { /* we have columns on right, go to the last column */ - if (cm_numCols % cm_cols_perPage) - curr_LCol = (cm_numCols / cm_cols_perPage) * cm_cols_perPage; - else - curr_LCol = ((cm_numCols / cm_cols_perPage)-1) * cm_cols_perPage; + if (cm_numCols % cm_cols_perPage) + curr_LCol = (cm_numCols / cm_cols_perPage) * cm_cols_perPage; + else + curr_LCol = + ((cm_numCols / cm_cols_perPage) - 1) * cm_cols_perPage; cm_refresh(cm_currPage, curr_LCol); - } - return(0); + } + return (0); } @@ -2864,258 +2923,278 @@ Switch_cm_rightmost() int create_CMframe_objects() -{ /* create_CMframe_objects */ - static char rn[] = "create_CMframe_objects"; - struct ServerInfo_line *cm_lines_Ptr; - struct onode **cm_data_o_Ptr; - struct onode **cmLabels_o_Ptr; - int x_pos; - int y_pos; - int code; - int i; - int j; - int numBytes; - int arrIdx; +{ /* create_CMframe_objects */ + static char rn[] = "create_CMframe_objects"; + struct ServerInfo_line *cm_lines_Ptr; + struct onode **cm_data_o_Ptr; + struct onode **cmLabels_o_Ptr; + int x_pos; + int y_pos; + int code; + int i; + int j; + int numBytes; + int arrIdx; if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); } - /* create the command line object */ - cm_cmd_o = initLightObject("Command [oview, fs, prev, next, left, right] ? ", - 0,maxY-1,FC_CMD_O_WIDTH,afsmon_win); - if (cm_cmd_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create cm command onode\n",rn); + /* create the command line object */ + cm_cmd_o = + initLightObject("Command [oview, fs, prev, next, left, right] ? ", 0, + maxY - 1, FC_CMD_O_WIDTH, afsmon_win); + if (cm_cmd_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create cm command onode\n", rn); afsmon_Exit(420); - } - code = gtxframe_AddToList(cmFrame,cm_cmd_o); - code = gator_light_set(cm_cmd_o,HIGHLIGHT); + } + code = gtxframe_AddToList(cmFrame, cm_cmd_o); + code = gator_light_set(cm_cmd_o, HIGHLIGHT); - /* we already have the dimensions for the frame - same as the ovw frame */ - /* use the ovw program name object for the cm screen too */ + /* we already have the dimensions for the frame - same as the ovw frame */ + /* use the ovw program name object for the cm screen too */ - code = gtxframe_AddToList(cmFrame, ovw_progName_o); + code = gtxframe_AddToList(cmFrame, ovw_progName_o); - /* create the page number object */ - cm_pageNum_o = initLightObject("[Cache Managers, p. X of X, c. Y of Y]", - maxX-FC_PAGENUM_O_WIDTH,0,FC_PAGENUM_O_WIDTH,afsmon_win); - if (cm_pageNum_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create pageNumber onode\n",rn); + /* create the page number object */ + cm_pageNum_o = + initLightObject("[Cache Managers, p. X of X, c. Y of Y]", + maxX - FC_PAGENUM_O_WIDTH, 0, FC_PAGENUM_O_WIDTH, + afsmon_win); + if (cm_pageNum_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn); afsmon_Exit(415); - } - code = gtxframe_AddToList(cmFrame,cm_pageNum_o); - code = gator_light_set(cm_pageNum_o,HIGHLIGHT); - - /* create the probe number object */ - cm_probeNum_o = initLightObject("[CM probes 1, freq=30 sec]", - maxX-FC_PROBENUM_O_WIDTH ,maxY-1, FC_PROBENUM_O_WIDTH, afsmon_win); - if (cm_probeNum_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create cm probeNum onode\n",rn); + } + code = gtxframe_AddToList(cmFrame, cm_pageNum_o); + code = gator_light_set(cm_pageNum_o, HIGHLIGHT); + + /* create the probe number object */ + cm_probeNum_o = + initLightObject("[CM probes 1, freq=30 sec]", + maxX - FC_PROBENUM_O_WIDTH, maxY - 1, + FC_PROBENUM_O_WIDTH, afsmon_win); + if (cm_probeNum_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create cm probeNum onode\n", rn); afsmon_Exit(425); - } - code = gtxframe_AddToList(cmFrame,cm_probeNum_o); - code = gator_light_set(cm_probeNum_o,HIGHLIGHT); - - - /* create the numCM monitored object */ - cm_numCM_o = initLightObject( - " 0 Cache Mangers monitored, 0 alerts on 0 machines", - 4,2,FC_NUMHOSTS_O_WIDTH,afsmon_win); - if (cm_numCM_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create numCM onode for the cm frame\n", - rn); + } + code = gtxframe_AddToList(cmFrame, cm_probeNum_o); + code = gator_light_set(cm_probeNum_o, HIGHLIGHT); + + + /* create the numCM monitored object */ + cm_numCM_o = + initLightObject + (" 0 Cache Mangers monitored, 0 alerts on 0 machines", 4, 2, + FC_NUMHOSTS_O_WIDTH, afsmon_win); + if (cm_numCM_o == NULL) { + sprintf(errMsg, + "[ %s ] Failed to create numCM onode for the cm frame\n", rn); afsmon_Exit(430); - } - code = gtxframe_AddToList(cmFrame,cm_numCM_o); - - /* create the "more columns to left" indicator */ - cm_leftArrows_o = initLightObject("<<<", 0,2,FC_ARROWS_O_WIDTH, afsmon_win); - if (cm_leftArrows_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create leftArrows onode for the cm frame\n", rn); + } + code = gtxframe_AddToList(cmFrame, cm_numCM_o); + + /* create the "more columns to left" indicator */ + cm_leftArrows_o = + initLightObject("<<<", 0, 2, FC_ARROWS_O_WIDTH, afsmon_win); + if (cm_leftArrows_o == NULL) { + sprintf(errMsg, + "[ %s ] Failed to create leftArrows onode for the cm frame\n", + rn); afsmon_Exit(435); - } - code = gtxframe_AddToList(cmFrame,cm_leftArrows_o); - - /* create the "more columns to right" indicator */ - cm_rightArrows_o = initLightObject(">>>", maxX-FC_ARROWS_O_WIDTH, 2, - FC_ARROWS_O_WIDTH, afsmon_win); - if (cm_rightArrows_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create rightArrows onode for the cm frame\n", rn); + } + code = gtxframe_AddToList(cmFrame, cm_leftArrows_o); + + /* create the "more columns to right" indicator */ + cm_rightArrows_o = + initLightObject(">>>", maxX - FC_ARROWS_O_WIDTH, 2, FC_ARROWS_O_WIDTH, + afsmon_win); + if (cm_rightArrows_o == NULL) { + sprintf(errMsg, + "[ %s ] Failed to create rightArrows onode for the cm frame\n", + rn); afsmon_Exit(440); - } - code = gtxframe_AddToList(cmFrame,cm_rightArrows_o); + } + code = gtxframe_AddToList(cmFrame, cm_rightArrows_o); - /* calculate the maximum number of hosts per page (2 rows per host) */ - cm_numHosts_perPage = (maxY - FC_NUM_FIXED_LINES) / 2; + /* calculate the maximum number of hosts per page (2 rows per host) */ + cm_numHosts_perPage = (maxY - FC_NUM_FIXED_LINES) / 2; - /* determine the number of data columns that can fit in a page */ - cm_cols_perPage = (maxX - FC_HOSTNAME_O_WIDTH ) / (FC_COLUMN_WIDTH); + /* determine the number of data columns that can fit in a page */ + cm_cols_perPage = (maxX - FC_HOSTNAME_O_WIDTH) / (FC_COLUMN_WIDTH); - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] cm_numHosts_perPage=%d cm_cols_perPage=%d\n", - rn,cm_numHosts_perPage, cm_cols_perPage); + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] cm_numHosts_perPage=%d cm_cols_perPage=%d\n", + rn, cm_numHosts_perPage, cm_cols_perPage); fflush(debugFD); - } + } - /* the above two variables give us the information needed to create - the objects for displaying the file server information */ + /* the above two variables give us the information needed to create + * the objects for displaying the file server information */ - /* allocate memory for all the onode pointers required to display - the file server statistics */ + /* allocate memory for all the onode pointers required to display + * the file server statistics */ - numBytes = cm_numHosts_perPage * sizeof(struct ServerInfo_line); - cm_lines = (struct ServerInfo_line *) malloc(numBytes); - if (cm_lines == (struct ServerInfo_line *)0) { - sprintf(errMsg,"[ %s ] Failed to allocate %d bytes for CM data lines\n", - rn, numBytes); + numBytes = cm_numHosts_perPage * sizeof(struct ServerInfo_line); + cm_lines = (struct ServerInfo_line *)malloc(numBytes); + if (cm_lines == (struct ServerInfo_line *)0) { + sprintf(errMsg, + "[ %s ] Failed to allocate %d bytes for CM data lines\n", rn, + numBytes); afsmon_Exit(445); - } - - /* for each line of server statistics allocate memory to store two arrays - of data onodes */ - - cm_lines_Ptr = cm_lines; - for(i=0; idata_o[arrIdx] = (struct onode **) malloc(numBytes); - if (cm_lines_Ptr->data_o[arrIdx] == (struct onode **)0) { - sprintf(errMsg,"[ %s ] Failed to allocate %d bytes for CM data onodes\n", - rn, numBytes); - afsmon_Exit(450); + } + + /* for each line of server statistics allocate memory to store two arrays + * of data onodes */ + + cm_lines_Ptr = cm_lines; + for (i = 0; i < cm_numHosts_perPage; i++) { + for (arrIdx = 0; arrIdx < 2; arrIdx++) { + numBytes = cm_cols_perPage * sizeof(struct onode *); + cm_lines_Ptr->data_o[arrIdx] = (struct onode **)malloc(numBytes); + if (cm_lines_Ptr->data_o[arrIdx] == NULL) { + sprintf(errMsg, + "[ %s ] Failed to allocate %d bytes for CM data onodes\n", + rn, numBytes); + afsmon_Exit(450); + } } - } - cm_lines_Ptr++; - } + cm_lines_Ptr++; + } - /* now allocate the onodes itself */ + /* now allocate the onodes itself */ - cm_lines_Ptr = cm_lines; - for(i=0; ihost_o = initLightObject("CMHostName", - 0,FC_FIRST_HOST_ROW + 2*i, FC_HOSTNAME_O_WIDTH, afsmon_win); - if (cm_lines_Ptr->host_o == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create an CM name onode\n",rn); - afsmon_Exit(455); - } - code = gtxframe_AddToList(cmFrame, cm_lines_Ptr->host_o); + cm_lines_Ptr->host_o = + initLightObject("CMHostName", 0, FC_FIRST_HOST_ROW + 2 * i, + FC_HOSTNAME_O_WIDTH, afsmon_win); + if (cm_lines_Ptr->host_o == NULL) { + sprintf(errMsg, "[ %s ] Failed to create an CM name onode\n", rn); + afsmon_Exit(455); + } + code = gtxframe_AddToList(cmFrame, cm_lines_Ptr->host_o); /* if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Addr of host_o = %d for line %d\n", - rn,cm_lines_Ptr->host_o,i); - fflush(debugFD); - } */ + * fprintf(debugFD,"[ %s ] Addr of host_o = %d for line %d\n", + * rn,cm_lines_Ptr->host_o,i); + * fflush(debugFD); + * } */ /* initialize data onodes for this host */ - for(arrIdx=0; arrIdx<2; arrIdx++) { /* for each array index */ + for (arrIdx = 0; arrIdx < 2; arrIdx++) { /* for each array index */ - cm_data_o_Ptr = cm_lines_Ptr->data_o[arrIdx]; - for(j=0; jdata_o[arrIdx]; + for (j = 0; j < cm_cols_perPage; j++) { /* for each column */ char tmpBuf[20]; /* determine x & y coordinate for this data object */ /* the 1's are for leaving a blank after each column */ x_pos = FC_HOSTNAME_O_WIDTH + (j * (FC_COLUMN_WIDTH)); - y_pos = FC_FIRST_HOST_ROW + 2*i + arrIdx; - - sprintf(tmpBuf,"-CMData %d-",arrIdx); - *cm_data_o_Ptr = initLightObject(tmpBuf, - x_pos, y_pos, FC_COLUMN_WIDTH, afsmon_win); - if (*cm_data_o_Ptr == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create an CM data onode\n",rn); - afsmon_Exit(460); + y_pos = FC_FIRST_HOST_ROW + 2 * i + arrIdx; + + sprintf(tmpBuf, "-CMData %d-", arrIdx); + *cm_data_o_Ptr = + initLightObject(tmpBuf, x_pos, y_pos, FC_COLUMN_WIDTH, + afsmon_win); + if (*cm_data_o_Ptr == NULL) { + sprintf(errMsg, + "[ %s ] Failed to create an CM data onode\n", rn); + afsmon_Exit(460); } - code = gtxframe_AddToList(cmFrame, *cm_data_o_Ptr); + code = gtxframe_AddToList(cmFrame, *cm_data_o_Ptr); cm_data_o_Ptr++; - } /* for each column */ - } /* for each onode array index */ + } /* for each column */ + } /* for each onode array index */ - cm_lines_Ptr++; - } /* for each host slot */ + cm_lines_Ptr++; + } /* for each host slot */ - /* INITIALIZE COLUMN LABELS */ + /* INITIALIZE COLUMN LABELS */ - /* allocate memory for two arrays of onode pointers for file server column - labels */ - for( arrIdx=0; arrIdx < 3; arrIdx++) { + /* allocate memory for two arrays of onode pointers for file server column + * labels */ + for (arrIdx = 0; arrIdx < 3; arrIdx++) { - cmLabels_o[arrIdx] = (struct onode **) malloc( - sizeof(struct onode *) * cm_cols_perPage); - if (cmLabels_o[arrIdx] == (struct onode **)0) { - sprintf(errMsg,"[ %s ] Failed to allocate memory for CM label onodes\n", - rn); - afsmon_Exit(465); - } - - /* create cache manager name objects */ - cmLabels_o_Ptr = cmLabels_o[arrIdx]; - for (i=0; i< cm_cols_perPage; i++) { - *cmLabels_o_Ptr = initLightObject("", - FC_HOSTNAME_O_WIDTH + i * FC_COLUMN_WIDTH, - FC_FIRST_LABEL_ROW + arrIdx, - FC_COLUMN_WIDTH,afsmon_win); - - if (*cmLabels_o_Ptr == (struct onode *)0) { - sprintf(errMsg,"[ %s ] Failed to create a CM label onode\n",rn); + cmLabels_o[arrIdx] = + (struct onode **)malloc(sizeof(struct onode *) * cm_cols_perPage); + if (cmLabels_o[arrIdx] == NULL) { + sprintf(errMsg, + "[ %s ] Failed to allocate memory for CM label onodes\n", + rn); + afsmon_Exit(465); + } + + /* create cache manager name objects */ + cmLabels_o_Ptr = cmLabels_o[arrIdx]; + for (i = 0; i < cm_cols_perPage; i++) { + *cmLabels_o_Ptr = + initLightObject("", FC_HOSTNAME_O_WIDTH + i * FC_COLUMN_WIDTH, + FC_FIRST_LABEL_ROW + arrIdx, FC_COLUMN_WIDTH, + afsmon_win); + + if (*cmLabels_o_Ptr == NULL) { + sprintf(errMsg, "[ %s ] Failed to create a CM label onode\n", + rn); afsmon_Exit(470); - } - code = gtxframe_AddToList(cmFrame,*cmLabels_o_Ptr); - cmLabels_o_Ptr++; - } + } + code = gtxframe_AddToList(cmFrame, *cmLabels_o_Ptr); + cmLabels_o_Ptr++; + } - } + } - /* initialize the column & page counters */ + /* initialize the column & page counters */ - cm_currPage = 1; - cm_numCols = cm_DisplayItems_count; - cm_numPages = numCM / cm_numHosts_perPage; - if (numCM % cm_numHosts_perPage) + cm_currPage = 1; + cm_numCols = cm_DisplayItems_count; + cm_numPages = numCM / cm_numHosts_perPage; + if (numCM % cm_numHosts_perPage) cm_numPages++; - cm_curr_LCol = 0; /* leftmost col */ - cm_curr_RCol = 0; /* rightmost col */ + cm_curr_LCol = 0; /* leftmost col */ + cm_curr_RCol = 0; /* rightmost col */ - /* create keyboard bindings */ - /* bind Q and  to exit */ - keymap_BindToString(cmFrame->keymap,"Q",afsmonExit_gtx,(char *)0,(char *)0); - keymap_BindToString(cmFrame->keymap,"",afsmonExit_gtx,(char *)0,(char *)0); + /* create keyboard bindings */ + /* bind Q and  to exit */ + keymap_BindToString(cmFrame->keymap, "Q", afsmonExit_gtx, NULL, NULL); + keymap_BindToString(cmFrame->keymap, "", afsmonExit_gtx, NULL, NULL); - /* o = overview, c = cm, n = next, p = prev, l = left, r = right - N = last page, P = first page, L = leftmost col, R = rightmost col */ + /* o = overview, c = cm, n = next, p = prev, l = left, r = right + * N = last page, P = first page, L = leftmost col, R = rightmost col */ - keymap_BindToString(cmFrame->keymap,"o",Switch_cm_2_ovw,(char *)0,(char *)0); - keymap_BindToString(cmFrame->keymap,"f",Switch_cm_2_fs,(char *)0,(char *)0); - keymap_BindToString(cmFrame->keymap,"n",Switch_cm_next,(char *)0,(char *)0); - keymap_BindToString(cmFrame->keymap,"N",Switch_cm_last,(char *)0,(char *)0); - keymap_BindToString(cmFrame->keymap,"p",Switch_cm_prev,(char *)0,(char *)0); - keymap_BindToString(cmFrame->keymap,"P",Switch_cm_first,(char *)0,(char *)0); - keymap_BindToString(cmFrame->keymap,"l",Switch_cm_left,(char *)0,(char *)0); - keymap_BindToString(cmFrame->keymap,"L",Switch_cm_leftmost,(char *)0,(char *)0); - keymap_BindToString(cmFrame->keymap,"r",Switch_cm_right,(char *)0,(char *)0); - keymap_BindToString(cmFrame->keymap,"R",Switch_cm_rightmost,(char *)0,(char *)0); + keymap_BindToString(cmFrame->keymap, "o", Switch_cm_2_ovw, NULL, NULL); + keymap_BindToString(cmFrame->keymap, "f", Switch_cm_2_fs, NULL, NULL); + keymap_BindToString(cmFrame->keymap, "n", Switch_cm_next, NULL, NULL); + keymap_BindToString(cmFrame->keymap, "N", Switch_cm_last, NULL, NULL); + keymap_BindToString(cmFrame->keymap, "p", Switch_cm_prev, NULL, NULL); + keymap_BindToString(cmFrame->keymap, "P", Switch_cm_first, NULL, NULL); + keymap_BindToString(cmFrame->keymap, "l", Switch_cm_left, NULL, NULL); + keymap_BindToString(cmFrame->keymap, "L", Switch_cm_leftmost, NULL, NULL); + keymap_BindToString(cmFrame->keymap, "r", Switch_cm_right, NULL, NULL); + keymap_BindToString(cmFrame->keymap, "R", Switch_cm_rightmost, NULL, + NULL); - return(0); -} /* create_CMframe_objects */ + return (0); +} /* create_CMframe_objects */ @@ -3127,75 +3206,74 @@ create_CMframe_objects() * for the overview, File Servers & Cache Managers screens. *----------------------------------------------------------------------*/ int -gtx_initialize() -{ /* gtx_initialize */ - static char rn[] = "gtx_initialize"; /* routine name */ - int code; +gtx_initialize() +{ /* gtx_initialize */ + static char rn[] = "gtx_initialize"; /* routine name */ + int code; if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); } - afsmon_win = gtx_Init(0,-1); /* 0 => dont start input server, - 1 => use curses */ - if(afsmon_win == (struct gwin *)0) { - sprintf(errMsg,"[ %s ] gtx initialization failed\n",rn); + afsmon_win = gtx_Init(0, -1); /* 0 => dont start input server, + * 1 => use curses */ + if (afsmon_win == NULL) { + sprintf(errMsg, "[ %s ] gtx initialization failed\n", rn); afsmon_Exit(475); - } - gtx_initialized = 1; + } + gtx_initialized = 1; - /* Create the Overview frame */ + /* Create the Overview frame */ - ovwFrame = gtxframe_Create(); - if (ovwFrame == (struct gtx_frame *)0) { - sprintf(errMsg,"[ %s ] Failed to create overview frame\n",rn); + ovwFrame = gtxframe_Create(); + if (ovwFrame == (struct gtx_frame *)0) { + sprintf(errMsg, "[ %s ] Failed to create overview frame\n", rn); afsmon_Exit(480); - } + } - /* bind the overview frame to the window */ - gtxframe_SetFrame(afsmon_win,ovwFrame); + /* bind the overview frame to the window */ + gtxframe_SetFrame(afsmon_win, ovwFrame); - /* create overview frame objects */ - code = create_ovwFrame_objects(); - if (code) { - sprintf(errMsg,"[ %s ] Error in creating ovw frame objects\n",rn); + /* create overview frame objects */ + code = create_ovwFrame_objects(); + if (code) { + sprintf(errMsg, "[ %s ] Error in creating ovw frame objects\n", rn); afsmon_Exit(485); - } + } - /* Create the File Server frame */ - fsFrame = gtxframe_Create(); - if (fsFrame == (struct gtx_frame *)0) { - sprintf(errMsg,"[ %s ] Failed to create file server frame\n",rn); + /* Create the File Server frame */ + fsFrame = gtxframe_Create(); + if (fsFrame == (struct gtx_frame *)0) { + sprintf(errMsg, "[ %s ] Failed to create file server frame\n", rn); afsmon_Exit(490); - } + } - /* Create File Server frame objects */ - code = create_FSframe_objects(); - if (code) { - sprintf(errMsg,"[ %s ] Error in creating FS frame objects\n",rn); + /* Create File Server frame objects */ + code = create_FSframe_objects(); + if (code) { + sprintf(errMsg, "[ %s ] Error in creating FS frame objects\n", rn); afsmon_Exit(495); - } + } - /* Create the Cache Managers frame */ - cmFrame = gtxframe_Create(); - if (cmFrame == (struct gtx_frame *)0) { - sprintf(errMsg,"[ %s ] Failed to create Cache Managers frame\n",rn); + /* Create the Cache Managers frame */ + cmFrame = gtxframe_Create(); + if (cmFrame == (struct gtx_frame *)0) { + sprintf(errMsg, "[ %s ] Failed to create Cache Managers frame\n", rn); afsmon_Exit(500); - } + } - /* Create Cache Managers frame objects */ - code = create_CMframe_objects(); - if (code) { - sprintf(errMsg,"[ %s ] Error in creating CM frame objects\n",rn); + /* Create Cache Managers frame objects */ + code = create_CMframe_objects(); + if (code) { + sprintf(errMsg, "[ %s ] Error in creating CM frame objects\n", rn); afsmon_Exit(505); - } - - /* misc initializations */ - sprintf(blankline,"%255s"," "); + } - return (0); -} /* gtx_initialize */ + /* misc initializations */ + sprintf(blankline, "%255s", " "); + return (0); +} /* gtx_initialize */ diff --git a/src/afsmonitor/afsmonitor.c b/src/afsmonitor/afsmonitor.c index a83a34f29..92d41027c 100644 --- a/src/afsmonitor/afsmonitor.c +++ b/src/afsmonitor/afsmonitor.c @@ -18,7 +18,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/afsmonitor/afsmonitor.c,v 1.1.1.10 2004/01/10 20:55:53 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afsmonitor/afsmonitor.c,v 1.15 2003/10/24 06:26:06 shadow Exp $"); #include #include @@ -35,21 +36,21 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afsmonitor/afsmonitor.c,v 1.1.1.10 2004 #endif #include -#include /*Generic window package*/ -#include /*Object definitions*/ +#include /*Generic window package */ +#include /*Object definitions */ #if 0 -#include /*Text object interface*/ +#include /*Text object interface */ #endif -#include /*Light object interface*/ -#include /*Curses window package*/ -#include /*Dumb terminal window package*/ -#include /*X11 window package*/ -#include /*Frame package*/ +#include /*Light object interface */ +#include /*Curses window package */ +#include /*Dumb terminal window package */ +#include /*X11 window package */ +#include /*Frame package */ -#include -#include +#include +#include #include "afsmonitor.h" @@ -71,14 +72,14 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afsmonitor/afsmonitor.c,v 1.1.1.10 2004 int afsmon_debug = 0; /* debug info to file ? */ FILE *debugFD; /* debugging file descriptor */ static int afsmon_output = 0; /* output to file ? */ -static int afsmon_detOutput = 0; /* detailed output ? */ +static int afsmon_detOutput = 0; /* detailed output ? */ static int afsmon_onceOnly = 0; /* probe once only ? (not implemented) */ int afsmon_probefreq; /* probe frequency */ static int wpkg_to_use; /* graphics package to use */ -static char output_filename[80];/* output filename */ -char errMsg[256]; /* buffers used to print error messages after*/ -char errMsg1[256]; /* gtx is initialized (stderr/stdout gone !) */ -int num_bufSlots = 0; /* number of slots in fs & cm circular buffers*/ +static char output_filename[80]; /* output filename */ +char errMsg[256]; /* buffers used to print error messages after */ +char errMsg1[256]; /* gtx is initialized (stderr/stdout gone !) */ +int num_bufSlots = 0; /* number of slots in fs & cm circular buffers */ /* Flags used to process "show" directives in config file */ short fs_showFlags[NUM_FS_STAT_ENTRIES]; @@ -95,11 +96,11 @@ short cm_showFlags[NUM_CM_STAT_ENTRIES]; #define NUM_XSTAT_FS_AFS_PERFSTATS_LONGS 66 /* number of fields (longs) in struct afs_PerfStats that we display */ -#define NUM_AFS_STATS_CMPERF_LONGS 40 /* number of longs in struct afs_stats_CMPerf excluding up/down stats and fields we dont display */ - +#define NUM_AFS_STATS_CMPERF_LONGS 40 /* number of longs in struct afs_stats_CMPerf excluding up/down stats and fields we dont display */ + /* variables used for exec'ing user provided threshold handlers */ -char *fsHandler_argv[20]; /* *argv[] for the handler */ +char *fsHandler_argv[20]; /* *argv[] for the handler */ char fsHandler_args[20][256]; /* buffer space for arguments */ int exec_fsThreshHandler = 0; /* execute fs threshold handler ? */ @@ -130,28 +131,28 @@ static struct afsmon_hostEntry *last_hostEntry; /* names of the last host processed in the config file */ static char last_fsHost[HOST_NAME_LEN]; static char last_cmHost[HOST_NAME_LEN]; -static lastHostType = 0; /* 0 = no host entries processed - 1 = last host was file server - 2 = last host was cache manager. */ +static lastHostType = 0; /* 0 = no host entries processed + * 1 = last host was file server + * 2 = last host was cache manager. */ /* FILE SERVER CIRCULAR BUFFER VARIABLES */ struct afsmon_fs_Results_list { - struct xstat_fs_ProbeResults *fsResults; /* ptr to results struct*/ - int empty; /* fsResults empty ? */ - struct afsmon_fs_Results_list *next; + struct xstat_fs_ProbeResults *fsResults; /* ptr to results struct */ + int empty; /* fsResults empty ? */ + struct afsmon_fs_Results_list *next; }; struct afsmon_fs_Results_CBuffer { - int probeNum; /* probe number of entries in this slot */ - struct afsmon_fs_Results_list *list; /* ptr to list of results */ + int probeNum; /* probe number of entries in this slot */ + struct afsmon_fs_Results_list *list; /* ptr to list of results */ }; /* buffer for FS probe results */ struct afsmon_fs_Results_CBuffer *afsmon_fs_ResultsCB; -int afsmon_fs_curr_CBindex = 0; /* current fs CB slot */ +int afsmon_fs_curr_CBindex = 0; /* current fs CB slot */ /* Probe number variables. The current probe number is incremented when the first probe from a new probe cycle is received. The prev probe @@ -166,20 +167,20 @@ int afsmon_fs_prev_probeNum = 0; /* previous fs probe number */ /* CACHE MANAGER CIRCULAR BUFFER VARIABLES */ struct afsmon_cm_Results_list { - struct xstat_cm_ProbeResults *cmResults; /* ptr to results struct*/ - int empty; /* cmResults empty ? */ - struct afsmon_cm_Results_list *next; + struct xstat_cm_ProbeResults *cmResults; /* ptr to results struct */ + int empty; /* cmResults empty ? */ + struct afsmon_cm_Results_list *next; }; struct afsmon_cm_Results_CBuffer { - int probeNum; /* probe number of entries in this slot */ - struct afsmon_cm_Results_list *list; /* ptr to list of results */ + int probeNum; /* probe number of entries in this slot */ + struct afsmon_cm_Results_list *list; /* ptr to list of results */ }; /* buffer for CM probe results */ struct afsmon_cm_Results_CBuffer *afsmon_cm_ResultsCB; -int afsmon_cm_curr_CBindex = 0; /* current cm CB slot */ +int afsmon_cm_curr_CBindex = 0; /* current cm CB slot */ /* Probe number variables. The current probe number is incremented @@ -188,29 +189,29 @@ number is incremented when the last probe of the current cycle is received. This difference is because of the purpose for which these counters are used */ -int afsmon_cm_curr_probeNum = 1; /* current cm probe number */ -int afsmon_cm_prev_probeNum = 0; /* previous cm probe number */ +int afsmon_cm_curr_probeNum = 1; /* current cm probe number */ +int afsmon_cm_prev_probeNum = 0; /* previous cm probe number */ /* Structures to hold FS & CM results in string format(suitable for display ) */ -/* ptr to array holding the results of FS probes in ascii format */ +/* ptr to array holding the results of FS probes in ascii format */ /* for current probe cycle */ struct fs_Display_Data *curr_fsData = (struct fs_Display_Data *)0; /* for previous probe cycle */ struct fs_Display_Data *prev_fsData = (struct fs_Display_Data *)0; -/* ptr to array holding the results of CM probes in ascii format */ +/* ptr to array holding the results of CM probes in ascii format */ /* for current probe cycle */ struct cm_Display_Data *curr_cmData = (struct cm_Display_Data *)0; /* for previous probe cycle */ -struct cm_Display_Data *prev_cmData = (struct cm_Display_Data *)0; +struct cm_Display_Data *prev_cmData = (struct cm_Display_Data *)0; /* EXTERN DEFINITIONS */ -extern struct hostent *hostutil_GetHostByName(); +extern struct hostent *hostutil_GetHostByName(); @@ -243,7 +244,7 @@ data is available for updating the display */ extern fs_Data_Available; extern cm_Data_Available; -extern int gtx_initialized; /* gtx initialized ? */ +extern int gtx_initialized; /* gtx initialized ? */ /* This array contains the indices of the file server data items that are to be displayed on the File Servers screen. For example, suppose the @@ -255,24 +256,24 @@ items in the fs_varNames[] array */ short fs_Display_map[XSTAT_FS_FULLPERF_RESULTS_LEN]; int fs_DisplayItems_count = 0; /* number of items to display */ -int fs_showDefault = 1; /* show all of FS data ? */ +int fs_showDefault = 1; /* show all of FS data ? */ /* same use as above for Cache Managers */ short cm_Display_map[XSTAT_CM_FULLPERF_RESULTS_LEN]; int cm_DisplayItems_count = 0; /* number of items to display */ -int cm_showDefault = 1; /* show all of CM data ? */ +int cm_showDefault = 1; /* show all of CM data ? */ -extern int fs_currPage; /* current page number in the File Servers frame */ -extern int fs_curr_LCol; /* current leftmost column on display on FS frame */ +extern int fs_currPage; /* current page number in the File Servers frame */ +extern int fs_curr_LCol; /* current leftmost column on display on FS frame */ -extern int cm_currPage; /* current page number in the Cache Managers frame */ -extern int cm_curr_LCol; /* current leftmost column on display on CM frame */ +extern int cm_currPage; /* current page number in the Cache Managers frame */ +extern int cm_curr_LCol; /* current leftmost column on display on CM frame */ /* File server and Cache manager data is classified into sections & groups to help the user choose what he wants displayed */ -extern char *fs_categories[]; /* file server data category names */ -extern char *cm_categories[]; /* cache manager data category names */ +extern char *fs_categories[]; /* file server data category names */ +extern char *cm_categories[]; /* cache manager data category names */ @@ -285,48 +286,50 @@ extern char *cm_categories[]; /* cache manager data category names */ config file to be case insensitive. */ -char *strcasestr(s1,s2) -char *s1; -char *s2; +char * +strcasestr(s1, s2) + char *s1; + char *s2; { - char *ptr; - int len1,len2; + char *ptr; + int len1, len2; - len1 = strlen(s1); - len2 = strlen(s2); + len1 = strlen(s1); + len2 = strlen(s2); - if ( len1 < len2) - return ((char *)NULL); + if (len1 < len2) + return ((char *)NULL); - ptr = s1; + ptr = s1; - while( len1 >= len2 && len1 > 0 ) { - if ( (strncasecmp(ptr,s2,len2)) == 0) - return (ptr); - ptr++; - len1--; - } - return ((char *)NULL); + while (len1 >= len2 && len1 > 0) { + if ((strncasecmp(ptr, s2, len2)) == 0) + return (ptr); + ptr++; + len1--; + } + return ((char *)NULL); } #endif -struct hostent *GetHostByName(name) -char *name; +struct hostent * +GetHostByName(name) + char *name; { - struct hostent *he; + struct hostent *he; #ifdef AFS_SUN5_ENV - char ip_addr[32]; + char ip_addr[32]; #endif - - he = gethostbyname(name); + + he = gethostbyname(name); #ifdef AFS_SUN5_ENV - /* On solaris the above does not resolve hostnames to full names */ - if (he != (struct hostent *)0) { - memcpy(ip_addr, he->h_addr, he->h_length); - he = gethostbyaddr(ip_addr, he->h_length, he->h_addrtype); - } + /* On solaris the above does not resolve hostnames to full names */ + if (he != NULL) { + memcpy(ip_addr, he->h_addr, he->h_length); + he = gethostbyaddr(ip_addr, he->h_length, he->h_addrtype); + } #endif - return(he); + return (he); } @@ -348,203 +351,205 @@ char *name; * *----------------------------------------------------------------------*/ -int -afsmon_Exit(a_exitVal) -int a_exitVal; /* exit code */ -{ /* afsmon_Exit */ - static char rn[] = "afsmon_Exit"; - struct afsmon_fs_Results_list *tmp_fslist; - struct afsmon_fs_Results_list *next_fslist; - struct xstat_fs_ProbeResults *tmp_xstat_fsPR; - struct afsmon_cm_Results_list *tmp_cmlist; - struct afsmon_cm_Results_list *next_cmlist; - struct xstat_cm_ProbeResults *tmp_xstat_cmPR; - struct afsmon_hostEntry *curr_hostEntry; - struct afsmon_hostEntry *prev_hostEntry; - int i; - int j; - int bufslot; - int code; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called with exit code %d\n",rn, a_exitVal); +int +afsmon_Exit(a_exitVal) + int a_exitVal; /* exit code */ +{ /* afsmon_Exit */ + static char rn[] = "afsmon_Exit"; + struct afsmon_fs_Results_list *tmp_fslist; + struct afsmon_fs_Results_list *next_fslist; + struct xstat_fs_ProbeResults *tmp_xstat_fsPR; + struct afsmon_cm_Results_list *tmp_cmlist; + struct afsmon_cm_Results_list *next_cmlist; + struct xstat_cm_ProbeResults *tmp_xstat_cmPR; + struct afsmon_hostEntry *curr_hostEntry; + struct afsmon_hostEntry *prev_hostEntry; + int i; + int j; + int bufslot; + int code; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called with exit code %d\n", rn, a_exitVal); fflush(debugFD); - } - - /* get out of curses first, but not if we are here to exec a threshold - handler. If we do, the screen gets messed up */ - if (gtx_initialized && ! exec_fsThreshHandler) + } + + /* get out of curses first, but not if we are here to exec a threshold + * handler. If we do, the screen gets messed up */ + if (gtx_initialized && !exec_fsThreshHandler) gator_cursesgwin_cleanup(afsmon_win); - - /* print the error message buffer */ - if (errMsg[0] != '\0') - fprintf(stderr,"%s",errMsg); - if (errMsg1[0] != '\0') - fprintf(stderr,"%s",errMsg1); - - /* deallocate file server circular buffers */ - if (numFS && num_bufSlots) { - if(afsmon_debug) { - fprintf(debugFD,"freeing FS circular buffers "); - fflush(debugFD); - } - - for (bufslot=0; bufslotnext; - tmp_xstat_fsPR = tmp_fslist->fsResults; + } + next_fslist = tmp_fslist->next; + tmp_xstat_fsPR = tmp_fslist->fsResults; - if (afsmon_debug) - fprintf(debugFD,"%d ",numFS-j); - - /* free xstat_fs_Results data */ - free(tmp_xstat_fsPR->data.AFS_CollData_val); - free(tmp_xstat_fsPR->connP); - free(tmp_xstat_fsPR); - - /* free the fs list item */ - free(tmp_fslist); - tmp_fslist = next_fslist; - - } /* while fs list items in this slot */ - } /* if entries in this buffer slot */ - } /* for each fs buffer slot */ - if (afsmon_debug) - fprintf(debugFD,"\n"); - } - - if (afsmon_debug) + if (afsmon_debug) + fprintf(debugFD, "%d ", numFS - j); + + /* free xstat_fs_Results data */ + free(tmp_xstat_fsPR->data.AFS_CollData_val); + free(tmp_xstat_fsPR->connP); + free(tmp_xstat_fsPR); + + /* free the fs list item */ + free(tmp_fslist); + tmp_fslist = next_fslist; + + } /* while fs list items in this slot */ + } /* if entries in this buffer slot */ + } /* for each fs buffer slot */ + if (afsmon_debug) + fprintf(debugFD, "\n"); + } + + if (afsmon_debug) fflush(debugFD); - /* deallocate cache manager curcular buffers */ - if (numCM && num_bufSlots) { - if (afsmon_debug) - fprintf(debugFD,"freeing CM curcular buffers "); - for (bufslot=0; bufslotnext; - tmp_xstat_cmPR = tmp_cmlist->cmResults; - - if (afsmon_debug) - fprintf(debugFD,"%d ",numCM-j); - /* make sure data is ok */ - /* Print_cm_FullPerfInfo(tmp_xstat_cmPR); */ - - /* free xstat_cm_Results data */ - free(tmp_xstat_cmPR->data.AFSCB_CollData_val); - free(tmp_xstat_cmPR->connP); - free(tmp_xstat_cmPR); - - /* free the cm list item */ - free(tmp_cmlist); - tmp_cmlist = next_cmlist; - - } /* while cm list items in this slot */ - } /* if entries in this buffer slot */ - } /* for each cm buffer slot */ - if (afsmon_debug) - fprintf(debugFD,"\n"); - } - - - /* deallocate FS & CM Print buffers */ - if (curr_fsData != (struct fs_Display_Data *)0) { - if (afsmon_debug) - fprintf(debugFD,"Deallocating FS Print Buffers .... curr"); + } + next_cmlist = tmp_cmlist->next; + tmp_xstat_cmPR = tmp_cmlist->cmResults; + + if (afsmon_debug) + fprintf(debugFD, "%d ", numCM - j); + /* make sure data is ok */ + /* Print_cm_FullPerfInfo(tmp_xstat_cmPR); */ + + /* free xstat_cm_Results data */ + free(tmp_xstat_cmPR->data.AFSCB_CollData_val); + free(tmp_xstat_cmPR->connP); + free(tmp_xstat_cmPR); + + /* free the cm list item */ + free(tmp_cmlist); + tmp_cmlist = next_cmlist; + + } /* while cm list items in this slot */ + } /* if entries in this buffer slot */ + } /* for each cm buffer slot */ + if (afsmon_debug) + fprintf(debugFD, "\n"); + } + + + /* deallocate FS & CM Print buffers */ + if (curr_fsData != (struct fs_Display_Data *)0) { + if (afsmon_debug) + fprintf(debugFD, "Deallocating FS Print Buffers .... curr"); free(curr_fsData); - } - if (prev_fsData != (struct fs_Display_Data *)0) { - if (afsmon_debug) - fprintf(debugFD,", prev \n"); + } + if (prev_fsData != (struct fs_Display_Data *)0) { + if (afsmon_debug) + fprintf(debugFD, ", prev \n"); free(prev_fsData); - } - if (prev_cmData != (struct cm_Display_Data *)0) { - if (afsmon_debug) - fprintf(debugFD,"Deallocating CM Print Buffers .... curr"); + } + if (prev_cmData != (struct cm_Display_Data *)0) { + if (afsmon_debug) + fprintf(debugFD, "Deallocating CM Print Buffers .... curr"); free(curr_cmData); - } - if (prev_cmData != (struct cm_Display_Data *)0) { - if (afsmon_debug) - fprintf(debugFD,", prev \n"); + } + if (prev_cmData != (struct cm_Display_Data *)0) { + if (afsmon_debug) + fprintf(debugFD, ", prev \n"); free(prev_cmData); - } - - /* deallocate hostEntry lists */ - if (numFS) { - if (afsmon_debug) - fprintf(debugFD,"Deallocating FS hostEntries .."); + } + + /* deallocate hostEntry lists */ + if (numFS) { + if (afsmon_debug) + fprintf(debugFD, "Deallocating FS hostEntries .."); curr_hostEntry = FSnameList; - for(i=0; ithresh != (struct Threshold *)0) - free(curr_hostEntry->thresh); - free(curr_hostEntry); - if (afsmon_debug) - fprintf(debugFD," %d",i); - curr_hostEntry = prev_hostEntry->next; - } - if (afsmon_debug) - fprintf(debugFD,"\n"); - } - if (numCM) { - if (afsmon_debug) - fprintf(debugFD,"Deallocating CM hostEntries .."); + for (i = 0; i < numFS; i++) { + prev_hostEntry = curr_hostEntry; + if (curr_hostEntry->thresh != NULL) + free(curr_hostEntry->thresh); + free(curr_hostEntry); + if (afsmon_debug) + fprintf(debugFD, " %d", i); + curr_hostEntry = prev_hostEntry->next; + } + if (afsmon_debug) + fprintf(debugFD, "\n"); + } + if (numCM) { + if (afsmon_debug) + fprintf(debugFD, "Deallocating CM hostEntries .."); curr_hostEntry = CMnameList; - for(i=0; ithresh != (struct Threshold *)0) - free(curr_hostEntry->thresh); - free(curr_hostEntry); - if (afsmon_debug) - fprintf(debugFD," %d",i); - curr_hostEntry = prev_hostEntry->next; - } - if (afsmon_debug) - fprintf(debugFD,"\n"); - } - - /* close debug file */ - if (afsmon_debug) { + for (i = 0; i < numCM; i++) { + prev_hostEntry = curr_hostEntry; + if (curr_hostEntry->thresh != NULL) + free(curr_hostEntry->thresh); + free(curr_hostEntry); + if (afsmon_debug) + fprintf(debugFD, " %d", i); + curr_hostEntry = prev_hostEntry->next; + } + if (afsmon_debug) + fprintf(debugFD, "\n"); + } + + /* close debug file */ + if (afsmon_debug) { fflush(debugFD); fclose(debugFD); - } + } - if (exec_fsThreshHandler) { - code = execvp(fsHandler_argv[0],fsHandler_argv); - if (code == -1) { - fprintf(stderr,"execvp() of %s returned %d, errno %d\n", - fsHandler_argv[0], code, errno); - exit(-1); - } - } + if (exec_fsThreshHandler) { + code = execvp(fsHandler_argv[0], fsHandler_argv); + if (code == -1) { + fprintf(stderr, "execvp() of %s returned %d, errno %d\n", + fsHandler_argv[0], code, errno); + exit(-1); + } + } - exit(a_exitVal); -} /* afsmon_Exit */ + exit(a_exitVal); +} /* afsmon_Exit */ /*----------------------------------------------------------------------- * insert_FS() @@ -557,41 +562,41 @@ int a_exitVal; /* exit code */ * Failure: -1 *----------------------------------------------------------------------*/ -int -insert_FS( a_hostName ) -char *a_hostName; /* name of cache manager to be inserted in list */ -{ /* insert_FS() */ - static char rn[] = "insert_FS"; /* routine name */ - static struct afsmon_hostEntry *curr_item; - static struct afsmon_hostEntry *prev_item; - - if ( *a_hostName == '\0') - return(-1); - curr_item = (struct afsmon_hostEntry *) - malloc(sizeof(struct afsmon_hostEntry)); - if (curr_item == (struct afsmon_hostEntry *)0) { - fprintf(stderr,"Failed to allocate space for FS nameList\n"); - return(-1); - } - - strncpy(curr_item->hostName,a_hostName,CFG_STR_LEN); - curr_item->next = (struct afsmon_hostEntry *)0; - curr_item->numThresh = 0; - curr_item->thresh = (struct Threshold *)0; - - if (FSnameList == (struct afsmon_hostEntry *)0) +int +insert_FS(a_hostName) + char *a_hostName; /* name of cache manager to be inserted in list */ +{ /* insert_FS() */ + static char rn[] = "insert_FS"; /* routine name */ + static struct afsmon_hostEntry *curr_item; + static struct afsmon_hostEntry *prev_item; + + if (*a_hostName == '\0') + return (-1); + curr_item = (struct afsmon_hostEntry *) + malloc(sizeof(struct afsmon_hostEntry)); + if (curr_item == (struct afsmon_hostEntry *)0) { + fprintf(stderr, "Failed to allocate space for FS nameList\n"); + return (-1); + } + + strncpy(curr_item->hostName, a_hostName, CFG_STR_LEN); + curr_item->next = (struct afsmon_hostEntry *)0; + curr_item->numThresh = 0; + curr_item->thresh = NULL; + + if (FSnameList == (struct afsmon_hostEntry *)0) FSnameList = curr_item; - else - prev_item->next = curr_item; + else + prev_item->next = curr_item; - prev_item = curr_item; - /* record the address of this entry so that its threshold - count can be incremented during the first pass of the config file */ - last_hostEntry = curr_item; + prev_item = curr_item; + /* record the address of this entry so that its threshold + * count can be incremented during the first pass of the config file */ + last_hostEntry = curr_item; - return(0); + return (0); } - + /*----------------------------------------------------------------------- * print_FS() * @@ -604,34 +609,34 @@ char *a_hostName; /* name of cache manager to be inserted in list */ *----------------------------------------------------------------------*/ void print_FS() -{ /* print_FS() */ - static char rn[] = "print_FS"; - struct afsmon_hostEntry *tempFS; - struct Threshold *threshP; - int i; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); +{ /* print_FS() */ + static char rn[] = "print_FS"; + struct afsmon_hostEntry *tempFS; + struct Threshold *threshP; + int i; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); - } - - if (afsmon_debug) { - tempFS = FSnameList; - fprintf(debugFD,"No of File Servers: %d\n",numFS); - if (numFS) { - do { - fprintf(debugFD,"\t %s threshCount = %d\n", - tempFS->hostName,tempFS->numThresh); + } + + if (afsmon_debug) { + tempFS = FSnameList; + fprintf(debugFD, "No of File Servers: %d\n", numFS); + if (numFS) { + do { + fprintf(debugFD, "\t %s threshCount = %d\n", tempFS->hostName, + tempFS->numThresh); threshP = tempFS->thresh; - for(i=0; inumThresh; i++,threshP++) - fprintf(debugFD,"\t thresh (%2d) %s %s %s\n", - threshP->index, threshP->itemName, - threshP->threshVal,threshP->handler); - } while ( (tempFS = tempFS->next) != (struct afsmon_hostEntry *)0); - } - fprintf(debugFD,"\t\t-----End of List-----\n"); - fflush(debugFD); - } + for (i = 0; i < tempFS->numThresh; i++, threshP++) + fprintf(debugFD, "\t thresh (%2d) %s %s %s\n", + threshP->index, threshP->itemName, + threshP->threshVal, threshP->handler); + } while ((tempFS = tempFS->next) != (struct afsmon_hostEntry *)0); + } + fprintf(debugFD, "\t\t-----End of List-----\n"); + fflush(debugFD); + } } @@ -646,41 +651,41 @@ print_FS() * Failure: -1 *----------------------------------------------------------------------*/ -int -insert_CM( a_hostName ) -char *a_hostName; /* name of cache manager to be inserted in list */ -{ /* insert_CM */ - static char rn[] = "insert_CM"; /* routine name */ - static struct afsmon_hostEntry *curr_item; - static struct afsmon_hostEntry *prev_item; - - if ( *a_hostName == '\0') - return(-1); - curr_item = (struct afsmon_hostEntry *) - malloc(sizeof(struct afsmon_hostEntry)); - if (curr_item == (struct afsmon_hostEntry *)0) { - fprintf(stderr,"Failed to allocate space for CM nameList\n"); - return(-1); - } - - strncpy(curr_item->hostName,a_hostName,CFG_STR_LEN); - curr_item->next = (struct afsmon_hostEntry *)0; - curr_item->numThresh = 0; - curr_item->thresh = (struct Threshold *)0; - - if (CMnameList == (struct afsmon_hostEntry *)0) +int +insert_CM(a_hostName) + char *a_hostName; /* name of cache manager to be inserted in list */ +{ /* insert_CM */ + static char rn[] = "insert_CM"; /* routine name */ + static struct afsmon_hostEntry *curr_item; + static struct afsmon_hostEntry *prev_item; + + if (*a_hostName == '\0') + return (-1); + curr_item = (struct afsmon_hostEntry *) + malloc(sizeof(struct afsmon_hostEntry)); + if (curr_item == (struct afsmon_hostEntry *)0) { + fprintf(stderr, "Failed to allocate space for CM nameList\n"); + return (-1); + } + + strncpy(curr_item->hostName, a_hostName, CFG_STR_LEN); + curr_item->next = (struct afsmon_hostEntry *)0; + curr_item->numThresh = 0; + curr_item->thresh = NULL; + + if (CMnameList == (struct afsmon_hostEntry *)0) CMnameList = curr_item; - else - prev_item->next = curr_item; + else + prev_item->next = curr_item; - prev_item = curr_item; - /* side effect. note the address of this entry so that its threshold - count can be incremented during the first pass of the config file */ - last_hostEntry = curr_item; + prev_item = curr_item; + /* side effect. note the address of this entry so that its threshold + * count can be incremented during the first pass of the config file */ + last_hostEntry = curr_item; - return(0); + return (0); } - + /*----------------------------------------------------------------------- * print_CM() @@ -694,35 +699,35 @@ char *a_hostName; /* name of cache manager to be inserted in list */ *----------------------------------------------------------------------*/ int print_CM() -{ /* print_CM() */ - static char rn[] = "print_CM"; - struct afsmon_hostEntry *tempCM; - struct Threshold *threshP; - int i; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); +{ /* print_CM() */ + static char rn[] = "print_CM"; + struct afsmon_hostEntry *tempCM; + struct Threshold *threshP; + int i; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); - } - - if (afsmon_debug) { - tempCM = CMnameList; - fprintf(debugFD,"No of Cache Managers: %d\n",numCM); - if (numCM) { - do { - fprintf(debugFD,"\t %s threshCount = %d\n", - tempCM->hostName,tempCM->numThresh); + } + + if (afsmon_debug) { + tempCM = CMnameList; + fprintf(debugFD, "No of Cache Managers: %d\n", numCM); + if (numCM) { + do { + fprintf(debugFD, "\t %s threshCount = %d\n", tempCM->hostName, + tempCM->numThresh); threshP = tempCM->thresh; - for(i=0; inumThresh; i++,threshP++) - fprintf(debugFD,"\t thresh (%2d) %s %s %s\n", - threshP->index, threshP->itemName, - threshP->threshVal,threshP->handler); - } while ( (tempCM = tempCM->next) != (struct afsmon_hostEntry *)0); - } - fprintf(debugFD,"\t\t-----End of List-----\n"); - } - return(0); -} /* print_CM() */ + for (i = 0; i < tempCM->numThresh; i++, threshP++) + fprintf(debugFD, "\t thresh (%2d) %s %s %s\n", + threshP->index, threshP->itemName, + threshP->threshVal, threshP->handler); + } while ((tempCM = tempCM->next) != (struct afsmon_hostEntry *)0); + } + fprintf(debugFD, "\t\t-----End of List-----\n"); + } + return (0); +} /* print_CM() */ @@ -746,61 +751,64 @@ print_CM() int parse_hostEntry(a_line) -char *a_line; -{ /* parse_hostEntry */ - - static char rn[] = "parse_hostEntry"; /* routine name */ - char opcode[CFG_STR_LEN]; /* specifies type of config entry */ - char arg1[CFG_STR_LEN]; /* hostname or qualifier (fs/cm?) */ - char arg2[CFG_STR_LEN]; /* threshold variable */ - char arg3[CFG_STR_LEN]; /* threshold value */ - char arg4[CFG_STR_LEN]; /* user's handler */ - struct hostent *he; /* host entry */ - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_line = %s\n",rn, a_line); + char *a_line; +{ /* parse_hostEntry */ + + static char rn[] = "parse_hostEntry"; /* routine name */ + char opcode[CFG_STR_LEN]; /* specifies type of config entry */ + char arg1[CFG_STR_LEN]; /* hostname or qualifier (fs/cm?) */ + char arg2[CFG_STR_LEN]; /* threshold variable */ + char arg3[CFG_STR_LEN]; /* threshold value */ + char arg4[CFG_STR_LEN]; /* user's handler */ + struct hostent *he; /* host entry */ + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_line = %s\n", rn, a_line); fflush(debugFD); - } - - /* break it up */ - opcode[0] = 0;arg1[0] = 0;arg2[0] = 0;arg3[0] = 0;arg4[0] = 0; - sscanf(a_line,"%s %s %s %s %s",opcode,arg1,arg2,arg3,arg4); - /* syntax is "opcode hostname" */ - if ((strlen(arg2)) != 0) { - fprintf(stderr,"[ %s ] Extraneous characters at end of line\n", rn); - return(-1); - } - - /* good host ? */ - he = GetHostByName(arg1); - if ( he == (struct hostent *)0) { - fprintf(stderr,"[ %s ] Unable to resolve hostname %s\n", - rn,arg1); - return(-1); - } - - if ((strcasecmp(opcode,"fs")) == 0) { + } + + /* break it up */ + opcode[0] = 0; + arg1[0] = 0; + arg2[0] = 0; + arg3[0] = 0; + arg4[0] = 0; + sscanf(a_line, "%s %s %s %s %s", opcode, arg1, arg2, arg3, arg4); + /* syntax is "opcode hostname" */ + if ((strlen(arg2)) != 0) { + fprintf(stderr, "[ %s ] Extraneous characters at end of line\n", rn); + return (-1); + } + + /* good host ? */ + he = GetHostByName(arg1); + if (he == NULL) { + fprintf(stderr, "[ %s ] Unable to resolve hostname %s\n", rn, arg1); + return (-1); + } + + if ((strcasecmp(opcode, "fs")) == 0) { /* use the complete host name to insert in the file server names list */ - insert_FS(he->h_name); + insert_FS(he->h_name); /* note that last host entry in the config file was fs */ - lastHostType = 1; - numFS++; + lastHostType = 1; + numFS++; /* threholds are not global anymore */ - if (global_ThreshFlag) global_ThreshFlag = 0; - } - else if ((strcasecmp(opcode,"cm")) == 0) { + if (global_ThreshFlag) + global_ThreshFlag = 0; + } else if ((strcasecmp(opcode, "cm")) == 0) { /* use the complete host name to insert in the CM names list */ - insert_CM(he->h_name); + insert_CM(he->h_name); /* last host entry in the config file was cm */ - lastHostType = 2; + lastHostType = 2; numCM++; /* threholds are not global anymore */ - if (global_ThreshFlag) global_ThreshFlag = 0; - } - else - return(-1); + if (global_ThreshFlag) + global_ThreshFlag = 0; + } else + return (-1); - return(0); + return (0); } /*----------------------------------------------------------------------- @@ -821,72 +829,84 @@ char *a_line; int parse_threshEntry(a_line) -char *a_line; -{ /* parse_threshEntry */ - static char rn[] = "parse_threshEntry"; /* routine name */ - char opcode[CFG_STR_LEN]; /* specifies type of config entry */ - char arg1[CFG_STR_LEN]; /* hostname or qualifier (fs/cm?) */ - char arg2[CFG_STR_LEN]; /* threshold variable */ - char arg3[CFG_STR_LEN]; /* threshold value */ - char arg4[CFG_STR_LEN]; /* user's handler */ - char arg5[CFG_STR_LEN]; /* junk characters */ - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_line = %s\n",rn, a_line); + char *a_line; +{ /* parse_threshEntry */ + static char rn[] = "parse_threshEntry"; /* routine name */ + char opcode[CFG_STR_LEN]; /* specifies type of config entry */ + char arg1[CFG_STR_LEN]; /* hostname or qualifier (fs/cm?) */ + char arg2[CFG_STR_LEN]; /* threshold variable */ + char arg3[CFG_STR_LEN]; /* threshold value */ + char arg4[CFG_STR_LEN]; /* user's handler */ + char arg5[CFG_STR_LEN]; /* junk characters */ + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_line = %s\n", rn, a_line); fflush(debugFD); - } - - /* break it up */ - opcode[0] = 0;arg1[0] = 0;arg2[0] = 0;arg3[0] = 0;arg4[0] = 0;arg5[0] = 0; - sscanf(a_line,"%s %s %s %s %s %s",opcode,arg1,arg2,arg3,arg4,arg5); - - /* syntax is "thresh fs/cm variable_name threshold_value [handler] " */ - if (((strlen(arg1)) == 0)||((strlen(arg2)) == 0)||((strlen(arg3)) == 0)) { - fprintf(stderr,"[ %s ] Incomplete line\n", rn); - return(-1); - } - if (strlen(arg3) > THRESH_VAR_LEN-2) { - fprintf(stderr,"[%s ] threshold value too long\n", rn); - return(-1); - } - - if ((strcasecmp(arg1,"fs")) == 0) { + } + + /* break it up */ + opcode[0] = 0; + arg1[0] = 0; + arg2[0] = 0; + arg3[0] = 0; + arg4[0] = 0; + arg5[0] = 0; + sscanf(a_line, "%s %s %s %s %s %s", opcode, arg1, arg2, arg3, arg4, arg5); + + /* syntax is "thresh fs/cm variable_name threshold_value [handler] " */ + if (((strlen(arg1)) == 0) || ((strlen(arg2)) == 0) + || ((strlen(arg3)) == 0)) { + fprintf(stderr, "[ %s ] Incomplete line\n", rn); + return (-1); + } + if (strlen(arg3) > THRESH_VAR_LEN - 2) { + fprintf(stderr, "[%s ] threshold value too long\n", rn); + return (-1); + } + + if ((strcasecmp(arg1, "fs")) == 0) { switch (lastHostType) { - case 0: /* its a global threshold */ - global_fsThreshCount++; - break; - case 1: /* inc thresh count of last file server */ - last_hostEntry->numThresh++; - break; + case 0: /* its a global threshold */ + global_fsThreshCount++; + break; + case 1: /* inc thresh count of last file server */ + last_hostEntry->numThresh++; + break; case 2: - fprintf(stderr,"[ %s ] A threshold for a File Server cannot be placed after a Cache Manager host entry in the config file \n",rn); - return(-1); + fprintf(stderr, + "[ %s ] A threshold for a File Server cannot be placed after a Cache Manager host entry in the config file \n", + rn); + return (-1); default: - fprintf(stderr,"[ %s ] Programming error 1\n",rn); - return(-1); + fprintf(stderr, "[ %s ] Programming error 1\n", rn); + return (-1); } - } else if ((strcasecmp(arg1,"cm")) == 0) { + } else if ((strcasecmp(arg1, "cm")) == 0) { switch (lastHostType) { - case 0: /* its a global threshold */ - global_cmThreshCount++; - break; - case 2: /* inc thresh count of last cache manager */ - last_hostEntry->numThresh++; - break; + case 0: /* its a global threshold */ + global_cmThreshCount++; + break; + case 2: /* inc thresh count of last cache manager */ + last_hostEntry->numThresh++; + break; case 1: - fprintf(stderr,"[ %s ] A threshold for a Cache Manager cannot be placed after a File Server host entry in the config file \n",rn); - return(-1); + fprintf(stderr, + "[ %s ] A threshold for a Cache Manager cannot be placed after a File Server host entry in the config file \n", + rn); + return (-1); default: - fprintf(stderr,"[ %s ] Programming error 2\n",rn); - return(-1); + fprintf(stderr, "[ %s ] Programming error 2\n", rn); + return (-1); } - } else if ((strcasecmp(arg1,"cm")) != 0 && (strcasecmp(arg1,"cm")) != 0 ) { - fprintf(stderr,"[ %s ] Syntax error. Second argument should be \"fs\" or \"cm\" \n",rn); - return(-1); - } + } else if ((strcasecmp(arg1, "cm")) != 0 && (strcasecmp(arg1, "cm")) != 0) { + fprintf(stderr, + "[ %s ] Syntax error. Second argument should be \"fs\" or \"cm\" \n", + rn); + return (-1); + } - return(0); -} /* parse_threshEntry */ + return (0); +} /* parse_threshEntry */ /*----------------------------------------------------------------------- @@ -913,153 +933,158 @@ char *a_line; *----------------------------------------------------------------------*/ int -store_threshold(a_type,a_varName,a_value,a_handler) -int a_type; /* 1 = fs , 2 = cm */ -char *a_varName; /* threshold name */ -char *a_value; /* threshold value */ -char *a_handler; /* threshold overflow handler */ - -{ /* store_thresholds */ - - static char rn[] = "store_thresholds"; /* routine name */ - struct afsmon_hostEntry *tmp_host; /* tmp ptr to hostEntry */ - struct afsmon_hostEntry *Header; /* tmp ptr to hostEntry list header*/ - struct Threshold *threshP; /* tmp ptr to threshold list */ - char *hostname; - int index; /* index to fs_varNames or cm_varNames */ - int found; - int done; - int srvCount; /* tmp count of host names */ - int *global_TC; /* ptr to global_xxThreshCount */ - int i,j; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_type= %d, a_varName= %s, a_value= %s, a_handler=%s\n",rn, a_type, a_varName, a_value, a_handler); +store_threshold(a_type, a_varName, a_value, a_handler) + int a_type; /* 1 = fs , 2 = cm */ + char *a_varName; /* threshold name */ + char *a_value; /* threshold value */ + char *a_handler; /* threshold overflow handler */ + +{ /* store_thresholds */ + + static char rn[] = "store_thresholds"; /* routine name */ + struct afsmon_hostEntry *tmp_host; /* tmp ptr to hostEntry */ + struct afsmon_hostEntry *Header; /* tmp ptr to hostEntry list header */ + struct Threshold *threshP; /* tmp ptr to threshold list */ + char *hostname; + int index; /* index to fs_varNames or cm_varNames */ + int found; + int done; + int srvCount; /* tmp count of host names */ + int *global_TC; /* ptr to global_xxThreshCount */ + int i, j; + + if (afsmon_debug) { + fprintf(debugFD, + "[ %s ] Called, a_type= %d, a_varName= %s, a_value= %s, a_handler=%s\n", + rn, a_type, a_varName, a_value, a_handler); fflush(debugFD); - } - - /* resolve the threshold variable name */ - found = 0; - if (a_type == 1) { /* fs threshold */ - for(index=0; index < NUM_FS_STAT_ENTRIES ; index++) { - if (strcasecmp(a_varName,fs_varNames[index]) == 0) { - found = 1; - break; - } + } + + /* resolve the threshold variable name */ + found = 0; + if (a_type == 1) { /* fs threshold */ + for (index = 0; index < NUM_FS_STAT_ENTRIES; index++) { + if (strcasecmp(a_varName, fs_varNames[index]) == 0) { + found = 1; + break; + } } if (!found) { - fprintf(stderr,"[ %s ] Unknown FS threshold variable name %s\n", - rn,a_varName); - return(-1); + fprintf(stderr, "[ %s ] Unknown FS threshold variable name %s\n", + rn, a_varName); + return (-1); } Header = FSnameList; srvCount = numFS; hostname = last_fsHost; global_TC = &global_fsThreshCount; - } else if (a_type == 2) { /* cm threshold */ - for(index=0; index < NUM_CM_STAT_ENTRIES; index++) { - if (strcasecmp(a_varName,cm_varNames[index]) == 0) { - found = 1; - break; - } + } else if (a_type == 2) { /* cm threshold */ + for (index = 0; index < NUM_CM_STAT_ENTRIES; index++) { + if (strcasecmp(a_varName, cm_varNames[index]) == 0) { + found = 1; + break; + } } if (!found) { - fprintf(stderr,"[ %s ] Unknown CM threshold variable name %s\n", - rn,a_varName); - return(-1); + fprintf(stderr, "[ %s ] Unknown CM threshold variable name %s\n", + rn, a_varName); + return (-1); } Header = CMnameList; srvCount = numCM; hostname = last_cmHost; global_TC = &global_cmThreshCount; - } else - return(-1); + } else + return (-1); - /* if the global thresh count is not zero, place this threshold on - all the host entries */ + /* if the global thresh count is not zero, place this threshold on + * all the host entries */ - if (*global_TC) { + if (*global_TC) { tmp_host = Header; - for(i=0; ithresh; - done = 0; - for(j=0; jnumThresh; j++) { - if ( (threshP->itemName[0] == '\0') || - (strcasecmp(threshP->itemName,a_varName) == 0) ) { - strncpy(threshP->itemName,a_varName,THRESH_VAR_NAME_LEN); - strncpy(threshP->threshVal,a_value,THRESH_VAR_LEN); - strcpy(threshP->handler,a_handler); - threshP->index = index; - done = 1; - break; - } - threshP++; - } - if (!done) { - fprintf(stderr,"[ %s ] Could not insert threshold entry",rn); - fprintf(stderr,"for %s in thresh list of host %s \n", - a_varName,tmp_host->hostName); - return(-1); + for (i = 0; i < srvCount; i++) { + threshP = tmp_host->thresh; + done = 0; + for (j = 0; j < tmp_host->numThresh; j++) { + if ((threshP->itemName[0] == '\0') + || (strcasecmp(threshP->itemName, a_varName) == 0)) { + strncpy(threshP->itemName, a_varName, + THRESH_VAR_NAME_LEN); + strncpy(threshP->threshVal, a_value, THRESH_VAR_LEN); + strcpy(threshP->handler, a_handler); + threshP->index = index; + done = 1; + break; } - tmp_host = tmp_host->next; + threshP++; + } + if (!done) { + fprintf(stderr, "[ %s ] Could not insert threshold entry", + rn); + fprintf(stderr, "for %s in thresh list of host %s \n", + a_varName, tmp_host->hostName); + return (-1); + } + tmp_host = tmp_host->next; } (*global_TC)--; - return(0); - } - - /* it is not a global threshold, insert it in the thresh list of this - host only. We overwrite the global threshold if it was alread set */ - - if (*hostname == '\0') { - fprintf(stderr,"[ %s ] Programming error 3\n",rn); - return(-1); - } - - /* get the hostEntry that this threshold belongs to */ - tmp_host = Header; - found = 0; - for(i=0; i < srvCount; i++) { - if (strcasecmp(tmp_host->hostName,hostname) == 0) { - found = 1; - break; + return (0); + } + + /* it is not a global threshold, insert it in the thresh list of this + * host only. We overwrite the global threshold if it was alread set */ + + if (*hostname == '\0') { + fprintf(stderr, "[ %s ] Programming error 3\n", rn); + return (-1); + } + + /* get the hostEntry that this threshold belongs to */ + tmp_host = Header; + found = 0; + for (i = 0; i < srvCount; i++) { + if (strcasecmp(tmp_host->hostName, hostname) == 0) { + found = 1; + break; } tmp_host = tmp_host->next; - } - if (!found) { - fprintf(stderr,"[ %s ] Unable to find host %s in %s hostEntry list", - rn,hostname,(a_type-1)?"CM":"FS"); - return(-1); - } - - /* put this entry on the thresh list of this host, overwrite global value - if needed */ - - threshP = tmp_host->thresh; - done = 0; - for(i=0; i < tmp_host->numThresh; i++) { - if ( (threshP->itemName[0] == '\0') || - (strcasecmp(threshP->itemName,a_varName) == 0) ) { - strncpy(threshP->itemName,a_varName,THRESH_VAR_NAME_LEN); - strncpy(threshP->threshVal,a_value,THRESH_VAR_LEN); - strcpy(threshP->handler,a_handler); - threshP->index = index; - done = 1; - break; - } - threshP++; - } - - if (!done) { - fprintf(stderr,"[ %s ] Unable to insert threshold %s for %s host %s\n", - rn, a_varName, (a_type -1)?"CM":"FS", tmp_host->hostName); - return(-1); - } - - return(0); - -} /* store_thresholds */ + } + if (!found) { + fprintf(stderr, "[ %s ] Unable to find host %s in %s hostEntry list", + rn, hostname, (a_type - 1) ? "CM" : "FS"); + return (-1); + } + + /* put this entry on the thresh list of this host, overwrite global value + * if needed */ + + threshP = tmp_host->thresh; + done = 0; + for (i = 0; i < tmp_host->numThresh; i++) { + if ((threshP->itemName[0] == '\0') + || (strcasecmp(threshP->itemName, a_varName) == 0)) { + strncpy(threshP->itemName, a_varName, THRESH_VAR_NAME_LEN); + strncpy(threshP->threshVal, a_value, THRESH_VAR_LEN); + strcpy(threshP->handler, a_handler); + threshP->index = index; + done = 1; + break; + } + threshP++; + } + + if (!done) { + fprintf(stderr, + "[ %s ] Unable to insert threshold %s for %s host %s\n", rn, + a_varName, (a_type - 1) ? "CM" : "FS", tmp_host->hostName); + return (-1); + } + + return (0); + +} /* store_thresholds */ /*----------------------------------------------------------------------- @@ -1088,270 +1113,291 @@ char *a_handler; /* threshold overflow handler */ int parse_showEntry(a_line) -char *a_line; -{ /* parse_showEntry */ - static char rn[] = "parse_showEntry"; - char opcode[CFG_STR_LEN]; /* specifies type of config entry */ - char arg1[CFG_STR_LEN]; /* show fs or cm entry ? */ - char arg2[CFG_STR_LEN]; /* what we gotta show */ - char arg3[CFG_STR_LEN]; /* junk */ - char catName[CFG_STR_LEN]; /* for category names */ - int numGroups; /* number of groups in a section */ - int fromIdx; - int toIdx; - int found; - int idx = 0; /* index to fs_categories[] */ - int i; - int j; - - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_line= %s\n",rn, a_line); + char *a_line; +{ /* parse_showEntry */ + static char rn[] = "parse_showEntry"; + char opcode[CFG_STR_LEN]; /* specifies type of config entry */ + char arg1[CFG_STR_LEN]; /* show fs or cm entry ? */ + char arg2[CFG_STR_LEN]; /* what we gotta show */ + char arg3[CFG_STR_LEN]; /* junk */ + char catName[CFG_STR_LEN]; /* for category names */ + int numGroups; /* number of groups in a section */ + int fromIdx; + int toIdx; + int found; + int idx = 0; /* index to fs_categories[] */ + int i; + int j; + + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_line= %s\n", rn, a_line); fflush(debugFD); - } - opcode[0] = 0; arg1[0] = 0; arg2[0] = 0; arg3[0] = 0; - sscanf(a_line,"%s %s %s %s", opcode, arg1, arg2, arg3); - - if (arg3[0] != '\0') { - fprintf(stderr,"[ %s ] Extraneous characters at end of line\n",rn); - return(-1); - } - - if ((strcasecmp(arg1,"fs") != 0) && (strcasecmp(arg1,"cm") != 0)) { - fprintf(stderr,"[ %s ] Second argument of \"show\" directive should be \"fs\" or \"cm\" \n",rn); - return(-1); - } - - /* Each entry can either be a variable name or a section/group name. Variable - names are listed in xx_varNames[] and section/group names in xx_categories[]. - The section/group names in xx_categiries[] also give the starting/ending - indices of the variables belonging to that section/group. These indices - are stored in order in xx_Display_map[] and displayed to the screen in that - order. */ - - /* To handle duplicate "show" entries we keep track of what what we have - already marked to show in the xx_showFlags[] */ - - if (strcasecmp(arg1,"fs") == 0) { /* its a File Server entry */ - - /* mark that we have to show only what the user wants */ - fs_showDefault = 0; - - /* if it is a section/group name, find it in the fs_categories[] array */ - - found = 0; - if ( strcasestr(arg2,"_section") != (char *)NULL || - strcasestr(arg2,"_group") != (char *)NULL ) { - idx = 0; - while(idx NUM_FS_STAT_ENTRIES || - toIdx > NUM_FS_STAT_ENTRIES) - return(-2); - for(j=fromIdx; j<=toIdx; j++) { - if (! fs_showFlags[j]) { - fs_Display_map[fs_DisplayItems_count] = j; - fs_DisplayItems_count++; - fs_showFlags[j] = 1; + if (fromIdx < 0 || toIdx < 0 || fromIdx > NUM_FS_STAT_ENTRIES + || toIdx > NUM_FS_STAT_ENTRIES) + return (-2); + for (j = fromIdx; j <= toIdx; j++) { + if (!fs_showFlags[j]) { + fs_Display_map[fs_DisplayItems_count] = j; + fs_DisplayItems_count++; + fs_showFlags[j] = 1; } if (fs_DisplayItems_count > NUM_FS_STAT_ENTRIES) { - fprintf(stderr,"[ %s ] fs_DisplayItems_count ovf\n",rn); - return(-3); - } - } - } else - - /* if it is a section name, get the count of number of groups in it and - for each group fill in the start/end indices in the fs_Display_map[] */ - - if (strcasestr(arg2,"_section") != (char *)NULL ) { - /* fromIdx is actually the number of groups in thi section */ - numGroups = fromIdx; - /* for each group in section */ - while(idx < FS_NUM_DATA_CATEGORIES && numGroups) { - sscanf(fs_categories[idx],"%s %d %d",catName, &fromIdx, &toIdx); - - if (strcasestr(catName,"_group") != (char *)0) { - if (fromIdx < 0 || toIdx < 0 || fromIdx > NUM_FS_STAT_ENTRIES || - toIdx > NUM_FS_STAT_ENTRIES) - return(-4); - for(j=fromIdx; j<=toIdx; j++) { - if (! fs_showFlags[j]) { - fs_Display_map[fs_DisplayItems_count] = j; - fs_DisplayItems_count++; - fs_showFlags[j] = 1; + fprintf(stderr, "[ %s ] fs_DisplayItems_count ovf\n", rn); + return (-3); } - if (fs_DisplayItems_count > NUM_FS_STAT_ENTRIES) { - fprintf(stderr,"[ %s ] fs_DisplayItems_count ovf\n",rn); - return(-5); + } + } else + /* if it is a section name, get the count of number of groups in it and + * for each group fill in the start/end indices in the fs_Display_map[] */ + + if (strcasestr(arg2, "_section") != (char *)NULL) { + /* fromIdx is actually the number of groups in thi section */ + numGroups = fromIdx; + /* for each group in section */ + while (idx < FS_NUM_DATA_CATEGORIES && numGroups) { + sscanf(fs_categories[idx], "%s %d %d", catName, &fromIdx, + &toIdx); + + if (strcasestr(catName, "_group") != NULL) { + if (fromIdx < 0 || toIdx < 0 + || fromIdx > NUM_FS_STAT_ENTRIES + || toIdx > NUM_FS_STAT_ENTRIES) + return (-4); + for (j = fromIdx; j <= toIdx; j++) { + if (!fs_showFlags[j]) { + fs_Display_map[fs_DisplayItems_count] = j; + fs_DisplayItems_count++; + fs_showFlags[j] = 1; + } + if (fs_DisplayItems_count > NUM_FS_STAT_ENTRIES) { + fprintf(stderr, + "[ %s ] fs_DisplayItems_count ovf\n", rn); + return (-5); + } + } + } else { + fprintf(stderr, "[ %s ] Error parsing groups for %s\n", + rn, arg2); + return (-6); } - } - } else { - fprintf(stderr,"[ %s ] Error parsing groups for %s\n",rn,arg2); - return(-6); - } - idx++; - numGroups--; - } /* for each group in section */ + idx++; + numGroups--; + } /* for each group in section */ - } else { /* it is a variable name */ + } else { /* it is a variable name */ - for(i=0; i= NUM_FS_STAT_ENTRIES) { - fprintf(stderr,"[ %s ] fs_DisplayItems_count ovf\n",rn); - return(-25); - } - found = 1; + } + if (fs_DisplayItems_count >= NUM_FS_STAT_ENTRIES) { + fprintf(stderr, "[ %s ] fs_DisplayItems_count ovf\n", + rn); + return (-25); + } + found = 1; } - } - if (! found) { /* typo in section/group name */ - fprintf(stderr,"[ %s ] Could not find variable name %s\n",rn,arg2); - return(-1); - } - } /* its a variable name */ - - } /* it is an fs entry */ + } + if (!found) { /* typo in section/group name */ + fprintf(stderr, "[ %s ] Could not find variable name %s\n", + rn, arg2); + return (-1); + } + } /* its a variable name */ + } - if (strcasecmp(arg1,"cm") == 0) { /* its a Cache Manager entry */ + /* it is an fs entry */ + if (strcasecmp(arg1, "cm") == 0) { /* its a Cache Manager entry */ - /* mark that we have to show only what the user wants */ - cm_showDefault = 0; + /* mark that we have to show only what the user wants */ + cm_showDefault = 0; - /* if it is a section/group name, find it in the cm_categories[] array */ + /* if it is a section/group name, find it in the cm_categories[] array */ - found = 0; - if ( strcasestr(arg2,"_section") != (char *)NULL || - strcasestr(arg2,"_group") != (char *)NULL ) { - idx = 0; - while(idx NUM_CM_STAT_ENTRIES || - toIdx > NUM_CM_STAT_ENTRIES) - return(-10); - for(j=fromIdx; j<=toIdx; j++) { - if (! cm_showFlags[j]) { - cm_Display_map[cm_DisplayItems_count] = j; - cm_DisplayItems_count++; - cm_showFlags[j] = 1; + if (fromIdx < 0 || toIdx < 0 || fromIdx > NUM_CM_STAT_ENTRIES + || toIdx > NUM_CM_STAT_ENTRIES) + return (-10); + for (j = fromIdx; j <= toIdx; j++) { + if (!cm_showFlags[j]) { + cm_Display_map[cm_DisplayItems_count] = j; + cm_DisplayItems_count++; + cm_showFlags[j] = 1; } if (cm_DisplayItems_count > NUM_CM_STAT_ENTRIES) { - fprintf(stderr,"[ %s ] cm_DisplayItems_count ovf\n",rn); - return(-11); + fprintf(stderr, "[ %s ] cm_DisplayItems_count ovf\n", rn); + return (-11); } - } - } else - - /* if it is a section name, get the count of number of groups in it and - for each group fill in the start/end indices in the cm_Display_map[] */ - - if (strcasestr(arg2,"_section") != (char *)NULL ) { - /* fromIdx is actually the number of groups in thi section */ - numGroups = fromIdx; - /* for each group in section */ - while(idx < CM_NUM_DATA_CATEGORIES && numGroups) { - sscanf(cm_categories[idx],"%s %d %d",catName, &fromIdx, &toIdx); - - if (strcasestr(catName,"_group") != (char *)0) { - if (fromIdx < 0 || toIdx < 0 || fromIdx > NUM_CM_STAT_ENTRIES || - toIdx > NUM_CM_STAT_ENTRIES) - return(-12); - for(j=fromIdx; j<=toIdx; j++) { - if (! cm_showFlags[j]) { - cm_Display_map[cm_DisplayItems_count] = j; - cm_DisplayItems_count++; - cm_showFlags[j] = 1; - } - if (cm_DisplayItems_count > NUM_CM_STAT_ENTRIES) { - fprintf(stderr,"[ %s ] cm_DisplayItems_count ovf\n",rn); - return(-13); + } + } else + /* if it is a section name, get the count of number of groups in it and + * for each group fill in the start/end indices in the cm_Display_map[] */ + + if (strcasestr(arg2, "_section") != (char *)NULL) { + /* fromIdx is actually the number of groups in thi section */ + numGroups = fromIdx; + /* for each group in section */ + while (idx < CM_NUM_DATA_CATEGORIES && numGroups) { + sscanf(cm_categories[idx], "%s %d %d", catName, &fromIdx, + &toIdx); + + if (strcasestr(catName, "_group") != NULL) { + if (fromIdx < 0 || toIdx < 0 + || fromIdx > NUM_CM_STAT_ENTRIES + || toIdx > NUM_CM_STAT_ENTRIES) + return (-12); + for (j = fromIdx; j <= toIdx; j++) { + if (!cm_showFlags[j]) { + cm_Display_map[cm_DisplayItems_count] = j; + cm_DisplayItems_count++; + cm_showFlags[j] = 1; + } + if (cm_DisplayItems_count > NUM_CM_STAT_ENTRIES) { + fprintf(stderr, + "[ %s ] cm_DisplayItems_count ovf\n", rn); + return (-13); + } + } + } else { + fprintf(stderr, "[ %s ] Error parsing groups for %s\n", + rn, arg2); + return (-15); } - } - } else { - fprintf(stderr,"[ %s ] Error parsing groups for %s\n",rn,arg2); - return(-15); - } - idx++; - numGroups--; - } /* for each group in section */ + idx++; + numGroups--; + } /* for each group in section */ - } else { /* it is a variable name */ + } else { /* it is a variable name */ - for(i=0; i= NUM_CM_STAT_ENTRIES) { - fprintf(stderr,"[ %s ] cm_DisplayItems_count ovf\n",rn); - return(-20); - } - found = 1; + } + if (cm_DisplayItems_count >= NUM_CM_STAT_ENTRIES) { + fprintf(stderr, "[ %s ] cm_DisplayItems_count ovf\n", + rn); + return (-20); + } + found = 1; } - } - if (! found) { /* typo in section/group name */ - fprintf(stderr,"[ %s ] Could not find variable name %s\n",rn,arg2); - return(-1); - } - } /* its a variable name */ + } + if (!found) { /* typo in section/group name */ + fprintf(stderr, "[ %s ] Could not find variable name %s\n", + rn, arg2); + return (-1); + } + } /* its a variable name */ - } /* it is an cm entry */ + } + /* it is an cm entry */ + return (0); - return(0); - -} /* parse_showEntry */ +} /* parse_showEntry */ /*----------------------------------------------------------------------- @@ -1375,230 +1421,244 @@ char *a_line; int process_config_file(a_config_filename) -char *a_config_filename; -{ /* process_config_file() */ - static char rn[] = "process_config_file"; /* routine name */ - FILE *configFD; /* config file descriptor */ - char line[4*CFG_STR_LEN]; /* a line of config file */ - char opcode[CFG_STR_LEN]; /* specifies type of config entry */ - char arg1[CFG_STR_LEN]; /* hostname or qualifier (fs/cm?) */ - char arg2[CFG_STR_LEN]; /* threshold variable */ - char arg3[CFG_STR_LEN]; /* threshold value */ - char arg4[CFG_STR_LEN]; /* user's handler */ - struct afsmon_hostEntry *curr_host; - struct hostent *he; /* hostentry to resolve host name*/ - char *handlerPtr; /* ptr to pass theresh handler string */ - int code = 0; /* error code */ - int linenum = 0; /* config file line number */ - int threshCount; /* count of thresholds for each server */ - int error_in_config; /* syntax errors in config file ?? */ - int i; - int numBytes; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_config_filename= %s\n", - rn, a_config_filename); + char *a_config_filename; +{ /* process_config_file() */ + static char rn[] = "process_config_file"; /* routine name */ + FILE *configFD; /* config file descriptor */ + char line[4 * CFG_STR_LEN]; /* a line of config file */ + char opcode[CFG_STR_LEN]; /* specifies type of config entry */ + char arg1[CFG_STR_LEN]; /* hostname or qualifier (fs/cm?) */ + char arg2[CFG_STR_LEN]; /* threshold variable */ + char arg3[CFG_STR_LEN]; /* threshold value */ + char arg4[CFG_STR_LEN]; /* user's handler */ + struct afsmon_hostEntry *curr_host; + struct hostent *he; /* hostentry to resolve host name */ + char *handlerPtr; /* ptr to pass theresh handler string */ + int code = 0; /* error code */ + int linenum = 0; /* config file line number */ + int threshCount; /* count of thresholds for each server */ + int error_in_config; /* syntax errors in config file ?? */ + int i; + int numBytes; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_config_filename= %s\n", rn, + a_config_filename); fflush(debugFD); - } + } - /* open config file */ + /* open config file */ - configFD = fopen(a_config_filename,"r"); - if (configFD == (FILE *)0) { - fprintf(stderr,"Failed to open config file %s \n",a_config_filename); + configFD = fopen(a_config_filename, "r"); + if (configFD == (FILE *) 0) { + fprintf(stderr, "Failed to open config file %s \n", + a_config_filename); if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Failed to open config file %s \n", - rn, a_config_filename); + fprintf(debugFD, "[ %s ] Failed to open config file %s \n", rn, + a_config_filename); } afsmon_Exit(5); - } + } - /* parse config file */ + /* parse config file */ - /* We process the config file in two passes. In the first pass we check - for correct syntax and for valid entries and also keep count of the - number of servers and thresholds to monitor. This the data strctures - can be arrays instead of link lists since we would know their sizes.*/ + /* We process the config file in two passes. In the first pass we check + * for correct syntax and for valid entries and also keep count of the + * number of servers and thresholds to monitor. This the data strctures + * can be arrays instead of link lists since we would know their sizes. */ - /* First Pass */ + /* First Pass */ - numFS = 0; - numCM = 0; - threshCount = 0; - error_in_config = 0; /* flag to note if config file has syntax errors*/ + numFS = 0; + numCM = 0; + threshCount = 0; + error_in_config = 0; /* flag to note if config file has syntax errors */ - while ( (fgets(line,CFG_STR_LEN,configFD)) != NULL) - { - opcode[0] = 0; arg1[0] = 0; arg2[0] = 0; arg3[0] = 0; arg4[0] = 0; - sscanf(line,"%s %s %s %s %s", opcode, arg1, arg2, arg3, arg4); + while ((fgets(line, CFG_STR_LEN, configFD)) != NULL) { + opcode[0] = 0; + arg1[0] = 0; + arg2[0] = 0; + arg3[0] = 0; + arg4[0] = 0; + sscanf(line, "%s %s %s %s %s", opcode, arg1, arg2, arg3, arg4); linenum++; /* skip blank lines and comment lines */ - if ( (strlen(opcode) == 0) || line[0] == '#' ) continue; - - if ( (strcasecmp(opcode,"fs") == 0) || (strcasecmp(opcode,"cm")) == 0) { - code = parse_hostEntry(line); - } else if ((strcasecmp(opcode,"thresh")) == 0) { - code = parse_threshEntry(line); - } else if ((strcasecmp(opcode,"show")) == 0) { - code = parse_showEntry(line); + if ((strlen(opcode) == 0) || line[0] == '#') + continue; + + if ((strcasecmp(opcode, "fs") == 0) + || (strcasecmp(opcode, "cm")) == 0) { + code = parse_hostEntry(line); + } else if ((strcasecmp(opcode, "thresh")) == 0) { + code = parse_threshEntry(line); + } else if ((strcasecmp(opcode, "show")) == 0) { + code = parse_showEntry(line); } else { - fprintf(stderr,"[ %s ] Unknown opcode %s\n",rn,opcode); - code = 1; + fprintf(stderr, "[ %s ] Unknown opcode %s\n", rn, opcode); + code = 1; } - + if (code) { - fprintf(stderr,"[ %s ] Error in line:\n %d: %s\n", - rn,linenum,line); - error_in_config = 1; - } - } - - if (error_in_config) - afsmon_Exit(10); - - if (afsmon_debug) { - fprintf(debugFD,"Global FS thresholds count = %d\n",global_fsThreshCount); - fprintf(debugFD,"Global CM thresholds count = %d\n",global_cmThreshCount); - fflush(debugFD); - } - - /* the threshold count of all hosts in increased by 1 for each global - threshold. If one of the hosts has a local threshold for the same - variable it would end up being counted twice. whats a few bytes of memory - wasted anyway ? */ - - if (global_fsThreshCount) { - curr_host = FSnameList; - for(i=0; inumThresh += global_fsThreshCount; - curr_host = curr_host->next; - } - } - if (global_cmThreshCount) { - curr_host = CMnameList; - for(i=0; inumThresh += global_cmThreshCount; - curr_host = curr_host->next; - } - } - - - /* make sure we have something to monitor */ - if (numFS == 0 && numCM == 0) { - fprintf(stderr,"\nConfig file must specify atleast one File Server or Cache Manager host to monitor.\n"); - fclose(configFD); + fprintf(stderr, "[ %s ] Error in line:\n %d: %s\n", rn, linenum, + line); + error_in_config = 1; + } + } + + if (error_in_config) + afsmon_Exit(10); + + if (afsmon_debug) { + fprintf(debugFD, "Global FS thresholds count = %d\n", + global_fsThreshCount); + fprintf(debugFD, "Global CM thresholds count = %d\n", + global_cmThreshCount); + fflush(debugFD); + } + + /* the threshold count of all hosts in increased by 1 for each global + * threshold. If one of the hosts has a local threshold for the same + * variable it would end up being counted twice. whats a few bytes of memory + * wasted anyway ? */ + + if (global_fsThreshCount) { + curr_host = FSnameList; + for (i = 0; i < numFS; i++) { + curr_host->numThresh += global_fsThreshCount; + curr_host = curr_host->next; + } + } + if (global_cmThreshCount) { + curr_host = CMnameList; + for (i = 0; i < numCM; i++) { + curr_host->numThresh += global_cmThreshCount; + curr_host = curr_host->next; + } + } + + + /* make sure we have something to monitor */ + if (numFS == 0 && numCM == 0) { + fprintf(stderr, + "\nConfig file must specify atleast one File Server or Cache Manager host to monitor.\n"); + fclose(configFD); afsmon_Exit(15); - } + } - /* Second Pass */ + /* Second Pass */ - fseek(configFD,0,0); /* seek to the beginning */ + fseek(configFD, 0, 0); /* seek to the beginning */ - /* allocate memory for threshold lists */ - curr_host = FSnameList; - for(i=0; ihostName[0] == '\0') { - fprintf(stderr,"[ %s ] Programming error 4\n",rn); - afsmon_Exit(20); + fprintf(stderr, "[ %s ] Programming error 4\n", rn); + afsmon_Exit(20); } if (curr_host->numThresh) { - numBytes = curr_host->numThresh * sizeof(struct Threshold); - curr_host->thresh = (struct Threshold *) malloc(numBytes); - if (curr_host->thresh == (struct Threshold *)0) { - fprintf(stderr,"[ %s ] Memory Allocation error 1",rn); - afsmon_Exit(25); - } - memset(curr_host->thresh, 0, numBytes); - } + numBytes = curr_host->numThresh * sizeof(struct Threshold); + curr_host->thresh = (struct Threshold *)malloc(numBytes); + if (curr_host->thresh == NULL) { + fprintf(stderr, "[ %s ] Memory Allocation error 1", rn); + afsmon_Exit(25); + } + memset(curr_host->thresh, 0, numBytes); + } curr_host = curr_host->next;; - } + } - curr_host = CMnameList; - for(i=0; ihostName[0] == '\0') { - fprintf(stderr,"[ %s ] Programming error 5\n",rn); - afsmon_Exit(30); + fprintf(stderr, "[ %s ] Programming error 5\n", rn); + afsmon_Exit(30); } if (curr_host->numThresh) { - numBytes = curr_host->numThresh * sizeof(struct Threshold); - curr_host->thresh = (struct Threshold *) malloc(numBytes); - if (curr_host->thresh == (struct Threshold *)0) { - fprintf(stderr,"[ %s ] Memory Allocation error 2",rn); - afsmon_Exit(35); - } - memset(curr_host->thresh, 0, numBytes); - } + numBytes = curr_host->numThresh * sizeof(struct Threshold); + curr_host->thresh = (struct Threshold *)malloc(numBytes); + if (curr_host->thresh == NULL) { + fprintf(stderr, "[ %s ] Memory Allocation error 2", rn); + afsmon_Exit(35); + } + memset(curr_host->thresh, 0, numBytes); + } curr_host = curr_host->next;; - } + } - opcode[0] = 0; arg1[0] = 0; arg2[0] = 0; arg3[0] = 0; arg4[0] = 0; - last_fsHost[0] = '\0'; - last_cmHost[0] = '\0'; - linenum = 0; - while ( (fgets(line,CFG_STR_LEN,configFD)) != NULL) { - opcode[0] = 0; arg1[0] = 0; arg2[0] = 0; arg3[0] = 0; arg4[0] = 0; - sscanf(line,"%s %s %s %s %s", opcode, arg1, arg2, arg3, arg4); + opcode[0] = 0; + arg1[0] = 0; + arg2[0] = 0; + arg3[0] = 0; + arg4[0] = 0; + last_fsHost[0] = '\0'; + last_cmHost[0] = '\0'; + linenum = 0; + while ((fgets(line, CFG_STR_LEN, configFD)) != NULL) { + opcode[0] = 0; + arg1[0] = 0; + arg2[0] = 0; + arg3[0] = 0; + arg4[0] = 0; + sscanf(line, "%s %s %s %s %s", opcode, arg1, arg2, arg3, arg4); linenum++; /* if we have a host entry, remember the host name */ - if (strcasecmp(opcode,"fs") == 0) { - he = GetHostByName(arg1); - strncpy(last_fsHost,he->h_name,HOST_NAME_LEN); - } - else if (strcasecmp(opcode,"cm") == 0) { - he = GetHostByName(arg1); - strncpy(last_cmHost,he->h_name,HOST_NAME_LEN); - } - else if (strcasecmp(opcode,"thresh") == 0) { - /* if we have a threshold handler it may have arguments - and the sscanf() above would not get them, so do the - following */ - if (strlen(arg4)) { - handlerPtr = line; - /* now skip over 4 words - this is done by first - skipping leading blanks then skipping a word */ - for(i=0; i<4; i++) { - while( isspace(*handlerPtr) ) - handlerPtr++; - while(! isspace(*handlerPtr) ) - handlerPtr++; - } - while( isspace(*handlerPtr) ) - handlerPtr++; - /* we how have a pointer to the start of the handler - name & args */ - } else - handlerPtr = arg4; /* empty string */ - - - if (strcasecmp(arg1,"fs") == 0) - code = store_threshold(1, /* 1 = fs*/ - arg2,arg3,handlerPtr); - - else if (strcasecmp(arg1,"cm") == 0) - code = store_threshold(2, /* 2 = fs*/ - arg2,arg3,handlerPtr); - - else { - fprintf(stderr,"[ %s ] Programming error 6\n", rn); - afsmon_Exit(40); - } - if (code) { - fprintf(stderr,"[ %s ] Failed to store threshold\n", - rn); - fprintf(stderr,"[ %s ] Error processing line:\n%d: %s", - rn,linenum,line); - afsmon_Exit(45); + if (strcasecmp(opcode, "fs") == 0) { + he = GetHostByName(arg1); + strncpy(last_fsHost, he->h_name, HOST_NAME_LEN); + } else if (strcasecmp(opcode, "cm") == 0) { + he = GetHostByName(arg1); + strncpy(last_cmHost, he->h_name, HOST_NAME_LEN); + } else if (strcasecmp(opcode, "thresh") == 0) { + /* if we have a threshold handler it may have arguments + * and the sscanf() above would not get them, so do the + * following */ + if (strlen(arg4)) { + handlerPtr = line; + /* now skip over 4 words - this is done by first + * skipping leading blanks then skipping a word */ + for (i = 0; i < 4; i++) { + while (isspace(*handlerPtr)) + handlerPtr++; + while (!isspace(*handlerPtr)) + handlerPtr++; } + while (isspace(*handlerPtr)) + handlerPtr++; + /* we how have a pointer to the start of the handler + * name & args */ + } else + handlerPtr = arg4; /* empty string */ + + + if (strcasecmp(arg1, "fs") == 0) + code = store_threshold(1, /* 1 = fs */ + arg2, arg3, handlerPtr); + + else if (strcasecmp(arg1, "cm") == 0) + code = store_threshold(2, /* 2 = fs */ + arg2, arg3, handlerPtr); + + else { + fprintf(stderr, "[ %s ] Programming error 6\n", rn); + afsmon_Exit(40); + } + if (code) { + fprintf(stderr, "[ %s ] Failed to store threshold\n", rn); + fprintf(stderr, "[ %s ] Error processing line:\n%d: %s", rn, + linenum, line); + afsmon_Exit(45); + } } - } + } - fclose(configFD); - return(0); + fclose(configFD); + return (0); } /*----------------------------------------------------------------------- @@ -1612,42 +1672,47 @@ char *a_config_filename; * Nothing. *----------------------------------------------------------------------*/ -void +void Print_FS_CB() -{ /* Print_FS_CB() */ - - struct afsmon_fs_Results_list *fslist; - int i; - int j; - - /* print valid info in the fs CB */ - - if (afsmon_debug) { - fprintf(debugFD,"==================== FS Buffer ========================\n"); - fprintf(debugFD,"afsmon_fs_curr_CBindex = %d\n",afsmon_fs_curr_CBindex); - fprintf(debugFD,"afsmon_fs_curr_probeNum = %d\n\n",afsmon_fs_curr_probeNum); - - for(i=0; iempty) { - fprintf(debugFD,"\t %d) probeNum = %d host = %s", - j,fslist->fsResults->probeNum, - fslist-> fsResults->connP->hostName); - if (fslist->fsResults->probeOK) fprintf(debugFD," NOTOK\n"); - else fprintf(debugFD," OK\n"); +{ /* Print_FS_CB() */ + + struct afsmon_fs_Results_list *fslist; + int i; + int j; + + /* print valid info in the fs CB */ + + if (afsmon_debug) { + fprintf(debugFD, + "==================== FS Buffer ========================\n"); + fprintf(debugFD, "afsmon_fs_curr_CBindex = %d\n", + afsmon_fs_curr_CBindex); + fprintf(debugFD, "afsmon_fs_curr_probeNum = %d\n\n", + afsmon_fs_curr_probeNum); + + for (i = 0; i < num_bufSlots; i++) { + fprintf(debugFD, "\t--------- slot %d ----------\n", i); + fslist = afsmon_fs_ResultsCB[i].list; + j = 0; + while (j < numFS) { + if (!fslist->empty) { + fprintf(debugFD, "\t %d) probeNum = %d host = %s", j, + fslist->fsResults->probeNum, + fslist->fsResults->connP->hostName); + if (fslist->fsResults->probeOK) + fprintf(debugFD, " NOTOK\n"); + else + fprintf(debugFD, " OK\n"); } else - fprintf(debugFD,"\t %d) -- empty --\n",j); + fprintf(debugFD, "\t %d) -- empty --\n", j); fslist = fslist->next; j++; + } + if (fslist != (struct afsmon_fs_Results_list *)0) + fprintf(debugFD, "dangling last next ptr fs CB\n"); } - if (fslist != (struct afsmon_fs_Results_list *)0 ) - fprintf(debugFD,"dangling last next ptr fs CB\n"); - } - } -} /* Print_FS_CB() */ + } +} /* Print_FS_CB() */ /*----------------------------------------------------------------------- * save_FS_results_inCB() @@ -1667,81 +1732,89 @@ Print_FS_CB() *----------------------------------------------------------------------*/ int save_FS_results_inCB(a_newProbeCycle) -int a_newProbeCycle; /* start of a new probe cycle ? */ + int a_newProbeCycle; /* start of a new probe cycle ? */ -{ /* save_FS_results_inCB() */ - static char rn[] = "save_FS_results_inCB"; /* routine name */ - struct afsmon_fs_Results_list *tmp_fslist_item; /* temp fs list item */ - struct xstat_fs_ProbeResults *tmp_fsPR; /* temp ptr */ - int i; +{ /* save_FS_results_inCB() */ + static char rn[] = "save_FS_results_inCB"; /* routine name */ + struct afsmon_fs_Results_list *tmp_fslist_item; /* temp fs list item */ + struct xstat_fs_ProbeResults *tmp_fsPR; /* temp ptr */ + int i; - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_newProbeCycle= %d\n", - rn, a_newProbeCycle); + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_newProbeCycle= %d\n", rn, + a_newProbeCycle); fflush(debugFD); - } + } - /* If a new probe cycle started, mark the list in the current buffer - slot empty for resuse. Note that afsmon_fs_curr_CBindex was appropriately - incremented in afsmon_FS_Handler() */ + /* If a new probe cycle started, mark the list in the current buffer + * slot empty for resuse. Note that afsmon_fs_curr_CBindex was appropriately + * incremented in afsmon_FS_Handler() */ - if (a_newProbeCycle) { - tmp_fslist_item = afsmon_fs_ResultsCB[afsmon_fs_curr_CBindex].list; - for(i=0; iempty = 1; - tmp_fslist_item = tmp_fslist_item->next; - } - } + if (a_newProbeCycle) { + tmp_fslist_item = afsmon_fs_ResultsCB[afsmon_fs_curr_CBindex].list; + for (i = 0; i < numFS; i++) { + tmp_fslist_item->empty = 1; + tmp_fslist_item = tmp_fslist_item->next; + } + } - /* locate last unused item in list */ - tmp_fslist_item = afsmon_fs_ResultsCB[afsmon_fs_curr_CBindex].list; - for(i=0; iempty) break; + /* locate last unused item in list */ + tmp_fslist_item = afsmon_fs_ResultsCB[afsmon_fs_curr_CBindex].list; + for (i = 0; i < numFS; i++) { + if (tmp_fslist_item->empty) + break; tmp_fslist_item = tmp_fslist_item->next; - } - - /* if we could not find one we have an inconsistent list */ - if ( ! tmp_fslist_item->empty ) { - fprintf(stderr,"[ %s ] list inconsistency 1. unable to find an empty slot to store results of probenum %d of %s\n",rn, - xstat_fs_Results.probeNum,xstat_fs_Results.connP->hostName); + } + + /* if we could not find one we have an inconsistent list */ + if (!tmp_fslist_item->empty) { + fprintf(stderr, + "[ %s ] list inconsistency 1. unable to find an empty slot to store results of probenum %d of %s\n", + rn, xstat_fs_Results.probeNum, + xstat_fs_Results.connP->hostName); afsmon_Exit(50); - } + } - tmp_fsPR = tmp_fslist_item->fsResults; + tmp_fsPR = tmp_fslist_item->fsResults; - /* copy hostname and probe number and probe time and probe status. - if the probe failed return now */ + /* copy hostname and probe number and probe time and probe status. + * if the probe failed return now */ - memcpy(tmp_fsPR->connP->hostName, xstat_fs_Results.connP->hostName, sizeof(xstat_fs_Results.connP->hostName)); - tmp_fsPR->probeNum = xstat_fs_Results.probeNum; - tmp_fsPR->probeTime = xstat_fs_Results.probeTime; - tmp_fsPR->probeOK = xstat_fs_Results.probeOK; - if (xstat_fs_Results.probeOK) { /* probeOK = 1 => notOK */ - /* we have a nonempty results structure so mark the list item used */ - tmp_fslist_item->empty = 0; - return(0); - } + memcpy(tmp_fsPR->connP->hostName, xstat_fs_Results.connP->hostName, + sizeof(xstat_fs_Results.connP->hostName)); + tmp_fsPR->probeNum = xstat_fs_Results.probeNum; + tmp_fsPR->probeTime = xstat_fs_Results.probeTime; + tmp_fsPR->probeOK = xstat_fs_Results.probeOK; + if (xstat_fs_Results.probeOK) { /* probeOK = 1 => notOK */ + /* we have a nonempty results structure so mark the list item used */ + tmp_fslist_item->empty = 0; + return (0); + } + + /* copy connection information */ + memcpy(&(tmp_fsPR->connP->skt), &(xstat_fs_Results.connP->skt), + sizeof(struct sockaddr_in)); - /* copy connection information */ - memcpy(&(tmp_fsPR->connP->skt), &(xstat_fs_Results.connP->skt), sizeof(struct sockaddr_in)); + memcpy(tmp_fsPR->connP->hostName, xstat_fs_Results.connP->hostName, + sizeof(xstat_fs_Results.connP->hostName)); + tmp_fsPR->collectionNumber = xstat_fs_Results.collectionNumber; - memcpy(tmp_fsPR->connP->hostName, xstat_fs_Results.connP->hostName, sizeof(xstat_fs_Results.connP->hostName)); - tmp_fsPR->collectionNumber = xstat_fs_Results.collectionNumber; + /* copy the probe data information */ + tmp_fsPR->data.AFS_CollData_len = xstat_fs_Results.data.AFS_CollData_len; + memcpy(tmp_fsPR->data.AFS_CollData_val, + xstat_fs_Results.data.AFS_CollData_val, + xstat_fs_Results.data.AFS_CollData_len * sizeof(afs_int32)); - /* copy the probe data information */ - tmp_fsPR->data.AFS_CollData_len = xstat_fs_Results.data.AFS_CollData_len; - memcpy(tmp_fsPR->data.AFS_CollData_val, xstat_fs_Results.data.AFS_CollData_val, xstat_fs_Results.data.AFS_CollData_len * sizeof(afs_int32)); - - /* we have a valid results structure so mark the list item used */ - tmp_fslist_item->empty = 0; + /* we have a valid results structure so mark the list item used */ + tmp_fslist_item->empty = 0; - /* Print the fs circular buffer */ - Print_FS_CB(); - - return(0); -} /* save_FS_results_inCB() */ + /* Print the fs circular buffer */ + Print_FS_CB(); + + return (0); +} /* save_FS_results_inCB() */ /*----------------------------------------------------------------------- @@ -1761,103 +1834,119 @@ int a_newProbeCycle; /* start of a new probe cycle ? */ *----------------------------------------------------------------------*/ int -fs_Results_ltoa(a_fsData,a_fsResults) -struct fs_Display_Data *a_fsData; /* target buffer */ -struct xstat_fs_ProbeResults *a_fsResults; /* ptr to xstat fs Results */ -{ /* fs_Results_ltoa */ - - static char rn[] = "fs_Results_ltoa"; /* routine name */ - afs_int32 *srcbuf; - struct fs_stats_FullPerfStats *fullPerfP; - int idx; - int i,j; - afs_int32 *tmpbuf; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_fsData= %d, a_fsResults= %d\n", - rn, a_fsData, a_fsResults); +fs_Results_ltoa(a_fsData, a_fsResults) + struct fs_Display_Data *a_fsData; /* target buffer */ + struct xstat_fs_ProbeResults *a_fsResults; /* ptr to xstat fs Results */ +{ /* fs_Results_ltoa */ + + static char rn[] = "fs_Results_ltoa"; /* routine name */ + afs_int32 *srcbuf; + struct fs_stats_FullPerfStats *fullPerfP; + int idx; + int i, j; + afs_int32 *tmpbuf; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_fsData= %d, a_fsResults= %d\n", rn, + a_fsData, a_fsResults); fflush(debugFD); - } + } - fullPerfP = (struct fs_stats_FullPerfStats *) - (a_fsResults->data.AFS_CollData_val); + fullPerfP = (struct fs_stats_FullPerfStats *) + (a_fsResults->data.AFS_CollData_val); - /* there are two parts to the xstat FS statistics - - fullPerfP->overall which give the overall performance statistics, and - - fullPerfP->det which gives detailed info about file server operation - execution times */ + /* there are two parts to the xstat FS statistics + * - fullPerfP->overall which give the overall performance statistics, and + * - fullPerfP->det which gives detailed info about file server operation + * execution times */ - /* copy overall performance statistics */ - srcbuf = (afs_int32 *) &(fullPerfP->overall); - idx = 0; - for(i=0; i< NUM_XSTAT_FS_AFS_PERFSTATS_LONGS; i++) { - sprintf(a_fsData->data[idx],"%d",*srcbuf); + /* copy overall performance statistics */ + srcbuf = (afs_int32 *) & (fullPerfP->overall); + idx = 0; + for (i = 0; i < NUM_XSTAT_FS_AFS_PERFSTATS_LONGS; i++) { + sprintf(a_fsData->data[idx], "%d", *srcbuf); idx++; srcbuf++; - } + } + + /* copy epoch */ + srcbuf = (afs_int32 *) & (fullPerfP->det.epoch); + sprintf(a_fsData->data[idx], "%d", *srcbuf); /* epoch */ + idx++; - /* copy epoch */ - srcbuf = (afs_int32 *) &(fullPerfP->det.epoch); - sprintf(a_fsData->data[idx], "%d", *srcbuf); /* epoch */ - idx++; + /* copy fs operation timing */ - /* copy fs operation timing */ + srcbuf = (afs_int32 *) (fullPerfP->det.rpcOpTimes); - srcbuf = (afs_int32 *) (fullPerfP->det.rpcOpTimes); - - for(i=0; idata[idx], "%d", *srcbuf); /* numOps*/ - idx++; srcbuf++; + for (i = 0; i < FS_STATS_NUM_RPC_OPS; i++) { + sprintf(a_fsData->data[idx], "%d", *srcbuf); /* numOps */ + idx++; + srcbuf++; sprintf(a_fsData->data[idx], "%d", *srcbuf); /* numSuccesses */ - idx++; srcbuf++; - tmpbuf = srcbuf++; /* sum time */ - sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* sqr time */ - sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* min time */ - sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* max time */ - sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - } - - /* copy fs transfer timings */ - - srcbuf = (afs_int32 *) (fullPerfP->det.xferOpTimes); - for(i=0; idata[idx], "%d", *srcbuf); /* numOps*/ - idx++; srcbuf++; + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* sum time */ + sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* sqr time */ + sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* min time */ + sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* max time */ + sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + } + + /* copy fs transfer timings */ + + srcbuf = (afs_int32 *) (fullPerfP->det.xferOpTimes); + for (i = 0; i < FS_STATS_NUM_XFER_OPS; i++) { + sprintf(a_fsData->data[idx], "%d", *srcbuf); /* numOps */ + idx++; + srcbuf++; sprintf(a_fsData->data[idx], "%d", *srcbuf); /* numSuccesses */ - idx++; srcbuf++; - tmpbuf = srcbuf++; /* sum time */ - sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* sqr time */ - sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* min time */ - sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* max time */ - sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* sum time */ + sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* sqr time */ + sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* min time */ + sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* max time */ + sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; sprintf(a_fsData->data[idx], "%d", *srcbuf); /* sum bytes */ - idx++; srcbuf++; + idx++; + srcbuf++; sprintf(a_fsData->data[idx], "%d", *srcbuf); /* min bytes */ - idx++; srcbuf++; + idx++; + srcbuf++; sprintf(a_fsData->data[idx], "%d", *srcbuf); /* max bytes */ - idx++; srcbuf++; - for(j=0; jdata[idx], "%d", *srcbuf); /* bucket[j] */ - idx++; srcbuf++; + idx++; + srcbuf++; + for (j = 0; j < FS_STATS_NUM_XFER_BUCKETS; j++) { + sprintf(a_fsData->data[idx], "%d", *srcbuf); /* bucket[j] */ + idx++; + srcbuf++; } - } + } - return(0); -} /* fs_Results_ltoa */ + return (0); +} /* fs_Results_ltoa */ @@ -1876,88 +1965,91 @@ struct xstat_fs_ProbeResults *a_fsResults; /* ptr to xstat fs Results */ *----------------------------------------------------------------------*/ int -execute_thresh_handler(a_handler, a_hostName, a_hostType, - a_threshName,a_threshValue, a_actValue) -char *a_handler; /* ptr to handler function + args */ -char *a_hostName; /* host name for which threshold crossed */ -int a_hostType; /* fs or cm ? */ -char *a_threshName; /* threshold variable name */ -char *a_threshValue; /* threshold value */ -char *a_actValue; /* actual value */ - -{ /* execute_thresh_handler */ - - static char rn[] = "execute_thresh_handler"; - char fileName[256]; /* file name to execute */ - int i; - char *ch; - int code; - int argNum; - int anotherArg; /* boolean used to flag if another arg is available */ - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_handler= %s, a_hostName= %s, a_hostType= %d, a_threshName= %s, a_threshValue= %s, a_actValue= %s\n", - rn, a_handler, a_hostName, a_hostType, a_threshName, a_threshValue, - a_actValue); +execute_thresh_handler(a_handler, a_hostName, a_hostType, a_threshName, + a_threshValue, a_actValue) + char *a_handler; /* ptr to handler function + args */ + char *a_hostName; /* host name for which threshold crossed */ + int a_hostType; /* fs or cm ? */ + char *a_threshName; /* threshold variable name */ + char *a_threshValue; /* threshold value */ + char *a_actValue; /* actual value */ + +{ /* execute_thresh_handler */ + + static char rn[] = "execute_thresh_handler"; + char fileName[256]; /* file name to execute */ + int i; + char *ch; + int code; + int argNum; + int anotherArg; /* boolean used to flag if another arg is available */ + + if (afsmon_debug) { + fprintf(debugFD, + "[ %s ] Called, a_handler= %s, a_hostName= %s, a_hostType= %d, a_threshName= %s, a_threshValue= %s, a_actValue= %s\n", + rn, a_handler, a_hostName, a_hostType, a_threshName, + a_threshValue, a_actValue); fflush(debugFD); - } + } - /* get the filename to execute - the first argument */ - sscanf(a_handler,"%s",fileName); + /* get the filename to execute - the first argument */ + sscanf(a_handler, "%s", fileName); - /* construct the contents of *argv[] */ + /* construct the contents of *argv[] */ - strncpy(fsHandler_args[0], fileName,256); - strncpy(fsHandler_args[1], a_hostName, HOST_NAME_LEN); - if (a_hostType == FS) strcpy(fsHandler_args[2], "fs"); - else strcpy(fsHandler_args[2], "cm"); - strncpy(fsHandler_args[3], a_threshName, THRESH_VAR_NAME_LEN); - strncpy(fsHandler_args[4], a_threshValue, THRESH_VAR_LEN); - strncpy(fsHandler_args[5], a_actValue, THRESH_VAR_LEN); + strncpy(fsHandler_args[0], fileName, 256); + strncpy(fsHandler_args[1], a_hostName, HOST_NAME_LEN); + if (a_hostType == FS) + strcpy(fsHandler_args[2], "fs"); + else + strcpy(fsHandler_args[2], "cm"); + strncpy(fsHandler_args[3], a_threshName, THRESH_VAR_NAME_LEN); + strncpy(fsHandler_args[4], a_threshValue, THRESH_VAR_LEN); + strncpy(fsHandler_args[5], a_actValue, THRESH_VAR_LEN); - argNum = 6; - anotherArg = 1; - ch = a_handler; + argNum = 6; + anotherArg = 1; + ch = a_handler; - /* we have already extracted the file name so skip to the 1st arg */ - while (isspace(*ch)) /* leading blanks */ + /* we have already extracted the file name so skip to the 1st arg */ + while (isspace(*ch)) /* leading blanks */ ch++; - while (! isspace(*ch) && *ch != '\0') /* handler filename */ + while (!isspace(*ch) && *ch != '\0') /* handler filename */ ch++; - while( *ch != '\0' ) { + while (*ch != '\0') { if (isspace(*ch)) { - anotherArg = 1; - } else if (anotherArg) { - anotherArg = 0; - sscanf(ch,"%s",fsHandler_args[argNum]); - argNum++; + anotherArg = 1; + } else if (anotherArg) { + anotherArg = 0; + sscanf(ch, "%s", fsHandler_args[argNum]); + argNum++; } ch++; if (argNum >= 20) { - sprintf(errMsg, - "Threshold handlers cannot have more than 20 arguments\n"); - afsmon_Exit(55); + sprintf(errMsg, + "Threshold handlers cannot have more than 20 arguments\n"); + afsmon_Exit(55); } - } + } - fsHandler_argv[argNum] = (char *)0; - for(i=0; inumThresh == 0) { + if (a_hostEntry->numThresh == 0) { /* store in ovf count ?? */ - return(0); - } + return (0); + } - count = 0; - threshP = a_hostEntry->thresh; - for(i=0; i < a_hostEntry->numThresh; i++) { + count = 0; + threshP = a_hostEntry->thresh; + for (i = 0; i < a_hostEntry->numThresh; i++) { if (threshP->itemName[0] == '\0') { - threshP++; continue; + threshP++; + continue; } idx = threshP->index; /* positional index to the data array */ - tValue = atof(threshP->threshVal); /* threshold value */ - pValue = atof(a_Data->data[idx]); /* probe value */ + tValue = atof(threshP->threshVal); /* threshold value */ + pValue = atof(a_Data->data[idx]); /* probe value */ if (pValue > tValue) { - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] fs = %s, thresh ovf for %s, threshold= %s, probevalue= %s\n", - rn, a_hostEntry->hostName, threshP->itemName, threshP->threshVal, a_Data->data[idx]); + if (afsmon_debug) { + fprintf(debugFD, + "[ %s ] fs = %s, thresh ovf for %s, threshold= %s, probevalue= %s\n", + rn, a_hostEntry->hostName, threshP->itemName, + threshP->threshVal, a_Data->data[idx]); fflush(debugFD); - } - /* if the threshold is crossed, call the handler function - only if this was a transition -ie, if the threshold was - crossed in the last probe too just count & keep quite! */ + } + /* if the threshold is crossed, call the handler function + * only if this was a transition -ie, if the threshold was + * crossed in the last probe too just count & keep quite! */ - if (! a_Data->threshOvf[idx]) { + if (!a_Data->threshOvf[idx]) { a_Data->threshOvf[idx] = 1; /* call the threshold handler if provided */ if (threshP->handler[0] != '\0') { - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Calling ovf handler %s\n", + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Calling ovf handler %s\n", rn, threshP->handler); fflush(debugFD); - } - execute_thresh_handler(threshP->handler, - a_Data->hostName, FS, threshP->itemName, - threshP->threshVal, a_Data->data[idx]); - } + } + execute_thresh_handler(threshP->handler, a_Data->hostName, + FS, threshP->itemName, + threshP->threshVal, + a_Data->data[idx]); } + } - count++; + count++; } else - /* in case threshold was previously crossed, blank it out */ - a_Data->threshOvf[idx] = 0; + /* in case threshold was previously crossed, blank it out */ + a_Data->threshOvf[idx] = 0; threshP++; - } + } /* store the overflow count */ - a_Data->ovfCount = count; + a_Data->ovfCount = count; - return(0); -} /* check_fs_thresholds */ + return (0); +} /* check_fs_thresholds */ /*----------------------------------------------------------------------- @@ -2072,176 +2168,185 @@ struct fs_Display_Data *a_Data; /* ptr to fs data to be displayed */ int save_FS_data_forDisplay(a_fsResults) -struct xstat_fs_ProbeResults *a_fsResults; -{ /* save_FS_data_forDisplay */ - - static char rn[] = "save_FS_data_forDisplay"; /* routine name */ - struct fs_Display_Data *curr_fsDataP; /* tmp ptr to curr_fsData*/ - struct fs_Display_Data *prev_fsDataP; /* tmp ptr to prev_fsData*/ - struct afsmon_hostEntry *curr_host; - static int probes_Received = 0; /* number of probes reveived in - the current cycle. If this is equal to numFS we got all - the data we want in this cycle and can now display it */ - int numBytes; - int okay; - int i; - int code; - int done; - - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_fsResults= %d\n",rn, a_fsResults); + struct xstat_fs_ProbeResults *a_fsResults; +{ /* save_FS_data_forDisplay */ + + static char rn[] = "save_FS_data_forDisplay"; /* routine name */ + struct fs_Display_Data *curr_fsDataP; /* tmp ptr to curr_fsData */ + struct fs_Display_Data *prev_fsDataP; /* tmp ptr to prev_fsData */ + struct afsmon_hostEntry *curr_host; + static int probes_Received = 0; /* number of probes reveived in + * the current cycle. If this is equal to numFS we got all + * the data we want in this cycle and can now display it */ + int numBytes; + int okay; + int i; + int code; + int done; + + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_fsResults= %d\n", rn, a_fsResults); fflush(debugFD); - } + } - /* store results in the display array */ + /* store results in the display array */ - okay = 0; - curr_fsDataP = curr_fsData; - for (i=0; ihostName,a_fsResults->connP->hostName)) == 0) { - okay = 1; - break; + okay = 0; + curr_fsDataP = curr_fsData; + for (i = 0; i < numFS; i++) { + if ((strcasecmp(curr_fsDataP->hostName, a_fsResults->connP->hostName)) + == 0) { + okay = 1; + break; } curr_fsDataP++; - } - - if (!okay) { - fprintf(stderr,"[ %s ] Could not insert FS probe results for host %s in fs display array\n",rn, a_fsResults->connP->hostName); - afsmon_Exit(65); - } + } - /* Check the status of the probe. If it succeeded, we store its - results in the display data structure. If it failed we only mark - the failed status in the display data structure. */ + if (!okay) { + fprintf(stderr, + "[ %s ] Could not insert FS probe results for host %s in fs display array\n", + rn, a_fsResults->connP->hostName); + afsmon_Exit(65); + } - if (a_fsResults->probeOK) { /* 1 => notOK the xstat results */ + /* Check the status of the probe. If it succeeded, we store its + * results in the display data structure. If it failed we only mark + * the failed status in the display data structure. */ + + if (a_fsResults->probeOK) { /* 1 => notOK the xstat results */ curr_fsDataP->probeOK = 0; /* print the probe status */ - if (afsmon_debug) { - fprintf(debugFD,"\n\t\t ----- fs display data ------\n"); - fprintf(debugFD,"HostName = %s PROBE FAILED \n",curr_fsDataP->hostName); - fflush(debugFD); + if (afsmon_debug) { + fprintf(debugFD, "\n\t\t ----- fs display data ------\n"); + fprintf(debugFD, "HostName = %s PROBE FAILED \n", + curr_fsDataP->hostName); + fflush(debugFD); } - } else { /* probe succeeded, update display data structures */ + } else { /* probe succeeded, update display data structures */ curr_fsDataP->probeOK = 1; - /* covert longs to strings and place them in curr_fsDataP */ - fs_Results_ltoa(curr_fsDataP, a_fsResults); + /* covert longs to strings and place them in curr_fsDataP */ + fs_Results_ltoa(curr_fsDataP, a_fsResults); - /* compare with thresholds and set the overflow flags. - note that the threshold information is in the hostEntry structure and - each threshold item has a positional index associated with it */ + /* compare with thresholds and set the overflow flags. + * note that the threshold information is in the hostEntry structure and + * each threshold item has a positional index associated with it */ - /* locate the hostEntry for this host */ - done = 0; - curr_host = FSnameList; - for(i=0; ihostName,a_fsResults->connP->hostName) == 0) { - done = 1; - break; - } - curr_host = curr_host->next;; - } - if (!done) afsmon_Exit(70); + /* locate the hostEntry for this host */ + done = 0; + curr_host = FSnameList; + for (i = 0; i < numFS; i++) { + if (strcasecmp(curr_host->hostName, a_fsResults->connP->hostName) + == 0) { + done = 1; + break; + } + curr_host = curr_host->next;; + } + if (!done) + afsmon_Exit(70); - code = check_fs_thresholds(curr_host, curr_fsDataP); - if (code) { - fprintf(stderr,"[ %s ] Error in checking thresholds\n",rn); - afsmon_Exit(75); - } + code = check_fs_thresholds(curr_host, curr_fsDataP); + if (code) { + fprintf(stderr, "[ %s ] Error in checking thresholds\n", rn); + afsmon_Exit(75); + } - - /* print the info we just saved */ - if (afsmon_debug) { - fprintf(debugFD,"\n\t\t ----- fs display data ------\n"); - fprintf(debugFD,"HostName = %s\n",curr_fsDataP->hostName); - for(i=0; idata[i], - fs_varNames[i], curr_fsDataP->threshOvf[i] ? "(ovf)":"" ); + /* print the info we just saved */ - fprintf(debugFD,"\t\t--------------------------------\n\n"); - fflush(debugFD); - } + if (afsmon_debug) { + fprintf(debugFD, "\n\t\t ----- fs display data ------\n"); + fprintf(debugFD, "HostName = %s\n", curr_fsDataP->hostName); + for (i = 0; i < NUM_FS_STAT_ENTRIES; i++) + fprintf(debugFD, "%20s %30s %s\n", curr_fsDataP->data[i], + fs_varNames[i], + curr_fsDataP->threshOvf[i] ? "(ovf)" : ""); + + fprintf(debugFD, "\t\t--------------------------------\n\n"); + fflush(debugFD); + } - } /* the probe succeeded, so we store the data in the display structure */ + } /* the probe succeeded, so we store the data in the display structure */ /* if we have received a reply from all the hosts for this probe cycle, - it is time to display the data */ + * it is time to display the data */ - probes_Received++; - if (probes_Received == numFS) { + probes_Received++; + if (probes_Received == numFS) { probes_Received = 0; if (afsmon_fs_curr_probeNum != afsmon_fs_prev_probeNum + 1) { - sprintf(errMsg,"[ %s ] Probe number %d missed! \n", - rn, afsmon_fs_prev_probeNum +1); - afsmon_Exit(80); + sprintf(errMsg, "[ %s ] Probe number %d missed! \n", rn, + afsmon_fs_prev_probeNum + 1); + afsmon_Exit(80); } else - afsmon_fs_prev_probeNum++; + afsmon_fs_prev_probeNum++; /* backup the display data of the probe cycle that just completed - - ie., store curr_fsData in prev_fsData */ + * ie., store curr_fsData in prev_fsData */ - memcpy((char *)prev_fsData, (char *)curr_fsData, (numFS * sizeof(struct fs_Display_Data)) ); + memcpy((char *)prev_fsData, (char *)curr_fsData, + (numFS * sizeof(struct fs_Display_Data))); /* initialize curr_fsData but retain the threshold flag information. - The previous state of threshold flags is used in check_fs_thresholds()*/ + * The previous state of threshold flags is used in check_fs_thresholds() */ numBytes = NUM_FS_STAT_ENTRIES * CM_STAT_STRING_LEN; curr_fsDataP = curr_fsData; - for(i=0; iprobeOK = 0; - curr_fsDataP->ovfCount = 0; - memset((char *)curr_fsDataP->data, 0, numBytes); - curr_fsDataP++; + for (i = 0; i < numFS; i++) { + curr_fsDataP->probeOK = 0; + curr_fsDataP->ovfCount = 0; + memset((char *)curr_fsDataP->data, 0, numBytes); + curr_fsDataP++; } - + /* prev_fsData now contains all the information for the probe cycle - that just completed. Now count the number of threshold overflows for - use in the overview screen */ + * that just completed. Now count the number of threshold overflows for + * use in the overview screen */ prev_fsDataP = prev_fsData; num_fs_alerts = 0; numHosts_onfs_alerts = 0; - for(i=0; iprobeOK ) { /* if probe failed */ - num_fs_alerts++; - numHosts_onfs_alerts++; - } if (prev_fsDataP->ovfCount) { /* overflows ?? */ - num_fs_alerts += prev_fsDataP->ovfCount; - numHosts_onfs_alerts++; - } - prev_fsDataP++; + for (i = 0; i < numFS; i++) { + if (!prev_fsDataP->probeOK) { /* if probe failed */ + num_fs_alerts++; + numHosts_onfs_alerts++; + } + if (prev_fsDataP->ovfCount) { /* overflows ?? */ + num_fs_alerts += prev_fsDataP->ovfCount; + numHosts_onfs_alerts++; + } + prev_fsDataP++; } if (afsmon_debug) - fprintf(debugFD,"Number of FS alerts = %d (on %d hosts)\n", - num_fs_alerts, numHosts_onfs_alerts); + fprintf(debugFD, "Number of FS alerts = %d (on %d hosts)\n", + num_fs_alerts, numHosts_onfs_alerts); /* flag that the data is now ready to be displayed */ fs_Data_Available = 1; - /* call the Overview frame update routine (update only FS info)*/ + /* call the Overview frame update routine (update only FS info) */ ovw_refresh(ovw_currPage, OVW_UPDATE_FS); /* call the File Servers frame update routine */ fs_refresh(fs_currPage, fs_curr_LCol); - } /* display data */ + } + /* display data */ + return (0); +} /* save_FS_data_forDisplay */ - return(0); -} /* save_FS_data_forDisplay */ - @@ -2259,65 +2364,64 @@ struct xstat_fs_ProbeResults *a_fsResults; *----------------------------------------------------------------------*/ int -afsmon_FS_Handler() -{ /* afsmon_FS_Handler() */ - static char rn[] = "afsmon_FS_Handler"; /* routine name */ - int newProbeCycle; /* start of new probe cycle ? */ - int code; /* return status */ - - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, hostName= %s, probeNum= %d, status=%s\n", - rn, - xstat_fs_Results.connP->hostName, - xstat_fs_Results.probeNum, - xstat_fs_Results.probeOK? "FAILED":"OK"); - fflush(debugFD); - } - - - /* print the probe results to output file */ - if (afsmon_output) { +afsmon_FS_Handler() +{ /* afsmon_FS_Handler() */ + static char rn[] = "afsmon_FS_Handler"; /* routine name */ + int newProbeCycle; /* start of new probe cycle ? */ + int code; /* return status */ + + + if (afsmon_debug) { + fprintf(debugFD, + "[ %s ] Called, hostName= %s, probeNum= %d, status=%s\n", rn, + xstat_fs_Results.connP->hostName, xstat_fs_Results.probeNum, + xstat_fs_Results.probeOK ? "FAILED" : "OK"); + fflush(debugFD); + } + + + /* print the probe results to output file */ + if (afsmon_output) { code = afsmon_fsOutput(output_filename, afsmon_detOutput); - if (code) { - fprintf(stderr,"[ %s ] output to file %s returned error code=%d\n", - rn,output_filename,code); - } - } - - /* Update current probe number and circular buffer index. if current - probenum changed make sure it is only by 1 */ - - newProbeCycle = 0; - if (xstat_fs_Results.probeNum != afsmon_fs_curr_probeNum) { - if (xstat_fs_Results.probeNum == afsmon_fs_curr_probeNum + 1) { - afsmon_fs_curr_probeNum++; - newProbeCycle = 1; - if (num_bufSlots) - afsmon_fs_curr_CBindex= - (afsmon_fs_curr_probeNum - 1) % num_bufSlots; + if (code) { + fprintf(stderr, + "[ %s ] output to file %s returned error code=%d\n", rn, + output_filename, code); } - else { - fprintf(stderr,"[ %s ] probe number %d-1 missed\n", - rn,xstat_fs_Results.probeNum); - afsmon_Exit(85); + } + + /* Update current probe number and circular buffer index. if current + * probenum changed make sure it is only by 1 */ + + newProbeCycle = 0; + if (xstat_fs_Results.probeNum != afsmon_fs_curr_probeNum) { + if (xstat_fs_Results.probeNum == afsmon_fs_curr_probeNum + 1) { + afsmon_fs_curr_probeNum++; + newProbeCycle = 1; + if (num_bufSlots) + afsmon_fs_curr_CBindex = + (afsmon_fs_curr_probeNum - 1) % num_bufSlots; + } else { + fprintf(stderr, "[ %s ] probe number %d-1 missed\n", rn, + xstat_fs_Results.probeNum); + afsmon_Exit(85); } - } + } - /* store the results of this probe in the FS circular buffer */ - if (num_bufSlots) - save_FS_results_inCB(newProbeCycle); + /* store the results of this probe in the FS circular buffer */ + if (num_bufSlots) + save_FS_results_inCB(newProbeCycle); - /* store the results of the current probe in the fs data display structure. - if the current probe number changed, swap the current and previous display - structures. note that the display screen is updated from these structures - and should start showing the data of the just completed probe cycle */ + /* store the results of the current probe in the fs data display structure. + * if the current probe number changed, swap the current and previous display + * structures. note that the display screen is updated from these structures + * and should start showing the data of the just completed probe cycle */ - save_FS_data_forDisplay(&xstat_fs_Results); + save_FS_data_forDisplay(&xstat_fs_Results); - return(0); -} + return (0); +} @@ -2329,41 +2433,46 @@ afsmon_FS_Handler() * Prints the Cache Manager circular buffer *----------------------------------------------------------------------*/ -void +void Print_CM_CB() -{ /* Print_CM_CB() */ - - struct afsmon_cm_Results_list *cmlist; - int i; - int j; - - /* print valid info in the cm CB */ - - if (afsmon_debug) { - fprintf(debugFD,"==================== CM Buffer ========================\n"); - fprintf(debugFD,"afsmon_cm_curr_CBindex = %d\n",afsmon_cm_curr_CBindex); - fprintf(debugFD,"afsmon_cm_curr_probeNum = %d\n\n",afsmon_cm_curr_probeNum); - - for(i=0; iempty) { - fprintf(debugFD,"\t %d) probeNum = %d host = %s", - j,cmlist->cmResults->probeNum, - cmlist-> cmResults->connP->hostName); - if (cmlist->cmResults->probeOK) fprintf(debugFD," NOTOK\n"); - else fprintf(debugFD," OK\n"); +{ /* Print_CM_CB() */ + + struct afsmon_cm_Results_list *cmlist; + int i; + int j; + + /* print valid info in the cm CB */ + + if (afsmon_debug) { + fprintf(debugFD, + "==================== CM Buffer ========================\n"); + fprintf(debugFD, "afsmon_cm_curr_CBindex = %d\n", + afsmon_cm_curr_CBindex); + fprintf(debugFD, "afsmon_cm_curr_probeNum = %d\n\n", + afsmon_cm_curr_probeNum); + + for (i = 0; i < num_bufSlots; i++) { + fprintf(debugFD, "\t--------- slot %d ----------\n", i); + cmlist = afsmon_cm_ResultsCB[i].list; + j = 0; + while (j < numCM) { + if (!cmlist->empty) { + fprintf(debugFD, "\t %d) probeNum = %d host = %s", j, + cmlist->cmResults->probeNum, + cmlist->cmResults->connP->hostName); + if (cmlist->cmResults->probeOK) + fprintf(debugFD, " NOTOK\n"); + else + fprintf(debugFD, " OK\n"); } else - fprintf(debugFD,"\t %d) -- empty --\n",j); + fprintf(debugFD, "\t %d) -- empty --\n", j); cmlist = cmlist->next; j++; + } + if (cmlist != (struct afsmon_cm_Results_list *)0) + fprintf(debugFD, "dangling last next ptr cm CB\n"); } - if (cmlist != (struct afsmon_cm_Results_list *)0 ) - fprintf(debugFD,"dangling last next ptr cm CB\n"); - } - } + } } @@ -2386,84 +2495,94 @@ Print_CM_CB() int save_CM_results_inCB(a_newProbeCycle) -int a_newProbeCycle; /* start of new probe cycle ? */ + int a_newProbeCycle; /* start of new probe cycle ? */ -{ /* save_CM_results_inCB() */ - static char rn[] = "save_CM_results_inCB"; /* routine name */ - struct afsmon_cm_Results_list *tmp_cmlist_item; /* temp cm list item */ - struct xstat_cm_ProbeResults *tmp_cmPR; /* temp ptr */ - int i; +{ /* save_CM_results_inCB() */ + static char rn[] = "save_CM_results_inCB"; /* routine name */ + struct afsmon_cm_Results_list *tmp_cmlist_item; /* temp cm list item */ + struct xstat_cm_ProbeResults *tmp_cmPR; /* temp ptr */ + int i; - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_newProbeCycle= %d\n",rn, a_newProbeCycle); + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_newProbeCycle= %d\n", rn, + a_newProbeCycle); fflush(debugFD); - } - - /* If a new probe cycle started, mark the list in the current buffer - slot empty for resuse. Note that afsmon_cm_curr_CBindex was appropriately - incremented in afsmon_CM_Handler() */ - - if (a_newProbeCycle) { - tmp_cmlist_item = afsmon_cm_ResultsCB[afsmon_cm_curr_CBindex].list; - for(i=0; iempty = 1; - tmp_cmlist_item = tmp_cmlist_item->next; - } - } - - /* locate last unused item in list */ - tmp_cmlist_item = afsmon_cm_ResultsCB[afsmon_cm_curr_CBindex].list; - for(i=0; iempty) break; + } + + /* If a new probe cycle started, mark the list in the current buffer + * slot empty for resuse. Note that afsmon_cm_curr_CBindex was appropriately + * incremented in afsmon_CM_Handler() */ + + if (a_newProbeCycle) { + tmp_cmlist_item = afsmon_cm_ResultsCB[afsmon_cm_curr_CBindex].list; + for (i = 0; i < numCM; i++) { + tmp_cmlist_item->empty = 1; + tmp_cmlist_item = tmp_cmlist_item->next; + } + } + + /* locate last unused item in list */ + tmp_cmlist_item = afsmon_cm_ResultsCB[afsmon_cm_curr_CBindex].list; + for (i = 0; i < numCM; i++) { + if (tmp_cmlist_item->empty) + break; tmp_cmlist_item = tmp_cmlist_item->next; - } - - /* if we could not find one we have an inconsistent list */ - if ( ! tmp_cmlist_item->empty ) { - fprintf(stderr,"[ %s ] list inconsistency 1. unable to find an empty slot to store results of probenum %d of %s\n",rn, - xstat_cm_Results.probeNum,xstat_cm_Results.connP->hostName); + } + + /* if we could not find one we have an inconsistent list */ + if (!tmp_cmlist_item->empty) { + fprintf(stderr, + "[ %s ] list inconsistency 1. unable to find an empty slot to store results of probenum %d of %s\n", + rn, xstat_cm_Results.probeNum, + xstat_cm_Results.connP->hostName); afsmon_Exit(90); - } + } - tmp_cmPR = tmp_cmlist_item->cmResults; + tmp_cmPR = tmp_cmlist_item->cmResults; - /* copy hostname and probe number and probe time and probe status. - if the probe failed return now */ + /* copy hostname and probe number and probe time and probe status. + * if the probe failed return now */ - memcpy(tmp_cmPR->connP->hostName, xstat_cm_Results.connP->hostName, sizeof(xstat_cm_Results.connP->hostName)); - tmp_cmPR->probeNum = xstat_cm_Results.probeNum; - tmp_cmPR->probeTime = xstat_cm_Results.probeTime; - tmp_cmPR->probeOK = xstat_cm_Results.probeOK; - if (xstat_cm_Results.probeOK) { /* probeOK = 1 => notOK */ - /* we have a nonempty results structure so mark the list item used */ - tmp_cmlist_item->empty = 0; - return(0); - } + memcpy(tmp_cmPR->connP->hostName, xstat_cm_Results.connP->hostName, + sizeof(xstat_cm_Results.connP->hostName)); + tmp_cmPR->probeNum = xstat_cm_Results.probeNum; + tmp_cmPR->probeTime = xstat_cm_Results.probeTime; + tmp_cmPR->probeOK = xstat_cm_Results.probeOK; + if (xstat_cm_Results.probeOK) { /* probeOK = 1 => notOK */ + /* we have a nonempty results structure so mark the list item used */ + tmp_cmlist_item->empty = 0; + return (0); + } - /* copy connection information */ - memcpy(&(tmp_cmPR->connP->skt), &(xstat_cm_Results.connP->skt), sizeof(struct sockaddr_in)); + /* copy connection information */ + memcpy(&(tmp_cmPR->connP->skt), &(xstat_cm_Results.connP->skt), + sizeof(struct sockaddr_in)); /**** NEED TO COPY rx_connection INFORMATION HERE ******/ - memcpy(tmp_cmPR->connP->hostName, xstat_cm_Results.connP->hostName, sizeof(xstat_cm_Results.connP->hostName)); - tmp_cmPR->collectionNumber = xstat_cm_Results.collectionNumber; + memcpy(tmp_cmPR->connP->hostName, xstat_cm_Results.connP->hostName, + sizeof(xstat_cm_Results.connP->hostName)); + tmp_cmPR->collectionNumber = xstat_cm_Results.collectionNumber; - /* copy the probe data information */ - tmp_cmPR->data.AFSCB_CollData_len = xstat_cm_Results.data.AFSCB_CollData_len; - memcpy(tmp_cmPR->data.AFSCB_CollData_val, xstat_cm_Results.data.AFSCB_CollData_val, xstat_cm_Results.data.AFSCB_CollData_len * sizeof(afs_int32)); + /* copy the probe data information */ + tmp_cmPR->data.AFSCB_CollData_len = + xstat_cm_Results.data.AFSCB_CollData_len; + memcpy(tmp_cmPR->data.AFSCB_CollData_val, + xstat_cm_Results.data.AFSCB_CollData_val, + xstat_cm_Results.data.AFSCB_CollData_len * sizeof(afs_int32)); - - /* we have a valid results structure so mark the list item used */ - tmp_cmlist_item->empty = 0; - /* print the stored info - to make sure we copied it right */ - /* Print_cm_FullPerfInfo(tmp_cmPR); */ - /* Print the cm circular buffer */ - Print_CM_CB(); - return(0); -} /* save_CM_results_inCB */ + /* we have a valid results structure so mark the list item used */ + tmp_cmlist_item->empty = 0; + + /* print the stored info - to make sure we copied it right */ + /* Print_cm_FullPerfInfo(tmp_cmPR); */ + /* Print the cm circular buffer */ + Print_CM_CB(); + return (0); +} /* save_CM_results_inCB */ @@ -2484,202 +2603,234 @@ int a_newProbeCycle; /* start of new probe cycle ? */ *----------------------------------------------------------------------*/ int -cm_Results_ltoa(a_cmData,a_cmResults) -struct cm_Display_Data *a_cmData; /* target buffer */ -struct xstat_cm_ProbeResults *a_cmResults; /* ptr to xstat cm Results */ -{ /* cm_Results_ltoa */ - - static char rn[] = "cm_Results_ltoa"; /* routine name */ - struct afs_stats_CMFullPerf *fullP; /* ptr to complete CM stats */ - afs_int32 *srcbuf; - afs_int32 *tmpbuf; - int i,j; - int idx; - afs_int32 numLongs; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_cmData= %d, a_cmResults= %d\n", - rn, a_cmData, a_cmResults); +cm_Results_ltoa(a_cmData, a_cmResults) + struct cm_Display_Data *a_cmData; /* target buffer */ + struct xstat_cm_ProbeResults *a_cmResults; /* ptr to xstat cm Results */ +{ /* cm_Results_ltoa */ + + static char rn[] = "cm_Results_ltoa"; /* routine name */ + struct afs_stats_CMFullPerf *fullP; /* ptr to complete CM stats */ + afs_int32 *srcbuf; + afs_int32 *tmpbuf; + int i, j; + int idx; + afs_int32 numLongs; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_cmData= %d, a_cmResults= %d\n", rn, + a_cmData, a_cmResults); fflush(debugFD); - } - - - fullP = (struct afs_stats_CMFullPerf *) - (xstat_cm_Results.data.AFSCB_CollData_val); - - /* There are 4 parts to CM statistics - - Overall performance statistics (including up/down statistics) - - This CMs FS RPC operations info - - This CMs FS RPC errors info - - This CMs FS transfers info - - Authentication info - - [Un]Replicated access info - */ - - /* copy overall performance statistics */ - srcbuf = (afs_int32 *) &(fullP->perf); - idx = 0; - /* we skip the 19 entry, ProtServAddr, so the index must account for this */ - for(i=0 ; iperf); + idx = 0; + /* we skip the 19 entry, ProtServAddr, so the index must account for this */ + for (i = 0; i < NUM_AFS_STATS_CMPERF_LONGS + 1; i++) { if (i == 19) { - srcbuf++; - continue; /* skip ProtServerAddr */ + srcbuf++; + continue; /* skip ProtServerAddr */ } sprintf(a_cmData->data[idx], "%d", *srcbuf); idx++; srcbuf++; - } - - /*printf("Ending index value = %d\n",idx-1);*/ - - /* server up/down statistics */ - /* copy file server up/down stats */ - srcbuf = (afs_int32 *) (fullP->perf.fs_UpDown); - numLongs = 2 * (sizeof(struct afs_stats_SrvUpDownInfo) / sizeof(afs_int32)); - for(i=0 ; iperf.fs_UpDown); + numLongs = + 2 * (sizeof(struct afs_stats_SrvUpDownInfo) / sizeof(afs_int32)); + for (i = 0; i < numLongs; i++) { sprintf(a_cmData->data[idx], "%d", *srcbuf); idx++; srcbuf++; - } - - /*printf("Ending index value = %d\n",idx-1);*/ - - /* copy volume location server up/down stats */ - srcbuf = (afs_int32 *) (fullP->perf.vl_UpDown); - numLongs = 2 * (sizeof(struct afs_stats_SrvUpDownInfo) / sizeof(afs_int32)); - for(i=0 ; iperf.vl_UpDown); + numLongs = + 2 * (sizeof(struct afs_stats_SrvUpDownInfo) / sizeof(afs_int32)); + for (i = 0; i < numLongs; i++) { sprintf(a_cmData->data[idx], "%d", *srcbuf); idx++; srcbuf++; - } - - /*printf("Ending index value = %d\n",idx-1);*/ - - /* copy CMs individual FS RPC operations info */ - srcbuf = (afs_int32 *) (fullP->rpc.fsRPCTimes); - for(i=0; idata[idx], "%d", *srcbuf); /* numOps*/ - idx++; srcbuf++; + } + + /*printf("Ending index value = %d\n",idx-1); */ + + /* copy CMs individual FS RPC operations info */ + srcbuf = (afs_int32 *) (fullP->rpc.fsRPCTimes); + for (i = 0; i < AFS_STATS_NUM_FS_RPC_OPS; i++) { + sprintf(a_cmData->data[idx], "%d", *srcbuf); /* numOps */ + idx++; + srcbuf++; sprintf(a_cmData->data[idx], "%d", *srcbuf); /* numSuccesses */ - idx++; srcbuf++; - tmpbuf = srcbuf++; /* sum time */ - sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* sqr time */ - sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* min time */ - sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* max time */ - sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - } - - /*printf("Ending index value = %d\n",idx-1);*/ - - /* copy CMs individual FS RPC errors info */ - - srcbuf = (afs_int32 *) (fullP->rpc.fsRPCErrors); - for(i=0; idata[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* sqr time */ + sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* min time */ + sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* max time */ + sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + } + + /*printf("Ending index value = %d\n",idx-1); */ + + /* copy CMs individual FS RPC errors info */ + + srcbuf = (afs_int32 *) (fullP->rpc.fsRPCErrors); + for (i = 0; i < AFS_STATS_NUM_FS_RPC_OPS; i++) { sprintf(a_cmData->data[idx], "%d", *srcbuf); /* server */ - idx++; srcbuf++; + idx++; + srcbuf++; sprintf(a_cmData->data[idx], "%d", *srcbuf); /* network */ - idx++; srcbuf++; + idx++; + srcbuf++; sprintf(a_cmData->data[idx], "%d", *srcbuf); /* prot */ - idx++; srcbuf++; + idx++; + srcbuf++; sprintf(a_cmData->data[idx], "%d", *srcbuf); /* vol */ - idx++; srcbuf++; + idx++; + srcbuf++; sprintf(a_cmData->data[idx], "%d", *srcbuf); /* busies */ - idx++; srcbuf++; + idx++; + srcbuf++; sprintf(a_cmData->data[idx], "%d", *srcbuf); /* other */ - idx++; srcbuf++; - } + idx++; + srcbuf++; + } - /*printf("Ending index value = %d\n",idx-1);*/ + /*printf("Ending index value = %d\n",idx-1); */ - /* copy CMs individual RPC transfers info */ + /* copy CMs individual RPC transfers info */ - srcbuf = (afs_int32 *) (fullP->rpc.fsXferTimes); - for(i=0; idata[idx], "%d", *srcbuf); /* numOps*/ - idx++; srcbuf++; + srcbuf = (afs_int32 *) (fullP->rpc.fsXferTimes); + for (i = 0; i < AFS_STATS_NUM_FS_XFER_OPS; i++) { + sprintf(a_cmData->data[idx], "%d", *srcbuf); /* numOps */ + idx++; + srcbuf++; sprintf(a_cmData->data[idx], "%d", *srcbuf); /* numSuccesses */ - idx++; srcbuf++; - tmpbuf = srcbuf++; /* sum time */ - sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* sqr time */ - sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* min time */ - sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* max time */ - sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* sum time */ + sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* sqr time */ + sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* min time */ + sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* max time */ + sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; sprintf(a_cmData->data[idx], "%d", *srcbuf); /* sum bytes */ - idx++; srcbuf++; + idx++; + srcbuf++; sprintf(a_cmData->data[idx], "%d", *srcbuf); /* min bytes */ - idx++; srcbuf++; + idx++; + srcbuf++; sprintf(a_cmData->data[idx], "%d", *srcbuf); /* max bytes */ - idx++; srcbuf++; - for(j=0; jdata[idx], "%d", *srcbuf); /* bucket[j] */ - idx++; srcbuf++; + idx++; + srcbuf++; + for (j = 0; j < AFS_STATS_NUM_XFER_BUCKETS; j++) { + sprintf(a_cmData->data[idx], "%d", *srcbuf); /* bucket[j] */ + idx++; + srcbuf++; } } - /*printf("Ending index value = %d\n",idx-1);*/ + /*printf("Ending index value = %d\n",idx-1); */ - /* copy CM operations timings */ + /* copy CM operations timings */ - srcbuf = (afs_int32 *) (fullP->rpc.cmRPCTimes); - for(i=0; idata[idx], "%d", *srcbuf); /* numOps*/ - idx++; srcbuf++; + srcbuf = (afs_int32 *) (fullP->rpc.cmRPCTimes); + for (i = 0; i < AFS_STATS_NUM_CM_RPC_OPS; i++) { + sprintf(a_cmData->data[idx], "%d", *srcbuf); /* numOps */ + idx++; + srcbuf++; sprintf(a_cmData->data[idx], "%d", *srcbuf); /* numSuccesses */ - idx++; srcbuf++; - tmpbuf = srcbuf++; /* sum time */ - sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* sqr time */ - sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* min time */ - sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - tmpbuf = srcbuf++; /* max time */ - sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); - idx++; srcbuf++; - } - - /*printf("Ending index value = %d\n",idx-1);*/ - - /* copy authentication info */ - - srcbuf = (afs_int32 *) &(fullP->authent); - numLongs = sizeof(struct afs_stats_AuthentInfo) / sizeof(afs_int32); - for(i=0; idata[idx], "%d", *srcbuf); - idx++; srcbuf++; - } - - /*printf("Ending index value = %d\n",idx-1);*/ - - /* copy CM [un]replicated access info */ - - srcbuf = (afs_int32 *) &(fullP->accessinf); - numLongs = sizeof(struct afs_stats_AccessInfo) / sizeof(afs_int32); - for(i=0; idata[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* sqr time */ + sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* min time */ + sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + tmpbuf = srcbuf++; /* max time */ + sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf); + idx++; + srcbuf++; + } + + /*printf("Ending index value = %d\n",idx-1); */ + + /* copy authentication info */ + + srcbuf = (afs_int32 *) & (fullP->authent); + numLongs = sizeof(struct afs_stats_AuthentInfo) / sizeof(afs_int32); + for (i = 0; i < numLongs; i++) { sprintf(a_cmData->data[idx], "%d", *srcbuf); - idx++; srcbuf++; - } + idx++; + srcbuf++; + } - /*printf("Ending index value = %d\n",idx-1);*/ - return(0); + /*printf("Ending index value = %d\n",idx-1); */ -} /* cm_Results_ltoa */ + /* copy CM [un]replicated access info */ + + srcbuf = (afs_int32 *) & (fullP->accessinf); + numLongs = sizeof(struct afs_stats_AccessInfo) / sizeof(afs_int32); + for (i = 0; i < numLongs; i++) { + sprintf(a_cmData->data[idx], "%d", *srcbuf); + idx++; + srcbuf++; + } + + /*printf("Ending index value = %d\n",idx-1); */ + return (0); + +} /* cm_Results_ltoa */ /*----------------------------------------------------------------------- @@ -2702,77 +2853,81 @@ struct xstat_cm_ProbeResults *a_cmResults; /* ptr to xstat cm Results */ int check_cm_thresholds(a_hostEntry, a_Data) -struct afsmon_hostEntry *a_hostEntry; /* ptr to hostEntry */ -struct cm_Display_Data *a_Data; /* ptr to cm data to be displayed */ - -{ /* check_cm_thresholds */ - - static char rn[] = "check_cm_thresholds"; - struct Threshold *threshP; - double tValue; /* threshold value */ - double pValue; /* probe value */ - int i; - int idx; - int count; /* number of thresholds exceeded */ - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_hostEntry= %d, a_Data= %d\n", - rn, a_hostEntry, a_Data); + struct afsmon_hostEntry *a_hostEntry; /* ptr to hostEntry */ + struct cm_Display_Data *a_Data; /* ptr to cm data to be displayed */ + +{ /* check_cm_thresholds */ + + static char rn[] = "check_cm_thresholds"; + struct Threshold *threshP; + double tValue; /* threshold value */ + double pValue; /* probe value */ + int i; + int idx; + int count; /* number of thresholds exceeded */ + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_hostEntry= %d, a_Data= %d\n", rn, + a_hostEntry, a_Data); fflush(debugFD); - } + } - if (a_hostEntry->numThresh == 0) { + if (a_hostEntry->numThresh == 0) { /* store in ovf count ?? */ - return(0); - } + return (0); + } - count = 0; - threshP = a_hostEntry->thresh; - for(i=0; i < a_hostEntry->numThresh; i++) { + count = 0; + threshP = a_hostEntry->thresh; + for (i = 0; i < a_hostEntry->numThresh; i++) { if (threshP->itemName[0] == '\0') { - threshP++; continue; + threshP++; + continue; } idx = threshP->index; /* positional index to the data array */ - tValue = atof(threshP->threshVal); /* threshold value */ - pValue = atof(a_Data->data[idx]); /* probe value */ + tValue = atof(threshP->threshVal); /* threshold value */ + pValue = atof(a_Data->data[idx]); /* probe value */ if (pValue > tValue) { - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] cm = %s, thresh ovf for %s, threshold= %s, probevalue= %s\n", - rn, a_hostEntry->hostName, threshP->itemName, threshP->threshVal , a_Data->data[idx]); - fflush(debugFD); - } + if (afsmon_debug) { + fprintf(debugFD, + "[ %s ] cm = %s, thresh ovf for %s, threshold= %s, probevalue= %s\n", + rn, a_hostEntry->hostName, threshP->itemName, + threshP->threshVal, a_Data->data[idx]); + fflush(debugFD); + } - /* if the threshold is crossed, call the handler function - only if this was a transition -ie, if the threshold was - crossed in the last probe too just count & keep quite! */ + /* if the threshold is crossed, call the handler function + * only if this was a transition -ie, if the threshold was + * crossed in the last probe too just count & keep quite! */ - if (! a_Data->threshOvf[idx]) { + if (!a_Data->threshOvf[idx]) { a_Data->threshOvf[idx] = 1; /* call the threshold handler if provided */ if (threshP->handler[0] != '\0') { - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Calling ovf handler %s\n", + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Calling ovf handler %s\n", rn, threshP->handler); fflush(debugFD); - } - execute_thresh_handler(threshP->handler, - a_Data->hostName, CM, threshP->itemName, - threshP->threshVal, a_Data->data[idx]); - } + } + execute_thresh_handler(threshP->handler, a_Data->hostName, + CM, threshP->itemName, + threshP->threshVal, + a_Data->data[idx]); } + } - count++; + count++; } else - /* in case threshold was previously crossed, blank it out */ - a_Data->threshOvf[idx] = 0; + /* in case threshold was previously crossed, blank it out */ + a_Data->threshOvf[idx] = 0; threshP++; - } + } /* store the overflow count */ - a_Data->ovfCount = count; + a_Data->ovfCount = count; - return(0); -} /* check_cm_thresholds */ + return (0); +} /* check_cm_thresholds */ /*----------------------------------------------------------------------- @@ -2795,198 +2950,222 @@ struct cm_Display_Data *a_Data; /* ptr to cm data to be displayed */ int save_CM_data_forDisplay(a_cmResults) -struct xstat_cm_ProbeResults *a_cmResults; -{ /* save_CM_data_forDisplay */ - - static char rn[] = "save_CM_data_forDisplay"; /* routine name */ - struct cm_Display_Data *curr_cmDataP; - struct cm_Display_Data *prev_cmDataP; - struct afsmon_hostEntry *curr_host; - static int probes_Received = 0; /* number of probes reveived in - the current cycle. If this is equal to numFS we got all - the data we want in this cycle and can now display it */ - int numBytes; - int done; - int code; - int okay; - int i; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, a_cmResults= %d\n",rn, a_cmResults); + struct xstat_cm_ProbeResults *a_cmResults; +{ /* save_CM_data_forDisplay */ + + static char rn[] = "save_CM_data_forDisplay"; /* routine name */ + struct cm_Display_Data *curr_cmDataP; + struct cm_Display_Data *prev_cmDataP; + struct afsmon_hostEntry *curr_host; + static int probes_Received = 0; /* number of probes reveived in + * the current cycle. If this is equal to numFS we got all + * the data we want in this cycle and can now display it */ + int numBytes; + int done; + int code; + int okay; + int i; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, a_cmResults= %d\n", rn, a_cmResults); fflush(debugFD); - } + } - /* store results in the display array */ + /* store results in the display array */ - okay = 0; - curr_cmDataP = curr_cmData; - for (i=0; ihostName,a_cmResults->connP->hostName)) == 0) { - okay = 1; - break; + okay = 0; + curr_cmDataP = curr_cmData; + for (i = 0; i < numCM; i++) { + if ((strcasecmp(curr_cmDataP->hostName, a_cmResults->connP->hostName)) + == 0) { + okay = 1; + break; } curr_cmDataP++; - } + } - if (!okay) { - fprintf(stderr,"[ %s ] Could not insert CM probe results for host %s in cm display array\n",rn, a_cmResults->connP->hostName); + if (!okay) { + fprintf(stderr, + "[ %s ] Could not insert CM probe results for host %s in cm display array\n", + rn, a_cmResults->connP->hostName); afsmon_Exit(95); - } + } - /* Check the status of the probe. If it succeeded, we store its - results in the display data structure. If it failed we only mark - the failed status in the display data structure. */ + /* Check the status of the probe. If it succeeded, we store its + * results in the display data structure. If it failed we only mark + * the failed status in the display data structure. */ - if (a_cmResults->probeOK) { /* 1 => notOK the xstat results */ + if (a_cmResults->probeOK) { /* 1 => notOK the xstat results */ curr_cmDataP->probeOK = 0; /* print the probe status */ - if (afsmon_debug) { - fprintf(debugFD,"\n\t\t ----- cm display data ------\n"); - fprintf(debugFD,"HostName = %s PROBE FAILED \n",curr_cmDataP->hostName); - fflush(debugFD); + if (afsmon_debug) { + fprintf(debugFD, "\n\t\t ----- cm display data ------\n"); + fprintf(debugFD, "HostName = %s PROBE FAILED \n", + curr_cmDataP->hostName); + fflush(debugFD); } - } else { /* probe succeeded, update display data structures */ + } else { /* probe succeeded, update display data structures */ curr_cmDataP->probeOK = 1; - /* covert longs to strings and place them in curr_cmDataP */ - cm_Results_ltoa(curr_cmDataP, a_cmResults); + /* covert longs to strings and place them in curr_cmDataP */ + cm_Results_ltoa(curr_cmDataP, a_cmResults); - /* compare with thresholds and set the overflow flags. - note that the threshold information is in the hostEntry structure and - each threshold item has a positional index associated with it */ + /* compare with thresholds and set the overflow flags. + * note that the threshold information is in the hostEntry structure and + * each threshold item has a positional index associated with it */ - /* locate the hostEntry for this host */ - done = 0; - curr_host = CMnameList; - for(i=0; ihostName,a_cmResults->connP->hostName) == 0) { + /* locate the hostEntry for this host */ + done = 0; + curr_host = CMnameList; + for (i = 0; i < numCM; i++) { + if (strcasecmp(curr_host->hostName, a_cmResults->connP->hostName) + == 0) { done = 1; break; - } - curr_host = curr_host->next; - } - if (!done) afsmon_Exit(100); - - code = check_cm_thresholds(curr_host, curr_cmDataP); - if (code) { - fprintf(stderr,"[ %s ] Error in checking thresholds\n",rn); - afsmon_Exit(105); - } - - - /* print the info we just saved */ - if (afsmon_debug) { - fprintf(debugFD,"\n\t\t ----- CM display data ------\n"); - fprintf(debugFD,"HostName = %s\n",curr_cmDataP->hostName); - for(i=0; inext; + } + if (!done) + afsmon_Exit(100); + + code = check_cm_thresholds(curr_host, curr_cmDataP); + if (code) { + fprintf(stderr, "[ %s ] Error in checking thresholds\n", rn); + afsmon_Exit(105); + } + + + /* print the info we just saved */ + if (afsmon_debug) { + fprintf(debugFD, "\n\t\t ----- CM display data ------\n"); + fprintf(debugFD, "HostName = %s\n", curr_cmDataP->hostName); + for (i = 0; i < NUM_CM_STAT_ENTRIES; i++) { switch (i) { - case 0: fprintf(debugFD,"\t -- Overall Perf Info --\n"); - break; - case 39: fprintf(debugFD,"\t -- File Server up/down stats - same cell --\n"); - break; - case 64: fprintf(debugFD,"\t -- File Server up/down stats - diff cell --\n"); - break; - case 89: fprintf(debugFD,"\t -- VL server up/down stats - same cell --\n"); - break; - case 114: fprintf(debugFD,"\t -- VL server up/down stats - diff cell --\n"); - break; - case 139: fprintf(debugFD,"\t -- FS Operation Timings --\n"); - break; - case 279: fprintf(debugFD,"\t -- FS Error Info --\n"); - break; - case 447: fprintf(debugFD,"\t -- FS Transfer Timings --\n"); - break; - case 475: fprintf(debugFD,"\t -- CM Operations Timings --\n"); - break; - case 510: fprintf(debugFD,"\t -- Authentication Info --\n"); - break; - case 522: fprintf(debugFD,"\t -- Access Info --\n"); - break; - default: break; + case 0: + fprintf(debugFD, "\t -- Overall Perf Info --\n"); + break; + case 39: + fprintf(debugFD, + "\t -- File Server up/down stats - same cell --\n"); + break; + case 64: + fprintf(debugFD, + "\t -- File Server up/down stats - diff cell --\n"); + break; + case 89: + fprintf(debugFD, + "\t -- VL server up/down stats - same cell --\n"); + break; + case 114: + fprintf(debugFD, + "\t -- VL server up/down stats - diff cell --\n"); + break; + case 139: + fprintf(debugFD, "\t -- FS Operation Timings --\n"); + break; + case 279: + fprintf(debugFD, "\t -- FS Error Info --\n"); + break; + case 447: + fprintf(debugFD, "\t -- FS Transfer Timings --\n"); + break; + case 475: + fprintf(debugFD, "\t -- CM Operations Timings --\n"); + break; + case 510: + fprintf(debugFD, "\t -- Authentication Info --\n"); + break; + case 522: + fprintf(debugFD, "\t -- Access Info --\n"); + break; + default: + break; } - fprintf(debugFD,"%20s %30s %s\n", curr_cmDataP->data[i], - cm_varNames[i],curr_cmDataP->threshOvf[i] ? "(ovf)":"" ); - } - fprintf(debugFD,"\t\t--------------------------------\n\n"); - } + fprintf(debugFD, "%20s %30s %s\n", curr_cmDataP->data[i], + cm_varNames[i], + curr_cmDataP->threshOvf[i] ? "(ovf)" : ""); + } + fprintf(debugFD, "\t\t--------------------------------\n\n"); + } - } /* if the probe succeeded, update the display data structures */ + } /* if the probe succeeded, update the display data structures */ - /* if we have received a reply from all the hosts for this probe cycle, - it is time to display the data */ + /* if we have received a reply from all the hosts for this probe cycle, + * it is time to display the data */ - probes_Received++; - if (probes_Received == numCM) { + probes_Received++; + if (probes_Received == numCM) { probes_Received = 0; if (afsmon_cm_curr_probeNum != afsmon_cm_prev_probeNum + 1) { - sprintf(errMsg,"[ %s ] Probe number %d missed! \n", - rn, afsmon_cm_prev_probeNum +1); - afsmon_Exit(110); + sprintf(errMsg, "[ %s ] Probe number %d missed! \n", rn, + afsmon_cm_prev_probeNum + 1); + afsmon_Exit(110); } else - afsmon_cm_prev_probeNum++; + afsmon_cm_prev_probeNum++; /* backup the display data of the probe cycle that just completed - - ie., store curr_cmData in prev_cmData */ + * ie., store curr_cmData in prev_cmData */ - memcpy((char *)prev_cmData, (char *)curr_cmData, (numCM * sizeof(struct cm_Display_Data)) ); + memcpy((char *)prev_cmData, (char *)curr_cmData, + (numCM * sizeof(struct cm_Display_Data))); /* initialize curr_cmData but retain the threshold flag information. - The previous state of threshold flags is used in check_cm_thresholds()*/ + * The previous state of threshold flags is used in check_cm_thresholds() */ curr_cmDataP = curr_cmData; numBytes = NUM_CM_STAT_ENTRIES * CM_STAT_STRING_LEN; - for(i=0; iprobeOK = 0; - curr_cmDataP->ovfCount = 0; - memset((char *)curr_cmDataP->data, 0, numBytes); - curr_cmDataP++; + for (i = 0; i < numCM; i++) { + curr_cmDataP->probeOK = 0; + curr_cmDataP->ovfCount = 0; + memset((char *)curr_cmDataP->data, 0, numBytes); + curr_cmDataP++; } /* prev_cmData now contains all the information for the probe cycle - that just completed. Now count the number of threshold overflows for - use in the overview screen */ + * that just completed. Now count the number of threshold overflows for + * use in the overview screen */ prev_cmDataP = prev_cmData; num_cm_alerts = 0; numHosts_oncm_alerts = 0; - for(i=0; iprobeOK) { /* if probe failed */ - num_cm_alerts++; - numHosts_oncm_alerts++; - } else if (prev_cmDataP->ovfCount) { /* overflows ?? */ - num_cm_alerts += prev_cmDataP->ovfCount; - numHosts_oncm_alerts++; - } - prev_cmDataP++; + for (i = 0; i < numCM; i++) { + if (!prev_cmDataP->probeOK) { /* if probe failed */ + num_cm_alerts++; + numHosts_oncm_alerts++; + } else if (prev_cmDataP->ovfCount) { /* overflows ?? */ + num_cm_alerts += prev_cmDataP->ovfCount; + numHosts_oncm_alerts++; + } + prev_cmDataP++; } if (afsmon_debug) - fprintf(debugFD,"Number of CM alerts = %d (on %d hosts)\n", - num_cm_alerts, numHosts_oncm_alerts); + fprintf(debugFD, "Number of CM alerts = %d (on %d hosts)\n", + num_cm_alerts, numHosts_oncm_alerts); /* flag that the data is now ready to be displayed */ cm_Data_Available = 1; - /* update the Overview frame (only CM info)*/ + /* update the Overview frame (only CM info) */ ovw_refresh(ovw_currPage, OVW_UPDATE_CM); /* update the Cache Managers frame */ cm_refresh(cm_currPage, cm_curr_LCol); - } + } - return(0); -} /* save_CM_data_forDisplay */ - + return (0); +} /* save_CM_data_forDisplay */ + /*----------------------------------------------------------------------- @@ -3003,62 +3182,61 @@ struct xstat_cm_ProbeResults *a_cmResults; *----------------------------------------------------------------------*/ int -afsmon_CM_Handler() -{ /* afsmon_CM_Handler() */ - static char rn[] = "afsmon_CM_Handler"; /* routine name */ - int code; /* return status */ - int newProbeCycle; /* start of new probe cycle ? */ - - if (afsmon_debug) { - fprintf(debugFD, - "[ %s ] Called, hostName= %s, probeNum= %d, status= %s\n", rn, - xstat_cm_Results.connP->hostName, - xstat_cm_Results.probeNum, - xstat_cm_Results.probeOK? "FAILED":"OK"); - fflush(debugFD); - } - - - /* print the probe results to output file */ - if (afsmon_output) { +afsmon_CM_Handler() +{ /* afsmon_CM_Handler() */ + static char rn[] = "afsmon_CM_Handler"; /* routine name */ + int code; /* return status */ + int newProbeCycle; /* start of new probe cycle ? */ + + if (afsmon_debug) { + fprintf(debugFD, + "[ %s ] Called, hostName= %s, probeNum= %d, status= %s\n", rn, + xstat_cm_Results.connP->hostName, xstat_cm_Results.probeNum, + xstat_cm_Results.probeOK ? "FAILED" : "OK"); + fflush(debugFD); + } + + + /* print the probe results to output file */ + if (afsmon_output) { code = afsmon_cmOutput(output_filename, afsmon_detOutput); - if (code) { - fprintf(stderr,"[ %s ] output to file %s returned error code=%d\n", - rn,output_filename,code); - } - } - - /* Update current probe number and circular buffer index. if current - probenum changed make sure it is only by 1 */ - - newProbeCycle = 0; - if (xstat_cm_Results.probeNum != afsmon_cm_curr_probeNum) { - if (xstat_cm_Results.probeNum == afsmon_cm_curr_probeNum + 1) { - afsmon_cm_curr_probeNum++; - newProbeCycle = 1; - if (num_bufSlots) - afsmon_cm_curr_CBindex= - (afsmon_cm_curr_probeNum - 1) % num_bufSlots; + if (code) { + fprintf(stderr, + "[ %s ] output to file %s returned error code=%d\n", rn, + output_filename, code); } - else { - fprintf(stderr,"[ %s ] probe number %d-1 missed\n", - rn,xstat_cm_Results.probeNum); - afsmon_Exit(115); + } + + /* Update current probe number and circular buffer index. if current + * probenum changed make sure it is only by 1 */ + + newProbeCycle = 0; + if (xstat_cm_Results.probeNum != afsmon_cm_curr_probeNum) { + if (xstat_cm_Results.probeNum == afsmon_cm_curr_probeNum + 1) { + afsmon_cm_curr_probeNum++; + newProbeCycle = 1; + if (num_bufSlots) + afsmon_cm_curr_CBindex = + (afsmon_cm_curr_probeNum - 1) % num_bufSlots; + } else { + fprintf(stderr, "[ %s ] probe number %d-1 missed\n", rn, + xstat_cm_Results.probeNum); + afsmon_Exit(115); } - } + } - /* save the results of this probe in the CM buffer */ - if (num_bufSlots) - save_CM_results_inCB(newProbeCycle); + /* save the results of this probe in the CM buffer */ + if (num_bufSlots) + save_CM_results_inCB(newProbeCycle); - /* store the results of the current probe in the cm data display structure. - if the current probe number changed, swap the current and previous display - structures. note that the display screen is updated from these structures - and should start showing the data of the just completed probe cycle */ + /* store the results of the current probe in the cm data display structure. + * if the current probe number changed, swap the current and previous display + * structures. note that the display screen is updated from these structures + * and should start showing the data of the just completed probe cycle */ - save_CM_data_forDisplay(&xstat_cm_Results); + save_CM_data_forDisplay(&xstat_cm_Results); - return(0); + return (0); } /*----------------------------------------------------------------------- @@ -3074,106 +3252,109 @@ afsmon_CM_Handler() int init_fs_buffers() -{ /* init_fs_buffers() */ - static char rn[] = "init_fs_buffers"; /* routine name */ - struct afsmon_fs_Results_list *new_fslist_item; /* ptr for new struct */ - struct afsmon_fs_Results_list *tmp_fslist_item; /* temp ptr */ - struct xstat_fs_ProbeResults *new_fsPR; /* ptr for new struct */ - int i,j; - int bufslot; - int numfs; - - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); +{ /* init_fs_buffers() */ + static char rn[] = "init_fs_buffers"; /* routine name */ + struct afsmon_fs_Results_list *new_fslist_item; /* ptr for new struct */ + struct afsmon_fs_Results_list *tmp_fslist_item; /* temp ptr */ + struct xstat_fs_ProbeResults *new_fsPR; /* ptr for new struct */ + int i, j; + int bufslot; + int numfs; + + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); - } - - /* allocate memory for the circular buffer of pointers */ - - afsmon_fs_ResultsCB = (struct afsmon_fs_Results_CBuffer *) malloc( - sizeof(struct afsmon_fs_Results_CBuffer) * num_bufSlots); - - /* initialize the fs circular buffer */ - for (i=0; iconnP = (struct xstat_fs_ConnectionInfo *) malloc( - sizeof(struct xstat_fs_ConnectionInfo)); - if (new_fsPR->connP == (struct xstat_fs_ConnectionInfo *)0 ) { - free(new_fslist_item); - free(new_fsPR); - return(-1); + new_fsPR->connP = (struct xstat_fs_ConnectionInfo *) + malloc(sizeof(struct xstat_fs_ConnectionInfo)); + if (new_fsPR->connP == (struct xstat_fs_ConnectionInfo *)0) { + free(new_fslist_item); + free(new_fsPR); + return (-1); } - /* >>> need to allocate rx connection info structure here <<< */ + /* >>> need to allocate rx connection info structure here <<< */ - new_fsPR->data.AFS_CollData_val = (afs_int32 *) malloc( - XSTAT_FS_FULLPERF_RESULTS_LEN * sizeof(afs_int32)); - if (new_fsPR->data.AFS_CollData_val == (afs_int32 *)0) { - free(new_fslist_item); - free(new_fsPR->connP); - free(new_fsPR); - return(-1); + new_fsPR->data.AFS_CollData_val = + (afs_int32 *) malloc(XSTAT_FS_FULLPERF_RESULTS_LEN * + sizeof(afs_int32)); + if (new_fsPR->data.AFS_CollData_val == NULL) { + free(new_fslist_item); + free(new_fsPR->connP); + free(new_fsPR); + return (-1); } - /* initialize this list entry */ - new_fslist_item->fsResults = new_fsPR; - new_fslist_item->empty = 1; - new_fslist_item->next = (struct afsmon_fs_Results_list *)0; - - /* store it at the end of the fs list in the current CB slot */ - if (afsmon_fs_ResultsCB[bufslot].list == (struct afsmon_fs_Results_list *)0) - afsmon_fs_ResultsCB[ bufslot ].list = new_fslist_item; - else { - tmp_fslist_item = afsmon_fs_ResultsCB[ bufslot ].list; - j=0; - while(tmp_fslist_item != (struct afsmon_fs_Results_list *)0) - { - if (tmp_fslist_item->next == (struct afsmon_fs_Results_list *)0) - break; - tmp_fslist_item = tmp_fslist_item->next; - if (++j > numFS) - { - /* something goofed. exit */ - fprintf(stderr,"[ %s ] list creation error\n",rn); - return(-1); - } - } - tmp_fslist_item->next = new_fslist_item; - } - - } /* while servers */ - } /* for each buffer slot */ - } /* if we have file servers to monitor */ - return(0); + /* initialize this list entry */ + new_fslist_item->fsResults = new_fsPR; + new_fslist_item->empty = 1; + new_fslist_item->next = (struct afsmon_fs_Results_list *)0; + + /* store it at the end of the fs list in the current CB slot */ + if (afsmon_fs_ResultsCB[bufslot].list == + (struct afsmon_fs_Results_list *)0) + afsmon_fs_ResultsCB[bufslot].list = new_fslist_item; + else { + tmp_fslist_item = afsmon_fs_ResultsCB[bufslot].list; + j = 0; + while (tmp_fslist_item != + (struct afsmon_fs_Results_list *)0) { + if (tmp_fslist_item->next == + (struct afsmon_fs_Results_list *)0) + break; + tmp_fslist_item = tmp_fslist_item->next; + if (++j > numFS) { + /* something goofed. exit */ + fprintf(stderr, "[ %s ] list creation error\n", + rn); + return (-1); + } + } + tmp_fslist_item->next = new_fslist_item; + } + + } /* while servers */ + } /* for each buffer slot */ + } /* if we have file servers to monitor */ + return (0); } /*----------------------------------------------------------------------- @@ -3189,108 +3370,112 @@ init_fs_buffers() int init_cm_buffers() -{ /* init_cm_buffers() */ - static char rn[] = "init_cm_buffers"; /* routine name */ - struct afsmon_cm_Results_list *new_cmlist_item; /* ptr for new struct */ - struct afsmon_cm_Results_list *tmp_cmlist_item; /* temp ptr */ - struct xstat_cm_ProbeResults *new_cmPR; /* ptr for new struct */ - int i,j; - int bufslot; - int numcm; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); +{ /* init_cm_buffers() */ + static char rn[] = "init_cm_buffers"; /* routine name */ + struct afsmon_cm_Results_list *new_cmlist_item; /* ptr for new struct */ + struct afsmon_cm_Results_list *tmp_cmlist_item; /* temp ptr */ + struct xstat_cm_ProbeResults *new_cmPR; /* ptr for new struct */ + int i, j; + int bufslot; + int numcm; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); - } - - /* allocate memory for the circular buffer of pointers */ - afsmon_cm_ResultsCB = (struct afsmon_cm_Results_CBuffer *) malloc( - sizeof(struct afsmon_cm_Results_CBuffer) * num_bufSlots); - - /* initialize the fs circular buffer */ - for (i=0; iconnP = (struct xstat_cm_ConnectionInfo *) malloc( - sizeof(struct xstat_cm_ConnectionInfo)); - if (new_cmPR->connP == (struct xstat_cm_ConnectionInfo *)0 ) { - free(new_cmlist_item); - free(new_cmPR); - return(-1); + new_cmPR->connP = (struct xstat_cm_ConnectionInfo *) + malloc(sizeof(struct xstat_cm_ConnectionInfo)); + if (new_cmPR->connP == (struct xstat_cm_ConnectionInfo *)0) { + free(new_cmlist_item); + free(new_cmPR); + return (-1); } - /* >>> need to allocate rx connection info structure here <<< */ + /* >>> need to allocate rx connection info structure here <<< */ - new_cmPR->data.AFSCB_CollData_val = (afs_int32 *) malloc( - XSTAT_CM_FULLPERF_RESULTS_LEN * sizeof(afs_int32)); - if (new_cmPR->data.AFSCB_CollData_val == (afs_int32 *)0) { - free(new_cmlist_item); - free(new_cmPR->connP); - free(new_cmPR); - return(-1); + new_cmPR->data.AFSCB_CollData_val = + (afs_int32 *) malloc(XSTAT_CM_FULLPERF_RESULTS_LEN * + sizeof(afs_int32)); + if (new_cmPR->data.AFSCB_CollData_val == NULL) { + free(new_cmlist_item); + free(new_cmPR->connP); + free(new_cmPR); + return (-1); } - /* initialize this list entry */ - new_cmlist_item->cmResults = new_cmPR; - new_cmlist_item->empty = 1; - new_cmlist_item->next = (struct afsmon_cm_Results_list *)0; - - /* store it at the end of the cm list in the current CB slot */ - if (afsmon_cm_ResultsCB[bufslot].list == (struct afsmon_cm_Results_list *)0) - afsmon_cm_ResultsCB[ bufslot ].list = new_cmlist_item; - else { - tmp_cmlist_item = afsmon_cm_ResultsCB[ bufslot ].list; - j=0; - while(tmp_cmlist_item != (struct afsmon_cm_Results_list *)0) - { - if (tmp_cmlist_item->next == (struct afsmon_cm_Results_list *)0) - break; - tmp_cmlist_item = tmp_cmlist_item->next; - if (++j > numCM) - { - /* something goofed. exit */ - fprintf(stderr,"[ %s ] list creation error\n",rn); - return(-1); - } - } - tmp_cmlist_item->next = new_cmlist_item; - } - - } /* while servers */ - } /* for each buffer slot */ - } /* if we have file servers to monitor */ - /* print the CB to make sure it is right */ - Print_CM_CB(); - - return(0); -} /* init_cm_buffers() */ + /* initialize this list entry */ + new_cmlist_item->cmResults = new_cmPR; + new_cmlist_item->empty = 1; + new_cmlist_item->next = (struct afsmon_cm_Results_list *)0; + + /* store it at the end of the cm list in the current CB slot */ + if (afsmon_cm_ResultsCB[bufslot].list == + (struct afsmon_cm_Results_list *)0) + afsmon_cm_ResultsCB[bufslot].list = new_cmlist_item; + else { + tmp_cmlist_item = afsmon_cm_ResultsCB[bufslot].list; + j = 0; + while (tmp_cmlist_item != + (struct afsmon_cm_Results_list *)0) { + if (tmp_cmlist_item->next == + (struct afsmon_cm_Results_list *)0) + break; + tmp_cmlist_item = tmp_cmlist_item->next; + if (++j > numCM) { + /* something goofed. exit */ + fprintf(stderr, "[ %s ] list creation error\n", + rn); + return (-1); + } + } + tmp_cmlist_item->next = new_cmlist_item; + } + + } /* while servers */ + } /* for each buffer slot */ + } + /* if we have file servers to monitor */ + /* print the CB to make sure it is right */ + Print_CM_CB(); + + return (0); +} /* init_cm_buffers() */ /*------------------------------------------------------------------------- @@ -3308,100 +3493,106 @@ init_cm_buffers() int init_print_buffers() -{ /* init_print_buffers */ - - static char rn[] = "init_print_buffers"; /* routine name */ - struct fs_Display_Data *tmp_fsData1; /* temp pointers */ - struct fs_Display_Data *tmp_fsData2; - struct cm_Display_Data *tmp_cmData1; - struct cm_Display_Data *tmp_cmData2; - struct afsmon_hostEntry *tmp_fsNames; - struct afsmon_hostEntry *tmp_cmNames; - int i; - int numBytes; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); +{ /* init_print_buffers */ + + static char rn[] = "init_print_buffers"; /* routine name */ + struct fs_Display_Data *tmp_fsData1; /* temp pointers */ + struct fs_Display_Data *tmp_fsData2; + struct cm_Display_Data *tmp_cmData1; + struct cm_Display_Data *tmp_cmData2; + struct afsmon_hostEntry *tmp_fsNames; + struct afsmon_hostEntry *tmp_cmNames; + int i; + int numBytes; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); - } - - /* allocate numFS blocks of the FS print structure. */ - - /* we need two instances of this structure - one (curr_fsData) for storing - the results of the fs probes currently in progress and another (prev_fsData) - for the last completed probe. The display is updated from the contents of - prev_fsData. The pointers curr_fsData & prev_fsData are switched whenever - the probe number changes */ - - if (numFS) { - numBytes = numFS * sizeof(struct fs_Display_Data); - curr_fsData = (struct fs_Display_Data *) malloc(numBytes); - if (curr_fsData == (struct fs_Display_Data *)0) { - fprintf(stderr,"[ %s ] Memory allocation failure\n",rn); - return(-1); - } - memset(curr_fsData, 0, numBytes); - - numBytes = numFS * sizeof(struct fs_Display_Data); - prev_fsData = (struct fs_Display_Data *) malloc(numBytes); - if (prev_fsData == (struct fs_Display_Data *)0) { - fprintf(stderr,"[ %s ] Memory allocation failure\n",rn); - return(-5); - } - memset(prev_fsData, 0, numBytes); - - /* fill in the host names */ - tmp_fsData1 = curr_fsData; - tmp_fsData2 = curr_fsData; - tmp_fsNames = FSnameList; - for(i=0; ihostName, tmp_fsNames->hostName, HOST_NAME_LEN); - strncpy(tmp_fsData2->hostName, tmp_fsNames->hostName, HOST_NAME_LEN); - tmp_fsData1++; - tmp_fsData2++; - tmp_fsNames = tmp_fsNames->next;; - } - - } /* if file servers to monitor */ - - /* allocate numCM blocks of the CM print structure */ - /* we need two instances of this structure for the same reasons as above*/ - - if (numCM) { - numBytes = numCM * sizeof(struct cm_Display_Data); - - curr_cmData = (struct cm_Display_Data *) malloc(numBytes); - if (curr_cmData == (struct cm_Display_Data *)0) { - fprintf(stderr,"[ %s ] Memory allocation failure\n",rn); - return(-10); - } - memset(curr_cmData, 0, numBytes); - - numBytes = numCM * sizeof(struct cm_Display_Data); - prev_cmData = (struct cm_Display_Data *) malloc(numBytes); - if (prev_cmData == (struct cm_Display_Data *)0) { - fprintf(stderr,"[ %s ] Memory allocation failure\n",rn); - return(-15); - } - memset(prev_cmData, 0, numBytes); - - /* fill in the host names */ - tmp_cmData1 = curr_cmData; - tmp_cmData2 = curr_cmData; - tmp_cmNames = CMnameList; - for(i=0; ihostName, tmp_cmNames->hostName, HOST_NAME_LEN); - strncpy(tmp_cmData2->hostName, tmp_cmNames->hostName, HOST_NAME_LEN); - tmp_cmData1++; - tmp_cmData2++; - tmp_cmNames = tmp_cmNames->next;; - } - - } /* if cache managers to monitor */ - - return(0); - -} /* init_print_buffers */ + } + + /* allocate numFS blocks of the FS print structure. */ + + /* we need two instances of this structure - one (curr_fsData) for storing + * the results of the fs probes currently in progress and another (prev_fsData) + * for the last completed probe. The display is updated from the contents of + * prev_fsData. The pointers curr_fsData & prev_fsData are switched whenever + * the probe number changes */ + + if (numFS) { + numBytes = numFS * sizeof(struct fs_Display_Data); + curr_fsData = (struct fs_Display_Data *)malloc(numBytes); + if (curr_fsData == (struct fs_Display_Data *)0) { + fprintf(stderr, "[ %s ] Memory allocation failure\n", rn); + return (-1); + } + memset(curr_fsData, 0, numBytes); + + numBytes = numFS * sizeof(struct fs_Display_Data); + prev_fsData = (struct fs_Display_Data *)malloc(numBytes); + if (prev_fsData == (struct fs_Display_Data *)0) { + fprintf(stderr, "[ %s ] Memory allocation failure\n", rn); + return (-5); + } + memset(prev_fsData, 0, numBytes); + + /* fill in the host names */ + tmp_fsData1 = curr_fsData; + tmp_fsData2 = curr_fsData; + tmp_fsNames = FSnameList; + for (i = 0; i < numFS; i++) { + strncpy(tmp_fsData1->hostName, tmp_fsNames->hostName, + HOST_NAME_LEN); + strncpy(tmp_fsData2->hostName, tmp_fsNames->hostName, + HOST_NAME_LEN); + tmp_fsData1++; + tmp_fsData2++; + tmp_fsNames = tmp_fsNames->next;; + } + + } + + + + /* if file servers to monitor */ + /* allocate numCM blocks of the CM print structure */ + /* we need two instances of this structure for the same reasons as above */ + if (numCM) { + numBytes = numCM * sizeof(struct cm_Display_Data); + + curr_cmData = (struct cm_Display_Data *)malloc(numBytes); + if (curr_cmData == (struct cm_Display_Data *)0) { + fprintf(stderr, "[ %s ] Memory allocation failure\n", rn); + return (-10); + } + memset(curr_cmData, 0, numBytes); + + numBytes = numCM * sizeof(struct cm_Display_Data); + prev_cmData = (struct cm_Display_Data *)malloc(numBytes); + if (prev_cmData == (struct cm_Display_Data *)0) { + fprintf(stderr, "[ %s ] Memory allocation failure\n", rn); + return (-15); + } + memset(prev_cmData, 0, numBytes); + + /* fill in the host names */ + tmp_cmData1 = curr_cmData; + tmp_cmData2 = curr_cmData; + tmp_cmNames = CMnameList; + for (i = 0; i < numCM; i++) { + strncpy(tmp_cmData1->hostName, tmp_cmNames->hostName, + HOST_NAME_LEN); + strncpy(tmp_cmData2->hostName, tmp_cmNames->hostName, + HOST_NAME_LEN); + tmp_cmData1++; + tmp_cmData2++; + tmp_cmNames = tmp_cmNames->next;; + } + + } + /* if cache managers to monitor */ + return (0); + +} /* init_print_buffers */ /*----------------------------------------------------------------------- * quit_signal() @@ -3413,13 +3604,13 @@ init_print_buffers() void quit_signal(sig) -int sig; -{ /* quit_signal */ - static char *rn = "quit_signal"; /* routine name */ + int sig; +{ /* quit_signal */ + static char *rn = "quit_signal"; /* routine name */ - fprintf(stderr,"Received signal %d \n",sig); - afsmon_Exit(120); -} /* quit_signal */ + fprintf(stderr, "Received signal %d \n", sig); + afsmon_Exit(120); +} /* quit_signal */ @@ -3441,219 +3632,231 @@ int sig; int afsmon_execute() -{ /* afsmon_execute() */ - static char rn[] = "afsmon_execute"; /* routine name */ - static char fullhostname[128]; /* full host name */ - struct sockaddr_in *FSSktArray; /* fs socket array */ - int FSsktbytes; /* num bytes in above */ - struct sockaddr_in *CMSktArray; /* cm socket array */ - int CMsktbytes; /* num bytes in above */ - struct sockaddr_in *curr_skt; /* ptr to current socket*/ - struct afsmon_hostEntry *curr_FS; /* ptr to FS name list */ - struct afsmon_hostEntry *curr_CM; /* ptr to CM name list */ - struct hostent *he; /* host entry */ - afs_int32 *collIDP; /* ptr to collection ID */ - int numCollIDs; /* number of collection IDs */ - int FSinitFlags = 0; /* flags for xstat_fs_Init */ - int CMinitFlags = 0; /* flags for xstat_cm_Init */ - int code; /* function return code */ - struct timeval tv; /* time structure */ - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n",rn); +{ /* afsmon_execute() */ + static char rn[] = "afsmon_execute"; /* routine name */ + static char fullhostname[128]; /* full host name */ + struct sockaddr_in *FSSktArray; /* fs socket array */ + int FSsktbytes; /* num bytes in above */ + struct sockaddr_in *CMSktArray; /* cm socket array */ + int CMsktbytes; /* num bytes in above */ + struct sockaddr_in *curr_skt; /* ptr to current socket */ + struct afsmon_hostEntry *curr_FS; /* ptr to FS name list */ + struct afsmon_hostEntry *curr_CM; /* ptr to CM name list */ + struct hostent *he; /* host entry */ + afs_int32 *collIDP; /* ptr to collection ID */ + int numCollIDs; /* number of collection IDs */ + int FSinitFlags = 0; /* flags for xstat_fs_Init */ + int CMinitFlags = 0; /* flags for xstat_cm_Init */ + int code; /* function return code */ + struct timeval tv; /* time structure */ + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called\n", rn); fflush(debugFD); - } - - - /* process file server entries */ - if (numFS) { - /* Allocate an array of sockets for each fileserver we monitor */ - - FSsktbytes = numFS * sizeof(struct sockaddr_in); - FSSktArray = (struct sockaddr_in *) malloc(FSsktbytes); - if (FSSktArray == (struct sockaddr_in *)0) { - fprintf(stderr,"[ %s ] cannot malloc %d sockaddr_ins for fileservers\n", - rn,numFS); - return(-1); - } - - memset(FSSktArray, 0, FSsktbytes); - - /* Fill in the socket information for each fileserve */ - - curr_skt = FSSktArray; - curr_FS = FSnameList; /* FS name list header */ - while (curr_FS) { - strncpy(fullhostname,curr_FS->hostName,sizeof(fullhostname)); - he = GetHostByName(fullhostname); - if (he == (struct hostent *)0) { - fprintf(stderr,"[ %s ] Cannot get host info for %s\n",rn, fullhostname); - return(-1); - } - strncpy(curr_FS->hostName,he->h_name,HOST_NAME_LEN); /* complete name*/ - memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4); - curr_skt->sin_family = htons(AF_INET); /*Internet family*/ - curr_skt->sin_port = htons(7000); /*FileServer port*/ + } + + + /* process file server entries */ + if (numFS) { + /* Allocate an array of sockets for each fileserver we monitor */ + + FSsktbytes = numFS * sizeof(struct sockaddr_in); + FSSktArray = (struct sockaddr_in *)malloc(FSsktbytes); + if (FSSktArray == (struct sockaddr_in *)0) { + fprintf(stderr, + "[ %s ] cannot malloc %d sockaddr_ins for fileservers\n", + rn, numFS); + return (-1); + } + + memset(FSSktArray, 0, FSsktbytes); + + /* Fill in the socket information for each fileserve */ + + curr_skt = FSSktArray; + curr_FS = FSnameList; /* FS name list header */ + while (curr_FS) { + strncpy(fullhostname, curr_FS->hostName, sizeof(fullhostname)); + he = GetHostByName(fullhostname); + if (he == NULL) { + fprintf(stderr, "[ %s ] Cannot get host info for %s\n", rn, + fullhostname); + return (-1); + } + strncpy(curr_FS->hostName, he->h_name, HOST_NAME_LEN); /* complete name */ + memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4); + curr_skt->sin_family = htons(AF_INET); /*Internet family */ + curr_skt->sin_port = htons(7000); /*FileServer port */ #ifdef STRUCT_SOCKADDR_HAS_SA_LEN - curr_skt->sin_len = sizeof(struct sockaddr_in); + curr_skt->sin_len = sizeof(struct sockaddr_in); #endif - /* get the next dude */ - curr_skt++; - curr_FS = curr_FS->next; - } - - /* initialize collection IDs. We need only one entry since we collect - all the information from xstat */ - - numCollIDs = 1; - collIDP = (afs_int32 *) malloc (sizeof (afs_int32)); - if (collIDP == (afs_int32 *)0) { - fprintf(stderr,"[ %s ] failed to allocate a measely afs_int32 word.Argh!\n", rn); - return(-1); - } - *collIDP = 2; /* USE A macro for this */ - - FSinitFlags = 0; - if (afsmon_onceOnly) /* option not provided at this time */ - FSinitFlags |= XSTAT_FS_INITFLAG_ONE_SHOT; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Calling xstat_fs_Init \n",rn); - fflush(debugFD); - } - - code = xstat_fs_Init(numFS, /*Num servers*/ - FSSktArray, /*File Server socket array*/ - afsmon_probefreq, /*probe frequency*/ - afsmon_FS_Handler, /*Handler routine*/ - FSinitFlags, /*Initialization flags*/ - numCollIDs, /*Number of collection IDs*/ - collIDP); /*Ptr to collection ID */ - - if (code) { - fprintf(stderr,"[ %s ] xstat_fs_init returned error\n",rn); - afsmon_Exit(125); - } - - } /* end of process fileserver entries */ - - /* process cache manager entries */ - - if (numCM) { - /* Allocate an array of sockets for each cache manager we monitor */ - - CMsktbytes = numCM * sizeof(struct sockaddr_in); - CMSktArray = (struct sockaddr_in *) malloc(CMsktbytes); - if (CMSktArray == (struct sockaddr_in *)0) { - fprintf(stderr,"[ %s ] cannot malloc %d sockaddr_ins for CM entries\n", - rn,numCM); - return(-1); - } - - memset(CMSktArray, 0, CMsktbytes); - - /* Fill in the socket information for each CM */ - - curr_skt = CMSktArray; - curr_CM = CMnameList; /* CM name list header */ - while (curr_CM) { - strncpy(fullhostname,curr_CM->hostName,sizeof(fullhostname)); - he = GetHostByName(fullhostname); - if (he == (struct hostent *)0) { - fprintf(stderr,"[ %s ] Cannot get host info for %s\n",rn, fullhostname); - return(-1); - } - strncpy(curr_CM->hostName,he->h_name,HOST_NAME_LEN); /* complete name*/ - memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4); - curr_skt->sin_family = htons(AF_INET); /*Internet family*/ - curr_skt->sin_port = htons(7001); /*Cache Manager port*/ + /* get the next dude */ + curr_skt++; + curr_FS = curr_FS->next; + } + + /* initialize collection IDs. We need only one entry since we collect + * all the information from xstat */ + + numCollIDs = 1; + collIDP = (afs_int32 *) malloc(sizeof(afs_int32)); + if (collIDP == NULL) { + fprintf(stderr, + "[ %s ] failed to allocate a measely afs_int32 word.Argh!\n", + rn); + return (-1); + } + *collIDP = 2; /* USE A macro for this */ + + FSinitFlags = 0; + if (afsmon_onceOnly) /* option not provided at this time */ + FSinitFlags |= XSTAT_FS_INITFLAG_ONE_SHOT; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Calling xstat_fs_Init \n", rn); + fflush(debugFD); + } + + code = xstat_fs_Init(numFS, /*Num servers */ + FSSktArray, /*File Server socket array */ + afsmon_probefreq, /*probe frequency */ + afsmon_FS_Handler, /*Handler routine */ + FSinitFlags, /*Initialization flags */ + numCollIDs, /*Number of collection IDs */ + collIDP); /*Ptr to collection ID */ + + if (code) { + fprintf(stderr, "[ %s ] xstat_fs_init returned error\n", rn); + afsmon_Exit(125); + } + + } + + + /* end of process fileserver entries */ + /* process cache manager entries */ + if (numCM) { + /* Allocate an array of sockets for each cache manager we monitor */ + + CMsktbytes = numCM * sizeof(struct sockaddr_in); + CMSktArray = (struct sockaddr_in *)malloc(CMsktbytes); + if (CMSktArray == (struct sockaddr_in *)0) { + fprintf(stderr, + "[ %s ] cannot malloc %d sockaddr_ins for CM entries\n", + rn, numCM); + return (-1); + } + + memset(CMSktArray, 0, CMsktbytes); + + /* Fill in the socket information for each CM */ + + curr_skt = CMSktArray; + curr_CM = CMnameList; /* CM name list header */ + while (curr_CM) { + strncpy(fullhostname, curr_CM->hostName, sizeof(fullhostname)); + he = GetHostByName(fullhostname); + if (he == NULL) { + fprintf(stderr, "[ %s ] Cannot get host info for %s\n", rn, + fullhostname); + return (-1); + } + strncpy(curr_CM->hostName, he->h_name, HOST_NAME_LEN); /* complete name */ + memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4); + curr_skt->sin_family = htons(AF_INET); /*Internet family */ + curr_skt->sin_port = htons(7001); /*Cache Manager port */ #ifdef STRUCT_SOCKADDR_HAS_SA_LEN - curr_skt->sin_len = sizeof(struct sockaddr_in); + curr_skt->sin_len = sizeof(struct sockaddr_in); #endif - /* get the next dude */ - curr_skt++; - curr_CM = curr_CM->next; - } - - /* initialize collection IDs. We need only one entry since we collect - all the information from xstat */ - - numCollIDs = 1; - collIDP = (afs_int32 *) malloc (sizeof (afs_int32)); - if (collIDP == (afs_int32 *)0) { - fprintf(stderr,"[ %s ] failed to allocate a measely long word.Argh!\n", rn); - return(-1); - } - *collIDP = 2; /* USE A macro for this */ - - CMinitFlags = 0; - if (afsmon_onceOnly) /* once only ? */ - CMinitFlags |= XSTAT_CM_INITFLAG_ONE_SHOT; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Calling xstat_cm_Init \n",rn); - fflush(debugFD); - } + /* get the next dude */ + curr_skt++; + curr_CM = curr_CM->next; + } - code = xstat_cm_Init(numCM, /*Num servers*/ - CMSktArray, /*Cache Manager socket array*/ - afsmon_probefreq, /*probe frequency*/ - afsmon_CM_Handler, /*Handler routine*/ - CMinitFlags, /*Initialization flags*/ - numCollIDs, /*Number of collection IDs*/ - collIDP); /*Ptr to collection ID */ + /* initialize collection IDs. We need only one entry since we collect + * all the information from xstat */ + + numCollIDs = 1; + collIDP = (afs_int32 *) malloc(sizeof(afs_int32)); + if (collIDP == NULL) { + fprintf(stderr, + "[ %s ] failed to allocate a measely long word.Argh!\n", + rn); + return (-1); + } + *collIDP = 2; /* USE A macro for this */ - if (code) { - fprintf(stderr,"[ %s ] xstat_cm_init returned error\n",rn); - afsmon_Exit(130); - } - } /* end of process cache manager entries */ + CMinitFlags = 0; + if (afsmon_onceOnly) /* once only ? */ + CMinitFlags |= XSTAT_CM_INITFLAG_ONE_SHOT; + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Calling xstat_cm_Init \n", rn); + fflush(debugFD); + } - /* if only one probe was required setup a waiting process for the - termination signal */ + code = xstat_cm_Init(numCM, /*Num servers */ + CMSktArray, /*Cache Manager socket array */ + afsmon_probefreq, /*probe frequency */ + afsmon_CM_Handler, /*Handler routine */ + CMinitFlags, /*Initialization flags */ + numCollIDs, /*Number of collection IDs */ + collIDP); /*Ptr to collection ID */ - if (afsmon_onceOnly) { + if (code) { + fprintf(stderr, "[ %s ] xstat_cm_init returned error\n", rn); + afsmon_Exit(130); + } + } + + + + /* end of process cache manager entries */ + /* if only one probe was required setup a waiting process for the + * termination signal */ + if (afsmon_onceOnly) { code = LWP_WaitProcess(&terminationEvent); if (code) { - if (afsmon_debug) { - fprintf(debugFD,"LWP_WaitProcess() returned error %d\n",code); + if (afsmon_debug) { + fprintf(debugFD, "LWP_WaitProcess() returned error %d\n", + code); fflush(debugFD); - } - afsmon_Exit(135); + } + afsmon_Exit(135); } - } + } - /* start the gtx input server */ - code = gtx_InputServer(afsmon_win); - if (code) { - fprintf(stderr,"[ %s ] Failed to start input server \n",rn); + /* start the gtx input server */ + code = gtx_InputServer(afsmon_win); + if (code) { + fprintf(stderr, "[ %s ] Failed to start input server \n", rn); afsmon_Exit(140); - } - - /* This part of the code is reached only if the input server is not started - for debugging purposes */ - - /* sleep forever */ - tv.tv_sec = 24*60; - tv.tv_usec = 0; - fprintf(stderr,"[ %s ] going to sleep ...\n",rn); - while(1) { - code = IOMGR_Select( 0, /*Num fds*/ - 0, /*Descriptors ready for reading*/ - 0, /*Descriptors ready for writing*/ - 0, /*Descriptors with exceptional conditions*/ - &tv); /*Timeout structure*/ - if (code) { - fprintf(stderr,"[ %s ] IOMGR_Select() returned non-zero value %d\n", - rn,code); - afsmon_Exit(145); - } - } /* while sleep */ + } + + /* This part of the code is reached only if the input server is not started + * for debugging purposes */ + + /* sleep forever */ + tv.tv_sec = 24 * 60; + tv.tv_usec = 0; + fprintf(stderr, "[ %s ] going to sleep ...\n", rn); + while (1) { + code = IOMGR_Select(0, /*Num fds */ + 0, /*Descriptors ready for reading */ + 0, /*Descriptors ready for writing */ + 0, /*Descriptors with exceptional conditions */ + &tv); /*Timeout structure */ + if (code) { + fprintf(stderr, + "[ %s ] IOMGR_Select() returned non-zero value %d\n", rn, + code); + afsmon_Exit(145); + } + } /* while sleep */ } - + /*----------------------------------------------------------------------- * afsmonInit() @@ -3673,266 +3876,276 @@ afsmon_execute() * Failure: Exits afsmonitor. *----------------------------------------------------------------------*/ -int -afsmonInit(as) -struct cmd_syndesc *as; -{ /* afsmonInit() */ - - static char rn[] = "afsmonInit"; /* Routine name */ - char *debug_filename; /* pointer to debug filename */ - FILE *outputFD; /* output file descriptor */ - struct cmd_item *hostPtr; /* ptr to parse command line args */ - char buf[256]; /* buffer for processing hostnames */ - int code; - int i; - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called, as= %d\n",rn, as); +int +afsmonInit(as) + struct cmd_syndesc *as; +{ /* afsmonInit() */ + + static char rn[] = "afsmonInit"; /* Routine name */ + char *debug_filename; /* pointer to debug filename */ + FILE *outputFD; /* output file descriptor */ + struct cmd_item *hostPtr; /* ptr to parse command line args */ + char buf[256]; /* buffer for processing hostnames */ + int code; + int i; + + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called, as= %d\n", rn, as); fflush(debugFD); - } + } - /* Open the debug file if -debug option is specified */ - if (as->parms[P_DEBUG].items != 0) { + /* Open the debug file if -debug option is specified */ + if (as->parms[P_DEBUG].items != 0) { afsmon_debug = 1; debug_filename = as->parms[P_DEBUG].items->data; - debugFD = fopen(debug_filename, "w"); - if (debugFD == (FILE *)0) { - printf("[ %s ] Failed to open debugging file %s for writing\n", - rn,"log"); - afsmon_debug = 0; - afsmon_Exit(150); - } - } - - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Called\n", rn); - } - - - /* use curses always until we support other packages */ -#ifdef notdef - wpkg_to_use = atoi(as->parms[P_PACKAGE].items->data); + debugFD = fopen(debug_filename, "w"); + if (debugFD == (FILE *) 0) { + printf("[ %s ] Failed to open debugging file %s for writing\n", + rn, "log"); + afsmon_debug = 0; + afsmon_Exit(150); + } + } - switch (wpkg_to_use) { - case GATOR_WIN_CURSES: - fprintf(stderr, "curses\n"); - break; - case GATOR_WIN_DUMB: - fprintf(stderr, "dumb terminal\n"); - break; - case GATOR_WIN_X11: - fprintf(stderr, "X11\n"); - break; - default: - fprintf(stderr, "Illegal graphics package: %d\n", wpkg_to_use); - afsmon_Exit(155); - } /*end switch (wpkg_to_use)*/ + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Called\n", rn); + } + + + /* use curses always until we support other packages */ +#ifdef notdef + wpkg_to_use = atoi(as->parms[P_PACKAGE].items->data); + + switch (wpkg_to_use) { + case GATOR_WIN_CURSES: + fprintf(stderr, "curses\n"); + break; + case GATOR_WIN_DUMB: + fprintf(stderr, "dumb terminal\n"); + break; + case GATOR_WIN_X11: + fprintf(stderr, "X11\n"); + break; + default: + fprintf(stderr, "Illegal graphics package: %d\n", wpkg_to_use); + afsmon_Exit(155); + } /*end switch (wpkg_to_use) */ #endif - wpkg_to_use = GATOR_WIN_CURSES; - - /* get probe frequency . We check for meaningful bounds on the frequency - and reset to the default value if needed. The upper bound of 24 - hours looks ridiculous though! */ + wpkg_to_use = GATOR_WIN_CURSES; + + /* get probe frequency . We check for meaningful bounds on the frequency + * and reset to the default value if needed. The upper bound of 24 + * hours looks ridiculous though! */ - afsmon_probefreq = 0; - if (as->parms[P_FREQUENCY].items != 0) + afsmon_probefreq = 0; + if (as->parms[P_FREQUENCY].items != 0) afsmon_probefreq = atoi(as->parms[P_FREQUENCY].items->data); - else + else afsmon_probefreq = DEFAULT_FREQUENCY; - if (afsmon_probefreq <= 0 || afsmon_probefreq > 24*60*60) { + if (afsmon_probefreq <= 0 || afsmon_probefreq > 24 * 60 * 60) { afsmon_probefreq = DEFAULT_FREQUENCY; if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Invalid probe frequency %s specified, resetting to default value %d seconds\n", - rn, as->parms[P_FREQUENCY].items->data, afsmon_probefreq); - fflush(debugFD); + fprintf(debugFD, + "[ %s ] Invalid probe frequency %s specified, resetting to default value %d seconds\n", + rn, as->parms[P_FREQUENCY].items->data, afsmon_probefreq); + fflush(debugFD); } - fprintf(stderr,"Invalid probe frequency %s specified, resetting to default value %d seconds\n", + fprintf(stderr, + "Invalid probe frequency %s specified, resetting to default value %d seconds\n", as->parms[P_FREQUENCY].items->data, afsmon_probefreq); sleep(3); - } + } - /* make sure output file is writable, else complain now */ - /* we will open and close it as needed after probes */ + /* make sure output file is writable, else complain now */ + /* we will open and close it as needed after probes */ - if (as->parms[P_OUTPUT].items != 0) { + if (as->parms[P_OUTPUT].items != 0) { afsmon_output = 1; /* output flag */ - strncpy (output_filename, as->parms[P_OUTPUT].items->data,80); - outputFD = fopen(output_filename,"a"); - if (outputFD == (FILE *)0) { - fprintf(stderr,"Failed to open output file %s \n", - output_filename); - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] Failed to open output file %s \n", + strncpy(output_filename, as->parms[P_OUTPUT].items->data, 80); + outputFD = fopen(output_filename, "a"); + if (outputFD == (FILE *) 0) { + fprintf(stderr, "Failed to open output file %s \n", + output_filename); + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] Failed to open output file %s \n", rn, output_filename); afsmon_Exit(160); - } + } + } + if (afsmon_debug) { + fprintf(debugFD, "[ %s ] output file is %s\n", rn, + output_filename); } - if (afsmon_debug) { - fprintf(debugFD,"[ %s ] output file is %s\n",rn,output_filename); - } - fclose (outputFD); - } + fclose(outputFD); + } - /* detailed statistics to storage file */ - if (as->parms[P_DETAILED].items !=0) { + /* detailed statistics to storage file */ + if (as->parms[P_DETAILED].items != 0) { if (as->parms[P_OUTPUT].items == 0) { - fprintf(stderr,"-detailed switch can be used only with -output\n"); + fprintf(stderr, + "-detailed switch can be used only with -output\n"); afsmon_Exit(165); } afsmon_detOutput = 1; - } + } - /* Initialize host list headers */ - FSnameList = (struct afsmon_hostEntry *)0; - CMnameList = (struct afsmon_hostEntry *)0; + /* Initialize host list headers */ + FSnameList = (struct afsmon_hostEntry *)0; + CMnameList = (struct afsmon_hostEntry *)0; - /* The -config option is mutually exclusive with the -fshosts,-cmhosts - options */ + /* The -config option is mutually exclusive with the -fshosts,-cmhosts + * options */ - if (as->parms[P_CONFIG].items) { + if (as->parms[P_CONFIG].items) { if (as->parms[P_FSHOSTS].items || as->parms[P_CMHOSTS].items) { - fprintf(stderr,"Cannot use -config option with -fshosts or -cmhosts\n"); - afsmon_Exit(170); + fprintf(stderr, + "Cannot use -config option with -fshosts or -cmhosts\n"); + afsmon_Exit(170); } - } else { - if (! as->parms[P_FSHOSTS].items && ! as->parms[P_CMHOSTS].items) { - fprintf(stderr,"Must specify either -config or (-fshosts and/or -cmhosts) options \n"); - afsmon_Exit(175); + } else { + if (!as->parms[P_FSHOSTS].items && !as->parms[P_CMHOSTS].items) { + fprintf(stderr, + "Must specify either -config or (-fshosts and/or -cmhosts) options \n"); + afsmon_Exit(175); } - } + } - /* If a file server host is specified on the command line we reuse - parse_hostEntry() function . Just the pass the info as if it were - read off the config file */ + /* If a file server host is specified on the command line we reuse + * parse_hostEntry() function . Just the pass the info as if it were + * read off the config file */ - if (as->parms[P_FSHOSTS].items) { + if (as->parms[P_FSHOSTS].items) { hostPtr = as->parms[P_FSHOSTS].items; - while( hostPtr != (struct cmd_item *)0) { - sprintf(buf,"fs %s",hostPtr->data); - code = parse_hostEntry(buf); - if (code) { - fprintf(stderr,"Could not parse %s\n",hostPtr->data); + while (hostPtr != (struct cmd_item *)0) { + sprintf(buf, "fs %s", hostPtr->data); + code = parse_hostEntry(buf); + if (code) { + fprintf(stderr, "Could not parse %s\n", hostPtr->data); afsmon_Exit(180); - } + } - hostPtr = hostPtr->next; + hostPtr = hostPtr->next; } - } + } - /* same as above for -cmhosts */ - if (as->parms[P_CMHOSTS].items) { + /* same as above for -cmhosts */ + if (as->parms[P_CMHOSTS].items) { hostPtr = as->parms[P_CMHOSTS].items; - while( hostPtr != (struct cmd_item *)0) { - sprintf(buf,"cm %s",hostPtr->data); - code = parse_hostEntry(buf); - if (code) { - fprintf(stderr,"Could not parse %s\n",hostPtr->data); + while (hostPtr != (struct cmd_item *)0) { + sprintf(buf, "cm %s", hostPtr->data); + code = parse_hostEntry(buf); + if (code) { + fprintf(stderr, "Could not parse %s\n", hostPtr->data); afsmon_Exit(185); - } + } - hostPtr = hostPtr->next; + hostPtr = hostPtr->next; } - } + } - /* number of slots in circular buffers */ - if (as->parms[P_BUFFERS].items) + /* number of slots in circular buffers */ + if (as->parms[P_BUFFERS].items) num_bufSlots = atoi(as->parms[P_BUFFERS].items->data); - else + else num_bufSlots = DEFAULT_BUFSLOTS; - /* Initialize xx_showFlags[]. This array is used solely for processing the - "show" directives in the config file in parse_showEntries() */ - for(i=0; iparms[P_CONFIG].items) - process_config_file(as->parms[P_CONFIG].items->data); + if (as->parms[P_CONFIG].items) + process_config_file(as->parms[P_CONFIG].items->data); - /* print out the FS and CM lists */ - print_FS(); print_CM(); + /* print out the FS and CM lists */ + print_FS(); + print_CM(); - /* Initialize the FS results-to-screen map array if there were no "show fs" - directives in the config file */ - if (fs_showDefault) { - for(i=0; i < NUM_FS_STAT_ENTRIES; i++) - fs_Display_map[i] = i; - fs_DisplayItems_count = NUM_FS_STAT_ENTRIES; - } + /* Initialize the FS results-to-screen map array if there were no "show fs" + * directives in the config file */ + if (fs_showDefault) { + for (i = 0; i < NUM_FS_STAT_ENTRIES; i++) + fs_Display_map[i] = i; + fs_DisplayItems_count = NUM_FS_STAT_ENTRIES; + } - /* Initialize the CM results-to-screen map array if there were no "show cm" - directives in the config file */ - if (cm_showDefault) { - for(i=0; i < NUM_CM_STAT_ENTRIES; i++) - cm_Display_map[i] = i; - cm_DisplayItems_count = NUM_CM_STAT_ENTRIES; - } + /* Initialize the CM results-to-screen map array if there were no "show cm" + * directives in the config file */ + if (cm_showDefault) { + for (i = 0; i < NUM_CM_STAT_ENTRIES; i++) + cm_Display_map[i] = i; + cm_DisplayItems_count = NUM_CM_STAT_ENTRIES; + } - /* setup an interrupt signal handler; we ain't wanna leak core */ - /* this binding is useful only until gtx is initialized after which the - keyboard input server takes over. */ - if ( (signal(SIGINT,quit_signal)) == SIG_ERR ) { + /* setup an interrupt signal handler; we ain't wanna leak core */ + /* this binding is useful only until gtx is initialized after which the + * keyboard input server takes over. */ + if ((signal(SIGINT, quit_signal)) == SIG_ERR) { perror("signal() failed."); afsmon_Exit(190); - } + } - /* init error message buffers. these will be used to print error messages - once gtx is initialized and there is no access to stderr/stdout */ - errMsg[0] = '\0'; errMsg1[0] = '\0'; + /* init error message buffers. these will be used to print error messages + * once gtx is initialized and there is no access to stderr/stdout */ + errMsg[0] = '\0'; + errMsg1[0] = '\0'; - if (num_bufSlots) { + if (num_bufSlots) { - /* initialize fs and cm circular buffers before initiating probes */ - if (numFS) { - code = init_fs_buffers(); - if (code) { - fprintf(stderr,"[ %s ] init_fs_buffers returned %d\n",rn,code); + /* initialize fs and cm circular buffers before initiating probes */ + if (numFS) { + code = init_fs_buffers(); + if (code) { + fprintf(stderr, "[ %s ] init_fs_buffers returned %d\n", rn, + code); afsmon_Exit(195); - } - } + } + } - if (numCM) { - code = init_cm_buffers(); - if (code) { - fprintf(stderr,"[ %s ] init_cm_buffers returned %d\n",rn,code); + if (numCM) { + code = init_cm_buffers(); + if (code) { + fprintf(stderr, "[ %s ] init_cm_buffers returned %d\n", rn, + code); afsmon_Exit(200); - } - } - } - - /* allocate and initialize buffers for holding fs & cm results in ascii - format suitable for updating the screen */ - code = init_print_buffers(); - if (code) { - fprintf(stderr,"[ %s ] init_print_buffers returned %d\n",rn,code); + } + } + } + + /* allocate and initialize buffers for holding fs & cm results in ascii + * format suitable for updating the screen */ + code = init_print_buffers(); + if (code) { + fprintf(stderr, "[ %s ] init_print_buffers returned %d\n", rn, code); afsmon_Exit(205); - } - - /* perform gtx initializations */ - code = gtx_initialize(); - if (code) { - fprintf(stderr,"[ %s ] gtx_initialize returned %d\n",rn,code); + } + + /* perform gtx initializations */ + code = gtx_initialize(); + if (code) { + fprintf(stderr, "[ %s ] gtx_initialize returned %d\n", rn, code); afsmon_Exit(210); - } + } - /* start xstat probes */ - afsmon_execute(); + /* start xstat probes */ + afsmon_execute(); - return(0); /* will not return from the call to afsmon_execute() */ + return (0); /* will not return from the call to afsmon_execute() */ -} /* afsmonInit() */ +} /* afsmonInit() */ /*----------------------------------------------------------------------- @@ -3941,14 +4154,15 @@ struct cmd_syndesc *as; #include "AFS_component_version_number.c" -int main(argc, argv) -int argc; -char **argv; -{ /* main() */ +int +main(argc, argv) + int argc; + char **argv; +{ /* main() */ - static char rn[] = "main"; /* routine name */ - afs_int32 code; /*Return code*/ - struct cmd_syndesc *ts; /*Ptr to cmd line syntax descriptor*/ + static char rn[] = "main"; /* routine name */ + afs_int32 code; /*Return code */ + struct cmd_syndesc *ts; /*Ptr to cmd line syntax descriptor */ #ifdef AFS_AIX32_ENV /* @@ -3968,28 +4182,26 @@ char **argv; /* * Set up the commands we understand. */ - ts = cmd_CreateSyntax("initcmd", afsmonInit, 0, - "initialize the program"); - cmd_AddParm(ts, "-config", CMD_SINGLE, CMD_OPTIONAL, + ts = cmd_CreateSyntax("initcmd", afsmonInit, 0, "initialize the program"); + cmd_AddParm(ts, "-config", CMD_SINGLE, CMD_OPTIONAL, "configuration file"); - cmd_AddParm(ts, "-frequency", CMD_SINGLE, CMD_OPTIONAL, + cmd_AddParm(ts, "-frequency", CMD_SINGLE, CMD_OPTIONAL, "poll frequency, in seconds"); - cmd_AddParm(ts, "-output", CMD_SINGLE, CMD_OPTIONAL, - "storage file name"); - cmd_AddParm(ts, "-detailed", CMD_FLAG, CMD_OPTIONAL, + cmd_AddParm(ts, "-output", CMD_SINGLE, CMD_OPTIONAL, "storage file name"); + cmd_AddParm(ts, "-detailed", CMD_FLAG, CMD_OPTIONAL, "output detailed statistics to storage file"); #ifdef notdef - /* we hope to use this .... eventually! */ - cmd_AddParm(ts,"-package", CMD_SINGLE, CMD_REQUIRED, + /* we hope to use this .... eventually! */ + cmd_AddParm(ts, "-package", CMD_SINGLE, CMD_REQUIRED, "Graphics Package to use"); #endif - cmd_AddParm(ts, "-debug", CMD_SINGLE, CMD_OPTIONAL, + cmd_AddParm(ts, "-debug", CMD_SINGLE, CMD_OPTIONAL, "turn debugging output on to the named file"); - cmd_AddParm(ts, "-fshosts", CMD_LIST, CMD_OPTIONAL, + cmd_AddParm(ts, "-fshosts", CMD_LIST, CMD_OPTIONAL, "list of file servers to monitor"); - cmd_AddParm(ts, "-cmhosts", CMD_LIST, CMD_OPTIONAL, + cmd_AddParm(ts, "-cmhosts", CMD_LIST, CMD_OPTIONAL, "list of cache managers to monitor"); - cmd_AddParm(ts,"-buffers", CMD_SINGLE, CMD_OPTIONAL, + cmd_AddParm(ts, "-buffers", CMD_SINGLE, CMD_OPTIONAL, "number of buffer slots"); /* @@ -3997,11 +4209,10 @@ char **argv; */ code = cmd_Dispatch(argc, argv); - if (code) - afsmon_Exit(1); + if (code) + afsmon_Exit(1); else - afsmon_Exit(2); - - exit(0); /* redundant, but gets rid of warning */ -} /*main*/ + afsmon_Exit(2); + exit(0); /* redundant, but gets rid of warning */ +} /*main */ diff --git a/src/afsmonitor/afsmonitor.h b/src/afsmonitor/afsmonitor.h index 2a78c68e5..3561432d8 100644 --- a/src/afsmonitor/afsmonitor.h +++ b/src/afsmonitor/afsmonitor.h @@ -12,9 +12,9 @@ #define HOST_NAME_LEN 80 /* length of server/cm names */ -#define XSTAT_FS_FULLPERF_RESULTS_LEN 424 /* value of xstat_fs_Results.data.AFS_COllData_len. We use this value before making any xstat calls and hence need this definition. Remember to change this value appropriately if the size of any of the fs related data structures change. Need to find a better way of doing this */ +#define XSTAT_FS_FULLPERF_RESULTS_LEN 424 /* value of xstat_fs_Results.data.AFS_COllData_len. We use this value before making any xstat calls and hence need this definition. Remember to change this value appropriately if the size of any of the fs related data structures change. Need to find a better way of doing this */ -#define XSTAT_CM_FULLPERF_RESULTS_LEN 740 /* value of xstat_cm_Results.data.AFS_COllData_len. We use this value before making any xstat calls and hence need this definition. Remember to change this value appropriately if the size of any of the cm related data structures change. Need to find a better way of doing this */ +#define XSTAT_CM_FULLPERF_RESULTS_LEN 740 /* value of xstat_cm_Results.data.AFS_COllData_len. We use this value before making any xstat calls and hence need this definition. Remember to change this value appropriately if the size of any of the cm related data structures change. Need to find a better way of doing this */ /* THRESHOLD STRUCTURE DEFINITIONS */ @@ -23,47 +23,47 @@ /* structure of each threshold item */ struct Threshold { - char itemName[THRESH_VAR_NAME_LEN]; /* field name */ - int index; /* positional index */ - char threshVal[THRESH_VAR_LEN]; /* user provided threshold value */ - char handler[256]; /* user provided ovf handler */ + char itemName[THRESH_VAR_NAME_LEN]; /* field name */ + int index; /* positional index */ + char threshVal[THRESH_VAR_LEN]; /* user provided threshold value */ + char handler[256]; /* user provided ovf handler */ }; /* structures to store info of hosts to be monitored */ struct afsmon_hostEntry { - char hostName[HOST_NAME_LEN]; /* fs or cm host name */ - int numThresh; /* number of thresholds for this host */ - struct Threshold *thresh; /* ptr to threshold entries */ - struct afsmon_hostEntry *next; + char hostName[HOST_NAME_LEN]; /* fs or cm host name */ + int numThresh; /* number of thresholds for this host */ + struct Threshold *thresh; /* ptr to threshold entries */ + struct afsmon_hostEntry *next; }; -#define NUM_FS_STAT_ENTRIES 271 /* number of file server statistics - entries to display */ -#define FS_STAT_STRING_LEN 14 /* max length of each string above */ -#define NUM_CM_STAT_ENTRIES 571 /* number of cache manager statistics - entries to display */ -#define CM_STAT_STRING_LEN 14 /* max length of each string above */ +#define NUM_FS_STAT_ENTRIES 271 /* number of file server statistics + * entries to display */ +#define FS_STAT_STRING_LEN 14 /* max length of each string above */ +#define NUM_CM_STAT_ENTRIES 571 /* number of cache manager statistics + * entries to display */ +#define CM_STAT_STRING_LEN 14 /* max length of each string above */ /* structures to store statistics in a format convenient to dump to the screen */ /* for file servers */ struct fs_Display_Data { - char hostName[HOST_NAME_LEN]; - int probeOK; /* 0 => probe failed */ - char data[ NUM_FS_STAT_ENTRIES ][ FS_STAT_STRING_LEN ]; - short threshOvf[ NUM_FS_STAT_ENTRIES ]; /* overflow flags */ - int ovfCount; /* overflow count */ + char hostName[HOST_NAME_LEN]; + int probeOK; /* 0 => probe failed */ + char data[NUM_FS_STAT_ENTRIES][FS_STAT_STRING_LEN]; + short threshOvf[NUM_FS_STAT_ENTRIES]; /* overflow flags */ + int ovfCount; /* overflow count */ }; /* for cache managers */ struct cm_Display_Data { - char hostName[HOST_NAME_LEN]; - int probeOK; /* 0 => probe failed */ - char data[ NUM_CM_STAT_ENTRIES ][ CM_STAT_STRING_LEN ]; - short threshOvf[ NUM_CM_STAT_ENTRIES ]; /* overflow flags */ - int ovfCount; /* overflow count */ + char hostName[HOST_NAME_LEN]; + int probeOK; /* 0 => probe failed */ + char data[NUM_CM_STAT_ENTRIES][CM_STAT_STRING_LEN]; + short threshOvf[NUM_CM_STAT_ENTRIES]; /* overflow flags */ + int ovfCount; /* overflow count */ }; /* GTX related definitions */ diff --git a/src/afsweb/Makefile.in b/src/afsweb/Makefile.in index 5fdc240fa..f5080e806 100644 --- a/src/afsweb/Makefile.in +++ b/src/afsweb/Makefile.in @@ -5,32 +5,11 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html -DEST=@DEST@ -TOP_INCDIR=@TOP_INCDIR@ -TOP_LIBDIR=@TOP_LIBDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -libdir=@libdir@ -includedir=@includedir@ -mandir=@mandir@ -afssrvbindir=@afssrvbindir@ -afssrvsbindir=@afssrvsbindir@ -afssrvlibexecdir=@afssrvlibexecdir@ -RXGEN=${TOP_SRCDIR}/rxgen/rxgen -TOP_SRCDIR=@TOP_SRCDIR@ -SYS_NAME=@AFS_SYSNAME@ +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config -SHELL=/bin/sh -include ../config/Makefile.${SYS_NAME} - -UKERNELDIR=../libuafs -COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et - UKSRCS=nsafs.h nsafs.c securehash.c # @@ -135,23 +114,10 @@ netscape_afs_web_secure: chmod a+x ${DEST}/root.afsweb/install/${NETSCAPE_INSTALL_SCRIPT} chmod a+w ${DEST}/root.afsweb/install/${NETSCAPE_INSTALL_SCRIPT} -all: kinstall ukinstall +all: install: -kinstall: - @echo No $@ source here. - - -webinstall: ${UKERNELDIR}/afs ${UKSRCS} - ${INSTALL} ${UKSRCS} ${UKERNELDIR}/afs - -${UKERNELDIR}/afs: - mkdir -p $@ - -ukinstall: - @echo No $@ source here. - ## ## For Apache Afs Web Secure libraries and binaries ## NOTE: APACHE_INCLUDES should point to the Apache src directory where diff --git a/src/afsweb/README b/src/afsweb/README index be22f8411..54f970624 100644 --- a/src/afsweb/README +++ b/src/afsweb/README @@ -38,7 +38,7 @@ Web server: Apache 1.2.6 or Apache 1.3.1 AFS (client): AFS Client 3.4a Disk Space: 650 KB -Note: Due to security considerations, Transarc strongly recommends that the +Note: Due to security considerations, OpenAFS strongly recommends that the AFS Web Security Pack be used only on a server enabled with Secure Sockets Layer (SSL). diff --git a/src/afsweb/README.BETA2 b/src/afsweb/README.BETA2 index 2c4816c30..9c5e08ab6 100644 --- a/src/afsweb/README.BETA2 +++ b/src/afsweb/README.BETA2 @@ -33,7 +33,7 @@ Web server: Apache 1.2.6 AFS (client): AFS Client 3.4a Disk Space: 650 KB -Note: Due to security considerations, Transarc strongly recommends that +Note: Due to security considerations, OpenAFS strongly recommends that AFS Web Security Pack be used only on a server enabled with Secure Sockets Layer (SSL). diff --git a/src/afsweb/afswsNetscape_config.sh b/src/afsweb/afswsNetscape_config.sh index af0c5fcee..4a10220ed 100755 --- a/src/afsweb/afswsNetscape_config.sh +++ b/src/afsweb/afswsNetscape_config.sh @@ -1,406 +1,397 @@ -#!/bin/sh -# $Header: /tmp/cvstemp/openafs/src/afsweb/afswsNetscape_config.sh,v 1.1 2002/05/10 23:57:03 hartmans Exp $ -# -# Installation and Configuration script for AFS Web Security Pack -# -# History: -# -# 19-Mar-1998 Created. (wvh@transarc.com) -# -# 06-May-1998 Added tar file stuff and tweaked to add CellServDb -# edits, etc. -# -# The suggested procedure would be to install everything from the CD -# (maybe using tar?), and then run the this script. -# -# Suggested final installation heirarchy would look like: -# -# /usr//etc - conf files for AFSWebSecure -# /usr//lib - location of shared library -# /usr//cache - real cache or symlink elsewhere -# /usr//log - log files -# -########################################################################## -# -# Actual install script begins here. -# -########################################################################## - -PRODUCT="AFS Web Security Pack" - -# -# Handle various types of failures -# -trap 'echo "" ; \ - echo "$PRODUCT Installation cancelled." ; \ - echo "" ; \ - exit 1' 1 2 3 6 9 12 13 15 16 17 24 25 29 - -rm -f /tmp/newconf - -# -# Figure out what OS we're running on so that we try to -# exec the right binaries in the script. (The uname -# binary lives in the same place on AIX and SunOS -# (Solaris) systems, else we'd have to conditionalize -# that, too.) -# -OSTYPE=`/usr/bin/uname | sed -e 's;\([a-zA-Z]*\).*;\1;'` - -if [ x$OSTYPE = "xSunOS" ] ; then - HOSTNAME=/usr/ucb/hostname - NSLOOKUP=/usr/sbin/nslookup - EX=/usr/ucb/ex - ECHO=/bin/echo - ECHOFLAG="\c" - AFSWSLIB=nsafs.so -elif [ x$OSTYPE = "xAIX" ] ; then - HOSTNAME=/usr/bin/hostname - NSLOOKUP=/usr/bin/nslookup - EX=/usr/bin/ex - ECHO=echo - ECHOFLAG="" - AFSWSLIB=nsafs.a -else - $ECHO " ERROR: unsupported OSTYPE \"$OSTYPE\" returned by /usr/bin/uname." - exit 1 -fi - -# -# Check for the existence of the file to install from, and exit -# if not in pwd. -# - if [ ! -f ns_afswebsecure.tar ] ; then - $ECHO " File ns_afswebsecure.tar not found in working directory." - $ECHO "" - exit 1 - fi -# -# Find out where the server is installed -# - $ECHO "Enter the directory where the Web server's bin directory is located [/usr/netscape/suitespot]: " $ECHOFLAG - read ws_srvdir - if [ x$ws_srvdir = "x" ] ; then - ws_srvdir="/usr/netscape/suitespot" - fi - - $ECHO "" -# -# Find out the name of the Web server. Sets three variables for -# the hostname: lhn, which is the full host name; shn, which is -# the short (non-domain) host name; and dhn, which is the domain -# name. This uses nslookup, since we can't depend on the host -# actually being in /etc/hosts due to DNS and YP. -# - tmp=`$HOSTNAME` - lhn=`$NSLOOKUP $tmp | grep Name: | sed -e 's;Name:[ ]*;;'` - shn=`echo $lhn | sed -e 's;\([-_a-zA-Z0-9]*\).*;\1;'` - dhn=`echo $lhn | sed -e "s;$shn\.;;"` - -# echo "" -# echo "Long host name is $lhn." -# echo "Short host name is $shn." -# echo "Domain name is $dhn." -# echo "" - - $ECHO "Enter the Web server to use to access AFS data [$shn]: " $ECHOFLAG - read ws_wsname - case $ws_wsname in - '') ;; - *) shn=$ws_wsname;; - esac - - ws_conf=$ws_srvdir"/https-"$shn"/config/obj.conf" - - if [ ! -f $ws_conf ] ; then - $ECHO " ERROR: server config file \"$ws_conf\" not found." - exit 1 - else - $ECHO "" - fi -# -# Make sure we can actually modify the obj.conf file -# - - touch $ws_conf 1> /dev/null 2> /dev/null - if [ $? != 0 ] ; then - $ECHO " ERROR: No write permission to configuration file $ws_conf." - exit 1 - fi - -# -# Check if AFS WebSecure is already installed -# - grep nsafs $ws_conf 1> /dev/null 2> /dev/null - if [ $? = 0 ] ; then - $ECHO " ERROR: $PRODUCT entries already exist in $ws_conf." - exit 1 - fi - -# -# Find out where the AFSWebSecure stuff should be installed. -# - - $ECHO "Enter the $PRODUCT installation directory [/usr/afsweb]: " $ECHOFLAG - read ws_wsdir - if [ x$ws_wsdir = "x" ] ; then - ws_wsdir="/usr/afsweb" - fi - -# -# Install WebSecure from tar file in same directory from which the -# ws_config script was started. The convoluted directory creation -# loop lets people install in a directory tree that doesn't exist -# yet, which would not typically be the case, but... -# - if [ ! -d $ws_wsdir ] ; then - base="" - root="" - target=$ws_wsdir - while [ x$target != "x" ] ; do - base=`echo $target | sed -e 's;\(/[^/]*\)[-/a-zA-Z0-9_]*;\1;'` - target=`echo $target | sed -e 's;\(/[^/]*\)\([-/a-zA-Z0-9_]*\);\2;'` - if [ ! -d $root$base ] ; then - echo "Creating $root$base" - mkdir $root$base 1> /dev/null 2> /dev/null - if [ $? != 0 ] ; then - $ECHO "ERROR: Could not create $ws_wsdir. Check permissions and retry." - exit 1 - fi - fi - root=$root$base - done - fi - - $ECHO "" - wd=`pwd` - cd $ws_wsdir - tar xvf $wd"/ns_afswebsecure.tar" - -# -# Use this as a check that everything went OK. -# - if [ ! -f $ws_wsdir"/lib/${AFSWSLIB}" ] ; then - $ECHO " ERROR: $PRODUCT shared library \"$ws_wsdir/lib/${AFSWSLIB}\" not found." - exit 1 - else - $ECHO "" - fi - -# -# Ensure that the cache dir and log files are owned by the user -# specified in magnus.conf that this server runs as -# - ws_mconf=$ws_srvdir/https-$shn/config/magnus.conf - - if [ ! -f $ws_mconf ] ; then - $ECHO " ERROR: server config file \"$ws_mconf\" not found." - exit 1 - else - $ECHO "" - fi - - username=`grep -i User $ws_mconf | awk '{ print $2 }'` - chown $username $ws_wsdir/cache $ws_wsdir/log - -# -# Enter the size of the AFS cache in 1K blocks -# - - $ECHO "Enter the size of the $PRODUCT cache in 1K blocks [5000]: " $ECHOFLAG - read ws_csize - if [ x$ws_csize = "x" ] ; then - ws_csize="5000" - fi - $ECHO "" - - expr $ws_csize + 1 1> /dev/null 2> /dev/null - if [ $? != 0 ] ; then - $ECHO " ERROR: Cache size must be numeric. You entered \"$ws_csize\"." - exit 1 - fi - -# -# Set default value for advanced options - number of files in the cache -# and number of receiving threads. -# - ws_cfiles=`expr $ws_csize / 10` - ws_numt="2" - -# -# Enter the number of AFS daemon processes -# - - $ECHO "Enter the number of AFS daemons to run [3]: " $ECHOFLAG - read ws_numd - if [ x$ws_numd = "x" ] ; then - ws_numd="3" - fi - $ECHO "" - - expr $ws_numd + 1 1> /dev/null 2> /dev/null - if [ $? != 0 ] ; then - $ECHO " ERROR: The number of AFS daemons must be numeric. You entered \"$ws_numd\"." - exit 1 - fi - -# -# Enter the number of entries in the AFS Stat cache -# Default is the number of files in the cache. -# - - $ECHO "Enter the number of entries in the AFS stat cache [$ws_cfiles]: " $ECHOFLAG - read ws_nums - if [ x$ws_nums = "x" ] ; then - ws_nums=$ws_cfiles - fi - $ECHO "" - - expr $ws_nums + 1 1> /dev/null 2> /dev/null - if [ $? != 0 ] ; then - $ECHO " ERROR: The number of entries in the stat cache must be numeric. You entered \"$ws_nums\"." - exit 1 - fi - -# -# Find out which cells $PRODUCT should work with -# - - $ECHO "Enter the AFS cell to access using $PRODUCT [$dhn]: " $ECHOFLAG - read ws_cell - if [ x$ws_cell = "x" ] ; then - ws_cell=$dhn - fi - -# -# Create appropriate ThisCell file -# - echo $ws_cell > $ws_wsdir"/etc/ThisCell" - -# -# If necessary, add entries to generic cellServDB file -# - grep $ws_cell $ws_wsdir"/etc/CellServDB" 1> /dev/null 2> /dev/null - if [ $? != 0 ] ; then - $ECHO " Cell $ws_cell not found in default CellServDB file." - $ECHO "" - $ECHO "Enter a one-line text description for this cell: " $ECHOFLAG - read exp - $ECHO ">$ws_cell # $exp" >> $ws_wsdir"/etc/CellServDB" - $ECHO "" - $ECHO "Enter the IP address of a database server for this cell ('.' to exit): " $ECHOFLAG - read ws_dbsrv - while [ x$ws_dbsrv != "x." ] ; do - ws_dbname=`grep $ws_dbsrv /etc/hosts | sed -e 's;[0-9\.]*[ ]*\([a-z\.A-Z0-9]*\).*;\1;'` - if [ x$ws_dbname = "x" ] ; then - ws_dbname="Unknown" - fi - $ECHO " Appending $ws_dbname, IP address $ws_dbsrv." - $ECHO "$ws_dbsrv #$ws_dbname" >> $ws_wsdir"/etc/CellServDB" - $ECHO "Enter the IP address of a database server for this cell ('.' to exit): " $ECHOFLAG - read ws_dbsrv - done - else - $ECHO " Found cell $ws_cell in $ws_wsdir/etc/CellServDB." - fi - - $ECHO "" -# -# -# "Advanced" configuration items - optional. These are: -# -# - number of RX threads -# - number of files in the AFS WebSecure cache -# -# -# $ECHO "Do you want to configure advanced options? (y/n): " $ECHOFLAG -# read ans -# let=`echo $ans | sed -e 's;\(.\).*;\1;' | tr [A-Z] [a-z]` -# $ECHO "" -# if [ x$let = "xy" ] ; then -# -# -# Enter the number of files in the AFS cache - default is ws_csize/10 -# -# -# $ECHO "Enter the number of files in the Websecure cache [$ws_cfiles]: " $ECHOFLAG -# read ws_cfiles -# if [ x$ws_cfiles = "x" ] ; then -# ws_cfiles=`expr $ws_csize / 10` -# fi -# $ECHO "" -# -# expr $ws_cfiles + 1 1> /dev/null 2> /dev/null -# if [ $? != 0 ] ; then -# $ECHO " ERROR: Number of cache files must be numeric. You entered \"$ws_cfiles\"." -# exit 1 -# fi -# -# -# Enter the number of threads to process RX packets -# -# -# $ECHO "Enter the number of threads to process RX requests [2]: " $ECHOFLAG -# read ws_numt -# if [ x$ws_numt = "x" ] ; then -# ws_numt="2" -# fi -# $ECHO "" -# -# expr $ws_numt + 1 1> /dev/null 2> /dev/null -# if [ $? != 0 ] ; then -# $ECHO " ERROR: The number of RX threads must be numeric. You entered \"$ws_numt\"." -# exit 1 -# fi -# -# fi -# -# -# Now that we have all the info we need, time to actually edit the obj.conf file -# -# Back up the old one if no previous backup exists -# -if [ -f $ws_conf".pre_ws" ] ; then - $ECHO "NOTE: Backup file \"$ws_conf.pre_ws\" already exists." - $ECHO " Not backing up current obj.conf file." -else - cp $ws_conf $ws_conf".pre_ws" - $ECHO " Creating backup copy of obj.conf file..." -fi - -$EX $ws_conf << END_OF_FILE 1> /dev/null -1 -/mime-types -a -Init fn="load-modules" shlib="$ws_wsdir/lib/${AFSWSLIB}" funcs="nsafs-init,nsafs-basic,nsafs-mount,nsafs-public,nsafs-nolinks,nsafs-check,nsafs-nocheck,nsafs-find-index,nsafs-send,nsafs-force-type,nsafs-put,nsafs-delete,nsafs-move,nsafs-index,nsafs-mkdir,nsafs-rmdir" -Init fn="nsafs-init" cell="$ws_cell" blocks="$ws_csize" files="$ws_cfiles" stat="$ws_nums" daemons="$ws_numd" cachedir="$ws_wsdir/cache" confdir="$ws_wsdir/etc" logfile="$ws_wsdir/log/nsafs.log" exp-max="120" timeout="30" rcvthreads="$ws_numt" -. -/default -a -AuthTrans fn="nsafs-basic" -NameTrans fn="nsafs-mount" mount="/afs" -PathCheck fn="nsafs-public" public="/afs" -PathCheck fn="nsafs-nolinks" nolinks="/afs/$ws_cell/usr" -. -/Service -i -Service method="(GET|HEAD)" fn="nsafs-send" index="fancy" -. -w! /tmp/newconf -q -END_OF_FILE - -cp /tmp/newconf $ws_conf - -$ECHO "" - -$ECHO " Installation of $PRODUCT complete." - - - - - - - - - +#!/bin/sh +# $Header: /cvs/openafs/src/afsweb/afswsNetscape_config.sh,v 1.2 2003/11/21 08:00:17 jaltman Exp $ +# +# Installation and Configuration script for AFS Web Security Pack +# +# History: +# +# 19-Mar-1998 Created. (wvh@transarc.com) +# +# 06-May-1998 Added tar file stuff and tweaked to add CellServDb +# edits, etc. +# +# The suggested procedure would be to install everything from the CD +# (maybe using tar?), and then run the this script. +# +# Suggested final installation heirarchy would look like: +# +# /usr//etc - conf files for AFSWebSecure +# /usr//lib - location of shared library +# /usr//cache - real cache or symlink elsewhere +# /usr//log - log files +# +########################################################################## +# +# Actual install script begins here. +# +########################################################################## + +PRODUCT="AFS Web Security Pack" + +# +# Handle various types of failures +# +trap 'echo "" ; \ + echo "$PRODUCT Installation cancelled." ; \ + echo "" ; \ + exit 1' 1 2 3 6 9 12 13 15 16 17 24 25 29 + +rm -f /tmp/newconf + +# +# Figure out what OS we're running on so that we try to +# exec the right binaries in the script. (The uname +# binary lives in the same place on AIX and SunOS +# (Solaris) systems, else we'd have to conditionalize +# that, too.) +# +OSTYPE=`/usr/bin/uname | sed -e 's;\([a-zA-Z]*\).*;\1;'` + +if [ x$OSTYPE = "xSunOS" ] ; then + HOSTNAME=/usr/ucb/hostname + NSLOOKUP=/usr/sbin/nslookup + EX=/usr/ucb/ex + ECHO=/bin/echo + ECHOFLAG="\c" + AFSWSLIB=nsafs.so +elif [ x$OSTYPE = "xAIX" ] ; then + HOSTNAME=/usr/bin/hostname + NSLOOKUP=/usr/bin/nslookup + EX=/usr/bin/ex + ECHO=echo + ECHOFLAG="" + AFSWSLIB=nsafs.a +else + $ECHO " ERROR: unsupported OSTYPE \"$OSTYPE\" returned by /usr/bin/uname." + exit 1 +fi + +# +# Check for the existence of the file to install from, and exit +# if not in pwd. +# + if [ ! -f ns_afswebsecure.tar ] ; then + $ECHO " File ns_afswebsecure.tar not found in working directory." + $ECHO "" + exit 1 + fi +# +# Find out where the server is installed +# + $ECHO "Enter the directory where the Web server's bin directory is located [/usr/netscape/suitespot]: " $ECHOFLAG + read ws_srvdir + if [ x$ws_srvdir = "x" ] ; then + ws_srvdir="/usr/netscape/suitespot" + fi + + $ECHO "" +# +# Find out the name of the Web server. Sets three variables for +# the hostname: lhn, which is the full host name; shn, which is +# the short (non-domain) host name; and dhn, which is the domain +# name. This uses nslookup, since we can't depend on the host +# actually being in /etc/hosts due to DNS and YP. +# + tmp=`$HOSTNAME` + lhn=`$NSLOOKUP $tmp | grep Name: | sed -e 's;Name:[ ]*;;'` + shn=`echo $lhn | sed -e 's;\([-_a-zA-Z0-9]*\).*;\1;'` + dhn=`echo $lhn | sed -e "s;$shn\.;;"` + +# echo "" +# echo "Long host name is $lhn." +# echo "Short host name is $shn." +# echo "Domain name is $dhn." +# echo "" + + $ECHO "Enter the Web server to use to access AFS data [$shn]: " $ECHOFLAG + read ws_wsname + case $ws_wsname in + '') ;; + *) shn=$ws_wsname;; + esac + + ws_conf=$ws_srvdir"/https-"$shn"/config/obj.conf" + + if [ ! -f $ws_conf ] ; then + $ECHO " ERROR: server config file \"$ws_conf\" not found." + exit 1 + else + $ECHO "" + fi +# +# Make sure we can actually modify the obj.conf file +# + + touch $ws_conf 1> /dev/null 2> /dev/null + if [ $? != 0 ] ; then + $ECHO " ERROR: No write permission to configuration file $ws_conf." + exit 1 + fi + +# +# Check if AFS WebSecure is already installed +# + grep nsafs $ws_conf 1> /dev/null 2> /dev/null + if [ $? = 0 ] ; then + $ECHO " ERROR: $PRODUCT entries already exist in $ws_conf." + exit 1 + fi + +# +# Find out where the AFSWebSecure stuff should be installed. +# + + $ECHO "Enter the $PRODUCT installation directory [/usr/afsweb]: " $ECHOFLAG + read ws_wsdir + if [ x$ws_wsdir = "x" ] ; then + ws_wsdir="/usr/afsweb" + fi + +# +# Install WebSecure from tar file in same directory from which the +# ws_config script was started. The convoluted directory creation +# loop lets people install in a directory tree that doesn't exist +# yet, which would not typically be the case, but... +# + if [ ! -d $ws_wsdir ] ; then + base="" + root="" + target=$ws_wsdir + while [ x$target != "x" ] ; do + base=`echo $target | sed -e 's;\(/[^/]*\)[-/a-zA-Z0-9_]*;\1;'` + target=`echo $target | sed -e 's;\(/[^/]*\)\([-/a-zA-Z0-9_]*\);\2;'` + if [ ! -d $root$base ] ; then + echo "Creating $root$base" + mkdir $root$base 1> /dev/null 2> /dev/null + if [ $? != 0 ] ; then + $ECHO "ERROR: Could not create $ws_wsdir. Check permissions and retry." + exit 1 + fi + fi + root=$root$base + done + fi + + $ECHO "" + wd=`pwd` + cd $ws_wsdir + tar xvf $wd"/ns_afswebsecure.tar" + +# +# Use this as a check that everything went OK. +# + if [ ! -f $ws_wsdir"/lib/${AFSWSLIB}" ] ; then + $ECHO " ERROR: $PRODUCT shared library \"$ws_wsdir/lib/${AFSWSLIB}\" not found." + exit 1 + else + $ECHO "" + fi + +# +# Ensure that the cache dir and log files are owned by the user +# specified in magnus.conf that this server runs as +# + ws_mconf=$ws_srvdir/https-$shn/config/magnus.conf + + if [ ! -f $ws_mconf ] ; then + $ECHO " ERROR: server config file \"$ws_mconf\" not found." + exit 1 + else + $ECHO "" + fi + + username=`grep -i User $ws_mconf | awk '{ print $2 }'` + chown $username $ws_wsdir/cache $ws_wsdir/log + +# +# Enter the size of the AFS cache in 1K blocks +# + + $ECHO "Enter the size of the $PRODUCT cache in 1K blocks [5000]: " $ECHOFLAG + read ws_csize + if [ x$ws_csize = "x" ] ; then + ws_csize="5000" + fi + $ECHO "" + + expr $ws_csize + 1 1> /dev/null 2> /dev/null + if [ $? != 0 ] ; then + $ECHO " ERROR: Cache size must be numeric. You entered \"$ws_csize\"." + exit 1 + fi + +# +# Set default value for advanced options - number of files in the cache +# and number of receiving threads. +# + ws_cfiles=`expr $ws_csize / 10` + ws_numt="2" + +# +# Enter the number of AFS daemon processes +# + + $ECHO "Enter the number of AFS daemons to run [3]: " $ECHOFLAG + read ws_numd + if [ x$ws_numd = "x" ] ; then + ws_numd="3" + fi + $ECHO "" + + expr $ws_numd + 1 1> /dev/null 2> /dev/null + if [ $? != 0 ] ; then + $ECHO " ERROR: The number of AFS daemons must be numeric. You entered \"$ws_numd\"." + exit 1 + fi + +# +# Enter the number of entries in the AFS Stat cache +# Default is the number of files in the cache. +# + + $ECHO "Enter the number of entries in the AFS stat cache [$ws_cfiles]: " $ECHOFLAG + read ws_nums + if [ x$ws_nums = "x" ] ; then + ws_nums=$ws_cfiles + fi + $ECHO "" + + expr $ws_nums + 1 1> /dev/null 2> /dev/null + if [ $? != 0 ] ; then + $ECHO " ERROR: The number of entries in the stat cache must be numeric. You entered \"$ws_nums\"." + exit 1 + fi + +# +# Find out which cells $PRODUCT should work with +# + + $ECHO "Enter the AFS cell to access using $PRODUCT [$dhn]: " $ECHOFLAG + read ws_cell + if [ x$ws_cell = "x" ] ; then + ws_cell=$dhn + fi + +# +# Create appropriate ThisCell file +# + echo $ws_cell > $ws_wsdir"/etc/ThisCell" + +# +# If necessary, add entries to generic cellServDB file +# + grep $ws_cell $ws_wsdir"/etc/CellServDB" 1> /dev/null 2> /dev/null + if [ $? != 0 ] ; then + $ECHO " Cell $ws_cell not found in default CellServDB file." + $ECHO "" + $ECHO "Enter a one-line text description for this cell: " $ECHOFLAG + read exp + $ECHO ">$ws_cell # $exp" >> $ws_wsdir"/etc/CellServDB" + $ECHO "" + $ECHO "Enter the IP address of a database server for this cell ('.' to exit): " $ECHOFLAG + read ws_dbsrv + while [ x$ws_dbsrv != "x." ] ; do + ws_dbname=`grep $ws_dbsrv /etc/hosts | sed -e 's;[0-9\.]*[ ]*\([a-z\.A-Z0-9]*\).*;\1;'` + if [ x$ws_dbname = "x" ] ; then + ws_dbname="Unknown" + fi + $ECHO " Appending $ws_dbname, IP address $ws_dbsrv." + $ECHO "$ws_dbsrv #$ws_dbname" >> $ws_wsdir"/etc/CellServDB" + $ECHO "Enter the IP address of a database server for this cell ('.' to exit): " $ECHOFLAG + read ws_dbsrv + done + else + $ECHO " Found cell $ws_cell in $ws_wsdir/etc/CellServDB." + fi + + $ECHO "" +# +# +# "Advanced" configuration items - optional. These are: +# +# - number of RX threads +# - number of files in the AFS WebSecure cache +# +# +# $ECHO "Do you want to configure advanced options? (y/n): " $ECHOFLAG +# read ans +# let=`echo $ans | sed -e 's;\(.\).*;\1;' | tr [A-Z] [a-z]` +# $ECHO "" +# if [ x$let = "xy" ] ; then +# +# +# Enter the number of files in the AFS cache - default is ws_csize/10 +# +# +# $ECHO "Enter the number of files in the Websecure cache [$ws_cfiles]: " $ECHOFLAG +# read ws_cfiles +# if [ x$ws_cfiles = "x" ] ; then +# ws_cfiles=`expr $ws_csize / 10` +# fi +# $ECHO "" +# +# expr $ws_cfiles + 1 1> /dev/null 2> /dev/null +# if [ $? != 0 ] ; then +# $ECHO " ERROR: Number of cache files must be numeric. You entered \"$ws_cfiles\"." +# exit 1 +# fi +# +# +# Enter the number of threads to process RX packets +# +# +# $ECHO "Enter the number of threads to process RX requests [2]: " $ECHOFLAG +# read ws_numt +# if [ x$ws_numt = "x" ] ; then +# ws_numt="2" +# fi +# $ECHO "" +# +# expr $ws_numt + 1 1> /dev/null 2> /dev/null +# if [ $? != 0 ] ; then +# $ECHO " ERROR: The number of RX threads must be numeric. You entered \"$ws_numt\"." +# exit 1 +# fi +# +# fi +# +# +# Now that we have all the info we need, time to actually edit the obj.conf file +# +# Back up the old one if no previous backup exists +# +if [ -f $ws_conf".pre_ws" ] ; then + $ECHO "NOTE: Backup file \"$ws_conf.pre_ws\" already exists." + $ECHO " Not backing up current obj.conf file." +else + cp $ws_conf $ws_conf".pre_ws" + $ECHO " Creating backup copy of obj.conf file..." +fi + +$EX $ws_conf << END_OF_FILE 1> /dev/null +1 +/mime-types +a +Init fn="load-modules" shlib="$ws_wsdir/lib/${AFSWSLIB}" funcs="nsafs-init,nsafs-basic,nsafs-mount,nsafs-public,nsafs-nolinks,nsafs-check,nsafs-nocheck,nsafs-find-index,nsafs-send,nsafs-force-type,nsafs-put,nsafs-delete,nsafs-move,nsafs-index,nsafs-mkdir,nsafs-rmdir" +Init fn="nsafs-init" cell="$ws_cell" blocks="$ws_csize" files="$ws_cfiles" stat="$ws_nums" daemons="$ws_numd" cachedir="$ws_wsdir/cache" confdir="$ws_wsdir/etc" logfile="$ws_wsdir/log/nsafs.log" exp-max="120" timeout="30" rcvthreads="$ws_numt" +. +/default +a +AuthTrans fn="nsafs-basic" +NameTrans fn="nsafs-mount" mount="/afs" +PathCheck fn="nsafs-public" public="/afs" +PathCheck fn="nsafs-nolinks" nolinks="/afs/$ws_cell/usr" +. +/Service +i +Service method="(GET|HEAD)" fn="nsafs-send" index="fancy" +. +w! /tmp/newconf +q +END_OF_FILE + +cp /tmp/newconf $ws_conf + +$ECHO "" + +$ECHO " Installation of $PRODUCT complete." diff --git a/src/afsweb/apache_afs_cache.c b/src/afsweb/apache_afs_cache.c index ee7ef6fe7..bed11b92c 100644 --- a/src/afsweb/apache_afs_cache.c +++ b/src/afsweb/apache_afs_cache.c @@ -12,7 +12,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/afsweb/apache_afs_cache.c,v 1.1.1.5 2001/09/11 14:31:09 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afsweb/apache_afs_cache.c,v 1.6 2003/07/15 23:14:33 shadow Exp $"); #include "apache_afs_cache.h" @@ -48,15 +49,17 @@ static const sha_int hashinit[] = { #define ROTL(n, x) (((x) << (n)) | ((x) >> (SHA_BITS_PER_INT - (n)))) #ifdef DISABLED_CODE_HERE -static sha_int f(int t, sha_int x, sha_int y, sha_int z) +static sha_int +f(int t, sha_int x, sha_int y, sha_int z) { - if (t < 0 || t >= SHA_ROUNDS) return 0; + if (t < 0 || t >= SHA_ROUNDS) + return 0; if (t < 20) - return (z ^ (x & (y ^ z))); + return (z ^ (x & (y ^ z))); if (t < 40) - return (x ^ y ^ z); + return (x ^ y ^ z); if (t < 60) - return ((x & y) | (z & (x | y))); /* saves 1 boolean op */ + return ((x & y) | (z & (x | y))); /* saves 1 boolean op */ return (x ^ y ^ z); /* 60-79 same as 40-59 */ } #endif @@ -93,14 +96,16 @@ static sha_int f(int t, sha_int x, sha_int y, sha_int z) /* This macro/function supplies the "magic" constant for each round. */ /* The function call version preserved above until stable */ -static const sha_int k_vals[] = { 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6}; +static const sha_int k_vals[] = + { 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6 }; #define K(t) ( (t < 0 || t >= SHA_ROUNDS) ? 0 : k_vals[ t/20 ] ) /* * Update the internal state based on the given chunk. */ -static void transform(shaState *shaStateP, sha_int *chunk) +static void +transform(shaState * shaStateP, sha_int * chunk) { sha_int A = shaStateP->digest[0]; sha_int B = shaStateP->digest[1]; @@ -115,13 +120,17 @@ static void transform(shaState *shaStateP, sha_int *chunk) for (t = 0; t < SHA_CHUNK_INTS; t++) W[t] = chunk[t]; for (; t < SHA_ROUNDS; t++) { - TEMP = W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]; + TEMP = W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16]; W[t] = ROTL(1, TEMP); } for (t = 0; t < SHA_ROUNDS; t++) { TEMP = ROTL(5, A) + f(t, B, C, D) + E + W[t] + K(t); - E = D; D = C; C = ROTL(30, B); B = A; A = TEMP; + E = D; + D = C; + C = ROTL(30, B); + B = A; + A = TEMP; } shaStateP->digest[0] += A; @@ -137,7 +146,8 @@ static void transform(shaState *shaStateP, sha_int *chunk) * as input and produces an output array of ints that is * SHA_CHUNK_INTS long. */ -static void buildInts(const char *data, sha_int *chunk) +static void +buildInts(const char *data, sha_int * chunk) { /* * Need to copy the data because we can't be certain that @@ -159,7 +169,8 @@ static void buildInts(const char *data, sha_int *chunk) * buildInts to break the input up into chunks and repeatedly passing * these chunks to transform(). */ -void sha_update(shaState *shaStateP, const char *buffer, int bufferLen) +void +sha_update(shaState * shaStateP, const char *buffer, int bufferLen) { int i; sha_int chunk[SHA_CHUNK_INTS]; @@ -173,7 +184,7 @@ void sha_update(shaState *shaStateP, const char *buffer, int bufferLen) shaStateP->bitcountHi++; shaStateP->bitcountLo = newLo; shaStateP->bitcountHi += ((bufferLen >> (SHA_BITS_PER_INT - 3)) & 0x07); - + /* * If we won't have enough for a full chunk, just tack this * buffer onto the leftover piece and return. @@ -204,9 +215,9 @@ void sha_update(shaState *shaStateP, const char *buffer, int bufferLen) bufferLen -= SHA_CHUNK_BYTES; } /* assert((bufferLen >= 0) && (bufferLen < SHA_CHUNK_BYTES)); */ - if ((bufferLen < 0) || (bufferLen > SHA_CHUNK_BYTES) ) { - fprintf(stderr, "apache_afs_cache: ASSERTION FAILED...exiting\n"); - exit(-1); + if ((bufferLen < 0) || (bufferLen > SHA_CHUNK_BYTES)) { + fprintf(stderr, "apache_afs_cache: ASSERTION FAILED...exiting\n"); + exit(-1); } if (bufferLen > 0) { @@ -222,7 +233,8 @@ void sha_update(shaState *shaStateP, const char *buffer, int bufferLen) * of the hash bitcount to finish the hash. The hash value * is not valid until finish() has been called. */ -void sha_finish(shaState *shaStateP) +void +sha_finish(shaState * shaStateP) { sha_int chunk[SHA_CHUNK_INTS]; int i; @@ -253,11 +265,13 @@ void sha_finish(shaState *shaStateP) * SHS standard, and clear out the bitcount and leftover vars. * This should be used to initialize an shaState. */ -void sha_clear(shaState *shaStateP) +void +sha_clear(shaState * shaStateP) { big_endian = (0x01020304 == htonl(0x01020304)); - memcpy((void *)&shaStateP->digest[0], (void *)&hashinit[0], SHA_HASH_BYTES); + memcpy((void *)&shaStateP->digest[0], (void *)&hashinit[0], + SHA_HASH_BYTES); shaStateP->bitcountLo = shaStateP->bitcountHi = 0; shaStateP->leftoverLen = 0; } @@ -266,7 +280,8 @@ void sha_clear(shaState *shaStateP) /* * Hash the buffer and place the result in *shaStateP. */ -void sha_hash(shaState *shaStateP, const char *buffer, int bufferLen) +void +sha_hash(shaState * shaStateP, const char *buffer, int bufferLen) { sha_clear(shaStateP); sha_update(shaStateP, buffer, bufferLen); @@ -278,10 +293,11 @@ void sha_hash(shaState *shaStateP, const char *buffer, int bufferLen) * Returns the current state of the hash as an array of 20 bytes. * This will be an interim result if finish() has not yet been called. */ -void sha_bytes(const shaState *shaStateP, char *bytes) +void +sha_bytes(const shaState * shaStateP, char *bytes) { sha_int temp[SHA_HASH_INTS]; - int i; + int i; for (i = 0; i < SHA_HASH_INTS; i++) temp[i] = htonl(shaStateP->digest[i]); @@ -292,54 +308,53 @@ void sha_bytes(const shaState *shaStateP, char *bytes) /* * Hash function for the AFS login cache */ -int weblog_login_hash(char *name, char *cell) +int +weblog_login_hash(char *name, char *cell) { char *p; afs_uint32 val; - for (val = *name , p = name ; *p != '\0' ; p++) { - val = (val << 2) ^ val ^ (afs_uint32)(*p); + for (val = *name, p = name; *p != '\0'; p++) { + val = (val << 2) ^ val ^ (afs_uint32) (*p); } - for (p = cell ; *p != '\0' ; p++) { - val = (val << 2) ^ val ^ (afs_uint32)(*p); + for (p = cell; *p != '\0'; p++) { + val = (val << 2) ^ val ^ (afs_uint32) (*p); } - return val & (WEBLOG_LOGIN_HASH_SIZE-1); + return val & (WEBLOG_LOGIN_HASH_SIZE - 1); } /* * Compute a SHA checksum on the username, cellname, and password */ -void weblog_login_checksum( - char *user, - char *cell, - char *passwd, - char *cksum) +void +weblog_login_checksum(char *user, char *cell, char *passwd, char *cksum) { - int passwdLen; - int userLen; - int cellLen; - char *shaBuffer; - shaState state; - - /* - * Compute SHA(username,SHA(password,pad)) - */ - passwdLen = strlen(passwd); - userLen = strlen(user); - cellLen = strlen(cell); - shaBuffer = (char *) malloc(MAX(userLen+cellLen,passwdLen)+SHA_HASH_BYTES); - strcpy(shaBuffer, passwd); - memcpy((void *)(shaBuffer + passwdLen), (void *)(&weblog_login_pad[0]), - SHA_HASH_BYTES); - sha_clear(&state); - sha_hash(&state, shaBuffer, passwdLen+SHA_HASH_BYTES); - memcpy(shaBuffer, user, userLen); - memcpy(shaBuffer+userLen, cell, cellLen); - sha_bytes(&state, shaBuffer+userLen+cellLen); - sha_clear(&state); - sha_hash(&state, shaBuffer, userLen+cellLen+SHA_HASH_BYTES); - sha_bytes(&state, &cksum[0]); - memset(shaBuffer, 0, MAX(userLen+cellLen,passwdLen)+SHA_HASH_BYTES); - free(shaBuffer); + int passwdLen; + int userLen; + int cellLen; + char *shaBuffer; + shaState state; + + /* + * Compute SHA(username,SHA(password,pad)) + */ + passwdLen = strlen(passwd); + userLen = strlen(user); + cellLen = strlen(cell); + shaBuffer = + (char *)malloc(MAX(userLen + cellLen, passwdLen) + SHA_HASH_BYTES); + strcpy(shaBuffer, passwd); + memcpy((void *)(shaBuffer + passwdLen), (void *)(&weblog_login_pad[0]), + SHA_HASH_BYTES); + sha_clear(&state); + sha_hash(&state, shaBuffer, passwdLen + SHA_HASH_BYTES); + memcpy(shaBuffer, user, userLen); + memcpy(shaBuffer + userLen, cell, cellLen); + sha_bytes(&state, shaBuffer + userLen + cellLen); + sha_clear(&state); + sha_hash(&state, shaBuffer, userLen + cellLen + SHA_HASH_BYTES); + sha_bytes(&state, &cksum[0]); + memset(shaBuffer, 0, MAX(userLen + cellLen, passwdLen) + SHA_HASH_BYTES); + free(shaBuffer); } /* @@ -347,179 +362,175 @@ void weblog_login_checksum( * given username, and the SHA checksums match, then * set the token parameter and return 1, otherwise return 0. */ -int weblog_login_lookup( - char *user, - char *cell, - char *cksum, - char *token) +int +weblog_login_lookup(char *user, char *cell, char *cksum, char *token) { - int index; - long curTime; - struct weblog_login *loginP, *tmpP, loginTmp; - - /* - * Search the hash chain for a matching entry, free - * expired entries as we search - */ - index = weblog_login_hash(user, cell); - curTime = time(NULL); - - loginP = weblog_login_cache[index].head; - while (loginP != NULL) { - if (loginP->expiration < curTime) { - tmpP = loginP; - loginP = tmpP->next; - - DLL_DELETE(tmpP, weblog_login_cache[index].head, - weblog_login_cache[index].tail, next, prev); - free(tmpP); - continue; - } - if (strcmp(loginP->username, user) == 0 && - strcmp(loginP->cellname, cell) == 0 && - memcmp((void *)&loginP->cksum[0], (void *)cksum,SHA_HASH_BYTES) == 0) { - - memcpy((void *)token, (void *) &loginP->token[0], MAXBUFF); - return loginP->tokenLen; + int index; + long curTime; + struct weblog_login *loginP, *tmpP, loginTmp; + + /* + * Search the hash chain for a matching entry, free + * expired entries as we search + */ + index = weblog_login_hash(user, cell); + curTime = time(NULL); + + loginP = weblog_login_cache[index].head; + while (loginP != NULL) { + if (loginP->expiration < curTime) { + tmpP = loginP; + loginP = tmpP->next; + + DLL_DELETE(tmpP, weblog_login_cache[index].head, + weblog_login_cache[index].tail, next, prev); + free(tmpP); + continue; + } + if (strcmp(loginP->username, user) == 0 + && strcmp(loginP->cellname, cell) == 0 + && memcmp((void *)&loginP->cksum[0], (void *)cksum, + SHA_HASH_BYTES) == 0) { + + memcpy((void *)token, (void *)&loginP->token[0], MAXBUFF); + return loginP->tokenLen; + } + loginP = loginP->next; } - loginP = loginP->next; - } - return 0; + return 0; } /* * Insert a login token into the cache. If the user already has an entry, * then overwrite the old entry. */ -int weblog_login_store( - char *user, - char *cell, - char *cksum, - char *token, - int tokenLen, - afs_uint32 expiration) +int +weblog_login_store(char *user, char *cell, char *cksum, char *token, + int tokenLen, afs_uint32 expiration) { - int index; - long curTime; - struct weblog_login *loginP, *tmpP, loginTmp; - - int parseToken(char *tokenBuf); - - /* - * Search the hash chain for a matching entry, free - * expired entries as we search - */ - index = weblog_login_hash(user, cell); - curTime = time(NULL); - loginP = weblog_login_cache[index].head; - - while (loginP != NULL) { - if (strcmp(loginP->username, user) == 0 && - strcmp(loginP->cellname, cell) == 0) { - break; + int index; + long curTime; + struct weblog_login *loginP, *tmpP, loginTmp; + + int parseToken(char *tokenBuf); + + /* + * Search the hash chain for a matching entry, free + * expired entries as we search + */ + index = weblog_login_hash(user, cell); + curTime = time(NULL); + loginP = weblog_login_cache[index].head; + + while (loginP != NULL) { + if (strcmp(loginP->username, user) == 0 + && strcmp(loginP->cellname, cell) == 0) { + break; + } + if (loginP->expiration < curTime) { + tmpP = loginP; + loginP = tmpP->next; + + DLL_DELETE(tmpP, weblog_login_cache[index].head, + weblog_login_cache[index].tail, next, prev); + free(tmpP); + continue; + } + loginP = loginP->next; } - if (loginP->expiration < curTime) { - tmpP = loginP; - loginP = tmpP->next; - - DLL_DELETE(tmpP, weblog_login_cache[index].head, - weblog_login_cache[index].tail, next, prev); - free(tmpP); - continue; + if (loginP == NULL) { + loginP = (struct weblog_login *)malloc(sizeof(struct weblog_login)); + strcpy(&loginP->username[0], user); + strcpy(&loginP->cellname[0], cell); + } else { + DLL_DELETE(loginP, weblog_login_cache[index].head, + weblog_login_cache[index].tail, next, prev); } - loginP = loginP->next; - } - if (loginP == NULL) { - loginP = (struct weblog_login *)malloc(sizeof(struct weblog_login)); - strcpy(&loginP->username[0], user); - strcpy(&loginP->cellname[0], cell); - } - else { - DLL_DELETE(loginP, weblog_login_cache[index].head, - weblog_login_cache[index].tail, next, prev); - } - - memcpy((void *)&loginP->cksum[0], (void *)cksum, SHA_HASH_BYTES); - loginP->expiration = expiration; - loginP->tokenLen=getTokenLen(token); - memcpy((void *)&loginP->token[0], (void *)token, MAXBUFF); - - DLL_INSERT_TAIL(loginP, weblog_login_cache[index].head, - weblog_login_cache[index].tail, next, prev); - return 0; + + memcpy((void *)&loginP->cksum[0], (void *)cksum, SHA_HASH_BYTES); + loginP->expiration = expiration; + loginP->tokenLen = getTokenLen(token); + memcpy((void *)&loginP->token[0], (void *)token, MAXBUFF); + + DLL_INSERT_TAIL(loginP, weblog_login_cache[index].head, + weblog_login_cache[index].tail, next, prev); + return 0; } token_cache_init() { - int i; - for (i = 0 ; i < WEBLOG_LOGIN_HASH_SIZE ; i++) { - DLL_INIT_LIST(weblog_login_cache[i].head, - weblog_login_cache[i].tail); - } + int i; + for (i = 0; i < WEBLOG_LOGIN_HASH_SIZE; i++) { + DLL_INIT_LIST(weblog_login_cache[i].head, weblog_login_cache[i].tail); + } } -int getTokenLen(char *buf) +int +getTokenLen(char *buf) { - afs_int32 len=0; - afs_int32 rc=0; - char cellName[WEBLOG_CELLNAME_MAX]; - register char *tp; - int n = sizeof(afs_int32); - struct ClearToken { - afs_int32 AuthHandle; - char HandShakeKey[8]; - afs_int32 ViceId; - afs_int32 BeginTimestamp; - afs_int32 EndTimestamp; - } token; - tp=buf; - memcpy(&len, tp, sizeof(afs_int32)); /* get size of secret token */ - rc=(len+sizeof(afs_int32)); - tp += (sizeof(afs_int32) + len); /* skip secret token and its length */ - memcpy(&len, tp, sizeof(afs_int32)); /* get size of clear token */ - if (len != sizeof(struct ClearToken)) { + afs_int32 len = 0; + afs_int32 rc = 0; + char cellName[WEBLOG_CELLNAME_MAX]; + register char *tp; + int n = sizeof(afs_int32); + struct ClearToken { + afs_int32 AuthHandle; + char HandShakeKey[8]; + afs_int32 ViceId; + afs_int32 BeginTimestamp; + afs_int32 EndTimestamp; + } token; + tp = buf; + memcpy(&len, tp, sizeof(afs_int32)); /* get size of secret token */ + rc = (len + sizeof(afs_int32)); + tp += (sizeof(afs_int32) + len); /* skip secret token and its length */ + memcpy(&len, tp, sizeof(afs_int32)); /* get size of clear token */ + if (len != sizeof(struct ClearToken)) { #ifdef DEBUG - fprintf(stderr, "apache_afs_cache.c:getExpiration:" - "something's wrong with the length of ClearToken:%d\n", len); + fprintf(stderr, + "apache_afs_cache.c:getExpiration:" + "something's wrong with the length of ClearToken:%d\n", len); #endif - return -1; - } - rc+=(sizeof(afs_int32)+len); /* length of clear token + length itself */ - tp+=(sizeof(afs_int32)+len); /* skip clear token and its length */ - rc+=sizeof(afs_int32); /* length of primary flag */ - tp+=sizeof(afs_int32); /* skip over primary flag */ - strcpy(cellName, tp); - if (cellName != NULL) - rc+=strlen(cellName); - return rc; + return -1; + } + rc += (sizeof(afs_int32) + len); /* length of clear token + length itself */ + tp += (sizeof(afs_int32) + len); /* skip clear token and its length */ + rc += sizeof(afs_int32); /* length of primary flag */ + tp += sizeof(afs_int32); /* skip over primary flag */ + strcpy(cellName, tp); + if (cellName != NULL) + rc += strlen(cellName); + return rc; } -long getExpiration(char *buf) +long +getExpiration(char *buf) { - afs_int32 len=0; - register char *tp; - int n = sizeof(afs_int32); - struct ClearToken { - afs_int32 AuthHandle; - char HandShakeKey[8]; - afs_int32 ViceId; - afs_int32 BeginTimestamp; - afs_int32 EndTimestamp; - } token; - - tp = buf; - memcpy(&len, tp, sizeof(afs_int32)); /* get size of secret token */ - tp += (sizeof(afs_int32) + len); /* skip secret token and its length */ - memcpy(&len, tp, sizeof(afs_int32)); /* get size of clear token */ - if (len != sizeof(struct ClearToken)) { + afs_int32 len = 0; + register char *tp; + int n = sizeof(afs_int32); + struct ClearToken { + afs_int32 AuthHandle; + char HandShakeKey[8]; + afs_int32 ViceId; + afs_int32 BeginTimestamp; + afs_int32 EndTimestamp; + } token; + + tp = buf; + memcpy(&len, tp, sizeof(afs_int32)); /* get size of secret token */ + tp += (sizeof(afs_int32) + len); /* skip secret token and its length */ + memcpy(&len, tp, sizeof(afs_int32)); /* get size of clear token */ + if (len != sizeof(struct ClearToken)) { #ifdef DEBUG - fprintf(stderr, "apache_afs_cache.c:getExpiration:" - "something's wrong with the length of ClearToken:%d\n", len); + fprintf(stderr, + "apache_afs_cache.c:getExpiration:" + "something's wrong with the length of ClearToken:%d\n", len); #endif - return -1; - } - - tp += sizeof(afs_int32); /* skip length of clear token */ - memcpy(&token, tp, sizeof(struct ClearToken)); /* copy the token */ - return token.EndTimestamp; + return -1; + } + + tp += sizeof(afs_int32); /* skip length of clear token */ + memcpy(&token, tp, sizeof(struct ClearToken)); /* copy the token */ + return token.EndTimestamp; } diff --git a/src/afsweb/apache_afs_cache.h b/src/afsweb/apache_afs_cache.h index 307b5dfc3..824480ccb 100644 --- a/src/afsweb/apache_afs_cache.h +++ b/src/afsweb/apache_afs_cache.h @@ -68,11 +68,11 @@ #define WEBLOG_MAX_PATH 1024 /* Maximum path length */ #define WEBLOG_USERNAME_MAX 64 /* Maximum username length */ #define WEBLOG_CELLNAME_MAX 64 /* Maximum password length */ -#define WEBLOG_PASSWORD_MAX 64 +#define WEBLOG_PASSWORD_MAX 64 #define WEBLOG_LOGIN_HASH_SIZE 1024 /* MUST be power of two */ -#define TEN_MINUTES 600 /* 10 minutes = 600 seconds */ +#define TEN_MINUTES 600 /* 10 minutes = 600 seconds */ -#define MAXBUFF 1024 /* CHECK THIS - size of token */ +#define MAXBUFF 1024 /* CHECK THIS - size of token */ /* * Structure user to store entries in AFS login cache */ @@ -90,9 +90,13 @@ struct weblog_login { extern int weblog_login_hash(char *name, char *cell); -extern void weblog_login_checksum(char *user,char *cell,char *passwd,char *cksum); -extern int weblog_login_lookup(char *user,char *cell,char *cksum,char *token); -extern int weblog_login_store(char *user,char *cell,char *cksum,char *token,int tokenLen, afs_uint32 expiration); +extern void weblog_login_checksum(char *user, char *cell, char *passwd, + char *cksum); +extern int weblog_login_lookup(char *user, char *cell, char *cksum, + char *token); +extern int weblog_login_store(char *user, char *cell, char *cksum, + char *token, int tokenLen, + afs_uint32 expiration); extern int getTokenLen(char *token); #endif /* _APACHE_AFS_CACHE_H_INCLUDED_ */ diff --git a/src/afsweb/apache_afs_client.c b/src/afsweb/apache_afs_client.c index eda7e7c9f..8cc3e633d 100644 --- a/src/afsweb/apache_afs_client.c +++ b/src/afsweb/apache_afs_client.c @@ -22,13 +22,13 @@ #define afsassert(str) if(!(str)) { fprintf(stderr, "afs module: assertion failed:%s\t%d\n",__FILE__,__LINE__) ; return SERVER_ERROR; } -#define MAXBUFF 1024 +#define MAXBUFF 1024 #define APACHEAFS_MAX_PATH 1024 /* Maximum path length */ -#define APACHEAFS_USERNAME_MAX 64 /* Maximum username length */ -#define APACHEAFS_PASSWORD_MAX 64 /* Maximum password length */ -#define APACHEAFS_CELLNAME_MAX 64 /* Maximum cellname length */ -#define APACHEAFS_MOUNTPTLEN_MAX 64 /* Max mountpoint length */ +#define APACHEAFS_USERNAME_MAX 64 /* Maximum username length */ +#define APACHEAFS_PASSWORD_MAX 64 /* Maximum password length */ +#define APACHEAFS_CELLNAME_MAX 64 /* Maximum cellname length */ +#define APACHEAFS_MOUNTPTLEN_MAX 64 /* Max mountpoint length */ #ifndef MAX #define MAX(A,B) ((A)>(B)?(A):(B)) @@ -38,7 +38,7 @@ #endif /* !MAX */ /* */ -static int setCellAuthHeader(request_rec *r); +static int setCellAuthHeader(request_rec * r); /* Module name for logging stuff */ extern const char module_name[]; @@ -67,172 +67,177 @@ static char lastCell[APACHEAFS_CELLNAME_MAX]; static char lastCksum[SHA_HASH_BYTES]; /* do I have my own PAG */ -static int doneSETPAG=0; +static int doneSETPAG = 0; /* * Parse the authorization header for username and password */ -static int parse_authhdr(request_rec *r, - char *user, - char *passwd, - char *cell, - char *defaultCell) +static int +parse_authhdr(request_rec * r, char *user, char *passwd, char *cell, + char *defaultCell) { - int i; - char *p, *t; - const char *auth_line = TABLE_GET (r->headers_in, "Authorization"); - - if ((r == NULL) || (auth_line == NULL) || (user == NULL) || - (passwd == NULL) || (cell == NULL)) { - LOG_REASON ("AFSAUTH_CLIENT: NULL request record, auth_line, cell," - "user or passwd while parsing authentication header", - r->uri, r); - return SERVER_ERROR; - } - - user[0] = '\0'; - passwd[0] = '\0'; - cell[0] = '\0'; - - /* - * check for basic authentication - */ - if (strncasecmp(GETWORD(r->pool,(const char **)&auth_line,' '), - "basic",6) != 0) { - /* Client tried to authenticate using some other auth scheme */ - LOG_REASON ("AFSAUTH_CLIENT:client used other than Basic authentication" - "scheme", r->uri, r); - return SERVER_ERROR; - } - - /* - * Username and password are base64 encoded - */ - t = UUDECODE (r->pool, auth_line); - - if (t == NULL) { - LOG_REASON ("AFSAUTH_CLIENT:uudecode failed", r->uri, r); - return SERVER_ERROR; - } - - /* - * Format is user@cell:passwd. The user, cell or passwd may be missing - */ - r->connection->user = GETWORD_NULLS (r->pool, (const char **)&t, ':'); - r->connection->auth_type = "Basic"; - strcpy(passwd,t); - - p = r->connection->user; - - for ( i = 0 ; *p != '@' && *p != '\0' ; p++ , i++) { - user[i] = *p; - } - user[i] = '\0'; - if (*p == '@') { - for (i = 0 , p++ ; *p != '\0' ; p++ , i++) { - cell[i] = *p; - } - cell[i] = '\0'; - } - - if (cell[0] == '\0') { - strcpy(cell, defaultCell); - } - return OK; + int i; + char *p, *t; + const char *auth_line = TABLE_GET(r->headers_in, "Authorization"); + + if ((r == NULL) || (auth_line == NULL) || (user == NULL) + || (passwd == NULL) || (cell == NULL)) { + LOG_REASON("AFSAUTH_CLIENT: NULL request record, auth_line, cell," + "user or passwd while parsing authentication header", + r->uri, r); + return SERVER_ERROR; + } + + user[0] = '\0'; + passwd[0] = '\0'; + cell[0] = '\0'; + + /* + * check for basic authentication + */ + if (strncasecmp + (GETWORD(r->pool, (const char **)&auth_line, ' '), "basic", 6) != 0) { + /* Client tried to authenticate using some other auth scheme */ + LOG_REASON + ("AFSAUTH_CLIENT:client used other than Basic authentication" + "scheme", r->uri, r); + return SERVER_ERROR; + } + + /* + * Username and password are base64 encoded + */ + t = UUDECODE(r->pool, auth_line); + + if (t == NULL) { + LOG_REASON("AFSAUTH_CLIENT:uudecode failed", r->uri, r); + return SERVER_ERROR; + } + + /* + * Format is user@cell:passwd. The user, cell or passwd may be missing + */ + r->connection->user = GETWORD_NULLS(r->pool, (const char **)&t, ':'); + r->connection->auth_type = "Basic"; + strcpy(passwd, t); + + p = r->connection->user; + + for (i = 0; *p != '@' && *p != '\0'; p++, i++) { + user[i] = *p; + } + user[i] = '\0'; + if (*p == '@') { + for (i = 0, p++; *p != '\0'; p++, i++) { + cell[i] = *p; + } + cell[i] = '\0'; + } + + if (cell[0] == '\0') { + strcpy(cell, defaultCell); + } + return OK; } /* * send a buffer to the weblog process over the pipe. Used for sending * authentication credentials to weblog */ -static int sendBuffer(char *buf, int len) +static int +sendBuffer(char *buf, int len) { - afsassert(buf); - if (write(writePipe, buf, len) != len) { - afslog(5, ("%s: Error writing to pipe - %s", module_name, strerror(errno))); - return -1; - } - return 0; + afsassert(buf); + if (write(writePipe, buf, len) != len) { + afslog(5, + ("%s: Error writing to pipe - %s", module_name, + strerror(errno))); + return -1; + } + return 0; } /* * packs user credentials into a buffer seperated by newlines and * sends them to weblog */ -static int sendTo_afsAuthenticator(char *user, char *passwd, - char *cell, char *type) +static int +sendTo_afsAuthenticator(char *user, char *passwd, char *cell, char *type) { - char buf[MAXBUFF]; + char buf[MAXBUFF]; - afsassert(user); - afsassert(passwd); - afsassert(cell); - afsassert(type); + afsassert(user); + afsassert(passwd); + afsassert(cell); + afsassert(type); - sprintf(buf, "%s\n%s\n%s\n%s", type, user, cell, passwd); - return sendBuffer(buf, strlen(buf)); + sprintf(buf, "%s\n%s\n%s\n%s", type, user, cell, passwd); + return sendBuffer(buf, strlen(buf)); } /* * reads the response from weblog over the pipe */ -static int recvFrom_afsAuthenticator(char *buf) +static int +recvFrom_afsAuthenticator(char *buf) { - int n; - - afsassert(buf); - n = read(readPipe, buf, MAXBUFF); - if(n < 0) { - afslog(5, ("%s: Error reading from pipe - %s", module_name, strerror(errno))); - return -1; - } - return n; + int n; + + afsassert(buf); + n = read(readPipe, buf, MAXBUFF); + if (n < 0) { + afslog(5, + ("%s: Error reading from pipe - %s", module_name, + strerror(errno))); + return -1; + } + return n; } #ifndef NO_AFSAPACHE_CACHE /* * check local cache for the token associated with user crds. */ -static int check_Cache(char *user, char *passwd, char *cell, char *tokenBuf) +static int +check_Cache(char *user, char *passwd, char *cell, char *tokenBuf) { - char cksum[SHA_HASH_BYTES]; /* for sha checksum for caching */ + char cksum[SHA_HASH_BYTES]; /* for sha checksum for caching */ - /* look up local cache - function in apache_afs_cach.c */ - weblog_login_checksum(user, cell, passwd, cksum); - return weblog_login_lookup(user, cell, cksum, &tokenBuf[0]); + /* look up local cache - function in apache_afs_cach.c */ + weblog_login_checksum(user, cell, passwd, cksum); + return weblog_login_lookup(user, cell, cksum, &tokenBuf[0]); } /* * put the token and the user credentials in the local cache */ -static int updateCache(char *user, - char *passwd, - char *cell, - char *tokenBuf, - int cacheExpiration) +static int +updateCache(char *user, char *passwd, char *cell, char *tokenBuf, + int cacheExpiration) { - long expires = 0, testExpires = 0; - char cksum[SHA_HASH_BYTES]; /* for sha checksum for caching */ - - /* put the token in local cache with the expiration date */ - expires = getExpiration(tokenBuf); - if (expires < 0 ) { - afslog(5, ("%s: Error getting expiration time for cache. Expires %d", - module_name, expires)); - return -1; - } - - weblog_login_checksum(user, cell, passwd, cksum); - - if (cacheExpiration == 0) { - weblog_login_store(user, cell, cksum, &tokenBuf[0], sizeof(tokenBuf),expires); - } - else { - testExpires=cacheExpiration+time(NULL); - weblog_login_store(user, cell, cksum, &tokenBuf[0],sizeof(tokenBuf), - MIN(expires,testExpires)); - } - return 0; + long expires = 0, testExpires = 0; + char cksum[SHA_HASH_BYTES]; /* for sha checksum for caching */ + + /* put the token in local cache with the expiration date */ + expires = getExpiration(tokenBuf); + if (expires < 0) { + afslog(5, + ("%s: Error getting expiration time for cache. Expires %d", + module_name, expires)); + return -1; + } + + weblog_login_checksum(user, cell, passwd, cksum); + + if (cacheExpiration == 0) { + weblog_login_store(user, cell, cksum, &tokenBuf[0], sizeof(tokenBuf), + expires); + } else { + testExpires = cacheExpiration + time(NULL); + weblog_login_store(user, cell, cksum, &tokenBuf[0], sizeof(tokenBuf), + MIN(expires, testExpires)); + } + return 0; } #endif /* NO_APACHEAFS_CACHE */ @@ -240,31 +245,33 @@ static int updateCache(char *user, /* * locking routines to provide exclusive access to the pipes */ -static int start_lock(int fd, int cmd, int type) +static int +start_lock(int fd, int cmd, int type) { - struct flock lock; - lock.l_type=type; - lock.l_start = 0; - lock.l_whence = SEEK_SET; - lock.l_len = 0; - return (fcntl(fd, cmd, &lock)); + struct flock lock; + lock.l_type = type; + lock.l_start = 0; + lock.l_whence = SEEK_SET; + lock.l_len = 0; + return (fcntl(fd, cmd, &lock)); } -static int test_lock(int fd, int type) +static int +test_lock(int fd, int type) { - struct flock lock; - lock.l_type=type; - lock.l_start = 0; - lock.l_whence = SEEK_SET; - lock.l_len = 0; - - if (fcntl(fd, F_GETLK, &lock) < 0) { - return -1; - } - if (lock.l_type == F_UNLCK) { - return 0; /* not locked */ - } - return (lock.l_pid); /* return pid of locking process */ + struct flock lock; + lock.l_type = type; + lock.l_start = 0; + lock.l_whence = SEEK_SET; + lock.l_len = 0; + + if (fcntl(fd, F_GETLK, &lock) < 0) { + return -1; + } + if (lock.l_type == F_UNLCK) { + return 0; /* not locked */ + } + return (lock.l_pid); /* return pid of locking process */ } @@ -288,20 +295,20 @@ static int test_lock(int fd, int type) * over a shared pipe (mutex provided using locks) and recieves either a * token or an error message */ -static int request_Authentication(char *user, char *passwd, - char *cell, char *type, - char *tokenbuf, char *reason) +static int +request_Authentication(char *user, char *passwd, char *cell, char *type, + char *tokenbuf, char *reason) { - int len = 0; - int pid; - char *temp; - int lockfd = 0; + int len = 0; + int pid; + char *temp; + int lockfd = 0; - afsassert(user); - afsassert(passwd); - afsassert(cell); - afsassert(type); - afsassert(tokenbuf); + afsassert(user); + afsassert(passwd); + afsassert(cell); + afsassert(type); + afsassert(tokenbuf); /* * lock the pipe before beginning communication or in case of AIX it is an @@ -309,115 +316,123 @@ static int request_Authentication(char *user, char *passwd, * a temporary file and use that fd instead */ #ifdef AIX - lockfd = tempfd; + lockfd = tempfd; #else - lockfd = writePipe; + lockfd = writePipe; #endif - while ((pid = Is_writelock(lockfd)) != 0) { - if (pid < 0) { - afslog(5, ("%s: pid:%d Error locking pipe - %s", - module_name, getpid(), strerror(errno))); - return -1; + while ((pid = Is_writelock(lockfd)) != 0) { + if (pid < 0) { + afslog(5, + ("%s: pid:%d Error locking pipe - %s", module_name, + getpid(), strerror(errno))); + return -1; + } + afslog(40, + ("%s: pid %d waiting for lock held by pid %d", module_name, + getpid(), pid)); } - afslog(40, ("%s: pid %d waiting for lock held by pid %d", - module_name, getpid(), pid)); - } - if(Write_lock(lockfd) == -1) { - afslog(5, ("%s: pid:%d Error write lock - %s. Retrying with WriteW", - module_name, getpid(), strerror(errno))); - if (Writew_lock(lockfd) == -1) { - afslog(5, ("%s: pid:%d Error write lock - %s", - module_name, getpid(), strerror(errno))); - return -1; + if (Write_lock(lockfd) == -1) { + afslog(5, + ("%s: pid:%d Error write lock - %s. Retrying with WriteW", + module_name, getpid(), strerror(errno))); + if (Writew_lock(lockfd) == -1) { + afslog(5, + ("%s: pid:%d Error write lock - %s", module_name, getpid(), + strerror(errno))); + return -1; + } } - } - if (sendTo_afsAuthenticator(user, passwd, cell, type) == -1) { - Unlock(lockfd); - afslog(5, ("%s: Error sending authentication info", module_name)); - return -1; - } + if (sendTo_afsAuthenticator(user, passwd, cell, type) == -1) { + Unlock(lockfd); + afslog(5, ("%s: Error sending authentication info", module_name)); + return -1; + } - len = recvFrom_afsAuthenticator(tokenbuf); + len = recvFrom_afsAuthenticator(tokenbuf); /* release the lock */ - if (Unlock(lockfd)) { - afslog(5, ("%s: pid:%d Error unlocking", module_name, getpid())); - return -1; - } - - if (len > 0) { - if (strncmp(tokenbuf,"FAILURE",7)==0) { - temp = &tokenbuf[7]; - strncpy(reason, temp, len); - return -2; - } - } - return len; + if (Unlock(lockfd)) { + afslog(5, ("%s: pid:%d Error unlocking", module_name, getpid())); + return -1; + } + + if (len > 0) { + if (strncmp(tokenbuf, "FAILURE", 7) == 0) { + temp = &tokenbuf[7]; + strncpy(reason, temp, len); + return -2; + } + } + return len; } /* * pioctl setting token */ -static int setToken(char *tokenBuf, int tokenLen) +static int +setToken(char *tokenBuf, int tokenLen) { - register char *temp; - afs_int32 i=0; + register char *temp; + afs_int32 i = 0; - afsassert(tokenBuf); + afsassert(tokenBuf); - /* - * set the primary flag only if we haven't done a SETPAG previoulsy - * by flipping this bit - */ - if (!doneSETPAG) { + /* + * set the primary flag only if we haven't done a SETPAG previoulsy + * by flipping this bit + */ + if (!doneSETPAG) { #ifdef OLDSETPAG - /* skip over the secret token */ - temp = tokenBuf; - memcpy(&i, temp, sizeof(afs_int32)); - temp += (i + sizeof(afs_int32)); - - /* skip over the clear token */ - memcpy(&i, temp, sizeof(afs_int32)); - temp += (i + sizeof(afs_int32)); - - doneSETPAG = 1; - memcpy(&i, temp, sizeof(afs_int32)); - i |= 0x8000; - memcpy(temp, &i, sizeof(afs_int32)); - temp += sizeof(afs_int32); + /* skip over the secret token */ + temp = tokenBuf; + memcpy(&i, temp, sizeof(afs_int32)); + temp += (i + sizeof(afs_int32)); + + /* skip over the clear token */ + memcpy(&i, temp, sizeof(afs_int32)); + temp += (i + sizeof(afs_int32)); + + doneSETPAG = 1; + memcpy(&i, temp, sizeof(afs_int32)); + i |= 0x8000; + memcpy(temp, &i, sizeof(afs_int32)); + temp += sizeof(afs_int32); #endif - if(do_setpag()) { - return -1; + if (do_setpag()) { + return -1; + } + doneSETPAG = 1; } - doneSETPAG=1; - } - return do_pioctl(tokenBuf, tokenLen, tokenBuf, tokenLen, VIOCSETTOK, NULL, 0); + return do_pioctl(tokenBuf, tokenLen, tokenBuf, tokenLen, VIOCSETTOK, NULL, + 0); } /* * Get the token for the primary cell from the cache manager for this * process. Primary cell is the cell at the first index (index 0) */ -static int getToken(char *buf, int bufsize) +static int +getToken(char *buf, int bufsize) { - /* get just the ONE token for this PAG from cache manager */ - afs_int32 i = 0; - memcpy((void *)buf, (void *)&i, sizeof(afs_int32)); - return do_pioctl(buf, sizeof(afs_int32), buf, bufsize, - VIOCGETTOK, NULL,0); + /* get just the ONE token for this PAG from cache manager */ + afs_int32 i = 0; + memcpy((void *)buf, (void *)&i, sizeof(afs_int32)); + return do_pioctl(buf, sizeof(afs_int32), buf, bufsize, VIOCGETTOK, NULL, + 0); } - + /* * discard all authentication information for this PAG ie. this process */ -int unlog() +int +unlog() { - return do_pioctl(0, 0, 0,0, VIOCUNPAG, NULL, 0); + return do_pioctl(0, 0, 0, 0, VIOCUNPAG, NULL, 0); } @@ -429,287 +444,303 @@ int unlog() * - sets the token and returns appropriate return code * Return values: OK, SERVER_ERROR, AUTH_REQUIRED, FORBIDDEN */ -int authenticateUser(request_rec *r, char *defaultCell, - int cacheExpiration, char *type) +int +authenticateUser(request_rec * r, char *defaultCell, int cacheExpiration, + char *type) { - char user[APACHEAFS_USERNAME_MAX]; - char passwd[APACHEAFS_PASSWORD_MAX]; - char cell[APACHEAFS_CELLNAME_MAX]; - char tokenbuf[MAXBUFF]; - char cksum[SHA_HASH_BYTES]; - int rc = 0; - int i = 0; - const char *auth_line; - char reason[MAXBUFF]; /* if authentication failed - this is why */ - char err_msg[MAXBUFF]; - int userChanged = 0; - - afsassert(r); - afsassert(r->uri); - afsassert(defaultCell); - afsassert(type); - - auth_line = TABLE_GET (r->headers_in, "Authorization"); - - if (strcmp(global_default_cell, defaultCell)) { - strcpy(global_default_cell, defaultCell); - } - - memset(user, 0, APACHEAFS_USERNAME_MAX); - memset(passwd, 0, APACHEAFS_PASSWORD_MAX); - memset(cell, 0, APACHEAFS_CELLNAME_MAX); - - if (auth_line == NULL) { /* No Authorization field - we don't do anything */ + char user[APACHEAFS_USERNAME_MAX]; + char passwd[APACHEAFS_PASSWORD_MAX]; + char cell[APACHEAFS_CELLNAME_MAX]; + char tokenbuf[MAXBUFF]; + char cksum[SHA_HASH_BYTES]; + int rc = 0; + int i = 0; + const char *auth_line; + char reason[MAXBUFF]; /* if authentication failed - this is why */ + char err_msg[MAXBUFF]; + int userChanged = 0; + + afsassert(r); + afsassert(r->uri); + afsassert(defaultCell); + afsassert(type); + + auth_line = TABLE_GET(r->headers_in, "Authorization"); + + if (strcmp(global_default_cell, defaultCell)) { + strcpy(global_default_cell, defaultCell); + } + + memset(user, 0, APACHEAFS_USERNAME_MAX); + memset(passwd, 0, APACHEAFS_PASSWORD_MAX); + memset(cell, 0, APACHEAFS_CELLNAME_MAX); + + if (auth_line == NULL) { /* No Authorization field - we don't do anything */ + /* + * No Authorization field recieved - that's fine by us. + * go ahead and attempt to service the request and if we get + * back FORBIDDEN then we'll take care of it then + */ + afslog(15, ("%s: No authline recieved", module_name)); + haveAuth = 0; + userChanged = 1; + memset(lastUser, 0, APACHEAFS_USERNAME_MAX); + memset(lastCell, 0, APACHEAFS_CELLNAME_MAX); + memset(lastCksum, 0, SHA_HASH_BYTES); + rc = unlog(); + afslog(25, + ("%s: pid:%d No Authorization field. Unlogging ...", + module_name, getpid())); + if (rc) { + sprintf(err_msg, + "%s: Error unlogging from AFS cell - rc: %d, errno:%d", + module_name, rc, errno); + LOG_REASON(err_msg, r->uri, r); + return SERVER_ERROR; + } + return OK; + } + /* - * No Authorization field recieved - that's fine by us. - * go ahead and attempt to service the request and if we get - * back FORBIDDEN then we'll take care of it then + * We should get here only if there IS an Authorization field */ - afslog(15, ("%s: No authline recieved", module_name)); - haveAuth = 0; - userChanged=1; - memset(lastUser, 0, APACHEAFS_USERNAME_MAX); - memset(lastCell, 0, APACHEAFS_CELLNAME_MAX); - memset(lastCksum, 0, SHA_HASH_BYTES); - rc = unlog(); - afslog(25, ("%s: pid:%d No Authorization field. Unlogging ...", - module_name, getpid())); - if (rc) { - sprintf(err_msg, "%s: Error unlogging from AFS cell - rc: %d, errno:%d", - module_name, rc, errno); - LOG_REASON(err_msg, r->uri, r); - return SERVER_ERROR; + + if ((rc = parse_authhdr(r, user, passwd, cell, defaultCell)) != 0) { + sprintf(err_msg, "%s: Error parsing Authorization Header rc:%d", + module_name, rc); + LOG_REASON(err_msg, r->uri, r); + return rc; /* SERVER ERROR */ } - return OK; - } - - /* - * We should get here only if there IS an Authorization field - */ - - if ((rc = parse_authhdr(r, user, passwd, cell, defaultCell)) != 0) { - sprintf(err_msg, "%s: Error parsing Authorization Header rc:%d", - module_name, rc); - LOG_REASON(err_msg, r->uri, r); - return rc; /* SERVER ERROR */ - } - - /* - * should get here only after obtaining the username and password and cell - * check to make sure anyway - */ - if ((user[0] =='\0') || (cell[0] == '\0') || (passwd[0] =='\0')) { - afslog(15, ("%s: pid:%d No username or password or cell. Unlogging.", + + /* + * should get here only after obtaining the username and password and cell + * check to make sure anyway + */ + if ((user[0] == '\0') || (cell[0] == '\0') || (passwd[0] == '\0')) { + afslog(15, + ("%s: pid:%d No username or password or cell. Unlogging.", module_name, getpid())); - haveAuth = 0; - userChanged = 1; - memset(lastUser, 0, APACHEAFS_USERNAME_MAX); - memset(lastCell, 0, APACHEAFS_CELLNAME_MAX); - memset(lastCksum, 0, SHA_HASH_BYTES); - rc = unlog(); - if (rc) { - sprintf(err_msg, "%s: Error unlogging from AFS cell - rc: %d, errno:%d", - module_name, rc, errno); - LOG_REASON(err_msg, r->uri, r); - return SERVER_ERROR; + haveAuth = 0; + userChanged = 1; + memset(lastUser, 0, APACHEAFS_USERNAME_MAX); + memset(lastCell, 0, APACHEAFS_CELLNAME_MAX); + memset(lastCksum, 0, SHA_HASH_BYTES); + rc = unlog(); + if (rc) { + sprintf(err_msg, + "%s: Error unlogging from AFS cell - rc: %d, errno:%d", + module_name, rc, errno); + LOG_REASON(err_msg, r->uri, r); + return SERVER_ERROR; + } + setCellAuthHeader(r); + return AUTH_REQUIRED; } - setCellAuthHeader(r); - return AUTH_REQUIRED; - } - #ifdef DEBUG - fprintf(stderr, "Cell:%s\tUser:%s\tPasswd:%s\n", cell, user, passwd); + fprintf(stderr, "Cell:%s\tUser:%s\tPasswd:%s\n", cell, user, passwd); #endif - /* - * compare with previous username/cell/cksum - update it - * unlog if required - */ - - weblog_login_checksum(user, cell, passwd, cksum); - if (!haveAuth) { - haveAuth = 1; - strcpy(lastUser, user); - strcpy (lastCksum, cksum); - strcpy(lastCell, cell); - } - if (strcmp(user, lastUser) || - strcmp(cell, lastCell) || - strcmp(cksum, lastCksum)) { /* - * unlog the old user from the cell if a new username/passwd is recievd - */ - - userChanged = 1; - afslog(25, ("%s: pid:%d\tUnlogging user %s from cell%s", - module_name, getpid(), lastUser, lastCell)); - afslog(25, ("%s:New user:%s\t New Cell:%s", module_name, user, cell)); - afslog(25, ("%s:Trying to get URL:%s", module_name, r->uri)); - afslog(25, ("%s: Unlogging ....", module_name)); - - if (unlog()) { - sprintf(err_msg, "%s: Error unlogging from AFS cell - rc: %d, errno:%d", - module_name, rc, errno); - LOG_REASON(err_msg, r->uri, r); - return SERVER_ERROR; - } - /* change lastUser to this user */ - strcpy(lastUser, user); - strcpy (lastCksum, cksum); - strcpy(lastCell, cell); - } /* strcmp checksums - ie. did the user change */ - - -#ifndef NO_AFSAPACHE_CACHE - if (!cache_initialized) { - token_cache_init(); - cache_initialized = 1; - } - - /* have to check local cache for this name/passwd */ - - rc = check_Cache(user, passwd, cell, tokenbuf); - if (rc) { - /* if found then just send the request without going through - * weblog - this means the user has already been authenticated - * once and we have a valid token just need to set it - - * only if it is different from the token already set. No need to - * even unlog because this token is set for the entire PAG which - * of course consists of just this child process + * compare with previous username/cell/cksum - update it + * unlog if required */ - afslog(35, ("%s: pid:%d found user %s's token (expires:%d) in cache", - module_name, getpid(), user, (getExpiration(tokenbuf)-time(NULL)))); - - /* if the user changed then set this token else leave it since it should - be set */ - if (userChanged) { - /* set this token obtained from the local cache */ - afslog(15,("%s:pid:%d\t Setting cached token", module_name, getpid())); - if(setToken(tokenbuf, rc)) { - afslog(5, ("%s: pid:%d Failed to set token obtained from cache." - "rc:%d errno:%d Token Expiration:%d", module_name, getpid(), - rc, errno, (getExpiration(tokenbuf)-time(NULL)))); -#ifdef DEBUG_CACHE - parseToken(tokenbuf); -#endif + + weblog_login_checksum(user, cell, passwd, cksum); + if (!haveAuth) { + haveAuth = 1; + strcpy(lastUser, user); + strcpy(lastCksum, cksum); + strcpy(lastCell, cell); + } + if (strcmp(user, lastUser) || strcmp(cell, lastCell) + || strcmp(cksum, lastCksum)) { /* - * BUG WORKAROUND: sometimes we fail while setting token - * with errno ESRCH indicating the named cell - * in the last field of the token is not recognized - but that's - * not quite true according to parseToken()!! Possibly corrupted - * tokens from the cache? - * Anyway we just get a new token from weblog + * unlog the old user from the cell if a new username/passwd is recievd */ - goto reqAuth; - } - } /* if userChanged */ - else { - /* if this is a child process getting the request for the first time - * then there's no way this guy's got a token for us in which case - * getToken should fail with EDOM and that means we should set the token - * first and maybe set a static variable saying we have set a token? - */ - char temp[MAXBUFF]; - if(getToken(temp, sizeof(temp))) { - if (errno == EDOM) { - /* try setting the cached token */ - if(setToken(tokenbuf,rc)) { - /* - * same bug workaround here. ie. go to weblog if setting - * the cached token fails. - */ - sprintf(err_msg,"%s: pid:%d Failed to set cached token." - "errno:%d rc:%d", module_name, getpid(), errno, rc); - LOG_REASON(err_msg, r->uri, r); - goto reqAuth; - } + + userChanged = 1; + afslog(25, + ("%s: pid:%d\tUnlogging user %s from cell%s", module_name, + getpid(), lastUser, lastCell)); + afslog(25, ("%s:New user:%s\t New Cell:%s", module_name, user, cell)); + afslog(25, ("%s:Trying to get URL:%s", module_name, r->uri)); + afslog(25, ("%s: Unlogging ....", module_name)); + + if (unlog()) { + sprintf(err_msg, + "%s: Error unlogging from AFS cell - rc: %d, errno:%d", + module_name, rc, errno); + LOG_REASON(err_msg, r->uri, r); + return SERVER_ERROR; } + /* change lastUser to this user */ + strcpy(lastUser, user); + strcpy(lastCksum, cksum); + strcpy(lastCell, cell); + } + + /* strcmp checksums - ie. did the user change */ +#ifndef NO_AFSAPACHE_CACHE + if (!cache_initialized) { + token_cache_init(); + cache_initialized = 1; + } + + /* have to check local cache for this name/passwd */ + + rc = check_Cache(user, passwd, cell, tokenbuf); + if (rc) { + /* if found then just send the request without going through + * weblog - this means the user has already been authenticated + * once and we have a valid token just need to set it - + * only if it is different from the token already set. No need to + * even unlog because this token is set for the entire PAG which + * of course consists of just this child process + */ + afslog(35, + ("%s: pid:%d found user %s's token (expires:%d) in cache", + module_name, getpid(), user, + (getExpiration(tokenbuf) - time(NULL)))); + + /* if the user changed then set this token else leave it since it should + * be set */ + if (userChanged) { + /* set this token obtained from the local cache */ + afslog(15, + ("%s:pid:%d\t Setting cached token", module_name, + getpid())); + if (setToken(tokenbuf, rc)) { + afslog(5, + ("%s: pid:%d Failed to set token obtained from cache." + "rc:%d errno:%d Token Expiration:%d", module_name, + getpid(), rc, errno, + (getExpiration(tokenbuf) - time(NULL)))); +#ifdef DEBUG_CACHE + parseToken(tokenbuf); +#endif + /* + * BUG WORKAROUND: sometimes we fail while setting token + * with errno ESRCH indicating the named cell + * in the last field of the token is not recognized - but that's + * not quite true according to parseToken()!! Possibly corrupted + * tokens from the cache? + * Anyway we just get a new token from weblog + */ + goto reqAuth; + } + } /* if userChanged */ else { - /* and again for any getToken failure other than EDOM */ - sprintf(err_msg,"%s: Failed to get token: errno:%d rc:%d", - module_name, errno, rc); - LOG_REASON(err_msg, r->uri, r); - goto reqAuth; + /* if this is a child process getting the request for the first time + * then there's no way this guy's got a token for us in which case + * getToken should fail with EDOM and that means we should set the token + * first and maybe set a static variable saying we have set a token? + */ + char temp[MAXBUFF]; + if (getToken(temp, sizeof(temp))) { + if (errno == EDOM) { + /* try setting the cached token */ + if (setToken(tokenbuf, rc)) { + /* + * same bug workaround here. ie. go to weblog if setting + * the cached token fails. + */ + sprintf(err_msg, + "%s: pid:%d Failed to set cached token." + "errno:%d rc:%d", module_name, getpid(), + errno, rc); + LOG_REASON(err_msg, r->uri, r); + goto reqAuth; + } + } else { + /* and again for any getToken failure other than EDOM */ + sprintf(err_msg, + "%s: Failed to get token: errno:%d rc:%d", + module_name, errno, rc); + LOG_REASON(err_msg, r->uri, r); + goto reqAuth; + } + } /* so we already have a token set since the gettoken succeeded */ } - } /* so we already have a token set since the gettoken succeeded */ - } - /* to set the REMOTE_USER environment variable */ - strcpy(r->connection->user,user); - return OK; - } - /* - * else - request afs_Authenticator's for it and update local cache - * then go about serving the request URI - */ - else { - reqAuth: + /* to set the REMOTE_USER environment variable */ + strcpy(r->connection->user, user); + return OK; + } + /* + * else - request afs_Authenticator's for it and update local cache + * then go about serving the request URI + */ + else { + reqAuth: #endif /* NO_AFSAPACHE_CACHE */ - rc = request_Authentication(user, passwd, cell, type, tokenbuf,reason); - if (rc > 0) { - /* we got back a token from weblog */ - /* set the token with setToken */ - if(setToken(tokenbuf, rc)) { - sprintf(err_msg, "%s: Failed to set token given by weblog. errno:%d", - module_name, errno); - LOG_REASON(err_msg, r->uri, r); - return SERVER_ERROR; - } - -#ifdef DEBUG_TOKENS - system("/usr/afsws/bin/tokens"); + rc = request_Authentication(user, passwd, cell, type, tokenbuf, + reason); + if (rc > 0) { + /* we got back a token from weblog */ + /* set the token with setToken */ + if (setToken(tokenbuf, rc)) { + sprintf(err_msg, + "%s: Failed to set token given by weblog. errno:%d", + module_name, errno); + LOG_REASON(err_msg, r->uri, r); + return SERVER_ERROR; + } +#ifdef DEBUG_TOKENS + system("/usr/afsws/bin/tokens"); #endif #ifndef NO_AFSAPACHE_CACHE - /* update local cache */ - if (updateCache(user, passwd, cell, tokenbuf,cacheExpiration)) { - sprintf(err_msg, "%s: Error updating cache", module_name); - LOG_REASON(err_msg, r->uri, r); - return SERVER_ERROR; - } - afslog(15, ("%s: pid:%d\t put user:%s tokens in cache", - module_name, getpid(), user)); + /* update local cache */ + if (updateCache(user, passwd, cell, tokenbuf, cacheExpiration)) { + sprintf(err_msg, "%s: Error updating cache", module_name); + LOG_REASON(err_msg, r->uri, r); + return SERVER_ERROR; + } + afslog(15, + ("%s: pid:%d\t put user:%s tokens in cache", module_name, + getpid(), user)); #endif /* NO_AFSAPACHE_CACHE */ - /* now we've got a token, updated the cache and set it so we should - * have no problems accessing AFS files - however if we do then - * we handle it in afs_accessCheck() when the error comes back - */ + /* now we've got a token, updated the cache and set it so we should + * have no problems accessing AFS files - however if we do then + * we handle it in afs_accessCheck() when the error comes back + */ - /* to set the REMOTE_USER environment variable to the username */ - strcpy(r->connection->user,user); - return OK; - } - else if (rc == -2) { - sprintf(err_msg, ":%s: AFS authentication failed for %s@%s because %s", - module_name, user, cell, reason); - LOG_REASON(err_msg, r->uri, r); - setCellAuthHeader(r); - return AUTH_REQUIRED; - } - else if (rc == -1) { - sprintf(err_msg, "%s: Error readiong from pipe. errno:%d", module_name, errno); - LOG_REASON(err_msg, r->uri, r); - return SERVER_ERROR; - } - - else { - /* - * unknown error from weblog - this should not occur - * if afs_Authenticator can't authenticate you, then return FORBIDDEN - */ - sprintf(err_msg, "%s: AFS could not authenticate user %s in cell %s." - "Returning FORBIDDEN", module_name, user, cell); - LOG_REASON(err_msg, r->uri, r); - return FORBIDDEN; - } + /* to set the REMOTE_USER environment variable to the username */ + strcpy(r->connection->user, user); + return OK; + } else if (rc == -2) { + sprintf(err_msg, + ":%s: AFS authentication failed for %s@%s because %s", + module_name, user, cell, reason); + LOG_REASON(err_msg, r->uri, r); + setCellAuthHeader(r); + return AUTH_REQUIRED; + } else if (rc == -1) { + sprintf(err_msg, "%s: Error readiong from pipe. errno:%d", + module_name, errno); + LOG_REASON(err_msg, r->uri, r); + return SERVER_ERROR; + } + + else { + /* + * unknown error from weblog - this should not occur + * if afs_Authenticator can't authenticate you, then return FORBIDDEN + */ + sprintf(err_msg, + "%s: AFS could not authenticate user %s in cell %s." + "Returning FORBIDDEN", module_name, user, cell); + LOG_REASON(err_msg, r->uri, r); + return FORBIDDEN; + } #ifndef NO_AFSAPACHE_CACHE - } + } #endif - /* should never get here */ - LOG_REASON("AFS Authentication: WE SHOULD NEVER GET HERE", r->uri, r ); - return SERVER_ERROR; + /* should never get here */ + LOG_REASON("AFS Authentication: WE SHOULD NEVER GET HERE", r->uri, r); + return SERVER_ERROR; } @@ -718,22 +749,26 @@ int authenticateUser(request_rec *r, char *defaultCell, * returns 0 if successful -1 if failure. Assumes memory has been allocated * for cell. Used to set the www-authenticate header. */ -static int get_cellname_from_path(char *apath, char *cell) +static int +get_cellname_from_path(char *apath, char *cell) { - int rc; + int rc; - afsassert(apath); - afsassert(cell); + afsassert(apath); + afsassert(cell); - rc = do_pioctl(NULL, 0, cell, APACHEAFS_CELLNAME_MAX, - VIOC_FILE_CELL_NAME, apath, 1); - if (rc) - afslog(30, ("%s: Error getting cell from path %s. errno:%d rc:%d", + rc = do_pioctl(NULL, 0, cell, APACHEAFS_CELLNAME_MAX, VIOC_FILE_CELL_NAME, + apath, 1); + if (rc) + afslog(30, + ("%s: Error getting cell from path %s. errno:%d rc:%d", module_name, apath, errno, rc)); - else - afslog(30, ("%s: Obtained cell %s from path %s", module_name, cell, apath)); + else + afslog(30, + ("%s: Obtained cell %s from path %s", module_name, cell, + apath)); - return rc; + return rc; } /* @@ -741,65 +776,66 @@ static int get_cellname_from_path(char *apath, char *cell) * call get_cell_by_name. * TODO: These could well be combined into one single function. */ -static int getcellname(request_rec *r, char *buf) +static int +getcellname(request_rec * r, char *buf) { - int rc = 0; - - afsassert(r); - afsassert(buf); - - if (r->filename) { - rc = get_cellname_from_path(r->filename, buf); - } - else { - char path[1024]; - sprintf(path,"%s/%s",DOCUMENT_ROOT(r), r->uri); - rc = get_cellname_from_path(path, buf); - } - return rc; + int rc = 0; + + afsassert(r); + afsassert(buf); + + if (r->filename) { + rc = get_cellname_from_path(r->filename, buf); + } else { + char path[1024]; + sprintf(path, "%s/%s", DOCUMENT_ROOT(r), r->uri); + rc = get_cellname_from_path(path, buf); + } + return rc; } /* * Returns a part of the url upto the second slash in the buf */ -static int geturi(request_rec *r, char *buf) +static int +geturi(request_rec * r, char *buf) { - int rc = 0; - char *pos; - char *end; - int i = 0; - int max = 2; - - afsassert(r); - afsassert(buf); - - memset(buf, 0, APACHEAFS_CELLNAME_MAX); - pos = strchr(r->uri,'/'); - if (pos != NULL) { - pos++; - for (i=0; iuri, '/'); + if (pos != NULL) { + pos++; + for (i = 0; i < max; i++) { + end = strchr(pos, '/'); + if (end != NULL) { + int len = strlen(pos) - strlen(end); + strcat(buf, "/"); + strncat(buf, pos, len); + afslog(35, + ("%s: Getting URI upto second slash buf:%s", + module_name, buf)); + pos += (len + 1); + end = strchr(pos, '/'); + if (end == NULL) { + break; + } + } else { + strcat(buf, pos); + break; + } } - } - else { - strcat(buf,pos); - break; - } - } - } - else { - strcpy(buf," "); - } - return rc; + } else { + strcpy(buf, " "); + } + return rc; } /* @@ -808,139 +844,147 @@ static int geturi(request_rec *r, char *buf) * resides in, failing which the first part of the uri failing which the * string Unknown */ -static int parseAuthName_int(request_rec *r, char *buf, char *msg) +static int +parseAuthName_int(request_rec * r, char *buf, char *msg) { - char *pos; - char *end; - int len = 0; - int rc = 0; - char blank[APACHEAFS_CELLNAME_MAX]; - - afsassert(r); - afsassert(buf); - afsassert(msg); - - memset(blank, 0, sizeof(blank)); - afslog(50, ("%s: Parsing Authorization Required reply. buf:%s", module_name, buf)); - - pos = strchr(buf, '<'); - if (pos) { - len = strlen(pos); - pos++; - end = strchr(pos, '>'); - if (end == NULL) { - afslog(0,("%s:Parse error for AUTH_REQUIRED reply - mismatched <", module_name)); - fprintf(stderr,"Parse Error: mismatched <\n"); - strncpy(msg, buf, strlen(buf)-len); - afslog(0, ("%s: msg:%s", msg)); - return -1; - } - end++; - if (pos[0] == '%') { - pos++; - switch(pos[0]) { - case 'c': - rc = getcellname(r, blank); - if (!rc) { - strncpy(msg, buf, strlen(buf)-len); - strcat(msg, blank); - strcat(msg, end); - return 0; - } - break; - - case 'u': - rc = geturi(r, blank); - if (!rc) { - strncpy(msg, buf, strlen(buf)-len); - strcat(msg, blank); - strcat(msg, end); - return 0; + char *pos; + char *end; + int len = 0; + int rc = 0; + char blank[APACHEAFS_CELLNAME_MAX]; + + afsassert(r); + afsassert(buf); + afsassert(msg); + + memset(blank, 0, sizeof(blank)); + afslog(50, + ("%s: Parsing Authorization Required reply. buf:%s", module_name, + buf)); + + pos = strchr(buf, '<'); + if (pos) { + len = strlen(pos); + pos++; + end = strchr(pos, '>'); + if (end == NULL) { + afslog(0, + ("%s:Parse error for AUTH_REQUIRED reply - mismatched <", + module_name)); + fprintf(stderr, "Parse Error: mismatched <\n"); + strncpy(msg, buf, strlen(buf) - len); + afslog(0, ("%s: msg:%s", msg)); + return -1; } - break; - - case 'd': - if (global_default_cell != NULL) { - strncpy(msg, buf, strlen(buf)-len); - strcat(msg, global_default_cell); - strcat(msg, end); - return 0; + end++; + if (pos[0] == '%') { + pos++; + switch (pos[0]) { + case 'c': + rc = getcellname(r, blank); + if (!rc) { + strncpy(msg, buf, strlen(buf) - len); + strcat(msg, blank); + strcat(msg, end); + return 0; + } + break; + + case 'u': + rc = geturi(r, blank); + if (!rc) { + strncpy(msg, buf, strlen(buf) - len); + strcat(msg, blank); + strcat(msg, end); + return 0; + } + break; + + case 'd': + if (global_default_cell != NULL) { + strncpy(msg, buf, strlen(buf) - len); + strcat(msg, global_default_cell); + strcat(msg, end); + return 0; + } + break; + } + strncpy(msg, buf, strlen(buf) - len); + strcat(msg, "<"); + pos++; + strcat(msg, pos); + strcpy(buf, msg); + memset(msg, 0, 1024); + parseAuthName_int(r, buf, msg); + return 0; + } else { + strncpy(msg, buf, strlen(buf) - len); + strncat(msg, pos, strlen(pos) - strlen(end) - 1); + strcat(msg, end); + return 0; } - break; - } - strncpy(msg, buf, strlen(buf)-len); - strcat(msg,"<"); - pos++; - strcat(msg, pos); - strcpy(buf, msg); - memset(msg, 0, 1024); - parseAuthName_int(r, buf, msg); - return 0; - } - else { - strncpy(msg, buf, strlen(buf)-len); - strncat(msg, pos, strlen(pos)-strlen(end)-1); - strcat(msg, end); - return 0; } - } } /* * Parses the entire auth_name string - ie. takes care of multiple * <%...> <%...> */ -static int parseAuthName(request_rec *r, char *buf) +static int +parseAuthName(request_rec * r, char *buf) { - char *pos; - int rc; - char msg[1024]; + char *pos; + int rc; + char msg[1024]; - afsassert(r); - afsassert(buf); + afsassert(r); + afsassert(buf); - memset(msg, 0, sizeof(msg)); - - pos=strchr(buf,'<'); - while (pos != NULL) { - rc = parseAuthName_int(r, buf, msg); - if (rc) { - strcpy(buf, msg); - afslog(35, ("%s: Failed to parse Auth Name. buf:%s", module_name, buf)); - return -1; - } - strcpy(buf, msg); memset(msg, 0, sizeof(msg)); + pos = strchr(buf, '<'); - } - afslog(50, ("%s: Parsing WWW Auth required reply. final message:%s", - module_name, buf)); - return 0; + while (pos != NULL) { + rc = parseAuthName_int(r, buf, msg); + if (rc) { + strcpy(buf, msg); + afslog(35, + ("%s: Failed to parse Auth Name. buf:%s", module_name, + buf)); + return -1; + } + strcpy(buf, msg); + memset(msg, 0, sizeof(msg)); + pos = strchr(buf, '<'); + } + afslog(50, + ("%s: Parsing WWW Auth required reply. final message:%s", + module_name, buf)); + return 0; } /* * Set the www-authenticate header - this is the login prompt the users see */ -static int setCellAuthHeader(request_rec *r) +static int +setCellAuthHeader(request_rec * r) { - char *name; - char buf[1024]; - int rc = 0; - - afsassert(r); - - name = (char *)get_afs_authprompt(r); - if (name != NULL) { - strcpy(buf, name); - rc = parseAuthName(r, buf); - } - else { - strcpy(buf, " "); - } - TABLE_SET (r->err_headers_out, "WWW-Authenticate", - PSTRCAT(r->pool, "Basic realm=\"", buf, "\"", NULL)); - return rc; + char *name; + char buf[1024]; + int rc = 0; + + afsassert(r); + + name = (char *)get_afs_authprompt(r); + if (name != NULL) { + strcpy(buf, name); + rc = parseAuthName(r, buf); + } else { + strcpy(buf, " "); + } + TABLE_SET(r->err_headers_out, "WWW-Authenticate", + PSTRCAT(r->pool, "Basic realm=\"", buf, "\"", NULL)); + return rc; } @@ -950,13 +994,13 @@ static int setCellAuthHeader(request_rec *r) * www-authenticate header. Should be called if we can't access a file because * permission is denied. */ -int forbToAuthReqd(request_rec *r) +int +forbToAuthReqd(request_rec * r) { - if (haveAuth) { - return FORBIDDEN; - } - else { - setCellAuthHeader(r); - return AUTH_REQUIRED; - } + if (haveAuth) { + return FORBIDDEN; + } else { + setCellAuthHeader(r); + return AUTH_REQUIRED; + } } diff --git a/src/afsweb/apache_afs_module.c b/src/afsweb/apache_afs_module.c index bdd2d4759..ab4e90fb8 100644 --- a/src/afsweb/apache_afs_module.c +++ b/src/afsweb/apache_afs_module.c @@ -39,10 +39,10 @@ * these are used */ #define DEFAULT_WEBLOG_PATH "./weblog_starter" -#define DEFAULT_CACHE_EXPIRATION 300 /* 5 minutes */ -#define DEFAULT_TOKEN_EXPIRATION 600 /* 10 minutes */ +#define DEFAULT_CACHE_EXPIRATION 300 /* 5 minutes */ +#define DEFAULT_TOKEN_EXPIRATION 600 /* 10 minutes */ #define DEFAULT_DEBUG_LEVEL 0 -#define null ((void*)0) +#define null ((void*)0) extern u_long afsDebugLevel; @@ -50,23 +50,21 @@ extern u_long afsDebugLevel; module afs_module; /* Data type for server configuration */ -typedef struct -{ - char *afs_defaultCell; - u_long afs_cacheExpiration; - u_long afs_tokenExpiration; - char *afs_weblogPath; - char *afs_accessLog; - u_long afs_debugLevel; +typedef struct { + char *afs_defaultCell; + u_long afs_cacheExpiration; + u_long afs_tokenExpiration; + char *afs_weblogPath; + char *afs_accessLog; + u_long afs_debugLevel; } afs_server_config_rec; /* Data type for per directory configuration */ -typedef struct -{ - char *afs_authtype; - char *afs_prompt; - char *afs_cell; +typedef struct { + char *afs_authtype; + char *afs_prompt; + char *afs_cell; } afs_dir_config_rec; @@ -77,135 +75,142 @@ static u_long cacheExpiration; int logAccessErrors = 0; int logfd = -1; -static int afsAccessFile_flags = ( O_WRONLY | O_APPEND | O_CREAT ); +static int afsAccessFile_flags = (O_WRONLY | O_APPEND | O_CREAT); #ifdef __EMX__ /* OS/2 dosen't support users and groups */ -static mode_t afsAccessFile_mode = ( S_IREAD | S_IWRITE ); +static mode_t afsAccessFile_mode = (S_IREAD | S_IWRITE); #else -static mode_t afsAccessFile_mode = ( S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ); +static mode_t afsAccessFile_mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); #endif -void afs_init(server_rec *s, pool *p) +void +afs_init(server_rec * s, pool * p) { - if (!initialized) { - char *weblogPath; - afs_server_config_rec *src = get_module_config(s->module_config, &afs_module); - int tokenExpiration = src->afs_tokenExpiration; - - initialized = 1; - if (src->afs_weblogPath) - weblogPath = pstrdup(p, src->afs_weblogPath); - else - weblogPath = pstrdup(p, DEFAULT_WEBLOG_PATH); - - if (src->afs_defaultCell) - strcpy(defaultCell,src->afs_defaultCell); - else { - fprintf(stderr, "AFS Module: SetAFSDEfaultCell " - "is a required directive for module to work. Exiting\n"); - exit(1); - } - tokenExpiration = src->afs_tokenExpiration; - cacheExpiration = src->afs_cacheExpiration; - afsDebugLevel = src->afs_debugLevel; - - if ((src->afs_accessLog == NULL) || (src->afs_accessLog == "")) { - logAccessErrors = 0; - } - else { - char *filename = server_root_relative(p, src->afs_accessLog); - logfd = open(filename,afsAccessFile_flags, afsAccessFile_mode); - if (logfd < 0) { - fprintf(stderr, "afs_module:Error opening afs access log file:%s\n" - "Error:%s,Exiting\n",strerror(errno),filename); - exit(-1); - } - logAccessErrors = 1; - } - - if (cacheExpiration < 0) { - cacheExpiration = DEFAULT_CACHE_EXPIRATION; - } - if (tokenExpiration < 0) { - tokenExpiration = DEFAULT_TOKEN_EXPIRATION; - } - - if (afsDebugLevel < 0) { - afsDebugLevel = DEFAULT_DEBUG_LEVEL; - } - - if (cacheExpiration > tokenExpiration) { - fprintf(stderr, "tokenExpiration:%d is less than cacheExpiration:%d\n", - tokenExpiration, cacheExpiration); - fprintf(stderr, "\n\n"); - fprintf(stderr, "Ensure that this does not happen, since you will " - "not be allowed access to files if the cached token has expired " - "because the token lifetime is less than the cache expiration " - "time. Restart the server after editing the config file\n"); - exit(1); - } - - if (!cacheExpiration && tokenExpiration) { - fprintf(stderr, "cacheExpiration is set to infinity (0), but " - "tokenExpiration:%d is finite\n",tokenExpiration); - fprintf(stderr, "\n\n"); - fprintf(stderr, "Ensure that this does not happen, since you will " - "not be allowed access to files if the cached token has expired " - "because the token lifetime is less than the cache expiration " - "time (infinite). " - "Restart the server after editing the config file\n"); - } + if (!initialized) { + char *weblogPath; + afs_server_config_rec *src = + get_module_config(s->module_config, &afs_module); + int tokenExpiration = src->afs_tokenExpiration; + + initialized = 1; + if (src->afs_weblogPath) + weblogPath = pstrdup(p, src->afs_weblogPath); + else + weblogPath = pstrdup(p, DEFAULT_WEBLOG_PATH); + + if (src->afs_defaultCell) + strcpy(defaultCell, src->afs_defaultCell); + else { + fprintf(stderr, + "AFS Module: SetAFSDEfaultCell " + "is a required directive for module to work. Exiting\n"); + exit(1); + } + tokenExpiration = src->afs_tokenExpiration; + cacheExpiration = src->afs_cacheExpiration; + afsDebugLevel = src->afs_debugLevel; + + if ((src->afs_accessLog == NULL) || (src->afs_accessLog == "")) { + logAccessErrors = 0; + } else { + char *filename = server_root_relative(p, src->afs_accessLog); + logfd = open(filename, afsAccessFile_flags, afsAccessFile_mode); + if (logfd < 0) { + fprintf(stderr, + "afs_module:Error opening afs access log file:%s\n" + "Error:%s,Exiting\n", strerror(errno), filename); + exit(-1); + } + logAccessErrors = 1; + } + + if (cacheExpiration < 0) { + cacheExpiration = DEFAULT_CACHE_EXPIRATION; + } + if (tokenExpiration < 0) { + tokenExpiration = DEFAULT_TOKEN_EXPIRATION; + } + + if (afsDebugLevel < 0) { + afsDebugLevel = DEFAULT_DEBUG_LEVEL; + } + + if (cacheExpiration > tokenExpiration) { + fprintf(stderr, + "tokenExpiration:%d is less than cacheExpiration:%d\n", + tokenExpiration, cacheExpiration); + fprintf(stderr, "\n\n"); + fprintf(stderr, + "Ensure that this does not happen, since you will " + "not be allowed access to files if the cached token has expired " + "because the token lifetime is less than the cache expiration " + "time. Restart the server after editing the config file\n"); + exit(1); + } + + if (!cacheExpiration && tokenExpiration) { + fprintf(stderr, + "cacheExpiration is set to infinity (0), but " + "tokenExpiration:%d is finite\n", tokenExpiration); + fprintf(stderr, "\n\n"); + fprintf(stderr, + "Ensure that this does not happen, since you will " + "not be allowed access to files if the cached token has expired " + "because the token lifetime is less than the cache expiration " + "time (infinite). " + "Restart the server after editing the config file\n"); + } #ifdef SHUTDOWN_IF_AFS_FAILS - afs_plugin_init(tokenExpiration, - server_root_relative(p, weblogPath), - server_root_relative(p, s->error_fname), - server_root_relative(p, pid_fname), - defaultCell, NULL, cacheExpiration, NULL, - 1); + afs_plugin_init(tokenExpiration, server_root_relative(p, weblogPath), + server_root_relative(p, s->error_fname), + server_root_relative(p, pid_fname), defaultCell, NULL, + cacheExpiration, NULL, 1); #else - afs_plugin_init(tokenExpiration, - server_root_relative(p, weblogPath), - server_root_relative(p, s->error_fname), - server_root_relative(p, pid_fname), - defaultCell, NULL, cacheExpiration, NULL, - 0); + afs_plugin_init(tokenExpiration, server_root_relative(p, weblogPath), + server_root_relative(p, s->error_fname), + server_root_relative(p, pid_fname), defaultCell, NULL, + cacheExpiration, NULL, 0); #endif - } + } } -static int check_weblog(char *path) +static int +check_weblog(char *path) { - struct stat fs; - int rc = stat(path, &fs); - if (rc) - return rc; - - if (!((fs.st_mode & S_IXUSR) || (fs.st_mode & S_IXGRP) || (fs.st_mode & S_IXOTH))) - return 2; - return 0; + struct stat fs; + int rc = stat(path, &fs); + if (rc) + return rc; + + if (!((fs.st_mode & S_IXUSR) || (fs.st_mode & S_IXGRP) + || (fs.st_mode & S_IXOTH))) + return 2; + return 0; } /* * per-server configuration creator */ -void *create_afs_server_config (pool *p, server_rec *s) +void * +create_afs_server_config(pool * p, server_rec * s) { - afs_server_config_rec *scr = - (afs_server_config_rec *) pcalloc(p, sizeof(afs_server_config_rec)); - scr->afs_cacheExpiration = 0; - scr->afs_tokenExpiration = 0; - scr->afs_debugLevel = 0; - return (void *)scr; + afs_server_config_rec *scr = + (afs_server_config_rec *) pcalloc(p, sizeof(afs_server_config_rec)); + scr->afs_cacheExpiration = 0; + scr->afs_tokenExpiration = 0; + scr->afs_debugLevel = 0; + return (void *)scr; } /* * per-dir configuration record creator */ -void *create_afs_dir_config (pool *p, char *dummy) +void * +create_afs_dir_config(pool * p, char *dummy) { - afs_dir_config_rec *new = - (afs_dir_config_rec *)pcalloc(p,sizeof(afs_dir_config_rec)); - return (void *)new; + afs_dir_config_rec *new = + (afs_dir_config_rec *) pcalloc(p, sizeof(afs_dir_config_rec)); + return (void *)new; } /* @@ -213,168 +218,186 @@ void *create_afs_dir_config (pool *p, char *dummy) * token and cache expiration time to the server configuration. As well as per-dir * configs like AFSAuthentication. */ -const char *set_afscell(cmd_parms *cmd, void *dummy, char *arg) +const char * +set_afscell(cmd_parms * cmd, void *dummy, char *arg) { - void *sc = cmd->server->module_config; - afs_server_config_rec *sr = get_module_config(sc, &afs_module); - - if ((arg == NULL)||(arg[0] == '\0')) - return "AFS Default cell is a required directive"; + void *sc = cmd->server->module_config; + afs_server_config_rec *sr = get_module_config(sc, &afs_module); + + if ((arg == NULL) || (arg[0] == '\0')) + return "AFS Default cell is a required directive"; sr->afs_defaultCell = arg; return NULL; } -const char *set_afsweblogpath(cmd_parms *cmd, void *dummy, char *arg) +const char * +set_afsweblogpath(cmd_parms * cmd, void *dummy, char *arg) { - void *sc = cmd->server->module_config; - afs_server_config_rec *sr = get_module_config(sc, &afs_module); - int rc = check_weblog(arg); - if (rc) { - switch (rc) { - case 1: - return "Weblog Path should be the full path to the weblog_starter binary"; - case 2: - return "weblog_starter not executable"; + void *sc = cmd->server->module_config; + afs_server_config_rec *sr = get_module_config(sc, &afs_module); + int rc = check_weblog(arg); + if (rc) { + switch (rc) { + case 1: + return + "Weblog Path should be the full path to the weblog_starter binary"; + case 2: + return "weblog_starter not executable"; + } } - } - sr->afs_weblogPath = arg; - return NULL; + sr->afs_weblogPath = arg; + return NULL; } -const char *set_afsacceslog(cmd_parms *cmd, void *dummy, char *arg) +const char * +set_afsacceslog(cmd_parms * cmd, void *dummy, char *arg) { - void *sc = cmd->server->module_config; - afs_server_config_rec *sr = get_module_config(sc,&afs_module); - sr->afs_accessLog = arg; - return NULL; + void *sc = cmd->server->module_config; + afs_server_config_rec *sr = get_module_config(sc, &afs_module); + sr->afs_accessLog = arg; + return NULL; } -static const char *set_afs_CacheExpiration(cmd_parms *cmd, void *dummy, char *expTime) +static const char * +set_afs_CacheExpiration(cmd_parms * cmd, void *dummy, char *expTime) { - afs_server_config_rec *sr = - get_module_config(cmd->server->module_config, &afs_module); - sr->afs_cacheExpiration = atol(expTime); - return NULL; + afs_server_config_rec *sr = + get_module_config(cmd->server->module_config, &afs_module); + sr->afs_cacheExpiration = atol(expTime); + return NULL; } -static const char *set_afs_TokenExpiration(cmd_parms *cmd, void *dummy, char *expTime) +static const char * +set_afs_TokenExpiration(cmd_parms * cmd, void *dummy, char *expTime) { - afs_server_config_rec *sr = - get_module_config(cmd->server->module_config, &afs_module); - sr->afs_tokenExpiration = atol(expTime); - return NULL; + afs_server_config_rec *sr = + get_module_config(cmd->server->module_config, &afs_module); + sr->afs_tokenExpiration = atol(expTime); + return NULL; } -static const char *set_afs_DebugLevel(cmd_parms *cmd, void *dummy, char *debugLevel) +static const char * +set_afs_DebugLevel(cmd_parms * cmd, void *dummy, char *debugLevel) { - afs_server_config_rec *sr = get_module_config(cmd->server->module_config, - &afs_module); - sr->afs_debugLevel = atol(debugLevel); - return NULL; + afs_server_config_rec *sr = get_module_config(cmd->server->module_config, + &afs_module); + sr->afs_debugLevel = atol(debugLevel); + return NULL; } /* Commands this module needs to handle */ command_rec afs_cmds[] = { - { "SetAFSDefaultCell", set_afscell, NULL, - RSRC_CONF, TAKE1,"the AFS cell you want to access by default" }, - - { "SetAFSCacheExpiration", set_afs_CacheExpiration, NULL, RSRC_CONF, TAKE1, - "time for tokens in the client cache to live" }, - - { "SetAFSWeblogPath",set_afsweblogpath, NULL, RSRC_CONF, TAKE1, - "full or relative to ServerRoot path to the weblog_starter binary" }, - - { "SetAFSTokenExpiration", set_afs_TokenExpiration, NULL, RSRC_CONF, TAKE1, - "time for tokens in the kernel cache to live" }, - - { "SetAFSAccessLog", set_afsacceslog, NULL, RSRC_CONF, TAKE1, - "log afs access errors to this file" }, - - { "SetAFSDebugLevel", set_afs_DebugLevel, NULL, RSRC_CONF, TAKE1, - "Set Verbosity level for logging stuff to the error log" }, - - { "AFSLoginPrompt", set_string_slot, - (void *)XtOffsetOf(afs_dir_config_rec, afs_prompt), ACCESS_CONF, TAKE1, - "Prompt to show on Authenticating Window - similar to AuthName"}, - - { "AFSAuthType", set_string_slot, - (void*)XtOffsetOf(afs_dir_config_rec, afs_authtype), ACCESS_CONF, TAKE1, - "Authentication type for AFS" }, - - { "AFSDefaultCell", set_string_slot, - (void*)XtOffsetOf(afs_dir_config_rec, afs_cell), ACCESS_CONF, TAKE1, - "Default AFS cell for this location" }, - - { NULL } + {"SetAFSDefaultCell", set_afscell, NULL, + RSRC_CONF, TAKE1, "the AFS cell you want to access by default"} + , + + {"SetAFSCacheExpiration", set_afs_CacheExpiration, NULL, RSRC_CONF, TAKE1, + "time for tokens in the client cache to live"} + , + + {"SetAFSWeblogPath", set_afsweblogpath, NULL, RSRC_CONF, TAKE1, + "full or relative to ServerRoot path to the weblog_starter binary"} + , + + {"SetAFSTokenExpiration", set_afs_TokenExpiration, NULL, RSRC_CONF, TAKE1, + "time for tokens in the kernel cache to live"} + , + + {"SetAFSAccessLog", set_afsacceslog, NULL, RSRC_CONF, TAKE1, + "log afs access errors to this file"} + , + + {"SetAFSDebugLevel", set_afs_DebugLevel, NULL, RSRC_CONF, TAKE1, + "Set Verbosity level for logging stuff to the error log"} + , + + {"AFSLoginPrompt", set_string_slot, + (void *)XtOffsetOf(afs_dir_config_rec, afs_prompt), ACCESS_CONF, TAKE1, + "Prompt to show on Authenticating Window - similar to AuthName"}, + + {"AFSAuthType", set_string_slot, + (void *)XtOffsetOf(afs_dir_config_rec, afs_authtype), ACCESS_CONF, TAKE1, + "Authentication type for AFS"}, + + {"AFSDefaultCell", set_string_slot, + (void *)XtOffsetOf(afs_dir_config_rec, afs_cell), ACCESS_CONF, TAKE1, + "Default AFS cell for this location"}, + + {NULL} }; -char *get_afsauthtype(request_rec *r) +char * +get_afsauthtype(request_rec * r) { - afs_dir_config_rec *dr = (afs_dir_config_rec *) - get_module_config(r->per_dir_config, &afs_module); - if (!dr->afs_authtype) { - /* Try to unite CGI subprocess configuration info */ - if (r->main) { - dr = (afs_dir_config_rec *) - get_module_config(r->main->per_dir_config, &afs_module); - } - } - return dr->afs_authtype; + afs_dir_config_rec *dr = (afs_dir_config_rec *) + get_module_config(r->per_dir_config, &afs_module); + if (!dr->afs_authtype) { + /* Try to unite CGI subprocess configuration info */ + if (r->main) { + dr = (afs_dir_config_rec *) + get_module_config(r->main->per_dir_config, &afs_module); + } + } + return dr->afs_authtype; } -char *get_afs_authprompt(request_rec *r) +char * +get_afs_authprompt(request_rec * r) { - afs_dir_config_rec *dr = - (afs_dir_config_rec *)get_module_config(r->per_dir_config, &afs_module); - if (!dr->afs_prompt) { - /* Try to unite CGI subprocess configuration info */ - if (r->main) { - dr = (afs_dir_config_rec *) - get_module_config(r->main->per_dir_config, &afs_module); - } - } - return dr->afs_prompt; + afs_dir_config_rec *dr = + (afs_dir_config_rec *) get_module_config(r->per_dir_config, + &afs_module); + if (!dr->afs_prompt) { + /* Try to unite CGI subprocess configuration info */ + if (r->main) { + dr = (afs_dir_config_rec *) + get_module_config(r->main->per_dir_config, &afs_module); + } + } + return dr->afs_prompt; } -static char *get_afs_cell(request_rec *r) +static char * +get_afs_cell(request_rec * r) { - afs_dir_config_rec *dr = - (afs_dir_config_rec *)get_module_config(r->per_dir_config, &afs_module); - if (!dr->afs_cell) { - /* Try to unite CGI subprocess configuration info */ - if (r->main) { - dr = (afs_dir_config_rec *) - get_module_config(r->main->per_dir_config, &afs_module); - } - } - return dr->afs_cell; + afs_dir_config_rec *dr = + (afs_dir_config_rec *) get_module_config(r->per_dir_config, + &afs_module); + if (!dr->afs_cell) { + /* Try to unite CGI subprocess configuration info */ + if (r->main) { + dr = (afs_dir_config_rec *) + get_module_config(r->main->per_dir_config, &afs_module); + } + } + return dr->afs_cell; } -int afs_auth(request_rec *r) +int +afs_auth(request_rec * r) { - char *cell = get_afs_cell(r); - return afs_auth_internal(r, cell ? cell : defaultCell, cacheExpiration); + char *cell = get_afs_cell(r); + return afs_auth_internal(r, cell ? cell : defaultCell, cacheExpiration); } -module afs_module = -{ - STANDARD_MODULE_STUFF, - afs_init, - create_afs_dir_config, - NULL, - create_afs_server_config, - NULL, - afs_cmds, - NULL, - afs_auth, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, +module afs_module = { + STANDARD_MODULE_STUFF, + afs_init, + create_afs_dir_config, + NULL, + create_afs_server_config, + NULL, + afs_cmds, + NULL, + afs_auth, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, }; diff --git a/src/afsweb/apache_afs_plugin.c b/src/afsweb/apache_afs_plugin.c index 08d2066b4..094112b07 100644 --- a/src/afsweb/apache_afs_plugin.c +++ b/src/afsweb/apache_afs_plugin.c @@ -36,8 +36,8 @@ u_long afsDebugLevel; const char module_name[] = "AFS Authentication Module"; typedef struct { - char defaultCell[64]; - u_long cacheExpiration; + char defaultCell[64]; + u_long cacheExpiration; } apache_afs_glob; static apache_afs_glob *afs_str; @@ -54,21 +54,22 @@ int tempfd; * as a means of synchronization for providing exclusive access to the pipe * for communicating with the weblog process */ -static int create_temp_file() +static int +create_temp_file() { - char tmpFileName[L_tmpnam]; - int lockfd=0; + char tmpFileName[L_tmpnam]; + int lockfd = 0; - tmpnam(tmpFileName); - unlink(tmpFileName); + tmpnam(tmpFileName); + unlink(tmpFileName); - lockfd = open(tmpFileName, O_RDWR | O_CREAT); - if (lockfd < 0) { - perror("afs_plugin:Error creating temp file:"); + lockfd = open(tmpFileName, O_RDWR | O_CREAT); + if (lockfd < 0) { + perror("afs_plugin:Error creating temp file:"); + return lockfd; + } + unlink(tmpFileName); return lockfd; - } - unlink(tmpFileName); - return lockfd; } #endif @@ -76,185 +77,193 @@ static int create_temp_file() * Initialization: start up the weblog process. Open the pipes and pass their * file descriptors to the weblog process */ -void afs_plugin_init(int tokenExpiration, char *weblogPath,char *error_fname, char *pf, - char *cell,char *dir,int exp,char *loc,int shutdown) +void +afs_plugin_init(int tokenExpiration, char *weblogPath, char *error_fname, + char *pf, char *cell, char *dir, int exp, char *loc, + int shutdown) { - int childpid; - int pipe1[2], pipe2[2]; - char weblogarg1[32]; - char weblogarg2[32]; - char weblogarg3[32]; - char weblogarg4[32]; - - FILE *fp; /* for pid_fname */ - char *afs_weblog_pidfile; - char *httpd_pid_fname=(char *) malloc(strlen(pf)+1); - if (httpd_pid_fname == NULL) { - fprintf(stderr, "%s: malloc failed - out of memory while allocating space for httpd_pid_fname\n", module_name); - exit(-1); - } - strcpy(httpd_pid_fname, pf); - afs_weblog_pidfile=(char *) malloc(strlen(httpd_pid_fname)+5); - if (httpd_pid_fname == NULL) { - fprintf(stderr, "%s: malloc failed - out of memory while allocating space for afs_weblog_pidfile\n", module_name); - exit(-1); - } - sprintf(afs_weblog_pidfile,"%s.afs", httpd_pid_fname); - - if(do_setpag()){ - fprintf(stderr, "%s:Failed to set pag Error:%d\n", - module_name,errno); - exit(-1); - } - - afs_str = (apache_afs_glob *) malloc(sizeof(apache_afs_glob)); - if (afs_str == NULL) { - fprintf(stderr, "%s:malloc failed for afs_str\n",module_name); - exit(-1); - } - - if (cell) - strcpy(afs_str->defaultCell, cell); - else { - fprintf(stderr, "%s: NULL argument in cell\n",module_name); - exit(-1); - } - afs_str->cacheExpiration = exp; - - afslog(5, ("Default Cell:%s\nCache Expiration:%d\nDebugLevel:%d", - afs_str->defaultCell, afs_str->cacheExpiration,afsDebugLevel)); + int childpid; + int pipe1[2], pipe2[2]; + char weblogarg1[32]; + char weblogarg2[32]; + char weblogarg3[32]; + char weblogarg4[32]; + + FILE *fp; /* for pid_fname */ + char *afs_weblog_pidfile; + char *httpd_pid_fname = (char *)malloc(strlen(pf) + 1); + if (httpd_pid_fname == NULL) { + fprintf(stderr, + "%s: malloc failed - out of memory while allocating space for httpd_pid_fname\n", + module_name); + exit(-1); + } + strcpy(httpd_pid_fname, pf); + afs_weblog_pidfile = (char *)malloc(strlen(httpd_pid_fname) + 5); + if (httpd_pid_fname == NULL) { + fprintf(stderr, + "%s: malloc failed - out of memory while allocating space for afs_weblog_pidfile\n", + module_name); + exit(-1); + } + sprintf(afs_weblog_pidfile, "%s.afs", httpd_pid_fname); + + if (do_setpag()) { + fprintf(stderr, "%s:Failed to set pag Error:%d\n", module_name, + errno); + exit(-1); + } + + afs_str = (apache_afs_glob *) malloc(sizeof(apache_afs_glob)); + if (afs_str == NULL) { + fprintf(stderr, "%s:malloc failed for afs_str\n", module_name); + exit(-1); + } + + if (cell) + strcpy(afs_str->defaultCell, cell); + else { + fprintf(stderr, "%s: NULL argument in cell\n", module_name); + exit(-1); + } + afs_str->cacheExpiration = exp; + + afslog(5, + ("Default Cell:%s\nCache Expiration:%d\nDebugLevel:%d", + afs_str->defaultCell, afs_str->cacheExpiration, afsDebugLevel)); #ifdef AIX - /* Get a temp file fd for locking */ - tempfd=create_temp_file(); - if (tempfd < 0) { - fprintf(stderr, "%s: Error creating temp file", module_name); - exit(-1); - } + /* Get a temp file fd for locking */ + tempfd = create_temp_file(); + if (tempfd < 0) { + fprintf(stderr, "%s: Error creating temp file", module_name); + exit(-1); + } #endif - if (pipe(pipe1) < 0 || pipe(pipe2) < 0) { - fprintf(stderr, "%s: Error creating pipes - %s",module_name, strerror(errno)); - exit(-1); - } - if ((childpid = fork()) < 0) { - fprintf(stderr,"%s: Error forking - %s",module_name, strerror(errno)); - exit(-1); - } - else if (childpid > 0) { /* parent */ - close(pipe1[0]); - close(pipe2[1]); - readPipe = pipe2[0]; - writePipe = pipe1[1]; - } - else { /* child */ - close(pipe1[1]); - close(pipe2[0]); - fp=fopen(afs_weblog_pidfile, "w"); - if (fp == NULL) { - perror("fopen"); - fprintf(stderr, "%s: Error opening pidfile:%s - %s\n", - module_name, afs_weblog_pidfile, strerror(errno)); - close(pipe1[0]); - close(pipe2[1]); - exit(-1); + if (pipe(pipe1) < 0 || pipe(pipe2) < 0) { + fprintf(stderr, "%s: Error creating pipes - %s", module_name, + strerror(errno)); + exit(-1); } - fprintf(fp,"%ld\n", (long)getpid()); - fclose(fp); - free(afs_weblog_pidfile); - sprintf(weblogarg1, "%d", pipe1[0]); - sprintf(weblogarg2, "%d", pipe2[1]); - sprintf(weblogarg3, "%d", afs_str->cacheExpiration); - sprintf(weblogarg4, "%d", tokenExpiration); - sleep(5); - execlp(weblogPath,"weblog_starter", weblogPath, error_fname, - weblogarg1,weblogarg2,weblogarg3,weblogarg4, - (char *)0); - fprintf(stderr, "%s: Error executing %s - %s\n", - module_name, weblogPath, strerror(errno)); - perror("execlp"); - close(pipe1[0]); - close(pipe2[1]); - fclose(fp); - - /* exit by sending a SIGTERM to the httpd process (how to get the pid?) - * since at this point the pid file is outdated and only if we sleep for - * a while to allow httpd_main to put it's pid in the pidfile can we - * attempt to send it a SIGTERM for graceful shuttdown) - * so that everything is brought down - if you want to bring everything - * down!! Else continue with httpd without AFS authentication. - */ + if ((childpid = fork()) < 0) { + fprintf(stderr, "%s: Error forking - %s", module_name, + strerror(errno)); + exit(-1); + } else if (childpid > 0) { /* parent */ + close(pipe1[0]); + close(pipe2[1]); + readPipe = pipe2[0]; + writePipe = pipe1[1]; + } else { /* child */ + close(pipe1[1]); + close(pipe2[0]); + fp = fopen(afs_weblog_pidfile, "w"); + if (fp == NULL) { + perror("fopen"); + fprintf(stderr, "%s: Error opening pidfile:%s - %s\n", + module_name, afs_weblog_pidfile, strerror(errno)); + close(pipe1[0]); + close(pipe2[1]); + exit(-1); + } + fprintf(fp, "%ld\n", (long)getpid()); + fclose(fp); + free(afs_weblog_pidfile); + sprintf(weblogarg1, "%d", pipe1[0]); + sprintf(weblogarg2, "%d", pipe2[1]); + sprintf(weblogarg3, "%d", afs_str->cacheExpiration); + sprintf(weblogarg4, "%d", tokenExpiration); + sleep(5); + execlp(weblogPath, "weblog_starter", weblogPath, error_fname, + weblogarg1, weblogarg2, weblogarg3, weblogarg4, NULL); + fprintf(stderr, "%s: Error executing %s - %s\n", module_name, + weblogPath, strerror(errno)); + perror("execlp"); + close(pipe1[0]); + close(pipe2[1]); + fclose(fp); + + /* exit by sending a SIGTERM to the httpd process (how to get the pid?) + * since at this point the pid file is outdated and only if we sleep for + * a while to allow httpd_main to put it's pid in the pidfile can we + * attempt to send it a SIGTERM for graceful shuttdown) + * so that everything is brought down - if you want to bring everything + * down!! Else continue with httpd without AFS authentication. + */ /*#ifdef SHUTDOWN_IF_AFS_FAILS in afs_module.c */ - if (shutdown) { + if (shutdown) { #define KILL_TIME_WAIT 1 #define MAX_KILL_ATTEMPTS 3 - int attempts=0; - fp=fopen(httpd_pid_fname,"r"); - fscanf(fp,"%d", &childpid); - fclose(fp); - killagain: - sleep(KILL_TIME_WAIT); - if (kill(childpid,SIGTERM) == -1) { - if ((errno == ESRCH) && (attempts < MAX_KILL_ATTEMPTS)) { - attempts++; - fprintf(stderr, "%s:SIGTERM to process:%d FAILED attempt:%d\nRetrying " - " for %d more attempts every %d seconds\n", - module_name,childpid,attempts, - (MAX_KILL_ATTEMPTS-attempts), KILL_TIME_WAIT); - goto killagain; + int attempts = 0; + fp = fopen(httpd_pid_fname, "r"); + fscanf(fp, "%d", &childpid); + fclose(fp); + killagain: + sleep(KILL_TIME_WAIT); + if (kill(childpid, SIGTERM) == -1) { + if ((errno == ESRCH) && (attempts < MAX_KILL_ATTEMPTS)) { + attempts++; + fprintf(stderr, + "%s:SIGTERM to process:%d FAILED attempt:%d\nRetrying " + " for %d more attempts every %d seconds\n", + module_name, childpid, attempts, + (MAX_KILL_ATTEMPTS - attempts), KILL_TIME_WAIT); + goto killagain; + } + } else { + fprintf(stderr, "%s:Shutdown complete ...\n", module_name); + } + if (attempts >= MAX_KILL_ATTEMPTS) { + fprintf(stderr, + "%s:httpd is still running-AFS authentication will fail " + "because weblog startup failed\n", module_name); + } + exit(0); + } else { + fprintf(stderr, + "%s:httpd running - AFS Authentication will not work! " + "Weblog startup failure", module_name); + exit(-1); } - } - else { - fprintf(stderr, "%s:Shutdown complete ...\n", module_name); - } - if (attempts >= MAX_KILL_ATTEMPTS) { - fprintf(stderr, - "%s:httpd is still running-AFS authentication will fail " - "because weblog startup failed\n",module_name); - } - exit(0); } - else { - fprintf(stderr, "%s:httpd running - AFS Authentication will not work! " - "Weblog startup failure", module_name); - exit(-1); - } - } } /* * Returns HTTP error codes based on the result of a stat error */ -static int sort_stat_error(request_rec *r) +static int +sort_stat_error(request_rec * r) { - int status = 0; - switch(errno) { - case ENOENT: - status = HTTP_NOT_FOUND; - break; - - case EACCES: - status = FORBIDDEN; - break; - - case ENOLINK: - status = HTTP_NOT_FOUND; - break; - - case ENODEV: - status = HTTP_NOT_FOUND; - break; - - default: - { - char error[ERRSTRLEN]; - sprintf(error,"%s: stat error: %s",module_name, strerror(errno)); - status = SERVER_ERROR; - LOG_REASON(error,r->uri, r); - break; + int status = 0; + switch (errno) { + case ENOENT: + status = HTTP_NOT_FOUND; + break; + + case EACCES: + status = FORBIDDEN; + break; + + case ENOLINK: + status = HTTP_NOT_FOUND; + break; + + case ENODEV: + status = HTTP_NOT_FOUND; + break; + + default: + { + char error[ERRSTRLEN]; + sprintf(error, "%s: stat error: %s", module_name, + strerror(errno)); + status = SERVER_ERROR; + LOG_REASON(error, r->uri, r); + break; + } } - } - return status; + return status; } /* @@ -268,197 +277,205 @@ static int sort_stat_error(request_rec *r) - sets the filename field - sets the path_info field */ -static int remove_path_info(request_rec *r, char *path, struct stat *buf) +static int +remove_path_info(request_rec * r, char *path, struct stat *buf) { - char *cp; - char *end; - char *last_cp = NULL; - int rc = 0; - - afsassert(r); - afsassert(path); - afsassert(buf); - - end = &path[strlen(path)]; - - /* Advance over trailing slashes ... NOT part of filename */ - for (cp = end; cp > path && cp[-1] == '/'; --cp) - continue; - - while (cp > path) { - /* See if the pathname ending here exists... */ - *cp = '\0'; - errno = 0; - rc = stat(path, buf); - if (cp != end) - *cp = '/'; - - if (!rc) { - if (S_ISDIR(buf->st_mode) && last_cp) { - buf->st_mode = 0; /* No such file... */ - cp = last_cp; - } - r->path_info = pstrdup(r->pool, cp); - *cp = '\0'; - return OK; - } - - else if (errno == ENOENT || errno == ENOTDIR) { - last_cp = cp; - while (--cp > path && *cp != '/') - continue; - while (cp > path && cp[-1] == '/') - --cp; - } - else if (errno != EACCES) { - /* - * this would be really bad since we checked the entire path - * earlier and got ENOTDIR instead of EACCES - so why are we getting - * it now? Anyway, we ought to return FORBIDDEN - */ - return HTTP_FORBIDDEN; + char *cp; + char *end; + char *last_cp = NULL; + int rc = 0; + + afsassert(r); + afsassert(path); + afsassert(buf); + + end = &path[strlen(path)]; + + /* Advance over trailing slashes ... NOT part of filename */ + for (cp = end; cp > path && cp[-1] == '/'; --cp) + continue; + + while (cp > path) { + /* See if the pathname ending here exists... */ + *cp = '\0'; + errno = 0; + rc = stat(path, buf); + if (cp != end) + *cp = '/'; + + if (!rc) { + if (S_ISDIR(buf->st_mode) && last_cp) { + buf->st_mode = 0; /* No such file... */ + cp = last_cp; + } + r->path_info = pstrdup(r->pool, cp); + *cp = '\0'; + return OK; + } + + else if (errno == ENOENT || errno == ENOTDIR) { + last_cp = cp; + while (--cp > path && *cp != '/') + continue; + while (cp > path && cp[-1] == '/') + --cp; + } else if (errno != EACCES) { + /* + * this would be really bad since we checked the entire path + * earlier and got ENOTDIR instead of EACCES - so why are we getting + * it now? Anyway, we ought to return FORBIDDEN + */ + return HTTP_FORBIDDEN; + } } - } - r->filename = pstrdup(r->pool, path); - return OK; + r->filename = pstrdup(r->pool, path); + return OK; } - + /* * Checks to see if actual access to the URL is permitted or not * stats the URI first, if failure returns FORBIDDEN, if allowed then * checks to see if it is a file, dir or LINK (TEST), and accordingly does more */ -static int can_access(request_rec *r) +static int +can_access(request_rec * r) { - int rc; - char *doc_root = (char *)DOCUMENT_ROOT(r); - struct stat buf; - char path[MAX_STRING_LEN]; - - afsassert(r->uri); - afsassert(doc_root); - - if (r->filename) { - afslog(10, ("%s: Found r->filename:%s", module_name, r->filename)); - sprintf(path,"%s",r->filename); - } - else { - afslog(10, ("%s: Composing path from doc_root:%s and r->uri:%s", + int rc; + char *doc_root = (char *)DOCUMENT_ROOT(r); + struct stat buf; + char path[MAX_STRING_LEN]; + + afsassert(r->uri); + afsassert(doc_root); + + if (r->filename) { + afslog(10, ("%s: Found r->filename:%s", module_name, r->filename)); + sprintf(path, "%s", r->filename); + } else { + afslog(10, + ("%s: Composing path from doc_root:%s and r->uri:%s", module_name, doc_root, r->uri)); - sprintf(path,"%s/%s",doc_root,r->uri); - afslog(10, ("%s: Path:%s", module_name, path)); - } - rc = stat(path, &buf); - if (rc == -1) { - afslog(2, ("%s: pid:%d\tpath:%s\tstat error:%s", - module_name, getpid(), path, strerror(errno))); - - /* - * if the requested method is an HTTP PUT and the file does not - * exist then well, we'll get a stat error but we shouldn't return - * an error - we should try and open the file in append mode and then - * see if we get a permission denied error - */ - if ((strncmp(r->method,"PUT",3) == 0) && (errno == ENOENT)) { - FILE *f=fopen(path,"a"); - if (f == NULL) { - if (errno == EACCES) { - afslog(2, ("%s: Either AFS acls or other permissions forbid write" - " access to file %s for user %s", module_name, path, - r->connection->user ? r->connection->user : "UNKNOWN")); - return FORBIDDEN; - } - else { - log_reason("afs_module: Error checking file for PUT method",r->uri,r); - return SERVER_ERROR; - } - } + sprintf(path, "%s/%s", doc_root, r->uri); + afslog(10, ("%s: Path:%s", module_name, path)); } - else if (errno == ENOTDIR) { - /* - * maybe the special case of CGI PATH_INFO to be translated to - * PATH_TRANSLATED - check each component of this path - * and stat it to see what portion of the url is actually - * the path and discard the rest for our purposes. - */ - rc = remove_path_info(r, path, &buf); - afslog(10,("%s:remove_path_info returned %d path:%s", - module_name, rc, path)); - if (rc) - return rc; - } - else { - return sort_stat_error(r); - } - } - /* - * If we get here then we have something - either a file or a directory - */ - else { - if (S_IFREG == (buf.st_mode & S_IFMT)) { - /* regular file */ - FILE *f; - char permissions[] = { 'r', '\0', '\0', '\0' }; /* room for +, etc... */ - - if ((strncmp(r->method, "PUT",3) == 0)) { - strcpy(permissions,"a"); - } - if(!(f = fopen(path,permissions))) { - if (errno == EACCES) { - afslog(2, ("%s: Either AFS acls or other permissions" - " forbid access to file %s for user %s", module_name, path, - r->connection->user ? r->connection->user : "UNKNOWN")); - return FORBIDDEN; - } - else { - char error[ERRSTRLEN]; - sprintf(error,"%s: Error checking file %s for permissions:%s", - module_name, path, strerror(errno)); - log_reason(error, r->uri, r); - return SERVER_ERROR; + rc = stat(path, &buf); + if (rc == -1) { + afslog(2, + ("%s: pid:%d\tpath:%s\tstat error:%s", module_name, getpid(), + path, strerror(errno))); + + /* + * if the requested method is an HTTP PUT and the file does not + * exist then well, we'll get a stat error but we shouldn't return + * an error - we should try and open the file in append mode and then + * see if we get a permission denied error + */ + if ((strncmp(r->method, "PUT", 3) == 0) && (errno == ENOENT)) { + FILE *f = fopen(path, "a"); + if (f == NULL) { + if (errno == EACCES) { + afslog(2, + ("%s: Either AFS acls or other permissions forbid write" + " access to file %s for user %s", module_name, + path, + r->connection->user ? r->connection-> + user : "UNKNOWN")); + return FORBIDDEN; + } else { + log_reason + ("afs_module: Error checking file for PUT method", + r->uri, r); + return SERVER_ERROR; + } + } + } else if (errno == ENOTDIR) { + /* + * maybe the special case of CGI PATH_INFO to be translated to + * PATH_TRANSLATED - check each component of this path + * and stat it to see what portion of the url is actually + * the path and discard the rest for our purposes. + */ + rc = remove_path_info(r, path, &buf); + afslog(10, + ("%s:remove_path_info returned %d path:%s", module_name, + rc, path)); + if (rc) + return rc; + } else { + return sort_stat_error(r); } - } - fclose(f); - return OK; } - if (S_IFDIR == (buf.st_mode&S_IFMT)) { - /* path is a directory */ - - if (r->uri[strlen(r->uri)-1] != '/'){ - /* if we don't have a trailing slash, return REDIRECT */ - char *ifile; - if (r->args != NULL) { - ifile = PSTRCAT (r->pool, escape_uri(r->pool, r->uri), - "/", "?", r->args, NULL); - } - else { - ifile = PSTRCAT (r->pool, escape_uri(r->pool, r->uri), - "/", NULL); + /* + * If we get here then we have something - either a file or a directory + */ + else { + if (S_IFREG == (buf.st_mode & S_IFMT)) { + /* regular file */ + FILE *f; + char permissions[] = { 'r', '\0', '\0', '\0' }; /* room for +, etc... */ + + if ((strncmp(r->method, "PUT", 3) == 0)) { + strcpy(permissions, "a"); + } + if (!(f = fopen(path, permissions))) { + if (errno == EACCES) { + afslog(2, + ("%s: Either AFS acls or other permissions" + " forbid access to file %s for user %s", + module_name, path, + r->connection->user ? r->connection-> + user : "UNKNOWN")); + return FORBIDDEN; + } else { + char error[ERRSTRLEN]; + sprintf(error, + "%s: Error checking file %s for permissions:%s", + module_name, path, strerror(errno)); + log_reason(error, r->uri, r); + return SERVER_ERROR; + } + } + fclose(f); + return OK; } - TABLE_SET (r->headers_out, "Location",ifile); - return REDIRECT; - } - else { - DIR *d; - if(!(d = opendir(path))) { - if (errno == EACCES) { - afslog(2, ("%s: Error accessing dir %s - %s", - module_name, path, strerror(errno))); - return FORBIDDEN; - } - else { - char error[ERRSTRLEN]; - sprintf(error,"%s: opendir failed with Error:%s", - module_name, strerror(errno)); - log_reason(error,r,r->uri); - return SERVER_ERROR; - } + if (S_IFDIR == (buf.st_mode & S_IFMT)) { + /* path is a directory */ + + if (r->uri[strlen(r->uri) - 1] != '/') { + /* if we don't have a trailing slash, return REDIRECT */ + char *ifile; + if (r->args != NULL) { + ifile = + PSTRCAT(r->pool, escape_uri(r->pool, r->uri), "/", + "?", r->args, NULL); + } else { + ifile = + PSTRCAT(r->pool, escape_uri(r->pool, r->uri), "/", + NULL); + } + TABLE_SET(r->headers_out, "Location", ifile); + return REDIRECT; + } else { + DIR *d; + if (!(d = opendir(path))) { + if (errno == EACCES) { + afslog(2, + ("%s: Error accessing dir %s - %s", + module_name, path, strerror(errno))); + return FORBIDDEN; + } else { + char error[ERRSTRLEN]; + sprintf(error, "%s: opendir failed with Error:%s", + module_name, strerror(errno)); + log_reason(error, r, r->uri); + return SERVER_ERROR; + } + } + closedir(d); + return OK; + } } - closedir(d); - return OK; - } } - } } @@ -466,117 +483,129 @@ static int can_access(request_rec *r) * Logs requests which led to a FORBIDDEN return code provided a token * existed. Added feature (SetAFSAccessLog) in beta2 */ -static int log_Access_Error(request_rec *r) +static int +log_Access_Error(request_rec * r) { - if(FIND_LINKED_MODULE("afs_module.c") != NULL) { - char err_msg[1024]; - int rc = 0; - int len = 0; - extern int logfd; - - if (r->connection->user) - sprintf(err_msg, "[%s] AFS ACL's deny permission to " - "user: %s for URI:%s\n",GET_TIME(), r->connection->user, r->uri); - else - sprintf(err_msg,"[%s] AFS ACL's deny permission to user - for URI:%s\n", - GET_TIME(), r->uri); - - len=strlen(err_msg); - rc=write(logfd, err_msg, len); - - if(rc != len){ - afslog(0, ("%s: Error logging message:%s - %s", - module_name, err_msg, strerror(errno))); - return -1; + if (FIND_LINKED_MODULE("afs_module.c") != NULL) { + char err_msg[1024]; + int rc = 0; + int len = 0; + extern int logfd; + + if (r->connection->user) + sprintf(err_msg, + "[%s] AFS ACL's deny permission to " + "user: %s for URI:%s\n", GET_TIME(), r->connection->user, + r->uri); + else + sprintf(err_msg, + "[%s] AFS ACL's deny permission to user - for URI:%s\n", + GET_TIME(), r->uri); + + len = strlen(err_msg); + rc = write(logfd, err_msg, len); + + if (rc != len) { + afslog(0, + ("%s: Error logging message:%s - %s", module_name, err_msg, + strerror(errno))); + return -1; + } + return rc; } - return rc; - } } /* * The interface - hook to obtain an AFS token if needed based on the * result of a stat (returned by can_access) or an open file */ -int afs_auth_internal(request_rec *r, char *cell) +int +afs_auth_internal(request_rec * r, char *cell) { - afsassert(r); - afsassert(r->uri); - afsassert(cell); - if(FIND_LINKED_MODULE("afs_module.c") != NULL) { - int rc, status; - char *type; - static int haveToken = 1; /* assume that we always have a token */ - extern int logAccessErrors; - - /* - * Get afs_authtype directive value for that directory or location - */ - type = (char *) get_afsauthtype(r); - - /* - * UserDir (tilde) support - */ + afsassert(r); + afsassert(r->uri); + afsassert(cell); + if (FIND_LINKED_MODULE("afs_module.c") != NULL) { + int rc, status; + char *type; + static int haveToken = 1; /* assume that we always have a token */ + extern int logAccessErrors; + + /* + * Get afs_authtype directive value for that directory or location + */ + type = (char *)get_afsauthtype(r); + + /* + * UserDir (tilde) support + */ #ifndef APACHE_1_3 - if (FIND_LINKED_MODULE("mod_userdir.c") != NULL) { - rc=translate_userdir(r); - if ((rc != OK) && (rc != DECLINED)) { - LOG_REASON("afs_module: Failure while translating userdir", r->uri,r); - return rc; - } - } + if (FIND_LINKED_MODULE("mod_userdir.c") != NULL) { + rc = translate_userdir(r); + if ((rc != OK) && (rc != DECLINED)) { + LOG_REASON("afs_module: Failure while translating userdir", + r->uri, r); + return rc; + } + } #endif - afslog(20, ("%s: pid:%d r->uri:%s", module_name, getpid(), r->uri)); - if (type) - afslog(20, ("%s: AFSAuthType: %s", module_name, type)); - else - afslog(20, ("%s: AFSAuthType NULL", module_name)); - - /* if AuthType is not AFS, then unlog any existing tokens and DECLINE */ - if (type == NULL) { - if (haveToken) - unlog(); - return DECLINED; - } + afslog(20, ("%s: pid:%d r->uri:%s", module_name, getpid(), r->uri)); + if (type) + afslog(20, ("%s: AFSAuthType: %s", module_name, type)); + else + afslog(20, ("%s: AFSAuthType NULL", module_name)); + + /* if AuthType is not AFS, then unlog any existing tokens and DECLINE */ + if (type == NULL) { + if (haveToken) + unlog(); + return DECLINED; + } - if((strcasecmp(type, AFS_AUTHTYPE)) && (strcasecmp(type,AFS_DFS_AUTHTYPE))) { - if (haveToken) - unlog(); - afslog(10, ("%s: Error unknown AFSAuthType:%s returning DECLINED", - module_name, type)); - return DECLINED; - } - - if (cell) - status=authenticateUser(r, cell, afs_str->cacheExpiration, type); - else - status=authenticateUser(r, afs_str->defaultCell, afs_str->cacheExpiration, type); - - if (status != OK ) { - afslog(10, ("%s: Returning status %d", module_name, status)); - return status; - } - - /* can we access this URL? */ - rc = can_access(r); - - if (rc == OK) { - return DECLINED; - } - - if (rc == REDIRECT) { - return REDIRECT; - } - - if (rc == FORBIDDEN) { - rc = forbToAuthReqd(r); - if (rc == FORBIDDEN) { - if (logAccessErrors) { - log_Access_Error(r); + if ((strcasecmp(type, AFS_AUTHTYPE)) + && (strcasecmp(type, AFS_DFS_AUTHTYPE))) { + if (haveToken) + unlog(); + afslog(10, + ("%s: Error unknown AFSAuthType:%s returning DECLINED", + module_name, type)); + return DECLINED; + } + + if (cell) + status = + authenticateUser(r, cell, afs_str->cacheExpiration, type); + else + status = + authenticateUser(r, afs_str->defaultCell, + afs_str->cacheExpiration, type); + + if (status != OK) { + afslog(10, ("%s: Returning status %d", module_name, status)); + return status; + } + + /* can we access this URL? */ + rc = can_access(r); + + if (rc == OK) { + return DECLINED; + } + + if (rc == REDIRECT) { + return REDIRECT; + } + + if (rc == FORBIDDEN) { + rc = forbToAuthReqd(r); + if (rc == FORBIDDEN) { + if (logAccessErrors) { + log_Access_Error(r); + } + } + return rc; } - } - return rc; + return DECLINED; } - return DECLINED; - } } diff --git a/src/afsweb/apache_afs_utils.c b/src/afsweb/apache_afs_utils.c index aa12df4fc..8ae4501e3 100644 --- a/src/afsweb/apache_afs_utils.c +++ b/src/afsweb/apache_afs_utils.c @@ -23,44 +23,48 @@ * sets up the ViceIoctl buffer with all the parameters required * NOTE: in_buffer and out_buffer may point to the same memory buffer */ -int do_pioctl(char *in_buffer, int in_size, - char *out_buffer, int out_size, - int opcode, char *path, int followSymLinks) +int +do_pioctl(char *in_buffer, int in_size, char *out_buffer, int out_size, + int opcode, char *path, int followSymLinks) { - struct ViceIoctl iob; - iob.in = in_buffer; - iob.in_size = in_size; - iob.out = out_buffer; - iob.out_size = out_size; - + struct ViceIoctl iob; + iob.in = in_buffer; + iob.in_size = in_size; + iob.out = out_buffer; + iob.out_size = out_size; + #ifdef AFS_USR_SUN5_ENV - return syscall(AFS_SYSCALL, AFSCALL_PIOCTL, path, _VICEIOCTL(opcode), &iob, - followSymLinks); + return syscall(AFS_SYSCALL, AFSCALL_PIOCTL, path, _VICEIOCTL(opcode), + &iob, followSymLinks); #else /* AFS_USR_SUN5_ENV */ - return lpioctl(path, _VICEIOCTL(opcode), &iob, followSymLinks); + return lpioctl(path, _VICEIOCTL(opcode), &iob, followSymLinks); #endif /* AFS_USR_SUN5_ENV */ } -int do_setpag() +int +do_setpag() { - return lsetpag(); + return lsetpag(); } /* * Return 1 if we have a token, 0 if we don't */ -int haveToken() +int +haveToken() { - char temp[1024]; - afs_int32 i = 0; - int code; + char temp[1024]; + afs_int32 i = 0; + int code; - memcpy((void *)temp, (void *)&i, sizeof(afs_int32)); - code = do_pioctl(temp, sizeof(afs_int32), temp, sizeof(temp),VIOCGETTOK, NULL,0); - if (code) - return 0; - else - return 1; + memcpy((void *)temp, (void *)&i, sizeof(afs_int32)); + code = + do_pioctl(temp, sizeof(afs_int32), temp, sizeof(temp), VIOCGETTOK, + NULL, 0); + if (code) + return 0; + else + return 1; } @@ -70,66 +74,69 @@ int haveToken() */ flipPrimary(char *tokenBuf) { - afs_int32 i; - char * temp = tokenBuf; - - /* skip over the secret token */ - memcpy(&i, temp, sizeof(afs_int32)); - temp += (i + sizeof(afs_int32)); - - /* skip over the clear token */ - memcpy(&i, temp, sizeof(afs_int32)); - temp += (i + sizeof(afs_int32)); - - /* set the primary flag */ - memcpy(&i, temp, sizeof(afs_int32)); - i |= 0x8000; - memcpy(temp, &i, sizeof(afs_int32)); - temp += sizeof(afs_int32); - return 0; + afs_int32 i; + char *temp = tokenBuf; + + /* skip over the secret token */ + memcpy(&i, temp, sizeof(afs_int32)); + temp += (i + sizeof(afs_int32)); + + /* skip over the clear token */ + memcpy(&i, temp, sizeof(afs_int32)); + temp += (i + sizeof(afs_int32)); + + /* set the primary flag */ + memcpy(&i, temp, sizeof(afs_int32)); + i |= 0x8000; + memcpy(temp, &i, sizeof(afs_int32)); + temp += sizeof(afs_int32); + return 0; } -/* get the current AFS pag for the calling process */ -static afs_int32 curpag() +/* get the current AFS pag for the calling process */ +static afs_int32 +curpag() { - gid_t groups[30]; - afs_uint32 g0, g1; - afs_uint32 h, l, ret; - - if (getgroups(sizeof groups/sizeof groups[0], groups) < 2) return 0; - - g0 = groups[0] & 0xffff; - g1 = groups[1] & 0xffff; - g0 -= 0x3f00; - g1 -= 0x3f00; - if (g0 < 0xc000 && g1 < 0xc000) { - l = ((g0 & 0x3fff) << 14) | (g1 & 0x3fff); - h = (g0 >> 14); - h = (g1 >> 14) + h + h + h; - ret = ((h << 28) | l); - /* Additional testing */ - if (((ret >> 24) & 0xff) == 'A') - return ret; - else - return -1; - } - return -1; + gid_t groups[30]; + afs_uint32 g0, g1; + afs_uint32 h, l, ret; + + if (getgroups(sizeof groups / sizeof groups[0], groups) < 2) + return 0; + + g0 = groups[0] & 0xffff; + g1 = groups[1] & 0xffff; + g0 -= 0x3f00; + g1 -= 0x3f00; + if (g0 < 0xc000 && g1 < 0xc000) { + l = ((g0 & 0x3fff) << 14) | (g1 & 0x3fff); + h = (g0 >> 14); + h = (g1 >> 14) + h + h + h; + ret = ((h << 28) | l); + /* Additional testing */ + if (((ret >> 24) & 0xff) == 'A') + return ret; + else + return -1; + } + return -1; } /* Returns the AFS pag number, if any, otherwise return -1 */ -afs_int32 getPAG() +afs_int32 +getPAG() { - afs_int32 pag; + afs_int32 pag; - assert(sizeof(afs_uint32) == 4); - assert(sizeof(afs_int32) == 4); + assert(sizeof(afs_uint32) == 4); + assert(sizeof(afs_int32) == 4); - pag = curpag(); - if (pag == 0 || pag == -1) - return -1; + pag = curpag(); + if (pag == 0 || pag == -1) + return -1; - /* high order byte is always 'A'; actual pag value is low 24 bits */ - return (pag & 0xFFFFFF); + /* high order byte is always 'A'; actual pag value is low 24 bits */ + return (pag & 0xFFFFFF); } /* @@ -138,46 +145,48 @@ afs_int32 getPAG() * the directive SetAFSDebugLevel in the httpd.conf file */ /* VARARGS1 */ -void afsLogError (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -char * a; -char * b; -char * c; -char * d; -char * e; -char * f; -char * g; -char * h; -char * i; -char * j; -char * k; -char * l; -char * m; -char * n; +void +afsLogError(a, b, c, d, e, f, g, h, i, j, k, l, m, n) + char *a; + char *b; + char *c; + char *d; + char *e; + char *f; + char *g; + char *h; + char *i; + char *j; + char *k; + char *l; + char *m; + char *n; { - char reason[1024]; - - sprintf (reason, a,b,c,d,e,f,g,h,i,j,k,l,m,n); - /* LOG_REASON(reason,r->uri,r); */ - strcat(reason,"\n"); - fprintf(stderr, reason); + char reason[1024]; + + sprintf(reason, a, b, c, d, e, f, g, h, i, j, k, l, m, n); + /* LOG_REASON(reason,r->uri,r); */ + strcat(reason, "\n"); + fprintf(stderr, reason); } - + /* the following are debug utilities */ -void hexDump(char *tbuffer, int len) +void +hexDump(char *tbuffer, int len) { - int i; - int byte; - char *temp = tbuffer; - - fprintf(stderr, "HEXDUMP:\n"); - for (i=0; i < len; i++) { - byte = *temp; - temp++; - fprintf(stderr, "%x",byte); - } - fprintf(stderr, "\n"); + int i; + int byte; + char *temp = tbuffer; + + fprintf(stderr, "HEXDUMP:\n"); + for (i = 0; i < len; i++) { + byte = *temp; + temp++; + fprintf(stderr, "%x", byte); + } + fprintf(stderr, "\n"); } /* @@ -185,67 +194,71 @@ void hexDump(char *tbuffer, int len) * call this before and after the routine to dosetpag and verify results */ -int printGroups() +int +printGroups() { - int numGroups,i; - gid_t grouplist[NGROUPS_MAX]; + int numGroups, i; + gid_t grouplist[NGROUPS_MAX]; - numGroups = getgroups(NGROUPS_MAX, &grouplist[0]); - if (numGroups == -1) { - perror("getgroups:"); - return -1; - } - for (i=0; i #include @@ -16,8 +16,8 @@ #include #include -#include /* had to put this for in_addr used in venus.h */ -#include /* for pioctl opcode defines */ +#include /* had to put this for in_addr used in venus.h */ +#include /* for pioctl opcode defines */ #include "assert.h" @@ -29,9 +29,9 @@ #endif /* !MAX */ -extern int do_pioctl(char *in_buffer, int in_size, - char *out_buffer, int out_size, - int opcode, char *path, int followSymLinks); +extern int do_pioctl(char *in_buffer, int in_size, char *out_buffer, + int out_size, int opcode, char *path, + int followSymLinks); extern int flipPrimary(char *tokenBuf); extern afs_int32 getPAG(); diff --git a/src/afsweb/apache_afs_weblog.c b/src/afsweb/apache_afs_weblog.c index c8d53c41f..8468e05f3 100644 --- a/src/afsweb/apache_afs_weblog.c +++ b/src/afsweb/apache_afs_weblog.c @@ -31,224 +31,229 @@ #define WEBLOG_BIN "weblog" /* TODO - set restart_attempts to 0 if not within certain time period */ -#define MAX_RESTARTS 3 /* after this many restarts just die */ -static int restart_attempts=0; +#define MAX_RESTARTS 3 /* after this many restarts just die */ +static int restart_attempts = 0; -int error_fd; /* error file descriptor */ +int error_fd; /* error file descriptor */ -void sig_term() { +void +sig_term() +{ #ifdef AIX - pid_t pgrp=getpgrp(); + pid_t pgrp = getpgrp(); #else - pid_t pgrp=getpgrp(0); + pid_t pgrp = getpgrp(0); #endif - int n; + int n; #ifdef DEBUG - write(2, "weblog_starter: caught SIGTERM, shutting down",43); + write(2, "weblog_starter: caught SIGTERM, shutting down", 43); #endif - log_error("weblog_starter: caught SIGTERM, shutting down"); + log_error("weblog_starter: caught SIGTERM, shutting down"); - if (pgrp == (pid_t)-1) { - log_error("getpgrp failed - kill weblog manually"); - write(2,"getpgrp failed - kill weblog manually",38); + if (pgrp == (pid_t) - 1) { + log_error("getpgrp failed - kill weblog manually"); + write(2, "getpgrp failed - kill weblog manually", 38); + exit(1); + } + kill(-pgrp, SIGKILL); exit(1); - } - kill(-pgrp,SIGKILL); - exit(1); } /* strip out this binary and replace it with the weblog binary's name */ -getpath(char *this, char *path) { - char *temp=&this[0]; - int len=strlen(this); - int pos=0,i=0,j=0; - char bin_name[]=WEBLOG_BIN; - int len1=strlen(bin_name); - - strcpy(path,this); - temp+=(len); - pos=len; - while(*temp != '/') { - temp--; - pos--; - } - for (i=(pos+1);i=len1) - break; - } +getpath(char *this, char *path) +{ + char *temp = &this[0]; + int len = strlen(this); + int pos = 0, i = 0, j = 0; + char bin_name[] = WEBLOG_BIN; + int len1 = strlen(bin_name); + + strcpy(path, this); + temp += (len); + pos = len; + while (*temp != '/') { + temp--; + pos--; + } + for (i = (pos + 1); i < len; i++, j++) { + path[i] = bin_name[j]; + if (j >= len1) + break; + } } -char *get_time() { +char * +get_time() +{ time_t t; char *time_string; - t=time(NULL); - time_string = (char *) ctime((time_t *) &t); + t = time(NULL); + time_string = (char *)ctime((time_t *) & t); time_string[strlen(time_string) - 1] = '\0'; return (time_string); } log_error(char *msg) { - char err_msg[1024]; + char err_msg[1024]; - sprintf(err_msg,"[%s] weblog:%s\n",get_time(), msg); - write(error_fd,(void *) err_msg, strlen(err_msg)); + sprintf(err_msg, "[%s] weblog:%s\n", get_time(), msg); + write(error_fd, (void *)err_msg, strlen(err_msg)); } -int main(int argc, char **argv) +int +main(int argc, char **argv) { - pid_t weblog_pid; - int stat=-1; - int exitstatus=0; - char rn[]="weblog_starter"; - char path[1024]; - char error_fname[1024]; - - struct sigaction sa; - - memset(&sa,0,sizeof sa); - sa.sa_handler=(void (*)())sig_term; - if(sigaction(SIGTERM,&sa,NULL) < 0) { - perror("sigaction(SIGTERM)"); - } - - getpath(argv[1], path); - strcpy(error_fname,argv[2]); - - error_fd=open(error_fname,O_WRONLY|O_APPEND|O_CREAT); - if (error_fd < 0) { - fprintf(stderr, "%s:Error opening log file:%s\nExiting\n",rn,error_fname); - perror("open"); - exit(-1); - } - - log_error("weblog_starter resuming normal operation"); - - while(restart_attempts < MAX_RESTARTS) { - /* fork the weblog process and wait till it exits */ - if((weblog_pid=fork()) < 0) { - log_error("Could not fork process"); + pid_t weblog_pid; + int stat = -1; + int exitstatus = 0; + char rn[] = "weblog_starter"; + char path[1024]; + char error_fname[1024]; + + struct sigaction sa; + + memset(&sa, 0, sizeof sa); + sa.sa_handler = (void (*)())sig_term; + if (sigaction(SIGTERM, &sa, NULL) < 0) { + perror("sigaction(SIGTERM)"); + } + + getpath(argv[1], path); + strcpy(error_fname, argv[2]); + + error_fd = open(error_fname, O_WRONLY | O_APPEND | O_CREAT); + if (error_fd < 0) { + fprintf(stderr, "%s:Error opening log file:%s\nExiting\n", rn, + error_fname); + perror("open"); + exit(-1); + } + + log_error("weblog_starter resuming normal operation"); + + while (restart_attempts < MAX_RESTARTS) { + /* fork the weblog process and wait till it exits */ + if ((weblog_pid = fork()) < 0) { + log_error("Could not fork process"); #ifdef DEBUG - perror("apache_afs_weblog:Could not fork process"); + perror("apache_afs_weblog:Could not fork process"); #endif - exit(-1); - } - switch (weblog_pid) { - case 0: - /* the child process - in this case weblog */ - execlp(path, "weblog", argv[3],argv[4],argv[5],argv[6],(char *)0); + exit(-1); + } + switch (weblog_pid) { + case 0: + /* the child process - in this case weblog */ + execlp(path, "weblog", argv[3], argv[4], argv[5], argv[6], NULL); #ifdef DEBUG - perror("apache_afs_weblog:Could not execute weblog"); -#endif - exit(RESTARTERROR); - - default: - /* parent: just wait for the child */ - weblog_pid=waitpid((pid_t) -1, &stat,0); - - if (weblog_pid == -1) { + perror("apache_afs_weblog:Could not execute weblog"); +#endif + exit(RESTARTERROR); + + default: + /* parent: just wait for the child */ + weblog_pid = waitpid((pid_t) - 1, &stat, 0); + + if (weblog_pid == -1) { #ifdef DEBUG - perror("apache_Afs_weblog: wait error"); -#endif - log_error("wait error"); - kill(getpid(),SIGTERM); - } - - if (WIFEXITED(stat)) { - exitstatus=WEXITSTATUS(stat); - switch(exitstatus) { - case 0: + perror("apache_Afs_weblog: wait error"); +#endif + log_error("wait error"); + kill(getpid(), SIGTERM); + } + + if (WIFEXITED(stat)) { + exitstatus = WEXITSTATUS(stat); + switch (exitstatus) { + case 0: #ifdef DEBUG - fprintf(stderr, "%s:No error ... restarting\n",rn); + fprintf(stderr, "%s:No error ... restarting\n", rn); #endif - break; - - case RESTART: + break; + + case RESTART: #ifdef DEBUG - fprintf(stderr, "%s:%s...Exiting\n", rn, RESTARTMSG); + fprintf(stderr, "%s:%s...Exiting\n", rn, RESTARTMSG); #endif - log_error(RESTARTMSG); - exit(-1); - - case NULLARGS: + log_error(RESTARTMSG); + exit(-1); + + case NULLARGS: #ifdef DEBUG - fprintf(stderr, "%s:%s...Exiting\n", rn, NULLARGSMSG); - log_error(NULLARGSMSG); + fprintf(stderr, "%s:%s...Exiting\n", rn, NULLARGSMSG); + log_error(NULLARGSMSG); #endif - exit(-1); - - case PIPESEND: + exit(-1); + + case PIPESEND: #ifdef DEBUG - fprintf(stderr, "%s:%s...Restarting\n", rn, PIPESENDMSG); + fprintf(stderr, "%s:%s...Restarting\n", rn, PIPESENDMSG); #endif - log_error(PIPESENDMSG); - break; - - case PIPEREAD: + log_error(PIPESENDMSG); + break; + + case PIPEREAD: #ifdef DEBUG - fprintf(stderr, "%s:%s...Exiting\n", rn, PIPEREADMSG); + fprintf(stderr, "%s:%s...Exiting\n", rn, PIPEREADMSG); #endif - log_error(PIPEREADMSG); - exit(-1); - - case PARSE: + log_error(PIPEREADMSG); + exit(-1); + + case PARSE: #ifdef DEBUG - fprintf(stderr, "%s:%s...Exiting\n", rn, PARSEMSG); + fprintf(stderr, "%s:%s...Exiting\n", rn, PARSEMSG); #endif - log_error(PARSEMSG); - exit(-1); - - case KA: + log_error(PARSEMSG); + exit(-1); + + case KA: #ifdef DEBUG - fprintf(stderr, "%s:%s...Exiting\n", rn, KAMSG); + fprintf(stderr, "%s:%s...Exiting\n", rn, KAMSG); #endif - log_error(KAMSG); - exit(-1); - - default: + log_error(KAMSG); + exit(-1); + + default: #ifdef DEBUG - fprintf(stderr, "%s:Unknown error...Exiting\n", rn); -#endif - log_error("Unknown error"); - exit(-1); - } /* switch (exitstatus) */ - } /* if weblog exited */ - - else { /* weblog terminated abnormally */ - if (WIFSIGNALED(stat)) { + fprintf(stderr, "%s:Unknown error...Exiting\n", rn); +#endif + log_error("Unknown error"); + exit(-1); + } /* switch (exitstatus) */ + } + /* if weblog exited */ + else { /* weblog terminated abnormally */ + if (WIFSIGNALED(stat)) { #ifdef DEBUG - fprintf(stderr, "%s:The signal that terminated weblog:%d\n" - "Restarting weblog ...\n",rn,WTERMSIG(stat)); + fprintf(stderr, + "%s:The signal that terminated weblog:%d\n" + "Restarting weblog ...\n", rn, WTERMSIG(stat)); #endif - } + } #ifndef AIX - else if (WCOREDUMP(stat)){ + else if (WCOREDUMP(stat)) { #ifdef DEBUG - fprintf(stderr, "%s: weblog dumped core" - "Exiting ...\n",rn); + fprintf(stderr, "%s: weblog dumped core" "Exiting ...\n", + rn); #endif - log_error("Core dump"); - exit(-1); - } + log_error("Core dump"); + exit(-1); + } #endif - else { + else { #ifdef DEBUG - fprintf(stderr, "%s: weblog died under STRANGE circumstances..." - "restarting weblog\n",rn); + fprintf(stderr, + "%s: weblog died under STRANGE circumstances..." + "restarting weblog\n", rn); #endif - } - } - break; - } /* switch(weblog_pid) */ - restart_attempts++; - } /* while */ + } + } + break; + } /* switch(weblog_pid) */ + restart_attempts++; + } /* while */ } - - - - diff --git a/src/afsweb/apache_api.h b/src/afsweb/apache_api.h index b6e1b02c0..f6ebd583b 100644 --- a/src/afsweb/apache_api.h +++ b/src/afsweb/apache_api.h @@ -42,7 +42,7 @@ #define FIND_LINKED_MODULE ap_find_linked_module #else #include "1.2/httpd.h" -#include "1.2/http_conf_globals.h" /* for pid_fname */ +#include "1.2/http_conf_globals.h" /* for pid_fname */ #define OS_ESCAPE_PATH os_escape_path #define TABLE_SET table_set diff --git a/src/afsweb/apache_includes/1.2/alloc.h b/src/afsweb/apache_includes/1.2/alloc.h index 858bf2cb5..d7bc76d60 100644 --- a/src/afsweb/apache_includes/1.2/alloc.h +++ b/src/afsweb/apache_includes/1.2/alloc.h @@ -76,18 +76,18 @@ typedef struct pool pool; extern pool *permanent_pool; void init_alloc(); /* Set up everything */ -pool *make_sub_pool (pool *); /* All pools are subpools of permanent_pool */ -void destroy_pool (pool *); +pool *make_sub_pool(pool *); /* All pools are subpools of permanent_pool */ +void destroy_pool(pool *); /* Clearing out EVERYTHING in an pool... destroys any sub-pools */ -void clear_pool (struct pool *); +void clear_pool(struct pool *); /* Preparing for exec() --- close files, etc., but *don't* flush I/O * buffers, *don't* wait for subprocesses, and *don't* free any memory. */ -void cleanup_for_exec (); +void cleanup_for_exec(); /* routines to allocate memory from an pool... */ @@ -95,7 +95,7 @@ void *palloc(struct pool *, int nbytes); void *pcalloc(struct pool *, int nbytes); extern char *pstrdup(struct pool *, const char *s); extern char *pstrndup(struct pool *, const char *s, int n); -char *pstrcat(struct pool *, ...); /* all '...' must be char* */ +char *pstrcat(struct pool *, ...); /* all '...' must be char* */ /* array and alist management... keeping lists of things. * Common enough to want common support code ... @@ -109,20 +109,20 @@ typedef struct { char *elts; } array_header; -array_header *make_array (pool *p, int nelts, int elt_size); -void *push_array (array_header *); -void array_cat (array_header *dst, const array_header *src); -array_header *append_arrays (pool *, const array_header *, - const array_header *); +array_header *make_array(pool * p, int nelts, int elt_size); +void *push_array(array_header *); +void array_cat(array_header * dst, const array_header * src); +array_header *append_arrays(pool *, const array_header *, + const array_header *); /* copy_array copies the *entire* array. copy_array_hdr just copies * the header, and arranges for the elements to be copied if (and only * if) the code subsequently does a push or arraycat. */ - -array_header *copy_array (pool *p, const array_header *src); -array_header *copy_array_hdr (pool *p, const array_header *src); - + +array_header *copy_array(pool * p, const array_header * src); +array_header *copy_array_hdr(pool * p, const array_header * src); + /* Tables. Implemented alist style, for now, though we try to keep * it so that imposing a hash table structure on top in the future @@ -133,8 +133,8 @@ array_header *copy_array_hdr (pool *p, const array_header *src); * currently being used... */ -typedef array_header table; - +typedef array_header table; + typedef struct { char *key; /* maybe NULL in future; * check when iterating thru table_elts @@ -142,20 +142,20 @@ typedef struct { char *val; } table_entry; -table *make_table (pool *p, int nelts); -table *copy_table (pool *p, const table *); -void clear_table (table *); -char *table_get (const table *, const char *); -void table_set (table *, const char *name, const char *val); -void table_merge (table *, const char *name, const char *more_val); -void table_unset (table *, const char *key); -void table_add (table *, const char *name, const char *val); -void table_do (int (*comp)(void *, const char *, const char *), void *rec, - const table *t, ...); +table *make_table(pool * p, int nelts); +table *copy_table(pool * p, const table *); +void clear_table(table *); +char *table_get(const table *, const char *); +void table_set(table *, const char *name, const char *val); +void table_merge(table *, const char *name, const char *more_val); +void table_unset(table *, const char *key); +void table_add(table *, const char *name, const char *val); +void table_do(int (*comp) (void *, const char *, const char *), void *rec, + const table * t, ...); -table *overlay_tables (pool *p, const table *overlay, const table *base); +table *overlay_tables(pool * p, const table * overlay, const table * base); -array_header *table_elts (table *); +array_header *table_elts(table *); #define is_empty_table(t) (((t) == NULL)||((t)->nelts == 0)) @@ -181,12 +181,11 @@ array_header *table_elts (table *); * unblock_alarms() below... */ -void register_cleanup (pool *p, void *data, - void (*plain_cleanup)(void *), - void (*child_cleanup)(void *)); +void register_cleanup(pool * p, void *data, void (*plain_cleanup) (void *), + void (*child_cleanup) (void *)); -void kill_cleanup (pool *p, void *data, void (*plain_cleanup)(void *)); -void run_cleanup (pool *p, void *data, void (*cleanup)(void *)); +void kill_cleanup(pool * p, void *data, void (*plain_cleanup) (void *)); +void run_cleanup(pool * p, void *data, void (*cleanup) (void *)); /* The time between when a resource is actually allocated, and when it * its cleanup is registered is a critical section, during which the @@ -207,14 +206,14 @@ extern void unblock_alarms(); FILE *pfopen(struct pool *, const char *name, const char *fmode); FILE *pfdopen(struct pool *, int fd, const char *fmode); -int popenf(struct pool *, const char *name, int flg, int mode); +int popenf(struct pool *, const char *name, int flg, int mode); -void note_cleanups_for_file (pool *, FILE *); -void note_cleanups_for_fd (pool *, int); -void kill_cleanups_for_fd (pool *p, int fd); +void note_cleanups_for_file(pool *, FILE *); +void note_cleanups_for_fd(pool *, int); +void kill_cleanups_for_fd(pool * p, int fd); -regex_t *pregcomp (pool *p, const char *pattern, int cflags); -void pregfree (pool *p, regex_t *reg); +regex_t *pregcomp(pool * p, const char *pattern, int cflags); +void pregfree(pool * p, regex_t * reg); /* routines to note closes... file descriptors are constrained enough * on some systems that we want to support this. @@ -232,12 +231,13 @@ int pclosef(struct pool *, int fd); * set the associated args to NULL). It takes as args a function * to call in the child, and an argument to be passed to the function. */ - -enum kill_conditions { kill_never, kill_always, kill_after_timeout, just_wait}; -int spawn_child_err (pool *, void (*)(void *), void *, - enum kill_conditions, FILE **pipe_in, FILE **pipe_out, - FILE **pipe_err); +enum kill_conditions { kill_never, kill_always, kill_after_timeout, + just_wait +}; + +int spawn_child_err(pool *, void (*)(void *), void *, enum kill_conditions, + FILE ** pipe_in, FILE ** pipe_out, FILE ** pipe_err); #define spawn_child(p,f,v,k,in,out) spawn_child_err(p,f,v,k,in,out,NULL) /* magic numbers --- min free bytes to consider a free pool block useable, @@ -248,5 +248,5 @@ int spawn_child_err (pool *, void (*)(void *), void *, /* Finally, some accounting */ -long bytes_in_pool(pool *p); +long bytes_in_pool(pool * p); long bytes_in_free_blocks(); diff --git a/src/afsweb/apache_includes/1.2/buff.h b/src/afsweb/apache_includes/1.2/buff.h index aa1926723..aae3e446c 100644 --- a/src/afsweb/apache_includes/1.2/buff.h +++ b/src/afsweb/apache_includes/1.2/buff.h @@ -65,8 +65,8 @@ #define B_RDERR (16) /* A write error has occurred */ #define B_WRERR (32) -#ifdef B_ERROR /* in SVR4: sometimes defined in /usr/include/sys/buf.h */ -#undef B_ERROR /* avoid "warning: `B_ERROR' redefined" */ +#ifdef B_ERROR /* in SVR4: sometimes defined in /usr/include/sys/buf.h */ +#undef B_ERROR /* avoid "warning: `B_ERROR' redefined" */ #endif #define B_ERROR (48) /* Use chunked writing */ @@ -76,60 +76,59 @@ typedef struct buff_struct BUFF; -struct buff_struct -{ - int flags; /* flags */ - unsigned char *inptr; /* pointer to next location to read */ - int incnt; /* number of bytes left to read from input buffer; - * always 0 if had a read error */ - int outchunk; /* location of chunk header when chunking */ - int outcnt; /* number of byte put in output buffer */ +struct buff_struct { + int flags; /* flags */ + unsigned char *inptr; /* pointer to next location to read */ + int incnt; /* number of bytes left to read from input buffer; + * always 0 if had a read error */ + int outchunk; /* location of chunk header when chunking */ + int outcnt; /* number of byte put in output buffer */ unsigned char *inbase; unsigned char *outbase; int bufsiz; - void (*error)(BUFF *fb, int op, void *data); + void (*error) (BUFF * fb, int op, void *data); void *error_data; - long int bytes_sent; /* number of bytes actually written */ + long int bytes_sent; /* number of bytes actually written */ pool *pool; /* could also put pointers to the basic I/O routines here */ - int fd; /* the file descriptor */ - int fd_in; /* input file descriptor, if different */ + int fd; /* the file descriptor */ + int fd_in; /* input file descriptor, if different */ }; /* Options to bset/getopt */ #define BO_BYTECT (1) /* Stream creation and modification */ -extern BUFF *bcreate(pool *p, int flags); -extern void bpushfd(BUFF *fb, int fd_in, int fd_out); -extern int bsetopt(BUFF *fb, int optname, const void *optval); -extern int bgetopt(BUFF *fb, int optname, void *optval); -extern int bsetflag(BUFF *fb, int flag, int value); -extern int bclose(BUFF *fb); +extern BUFF *bcreate(pool * p, int flags); +extern void bpushfd(BUFF * fb, int fd_in, int fd_out); +extern int bsetopt(BUFF * fb, int optname, const void *optval); +extern int bgetopt(BUFF * fb, int optname, void *optval); +extern int bsetflag(BUFF * fb, int flag, int value); +extern int bclose(BUFF * fb); #define bgetflag(fb, flag) ((fb)->flags & (flag)) /* Error handling */ -extern void bonerror(BUFF *fb, void (*error)(BUFF *, int, void *), +extern void bonerror(BUFF * fb, void (*error) (BUFF *, int, void *), void *data); /* I/O */ -extern int bread(BUFF *fb, void *buf, int nbyte); -extern int bgets(char *s, int n, BUFF *fb); -extern int blookc(char *buff, BUFF *fb); -extern int bskiplf(BUFF *fb); -extern int bwrite(BUFF *fb, const void *buf, int nbyte); -extern int bflush(BUFF *fb); -extern int bputs(const char *x, BUFF *fb); -extern int bvputs(BUFF *fb, ...); -extern int bprintf(BUFF *fb,const char *fmt,...); -extern int vbprintf(BUFF *fb,const char *fmt,va_list vlist); +extern int bread(BUFF * fb, void *buf, int nbyte); +extern int bgets(char *s, int n, BUFF * fb); +extern int blookc(char *buff, BUFF * fb); +extern int bskiplf(BUFF * fb); +extern int bwrite(BUFF * fb, const void *buf, int nbyte); +extern int bflush(BUFF * fb); +extern int bputs(const char *x, BUFF * fb); +extern int bvputs(BUFF * fb, ...); +extern int bprintf(BUFF * fb, const char *fmt, ...); +extern int vbprintf(BUFF * fb, const char *fmt, va_list vlist); /* Internal routines */ -extern int bflsbuf(int c, BUFF *fb); -extern int bfilbuf(BUFF *fb); +extern int bflsbuf(int c, BUFF * fb); +extern int bfilbuf(BUFF * fb); #define bgetc(fb) ( ((fb)->incnt == 0) ? bfilbuf(fb) : \ ((fb)->incnt--, *((fb)->inptr++)) ) diff --git a/src/afsweb/apache_includes/1.2/conf.h b/src/afsweb/apache_includes/1.2/conf.h index ee6f0be2a..771988fd7 100644 --- a/src/afsweb/apache_includes/1.2/conf.h +++ b/src/afsweb/apache_includes/1.2/conf.h @@ -84,7 +84,7 @@ char *crypt(const char *pw, const char *salt); char *mktemp(char *template); #define JMP_BUF sigjmp_buf #define HAVE_MMAP -#include +#include #define NEED_STRERROR typedef int rlim_t; #ifndef HAVE_MEMMOVE @@ -167,8 +167,8 @@ typedef int rlim_t; #define ULTRIX_BRAIN_DEATH #define NEED_STRDUP /* If you have Ultrix 4.3, and are using cc, const is broken */ -#ifndef __ultrix__ /* Hack to check for pre-Ultrix 4.4 cc */ -#define const /* Not implemented */ +#ifndef __ultrix__ /* Hack to check for pre-Ultrix 4.4 cc */ +#define const /* Not implemented */ #endif #define JMP_BUF sigjmp_buf @@ -245,7 +245,7 @@ typedef unsigned short mode_t; #ifndef rlim_t typedef int rlim_t; #endif -typedef u_long n_long; +typedef u_long n_long; #endif #define STDIN_FILENO 0 @@ -269,7 +269,7 @@ typedef int rlim_t; #undef NO_SETSID #undef NEED_STRDUP #define JMP_BUF sigjmp_buf -#include +#include #elif defined(SCO) #undef HAVE_GMTOFF @@ -278,8 +278,8 @@ typedef int rlim_t; #define NEED_INITGROUPS #define NO_WRITEV #define JMP_BUF sigjmp_buf -#define SIGURG SIGUSR1 /* but note, this signal will be sent to a process group if enabled (for OOB data). It is not currently enabled. */ -#include +#define SIGURG SIGUSR1 /* but note, this signal will be sent to a process group if enabled (for OOB data). It is not currently enabled. */ +#include #elif defined(SCO5) @@ -293,21 +293,21 @@ typedef int rlim_t; /* Although SCO 5 defines these in (note the "s") they don't have consts. Sigh. */ -extern int strcasecmp(const char *,const char *); -extern int strncasecmp(const char *,const char *,unsigned); +extern int strcasecmp(const char *, const char *); +extern int strncasecmp(const char *, const char *, unsigned); #elif defined(AUX) /* These are to let -Wall compile more cleanly */ extern int strcasecmp(const char *, const char *); -extern int strncasecmp(const char *,const char *,unsigned); +extern int strncasecmp(const char *, const char *, unsigned); extern int set42sig(), getopt(), getpeername(); extern int listen(), bind(), socket(), getsockname(); extern int accept(), gethostname(), connect(), lstat(); extern int select(), killpg(), shutdown(); extern int initgroups(), setsockopt(); extern char *shmat(); -extern int shmctl(); -extern int shmget(); +extern int shmctl(); +extern int shmget(); extern char *sbrk(); extern char *crypt(); #include @@ -415,7 +415,7 @@ typedef quad_t rlim_t; char *crypt(const char *pw, const char *salt); #endif #ifndef initgroups -int initgroups (char *, int); +int initgroups(char *, int); #endif #ifndef strncasecmp #define strncasecmp strnicmp @@ -449,7 +449,7 @@ int initgroups (char *, int); #define USE_FCNTL_SERIALIZED_ACCEPT #define HAVE_MMAP #define HAVE_CRYPT_H - + #elif defined(__EMX__) /* Defines required for EMX OS/2 port. */ #define JMP_BUF sigjmp_buf @@ -459,10 +459,10 @@ int initgroups (char *, int); #define NO_SETSID /* Add some drive name support */ #define chdir _chdir2 -#include +#include #define MAXSOCKETS 4096 #define HAVE_MMAP - + #elif defined(__MACHTEN__) typedef int rlim_t; #define JMP_BUF sigjmp_buf @@ -497,7 +497,7 @@ typedef int rlim_t; typedef int rlim_t; #elif defined(ISC) -#include +#include #define NO_KILLPG #undef NO_SETSID #define HAVE_SHMGET @@ -546,7 +546,7 @@ typedef int rlim_t; #define ap_snprintf snprintf #define ap_vsnprintf vsnprintf #else -int ap_snprintf(char *buf, size_t len, const char *format,...); +int ap_snprintf(char *buf, size_t len, const char *format, ...); int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap); #endif @@ -574,9 +574,9 @@ int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap); #include #include #ifndef MPE -#include /* for inet_ntoa */ +#include /* for inet_ntoa */ #endif -#include /* for ctime */ +#include /* for ctime */ #include #include #include @@ -596,8 +596,8 @@ int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap); #ifdef HAVE_SYS_RESOURCE_H #include #ifdef SUNOS4 -int getrlimit( int, struct rlimit *); -int setrlimit( int, struct rlimit *); +int getrlimit(int, struct rlimit *); +int setrlimit(int, struct rlimit *); #endif #endif #ifdef HAVE_MMAP @@ -654,7 +654,7 @@ typedef void Sigfunc(int); #undef signal #endif #define signal(s,f) ap_signal(s,f) -Sigfunc *signal(int signo, Sigfunc *func); +Sigfunc *signal(int signo, Sigfunc * func); #endif #include @@ -680,13 +680,13 @@ Sigfunc *signal(int signo, Sigfunc *func); #define XtOffset(p_type,field) \ (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) -#else /* !CRAY2 */ +#else /* !CRAY2 */ #define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field)) -#endif /* !CRAY2 */ -#endif /* __STDC__ */ -#else /* ! (CRAY || __arm) */ +#endif /* !CRAY2 */ +#endif /* __STDC__ */ +#else /* ! (CRAY || __arm) */ #define XtOffset(p_type,field) \ ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) @@ -706,52 +706,52 @@ Sigfunc *signal(int signo, Sigfunc *func); * Sun Quality Software. Gotta love it. */ -int getopt (int, char **, char *); +int getopt(int, char **, char *); -int strcasecmp (char *, char *); -int strncasecmp (char *, char *, int); +int strcasecmp(char *, char *); +int strncasecmp(char *, char *, int); int toupper(int); -int tolower(int); - -int printf (char *, ...); -int fprintf (FILE *, char *, ...); -int fputs (char *, FILE *); -int fread (char *, int, int, FILE *); -int fwrite (char *, int, int, FILE *); -int fflush (FILE *); -int fclose (FILE *); -int ungetc (int, FILE *); -int _filbuf (FILE *); /* !!! */ -int _flsbuf (unsigned char, FILE *); /* !!! */ -int sscanf (char *, char *, ...); -void setbuf (FILE *, char *); -void perror (char *); - -time_t time (time_t *); -int strftime (char *, int, char *, struct tm *); - -int initgroups (char *, int); -int wait3 (int *, int, void*); /* Close enough for us... */ -int lstat (const char *, struct stat *); -int stat (const char *, struct stat *); -int flock (int, int); +int tolower(int); + +int printf(char *, ...); +int fprintf(FILE *, char *, ...); +int fputs(char *, FILE *); +int fread(char *, int, int, FILE *); +int fwrite(char *, int, int, FILE *); +int fflush(FILE *); +int fclose(FILE *); +int ungetc(int, FILE *); +int _filbuf(FILE *); /* !!! */ +int _flsbuf(unsigned char, FILE *); /* !!! */ +int sscanf(char *, char *, ...); +void setbuf(FILE *, char *); +void perror(char *); + +time_t time(time_t *); +int strftime(char *, int, char *, struct tm *); + +int initgroups(char *, int); +int wait3(int *, int, void *); /* Close enough for us... */ +int lstat(const char *, struct stat *); +int stat(const char *, struct stat *); +int flock(int, int); #ifndef NO_KILLPG int killpg(int, int); #endif -int socket (int, int, int); -int setsockopt (int, int, int, const char*, int); -int listen (int, int); -int bind (int, struct sockaddr *, int); -int connect (int, struct sockaddr *, int); -int accept (int, struct sockaddr *, int *); -int shutdown (int, int); - -int getsockname (int s, struct sockaddr *name, int *namelen); -int getpeername (int s, struct sockaddr *name, int *namelen); -int gethostname (char *name, int namelen); -void syslog (int, char *, ...); -char *mktemp (char *); - -long vfprintf (FILE *, char *, va_list); - +int socket(int, int, int); +int setsockopt(int, int, int, const char *, int); +int listen(int, int); +int bind(int, struct sockaddr *, int); +int connect(int, struct sockaddr *, int); +int accept(int, struct sockaddr *, int *); +int shutdown(int, int); + +int getsockname(int s, struct sockaddr *name, int *namelen); +int getpeername(int s, struct sockaddr *name, int *namelen); +int gethostname(char *name, int namelen); +void syslog(int, char *, ...); +char *mktemp(char *); + +long vfprintf(FILE *, char *, va_list); + #endif diff --git a/src/afsweb/apache_includes/1.2/http_conf_globals.h b/src/afsweb/apache_includes/1.2/http_conf_globals.h index 3a60e7db7..b87733fc4 100644 --- a/src/afsweb/apache_includes/1.2/http_conf_globals.h +++ b/src/afsweb/apache_includes/1.2/http_conf_globals.h @@ -83,4 +83,3 @@ extern char *server_argv0; extern char server_root[MAX_STRING_LEN]; extern char server_confname[MAX_STRING_LEN]; - diff --git a/src/afsweb/apache_includes/1.2/httpd.h b/src/afsweb/apache_includes/1.2/httpd.h index abee73506..7481bc7ba 100644 --- a/src/afsweb/apache_includes/1.2/httpd.h +++ b/src/afsweb/apache_includes/1.2/httpd.h @@ -67,7 +67,7 @@ */ #ifndef HTTPD_ROOT #ifdef __EMX__ -/* Set default for OS/2 file system */ +/* Set default for OS/2 file system */ #define HTTPD_ROOT "/os2httpd" #else #define HTTPD_ROOT "/usr/local/etc/httpd" @@ -77,7 +77,7 @@ #ifndef DOCUMENT_LOCATION /* Root of server */ #ifdef __EMX__ -/* Set default for OS/2 file system */ +/* Set default for OS/2 file system */ #define DOCUMENT_LOCATION "/os2httpd/docs" #else #define DOCUMENT_LOCATION "/usr/local/etc/httpd/htdocs" @@ -116,7 +116,7 @@ /* The name of the log files */ #ifndef DEFAULT_XFERLOG #ifdef __EMX__ -/* Set default for OS/2 file system */ +/* Set default for OS/2 file system */ #define DEFAULT_XFERLOG "logs/access.log" #else #define DEFAULT_XFERLOG "logs/access_log" @@ -124,7 +124,7 @@ #endif /* DEFAULT_XFERLOG */ #ifndef DEFAULT_ERRORLOG #ifdef __EMX__ -/* Set default for OS/2 file system */ +/* Set default for OS/2 file system */ #define DEFAULT_ERRORLOG "logs/error.log" #else #define DEFAULT_ERRORLOG "logs/error_log" @@ -152,7 +152,7 @@ /* Define this to be what your per-directory security files are called */ #ifdef __EMX__ -/* Set default for OS/2 file system */ +/* Set default for OS/2 file system */ #define DEFAULT_ACCESS_FNAME "htaccess" #else #define DEFAULT_ACCESS_FNAME ".htaccess" @@ -191,7 +191,7 @@ /* The path to the Bourne shell, for parsed docs */ #ifndef SHELL_PATH #ifdef __EMX__ -/* Set default for OS/2 file system */ +/* Set default for OS/2 file system */ #define SHELL_PATH "CMD.EXE" #else #define SHELL_PATH "/bin/sh" @@ -274,7 +274,7 @@ * Example: "Apache/1.1.0 MrWidget/0.1-alpha" */ -#define SERVER_BASEVERSION "Apache/1.2.6" /* SEE COMMENTS ABOVE */ +#define SERVER_BASEVERSION "Apache/1.2.6" /* SEE COMMENTS ABOVE */ #ifdef SERVER_SUBVERSION #define SERVER_VERSION SERVER_BASEVERSION " " SERVER_SUBVERSION #else @@ -420,11 +420,10 @@ /* This represents the result of calling htaccess; these are cached for * each request. */ -struct htaccess_result -{ - char *dir; /* the directory to which this applies */ - int override; /* the overrides allowed for the .htaccess file */ - void *htaccess; /* the configuration directives */ +struct htaccess_result { + char *dir; /* the directory to which this applies */ + int override; /* the overrides allowed for the .htaccess file */ + void *htaccess; /* the configuration directives */ /* the next one, or NULL if no more; N.B. never change this */ const struct htaccess_result *next; }; @@ -437,109 +436,109 @@ typedef struct listen_rec listen_rec; struct request_rec { - pool *pool; - conn_rec *connection; - server_rec *server; + pool *pool; + conn_rec *connection; + server_rec *server; - request_rec *next; /* If we wind up getting redirected, + request_rec *next; /* If we wind up getting redirected, * pointer to the request we redirected to. */ - request_rec *prev; /* If this is an internal redirect, + request_rec *prev; /* If this is an internal redirect, * pointer to where we redirected *from*. */ - - request_rec *main; /* If this is a sub_request (see request.h) + + request_rec *main; /* If this is a sub_request (see request.h) * pointer back to the main request. */ - /* Info about the request itself... we begin with stuff that only - * protocol.c should ever touch... - */ - - char *the_request; /* First line of request, so we can log it */ - int assbackwards; /* HTTP/0.9, "simple" request */ - int proxyreq; /* A proxy request */ - int header_only; /* HEAD request, as opposed to GET */ - char *protocol; /* Protocol, as given to us, or HTTP/0.9 */ - int proto_num; /* Number version of protocol; 1.1 = 1001 */ - char *hostname; /* Host, as set by full URI or Host: */ - int hostlen; /* Length of http://host:port in full URI */ - - time_t request_time; /* When the request started */ - - char *status_line; /* Status line, if set by script */ - int status; /* In any case */ - - /* Request method, two ways; also, protocol, etc.. Outside of protocol.c, - * look, but don't touch. - */ - - char *method; /* GET, HEAD, POST, etc. */ - int method_number; /* M_GET, M_POST, etc. */ - int allowed; /* Allowed methods - for 405, OPTIONS, etc */ - - int sent_bodyct; /* byte count in stream is for body */ - long bytes_sent; /* body byte count, for easy access */ - - /* HTTP/1.1 connection-level features */ - - int chunked; /* sending chunked transfer-coding */ - int byterange; /* number of byte ranges */ - char *boundary; /* multipart/byteranges boundary */ - char *range; /* The Range: header */ - long clength; /* The "real" content length */ - - long remaining; /* bytes left to read */ - long read_length; /* bytes that have been read */ - int read_body; /* how the request body should be read */ - int read_chunked; /* reading chunked transfer-coding */ - - /* MIME header environments, in and out. Also, an array containing - * environment variables to be passed to subprocesses, so people can - * write modules to add to that environment. - * - * The difference between headers_out and err_headers_out is that the - * latter are printed even on error, and persist across internal redirects - * (so the headers printed for ErrorDocument handlers will have them). - * - * The 'notes' table is for notes from one module to another, with no - * other set purpose in mind... - */ - - table *headers_in; - table *headers_out; - table *err_headers_out; - table *subprocess_env; - table *notes; - - char *content_type; /* Break these out --- we dispatch on 'em */ - char *handler; /* What we *really* dispatch on */ - - char *content_encoding; - char *content_language; /* for back-compat. only -- do not use */ - array_header *content_languages; /* array of (char*) */ - - int no_cache; - int no_local_copy; - - /* What object is being requested (either directly, or via include - * or content-negotiation mapping). - */ - - char *uri; /* complete URI for a proxy req, or - URL path for a non-proxy req */ - char *filename; - char *path_info; - char *args; /* QUERY_ARGS, if any */ - struct stat finfo; /* ST_MODE set to zero if no such file */ - - /* Various other config info which may change with .htaccess files - * These are config vectors, with one void* pointer for each module - * (the thing pointed to being the module's business). - */ - - void *per_dir_config; /* Options set in config files, etc. */ - void *request_config; /* Notes on *this* request */ + /* Info about the request itself... we begin with stuff that only + * protocol.c should ever touch... + */ + + char *the_request; /* First line of request, so we can log it */ + int assbackwards; /* HTTP/0.9, "simple" request */ + int proxyreq; /* A proxy request */ + int header_only; /* HEAD request, as opposed to GET */ + char *protocol; /* Protocol, as given to us, or HTTP/0.9 */ + int proto_num; /* Number version of protocol; 1.1 = 1001 */ + char *hostname; /* Host, as set by full URI or Host: */ + int hostlen; /* Length of http://host:port in full URI */ + + time_t request_time; /* When the request started */ + + char *status_line; /* Status line, if set by script */ + int status; /* In any case */ + + /* Request method, two ways; also, protocol, etc.. Outside of protocol.c, + * look, but don't touch. + */ + + char *method; /* GET, HEAD, POST, etc. */ + int method_number; /* M_GET, M_POST, etc. */ + int allowed; /* Allowed methods - for 405, OPTIONS, etc */ + + int sent_bodyct; /* byte count in stream is for body */ + long bytes_sent; /* body byte count, for easy access */ + + /* HTTP/1.1 connection-level features */ + + int chunked; /* sending chunked transfer-coding */ + int byterange; /* number of byte ranges */ + char *boundary; /* multipart/byteranges boundary */ + char *range; /* The Range: header */ + long clength; /* The "real" content length */ + + long remaining; /* bytes left to read */ + long read_length; /* bytes that have been read */ + int read_body; /* how the request body should be read */ + int read_chunked; /* reading chunked transfer-coding */ + + /* MIME header environments, in and out. Also, an array containing + * environment variables to be passed to subprocesses, so people can + * write modules to add to that environment. + * + * The difference between headers_out and err_headers_out is that the + * latter are printed even on error, and persist across internal redirects + * (so the headers printed for ErrorDocument handlers will have them). + * + * The 'notes' table is for notes from one module to another, with no + * other set purpose in mind... + */ + + table *headers_in; + table *headers_out; + table *err_headers_out; + table *subprocess_env; + table *notes; + + char *content_type; /* Break these out --- we dispatch on 'em */ + char *handler; /* What we *really* dispatch on */ + + char *content_encoding; + char *content_language; /* for back-compat. only -- do not use */ + array_header *content_languages; /* array of (char*) */ + + int no_cache; + int no_local_copy; + + /* What object is being requested (either directly, or via include + * or content-negotiation mapping). + */ + + char *uri; /* complete URI for a proxy req, or + * URL path for a non-proxy req */ + char *filename; + char *path_info; + char *args; /* QUERY_ARGS, if any */ + struct stat finfo; /* ST_MODE set to zero if no such file */ + + /* Various other config info which may change with .htaccess files + * These are config vectors, with one void* pointer for each module + * (the thing pointed to being the module's business). + */ + + void *per_dir_config; /* Options set in config files, etc. */ + void *request_config; /* Notes on *this* request */ /* * a linked list of the configuration directives in the .htaccess files @@ -547,7 +546,7 @@ struct request_rec { * N.B. always add to the head of the list, _never_ to the end. * that way, a sub request's list can (temporarily) point to a parent's list */ - const struct htaccess_result *htaccess; + const struct htaccess_result *htaccess; }; @@ -555,39 +554,39 @@ struct request_rec { */ struct conn_rec { - - pool *pool; - server_rec *server; - server_rec *base_server; /* Physical vhost this conn come in on */ - - /* Information about the connection itself */ - - int child_num; /* The number of the child handling conn_rec */ - BUFF *client; /* Connetion to the guy */ - int aborted; /* Are we still talking? */ - - /* Who is the client? */ - - struct sockaddr_in local_addr; /* local address */ - struct sockaddr_in remote_addr;/* remote address */ - char *remote_ip; /* Client's IP address */ - char *remote_host; /* Client's DNS name, if known. - * NULL if DNS hasn't been checked, - * "" if it has and no address was found. - * N.B. Only access this though + + pool *pool; + server_rec *server; + server_rec *base_server; /* Physical vhost this conn come in on */ + + /* Information about the connection itself */ + + int child_num; /* The number of the child handling conn_rec */ + BUFF *client; /* Connetion to the guy */ + int aborted; /* Are we still talking? */ + + /* Who is the client? */ + + struct sockaddr_in local_addr; /* local address */ + struct sockaddr_in remote_addr; /* remote address */ + char *remote_ip; /* Client's IP address */ + char *remote_host; /* Client's DNS name, if known. + * NULL if DNS hasn't been checked, + * "" if it has and no address was found. + * N.B. Only access this though * get_remote_host() */ - char *remote_logname; /* Only ever set if doing rfc1413 lookups. - * N.B. Only access this through + char *remote_logname; /* Only ever set if doing rfc1413 lookups. + * N.B. Only access this through * get_remote_logname() */ char *user; /* If an authentication check was made, * this gets set to the user name. We assume * that there's only one user per connection(!) */ - char *auth_type; /* Ditto. */ + char *auth_type; /* Ditto. */ - int keepalive; /* Are we using HTTP Keep-Alive? */ - int keptalive; /* Did we use HTTP Keep-Alive? */ - int keepalives; /* How many times have we used it? */ + int keepalive; /* Are we using HTTP Keep-Alive? */ + int keptalive; /* Did we use HTTP Keep-Alive? */ + int keepalives; /* How many times have we used it? */ }; /* Per-vhost config... */ @@ -601,7 +600,7 @@ typedef struct server_addr_rec server_addr_rec; struct server_addr_rec { server_addr_rec *next; struct in_addr host_addr; /* The bound address, for this server */ - unsigned short host_port; /* The bound port, for this server */ + unsigned short host_port; /* The bound port, for this server */ char *virthost; /* The name given in */ }; @@ -609,26 +608,26 @@ struct server_addr_rec { struct server_rec { server_rec *next; - + /* Full locations of server config info */ - + char *srm_confname; char *access_confname; - + /* Contact information */ - + char *server_admin; char *server_hostname; - unsigned short port; /* for redirects, etc. */ - + unsigned short port; /* for redirects, etc. */ + /* Log files --- note that transfer log is now in the modules... */ - + char *error_fname; FILE *error_log; - + /* Module-specific configuration for server, and defaults... */ - int is_virtual; /* true if this is the virtual server */ + int is_virtual; /* true if this is the virtual server */ void *module_config; /* Config vector containing pointers to * modules' per-server config structures. */ @@ -642,7 +641,7 @@ struct server_rec { int keep_alive_timeout; /* Seconds we'll wait for another request */ int keep_alive_max; /* Maximum requests per connection */ int keep_alive; /* Use persistent connections? */ - int send_buffer_size; /* size of TCP send buffer (in bytes) */ + int send_buffer_size; /* size of TCP send buffer (in bytes) */ char *path; /* Pathname for ServerPath */ int pathlen; /* Length of path */ @@ -656,9 +655,9 @@ struct server_rec { /* These are more like real hosts than virtual hosts */ struct listen_rec { listen_rec *next; - struct sockaddr_in local_addr; /* local IP address and port */ + struct sockaddr_in local_addr; /* local IP address and port */ int fd; - int used; /* Only used during restart */ + int used; /* Only used during restart */ /* more stuff here, like which protocol is bound to the port */ }; @@ -670,70 +669,70 @@ extern const char month_snames[12][4]; struct tm *get_gmtoff(int *tz); char *get_time(); -char *ht_time (pool *p, time_t t, const char *fmt, int gmt); -char *gm_timestr_822(pool *p, time_t t); - +char *ht_time(pool * p, time_t t, const char *fmt, int gmt); +char *gm_timestr_822(pool * p, time_t t); + /* String handling. The *_nc variants allow you to use non-const char **s as arguments (unfortunately C won't automatically convert a char ** to a const -char **) */ - -char *getword(pool *p, const char **line, char stop); -char *getword_nc(pool *p, char **line, char stop); -char *getword_white(pool *p, const char **line); -char *getword_white_nc(pool *p, char **line); -char *getword_nulls (pool *p, const char **line, char stop); -char *getword_nulls_nc (pool *p, char **line, char stop); -char *getword_conf (pool *p, const char **line); -char *getword_conf_nc (pool *p, char **line); - -char *get_token (pool *p, char **accept_line, int accept_white); -int find_token (pool *p, const char *line, const char *tok); -int find_last_token (pool *p, const char *line, const char *tok); - +char **) */ + +char *getword(pool * p, const char **line, char stop); +char *getword_nc(pool * p, char **line, char stop); +char *getword_white(pool * p, const char **line); +char *getword_white_nc(pool * p, char **line); +char *getword_nulls(pool * p, const char **line, char stop); +char *getword_nulls_nc(pool * p, char **line, char stop); +char *getword_conf(pool * p, const char **line); +char *getword_conf_nc(pool * p, char **line); + +char *get_token(pool * p, char **accept_line, int accept_white); +int find_token(pool * p, const char *line, const char *tok); +int find_last_token(pool * p, const char *line, const char *tok); + int is_url(const char *u); extern int unescape_url(char *url); void no2slash(char *name); void getparents(char *name); -char *escape_path_segment(pool *p, const char *s); -char *os_escape_path(pool *p,const char *path,int partial); +char *escape_path_segment(pool * p, const char *s); +char *os_escape_path(pool * p, const char *path, int partial); #define escape_uri(ppool,path) os_escape_path(ppool,path,1) -extern char *escape_html(pool *p, const char *s); -char *construct_server(pool *p, const char *hostname, unsigned port); -char *construct_url (pool *p, const char *path, const server_rec *s); -char *escape_shell_cmd (pool *p, const char *s); - +extern char *escape_html(pool * p, const char *s); +char *construct_server(pool * p, const char *hostname, unsigned port); +char *construct_url(pool * p, const char *path, const server_rec * s); +char *escape_shell_cmd(pool * p, const char *s); + int count_dirs(const char *path); -char *make_dirstr(pool *a, const char *s, int n); -char *make_full_path(pool *a, const char *dir, const char *f); - +char *make_dirstr(pool * a, const char *s, int n); +char *make_full_path(pool * a, const char *dir, const char *f); + int is_matchexp(const char *str); int strcmp_match(const char *str, const char *exp); int strcasecmp_match(const char *str, const char *exp); -char *uudecode (pool *, const char *); +char *uudecode(pool *, const char *); -char *pregsub(pool *p, const char *input, const char *source, - size_t nmatch, regmatch_t pmatch[]); +char *pregsub(pool * p, const char *input, const char *source, size_t nmatch, + regmatch_t pmatch[]); -void str_tolower (char *); -int ind (const char *, char); /* Sigh... */ -int rind (const char *, char); +void str_tolower(char *); +int ind(const char *, char); /* Sigh... */ +int rind(const char *, char); -int cfg_getline(char *s, int n, FILE *f); +int cfg_getline(char *s, int n, FILE * f); #ifdef NEED_STRERROR -char *strerror (int err); +char *strerror(int err); #endif /* Misc system hackery */ - + uid_t uname2id(const char *name); gid_t gname2id(const char *name); int is_directory(const char *name); -int can_exec(const struct stat *); +int can_exec(const struct stat *); void chdir_file(const char *file); - + char *get_local_host(pool *); -unsigned long get_virthost_addr (const char *hostname, unsigned short *port); +unsigned long get_virthost_addr(const char *hostname, unsigned short *port); extern time_t restart_time; @@ -761,6 +760,6 @@ extern time_t restart_time; * never fails. If the high line was requested and it fails it will also try * the low line. */ -int ap_slack (int fd, int line); +int ap_slack(int fd, int line); #define AP_SLACK_LOW 1 #define AP_SLACK_HIGH 2 diff --git a/src/afsweb/apache_includes/1.3.1/alloc.h b/src/afsweb/apache_includes/1.3.1/alloc.h index 902be1ed7..31de7e672 100644 --- a/src/afsweb/apache_includes/1.3.1/alloc.h +++ b/src/afsweb/apache_includes/1.3.1/alloc.h @@ -83,17 +83,17 @@ extern "C" { * alloc.c. */ - /* Need declaration of DIR on Win32 */ + /* Need declaration of DIR on Win32 */ #ifdef WIN32 -#include "../os/win32/readdir.h" +#include "os/win32/readdir.h" #endif -typedef struct pool pool; -typedef struct pool ap_pool; + typedef struct pool pool; + typedef struct pool ap_pool; -pool * ap_init_alloc(void); /* Set up everything */ -API_EXPORT(pool *) ap_make_sub_pool(pool *); /* All pools are subpools of permanent_pool */ -API_EXPORT(void) ap_destroy_pool(pool *); + pool *ap_init_alloc(void); /* Set up everything */ + API_EXPORT(pool *) ap_make_sub_pool(pool *); /* All pools are subpools of permanent_pool */ + API_EXPORT(void) ap_destroy_pool(pool *); /* used to guarantee to the pool debugging code that the sub pool will not be * destroyed before the parent pool @@ -104,58 +104,65 @@ API_EXPORT(void) ap_destroy_pool(pool *); #endif #define ap_pool_join(a,b) #else -API_EXPORT(void) ap_pool_join(pool *p, pool *sub); -API_EXPORT(pool *) ap_find_pool(const void *ts); -API_EXPORT(int) ap_pool_is_ancestor(pool *a, pool *b); + API_EXPORT(void) ap_pool_join(pool * p, pool * sub); + API_EXPORT(pool *) ap_find_pool(const void *ts); + API_EXPORT(int) ap_pool_is_ancestor(pool * a, pool * b); #endif /* Clearing out EVERYTHING in an pool... destroys any sub-pools */ -API_EXPORT(void) ap_clear_pool(struct pool *); + API_EXPORT(void) ap_clear_pool(struct pool *); /* Preparing for exec() --- close files, etc., but *don't* flush I/O * buffers, *don't* wait for subprocesses, and *don't* free any memory. */ -API_EXPORT(void) ap_cleanup_for_exec(void); + API_EXPORT(void) ap_cleanup_for_exec(void); /* routines to allocate memory from an pool... */ -API_EXPORT(void *) ap_palloc(struct pool *, int nbytes); -API_EXPORT(void *) ap_pcalloc(struct pool *, int nbytes); -API_EXPORT(char *) ap_pstrdup(struct pool *, const char *s); + API_EXPORT(void *) ap_palloc(struct pool *, int nbytes); + API_EXPORT(void *) ap_pcalloc(struct pool *, int nbytes); + API_EXPORT(char *) ap_pstrdup(struct pool *, const char *s); /* make a nul terminated copy of the n characters starting with s */ -API_EXPORT(char *) ap_pstrndup(struct pool *, const char *s, int n); -API_EXPORT_NONSTD(char *) ap_pstrcat(struct pool *,...); /* all '...' must be char* */ -API_EXPORT_NONSTD(char *) ap_psprintf(struct pool *, const char *fmt, ...) - __attribute__((format(printf,2,3))); -API_EXPORT(char *) ap_pvsprintf(struct pool *, const char *fmt, va_list); + API_EXPORT(char *) ap_pstrndup(struct pool *, const char *s, int n); + API_EXPORT_NONSTD(char *) ap_pstrcat(struct pool *, ...); /* all '...' must be char* */ + API_EXPORT_NONSTD(char *) ap_psprintf(struct pool *, const char *fmt, + ...) + __attribute__ ((format(printf, 2, 3))); + API_EXPORT(char *) ap_pvsprintf(struct pool *, const char *fmt, + va_list); /* array and alist management... keeping lists of things. * Common enough to want common support code ... */ -typedef struct { - ap_pool *pool; - int elt_size; - int nelts; - int nalloc; - char *elts; -} array_header; - -API_EXPORT(array_header *) ap_make_array(pool *p, int nelts, int elt_size); -API_EXPORT(void *) ap_push_array(array_header *); -API_EXPORT(void) ap_array_cat(array_header *dst, const array_header *src); -API_EXPORT(array_header *) ap_append_arrays(pool *, const array_header *, - const array_header *); + typedef struct { + ap_pool *pool; + int elt_size; + int nelts; + int nalloc; + char *elts; + } array_header; + + API_EXPORT(array_header *) ap_make_array(pool * p, int nelts, + int elt_size); + API_EXPORT(void *) ap_push_array(array_header *); + API_EXPORT(void) ap_array_cat(array_header * dst, + const array_header * src); + API_EXPORT(array_header *) ap_append_arrays(pool *, + const array_header *, + const array_header *); /* copy_array copies the *entire* array. copy_array_hdr just copies * the header, and arranges for the elements to be copied if (and only * if) the code subsequently does a push or arraycat. */ -API_EXPORT(array_header *) ap_copy_array(pool *p, const array_header *src); -API_EXPORT(array_header *) ap_copy_array_hdr(pool *p, const array_header *src); + API_EXPORT(array_header *) ap_copy_array(pool * p, + const array_header * src); + API_EXPORT(array_header *) ap_copy_array_hdr(pool * p, + const array_header * src); /* Tables. Implemented alist style, for now, though we try to keep @@ -167,30 +174,38 @@ API_EXPORT(array_header *) ap_copy_array_hdr(pool *p, const array_header *src); * currently being used... */ -typedef struct table table; - -typedef struct { - char *key; /* maybe NULL in future; - * check when iterating thru table_elts - */ - char *val; -} table_entry; - -API_EXPORT(table *) ap_make_table(pool *p, int nelts); -API_EXPORT(table *) ap_copy_table(pool *p, const table *); -API_EXPORT(void) ap_clear_table(table *); -API_EXPORT(const char *) ap_table_get(const table *, const char *); -API_EXPORT(void) ap_table_set(table *, const char *name, const char *val); -API_EXPORT(void) ap_table_setn(table *, const char *name, const char *val); -API_EXPORT(void) ap_table_merge(table *, const char *name, const char *more_val); -API_EXPORT(void) ap_table_mergen(table *, const char *name, const char *more_val); -API_EXPORT(void) ap_table_unset(table *, const char *key); -API_EXPORT(void) ap_table_add(table *, const char *name, const char *val); -API_EXPORT(void) ap_table_addn(table *, const char *name, const char *val); -API_EXPORT(void) ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, - const table *t,...); - -API_EXPORT(table *) ap_overlay_tables(pool *p, const table *overlay, const table *base); + typedef struct table table; + + typedef struct { + char *key; /* maybe NULL in future; + * check when iterating thru table_elts + */ + char *val; + } table_entry; + + API_EXPORT(table *) ap_make_table(pool * p, int nelts); + API_EXPORT(table *) ap_copy_table(pool * p, const table *); + API_EXPORT(void) ap_clear_table(table *); + API_EXPORT(const char *) ap_table_get(const table *, const char *); + API_EXPORT(void) ap_table_set(table *, const char *name, + const char *val); + API_EXPORT(void) ap_table_setn(table *, const char *name, + const char *val); + API_EXPORT(void) ap_table_merge(table *, const char *name, + const char *more_val); + API_EXPORT(void) ap_table_mergen(table *, const char *name, + const char *more_val); + API_EXPORT(void) ap_table_unset(table *, const char *key); + API_EXPORT(void) ap_table_add(table *, const char *name, + const char *val); + API_EXPORT(void) ap_table_addn(table *, const char *name, + const char *val); + API_EXPORT(void) + ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, + const table * t, ...); + + API_EXPORT(table *) ap_overlay_tables(pool * p, const table * overlay, + const table * base); /* XXX: these know about the definition of struct table in alloc.c. That * definition is not here because it is supposed to be private, and by not @@ -222,16 +237,18 @@ API_EXPORT(table *) ap_overlay_tables(pool *p, const table *overlay, const table * unblock_alarms() below... */ -API_EXPORT(void) ap_register_cleanup(pool *p, void *data, - void (*plain_cleanup) (void *), - void (*child_cleanup) (void *)); + API_EXPORT(void) ap_register_cleanup(pool * p, void *data, + void (*plain_cleanup) (void *), + void (*child_cleanup) (void *)); -API_EXPORT(void) ap_kill_cleanup(pool *p, void *data, void (*plain_cleanup) (void *)); -API_EXPORT(void) ap_run_cleanup(pool *p, void *data, void (*cleanup) (void *)); + API_EXPORT(void) ap_kill_cleanup(pool * p, void *data, + void (*plain_cleanup) (void *)); + API_EXPORT(void) ap_run_cleanup(pool * p, void *data, + void (*cleanup) (void *)); /* A "do-nothing" cleanup, for register_cleanup; it's faster to do * things this way than to test for NULL. */ -API_EXPORT_NONSTD(void) ap_null_cleanup(void *data); + API_EXPORT_NONSTD(void) ap_null_cleanup(void *data); /* The time between when a resource is actually allocated, and when it * its cleanup is registered is a critical section, during which the @@ -243,45 +260,48 @@ API_EXPORT_NONSTD(void) ap_null_cleanup(void *data); * up with timeout handling in general... */ -API_EXPORT(void) ap_block_alarms(void); -API_EXPORT(void) ap_unblock_alarms(void); + API_EXPORT(void) ap_block_alarms(void); + API_EXPORT(void) ap_unblock_alarms(void); /* Common cases which want utility support.. * the note_cleanups_for_foo routines are for */ -API_EXPORT(FILE *) ap_pfopen(struct pool *, const char *name, const char *fmode); -API_EXPORT(FILE *) ap_pfdopen(struct pool *, int fd, const char *fmode); -API_EXPORT(int) ap_popenf(struct pool *, const char *name, int flg, int mode); + API_EXPORT(FILE *) ap_pfopen(struct pool *, const char *name, + const char *fmode); + API_EXPORT(FILE *) ap_pfdopen(struct pool *, int fd, const char *fmode); + API_EXPORT(int) ap_popenf(struct pool *, const char *name, int flg, + int mode); -API_EXPORT(void) ap_note_cleanups_for_file(pool *, FILE *); -API_EXPORT(void) ap_note_cleanups_for_fd(pool *, int); + API_EXPORT(void) ap_note_cleanups_for_file(pool *, FILE *); + API_EXPORT(void) ap_note_cleanups_for_fd(pool *, int); #ifdef WIN32 -API_EXPORT(void) ap_note_cleanups_for_h(pool *, HANDLE); + API_EXPORT(void) ap_note_cleanups_for_h(pool *, HANDLE); #endif -API_EXPORT(void) ap_kill_cleanups_for_fd(pool *p, int fd); + API_EXPORT(void) ap_kill_cleanups_for_fd(pool * p, int fd); -API_EXPORT(void) ap_note_cleanups_for_socket(pool *, int); -API_EXPORT(void) ap_kill_cleanups_for_socket(pool *p, int sock); -API_EXPORT(int) ap_psocket(pool *p, int, int, int); -API_EXPORT(int) ap_pclosesocket(pool *a, int sock); + API_EXPORT(void) ap_note_cleanups_for_socket(pool *, int); + API_EXPORT(void) ap_kill_cleanups_for_socket(pool * p, int sock); + API_EXPORT(int) ap_psocket(pool * p, int, int, int); + API_EXPORT(int) ap_pclosesocket(pool * a, int sock); -API_EXPORT(regex_t *) ap_pregcomp(pool *p, const char *pattern, int cflags); -API_EXPORT(void) ap_pregfree(pool *p, regex_t * reg); + API_EXPORT(regex_t *) ap_pregcomp(pool * p, const char *pattern, + int cflags); + API_EXPORT(void) ap_pregfree(pool * p, regex_t * reg); /* routines to note closes... file descriptors are constrained enough * on some systems that we want to support this. */ -API_EXPORT(int) ap_pfclose(struct pool *, FILE *); -API_EXPORT(int) ap_pclosef(struct pool *, int fd); + API_EXPORT(int) ap_pfclose(struct pool *, FILE *); + API_EXPORT(int) ap_pclosef(struct pool *, int fd); #ifdef WIN32 -API_EXPORT(int) ap_pcloseh(struct pool *, HANDLE hDevice); + API_EXPORT(int) ap_pcloseh(struct pool *, HANDLE hDevice); #endif /* routines to deal with directories */ -API_EXPORT(DIR *) ap_popendir(pool *p, const char *name); -API_EXPORT(void) ap_pclosedir(pool *p, DIR * d); + API_EXPORT(DIR *) ap_popendir(pool * p, const char *name); + API_EXPORT(void) ap_pclosedir(pool * p, DIR * d); /* ... even child processes (which we may want to wait for, * or to kill outright, on unexpected termination). @@ -293,21 +313,21 @@ API_EXPORT(void) ap_pclosedir(pool *p, DIR * d); * to call in the child, and an argument to be passed to the function. */ -enum kill_conditions { - kill_never, /* process is never sent any signals */ - kill_always, /* process is sent SIGKILL on pool cleanup */ - kill_after_timeout, /* SIGTERM, wait 3 seconds, SIGKILL */ - just_wait, /* wait forever for the process to complete */ - kill_only_once /* send SIGTERM and then wait */ -}; - -typedef struct child_info child_info; -API_EXPORT(void) ap_note_subprocess(pool *a, int pid, - enum kill_conditions how); -API_EXPORT(int) ap_spawn_child(pool *, int (*)(void *, child_info *), - void *, enum kill_conditions, - FILE **pipe_in, FILE **pipe_out, - FILE **pipe_err); + enum kill_conditions { + kill_never, /* process is never sent any signals */ + kill_always, /* process is sent SIGKILL on pool cleanup */ + kill_after_timeout, /* SIGTERM, wait 3 seconds, SIGKILL */ + just_wait, /* wait forever for the process to complete */ + kill_only_once /* send SIGTERM and then wait */ + }; + + typedef struct child_info child_info; + API_EXPORT(void) ap_note_subprocess(pool * a, int pid, + enum kill_conditions how); + API_EXPORT(int) ap_spawn_child(pool *, int (*)(void *, child_info *), + void *, enum kill_conditions, + FILE ** pipe_in, FILE ** pipe_out, + FILE ** pipe_err); /* magic numbers --- min free bytes to consider a free pool block useable, * and the min amount to allocate if we have to go to malloc() */ @@ -321,11 +341,10 @@ API_EXPORT(int) ap_spawn_child(pool *, int (*)(void *, child_info *), /* Finally, some accounting */ -API_EXPORT(long) ap_bytes_in_pool(pool *p); -API_EXPORT(long) ap_bytes_in_free_blocks(void); + API_EXPORT(long) ap_bytes_in_pool(pool * p); + API_EXPORT(long) ap_bytes_in_free_blocks(void); #ifdef __cplusplus } #endif - -#endif /* !APACHE_ALLOC_H */ +#endif /* !APACHE_ALLOC_H */ diff --git a/src/afsweb/apache_includes/1.3.1/ap.h b/src/afsweb/apache_includes/1.3.1/ap.h index b1bcdc5bc..b5b34d81a 100644 --- a/src/afsweb/apache_includes/1.3.1/ap.h +++ b/src/afsweb/apache_includes/1.3.1/ap.h @@ -65,12 +65,12 @@ extern "C" { #endif -API_EXPORT(char *) ap_cpystrn(char *, const char *, size_t); -int ap_slack(int, int); -API_EXPORT(int) ap_snprintf(char *, size_t, const char *, ...); -API_EXPORT(int) ap_vsnprintf(char *, size_t, const char *, va_list ap); -int ap_execle(const char *, const char *, ...); -int ap_execve(const char *, const char *argv[], const char *envp[]); + API_EXPORT(char *) ap_cpystrn(char *, const char *, size_t); + int ap_slack(int, int); + API_EXPORT(int) ap_snprintf(char *, size_t, const char *, ...); + API_EXPORT(int) ap_vsnprintf(char *, size_t, const char *, va_list ap); + int ap_execle(const char *, const char *, ...); + int ap_execve(const char *, const char *argv[], const char *envp[]); /* small utility macros to make things easier to read */ @@ -82,7 +82,7 @@ int ap_execve(const char *, const char *argv[], const char *envp[]); #else #define ap_killpg(x, y) (killpg ((x), (y))) #endif -#endif /* WIN32 */ +#endif /* WIN32 */ /* ap_vformatter() is a generic printf-style formatting routine * with some extensions. The extensions are: @@ -133,13 +133,14 @@ int ap_execve(const char *, const char *argv[], const char *envp[]); * or until ap_vformatter returns. */ -typedef struct { - char *curpos; - char *endpos; -} ap_vformatter_buff; + typedef struct { + char *curpos; + char *endpos; + } ap_vformatter_buff; -API_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff *), - ap_vformatter_buff *, const char *fmt, va_list ap); + API_EXPORT(int) ap_vformatter(int (*flush_func) (ap_vformatter_buff *), + ap_vformatter_buff *, const char *fmt, + va_list ap); /* These are snprintf implementations based on ap_vformatter(). * @@ -156,13 +157,13 @@ API_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff *), * to distinguish between an output which was truncated, and an output which * exactly filled the buffer. */ -API_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format,...) - __attribute__((format(printf,3,4))); -API_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, - va_list ap); + API_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format, + ...) + __attribute__ ((format(printf, 3, 4))); + API_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, + va_list ap); #ifdef __cplusplus } #endif - -#endif /* !APACHE_AP_H */ +#endif /* !APACHE_AP_H */ diff --git a/src/afsweb/apache_includes/1.3.1/ap_compat.h b/src/afsweb/apache_includes/1.3.1/ap_compat.h index 23c8b04da..b08484234 100644 --- a/src/afsweb/apache_includes/1.3.1/ap_compat.h +++ b/src/afsweb/apache_includes/1.3.1/ap_compat.h @@ -415,6 +415,4 @@ extern "C" { #ifdef __cplusplus } #endif - -#endif /* !AP_COMPAT_H */ - +#endif /* !AP_COMPAT_H */ diff --git a/src/afsweb/apache_includes/1.3.1/ap_config.h b/src/afsweb/apache_includes/1.3.1/ap_config.h index d12a44bb0..7bcad2ce4 100644 --- a/src/afsweb/apache_includes/1.3.1/ap_config.h +++ b/src/afsweb/apache_includes/1.3.1/ap_config.h @@ -85,7 +85,7 @@ stat() properly */ #ifdef WIN32 /* include process.h first so we can override spawn[lv]e* properly */ #include -#include "../os/win32/os.h" +#include "os/win32/os.h" #else #include "os.h" #endif @@ -96,15 +96,15 @@ stat() properly */ /* Define one of these according to your system. */ #if defined(MINT) -typedef int rlim_t; + typedef int rlim_t; #define JMP_BUF sigjmp_buf #define NO_LONG_DOUBLE #define USE_FLOCK_SERIALIZED_ACCEPT #define _BSD_SOURCE #define EAGAIN EWOULDBLOCK -int initgroups (char *, int); -char *crypt (const char *pw, const char *salt); -int gethostname (char *name, int namelen); + int initgroups(char *, int); + char *crypt(const char *pw, const char *salt); + int gethostname(char *name, int namelen); #elif defined(MPE) #include @@ -113,15 +113,15 @@ int gethostname (char *name, int namelen); #define NO_WRITEV #define HAVE_SHMGET 1 #define USE_SHMGET_SCOREBOARD -#define SHM_R 0400 /* Read permission */ -#define SHM_W 0200 /* Write permission */ +#define SHM_R 0400 /* Read permission */ +#define SHM_W 0200 /* Write permission */ #define NEED_INITGROUPS #define NEED_STRCASECMP #define NEED_STRDUP #define NEED_STRNCASECMP -extern void GETPRIVMODE(); -extern void GETUSERMODE(); -extern char *inet_ntoa(); + extern void GETPRIVMODE(); + extern void GETUSERMODE(); + extern char *inet_ntoa(); #define NO_SLACK #define NO_GETTIMEOFDAY #define S_IEXEC S_IXUSR @@ -133,14 +133,14 @@ extern char *inet_ntoa(); #define HAVE_GMTOFF 1 #undef NO_KILLPG #undef NO_SETSID -char *crypt(const char *pw, const char *salt); -char *mktemp(char *template); + char *crypt(const char *pw, const char *salt); + char *mktemp(char *template); #define HAVE_MMAP 1 #define USE_MMAP_SCOREBOARD #define USE_MMAP_FILES #include #define NEED_STRERROR -typedef int rlim_t; + typedef int rlim_t; #ifndef HAVE_MEMMOVE #define memmove(a,b,c) memcpy(a, b, c) #endif @@ -164,8 +164,8 @@ typedef int rlim_t; /* AFS Websecure tweak to compile on Linux */ #if ! defined(AIX) && ! defined(HAVE_UNISTD_H) -int gethostname(char *name, int namelen); -#endif /* ! defined(AIX) && ! defined(HAVE_UNISTD_H) */ + int gethostname(char *name, int namelen); +#endif /* ! defined(AIX) && ! defined(HAVE_UNISTD_H) */ #define HAVE_SYSLOG 1 #define SYS_SIGLIST _sys_siglist @@ -212,7 +212,7 @@ int gethostname(char *name, int namelen); #define HAVE_SYSLOG 1 #ifndef HPUX10 #define SELECT_NEEDS_CAST -typedef int rlim_t; + typedef int rlim_t; #endif #elif defined(HPUX11) @@ -249,7 +249,7 @@ typedef int rlim_t; #define DEFAULT_USER "nobody" #endif #ifdef NEED_RLIM_T -typedef int rlim_t; + typedef int rlim_t; #endif #define USE_FCNTL_SERIALIZED_ACCEPT #ifdef USEBCOPY @@ -291,7 +291,7 @@ typedef int rlim_t; #define USE_MMAP_FILES #define NO_LONG_DOUBLE #define HAVE_SYSLOG 1 -typedef int rlim_t; + typedef int rlim_t; #elif defined(SEQUENT) #define HAVE_GMTOFF 1 @@ -301,7 +301,7 @@ typedef int rlim_t; #define HAVE_SYSLOG 1 #elif defined(NEXT) -typedef unsigned short mode_t; + typedef unsigned short mode_t; #define HAVE_GMTOFF 1 #undef NO_KILLPG #define NO_SETSID @@ -344,9 +344,9 @@ typedef unsigned short mode_t; #ifndef S_IWOTH #define S_IWOTH 000002 #ifndef rlim_t -typedef int rlim_t; + typedef int rlim_t; #endif -typedef u_long n_long; + typedef u_long n_long; #endif #define STDIN_FILENO 0 @@ -359,7 +359,7 @@ typedef u_long n_long; #define WEXITSTATUS(status) (int)( WIFEXITED(status) ? ( (status).w_retcode ) : -1) #define WTERMSIG(status) (int)( (status).w_termsig ) -typedef int pid_t; + typedef int pid_t; #define USE_LONGJMP #define NO_USE_SIGACTION #define HAVE_SYSLOG 1 @@ -401,7 +401,7 @@ typedef int pid_t; /* glibc 2.1 and later finally define rlim_t */ #if !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1) -typedef int rlim_t; + typedef int rlim_t; #endif /* flock is faster ... but hasn't been tested on 1.x systems */ @@ -440,23 +440,23 @@ typedef int rlim_t; /* Although SCO 5 defines these in (note the "s") they don't have consts. Sigh. */ -extern int strcasecmp(const char *, const char *); -extern int strncasecmp(const char *, const char *, unsigned); + extern int strcasecmp(const char *, const char *); + extern int strncasecmp(const char *, const char *, unsigned); #elif defined(AUX3) /* These are to let -Wall compile more cleanly */ -extern int strcasecmp(const char *, const char *); -extern int strncasecmp(const char *, const char *, unsigned); -extern int set42sig(), getopt(), getpeername(); -extern int listen(), bind(), socket(), getsockname(); -extern int accept(), gethostname(), connect(), lstat(); -extern int select(), killpg(), shutdown(); -extern int initgroups(), setsockopt(); -extern char *shmat(); -extern int shmctl(); -extern int shmget(); -extern char *sbrk(); -extern char *crypt(); + extern int strcasecmp(const char *, const char *); + extern int strncasecmp(const char *, const char *, unsigned); + extern int set42sig(), getopt(), getpeername(); + extern int listen(), bind(), socket(), getsockname(); + extern int accept(), gethostname(), connect(), lstat(); + extern int select(), killpg(), shutdown(); + extern int initgroups(), setsockopt(); + extern char *shmat(); + extern int shmctl(); + extern int shmget(); + extern char *sbrk(); + extern char *crypt(); #include #undef HAVE_GMTOFF #undef NO_KILLPG @@ -488,8 +488,8 @@ extern char *crypt(); #define NEED_STRCASECMP #ifndef ENCORE #define NEED_STRNCASECMP -#endif /* ENCORE */ -#endif /* MPRAS */ +#endif /* ENCORE */ +#endif /* MPRAS */ /* A lot of SVR4 systems need this */ #ifndef USE_SYSVSEM_SERIALIZED_ACCEPT #define USE_FCNTL_SERIALIZED_ACCEPT @@ -498,9 +498,9 @@ extern char *crypt(); #define NET_SIZE_T size_t #define HAVE_SHMGET 1 #define USE_SHMGET_SCOREBOARD -#ifdef _OSD_POSIX /* BS2000-POSIX mainframe needs initgroups */ +#ifdef _OSD_POSIX /* BS2000-POSIX mainframe needs initgroups */ #define NEED_INITGROUPS -#define NEED_HASHBANG_EMUL /* execve() doesn't start shell scripts by default */ +#define NEED_HASHBANG_EMUL /* execve() doesn't start shell scripts by default */ #undef HAVE_SHMGET #undef USE_SHMGET_SCOREBOARD #undef bzero @@ -575,7 +575,7 @@ extern char *crypt(); #define WTERMSIG(status) (int)((status).w_termsig) #define strftime(buf,bufsize,fmt,tm) ascftime(buf,fmt,tm) #include -#include +#include #elif defined(APOLLO) #undef HAVE_GMTOFF @@ -601,7 +601,7 @@ extern char *crypt(); #endif #if defined(__bsdi__) || \ (defined(__FreeBSD_version) && (__FreeBSD_version < 220000)) -typedef quad_t rlim_t; + typedef quad_t rlim_t; #endif #define USE_FLOCK_SERIALIZED_ACCEPT #define HAVE_SYSLOG 1 @@ -609,10 +609,10 @@ typedef quad_t rlim_t; #elif defined(QNX) #ifndef crypt -char *crypt(const char *pw, const char *salt); + char *crypt(const char *pw, const char *salt); #endif #ifndef initgroups -int initgroups(char *, int); + int initgroups(char *, int); #endif #ifndef strncasecmp #define strncasecmp strnicmp @@ -640,8 +640,8 @@ int initgroups(char *, int); #undef NO_SETSID #undef NO_USE_SIGACTION #undef NO_LINGCLOSE -extern char *crypt(char *pw, char *salt); -typedef int rlim_t; + extern char *crypt(char *pw, char *salt); + typedef int rlim_t; #define HAVE_SYSLOG 1 #elif defined(UXPDS) @@ -675,7 +675,7 @@ typedef int rlim_t; #define NO_RELIABLE_PIPED_LOGS #elif defined(__MACHTEN__) -typedef int rlim_t; + typedef int rlim_t; #undef NO_KILLPG #define NO_SETSID #define HAVE_GMTOFF 1 @@ -708,7 +708,7 @@ typedef int rlim_t; #define NO_TIMEZONE #include #include -typedef int rlim_t; + typedef int rlim_t; #elif defined(ISC) #include @@ -731,13 +731,13 @@ typedef int rlim_t; #include #include #include -typedef int pid_t; -typedef int rlim_t; -typedef int mode_t; + typedef int pid_t; + typedef int rlim_t; + typedef int mode_t; #elif defined(RISCIX) #include -typedef int rlim_t; + typedef int rlim_t; #define NO_USE_SIGACTION #define USE_LONGJMP #define NEED_STRCASECMP @@ -856,7 +856,7 @@ typedef int rlim_t; #include #ifdef HAVE_SYS_SELECT_H #include -#endif /* HAVE_SYS_SELECT_H */ +#endif /* HAVE_SYS_SELECT_H */ #include #include #include @@ -873,12 +873,12 @@ typedef int rlim_t; #define O_BINARY (0) #endif -#else /* WIN32 */ +#else /* WIN32 */ #include #include #include #include -#endif /* ndef WIN32 */ +#endif /* ndef WIN32 */ #include /* for ctime */ #include @@ -892,7 +892,7 @@ typedef int rlim_t; #endif #ifdef WIN32 -#include "../include/hsregex.h" +#include "include/hsregex.h" #elif defined(USE_HSREGEX) #include "hsregex.h" #else @@ -902,8 +902,8 @@ typedef int rlim_t; #ifdef HAVE_SYS_RESOURCE_H #include #ifdef SUNOS4 -int getrlimit(int, struct rlimit *); -int setrlimit(int, struct rlimit *); + int getrlimit(int, struct rlimit *); + int setrlimit(int, struct rlimit *); #endif #endif #ifdef USE_MMAP_SCOREBOARD @@ -952,7 +952,7 @@ int setrlimit(int, struct rlimit *); * Replace signal function with sigaction equivalent */ #ifndef NO_USE_SIGACTION -typedef void Sigfunc(int); + typedef void Sigfunc(int); #if defined(SIG_IGN) && !defined(SIG_ERR) #define SIG_ERR ((Sigfunc *)-1) @@ -965,7 +965,7 @@ typedef void Sigfunc(int); #undef signal #endif #define signal(s,f) ap_signal(s,f) -Sigfunc *signal(int signo, Sigfunc * func); + Sigfunc *signal(int signo, Sigfunc * func); #endif #include @@ -1009,9 +1009,9 @@ Sigfunc *signal(int signo, Sigfunc * func); * with a HASHBANG (#!) followed by interpreter name and args, define this. */ #ifdef NEED_HASHBANG_EMUL -extern int ap_execle(const char *filename, const char *arg,...); -extern int ap_execve(const char *filename, const char *argv[], - const char *envp[]); + extern int ap_execle(const char *filename, const char *arg, ...); + extern int ap_execve(const char *filename, const char *argv[], + const char *envp[]); /* ap_execle() is a wrapper function around ap_execve(). */ #define execle ap_execle #define execve(path,argv,envp) ap_execve(path,argv,envp) @@ -1030,18 +1030,18 @@ extern int ap_execve(const char *filename, const char *argv[], #define XtOffset(p_type,field) \ (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) -#else /* !CRAY2 */ +#else /* !CRAY2 */ #define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field)) -#endif /* !CRAY2 */ -#endif /* __STDC__ */ -#else /* ! (CRAY || __arm) */ +#endif /* !CRAY2 */ +#endif /* __STDC__ */ +#else /* ! (CRAY || __arm) */ #define XtOffset(p_type,field) \ ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) -#endif /* !CRAY */ +#endif /* !CRAY */ #ifdef offsetof #define XtOffsetOf(s_type,field) offsetof(s_type,field) @@ -1088,82 +1088,82 @@ extern int ap_execve(const char *filename, const char *argv[], * currently (13Nov97) used. */ -int getopt(int, char **, char *); - -int strcasecmp(const char *, const char *); -int strncasecmp(const char *, const char *, int); -int toupper(int); -int tolower(int); - -int printf(char *,...); -int fprintf(FILE *, char *,...); -int fputs(char *, FILE *); -int fread(char *, int, int, FILE *); -int fwrite(char *, int, int, FILE *); -int fgetc(FILE *); -char *fgets(char *s, int, FILE*); -int fflush(FILE *); -int fclose(FILE *); -int ungetc(int, FILE *); -int _filbuf(FILE *); /* !!! */ -int _flsbuf(unsigned char, FILE *); /* !!! */ -int sscanf(char *, char *,...); -void setbuf(FILE *, char *); -void perror(char *); - -time_t time(time_t *); -int strftime(char *, int, const char *, struct tm *); - -int initgroups(char *, int); -int wait3(int *, int, void *); /* Close enough for us... */ -int lstat(const char *, struct stat *); -int stat(const char *, struct stat *); -int flock(int, int); + int getopt(int, char **, char *); + + int strcasecmp(const char *, const char *); + int strncasecmp(const char *, const char *, int); + int toupper(int); + int tolower(int); + + int printf(char *, ...); + int fprintf(FILE *, char *, ...); + int fputs(char *, FILE *); + int fread(char *, int, int, FILE *); + int fwrite(char *, int, int, FILE *); + int fgetc(FILE *); + char *fgets(char *s, int, FILE *); + int fflush(FILE *); + int fclose(FILE *); + int ungetc(int, FILE *); + int _filbuf(FILE *); /* !!! */ + int _flsbuf(unsigned char, FILE *); /* !!! */ + int sscanf(char *, char *, ...); + void setbuf(FILE *, char *); + void perror(char *); + + time_t time(time_t *); + int strftime(char *, int, const char *, struct tm *); + + int initgroups(char *, int); + int wait3(int *, int, void *); /* Close enough for us... */ + int lstat(const char *, struct stat *); + int stat(const char *, struct stat *); + int flock(int, int); #ifndef NO_KILLPG -int killpg(int, int); + int killpg(int, int); #endif -int socket(int, int, int); -int setsockopt(int, int, int, const char *, int); -int listen(int, int); -int bind(int, struct sockaddr *, int); -int connect(int, struct sockaddr *, int); -int accept(int, struct sockaddr *, int *); -int shutdown(int, int); + int socket(int, int, int); + int setsockopt(int, int, int, const char *, int); + int listen(int, int); + int bind(int, struct sockaddr *, int); + int connect(int, struct sockaddr *, int); + int accept(int, struct sockaddr *, int *); + int shutdown(int, int); -int getsockname(int s, struct sockaddr *name, int *namelen); -int getpeername(int s, struct sockaddr *name, int *namelen); -int gethostname(char *name, int namelen); -void syslog(int, char *,...); -char *mktemp(char *); + int getsockname(int s, struct sockaddr *name, int *namelen); + int getpeername(int s, struct sockaddr *name, int *namelen); + int gethostname(char *name, int namelen); + void syslog(int, char *, ...); + char *mktemp(char *); -long vfprintf(FILE *, const char *, va_list); + long vfprintf(FILE *, const char *, va_list); -#endif /* SUNOS_LIB_PROTOTYPES */ +#endif /* SUNOS_LIB_PROTOTYPES */ /* The assumption is that when the functions are missing, * then there's no matching prototype available either. * Declare what is needed exactly as the replacement routines implement it. */ #ifdef NEED_STRDUP -extern char *strdup (const char *str); + extern char *strdup(const char *str); #endif #ifdef NEED_STRCASECMP -extern int strcasecmp (const char *a, const char *b); + extern int strcasecmp(const char *a, const char *b); #endif #ifdef NEED_STRNCASECMP -extern int strncasecmp (const char *a, const char *b, int n); + extern int strncasecmp(const char *a, const char *b, int n); #endif #ifdef NEED_INITGROUPS -extern int initgroups(const char *name, gid_t basegid); + extern int initgroups(const char *name, gid_t basegid); #endif #ifdef NEED_WAITPID -extern int waitpid(pid_t pid, int *statusp, int options); + extern int waitpid(pid_t pid, int *statusp, int options); #endif #ifdef NEED_STRERROR -extern char *strerror (int err); + extern char *strerror(int err); #endif #ifdef NEED_DIFFTIME -extern double difftime(time_t time1, time_t time0); + extern double difftime(time_t time1, time_t time0); #endif #ifndef ap_wait_t @@ -1173,5 +1173,4 @@ extern double difftime(time_t time1, time_t time0); #ifdef __cplusplus } #endif - -#endif /* !AP_CONFIG_H */ +#endif /* !AP_CONFIG_H */ diff --git a/src/afsweb/apache_includes/1.3.1/ap_ctype.h b/src/afsweb/apache_includes/1.3.1/ap_ctype.h index bba58b45d..af5c34878 100644 --- a/src/afsweb/apache_includes/1.3.1/ap_ctype.h +++ b/src/afsweb/apache_includes/1.3.1/ap_ctype.h @@ -85,5 +85,4 @@ extern "C" { #ifdef __cplusplus } #endif - -#endif /* !AP_CTYPE_H */ +#endif /* !AP_CTYPE_H */ diff --git a/src/afsweb/apache_includes/1.3.1/buff.h b/src/afsweb/apache_includes/1.3.1/buff.h index a20338fa6..908186c4c 100644 --- a/src/afsweb/apache_includes/1.3.1/buff.h +++ b/src/afsweb/apache_includes/1.3.1/buff.h @@ -81,7 +81,7 @@ extern "C" { #define B_RDERR (16) /* A write error has occurred */ #define B_WRERR (32) -#ifdef B_ERROR /* in SVR4: sometimes defined in /usr/include/sys/buf.h */ +#ifdef B_ERROR /* in SVR4: sometimes defined in /usr/include/sys/buf.h */ #undef B_ERROR #endif #define B_ERROR (48) @@ -92,89 +92,90 @@ extern "C" { /* buffer is a socket */ #define B_SOCKET (256) #ifdef CHARSET_EBCDIC -#define B_ASCII2EBCDIC 0x40000000 /* Enable conversion for this buffer */ -#define B_EBCDIC2ASCII 0x80000000 /* Enable conversion for this buffer */ -#endif /*CHARSET_EBCDIC*/ +#define B_ASCII2EBCDIC 0x40000000 /* Enable conversion for this buffer */ +#define B_EBCDIC2ASCII 0x80000000 /* Enable conversion for this buffer */ +#endif /*CHARSET_EBCDIC */ -typedef struct buff_struct BUFF; + typedef struct buff_struct BUFF; -struct buff_struct { - int flags; /* flags */ - unsigned char *inptr; /* pointer to next location to read */ - int incnt; /* number of bytes left to read from input buffer; + struct buff_struct { + int flags; /* flags */ + unsigned char *inptr; /* pointer to next location to read */ + int incnt; /* number of bytes left to read from input buffer; * always 0 if had a read error */ - int outchunk; /* location of chunk header when chunking */ - int outcnt; /* number of byte put in output buffer */ - unsigned char *inbase; - unsigned char *outbase; - int bufsiz; - void (*error) (BUFF *fb, int op, void *data); - void *error_data; - long int bytes_sent; /* number of bytes actually written */ + int outchunk; /* location of chunk header when chunking */ + int outcnt; /* number of byte put in output buffer */ + unsigned char *inbase; + unsigned char *outbase; + int bufsiz; + void (*error) (BUFF * fb, int op, void *data); + void *error_data; + long int bytes_sent; /* number of bytes actually written */ - ap_pool *pool; + ap_pool *pool; /* could also put pointers to the basic I/O routines here */ - int fd; /* the file descriptor */ - int fd_in; /* input file descriptor, if different */ + int fd; /* the file descriptor */ + int fd_in; /* input file descriptor, if different */ #ifdef WIN32 - HANDLE hFH; /* Windows filehandle */ + HANDLE hFH; /* Windows filehandle */ #endif - /* transport handle, for RPC binding handle or some such */ - void *t_handle; + /* transport handle, for RPC binding handle or some such */ + void *t_handle; #ifdef B_SFIO - Sfio_t *sf_in; - Sfio_t *sf_out; + Sfio_t *sf_in; + Sfio_t *sf_out; #endif -}; + }; #ifdef B_SFIO -typedef struct { - Sfdisc_t disc; - BUFF *buff; -} apache_sfio; + typedef struct { + Sfdisc_t disc; + BUFF *buff; + } apache_sfio; -extern Sfdisc_t *bsfio_new(pool *p, BUFF *b); + extern Sfdisc_t *bsfio_new(pool * p, BUFF * b); #endif /* Options to bset/getopt */ #define BO_BYTECT (1) /* Stream creation and modification */ -API_EXPORT(BUFF *) ap_bcreate(pool *p, int flags); -API_EXPORT(void) ap_bpushfd(BUFF *fb, int fd_in, int fd_out); + API_EXPORT(BUFF *) ap_bcreate(pool * p, int flags); + API_EXPORT(void) ap_bpushfd(BUFF * fb, int fd_in, int fd_out); #ifdef WIN32 -API_EXPORT(void) ap_bpushh(BUFF *fb, HANDLE hFH); + API_EXPORT(void) ap_bpushh(BUFF * fb, HANDLE hFH); #endif -API_EXPORT(int) ap_bsetopt(BUFF *fb, int optname, const void *optval); -API_EXPORT(int) ap_bgetopt(BUFF *fb, int optname, void *optval); -API_EXPORT(int) ap_bsetflag(BUFF *fb, int flag, int value); -API_EXPORT(int) ap_bclose(BUFF *fb); + API_EXPORT(int) ap_bsetopt(BUFF * fb, int optname, const void *optval); + API_EXPORT(int) ap_bgetopt(BUFF * fb, int optname, void *optval); + API_EXPORT(int) ap_bsetflag(BUFF * fb, int flag, int value); + API_EXPORT(int) ap_bclose(BUFF * fb); #define ap_bgetflag(fb, flag) ((fb)->flags & (flag)) /* Error handling */ -API_EXPORT(void) ap_bonerror(BUFF *fb, void (*error) (BUFF *, int, void *), - void *data); + API_EXPORT(void) ap_bonerror(BUFF * fb, + void (*error) (BUFF *, int, void *), + void *data); /* I/O */ -API_EXPORT(int) ap_bread(BUFF *fb, void *buf, int nbyte); -API_EXPORT(int) ap_bgets(char *s, int n, BUFF *fb); -API_EXPORT(int) ap_blookc(char *buff, BUFF *fb); -API_EXPORT(int) ap_bskiplf(BUFF *fb); -API_EXPORT(int) ap_bwrite(BUFF *fb, const void *buf, int nbyte); -API_EXPORT(int) ap_bflush(BUFF *fb); -API_EXPORT(int) ap_bputs(const char *x, BUFF *fb); -API_EXPORT(int) ap_bvputs(BUFF *fb,...); -API_EXPORT_NONSTD(int) ap_bprintf(BUFF *fb, const char *fmt,...) - __attribute__((format(printf,2,3))); -API_EXPORT(int) ap_vbprintf(BUFF *fb, const char *fmt, va_list vlist); + API_EXPORT(int) ap_bread(BUFF * fb, void *buf, int nbyte); + API_EXPORT(int) ap_bgets(char *s, int n, BUFF * fb); + API_EXPORT(int) ap_blookc(char *buff, BUFF * fb); + API_EXPORT(int) ap_bskiplf(BUFF * fb); + API_EXPORT(int) ap_bwrite(BUFF * fb, const void *buf, int nbyte); + API_EXPORT(int) ap_bflush(BUFF * fb); + API_EXPORT(int) ap_bputs(const char *x, BUFF * fb); + API_EXPORT(int) ap_bvputs(BUFF * fb, ...); + API_EXPORT_NONSTD(int) ap_bprintf(BUFF * fb, const char *fmt, ...) + __attribute__ ((format(printf, 2, 3))); + API_EXPORT(int) ap_vbprintf(BUFF * fb, const char *fmt, va_list vlist); /* Internal routines */ -API_EXPORT(int) ap_bflsbuf(int c, BUFF *fb); -API_EXPORT(int) ap_bfilbuf(BUFF *fb); + API_EXPORT(int) ap_bflsbuf(int c, BUFF * fb); + API_EXPORT(int) ap_bfilbuf(BUFF * fb); #ifndef CHARSET_EBCDIC @@ -185,7 +186,7 @@ API_EXPORT(int) ap_bfilbuf(BUFF *fb); (fb)->outcnt == (fb)->bufsiz) ? ap_bflsbuf(c, (fb)) : \ ((fb)->outbase[(fb)->outcnt++] = (c), 0)) -#else /*CHARSET_EBCDIC*/ +#else /*CHARSET_EBCDIC */ #define ap_bgetc(fb) ( ((fb)->incnt == 0) ? ap_bfilbuf(fb) : \ ((fb)->incnt--, (fb->flags & B_ASCII2EBCDIC)\ @@ -196,41 +197,41 @@ API_EXPORT(int) ap_bfilbuf(BUFF *fb); ((fb)->outbase[(fb)->outcnt++] = (fb->flags & B_EBCDIC2ASCII)\ ?os_toascii[(unsigned char)c]:(c), 0)) -#endif /*CHARSET_EBCDIC*/ -struct child_info { +#endif /*CHARSET_EBCDIC */ + struct child_info { #ifdef WIN32 - /* - * These handles are used by ap_call_exec to call - * create process with pipe handles. - */ - HANDLE hPipeInputRead; - HANDLE hPipeOutputWrite; - HANDLE hPipeErrorWrite; + /* + * These handles are used by ap_call_exec to call + * create process with pipe handles. + */ + HANDLE hPipeInputRead; + HANDLE hPipeOutputWrite; + HANDLE hPipeErrorWrite; #else - /* - * We need to put a dummy member in here to avoid compilation - * errors under certain Unix compilers, like SGI's and HPUX's, - * which fail to compile a zero-sized struct. Of course - * it would be much nicer if there was actually a use for this - * structure under Unix. Aah the joys of x-platform code. - */ - int dummy; + /* + * We need to put a dummy member in here to avoid compilation + * errors under certain Unix compilers, like SGI's and HPUX's, + * which fail to compile a zero-sized struct. Of course + * it would be much nicer if there was actually a use for this + * structure under Unix. Aah the joys of x-platform code. + */ + int dummy; #endif -}; -API_EXPORT(int) ap_bspawn_child(pool *, int (*)(void *, child_info *), void *, - enum kill_conditions, BUFF **pipe_in, BUFF **pipe_out, - BUFF **pipe_err); + }; + API_EXPORT(int) ap_bspawn_child(pool *, int (*)(void *, child_info *), + void *, enum kill_conditions, + BUFF ** pipe_in, BUFF ** pipe_out, + BUFF ** pipe_err); /* enable non-blocking operations */ -API_EXPORT(int) ap_bnonblock(BUFF *fb, int direction); + API_EXPORT(int) ap_bnonblock(BUFF * fb, int direction); /* and get an fd to select() on */ -API_EXPORT(int) ap_bfileno(BUFF *fb, int direction); + API_EXPORT(int) ap_bfileno(BUFF * fb, int direction); /* bflush() if a read now would block, but don't actually read anything */ -API_EXPORT(void) ap_bhalfduplex(BUFF *fb); + API_EXPORT(void) ap_bhalfduplex(BUFF * fb); #ifdef __cplusplus } #endif - -#endif /* !APACHE_BUFF_H */ +#endif /* !APACHE_BUFF_H */ diff --git a/src/afsweb/apache_includes/1.3.1/http_conf_globals.h b/src/afsweb/apache_includes/1.3.1/http_conf_globals.h index 0763e6b9e..4a738b509 100644 --- a/src/afsweb/apache_includes/1.3.1/http_conf_globals.h +++ b/src/afsweb/apache_includes/1.3.1/http_conf_globals.h @@ -66,32 +66,32 @@ extern "C" { * Process config --- what the process ITSELF is doing */ -extern int ap_standalone; -extern uid_t ap_user_id; -extern char *ap_user_name; -extern gid_t ap_group_id; + extern int ap_standalone; + extern uid_t ap_user_id; + extern char *ap_user_name; + extern gid_t ap_group_id; #ifdef MULTIPLE_GROUPS -extern gid_t group_id_list[NGROUPS_MAX]; + extern gid_t group_id_list[NGROUPS_MAX]; #endif -extern int ap_max_requests_per_child; -extern int ap_threads_per_child; -extern int ap_excess_requests_per_child; -extern struct in_addr ap_bind_address; -extern listen_rec *ap_listeners; -extern int ap_daemons_to_start; -extern int ap_daemons_min_free; -extern int ap_daemons_max_free; -extern int ap_daemons_limit; -extern MODULE_VAR_EXPORT int ap_suexec_enabled; -extern int ap_listenbacklog; -extern int ap_dump_settings; + extern int ap_max_requests_per_child; + extern int ap_threads_per_child; + extern int ap_excess_requests_per_child; + extern struct in_addr ap_bind_address; + extern listen_rec *ap_listeners; + extern int ap_daemons_to_start; + extern int ap_daemons_min_free; + extern int ap_daemons_max_free; + extern int ap_daemons_limit; + extern MODULE_VAR_EXPORT int ap_suexec_enabled; + extern int ap_listenbacklog; + extern int ap_dump_settings; -extern char *ap_pid_fname; -extern char *ap_scoreboard_fname; -extern char *ap_lock_fname; -extern MODULE_VAR_EXPORT char *ap_server_argv0; + extern char *ap_pid_fname; + extern char *ap_scoreboard_fname; + extern char *ap_lock_fname; + extern MODULE_VAR_EXPORT char *ap_server_argv0; -extern enum server_token_type ap_server_tokens; + extern enum server_token_type ap_server_tokens; /* Trying to allocate these in the config pool gets us into some *nasty* * chicken-and-egg problems in http_main.c --- where do you stick them @@ -99,21 +99,20 @@ extern enum server_token_type ap_server_tokens; * statically... */ -extern API_VAR_EXPORT char ap_server_root[MAX_STRING_LEN]; -extern char ap_server_confname[MAX_STRING_LEN]; + extern API_VAR_EXPORT char ap_server_root[MAX_STRING_LEN]; + extern char ap_server_confname[MAX_STRING_LEN]; /* for -C, -c and -D switches */ -extern array_header *ap_server_pre_read_config; -extern array_header *ap_server_post_read_config; -extern array_header *ap_server_config_defines; + extern array_header *ap_server_pre_read_config; + extern array_header *ap_server_post_read_config; + extern array_header *ap_server_config_defines; /* We want this to have the least chance of being corrupted if there * is some memory corruption, so we allocate it statically. */ -extern char ap_coredump_dir[MAX_STRING_LEN]; + extern char ap_coredump_dir[MAX_STRING_LEN]; #ifdef __cplusplus } #endif - -#endif /* !APACHE_HTTP_CONF_GLOBALS_H */ +#endif /* !APACHE_HTTP_CONF_GLOBALS_H */ diff --git a/src/afsweb/apache_includes/1.3.1/httpd.h b/src/afsweb/apache_includes/1.3.1/httpd.h index 6fd0db466..ed87ca790 100644 --- a/src/afsweb/apache_includes/1.3.1/httpd.h +++ b/src/afsweb/apache_includes/1.3.1/httpd.h @@ -88,7 +88,7 @@ extern "C" { #else #define HTTPD_ROOT "/usr/local/apache" #endif -#endif /* HTTPD_ROOT */ +#endif /* HTTPD_ROOT */ /* Default location of documents. Can be overridden by the DocumentRoot * directive. @@ -100,7 +100,7 @@ extern "C" { #else #define DOCUMENT_LOCATION HTTPD_ROOT "/htdocs" #endif -#endif /* DOCUMENT_LOCATION */ +#endif /* DOCUMENT_LOCATION */ /* Max. number of dynamically loaded modules */ #ifndef DYNAMIC_MODULE_LIMIT @@ -150,7 +150,7 @@ extern "C" { #else #define DEFAULT_XFERLOG "logs/access_log" #endif -#endif /* DEFAULT_XFERLOG */ +#endif /* DEFAULT_XFERLOG */ #ifndef DEFAULT_ERRORLOG #ifdef __EMX__ @@ -159,7 +159,7 @@ extern "C" { #else #define DEFAULT_ERRORLOG "logs/error_log" #endif -#endif /* DEFAULT_ERRORLOG */ +#endif /* DEFAULT_ERRORLOG */ #ifndef DEFAULT_PIDLOG #define DEFAULT_PIDLOG "logs/httpd.pid" @@ -195,7 +195,7 @@ extern "C" { #else #define DEFAULT_ACCESS_FNAME ".htaccess" #endif -#endif /* DEFAULT_ACCESS_FNAME */ +#endif /* DEFAULT_ACCESS_FNAME */ /* The name of the server config file */ #ifndef SERVER_CONFIG_FILE @@ -239,7 +239,7 @@ extern "C" { #else #define SHELL_PATH "/bin/sh" #endif -#endif /* SHELL_PATH */ +#endif /* SHELL_PATH */ /* The path to the suExec wrapper, can be overridden in Configuration */ #ifndef SUEXEC_BIN @@ -384,15 +384,15 @@ extern "C" { #define SERVER_BASEVERSION "Apache/1.3.1" /* SEE COMMENTS ABOVE */ #define SERVER_VERSION SERVER_BASEVERSION -enum server_token_type { - SrvTk_MIN, /* eg: Apache/1.3.0 */ - SrvTk_OS, /* eg: Apache/1.3.0 (UNIX) */ - SrvTk_FULL /* eg: Apache/1.3.0 (UNIX) PHP/3.0 FooBar/1.2b */ -}; + enum server_token_type { + SrvTk_MIN, /* eg: Apache/1.3.0 */ + SrvTk_OS, /* eg: Apache/1.3.0 (UNIX) */ + SrvTk_FULL /* eg: Apache/1.3.0 (UNIX) PHP/3.0 FooBar/1.2b */ + }; -API_EXPORT(const char *) ap_get_server_version(void); -API_EXPORT(void) ap_add_version_component(const char *component); -API_EXPORT(const char *) ap_get_server_built(void); + API_EXPORT(const char *) ap_get_server_version(void); + API_EXPORT(void) ap_add_version_component(const char *component); + API_EXPORT(const char *) ap_get_server_built(void); /* Numeric release version identifier: major minor bugfix betaseq * Always increases along the same track as the source branch. @@ -506,8 +506,8 @@ API_EXPORT(const char *) ap_get_server_built(void); #define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html" #define INCLUDES_MAGIC_TYPE3 "text/x-server-parsed-html3" #ifdef CHARSET_EBCDIC -#define ASCIITEXT_MAGIC_TYPE_PREFIX "text/x-ascii-" /* Text files whose content-type starts with this are passed thru unconverted */ -#endif /*CHARSET_EBCDIC*/ +#define ASCIITEXT_MAGIC_TYPE_PREFIX "text/x-ascii-" /* Text files whose content-type starts with this are passed thru unconverted */ +#endif /*CHARSET_EBCDIC */ #define MAP_FILE_MAGIC_TYPE "application/x-type-map" #define ASIS_MAGIC_TYPE "httpd/send-as-is" #define DIR_MAGIC_TYPE "httpd/unix-directory" @@ -517,7 +517,7 @@ API_EXPORT(const char *) ap_get_server_built(void); #ifndef CHARSET_EBCDIC #define LF 10 #define CR 13 -#else /* CHARSET_EBCDIC */ +#else /* CHARSET_EBCDIC */ #include "ebcdic.h" /* OSD_POSIX uses the EBCDIC charset. The transition ASCII->EBCDIC is done in * the buff package (bread/bputs/bwrite), so everywhere else, we use @@ -528,7 +528,7 @@ API_EXPORT(const char *) ap_get_server_built(void); */ #define CR '\r' #define LF '\n' -#endif /* CHARSET_EBCDIC */ +#endif /* CHARSET_EBCDIC */ /* Possible values for request_rec.read_body (set by handling module): * REQUEST_NO_BODY Send 413 error if message has any body @@ -557,153 +557,153 @@ API_EXPORT(const char *) ap_get_server_built(void); /* This represents the result of calling htaccess; these are cached for * each request. */ -struct htaccess_result { - char *dir; /* the directory to which this applies */ - int override; /* the overrides allowed for the .htaccess file */ - void *htaccess; /* the configuration directives */ + struct htaccess_result { + char *dir; /* the directory to which this applies */ + int override; /* the overrides allowed for the .htaccess file */ + void *htaccess; /* the configuration directives */ /* the next one, or NULL if no more; N.B. never change this */ - const struct htaccess_result *next; -}; + const struct htaccess_result *next; + }; -typedef struct conn_rec conn_rec; -typedef struct server_rec server_rec; -typedef struct request_rec request_rec; -typedef struct listen_rec listen_rec; + typedef struct conn_rec conn_rec; + typedef struct server_rec server_rec; + typedef struct request_rec request_rec; + typedef struct listen_rec listen_rec; #include "util_uri.h" -struct request_rec { + struct request_rec { - ap_pool *pool; - conn_rec *connection; - server_rec *server; + ap_pool *pool; + conn_rec *connection; + server_rec *server; - request_rec *next; /* If we wind up getting redirected, + request_rec *next; /* If we wind up getting redirected, * pointer to the request we redirected to. */ - request_rec *prev; /* If this is an internal redirect, + request_rec *prev; /* If this is an internal redirect, * pointer to where we redirected *from*. */ - request_rec *main; /* If this is a sub_request (see request.h) + request_rec *main; /* If this is a sub_request (see request.h) * pointer back to the main request. */ - /* Info about the request itself... we begin with stuff that only - * protocol.c should ever touch... - */ + /* Info about the request itself... we begin with stuff that only + * protocol.c should ever touch... + */ - char *the_request; /* First line of request, so we can log it */ - int assbackwards; /* HTTP/0.9, "simple" request */ - int proxyreq; /* A proxy request (calculated during + char *the_request; /* First line of request, so we can log it */ + int assbackwards; /* HTTP/0.9, "simple" request */ + int proxyreq; /* A proxy request (calculated during * post_read_request or translate_name) */ - int header_only; /* HEAD request, as opposed to GET */ - char *protocol; /* Protocol, as given to us, or HTTP/0.9 */ - int proto_num; /* Number version of protocol; 1.1 = 1001 */ - const char *hostname; /* Host, as set by full URI or Host: */ - - time_t request_time; /* When the request started */ - - char *status_line; /* Status line, if set by script */ - int status; /* In any case */ - - /* Request method, two ways; also, protocol, etc.. Outside of protocol.c, - * look, but don't touch. - */ - - char *method; /* GET, HEAD, POST, etc. */ - int method_number; /* M_GET, M_POST, etc. */ - - /* - allowed is a bitvector of the allowed methods. - - A handler must ensure that the request method is one that - it is capable of handling. Generally modules should DECLINE - any request methods they do not handle. Prior to aborting the - handler like this the handler should set r->allowed to the list - of methods that it is willing to handle. This bitvector is used - to construct the "Allow:" header required for OPTIONS requests, - and METHOD_NOT_ALLOWED and NOT_IMPLEMENTED status codes. - - Since the default_handler deals with OPTIONS, all modules can - usually decline to deal with OPTIONS. TRACE is always allowed, - modules don't need to set it explicitly. - - Since the default_handler will always handle a GET, a - module which does *not* implement GET should probably return - METHOD_NOT_ALLOWED. Unfortunately this means that a Script GET - handler can't be installed by mod_actions. - */ - int allowed; /* Allowed methods - for 405, OPTIONS, etc */ - - int sent_bodyct; /* byte count in stream is for body */ - long bytes_sent; /* body byte count, for easy access */ - time_t mtime; /* Time the resource was last modified */ - - /* HTTP/1.1 connection-level features */ - - int chunked; /* sending chunked transfer-coding */ - int byterange; /* number of byte ranges */ - char *boundary; /* multipart/byteranges boundary */ - const char *range; /* The Range: header */ - long clength; /* The "real" content length */ - - long remaining; /* bytes left to read */ - long read_length; /* bytes that have been read */ - int read_body; /* how the request body should be read */ - int read_chunked; /* reading chunked transfer-coding */ - - /* MIME header environments, in and out. Also, an array containing - * environment variables to be passed to subprocesses, so people can - * write modules to add to that environment. - * - * The difference between headers_out and err_headers_out is that the - * latter are printed even on error, and persist across internal redirects - * (so the headers printed for ErrorDocument handlers will have them). - * - * The 'notes' table is for notes from one module to another, with no - * other set purpose in mind... - */ - - table *headers_in; - table *headers_out; - table *err_headers_out; - table *subprocess_env; - table *notes; - - /* content_type, handler, content_encoding, content_language, and all - * content_languages MUST be lowercased strings. They may be pointers - * to static strings; they should not be modified in place. - */ - const char *content_type; /* Break these out --- we dispatch on 'em */ - const char *handler; /* What we *really* dispatch on */ - - const char *content_encoding; - const char *content_language; /* for back-compat. only -- do not use */ - array_header *content_languages; /* array of (char*) */ - - int no_cache; - int no_local_copy; - - /* What object is being requested (either directly, or via include - * or content-negotiation mapping). - */ - - char *unparsed_uri; /* the uri without any parsing performed */ - char *uri; /* the path portion of the URI */ - char *filename; - char *path_info; - char *args; /* QUERY_ARGS, if any */ - struct stat finfo; /* ST_MODE set to zero if no such file */ - uri_components parsed_uri; /* components of uri, dismantled */ - - /* Various other config info which may change with .htaccess files - * These are config vectors, with one void* pointer for each module - * (the thing pointed to being the module's business). - */ - - void *per_dir_config; /* Options set in config files, etc. */ - void *request_config; /* Notes on *this* request */ + int header_only; /* HEAD request, as opposed to GET */ + char *protocol; /* Protocol, as given to us, or HTTP/0.9 */ + int proto_num; /* Number version of protocol; 1.1 = 1001 */ + const char *hostname; /* Host, as set by full URI or Host: */ + + time_t request_time; /* When the request started */ + + char *status_line; /* Status line, if set by script */ + int status; /* In any case */ + + /* Request method, two ways; also, protocol, etc.. Outside of protocol.c, + * look, but don't touch. + */ + + char *method; /* GET, HEAD, POST, etc. */ + int method_number; /* M_GET, M_POST, etc. */ + + /* + * allowed is a bitvector of the allowed methods. + * + * A handler must ensure that the request method is one that + * it is capable of handling. Generally modules should DECLINE + * any request methods they do not handle. Prior to aborting the + * handler like this the handler should set r->allowed to the list + * of methods that it is willing to handle. This bitvector is used + * to construct the "Allow:" header required for OPTIONS requests, + * and METHOD_NOT_ALLOWED and NOT_IMPLEMENTED status codes. + * + * Since the default_handler deals with OPTIONS, all modules can + * usually decline to deal with OPTIONS. TRACE is always allowed, + * modules don't need to set it explicitly. + * + * Since the default_handler will always handle a GET, a + * module which does *not* implement GET should probably return + * METHOD_NOT_ALLOWED. Unfortunately this means that a Script GET + * handler can't be installed by mod_actions. + */ + int allowed; /* Allowed methods - for 405, OPTIONS, etc */ + + int sent_bodyct; /* byte count in stream is for body */ + long bytes_sent; /* body byte count, for easy access */ + time_t mtime; /* Time the resource was last modified */ + + /* HTTP/1.1 connection-level features */ + + int chunked; /* sending chunked transfer-coding */ + int byterange; /* number of byte ranges */ + char *boundary; /* multipart/byteranges boundary */ + const char *range; /* The Range: header */ + long clength; /* The "real" content length */ + + long remaining; /* bytes left to read */ + long read_length; /* bytes that have been read */ + int read_body; /* how the request body should be read */ + int read_chunked; /* reading chunked transfer-coding */ + + /* MIME header environments, in and out. Also, an array containing + * environment variables to be passed to subprocesses, so people can + * write modules to add to that environment. + * + * The difference between headers_out and err_headers_out is that the + * latter are printed even on error, and persist across internal redirects + * (so the headers printed for ErrorDocument handlers will have them). + * + * The 'notes' table is for notes from one module to another, with no + * other set purpose in mind... + */ + + table *headers_in; + table *headers_out; + table *err_headers_out; + table *subprocess_env; + table *notes; + + /* content_type, handler, content_encoding, content_language, and all + * content_languages MUST be lowercased strings. They may be pointers + * to static strings; they should not be modified in place. + */ + const char *content_type; /* Break these out --- we dispatch on 'em */ + const char *handler; /* What we *really* dispatch on */ + + const char *content_encoding; + const char *content_language; /* for back-compat. only -- do not use */ + array_header *content_languages; /* array of (char*) */ + + int no_cache; + int no_local_copy; + + /* What object is being requested (either directly, or via include + * or content-negotiation mapping). + */ + + char *unparsed_uri; /* the uri without any parsing performed */ + char *uri; /* the path portion of the URI */ + char *filename; + char *path_info; + char *args; /* QUERY_ARGS, if any */ + struct stat finfo; /* ST_MODE set to zero if no such file */ + uri_components parsed_uri; /* components of uri, dismantled */ + + /* Various other config info which may change with .htaccess files + * These are config vectors, with one void* pointer for each module + * (the thing pointed to being the module's business). + */ + + void *per_dir_config; /* Options set in config files, etc. */ + void *request_config; /* Notes on *this* request */ /* * a linked list of the configuration directives in the .htaccess files @@ -711,52 +711,52 @@ struct request_rec { * N.B. always add to the head of the list, _never_ to the end. * that way, a sub request's list can (temporarily) point to a parent's list */ - const struct htaccess_result *htaccess; -}; + const struct htaccess_result *htaccess; + }; /* Things which are per connection */ -struct conn_rec { + struct conn_rec { - ap_pool *pool; - server_rec *server; - server_rec *base_server; /* Physical vhost this conn come in on */ - void *vhost_lookup_data; /* used by http_vhost.c */ + ap_pool *pool; + server_rec *server; + server_rec *base_server; /* Physical vhost this conn come in on */ + void *vhost_lookup_data; /* used by http_vhost.c */ - /* Information about the connection itself */ + /* Information about the connection itself */ - int child_num; /* The number of the child handling conn_rec */ - BUFF *client; /* Connection to the guy */ + int child_num; /* The number of the child handling conn_rec */ + BUFF *client; /* Connection to the guy */ - /* Who is the client? */ + /* Who is the client? */ - struct sockaddr_in local_addr; /* local address */ - struct sockaddr_in remote_addr; /* remote address */ - char *remote_ip; /* Client's IP address */ - char *remote_host; /* Client's DNS name, if known. + struct sockaddr_in local_addr; /* local address */ + struct sockaddr_in remote_addr; /* remote address */ + char *remote_ip; /* Client's IP address */ + char *remote_host; /* Client's DNS name, if known. * NULL if DNS hasn't been checked, * "" if it has and no address was found. * N.B. Only access this though * get_remote_host() */ - char *remote_logname; /* Only ever set if doing rfc1413 lookups. + char *remote_logname; /* Only ever set if doing rfc1413 lookups. * N.B. Only access this through * get_remote_logname() */ - char *user; /* If an authentication check was made, + char *user; /* If an authentication check was made, * this gets set to the user name. We assume * that there's only one user per connection(!) */ - char *ap_auth_type; /* Ditto. */ + char *ap_auth_type; /* Ditto. */ - unsigned aborted:1; /* Are we still talking? */ - signed int keepalive:2; /* Are we using HTTP Keep-Alive? + unsigned aborted:1; /* Are we still talking? */ + signed int keepalive:2; /* Are we using HTTP Keep-Alive? * -1 fatal error, 0 undecided, 1 yes */ - unsigned keptalive:1; /* Did we use HTTP Keep-Alive? */ - signed int double_reverse:2;/* have we done double-reverse DNS? - * -1 yes/failure, 0 not yet, 1 yes/success */ - int keepalives; /* How many times have we used it? */ -}; + unsigned keptalive:1; /* Did we use HTTP Keep-Alive? */ + signed int double_reverse:2; /* have we done double-reverse DNS? + * -1 yes/failure, 0 not yet, 1 yes/success */ + int keepalives; /* How many times have we used it? */ + }; /* Per-vhost config... */ @@ -765,200 +765,220 @@ struct conn_rec { */ #define DEFAULT_VHOST_ADDR 0xfffffffful -typedef struct server_addr_rec server_addr_rec; -struct server_addr_rec { - server_addr_rec *next; - struct in_addr host_addr; /* The bound address, for this server */ - unsigned short host_port; /* The bound port, for this server */ - char *virthost; /* The name given in */ -}; + typedef struct server_addr_rec server_addr_rec; + struct server_addr_rec { + server_addr_rec *next; + struct in_addr host_addr; /* The bound address, for this server */ + unsigned short host_port; /* The bound port, for this server */ + char *virthost; /* The name given in */ + }; -struct server_rec { + struct server_rec { - server_rec *next; + server_rec *next; - /* description of where the definition came from */ - const char *defn_name; - unsigned defn_line_number; + /* description of where the definition came from */ + const char *defn_name; + unsigned defn_line_number; - /* Full locations of server config info */ + /* Full locations of server config info */ - char *srm_confname; - char *access_confname; + char *srm_confname; + char *access_confname; - /* Contact information */ + /* Contact information */ - char *server_admin; - char *server_hostname; - unsigned short port; /* for redirects, etc. */ + char *server_admin; + char *server_hostname; + unsigned short port; /* for redirects, etc. */ - /* Log files --- note that transfer log is now in the modules... */ + /* Log files --- note that transfer log is now in the modules... */ - char *error_fname; - FILE *error_log; - int loglevel; + char *error_fname; + FILE *error_log; + int loglevel; - /* Module-specific configuration for server, and defaults... */ + /* Module-specific configuration for server, and defaults... */ - int is_virtual; /* true if this is the virtual server */ - void *module_config; /* Config vector containing pointers to + int is_virtual; /* true if this is the virtual server */ + void *module_config; /* Config vector containing pointers to * modules' per-server config structures. */ - void *lookup_defaults; /* MIME type info, etc., before we start + void *lookup_defaults; /* MIME type info, etc., before we start * checking per-directory info. */ - /* Transaction handling */ + /* Transaction handling */ - server_addr_rec *addrs; - int timeout; /* Timeout, in seconds, before we give up */ - int keep_alive_timeout; /* Seconds we'll wait for another request */ - int keep_alive_max; /* Maximum requests per connection */ - int keep_alive; /* Use persistent connections? */ - int send_buffer_size; /* size of TCP send buffer (in bytes) */ + server_addr_rec *addrs; + int timeout; /* Timeout, in seconds, before we give up */ + int keep_alive_timeout; /* Seconds we'll wait for another request */ + int keep_alive_max; /* Maximum requests per connection */ + int keep_alive; /* Use persistent connections? */ + int send_buffer_size; /* size of TCP send buffer (in bytes) */ - char *path; /* Pathname for ServerPath */ - int pathlen; /* Length of path */ + char *path; /* Pathname for ServerPath */ + int pathlen; /* Length of path */ - array_header *names; /* Normal names for ServerAlias servers */ - array_header *wild_names; /* Wildcarded names for ServerAlias servers */ + array_header *names; /* Normal names for ServerAlias servers */ + array_header *wild_names; /* Wildcarded names for ServerAlias servers */ - uid_t server_uid; /* effective user id when calling exec wrapper */ - gid_t server_gid; /* effective group id when calling exec wrapper */ -}; + uid_t server_uid; /* effective user id when calling exec wrapper */ + gid_t server_gid; /* effective group id when calling exec wrapper */ + }; /* These are more like real hosts than virtual hosts */ -struct listen_rec { - listen_rec *next; - struct sockaddr_in local_addr; /* local IP address and port */ - int fd; - int used; /* Only used during restart */ + struct listen_rec { + listen_rec *next; + struct sockaddr_in local_addr; /* local IP address and port */ + int fd; + int used; /* Only used during restart */ /* more stuff here, like which protocol is bound to the port */ -}; + }; /* Prototypes for utilities... util.c. */ -extern void ap_util_init(void); + extern void ap_util_init(void); /* Time */ -extern API_VAR_EXPORT const char ap_month_snames[12][4]; -extern API_VAR_EXPORT const char ap_day_snames[7][4]; + extern API_VAR_EXPORT const char ap_month_snames[12][4]; + extern API_VAR_EXPORT const char ap_day_snames[7][4]; -API_EXPORT(struct tm *) ap_get_gmtoff(int *tz); -API_EXPORT(char *) ap_get_time(void); -API_EXPORT(char *) ap_ht_time(pool *p, time_t t, const char *fmt, int gmt); -API_EXPORT(char *) ap_gm_timestr_822(pool *p, time_t t); + API_EXPORT(struct tm *) ap_get_gmtoff(int *tz); + API_EXPORT(char *) ap_get_time(void); + API_EXPORT(char *) ap_ht_time(pool * p, time_t t, const char *fmt, + int gmt); + API_EXPORT(char *) ap_gm_timestr_822(pool * p, time_t t); /* String handling. The *_nc variants allow you to use non-const char **s as arguments (unfortunately C won't automatically convert a char ** to a const char **) */ -API_EXPORT(char *) ap_getword(pool *p, const char **line, char stop); -API_EXPORT(char *) ap_getword_nc(pool *p, char **line, char stop); -API_EXPORT(char *) ap_getword_white(pool *p, const char **line); -API_EXPORT(char *) ap_getword_white_nc(pool *p, char **line); -API_EXPORT(char *) ap_getword_nulls(pool *p, const char **line, char stop); -API_EXPORT(char *) ap_getword_nulls_nc(pool *p, char **line, char stop); -API_EXPORT(char *) ap_getword_conf(pool *p, const char **line); -API_EXPORT(char *) ap_getword_conf_nc(pool *p, char **line); - -API_EXPORT(char *) ap_get_token(pool *p, const char **accept_line, int accept_white); -API_EXPORT(int) ap_find_token(pool *p, const char *line, const char *tok); -API_EXPORT(int) ap_find_last_token(pool *p, const char *line, const char *tok); - -API_EXPORT(int) ap_is_url(const char *u); -API_EXPORT(int) ap_unescape_url(char *url); -API_EXPORT(void) ap_no2slash(char *name); -API_EXPORT(void) ap_getparents(char *name); -API_EXPORT(char *) ap_escape_path_segment(pool *p, const char *s); -API_EXPORT(char *) ap_os_escape_path(pool *p, const char *path, int partial); + API_EXPORT(char *) ap_getword(pool * p, const char **line, char stop); + API_EXPORT(char *) ap_getword_nc(pool * p, char **line, char stop); + API_EXPORT(char *) ap_getword_white(pool * p, const char **line); + API_EXPORT(char *) ap_getword_white_nc(pool * p, char **line); + API_EXPORT(char *) ap_getword_nulls(pool * p, const char **line, + char stop); + API_EXPORT(char *) ap_getword_nulls_nc(pool * p, char **line, + char stop); + API_EXPORT(char *) ap_getword_conf(pool * p, const char **line); + API_EXPORT(char *) ap_getword_conf_nc(pool * p, char **line); + + API_EXPORT(char *) ap_get_token(pool * p, const char **accept_line, + int accept_white); + API_EXPORT(int) ap_find_token(pool * p, const char *line, + const char *tok); + API_EXPORT(int) ap_find_last_token(pool * p, const char *line, + const char *tok); + + API_EXPORT(int) ap_is_url(const char *u); + API_EXPORT(int) ap_unescape_url(char *url); + API_EXPORT(void) ap_no2slash(char *name); + API_EXPORT(void) ap_getparents(char *name); + API_EXPORT(char *) ap_escape_path_segment(pool * p, const char *s); + API_EXPORT(char *) ap_os_escape_path(pool * p, const char *path, + int partial); #define escape_uri(ppool,path) ap_os_escape_path(ppool,path,1) -API_EXPORT(char *) ap_escape_html(pool *p, const char *s); -API_EXPORT(char *) ap_construct_server(pool *p, const char *hostname, - unsigned port, const request_rec *r); -API_EXPORT(char *) ap_escape_shell_cmd(pool *p, const char *s); - -API_EXPORT(int) ap_count_dirs(const char *path); -API_EXPORT(char *) ap_make_dirstr_prefix(char *d, const char *s, int n); -API_EXPORT(char *) ap_make_dirstr_parent(pool *p, const char *s); + API_EXPORT(char *) ap_escape_html(pool * p, const char *s); + API_EXPORT(char *) ap_construct_server(pool * p, const char *hostname, + unsigned port, + const request_rec * r); + API_EXPORT(char *) ap_escape_shell_cmd(pool * p, const char *s); + + API_EXPORT(int) ap_count_dirs(const char *path); + API_EXPORT(char *) ap_make_dirstr_prefix(char *d, const char *s, int n); + API_EXPORT(char *) ap_make_dirstr_parent(pool * p, const char *s); /* deprecated. The previous two routines are preferred. */ -API_EXPORT(char *) ap_make_dirstr(pool *a, const char *s, int n); -API_EXPORT(char *) ap_make_full_path(pool *a, const char *dir, const char *f); - -API_EXPORT(int) ap_is_matchexp(const char *str); -API_EXPORT(int) ap_strcmp_match(const char *str, const char *exp); -API_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp); -API_EXPORT(char *) ap_uudecode(pool *, const char *); + API_EXPORT(char *) ap_make_dirstr(pool * a, const char *s, int n); + API_EXPORT(char *) ap_make_full_path(pool * a, const char *dir, + const char *f); + + API_EXPORT(int) ap_is_matchexp(const char *str); + API_EXPORT(int) ap_strcmp_match(const char *str, const char *exp); + API_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp); + API_EXPORT(char *) ap_uudecode(pool *, const char *); #ifdef __EMX__ -void os2pathname(char *path); + void os2pathname(char *path); #endif -API_EXPORT(char *) ap_pregsub(pool *p, const char *input, const char *source, - size_t nmatch, regmatch_t pmatch[]); + API_EXPORT(char *) ap_pregsub(pool * p, const char *input, + const char *source, size_t nmatch, + regmatch_t pmatch[]); -API_EXPORT(void) ap_content_type_tolower(char *); -API_EXPORT(void) ap_str_tolower(char *); -API_EXPORT(int) ap_ind(const char *, char); /* Sigh... */ -API_EXPORT(int) ap_rind(const char *, char); + API_EXPORT(void) ap_content_type_tolower(char *); + API_EXPORT(void) ap_str_tolower(char *); + API_EXPORT(int) ap_ind(const char *, char); /* Sigh... */ + API_EXPORT(int) ap_rind(const char *, char); -API_EXPORT(char *) ap_escape_quotes (pool *p, const char *instring); + API_EXPORT(char *) ap_escape_quotes(pool * p, const char *instring); /* Common structure for reading of config files / passwd files etc. */ -typedef struct { - int (*getch) (void *param); /* a getc()-like function */ - void *(*getstr) (void *buf, size_t bufsiz, void *param); /* a fgets()-like function */ - int (*close) (void *param); /* a close hander function */ - void *param; /* the argument passed to getch/getstr/close */ - const char *name; /* the filename / description */ - unsigned line_number; /* current line number, starting at 1 */ -} configfile_t; + typedef struct { + int (*getch) (void *param); /* a getc()-like function */ + void *(*getstr) (void *buf, size_t bufsiz, void *param); /* a fgets()-like function */ + int (*close) (void *param); /* a close hander function */ + void *param; /* the argument passed to getch/getstr/close */ + const char *name; /* the filename / description */ + unsigned line_number; /* current line number, starting at 1 */ + } configfile_t; /* Open a configfile_t as FILE, return open configfile_t struct pointer */ -API_EXPORT(configfile_t *) ap_pcfg_openfile(pool *p, const char *name); + API_EXPORT(configfile_t *) ap_pcfg_openfile(pool * p, const char *name); /* Allocate a configfile_t handle with user defined functions and params */ -API_EXPORT(configfile_t *) ap_pcfg_open_custom(pool *p, const char *descr, - void *param, - int(*getc_func)(void*), - void *(*gets_func) (void *buf, size_t bufsiz, void *param), - int(*close_func)(void *param)); + API_EXPORT(configfile_t *) ap_pcfg_open_custom(pool * p, + const char *descr, + void *param, + int (*getc_func) (void + *), + void *(*gets_func) (void + *buf, + size_t + bufsiz, + void + *param), + int (*close_func) (void + *param)); /* Read one line from open configfile_t, strip LF, increase line number */ -API_EXPORT(int) ap_cfg_getline(char *buf, size_t bufsize, configfile_t *cfp); + API_EXPORT(int) ap_cfg_getline(char *buf, size_t bufsize, + configfile_t * cfp); /* Read one char from open configfile_t, increase line number upon LF */ -API_EXPORT(int) ap_cfg_getc(configfile_t *cfp); + API_EXPORT(int) ap_cfg_getc(configfile_t * cfp); /* Detach from open configfile_t, calling the close handler */ -API_EXPORT(int) ap_cfg_closefile(configfile_t *cfp); + API_EXPORT(int) ap_cfg_closefile(configfile_t * cfp); #ifdef NEED_STRERROR -char *strerror(int err); + char *strerror(int err); #endif /* Misc system hackery */ -API_EXPORT(uid_t) ap_uname2id(const char *name); -API_EXPORT(gid_t) ap_gname2id(const char *name); -API_EXPORT(int) ap_is_directory(const char *name); -API_EXPORT(int) ap_can_exec(const struct stat *); -API_EXPORT(void) ap_chdir_file(const char *file); + API_EXPORT(uid_t) ap_uname2id(const char *name); + API_EXPORT(gid_t) ap_gname2id(const char *name); + API_EXPORT(int) ap_is_directory(const char *name); + API_EXPORT(int) ap_can_exec(const struct stat *); + API_EXPORT(void) ap_chdir_file(const char *file); #ifndef HAVE_CANONICAL_FILENAME #define ap_os_canonical_filename(p,f) (f) #else -API_EXPORT(char *) ap_os_canonical_filename(pool *p, const char *file); + API_EXPORT(char *) ap_os_canonical_filename(pool * p, const char *file); #endif #ifdef _OSD_POSIX -extern const char *os_set_authfile(pool *p, const char *filename); -extern int os_init_job_environment(server_rec *s, const char *user_name); -#endif /* _OSD_POSIX */ + extern const char *os_set_authfile(pool * p, const char *filename); + extern int os_init_job_environment(server_rec * s, const char *user_name); +#endif /* _OSD_POSIX */ -char *ap_get_local_host(pool *); -unsigned long ap_get_virthost_addr(const char *hostname, unsigned short *port); + char *ap_get_local_host(pool *); + unsigned long ap_get_virthost_addr(const char *hostname, + unsigned short *port); -extern API_VAR_EXPORT time_t ap_restart_time; + extern API_VAR_EXPORT time_t ap_restart_time; /* * Apache tries to keep all of its long term filehandles (such as log files, @@ -987,18 +1007,19 @@ extern API_VAR_EXPORT time_t ap_restart_time; #ifdef NO_SLACK #define ap_slack(fd,line) (fd) #else -int ap_slack(int fd, int line); + int ap_slack(int fd, int line); #define AP_SLACK_LOW 1 #define AP_SLACK_HIGH 2 #endif -API_EXPORT(char *) ap_escape_quotes(pool *p, const char *instr); + API_EXPORT(char *) ap_escape_quotes(pool * p, const char *instr); /* * Redefine assert() to something more useful for an Apache... */ -API_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, int nLine) - __attribute__((noreturn)); + API_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, + int nLine) + __attribute__ ((noreturn)); #define ap_assert(exp) (void)( (exp) || (ap_log_assert(#exp, __FILE__, __LINE__), 0) ) /* The optimized timeout code only works if we're not MULTITHREAD and we're @@ -1021,7 +1042,7 @@ API_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, int nLine) #define SIGSTOP_CGI_CHILD 16 #ifdef DEBUG_SIGSTOP -extern int raise_sigstop_flags; + extern int raise_sigstop_flags; #define RAISE_SIGSTOP(x) do { \ if (raise_sigstop_flags & SIGSTOP_##x) raise(SIGSTOP);\ } while (0) @@ -1029,7 +1050,8 @@ extern int raise_sigstop_flags; #define RAISE_SIGSTOP(x) #endif -API_EXPORT(extern const char *) ap_psignature(const char *prefix, request_rec *r); + API_EXPORT(extern const char *) ap_psignature(const char *prefix, + request_rec * r); /* strtoul does not exist on sunos4. */ #ifdef strtoul @@ -1040,5 +1062,4 @@ API_EXPORT(extern const char *) ap_psignature(const char *prefix, request_rec *r #ifdef __cplusplus } #endif - -#endif /* !APACHE_HTTPD_H */ +#endif /* !APACHE_HTTPD_H */ diff --git a/src/afsweb/apache_includes/1.3.1/os.h b/src/afsweb/apache_includes/1.3.1/os.h index a9f8df961..224620018 100644 --- a/src/afsweb/apache_includes/1.3.1/os.h +++ b/src/afsweb/apache_includes/1.3.1/os.h @@ -119,9 +119,9 @@ const char *dlerror(void); #endif #define ap_os_dso_handle_t void * -void * ap_os_dso_load(const char *); -void ap_os_dso_unload(void *); -void * ap_os_dso_sym(void *, const char *); +void *ap_os_dso_load(const char *); +void ap_os_dso_unload(void *); +void *ap_os_dso_sym(void *, const char *); const char *ap_os_dso_error(void); -#endif /* !APACHE_OS_H */ +#endif /* !APACHE_OS_H */ diff --git a/src/afsweb/apache_includes/1.3.1/util_uri.h b/src/afsweb/apache_includes/1.3.1/util_uri.h index 6309a4792..118f98a16 100644 --- a/src/afsweb/apache_includes/1.3.1/util_uri.h +++ b/src/afsweb/apache_includes/1.3.1/util_uri.h @@ -65,10 +65,10 @@ extern "C" { #endif -typedef struct { - const char *name; - unsigned short default_port; -} schemes_t; + typedef struct { + const char *name; + unsigned short default_port; + } schemes_t; #define DEFAULT_FTP_DATA_PORT 20 #define DEFAULT_FTP_PORT 21 @@ -87,42 +87,49 @@ typedef struct { #define UNP_OMITPATHINFO (1U<<4) /* Show "scheme://user@site:port" only */ #define UNP_OMITQUERY (1U<<5) /* Omit the "?queryarg" from the path */ -typedef struct { - char *scheme; /* scheme ("http"/"ftp"/...) */ - char *hostinfo; /* combined [user[:password]@]host[:port] */ - char *user; /* user name, as in http://user:passwd@host:port/ */ - char *password; /* password, as in http://user:passwd@host:port/ */ - char *hostname; /* hostname from URI (or from Host: header) */ - char *port_str; /* port string (integer representation is in "port") */ - char *path; /* the request path (or "/" if only scheme://host was given) */ - char *query; /* Everything after a '?' in the path, if present */ - char *fragment; /* Trailing "#fragment" string, if present */ + typedef struct { + char *scheme; /* scheme ("http"/"ftp"/...) */ + char *hostinfo; /* combined [user[:password]@]host[:port] */ + char *user; /* user name, as in http://user:passwd@host:port/ */ + char *password; /* password, as in http://user:passwd@host:port/ */ + char *hostname; /* hostname from URI (or from Host: header) */ + char *port_str; /* port string (integer representation is in "port") */ + char *path; /* the request path (or "/" if only scheme://host was given) */ + char *query; /* Everything after a '?' in the path, if present */ + char *fragment; /* Trailing "#fragment" string, if present */ - struct hostent *hostent; + struct hostent *hostent; - unsigned short port; /* The port number, numeric, valid only if port_str != NULL */ - - unsigned is_initialized:1; + unsigned short port; /* The port number, numeric, valid only if port_str != NULL */ - unsigned dns_looked_up:1; - unsigned dns_resolved:1; + unsigned is_initialized:1; -} uri_components; + unsigned dns_looked_up:1; + unsigned dns_resolved:1; + + } uri_components; /* util_uri.c */ -API_EXPORT(unsigned short) ap_default_port_for_scheme(const char *scheme_str); -API_EXPORT(unsigned short) ap_default_port_for_request(const request_rec *r); -API_EXPORT(struct hostent *) ap_pduphostent(pool *p, const struct hostent *hp); -API_EXPORT(struct hostent *) ap_pgethostbyname(pool *p, const char *hostname); -API_EXPORT(char *) ap_unparse_uri_components(pool *p, const uri_components *uptr, - unsigned flags); -API_EXPORT(int) ap_parse_uri_components(pool *p, const char *uri, uri_components *uptr); -API_EXPORT(int) ap_parse_hostinfo_components(pool *p, const char *hostinfo, uri_components *uptr); + API_EXPORT(unsigned short) ap_default_port_for_scheme(const char + *scheme_str); + API_EXPORT(unsigned short) ap_default_port_for_request(const request_rec + * r); + API_EXPORT(struct hostent *) ap_pduphostent(pool * p, + const struct hostent *hp); + API_EXPORT(struct hostent *) ap_pgethostbyname(pool * p, + const char *hostname); + API_EXPORT(char *) ap_unparse_uri_components(pool * p, + const uri_components * + uptr, unsigned flags); + API_EXPORT(int) ap_parse_uri_components(pool * p, const char *uri, + uri_components * uptr); + API_EXPORT(int) ap_parse_hostinfo_components(pool * p, + const char *hostinfo, + uri_components * uptr); /* called by the core in main() */ -extern void ap_util_uri_init(void); + extern void ap_util_uri_init(void); #ifdef __cplusplus } #endif - -#endif /*UTIL_URI_H*/ +#endif /*UTIL_URI_H */ diff --git a/src/afsweb/apache_includes/1.3.6/alloc.h b/src/afsweb/apache_includes/1.3.6/alloc.h index 8a0e21f5d..915cafdc9 100644 --- a/src/afsweb/apache_includes/1.3.6/alloc.h +++ b/src/afsweb/apache_includes/1.3.6/alloc.h @@ -83,17 +83,17 @@ extern "C" { * alloc.c. */ - /* Need declaration of DIR on Win32 */ + /* Need declaration of DIR on Win32 */ #ifdef WIN32 -#include "../os/win32/readdir.h" +#include "os/win32/readdir.h" #endif -typedef struct pool pool; -typedef struct pool ap_pool; + typedef struct pool pool; + typedef struct pool ap_pool; -pool * ap_init_alloc(void); /* Set up everything */ -API_EXPORT(pool *) ap_make_sub_pool(pool *); /* All pools are subpools of permanent_pool */ -API_EXPORT(void) ap_destroy_pool(pool *); + pool *ap_init_alloc(void); /* Set up everything */ + API_EXPORT(pool *) ap_make_sub_pool(pool *); /* All pools are subpools of permanent_pool */ + API_EXPORT(void) ap_destroy_pool(pool *); /* used to guarantee to the pool debugging code that the sub pool will not be * destroyed before the parent pool @@ -104,50 +104,55 @@ API_EXPORT(void) ap_destroy_pool(pool *); #endif #define ap_pool_join(a,b) #else -API_EXPORT(void) ap_pool_join(pool *p, pool *sub); -API_EXPORT(pool *) ap_find_pool(const void *ts); -API_EXPORT(int) ap_pool_is_ancestor(pool *a, pool *b); + API_EXPORT(void) ap_pool_join(pool * p, pool * sub); + API_EXPORT(pool *) ap_find_pool(const void *ts); + API_EXPORT(int) ap_pool_is_ancestor(pool * a, pool * b); #endif /* Clearing out EVERYTHING in an pool... destroys any sub-pools */ -API_EXPORT(void) ap_clear_pool(struct pool *); + API_EXPORT(void) ap_clear_pool(struct pool *); /* Preparing for exec() --- close files, etc., but *don't* flush I/O * buffers, *don't* wait for subprocesses, and *don't* free any memory. */ -API_EXPORT(void) ap_cleanup_for_exec(void); + API_EXPORT(void) ap_cleanup_for_exec(void); /* routines to allocate memory from an pool... */ -API_EXPORT(void *) ap_palloc(struct pool *, int nbytes); -API_EXPORT(void *) ap_pcalloc(struct pool *, int nbytes); -API_EXPORT(char *) ap_pstrdup(struct pool *, const char *s); + API_EXPORT(void *) ap_palloc(struct pool *, int nbytes); + API_EXPORT(void *) ap_pcalloc(struct pool *, int nbytes); + API_EXPORT(char *) ap_pstrdup(struct pool *, const char *s); /* make a nul terminated copy of the n characters starting with s */ -API_EXPORT(char *) ap_pstrndup(struct pool *, const char *s, int n); -API_EXPORT_NONSTD(char *) ap_pstrcat(struct pool *,...); /* all '...' must be char* */ -API_EXPORT_NONSTD(char *) ap_psprintf(struct pool *, const char *fmt, ...) - __attribute__((format(printf,2,3))); -API_EXPORT(char *) ap_pvsprintf(struct pool *, const char *fmt, va_list); + API_EXPORT(char *) ap_pstrndup(struct pool *, const char *s, int n); + API_EXPORT_NONSTD(char *) ap_pstrcat(struct pool *, ...); /* all '...' must be char* */ + API_EXPORT_NONSTD(char *) ap_psprintf(struct pool *, const char *fmt, + ...) + __attribute__ ((format(printf, 2, 3))); + API_EXPORT(char *) ap_pvsprintf(struct pool *, const char *fmt, + va_list); /* array and alist management... keeping lists of things. * Common enough to want common support code ... */ -typedef struct { - ap_pool *pool; - int elt_size; - int nelts; - int nalloc; - char *elts; -} array_header; - -API_EXPORT(array_header *) ap_make_array(pool *p, int nelts, int elt_size); -API_EXPORT(void *) ap_push_array(array_header *); -API_EXPORT(void) ap_array_cat(array_header *dst, const array_header *src); -API_EXPORT(array_header *) ap_append_arrays(pool *, const array_header *, - const array_header *); + typedef struct { + ap_pool *pool; + int elt_size; + int nelts; + int nalloc; + char *elts; + } array_header; + + API_EXPORT(array_header *) ap_make_array(pool * p, int nelts, + int elt_size); + API_EXPORT(void *) ap_push_array(array_header *); + API_EXPORT(void) ap_array_cat(array_header * dst, + const array_header * src); + API_EXPORT(array_header *) ap_append_arrays(pool *, + const array_header *, + const array_header *); /* ap_array_pstrcat generates a new string from the pool containing * the concatenated sequence of substrings referenced as elements within @@ -155,16 +160,18 @@ API_EXPORT(array_header *) ap_append_arrays(pool *, const array_header *, * or if there are no elements in the array. * If sep is non-NUL, it will be inserted between elements as a separator. */ -API_EXPORT(char *) ap_array_pstrcat(pool *p, const array_header *arr, - const char sep); + API_EXPORT(char *) ap_array_pstrcat(pool * p, const array_header * arr, + const char sep); /* copy_array copies the *entire* array. copy_array_hdr just copies * the header, and arranges for the elements to be copied if (and only * if) the code subsequently does a push or arraycat. */ -API_EXPORT(array_header *) ap_copy_array(pool *p, const array_header *src); -API_EXPORT(array_header *) ap_copy_array_hdr(pool *p, const array_header *src); + API_EXPORT(array_header *) ap_copy_array(pool * p, + const array_header * src); + API_EXPORT(array_header *) ap_copy_array_hdr(pool * p, + const array_header * src); /* Tables. Implemented alist style, for now, though we try to keep @@ -176,30 +183,38 @@ API_EXPORT(array_header *) ap_copy_array_hdr(pool *p, const array_header *src); * currently being used... */ -typedef struct table table; - -typedef struct { - char *key; /* maybe NULL in future; - * check when iterating thru table_elts - */ - char *val; -} table_entry; - -API_EXPORT(table *) ap_make_table(pool *p, int nelts); -API_EXPORT(table *) ap_copy_table(pool *p, const table *); -API_EXPORT(void) ap_clear_table(table *); -API_EXPORT(const char *) ap_table_get(const table *, const char *); -API_EXPORT(void) ap_table_set(table *, const char *name, const char *val); -API_EXPORT(void) ap_table_setn(table *, const char *name, const char *val); -API_EXPORT(void) ap_table_merge(table *, const char *name, const char *more_val); -API_EXPORT(void) ap_table_mergen(table *, const char *name, const char *more_val); -API_EXPORT(void) ap_table_unset(table *, const char *key); -API_EXPORT(void) ap_table_add(table *, const char *name, const char *val); -API_EXPORT(void) ap_table_addn(table *, const char *name, const char *val); -API_EXPORT(void) ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, - const table *t,...); - -API_EXPORT(table *) ap_overlay_tables(pool *p, const table *overlay, const table *base); + typedef struct table table; + + typedef struct { + char *key; /* maybe NULL in future; + * check when iterating thru table_elts + */ + char *val; + } table_entry; + + API_EXPORT(table *) ap_make_table(pool * p, int nelts); + API_EXPORT(table *) ap_copy_table(pool * p, const table *); + API_EXPORT(void) ap_clear_table(table *); + API_EXPORT(const char *) ap_table_get(const table *, const char *); + API_EXPORT(void) ap_table_set(table *, const char *name, + const char *val); + API_EXPORT(void) ap_table_setn(table *, const char *name, + const char *val); + API_EXPORT(void) ap_table_merge(table *, const char *name, + const char *more_val); + API_EXPORT(void) ap_table_mergen(table *, const char *name, + const char *more_val); + API_EXPORT(void) ap_table_unset(table *, const char *key); + API_EXPORT(void) ap_table_add(table *, const char *name, + const char *val); + API_EXPORT(void) ap_table_addn(table *, const char *name, + const char *val); + API_EXPORT(void) + ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, + const table * t, ...); + + API_EXPORT(table *) ap_overlay_tables(pool * p, const table * overlay, + const table * base); /* Conceptually, ap_overlap_tables does this: @@ -225,7 +240,8 @@ API_EXPORT(table *) ap_overlay_tables(pool *p, const table *overlay, const table */ #define AP_OVERLAP_TABLES_SET (0) #define AP_OVERLAP_TABLES_MERGE (1) -API_EXPORT(void) ap_overlap_tables(table *a, const table *b, unsigned flags); + API_EXPORT(void) ap_overlap_tables(table * a, const table * b, + unsigned flags); /* XXX: these know about the definition of struct table in alloc.c. That * definition is not here because it is supposed to be private, and by not @@ -257,16 +273,18 @@ API_EXPORT(void) ap_overlap_tables(table *a, const table *b, unsigned flags); * unblock_alarms() below... */ -API_EXPORT(void) ap_register_cleanup(pool *p, void *data, - void (*plain_cleanup) (void *), - void (*child_cleanup) (void *)); + API_EXPORT(void) ap_register_cleanup(pool * p, void *data, + void (*plain_cleanup) (void *), + void (*child_cleanup) (void *)); -API_EXPORT(void) ap_kill_cleanup(pool *p, void *data, void (*plain_cleanup) (void *)); -API_EXPORT(void) ap_run_cleanup(pool *p, void *data, void (*cleanup) (void *)); + API_EXPORT(void) ap_kill_cleanup(pool * p, void *data, + void (*plain_cleanup) (void *)); + API_EXPORT(void) ap_run_cleanup(pool * p, void *data, + void (*cleanup) (void *)); /* A "do-nothing" cleanup, for register_cleanup; it's faster to do * things this way than to test for NULL. */ -API_EXPORT_NONSTD(void) ap_null_cleanup(void *data); + API_EXPORT_NONSTD(void) ap_null_cleanup(void *data); /* The time between when a resource is actually allocated, and when it * its cleanup is registered is a critical section, during which the @@ -282,46 +300,49 @@ API_EXPORT_NONSTD(void) ap_null_cleanup(void *data); #define ap_block_alarms() (0) #define ap_unblock_alarms() (0) #else -API_EXPORT(void) ap_block_alarms(void); -API_EXPORT(void) ap_unblock_alarms(void); -#endif /* TPF */ + API_EXPORT(void) ap_block_alarms(void); + API_EXPORT(void) ap_unblock_alarms(void); +#endif /* TPF */ /* Common cases which want utility support.. * the note_cleanups_for_foo routines are for */ -API_EXPORT(FILE *) ap_pfopen(struct pool *, const char *name, const char *fmode); -API_EXPORT(FILE *) ap_pfdopen(struct pool *, int fd, const char *fmode); -API_EXPORT(int) ap_popenf(struct pool *, const char *name, int flg, int mode); + API_EXPORT(FILE *) ap_pfopen(struct pool *, const char *name, + const char *fmode); + API_EXPORT(FILE *) ap_pfdopen(struct pool *, int fd, const char *fmode); + API_EXPORT(int) ap_popenf(struct pool *, const char *name, int flg, + int mode); -API_EXPORT(void) ap_note_cleanups_for_file(pool *, FILE *); -API_EXPORT(void) ap_note_cleanups_for_fd(pool *, int); + API_EXPORT(void) ap_note_cleanups_for_file(pool *, FILE *); + API_EXPORT(void) ap_note_cleanups_for_fd(pool *, int); #ifdef WIN32 -API_EXPORT(void) ap_note_cleanups_for_h(pool *, HANDLE); + API_EXPORT(void) ap_note_cleanups_for_h(pool *, HANDLE); #endif -API_EXPORT(void) ap_kill_cleanups_for_fd(pool *p, int fd); + API_EXPORT(void) ap_kill_cleanups_for_fd(pool * p, int fd); -API_EXPORT(void) ap_note_cleanups_for_socket(pool *, int); -API_EXPORT(void) ap_kill_cleanups_for_socket(pool *p, int sock); -API_EXPORT(int) ap_psocket(pool *p, int, int, int); -API_EXPORT(int) ap_pclosesocket(pool *a, int sock); + API_EXPORT(void) ap_note_cleanups_for_socket(pool *, int); + API_EXPORT(void) ap_kill_cleanups_for_socket(pool * p, int sock); + API_EXPORT(int) ap_psocket(pool * p, int, int, int); + API_EXPORT(int) ap_pclosesocket(pool * a, int sock); -API_EXPORT(regex_t *) ap_pregcomp(pool *p, const char *pattern, int cflags); -API_EXPORT(void) ap_pregfree(pool *p, regex_t * reg); + API_EXPORT(regex_t *) ap_pregcomp(pool * p, const char *pattern, + int cflags); + API_EXPORT(void) ap_pregfree(pool * p, regex_t * reg); /* routines to note closes... file descriptors are constrained enough * on some systems that we want to support this. */ -API_EXPORT(int) ap_pfclose(struct pool *, FILE *); -API_EXPORT(int) ap_pclosef(struct pool *, int fd); + API_EXPORT(int) ap_pfclose(struct pool *, FILE *); + API_EXPORT(int) ap_pclosef(struct pool *, int fd); #ifdef WIN32 -API_EXPORT(int) ap_pcloseh(struct pool *, HANDLE hDevice); + API_EXPORT(int) ap_pcloseh(struct pool *, HANDLE hDevice); #endif /* routines to deal with directories */ -API_EXPORT(DIR *) ap_popendir(pool *p, const char *name); -API_EXPORT(void) ap_pclosedir(pool *p, DIR * d); + API_EXPORT(DIR *) ap_popendir(pool * p, const char *name); + API_EXPORT(void) ap_pclosedir(pool * p, DIR * d); /* ... even child processes (which we may want to wait for, * or to kill outright, on unexpected termination). @@ -333,21 +354,21 @@ API_EXPORT(void) ap_pclosedir(pool *p, DIR * d); * to call in the child, and an argument to be passed to the function. */ -enum kill_conditions { - kill_never, /* process is never sent any signals */ - kill_always, /* process is sent SIGKILL on pool cleanup */ - kill_after_timeout, /* SIGTERM, wait 3 seconds, SIGKILL */ - just_wait, /* wait forever for the process to complete */ - kill_only_once /* send SIGTERM and then wait */ -}; - -typedef struct child_info child_info; -API_EXPORT(void) ap_note_subprocess(pool *a, pid_t pid, - enum kill_conditions how); -API_EXPORT(int) ap_spawn_child(pool *, int (*)(void *, child_info *), - void *, enum kill_conditions, - FILE **pipe_in, FILE **pipe_out, - FILE **pipe_err); + enum kill_conditions { + kill_never, /* process is never sent any signals */ + kill_always, /* process is sent SIGKILL on pool cleanup */ + kill_after_timeout, /* SIGTERM, wait 3 seconds, SIGKILL */ + just_wait, /* wait forever for the process to complete */ + kill_only_once /* send SIGTERM and then wait */ + }; + + typedef struct child_info child_info; + API_EXPORT(void) ap_note_subprocess(pool * a, pid_t pid, + enum kill_conditions how); + API_EXPORT(int) ap_spawn_child(pool *, int (*)(void *, child_info *), + void *, enum kill_conditions, + FILE ** pipe_in, FILE ** pipe_out, + FILE ** pipe_err); /* magic numbers --- min free bytes to consider a free pool block useable, * and the min amount to allocate if we have to go to malloc() */ @@ -361,11 +382,10 @@ API_EXPORT(int) ap_spawn_child(pool *, int (*)(void *, child_info *), /* Finally, some accounting */ -API_EXPORT(long) ap_bytes_in_pool(pool *p); -API_EXPORT(long) ap_bytes_in_free_blocks(void); + API_EXPORT(long) ap_bytes_in_pool(pool * p); + API_EXPORT(long) ap_bytes_in_free_blocks(void); #ifdef __cplusplus } #endif - -#endif /* !APACHE_ALLOC_H */ +#endif /* !APACHE_ALLOC_H */ diff --git a/src/afsweb/apache_includes/1.3.6/ap.h b/src/afsweb/apache_includes/1.3.6/ap.h index ed18dbd00..a93df892f 100644 --- a/src/afsweb/apache_includes/1.3.6/ap.h +++ b/src/afsweb/apache_includes/1.3.6/ap.h @@ -65,10 +65,10 @@ extern "C" { #endif -API_EXPORT(char *) ap_cpystrn(char *, const char *, size_t); -int ap_slack(int, int); -int ap_execle(const char *, const char *, ...); -int ap_execve(const char *, const char *argv[], const char *envp[]); + API_EXPORT(char *) ap_cpystrn(char *, const char *, size_t); + int ap_slack(int, int); + int ap_execle(const char *, const char *, ...); + int ap_execve(const char *, const char *argv[], const char *envp[]); /* small utility macros to make things easier to read */ @@ -80,7 +80,7 @@ int ap_execve(const char *, const char *argv[], const char *envp[]); #else #define ap_killpg(x, y) (killpg ((x), (y))) #endif -#endif /* WIN32 */ +#endif /* WIN32 */ /* ap_vformatter() is a generic printf-style formatting routine * with some extensions. The extensions are: @@ -131,13 +131,14 @@ int ap_execve(const char *, const char *argv[], const char *envp[]); * or until ap_vformatter returns. */ -typedef struct { - char *curpos; - char *endpos; -} ap_vformatter_buff; + typedef struct { + char *curpos; + char *endpos; + } ap_vformatter_buff; -API_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff *), - ap_vformatter_buff *, const char *fmt, va_list ap); + API_EXPORT(int) ap_vformatter(int (*flush_func) (ap_vformatter_buff *), + ap_vformatter_buff *, const char *fmt, + va_list ap); /* These are snprintf implementations based on ap_vformatter(). * @@ -154,13 +155,13 @@ API_EXPORT(int) ap_vformatter(int (*flush_func)(ap_vformatter_buff *), * to distinguish between an output which was truncated, and an output which * exactly filled the buffer. */ -API_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format,...) - __attribute__((format(printf,3,4))); -API_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, - va_list ap); + API_EXPORT(int) ap_snprintf(char *buf, size_t len, const char *format, + ...) + __attribute__ ((format(printf, 3, 4))); + API_EXPORT(int) ap_vsnprintf(char *buf, size_t len, const char *format, + va_list ap); #ifdef __cplusplus } #endif - -#endif /* !APACHE_AP_H */ +#endif /* !APACHE_AP_H */ diff --git a/src/afsweb/apache_includes/1.3.6/ap_compat.h b/src/afsweb/apache_includes/1.3.6/ap_compat.h index 4d706e8d8..3e80bafab 100644 --- a/src/afsweb/apache_includes/1.3.6/ap_compat.h +++ b/src/afsweb/apache_includes/1.3.6/ap_compat.h @@ -420,5 +420,4 @@ extern "C" { #ifdef __cplusplus } #endif - -#endif /* !AP_COMPAT_H */ +#endif /* !AP_COMPAT_H */ diff --git a/src/afsweb/apache_includes/1.3.6/ap_config.h b/src/afsweb/apache_includes/1.3.6/ap_config.h index a33d5630d..e921d448c 100644 --- a/src/afsweb/apache_includes/1.3.6/ap_config.h +++ b/src/afsweb/apache_includes/1.3.6/ap_config.h @@ -110,7 +110,7 @@ stat() properly */ #ifdef WIN32 /* include process.h first so we can override spawn[lv]e* properly */ #include -#include "../os/win32/os.h" +#include "os/win32/os.h" #else #include "os.h" #endif @@ -121,15 +121,15 @@ stat() properly */ /* Define one of these according to your system. */ #if defined(MINT) -typedef int rlim_t; + typedef int rlim_t; #define JMP_BUF sigjmp_buf #define NO_LONG_DOUBLE #define USE_FLOCK_SERIALIZED_ACCEPT #define _BSD_SOURCE #define EAGAIN EWOULDBLOCK -int initgroups (char *, int); -char *crypt (const char *pw, const char *salt); -int gethostname (char *name, int namelen); + int initgroups(char *, int); + char *crypt(const char *pw, const char *salt); + int gethostname(char *name, int namelen); #elif defined(MPE) #include @@ -138,15 +138,15 @@ int gethostname (char *name, int namelen); #define NO_WRITEV #define HAVE_SHMGET 1 #define USE_SHMGET_SCOREBOARD -#define SHM_R 0400 /* Read permission */ -#define SHM_W 0200 /* Write permission */ +#define SHM_R 0400 /* Read permission */ +#define SHM_W 0200 /* Write permission */ #define NEED_INITGROUPS #define NEED_STRCASECMP #define NEED_STRDUP #define NEED_STRNCASECMP -extern void GETPRIVMODE(); -extern void GETUSERMODE(); -extern char *inet_ntoa(); + extern void GETPRIVMODE(); + extern void GETUSERMODE(); + extern char *inet_ntoa(); #define NO_SLACK #define NO_GETTIMEOFDAY #define S_IEXEC S_IXUSR @@ -158,14 +158,14 @@ extern char *inet_ntoa(); #define HAVE_GMTOFF 1 #undef NO_KILLPG #undef NO_SETSID -char *crypt(const char *pw, const char *salt); -char *mktemp(char *template); + char *crypt(const char *pw, const char *salt); + char *mktemp(char *template); #define HAVE_MMAP 1 #define USE_MMAP_SCOREBOARD #define USE_MMAP_FILES #include #define NEED_STRERROR -typedef int rlim_t; + typedef int rlim_t; #ifndef HAVE_MEMMOVE #define memmove(a,b,c) memcpy(a, b, c) #endif @@ -188,8 +188,8 @@ typedef int rlim_t; #define USE_MMAP_FILES /* Transarc hack to get AIX to build */ #if ! defined(AIX) && ! defined(linux) -int gethostname(char *name, int namelen); -#endif /* ! AIX && ! linux */ + int gethostname(char *name, int namelen); +#endif /* ! AIX && ! linux */ #define HAVE_SYSLOG 1 #define SYS_SIGLIST _sys_siglist @@ -237,7 +237,7 @@ int gethostname(char *name, int namelen); #define HAVE_SYSLOG 1 #ifndef HPUX10 #define SELECT_NEEDS_CAST -typedef int rlim_t; + typedef int rlim_t; #endif #elif defined(HPUX11) @@ -274,7 +274,7 @@ typedef int rlim_t; #define DEFAULT_USER "nobody" #endif #ifdef NEED_RLIM_T -typedef int rlim_t; + typedef int rlim_t; #endif #define USE_FCNTL_SERIALIZED_ACCEPT #ifdef USEBCOPY @@ -319,7 +319,7 @@ typedef int rlim_t; #define USE_MMAP_FILES #define NO_LONG_DOUBLE #define HAVE_SYSLOG 1 -typedef int rlim_t; + typedef int rlim_t; #elif defined(SEQUENT) #define HAVE_GMTOFF 1 @@ -329,7 +329,7 @@ typedef int rlim_t; #define HAVE_SYSLOG 1 #elif defined(NEXT) -typedef unsigned short mode_t; + typedef unsigned short mode_t; #define HAVE_GMTOFF 1 #undef NO_KILLPG #define NO_SETSID @@ -372,9 +372,9 @@ typedef unsigned short mode_t; #ifndef S_IWOTH #define S_IWOTH 000002 #ifndef rlim_t -typedef int rlim_t; + typedef int rlim_t; #endif -typedef u_long n_long; + typedef u_long n_long; #endif #define STDIN_FILENO 0 @@ -387,12 +387,12 @@ typedef u_long n_long; #define WEXITSTATUS(status) (int)( WIFEXITED(status) ? ( (status).w_retcode ) : -1) #define WTERMSIG(status) (int)( (status).w_termsig ) -typedef int pid_t; + typedef int pid_t; #define USE_LONGJMP #define NO_USE_SIGACTION #define HAVE_SYSLOG 1 -#elif defined(RHAPSODY) /* Mac OS X Server */ +#elif defined(RHAPSODY) /* Mac OS X Server */ #define HAVE_GMTOFF #define HAVE_MMAP #define USE_MMAP_FILES @@ -487,7 +487,7 @@ typedef int pid_t; /* glibc 2.1 and later finally define rlim_t */ #if !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1) -typedef int rlim_t; + typedef int rlim_t; #endif #elif defined(SCO) @@ -511,23 +511,23 @@ typedef int rlim_t; /* Although SCO 5 defines these in (note the "s") they don't have consts. Sigh. */ -extern int strcasecmp(const char *, const char *); -extern int strncasecmp(const char *, const char *, unsigned); + extern int strcasecmp(const char *, const char *); + extern int strncasecmp(const char *, const char *, unsigned); #elif defined(AUX3) /* These are to let -Wall compile more cleanly */ -extern int strcasecmp(const char *, const char *); -extern int strncasecmp(const char *, const char *, unsigned); -extern int set42sig(), getopt(), getpeername(); -extern int listen(), bind(), socket(), getsockname(); -extern int accept(), gethostname(), connect(), lstat(); -extern int select(), killpg(), shutdown(); -extern int initgroups(), setsockopt(); -extern char *shmat(); -extern int shmctl(); -extern int shmget(); -extern char *sbrk(); -extern char *crypt(); + extern int strcasecmp(const char *, const char *); + extern int strncasecmp(const char *, const char *, unsigned); + extern int set42sig(), getopt(), getpeername(); + extern int listen(), bind(), socket(), getsockname(); + extern int accept(), gethostname(), connect(), lstat(); + extern int select(), killpg(), shutdown(); + extern int initgroups(), setsockopt(); + extern char *shmat(); + extern int shmctl(); + extern int shmget(); + extern char *sbrk(); + extern char *crypt(); #include #undef HAVE_GMTOFF #undef NO_KILLPG @@ -559,8 +559,8 @@ extern char *crypt(); #define NEED_STRCASECMP #ifndef ENCORE #define NEED_STRNCASECMP -#endif /* ENCORE */ -#endif /* MPRAS */ +#endif /* ENCORE */ +#endif /* MPRAS */ /* A lot of SVR4 systems need this */ #ifndef USE_SYSVSEM_SERIALIZED_ACCEPT #define USE_FCNTL_SERIALIZED_ACCEPT @@ -569,9 +569,9 @@ extern char *crypt(); #define NET_SIZE_T size_t #define HAVE_SHMGET 1 #define USE_SHMGET_SCOREBOARD -#ifdef _OSD_POSIX /* BS2000-POSIX mainframe needs initgroups */ +#ifdef _OSD_POSIX /* BS2000-POSIX mainframe needs initgroups */ #define NEED_INITGROUPS -#define NEED_HASHBANG_EMUL /* execve() doesn't start shell scripts by default */ +#define NEED_HASHBANG_EMUL /* execve() doesn't start shell scripts by default */ #undef HAVE_SHMGET #undef NEED_STRCASECMP #undef NEED_STRNCASECMP @@ -656,9 +656,9 @@ extern char *crypt(); #define WEXITSTATUS(status) (int)((status).w_retcode) #define WTERMSIG(status) (int)((status).w_termsig) #define strftime(buf,bufsize,fmt,tm) ascftime(buf,fmt,tm) -#undef HAVE_SYS_RESOURCE_H /* exists but does not provide *rlimit funcs */ +#undef HAVE_SYS_RESOURCE_H /* exists but does not provide *rlimit funcs */ #include -#include +#include #elif defined(APOLLO) #undef HAVE_GMTOFF @@ -684,7 +684,7 @@ extern char *crypt(); #endif #if defined(__bsdi__) || \ (defined(__FreeBSD_version) && (__FreeBSD_version < 220000)) -typedef quad_t rlim_t; + typedef quad_t rlim_t; #endif #define USE_FLOCK_SERIALIZED_ACCEPT #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT @@ -693,10 +693,10 @@ typedef quad_t rlim_t; #elif defined(QNX) #ifndef crypt -char *crypt(const char *pw, const char *salt); + char *crypt(const char *pw, const char *salt); #endif #ifndef initgroups -int initgroups(char *, int); + int initgroups(char *, int); #endif #ifndef strncasecmp #define strncasecmp strnicmp @@ -724,8 +724,8 @@ int initgroups(char *, int); #undef NO_SETSID #undef NO_USE_SIGACTION #undef NO_LINGCLOSE -extern char *crypt(char *pw, char *salt); -typedef int rlim_t; + extern char *crypt(char *pw, char *salt); + typedef int rlim_t; #define HAVE_SYSLOG 1 #elif defined(UXPDS) @@ -759,7 +759,7 @@ typedef int rlim_t; #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT #elif defined(__MACHTEN__) -typedef int rlim_t; + typedef int rlim_t; #undef NO_KILLPG #define NO_SETSID #define HAVE_GMTOFF 1 @@ -792,7 +792,7 @@ typedef int rlim_t; #define NO_TIMEZONE #include #include -typedef int rlim_t; + typedef int rlim_t; #elif defined(ISC) #include @@ -815,13 +815,13 @@ typedef int rlim_t; #include #include #include -typedef int pid_t; -typedef int rlim_t; -typedef int mode_t; + typedef int pid_t; + typedef int rlim_t; + typedef int mode_t; #elif defined(RISCIX) #include -typedef int rlim_t; + typedef int rlim_t; #define NO_USE_SIGACTION #define USE_LONGJMP #define NEED_STRCASECMP @@ -844,7 +844,7 @@ typedef int rlim_t; /* All windows stuff is now in os/win32/os.h */ -#elif defined(TPF) /* IBM Transaction Processing Facility operating system */ +#elif defined(TPF) /* IBM Transaction Processing Facility operating system */ #include #include @@ -965,10 +965,10 @@ typedef int rlim_t; #include #ifdef HAVE_SYS_SELECT_H #include -#endif /* HAVE_SYS_SELECT_H */ +#endif /* HAVE_SYS_SELECT_H */ #ifndef TPF #include -#endif /* TPF */ +#endif /* TPF */ #include #include #if !defined(MPE) && !defined(BEOS) && !defined(TPF) @@ -984,12 +984,12 @@ typedef int rlim_t; #define O_BINARY (0) #endif -#else /* WIN32 */ +#else /* WIN32 */ #include #include #include #include -#endif /* ndef WIN32 */ +#endif /* ndef WIN32 */ #include /* for ctime */ #ifdef WIN32 @@ -1006,7 +1006,7 @@ typedef int rlim_t; #endif #ifdef WIN32 -#include "../include/hsregex.h" +#include "include/hsregex.h" #elif defined(USE_HSREGEX) #include "hsregex.h" #else @@ -1016,8 +1016,8 @@ typedef int rlim_t; #ifdef HAVE_SYS_RESOURCE_H #include #ifdef SUNOS4 -int getrlimit(int, struct rlimit *); -int setrlimit(int, struct rlimit *); + int getrlimit(int, struct rlimit *); + int setrlimit(int, struct rlimit *); #endif #endif #ifdef USE_MMAP_SCOREBOARD @@ -1066,7 +1066,7 @@ int setrlimit(int, struct rlimit *); * Replace signal function with sigaction equivalent */ #ifndef NO_USE_SIGACTION -typedef void Sigfunc(int); + typedef void Sigfunc(int); #if defined(SIG_IGN) && !defined(SIG_ERR) #define SIG_ERR ((Sigfunc *)-1) @@ -1079,7 +1079,7 @@ typedef void Sigfunc(int); #undef signal #endif #define signal(s,f) ap_signal(s,f) -Sigfunc *signal(int signo, Sigfunc * func); + Sigfunc *signal(int signo, Sigfunc * func); #endif #include @@ -1125,9 +1125,9 @@ Sigfunc *signal(int signo, Sigfunc * func); * with a HASHBANG (#!) followed by interpreter name and args, define this. */ #ifdef NEED_HASHBANG_EMUL -extern int ap_execle(const char *filename, const char *arg,...); -extern int ap_execve(const char *filename, const char *argv[], - const char *envp[]); + extern int ap_execle(const char *filename, const char *arg, ...); + extern int ap_execve(const char *filename, const char *argv[], + const char *envp[]); /* ap_execle() is a wrapper function around ap_execve(). */ #define execle ap_execle #define execve(path,argv,envp) ap_execve(path,argv,envp) @@ -1146,18 +1146,18 @@ extern int ap_execve(const char *filename, const char *argv[], #define XtOffset(p_type,field) \ (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) -#else /* !CRAY2 */ +#else /* !CRAY2 */ #define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field)) -#endif /* !CRAY2 */ -#endif /* __STDC__ */ -#else /* ! (CRAY || __arm) */ +#endif /* !CRAY2 */ +#endif /* __STDC__ */ +#else /* ! (CRAY || __arm) */ #define XtOffset(p_type,field) \ ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) -#endif /* !CRAY */ +#endif /* !CRAY */ #ifdef offsetof #define XtOffsetOf(s_type,field) offsetof(s_type,field) @@ -1204,82 +1204,82 @@ extern int ap_execve(const char *filename, const char *argv[], * currently (13Nov97) used. */ -int getopt(int, char **, char *); - -int strcasecmp(const char *, const char *); -int strncasecmp(const char *, const char *, int); -int toupper(int); -int tolower(int); - -int printf(char *,...); -int fprintf(FILE *, char *,...); -int fputs(char *, FILE *); -int fread(char *, int, int, FILE *); -int fwrite(char *, int, int, FILE *); -int fgetc(FILE *); -char *fgets(char *s, int, FILE*); -int fflush(FILE *); -int fclose(FILE *); -int ungetc(int, FILE *); -int _filbuf(FILE *); /* !!! */ -int _flsbuf(unsigned char, FILE *); /* !!! */ -int sscanf(char *, char *,...); -void setbuf(FILE *, char *); -void perror(char *); - -time_t time(time_t *); -int strftime(char *, int, const char *, struct tm *); - -int initgroups(char *, int); -int wait3(int *, int, void *); /* Close enough for us... */ -int lstat(const char *, struct stat *); -int stat(const char *, struct stat *); -int flock(int, int); + int getopt(int, char **, char *); + + int strcasecmp(const char *, const char *); + int strncasecmp(const char *, const char *, int); + int toupper(int); + int tolower(int); + + int printf(char *, ...); + int fprintf(FILE *, char *, ...); + int fputs(char *, FILE *); + int fread(char *, int, int, FILE *); + int fwrite(char *, int, int, FILE *); + int fgetc(FILE *); + char *fgets(char *s, int, FILE *); + int fflush(FILE *); + int fclose(FILE *); + int ungetc(int, FILE *); + int _filbuf(FILE *); /* !!! */ + int _flsbuf(unsigned char, FILE *); /* !!! */ + int sscanf(char *, char *, ...); + void setbuf(FILE *, char *); + void perror(char *); + + time_t time(time_t *); + int strftime(char *, int, const char *, struct tm *); + + int initgroups(char *, int); + int wait3(int *, int, void *); /* Close enough for us... */ + int lstat(const char *, struct stat *); + int stat(const char *, struct stat *); + int flock(int, int); #ifndef NO_KILLPG -int killpg(int, int); + int killpg(int, int); #endif -int socket(int, int, int); -int setsockopt(int, int, int, const char *, int); -int listen(int, int); -int bind(int, struct sockaddr *, int); -int connect(int, struct sockaddr *, int); -int accept(int, struct sockaddr *, int *); -int shutdown(int, int); + int socket(int, int, int); + int setsockopt(int, int, int, const char *, int); + int listen(int, int); + int bind(int, struct sockaddr *, int); + int connect(int, struct sockaddr *, int); + int accept(int, struct sockaddr *, int *); + int shutdown(int, int); -int getsockname(int s, struct sockaddr *name, int *namelen); -int getpeername(int s, struct sockaddr *name, int *namelen); -int gethostname(char *name, int namelen); -void syslog(int, char *,...); -char *mktemp(char *); + int getsockname(int s, struct sockaddr *name, int *namelen); + int getpeername(int s, struct sockaddr *name, int *namelen); + int gethostname(char *name, int namelen); + void syslog(int, char *, ...); + char *mktemp(char *); -long vfprintf(FILE *, const char *, va_list); + long vfprintf(FILE *, const char *, va_list); -#endif /* SUNOS_LIB_PROTOTYPES */ +#endif /* SUNOS_LIB_PROTOTYPES */ /* The assumption is that when the functions are missing, * then there's no matching prototype available either. * Declare what is needed exactly as the replacement routines implement it. */ #ifdef NEED_STRDUP -extern char *strdup (const char *str); + extern char *strdup(const char *str); #endif #ifdef NEED_STRCASECMP -extern int strcasecmp (const char *a, const char *b); + extern int strcasecmp(const char *a, const char *b); #endif #ifdef NEED_STRNCASECMP -extern int strncasecmp (const char *a, const char *b, int n); + extern int strncasecmp(const char *a, const char *b, int n); #endif #ifdef NEED_INITGROUPS -extern int initgroups(const char *name, gid_t basegid); + extern int initgroups(const char *name, gid_t basegid); #endif #ifdef NEED_WAITPID -extern int waitpid(pid_t pid, int *statusp, int options); + extern int waitpid(pid_t pid, int *statusp, int options); #endif #ifdef NEED_STRERROR -extern char *strerror (int err); + extern char *strerror(int err); #endif #ifdef NEED_DIFFTIME -extern double difftime(time_t time1, time_t time0); + extern double difftime(time_t time1, time_t time0); #endif #ifndef ap_wait_t @@ -1289,5 +1289,4 @@ extern double difftime(time_t time1, time_t time0); #ifdef __cplusplus } #endif - -#endif /* !AP_CONFIG_H */ +#endif /* !AP_CONFIG_H */ diff --git a/src/afsweb/apache_includes/1.3.6/ap_ctype.h b/src/afsweb/apache_includes/1.3.6/ap_ctype.h index e0a6abcaa..f45bffec1 100644 --- a/src/afsweb/apache_includes/1.3.6/ap_ctype.h +++ b/src/afsweb/apache_includes/1.3.6/ap_ctype.h @@ -86,5 +86,4 @@ extern "C" { #ifdef __cplusplus } #endif - -#endif /* !AP_CTYPE_H */ +#endif /* !AP_CTYPE_H */ diff --git a/src/afsweb/apache_includes/1.3.6/ap_mmn.h b/src/afsweb/apache_includes/1.3.6/ap_mmn.h index f844ec2f7..628d13dfb 100644 --- a/src/afsweb/apache_includes/1.3.6/ap_mmn.h +++ b/src/afsweb/apache_includes/1.3.6/ap_mmn.h @@ -216,12 +216,12 @@ * 19990320 - METHODS and M_INVALID symbol values modified */ -#define MODULE_MAGIC_COOKIE 0x41503133UL /* "AP13" */ +#define MODULE_MAGIC_COOKIE 0x41503133UL /* "AP13" */ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 19990320 #endif -#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */ #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR /* backward compat */ /* Useful for testing for features. */ diff --git a/src/afsweb/apache_includes/1.3.6/buff.h b/src/afsweb/apache_includes/1.3.6/buff.h index 27ccd1537..74ef89af0 100644 --- a/src/afsweb/apache_includes/1.3.6/buff.h +++ b/src/afsweb/apache_includes/1.3.6/buff.h @@ -81,7 +81,7 @@ extern "C" { #define B_RDERR (16) /* A write error has occurred */ #define B_WRERR (32) -#ifdef B_ERROR /* in SVR4: sometimes defined in /usr/include/sys/buf.h */ +#ifdef B_ERROR /* in SVR4: sometimes defined in /usr/include/sys/buf.h */ #undef B_ERROR #endif #define B_ERROR (48) @@ -92,89 +92,90 @@ extern "C" { /* buffer is a socket */ #define B_SOCKET (256) #ifdef CHARSET_EBCDIC -#define B_ASCII2EBCDIC 0x40000000 /* Enable conversion for this buffer */ -#define B_EBCDIC2ASCII 0x80000000 /* Enable conversion for this buffer */ -#endif /*CHARSET_EBCDIC*/ +#define B_ASCII2EBCDIC 0x40000000 /* Enable conversion for this buffer */ +#define B_EBCDIC2ASCII 0x80000000 /* Enable conversion for this buffer */ +#endif /*CHARSET_EBCDIC */ -typedef struct buff_struct BUFF; + typedef struct buff_struct BUFF; -struct buff_struct { - int flags; /* flags */ - unsigned char *inptr; /* pointer to next location to read */ - int incnt; /* number of bytes left to read from input buffer; + struct buff_struct { + int flags; /* flags */ + unsigned char *inptr; /* pointer to next location to read */ + int incnt; /* number of bytes left to read from input buffer; * always 0 if had a read error */ - int outchunk; /* location of chunk header when chunking */ - int outcnt; /* number of byte put in output buffer */ - unsigned char *inbase; - unsigned char *outbase; - int bufsiz; - void (*error) (BUFF *fb, int op, void *data); - void *error_data; - long int bytes_sent; /* number of bytes actually written */ + int outchunk; /* location of chunk header when chunking */ + int outcnt; /* number of byte put in output buffer */ + unsigned char *inbase; + unsigned char *outbase; + int bufsiz; + void (*error) (BUFF * fb, int op, void *data); + void *error_data; + long int bytes_sent; /* number of bytes actually written */ - ap_pool *pool; + ap_pool *pool; /* could also put pointers to the basic I/O routines here */ - int fd; /* the file descriptor */ - int fd_in; /* input file descriptor, if different */ + int fd; /* the file descriptor */ + int fd_in; /* input file descriptor, if different */ #ifdef WIN32 - HANDLE hFH; /* Windows filehandle */ + HANDLE hFH; /* Windows filehandle */ #endif - /* transport handle, for RPC binding handle or some such */ - void *t_handle; + /* transport handle, for RPC binding handle or some such */ + void *t_handle; #ifdef B_SFIO - Sfio_t *sf_in; - Sfio_t *sf_out; + Sfio_t *sf_in; + Sfio_t *sf_out; #endif -}; + }; #ifdef B_SFIO -typedef struct { - Sfdisc_t disc; - BUFF *buff; -} apache_sfio; + typedef struct { + Sfdisc_t disc; + BUFF *buff; + } apache_sfio; -extern Sfdisc_t *bsfio_new(pool *p, BUFF *b); + extern Sfdisc_t *bsfio_new(pool * p, BUFF * b); #endif /* Options to bset/getopt */ #define BO_BYTECT (1) /* Stream creation and modification */ -API_EXPORT(BUFF *) ap_bcreate(pool *p, int flags); -API_EXPORT(void) ap_bpushfd(BUFF *fb, int fd_in, int fd_out); + API_EXPORT(BUFF *) ap_bcreate(pool * p, int flags); + API_EXPORT(void) ap_bpushfd(BUFF * fb, int fd_in, int fd_out); #ifdef WIN32 -API_EXPORT(void) ap_bpushh(BUFF *fb, HANDLE hFH); + API_EXPORT(void) ap_bpushh(BUFF * fb, HANDLE hFH); #endif -API_EXPORT(int) ap_bsetopt(BUFF *fb, int optname, const void *optval); -API_EXPORT(int) ap_bgetopt(BUFF *fb, int optname, void *optval); -API_EXPORT(int) ap_bsetflag(BUFF *fb, int flag, int value); -API_EXPORT(int) ap_bclose(BUFF *fb); + API_EXPORT(int) ap_bsetopt(BUFF * fb, int optname, const void *optval); + API_EXPORT(int) ap_bgetopt(BUFF * fb, int optname, void *optval); + API_EXPORT(int) ap_bsetflag(BUFF * fb, int flag, int value); + API_EXPORT(int) ap_bclose(BUFF * fb); #define ap_bgetflag(fb, flag) ((fb)->flags & (flag)) /* Error handling */ -API_EXPORT(void) ap_bonerror(BUFF *fb, void (*error) (BUFF *, int, void *), - void *data); + API_EXPORT(void) ap_bonerror(BUFF * fb, + void (*error) (BUFF *, int, void *), + void *data); /* I/O */ -API_EXPORT(int) ap_bread(BUFF *fb, void *buf, int nbyte); -API_EXPORT(int) ap_bgets(char *s, int n, BUFF *fb); -API_EXPORT(int) ap_blookc(char *buff, BUFF *fb); -API_EXPORT(int) ap_bskiplf(BUFF *fb); -API_EXPORT(int) ap_bwrite(BUFF *fb, const void *buf, int nbyte); -API_EXPORT(int) ap_bflush(BUFF *fb); -API_EXPORT(int) ap_bputs(const char *x, BUFF *fb); -API_EXPORT(int) ap_bvputs(BUFF *fb,...); -API_EXPORT_NONSTD(int) ap_bprintf(BUFF *fb, const char *fmt,...) - __attribute__((format(printf,2,3))); -API_EXPORT(int) ap_vbprintf(BUFF *fb, const char *fmt, va_list vlist); + API_EXPORT(int) ap_bread(BUFF * fb, void *buf, int nbyte); + API_EXPORT(int) ap_bgets(char *s, int n, BUFF * fb); + API_EXPORT(int) ap_blookc(char *buff, BUFF * fb); + API_EXPORT(int) ap_bskiplf(BUFF * fb); + API_EXPORT(int) ap_bwrite(BUFF * fb, const void *buf, int nbyte); + API_EXPORT(int) ap_bflush(BUFF * fb); + API_EXPORT(int) ap_bputs(const char *x, BUFF * fb); + API_EXPORT(int) ap_bvputs(BUFF * fb, ...); + API_EXPORT_NONSTD(int) ap_bprintf(BUFF * fb, const char *fmt, ...) + __attribute__ ((format(printf, 2, 3))); + API_EXPORT(int) ap_vbprintf(BUFF * fb, const char *fmt, va_list vlist); /* Internal routines */ -API_EXPORT(int) ap_bflsbuf(int c, BUFF *fb); -API_EXPORT(int) ap_bfilbuf(BUFF *fb); + API_EXPORT(int) ap_bflsbuf(int c, BUFF * fb); + API_EXPORT(int) ap_bfilbuf(BUFF * fb); #ifndef CHARSET_EBCDIC @@ -185,7 +186,7 @@ API_EXPORT(int) ap_bfilbuf(BUFF *fb); (fb)->outcnt == (fb)->bufsiz) ? ap_bflsbuf(c, (fb)) : \ ((fb)->outbase[(fb)->outcnt++] = (c), 0)) -#else /*CHARSET_EBCDIC*/ +#else /*CHARSET_EBCDIC */ #define ap_bgetc(fb) ( ((fb)->incnt == 0) ? ap_bfilbuf(fb) : \ ((fb)->incnt--, (fb->flags & B_ASCII2EBCDIC)\ @@ -196,41 +197,41 @@ API_EXPORT(int) ap_bfilbuf(BUFF *fb); ((fb)->outbase[(fb)->outcnt++] = (fb->flags & B_EBCDIC2ASCII)\ ?os_toascii[(unsigned char)c]:(c), 0)) -#endif /*CHARSET_EBCDIC*/ -struct child_info { +#endif /*CHARSET_EBCDIC */ + struct child_info { #ifdef WIN32 - /* - * These handles are used by ap_call_exec to call - * create process with pipe handles. - */ - HANDLE hPipeInputRead; - HANDLE hPipeOutputWrite; - HANDLE hPipeErrorWrite; + /* + * These handles are used by ap_call_exec to call + * create process with pipe handles. + */ + HANDLE hPipeInputRead; + HANDLE hPipeOutputWrite; + HANDLE hPipeErrorWrite; #else - /* - * We need to put a dummy member in here to avoid compilation - * errors under certain Unix compilers, like SGI's and HPUX's, - * which fail to compile a zero-sized struct. Of course - * it would be much nicer if there was actually a use for this - * structure under Unix. Aah the joys of x-platform code. - */ - int dummy; + /* + * We need to put a dummy member in here to avoid compilation + * errors under certain Unix compilers, like SGI's and HPUX's, + * which fail to compile a zero-sized struct. Of course + * it would be much nicer if there was actually a use for this + * structure under Unix. Aah the joys of x-platform code. + */ + int dummy; #endif -}; -API_EXPORT(int) ap_bspawn_child(pool *, int (*)(void *, child_info *), void *, - enum kill_conditions, BUFF **pipe_in, BUFF **pipe_out, - BUFF **pipe_err); + }; + API_EXPORT(int) ap_bspawn_child(pool *, int (*)(void *, child_info *), + void *, enum kill_conditions, + BUFF ** pipe_in, BUFF ** pipe_out, + BUFF ** pipe_err); /* enable non-blocking operations */ -API_EXPORT(int) ap_bnonblock(BUFF *fb, int direction); + API_EXPORT(int) ap_bnonblock(BUFF * fb, int direction); /* and get an fd to select() on */ -API_EXPORT(int) ap_bfileno(BUFF *fb, int direction); + API_EXPORT(int) ap_bfileno(BUFF * fb, int direction); /* bflush() if a read now would block, but don't actually read anything */ -API_EXPORT(void) ap_bhalfduplex(BUFF *fb); + API_EXPORT(void) ap_bhalfduplex(BUFF * fb); #ifdef __cplusplus } #endif - -#endif /* !APACHE_BUFF_H */ +#endif /* !APACHE_BUFF_H */ diff --git a/src/afsweb/apache_includes/1.3.6/http_conf_globals.h b/src/afsweb/apache_includes/1.3.6/http_conf_globals.h index c540c4e0a..ca1d965b6 100644 --- a/src/afsweb/apache_includes/1.3.6/http_conf_globals.h +++ b/src/afsweb/apache_includes/1.3.6/http_conf_globals.h @@ -66,33 +66,33 @@ extern "C" { * Process config --- what the process ITSELF is doing */ -extern int ap_standalone; -extern uid_t ap_user_id; -extern char *ap_user_name; -extern gid_t ap_group_id; + extern int ap_standalone; + extern uid_t ap_user_id; + extern char *ap_user_name; + extern gid_t ap_group_id; #ifdef MULTIPLE_GROUPS -extern gid_t group_id_list[NGROUPS_MAX]; + extern gid_t group_id_list[NGROUPS_MAX]; #endif -extern int ap_max_requests_per_child; -extern int ap_threads_per_child; -extern int ap_excess_requests_per_child; -extern struct in_addr ap_bind_address; -extern listen_rec *ap_listeners; -extern int ap_daemons_to_start; -extern int ap_daemons_min_free; -extern int ap_daemons_max_free; -extern int ap_daemons_limit; -extern MODULE_VAR_EXPORT int ap_suexec_enabled; -extern int ap_listenbacklog; -extern int ap_dump_settings; -extern API_VAR_EXPORT int ap_extended_status; + extern int ap_max_requests_per_child; + extern int ap_threads_per_child; + extern int ap_excess_requests_per_child; + extern struct in_addr ap_bind_address; + extern listen_rec *ap_listeners; + extern int ap_daemons_to_start; + extern int ap_daemons_min_free; + extern int ap_daemons_max_free; + extern int ap_daemons_limit; + extern MODULE_VAR_EXPORT int ap_suexec_enabled; + extern int ap_listenbacklog; + extern int ap_dump_settings; + extern API_VAR_EXPORT int ap_extended_status; -extern char *ap_pid_fname; -extern char *ap_scoreboard_fname; -extern char *ap_lock_fname; -extern MODULE_VAR_EXPORT char *ap_server_argv0; + extern char *ap_pid_fname; + extern char *ap_scoreboard_fname; + extern char *ap_lock_fname; + extern MODULE_VAR_EXPORT char *ap_server_argv0; -extern enum server_token_type ap_server_tokens; + extern enum server_token_type ap_server_tokens; /* Trying to allocate these in the config pool gets us into some *nasty* * chicken-and-egg problems in http_main.c --- where do you stick them @@ -100,21 +100,20 @@ extern enum server_token_type ap_server_tokens; * statically... */ -extern API_VAR_EXPORT char ap_server_root[MAX_STRING_LEN]; -extern char ap_server_confname[MAX_STRING_LEN]; + extern API_VAR_EXPORT char ap_server_root[MAX_STRING_LEN]; + extern char ap_server_confname[MAX_STRING_LEN]; /* for -C, -c and -D switches */ -extern array_header *ap_server_pre_read_config; -extern array_header *ap_server_post_read_config; -extern array_header *ap_server_config_defines; + extern array_header *ap_server_pre_read_config; + extern array_header *ap_server_post_read_config; + extern array_header *ap_server_config_defines; /* We want this to have the least chance of being corrupted if there * is some memory corruption, so we allocate it statically. */ -extern char ap_coredump_dir[MAX_STRING_LEN]; + extern char ap_coredump_dir[MAX_STRING_LEN]; #ifdef __cplusplus } #endif - -#endif /* !APACHE_HTTP_CONF_GLOBALS_H */ +#endif /* !APACHE_HTTP_CONF_GLOBALS_H */ diff --git a/src/afsweb/apache_includes/1.3.6/httpd.h b/src/afsweb/apache_includes/1.3.6/httpd.h index 60d3582dc..b92580537 100644 --- a/src/afsweb/apache_includes/1.3.6/httpd.h +++ b/src/afsweb/apache_includes/1.3.6/httpd.h @@ -88,7 +88,7 @@ extern "C" { #else #define HTTPD_ROOT "/usr/local/apache" #endif -#endif /* HTTPD_ROOT */ +#endif /* HTTPD_ROOT */ /* Default location of documents. Can be overridden by the DocumentRoot * directive. @@ -100,7 +100,7 @@ extern "C" { #else #define DOCUMENT_LOCATION HTTPD_ROOT "/htdocs" #endif -#endif /* DOCUMENT_LOCATION */ +#endif /* DOCUMENT_LOCATION */ /* Max. number of dynamically loaded modules */ #ifndef DYNAMIC_MODULE_LIMIT @@ -156,7 +156,7 @@ extern "C" { #else #define DEFAULT_XFERLOG "logs/access_log" #endif -#endif /* DEFAULT_XFERLOG */ +#endif /* DEFAULT_XFERLOG */ #ifndef DEFAULT_ERRORLOG #if defined(OS2) || defined(WIN32) @@ -164,7 +164,7 @@ extern "C" { #else #define DEFAULT_ERRORLOG "logs/error_log" #endif -#endif /* DEFAULT_ERRORLOG */ +#endif /* DEFAULT_ERRORLOG */ #ifndef DEFAULT_PIDLOG #define DEFAULT_PIDLOG "logs/httpd.pid" @@ -200,7 +200,7 @@ extern "C" { #else #define DEFAULT_ACCESS_FNAME ".htaccess" #endif -#endif /* DEFAULT_ACCESS_FNAME */ +#endif /* DEFAULT_ACCESS_FNAME */ /* The name of the server config file */ #ifndef SERVER_CONFIG_FILE @@ -244,7 +244,7 @@ extern "C" { #else #define SHELL_PATH "/bin/sh" #endif -#endif /* SHELL_PATH */ +#endif /* SHELL_PATH */ /* The path to the suExec wrapper, can be overridden in Configuration */ #ifndef SUEXEC_BIN @@ -392,13 +392,13 @@ extern "C" { */ #ifndef DEFAULT_LIMIT_REQUEST_LINE #define DEFAULT_LIMIT_REQUEST_LINE 8190 -#endif /* default limit on bytes in Request-Line (Method+URI+HTTP-version) */ +#endif /* default limit on bytes in Request-Line (Method+URI+HTTP-version) */ #ifndef DEFAULT_LIMIT_REQUEST_FIELDSIZE #define DEFAULT_LIMIT_REQUEST_FIELDSIZE 8190 -#endif /* default limit on bytes in any one header field */ +#endif /* default limit on bytes in any one header field */ #ifndef DEFAULT_LIMIT_REQUEST_FIELDS #define DEFAULT_LIMIT_REQUEST_FIELDS 100 -#endif /* default limit on number of request header fields */ +#endif /* default limit on number of request header fields */ /* * The below defines the base string of the Server: header. Additional @@ -415,15 +415,15 @@ extern "C" { #define SERVER_BASEVERSION "Apache/1.3.6" /* SEE COMMENTS ABOVE */ #define SERVER_VERSION SERVER_BASEVERSION -enum server_token_type { - SrvTk_MIN, /* eg: Apache/1.3.0 */ - SrvTk_OS, /* eg: Apache/1.3.0 (UNIX) */ - SrvTk_FULL /* eg: Apache/1.3.0 (UNIX) PHP/3.0 FooBar/1.2b */ -}; + enum server_token_type { + SrvTk_MIN, /* eg: Apache/1.3.0 */ + SrvTk_OS, /* eg: Apache/1.3.0 (UNIX) */ + SrvTk_FULL /* eg: Apache/1.3.0 (UNIX) PHP/3.0 FooBar/1.2b */ + }; -API_EXPORT(const char *) ap_get_server_version(void); -API_EXPORT(void) ap_add_version_component(const char *component); -API_EXPORT(const char *) ap_get_server_built(void); + API_EXPORT(const char *) ap_get_server_version(void); + API_EXPORT(void) ap_add_version_component(const char *component); + API_EXPORT(const char *) ap_get_server_built(void); /* Numeric release version identifier: MMNNFFRBB: major minor fix final beta * Always increases along the same track as the source branch. @@ -563,8 +563,8 @@ API_EXPORT(const char *) ap_get_server_built(void); #define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html" #define INCLUDES_MAGIC_TYPE3 "text/x-server-parsed-html3" #ifdef CHARSET_EBCDIC -#define ASCIITEXT_MAGIC_TYPE_PREFIX "text/x-ascii-" /* Text files whose content-type starts with this are passed thru unconverted */ -#endif /*CHARSET_EBCDIC*/ +#define ASCIITEXT_MAGIC_TYPE_PREFIX "text/x-ascii-" /* Text files whose content-type starts with this are passed thru unconverted */ +#endif /*CHARSET_EBCDIC */ #define MAP_FILE_MAGIC_TYPE "application/x-type-map" #define ASIS_MAGIC_TYPE "httpd/send-as-is" #define DIR_MAGIC_TYPE "httpd/unix-directory" @@ -574,7 +574,7 @@ API_EXPORT(const char *) ap_get_server_built(void); #ifndef CHARSET_EBCDIC #define LF 10 #define CR 13 -#else /* CHARSET_EBCDIC */ +#else /* CHARSET_EBCDIC */ #include "ebcdic.h" /* OSD_POSIX uses the EBCDIC charset. The transition ASCII->EBCDIC is done in * the buff package (bread/bputs/bwrite), so everywhere else, we use @@ -585,7 +585,7 @@ API_EXPORT(const char *) ap_get_server_built(void); */ #define CR '\r' #define LF '\n' -#endif /* CHARSET_EBCDIC */ +#endif /* CHARSET_EBCDIC */ /* Possible values for request_rec.read_body (set by handling module): * REQUEST_NO_BODY Send 413 error if message has any body @@ -614,156 +614,156 @@ API_EXPORT(const char *) ap_get_server_built(void); /* This represents the result of calling htaccess; these are cached for * each request. */ -struct htaccess_result { - char *dir; /* the directory to which this applies */ - int override; /* the overrides allowed for the .htaccess file */ - void *htaccess; /* the configuration directives */ + struct htaccess_result { + char *dir; /* the directory to which this applies */ + int override; /* the overrides allowed for the .htaccess file */ + void *htaccess; /* the configuration directives */ /* the next one, or NULL if no more; N.B. never change this */ - const struct htaccess_result *next; -}; + const struct htaccess_result *next; + }; -typedef struct conn_rec conn_rec; -typedef struct server_rec server_rec; -typedef struct request_rec request_rec; -typedef struct listen_rec listen_rec; + typedef struct conn_rec conn_rec; + typedef struct server_rec server_rec; + typedef struct request_rec request_rec; + typedef struct listen_rec listen_rec; #include "util_uri.h" -struct request_rec { + struct request_rec { - ap_pool *pool; - conn_rec *connection; - server_rec *server; + ap_pool *pool; + conn_rec *connection; + server_rec *server; - request_rec *next; /* If we wind up getting redirected, + request_rec *next; /* If we wind up getting redirected, * pointer to the request we redirected to. */ - request_rec *prev; /* If this is an internal redirect, + request_rec *prev; /* If this is an internal redirect, * pointer to where we redirected *from*. */ - request_rec *main; /* If this is a sub_request (see request.h) + request_rec *main; /* If this is a sub_request (see request.h) * pointer back to the main request. */ - /* Info about the request itself... we begin with stuff that only - * protocol.c should ever touch... - */ + /* Info about the request itself... we begin with stuff that only + * protocol.c should ever touch... + */ - char *the_request; /* First line of request, so we can log it */ - int assbackwards; /* HTTP/0.9, "simple" request */ - int proxyreq; /* A proxy request (calculated during + char *the_request; /* First line of request, so we can log it */ + int assbackwards; /* HTTP/0.9, "simple" request */ + int proxyreq; /* A proxy request (calculated during * post_read_request or translate_name) */ - int header_only; /* HEAD request, as opposed to GET */ - char *protocol; /* Protocol, as given to us, or HTTP/0.9 */ - int proto_num; /* Number version of protocol; 1.1 = 1001 */ - const char *hostname; /* Host, as set by full URI or Host: */ - - time_t request_time; /* When the request started */ - - const char *status_line; /* Status line, if set by script */ - int status; /* In any case */ - - /* Request method, two ways; also, protocol, etc.. Outside of protocol.c, - * look, but don't touch. - */ - - const char *method; /* GET, HEAD, POST, etc. */ - int method_number; /* M_GET, M_POST, etc. */ - - /* - allowed is a bitvector of the allowed methods. - - A handler must ensure that the request method is one that - it is capable of handling. Generally modules should DECLINE - any request methods they do not handle. Prior to aborting the - handler like this the handler should set r->allowed to the list - of methods that it is willing to handle. This bitvector is used - to construct the "Allow:" header required for OPTIONS requests, - and METHOD_NOT_ALLOWED and NOT_IMPLEMENTED status codes. - - Since the default_handler deals with OPTIONS, all modules can - usually decline to deal with OPTIONS. TRACE is always allowed, - modules don't need to set it explicitly. - - Since the default_handler will always handle a GET, a - module which does *not* implement GET should probably return - METHOD_NOT_ALLOWED. Unfortunately this means that a Script GET - handler can't be installed by mod_actions. - */ - int allowed; /* Allowed methods - for 405, OPTIONS, etc */ - - int sent_bodyct; /* byte count in stream is for body */ - long bytes_sent; /* body byte count, for easy access */ - time_t mtime; /* Time the resource was last modified */ - - /* HTTP/1.1 connection-level features */ - - int chunked; /* sending chunked transfer-coding */ - int byterange; /* number of byte ranges */ - char *boundary; /* multipart/byteranges boundary */ - const char *range; /* The Range: header */ - long clength; /* The "real" content length */ - - long remaining; /* bytes left to read */ - long read_length; /* bytes that have been read */ - int read_body; /* how the request body should be read */ - int read_chunked; /* reading chunked transfer-coding */ - unsigned expecting_100; /* is client waiting for a 100 response? */ - - /* MIME header environments, in and out. Also, an array containing - * environment variables to be passed to subprocesses, so people can - * write modules to add to that environment. - * - * The difference between headers_out and err_headers_out is that the - * latter are printed even on error, and persist across internal redirects - * (so the headers printed for ErrorDocument handlers will have them). - * - * The 'notes' table is for notes from one module to another, with no - * other set purpose in mind... - */ - - table *headers_in; - table *headers_out; - table *err_headers_out; - table *subprocess_env; - table *notes; - - /* content_type, handler, content_encoding, content_language, and all - * content_languages MUST be lowercased strings. They may be pointers - * to static strings; they should not be modified in place. - */ - const char *content_type; /* Break these out --- we dispatch on 'em */ - const char *handler; /* What we *really* dispatch on */ - - const char *content_encoding; - const char *content_language; /* for back-compat. only -- do not use */ - array_header *content_languages; /* array of (char*) */ - - char *vlist_validator; /* variant list validator (if negotiated) */ - - int no_cache; - int no_local_copy; - - /* What object is being requested (either directly, or via include - * or content-negotiation mapping). - */ - - char *unparsed_uri; /* the uri without any parsing performed */ - char *uri; /* the path portion of the URI */ - char *filename; - char *path_info; - char *args; /* QUERY_ARGS, if any */ - struct stat finfo; /* ST_MODE set to zero if no such file */ - uri_components parsed_uri; /* components of uri, dismantled */ - - /* Various other config info which may change with .htaccess files - * These are config vectors, with one void* pointer for each module - * (the thing pointed to being the module's business). - */ - - void *per_dir_config; /* Options set in config files, etc. */ - void *request_config; /* Notes on *this* request */ + int header_only; /* HEAD request, as opposed to GET */ + char *protocol; /* Protocol, as given to us, or HTTP/0.9 */ + int proto_num; /* Number version of protocol; 1.1 = 1001 */ + const char *hostname; /* Host, as set by full URI or Host: */ + + time_t request_time; /* When the request started */ + + const char *status_line; /* Status line, if set by script */ + int status; /* In any case */ + + /* Request method, two ways; also, protocol, etc.. Outside of protocol.c, + * look, but don't touch. + */ + + const char *method; /* GET, HEAD, POST, etc. */ + int method_number; /* M_GET, M_POST, etc. */ + + /* + * allowed is a bitvector of the allowed methods. + * + * A handler must ensure that the request method is one that + * it is capable of handling. Generally modules should DECLINE + * any request methods they do not handle. Prior to aborting the + * handler like this the handler should set r->allowed to the list + * of methods that it is willing to handle. This bitvector is used + * to construct the "Allow:" header required for OPTIONS requests, + * and METHOD_NOT_ALLOWED and NOT_IMPLEMENTED status codes. + * + * Since the default_handler deals with OPTIONS, all modules can + * usually decline to deal with OPTIONS. TRACE is always allowed, + * modules don't need to set it explicitly. + * + * Since the default_handler will always handle a GET, a + * module which does *not* implement GET should probably return + * METHOD_NOT_ALLOWED. Unfortunately this means that a Script GET + * handler can't be installed by mod_actions. + */ + int allowed; /* Allowed methods - for 405, OPTIONS, etc */ + + int sent_bodyct; /* byte count in stream is for body */ + long bytes_sent; /* body byte count, for easy access */ + time_t mtime; /* Time the resource was last modified */ + + /* HTTP/1.1 connection-level features */ + + int chunked; /* sending chunked transfer-coding */ + int byterange; /* number of byte ranges */ + char *boundary; /* multipart/byteranges boundary */ + const char *range; /* The Range: header */ + long clength; /* The "real" content length */ + + long remaining; /* bytes left to read */ + long read_length; /* bytes that have been read */ + int read_body; /* how the request body should be read */ + int read_chunked; /* reading chunked transfer-coding */ + unsigned expecting_100; /* is client waiting for a 100 response? */ + + /* MIME header environments, in and out. Also, an array containing + * environment variables to be passed to subprocesses, so people can + * write modules to add to that environment. + * + * The difference between headers_out and err_headers_out is that the + * latter are printed even on error, and persist across internal redirects + * (so the headers printed for ErrorDocument handlers will have them). + * + * The 'notes' table is for notes from one module to another, with no + * other set purpose in mind... + */ + + table *headers_in; + table *headers_out; + table *err_headers_out; + table *subprocess_env; + table *notes; + + /* content_type, handler, content_encoding, content_language, and all + * content_languages MUST be lowercased strings. They may be pointers + * to static strings; they should not be modified in place. + */ + const char *content_type; /* Break these out --- we dispatch on 'em */ + const char *handler; /* What we *really* dispatch on */ + + const char *content_encoding; + const char *content_language; /* for back-compat. only -- do not use */ + array_header *content_languages; /* array of (char*) */ + + char *vlist_validator; /* variant list validator (if negotiated) */ + + int no_cache; + int no_local_copy; + + /* What object is being requested (either directly, or via include + * or content-negotiation mapping). + */ + + char *unparsed_uri; /* the uri without any parsing performed */ + char *uri; /* the path portion of the URI */ + char *filename; + char *path_info; + char *args; /* QUERY_ARGS, if any */ + struct stat finfo; /* ST_MODE set to zero if no such file */ + uri_components parsed_uri; /* components of uri, dismantled */ + + /* Various other config info which may change with .htaccess files + * These are config vectors, with one void* pointer for each module + * (the thing pointed to being the module's business). + */ + + void *per_dir_config; /* Options set in config files, etc. */ + void *request_config; /* Notes on *this* request */ /* * a linked list of the configuration directives in the .htaccess files @@ -771,58 +771,58 @@ struct request_rec { * N.B. always add to the head of the list, _never_ to the end. * that way, a sub request's list can (temporarily) point to a parent's list */ - const struct htaccess_result *htaccess; + const struct htaccess_result *htaccess; /* Things placed at the end of the record to avoid breaking binary * compatibility. It would be nice to remember to reorder the entire * record to improve 64bit alignment the next time we need to break * binary compatibility for some other reason. */ -}; + }; /* Things which are per connection */ -struct conn_rec { + struct conn_rec { - ap_pool *pool; - server_rec *server; - server_rec *base_server; /* Physical vhost this conn come in on */ - void *vhost_lookup_data; /* used by http_vhost.c */ + ap_pool *pool; + server_rec *server; + server_rec *base_server; /* Physical vhost this conn come in on */ + void *vhost_lookup_data; /* used by http_vhost.c */ - /* Information about the connection itself */ + /* Information about the connection itself */ - int child_num; /* The number of the child handling conn_rec */ - BUFF *client; /* Connection to the guy */ + int child_num; /* The number of the child handling conn_rec */ + BUFF *client; /* Connection to the guy */ - /* Who is the client? */ + /* Who is the client? */ - struct sockaddr_in local_addr; /* local address */ - struct sockaddr_in remote_addr; /* remote address */ - char *remote_ip; /* Client's IP address */ - char *remote_host; /* Client's DNS name, if known. + struct sockaddr_in local_addr; /* local address */ + struct sockaddr_in remote_addr; /* remote address */ + char *remote_ip; /* Client's IP address */ + char *remote_host; /* Client's DNS name, if known. * NULL if DNS hasn't been checked, * "" if it has and no address was found. * N.B. Only access this though * get_remote_host() */ - char *remote_logname; /* Only ever set if doing rfc1413 lookups. + char *remote_logname; /* Only ever set if doing rfc1413 lookups. * N.B. Only access this through * get_remote_logname() */ - char *user; /* If an authentication check was made, + char *user; /* If an authentication check was made, * this gets set to the user name. We assume * that there's only one user per connection(!) */ - char *ap_auth_type; /* Ditto. */ + char *ap_auth_type; /* Ditto. */ - unsigned aborted:1; /* Are we still talking? */ - signed int keepalive:2; /* Are we using HTTP Keep-Alive? + unsigned aborted:1; /* Are we still talking? */ + signed int keepalive:2; /* Are we using HTTP Keep-Alive? * -1 fatal error, 0 undecided, 1 yes */ - unsigned keptalive:1; /* Did we use HTTP Keep-Alive? */ - signed int double_reverse:2;/* have we done double-reverse DNS? - * -1 yes/failure, 0 not yet, 1 yes/success */ - int keepalives; /* How many times have we used it? */ -}; + unsigned keptalive:1; /* Did we use HTTP Keep-Alive? */ + signed int double_reverse:2; /* have we done double-reverse DNS? + * -1 yes/failure, 0 not yet, 1 yes/success */ + int keepalives; /* How many times have we used it? */ + }; /* Per-vhost config... */ @@ -831,193 +831,214 @@ struct conn_rec { */ #define DEFAULT_VHOST_ADDR 0xfffffffful -typedef struct server_addr_rec server_addr_rec; -struct server_addr_rec { - server_addr_rec *next; - struct in_addr host_addr; /* The bound address, for this server */ - unsigned short host_port; /* The bound port, for this server */ - char *virthost; /* The name given in */ -}; + typedef struct server_addr_rec server_addr_rec; + struct server_addr_rec { + server_addr_rec *next; + struct in_addr host_addr; /* The bound address, for this server */ + unsigned short host_port; /* The bound port, for this server */ + char *virthost; /* The name given in */ + }; -struct server_rec { + struct server_rec { - server_rec *next; + server_rec *next; - /* description of where the definition came from */ - const char *defn_name; - unsigned defn_line_number; + /* description of where the definition came from */ + const char *defn_name; + unsigned defn_line_number; - /* Full locations of server config info */ + /* Full locations of server config info */ - char *srm_confname; - char *access_confname; + char *srm_confname; + char *access_confname; - /* Contact information */ + /* Contact information */ - char *server_admin; - char *server_hostname; - unsigned short port; /* for redirects, etc. */ + char *server_admin; + char *server_hostname; + unsigned short port; /* for redirects, etc. */ - /* Log files --- note that transfer log is now in the modules... */ + /* Log files --- note that transfer log is now in the modules... */ - char *error_fname; - FILE *error_log; - int loglevel; + char *error_fname; + FILE *error_log; + int loglevel; - /* Module-specific configuration for server, and defaults... */ + /* Module-specific configuration for server, and defaults... */ - int is_virtual; /* true if this is the virtual server */ - void *module_config; /* Config vector containing pointers to + int is_virtual; /* true if this is the virtual server */ + void *module_config; /* Config vector containing pointers to * modules' per-server config structures. */ - void *lookup_defaults; /* MIME type info, etc., before we start + void *lookup_defaults; /* MIME type info, etc., before we start * checking per-directory info. */ - /* Transaction handling */ + /* Transaction handling */ - server_addr_rec *addrs; - int timeout; /* Timeout, in seconds, before we give up */ - int keep_alive_timeout; /* Seconds we'll wait for another request */ - int keep_alive_max; /* Maximum requests per connection */ - int keep_alive; /* Use persistent connections? */ - int send_buffer_size; /* size of TCP send buffer (in bytes) */ + server_addr_rec *addrs; + int timeout; /* Timeout, in seconds, before we give up */ + int keep_alive_timeout; /* Seconds we'll wait for another request */ + int keep_alive_max; /* Maximum requests per connection */ + int keep_alive; /* Use persistent connections? */ + int send_buffer_size; /* size of TCP send buffer (in bytes) */ - char *path; /* Pathname for ServerPath */ - int pathlen; /* Length of path */ + char *path; /* Pathname for ServerPath */ + int pathlen; /* Length of path */ - array_header *names; /* Normal names for ServerAlias servers */ - array_header *wild_names; /* Wildcarded names for ServerAlias servers */ + array_header *names; /* Normal names for ServerAlias servers */ + array_header *wild_names; /* Wildcarded names for ServerAlias servers */ - uid_t server_uid; /* effective user id when calling exec wrapper */ - gid_t server_gid; /* effective group id when calling exec wrapper */ + uid_t server_uid; /* effective user id when calling exec wrapper */ + gid_t server_gid; /* effective group id when calling exec wrapper */ - int limit_req_line; /* limit on size of the HTTP request line */ - int limit_req_fieldsize; /* limit on size of any request header field */ - int limit_req_fields; /* limit on number of request header fields */ -}; + int limit_req_line; /* limit on size of the HTTP request line */ + int limit_req_fieldsize; /* limit on size of any request header field */ + int limit_req_fields; /* limit on number of request header fields */ + }; /* These are more like real hosts than virtual hosts */ -struct listen_rec { - listen_rec *next; - struct sockaddr_in local_addr; /* local IP address and port */ - int fd; - int used; /* Only used during restart */ + struct listen_rec { + listen_rec *next; + struct sockaddr_in local_addr; /* local IP address and port */ + int fd; + int used; /* Only used during restart */ /* more stuff here, like which protocol is bound to the port */ -}; + }; /* Prototypes for utilities... util.c. */ -extern void ap_util_init(void); + extern void ap_util_init(void); /* Time */ -extern API_VAR_EXPORT const char ap_month_snames[12][4]; -extern API_VAR_EXPORT const char ap_day_snames[7][4]; + extern API_VAR_EXPORT const char ap_month_snames[12][4]; + extern API_VAR_EXPORT const char ap_day_snames[7][4]; -API_EXPORT(struct tm *) ap_get_gmtoff(int *tz); -API_EXPORT(char *) ap_get_time(void); -API_EXPORT(char *) ap_ht_time(pool *p, time_t t, const char *fmt, int gmt); -API_EXPORT(char *) ap_gm_timestr_822(pool *p, time_t t); + API_EXPORT(struct tm *) ap_get_gmtoff(int *tz); + API_EXPORT(char *) ap_get_time(void); + API_EXPORT(char *) ap_ht_time(pool * p, time_t t, const char *fmt, + int gmt); + API_EXPORT(char *) ap_gm_timestr_822(pool * p, time_t t); /* String handling. The *_nc variants allow you to use non-const char **s as arguments (unfortunately C won't automatically convert a char ** to a const char **) */ -API_EXPORT(char *) ap_getword(pool *p, const char **line, char stop); -API_EXPORT(char *) ap_getword_nc(pool *p, char **line, char stop); -API_EXPORT(char *) ap_getword_white(pool *p, const char **line); -API_EXPORT(char *) ap_getword_white_nc(pool *p, char **line); -API_EXPORT(char *) ap_getword_nulls(pool *p, const char **line, char stop); -API_EXPORT(char *) ap_getword_nulls_nc(pool *p, char **line, char stop); -API_EXPORT(char *) ap_getword_conf(pool *p, const char **line); -API_EXPORT(char *) ap_getword_conf_nc(pool *p, char **line); - -API_EXPORT(const char *) ap_size_list_item(const char **field, int *len); -API_EXPORT(char *) ap_get_list_item(pool *p, const char **field); -API_EXPORT(int) ap_find_list_item(pool *p, const char *line, const char *tok); - -API_EXPORT(char *) ap_get_token(pool *p, const char **accept_line, int accept_white); -API_EXPORT(int) ap_find_token(pool *p, const char *line, const char *tok); -API_EXPORT(int) ap_find_last_token(pool *p, const char *line, const char *tok); - -API_EXPORT(int) ap_is_url(const char *u); -API_EXPORT(int) ap_unescape_url(char *url); -API_EXPORT(void) ap_no2slash(char *name); -API_EXPORT(void) ap_getparents(char *name); -API_EXPORT(char *) ap_escape_path_segment(pool *p, const char *s); -API_EXPORT(char *) ap_os_escape_path(pool *p, const char *path, int partial); + API_EXPORT(char *) ap_getword(pool * p, const char **line, char stop); + API_EXPORT(char *) ap_getword_nc(pool * p, char **line, char stop); + API_EXPORT(char *) ap_getword_white(pool * p, const char **line); + API_EXPORT(char *) ap_getword_white_nc(pool * p, char **line); + API_EXPORT(char *) ap_getword_nulls(pool * p, const char **line, + char stop); + API_EXPORT(char *) ap_getword_nulls_nc(pool * p, char **line, + char stop); + API_EXPORT(char *) ap_getword_conf(pool * p, const char **line); + API_EXPORT(char *) ap_getword_conf_nc(pool * p, char **line); + + API_EXPORT(const char *) ap_size_list_item(const char **field, + int *len); + API_EXPORT(char *) ap_get_list_item(pool * p, const char **field); + API_EXPORT(int) ap_find_list_item(pool * p, const char *line, + const char *tok); + + API_EXPORT(char *) ap_get_token(pool * p, const char **accept_line, + int accept_white); + API_EXPORT(int) ap_find_token(pool * p, const char *line, + const char *tok); + API_EXPORT(int) ap_find_last_token(pool * p, const char *line, + const char *tok); + + API_EXPORT(int) ap_is_url(const char *u); + API_EXPORT(int) ap_unescape_url(char *url); + API_EXPORT(void) ap_no2slash(char *name); + API_EXPORT(void) ap_getparents(char *name); + API_EXPORT(char *) ap_escape_path_segment(pool * p, const char *s); + API_EXPORT(char *) ap_os_escape_path(pool * p, const char *path, + int partial); #define ap_escape_uri(ppool,path) ap_os_escape_path(ppool,path,1) -API_EXPORT(char *) ap_escape_html(pool *p, const char *s); -API_EXPORT(char *) ap_construct_server(pool *p, const char *hostname, - unsigned port, const request_rec *r); -API_EXPORT(char *) ap_escape_shell_cmd(pool *p, const char *s); - -API_EXPORT(int) ap_count_dirs(const char *path); -API_EXPORT(char *) ap_make_dirstr_prefix(char *d, const char *s, int n); -API_EXPORT(char *) ap_make_dirstr_parent(pool *p, const char *s); + API_EXPORT(char *) ap_escape_html(pool * p, const char *s); + API_EXPORT(char *) ap_construct_server(pool * p, const char *hostname, + unsigned port, + const request_rec * r); + API_EXPORT(char *) ap_escape_shell_cmd(pool * p, const char *s); + + API_EXPORT(int) ap_count_dirs(const char *path); + API_EXPORT(char *) ap_make_dirstr_prefix(char *d, const char *s, int n); + API_EXPORT(char *) ap_make_dirstr_parent(pool * p, const char *s); /* deprecated. The previous two routines are preferred. */ -API_EXPORT(char *) ap_make_dirstr(pool *a, const char *s, int n); -API_EXPORT(char *) ap_make_full_path(pool *a, const char *dir, const char *f); - -API_EXPORT(int) ap_is_matchexp(const char *str); -API_EXPORT(int) ap_strcmp_match(const char *str, const char *exp); -API_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp); -API_EXPORT(char *) ap_uudecode(pool *, const char *); -API_EXPORT(char *) ap_uuencode(pool *p, char *string); + API_EXPORT(char *) ap_make_dirstr(pool * a, const char *s, int n); + API_EXPORT(char *) ap_make_full_path(pool * a, const char *dir, + const char *f); + + API_EXPORT(int) ap_is_matchexp(const char *str); + API_EXPORT(int) ap_strcmp_match(const char *str, const char *exp); + API_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp); + API_EXPORT(char *) ap_uudecode(pool *, const char *); + API_EXPORT(char *) ap_uuencode(pool * p, char *string); #ifdef OS2 -void os2pathname(char *path); + void os2pathname(char *path); #endif -API_EXPORT(char *) ap_pregsub(pool *p, const char *input, const char *source, - size_t nmatch, regmatch_t pmatch[]); + API_EXPORT(char *) ap_pregsub(pool * p, const char *input, + const char *source, size_t nmatch, + regmatch_t pmatch[]); -API_EXPORT(void) ap_content_type_tolower(char *); -API_EXPORT(void) ap_str_tolower(char *); -API_EXPORT(int) ap_ind(const char *, char); /* Sigh... */ -API_EXPORT(int) ap_rind(const char *, char); + API_EXPORT(void) ap_content_type_tolower(char *); + API_EXPORT(void) ap_str_tolower(char *); + API_EXPORT(int) ap_ind(const char *, char); /* Sigh... */ + API_EXPORT(int) ap_rind(const char *, char); -API_EXPORT(char *) ap_escape_quotes (pool *p, const char *instring); + API_EXPORT(char *) ap_escape_quotes(pool * p, const char *instring); /* Common structure for reading of config files / passwd files etc. */ -typedef struct { - int (*getch) (void *param); /* a getc()-like function */ - void *(*getstr) (void *buf, size_t bufsiz, void *param); /* a fgets()-like function */ - int (*close) (void *param); /* a close hander function */ - void *param; /* the argument passed to getch/getstr/close */ - const char *name; /* the filename / description */ - unsigned line_number; /* current line number, starting at 1 */ -} configfile_t; + typedef struct { + int (*getch) (void *param); /* a getc()-like function */ + void *(*getstr) (void *buf, size_t bufsiz, void *param); /* a fgets()-like function */ + int (*close) (void *param); /* a close hander function */ + void *param; /* the argument passed to getch/getstr/close */ + const char *name; /* the filename / description */ + unsigned line_number; /* current line number, starting at 1 */ + } configfile_t; /* Open a configfile_t as FILE, return open configfile_t struct pointer */ -API_EXPORT(configfile_t *) ap_pcfg_openfile(pool *p, const char *name); + API_EXPORT(configfile_t *) ap_pcfg_openfile(pool * p, const char *name); /* Allocate a configfile_t handle with user defined functions and params */ -API_EXPORT(configfile_t *) ap_pcfg_open_custom(pool *p, const char *descr, - void *param, - int(*getc_func)(void*), - void *(*gets_func) (void *buf, size_t bufsiz, void *param), - int(*close_func)(void *param)); + API_EXPORT(configfile_t *) ap_pcfg_open_custom(pool * p, + const char *descr, + void *param, + int (*getc_func) (void + *), + void *(*gets_func) (void + *buf, + size_t + bufsiz, + void + *param), + int (*close_func) (void + *param)); /* Read one line from open configfile_t, strip LF, increase line number */ -API_EXPORT(int) ap_cfg_getline(char *buf, size_t bufsize, configfile_t *cfp); + API_EXPORT(int) ap_cfg_getline(char *buf, size_t bufsize, + configfile_t * cfp); /* Read one char from open configfile_t, increase line number upon LF */ -API_EXPORT(int) ap_cfg_getc(configfile_t *cfp); + API_EXPORT(int) ap_cfg_getc(configfile_t * cfp); /* Detach from open configfile_t, calling the close handler */ -API_EXPORT(int) ap_cfg_closefile(configfile_t *cfp); + API_EXPORT(int) ap_cfg_closefile(configfile_t * cfp); #ifdef NEED_STRERROR -char *strerror(int err); + char *strerror(int err); #endif /* Misc system hackery */ -API_EXPORT(uid_t) ap_uname2id(const char *name); -API_EXPORT(gid_t) ap_gname2id(const char *name); -API_EXPORT(int) ap_is_directory(const char *name); -API_EXPORT(int) ap_can_exec(const struct stat *); -API_EXPORT(void) ap_chdir_file(const char *file); + API_EXPORT(uid_t) ap_uname2id(const char *name); + API_EXPORT(gid_t) ap_gname2id(const char *name); + API_EXPORT(int) ap_is_directory(const char *name); + API_EXPORT(int) ap_can_exec(const struct stat *); + API_EXPORT(void) ap_chdir_file(const char *file); #ifndef HAVE_CANONICAL_FILENAME /* @@ -1027,10 +1048,12 @@ API_EXPORT(void) ap_chdir_file(const char *file); #define ap_os_case_canonical_filename(p,f) (f) #define ap_os_systemcase_filename(p,f) (f) #else -API_EXPORT(char *) ap_os_canonical_filename(pool *p, const char *file); + API_EXPORT(char *) ap_os_canonical_filename(pool * p, const char *file); #ifdef WIN32 -API_EXPORT(char *) ap_os_case_canonical_filename(pool *pPool, const char *szFile); -API_EXPORT(char *) ap_os_systemcase_filename(pool *pPool, const char *szFile); + API_EXPORT(char *) ap_os_case_canonical_filename(pool * pPool, + const char *szFile); + API_EXPORT(char *) ap_os_systemcase_filename(pool * pPool, + const char *szFile); #else #define ap_os_case_canonical_filename(p,f) ap_os_canonical_filename(p,f) #define ap_os_systemcase_filename(p,f) ap_os_canonical_filename(p,f) @@ -1038,14 +1061,15 @@ API_EXPORT(char *) ap_os_systemcase_filename(pool *pPool, const char *szFile); #endif #ifdef _OSD_POSIX -extern const char *os_set_account(pool *p, const char *account); -extern int os_init_job_environment(server_rec *s, const char *user_name, int one_process); -#endif /* _OSD_POSIX */ + extern const char *os_set_account(pool * p, const char *account); + extern int os_init_job_environment(server_rec * s, const char *user_name, + int one_process); +#endif /* _OSD_POSIX */ -char *ap_get_local_host(pool *); -unsigned long ap_get_virthost_addr(char *hostname, unsigned short *port); + char *ap_get_local_host(pool *); + unsigned long ap_get_virthost_addr(char *hostname, unsigned short *port); -extern API_VAR_EXPORT time_t ap_restart_time; + extern API_VAR_EXPORT time_t ap_restart_time; /* * Apache tries to keep all of its long term filehandles (such as log files, @@ -1074,18 +1098,19 @@ extern API_VAR_EXPORT time_t ap_restart_time; #ifdef NO_SLACK #define ap_slack(fd,line) (fd) #else -int ap_slack(int fd, int line); + int ap_slack(int fd, int line); #define AP_SLACK_LOW 1 #define AP_SLACK_HIGH 2 #endif -API_EXPORT(char *) ap_escape_quotes(pool *p, const char *instr); + API_EXPORT(char *) ap_escape_quotes(pool * p, const char *instr); /* * Redefine assert() to something more useful for an Apache... */ -API_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, int nLine) - __attribute__((noreturn)); + API_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, + int nLine) + __attribute__ ((noreturn)); #define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__)) /* The optimized timeout code only works if we're not MULTITHREAD and we're @@ -1108,7 +1133,7 @@ API_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, int nLine) #define SIGSTOP_CGI_CHILD 16 #ifdef DEBUG_SIGSTOP -extern int raise_sigstop_flags; + extern int raise_sigstop_flags; #define RAISE_SIGSTOP(x) do { \ if (raise_sigstop_flags & SIGSTOP_##x) raise(SIGSTOP);\ } while (0) @@ -1116,7 +1141,8 @@ extern int raise_sigstop_flags; #define RAISE_SIGSTOP(x) #endif -API_EXPORT(extern const char *) ap_psignature(const char *prefix, request_rec *r); + API_EXPORT(extern const char *) ap_psignature(const char *prefix, + request_rec * r); /* strtoul does not exist on sunos4. */ #ifdef strtoul @@ -1127,5 +1153,4 @@ API_EXPORT(extern const char *) ap_psignature(const char *prefix, request_rec *r #ifdef __cplusplus } #endif - -#endif /* !APACHE_HTTPD_H */ +#endif /* !APACHE_HTTPD_H */ diff --git a/src/afsweb/apache_includes/1.3.6/os-inline.c b/src/afsweb/apache_includes/1.3.6/os-inline.c index 54ff49a63..10c035e77 100644 --- a/src/afsweb/apache_includes/1.3.6/os-inline.c +++ b/src/afsweb/apache_includes/1.3.6/os-inline.c @@ -25,7 +25,8 @@ #endif -INLINE int ap_os_is_path_absolute(const char *file) +INLINE int +ap_os_is_path_absolute(const char *file) { - return file[0] == '/'; + return file[0] == '/'; } diff --git a/src/afsweb/apache_includes/1.3.6/os.h b/src/afsweb/apache_includes/1.3.6/os.h index 496cfa9f9..191d8ea36 100644 --- a/src/afsweb/apache_includes/1.3.6/os.h +++ b/src/afsweb/apache_includes/1.3.6/os.h @@ -135,10 +135,10 @@ const char *dlerror(void); #endif #define ap_os_dso_handle_t void * -void ap_os_dso_init(void); -void * ap_os_dso_load(const char *); -void ap_os_dso_unload(void *); -void * ap_os_dso_sym(void *, const char *); +void ap_os_dso_init(void); +void *ap_os_dso_load(const char *); +void ap_os_dso_unload(void *); +void *ap_os_dso_sym(void *, const char *); const char *ap_os_dso_error(void); -#endif /* !APACHE_OS_H */ +#endif /* !APACHE_OS_H */ diff --git a/src/afsweb/apache_includes/1.3.6/util_uri.h b/src/afsweb/apache_includes/1.3.6/util_uri.h index d5a67593f..1ecd4214a 100644 --- a/src/afsweb/apache_includes/1.3.6/util_uri.h +++ b/src/afsweb/apache_includes/1.3.6/util_uri.h @@ -65,10 +65,10 @@ extern "C" { #endif -typedef struct { - const char *name; - unsigned short default_port; -} schemes_t; + typedef struct { + const char *name; + unsigned short default_port; + } schemes_t; #define DEFAULT_FTP_DATA_PORT 20 #define DEFAULT_FTP_PORT 21 @@ -87,42 +87,49 @@ typedef struct { #define UNP_OMITPATHINFO (1U<<4) /* Show "scheme://user@site:port" only */ #define UNP_OMITQUERY (1U<<5) /* Omit the "?queryarg" from the path */ -typedef struct { - char *scheme; /* scheme ("http"/"ftp"/...) */ - char *hostinfo; /* combined [user[:password]@]host[:port] */ - char *user; /* user name, as in http://user:passwd@host:port/ */ - char *password; /* password, as in http://user:passwd@host:port/ */ - char *hostname; /* hostname from URI (or from Host: header) */ - char *port_str; /* port string (integer representation is in "port") */ - char *path; /* the request path (or "/" if only scheme://host was given) */ - char *query; /* Everything after a '?' in the path, if present */ - char *fragment; /* Trailing "#fragment" string, if present */ + typedef struct { + char *scheme; /* scheme ("http"/"ftp"/...) */ + char *hostinfo; /* combined [user[:password]@]host[:port] */ + char *user; /* user name, as in http://user:passwd@host:port/ */ + char *password; /* password, as in http://user:passwd@host:port/ */ + char *hostname; /* hostname from URI (or from Host: header) */ + char *port_str; /* port string (integer representation is in "port") */ + char *path; /* the request path (or "/" if only scheme://host was given) */ + char *query; /* Everything after a '?' in the path, if present */ + char *fragment; /* Trailing "#fragment" string, if present */ - struct hostent *hostent; + struct hostent *hostent; - unsigned short port; /* The port number, numeric, valid only if port_str != NULL */ - - unsigned is_initialized:1; + unsigned short port; /* The port number, numeric, valid only if port_str != NULL */ - unsigned dns_looked_up:1; - unsigned dns_resolved:1; + unsigned is_initialized:1; -} uri_components; + unsigned dns_looked_up:1; + unsigned dns_resolved:1; + + } uri_components; /* util_uri.c */ -API_EXPORT(unsigned short) ap_default_port_for_scheme(const char *scheme_str); -API_EXPORT(unsigned short) ap_default_port_for_request(const request_rec *r); -API_EXPORT(struct hostent *) ap_pduphostent(pool *p, const struct hostent *hp); -API_EXPORT(struct hostent *) ap_pgethostbyname(pool *p, const char *hostname); -API_EXPORT(char *) ap_unparse_uri_components(pool *p, const uri_components *uptr, - unsigned flags); -API_EXPORT(int) ap_parse_uri_components(pool *p, const char *uri, uri_components *uptr); -API_EXPORT(int) ap_parse_hostinfo_components(pool *p, const char *hostinfo, uri_components *uptr); + API_EXPORT(unsigned short) ap_default_port_for_scheme(const char + *scheme_str); + API_EXPORT(unsigned short) ap_default_port_for_request(const request_rec + * r); + API_EXPORT(struct hostent *) ap_pduphostent(pool * p, + const struct hostent *hp); + API_EXPORT(struct hostent *) ap_pgethostbyname(pool * p, + const char *hostname); + API_EXPORT(char *) ap_unparse_uri_components(pool * p, + const uri_components * + uptr, unsigned flags); + API_EXPORT(int) ap_parse_uri_components(pool * p, const char *uri, + uri_components * uptr); + API_EXPORT(int) ap_parse_hostinfo_components(pool * p, + const char *hostinfo, + uri_components * uptr); /* called by the core in main() */ -extern void ap_util_uri_init(void); + extern void ap_util_uri_init(void); #ifdef __cplusplus } #endif - -#endif /*UTIL_URI_H*/ +#endif /*UTIL_URI_H */ diff --git a/src/afsweb/apache_includes/alloc.h b/src/afsweb/apache_includes/alloc.h index 858bf2cb5..d7bc76d60 100644 --- a/src/afsweb/apache_includes/alloc.h +++ b/src/afsweb/apache_includes/alloc.h @@ -76,18 +76,18 @@ typedef struct pool pool; extern pool *permanent_pool; void init_alloc(); /* Set up everything */ -pool *make_sub_pool (pool *); /* All pools are subpools of permanent_pool */ -void destroy_pool (pool *); +pool *make_sub_pool(pool *); /* All pools are subpools of permanent_pool */ +void destroy_pool(pool *); /* Clearing out EVERYTHING in an pool... destroys any sub-pools */ -void clear_pool (struct pool *); +void clear_pool(struct pool *); /* Preparing for exec() --- close files, etc., but *don't* flush I/O * buffers, *don't* wait for subprocesses, and *don't* free any memory. */ -void cleanup_for_exec (); +void cleanup_for_exec(); /* routines to allocate memory from an pool... */ @@ -95,7 +95,7 @@ void *palloc(struct pool *, int nbytes); void *pcalloc(struct pool *, int nbytes); extern char *pstrdup(struct pool *, const char *s); extern char *pstrndup(struct pool *, const char *s, int n); -char *pstrcat(struct pool *, ...); /* all '...' must be char* */ +char *pstrcat(struct pool *, ...); /* all '...' must be char* */ /* array and alist management... keeping lists of things. * Common enough to want common support code ... @@ -109,20 +109,20 @@ typedef struct { char *elts; } array_header; -array_header *make_array (pool *p, int nelts, int elt_size); -void *push_array (array_header *); -void array_cat (array_header *dst, const array_header *src); -array_header *append_arrays (pool *, const array_header *, - const array_header *); +array_header *make_array(pool * p, int nelts, int elt_size); +void *push_array(array_header *); +void array_cat(array_header * dst, const array_header * src); +array_header *append_arrays(pool *, const array_header *, + const array_header *); /* copy_array copies the *entire* array. copy_array_hdr just copies * the header, and arranges for the elements to be copied if (and only * if) the code subsequently does a push or arraycat. */ - -array_header *copy_array (pool *p, const array_header *src); -array_header *copy_array_hdr (pool *p, const array_header *src); - + +array_header *copy_array(pool * p, const array_header * src); +array_header *copy_array_hdr(pool * p, const array_header * src); + /* Tables. Implemented alist style, for now, though we try to keep * it so that imposing a hash table structure on top in the future @@ -133,8 +133,8 @@ array_header *copy_array_hdr (pool *p, const array_header *src); * currently being used... */ -typedef array_header table; - +typedef array_header table; + typedef struct { char *key; /* maybe NULL in future; * check when iterating thru table_elts @@ -142,20 +142,20 @@ typedef struct { char *val; } table_entry; -table *make_table (pool *p, int nelts); -table *copy_table (pool *p, const table *); -void clear_table (table *); -char *table_get (const table *, const char *); -void table_set (table *, const char *name, const char *val); -void table_merge (table *, const char *name, const char *more_val); -void table_unset (table *, const char *key); -void table_add (table *, const char *name, const char *val); -void table_do (int (*comp)(void *, const char *, const char *), void *rec, - const table *t, ...); +table *make_table(pool * p, int nelts); +table *copy_table(pool * p, const table *); +void clear_table(table *); +char *table_get(const table *, const char *); +void table_set(table *, const char *name, const char *val); +void table_merge(table *, const char *name, const char *more_val); +void table_unset(table *, const char *key); +void table_add(table *, const char *name, const char *val); +void table_do(int (*comp) (void *, const char *, const char *), void *rec, + const table * t, ...); -table *overlay_tables (pool *p, const table *overlay, const table *base); +table *overlay_tables(pool * p, const table * overlay, const table * base); -array_header *table_elts (table *); +array_header *table_elts(table *); #define is_empty_table(t) (((t) == NULL)||((t)->nelts == 0)) @@ -181,12 +181,11 @@ array_header *table_elts (table *); * unblock_alarms() below... */ -void register_cleanup (pool *p, void *data, - void (*plain_cleanup)(void *), - void (*child_cleanup)(void *)); +void register_cleanup(pool * p, void *data, void (*plain_cleanup) (void *), + void (*child_cleanup) (void *)); -void kill_cleanup (pool *p, void *data, void (*plain_cleanup)(void *)); -void run_cleanup (pool *p, void *data, void (*cleanup)(void *)); +void kill_cleanup(pool * p, void *data, void (*plain_cleanup) (void *)); +void run_cleanup(pool * p, void *data, void (*cleanup) (void *)); /* The time between when a resource is actually allocated, and when it * its cleanup is registered is a critical section, during which the @@ -207,14 +206,14 @@ extern void unblock_alarms(); FILE *pfopen(struct pool *, const char *name, const char *fmode); FILE *pfdopen(struct pool *, int fd, const char *fmode); -int popenf(struct pool *, const char *name, int flg, int mode); +int popenf(struct pool *, const char *name, int flg, int mode); -void note_cleanups_for_file (pool *, FILE *); -void note_cleanups_for_fd (pool *, int); -void kill_cleanups_for_fd (pool *p, int fd); +void note_cleanups_for_file(pool *, FILE *); +void note_cleanups_for_fd(pool *, int); +void kill_cleanups_for_fd(pool * p, int fd); -regex_t *pregcomp (pool *p, const char *pattern, int cflags); -void pregfree (pool *p, regex_t *reg); +regex_t *pregcomp(pool * p, const char *pattern, int cflags); +void pregfree(pool * p, regex_t * reg); /* routines to note closes... file descriptors are constrained enough * on some systems that we want to support this. @@ -232,12 +231,13 @@ int pclosef(struct pool *, int fd); * set the associated args to NULL). It takes as args a function * to call in the child, and an argument to be passed to the function. */ - -enum kill_conditions { kill_never, kill_always, kill_after_timeout, just_wait}; -int spawn_child_err (pool *, void (*)(void *), void *, - enum kill_conditions, FILE **pipe_in, FILE **pipe_out, - FILE **pipe_err); +enum kill_conditions { kill_never, kill_always, kill_after_timeout, + just_wait +}; + +int spawn_child_err(pool *, void (*)(void *), void *, enum kill_conditions, + FILE ** pipe_in, FILE ** pipe_out, FILE ** pipe_err); #define spawn_child(p,f,v,k,in,out) spawn_child_err(p,f,v,k,in,out,NULL) /* magic numbers --- min free bytes to consider a free pool block useable, @@ -248,5 +248,5 @@ int spawn_child_err (pool *, void (*)(void *), void *, /* Finally, some accounting */ -long bytes_in_pool(pool *p); +long bytes_in_pool(pool * p); long bytes_in_free_blocks(); diff --git a/src/afsweb/apache_includes/buff.h b/src/afsweb/apache_includes/buff.h index aa1926723..aae3e446c 100644 --- a/src/afsweb/apache_includes/buff.h +++ b/src/afsweb/apache_includes/buff.h @@ -65,8 +65,8 @@ #define B_RDERR (16) /* A write error has occurred */ #define B_WRERR (32) -#ifdef B_ERROR /* in SVR4: sometimes defined in /usr/include/sys/buf.h */ -#undef B_ERROR /* avoid "warning: `B_ERROR' redefined" */ +#ifdef B_ERROR /* in SVR4: sometimes defined in /usr/include/sys/buf.h */ +#undef B_ERROR /* avoid "warning: `B_ERROR' redefined" */ #endif #define B_ERROR (48) /* Use chunked writing */ @@ -76,60 +76,59 @@ typedef struct buff_struct BUFF; -struct buff_struct -{ - int flags; /* flags */ - unsigned char *inptr; /* pointer to next location to read */ - int incnt; /* number of bytes left to read from input buffer; - * always 0 if had a read error */ - int outchunk; /* location of chunk header when chunking */ - int outcnt; /* number of byte put in output buffer */ +struct buff_struct { + int flags; /* flags */ + unsigned char *inptr; /* pointer to next location to read */ + int incnt; /* number of bytes left to read from input buffer; + * always 0 if had a read error */ + int outchunk; /* location of chunk header when chunking */ + int outcnt; /* number of byte put in output buffer */ unsigned char *inbase; unsigned char *outbase; int bufsiz; - void (*error)(BUFF *fb, int op, void *data); + void (*error) (BUFF * fb, int op, void *data); void *error_data; - long int bytes_sent; /* number of bytes actually written */ + long int bytes_sent; /* number of bytes actually written */ pool *pool; /* could also put pointers to the basic I/O routines here */ - int fd; /* the file descriptor */ - int fd_in; /* input file descriptor, if different */ + int fd; /* the file descriptor */ + int fd_in; /* input file descriptor, if different */ }; /* Options to bset/getopt */ #define BO_BYTECT (1) /* Stream creation and modification */ -extern BUFF *bcreate(pool *p, int flags); -extern void bpushfd(BUFF *fb, int fd_in, int fd_out); -extern int bsetopt(BUFF *fb, int optname, const void *optval); -extern int bgetopt(BUFF *fb, int optname, void *optval); -extern int bsetflag(BUFF *fb, int flag, int value); -extern int bclose(BUFF *fb); +extern BUFF *bcreate(pool * p, int flags); +extern void bpushfd(BUFF * fb, int fd_in, int fd_out); +extern int bsetopt(BUFF * fb, int optname, const void *optval); +extern int bgetopt(BUFF * fb, int optname, void *optval); +extern int bsetflag(BUFF * fb, int flag, int value); +extern int bclose(BUFF * fb); #define bgetflag(fb, flag) ((fb)->flags & (flag)) /* Error handling */ -extern void bonerror(BUFF *fb, void (*error)(BUFF *, int, void *), +extern void bonerror(BUFF * fb, void (*error) (BUFF *, int, void *), void *data); /* I/O */ -extern int bread(BUFF *fb, void *buf, int nbyte); -extern int bgets(char *s, int n, BUFF *fb); -extern int blookc(char *buff, BUFF *fb); -extern int bskiplf(BUFF *fb); -extern int bwrite(BUFF *fb, const void *buf, int nbyte); -extern int bflush(BUFF *fb); -extern int bputs(const char *x, BUFF *fb); -extern int bvputs(BUFF *fb, ...); -extern int bprintf(BUFF *fb,const char *fmt,...); -extern int vbprintf(BUFF *fb,const char *fmt,va_list vlist); +extern int bread(BUFF * fb, void *buf, int nbyte); +extern int bgets(char *s, int n, BUFF * fb); +extern int blookc(char *buff, BUFF * fb); +extern int bskiplf(BUFF * fb); +extern int bwrite(BUFF * fb, const void *buf, int nbyte); +extern int bflush(BUFF * fb); +extern int bputs(const char *x, BUFF * fb); +extern int bvputs(BUFF * fb, ...); +extern int bprintf(BUFF * fb, const char *fmt, ...); +extern int vbprintf(BUFF * fb, const char *fmt, va_list vlist); /* Internal routines */ -extern int bflsbuf(int c, BUFF *fb); -extern int bfilbuf(BUFF *fb); +extern int bflsbuf(int c, BUFF * fb); +extern int bfilbuf(BUFF * fb); #define bgetc(fb) ( ((fb)->incnt == 0) ? bfilbuf(fb) : \ ((fb)->incnt--, *((fb)->inptr++)) ) diff --git a/src/afsweb/apache_includes/conf.h b/src/afsweb/apache_includes/conf.h index ee6f0be2a..771988fd7 100644 --- a/src/afsweb/apache_includes/conf.h +++ b/src/afsweb/apache_includes/conf.h @@ -84,7 +84,7 @@ char *crypt(const char *pw, const char *salt); char *mktemp(char *template); #define JMP_BUF sigjmp_buf #define HAVE_MMAP -#include +#include #define NEED_STRERROR typedef int rlim_t; #ifndef HAVE_MEMMOVE @@ -167,8 +167,8 @@ typedef int rlim_t; #define ULTRIX_BRAIN_DEATH #define NEED_STRDUP /* If you have Ultrix 4.3, and are using cc, const is broken */ -#ifndef __ultrix__ /* Hack to check for pre-Ultrix 4.4 cc */ -#define const /* Not implemented */ +#ifndef __ultrix__ /* Hack to check for pre-Ultrix 4.4 cc */ +#define const /* Not implemented */ #endif #define JMP_BUF sigjmp_buf @@ -245,7 +245,7 @@ typedef unsigned short mode_t; #ifndef rlim_t typedef int rlim_t; #endif -typedef u_long n_long; +typedef u_long n_long; #endif #define STDIN_FILENO 0 @@ -269,7 +269,7 @@ typedef int rlim_t; #undef NO_SETSID #undef NEED_STRDUP #define JMP_BUF sigjmp_buf -#include +#include #elif defined(SCO) #undef HAVE_GMTOFF @@ -278,8 +278,8 @@ typedef int rlim_t; #define NEED_INITGROUPS #define NO_WRITEV #define JMP_BUF sigjmp_buf -#define SIGURG SIGUSR1 /* but note, this signal will be sent to a process group if enabled (for OOB data). It is not currently enabled. */ -#include +#define SIGURG SIGUSR1 /* but note, this signal will be sent to a process group if enabled (for OOB data). It is not currently enabled. */ +#include #elif defined(SCO5) @@ -293,21 +293,21 @@ typedef int rlim_t; /* Although SCO 5 defines these in (note the "s") they don't have consts. Sigh. */ -extern int strcasecmp(const char *,const char *); -extern int strncasecmp(const char *,const char *,unsigned); +extern int strcasecmp(const char *, const char *); +extern int strncasecmp(const char *, const char *, unsigned); #elif defined(AUX) /* These are to let -Wall compile more cleanly */ extern int strcasecmp(const char *, const char *); -extern int strncasecmp(const char *,const char *,unsigned); +extern int strncasecmp(const char *, const char *, unsigned); extern int set42sig(), getopt(), getpeername(); extern int listen(), bind(), socket(), getsockname(); extern int accept(), gethostname(), connect(), lstat(); extern int select(), killpg(), shutdown(); extern int initgroups(), setsockopt(); extern char *shmat(); -extern int shmctl(); -extern int shmget(); +extern int shmctl(); +extern int shmget(); extern char *sbrk(); extern char *crypt(); #include @@ -415,7 +415,7 @@ typedef quad_t rlim_t; char *crypt(const char *pw, const char *salt); #endif #ifndef initgroups -int initgroups (char *, int); +int initgroups(char *, int); #endif #ifndef strncasecmp #define strncasecmp strnicmp @@ -449,7 +449,7 @@ int initgroups (char *, int); #define USE_FCNTL_SERIALIZED_ACCEPT #define HAVE_MMAP #define HAVE_CRYPT_H - + #elif defined(__EMX__) /* Defines required for EMX OS/2 port. */ #define JMP_BUF sigjmp_buf @@ -459,10 +459,10 @@ int initgroups (char *, int); #define NO_SETSID /* Add some drive name support */ #define chdir _chdir2 -#include +#include #define MAXSOCKETS 4096 #define HAVE_MMAP - + #elif defined(__MACHTEN__) typedef int rlim_t; #define JMP_BUF sigjmp_buf @@ -497,7 +497,7 @@ typedef int rlim_t; typedef int rlim_t; #elif defined(ISC) -#include +#include #define NO_KILLPG #undef NO_SETSID #define HAVE_SHMGET @@ -546,7 +546,7 @@ typedef int rlim_t; #define ap_snprintf snprintf #define ap_vsnprintf vsnprintf #else -int ap_snprintf(char *buf, size_t len, const char *format,...); +int ap_snprintf(char *buf, size_t len, const char *format, ...); int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap); #endif @@ -574,9 +574,9 @@ int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap); #include #include #ifndef MPE -#include /* for inet_ntoa */ +#include /* for inet_ntoa */ #endif -#include /* for ctime */ +#include /* for ctime */ #include #include #include @@ -596,8 +596,8 @@ int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap); #ifdef HAVE_SYS_RESOURCE_H #include #ifdef SUNOS4 -int getrlimit( int, struct rlimit *); -int setrlimit( int, struct rlimit *); +int getrlimit(int, struct rlimit *); +int setrlimit(int, struct rlimit *); #endif #endif #ifdef HAVE_MMAP @@ -654,7 +654,7 @@ typedef void Sigfunc(int); #undef signal #endif #define signal(s,f) ap_signal(s,f) -Sigfunc *signal(int signo, Sigfunc *func); +Sigfunc *signal(int signo, Sigfunc * func); #endif #include @@ -680,13 +680,13 @@ Sigfunc *signal(int signo, Sigfunc *func); #define XtOffset(p_type,field) \ (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) -#else /* !CRAY2 */ +#else /* !CRAY2 */ #define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field)) -#endif /* !CRAY2 */ -#endif /* __STDC__ */ -#else /* ! (CRAY || __arm) */ +#endif /* !CRAY2 */ +#endif /* __STDC__ */ +#else /* ! (CRAY || __arm) */ #define XtOffset(p_type,field) \ ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) @@ -706,52 +706,52 @@ Sigfunc *signal(int signo, Sigfunc *func); * Sun Quality Software. Gotta love it. */ -int getopt (int, char **, char *); +int getopt(int, char **, char *); -int strcasecmp (char *, char *); -int strncasecmp (char *, char *, int); +int strcasecmp(char *, char *); +int strncasecmp(char *, char *, int); int toupper(int); -int tolower(int); - -int printf (char *, ...); -int fprintf (FILE *, char *, ...); -int fputs (char *, FILE *); -int fread (char *, int, int, FILE *); -int fwrite (char *, int, int, FILE *); -int fflush (FILE *); -int fclose (FILE *); -int ungetc (int, FILE *); -int _filbuf (FILE *); /* !!! */ -int _flsbuf (unsigned char, FILE *); /* !!! */ -int sscanf (char *, char *, ...); -void setbuf (FILE *, char *); -void perror (char *); - -time_t time (time_t *); -int strftime (char *, int, char *, struct tm *); - -int initgroups (char *, int); -int wait3 (int *, int, void*); /* Close enough for us... */ -int lstat (const char *, struct stat *); -int stat (const char *, struct stat *); -int flock (int, int); +int tolower(int); + +int printf(char *, ...); +int fprintf(FILE *, char *, ...); +int fputs(char *, FILE *); +int fread(char *, int, int, FILE *); +int fwrite(char *, int, int, FILE *); +int fflush(FILE *); +int fclose(FILE *); +int ungetc(int, FILE *); +int _filbuf(FILE *); /* !!! */ +int _flsbuf(unsigned char, FILE *); /* !!! */ +int sscanf(char *, char *, ...); +void setbuf(FILE *, char *); +void perror(char *); + +time_t time(time_t *); +int strftime(char *, int, char *, struct tm *); + +int initgroups(char *, int); +int wait3(int *, int, void *); /* Close enough for us... */ +int lstat(const char *, struct stat *); +int stat(const char *, struct stat *); +int flock(int, int); #ifndef NO_KILLPG int killpg(int, int); #endif -int socket (int, int, int); -int setsockopt (int, int, int, const char*, int); -int listen (int, int); -int bind (int, struct sockaddr *, int); -int connect (int, struct sockaddr *, int); -int accept (int, struct sockaddr *, int *); -int shutdown (int, int); - -int getsockname (int s, struct sockaddr *name, int *namelen); -int getpeername (int s, struct sockaddr *name, int *namelen); -int gethostname (char *name, int namelen); -void syslog (int, char *, ...); -char *mktemp (char *); - -long vfprintf (FILE *, char *, va_list); - +int socket(int, int, int); +int setsockopt(int, int, int, const char *, int); +int listen(int, int); +int bind(int, struct sockaddr *, int); +int connect(int, struct sockaddr *, int); +int accept(int, struct sockaddr *, int *); +int shutdown(int, int); + +int getsockname(int s, struct sockaddr *name, int *namelen); +int getpeername(int s, struct sockaddr *name, int *namelen); +int gethostname(char *name, int namelen); +void syslog(int, char *, ...); +char *mktemp(char *); + +long vfprintf(FILE *, char *, va_list); + #endif diff --git a/src/afsweb/apache_includes/http_conf_globals.h b/src/afsweb/apache_includes/http_conf_globals.h index 3a60e7db7..b87733fc4 100644 --- a/src/afsweb/apache_includes/http_conf_globals.h +++ b/src/afsweb/apache_includes/http_conf_globals.h @@ -83,4 +83,3 @@ extern char *server_argv0; extern char server_root[MAX_STRING_LEN]; extern char server_confname[MAX_STRING_LEN]; - diff --git a/src/afsweb/apache_includes/httpd.h b/src/afsweb/apache_includes/httpd.h index abee73506..7481bc7ba 100644 --- a/src/afsweb/apache_includes/httpd.h +++ b/src/afsweb/apache_includes/httpd.h @@ -67,7 +67,7 @@ */ #ifndef HTTPD_ROOT #ifdef __EMX__ -/* Set default for OS/2 file system */ +/* Set default for OS/2 file system */ #define HTTPD_ROOT "/os2httpd" #else #define HTTPD_ROOT "/usr/local/etc/httpd" @@ -77,7 +77,7 @@ #ifndef DOCUMENT_LOCATION /* Root of server */ #ifdef __EMX__ -/* Set default for OS/2 file system */ +/* Set default for OS/2 file system */ #define DOCUMENT_LOCATION "/os2httpd/docs" #else #define DOCUMENT_LOCATION "/usr/local/etc/httpd/htdocs" @@ -116,7 +116,7 @@ /* The name of the log files */ #ifndef DEFAULT_XFERLOG #ifdef __EMX__ -/* Set default for OS/2 file system */ +/* Set default for OS/2 file system */ #define DEFAULT_XFERLOG "logs/access.log" #else #define DEFAULT_XFERLOG "logs/access_log" @@ -124,7 +124,7 @@ #endif /* DEFAULT_XFERLOG */ #ifndef DEFAULT_ERRORLOG #ifdef __EMX__ -/* Set default for OS/2 file system */ +/* Set default for OS/2 file system */ #define DEFAULT_ERRORLOG "logs/error.log" #else #define DEFAULT_ERRORLOG "logs/error_log" @@ -152,7 +152,7 @@ /* Define this to be what your per-directory security files are called */ #ifdef __EMX__ -/* Set default for OS/2 file system */ +/* Set default for OS/2 file system */ #define DEFAULT_ACCESS_FNAME "htaccess" #else #define DEFAULT_ACCESS_FNAME ".htaccess" @@ -191,7 +191,7 @@ /* The path to the Bourne shell, for parsed docs */ #ifndef SHELL_PATH #ifdef __EMX__ -/* Set default for OS/2 file system */ +/* Set default for OS/2 file system */ #define SHELL_PATH "CMD.EXE" #else #define SHELL_PATH "/bin/sh" @@ -274,7 +274,7 @@ * Example: "Apache/1.1.0 MrWidget/0.1-alpha" */ -#define SERVER_BASEVERSION "Apache/1.2.6" /* SEE COMMENTS ABOVE */ +#define SERVER_BASEVERSION "Apache/1.2.6" /* SEE COMMENTS ABOVE */ #ifdef SERVER_SUBVERSION #define SERVER_VERSION SERVER_BASEVERSION " " SERVER_SUBVERSION #else @@ -420,11 +420,10 @@ /* This represents the result of calling htaccess; these are cached for * each request. */ -struct htaccess_result -{ - char *dir; /* the directory to which this applies */ - int override; /* the overrides allowed for the .htaccess file */ - void *htaccess; /* the configuration directives */ +struct htaccess_result { + char *dir; /* the directory to which this applies */ + int override; /* the overrides allowed for the .htaccess file */ + void *htaccess; /* the configuration directives */ /* the next one, or NULL if no more; N.B. never change this */ const struct htaccess_result *next; }; @@ -437,109 +436,109 @@ typedef struct listen_rec listen_rec; struct request_rec { - pool *pool; - conn_rec *connection; - server_rec *server; + pool *pool; + conn_rec *connection; + server_rec *server; - request_rec *next; /* If we wind up getting redirected, + request_rec *next; /* If we wind up getting redirected, * pointer to the request we redirected to. */ - request_rec *prev; /* If this is an internal redirect, + request_rec *prev; /* If this is an internal redirect, * pointer to where we redirected *from*. */ - - request_rec *main; /* If this is a sub_request (see request.h) + + request_rec *main; /* If this is a sub_request (see request.h) * pointer back to the main request. */ - /* Info about the request itself... we begin with stuff that only - * protocol.c should ever touch... - */ - - char *the_request; /* First line of request, so we can log it */ - int assbackwards; /* HTTP/0.9, "simple" request */ - int proxyreq; /* A proxy request */ - int header_only; /* HEAD request, as opposed to GET */ - char *protocol; /* Protocol, as given to us, or HTTP/0.9 */ - int proto_num; /* Number version of protocol; 1.1 = 1001 */ - char *hostname; /* Host, as set by full URI or Host: */ - int hostlen; /* Length of http://host:port in full URI */ - - time_t request_time; /* When the request started */ - - char *status_line; /* Status line, if set by script */ - int status; /* In any case */ - - /* Request method, two ways; also, protocol, etc.. Outside of protocol.c, - * look, but don't touch. - */ - - char *method; /* GET, HEAD, POST, etc. */ - int method_number; /* M_GET, M_POST, etc. */ - int allowed; /* Allowed methods - for 405, OPTIONS, etc */ - - int sent_bodyct; /* byte count in stream is for body */ - long bytes_sent; /* body byte count, for easy access */ - - /* HTTP/1.1 connection-level features */ - - int chunked; /* sending chunked transfer-coding */ - int byterange; /* number of byte ranges */ - char *boundary; /* multipart/byteranges boundary */ - char *range; /* The Range: header */ - long clength; /* The "real" content length */ - - long remaining; /* bytes left to read */ - long read_length; /* bytes that have been read */ - int read_body; /* how the request body should be read */ - int read_chunked; /* reading chunked transfer-coding */ - - /* MIME header environments, in and out. Also, an array containing - * environment variables to be passed to subprocesses, so people can - * write modules to add to that environment. - * - * The difference between headers_out and err_headers_out is that the - * latter are printed even on error, and persist across internal redirects - * (so the headers printed for ErrorDocument handlers will have them). - * - * The 'notes' table is for notes from one module to another, with no - * other set purpose in mind... - */ - - table *headers_in; - table *headers_out; - table *err_headers_out; - table *subprocess_env; - table *notes; - - char *content_type; /* Break these out --- we dispatch on 'em */ - char *handler; /* What we *really* dispatch on */ - - char *content_encoding; - char *content_language; /* for back-compat. only -- do not use */ - array_header *content_languages; /* array of (char*) */ - - int no_cache; - int no_local_copy; - - /* What object is being requested (either directly, or via include - * or content-negotiation mapping). - */ - - char *uri; /* complete URI for a proxy req, or - URL path for a non-proxy req */ - char *filename; - char *path_info; - char *args; /* QUERY_ARGS, if any */ - struct stat finfo; /* ST_MODE set to zero if no such file */ - - /* Various other config info which may change with .htaccess files - * These are config vectors, with one void* pointer for each module - * (the thing pointed to being the module's business). - */ - - void *per_dir_config; /* Options set in config files, etc. */ - void *request_config; /* Notes on *this* request */ + /* Info about the request itself... we begin with stuff that only + * protocol.c should ever touch... + */ + + char *the_request; /* First line of request, so we can log it */ + int assbackwards; /* HTTP/0.9, "simple" request */ + int proxyreq; /* A proxy request */ + int header_only; /* HEAD request, as opposed to GET */ + char *protocol; /* Protocol, as given to us, or HTTP/0.9 */ + int proto_num; /* Number version of protocol; 1.1 = 1001 */ + char *hostname; /* Host, as set by full URI or Host: */ + int hostlen; /* Length of http://host:port in full URI */ + + time_t request_time; /* When the request started */ + + char *status_line; /* Status line, if set by script */ + int status; /* In any case */ + + /* Request method, two ways; also, protocol, etc.. Outside of protocol.c, + * look, but don't touch. + */ + + char *method; /* GET, HEAD, POST, etc. */ + int method_number; /* M_GET, M_POST, etc. */ + int allowed; /* Allowed methods - for 405, OPTIONS, etc */ + + int sent_bodyct; /* byte count in stream is for body */ + long bytes_sent; /* body byte count, for easy access */ + + /* HTTP/1.1 connection-level features */ + + int chunked; /* sending chunked transfer-coding */ + int byterange; /* number of byte ranges */ + char *boundary; /* multipart/byteranges boundary */ + char *range; /* The Range: header */ + long clength; /* The "real" content length */ + + long remaining; /* bytes left to read */ + long read_length; /* bytes that have been read */ + int read_body; /* how the request body should be read */ + int read_chunked; /* reading chunked transfer-coding */ + + /* MIME header environments, in and out. Also, an array containing + * environment variables to be passed to subprocesses, so people can + * write modules to add to that environment. + * + * The difference between headers_out and err_headers_out is that the + * latter are printed even on error, and persist across internal redirects + * (so the headers printed for ErrorDocument handlers will have them). + * + * The 'notes' table is for notes from one module to another, with no + * other set purpose in mind... + */ + + table *headers_in; + table *headers_out; + table *err_headers_out; + table *subprocess_env; + table *notes; + + char *content_type; /* Break these out --- we dispatch on 'em */ + char *handler; /* What we *really* dispatch on */ + + char *content_encoding; + char *content_language; /* for back-compat. only -- do not use */ + array_header *content_languages; /* array of (char*) */ + + int no_cache; + int no_local_copy; + + /* What object is being requested (either directly, or via include + * or content-negotiation mapping). + */ + + char *uri; /* complete URI for a proxy req, or + * URL path for a non-proxy req */ + char *filename; + char *path_info; + char *args; /* QUERY_ARGS, if any */ + struct stat finfo; /* ST_MODE set to zero if no such file */ + + /* Various other config info which may change with .htaccess files + * These are config vectors, with one void* pointer for each module + * (the thing pointed to being the module's business). + */ + + void *per_dir_config; /* Options set in config files, etc. */ + void *request_config; /* Notes on *this* request */ /* * a linked list of the configuration directives in the .htaccess files @@ -547,7 +546,7 @@ struct request_rec { * N.B. always add to the head of the list, _never_ to the end. * that way, a sub request's list can (temporarily) point to a parent's list */ - const struct htaccess_result *htaccess; + const struct htaccess_result *htaccess; }; @@ -555,39 +554,39 @@ struct request_rec { */ struct conn_rec { - - pool *pool; - server_rec *server; - server_rec *base_server; /* Physical vhost this conn come in on */ - - /* Information about the connection itself */ - - int child_num; /* The number of the child handling conn_rec */ - BUFF *client; /* Connetion to the guy */ - int aborted; /* Are we still talking? */ - - /* Who is the client? */ - - struct sockaddr_in local_addr; /* local address */ - struct sockaddr_in remote_addr;/* remote address */ - char *remote_ip; /* Client's IP address */ - char *remote_host; /* Client's DNS name, if known. - * NULL if DNS hasn't been checked, - * "" if it has and no address was found. - * N.B. Only access this though + + pool *pool; + server_rec *server; + server_rec *base_server; /* Physical vhost this conn come in on */ + + /* Information about the connection itself */ + + int child_num; /* The number of the child handling conn_rec */ + BUFF *client; /* Connetion to the guy */ + int aborted; /* Are we still talking? */ + + /* Who is the client? */ + + struct sockaddr_in local_addr; /* local address */ + struct sockaddr_in remote_addr; /* remote address */ + char *remote_ip; /* Client's IP address */ + char *remote_host; /* Client's DNS name, if known. + * NULL if DNS hasn't been checked, + * "" if it has and no address was found. + * N.B. Only access this though * get_remote_host() */ - char *remote_logname; /* Only ever set if doing rfc1413 lookups. - * N.B. Only access this through + char *remote_logname; /* Only ever set if doing rfc1413 lookups. + * N.B. Only access this through * get_remote_logname() */ char *user; /* If an authentication check was made, * this gets set to the user name. We assume * that there's only one user per connection(!) */ - char *auth_type; /* Ditto. */ + char *auth_type; /* Ditto. */ - int keepalive; /* Are we using HTTP Keep-Alive? */ - int keptalive; /* Did we use HTTP Keep-Alive? */ - int keepalives; /* How many times have we used it? */ + int keepalive; /* Are we using HTTP Keep-Alive? */ + int keptalive; /* Did we use HTTP Keep-Alive? */ + int keepalives; /* How many times have we used it? */ }; /* Per-vhost config... */ @@ -601,7 +600,7 @@ typedef struct server_addr_rec server_addr_rec; struct server_addr_rec { server_addr_rec *next; struct in_addr host_addr; /* The bound address, for this server */ - unsigned short host_port; /* The bound port, for this server */ + unsigned short host_port; /* The bound port, for this server */ char *virthost; /* The name given in */ }; @@ -609,26 +608,26 @@ struct server_addr_rec { struct server_rec { server_rec *next; - + /* Full locations of server config info */ - + char *srm_confname; char *access_confname; - + /* Contact information */ - + char *server_admin; char *server_hostname; - unsigned short port; /* for redirects, etc. */ - + unsigned short port; /* for redirects, etc. */ + /* Log files --- note that transfer log is now in the modules... */ - + char *error_fname; FILE *error_log; - + /* Module-specific configuration for server, and defaults... */ - int is_virtual; /* true if this is the virtual server */ + int is_virtual; /* true if this is the virtual server */ void *module_config; /* Config vector containing pointers to * modules' per-server config structures. */ @@ -642,7 +641,7 @@ struct server_rec { int keep_alive_timeout; /* Seconds we'll wait for another request */ int keep_alive_max; /* Maximum requests per connection */ int keep_alive; /* Use persistent connections? */ - int send_buffer_size; /* size of TCP send buffer (in bytes) */ + int send_buffer_size; /* size of TCP send buffer (in bytes) */ char *path; /* Pathname for ServerPath */ int pathlen; /* Length of path */ @@ -656,9 +655,9 @@ struct server_rec { /* These are more like real hosts than virtual hosts */ struct listen_rec { listen_rec *next; - struct sockaddr_in local_addr; /* local IP address and port */ + struct sockaddr_in local_addr; /* local IP address and port */ int fd; - int used; /* Only used during restart */ + int used; /* Only used during restart */ /* more stuff here, like which protocol is bound to the port */ }; @@ -670,70 +669,70 @@ extern const char month_snames[12][4]; struct tm *get_gmtoff(int *tz); char *get_time(); -char *ht_time (pool *p, time_t t, const char *fmt, int gmt); -char *gm_timestr_822(pool *p, time_t t); - +char *ht_time(pool * p, time_t t, const char *fmt, int gmt); +char *gm_timestr_822(pool * p, time_t t); + /* String handling. The *_nc variants allow you to use non-const char **s as arguments (unfortunately C won't automatically convert a char ** to a const -char **) */ - -char *getword(pool *p, const char **line, char stop); -char *getword_nc(pool *p, char **line, char stop); -char *getword_white(pool *p, const char **line); -char *getword_white_nc(pool *p, char **line); -char *getword_nulls (pool *p, const char **line, char stop); -char *getword_nulls_nc (pool *p, char **line, char stop); -char *getword_conf (pool *p, const char **line); -char *getword_conf_nc (pool *p, char **line); - -char *get_token (pool *p, char **accept_line, int accept_white); -int find_token (pool *p, const char *line, const char *tok); -int find_last_token (pool *p, const char *line, const char *tok); - +char **) */ + +char *getword(pool * p, const char **line, char stop); +char *getword_nc(pool * p, char **line, char stop); +char *getword_white(pool * p, const char **line); +char *getword_white_nc(pool * p, char **line); +char *getword_nulls(pool * p, const char **line, char stop); +char *getword_nulls_nc(pool * p, char **line, char stop); +char *getword_conf(pool * p, const char **line); +char *getword_conf_nc(pool * p, char **line); + +char *get_token(pool * p, char **accept_line, int accept_white); +int find_token(pool * p, const char *line, const char *tok); +int find_last_token(pool * p, const char *line, const char *tok); + int is_url(const char *u); extern int unescape_url(char *url); void no2slash(char *name); void getparents(char *name); -char *escape_path_segment(pool *p, const char *s); -char *os_escape_path(pool *p,const char *path,int partial); +char *escape_path_segment(pool * p, const char *s); +char *os_escape_path(pool * p, const char *path, int partial); #define escape_uri(ppool,path) os_escape_path(ppool,path,1) -extern char *escape_html(pool *p, const char *s); -char *construct_server(pool *p, const char *hostname, unsigned port); -char *construct_url (pool *p, const char *path, const server_rec *s); -char *escape_shell_cmd (pool *p, const char *s); - +extern char *escape_html(pool * p, const char *s); +char *construct_server(pool * p, const char *hostname, unsigned port); +char *construct_url(pool * p, const char *path, const server_rec * s); +char *escape_shell_cmd(pool * p, const char *s); + int count_dirs(const char *path); -char *make_dirstr(pool *a, const char *s, int n); -char *make_full_path(pool *a, const char *dir, const char *f); - +char *make_dirstr(pool * a, const char *s, int n); +char *make_full_path(pool * a, const char *dir, const char *f); + int is_matchexp(const char *str); int strcmp_match(const char *str, const char *exp); int strcasecmp_match(const char *str, const char *exp); -char *uudecode (pool *, const char *); +char *uudecode(pool *, const char *); -char *pregsub(pool *p, const char *input, const char *source, - size_t nmatch, regmatch_t pmatch[]); +char *pregsub(pool * p, const char *input, const char *source, size_t nmatch, + regmatch_t pmatch[]); -void str_tolower (char *); -int ind (const char *, char); /* Sigh... */ -int rind (const char *, char); +void str_tolower(char *); +int ind(const char *, char); /* Sigh... */ +int rind(const char *, char); -int cfg_getline(char *s, int n, FILE *f); +int cfg_getline(char *s, int n, FILE * f); #ifdef NEED_STRERROR -char *strerror (int err); +char *strerror(int err); #endif /* Misc system hackery */ - + uid_t uname2id(const char *name); gid_t gname2id(const char *name); int is_directory(const char *name); -int can_exec(const struct stat *); +int can_exec(const struct stat *); void chdir_file(const char *file); - + char *get_local_host(pool *); -unsigned long get_virthost_addr (const char *hostname, unsigned short *port); +unsigned long get_virthost_addr(const char *hostname, unsigned short *port); extern time_t restart_time; @@ -761,6 +760,6 @@ extern time_t restart_time; * never fails. If the high line was requested and it fails it will also try * the low line. */ -int ap_slack (int fd, int line); +int ap_slack(int fd, int line); #define AP_SLACK_LOW 1 #define AP_SLACK_HIGH 2 diff --git a/src/afsweb/nsafs.c b/src/afsweb/nsafs.c index 4735f186b..4739fdc3e 100644 --- a/src/afsweb/nsafs.c +++ b/src/afsweb/nsafs.c @@ -12,20 +12,21 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afsweb/nsafs.c,v 1.1.1.4 2001/07/14 22:20:32 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afsweb/nsafs.c,v 1.6 2003/07/15 23:14:35 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ #include -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" -#include "../afs/afs_usrops.h" -#include "../afs/auth.h" -#include "../afs/cellconfig.h" -#include "../afs/vice.h" -#include "../afs/kautils.h" -#include "../afs/nsafs.h" +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" +#include "afs_usrops.h" +#include "afs/auth.h" +#include "afs/cellconfig.h" +#include "afs/vice.h" +#include "afs/kautils.h" +#include "afs/nsafs.h" #define NSAFS_DFLT_RCVTHREADS 2 /* Dflt number recevice threads */ #define NSAFS_BUFFER_SIZE 4096 /* Send/Receive buffer size */ @@ -33,7 +34,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afsweb/nsafs.c,v 1.1.1.4 2001/07/14 22: #define NSAFS_USERNAME_MAX 64 /* Maximum username length */ #define NSAFS_PASSWORD_MAX 64 /* Maximum password length */ #define NSAFS_LOGIN_HASH_SIZE 1024 /* MUST be power of two */ -#define TEN_MINUTES 600 /* 10 minutes = 600 seconds */ +#define TEN_MINUTES 600 /* 10 minutes = 600 seconds */ #define NSAFS_DIR_ALLOW "GET,HEAD,MOVE,INDEX,RMDIR" #define NSAFS_LINK_ALLOW "GET,HEAD,MOVE,DELETE" @@ -145,9 +146,10 @@ static int base64_to_value[256] = { /* * Decode a base64 encoded buffer in place */ -void nsafs_decode64(char *buf) +void +nsafs_decode64(char *buf) { - int i,j; + int i, j; int len; int val1; int val2; @@ -157,7 +159,7 @@ void nsafs_decode64(char *buf) /* * Allow trailing blanks */ - for (len = strlen(buf) ; buf[len-1] == ' ' && len > 0 ; len--); + for (len = strlen(buf); buf[len - 1] == ' ' && len > 0; len--); /* * Valid encodings are multiples of four characters @@ -167,14 +169,14 @@ void nsafs_decode64(char *buf) return; } - for (i = 0, j = 0 ; i < len ; i += 4, j += 3) { + for (i = 0, j = 0; i < len; i += 4, j += 3) { val1 = base64_to_value[buf[i]]; - val2 = base64_to_value[buf[i+1]]; - val3 = base64_to_value[buf[i+2]]; - val4 = base64_to_value[buf[i+3]]; - buf[j] = ((val1<<2)&0xfc) | ((val2>>4)&0x3); - buf[j+1] = ((val2<<4)&0xf0) | ((val3>>2)&0xf); - buf[j+2] = ((val3<<6)&0xc0) | (val4&0x3f); + val2 = base64_to_value[buf[i + 1]]; + val3 = base64_to_value[buf[i + 2]]; + val4 = base64_to_value[buf[i + 3]]; + buf[j] = ((val1 << 2) & 0xfc) | ((val2 >> 4) & 0x3); + buf[j + 1] = ((val2 << 4) & 0xf0) | ((val3 >> 2) & 0xf); + buf[j + 2] = ((val3 << 6) & 0xc0) | (val4 & 0x3f); } buf[j] = '\0'; } @@ -183,22 +185,22 @@ void nsafs_decode64(char *buf) /* * Interface for pioctls - used for unlogging */ -#include "../afs/venus.h" -int do_pioctl(char *in_buffer, int in_size, - char *out_buffer, int out_size, - int opcode, char *path, int followSymLinks) +#include "afs/venus.h" +int +do_pioctl(char *in_buffer, int in_size, char *out_buffer, int out_size, + int opcode, char *path, int followSymLinks) { - struct ViceIoctl iob; - iob.in = in_buffer; - iob.in_size = in_size; - iob.out = out_buffer; - iob.out_size = out_size; - + struct ViceIoctl iob; + iob.in = in_buffer; + iob.in_size = in_size; + iob.out = out_buffer; + iob.out_size = out_size; + #ifdef AFS_USR_SUN5_ENV - return syscall(AFS_SYSCALL, AFSCALL_PIOCTL, path, _VICEIOCTL(opcode), &iob, - followSymLinks); + return syscall(AFS_SYSCALL, AFSCALL_PIOCTL, path, _VICEIOCTL(opcode), + &iob, followSymLinks); #else /* AFS_USR_SUN5_ENV */ - return lpioctl(path, _VICEIOCTL(opcode), &iob, followSymLinks); + return lpioctl(path, _VICEIOCTL(opcode), &iob, followSymLinks); #endif /* AFS_USR_SUN5_ENV */ } @@ -206,30 +208,32 @@ int do_pioctl(char *in_buffer, int in_size, * unlog - invalidate any existing AFS tokens with the kernel cache * manager. In case the server is started up with tokens */ -int unlog() +int +unlog() { - return do_pioctl(NULL, 0, NULL, 0, VIOCUNPAG, NULL, 0); + return do_pioctl(NULL, 0, NULL, 0, VIOCUNPAG, NULL, 0); } /* * Initialize the AFS client and the login cache */ -void nsafs_init_once() +void +nsafs_init_once() { int i; crit_enter(nsafs_init_lock); if (nsafs_init_done == 0) { - i=unlog(); - if (i) { + i = unlog(); + if (i) { /* printf("unlog from AFS failed: errno:%d\n", errno); */ - } - uafs_Init("nsafs-init", mountDirParam, confDirParam, + } + uafs_Init("nsafs-init", mountDirParam, confDirParam, cacheBaseDirParam, cacheBlocksParam, cacheFilesParam, cacheStatEntriesParam, dCacheSizeParam, vCacheSizeParam, chunkSizeParam, 0, debugParam, nDaemonsParam, -1, logFileParam); nsafs_login_lock = crit_init(); - for (i = 0 ; i < NSAFS_LOGIN_HASH_SIZE ; i++) { + for (i = 0; i < NSAFS_LOGIN_HASH_SIZE; i++) { DLL_INIT_LIST(nsafs_login_cache[i].head, nsafs_login_cache[i].tail); } @@ -242,27 +246,25 @@ void nsafs_init_once() /* * Hash function for the AFS login cache */ -int nsafs_login_hash(char *name, char *cell) +int +nsafs_login_hash(char *name, char *cell) { char *p; afs_uint32 val; - for (val = *name , p = name ; *p != '\0' ; p++) { - val = (val << 2) ^ val ^ (afs_uint32)(*p); + for (val = *name, p = name; *p != '\0'; p++) { + val = (val << 2) ^ val ^ (afs_uint32) (*p); } - for (p = cell ; *p != '\0' ; p++) { - val = (val << 2) ^ val ^ (afs_uint32)(*p); + for (p = cell; *p != '\0'; p++) { + val = (val << 2) ^ val ^ (afs_uint32) (*p); } - return val & (NSAFS_LOGIN_HASH_SIZE-1); + return val & (NSAFS_LOGIN_HASH_SIZE - 1); } /* * Compute a SHA checksum on the username, cellname, and password */ -void nsafs_login_checksum( - char *user, - char *cell, - char *passwd, - char *cksum) +void +nsafs_login_checksum(char *user, char *cell, char *passwd, char *cksum) { int passwdLen; int userLen; @@ -276,26 +278,29 @@ void nsafs_login_checksum( passwdLen = strlen(passwd); userLen = strlen(user); cellLen = strlen(cell); - shaBuffer = afs_osi_Alloc(MAX(userLen+cellLen,passwdLen)+SHA_HASH_BYTES); + shaBuffer = + afs_osi_Alloc(MAX(userLen + cellLen, passwdLen) + SHA_HASH_BYTES); strcpy(shaBuffer, passwd); memcpy((void *)(shaBuffer + passwdLen), (void *)(&nsafs_login_pad[0]), SHA_HASH_BYTES); sha_clear(&state); - sha_hash(&state, shaBuffer, passwdLen+SHA_HASH_BYTES); + sha_hash(&state, shaBuffer, passwdLen + SHA_HASH_BYTES); memcpy(shaBuffer, user, userLen); - memcpy(shaBuffer+userLen, cell, cellLen); - sha_bytes(&state, shaBuffer+userLen+cellLen); + memcpy(shaBuffer + userLen, cell, cellLen); + sha_bytes(&state, shaBuffer + userLen + cellLen); sha_clear(&state); - sha_hash(&state, shaBuffer, userLen+cellLen+SHA_HASH_BYTES); + sha_hash(&state, shaBuffer, userLen + cellLen + SHA_HASH_BYTES); sha_bytes(&state, &cksum[0]); - memset(shaBuffer, 0, MAX(userLen+cellLen,passwdLen)+SHA_HASH_BYTES); - afs_osi_Free(shaBuffer, MAX(userLen+cellLen,passwdLen)+SHA_HASH_BYTES); + memset(shaBuffer, 0, MAX(userLen + cellLen, passwdLen) + SHA_HASH_BYTES); + afs_osi_Free(shaBuffer, + MAX(userLen + cellLen, passwdLen) + SHA_HASH_BYTES); } /* * Set the AFS identity given from the group0 and group1 strings */ -void nsafs_set_id_from_ints(int viceid, int group0, int group1) +void +nsafs_set_id_from_ints(int viceid, int group0, int group1) { int i; struct usr_ucred *crp; @@ -309,7 +314,7 @@ void nsafs_set_id_from_ints(int viceid, int group0, int group1) crp->cr_groups[1] = group1; crp->cr_groups[2] = getgid(); crp->cr_ngroups = 1; - for (i = 3 ; i < NGROUPS ; i++) { + for (i = 3; i < NGROUPS; i++) { crp->cr_groups[i] = NOGROUP; } } @@ -317,7 +322,8 @@ void nsafs_set_id_from_ints(int viceid, int group0, int group1) /* * Set the AFS identity given from the viceid, group0 and group1 strings */ -void nsafs_set_id_from_strings(char *viceid, char *group0, char *group1) +void +nsafs_set_id_from_strings(char *viceid, char *group0, char *group1) { int i; struct usr_ucred *crp; @@ -332,7 +338,7 @@ void nsafs_set_id_from_strings(char *viceid, char *group0, char *group1) crp->cr_suid = getuid(); crp->cr_groups[0] = getgid(); crp->cr_ngroups = 1; - for (i = 1 ; i < NGROUPS ; i++) { + for (i = 1; i < NGROUPS; i++) { crp->cr_groups[i] = NOGROUP; } } @@ -343,13 +349,9 @@ void nsafs_set_id_from_strings(char *viceid, char *group0, char *group1) * given username, and the SHA checksums match, then set the group0 * and group1 parameters and return 1, otherwise return 0. */ -int nsafs_login_lookup( - char *user, - char *cell, - char *cksum, - int *viceid, - int *group0, - int *group1) +int +nsafs_login_lookup(char *user, char *cell, char *cksum, int *viceid, + int *group0, int *group1) { int index; long curTime; @@ -373,11 +375,11 @@ int nsafs_login_lookup( nsafs_login_cache[index].tail, next, prev); afs_osi_Free(tmpP, sizeof(struct nsafs_login)); continue; - } - if (strcmp(loginP->username, user) == 0 && - strcmp(loginP->cellname, cell) == 0 && - memcmp((void *)&loginP->cksum[0], (void *)cksum, - SHA_HASH_BYTES) == 0) { + } + if (strcmp(loginP->username, user) == 0 + && strcmp(loginP->cellname, cell) == 0 + && memcmp((void *)&loginP->cksum[0], (void *)cksum, + SHA_HASH_BYTES) == 0) { *viceid = loginP->viceid; *group0 = loginP->group0; *group1 = loginP->group1; @@ -394,14 +396,9 @@ int nsafs_login_lookup( * Insert a login ID into the cache. If the user already has an entry, * then overwrite the old entry. */ -int nsafs_login_store( - char *user, - char *cell, - char *cksum, - int viceid, - int group0, - int group1, - afs_uint32 expiration) +int +nsafs_login_store(char *user, char *cell, char *cksum, int viceid, int group0, + int group1, afs_uint32 expiration) { int index; long curTime; @@ -416,8 +413,8 @@ int nsafs_login_store( crit_enter(nsafs_login_lock); loginP = nsafs_login_cache[index].head; while (loginP != NULL) { - if (strcmp(loginP->username, user) == 0 && - strcmp(loginP->cellname, cell) == 0) { + if (strcmp(loginP->username, user) == 0 + && strcmp(loginP->cellname, cell) == 0) { break; } if (loginP->expiration < curTime) { @@ -429,18 +426,19 @@ int nsafs_login_store( nsafs_login_cache[index].tail, next, prev); afs_osi_Free(tmpP, sizeof(struct nsafs_login)); continue; - } + } loginP = loginP->next; } if (loginP == NULL) { loginP = (struct nsafs_login *) - afs_osi_Alloc(sizeof(struct nsafs_login)); + afs_osi_Alloc(sizeof(struct nsafs_login)); strcpy(&loginP->username[0], user); strcpy(&loginP->cellname[0], cell); } else { DLL_DELETE(loginP, nsafs_login_cache[index].head, nsafs_login_cache[index].tail, next, prev); - nsafs_set_id_from_ints(loginP->viceid, loginP->group0, loginP->group1); + nsafs_set_id_from_ints(loginP->viceid, loginP->group0, + loginP->group1); uafs_unlog(); } nsafs_set_id_from_ints(viceid, group0, group1); @@ -458,19 +456,15 @@ int nsafs_login_store( /* * Extract a string parameter from the parameter block */ -int nsafs_get_string( - char **paramP, - char *dflt, - char *name, - pblock *pb, - Session *sn, - Request *rq) +int +nsafs_get_string(char **paramP, char *dflt, char *name, pblock * pb, + Session * sn, Request * rq) { char *tmpPtr; char error[128]; tmpPtr = pblock_findval(name, pb); - if(tmpPtr == NULL) { + if (tmpPtr == NULL) { if (dflt == NULL) { log_error(LOG_MISCONFIG, "nsafs", sn, rq, "nsafs_init: please supply a %s parameter", name); @@ -479,7 +473,7 @@ int nsafs_get_string( tmpPtr = dflt; } } - *paramP = afs_osi_Alloc(strlen(tmpPtr)+1); + *paramP = afs_osi_Alloc(strlen(tmpPtr) + 1); strcpy(*paramP, tmpPtr); return REQ_PROCEED; } @@ -487,19 +481,15 @@ int nsafs_get_string( /* * Extract a long integer parameter from the parameter block */ -int nsafs_get_long( - long *paramP, - long dflt, - char *name, - pblock *pb, - Session *sn, - Request *rq) +int +nsafs_get_long(long *paramP, long dflt, char *name, pblock * pb, Session * sn, + Request * rq) { char *start, *end; long val; start = pblock_findval(name, pb); - if(start == NULL) { + if (start == NULL) { if (dflt < 0) { log_error(LOG_MISCONFIG, "nsafs", sn, rq, "nsafs_init: please supply a %s parameter", name); @@ -522,13 +512,9 @@ int nsafs_get_long( /* * Extract an integer parameter from the parameter block */ -int nsafs_get_int( - int *paramP, - int dflt, - char *name, - pblock *pb, - Session *sn, - Request *rq) +int +nsafs_get_int(int *paramP, int dflt, char *name, pblock * pb, Session * sn, + Request * rq) { int code; long val; @@ -543,11 +529,8 @@ int nsafs_get_int( /* * Parse the authorization header for username and password */ -void nsafs_parse_authhdr( - char *authHdr, - char *user, - char *cell, - char *passwd) +void +nsafs_parse_authhdr(char *authHdr, char *user, char *cell, char *passwd) { int i; char *p; @@ -559,11 +542,11 @@ void nsafs_parse_authhdr( /* * Skip leading blanks, check for basic authentication */ - for (p = authHdr ; *p == ' ' && *p != '\0' ; p++); + for (p = authHdr; *p == ' ' && *p != '\0'; p++); if (strncasecmp(p, "basic ", 6) != 0) { return; } - for (p += 6 ; *p == ' ' ; p++); + for (p += 6; *p == ' '; p++); /* * Username and password are base64 encoded @@ -573,18 +556,18 @@ void nsafs_parse_authhdr( /* * Format is user@cell:passwd. The user, cell or passwd may be missing */ - for ( i = 0 ; *p != '@' && *p != ':' && *p != '\0' ; p++ , i++) { + for (i = 0; *p != '@' && *p != ':' && *p != '\0'; p++, i++) { user[i] = *p; } user[i] = '\0'; if (*p == '@') { - for (i = 0 , p++ ; *p != ':' && *p != '\0' ; p++ , i++) { + for (i = 0, p++; *p != ':' && *p != '\0'; p++, i++) { cell[i] = *p; } cell[i] = '\0'; } if (*p == ':') { - for (i = 0 , p++ ; *p != '\0' ; p++ , i++) { + for (i = 0, p++; *p != '\0'; p++, i++) { passwd[i] = *p; } passwd[i] = '\0'; @@ -594,12 +577,9 @@ void nsafs_parse_authhdr( /* * Return an appropriate error given a system errno */ -int nsafs_error_check( - int code, - char *text, - pblock *pb, - Session *sn, - Request *rq) +int +nsafs_error_check(int code, char *text, pblock * pb, Session * sn, + Request * rq) { char txtbuf[256]; char *realmBuf; @@ -618,21 +598,20 @@ int nsafs_error_check( * nsafs_nocheck is set. If nsafs_nocheck is set then change * EPERM to EACCES */ - if (code == EACCES && - pblock_findval("nsafs_nocheck", rq->vars) == NULL && - (pblock_findval("nsafs_viceid", rq->vars) == NULL || - pblock_findval("nsafs_group0", rq->vars) == NULL || - pblock_findval("nsafs_group1", rq->vars) == NULL)) { + if (code == EACCES && pblock_findval("nsafs_nocheck", rq->vars) == NULL + && (pblock_findval("nsafs_viceid", rq->vars) == NULL + || pblock_findval("nsafs_group0", rq->vars) == NULL + || pblock_findval("nsafs_group1", rq->vars) == NULL)) { code = EPERM; - } else if (code == EPERM && - pblock_findval("nsafs_nocheck", rq->vars) == NULL) { - char *status=pblock_findval("status",rq->vars); - if (strcmp(status,"Login Failed")) - code = EACCES; + } else if (code == EPERM + && pblock_findval("nsafs_nocheck", rq->vars) == NULL) { + char *status = pblock_findval("status", rq->vars); + if (strcmp(status, "Login Failed")) + code = EACCES; } switch (code) { - case EPERM: + case EPERM: /* * We overload EPERM (not super-user) to mean unauthenticated. * We use the first subdirectory beneath the AFS mount point @@ -642,7 +621,7 @@ int nsafs_error_check( protocol_status(sn, rq, PROTOCOL_UNAUTHORIZED, NULL); path = pblock_findval("path", rq->vars); realmBuf = NULL; - if(path != NULL) { + if (path != NULL) { path = uafs_afsPathName(path); } if (path != NULL && *path != '\0') { @@ -660,16 +639,16 @@ int nsafs_error_check( } pblock_nvinsert("WWW-authenticate", txtbuf, rq->srvhdrs); break; - case EACCES: + case EACCES: log_error(LOG_SECURITY, "nsafs", sn, rq, txtbuf); protocol_status(sn, rq, PROTOCOL_FORBIDDEN, NULL); break; - case ENOENT: - case ENOTDIR: + case ENOENT: + case ENOTDIR: log_error(LOG_INFORM, "nsafs", sn, rq, txtbuf); protocol_status(sn, rq, PROTOCOL_NOT_FOUND, NULL); break; - default: + default: log_error(LOG_FAILURE, "nsafs", sn, rq, txtbuf); protocol_status(sn, rq, PROTOCOL_SERVER_ERROR, NULL); break; @@ -682,11 +661,9 @@ int nsafs_error_check( * if the preconditions are met. Any other return value means * that the request has been aborted. */ -int nsafs_check_preconditions( - struct stat *stp, - pblock *pb, - Session *sn, - Request *rq) +int +nsafs_check_preconditions(struct stat *stp, pblock * pb, Session * sn, + Request * rq) { int code; time_t mtime; @@ -717,26 +694,24 @@ int nsafs_check_preconditions( * We used to call protocol_set_finfo, but it wasn't handling * if-unmodified-since headers correctly. */ -int nsafs_set_finfo( - Session *sn, - Request *rq, - struct stat *stp) +int +nsafs_set_finfo(Session * sn, Request * rq, struct stat *stp) { int code; time_t mtime; struct tm tms, *tmsp; char *reqhdr; char dateStr[128]; - char *days[] = {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"}; - char *months[] = {"Jan","Feb","Mar","Apr","May","Jun", - "Jul","Aug","Sep","Oct","Nov","Dec"}; + char *days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; + char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + }; mtime = stp->st_mtime; tmsp = system_gmtime(&mtime, &tms); - sprintf(&dateStr[0],"%s, %02d %s %d %02d:%02d:%02d GMT", - days[tmsp->tm_wday], tmsp->tm_mday, - months[tmsp->tm_mon], tmsp->tm_year+1900, - tmsp->tm_hour, tmsp->tm_min, tmsp->tm_sec); + sprintf(&dateStr[0], "%s, %02d %s %d %02d:%02d:%02d GMT", + days[tmsp->tm_wday], tmsp->tm_mday, months[tmsp->tm_mon], + tmsp->tm_year + 1900, tmsp->tm_hour, tmsp->tm_min, tmsp->tm_sec); pblock_nvinsert("Last-Modified", &dateStr[0], rq->srvhdrs); pblock_nninsert("Content-Length", stp->st_size, rq->srvhdrs); @@ -748,7 +723,8 @@ int nsafs_set_finfo( * here because we are still in the parent process. We don't * initialize AFS until we get the first service request. */ -NSAPI_PUBLIC int nsafs_init(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_init(pblock * pb, Session * sn, Request * rq) { int code; @@ -810,7 +786,8 @@ NSAPI_PUBLIC int nsafs_init(pblock *pb, Session *sn, Request *rq) if (code != REQ_PROCEED) { return code; } - code = nsafs_get_long(&maxExpirationParam, LONG_MAX, "exp-max", pb, sn, rq); + code = + nsafs_get_long(&maxExpirationParam, LONG_MAX, "exp-max", pb, sn, rq); if (code != REQ_PROCEED) { return code; } @@ -821,7 +798,8 @@ NSAPI_PUBLIC int nsafs_init(pblock *pb, Session *sn, Request *rq) /* * Extract name strings from a comma separated list */ -char *nsafs_NameFromNames(char *last, char *list, int *pos) +char * +nsafs_NameFromNames(char *last, char *list, int *pos) { int len; char *start; @@ -830,18 +808,18 @@ char *nsafs_NameFromNames(char *last, char *list, int *pos) if (last == NULL) { *pos = 0; } else { - afs_osi_Free(last, strlen(last)+1); + afs_osi_Free(last, strlen(last) + 1); } start = &list[*pos]; if (*start == '\0') { return NULL; } - for (len = 0 ; start[len] != ',' && start[len] != '\0' ; len++); + for (len = 0; start[len] != ',' && start[len] != '\0'; len++); *pos += len; if (list[*pos] == ',') { *pos += 1; } - retVal = afs_osi_Alloc(len+1); + retVal = afs_osi_Alloc(len + 1); memcpy(retVal, start, len); retVal[len] = '\0'; return retVal; @@ -856,7 +834,8 @@ char *nsafs_NameFromNames(char *last, char *list, int *pos) * Send an Unauthorized response if login fails to prompt the user * to reenter the username and password. */ -NSAPI_PUBLIC int nsafs_basic(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_basic(pblock * pb, Session * sn, Request * rq) { int i; int rc; @@ -896,7 +875,7 @@ NSAPI_PUBLIC int nsafs_basic(pblock *pb, Session *sn, Request *rq) nsafs_parse_authhdr(authHdr, &user[0], &cell[0], &passwd[0]); if (user[0] == '\0' || passwd[0] == '\0') { memset((void *)&passwd[0], 0, NSAFS_PASSWORD_MAX); - pblock_nvinsert("status","Login Failed",rq->vars); + pblock_nvinsert("status", "Login Failed", rq->vars); return nsafs_error_check(EPERM, "Invalid auth header", pb, sn, rq); } if (cell[0] == '\0') { @@ -929,10 +908,10 @@ NSAPI_PUBLIC int nsafs_basic(pblock *pb, Session *sn, Request *rq) } if (cellP == NULL) { memset((void *)&passwd[0], 0, NSAFS_PASSWORD_MAX); - pblock_nvinsert("status","Login Failed",rq->vars); + pblock_nvinsert("status", "Login Failed", rq->vars); return nsafs_error_check(EPERM, "Invalid cell", pb, sn, rq); } - afs_osi_Free(cellP, strlen(cellP)+1); + afs_osi_Free(cellP, strlen(cellP) + 1); u.u_expiration = 0; nsafs_set_id_from_strings(NULL, NULL, NULL); @@ -941,15 +920,16 @@ NSAPI_PUBLIC int nsafs_basic(pblock *pb, Session *sn, Request *rq) if (code != 0) { #if 0 sprintf(txtbuf, "%s@%s: %s\n", user, cell, reason); - pblock_nvinsert("status","Login Failed",rq->vars); + pblock_nvinsert("status", "Login Failed", rq->vars); return nsafs_error_check(EPERM, txtbuf, pb, sn, rq); #else /* 0 */ - return REQ_PROCEED; + return REQ_PROCEED; #endif /* 0 */ } expiration = u.u_expiration; usr_assert(expiration != 0); - expiration = MIN(expiration, (afs_uint32)(time(NULL) + maxExpirationParam)); + expiration = + MIN(expiration, (afs_uint32) (time(NULL) + maxExpirationParam)); /* * Insert the credentials into the login cache @@ -971,7 +951,8 @@ NSAPI_PUBLIC int nsafs_basic(pblock *pb, Session *sn, Request *rq) * Terminates the name translation step for files in AFS. * Puts the AFS pathname into path and into ppath request vars. */ -NSAPI_PUBLIC int nsafs_mount(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_mount(pblock * pb, Session * sn, Request * rq) { char *reqUri; char *newReqUri; @@ -1034,7 +1015,8 @@ NSAPI_PUBLIC int nsafs_mount(pblock *pb, Session *sn, Request *rq) /* * Allow unauthorized users to access a specific directory in AFS */ -NSAPI_PUBLIC int nsafs_public(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_public(pblock * pb, Session * sn, Request * rq) { char *path; char *public; @@ -1062,13 +1044,13 @@ NSAPI_PUBLIC int nsafs_public(pblock *pb, Session *sn, Request *rq) util_uri_parse(public); } pubLen = strlen(public); - if (strncmp(path, public, pubLen) != 0 || - (path[pubLen] != '/' && path[pubLen] != '\0')) { + if (strncmp(path, public, pubLen) != 0 + || (path[pubLen] != '/' && path[pubLen] != '\0')) { return REQ_NOACTION; } - if (pblock_findval("nsafs_viceid", rq->vars) == NULL || - pblock_findval("nsafs_group0", rq->vars) == NULL || - pblock_findval("nsafs_group1", rq->vars) == NULL) { + if (pblock_findval("nsafs_viceid", rq->vars) == NULL + || pblock_findval("nsafs_group0", rq->vars) == NULL + || pblock_findval("nsafs_group1", rq->vars) == NULL) { pblock_nvinsert("nsafs_public", "TRUE", rq->vars); } return REQ_PROCEED; @@ -1077,7 +1059,8 @@ NSAPI_PUBLIC int nsafs_public(pblock *pb, Session *sn, Request *rq) /* * Identify a path that should be an authentication realm. */ -NSAPI_PUBLIC int nsafs_realm(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_realm(pblock * pb, Session * sn, Request * rq) { char *path; char *realm; @@ -1112,8 +1095,8 @@ NSAPI_PUBLIC int nsafs_realm(pblock *pb, Session *sn, Request *rq) } pathLen = strlen(realm); - if (strncmp(path, realm, pathLen) != 0 || - (path[pathLen] != '/' && path[pathLen] != '\0')) { + if (strncmp(path, realm, pathLen) != 0 + || (path[pathLen] != '/' && path[pathLen] != '\0')) { return REQ_NOACTION; } pblock_nvinsert("nsafs_realm", realm, rq->vars); @@ -1124,12 +1107,9 @@ NSAPI_PUBLIC int nsafs_realm(pblock *pb, Session *sn, Request *rq) * Check whether any path elements beneath the nolinks directory * are symbolic links. Return REQ_PROCEED if no links are found. */ -int nsafs_check_for_links( - char *path, - char *nolinks, - pblock *pb, - Session *sn, - Request *rq) +int +nsafs_check_for_links(char *path, char *nolinks, pblock * pb, Session * sn, + Request * rq) { int rc; int code; @@ -1144,19 +1124,18 @@ int nsafs_check_for_links( */ dirLen = strlen(nolinks); pathLen = strlen(path); - if (pathLen < dirLen || - strncmp(path, nolinks, dirLen) != 0 || - (path[dirLen] != '/' && path[dirLen] != '\0')) { + if (pathLen < dirLen || strncmp(path, nolinks, dirLen) != 0 + || (path[dirLen] != '/' && path[dirLen] != '\0')) { return REQ_PROCEED; } if (path[dirLen] == '/') { dirLen++; } - allocSize = pathLen+1; + allocSize = pathLen + 1; tmpPath = (char *)afs_osi_Alloc(allocSize); strcpy(tmpPath, path); - while(tmpPath[pathLen] == '/' && pathLen > dirLen) { + while (tmpPath[pathLen] == '/' && pathLen > dirLen) { tmpPath[pathLen] = '\0'; pathLen--; } @@ -1171,11 +1150,11 @@ int nsafs_check_for_links( afs_osi_Free(tmpPath, allocSize); return nsafs_error_check(ENOENT, NULL, pb, sn, rq); } - while(tmpPath[pathLen] != '/' && pathLen > dirLen) { + while (tmpPath[pathLen] != '/' && pathLen > dirLen) { tmpPath[pathLen] = '\0'; pathLen--; } - while(tmpPath[pathLen] == '/' && pathLen > dirLen) { + while (tmpPath[pathLen] == '/' && pathLen > dirLen) { tmpPath[pathLen] = '\0'; pathLen--; } @@ -1187,7 +1166,8 @@ int nsafs_check_for_links( /* * Deny access to symbolic links in a directory or its descendents. */ -NSAPI_PUBLIC int nsafs_nolinks(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_nolinks(pblock * pb, Session * sn, Request * rq) { int code; char *path; @@ -1254,7 +1234,8 @@ NSAPI_PUBLIC int nsafs_nolinks(pblock *pb, Session *sn, Request *rq) /* * Set the MIME type for files in AFS. */ -NSAPI_PUBLIC int nsafs_force_type(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_force_type(pblock * pb, Session * sn, Request * rq) { char *path; char *dflt; @@ -1291,7 +1272,8 @@ NSAPI_PUBLIC int nsafs_force_type(pblock *pb, Session *sn, Request *rq) * Disable the Unauthorized response message so users never get * prompted for their name and password. */ -NSAPI_PUBLIC int nsafs_nocheck(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_nocheck(pblock * pb, Session * sn, Request * rq) { char *path; @@ -1331,7 +1313,8 @@ NSAPI_PUBLIC int nsafs_nocheck(pblock *pb, Session *sn, Request *rq) * Require all requests for AFS files that are not explicitly made * public to be authenticated. */ -NSAPI_PUBLIC int nsafs_check(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_check(pblock * pb, Session * sn, Request * rq) { char *path; @@ -1357,9 +1340,9 @@ NSAPI_PUBLIC int nsafs_check(pblock *pb, Session *sn, Request *rq) return REQ_PROCEED; } - if (pblock_findval("nsafs_viceid", rq->vars) == NULL || - pblock_findval("nsafs_group0", rq->vars) == NULL || - pblock_findval("nsafs_group1", rq->vars) == NULL) { + if (pblock_findval("nsafs_viceid", rq->vars) == NULL + || pblock_findval("nsafs_group0", rq->vars) == NULL + || pblock_findval("nsafs_group1", rq->vars) == NULL) { return nsafs_error_check(EPERM, NULL, pb, sn, rq); } @@ -1369,7 +1352,8 @@ NSAPI_PUBLIC int nsafs_check(pblock *pb, Session *sn, Request *rq) /* * Find index files for directories */ -NSAPI_PUBLIC int nsafs_find_index(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_find_index(pblock * pb, Session * sn, Request * rq) { char *path; char *indexNames; @@ -1396,7 +1380,7 @@ NSAPI_PUBLIC int nsafs_find_index(pblock *pb, Session *sn, Request *rq) /* * Skip pathnames that don't end in a slash */ - if (*path == '\0' || path[strlen(path)-1] != '/') { + if (*path == '\0' || path[strlen(path) - 1] != '/') { return REQ_NOACTION; } @@ -1423,17 +1407,17 @@ NSAPI_PUBLIC int nsafs_find_index(pblock *pb, Session *sn, Request *rq) indexP = nsafs_NameFromNames(NULL, indexNames, &pos); while (indexP != NULL) { - nameP = afs_osi_Alloc(strlen(path)+strlen(indexP)+2); + nameP = afs_osi_Alloc(strlen(path) + strlen(indexP) + 2); sprintf(nameP, "%s/%s", path, indexP); rc = stat(nameP, &st); if (rc == 0 && (st.st_mode & S_IFMT) != S_IFDIR) { param_free(pblock_remove("path", rq->vars)); pblock_nvinsert("path", nameP, rq->vars); - afs_osi_Free(nameP, strlen(path)+strlen(indexP)+2); - afs_osi_Free(indexP, strlen(indexP)+1); + afs_osi_Free(nameP, strlen(path) + strlen(indexP) + 2); + afs_osi_Free(indexP, strlen(indexP) + 1); return REQ_PROCEED; } - afs_osi_Free(nameP, strlen(path)+strlen(indexP)+2); + afs_osi_Free(nameP, strlen(path) + strlen(indexP) + 2); indexP = nsafs_NameFromNames(indexP, indexNames, &pos); } } else { @@ -1461,17 +1445,17 @@ NSAPI_PUBLIC int nsafs_find_index(pblock *pb, Session *sn, Request *rq) indexP = nsafs_NameFromNames(NULL, indexNames, &pos); while (indexP != NULL) { - nameP = afs_osi_Alloc(strlen(path)+strlen(indexP)+2); + nameP = afs_osi_Alloc(strlen(path) + strlen(indexP) + 2); sprintf(nameP, "%s/%s", path, indexP); rc = uafs_stat(nameP, &st); if (rc == 0 && (st.st_mode & S_IFMT) != S_IFDIR) { param_free(pblock_remove("path", rq->vars)); pblock_nvinsert("path", nameP, rq->vars); - afs_osi_Free(nameP, strlen(path)+strlen(indexP)+2); - afs_osi_Free(indexP, strlen(indexP)+1); + afs_osi_Free(nameP, strlen(path) + strlen(indexP) + 2); + afs_osi_Free(indexP, strlen(indexP) + 1); return REQ_PROCEED; } - afs_osi_Free(nameP, strlen(path)+strlen(indexP)+2); + afs_osi_Free(nameP, strlen(path) + strlen(indexP) + 2); indexP = nsafs_NameFromNames(indexP, indexNames, &pos); } } @@ -1495,7 +1479,8 @@ struct nsafs_tree { /* * Validate that the given tree is a valid balanced binary tree */ -int nsafs_tree_check(struct nsafs_tree *root) +int +nsafs_tree_check(struct nsafs_tree *root) { int leftDepth; int rightDepth; @@ -1517,7 +1502,7 @@ int nsafs_tree_check(struct nsafs_tree *root) assert(balance == root->balance); assert(balance >= -1); assert(balance <= 1); - return (MAX(leftDepth, rightDepth)+1); + return (MAX(leftDepth, rightDepth) + 1); } #endif /* NSAFS_TREE_DEBUG */ @@ -1526,9 +1511,8 @@ int nsafs_tree_check(struct nsafs_tree *root) * rootP is the address of the parent's pointer to this node. * Returns the change in depth of this tree (0 or 1) */ -int nsafs_node_insert( - struct nsafs_tree *newNode, - struct nsafs_tree **rootP) +int +nsafs_node_insert(struct nsafs_tree *newNode, struct nsafs_tree **rootP) { struct nsafs_tree *thisNode; int delta; @@ -1536,7 +1520,7 @@ int nsafs_node_insert( thisNode = *rootP; if (strcmp(newNode->name, thisNode->name) < 0) { /* - * Insert left + * Insert left */ if (thisNode->left == NULL) { thisNode->left = newNode; @@ -1594,7 +1578,7 @@ int nsafs_node_insert( } } else { /* - * Insert right + * Insert right */ if (thisNode->right == NULL) { thisNode->right = newNode; @@ -1657,10 +1641,8 @@ int nsafs_node_insert( * Allocate storage for a new directory entry, copy in the name and * text, and insert the entry into the balanced binary tree. */ -void nsafs_tree_insert( - char *name, - char *text, - struct nsafs_tree **rootP) +void +nsafs_tree_insert(char *name, char *text, struct nsafs_tree **rootP) { int nameLen; int textLen; @@ -1675,7 +1657,7 @@ void nsafs_tree_insert( allocLen = sizeof(struct nsafs_tree) + nameLen + textLen + 2; newNode = (struct nsafs_tree *)afs_osi_Alloc(allocLen); usr_assert(newNode != NULL); - newNode->name = (char *)(newNode+1); + newNode->name = (char *)(newNode + 1); newNode->text = newNode->name + nameLen + 1; newNode->textLen = textLen; newNode->allocLen = allocLen; @@ -1703,19 +1685,16 @@ void nsafs_tree_insert( /* * Transmit the contents of the tree */ -int nsafs_tree_send( - SYS_NETFD sd, - struct nsafs_tree *root, - char *outbuf, - int *buflen, - int bufsize) +int +nsafs_tree_send(SYS_NETFD sd, struct nsafs_tree *root, char *outbuf, + int *buflen, int bufsize) { int code; struct nsafs_tree *node; char *txtBuf; int txtLen; int len; - + /* * Recurse left, iterate right */ @@ -1751,11 +1730,11 @@ int nsafs_tree_send( /* * Free the binary tree and all data within */ -void nsafs_tree_free( - struct nsafs_tree *root) +void +nsafs_tree_free(struct nsafs_tree *root) { struct nsafs_tree *node, *next; - + /* * Iterate left, recurse right */ @@ -1765,7 +1744,8 @@ void nsafs_tree_free( nsafs_tree_free(node->right); } next = node->left; - afs_osi_Free(node, sizeof(struct nsafs_tree) + strlen(node->name) + + afs_osi_Free(node, + sizeof(struct nsafs_tree) + strlen(node->name) + strlen(node->text) + 2); node = next; } @@ -1774,12 +1754,9 @@ void nsafs_tree_free( /* * Send the contents of an AFS directory, Simple directory format */ -int nsafs_send_directory( - char *path, - struct stat *stp, - pblock *pb, - Session *sn, - Request *rq) +int +nsafs_send_directory(char *path, struct stat *stp, pblock * pb, Session * sn, + Request * rq) { char *dirbuf; int buflen; @@ -1789,10 +1766,9 @@ int nsafs_send_directory( int contentLength; int rc; int code; - char *htmlHdr = "\r\n\r\n" - "Index of %s\r\n" - "

    Index of %s

    \r\n" - "

    \r\n"; + char *htmlHdr = + "\r\n\r\n" "Index of %s\r\n" + "

    Index of %s

    \r\n" "

    \r\n"; char *htmlTrl = "
    \r\n"; struct nsafs_tree *root; @@ -1822,9 +1798,8 @@ int nsafs_send_directory( } else { filename = enp->d_name; } - sprintf(dirbuf, - " %s\r\n", - path, enp->d_name, filename, filename); + sprintf(dirbuf, " %s\r\n", path, + enp->d_name, filename, filename); contentLength += strlen(dirbuf); nsafs_tree_insert(enp->d_name, dirbuf, &root); } @@ -1902,12 +1877,9 @@ int nsafs_send_directory( /* * Send the contents of an AFS file */ -int nsafs_send_file( - char *path, - struct stat *stp, - pblock *pb, - Session *sn, - Request *rq) +int +nsafs_send_file(char *path, struct stat *stp, pblock * pb, Session * sn, + Request * rq) { char *filebuf; int i; @@ -1918,7 +1890,7 @@ int nsafs_send_file( /* * Make sure we can open the file before we send the response header */ - fd = uafs_open(path, O_RDONLY, 0); + fd = uafs_open(path, O_RDONLY, 0); if (fd < 0) { code = errno; return nsafs_error_check(code, NULL, pb, sn, rq); @@ -1971,7 +1943,8 @@ int nsafs_send_file( /* * Service function for AFS files and directories */ -NSAPI_PUBLIC int nsafs_send(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_send(pblock * pb, Session * sn, Request * rq) { char *path; char *dirPath; @@ -2040,17 +2013,17 @@ NSAPI_PUBLIC int nsafs_send(pblock *pb, Session *sn, Request *rq) */ if ((st.st_mode & S_IFMT) == S_IFDIR) { len = strlen(path); - dirPath = afs_osi_Alloc(len+2); + dirPath = afs_osi_Alloc(len + 2); strcpy(dirPath, path); - if (dirPath[len-1] != '/') { + if (dirPath[len - 1] != '/') { dirPath[len] = '/'; - dirPath[len+1] = '\0'; + dirPath[len + 1] = '\0'; } if (util_uri_is_evil(dirPath)) { util_uri_parse(dirPath); } code = nsafs_send_directory(dirPath, &st, pb, sn, rq); - afs_osi_Free(dirPath, len+2); + afs_osi_Free(dirPath, len + 2); } else { code = nsafs_send_file(path, &st, pb, sn, rq); } @@ -2060,7 +2033,8 @@ NSAPI_PUBLIC int nsafs_send(pblock *pb, Session *sn, Request *rq) /* * Service function to create new AFS files */ -NSAPI_PUBLIC int nsafs_put(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_put(pblock * pb, Session * sn, Request * rq) { char *path; char *viceid; @@ -2141,7 +2115,7 @@ NSAPI_PUBLIC int nsafs_put(pblock *pb, Session *sn, Request *rq) rspStatus = PROTOCOL_OK; } - fd = uafs_open(path, O_WRONLY|O_CREAT|O_TRUNC, 0644); + fd = uafs_open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); if (fd < 0) { code = errno; return nsafs_error_check(code, NULL, pb, sn, rq); @@ -2161,7 +2135,7 @@ NSAPI_PUBLIC int nsafs_put(pblock *pb, Session *sn, Request *rq) eof = 1; } } - for (bytesRead = 0 ; !eof && bytesRead < bytesToRead ; bytesRead++) { + for (bytesRead = 0; !eof && bytesRead < bytesToRead; bytesRead++) { rc = netbuf_getc(sn->inbuf); if (rc == IO_EOF) { eof = 1; @@ -2197,7 +2171,7 @@ NSAPI_PUBLIC int nsafs_put(pblock *pb, Session *sn, Request *rq) log_error(LOG_FAILURE, "nsafs", sn, rq, "received partial contents"); return REQ_EXIT; } - + pblock_nninsert("Content-Length", 0, rq->srvhdrs); protocol_status(sn, rq, rspStatus, NULL); code = protocol_start_response(sn, rq); @@ -2207,7 +2181,8 @@ NSAPI_PUBLIC int nsafs_put(pblock *pb, Session *sn, Request *rq) /* * Service function to delete AFS files */ -NSAPI_PUBLIC int nsafs_delete(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_delete(pblock * pb, Session * sn, Request * rq) { char *path; char *viceid; @@ -2255,7 +2230,7 @@ NSAPI_PUBLIC int nsafs_delete(pblock *pb, Session *sn, Request *rq) return REQ_ABORTED; } - rc = uafs_unlink(path); + rc = uafs_unlink(path); if (rc < 0) { code = errno; return nsafs_error_check(code, NULL, pb, sn, rq); @@ -2270,7 +2245,8 @@ NSAPI_PUBLIC int nsafs_delete(pblock *pb, Session *sn, Request *rq) /* * Service function to create AFS directories */ -NSAPI_PUBLIC int nsafs_mkdir(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_mkdir(pblock * pb, Session * sn, Request * rq) { char *path; char *viceid; @@ -2307,7 +2283,7 @@ NSAPI_PUBLIC int nsafs_mkdir(pblock *pb, Session *sn, Request *rq) /* * Create the directory */ - rc = uafs_mkdir(path, 0755); + rc = uafs_mkdir(path, 0755); if (rc < 0) { code = errno; return nsafs_error_check(code, NULL, pb, sn, rq); @@ -2322,7 +2298,8 @@ NSAPI_PUBLIC int nsafs_mkdir(pblock *pb, Session *sn, Request *rq) /* * Service function to delete AFS directories */ -NSAPI_PUBLIC int nsafs_rmdir(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_rmdir(pblock * pb, Session * sn, Request * rq) { char *path; char *viceid; @@ -2370,7 +2347,7 @@ NSAPI_PUBLIC int nsafs_rmdir(pblock *pb, Session *sn, Request *rq) * to to delete directories. */ if ((st.st_mode & S_IFMT) == S_IFDIR) { - rc = uafs_rmdir(path); + rc = uafs_rmdir(path); } else if ((st.st_mode & S_IFMT) == S_IFLNK) { log_error(LOG_INFORM, "nsafs", sn, rq, "Cannot RMDIR links"); protocol_status(sn, rq, PROTOCOL_METHOD_NOT_ALLOWED, NULL); @@ -2396,7 +2373,8 @@ NSAPI_PUBLIC int nsafs_rmdir(pblock *pb, Session *sn, Request *rq) /* * Service function to rename AFS files and directories */ -NSAPI_PUBLIC int nsafs_move(pblock *pb, Session *sn, Request *rq) +NSAPI_PUBLIC int +nsafs_move(pblock * pb, Session * sn, Request * rq) { char *path; char *newPath; @@ -2441,7 +2419,7 @@ NSAPI_PUBLIC int nsafs_move(pblock *pb, Session *sn, Request *rq) /* * Rename the object */ - rc = uafs_rename(path, newPath); + rc = uafs_rename(path, newPath); if (rc < 0) { code = errno; return nsafs_error_check(code, NULL, pb, sn, rq); @@ -2456,10 +2434,8 @@ NSAPI_PUBLIC int nsafs_move(pblock *pb, Session *sn, Request *rq) /* * Send the index of an AFS directory */ -int nsafs_index( - pblock *pb, - Session *sn, - Request *rq) +int +nsafs_index(pblock * pb, Session * sn, Request * rq) { char *path; char *viceid; @@ -2545,14 +2521,14 @@ int nsafs_index( if (rc < 0) { continue; } else if ((st.st_mode & S_IFMT) == S_IFDIR) { - sprintf(dirbuf, "%s directory %u %u\r\n", - enp->d_name, st.st_size, st.st_mtime); + sprintf(dirbuf, "%s directory %u %u\r\n", enp->d_name, st.st_size, + st.st_mtime); } else if ((st.st_mode & S_IFMT) == S_IFLNK) { - sprintf(dirbuf, "%s link %u %u\r\n", - enp->d_name, st.st_size, st.st_mtime); + sprintf(dirbuf, "%s link %u %u\r\n", enp->d_name, st.st_size, + st.st_mtime); } else { - sprintf(dirbuf, "%s unknown %u %u\r\n", - enp->d_name, st.st_size, st.st_mtime); + sprintf(dirbuf, "%s unknown %u %u\r\n", enp->d_name, st.st_size, + st.st_mtime); } contentLength += strlen(dirbuf); nsafs_tree_insert(enp->d_name, dirbuf, &root); diff --git a/src/afsweb/nsafs.h b/src/afsweb/nsafs.h index 0c2d3a27d..dce94f75f 100644 --- a/src/afsweb/nsafs.h +++ b/src/afsweb/nsafs.h @@ -8,13 +8,9 @@ */ /* - * All Rights Reserved - * Licensed Materials - Property of Transarc * * COMPONENT_NAME: Delite Gateway * - * ORIGINS: Transarc Corp. - * */ #ifndef _NSAFS_H_ @@ -45,16 +41,15 @@ typedef struct shaState { } shaState; -void sha_clear(shaState *shaStateP); -void sha_update(shaState *shaStateP, const char *buffer, int bufferLen); -void sha_finish(shaState *shaStateP); -void sha_hash(shaState *shaStateP, const char *buffer, int bufferLen); -void sha_bytes(const shaState *shaStateP, char *bytes); +void sha_clear(shaState * shaStateP); +void sha_update(shaState * shaStateP, const char *buffer, int bufferLen); +void sha_finish(shaState * shaStateP); +void sha_hash(shaState * shaStateP, const char *buffer, int bufferLen); +void sha_bytes(const shaState * shaStateP, char *bytes); -extern afs_int32 nsafs_SetToken ( - struct ktc_principal *aserver, - struct ktc_token *atoken, - struct ktc_principal *aclient, - afs_int32 flags); +extern afs_int32 nsafs_SetToken(struct ktc_principal *aserver, + struct ktc_token *atoken, + struct ktc_principal *aclient, + afs_int32 flags); #endif /* _NSAFS_H_ */ diff --git a/src/afsweb/securehash.c b/src/afsweb/securehash.c index 0db6e5072..c5b14e724 100644 --- a/src/afsweb/securehash.c +++ b/src/afsweb/securehash.c @@ -8,16 +8,9 @@ */ /* - * All Rights Reserved - * Licensed Materials - Property of Transarc - * - * For copyright information, see IPL which you accepted in order to - * download this software. * * COMPONENT_NAME: nsafs * - * ORIGINS: Transarc Corp. - * */ /* @@ -26,18 +19,19 @@ */ #include -#include "../afs/param.h" +#include "afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afsweb/securehash.c,v 1.1.1.4 2001/07/14 22:20:31 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afsweb/securehash.c,v 1.7 2003/07/15 23:14:35 shadow Exp $"); -#include "../afs/sysincludes.h" /* Standard vendor system headers */ +#include "afs/sysincludes.h" /* Standard vendor system headers */ #include -#include "../afs/afsincludes.h" /* Afs-based standard headers */ -#include "../afs/afs_stats.h" -#include "../afs/auth.h" -#include "../afs/cellconfig.h" -#include "../afs/vice.h" -#include "../afs/nsafs.h" +#include "afsincludes.h" /* Afs-based standard headers */ +#include "afs/afs_stats.h" +#include "afs/auth.h" +#include "afs/cellconfig.h" +#include "afs/vice.h" +#include "afs/nsafs.h" static int big_endian; @@ -49,15 +43,17 @@ static const sha_int hashinit[] = { #define ROTL(n, x) (((x) << (n)) | ((x) >> (SHA_BITS_PER_INT - (n)))) #ifdef DISABLED_CODE_HERE -static sha_int f(int t, sha_int x, sha_int y, sha_int z) +static sha_int +f(int t, sha_int x, sha_int y, sha_int z) { - if (t < 0 || t >= SHA_ROUNDS) return 0; + if (t < 0 || t >= SHA_ROUNDS) + return 0; if (t < 20) - return (z ^ (x & (y ^ z))); + return (z ^ (x & (y ^ z))); if (t < 40) - return (x ^ y ^ z); + return (x ^ y ^ z); if (t < 60) - return ((x & y) | (z & (x | y))); /* saves 1 boolean op */ + return ((x & y) | (z & (x | y))); /* saves 1 boolean op */ return (x ^ y ^ z); /* 60-79 same as 40-59 */ } #endif @@ -94,14 +90,16 @@ static sha_int f(int t, sha_int x, sha_int y, sha_int z) /* This macro/function supplies the "magic" constant for each round. */ /* The function call version preserved above until stable */ -static const sha_int k_vals[] = { 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6}; +static const sha_int k_vals[] = + { 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6 }; #define K(t) ( (t < 0 || t >= SHA_ROUNDS) ? 0 : k_vals[ t/20 ] ) /* * Update the internal state based on the given chunk. */ -static void transform(shaState *shaStateP, sha_int *chunk) +static void +transform(shaState * shaStateP, sha_int * chunk) { sha_int A = shaStateP->digest[0]; sha_int B = shaStateP->digest[1]; @@ -116,13 +114,17 @@ static void transform(shaState *shaStateP, sha_int *chunk) for (t = 0; t < SHA_CHUNK_INTS; t++) W[t] = chunk[t]; for (; t < SHA_ROUNDS; t++) { - TEMP = W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]; + TEMP = W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16]; W[t] = ROTL(1, TEMP); } for (t = 0; t < SHA_ROUNDS; t++) { TEMP = ROTL(5, A) + f(t, B, C, D) + E + W[t] + K(t); - E = D; D = C; C = ROTL(30, B); B = A; A = TEMP; + E = D; + D = C; + C = ROTL(30, B); + B = A; + A = TEMP; } shaStateP->digest[0] += A; @@ -138,7 +140,8 @@ static void transform(shaState *shaStateP, sha_int *chunk) * as input and produces an output array of ints that is * SHA_CHUNK_INTS long. */ -static void buildInts(const char *data, sha_int *chunk) +static void +buildInts(const char *data, sha_int * chunk) { /* * Need to copy the data because we can't be certain that @@ -160,7 +163,8 @@ static void buildInts(const char *data, sha_int *chunk) * buildInts to break the input up into chunks and repeatedly passing * these chunks to transform(). */ -void sha_update(shaState *shaStateP, const char *buffer, int bufferLen) +void +sha_update(shaState * shaStateP, const char *buffer, int bufferLen) { int i; sha_int chunk[SHA_CHUNK_INTS]; @@ -174,7 +178,7 @@ void sha_update(shaState *shaStateP, const char *buffer, int bufferLen) shaStateP->bitcountHi++; shaStateP->bitcountLo = newLo; shaStateP->bitcountHi += ((bufferLen >> (SHA_BITS_PER_INT - 3)) & 0x07); - + /* * If we won't have enough for a full chunk, just tack this * buffer onto the leftover piece and return. @@ -219,7 +223,8 @@ void sha_update(shaState *shaStateP, const char *buffer, int bufferLen) * of the hash bitcount to finish the hash. The hash value * is not valid until finish() has been called. */ -void sha_finish(shaState *shaStateP) +void +sha_finish(shaState * shaStateP) { sha_int chunk[SHA_CHUNK_INTS]; int i; @@ -250,11 +255,13 @@ void sha_finish(shaState *shaStateP) * SHS standard, and clear out the bitcount and leftover vars. * This should be used to initialize an shaState. */ -void sha_clear(shaState *shaStateP) +void +sha_clear(shaState * shaStateP) { big_endian = (0x01020304 == htonl(0x01020304)); - memcpy((void *)&shaStateP->digest[0], (void *)&hashinit[0], SHA_HASH_BYTES); + memcpy((void *)&shaStateP->digest[0], (void *)&hashinit[0], + SHA_HASH_BYTES); shaStateP->bitcountLo = shaStateP->bitcountHi = 0; shaStateP->leftoverLen = 0; } @@ -263,7 +270,8 @@ void sha_clear(shaState *shaStateP) /* * Hash the buffer and place the result in *shaStateP. */ -void sha_hash(shaState *shaStateP, const char *buffer, int bufferLen) +void +sha_hash(shaState * shaStateP, const char *buffer, int bufferLen) { sha_clear(shaStateP); sha_update(shaStateP, buffer, bufferLen); @@ -275,10 +283,11 @@ void sha_hash(shaState *shaStateP, const char *buffer, int bufferLen) * Returns the current state of the hash as an array of 20 bytes. * This will be an interim result if finish() has not yet been called. */ -void sha_bytes(const shaState *shaStateP, char *bytes) +void +sha_bytes(const shaState * shaStateP, char *bytes) { sha_int temp[SHA_HASH_INTS]; - int i; + int i; for (i = 0; i < SHA_HASH_INTS; i++) temp[i] = htonl(shaStateP->digest[i]); diff --git a/src/afsweb/weblog.c b/src/afsweb/weblog.c index 3702e2fa2..e3d618fd6 100644 --- a/src/afsweb/weblog.c +++ b/src/afsweb/weblog.c @@ -24,7 +24,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/afsweb/weblog.c,v 1.1.1.6 2001/09/11 14:31:11 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/afsweb/weblog.c,v 1.8 2003/07/15 23:14:35 shadow Exp $"); #include #include @@ -60,7 +61,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afsweb/weblog.c,v 1.1.1.6 2001/09/11 14 #define MAXBUFF 1024 /* For caching */ -#include "apache_afs_cache.h" +#include "apache_afs_cache.h" /* the actual function that does all the work! */ int CommandProc(); @@ -78,88 +79,90 @@ static int writePipe; * now I know why this was necessary! - it's a hokie thing - * the call to ka_UserAuthenticateGeneral doesn't compile otherwise */ -int osi_audit() +int +osi_audit() { - return 0; + return 0; } -main (int argc, char **argv) -{ - struct cmd_syndesc *ts; - afs_int32 code; +main(int argc, char **argv) +{ + struct cmd_syndesc *ts; + afs_int32 code; #ifdef AFS_AIX32_ENV - /* - * The following signal action for AIX is necessary so that in case of a - * crash (i.e. core is generated) we can include the user's data section - * in the core dump. Unfortunately, by default, only a partial core is - * generated which, in many cases, isn't too useful. - */ - struct sigaction nsa; - - sigemptyset(&nsa.sa_mask); - nsa.sa_handler = SIG_DFL; - nsa.sa_flags = SA_FULLDUMP; - sigaction(SIGABRT, &nsa, NULL); - sigaction(SIGSEGV, &nsa, NULL); + /* + * The following signal action for AIX is necessary so that in case of a + * crash (i.e. core is generated) we can include the user's data section + * in the core dump. Unfortunately, by default, only a partial core is + * generated which, in many cases, isn't too useful. + */ + struct sigaction nsa; + + sigemptyset(&nsa.sa_mask); + nsa.sa_handler = SIG_DFL; + nsa.sa_flags = SA_FULLDUMP; + sigaction(SIGABRT, &nsa, NULL); + sigaction(SIGSEGV, &nsa, NULL); #endif - + /* * we ignore SIGPIPE so that EPIPE is returned if there is no one reading * data being written to the pipe */ -#ifdef AIX - /* TODO - for AIX? */ +#ifdef AIX + /* TODO - for AIX? */ #else - struct sigaction sa; - sa.sa_handler = SIG_IGN; - sigaction(SIGPIPE, &sa, NULL); + struct sigaction sa; + sa.sa_handler = SIG_IGN; + sigaction(SIGPIPE, &sa, NULL); #endif - zero_argc = argc; - zero_argv = argv; - - ts = cmd_CreateSyntax((char *) 0, CommandProc, 0, - "obtain Kerberos authentication for web servers"); + zero_argc = argc; + zero_argv = argv; -/* define the command line arguments */ + ts = cmd_CreateSyntax(NULL, CommandProc, 0, + "obtain Kerberos authentication for web servers"); + +/* define the command line arguments */ #define aREADPIPE 0 #define aWRITEPIPE 1 #define aCACHEEXPIRATION 2 #define aTOKENEXPIRATION 3 #define aSILENT 4 - cmd_AddParm(ts, "-readPipe", CMD_SINGLE, CMD_OPTIONAL, "inPipefd"); - cmd_AddParm(ts, "-writePipe", CMD_SINGLE, CMD_OPTIONAL, "outPipefd"); - cmd_AddParm(ts, "-cacheExpiration", CMD_SINGLE, CMD_OPTIONAL, - "local cache expiration times for tokens"); - cmd_AddParm(ts, "-tokenExpiration", CMD_SINGLE, CMD_OPTIONAL, - "cache manager expiration time for tokens"); - cmd_AddParm(ts, "-silent", CMD_FLAG, CMD_OPTIONAL, "silent operation"); - - code = cmd_Dispatch(argc, argv); - - WEBLOGEXIT(code); + cmd_AddParm(ts, "-readPipe", CMD_SINGLE, CMD_OPTIONAL, "inPipefd"); + cmd_AddParm(ts, "-writePipe", CMD_SINGLE, CMD_OPTIONAL, "outPipefd"); + cmd_AddParm(ts, "-cacheExpiration", CMD_SINGLE, CMD_OPTIONAL, + "local cache expiration times for tokens"); + cmd_AddParm(ts, "-tokenExpiration", CMD_SINGLE, CMD_OPTIONAL, + "cache manager expiration time for tokens"); + cmd_AddParm(ts, "-silent", CMD_FLAG, CMD_OPTIONAL, "silent operation"); + + code = cmd_Dispatch(argc, argv); + + WEBLOGEXIT(code); } /* * send a buffer over the pipe */ -static int sendToken(int len, void *buf) +static int +sendToken(int len, void *buf) { - if(buf == NULL) { - WEBLOGEXIT(NULLARGSERROR); - } - if (write(writePipe, buf, len) != len) { + if (buf == NULL) { + WEBLOGEXIT(NULLARGSERROR); + } + if (write(writePipe, buf, len) != len) { #ifdef DEBUG - perror("weblog: write to pipe error"); + perror("weblog: write to pipe error"); #endif - return -1; - } - return 0; + return -1; + } + return 0; } @@ -167,26 +170,27 @@ static int sendToken(int len, void *buf) * read the incoming buffer from the pipe */ -static int readFromClient(char *buf) +static int +readFromClient(char *buf) { - int n; - if(buf == NULL) { - WEBLOGEXIT(NULLARGSERROR); - } - n = read(readPipe, buf, MAXBUFF); - if(n < 0) { + int n; + if (buf == NULL) { + WEBLOGEXIT(NULLARGSERROR); + } + n = read(readPipe, buf, MAXBUFF); + if (n < 0) { #ifdef DEBUG - perror("weblog: pipe read error"); + perror("weblog: pipe read error"); #endif - return -1; - } - if (n == 0) { + return -1; + } + if (n == 0) { #ifdef DEBUG - perror("weblog: zero bytes read from pipe"); + perror("weblog: zero bytes read from pipe"); #endif - return -1; - } - return n; + return -1; + } + return n; } /* @@ -199,24 +203,25 @@ static int readFromClient(char *buf) * NOTE - the space seperated credentials failed for passwds with spaces, thus * we use newline for seperators instead */ -static int getNullSepWord(char *buf, char sep, char *retBuf, int start) +static int +getNullSepWord(char *buf, char sep, char *retBuf, int start) { - int ret=0; - int len=strlen(buf)-start; - - /* error checks */ - if ((buf == NULL) || (retBuf == NULL) || (start < 0)) { - fprintf(stderr, "weblog (getWordSep):NULL args\n"); - return -1; - } - - while ((buf[start] != sep) && (ret<=len)) { - retBuf[ret]=buf[start]; - ret++; - start++; - } - retBuf[ret]='\0'; - return (ret+1); + int ret = 0; + int len = strlen(buf) - start; + + /* error checks */ + if ((buf == NULL) || (retBuf == NULL) || (start < 0)) { + fprintf(stderr, "weblog (getWordSep):NULL args\n"); + return -1; + } + + while ((buf[start] != sep) && (ret <= len)) { + retBuf[ret] = buf[start]; + ret++; + start++; + } + retBuf[ret] = '\0'; + return (ret + 1); } @@ -224,34 +229,35 @@ static int getNullSepWord(char *buf, char sep, char *retBuf, int start) * parses the NEWLINE seperated buffer giving the username, passwd and cell * coming over the pipe from the clients and sets the variables accordingly */ -static int parseBuf(char *buf, char *user, char *pass, char *cell, char *type) +static int +parseBuf(char *buf, char *user, char *pass, char *cell, char *type) { - char *temp; - int start=0, ret = 0; + char *temp; + int start = 0, ret = 0; - if ((buf == NULL) || (user == NULL) || (pass == NULL) || (cell == NULL) - || (type == NULL)) { + if ((buf == NULL) || (user == NULL) || (pass == NULL) || (cell == NULL) + || (type == NULL)) { #ifdef DEBUG - fprintf(stderr, "afs_Authenticator:parseBuf-an arg was NULL\n"); + fprintf(stderr, "afs_Authenticator:parseBuf-an arg was NULL\n"); #endif - return -1; - } - if ((ret = getNullSepWord(buf, '\n', type, start)) < 0) { - return -1; - } - start += ret; - if ((ret = getNullSepWord(buf, '\n', user, start)) < 0) { - return -1; - } - start += ret; - if ((ret = getNullSepWord(buf, '\n', cell, start)) < 0) { - return -1; - } - start += ret; - if ((ret = getNullSepWord(buf, '\n', pass, start)) < 0) { - return -1; - } - return 0; + return -1; + } + if ((ret = getNullSepWord(buf, '\n', type, start)) < 0) { + return -1; + } + start += ret; + if ((ret = getNullSepWord(buf, '\n', user, start)) < 0) { + return -1; + } + start += ret; + if ((ret = getNullSepWord(buf, '\n', cell, start)) < 0) { + return -1; + } + start += ret; + if ((ret = getNullSepWord(buf, '\n', pass, start)) < 0) { + return -1; + } + return 0; } @@ -259,16 +265,18 @@ static int parseBuf(char *buf, char *user, char *pass, char *cell, char *type) * Discard any authentication information held in trust by the Cache Manager * for the calling process and all other processes in the same PAG */ -static int unlog() +static int +unlog() { - return do_pioctl(NULL, 0, NULL, 0, VIOCUNPAG, NULL, 0); + return do_pioctl(NULL, 0, NULL, 0, VIOCUNPAG, NULL, 0); } /* we can obtain a PAG by calling this system call */ -static int makeNewPAG() +static int +makeNewPAG() { - return do_setpag(); + return do_setpag(); } #ifdef ENABLE_DCE_DLOG @@ -294,59 +302,63 @@ typedef struct kdc_as_reply { char *realm; } kdc_as_reply_t; -static char *makeString(char *sp) +static char * +makeString(char *sp) { - int len; - char *new_string; - - if (sp == NULL) { - fprintf(stderr, "weblog: makeString - NULL argument\n"); - return NULL; - } - len=strlen(sp); - if (len < 0) { - fprintf(stderr, "weblog: makeString. strlen error\n"); - return NULL; - } - new_string=(char *) malloc(len+1); - if (new_string==(char *)0) { - fprintf(stderr, "weblog: Out of memory - malloc failed\n"); - return NULL; - } - strncpy(new_string,sp,len); - return new_string; + int len; + char *new_string; + + if (sp == NULL) { + fprintf(stderr, "weblog: makeString - NULL argument\n"); + return NULL; + } + len = strlen(sp); + if (len < 0) { + fprintf(stderr, "weblog: makeString. strlen error\n"); + return NULL; + } + new_string = (char *)malloc(len + 1); + if (new_string == NULL) { + fprintf(stderr, "weblog: Out of memory - malloc failed\n"); + return NULL; + } + strncpy(new_string, sp, len); + return new_string; } /* * Store the returned credentials as an AFS "token" for the user * "AFS ID ". */ -static int store_afs_token(unix_id, realm_p, tkt_type, ticket_p, ticket_len, - session_key, starttime, endtime, set_pag) - afs_int32 unix_id; - char *realm_p; - afs_int32 tkt_type; - unsigned char *ticket_p; - int ticket_len; - des_cblock session_key; - afs_int32 starttime; - afs_int32 endtime; - int set_pag; +static int +store_afs_token(unix_id, realm_p, tkt_type, ticket_p, ticket_len, session_key, + starttime, endtime, set_pag) + afs_int32 unix_id; + char *realm_p; + afs_int32 tkt_type; + unsigned char *ticket_p; + int ticket_len; + des_cblock session_key; + afs_int32 starttime; + afs_int32 endtime; + int set_pag; { struct ktc_token token; struct ktc_principal client, server; token.startTime = starttime; token.endTime = endtime; - memcpy((char *) &token.sessionKey, session_key, sizeof(token.sessionKey)); + memcpy((char *)&token.sessionKey, session_key, sizeof(token.sessionKey)); token.kvno = tkt_type; token.ticketLen = ticket_len; if (ticket_len > MAXKTCTICKETLEN) { - fprintf(stderr, "weblog: DCE ticket is too long (length %d)." - "Maximum length accepted by AFS cache manager is %d\n", MAXKTCTICKETLEN); + fprintf(stderr, + "weblog: DCE ticket is too long (length %d)." + "Maximum length accepted by AFS cache manager is %d\n", + MAXKTCTICKETLEN); return -1; } - memcpy((char *) token.ticket, (char *) ticket_p, ticket_len); + memcpy((char *)token.ticket, (char *)ticket_p, ticket_len); sprintf(client.name, "AFS ID %d", unix_id); strcpy(client.instance, ""); @@ -356,17 +368,18 @@ static int store_afs_token(unix_id, realm_p, tkt_type, ticket_p, ticket_len, strcpy(server.instance, ""); strcpy(server.cell, realm_p); - return (ktc_SetToken(&server, &token, &client, - set_pag ? AFS_SETTOK_SETPAG : 0)); + return (ktc_SetToken + (&server, &token, &client, set_pag ? AFS_SETTOK_SETPAG : 0)); } -static char *make_string(s_p, length) - char *s_p; - int length; +static char * +make_string(s_p, length) + char *s_p; + int length; { - char *new_p = (char *) malloc(length + 1); - if (new_p == (char *) 0) { + char *new_p = (char *)malloc(length + 1); + if (new_p == NULL) { fprintf(stderr, "dlog: out of memory\n"); exit(1); } @@ -381,28 +394,30 @@ static char *make_string(s_p, length) * * NOTE: A test for this procedure is included at the end of this file. */ -static int decode_asn_time(buf, buflen, utime) - char *buf; - int buflen; - afs_int32 *utime; +static int +decode_asn_time(buf, buflen, utime) + char *buf; + int buflen; + afs_int32 *utime; { int year, month, day, hour, mina, sec; int leapyear, days; - static mdays[11] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30}; + static mdays[11] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30 }; int m; - if (buflen != 15 || - sscanf(buf, "%4d%2d%2d%2d%2d%2dZ", - &year, &month, &day, &hour, &mina, &sec) != 6) { + if (buflen != 15 + || sscanf(buf, "%4d%2d%2d%2d%2d%2dZ", &year, &month, &day, &hour, + &mina, &sec) != 6) { return 1; } leapyear = month > 2 ? (year + 1) : year; /* Account for feb 29 if - current year is a leap year */ - for (days = 0, m = 0; m < month - 1; m++) days += mdays[m]; + * current year is a leap year */ + for (days = 0, m = 0; m < month - 1; m++) + days += mdays[m]; *utime = - ((((((year - 1970) * 365 + (leapyear - 1970 + 1)/4 - + days + day - 1) * 24) + hour) * 60 + mina) * 60) + sec; + ((((((year - 1970) * 365 + (leapyear - 1970 + 1) / 4 + days + day - + 1) * 24) + hour) * 60 + mina) * 60) + sec; return 0; } @@ -428,10 +443,11 @@ static int decode_asn_time(buf, buflen, utime) #define ASN_GENERAL_STRING 0x1b #define KDC_REP 0x7a -static int decode_reply(buf, buflen, reply_p) - unsigned char *buf; /* encoded ASN.1 string */ - int buflen; /* length of encoded string */ - kdc_as_reply_t *reply_p; /* result */ +static int +decode_reply(buf, buflen, reply_p) + unsigned char *buf; /* encoded ASN.1 string */ + int buflen; /* length of encoded string */ + kdc_as_reply_t *reply_p; /* result */ { unsigned char *limit = buf + buflen; @@ -444,7 +460,7 @@ static int decode_reply(buf, buflen, reply_p) char saw_realm = 0; int context = -1; /* Initialize with invalid context */ - + reply_p->starttime = 0; /* This is optionally provided by kdc */ while (buf < limit) { @@ -456,7 +472,7 @@ static int decode_reply(buf, buflen, reply_p) if ((op & 0x20) == 0) { /* Primitive encoding */ if (len & 0x80) { - return 1; /* Forget about long unspecified lengths */ + return 1; /* Forget about long unspecified lengths */ } /* Bounds check */ if (buf + len > limit) @@ -464,11 +480,11 @@ static int decode_reply(buf, buflen, reply_p) } switch (op) { - case KDC_REP: + case KDC_REP: saw_kdc_rep++; break; - case ASN_INTEGER: + case ASN_INTEGER: { /* * Since non ANSI C doesn't recognize the "signed" @@ -490,7 +506,7 @@ static int decode_reply(buf, buflen, reply_p) } break; - case ASN_OCTET_STRING: + case ASN_OCTET_STRING: if (context == 1 && len == sizeof(reply_p->session_key)) { saw_session_key++; memcpy(reply_p->session_key, buf, len); @@ -498,10 +514,10 @@ static int decode_reply(buf, buflen, reply_p) buf += len; break; - case ASN_GENERAL_STRING: + case ASN_GENERAL_STRING: if (context == 9) { saw_realm = 1; - reply_p->realm = make_string(buf,len); + reply_p->realm = make_string(buf, len); goto out; /* Best to terminate now, rather than * continue--we don't know if the entire * request is padded with zeroes, and if @@ -515,21 +531,21 @@ static int decode_reply(buf, buflen, reply_p) buf += len; break; - case ASN_TIME: + case ASN_TIME: switch (context) { - case 5: + case 5: saw_authtime++; - if (decode_asn_time(buf, len, &reply_p->authtime)) + if (decode_asn_time(buf, len, &reply_p->authtime)) return 1; break; - case 6: + case 6: saw_starttime++; if (decode_asn_time(buf, len, &reply_p->starttime)) return 1; break; - - case 7: + + case 7: saw_endtime++; if (decode_asn_time(buf, len, &reply_p->endtime)) return 1; @@ -538,7 +554,7 @@ static int decode_reply(buf, buflen, reply_p) buf += len; break; - default: + default: if ((op & 0xe0) == 0xa0) { /* Remember last context label */ context = op & 0x1f; @@ -550,228 +566,234 @@ static int decode_reply(buf, buflen, reply_p) } out: - return ! (saw_kdc_rep == 1 && saw_nonce == 1 && saw_session_key == 1 && - saw_authtime == 1 && (saw_starttime == 1 || saw_starttime == 0) && - saw_endtime == 1 && saw_realm == 1); + return !(saw_kdc_rep == 1 && saw_nonce == 1 && saw_session_key == 1 + && saw_authtime == 1 && (saw_starttime == 1 + || saw_starttime == 0) + && saw_endtime == 1 && saw_realm == 1); } - + /* * Attempt to obtain a DFS ticket */ -static int getDFScreds(char *name, char *realm, char *passwd, - afs_uint32 lifetime, char **reason) +static int +getDFScreds(char *name, char *realm, char *passwd, afs_uint32 lifetime, + char **reason) { - extern ADK_GetTicket(); - afs_int32 serverList[MAXSERVERS]; - struct rx_connection *serverconns[MAXSERVERS]; - struct ubik_client *ubik_handle=0; - struct timeval now; /* current time */ - afs_int32 nonce; /* Kerberos V5 "nonce" */ - adk_error_ptr error_p; /* Error code from ktc intermediary */ - adk_reply_ptr reply_p; /* reply from ktc intermediary */ - des_cblock passwd_key; /* des key from user password */ - des_key_schedule schedule; /* Key schedule from key */ - kdc_as_reply_t kdcrep; /* Our own decoded version of - ciphertext portion of kdc reply */ - int code; - struct afsconf_dir *cdir; /* Open configuration structure */ - int i; - struct afsconf_cell cellinfo; /* Info for specified cell */ - - if ((name==NULL)||(realm==NULL)||(passwd==NULL)) { - *reason=makeString("weblog: NULL Arguments to getDCEcreds"); - return -1; - } - - cdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH); - if (!cdir) { - *reason=makeString("weblog: unable to read or open AFS client " - "configuration file"); - return -1; - } - - /* - * Resolve full name of cell and get server list. - */ - code = afsconf_GetCellInfo(cdir, realm, 0, &cellinfo); - if (code) { - *reason=makeString("-- unable to get cell info"); - return -1; - } - - if (strcmp(realm, cellinfo.name)) { - strncpy(realm, cellinfo.name, sizeof(realm) - 1); - realm[sizeof(realm) - 1] = '\0'; - } - - for (i = 0; i < cellinfo.numServers && i < MAXSERVERS; i++) { - serverList[i] = cellinfo.hostAddr[i].sin_addr.s_addr; - } - if (i < MAXSERVERS) serverList[i] = 0; - - /* - * Make connections to all the servers. - */ - rx_Init(0); - for (i = 0; i < MAXSERVERS; i++) { - if (! serverList[i]) { - serverconns[i] = 0; - break; + extern ADK_GetTicket(); + afs_int32 serverList[MAXSERVERS]; + struct rx_connection *serverconns[MAXSERVERS]; + struct ubik_client *ubik_handle = 0; + struct timeval now; /* current time */ + afs_int32 nonce; /* Kerberos V5 "nonce" */ + adk_error_ptr error_p; /* Error code from ktc intermediary */ + adk_reply_ptr reply_p; /* reply from ktc intermediary */ + des_cblock passwd_key; /* des key from user password */ + des_key_schedule schedule; /* Key schedule from key */ + kdc_as_reply_t kdcrep; /* Our own decoded version of + * ciphertext portion of kdc reply */ + int code; + struct afsconf_dir *cdir; /* Open configuration structure */ + int i; + struct afsconf_cell cellinfo; /* Info for specified cell */ + + if ((name == NULL) || (realm == NULL) || (passwd == NULL)) { + *reason = makeString("weblog: NULL Arguments to getDCEcreds"); + return -1; + } + + cdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH); + if (!cdir) { + *reason = + makeString("weblog: unable to read or open AFS client " + "configuration file"); + return -1; + } + + /* + * Resolve full name of cell and get server list. + */ + code = afsconf_GetCellInfo(cdir, realm, 0, &cellinfo); + if (code) { + *reason = makeString("-- unable to get cell info"); + return -1; + } + + if (strcmp(realm, cellinfo.name)) { + strncpy(realm, cellinfo.name, sizeof(realm) - 1); + realm[sizeof(realm) - 1] = '\0'; + } + + for (i = 0; i < cellinfo.numServers && i < MAXSERVERS; i++) { + serverList[i] = cellinfo.hostAddr[i].sin_addr.s_addr; + } + if (i < MAXSERVERS) + serverList[i] = 0; + + /* + * Make connections to all the servers. + */ + rx_Init(0); + for (i = 0; i < MAXSERVERS; i++) { + if (!serverList[i]) { + serverconns[i] = 0; + break; + } + serverconns[i] = + rx_NewConnection(serverList[i], htons(ADK_PORT), ADK_SERVICE, + rxnull_NewClientSecurityObject(), 0); + } + + /* + * Initialize ubik client gizmo to randomize the calls for us. + */ + ubik_ClientInit(serverconns, &ubik_handle); + /* + * Come up with an acceptable nonce. V5 doc says that we just need + * time of day. Actually, for this app, I don't think anything + * is really needed. Better safe than sorry (although I wonder if + * it might have been better to encode the AFS ID in the nonce + * reply field--that's the one field that the intermediate server + * has total control over, and which can be securely transmitted + * back to the client). + */ + gettimeofday(&now, 0); + nonce = now.tv_sec; + + + /* + * Ask our agent to get us a Kerberos V5 ticket. + */ + reply_p = (adk_reply_ptr) 0; + error_p = (adk_error_ptr) 0; + code = ubik_Call(ADK_GetTicket, ubik_handle, 0, /* Ubik flags */ + name, /* IN: Principal: must be exact DCE principal */ + nonce, /* IN: Input nonce */ + lifetime, /* IN: lifetime */ + &error_p, /* OUT: Error, if any */ + &reply_p); /* OUT: KTC reply, if no error */ + + /* + * Destroy Rx connections on the off-chance this will allow less state + * to be preserved at the server. + */ + ubik_ClientDestroy(ubik_handle); + + /* + * Finalize Rx. This may allow connections at the server to wind down + * faster. + */ + rx_Finalize(); + + + /* + * Check for simple communication failures. + */ + if (code) { + *reason = makeString("-- failed to contact authentication service"); + return -1; + } + + /* + * Also check for DCE errors, which are interpreted for us by + * the translator. + */ + if (error_p && error_p->code) { + *reason = (char *)makeString(error_p->data); + fprintf(stderr, "weblog error:error_p->data:%s\n", error_p->data); + return -1; + } + + + /* + * Make sure the reply was filled in. + */ + if (!reply_p) { + *reason = (char *) + makeString + ("weblog: unexpected error in server response; aborted"); + return -1; } - serverconns[i] = rx_NewConnection - (serverList[i], htons(ADK_PORT), ADK_SERVICE, - rxnull_NewClientSecurityObject(), 0); - } - - /* - * Initialize ubik client gizmo to randomize the calls for us. - */ - ubik_ClientInit(serverconns, &ubik_handle); - /* - * Come up with an acceptable nonce. V5 doc says that we just need - * time of day. Actually, for this app, I don't think anything - * is really needed. Better safe than sorry (although I wonder if - * it might have been better to encode the AFS ID in the nonce - * reply field--that's the one field that the intermediate server - * has total control over, and which can be securely transmitted - * back to the client). - */ - gettimeofday(&now, 0); - nonce = now.tv_sec; - - - /* - * Ask our agent to get us a Kerberos V5 ticket. - */ - reply_p = (adk_reply_ptr) 0; - error_p = (adk_error_ptr) 0; - code = ubik_Call - (ADK_GetTicket, - ubik_handle, - 0, /* Ubik flags */ - name, /* IN: Principal: must be exact DCE principal */ - nonce, /* IN: Input nonce */ - lifetime, /* IN: lifetime */ - &error_p, /* OUT: Error, if any */ - &reply_p); /* OUT: KTC reply, if no error */ - - /* - * Destroy Rx connections on the off-chance this will allow less state - * to be preserved at the server. - */ - ubik_ClientDestroy(ubik_handle); - - /* - * Finalize Rx. This may allow connections at the server to wind down - * faster. - */ - rx_Finalize(); - - - /* - * Check for simple communication failures. - */ - if (code) { - *reason=makeString("-- failed to contact authentication service"); - return -1; - } - - /* - * Also check for DCE errors, which are interpreted for us by - * the translator. - */ - if (error_p && error_p->code) { - *reason=( char *) makeString(error_p->data); - fprintf(stderr,"weblog error:error_p->data:%s\n", error_p->data); - return -1; - } - - - /* - * Make sure the reply was filled in. - */ - if (!reply_p) { - *reason=(char *) makeString("weblog: unexpected error in server response; aborted"); - return -1; - } - - - /* - * Convert the password into the appropriate key block, given - * the salt passed back from the ADK_GetTicket call, above. Destroy - * the password. - */ - if (strlen(passwd) + strlen(reply_p->salt) + 1 > BUFSIZ) { - *reason=(char *) makeString("weblog: unexpectedly long passwd/salt combination"); - return -1; - } - strcat(passwd, reply_p->salt); - des_string_to_key(passwd, passwd_key); - - /* Destroy the password. */ - memset(passwd, 0, strlen(passwd)); - - - /* - * Decrypt the private data returned by the DCE KDC, and forwarded - * to us by the translator. - */ - code = des_key_sched (passwd_key, schedule); - if (!code) { - code = des_cbc_encrypt - (reply_p->private.adk_code_val, reply_p->private.adk_code_val, - reply_p->private.adk_code_len, schedule, passwd_key, DECRYPT); - } - if (code) { - *reason=(char *) makeString("-- unable to decrypt reply from the DCE KDC"); - return -1; - } - - /* - * Destroy the key block: it's no longer needed. - */ - memset(schedule, 0, sizeof(schedule)); - memset(passwd_key, 0, sizeof(passwd_key)); - - - /* - * Do a very quick and dirty ASN.1 decode of the relevant parts - * of the private data. - * - * The decrypted data contains a 12-byte header (confounder and CRC-32 - * checksum). We choose to ignore this. - */ - code = decode_reply(reply_p->private.adk_code_val + 12, /* Skip header */ - reply_p->private.adk_code_len - 12, /* ditto */ - &kdcrep); - - if (code || kdcrep.nonce != nonce) { - *reason=(char *)makeString("weblog: DCE authentication failed -- " - "password is probably incorrect"); - return -1; - } - - - /* - * Make an AFS token out of the ticket and session key, and install it - * in the cache manager. - */ - code = store_afs_token(reply_p->unix_id, - realm, - reply_p->tktype, - reply_p->ticket.adk_code_val, - reply_p->ticket.adk_code_len, - kdcrep.session_key, - kdcrep.starttime? kdcrep.starttime : kdcrep.authtime, - kdcrep.endtime, - 0); - - if (code) { - *reason=(char *)makeString("weblog -- getDCEcreds:failed to store tickets"); - return -1; - } - return 0; + + + /* + * Convert the password into the appropriate key block, given + * the salt passed back from the ADK_GetTicket call, above. Destroy + * the password. + */ + if (strlen(passwd) + strlen(reply_p->salt) + 1 > BUFSIZ) { + *reason = (char *) + makeString("weblog: unexpectedly long passwd/salt combination"); + return -1; + } + strcat(passwd, reply_p->salt); + des_string_to_key(passwd, passwd_key); + + /* Destroy the password. */ + memset(passwd, 0, strlen(passwd)); + + + /* + * Decrypt the private data returned by the DCE KDC, and forwarded + * to us by the translator. + */ + code = des_key_sched(passwd_key, schedule); + if (!code) { + code = + des_cbc_encrypt(reply_p->private.adk_code_val, + reply_p->private.adk_code_val, + reply_p->private.adk_code_len, schedule, + passwd_key, DECRYPT); + } + if (code) { + *reason = + (char *)makeString("-- unable to decrypt reply from the DCE KDC"); + return -1; + } + + /* + * Destroy the key block: it's no longer needed. + */ + memset(schedule, 0, sizeof(schedule)); + memset(passwd_key, 0, sizeof(passwd_key)); + + + /* + * Do a very quick and dirty ASN.1 decode of the relevant parts + * of the private data. + * + * The decrypted data contains a 12-byte header (confounder and CRC-32 + * checksum). We choose to ignore this. + */ + code = decode_reply(reply_p->private.adk_code_val + 12, /* Skip header */ + reply_p->private.adk_code_len - 12, /* ditto */ + &kdcrep); + + if (code || kdcrep.nonce != nonce) { + *reason = + (char *)makeString("weblog: DCE authentication failed -- " + "password is probably incorrect"); + return -1; + } + + + /* + * Make an AFS token out of the ticket and session key, and install it + * in the cache manager. + */ + code = + store_afs_token(reply_p->unix_id, realm, reply_p->tktype, + reply_p->ticket.adk_code_val, + reply_p->ticket.adk_code_len, kdcrep.session_key, + kdcrep.starttime ? kdcrep.starttime : kdcrep.authtime, + kdcrep.endtime, 0); + + if (code) { + *reason = (char *) + makeString("weblog -- getDCEcreds:failed to store tickets"); + return -1; + } + return 0; } #endif /* ENABLE_DCE_DLOG */ @@ -781,257 +803,260 @@ static int getDFScreds(char *name, char *realm, char *passwd, * arrive through a pipe from the httpds, authenticates the user and * returns a token (or a failure message) over the pipe */ -CommandProc (as, arock) +CommandProc(as, arock) char *arock; struct cmd_syndesc *as; - + { - char name[MAXKTCNAMELEN]; - char cell[MAXKTCREALMLEN]; - char passwd[BUFSIZ]; + char name[MAXKTCNAMELEN]; + char cell[MAXKTCREALMLEN]; + char passwd[BUFSIZ]; /* All the constant sizes for these arrays are taken from the code for klog */ - - char cksum[SHA_HASH_BYTES]; /* for sha checksum for caching */ - afs_int32 expires=0; /* for cache expiration */ - afs_int32 cacheExpiration=0; /* configurable cmd line parameter */ - afs_int32 testExpires=0; /* cacheExpiration + current time */ - - int authtype = 0; /* AFS or AFS-DFS Authentication */ - int code; - int shutdown = 0; /* on getting shutdown from the pipe we GO */ - int gotToken = 0; /* did we get a token from the cache manager */ - afs_int32 i=0; /* for getting primary token held by CM */ - int dosetpag=1; /* not used */ - Date lifetime; /* requested ticket lifetime */ - char tbuffer[MAXBUFF]; /* for pioctl ops + pipe transfers */ - static char rn[] = "weblog"; /* Routine name */ - static int Silent = 0; /* Don't want error messages */ - afs_int32 password_expires = -1; - char *reason; /* string describing errors */ - char type[10]; /* authentication type AFS or DFS */ - - /* blow away command line arguments */ - for (i=1; iparms[aSILENT].items ? 1 : 0); - - code = ka_Init(0); - if (code) { - if (!Silent) { - fprintf(stderr, "%s:ka_Init FAILED\n", rn); + + char cksum[SHA_HASH_BYTES]; /* for sha checksum for caching */ + afs_int32 expires = 0; /* for cache expiration */ + afs_int32 cacheExpiration = 0; /* configurable cmd line parameter */ + afs_int32 testExpires = 0; /* cacheExpiration + current time */ + + int authtype = 0; /* AFS or AFS-DFS Authentication */ + int code; + int shutdown = 0; /* on getting shutdown from the pipe we GO */ + int gotToken = 0; /* did we get a token from the cache manager */ + afs_int32 i = 0; /* for getting primary token held by CM */ + int dosetpag = 1; /* not used */ + Date lifetime; /* requested ticket lifetime */ + char tbuffer[MAXBUFF]; /* for pioctl ops + pipe transfers */ + static char rn[] = "weblog"; /* Routine name */ + static int Silent = 0; /* Don't want error messages */ + afs_int32 password_expires = -1; + char *reason; /* string describing errors */ + char type[10]; /* authentication type AFS or DFS */ + + /* blow away command line arguments */ + for (i = 1; i < zero_argc; i++) + memset(zero_argv[i], 0, strlen(zero_argv[i])); + zero_argc = 0; + + /* first determine quiet flag based on -silent switch */ + Silent = (as->parms[aSILENT].items ? 1 : 0); + + code = ka_Init(0); + if (code) { + if (!Silent) { + fprintf(stderr, "%s:ka_Init FAILED\n", rn); + } + WEBLOGEXIT(KAERROR); } - WEBLOGEXIT(KAERROR); - } - - /* Parse our arguments. */ - if (as->parms[aREADPIPE].items) - /* there is a file descriptor instead of stdin */ - readPipe = atoi(as->parms[aREADPIPE].items->data); - else - readPipe = stdin; - - if (as->parms[aWRITEPIPE].items) - /* there is a file descriptor instead of stdout */ - writePipe = atoi(as->parms[aWRITEPIPE].items->data); - else - writePipe = stdout; - - if (as->parms[aCACHEEXPIRATION].items) - /* set configurable cache expiration time */ - cacheExpiration=atoi(as->parms[aCACHEEXPIRATION].items->data); - - if (as->parms[aTOKENEXPIRATION].items) - /* set configurable token lifetime */ - lifetime = atoi(as->parms[aTOKENEXPIRATION].items->data); - - /* - * Initialize the cache for tokens - */ - token_cache_init(); - - /* - * discard any tokens held for this PAG - - * should we create a seperate PAG for weblog first? makeNewPAG does that - */ + + /* Parse our arguments. */ + if (as->parms[aREADPIPE].items) + /* there is a file descriptor instead of stdin */ + readPipe = atoi(as->parms[aREADPIPE].items->data); + else + readPipe = stdin; + + if (as->parms[aWRITEPIPE].items) + /* there is a file descriptor instead of stdout */ + writePipe = atoi(as->parms[aWRITEPIPE].items->data); + else + writePipe = stdout; + + if (as->parms[aCACHEEXPIRATION].items) + /* set configurable cache expiration time */ + cacheExpiration = atoi(as->parms[aCACHEEXPIRATION].items->data); + + if (as->parms[aTOKENEXPIRATION].items) + /* set configurable token lifetime */ + lifetime = atoi(as->parms[aTOKENEXPIRATION].items->data); + + /* + * Initialize the cache for tokens + */ + token_cache_init(); + + /* + * discard any tokens held for this PAG - + * should we create a seperate PAG for weblog first? makeNewPAG does that + */ #ifdef DEBUG - fprintf(stderr, "%s:Before MAKENEWPAG\n", rn); - printGroups(); - fprintf(stderr,"\nWEBLOG: before PAG:\t"); - printPAG(); + fprintf(stderr, "%s:Before MAKENEWPAG\n", rn); + printGroups(); + fprintf(stderr, "\nWEBLOG: before PAG:\t"); + printPAG(); #endif - if (makeNewPAG()) { - fprintf(stderr, "WEBLOG: MakeNewPAG failed\n"); - } + if (makeNewPAG()) { + fprintf(stderr, "WEBLOG: MakeNewPAG failed\n"); + } #ifdef DEBUG - fprintf(stderr,"weblog:AFTER do_setpag,PAG:\t"); - printPAG(); - fprintf(stderr, "%s:After MAKENEWPAG\n", rn); - printGroups(); + fprintf(stderr, "weblog:AFTER do_setpag,PAG:\t"); + printPAG(); + fprintf(stderr, "%s:After MAKENEWPAG\n", rn); + printGroups(); #endif - - if (unlog()) { + + if (unlog()) { #ifdef DEBUG - fprintf(stderr, "WEBLOG: UNLOG FAILED\n"); + fprintf(stderr, "WEBLOG: UNLOG FAILED\n"); #endif - } - - while (!shutdown) { - gotToken = 0; - code = readFromClient(tbuffer); - if (code > 0) { - tbuffer[code]='\0'; - code =parseBuf(tbuffer, name, passwd, cell, type); - if (code) { - fprintf(stderr, "weblog: parseBuf FAILED\n"); - WEBLOGEXIT(PARSEERROR); - } } - else { + + while (!shutdown) { + gotToken = 0; + code = readFromClient(tbuffer); + if (code > 0) { + tbuffer[code] = '\0'; + code = parseBuf(tbuffer, name, passwd, cell, type); + if (code) { + fprintf(stderr, "weblog: parseBuf FAILED\n"); + WEBLOGEXIT(PARSEERROR); + } + } else { #ifdef DEBUG - fprintf(stderr, "%s: readFromClient FAILED:%d...exiting\n",rn,code); + fprintf(stderr, "%s: readFromClient FAILED:%d...exiting\n", rn, + code); #endif - WEBLOGEXIT(PIPEREADERROR); - } + WEBLOGEXIT(PIPEREADERROR); + } - if (strcasecmp(type, "AFS") == 0) { - authtype=1; - } + if (strcasecmp(type, "AFS") == 0) { + authtype = 1; + } #ifdef ENABLE_DCE_DLOG - else if (strcasecmp(type, "AFS-DFS")==0) { - authtype=2; - } + else if (strcasecmp(type, "AFS-DFS") == 0) { + authtype = 2; + } #endif /* ENABLE_DCE_DLOG */ - else { - authtype=0; - } + else { + authtype = 0; + } - if(!authtype) { - reason=(char *)malloc(sizeof(tbuffer)); - sprintf(reason, "weblog: Unknown Authentication type:%s. AFS-DFS login " - "may not be enabled - check compile flags for ENABLE_DCE_DLOG", type); - goto reply_failure; - } + if (!authtype) { + reason = (char *)malloc(sizeof(tbuffer)); + sprintf(reason, + "weblog: Unknown Authentication type:%s. AFS-DFS login " + "may not be enabled - check compile flags for ENABLE_DCE_DLOG", + type); + goto reply_failure; + } - memset((void *)&tbuffer, 0, sizeof(tbuffer)); + memset((void *)&tbuffer, 0, sizeof(tbuffer)); - /* look up local cache */ - weblog_login_checksum(name, cell, passwd, cksum); - code = weblog_login_lookup(name, cell, cksum, &tbuffer[0]); + /* look up local cache */ + weblog_login_checksum(name, cell, passwd, cksum); + code = weblog_login_lookup(name, cell, cksum, &tbuffer[0]); - if (!code) { /* local cache lookup failed */ - /* authenticate user */ + if (!code) { /* local cache lookup failed */ + /* authenticate user */ #ifdef DEBUG - fprintf(stderr, "WEBLOG GROUPCHECK BEFORE KA_AUTH\n"); - printGroups(); + fprintf(stderr, "WEBLOG GROUPCHECK BEFORE KA_AUTH\n"); + printGroups(); #endif - - if (authtype==1) { - code=ka_UserAuthenticateGeneral - ( - KA_USERAUTH_VERSION+0, name, NULL, cell, - passwd, lifetime, &password_expires,0,&reason - ); - } + + if (authtype == 1) { + code = + ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION + 0, name, + NULL, cell, passwd, lifetime, + &password_expires, 0, &reason); + } #ifdef ENABLE_DCE_DLOG - else if (authtype == 2) { - unlog(); - code=getDFScreds(name,cell,passwd, lifetime, &reason); - } + else if (authtype == 2) { + unlog(); + code = getDFScreds(name, cell, passwd, lifetime, &reason); + } #ifdef DEBUG_DCE - printf("Code:%d\n",code); - if (code) { - if (reason) { - printf("FAILURE:Reason:%s\n",reason); - } - } + printf("Code:%d\n", code); + if (code) { + if (reason) { + printf("FAILURE:Reason:%s\n", reason); + } + } #endif #endif /* ENABLE_DCE_DLOG */ - if (code) { + if (code) { #ifdef DEBUG - if (!Silent) { - fprintf(stderr,"weblog:Unable to authenticate to AFS because " - "%s\n", reason); - } + if (!Silent) { + fprintf(stderr, + "weblog:Unable to authenticate to AFS because " + "%s\n", reason); + } #endif - goto reply_failure; - } - else { + goto reply_failure; + } else { #ifdef DEBUG - fprintf(stderr,"WEBLOG:After ka_UserAuthenticateGeneral GroupCheck\n"); - printGroups(); + fprintf(stderr, + "WEBLOG:After ka_UserAuthenticateGeneral GroupCheck\n"); + printGroups(); #endif - /* get just the ONE token for this PAG from cache manager */ - i=0; - memcpy((void *)&tbuffer[0], (void *)&i, sizeof(afs_int32)); - code = do_pioctl(tbuffer, sizeof(afs_int32), tbuffer, sizeof(tbuffer), - VIOCGETTOK, NULL,0); - if(code) { - fprintf(stderr, "weblog: failed to get token:%d\n", code); - strcpy(reason, "FAILED TO GET TOKEN FROM CACHE MANAGER\n"); - } - else { - gotToken = 1; + /* get just the ONE token for this PAG from cache manager */ + i = 0; + memcpy((void *)&tbuffer[0], (void *)&i, sizeof(afs_int32)); + code = + do_pioctl(tbuffer, sizeof(afs_int32), tbuffer, + sizeof(tbuffer), VIOCGETTOK, NULL, 0); + if (code) { + fprintf(stderr, "weblog: failed to get token:%d\n", code); + strcpy(reason, + "FAILED TO GET TOKEN FROM CACHE MANAGER\n"); + } else { + gotToken = 1; #ifdef DEBUG - hexDump(tbuffer, sizeof(tbuffer)); - parseToken(tbuffer); + hexDump(tbuffer, sizeof(tbuffer)); + parseToken(tbuffer); #endif /* _DEBUG */ - /* put the token in local cache with the expiration date/time */ - expires = getExpiration(tbuffer); - if (expires < 0 ) { + /* put the token in local cache with the expiration date/time */ + expires = getExpiration(tbuffer); + if (expires < 0) { #ifdef DEBUG - fprintf(stderr, "Error getting expiration time\n"); + fprintf(stderr, "Error getting expiration time\n"); #endif - } - else { - weblog_login_checksum(name, cell, passwd, cksum); - if (cacheExpiration == 0) { - weblog_login_store(name, cell, cksum, &tbuffer[0],sizeof(tbuffer),expires); - } - else { - testExpires = cacheExpiration+time(NULL); - weblog_login_store(name, cell, cksum, &tbuffer[0],sizeof(tbuffer), - MIN(expires,testExpires)); + } else { + weblog_login_checksum(name, cell, passwd, cksum); + if (cacheExpiration == 0) { + weblog_login_store(name, cell, cksum, &tbuffer[0], + sizeof(tbuffer), expires); + } else { + testExpires = cacheExpiration + time(NULL); + weblog_login_store(name, cell, cksum, &tbuffer[0], + sizeof(tbuffer), MIN(expires, + testExpires)); + } + } + } } - } - } - } - } - else { - /* cache lookup succesful */ + } else { + /* cache lookup succesful */ #ifdef DEBUG - fprintf(stderr, "WEBLOG: Cache lookup succesful\n"); + fprintf(stderr, "WEBLOG: Cache lookup succesful\n"); #endif - gotToken = 1; - } + gotToken = 1; + } - /* prepare the reply buffer with this token */ - if (!gotToken) { + /* prepare the reply buffer with this token */ + if (!gotToken) { -reply_failure: - /* respond with a reason why authentication failed */ - sprintf(tbuffer,"FAILURE:%s",reason); - } + reply_failure: + /* respond with a reason why authentication failed */ + sprintf(tbuffer, "FAILURE:%s", reason); + } - /* send response to client */ - code = sendToken(sizeof(tbuffer), tbuffer); - if (code) { + /* send response to client */ + code = sendToken(sizeof(tbuffer), tbuffer); + if (code) { #ifdef DEBUG - fprintf(stderr,"sendToken FAILED\n"); + fprintf(stderr, "sendToken FAILED\n"); #endif - WEBLOGEXIT(PIPESENDERROR); - } - /* unlog after every request unconditionally */ - if (unlog()) { + WEBLOGEXIT(PIPESENDERROR); + } + /* unlog after every request unconditionally */ + if (unlog()) { #ifdef DEBUG - fprintf(stderr, "WEBLOG: UNLOG FAILED\n"); + fprintf(stderr, "WEBLOG: UNLOG FAILED\n"); #endif - } - } /* end - while */ - return 0; + } + } /* end - while */ + return 0; } diff --git a/src/afsweb/weblog_errors.h b/src/afsweb/weblog_errors.h index 1d5d4d706..07cc402c4 100644 --- a/src/afsweb/weblog_errors.h +++ b/src/afsweb/weblog_errors.h @@ -11,7 +11,7 @@ #define _WEBLOG_ERRORS_H_INCLUDED_ /* error code definitions */ -#define PIPEREAD 1 +#define PIPEREAD 1 #define PIPESEND 2 #define KA 3 #define PARSE 4 @@ -20,7 +20,7 @@ #define WEBLOGMINERROR ((10<<16)) #define PIPEREADERROR (WEBLOGMINERROR + PIPEREAD) -#define PIPESENDERROR (WEBLOGMINERROR + PIPESEND) +#define PIPESENDERROR (WEBLOGMINERROR + PIPESEND) #define KAERROR (WEBLOGMINERROR + KA) #define NULLARGSERROR (WEBLOGMINERROR + PARSE) #define PARSEERROR (WEBLOGMINERROR + NULLARGS) @@ -39,4 +39,3 @@ rx_Finalize(); \ (!code ? exit(0) : exit((code)-WEBLOGMINERROR)) #endif /* _WEBLOG_ERRORS_H_INCLUDED_ */ - diff --git a/src/audit/Makefile.in b/src/audit/Makefile.in index 864a800f5..64aebe1d5 100644 --- a/src/audit/Makefile.in +++ b/src/audit/Makefile.in @@ -12,45 +12,17 @@ # # supported (if not supported, don't show it). # ###################################################################### -DEST=@DEST@ -TOP_INCDIR=@TOP_INCDIR@ -TOP_LIBDIR=@TOP_LIBDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -libdir=@libdir@ -includedir=@includedir@ -mandir=@mandir@ -afssrvbindir=@afssrvbindir@ -afssrvsbindir=@afssrvsbindir@ -afssrvlibexecdir=@afssrvlibexecdir@ -COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et -RXGEN=${TOP_SRCDIR}/rxgen/rxgen -TOP_SRCDIR=@TOP_SRCDIR@ -SYS_NAME=@AFS_SYSNAME@ - -SHELL = /bin/sh - -include ../config/Makefile.${SYS_NAME} - -UKERNELDIR = ../libuafs - -CFLAGS=${OPTMZ} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} - -all: ukinstall ${TOP_LIBDIR}/libaudit.a ${TOP_INCDIR}/afs/audit.h +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config -# XXX-INST: where to install the AIX audit files? -install: ${DESTDIR}${libdir}/afs/libaudit.a ${DESTDIR}${includedir}/afs/audit.h - -ukinstall: ${UKERNELDIR}/afs ${UKERNELDIR}/afs/audit.h +CFLAGS=-I. -I${srcdir} ${OPTMZ} -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} ${XCFLAGS} -${UKERNELDIR}/afs: - mkdir -p ${UKERNELDIR}/afs +all: ${TOP_LIBDIR}/libaudit.a ${TOP_INCDIR}/afs/audit.h -${UKERNELDIR}/afs/audit.h: audit.h - ${INSTALL} $? $@ +# XXX-INST: where to install the AIX audit files? +install: \ + ${DESTDIR}${libdir}/afs/libaudit.a \ + ${DESTDIR}${includedir}/afs/audit.h ${DEST}/include/afs/audit.h: audit.h ${INSTALL} $? $@ @@ -64,7 +36,7 @@ libaudit.a: audit.o AFS_component_version_number.o $(RANLIB) libaudit.a audit.o: audit.c audit.h - ${CC} ${CFLAGS} -c audit.c + ${CC} ${CFLAGS} -c ${srcdir}/audit.c clean: $(RM) -f *.a *.o core AFS_component_version_number.c @@ -85,10 +57,10 @@ ${TOP_INCDIR}/afs/audit.h: audit.h dest: ${DEST}/lib/afs/libaudit.a ${DEST}/include/afs/audit.h case ${SYS_NAME} in \ rs_aix*) \ - ${INSTALL} Audit ${DEST}/root.server/usr/afs/local ; \ - ${INSTALL} objects.aix.sample ${DEST}/root.server/usr/afs/local/audit/objects.sample ; \ - ${INSTALL} events.aix.sample ${DEST}/root.server/usr/afs/local/audit/events.sample ; \ - ${INSTALL} config.aix.sample ${DEST}/root.server/usr/afs/local/audit/config.sample ;; \ + ${INSTALL} ${srcdir}/Audit ${DEST}/root.server/usr/afs/local ; \ + ${INSTALL} ${srcdir}/objects.aix.sample ${DEST}/root.server/usr/afs/local/audit/objects.sample ; \ + ${INSTALL} ${srcdir}/events.aix.sample ${DEST}/root.server/usr/afs/local/audit/events.sample ; \ + ${INSTALL} ${srcdir}/config.aix.sample ${DEST}/root.server/usr/afs/local/audit/config.sample ;; \ *) ;; \ esac ; diff --git a/src/audit/NTMakefile b/src/audit/NTMakefile index b6502e623..9855cfc2e 100644 --- a/src/audit/NTMakefile +++ b/src/audit/NTMakefile @@ -1,3 +1,4 @@ +# # Copyright 2000, International Business Machines Corporation and others. # All Rights Reserved. # @@ -5,10 +6,10 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=audit !INCLUDE ..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\config\NTMakefile.version - INCFILEDIR = $(DESTDIR)\include\afs INCFILES =\ @@ -19,7 +20,7 @@ INCFILES =\ LIBFILE = $(DESTDIR)\lib\afs\afsaudit.lib LIBOBJS =\ - audit.obj + $(OUT)\audit.obj $(LIBFILE): $(LIBOBJS) $(LIBARCH) diff --git a/src/audit/audit.c b/src/audit/audit.c index 60f9108f1..aaffb8650 100644 --- a/src/audit/audit.c +++ b/src/audit/audit.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/audit/audit.c,v 1.1.1.6 2001/09/11 14:31:18 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/audit/audit.c,v 1.8 2003/07/15 23:14:38 shadow Exp $"); #include #include @@ -29,10 +30,10 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/audit/audit.c,v 1.1.1.6 2001/09/11 14:3 #endif #include -char *bufferPtr; -int bufferLen; -int osi_audit_all = (-1); /* Not determined yet */ -int osi_echo_trail = (-1); +char *bufferPtr; +int bufferLen; +int osi_audit_all = (-1); /* Not determined yet */ +int osi_echo_trail = (-1); #ifdef AFS_AIX_ENV /** all these functions are only defined for AIX */ @@ -44,180 +45,186 @@ int osi_echo_trail = (-1); /* AIX requires a buffer filled with values to record with each audit event. * aixmakebuf creates that buffer from the variable list of values we are given. * ************************************************************************** */ -static aixmakebuf (audEvent, vaList) +static +aixmakebuf(audEvent, vaList) char *audEvent; char *vaList; { - int code; - int vaEntry; - int vaInt; - afs_int32 vaLong; - char *vaStr; - char *vaLst; - char hname[20]; - struct AFSFid *vaFid; - - vaEntry = va_arg(vaList, int); - while ( vaEntry != AUD_END ) - { - switch (vaEntry) - { - case AUD_STR : /* String */ - vaStr = (char *) va_arg(vaList, int); - if ( vaStr ) - { - strcpy (bufferPtr, vaStr); - bufferPtr += strlen(vaStr) + 1; - } - else - { - strcpy (bufferPtr, ""); - bufferPtr++; - } - break; - case AUD_INT : /* Integer */ - vaInt = va_arg(vaList, int); - *(int *)bufferPtr = vaInt; - bufferPtr += sizeof(vaInt); - break; - case AUD_DATE : /* Date */ - case AUD_HOST : /* Host ID */ - case AUD_LONG : /* long */ - vaLong = va_arg(vaList, afs_int32); - *(afs_int32 *)bufferPtr = vaLong; - bufferPtr += sizeof(vaLong); - break; - case AUD_LST : /* Ptr to another list */ - vaLst = (char *) va_arg(vaList, int); - aixmakebuf(audEvent, vaLst); - break; - case AUD_FID : /* AFSFid - contains 3 entries */ - vaFid = (struct AFSFid *) va_arg(vaList, int); - if (vaFid) { - memcpy(bufferPtr, vaFid, sizeof(struct AFSFid)); - } - else { - memset(bufferPtr, 0, sizeof(struct AFSFid)); - } - bufferPtr += sizeof(struct AFSFid); - break; - - /* Whole array of fids-- don't know how to handle variable length audit - * data with AIX audit package, so for now we just store the first fid. - * Better one than none. */ - case AUD_FIDS : - { - struct AFSCBFids *Fids; - - Fids = (struct AFSCBFids *) va_arg(vaList, int); - if (Fids && Fids->AFSCBFids_len) { - *((u_int *)bufferPtr) = Fids->AFSCBFids_len; - bufferPtr += sizeof(u_int); - memcpy(bufferPtr, Fids->AFSCBFids_val, sizeof(struct AFSFid)); - } - else { - struct AFSFid dummy; - *((u_int *)bufferPtr) = 0; - bufferPtr += sizeof(u_int); - memset(bufferPtr, 0, sizeof(struct AFSFid)); - } - bufferPtr += sizeof(struct AFSFid); - break; - } - default: + int code; + int vaEntry; + int vaInt; + afs_int32 vaLong; + char *vaStr; + char *vaLst; + char hname[20]; + struct AFSFid *vaFid; + + vaEntry = va_arg(vaList, int); + while (vaEntry != AUD_END) { + switch (vaEntry) { + case AUD_STR: /* String */ + vaStr = (char *)va_arg(vaList, int); + if (vaStr) { + strcpy(bufferPtr, vaStr); + bufferPtr += strlen(vaStr) + 1; + } else { + strcpy(bufferPtr, ""); + bufferPtr++; + } + break; + case AUD_INT: /* Integer */ + vaInt = va_arg(vaList, int); + *(int *)bufferPtr = vaInt; + bufferPtr += sizeof(vaInt); + break; + case AUD_DATE: /* Date */ + case AUD_HOST: /* Host ID */ + case AUD_LONG: /* long */ + vaLong = va_arg(vaList, afs_int32); + *(afs_int32 *) bufferPtr = vaLong; + bufferPtr += sizeof(vaLong); + break; + case AUD_LST: /* Ptr to another list */ + vaLst = (char *)va_arg(vaList, int); + aixmakebuf(audEvent, vaLst); + break; + case AUD_FID: /* AFSFid - contains 3 entries */ + vaFid = (struct AFSFid *)va_arg(vaList, int); + if (vaFid) { + memcpy(bufferPtr, vaFid, sizeof(struct AFSFid)); + } else { + memset(bufferPtr, 0, sizeof(struct AFSFid)); + } + bufferPtr += sizeof(struct AFSFid); + break; + + /* Whole array of fids-- don't know how to handle variable length audit + * data with AIX audit package, so for now we just store the first fid. + * Better one than none. */ + case AUD_FIDS: + { + struct AFSCBFids *Fids; + + Fids = (struct AFSCBFids *)va_arg(vaList, int); + if (Fids && Fids->AFSCBFids_len) { + *((u_int *) bufferPtr) = Fids->AFSCBFids_len; + bufferPtr += sizeof(u_int); + memcpy(bufferPtr, Fids->AFSCBFids_val, + sizeof(struct AFSFid)); + } else { + struct AFSFid dummy; + *((u_int *) bufferPtr) = 0; + bufferPtr += sizeof(u_int); + memset(bufferPtr, 0, sizeof(struct AFSFid)); + } + bufferPtr += sizeof(struct AFSFid); + break; + } + default: #ifdef AFS_AIX32_ENV - code = auditlog("AFS_Aud_EINVAL", (-1), audEvent, (strlen(audEvent)+1)); + code = + auditlog("AFS_Aud_EINVAL", (-1), audEvent, + (strlen(audEvent) + 1)); #endif - return; - break; - } /* end switch */ + return; + break; + } /* end switch */ - vaEntry = va_arg(vaList, int); - } /* end while */ + vaEntry = va_arg(vaList, int); + } /* end while */ } -static printbuf (audEvent, errCode, vaList) +static +printbuf(audEvent, errCode, vaList) char *audEvent; afs_int32 errCode; char *vaList; { - int vaEntry; - int vaInt; - afs_int32 vaLong; - char *vaStr; - char *vaLst; - char hname[20]; - struct AFSFid *vaFid; - struct AFSCBFids *vaFids; - - if ( osi_echo_trail < 0 ) osi_audit_check(); - if ( ! osi_echo_trail ) return; - - if ( strcmp(audEvent,"VALST") != 0 ) - printf ("%s %d ", audEvent, errCode); - - vaEntry = va_arg(vaList, int); - while ( vaEntry != AUD_END ) - { - switch (vaEntry) - { - case AUD_STR : /* String */ - vaStr = (char *) va_arg(vaList, int); - if ( vaStr ) printf("%s ", vaStr); - else printf("", vaStr); - break; - case AUD_INT : /* Integer */ - vaInt = va_arg(vaList, int); - printf("%d ", vaInt); - break; - case AUD_DATE : /* Date */ - case AUD_HOST : /* Host ID */ - vaLong = va_arg(vaList, afs_int32); - printf("%u ", vaLong); - break; - case AUD_LONG : /* afs_int32 */ - vaLong = va_arg(vaList, afs_int32); - printf("%d ", vaLong); - break; - case AUD_LST : /* Ptr to another list */ - vaLst = (char *) va_arg(vaList, int); - printbuf("VALST", 0, vaLst); - break; - case AUD_FID : /* AFSFid - contains 3 entries */ - vaFid = (struct AFSFid *) va_arg(vaList, int); - if (vaFid) printf ("%u:%u:%u ", vaFid->Volume, vaFid->Vnode, vaFid->Unique); - else printf ("%u:%u:%u ", 0, 0, 0); - break; - case AUD_FIDS : /* array of Fids */ - vaFids = (struct AFSCBFids *) va_arg(vaList, int); - vaFid = NULL; - - if (vaFids) - vaFid = vaFids->AFSCBFids_val; - if (vaFid) - printf ("%u %u:%u:%u ", vaFids->AFSCBFids_len, vaFid->Volume, - vaFid->Vnode, vaFid->Unique); - else printf ("0 0:0:0 "); - break; - default: - printf ("--badval-- "); - break; - } /* end switch */ - vaEntry = va_arg(vaList, int); - } /* end while */ + int vaEntry; + int vaInt; + afs_int32 vaLong; + char *vaStr; + char *vaLst; + char hname[20]; + struct AFSFid *vaFid; + struct AFSCBFids *vaFids; + + if (osi_echo_trail < 0) + osi_audit_check(); + if (!osi_echo_trail) + return; - if ( strcmp(audEvent,"VALST") != 0 ) - printf ("\n"); + if (strcmp(audEvent, "VALST") != 0) + printf("%s %d ", audEvent, errCode); + + vaEntry = va_arg(vaList, int); + while (vaEntry != AUD_END) { + switch (vaEntry) { + case AUD_STR: /* String */ + vaStr = (char *)va_arg(vaList, int); + if (vaStr) + printf("%s ", vaStr); + else + printf("", vaStr); + break; + case AUD_INT: /* Integer */ + vaInt = va_arg(vaList, int); + printf("%d ", vaInt); + break; + case AUD_DATE: /* Date */ + case AUD_HOST: /* Host ID */ + vaLong = va_arg(vaList, afs_int32); + printf("%u ", vaLong); + break; + case AUD_LONG: /* afs_int32 */ + vaLong = va_arg(vaList, afs_int32); + printf("%d ", vaLong); + break; + case AUD_LST: /* Ptr to another list */ + vaLst = (char *)va_arg(vaList, int); + printbuf("VALST", 0, vaLst); + break; + case AUD_FID: /* AFSFid - contains 3 entries */ + vaFid = (struct AFSFid *)va_arg(vaList, int); + if (vaFid) + printf("%u:%u:%u ", vaFid->Volume, vaFid->Vnode, + vaFid->Unique); + else + printf("%u:%u:%u ", 0, 0, 0); + break; + case AUD_FIDS: /* array of Fids */ + vaFids = (struct AFSCBFids *)va_arg(vaList, int); + vaFid = NULL; + + if (vaFids) + vaFid = vaFids->AFSCBFids_val; + if (vaFid) + printf("%u %u:%u:%u ", vaFids->AFSCBFids_len, vaFid->Volume, + vaFid->Vnode, vaFid->Unique); + else + printf("0 0:0:0 "); + break; + default: + printf("--badval-- "); + break; + } /* end switch */ + vaEntry = va_arg(vaList, int); + } /* end while */ + + if (strcmp(audEvent, "VALST") != 0) + printf("\n"); } #else -static aixmakebuf (audEvent, vaList) +static +aixmakebuf(audEvent, vaList) char *audEvent; va_list vaList; { return; } -static printbuf (audEvent, errCode, vaList) +static +printbuf(audEvent, errCode, vaList) char *audEvent; long errCode; va_list vaList; @@ -231,79 +238,80 @@ static printbuf (audEvent, errCode, vaList) /* ************************************************************************** */ /* The routine that acually does the audit call. * ************************************************************************** */ -int osi_audit (char *audEvent, /* Event name (15 chars or less) */ - afs_int32 errCode, /* The error code */ - ...) +int +osi_audit(char *audEvent, /* Event name (15 chars or less) */ + afs_int32 errCode, /* The error code */ + ...) { #ifdef AFS_AIX32_ENV - afs_int32 code; - afs_int32 err; - int result; + afs_int32 code; + afs_int32 err; + int result; - va_list vaList; - static struct Lock audbuflock = {0,0,0,0, + va_list vaList; + static struct Lock audbuflock = { 0, 0, 0, 0, #ifdef AFS_PTHREAD_ENV - PTHREAD_MUTEX_INITIALIZER, - PTHREAD_COND_INITIALIZER, - PTHREAD_COND_INITIALIZER + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_COND_INITIALIZER, + PTHREAD_COND_INITIALIZER #endif /* AFS_PTHREAD_ENV */ - }; - static char BUFFER[32768]; - - if ( osi_audit_all < 0 ) osi_audit_check(); - if ( ! osi_audit_all ) return; - - switch (errCode) - { - case 0 : - result = AUDIT_OK; - break; - case KANOAUTH : /* kautils.h */ - case RXKADNOAUTH : /* rxkad.h */ - result = AUDIT_FAIL_AUTH; - break; - case EPERM : /* errno.h */ - case EACCES : /* errno.h */ - case PRPERM : /* pterror.h */ - result = AUDIT_FAIL_ACCESS; - break; - case VL_PERM : /* vlserver.h */ - case BUDB_NOTPERMITTED : /* budb_errs.h */ + }; + static char BUFFER[32768]; + + if (osi_audit_all < 0) + osi_audit_check(); + if (!osi_audit_all) + return; + + switch (errCode) { + case 0: + result = AUDIT_OK; + break; + case KANOAUTH: /* kautils.h */ + case RXKADNOAUTH: /* rxkad.h */ + result = AUDIT_FAIL_AUTH; + break; + case EPERM: /* errno.h */ + case EACCES: /* errno.h */ + case PRPERM: /* pterror.h */ + result = AUDIT_FAIL_ACCESS; + break; + case VL_PERM: /* vlserver.h */ + case BUDB_NOTPERMITTED: /* budb_errs.h */ /* case KRB_RD_AP_UNAUTHOR : */ - case BZACCESS : /* bnode.h */ - case VOLSERBAD_ACCESS : /* volser.h */ - result = AUDIT_FAIL_PRIV; - break; + case BZACCESS: /* bnode.h */ + case VOLSERBAD_ACCESS: /* volser.h */ + result = AUDIT_FAIL_PRIV; + break; default: - result = AUDIT_FAIL; - break; - } + result = AUDIT_FAIL; + break; + } - ObtainWriteLock(&audbuflock); - bufferPtr = BUFFER; + ObtainWriteLock(&audbuflock); + bufferPtr = BUFFER; - /* Put the error code into the buffer list */ - *(int *)bufferPtr = errCode; - bufferPtr += sizeof(errCode); + /* Put the error code into the buffer list */ + *(int *)bufferPtr = errCode; + bufferPtr += sizeof(errCode); - va_start(vaList, errCode); - aixmakebuf(audEvent, vaList); + va_start(vaList, errCode); + aixmakebuf(audEvent, vaList); - va_start(vaList, errCode); - printbuf(audEvent, errCode, vaList); - - bufferLen = (int)((afs_int32)bufferPtr - (afs_int32)&BUFFER[0]); - code = auditlog (audEvent, result, BUFFER, bufferLen); + va_start(vaList, errCode); + printbuf(audEvent, errCode, vaList); + + bufferLen = (int)((afs_int32) bufferPtr - (afs_int32) & BUFFER[0]); + code = auditlog(audEvent, result, BUFFER, bufferLen); #ifdef notdef - if (code) - { - err = errno; - code = auditlog ("AFS_Aud_Fail", result, &err, sizeof(err)); - if (code) - printf("Error while writing audit entry: %d.\n", errno); - } + if (code) { + err = errno; + code = auditlog("AFS_Aud_Fail", result, &err, sizeof(err)); + if (code) + printf("Error while writing audit entry: %d.\n", errno); + } #endif /* notdef */ - ReleaseWriteLock(&audbuflock); + ReleaseWriteLock(&audbuflock); #endif } @@ -311,73 +319,65 @@ int osi_audit (char *audEvent, /* Event name (15 chars or less) */ /* Given a RPC call structure, this routine extracts the name and host id from the * call and includes it within the audit information. * ************************************************************************** */ -int osi_auditU (struct rx_call *call, - char *audEvent, - int errCode, - ...) +int +osi_auditU(struct rx_call *call, char *audEvent, int errCode, ...) { - struct rx_connection *conn; - struct rx_peer *peer; - afs_int32 secClass; - afs_int32 code; - char afsName[MAXKTCNAMELEN]; - afs_int32 hostId; - va_list vaList; - - - if ( osi_audit_all < 0 ) osi_audit_check(); - if ( !osi_audit_all ) return; - - strcpy (afsName, "--Unknown--"); - hostId = 0; - - if ( call ) - { - conn = rx_ConnectionOf(call); /* call -> conn) */ - if (conn) - { - secClass = rx_SecurityClassOf(conn); /* conn -> securityIndex */ - if (secClass == 0) /* unauthenticated */ - { - osi_audit ("AFS_Aud_Unauth", (-1), AUD_STR, audEvent, AUD_END); - strcpy (afsName, "--UnAuth--"); - } - else if (secClass == 2) /* authenticated */ - { - code = rxkad_GetServerInfo(conn, (char *)0, (char *)0, afsName, - (char *)0, (char *)0, (char *)0); - if (code) - { - osi_audit ("AFS_Aud_NoAFSId", (-1), AUD_STR, audEvent, AUD_END); - strcpy (afsName, "--NoName--"); + struct rx_connection *conn; + struct rx_peer *peer; + afs_int32 secClass; + afs_int32 code; + char afsName[MAXKTCNAMELEN]; + afs_int32 hostId; + va_list vaList; + + + if (osi_audit_all < 0) + osi_audit_check(); + if (!osi_audit_all) + return; + + strcpy(afsName, "--Unknown--"); + hostId = 0; + + if (call) { + conn = rx_ConnectionOf(call); /* call -> conn) */ + if (conn) { + secClass = rx_SecurityClassOf(conn); /* conn -> securityIndex */ + if (secClass == 0) { /* unauthenticated */ + osi_audit("AFS_Aud_Unauth", (-1), AUD_STR, audEvent, AUD_END); + strcpy(afsName, "--UnAuth--"); + } else if (secClass == 2) { /* authenticated */ + code = + rxkad_GetServerInfo(conn, NULL, NULL, afsName, NULL, NULL, + NULL); + if (code) { + osi_audit("AFS_Aud_NoAFSId", (-1), AUD_STR, audEvent, + AUD_END); + strcpy(afsName, "--NoName--"); + } + } else { /* Unauthenticated & unknown */ + + osi_audit("AFS_Aud_UnknSec", (-1), AUD_STR, audEvent, + AUD_END); + } + + peer = rx_PeerOf(conn); /* conn -> peer */ + if (peer) + hostId = rx_HostOf(peer); /* peer -> host */ + else + osi_audit("AFS_Aud_NoHost", (-1), AUD_STR, audEvent, AUD_END); + } else { /* null conn */ + + osi_audit("AFS_Aud_NoConn", (-1), AUD_STR, audEvent, AUD_END); } - } - else /* Unauthenticated & unknown */ - { - osi_audit ("AFS_Aud_UnknSec", (-1), AUD_STR, audEvent, AUD_END); - } - - peer = rx_PeerOf(conn); /* conn -> peer */ - if ( peer ) - hostId = rx_HostOf(peer); /* peer -> host */ - else - osi_audit ("AFS_Aud_NoHost", (-1), AUD_STR, audEvent, AUD_END); - } - else /* null conn */ - { - osi_audit ("AFS_Aud_NoConn", (-1), AUD_STR, audEvent, AUD_END); + } else { /* null call */ + + osi_audit("AFS_Aud_NoCall", (-1), AUD_STR, audEvent, AUD_END); } - } - else /* null call */ - { - osi_audit ("AFS_Aud_NoCall", (-1), AUD_STR, audEvent, AUD_END); - } - - va_start(vaList, errCode); - osi_audit (audEvent, errCode, AUD_STR, afsName, - AUD_HOST, hostId, - AUD_LST, vaList, - AUD_END); + + va_start(vaList, errCode); + osi_audit(audEvent, errCode, AUD_STR, afsName, AUD_HOST, hostId, AUD_LST, + vaList, AUD_END); } /* ************************************************************************** */ @@ -386,47 +386,53 @@ int osi_auditU (struct rx_call *call, * enabled. * ************************************************************************** */ -int osi_audit_check () +int +osi_audit_check() { - FILE *fds; - int onoff; - char event[257]; - - osi_audit_all = 1; /* say we made check (>= 0) */ - /* and assume audit all events (for now) */ - onoff = 0; /* assume we will turn auditing off */ - osi_echo_trail = 0; /* assume no echoing */ - - fds = fopen(AFSDIR_SERVER_AUDIT_FILEPATH, "r"); - if (fds) - { - while ( fscanf(fds, "%256s", event) > 0) - { - if ( strcmp(event,"AFS_AUDIT_AllEvents") == 0 ) - onoff = 1; - - if ( strcmp(event,"Echo_Trail") == 0 ) - osi_echo_trail = 1; - } - fclose(fds); - } - - /* Audit this event all of the time */ - if (onoff) osi_audit("AFS_Aud_On", 0, AUD_END); - else osi_audit("AFS_Aud_Off", 0, AUD_END); - - /* Now set whether we audit all events from here on out */ - osi_audit_all = onoff; + FILE *fds; + int onoff; + char event[257]; + + osi_audit_all = 1; /* say we made check (>= 0) */ + /* and assume audit all events (for now) */ + onoff = 0; /* assume we will turn auditing off */ + osi_echo_trail = 0; /* assume no echoing */ + + fds = fopen(AFSDIR_SERVER_AUDIT_FILEPATH, "r"); + if (fds) { + while (fscanf(fds, "%256s", event) > 0) { + if (strcmp(event, "AFS_AUDIT_AllEvents") == 0) + onoff = 1; + + if (strcmp(event, "Echo_Trail") == 0) + osi_echo_trail = 1; + } + fclose(fds); + } + + /* Audit this event all of the time */ + if (onoff) + osi_audit("AFS_Aud_On", 0, AUD_END); + else + osi_audit("AFS_Aud_Off", 0, AUD_END); + + /* Now set whether we audit all events from here on out */ + osi_audit_all = onoff; } #else /* ! AFS_AIX_ENV */ -int osi_audit (char *audEvent, afs_int32 errCode, ...) -{ return 0; } +int +osi_audit(char *audEvent, afs_int32 errCode, ...) +{ + return 0; +} -int osi_auditU (struct rx_call *call, char *audEvent, int errCode, ...) -{ return 0; } +int +osi_auditU(struct rx_call *call, char *audEvent, int errCode, ...) +{ + return 0; +} #endif - diff --git a/src/audit/audit.h b/src/audit/audit.h index fe6bb2f24..664b62884 100644 --- a/src/audit/audit.h +++ b/src/audit/audit.h @@ -7,19 +7,19 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#define AUD_END 0 /* End of veriable list */ -#define AUD_STR 1 /* String in variable list */ -#define AUD_INT 2 /* int in variable list */ -#define AUD_LST 3 /* Variable list in a variable list */ -#define AUD_HOST 4 /* A host # to be changed to string */ -#define AUD_LONG 5 /* long in variable list */ -#define AUD_DATE 6 /* date (unsigned long) */ -#define AUD_FID 7 /* File ID */ -#define AUD_FIDS 8 /* array of Fids */ +#define AUD_END 0 /* End of veriable list */ +#define AUD_STR 1 /* String in variable list */ +#define AUD_INT 2 /* int in variable list */ +#define AUD_LST 3 /* Variable list in a variable list */ +#define AUD_HOST 4 /* A host # to be changed to string */ +#define AUD_LONG 5 /* long in variable list */ +#define AUD_DATE 6 /* date (unsigned long) */ +#define AUD_FID 7 /* File ID */ +#define AUD_FIDS 8 /* array of Fids */ /* next 3 lines on behalf of MR-AFS */ -#define AUD_RESID 20 /* resid in variable list */ -#define AUD_RSSIZERANGE 21 /* rssizerange in variable list */ -#define AUD_LOOKUPINFO 22 /* LookupInfo in variable list */ +#define AUD_RESID 20 /* resid in variable list */ +#define AUD_RSSIZERANGE 21 /* rssizerange in variable list */ +#define AUD_LOOKUPINFO 22 /* LookupInfo in variable list */ /* * Note: the master definitions of these error codes come from *.et @@ -27,13 +27,13 @@ * simple way to avoid circular dependence problems in the build. */ -#define KANOAUTH (180488L) /* kauth/kaerrors.et */ -#define RXKADNOAUTH (19270405L) /* rxkad/rxkad_errs.et */ -#define PRPERM (267269L) /* ptserver/pterror.et */ -#define VL_PERM (363546L) /* vlserver/vl_errors.et */ -#define BUDB_NOTPERMITTED (156303880L) /* budb/budb_errs.et */ -#define BZACCESS (39430L) /* bozo/boserr.et */ -#define VOLSERBAD_ACCESS (1492325127L) /* volser/volerr.et */ +#define KANOAUTH (180488L) /* kauth/kaerrors.et */ +#define RXKADNOAUTH (19270405L) /* rxkad/rxkad_errs.et */ +#define PRPERM (267269L) /* ptserver/pterror.et */ +#define VL_PERM (363546L) /* vlserver/vl_errors.et */ +#define BUDB_NOTPERMITTED (156303880L) /* budb/budb_errs.et */ +#define BZACCESS (39430L) /* bozo/boserr.et */ +#define VOLSERBAD_ACCESS (1492325127L) /* volser/volerr.et */ #define VS_StartEvent "AFS_VS_Start" @@ -281,6 +281,5 @@ /* prototypes for audit functions */ -int osi_audit (char *audEvent, afs_int32 errCode, ...); -int osi_auditU (struct rx_call *call, char *audEvent, int errCode, ...); - +int osi_audit(char *audEvent, afs_int32 errCode, ...); +int osi_auditU(struct rx_call *call, char *audEvent, int errCode, ...); diff --git a/src/auth/Makefile.in b/src/auth/Makefile.in index 3a1416318..f768f1b77 100644 --- a/src/auth/Makefile.in +++ b/src/auth/Makefile.in @@ -5,37 +5,14 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html -DEST=@DEST@ -TOP_INCDIR=@TOP_INCDIR@ -TOP_LIBDIR=@TOP_LIBDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -libdir=@libdir@ -includedir=@includedir@ -mandir=@mandir@ -afssrvbindir=@afssrvbindir@ -afssrvsbindir=@afssrvsbindir@ -afssrvlibexecdir=@afssrvlibexecdir@ -RXGEN=${TOP_SRCDIR}/rxgen/rxgen -TOP_SRCDIR=@TOP_SRCDIR@ -SYS_NAME=@AFS_SYSNAME@ - -SHELL = /bin/sh - -include ../config/Makefile.${SYS_NAME} - -KERNELDIR = ../libafs -UKERNELDIR = ../libuafs -COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config + OBJS= cellconfig.o ktc.o userok.o writeconfig.o authcon.o \ acfg_errors.o ktc_errors.o KOBJS= cellconfig.o ktc.krb.o userok.o writeconfig.o authcon.o \ acfg_errors.o ktc_errors.o -CFLAGS=${DBG} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} LIBS=libauth.a ${TOP_LIBDIR}/libsys.a \ ${TOP_LIBDIR}/librxkad.a ${TOP_LIBDIR}/libdes.a \ ${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/libsys.a \ @@ -45,7 +22,9 @@ KSRCS=auth.h UKSRCS=${KSRCS} cellconfig.h acfg_errors.c keys.h cellconfig.c \ ktc.c authcon.c ktc_errors.c -all: kinstall ukinstall ${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/libauth.krb.a ${TOP_INCDIR}/afs/keys.h ${TOP_INCDIR}/afs/cellconfig.h ${TOP_INCDIR}/afs/auth.h copyauth setkey +all: ${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/libauth.krb.a depinstall copyauth setkey + +depinstall: ${TOP_INCDIR}/afs/keys.h ${TOP_INCDIR}/afs/cellconfig.h ${TOP_INCDIR}/afs/auth.h cellconfig.o: cellconfig.c ${INCLS} ktc.o: ktc.c ${INCLS} ${TOP_INCDIR}/afs/vice.h @@ -57,7 +36,7 @@ copyauth.o: copyauth.c ${INCLS} AFS_component_version_number.o setkey.o: setkey.c ${INCLS} AFS_component_version_number.o ktc.krb.o: ktc.c ${INCLS} ${TOP_INCDIR}/afs/vice.h - ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ktc.c -o ktc.krb.o + ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/ktc.c -o ktc.krb.o libauth.a: $(OBJS) AFS_component_version_number.o -$(RM) -f libauth.a @@ -69,64 +48,27 @@ libauth.krb.a: $(KOBJS) AFS_component_version_number.o $(AR) crv $@ $(KOBJS) AFS_component_version_number.o $(RANLIB) $@ -copyauth: copyauth.o +copyauth: copyauth.o ${LIBS} $(CC) $(CFLAGS) -o copyauth copyauth.o ${LIBS} ${XLIBS} -setkey: setkey.o +setkey: setkey.o ${LIBS} ${CC} $(CFLAGS) -o setkey setkey.o ${LIBS} ${XLIBS} acfg_errors.o: acfg_errors.c acfg_errors.c cellconfig.h: acfg_errors.et cellconfig.p.h - $(RM) -f cellconfig.h acfg_errors.c; ${COMPILE_ET} acfg_errors -h cellconfig + $(RM) -f cellconfig.h acfg_errors.c + ${COMPILE_ET} -p ${srcdir} acfg_errors -h cellconfig ktc_errors.o: ktc_errors.c ktc_errors.c auth.h: ktc_errors.et auth.p.h - $(RM) -f auth.h ktc_errors.c; ${COMPILE_ET} ktc_errors -h auth + $(RM) -f auth.h ktc_errors.c + ${COMPILE_ET} -p ${srcdir} ktc_errors -h auth # # Install targets # -kinstall: ${KERNELDIR}/afs/auth.h - -${KERNELDIR}/afs/auth.h: auth.h - ${INSTALL} $? $@ - -ukinstall: \ - ${UKERNELDIR}/afs/auth.h \ - ${UKERNELDIR}/afs/cellconfig.h \ - ${UKERNELDIR}/afs/acfg_errors.c \ - ${UKERNELDIR}/afs/keys.h \ - ${UKERNELDIR}/afs/cellconfig.c \ - ${UKERNELDIR}/afs/ktc.c \ - ${UKERNELDIR}/afs/authcon.c \ - ${UKERNELDIR}/afs/ktc_errors.c - -${UKERNELDIR}/afs/auth.h: auth.h - ${INSTALL} $? $@ - -${UKERNELDIR}/afs/cellconfig.h: cellconfig.h - ${INSTALL} $? $@ - -${UKERNELDIR}/afs/cellconfig.c: cellconfig.c - ${INSTALL} $? $@ - -${UKERNELDIR}/afs/acfg_errors.c: acfg_errors.c - ${INSTALL} $? $@ - -${UKERNELDIR}/afs/keys.h: keys.h - ${INSTALL} $? $@ - -${UKERNELDIR}/afs/ktc.c: ktc.c - ${INSTALL} $? $@ - -${UKERNELDIR}/afs/authcon.c: authcon.c - ${INSTALL} $? $@ - -${UKERNELDIR}/afs/ktc_errors.c: ktc_errors.c - ${INSTALL} $? $@ - install: ${DESTDIR}${libdir}/afs/libauth.a ${DESTDIR}${libdir}/afs/libauth.krb.a ${DESTDIR}${includedir}/afs/keys.h ${DESTDIR}${includedir}/afs/cellconfig.h ${DESTDIR}${includedir}/afs/auth.h ${DESTDIR}${sbindir}/copyauth ${DEST}/lib/afs/libauth.a: libauth.a diff --git a/src/auth/NTMakefile b/src/auth/NTMakefile index 5ff836ac2..0a3d3a00f 100644 --- a/src/auth/NTMakefile +++ b/src/auth/NTMakefile @@ -5,10 +5,10 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=auth !INCLUDE ..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\config\NTMakefile.version - INCFILEDIR = $(DESTDIR)\include\afs # header file install directory INCFILES =\ @@ -25,17 +25,22 @@ AFSAUTH_LIBFILE = $(DESTDIR)\lib\afs\afsauth.lib AFSD = ..\WINNT\afsd AFSAUTH_LIBOBJS =\ - cellconfig.obj \ - userok.obj \ - writeconfig.obj \ - authcon.obj \ - acfg_errors.obj \ - ktc_errors.obj \ - ktc_nt.obj \ - $(AFSD)\afsrpc_c.obj \ - AFS_component_version_number.obj - -$(AFSAUTH_LIBFILE): $(AFSAUTH_LIBOBJS) + $(OUT)\cellconfig.obj \ + $(OUT)\userok.obj \ + $(OUT)\writeconfig.obj \ + $(OUT)\authcon.obj \ + $(OUT)\acfg_errors.obj \ + $(OUT)\ktc_errors.obj \ + $(OUT)\ktc_nt.obj \ + $(OUT)\AFS_component_version_number.obj + +AFSDOBJS =\ + $(OUT)\$(AFSD)\afsrpc_c.obj + +$(AFSDOBJS): $(AFSD)\$$(@B).c + $(C2OBJ) -I$*(*D) $** + +$(AFSAUTH_LIBFILE): $(AFSAUTH_LIBOBJS) $(AFSDOBJS) $(LIBARCH) rpcrt4.lib ############################################################################ @@ -44,14 +49,14 @@ $(AFSAUTH_LIBFILE): $(AFSAUTH_LIBOBJS) AFSAUTH_KRB_LIBFILE = $(DESTDIR)\lib\afs\afsauth.krb.lib AFSAUTH_KRB_LIBOBJS =\ - cellconfig.obj \ - userok.obj \ - writeconfig.obj \ - authcon.obj \ - acfg_errors.obj \ - ktc_errors.obj \ - ktc_nt.obj \ - AFS_component_version_number.obj + $(OUT)\cellconfig.obj \ + $(OUT)\userok.obj \ + $(OUT)\writeconfig.obj \ + $(OUT)\authcon.obj \ + $(OUT)\acfg_errors.obj \ + $(OUT)\ktc_errors.obj \ + $(OUT)\ktc_nt.obj \ + $(OUT)\AFS_component_version_number.obj $(AFSAUTH_KRB_LIBFILE): $(AFSAUTH_KRB_LIBOBJS) $(LIBARCH) rpcrt4.lib @@ -59,23 +64,23 @@ $(AFSAUTH_KRB_LIBFILE): $(AFSAUTH_KRB_LIBOBJS) ############################################################################ # build setkey -SETKEY_EXEFILE = setkey.exe +SETKEY_EXEFILE = $(OUT)\setkey.exe SETKEY_EXEOBJS =\ - setkey.obj + $(OUT)\setkey.obj EXELIBDIR = $(DESTDIR)\lib EXELIBS =\ $(EXELIBDIR)\afs\afsauth.lib \ - $(DESTDIR)\lib\afsrxkad.lib \ - $(DESTDIR)\lib\afsdes.lib \ + $(EXELIBDIR)\afsrxkad.lib \ + $(EXELIBDIR)\afsdes.lib \ $(EXELIBDIR)\afsrx.lib \ $(EXELIBDIR)\afslwp.lib \ $(EXELIBDIR)\afs\afsutil.lib \ - $(DESTDIR)\lib\afs\afseventlog.lib \ + $(EXELIBDIR)\afs\afseventlog.lib \ $(EXELIBDIR)\afs\afsreg.lib \ - $(DESTDIR)\lib\cm_dns.obj + $(EXELIBDIR)\cm_dns.obj $(SETKEY_EXEFILE): $(SETKEY_EXEOBJS) $(EXELIBS) @@ -86,30 +91,33 @@ $(SETKEY_EXEFILE): $(SETKEY_EXEOBJS) $(EXELIBS) COPYAUTH_EXEFILE = $(DESTDIR)\etc\copyauth.exe COPYAUTH_EXEOBJS =\ - copyauth.obj + $(OUT)\copyauth.obj $(COPYAUTH_EXEFILE): $(COPYAUTH_EXEOBJS) $(EXELIBS) $(EXECONLINK) $(EXEPREP) -acfg_errors.c $(INCFILEDIR)\cellconfig.h : acfg_errors.et cellconfig.p.h - $(DEL) $(INCFILEDIR)\cellconfig.h acfg_errors.c +$(INCFILES):$$(@F) + $(COPY) $** $(INCFILEDIR)\. + +acfg_errors.c cellconfig.h : acfg_errors.et cellconfig.p.h + $(DEL) cellconfig.h acfg_errors.c $(COMPILE_ET) acfg_errors.et -h cellconfig - $(COPY) cellconfig.h $(INCFILEDIR)\cellconfig.h -ktc_errors.c $(INCFILEDIR)\auth.h: ktc_errors.et auth.p.h +ktc_errors.c auth.h: ktc_errors.et auth.p.h $(DEL) auth.h ktc_errors.c $(COMPILE_ET) ktc_errors.et -h auth - $(COPY) auth.h $(INCFILEDIR)\auth.h -install: $(INCFILES) $(AFSAUTH_LIBFILE) setkey.exe # $(COPYAUTH_EXEFILE) $(AFSAUTH_KRB_LIBFILE) +install: $(INCFILES) $(AFSAUTH_LIBFILE) $(OUT)\setkey.exe # $(COPYAUTH_EXEFILE) $(AFSAUTH_KRB_LIBFILE) install9x: install clean:: $(DEL) acfg_errors.c ktc_errors.c - $(DEL) $(INCFILEDIR)\auth.h $(INCFILEDIR)\cellconfig.h + $(DEL) $(INCFILES) $(AFSAUTH_LIBFILE) $(DEL) auth.h cellconfig.h setkey: $(SETKEY_EXEFILE) +mkdir: + diff --git a/src/auth/auth.p.h b/src/auth/auth.p.h index 96a10f22a..0a9d93257 100644 --- a/src/auth/auth.p.h +++ b/src/auth/auth.p.h @@ -10,7 +10,7 @@ #ifndef __AUTH_AFS_INCL_ #define __AUTH_AFS_INCL_ 1 -#include /* to get ticket parameters/contents */ +#include /* to get ticket parameters/contents */ /* super-user pincipal used by servers when talking to other servers */ #define AUTH_SUPERUSER "afs" @@ -19,35 +19,22 @@ struct ktc_token { afs_int32 startTime; afs_int32 endTime; struct ktc_encryptionKey sessionKey; - short kvno; /* XXX UNALIGNED */ + short kvno; /* XXX UNALIGNED */ int ticketLen; char ticket[MAXKTCTICKETLEN]; }; #ifdef AFS_NT40_ENV -extern int ktc_SetToken( - struct ktc_principal *server, - struct ktc_token *token, - struct ktc_principal *client, - afs_int32 flags -); - -extern int ktc_GetToken( - struct ktc_principal *server, - struct ktc_token *token, - int tokenLen, - struct ktc_principal *client -); - -extern int ktc_ListTokens( - int cellNum, - int *cellNumP, - struct ktc_principal *serverName -); - -extern int ktc_ForgetToken( - struct ktc_principal *server -); +extern int ktc_SetToken(struct ktc_principal *server, struct ktc_token *token, + struct ktc_principal *client, afs_int32 flags); + +extern int ktc_GetToken(struct ktc_principal *server, struct ktc_token *token, + int tokenLen, struct ktc_principal *client); + +extern int ktc_ListTokens(int cellNum, int *cellNumP, + struct ktc_principal *serverName); + +extern int ktc_ForgetToken(struct ktc_principal *server); extern int ktc_ForgetAllTokens(void); diff --git a/src/auth/authcon.c b/src/auth/authcon.c index 8ac1bb506..06918e74e 100644 --- a/src/auth/authcon.c +++ b/src/auth/authcon.c @@ -9,25 +9,26 @@ #include #if defined(UKERNEL) -#include "../afs/param.h" +#include "afs/param.h" #else #include #endif -RCSID("$Header: /tmp/cvstemp/openafs/src/auth/authcon.c,v 1.1.1.7 2001/10/14 18:04:00 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/auth/authcon.c,v 1.13 2003/07/15 23:14:41 shadow Exp $"); #if defined(UKERNEL) -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/stds.h" -#include "../afs/pthread_glock.h" -#include "../des/des.h" -#include "../rx/rxkad.h" -#include "../rx/rx.h" -#include "../afs/cellconfig.h" -#include "../afs/keys.h" -#include "../afs/auth.h" -#include "../afs/pthread_glock.h" +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/stds.h" +#include "afs/pthread_glock.h" +#include "des/des.h" +#include "rx/rxkad.h" +#include "rx/rx.h" +#include "afs/cellconfig.h" +#include "afs/keys.h" +#include "afs/auth.h" +#include "afs/pthread_glock.h" #else /* defined(UKERNEL) */ #include #include @@ -48,18 +49,14 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/authcon.c,v 1.1.1.7 2001/10/14 18: #include "auth.h" #endif /* defined(UKERNEL) */ - -extern afs_int32 afsconf_Authenticate(); -extern int afsconf_GetKey(); -extern struct rx_securityClass *rxkad_NewServerSecurityObject(); -extern struct rx_securityClass *rxkad_NewClientSecurityObject(); - /* return a null security object if nothing else can be done */ -static afs_int32 QuickAuth(astr, aindex) -struct rx_securityClass **astr; -afs_int32 *aindex; { +static afs_int32 +QuickAuth(astr, aindex) + struct rx_securityClass **astr; + afs_int32 *aindex; +{ register struct rx_securityClass *tc; - tc = (struct rx_securityClass *) rxnull_NewClientSecurityObject(); + tc = rxnull_NewClientSecurityObject(); *astr = tc; *aindex = 0; return 0; @@ -67,60 +64,62 @@ afs_int32 *aindex; { #if !defined(UKERNEL) /* Return an appropriate security class and index */ -afs_int32 afsconf_ServerAuth(adir, astr, aindex) -register struct afsconf_dir *adir; -struct rx_securityClass **astr; -afs_int32 *aindex; { +afs_int32 +afsconf_ServerAuth(adir, astr, aindex) + register struct afsconf_dir *adir; + struct rx_securityClass **astr; + afs_int32 *aindex; +{ register struct rx_securityClass *tclass; - - LOCK_GLOBAL_MUTEX - tclass = (struct rx_securityClass *) - rxkad_NewServerSecurityObject(0, adir, afsconf_GetKey, (char *) 0); + + LOCK_GLOBAL_MUTEX tclass = (struct rx_securityClass *) + rxkad_NewServerSecurityObject(0, adir, afsconf_GetKey, NULL); if (tclass) { *astr = tclass; - *aindex = 2; /* kerberos security index */ - UNLOCK_GLOBAL_MUTEX - return 0; - } - else { - UNLOCK_GLOBAL_MUTEX - return 2; + *aindex = 2; /* kerberos security index */ + UNLOCK_GLOBAL_MUTEX return 0; + } else { + UNLOCK_GLOBAL_MUTEX return 2; } } #endif /* !defined(UKERNEL) */ -static afs_int32 GenericAuth(adir, astr, aindex, enclevel) -struct afsconf_dir *adir; -struct rx_securityClass **astr; -afs_int32 *aindex; -rxkad_level enclevel; { +static afs_int32 +GenericAuth(adir, astr, aindex, enclevel) + struct afsconf_dir *adir; + struct rx_securityClass **astr; + afs_int32 *aindex; + rxkad_level enclevel; +{ char tbuffer[256]; struct ktc_encryptionKey key, session; struct rx_securityClass *tclass; afs_int32 kvno; afs_int32 ticketLen; register afs_int32 code; - + /* first, find the right key and kvno to use */ code = afsconf_GetLatestKey(adir, &kvno, &key); if (code) { return QuickAuth(astr, aindex); } - + /* next create random session key, using key for seed to good random */ - des_init_random_number_generator (&key); - code = des_random_key (&session); + des_init_random_number_generator(&key); + code = des_random_key(&session); if (code) { return QuickAuth(astr, aindex); } - + /* now create the actual ticket */ ticketLen = sizeof(tbuffer); - code = tkt_MakeTicket(tbuffer, &ticketLen, &key, AUTH_SUPERUSER, "", "", 0, - 0xffffffff, &session, 0, "afs", ""); + memset(tbuffer, '\0', sizeof(tbuffer)); + code = + tkt_MakeTicket(tbuffer, &ticketLen, &key, AUTH_SUPERUSER, "", "", 0, + 0xffffffff, &session, 0, "afs", ""); /* parms were buffer, ticketlen, key to seal ticket with, principal - name, instance and cell, start time, end time, session key to seal - in ticket, inet host, server name and server instance */ + * name, instance and cell, start time, end time, session key to seal + * in ticket, inet host, server name and server instance */ if (code) { return QuickAuth(astr, aindex); } @@ -130,41 +129,38 @@ rxkad_level enclevel; { * order when compiling the system from scratch (rx/rxkad.h isn't installed * yet). */ tclass = (struct rx_securityClass *) - rxkad_NewClientSecurityObject(enclevel, &session, kvno, - ticketLen, tbuffer); + rxkad_NewClientSecurityObject(enclevel, &session, kvno, ticketLen, + tbuffer); *astr = tclass; - *aindex = 2; /* kerberos security index */ + *aindex = 2; /* kerberos security index */ return 0; } /* build a fake ticket for 'afs' using keys from adir, returning an * appropriate security class and index */ -afs_int32 afsconf_ClientAuth(adir, astr, aindex) -struct afsconf_dir *adir; -struct rx_securityClass **astr; -afs_int32 *aindex; { +afs_int32 +afsconf_ClientAuth(struct afsconf_dir * adir, struct rx_securityClass ** astr, + afs_int32 * aindex) +{ afs_int32 rc; - LOCK_GLOBAL_MUTEX - rc = GenericAuth(adir, astr, aindex, rxkad_clear); - UNLOCK_GLOBAL_MUTEX - return rc; + LOCK_GLOBAL_MUTEX rc = GenericAuth(adir, astr, aindex, rxkad_clear); + UNLOCK_GLOBAL_MUTEX return rc; } /* build a fake ticket for 'afs' using keys from adir, returning an * appropriate security class and index. This one, unlike the above, * tells rxkad to encrypt the data, too. */ -afs_int32 afsconf_ClientAuthSecure(adir, astr, aindex) -struct afsconf_dir *adir; -struct rx_securityClass **astr; -afs_int32 *aindex; { +afs_int32 +afsconf_ClientAuthSecure(adir, astr, aindex) + struct afsconf_dir *adir; + struct rx_securityClass **astr; + afs_int32 *aindex; +{ afs_int32 rc; - LOCK_GLOBAL_MUTEX - rc = GenericAuth(adir, astr, aindex, rxkad_crypt); - UNLOCK_GLOBAL_MUTEX - return rc; + LOCK_GLOBAL_MUTEX rc = GenericAuth(adir, astr, aindex, rxkad_crypt); + UNLOCK_GLOBAL_MUTEX return rc; } - diff --git a/src/auth/cellconfig.c b/src/auth/cellconfig.c index 2846af180..ed74a815c 100644 --- a/src/auth/cellconfig.c +++ b/src/auth/cellconfig.c @@ -10,13 +10,14 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.14 2003/07/30 17:11:21 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/auth/cellconfig.c,v 1.36 2004/03/10 07:38:17 shadow Exp $"); #include #include #ifdef UKERNEL -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" +#include "afs/sysincludes.h" +#include "afsincludes.h" #else /* UKERNEL */ #include #ifdef AFS_NT40_ENV @@ -35,6 +36,9 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.14 2003/07/30 #include #ifdef AFS_AFSDB_ENV #include +#ifdef HAVE_ARPA_NAMESER_COMPAT_H +#include +#endif #include #endif /* AFS_AFSDB_ENV */ #endif /* AFS_NT40_ENV */ @@ -61,31 +65,45 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.14 2003/07/30 #include "cellconfig.h" #include "keys.h" -#ifndef T_AFSDB -#define T_AFSDB 18 /* per RFC1183 section 1 */ +static struct afsconf_servPair serviceTable[] = { + {"afs", 7000,}, + {"afscb", 7001,}, + {"afsprot", 7002,}, + {"afsvldb", 7003,}, + {"afskauth", 7004,}, + {"afsvol", 7005,}, + {"afserror", 7006,}, + {"afsnanny", 7007,}, + {"afsupdate", 7008,}, + {"afsrmtsys", 7009,}, + {"afsres", 7010,}, /* residency database for MR-AFS */ + {"afsremio", 7011,}, /* remote I/O interface for MR-AFS */ + {0, 0} /* insert new services before this spot */ +}; + +/* Prototypes */ +static afs_int32 afsconf_FindService(register const char *aname); +static int TrimLine(char *abuffer); +#ifdef AFS_NT40_ENV +static int IsClientConfigDirectory(const char *path); +static int GetCellNT(struct afsconf_dir *adir); #endif +static int afsconf_Check(register struct afsconf_dir *adir); +static int afsconf_Touch(register struct afsconf_dir *adir); +static int GetCellUnix(struct afsconf_dir *adir); +static int afsconf_OpenInternal(register struct afsconf_dir *adir, char *cell, + char clones[]); +static int ParseHostLine(char *aline, register struct sockaddr_in *addr, + char *aname, char *aclone); +static int ParseCellLine(register char *aline, register char *aname, + register char *alname); +static int afsconf_CloseInternal(register struct afsconf_dir *adir); +static int afsconf_Reopen(register struct afsconf_dir *adir); +static int SaveKeys(struct afsconf_dir *adir); -static ParseHostLine(); -static ParseCellLine(); -static afsconf_OpenInternal(); -static afsconf_CloseInternal(); -static afsconf_Reopen(); - -static struct afsconf_servPair serviceTable [] = { - { "afs", 7000, }, - { "afscb", 7001, }, - { "afsprot", 7002, }, - { "afsvldb", 7003, }, - { "afskauth", 7004, }, - { "afsvol", 7005, }, - { "afserror", 7006, }, - { "afsnanny", 7007, }, - { "afsupdate", 7008, }, - { "afsrmtsys", 7009, }, - { "afsres", 7010, }, /* residency database for MR-AFS */ - { "afsremio", 7011, }, /* remote I/O interface for MR-AFS */ - { 0, 0 } /* insert new services before this spot */ -}; +#ifndef T_AFSDB +#define T_AFSDB 18 /* per RFC1183 section 1 */ +#endif /* * Basic Rule: we touch "/CellServDB" every time we change anything, so @@ -95,8 +113,9 @@ static struct afsconf_servPair serviceTable [] = { */ /* return port number in network byte order in the low 16 bits of a long; return -1 if not found */ -static afs_int32 afsconf_FindService(aname) -register char *aname; { +static afs_int32 +afsconf_FindService(register const char *aname) +{ /* lookup a service name */ struct servent *ts; register struct afsconf_servPair *tsp; @@ -104,29 +123,33 @@ register char *aname; { #if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) ts = getservbyname(aname, ""); #else - ts = getservbyname(aname, (char *) 0); + ts = getservbyname(aname, NULL); #endif if (ts) { /* we found it in /etc/services, so we use this value */ - return ts->s_port; /* already in network byte order */ + return ts->s_port; /* already in network byte order */ } /* not found in /etc/services, see if it is one of ours */ - for(tsp = serviceTable;; tsp++) { - if (tsp->name == (char *) 0) return -1; - if (!strcmp(tsp->name, aname)) return htons(tsp->port); + for (tsp = serviceTable;; tsp++) { + if (tsp->name == NULL) + return -1; + if (!strcmp(tsp->name, aname)) + return htons(tsp->port); } } -static int TrimLine(abuffer) -char *abuffer; { +static int +TrimLine(char *abuffer) +{ char tbuffer[256]; register char *tp; register int tc; tp = abuffer; while ((tc = *tp)) { - if (!isspace(tc)) break; + if (!isspace(tc)) + break; tp++; } strcpy(tbuffer, tp); @@ -139,7 +162,8 @@ char *abuffer; { * IsClientConfigDirectory() -- determine if path matches well-known * client configuration directory. */ -static int IsClientConfigDirectory(const char *path) +static int +IsClientConfigDirectory(const char *path) { const char *cdir = AFSDIR_CLIENT_ETC_DIRPATH; int i; @@ -175,8 +199,9 @@ static int IsClientConfigDirectory(const char *path) #endif /* AFS_NT40_ENV */ -static int afsconf_Check(adir) -register struct afsconf_dir *adir; { +static int +afsconf_Check(register struct afsconf_dir *adir) +{ char tbuffer[256]; struct stat tstat; register afs_int32 code; @@ -184,11 +209,11 @@ register struct afsconf_dir *adir; { #ifdef AFS_NT40_ENV /* NT client CellServDB has different file name than NT server or Unix */ if (IsClientConfigDirectory(adir->name)) { - strcompose(tbuffer, 256, - adir->name, "/", AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL); + strcompose(tbuffer, 256, adir->name, "/", + AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL); } else { - strcompose(tbuffer, 256, - adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL); + strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, + NULL); } #else strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL); @@ -207,24 +232,25 @@ register struct afsconf_dir *adir; { } /* set modtime on file */ -static afsconf_Touch(adir) -register struct afsconf_dir *adir; { +static int +afsconf_Touch(register struct afsconf_dir *adir) +{ char tbuffer[256]; #ifndef AFS_NT40_ENV struct timeval tvp[2]; #endif - adir->timeRead = 0; /* just in case */ + adir->timeRead = 0; /* just in case */ #ifdef AFS_NT40_ENV /* NT client CellServDB has different file name than NT server or Unix */ if (IsClientConfigDirectory(adir->name)) { - strcompose(tbuffer, 256, - adir->name, "/", AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL); + strcompose(tbuffer, 256, adir->name, "/", + AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL); } else { - strcompose(tbuffer, 256, - adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL); + strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, + NULL); } return _utime(tbuffer, NULL); @@ -234,24 +260,25 @@ register struct afsconf_dir *adir; { gettimeofday(&tvp[0], NULL); tvp[1] = tvp[0]; return utimes(tbuffer, tvp); -#endif /* AFS_NT40_ENV */ +#endif /* AFS_NT40_ENV */ } -struct afsconf_dir *afsconf_Open(adir) -register char *adir; { +struct afsconf_dir * +afsconf_Open(register const char *adir) +{ register struct afsconf_dir *tdir; register afs_int32 code; LOCK_GLOBAL_MUTEX - /* zero structure and fill in name; rest is done by internal routine */ - tdir = (struct afsconf_dir *) malloc(sizeof(struct afsconf_dir)); + /* zero structure and fill in name; rest is done by internal routine */ + tdir = (struct afsconf_dir *)malloc(sizeof(struct afsconf_dir)); memset(tdir, 0, sizeof(struct afsconf_dir)); - tdir->name = (char *) malloc(strlen(adir)+1); + tdir->name = (char *)malloc(strlen(adir) + 1); strcpy(tdir->name, adir); code = afsconf_OpenInternal(tdir, 0, 0); if (code) { - char *afsconf_path, *getenv(), afs_confdir[128]; + char *afsconf_path, afs_confdir[128]; free(tdir->name); /* Check global place only when local Open failed for whatever reason */ @@ -266,8 +293,7 @@ register char *adir; { fp = fopen("/.AFSCONF", "r"); if (fp == 0) { free(tdir); - UNLOCK_GLOBAL_MUTEX - return (struct afsconf_dir *) 0; + UNLOCK_GLOBAL_MUTEX return (struct afsconf_dir *)0; } fgets(afs_confdir, 128, fp); fclose(fp); @@ -281,42 +307,37 @@ register char *adir; { fp = fopen("/.AFSCONF", "r"); if (fp == 0) { free(tdir); - UNLOCK_GLOBAL_MUTEX - return (struct afsconf_dir *) 0; + UNLOCK_GLOBAL_MUTEX return (struct afsconf_dir *)0; } - fgets(afs_confdir, 128, fp); - fclose(fp); } fgets(afs_confdir, 128, fp); - fclose(fp); + fclose(fp); } len = strlen(afs_confdir); if (len == 0) { free(tdir); - UNLOCK_GLOBAL_MUTEX - return (struct afsconf_dir *) 0; + UNLOCK_GLOBAL_MUTEX return (struct afsconf_dir *)0; } - if (afs_confdir[len-1] == '\n') { - afs_confdir[len-1] = 0; + if (afs_confdir[len - 1] == '\n') { + afs_confdir[len - 1] = 0; } afsconf_path = afs_confdir; } - tdir->name = (char *) malloc(strlen(afsconf_path)+1); + tdir->name = (char *)malloc(strlen(afsconf_path) + 1); strcpy(tdir->name, afsconf_path); code = afsconf_OpenInternal(tdir, 0, 0); if (code) { free(tdir->name); free(tdir); - UNLOCK_GLOBAL_MUTEX - return (struct afsconf_dir *) 0; + UNLOCK_GLOBAL_MUTEX return (struct afsconf_dir *)0; } } - UNLOCK_GLOBAL_MUTEX - return tdir; + UNLOCK_GLOBAL_MUTEX return tdir; } -static int GetCellUnix(struct afsconf_dir *adir) +static int +GetCellUnix(struct afsconf_dir *adir) { int rc; char tbuffer[256]; @@ -325,14 +346,14 @@ static int GetCellUnix(struct afsconf_dir *adir) strcompose(tbuffer, 256, adir->name, "/", AFSDIR_THISCELL_FILE, NULL); tf = fopen(tbuffer, "r"); if (tf) { + /* FIXME: buffer overflow waiting to happen */ rc = fscanf(tf, "%s", tbuffer); if (rc == 1) { - adir->cellName = (char *) malloc(strlen(tbuffer)+1); + adir->cellName = (char *)malloc(strlen(tbuffer) + 1); strcpy(adir->cellName, tbuffer); } fclose(tf); - } - else { + } else { return -1; } return 0; @@ -340,7 +361,8 @@ static int GetCellUnix(struct afsconf_dir *adir) #ifdef AFS_NT40_ENV -static int GetCellNT(struct afsconf_dir *adir) +static int +GetCellNT(struct afsconf_dir *adir) { if (IsClientConfigDirectory(adir->name)) { /* NT client config dir; ThisCell is in registry (no file). */ @@ -353,10 +375,9 @@ static int GetCellNT(struct afsconf_dir *adir) #endif /* AFS_NT40_ENV */ -static int afsconf_OpenInternal(adir, cell, clones) -register struct afsconf_dir *adir; -char *cell; -char clones[]; +static int +afsconf_OpenInternal(register struct afsconf_dir *adir, char *cell, + char clones[]) { FILE *tf; register char *tp, *bp; @@ -374,7 +395,7 @@ char clones[]; i = GetCellUnix(adir); #endif -#ifndef AFS_FREELANCE_CLIENT /* no local cell not fatal in freelance */ +#ifndef AFS_FREELANCE_CLIENT /* no local cell not fatal in freelance */ if (i) { return i; } @@ -389,16 +410,16 @@ char clones[]; */ if (IsClientConfigDirectory(adir->name)) { /* NT client config dir */ - strcompose(tbuffer, 256, - adir->name, "/", AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL); + strcompose(tbuffer, 256, adir->name, "/", + AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL); } else { /* NT server config dir */ - strcompose(tbuffer, 256, - adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL); + strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, + NULL); } #else strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL); -#endif /* AFS_NT40_ENV */ +#endif /* AFS_NT40_ENV */ if (!stat(tbuffer, &tstat)) { adir->timeRead = tstat.st_mtime; @@ -413,9 +434,11 @@ char clones[]; } while (1) { tp = fgets(tbuffer, sizeof(tbuffer), tf); - if (!tp) break; - TrimLine(tbuffer); /* remove white space */ - if (tbuffer[0] == 0 || tbuffer[0] == '\n') continue; /* empty line */ + if (!tp) + break; + TrimLine(tbuffer); /* remove white space */ + if (tbuffer[0] == 0 || tbuffer[0] == '\n') + continue; /* empty line */ if (tbuffer[0] == '>') { char linkedcell[MAXCELLCHARS]; /* start new cell item */ @@ -425,21 +448,23 @@ char clones[]; adir->entries = curEntry; curEntry = 0; } - curEntry = (struct afsconf_entry *) malloc(sizeof(struct afsconf_entry)); + curEntry = + (struct afsconf_entry *)malloc(sizeof(struct afsconf_entry)); memset(curEntry, 0, sizeof(struct afsconf_entry)); - code = ParseCellLine(tbuffer, curEntry->cellInfo.name, linkedcell); + code = + ParseCellLine(tbuffer, curEntry->cellInfo.name, linkedcell); if (code) { afsconf_CloseInternal(adir); fclose(tf); + free(curEntry); return -1; } if (linkedcell[0] != '\0') { curEntry->cellInfo.linkedCell = - (char *) malloc(strlen(linkedcell) + 1); + (char *)malloc(strlen(linkedcell) + 1); strcpy(curEntry->cellInfo.linkedCell, linkedcell); } - } - else { + } else { /* new host in the current cell */ if (!curEntry) { afsconf_CloseInternal(adir); @@ -447,17 +472,24 @@ char clones[]; return -1; } i = curEntry->cellInfo.numServers; - if (cell && !strcmp(cell, curEntry->cellInfo.name)) - code = ParseHostLine(tbuffer, (char *) &curEntry->cellInfo.hostAddr[i], curEntry->cellInfo.hostName[i], &clones[i]); - else - code = ParseHostLine(tbuffer, (char *) &curEntry->cellInfo.hostAddr[i], curEntry->cellInfo.hostName[i], 0); + if (cell && !strcmp(cell, curEntry->cellInfo.name)) + code = + ParseHostLine(tbuffer, &curEntry->cellInfo.hostAddr[i], + curEntry->cellInfo.hostName[i], &clones[i]); + else + code = + ParseHostLine(tbuffer, &curEntry->cellInfo.hostAddr[i], + curEntry->cellInfo.hostName[i], 0); if (code) { if (code == AFSCONF_SYNTAX) { - for (bp=tbuffer; *bp != '\n'; bp++) { /* Take out the from the buffer */ - if (!*bp) break; + for (bp = tbuffer; *bp != '\n'; bp++) { /* Take out the from the buffer */ + if (!*bp) + break; } - *bp= '\0'; - fprintf(stderr, "Can't properly parse host line \"%s\" in configuration file %s\n", tbuffer, tbuf1); + *bp = '\0'; + fprintf(stderr, + "Can't properly parse host line \"%s\" in configuration file %s\n", + tbuffer, tbuf1); } free(curEntry); fclose(tf); @@ -467,7 +499,7 @@ char clones[]; curEntry->cellInfo.numServers = ++i; } } - fclose(tf); /* close the file now */ + fclose(tf); /* close the file now */ /* end the last partially-completed cell */ if (curEntry) { @@ -483,23 +515,28 @@ char clones[]; char *aliasPtr; tp = fgets(tbuffer, sizeof(tbuffer), tf); - if (!tp) break; - TrimLine(tbuffer); /* remove white space */ + if (!tp) + break; + TrimLine(tbuffer); /* remove white space */ - if (tbuffer[0] == '\0' || - tbuffer[0] == '\n' || - tbuffer[0] == '#') continue; /* empty line */ + if (tbuffer[0] == '\0' || tbuffer[0] == '\n' || tbuffer[0] == '#') + continue; /* empty line */ tp = tbuffer; - while (tp[0] != '\0' && tp[0] != ' ' && tp[0] != '\t') tp++; - if (tp[0] == '\0') continue; /* invalid line */ + while (tp[0] != '\0' && tp[0] != ' ' && tp[0] != '\t') + tp++; + if (tp[0] == '\0') + continue; /* invalid line */ - while (tp[0] != '\0' && (tp[0] == ' ' || tp[0] == '\t')) 0[tp++] = '\0'; - if (tp[0] == '\0') continue; /* invalid line */ + while (tp[0] != '\0' && (tp[0] == ' ' || tp[0] == '\t')) + 0[tp++] = '\0'; + if (tp[0] == '\0') + continue; /* invalid line */ aliasPtr = tp; - while (tp[0] != '\0' && tp[0] != ' ' && tp[0] != '\t' && - tp[0] != '\r' && tp[0] != '\n') tp++; + while (tp[0] != '\0' && tp[0] != ' ' && tp[0] != '\t' && tp[0] != '\r' + && tp[0] != '\n') + tp++; tp[0] = '\0'; curAlias = malloc(sizeof(*curAlias)); @@ -512,9 +549,10 @@ char clones[]; adir->alias_entries = curAlias; } - if (tf != NULL) fclose(tf); + if (tf != NULL) + fclose(tf); /* now read the fs keys, if possible */ - adir->keystr = (struct afsconf_keys *) 0; + adir->keystr = (struct afsconf_keys *)0; afsconf_IntGetKeys(adir); return 0; @@ -525,29 +563,33 @@ char clones[]; *"[128.2.1.3] #hostname" for clones * into the appropriate pieces. */ -static ParseHostLine(aline, addr, aname, aclone) - char *aclone; - register struct sockaddr_in *addr; - char *aline, *aname; +static int +ParseHostLine(char *aline, register struct sockaddr_in *addr, char *aname, + char *aclone) { int c1, c2, c3, c4; register afs_int32 code; register char *tp; if (*aline == '[') { - if (aclone) *aclone = 1; - code = sscanf(aline, "[%d.%d.%d.%d] #%s", &c1, &c2, &c3, &c4, aname); + if (aclone) + *aclone = 1; + /* FIXME: length of aname unknown here */ + code = sscanf(aline, "[%d.%d.%d.%d] #%s", &c1, &c2, &c3, &c4, aname); } else { - if (aclone) *aclone = 0; - code = sscanf(aline, "%d.%d.%d.%d #%s", &c1, &c2, &c3, &c4, aname); + if (aclone) + *aclone = 0; + /* FIXME: length of aname unknown here */ + code = sscanf(aline, "%d.%d.%d.%d #%s", &c1, &c2, &c3, &c4, aname); } - if (code != 5) return AFSCONF_SYNTAX; + if (code != 5) + return AFSCONF_SYNTAX; addr->sin_family = AF_INET; addr->sin_port = 0; #ifdef STRUCT_SOCKADDR_HAS_SA_LEN addr->sin_len = sizeof(struct sockaddr_in); #endif - tp = (char *) &addr->sin_addr; + tp = (char *)&addr->sin_addr; *tp++ = c1; *tp++ = c2; *tp++ = c3; @@ -559,11 +601,15 @@ static ParseHostLine(aline, addr, aname, aclone) * ">cellname [linkedcellname] [#comments]" * into the appropriate pieces. */ -static ParseCellLine(aline, aname, alname) -register char *aline, *aname, *alname; { +static int +ParseCellLine(register char *aline, register char *aname, + register char *alname) +{ register int code; + /* FIXME: length of aname, alname unknown here */ code = sscanf(aline, ">%s %s", aname, alname); - if (code == 1) *alname = '\0'; + if (code == 1) + *alname = '\0'; if (code == 2) { if (*alname == '#') { *alname = '\0'; @@ -573,66 +619,60 @@ register char *aline, *aname, *alname; { } /* call aproc(entry, arock, adir) for all cells. Proc must return 0, or we'll stop early and return the code it returns */ -afsconf_CellApply(adir, aproc, arock) -struct afsconf_dir *adir; -int (*aproc)(); -char *arock; { +int +afsconf_CellApply(struct afsconf_dir *adir, + int (*aproc) (struct afsconf_cell * cell, char *arock, + struct afsconf_dir * dir), char *arock) +{ register struct afsconf_entry *tde; register afs_int32 code; - LOCK_GLOBAL_MUTEX - for(tde=adir->entries; tde; tde=tde->next) { - code = (*aproc)(&tde->cellInfo, arock, adir); + LOCK_GLOBAL_MUTEX for (tde = adir->entries; tde; tde = tde->next) { + code = (*aproc) (&tde->cellInfo, arock, adir); if (code) { - UNLOCK_GLOBAL_MUTEX - return code; + UNLOCK_GLOBAL_MUTEX return code; } } - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } /* call aproc(entry, arock, adir) for all cell aliases. * Proc must return 0, or we'll stop early and return the code it returns */ -afsconf_CellAliasApply(adir, aproc, arock) - struct afsconf_dir *adir; - int (*aproc)(); - char *arock; +int +afsconf_CellAliasApply(struct afsconf_dir *adir, + int (*aproc) (struct afsconf_cellalias * alias, + char *arock, struct afsconf_dir * dir), + char *arock) { register struct afsconf_aliasentry *tde; register afs_int32 code; - LOCK_GLOBAL_MUTEX - for(tde=adir->alias_entries; tde; tde=tde->next) { - code = (*aproc)(&tde->aliasInfo, arock, adir); + LOCK_GLOBAL_MUTEX for (tde = adir->alias_entries; tde; tde = tde->next) { + code = (*aproc) (&tde->aliasInfo, arock, adir); if (code) { - UNLOCK_GLOBAL_MUTEX - return code; + UNLOCK_GLOBAL_MUTEX return code; } } - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } afs_int32 afsconf_SawCell = 0; -afsconf_GetExtendedCellInfo(adir, acellName, aservice, acellInfo, clones) - struct afsconf_dir *adir; - char *aservice; - char *acellName; - struct afsconf_cell *acellInfo; - char clones[]; +int +afsconf_GetExtendedCellInfo(struct afsconf_dir *adir, char *acellName, + char *aservice, struct afsconf_cell *acellInfo, + char clones[]) { afs_int32 code; char *cell; code = afsconf_GetCellInfo(adir, acellName, aservice, acellInfo); - if (code) - return code; + if (code) + return code; - if (acellName) - cell = acellName; + if (acellName) + cell = acellName; else - cell = (char *) &acellInfo->name; + cell = (char *)&acellInfo->name; code = afsconf_OpenInternal(adir, cell, clones); return code; @@ -640,10 +680,9 @@ afsconf_GetExtendedCellInfo(adir, acellName, aservice, acellInfo, clones) #ifdef AFS_AFSDB_ENV #if !defined(AFS_NT40_ENV) -afsconf_GetAfsdbInfo(acellName, aservice, acellInfo) - char *acellName; - char *aservice; - struct afsconf_cell *acellInfo; +int +afsconf_GetAfsdbInfo(char *acellName, char *aservice, + struct afsconf_cell *acellInfo) { afs_int32 code; int tservice, i; @@ -659,12 +698,10 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo) * replaced with a more fine-grained lock just for the resolver * operations. */ - LOCK_GLOBAL_MUTEX - len = res_search(acellName, C_IN, T_AFSDB, answer, sizeof(answer)); - UNLOCK_GLOBAL_MUTEX - - if (len < 0) - return AFSCONF_NOTFOUND; + LOCK_GLOBAL_MUTEX len = + res_search(acellName, C_IN, T_AFSDB, answer, sizeof(answer)); + UNLOCK_GLOBAL_MUTEX if (len < 0) + return AFSCONF_NOTFOUND; p = answer + sizeof(HEADER); /* Skip header */ code = dn_expand(answer, answer + len, p, host, sizeof(host)); @@ -680,13 +717,13 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo) if (code < 0) return AFSCONF_NOTFOUND; - p += code; /* Skip the name */ + p += code; /* Skip the name */ type = (p[0] << 8) | p[1]; - p += 4; /* Skip type and class */ + p += 4; /* Skip type and class */ ttl = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; - p += 4; /* Skip the TTL */ + p += 4; /* Skip the TTL */ size = (p[0] << 8) | p[1]; - p += 2; /* Skip the size */ + p += 2; /* Skip the size */ if (type == T_AFSDB) { struct hostent *he; @@ -702,12 +739,11 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo) strcpy(realCellName, host); } - code = dn_expand(answer, answer+len, p+2, host, sizeof(host)); + code = dn_expand(answer, answer + len, p + 2, host, sizeof(host)); if (code < 0) return AFSCONF_NOTFOUND; - if ((afsdb_type == 1) && - (server_num < MAXHOSTSPERCELL) && + if ((afsdb_type == 1) && (server_num < MAXHOSTSPERCELL) && /* Do we want to get TTL data for the A record as well? */ (he = gethostbyname(host))) { afs_int32 ipaddr; @@ -717,18 +753,19 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo) sizeof(acellInfo->hostName[server_num])); server_num++; - if (!minttl || ttl < minttl) minttl = ttl; + if (!minttl || ttl < minttl) + minttl = ttl; } } p += size; } - if (server_num == 0) /* No AFSDB records */ + if (server_num == 0) /* No AFSDB records */ return AFSCONF_NOTFOUND; /* Convert the real cell name to lowercase */ - for (p = (unsigned char *) realCellName; *p; p++) + for (p = (unsigned char *)realCellName; *p; p++) *p = tolower(*p); strncpy(acellInfo->name, realCellName, sizeof(acellInfo->name)); @@ -737,8 +774,8 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo) if (aservice) { tservice = afsconf_FindService(aservice); if (tservice < 0) - return AFSCONF_NOTFOUND; /* service not found */ - for (i=0; inumServers; i++) { + return AFSCONF_NOTFOUND; /* service not found */ + for (i = 0; i < acellInfo->numServers; i++) { acellInfo->hostAddr[i].sin_port = tservice; } } @@ -747,65 +784,59 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo) return 0; } -#else /* windows */ -int afsconf_GetAfsdbInfo(acellName, aservice, acellInfo) - char *aservice; - char *acellName; - struct afsconf_cell *acellInfo; +#else /* windows */ +int +afsconf_GetAfsdbInfo(char *acellName, char *aservice, + struct afsconf_cell *acellInfo) { register afs_int32 i; int tservice; struct afsconf_entry DNSce; - char *DNStmpStrp; /* a temp string pointer */ - struct hostent *thp; afs_int32 cellHosts[AFSMAXCELLHOSTS]; int numServers; int rc; - int *ttl; + int ttl; - DNSce.cellInfo.numServers=0; + DNSce.cellInfo.numServers = 0; DNSce.next = NULL; rc = getAFSServer(acellName, cellHosts, &numServers, &ttl); /* ignore the ttl here since this code is only called by transitory programs - like klog, etc. */ + * like klog, etc. */ if (rc < 0) - return -1; + return -1; if (numServers == 0) - return -1; + return -1; - for (i = 0; i < numServers; i++) - { - memcpy(&acellInfo->hostAddr[i].sin_addr.s_addr, &cellHosts[i], sizeof(long)); - acellInfo->hostAddr[i].sin_family = AF_INET; + for (i = 0; i < numServers; i++) { + memcpy(&acellInfo->hostAddr[i].sin_addr.s_addr, &cellHosts[i], + sizeof(long)); + acellInfo->hostAddr[i].sin_family = AF_INET; - /* sin_port supplied by connection code */ + /* sin_port supplied by connection code */ } acellInfo->numServers = numServers; strcpy(acellInfo->name, acellName); if (aservice) { - LOCK_GLOBAL_MUTEX - tservice = afsconf_FindService(aservice); - UNLOCK_GLOBAL_MUTEX - if (tservice < 0) { - return AFSCONF_NOTFOUND; /* service not found */ - } - for(i=0; i< acellInfo->numServers; i++) { - acellInfo->hostAddr[i].sin_port = tservice; - } + LOCK_GLOBAL_MUTEX tservice = afsconf_FindService(aservice); + UNLOCK_GLOBAL_MUTEX if (tservice < 0) { + return AFSCONF_NOTFOUND; /* service not found */ + } + for (i = 0; i < acellInfo->numServers; i++) { + acellInfo->hostAddr[i].sin_port = tservice; + } } - acellInfo->linkedCell = NULL; /* no linked cell */ + acellInfo->linkedCell = NULL; /* no linked cell */ acellInfo->flags = 0; return 0; } #endif /* windows */ #endif /* AFS_AFSDB_ENV */ -afsconf_GetCellInfo(adir, acellName, aservice, acellInfo) -struct afsconf_dir *adir; -char *aservice; -char *acellName; -struct afsconf_cell *acellInfo; { +int +afsconf_GetCellInfo(struct afsconf_dir *adir, char *acellName, char *aservice, + struct afsconf_cell *acellInfo) +{ register struct afsconf_entry *tce; struct afsconf_aliasentry *tcae; struct afsconf_entry *bestce; @@ -816,28 +847,26 @@ struct afsconf_cell *acellInfo; { int ambig; char tbuffer[64]; - LOCK_GLOBAL_MUTEX - if (adir) afsconf_Check(adir); + LOCK_GLOBAL_MUTEX if (adir) + afsconf_Check(adir); if (acellName) { tcell = acellName; - cnLen = strlen(tcell)+1; - lcstring (tcell, tcell, cnLen); - afsconf_SawCell = 1; /* will ignore the AFSCELL switch on future */ - /* call to afsconf_GetLocalCell: like klog */ + cnLen = strlen(tcell) + 1; + lcstring(tcell, tcell, cnLen); + afsconf_SawCell = 1; /* will ignore the AFSCELL switch on future */ + /* call to afsconf_GetLocalCell: like klog */ } else { i = afsconf_GetLocalCell(adir, tbuffer, sizeof(tbuffer)); if (i) { - UNLOCK_GLOBAL_MUTEX - return i; + UNLOCK_GLOBAL_MUTEX return i; } tcell = tbuffer; } cnLen = strlen(tcell); - bestce = (struct afsconf_entry *) 0; + bestce = (struct afsconf_entry *)0; ambig = 0; if (!adir) { - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } /* Look through the list of aliases */ @@ -848,124 +877,132 @@ struct afsconf_cell *acellInfo; { } } - for(tce=adir->entries;tce;tce=tce->next) { + for (tce = adir->entries; tce; tce = tce->next) { if (strcasecmp(tce->cellInfo.name, tcell) == 0) { /* found our cell */ bestce = tce; ambig = 0; break; } - if (strlen(tce->cellInfo.name) < cnLen) continue; /* clearly wrong */ + if (strlen(tce->cellInfo.name) < cnLen) + continue; /* clearly wrong */ if (strncasecmp(tce->cellInfo.name, tcell, cnLen) == 0) { - if (bestce) ambig = 1; /* ambiguous unless we get exact match */ + if (bestce) + ambig = 1; /* ambiguous unless we get exact match */ bestce = tce; } } - if (!ambig && bestce) { + if (!ambig && bestce && bestce->cellInfo.numServers) { *acellInfo = bestce->cellInfo; /* structure assignment */ if (aservice) { tservice = afsconf_FindService(aservice); if (tservice < 0) { - UNLOCK_GLOBAL_MUTEX - return AFSCONF_NOTFOUND; /* service not found */ + UNLOCK_GLOBAL_MUTEX return AFSCONF_NOTFOUND; /* service not found */ } - for(i=0;inumServers;i++) { + for (i = 0; i < acellInfo->numServers; i++) { acellInfo->hostAddr[i].sin_port = tservice; } } acellInfo->timeout = 0; - UNLOCK_GLOBAL_MUTEX - return 0; - } - else { + UNLOCK_GLOBAL_MUTEX return 0; + } else { UNLOCK_GLOBAL_MUTEX #ifdef AFS_AFSDB_ENV - return afsconf_GetAfsdbInfo(tcell, aservice, acellInfo); + return afsconf_GetAfsdbInfo(tcell, aservice, acellInfo); #else - return AFSCONF_NOTFOUND; + return AFSCONF_NOTFOUND; #endif /* AFS_AFSDB_ENV */ } } -afsconf_GetLocalCell(adir, aname, alen) -register struct afsconf_dir *adir; -char *aname; -afs_int32 alen; { - static int afsconf_showcell = 0; - char *afscell_path; - char *getenv(); - afs_int32 code = 0; - - LOCK_GLOBAL_MUTEX - /* - * If a cell switch was specified in a command, then it should override the - * AFSCELL variable. If a cell was specified, then the afsconf_SawCell flag - * is set and the cell name in the adir structure is used. - * Read the AFSCELL var each time: in case it changes (unsetenv AFSCELL). - */ - if ( !afsconf_SawCell && (afscell_path= getenv("AFSCELL")) ) { - if ( !afsconf_showcell ) { - fprintf(stderr, "Note: Operation is performed on cell %s\n", afscell_path); +int +afsconf_GetLocalCell(register struct afsconf_dir *adir, char *aname, + afs_int32 alen) +{ + static int afsconf_showcell = 0; + char *afscell_path; + afs_int32 code = 0; + + LOCK_GLOBAL_MUTEX + /* + * If a cell switch was specified in a command, then it should override the + * AFSCELL variable. If a cell was specified, then the afsconf_SawCell flag + * is set and the cell name in the adir structure is used. + * Read the AFSCELL var each time: in case it changes (unsetenv AFSCELL). + */ + if (!afsconf_SawCell && (afscell_path = getenv("AFSCELL"))) { + if (!afsconf_showcell) { + fprintf(stderr, "Note: Operation is performed on cell %s\n", + afscell_path); afsconf_showcell = 1; } strncpy(aname, afscell_path, alen); - } else { + } else { afsconf_Check(adir); if (adir->cellName) { strncpy(aname, adir->cellName, alen); - } - else code = AFSCONF_UNKNOWN; + } else + code = AFSCONF_UNKNOWN; } - UNLOCK_GLOBAL_MUTEX - return(code); + UNLOCK_GLOBAL_MUTEX return (code); } -afsconf_Close(adir) -struct afsconf_dir *adir; { - LOCK_GLOBAL_MUTEX - afsconf_CloseInternal(adir); - if (adir->name) free(adir->name); +int +afsconf_Close(struct afsconf_dir *adir) +{ + LOCK_GLOBAL_MUTEX afsconf_CloseInternal(adir); + if (adir->name) + free(adir->name); free(adir); - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } -static int afsconf_CloseInternal(adir) -register struct afsconf_dir *adir; { +static int +afsconf_CloseInternal(register struct afsconf_dir *adir) +{ register struct afsconf_entry *td, *nd; + struct afsconf_aliasentry *ta, *na; register char *tname; - tname = adir->name; /* remember name, since that's all we preserve */ + tname = adir->name; /* remember name, since that's all we preserve */ /* free everything we can find */ - if (adir->cellName) free(adir->cellName); - for(td=adir->entries;td;td=nd) { + if (adir->cellName) + free(adir->cellName); + for (td = adir->entries; td; td = nd) { nd = td->next; if (td->cellInfo.linkedCell) free(td->cellInfo.linkedCell); free(td); } - if (adir->keystr) free(adir->keystr); + for (ta = adir->alias_entries; ta; ta = na) { + na = ta->next; + free(ta); + } + if (adir->keystr) + free(adir->keystr); /* reinit */ memset(adir, 0, sizeof(struct afsconf_dir)); - adir->name = tname; /* restore it */ + adir->name = tname; /* restore it */ return 0; } -static int afsconf_Reopen(adir) -register struct afsconf_dir *adir; { +static int +afsconf_Reopen(register struct afsconf_dir *adir) +{ register afs_int32 code; code = afsconf_CloseInternal(adir); - if (code) return code; + if (code) + return code; code = afsconf_OpenInternal(adir, 0, 0); return code; } /* called during opening of config file */ -afsconf_IntGetKeys(adir) -struct afsconf_dir *adir; +int +afsconf_IntGetKeys(struct afsconf_dir *adir) { char tbuffer[256]; register int fd; @@ -985,59 +1022,49 @@ struct afsconf_dir *adir; #endif /* AFS_NT40_ENV */ LOCK_GLOBAL_MUTEX - /* compute the key name and other setup */ - - strcompose(tbuffer, 256, adir->name, "/", AFSDIR_KEY_FILE, NULL); - tstr = (struct afsconf_keys *) malloc(sizeof (struct afsconf_keys)); + /* compute the key name and other setup */ + strcompose(tbuffer, 256, adir->name, "/", AFSDIR_KEY_FILE, NULL); + tstr = (struct afsconf_keys *)malloc(sizeof(struct afsconf_keys)); adir->keystr = tstr; /* read key file */ fd = open(tbuffer, O_RDONLY); if (fd < 0) { tstr->nkeys = 0; - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } code = read(fd, tstr, sizeof(struct afsconf_keys)); close(fd); if (code < sizeof(afs_int32)) { tstr->nkeys = 0; - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } /* convert key structure to host order */ tstr->nkeys = ntohl(tstr->nkeys); - for(fd=0;fdnkeys;fd++) + for (fd = 0; fd < tstr->nkeys; fd++) tstr->key[fd].kvno = ntohl(tstr->key[fd].kvno); - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } /* get keys structure */ -afsconf_GetKeys(adir, astr) -struct afsconf_dir *adir; -struct afsconf_keys *astr; +int +afsconf_GetKeys(struct afsconf_dir *adir, struct afsconf_keys *astr) { register afs_int32 code; - LOCK_GLOBAL_MUTEX - code = afsconf_Check(adir); + LOCK_GLOBAL_MUTEX code = afsconf_Check(adir); if (code) { - UNLOCK_GLOBAL_MUTEX - return AFSCONF_FAILURE; + UNLOCK_GLOBAL_MUTEX return AFSCONF_FAILURE; } memcpy(astr, adir->keystr, sizeof(struct afsconf_keys)); - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } /* get latest key */ -afs_int32 afsconf_GetLatestKey(adir, avno, akey) - IN struct afsconf_dir *adir; - OUT afs_int32 *avno; - OUT char *akey; +afs_int32 +afsconf_GetLatestKey(struct afsconf_dir * adir, afs_int32 * avno, char *akey) { register int i; int maxa; @@ -1045,67 +1072,60 @@ afs_int32 afsconf_GetLatestKey(adir, avno, akey) register afs_int32 best; struct afsconf_key *bestk; register afs_int32 code; - - LOCK_GLOBAL_MUTEX - code = afsconf_Check(adir); + + LOCK_GLOBAL_MUTEX code = afsconf_Check(adir); if (code) { - UNLOCK_GLOBAL_MUTEX - return AFSCONF_FAILURE; + UNLOCK_GLOBAL_MUTEX return AFSCONF_FAILURE; } maxa = adir->keystr->nkeys; - best = -1; /* highest kvno we've seen yet */ - bestk = (struct afsconf_key *) 0; /* ptr to structure providing best */ - for(tk = adir->keystr->key,i=0;ikvno == 999) continue; /* skip bcrypt keys */ + best = -1; /* highest kvno we've seen yet */ + bestk = (struct afsconf_key *)0; /* ptr to structure providing best */ + for (tk = adir->keystr->key, i = 0; i < maxa; i++, tk++) { + if (tk->kvno == 999) + continue; /* skip bcrypt keys */ if (tk->kvno > best) { best = tk->kvno; bestk = tk; } } - if (bestk) { /* found any */ - if (akey) memcpy(akey, bestk->key, 8); /* copy out latest key */ - if (avno) *avno = bestk->kvno; /* and kvno to caller */ - UNLOCK_GLOBAL_MUTEX - return 0; + if (bestk) { /* found any */ + if (akey) + memcpy(akey, bestk->key, 8); /* copy out latest key */ + if (avno) + *avno = bestk->kvno; /* and kvno to caller */ + UNLOCK_GLOBAL_MUTEX return 0; } - UNLOCK_GLOBAL_MUTEX - return AFSCONF_NOTFOUND; /* didn't find any keys */ + UNLOCK_GLOBAL_MUTEX return AFSCONF_NOTFOUND; /* didn't find any keys */ } /* get a particular key */ -afsconf_GetKey(adir, avno, akey) -struct afsconf_dir *adir; -afs_int32 avno; -char *akey; +int +afsconf_GetKey(struct afsconf_dir *adir, afs_int32 avno, char *akey) { register int i, maxa; register struct afsconf_key *tk; register afs_int32 code; - LOCK_GLOBAL_MUTEX - code = afsconf_Check(adir); + LOCK_GLOBAL_MUTEX code = afsconf_Check(adir); if (code) { - UNLOCK_GLOBAL_MUTEX - return AFSCONF_FAILURE; + UNLOCK_GLOBAL_MUTEX return AFSCONF_FAILURE; } maxa = adir->keystr->nkeys; - for(tk = adir->keystr->key,i=0;ikeystr->key, i = 0; i < maxa; i++, tk++) { if (tk->kvno == avno) { memcpy(akey, tk->key, 8); - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } } - UNLOCK_GLOBAL_MUTEX - return AFSCONF_NOTFOUND; + UNLOCK_GLOBAL_MUTEX return AFSCONF_NOTFOUND; } /* save the key structure in the appropriate file */ -static SaveKeys(adir) -struct afsconf_dir *adir; +static int +SaveKeys(struct afsconf_dir *adir) { struct afsconf_keys tkeys; register int fd; @@ -1115,48 +1135,46 @@ struct afsconf_dir *adir; memcpy(&tkeys, adir->keystr, sizeof(struct afsconf_keys)); /* convert it to net byte order */ - for(i = 0; iname, "/", AFSDIR_KEY_FILE, NULL); fd = open(tbuffer, O_RDWR | O_CREAT | O_TRUNC, 0600); - if (fd < 0) return AFSCONF_FAILURE; + if (fd < 0) + return AFSCONF_FAILURE; i = write(fd, &tkeys, sizeof(tkeys)); if (i != sizeof(tkeys)) { close(fd); return AFSCONF_FAILURE; } - if (close(fd) < 0) return AFSCONF_FAILURE; + if (close(fd) < 0) + return AFSCONF_FAILURE; return 0; } -afsconf_AddKey(adir, akvno, akey, overwrite) -struct afsconf_dir *adir; -afs_int32 akvno, overwrite; -char akey[8]; +int +afsconf_AddKey(struct afsconf_dir *adir, afs_int32 akvno, char akey[8], + afs_int32 overwrite) { register struct afsconf_keys *tk; register struct afsconf_key *tkey; register afs_int32 i; int foundSlot; - LOCK_GLOBAL_MUTEX - tk = adir->keystr; - + LOCK_GLOBAL_MUTEX tk = adir->keystr; + if (akvno != 999) { if (akvno < 0 || akvno > 255) { - UNLOCK_GLOBAL_MUTEX - return ERANGE; + UNLOCK_GLOBAL_MUTEX return ERANGE; } } foundSlot = 0; - for(i=0, tkey = tk->key; inkeys; i++, tkey++) { + for (i = 0, tkey = tk->key; i < tk->nkeys; i++, tkey++) { if (tkey->kvno == akvno) { if (!overwrite) { - UNLOCK_GLOBAL_MUTEX - return AFSCONF_KEYINUSE; + UNLOCK_GLOBAL_MUTEX return AFSCONF_KEYINUSE; } foundSlot = 1; break; @@ -1164,8 +1182,7 @@ char akey[8]; } if (!foundSlot) { if (tk->nkeys >= AFSCONF_MAXKEYS) { - UNLOCK_GLOBAL_MUTEX - return AFSCONF_FULL; + UNLOCK_GLOBAL_MUTEX return AFSCONF_FULL; } tkey = &tk->key[tk->nkeys++]; } @@ -1173,44 +1190,39 @@ char akey[8]; memcpy(tkey->key, akey, 8); i = SaveKeys(adir); afsconf_Touch(adir); - UNLOCK_GLOBAL_MUTEX - return i; + UNLOCK_GLOBAL_MUTEX return i; } /* this proc works by sliding the other guys down, rather than using a funny kvno value, so that callers can count on getting a good key in key[0]. */ -afsconf_DeleteKey(adir, akvno) -struct afsconf_dir *adir; -afs_int32 akvno; +int +afsconf_DeleteKey(struct afsconf_dir *adir, afs_int32 akvno) { register struct afsconf_keys *tk; register struct afsconf_key *tkey; register int i; int foundFlag = 0; - LOCK_GLOBAL_MUTEX - tk = adir->keystr; + LOCK_GLOBAL_MUTEX tk = adir->keystr; - for(i=0, tkey = tk->key; inkeys; i++, tkey++) { + for (i = 0, tkey = tk->key; i < tk->nkeys; i++, tkey++) { if (tkey->kvno == akvno) { foundFlag = 1; break; } } if (!foundFlag) { - UNLOCK_GLOBAL_MUTEX - return AFSCONF_NOTFOUND; + UNLOCK_GLOBAL_MUTEX return AFSCONF_NOTFOUND; } /* otherwise slide the others down. i and tkey point at the guy to delete */ - for(;inkeys-1; i++,tkey++) { - tkey->kvno = (tkey+1)->kvno; - memcpy(tkey->key, (tkey+1)->key, 8); + for (; i < tk->nkeys - 1; i++, tkey++) { + tkey->kvno = (tkey + 1)->kvno; + memcpy(tkey->key, (tkey + 1)->key, 8); } tk->nkeys--; i = SaveKeys(adir); afsconf_Touch(adir); - UNLOCK_GLOBAL_MUTEX - return i; + UNLOCK_GLOBAL_MUTEX return i; } diff --git a/src/auth/cellconfig.p.h b/src/auth/cellconfig.p.h index 5fa71d1ba..e2ae6ed2d 100644 --- a/src/auth/cellconfig.p.h +++ b/src/auth/cellconfig.p.h @@ -60,13 +60,13 @@ Creation date: * Complete server info for one cell. */ struct afsconf_cell { - char name[MAXCELLCHARS]; /*Cell name*/ - short numServers; /*Num active servers for the cell*/ - short flags; /* useful flags */ - struct sockaddr_in hostAddr[MAXHOSTSPERCELL]; /*IP addresses for cell's servers*/ - char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS]; /*Names for cell's servers*/ - char *linkedCell; /* Linked cell name, if any */ - int timeout; /* Data timeout, if non-zero */ + char name[MAXCELLCHARS]; /*Cell name */ + short numServers; /*Num active servers for the cell */ + short flags; /* useful flags */ + struct sockaddr_in hostAddr[MAXHOSTSPERCELL]; /*IP addresses for cell's servers */ + char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS]; /*Names for cell's servers */ + char *linkedCell; /* Linked cell name, if any */ + int timeout; /* Data timeout, if non-zero */ }; struct afsconf_cellalias { @@ -76,7 +76,7 @@ struct afsconf_cellalias { struct afsconf_entry { struct afsconf_entry *next; /* next guy in afsconf_dir */ - struct afsconf_cell cellInfo; /* info for this cell */ + struct afsconf_cell cellInfo; /* info for this cell */ }; struct afsconf_aliasentry { @@ -85,24 +85,59 @@ struct afsconf_aliasentry { }; struct afsconf_dir { - char *name; /* pointer to dir prefix */ - char *cellName; /* cell name, if any, we're in */ - struct afsconf_entry *entries; /* list of cell entries */ - struct afsconf_keys *keystr; /* structure containing keys */ - afs_int32 timeRead; /* time stamp of file last read */ - struct afsconf_aliasentry *alias_entries; /* cell aliases */ + char *name; /* pointer to dir prefix */ + char *cellName; /* cell name, if any, we're in */ + struct afsconf_entry *entries; /* list of cell entries */ + struct afsconf_keys *keystr; /* structure containing keys */ + afs_int32 timeRead; /* time stamp of file last read */ + struct afsconf_aliasentry *alias_entries; /* cell aliases */ }; -extern struct afsconf_dir *afsconf_Open(); -extern afs_int32 afsconf_ClientAuth(); -extern afs_int32 afsconf_Authenticate(); -extern int afsconf_GetKey(); - struct afsconf_servPair { char *name; int port; }; +extern struct afsconf_dir *afsconf_Open(register const char *adir); +extern int afsconf_CellApply(struct afsconf_dir *adir, + int (*aproc) (struct afsconf_cell * cell, + char *arock, + struct afsconf_dir * dir), + char *arock); +extern int afsconf_CellAliasApply(struct afsconf_dir *adir, + int (*aproc) (struct afsconf_cellalias * + alias, char *arock, + struct afsconf_dir * dir), + char *arock); +extern int afsconf_GetExtendedCellInfo(struct afsconf_dir *adir, + char *acellName, char *aservice, + struct afsconf_cell *acellInfo, + char clones[]); +extern int afsconf_GetAfsdbInfo(char *acellName, char *aservice, + struct afsconf_cell *acellInfo); +extern int afsconf_GetCellInfo(struct afsconf_dir *adir, char *acellName, + char *aservice, + struct afsconf_cell *acellInfo); +extern int afsconf_GetLocalCell(register struct afsconf_dir *adir, + char *aname, afs_int32 alen); +extern int afsconf_Close(struct afsconf_dir *adir); +extern int afsconf_IntGetKeys(struct afsconf_dir *adir); +extern int afsconf_GetKeys(struct afsconf_dir *adir, + struct afsconf_keys *astr); +extern afs_int32 afsconf_GetLatestKey(struct afsconf_dir *adir, + afs_int32 * avno, char *akey); +extern int afsconf_GetKey(struct afsconf_dir *adir, afs_int32 avno, + char *akey); +extern int afsconf_AddKey(struct afsconf_dir *adir, afs_int32 akvno, + char akey[8], afs_int32 overwrite); +extern int afsconf_DeleteKey(struct afsconf_dir *adir, afs_int32 akvno); + +struct rx_securityClass; +extern afs_int32 afsconf_ClientAuth(struct afsconf_dir *adir, + struct rx_securityClass **astr, + afs_int32 * aindex); + + /* some well-known ports and their names; new additions to table in cellconfig.c, too */ #define AFSCONF_FILESERVICE "afs" @@ -128,6 +163,6 @@ struct afsconf_servPair { #define AFSCONF_RSDBSERVICE "afsres" #define AFSCONF_RESPORT 7010 #define AFSCONF_REMIODBSERVICE "afsremio" -#define AFSCONF_REMIOPORT 7011 +#define AFSCONF_REMIOPORT 7011 #endif /* __CELLCONFIG_AFS_INCL_ */ diff --git a/src/auth/copyauth.c b/src/auth/copyauth.c index 3cb8abd4b..ae650eaa8 100644 --- a/src/auth/copyauth.c +++ b/src/auth/copyauth.c @@ -10,7 +10,16 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/auth/copyauth.c,v 1.1.1.4 2001/07/14 22:20:40 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/auth/copyauth.c,v 1.6 2003/07/15 23:14:41 shadow Exp $"); + +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif #include #include "auth.h" @@ -27,8 +36,9 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/copyauth.c,v 1.1.1.4 2001/07/14 22 char whoami[256]; main(argc, argv) -int argc; -char **argv; { + int argc; + char **argv; +{ char localName[64]; register afs_int32 code; register char *cname; @@ -39,8 +49,10 @@ char **argv; { strcpy(whoami, argv[0]); if (argc <= 1) { - printf("%s: copies a file system ticket from the local cell to another cell\n",whoami); - printf("%s: usage is 'setauth \n",whoami); + printf + ("%s: copies a file system ticket from the local cell to another cell\n", + whoami); + printf("%s: usage is 'setauth \n", whoami); exit(1); } @@ -54,28 +66,32 @@ char **argv; { } code = afsconf_GetLocalCell(tdir, localName, sizeof(localName)); if (code) { - printf("%s: can't determine local cell name\n",whoami); + printf("%s: can't determine local cell name\n", whoami); exit(1); } /* done with configuration stuff now */ afsconf_Close(tdir); - - + + /* get ticket in local cell */ strcpy(tserver.cell, localName); strcpy(tserver.name, "afs"); tserver.instance[0] = 0; - code = ktc_GetToken(&tserver, &token, sizeof(token), (char *) 0); + code = ktc_GetToken(&tserver, &token, sizeof(token), NULL); if (code) { - printf("%s: failed to get '%s' service ticket in cell '%s' (code %d)\n", whoami, tserver.name, tserver.cell, code); + printf + ("%s: failed to get '%s' service ticket in cell '%s' (code %d)\n", + whoami, tserver.name, tserver.cell, code); exit(1); } - + /* and now set the ticket in the new cell */ strcpy(tserver.cell, argv[1]); - code = ktc_SetToken(&tserver, &token, (char *) 0, 0); + code = ktc_SetToken(&tserver, &token, NULL, 0); if (code) { - printf("%s: failed to set ticket (code %d), are you sure you're authenticated?\n", whoami, code); + printf + ("%s: failed to set ticket (code %d), are you sure you're authenticated?\n", + whoami, code); exit(1); } diff --git a/src/auth/ktc.c b/src/auth/ktc.c index b65d5053a..e2b3eb277 100644 --- a/src/auth/ktc.c +++ b/src/auth/ktc.c @@ -11,23 +11,24 @@ #include #if defined(UKERNEL) -#include "../afs/param.h" +#include "afs/param.h" #else #include #endif -RCSID("$Header: /tmp/cvstemp/openafs/src/auth/ktc.c,v 1.1.1.9 2003/07/30 17:11:22 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/auth/ktc.c,v 1.15 2004/04/14 23:26:13 jaltman Exp $"); #if defined(UKERNEL) -#include "../afs/sysincludes.h" -#include "../afs/afsincludes.h" -#include "../afs/stds.h" -#include "../afs/pthread_glock.h" -#include "../afs/vice.h" -#include "../afs/auth.h" -#include "../afs/venus.h" -#include "../afs/pthread_glock.h" -#include "../afs/dirpath.h" +#include "afs/sysincludes.h" +#include "afsincludes.h" +#include "afs/stds.h" +#include "afs/pthread_glock.h" +#include "afs/vice.h" +#include "afs/auth.h" +#include "afs/venus.h" +#include "afs/pthread_glock.h" +#include "afs/dirpath.h" #if !defined(min) #define min(a,b) ((a)<(b)?(a):(b)) @@ -77,33 +78,31 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/ktc.c,v 1.1.1.9 2003/07/30 17:11:2 #define AFS_KERBEROS_ENV #endif -#ifdef AFS_KERBEROS_ENV +#ifdef AFS_KERBEROS_ENV #include #include -extern afs_uint32 life_to_time(); -extern unsigned char time_to_life(); #include "cellconfig.h" static char lcell[MAXCELLCHARS]; - + #define TKT_ROOT "/tmp/tkt" - + #define KSUCCESS 0 #define KFAILURE 255 - + /* Definitions for ticket file utilities */ #define R_TKT_FIL 0 #define W_TKT_FIL 1 - + /* Error codes returned by ticket file utilities */ #define NO_TKT_FIL 76 /* No ticket file found */ #define TKT_FIL_ACC 77 /* Couldn't access tkt file */ #define TKT_FIL_LCK 78 /* Couldn't lock ticket file */ #define TKT_FIL_FMT 79 /* Bad ticket file format */ #define TKT_FIL_INI 80 /* afs_tf_init not called first */ - + /* Values returned by get_credentials */ #define RET_TKFIL 21 /* Can't read ticket file */ - + #ifndef BUFSIZ #define BUFSIZ 4096 #endif @@ -125,18 +124,16 @@ static struct flock fileUlock = { F_UNLCK, 0, 0, 0, 0 }; #ifndef EOF #define EOF (-1) #endif - + /* the following routines aren't static anymore on behalf of the kerberos IV * compatibility library built in subtree krb. */ -int afs_tf_init(), afs_tf_get_pname(), afs_tf_get_pinst(), afs_tf_get_cred(); -int afs_tf_save_cred(), afs_tf_close(), afs_tf_create(); +int afs_tf_init(), afs_tf_get_pname(), afs_tf_get_pinst(), afs_tf_get_cred(); +int afs_tf_save_cred(), afs_tf_close(), afs_tf_create(); int afs_tf_dest_tkt(); -/* except ktc_LocalCell which is still static - */ -static int ktc_LocalCell(); +static void ktc_LocalCell(); char *ktc_tkt_string(); -#endif /* AFS_KERBEROS_ENV */ +#endif /* AFS_KERBEROS_ENV */ #ifdef AFS_DUX40_ENV #define PIOCTL afs_pioctl @@ -199,7 +196,7 @@ static int kernelKTC = 0; /* printf ("returned from KTC_NO_OP kernelKTC <= %d; code=%d, errno=%d\n", kernelKTC, code, errno); */\ } -#else /* AFS_DECOSF_ENV */ +#else /* AFS_DECOSF_ENV */ #define CHECK_KERNEL \ if (kernelKTC == 0) { \ @@ -213,7 +210,7 @@ static int kernelKTC = 0; else kernelKTC = 2; \ /* printf ("returned from KTC_NO_OP kernelKTC <= %d; code=%d, errno=%d\n", kernelKTC, code, errno); */\ } -#endif /* AFS_DECOSF_ENV */ +#endif /* AFS_DECOSF_ENV */ #define TRY_KERNEL(cmd,a1,a2,a3,a4) \ { CHECK_KERNEL; \ @@ -230,11 +227,11 @@ static int kernelKTC = 0; /* this is a structure used to communicate with the afs cache mgr, but is * otherwise irrelevant */ struct ClearToken { - afs_int32 AuthHandle; - char HandShakeKey[8]; - afs_int32 ViceId; - afs_int32 BeginTimestamp; - afs_int32 EndTimestamp; + afs_int32 AuthHandle; + char HandShakeKey[8]; + afs_int32 ViceId; + afs_int32 BeginTimestamp; + afs_int32 EndTimestamp; }; #endif /* !defined(UKERNEL) */ @@ -244,31 +241,40 @@ static struct { int valid; struct ktc_principal server; struct ktc_principal client; - struct ktc_token token; -} local_tokens[MAXLOCALTOKENS] = {{0}, {0}, {0}, {0}}; + struct ktc_token token; +} local_tokens[MAXLOCALTOKENS] = { { +0}, { +0}, { +0}, { +0}}; /* new interface routines to the ticket cache. Only handle afs service right * now. */ -static int NewSetToken (aserver, atoken, aclient, flags) - struct ktc_principal *aserver; - struct ktc_principal *aclient; - struct ktc_token *atoken; - afs_int32 flags; +static int +NewSetToken(aserver, atoken, aclient, flags) + struct ktc_principal *aserver; + struct ktc_principal *aclient; + struct ktc_token *atoken; + afs_int32 flags; { - TRY_KERNEL (KTC_SETTOKEN_OP, - aserver, aclient, atoken, sizeof(struct ktc_token)); + TRY_KERNEL(KTC_SETTOKEN_OP, aserver, aclient, atoken, + sizeof(struct ktc_token)); /* no kernel ticket cache */ return EINVAL; } -static int OldSetToken (aserver, atoken, aclient, flags) -struct ktc_principal *aserver, *aclient; -struct ktc_token *atoken; -afs_int32 flags; +#define MAXPIOCTLTOKENLEN \ +(3*sizeof(afs_int32)+MAXKTCTICKETLEN+sizeof(struct ClearToken)+MAXKTCREALMLEN) + +static int +OldSetToken(aserver, atoken, aclient, flags) + struct ktc_principal *aserver, *aclient; + struct ktc_token *atoken; + afs_int32 flags; { struct ViceIoctl iob; - char tbuffer[1024]; + char tbuffer[MAXPIOCTLTOKENLEN]; register char *tp; struct ClearToken ct; register afs_int32 code; @@ -277,29 +283,36 @@ afs_int32 flags; if (strcmp(aserver->name, "afs") != 0) { int found = -1; int i; - for (i=0; iname) == 0) && - (strcmp (local_tokens[i].server.instance, aserver->instance) == 0) && - (strcmp (local_tokens[i].server.cell, aserver->cell) == 0)) { - found = i; /* replace existing entry */ + if ((strcmp(local_tokens[i].server.name, aserver->name) == 0) + && + (strcmp + (local_tokens[i].server.instance, + aserver->instance) == 0) + && (strcmp(local_tokens[i].server.cell, aserver->cell) == + 0)) { + found = i; /* replace existing entry */ break; - } - else /* valid, but no match */ ; - } else found = i; /* remember this empty slot */ - if (found == -1) return KTC_NOENT; + } else /* valid, but no match */ + ; + } else + found = i; /* remember this empty slot */ + if (found == -1) + return KTC_NOENT; memcpy(&local_tokens[found].token, atoken, sizeof(struct ktc_token)); local_tokens[found].server = *aserver; local_tokens[found].client = *aclient; local_tokens[found].valid = 1; return 0; } - tp = tbuffer; /* start copying here */ - if ((atoken->ticketLen < MINKTCTICKETLEN) || - (atoken->ticketLen > MAXKTCTICKETLEN)) return KTC_TOOBIG; - memcpy(tp, &atoken->ticketLen, sizeof(afs_int32)); /* copy in ticket length */ + tp = tbuffer; /* start copying here */ + if ((atoken->ticketLen < MINKTCTICKETLEN) + || (atoken->ticketLen > MAXKTCTICKETLEN)) + return KTC_TOOBIG; + memcpy(tp, &atoken->ticketLen, sizeof(afs_int32)); /* copy in ticket length */ tp += sizeof(afs_int32); - memcpy(tp, atoken->ticket, atoken->ticketLen); /* copy in ticket */ + memcpy(tp, atoken->ticket, atoken->ticketLen); /* copy in ticket */ tp += atoken->ticketLen; /* next, copy in the "clear token", describing who we are */ ct.AuthHandle = atoken->kvno; /* hide auth handle here */ @@ -307,25 +320,31 @@ afs_int32 flags; ct.BeginTimestamp = atoken->startTime; ct.EndTimestamp = atoken->endTime; - if (ct.BeginTimestamp == 0) ct.BeginTimestamp = 1; + if (ct.BeginTimestamp == 0) + ct.BeginTimestamp = 1; - if ((strlen(aclient->name) > strlen ("AFS ID ")) && - (aclient->instance[0] == 0)) { + if ((strlen(aclient->name) > strlen("AFS ID ")) + && (aclient->instance[0] == 0)) { int sign = 1; afs_int32 viceId = 0; - char *cp = aclient->name + strlen ("AFS ID "); - if (*cp == '-') { sign = -1; cp++; } + char *cp = aclient->name + strlen("AFS ID "); + if (*cp == '-') { + sign = -1; + cp++; + } while (*cp) { - if (isdigit(*cp)) viceId = viceId*10 + (int)(*cp - '0'); - else goto not_vice_id; + if (isdigit(*cp)) + viceId = viceId * 10 + (int)(*cp - '0'); + else + goto not_vice_id; cp++; } ct.ViceId = viceId * sign; /* OK to let any value here? */ if (((ct.EndTimestamp - ct.BeginTimestamp) & 1) == 0) ct.BeginTimestamp++; /* force lifetime to be odd */ } else { -not_vice_id: - ct.ViceId = getuid(); /* wrong, but works in primary cell */ + not_vice_id: + ct.ViceId = getuid(); /* wrong, but works in primary cell */ if (((ct.EndTimestamp - ct.BeginTimestamp) & 1) == 1) ct.BeginTimestamp++; /* force lifetime to be even */ } @@ -354,7 +373,7 @@ not_vice_id: * The following means that setpag will affect the parent process as * well as the current process. */ - if (flags & AFS_SETTOK_SETPAG) + if (flags & AFS_SETTOK_SETPAG) temp |= 0x8000; memcpy(tp, &temp, sizeof(afs_int32)); @@ -362,183 +381,193 @@ not_vice_id: /* finally copy in the cell name */ temp = strlen(aserver->cell); - if (temp >= MAXKTCREALMLEN) return KTC_TOOBIG; + if (temp >= MAXKTCREALMLEN) + return KTC_TOOBIG; strcpy(tp, aserver->cell); - tp += temp+1; + tp += temp + 1; /* now setup for the pioctl */ iob.in = tbuffer; - iob.in_size = tp-tbuffer; + iob.in_size = tp - tbuffer; iob.out = tbuffer; iob.out_size = sizeof(tbuffer); #if defined(NO_AFS_CLIENT) - { int fd; /* DEBUG */ - char *tkfile; - if ((tkfile=getenv("TKTFILE")) && - ((fd=open(tkfile, O_WRONLY|O_APPEND|O_TRUNC|O_CREAT, 0644)) >= 0)) { - printf("Writing ticket to: %s\n", tkfile); - code = (write(fd, iob.in, iob.in_size) != iob.in_size); - close(fd); - } - else - code = KTC_PIOCTLFAIL; + { + int fd; /* DEBUG */ + char *tkfile; + if ((tkfile = getenv("TKTFILE")) + && + ((fd = + open(tkfile, O_WRONLY | O_APPEND | O_TRUNC | O_CREAT, + 0644)) >= 0)) { + printf("Writing ticket to: %s\n", tkfile); + code = (write(fd, iob.in, iob.in_size) != iob.in_size); + close(fd); + } else + code = KTC_PIOCTLFAIL; } #else /* NO_AFS_CLIENT */ code = PIOCTL(0, VIOCSETTOK, &iob, 0); #endif /* NO_AFS_CLIENT */ - if (code) return KTC_PIOCTLFAIL; + if (code) + return KTC_PIOCTLFAIL; return 0; } -ktc_SetToken (aserver, atoken, aclient, flags) - struct ktc_principal *aserver; - struct ktc_principal *aclient; - struct ktc_token *atoken; - afs_int32 flags; +ktc_SetToken(aserver, atoken, aclient, flags) + struct ktc_principal *aserver; + struct ktc_principal *aclient; + struct ktc_token *atoken; + afs_int32 flags; { int ncode, ocode; LOCK_GLOBAL_MUTEX #ifdef AFS_KERBEROS_ENV - if (!lcell[0]) ktc_LocalCell(); - - if (/*!strcmp(aclient->cell, lcell) && this would only store local creds*/ - (strcmp(aserver->name, "AuthServer") || - strcmp(aserver->instance, "Admin"))){ - if (strcmp(aserver->name, "krbtgt") == 0) { - static char lrealm[MAXKTCREALMLEN]; - - if (!lrealm[0]) ucstring(lrealm, lcell, MAXKTCREALMLEN); - if (strcmp(aserver->instance, lrealm) == 0) { - afs_tf_create(aclient->name, aclient->instance); - } - } - - ncode = afs_tf_init(ktc_tkt_string(), W_TKT_FIL); - if (ncode == NO_TKT_FIL) { - (void) afs_tf_create(aclient->name, aclient->instance); - ncode = afs_tf_init(ktc_tkt_string(), W_TKT_FIL); - } - - if (!ncode) { - afs_tf_save_cred(aserver, atoken, aclient); - } - afs_tf_close(); + if (!lcell[0]) + ktc_LocalCell(); + + if ( /*!strcmp(aclient->cell, lcell) && this would only store local creds */ + (strcmp(aserver->name, "AuthServer") + || strcmp(aserver->instance, "Admin"))) { + if (strcmp(aserver->name, "krbtgt") == 0) { + static char lrealm[MAXKTCREALMLEN]; + + if (!lrealm[0]) + ucstring(lrealm, lcell, MAXKTCREALMLEN); + if (strcmp(aserver->instance, lrealm) == 0) { + afs_tf_create(aclient->name, aclient->instance); + } + } + + ncode = afs_tf_init(ktc_tkt_string(), W_TKT_FIL); + if (ncode == NO_TKT_FIL) { + (void)afs_tf_create(aclient->name, aclient->instance); + ncode = afs_tf_init(ktc_tkt_string(), W_TKT_FIL); + } + + if (!ncode) { + afs_tf_save_cred(aserver, atoken, aclient); + } + afs_tf_close(); #ifdef NO_AFS_CLIENT - UNLOCK_GLOBAL_MUTEX - return ncode; + UNLOCK_GLOBAL_MUTEX return ncode; #endif /* NO_AFS_CLIENT */ - } + } #endif #ifndef NO_AFS_CLIENT - ncode = NewSetToken (aserver, atoken, aclient, flags); - if (ncode || /* new style failed */ - (strcmp (aserver->name, "afs") == 0)) { /* for afs tokens do both */ - ocode = OldSetToken (aserver, atoken, aclient, flags); - } else ocode = 0; + ncode = NewSetToken(aserver, atoken, aclient, flags); + if (ncode || /* new style failed */ + (strcmp(aserver->name, "afs") == 0)) { /* for afs tokens do both */ + ocode = OldSetToken(aserver, atoken, aclient, flags); + } else + ocode = 0; if (ncode && ocode) { - UNLOCK_GLOBAL_MUTEX - if (ocode == -1) ocode = errno; - else if (ocode == KTC_PIOCTLFAIL) ocode = errno; - if (ocode == ESRCH) return KTC_NOCELL; - if (ocode == EINVAL) return KTC_NOPIOCTL; - if (ocode == EIO) return KTC_NOCM; + UNLOCK_GLOBAL_MUTEX if (ocode == -1) + ocode = errno; + else if (ocode == KTC_PIOCTLFAIL) + ocode = errno; + if (ocode == ESRCH) + return KTC_NOCELL; + if (ocode == EINVAL) + return KTC_NOPIOCTL; + if (ocode == EIO) + return KTC_NOCM; return KTC_PIOCTLFAIL; } #endif /* NO_AFS_CLIENT */ - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } /* get token, given server we need and token buffer. aclient will eventually * be set to our identity to the server. */ ktc_GetToken(aserver, atoken, atokenLen, aclient) -struct ktc_principal *aserver, *aclient; -int atokenLen; -struct ktc_token *atoken; { + struct ktc_principal *aserver, *aclient; + int atokenLen; + struct ktc_token *atoken; +{ struct ViceIoctl iob; - char tbuffer[1024]; + char tbuffer[MAXPIOCTLTOKENLEN]; register afs_int32 code; int index; - char *stp, *cellp; /* secret token ptr */ + char *stp, *cellp; /* secret token ptr */ struct ClearToken ct; register char *tp; afs_int32 temp; - int maxLen; /* biggest ticket we can copy */ - int tktLen; /* server ticket length */ + int maxLen; /* biggest ticket we can copy */ + int tktLen; /* server ticket length */ char found = 0; - + LOCK_GLOBAL_MUTEX #ifndef NO_AFS_CLIENT - TRY_KERNEL (KTC_GETTOKEN_OP, aserver, aclient, atoken, atokenLen); + TRY_KERNEL(KTC_GETTOKEN_OP, aserver, aclient, atoken, atokenLen); #endif /* NO_AFS_CLIENT */ #ifdef AFS_KERBEROS_ENV - if (!lcell[0]) ktc_LocalCell(); + if (!lcell[0]) + ktc_LocalCell(); #endif #ifndef NO_AFS_CLIENT - if (strcmp(aserver->name, "afs") != 0) + if (strcmp(aserver->name, "afs") != 0) #endif /* NO_AFS_CLIENT */ - { + { int i; /* try the local tokens */ - for (i=0; iname) == 0) && - (strcmp (local_tokens[i].server.instance, aserver->instance) == 0) && - (strcmp (local_tokens[i].server.cell, aserver->cell) == 0)) { - memcpy (atoken, &local_tokens[i].token, min (atokenLen, sizeof(struct ktc_token))); + for (i = 0; i < MAXLOCALTOKENS; i++) + if (local_tokens[i].valid + && (strcmp(local_tokens[i].server.name, aserver->name) == 0) + && (strcmp(local_tokens[i].server.instance, aserver->instance) + == 0) + && (strcmp(local_tokens[i].server.cell, aserver->cell) == 0)) { + memcpy(atoken, &local_tokens[i].token, + min(atokenLen, sizeof(struct ktc_token))); if (aclient) *aclient = local_tokens[i].client; - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } #ifdef AFS_KERBEROS_ENV - if (!afs_tf_init(ktc_tkt_string(), R_TKT_FIL)) { - if (aclient) { - if (!afs_tf_get_pname(aclient->name) && - !afs_tf_get_pinst(aclient->instance)) - found = 1; - } else { - char tmpstring[MAXHOSTCHARS]; - afs_tf_get_pname(&tmpstring); - afs_tf_get_pinst(&tmpstring); - found = 1; - } - } - if (found) { - struct ktc_principal cprincipal; - struct ktc_token ctoken; - - while (!afs_tf_get_cred(&cprincipal, &ctoken)) { - if (strcmp(cprincipal.name, aserver->name) == 0 && - strcmp(cprincipal.instance, aserver->instance) == 0 && - strcmp(cprincipal.cell, aserver->cell) == 0) { - + if (!afs_tf_init(ktc_tkt_string(), R_TKT_FIL)) { + if (aclient) { + if (!afs_tf_get_pname(aclient->name) + && !afs_tf_get_pinst(aclient->instance)) + found = 1; + } else { + char tmpstring[MAXHOSTCHARS]; + afs_tf_get_pname(&tmpstring); + afs_tf_get_pinst(&tmpstring); + found = 1; + } + } + if (found) { + struct ktc_principal cprincipal; + struct ktc_token ctoken; + + while (!afs_tf_get_cred(&cprincipal, &ctoken)) { + if (strcmp(cprincipal.name, aserver->name) == 0 + && strcmp(cprincipal.instance, aserver->instance) == 0 + && strcmp(cprincipal.cell, aserver->cell) == 0) { + if (aclient) strcpy(aclient->cell, lcell); - memcpy(atoken, &ctoken, - min (atokenLen, sizeof(struct ktc_token))); - - afs_tf_close(); - UNLOCK_GLOBAL_MUTEX - return 0; - } - } - } - afs_tf_close(); + memcpy(atoken, &ctoken, + min(atokenLen, sizeof(struct ktc_token))); + + afs_tf_close(); + UNLOCK_GLOBAL_MUTEX return 0; + } + } + } + afs_tf_close(); #endif - UNLOCK_GLOBAL_MUTEX - return KTC_NOENT; + UNLOCK_GLOBAL_MUTEX return KTC_NOENT; } - #ifndef NO_AFS_CLIENT - for (index=0; index<200; index++) { /* sanity check in case pioctl fails */ - iob.in = (char *) &index; + for (index = 0; index < 200; index++) { /* sanity check in case pioctl fails */ + iob.in = (char *)&index; iob.in_size = sizeof(afs_int32); iob.out = tbuffer; iob.out_size = sizeof(tbuffer); @@ -548,8 +577,7 @@ struct ktc_token *atoken; { if (code) { /* failed to retrieve specified token */ if (code < 0 && errno == EDOM) { - UNLOCK_GLOBAL_MUTEX - return KTC_NOENT; + UNLOCK_GLOBAL_MUTEX return KTC_NOENT; } } else { /* token retrieved; parse buffer */ @@ -567,8 +595,7 @@ struct ktc_token *atoken; { /* get size of clear token and verify */ memcpy(&temp, tp, sizeof(afs_int32)); if (temp != sizeof(struct ClearToken)) { - UNLOCK_GLOBAL_MUTEX - return KTC_ERROR; + UNLOCK_GLOBAL_MUTEX return KTC_ERROR; } tp += sizeof(afs_int32); @@ -588,10 +615,10 @@ struct ktc_token *atoken; { #endif ) { /* got token for cell; check that it will fit */ - maxLen = atokenLen - sizeof(struct ktc_token) + MAXKTCTICKETLEN; + maxLen = + atokenLen - sizeof(struct ktc_token) + MAXKTCTICKETLEN; if (maxLen < tktLen) { - UNLOCK_GLOBAL_MUTEX - return KTC_TOOBIG; + UNLOCK_GLOBAL_MUTEX return KTC_TOOBIG; } /* set return values */ @@ -602,30 +629,30 @@ struct ktc_token *atoken; { ct.AuthHandle = 999; } atoken->kvno = ct.AuthHandle; - memcpy(&atoken->sessionKey, ct.HandShakeKey, sizeof(struct ktc_encryptionKey)); + memcpy(&atoken->sessionKey, ct.HandShakeKey, + sizeof(struct ktc_encryptionKey)); atoken->ticketLen = tktLen; if (aclient) { strcpy(aclient->cell, cellp); aclient->instance[0] = 0; - if ((atoken->kvno == 999) || /* old style bcrypt ticket */ - (ct.BeginTimestamp && /* new w/ prserver lookup */ + if ((atoken->kvno == 999) || /* old style bcrypt ticket */ + (ct.BeginTimestamp && /* new w/ prserver lookup */ (((ct.EndTimestamp - ct.BeginTimestamp) & 1) == 1))) { sprintf(aclient->name, "AFS ID %d", ct.ViceId); } else { sprintf(aclient->name, "Unix UID %d", ct.ViceId); } } - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } } } #endif /* NO_AFS_CLIENT */ - UNLOCK_GLOBAL_MUTEX - if ((code < 0) && (errno == EINVAL)) return KTC_NOPIOCTL; + UNLOCK_GLOBAL_MUTEX if ((code < 0) && (errno == EINVAL)) + return KTC_NOPIOCTL; return KTC_PIOCTLFAIL; /* probable cause */ } @@ -635,15 +662,14 @@ struct ktc_token *atoken; { */ #ifndef NO_AFS_CLIENT ktc_ForgetToken(aserver) -struct ktc_principal *aserver; { + struct ktc_principal *aserver; +{ int rc; - LOCK_GLOBAL_MUTEX - TRY_KERNEL (KTC_FORGETTOKEN_OP, aserver, 0,0,0); + LOCK_GLOBAL_MUTEX TRY_KERNEL(KTC_FORGETTOKEN_OP, aserver, 0, 0, 0); rc = ktc_ForgetAllTokens(); /* bogus, but better */ - UNLOCK_GLOBAL_MUTEX - return rc; + UNLOCK_GLOBAL_MUTEX return rc; } #endif /* NO_AFS_CLIENT */ @@ -652,97 +678,96 @@ struct ktc_principal *aserver; { * success. */ ktc_ListTokens(aprevIndex, aindex, aserver) -int aprevIndex, *aindex; -struct ktc_principal *aserver; { + int aprevIndex, *aindex; + struct ktc_principal *aserver; +{ struct ViceIoctl iob; - char tbuffer[1024]; + char tbuffer[MAXPIOCTLTOKENLEN]; register afs_int32 code; register char *tp; afs_int32 temp, index; + memset(tbuffer, 0, sizeof(tbuffer)); + LOCK_GLOBAL_MUTEX #ifndef NO_AFS_CLIENT - TRY_KERNEL (KTC_LISTTOKENS_OP, aserver, aprevIndex, aindex, 0); + TRY_KERNEL(KTC_LISTTOKENS_OP, aserver, aprevIndex, aindex, 0); #endif /* NO_AFS_CLIENT */ index = aprevIndex; #ifdef NO_AFS_CLIENT - if (index < 214) index = 214; + if (index < 214) + index = 214; #endif /* NO_AFS_CLIENT */ #ifdef AFS_KERBEROS_ENV - if (index >= 214) { - int i; - struct ktc_principal cprincipal; - struct ktc_token ctoken; - - if (afs_tf_init(ktc_tkt_string(), R_TKT_FIL) || - afs_tf_get_pname(tbuffer) || - afs_tf_get_pinst(tbuffer)) { - afs_tf_close(); - UNLOCK_GLOBAL_MUTEX - return KTC_NOENT; - } - - for (i=214; i= 214) { + int i; + struct ktc_principal cprincipal; + struct ktc_token ctoken; + + if (afs_tf_init(ktc_tkt_string(), R_TKT_FIL) + || afs_tf_get_pname(tbuffer) || afs_tf_get_pinst(tbuffer)) { + afs_tf_close(); + UNLOCK_GLOBAL_MUTEX return KTC_NOENT; + } + + for (i = 214; i < index; i++) { + if (afs_tf_get_cred(&cprincipal, &ctoken)) { + afs_tf_close(); + UNLOCK_GLOBAL_MUTEX return KTC_NOENT; + } + } + + again: + if (afs_tf_get_cred(&cprincipal, &ctoken)) { + afs_tf_close(); + UNLOCK_GLOBAL_MUTEX return KTC_NOENT; + } + index++; + #ifndef NO_AFS_CLIENT - if (!strcmp(cprincipal.name, "afs") && cprincipal.instance[0]==0) { - goto again; - } + if (!strcmp(cprincipal.name, "afs") && cprincipal.instance[0] == 0) { + goto again; + } #endif /* NO_AFS_CLIENT */ - - for (i=0; i < MAXLOCALTOKENS; i++) { - if (!strcmp(cprincipal.name, local_tokens[i].server.name) && - !strcmp(cprincipal.instance, local_tokens[i].server.instance) && - !strcmp(cprincipal.cell, local_tokens[i].server.cell)) { - goto again; - } - } - - *aserver = cprincipal; - *aindex = index; - afs_tf_close(); - UNLOCK_GLOBAL_MUTEX - return 0; - } + + for (i = 0; i < MAXLOCALTOKENS; i++) { + if (!strcmp(cprincipal.name, local_tokens[i].server.name) + && !strcmp(cprincipal.instance, + local_tokens[i].server.instance) + && !strcmp(cprincipal.cell, local_tokens[i].server.cell)) { + goto again; + } + } + + *aserver = cprincipal; + *aindex = index; + afs_tf_close(); + UNLOCK_GLOBAL_MUTEX return 0; + } #endif #ifndef NO_AFS_CLIENT - if (index >= 123) { /* special hack for returning TCS */ - while (index-123 < MAXLOCALTOKENS) { - if (local_tokens[index-123].valid) { - *aserver = local_tokens[index-123].server; - *aindex = index+1; - UNLOCK_GLOBAL_MUTEX - return 0; + if (index >= 123) { /* special hack for returning TCS */ + while (index - 123 < MAXLOCALTOKENS) { + if (local_tokens[index - 123].valid) { + *aserver = local_tokens[index - 123].server; + *aindex = index + 1; + UNLOCK_GLOBAL_MUTEX return 0; } index++; } UNLOCK_GLOBAL_MUTEX #ifdef AFS_KERBEROS_ENV - return ktc_ListTokens(214, aindex, aserver); + return ktc_ListTokens(214, aindex, aserver); #else - return KTC_NOENT; + return KTC_NOENT; #endif } /* get tokens from the kernel */ - while (index<200) { /* sanity check in case pioctl fails */ - iob.in = (char *) &index; + while (index < 200) { /* sanity check in case pioctl fails */ + iob.in = (char *)&index; iob.in_size = sizeof(afs_int32); iob.out = tbuffer; iob.out_size = sizeof(tbuffer); @@ -750,22 +775,20 @@ struct ktc_principal *aserver; { if (code < 0 && errno == EDOM) { if (index < 123) { int rc; - rc = ktc_ListTokens (123, aindex, aserver); - UNLOCK_GLOBAL_MUTEX - return rc; - } - else { - UNLOCK_GLOBAL_MUTEX - return KTC_NOENT; + rc = ktc_ListTokens(123, aindex, aserver); + UNLOCK_GLOBAL_MUTEX return rc; + } else { + UNLOCK_GLOBAL_MUTEX return KTC_NOENT; } } - if (code == 0) break; /* got a ticket */ + if (code == 0) + break; /* got a ticket */ /* otherwise we should skip this ticket slot */ index++; } if (code < 0) { - UNLOCK_GLOBAL_MUTEX - if (errno == EINVAL) return KTC_NOPIOCTL; + UNLOCK_GLOBAL_MUTEX if (errno == EINVAL) + return KTC_NOPIOCTL; return KTC_PIOCTLFAIL; } @@ -773,45 +796,46 @@ struct ktc_principal *aserver; { tp = tbuffer; /* next iterator determined by earlier loop */ - *aindex = index+1; + *aindex = index + 1; - memcpy(&temp, tp, sizeof(afs_int32)); /* get size of secret token */ + memcpy(&temp, tp, sizeof(afs_int32)); /* get size of secret token */ tp += sizeof(afs_int32); - tp += temp; /* skip ticket for now */ - memcpy(&temp, tp, sizeof(afs_int32)); /* get size of clear token */ + tp += temp; /* skip ticket for now */ + memcpy(&temp, tp, sizeof(afs_int32)); /* get size of clear token */ if (temp != sizeof(struct ClearToken)) { - UNLOCK_GLOBAL_MUTEX - return KTC_ERROR; + UNLOCK_GLOBAL_MUTEX return KTC_ERROR; } - tp += sizeof(afs_int32); /* skip length */ - tp += temp; /* skip clear token itself */ - tp += sizeof(afs_int32); /* skip primary flag */ + tp += sizeof(afs_int32); /* skip length */ + tp += temp; /* skip clear token itself */ + tp += sizeof(afs_int32); /* skip primary flag */ /* tp now points to the cell name */ strcpy(aserver->cell, tp); aserver->instance[0] = 0; strcpy(aserver->name, "afs"); #endif /* NO_AFS_CLIENT */ - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } /* discard all tokens from this user's cache */ -static int NewForgetAll () +static int +NewForgetAll() { #ifndef NO_AFS_CLIENT - TRY_KERNEL (KTC_FORGETALLTOKENS_OP, 0,0,0,0); + TRY_KERNEL(KTC_FORGETALLTOKENS_OP, 0, 0, 0, 0); #endif /* NO_AFS_CLIENT */ return EINVAL; } -static int OldForgetAll () +static int +OldForgetAll() { struct ViceIoctl iob; register afs_int32 code; int i; - for (i=0; i. */ - + #if 0 #include #include @@ -880,12 +906,12 @@ ktc_OldPioctl () #include #include #endif - + #define TOO_BIG -1 #define TF_LCK_RETRY ((unsigned)2) /* seconds to sleep before - * retry if ticket file is - * locked */ - + * retry if ticket file is + * locked */ + /* * fd must be initialized to something that won't ever occur as a real * file descriptor. Since open(2) returns only non-negative numbers as @@ -899,13 +925,13 @@ ktc_OldPioctl () * c. In tf_close, be sure it gets reinitialized to a negative * number. */ -static fd = -1; -static curpos; /* Position in tfbfr */ -static lastpos; /* End of tfbfr */ -static char tfbfr[BUFSIZ]; /* Buffer for ticket data */ - +static fd = -1; +static curpos; /* Position in tfbfr */ +static lastpos; /* End of tfbfr */ +static char tfbfr[BUFSIZ]; /* Buffer for ticket data */ + static tf_gets(), tf_read(); - + /* * This file contains routines for manipulating the ticket cache file. * @@ -968,39 +994,39 @@ static tf_gets(), tf_read(); * TKT_FIL_ACC - file was in wrong mode, etc. * TKT_FIL_LCK - couldn't lock the file, even after a retry */ - + afs_tf_init(tf_name, rw) - char *tf_name; + char *tf_name; { - int wflag; - int me; - struct stat stat_buf; - - switch (rw) { - case R_TKT_FIL: - wflag = 0; - break; - case W_TKT_FIL: - wflag = 1; - break; - default: - return TKT_FIL_ACC; - } - if (lstat(tf_name, &stat_buf) < 0) - switch (errno) { - case ENOENT: - return NO_TKT_FIL; - default: - return TKT_FIL_ACC; - } - me = getuid(); - if ((stat_buf.st_uid != me && me != 0) || - ((stat_buf.st_mode & S_IFMT) != S_IFREG)) - return TKT_FIL_ACC; - - /* - * If "wflag" is set, open the ticket file in append-writeonly mode - * and lock the ticket file in exclusive mode. If unable to lock + int wflag; + int me; + struct stat stat_buf; + + switch (rw) { + case R_TKT_FIL: + wflag = 0; + break; + case W_TKT_FIL: + wflag = 1; + break; + default: + return TKT_FIL_ACC; + } + if (lstat(tf_name, &stat_buf) < 0) + switch (errno) { + case ENOENT: + return NO_TKT_FIL; + default: + return TKT_FIL_ACC; + } + me = getuid(); + if ((stat_buf.st_uid != me && me != 0) + || ((stat_buf.st_mode & S_IFMT) != S_IFREG)) + return TKT_FIL_ACC; + + /* + * If "wflag" is set, open the ticket file in append-writeonly mode + * and lock the ticket file in exclusive mode. If unable to lock * the file, sleep and try again. If we fail again, return with the * proper error message. */ @@ -1013,15 +1039,15 @@ afs_tf_init(tf_name, rw) return TKT_FIL_ACC; } #if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) - if (fcntl(fd, F_SETLK, &fileWlock) == -1) { + if (fcntl(fd, F_SETLK, &fileWlock) == -1) { sleep(TF_LCK_RETRY); - if (fcntl(fd, F_SETLK, &fileWlock) == -1) { + if (fcntl(fd, F_SETLK, &fileWlock) == -1) { #else if (flock(fd, LOCK_EX | LOCK_NB) < 0) { sleep(TF_LCK_RETRY); if (flock(fd, LOCK_EX | LOCK_NB) < 0) { #endif - (void) close(fd); + (void)close(fd); fd = -1; return TKT_FIL_LCK; } @@ -1038,15 +1064,15 @@ afs_tf_init(tf_name, rw) return TKT_FIL_ACC; } #if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) - if (fcntl(fd, F_SETLK, &fileRlock) == -1) { + if (fcntl(fd, F_SETLK, &fileRlock) == -1) { sleep(TF_LCK_RETRY); - if (fcntl(fd, F_SETLK, &fileRlock) == -1) { + if (fcntl(fd, F_SETLK, &fileRlock) == -1) { #else if (flock(fd, LOCK_SH | LOCK_NB) < 0) { sleep(TF_LCK_RETRY); if (flock(fd, LOCK_SH | LOCK_NB) < 0) { #endif - (void) close(fd); + (void)close(fd); fd = -1; return TKT_FIL_LCK; } @@ -1064,7 +1090,7 @@ afs_tf_init(tf_name, rw) */ afs_tf_get_pname(p) - char *p; + char *p; { if (fd < 0) { return TKT_FIL_INI; @@ -1085,7 +1111,7 @@ afs_tf_get_pname(p) */ afs_tf_get_pinst(inst) - char *inst; + char *inst; { if (fd < 0) { return TKT_FIL_INI; @@ -1107,11 +1133,11 @@ afs_tf_get_pinst(inst) */ afs_tf_get_cred(principal, token) - struct ktc_principal *principal; - struct ktc_token *token; + struct ktc_principal *principal; + struct ktc_token *token; { - int k_errno; - int kvno, lifetime; + int k_errno; + int kvno, lifetime; if (fd < 0) { return TKT_FIL_INI; @@ -1140,17 +1166,16 @@ afs_tf_get_cred(principal, token) return EOF; } lcstring(principal->cell, principal->cell, MAXKTCREALMLEN); - if ( - tf_read((char *) &(token->sessionKey), 8) < 1 || - tf_read((char *) &(lifetime), sizeof(lifetime)) < 1 || - tf_read((char *) &(kvno), sizeof(kvno)) < 1 || - tf_read((char *) &(token->ticketLen), sizeof(token->ticketLen)) + if (tf_read((char *)&(token->sessionKey), 8) < 1 + || tf_read((char *)&(lifetime), sizeof(lifetime)) < 1 + || tf_read((char *)&(kvno), sizeof(kvno)) < 1 + || tf_read((char *)&(token->ticketLen), sizeof(token->ticketLen)) < 1 || - /* don't try to read a silly amount into ticket->dat */ - token->ticketLen > MAXKTCTICKETLEN || - tf_read((char *) (token->ticket), token->ticketLen) < 1 || - tf_read((char *) &(token->startTime), sizeof(token->startTime)) < 1 - ) { + /* don't try to read a silly amount into ticket->dat */ + token->ticketLen > MAXKTCTICKETLEN + || tf_read((char *)(token->ticket), token->ticketLen) < 1 + || tf_read((char *)&(token->startTime), + sizeof(token->startTime)) < 1) { return TKT_FIL_FMT; } token->endTime = life_to_time(token->startTime, lifetime); @@ -1170,11 +1195,11 @@ afs_tf_close() { if (!(fd < 0)) { #if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) - (void) fcntl(fd, F_SETLK, &fileUlock); + (void)fcntl(fd, F_SETLK, &fileUlock); #else - (void) flock(fd, LOCK_UN); -#endif - (void) close(fd); + (void)flock(fd, LOCK_UN); +#endif + (void)close(fd); fd = -1; /* see declaration of fd above */ } memset(tfbfr, 0, sizeof(tfbfr)); @@ -1198,9 +1223,9 @@ afs_tf_close() * file is seriously ill. */ -static +static tf_gets(s, n) - register char *s; + register char *s; { register count; @@ -1216,7 +1241,7 @@ tf_gets(s, n) return 0; } *s = tfbfr[curpos++]; - if (*s++== '\0') + if (*s++ == '\0') return (n - count); } return TOO_BIG; @@ -1236,11 +1261,11 @@ tf_gets(s, n) static tf_read(s, n) - register char *s; - register n; + register char *s; + register n; { register count; - + for (count = n; count > 0; --count) { if (curpos >= sizeof(tfbfr)) { lastpos = read(fd, tfbfr, sizeof(tfbfr)); @@ -1253,8 +1278,8 @@ tf_read(s, n) } return n; } - -char *tkt_string(); + +char *tkt_string(); /* * afs_tf_save_cred() appends an incoming ticket to the end of the ticket @@ -1268,47 +1293,50 @@ char *tkt_string(); */ afs_tf_save_cred(aserver, atoken, aclient) - struct ktc_principal *aserver; - struct ktc_principal *aclient; - struct ktc_token *atoken; /* Token */ + struct ktc_principal *aserver; + struct ktc_principal *aclient; + struct ktc_token *atoken; /* Token */ { - char realm[MAXKTCREALMLEN+1]; + char realm[MAXKTCREALMLEN + 1]; char junk[MAXKTCNAMELEN]; struct ktc_principal principal; struct ktc_token token; - int status; - off_t start; - int lifetime, kvno; - int count; /* count for write */ + int status; + off_t start; + int lifetime, kvno; + int count; /* count for write */ if (fd < 0) { /* fd is ticket file as set by afs_tf_init */ - return TKT_FIL_INI; + return TKT_FIL_INI; } ucstring(realm, aserver->cell, MAXKTCREALMLEN); realm[MAXKTCREALMLEN] = '\0'; /* Look for a duplicate ticket */ - (void) lseek(fd, (off_t) 0L, 0); + (void)lseek(fd, (off_t) 0L, 0); curpos = sizeof(tfbfr); - if (afs_tf_get_pname(junk) || strcmp(junk, aclient->name) || - afs_tf_get_pinst(junk) || strcmp(junk, aclient->instance)) goto bad; + if (afs_tf_get_pname(junk) || strcmp(junk, aclient->name) + || afs_tf_get_pinst(junk) || strcmp(junk, aclient->instance)) + goto bad; do { start = lseek(fd, (off_t) 0L, 1) - lastpos + curpos; status = afs_tf_get_cred(&principal, &token); - } while (status == 0 && - (strcmp(aserver->name, principal.name) != 0 || - strcmp(aserver->instance, principal.instance) != 0 || - strcmp(aserver->cell, principal.cell) != 0)); + } while (status == 0 + && (strcmp(aserver->name, principal.name) != 0 + || strcmp(aserver->instance, principal.instance) != 0 + || strcmp(aserver->cell, principal.cell) != 0)); /* * Two tickets for the same user authenticating to the same service * should be the same length, but we check here just to make sure. */ - if (status == 0 && token.ticketLen != atoken->ticketLen) return KFAILURE; - if (status && status != EOF) return status; + if (status == 0 && token.ticketLen != atoken->ticketLen) + return KFAILURE; + if (status && status != EOF) + return status; /* Position over the credential we just matched (or the EOF) */ lseek(fd, start, 0); @@ -1328,32 +1356,31 @@ afs_tf_save_cred(aserver, atoken, aclient) if (write(fd, realm, count) != count) goto bad; /* Session key */ - if (write(fd, (char *) &atoken->sessionKey, 8) != 8) + if (write(fd, (char *)&atoken->sessionKey, 8) != 8) goto bad; /* Lifetime */ lifetime = time_to_life(atoken->startTime, atoken->endTime); - if (write(fd, (char *) &lifetime, sizeof(int)) != sizeof(int)) + if (write(fd, (char *)&lifetime, sizeof(int)) != sizeof(int)) goto bad; /* Key vno */ kvno = atoken->kvno; - if (write(fd, (char *) &kvno, sizeof(int)) != sizeof(int)) + if (write(fd, (char *)&kvno, sizeof(int)) != sizeof(int)) goto bad; /* Tkt length */ - if (write(fd, (char *) &(atoken->ticketLen), sizeof(int)) != - sizeof(int)) + if (write(fd, (char *)&(atoken->ticketLen), sizeof(int)) != sizeof(int)) goto bad; /* Ticket */ count = atoken->ticketLen; if (write(fd, atoken->ticket, count) != count) goto bad; /* Issue date */ - if (write(fd, (char *) &atoken->startTime, sizeof(afs_int32)) + if (write(fd, (char *)&atoken->startTime, sizeof(afs_int32)) != sizeof(afs_int32)) goto bad; /* Actually, we should check each write for success */ return (0); -bad: + bad: return (KFAILURE); } @@ -1383,24 +1410,23 @@ char *getenv(); static char krb_ticket_string[4096] = ""; -char *ktc_tkt_string() +char * +ktc_tkt_string() { char *env; - LOCK_GLOBAL_MUTEX - if (!*krb_ticket_string) { - if (env = getenv("KRBTKFILE")) { - (void) strncpy(krb_ticket_string, env, - sizeof(krb_ticket_string)-1); - krb_ticket_string[sizeof(krb_ticket_string)-1] = '\0'; + LOCK_GLOBAL_MUTEX if (!*krb_ticket_string) { + if (env = getenv("KRBTKFILE")) { + (void)strncpy(krb_ticket_string, env, + sizeof(krb_ticket_string) - 1); + krb_ticket_string[sizeof(krb_ticket_string) - 1] = '\0'; } else { /* 32 bits of signed integer will always fit in 11 characters - (including the sign), so no need to worry about overflow */ - (void) sprintf(krb_ticket_string, "%s%d",TKT_ROOT,getuid()); - } + * (including the sign), so no need to worry about overflow */ + (void)sprintf(krb_ticket_string, "%s%d", TKT_ROOT, getuid()); + } } - UNLOCK_GLOBAL_MUTEX - return krb_ticket_string; + UNLOCK_GLOBAL_MUTEX return krb_ticket_string; } /* @@ -1416,15 +1442,13 @@ char *ktc_tkt_string() void ktc_set_tkt_string(val) -char *val; + char *val; { - LOCK_GLOBAL_MUTEX - (void) strncpy(krb_ticket_string, val, sizeof(krb_ticket_string)-1); - krb_ticket_string[sizeof(krb_ticket_string)-1] = '\0'; - UNLOCK_GLOBAL_MUTEX - - return; + LOCK_GLOBAL_MUTEX(void) strncpy(krb_ticket_string, val, + sizeof(krb_ticket_string) - 1); + krb_ticket_string[sizeof(krb_ticket_string) - 1] = '\0'; + UNLOCK_GLOBAL_MUTEX return; } /* @@ -1434,9 +1458,9 @@ char *val; * success, or KFAILURE if something goes wrong. */ -afs_tf_create(pname,pinst) - char *pname; - char *pinst; +afs_tf_create(pname, pinst) + char *pname; + char *pinst; { int tktfile; int me, metoo; @@ -1447,63 +1471,63 @@ afs_tf_create(pname,pinst) char zerobuf[1024]; struct stat sbuf; - me = getuid (); + me = getuid(); metoo = geteuid(); - if (lstat(file,&sbuf) == 0) { - if ((sbuf.st_uid != me && me != 0) || ((sbuf.st_mode & S_IFMT) != S_IFREG) || - sbuf.st_mode & 077) { + if (lstat(file, &sbuf) == 0) { + if ((sbuf.st_uid != me && me != 0) + || ((sbuf.st_mode & S_IFMT) != S_IFREG) || sbuf.st_mode & 077) { return KFAILURE; } /* file already exists, and permissions appear ok, so nuke it */ if ((fd = open(file, O_RDWR, 0)) < 0) - goto out; /* can't zero it, but we can still try truncating it */ + goto out; /* can't zero it, but we can still try truncating it */ memset(zerobuf, 0, sizeof(zerobuf)); for (i = 0; i < sbuf.st_size; i += sizeof(zerobuf)) if (write(fd, zerobuf, sizeof(zerobuf)) != sizeof(zerobuf)) { - (void) fsync(fd); - (void) close(fd); + (void)fsync(fd); + (void)close(fd); goto out; } - - (void) fsync(fd); - (void) close(fd); + + (void)fsync(fd); + (void)close(fd); } - out: + out: /* arrange so the file is owned by the ruid - (swap real & effective uid if necessary). - This isn't a security problem, since the ticket file, if it already - exists, has the right uid (== ruid) and mode. */ + * (swap real & effective uid if necessary). + * This isn't a security problem, since the ticket file, if it already + * exists, has the right uid (== ruid) and mode. */ if (me != metoo) { if (setreuid(metoo, me) < 0) { - return(KFAILURE); + return (KFAILURE); } } tktfile = creat(file, 0600); if (me != metoo) { if (setreuid(me, metoo) < 0) { /* can't switch??? fail! */ - return(KFAILURE); + return (KFAILURE); } } if (tktfile < 0) { - return(KFAILURE); + return (KFAILURE); } - count = strlen(pname)+1; - if (write(tktfile,pname,count) != count) { - (void) close(tktfile); - return(KFAILURE); + count = strlen(pname) + 1; + if (write(tktfile, pname, count) != count) { + (void)close(tktfile); + return (KFAILURE); } - count = strlen(pinst)+1; - if (write(tktfile,pinst,count) != count) { - (void) close(tktfile); - return(KFAILURE); + count = strlen(pinst) + 1; + if (write(tktfile, pinst, count) != count) { + (void)close(tktfile); + return (KFAILURE); } - (void) close(tktfile); - return(KSUCCESS); + (void)close(tktfile); + return (KSUCCESS); } /* @@ -1516,12 +1540,12 @@ afs_tf_create(pname,pinst) afs_tf_dest_tkt() { char *file = ktc_tkt_string(); - int i,fd; + int i, fd; struct stat statb; char buf[BUFSIZ]; errno = 0; - if (lstat(file,&statb) < 0) + if (lstat(file, &statb) < 0) goto out; if (!(statb.st_mode & S_IFREG)) @@ -1534,32 +1558,36 @@ afs_tf_dest_tkt() for (i = 0; i < statb.st_size; i += BUFSIZ) if (write(fd, buf, BUFSIZ) != BUFSIZ) { - (void) fsync(fd); - (void) close(fd); + (void)fsync(fd); + (void)close(fd); goto out; } - (void) fsync(fd); - (void) close(fd); + (void)fsync(fd); + (void)close(fd); - (void) unlink(file); + (void)unlink(file); -out: - if (errno == ENOENT) return RET_TKFIL; - else if (errno != 0) return KFAILURE; + out: + if (errno == ENOENT) + return RET_TKFIL; + else if (errno != 0) + return KFAILURE; return 0; } -static afs_uint32 curpag() +static afs_uint32 +curpag() { gid_t groups[NGROUPS_MAX]; afs_uint32 g0, g1; afs_uint32 h, l, ret; - if (getgroups(sizeof groups/sizeof groups[0], groups) < 2) return 0; + if (getgroups(sizeof groups / sizeof groups[0], groups) < 2) + return 0; - g0 = groups[0] & 0xffff; - g1 = groups[1] & 0xffff; + g0 = groups[0] & 0xffff; + g1 = groups[1] & 0xffff; g0 -= 0x3f00; g1 -= 0x3f00; if (g0 < 0xc000 && g1 < 0xc000) { @@ -1575,7 +1603,7 @@ static afs_uint32 curpag() } return -1; } - + ktc_newpag() { @@ -1587,25 +1615,25 @@ ktc_newpag() int numenv; char **newenv, **senv, **denv; - LOCK_GLOBAL_MUTEX - if (stat("/ticket", &sbuf) == -1) { + LOCK_GLOBAL_MUTEX if (stat("/ticket", &sbuf) == -1) { prefix = "/tmp/tkt"; } pag = curpag() & 0xffffffff; if (pag == -1) { sprintf(fname, "%s%d", prefix, getuid()); - } - else { + } else { sprintf(fname, "%sp%ld", prefix, pag); } ktc_set_tkt_string(fname); - for (senv=environ, numenv=0; *senv; senv++) numenv++; - newenv = (char **)malloc((numenv+2) * sizeof(char *)); + for (senv = environ, numenv = 0; *senv; senv++) + numenv++; + newenv = (char **)malloc((numenv + 2) * sizeof(char *)); - for (senv=environ, denv=newenv; *senv; *senv++) { - if (strncmp(*senv, "KRBTKFILE=", 10) != 0) *denv++ = *senv; + for (senv = environ, denv = newenv; *senv; *senv++) { + if (strncmp(*senv, "KRBTKFILE=", 10) != 0) + *denv++ = *senv; } *denv = (char *)malloc(10 + strlen(fname) + 1); @@ -1613,22 +1641,22 @@ ktc_newpag() strcat(*denv, fname); *++denv = 0; environ = newenv; - UNLOCK_GLOBAL_MUTEX -} +UNLOCK_GLOBAL_MUTEX} /* * BLETCH! We have to invoke the entire afsconf package just to * find out what the local cell is. */ -static ktc_LocalCell() +static void +ktc_LocalCell() { int code; struct afsconf_dir *conf; - if ((conf = afsconf_Open (AFSDIR_CLIENT_ETC_DIRPATH)) || - (conf = afsconf_Open (AFSDIR_SERVER_ETC_DIRPATH ))) { - code = afsconf_GetLocalCell (conf, lcell, sizeof(lcell)); - afsconf_Close (conf); + if ((conf = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH)) + || (conf = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH))) { + code = afsconf_GetLocalCell(conf, lcell, sizeof(lcell)); + afsconf_Close(conf); } if (!conf || code) { printf("** Can't determine local cell name!\n"); diff --git a/src/auth/ktc_nt.c b/src/auth/ktc_nt.c index e75287c88..7b5aa5a50 100644 --- a/src/auth/ktc_nt.c +++ b/src/auth/ktc_nt.c @@ -12,7 +12,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/auth/ktc_nt.c,v 1.1.1.6 2002/01/22 19:52:29 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/auth/ktc_nt.c,v 1.16 2004/04/04 02:35:47 jaltman Exp $"); #include #include @@ -25,27 +26,30 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/ktc_nt.c,v 1.1.1.6 2002/01/22 19:5 #include #include #include -#include "../WINNT/afsd/afsrpc.h" +#include "afs/afsrpc.h" #include #include "auth.h" #include +/* TBUFFERSIZE must be at least 512 larger than KTCMAXTICKETSIZE */ +#define TBUFFERSIZE 12512 /* Forward declarations for local token cache. */ static int SetLocalToken(struct ktc_principal *aserver, struct ktc_token *atoken, - struct ktc_principal *aclient, - afs_int32 flags); + struct ktc_principal *aclient, afs_int32 flags); static int GetLocalToken(struct ktc_principal *aserver, - struct ktc_token *atoken, - int atokenLen, + struct ktc_token *atoken, int atokenLen, struct ktc_principal *aclient); static int ForgetLocalTokens(); static int ForgetOneLocalToken(struct ktc_principal *aserver); static char AFSConfigKeyName[] = - "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"; + "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"; + +static char AFSGlobalKTCMutexName[] = "Global\\AFS_KTC_Mutex"; +static char AFSKTCMutexName[] = "AFS_KTC_Mutex"; /* * Support for RPC's to send and receive session keys @@ -58,14 +62,16 @@ static char AFSConfigKeyName[] = char rpcErr[256]; -void __RPC_FAR * __RPC_USER midl_user_allocate (size_t cBytes) +void __RPC_FAR *__RPC_USER +midl_user_allocate(size_t cBytes) { - return ((void __RPC_FAR *) malloc(cBytes)); + return ((void __RPC_FAR *)malloc(cBytes)); } -void __RPC_USER midl_user_free(void __RPC_FAR * p) +void __RPC_USER +midl_user_free(void __RPC_FAR * p) { - free(p); + free(p); } /* @@ -73,607 +79,695 @@ void __RPC_USER midl_user_free(void __RPC_FAR * p) * the same as the client (i.e. standalone, non-gateway), NULL can be * used, so it is not necessary to call gethostbyname(). */ -void getservername(char **snp, unsigned int snSize) +void +getservername(char **snp, unsigned int snSize) { - HKEY parmKey; - long code; - - code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSConfigKeyName, - 0, KEY_QUERY_VALUE, &parmKey); - if (code != ERROR_SUCCESS) - goto nogateway; - code = RegQueryValueEx(parmKey, "Gateway", NULL, NULL, - *snp, &snSize); - RegCloseKey (parmKey); - if (code == ERROR_SUCCESS) - return; -nogateway: - /* No gateway name in registry; use ourself */ - *snp = NULL; + HKEY parmKey; + long code; + + code = + RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, KEY_QUERY_VALUE, + &parmKey); + if (code != ERROR_SUCCESS) + goto nogateway; + code = RegQueryValueEx(parmKey, "Gateway", NULL, NULL, *snp, &snSize); + RegCloseKey(parmKey); + if (code == ERROR_SUCCESS) + return; + nogateway: + /* No gateway name in registry; use ourself */ + *snp = NULL; } -RPC_STATUS send_key(afs_uuid_t uuid, char sessionKey[8]) +RPC_STATUS +send_key(afs_uuid_t uuid, char sessionKey[8]) { - RPC_STATUS status; - char *stringBinding = NULL; - ULONG authnLevel, authnSvc; - char serverName[256]; - char *serverNamep = serverName; - char encrypt[32]; - BOOL encryptionOff = FALSE; - char protseq[32]; - - /* Encryption on by default */ - if (GetEnvironmentVariable("AFS_RPC_ENCRYPT", - encrypt, sizeof(encrypt))) - if (!strcmpi(encrypt, "OFF")) - encryptionOff = TRUE; - - /* Protocol sequence is named pipe by default */ - if (!GetEnvironmentVariable("AFS_RPC_PROTSEQ", - protseq, sizeof(protseq))) - strcpy(protseq, "ncacn_np"); - - /* Server name */ - getservername(&serverNamep, sizeof(serverName)); - - status = RpcStringBindingCompose("", /* obj uuid */ - protseq, - serverNamep, - "", /* endpoint */ - "", /* protocol options */ - &stringBinding); - if (status != RPC_S_OK) - goto cleanup; - - status = RpcBindingFromStringBinding(stringBinding, &hAfsHandle); - if (status != RPC_S_OK) - goto cleanup; - - /* - * On Windows 95/98, we must resolve the binding before calling - * SetAuthInfo. On Windows NT, we don't have to resolve yet, - * but it does no harm. - */ - status = RpcEpResolveBinding(hAfsHandle, afsrpc_v1_0_c_ifspec); - if (status != RPC_S_OK) - goto cleanup; - - if (encryptionOff) { - authnLevel = RPC_C_AUTHN_LEVEL_NONE; - authnSvc = RPC_C_AUTHN_WINNT; - } else { - authnLevel = RPC_C_AUTHN_LEVEL_PKT_PRIVACY; - authnSvc = RPC_C_AUTHN_WINNT; - } + RPC_STATUS status; + char *stringBinding = NULL; + ULONG authnLevel, authnSvc; + char serverName[256]; + char *serverNamep = serverName; + char encrypt[32]; + BOOL encryptionOff = FALSE; + char protseq[32]; + + /* Encryption on by default */ + if (GetEnvironmentVariable("AFS_RPC_ENCRYPT", encrypt, sizeof(encrypt))) + if (!strcmpi(encrypt, "OFF")) + encryptionOff = TRUE; + + /* Protocol sequence is named pipe by default */ + if (!GetEnvironmentVariable("AFS_RPC_PROTSEQ", protseq, sizeof(protseq))) + strcpy(protseq, "ncacn_np"); + + /* Server name */ + getservername(&serverNamep, sizeof(serverName)); + + status = RpcStringBindingCompose("", /* obj uuid */ + protseq, serverNamep, "", /* endpoint */ + "", /* protocol options */ + &stringBinding); + if (status != RPC_S_OK) + goto cleanup; + + status = RpcBindingFromStringBinding(stringBinding, &hAfsHandle); + if (status != RPC_S_OK) + goto cleanup; + + /* + * On Windows 95/98, we must resolve the binding before calling + * SetAuthInfo. On Windows NT, we don't have to resolve yet, + * but it does no harm. + */ + status = RpcEpResolveBinding(hAfsHandle, afsrpc_v1_0_c_ifspec); + if (status != RPC_S_OK) + goto cleanup; + + if (encryptionOff) { + authnLevel = RPC_C_AUTHN_LEVEL_NONE; + authnSvc = RPC_C_AUTHN_WINNT; + } else { + authnLevel = RPC_C_AUTHN_LEVEL_PKT_PRIVACY; + authnSvc = RPC_C_AUTHN_WINNT; + } - status = RpcBindingSetAuthInfo(hAfsHandle, NULL, authnLevel, authnSvc, - NULL, RPC_C_AUTHZ_NONE); - if (status != RPC_S_OK) - goto cleanup; + status = + RpcBindingSetAuthInfo(hAfsHandle, NULL, authnLevel, authnSvc, NULL, + RPC_C_AUTHZ_NONE); + if (status != RPC_S_OK) + goto cleanup; - RpcTryExcept { - status = AFSRPC_SetToken(uuid, sessionKey); - } - RpcExcept(1) { - status = RpcExceptionCode(); - } - RpcEndExcept - -cleanup: - if (stringBinding) - RpcStringFree(&stringBinding); + RpcTryExcept { + status = AFSRPC_SetToken(uuid, sessionKey); + } + RpcExcept(1) { + status = RpcExceptionCode(); + } + RpcEndExcept cleanup:if (stringBinding) + RpcStringFree(&stringBinding); - if (hAfsHandle != NULL) - RpcBindingFree(&hAfsHandle); + if (hAfsHandle != NULL) + RpcBindingFree(&hAfsHandle); - return status; + return status; } -RPC_STATUS receive_key(afs_uuid_t uuid, char sessionKey[8]) +RPC_STATUS +receive_key(afs_uuid_t uuid, char sessionKey[8]) { - RPC_STATUS status; - char *stringBinding = NULL; - ULONG authnLevel, authnSvc; - char serverName[256]; - char *serverNamep = serverName; - char encrypt[32]; - BOOL encryptionOff = FALSE; - char protseq[32]; - - /* Encryption on by default */ - if (GetEnvironmentVariable("AFS_RPC_ENCRYPT", - encrypt, sizeof(encrypt))) - if (!strcmpi(encrypt, "OFF")) - encryptionOff = TRUE; - - /* Protocol sequence is named pipe by default */ - if (!GetEnvironmentVariable("AFS_RPC_PROTSEQ", - protseq, sizeof(protseq))) - strcpy(protseq, "ncacn_np"); - - /* Server name */ - getservername(&serverNamep, sizeof(serverName)); - - status = RpcStringBindingCompose("", /* obj uuid */ - protseq, - serverNamep, - "", /* endpoint */ - "", /* protocol options */ - &stringBinding); - if (status != RPC_S_OK) - goto cleanup; - - status = RpcBindingFromStringBinding(stringBinding, &hAfsHandle); - if (status != RPC_S_OK) - goto cleanup; - - /* - * On Windows 95/98, we must resolve the binding before calling - * SetAuthInfo. On Windows NT, we don't have to resolve yet, - * but it does no harm. - */ - status = RpcEpResolveBinding(hAfsHandle, afsrpc_v1_0_c_ifspec); - if (status != RPC_S_OK) - goto cleanup; - - if (encryptionOff) { - authnLevel = RPC_C_AUTHN_LEVEL_NONE; - authnSvc = RPC_C_AUTHN_WINNT; - } else { - authnLevel = RPC_C_AUTHN_LEVEL_PKT_PRIVACY; - authnSvc = RPC_C_AUTHN_WINNT; - } - - status = RpcBindingSetAuthInfo(hAfsHandle, NULL, authnLevel, authnSvc, - NULL, RPC_C_AUTHZ_NONE); - if (status != RPC_S_OK) - goto cleanup; + RPC_STATUS status; + char *stringBinding = NULL; + ULONG authnLevel, authnSvc; + char serverName[256]; + char *serverNamep = serverName; + char encrypt[32]; + BOOL encryptionOff = FALSE; + char protseq[32]; + + /* Encryption on by default */ + if (GetEnvironmentVariable("AFS_RPC_ENCRYPT", encrypt, sizeof(encrypt))) + if (!strcmpi(encrypt, "OFF")) + encryptionOff = TRUE; + + /* Protocol sequence is named pipe by default */ + if (!GetEnvironmentVariable("AFS_RPC_PROTSEQ", protseq, sizeof(protseq))) + strcpy(protseq, "ncacn_np"); + + /* Server name */ + getservername(&serverNamep, sizeof(serverName)); + + status = RpcStringBindingCompose("", /* obj uuid */ + protseq, serverNamep, "", /* endpoint */ + "", /* protocol options */ + &stringBinding); + if (status != RPC_S_OK) + goto cleanup; + + status = RpcBindingFromStringBinding(stringBinding, &hAfsHandle); + if (status != RPC_S_OK) + goto cleanup; + + /* + * On Windows 95/98, we must resolve the binding before calling + * SetAuthInfo. On Windows NT, we don't have to resolve yet, + * but it does no harm. + */ + status = RpcEpResolveBinding(hAfsHandle, afsrpc_v1_0_c_ifspec); + if (status != RPC_S_OK) + goto cleanup; + + if (encryptionOff) { + authnLevel = RPC_C_AUTHN_LEVEL_NONE; + authnSvc = RPC_C_AUTHN_WINNT; + } else { + authnLevel = RPC_C_AUTHN_LEVEL_PKT_PRIVACY; + authnSvc = RPC_C_AUTHN_WINNT; + } - RpcTryExcept { - status = AFSRPC_GetToken(uuid, sessionKey); - } - RpcExcept(1) { - status = RpcExceptionCode(); - } - RpcEndExcept + status = + RpcBindingSetAuthInfo(hAfsHandle, NULL, authnLevel, authnSvc, NULL, + RPC_C_AUTHZ_NONE); + if (status != RPC_S_OK) + goto cleanup; -cleanup: - if (stringBinding) - RpcStringFree(&stringBinding); + RpcTryExcept { + status = AFSRPC_GetToken(uuid, sessionKey); + } + RpcExcept(1) { + status = RpcExceptionCode(); + } + RpcEndExcept cleanup:if (stringBinding) + RpcStringFree(&stringBinding); - if (hAfsHandle != NULL) - RpcBindingFree(&hAfsHandle); + if (hAfsHandle != NULL) + RpcBindingFree(&hAfsHandle); - return status; + return status; } -int ktc_SetToken( - struct ktc_principal *server, - struct ktc_token *token, - struct ktc_principal *client, - int flags) +int +ktc_SetToken(struct ktc_principal *server, struct ktc_token *token, + struct ktc_principal *client, int flags) { - struct ViceIoctl iob; - char tbuffer[1024]; - char *tp; - struct ClearToken ct; - int temp; - int code; - RPC_STATUS status; - afs_uuid_t uuid; - - if (token->ticketLen < MINKTCTICKETLEN - || token->ticketLen > MAXKTCTICKETLEN) - return KTC_INVAL; - - if (strcmp(server->name, "afs")) { - return SetLocalToken(server, token, client, flags); - } + struct ViceIoctl iob; + char tbuffer[TBUFFERSIZE]; + char *tp; + struct ClearToken ct; + int temp; + int code; + RPC_STATUS status; + afs_uuid_t uuid; + HANDLE ktcMutex = NULL; + + if (token->ticketLen < MINKTCTICKETLEN + || token->ticketLen > MAXKTCTICKETLEN) + return KTC_INVAL; + + if (strcmp(server->name, "afs")) { + return SetLocalToken(server, token, client, flags); + } - tp = tbuffer; + tp = tbuffer; - /* ticket length */ - memcpy(tp, &token->ticketLen, sizeof(token->ticketLen)); - tp += sizeof(&token->ticketLen); + /* ticket length */ + memcpy(tp, &token->ticketLen, sizeof(token->ticketLen)); + tp += sizeof(&token->ticketLen); - /* ticket */ - memcpy(tp, token->ticket, token->ticketLen); - tp += token->ticketLen; + /* ticket */ + memcpy(tp, token->ticket, token->ticketLen); + tp += token->ticketLen; - /* clear token */ - ct.AuthHandle = token->kvno; - /* - * Instead of sending the session key in the clear, we zero it, - * and send it later, via RPC, encrypted. - */ + /* clear token */ + ct.AuthHandle = token->kvno; + /* + * Instead of sending the session key in the clear, we zero it, + * and send it later, via RPC, encrypted. + */ #ifndef AFS_WIN95_ENV - /* - memcpy(ct.HandShakeKey, &token->sessionKey, sizeof(token->sessionKey)); - */ - memset(ct.HandShakeKey, 0, sizeof(ct.HandShakeKey)); + /* + * memcpy(ct.HandShakeKey, &token->sessionKey, sizeof(token->sessionKey)); + */ + memset(ct.HandShakeKey, 0, sizeof(ct.HandShakeKey)); #else - memcpy(ct.HandShakeKey, &token->sessionKey, sizeof(token->sessionKey)); + memcpy(ct.HandShakeKey, &token->sessionKey, sizeof(token->sessionKey)); #endif - ct.BeginTimestamp = token->startTime; - ct.EndTimestamp = token->endTime; - if (ct.BeginTimestamp == 0) ct.BeginTimestamp = 1; - - /* We don't know from Vice ID's yet */ - ct.ViceId = 37; /* XXX */ - if (((ct.EndTimestamp - ct.BeginTimestamp) & 1) == 1) - ct.BeginTimestamp++; /* force lifetime to be even */ - - /* size of clear token */ - temp = sizeof(struct ClearToken); - memcpy(tp, &temp, sizeof(temp)); - tp += sizeof(temp); - - /* clear token itself */ - memcpy(tp, &ct, sizeof(ct)); - tp += sizeof(ct); - - /* flags; on NT there is no setpag flag, but there is an - * integrated logon flag */ - temp = ((flags & AFS_SETTOK_LOGON) ? PIOCTL_LOGON : 0); - memcpy(tp, &temp, sizeof(temp)); - tp += sizeof(temp); - - /* cell name */ - temp = strlen(server->cell); - if (temp >= MAXKTCREALMLEN) - return KTC_INVAL; - strcpy(tp, server->cell); - tp += temp+1; - - /* user name */ - temp = strlen(client->name); - if (temp >= MAXKTCNAMELEN) - return KTC_INVAL; - strcpy(tp, client->name); - tp += temp+1; + ct.BeginTimestamp = token->startTime; + ct.EndTimestamp = token->endTime; + if (ct.BeginTimestamp == 0) + ct.BeginTimestamp = 1; + + /* We don't know from Vice ID's yet */ + ct.ViceId = 37; /* XXX */ + if (((ct.EndTimestamp - ct.BeginTimestamp) & 1) == 1) + ct.BeginTimestamp++; /* force lifetime to be even */ + + /* size of clear token */ + temp = sizeof(struct ClearToken); + memcpy(tp, &temp, sizeof(temp)); + tp += sizeof(temp); + + /* clear token itself */ + memcpy(tp, &ct, sizeof(ct)); + tp += sizeof(ct); + + /* flags; on NT there is no setpag flag, but there is an + * integrated logon flag */ + temp = ((flags & AFS_SETTOK_LOGON) ? PIOCTL_LOGON : 0); + memcpy(tp, &temp, sizeof(temp)); + tp += sizeof(temp); + + /* cell name */ + temp = strlen(server->cell); + if (temp >= MAXKTCREALMLEN) + return KTC_INVAL; + strcpy(tp, server->cell); + tp += temp + 1; + + /* user name */ + temp = strlen(client->name); + if (temp >= MAXKTCNAMELEN) + return KTC_INVAL; + strcpy(tp, client->name); + tp += temp + 1; /* we need the SMB user name to associate the tokens with in the - integrated logon case. */ + * integrated logon case. */ if (flags & AFS_SETTOK_LOGON) { - if (client->smbname == NULL) - temp = 0; - else + if (client->smbname == NULL) + temp = 0; + else temp = strlen(client->smbname); - if (temp == 0 || temp >= MAXKTCNAMELEN) - return KTC_INVAL; - strcpy(tp, client->smbname); - tp += temp+1; + if (temp == 0 || temp >= MAXKTCNAMELEN) + return KTC_INVAL; + strcpy(tp, client->smbname); + tp += temp + 1; } - - /* uuid */ - status = UuidCreate((UUID *)&uuid); - memcpy(tp, &uuid, sizeof(uuid)); - tp += sizeof(uuid); + + /* uuid */ + status = UuidCreate((UUID *) & uuid); + memcpy(tp, &uuid, sizeof(uuid)); + tp += sizeof(uuid); + #ifndef AFS_WIN95_ENV - /* RPC to send session key */ - status = send_key(uuid, token->sessionKey.data); - if (status != RPC_S_OK) { - if (status == 1) - strcpy(rpcErr, "RPC failure in AFS gateway"); - else - DceErrorInqText(status, rpcErr); - if (status == RPC_S_SERVER_UNAVAILABLE - || status == EPT_S_NOT_REGISTERED) - return KTC_NOCMRPC; - else - return KTC_RPC; - } + ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName); + if ( ktcMutex == NULL ) + return KTC_PIOCTLFAIL; + if ( GetLastError() == ERROR_ALREADY_EXISTS ) { + if ( WaitForSingleObject( ktcMutex, INFINITE) != WAIT_OBJECT_0 ) { + CloseHandle(ktcMutex); + return KTC_PIOCTLFAIL; + } + } + + /* RPC to send session key */ + status = send_key(uuid, token->sessionKey.data); + if (status != RPC_S_OK) { + if (status == 1) + strcpy(rpcErr, "RPC failure in AFS gateway"); + else + DceErrorInqText(status, rpcErr); + if (status == RPC_S_SERVER_UNAVAILABLE || + status == EPT_S_NOT_REGISTERED) + { + ReleaseMutex(ktcMutex); + CloseHandle(ktcMutex); + return KTC_NOCMRPC; + } + else + { + ReleaseMutex(ktcMutex); + CloseHandle(ktcMutex); + return KTC_RPC; + } + } #endif /* AFS_WIN95_ENV */ - /* set up for pioctl */ - iob.in = tbuffer; - iob.in_size = tp - tbuffer; - iob.out = tbuffer; - iob.out_size = sizeof(tbuffer); - - code = pioctl(0, VIOCSETTOK, &iob, 0); - if (code) { - if (code == -1) { - if (errno == ESRCH) - return KTC_NOCELL; - else if (errno == ENODEV) - return KTC_NOCM; - else if (errno == EINVAL) - return KTC_INVAL; - else - return KTC_PIOCTLFAIL; - } - else - return KTC_PIOCTLFAIL; - } + /* set up for pioctl */ + iob.in = tbuffer; + iob.in_size = tp - tbuffer; + iob.out = tbuffer; + iob.out_size = sizeof(tbuffer); + + code = pioctl(0, VIOCSETTOK, &iob, 0); + +#ifndef AFS_WIN95_ENV + ReleaseMutex(ktcMutex); + CloseHandle(ktcMutex); +#endif /* AFS_WIN95_ENV */ + + if (code) { + if (code == -1) { + if (errno == ESRCH) + return KTC_NOCELL; + else if (errno == ENODEV) + return KTC_NOCM; + else if (errno == EINVAL) + return KTC_INVAL; + else + return KTC_PIOCTLFAIL; + } else + return KTC_PIOCTLFAIL; + } - return 0; + return 0; } -int ktc_GetToken( - struct ktc_principal *server, - struct ktc_token *token, - int tokenLen, - struct ktc_principal *client) +int +ktc_GetToken(struct ktc_principal *server, struct ktc_token *token, + int tokenLen, struct ktc_principal *client) { - struct ViceIoctl iob; - char tbuffer[1024]; - char *tp, *cp; - char *ticketP; - int ticketLen, temp; - struct ClearToken ct; - char *cellName; - int cellNameSize; - int maxLen; - int code; - RPC_STATUS status; - afs_uuid_t uuid; - - tp = tbuffer; - - /* check to see if the user is requesting tokens for a principal - * other than afs. If so, check the local token cache. - */ - if (strcmp(server->name, "afs")) { - return GetLocalToken(server, token, tokenLen, client); - } + struct ViceIoctl iob; + char tbuffer[TBUFFERSIZE]; + char *tp, *cp; + char *ticketP; + int ticketLen, temp; + struct ClearToken ct; + char *cellName; + int cellNameSize; + int maxLen; + int code; + RPC_STATUS status; + afs_uuid_t uuid; + HANDLE ktcMutex = NULL; + + tp = tbuffer; + + /* check to see if the user is requesting tokens for a principal + * other than afs. If so, check the local token cache. + */ + if (strcmp(server->name, "afs")) { + return GetLocalToken(server, token, tokenLen, client); + } - /* cell name */ - strcpy(tp, server->cell); - tp += strlen(server->cell) + 1; - - /* uuid */ - status = UuidCreate((UUID *)&uuid); - memcpy(tp, &uuid, sizeof(uuid)); - tp += sizeof(uuid); - - iob.in = tbuffer; - iob.in_size = tp - tbuffer; - iob.out = tbuffer; - iob.out_size = sizeof(tbuffer); - - code = pioctl(0, VIOCNEWGETTOK, &iob, 0); - if (code) { - if (code == -1) { - if (errno == ESRCH) - return KTC_NOCELL; - else if (errno == ENODEV) - return KTC_NOCM; - else if (errno == EINVAL) - return KTC_INVAL; - else if (errno == EDOM) - return KTC_NOENT; - else - return KTC_PIOCTLFAIL; - } - else - return KTC_PIOCTLFAIL; - } + /* cell name */ + strcpy(tp, server->cell); + tp += strlen(server->cell) + 1; + + /* uuid */ + status = UuidCreate((UUID *) & uuid); + memcpy(tp, &uuid, sizeof(uuid)); + tp += sizeof(uuid); + + iob.in = tbuffer; + iob.in_size = tp - tbuffer; + iob.out = tbuffer; + iob.out_size = sizeof(tbuffer); + +#ifndef AFS_WIN95_ENV + ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName); + if ( ktcMutex == NULL ) + return KTC_PIOCTLFAIL; + if ( GetLastError() == ERROR_ALREADY_EXISTS ) { + if ( WaitForSingleObject( ktcMutex, INFINITE) != WAIT_OBJECT_0 ) { + CloseHandle(ktcMutex); + return KTC_PIOCTLFAIL; + } + } +#endif /* AFS_WIN95_ENV */ -#ifndef AFS_WIN95_ENV /* get rid of RPC for win95 build */ - /* RPC to receive session key */ - status = receive_key(uuid, token->sessionKey.data); - if (status != RPC_S_OK) { - if (status == 1) - strcpy(rpcErr, "RPC failure in AFS gateway"); - else - DceErrorInqText(status, rpcErr); - if (status == RPC_S_SERVER_UNAVAILABLE - || status == EPT_S_NOT_REGISTERED) - return KTC_NOCMRPC; - else - return KTC_RPC; - } + code = pioctl(0, VIOCNEWGETTOK, &iob, 0); + if (code) { +#ifndef AFS_WIN95_ENV + ReleaseMutex(ktcMutex); + CloseHandle(ktcMutex); +#endif /* AFS_WIN95_ENV */ + if (code == -1) { + if (errno == ESRCH) + return KTC_NOCELL; + else if (errno == ENODEV) + return KTC_NOCM; + else if (errno == EINVAL) + return KTC_INVAL; + else if (errno == EDOM) + return KTC_NOENT; + else + return KTC_PIOCTLFAIL; + } else + return KTC_PIOCTLFAIL; + } + +#ifndef AFS_WIN95_ENV + /* get rid of RPC for win95 build */ + /* RPC to receive session key */ + status = receive_key(uuid, token->sessionKey.data); + + ReleaseMutex(ktcMutex); + CloseHandle(ktcMutex); + + if (status != RPC_S_OK) { + if (status == 1) + strcpy(rpcErr, "RPC failure in AFS gateway"); + else + DceErrorInqText(status, rpcErr); + if (status == RPC_S_SERVER_UNAVAILABLE + || status == EPT_S_NOT_REGISTERED) + return KTC_NOCMRPC; + else + return KTC_RPC; + } #endif /* AFS_WIN95_ENV */ - cp = tbuffer; + cp = tbuffer; - /* ticket length */ - memcpy(&ticketLen, cp, sizeof(ticketLen)); - cp += sizeof(ticketLen); + /* ticket length */ + memcpy(&ticketLen, cp, sizeof(ticketLen)); + cp += sizeof(ticketLen); - /* remember where ticket is and skip over it */ - ticketP = cp; - cp += ticketLen; + /* remember where ticket is and skip over it */ + ticketP = cp; + cp += ticketLen; - /* size of clear token */ - memcpy(&temp, cp, sizeof(temp)); - cp += sizeof(temp); - if (temp != sizeof(ct)) - return KTC_ERROR; + /* size of clear token */ + memcpy(&temp, cp, sizeof(temp)); + cp += sizeof(temp); + if (temp != sizeof(ct)) + return KTC_ERROR; - /* clear token */ - memcpy(&ct, cp, temp); - cp += temp; + /* clear token */ + memcpy(&ct, cp, temp); + cp += temp; - /* skip over primary flag */ - cp += sizeof(temp); + /* skip over primary flag */ + cp += sizeof(temp); - /* remember cell name and skip over it */ - cellName = cp; - cellNameSize = strlen(cp); - cp += cellNameSize + 1; + /* remember cell name and skip over it */ + cellName = cp; + cellNameSize = strlen(cp); + cp += cellNameSize + 1; - /* user name is here */ + /* user name is here */ - /* check that ticket will fit */ + /* check that ticket will fit + * this compares the size of the ktc_token allocated by the app + * which might be smaller than the current definition of MAXKTCTICKETLEN + */ maxLen = tokenLen - sizeof(struct ktc_token) + MAXKTCTICKETLEN; if (maxLen < ticketLen) return KTC_TOOBIG; - /* set return values */ - memcpy(token->ticket, ticketP, ticketLen); - token->startTime = ct.BeginTimestamp; - token->endTime = ct.EndTimestamp; - if (ct.AuthHandle == -1) ct.AuthHandle = 999; - token->kvno = ct.AuthHandle; + /* set return values */ + memcpy(token->ticket, ticketP, ticketLen); + token->startTime = ct.BeginTimestamp; + token->endTime = ct.EndTimestamp; + if (ct.AuthHandle == -1) + ct.AuthHandle = 999; + token->kvno = ct.AuthHandle; #ifndef AFS_WIN95_ENV - /* - * Session key has already been set via RPC - */ + /* + * Session key has already been set via RPC + */ #else - memcpy(&token->sessionKey, ct.HandShakeKey, sizeof(ct.HandShakeKey)); + memcpy(&token->sessionKey, ct.HandShakeKey, sizeof(ct.HandShakeKey)); #endif /* AFS_WIN95_ENV */ - token->ticketLen = ticketLen; - if (client) { - strcpy(client->name, cp); - client->instance[0] = '\0'; - strcpy(client->cell, cellName); - } + token->ticketLen = ticketLen; + if (client) { + strcpy(client->name, cp); + client->instance[0] = '\0'; + strcpy(client->cell, cellName); + } - return 0; + return 0; } -int ktc_ListTokens( - int cellNum, - int *cellNumP, - struct ktc_principal *server) +int +ktc_ListTokens(int cellNum, int *cellNumP, struct ktc_principal *server) { - struct ViceIoctl iob; - char tbuffer[1024]; - char *tp, *cp; - int newIter, ticketLen, temp; - int code; - - tp = tbuffer; - - /* iterator */ - memcpy(tp, &cellNum, sizeof(cellNum)); - tp += sizeof(cellNum); - - /* do pioctl */ - iob.in = tbuffer; - iob.in_size = tp - tbuffer; - iob.out = tbuffer; - iob.out_size = sizeof(tbuffer); - - code = pioctl(0, VIOCGETTOK, &iob, 0); - if (code) { - if (code == -1) { - if (errno == ESRCH) - return KTC_NOCELL; - else if (errno == ENODEV) - return KTC_NOCM; - else if (errno == EINVAL) - return KTC_INVAL; - else if (errno == EDOM) - return KTC_NOENT; - else - return KTC_PIOCTLFAIL; - } - else - return KTC_PIOCTLFAIL; - } + struct ViceIoctl iob; + char tbuffer[TBUFFERSIZE]; + char *tp, *cp; + int newIter, ticketLen, temp; + int code; + HANDLE ktcMutex = NULL; + +#ifndef AFS_WIN95_ENV + ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName); + if ( ktcMutex == NULL ) + return KTC_PIOCTLFAIL; + if ( GetLastError() == ERROR_ALREADY_EXISTS ) { + if ( WaitForSingleObject( ktcMutex, INFINITE) != WAIT_OBJECT_0 ) { + CloseHandle(ktcMutex); + return KTC_PIOCTLFAIL; + } + } +#endif /* AFS_WIN95_ENV */ + + tp = tbuffer; + + /* iterator */ + memcpy(tp, &cellNum, sizeof(cellNum)); + tp += sizeof(cellNum); - cp = tbuffer; + /* do pioctl */ + iob.in = tbuffer; + iob.in_size = tp - tbuffer; + iob.out = tbuffer; + iob.out_size = sizeof(tbuffer); - /* new iterator */ - memcpy(&newIter, cp, sizeof(newIter)); - cp += sizeof(newIter); + code = pioctl(0, VIOCGETTOK, &iob, 0); - /* ticket length */ - memcpy(&ticketLen, cp, sizeof(ticketLen)); - cp += sizeof(ticketLen); +#ifndef AFS_WIN95_ENV + ReleaseMutex(ktcMutex); + CloseHandle(ktcMutex); +#endif /* AFS_WIN95_ENV */ + + if (code) { + if (code == -1) { + if (errno == ESRCH) + return KTC_NOCELL; + else if (errno == ENODEV) + return KTC_NOCM; + else if (errno == EINVAL) + return KTC_INVAL; + else if (errno == EDOM) + return KTC_NOENT; + else + return KTC_PIOCTLFAIL; + } else + return KTC_PIOCTLFAIL; + } + + cp = tbuffer; - /* skip over ticket */ - cp += ticketLen; + /* new iterator */ + memcpy(&newIter, cp, sizeof(newIter)); + cp += sizeof(newIter); - /* clear token size */ - memcpy(&temp, cp, sizeof(temp)); - cp += sizeof(temp); - if (temp != sizeof(struct ClearToken)) - return KTC_ERROR; + /* ticket length */ + memcpy(&ticketLen, cp, sizeof(ticketLen)); + cp += sizeof(ticketLen); - /* skip over clear token */ - cp += sizeof(struct ClearToken); + /* skip over ticket */ + cp += ticketLen; - /* skip over primary flag */ - cp += sizeof(temp); + /* clear token size */ + memcpy(&temp, cp, sizeof(temp)); + cp += sizeof(temp); + if (temp != sizeof(struct ClearToken)) + return KTC_ERROR; - /* cell name is here */ + /* skip over clear token */ + cp += sizeof(struct ClearToken); - /* set return values */ - strcpy(server->cell, cp); - server->instance[0] = '\0'; - strcpy(server->name, "afs"); + /* skip over primary flag */ + cp += sizeof(temp); - *cellNumP = newIter; - return 0; + /* cell name is here */ + + /* set return values */ + strcpy(server->cell, cp); + server->instance[0] = '\0'; + strcpy(server->name, "afs"); + + *cellNumP = newIter; + return 0; } -int ktc_ForgetToken( - struct ktc_principal *server) +int +ktc_ForgetToken(struct ktc_principal *server) { - struct ViceIoctl iob; - char tbuffer[1024]; - char *tp; - int code; + struct ViceIoctl iob; + char tbuffer[TBUFFERSIZE]; + char *tp; + int code; + HANDLE ktcMutex = NULL; + + if (strcmp(server->name, "afs")) { + return ForgetOneLocalToken(server); + } - if (strcmp(server->name, "afs")) { - return ForgetOneLocalToken(server); - } +#ifndef AFS_WIN95_ENV + ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName); + if ( ktcMutex == NULL ) + return KTC_PIOCTLFAIL; + if ( GetLastError() == ERROR_ALREADY_EXISTS ) { + if ( WaitForSingleObject( ktcMutex, INFINITE) != WAIT_OBJECT_0 ) { + CloseHandle(ktcMutex); + return KTC_PIOCTLFAIL; + } + } +#endif /* AFS_WIN95_ENV */ - tp = tbuffer; - - /* cell name */ - strcpy(tp, server->cell); - tp += strlen(tp) + 1; - - /* do pioctl */ - iob.in = tbuffer; - iob.in_size = tp - tbuffer; - iob.out = tbuffer; - iob.out_size = sizeof(tbuffer); - - code = pioctl(0, VIOCDELTOK, &iob, 0); - if (code) { - if (code == -1) { - if (errno == ESRCH) - return KTC_NOCELL; - else if (errno == EDOM) - return KTC_NOENT; - else if (errno == ENODEV) - return KTC_NOCM; - else - return KTC_PIOCTLFAIL; - } - else - return KTC_PIOCTLFAIL; - } - return 0; + tp = tbuffer; + + /* cell name */ + strcpy(tp, server->cell); + tp += strlen(tp) + 1; + + /* do pioctl */ + iob.in = tbuffer; + iob.in_size = tp - tbuffer; + iob.out = tbuffer; + iob.out_size = sizeof(tbuffer); + + code = pioctl(0, VIOCDELTOK, &iob, 0); +#ifndef AFS_WIN95_ENV + ReleaseMutex(ktcMutex); + CloseHandle(ktcMutex); +#endif /* AFS_WIN95_ENV */ + if (code) { + if (code == -1) { + if (errno == ESRCH) + return KTC_NOCELL; + else if (errno == EDOM) + return KTC_NOENT; + else if (errno == ENODEV) + return KTC_NOCM; + else + return KTC_PIOCTLFAIL; + } else + return KTC_PIOCTLFAIL; + } + return 0; } -int ktc_ForgetAllTokens() +int +ktc_ForgetAllTokens() { - struct ViceIoctl iob; - char tbuffer[1024]; - int code; - - (void) ForgetLocalTokens(); - - /* do pioctl */ - iob.in = tbuffer; - iob.in_size = 0; - iob.out = tbuffer; - iob.out_size = sizeof(tbuffer); - - code = pioctl(0, VIOCDELALLTOK, &iob, 0); - if (code) { - if (code == -1) { - if (errno == ENODEV) - return KTC_NOCM; - else - return KTC_PIOCTLFAIL; - } - else - return KTC_PIOCTLFAIL; - } - return 0; + struct ViceIoctl iob; + char tbuffer[TBUFFERSIZE]; + int code; + HANDLE ktcMutex = NULL; + + (void)ForgetLocalTokens(); + +#ifndef AFS_WIN95_ENV + ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName); + if ( ktcMutex == NULL ) + return KTC_PIOCTLFAIL; + if ( GetLastError() == ERROR_ALREADY_EXISTS ) { + if ( WaitForSingleObject( ktcMutex, INFINITE) != WAIT_OBJECT_0 ) { + CloseHandle(ktcMutex); + return KTC_PIOCTLFAIL; + } + } +#endif /* AFS_WIN95_ENV */ + + /* do pioctl */ + iob.in = tbuffer; + iob.in_size = 0; + iob.out = tbuffer; + iob.out_size = sizeof(tbuffer); + + code = pioctl(0, VIOCDELALLTOK, &iob, 0); +#ifndef AFS_WIN95_ENV + ReleaseMutex(ktcMutex); + CloseHandle(ktcMutex); +#endif /* AFS_WIN95_ENV */ + if (code) { + if (code == -1) { + if (errno == ENODEV) + return KTC_NOCM; + else + return KTC_PIOCTLFAIL; + } else + return KTC_PIOCTLFAIL; + } + return 0; } -int ktc_OldPioctl () +int +ktc_OldPioctl() { return 1; } @@ -686,98 +780,92 @@ static struct { struct ktc_principal server; struct ktc_principal client; struct ktc_token token; -} local_tokens[MAXLOCALTOKENS] = {0}; +} local_tokens[MAXLOCALTOKENS] = { +0}; -static int SetLocalToken(struct ktc_principal *aserver, - struct ktc_token *atoken, - struct ktc_principal *aclient, - afs_int32 flags) +static int +SetLocalToken(struct ktc_principal *aserver, struct ktc_token *atoken, + struct ktc_principal *aclient, afs_int32 flags) { int found = -1; int i; - LOCK_GLOBAL_MUTEX - for (i = 0; i < MAXLOCALTOKENS; i++) + LOCK_GLOBAL_MUTEX for (i = 0; i < MAXLOCALTOKENS; i++) if (local_tokens[i].valid) { - if ((strcmp(local_tokens[i].server.name, aserver->name) == 0) && - (strcmp(local_tokens[i].server.instance, - aserver->instance) == 0) && - (strcmp(local_tokens[i].server.cell, aserver->cell) == 0)) { + if ((strcmp(local_tokens[i].server.name, aserver->name) == 0) + && (strcmp(local_tokens[i].server.instance, aserver->instance) + == 0) + && (strcmp(local_tokens[i].server.cell, aserver->cell) == 0)) { found = i; /* replace existing entry */ break; } } else if (found == -1) - found = i; /* remember empty slot but keep looking for a match */ + found = i; /* remember empty slot but keep looking for a match */ if (found == -1) { - UNLOCK_GLOBAL_MUTEX - return KTC_NOENT; + UNLOCK_GLOBAL_MUTEX return KTC_NOENT; } memcpy(&local_tokens[found].token, atoken, sizeof(struct ktc_token)); - memcpy(&local_tokens[found].server, aserver, sizeof(struct ktc_principal)); - memcpy(&local_tokens[found].client, aclient, sizeof(struct ktc_principal)); + memcpy(&local_tokens[found].server, aserver, + sizeof(struct ktc_principal)); + memcpy(&local_tokens[found].client, aclient, + sizeof(struct ktc_principal)); local_tokens[found].valid = 1; - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } -static int GetLocalToken(struct ktc_principal *aserver, - struct ktc_token *atoken, - int atokenLen, - struct ktc_principal *aclient) +static int +GetLocalToken(struct ktc_principal *aserver, struct ktc_token *atoken, + int atokenLen, struct ktc_principal *aclient) { int i; - LOCK_GLOBAL_MUTEX - for (i = 0; i < MAXLOCALTOKENS; i++) - if (local_tokens[i].valid && - (strcmp(local_tokens[i].server.name, aserver->name) == 0) && - (strcmp(local_tokens[i].server.instance,aserver->instance) == 0) && - (strcmp(local_tokens[i].server.cell, aserver->cell) == 0)) { + LOCK_GLOBAL_MUTEX for (i = 0; i < MAXLOCALTOKENS; i++) + if (local_tokens[i].valid + && (strcmp(local_tokens[i].server.name, aserver->name) == 0) + && (strcmp(local_tokens[i].server.instance, aserver->instance) == + 0) + && (strcmp(local_tokens[i].server.cell, aserver->cell) == 0)) { memcpy(atoken, &local_tokens[i].token, min(atokenLen, sizeof(struct ktc_token))); memcpy(aclient, &local_tokens[i].client, sizeof(struct ktc_principal)); - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } - UNLOCK_GLOBAL_MUTEX - return KTC_NOENT; + UNLOCK_GLOBAL_MUTEX return KTC_NOENT; } -static int ForgetLocalTokens() +static int +ForgetLocalTokens() { int i; - LOCK_GLOBAL_MUTEX - for (i = 0; i < MAXLOCALTOKENS; i++) { + LOCK_GLOBAL_MUTEX for (i = 0; i < MAXLOCALTOKENS; i++) { local_tokens[i].valid = 0; memset(&local_tokens[i].token.sessionKey, 0, sizeof(struct ktc_encryptionKey)); } - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } -static int ForgetOneLocalToken(struct ktc_principal *aserver) +static int +ForgetOneLocalToken(struct ktc_principal *aserver) { int i; - LOCK_GLOBAL_MUTEX - for (i = 0; i < MAXLOCALTOKENS; i++) { - if (local_tokens[i].valid && - (strcmp(local_tokens[i].server.name, aserver->name) == 0) && - (strcmp(local_tokens[i].server.instance,aserver->instance) == 0) && - (strcmp(local_tokens[i].server.cell, aserver->cell) == 0)) { + LOCK_GLOBAL_MUTEX for (i = 0; i < MAXLOCALTOKENS; i++) { + if (local_tokens[i].valid + && (strcmp(local_tokens[i].server.name, aserver->name) == 0) + && (strcmp(local_tokens[i].server.instance, aserver->instance) == + 0) + && (strcmp(local_tokens[i].server.cell, aserver->cell) == 0)) { local_tokens[i].valid = 0; memset(&local_tokens[i].token.sessionKey, 0, sizeof(struct ktc_encryptionKey)); - UNLOCK_GLOBAL_MUTEX - return 0; + UNLOCK_GLOBAL_MUTEX return 0; } } - UNLOCK_GLOBAL_MUTEX - return KTC_NOENT; + UNLOCK_GLOBAL_MUTEX return KTC_NOENT; } diff --git a/src/auth/setkey.c b/src/auth/setkey.c index b9b4e0998..a0dc50f55 100644 --- a/src/auth/setkey.c +++ b/src/auth/setkey.c @@ -9,9 +9,10 @@ #include #include - -RCSID("$Header: /tmp/cvstemp/openafs/src/auth/setkey.c,v 1.1.1.5 2001/09/11 14:31:23 hartmans Exp $"); - + +RCSID + ("$Header: /cvs/openafs/src/auth/setkey.c,v 1.8 2003/07/15 23:14:41 shadow Exp $"); + #include #include #include @@ -43,8 +44,9 @@ static int hex2char(char c); int main(argc, argv) -int argc; -char **argv; { + int argc; + char **argv; +{ struct afsconf_dir *tdir; register afs_int32 code; int i; @@ -62,32 +64,32 @@ char **argv; { tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH); if (!tdir) { - printf("setkey: can't initialize conf dir '%s'\n", AFSDIR_SERVER_ETC_DIRPATH); + printf("setkey: can't initialize conf dir '%s'\n", + AFSDIR_SERVER_ETC_DIRPATH); exit(1); } - if (strcmp(argv[1], "add")==0) { + if (strcmp(argv[1], "add") == 0) { char tkey[8]; if (argc != 4) { printf("setkey add: usage is 'setkey add \n"); exit(1); } if (strlen(argv[3]) != 16) { - printf("key %s is not in right format\n", argv[3]); - printf(" should be an 8byte hex representation \n"); - printf(" Ex: setkey add 0 \"80b6a7cd7a9dadb6\"\n"); - exit(1); + printf("key %s is not in right format\n", argv[3]); + printf(" should be an 8byte hex representation \n"); + printf(" Ex: setkey add 0 \"80b6a7cd7a9dadb6\"\n"); + exit(1); } memset(tkey, 0, sizeof(tkey)); - for(i=7, cp = argv[3] + 15;i>=0; i--,cp-=2) - tkey[i] = char2hex(*cp) + char2hex(*(cp-1))*16; + for (i = 7, cp = argv[3] + 15; i >= 0; i--, cp -= 2) + tkey[i] = char2hex(*cp) + char2hex(*(cp - 1)) * 16; code = afsconf_AddKey(tdir, atoi(argv[2]), tkey, 1); if (code) { - printf("setkey: failed to set key, code %d.\n", (int) code); + printf("setkey: failed to set key, code %d.\n", (int)code); exit(1); } - } - else if (strcmp(argv[1], "delete")==0) { + } else if (strcmp(argv[1], "delete") == 0) { afs_int32 kvno; if (argc != 3) { printf("setkey delete: usage is 'setkey delete \n"); @@ -96,62 +98,66 @@ char **argv; { kvno = atoi(argv[2]); code = afsconf_DeleteKey(tdir, kvno); if (code) { - printf("setkey: failed to delete key %d, (code %d)\n", (int) kvno, (int) code); + printf("setkey: failed to delete key %d, (code %d)\n", (int)kvno, + (int)code); exit(1); } - } - else if (strcmp(argv[1], "list") == 0) { + } else if (strcmp(argv[1], "list") == 0) { struct afsconf_keys tkeys; register int i; char tbuffer[9]; - + code = afsconf_GetKeys(tdir, &tkeys); if (code) { - printf("setkey: failed to get keys, code %d\n", (int) code); + printf("setkey: failed to get keys, code %d\n", (int)code); exit(1); } - for(i=0;i= '0' && c <='9') - return ( c - 48); - if ( (c >= 'a') && (c <= 'f') ) - return (c-'a' + 10); - - if ( (c >= 'A') && (c <='F') ) - return (c-'A' + 10); - - return -1; + if (c >= '0' && c <= '9') + return (c - 48); + if ((c >= 'a') && (c <= 'f')) + return (c - 'a' + 10); + + if ((c >= 'A') && (c <= 'F')) + return (c - 'A' + 10); + + return -1; } -static int hex2char(char c) +static int +hex2char(char c) { - if (c <=9) - return (c+48); + if (c <= 9) + return (c + 48); - return (c - 10 + 'a'); + return (c - 10 + 'a'); } diff --git a/src/auth/test/Makefile.in b/src/auth/test/Makefile.in index 9f8254dcd..6214dffb7 100644 --- a/src/auth/test/Makefile.in +++ b/src/auth/test/Makefile.in @@ -5,16 +5,8 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html -DESTDIR=@DESTDIR@ -SRCDIR=@SRCDIR@ -TOP_SRCDIR=@TOP_SRCDIR@ -SYS_NAME=@AFS_SYSNAME@ - -include ../../config/Makefile.${SYS_NAME} - -SRCDIR= - -OPTIMIZE=-O +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config INCDIRS= -I./ -I${DESTDIR}/include LDIRS= -L${DESTDIR}/lib -L${DESTDIR}/lib/afs -L${DESTDIR}/lib/rx diff --git a/src/auth/test/NTMakefile b/src/auth/test/NTMakefile index c31e00afc..da9938b82 100644 --- a/src/auth/test/NTMakefile +++ b/src/auth/test/NTMakefile @@ -5,14 +5,15 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=auth\test !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\..\config\NTMakefile.version ############################################################################ -CELL_EXEFILE = testcellconf.exe +CELL_EXEFILE = $(OUT)\testcellconf.exe CELL_EXEOBJS =\ - testcellconf.obj + $(OUT)\testcellconf.obj CELL_EXELIBS =\ $(DESTDIR)\lib\afs\afsauth.lib \ @@ -26,10 +27,10 @@ $(CELL_EXEFILE): $(CELL_EXEOBJS) $(CELL_EXELIBS) $(EXEPREP) ############################################################################ -KTC_EXEFILE = ktctest.exe +KTC_EXEFILE = $(OUT)\ktctest.exe KTC_EXEOBJS =\ - ktctest.obj + $(OUT)\ktctest.obj KTC_EXELIBS =\ $(DESTDIR)\lib\afs\afsutil.lib \ @@ -44,3 +45,6 @@ $(KTC_EXEFILE): $(KTC_EXEOBJS) $(KTC_EXELIBS) test tests: $(CELL_EXEFILE) $(KTC_EXEFILE) clean:: + +mkdir: + diff --git a/src/auth/test/ktctest.c b/src/auth/test/ktctest.c index b14720d37..029eed954 100644 --- a/src/auth/test/ktctest.c +++ b/src/auth/test/ktctest.c @@ -17,7 +17,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/auth/test/ktctest.c,v 1.1.1.4 2001/07/14 22:20:42 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/auth/test/ktctest.c,v 1.5 2003/07/15 23:14:42 shadow Exp $"); #include #include @@ -25,16 +26,14 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/test/ktctest.c,v 1.1.1.4 2001/07/1 extern int ktc_SetToken(struct ktc_principal *aserver, struct ktc_token *atoken, - struct ktc_principal *aclient, - int flags); + struct ktc_principal *aclient, int flags); extern int ktc_GetToken(struct ktc_principal *aserver, - struct ktc_token *atoken, - int atokenLen, + struct ktc_token *atoken, int atokenLen, struct ktc_principal *aclient); -extern int ktc_ListTokens(int aprevIndex, - int* aindex, struct ktc_principal *aserver); +extern int ktc_ListTokens(int aprevIndex, int *aindex, + struct ktc_principal *aserver); extern int ktc_ForgetAllTokens(void); @@ -45,7 +44,8 @@ static int SameToken(struct ktc_token *t1, struct ktc_token *t2); #define MAXCELLS 20 -int main(void) +int +main(void) { struct ktc_principal oldServer[MAXCELLS], newServer[MAXCELLS]; struct ktc_principal oldClient[MAXCELLS], newClient[MAXCELLS]; @@ -83,9 +83,9 @@ int main(void) } /* fetch token and client identity w.r.t. server */ - code = ktc_GetToken(&oldServer[i], - &oldToken[i], sizeof(struct ktc_token), - &oldClient[i]); + code = + ktc_GetToken(&oldServer[i], &oldToken[i], + sizeof(struct ktc_token), &oldClient[i]); if (code) { /* some unexpected error occured */ @@ -106,8 +106,8 @@ int main(void) for (i = 0; i < cellCount; i++) { printf("Token[%d]: server = %s@%s, client = %s@%s\n", i, - oldServer[i].name, oldServer[i].cell, - oldClient[i].name, oldClient[i].cell); + oldServer[i].name, oldServer[i].cell, oldClient[i].name, + oldClient[i].cell); } @@ -126,9 +126,9 @@ int main(void) struct ktc_principal dummyPrincipal; struct ktc_token dummyToken; - code = ktc_GetToken(&oldServer[i], - &dummyToken, sizeof(struct ktc_token), - &dummyPrincipal); + code = + ktc_GetToken(&oldServer[i], &dummyToken, sizeof(struct ktc_token), + &dummyPrincipal); if (code != KTC_NOENT) { printf("ktc_ForgetAllTokens did not eliminate all tokens.\n"); @@ -137,7 +137,7 @@ int main(void) cellIndex = 0; - code = ktc_ListTokens(cellIndex, &cellIndex, &dummyPrincipal); + code = ktc_ListTokens(cellIndex, &cellIndex, &dummyPrincipal); if (code != KTC_NOENT) { printf("ktc_ForgetAllTokens did not eliminate all tokens.\n"); @@ -182,9 +182,9 @@ int main(void) } /* fetch token and client identity w.r.t. server */ - code = ktc_GetToken(&newServer[i], - &newToken[i], sizeof(struct ktc_token), - &newClient[i]); + code = + ktc_GetToken(&newServer[i], &newToken[i], + sizeof(struct ktc_token), &newClient[i]); if (code) { /* some unexpected error occured */ @@ -208,9 +208,9 @@ int main(void) found = 0; for (k = 0; k < cellCount; k++) { - if (SamePrincipal(&oldServer[i], &newServer[k]) && - SamePrincipal(&oldClient[i], &newClient[k]) && - SameToken(&oldToken[i], &newToken[k])) { + if (SamePrincipal(&oldServer[i], &newServer[k]) + && SamePrincipal(&oldClient[i], &newClient[k]) + && SameToken(&oldToken[i], &newToken[k])) { /* found a matching token */ found = 1; break; @@ -233,9 +233,8 @@ int main(void) static int SamePrincipal(struct ktc_principal *p1, struct ktc_principal *p2) { - if (strcmp(p1->name, p2->name) || - strcmp(p1->instance, p2->instance) || - strcmp(p1->cell, p2->cell)) { + if (strcmp(p1->name, p2->name) || strcmp(p1->instance, p2->instance) + || strcmp(p1->cell, p2->cell)) { /* principals do not match */ return 0; } else { @@ -248,12 +247,10 @@ SamePrincipal(struct ktc_principal *p1, struct ktc_principal *p2) static int SameToken(struct ktc_token *t1, struct ktc_token *t2) { - if ((t1->startTime != t2->startTime) || - (t1->endTime != t2->endTime) || - memcmp(&t1->sessionKey, &t2->sessionKey, sizeof(t1->sessionKey)) || - (t1->kvno != t2->kvno) || - (t1->ticketLen != t2->ticketLen) || - memcmp(t1->ticket, t2->ticket, t1->ticketLen)) { + if ((t1->startTime != t2->startTime) || (t1->endTime != t2->endTime) + || memcmp(&t1->sessionKey, &t2->sessionKey, sizeof(t1->sessionKey)) + || (t1->kvno != t2->kvno) || (t1->ticketLen != t2->ticketLen) + || memcmp(t1->ticket, t2->ticket, t1->ticketLen)) { /* tokens do not match */ return 0; } else { diff --git a/src/auth/test/testcellconf.c b/src/auth/test/testcellconf.c index b113ef920..c6e72633f 100644 --- a/src/auth/test/testcellconf.c +++ b/src/auth/test/testcellconf.c @@ -25,7 +25,8 @@ Creation date: #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/auth/test/testcellconf.c,v 1.1.1.5 2001/09/11 14:31:24 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/auth/test/testcellconf.c,v 1.7 2003/07/15 23:14:42 shadow Exp $"); #include #include @@ -40,24 +41,26 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/test/testcellconf.c,v 1.1.1.5 2001 #include PrintOneCell(ainfo, arock, adir) -struct afsconf_cell *ainfo; -char *arock; -struct afsconf_dir *adir; { + struct afsconf_cell *ainfo; + char *arock; + struct afsconf_dir *adir; +{ register int i; long temp; printf("Cell %s:\n", ainfo->name); - for(i=0;inumServers;i++) { + for (i = 0; i < ainfo->numServers; i++) { memcpy(&temp, &ainfo->hostAddr[i].sin_addr, sizeof(long)); - printf(" host %s at %x.%x\n", ainfo->hostName[i], temp, ainfo->hostAddr[i].sin_port); + printf(" host %s at %x.%x\n", ainfo->hostName[i], temp, + ainfo->hostAddr[i].sin_port); } return 0; } /*Main for testcellconfig*/ main(argc, argv) -int argc; -char *argv[]; + int argc; + char *argv[]; { struct afsconf_dir *theDir; char tbuffer[1024]; @@ -67,7 +70,8 @@ char *argv[]; char *dirName; if (argc < 2) { - printf("usage: testcellconfig []*\n"); + printf + ("usage: testcellconfig []*\n"); exit(1); } @@ -77,7 +81,7 @@ char *argv[]; printf("could not open configuration files in '%s'\n", dirName); exit(1); } - + /* get the cell */ code = afsconf_GetLocalCell(theDir, tbuffer, sizeof(tbuffer)); if (code != 0) { @@ -85,34 +89,36 @@ char *argv[]; exit(1); } printf("Local cell is '%s'\n\n", tbuffer); - + if (argc == 2) { printf("About to print cell database contents:\n"); afsconf_CellApply(theDir, PrintOneCell, 0); printf("Done.\n\n"); /* do this junk once */ printf("start of special test\n"); - code = afsconf_GetCellInfo(theDir, (char *) 0, "afsprot", &theCell); - if (code) printf("failed to find afsprot service (%d)\n", code); + code = afsconf_GetCellInfo(theDir, NULL, "afsprot", &theCell); + if (code) + printf("failed to find afsprot service (%d)\n", code); else { printf("AFSPROT service:\n"); - PrintOneCell(&theCell, (char *) (char *) 0, theDir); + PrintOneCell(&theCell, (char *)NULL, theDir); } code = afsconf_GetCellInfo(theDir, 0, "bozotheclown", &theCell); - if (code == 0) printf("unexpectedly found service 'bozotheclown'\n"); - code = afsconf_GetCellInfo(theDir, (char *) 0, "telnet", &theCell); + if (code == 0) + printf("unexpectedly found service 'bozotheclown'\n"); + code = afsconf_GetCellInfo(theDir, NULL, "telnet", &theCell); printf("Here's the telnet service:\n"); - PrintOneCell(&theCell, (char *) 0, theDir); + PrintOneCell(&theCell, NULL, theDir); printf("done with special test\n"); - } - else { + } else { /* now print out specified cell info */ - for(i = 2; i #include -RCSID("$Header: /tmp/cvstemp/openafs/src/auth/userok.c,v 1.1.1.7 2001/10/14 18:04:02 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/auth/userok.c,v 1.12 2003/12/07 22:49:17 jaltman Exp $"); #include #include @@ -25,7 +26,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/userok.c,v 1.1.1.7 2001/10/14 18:0 #include #endif #include -#include /* for realpath() */ +#include /* for realpath() */ #include #include #include @@ -48,77 +49,81 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/userok.c,v 1.1.1.7 2001/10/14 18:0 afs_int32 afsconf_SuperUser(); #if !defined(UKERNEL) -int afsconf_CheckAuth(adir, acall) -register struct rx_call *acall; -register struct afsconf_dir *adir; { - LOCK_GLOBAL_MUTEX - return ((afsconf_SuperUser(adir, acall, (char *)0) == 0)? 10029 : 0); - UNLOCK_GLOBAL_MUTEX -} +int +afsconf_CheckAuth(adir, acall) + register struct rx_call *acall; + register struct afsconf_dir *adir; +{ + LOCK_GLOBAL_MUTEX return ((afsconf_SuperUser(adir, acall, NULL) == 0) ? + 10029 : 0); +UNLOCK_GLOBAL_MUTEX} #endif /* !defined(UKERNEL) */ -static GetNoAuthFlag(adir) -struct afsconf_dir *adir; { +static int +GetNoAuthFlag(adir) + struct afsconf_dir *adir; +{ if (access(AFSDIR_SERVER_NOAUTH_FILEPATH, 0) == 0) { - osi_audit ( NoAuthEvent, 0, AUD_END ); /* some random server is running noauth */ - return 1; /* if /usr/afs/local/NoAuth file exists, allow access */ - } + osi_audit(NoAuthEvent, 0, AUD_END); /* some random server is running noauth */ + return 1; /* if /usr/afs/local/NoAuth file exists, allow access */ + } return 0; } +int afsconf_GetNoAuthFlag(adir) -struct afsconf_dir *adir; { + struct afsconf_dir *adir; +{ int rc; - LOCK_GLOBAL_MUTEX - rc = GetNoAuthFlag(adir); - UNLOCK_GLOBAL_MUTEX - return rc; + LOCK_GLOBAL_MUTEX rc = GetNoAuthFlag(adir); + UNLOCK_GLOBAL_MUTEX return rc; } +void afsconf_SetNoAuthFlag(adir, aflag) -struct afsconf_dir *adir; -int aflag; { + struct afsconf_dir *adir; + int aflag; +{ register afs_int32 code; - - LOCK_GLOBAL_MUTEX - if (aflag == 0) { + LOCK_GLOBAL_MUTEX if (aflag == 0) { /* turn off noauth flag */ - code = ( unlink(AFSDIR_SERVER_NOAUTH_FILEPATH) ? errno : 0 ); - osi_audit ( NoAuthDisableEvent, code, AUD_END ); - } - else { + code = (unlink(AFSDIR_SERVER_NOAUTH_FILEPATH) ? errno : 0); + osi_audit(NoAuthDisableEvent, code, AUD_END); + } else { /* try to create file */ - code = open(AFSDIR_SERVER_NOAUTH_FILEPATH, O_CREAT | O_TRUNC | O_RDWR, 0666); - if (code >= 0) { - close(code); - osi_audit ( NoAuthEnableEvent, 0, AUD_END ); - } - else - osi_audit ( NoAuthEnableEvent, errno, AUD_END ); + code = + open(AFSDIR_SERVER_NOAUTH_FILEPATH, O_CREAT | O_TRUNC | O_RDWR, + 0666); + if (code >= 0) { + close(code); + osi_audit(NoAuthEnableEvent, 0, AUD_END); + } else + osi_audit(NoAuthEnableEvent, errno, AUD_END); } - UNLOCK_GLOBAL_MUTEX -} +UNLOCK_GLOBAL_MUTEX} /* deletes a user from the UserList file */ +int afsconf_DeleteUser(adir, auser) -struct afsconf_dir *adir; -register char *auser; { + struct afsconf_dir *adir; + register char *auser; +{ char tbuffer[1024]; char nbuffer[1024]; register FILE *tf; register FILE *nf; register int flag; - char tname[64]; + char tname[64 + 1]; char *tp; int found; struct stat tstat; register afs_int32 code; - LOCK_GLOBAL_MUTEX - strcompose(tbuffer, sizeof tbuffer, adir->name, "/", AFSDIR_ULIST_FILE, NULL); + LOCK_GLOBAL_MUTEX strcompose(tbuffer, sizeof tbuffer, adir->name, "/", + AFSDIR_ULIST_FILE, NULL); #ifndef AFS_NT40_ENV { /* @@ -135,114 +140,121 @@ register char *auser; { #endif /* AFS_NT40_ENV */ tf = fopen(tbuffer, "r"); if (!tf) { - UNLOCK_GLOBAL_MUTEX - return -1; + UNLOCK_GLOBAL_MUTEX return -1; } code = stat(tbuffer, &tstat); if (code < 0) { - UNLOCK_GLOBAL_MUTEX - return code; + UNLOCK_GLOBAL_MUTEX return code; } strcpy(nbuffer, tbuffer); strcat(nbuffer, ".NXX"); nf = fopen(nbuffer, "w+"); if (!nf) { fclose(tf); - UNLOCK_GLOBAL_MUTEX - return EIO; + UNLOCK_GLOBAL_MUTEX return EIO; } flag = 0; found = 0; while (1) { /* check for our user id */ tp = fgets(nbuffer, sizeof(nbuffer), tf); - if (tp == (char *)0) break; + if (tp == NULL) + break; code = sscanf(nbuffer, "%64s", tname); if (code == 1 && strcmp(tname, auser) == 0) { /* found the guy, don't copy to output file */ found = 1; - } - else { + } else { /* otherwise copy original line to output */ fprintf(nf, "%s", nbuffer); } } fclose(tf); - if (ferror(nf)) flag = 1; - if (fclose(nf) == EOF) flag = 1; + if (ferror(nf)) + flag = 1; + if (fclose(nf) == EOF) + flag = 1; strcpy(nbuffer, tbuffer); - strcat(nbuffer, ".NXX"); /* generate new file name again */ + strcat(nbuffer, ".NXX"); /* generate new file name again */ if (flag == 0) { /* try the rename */ flag = renamefile(nbuffer, tbuffer); if (flag == 0) flag = chmod(tbuffer, tstat.st_mode); - } - else unlink(nbuffer); + } else + unlink(nbuffer); /* finally, decide what to return to the caller */ - UNLOCK_GLOBAL_MUTEX - if (flag) return EIO; /* something mysterious went wrong */ - if (!found) return ENOENT; /* entry wasn't found, no changes made */ + UNLOCK_GLOBAL_MUTEX if (flag) + return EIO; /* something mysterious went wrong */ + if (!found) + return ENOENT; /* entry wasn't found, no changes made */ return 0; /* everything was fine */ } /* returns nth super user from the UserList file */ +int afsconf_GetNthUser(adir, an, abuffer, abufferLen) -struct afsconf_dir *adir; -afs_int32 an; -char *abuffer; -afs_int32 abufferLen; { + struct afsconf_dir *adir; + afs_int32 an; + char *abuffer; + afs_int32 abufferLen; +{ char tbuffer[256]; register FILE *tf; - char tname[64]; + char tname[64 + 1]; register char *tp; register int flag; register afs_int32 code; - LOCK_GLOBAL_MUTEX - strcompose(tbuffer, sizeof tbuffer, adir->name, "/", AFSDIR_ULIST_FILE, NULL); + LOCK_GLOBAL_MUTEX strcompose(tbuffer, sizeof tbuffer, adir->name, "/", + AFSDIR_ULIST_FILE, NULL); tf = fopen(tbuffer, "r"); if (!tf) { - UNLOCK_GLOBAL_MUTEX - return 1; + UNLOCK_GLOBAL_MUTEX return 1; } flag = 1; while (1) { /* check for our user id */ tp = fgets(tbuffer, sizeof(tbuffer), tf); - if (tp == (char *)0) break; + if (tp == NULL) + break; code = sscanf(tbuffer, "%64s", tname); if (code == 1 && an-- == 0) { flag = 0; break; } } - if (flag == 0) strcpy(abuffer, tname); + if (flag == 0) + strcpy(abuffer, tname); fclose(tf); - UNLOCK_GLOBAL_MUTEX - return flag; + UNLOCK_GLOBAL_MUTEX return flag; } /* returns true iff user is in the UserList file */ -static FindUser(adir, auser) -struct afsconf_dir *adir; -register char *auser; { +static int +FindUser(adir, auser) + struct afsconf_dir *adir; + register char *auser; +{ char tbuffer[256]; register bufio_p bp; - char tname[64]; + char tname[64 + 1]; register int flag; register afs_int32 code; int rc; - strcompose(tbuffer, sizeof tbuffer, adir->name, "/", AFSDIR_ULIST_FILE, NULL); + strcompose(tbuffer, sizeof tbuffer, adir->name, "/", AFSDIR_ULIST_FILE, + NULL); bp = BufioOpen(tbuffer, O_RDONLY, 0); - if (!bp) return 0; + if (!bp) + return 0; flag = 0; while (1) { /* check for our user id */ rc = BufioGets(bp, tbuffer, sizeof(tbuffer)); - if (rc < 0) break; + if (rc < 0) + break; code = sscanf(tbuffer, "%64s", tname); if (code == 1 && strcmp(tname, auser) == 0) { flag = 1; @@ -254,67 +266,71 @@ register char *auser; { } /* add a user to the user list, checking for duplicates */ +int afsconf_AddUser(adir, aname) -struct afsconf_dir *adir; -char *aname; { + struct afsconf_dir *adir; + char *aname; +{ FILE *tf; register afs_int32 code; char tbuffer[256]; - LOCK_GLOBAL_MUTEX - if (FindUser(adir, aname)) { - UNLOCK_GLOBAL_MUTEX - return EEXIST; /* already in the list */ + LOCK_GLOBAL_MUTEX if (FindUser(adir, aname)) { + UNLOCK_GLOBAL_MUTEX return EEXIST; /* already in the list */ } - strcompose(tbuffer, sizeof tbuffer, adir->name, "/", AFSDIR_ULIST_FILE, NULL); + strcompose(tbuffer, sizeof tbuffer, adir->name, "/", AFSDIR_ULIST_FILE, + NULL); tf = fopen(tbuffer, "a+"); if (!tf) { - UNLOCK_GLOBAL_MUTEX - return EIO; + UNLOCK_GLOBAL_MUTEX return EIO; } fprintf(tf, "%s\n", aname); code = 0; - if (ferror(tf)) code = EIO; - if (fclose(tf)) code = EIO; - UNLOCK_GLOBAL_MUTEX - return code; + if (ferror(tf)) + code = EIO; + if (fclose(tf)) + code = EIO; + UNLOCK_GLOBAL_MUTEX return code; } /* special CompFindUser routine that builds up a princ and then calls finduser on it. If found, returns char * to user string, otherwise returns NULL. The resulting string should be immediately copied to other storage prior to release of mutex. */ -static char *CompFindUser(adir, name, sep, inst, realm) - struct afsconf_dir *adir; - char *name; - char *sep; - char *inst; - char *realm; +static char * +CompFindUser(adir, name, sep, inst, realm) + struct afsconf_dir *adir; + char *name; + char *sep; + char *inst; + char *realm; { - static char fullname[ MAXKTCNAMELEN + MAXKTCNAMELEN + - MAXKTCREALMLEN + 3 ]; + static char fullname[MAXKTCNAMELEN + MAXKTCNAMELEN + MAXKTCREALMLEN + 3]; /* always must have name */ - if ( !name || !name[0] ) { return NULL; } + if (!name || !name[0]) { + return NULL; + } strcpy(fullname, name); /* might have instance */ - if ( inst && inst[0] ) { - if ( !sep || !sep[0] ) { return NULL; } + if (inst && inst[0]) { + if (!sep || !sep[0]) { + return NULL; + } strcat(fullname, sep); strcat(fullname, inst); } /* might have realm */ - if ( realm && realm[0] ) - { + if (realm && realm[0]) { strcat(fullname, "@"); strcat(fullname, realm); } - if ( FindUser(adir, fullname) ) { + if (FindUser(adir, fullname)) { return fullname; } else { return NULL; @@ -326,77 +342,74 @@ static char *CompFindUser(adir, name, sep, inst, realm) users. Copy the "real name" of the authenticated user into namep if a pointer is passed. */ -afs_int32 afsconf_SuperUser(adir, acall, namep) -struct afsconf_dir *adir; -struct rx_call *acall; -char *namep; { +afs_int32 +afsconf_SuperUser(adir, acall, namep) + struct afsconf_dir *adir; + struct rx_call *acall; + char *namep; +{ register struct rx_connection *tconn; register afs_int32 code; int flag; - LOCK_GLOBAL_MUTEX - if (!adir) { - UNLOCK_GLOBAL_MUTEX - return 0; + LOCK_GLOBAL_MUTEX if (!adir) { + UNLOCK_GLOBAL_MUTEX return 0; } if (afsconf_GetNoAuthFlag(adir)) { - if (namep) strcpy(namep, ""); - UNLOCK_GLOBAL_MUTEX - return 1; + if (namep) + strcpy(namep, ""); + UNLOCK_GLOBAL_MUTEX return 1; } tconn = rx_ConnectionOf(acall); code = rx_SecurityClassOf(tconn); - if (code == 0) { - UNLOCK_GLOBAL_MUTEX - return 0; /* not authenticated at all, answer is no */ - } - else if (code == 1) { + if (code == 0) { + UNLOCK_GLOBAL_MUTEX return 0; /* not authenticated at all, answer is no */ + } else if (code == 1) { /* bcrypt tokens */ - UNLOCK_GLOBAL_MUTEX - return 0; /* not supported any longer */ - } - else if (code == 2) { + UNLOCK_GLOBAL_MUTEX return 0; /* not supported any longer */ + } else if (code == 2) { char tname[MAXKTCNAMELEN]; /* authentication from ticket */ char tinst[MAXKTCNAMELEN]; char tcell[MAXKTCREALMLEN]; char tcell_l[MAXKTCREALMLEN]; char *tmp; - + /* keep track of which one actually authorized request */ - char uname[MAXKTCNAMELEN+MAXKTCNAMELEN+MAXKTCREALMLEN+3]; + char uname[MAXKTCNAMELEN + MAXKTCNAMELEN + MAXKTCREALMLEN + 3]; afs_uint32 exp; static char lcell[MAXCELLCHARS] = ""; static char lrealm[AFS_REALM_SZ] = ""; - + /* get auth details from server connection */ - code = rxkad_GetServerInfo - (acall->conn, (afs_int32 *) 0, &exp, - tname, tinst, tcell, (afs_int32 *) 0); + code = + rxkad_GetServerInfo(acall->conn, NULL, &exp, tname, tinst, tcell, + NULL); if (code) { - UNLOCK_GLOBAL_MUTEX - return 0; /* bogus connection/other error */ + UNLOCK_GLOBAL_MUTEX return 0; /* bogus connection/other error */ } /* don't bother checking anything else if tix have expired */ #ifdef AFS_PTHREAD_ENV - if (exp < clock_Sec()) { + if (exp < clock_Sec()) { #else - if (exp < FT_ApproxTime()) { + if (exp < FT_ApproxTime()) { #endif - UNLOCK_GLOBAL_MUTEX - return 0; /* expired tix */ + UNLOCK_GLOBAL_MUTEX return 0; /* expired tix */ } /* generate lowercased version of cell name */ strcpy(tcell_l, tcell); tmp = tcell_l; - while ( *tmp ) { *tmp = tolower(*tmp); *tmp++; } + while (*tmp) { + *tmp = tolower(*tmp); + *tmp++; + } /* determine local cell name. It's static, so will only get - calculated the first time through */ + * calculated the first time through */ if (!lcell[0]) afsconf_GetLocalCell(adir, lcell, sizeof(lcell)); @@ -404,7 +417,7 @@ char *namep; { /* note - this assumes AFS_REALM_SZ <= MAXCELLCHARS */ /* just set it to lcell if it fails */ if (!lrealm[0]) { - if (afs_krb_get_lrealm(lrealm, 0) != 0) /* KSUCCESS */ + if (afs_krb_get_lrealm(lrealm, 0) != 0) /* KSUCCESS */ strncpy(lrealm, lcell, AFS_REALM_SZ); } @@ -414,38 +427,38 @@ char *namep; { flag = 0; /* localauth special case */ - if ( strlen(tinst) == 0 && strlen(tcell) == 0 && - !strcmp(tname, AUTH_SUPERUSER) ) { + if (strlen(tinst) == 0 && strlen(tcell) == 0 + && !strcmp(tname, AUTH_SUPERUSER)) { strcpy(uname, ""); flag = 1; - /* cell of connection matches local cell or krb4 realm */ - } else if ( !strcasecmp(tcell, lcell) || !strcasecmp(tcell,lrealm) ) { - if ( (tmp = CompFindUser(adir, tname, ".", tinst, NULL)) ) { + /* cell of connection matches local cell or krb4 realm */ + } else if (!strcasecmp(tcell, lcell) || !strcasecmp(tcell, lrealm)) { + if ((tmp = CompFindUser(adir, tname, ".", tinst, NULL))) { strcpy(uname, tmp); flag = 1; #ifdef notyet - } else if ( (tmp = CompFindUser(adir, tname, "/", tinst, NULL)) ) { + } else if ((tmp = CompFindUser(adir, tname, "/", tinst, NULL))) { strcpy(uname, tmp); flag = 1; #endif } - /* cell of conn doesn't match local cell or realm */ + /* cell of conn doesn't match local cell or realm */ } else { - if ( (tmp = CompFindUser(adir, tname, ".", tinst, tcell)) ) { + if ((tmp = CompFindUser(adir, tname, ".", tinst, tcell))) { strcpy(uname, tmp); flag = 1; #ifdef notyet - } else if ( (tmp = CompFindUser(adir, tname, "/", tinst, tcell)) ) { + } else if ((tmp = CompFindUser(adir, tname, "/", tinst, tcell))) { strcpy(uname, tmp); flag = 1; #endif - } else if ( (tmp = CompFindUser(adir, tname, ".", tinst, tcell_l)) ) { + } else if ((tmp = CompFindUser(adir, tname, ".", tinst, tcell_l))) { strcpy(uname, tmp); flag = 1; #ifdef notyet - } else if ( (tmp = CompFindUser(adir, tname, "/", tinst, tcell_l)) ) { + } else if ((tmp = CompFindUser(adir, tname, "/", tinst, tcell_l))) { strcpy(uname, tmp); flag = 1; #endif @@ -454,11 +467,8 @@ char *namep; { if (namep) strcpy(namep, uname); - UNLOCK_GLOBAL_MUTEX - return flag; - } - else { /* some other auth type */ - UNLOCK_GLOBAL_MUTEX - return 0; /* mysterious, just say no */ + UNLOCK_GLOBAL_MUTEX return flag; + } else { /* some other auth type */ + UNLOCK_GLOBAL_MUTEX return 0; /* mysterious, just say no */ } } diff --git a/src/auth/writeconfig.c b/src/auth/writeconfig.c index a08e86157..9cde1a001 100644 --- a/src/auth/writeconfig.c +++ b/src/auth/writeconfig.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/auth/writeconfig.c,v 1.1.1.7 2001/10/14 18:04:02 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/auth/writeconfig.c,v 1.10 2003/12/07 22:49:17 jaltman Exp $"); #include #include @@ -47,33 +48,37 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/writeconfig.c,v 1.1.1.7 2001/10/14 by acellInfo parm. Useful only on the server (which describes only one cell). */ -static VerifyEntries(aci) -register struct afsconf_cell *aci; { +static int +VerifyEntries(aci) + register struct afsconf_cell *aci; +{ register int i; register struct hostent *th; - - for(i=0;inumServers;i++) { + + for (i = 0; i < aci->numServers; i++) { if (aci->hostAddr[i].sin_addr.s_addr == 0) { /* no address spec'd */ if (*(aci->hostName[i]) != 0) { th = gethostbyname(aci->hostName[i]); if (!th) { - printf("Host %s not found in host database...\n", aci->hostName[i]); - return AFSCONF_FAILURE; + printf("Host %s not found in host database...\n", + aci->hostName[i]); + return AFSCONF_FAILURE; } - memcpy(&aci->hostAddr[i].sin_addr, th->h_addr, sizeof(afs_int32)); + memcpy(&aci->hostAddr[i].sin_addr, th->h_addr, + sizeof(afs_int32)); } /* otherwise we're deleting this entry */ - } - else { + } else { /* address spec'd, perhaps no name known */ - if (aci->hostName[i][0] != 0) continue; /* name known too */ + if (aci->hostName[i][0] != 0) + continue; /* name known too */ /* figure out name, if possible */ - th = gethostbyaddr((char *)(&aci->hostAddr[i].sin_addr), 4, AF_INET); + th = gethostbyaddr((char *)(&aci->hostAddr[i].sin_addr), 4, + AF_INET); if (!th) { strcpy(aci->hostName[i], "UNKNOWNHOST"); - } - else { + } else { strcpy(aci->hostName[i], th->h_name); } } @@ -84,89 +89,91 @@ register struct afsconf_cell *aci; { /* Changed the interface to accept the afsconf_dir datastructure. This is a handle to the internal cache that is maintained by the bosserver. */ - + +int afsconf_SetCellInfo(adir, apath, acellInfo) -struct afsconf_dir *adir; -char *apath; -struct afsconf_cell *acellInfo; + struct afsconf_dir *adir; + char *apath; + struct afsconf_cell *acellInfo; { afs_int32 code; - code = afsconf_SetExtendedCellInfo(adir, apath, acellInfo, (char *)0); + code = afsconf_SetExtendedCellInfo(adir, apath, acellInfo, NULL); return code; } - + +int afsconf_SetExtendedCellInfo(adir, apath, acellInfo, clones) - struct afsconf_dir *adir; - char *apath; - struct afsconf_cell *acellInfo; - char clones[]; + struct afsconf_dir *adir; + char *apath; + struct afsconf_cell *acellInfo; + char clones[]; { register afs_int32 code; register int fd; char tbuffer[1024]; register FILE *tf; register afs_int32 i; - + LOCK_GLOBAL_MUTEX - /* write ThisCell file */ - strcompose(tbuffer, 1024, apath, "/", AFSDIR_THISCELL_FILE, NULL); + /* write ThisCell file */ + strcompose(tbuffer, 1024, apath, "/", AFSDIR_THISCELL_FILE, NULL); fd = open(tbuffer, O_RDWR | O_CREAT | O_TRUNC, 0666); if (fd < 0) { - UNLOCK_GLOBAL_MUTEX - return errno; + UNLOCK_GLOBAL_MUTEX return errno; } i = strlen(acellInfo->name); code = write(fd, acellInfo->name, i); if (code != i) { - UNLOCK_GLOBAL_MUTEX - return AFSCONF_FAILURE; + UNLOCK_GLOBAL_MUTEX return AFSCONF_FAILURE; } if (close(fd) < 0) { - UNLOCK_GLOBAL_MUTEX - return errno; + UNLOCK_GLOBAL_MUTEX return errno; } - + /* make sure we have both name and address for each host, looking up other - if need be */ + * if need be */ code = VerifyEntries(acellInfo); if (code) { - UNLOCK_GLOBAL_MUTEX - return code; + UNLOCK_GLOBAL_MUTEX return code; } /* write CellServDB */ strcompose(tbuffer, 1024, apath, "/", AFSDIR_CELLSERVDB_FILE, NULL); tf = fopen(tbuffer, "w"); if (!tf) { - UNLOCK_GLOBAL_MUTEX - return AFSCONF_NOTFOUND; + UNLOCK_GLOBAL_MUTEX return AFSCONF_NOTFOUND; } - fprintf(tf, ">%s #Cell name\n", acellInfo->name); - for(i=0;i < acellInfo->numServers; i++) { + fprintf(tf, ">%s #Cell name\n", acellInfo->name); + for (i = 0; i < acellInfo->numServers; i++) { code = acellInfo->hostAddr[i].sin_addr.s_addr; /* net order */ - if (code == 0) continue; /* delete request */ + if (code == 0) + continue; /* delete request */ code = ntohl(code); /* convert to host order */ - if (clones && clones[i]) - fprintf(tf, "[%d.%d.%d.%d] #%s\n", (code>>24) & 0xff, (code>>16)&0xff, (code>>8)&0xff, code&0xff, acellInfo->hostName[i]); - else - fprintf(tf, "%d.%d.%d.%d #%s\n", (code>>24) & 0xff, (code>>16)&0xff, (code>>8)&0xff, code&0xff, acellInfo->hostName[i]); + if (clones && clones[i]) + fprintf(tf, "[%d.%d.%d.%d] #%s\n", (code >> 24) & 0xff, + (code >> 16) & 0xff, (code >> 8) & 0xff, code & 0xff, + acellInfo->hostName[i]); + else + fprintf(tf, "%d.%d.%d.%d #%s\n", (code >> 24) & 0xff, + (code >> 16) & 0xff, (code >> 8) & 0xff, code & 0xff, + acellInfo->hostName[i]); } if (ferror(tf)) { fclose(tf); - UNLOCK_GLOBAL_MUTEX - return AFSCONF_FAILURE; + UNLOCK_GLOBAL_MUTEX return AFSCONF_FAILURE; } code = fclose(tf); /* Reset the timestamp in the cache, so that - the CellServDB is read into the cache next time. - Resolves the lost update problem due to an inconsistent cache - */ - if (adir) adir->timeRead = 0; + * the CellServDB is read into the cache next time. + * Resolves the lost update problem due to an inconsistent cache + */ + if (adir) + adir->timeRead = 0; - UNLOCK_GLOBAL_MUTEX - if (code == EOF) return AFSCONF_FAILURE; + UNLOCK_GLOBAL_MUTEX if (code == EOF) + return AFSCONF_FAILURE; return 0; } diff --git a/src/bozo/Makefile.in b/src/bozo/Makefile.in index c48b800c1..c6c0a9161 100644 --- a/src/bozo/Makefile.in +++ b/src/bozo/Makefile.in @@ -5,30 +5,9 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html -DEST=@DEST@ -TOP_INCDIR=@TOP_INCDIR@ -TOP_LIBDIR=@TOP_LIBDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -libdir=@libdir@ -includedir=@includedir@ -mandir=@mandir@ -afssrvbindir=@afssrvbindir@ -afssrvsbindir=@afssrvsbindir@ -afssrvlibexecdir=@afssrvlibexecdir@ -RXGEN=${TOP_SRCDIR}/rxgen/rxgen -TOP_SRCDIR=@TOP_SRCDIR@ -SYS_NAME=@AFS_SYSNAME@ - -SHELL=/bin/sh - -include ../config/Makefile.${SYS_NAME} - -COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et -CFLAGS=${DBG} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config + RPCINCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/rx/rx.h bosint.h INCLS=bnode.h \ @@ -68,11 +47,25 @@ bosint.ss.o: bosint.ss.c ${RPCINCLS} bosint.xdr.o: bosint.xdr.c ${RPCINCLS} bosint.cs.o: bosint.cs.c ${RPCINCLS} -bosint.xdr.c bosint.ss.c bosint.cs.c bosint.h: bosint.xg - ${RXGEN} -x bosint.xg +bosint.cs.c: bosint.xg + ${RXGEN} -x -C -o $@ ${srcdir}/bosint.xg + +bosint.ss.c: bosint.xg + ${RXGEN} -x -S -o $@ ${srcdir}/bosint.xg + +bosint.xdr.c: bosint.xg + ${RXGEN} -x -c -o $@ ${srcdir}/bosint.xg + +bosint.h: bosint.xg + ${RXGEN} -x -h -o $@ ${srcdir}/bosint.xg + +bosint.cs.c: bosint.h +bosint.ss.c: bosint.h +bosint.xdr.c: bosint.h bnode.h boserr.c: bnode.p.h boserr.et - $(RM) -f boserr.c bnode.h; $(COMPILE_ET) boserr -h bnode + $(RM) -f boserr.c bnode.h + ${COMPILE_ET} -p ${srcdir} boserr -h bnode bosserver.o: bosserver.c ${INCLS} AFS_component_version_number.o diff --git a/src/bozo/NTMakefile b/src/bozo/NTMakefile index 7a6f08524..e59bcd29e 100644 --- a/src/bozo/NTMakefile +++ b/src/bozo/NTMakefile @@ -5,10 +5,10 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=bozo !INCLUDE ..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\config\NTMakefile.version - ############################################################################ # Header files to install @@ -22,10 +22,10 @@ INCFILES =\ BOS_LIBFILE = $(DESTDIR)\lib\afs\afsbos.lib BOS_LIBOBJS =\ - AFS_component_version_number.obj \ - bosint.cs.obj \ - bosint.xdr.obj \ - boserr.obj + $(OUT)\bosint.cs.obj \ + $(OUT)\bosint.xdr.obj \ + $(OUT)\boserr.obj \ + $(OUT)\AFS_component_version_number.obj $(BOS_LIBFILE): $(BOS_LIBOBJS) $(LIBARCH) @@ -37,14 +37,14 @@ $(BOS_LIBFILE): $(BOS_LIBOBJS) BOSSERVER_EXEFILE = $(DESTDIR)\root.server\usr\afs\bin\bosserver.exe BOSSERVER_EXEOBJS =\ - bosserver.obj \ - bnode.obj \ - cronbnodeops.obj \ - ezbnodeops.obj \ - fsbnodeops.obj \ - bosint.ss.obj \ - bosoprocs.obj \ - bosserver.res + $(OUT)\bosserver.obj \ + $(OUT)\bnode.obj \ + $(OUT)\cronbnodeops.obj \ + $(OUT)\ezbnodeops.obj \ + $(OUT)\fsbnodeops.obj \ + $(OUT)\bosint.ss.obj \ + $(OUT)\bosoprocs.obj \ + $(OUT)\bosserver.res BOSSERVER_EXELIBS =\ @@ -81,8 +81,8 @@ RS_BOS_EXEFILE = $(DESTDIR)\root.server\usr\afs\bin\bos.exe CL_BOS_EXEFILE = $(DESTDIR)\bin\bos.exe BOS_EXEOBJS =\ - bos.obj \ - bos.res + $(OUT)\bos.obj \ + $(OUT)\bos.res BOS_EXELIBS =\ $(DESTDIR)\lib\afsrx.lib \ @@ -130,11 +130,9 @@ bnode.h boserr.c: boserr.et bnode.p.h ############################################################################ # Definitions for generating versioninfo resources -bosserver.res: bosserver.rc AFS_component_version_number.h - $(RC) $*.rc +$(OUT)\bosserver.res: AFS_component_version_number.h -bos.res: bos.rc AFS_component_version_number.h - $(RC) $*.rc +$(OUT)\bos.res: AFS_component_version_number.h ############################################################################ # Install target; primary makefile target @@ -147,3 +145,6 @@ install: $(BOS_LIBFILE) $(BOSSERVER_EXEFILE) $(CL_BOS_EXEFILE) $(INCFILES) clean:: $(DEL) bnode.h boserr.c bosint.cs.c bosint.h bosint.ss.c bosint.xdr.c + +mkdir: + diff --git a/src/bozo/bnode.c b/src/bozo/bnode.c index fc0f01b56..6b0c0a567 100644 --- a/src/bozo/bnode.c +++ b/src/bozo/bnode.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bnode.c,v 1.1.1.9 2002/09/26 19:04:55 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bozo/bnode.c,v 1.17 2003/07/15 23:14:42 shadow Exp $"); #include #include @@ -27,7 +28,16 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bnode.c,v 1.1.1.9 2002/09/26 19:04 #include #endif #include -#include /* signal(), kill(), wait(), etc. */ + +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif + +#include /* signal(), kill(), wait(), etc. */ #include #include #include @@ -42,34 +52,32 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bnode.c,v 1.1.1.9 2002/09/26 19:04 #define BNODE_LWP_STACKSIZE (16 * 1024) int bnode_waiting = 0; -static PROCESS bproc_pid; /* pid of waker-upper */ -static struct bnode *allBnodes=0; /* list of all bnodes */ -static struct bnode_proc *allProcs=0; /* list of all processes for which we're waiting */ -static struct bnode_type *allTypes=0; /* list of registered type handlers */ +static PROCESS bproc_pid; /* pid of waker-upper */ +static struct bnode *allBnodes = 0; /* list of all bnodes */ +static struct bnode_proc *allProcs = 0; /* list of all processes for which we're waiting */ +static struct bnode_type *allTypes = 0; /* list of registered type handlers */ static struct bnode_stats { int weirdPids; } bnode_stats; -static afs_int32 SendNotifierData(); -static int DeleteProc(); - #ifndef AFS_NT40_ENV -extern char **environ; /* env structure */ +extern char **environ; /* env structure */ #endif /* Remember the name of the process, if any, that failed last */ -static void RememberProcName(ap) -register struct bnode_proc *ap; { +static void +RememberProcName(register struct bnode_proc *ap) +{ register struct bnode *tbnodep; tbnodep = ap->bnode; if (tbnodep->lastErrorName) { free(tbnodep->lastErrorName); - tbnodep->lastErrorName = (char *) 0; + tbnodep->lastErrorName = NULL; } if (ap->coreName) { - tbnodep->lastErrorName = (char *) malloc(strlen(ap->coreName)+1); + tbnodep->lastErrorName = (char *)malloc(strlen(ap->coreName) + 1); strcpy(tbnodep->lastErrorName, ap->coreName); } } @@ -77,10 +85,9 @@ register struct bnode_proc *ap; { /* utility for use by BOP_HASCORE functions to determine where a core file might * be stored. */ -bnode_CoreName(abnode, acoreName, abuffer) -register struct bnode *abnode; -char *acoreName; -char *abuffer; { +int +bnode_CoreName(register struct bnode *abnode, char *acoreName, char *abuffer) +{ strcpy(abuffer, AFSDIR_SERVER_CORELOG_FILEPATH); if (acoreName) { strcat(abuffer, acoreName); @@ -91,62 +98,64 @@ char *abuffer; { } /* save core file, if any */ -static void SaveCore(abnode, aproc) -register struct bnode_proc *aproc; -register struct bnode *abnode; { +static void +SaveCore(register struct bnode *abnode, register struct bnode_proc + *aproc) +{ char tbuffer[256]; struct stat tstat; register afs_int32 code; #ifdef BOZO_SAVE_CORES - struct timeval Start; + struct timeval Start; struct tm *TimeFields; char FileName[256]; #endif code = stat(AFSDIR_SERVER_CORELOG_FILEPATH, &tstat); - if (code) return; - + if (code) + return; + bnode_CoreName(abnode, aproc->coreName, tbuffer); #ifdef BOZO_SAVE_CORES TM_GetTimeOfDay(&Start, 0); TimeFields = localtime(&Start.tv_sec); - sprintf(FileName,"%s.%d%02d%02d%02d%02d%02d", tbuffer, - TimeFields->tm_year, TimeFields->tm_mon + 1, - TimeFields->tm_mday, TimeFields->tm_hour, TimeFields->tm_min, - TimeFields->tm_sec); - strcpy(tbuffer,FileName); + sprintf(FileName, "%s.%d%02d%02d%02d%02d%02d", tbuffer, + TimeFields->tm_year, TimeFields->tm_mon + 1, TimeFields->tm_mday, + TimeFields->tm_hour, TimeFields->tm_min, TimeFields->tm_sec); + strcpy(tbuffer, FileName); #endif code = renamefile(AFSDIR_SERVER_CORELOG_FILEPATH, tbuffer); } -bnode_GetString(abnode, abuffer, alen) -register struct bnode *abnode; -register char *abuffer; -register afs_int32 alen;{ +int +bnode_GetString(register struct bnode *abnode, register char *abuffer, + register afs_int32 alen) +{ return BOP_GETSTRING(abnode, abuffer, alen); } -bnode_GetParm(abnode, aindex, abuffer, alen) -register struct bnode *abnode; -register afs_int32 aindex; -register char *abuffer; -afs_int32 alen; { +int +bnode_GetParm(register struct bnode *abnode, register afs_int32 aindex, + register char *abuffer, afs_int32 alen) +{ return BOP_GETPARM(abnode, aindex, abuffer, alen); } -bnode_GetStat(abnode, astatus) -register struct bnode *abnode; -register afs_int32 *astatus; { +int +bnode_GetStat(register struct bnode *abnode, register afs_int32 * astatus) +{ return BOP_GETSTAT(abnode, astatus); } -bnode_RestartP(abnode) -register struct bnode *abnode; { +int +bnode_RestartP(register struct bnode *abnode) +{ return BOP_RESTARTP(abnode); } -static bnode_Check(abnode) -register struct bnode *abnode; { +static int +bnode_Check(register struct bnode *abnode) +{ if (abnode->flags & BNODE_WAIT) { abnode->flags &= ~BNODE_WAIT; LWP_NoYieldSignal(abnode); @@ -155,19 +164,22 @@ register struct bnode *abnode; { } /* tell if an instance has a core file */ -bnode_HasCore(abnode) -register struct bnode *abnode; { +int +bnode_HasCore(register struct bnode *abnode) +{ return BOP_HASCORE(abnode); } /* wait for all bnodes to stabilize */ -bnode_WaitAll() { +int +bnode_WaitAll() +{ register struct bnode *tb; register afs_int32 code; afs_int32 stat; retry: - for(tb = allBnodes; tb; tb=tb->next) { + for (tb = allBnodes; tb; tb = tb->next) { bnode_Hold(tb); code = BOP_GETSTAT(tb, &stat); if (code) { @@ -186,9 +198,9 @@ bnode_WaitAll() { } /* wait until bnode status is correct */ -bnode_WaitStatus(abnode, astatus) -int astatus; -register struct bnode *abnode; { +int +bnode_WaitStatus(register struct bnode *abnode, int astatus) +{ register afs_int32 code; afs_int32 stat; @@ -196,16 +208,17 @@ register struct bnode *abnode; { while (1) { /* get the status */ code = BOP_GETSTAT(abnode, &stat); - if (code) return code; + if (code) + return code; /* otherwise, check if we're done */ if (stat == astatus) { bnode_Release(abnode); - return 0; /* done */ + return 0; /* done */ } if (astatus != abnode->goal) { bnode_Release(abnode); - return -1; /* no longer our goal, don't keep waiting */ + return -1; /* no longer our goal, don't keep waiting */ } /* otherwise, block */ abnode->flags |= BNODE_WAIT; @@ -213,9 +226,9 @@ register struct bnode *abnode; { } } -bnode_SetStat(abnode, agoal) -register struct bnode *abnode; -register int agoal; { +int +bnode_SetStat(register struct bnode *abnode, register int agoal) +{ abnode->goal = agoal; bnode_Check(abnode); BOP_SETSTAT(abnode, agoal); @@ -223,69 +236,75 @@ register int agoal; { return 0; } -bnode_SetGoal(abnode, agoal) -register struct bnode *abnode; -register int agoal; { +int +bnode_SetGoal(register struct bnode *abnode, register int agoal) +{ abnode->goal = agoal; bnode_Check(abnode); return 0; } -bnode_SetFileGoal(abnode, agoal) -register struct bnode *abnode; -register int agoal; { - if (abnode->fileGoal == agoal) return 0; /* already done */ +int +bnode_SetFileGoal(register struct bnode *abnode, register int agoal) +{ + if (abnode->fileGoal == agoal) + return 0; /* already done */ abnode->fileGoal = agoal; WriteBozoFile(0); return 0; } /* apply a function to all bnodes in the system */ -int bnode_ApplyInstance(aproc, arock) -int (*aproc)(); -char *arock; { +int +bnode_ApplyInstance(int (*aproc) (), char *arock) +{ register struct bnode *tb, *nb; register afs_int32 code; - for(tb = allBnodes; tb; tb=nb) { + for (tb = allBnodes; tb; tb = nb) { nb = tb->next; code = (*aproc) (tb, arock); - if (code) return code; + if (code) + return code; } return 0; } -struct bnode *bnode_FindInstance (aname) -register char *aname; { +struct bnode * +bnode_FindInstance(register char *aname) +{ register struct bnode *tb; - - for(tb=allBnodes;tb;tb=tb->next) { - if (!strcmp(tb->name, aname)) return tb; + + for (tb = allBnodes; tb; tb = tb->next) { + if (!strcmp(tb->name, aname)) + return tb; } - return (struct bnode *) 0; + return NULL; } -static struct bnode_type *FindType(aname) -register char *aname; { +static struct bnode_type * +FindType(register char *aname) +{ register struct bnode_type *tt; - - for(tt=allTypes;tt;tt=tt->next) { - if (!strcmp(tt->name, aname)) return tt; + + for (tt = allTypes; tt; tt = tt->next) { + if (!strcmp(tt->name, aname)) + return tt; } - return (struct bnode_type *) 0; + return (struct bnode_type *)0; } -bnode_Register(atype, aprocs, anparms) -char *atype; -int anparms; /* number of parms to create */ -struct bnode_ops *aprocs; { +int +bnode_Register(char *atype, struct bnode_ops *aprocs, int anparms) +{ register struct bnode_type *tt; - for(tt=allTypes;tt;tt=tt->next) { - if (!strcmp(tt->name, atype)) break; + for (tt = allTypes; tt; tt = tt->next) { + if (!strcmp(tt->name, atype)) + break; } if (!tt) { - tt = (struct bnode_type *) malloc(sizeof(struct bnode_type)); + tt = (struct bnode_type *)malloc(sizeof(struct bnode_type)); memset(tt, 0, sizeof(struct bnode_type)); tt->next = allTypes; allTypes = tt; @@ -295,35 +314,38 @@ struct bnode_ops *aprocs; { return 0; } -afs_int32 bnode_Create(atype, ainstance, abp, ap1, ap2, ap3, ap4, ap5, notifier,fileGoal) -char *atype; -char *ainstance; -struct bnode **abp; -char *ap1, *ap2, *ap3, *ap4, *ap5, *notifier; -int fileGoal;{ +afs_int32 +bnode_Create(char *atype, char *ainstance, struct bnode ** abp, char *ap1, + char *ap2, char *ap3, char *ap4, char *ap5, char *notifier, + int fileGoal) +{ struct bnode_type *type; struct bnode *tb; char *notifierpath = NULL; struct stat tstat; - if (bnode_FindInstance(ainstance)) return BZEXISTS; + if (bnode_FindInstance(ainstance)) + return BZEXISTS; type = FindType(atype); - if (!type) return BZBADTYPE; + if (!type) + return BZBADTYPE; if (notifier && strcmp(notifier, NONOTIFIER)) { /* construct local path from canonical (wire-format) path */ if (ConstructLocalBinPath(notifier, ¬ifierpath)) { - bozo_Log("BNODE-Create: Notifier program path invalid '%s'\n", notifier); + bozo_Log("BNODE-Create: Notifier program path invalid '%s'\n", + notifier); return BZNOCREATE; } if (stat(notifierpath, &tstat)) { - bozo_Log("BNODE-Create: Notifier program '%s' not found\n", notifierpath); + bozo_Log("BNODE-Create: Notifier program '%s' not found\n", + notifierpath); free(notifierpath); return BZNOCREATE; } } - tb = (*type->ops->create)(ainstance, ap1, ap2, ap3, ap4, ap5); + tb = (*type->ops->create) (ainstance, ap1, ap2, ap3, ap4, ap5); if (!tb) { free(notifierpath); return BZNOCREATE; @@ -333,33 +355,37 @@ int fileGoal;{ tb->type = type; /* The fs_create above calls bnode_InitBnode() which always sets the - ** fileGoal to BSTAT_NORMAL .... overwrite it with whatever is passed into - ** this function as a parameter... */ + ** fileGoal to BSTAT_NORMAL .... overwrite it with whatever is passed into + ** this function as a parameter... */ tb->fileGoal = fileGoal; - bnode_SetStat(tb, tb->goal); /* nudge it once */ + bnode_SetStat(tb, tb->goal); /* nudge it once */ WriteBozoFile(0); return 0; } -int bnode_DeleteName(ainstance) -char *ainstance; { +int +bnode_DeleteName(char *ainstance) +{ register struct bnode *tb; tb = bnode_FindInstance(ainstance); - if (!tb) return BZNOENT; - + if (!tb) + return BZNOENT; + return bnode_Delete(tb); } -bnode_Hold(abnode) -register struct bnode *abnode; { +int +bnode_Hold(register struct bnode *abnode) +{ abnode->refCount++; return 0; } -bnode_Release(abnode) -register struct bnode *abnode; { +int +bnode_Release(register struct bnode *abnode) +{ abnode->refCount--; if (abnode->refCount == 0 && abnode->flags & BNODE_DELETE) { abnode->flags &= ~BNODE_DELETE; /* we're going for it */ @@ -368,12 +394,13 @@ register struct bnode *abnode; { return 0; } -int bnode_Delete(abnode) -register struct bnode *abnode; { +int +bnode_Delete(register struct bnode *abnode) +{ register afs_int32 code; register struct bnode **lb, *ub; afs_int32 temp; - + if (abnode->refCount != 0) { abnode->flags |= BNODE_DELETE; return 0; @@ -383,85 +410,108 @@ register struct bnode *abnode; { bnode_Hold(abnode); code = BOP_GETSTAT(abnode, &temp); bnode_Release(abnode); - if (code) return code; - if (temp != BSTAT_SHUTDOWN) return BZBUSY; + if (code) + return code; + if (temp != BSTAT_SHUTDOWN) + return BZBUSY; /* all clear to zap */ - for(lb = &allBnodes, ub = *lb; ub; lb= &ub->next, ub = *lb) { + for (lb = &allBnodes, ub = *lb; ub; lb = &ub->next, ub = *lb) { if (ub == abnode) { /* unthread it from the list */ *lb = ub->next; break; } } - free(abnode->name); /* do this first, since bnode fields may be bad after BOP_DELETE */ + free(abnode->name); /* do this first, since bnode fields may be bad after BOP_DELETE */ code = BOP_DELETE(abnode); /* don't play games like holding over this one */ WriteBozoFile(0); return code; } /* function to tell if there's a timeout coming up */ -int bnode_PendingTimeout(abnode) -register struct bnode *abnode; { +int +bnode_PendingTimeout(register struct bnode *abnode) +{ return (abnode->flags & BNODE_NEEDTIMEOUT); } /* function called to set / clear periodic bnode wakeup times */ -int bnode_SetTimeout(abnode, atimeout) -register struct bnode *abnode; -afs_int32 atimeout; { +int +bnode_SetTimeout(register struct bnode *abnode, afs_int32 atimeout) +{ if (atimeout != 0) { abnode->nextTimeout = FT_ApproxTime() + atimeout; abnode->flags |= BNODE_NEEDTIMEOUT; abnode->period = atimeout; IOMGR_Cancel(bproc_pid); - } - else { + } else { abnode->flags &= ~BNODE_NEEDTIMEOUT; } return 0; } /* used by new bnode creation code to format bnode header */ -int bnode_InitBnode (abnode, abnodeops, aname) -register struct bnode *abnode; -char *aname; -struct bnode_ops *abnodeops; { +int +bnode_InitBnode(register struct bnode *abnode, struct bnode_ops *abnodeops, + char *aname) +{ struct bnode **lb, *nb; /* format the bnode properly */ memset(abnode, 0, sizeof(struct bnode)); abnode->ops = abnodeops; - abnode->name = (char *) malloc(strlen(aname)+1); + abnode->name = (char *)malloc(strlen(aname) + 1); + if (!abnode->name) + return ENOMEM; strcpy(abnode->name, aname); abnode->flags = BNODE_ACTIVE; abnode->fileGoal = BSTAT_NORMAL; abnode->goal = BSTAT_SHUTDOWN; /* put the bnode at the end of the list so we write bnode file in same order */ - for(lb = &allBnodes, nb = *lb; nb; lb = &nb->next, nb = *lb); + for (lb = &allBnodes, nb = *lb; nb; lb = &nb->next, nb = *lb); *lb = abnode; return 0; } +static int +DeleteProc(register struct bnode_proc *abproc) +{ + register struct bnode_proc **pb, *tb; + struct bnode_proc *nb; + + for (pb = &allProcs, tb = *pb; tb; pb = &tb->next, tb = nb) { + nb = tb->next; + if (tb == abproc) { + *pb = nb; + free(tb); + return 0; + } + } + return BZNOENT; +} + /* bnode lwp executes this code repeatedly */ -static int bproc() { +static int +bproc() +{ register afs_int32 code; register struct bnode *tb; register afs_int32 temp; register struct bnode_proc *tp; struct bnode *nb; - int options; /* must not be register */ + int options; /* must not be register */ struct timeval tv; int setAny; int status; while (1) { /* first figure out how long to sleep for */ - temp = 0x7fffffff; /* afs_int32 time; maxint doesn't work in select */ + temp = 0x7fffffff; /* afs_int32 time; maxint doesn't work in select */ setAny = 0; - for(tb = allBnodes; tb; tb=tb->next) { + for (tb = allBnodes; tb; tb = tb->next) { if (tb->flags & BNODE_NEEDTIMEOUT) { if (tb->nextTimeout < temp) { setAny = 1; @@ -472,32 +522,34 @@ static int bproc() { /* now temp has the time at which we should wakeup next */ /* sleep */ - if (setAny) temp -= FT_ApproxTime(); /* how many seconds until next event */ - else temp = 999999; + if (setAny) + temp -= FT_ApproxTime(); /* how many seconds until next event */ + else + temp = 999999; if (temp > 0) { tv.tv_sec = temp; tv.tv_usec = 0; code = IOMGR_Select(0, 0, 0, 0, &tv); - } - else code = 0; /* fake timeout code */ + } else + code = 0; /* fake timeout code */ /* figure out why we woke up; child exit or timeouts */ - FT_GetTimeOfDay(&tv, 0); /* must do the real gettimeofday once and a while */ + FT_GetTimeOfDay(&tv, 0); /* must do the real gettimeofday once and a while */ temp = tv.tv_sec; /* check all bnodes to see which ones need timeout events */ - for(tb = allBnodes; tb; tb=nb) { + for (tb = allBnodes; tb; tb = nb) { if ((tb->flags & BNODE_NEEDTIMEOUT) && temp > tb->nextTimeout) { bnode_Hold(tb); BOP_TIMEOUT(tb); bnode_Check(tb); - if (tb->flags & BNODE_NEEDTIMEOUT) { /* check again, BOP_TIMEOUT could change */ + if (tb->flags & BNODE_NEEDTIMEOUT) { /* check again, BOP_TIMEOUT could change */ tb->nextTimeout = FT_ApproxTime() + tb->period; } nb = tb->next; - bnode_Release(tb); /* delete may occur here */ - } - else nb=tb->next; + bnode_Release(tb); /* delete may occur here */ + } else + nb = tb->next; } if (code < 0) { @@ -505,12 +557,14 @@ static int bproc() { while (1) { options = WNOHANG; bnode_waiting = options | 0x800000; - code = waitpid((pid_t)-1, &status, options); + code = waitpid((pid_t) - 1, &status, options); bnode_waiting = 0; - if (code == 0 || code == -1) break; /* all done */ + if (code == 0 || code == -1) + break; /* all done */ /* otherwise code has a process id, which we now search for */ - for(tp=allProcs; tp; tp=tp->next) - if (tp->pid == code) break; + for (tp = allProcs; tp; tp = tp->next) + if (tp->pid == code) + break; if (tp) { /* found the pid */ tb = tp->bnode; @@ -534,20 +588,20 @@ static int bproc() { tb->errorSignal = 0; } if (tp->coreName) - bozo_Log("%s:%s exited with code %d\n", - tb->name, tp->coreName, tp->lastExit); + bozo_Log("%s:%s exited with code %d\n", tb->name, + tp->coreName, tp->lastExit); else - bozo_Log("%s exited with code %d\n", - tb->name, tp->lastExit); - } - else { + bozo_Log("%s exited with code %d\n", tb->name, + tp->lastExit); + } else { /* Signal occurred, perhaps spurious due to shutdown request. * If due to a shutdown request, don't overwrite last error * information. */ tp->lastSignal = WTERMSIG(status); tp->lastExit = 0; - if (tp->lastSignal != SIGQUIT && tp->lastSignal != SIGTERM + if (tp->lastSignal != SIGQUIT + && tp->lastSignal != SIGTERM && tp->lastSignal != SIGKILL) { tb->errorSignal = tp->lastSignal; tb->lastErrorExit = FT_ApproxTime(); @@ -555,18 +609,21 @@ static int bproc() { } if (tp->coreName) bozo_Log("%s:%s exited on signal %d%s\n", - tb->name, tp->coreName, tp->lastSignal, - WCOREDUMP(status) ? " (core dumped)" : ""); + tb->name, tp->coreName, tp->lastSignal, + WCOREDUMP(status) ? " (core dumped)" : + ""); else - bozo_Log("%s exited on signal %d%s\n", - tb->name, tp->lastSignal, - WCOREDUMP(status) ? " (core dumped)" : ""); + bozo_Log("%s exited on signal %d%s\n", tb->name, + tp->lastSignal, + WCOREDUMP(status) ? " (core dumped)" : + ""); SaveCore(tb, tp); } tb->lastAnyExit = FT_ApproxTime(); if (tb->notifier) { - bozo_Log("BNODE: Notifier %s will be called\n", tb->notifier); + bozo_Log("BNODE: Notifier %s will be called\n", + tb->notifier); hdl_notifier(tp); } BOP_PROCEXIT(tb, tp); @@ -576,76 +633,21 @@ static int bproc() { /* 10 in 10 seconds */ tb->flags |= BNODE_ERRORSTOP; bnode_SetGoal(tb, BSTAT_SHUTDOWN); - bozo_Log("BNODE '%s' repeatedly failed to start, perhaps missing executable.\n", - tb->name); + bozo_Log + ("BNODE '%s' repeatedly failed to start, perhaps missing executable.\n", + tb->name); } bnode_Release(tb); /* bnode delete can happen here */ DeleteProc(tp); - } - else bnode_stats.weirdPids++; + } else + bnode_stats.weirdPids++; } } } } - -#ifdef notdef -sigcatch() -{ - signal(SIGPIPE, SIG_IGN); - bozo_Log("Notifier aborted prematurely"); - exit(0); -} -#endif - - - -hdl_notifier(tp) - struct bnode_proc *tp; -{ -#ifndef AFS_NT40_ENV /* NT notifier callout not yet implemented */ - int code, pid, status; - struct stat tstat; - - if (stat(tp->bnode->notifier, &tstat)) { - bozo_Log("BNODE: Failed to find notifier '%s'; ignored\n", tp->bnode->notifier); - return(1); - } - if ((pid = fork()) == 0) { - FILE *fout; - struct bnode *tb = tp->bnode; - int ec; - -#if defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI51_ENV) - ec = setsid(); -#else -#ifdef AFS_LINUX20_ENV - ec = setpgrp(); -#else - ec = setpgrp(0,0); -#endif -#endif - fout = popen(tb->notifier, "w"); - if (fout == NULL) { - bozo_Log("BNODE: Failed to find notifier '%s'; ignored\n", tb->notifier); - perror(tb->notifier); - exit(1); - } - code = SendNotifierData(fileno(fout), tp); - pclose(fout); - exit(0); - } else if (pid < 0) { - bozo_Log("Failed to fork creating process to handle notifier '%s'\n", tp->bnode->notifier); - return -1; - } -#endif /* AFS_NT40_ENV */ - return(0); -} - - -static afs_int32 SendNotifierData(fd, tp) - register int fd; - register struct bnode_proc *tp; +static afs_int32 +SendNotifierData(register int fd, register struct bnode_proc *tp) { register struct bnode *tb = tp->bnode; char buffer[1000], *bufp = buffer, *buf1; @@ -654,73 +656,117 @@ static afs_int32 SendNotifierData(fd, tp) /* * First sent out the bnode_proc struct */ - (void) sprintf(bufp, "BEGIN bnode_proc\n"); + (void)sprintf(bufp, "BEGIN bnode_proc\n"); bufp += strlen(bufp); - (void) sprintf(bufp, "comLine: %s\n", tp->comLine); + (void)sprintf(bufp, "comLine: %s\n", tp->comLine); bufp += strlen(bufp); if (!(buf1 = tp->coreName)) buf1 = "(null)"; - (void) sprintf(bufp, "coreName: %s\n", buf1); + (void)sprintf(bufp, "coreName: %s\n", buf1); bufp += strlen(bufp); - (void) sprintf(bufp, "pid: %ld\n", tp->pid); + (void)sprintf(bufp, "pid: %ld\n", tp->pid); bufp += strlen(bufp); - (void) sprintf(bufp, "lastExit: %ld\n", tp->lastExit); + (void)sprintf(bufp, "lastExit: %ld\n", tp->lastExit); bufp += strlen(bufp); #ifdef notdef - (void) sprintf(bufp, "lastSignal: %ld\n", tp->lastSignal); + (void)sprintf(bufp, "lastSignal: %ld\n", tp->lastSignal); bufp += strlen(bufp); #endif - (void) sprintf(bufp, "flags: %ld\n", tp->flags); + (void)sprintf(bufp, "flags: %ld\n", tp->flags); bufp += strlen(bufp); - (void) sprintf(bufp, "END bnode_proc\n"); + (void)sprintf(bufp, "END bnode_proc\n"); bufp += strlen(bufp); - len =(int)(bufp-buffer); + len = (int)(bufp - buffer); if (write(fd, buffer, len) < 0) { return -1; } /* * Now sent out the bnode struct - */ + */ bufp = buffer; - (void) sprintf(bufp, "BEGIN bnode\n"); + (void)sprintf(bufp, "BEGIN bnode\n"); bufp += strlen(bufp); - (void) sprintf(bufp, "name: %s\n", tb->name); + (void)sprintf(bufp, "name: %s\n", tb->name); bufp += strlen(bufp); - (void) sprintf(bufp, "rsTime: %ld\n", tb->rsTime); + (void)sprintf(bufp, "rsTime: %ld\n", tb->rsTime); bufp += strlen(bufp); - (void) sprintf(bufp, "rsCount: %ld\n", tb->rsCount); + (void)sprintf(bufp, "rsCount: %ld\n", tb->rsCount); bufp += strlen(bufp); - (void) sprintf(bufp, "procStartTime: %ld\n", tb->procStartTime); + (void)sprintf(bufp, "procStartTime: %ld\n", tb->procStartTime); bufp += strlen(bufp); - (void) sprintf(bufp, "procStarts: %ld\n", tb->procStarts); + (void)sprintf(bufp, "procStarts: %ld\n", tb->procStarts); bufp += strlen(bufp); - (void) sprintf(bufp, "lastAnyExit: %ld\n", tb->lastAnyExit); + (void)sprintf(bufp, "lastAnyExit: %ld\n", tb->lastAnyExit); bufp += strlen(bufp); - (void) sprintf(bufp, "lastErrorExit: %ld\n", tb->lastErrorExit); + (void)sprintf(bufp, "lastErrorExit: %ld\n", tb->lastErrorExit); bufp += strlen(bufp); - (void) sprintf(bufp, "errorCode: %ld\n", tb->errorCode); + (void)sprintf(bufp, "errorCode: %ld\n", tb->errorCode); bufp += strlen(bufp); - (void) sprintf(bufp, "errorSignal: %ld\n", tb->errorSignal); + (void)sprintf(bufp, "errorSignal: %ld\n", tb->errorSignal); bufp += strlen(bufp); /* (void) sprintf(bufp, "lastErrorName: %s\n", tb->lastErrorName); bufp += strlen(bufp); */ - (void) sprintf(bufp, "goal: %d\n", tb->goal); + (void)sprintf(bufp, "goal: %d\n", tb->goal); bufp += strlen(bufp); - (void) sprintf(bufp, "END bnode\n"); + (void)sprintf(bufp, "END bnode\n"); bufp += strlen(bufp); - len = (int)bufp-(int)buffer; + len = (int)bufp - (int)buffer; if (write(fd, buffer, len) < 0) { return -1; } } +int +hdl_notifier(struct bnode_proc *tp) +{ +#ifndef AFS_NT40_ENV /* NT notifier callout not yet implemented */ + int code, pid, status; + struct stat tstat; + + if (stat(tp->bnode->notifier, &tstat)) { + bozo_Log("BNODE: Failed to find notifier '%s'; ignored\n", + tp->bnode->notifier); + return (1); + } + if ((pid = fork()) == 0) { + FILE *fout; + struct bnode *tb = tp->bnode; + int ec; + +#if defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI51_ENV) + ec = setsid(); +#else +#ifdef AFS_LINUX20_ENV + ec = setpgrp(); +#else + ec = setpgrp(0, 0); +#endif +#endif + fout = popen(tb->notifier, "w"); + if (fout == NULL) { + bozo_Log("BNODE: Failed to find notifier '%s'; ignored\n", + tb->notifier); + perror(tb->notifier); + exit(1); + } + code = SendNotifierData(fileno(fout), tp); + pclose(fout); + exit(0); + } else if (pid < 0) { + bozo_Log("Failed to fork creating process to handle notifier '%s'\n", + tp->bnode->notifier); + return -1; + } +#endif /* AFS_NT40_ENV */ + return (0); +} - /* Called by IOMGR at low priority on IOMGR's stack shortly after a SIGCHLD * occurs. Wakes up bproc do redo things */ +int bnode_SoftInt(int asignal) { IOMGR_Cancel(bproc_pid); @@ -744,34 +790,42 @@ bnode_Int(int asignal) /* intialize the whole system */ -int bnode_Init() { +int +bnode_Init() +{ PROCESS junk; register afs_int32 code; struct sigaction newaction; static initDone = 0; - if (initDone) return 0; + if (initDone) + return 0; initDone = 1; memset(&bnode_stats, 0, sizeof(bnode_stats)); - LWP_InitializeProcessSupport(1, &junk); /* just in case */ + LWP_InitializeProcessSupport(1, &junk); /* just in case */ IOMGR_Initialize(); code = LWP_CreateProcess(bproc, BNODE_LWP_STACKSIZE, - /* priority */ 1, /* parm */0, "bnode-manager", &bproc_pid); - if (code) return code; + /* priority */ 1, (void *) /* parm */ 0, + "bnode-manager", &bproc_pid); + if (code) + return code; memset((char *)&newaction, 0, sizeof(newaction)); newaction.sa_handler = bnode_Int; code = sigaction(SIGCHLD, &newaction, NULL); - if (code) return errno; + if (code) + return errno; code = sigaction(SIGQUIT, &newaction, NULL); - if (code) return errno; + if (code) + return errno; return code; } - + /* free token list returned by parseLine */ -bnode_FreeTokens(alist) - register struct bnode_token *alist; { +int +bnode_FreeTokens(register struct bnode_token *alist) +{ register struct bnode_token *nlist; - for(; alist; alist = nlist) { + for (; alist; alist = nlist) { nlist = alist->next; free(alist->key); free(alist); @@ -779,55 +833,61 @@ bnode_FreeTokens(alist) return 0; } -static space(x) -int x; { - if (x == 0 || x == ' ' || x == '\t' || x== '\n') return 1; - else return 0; +static int +space(int x) +{ + if (x == 0 || x == ' ' || x == '\t' || x == '\n') + return 1; + else + return 0; } -bnode_ParseLine(aline, alist) - char *aline; - struct bnode_token **alist; { +int +bnode_ParseLine(char *aline, struct bnode_token **alist) +{ char tbuffer[256]; register char *tptr; int inToken; struct bnode_token *first, *last; register struct bnode_token *ttok; register int tc; - - inToken = 0; /* not copying token chars at start */ - first = (struct bnode_token *) 0; - last = (struct bnode_token *) 0; + + inToken = 0; /* not copying token chars at start */ + first = (struct bnode_token *)0; + last = (struct bnode_token *)0; while (1) { tc = *aline++; - if (tc == 0 || space(tc)) { /* terminating null gets us in here, too */ + if (tc == 0 || space(tc)) { /* terminating null gets us in here, too */ if (inToken) { - inToken = 0; /* end of this token */ + inToken = 0; /* end of this token */ *tptr++ = 0; - ttok = (struct bnode_token *) malloc(sizeof(struct bnode_token)); - ttok->next = (struct bnode_token *) 0; - ttok->key = (char *) malloc(strlen(tbuffer)+1); + ttok = + (struct bnode_token *)malloc(sizeof(struct bnode_token)); + ttok->next = (struct bnode_token *)0; + ttok->key = (char *)malloc(strlen(tbuffer) + 1); strcpy(ttok->key, tbuffer); if (last) { last->next = ttok; last = ttok; - } - else last = ttok; - if (!first) first = ttok; + } else + last = ttok; + if (!first) + first = ttok; } - } - else { + } else { /* an alpha character */ if (!inToken) { tptr = tbuffer; inToken = 1; } - if (tptr - tbuffer >= sizeof(tbuffer)) return -1; /* token too long */ + if (tptr - tbuffer >= sizeof(tbuffer)) + return -1; /* token too long */ *tptr++ = tc; } if (tc == 0) { /* last token flushed 'cause space(0) --> true */ - if (last) last->next = (struct bnode_token *) 0; + if (last) + last->next = (struct bnode_token *)0; *alist = first; return 0; } @@ -835,11 +895,10 @@ bnode_ParseLine(aline, alist) } #define MAXVARGS 128 -int bnode_NewProc(abnode, aexecString, coreName, aproc) -struct bnode_proc **aproc; -char *coreName; -struct bnode *abnode; -char *aexecString; { +int +bnode_NewProc(struct bnode *abnode, char *aexecString, char *coreName, + struct bnode_proc **aproc) +{ struct bnode_token *tlist, *tt; afs_int32 code; struct bnode_proc *tp; @@ -847,9 +906,10 @@ char *aexecString; { char *argv[MAXVARGS]; int i; - code = bnode_ParseLine(aexecString, &tlist); /* try parsing first */ - if (code) return code; - tp = (struct bnode_proc *) malloc(sizeof(struct bnode_proc)); + code = bnode_ParseLine(aexecString, &tlist); /* try parsing first */ + if (code) + return code; + tp = (struct bnode_proc *)malloc(sizeof(struct bnode_proc)); memset(tp, 0, sizeof(struct bnode_proc)); tp->next = allProcs; allProcs = tp; @@ -864,12 +924,12 @@ char *aexecString; { for (tt = tlist, i = 0; i < (MAXVARGS - 1) && tt; tt = tt->next, i++) { argv[i] = tt->key; } - argv[i] = (char *) 0; /* null-terminated */ + argv[i] = NULL; /* null-terminated */ cpid = spawnprocve(argv[0], argv, environ, -1); - osi_audit(BOSSpawnProcEvent, 0, AUD_STR, aexecString, AUD_END ); + osi_audit(BOSSpawnProcEvent, 0, AUD_STR, aexecString, AUD_END); - if (cpid == (pid_t)-1) { + if (cpid == (pid_t) - 1) { bozo_Log("Failed to spawn process for bnode '%s'\n", abnode->name); bnode_FreeTokens(tlist); free(tp); @@ -884,26 +944,29 @@ char *aexecString; { return 0; } -int bnode_StopProc(aproc, asignal) -register struct bnode_proc *aproc; -int asignal; { +int +bnode_StopProc(register struct bnode_proc *aproc, int asignal) +{ register int code; if (!(aproc->flags & BPROC_STARTED) || (aproc->flags & BPROC_EXITED)) return BZNOTACTIVE; - osi_audit( BOSStopProcEvent, 0, AUD_STR, (aproc ? aproc->comLine : (char *)0), AUD_END ); + osi_audit(BOSStopProcEvent, 0, AUD_STR, (aproc ? aproc->comLine : NULL), + AUD_END); code = kill(aproc->pid, asignal); bnode_Check(aproc->bnode); return code; } -int bnode_Deactivate(abnode) -register struct bnode *abnode; { +int +bnode_Deactivate(register struct bnode *abnode) +{ register struct bnode **pb, *tb; struct bnode *nb; - if (!(abnode->flags & BNODE_ACTIVE)) return BZNOTACTIVE; - for(pb = &allBnodes,tb = *pb; tb; tb=nb) { + if (!(abnode->flags & BNODE_ACTIVE)) + return BZNOTACTIVE; + for (pb = &allBnodes, tb = *pb; tb; tb = nb) { nb = tb->next; if (tb == abnode) { *pb = nb; @@ -913,19 +976,3 @@ register struct bnode *abnode; { } return BZNOENT; } - -static int DeleteProc(abproc) -register struct bnode_proc *abproc; { - register struct bnode_proc **pb, *tb; - struct bnode_proc *nb; - - for(pb = &allProcs,tb = *pb; tb; pb = &tb->next, tb=nb) { - nb = tb->next; - if (tb == abproc) { - *pb = nb; - free(tb); - return 0; - } - } - return BZNOENT; -} diff --git a/src/bozo/bnode.p.h b/src/bozo/bnode.p.h index 4340ac857..594da83e3 100644 --- a/src/bozo/bnode.p.h +++ b/src/bozo/bnode.p.h @@ -18,16 +18,16 @@ #define BOP_HASCORE(bnode) ((*(bnode)->ops->hascore)((bnode))) struct bnode_ops { - struct bnode *(*create)(/* variable args */); - int (*timeout) (/* bnode */); - int (*getstat) (/* bnode, status */); - int (*setstat) (/* bnode, status */); - int (*delete) (/* bnode */); - int (*procexit) (/* bnode, proc */); - int (*getstring) (/* bnode, buffer, bufLen */); - int (*getparm) (/* bnode, parmIndex, buffer, bufLen */); - int (*restartp) (/* bnode */); - int (*hascore) (/* bnode */); + struct bnode *(*create) ( /* variable args */ ); + int (*timeout) ( /* bnode */ ); + int (*getstat) ( /* bnode, status */ ); + int (*setstat) ( /* bnode, status */ ); + int (*delete) ( /* bnode */ ); + int (*procexit) ( /* bnode, proc */ ); + int (*getstring) ( /* bnode, buffer, bufLen */ ); + int (*getparm) ( /* bnode, parmIndex, buffer, bufLen */ ); + int (*restartp) ( /* bnode */ ); + int (*hascore) ( /* bnode */ ); }; struct bnode_type { @@ -42,78 +42,78 @@ struct bnode_token { }; struct bnode { - struct bnode *next; /* next pointer in top-level's list */ - char *name; /* instance name */ - afs_int32 nextTimeout; /* next time this guy should be woken */ - afs_int32 period; /* period between calls */ - afs_int32 rsTime; /* time we started counting restarts */ - afs_int32 rsCount; /* count of restarts since rsTime */ - struct bnode_type *type; /* type object */ - struct bnode_ops *ops; /* functions implementing bnode class */ - afs_int32 procStartTime; /* last time a process was started */ - afs_int32 procStarts; /* number of process starts */ - afs_int32 lastAnyExit; /* last time a process exited, for any reason */ - afs_int32 lastErrorExit; /* last time a process exited unexpectedly */ - afs_int32 errorCode; /* last exit return code */ - afs_int32 errorSignal; /* last proc terminating signal */ - char *lastErrorName; /* name of proc that failed last */ - char *notifier; /* notifier program to be executed on exits */ - short refCount; /* reference count */ - short flags; /* random flags */ - char goal; /* 1=running or 0=not running */ - char fileGoal; /* same, but to be stored in file */ + struct bnode *next; /* next pointer in top-level's list */ + char *name; /* instance name */ + afs_int32 nextTimeout; /* next time this guy should be woken */ + afs_int32 period; /* period between calls */ + afs_int32 rsTime; /* time we started counting restarts */ + afs_int32 rsCount; /* count of restarts since rsTime */ + struct bnode_type *type; /* type object */ + struct bnode_ops *ops; /* functions implementing bnode class */ + afs_int32 procStartTime; /* last time a process was started */ + afs_int32 procStarts; /* number of process starts */ + afs_int32 lastAnyExit; /* last time a process exited, for any reason */ + afs_int32 lastErrorExit; /* last time a process exited unexpectedly */ + afs_int32 errorCode; /* last exit return code */ + afs_int32 errorSignal; /* last proc terminating signal */ + char *lastErrorName; /* name of proc that failed last */ + char *notifier; /* notifier program to be executed on exits */ + short refCount; /* reference count */ + short flags; /* random flags */ + char goal; /* 1=running or 0=not running */ + char fileGoal; /* same, but to be stored in file */ }; struct bnode_proc { - struct bnode_proc *next; /* next guy in top-level's list */ - struct bnode *bnode; /* bnode creating this process */ - char *comLine; /* command line used to start this process */ - char *coreName; /* optional core file component name */ - afs_int32 pid; /* pid if created */ - afs_int32 lastExit; /* last termination code */ - afs_int32 lastSignal; /* last signal that killed this guy */ - afs_int32 flags; /* flags giving process state */ + struct bnode_proc *next; /* next guy in top-level's list */ + struct bnode *bnode; /* bnode creating this process */ + char *comLine; /* command line used to start this process */ + char *coreName; /* optional core file component name */ + afs_int32 pid; /* pid if created */ + afs_int32 lastExit; /* last termination code */ + afs_int32 lastSignal; /* last signal that killed this guy */ + afs_int32 flags; /* flags giving process state */ }; - + struct ezbnode { struct bnode b; afs_int32 zapTime; /* time we sent a sigterm */ char *command; struct bnode_proc *proc; - afs_int32 lastStart; /* time last started process */ + afs_int32 lastStart; /* time last started process */ char waitingForShutdown; /* have we started any shutdown procedure? */ - char running; /* is process running? */ - char killSent; /* have we tried sigkill signal? */ + char running; /* is process running? */ + char killSent; /* have we tried sigkill signal? */ }; /* this struct is used to construct a list of dirpaths, along with * their recommended permissions */ struct bozo_bosEntryStats { - const char *path; /* pathname to check */ - int dir; /* 1=>dir or 0=>file */ - int rootOwner; /* 1=>root must own */ - int reqPerm; /* required permissions */ - int proPerm; /* prohibited permissions */ + const char *path; /* pathname to check */ + int dir; /* 1=>dir or 0=>file */ + int rootOwner; /* 1=>root must own */ + int reqPerm; /* required permissions */ + int proPerm; /* prohibited permissions */ }; /* bnode flags */ -#define BNODE_NEEDTIMEOUT 1 /* timeouts are active */ -#define BNODE_ACTIVE 2 /* in generic lists */ -#define BNODE_WAIT 4 /* someone waiting for status change */ -#define BNODE_DELETE 8 /* delete this bnode asap */ -#define BNODE_ERRORSTOP 0x10 /* stopped due to errors */ +#define BNODE_NEEDTIMEOUT 1 /* timeouts are active */ +#define BNODE_ACTIVE 2 /* in generic lists */ +#define BNODE_WAIT 4 /* someone waiting for status change */ +#define BNODE_DELETE 8 /* delete this bnode asap */ +#define BNODE_ERRORSTOP 0x10 /* stopped due to errors */ /* flags for bnode_proc */ -#define BPROC_STARTED 1 /* ever started */ -#define BPROC_EXITED 2 /* exited */ +#define BPROC_STARTED 1 /* ever started */ +#define BPROC_EXITED 2 /* exited */ #define NONOTIFIER "__NONOTIFIER__" /* status values for bnodes, and goals */ -#define BSTAT_SHUTDOWN 0 /* shutdown normally */ -#define BSTAT_NORMAL 1 /* running normally */ -#define BSTAT_SHUTTINGDOWN 2 /* normal --> shutdown */ -#define BSTAT_STARTINGUP 3 /* shutdown --> normal */ +#define BSTAT_SHUTDOWN 0 /* shutdown normally */ +#define BSTAT_NORMAL 1 /* running normally */ +#define BSTAT_SHUTTINGDOWN 2 /* normal --> shutdown */ +#define BSTAT_STARTINGUP 3 /* shutdown --> normal */ /* exit values indicating that NT SCM integrator should restart bosserver */ #ifdef AFS_NT40_ENV @@ -124,14 +124,16 @@ struct bozo_bosEntryStats { #endif /* max time to wait for fileserver shutdown */ -#define FSSDTIME (30 * 60) /* seconds */ +#define FSSDTIME (30 * 60) /* seconds */ /* calls back up to the generic bnode layer */ -extern int bnode_SetTimeout(/* bnode, timeout */); -extern int bnode_Init(/* bnode, bnodeops */); -extern int bnode_Activate(/* bnode */); -extern int bnode_NewProc(/* bnode, execstring, corename, procaddr */); -extern int bnode_Init(/* no parms */); +extern int bnode_SetTimeout( /* bnode, timeout */ ); +extern int bnode_Init( /* bnode, bnodeops */ ); +extern int bnode_Activate( /* bnode */ ); +extern int bnode_NewProc( /* bnode, execstring, corename, procaddr */ ); +extern int bnode_Init( /* no parms */ ); extern afs_int32 bnode_Create(); extern struct bnode *bnode_FindInstance(); +extern int bnode_WaitStatus(register struct bnode *abnode, int astatus); +extern int bnode_SetStat(register struct bnode *abnode, register int agoal); diff --git a/src/bozo/bos.c b/src/bozo/bos.c index 07fc18b9a..655244173 100644 --- a/src/bozo/bos.c +++ b/src/bozo/bos.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bos.c,v 1.1.1.10 2002/09/26 19:04:56 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bozo/bos.c,v 1.20 2003/12/07 22:49:18 jaltman Exp $"); #include #include @@ -28,7 +29,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bos.c,v 1.1.1.10 2002/09/26 19:04: #include #endif /* AFS_NT40_ENV */ #include -#include /* signal(), kill(), wait(), etc. */ +#include /* signal(), kill(), wait(), etc. */ #include #include "bnode.h" #include @@ -46,13 +47,6 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bos.c,v 1.1.1.10 2002/09/26 19:04: #include #include - - -extern char *volutil_PartitionName(); -extern struct rx_call *rx_NewCall(); -extern char *volutil_PartitionName(); -extern struct hostent *hostutil_GetHostByName(); - static IStatServer(); static DoStat(); @@ -84,26 +78,35 @@ static struct SalvageParms { /* dummy routine for the audit work. It should do nothing since audits */ /* occur at the server level and bos is not a server. */ -osi_audit() {return 0;} +osi_audit() +{ + return 0; +} /* keep those lines small */ -static char *em(acode) -afs_int32 acode; { +static char * +em(acode) + afs_int32 acode; +{ if (acode == -1) return "communications failure (-1)"; else if (acode == -3) return "communications timeout (-3)"; - else return (char *) error_message(acode); + else + return (char *)error_message(acode); } /* get partition id from a name */ -static afs_int32 GetPartitionID(aname) -char *aname; { +static afs_int32 +GetPartitionID(aname) + char *aname; +{ register char tc; char ascii[3]; tc = *aname; - if (tc == 0) return -1; /* unknown */ + if (tc == 0) + return -1; /* unknown */ /* numbers go straight through */ if (tc >= '0' && tc <= '9') { return atoi(aname); @@ -112,40 +115,41 @@ char *aname; { ascii[2] = 0; if (strlen(aname) <= 2) { strcpy(ascii, aname); - } - else if (!strncmp(aname, "/vicep", 6)) { - strncpy(ascii, aname+6, 2); - } - else if (!strncmp(aname, "vicep", 5)) { - strncpy(ascii, aname+5, 2); - } - else return -1; /* bad partition name */ + } else if (!strncmp(aname, "/vicep", 6)) { + strncpy(ascii, aname + 6, 2); + } else if (!strncmp(aname, "vicep", 5)) { + strncpy(ascii, aname + 5, 2); + } else + return -1; /* bad partition name */ /* now partitions are named /vicepa ... /vicepz, /vicepaa, /vicepab, * .../vicepzz, and are numbered from 0. Do the appropriate conversion */ if (ascii[1] == 0) { /* one char name, 0..25 */ - if (ascii[0] < 'a' || ascii[0] > 'z') return -1; /* wrongo */ + if (ascii[0] < 'a' || ascii[0] > 'z') + return -1; /* wrongo */ return ascii[0] - 'a'; - } - else { + } else { /* two char name, 26 .. */ - if (ascii[0] < 'a' || ascii[0] > 'z') return -1; /* wrongo */ - if (ascii[1] < 'a' || ascii[1] > 'z') return -1; /* just as bad */ + if (ascii[0] < 'a' || ascii[0] > 'z') + return -1; /* wrongo */ + if (ascii[1] < 'a' || ascii[1] > 'z') + return -1; /* just as bad */ return (ascii[0] - 'a') * 26 + (ascii[1] - 'a') + 26; } } /* make ctime easier to use */ -static char *DateOf(atime) -afs_int32 atime; { +static char * +DateOf(atime) + afs_int32 atime; +{ static char tbuffer[30]; register char *tp; - tp=ctime((time_t *)&atime); + tp = ctime((time_t *) & atime); if (tp) { strcpy(tbuffer, tp); - tbuffer[24] = 0; /* get rid of new line */ - } - else + tbuffer[24] = 0; /* get rid of new line */ + } else strcpy(tbuffer, "BAD TIME"); return tbuffer; } @@ -157,9 +161,11 @@ static int scIndex; /* use the syntax descr to get a connection, authenticated appropriately. * aencrypt is set if we want to encrypt the data on the wire. */ -static struct rx_connection *GetConn(as, aencrypt) -int aencrypt; -struct cmd_syndesc *as; { +static struct rx_connection * +GetConn(as, aencrypt) + int aencrypt; + struct cmd_syndesc *as; +{ struct hostent *th; char *hostname; register afs_int32 code; @@ -182,110 +188,128 @@ struct cmd_syndesc *as; { /* get tokens for making authenticated connections */ localauth = (as->parms[ADDPARMOFFSET + 2].items != 0); - confdir = (localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH); - tdir = afsconf_Open (confdir); + confdir = + (localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH); + tdir = afsconf_Open(confdir); if (tdir) { struct afsconf_cell info; char *tname; - if (as->parms[ADDPARMOFFSET].items) + if (as->parms[ADDPARMOFFSET].items) tname = as->parms[ADDPARMOFFSET].items->data; - else tname = (char *) 0; + else + tname = NULL; /* next call expands cell name abbrevs for us and handles looking up - * local cell */ - code = afsconf_GetCellInfo(tdir, tname, (char *) 0, &info); + * local cell */ + code = afsconf_GetCellInfo(tdir, tname, NULL, &info); if (code) { - com_err ("bos", code, "(can't find cell '%s' in cell database)", - (tname? tname : "")); + com_err("bos", code, "(can't find cell '%s' in cell database)", + (tname ? tname : "")); exit(1); - } - else strcpy(sname.cell, info.name); - } - else { + } else + strcpy(sname.cell, info.name); + } else { printf("bos: can't open cell database (%s)\n", confdir); exit(1); } sname.instance[0] = 0; strcpy(sname.name, "afs"); - sc[0] = (struct rx_securityClass *) rxnull_NewClientSecurityObject(); + sc[0] = rxnull_NewClientSecurityObject(); sc[1] = 0; sc[2] = 0; scIndex = 0; - if (!as->parms[ADDPARMOFFSET + 1].items) { /* not -noauth */ - if (as->parms[ADDPARMOFFSET + 2].items) { /* -localauth */ - code = afsconf_GetLatestKey (tdir, 0,0); - if (code) com_err ("bos", code, "(getting key from local KeyFile)"); + if (!as->parms[ADDPARMOFFSET + 1].items) { /* not -noauth */ + if (as->parms[ADDPARMOFFSET + 2].items) { /* -localauth */ + code = afsconf_GetLatestKey(tdir, 0, 0); + if (code) + com_err("bos", code, "(getting key from local KeyFile)"); else { if (aencrypt) - code = afsconf_ClientAuthSecure (tdir, &sc[2], &scIndex); + code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex); else - code = afsconf_ClientAuth (tdir, &sc[2], &scIndex); - if (code) com_err ("bos", code, "(calling ClientAuth)"); + code = afsconf_ClientAuth(tdir, &sc[2], &scIndex); + if (code) + com_err("bos", code, "(calling ClientAuth)"); else if (scIndex != 2) /* this shouldn't happen */ sc[scIndex] = sc[2]; } - } else { /* not -localauth, check for tickets */ - code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), (char *)0); + } else { /* not -localauth, check for tickets */ + code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL); if (code == 0) { /* have tickets, will travel */ - if (ttoken.kvno >= 0 && ttoken.kvno <= 255) ; + if (ttoken.kvno >= 0 && ttoken.kvno <= 255); else { - fprintf (stderr, - "bos: funny kvno (%d) in ticket, proceeding\n", - ttoken.kvno); + fprintf(stderr, + "bos: funny kvno (%d) in ticket, proceeding\n", + ttoken.kvno); } /* kerberos tix */ - if (aencrypt) encryptLevel = rxkad_crypt; - else encryptLevel = rxkad_clear; + if (aencrypt) + encryptLevel = rxkad_crypt; + else + encryptLevel = rxkad_clear; sc[2] = (struct rx_securityClass *) - rxkad_NewClientSecurityObject - (encryptLevel, &ttoken.sessionKey, - ttoken.kvno, ttoken.ticketLen, ttoken.ticket); + rxkad_NewClientSecurityObject(encryptLevel, + &ttoken.sessionKey, + ttoken.kvno, + ttoken.ticketLen, + ttoken.ticket); scIndex = 2; - } else com_err ("bos", code, "(getting tickets)"); + } else + com_err("bos", code, "(getting tickets)"); } if ((scIndex == 0) || (sc[scIndex] == 0)) { - fprintf (stderr, "bos: running unauthenticated\n"); + fprintf(stderr, "bos: running unauthenticated\n"); scIndex = 0; } } - tconn = rx_NewConnection (addr, htons(AFSCONF_NANNYPORT), 1, - sc[scIndex], scIndex); + tconn = + rx_NewConnection(addr, htons(AFSCONF_NANNYPORT), 1, sc[scIndex], + scIndex); if (!tconn) { - fprintf (stderr, "bos: could not create rx connection\n"); + fprintf(stderr, "bos: could not create rx connection\n"); exit(1); } - rxs_Release (sc[scIndex]); + rxs_Release(sc[scIndex]); return tconn; } -static SetAuth(as) -struct cmd_syndesc *as; { +static +SetAuth(as) + struct cmd_syndesc *as; +{ register afs_int32 code; register struct rx_connection *tconn; afs_int32 flag; register char *tp; - + tconn = GetConn(as, 0); tp = as->parms[1].items->data; - if (strcmp(tp, "on")==0) flag = 0; /* auth req.: noauthflag is false */ - else if (strcmp(tp, "off") == 0) flag = 1; + if (strcmp(tp, "on") == 0) + flag = 0; /* auth req.: noauthflag is false */ + else if (strcmp(tp, "off") == 0) + flag = 1; else { - printf("bos: illegal authentication specifier '%s', must be 'off' or 'on'.\n", tp); + printf + ("bos: illegal authentication specifier '%s', must be 'off' or 'on'.\n", + tp); return 1; } code = BOZO_SetNoAuthFlag(tconn, flag); - if (code) com_err ("bos", code, "(failed to set authentication flag)"); + if (code) + com_err("bos", code, "(failed to set authentication flag)"); return 0; } /* take a name (e.g. foo/bar, and a dir e.g. /usr/afs/bin, and construct * /usr/afs/bin/bar */ -static ComputeDestDir(aname, adir, aresult, alen) -char *aname, *adir, *aresult; -afs_int32 alen; { +static +ComputeDestDir(aname, adir, aresult, alen) + char *aname, *adir, *aresult; + afs_int32 alen; +{ register char *tp; strcpy(aresult, adir); @@ -294,8 +318,7 @@ afs_int32 alen; { /* no '/' in name */ strcat(aresult, "/"); strcat(aresult, aname); - } - else { + } else { /* tp points at the / character */ strcat(aresult, tp); } @@ -303,53 +326,69 @@ afs_int32 alen; { } /* copy data from fd afd to rx call acall */ -static CopyBytes(afd, acall) -int afd; -register struct rx_call *acall; { +static +CopyBytes(afd, acall) + int afd; + register struct rx_call *acall; +{ register afs_int32 code; register afs_int32 len; char tbuffer[256]; - while(1) { + while (1) { len = read(afd, tbuffer, sizeof(tbuffer)); - if (len < 0) return errno; - if (len == 0) return 0; /* all done */ + if (len < 0) + return errno; + if (len == 0) + return 0; /* all done */ code = rx_Write(acall, tbuffer, len); - if (code != len) return -1; + if (code != len) + return -1; } } -static Prune(as) -register struct cmd_syndesc *as; { +static +Prune(as) + register struct cmd_syndesc *as; +{ register afs_int32 code; register struct rx_connection *tconn; register afs_int32 flags; - + tconn = GetConn(as, 0); flags = 0; - if (as->parms[1].items) flags |= BOZO_PRUNEBAK; - if (as->parms[2].items) flags |= BOZO_PRUNEOLD; - if (as->parms[3].items) flags |= BOZO_PRUNECORE; - if (as->parms[4].items) flags |= 0xff; + if (as->parms[1].items) + flags |= BOZO_PRUNEBAK; + if (as->parms[2].items) + flags |= BOZO_PRUNEOLD; + if (as->parms[3].items) + flags |= BOZO_PRUNECORE; + if (as->parms[4].items) + flags |= 0xff; code = BOZO_Prune(tconn, flags); - if (code) com_err ("bos", code, "(failed to prune server files)"); + if (code) + com_err("bos", code, "(failed to prune server files)"); return code; } -static Exec(as) -register struct cmd_syndesc *as; { +static +Exec(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; tconn = GetConn(as, 0); code = BOZO_Exec(tconn, as->parms[1].items->data); - if (code) printf("bos: failed to execute command (%s)\n", - em(code)); + if (code) + printf("bos: failed to execute command (%s)\n", em(code)); return code; } -static GetDate(as) -register struct cmd_syndesc *as; { +static +GetDate(as) + register struct cmd_syndesc *as; +{ register afs_int32 code; char tbuffer[256]; char destDir[256]; @@ -364,10 +403,12 @@ register struct cmd_syndesc *as; { } /* compute dest dir or file; default MUST be canonical form of dir path */ - if (as->parms[2].items) strcpy(destDir, as->parms[2].items->data); - else strcpy(destDir, AFSDIR_CANONICAL_SERVER_BIN_DIRPATH); + if (as->parms[2].items) + strcpy(destDir, as->parms[2].items->data); + else + strcpy(destDir, AFSDIR_CANONICAL_SERVER_BIN_DIRPATH); - for(ti=as->parms[1].items; ti; ti=ti->next) { + for (ti = as->parms[1].items; ti; ti = ti->next) { /* check date for each file */ ComputeDestDir(ti->data, destDir, tbuffer, sizeof(tbuffer)); code = BOZO_GetDates(tconn, tbuffer, &time, &bakTime, &oldTime); @@ -375,23 +416,30 @@ register struct cmd_syndesc *as; { printf("bos: failed to check date on %s (%s)\n", ti->data, em(code)); return 1; - } - else { + } else { printf("File %s ", tbuffer); - if (time == 0) printf("does not exist, "); - else printf("dated %s, ", DateOf(time)); - if (bakTime == 0) printf("no .BAK file, "); - else printf(".BAK file dated %s, ", DateOf(bakTime)); - if (oldTime == 0) printf("no .OLD file."); - else printf(".OLD file dated %s.", DateOf(oldTime)); + if (time == 0) + printf("does not exist, "); + else + printf("dated %s, ", DateOf(time)); + if (bakTime == 0) + printf("no .BAK file, "); + else + printf(".BAK file dated %s, ", DateOf(bakTime)); + if (oldTime == 0) + printf("no .OLD file."); + else + printf(".OLD file dated %s.", DateOf(oldTime)); printf("\n"); } } return 0; } -static UnInstall(as) -register struct cmd_syndesc *as; { +static +UnInstall(as) + register struct cmd_syndesc *as; +{ register afs_int32 code; char tbuffer[256]; char destDir[256]; @@ -405,26 +453,29 @@ register struct cmd_syndesc *as; { } /* compute dest dir or file; default MUST be canonical form of dir path */ - if (as->parms[2].items) strcpy(destDir, as->parms[2].items->data); - else strcpy(destDir, AFSDIR_CANONICAL_SERVER_BIN_DIRPATH); + if (as->parms[2].items) + strcpy(destDir, as->parms[2].items->data); + else + strcpy(destDir, AFSDIR_CANONICAL_SERVER_BIN_DIRPATH); - for(ti=as->parms[1].items; ti; ti=ti->next) { + for (ti = as->parms[1].items; ti; ti = ti->next) { /* uninstall each file */ ComputeDestDir(ti->data, destDir, tbuffer, sizeof(tbuffer)); code = BOZO_UnInstall(tconn, tbuffer); if (code) { - printf("bos: failed to uninstall %s (%s)\n", ti->data, - em(code)); + printf("bos: failed to uninstall %s (%s)\n", ti->data, em(code)); return 1; - } - else printf("bos: uninstalled file %s\n", ti->data); + } else + printf("bos: uninstalled file %s\n", ti->data); } return 0; } -static afs_int32 GetServerGoal(aconn, aname) -char *aname; -struct rx_connection *aconn; { +static afs_int32 +GetServerGoal(aconn, aname) + char *aname; + struct rx_connection *aconn; +{ char buffer[500]; char *tp; register afs_int32 code; @@ -433,10 +484,10 @@ struct rx_connection *aconn; { tp = buffer; code = BOZO_GetInstanceInfo(aconn, aname, &tp, &istatus); if (code) { - printf("bos: failed to get instance info for '%s' (%s)\n", - aname, em(code)); + printf("bos: failed to get instance info for '%s' (%s)\n", aname, + em(code)); /* if we can't get the answer, assume its running */ - return BSTAT_NORMAL; + return BSTAT_NORMAL; } if (istatus.goal == 0) return BSTAT_SHUTDOWN; @@ -444,8 +495,10 @@ struct rx_connection *aconn; { return BSTAT_NORMAL; } -static Install(as) -struct cmd_syndesc *as; { +static +Install(as) + struct cmd_syndesc *as; +{ struct rx_connection *tconn; register afs_int32 code; register struct cmd_item *ti; @@ -462,10 +515,12 @@ struct cmd_syndesc *as; { } /* compute dest dir or file; default MUST be canonical form of dir path */ - if (as->parms[2].items) strcpy(destDir, as->parms[2].items->data); - else strcpy(destDir, AFSDIR_CANONICAL_SERVER_BIN_DIRPATH); + if (as->parms[2].items) + strcpy(destDir, as->parms[2].items->data); + else + strcpy(destDir, AFSDIR_CANONICAL_SERVER_BIN_DIRPATH); - for(ti=as->parms[1].items; ti; ti=ti->next) { + for (ti = as->parms[1].items; ti; ti = ti->next) { /* install each file */ fd = open(ti->data, O_RDONLY); if (fd < 0) { @@ -482,8 +537,9 @@ struct cmd_syndesc *as; { /* compute destination dir */ ComputeDestDir(ti->data, destDir, tbuffer, sizeof(tbuffer)); tcall = rx_NewCall(tconn); - code = StartBOZO_Install(tcall, tbuffer, tstat.st_size, (afs_int32)tstat.st_mode, - tstat.st_mtime); + code = + StartBOZO_Install(tcall, tbuffer, tstat.st_size, + (afs_int32) tstat.st_mode, tstat.st_mtime); if (code == 0) { code = CopyBytes(fd, tcall); } @@ -491,29 +547,31 @@ struct cmd_syndesc *as; { if (code) { printf("bos: failed to install %s (%s)\n", ti->data, em(code)); return 1; - } - else printf("bos: installed file %s\n", ti->data); + } else + printf("bos: installed file %s\n", ti->data); } return 0; } -static Shutdown(as) -struct cmd_syndesc *as; { +static +Shutdown(as) + struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; register struct cmd_item *ti; - + tconn = GetConn(as, 0); if (as->parms[1].items == 0) { code = BOZO_ShutdownAll(tconn); - if (code) printf("bos: failed to shutdown servers (%s)\n", em(code)); - } - else { - for(ti = as->parms[1].items; ti; ti=ti->next) { + if (code) + printf("bos: failed to shutdown servers (%s)\n", em(code)); + } else { + for (ti = as->parms[1].items; ti; ti = ti->next) { code = BOZO_SetTStatus(tconn, ti->data, BSTAT_SHUTDOWN); if (code) - printf("bos: failed to shutdown instance %s (%s)\n", - ti->data, em(code)); + printf("bos: failed to shutdown instance %s (%s)\n", ti->data, + em(code)); } } if (as->parms[8].items) { @@ -525,9 +583,11 @@ struct cmd_syndesc *as; { return 0; } -static BlockScannerCmd(as, arock) -struct cmd_syndesc *as; -char *arock; { +static +BlockScannerCmd(as, arock) + struct cmd_syndesc *as; + char *arock; +{ register afs_int32 code; struct rx_connection *tconn; char BlockCommand[] = "/usr/afs/bin/scanner -block"; @@ -535,14 +595,17 @@ char *arock; { tconn = GetConn(as, 0); code = BOZO_Exec(tconn, BlockCommand); if (code) - printf("bos: failed to block scanner from making migration requests (%s)\n", - em(code)); + printf + ("bos: failed to block scanner from making migration requests (%s)\n", + em(code)); return 0; } -static UnBlockScannerCmd(as, arock) -struct cmd_syndesc *as; -char *arock; { +static +UnBlockScannerCmd(as, arock) + struct cmd_syndesc *as; + char *arock; +{ register afs_int32 code; struct rx_connection *tconn; char UnBlockCommand[] = "/usr/afs/bin/scanner -unblock"; @@ -550,14 +613,17 @@ char *arock; { tconn = GetConn(as, 0); code = BOZO_Exec(tconn, UnBlockCommand); if (code) - printf("bos: failed to allow scanner daemon to make migration requests again (%s)\n", - em(code)); + printf + ("bos: failed to allow scanner daemon to make migration requests again (%s)\n", + em(code)); return 0; -} +} -static GetRestartCmd(as, arock) -struct cmd_syndesc *as; -char *arock; { +static +GetRestartCmd(as, arock) + struct cmd_syndesc *as; + char *arock; +{ register afs_int32 code; struct ktime generalTime, newBinaryTime; char messageBuffer[256]; @@ -569,12 +635,14 @@ char *arock; { code = BOZO_GetRestartTime(tconn, 1, &generalTime); if (code) { - printf("bos: failed to retrieve restart information (%s)\n", em(code)); + printf("bos: failed to retrieve restart information (%s)\n", + em(code)); return code; } code = BOZO_GetRestartTime(tconn, 2, &newBinaryTime); if (code) { - printf("bos: failed to retrieve restart information (%s)\n", em(code)); + printf("bos: failed to retrieve restart information (%s)\n", + em(code)); return code; } @@ -596,9 +664,11 @@ char *arock; { return 0; } -static SetRestartCmd(as, arock) -struct cmd_syndesc *as; -char *arock; { +static +SetRestartCmd(as, arock) + struct cmd_syndesc *as; + char *arock; +{ afs_int32 count; register afs_int32 code; struct ktime restartTime; @@ -607,13 +677,20 @@ char *arock; { count = 0; tconn = GetConn(as, 0); - if (as->parms[2].items) {count++; type = 1;} - if (as->parms[3].items) {count++; type = 2;} + if (as->parms[2].items) { + count++; + type = 1; + } + if (as->parms[3].items) { + count++; + type = 2; + } if (count > 1) { printf("bos: can't specify more than one restart time at a time\n"); return -1; } - if (count == 0) type = 1; /* by default set general restart time */ + if (count == 0) + type = 1; /* by default set general restart time */ if (code = ktime_ParsePeriodic(as->parms[1].items->data, &restartTime)) { printf("bos: failed to parse '%s' as periodic restart time(%s)\n", @@ -629,42 +706,46 @@ char *arock; { return 0; } -static Startup(as) -struct cmd_syndesc *as; { +static +Startup(as) + struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; register struct cmd_item *ti; - + tconn = GetConn(as, 0); if (as->parms[1].items == 0) { code = BOZO_StartupAll(tconn); if (code) printf("bos: failed to startup servers (%s)\n", em(code)); - } - else { - for(ti = as->parms[1].items; ti; ti=ti->next) { + } else { + for (ti = as->parms[1].items; ti; ti = ti->next) { code = BOZO_SetTStatus(tconn, ti->data, BSTAT_NORMAL); if (code) - printf("bos: failed to start instance %s (%s)\n", - ti->data, em(code)); + printf("bos: failed to start instance %s (%s)\n", ti->data, + em(code)); } } return 0; } -static Restart(as) -struct cmd_syndesc *as; { +static +Restart(as) + struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; register struct cmd_item *ti; - + tconn = GetConn(as, 0); if (as->parms[2].items) { /* this is really a rebozo command */ if (as->parms[1].items) { /* specified specific things to restart, can't do this at the same - * time */ - printf("bos: can't specify both '-bos' and specific servers to restart.\n"); + * time */ + printf + ("bos: can't specify both '-bos' and specific servers to restart.\n"); return 1; } /* otherwise do a rebozo */ @@ -674,81 +755,91 @@ struct cmd_syndesc *as; { return code; } if (as->parms[1].items == 0) { - if (as->parms[3].items) { /* '-all' */ + if (as->parms[3].items) { /* '-all' */ code = BOZO_RestartAll(tconn); - if (code) printf("bos: failed to restart servers (%s)\n", em(code)); + if (code) + printf("bos: failed to restart servers (%s)\n", em(code)); } else printf("bos: To restart all processes please specify '-all'\n"); - } - else { + } else { if (as->parms[3].items) { printf("bos: Can't use '-all' along with individual instances\n"); } else { - for(ti = as->parms[1].items; ti; ti=ti->next) { + for (ti = as->parms[1].items; ti; ti = ti->next) { code = BOZO_Restart(tconn, ti->data); if (code) - printf("bos: failed to restart instance %s (%s)\n", ti->data, - em(code)); + printf("bos: failed to restart instance %s (%s)\n", + ti->data, em(code)); } } } return 0; } -static SetCellName(as) -struct cmd_syndesc *as; { +static +SetCellName(as) + struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; - + tconn = GetConn(as, 0); code = BOZO_SetCellName(tconn, as->parms[1].items->data); - if (code) printf("bos: failed to set cell (%s)\n", em(code)); + if (code) + printf("bos: failed to set cell (%s)\n", em(code)); return 0; } -static AddHost(as) -register struct cmd_syndesc *as; { +static +AddHost(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; register struct cmd_item *ti; char name[MAXHOSTCHARS]; - + tconn = GetConn(as, 0); - for(ti = as->parms[1].items; ti; ti=ti->next) { - if (as->parms[2].items) { - if (strlen(ti->data) > MAXHOSTCHARS - 3) { - fprintf(stderr, "bos: host name too long\n"); - return E2BIG; - } - name[0] = '['; - strcpy(&name[1],ti->data); - strcat((char *)&name, "]"); - code = BOZO_AddCellHost(tconn, name); - } else - code = BOZO_AddCellHost(tconn, ti->data); + for (ti = as->parms[1].items; ti; ti = ti->next) { + if (as->parms[2].items) { + if (strlen(ti->data) > MAXHOSTCHARS - 3) { + fprintf(stderr, "bos: host name too long\n"); + return E2BIG; + } + name[0] = '['; + strcpy(&name[1], ti->data); + strcat((char *)&name, "]"); + code = BOZO_AddCellHost(tconn, name); + } else + code = BOZO_AddCellHost(tconn, ti->data); if (code) printf("bos: failed to add host %s (%s)\n", ti->data, em(code)); } return 0; } -static RemoveHost(as) -register struct cmd_syndesc *as; { +static +RemoveHost(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; register struct cmd_item *ti; - + tconn = GetConn(as, 0); - for(ti=as->parms[1].items; ti; ti=ti->next) { + for (ti = as->parms[1].items; ti; ti = ti->next) { code = BOZO_DeleteCellHost(tconn, ti->data); if (code) - printf("bos: failed to delete host %s (%s)\n", ti->data, em(code)); + printf("bos: failed to delete host %s (%s)\n", ti->data, + em(code)); } return 0; } -static ListHosts(as) -register struct cmd_syndesc *as; { +static +ListHosts(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; char tbuffer[256]; @@ -763,20 +854,23 @@ register struct cmd_syndesc *as; { exit(1); } printf("Cell name is %s\n", tbuffer); - for(i=0;;i++) { + for (i = 0;; i++) { code = BOZO_GetCellHost(tconn, i, &tp); - if (code == BZDOM) break; + if (code == BZDOM) + break; if (code != 0) { printf("bos: failed to get cell host %d (%s)\n", i, em(code)); exit(1); } - printf(" Host %d is %s\n", i+1, tbuffer); + printf(" Host %d is %s\n", i + 1, tbuffer); } return 0; } -static AddKey(as) -register struct cmd_syndesc *as; { +static +AddKey(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; struct ktc_encryptionKey tkey; @@ -784,33 +878,30 @@ register struct cmd_syndesc *as; { char *tcell; char cellBuffer[256]; char buf[BUFSIZ], ver[BUFSIZ]; - + tconn = GetConn(as, 1); memset(&tkey, 0, sizeof(struct ktc_encryptionKey)); - if(as->parms[1].items) - strcpy(buf,as->parms[1].items->data); - else - { - /* prompt for key */ - code=des_read_pw_string(buf,sizeof(buf),"input key: ",0); - if(code || strlen(buf)==0) - { - fprintf(stderr,"Bad key: \n"); - exit(1); - } - code=des_read_pw_string(ver,sizeof(ver),"Retype input key: ",0); - if(code || strlen(ver)==0) - { - fprintf(stderr,"Bad key: \n"); - exit(1); - } - if (strcmp (ver, buf) != 0) { - fprintf (stderr, "\nInput key mismatch\n"); - exit(1); - } - + if (as->parms[1].items) + strcpy(buf, as->parms[1].items->data); + else { + /* prompt for key */ + code = des_read_pw_string(buf, sizeof(buf), "input key: ", 0); + if (code || strlen(buf) == 0) { + fprintf(stderr, "Bad key: \n"); + exit(1); + } + code = des_read_pw_string(ver, sizeof(ver), "Retype input key: ", 0); + if (code || strlen(ver) == 0) { + fprintf(stderr, "Bad key: \n"); + exit(1); } + if (strcmp(ver, buf) != 0) { + fprintf(stderr, "\nInput key mismatch\n"); + exit(1); + } + + } temp = atoi(as->parms[2].items->data); if (temp == 999) { @@ -819,24 +910,23 @@ register struct cmd_syndesc *as; { strcpy((char *)&tkey, as->parms[1].items->data); */ strcpy((char *)&tkey, buf); - } - else { /* kerberos key */ + } else { /* kerberos key */ if (as->parms[ADDPARMOFFSET].items) { strcpy(cellBuffer, as->parms[ADDPARMOFFSET].items->data); /* string to key needs upper-case cell names */ /* I don't believe this is true. The string to key function - * actually expands the cell name, then LOWER-CASES it. Perhaps it - * didn't use to??? */ + * actually expands the cell name, then LOWER-CASES it. Perhaps it + * didn't use to??? */ ucstring(cellBuffer, cellBuffer, strlen(cellBuffer)); tcell = cellBuffer; - } - else tcell = (char *) 0; /* no cell specified, use current */ + } else + tcell = NULL; /* no cell specified, use current */ /* ka_StringToKey(as->parms[1].items->data, tcell, &tkey); */ - ka_StringToKey(buf,tcell,&tkey); + ka_StringToKey(buf, tcell, &tkey); } tconn = GetConn(as, 1); code = BOZO_AddKey(tconn, temp, &tkey); @@ -847,15 +937,17 @@ register struct cmd_syndesc *as; { return 0; } -static RemoveKey(as) -register struct cmd_syndesc *as; { +static +RemoveKey(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; afs_int32 temp; register struct cmd_item *ti; - + tconn = GetConn(as, 0); - for(ti=as->parms[1].items; ti; ti=ti->next) { + for (ti = as->parms[1].items; ti; ti = ti->next) { temp = atoi(ti->data); code = BOZO_DeleteKey(tconn, temp); if (code) { @@ -866,8 +958,9 @@ register struct cmd_syndesc *as; { return 0; } -static ListKeys(as) - IN register struct cmd_syndesc *as; +static +ListKeys(as) + IN register struct cmd_syndesc *as; { register struct rx_connection *tconn; register afs_int32 code; @@ -876,23 +969,24 @@ static ListKeys(as) struct bozo_keyInfo keyInfo; int everWorked; register afs_int32 i; - + tconn = GetConn(as, 1); everWorked = 0; - for(i=0;;i++) { + for (i = 0;; i++) { code = BOZO_ListKeys(tconn, i, &kvno, &tkey, &keyInfo); - if (code) break; + if (code) + break; everWorked = 1; /* first check if key is returned */ - if ((!ka_KeyIsZero (&tkey, sizeof(tkey))) && (as->parms[1].items)) { - printf ("key %d is '", kvno); - ka_PrintBytes (&tkey, sizeof(tkey)); - printf ("'\n"); + if ((!ka_KeyIsZero(&tkey, sizeof(tkey))) && (as->parms[1].items)) { + printf("key %d is '", kvno); + ka_PrintBytes(&tkey, sizeof(tkey)); + printf("'\n"); } else { - if (keyInfo.keyCheckSum == 0) /* shouldn't happen */ - printf ("key version is %d\n", kvno); + if (keyInfo.keyCheckSum == 0) /* shouldn't happen */ + printf("key version is %d\n", kvno); else - printf ("key %d has cksum %u\n", kvno, keyInfo.keyCheckSum); + printf("key %d has cksum %u\n", kvno, keyInfo.keyCheckSum); } } if (everWorked) { @@ -905,8 +999,10 @@ static ListKeys(as) return 0; } -static AddSUser(as) -register struct cmd_syndesc *as; { +static +AddSUser(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; int failed; @@ -914,7 +1010,7 @@ register struct cmd_syndesc *as; { failed = 0; tconn = GetConn(as, 0); - for(ti=as->parms[1].items; ti; ti=ti->next) { + for (ti = as->parms[1].items; ti; ti = ti->next) { code = BOZO_AddSUser(tconn, ti->data); if (code) { printf("bos: failed to add user '%s' (%s)\n", ti->data, em(code)); @@ -924,8 +1020,10 @@ register struct cmd_syndesc *as; { return failed; } -static RemoveSUser(as) -register struct cmd_syndesc *as; { +static +RemoveSUser(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register struct cmd_item *ti; register afs_int32 code; @@ -933,7 +1031,7 @@ register struct cmd_syndesc *as; { failed = 0; tconn = GetConn(as, 0); - for(ti=as->parms[1].items; ti; ti=ti->next) { + for (ti = as->parms[1].items; ti; ti = ti->next) { code = BOZO_DeleteSUser(tconn, ti->data); if (code) { printf("bos: failed to delete user '%s', ", ti->data); @@ -947,86 +1045,97 @@ register struct cmd_syndesc *as; { return failed; } -#define NPERLINE 10 /* dudes to print per line */ -static ListSUsers(as) -register struct cmd_syndesc *as; { +#define NPERLINE 10 /* dudes to print per line */ +static +ListSUsers(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register int i; register afs_int32 code; char tbuffer[256]; char *tp; int lastNL, printGreeting; - + tconn = GetConn(as, 0); lastNL = 0; printGreeting = 1; - for(i=0;;i++) { + for (i = 0;; i++) { tp = tbuffer; code = BOZO_ListSUsers(tconn, i, &tp); - if (code) break; + if (code) + break; if (printGreeting) { printGreeting = 0; /* delay until after first call succeeds */ printf("SUsers are: "); } printf("%s ", tbuffer); - if ((i % NPERLINE) == NPERLINE-1) { + if ((i % NPERLINE) == NPERLINE - 1) { printf("\n"); lastNL = 1; - } - else lastNL = 0; + } else + lastNL = 0; } if (code != 1) { /* a real error code, instead of scanned past end */ printf("bos: failed to retrieve super-user list (%s)\n", em(code)); return code; } - if (lastNL == 0) printf("\n"); + if (lastNL == 0) + printf("\n"); return 0; } -static StatServer(as) -register struct cmd_syndesc *as; { +static +StatServer(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; register int i; char ibuffer[BOZO_BSSIZE]; char *tp; int int32p; - + /* int32p==1 is obsolete, smaller, printout */ - int32p = (as->parms[2].items != 0? 2 : 0); + int32p = (as->parms[2].items != 0 ? 2 : 0); /* no parms does something pretty different */ - if (as->parms[1].items) return IStatServer(as, int32p); + if (as->parms[1].items) + return IStatServer(as, int32p); tconn = GetConn(as, 0); - for(i=0;;i++) { + for (i = 0;; i++) { /* for each instance */ tp = ibuffer; code = BOZO_EnumerateInstance(tconn, i, &tp); - if (code == BZDOM) break; + if (code == BZDOM) + break; if (code) { printf("bos: failed to contact host's bosserver (%s).\n", em(code)); break; } - DoStat(ibuffer, tconn, int32p, (i==0)); /* print status line */ + DoStat(ibuffer, tconn, int32p, (i == 0)); /* print status line */ } return 0; } -static CreateServer(as) -register struct cmd_syndesc *as; { +static +CreateServer(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; char *parms[6]; register struct cmd_item *ti; register int i; - char *type, *name, *notifier=NONOTIFIER; + char *type, *name, *notifier = NONOTIFIER; tconn = GetConn(as, 0); - for(i=0;i<6;i++) parms[i] = ""; - for(i=0,ti=as->parms[3].items; (ti && i<6); ti=ti->next,i++) { + for (i = 0; i < 6; i++) + parms[i] = ""; + for (i = 0, ti = as->parms[3].items; (ti && i < 6); ti = ti->next, i++) { parms[i] = ti->data; } name = as->parms[1].items->data; @@ -1034,62 +1143,70 @@ register struct cmd_syndesc *as; { if (ti = as->parms[4].items) { notifier = ti->data; } - code = BOZO_CreateBnode(tconn, type, name, parms[0], parms[1], parms[2], - parms[3], parms[4], notifier); + code = + BOZO_CreateBnode(tconn, type, name, parms[0], parms[1], parms[2], + parms[3], parms[4], notifier); if (code) { - printf("bos: failed to create new server instance %s of type '%s' (%s)\n", - name, type, em(code)); + printf + ("bos: failed to create new server instance %s of type '%s' (%s)\n", + name, type, em(code)); } return code; } -static DeleteServer(as) -register struct cmd_syndesc *as; { +static +DeleteServer(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; register struct cmd_item *ti; code = 0; tconn = GetConn(as, 0); - for(ti=as->parms[1].items; ti; ti=ti->next) { + for (ti = as->parms[1].items; ti; ti = ti->next) { code = BOZO_DeleteBnode(tconn, ti->data); if (code) { if (code == BZBUSY) printf("bos: can't delete running instance '%s'\n", ti->data); else - printf("bos: failed to delete instance '%s' (%s)\n", - ti->data, em(code)); + printf("bos: failed to delete instance '%s' (%s)\n", ti->data, + em(code)); } } return code; } -static StartServer(as) -register struct cmd_syndesc *as; { +static +StartServer(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; register struct cmd_item *ti; code = 0; tconn = GetConn(as, 0); - for(ti=as->parms[1].items; ti; ti=ti->next) { + for (ti = as->parms[1].items; ti; ti = ti->next) { code = BOZO_SetStatus(tconn, ti->data, BSTAT_NORMAL); if (code) - printf("bos: failed to start instance '%s' (%s)\n", - ti->data, em(code)); + printf("bos: failed to start instance '%s' (%s)\n", ti->data, + em(code)); } return code; } -static StopServer(as) -register struct cmd_syndesc *as; { +static +StopServer(as) + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code; register struct cmd_item *ti; code = 0; tconn = GetConn(as, 0); - for(ti=as->parms[1].items; ti; ti=ti->next) { + for (ti = as->parms[1].items; ti; ti = ti->next) { code = BOZO_SetStatus(tconn, ti->data, BSTAT_SHUTDOWN); if (code) printf("bos: failed to change stop instance '%s' (%s)\n", @@ -1106,15 +1223,17 @@ register struct cmd_syndesc *as; { #define PARMBUFFERSSIZE 32 -static DoSalvage(aconn, aparm1, aparm2, aoutName, showlog,parallel,atmpDir,orphans) -struct rx_connection *aconn; -char *aoutName; -char *aparm1; -char *aparm2; -afs_int32 showlog; -char *parallel; -char *atmpDir; -char *orphans; +static +DoSalvage(aconn, aparm1, aparm2, aoutName, showlog, parallel, atmpDir, + orphans) + struct rx_connection *aconn; + char *aoutName; + char *aparm1; + char *aparm2; + afs_int32 showlog; + char *parallel; + char *atmpDir; + char *orphans; { register afs_int32 code; char *parms[6]; @@ -1125,13 +1244,13 @@ char *orphans; char *tp; FILE *outFile; int closeIt; - char partName[20]; /* canonical name for partition */ + char partName[20]; /* canonical name for partition */ char pbuffer[PARMBUFFERSSIZE]; afs_int32 partNumber; char *notifier = NONOTIFIER; /* if a partition was specified, canonicalize the name, since - the salvager has a stupid partition ID parser */ + * the salvager has a stupid partition ID parser */ if (aparm1) { partNumber = volutil_GetPartitionID(aparm1); if (partNumber < 0) { @@ -1144,8 +1263,8 @@ char *orphans; return EINVAL; } strcpy(partName, tp); - } - else partName[0] = 0; + } else + partName[0] = 0; /* open the file name */ if (aoutName) { @@ -1155,110 +1274,113 @@ char *orphans; aoutName); return ENOENT; } - closeIt = 1; /* close this file later */ - } - else { + closeIt = 1; /* close this file later */ + } else { outFile = stdout; - closeIt = 0; /* don't close this file later */ + closeIt = 0; /* don't close this file later */ } - for(code=2;code<6;code++) parms[code] = ""; - if (!aparm2) aparm2 = ""; + for (code = 2; code < 6; code++) + parms[code] = ""; + if (!aparm2) + aparm2 = ""; /* MUST pass canonical (wire-format) salvager path to bosserver */ strncpy(tbuffer, AFSDIR_CANONICAL_SERVER_SALVAGER_FILEPATH, BOZO_BSSIZE); if (*aparm2 != 0) { - if ( (strlen(tbuffer) + 1 + strlen(partName) + 1 + strlen(aparm2) + 1) > BOZO_BSSIZE ) { - printf("bos: command line too big\n"); - return(E2BIG); + if ((strlen(tbuffer) + 1 + strlen(partName) + 1 + strlen(aparm2) + + 1) > BOZO_BSSIZE) { + printf("bos: command line too big\n"); + return (E2BIG); } strcat(tbuffer, " "); strcat(tbuffer, partName); strcat(tbuffer, " "); strcat(tbuffer, aparm2); } else { - if ( (strlen(tbuffer) + 4 + strlen(partName) + 1) > BOZO_BSSIZE ) { - printf("bos: command line too big\n"); - return(E2BIG); + if ((strlen(tbuffer) + 4 + strlen(partName) + 1) > BOZO_BSSIZE) { + printf("bos: command line too big\n"); + return (E2BIG); } - strcat (tbuffer, " -f "); - strcat (tbuffer, partName); + strcat(tbuffer, " -f "); + strcat(tbuffer, partName); } /* add the parallel option if given */ - if (parallel != (char *)0) { - if ( (strlen(tbuffer) + 11 + strlen(parallel) + 1) > BOZO_BSSIZE ) { - printf("bos: command line too big\n"); - return(E2BIG); + if (parallel != NULL) { + if ((strlen(tbuffer) + 11 + strlen(parallel) + 1) > BOZO_BSSIZE) { + printf("bos: command line too big\n"); + return (E2BIG); } strcat(tbuffer, " -parallel "); strcat(tbuffer, parallel); } /* add the tmpdir option if given */ - if (atmpDir != (char *)0) { - if ( (strlen(tbuffer) + 9 + strlen(atmpDir) + 1) > BOZO_BSSIZE ) { - printf("bos: command line too big\n"); - return(E2BIG); + if (atmpDir != NULL) { + if ((strlen(tbuffer) + 9 + strlen(atmpDir) + 1) > BOZO_BSSIZE) { + printf("bos: command line too big\n"); + return (E2BIG); } strcat(tbuffer, " -tmpdir "); strcat(tbuffer, atmpDir); } /* add the orphans option if given */ - if (orphans != (char *)0) { - if ( (strlen(tbuffer) + 10 + strlen(orphans) + 1) > BOZO_BSSIZE ) { - printf("bos: command line too big\n"); - return(E2BIG); + if (orphans != NULL) { + if ((strlen(tbuffer) + 10 + strlen(orphans) + 1) > BOZO_BSSIZE) { + printf("bos: command line too big\n"); + return (E2BIG); } strcat(tbuffer, " -orphans "); strcat(tbuffer, orphans); } if (mrafsParm.Optdebug) - strcat(tbuffer," -debug"); + strcat(tbuffer, " -debug"); if (mrafsParm.Optnowrite) - strcat(tbuffer," -nowrite"); + strcat(tbuffer, " -nowrite"); if (mrafsParm.Optforce) - strcat(tbuffer," -force"); + strcat(tbuffer, " -force"); if (mrafsParm.Optoktozap) - strcat(tbuffer," -oktozap"); + strcat(tbuffer, " -oktozap"); if (mrafsParm.Optrootfiles) - strcat(tbuffer," -rootfiles"); + strcat(tbuffer, " -rootfiles"); if (mrafsParm.Optsalvagedirs) - strcat(tbuffer," -salvagedirs"); + strcat(tbuffer, " -salvagedirs"); if (mrafsParm.Optblockreads) - strcat(tbuffer," -blockreads"); + strcat(tbuffer, " -blockreads"); if (mrafsParm.OptListResidencies) - strcat(tbuffer," -ListResidencies"); + strcat(tbuffer, " -ListResidencies"); if (mrafsParm.OptSalvageRemote) - strcat(tbuffer," -SalvageRemote"); + strcat(tbuffer, " -SalvageRemote"); if (mrafsParm.OptSalvageArchival) - strcat(tbuffer," -SalvageArchival"); + strcat(tbuffer, " -SalvageArchival"); if (mrafsParm.OptIgnoreCheck) - strcat(tbuffer," -IgnoreCheck"); + strcat(tbuffer, " -IgnoreCheck"); if (mrafsParm.OptForceOnLine) - strcat(tbuffer," -ForceOnLine"); + strcat(tbuffer, " -ForceOnLine"); if (mrafsParm.OptUseRootDirACL) - strcat(tbuffer," -UseRootDirACL"); + strcat(tbuffer, " -UseRootDirACL"); if (mrafsParm.OptTraceBadLinkCounts) - strcat(tbuffer," -TraceBadLinkCounts"); + strcat(tbuffer, " -TraceBadLinkCounts"); if (mrafsParm.OptDontAskFS) - strcat(tbuffer," -DontAskFS"); + strcat(tbuffer, " -DontAskFS"); if (mrafsParm.OptLogLevel) { - sprintf(pbuffer, " -LogLevel %ld", mrafsParm.OptLogLevel); - strcat(tbuffer, pbuffer); + sprintf(pbuffer, " -LogLevel %ld", mrafsParm.OptLogLevel); + strcat(tbuffer, pbuffer); } if (mrafsParm.OptRxDebug) - strcat(tbuffer," -rxdebug"); + strcat(tbuffer, " -rxdebug"); if (mrafsParm.OptResidencies) { - sprintf(pbuffer, " -Residencies %lu", mrafsParm.OptResidencies); - strcat(tbuffer, pbuffer); - } + sprintf(pbuffer, " -Residencies %lu", mrafsParm.OptResidencies); + strcat(tbuffer, pbuffer); + } parms[0] = tbuffer; - parms[1] = "now"; /* when to do it */ - code = BOZO_CreateBnode(aconn, "cron", "salvage-tmp", parms[0], parms[1], - parms[2], parms[3], parms[4], notifier); + parms[1] = "now"; /* when to do it */ + code = + BOZO_CreateBnode(aconn, "cron", "salvage-tmp", parms[0], parms[1], + parms[2], parms[3], parms[4], notifier); if (code) { printf("bos: failed to start 'salvager' (%s)\n", em(code)); goto done; @@ -1268,7 +1390,8 @@ char *orphans; IOMGR_Sleep(5); tp = tbuffer; code = BOZO_GetInstanceInfo(aconn, "salvage-tmp", &tp, &istatus); - if (code) break; + if (code) + break; printf("bos: waiting for salvage to complete.\n"); } if (code != BZNOENT) { @@ -1283,29 +1406,35 @@ char *orphans; fprintf(outFile, "SalvageLog:\n"); tcall = rx_NewCall(aconn); /* MUST pass canonical (wire-format) salvager log path to bosserver */ - code = StartBOZO_GetLog(tcall, AFSDIR_CANONICAL_SERVER_SLVGLOG_FILEPATH); + code = + StartBOZO_GetLog(tcall, AFSDIR_CANONICAL_SERVER_SLVGLOG_FILEPATH); if (code) { rx_EndCall(tcall, code); goto done; } /* copy data */ - while(1) { + while (1) { code = rx_Read(tcall, &buffer, 1); - if (code != 1) break; + if (code != 1) + break; putc(buffer, outFile); - if (buffer == 0) break; /* the end delimeter */ + if (buffer == 0) + break; /* the end delimeter */ } code = rx_EndCall(tcall, 0); /* fall through into cleanup code */ } done: - if (closeIt && outFile) fclose(outFile); + if (closeIt && outFile) + fclose(outFile); return code; } -static GetLogCmd(as) -register struct cmd_syndesc *as; { +static +GetLogCmd(as) + register struct cmd_syndesc *as; +{ struct rx_connection *tconn; register struct rx_call *tcall; register afs_int32 code; @@ -1322,13 +1451,14 @@ register struct cmd_syndesc *as; { } /* copy data */ error = 0; - while(1) { + while (1) { code = rx_Read(tcall, &buffer, 1); if (code != 1) { error = EIO; break; } - if (buffer == 0) break; /* the end delimeter */ + if (buffer == 0) + break; /* the end delimeter */ putchar(buffer); } code = rx_EndCall(tcall, error); @@ -1340,8 +1470,10 @@ register struct cmd_syndesc *as; { return code; } -static SalvageCmd(as) -struct cmd_syndesc *as; { +static +SalvageCmd(as) + struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register afs_int32 code, rc, i; char *outName; @@ -1355,15 +1487,15 @@ struct cmd_syndesc *as; { char *tp; memset(&mrafsParm, 0, sizeof(mrafsParm)); - + /* parm 0 is machine name, 1 is partition, 2 is volume, 3 is -all flag */ tconn = GetConn(as, 0); /* Find out whether fileserver is running MR-AFS (has a scanner instance) */ /* XXX this should really be done some other way, potentially by RPC */ - tp = &tname; + tp = &tname[0]; if (code = BOZO_GetInstanceParm(tconn, "fs", 3, &tp) == 0) - mrafs = 1; + mrafs = 1; /* we can do a volume, a partition or the whole thing, but not mixtures * thereof */ @@ -1384,91 +1516,95 @@ struct cmd_syndesc *as; { if (as->parms[3].items) outName = as->parms[3].items->data; else - outName = (char *) 0; + outName = NULL; if (as->parms[5].items) showlog = 1; /* parallel option */ - parallel = (char *) 0; + parallel = NULL; if (as->parms[6].items) parallel = as->parms[6].items->data; /* get the tmpdir filename if any */ - tmpDir = (char *)0; + tmpDir = NULL; if (as->parms[7].items) tmpDir = as->parms[7].items->data; /* -orphans option */ - orphans = (char *)0; + orphans = NULL; if (as->parms[8].items) { if (mrafs) { printf("Can't specify -orphans for MR-AFS fileserver\n"); return EINVAL; } - orphans = as->parms[8].items->data; + orphans = as->parms[8].items->data; } - + if (mrafs) { - if (as->parms[MRAFS_OFFSET].items) - mrafsParm.Optdebug = 1; - if (as->parms[MRAFS_OFFSET + 1].items) - mrafsParm.Optnowrite = 1; - if (as->parms[MRAFS_OFFSET + 2].items) - mrafsParm.Optforce = 1; - if (as->parms[MRAFS_OFFSET + 3].items) - mrafsParm.Optoktozap = 1; - if (as->parms[MRAFS_OFFSET + 4].items) - mrafsParm.Optrootfiles = 1; - if (as->parms[MRAFS_OFFSET + 5].items) - mrafsParm.Optsalvagedirs = 1; - if (as->parms[MRAFS_OFFSET + 6].items) - mrafsParm.Optblockreads = 1; - if (as->parms[MRAFS_OFFSET + 7].items) - mrafsParm.OptListResidencies = 1; - if (as->parms[MRAFS_OFFSET + 8].items) - mrafsParm.OptSalvageRemote = 1; - if (as->parms[MRAFS_OFFSET + 9].items) - mrafsParm.OptSalvageArchival = 1; - if (as->parms[MRAFS_OFFSET + 10].items) - mrafsParm.OptIgnoreCheck = 1; - if (as->parms[MRAFS_OFFSET + 11].items) - mrafsParm.OptForceOnLine = 1; - if (as->parms[MRAFS_OFFSET + 12].items) - mrafsParm.OptUseRootDirACL = 1; - if (as->parms[MRAFS_OFFSET + 13].items) - mrafsParm.OptTraceBadLinkCounts = 1; - if (as->parms[MRAFS_OFFSET + 14].items) - mrafsParm.OptDontAskFS = 1; - if (as->parms[MRAFS_OFFSET + 15].items) - mrafsParm.OptLogLevel = atoi(as->parms[MRAFS_OFFSET + 15].items->data); - if (as->parms[MRAFS_OFFSET + 16].items) - mrafsParm.OptRxDebug = 1; - if (as->parms[MRAFS_OFFSET + 17].items) { - if (as->parms[MRAFS_OFFSET + 8].items || - as->parms[MRAFS_OFFSET + 9].items) { - printf("Can't specify -Residencies with -SalvageRemote or -SalvageArchival\n"); - return EINVAL; - } - code = GetUInt32(as->parms[MRAFS_OFFSET + 17].items->data, - &mrafsParm.OptResidencies); - if (code) { - printf("bos: '%s' is not a valid residency mask.\n", - as->parms[MRAFS_OFFSET + 13].items->data); - return code; - } - } + if (as->parms[MRAFS_OFFSET].items) + mrafsParm.Optdebug = 1; + if (as->parms[MRAFS_OFFSET + 1].items) + mrafsParm.Optnowrite = 1; + if (as->parms[MRAFS_OFFSET + 2].items) + mrafsParm.Optforce = 1; + if (as->parms[MRAFS_OFFSET + 3].items) + mrafsParm.Optoktozap = 1; + if (as->parms[MRAFS_OFFSET + 4].items) + mrafsParm.Optrootfiles = 1; + if (as->parms[MRAFS_OFFSET + 5].items) + mrafsParm.Optsalvagedirs = 1; + if (as->parms[MRAFS_OFFSET + 6].items) + mrafsParm.Optblockreads = 1; + if (as->parms[MRAFS_OFFSET + 7].items) + mrafsParm.OptListResidencies = 1; + if (as->parms[MRAFS_OFFSET + 8].items) + mrafsParm.OptSalvageRemote = 1; + if (as->parms[MRAFS_OFFSET + 9].items) + mrafsParm.OptSalvageArchival = 1; + if (as->parms[MRAFS_OFFSET + 10].items) + mrafsParm.OptIgnoreCheck = 1; + if (as->parms[MRAFS_OFFSET + 11].items) + mrafsParm.OptForceOnLine = 1; + if (as->parms[MRAFS_OFFSET + 12].items) + mrafsParm.OptUseRootDirACL = 1; + if (as->parms[MRAFS_OFFSET + 13].items) + mrafsParm.OptTraceBadLinkCounts = 1; + if (as->parms[MRAFS_OFFSET + 14].items) + mrafsParm.OptDontAskFS = 1; + if (as->parms[MRAFS_OFFSET + 15].items) + mrafsParm.OptLogLevel = + atoi(as->parms[MRAFS_OFFSET + 15].items->data); + if (as->parms[MRAFS_OFFSET + 16].items) + mrafsParm.OptRxDebug = 1; + if (as->parms[MRAFS_OFFSET + 17].items) { + if (as->parms[MRAFS_OFFSET + 8].items + || as->parms[MRAFS_OFFSET + 9].items) { + printf + ("Can't specify -Residencies with -SalvageRemote or -SalvageArchival\n"); + return EINVAL; + } + code = + util_GetUInt32(as->parms[MRAFS_OFFSET + 17].items->data, + &mrafsParm.OptResidencies); + if (code) { + printf("bos: '%s' is not a valid residency mask.\n", + as->parms[MRAFS_OFFSET + 13].items->data); + return code; + } + } } else { - int stop = 0; + int stop = 0; - for (i = 9; i < ADDPARMOFFSET; i++) { - if (as->parms[i].items) { - printf(" %s only possible for MR-AFS fileserver.\n", - as->parms[i].name); - stop = 1; - } - } - if (stop) exit(1); + for (i = 9; i < ADDPARMOFFSET; i++) { + if (as->parms[i].items) { + printf(" %s only possible for MR-AFS fileserver.\n", + as->parms[i].name); + stop = 1; + } + } + if (stop) + exit(1); } if (as->parms[4].items) { @@ -1483,11 +1619,13 @@ struct cmd_syndesc *as; { } code = BOZO_WaitAll(tconn); /* wait for shutdown to complete */ if (code) - printf("bos: failed to wait for file server shutdown, continuing.\n"); + printf + ("bos: failed to wait for file server shutdown, continuing.\n"); } /* now do the salvage operation */ printf("Starting salvage.\n"); - rc = DoSalvage(tconn, (char *) 0, (char *) 0, outName, showlog,parallel,tmpDir,orphans); + rc = DoSalvage(tconn, NULL, NULL, outName, showlog, parallel, tmpDir, + orphans); if (curGoal == BSTAT_NORMAL) { printf("bos: restarting fs.\n"); code = BOZO_SetTStatus(tconn, "fs", BSTAT_NORMAL); @@ -1496,11 +1634,12 @@ struct cmd_syndesc *as; { return code; } } - if (rc) return rc; - } - else if (!as->parms[2].items) { + if (rc) + return rc; + } else if (!as->parms[2].items) { if (!as->parms[1].items) { - printf("bos: must specify -all switch to salvage all partitions.\n"); + printf + ("bos: must specify -all switch to salvage all partitions.\n"); return -1; } if (volutil_GetPartitionID(as->parms[1].items->data) < 0) { @@ -1522,12 +1661,13 @@ struct cmd_syndesc *as; { } code = BOZO_WaitAll(tconn); /* wait for shutdown to complete */ if (code) - printf("bos: failed to wait for file server shutdown, continuing.\n"); + printf + ("bos: failed to wait for file server shutdown, continuing.\n"); } /* now do the salvage operation */ printf("Starting salvage.\n"); - rc = DoSalvage(tconn, as->parms[1].items->data, (char *) 0, - outName, showlog,parallel,tmpDir,orphans); + rc = DoSalvage(tconn, as->parms[1].items->data, NULL, outName, + showlog, parallel, tmpDir, orphans); if (curGoal == BSTAT_NORMAL) { printf("bos: restarting fs.\n"); code = BOZO_SetTStatus(tconn, "fs", BSTAT_NORMAL); @@ -1536,36 +1676,40 @@ struct cmd_syndesc *as; { return code; } } - if (rc) return rc; - } - else { + if (rc) + return rc; + } else { /* salvage individual volume (don't shutdown fs first), just use - * single-shot cron bnode. Must leave server running when using this - * option, since salvager will ask file server for the volume */ + * single-shot cron bnode. Must leave server running when using this + * option, since salvager will ask file server for the volume */ char *tmpname; afs_int32 err; const char *confdir; int localauth; - if (as->parms[ADDPARMOFFSET].items) + if (as->parms[ADDPARMOFFSET].items) tmpname = as->parms[ADDPARMOFFSET].items->data; - else tmpname = (char *) 0; + else + tmpname = NULL; localauth = (as->parms[ADDPARMOFFSET + 2].items != 0); - confdir = (localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH); - code = vsu_ClientInit(/* noauth */ 1, confdir, tmpname, - /* server auth */ 0, &cstruct, (int (*)()) 0); + confdir = + (localauth ? AFSDIR_SERVER_ETC_DIRPATH : + AFSDIR_CLIENT_ETC_DIRPATH); + code = vsu_ClientInit( /* noauth */ 1, confdir, tmpname, + /* server auth */ 0, &cstruct, (int (*)())0); if (code == 0) { newID = vsu_GetVolumeID(as->parms[2].items->data, cstruct, &err); if (newID == 0) { - printf("bos: can't interpret %s as volume name or ID\n", as->parms[2].items->data); + printf("bos: can't interpret %s as volume name or ID\n", + as->parms[2].items->data); return -1; } sprintf(tname, "%u", newID); - } - else { - printf("bos: can't initialize volume system client (code %d), trying anyway.\n", - as->parms[2].items->data, code); + } else { + printf + ("bos: can't initialize volume system client (code %d), trying anyway.\n", + code); strncpy(tname, as->parms[2].items->data, sizeof(tname)); } if (volutil_GetPartitionID(as->parms[1].items->data) < 0) { @@ -1578,33 +1722,36 @@ struct cmd_syndesc *as; { } printf("Starting salvage.\n"); rc = DoSalvage(tconn, as->parms[1].items->data, tname, outName, - showlog,parallel,tmpDir,orphans); - if (rc) - return rc; + showlog, parallel, tmpDir, orphans); + if (rc) + return rc; } return 0; } -static IStatServer(as, int32p) -int int32p; -register struct cmd_syndesc *as; { +static +IStatServer(as, int32p) + int int32p; + register struct cmd_syndesc *as; +{ register struct rx_connection *tconn; register struct cmd_item *ti; int firstTime = 1; tconn = GetConn(as, 0); - for (ti=as->parms[1].items; ti; ti=ti->next) { + for (ti = as->parms[1].items; ti; ti = ti->next) { DoStat(ti->data, tconn, int32p, firstTime); firstTime = 0; } return 0; } -static DoStat (aname, aconn, aint32p, firstTime) - IN char *aname; - IN register struct rx_connection *aconn; - IN int aint32p; - IN int firstTime; /* true iff first instance in cmd */ +static +DoStat(aname, aconn, aint32p, firstTime) + IN char *aname; + IN register struct rx_connection *aconn; + IN int aint32p; + IN int firstTime; /* true iff first instance in cmd */ { afs_int32 temp; char buffer[500]; @@ -1617,20 +1764,24 @@ static DoStat (aname, aconn, aint32p, firstTime) tp = buffer; code = BOZO_GetInstanceInfo(aconn, aname, &tp, &istatus); if (code) { - printf("bos: failed to get instance info for '%s' (%s)\n", - aname, em(code)); + printf("bos: failed to get instance info for '%s' (%s)\n", aname, + em(code)); return -1; } if (firstTime && aint32p && (istatus.flags & BOZO_BADDIRACCESS)) - printf ("Bosserver reports inappropriate access on server directories\n"); + printf + ("Bosserver reports inappropriate access on server directories\n"); printf("Instance %s, ", aname); - if (aint32p) printf("(type is %s) ", buffer); + if (aint32p) + printf("(type is %s) ", buffer); if (istatus.fileGoal == istatus.goal) { - if (!istatus.goal) printf("disabled, "); - } - else { - if (istatus.fileGoal) printf("temporarily disabled, "); - else printf("temporarily enabled, "); + if (!istatus.goal) + printf("disabled, "); + } else { + if (istatus.fileGoal) + printf("temporarily disabled, "); + else + printf("temporarily enabled, "); } if (istatus.flags & BOZO_ERRORSTOP) @@ -1641,21 +1792,26 @@ static DoStat (aname, aconn, aint32p, firstTime) tp = buffer; code = BOZO_GetStatus(aconn, aname, &temp, &tp); if (code) - printf("bos: failed to get status for instance '%s' (%s)\n", - aname, em(code)); + printf("bos: failed to get status for instance '%s' (%s)\n", aname, + em(code)); else { - printf("currently ", aname); - if (temp == BSTAT_NORMAL) printf("running normally.\n"); - else if (temp == BSTAT_SHUTDOWN) printf("shutdown.\n"); - else if (temp == BSTAT_STARTINGUP) printf("starting up.\n"); - else if (temp == BSTAT_SHUTTINGDOWN) printf("shutting down.\n"); + printf("currently "); + if (temp == BSTAT_NORMAL) + printf("running normally.\n"); + else if (temp == BSTAT_SHUTDOWN) + printf("shutdown.\n"); + else if (temp == BSTAT_STARTINGUP) + printf("starting up.\n"); + else if (temp == BSTAT_SHUTTINGDOWN) + printf("shutting down.\n"); if (buffer[0] != 0) { printf(" Auxiliary status is: %s.\n", buffer); } } /* are we done yet? */ - if (!aint32p) return 0; + if (!aint32p) + return 0; if (istatus.procStartTime) printf(" Process last started at %s (%d proc starts)\n", @@ -1664,7 +1820,7 @@ static DoStat (aname, aconn, aint32p, firstTime) printf(" Last exit at %s\n", DateOf(istatus.lastAnyExit)); } if (istatus.lastErrorExit) { - is1 = is2 = is3 = is4 = (char *) 0; + is1 = is2 = is3 = is4 = NULL; printf(" Last error exit at %s, ", DateOf(istatus.lastErrorExit)); code = BOZO_GetInstanceStrings(aconn, aname, &is1, &is2, &is3, &is4); /* don't complain about failing call, since could simply mean @@ -1685,18 +1841,18 @@ static DoStat (aname, aconn, aint32p, firstTime) printf("due to shutdown request\n"); else printf("due to signal %d\n", istatus.errorSignal); - } - else + } else printf("by exiting with code %d\n", istatus.errorCode); } - + if (aint32p > 1) { /* try to display all the parms */ - for(i=0;;i++) { + for (i = 0;; i++) { tp = buffer; code = BOZO_GetInstanceParm(aconn, aname, i, &tp); - if (code) break; - printf(" Command %d is '%s'\n", i+1, buffer); + if (code) + break; + printf(" Command %d is '%s'\n", i + 1, buffer); } tp = buffer; code = BOZO_GetInstanceParm(aconn, aname, 999, &tp); @@ -1710,48 +1866,56 @@ static DoStat (aname, aconn, aint32p, firstTime) } #ifdef BOS_RESTRICTED_MODE -static GetRestrict(as) -struct cmd_syndesc *as; { +static +GetRestrict(as) + struct cmd_syndesc *as; +{ register struct rx_connection *tconn; afs_int32 code, val; - + tconn = GetConn(as, 0); code = BOZO_GetRestrictedMode(tconn, &val); - if (code) printf("bos: failed to get restricted mode (%s)\n", em(code)); - else printf("Restricted mode is %s\n", val ? "on" : "off"); - + if (code) + printf("bos: failed to get restricted mode (%s)\n", em(code)); + else + printf("Restricted mode is %s\n", val ? "on" : "off"); + return 0; } -static SetRestrict(as) -struct cmd_syndesc *as; { +static +SetRestrict(as) + struct cmd_syndesc *as; +{ register struct rx_connection *tconn; afs_int32 code, val; - + tconn = GetConn(as, 0); util_GetInt32(as->parms[1].items->data, &val); code = BOZO_SetRestrictedMode(tconn, val); - if (code) printf("bos: failed to set restricted mode (%s)\n", em(code)); + if (code) + printf("bos: failed to set restricted mode (%s)\n", em(code)); return 0; } #endif -static void add_std_args (ts) - register struct cmd_syndesc *ts; +static void +add_std_args(ts) + register struct cmd_syndesc *ts; { cmd_Seek(ts, ADDPARMOFFSET); /* + 0 */ cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name"); /* + 1 */ cmd_AddParm(ts, "-noauth", CMD_FLAG, CMD_OPTIONAL, - "don't authenticate"); - /* + 2 */ cmd_AddParm (ts, "-localauth", CMD_FLAG, CMD_OPTIONAL, - "create tickets from KeyFile"); + "don't authenticate"); + /* + 2 */ cmd_AddParm(ts, "-localauth", CMD_FLAG, CMD_OPTIONAL, + "create tickets from KeyFile"); } - + #include "AFS_component_version_number.c" main(argc, argv) - int argc; - char **argv; + int argc; + char **argv; { register afs_int32 code; register struct cmd_syndesc *ts; @@ -1765,7 +1929,7 @@ main(argc, argv) * generated which, in many cases, isn't too useful. */ struct sigaction nsa; - + sigemptyset(&nsa.sa_mask); nsa.sa_handler = SIG_DFL; nsa.sa_flags = SA_FULLDUMP; @@ -1797,7 +1961,7 @@ main(argc, argv) ts = cmd_CreateSyntax("start", StartServer, 0, "start running a server"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-instance", CMD_LIST, 0, "server process name"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("stop", StopServer, 0, "halt a server instance"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); @@ -1805,15 +1969,15 @@ main(argc, argv) cmd_Seek(ts, 8); cmd_AddParm(ts, "-wait", CMD_FLAG, CMD_OPTIONAL, "wait for process to stop"); - add_std_args (ts); - + add_std_args(ts); + ts = cmd_CreateSyntax("status", StatServer, 0, "show server instance status"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL, "server process name"); cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "long status"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("shutdown", Shutdown, 0, "shutdown all processes"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); @@ -1821,19 +1985,20 @@ main(argc, argv) cmd_Seek(ts, 8); cmd_AddParm(ts, "-wait", CMD_FLAG, CMD_OPTIONAL, "wait for process to stop"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("startup", Startup, 0, "start all processes"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL, "instances"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("restart", Restart, 0, "restart processes"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL, "instances"); - cmd_AddParm(ts, "-bosserver", CMD_FLAG, CMD_OPTIONAL, "restart bosserver"); + cmd_AddParm(ts, "-bosserver", CMD_FLAG, CMD_OPTIONAL, + "restart bosserver"); cmd_AddParm(ts, "-all", CMD_FLAG, CMD_OPTIONAL, "restart all processes"); - add_std_args (ts); + add_std_args(ts); #ifndef OPBOS @@ -1843,105 +2008,107 @@ main(argc, argv) cmd_AddParm(ts, "-instance", CMD_SINGLE, 0, "server process name"); cmd_AddParm(ts, "-type", CMD_SINGLE, 0, "server type"); cmd_AddParm(ts, "-cmd", CMD_LIST, 0, "command lines"); - cmd_AddParm(ts, "-notifier", CMD_SINGLE, CMD_OPTIONAL, "Notifier program"); - add_std_args (ts); + cmd_AddParm(ts, "-notifier", CMD_SINGLE, CMD_OPTIONAL, + "Notifier program"); + add_std_args(ts); ts = cmd_CreateSyntax("delete", DeleteServer, 0, "delete a server instance"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-instance", CMD_LIST, 0, "server process name"); - add_std_args (ts); - + add_std_args(ts); + ts = cmd_CreateSyntax("adduser", AddSUser, 0, "add users to super-user list"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-user", CMD_LIST, 0, "user names"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("removeuser", RemoveSUser, 0, "remove users from super-user list"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-user", CMD_LIST, 0, "user names"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("listusers", ListSUsers, 0, "list super-users"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("addkey", AddKey, 0, - "add keys to key dbase (kvno 999 is bcrypt)"); + "add keys to key dbase (kvno 999 is bcrypt)"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-key", CMD_SINGLE, CMD_OPTIONAL, "key"); cmd_AddParm(ts, "-kvno", CMD_SINGLE, 0, "key version number"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("removekey", RemoveKey, 0, "remove keys from key dbase"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-kvno", CMD_LIST, 0, "key version number"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("listkeys", ListKeys, 0, "list keys"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); - cmd_AddParm(ts, "-showkey", CMD_FLAG, CMD_OPTIONAL, "show the actual key rather than the checksum"); - add_std_args (ts); + cmd_AddParm(ts, "-showkey", CMD_FLAG, CMD_OPTIONAL, + "show the actual key rather than the checksum"); + add_std_args(ts); ts = cmd_CreateSyntax("listhosts", ListHosts, 0, "get cell host list"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); - add_std_args (ts); + add_std_args(ts); cmd_CreateAlias(ts, "getcell"); ts = cmd_CreateSyntax("setcellname", SetCellName, 0, "set cell name"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "cell name"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("addhost", AddHost, 0, "add host to cell dbase"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-host", CMD_LIST, 0, "host name"); cmd_AddParm(ts, "-clone", CMD_FLAG, CMD_OPTIONAL, "vote doesn't count"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("removehost", RemoveHost, 0, "remove host from cell dbase"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-host", CMD_LIST, 0, "host name"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("setauth", SetAuth, 0, "set authentication required flag"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); - cmd_AddParm(ts, "-authrequired", CMD_SINGLE, - 0, "on or off: authentication required for admin requests"); - add_std_args (ts); - + cmd_AddParm(ts, "-authrequired", CMD_SINGLE, 0, + "on or off: authentication required for admin requests"); + add_std_args(ts); + ts = cmd_CreateSyntax("install", Install, 0, "install program"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-file", CMD_LIST, 0, "files to install"); cmd_AddParm(ts, "-dir", CMD_SINGLE, CMD_OPTIONAL, "destination dir"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("uninstall", UnInstall, 0, "uninstall program"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-file", CMD_LIST, 0, "files to uninstall"); cmd_AddParm(ts, "-dir", CMD_SINGLE, CMD_OPTIONAL, "destination dir"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("getlog", GetLogCmd, 0, "examine log file"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-file", CMD_SINGLE, 0, "log file to examine"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("getdate", GetDate, 0, "get dates for programs"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-file", CMD_LIST, 0, "files to check"); cmd_AddParm(ts, "-dir", CMD_SINGLE, CMD_OPTIONAL, "destination dir"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("exec", Exec, 0, "execute shell command on server"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-cmd", CMD_SINGLE, 0, "command to execute"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("prune", Prune, 0, "prune server files"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); @@ -1949,78 +2116,101 @@ main(argc, argv) cmd_AddParm(ts, "-old", CMD_FLAG, CMD_OPTIONAL, "delete .OLD files"); cmd_AddParm(ts, "-core", CMD_FLAG, CMD_OPTIONAL, "delete core files"); cmd_AddParm(ts, "-all", CMD_FLAG, CMD_OPTIONAL, "delete all junk files"); - add_std_args (ts); + add_std_args(ts); - ts = cmd_CreateSyntax("setrestart", SetRestartCmd, 0, "set restart times"); + ts = cmd_CreateSyntax("setrestart", SetRestartCmd, 0, + "set restart times"); cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name"); - cmd_AddParm(ts, "-time", CMD_SINGLE, - CMD_REQUIRED, "time to restart server"); - cmd_AddParm(ts, "-general", CMD_FLAG, - CMD_OPTIONAL, "set general restart time"); - cmd_AddParm(ts, "-newbinary", CMD_FLAG, - CMD_OPTIONAL, "set new binary restart time"); - add_std_args (ts); - - ts = cmd_CreateSyntax("getrestart", GetRestartCmd, 0, "get restart times"); + cmd_AddParm(ts, "-time", CMD_SINGLE, CMD_REQUIRED, + "time to restart server"); + cmd_AddParm(ts, "-general", CMD_FLAG, CMD_OPTIONAL, + "set general restart time"); + cmd_AddParm(ts, "-newbinary", CMD_FLAG, CMD_OPTIONAL, + "set new binary restart time"); + add_std_args(ts); + + ts = cmd_CreateSyntax("getrestart", GetRestartCmd, 0, + "get restart times"); cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("salvage", SalvageCmd, 0, "salvage partition or volumes"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); - cmd_AddParm(ts, "-partition", CMD_SINGLE, - CMD_OPTIONAL, "salvage partition"); - cmd_AddParm(ts, "-volume", CMD_SINGLE, - CMD_OPTIONAL, "salvage volume number or volume name"); - cmd_AddParm(ts, "-file", CMD_SINGLE, - CMD_OPTIONAL, "salvage log output file"); + cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, + "salvage partition"); + cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_OPTIONAL, + "salvage volume number or volume name"); + cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, + "salvage log output file"); cmd_AddParm(ts, "-all", CMD_FLAG, CMD_OPTIONAL, "salvage whole server"); - cmd_AddParm(ts, "-showlog", CMD_FLAG, CMD_OPTIONAL, "display salvage log"); - cmd_AddParm(ts, "-parallel",CMD_SINGLE, CMD_OPTIONAL, - "# of max parallel partition salvaging"); - cmd_AddParm(ts, "-tmpdir",CMD_SINGLE, CMD_OPTIONAL, + cmd_AddParm(ts, "-showlog", CMD_FLAG, CMD_OPTIONAL, + "display salvage log"); + cmd_AddParm(ts, "-parallel", CMD_SINGLE, CMD_OPTIONAL, + "# of max parallel partition salvaging"); + cmd_AddParm(ts, "-tmpdir", CMD_SINGLE, CMD_OPTIONAL, "directory to place tmp files"); - cmd_AddParm(ts, "-orphans", CMD_SINGLE, CMD_OPTIONAL, + cmd_AddParm(ts, "-orphans", CMD_SINGLE, CMD_OPTIONAL, "ignore | remove | attach"); - cmd_AddParm(ts, "-debug", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Run in Debugging mode"); - cmd_AddParm(ts, "-nowrite", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Run readonly/test mode"); - cmd_AddParm(ts, "-force", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Force full salvaging"); - cmd_AddParm(ts, "-oktozap", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Give permission to destroy bogus file residencies/volumes - debugging flag"); - cmd_AddParm(ts, "-rootfiles", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Show files owned by root - debugging flag"); - cmd_AddParm(ts, "-salvagedirs", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Force rebuild/salvage of all directories"); - cmd_AddParm(ts, "-blockreads", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Read smaller blocks to handle IO/bad blocks"); - cmd_AddParm(ts, "-ListResidencies", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Just list affected file residencies - debugging flag"); - cmd_AddParm(ts, "-SalvageRemote", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Salvage storage systems that are not directly attached"); - cmd_AddParm(ts, "-SalvageArchival", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Salvage HSM storage systems"); - cmd_AddParm(ts, "-IgnoreCheck", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Don't perform VLDB safety check when deleting unreferenced files. Only a good idea in single server cell."); - cmd_AddParm(ts, "-ForceOnLine", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Force the volume to come online, even if it hasn't salvaged cleanly."); - cmd_AddParm(ts, "-UseRootDirACL", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Use the root directory ACL for lost+found directory if it is created."); - cmd_AddParm(ts, "-TraceBadLinkCounts", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Print out lines about volume reference count changes."); - cmd_AddParm(ts, "-DontAskFS", CMD_FLAG,CMD_OPTIONAL, "(MR-AFS) Don't ask fileserver to take volume offline. THIS IS VERY DANGEROUS."); - cmd_AddParm(ts, "-LogLevel", CMD_SINGLE, CMD_OPTIONAL, "(MR-AFS) log level"); - cmd_AddParm(ts, "-rxdebug", CMD_FLAG, CMD_OPTIONAL, "(MR-AFS) Write out rx debug information."); - cmd_AddParm(ts, "-Residencies", CMD_SINGLE, CMD_OPTIONAL, "(MR-AFS) Numeric mask of residencies to be included in the salvage. Do not use with -SalvageRemote or -SalvageArchival"); - add_std_args (ts); + cmd_AddParm(ts, "-debug", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Run in Debugging mode"); + cmd_AddParm(ts, "-nowrite", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Run readonly/test mode"); + cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Force full salvaging"); + cmd_AddParm(ts, "-oktozap", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Give permission to destroy bogus file residencies/volumes - debugging flag"); + cmd_AddParm(ts, "-rootfiles", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Show files owned by root - debugging flag"); + cmd_AddParm(ts, "-salvagedirs", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Force rebuild/salvage of all directories"); + cmd_AddParm(ts, "-blockreads", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Read smaller blocks to handle IO/bad blocks"); + cmd_AddParm(ts, "-ListResidencies", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Just list affected file residencies - debugging flag"); + cmd_AddParm(ts, "-SalvageRemote", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Salvage storage systems that are not directly attached"); + cmd_AddParm(ts, "-SalvageArchival", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Salvage HSM storage systems"); + cmd_AddParm(ts, "-IgnoreCheck", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Don't perform VLDB safety check when deleting unreferenced files. Only a good idea in single server cell."); + cmd_AddParm(ts, "-ForceOnLine", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Force the volume to come online, even if it hasn't salvaged cleanly."); + cmd_AddParm(ts, "-UseRootDirACL", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Use the root directory ACL for lost+found directory if it is created."); + cmd_AddParm(ts, "-TraceBadLinkCounts", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Print out lines about volume reference count changes."); + cmd_AddParm(ts, "-DontAskFS", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Don't ask fileserver to take volume offline. THIS IS VERY DANGEROUS."); + cmd_AddParm(ts, "-LogLevel", CMD_SINGLE, CMD_OPTIONAL, + "(MR-AFS) log level"); + cmd_AddParm(ts, "-rxdebug", CMD_FLAG, CMD_OPTIONAL, + "(MR-AFS) Write out rx debug information."); + cmd_AddParm(ts, "-Residencies", CMD_SINGLE, CMD_OPTIONAL, + "(MR-AFS) Numeric mask of residencies to be included in the salvage. Do not use with -SalvageRemote or -SalvageArchival"); + add_std_args(ts); ts = cmd_CreateSyntax("blockscanner", BlockScannerCmd, 0, - "block scanner daemon from making migration requests"); + "block scanner daemon from making migration requests"); cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name"); - add_std_args (ts); + add_std_args(ts); ts = cmd_CreateSyntax("unblockscanner", UnBlockScannerCmd, 0, - "allow scanner daemon to make migration requests again"); + "allow scanner daemon to make migration requests again"); cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name"); - add_std_args (ts); + add_std_args(ts); #ifdef BOS_RESTRICTED_MODE - ts = cmd_CreateSyntax("getrestricted", GetRestrict, 0, "get restrict mode"); + ts = cmd_CreateSyntax("getrestricted", GetRestrict, 0, + "get restrict mode"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); - add_std_args (ts); + add_std_args(ts); - ts = cmd_CreateSyntax("setrestricted", SetRestrict, 0, "set restrict mode"); + ts = cmd_CreateSyntax("setrestricted", SetRestrict, 0, + "set restrict mode"); cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name"); cmd_AddParm(ts, "-mode", CMD_SINGLE, 0, "mode to set"); - add_std_args (ts); + add_std_args(ts); #endif #endif diff --git a/src/bozo/bos_util.c b/src/bozo/bos_util.c index 3bbf9804c..4af472f3c 100644 --- a/src/bozo/bos_util.c +++ b/src/bozo/bos_util.c @@ -22,19 +22,28 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bos_util.c,v 1.1.1.2 2003/07/30 17:11:24 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bozo/bos_util.c,v 1.4 2003/07/15 23:14:43 shadow Exp $"); #include #include #include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif + #include #include #include #include #include -int +int main(int argc, char **argv) { struct afsconf_dir *tdir; @@ -54,14 +63,15 @@ main(int argc, char **argv) tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIR); if (!tdir) { - printf("bos_util: can't initialize conf dir '%s'\n", AFSDIR_SERVER_ETC_DIR); + printf("bos_util: can't initialize conf dir '%s'\n", + AFSDIR_SERVER_ETC_DIR); exit(1); } - if (strcmp(argv[1], "add")==0) { + if (strcmp(argv[1], "add") == 0) { struct ktc_encryptionKey tkey; int kvno; char buf[BUFSIZ], ver[BUFSIZ]; - char *tcell = (char *) 0; + char *tcell = NULL; if (argc != 3) { printf("bos_util add: usage is 'bos_util add \n"); @@ -71,33 +81,32 @@ main(int argc, char **argv) memset(&tkey, 0, sizeof(struct ktc_encryptionKey)); /* prompt for key */ - code=des_read_pw_string(buf,sizeof(buf),"input key: ",0); - if(code || strlen(buf)==0) { + code = des_read_pw_string(buf, sizeof(buf), "input key: ", 0); + if (code || strlen(buf) == 0) { printf("Bad key: \n"); exit(1); } - code=des_read_pw_string(ver,sizeof(ver),"Retype input key: ",0); - if(code || strlen(ver)==0) { + code = des_read_pw_string(ver, sizeof(ver), "Retype input key: ", 0); + if (code || strlen(ver) == 0) { printf("Bad key: \n"); exit(1); } - if (strcmp (ver, buf) != 0) { - printf ("\nInput key mismatch\n"); + if (strcmp(ver, buf) != 0) { + printf("\nInput key mismatch\n"); exit(1); } - ka_StringToKey(buf,tcell,&tkey); - code = afsconf_AddKey(tdir, kvno, &tkey); + ka_StringToKey(buf, tcell, &tkey); + code = afsconf_AddKey(tdir, kvno, &tkey, 0); if (code) { printf("bos_util: failed to set key, code %d.\n", code); exit(1); } - } - else if (strcmp(argv[1], "adddes")==0) { + } else if (strcmp(argv[1], "adddes") == 0) { struct ktc_encryptionKey tkey; int kvno; register afs_int32 code; char buf[BUFSIZ], ver[BUFSIZ]; - char *tcell = (char *) 0; + char *tcell = NULL; if (argc != 3) { printf("bos_util adddes: usage is 'bos_util adddes \n"); @@ -107,55 +116,56 @@ main(int argc, char **argv) memset(&tkey, 0, sizeof(struct ktc_encryptionKey)); /* prompt for key */ - code=des_read_pw_string(buf,sizeof(buf),"input key: ",0); - if(code || strlen(buf)==0) { + code = des_read_pw_string(buf, sizeof(buf), "input key: ", 0); + if (code || strlen(buf) == 0) { printf("Bad key: \n"); exit(1); } - code=des_read_pw_string(ver,sizeof(ver),"Retype input key: ",0); - if(code || strlen(ver)==0) { + code = des_read_pw_string(ver, sizeof(ver), "Retype input key: ", 0); + if (code || strlen(ver) == 0) { printf("Bad key: \n"); exit(1); } - if (strcmp (ver, buf) != 0) { - printf ("\nInput key mismatch\n"); + if (strcmp(ver, buf) != 0) { + printf("\nInput key mismatch\n"); exit(1); } - des_string_to_key(buf,&tkey); - code = afsconf_AddKey(tdir, kvno, &tkey); + des_string_to_key(buf, &tkey); + code = afsconf_AddKey(tdir, kvno, &tkey, 0); if (code) { printf("bos_util: failed to set key, code %d.\n", code); exit(1); } } #ifdef KERBEROS - else if (strcmp(argv[1], "srvtab2keyfile")==0) { + else if (strcmp(argv[1], "srvtab2keyfile") == 0) { char tkey[8], name[255], inst[255], realm[255]; int kvno; if (argc != 5) { - printf("bos_util add: usage is 'bos_util srvtab2keyfile \n"); + printf + ("bos_util add: usage is 'bos_util srvtab2keyfile \n"); exit(1); } kvno = atoi(argv[2]); bzero(tkey, sizeof(tkey)); code = kname_parse(name, inst, realm, argv[4]); if (code != 0) { - printf("Invalid kerberos name\n"); - exit(1); + printf("Invalid kerberos name\n"); + exit(1); } code = read_service_key(name, inst, realm, kvno, argv[3], tkey); if (code != 0) { - printf("Can't find key in %s\n", argv[3]); - exit(1); + printf("Can't find key in %s\n", argv[3]); + exit(1); } - code = afsconf_AddKey(tdir, kvno, tkey); + code = afsconf_AddKey(tdir, kvno, tkey, 0); if (code) { printf("bos_util: failed to set key, code %d.\n", code); exit(1); } } #endif - else if (strcmp(argv[1], "delete")==0) { + else if (strcmp(argv[1], "delete") == 0) { long kvno; if (argc != 3) { printf("bos_util delete: usage is 'bos_util delete \n"); @@ -164,37 +174,38 @@ main(int argc, char **argv) kvno = atoi(argv[2]); code = afsconf_DeleteKey(tdir, kvno); if (code) { - printf("bos_util: failed to delete key %d, (code %d)\n", kvno, code); + printf("bos_util: failed to delete key %d, (code %d)\n", kvno, + code); exit(1); } - } - else if (strcmp(argv[1], "list") == 0) { + } else if (strcmp(argv[1], "list") == 0) { struct afsconf_keys tkeys; register int i; unsigned char tbuffer[9]; - + code = afsconf_GetKeys(tdir, &tkeys); if (code) { printf("bos_util: failed to get keys, code %d\n", code); exit(1); } - for(i=0;i #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosoprocs.c,v 1.1.1.11 2002/09/26 19:04:57 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bozo/bosoprocs.c,v 1.19 2003/12/07 22:49:18 jaltman Exp $"); #include #include @@ -37,6 +38,14 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosoprocs.c,v 1.1.1.11 2002/09/26 #include #include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif + #include "bnode.h" #include "bosint.h" @@ -44,30 +53,31 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosoprocs.c,v 1.1.1.11 2002/09/26 extern struct ktime bozo_nextRestartKT, bozo_nextDayKT; extern struct afsconf_dir *bozo_confdir; -extern struct rx_securityClass *bozo_rxsc[2]; extern int bozo_newKTs; extern int DoLogging; #ifdef BOS_RESTRICTED_MODE extern int bozo_isrestricted; #endif -BOZO_GetRestartTime(acall, atype, aktime) -struct rx_call *acall; -afs_int32 atype; -struct ktime *aktime; { +afs_int32 +SBOZO_GetRestartTime(acall, atype, aktime) + struct rx_call *acall; + afs_int32 atype; + struct bozo_netKTime *aktime; +{ register afs_int32 code; - code = 0; /* assume success */ + code = 0; /* assume success */ switch (atype) { - case 1: + case 1: memcpy(aktime, &bozo_nextRestartKT, sizeof(struct ktime)); break; - case 2: + case 2: memcpy(aktime, &bozo_nextDayKT, sizeof(struct ktime)); break; - default: + default: code = BZDOM; break; } @@ -75,31 +85,34 @@ struct ktime *aktime; { return code; } -BOZO_SetRestartTime(acall, atype, aktime) -struct rx_call *acall; -afs_int32 atype; -struct ktime *aktime; { +afs_int32 +SBOZO_SetRestartTime(acall, atype, aktime) + struct rx_call *acall; + afs_int32 atype; + struct bozo_netKTime *aktime; +{ register afs_int32 code; char caller[MAXKTCNAMELEN]; /* check for proper permissions */ if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } - if (DoLogging) bozo_Log("%s is executing SetRestartTime\n", caller); + if (DoLogging) + bozo_Log("%s is executing SetRestartTime\n", caller); - code = 0; /* assume success */ + code = 0; /* assume success */ switch (atype) { - case 1: + case 1: memcpy(&bozo_nextRestartKT, aktime, sizeof(struct ktime)); break; - case 2: + case 2: memcpy(&bozo_nextDayKT, aktime, sizeof(struct ktime)); break; - default: + default: code = BZDOM; break; } @@ -110,43 +123,48 @@ struct ktime *aktime; { bozo_newKTs = 1; } -fail: - osi_auditU (acall, BOS_SetRestartEvent, code, AUD_END); + fail: + osi_auditU(acall, BOS_SetRestartEvent, code, AUD_END); return code; } -BOZO_Exec(acall, acmd) -struct rx_call *acall; -char *acmd; { +afs_int32 +SBOZO_Exec(acall, acmd) + struct rx_call *acall; + char *acmd; +{ char caller[MAXKTCNAMELEN]; int code; if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } #ifdef BOS_RESTRICTED_MODE if (bozo_isrestricted) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } #endif - if (DoLogging) bozo_Log("%s is executing the shell command '%s'\n", caller, acmd); + if (DoLogging) + bozo_Log("%s is executing the shell command '%s'\n", caller, acmd); /* should copy output to acall, but don't yet cause its hard */ /* hard... NOT! Nnow _at least_ return the exit status */ code = system(acmd); - osi_auditU (acall, BOS_ExecEvent, code, AUD_STR, acmd, AUD_END); + osi_auditU(acall, BOS_ExecEvent, code, AUD_STR, acmd, AUD_END); -fail: + fail: return code; } -BOZO_GetDates(acall, aname, atime, abakTime, aoldTime) -struct rx_call *acall; -char *aname; -afs_int32 *atime, *abakTime, *aoldTime; { +afs_int32 +SBOZO_GetDates(acall, aname, atime, abakTime, aoldTime) + struct rx_call *acall; + char *aname; + afs_int32 *atime, *abakTime, *aoldTime; +{ struct stat tstat; char *strp; char tbuffer[AFSDIR_PATH_MAX]; @@ -178,9 +196,11 @@ afs_int32 *atime, *abakTime, *aoldTime; { return 0; } -BOZO_UnInstall(acall, aname) -struct rx_call *acall; -register char *aname; { +afs_int32 +SBOZO_UnInstall(acall, aname) + struct rx_call *acall; + register char *aname; +{ char *filepath; char fpOld[AFSDIR_PATH_MAX], fpBak[AFSDIR_PATH_MAX]; afs_int32 code; @@ -189,13 +209,13 @@ register char *aname; { if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { code = BZACCESS; - osi_auditU (acall, BOS_UnInstallEvent, code, AUD_STR, aname, AUD_END); + osi_auditU(acall, BOS_UnInstallEvent, code, AUD_STR, aname, AUD_END); return code; } #ifdef BOS_RESTRICTED_MODE if (bozo_isrestricted) { code = BZACCESS; - osi_auditU (acall, BOS_UnInstallEvent, code, AUD_STR, aname, AUD_END); + osi_auditU(acall, BOS_UnInstallEvent, code, AUD_STR, aname, AUD_END); return code; } #endif @@ -205,7 +225,8 @@ register char *aname; { return BZNOENT; } - if (DoLogging) bozo_Log("%s is executing UnInstall '%s'\n", caller, filepath); + if (DoLogging) + bozo_Log("%s is executing UnInstall '%s'\n", caller, filepath); strcpy(fpBak, filepath); strcat(fpBak, ".BAK"); @@ -216,7 +237,7 @@ register char *aname; { if (code) { /* can't find .BAK, try .OLD */ code = renamefile(fpOld, filepath); - if (code && errno == ENOENT) /* If doesn't exist don't fail */ + if (code && errno == ENOENT) /* If doesn't exist don't fail */ code = 0; } else { /* now rename .OLD to .BAK */ @@ -226,21 +247,22 @@ register char *aname; { if (code) code = errno; - osi_auditU (acall, BOS_UnInstallEvent, code, AUD_STR, filepath, AUD_END); + osi_auditU(acall, BOS_UnInstallEvent, code, AUD_STR, filepath, AUD_END); free(filepath); return code; } -#define BOZO_OLDTIME (7*24*3600) /* 7 days old */ -static void SaveOldFiles(char *aname) +#define BOZO_OLDTIME (7*24*3600) /* 7 days old */ +static void +SaveOldFiles(char *aname) { register afs_int32 code; char bbuffer[AFSDIR_PATH_MAX], obuffer[AFSDIR_PATH_MAX]; struct stat tstat; register afs_int32 now; afs_int32 oldTime, bakTime; - + strcpy(bbuffer, aname); strcat(bbuffer, ".BAK"); strcpy(obuffer, aname); @@ -248,31 +270,38 @@ static void SaveOldFiles(char *aname) now = FT_ApproxTime(); code = stat(aname, &tstat); - if (code < 0) return; /* can't stat file */ - - code = stat(obuffer, &tstat); /* discover old file's time */ - if (code) oldTime = 0; - else oldTime = tstat.st_mtime; + if (code < 0) + return; /* can't stat file */ - code = stat(bbuffer, &tstat); /* discover back file's time */ - if (code) bakTime = 0; - else bakTime = tstat.st_mtime; + code = stat(obuffer, &tstat); /* discover old file's time */ + if (code) + oldTime = 0; + else + oldTime = tstat.st_mtime; + + code = stat(bbuffer, &tstat); /* discover back file's time */ + if (code) + bakTime = 0; + else + bakTime = tstat.st_mtime; if (bakTime && (oldTime == 0 || bakTime < now - BOZO_OLDTIME)) { /* no .OLD file, or .BAK is at least a week old */ code = renamefile(bbuffer, obuffer); } - + /* finally rename to .BAK extension */ renamefile(aname, bbuffer); } -BOZO_Install(acall, aname, asize, mode, amtime) -struct rx_call *acall; -char *aname; -afs_int32 asize; -afs_int32 amtime; -afs_int32 mode; { +afs_int32 +SBOZO_Install(acall, aname, asize, mode, amtime) + struct rx_call *acall; + char *aname; + afs_int32 asize; + afs_int32 amtime; + afs_int32 mode; +{ afs_int32 code; int fd; afs_int32 len; @@ -285,9 +314,11 @@ afs_int32 mode; { char filepath[AFSDIR_PATH_MAX], tbuffer[AFSDIR_PATH_MAX], *fpp; char caller[MAXKTCNAMELEN]; - if (!afsconf_SuperUser(bozo_confdir, acall, caller)) return BZACCESS; + if (!afsconf_SuperUser(bozo_confdir, acall, caller)) + return BZACCESS; #ifdef BOS_RESTRICTED_MODE - if (bozo_isrestricted) return BZACCESS; + if (bozo_isrestricted) + return BZACCESS; #endif /* construct local path from canonical (wire-format) path */ @@ -297,39 +328,42 @@ afs_int32 mode; { strcpy(filepath, fpp); free(fpp); - if (DoLogging) bozo_Log("%s is executing Install '%s'\n", caller, filepath); + if (DoLogging) + bozo_Log("%s is executing Install '%s'\n", caller, filepath); /* open file */ fpp = filepath + strlen(filepath); - strcpy(fpp, ".NEW"); /* append ".NEW" to end of filepath */ + strcpy(fpp, ".NEW"); /* append ".NEW" to end of filepath */ fd = open(filepath, O_CREAT | O_RDWR | O_TRUNC, 0777); - if (fd < 0) return errno; + if (fd < 0) + return errno; total = 0; - while(1) { + while (1) { len = rx_Read(acall, tbuffer, sizeof(tbuffer)); if (len < 0) { close(fd); unlink(filepath); return 102; } - if (len == 0) break; /* no more input */ + if (len == 0) + break; /* no more input */ code = write(fd, tbuffer, len); if (code != len) { close(fd); unlink(filepath); return 100; } - total += len; /* track total written for safety check at end */ + total += len; /* track total written for safety check at end */ } close(fd); - if (asize != total) { + if (asize != total) { unlink(filepath); - return 101; /* wrong size */ + return 101; /* wrong size */ } /* save old files */ - *fpp = '\0'; /* remove ".NEW" from end of filepath */ - SaveOldFiles(filepath); /* don't care if it works, still install */ + *fpp = '\0'; /* remove ".NEW" from end of filepath */ + SaveOldFiles(filepath); /* don't care if it works, still install */ /* all done, rename to final name */ strcpy(tbuffer, filepath); @@ -350,104 +384,120 @@ afs_int32 mode; { chmod(filepath, mode); if (code < 0) { - osi_auditU (acall, BOS_InstallEvent, code, AUD_STR, filepath, AUD_END); - return errno; - } - else return 0; + osi_auditU(acall, BOS_InstallEvent, code, AUD_STR, filepath, AUD_END); + return errno; + } else + return 0; } -BOZO_SetCellName(acall, aname) -struct rx_call *acall; -char *aname; { +afs_int32 +SBOZO_SetCellName(acall, aname) + struct rx_call *acall; + char *aname; +{ struct afsconf_cell tcell; register afs_int32 code; char caller[MAXKTCNAMELEN]; char clones[MAXHOSTSPERCELL]; - + if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } - if (DoLogging) bozo_Log("%s is executing SetCellName '%s'\n", caller, aname); + if (DoLogging) + bozo_Log("%s is executing SetCellName '%s'\n", caller, aname); - code = afsconf_GetExtendedCellInfo(bozo_confdir, (char *) 0, (char *) 0, &tcell, &clones); - if (code) - goto fail; + code = + afsconf_GetExtendedCellInfo(bozo_confdir, NULL, NULL, &tcell, + &clones); + if (code) + goto fail; /* Check that tcell has enough space for the new cellname. */ if (strlen(aname) > sizeof tcell.name - 1) { - bozo_Log("ERROR: SetCellName: cell name '%s' exceeds %ld bytes (cell name not changed)\n", - aname, (long)(sizeof tcell.name - 1)); + bozo_Log + ("ERROR: SetCellName: cell name '%s' exceeds %ld bytes (cell name not changed)\n", + aname, (long)(sizeof tcell.name - 1)); code = BZDOM; goto fail; } strcpy(tcell.name, aname); - code = afsconf_SetExtendedCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell, &clones); + code = + afsconf_SetExtendedCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, + &tcell, &clones); fail: - osi_auditU (acall, BOS_SetCellEvent, code, AUD_STR, aname, AUD_END); + osi_auditU(acall, BOS_SetCellEvent, code, AUD_STR, aname, AUD_END); return code; } -BOZO_GetCellName(acall, aname) -struct rx_call *acall; -char **aname; { +afs_int32 +SBOZO_GetCellName(acall, aname) + struct rx_call *acall; + char **aname; +{ register afs_int32 code; char tname[MAXCELLCHARS]; - + code = afsconf_GetLocalCell(bozo_confdir, tname, sizeof(tname)); if (code) { - /* must set output parameters even if aborting */ - *aname = (char *) malloc(1); - **aname = 0; - } - else { - *aname = (char *) malloc(strlen(tname)+1); - strcpy(*aname, tname); + /* must set output parameters even if aborting */ + *aname = (char *)malloc(1); + **aname = 0; + } else { + *aname = (char *)malloc(strlen(tname) + 1); + strcpy(*aname, tname); } return code; } -BOZO_GetCellHost(acall, awhich, aname) -struct rx_call *acall; -afs_uint32 awhich; -char **aname; { +afs_int32 +SBOZO_GetCellHost(acall, awhich, aname) + struct rx_call *acall; + afs_uint32 awhich; + char **aname; +{ register afs_int32 code; struct afsconf_cell tcell; register char *tp; char clones[MAXHOSTSPERCELL]; - code = afsconf_GetExtendedCellInfo(bozo_confdir, (char *) 0, (char *) 0, &tcell, &clones); - if (code) goto fail; + code = + afsconf_GetExtendedCellInfo(bozo_confdir, NULL, NULL, &tcell, + &clones); + if (code) + goto fail; if (awhich >= tcell.numServers) { code = BZDOM; goto fail; } - + tp = tcell.hostName[awhich]; - *aname = (char *) malloc(strlen(tp)+3); + *aname = (char *)malloc(strlen(tp) + 3); if (clones[awhich]) { strcpy(*aname, "["); strcat(*aname, tp); strcat(*aname, "]"); } else - strcpy(*aname, tp); + strcpy(*aname, tp); goto done; - -fail: - *aname = (char *) malloc(1); /* return fake string */ + + fail: + *aname = (char *)malloc(1); /* return fake string */ **aname = 0; -done: + done: return code; } -BOZO_DeleteCellHost(acall, aname) -struct rx_call *acall; -char *aname; { +afs_int32 +SBOZO_DeleteCellHost(acall, aname) + struct rx_call *acall; + char *aname; +{ register afs_int32 code; struct afsconf_cell tcell; afs_int32 which; @@ -456,18 +506,20 @@ char *aname; { char clones[MAXHOSTSPERCELL]; if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } - if (DoLogging) - bozo_Log("%s is executing DeleteCellHost '%s'\n", caller, aname); + if (DoLogging) + bozo_Log("%s is executing DeleteCellHost '%s'\n", caller, aname); - code = afsconf_GetExtendedCellInfo(bozo_confdir, (char *) 0, (char *) 0, &tcell, &clones); - if (code) - goto fail; + code = + afsconf_GetExtendedCellInfo(bozo_confdir, NULL, NULL, &tcell, + &clones); + if (code) + goto fail; which = -1; - for(i=0;i sizeof tcell.hostAddr/sizeof tcell.hostAddr[0]) { - bozo_Log("ERROR: AddCellHost: attempt to add more than %ld database servers (database server '%s' not added)\n", - (long)(sizeof tcell.hostAddr/sizeof tcell.hostAddr[0]), aname); + if (tcell.numServers > + sizeof tcell.hostAddr / sizeof tcell.hostAddr[0]) { + bozo_Log + ("ERROR: AddCellHost: attempt to add more than %ld database servers (database server '%s' not added)\n", + (long)(sizeof tcell.hostAddr / sizeof tcell.hostAddr[0]), + aname); code = BZDOM; goto fail; } /* Check that tcell has enough space for the new hostname. */ if (strlen(aname) > sizeof tcell.hostName[0] - 1) { - bozo_Log("ERROR: AddCellHost: host name '%s' exceeds %ld bytes (not added)\n", - aname, (long)(sizeof tcell.hostName[0] - 1)); + bozo_Log + ("ERROR: AddCellHost: host name '%s' exceeds %ld bytes (not added)\n", + aname, (long)(sizeof tcell.hostName[0] - 1)); code = BZDOM; goto fail; } @@ -554,19 +616,22 @@ char *aname; { memset(&tcell.hostAddr[which], 0, sizeof(struct sockaddr_in)); strcpy(tcell.hostName[which], n); clones[which] = isClone; - code = afsconf_SetExtendedCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell, &clones); + code = + afsconf_SetExtendedCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, + &tcell, &clones); fail: osi_auditU(acall, BOS_AddHostEvent, code, AUD_STR, aname, AUD_END); return code; } -BOZO_ListKeys(acall, an, akvno, akey, akeyinfo) -struct rx_call *acall; -int an; -afs_int32 *akvno; -struct bozo_keyInfo *akeyinfo; -struct bozo_key *akey; +afs_int32 +SBOZO_ListKeys(acall, an, akvno, akey, akeyinfo) + struct rx_call *acall; + afs_int32 an; + afs_int32 *akvno; + struct bozo_keyInfo *akeyinfo; + struct bozo_key *akey; { struct afsconf_keys tkeys; register afs_int32 code; @@ -576,18 +641,19 @@ struct bozo_key *akey; rxkad_level enc_level = rxkad_clear; if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } - if (DoLogging) bozo_Log("%s is executing ListKeys\n", caller); + if (DoLogging) + bozo_Log("%s is executing ListKeys\n", caller); code = afsconf_GetKeys(bozo_confdir, &tkeys); - if (code) - goto fail; + if (code) + goto fail; if (tkeys.nkeys <= an) { - code = BZDOM; - goto fail; + code = BZDOM; + goto fail; } *akvno = tkeys.key[an].kvno; memset(akeyinfo, 0, sizeof(struct bozo_keyInfo)); @@ -600,242 +666,274 @@ struct bozo_key *akey; if ((noauth) || (enc_level == rxkad_crypt)) { memcpy(akey, tkeys.key[an].key, 8); - } - else memset(akey, 0, 8); + } else + memset(akey, 0, 8); code = stat(AFSDIR_SERVER_KEY_FILEPATH, &tstat); if (code == 0) { akeyinfo->mod_sec = tstat.st_mtime; } - ka_KeyCheckSum (tkeys.key[an].key, &akeyinfo->keyCheckSum); + ka_KeyCheckSum(tkeys.key[an].key, &akeyinfo->keyCheckSum); /* only errors is bad key parity */ -fail: + fail: if (noauth) - osi_auditU(acall, BOS_UnAuthListKeysEvent, code, AUD_END); + osi_auditU(acall, BOS_UnAuthListKeysEvent, code, AUD_END); osi_auditU(acall, BOS_ListKeysEvent, code, AUD_END); return code; } -BOZO_AddKey(acall, an, akey) -struct rx_call *acall; -afs_int32 an; -struct bozo_key *akey; { +afs_int32 +SBOZO_AddKey(acall, an, akey) + struct rx_call *acall; + afs_int32 an; + struct bozo_key *akey; +{ register afs_int32 code; char caller[MAXKTCNAMELEN]; rxkad_level enc_level = rxkad_clear; int noauth; if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } noauth = afsconf_GetNoAuthFlag(bozo_confdir); rxkad_GetServerInfo(acall->conn, &enc_level, 0, 0, 0, 0, 0); if ((!noauth) && (enc_level != rxkad_crypt)) { - code = BZENCREQ; - goto fail; + code = BZENCREQ; + goto fail; } - if (DoLogging) bozo_Log("%s is executing AddKey\n", caller); + if (DoLogging) + bozo_Log("%s is executing AddKey\n", caller); code = afsconf_AddKey(bozo_confdir, an, akey, 0); - if (code == AFSCONF_KEYINUSE) + if (code == AFSCONF_KEYINUSE) code = BZKEYINUSE; /* Unique code for afs rpc calls */ -fail: + fail: osi_auditU(acall, BOS_AddKeyEvent, code, AUD_END); return code; } -BOZO_SetNoAuthFlag(acall, aflag) -register struct rx_call *acall; -afs_int32 aflag; { - register afs_int32 code = 0; +afs_int32 +SBOZO_SetNoAuthFlag(acall, aflag) + register struct rx_call *acall; + afs_int32 aflag; +{ + register afs_int32 code = 0; char caller[MAXKTCNAMELEN]; if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } - if (DoLogging) bozo_Log("%s is executing Set No Authentication\n", caller); + if (DoLogging) + bozo_Log("%s is executing Set No Authentication\n", caller); afsconf_SetNoAuthFlag(bozo_confdir, aflag); -fail: + fail: osi_auditU(acall, BOS_SetNoAuthEvent, code, AUD_LONG, aflag, AUD_END); return code; } -BOZO_DeleteKey(acall, an) -struct rx_call *acall; -afs_int32 an; { +afs_int32 +SBOZO_DeleteKey(acall, an) + struct rx_call *acall; + afs_int32 an; +{ register afs_int32 code; char caller[MAXKTCNAMELEN]; if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } - if (DoLogging) bozo_Log("%s is executing DeleteKey\n", caller); + if (DoLogging) + bozo_Log("%s is executing DeleteKey\n", caller); code = afsconf_DeleteKey(bozo_confdir, an); -fail: + fail: osi_auditU(acall, BOS_DeleteKeyEvent, code, AUD_END); return code; } -BOZO_ListSUsers(acall, an, aname) -struct rx_call *acall; -afs_int32 an; -register char **aname; { +afs_int32 +SBOZO_ListSUsers(acall, an, aname) + struct rx_call *acall; + afs_int32 an; + register char **aname; +{ register afs_int32 code; register char *tp; - tp = *aname = (char *) malloc(256); - *tp = 0; /* in case getnthuser doesn't null-terminate the string */ + tp = *aname = (char *)malloc(256); + *tp = 0; /* in case getnthuser doesn't null-terminate the string */ code = afsconf_GetNthUser(bozo_confdir, an, tp, 256); -fail: + /* fail: */ osi_auditU(acall, BOS_ListSUserEvent, code, AUD_END); return code; } -BOZO_AddSUser(acall, aname) -struct rx_call *acall; -char *aname; { +afs_int32 +SBOZO_AddSUser(acall, aname) + struct rx_call *acall; + char *aname; +{ register afs_int32 code; char caller[MAXKTCNAMELEN]; if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } - if (DoLogging) - bozo_Log("%s is executing Add SuperUser '%s'\n", caller, aname); + if (DoLogging) + bozo_Log("%s is executing Add SuperUser '%s'\n", caller, aname); code = afsconf_AddUser(bozo_confdir, aname); -fail: + fail: osi_auditU(acall, BOS_AddSUserEvent, code, AUD_END); return code; } -BOZO_DeleteSUser(acall, aname) -struct rx_call *acall; -char *aname; { +afs_int32 +SBOZO_DeleteSUser(acall, aname) + struct rx_call *acall; + char *aname; +{ register afs_int32 code; char caller[MAXKTCNAMELEN]; if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } - if (DoLogging) - bozo_Log("%s is executing Delete SuperUser '%s'\n", caller, aname); + if (DoLogging) + bozo_Log("%s is executing Delete SuperUser '%s'\n", caller, aname); code = afsconf_DeleteUser(bozo_confdir, aname); -fail: + fail: osi_auditU(acall, BOS_DeleteSUserEvent, code, AUD_END); return code; } -BOZO_CreateBnode(acall, atype, ainstance, ap1, ap2, ap3, ap4, ap5, notifier) -struct rx_call *acall; -char *atype; -char *ainstance; -char *ap1, *ap2, *ap3, *ap4, *ap5; -char *notifier; { +afs_int32 +SBOZO_CreateBnode(acall, atype, ainstance, ap1, ap2, ap3, ap4, ap5, notifier) + struct rx_call *acall; + char *atype; + char *ainstance; + char *ap1, *ap2, *ap3, *ap4, *ap5; + char *notifier; +{ struct bnode *tb; afs_int32 code; char caller[MAXKTCNAMELEN]; if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } #ifdef BOS_RESTRICTED_MODE if (bozo_isrestricted) { - if (strcmp(atype, "cron") || strcmp(ainstance, "salvage-tmp") || - strcmp(ap2, "now") || - strncmp(ap1, AFSDIR_CANONICAL_SERVER_SALVAGER_FILEPATH, - strlen(AFSDIR_CANONICAL_SERVER_SALVAGER_FILEPATH))) { - code = BZACCESS; - goto fail; - } + if (strcmp(atype, "cron") || strcmp(ainstance, "salvage-tmp") + || strcmp(ap2, "now") + || strncmp(ap1, AFSDIR_CANONICAL_SERVER_SALVAGER_FILEPATH, + strlen(AFSDIR_CANONICAL_SERVER_SALVAGER_FILEPATH))) { + code = BZACCESS; + goto fail; + } } #endif - code = bnode_Create(atype, ainstance, &tb, ap1, ap2, ap3, ap4, ap5, notifier,BSTAT_NORMAL); + code = + bnode_Create(atype, ainstance, &tb, ap1, ap2, ap3, ap4, ap5, notifier, + BSTAT_NORMAL); if (!code) - bnode_SetStat(tb, BSTAT_NORMAL); + bnode_SetStat(tb, BSTAT_NORMAL); fail: osi_auditU(acall, BOS_CreateBnodeEvent, code, AUD_END); return code; } -BOZO_WaitAll(acall) -register struct rx_call *acall; { +afs_int32 +SBOZO_WaitAll(acall) + register struct rx_call *acall; +{ register afs_int32 code; char caller[MAXKTCNAMELEN]; if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } - if (DoLogging) bozo_Log("%s is executing Wait for All\n", caller); + if (DoLogging) + bozo_Log("%s is executing Wait for All\n", caller); code = bnode_WaitAll(); -fail: + fail: osi_auditU(acall, BOS_WaitAllEvent, code, AUD_END); return code; } -BOZO_DeleteBnode(acall, ainstance) -struct rx_call *acall; -char *ainstance; { +afs_int32 +SBOZO_DeleteBnode(acall, ainstance) + struct rx_call *acall; + char *ainstance; +{ register afs_int32 code; char caller[MAXKTCNAMELEN]; if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } #ifdef BOS_RESTRICTED_MODE if (bozo_isrestricted) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } #endif - if (DoLogging) bozo_Log("%s is executing DeleteBnode '%s'\n", caller, ainstance); + if (DoLogging) + bozo_Log("%s is executing DeleteBnode '%s'\n", caller, ainstance); code = bnode_DeleteName(ainstance); -fail: - osi_auditU(acall, BOS_DeleteBnodeEvent, code, AUD_STR, ainstance, AUD_END); + fail: + osi_auditU(acall, BOS_DeleteBnodeEvent, code, AUD_STR, ainstance, + AUD_END); return code; } -static swproc(abnode, arock) -register struct bnode *abnode; -char *arock; { - if (abnode->goal == BSTAT_NORMAL) return 0; /* this one's not shutting down */ +static +swproc(abnode, arock) + register struct bnode *abnode; + char *arock; +{ + if (abnode->goal == BSTAT_NORMAL) + return 0; /* this one's not shutting down */ /* otherwise, we are shutting down */ bnode_Hold(abnode); bnode_WaitStatus(abnode, BSTAT_SHUTDOWN); bnode_Release(abnode); - return 0; /* don't stop apply function early, no matter what */ + return 0; /* don't stop apply function early, no matter what */ } -static stproc(abnode, arock) -struct bnode *abnode; -char *arock; { - if (abnode->fileGoal == BSTAT_SHUTDOWN) return 0; /* don't do these guys */ +static +stproc(abnode, arock) + struct bnode *abnode; + char *arock; +{ + if (abnode->fileGoal == BSTAT_SHUTDOWN) + return 0; /* don't do these guys */ bnode_Hold(abnode); bnode_SetStat(abnode, BSTAT_NORMAL); @@ -843,9 +941,11 @@ char *arock; { return 0; } -static sdproc(abnode, arock) -struct bnode *abnode; -char *arock; { +static +sdproc(abnode, arock) + struct bnode *abnode; + char *arock; +{ bnode_Hold(abnode); bnode_SetStat(abnode, BSTAT_SHUTDOWN); bnode_Release(abnode); @@ -853,202 +953,236 @@ char *arock; { } /* shutdown and leave down */ -BOZO_ShutdownAll(acall) -struct rx_call *acall; { +afs_int32 +SBOZO_ShutdownAll(acall) + struct rx_call *acall; +{ /* iterate over all bnodes, setting the status to temporarily disabled */ register afs_int32 code; char caller[MAXKTCNAMELEN]; - + /* check for authorization */ if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } - if (DoLogging) bozo_Log("%s is executing ShutdownAll\n", caller); + if (DoLogging) + bozo_Log("%s is executing ShutdownAll\n", caller); - code = bnode_ApplyInstance(sdproc, (char *) 0); + code = bnode_ApplyInstance(sdproc, NULL); fail: - osi_auditU (acall, BOS_ShutdownAllEvent, code, AUD_END); + osi_auditU(acall, BOS_ShutdownAllEvent, code, AUD_END); return code; } /* shutdown and restart */ -BOZO_RestartAll(acall) -struct rx_call *acall; { +afs_int32 +SBOZO_RestartAll(acall) + struct rx_call *acall; +{ register afs_int32 code; char caller[MAXKTCNAMELEN]; - - if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + + if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { + code = BZACCESS; + goto fail; } - if (DoLogging) bozo_Log("%s is executing RestartAll\n", caller); + if (DoLogging) + bozo_Log("%s is executing RestartAll\n", caller); /* start shutdown of all processes */ - code = bnode_ApplyInstance(sdproc, (char *) 0); - if (code) goto fail; + code = bnode_ApplyInstance(sdproc, NULL); + if (code) + goto fail; /* wait for all done */ - code = bnode_ApplyInstance(swproc, (char *) 0); - if (code) goto fail; + code = bnode_ApplyInstance(swproc, NULL); + if (code) + goto fail; /* start them up again */ - code = bnode_ApplyInstance(stproc, (char *) 0); + code = bnode_ApplyInstance(stproc, NULL); fail: - osi_auditU (acall, BOS_RestartAllEvent, code, AUD_END); + osi_auditU(acall, BOS_RestartAllEvent, code, AUD_END); return code; } -BOZO_ReBozo(acall) -register struct rx_call *acall; { +afs_int32 +SBOZO_ReBozo(acall) + register struct rx_call *acall; +{ register afs_int32 code; char caller[MAXKTCNAMELEN]; /* acall is null if called internally to restart bosserver */ - if (acall && !afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + if (acall && !afsconf_SuperUser(bozo_confdir, acall, caller)) { + code = BZACCESS; + goto fail; } - if (DoLogging) bozo_Log("%s is executing ReBozo\n", caller); + if (DoLogging) + bozo_Log("%s is executing ReBozo\n", caller); /* start shutdown of all processes */ - code = bnode_ApplyInstance(sdproc, (char *) 0); - if (code) goto fail; + code = bnode_ApplyInstance(sdproc, NULL); + if (code) + goto fail; /* wait for all done */ - code = bnode_ApplyInstance(swproc, (char *) 0); - if (code) goto fail; + code = bnode_ApplyInstance(swproc, NULL); + if (code) + goto fail; - if (acall) osi_auditU (acall, BOS_RebozoEvent, code, AUD_END); - else osi_audit (BOS_RebozoIntEvent, code, AUD_END); + if (acall) + osi_auditU(acall, BOS_RebozoEvent, code, AUD_END); + else + osi_audit(BOS_RebozoIntEvent, code, AUD_END); - if (acall) rx_EndCall(acall, 0); /* try to get it done */ + if (acall) + rx_EndCall(acall, 0); /* try to get it done */ rx_Finalize(); - bozo_ReBozo(); /* this reexecs us, and doesn't return, of course */ + bozo_ReBozo(); /* this reexecs us, and doesn't return, of course */ -fail: + fail: /* Differentiate between external and internal ReBozo; prevents AFS_Aud_NoCall event */ - if (acall) osi_auditU (acall, BOS_RebozoEvent, code, AUD_END); - else osi_audit (BOS_RebozoIntEvent, code, AUD_END); - return code; /* should only get here in unusual circumstances */ + if (acall) + osi_auditU(acall, BOS_RebozoEvent, code, AUD_END); + else + osi_audit(BOS_RebozoIntEvent, code, AUD_END); + return code; /* should only get here in unusual circumstances */ } /* make sure all are running */ -BOZO_StartupAll(acall) -struct rx_call *acall; { +afs_int32 +SBOZO_StartupAll(acall) + struct rx_call *acall; +{ register afs_int32 code; char caller[MAXKTCNAMELEN]; - if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { + code = BZACCESS; + goto fail; } - if (DoLogging) bozo_Log("%s is executing StartupAll\n", caller); - code = bnode_ApplyInstance(stproc, (char *) 0); + if (DoLogging) + bozo_Log("%s is executing StartupAll\n", caller); + code = bnode_ApplyInstance(stproc, NULL); -fail: - osi_auditU (acall, BOS_StartupAllEvent, code, AUD_END); + fail: + osi_auditU(acall, BOS_StartupAllEvent, code, AUD_END); return code; } -BOZO_Restart(acall, ainstance) -struct rx_call *acall; -register char *ainstance; { +afs_int32 +SBOZO_Restart(acall, ainstance) + struct rx_call *acall; + register char *ainstance; +{ register struct bnode *tb; register afs_int32 code; char caller[MAXKTCNAMELEN]; - - if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + + if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { + code = BZACCESS; + goto fail; } - if (DoLogging) bozo_Log("%s is executing Restart '%s'\n", caller, ainstance); + if (DoLogging) + bozo_Log("%s is executing Restart '%s'\n", caller, ainstance); tb = bnode_FindInstance(ainstance); if (!tb) { - code = BZNOENT; - goto fail; + code = BZNOENT; + goto fail; } - + /* setup return code */ code = 0; bnode_Hold(tb); bnode_SetStat(tb, BSTAT_SHUTDOWN); - code = bnode_WaitStatus(tb, BSTAT_SHUTDOWN); /* this can fail */ + code = bnode_WaitStatus(tb, BSTAT_SHUTDOWN); /* this can fail */ bnode_SetStat(tb, BSTAT_NORMAL); bnode_Release(tb); -fail: - osi_auditU (acall, BOS_RestartEvent, code, AUD_STR, ainstance, AUD_END); + fail: + osi_auditU(acall, BOS_RestartEvent, code, AUD_STR, ainstance, AUD_END); return code; } /* set temp status */ -BOZO_SetTStatus(acall, ainstance, astatus) -struct rx_call *acall; -char *ainstance; -afs_int32 astatus; { +afs_int32 +SBOZO_SetTStatus(acall, ainstance, astatus) + struct rx_call *acall; + char *ainstance; + afs_int32 astatus; +{ register struct bnode *tb; register afs_int32 code; char caller[MAXKTCNAMELEN]; - if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { + code = BZACCESS; + goto fail; } - if (DoLogging) bozo_Log("%s is executing SetTempStatus '%s'\n", caller, ainstance); + if (DoLogging) + bozo_Log("%s is executing SetTempStatus '%s'\n", caller, ainstance); tb = bnode_FindInstance(ainstance); if (!tb) { - code = BZNOENT; - goto fail; + code = BZNOENT; + goto fail; } bnode_Hold(tb); code = bnode_SetStat(tb, astatus); bnode_Release(tb); -fail: - osi_auditU (acall, BOS_SetTempStatusEvent, code, AUD_STR, ainstance, AUD_END); + fail: + osi_auditU(acall, BOS_SetTempStatusEvent, code, AUD_STR, ainstance, + AUD_END); return code; } -BOZO_SetStatus(acall, ainstance, astatus) -struct rx_call *acall; -char *ainstance; -afs_int32 astatus; { +afs_int32 +SBOZO_SetStatus(acall, ainstance, astatus) + struct rx_call *acall; + char *ainstance; + afs_int32 astatus; +{ register struct bnode *tb; register afs_int32 code; char caller[MAXKTCNAMELEN]; - if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { + code = BZACCESS; + goto fail; } - if (DoLogging) bozo_Log("%s is executing SetStatus '%s' (status = %d)\n", caller, ainstance, astatus); + if (DoLogging) + bozo_Log("%s is executing SetStatus '%s' (status = %d)\n", caller, + ainstance, astatus); tb = bnode_FindInstance(ainstance); if (!tb) { - code = BZNOENT; - goto fail; + code = BZNOENT; + goto fail; } bnode_Hold(tb); bnode_SetFileGoal(tb, astatus); code = bnode_SetStat(tb, astatus); bnode_Release(tb); -fail: - osi_auditU (acall, BOS_SetStatusEvent, code, AUD_STR, ainstance, AUD_END); + fail: + osi_auditU(acall, BOS_SetStatusEvent, code, AUD_STR, ainstance, AUD_END); return code; } -BOZO_GetStatus(acall, ainstance, astat, astatDescr) -struct rx_call *acall; -char *ainstance; -afs_int32 *astat; -char **astatDescr; { +afs_int32 +SBOZO_GetStatus(acall, ainstance, astat, astatDescr) + struct rx_call *acall; + char *ainstance; + afs_int32 *astat; + char **astatDescr; +{ register struct bnode *tb; register afs_int32 code; @@ -1057,22 +1191,23 @@ char **astatDescr; { code = BZNOENT; goto fail; } - + bnode_Hold(tb); code = bnode_GetStat(tb, astat); if (code) { bnode_Release(tb); goto fail; } - - *astatDescr = (char *) malloc(BOZO_BSSIZE); + + *astatDescr = (char *)malloc(BOZO_BSSIZE); code = bnode_GetString(tb, *astatDescr, BOZO_BSSIZE); bnode_Release(tb); - if (code) (*astatDescr)[0] = 0; /* null string means no further info */ + if (code) + (*astatDescr)[0] = 0; /* null string means no further info */ return 0; -fail: - *astatDescr = (char *) malloc(1); + fail: + *astatDescr = (char *)malloc(1); **astatDescr = 0; return code; } @@ -1082,23 +1217,26 @@ struct eidata { int counter; }; -static eifunc(abnode, arock) -struct bnode *abnode; -struct eidata *arock; { +static +eifunc(abnode, arock) + struct bnode *abnode; + struct eidata *arock; +{ if (arock->counter-- == 0) { /* done */ strcpy(arock->iname, abnode->name); return 1; - } - else { + } else { /* not there yet */ return 0; } } -static ZapFile(adir, aname) -register char *adir; -register char *aname; { +static +ZapFile(adir, aname) + register char *adir; + register char *aname; +{ char tbuffer[256]; strcpy(tbuffer, adir); strcat(tbuffer, "/"); @@ -1106,38 +1244,41 @@ register char *aname; { return unlink(tbuffer); } -BOZO_Prune(acall, aflags) -struct rx_call *acall; -afs_int32 aflags; { +afs_int32 +SBOZO_Prune(acall, aflags) + struct rx_call *acall; + afs_int32 aflags; +{ register afs_int32 code; DIR *dirp; register struct dirent *tde; register int i; char caller[MAXKTCNAMELEN]; - if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { + code = BZACCESS; + goto fail; } #ifdef BOS_RESTRICTED_MODE if (bozo_isrestricted) { - code = BZACCESS; - goto fail; + code = BZACCESS; + goto fail; } #endif - if (DoLogging) bozo_Log("%s is executing Prune (flags=%d)\n", caller, aflags); + if (DoLogging) + bozo_Log("%s is executing Prune (flags=%d)\n", caller, aflags); /* first scan AFS binary directory */ dirp = opendir(AFSDIR_SERVER_BIN_DIRPATH); if (dirp) { - for(tde=readdir(dirp);tde;tde=readdir(dirp)) { + for (tde = readdir(dirp); tde; tde = readdir(dirp)) { i = strlen(tde->d_name); if (aflags & BOZO_PRUNEOLD) { - if(i >= 4 && strncmp(tde->d_name+i-4, ".OLD", 4)==0) + if (i >= 4 && strncmp(tde->d_name + i - 4, ".OLD", 4) == 0) ZapFile(AFSDIR_SERVER_BIN_DIRPATH, tde->d_name); } if (aflags & BOZO_PRUNEBAK) { - if(i >= 4 && strncmp(tde->d_name+i-4, ".BAK", 4)==0) + if (i >= 4 && strncmp(tde->d_name + i - 4, ".BAK", 4) == 0) ZapFile(AFSDIR_SERVER_BIN_DIRPATH, tde->d_name); } } @@ -1147,9 +1288,9 @@ afs_int32 aflags; { /* then scan AFS log directory */ dirp = opendir(AFSDIR_SERVER_LOGS_DIRPATH); if (dirp) { - for(tde=readdir(dirp);tde;tde=readdir(dirp)) { + for (tde = readdir(dirp); tde; tde = readdir(dirp)) { if (aflags & BOZO_PRUNECORE) { - if(strncmp(tde->d_name, AFSDIR_CORE_FILE, 4)==0) + if (strncmp(tde->d_name, AFSDIR_CORE_FILE, 4) == 0) ZapFile(AFSDIR_SERVER_LOGS_DIRPATH, tde->d_name); } } @@ -1158,35 +1299,40 @@ afs_int32 aflags; { code = 0; fail: - osi_auditU ( acall, BOS_PruneLogs, code, AUD_END); + osi_auditU(acall, BOS_PruneLogs, code, AUD_END); return code; } -BOZO_EnumerateInstance(acall, anum, ainstance) -struct rx_call *acall; -afs_int32 anum; -char **ainstance; { +afs_int32 +SBOZO_EnumerateInstance(acall, anum, ainstance) + struct rx_call *acall; + afs_int32 anum; + char **ainstance; +{ struct eidata tdata; - *ainstance = (char *) malloc(BOZO_BSSIZE); + *ainstance = (char *)malloc(BOZO_BSSIZE); **ainstance = 0; tdata.counter = anum; tdata.iname = *ainstance; bnode_ApplyInstance(eifunc, &tdata); - if (tdata.counter >= 0) return BZDOM; /* anum > # of actual instances */ - else return 0; + if (tdata.counter >= 0) + return BZDOM; /* anum > # of actual instances */ + else + return 0; } struct bozo_bosEntryStats bozo_bosEntryStats[] = { - {NULL, 1,1, 0755, 02}, /* AFSDIR_SERVER_AFS_DIRPATH */ - {NULL, 1,1, 0755, 02}, /* AFSDIR_SERVER_ETC_DIRPATH */ - {NULL, 1,1, 0755, 02}, /* AFSDIR_SERVER_BIN_DIRPATH */ - {NULL, 1,1, 0755, 02}, /* AFSDIR_SERVER_LOGS_DIRPATH */ - {NULL, 1,0, 0700, 07}, /* AFSDIR_SERVER_BACKUP_DIRPATH */ - {NULL, 1,1, 0700, 07}, /* AFSDIR_SERVER_DB_DIRPATH */ - {NULL, 1,1, 0700, 07}, /* AFSDIR_SERVER_LOCAL_DIRPATH */ - {NULL, 0,1, 0600, 07}, /* AFSDIR_SERVER_KEY_FILEPATH */ - {NULL, 0,1, 0600, 03}};/* AFSDIR_SERVER_ULIST_FILEPATH */ + {NULL, 1, 1, 0755, 02}, /* AFSDIR_SERVER_AFS_DIRPATH */ + {NULL, 1, 1, 0755, 02}, /* AFSDIR_SERVER_ETC_DIRPATH */ + {NULL, 1, 1, 0755, 02}, /* AFSDIR_SERVER_BIN_DIRPATH */ + {NULL, 1, 1, 0755, 02}, /* AFSDIR_SERVER_LOGS_DIRPATH */ + {NULL, 1, 0, 0700, 07}, /* AFSDIR_SERVER_BACKUP_DIRPATH */ + {NULL, 1, 1, 0700, 07}, /* AFSDIR_SERVER_DB_DIRPATH */ + {NULL, 1, 1, 0700, 07}, /* AFSDIR_SERVER_LOCAL_DIRPATH */ + {NULL, 0, 1, 0600, 07}, /* AFSDIR_SERVER_KEY_FILEPATH */ + {NULL, 0, 1, 0600, 03} +}; /* AFSDIR_SERVER_ULIST_FILEPATH */ int bozo_nbosEntryStats = sizeof(bozo_bosEntryStats) / sizeof(bozo_bosEntryStats[0]); @@ -1197,42 +1343,46 @@ int bozo_nbosEntryStats = * the path names require procedural as opposed to static initialization. * The other fields in the struct are however, statically initialized. */ -int initBosEntryStats() +int +initBosEntryStats() { - bozo_bosEntryStats[0].path = AFSDIR_SERVER_AFS_DIRPATH; - bozo_bosEntryStats[1].path = AFSDIR_SERVER_ETC_DIRPATH; - bozo_bosEntryStats[2].path = AFSDIR_SERVER_BIN_DIRPATH; - bozo_bosEntryStats[3].path = AFSDIR_SERVER_LOGS_DIRPATH; - bozo_bosEntryStats[4].path = AFSDIR_SERVER_BACKUP_DIRPATH; - bozo_bosEntryStats[5].path = AFSDIR_SERVER_DB_DIRPATH; - bozo_bosEntryStats[6].path = AFSDIR_SERVER_LOCAL_DIRPATH; - bozo_bosEntryStats[7].path = AFSDIR_SERVER_KEY_FILEPATH; - bozo_bosEntryStats[8].path = AFSDIR_SERVER_ULIST_FILEPATH; - - return 0; + bozo_bosEntryStats[0].path = AFSDIR_SERVER_AFS_DIRPATH; + bozo_bosEntryStats[1].path = AFSDIR_SERVER_ETC_DIRPATH; + bozo_bosEntryStats[2].path = AFSDIR_SERVER_BIN_DIRPATH; + bozo_bosEntryStats[3].path = AFSDIR_SERVER_LOGS_DIRPATH; + bozo_bosEntryStats[4].path = AFSDIR_SERVER_BACKUP_DIRPATH; + bozo_bosEntryStats[5].path = AFSDIR_SERVER_DB_DIRPATH; + bozo_bosEntryStats[6].path = AFSDIR_SERVER_LOCAL_DIRPATH; + bozo_bosEntryStats[7].path = AFSDIR_SERVER_KEY_FILEPATH; + bozo_bosEntryStats[8].path = AFSDIR_SERVER_ULIST_FILEPATH; + + return 0; } + /* StatEachEntry - If it's not there, it is okay. If anything else goes wrong * complain. Otherwise check permissions: shouldn't allow write or (usually) * read. */ -static int StatEachEntry (stats) - IN struct bozo_bosEntryStats *stats; +static int +StatEachEntry(stats) + IN struct bozo_bosEntryStats *stats; { struct stat info; - if (stat (stats->path, &info)) { - if (errno == ENOENT) return 1; /* no such entry: just ignore it */ - return 0; /* something else went wrong */ + if (stat(stats->path, &info)) { + if (errno == ENOENT) + return 1; /* no such entry: just ignore it */ + return 0; /* something else went wrong */ } else { - int rights; + int rights; if (((info.st_mode & S_IFDIR) != 0) != stats->dir) - return 0; /* not expected type */ + return 0; /* not expected type */ if (stats->rootOwner && (info.st_uid != 0)) - return 0; /* not owned by root */ + return 0; /* not owned by root */ rights = (info.st_mode & 0000777); if ((rights & stats->reqPerm) != stats->reqPerm) - return 0; /* required permissions not present */ + return 0; /* required permissions not present */ if ((rights & stats->proPerm) != 0) - return 0; /* prohibited permissions present */ + return 0; /* prohibited permissions present */ } return 1; } @@ -1241,7 +1391,8 @@ static int StatEachEntry (stats) * returns 0 if some are not OK and 1 otherwise. For efficiency, it doesn't do * this check more often than every 5 seconds. */ -int DirAccessOK () +int +DirAccessOK() { #ifdef AFS_NT40_ENV /* underlying filesystem may not support directory protection */ @@ -1253,60 +1404,62 @@ int DirAccessOK () int result; int i; - if ((now-lastTime) < 5) return lastResult; + if ((now - lastTime) < 5) + return lastResult; lastTime = now; result = 1; - for (i=0; ipath, - e->dir ? "dir" : "file", - e->reqPerm, - e->proPerm, + e->path, e->dir ? "dir" : "file", e->reqPerm, + (~e->proPerm & 0777), e->rootOwner ? ", owned by root" : ""); result = 0; break; } } - if (result != lastResult) { /* log changes */ - bozo_Log ("Server directory access is %sokay\n", - (result ? "" : "not ")); + if (result != lastResult) { /* log changes */ + bozo_Log("Server directory access is %sokay\n", + (result ? "" : "not ")); } lastResult = result; return lastResult; #endif /* AFS_NT40_ENV */ } -int GetRequiredDirPerm (path) - IN char *path; +int +GetRequiredDirPerm(path) + IN char *path; { int i; - for (i=0; itype) strcpy(*atype, tb->type->name); else - (*atype)[0] = 0; /* null string */ + (*atype)[0] = 0; /* null string */ memset(astatus, 0, sizeof(struct bozo_status)); /* good defaults */ astatus->goal = tb->goal; astatus->fileGoal = tb->fileGoal; @@ -1325,24 +1478,27 @@ BOZO_GetInstanceInfo(acall, ainstance, atype, astatus) return 0; } -BOZO_GetInstanceParm(acall, ainstance, anum, aparm) -struct rx_call *acall; -char *ainstance; -afs_int32 anum; -char **aparm; { +afs_int32 +SBOZO_GetInstanceParm(acall, ainstance, anum, aparm) + struct rx_call *acall; + char *ainstance; + afs_int32 anum; + char **aparm; +{ register struct bnode *tb; register char *tp; register afs_int32 code; - - tp = (char *) malloc(BOZO_BSSIZE); + + tp = (char *)malloc(BOZO_BSSIZE); *aparm = tp; - *tp = 0; /* null-terminate string in error case */ + *tp = 0; /* null-terminate string in error case */ tb = bnode_FindInstance(ainstance); - if (!tb) return BZNOENT; + if (!tb) + return BZNOENT; bnode_Hold(tb); if (anum == 999) { if (tb->notifier) { - memcpy(tp, tb->notifier, strlen(tb->notifier)+1); + memcpy(tp, tb->notifier, strlen(tb->notifier) + 1); code = 0; } else code = BZNOENT; /* XXXXX */ @@ -1354,9 +1510,11 @@ char **aparm; { return code; } -BOZO_GetLog(acall, aname) -register struct rx_call *acall; -char *aname; { +afs_int32 +SBOZO_GetLog(acall, aname) + register struct rx_call *acall; + char *aname; +{ register afs_int32 code; FILE *tfile; int tc; @@ -1367,15 +1525,15 @@ char *aname; { /* Check access since 'aname' could specify a file outside of the * AFS log directory (which is bosserver's working directory). */ - if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - code = BZACCESS; - goto fail; + if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { + code = BZACCESS; + goto fail; } #ifdef BOS_RESTRICTED_MODE - if (bozo_isrestricted && strchr(aname, '/') && - strcmp(aname, AFSDIR_CANONICAL_SERVER_SLVGLOG_FILEPATH)) { - code = BZACCESS; - goto fail; + if (bozo_isrestricted && strchr(aname, '/') + && strcmp(aname, AFSDIR_CANONICAL_SERVER_SLVGLOG_FILEPATH)) { + code = BZACCESS; + goto fail; } #endif @@ -1383,7 +1541,8 @@ char *aname; { if (ConstructLocalLogPath(aname, &logpath)) { return BZNOENT; } - if (DoLogging) bozo_Log("%s is executing GetLog '%s'\n", caller, logpath); + if (DoLogging) + bozo_Log("%s is executing GetLog '%s'\n", caller, logpath); tfile = fopen(logpath, "r"); free(logpath); @@ -1393,8 +1552,10 @@ char *aname; { while (1) { tc = getc(tfile); - if (tc == 0) continue; /* our termination condition on other end */ - if (tc == EOF) break; + if (tc == 0) + continue; /* our termination condition on other end */ + if (tc == EOF) + break; buffer = tc; if (rx_Write(acall, &buffer, 1) != 1) { fclose(tfile); @@ -1408,103 +1569,112 @@ char *aname; { /* write out the end delimeter */ buffer = 0; - if (rx_Write(acall, &buffer, 1) != 1) return BZNET; + if (rx_Write(acall, &buffer, 1) != 1) + return BZNET; code = 0; fail: - osi_auditU( acall, BOS_GetLogsEvent, code, AUD_END); + osi_auditU(acall, BOS_GetLogsEvent, code, AUD_END); return code; } -BOZO_GetInstanceStrings(acall, abnodeName, as1, as2, as3, as4) -struct rx_call *acall; -char *abnodeName; -char **as1, **as2, **as3, **as4; { +afs_int32 +SBOZO_GetInstanceStrings(acall, abnodeName, as1, as2, as3, as4) + struct rx_call *acall; + char *abnodeName; + char **as1, **as2, **as3, **as4; +{ register struct bnode *tb; - *as2 = (char *) malloc(1); + *as2 = (char *)malloc(1); **as2 = 0; - *as3 = (char *) malloc(1); + *as3 = (char *)malloc(1); **as3 = 0; - *as4 = (char *) malloc(1); + *as4 = (char *)malloc(1); **as4 = 0; tb = bnode_FindInstance(abnodeName); - if (!tb) goto fail; + if (!tb) + goto fail; /* now, return the appropriate error string, if any */ if (tb->lastErrorName) { - *as1 = (char *) malloc(strlen(tb->lastErrorName)+1); + *as1 = (char *)malloc(strlen(tb->lastErrorName) + 1); strcpy(*as1, tb->lastErrorName); - } - else { - *as1 = (char *) malloc(1); + } else { + *as1 = (char *)malloc(1); **as1 = 0; } return 0; fail: - *as1 = (char *) malloc(1); + *as1 = (char *)malloc(1); **as1 = 0; return BZNOENT; } #ifdef BOS_RESTRICTED_MODE -BOZO_GetRestrictedMode(acall, arestmode) -struct rx_call *acall; -afs_int32 *arestmode; +afs_int32 +SBOZO_GetRestrictedMode(acall, arestmode) + struct rx_call *acall; + afs_int32 *arestmode; { - *arestmode=bozo_isrestricted; - return 0; + *arestmode = bozo_isrestricted; + return 0; } -BOZO_SetRestrictedMode(acall, arestmode) -struct rx_call *acall; -afs_int32 arestmode; +afs_int32 +SBOZO_SetRestrictedMode(acall, arestmode) + struct rx_call *acall; + afs_int32 arestmode; { - afs_int32 code; - char caller[MAXKTCNAMELEN]; - - if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { - return BZACCESS; - } - if (bozo_isrestricted) { - return BZACCESS; - } - if (arestmode !=0 && arestmode !=1) { - return BZDOM; - } - bozo_isrestricted=arestmode; - code = WriteBozoFile(0); - fail: - return code; + afs_int32 code; + char caller[MAXKTCNAMELEN]; + + if (!afsconf_SuperUser(bozo_confdir, acall, caller)) { + return BZACCESS; + } + if (bozo_isrestricted) { + return BZACCESS; + } + if (arestmode != 0 && arestmode != 1) { + return BZDOM; + } + bozo_isrestricted = arestmode; + code = WriteBozoFile(0); + fail: + return code; } #else -BOZO_GetRestrictedMode(acall, arestmode) -struct rx_call *acall; -afs_int32 *arestmode; +afs_int32 +SBOZO_GetRestrictedMode(acall, arestmode) + struct rx_call *acall; + afs_int32 *arestmode; { - return RXGEN_OPCODE; + return RXGEN_OPCODE; } -BOZO_SetRestrictedMode(acall, arestmode) -struct rx_call *acall; -afs_int32 arestmode; +afs_int32 +SBOZO_SetRestrictedMode(acall, arestmode) + struct rx_call *acall; + afs_int32 arestmode; { - return RXGEN_OPCODE; + return RXGEN_OPCODE; } #endif -void bozo_ShutdownAndExit(int asignal) +void +bozo_ShutdownAndExit(int asignal) { int code; - bozo_Log("Shutdown of BOS server and processes in response to signal %d\n", - asignal); + bozo_Log + ("Shutdown of BOS server and processes in response to signal %d\n", + asignal); /* start shutdown of all processes */ - if ((code = bnode_ApplyInstance(sdproc, (char *) 0)) == 0) { + if ((code = bnode_ApplyInstance(sdproc, NULL)) == 0) { /* wait for shutdown to complete */ - code = bnode_ApplyInstance(swproc, (char *) 0); + code = bnode_ApplyInstance(swproc, NULL); } if (code) { diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index 84920e695..6eedec377 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosserver.c,v 1.1.1.13 2002/09/26 19:04:58 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bozo/bosserver.c,v 1.23 2003/12/07 22:49:18 jaltman Exp $"); #include #include @@ -41,7 +42,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosserver.c,v 1.1.1.13 2002/09/26 #include #include #include -#include /* signal(), kill(), wait(), etc. */ +#include /* signal(), kill(), wait(), etc. */ #if defined(AFS_SGI_ENV) #include #endif @@ -50,7 +51,6 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosserver.c,v 1.1.1.13 2002/09/26 #define BOZO_LWP_STACKSIZE 16000 extern int BOZO_ExecuteRequest(); extern int RXSTATS_ExecuteRequest(); -extern int afsconf_GetKey(); extern struct bnode_ops fsbnode_ops, ezbnode_ops, cronbnode_ops; void bozo_Log(); @@ -60,7 +60,6 @@ static char *bozo_pid; struct rx_securityClass *bozo_rxsc[3]; const char *bozo_fileName; FILE *bozo_logFile; -extern int rx_stackSize; /* for rx_SetStackSize macro */ int DoLogging = 0; int DoSyslog = 0; @@ -73,14 +72,15 @@ static afs_int32 nextDay; struct ktime bozo_nextRestartKT, bozo_nextDayKT; int bozo_newKTs; #ifdef BOS_RESTRICTED_MODE -int bozo_isrestricted=0; -int bozo_restdisable=0; +int bozo_isrestricted = 0; +int bozo_restdisable = 0; -void bozo_insecureme(int sig) +void +bozo_insecureme(int sig) { - signal(SIGFPE, bozo_insecureme); - bozo_isrestricted=0; - bozo_restdisable=1; + signal(SIGFPE, bozo_insecureme); + bozo_isrestricted = 0; + bozo_restdisable = 1; } #endif @@ -89,14 +89,16 @@ struct bztemp { }; /* check whether caller is authorized to manage RX statistics */ -int bozo_rxstat_userok(call) - struct rx_call *call; +int +bozo_rxstat_userok(struct rx_call *call) { - return afsconf_SuperUser(bozo_confdir, call, (char *)0); + return afsconf_SuperUser(bozo_confdir, call, NULL); } /* restart bozo process */ -bozo_ReBozo() { +int +bozo_ReBozo() +{ #ifdef AFS_NT40_ENV /* exit with restart code; SCM integrator process will restart bosserver */ int status = BOSEXIT_RESTART; @@ -128,12 +130,11 @@ bozo_ReBozo() { argv[i] = "-log"; i++; } - #ifndef AFS_NT40_ENV /* if syslog logging is on, pass "-syslog" to new bosserver */ if (DoSyslog) { - char *arg=(char *)malloc(40); /* enough for -syslog=# */ - if ( DoSyslogFacility != LOG_DAEMON ) { + char *arg = (char *)malloc(40); /* enough for -syslog=# */ + if (DoSyslogFacility != LOG_DAEMON) { snprintf(arg, 40, "-syslog=%d", DoSyslogFacility); } else { strcpy(arg, "-syslog"); @@ -151,21 +152,23 @@ bozo_ReBozo() { close(i); } - execv(argv[0], argv); /* should not return */ + execv(argv[0], argv); /* should not return */ _exit(1); #endif /* AFS_NT40_ENV */ } /* make sure a dir exists */ -static MakeDir(adir) -register char *adir; { +static int +MakeDir(register char *adir) +{ struct stat tstat; register afs_int32 code; if (stat(adir, &tstat) < 0 || (tstat.st_mode & S_IFMT) != S_IFDIR) { int reqPerm; unlink(adir); - reqPerm = GetRequiredDirPerm (adir); - if (reqPerm == -1) reqPerm = 0777; + reqPerm = GetRequiredDirPerm(adir); + if (reqPerm == -1) + reqPerm = 0777; #ifdef AFS_NT40_ENV /* underlying filesystem may not support directory protection */ code = mkdir(adir); @@ -178,65 +181,77 @@ register char *adir; { } /* create all the bozo dirs */ -static CreateDirs() { - - if ((!strncmp(AFSDIR_USR_DIRPATH, AFSDIR_CLIENT_ETC_DIRPATH, - strlen(AFSDIR_USR_DIRPATH))) || - (!strncmp(AFSDIR_USR_DIRPATH, AFSDIR_SERVER_BIN_DIRPATH, - strlen(AFSDIR_USR_DIRPATH)))) { - MakeDir(AFSDIR_USR_DIRPATH); - } - if (!strncmp(AFSDIR_SERVER_AFS_DIRPATH, AFSDIR_SERVER_BIN_DIRPATH, - strlen(AFSDIR_SERVER_AFS_DIRPATH))) { - MakeDir(AFSDIR_SERVER_AFS_DIRPATH); +static int +CreateDirs() +{ + if ((!strncmp + (AFSDIR_USR_DIRPATH, AFSDIR_CLIENT_ETC_DIRPATH, + strlen(AFSDIR_USR_DIRPATH))) + || + (!strncmp + (AFSDIR_USR_DIRPATH, AFSDIR_SERVER_BIN_DIRPATH, + strlen(AFSDIR_USR_DIRPATH)))) { + MakeDir(AFSDIR_USR_DIRPATH); + } + if (!strncmp + (AFSDIR_SERVER_AFS_DIRPATH, AFSDIR_SERVER_BIN_DIRPATH, + strlen(AFSDIR_SERVER_AFS_DIRPATH))) { + MakeDir(AFSDIR_SERVER_AFS_DIRPATH); } MakeDir(AFSDIR_SERVER_BIN_DIRPATH); - MakeDir(AFSDIR_SERVER_ETC_DIRPATH); + MakeDir(AFSDIR_SERVER_ETC_DIRPATH); MakeDir(AFSDIR_SERVER_LOCAL_DIRPATH); - MakeDir(AFSDIR_SERVER_DB_DIRPATH); + MakeDir(AFSDIR_SERVER_DB_DIRPATH); MakeDir(AFSDIR_SERVER_LOGS_DIRPATH); #ifndef AFS_NT40_ENV - if (!strncmp(AFSDIR_CLIENT_VICE_DIRPATH, AFSDIR_CLIENT_ETC_DIRPATH, - strlen(AFSDIR_CLIENT_VICE_DIRPATH))) { - MakeDir(AFSDIR_CLIENT_VICE_DIRPATH); + if (!strncmp + (AFSDIR_CLIENT_VICE_DIRPATH, AFSDIR_CLIENT_ETC_DIRPATH, + strlen(AFSDIR_CLIENT_VICE_DIRPATH))) { + MakeDir(AFSDIR_CLIENT_VICE_DIRPATH); } MakeDir(AFSDIR_CLIENT_ETC_DIRPATH); - symlink(AFSDIR_SERVER_THISCELL_FILEPATH, AFSDIR_CLIENT_THISCELL_FILEPATH); - symlink(AFSDIR_SERVER_CELLSERVDB_FILEPATH, AFSDIR_CLIENT_CELLSERVDB_FILEPATH); + symlink(AFSDIR_SERVER_THISCELL_FILEPATH, AFSDIR_CLIENT_THISCELL_FILEPATH); + symlink(AFSDIR_SERVER_CELLSERVDB_FILEPATH, + AFSDIR_CLIENT_CELLSERVDB_FILEPATH); #endif /* AFS_NT40_ENV */ return 0; } /* strip the \\n from the end of the line, if it is present */ -static StripLine(abuffer) -register char *abuffer; { +static int +StripLine(register char *abuffer) +{ register char *tp; - - tp = abuffer + strlen(abuffer); /* starts off pointing at the null */ - if(tp == abuffer) return 0; /* null string, no last character to check */ - tp--; /* aim at last character */ - if (*tp == '\n') *tp = 0; + + tp = abuffer + strlen(abuffer); /* starts off pointing at the null */ + if (tp == abuffer) + return 0; /* null string, no last character to check */ + tp--; /* aim at last character */ + if (*tp == '\n') + *tp = 0; return 0; } /* write one bnode's worth of entry into the file */ -static bzwrite(abnode, at) -register struct bnode *abnode; -register struct bztemp *at; { +static +bzwrite(register struct bnode *abnode, register struct bztemp *at) +{ register int i; char tbuffer[BOZO_BSSIZE]; register afs_int32 code; if (abnode->notifier) - fprintf(at->file, "bnode %s %s %d %s\n", - abnode->type->name, abnode->name, abnode->fileGoal, abnode->notifier); + fprintf(at->file, "bnode %s %s %d %s\n", abnode->type->name, + abnode->name, abnode->fileGoal, abnode->notifier); else - fprintf(at->file, "bnode %s %s %d\n", abnode->type->name, abnode->name, abnode->fileGoal); - for(i=0;;i++) { + fprintf(at->file, "bnode %s %s %d\n", abnode->type->name, + abnode->name, abnode->fileGoal); + for (i = 0;; i++) { code = bnode_GetParm(abnode, i, tbuffer, BOZO_BSSIZE); if (code) { - if (code != BZDOM) return code; + if (code != BZDOM) + return code; break; } fprintf(at->file, "parm %s\n", tbuffer); @@ -246,8 +261,9 @@ register struct bztemp *at; { } #define MAXPARMS 20 -ReadBozoFile(aname) -char *aname; { +int +ReadBozoFile(char *aname) +{ register FILE *tfile; char tbuffer[BOZO_BSSIZE]; register char *tp; @@ -266,54 +282,60 @@ char *aname; { /* if BozoInit exists and BosConfig doesn't, try a rename */ if (access(AFSDIR_SERVER_BOZINIT_FILEPATH, 0) == 0 && access(AFSDIR_SERVER_BOZCONF_FILEPATH, 0) != 0) { - code = renamefile(AFSDIR_SERVER_BOZINIT_FILEPATH, AFSDIR_SERVER_BOZCONF_FILEPATH); + code = + renamefile(AFSDIR_SERVER_BOZINIT_FILEPATH, + AFSDIR_SERVER_BOZCONF_FILEPATH); if (code < 0) perror("bosconfig rename"); } #ifdef BOS_NEW_CONFIG if (access(AFSDIR_SERVER_BOZCONFNEW_FILEPATH, 0) == 0) { - code = renamefile(AFSDIR_SERVER_BOZCONFNEW_FILEPATH, - AFSDIR_SERVER_BOZCONF_FILEPATH); - if (code < 0) - perror("bosconfig rename"); + code = + renamefile(AFSDIR_SERVER_BOZCONFNEW_FILEPATH, + AFSDIR_SERVER_BOZCONF_FILEPATH); + if (code < 0) + perror("bosconfig rename"); } -#endif +#endif } /* setup default times we want to do restarts */ bozo_nextRestartKT.mask = KTIME_HOUR | KTIME_MIN | KTIME_DAY; - bozo_nextRestartKT.hour = 4; /* 4 am */ + bozo_nextRestartKT.hour = 4; /* 4 am */ bozo_nextRestartKT.min = 0; - bozo_nextRestartKT.day = 0; /* Sunday */ + bozo_nextRestartKT.day = 0; /* Sunday */ bozo_nextDayKT.mask = KTIME_HOUR | KTIME_MIN; bozo_nextDayKT.hour = 5; bozo_nextDayKT.min = 0; - for(code=0;codefileGoal != BSTAT_NORMAL || abnode->goal != BSTAT_NORMAL) - return 0; /* don't restart stopped bnodes */ + return 0; /* don't restart stopped bnodes */ bnode_Hold(abnode); code = bnode_RestartP(abnode); if (code) { @@ -471,14 +504,16 @@ char *arock; { bnode_SetStat(abnode, BSTAT_NORMAL); } bnode_Release(abnode); - return 0; /* keep trying all bnodes */ + return 0; /* keep trying all bnodes */ } -#define BOZO_MINSKIP 3600 /* minimum to advance clock */ +#define BOZO_MINSKIP 3600 /* minimum to advance clock */ /* lwp to handle system restarts */ -static BozoDaemon() { +static int +BozoDaemon() +{ register afs_int32 now; - + /* now initialize the values */ bozo_newKTs = 1; while (1) { @@ -487,8 +522,8 @@ static BozoDaemon() { #ifdef BOS_RESTRICTED_MODE if (bozo_restdisable) { - bozo_Log("Restricted mode disabled by signal\n"); - bozo_restdisable=0; + bozo_Log("Restricted mode disabled by signal\n"); + bozo_restdisable = 0; } #endif if (bozo_newKTs) { /* need to recompute restart times */ @@ -499,13 +534,13 @@ static BozoDaemon() { /* see if we should do a restart */ if (now > nextRestart) { - BOZO_ReBozo(0); /* doesn't come back */ + SBOZO_ReBozo(0); /* doesn't come back */ } - + /* see if we should restart a server */ if (now > nextDay) { nextDay = ktime_next(&bozo_nextDayKT, BOZO_MINSKIP); - + /* call the bnode restartp function, and restart all that require it */ bnode_ApplyInstance(bdrestart, 0); } @@ -513,7 +548,8 @@ static BozoDaemon() { } #ifdef AFS_AIX32_ENV -static tweak_config() +static int +tweak_config() { FILE *f; char c[80]; @@ -524,20 +560,21 @@ static tweak_config() f = popen("/usr/sbin/no -o sb_max", "r"); s = fscanf(f, "sb_max = %d", &sb_max); fclose(f); - if (s < 1) + if (s < 1) return; f = popen("/usr/sbin/no -o ipfragttl", "r"); s = fscanf(f, "ipfragttl = %d", &ipfragttl); fclose(f); - if (s < 1) + if (s < 1) ipfragttl = 20; - if (sb_max < 131072) + if (sb_max < 131072) sb_max = 131072; if (ipfragttl > 20) ipfragttl = 20; - - sprintf(c, "/usr/sbin/no -o sb_max=%d -o ipfragttl=%d", sb_max, ipfragttl); + + sprintf(c, "/usr/sbin/no -o sb_max=%d -o ipfragttl=%d", sb_max, + ipfragttl); f = popen(c, "r"); fclose(f); } @@ -589,18 +626,18 @@ background(void) */ if (getpid() == getpgrp()) { - pid_t pid; - pid = fork(); - switch(pid) { - case -1: - abort(); /* leave footprints */ - break; - case 0: /* child */ - break; - default: /* parent */ - exit(0); - break; - } + pid_t pid; + pid = fork(); + switch (pid) { + case -1: + abort(); /* leave footprints */ + break; + case 0: /* child */ + break; + default: /* parent */ + exit(0); + break; + } } /* @@ -609,12 +646,12 @@ background(void) */ { - pid_t sid = setsid(); + pid_t sid = setsid(); - if (sid == -1) { - static char err[] = "bosserver: WARNING: setsid() failed\n"; - write(STDERR_FILENO, err, sizeof err - 1); - } + if (sid == -1) { + static char err[] = "bosserver: WARNING: setsid() failed\n"; + write(STDERR_FILENO, err, sizeof err - 1); + } } /* @@ -632,18 +669,18 @@ background(void) */ if (getpid() == getpgrp()) { - pid_t pid; - pid = fork(); - switch(pid) { - case -1: - abort(); /* leave footprints */ - break; - case 0: /* child */ - break; - default: /* parent */ - exit(0); - break; - } + pid_t pid; + pid = fork(); + switch (pid) { + case -1: + abort(); /* leave footprints */ + break; + case 0: /* child */ + break; + default: /* parent */ + exit(0); + break; + } } /* @@ -651,15 +688,16 @@ background(void) */ { - int fd; + int fd; - fd = open("/dev/tty", O_RDONLY); + fd = open("/dev/tty", O_RDONLY); - if (fd >= 0) { - static char err[] = "bosserver: WARNING: /dev/tty still attached\n"; - close(fd); - write(STDERR_FILENO, err, sizeof err - 1); - } + if (fd >= 0) { + static char err[] = + "bosserver: WARNING: /dev/tty still attached\n"; + close(fd); + write(STDERR_FILENO, err, sizeof err - 1); + } } } #endif /* ! AFS_NT40_ENV */ @@ -668,11 +706,8 @@ background(void) #include "AFS_component_version_number.c" - -main (argc, argv,envp) -int argc; -char **argv; -char **envp; +int +main(int argc, char **argv, char **envp) { struct rx_service *tservice; register afs_int32 code; @@ -723,7 +758,8 @@ char **envp; #ifdef AFS_NT40_ENV ReportErrorEventAlt(AFSEVT_SVR_NO_INSTALL_DIR, 0, argv[0], 0); #endif - fprintf(stderr, "%s: Unable to obtain AFS server directory.\n", argv[0]); + fprintf(stderr, "%s: Unable to obtain AFS server directory.\n", + argv[0]); exit(2); } @@ -743,37 +779,33 @@ char **envp; #endif /* parse cmd line */ - for(code=1;code=10) { + if (i >= 10) { bozo_Log("Bos giving up, can't initialize rx\n"); exit(code); } code = LWP_CreateProcess(BozoDaemon, BOZO_LWP_STACKSIZE, /* priority */ 1, - /* parm */0, "bozo-the-clown", &bozo_pid); + (void *) /*parm */ 0, "bozo-the-clown", + &bozo_pid); /* try to read the key from the config file */ tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH); @@ -887,21 +919,28 @@ char **envp; exit(1); } memset(tcell.hostAddr, 0, sizeof(tcell.hostAddr)); /* not computed */ - code = afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell); + code = + afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, + &tcell); if (code) { - bozo_Log("could not create cell database in '%s' (code %d), quitting\n", AFSDIR_SERVER_ETC_DIRPATH, code); + bozo_Log + ("could not create cell database in '%s' (code %d), quitting\n", + AFSDIR_SERVER_ETC_DIRPATH, code); exit(1); } tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH); if (!tdir) { - bozo_Log("failed to open newly-created cell database, quitting\n"); + bozo_Log + ("failed to open newly-created cell database, quitting\n"); exit(1); } } /* read init file, starting up programs */ - if (code=ReadBozoFile(0)) { - bozo_Log("bosserver: Something is wrong (%d) with the bos configuration file %s; aborting\n", code, AFSDIR_SERVER_BOZCONF_FILEPATH); + if (code = ReadBozoFile(0)) { + bozo_Log + ("bosserver: Something is wrong (%d) with the bos configuration file %s; aborting\n", + code, AFSDIR_SERVER_BOZCONF_FILEPATH); exit(code); } @@ -916,31 +955,34 @@ char **envp; afsconf_SetNoAuthFlag(tdir, noAuth); - bozo_rxsc[0] = (struct rx_securityClass *) rxnull_NewServerSecurityObject(); - bozo_rxsc[1] = (struct rx_securityClass *) 0; - bozo_rxsc[2] = (struct rx_securityClass *) rxkad_NewServerSecurityObject( - 0, tdir, afsconf_GetKey, (char *) 0); + bozo_rxsc[0] = rxnull_NewServerSecurityObject(); + bozo_rxsc[1] = (struct rx_securityClass *)0; + bozo_rxsc[2] = + rxkad_NewServerSecurityObject(0, tdir, afsconf_GetKey, NULL); /* Disable jumbograms */ rx_SetNoJumbo(); - tservice = rx_NewService(/* port */ 0, /* service id */ 1, - /*service name */ "bozo", /* security classes */ bozo_rxsc, - /* numb sec classes */ 3, BOZO_ExecuteRequest); + tservice = rx_NewService( /* port */ 0, /* service id */ 1, + /*service name */ "bozo", + /* security classes */ + bozo_rxsc, + /* numb sec classes */ 3, BOZO_ExecuteRequest); rx_SetMinProcs(tservice, 2); rx_SetMaxProcs(tservice, 4); - rx_SetStackSize(tservice, BOZO_LWP_STACKSIZE); /* so gethostbyname works (in cell stuff) */ + rx_SetStackSize(tservice, BOZO_LWP_STACKSIZE); /* so gethostbyname works (in cell stuff) */ - tservice = rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", bozo_rxsc, - 3, RXSTATS_ExecuteRequest); + tservice = + rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", bozo_rxsc, 3, + RXSTATS_ExecuteRequest); rx_SetMinProcs(tservice, 2); rx_SetMaxProcs(tservice, 4); - rx_StartServer(1); /* donate this process */ + rx_StartServer(1); /* donate this process */ } void -bozo_Log(a,b,c,d,e,f) -char *a, *b, *c, *d, *e, *f; { +bozo_Log(char *a, char *b, char *c, char *d, char *e, char *f) +{ char tdate[26]; time_t myTime; @@ -955,9 +997,10 @@ char *a, *b, *c, *d, *e, *f; { /* log normally closed, so can be removed */ - bozo_logFile=fopen(AFSDIR_SERVER_BOZLOG_FILEPATH, "a"); - if(bozo_logFile == NULL) { - printf("bosserver: WARNING: problem with %s", AFSDIR_SERVER_BOZLOG_FILEPATH); + bozo_logFile = fopen(AFSDIR_SERVER_BOZLOG_FILEPATH, "a"); + if (bozo_logFile == NULL) { + printf("bosserver: WARNING: problem with %s", + AFSDIR_SERVER_BOZLOG_FILEPATH); fflush(stdout); } @@ -969,7 +1012,7 @@ char *a, *b, *c, *d, *e, *f; { printf("%s ", tdate); printf(a, b, c, d, e, f); } - + /* close so rm BosLog works */ fclose(bozo_logFile); } diff --git a/src/bozo/cronbnodeops.c b/src/bozo/cronbnodeops.c index 7f2e7fcb6..a6877366a 100644 --- a/src/bozo/cronbnodeops.c +++ b/src/bozo/cronbnodeops.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/cronbnodeops.c,v 1.1.1.7 2001/10/14 18:04:06 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bozo/cronbnodeops.c,v 1.10 2003/12/07 22:49:18 jaltman Exp $"); #include #include @@ -21,18 +22,27 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/cronbnodeops.c,v 1.1.1.7 2001/10/1 #ifdef AFS_NT40_ENV #include #endif + +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#include + #include #include -#include /* signal(), kill(), wait(), etc. */ +#include /* signal(), kill(), wait(), etc. */ #include "bnode.h" static int cron_timeout(), cron_getstat(), cron_setstat(), cron_delete(); static int cron_procexit(), cron_getstring(), cron_getparm(), cron_restartp(); static int cron_hascore(); struct bnode *cron_create(); -extern char *ktime_DateOf(); -#define SDTIME 60 /* time in seconds given to a process to evaporate */ +#define SDTIME 60 /* time in seconds given to a process to evaporate */ struct bnode_ops cronbnode_ops = { cron_create, @@ -46,45 +56,49 @@ struct bnode_ops cronbnode_ops = { cron_restartp, cron_hascore, }; - + struct cronbnode { struct bnode b; afs_int32 zapTime; /* time we sent a sigterm */ char *command; char *whenString; /* string rep. of when to run */ struct bnode_proc *proc; - afs_int32 lastStart; /* time last started process */ + afs_int32 lastStart; /* time last started process */ afs_int32 nextRun; /* next time to run, if no proc running */ struct ktime whenToRun; /* high-level rep of when should we run this guy */ - afs_int32 when; /* computed at creation time and procexit time */ + afs_int32 when; /* computed at creation time and procexit time */ char everRun; /* true if ever ran */ char waitingForShutdown; /* have we started any shutdown procedure? */ - char running; /* is process running? */ - char killSent; /* have we tried sigkill signal? */ + char running; /* is process running? */ + char killSent; /* have we tried sigkill signal? */ }; -static int cron_hascore(abnode) -register struct ezbnode *abnode; { +static int +cron_hascore(register struct ezbnode *abnode) +{ char tbuffer[256]; - bnode_CoreName(abnode, (char *) 0, tbuffer); - if (access(tbuffer, 0) == 0) return 1; - else return 0; + bnode_CoreName(abnode, NULL, tbuffer); + if (access(tbuffer, 0) == 0) + return 1; + else + return 0; } /* run at creation or after process exit. figures out if we're all done (if a one shot run) or when we should run again. Sleeps until we should run again. Note that the computation of when we should run again is made in procexit and/or create procs. This guy only schedules the sleep */ -ScheduleCronBnode(abnode) -register struct cronbnode *abnode; { +int +ScheduleCronBnode(register struct cronbnode *abnode) +{ register afs_int32 code; register afs_int32 temp; struct bnode_proc *tp; /* If this proc is shutdown, tell bproc() to no longer run this job */ if (abnode->b.goal == BSTAT_SHUTDOWN) { - bnode_SetTimeout(abnode, 0); + bnode_SetTimeout(abnode, 0); return 0; } @@ -100,7 +114,7 @@ register struct cronbnode *abnode; { if (!abnode->running) { /* start up */ abnode->lastStart = FT_ApproxTime(); - code = bnode_NewProc(abnode, abnode->command, (char *) 0, &tp); + code = bnode_NewProc(abnode, abnode->command, NULL, &tp); if (code) { bozo_Log("cron bnode %s failed to start (code %d)\n", abnode->b.name, code); @@ -111,35 +125,37 @@ register struct cronbnode *abnode; { abnode->proc = tp; return 0; } - } - else { + } else { /* run periodically */ - if (abnode->running) return 0; + if (abnode->running) + return 0; /* otherwise find out when to run it, and do it then */ temp = abnode->when - FT_ApproxTime(); - if (temp < 1) temp = 1; /* temp is when to start dude */ + if (temp < 1) + temp = 1; /* temp is when to start dude */ bnode_SetTimeout(abnode, temp); } return 0; } -static int cron_restartp (abnode) -register struct cronbnode *abnode; { +static int +cron_restartp(register struct cronbnode *abnode) +{ return 0; } -static int cron_delete(abnode) -struct cronbnode *abnode; { +static int +cron_delete(struct cronbnode *abnode) +{ free(abnode->command); free(abnode->whenString); free(abnode); return 0; } -struct bnode *cron_create(ainstance, acommand, awhen) -char *ainstance; -char *awhen; -char *acommand; { +struct bnode * +cron_create(char *ainstance, char *acommand, char *awhen) +{ struct cronbnode *te; afs_int32 code; char *cmdpath; @@ -148,39 +164,40 @@ char *acommand; { /* construct local path from canonical (wire-format) path */ if (ConstructLocalBinPath(acommand, &cmdpath)) { bozo_Log("BNODE: command path invalid '%s'\n", acommand); - return (struct bnode *)0; + return NULL; } - te = (struct cronbnode *) malloc(sizeof(struct cronbnode)); + te = (struct cronbnode *)malloc(sizeof(struct cronbnode)); memset(te, 0, sizeof(struct cronbnode)); code = ktime_ParsePeriodic(awhen, &te->whenToRun); - if (code < 0) { + if ((code < 0) || (bnode_InitBnode(te, &cronbnode_ops, ainstance) != 0)) { free(te); free(cmdpath); - return (struct bnode *) 0; + return NULL; } - bnode_InitBnode(te, &cronbnode_ops, ainstance); te->when = ktime_next(&te->whenToRun, 0); te->command = cmdpath; te->whenString = copystr(awhen); - return (struct bnode *) te; + return (struct bnode *)te; } /* called to SIGKILL a process if it doesn't terminate normally. In cron, also start up a process if it is time and not already running */ -static int cron_timeout(abnode) -struct cronbnode *abnode; { +static int +cron_timeout(struct cronbnode *abnode) +{ register afs_int32 temp; register afs_int32 code; struct bnode_proc *tp; if (!abnode->running) { - if (abnode->when == 0) return 0; /* spurious timeout activation */ + if (abnode->when == 0) + return 0; /* spurious timeout activation */ /* not running, perhaps we should start it */ if (FT_ApproxTime() >= abnode->when) { abnode->lastStart = FT_ApproxTime(); bnode_SetTimeout(abnode, 0); - code = bnode_NewProc(abnode, abnode->command, (char *) 0, &tp); + code = bnode_NewProc(abnode, abnode->command, NULL, &tp); if (code) { bozo_Log("cron failed to start bnode %s (code %d)\n", abnode->b.name, code); @@ -189,16 +206,16 @@ struct cronbnode *abnode; { abnode->everRun = 1; abnode->running = 1; abnode->proc = tp; - } - else { + } else { /* woke up too early, try again */ temp = abnode->when - FT_ApproxTime(); - if (temp < 1) temp = 1; + if (temp < 1) + temp = 1; bnode_SetTimeout(abnode, temp); } - } - else { - if (!abnode->waitingForShutdown) return 0; /* spurious */ + } else { + if (!abnode->waitingForShutdown) + return 0; /* spurious */ /* send kill and turn off timer */ bnode_StopProc(abnode->proc, SIGKILL); abnode->killSent = 1; @@ -207,70 +224,71 @@ struct cronbnode *abnode; { return 0; } -static int cron_getstat(abnode, astatus) -struct cronbnode *abnode; -afs_int32 *astatus; { +static int +cron_getstat(struct cronbnode *abnode, afs_int32 * astatus) +{ register afs_int32 temp; - if (abnode->waitingForShutdown) temp = BSTAT_SHUTTINGDOWN; - else if (abnode->b.goal == 0) temp = BSTAT_SHUTDOWN; + if (abnode->waitingForShutdown) + temp = BSTAT_SHUTTINGDOWN; + else if (abnode->b.goal == 0) + temp = BSTAT_SHUTDOWN; else if (abnode->everRun && abnode->when == 0 && !abnode->running) { /* special hack: bnode deletion won't happen if bnode is active, so - we make bnodes that are ready to be deleted automatically appear - as BSTAT_SHUTDOWN so bnode_Delete is happy. */ + * we make bnodes that are ready to be deleted automatically appear + * as BSTAT_SHUTDOWN so bnode_Delete is happy. */ temp = BSTAT_SHUTDOWN; - } - else temp = BSTAT_NORMAL; + } else + temp = BSTAT_NORMAL; *astatus = temp; return 0; } -static int cron_setstat(abnode, astatus) -register struct cronbnode *abnode; -afs_int32 astatus; { - - if (abnode->waitingForShutdown) return BZBUSY; +static int +cron_setstat(register struct cronbnode *abnode, afs_int32 astatus) +{ + if (abnode->waitingForShutdown) + return BZBUSY; if (astatus == BSTAT_SHUTDOWN) { - if (abnode->running) { - /* start shutdown */ - bnode_StopProc(abnode->proc, SIGTERM); - abnode->waitingForShutdown = 1; - bnode_SetTimeout(abnode, SDTIME); - /* When shutdown is complete, bproc() calls BOP_PROCEXIT() - * [cron_procexit()] which will tell bproc() to no longer - * run this cron job. - */ - } else { - /* Tell bproc() to no longer run this cron job */ - bnode_SetTimeout(abnode, 0); - } - } - else if (astatus == BSTAT_NORMAL) { - /* start the cron job + if (abnode->running) { + /* start shutdown */ + bnode_StopProc(abnode->proc, SIGTERM); + abnode->waitingForShutdown = 1; + bnode_SetTimeout(abnode, SDTIME); + /* When shutdown is complete, bproc() calls BOP_PROCEXIT() + * [cron_procexit()] which will tell bproc() to no longer + * run this cron job. + */ + } else { + /* Tell bproc() to no longer run this cron job */ + bnode_SetTimeout(abnode, 0); + } + } else if (astatus == BSTAT_NORMAL) { + /* start the cron job * Figure out when to run next and schedule it */ - abnode->when = ktime_next(&abnode->whenToRun, 0); + abnode->when = ktime_next(&abnode->whenToRun, 0); ScheduleCronBnode(abnode); } return 0; } -static int cron_procexit(abnode, aproc) -struct cronbnode *abnode; -struct bnode_proc *aproc; { +static int +cron_procexit(struct cronbnode *abnode, struct bnode_proc *aproc) +{ /* process has exited */ /* log interesting errors for folks */ if (aproc->lastSignal) - bozo_Log("cron job %s exited due to signal %d\n", - abnode->b.name, aproc->lastSignal); + bozo_Log("cron job %s exited due to signal %d\n", abnode->b.name, + aproc->lastSignal); else if (aproc->lastExit) - bozo_Log("cron job %s exited with non-zero code %d\n", - abnode->b.name, aproc->lastExit); + bozo_Log("cron job %s exited with non-zero code %d\n", abnode->b.name, + aproc->lastExit); abnode->waitingForShutdown = 0; abnode->running = 0; abnode->killSent = 0; - abnode->proc = (struct bnode_proc *) 0; + abnode->proc = (struct bnode_proc *)0; /* Figure out when to run next and schedule it */ abnode->when = ktime_next(&abnode->whenToRun, 0); @@ -278,25 +296,27 @@ struct bnode_proc *aproc; { return 0; } -static int cron_getstring(abnode, abuffer, alen) -struct cronbnode *abnode; -char *abuffer; -afs_int32 alen;{ - if (abnode->running) strcpy(abuffer, "running now"); - else if (abnode->when==0) strcpy(abuffer, "waiting to run once"); - else sprintf(abuffer, "run next at %s", ktime_DateOf(abnode->when)); +static int +cron_getstring(struct cronbnode *abnode, char *abuffer, afs_int32 alen) +{ + if (abnode->running) + strcpy(abuffer, "running now"); + else if (abnode->when == 0) + strcpy(abuffer, "waiting to run once"); + else + sprintf(abuffer, "run next at %s", ktime_DateOf(abnode->when)); return 0; } -static cron_getparm(abnode, aindex, abuffer, alen) -struct cronbnode *abnode; -afs_int32 aindex; -char *abuffer; -afs_int32 alen; { - if (aindex == 0) strcpy(abuffer, abnode->command); +static int +cron_getparm(struct cronbnode *abnode, afs_int32 aindex, char *abuffer, + afs_int32 alen) +{ + if (aindex == 0) + strcpy(abuffer, abnode->command); else if (aindex == 1) { strcpy(abuffer, abnode->whenString); - } - else return BZDOM; + } else + return BZDOM; return 0; } diff --git a/src/bozo/ezbnodeops.c b/src/bozo/ezbnodeops.c index 2c5272f06..72d40de5d 100644 --- a/src/bozo/ezbnodeops.c +++ b/src/bozo/ezbnodeops.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/ezbnodeops.c,v 1.1.1.5 2001/09/11 14:31:28 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bozo/ezbnodeops.c,v 1.8 2003/07/15 23:14:43 shadow Exp $"); #include #include @@ -19,8 +20,18 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/ezbnodeops.c,v 1.1.1.5 2001/09/11 #ifdef AFS_NT40_ENV #include #endif + +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#include + #include -#include /* signal(), kill(), wait(), etc. */ +#include /* signal(), kill(), wait(), etc. */ #include "bnode.h" static int ez_timeout(), ez_getstat(), ez_setstat(), ez_delete(); @@ -28,7 +39,7 @@ static int ez_procexit(), ez_getstring(), ez_getparm(), ez_restartp(); static int ez_hascore(); struct bnode *ez_create(); -#define SDTIME 60 /* time in seconds given to a process to evaporate */ +#define SDTIME 60 /* time in seconds given to a process to evaporate */ struct bnode_ops ezbnode_ops = { ez_create, @@ -43,64 +54,78 @@ struct bnode_ops ezbnode_ops = { ez_hascore, }; -static int ez_hascore(abnode) -register struct ezbnode *abnode; { +static int +ez_hascore(register struct ezbnode *abnode) +{ char tbuffer[256]; - bnode_CoreName(abnode, (char *) 0, tbuffer); - if (access(tbuffer, 0) == 0) return 1; - else return 0; + bnode_CoreName(abnode, NULL, tbuffer); + if (access(tbuffer, 0) == 0) + return 1; + else + return 0; } -static int ez_restartp (abnode) -register struct ezbnode *abnode; { +static int +ez_restartp(register struct ezbnode *abnode) +{ struct bnode_token *tt; register afs_int32 code; struct stat tstat; - + code = bnode_ParseLine(abnode->command, &tt); - if (code) return 0; - if (!tt) return 0; + if (code) + return 0; + if (!tt) + return 0; code = stat(tt->key, &tstat); if (code) { bnode_FreeTokens(tt); return 0; } - if (tstat.st_ctime > abnode->lastStart) code = 1; - else code = 0; + if (tstat.st_ctime > abnode->lastStart) + code = 1; + else + code = 0; bnode_FreeTokens(tt); return code; } -static int ez_delete(abnode) -struct ezbnode *abnode; { +static int +ez_delete(struct ezbnode *abnode) +{ free(abnode->command); free(abnode); return 0; } -struct bnode *ez_create(ainstance, acommand) -char *ainstance; -char *acommand; { +struct bnode * +ez_create(char *ainstance, char *acommand) +{ struct ezbnode *te; char *cmdpath; if (ConstructLocalBinPath(acommand, &cmdpath)) { bozo_Log("BNODE: command path invalid '%s'\n", acommand); - return (struct bnode *)0; + return NULL; } - te = (struct ezbnode *) malloc(sizeof(struct ezbnode)); + te = (struct ezbnode *)malloc(sizeof(struct ezbnode)); memset(te, 0, sizeof(struct ezbnode)); - bnode_InitBnode(te, &ezbnode_ops, ainstance); + if (bnode_InitBnode(te, &ezbnode_ops, ainstance) != 0) { + free(te); + return NULL; + } te->command = cmdpath; - return (struct bnode *) te; + return (struct bnode *)te; } /* called to SIGKILL a process if it doesn't terminate normally */ -static int ez_timeout(abnode) -struct ezbnode *abnode; { - if (!abnode->waitingForShutdown) return 0; /* spurious */ +static int +ez_timeout(struct ezbnode *abnode) +{ + if (!abnode->waitingForShutdown) + return 0; /* spurious */ /* send kill and turn off timer */ bnode_StopProc(abnode->proc, SIGKILL); abnode->killSent = 1; @@ -108,34 +133,38 @@ struct ezbnode *abnode; { return 0; } -static int ez_getstat(abnode, astatus) -struct ezbnode *abnode; -afs_int32 *astatus; { +static int +ez_getstat(struct ezbnode *abnode, afs_int32 * astatus) +{ register afs_int32 temp; - if (abnode->waitingForShutdown) temp = BSTAT_SHUTTINGDOWN; - else if (abnode->running) temp = BSTAT_NORMAL; - else temp = BSTAT_SHUTDOWN; + if (abnode->waitingForShutdown) + temp = BSTAT_SHUTTINGDOWN; + else if (abnode->running) + temp = BSTAT_NORMAL; + else + temp = BSTAT_SHUTDOWN; *astatus = temp; return 0; } -static int ez_setstat(abnode, astatus) -register struct ezbnode *abnode; -afs_int32 astatus; { +static int +ez_setstat(register struct ezbnode *abnode, afs_int32 astatus) +{ struct bnode_proc *tp; register afs_int32 code; - if (abnode->waitingForShutdown) return BZBUSY; + if (abnode->waitingForShutdown) + return BZBUSY; if (astatus == BSTAT_NORMAL && !abnode->running) { /* start up */ abnode->lastStart = FT_ApproxTime(); - code = bnode_NewProc(abnode, abnode->command, (char *) 0, &tp); - if (code) return code; + code = bnode_NewProc(abnode, abnode->command, NULL, &tp); + if (code) + return code; abnode->running = 1; abnode->proc = tp; return 0; - } - else if (astatus == BSTAT_SHUTDOWN && abnode->running) { + } else if (astatus == BSTAT_SHUTDOWN && abnode->running) { /* start shutdown */ bnode_StopProc(abnode->proc, SIGTERM); abnode->waitingForShutdown = 1; @@ -145,36 +174,36 @@ afs_int32 astatus; { return 0; } -static int ez_procexit(abnode, aproc) -struct ezbnode *abnode; -struct bnode_proc *aproc; { +static int +ez_procexit(struct ezbnode *abnode, struct bnode_proc *aproc) +{ /* process has exited */ register afs_int32 code; abnode->waitingForShutdown = 0; abnode->running = 0; abnode->killSent = 0; - abnode->proc = (struct bnode_proc *) 0; + abnode->proc = (struct bnode_proc *)0; bnode_SetTimeout(abnode, 0); /* clear timer */ if (abnode->b.goal) code = ez_setstat(abnode, BSTAT_NORMAL); - else code = 0; + else + code = 0; return code; } -static int ez_getstring(abnode, abuffer, alen) -struct ezbnode *abnode; -char *abuffer; -afs_int32 alen;{ - return -1; /* don't have much to add */ +static int +ez_getstring(struct ezbnode *abnode, char *abuffer, afs_int32 alen) +{ + return -1; /* don't have much to add */ } -static ez_getparm(abnode, aindex, abuffer, alen) -struct ezbnode *abnode; -afs_int32 aindex; -char *abuffer; -afs_int32 alen; { - if (aindex > 0) return BZDOM; +static +ez_getparm(struct ezbnode *abnode, afs_int32 aindex, char *abuffer, + afs_int32 alen) +{ + if (aindex > 0) + return BZDOM; strcpy(abuffer, abnode->command); return 0; } diff --git a/src/bozo/fsbnodeops.c b/src/bozo/fsbnodeops.c index 7146ed42a..4b2eb32cc 100644 --- a/src/bozo/fsbnodeops.c +++ b/src/bozo/fsbnodeops.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/fsbnodeops.c,v 1.1.1.8 2001/10/14 18:04:06 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bozo/fsbnodeops.c,v 1.13 2003/12/07 22:49:18 jaltman Exp $"); #include #include @@ -24,9 +25,19 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/fsbnodeops.c,v 1.1.1.8 2001/10/14 #include #else #include + +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#include + #endif /* AFS_NT40_ENV */ #include -#include /* signal(), kill(), wait(), etc. */ +#include /* signal(), kill(), wait(), etc. */ #include #include "bnode.h" @@ -34,7 +45,6 @@ static int fs_timeout(), fs_getstat(), fs_setstat(), fs_delete(); static int fs_procexit(), fs_getstring(), fs_getparm(), fs_restartp(); static int fs_hascore(); struct bnode *fs_create(); -struct bnode *fsmr_create(); static SetNeedsClock(); static NudgeProcs(); @@ -44,8 +54,8 @@ static int emergency = 0; /* if this file exists, then we have to salvage the file system */ #define SALFILE "SALVAGE." -#define POLLTIME 20 /* for handling below */ -#define SDTIME 60 /* time in seconds given to a process to evaporate */ +#define POLLTIME 20 /* for handling below */ +#define SDTIME 60 /* time in seconds given to a process to evaporate */ /* basic rules: Normal operation involves having the file server and the vol server both running. @@ -78,35 +88,35 @@ struct bnode_ops fsbnode_ops = { fs_restartp, fs_hascore, }; - + struct fsbnode { struct bnode b; - afs_int32 timeSDStarted; /* time shutdown operation started */ - char *filecmd; /* command to start primary file server */ - char *volcmd; /* command to start secondary vol server */ - char *salcmd; /* command to start salvager */ - char *scancmd; /* command to start scanner (MR-AFS) */ - struct bnode_proc *fileProc; /* process for file server */ - struct bnode_proc *volProc; /* process for vol server */ - struct bnode_proc *salProc; /* process for salvager */ - struct bnode_proc *scanProc; /* process for scanner (MR-AFS) */ - afs_int32 lastFileStart; /* last start for file */ - afs_int32 lastVolStart; /* last start for vol */ - afs_int32 lastScanStart; /* last start for scanner (MR-AFS) */ - char fileRunning; /* file process is running */ - char volRunning; /* volser is running */ - char salRunning; /* salvager is running */ - char scanRunning; /* scanner is running (MR_AFS) */ - char fileSDW; /* file shutdown wait */ - char volSDW; /* vol shutdown wait */ - char salSDW; /* waiting for the salvager to shutdown */ - char scanSDW; /* scanner shutdown wait (MR_AFS) */ - char fileKillSent; /* kill signal has been sent */ + afs_int32 timeSDStarted; /* time shutdown operation started */ + char *filecmd; /* command to start primary file server */ + char *volcmd; /* command to start secondary vol server */ + char *salcmd; /* command to start salvager */ + char *scancmd; /* command to start scanner (MR-AFS) */ + struct bnode_proc *fileProc; /* process for file server */ + struct bnode_proc *volProc; /* process for vol server */ + struct bnode_proc *salProc; /* process for salvager */ + struct bnode_proc *scanProc; /* process for scanner (MR-AFS) */ + afs_int32 lastFileStart; /* last start for file */ + afs_int32 lastVolStart; /* last start for vol */ + afs_int32 lastScanStart; /* last start for scanner (MR-AFS) */ + char fileRunning; /* file process is running */ + char volRunning; /* volser is running */ + char salRunning; /* salvager is running */ + char scanRunning; /* scanner is running (MR_AFS) */ + char fileSDW; /* file shutdown wait */ + char volSDW; /* vol shutdown wait */ + char salSDW; /* waiting for the salvager to shutdown */ + char scanSDW; /* scanner shutdown wait (MR_AFS) */ + char fileKillSent; /* kill signal has been sent */ char volKillSent; char salKillSent; - char scanKillSent; /* kill signal has been sent (MR_AFS) */ - char needsSalvage; /* salvage before running */ - char needsClock; /* do we need clock ticks */ + char scanKillSent; /* kill signal has been sent (MR_AFS) */ + char needsSalvage; /* salvage before running */ + char needsClock; /* do we need clock ticks */ }; /* Function to tell whether this bnode has a core file or not. You might @@ -115,76 +125,96 @@ struct fsbnode { * there may not be an active process for a bnode that dumped core at the * time the query is done. */ -static int fs_hascore(abnode) -register struct ezbnode *abnode; { +static int +fs_hascore(register struct ezbnode *abnode) +{ char tbuffer[256]; /* see if file server has a core file */ bnode_CoreName(abnode, "file", tbuffer); - if (access(tbuffer, 0) == 0) return 1; + if (access(tbuffer, 0) == 0) + return 1; /* see if volserver has a core file */ bnode_CoreName(abnode, "vol", tbuffer); - if (access(tbuffer, 0) == 0) return 1; + if (access(tbuffer, 0) == 0) + return 1; /* see if salvager left a core file */ bnode_CoreName(abnode, "salv", tbuffer); - if (access(tbuffer, 0) == 0) return 1; + if (access(tbuffer, 0) == 0) + return 1; /* see if scanner left a core file (MR-AFS) */ bnode_CoreName(abnode, "scan", tbuffer); - if (access(tbuffer, 0) == 0) return 1; + if (access(tbuffer, 0) == 0) + return 1; /* no one left a core file */ return 0; } -static int fs_restartp (abnode) -register struct fsbnode *abnode; { +static int +fs_restartp(register struct fsbnode *abnode) +{ struct bnode_token *tt; register afs_int32 code; struct stat tstat; - + code = bnode_ParseLine(abnode->filecmd, &tt); - if (code) return 0; - if (!tt) return 0; + if (code) + return 0; + if (!tt) + return 0; code = stat(tt->key, &tstat); if (code) { bnode_FreeTokens(tt); return 0; } - if (tstat.st_ctime > abnode->lastFileStart) code = 1; - else code = 0; + if (tstat.st_ctime > abnode->lastFileStart) + code = 1; + else + code = 0; bnode_FreeTokens(tt); - if (code) return code; + if (code) + return code; /* now do same for volcmd */ code = bnode_ParseLine(abnode->volcmd, &tt); - if (code) return 0; - if (!tt) return 0; + if (code) + return 0; + if (!tt) + return 0; code = stat(tt->key, &tstat); if (code) { bnode_FreeTokens(tt); return 0; } - if (tstat.st_ctime > abnode->lastVolStart) code = 1; - else code = 0; + if (tstat.st_ctime > abnode->lastVolStart) + code = 1; + else + code = 0; bnode_FreeTokens(tt); - if (code) return code; - - if (abnode->scancmd) { /* Only in MR-AFS */ - /* now do same for scancmd (MR-AFS) */ - code = bnode_ParseLine(abnode->scancmd, &tt); - if (code) return 0; - if (!tt) return 0; - code = stat(tt->key, &tstat); - if (code) { - bnode_FreeTokens(tt); - return 0; + if (code) + return code; + + if (abnode->scancmd) { /* Only in MR-AFS */ + /* now do same for scancmd (MR-AFS) */ + code = bnode_ParseLine(abnode->scancmd, &tt); + if (code) + return 0; + if (!tt) + return 0; + code = stat(tt->key, &tstat); + if (code) { + bnode_FreeTokens(tt); + return 0; } - if (tstat.st_ctime > abnode->lastScanStart) code = 1; - else code = 0; - bnode_FreeTokens(tt); + if (tstat.st_ctime > abnode->lastScanStart) + code = 1; + else + code = 0; + bnode_FreeTokens(tt); } return code; @@ -192,63 +222,66 @@ register struct fsbnode *abnode; { /* set needsSalvage flag, creating file SALVAGE. if we need to salvage the file system (so we can tell over panic reboots */ -static SetSalFlag(abnode, aflag) -register struct fsbnode *abnode; -register int aflag; { +static int +SetSalFlag(register struct fsbnode *abnode, register int aflag) +{ char tbuffer[AFSDIR_PATH_MAX]; int fd; abnode->needsSalvage = aflag; - strcompose(tbuffer, AFSDIR_PATH_MAX, AFSDIR_SERVER_LOCAL_DIRPATH, "/", SALFILE, - abnode->b.name, NULL); + strcompose(tbuffer, AFSDIR_PATH_MAX, AFSDIR_SERVER_LOCAL_DIRPATH, "/", + SALFILE, abnode->b.name, NULL); if (aflag) { fd = open(tbuffer, O_CREAT | O_TRUNC | O_RDWR, 0666); close(fd); - } - else { + } else { unlink(tbuffer); } return 0; } /* set the needsSalvage flag according to the existence of the salvage file */ -static RestoreSalFlag(abnode) -register struct fsbnode *abnode; { +static int +RestoreSalFlag(register struct fsbnode *abnode) +{ char tbuffer[AFSDIR_PATH_MAX]; - strcompose(tbuffer, AFSDIR_PATH_MAX, AFSDIR_SERVER_LOCAL_DIRPATH, "/", SALFILE, - abnode->b.name, NULL); + strcompose(tbuffer, AFSDIR_PATH_MAX, AFSDIR_SERVER_LOCAL_DIRPATH, "/", + SALFILE, abnode->b.name, NULL); if (access(tbuffer, 0) == 0) { /* file exists, so need to salvage */ abnode->needsSalvage = 1; - } - else { + } else { abnode->needsSalvage = 0; } return 0; } -char *copystr(a) -register char *a; { +char * +copystr(register char *a) +{ register char *b; - b = (char *) malloc(strlen(a)+1); + b = (char *)malloc(strlen(a) + 1); strcpy(b, a); return b; } -static int fs_delete(abnode) -struct fsbnode *abnode; { +static int +fs_delete(struct fsbnode *abnode) +{ free(abnode->filecmd); free(abnode->volcmd); free(abnode->salcmd); - if (abnode->scancmd) free(abnode->scancmd); + if (abnode->scancmd) + free(abnode->scancmd); free(abnode); return 0; } #ifdef AFS_NT40_ENV -static void AppendExecutableExtension(char *cmd) +static void +AppendExecutableExtension(char *cmd) { char cmdext[_MAX_EXT]; @@ -261,12 +294,10 @@ static void AppendExecutableExtension(char *cmd) #endif /* AFS_NT40_ENV */ -struct bnode *fs_create(ainstance, afilecmd, avolcmd, asalcmd, ascancmd) -char *ainstance; -char *afilecmd; -char *avolcmd; -char *asalcmd; -char *ascancmd; { +struct bnode * +fs_create(char *ainstance, char *afilecmd, char *avolcmd, char *asalcmd, + char *ascancmd) +{ struct stat tstat; register struct fsbnode *te; char cmdname[AFSDIR_PATH_MAX]; @@ -290,10 +321,10 @@ char *ascancmd; { } if (ascancmd && strlen(ascancmd)) { - if (ConstructLocalBinPath(ascancmd, &scanCmdpath)) { - bozo_Log("BNODE: command path invalid '%s'\n", ascancmd); - bailout = 1; - } + if (ConstructLocalBinPath(ascancmd, &scanCmdpath)) { + bozo_Log("BNODE: command path invalid '%s'\n", ascancmd); + bailout = 1; + } } if (!bailout) { @@ -324,7 +355,7 @@ char *ascancmd; { bailout = 1; } - if (ascancmd && strlen(ascancmd)) { + if (ascancmd && strlen(ascancmd)) { sscanf(scanCmdpath, "%s", cmdname); #ifdef AFS_NT40_ENV AppendExecutableExtension(cmdname); @@ -337,29 +368,38 @@ char *ascancmd; { } if (bailout) { - free(fileCmdpath); free(volCmdpath); free(salCmdpath); - return (struct bnode *)0; + free(fileCmdpath); + free(volCmdpath); + free(salCmdpath); + return NULL; } - te = (struct fsbnode *) malloc(sizeof(struct fsbnode)); + te = (struct fsbnode *)malloc(sizeof(struct fsbnode)); memset(te, 0, sizeof(struct fsbnode)); te->filecmd = fileCmdpath; te->volcmd = volCmdpath; te->salcmd = salCmdpath; if (ascancmd && strlen(ascancmd)) - te->scancmd = scanCmdpath; - else - te->scancmd = (char *)0; - bnode_InitBnode(te, &fsbnode_ops, ainstance); + te->scancmd = scanCmdpath; + else + te->scancmd = NULL; + if (bnode_InitBnode(te, &fsbnode_ops, ainstance) != 0) { + free(te); + free(fileCmdpath); + free(volCmdpath); + free(salCmdpath); + return NULL; + } bnode_SetTimeout(te, POLLTIME); /* ask for timeout activations every 10 seconds */ RestoreSalFlag(te); /* restore needsSalvage flag based on file's existence */ SetNeedsClock(te); /* compute needsClock field */ - return (struct bnode *) te; + return (struct bnode *)te; } /* called to SIGKILL a process if it doesn't terminate normally */ -static int fs_timeout(abnode) -struct fsbnode *abnode; { +static int +fs_timeout(struct fsbnode *abnode) +{ register afs_int32 now; now = FT_ApproxTime(); @@ -368,63 +408,72 @@ struct fsbnode *abnode; { if (!abnode->volKillSent && now - abnode->timeSDStarted > SDTIME) { bnode_StopProc(abnode->volProc, SIGKILL); abnode->volKillSent = 1; - bozo_Log("bos shutdown: volserver failed to shutdown within %d seconds\n", - SDTIME); + bozo_Log + ("bos shutdown: volserver failed to shutdown within %d seconds\n", + SDTIME); } } if (abnode->salSDW) { if (!abnode->salKillSent && now - abnode->timeSDStarted > SDTIME) { bnode_StopProc(abnode->salProc, SIGKILL); abnode->salKillSent = 1; - bozo_Log("bos shutdown: salvager failed to shutdown within %d seconds\n", - SDTIME); + bozo_Log + ("bos shutdown: salvager failed to shutdown within %d seconds\n", + SDTIME); } } if (abnode->fileSDW) { if (!abnode->fileKillSent && now - abnode->timeSDStarted > FSSDTIME) { bnode_StopProc(abnode->fileProc, SIGKILL); abnode->fileKillSent = 1; - bozo_Log("bos shutdown: fileserver failed to shutdown within %d seconds\n", - FSSDTIME); + bozo_Log + ("bos shutdown: fileserver failed to shutdown within %d seconds\n", + FSSDTIME); } } if (abnode->scanSDW) { - if (!abnode->scanKillSent && now - abnode->timeSDStarted > SDTIME) { - bnode_StopProc(abnode->scanProc, SIGKILL); - abnode->scanKillSent = 1; - bozo_Log("bos shutdown: scanner failed to shutdown within %d seconds\n", - SDTIME); - } + if (!abnode->scanKillSent && now - abnode->timeSDStarted > SDTIME) { + bnode_StopProc(abnode->scanProc, SIGKILL); + abnode->scanKillSent = 1; + bozo_Log + ("bos shutdown: scanner failed to shutdown within %d seconds\n", + SDTIME); + } } SetNeedsClock(abnode); return 0; } -static int fs_getstat(abnode, astatus) -struct fsbnode *abnode; -afs_int32 *astatus; { +static int +fs_getstat(struct fsbnode *abnode, afs_int32 * astatus) +{ register afs_int32 temp; - if (abnode->volSDW || abnode->fileSDW || abnode->salSDW || abnode->scanSDW) + if (abnode->volSDW || abnode->fileSDW || abnode->salSDW + || abnode->scanSDW) temp = BSTAT_SHUTTINGDOWN; - else if (abnode->salRunning) temp = BSTAT_NORMAL; - else if (abnode->volRunning && abnode->fileRunning && (!abnode->scancmd || - abnode->scanRunning)) temp = BSTAT_NORMAL; - else if (!abnode->salRunning && !abnode->volRunning && !abnode->fileRunning - && !abnode->scanRunning) temp = BSTAT_SHUTDOWN; - else temp = BSTAT_STARTINGUP; + else if (abnode->salRunning) + temp = BSTAT_NORMAL; + else if (abnode->volRunning && abnode->fileRunning + && (!abnode->scancmd || abnode->scanRunning)) + temp = BSTAT_NORMAL; + else if (!abnode->salRunning && !abnode->volRunning + && !abnode->fileRunning && !abnode->scanRunning) + temp = BSTAT_SHUTDOWN; + else + temp = BSTAT_STARTINGUP; *astatus = temp; return 0; } -static int fs_setstat(abnode, astatus) -register struct fsbnode *abnode; -afs_int32 astatus; { +static int +fs_setstat(register struct fsbnode *abnode, afs_int32 astatus) +{ return NudgeProcs(abnode); } -static int fs_procexit(abnode, aproc) -struct fsbnode *abnode; -struct bnode_proc *aproc; { +static int +fs_procexit(struct fsbnode *abnode, struct bnode_proc *aproc) +{ /* process has exited */ if (aproc == abnode->volProc) { @@ -432,35 +481,33 @@ struct bnode_proc *aproc; { abnode->volRunning = 0; abnode->volSDW = 0; abnode->volKillSent = 0; - } - else if (aproc == abnode->fileProc) { + } else if (aproc == abnode->fileProc) { /* if we were expecting a shutdown and we didn't send a kill signal * and exited (didn't have a signal termination), then we assume that * the file server exited after putting the appropriate volumes safely * offline, and don't salvage next time. */ - if (abnode->fileSDW && !abnode->fileKillSent && aproc->lastSignal == 0) - SetSalFlag(abnode, 0); /* shut down normally */ + if (abnode->fileSDW && !abnode->fileKillSent + && aproc->lastSignal == 0) + SetSalFlag(abnode, 0); /* shut down normally */ abnode->fileProc = 0; abnode->fileRunning = 0; abnode->fileSDW = 0; abnode->fileKillSent = 0; - } - else if (aproc == abnode->salProc) { + } else if (aproc == abnode->salProc) { /* if we didn't shutdown the salvager, then assume it exited ok, and thus - that we don't have to salvage again */ + * that we don't have to salvage again */ if (!abnode->salSDW) SetSalFlag(abnode, 0); /* salvage just completed */ abnode->salProc = 0; abnode->salRunning = 0; abnode->salSDW = 0; abnode->salKillSent = 0; - } - else if (aproc == abnode->scanProc) { - abnode->scanProc = 0; - abnode->scanRunning = 0; - abnode->scanSDW = 0; - abnode->scanKillSent = 0; + } else if (aproc == abnode->scanProc) { + abnode->scanProc = 0; + abnode->scanRunning = 0; + abnode->scanSDW = 0; + abnode->scanKillSent = 0; } /* now restart anyone who needs to restart */ @@ -468,32 +515,35 @@ struct bnode_proc *aproc; { } /* make sure we're periodically checking the state if we need to */ -static SetNeedsClock(ab) - register struct fsbnode *ab; +static int +SetNeedsClock(register struct fsbnode *ab) { if (ab->b.goal == 1 && ab->fileRunning && ab->volRunning - && (!ab->scancmd || ab->scanRunning)) - ab->needsClock = 0; /* running normally */ - else if (ab->b.goal == 0 && !ab->fileRunning && !ab->volRunning + && (!ab->scancmd || ab->scanRunning)) + ab->needsClock = 0; /* running normally */ + else if (ab->b.goal == 0 && !ab->fileRunning && !ab->volRunning && !ab->salRunning && !ab->scanRunning) - ab->needsClock = 0; /* halted normally */ - else ab->needsClock = 1; /* other */ + ab->needsClock = 0; /* halted normally */ + else + ab->needsClock = 1; /* other */ if (ab->needsClock && !bnode_PendingTimeout(ab)) bnode_SetTimeout(ab, POLLTIME); - if (!ab->needsClock) bnode_SetTimeout(ab, 0); + if (!ab->needsClock) + bnode_SetTimeout(ab, 0); } -static NudgeProcs(abnode) -register struct fsbnode *abnode; { - struct bnode_proc *tp; /* not register */ +static int +NudgeProcs(register struct fsbnode *abnode) +{ + struct bnode_proc *tp; /* not register */ register afs_int32 code; afs_int32 now; now = FT_ApproxTime(); if (abnode->b.goal == 1) { /* we're trying to run the system. If the file server is running, then we - are trying to start up the system. If it is not running, then needsSalvage - tells us if we need to run the salvager or not */ + * are trying to start up the system. If it is not running, then needsSalvage + * tells us if we need to run the salvager or not */ if (abnode->fileRunning) { if (abnode->salRunning) { bozo_Log("Salvager running along with file server!\n"); @@ -515,21 +565,23 @@ register struct fsbnode *abnode; { if (abnode->scancmd) { if (!abnode->scanRunning) { abnode->lastScanStart = FT_ApproxTime(); - code = bnode_NewProc(abnode, abnode->scancmd, "scanner", &tp); + code = + bnode_NewProc(abnode, abnode->scancmd, "scanner", + &tp); if (code == 0) { abnode->scanProc = tp; abnode->scanRunning = 1; } } - } - } - else { /* file is not running */ + } + } else { /* file is not running */ /* see how to start */ if (!abnode->needsSalvage) { /* no crash apparent, just start up normally */ if (!abnode->fileRunning) { abnode->lastFileStart = FT_ApproxTime(); - code = bnode_NewProc(abnode, abnode->filecmd, "file", &tp); + code = + bnode_NewProc(abnode, abnode->filecmd, "file", &tp); if (code == 0) { abnode->fileProc = tp; abnode->fileRunning = 1; @@ -545,34 +597,38 @@ register struct fsbnode *abnode; { } } if (abnode->scancmd && !abnode->scanRunning) { - abnode->lastScanStart = FT_ApproxTime(); - code = bnode_NewProc(abnode, abnode->scancmd, "scanner", - &tp); - if (code == 0) { - abnode->scanProc = tp; - abnode->scanRunning = 1; - } - } - } - else { /* needs to be salvaged */ + abnode->lastScanStart = FT_ApproxTime(); + code = + bnode_NewProc(abnode, abnode->scancmd, "scanner", + &tp); + if (code == 0) { + abnode->scanProc = tp; + abnode->scanRunning = 1; + } + } + } else { /* needs to be salvaged */ /* make sure file server and volser are gone */ if (abnode->volRunning) { bnode_StopProc(abnode->volProc, SIGTERM); - if (!abnode->volSDW) abnode->timeSDStarted = now; + if (!abnode->volSDW) + abnode->timeSDStarted = now; abnode->volSDW = 1; } if (abnode->fileRunning) { bnode_StopProc(abnode->fileProc, SIGQUIT); - if (!abnode->fileSDW) abnode->timeSDStarted = now; + if (!abnode->fileSDW) + abnode->timeSDStarted = now; abnode->fileSDW = 1; } - if (abnode->scanRunning) { - bnode_StopProc(abnode->scanProc, SIGTERM); - if (!abnode->scanSDW) abnode->timeSDStarted = now; - abnode->scanSDW = 1; - } - if (abnode->volRunning || abnode->fileRunning - || abnode->scanRunning) return 0; + if (abnode->scanRunning) { + bnode_StopProc(abnode->scanProc, SIGTERM); + if (!abnode->scanSDW) + abnode->timeSDStarted = now; + abnode->scanSDW = 1; + } + if (abnode->volRunning || abnode->fileRunning + || abnode->scanRunning) + return 0; /* otherwise, it is safe to start salvager */ if (!abnode->salRunning) { code = bnode_NewProc(abnode, abnode->salcmd, "salv", &tp); @@ -583,8 +639,7 @@ register struct fsbnode *abnode; { } } } - } - else { /* goal is 0, we're shutting down */ + } else { /* goal is 0, we're shutting down */ /* trying to shutdown */ if (abnode->salRunning && !abnode->salSDW) { bnode_StopProc(abnode->salProc, SIGTERM); @@ -601,60 +656,62 @@ register struct fsbnode *abnode; { abnode->volSDW = 1; abnode->timeSDStarted = now; } - if (abnode->scanRunning && !abnode->scanSDW) { - bnode_StopProc(abnode->scanProc, SIGTERM); - abnode->scanSDW = 1; - abnode->timeSDStarted = now; - } + if (abnode->scanRunning && !abnode->scanSDW) { + bnode_StopProc(abnode->scanProc, SIGTERM); + abnode->scanSDW = 1; + abnode->timeSDStarted = now; + } } SetNeedsClock(abnode); return 0; } -static int fs_getstring(abnode, abuffer, alen) -struct fsbnode *abnode; -char *abuffer; -afs_int32 alen;{ - if (alen < 40) return -1; +static int +fs_getstring(struct fsbnode *abnode, char *abuffer, afs_int32 alen) +{ + if (alen < 40) + return -1; if (abnode->b.goal == 1) { if (abnode->fileRunning) { - if (abnode->fileSDW) strcpy(abuffer, "file server shutting down"); + if (abnode->fileSDW) + strcpy(abuffer, "file server shutting down"); else if (abnode->scancmd) { - if (!abnode->volRunning && !abnode->scanRunning) - strcpy(abuffer, "file server up; volser and scanner down"); + if (!abnode->volRunning && !abnode->scanRunning) + strcpy(abuffer, + "file server up; volser and scanner down"); else if (abnode->volRunning && !abnode->scanRunning) - strcpy(abuffer, "file server up; volser up; scanner down"); + strcpy(abuffer, + "file server up; volser up; scanner down"); else if (!abnode->volRunning && abnode->scanRunning) - strcpy(abuffer, "file server up; volser down; scanner up"); + strcpy(abuffer, + "file server up; volser down; scanner up"); - else strcpy(abuffer, "file server running"); - } - else if (!abnode->volRunning) + else + strcpy(abuffer, "file server running"); + } else if (!abnode->volRunning) strcpy(abuffer, "file server up; volser down"); - else strcpy(abuffer, "file server running"); - } - else if (abnode->salRunning) { + else + strcpy(abuffer, "file server running"); + } else if (abnode->salRunning) { strcpy(abuffer, "salvaging file system"); - } - else strcpy(abuffer, "starting file server"); - } - else { + } else + strcpy(abuffer, "starting file server"); + } else { /* shutting down */ if (abnode->fileRunning || abnode->volRunning || abnode->scanRunning) { strcpy(abuffer, "file server shutting down"); - } - else if (abnode->salRunning) + } else if (abnode->salRunning) strcpy(abuffer, "salvager shutting down"); - else strcpy(abuffer, "file server shut down"); + else + strcpy(abuffer, "file server shut down"); } return 0; } -static fs_getparm(abnode, aindex, abuffer, alen) -struct fsbnode *abnode; -afs_int32 aindex; -char *abuffer; -afs_int32 alen; { +static int +fs_getparm(struct fsbnode *abnode, afs_int32 aindex, char *abuffer, + afs_int32 alen) +{ if (aindex == 0) strcpy(abuffer, abnode->filecmd); else if (aindex == 1) diff --git a/src/bozo/smail-notifier.c b/src/bozo/smail-notifier.c index 10347d99b..da0767a31 100644 --- a/src/bozo/smail-notifier.c +++ b/src/bozo/smail-notifier.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/smail-notifier.c,v 1.1.1.4 2001/07/14 22:20:46 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bozo/smail-notifier.c,v 1.5 2003/07/15 23:14:43 shadow Exp $"); #include #include @@ -29,35 +30,37 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/smail-notifier.c,v 1.1.1.4 2001/07 /* * Replace it with a bboard (i.e. transarc.bosserver.auto-reports) */ -#define RECIPIENT "foo@cellname" +#define RECIPIENT "foo@cellname" #include "AFS_component_version_number.c" main(argc, argv) - int argc; - char **argv; + int argc; + char **argv; { struct stat tstat; FILE *fin = stdin; char buf[BUFSIZ], *bufp, *bufp1, *typep, *cmd, *bp; - register afs_int32 code, c, fd, id, pflags=-1, len, core=0, lastE=0; + register afs_int32 code, c, fd, id, pflags = -1, len, core = 0, lastE = 0; char comLine[60], coreName[40], name[40], lastErrorName[50]; - afs_int32 pid=-1, lastExit=-1, lastSignal=-1, rsTime=-1, rsCount=-1; - afs_int32 procStartTime=-1, procStarts=-1; - afs_int32 lastAnyExit=-1, lastErrorExit=-1, errorCode=-1, errorSignal=-1, goal=-1; + afs_int32 pid = -1, lastExit = -1, lastSignal = -1, rsTime = -1, rsCount = + -1; + afs_int32 procStartTime = -1, procStarts = -1; + afs_int32 lastAnyExit = -1, lastErrorExit = -1, errorCode = + -1, errorSignal = -1, goal = -1; char *timeStamp; - typep = (char *) malloc(50); - cmd = (char *) malloc(50); - bufp = bufp1 = (char *) malloc(1000); + typep = (char *)malloc(50); + cmd = (char *)malloc(50); + bufp = bufp1 = (char *)malloc(1000); while (fgets(buf, sizeof(buf), fin)) { - code = sscanf(buf, "%s %s\n", typep, cmd); + code = sscanf(buf, "%s %s\n", typep, cmd); if (code < 2) { continue; } - if (!strcmp(typep, "BEGIN") && !strcmp(cmd, "bnode_proc")) { + if (!strcmp(typep, "BEGIN") && !strcmp(cmd, "bnode_proc")) { while (fgets(buf, sizeof(buf), fin)) { - code = sscanf(buf, "%s %s\n", typep, cmd); + code = sscanf(buf, "%s %s\n", typep, cmd); if (code < 2) { printf("**bnode_proc**: typed=%s, cmd=%s\n", typep, cmd); break; @@ -79,13 +82,15 @@ main(argc, argv) else if (!strcmp(typep, "END")) { break; } else { - printf("Unexpected token %s in the bnode_proc (should be END)\n", typep); + printf + ("Unexpected token %s in the bnode_proc (should be END)\n", + typep); exit(1); } } - } else if (!strcmp(typep, "BEGIN") && !strcmp(cmd, "bnode")) { + } else if (!strcmp(typep, "BEGIN") && !strcmp(cmd, "bnode")) { while (fgets(buf, sizeof(buf), fin)) { - code = sscanf(buf, "%s %s\n", typep, cmd); + code = sscanf(buf, "%s %s\n", typep, cmd); if (code < 2) { printf("**bnode**: typed=%s, cmd=%s\n", typep, cmd); break; @@ -117,7 +122,9 @@ main(argc, argv) else if (!strcmp(typep, "END")) { break; } else { - printf("Unexpected token %s in the bnode (should be END)\n", typep); + printf + ("Unexpected token %s in the bnode (should be END)\n", + typep); exit(1); } } @@ -130,21 +137,24 @@ main(argc, argv) * Now make up the text for the post */ sprintf(buf, "/tmp/snote.%d", getpid()); - fd = open(buf, O_RDWR|O_CREAT|O_TRUNC, 0600); + fd = open(buf, O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd == -1) { perror(buf); printf("Unable to create temp file, %s\n", buf); exit(1); } - (void) sprintf(bufp, "Subject: Bosserver's automatic notification\n\n"); - bufp += strlen(bufp); - (void) sprintf(bufp, "AUTOMATIC NOTIFICATION EVENT FOR AFS SERVER INSTANCE %s\n\n", name); - bufp += strlen(bufp); - (void) sprintf(bufp, "Server Process id was: %d\n", pid); - bufp += strlen(bufp); - (void) sprintf(bufp, "Server command line: %s\n", comLine); - bufp += strlen(bufp); - if (strcmp(coreName, "(null)")) core = 1; + (void)sprintf(bufp, "Subject: Bosserver's automatic notification\n\n"); + bufp += strlen(bufp); + (void)sprintf(bufp, + "AUTOMATIC NOTIFICATION EVENT FOR AFS SERVER INSTANCE %s\n\n", + name); + bufp += strlen(bufp); + (void)sprintf(bufp, "Server Process id was: %d\n", pid); + bufp += strlen(bufp); + (void)sprintf(bufp, "Server command line: %s\n", comLine); + bufp += strlen(bufp); + if (strcmp(coreName, "(null)")) + core = 1; bp = comLine; strcpy(bp, AFSDIR_SERVER_CORELOG_FILEPATH); if (core) { @@ -160,59 +170,69 @@ main(argc, argv) } else core = 0; strcat(bp, " "); - (void) sprintf(bufp, "There is %score dump left %sfor this server\n", - (core?(c?"a recent ":"an 'old' "):"no "), (core?bp:"")); - bufp += strlen(bufp); + (void)sprintf(bufp, "There is %score dump left %sfor this server\n", + (core ? (c ? "a recent " : "an 'old' ") : "no "), + (core ? bp : "")); + bufp += strlen(bufp); #ifdef notdef - (void) sprintf(bufp, "Last Exit code %d\n", lastExit); - bufp += strlen(bufp); - (void) sprintf(bufp, "Last Signal number %d\n", lastSignal); - bufp += strlen(bufp); + (void)sprintf(bufp, "Last Exit code %d\n", lastExit); + bufp += strlen(bufp); + (void)sprintf(bufp, "Last Signal number %d\n", lastSignal); + bufp += strlen(bufp); #endif if (pflags == 1) strcpy(bp, "PROCESS STARTED"); else if (pflags == 2) strcpy(bp, "PROCESS EXITED"); - else + else strcpy(bp, "UNKNOWN"); - (void) sprintf(bufp, "Process state %d (%s)\n", pflags, bp); - bufp += strlen(bufp); + (void)sprintf(bufp, "Process state %d (%s)\n", pflags, bp); + bufp += strlen(bufp); timeStamp = ctime(&rsTime); timeStamp[24] = 0; - (void) sprintf(bufp, "\nNumber of restarts since %s is %d\n", timeStamp, rsCount); - bufp += strlen(bufp); + (void)sprintf(bufp, "\nNumber of restarts since %s is %d\n", timeStamp, + rsCount); + bufp += strlen(bufp); if (procStartTime) { timeStamp = ctime(&procStartTime); timeStamp[24] = 0; - (void) sprintf(bufp, "Number of process restarts since the process started %s is %d\n", timeStamp, procStarts); + (void)sprintf(bufp, + "Number of process restarts since the process started %s is %d\n", + timeStamp, procStarts); } - bufp += strlen(bufp); + bufp += strlen(bufp); if (lastAnyExit) { timeStamp = ctime(&lastAnyExit); timeStamp[24] = 0; - (void) sprintf(bufp, "Last time process exited for any reason: %s\n", timeStamp); + (void)sprintf(bufp, "Last time process exited for any reason: %s\n", + timeStamp); } - bufp += strlen(bufp); + bufp += strlen(bufp); if (lastErrorExit) { timeStamp = ctime(&lastErrorExit); timeStamp[24] = 0; - (void) sprintf(bufp, "Last time process exited unexpectedly: %s\n", timeStamp); + (void)sprintf(bufp, "Last time process exited unexpectedly: %s\n", + timeStamp); } - bufp += strlen(bufp); - (void) sprintf(bufp, "Last exit return code %d\n", errorCode); - bufp += strlen(bufp); - (void) sprintf(bufp, "Last process terminating signal %d\n", errorSignal); - bufp += strlen(bufp); + bufp += strlen(bufp); + (void)sprintf(bufp, "Last exit return code %d\n", errorCode); + bufp += strlen(bufp); + (void)sprintf(bufp, "Last process terminating signal %d\n", errorSignal); + bufp += strlen(bufp); #ifdef notdef - if (strcmp(lastErrorName, "(null)")) lastE = 1; + if (strcmp(lastErrorName, "(null)")) + lastE = 1; if (lastE) { - (void) sprintf(bufp, "Short name of process that failed last in this bnode is: %s\n", lastErrorName); - bufp += strlen(bufp); + (void)sprintf(bufp, + "Short name of process that failed last in this bnode is: %s\n", + lastErrorName); + bufp += strlen(bufp); } #endif - (void) sprintf(bufp, "The server is now %srunning\n", (goal?"":"not ")); - bufp += strlen(bufp); - len =(int)(bufp-bufp1); + (void)sprintf(bufp, "The server is now %srunning\n", + (goal ? "" : "not ")); + bufp += strlen(bufp); + len = (int)(bufp - bufp1); if (write(fd, bufp1, len) < 0) { perror("Write"); exit(1); diff --git a/src/bozo/test/Makefile.in b/src/bozo/test/Makefile.in index 4350da0e6..512e25b6e 100644 --- a/src/bozo/test/Makefile.in +++ b/src/bozo/test/Makefile.in @@ -5,26 +5,8 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html -DEST=@DEST@ -TOP_INCDIR=@TOP_INCDIR@ -TOP_LIBDIR=@TOP_LIBDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -libdir=@libdir@ -includedir=@includedir@ -mandir=@mandir@ -afssrvbindir=@afssrvbindir@ -afssrvsbindir=@afssrvsbindir@ -afssrvlibexecdir=@afssrvlibexecdir@ -COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et -RXGEN=${TOP_SRCDIR}/rxgen/rxgen -TOP_SRCDIR=@TOP_SRCDIR@ -SYS_NAME=@AFS_SYSNAME@ - -OPTIMIZE=-O +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config INCDIRS=-I${TOP_INCDIR} -I.. LDIRS=-L${TOP_LIBDIR} -L${DESTDIR}/lib/afs -L.. diff --git a/src/bozo/test/testproc.c b/src/bozo/test/testproc.c index ffe6f8dc5..b5eff7536 100644 --- a/src/bozo/test/testproc.c +++ b/src/bozo/test/testproc.c @@ -10,18 +10,21 @@ #include #include -static int ignore=0; +static int ignore = 0; static int sleepTime = 10; -sigproc() { +sigproc() +{ printf("testproc received signal\n"); - if (ignore) return 0; + if (ignore) + return 0; exit(0); } main(argc, argv) -int argc; -char **argv; { + int argc; + char **argv; +{ register int i; #ifdef AFS_AIX31_ENV @@ -32,7 +35,7 @@ char **argv; { * generated which, in many cases, isn't too useful. */ struct sigaction nsa; - + sigemptyset(&nsa.sa_mask); nsa.sa_handler = SIG_DFL; nsa.sa_flags = SA_FULLDUMP; @@ -40,15 +43,13 @@ char **argv; { #endif signal(SIGTERM, sigproc); signal(SIGQUIT, sigproc); - for(i=1;i sleep N seconds before exiting\n"); diff --git a/src/bu_utils/Makefile.in b/src/bu_utils/Makefile.in index c414aaf3c..afe22bffc 100644 --- a/src/bu_utils/Makefile.in +++ b/src/bu_utils/Makefile.in @@ -5,31 +5,8 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html -DEST=@DEST@ -TOP_INCDIR=@TOP_INCDIR@ -TOP_LIBDIR=@TOP_LIBDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -libdir=@libdir@ -includedir=@includedir@ -mandir=@mandir@ -afssrvbindir=@afssrvbindir@ -afssrvsbindir=@afssrvsbindir@ -afssrvlibexecdir=@afssrvlibexecdir@ -COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et -RXGEN=${TOP_SRCDIR}/rxgen/rxgen -TOP_SRCDIR=@TOP_SRCDIR@ -SYS_NAME=@AFS_SYSNAME@ - -SHELL = /bin/sh - -include ../config/Makefile.${SYS_NAME} - -CFLAGS=${DBG} -w -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR}/afs ${XCFLAGS} -LDFLAGS = ${XLDFLAGS} +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config all: fms @@ -53,6 +30,7 @@ clean: $(RM) -f *.o fms AFS_component_version_number.c include ../config/Makefile.version + ${DESTDIR}${sbindir}/fms: fms ${INSTALL} $? $@ diff --git a/src/bu_utils/NTMakefile b/src/bu_utils/NTMakefile index edc4c0e34..51f23b7ae 100644 --- a/src/bu_utils/NTMakefile +++ b/src/bu_utils/NTMakefile @@ -5,18 +5,18 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=bu_utils !INCLUDE ..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\config\NTMakefile.version - ############################################################################ # build fms.exe EXEFILE = $(DESTDIR)\etc\fms.exe EXEOBJS =\ - fms.obj \ - fms.res + $(OUT)\fms.obj \ + $(OUT)\fms.res EXELIBS =\ $(DESTDIR)\lib\afs\afscmd.lib \ @@ -32,8 +32,7 @@ $(EXEFILE): $(EXEOBJS) $(EXELIBS) ############################################################################ # Definitions for generating versioninfo resources -fms.res: fms.rc AFS_component_version_number.h - $(RC) $*.rc +$(OUT)\fms.res: AFS_component_version_number.h ############################################################################ # Install target; primary makefile target @@ -46,3 +45,5 @@ install: $(LIBFILE) $(DLLFILE) $(EXEFILE) $(INCFILES) clean:: +mkdir: + diff --git a/src/bu_utils/fms.c b/src/bu_utils/fms.c index e9d6af944..0c14ba1b5 100644 --- a/src/bu_utils/fms.c +++ b/src/bu_utils/fms.c @@ -10,26 +10,26 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bu_utils/fms.c,v 1.1.1.5 2001/09/11 14:31:30 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bu_utils/fms.c,v 1.7 2003/07/15 23:14:44 shadow Exp $"); #undef IN #include #include -#include /* for mtio.h */ +#include /* for mtio.h */ #include #include #include /* structure for writing data to tape */ -typedef struct tapeDataBuffer -{ - struct tapeDataBuffer *tdb_next; - char *tdb_buffer; +typedef struct tapeDataBuffer { + struct tapeDataBuffer *tdb_next; + char *tdb_buffer; } tapeDataBufferT; typedef tapeDataBufferT *tapeDataBufferP; /* globals */ -char *tapeDevice = 0; /* device pathname */ +char *tapeDevice = 0; /* device pathname */ afs_int32 eotEnabled = 1; /* prototypes */ @@ -52,7 +52,7 @@ void tt_fileMarkSize(struct cmd_syndesc *as, char *arock); void quitFms(int); main(argc, argv) - int argc; + int argc; char **argv; { struct sigaction intaction, oldaction; @@ -63,14 +63,16 @@ main(argc, argv) sigaction(SIGINT, &intaction, &oldaction); - cptr = cmd_CreateSyntax((char *) 0, tt_fileMarkSize, 0, - "write a tape full of file marks"); + cptr = + cmd_CreateSyntax(NULL, tt_fileMarkSize, 0, + "write a tape full of file marks"); cmd_AddParm(cptr, "-tape", CMD_SINGLE, CMD_REQUIRED, "tape special file"); cmd_Dispatch(argc, argv); } -void tt_fileMarkSize(as, arock) +void +tt_fileMarkSize(as, arock) struct cmd_syndesc *as; char *arock; { @@ -86,7 +88,7 @@ fileMarkSize(tapeDevice) char *tapeDevice; { afs_uint32 nFileMarks, nBlocks, nbfTape; - double tpSize, fmSize; + double tpSize, fmSize; afs_uint32 bufferSize = 16384; usd_handle_t hTape; FILE *logFile; @@ -96,18 +98,16 @@ fileMarkSize(tapeDevice) afs_int32 rewindTape(); - code = usd_Open(tapeDevice, - (USD_OPEN_RDWR | USD_OPEN_WLOCK), 0777, &hTape); - if ( code ) - { + code = + usd_Open(tapeDevice, (USD_OPEN_RDWR | USD_OPEN_WLOCK), 0777, &hTape); + if (code) { printf("Can't open tape device %s\n", tapeDevice); fflush(stdout); exit(1); } logFile = fopen("fms.log", "w+"); - if ( logFile == NULL ) - { + if (logFile == NULL) { printf("Can't open log file\n"); fflush(stdout); exit(1); @@ -116,8 +116,7 @@ fileMarkSize(tapeDevice) fflush(logFile); code = rewindTape(hTape); - if ( code ) - { + if (code) { fprintf(logFile, "Can't rewind tape\n"); fflush(logFile); ERROR(code); @@ -125,18 +124,16 @@ fileMarkSize(tapeDevice) /* measure capacity of tape */ nbfTape = 0; - countr = 0; - while ( 1 ) - { + countr = 0; + while (1) { code = dataBlock(hTape, bufferSize); nbfTape++; count++; - countr++; - if ( code ) + countr++; + if (code) break; - if ( count >= 5 ) - { + if (count >= 5) { count = 0; printf("\rwrote block: %d", nbfTape); } @@ -149,17 +146,15 @@ fileMarkSize(tapeDevice) printf("Finished data capacity test - rewinding\n"); /* reset the tape device */ code = USD_CLOSE(hTape); - if (code) - { + if (code) { fprintf(logFile, "Can't close tape device at end of pass 1\n"); fflush(logFile); printf("Can't close tape device %s\n", tapeDevice); goto error_exit; } - code = usd_Open(tapeDevice, - (USD_OPEN_RDWR | USD_OPEN_WLOCK), 0777, &hTape); - if ( code ) - { + code = + usd_Open(tapeDevice, (USD_OPEN_RDWR | USD_OPEN_WLOCK), 0777, &hTape); + if (code) { fprintf(logFile, "Can't open tape device for pass 2\n"); fflush(logFile); printf("Can't open tape device %s\n", tapeDevice); @@ -167,8 +162,7 @@ fileMarkSize(tapeDevice) } code = rewindTape(hTape); - if ( code ) - { + if (code) { fprintf(logFile, "Can't rewind tape\n"); fflush(logFile); ERROR(code); @@ -176,45 +170,45 @@ fileMarkSize(tapeDevice) /* now measure file mark size */ nFileMarks = 0; - nBlocks = 0; - count = 0; - countr = 0; - while ( 1 ) - { + nBlocks = 0; + count = 0; + countr = 0; + while (1) { code = dataBlock(hTape, bufferSize); nBlocks++; - if ( code ) + if (code) break; code = fileMark(hTape); nFileMarks++; - if ( code ) + if (code) break; count++; - countr++; + countr++; - if ( count >= 2 ) - { + if (count >= 2) { count = 0; - printf("\rwrote %d blocks, %d filemarks", - nBlocks, nFileMarks); + printf("\rwrote %d blocks, %d filemarks", nBlocks, nFileMarks); } } printf("\nFinished filemark test\n"); - tpSize = (double)nbfTape*(double)bufferSize; - fmSize = (((double)nbfTape - (double)nBlocks)*(double)bufferSize)/(double)nFileMarks; + tpSize = (double)nbfTape *(double)bufferSize; + fmSize = + (((double)nbfTape - + (double)nBlocks) * (double)bufferSize) / (double)nFileMarks; printf("Tape capacity is %.0f bytes\n", tpSize); - printf("File marks are %.0f bytes\n", fmSize); + printf("File marks are %.0f bytes\n", fmSize); fprintf(logFile, "Tape capacity is %.0f bytes\n", tpSize); - fprintf(logFile, "File marks are %.0f bytes\n", fmSize); + fprintf(logFile, "File marks are %.0f bytes\n", fmSize); fflush(logFile); fclose(logFile); -error_exit: + error_exit: USD_CLOSE(hTape); - return(code); + return (code); } -void quitFms(int sig) +void +quitFms(int sig) { exit(0); } @@ -229,25 +223,26 @@ void quitFms(int sig) afs_int32 rewindTape(usd_handle_t hTape) { - usd_tapeop_t tapeop; - int rcode; + usd_tapeop_t tapeop; + int rcode; - tapeop.tp_op = USDTAPE_REW; - tapeop.tp_count = 1; - rcode = USD_IOCTL(hTape, USD_IOCTL_TAPEOPERATION, (void *)&tapeop); - return rcode; + tapeop.tp_op = USDTAPE_REW; + tapeop.tp_count = 1; + rcode = USD_IOCTL(hTape, USD_IOCTL_TAPEOPERATION, (void *)&tapeop); + return rcode; } /* write an EOF marker */ -int fileMark(usd_handle_t hTape) +int +fileMark(usd_handle_t hTape) { - usd_tapeop_t tapeop; - int rcode; + usd_tapeop_t tapeop; + int rcode; - tapeop.tp_op = USDTAPE_WEOF; - tapeop.tp_count = 1; - rcode = USD_IOCTL(hTape, USD_IOCTL_TAPEOPERATION, (void *)&tapeop); - return rcode; + tapeop.tp_op = USDTAPE_WEOF; + tapeop.tp_count = 1; + rcode = USD_IOCTL(hTape, USD_IOCTL_TAPEOPERATION, (void *)&tapeop); + return rcode; } /* dataBlock @@ -266,37 +261,28 @@ dataBlock(usd_handle_t hTape, afs_int32 reqSize) /* dbBuffersize is only valid when dB_buffer is non-zero */ - if ( (dB_buffer != 0) - && (dB_buffersize != reqSize ) - ) - { + if ((dB_buffer != 0) + && (dB_buffersize != reqSize) + ) { free(dB_buffer); dB_buffer = 0; } - if (dB_buffer == 0 ) - { - dB_buffer = (char *) malloc(reqSize); - if ( dB_buffer == 0 ) + if (dB_buffer == 0) { + dB_buffer = (char *)malloc(reqSize); + if (dB_buffer == 0) ERROR(-1); dB_buffersize = reqSize; memset(dB_buffer, 0, dB_buffersize); } - ptr = (int *) dB_buffer; + ptr = (int *)dB_buffer; *ptr = dB_count++; code = USD_WRITE(hTape, dB_buffer, dB_buffersize, &xferd); if (code || xferd != dB_buffersize) ERROR(-1); -error_exit: - return(code); + error_exit: + return (code); } - - - - - - - diff --git a/src/bubasics/Makefile.in b/src/bubasics/Makefile.in index 0420d732a..77eec29d7 100644 --- a/src/bubasics/Makefile.in +++ b/src/bubasics/Makefile.in @@ -5,31 +5,8 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html -DEST=@DEST@ -TOP_INCDIR=@TOP_INCDIR@ -TOP_LIBDIR=@TOP_LIBDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -libdir=@libdir@ -includedir=@includedir@ -mandir=@mandir@ -afssrvbindir=@afssrvbindir@ -afssrvsbindir=@afssrvsbindir@ -afssrvlibexecdir=@afssrvlibexecdir@ -TOP_SRCDIR=@TOP_SRCDIR@ -SYS_NAME=@AFS_SYSNAME@ - -SHELL = /bin/sh - -include ../config/Makefile.${SYS_NAME} - -RXGEN=${TOP_SRCDIR}/rxgen/rxgen -COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et - -CFLAGS=${DBUG} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config all: ${TOP_LIBDIR}/libbubasics.a ${TOP_INCDIR}/afs/bumon.h ${TOP_INCDIR}/afs/butc.h ${TOP_INCDIR}/afs/bubasics.h ${TOP_INCDIR}/afs/tcdata.h ${TOP_INCDIR}/afs/butm.h ${TOP_INCDIR}/afs/butx.h @@ -40,23 +17,49 @@ libbubasics.a: $(OBJS) AFS_component_version_number.o ar r libbubasics.a ${OBJS} AFS_component_version_number.o ${RANLIB} libbubasics.a -butc.xdr.c butc.ss.c butc.cs.c butc.h: butc.xg - ${RXGEN} butc.xg +butc.xdr.c: butc.xg + ${RXGEN} -c -o $@ ${srcdir}/butc.xg -bumon.xdr.c bumon.ss.c bumon.cs.c bumon.h: bumon.xg - ${RXGEN} bumon.xg +butc.ss.c: butc.xg + ${RXGEN} -S -o $@ ${srcdir}/butc.xg + +butc.cs.c: butc.xg + ${RXGEN} -C -o $@ ${srcdir}/butc.xg + +butc.h: butc.xg + ${RXGEN} -h -o $@ ${srcdir}/butc.xg + +butc.xdr.c: butc.h +butc.cs.c: butc.h +butc.ss.c: butc.h + +bumon.xdr.c: bumon.xg + ${RXGEN} -c -o $@ ${srcdir}/bumon.xg + +bumon.ss.c: bumon.xg + ${RXGEN} -S -o $@ ${srcdir}/bumon.xg + +bumon.cs.c: bumon.xg + ${RXGEN} -C -o $@ ${srcdir}/bumon.xg + +bumon.h: bumon.xg + ${RXGEN} -h -o $@ ${srcdir}/bumon.xg + +bumon.xdr.c: bumon.h +bumon.ss.c: bumon.h +bumon.cs.c: bumon.h butm_errs.c butm.h: butm_errs.et butm.p.h $(RM) -f butm.h butm_errs.c - ${COMPILE_ET} butm_errs -h butm + ${COMPILE_ET} -p ${srcdir} butm_errs -h butm butc_errs.c tcdata.h: butc_errs.et tcdata.p.h butm.h $(RM) -f tcdata.h butc_errs.c - ${COMPILE_ET} butc_errs -h tcdata + ${COMPILE_ET} -p ${srcdir} butc_errs -h tcdata butx_errs.c butx.h: butx_errs.et $(RM) -f butx.h butx_errs.c - ${COMPILE_ET} butx_errs -h butx + ${COMPILE_ET} -p ${srcdir} butx_errs -h butx # # Installation targets diff --git a/src/bubasics/NTMakefile b/src/bubasics/NTMakefile index 05db2b8a6..a296ad0a9 100644 --- a/src/bubasics/NTMakefile +++ b/src/bubasics/NTMakefile @@ -5,10 +5,10 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=bubasics !INCLUDE ..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\config\NTMakefile.version - ############################################################################ # Install headers @@ -29,16 +29,16 @@ INCFILES =\ LIBFILE = $(DESTDIR)\lib\afs\afsbubasics.lib LIBOBJS =\ - butc.ss.obj \ - butc.cs.obj \ - butc.xdr.obj \ - bumon.ss.obj \ - bumon.cs.obj \ - bumon.xdr.obj \ - butc_errs.obj \ - butm_errs.obj \ - butx_errs.obj \ - AFS_component_version_number.obj + $(OUT)\butc.ss.obj \ + $(OUT)\butc.cs.obj \ + $(OUT)\butc.xdr.obj \ + $(OUT)\bumon.ss.obj \ + $(OUT)\bumon.cs.obj \ + $(OUT)\bumon.xdr.obj \ + $(OUT)\butc_errs.obj \ + $(OUT)\butm_errs.obj \ + $(OUT)\butx_errs.obj \ + $(OUT)\AFS_component_version_number.obj $(LIBFILE): $(LIBOBJS) $(LIBARCH) @@ -81,4 +81,5 @@ clean:: $(DEL) *.xdr.c *.ss.c *.cs.c butc.h bumon.h butm.h tcdata.h butx.h \ butc_errs.c butm_errs.c butx_errs.c - +mkdir: + diff --git a/src/bubasics/bubasics.h b/src/bubasics/bubasics.h index 74ef32fff..8fbd5949f 100644 --- a/src/bubasics/bubasics.h +++ b/src/bubasics/bubasics.h @@ -25,17 +25,17 @@ * These are not version flags as the name suggests. */ -#define BUTM_VERSIONFLAG_0 0 /* every size measure is in bytes */ -#define BUTM_VERSIONFLAG_1 1 /* every size measure is in kbytes */ -#define BUTM_VERSIONFLAG_2 2 /* afs 3.1 features */ +#define BUTM_VERSIONFLAG_0 0 /* every size measure is in bytes */ +#define BUTM_VERSIONFLAG_1 1 /* every size measure is in kbytes */ +#define BUTM_VERSIONFLAG_2 2 /* afs 3.1 features */ /* current version of the interface */ #define BUTM_MAJORVERSION BUTM_VERSIONFLAG_2 /* versions for the bucoord <-> butc interface */ -#define BUTC_VERSION_1 1 /* initial version, afs 3.1 */ -#define BUTC_VERSION_2 2 /* 3.4 version - added voltype to tc_dumpDesc */ -#define BUTC_VERSION_3 3 /* 3.4 version - labeltape change */ +#define BUTC_VERSION_1 1 /* initial version, afs 3.1 */ +#define BUTC_VERSION_2 2 /* 3.4 version - added voltype to tc_dumpDesc */ +#define BUTC_VERSION_3 3 /* 3.4 version - labeltape change */ #define CUR_BUTC_VERSION BUTC_VERSION_3 /* TAPE_VERSION Version of the current tape format used by butc @@ -60,13 +60,13 @@ #define TAPE_VERSION_4 4 #define CUR_TAPE_VERSION TAPE_VERSION_4 -#define BC_SCHEDULE_MAGIC 0x74327285 /* magic # for schedules */ -#define BC_SCHEDULE_V3_1 1 /* afs 3.1 */ -#define BC_SCHEDULE_VERSION BC_SCHEDULE_V3_1 /* current version */ +#define BC_SCHEDULE_MAGIC 0x74327285 /* magic # for schedules */ +#define BC_SCHEDULE_V3_1 1 /* afs 3.1 */ +#define BC_SCHEDULE_VERSION BC_SCHEDULE_V3_1 /* current version */ -#define BC_DUMPDB_MAGIC 0x10381645 /* magic # for dump db */ -#define BC_DUMPDB_V3_1 1 /* afs 3.1 */ -#define BC_DUMPDB_VERSION BC_DUMPDB_V3_1 /* current version */ +#define BC_DUMPDB_MAGIC 0x10381645 /* magic # for dump db */ +#define BC_DUMPDB_V3_1 1 /* afs 3.1 */ +#define BC_DUMPDB_VERSION BC_DUMPDB_V3_1 /* current version */ /* define ports that move to system configuration later */ #define BC_MESSAGEPORT 7020 /* for communicating with backup coordinator */ @@ -75,11 +75,11 @@ #ifndef AFSCONF_BUDBPORT #define AFSCONF_BUDBPORT 7021 /* for communicating with backup database */ #endif -#define BUDB_SERVICE 22314 /* service id */ +#define BUDB_SERVICE 22314 /* service id */ -#define RX_SCINDEX_NULL 0 /* No security */ -#define RX_SCINDEX_VAB 1 /* vice tokens, with bcrypt */ -#define RX_SCINDEX_KAD 2 /* Kerberos/DES */ +#define RX_SCINDEX_NULL 0 /* No security */ +#define RX_SCINDEX_VAB 1 /* vice tokens, with bcrypt */ +#define RX_SCINDEX_KAD 2 /* Kerberos/DES */ /* maximums for various text strings * DON'T alter these values until all disk/tape structures can be handled @@ -87,30 +87,30 @@ */ /* dump states */ -#define DUMP_FAILED 1 /* outright failed */ -#define DUMP_PARTIAL 2 /* partial on tape */ -#define DUMP_SUCCESS 3 /* all ok */ -#define DUMP_RETRY 4 /* failed, but retry */ -#define DUMP_NORETRYEOT 5 /* failed, and don't retry */ -#define DUMP_NOTHING 6 /* Nothing was dumped */ -#define DUMP_NODUMP 7 /* don't dump, and don't retry */ - - -#define BU_MAXNAMELEN 32 /* max for misc. names: eg volumes */ -#define BU_MAXTAPELEN 32 /* for tape names */ -#define BU_MAXHOSTLEN 32 /* for server (machine) names */ -#define BU_MAXTOKENLEN 16 /* identifiers */ -#define BU_MAXUNAMELEN 256 /* length of a user name */ -#define BU_MAXCELLLEN 256 /* length of a cell name */ +#define DUMP_FAILED 1 /* outright failed */ +#define DUMP_PARTIAL 2 /* partial on tape */ +#define DUMP_SUCCESS 3 /* all ok */ +#define DUMP_RETRY 4 /* failed, but retry */ +#define DUMP_NORETRYEOT 5 /* failed, and don't retry */ +#define DUMP_NOTHING 6 /* Nothing was dumped */ +#define DUMP_NODUMP 7 /* don't dump, and don't retry */ + + +#define BU_MAXNAMELEN 32 /* max for misc. names: eg volumes */ +#define BU_MAXTAPELEN 32 /* for tape names */ +#define BU_MAXHOSTLEN 32 /* for server (machine) names */ +#define BU_MAXTOKENLEN 16 /* identifiers */ +#define BU_MAXUNAMELEN 256 /* length of a user name */ +#define BU_MAXCELLLEN 256 /* length of a cell name */ /* proposed maximum name lengths PA */ -#define BU_MAX_NAME 64 /* misc. names */ -#define BU_MAX_DUMP_PATH 256 /* length of schedule path name */ +#define BU_MAX_NAME 64 /* misc. names */ +#define BU_MAX_DUMP_PATH 256 /* length of schedule path name */ #define BC_MAXPORTOFFSET 58510 /* max number of port offsets in database */ #ifndef NEVERDATE -#define NEVERDATE 037777777777 /* a date that will never come */ +#define NEVERDATE 037777777777 /* a date that will never come */ #endif #ifndef NEVERSTRING #define NEVERSTRING "NEVER \n" @@ -121,7 +121,7 @@ #define Date afs_uint32 #endif -#define DUMP_TAPE_NAME "Ubik_db_dump" /* base database tape name */ +#define DUMP_TAPE_NAME "Ubik_db_dump" /* base database tape name */ /* for expiration date processing */ #define BC_NO_EXPDATE 0 /* no expiration date */ @@ -133,16 +133,15 @@ sprintf (name, (set)->format, (seq) + (set)->b) /* common structure definitions */ -struct dlqlink -{ - struct dlqlink *dlq_next; - struct dlqlink *dlq_prev; - afs_int32 dlq_type; - char * dlq_structPtr; /* enclosing structure */ +struct dlqlink { + struct dlqlink *dlq_next; + struct dlqlink *dlq_prev; + afs_int32 dlq_type; + char *dlq_structPtr; /* enclosing structure */ }; -typedef struct dlqlink dlqlinkT; -typedef dlqlinkT *dlqlinkP; +typedef struct dlqlink dlqlinkT; +typedef dlqlinkT *dlqlinkP; /* invariants */ @@ -179,49 +178,48 @@ extern dlqlinkP dlqUnlinkf(); * S - server side only * B - client or server */ - -#define STARTING 0x1 /* C; still setting up, no server task yet */ + +#define STARTING 0x1 /* C; still setting up, no server task yet */ #define ABORT_REQUEST 0x2 /* B; user requested abort */ -#define ABORT_SENT 0x4 /* C; abort sent to server (REQ cleared) */ +#define ABORT_SENT 0x4 /* C; abort sent to server (REQ cleared) */ #define ABORT_DONE 0x8 /* S; abort complete on server */ #define ABORT_LOCAL 0x10 /* C; abort local task if contact lost */ -#define TASK_DONE 0x20 /* B; task complete */ +#define TASK_DONE 0x20 /* B; task complete */ #define SILENT 0x400 /* C; don't be verbose about termination */ #define NOREMOVE 0x1000 /* C; don't remove from queue */ /* comm status */ -#define CONTACT_LOST 0x40 /* B; contact lost */ +#define CONTACT_LOST 0x40 /* B; contact lost */ /* errror handling */ -#define TASK_ERROR 0x80 /* S; had fatal error, will terminate */ +#define TASK_ERROR 0x80 /* S; had fatal error, will terminate */ /* general status - copied back to client for jobs status */ #define DRIVE_WAIT 0x100 /* S; waiting for drive to become free */ #define OPR_WAIT 0x200 /* S; waiting for operator action */ -#define CALL_WAIT 0x800 /* S; waiting for callout routine completion */ +#define CALL_WAIT 0x800 /* S; waiting for callout routine completion */ -struct statusS -{ - dlqlinkT link; +struct statusS { + dlqlinkT link; - afs_uint32 taskId; /* task identifier */ - afs_uint32 dbDumpId; /* dump id */ - afs_uint32 flags; /* as above */ - afs_uint32 nKBytes; /* bytes xferred */ - char volumeName[BU_MAXNAMELEN]; /* current volume (if any) */ - afs_int32 volsFailed; /* # operation failures */ - afs_int32 lastPolled; /* last successful poll */ + afs_uint32 taskId; /* task identifier */ + afs_uint32 dbDumpId; /* dump id */ + afs_uint32 flags; /* as above */ + afs_uint32 nKBytes; /* bytes xferred */ + char volumeName[BU_MAXNAMELEN]; /* current volume (if any) */ + afs_int32 volsFailed; /* # operation failures */ + afs_int32 lastPolled; /* last successful poll */ /* bucoord local */ - char taskName[64]; /* type of task */ - afs_int32 port; - afs_int32 jobNumber; - afs_int32 volsTotal; /* total # vols */ - afs_int32 scheduledDump; /* Time this dump was scheduled */ - char *cmdLine; /* Command to exectute for this dump */ + char taskName[64]; /* type of task */ + afs_int32 port; + afs_int32 jobNumber; + afs_int32 volsTotal; /* total # vols */ + afs_int32 scheduledDump; /* Time this dump was scheduled */ + char *cmdLine; /* Command to exectute for this dump */ }; -typedef struct statusS statusT; -typedef statusT *statusP; +typedef struct statusS statusT; +typedef statusT *statusP; #endif diff --git a/src/bubasics/butm.p.h b/src/bubasics/butm.p.h index 4106d9f37..cd4475375 100644 --- a/src/bubasics/butm.p.h +++ b/src/bubasics/butm.p.h @@ -11,8 +11,8 @@ #include struct blockMark { - int count; /* actual number of bytes valid in the block */ - afs_int32 magic; + int count; /* actual number of bytes valid in the block */ + afs_int32 magic; afs_int32 spare1; afs_int32 spare2; afs_int32 spare3; @@ -21,60 +21,60 @@ struct blockMark { /* The size of a tapeblock is 16KB: contains header info and data */ #define BUTM_BLOCKSIZE 16384 -#define BUTM_HDRSIZE ((5*sizeof(afs_int32)) + sizeof(int)) /* sizeof blockMark */ +#define BUTM_HDRSIZE ((5*sizeof(afs_int32)) + sizeof(int)) /* sizeof blockMark */ #define BUTM_BLKSIZE (BUTM_BLOCKSIZE - BUTM_HDRSIZE) struct butm_tapeInfo { - afs_int32 structVersion; + afs_int32 structVersion; struct { - afs_int32 (*mount)(); - afs_int32 (*dismount)(); - afs_int32 (*create)(); - afs_int32 (*readLabel)(); - afs_int32 (*seek)(); - afs_int32 (*seekEODump)(); - afs_int32 (*readFileBegin)(); - afs_int32 (*readFileData)(); - afs_int32 (*readFileEnd)(); - afs_int32 (*writeFileBegin)(); - afs_int32 (*writeFileData)(); - afs_int32 (*writeFileEnd)(); - afs_int32 (*writeEOT)(); - afs_int32 (*setSize)(); - afs_int32 (*getSize)(); + afs_int32(*mount) (); + afs_int32(*dismount) (); + afs_int32(*create) (); + afs_int32(*readLabel) (); + afs_int32(*seek) (); + afs_int32(*seekEODump) (); + afs_int32(*readFileBegin) (); + afs_int32(*readFileData) (); + afs_int32(*readFileEnd) (); + afs_int32(*writeFileBegin) (); + afs_int32(*writeFileData) (); + afs_int32(*writeFileEnd) (); + afs_int32(*writeEOT) (); + afs_int32(*setSize) (); + afs_int32(*getSize) (); } ops; - char name[BU_MAXTAPELEN]; - afs_int32 position; /* current position of tape */ - afs_uint32 posCount; /* position in bytes of the tape */ + char name[BU_MAXTAPELEN]; + afs_int32 position; /* current position of tape */ + afs_uint32 posCount; /* position in bytes of the tape */ /* the next three fields are used for modeling tape usage */ - afs_uint32 nBytes; /* number of bytes written */ - afs_uint32 kBytes; /* number of Kbytes written */ - afs_int32 nRecords; /* number of records written */ - afs_int32 nFiles; /* number of files written */ + afs_uint32 nBytes; /* number of bytes written */ + afs_uint32 kBytes; /* number of Kbytes written */ + afs_int32 nRecords; /* number of records written */ + afs_int32 nFiles; /* number of files written */ /* These fields provide the coefficients for the above variables */ - afs_int32 recordSize; /* bytes per record */ - afs_uint32 tapeSize; /* length of tape */ - afs_int32 coefBytes; /* length multiplier for bytes */ - afs_int32 coefRecords; /* ditto records */ - afs_int32 coefFiles; /* ditto files */ - int simultaneousTapes; /* number of tapes mounted simultaneously */ - int status; /* status of tape */ - int flags; /* e.g. read-only, sequential */ - char *tcRock; /* for random tape coordinator storage */ - char *tmRock; /* for random tape module storage */ - afs_int32 sizeflags; /* What the units of tape size are. */ - - afs_int32 debug; /* print debugging info */ - afs_int32 error; /* Error code from butm module */ - afs_int32 spare[8]; + afs_int32 recordSize; /* bytes per record */ + afs_uint32 tapeSize; /* length of tape */ + afs_int32 coefBytes; /* length multiplier for bytes */ + afs_int32 coefRecords; /* ditto records */ + afs_int32 coefFiles; /* ditto files */ + int simultaneousTapes; /* number of tapes mounted simultaneously */ + int status; /* status of tape */ + int flags; /* e.g. read-only, sequential */ + char *tcRock; /* for random tape coordinator storage */ + char *tmRock; /* for random tape module storage */ + afs_int32 sizeflags; /* What the units of tape size are. */ + + afs_int32 debug; /* print debugging info */ + afs_int32 error; /* Error code from butm module */ + afs_int32 spare[8]; }; -struct tapeConfig{ +struct tapeConfig { char device[256]; afs_uint32 capacity; - afs_int32 fileMarkSize; /* size of file marks, in bytes */ + afs_int32 fileMarkSize; /* size of file marks, in bytes */ afs_int32 portOffset; }; @@ -89,24 +89,24 @@ struct tapeConfig{ #define BUTM_STATUS_WRITEERROR (1<<2) /* tape error during write */ #define BUTM_STATUS_READERROR (1<<3) /* tape error during read */ #define BUTM_STATUS_SEEKERROR (1<<4) /* tape error during positioning */ -#define BUTM_STATUS_EOF (1<<5) /* tape at EOF */ -#define BUTM_STATUS_EOD (1<<6) /* end of tape reached */ +#define BUTM_STATUS_EOF (1<<5) /* tape at EOF */ +#define BUTM_STATUS_EOD (1<<6) /* end of tape reached */ #define BUTM_FLAGS_READONLY (1<<0) /* tape mounted read-only */ #define BUTM_FLAGS_SEQUENTIAL (1<<1) /* tape is sequential access: sort positions */ struct butm_tapeLabel { - afs_int32 structVersion; /* structure version number */ - Date creationTime; /* when tape was first labeled */ - Date expirationDate; /* when tape can be relabelled */ + afs_int32 structVersion; /* structure version number */ + Date creationTime; /* when tape was first labeled */ + Date expirationDate; /* when tape can be relabelled */ char AFSName[BU_MAXTAPELEN]; /* AFS assigned tape name */ struct ktc_principal creator; /* person creating tape */ - char cell[BU_MAXCELLLEN]; /* cell which owns tape. */ - afs_uint32 dumpid; /* which dump on this tape */ - afs_int32 useCount; /* # times written */ - afs_int32 spare[8]; + char cell[BU_MAXCELLLEN]; /* cell which owns tape. */ + afs_uint32 dumpid; /* which dump on this tape */ + afs_int32 useCount; /* # times written */ + afs_int32 spare[8]; char comment[96]; - char pName[BU_MAXTAPELEN]; /* permanent user assigned tape name */ + char pName[BU_MAXTAPELEN]; /* permanent user assigned tape name */ afs_uint32 size; char dumpPath[BU_MAX_DUMP_PATH]; /* dump schedule path name */ }; @@ -142,5 +142,3 @@ struct butm_tapeLabel { #define butm_WriteEOT(i) (*((i)->ops.writeEOT))(i) #define butm_SetSize(i,s) (*((i)->ops.setSize))(i,s) #define butm_GetSize(i,s) (*((i)->ops.getSize))(i,s) - - diff --git a/src/bubasics/tcdata.p.h b/src/bubasics/tcdata.p.h index 4cc8f61f4..c5fd013b8 100644 --- a/src/bubasics/tcdata.p.h +++ b/src/bubasics/tcdata.p.h @@ -20,57 +20,56 @@ * G - generated by butc */ -struct dumpNode -{ +struct dumpNode { /* administrative fields */ - afs_int32 taskID; /* the task id */ - struct dumpNode *next; /* ptr to the next node on the list */ - statusP statusNodePtr; /* status node pointer */ + afs_int32 taskID; /* the task id */ + struct dumpNode *next; /* ptr to the next node on the list */ + statusP statusNodePtr; /* status node pointer */ /* common to dumps and restores */ - afs_int32 arraySize; /* Size of dump/restore array */ + afs_int32 arraySize; /* Size of dump/restore array */ /* specific to dumps */ char dumpSetName[TC_MAXNAMELEN]; /* name of the dump "." */ - char *dumpName; /* full dump path */ - char *volumeSetName; /* volume set */ + char *dumpName; /* full dump path */ + char *volumeSetName; /* volume set */ struct tc_tapeSet tapeSetDesc; /* description of the tape set */ - struct tc_dumpDesc *dumps; /* list of vols to dump */ - afs_int32 parent; /* parent dump ID, from main call */ - afs_int32 level; /* this dump's level, from main call */ - int doAppend; /* Append this dump to a dump set */ + struct tc_dumpDesc *dumps; /* list of vols to dump */ + afs_int32 parent; /* parent dump ID, from main call */ + afs_int32 level; /* this dump's level, from main call */ + int doAppend; /* Append this dump to a dump set */ /* restore specific */ - struct tc_restoreDesc *restores; /* info needed to restore volumes*/ + struct tc_restoreDesc *restores; /* info needed to restore volumes */ }; -struct deviceSyncNode{ - struct Lock lock; /* this is used to synchronise access to tape drive */ +struct deviceSyncNode { + struct Lock lock; /* this is used to synchronise access to tape drive */ afs_int32 flags; }; /* flags used to monitor status of dumps/restores */ -#define INPROGRESS 0x01 /*dump is in progress */ -#define ABORT 0x02 /*abort this dump */ -#define ABORTED 0x04 /*aborted this dump */ -#define DONE 0x08 /*done with this dump */ -#define WAITING 0x10 /*someone is waiting on this dump */ -#define ERROR 0x20 /*error in operation */ -#define PARTIAL 0x40 /*partial failure in operation */ +#define INPROGRESS 0x01 /*dump is in progress */ +#define ABORT 0x02 /*abort this dump */ +#define ABORTED 0x04 /*aborted this dump */ +#define DONE 0x08 /*done with this dump */ +#define WAITING 0x10 /*someone is waiting on this dump */ +#define ERROR 0x20 /*error in operation */ +#define PARTIAL 0x40 /*partial failure in operation */ /* define the opcodes */ -#define DUMP 0x01 /*dumping */ -#define RESTORE 0x02 /*restoring */ +#define DUMP 0x01 /*dumping */ +#define RESTORE 0x02 /*restoring */ /*these definitions are temporary */ #define TCPORT 7010 #define TCSERVICE_ID 10 -#define TC_GCTIME 300 /* the interval after which the GC is invoked */ -#define TC_ABORTTIME 30 /*time alotted for process to respond to abort */ -#define TC_MAXVOLNAME 64 /*this should come from VNAMESIZE in volume header*/ +#define TC_GCTIME 300 /* the interval after which the GC is invoked */ +#define TC_ABORTTIME 30 /*time alotted for process to respond to abort */ +#define TC_MAXVOLNAME 64 /*this should come from VNAMESIZE in volume header */ /*define some magic numbers to be used with volume headers and trailors on tape */ -#define TC_VOLBEGINMAGIC 0xb0258191 /*32 bit magic numbers */ +#define TC_VOLBEGINMAGIC 0xb0258191 /*32 bit magic numbers */ #define TC_VOLENDMAGIC 0x9167345a #define TC_VOLCONTD 0xffffffff /* @@ -79,20 +78,20 @@ struct deviceSyncNode{ */ #define TC_TRAILERBEGIN "+=!@#$%><%$#@!=+" /*indicates that trailer follows */ #define TC_MAXTAPENAMELEN 100 /*dont know how to estimate these numbers */ -#define TC_DEVICEINUSE 0x1000 /* used to indicate use of device by somebody */ -#define TC_NULLTAPENAME "" /* default tape name */ -#define TC_QUOTEDNULLTAPENAME "\"\"" /* null tapename in quotes */ +#define TC_DEVICEINUSE 0x1000 /* used to indicate use of device by somebody */ +#define TC_NULLTAPENAME "" /* default tape name */ +#define TC_QUOTEDNULLTAPENAME "\"\"" /* null tapename in quotes */ /* for user prompt generation */ -#define READOPCODE 0 /* read tape - for restore */ -#define WRITEOPCODE 1 /* write tape - for dump */ -#define LABELOPCODE 2 /* label a tape */ -#define READLABELOPCODE 3 /* read tape label */ -#define SCANOPCODE 4 /* scan tape contents */ -#define APPENDOPCODE 5 /* append write tape - for dump */ -#define SAVEDBOPCODE 6 /* save a database tape */ -#define RESTOREDBOPCODE 7 /* restore a database tape */ -#define CLOSEOPCODE 8 /* close a tape drive - for callout */ +#define READOPCODE 0 /* read tape - for restore */ +#define WRITEOPCODE 1 /* write tape - for dump */ +#define LABELOPCODE 2 /* label a tape */ +#define READLABELOPCODE 3 /* read tape label */ +#define SCANOPCODE 4 /* scan tape contents */ +#define APPENDOPCODE 5 /* append write tape - for dump */ +#define SAVEDBOPCODE 6 /* save a database tape */ +#define RESTOREDBOPCODE 7 /* restore a database tape */ +#define CLOSEOPCODE 8 /* close a tape drive - for callout */ /* marker used on tape. A header is placed (as a separate block) before the * volume data, and is appended (contiguously with the data) to the volume @@ -104,51 +103,46 @@ struct volumeHeader { char volumeName[TC_MAXVOLNAME]; char pad[2]; afs_int32 volumeID; - afs_int32 server; /* which server */ - afs_int32 part; /* partition vol. was on */ - afs_int32 from; /* clone date of vol ?? */ + afs_int32 server; /* which server */ + afs_int32 part; /* partition vol. was on */ + afs_int32 from; /* clone date of vol ?? */ int frag; - afs_int32 magic; /* just for checking */ + afs_int32 magic; /* just for checking */ afs_int32 contd; char dumpSetName[TC_MAXNAMELEN]; - afs_int32 dumpID; /* ID of enclosing dump */ - afs_int32 level; /* dump level, 0=full */ - afs_int32 parentID; /* ID of parent dump */ + afs_int32 dumpID; /* ID of enclosing dump */ + afs_int32 level; /* dump level, 0=full */ + afs_int32 parentID; /* ID of parent dump */ afs_int32 endTime; - afs_int32 versionflags; /* previously spare[0] */ - afs_int32 cloneDate; /* when this vol. was cloned */ - afs_int32 spares[2]; /* spare used to be spare[4] */ + afs_int32 versionflags; /* previously spare[0] */ + afs_int32 cloneDate; /* when this vol. was cloned */ + afs_int32 spares[2]; /* spare used to be spare[4] */ }; /* Interface structure for STC_LabelTape */ -struct labelTapeIf -{ +struct labelTapeIf { struct tc_tapeLabel label; afs_uint32 taskId; }; -struct scanTapeIf -{ +struct scanTapeIf { afs_int32 addDbFlag; afs_uint32 taskId; }; /* Interface structure for STC_SaveDb */ -struct saveDbIf -{ - Date archiveTime; - afs_uint32 taskId; +struct saveDbIf { + Date archiveTime; + afs_uint32 taskId; statusP statusPtr; }; /* Iterface structure for STC_DeleteDump */ -struct deleteDumpIf -{ - afs_uint32 dumpID; - afs_uint32 taskId; +struct deleteDumpIf { + afs_uint32 dumpID; + afs_uint32 taskId; }; #endif - diff --git a/src/bucoord/Makefile.in b/src/bucoord/Makefile.in index 55e8c96e2..c40c2d07c 100644 --- a/src/bucoord/Makefile.in +++ b/src/bucoord/Makefile.in @@ -5,32 +5,8 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html -DEST=@DEST@ -TOP_INCDIR=@TOP_INCDIR@ -TOP_LIBDIR=@TOP_LIBDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -libdir=@libdir@ -includedir=@includedir@ -mandir=@mandir@ -afssrvbindir=@afssrvbindir@ -afssrvsbindir=@afssrvsbindir@ -afssrvlibexecdir=@afssrvlibexecdir@ -TOP_SRCDIR=@TOP_SRCDIR@ -SYS_NAME=@AFS_SYSNAME@ - -SHELL = /bin/sh - -include ../config/Makefile.${SYS_NAME} - -COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et -RXGEN=${TOP_SRCDIR}/rxgen/rxgen - -CFLAGS=${DBUG} -w -I${TOP_SRCDIR}/config \ - -I${TOP_INCDIR} -I${TOP_INCDIR}/afs ${XCFLAGS} +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config LIBS=${TOP_LIBDIR}/libbudb.a ${TOP_LIBDIR}/libbubasics.a \ ${TOP_LIBDIR}/libbutm.a ${TOP_LIBDIR}/libvolser.a \ @@ -80,7 +56,7 @@ backup: $(BACKOBJS) ${LIBS} bucoord_errs.c bc.h: bucoord_errs.et bc.p.h $(RM) -f bc.h bucoord_errs.c - ${COMPILE_ET} bucoord_errs -h bc + ${COMPILE_ET} -p ${srcdir} bucoord_errs -h bc # # Install targets diff --git a/src/bucoord/NTMakefile b/src/bucoord/NTMakefile index 68e5fe607..a055a7cb6 100644 --- a/src/bucoord/NTMakefile +++ b/src/bucoord/NTMakefile @@ -5,10 +5,10 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=bucoord !INCLUDE ..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\config\NTMakefile.version - ######################################################################### # install local include file INCFILES = bc.h @@ -19,13 +19,13 @@ INCFILES = bc.h LIBFILE = $(DESTDIR)\lib\afs\afsbxdb.lib LIBOBJS =\ - dsstub.obj \ - ubik_db_if.obj \ - status.obj \ - dlq.obj \ - bucoord_errs.obj \ - volstub.obj \ - AFS_component_version_number.obj + $(OUT)/dsstub.obj \ + $(OUT)/ubik_db_if.obj \ + $(OUT)/status.obj \ + $(OUT)/dlq.obj \ + $(OUT)/bucoord_errs.obj \ + $(OUT)/volstub.obj \ + $(OUT)/AFS_component_version_number.obj $(LIBFILE): $(LIBOBJS) $(LIBARCH) @@ -37,25 +37,31 @@ $(LIBFILE): $(LIBOBJS) EXEFILE = $(DESTDIR)\etc\backup.exe EXEOBJS =\ - main.obj \ - config.obj \ - dsstub.obj \ - volstub.obj \ - commands.obj \ - regex.obj \ - server.obj \ - dsvs.obj \ - dump.obj \ - restore.obj \ - ubik_db_if.obj \ - dump_sched.obj \ - vol_sets.obj \ - tape_hosts.obj \ - bucoord_errs.obj \ - bc_status.obj \ - status.obj \ - dlq.obj \ - backup.res + $(OUT)\main.obj \ + $(OUT)\config.obj \ + $(OUT)\dsstub.obj \ + $(OUT)\volstub.obj \ + $(OUT)\commands.obj \ + $(OUT)\regex.obj \ + $(OUT)\server.obj \ + $(OUT)\dsvs.obj \ + $(OUT)\dump.obj \ + $(OUT)\restore.obj \ + $(OUT)\ubik_db_if.obj \ + $(OUT)\dump_sched.obj \ + $(OUT)\vol_sets.obj \ + $(OUT)\tape_hosts.obj \ + $(OUT)\bucoord_errs.obj \ + $(OUT)\bc_status.obj \ + $(OUT)\status.obj \ + $(OUT)\dlq.obj \ + + +$(OUT)/backup.res:AFS_component_version_number.h + $(RC) backup.rc + +$(EXEOBJS):$$(@B).c + $(C2OBJ) $** EXELIBS =\ $(DESTDIR)\lib\afs\afsbudb.lib \ @@ -98,8 +104,7 @@ bucoord_errs.c bc.h: bucoord_errs.et bc.p.h ############################################################################ # Definitions for generating versioninfo resources -backup.res: backup.rc AFS_component_version_number.h - $(RC) $*.rc +$(OUT)/backup.res: AFS_component_version_number.h ############################################################################ # Install @@ -113,3 +118,6 @@ install: $(INCFILES) $(LIBFILE) $(EXEFILE) clean:: $(DEL) bc.h bucoord_errs.c + +mkdir: + diff --git a/src/bucoord/bc.p.h b/src/bucoord/bc.p.h index 8cc12e5c4..b675fd35c 100644 --- a/src/bucoord/bc.p.h +++ b/src/bucoord/bc.p.h @@ -14,30 +14,30 @@ * Represents a host in the config database. */ struct bc_hostEntry { - struct bc_hostEntry *next; /*Ptr to next record*/ - char *name; /*Stringname for host*/ - struct sockaddr_in addr; /*Corresponding sockaddr*/ - afs_int32 portOffset; /*Port=standardPort+portOffset-allows multiple TC on a host*/ + struct bc_hostEntry *next; /*Ptr to next record */ + char *name; /*Stringname for host */ + struct sockaddr_in addr; /*Corresponding sockaddr */ + afs_int32 portOffset; /*Port=standardPort+portOffset-allows multiple TC on a host */ }; /* * Global backup program configuration information. */ struct bc_config { - char *path; /*Root directory for config info*/ - struct bc_hostEntry *dbaseHosts; /*Hosts providing the backup database service*/ - struct bc_hostEntry *tapeHosts; /*Hosts providing the tape drives*/ - struct bc_volumeSet *vset; /*List of all volume sets*/ - struct bc_dumpSchedule *dsched; /*Dump schedule list*/ - udbClientTextT configText[TB_NUM]; /* configuration text handles */ - char tmpTextFileNames[TB_NUM][AFSDIR_PATH_MAX]; /* names of temp files created to store config text recd from buserver */ + char *path; /*Root directory for config info */ + struct bc_hostEntry *dbaseHosts; /*Hosts providing the backup database service */ + struct bc_hostEntry *tapeHosts; /*Hosts providing the tape drives */ + struct bc_volumeSet *vset; /*List of all volume sets */ + struct bc_dumpSchedule *dsched; /*Dump schedule list */ + udbClientTextT configText[TB_NUM]; /* configuration text handles */ + char tmpTextFileNames[TB_NUM][AFSDIR_PATH_MAX]; /* names of temp files created to store config text recd from buserver */ }; /* * Central status information relating to per-opcode routine information. */ struct bc_opstatus { - int isCmdLineOpcode; /*Is this the opcode being done for the command line?*/ + int isCmdLineOpcode; /*Is this the opcode being done for the command line? */ }; /* @@ -45,40 +45,40 @@ struct bc_opstatus { * related volumes. Each volume set has a name and a list of volume * descriptions, one for each line in the volumeset configuration file. */ -#define VSFLAG_TEMPORARY 1 /* Volume set is temporary */ +#define VSFLAG_TEMPORARY 1 /* Volume set is temporary */ struct bc_volumeSet { - struct bc_volumeSet *next; /*Ptr to next volume set record*/ - char *name; /*Volume set name*/ - afs_int32 flags; /* flags */ - struct bc_volumeEntry *ventries; /*List of component volume entries*/ + struct bc_volumeSet *next; /*Ptr to next volume set record */ + char *name; /*Volume set name */ + afs_int32 flags; /* flags */ + struct bc_volumeEntry *ventries; /*List of component volume entries */ }; /* * Represents the name of a volume specifier in a volume set. */ struct bc_volumeEntry { - struct bc_volumeEntry *next; /*Ptr to next record in list*/ - char *serverName; /*Host name for volume spec*/ - struct sockaddr_in server; /*Host sockaddr for volume spec*/ - char *partname; /*Partition pattern name*/ - afs_int32 partition; /*Partition number for volume spec*/ - char *name; /*Volume pattern name*/ + struct bc_volumeEntry *next; /*Ptr to next record in list */ + char *serverName; /*Host name for volume spec */ + struct sockaddr_in server; /*Host sockaddr for volume spec */ + char *partname; /*Partition pattern name */ + afs_int32 partition; /*Partition number for volume spec */ + char *name; /*Volume pattern name */ }; /* * Represents an individual volume to be dumped, not a collection. */ struct bc_volumeDump { - struct bc_volumeDump *next; /*Ptr to next record*/ - afs_int32 vid; /*Volume id, or 0 if not known*/ - struct bc_volumeEntry *entry; /*Back pointer: information about server (obs?) */ - char *name; /*Individual volume name*/ - afs_int32 volType; /*Volume type*/ - afs_int32 date; /*From date (for full, incremental or whatever)*/ - afs_int32 cloneDate; /* time of this volume's snapshot */ - afs_int32 partition; /* partition containing this volume */ - struct sockaddr_in server; /* server to obtain data from */ + struct bc_volumeDump *next; /*Ptr to next record */ + afs_int32 vid; /*Volume id, or 0 if not known */ + struct bc_volumeEntry *entry; /*Back pointer: information about server (obs?) */ + char *name; /*Individual volume name */ + afs_int32 volType; /*Volume type */ + afs_int32 date; /*From date (for full, incremental or whatever) */ + afs_int32 cloneDate; /* time of this volume's snapshot */ + afs_int32 partition; /* partition containing this volume */ + struct sockaddr_in server; /* server to obtain data from */ }; /* @@ -86,46 +86,46 @@ struct bc_volumeDump { * safe5 daily incremental) */ struct bc_dumpSchedule { - struct bc_dumpSchedule *next; /*Ptr to next record*/ - char *name; /*Dump sched name*/ - char *vsname; /*Volume set name to dump*/ - afs_int32 period; /*Period in minutes*/ - afs_int32 periodType; /*Qualifier on above, for exceptions like 'monthly'*/ - char *parentName; /*Parent dump schedule name-unused PA*/ - struct bc_dumpSchedule *parent; /*These are built at run-time*/ + struct bc_dumpSchedule *next; /*Ptr to next record */ + char *name; /*Dump sched name */ + char *vsname; /*Volume set name to dump */ + afs_int32 period; /*Period in minutes */ + afs_int32 periodType; /*Qualifier on above, for exceptions like 'monthly' */ + char *parentName; /*Parent dump schedule name-unused PA */ + struct bc_dumpSchedule *parent; /*These are built at run-time */ struct bc_dumpSchedule *firstChild; struct bc_dumpSchedule *nextSibling; - afs_int32 level; /*Level of the dump (do we need this?)*/ - afs_int32 expDate; /* expiration date */ - afs_int32 expType; /* absolute or relative expiration */ + afs_int32 level; /*Level of the dump (do we need this?) */ + afs_int32 expDate; /* expiration date */ + afs_int32 expType; /* absolute or relative expiration */ }; /* * Private: represents a queued dump/restore item. */ struct bc_dumpTask { - int (*callProc)(); + int (*callProc) (); struct bc_config *config; struct bc_volumeDump *volumes; - char *dumpName; /*Dump name we're doing*/ - char *volSetName; /*Volume set we're dumping*/ + char *dumpName; /*Dump name we're doing */ + char *volSetName; /*Volume set we're dumping */ afs_int32 flags; - afs_int32 dumpID; /*Dump ID we're running*/ - int oldFlag; /* if a restore, whether we're doing it to the same vol#s */ + afs_int32 dumpID; /*Dump ID we're running */ + int oldFlag; /* if a restore, whether we're doing it to the same vol#s */ struct sockaddr_in destServer; /* destination server for restore command */ - afs_int32 destPartition; /* destination partition for restore command */ + afs_int32 destPartition; /* destination partition for restore command */ afs_int32 fromDate; /* date from which to do a restore command */ - afs_int32 parentDumpID; /* parent dump ID */ - afs_int32 dumpLevel; /* dump level being performed */ + afs_int32 parentDumpID; /* parent dump ID */ + afs_int32 dumpLevel; /* dump level being performed */ char *newExt; /* new volume extension if any, if oldFlag is false */ - afs_int32 bytesTransferred; /* How many bytes sent */ - afs_int32 volumeBeingDumped; /* the volume being processed */ - afs_int32 *portOffset; /* used to derive the ports of the TCs */ - afs_int32 portCount; /* number of points in the portOffset array */ + afs_int32 bytesTransferred; /* How many bytes sent */ + afs_int32 volumeBeingDumped; /* the volume being processed */ + afs_int32 *portOffset; /* used to derive the ports of the TCs */ + afs_int32 portCount; /* number of points in the portOffset array */ afs_int32 expDate; /* for dumps - expiration date */ afs_int32 expType; /* for dumps - abs. or relative expiration */ - int doAppend; /* for dumps - append this dump to the dump set */ - int dontExecute; /* dont execute the dump or restore */ + int doAppend; /* for dumps - append this dump to the dump set */ + int dontExecute; /* dont execute the dump or restore */ }; #define BC_DI_INUSE 1 /* entry not used */ @@ -136,6 +136,6 @@ struct bc_dumpTask { #define VSNAME "volumeset" #define BC_MAXSIMDUMPS 64 -#define BC_MAXPORTS 128 /* max number of port offsets for volrestore */ +#define BC_MAXPORTS 128 /* max number of port offsets for volrestore */ /* debugging support */ #define dprintf(x) diff --git a/src/bucoord/bc_status.c b/src/bucoord/bc_status.c index 56828f378..8539c2e0b 100644 --- a/src/bucoord/bc_status.c +++ b/src/bucoord/bc_status.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/bc_status.c,v 1.1.1.5 2001/09/11 14:31:32 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/bc_status.c,v 1.11 2003/12/07 22:49:18 jaltman Exp $"); #include #include @@ -40,13 +41,17 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/bc_status.c,v 1.1.1.5 2001/09/1 curPollPtr->flags &= ~(clear); \ unlock_Status(); +extern struct bc_config *bc_globalConfig; +extern afs_int32 bc_GetConn(struct bc_config *aconfig, afs_int32 aport, struct rx_connection **tconn); +extern statusP findStatus(afs_uint32 taskId); + /* globals for backup coordinator status management */ -dlqlinkT statusHead; /* chain of status blocks */ -struct Lock statusQueueLock; /* access control for status chain */ -struct Lock cmdLineLock; /* lock on the cmdLine */ +dlqlinkT statusHead; /* chain of status blocks */ +struct Lock statusQueueLock; /* access control for status chain */ +struct Lock cmdLineLock; /* lock on the cmdLine */ -afs_int32 lastTaskCode; /* Error code from task that last finished */ +afs_int32 lastTaskCode; /* Error code from task that last finished */ /* nextItem * get next item for status interrogation, if any. @@ -55,24 +60,23 @@ static statusP nextItem(linkPtr) statusP linkPtr; { - dlqlinkP ptr; + dlqlinkP ptr; ptr = (dlqlinkP) linkPtr; /* if last known item has terminated, reset ptr */ - if ( ptr == 0 ) - { + if (ptr == 0) { ptr = &statusHead; - if ( dlqEmpty(ptr) ) - return(0); + if (dlqEmpty(ptr)) + return (0); } ptr = ptr->dlq_next; /* if we're back at the head again */ - if ( ptr == &statusHead ) - return(0); - return((statusP) ptr); + if (ptr == &statusHead) + return (0); + return ((statusP) ptr); } #ifdef notdef @@ -80,36 +84,35 @@ static statusP nextItem(linkPtr) statusP linkPtr; { - dlqlinkP ptr; + dlqlinkP ptr; ptr = (dlqlinkP) linkPtr; /* if last known item has terminated, reset ptr */ - if ( ptr == 0 ) - { + if (ptr == 0) { ptr = &statusHead; - if ( dlqEmpty(ptr) ) - return(0); + if (dlqEmpty(ptr)) + return (0); } ptr = ptr->dlq_next; /* if we're back at the head again */ - if ( ptr == &statusHead ) - { + if (ptr == &statusHead) { ptr = ptr->dlq_next; } - return((statusP) ptr); + return ((statusP) ptr); } #endif /* notdef */ char *cmdLine; +int cmdDispatch() { #define MAXV 100 - char **targv[MAXV]; /*Ptr to parsed argv stuff*/ - afs_int32 targc; /*Num parsed arguments*/ + char **targv[MAXV]; /*Ptr to parsed argv stuff */ + afs_int32 targc; /*Num parsed arguments */ afs_int32 code; char *internalCmdLine; @@ -118,22 +121,23 @@ cmdDispatch() code = cmd_ParseLine(internalCmdLine, targv, &targc, MAXV); if (code) { - printf("Couldn't parse line: '%s'", error_message(code)); - return(1); + printf("Couldn't parse line: '%s'", error_message(code)); + return (1); } free(internalCmdLine); - + /* * Because the "-at" option cannot be wildcarded, we cannot fall * into recusive loop here by setting dispatchCount to 1. */ doDispatch(targc, targv, 1); cmd_FreeArgv(targv); + return(0); } statusWatcher() { - struct rx_connection *tconn = (struct rc_connection *)0; + struct rx_connection *tconn = (struct rc_connection *)0; statusP curPollPtr = 0; struct tciStatusS statusPtr; @@ -141,39 +145,36 @@ statusWatcher() /* task information */ afs_uint32 taskFlags; afs_uint32 localTaskFlags; - afs_uint32 temp; /* for flag manipulation */ + afs_uint32 temp; /* for flag manipulation */ afs_int32 jobNumber; afs_int32 taskId; afs_int32 port; afs_int32 atTime; PROCESS dispatchPid; - + afs_int32 code = 0; - extern struct bc_config *bc_globalConfig; - extern struct rx_connection *bc_GetConn(); lastTaskCode = 0; - while ( 1 ) - { /*w*/ - if (tconn) rx_DestroyConnection(tconn); + while (1) { /*w */ + if (tconn) + rx_DestroyConnection(tconn); tconn = (struct rc_connection *)0; lock_Status(); curPollPtr = nextItem(curPollPtr); - if ( curPollPtr == 0 ) - { + if (curPollPtr == 0) { #ifdef AFS_PTHREAD_ENV struct timespec delaytime; unlock_Status(); - delayTime.tv_sec = 5; + delayTime.tv_sec = 5; delayTime.tv_nsec = 0; pthread_delay_np(&delayTime); #else unlock_Status(); - IOMGR_Sleep(5); /* wait a while */ -#endif /*else AFS_PTHREAD_ENV*/ + IOMGR_Sleep(5); /* wait a while */ +#endif /*else AFS_PTHREAD_ENV */ continue; } @@ -189,21 +190,19 @@ statusWatcher() CLEAR_FLAG(ABORT_LOCAL); /* An abort request before the command even started */ - if ( atTime && (localTaskFlags & ABORT_REQUEST) ) - { + if (atTime && (localTaskFlags & ABORT_REQUEST)) { if (localTaskFlags & NOREMOVE) { - curPollPtr->flags |= (STARTING|ABORT_DONE); /* Will ignore on other passes */ - curPollPtr->scheduledDump = 0; + curPollPtr->flags |= (STARTING | ABORT_DONE); /* Will ignore on other passes */ + curPollPtr->scheduledDump = 0; } else { - deleteStatusNode(curPollPtr); + deleteStatusNode(curPollPtr); } curPollPtr = 0; continue; } /* A task not started yet - check its start time */ - if ( localTaskFlags & STARTING || atTime ) - { + if (localTaskFlags & STARTING || atTime) { /* * Start a timed dump if its time has come. When the job is * started, it will allocate its own status structure so this @@ -212,84 +211,75 @@ statusWatcher() * Avoid multiple processes trouncing the cmdLine by placing * lock around it. */ - if ( atTime && (atTime <= time(0)) ) - { - lock_cmdLine(); /* Will unlock in cmdDispatch */ + if (atTime && (atTime <= time(0))) { + lock_cmdLine(); /* Will unlock in cmdDispatch */ - cmdLine = curPollPtr->cmdLine; + cmdLine = curPollPtr->cmdLine; lock_Status(); curPollPtr->cmdLine = 0; unlock_Status(); - printf("Starting scheduled dump: job %d\n", jobNumber); - printf("schedD> %s\n", cmdLine); + printf("Starting scheduled dump: job %d\n", jobNumber); + printf("schedD> %s\n", cmdLine); - code = LWP_CreateProcess(cmdDispatch, 16384, LWP_NORMAL_PRIORITY, 2, - "cmdDispatch", &dispatchPid); - if ( code ) - { - if (cmdLine) - free(cmdLine); + code = + LWP_CreateProcess(cmdDispatch, 16384, LWP_NORMAL_PRIORITY, + (void *)2, "cmdDispatch", &dispatchPid); + if (code) { + if (cmdLine) + free(cmdLine); unlock_cmdLine(); printf("Couldn't create cmdDispatch task\n"); } if (localTaskFlags & NOREMOVE) { - curPollPtr->flags |= STARTING; /* Will ignore on other passes */ - curPollPtr->flags |= (code?TASK_ERROR:TASK_DONE); - curPollPtr->scheduledDump = 0; + curPollPtr->flags |= STARTING; /* Will ignore on other passes */ + curPollPtr->flags |= (code ? TASK_ERROR : TASK_DONE); + curPollPtr->scheduledDump = 0; } else { - deleteStatusNode(curPollPtr); + deleteStatusNode(curPollPtr); } curPollPtr = 0; } continue; } - if ( localTaskFlags & ABORT_LOCAL ) - { + if (localTaskFlags & ABORT_LOCAL) { /* kill the local task */ - if ( (localTaskFlags & CONTACT_LOST) != 0 ) - { - printf("Job %d: in contact with butc at port %d\n", - jobNumber, port); + if ((localTaskFlags & CONTACT_LOST) != 0) { + printf("Job %d: in contact with butc at port %d\n", jobNumber, + port); printf("Job %d cont: Local kill ignored - use normal kill\n", jobNumber); } } - code = (afs_int32)bc_GetConn(bc_globalConfig, port, &tconn); - if (code) - { + code = (afs_int32) bc_GetConn(bc_globalConfig, port, &tconn); + if (code) { SET_FLAG(CONTACT_LOST); continue; } - if ( CheckTCVersion(tconn) ) - { + if (CheckTCVersion(tconn)) { SET_FLAG(CONTACT_LOST); continue; } /* Send abort to TC requst if we have to */ - if ( localTaskFlags & ABORT_REQUEST ) - { + if (localTaskFlags & ABORT_REQUEST) { code = TC_RequestAbort(tconn, taskId); - if ( code ) - { + if (code) { com_err("statusWatcher", code, "; Can't post abort request"); - com_err("statusWatcher", 0, "...Deleting job"); + com_err("statusWatcher", 0, "...Deleting job"); if (localTaskFlags & NOREMOVE) { - curPollPtr->flags |= (STARTING|TASK_ERROR); - curPollPtr->scheduledDump = 0; + curPollPtr->flags |= (STARTING | TASK_ERROR); + curPollPtr->scheduledDump = 0; } else { - deleteStatusNode(curPollPtr); + deleteStatusNode(curPollPtr); } curPollPtr = 0; continue; - } - else - { + } else { lock_Status(); curPollPtr->flags &= ~ABORT_REQUEST; curPollPtr->flags |= ABORT_SENT; @@ -299,21 +289,19 @@ statusWatcher() /* otherwise just get the status */ code = TC_GetStatus(tconn, taskId, &statusPtr); - if (code) - { - if (code == TC_NODENOTFOUND) - { - printf("Job %d: %s - no such task on port %d, deleting\n", - jobNumber, curPollPtr->taskName, port); + if (code) { + if (code == TC_NODENOTFOUND) { + printf("Job %d: %s - no such task on port %d, deleting\n", + jobNumber, curPollPtr->taskName, port); if (localTaskFlags & NOREMOVE) { - curPollPtr->flags |= (STARTING|TASK_ERROR); - curPollPtr->scheduledDump = 0; + curPollPtr->flags |= (STARTING | TASK_ERROR); + curPollPtr->scheduledDump = 0; } else { - deleteStatusNode(curPollPtr); /* delete this status node */ + deleteStatusNode(curPollPtr); /* delete this status node */ } curPollPtr = 0; - continue; + continue; } SET_FLAG(CONTACT_LOST); @@ -330,8 +318,10 @@ statusWatcher() lock_Status(); /* remember some status flags in local struct */ - temp = (DRIVE_WAIT | OPR_WAIT | CALL_WAIT | TASK_DONE | ABORT_DONE | TASK_ERROR); - curPollPtr->flags &= ~temp; /* clear */ + temp = + (DRIVE_WAIT | OPR_WAIT | CALL_WAIT | TASK_DONE | ABORT_DONE | + TASK_ERROR); + curPollPtr->flags &= ~temp; /* clear */ curPollPtr->flags |= (taskFlags & temp); /* update */ curPollPtr->dbDumpId = statusPtr.dbDumpId; @@ -342,50 +332,49 @@ statusWatcher() unlock_Status(); /* Are we done */ - if (taskFlags & TASK_DONE) - { /*done*/ - if (taskFlags & ABORT_DONE) - { - if (curPollPtr->dbDumpId) - printf("Job %d: %s: DumpID %u Aborted", - jobNumber, curPollPtr->taskName, curPollPtr->dbDumpId); + if (taskFlags & TASK_DONE) { /*done */ + if (taskFlags & ABORT_DONE) { + if (curPollPtr->dbDumpId) + printf("Job %d: %s: DumpID %u Aborted", jobNumber, + curPollPtr->taskName, curPollPtr->dbDumpId); + else + printf("Job %d: %s Aborted", jobNumber, + curPollPtr->taskName); + + if (taskFlags & TASK_ERROR) + printf(" with errors\n"); else - printf("Job %d: %s Aborted", jobNumber, curPollPtr->taskName); + printf("\n"); - if ( taskFlags & TASK_ERROR ) printf(" with errors\n"); - else printf("\n"); - lastTaskCode = 1; } - else if (taskFlags & TASK_ERROR) - { - if ( !(localTaskFlags & SILENT) ) { - if (curPollPtr->dbDumpId) - printf("Job %d: DumpID %u Failed with errors\n", - jobNumber, curPollPtr->dbDumpId); - else - printf("Job %d Failed with errors\n", jobNumber); + else if (taskFlags & TASK_ERROR) { + if (!(localTaskFlags & SILENT)) { + if (curPollPtr->dbDumpId) + printf("Job %d: DumpID %u Failed with errors\n", + jobNumber, curPollPtr->dbDumpId); + else + printf("Job %d Failed with errors\n", jobNumber); } lastTaskCode = 2; } - else - { - if ( !(localTaskFlags & SILENT) ) - { + else { + if (!(localTaskFlags & SILENT)) { if (curPollPtr->dbDumpId) - printf("Job %d: %s: DumpID %u finished", - jobNumber, curPollPtr->taskName, curPollPtr->dbDumpId); + printf("Job %d: %s: DumpID %u finished", jobNumber, + curPollPtr->taskName, curPollPtr->dbDumpId); else - printf("Job %d: %s finished", jobNumber, curPollPtr->taskName); - - if (curPollPtr->volsTotal) - { - printf(". %d volumes dumped", (curPollPtr->volsTotal- - curPollPtr->volsFailed)); - if ( curPollPtr->volsFailed) - printf(", %d failed", curPollPtr->volsFailed); + printf("Job %d: %s finished", jobNumber, + curPollPtr->taskName); + + if (curPollPtr->volsTotal) { + printf(". %d volumes dumped", + (curPollPtr->volsTotal - + curPollPtr->volsFailed)); + if (curPollPtr->volsFailed) + printf(", %d failed", curPollPtr->volsFailed); } printf("\n"); @@ -395,19 +384,19 @@ statusWatcher() /* make call to destroy task on server */ code = TC_EndStatus(tconn, taskId); - if ( code ) - printf("Job %d: %s, error in job termination cleanup\n", - jobNumber, curPollPtr->taskName); - + if (code) + printf("Job %d: %s, error in job termination cleanup\n", + jobNumber, curPollPtr->taskName); + if (localTaskFlags & NOREMOVE) { - curPollPtr->flags |= STARTING; - curPollPtr->scheduledDump = 0; + curPollPtr->flags |= STARTING; + curPollPtr->scheduledDump = 0; } else { - deleteStatusNode(curPollPtr); /* unlink and destroy local task */ + deleteStatusNode(curPollPtr); /* unlink and destroy local task */ } curPollPtr = 0; - } /*done*/ - } /*w*/ + } /*done */ + } /*w */ } /* bc_jobNumber @@ -423,16 +412,15 @@ bc_jobNumber() dlqlinkP ptr; ptr = statusHead.dlq_next; - while ( ptr != &statusHead ) - { + while (ptr != &statusHead) { /* compute max of all job numbers */ - if ( ((statusP) ptr)->jobNumber > retval ) + if (((statusP) ptr)->jobNumber > retval) retval = ((statusP) ptr)->jobNumber; ptr = ptr->dlq_next; } retval++; - return(retval); + return (retval); } /* waitForTask @@ -441,32 +429,31 @@ bc_jobNumber() * had been cleaned up, then just return 0. */ waitForTask(taskId) - afs_uint32 taskId; + afs_uint32 taskId; { statusP ptr; - afs_int32 done=0, rcode, t; - extern statusP findStatus(); + afs_int32 done = 0, rcode, t; t = (TASK_DONE | ABORT_DONE | TASK_ERROR); while (!done) { - /* Sleep 2 seconds */ + /* Sleep 2 seconds */ #ifdef AFS_PTHREAD_ENV - struct timespec delaytime; - delayTime.tv_sec = 2; - delayTime.tv_nsec = 0; - pthread_delay_np(&delayTime); + struct timespec delaytime; + delayTime.tv_sec = 2; + delayTime.tv_nsec = 0; + pthread_delay_np(&delayTime); #else - IOMGR_Sleep(2); -#endif /*else AFS_PTHREAD_ENV*/ - - /* Check if we are done */ - lock_Status(); - ptr = findStatus(taskId); - if (!ptr || (ptr->flags & t)) { - rcode = (ptr ? ptr->flags : 0); - done=1; - } - unlock_Status(); + IOMGR_Sleep(2); +#endif /*else AFS_PTHREAD_ENV */ + + /* Check if we are done */ + lock_Status(); + ptr = findStatus(taskId); + if (!ptr || (ptr->flags & t)) { + rcode = (ptr ? ptr->flags : 0); + done = 1; + } + unlock_Status(); } return rcode; } diff --git a/src/bucoord/btest.c b/src/bucoord/btest.c index d793392d1..a6d18170d 100644 --- a/src/bucoord/btest.c +++ b/src/bucoord/btest.c @@ -16,20 +16,21 @@ #include #include "bc.h" -extern struct rx_securityClass *rxnull_NewClientSecurityObject(); - #include "AFS_component_version_number.c" main(argc, argv) -int argc; -char **argv; { + int argc; + char **argv; +{ struct rx_securityClass *rxsc; register struct rx_connection *tconn; register afs_int32 code; rx_Init(0); rxsc = rxnull_NewClientSecurityObject(); - tconn = rx_NewConnection(htonl(0x7f000001), htons(BC_MESSAGEPORT), 1, rxsc, 0); + tconn = + rx_NewConnection(htonl(0x7f000001), htons(BC_MESSAGEPORT), 1, rxsc, + 0); code = BC_Print(tconn, 1, 2, argv[1]); printf("Done, code %d\n", code); exit(0); diff --git a/src/bucoord/commands.c b/src/bucoord/commands.c index 4ef23a0e7..43567b864 100644 --- a/src/bucoord/commands.c +++ b/src/bucoord/commands.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/commands.c,v 1.1.1.7 2002/09/26 19:05:02 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/commands.c,v 1.14 2003/12/08 01:45:28 jaltman Exp $"); #include #include @@ -44,19 +45,14 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/commands.c,v 1.1.1.7 2002/09/26 extern struct bc_config *bc_globalConfig; -extern char *ktime_GetDateUsage(); extern struct bc_dumpSchedule *bc_FindDumpSchedule(); -extern struct bc_volumeSet *bc_FindVolumeSet(struct bc_config *cfg, char *name); +extern struct bc_volumeSet *bc_FindVolumeSet(struct bc_config *cfg, + char *name); extern struct bc_dumpTask bc_dumpTasks[BC_MAXSIMDUMPS]; extern struct ubik_client *cstruct; extern int bc_Dumper(); /* function to do dumps */ extern int bc_Restorer(); /* function to do restores */ -extern void bc_HandleMisc(); -extern afs_int32 ScanDumpHdr(); -extern afs_int32 ScanTapeVolume(); extern char *whoami; -extern int VL_ListEntry(); -extern int VL_ListAttributesN2(); extern struct ktc_token ttoken; extern char *tailCompPtr(); extern statusP createStatusNode(); @@ -70,294 +66,317 @@ extern afs_int32 lastTaskCode; #define HOSTADDR(sockaddr) (sockaddr)->sin_addr.s_addr #endif -int bc_EvalVolumeSet(aconfig, avs, avols, uclient) - struct bc_config *aconfig; - register struct bc_volumeSet *avs; - struct bc_volumeDump **avols; - struct ubik_client *uclient; -{ /*bc_EvalVolumeSet*/ - int code; - int a,b,c; - static afs_int32 use=2; - - if (use == 2) { /* Use EvalVolumeSet2() */ - code = EvalVolumeSet2(aconfig, avs, avols, uclient); - if (code == RXGEN_OPCODE) use = 1; - } - if (use == 1) { /* Use EvalVolumeSet1() */ - code = EvalVolumeSet1(aconfig, avs, avols, uclient); - } - return code; -} /*bc_EvalVolumeSet*/ +int +bc_EvalVolumeSet(aconfig, avs, avols, uclient) + struct bc_config *aconfig; + register struct bc_volumeSet *avs; + struct bc_volumeDump **avols; + struct ubik_client *uclient; +{ /*bc_EvalVolumeSet */ + int code; + static afs_int32 use = 2; + + if (use == 2) { /* Use EvalVolumeSet2() */ + code = EvalVolumeSet2(aconfig, avs, avols, uclient); + if (code == RXGEN_OPCODE) + use = 1; + } + if (use == 1) { /* Use EvalVolumeSet1() */ + code = EvalVolumeSet1(aconfig, avs, avols, uclient); + } + return code; +} /*bc_EvalVolumeSet */ struct partitionsort { - afs_int32 part; - struct bc_volumeDump *vdlist; - struct bc_volumeDump *lastvdlist; - struct bc_volumeDump *dupvdlist; - struct bc_volumeEntry *vole; - struct partitionsort *next; + afs_int32 part; + struct bc_volumeDump *vdlist; + struct bc_volumeDump *lastvdlist; + struct bc_volumeDump *dupvdlist; + struct bc_volumeEntry *vole; + struct partitionsort *next; }; struct serversort { - afs_uint32 ipaddr; - struct partitionsort *partitions; - struct serversort *next; + afs_uint32 ipaddr; + struct partitionsort *partitions; + struct serversort *next; }; -afs_int32 getSPEntries(server, partition, serverlist, ss, ps) - afs_uint32 server; - afs_int32 partition; - struct serversort **serverlist, **ss; - struct partitionsort **ps; +afs_int32 +getSPEntries(server, partition, serverlist, ss, ps) + afs_uint32 server; + afs_int32 partition; + struct serversort **serverlist, **ss; + struct partitionsort **ps; { - if (!(*ss) || ((*ss)->ipaddr != server)) { - *ps = 0; - for ((*ss)=*serverlist; (*ss); *ss=(*ss)->next) { - if ((*ss)->ipaddr == server) - break; - } - } - /* No server entry added. Add one */ - if (!(*ss)) { - *ss = (struct serversort *) malloc(sizeof(struct serversort)); - if (!(*ss)) { - com_err(whoami, BC_NOMEM, ""); - *ss = 0; - return(BC_NOMEM); - } - memset(*ss, 0, sizeof(struct serversort)); - (*ss)->ipaddr = server; - (*ss)->next = *serverlist; - *serverlist = *ss; - } - - - if (!(*ps) || ((*ps)->part != partition)) { - for (*ps=(*ss)->partitions; *ps; *ps=(*ps)->next) { - if ((*ps)->part == partition) - break; - } - } - /* No partition entry added. Add one */ - if (!(*ps)) { - *ps = (struct partitionsort *) malloc(sizeof(struct partitionsort)); - if (!(*ps)) { - com_err(whoami, BC_NOMEM, ""); - free (*ss); - *ps = 0; - *ss = 0; - return(BC_NOMEM); - } - memset(*ps, 0, sizeof(struct partitionsort)); - (*ps)->part = partition; - (*ps)->next = (*ss)->partitions; - (*ss)->partitions = *ps; - } - return 0; + if (!(*ss) || ((*ss)->ipaddr != server)) { + *ps = 0; + for ((*ss) = *serverlist; (*ss); *ss = (*ss)->next) { + if ((*ss)->ipaddr == server) + break; + } + } + /* No server entry added. Add one */ + if (!(*ss)) { + *ss = (struct serversort *)malloc(sizeof(struct serversort)); + if (!(*ss)) { + com_err(whoami, BC_NOMEM, ""); + *ss = 0; + return (BC_NOMEM); + } + memset(*ss, 0, sizeof(struct serversort)); + (*ss)->ipaddr = server; + (*ss)->next = *serverlist; + *serverlist = *ss; + } + + + if (!(*ps) || ((*ps)->part != partition)) { + for (*ps = (*ss)->partitions; *ps; *ps = (*ps)->next) { + if ((*ps)->part == partition) + break; + } + } + /* No partition entry added. Add one */ + if (!(*ps)) { + *ps = (struct partitionsort *)malloc(sizeof(struct partitionsort)); + if (!(*ps)) { + com_err(whoami, BC_NOMEM, ""); + free(*ss); + *ps = 0; + *ss = 0; + return (BC_NOMEM); + } + memset(*ps, 0, sizeof(struct partitionsort)); + (*ps)->part = partition; + (*ps)->next = (*ss)->partitions; + (*ss)->partitions = *ps; + } + return 0; } -afs_int32 randSPEntries(serverlist, avols) - struct serversort *serverlist; - struct bc_volumeDump **avols; +afs_int32 +randSPEntries(serverlist, avols) + struct serversort *serverlist; + struct bc_volumeDump **avols; { - struct serversort *ss, **pss, *tss; - struct partitionsort *ps, **pps; - afs_int32 r; - afs_int32 scount, pcount; - - *avols = 0; - - /* Seed random number generator */ - r = time(0) + getpid(); - srand(r); - - /* Count number of servers, remove one at a time */ - for (scount=0, ss=serverlist; ss; ss=ss->next, scount++); - for (; scount; scount--) { - /* Pick a random server in list and remove it */ - r = (rand()>>4) % scount; - for (pss=&serverlist, ss=serverlist; r; - pss=&ss->next, ss=ss->next, r--); - *pss = ss->next; - - /* Count number of partitions, remove one at a time */ - for (pcount=0, ps=ss->partitions; ps; ps=ps->next, pcount++); - for (; pcount; pcount--) { - /* Pick a random parition in list and remove it */ - r = (rand()>>4) % pcount; - for (pps=&ss->partitions, ps=ss->partitions; r; - pps=&ps->next, ps=ps->next, r--); - *pps = ps->next; - - ps->lastvdlist->next = *avols; - *avols = ps->vdlist; - free(ps); - } - free(ss); - } + struct serversort *ss, **pss; + struct partitionsort *ps, **pps; + afs_int32 r; + afs_int32 scount, pcount; + + *avols = 0; + + /* Seed random number generator */ + r = time(0) + getpid(); + srand(r); + + /* Count number of servers, remove one at a time */ + for (scount = 0, ss = serverlist; ss; ss = ss->next, scount++); + for (; scount; scount--) { + /* Pick a random server in list and remove it */ + r = (rand() >> 4) % scount; + for (pss = &serverlist, ss = serverlist; r; + pss = &ss->next, ss = ss->next, r--); + *pss = ss->next; + + /* Count number of partitions, remove one at a time */ + for (pcount = 0, ps = ss->partitions; ps; ps = ps->next, pcount++); + for (; pcount; pcount--) { + /* Pick a random parition in list and remove it */ + r = (rand() >> 4) % pcount; + for (pps = &ss->partitions, ps = ss->partitions; r; + pps = &ps->next, ps = ps->next, r--); + *pps = ps->next; + + ps->lastvdlist->next = *avols; + *avols = ps->vdlist; + free(ps); + } + free(ss); + } + return 0; } -int EvalVolumeSet2(aconfig, avs, avols, uclient) - struct bc_config *aconfig; - struct bc_volumeSet *avs; - struct bc_volumeDump **avols; - struct ubik_client *uclient; -{ /*EvalVolumeSet2*/ - struct bc_volumeEntry *tve; - struct bc_volumeDump *tavols; - struct VldbListByAttributes attributes; - afs_int32 si, nsi; /* startIndex and nextStartIndex */ - afs_int32 nentries, e, ei, et, add, l; - nbulkentries bulkentries; - struct nvldbentry *entries=0; - struct bc_volumeDump *tvd; - afs_int32 code=0, tcode; - afs_int32 count=0; - struct serversort *servers=0, *lastserver=0, *ss=0, *nss; - struct partitionsort *ps=0, *nps; - - *avols = (struct bc_volumeDump *) 0; - bulkentries.nbulkentries_len = 0; - bulkentries.nbulkentries_val = 0; - - /* For each of the volume set entries - collect the volumes that match it */ - for (tve=avs->ventries; tve; tve=tve->next) { - /* Put together a call to the vlserver for this vlentry. The - * performance gain is from letting the vlserver expand the - * volumeset and not this routine. - */ - attributes.Mask = 0; - if (tve->server.sin_addr.s_addr) { /* The server */ - attributes.Mask |= VLLIST_SERVER; - attributes.server = tve->server.sin_addr.s_addr; - } - if (tve->partition != -1) { /* The partition */ - attributes.Mask |= VLLIST_PARTITION; - attributes.partition = tve->partition; - } - - /* Now make the call to the vlserver */ - for (si=0; si != -1; si=nsi) { - nentries = 0; - bulkentries.nbulkentries_len = 0; - bulkentries.nbulkentries_val = 0; - nsi = -1; - tcode = ubik_Call(VL_ListAttributesN2, uclient, 0, - &attributes, tve->name, si, - &nentries, &bulkentries, &nsi); - if (tcode) ERROR(tcode); - - /* The 3.4 vlserver has a VL_ListAttributesN2() RPC call, but - * it is not complete. The only way to tell if it is not complete - * is if et == 0 (which we check for below). Also, if the call didn't - * match any entries, then we don't know what version the vlserver - * is. In both cases, we return RXGEN_OPCODE and the calling routine - * will switch to the EvalVolumeSet1() call. +int +EvalVolumeSet2(aconfig, avs, avols, uclient) + struct bc_config *aconfig; + struct bc_volumeSet *avs; + struct bc_volumeDump **avols; + struct ubik_client *uclient; +{ /*EvalVolumeSet2 */ + struct bc_volumeEntry *tve; + struct bc_volumeDump *tavols; + struct VldbListByAttributes attributes; + afs_int32 si, nsi; /* startIndex and nextStartIndex */ + afs_int32 nentries, e, ei, et, add, l; + nbulkentries bulkentries; + struct nvldbentry *entries = 0; + struct bc_volumeDump *tvd; + afs_int32 code = 0, tcode; + afs_int32 count = 0; + struct serversort *servers = 0, *lastserver = 0, *ss = 0; + struct partitionsort *ps = 0; + + *avols = (struct bc_volumeDump *)0; + bulkentries.nbulkentries_len = 0; + bulkentries.nbulkentries_val = 0; + + /* For each of the volume set entries - collect the volumes that match it */ + for (tve = avs->ventries; tve; tve = tve->next) { + /* Put together a call to the vlserver for this vlentry. The + * performance gain is from letting the vlserver expand the + * volumeset and not this routine. */ - if (nentries == 0) ERROR(RXGEN_OPCODE); /* Use EvalVolumeSet1 */ - - /* Step through each entry and add it to the list of volumes */ - entries = bulkentries.nbulkentries_val; - for (e=0; e> 16) & 0xffff; - switch (et) { - case ITSRWVOL: {et = RWVOL; break;} - case ITSBACKVOL:{et = BACKVOL; break;} - case ITSROVOL: {et = ROVOL; break;} - default: ERROR(RXGEN_OPCODE); /* Use EvalVolumeSet1 */ - } - - /* Find server and partiton structure to hang the entry off of */ - tcode = getSPEntries(entries[e].serverNumber[ei], - entries[e].serverPartition[ei], - &servers, &ss, &ps); - if (tcode) { - com_err(whoami, tcode, ""); - ERROR(tcode); - } - - /* Detect if this entry should be added (not a duplicate). - * Use ps->dupvdlist and ps->vole to only search volumes from - * previous volume set entries. - */ - add = 1; - if (tve != avs->ventries) { - l = strlen(entries[e].name); - if (ps->vole != tve) { - ps->vole = tve; - ps->dupvdlist = ps->vdlist; - } - for (tavols=ps->dupvdlist; add && tavols; tavols=tavols->next) { - if (strncmp(tavols->name, entries[e].name, l) == 0) { - if ( (strcmp(&entries[e].name[l], ".backup") == 0) || - (strcmp(&entries[e].name[l], ".readonly") == 0) || - (strcmp(&entries[e].name[l], "") == 0) ) - add = 0; - } - } - } - - if (add) { - /* Allocate a volume dump structure and its name */ - tvd = (struct bc_volumeDump *) malloc(sizeof(struct bc_volumeDump)); - if (!tvd) { - com_err(whoami, BC_NOMEM, ""); - ERROR(BC_NOMEM); - } - memset(tvd, 0, sizeof(*tvd)); - - tvd->name = (char *) malloc(strlen(entries[e].name)+10); - if (!(tvd->name)) { - com_err(whoami, BC_NOMEM, ""); - free(tvd); - ERROR(BC_NOMEM); - } - - /* Fill it in and thread onto avols list */ - strcpy(tvd->name, entries[e].name); - if (et == BACKVOL) strcat(tvd->name, ".backup"); - else if (et == ROVOL) strcat(tvd->name, ".readonly"); - tvd->vid = entries[e].volumeId[et]; - tvd->entry = tve; - tvd->volType = et; - tvd->partition = entries[e].serverPartition[ei]; - tvd->server.sin_addr.s_addr = entries[e].serverNumber[ei]; - tvd->server.sin_port = 0; /* default FS port */ - tvd->server.sin_family = AF_INET; + attributes.Mask = 0; + if (tve->server.sin_addr.s_addr) { /* The server */ + attributes.Mask |= VLLIST_SERVER; + attributes.server = tve->server.sin_addr.s_addr; + } + if (tve->partition != -1) { /* The partition */ + attributes.Mask |= VLLIST_PARTITION; + attributes.partition = tve->partition; + } + + /* Now make the call to the vlserver */ + for (si = 0; si != -1; si = nsi) { + nentries = 0; + bulkentries.nbulkentries_len = 0; + bulkentries.nbulkentries_val = 0; + nsi = -1; + tcode = + ubik_Call(VL_ListAttributesN2, uclient, 0, &attributes, + tve->name, si, &nentries, &bulkentries, &nsi); + if (tcode) + ERROR(tcode); + + /* The 3.4 vlserver has a VL_ListAttributesN2() RPC call, but + * it is not complete. The only way to tell if it is not complete + * is if et == 0 (which we check for below). Also, if the call didn't + * match any entries, then we don't know what version the vlserver + * is. In both cases, we return RXGEN_OPCODE and the calling routine + * will switch to the EvalVolumeSet1() call. + */ + if (nentries == 0) + ERROR(RXGEN_OPCODE); /* Use EvalVolumeSet1 */ + + /* Step through each entry and add it to the list of volumes */ + entries = bulkentries.nbulkentries_val; + for (e = 0; e < nentries; e++) { + ei = entries[e].matchindex & 0xffff; + et = (entries[e].matchindex >> 16) & 0xffff; + switch (et) { + case ITSRWVOL:{ + et = RWVOL; + break; + } + case ITSBACKVOL:{ + et = BACKVOL; + break; + } + case ITSROVOL:{ + et = ROVOL; + break; + } + default: + ERROR(RXGEN_OPCODE); /* Use EvalVolumeSet1 */ + } + + /* Find server and partiton structure to hang the entry off of */ + tcode = + getSPEntries(entries[e].serverNumber[ei], + entries[e].serverPartition[ei], &servers, + &ss, &ps); + if (tcode) { + com_err(whoami, tcode, ""); + ERROR(tcode); + } + + /* Detect if this entry should be added (not a duplicate). + * Use ps->dupvdlist and ps->vole to only search volumes from + * previous volume set entries. + */ + add = 1; + if (tve != avs->ventries) { + l = strlen(entries[e].name); + if (ps->vole != tve) { + ps->vole = tve; + ps->dupvdlist = ps->vdlist; + } + for (tavols = ps->dupvdlist; add && tavols; + tavols = tavols->next) { + if (strncmp(tavols->name, entries[e].name, l) == 0) { + if ((strcmp(&entries[e].name[l], ".backup") == 0) + || (strcmp(&entries[e].name[l], ".readonly") + == 0) + || (strcmp(&entries[e].name[l], "") == 0)) + add = 0; + } + } + } + + if (add) { + /* Allocate a volume dump structure and its name */ + tvd = (struct bc_volumeDump *) + malloc(sizeof(struct bc_volumeDump)); + if (!tvd) { + com_err(whoami, BC_NOMEM, ""); + ERROR(BC_NOMEM); + } + memset(tvd, 0, sizeof(*tvd)); + + tvd->name = (char *)malloc(strlen(entries[e].name) + 10); + if (!(tvd->name)) { + com_err(whoami, BC_NOMEM, ""); + free(tvd); + ERROR(BC_NOMEM); + } + + /* Fill it in and thread onto avols list */ + strcpy(tvd->name, entries[e].name); + if (et == BACKVOL) + strcat(tvd->name, ".backup"); + else if (et == ROVOL) + strcat(tvd->name, ".readonly"); + tvd->vid = entries[e].volumeId[et]; + tvd->entry = tve; + tvd->volType = et; + tvd->partition = entries[e].serverPartition[ei]; + tvd->server.sin_addr.s_addr = entries[e].serverNumber[ei]; + tvd->server.sin_port = 0; /* default FS port */ + tvd->server.sin_family = AF_INET; #ifdef STRUCT_SOCKADDR_HAS_SA_LEN - tvd->server.sin_len = sizeof(struct sockaddr_in); -#endif - - /* String tvd off of partition struct */ - tvd->next = ps->vdlist; - ps->vdlist = tvd; - if (!tvd->next) - ps->lastvdlist = tvd; - - count++; - } - } - - /* Free memory allocated during VL call */ - if (bulkentries.nbulkentries_val) { - free((char *)bulkentries.nbulkentries_val); - bulkentries.nbulkentries_val = 0; - entries = 0; - } - } - } - - /* Randomly link the volumedump entries together */ - randSPEntries(servers, avols); - fprintf (stderr, "Total number of volumes : %u\n", count); - - error_exit: - if (bulkentries.nbulkentries_val) { - free((char *)bulkentries.nbulkentries_val); - } - return(code); -} /*EvalVolumeSet2*/ + tvd->server.sin_len = sizeof(struct sockaddr_in); +#endif + + /* String tvd off of partition struct */ + tvd->next = ps->vdlist; + ps->vdlist = tvd; + if (!tvd->next) + ps->lastvdlist = tvd; + + count++; + } + } + + /* Free memory allocated during VL call */ + if (bulkentries.nbulkentries_val) { + free((char *)bulkentries.nbulkentries_val); + bulkentries.nbulkentries_val = 0; + entries = 0; + } + } + } + + /* Randomly link the volumedump entries together */ + randSPEntries(servers, avols); + fprintf(stderr, "Total number of volumes : %u\n", count); + + error_exit: + if (bulkentries.nbulkentries_val) { + free((char *)bulkentries.nbulkentries_val); + } + return (code); +} /*EvalVolumeSet2 */ /*----------------------------------------------------------------------------- * EvalVolumeSetOld @@ -400,80 +419,80 @@ int EvalVolumeSet2(aconfig, avs, avols, uclient) * None. *----------------------------------------------------------------------------- */ -int EvalVolumeSet1(aconfig, avs, avols, uclient) - struct bc_config *aconfig; - struct bc_volumeSet *avs; - struct bc_volumeDump **avols; - struct ubik_client *uclient; -{ /*EvalVolumeSet1*/ - afs_int32 code; /*Result of various calls*/ +int +EvalVolumeSet1(aconfig, avs, avols, uclient) + struct bc_config *aconfig; + struct bc_volumeSet *avs; + struct bc_volumeDump **avols; + struct ubik_client *uclient; +{ /*EvalVolumeSet1 */ + afs_int32 code; /*Result of various calls */ char *errm; - struct bc_volumeDump *tvd; /*Ptr to new dump instance*/ - struct bc_volumeEntry *tve, *ctve; /*Ptr to new volume entry instance*/ - char patt[256]; /*Composite regex; also, target string*/ - int volType; /*Type of volume that worked */ - afs_int32 index; /*Current VLDB entry index*/ - afs_int32 count; /*Needed by VL_ListEntry()*/ - afs_int32 next_index; /*Next index to list*/ - struct vldbentry entry; /*VLDB entry*/ - int srvpartpair; /*Loop counter: server/partition pair*/ + struct bc_volumeDump *tvd; /*Ptr to new dump instance */ + struct bc_volumeEntry *tve, *ctve; /*Ptr to new volume entry instance */ + char patt[256]; /*Composite regex; also, target string */ + int volType; /*Type of volume that worked */ + afs_int32 index; /*Current VLDB entry index */ + afs_int32 count; /*Needed by VL_ListEntry() */ + afs_int32 next_index; /*Next index to list */ + struct vldbentry entry; /*VLDB entry */ + int srvpartpair; /*Loop counter: server/partition pair */ afs_int32 total = 0; int found, foundentry; - struct serversort *servers=0, *ss=0; - struct partitionsort *ps=0; + struct serversort *servers = 0, *ss = 0; + struct partitionsort *ps = 0; - *avols = (struct bc_volumeDump *) 0; - ctve = (struct bc_volumeEntry *) 0; /* no compiled entry */ + *avols = (struct bc_volumeDump *)0; + ctve = (struct bc_volumeEntry *)0; /* no compiled entry */ /* For each vldb entry. * Variable next_index is set to the index of the next VLDB entry * in the enumeration. */ - for (index=0; 1; index=next_index) - { /*w*/ + for (index = 0; 1; index = next_index) { /*w */ memset(&entry, 0, sizeof(entry)); - code = ubik_Call(VL_ListEntry, /*Routine to invoke*/ - uclient, /*Ubik client structure*/ - 0, /*Ubik flags*/ - index, /*Current index*/ - &count, /*Ptr to working variable*/ - &next_index, /*Ptr to next index value to list*/ - &entry); /*Ptr to entry to fill*/ - if (code) return code; - if (!next_index) break; /* If the next index is invalid, bail out now. */ + code = ubik_Call(VL_ListEntry, /*Routine to invoke */ + uclient, /*Ubik client structure */ + 0, /*Ubik flags */ + index, /*Current index */ + &count, /*Ptr to working variable */ + &next_index, /*Ptr to next index value to list */ + &entry); /*Ptr to entry to fill */ + if (code) + return code; + if (!next_index) + break; /* If the next index is invalid, bail out now. */ /* For each entry in the volume set */ - found = 0; /* No match in volume set yet */ - for (tve=avs->ventries; tve; tve=tve->next) - { /*ve*/ + found = 0; /* No match in volume set yet */ + for (tve = avs->ventries; tve; tve = tve->next) { /*ve */ /* for each server in the vldb entry */ - for (srvpartpair=0; srvpartpair < entry.nServers; srvpartpair++) - { /*s*/ - /* On the same server */ - if ( tve->server.sin_addr.s_addr && - !VLDB_IsSameAddrs(tve->server.sin_addr.s_addr, - entry.serverNumber[srvpartpair], - &code) ) { - if (code) return(code); + for (srvpartpair = 0; srvpartpair < entry.nServers; srvpartpair++) { /*s */ + /* On the same server */ + if (tve->server.sin_addr.s_addr + && !VLDB_IsSameAddrs(tve->server.sin_addr.s_addr, + entry.serverNumber[srvpartpair], + &code)) { + if (code) + return (code); continue; } - + /* On the same partition */ - if ( (tve->partition != -1) && - (tve->partition != entry.serverPartition[srvpartpair]) ) + if ((tve->partition != -1) + && (tve->partition != entry.serverPartition[srvpartpair])) continue; /* If the volume entry is not compiled, then compile it */ - if (ctve != tve) - { + if (ctve != tve) { sprintf(patt, "^%s$", tve->name); - errm = (char*)re_comp(patt); - if (errm) - { - com_err(whoami, 0, "Can't compile regular expression '%s': %s", + errm = (char *)re_comp(patt); + if (errm) { + com_err(whoami, 0, + "Can't compile regular expression '%s': %s", patt, errm); - return(-1); + return (-1); } ctve = tve; } @@ -481,14 +500,11 @@ int EvalVolumeSet1(aconfig, avs, avols, uclient) /* If the RW name matches the volume set entry, take * it and exit. First choice is to use the RW volume. */ - if (entry.serverFlags[srvpartpair] & ITSRWVOL) - { - if (entry.flags & RW_EXISTS) - { - sprintf(patt, "%s", entry.name); + if (entry.serverFlags[srvpartpair] & ITSRWVOL) { + if (entry.flags & RW_EXISTS) { + sprintf(patt, "%s", entry.name); code = re_exec(patt); - if (code == 1) - { + if (code == 1) { found = 1; foundentry = srvpartpair; volType = RWVOL; @@ -499,12 +515,10 @@ int EvalVolumeSet1(aconfig, avs, avols, uclient) /* If the BK name matches the volume set entry, take * it and exit. Second choice is to use the BK volume. */ - if (entry.flags & BACK_EXISTS) - { - sprintf(patt, "%s.backup", entry.name); + if (entry.flags & BACK_EXISTS) { + sprintf(patt, "%s.backup", entry.name); code = re_exec(patt); - if (code == 1) - { + if (code == 1) { found = 1; foundentry = srvpartpair; volType = BACKVOL; @@ -517,81 +531,79 @@ int EvalVolumeSet1(aconfig, avs, avols, uclient) * it, but continue searching. Further entries may be * RW or backup entries that will match. */ - else if ( !found && - (entry.serverFlags[srvpartpair] & ITSROVOL) && - (entry.flags & RO_EXISTS) ) - { + else if (!found && (entry.serverFlags[srvpartpair] & ITSROVOL) + && (entry.flags & RO_EXISTS)) { sprintf(patt, "%s.readonly", entry.name); code = re_exec(patt); - if (code == 1) - { - found = 1; + if (code == 1) { + found = 1; foundentry = srvpartpair; volType = ROVOL; } } - + if (code < 0) com_err(whoami, 0, "Internal error in regex package"); - } /*s*/ + } /*s */ /* If found a match, then create a new volume dump entry */ - if (found) - { /*f*/ - /* Find server and partition structure to hang the entry off of */ - code = getSPEntries(entry.serverNumber[foundentry], - entry.serverPartition[foundentry], - &servers, &ss, &ps); - if (code) { - com_err(whoami, code, ""); - return(code); - } + if (found) { /*f */ + /* Find server and partition structure to hang the entry off of */ + code = + getSPEntries(entry.serverNumber[foundentry], + entry.serverPartition[foundentry], &servers, + &ss, &ps); + if (code) { + com_err(whoami, code, ""); + return (code); + } total++; - tvd = (struct bc_volumeDump *) malloc(sizeof(struct bc_volumeDump)); - if (!tvd) - { - com_err(whoami, BC_NOMEM,""); - return(BC_NOMEM); + tvd = (struct bc_volumeDump *) + malloc(sizeof(struct bc_volumeDump)); + if (!tvd) { + com_err(whoami, BC_NOMEM, ""); + return (BC_NOMEM); } memset(tvd, 0, sizeof(*tvd)); - tvd->name = (char *) malloc(strlen(entry.name)+10); - if (!(tvd->name)) - { + tvd->name = (char *)malloc(strlen(entry.name) + 10); + if (!(tvd->name)) { com_err(whoami, BC_NOMEM, ""); free(tvd); - return(BC_NOMEM); + return (BC_NOMEM); } strcpy(tvd->name, entry.name); - if (volType == BACKVOL) strcat(tvd->name, ".backup"); - else if (volType == ROVOL) strcat(tvd->name, ".readonly"); - tvd->vid = entry.volumeId[volType]; - tvd->entry = tve; - tvd->volType = volType; - tvd->partition = entry.serverPartition[foundentry]; + if (volType == BACKVOL) + strcat(tvd->name, ".backup"); + else if (volType == ROVOL) + strcat(tvd->name, ".readonly"); + tvd->vid = entry.volumeId[volType]; + tvd->entry = tve; + tvd->volType = volType; + tvd->partition = entry.serverPartition[foundentry]; tvd->server.sin_addr.s_addr = entry.serverNumber[foundentry]; - tvd->server.sin_port = 0; /* default FS port */ - tvd->server.sin_family = AF_INET; - - /* String tvd off of partition struct */ - tvd->next = ps->vdlist; - ps->vdlist = tvd; - if (!tvd->next) - ps->lastvdlist = tvd; + tvd->server.sin_port = 0; /* default FS port */ + tvd->server.sin_family = AF_INET; + + /* String tvd off of partition struct */ + tvd->next = ps->vdlist; + ps->vdlist = tvd; + if (!tvd->next) + ps->lastvdlist = tvd; break; - } /*f*/ - } /*ve*/ - } /*w*/ + } /*f */ + } /*ve */ + } /*w */ /* Randomly link the volumedump entries together */ randSPEntries(servers, avols); - fprintf (stderr, "Total number of volumes : %u\n", total); - return(0); -} /*EvalVolumeSet1*/ + fprintf(stderr, "Total number of volumes : %u\n", total); + return (0); +} /*EvalVolumeSet1 */ /* compactDateString * print out a date in compact format, 16 chars, format is @@ -601,32 +613,36 @@ int EvalVolumeSet1(aconfig, avs, avols, uclient) * exit: * ptr to a string containing a representation of the date */ -char *compactDateString(date_long, string, size) - afs_int32 *date_long, size; - char *string; +char * +compactDateString(date_long, string, size) + afs_int32 *date_long, size; + char *string; { struct tm *ltime; - if (!string) return 0; + if (!string) + return 0; if (*date_long == NEVERDATE) { sprintf(string, "NEVER"); } else { ltime = localtime(date_long); /* prints date in U.S. format of mm/dd/yyyy */ - strftime (string, size, "%m/%d/%Y %H:%M", ltime); + strftime(string, size, "%m/%d/%Y %H:%M", ltime); } - return(string); + return (string); } -afs_int32 bc_SafeATOI(anum) - char *anum; +afs_int32 +bc_SafeATOI(anum) + char *anum; { - afs_int32 total=0; + afs_int32 total = 0; for (; *anum; anum++) { - if ((*anum < '0') || (*anum > '9')) return -1; - total = (10 * total) + (afs_int32)(*anum - '0'); + if ((*anum < '0') || (*anum > '9')) + return -1; + total = (10 * total) + (afs_int32) (*anum - '0'); } return total; } @@ -636,20 +652,21 @@ afs_int32 bc_SafeATOI(anum) * by a character representing the units (K,M,G,T). Default is 'K'. * Return the size in KBytes. */ -afs_int32 bc_FloatATOI(anum) - char *anum; +afs_int32 +bc_FloatATOI(anum) + char *anum; { float total = 0; afs_int32 rtotal; - afs_int32 fraction = 0; /* > 0 if past the decimal */ + afs_int32 fraction = 0; /* > 0 if past the decimal */ for (; *anum; anum++) { if ((*anum == 't') || (*anum == 'T')) { - total *= 1024*1024*1024; + total *= 1024 * 1024 * 1024; break; } if ((*anum == 'g') || (*anum == 'G')) { - total *= 1024*1024; + total *= 1024 * 1024; break; } if ((*anum == 'm') || (*anum == 'M')) { @@ -660,40 +677,42 @@ afs_int32 bc_FloatATOI(anum) break; } if (*anum == '.') { - fraction = 10; - continue; + fraction = 10; + continue; } - if ((*anum < '0') || (*anum > '9')) return -1; + if ((*anum < '0') || (*anum > '9')) + return -1; if (!fraction) { - total = (10. * total) + (float)(*anum - '0'); + total = (10. * total) + (float)(*anum - '0'); } else { - total += ((float)(*anum - '0')) / (float)fraction; - fraction *= 10; + total += ((float)(*anum - '0')) / (float)fraction; + fraction *= 10; } } - total += 0.5; /* Round up */ - if (total > 0x7fffffff) /* Don't go over 2G */ - total = 0x7fffffff; + total += 0.5; /* Round up */ + if (total > 0x7fffffff) /* Don't go over 2G */ + total = 0x7fffffff; rtotal = (afs_int32) total; return (rtotal); } /* make a copy of a string so that it can be freed later */ -char *bc_CopyString(astring) - char *astring; +char * +bc_CopyString(astring) + char *astring; { afs_int32 tlen; char *tp; - if (!astring) return((char *) 0); /* propagate null strings easily */ + if (!astring) + return (NULL); /* propagate null strings easily */ tlen = strlen(astring); - tp = (char *) malloc(tlen+1); /* don't forget the terminating null */ - if (!tp) - { - com_err(whoami,BC_NOMEM,""); - return(tp); + tp = (char *)malloc(tlen + 1); /* don't forget the terminating null */ + if (!tp) { + com_err(whoami, BC_NOMEM, ""); + return (tp); } strcpy(tp, astring); return tp; @@ -705,43 +724,41 @@ char *bc_CopyString(astring) * */ -char *concatParams(itemPtr) - struct cmd_item *itemPtr; +char * +concatParams(itemPtr) + struct cmd_item *itemPtr; { - struct cmd_item *tempPtr; - afs_int32 length = 0; - char *string; - - /* compute the length of string required */ - for (tempPtr = itemPtr; tempPtr; tempPtr = tempPtr->next) - { - length += strlen(tempPtr->data); - length++; /* space or null terminator */ - } - - if ( length == 0 ) /* no string (0 length) */ - { - com_err(whoami, 0, "Can't have zero length date and time string"); - return((char *)0); - } - - string = (char *) malloc(length); /* allocate the string */ - if (!string) - { - com_err(whoami,BC_NOMEM,""); - return((char *)0); - } - string[0] = 0; - - tempPtr = itemPtr; /* now assemble the string */ - while ( tempPtr ) - { - strcat(string, tempPtr->data); - tempPtr = tempPtr->next; - if ( tempPtr ) strcat(string, " "); - } - - return(string); /* return the string */ + struct cmd_item *tempPtr; + afs_int32 length = 0; + char *string; + + /* compute the length of string required */ + for (tempPtr = itemPtr; tempPtr; tempPtr = tempPtr->next) { + length += strlen(tempPtr->data); + length++; /* space or null terminator */ + } + + if (length == 0) { /* no string (0 length) */ + com_err(whoami, 0, "Can't have zero length date and time string"); + return (NULL); + } + + string = (char *)malloc(length); /* allocate the string */ + if (!string) { + com_err(whoami, BC_NOMEM, ""); + return (NULL); + } + string[0] = 0; + + tempPtr = itemPtr; /* now assemble the string */ + while (tempPtr) { + strcat(string, tempPtr->data); + tempPtr = tempPtr->next; + if (tempPtr) + strcat(string, " "); + } + + return (string); /* return the string */ } /* printIfStatus @@ -752,52 +769,53 @@ printIfStatus(statusPtr) struct tciStatusS *statusPtr; { printf("Task %d: %s: ", statusPtr->taskId, statusPtr->taskName); - if ( statusPtr->nKBytes ) + if (statusPtr->nKBytes) printf("%ld Kbytes transferred", statusPtr->nKBytes); - if ( strlen(statusPtr->volumeName) != 0 ) - { - if ( statusPtr->nKBytes ) printf(", "); + if (strlen(statusPtr->volumeName) != 0) { + if (statusPtr->nKBytes) + printf(", "); printf("volume %s", statusPtr->volumeName); } /* orphan */ - if ( statusPtr->flags & ABORT_REQUEST ) + if (statusPtr->flags & ABORT_REQUEST) printf(" [abort request rcvd]"); - - if ( statusPtr->flags & ABORT_DONE ) + + if (statusPtr->flags & ABORT_DONE) printf(" [abort complete]"); - - if ( statusPtr->flags & OPR_WAIT ) + + if (statusPtr->flags & OPR_WAIT) printf(" [operator wait]"); - - if ( statusPtr->flags & CALL_WAIT ) + + if (statusPtr->flags & CALL_WAIT) printf(" [callout in progress]"); - - if ( statusPtr->flags & DRIVE_WAIT ) + + if (statusPtr->flags & DRIVE_WAIT) printf(" [drive wait]"); - if ( statusPtr->flags & TASK_DONE ) + if (statusPtr->flags & TASK_DONE) printf(" [done]"); printf("\n"); } -afs_int32 getPortOffset(port) - char *port; +afs_int32 +getPortOffset(port) + char *port; { - afs_int32 portOffset; - - portOffset = bc_SafeATOI(port); - - if (portOffset < 0) { - com_err(whoami,0,"Can't decode port offset '%s'", port); - return(-1); - } - else if (portOffset > BC_MAXPORTOFFSET) { - com_err(whoami,0,"%u exceeds max port offset %u",portOffset,BC_MAXPORTOFFSET); - return(-1); - } - return(portOffset); + afs_int32 portOffset; + + portOffset = bc_SafeATOI(port); + + if (portOffset < 0) { + com_err(whoami, 0, "Can't decode port offset '%s'", port); + return (-1); + } else if (portOffset > BC_MAXPORTOFFSET) { + com_err(whoami, 0, "%u exceeds max port offset %u", portOffset, + BC_MAXPORTOFFSET); + return (-1); + } + return (portOffset); } /* bc_GetTapeStatusCmd @@ -806,10 +824,9 @@ afs_int32 getPortOffset(port) bc_GetTapeStatusCmd(as, arock) struct cmd_syndesc *as; - char *arock; + char *arock; { afs_int32 code; - afs_int32 index, dumpID; struct rx_connection *tconn; afs_int32 portOffset = 0; @@ -820,33 +837,35 @@ bc_GetTapeStatusCmd(as, arock) code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); - return(code); + com_err(whoami, code, "; Can't retrieve tape hosts"); + return (code); } if (as->parms[0].items) { - portOffset = getPortOffset(as->parms[0].items->data); - if (portOffset < 0) return(BC_BADARG); + portOffset = getPortOffset(as->parms[0].items->data); + if (portOffset < 0) + return (BC_BADARG); } code = ConnectButc(bc_globalConfig, portOffset, &tconn); - if (code) return(code); - + if (code) + return (code); + flags = TSK_STAT_FIRST; taskId = 0; ntasks = 0; - while ( (flags & TSK_STAT_END) == 0 ) - { + while ((flags & TSK_STAT_END) == 0) { code = TC_ScanStatus(tconn, &taskId, &status, &flags); - if (code) - { - if (code == TC_NOTASKS) break; + if (code) { + if (code == TC_NOTASKS) + break; com_err(whoami, code, "; Can't get status from butc"); - return(-1); + return (-1); } - if ( (flags & TSK_STAT_NOTFOUND) ) break; /* Can't find the task id */ - flags &= ~TSK_STAT_FIRST; /* turn off flag */ + if ((flags & TSK_STAT_NOTFOUND)) + break; /* Can't find the task id */ + flags &= ~TSK_STAT_FIRST; /* turn off flag */ printIfStatus(&status); ntasks++; @@ -856,11 +875,11 @@ bc_GetTapeStatusCmd(as, arock) printf("Tape coordinator is idle\n"); if (flags & TSK_STAT_ADSM) - printf("TSM Tape coordinator\n"); + printf("TSM Tape coordinator\n"); else if (flags & TSK_STAT_XBSA) - printf("XBSA Tape coordinator\n"); + printf("XBSA Tape coordinator\n"); - return(0); + return (0); } extern struct Lock dispatchLock; @@ -874,27 +893,25 @@ bc_WaitForNoJobs() int i; int waitmsg = 1; int usefulJobRunning = 1; - + extern dlqlinkT statusHead; - statusP ptr; - dlqlinkP dptr; com_err(whoami, 0, "waiting for job termination"); - while (usefulJobRunning) - { + while (usefulJobRunning) { usefulJobRunning = (dlqEmpty(&statusHead) ? 0 : 1); - if (dispatchLock.excl_locked) usefulJobRunning = 1; - for (i=0; (!usefulJobRunning && (idlq_next; - while ( ptr != &statusHead ) - { + while (ptr != &statusHead) { statusPtr = (statusP) ptr; ptr = ptr->dlq_next; - - if ( statusPtr->scheduledDump ) - { - dlqUnlink((dlqlinkP)statusPtr); - dlqLinkb(&atJobsHead, (dlqlinkP)statusPtr); - } - else - { + + if (statusPtr->scheduledDump) { + dlqUnlink((dlqlinkP) statusPtr); + dlqLinkb(&atJobsHead, (dlqlinkP) statusPtr); + } else { printf("Job %d:", statusPtr->jobNumber); printf(" %s", statusPtr->taskName); - - if ( statusPtr->dbDumpId ) - printf(": DumpID %u", statusPtr->dbDumpId); - if ( statusPtr->nKBytes ) - printf(", %ld Kbytes", statusPtr->nKBytes); - if ( strlen(statusPtr->volumeName) != 0 ) - printf(", volume %s", statusPtr->volumeName); - - if ( statusPtr->flags & CONTACT_LOST ) - printf(" [butc contact lost]"); - - if ( statusPtr->flags & ABORT_REQUEST ) - printf(" [abort request]"); - - if ( statusPtr->flags & ABORT_SENT ) - printf(" [abort sent]"); - - if ( statusPtr->flags & OPR_WAIT ) - printf(" [operator wait]"); - - if ( statusPtr->flags & CALL_WAIT ) - printf(" [callout in progress]"); - - if ( statusPtr->flags & DRIVE_WAIT ) - printf(" [drive wait]"); + + if (statusPtr->dbDumpId) + printf(": DumpID %u", statusPtr->dbDumpId); + if (statusPtr->nKBytes) + printf(", %ld Kbytes", statusPtr->nKBytes); + if (strlen(statusPtr->volumeName) != 0) + printf(", volume %s", statusPtr->volumeName); + + if (statusPtr->flags & CONTACT_LOST) + printf(" [butc contact lost]"); + + if (statusPtr->flags & ABORT_REQUEST) + printf(" [abort request]"); + + if (statusPtr->flags & ABORT_SENT) + printf(" [abort sent]"); + + if (statusPtr->flags & OPR_WAIT) + printf(" [operator wait]"); + + if (statusPtr->flags & CALL_WAIT) + printf(" [callout in progress]"); + + if (statusPtr->flags & DRIVE_WAIT) + printf(" [drive wait]"); printf("\n"); } } @@ -969,34 +980,32 @@ bc_JobsCmd(as, arock) /* * Now print the scheduled dumps. */ - if ( !dlqEmpty(&statusHead) && as ) - printf("\n"); /* blank line between running and scheduled dumps */ + if (!dlqEmpty(&statusHead) && as) + printf("\n"); /* blank line between running and scheduled dumps */ prevTime = 0; - while ( !dlqEmpty(&atJobsHead) ) - { - ptr = (&atJobsHead) -> dlq_next; + while (!dlqEmpty(&atJobsHead)) { + ptr = (&atJobsHead)->dlq_next; youngest = (statusP) ptr; - ptr = ptr->dlq_next; - while ( ptr != &atJobsHead ) /* Find the dump that starts the earliest */ - { + ptr = ptr->dlq_next; + while (ptr != &atJobsHead) { /* Find the dump that starts the earliest */ statusPtr = (statusP) ptr; - if ( statusPtr->scheduledDump < youngest->scheduledDump ) - youngest = statusPtr; + if (statusPtr->scheduledDump < youngest->scheduledDump) + youngest = statusPtr; ptr = ptr->dlq_next; } - + /* Print token expiration time */ - if ( (ttoken.endTime > prevTime) && (ttoken.endTime <= youngest->scheduledDump) && - as && (ttoken.endTime != NEVERDATE)) - { - if (ttoken.endTime > time(0)) { + if ((ttoken.endTime > prevTime) + && (ttoken.endTime <= youngest->scheduledDump) && as + && (ttoken.endTime != NEVERDATE)) { + if (ttoken.endTime > time(0)) { compactDateString(&ttoken.endTime, ds, 50); - printf(" %16s: TOKEN EXPIRATION\n", ds); - } else { - printf(" TOKEN HAS EXPIRED\n"); - } + printf(" %16s: TOKEN EXPIRATION\n", ds); + } else { + printf(" TOKEN HAS EXPIRED\n"); + } } prevTime = youngest->scheduledDump; @@ -1004,19 +1013,18 @@ bc_JobsCmd(as, arock) compactDateString(&youngest->scheduledDump, ds, 50); printf("Job %d:", youngest->jobNumber); printf(" %16s: %s", ds, youngest->cmdLine); - printf("\n"); - + printf("\n"); + /* return to original list */ - dlqUnlink((dlqlinkP)youngest); - dlqLinkb(&statusHead, (dlqlinkP)youngest); + dlqUnlink((dlqlinkP) youngest); + dlqLinkb(&statusHead, (dlqlinkP) youngest); } /* Print token expiration time if havn't already */ - if ( (ttoken.endTime == NEVERDATE) && as ) - printf(" : TOKEN NEVER EXPIRES\n"); - else if ( (ttoken.endTime > prevTime) && as ) - { - if (ttoken.endTime > time(0)) { + if ((ttoken.endTime == NEVERDATE) && as) + printf(" : TOKEN NEVER EXPIRES\n"); + else if ((ttoken.endTime > prevTime) && as) { + if (ttoken.endTime > time(0)) { compactDateString(&ttoken.endTime, ds, 50); printf(" %16s: TOKEN EXPIRATION\n", ds); } else { @@ -1030,14 +1038,13 @@ bc_JobsCmd(as, arock) bc_KillCmd(as, arock) struct cmd_syndesc *as; - char *arock; + char *arock; { afs_int32 i; afs_int32 slot; struct bc_dumpTask *td; char *tp; char tbuffer[256]; - afs_int32 code; dlqlinkP ptr; statusP statusPtr; @@ -1047,41 +1054,33 @@ bc_KillCmd(as, arock) tp = as->parms[0].items->data; - if (strchr(tp, '.') == 0) - { + if (strchr(tp, '.') == 0) { slot = bc_SafeATOI(tp); - if (slot == -1) - { - com_err(whoami,0,"Bad syntax for number '%s'", tp); + if (slot == -1) { + com_err(whoami, 0, "Bad syntax for number '%s'", tp); return -1; } lock_Status(); ptr = (&statusHead)->dlq_next; - while ( ptr != &statusHead ) - { + while (ptr != &statusHead) { statusPtr = (statusP) ptr; - if ( statusPtr->jobNumber == slot ) - { + if (statusPtr->jobNumber == slot) { statusPtr->flags |= ABORT_REQUEST; unlock_Status(); - return(0); + return (0); } ptr = ptr->dlq_next; } unlock_Status(); fprintf(stderr, "Job %d not found\n", slot); - return(-1); - } - else - { + return (-1); + } else { /* vol.dump */ td = bc_dumpTasks; - for(i=0;iflags & BC_DI_INUSE) - { + for (i = 0; i < BC_MAXSIMDUMPS; i++, td++) { + if (td->flags & BC_DI_INUSE) { /* compute name */ strcpy(tbuffer, td->volSetName); strcat(tbuffer, "."); @@ -1090,32 +1089,30 @@ bc_KillCmd(as, arock) break; } } - if (i >= BC_MAXSIMDUMPS) - { - com_err(whoami,0,"Can't find job %s", tp); + if (i >= BC_MAXSIMDUMPS) { + com_err(whoami, 0, "Can't find job %s", tp); return -1; } lock_Status(); statusPtr = findStatus(td->dumpID); - if ( statusPtr == 0 ) - { + if (statusPtr == 0) { com_err(whoami, 0, "Can't locate status - internal error"); unlock_Status(); - return(-1); + return (-1); } statusPtr->flags |= ABORT_REQUEST; unlock_Status(); - return(0); + return (0); } return 0; } /* restore a volume or volumes */ bc_VolRestoreCmd(as, arock) - struct cmd_syndesc *as; - char *arock; + struct cmd_syndesc *as; + char *arock; { /* * parm 0 is the new server to restore to @@ -1130,128 +1127,124 @@ bc_VolRestoreCmd(as, arock) * a new volume ID for the restored volume. If a new extension is specified, * we add that extension to the volume name of the restored volume. */ - struct bc_volumeEntry tvolumeEntry; /* entry within the volume set */ + struct bc_volumeEntry tvolumeEntry; /* entry within the volume set */ struct bc_volumeDump *volsToRestore = (struct bc_volumeDump *)0; - struct bc_volumeDump *lastVol = (struct bc_volumeDump *)0; - struct bc_volumeDump *tvol; /* temp for same */ - struct sockaddr_in destServ; /* machine to which to restore volumes */ - afs_int32 destPartition; /* partition to which to restore volumes */ + struct bc_volumeDump *lastVol = (struct bc_volumeDump *)0; + struct bc_volumeDump *tvol; /* temp for same */ + struct sockaddr_in destServ; /* machine to which to restore volumes */ + afs_int32 destPartition; /* partition to which to restore volumes */ char *tp; struct cmd_item *ti; afs_int32 code; int oldFlag; afs_int32 fromDate; char *newExt, *timeString; - afs_int32 i, portRemain; - afs_int32 *ports = (afs_int32 *)0; - afs_int32 portCount=0; - int dontExecute; + afs_int32 i; + afs_int32 *ports = NULL; + afs_int32 portCount = 0; + int dontExecute; code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); - return(code); + com_err(whoami, code, "; Can't retrieve tape hosts"); + return (code); } /* specified other destination host */ - if (as->parms[0].items) - { + if (as->parms[0].items) { tp = as->parms[0].items->data; - if (bc_ParseHost(tp, &destServ)) - { - com_err(whoami,0,"Failed to locate destination host '%s'", tp); + if (bc_ParseHost(tp, &destServ)) { + com_err(whoami, 0, "Failed to locate destination host '%s'", tp); return -1; } } /* specified other destination partition */ - if (as->parms[1].items) - { + if (as->parms[1].items) { tp = as->parms[1].items->data; - if (bc_GetPartitionID(tp, &destPartition)) - { - com_err(whoami,0,"Can't parse destination partition '%s'", tp); + if (bc_GetPartitionID(tp, &destPartition)) { + com_err(whoami, 0, "Can't parse destination partition '%s'", tp); return -1; } } - for (ti=as->parms[2].items; ti; ti=ti->next) - { + for (ti = as->parms[2].items; ti; ti = ti->next) { /* build list of volume items */ - tvol = (struct bc_volumeDump *) malloc(sizeof(struct bc_volumeDump)); - if (!tvol) - { - com_err(whoami,BC_NOMEM,""); + tvol = (struct bc_volumeDump *)malloc(sizeof(struct bc_volumeDump)); + if (!tvol) { + com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } memset(tvol, 0, sizeof(struct bc_volumeDump)); - tvol->name = (char *) malloc(VOLSER_MAXVOLNAME +1); - if (!tvol->name) - { - com_err(whoami,BC_NOMEM,""); + tvol->name = (char *)malloc(VOLSER_MAXVOLNAME + 1); + if (!tvol->name) { + com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } - strncpy(tvol->name, ti->data,VOLSER_OLDMAXVOLNAME); + strncpy(tvol->name, ti->data, VOLSER_OLDMAXVOLNAME); tvol->entry = &tvolumeEntry; - if (lastVol) lastVol->next = tvol; /* thread onto end of list */ - else volsToRestore = tvol; + if (lastVol) + lastVol->next = tvol; /* thread onto end of list */ + else + volsToRestore = tvol; lastVol = tvol; } - if (as->parms[4].items) - { - timeString = concatParams(as->parms[4].items); - if (!timeString) return(-1); - + if (as->parms[4].items) { + timeString = concatParams(as->parms[4].items); + if (!timeString) + return (-1); + code = ktime_DateToLong(timeString, &fromDate); - free (timeString); - if (code) - { - com_err(whoami,0,"Can't parse restore date and time"); - com_err(whoami,0,"%s", ktime_GetDateUsage()); + free(timeString); + if (code) { + com_err(whoami, 0, "Can't parse restore date and time"); + com_err(whoami, 0, "%s", ktime_GetDateUsage()); return code; } - } - else - { - fromDate = 0x7fffffff; /* latest one */ + } else { + fromDate = 0x7fffffff; /* latest one */ } - newExt = (as->parms[3].items ? as->parms[3].items->data : (char *)0); + newExt = (as->parms[3].items ? as->parms[3].items->data : NULL); oldFlag = 0; /* Read all the port offsets into the ports array. The first element in the * array is for full restore and the rest are for incremental restores */ if (as->parms[5].items) { - for (ti=as->parms[5].items; ti; ti=ti->next) portCount++; - ports = (afs_int32 *)malloc(portCount*sizeof(afs_int32)); + for (ti = as->parms[5].items; ti; ti = ti->next) + portCount++; + ports = (afs_int32 *) malloc(portCount * sizeof(afs_int32)); if (!ports) { - com_err(whoami,BC_NOMEM,""); + com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } - for (ti=as->parms[5].items, i=0; ti; ti=ti->next, i++) { - ports[i] = getPortOffset(ti->data); - if (ports[i] < 0) return(BC_BADARG); + for (ti = as->parms[5].items, i = 0; ti; ti = ti->next, i++) { + ports[i] = getPortOffset(ti->data); + if (ports[i] < 0) + return (BC_BADARG); } } - dontExecute = (as->parms[6].items ? 1 : 0); /* -n */ + dontExecute = (as->parms[6].items ? 1 : 0); /* -n */ /* * Perform the call to start the restore. */ - code = bc_StartDmpRst(bc_globalConfig, "volume", "restore", volsToRestore, &destServ, - destPartition, fromDate, newExt, oldFlag, - /*parentDump*/0, /*dumpLevel*/0, - bc_Restorer, ports, portCount, - /*dumpSched*/0, /*append*/0, dontExecute); - if (code) com_err(whoami,code,"; Failed to queue restore"); - - return(code); + code = + bc_StartDmpRst(bc_globalConfig, "volume", "restore", volsToRestore, + &destServ, destPartition, fromDate, newExt, oldFlag, + /*parentDump */ 0, /*dumpLevel */ 0, + bc_Restorer, ports, portCount, + /*dumpSched */ 0, /*append */ 0, dontExecute); + if (code) + com_err(whoami, code, "; Failed to queue restore"); + + return (code); } /* restore a whole partition or server */ @@ -1265,28 +1258,29 @@ bc_VolRestoreCmd(as, arock) */ bc_DiskRestoreCmd(as, arock) -struct cmd_syndesc *as; -char *arock; { - struct bc_volumeSet tvolumeSet; /* temporary volume set for EvalVolumeSet call */ - struct bc_volumeEntry tvolumeEntry; /* entry within the volume set */ + struct cmd_syndesc *as; + char *arock; +{ + struct bc_volumeSet tvolumeSet; /* temporary volume set for EvalVolumeSet call */ + struct bc_volumeEntry tvolumeEntry; /* entry within the volume set */ struct bc_volumeDump *volsToRestore = (struct bc_volumeDump *)0; - struct sockaddr_in destServ; /* machine to which to restore volumes */ - afs_int32 destPartition; /* partition to which to restore volumes */ + struct sockaddr_in destServ; /* machine to which to restore volumes */ + afs_int32 destPartition; /* partition to which to restore volumes */ char *tp; afs_int32 code; int oldFlag; afs_int32 fromDate; char *newExt; - afs_int32 *ports = (afs_int32 *)0; - afs_int32 portCount=0; - int dontExecute; + afs_int32 *ports = NULL; + afs_int32 portCount = 0; + int dontExecute; struct bc_volumeDump *prev, *tvol, *nextvol; struct cmd_item *ti; afs_int32 i; /* parm 0 is the server to restore * parm 1 is the partition to restore - + * parm 8 and above as in VolRestoreCmd: * parm 8 is the new server to restore to * parm 9 is the new partition to restore to @@ -1294,13 +1288,13 @@ char *arock; { code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); - return(code); + com_err(whoami, code, "; Can't retrieve volume sets"); + return (code); } code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); - return(code); + com_err(whoami, code, "; Can't retrieve tape hosts"); + return (code); } /* create a volume set corresponding to the volume pattern we've been given */ @@ -1311,92 +1305,91 @@ char *arock; { tvolumeEntry.serverName = as->parms[0].items->data; tvolumeEntry.partname = as->parms[1].items->data; - if (bc_GetPartitionID(tvolumeEntry.partname, &tvolumeEntry.partition)) - { - com_err(whoami,0,"Can't parse partition '%s'", tvolumeEntry.partname); + if (bc_GetPartitionID(tvolumeEntry.partname, &tvolumeEntry.partition)) { + com_err(whoami, 0, "Can't parse partition '%s'", + tvolumeEntry.partname); return -1; } - if (bc_ParseHost(tvolumeEntry.serverName, &tvolumeEntry.server)) - { - com_err(whoami,0,"Can't locate host '%s'", tvolumeEntry.serverName); + if (bc_ParseHost(tvolumeEntry.serverName, &tvolumeEntry.server)) { + com_err(whoami, 0, "Can't locate host '%s'", tvolumeEntry.serverName); return -1; } /* specified other destination host */ - if (as->parms[8].items) - { + if (as->parms[8].items) { tp = as->parms[8].items->data; - if (bc_ParseHost(tp, &destServ)) - { - com_err(whoami,0,"Can't locate destination host '%s'", tp); + if (bc_ParseHost(tp, &destServ)) { + com_err(whoami, 0, "Can't locate destination host '%s'", tp); return -1; } - } - else /* use destination host == original host */ + } else /* use destination host == original host */ memcpy(&destServ, &tvolumeEntry.server, sizeof(destServ)); /* specified other destination partition */ - if (as->parms[9].items) - { + if (as->parms[9].items) { tp = as->parms[9].items->data; - if (bc_GetPartitionID(tp, &destPartition)) - { - com_err(whoami,0,"Can't parse destination partition '%s'", tp); + if (bc_GetPartitionID(tp, &destPartition)) { + com_err(whoami, 0, "Can't parse destination partition '%s'", tp); return -1; } - } - else /* use original partition */ + } else /* use original partition */ destPartition = tvolumeEntry.partition; - tvolumeEntry.name = ".*"; /* match all volumes (this should be a parameter) */ + tvolumeEntry.name = ".*"; /* match all volumes (this should be a parameter) */ if (as->parms[2].items) { - for (ti=as->parms[2].items; ti; ti=ti->next) portCount++; - ports = (afs_int32 *)malloc(portCount*sizeof(afs_int32)); - if (!ports) { - com_err(whoami,BC_NOMEM,""); - return BC_NOMEM; - } + for (ti = as->parms[2].items; ti; ti = ti->next) + portCount++; + ports = (afs_int32 *) malloc(portCount * sizeof(afs_int32)); + if (!ports) { + com_err(whoami, BC_NOMEM, ""); + return BC_NOMEM; + } - for (ti=as->parms[2].items, i=0; ti; ti=ti->next, i++) { - ports[i] = getPortOffset(ti->data); - if (ports[i] < 0) return(BC_BADARG); - } + for (ti = as->parms[2].items, i = 0; ti; ti = ti->next, i++) { + ports[i] = getPortOffset(ti->data); + if (ports[i] < 0) + return (BC_BADARG); + } } - newExt = (as->parms[10].items ? as->parms[10].items->data : (char *)0); - dontExecute = (as->parms[11].items ? 1 : 0); /* -n */ + newExt = (as->parms[10].items ? as->parms[10].items->data : NULL); + dontExecute = (as->parms[11].items ? 1 : 0); /* -n */ /* * Expand out the volume set into its component list of volumes, by calling VLDB server. */ - code = bc_EvalVolumeSet(bc_globalConfig, &tvolumeSet, &volsToRestore, cstruct); - if (code) - { - com_err(whoami,code,"; Failed to evaluate volume set"); - return(-1); + code = + bc_EvalVolumeSet(bc_globalConfig, &tvolumeSet, &volsToRestore, + cstruct); + if (code) { + com_err(whoami, code, "; Failed to evaluate volume set"); + return (-1); } /* Since we want only RW volumes, remove any * BK or RO volumes from the list. */ - for (prev=0, tvol=volsToRestore; tvol; tvol=nextvol) { - nextvol = tvol->next; - if (BackupName(tvol->name)) { - if (tvol->name) - fprintf (stderr, "Will not restore volume %s (its RW does not reside on the partition)\n", tvol->name); - - if (tvol == volsToRestore) { - volsToRestore = nextvol; - } else { - prev->next = nextvol; - } - if (tvol->name) free(tvol->name); - free(tvol); - } else { - prev = tvol; - } + for (prev = 0, tvol = volsToRestore; tvol; tvol = nextvol) { + nextvol = tvol->next; + if (BackupName(tvol->name)) { + if (tvol->name) + fprintf(stderr, + "Will not restore volume %s (its RW does not reside on the partition)\n", + tvol->name); + + if (tvol == volsToRestore) { + volsToRestore = nextvol; + } else { + prev->next = nextvol; + } + if (tvol->name) + free(tvol->name); + free(tvol); + } else { + prev = tvol; + } } fromDate = 0x7fffffff; /* last one before this date */ @@ -1405,160 +1398,162 @@ char *arock; { /* * Perform the call to start the dump. */ - code = bc_StartDmpRst(bc_globalConfig, "disk", "restore", volsToRestore, &destServ, - destPartition, fromDate, newExt, oldFlag, - /*parentDump*/0, /*dumpLevel*/0, - bc_Restorer, ports, portCount, - /*dumpSched*/0, /*append*/0, dontExecute); - if (code) com_err(whoami,code,"; Failed to queue restore"); - - return(code); + code = + bc_StartDmpRst(bc_globalConfig, "disk", "restore", volsToRestore, + &destServ, destPartition, fromDate, newExt, oldFlag, + /*parentDump */ 0, /*dumpLevel */ 0, + bc_Restorer, ports, portCount, + /*dumpSched */ 0, /*append */ 0, dontExecute); + if (code) + com_err(whoami, code, "; Failed to queue restore"); + + return (code); } /* bc_VolsetRestoreCmd * restore a volumeset or list of volumes. */ -bc_VolsetRestoreCmd (as, arock) - struct cmd_syndesc *as; - char *arock; +bc_VolsetRestoreCmd(as, arock) + struct cmd_syndesc *as; + char *arock; { int oldFlag; long fromDate; char *newExt; - int dontExecute; - afs_int32 *ports = (afs_int32 *)0; - afs_int32 portCount=0; - afs_int32 code = 0; - afs_int32 portoffset = 0; - char *volsetName; - struct bc_volumeSet *volsetPtr; /* Ptr to list of generated volume info*/ + int dontExecute; + afs_int32 *ports = NULL; + afs_int32 portCount = 0; + afs_int32 code = 0; + afs_int32 portoffset = 0; + char *volsetName; + struct bc_volumeSet *volsetPtr; /* Ptr to list of generated volume info */ struct bc_volumeDump *volsToRestore = (struct bc_volumeDump *)0; - struct bc_volumeDump *lastVol = (struct bc_volumeDump *)0; - struct sockaddr_in destServer; /* machine to which to restore volume */ - afs_int32 destPartition; /* partition to which to restore volumes */ - struct cmd_item *ti; - afs_int32 i; - + struct bc_volumeDump *lastVol = (struct bc_volumeDump *)0; + struct sockaddr_in destServer; /* machine to which to restore volume */ + afs_int32 destPartition; /* partition to which to restore volumes */ + struct cmd_item *ti; + afs_int32 i; + code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); - return(code); + com_err(whoami, code, "; Can't retrieve volume sets"); + return (code); } code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); - return(code); + com_err(whoami, code, "; Can't retrieve tape hosts"); + return (code); } - if (as->parms[0].items) - { - if (as->parms[1].items) - { + if (as->parms[0].items) { + if (as->parms[1].items) { com_err(whoami, 0, "Can't have both -name and -file options"); - return(-1); + return (-1); } volsetName = as->parms[0].items->data; - volsetPtr = bc_FindVolumeSet(bc_globalConfig, volsetName); - if (!volsetPtr) - { - com_err(whoami,0,"Can't find volume set '%s' in backup database", volsetName); - return(-1); + volsetPtr = bc_FindVolumeSet(bc_globalConfig, volsetName); + if (!volsetPtr) { + com_err(whoami, 0, + "Can't find volume set '%s' in backup database", + volsetName); + return (-1); } /* Expand out the volume set into its component list of volumes. */ - code = bc_EvalVolumeSet(bc_globalConfig, volsetPtr, &volsToRestore, cstruct); - if (code) - { - com_err(whoami,code,"; Failed to evaluate volume set"); - return(-1); + code = + bc_EvalVolumeSet(bc_globalConfig, volsetPtr, &volsToRestore, + cstruct); + if (code) { + com_err(whoami, code, "; Failed to evaluate volume set"); + return (-1); } - } - else if (as->parms[1].items) - { - FILE *fd; + } else if (as->parms[1].items) { + FILE *fd; char line[256]; char server[50], partition[50], volume[50], rest[256]; long count; struct bc_volumeDump *tvol; - fd = fopen(as->parms[1].items->data, "r"); - if (!fd) - { - com_err(whoami,errno,"; Cannot open file '%s'", as->parms[1].items->data); - return(-1); - } - - while ( fgets(line, 255, fd) ) - { - count = sscanf(line, "%s %s %s %s", server, partition, volume, rest); - - if (count <= 0) continue; - if (count < 3) - { - fprintf(stderr, + fd = fopen(as->parms[1].items->data, "r"); + if (!fd) { + com_err(whoami, errno, "; Cannot open file '%s'", + as->parms[1].items->data); + return (-1); + } + + while (fgets(line, 255, fd)) { + count = + sscanf(line, "%s %s %s %s", server, partition, volume, rest); + + if (count <= 0) + continue; + if (count < 3) { + fprintf(stderr, "Invalid volumeset file format: Wrong number of arguments: Ignoring\n"); fprintf(stderr, " %s", line); continue; } - if ( bc_ParseHost(server,&destServer) ) - { - com_err(whoami,0,"Failed to locate host '%s'", server); + if (bc_ParseHost(server, &destServer)) { + com_err(whoami, 0, "Failed to locate host '%s'", server); continue; } - if ( bc_GetPartitionID(partition,&destPartition) ) - { - com_err(whoami,0,"Failed to parse destination partition '%s'", partition); + if (bc_GetPartitionID(partition, &destPartition)) { + com_err(whoami, 0, + "Failed to parse destination partition '%s'", + partition); continue; } /* Allocate a volumeDump structure and link it in */ - tvol = (struct bc_volumeDump *) malloc(sizeof(struct bc_volumeDump)); + tvol = + (struct bc_volumeDump *)malloc(sizeof(struct bc_volumeDump)); memset(tvol, 0, sizeof(struct bc_volumeDump)); - tvol->name = (char *) malloc(VOLSER_MAXVOLNAME+1); - if (!tvol->name) - { - com_err(whoami,BC_NOMEM,""); + tvol->name = (char *)malloc(VOLSER_MAXVOLNAME + 1); + if (!tvol->name) { + com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } strncpy(tvol->name, volume, VOLSER_OLDMAXVOLNAME); memcpy(&tvol->server, &destServer, sizeof(destServer)); tvol->partition = destPartition; - if (lastVol) lastVol->next = tvol; /* thread onto end of list */ - else volsToRestore = tvol; + if (lastVol) + lastVol->next = tvol; /* thread onto end of list */ + else + volsToRestore = tvol; lastVol = tvol; } fclose(fd); - } - else - { - com_err(whoami,0,"-name or -file option required"); - return(-1); + } else { + com_err(whoami, 0, "-name or -file option required"); + return (-1); } /* Get the port offset for the restore */ if (as->parms[2].items) { - for (ti=as->parms[2].items; ti; ti=ti->next) portCount++; - ports = (afs_int32 *)malloc(portCount*sizeof(afs_int32)); - if (!ports) { - com_err(whoami,BC_NOMEM,""); - return BC_NOMEM; - } + for (ti = as->parms[2].items; ti; ti = ti->next) + portCount++; + ports = (afs_int32 *) malloc(portCount * sizeof(afs_int32)); + if (!ports) { + com_err(whoami, BC_NOMEM, ""); + return BC_NOMEM; + } - for (ti=as->parms[2].items, i=0; ti; ti=ti->next, i++) { - ports[i] = getPortOffset(ti->data); - if (ports[i] < 0) return(BC_BADARG); - } + for (ti = as->parms[2].items, i = 0; ti; ti = ti->next, i++) { + ports[i] = getPortOffset(ti->data); + if (ports[i] < 0) + return (BC_BADARG); + } } - newExt = (as->parms[3].items ? as->parms[3].items->data : (char *)0); + newExt = (as->parms[3].items ? as->parms[3].items->data : NULL); dontExecute = (as->parms[4].items ? 1 : 0); fromDate = 0x7fffffff; /* last one before this date */ @@ -1566,11 +1561,13 @@ bc_VolsetRestoreCmd (as, arock) /* Perform the call to start the restore */ code = bc_StartDmpRst(bc_globalConfig, "disk", "restore", volsToRestore, - /*destserver*/ 0, /*destpartition*/ 0, fromDate, newExt, oldFlag, - /*parentDump*/0, /*dumpLevel*/0, - bc_Restorer, ports, portCount, - /*dumpSched*/0, /*append*/0, dontExecute); - if (code) com_err(whoami,code,"; Failed to queue restore"); + /*destserver */ 0, /*destpartition */ 0, fromDate, + newExt, oldFlag, + /*parentDump */ 0, /*dumpLevel */ 0, + bc_Restorer, ports, portCount, + /*dumpSched */ 0, /*append */ 0, dontExecute); + if (code) + com_err(whoami, code, "; Failed to queue restore"); return code; } @@ -1597,58 +1594,54 @@ bc_VolsetRestoreCmd (as, arock) * As advertised. *--------------------------------------------------------------------------- */ -int dontExecute; - -int bc_DumpCmd(as, arock) - struct cmd_syndesc *as; - char *arock; -{ /*bc_DumpCmd*/ - static char rn[] = "bc_DumpCmd"; /*Routine name*/ - char *dumpPath, *vsName; /*Ptrs to various names*/ - struct bc_volumeSet *tvs; /*Ptr to list of generated volume info*/ - struct bc_dumpSchedule *tds, *baseds; /*Ptr to dump schedule node*/ - struct bc_volumeDump *tve, *volsToDump; /*Ptr to individual vols to be dumped*/ - struct bc_volumeDump *ntve, *tves, *ptves, *rtves; - struct budb_dumpEntry dumpEntry, de, fde; /* dump entry */ +int dontExecute; + +int +bc_DumpCmd(as, arock) + struct cmd_syndesc *as; + char *arock; +{ /*bc_DumpCmd */ + static char rn[] = "bc_DumpCmd"; /*Routine name */ + char *dumpPath, *vsName; /*Ptrs to various names */ + struct bc_volumeSet *tvs; /*Ptr to list of generated volume info */ + struct bc_dumpSchedule *tds, *baseds; /*Ptr to dump schedule node */ + struct bc_volumeDump *tve, *volsToDump; /*Ptr to individual vols to be dumped */ + struct budb_dumpEntry dumpEntry, de, fde; /* dump entry */ afs_uint32 d; - afs_int32 parent; /* parent dump */ - afs_int32 level; /* this dump's level # */ - afs_int32 problemFindingDump; /* can't find parent(s) */ + afs_int32 parent; /* parent dump */ + afs_int32 level; /* this dump's level # */ + afs_int32 problemFindingDump; /* can't find parent(s) */ - afs_int32 *portp = (afs_int32 *)0; + afs_int32 *portp = NULL; afs_int32 portCount = 0; - afs_int32 doAt, atTime; /* Time a timed-dump is to start at */ + afs_int32 doAt, atTime; /* Time a timed-dump is to start at */ afs_int32 length; char *timeString; - int doAppend; /* Append the dump to dump set */ - afs_int32 code; /* Return code */ - int loadfile; /* whether to load a file or not */ + int doAppend; /* Append the dump to dump set */ + afs_int32 code; /* Return code */ + int loadfile; /* whether to load a file or not */ - struct bc_dumpTask *dumpTaskPtr; /* for dump thread */ - afs_int32 dumpTaskSlot; - char *junk; statusP statusPtr; - int r, nservers, ns, serverfound; extern struct bc_dumpTask bc_dumpTasks[]; extern afs_int32 bcdb_FindLastVolClone(); - extern afs_int32 volImageTime(); + extern afs_int32 volImageTime(); code = bc_UpdateDumpSchedule(); if (code) { - com_err(whoami, code, "; Can't retrieve dump schedule"); - return(code); + com_err(whoami, code, "; Can't retrieve dump schedule"); + return (code); } code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); - return(code); + com_err(whoami, code, "; Can't retrieve volume sets"); + return (code); } code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); - return(code); + com_err(whoami, code, "; Can't retrieve tape hosts"); + return (code); } /* @@ -1656,22 +1649,18 @@ int bc_DumpCmd(as, arock) * The "-file" option cannot exist with the "-volume", "-dump", * "-portoffset", or "-append" option */ - if (as->parms[6].items) - { - loadfile = 1; - if ( as->parms[0].items || as->parms[1].items || - as->parms[2].items || as->parms[4].items ) - { - com_err(whoami,0,"Invalid option specified with -file option"); + if (as->parms[6].items) { + loadfile = 1; + if (as->parms[0].items || as->parms[1].items || as->parms[2].items + || as->parms[4].items) { + com_err(whoami, 0, "Invalid option specified with -file option"); return -1; } - } - else - { - loadfile = 0; - if ( !as->parms[0].items || !as->parms[1].items ) - { - com_err(whoami,0,"Must specify volume set name and dump level name"); + } else { + loadfile = 0; + if (!as->parms[0].items || !as->parms[1].items) { + com_err(whoami, 0, + "Must specify volume set name and dump level name"); return -1; } } @@ -1679,73 +1668,71 @@ int bc_DumpCmd(as, arock) /* * Get the time we are to perform this dump */ - if (as->parms[3].items) - { - doAt = 1; + if (as->parms[3].items) { + doAt = 1; timeString = concatParams(as->parms[3].items); - if (!timeString) return(-1); - + if (!timeString) + return (-1); + /* * Now parse this string for the time to start. */ code = ktime_DateToLong(timeString, &atTime); - free (timeString); - if ( code ) - { - com_err(whoami,0,"Can't parse dump start date and time"); - com_err(whoami,0,"%s", ktime_GetDateUsage()); - return(1); + free(timeString); + if (code) { + com_err(whoami, 0, "Can't parse dump start date and time"); + com_err(whoami, 0, "%s", ktime_GetDateUsage()); + return (1); } - } - else - doAt = 0; - - dontExecute = (as->parms[5].items ? 1 : 0); /* -n */ + } else + doAt = 0; + + dontExecute = (as->parms[5].items ? 1 : 0); /* -n */ /* * If this dump is not a load file, then check the parameters. */ - if (!loadfile) - { /*6*/ - vsName = as->parms[0].items->data; /* get volume set name */ - dumpPath = as->parms[1].items->data; /* get dump path */ + if (!loadfile) { /*6 */ + vsName = as->parms[0].items->data; /* get volume set name */ + dumpPath = as->parms[1].items->data; /* get dump path */ /* get the port number, if one was specified */ - if (as->parms[2].items) - { + if (as->parms[2].items) { portCount = 1; - portp = (afs_int32 *)malloc(sizeof(afs_int32)); - if (!portp) - { - com_err(whoami,BC_NOMEM,""); + portp = (afs_int32 *) malloc(sizeof(afs_int32)); + if (!portp) { + com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } *portp = getPortOffset(as->parms[2].items->data); - if (*portp < 0) return(BC_BADARG); + if (*portp < 0) + return (BC_BADARG); } - doAppend = (as->parms[4].items ? 1 : 0); /* -append */ + doAppend = (as->parms[4].items ? 1 : 0); /* -append */ /* * Get a hold of the given volume set and dump set. */ tvs = bc_FindVolumeSet(bc_globalConfig, vsName); - if (!tvs) - { - com_err(whoami,0, "Can't find volume set '%s' in backup database", vsName); - return(-1); + if (!tvs) { + com_err(whoami, 0, + "Can't find volume set '%s' in backup database", vsName); + return (-1); } baseds = bc_FindDumpSchedule(bc_globalConfig, dumpPath); - if (!baseds) - { - com_err(whoami,0, "Can't find dump schedule '%s' in backup database", dumpPath); - return(-1); + if (!baseds) { + com_err(whoami, 0, + "Can't find dump schedule '%s' in backup database", + dumpPath); + return (-1); } - } /*6*/ + } + /*6 */ /* * If given the "-at" option, then add this to the jobs list and return * with no error. @@ -1755,71 +1742,60 @@ int bc_DumpCmd(as, arock) * the -at option. If the -n option is there, it is scheduled with * the Timed dump as opposed to not scheduling the time dump at all. */ - if ( doAt ) - { - if ( atTime < time(0) ) - { - com_err(whoami,0,"Time of dump is earlier then current time - not added"); - } - else - { + if (doAt) { + if (atTime < time(0)) { + com_err(whoami, 0, + "Time of dump is earlier then current time - not added"); + } else { statusPtr = createStatusNode(); lock_Status(); statusPtr->scheduledDump = atTime; /* Determine length of the dump command */ length = 0; - length += 4; /* "dump" */ - if (loadfile) - { - length += 6; /* " -file" */ - length += 1 + strlen(as->parms[6].items->data); /* " " */ - } - else - { - /* length += 11; */ /* " -volumeset" */ - length += 1 + strlen(as->parms[0].items->data); /* " */ - - /* length += 6; */ /* " -dump" */ - length += 1 + strlen(as->parms[1].items->data); /* " */ - - if (as->parms[2].items) - { - /* length += 12; */ /* " -portoffset" */ - length += 1 + strlen(as->parms[2].items->data); /* " " */ + length += 4; /* "dump" */ + if (loadfile) { + length += 6; /* " -file" */ + length += 1 + strlen(as->parms[6].items->data); /* " " */ + } else { + /* length += 11; *//* " -volumeset" */ + length += 1 + strlen(as->parms[0].items->data); /* " */ + + /* length += 6; *//* " -dump" */ + length += 1 + strlen(as->parms[1].items->data); /* " */ + + if (as->parms[2].items) { + /* length += 12; *//* " -portoffset" */ + length += 1 + strlen(as->parms[2].items->data); /* " " */ } if (as->parms[4].items) - length += 8; /* " -append" */ + length += 8; /* " -append" */ } if (dontExecute) - length += 3; /* " -n" */ - length++; /* end-of-line */ + length += 3; /* " -n" */ + length++; /* end-of-line */ /* Allocate status block for this timed dump */ sprintf(statusPtr->taskName, "Scheduled Dump"); - statusPtr->jobNumber = bc_jobNumber(); - statusPtr->scheduledDump = atTime; - statusPtr->cmdLine = (char *) malloc(length); - if (!statusPtr->cmdLine) - { - com_err(whoami,BC_NOMEM,""); + statusPtr->jobNumber = bc_jobNumber(); + statusPtr->scheduledDump = atTime; + statusPtr->cmdLine = (char *)malloc(length); + if (!statusPtr->cmdLine) { + com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } - + /* Now reconstruct the dump command */ statusPtr->cmdLine[0] = 0; strcat(statusPtr->cmdLine, "dump"); - if (loadfile) - { - strcat(statusPtr->cmdLine, " -file"); + if (loadfile) { + strcat(statusPtr->cmdLine, " -file"); strcat(statusPtr->cmdLine, " "); strcat(statusPtr->cmdLine, as->parms[6].items->data); - } - else - { - /* strcat(statusPtr->cmdLine, " -volumeset"); */ + } else { + /* strcat(statusPtr->cmdLine, " -volumeset"); */ strcat(statusPtr->cmdLine, " "); strcat(statusPtr->cmdLine, as->parms[0].items->data); @@ -1827,8 +1803,7 @@ int bc_DumpCmd(as, arock) strcat(statusPtr->cmdLine, " "); strcat(statusPtr->cmdLine, as->parms[1].items->data); - if (as->parms[2].items) - { + if (as->parms[2].items) { /* strcat(statusPtr->cmdLine, " -portoffset"); */ strcat(statusPtr->cmdLine, " "); strcat(statusPtr->cmdLine, as->parms[2].items->data); @@ -1838,17 +1813,18 @@ int bc_DumpCmd(as, arock) strcat(statusPtr->cmdLine, " -append"); } if (dontExecute) - strcat(statusPtr->cmdLine, " -n"); + strcat(statusPtr->cmdLine, " -n"); printf("Add scheduled dump as job %d\n", statusPtr->jobNumber); - if ( (atTime > ttoken.endTime) && (ttoken.endTime != NEVERDATE) ) - com_err(whoami,0,"Warning: job %d starts after expiration of AFS token", + if ((atTime > ttoken.endTime) && (ttoken.endTime != NEVERDATE)) + com_err(whoami, 0, + "Warning: job %d starts after expiration of AFS token", statusPtr->jobNumber); - + unlock_Status(); } - return(0); + return (0); } /* @@ -1856,12 +1832,10 @@ int bc_DumpCmd(as, arock) * in the main routine prior the dispatch call. loadFile and dontExecute are * global variables so this can take place in main. */ - if (loadfile) - { - loadFile = (char *) malloc(strlen(as->parms[6].items->data)+1); - if (!loadFile) - { - com_err(whoami,BC_NOMEM,""); + if (loadfile) { + loadFile = (char *)malloc(strlen(as->parms[6].items->data) + 1); + if (!loadFile) { + com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } strcpy(loadFile, as->parms[6].items->data); @@ -1871,7 +1845,8 @@ int bc_DumpCmd(as, arock) /* * We are doing a real dump (no load file or timed dump). */ - printf("Starting dump of volume set '%s' (dump level '%s')\n", vsName, dumpPath); + printf("Starting dump of volume set '%s' (dump level '%s')\n", vsName, + dumpPath); /* For each dump-level above this one, see if the volumeset was dumped * at the level. We search all dump-levels since a higher dump-level @@ -1879,13 +1854,14 @@ int bc_DumpCmd(as, arock) */ parent = level = problemFindingDump = 0; for (tds = baseds->parent; tds; tds = tds->parent) { - /* Find the most recent dump of the volume-set at this dump-level. + /* Find the most recent dump of the volume-set at this dump-level. * Raise problem flag if didn't find a dump and a parent not yet found. */ - code = bcdb_FindLatestDump(vsName, tds->name, &dumpEntry); + code = bcdb_FindLatestDump(vsName, tds->name, &dumpEntry); if (code) { - if (!parent) problemFindingDump = 1; /* skipping a dump level */ - continue; + if (!parent) + problemFindingDump = 1; /* skipping a dump level */ + continue; } /* We found the most recent dump at this level. Now check @@ -1894,79 +1870,77 @@ int bc_DumpCmd(as, arock) * off of this dump. */ if (!parent || (dumpEntry.id > parent)) { - /* Follow the parent dumps to see if they are all there */ - for (d=dumpEntry.parent; d; d=de.parent) { - code = bcdb_FindDumpByID(d, &de); - if (code) break; + /* Follow the parent dumps to see if they are all there */ + for (d = dumpEntry.parent; d; d = de.parent) { + code = bcdb_FindDumpByID(d, &de); + if (code) + break; } /* If we found the entire level, remember it. Otherwise raise flag. * If we had already found a dump, raise the problem flag. */ if (!d && !code) { - if (parent) problemFindingDump = 1; - parent = dumpEntry.id; - level = dumpEntry.level+1; - memcpy(&fde, &dumpEntry, sizeof(dumpEntry)); - } - else { - /* Dump hierarchy not complete so can't base off the latest */ - problemFindingDump = 1; + if (parent) + problemFindingDump = 1; + parent = dumpEntry.id; + level = dumpEntry.level + 1; + memcpy(&fde, &dumpEntry, sizeof(dumpEntry)); + } else { + /* Dump hierarchy not complete so can't base off the latest */ + problemFindingDump = 1; } } } - + /* If the problemflag was raise, it means we are not doing the * dump at the level we requested it be done at. */ if (problemFindingDump) { - com_err(whoami,0, - "Warning: Doing level %d dump due to missing higher-level dumps", level); - if (parent) { - printf("Parent dump: dump %s (DumpID %u)\n", fde.name, parent); - } - } - else if (parent) { - printf("Found parent: dump %s (DumpID %u)\n", fde.name, parent); + com_err(whoami, 0, + "Warning: Doing level %d dump due to missing higher-level dumps", + level); + if (parent) { + printf("Parent dump: dump %s (DumpID %u)\n", fde.name, parent); + } + } else if (parent) { + printf("Found parent: dump %s (DumpID %u)\n", fde.name, parent); } /* Expand out the volume set into its component list of volumes. */ code = bc_EvalVolumeSet(bc_globalConfig, tvs, &volsToDump, cstruct); - if (code) - { - com_err(whoami,code,"; Failed to evaluate volume set"); - return(-1); + if (code) { + com_err(whoami, code, "; Failed to evaluate volume set"); + return (-1); } - if (!volsToDump) - { - printf("No volumes to dump\n"); - return(0); + if (!volsToDump) { + printf("No volumes to dump\n"); + return (0); } /* Determine what the clone time of the volume was when it was * last dumped (tve->date). This is the time from when an * incremental should be done (remains zero if a full dump). */ - if (parent) - { - for (tve=volsToDump; tve; tve=tve->next) - { + if (parent) { + for (tve = volsToDump; tve; tve = tve->next) { code = bcdb_FindClone(parent, tve->name, &tve->date); - if (code) tve->date = 0; + if (code) + tve->date = 0; /* Get the time the volume was last cloned and see if the volume has * changed since then. Only do this when the "-n" flag is specified * because butc will get the cloneDate at time of dump. */ - if (dontExecute) - { - code = volImageTime(tve->server.sin_addr.s_addr, tve->partition, - tve->vid, tve->volType, &tve->cloneDate); - if (code) tve->cloneDate = 0; - - if (tve->cloneDate && (tve->cloneDate == tve->date)) - { - com_err(whoami,0, + if (dontExecute) { + code = + volImageTime(tve->server.sin_addr.s_addr, tve->partition, + tve->vid, tve->volType, &tve->cloneDate); + if (code) + tve->cloneDate = 0; + + if (tve->cloneDate && (tve->cloneDate == tve->date)) { + com_err(whoami, 0, "Warning: Timestamp on volume %s unchanged from previous dump", tve->name); } @@ -1974,22 +1948,27 @@ int bc_DumpCmd(as, arock) } } - if (dontExecute) printf("Would have dumped the following volumes:\n"); - else printf("Preparing to dump the following volumes:\n"); - for (tve=volsToDump; tve; tve=tve->next) { - printf("\t%s (%u)\n", tve->name, tve->vid); - } - if (dontExecute) return(0); - - code = bc_StartDmpRst(bc_globalConfig, dumpPath, vsName, volsToDump, - /*destServer*/0, /*destPartition*/0, /*fromDate*/0, - /*newExt*/0, /*oldFlag*/0, - parent, level, bc_Dumper, portp, /*portCount*/1, baseds, - doAppend, dontExecute); - if (code) com_err(whoami,code,"; Failed to queue dump"); + if (dontExecute) + printf("Would have dumped the following volumes:\n"); + else + printf("Preparing to dump the following volumes:\n"); + for (tve = volsToDump; tve; tve = tve->next) { + printf("\t%s (%u)\n", tve->name, tve->vid); + } + if (dontExecute) + return (0); + + code = bc_StartDmpRst(bc_globalConfig, dumpPath, vsName, volsToDump, + /*destServer */ 0, /*destPartition */ 0, + /*fromDate */ 0, + /*newExt */ 0, /*oldFlag */ 0, + parent, level, bc_Dumper, portp, /*portCount */ 1, + baseds, doAppend, dontExecute); + if (code) + com_err(whoami, code, "; Failed to queue dump"); - return(code); -} /*bc_DumpCmd*/ + return (code); +} /*bc_DumpCmd */ /* bc_QuitCmd @@ -2000,25 +1979,26 @@ int bc_DumpCmd(as, arock) */ bc_QuitCmd(as, arock) - struct cmd_syndesc *as; - char *arock; + struct cmd_syndesc *as; + char *arock; { - int i; - struct bc_dumpTask *td; - extern dlqlinkT statusHead; - dlqlinkP ptr; - statusP statusPtr; + int i; + struct bc_dumpTask *td; + extern dlqlinkT statusHead; + dlqlinkP ptr; + statusP statusPtr; /* Check the status list for outstanding jobs */ lock_Status(); - for ( ptr=(&statusHead)->dlq_next; ptr!=&statusHead; ptr=ptr->dlq_next ) - { - statusPtr = (statusP) ptr; - if ( !(statusPtr->flags & ABORT_REQUEST) ) - { + for (ptr = (&statusHead)->dlq_next; ptr != &statusHead; + ptr = ptr->dlq_next) { + statusPtr = (statusP) ptr; + if (!(statusPtr->flags & ABORT_REQUEST)) { unlock_Status(); - com_err(whoami,0,"Job %d still running (and not aborted)", statusPtr->jobNumber); - com_err(whoami,0,"You must at least 'kill' all running jobs before quitting"); + com_err(whoami, 0, "Job %d still running (and not aborted)", + statusPtr->jobNumber); + com_err(whoami, 0, + "You must at least 'kill' all running jobs before quitting"); return -1; } } @@ -2027,20 +2007,20 @@ bc_QuitCmd(as, arock) /* A job still being initialized (but no status structure or job number since it * has not been handed to a butc process yet) */ - for(td=bc_dumpTasks, i=0; iflags & BC_DI_INUSE) - { - com_err(whoami,0,"A job is still running"); - com_err(whoami,0,"You must at least 'kill' all running jobs before quitting"); + for (td = bc_dumpTasks, i = 0; i < BC_MAXSIMDUMPS; i++, td++) { + if (td->flags & BC_DI_INUSE) { + com_err(whoami, 0, "A job is still running"); + com_err(whoami, 0, + "You must at least 'kill' all running jobs before quitting"); return -1; } } #ifdef AFS_NT40_ENV /* close the all temp text files before quitting */ - for(i=0; iconfigText[i], &bc_globalConfig->tmpTextFileNames[i][0]); + for (i = 0; i < TB_NUM; i++) + bc_closeTextFile(&bc_globalConfig->configText[i], + &bc_globalConfig->tmpTextFileNames[i][0]); #endif exit(lastTaskCode); } @@ -2054,57 +2034,56 @@ bc_LabelTapeCmd(as, arock) struct cmd_syndesc *as; char *arock; { - char *tapename=0, *pname=0; + char *tapename = 0, *pname = 0; afs_int32 size; afs_int32 code; afs_int32 port = 0; code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); - return(code); + com_err(whoami, code, "; Can't retrieve tape hosts"); + return (code); } - if(as->parms[0].items) { /* -name */ - tapename = as->parms[0].items->data; - if (strlen(tapename) >= TC_MAXTAPELEN) { - com_err(whoami,0,"AFS tape name '%s' is too long", tapename); + if (as->parms[0].items) { /* -name */ + tapename = as->parms[0].items->data; + if (strlen(tapename) >= TC_MAXTAPELEN) { + com_err(whoami, 0, "AFS tape name '%s' is too long", tapename); return -1; - } + } } - if(as->parms[3].items) { /* -pname */ - if (tapename) { + if (as->parms[3].items) { /* -pname */ + if (tapename) { com_err(whoami, 0, "Can only specify -name or -pname"); return -1; - } - pname = as->parms[3].items->data; - if (strlen(pname) >= TC_MAXTAPELEN) { - com_err(whoami,0,"Permanent tape name '%s' is too long", pname); + } + pname = as->parms[3].items->data; + if (strlen(pname) >= TC_MAXTAPELEN) { + com_err(whoami, 0, "Permanent tape name '%s' is too long", pname); return -1; - } + } } - if (as->parms[1].items) - { + if (as->parms[1].items) { size = bc_FloatATOI(as->parms[1].items->data); if (size == -1) { - com_err(whoami,0,"Bad syntax for tape size '%s'", + com_err(whoami, 0, "Bad syntax for tape size '%s'", as->parms[1].items->data); return -1; } - } - else + } else size = 0; - if (as->parms[2].items) - { - port = getPortOffset(as->parms[2].items->data); - if (port < 0) return(BC_BADARG); + if (as->parms[2].items) { + port = getPortOffset(as->parms[2].items->data); + if (port < 0) + return (BC_BADARG); } code = bc_LabelTape(tapename, pname, size, bc_globalConfig, port); - if (code) return code; + if (code) + return code; return 0; } @@ -2115,25 +2094,27 @@ bc_LabelTapeCmd(as, arock) */ bc_ReadLabelCmd(as, arock) -struct cmd_syndesc *as; -char *arock; + struct cmd_syndesc *as; + char *arock; { afs_int32 code; afs_int32 port = 0; - + code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); - return(code); + com_err(whoami, code, "; Can't retrieve tape hosts"); + return (code); } if (as->parms[0].items) { - port = getPortOffset(as->parms[0].items->data); - if (port < 0) return(BC_BADARG); + port = getPortOffset(as->parms[0].items->data); + if (port < 0) + return (BC_BADARG); } code = bc_ReadLabel(bc_globalConfig, port); - if (code) return code; + if (code) + return code; return 0; } @@ -2152,20 +2133,20 @@ bc_ScanDumpsCmd(as, arock) code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); - return(code); + com_err(whoami, code, "; Can't retrieve tape hosts"); + return (code); } /* check for flag */ - if ( as->parms[0].items != 0 ) /* add scan to database */ - { - dbAddFlag++; + if (as->parms[0].items != 0) { /* add scan to database */ + dbAddFlag++; } /* check for port */ if (as->parms[1].items) { - port = getPortOffset(as->parms[1].items->data); - if (port < 0) return(BC_BADARG); + port = getPortOffset(as->parms[1].items->data); + if (port < 0) + return (BC_BADARG); } code = bc_ScanDumps(bc_globalConfig, dbAddFlag, port); @@ -2187,66 +2168,63 @@ bc_ParseExpiration(paramPtr, expType, expDate) afs_int32 *expType; afs_int32 *expDate; { - struct cmd_item *itemPtr; - struct ktime_date kt; - char *dateString = 0; - afs_int32 code = 0; - - *expType = BC_NO_EXPDATE; - *expDate = 0; - - if ( !paramPtr->items ) ERROR(0); /* no expiration specified */ - - /* some form of expiration date specified. First validate the prefix */ - itemPtr = paramPtr->items; - - if ( strcmp(itemPtr->data, "at") == 0 ) - { - *expType = BC_ABS_EXPDATE; - - dateString = concatParams(itemPtr->next); - if (!dateString) ERROR(1); - - code = ktime_DateToLong(dateString, expDate); - if (code) ERROR(1); - } - else - if ( strcmp(itemPtr->data, "in") == 0 ) - { - *expType = BC_REL_EXPDATE; - - dateString = concatParams(itemPtr->next); - if (!dateString) ERROR(1); - - code = ParseRelDate(dateString, &kt); - if (code) ERROR(1); - *expDate = ktimeRelDate_ToLong(&kt); - } - else - { - dateString = concatParams(itemPtr); - if (!dateString) ERROR(1); - - if ( ktime_DateToLong(dateString,expDate) == 0 ) - { - *expType = BC_ABS_EXPDATE; - code = ktime_DateToLong(dateString, expDate); - if (code) ERROR(1); - } - else if ( ParseRelDate(dateString,&kt) == 0 ) - { - *expType = BC_REL_EXPDATE; - *expDate = ktimeRelDate_ToLong(&kt); - } - else - { - ERROR(1); - } - } - -error_exit: - if (dateString) free(dateString); - return(code); + struct cmd_item *itemPtr; + struct ktime_date kt; + char *dateString = 0; + afs_int32 code = 0; + + *expType = BC_NO_EXPDATE; + *expDate = 0; + + if (!paramPtr->items) + ERROR(0); /* no expiration specified */ + + /* some form of expiration date specified. First validate the prefix */ + itemPtr = paramPtr->items; + + if (strcmp(itemPtr->data, "at") == 0) { + *expType = BC_ABS_EXPDATE; + + dateString = concatParams(itemPtr->next); + if (!dateString) + ERROR(1); + + code = ktime_DateToLong(dateString, expDate); + if (code) + ERROR(1); + } else if (strcmp(itemPtr->data, "in") == 0) { + *expType = BC_REL_EXPDATE; + + dateString = concatParams(itemPtr->next); + if (!dateString) + ERROR(1); + + code = ParseRelDate(dateString, &kt); + if (code) + ERROR(1); + *expDate = ktimeRelDate_ToLong(&kt); + } else { + dateString = concatParams(itemPtr); + if (!dateString) + ERROR(1); + + if (ktime_DateToLong(dateString, expDate) == 0) { + *expType = BC_ABS_EXPDATE; + code = ktime_DateToLong(dateString, expDate); + if (code) + ERROR(1); + } else if (ParseRelDate(dateString, &kt) == 0) { + *expType = BC_REL_EXPDATE; + *expDate = ktimeRelDate_ToLong(&kt); + } else { + ERROR(1); + } + } + + error_exit: + if (dateString) + free(dateString); + return (code); } /* database lookup command and routines */ @@ -2264,11 +2242,11 @@ bc_dblookupCmd(as, arock) afs_int32 code; ciptr = as->parms[0].items; - if ( ciptr == 0 ) /* no argument specified */ - return(-1); + if (ciptr == 0) /* no argument specified */ + return (-1); code = DBLookupByVolume(ciptr->data); - return(code); + return (code); } @@ -2284,141 +2262,148 @@ bc_dbVerifyCmd(as, arock) afs_int32 host; struct hostent *hostPtr; - int detail; + int detail; afs_int32 code = 0; extern struct udbHandleS udbHandle; - extern afs_int32 BUDB_DbVerify(); - - detail = (as->parms[0].items ? 1 : 0); /* print more details */ - code = ubik_Call(BUDB_DbVerify, udbHandle.uh_client, 0, - &status, &orphans, &host); + detail = (as->parms[0].items ? 1 : 0); /* print more details */ - if (code) - { + code = + ubik_Call(BUDB_DbVerify, udbHandle.uh_client, 0, &status, &orphans, + &host); + + if (code) { com_err(whoami, code, "; Unable to verify database"); - return(-1); + return (-1); } /* verification call succeeded */ - + if (status == 0) printf("Database OK\n"); else com_err(whoami, status, "; Database is NOT_OK"); - if (detail) - { + if (detail) { printf("Orphan blocks %d\n", orphans); if (!host) printf("Unable to lookup host id\n"); - else - { - hostPtr = gethostbyaddr((char *) &host, sizeof(host), AF_INET); - if (hostPtr == 0 ) - printf("Database checker was %d.%d.%d.%d\n", - ((host&0xFF000000)>>24), ((host&0xFF0000)>>16), - ((host&0xFF00)>>8), (host&0xFF)); + else { + hostPtr = gethostbyaddr((char *)&host, sizeof(host), AF_INET); + if (hostPtr == 0) + printf("Database checker was %d.%d.%d.%d\n", + ((host & 0xFF000000) >> 24), ((host & 0xFF0000) >> 16), + ((host & 0xFF00) >> 8), (host & 0xFF)); else - printf("Database checker was %s\n", hostPtr->h_name); + printf("Database checker was %s\n", hostPtr->h_name); } } - return((status ? -1 : 0)); + return ((status ? -1 : 0)); } /* deleteDump: * Delete a dump. If port is >= 0, it means try to delete from XBSA server */ deleteDump(dumpid, port, force) - afs_uint32 dumpid; /* The dumpid to delete */ - afs_int32 port; /* port==-1 means don't go to butc */ - afs_int32 force; + afs_uint32 dumpid; /* The dumpid to delete */ + afs_int32 port; /* port==-1 means don't go to butc */ + afs_int32 force; { - afs_int32 code=0, tcode; - struct budb_dumpEntry dumpEntry; - struct rx_connection *tconn=0; - afs_int32 i, taskflag, xbsadump; - statusP statusPtr=0; - budb_dumpsList dumps; - afs_uint32 taskId; - - /* If the port is set, we will try to send a delete request to the butc */ - if (port >= 0) { - tcode = bc_UpdateHosts(); - if (tcode) { - com_err(whoami, tcode, "; Can't retrieve tape hosts"); - ERROR(tcode); - } - - /* Find the dump in the backup database */ - tcode = bcdb_FindDumpByID(dumpid, &dumpEntry); - if (tcode) { - com_err(whoami, tcode, "; Unable to locate dumpID %u in database", dumpid); - ERROR(tcode); - } - xbsadump = (dumpEntry.flags & (BUDB_DUMP_ADSM|BUDB_DUMP_BUTA)); - - /* If dump is to an XBSA server, connect to butc and send it - * the dump to delete. Butc will contact the XBSA server. - * The dump will not be an appended dump because XBSA butc - * does not support the append option. - */ - if (xbsadump && dumpEntry.nVolumes) { - tcode = ConnectButc(bc_globalConfig, port, &tconn); - if (tcode) ERROR(tcode); - - tcode = TC_DeleteDump(tconn, dumpid, &taskId); - if (tcode) { - if (tcode == RXGEN_OPCODE) tcode = BC_VERSIONFAIL; - com_err(whoami, tcode, "; Unable to delete dumpID %u via butc", dumpid); + afs_int32 code = 0, tcode; + struct budb_dumpEntry dumpEntry; + struct rx_connection *tconn = 0; + afs_int32 i, taskflag, xbsadump; + statusP statusPtr = 0; + budb_dumpsList dumps; + afs_uint32 taskId; + + /* If the port is set, we will try to send a delete request to the butc */ + if (port >= 0) { + tcode = bc_UpdateHosts(); + if (tcode) { + com_err(whoami, tcode, "; Can't retrieve tape hosts"); + ERROR(tcode); + } + + /* Find the dump in the backup database */ + tcode = bcdb_FindDumpByID(dumpid, &dumpEntry); + if (tcode) { + com_err(whoami, tcode, "; Unable to locate dumpID %u in database", + dumpid); ERROR(tcode); - } - - statusPtr = createStatusNode(); - lock_Status(); - statusPtr->taskId = taskId; - statusPtr->port = port; - statusPtr->jobNumber = bc_jobNumber(); - statusPtr->flags |= (SILENT|NOREMOVE); /* No msg & keep statusPtr */ - statusPtr->flags &= ~STARTING; /* clearstatus to examine */ - sprintf(statusPtr->taskName, "DeleteDump"); - unlock_Status(); - - /* Wait for task to finish */ - taskflag = waitForTask(taskId); - if (taskflag & (TASK_ERROR|ABORT_DONE)) { - com_err(whoami, BUTX_DELETEOBJFAIL, "; Unable to delete dumpID %u via butc", dumpid); - ERROR(BUTX_DELETEOBJFAIL); /* the task failed */ - } - } - } + } + xbsadump = (dumpEntry.flags & (BUDB_DUMP_ADSM | BUDB_DUMP_BUTA)); + + /* If dump is to an XBSA server, connect to butc and send it + * the dump to delete. Butc will contact the XBSA server. + * The dump will not be an appended dump because XBSA butc + * does not support the append option. + */ + if (xbsadump && dumpEntry.nVolumes) { + tcode = ConnectButc(bc_globalConfig, port, &tconn); + if (tcode) + ERROR(tcode); + + tcode = TC_DeleteDump(tconn, dumpid, &taskId); + if (tcode) { + if (tcode == RXGEN_OPCODE) + tcode = BC_VERSIONFAIL; + com_err(whoami, tcode, + "; Unable to delete dumpID %u via butc", dumpid); + ERROR(tcode); + } + + statusPtr = createStatusNode(); + lock_Status(); + statusPtr->taskId = taskId; + statusPtr->port = port; + statusPtr->jobNumber = bc_jobNumber(); + statusPtr->flags |= (SILENT | NOREMOVE); /* No msg & keep statusPtr */ + statusPtr->flags &= ~STARTING; /* clearstatus to examine */ + sprintf(statusPtr->taskName, "DeleteDump"); + unlock_Status(); + + /* Wait for task to finish */ + taskflag = waitForTask(taskId); + if (taskflag & (TASK_ERROR | ABORT_DONE)) { + com_err(whoami, BUTX_DELETEOBJFAIL, + "; Unable to delete dumpID %u via butc", dumpid); + ERROR(BUTX_DELETEOBJFAIL); /* the task failed */ + } + } + } error_exit: - if (statusPtr) deleteStatusNode(statusPtr); /* Clean up statusPtr - because NOREMOVE */ - if (tconn) rx_DestroyConnection(tconn); /* Destroy the connection */ - - /* Remove the dump from the backup database */ - if (!code || force) { - dumps.budb_dumpsList_len = 0; - dumps.budb_dumpsList_val = 0; - - tcode = bcdb_deleteDump(dumpid, 0, 0, &dumps); - if (tcode) { - com_err(whoami, tcode, "; Unable to delete dumpID %u from database", dumpid); - dumps.budb_dumpsList_len = 0; - if (!code) code = tcode; - } - - /* Display the dumps that were deleted - includes appended dumps */ - for (i=0; i0)?" Appended Dump":""); - if (dumps.budb_dumpsList_val) free(dumps.budb_dumpsList_val); - } - - return code; + if (statusPtr) + deleteStatusNode(statusPtr); /* Clean up statusPtr - because NOREMOVE */ + if (tconn) + rx_DestroyConnection(tconn); /* Destroy the connection */ + + /* Remove the dump from the backup database */ + if (!code || force) { + dumps.budb_dumpsList_len = 0; + dumps.budb_dumpsList_val = 0; + + tcode = bcdb_deleteDump(dumpid, 0, 0, &dumps); + if (tcode) { + com_err(whoami, tcode, + "; Unable to delete dumpID %u from database", dumpid); + dumps.budb_dumpsList_len = 0; + if (!code) + code = tcode; + } + + /* Display the dumps that were deleted - includes appended dumps */ + for (i = 0; i < dumps.budb_dumpsList_len; i++) + printf(" %u%s\n", dumps.budb_dumpsList_val[i], + (i > 0) ? " Appended Dump" : ""); + if (dumps.budb_dumpsList_val) + free(dumps.budb_dumpsList_val); + } + + return code; } /* bc_deleteDumpCmd @@ -2432,94 +2417,96 @@ bc_deleteDumpCmd(as, arock) char *arock; { afs_uint32 dumpid; - afs_int32 code = 0; + afs_int32 code = 0; afs_int32 rcode = 0; - afs_int32 groupId=0, havegroupid, sflags, noexecute; + afs_int32 groupId = 0, havegroupid, sflags, noexecute; struct cmd_item *ti; - afs_uint32 fromTime=0, toTime=0, havetime=0; - char *timeString; + afs_uint32 fromTime = 0, toTime = 0, havetime = 0; + char *timeString; budb_dumpsList dumps, flags; int i; - afs_int32 port=-1, dbonly=0, force; - afs_uint32 taskid; + afs_int32 port = -1, dbonly = 0, force; /* Must specify at least one of -dumpid, -from, or -to */ - if ( !as->parms[0].items && !as->parms[1].items && !as->parms[2].items && - !as->parms[4].items) { + if (!as->parms[0].items && !as->parms[1].items && !as->parms[2].items + && !as->parms[4].items) { com_err(whoami, 0, "Must specify at least one field"); - return(-1); + return (-1); } /* Must have -to option with -from option */ - if ( as->parms[1].items && !as->parms[2].items ) { + if (as->parms[1].items && !as->parms[2].items) { com_err(whoami, 0, "Must specify '-to' field with '-from' field"); - return(-1); + return (-1); } /* Get the time to delete from */ - if ( as->parms[1].items ) { /* -from */ + if (as->parms[1].items) { /* -from */ timeString = concatParams(as->parms[1].items); - if (!timeString) return(-1); + if (!timeString) + return (-1); /* * Now parse this string for the time to start. */ code = ktime_DateToLong(timeString, &fromTime); - free (timeString); - if ( code ) - { - com_err(whoami,0,"Can't parse 'from' date and time"); - com_err(whoami,0,"%s", ktime_GetDateUsage()); - return(-1); + free(timeString); + if (code) { + com_err(whoami, 0, "Can't parse 'from' date and time"); + com_err(whoami, 0, "%s", ktime_GetDateUsage()); + return (-1); } havetime = 1; } - port = (as->parms[3].items ? getPortOffset(as->parms[3].items->data) : 0); /* -port */ - if (as->parms[5].items) /* -dbonly */ - port = -1; - - force = (as->parms[6].items ? 1 : 0); + port = (as->parms[3].items ? getPortOffset(as->parms[3].items->data) : 0); /* -port */ + if (as->parms[5].items) /* -dbonly */ + port = -1; + + force = (as->parms[6].items ? 1 : 0); - havegroupid = (as->parms[4].items ? 1 : 0); - if (havegroupid) groupId = atoi(as->parms[4].items->data); + havegroupid = (as->parms[4].items ? 1 : 0); + if (havegroupid) + groupId = atoi(as->parms[4].items->data); - noexecute = (as->parms[7].items ? 1 : 0); + noexecute = (as->parms[7].items ? 1 : 0); /* Get the time to delete to */ - if ( as->parms[2].items ) { /* -to */ + if (as->parms[2].items) { /* -to */ timeString = concatParams(as->parms[2].items); - if (!timeString) return(-1); + if (!timeString) + return (-1); /* * Now parse this string for the time to start. Simce * times are at minute granularity, add 59 seconds. */ code = ktime_DateToLong(timeString, &toTime); - free (timeString); - if ( code ) - { - com_err(whoami,0,"Can't parse 'to' date and time"); - com_err(whoami,0,"%s", ktime_GetDateUsage()); - return(-1); + free(timeString); + if (code) { + com_err(whoami, 0, "Can't parse 'to' date and time"); + com_err(whoami, 0, "%s", ktime_GetDateUsage()); + return (-1); } toTime += 59; havetime = 1; } - if ( fromTime > toTime ) { - com_err(whoami, 0, "'-from' date/time cannot be later than '-to' date/time"); - return(-1); + if (fromTime > toTime) { + com_err(whoami, 0, + "'-from' date/time cannot be later than '-to' date/time"); + return (-1); } /* Remove speicific dump ids - if any */ - printf("The following dumps %s deleted:\n", (noexecute?"would have been":"were")); - for ( ti=as->parms[0].items; ti != 0; ti=ti->next ) { /* -dumpid */ - dumpid = atoi(ti->data); + printf("The following dumps %s deleted:\n", + (noexecute ? "would have been" : "were")); + for (ti = as->parms[0].items; ti != 0; ti = ti->next) { /* -dumpid */ + dumpid = atoi(ti->data); if (!noexecute) { - code = deleteDump(dumpid, port, force); + code = deleteDump(dumpid, port, force); } else { - printf(" %u\n", dumpid); + printf(" %u\n", dumpid); } } @@ -2532,40 +2519,52 @@ bc_deleteDumpCmd(as, arock) flags.budb_dumpsList_len = 0; flags.budb_dumpsList_val = 0; sflags = 0; - if (havegroupid) sflags |= BUDB_OP_GROUPID; - if (havetime) sflags |= BUDB_OP_DATES; + if (havegroupid) + sflags |= BUDB_OP_GROUPID; + if (havetime) + sflags |= BUDB_OP_DATES; - code = bcdb_listDumps(sflags, groupId, fromTime, toTime, &dumps, &flags); - if ( code ) { - com_err(whoami, code, "; Error while deleting dumps from %u to %u", - fromTime, toTime); + code = + bcdb_listDumps(sflags, groupId, fromTime, toTime, &dumps, &flags); + if (code) { + com_err(whoami, code, + "; Error while deleting dumps from %u to %u", fromTime, + toTime); rcode = -1; } - for (i=0; iparms[0].items) { portOffset = getPortOffset(as->parms[0].items->data); - if (portOffset < 0) return(BC_BADARG); + if (portOffset < 0) + return (BC_BADARG); } /* Get the time to delete to */ - if ( as->parms[1].items ) - { + if (as->parms[1].items) { timeString = concatParams(as->parms[1].items); - if (!timeString) return(-1); + if (!timeString) + return (-1); /* * Now parse this string for the time. Since * times are at minute granularity, add 59 seconds. */ code = ktime_DateToLong(timeString, &toTime); - free (timeString); - if ( code ) - { - com_err(whoami,0,"Can't parse '-archive' date and time"); - com_err(whoami,0,"%s", ktime_GetDateUsage()); - return(-1); + free(timeString); + if (code) { + com_err(whoami, 0, "Can't parse '-archive' date and time"); + com_err(whoami, 0, "%s", ktime_GetDateUsage()); + return (-1); } toTime += 59; - } - else - toTime = 0; + } else + toTime = 0; code = ConnectButc(bc_globalConfig, portOffset, &tconn); - if (code) return(code); - - code = TC_SaveDb(tconn, toTime, &taskId); if (code) - { + return (code); + + code = TC_SaveDb(tconn, toTime, &taskId); + if (code) { com_err(whoami, code, "; Failed to save database"); goto exit; } @@ -2627,16 +2625,16 @@ bc_saveDbCmd(as, arock) /* create status monitor block */ statusPtr = createStatusNode(); lock_Status(); - statusPtr->taskId = taskId; - statusPtr->port = portOffset; + statusPtr->taskId = taskId; + statusPtr->port = portOffset; statusPtr->jobNumber = bc_jobNumber(); - statusPtr->flags &= ~STARTING; /* clearstatus to examine */ + statusPtr->flags &= ~STARTING; /* clearstatus to examine */ sprintf(statusPtr->taskName, "SaveDb"); unlock_Status(); -exit: + exit: rx_DestroyConnection(tconn); - return(code); + return (code); } bc_restoreDbCmd(as, arock) @@ -2651,21 +2649,22 @@ bc_restoreDbCmd(as, arock) code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); - return(code); + com_err(whoami, code, "; Can't retrieve tape hosts"); + return (code); } if (as->parms[0].items) { - portOffset = getPortOffset(as->parms[0].items->data); - if (portOffset < 0) return(BC_BADARG); + portOffset = getPortOffset(as->parms[0].items->data); + if (portOffset < 0) + return (BC_BADARG); } code = ConnectButc(bc_globalConfig, portOffset, &tconn); - if (code) return(code); - - code = TC_RestoreDb(tconn, &taskId); if (code) - { + return (code); + + code = TC_RestoreDb(tconn, &taskId); + if (code) { com_err(whoami, code, "; Failed to restore database"); goto exit; } @@ -2673,16 +2672,16 @@ bc_restoreDbCmd(as, arock) /* create status monitor block */ statusPtr = createStatusNode(); lock_Status(); - statusPtr->taskId = taskId; - statusPtr->port = portOffset; - statusPtr->jobNumber = bc_jobNumber(); - statusPtr->flags &= ~STARTING; /* clearstatus to examine */ + statusPtr->taskId = taskId; + statusPtr->port = portOffset; + statusPtr->jobNumber = bc_jobNumber(); + statusPtr->flags &= ~STARTING; /* clearstatus to examine */ sprintf(statusPtr->taskName, "RestoreDb"); unlock_Status(); -exit: + exit: rx_DestroyConnection(tconn); - return(code); + return (code); } /* ---------------------------------- @@ -2692,14 +2691,13 @@ exit: /* structures and defines for DBLookupByVolume */ -#define DBL_MAX_VOLUMES 20 /* max. for each dump */ +#define DBL_MAX_VOLUMES 20 /* max. for each dump */ /* dumpedVol - saves interesting information so that we can print it out * later */ -struct dumpedVol -{ +struct dumpedVol { struct dumpedVol *next; afs_int32 dumpID; afs_int32 initialDumpID; @@ -2707,7 +2705,7 @@ struct dumpedVol afs_int32 level; afs_int32 parent; afs_int32 createTime; - afs_int32 incTime; /* actually the clone time */ + afs_int32 incTime; /* actually the clone time */ }; /* ----------------------------------------- @@ -2728,123 +2726,124 @@ DBLookupByVolume(volumeName) struct budb_volumeEntry volumeEntry[DBL_MAX_VOLUMES]; afs_int32 numEntries; afs_int32 tapedumpid; - afs_int32 last,next; + afs_int32 last, next; struct dumpedVol *dvptr = 0; struct dumpedVol *tempPtr = 0; - afs_int32 code=0; + afs_int32 code = 0; int i, pass; char vname[BU_MAXNAMELEN]; char ds[50]; - + for (pass = 0; pass < 2; pass++) { - /*p*/ - /* On second pass, search for backup volume */ - if (pass == 1) { - if (!BackupName(volumeName)) { - strcpy(vname, volumeName); - strcat(vname, ".backup"); - volumeName = vname; - } - else { - continue; - } - } - - last = next = 0; - while ( next != -1 ) - { /*w*/ - code = bcdb_LookupVolume(volumeName, &volumeEntry[0], - last, &next, DBL_MAX_VOLUMES, &numEntries); - if (code) break; - - /* add the volumes to the list */ - for ( i = 0; i < numEntries; i++ ) - { /*f*/ - struct dumpedVol *insPtr, **prevPtr; - - tempPtr = (struct dumpedVol *) malloc(sizeof(struct dumpedVol)); - if (!tempPtr) ERROR(BC_NOMEM); - - memset(tempPtr, 0, sizeof(*tempPtr)); - tempPtr->incTime = volumeEntry[i].clone; - tempPtr->dumpID = volumeEntry[i].dump; - strncpy(tempPtr->tapeName, volumeEntry[i].tape, BU_MAXTAPELEN); - - /* check if we need to null terminate it - just for safety */ - if ( strlen(volumeEntry[i].tape) >= BU_MAXTAPELEN ) - tempPtr->tapeName[BU_MAXTAPELEN-1] = 0; - - code = bcdb_FindDumpByID(tempPtr->dumpID, &dumpEntry); - if (code) - { - free(tempPtr); - ERROR(code); - } - - tempPtr->initialDumpID = dumpEntry.initialDumpID; - tempPtr->parent = dumpEntry.parent; - tempPtr->level = dumpEntry.level; - tempPtr->createTime = dumpEntry.created; - - /* add volume to list in reverse chronological order */ - prevPtr = &dvptr; - insPtr = dvptr; - - while ( (insPtr != 0) - && (insPtr->createTime > tempPtr->createTime) - ) - { - prevPtr = &insPtr->next; - insPtr = insPtr->next; - } - - /* now at the right place - insert the block */ - tempPtr->next = *prevPtr; - *prevPtr = tempPtr; - } /*f*/ - - last = next; - } /*w*/ - } /*p*/ - + /*p */ + /* On second pass, search for backup volume */ + if (pass == 1) { + if (!BackupName(volumeName)) { + strcpy(vname, volumeName); + strcat(vname, ".backup"); + volumeName = vname; + } else { + continue; + } + } + + last = next = 0; + while (next != -1) { /*w */ + code = + bcdb_LookupVolume(volumeName, &volumeEntry[0], last, &next, + DBL_MAX_VOLUMES, &numEntries); + if (code) + break; + + /* add the volumes to the list */ + for (i = 0; i < numEntries; i++) { /*f */ + struct dumpedVol *insPtr, **prevPtr; + + tempPtr = + (struct dumpedVol *)malloc(sizeof(struct dumpedVol)); + if (!tempPtr) + ERROR(BC_NOMEM); + + memset(tempPtr, 0, sizeof(*tempPtr)); + tempPtr->incTime = volumeEntry[i].clone; + tempPtr->dumpID = volumeEntry[i].dump; + strncpy(tempPtr->tapeName, volumeEntry[i].tape, + BU_MAXTAPELEN); + + /* check if we need to null terminate it - just for safety */ + if (strlen(volumeEntry[i].tape) >= BU_MAXTAPELEN) + tempPtr->tapeName[BU_MAXTAPELEN - 1] = 0; + + code = bcdb_FindDumpByID(tempPtr->dumpID, &dumpEntry); + if (code) { + free(tempPtr); + ERROR(code); + } + + tempPtr->initialDumpID = dumpEntry.initialDumpID; + tempPtr->parent = dumpEntry.parent; + tempPtr->level = dumpEntry.level; + tempPtr->createTime = dumpEntry.created; + + /* add volume to list in reverse chronological order */ + prevPtr = &dvptr; + insPtr = dvptr; + + while ((insPtr != 0) + && (insPtr->createTime > tempPtr->createTime) + ) { + prevPtr = &insPtr->next; + insPtr = insPtr->next; + } + + /* now at the right place - insert the block */ + tempPtr->next = *prevPtr; + *prevPtr = tempPtr; + } /*f */ + + last = next; + } /*w */ + } /*p */ + if (dvptr) { - printf("DumpID lvl parentID creation date clone date tape name\n"); - for (tempPtr = dvptr; tempPtr; tempPtr = tempPtr->next) { - /* For the user, the tape name is its name and initial dump id */ - tapedumpid = (tempPtr->initialDumpID ? tempPtr->initialDumpID : tempPtr->dumpID); - - /* beware the static items in compactDateString */ - compactDateString(&tempPtr->createTime, ds, 50); - printf("%-9d %-2d %-9d %16s", - tempPtr->dumpID, tempPtr->level, tempPtr->parent, ds); - compactDateString(&tempPtr->incTime, ds, 50); - printf(" %16s %s (%u)\n", ds, tempPtr->tapeName, tapedumpid); - } - code = 0; - } - -error_exit: + printf + ("DumpID lvl parentID creation date clone date tape name\n"); + for (tempPtr = dvptr; tempPtr; tempPtr = tempPtr->next) { + /* For the user, the tape name is its name and initial dump id */ + tapedumpid = + (tempPtr->initialDumpID ? tempPtr->initialDumpID : tempPtr-> + dumpID); + + /* beware the static items in compactDateString */ + compactDateString(&tempPtr->createTime, ds, 50); + printf("%-9d %-2d %-9d %16s", tempPtr->dumpID, tempPtr->level, + tempPtr->parent, ds); + compactDateString(&tempPtr->incTime, ds, 50); + printf(" %16s %s (%u)\n", ds, tempPtr->tapeName, tapedumpid); + } + code = 0; + } + + error_exit: for (tempPtr = dvptr; tempPtr; tempPtr = dvptr) { dvptr = dvptr->next; free(tempPtr); } if (code) - com_err(whoami, code, ""); - return(code); + com_err(whoami, code, ""); + return (code); } /* structures for dumpInfo */ -struct volumeLink -{ +struct volumeLink { struct volumeLink *nextVolume; struct budb_volumeEntry volumeEntry; }; -struct tapeLink -{ +struct tapeLink { struct tapeLink *nextTape; struct budb_tapeEntry tapeEntry; struct volumeLink *firstVolume; @@ -2868,7 +2867,6 @@ dumpInfo(dumpid, detailFlag) budb_volumeList vl; afs_int32 last, next, dbTime; afs_int32 tapedumpid; - afs_int32 numTapes; int tapeNumber; int i; @@ -2882,20 +2880,21 @@ dumpInfo(dumpid, detailFlag) lastTapeLinkPtr = 0; volumeLinkPtr = 0; lastVolumeLinkPtr = 0; - + /* first get information about the dump */ code = bcdb_FindDumpByID(dumpid, &dumpEntry); - if (code) ERROR(code); + if (code) + ERROR(code); /* For the user, the tape name is its name and initial dump id */ tapedumpid = (dumpEntry.initialDumpID ? dumpEntry.initialDumpID : dumpid); /* Is this a database dump id or not */ - if ( strcmp(dumpEntry.name,DUMP_TAPE_NAME) == 0 ) - dbDump = 1; + if (strcmp(dumpEntry.name, DUMP_TAPE_NAME) == 0) + dbDump = 1; else - dbDump = 0; + dbDump = 0; /* print out the information about the dump */ if (detailFlag) { @@ -2903,101 +2902,90 @@ dumpInfo(dumpid, detailFlag) printf("----\n"); printDumpEntry(&dumpEntry); } else { - if ( dbDump ) - printf("Dump: id %u, created: %s\n", - dumpEntry.id, ctime(&dumpEntry.created)); + if (dbDump) + printf("Dump: id %u, created: %s\n", dumpEntry.id, + ctime(&dumpEntry.created)); else printf("Dump: id %u, level %d, volumes %d, created: %s\n", dumpEntry.id, dumpEntry.level, dumpEntry.nVolumes, ctime(&dumpEntry.created)); } - if ( !detailFlag && (strlen(dumpEntry.tapes.tapeServer) > 0) && - (dumpEntry.flags & (BUDB_DUMP_ADSM | BUDB_DUMP_BUTA)) ) { - printf("Backup Service: TSM: Server: %s\n", - dumpEntry.tapes.tapeServer); + if (!detailFlag && (strlen(dumpEntry.tapes.tapeServer) > 0) + && (dumpEntry.flags & (BUDB_DUMP_ADSM | BUDB_DUMP_BUTA))) { + printf("Backup Service: TSM: Server: %s\n", + dumpEntry.tapes.tapeServer); } /* now get the list of tapes */ - for (tapeNumber=dumpEntry.tapes.b; tapeNumber<=dumpEntry.tapes.maxTapes; tapeNumber++) - { /*f*/ - tapeLinkPtr = (struct tapeLink *) malloc(sizeof(struct tapeLink)); - if (!tapeLinkPtr) - { - com_err(whoami,BC_NOMEM,""); + for (tapeNumber = dumpEntry.tapes.b; tapeNumber <= dumpEntry.tapes.maxTapes; tapeNumber++) { /*f */ + tapeLinkPtr = (struct tapeLink *)malloc(sizeof(struct tapeLink)); + if (!tapeLinkPtr) { + com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } memset(tapeLinkPtr, 0, sizeof(*tapeLinkPtr)); code = bcdb_FindTapeSeq(dumpid, tapeNumber, &tapeLinkPtr->tapeEntry); - if (code) - { + if (code) { code = 0; free(tapeLinkPtr); continue; } /* add this tape to previous chain */ - if (lastTapeLinkPtr) - { + if (lastTapeLinkPtr) { lastTapeLinkPtr->nextTape = tapeLinkPtr; lastTapeLinkPtr = tapeLinkPtr; } - if (head == 0) - { + if (head == 0) { head = tapeLinkPtr; lastTapeLinkPtr = head; } next = 0; - while (next != -1) - { /*wn*/ + while (next != -1) { /*wn */ vl.budb_volumeList_len = 0; vl.budb_volumeList_val = 0; last = next; /* now get all the volumes in this dump. */ - code = ubik_Call_SingleServer(BUDB_GetVolumes, udbHandle.uh_client, - UF_SINGLESERVER, - BUDB_MAJORVERSION, - BUDB_OP_DUMPID | BUDB_OP_TAPENAME, - tapeLinkPtr->tapeEntry.name, /* tape name */ - dumpid, /* dumpid (not initial dumpid) */ - 0, /* end */ - last, /* last */ - &next, /* nextindex */ - &dbTime, /* update time */ + code = ubik_Call_SingleServer(BUDB_GetVolumes, udbHandle.uh_client, UF_SINGLESERVER, BUDB_MAJORVERSION, BUDB_OP_DUMPID | BUDB_OP_TAPENAME, tapeLinkPtr->tapeEntry.name, /* tape name */ + dumpid, /* dumpid (not initial dumpid) */ + 0, /* end */ + last, /* last */ + &next, /* nextindex */ + &dbTime, /* update time */ &vl); - if (code) - { - if ( code == BUDB_ENDOFLIST ) /* 0 volumes on tape */ - { + if (code) { + if (code == BUDB_ENDOFLIST) { /* 0 volumes on tape */ code = 0; break; } ERROR(code); } - for (i=0; ifirstVolume; - volumeLinkPtr = (struct volumeLink *) malloc(sizeof(struct volumeLink)); - if (!volumeLinkPtr) - { - com_err(whoami,BC_NOMEM,""); + volumeLinkPtr = + (struct volumeLink *)malloc(sizeof(struct volumeLink)); + if (!volumeLinkPtr) { + com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } memset(volumeLinkPtr, 0, sizeof(*volumeLinkPtr)); - memcpy(&volumeLinkPtr->volumeEntry, &vl.budb_volumeList_val[i], sizeof(struct budb_volumeEntry)); + memcpy(&volumeLinkPtr->volumeEntry, + &vl.budb_volumeList_val[i], + sizeof(struct budb_volumeEntry)); /* now insert it onto the right place */ - while ( (*link != 0) && - (volumeLinkPtr->volumeEntry.position > (*link)->volumeEntry.position) ) - { + while ((*link != 0) + && (volumeLinkPtr->volumeEntry.position > + (*link)->volumeEntry.position)) { link = &((*link)->nextVolume); } @@ -3006,24 +2994,25 @@ dumpInfo(dumpid, detailFlag) *link = volumeLinkPtr; } - if (vl.budb_volumeList_val) free(vl.budb_volumeList_val); - } /*wn*/ - } /*f*/ + if (vl.budb_volumeList_val) + free(vl.budb_volumeList_val); + } /*wn */ + } /*f */ - for (tapeLinkPtr=head; tapeLinkPtr; tapeLinkPtr=tapeLinkPtr->nextTape) - { + for (tapeLinkPtr = head; tapeLinkPtr; tapeLinkPtr = tapeLinkPtr->nextTape) { if (detailFlag) { printf("\nTape\n"); printf("----\n"); printTapeEntry(&tapeLinkPtr->tapeEntry); } else { - printf("Tape: name %s (%u)\n", tapeLinkPtr->tapeEntry.name, tapedumpid); + printf("Tape: name %s (%u)\n", tapeLinkPtr->tapeEntry.name, + tapedumpid); printf("nVolumes %d, ", tapeLinkPtr->tapeEntry.nVolumes); compactDateString(&tapeLinkPtr->tapeEntry.written, ds, 50); printf("created %16s", ds); - if ( tapeLinkPtr->tapeEntry.expires != 0 ) { - compactDateString(&tapeLinkPtr->tapeEntry.expires, ds, 50); - printf(", expires %16s", ds); + if (tapeLinkPtr->tapeEntry.expires != 0) { + compactDateString(&tapeLinkPtr->tapeEntry.expires, ds, 50); + printf(", expires %16s", ds); } printf("\n\n"); } @@ -3031,70 +3020,65 @@ dumpInfo(dumpid, detailFlag) /* print out all the volumes */ /* print header for volume listing - db dumps have no volumes */ - if ( (detailFlag == 0) && !dbDump ) - printf("%4s %16s %9s %-s\n", "Pos", "Clone time", "Nbytes", "Volume"); - - for (volumeLinkPtr=tapeLinkPtr->firstVolume; volumeLinkPtr; - volumeLinkPtr=volumeLinkPtr->nextVolume) - { - if (detailFlag) - { + if ((detailFlag == 0) && !dbDump) + printf("%4s %16s %9s %-s\n", "Pos", "Clone time", "Nbytes", + "Volume"); + + for (volumeLinkPtr = tapeLinkPtr->firstVolume; volumeLinkPtr; + volumeLinkPtr = volumeLinkPtr->nextVolume) { + if (detailFlag) { printf("\nVolume\n"); printf("------\n"); printVolumeEntry(&volumeLinkPtr->volumeEntry); - } - else - { - compactDateString(&volumeLinkPtr->volumeEntry.clone, ds, 50), - printf("%4d %s %10u %16s\n", - volumeLinkPtr->volumeEntry.position, - ds, - volumeLinkPtr->volumeEntry.nBytes, - volumeLinkPtr->volumeEntry.name); + } else { + compactDateString(&volumeLinkPtr->volumeEntry.clone, ds, 50), + printf("%4d %s %10u %16s\n", + volumeLinkPtr->volumeEntry.position, ds, + volumeLinkPtr->volumeEntry.nBytes, + volumeLinkPtr->volumeEntry.name); } } } -error_exit: - if (code) com_err("dumpInfo", code, "; Can't get dump information"); + error_exit: + if (code) + com_err("dumpInfo", code, "; Can't get dump information"); /* free all allocated structures */ tapeLinkPtr = head; - while ( tapeLinkPtr ) - { + while (tapeLinkPtr) { volumeLinkPtr = tapeLinkPtr->firstVolume; - while ( volumeLinkPtr ) - { + while (volumeLinkPtr) { lastVolumeLinkPtr = volumeLinkPtr; volumeLinkPtr = volumeLinkPtr->nextVolume; free(lastVolumeLinkPtr); } - + lastTapeLinkPtr = tapeLinkPtr; tapeLinkPtr = tapeLinkPtr->nextTape; free(lastTapeLinkPtr); } - return(code); + return (code); } +int compareDump(ptr1, ptr2) struct budb_dumpEntry *ptr1, *ptr2; { - if ( ptr1->created < ptr2->created ) - return(-1); - else - if ( ptr1->created > ptr2->created ) - return(1); - return(0); + if (ptr1->created < ptr2->created) + return (-1); + else if (ptr1->created > ptr2->created) + return (1); + return (0); } -afs_int32 printRecentDumps(ndumps) +afs_int32 +printRecentDumps(ndumps) int ndumps; { - afs_int32 code = 0; - afs_int32 nextindex, index = 0; - afs_int32 dbTime; - afs_int32 tapedumpid; + afs_int32 code = 0; + afs_int32 nextindex, index = 0; + afs_int32 dbTime; budb_dumpList dl; struct budb_dumpEntry *dumpPtr; int i; @@ -3103,60 +3087,52 @@ afs_int32 printRecentDumps(ndumps) extern struct udbHandleS udbHandle; extern compareDump(); - do { /* while (nextindex != -1) */ - /* initialize the dump list */ - dl.budb_dumpList_len = 0; - dl.budb_dumpList_val = 0; - - /* outline algorithm */ - code = ubik_Call (BUDB_GetDumps, udbHandle.uh_client, 0, - BUDB_MAJORVERSION, - BUDB_OP_NPREVIOUS, - "", /* no name */ - 0, /* start */ - ndumps, /* end */ - index, /* index */ - &nextindex, - &dbTime, - &dl); - if (code) { - if (code == BUDB_ENDOFLIST) return 0; - com_err("dumpInfo", code, "; Can't get dump information"); - return(code); - } - - /* No need to sort, it's already sorted */ - - if (dl.budb_dumpList_len && (index == 0)) - printf("%10s %10s %2s %-16s %2s %5s dump name\n", - "dumpid", "parentid", "lv", "created", "nt", "nvols"); - - dumpPtr = dl.budb_dumpList_val; - for ( i = 1; i <= dl.budb_dumpList_len; i++ ) { - compactDateString(&dumpPtr->created, ds, 50), - printf("%10u %10u %-2d %16s %2d %5d %s", - dumpPtr->id, - dumpPtr->parent, - dumpPtr->level, - ds, - dumpPtr->tapes.maxTapes - dumpPtr->tapes.b + 1, - dumpPtr->nVolumes, - dumpPtr->name, - tapedumpid); - if (dumpPtr->initialDumpID) /* an appended dump */ - printf(" (%u)", dumpPtr->initialDumpID); - else if (dumpPtr->appendedDumpID) /* has appended dumps */ - printf(" (%u)", dumpPtr->id); - printf("\n"); - - dumpPtr++; - } - - if (dl.budb_dumpList_val) free(dl.budb_dumpList_val); - index = nextindex; - } while (nextindex != -1); - - return(code); + do { /* while (nextindex != -1) */ + /* initialize the dump list */ + dl.budb_dumpList_len = 0; + dl.budb_dumpList_val = 0; + + /* outline algorithm */ + code = ubik_Call(BUDB_GetDumps, udbHandle.uh_client, 0, BUDB_MAJORVERSION, BUDB_OP_NPREVIOUS, "", /* no name */ + 0, /* start */ + ndumps, /* end */ + index, /* index */ + &nextindex, &dbTime, &dl); + if (code) { + if (code == BUDB_ENDOFLIST) + return 0; + com_err("dumpInfo", code, "; Can't get dump information"); + return (code); + } + + /* No need to sort, it's already sorted */ + + if (dl.budb_dumpList_len && (index == 0)) + printf("%10s %10s %2s %-16s %2s %5s dump name\n", "dumpid", + "parentid", "lv", "created", "nt", "nvols"); + + dumpPtr = dl.budb_dumpList_val; + for (i = 1; i <= dl.budb_dumpList_len; i++) { + compactDateString(&dumpPtr->created, ds, 50), + printf("%10u %10u %-2d %16s %2d %5d %s", dumpPtr->id, + dumpPtr->parent, dumpPtr->level, ds, + dumpPtr->tapes.maxTapes - dumpPtr->tapes.b + 1, + dumpPtr->nVolumes, dumpPtr->name); + if (dumpPtr->initialDumpID) /* an appended dump */ + printf(" (%u)", dumpPtr->initialDumpID); + else if (dumpPtr->appendedDumpID) /* has appended dumps */ + printf(" (%u)", dumpPtr->id); + printf("\n"); + + dumpPtr++; + } + + if (dl.budb_dumpList_val) + free(dl.budb_dumpList_val); + index = nextindex; + } while (nextindex != -1); + + return (code); } /* bc_dumpInfoCmd @@ -3176,32 +3152,26 @@ bc_dumpInfoCmd(as, arock) afs_int32 dumpInfo(); - if( as->parms[0].items ) - { - if(as->parms[1].items) - { - com_err(whoami, 0, "These options are exclusive - select only one"); - return(BC_BADARG); + if (as->parms[0].items) { + if (as->parms[1].items) { + com_err(whoami, 0, + "These options are exclusive - select only one"); + return (BC_BADARG); } ndumps = atoi(as->parms[0].items->data); - if (ndumps <= 0) - { + if (ndumps <= 0) { com_err(whoami, 0, "Must provide a positive number"); return -1; } code = printRecentDumps(ndumps); - } - else if (as->parms[1].items) - { - detailFlag = (as->parms[2].items ? 1 : 0); /* 1 = detailed listing */ - dumpid = atoi(as->parms[1].items->data); + } else if (as->parms[1].items) { + detailFlag = (as->parms[2].items ? 1 : 0); /* 1 = detailed listing */ + dumpid = atoi(as->parms[1].items->data); code = dumpInfo(dumpid, detailFlag); - } - else - { - code = printRecentDumps(10); + } else { + code = printRecentDumps(10); } - return(code); + return (code); } diff --git a/src/bucoord/config.c b/src/bucoord/config.c index ac6bc993a..ca2a9bb72 100644 --- a/src/bucoord/config.c +++ b/src/bucoord/config.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/config.c,v 1.1.1.6 2002/09/26 19:05:03 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/config.c,v 1.8 2003/11/23 04:53:30 jaltman Exp $"); #include #ifdef AFS_NT40_ENV @@ -27,15 +28,17 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/config.c,v 1.1.1.6 2002/09/26 1 struct bc_config *bc_globalConfig; -static TrimLine(abuffer,aport) -afs_int32 *aport; -register char *abuffer; { +static +TrimLine(abuffer, aport) + afs_int32 *aport; + register char *abuffer; +{ register int tc; char garb[100]; *aport = 0; - sscanf(abuffer,"%s %u",garb,aport); - while(tc = *abuffer) { + sscanf(abuffer, "%s %u", garb, aport); + while (tc = *abuffer) { if (tc == ' ') { *abuffer = 0; return 0; @@ -45,39 +48,41 @@ register char *abuffer; { return 0; } -FILE *bc_open(aconfig, aname, aext, amode) -register struct bc_config *aconfig; -char *amode; -char *aext; -char *aname; { +FILE * +bc_open(aconfig, aname, aext, amode) + register struct bc_config *aconfig; + char *amode; + char *aext; + char *aname; +{ register FILE *tf; char tpath[256]; strcpy(tpath, aconfig->path); strcat(tpath, "/"); strcat(tpath, aname); - if (aext) strcat(tpath, aext); + if (aext) + strcat(tpath, aext); tf = fopen(tpath, amode); return tf; } -bc_InitConfig(apath) - char *apath; +bc_InitConfig(apath) + char *apath; { register struct bc_config *tb; - register struct bc_hostEntry *the; /* initialize global config structure */ - tb = (struct bc_config *) malloc(sizeof(struct bc_config)); - if (!tb) return(BC_NOMEM); + tb = (struct bc_config *)malloc(sizeof(struct bc_config)); + if (!tb) + return (BC_NOMEM); bc_globalConfig = tb; memset(tb, 0, sizeof(struct bc_config)); - tb->path = (char *) malloc(strlen(apath)+1); - if (!tb->path) - { - free(tb); - return(BC_NOMEM); + tb->path = (char *)malloc(strlen(apath) + 1); + if (!tb->path) { + free(tb); + return (BC_NOMEM); } strcpy(tb->path, apath); @@ -87,32 +92,36 @@ bc_InitConfig(apath) return 0; } -static HostAdd(alist, aname,aport) -struct bc_hostEntry **alist; -afs_int32 aport; -char *aname; { +static +HostAdd(alist, aname, aport) + struct bc_hostEntry **alist; + afs_int32 aport; + char *aname; +{ register struct bc_hostEntry **tlast, *tentry; struct hostent *th; /* check that the host address is real */ th = gethostbyname(aname); - if (!th) return -1; + if (!th) + return -1; /* check if this guy is already in the list */ - for(tentry = *alist; tentry; tentry=tentry->next) - if (tentry->portOffset == aport) return EEXIST; + for (tentry = *alist; tentry; tentry = tentry->next) + if (tentry->portOffset == aport) + return EEXIST; /* add this guy to the end of the list */ tlast = alist; - for(tentry = *tlast; tentry; tlast = &tentry->next, tentry = *tlast); + for (tentry = *tlast; tentry; tlast = &tentry->next, tentry = *tlast); /* tlast now points to the next pointer (or head pointer) we should overwrite */ - tentry = (struct bc_hostEntry *) malloc(sizeof(struct bc_hostEntry)); + tentry = (struct bc_hostEntry *)malloc(sizeof(struct bc_hostEntry)); memset(tentry, 0, sizeof(*tentry)); - tentry->name = (char *) malloc(strlen(aname)+1); + tentry->name = (char *)malloc(strlen(aname) + 1); strcpy(tentry->name, aname); *tlast = tentry; - tentry->next = (struct bc_hostEntry *) 0; + tentry->next = (struct bc_hostEntry *)0; tentry->addr.sin_family = AF_INET; memcpy(&tentry->addr.sin_addr.s_addr, th->h_addr, sizeof(afs_int32)); tentry->addr.sin_port = 0; @@ -123,18 +132,21 @@ char *aname; { return 0; } -static HostDelete(alist, aname,aport) -struct bc_hostEntry **alist; -afs_int32 aport; -char *aname; { +static +HostDelete(alist, aname, aport) + struct bc_hostEntry **alist; + afs_int32 aport; + char *aname; +{ register struct bc_hostEntry **tlast, *tentry; /* find guy to zap */ tlast = alist; - for(tentry = *tlast; tentry; tlast = &tentry->next, tentry = *tlast) + for (tentry = *tlast; tentry; tlast = &tentry->next, tentry = *tlast) if (strcmp(tentry->name, aname) == 0 && (aport == tentry->portOffset)) break; - if (!tentry) return ENOENT; /* failed to find it */ + if (!tentry) + return ENOENT; /* failed to find it */ /* otherwise delete the entry from the list and free appropriate structures */ *tlast = tentry->next; @@ -143,21 +155,23 @@ char *aname; { return 0; } -bc_AddTapeHost(aconfig, aname,aport) -struct bc_config *aconfig; -afs_int32 aport; -char *aname; { +bc_AddTapeHost(aconfig, aname, aport) + struct bc_config *aconfig; + afs_int32 aport; + char *aname; +{ register afs_int32 code; - code = HostAdd(&aconfig->tapeHosts, aname,aport); + code = HostAdd(&aconfig->tapeHosts, aname, aport); return code; } bc_DeleteTapeHost(aconfig, aname, aport) -struct bc_config *aconfig; -afs_int32 aport; -char *aname; { + struct bc_config *aconfig; + afs_int32 aport; + char *aname; +{ register afs_int32 code; code = HostDelete(&aconfig->tapeHosts, aname, aport); diff --git a/src/bucoord/dlq.c b/src/bucoord/dlq.c index ce2e13e64..5797dc8f9 100644 --- a/src/bucoord/dlq.c +++ b/src/bucoord/dlq.c @@ -9,8 +9,12 @@ #include #include +#ifdef HAVE_STDLIB_H +#include +#endif -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dlq.c,v 1.1.1.4 2001/07/14 22:20:51 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/dlq.c,v 1.9 2003/12/12 23:29:49 shadow Exp $"); #include @@ -30,30 +34,30 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dlq.c,v 1.1.1.4 2001/07/14 22:2 */ dlqEmpty(headptr) - dlqlinkP headptr; + dlqlinkP headptr; { DLQ_ASSERT_HEAD(headptr); - if ( headptr->dlq_next == headptr ) - return(1); - return(0); + if (headptr->dlq_next == headptr) + return (1); + return (0); } dlqInit(headptr) - dlqlinkP headptr; + dlqlinkP headptr; { headptr->dlq_next = headptr; headptr->dlq_prev = headptr; headptr->dlq_type = DLQ_HEAD; - headptr->dlq_structPtr = (char *)0; - return(0); + headptr->dlq_structPtr = NULL; + return (0); } /* dlqLinkf * link item to front of chain */ dlqLinkf(headptr, entryptr) - dlqlinkP headptr; - dlqlinkP entryptr; + dlqlinkP headptr; + dlqlinkP entryptr; { DLQ_ASSERT_HEAD(headptr); /* link in as first item in chain */ @@ -61,16 +65,16 @@ dlqLinkf(headptr, entryptr) headptr->dlq_next->dlq_prev = entryptr; entryptr->dlq_prev = headptr; headptr->dlq_next = entryptr; - return(0); -} + return (0); +} /* dlqLinkb * link item to end of chain */ dlqLinkb(headptr, entryptr) - dlqlinkP headptr; - dlqlinkP entryptr; + dlqlinkP headptr; + dlqlinkP entryptr; { DLQ_ASSERT_HEAD(headptr); entryptr->dlq_next = headptr; @@ -78,24 +82,25 @@ dlqLinkb(headptr, entryptr) headptr->dlq_prev = entryptr; entryptr->dlq_prev->dlq_next = entryptr; - return(0); + return (0); } /* dlqMoveb * move all the items on the fromptr and append to the toptr's list */ +void dlqMoveb(fromptr, toptr) - dlqlinkP fromptr; - dlqlinkP toptr; + dlqlinkP fromptr; + dlqlinkP toptr; { - dlqlinkP tailptr; + dlqlinkP tailptr; DLQ_ASSERT_HEAD(fromptr); DLQ_ASSERT_HEAD(toptr); - if ( dlqEmpty(fromptr) ) - return(0); + if (dlqEmpty(fromptr)) + return; tailptr = toptr->dlq_prev; @@ -110,6 +115,7 @@ dlqMoveb(fromptr, toptr) fromptr->dlq_next = fromptr; fromptr->dlq_prev = fromptr; + return; } /* dlqUnlinkb @@ -117,22 +123,22 @@ dlqMoveb(fromptr, toptr) */ dlqlinkP -dlqUnlinkb(headptr) - dlqlinkP headptr; +dlqUnlinkb(headptr) + dlqlinkP headptr; { - dlqlinkP ptr; + dlqlinkP ptr; DLQ_ASSERT_HEAD(headptr); - if ( dlqEmpty(headptr) ) - return(0); + if (dlqEmpty(headptr)) + return (0); ptr = headptr->dlq_prev; ptr->dlq_prev->dlq_next = headptr; headptr->dlq_prev = ptr->dlq_prev; - + ptr->dlq_next = ptr; ptr->dlq_prev = ptr; - return(ptr); + return (ptr); } /* dlqUnlinkf @@ -141,13 +147,13 @@ dlqUnlinkb(headptr) dlqlinkP dlqUnlinkf(headptr) - dlqlinkP headptr; + dlqlinkP headptr; { - dlqlinkP ptr; + dlqlinkP ptr; DLQ_ASSERT_HEAD(headptr); - if ( dlqEmpty(headptr) ) - return(0); + if (dlqEmpty(headptr)) + return (0); ptr = headptr->dlq_next; @@ -156,7 +162,7 @@ dlqUnlinkf(headptr) ptr->dlq_next = ptr; ptr->dlq_prev = ptr; - return(ptr); + return (ptr); } /* dlqUnlink @@ -164,11 +170,10 @@ dlqUnlinkf(headptr) */ dlqUnlink(ptr) - dlqlinkP ptr; + dlqlinkP ptr; { /* must not be the queue head */ - if ( ptr->dlq_type == DLQ_HEAD ) - { + if (ptr->dlq_type == DLQ_HEAD) { printf("dlqUnlink: invalid unlink\n"); exit(1); } @@ -186,55 +191,50 @@ dlqUnlink(ptr) dlqlinkP dlqFront(headptr) - dlqlinkP headptr; + dlqlinkP headptr; { DLQ_ASSERT_HEAD(headptr); - if ( dlqEmpty(headptr) ) - return(0); + if (dlqEmpty(headptr)) + return (0); - return(headptr->dlq_next); + return (headptr->dlq_next); } int dlqCount(headptr) - dlqlinkP headptr; + dlqlinkP headptr; { - dlqlinkP ptr; + dlqlinkP ptr; int count = 0; DLQ_ASSERT_HEAD(headptr); ptr = headptr->dlq_next; - while ( ptr != headptr ) - { + while (ptr != headptr) { ptr = ptr->dlq_next; count++; } - return(count); + return (count); } dlqTraverseQueue(headptr, fn1, fn2) - dlqlinkP headptr; - int (*fn1)(); - int (*fn2)(); + dlqlinkP headptr; + int (*fn1) (); + int (*fn2) (); { - dlqlinkP ptr, oldPtr; + dlqlinkP ptr, oldPtr; DLQ_ASSERT_HEAD(headptr); ptr = headptr->dlq_next; - while ( ptr != headptr ) - { + while (ptr != headptr) { if (fn2 && ptr->dlq_structPtr) - (*fn2)(ptr->dlq_structPtr); + (*fn2) (ptr->dlq_structPtr); oldPtr = ptr; ptr = ptr->dlq_next; - if (fn1) (*fn1)(oldPtr); + if (fn1) + (*fn1) (oldPtr); } - return(0); + return (0); } - - - - diff --git a/src/bucoord/dsstub.c b/src/bucoord/dsstub.c index ca8480ea6..3d539622f 100644 --- a/src/bucoord/dsstub.c +++ b/src/bucoord/dsstub.c @@ -14,7 +14,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dsstub.c,v 1.1.1.5 2001/09/11 14:31:34 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/dsstub.c,v 1.6 2003/07/15 23:14:47 shadow Exp $"); #include #include @@ -56,21 +57,24 @@ afs_int32 DeleteDump(); afs_int32 ScanDumpHdr(); /* return the tape file name corresponding to a particular tape */ -static char *TapeName(atapeName) -register char *atapeName; { +static char * +TapeName(atapeName) + register char *atapeName; +{ static char tbuffer[AFSDIR_PATH_MAX]; /* construct the backup dir path */ strcpy(tbuffer, AFSDIR_SERVER_BACKUP_DIRPATH); strcat(tbuffer, "/T"); - strcat(tbuffer+1, atapeName); + strcat(tbuffer + 1, atapeName); strcat(tbuffer, ".db"); return tbuffer; } /* return the dump file name corresponding to a particular dump ID */ -static char *DumpName(adumpID) -register afs_int32 adumpID; +static char * +DumpName(adumpID) + register afs_int32 adumpID; { static char tbuffer[AFSDIR_PATH_MAX]; char buf[AFSDIR_PATH_MAX]; @@ -82,9 +86,11 @@ register afs_int32 adumpID; return tbuffer; } -static FILE *OpenDump(adumpID, awrite) -char *awrite; -afs_int32 adumpID; { +static FILE * +OpenDump(adumpID, awrite) + char *awrite; + afs_int32 adumpID; +{ register char *tp; register FILE *tfile; @@ -98,9 +104,11 @@ afs_int32 adumpID; { * non-static for recoverDB */ -FILE *OpenTape(atapeName, awrite) -char *awrite; -char *atapeName; { +FILE * +OpenTape(atapeName, awrite) + char *awrite; + char *atapeName; +{ register char *tp; register FILE *tfile; tp = TapeName(atapeName); @@ -109,8 +117,10 @@ char *atapeName; { } /* scan for, and delete, all dumps whose parent dump ID is aparentID */ -static afs_int32 ScanForChildren(aparentID) -afs_int32 aparentID; { +static afs_int32 +ScanForChildren(aparentID) + afs_int32 aparentID; +{ DIR *tdir; register struct dirent *tde; afs_int32 dumpID, parent; @@ -119,16 +129,19 @@ afs_int32 aparentID; { afs_int32 j2, j3, j4; char dname[256]; char dumpName[1024]; - - tdir = opendir(AFSDIR_SERVER_BACKUP_DIRPATH); - if (!tdir) return -1; - for(tde=readdir(tdir); tde; tde=readdir(tdir)) { + tdir = opendir(AFSDIR_SERVER_BACKUP_DIRPATH); + if (!tdir) + return -1; + + for (tde = readdir(tdir); tde; tde = readdir(tdir)) { code = sscanf(tde->d_name, "D%ld.db", &dumpID); - if (code != 1) continue; + if (code != 1) + continue; tfile = OpenDump(dumpID, "r"); - if (!tfile) continue; /* shouldn't happen, but should continue anyway */ + if (!tfile) + continue; /* shouldn't happen, but should continue anyway */ code = ScanDumpHdr(tfile, dname, dumpName, &parent, &j2, &j3, &j4); fclose(tfile); @@ -140,26 +153,33 @@ afs_int32 aparentID; { /* if this guy's parent is the ID we're scanning for, delete it */ if (aparentID == parent) { code = DeleteDump(dumpID); - if (code) printf("backup:dsstub: failed to delete child dump %d\n", dumpID); + if (code) + printf("backup:dsstub: failed to delete child dump %d\n", + dumpID); } } closedir(tdir); return 0; } -static afs_int32 DeleteDump(adumpID) -afs_int32 adumpID; { +static afs_int32 +DeleteDump(adumpID) + afs_int32 adumpID; +{ register char *tp; register afs_int32 code; tp = DumpName(adumpID); code = unlink(tp); - if (code) return code; + if (code) + return code; code = ScanForChildren(adumpID); return code; } -static afs_int32 DeleteTape(atapeName) -char *atapeName; { +static afs_int32 +DeleteTape(atapeName) + char *atapeName; +{ register char *tp; register afs_int32 code; tp = TapeName(atapeName); @@ -178,18 +198,15 @@ tailCompPtr(pathNamePtr) { char *ptr; ptr = strrchr(pathNamePtr, '/'); - if ( ptr == 0 ) - { - /* this should never happen */ - printf("tailCompPtr: could not find / in name(%s)\n", - pathNamePtr); - return(pathNamePtr); - } - else - ptr++; /* skip the / */ - return(ptr); + if (ptr == 0) { + /* this should never happen */ + printf("tailCompPtr: could not find / in name(%s)\n", pathNamePtr); + return (pathNamePtr); + } else + ptr++; /* skip the / */ + return (ptr); } - + /* ScanDumpHdr * scan a dump header out of a dump file, leaving the file ptr set after * the header. @@ -220,33 +237,39 @@ ScanDumpHdr(afile, aname, dumpName, aparent, aincTime, acreateTime, alevel) register afs_int32 code; tp = fgets(tbuffer, sizeof(tbuffer), afile); - if (!tp) return -1; - code = sscanf(tbuffer, "%d %d %s %s %ld %ld %ld %ld", - &dbmagic, &dbversion, - aname, dumpName, aparent, aincTime, acreateTime, alevel); - if (code != 8) return -1; + if (!tp) + return -1; + code = + sscanf(tbuffer, "%d %d %s %s %ld %ld %ld %ld", &dbmagic, &dbversion, + aname, dumpName, aparent, aincTime, acreateTime, alevel); + if (code != 8) + return -1; /* now check the magic and version numbers */ - if ( (dbmagic != BC_DUMPDB_MAGIC) || (dbversion != BC_DUMPDB_VERSION) ) - return(-1); + if ((dbmagic != BC_DUMPDB_MAGIC) || (dbversion != BC_DUMPDB_VERSION)) + return (-1); return 0; } /* scan a tape header out of a tape file, leaving the file ptr positioned just past the header */ -static afs_int32 ScanTapeHdr(afile, adumpID, aseq, adamage) -register FILE *afile; -afs_int32 *adumpID; -afs_int32 *aseq; -afs_int32 *adamage; { +static afs_int32 +ScanTapeHdr(afile, adumpID, aseq, adamage) + register FILE *afile; + afs_int32 *adumpID; + afs_int32 *aseq; + afs_int32 *adamage; +{ char tbuffer[256]; char *tp; register afs_int32 code; tp = fgets(tbuffer, sizeof(tbuffer), afile); - if (!tp) return -1; + if (!tp) + return -1; code = sscanf(tbuffer, "%ld %ld %ld", adumpID, aseq, adamage); - if (code != 3) return -1; + if (code != 3) + return -1; return 0; } @@ -262,23 +285,28 @@ afs_int32 *adamage; { afs_int32 ScanTapeVolume(afile, avolName, avolID, atapeName, apos, aseq, alastp, cloneTime) -FILE *afile; -char *avolName; -afs_int32 *avolID; -char *atapeName; -afs_int32 *apos, *aseq, *alastp, *cloneTime; { + FILE *afile; + char *avolName; + afs_int32 *avolID; + char *atapeName; + afs_int32 *apos, *aseq, *alastp, *cloneTime; +{ char tbuffer[256]; register afs_int32 code; register char *tp; tp = fgets(tbuffer, sizeof(tbuffer), afile); - if (!tp) { /* something went wrong, or eof hit */ - if (ferror(afile)) return -1; /* error occurred */ - else return 1; /* eof */ + if (!tp) { /* something went wrong, or eof hit */ + if (ferror(afile)) + return -1; /* error occurred */ + else + return 1; /* eof */ } - code = sscanf(tbuffer, "%s %ld %s %ld %ld %ld %ld", avolName, avolID, - atapeName, apos, aseq, alastp, cloneTime); - if (code != 7) return -1; /* bad input line */ + code = + sscanf(tbuffer, "%s %ld %s %ld %ld %ld %ld", avolName, avolID, + atapeName, apos, aseq, alastp, cloneTime); + if (code != 7) + return -1; /* bad input line */ return 0; } @@ -298,29 +326,32 @@ ScanVolClone(tdump, volName, cloneTime) { char avolName[256], atapeName[256]; afs_int32 retval, avolID, apos, aseq, alastp; - - retval = ScanTapeVolume(tdump, &avolName[0], &avolID, &atapeName[0], - &apos, &aseq, &alastp, cloneTime); - while ( retval == 0 ) - { - if ( strcmp(avolName, volName) == 0 ) - return(0); - retval = ScanTapeVolume(tdump, &avolName[0], &avolID, &atapeName[0], - &apos, &aseq, &alastp, cloneTime); + + retval = + ScanTapeVolume(tdump, &avolName[0], &avolID, &atapeName[0], &apos, + &aseq, &alastp, cloneTime); + while (retval == 0) { + if (strcmp(avolName, volName) == 0) + return (0); + retval = + ScanTapeVolume(tdump, &avolName[0], &avolID, &atapeName[0], &apos, + &aseq, &alastp, cloneTime); } - return(-1); + return (-1); } /* seek a dump file (after a header scan has been done) to position apos */ -static SeekDump(afile, apos) -register FILE *afile; -afs_int32 apos; { +static +SeekDump(afile, apos) + register FILE *afile; + afs_int32 apos; +{ register afs_int32 i; register char *tp; char tbuffer[256]; /* now skip to appropriate position */ - for(i=0;i #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dsvs.c,v 1.1.1.6 2002/09/26 19:05:04 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/dsvs.c,v 1.9 2003/12/07 22:49:19 jaltman Exp $"); #include #include @@ -37,17 +38,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dsvs.c,v 1.1.1.6 2002/09/26 19: #include #include "bc.h" -extern struct bc_config *bc_globalConfig; -extern FILE *bc_open(); -extern void bc_HandleMisc(); -extern char *whoami; +static char db_dsvs = 0; /*Assume debugging output turned off */ +static char mn[] = "dsvs"; /*Module name */ -static char db_dsvs = 0; /*Assume debugging output turned off*/ -static char mn[] = "dsvs"; /*Module name*/ +struct ubik_client *cstructp; /*Ptr to Ubik client structure */ -struct ubik_client *cstructp; /*Ptr to Ubik client structure*/ - -extern struct bc_volumeSet *bc_FindVolumeSet(struct bc_config *cf, char *name); +extern struct bc_volumeSet *bc_FindVolumeSet(struct bc_config *cf, + char *name); /* Code to maintain dump schedule and volume set abstractions. @@ -58,9 +55,11 @@ extern struct bc_volumeSet *bc_FindVolumeSet(struct bc_config *cf, char *name); */ /* get partition id from a name */ -afs_int32 bc_GetPartitionID(aname, aval) - afs_int32 *aval; - char *aname; { +afs_int32 +bc_GetPartitionID(aname, aval) + afs_int32 *aval; + char *aname; +{ /*bc_GetPartitionID */ @@ -73,7 +72,8 @@ afs_int32 bc_GetPartitionID(aname, aval) return 0; } tc = *aname; - if (tc == 0) return -1; /* unknown */ + if (tc == 0) + return -1; /* unknown */ /* numbers go straight through */ if (tc >= '0' && tc <= '9') { *aval = bc_SafeATOI(aname); @@ -83,30 +83,30 @@ afs_int32 bc_GetPartitionID(aname, aval) ascii[2] = 0; if (strlen(aname) <= 2) { strcpy(ascii, aname); - } - else if (!strncmp(aname, "/vicep", 6)) { - strncpy(ascii, aname+6, 2); - } - else if (!strncmp(aname, "vicep", 5)) { - strncpy(ascii, aname+5, 2); - } - else return(BC_NOPARTITION); /* bad partition name */ + } else if (!strncmp(aname, "/vicep", 6)) { + strncpy(ascii, aname + 6, 2); + } else if (!strncmp(aname, "vicep", 5)) { + strncpy(ascii, aname + 5, 2); + } else + return (BC_NOPARTITION); /* bad partition name */ /* now partitions are named /vicepa ... /vicepz, /vicepaa, /vicepab, .../vicepzz, and are numbered - from 0. Do the appropriate conversion */ + * from 0. Do the appropriate conversion */ if (ascii[1] == 0) { /* one char name, 0..25 */ - if (ascii[0] < 'a' || ascii[0] > 'z') return -1; /* wrongo */ + if (ascii[0] < 'a' || ascii[0] > 'z') + return -1; /* wrongo */ *aval = ascii[0] - 'a'; return 0; - } - else { + } else { /* two char name, 26 .. */ - if (ascii[0] < 'a' || ascii[0] > 'z') return -1; /* wrongo */ - if (ascii[1] < 'a' || ascii[1] > 'z') return -1; /* just as bad */ + if (ascii[0] < 'a' || ascii[0] > 'z') + return -1; /* wrongo */ + if (ascii[1] < 'a' || ascii[1] > 'z') + return -1; /* just as bad */ *aval = (ascii[0] - 'a') * 26 + (ascii[1] - 'a') + 26; return 0; } -} /*bc_GetPartitionID*/ +} /*bc_GetPartitionID */ /*---------------------------------------------------------------------------- * bc_ParseHost @@ -131,17 +131,18 @@ afs_int32 bc_GetPartitionID(aname, aval) *---------------------------------------------------------------------------- */ -int bc_ParseHost(aname, asockaddr) - char *aname; - struct sockaddr_in *asockaddr; +int +bc_ParseHost(aname, asockaddr) + char *aname; + struct sockaddr_in *asockaddr; -{ /*bc_ParseHost*/ +{ /*bc_ParseHost */ - register struct hostent *th; /*Host entry*/ - afs_int32 addr; /*Converted address*/ - afs_int32 b1, b2, b3, b4; /*Byte-sized address chunks*/ - register afs_int32 code; /*Return code from sscanf()*/ - afs_int32 tmp1,tmp2; + register struct hostent *th; /*Host entry */ + afs_int32 addr; /*Converted address */ + afs_int32 b1, b2, b3, b4; /*Byte-sized address chunks */ + register afs_int32 code; /*Return code from sscanf() */ + afs_int32 tmp1, tmp2; /* * Try to parse the given name as a dot-notation IP address first. @@ -152,15 +153,15 @@ int bc_ParseHost(aname, asockaddr) * Four chunks were read, so we assume success. Construct the socket. */ #ifdef STRUCT_SOCKADDR_HAS_SA_LEN - asockaddr->sin_len=sizeof(struct sockaddr_in); + asockaddr->sin_len = sizeof(struct sockaddr_in); #endif asockaddr->sin_family = AF_INET; - asockaddr->sin_port = 0; - addr = (b1<<24) | (b2<<16) | (b3<<8) | b4; + asockaddr->sin_port = 0; + addr = (b1 << 24) | (b2 << 16) | (b3 << 8) | b4; memcpy(&tmp1, &addr, sizeof(afs_int32)); tmp2 = htonl(tmp1); memcpy(&asockaddr->sin_addr.s_addr, &tmp2, sizeof(afs_int32)); - return(0); + return (0); } /* @@ -178,67 +179,73 @@ int bc_ParseHost(aname, asockaddr) /* * No such luck, return failure. */ - return(BC_NOHOST); + return (BC_NOHOST); /* * We found a mapping; construct the socket. */ #ifdef STRUCT_SOCKADDR_HAS_SA_LEN - asockaddr->sin_len=sizeof(struct sockaddr_in); + asockaddr->sin_len = sizeof(struct sockaddr_in); #endif asockaddr->sin_family = AF_INET; - asockaddr->sin_port = 0; + asockaddr->sin_port = 0; memcpy(&tmp1, th->h_addr, sizeof(afs_int32)); tmp2 = htonl(tmp1); - memcpy(&(asockaddr->sin_addr.s_addr), &tmp2, sizeof(asockaddr->sin_addr.s_addr)); - return(0); + memcpy(&(asockaddr->sin_addr.s_addr), &tmp2, + sizeof(asockaddr->sin_addr.s_addr)); + return (0); -} /*bc_ParseHost*/ +} /*bc_ParseHost */ /* create an empty volume set, new items are added via bc_AddVolumeItem */ bc_CreateVolumeSet(aconfig, avolName, aflags) - struct bc_config *aconfig; - char *avolName; - afs_int32 aflags; + struct bc_config *aconfig; + char *avolName; + afs_int32 aflags; { register struct bc_volumeSet **tlast, *tset, *nset; - if (bc_FindVolumeSet(aconfig, avolName)) return -1; /* already exists */ + if (bc_FindVolumeSet(aconfig, avolName)) + return -1; /* already exists */ /* move to end of the list */ - nset = (struct bc_volumeSet *) malloc(sizeof(struct bc_volumeSet)); + nset = (struct bc_volumeSet *)malloc(sizeof(struct bc_volumeSet)); memset(nset, 0, sizeof(*nset)); nset->flags = aflags; - nset->name = (char *) malloc(strlen(avolName)+1); + nset->name = (char *)malloc(strlen(avolName) + 1); strcpy(nset->name, avolName); if (aflags & VSFLAG_TEMPORARY) { - /* Add to beginning of list */ - nset->next = aconfig->vset; - aconfig->vset = nset; + /* Add to beginning of list */ + nset->next = aconfig->vset; + aconfig->vset = nset; } else { - /* Add to end of list */ - for(tlast = &aconfig->vset, tset = *tlast; tset; tlast = &tset->next, tset = *tlast); - *tlast = nset; + /* Add to end of list */ + for (tlast = &aconfig->vset, tset = *tlast; tset; + tlast = &tset->next, tset = *tlast); + *tlast = nset; } return 0; } -void FreeVolumeSet(avset) - struct bc_volumeSet *avset; +void +FreeVolumeSet(avset) + struct bc_volumeSet *avset; { - FreeVolumeEntryList(avset->ventries); - free(avset->name); - free(avset); + FreeVolumeEntryList(avset->ventries); + free(avset->name); + free(avset); } -static FreeVolumeEntryList(aentry) -register struct bc_volumeEntry *aentry; { +static +FreeVolumeEntryList(aentry) + register struct bc_volumeEntry *aentry; +{ register struct bc_volumeEntry *tnext; - while(aentry) { + while (aentry) { tnext = aentry->next; FreeVolumeEntry(aentry); aentry = tnext; @@ -246,8 +253,10 @@ register struct bc_volumeEntry *aentry; { return 0; } -static FreeVolumeEntry(aentry) -register struct bc_volumeEntry *aentry; { +static +FreeVolumeEntry(aentry) + register struct bc_volumeEntry *aentry; +{ free(aentry->name); free(aentry->serverName); free(aentry->partname); @@ -256,19 +265,19 @@ register struct bc_volumeEntry *aentry; { } bc_DeleteVolumeSet(aconfig, avolName, flags) - struct bc_config *aconfig; - char *avolName; - afs_int32 *flags; + struct bc_config *aconfig; + char *avolName; + afs_int32 *flags; { register struct bc_volumeSet **tlast, *tset; *flags = 0; tlast = &aconfig->vset; - for(tset = *tlast; tset; tlast = &tset->next, tset = *tlast) { + for (tset = *tlast; tset; tlast = &tset->next, tset = *tlast) { if (strcmp(avolName, tset->name) == 0) { - *flags = tset->flags; /* Remember flags */ - *tlast = tset->next; /* Remove from chain */ - FreeVolumeSet(tset); /* Free the volume set */ + *flags = tset->flags; /* Remember flags */ + *tlast = tset->next; /* Remove from chain */ + FreeVolumeSet(tset); /* Free the volume set */ return 0; } } @@ -278,19 +287,21 @@ bc_DeleteVolumeSet(aconfig, avolName, flags) } bc_DeleteVolumeItem(aconfig, avolName, anumber) - struct bc_config *aconfig; - char *avolName; - afs_int32 anumber; + struct bc_config *aconfig; + char *avolName; + afs_int32 anumber; { register afs_int32 i; register struct bc_volumeSet *tset; register struct bc_volumeEntry *tentry, **tlast; tset = bc_FindVolumeSet(aconfig, avolName); - if (!tset) return -1; + if (!tset) + return -1; tlast = &tset->ventries; - for(i=1, tentry = *tlast; tentry; tlast = &tentry->next, tentry = *tlast, i++) { + for (i = 1, tentry = *tlast; tentry; + tlast = &tentry->next, tentry = *tlast, i++) { if (anumber == i) { /* found entry we want */ *tlast = tentry->next; @@ -298,59 +309,61 @@ bc_DeleteVolumeItem(aconfig, avolName, anumber) return 0; } } - return -2; /* not found */ + return -2; /* not found */ } bc_AddVolumeItem(aconfig, avolName, ahost, apart, avol) - struct bc_config *aconfig; - char *avolName; - char *ahost, *apart, *avol; + struct bc_config *aconfig; + char *avolName; + char *ahost, *apart, *avol; { struct bc_volumeSet *tset; register struct bc_volumeEntry **tlast, *tentry; register afs_int32 code; tset = bc_FindVolumeSet(aconfig, avolName); - if (!tset) return(BC_NOVOLSET); + if (!tset) + return (BC_NOVOLSET); /* otherwise append this item to the end of the real list */ tlast = &tset->ventries; /* move to end of the list */ - for(tentry = *tlast; tentry; tlast = &tentry->next, tentry = *tlast); - tentry = (struct bc_volumeEntry *) malloc(sizeof(struct bc_volumeEntry)); + for (tentry = *tlast; tentry; tlast = &tentry->next, tentry = *tlast); + tentry = (struct bc_volumeEntry *)malloc(sizeof(struct bc_volumeEntry)); memset(tentry, 0, sizeof(*tentry)); - tentry->serverName = (char *) malloc(strlen(ahost)+1); + tentry->serverName = (char *)malloc(strlen(ahost) + 1); strcpy(tentry->serverName, ahost); - tentry->partname = (char *) malloc(strlen(apart)+1); + tentry->partname = (char *)malloc(strlen(apart) + 1); strcpy(tentry->partname, apart); - tentry->name = (char *) malloc(strlen(avol)+1); + tentry->name = (char *)malloc(strlen(avol) + 1); strcpy(tentry->name, avol); code = bc_ParseHost(tentry->serverName, &tentry->server); if (code) - return(code); + return (code); code = bc_GetPartitionID(tentry->partname, &tentry->partition); if (code) - return(code); + return (code); - *tlast = tentry; /* thread on the list */ + *tlast = tentry; /* thread on the list */ return 0; } -struct bc_volumeSet *bc_FindVolumeSet(struct bc_config *aconfig, char *aname) -{ /*bc_FindVolumeSet*/ +struct bc_volumeSet * +bc_FindVolumeSet(struct bc_config *aconfig, char *aname) +{ /*bc_FindVolumeSet */ register struct bc_volumeSet *tvs; - for(tvs = aconfig->vset; tvs; tvs=tvs->next) { + for (tvs = aconfig->vset; tvs; tvs = tvs->next) { if (!strcmp(tvs->name, aname)) - return(tvs); + return (tvs); } - return(struct bc_volumeSet *)0; + return (struct bc_volumeSet *)0; -}/*bc_FindVolumeSet*/ +} /*bc_FindVolumeSet */ /* ------------------------------------ * dumpschedule management code @@ -366,26 +379,26 @@ struct bc_volumeSet *bc_FindVolumeSet(struct bc_config *aconfig, char *aname) * expType - absolute or relative */ -bc_CreateDumpSchedule(aconfig,adumpName, expDate, expType) -struct bc_config *aconfig; -char *adumpName; -afs_int32 expDate; -afs_int32 expType; +bc_CreateDumpSchedule(aconfig, adumpName, expDate, expType) + struct bc_config *aconfig; + char *adumpName; + afs_int32 expDate; + afs_int32 expType; { - register struct bc_dumpSchedule **tlast, *tdump; + register struct bc_dumpSchedule *tdump; struct bc_dumpSchedule *parent, *node; afs_int32 code; - if(strcmp(adumpName, "none") == 0) - return -2; /* invalid name */ + if (strcmp(adumpName, "none") == 0) + return -2; /* invalid name */ - code = FindDump(aconfig, adumpName, &parent, &node); - if ( code == 0 ) - return -1; /* node already exists */ - else if ( code != -1 ) - return -2; /* name specification error */ + code = FindDump(aconfig, adumpName, &parent, &node); + if (code == 0) + return -1; /* node already exists */ + else if (code != -1) + return -2; /* name specification error */ - tdump = (struct bc_dumpSchedule *) malloc(sizeof(struct bc_dumpSchedule)); + tdump = (struct bc_dumpSchedule *)malloc(sizeof(struct bc_dumpSchedule)); memset(tdump, 0, sizeof(*tdump)); /* prepend this node to the dump schedule list */ @@ -393,7 +406,7 @@ afs_int32 expType; aconfig->dsched = tdump; /* save the name of this dump node */ - tdump->name = (char *) malloc(strlen(adumpName)+1); + tdump->name = (char *)malloc(strlen(adumpName) + 1); strcpy(tdump->name, adumpName); /* expiration information */ @@ -411,26 +424,27 @@ afs_int32 expType; */ bc_DeleteDumpScheduleAddr(aconfig, adumpAddr) -struct bc_config *aconfig; -struct bc_dumpSchedule *adumpAddr; { + struct bc_config *aconfig; + struct bc_dumpSchedule *adumpAddr; +{ register struct bc_dumpSchedule **tlast, *tdump; register struct bc_dumpSchedule *tnext; /* knock off all children first */ - for(tdump = adumpAddr->firstChild; tdump; tdump = tnext) { + for (tdump = adumpAddr->firstChild; tdump; tdump = tnext) { /* extract next ptr now, since will be freed by recursive call below */ tnext = tdump->nextSibling; bc_DeleteDumpScheduleAddr(aconfig, tdump); } /* finally, remove us from the list of good dudes */ - for(tlast = &aconfig->dsched, tdump = *tlast; tdump; - tlast = &tdump->next, tdump = *tlast) { + for (tlast = &aconfig->dsched, tdump = *tlast; tdump; + tlast = &tdump->next, tdump = *tlast) { if (tdump == adumpAddr) { /* found the one we're looking for */ *tlast = tdump->next; /* remove us from basic list */ free(tdump->name); - free(tdump); + free(tdump); return 0; } } @@ -446,15 +460,17 @@ struct bc_dumpSchedule *adumpAddr; { * 0 for failure, ptr to dumpschedule for success */ -struct bc_dumpSchedule *bc_FindDumpSchedule(aconfig, aname) -char *aname; -struct bc_config *aconfig; { +struct bc_dumpSchedule * +bc_FindDumpSchedule(aconfig, aname) + char *aname; + struct bc_config *aconfig; +{ register struct bc_dumpSchedule *tds; - for(tds=aconfig->dsched; tds; tds=tds->next) { + for (tds = aconfig->dsched; tds; tds = tds->next) { if (!strcmp(tds->name, aname)) return tds; } - return (struct bc_dumpSchedule *) 0; + return (struct bc_dumpSchedule *)0; } /* bc_DeleteDumpSchedule @@ -462,21 +478,22 @@ struct bc_config *aconfig; { */ bc_DeleteDumpSchedule(aconfig, adumpName) -struct bc_config *aconfig; -char *adumpName; { + struct bc_config *aconfig; + char *adumpName; +{ register struct bc_dumpSchedule *tdump; /* does a linear search of the dump schedules in order to find * the one to delete */ - for(tdump = aconfig->dsched; tdump; tdump=tdump->next) { - if (strcmp(tdump->name, adumpName)==0) { + for (tdump = aconfig->dsched; tdump; tdump = tdump->next) { + if (strcmp(tdump->name, adumpName) == 0) { /* found it, we can zap recursively */ bc_DeleteDumpScheduleAddr(aconfig, tdump); /* tree's been pruned, but we have to recompute the internal pointers - from first principles, since we didn't bother to maintain - the sibling and children pointers during the call to delete - the nodes */ + * from first principles, since we didn't bother to maintain + * the sibling and children pointers during the call to delete + * the nodes */ bc_ProcessDumpSchedule(aconfig); return 0; } @@ -493,34 +510,30 @@ char *adumpName; { */ bc_ProcessDumpSchedule(aconfig) -register struct bc_config *aconfig; + register struct bc_config *aconfig; { - register struct bc_dumpSchedule *tds, *uds; + register struct bc_dumpSchedule *tds; struct bc_dumpSchedule *parentptr, *nodeptr; int retval; /* first, clear all the links on all entries so that this function * may be called any number of times with no ill effects */ - for(tds = aconfig->dsched; tds; tds=tds->next) - { - tds->parent = (struct bc_dumpSchedule *) 0; - tds->nextSibling = (struct bc_dumpSchedule *) 0; - tds->firstChild = (struct bc_dumpSchedule *) 0; + for (tds = aconfig->dsched; tds; tds = tds->next) { + tds->parent = (struct bc_dumpSchedule *)0; + tds->nextSibling = (struct bc_dumpSchedule *)0; + tds->firstChild = (struct bc_dumpSchedule *)0; } - for(tds = aconfig->dsched; tds; tds=tds->next) - { + for (tds = aconfig->dsched; tds; tds = tds->next) { retval = FindDump(aconfig, tds->name, &parentptr, &nodeptr); - if ( retval != 0 ) - { + if (retval != 0) { printf("bc_processdumpschedule: finddump returns %d\n", retval); exit(1); } /* only need to do work if it is not a root node */ - if ( parentptr != 0 ) - { + if (parentptr != 0) { nodeptr->parent = parentptr; nodeptr->nextSibling = parentptr->firstChild; parentptr->firstChild = nodeptr; @@ -556,74 +569,69 @@ FindDump(aconfig, nodeString, parentptr, nodeptr) { struct bc_dumpSchedule *dsptr; char *separator; - int matchLength; + int matchLength; char *curptr; *parentptr = 0; *nodeptr = 0; /* ensure first char is correct separator */ - if ( (nodeString[0] != '/') - || (strlen(&nodeString[0]) <= 1) - ) - { - printf("FindDump: %s, error in dump name specification\n", nodeString); - return(-3); + if ((nodeString[0] != '/') + || (strlen(&nodeString[0]) <= 1) + ) { + printf("FindDump: %s, error in dump name specification\n", + nodeString); + return (-3); } matchLength = 0; - curptr = &nodeString[1]; /* past first / */ + curptr = &nodeString[1]; /* past first / */ separator = strchr(curptr, '/'); - if ( separator == 0 ) - matchLength = strlen(curptr) + 1; /* +1 for leading / */ + if (separator == 0) + matchLength = strlen(curptr) + 1; /* +1 for leading / */ else - matchLength = (separator-&nodeString[0]); - + matchLength = (separator - &nodeString[0]); + /* printf("matchLength = %d\n", matchLength); */ - while ( 1 ) - { + while (1) { /* now search all the nodes for this name */ - for ( dsptr = aconfig->dsched; dsptr != 0; dsptr = dsptr->next) - { + for (dsptr = aconfig->dsched; dsptr != 0; dsptr = dsptr->next) { /* printf("compare %s with %s for %d\n", - dsptr->name, nodeString, matchLength); */ - if ( strlen(dsptr->name) != matchLength ) - continue; + * dsptr->name, nodeString, matchLength); */ + if (strlen(dsptr->name) != matchLength) + continue; - if ( strncmp(dsptr->name, nodeString, matchLength) == 0) - { + if (strncmp(dsptr->name, nodeString, matchLength) == 0) { *nodeptr = dsptr; break; } } - if ( nodeString[matchLength] == 0 ) - { + if (nodeString[matchLength] == 0) { /* last node in the path */ - if ( *nodeptr ) - return(0); /* all ok */ + if (*nodeptr) + return (0); /* all ok */ else - /* node not found; parent exists for non root nodes */ - return(-1); + /* node not found; parent exists for non root nodes */ + return (-1); } - if ( *nodeptr == 0 ) - /* failed to find a node in the path */ - return(-2); - - curptr = separator+1; - if ( *curptr == 0 ) - { + if (*nodeptr == 0) + /* failed to find a node in the path */ + return (-2); + + curptr = separator + 1; + if (*curptr == 0) { printf("FindDump: trailing / in %s\n", nodeString); - return(-3); + return (-3); } - + separator = strchr(curptr, '/'); - if ( separator == 0 ) - matchLength = strlen(&nodeString[0]); + if (separator == 0) + matchLength = strlen(&nodeString[0]); else - matchLength = separator-&nodeString[0]; - + matchLength = separator - &nodeString[0]; + *parentptr = *nodeptr; *nodeptr = 0; } diff --git a/src/bucoord/dump.c b/src/bucoord/dump.c index 14da3ad42..917619028 100644 --- a/src/bucoord/dump.c +++ b/src/bucoord/dump.c @@ -14,7 +14,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dump.c,v 1.1.1.5 2001/09/11 14:31:35 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/dump.c,v 1.12 2003/12/07 22:49:19 jaltman Exp $"); #include #include @@ -33,8 +34,8 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dump.c,v 1.1.1.5 2001/09/11 14: #include #include #include -#include /* for checking TC_ABORTFAILED. PA */ -#include /* for checking TC_ABORTFAILED. PA */ +#include /* for checking TC_ABORTFAILED. PA */ +#include /* for checking TC_ABORTFAILED. PA */ #include #include "bc.h" @@ -42,14 +43,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dump.c,v 1.1.1.5 2001/09/11 14: struct bc_dumpTask bc_dumpTasks[BC_MAXSIMDUMPS]; -extern struct bc_config *bc_globalConfig; extern char *bc_CopyString(); extern void bc_HandleMisc(); extern char *whoami; extern char *tailCompPtr(); extern statusP createStatusNode(); extern afs_int32 bc_jobNumber(); - + extern afs_int32 lastTaskCode; #ifdef AFS_DEC_ENV @@ -67,10 +67,8 @@ extern afs_int32 lastTaskCode; bc_Dumper(aindex) { struct rx_connection *tconn; - struct tc_dumpStat dumpStat; register struct bc_volumeDump *tde; afs_int32 count, port; - struct timeval tv; struct tc_dumpDesc *volDesc = 0; struct tc_dumpArray volArray; char *baseNamePtr; @@ -78,44 +76,45 @@ bc_Dumper(aindex) struct tc_dumpInterface dumpInterface; struct tc_dumpInterface *tcdiPtr = &dumpInterface; - register struct bc_dumpTask *dumpTaskPtr; + register struct bc_dumpTask *dumpTaskPtr; register afs_int32 code = 0; dumpTaskPtr = &bc_dumpTasks[aindex]; if (!dumpTaskPtr->portOffset || (dumpTaskPtr->portCount == 0)) - port = 0; - else - port = dumpTaskPtr->portOffset[0]; + port = 0; + else + port = dumpTaskPtr->portOffset[0]; code = ConnectButc(dumpTaskPtr->config, port, &tconn); - if (code) return(code); - + if (code) + return (code); + /* count number of volumes to be dumped and * build array of volumes to be sent to backup system */ - for (count=0, tde=dumpTaskPtr->volumes; tde; tde=tde->next, count++); - volDesc = (struct tc_dumpDesc *) malloc(count*sizeof(struct tc_dumpDesc)); - if (!volDesc) - { - com_err(whoami,BC_NOMEM,""); + for (count = 0, tde = dumpTaskPtr->volumes; tde; + tde = tde->next, count++); + volDesc = + (struct tc_dumpDesc *)malloc(count * sizeof(struct tc_dumpDesc)); + if (!volDesc) { + com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } - for (count=0, tde=dumpTaskPtr->volumes; tde; tde=tde->next, count++) - { + for (count = 0, tde = dumpTaskPtr->volumes; tde; tde = tde->next, count++) { strcpy(volDesc[count].name, tde->name); - volDesc[count].vid = tde->vid; - volDesc[count].vtype = tde->volType; - volDesc[count].partition = tde->partition; - volDesc[count].hostAddr = HOSTADDR(&tde->server); /* the internet address */ - volDesc[count].date = tde->date; - volDesc[count].cloneDate = tde->cloneDate; /* Not yet known */ + volDesc[count].vid = tde->vid; + volDesc[count].vtype = tde->volType; + volDesc[count].partition = tde->partition; + volDesc[count].hostAddr = HOSTADDR(&tde->server); /* the internet address */ + volDesc[count].date = tde->date; + volDesc[count].cloneDate = tde->cloneDate; /* Not yet known */ } - volArray.tc_dumpArray_len = count; /* element count */ - volArray.tc_dumpArray_val = volDesc; /* and data */ + volArray.tc_dumpArray_len = count; /* element count */ + volArray.tc_dumpArray_val = volDesc; /* and data */ baseNamePtr = tailCompPtr(dumpTaskPtr->dumpName); @@ -134,7 +133,7 @@ bc_Dumper(aindex) tcdiPtr->tapeSet.a = 1; tcdiPtr->tapeSet.b = 1; tcdiPtr->tapeSet.maxTapes = 1000000000; - tcdiPtr->tapeSet.expDate = dumpTaskPtr->expDate; /* PA */ + tcdiPtr->tapeSet.expDate = dumpTaskPtr->expDate; /* PA */ tcdiPtr->tapeSet.expType = dumpTaskPtr->expType; /* construct dump set name */ @@ -149,33 +148,35 @@ bc_Dumper(aindex) /* start the dump on the tape coordinator */ printf("Starting dump\n"); code = TC_PerformDump(tconn, tcdiPtr, &volArray, &dumpTaskPtr->dumpID); - if (code) - { + if (code) { com_err(whoami, code, "; Failed to start dump"); ERROR(code); } - com_err(whoami,0,"Task %u: Dump (%s)", dumpTaskPtr->dumpID, tcdiPtr->dumpName); + com_err(whoami, 0, "Task %u: Dump (%s)", dumpTaskPtr->dumpID, + tcdiPtr->dumpName); /* create status monitor block */ statusPtr = createStatusNode(); lock_Status(); - statusPtr->taskId = dumpTaskPtr->dumpID; - statusPtr->port = port; + statusPtr->taskId = dumpTaskPtr->dumpID; + statusPtr->port = port; statusPtr->jobNumber = bc_jobNumber(); statusPtr->volsTotal = volArray.tc_dumpArray_len; - statusPtr->flags &= ~STARTING; - sprintf(statusPtr->taskName, "Dump (%s.%s)", dumpTaskPtr->volSetName, baseNamePtr); + statusPtr->flags &= ~STARTING; + sprintf(statusPtr->taskName, "Dump (%s.%s)", dumpTaskPtr->volSetName, + baseNamePtr); unlock_Status(); -error_exit: + error_exit: /* locally allocated resources */ - if (volDesc) free(volDesc); + if (volDesc) + free(volDesc); - if (tconn) + if (tconn) rx_DestroyConnection(tconn); - return(code); + return (code); } /* freeDumpTaskVolumeList @@ -185,18 +186,17 @@ error_exit: freeDumpTaskVolumeList(vdptr) struct bc_volumeDump *vdptr; { - struct bc_volumeDump *nextVdPtr; + struct bc_volumeDump *nextVdPtr; - while (vdptr != 0) - { - nextVdPtr = vdptr->next; + while (vdptr != 0) { + nextVdPtr = vdptr->next; - if ( vdptr->name ) - free(vdptr->name); - free(vdptr); + if (vdptr->name) + free(vdptr->name); + free(vdptr); - vdptr = nextVdPtr; - } + vdptr = nextVdPtr; + } } /* bc_DmpRstStart @@ -204,23 +204,28 @@ freeDumpTaskVolumeList(vdptr) * we allocated a dumpTask entry. Here we do the task and then free the entry. */ bc_DmpRstStart(aindex) - afs_int32 aindex; + afs_int32 aindex; { register struct bc_dumpTask *tdump; - register afs_int32 code; + register afs_int32 code; tdump = &bc_dumpTasks[aindex]; - code = (tdump->callProc)(aindex); - if (code) lastTaskCode = code; + code = (tdump->callProc) (aindex); + if (code) + lastTaskCode = code; /* Cleanup allocated data structures */ freeDumpTaskVolumeList(tdump->volumes); tdump->dumpID = 0; - if (tdump->dumpName) free(tdump->dumpName); - if (tdump->newExt) free(tdump->newExt); - if (tdump->volSetName) free(tdump->volSetName); - if (tdump->portOffset) free(tdump->portOffset); + if (tdump->dumpName) + free(tdump->dumpName); + if (tdump->newExt) + free(tdump->newExt); + if (tdump->volSetName) + free(tdump->volSetName); + if (tdump->portOffset) + free(tdump->portOffset); tdump->flags &= ~BC_DI_INUSE; return code; @@ -238,85 +243,88 @@ bc_DmpRstStart(aindex) * bc_Restorer for doing restores */ -bc_StartDmpRst(aconfig, adname, avname, avolsToDump, adestServer, adestPartition, - afromDate, anewExt, aoldFlag, aparent, alevel, aproc, ports, - portCount, dsptr, append, dontExecute) - struct bc_config *aconfig; - char *adname; - char *avname; - struct bc_volumeDump *avolsToDump; - struct sockaddr_in *adestServer; - afs_int32 adestPartition; - afs_int32 afromDate; - char *anewExt; - int aoldFlag; - afs_int32 aparent, alevel; - int (*aproc)(); - afs_int32 *ports; - afs_int32 portCount; - struct bc_dumpSchedule *dsptr; - int append, dontExecute; +bc_StartDmpRst(aconfig, adname, avname, avolsToDump, adestServer, + adestPartition, afromDate, anewExt, aoldFlag, aparent, alevel, + aproc, ports, portCount, dsptr, append, dontExecute) + struct bc_config *aconfig; + char *adname; + char *avname; + struct bc_volumeDump *avolsToDump; + struct sockaddr_in *adestServer; + afs_int32 adestPartition; + afs_int32 afromDate; + char *anewExt; + int aoldFlag; + afs_int32 aparent, alevel; + int (*aproc) (); + afs_int32 *ports; + afs_int32 portCount; + struct bc_dumpSchedule *dsptr; + int append, dontExecute; { register int i; register afs_int32 code; char *junk; - int doit; - struct bc_volumeDump *tvol, *temp; - for (i=0; i= BC_MAXSIMDUMPS) - { + if (i >= BC_MAXSIMDUMPS) { com_err(whoami, BC_NOTLOCKED, "All of the dump/restore slots are in use, try again later"); - return(BC_NOTLOCKED); + return (BC_NOTLOCKED); } - + memset(&bc_dumpTasks[i], 0, sizeof(struct bc_dumpTask)); - bc_dumpTasks[i].callProc = aproc; - bc_dumpTasks[i].config = aconfig; - bc_dumpTasks[i].volumes = avolsToDump; - bc_dumpTasks[i].flags = BC_DI_INUSE; - bc_dumpTasks[i].dumpName = bc_CopyString(adname); - bc_dumpTasks[i].volSetName = bc_CopyString(avname); - bc_dumpTasks[i].newExt = bc_CopyString(anewExt); - bc_dumpTasks[i].dumpLevel = alevel; - bc_dumpTasks[i].parentDumpID = aparent; - bc_dumpTasks[i].oldFlag = aoldFlag; - bc_dumpTasks[i].fromDate = afromDate; + bc_dumpTasks[i].callProc = aproc; + bc_dumpTasks[i].config = aconfig; + bc_dumpTasks[i].volumes = avolsToDump; + bc_dumpTasks[i].flags = BC_DI_INUSE; + bc_dumpTasks[i].dumpName = bc_CopyString(adname); + bc_dumpTasks[i].volSetName = bc_CopyString(avname); + bc_dumpTasks[i].newExt = bc_CopyString(anewExt); + bc_dumpTasks[i].dumpLevel = alevel; + bc_dumpTasks[i].parentDumpID = aparent; + bc_dumpTasks[i].oldFlag = aoldFlag; + bc_dumpTasks[i].fromDate = afromDate; bc_dumpTasks[i].destPartition = adestPartition; - bc_dumpTasks[i].portOffset = ports; - bc_dumpTasks[i].portCount = portCount; - bc_dumpTasks[i].doAppend = append; - bc_dumpTasks[i].dontExecute = dontExecute; + bc_dumpTasks[i].portOffset = ports; + bc_dumpTasks[i].portCount = portCount; + bc_dumpTasks[i].doAppend = append; + bc_dumpTasks[i].dontExecute = dontExecute; - if (dsptr) - { + if (dsptr) { /* This should be specified for dumps, but will be 0 for restores */ bc_dumpTasks[i].expDate = dsptr->expDate; bc_dumpTasks[i].expType = dsptr->expType; } if (adestServer) - memcpy(&bc_dumpTasks[i].destServer, adestServer, sizeof(struct sockaddr_in)); + memcpy(&bc_dumpTasks[i].destServer, adestServer, + sizeof(struct sockaddr_in)); else - memset(&bc_dumpTasks[i].destServer, 0, sizeof(struct sockaddr_in)); - - code = LWP_CreateProcess(bc_DmpRstStart, 20480, LWP_NORMAL_PRIORITY, i, "helper", &junk); - if (code) - { + memset(&bc_dumpTasks[i].destServer, 0, sizeof(struct sockaddr_in)); + + code = + LWP_CreateProcess(bc_DmpRstStart, 20480, LWP_NORMAL_PRIORITY, + (void *)i, "helper", &junk); + if (code) { bc_HandleMisc(code); - com_err(whoami,code,"; Can't start thread"); + com_err(whoami, code, "; Can't start thread"); /* Cleanup allocated data structures */ freeDumpTaskVolumeList(bc_dumpTasks[i].volumes); bc_dumpTasks[i].dumpID = 0; - if (bc_dumpTasks[i].dumpName) free(bc_dumpTasks[i].dumpName); - if (bc_dumpTasks[i].newExt) free(bc_dumpTasks[i].newExt); - if (bc_dumpTasks[i].volSetName) free(bc_dumpTasks[i].volSetName); - if (bc_dumpTasks[i].portOffset) free(bc_dumpTasks[i].portOffset); + if (bc_dumpTasks[i].dumpName) + free(bc_dumpTasks[i].dumpName); + if (bc_dumpTasks[i].newExt) + free(bc_dumpTasks[i].newExt); + if (bc_dumpTasks[i].volSetName) + free(bc_dumpTasks[i].volSetName); + if (bc_dumpTasks[i].portOffset) + free(bc_dumpTasks[i].portOffset); bc_dumpTasks[i].flags &= ~BC_DI_INUSE; - return(code); + return (code); } return 0; @@ -339,17 +347,15 @@ bc_FindDumpSlot(dumpID, port) afs_int32 port; { int i; - - for ( i = 0; i < BC_MAXSIMDUMPS; i++ ) - { - if ( (bc_dumpTasks[i].flags & BC_DI_INUSE) && - (bc_dumpTasks[i].dumpID == dumpID) && - ((afs_int32)bc_dumpTasks[i].portOffset == port) ) - { - return(i); + + for (i = 0; i < BC_MAXSIMDUMPS; i++) { + if ((bc_dumpTasks[i].flags & BC_DI_INUSE) + && (bc_dumpTasks[i].dumpID == dumpID) + && ((afs_int32) bc_dumpTasks[i].portOffset == port)) { + return (i); } } - return(-1); + return (-1); } #endif @@ -358,11 +364,11 @@ bc_FindDumpSlot(dumpID, port) * label a tape */ -bc_LabelTape (afsname, pname, size, config, port) -char *afsname, *pname; -struct bc_config *config; -afs_int32 port; -afs_int32 size; +bc_LabelTape(afsname, pname, size, config, port) + char *afsname, *pname; + struct bc_config *config; + afs_int32 port; + afs_int32 size; { struct rx_connection *tconn; afs_int32 code = 0; @@ -371,20 +377,20 @@ afs_int32 size; afs_uint32 taskId; code = ConnectButc(config, port, &tconn); - if (code) return(code); - + if (code) + return (code); + memset(&label, 0, sizeof(label)); if (afsname) - strcpy(label.afsname, afsname); + strcpy(label.afsname, afsname); if (pname) - strcpy(label.pname, (strcmp(pname,"")?pname:"")); + strcpy(label.pname, (strcmp(pname, "") ? pname : "")); label.size = size; code = TC_LabelTape(tconn, &label, &taskId); - if (code) - { - com_err(whoami,code,"; Failed to start labeltape"); - return(code); + if (code) { + com_err(whoami, code, "; Failed to start labeltape"); + return (code); } /* create status monitor block */ @@ -393,13 +399,13 @@ afs_int32 size; statusPtr->taskId = taskId; statusPtr->port = port; statusPtr->jobNumber = bc_jobNumber(); - /* statusPtr->flags |= SILENT; */ /* don't report termination */ - statusPtr->flags &= ~STARTING; /* ok to examine */ + /* statusPtr->flags |= SILENT; *//* don't report termination */ + statusPtr->flags &= ~STARTING; /* ok to examine */ sprintf(statusPtr->taskName, "Labeltape (%s)", (pname ? pname : (afsname ? afsname : ""))); unlock_Status(); - + return 0; } @@ -408,53 +414,53 @@ afs_int32 size; * a tape */ -bc_ReadLabel(config,port) - struct bc_config *config; - afs_int32 port; +bc_ReadLabel(config, port) + struct bc_config *config; + afs_int32 port; { struct rx_connection *tconn; struct tc_tapeLabel label; afs_uint32 taskId; afs_int32 code = 0; - char *tname=0; + char *tname = 0; code = ConnectButc(config, port, &tconn); - if (code) return(code); - + if (code) + return (code); + memset(&label, 0, sizeof(label)); code = TC_ReadLabel(tconn, &label, &taskId); if (code) { - if (code == BUTM_NOLABEL) { - printf("Tape read was unlabelled\n"); - return 0; + if (code == BUTM_NOLABEL) { + printf("Tape read was unlabelled\n"); + return 0; } - com_err(whoami,code,"; Failed to start readlabel"); - return(code); + com_err(whoami, code, "; Failed to start readlabel"); + return (code); } - if (strcmp(label.pname,"")) - tname = label.pname; - else if (strcmp(label.afsname,"")) - tname = label.afsname; + if (strcmp(label.pname, "")) + tname = label.pname; + else if (strcmp(label.afsname, "")) + tname = label.afsname; if (!tname) { - printf("Tape read was labelled : size : %u\n",label.size); - } - else if (!label.tapeId) { - printf("Tape read was labelled : %s size : %lu Kbytes\n", tname, label.size); - } - else { - printf("Tape read was labelled : %s (%lu) size : %lu Kbytes\n", - tname, label.tapeId, label.size); + printf("Tape read was labelled : size : %u\n", label.size); + } else if (!label.tapeId) { + printf("Tape read was labelled : %s size : %lu Kbytes\n", tname, + label.size); + } else { + printf("Tape read was labelled : %s (%lu) size : %lu Kbytes\n", tname, + label.tapeId, label.size); } return 0; } bc_ScanDumps(config, dbAddFlag, port) - struct bc_config *config; - afs_int32 dbAddFlag; - afs_int32 port; + struct bc_config *config; + afs_int32 dbAddFlag; + afs_int32 port; { struct rx_connection *tconn; statusP statusPtr; @@ -462,26 +468,26 @@ bc_ScanDumps(config, dbAddFlag, port) afs_int32 code = 0; code = ConnectButc(config, port, &tconn); - if (code) return(code); - - code = TC_ScanDumps(tconn, dbAddFlag, &taskId); if (code) - { + return (code); + + code = TC_ScanDumps(tconn, dbAddFlag, &taskId); + if (code) { com_err(whoami, code, "; Failed to start scantape"); - return(code); + return (code); } /* create status monitor block */ statusPtr = createStatusNode(); lock_Status(); - statusPtr->taskId = taskId; - statusPtr->port = port; - statusPtr->jobNumber = bc_jobNumber(); - statusPtr->flags &= ~STARTING; /* ok to examine */ + statusPtr->taskId = taskId; + statusPtr->port = port; + statusPtr->jobNumber = bc_jobNumber(); + statusPtr->flags &= ~STARTING; /* ok to examine */ sprintf(statusPtr->taskName, "Scantape"); unlock_Status(); - - return(0); + + return (0); } /*************/ @@ -490,12 +496,12 @@ bc_ScanDumps(config, dbAddFlag, port) /* get a connection to the tape controller */ afs_int32 -bc_GetConn (aconfig, aport, tconn) - struct bc_config *aconfig; - afs_int32 aport; - struct rx_connection **tconn; +bc_GetConn(aconfig, aport, tconn) + struct bc_config *aconfig; + afs_int32 aport; + struct rx_connection **tconn; { - afs_int32 code = 0; + afs_int32 code = 0; afs_uint32 host; unsigned short port; static struct rx_securityClass *rxsc; @@ -505,25 +511,25 @@ bc_GetConn (aconfig, aport, tconn) /* use non-secure connections to butc */ if (!rxsc) - rxsc = (struct rx_securityClass *) rxnull_NewClientSecurityObject(); - if (!rxsc || !aconfig) return(-1); + rxsc = rxnull_NewClientSecurityObject(); + if (!rxsc || !aconfig) + return (-1); - for (te = aconfig->tapeHosts; te; te = te->next) - { - if ( te->portOffset == aport ) - { + for (te = aconfig->tapeHosts; te; te = te->next) { + if (te->portOffset == aport) { /* found the right port */ - host = te->addr.sin_addr.s_addr; - if (!host) return (BC_NOHOSTENTRY); /* gethostbyname in bc_ParseHosts failed */ + host = te->addr.sin_addr.s_addr; + if (!host) + return (BC_NOHOSTENTRY); /* gethostbyname in bc_ParseHosts failed */ port = htons(BC_TAPEPORT + aport); /* servers is 1; sec index is 0 */ *tconn = rx_NewConnection(host, port, 1, rxsc, 0); - return((*tconn ? 0 : -1)); + return ((*tconn ? 0 : -1)); } } - return(BC_NOHOSTENTRY); + return (BC_NOHOSTENTRY); } /* CheckTCVersion @@ -540,39 +546,42 @@ CheckTCVersion(tconn) afs_int32 code; code = TC_TCInfo(tconn, &tci); - if (code) return(code); - + if (code) + return (code); + if (tci.tcVersion != CUR_BUTC_VERSION) - return(BC_VERSIONFAIL); + return (BC_VERSIONFAIL); return 0; } + ConnectButc(config, port, tconn) - struct bc_config *config; - afs_int32 port; - struct rx_connection **tconn; + struct bc_config *config; + afs_int32 port; + struct rx_connection **tconn; { afs_int32 code; code = bc_GetConn(config, port, tconn); - if (code) - { - com_err(whoami,code,"; Can't connect to tape coordinator at port %d", port); - return(code); + if (code) { + com_err(whoami, code, + "; Can't connect to tape coordinator at port %d", port); + return (code); } code = CheckTCVersion(*tconn); - if (code) - { + if (code) { rx_DestroyConnection(*tconn); if (code == BC_VERSIONFAIL) - com_err(whoami, code, "; Backup and butc are not the same version"); + com_err(whoami, code, + "; Backup and butc are not the same version"); else - com_err(whoami, code, "; Can't access tape coordinator at port %d", port); + com_err(whoami, code, + "; Can't access tape coordinator at port %d", port); - return(code); + return (code); } - - return(0); + + return (0); } diff --git a/src/bucoord/dump_sched.c b/src/bucoord/dump_sched.c index c34dd148a..e9467503e 100644 --- a/src/bucoord/dump_sched.c +++ b/src/bucoord/dump_sched.c @@ -16,7 +16,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dump_sched.c,v 1.1.1.5 2001/09/11 14:31:36 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/dump_sched.c,v 1.7 2003/11/23 04:53:30 jaltman Exp $"); #ifdef AFS_NT40_ENV #include @@ -49,7 +50,7 @@ extern char *whoami; * command level routines * ------------------------------------ */ - + /* bc_AddDumpCmd * add a dump schedule * params: @@ -57,30 +58,27 @@ extern char *whoami; * parm 1: expiration date (list) */ -afs_int32 bc_AddDumpCmd(as, arock) -struct cmd_syndesc *as; -char *arock; { - register char *dname; /* dump schedule name */ - char *dateString; /* expiration date */ +afs_int32 +bc_AddDumpCmd(as, arock) + struct cmd_syndesc *as; + char *arock; +{ + register char *dname; /* dump schedule name */ register afs_int32 code; afs_int32 expType, expDate; - register struct cmd_item *ti, *expItem; + register struct cmd_item *ti; udbClientTextP ctPtr; afs_int32 bc_ParseExpiration(); /* if an expiration date has been specified */ - if (as->parms[1].items) - { + if (as->parms[1].items) { code = bc_ParseExpiration(&as->parms[1], &expType, &expDate); - if (code) - { + if (code) { printf("Invalid expiration date syntax\n"); - return(1); + return (1); } - } - else - { + } else { /* no expiration date specified */ expDate = 0; expType = BC_NO_EXPDATE; @@ -90,60 +88,59 @@ char *arock; { ctPtr = &bc_globalConfig->configText[TB_DUMPSCHEDULE]; code = bc_LockText(ctPtr); - if (code) ERROR(code); + if (code) + ERROR(code); code = bc_UpdateDumpSchedule(); if (code) { - com_err(whoami, code, "; Can't retrieve dump schedule"); - return(code); + com_err(whoami, code, "; Can't retrieve dump schedule"); + return (code); } /* process each dump name using the expiration date computed above */ - for( ti=as->parms[0].items; ti != 0; ti = ti->next ) - { + for (ti = as->parms[0].items; ti != 0; ti = ti->next) { /* get next dump name to process */ dname = ti->data; - + /* validate the name dump name length */ - if ( strlen(dname) >= BU_MAX_DUMP_PATH ) - { - com_err(whoami, 0, "Dump names must be < %d characters", BU_MAX_DUMP_PATH); + if (strlen(dname) >= BU_MAX_DUMP_PATH) { + com_err(whoami, 0, "Dump names must be < %d characters", + BU_MAX_DUMP_PATH); com_err(whoami, 0, "Dump %s not added", dname); code = -1; continue; } - code = bc_CreateDumpSchedule(bc_globalConfig, dname, expDate, expType); - if (code) - { + code = + bc_CreateDumpSchedule(bc_globalConfig, dname, expDate, expType); + if (code) { if (code == -1) - com_err(whoami,0,"Dump already exists"); - else - if (code == -2) - com_err(whoami,0,"Invalid path name '%s'", dname); + com_err(whoami, 0, "Dump already exists"); + else if (code == -2) + com_err(whoami, 0, "Invalid path name '%s'", dname); + else if (code == -3) + com_err(whoami, 0, "Name specification error"); else - if ( code == -3 ) - com_err(whoami, 0, "Name specification error"); - else - com_err(whoami,code,"; Failed to create dump schedule"); + com_err(whoami, code, "; Failed to create dump schedule"); continue; } - + /* save the new schedule item */ code = bc_SaveDumpSchedule(); - if (code) - { + if (code) { com_err(whoami, code, "Cannot save dump schedule"); - com_err(whoami,0,"Changes are temporary - for this session only"); + com_err(whoami, 0, + "Changes are temporary - for this session only"); break; } - com_err(whoami,0,"Created new dump schedule %s", dname); + com_err(whoami, 0, "Created new dump schedule %s", dname); } -error_exit: - if (ctPtr->lockHandle) bc_UnlockText(ctPtr); - return(code); + error_exit: + if (ctPtr->lockHandle) + bc_UnlockText(ctPtr); + return (code); } @@ -151,52 +148,52 @@ error_exit: * delete a dump schedule */ -afs_int32 bc_DeleteDumpCmd(as, arock) -struct cmd_syndesc *as; -char *arock; { +afs_int32 +bc_DeleteDumpCmd(as, arock) + struct cmd_syndesc *as; + char *arock; +{ /* parm 0 is vol set name * parm 1 is dump schedule name */ - register char *dname; - register afs_int32 code; + register char *dname; + register afs_int32 code; udbClientTextP ctPtr; /* lock schedules and check validity */ ctPtr = &bc_globalConfig->configText[TB_DUMPSCHEDULE]; code = bc_LockText(ctPtr); - if ( code ) - ERROR(code); + if (code) + ERROR(code); code = bc_UpdateDumpSchedule(); if (code) { - com_err(whoami, code, "; Can't retrieve dump schedule"); - return(code); + com_err(whoami, code, "; Can't retrieve dump schedule"); + return (code); } dname = as->parms[0].items->data; code = bc_DeleteDumpSchedule(bc_globalConfig, dname); - if (code) - { + if (code) { if (code == -1) - com_err(whoami,0,"No such dump as %s", dname); + com_err(whoami, 0, "No such dump as %s", dname); else - com_err(whoami,code,"; Failed to delete dump schedule"); + com_err(whoami, code, "; Failed to delete dump schedule"); goto error_exit; } - + code = bc_SaveDumpSchedule(); if (code == 0) - printf("backup: deleted dump schedule %s\n", dname); - else - { + printf("backup: deleted dump schedule %s\n", dname); + else { com_err(whoami, code, "Cannot save dump schedule file"); - com_err(whoami,0,"Deletion is temporary - for this session only"); + com_err(whoami, 0, "Deletion is temporary - for this session only"); } -error_exit: - if ( ctPtr->lockHandle != 0 ) + error_exit: + if (ctPtr->lockHandle != 0) bc_UnlockText(ctPtr); return code; } @@ -209,9 +206,10 @@ error_exit: * ignored */ -afs_int32 bc_ListDumpScheduleCmd(as, arock) -struct cmd_syndesc *as; -char *arock; +afs_int32 +bc_ListDumpScheduleCmd(as, arock) + struct cmd_syndesc *as; + char *arock; { /* no parms */ afs_int32 code; @@ -220,18 +218,17 @@ char *arock; /* first check to see if schedules must be updated */ code = bc_UpdateDumpSchedule(); if (code) { - com_err(whoami, code, "; Can't retrieve dump schedule"); - return(code); + com_err(whoami, code, "; Can't retrieve dump schedule"); + return (code); } /* go through entire list, displaying trees for root-level dump * schedules */ - for(tdump = bc_globalConfig->dsched; tdump; tdump=tdump->next) - { - /* if this is a root-level dump, show it and its kids */ - if (!tdump->parent) - ListDumpSchedule(tdump, 0); + for (tdump = bc_globalConfig->dsched; tdump; tdump = tdump->next) { + /* if this is a root-level dump, show it and its kids */ + if (!tdump->parent) + ListDumpSchedule(tdump, 0); } return 0; } @@ -244,11 +241,12 @@ char *arock; * parm 1: expiration date (list) */ -afs_int32 bc_SetExpCmd(as, arock) +afs_int32 +bc_SetExpCmd(as, arock) struct cmd_syndesc *as; char *arock; { - register char *dname; /* dump schedule name */ + register char *dname; /* dump schedule name */ register struct cmd_item *ti; struct bc_dumpSchedule *node, *parent; afs_int32 expType, expDate; @@ -258,17 +256,13 @@ afs_int32 bc_SetExpCmd(as, arock) afs_int32 bc_ParseExpiration(); /* if an expiration date has been specified */ - if (as->parms[1].items) - { + if (as->parms[1].items) { code = bc_ParseExpiration(&as->parms[1], &expType, &expDate); - if (code) - { + if (code) { printf("Invalid expiration date syntax\n"); - return(1); + return (1); } - } - else - { + } else { /* no expiration date specified */ expDate = 0; expType = BC_NO_EXPDATE; @@ -278,32 +272,31 @@ afs_int32 bc_SetExpCmd(as, arock) ctPtr = &bc_globalConfig->configText[TB_DUMPSCHEDULE]; code = bc_LockText(ctPtr); - if (code) ERROR(code); + if (code) + ERROR(code); code = bc_UpdateDumpSchedule(); if (code) { - com_err(whoami, code, "; Can't retrieve dump schedule"); - return(code); + com_err(whoami, code, "; Can't retrieve dump schedule"); + return (code); } /* process each dump name using the expiration date computed above */ - for( ti = as->parms[0].items; ti != 0; ti = ti->next) - { + for (ti = as->parms[0].items; ti != 0; ti = ti->next) { /* get next dump name to process */ dname = ti->data; - + /* validate the name dump name length */ - if ( strlen(dname) >= BU_MAX_DUMP_PATH ) - { + if (strlen(dname) >= BU_MAX_DUMP_PATH) { code = -1; - com_err(whoami, 0, "Dump names must be < %d characters", BU_MAX_DUMP_PATH); + com_err(whoami, 0, "Dump names must be < %d characters", + BU_MAX_DUMP_PATH); com_err(whoami, 0, "Dump %s not added", dname); continue; } code = FindDump(bc_globalConfig, dname, &parent, &node); - if (code) - { + if (code) { com_err(whoami, 0, "Dump level %s not found", dname); continue; } @@ -311,17 +304,18 @@ afs_int32 bc_SetExpCmd(as, arock) node->expDate = expDate; node->expType = expType; } - + code = bc_SaveDumpSchedule(); - if ( code ) - { + if (code) { com_err(whoami, code, "Cannot save dump schedule"); - com_err(whoami,0,"Expiration changes effective for this session only"); + com_err(whoami, 0, + "Expiration changes effective for this session only"); } -error_exit: - if (ctPtr->lockHandle) bc_UnlockText(ctPtr); - return(code); + error_exit: + if (ctPtr->lockHandle) + bc_UnlockText(ctPtr); + return (code); } @@ -334,13 +328,13 @@ error_exit: bc_ParseDumpSchedule() { char tbuffer[1024]; - char dsname[256], period[64]; + char dsname[256], period[64]; char *tp; afs_int32 code; udbClientTextP ctPtr; register struct bc_dumpSchedule *tds; struct bc_dumpSchedule **ppds, *pds; - afs_int32 expDate, expType; + afs_int32 expDate, expType; register FILE *stream; @@ -348,56 +342,55 @@ bc_ParseDumpSchedule() ctPtr = &bc_globalConfig->configText[TB_DUMPSCHEDULE]; stream = ctPtr->textStream; - if ( ctPtr->textSize == 0 ) /* nothing defined yet */ - return(0); + if (ctPtr->textSize == 0) /* nothing defined yet */ + return (0); - if ( stream == NULL ) - return(BC_INTERNALERROR); + if (stream == NULL) + return (BC_INTERNALERROR); rewind(stream); /* check the magic number and version */ tp = fgets(tbuffer, sizeof(tbuffer), stream); - if ( tp == 0 ) + if (tp == 0) /* can't read first line - error */ - return(BC_INTERNALERROR); - else - { + return (BC_INTERNALERROR); + else { afs_int32 dsmagic, dsversion; - + /* read the first line, and then check magic # and version */ - + code = sscanf(tbuffer, "%d %d", &dsmagic, &dsversion); - if ( (code != 2) - || (dsmagic != BC_SCHEDULE_MAGIC) - || (dsversion != BC_SCHEDULE_VERSION) - ) - { + if ((code != 2) + || (dsmagic != BC_SCHEDULE_MAGIC) + || (dsversion != BC_SCHEDULE_VERSION) + ) { /* invalid or unexpected header - error */ com_err(whoami, 0, "Unable to understand dump schedule file"); - return(BC_INTERNALERROR); + return (BC_INTERNALERROR); } } - while(1) - { + while (1) { /* read all of the lines out */ tp = fgets(tbuffer, sizeof(tbuffer), stream); - if ( tp == 0 ) - break; /* hit eof? */ - code = sscanf(tbuffer, "%s %s %d %d", dsname, period, - &expDate, &expType); - if (code != 4) - { - com_err(whoami,0,"Syntax error in dump schedule file, line is: %s", + if (tp == 0) + break; /* hit eof? */ + code = + sscanf(tbuffer, "%s %s %d %d", dsname, period, &expDate, + &expType); + if (code != 4) { + com_err(whoami, 0, + "Syntax error in dump schedule file, line is: %s", tbuffer); return (BC_INTERNALERROR); } - tds = (struct bc_dumpSchedule *)malloc(sizeof(struct bc_dumpSchedule)); + tds = + (struct bc_dumpSchedule *)malloc(sizeof(struct bc_dumpSchedule)); memset(tds, 0, sizeof(*tds)); - tds->next = (struct bc_dumpSchedule *) 0; - tds->name = (char *) malloc(strlen(dsname)+1); + tds->next = (struct bc_dumpSchedule *)0; + tds->name = (char *)malloc(strlen(dsname) + 1); strcpy(tds->name, dsname); tds->expDate = expDate; @@ -406,14 +399,13 @@ bc_ParseDumpSchedule() /* find the end of the schedule list, and append the new item to it */ ppds = &bc_globalConfig->dsched; pds = *ppds; - while ( pds != 0 ) - { + while (pds != 0) { ppds = &pds->next; pds = *ppds; } *ppds = tds; } - return 0; + return 0; } @@ -428,45 +420,44 @@ bc_SaveDumpSchedule() /* setup the right ptr */ ctPtr = &bc_globalConfig->configText[TB_DUMPSCHEDULE]; - + /* must be locked */ - if ( ctPtr->lockHandle == 0 ) - return(BC_INTERNALERROR); + if (ctPtr->lockHandle == 0) + return (BC_INTERNALERROR); /* truncate the file */ code = ftruncate(fileno(ctPtr->textStream), 0); - if ( code ) - ERROR(errno); + if (code) + ERROR(errno); rewind(ctPtr->textStream); /* write the new information */ - fprintf(ctPtr->textStream, "%d %d\n", - BC_SCHEDULE_MAGIC, BC_SCHEDULE_VERSION); + fprintf(ctPtr->textStream, "%d %d\n", BC_SCHEDULE_MAGIC, + BC_SCHEDULE_VERSION); - for(tdump = bc_globalConfig->dsched; tdump; tdump = tdump->next) - { - fprintf(ctPtr->textStream, "%s %s %d %d\n",tdump->name, "any", - tdump->expDate, tdump->expType); + for (tdump = bc_globalConfig->dsched; tdump; tdump = tdump->next) { + fprintf(ctPtr->textStream, "%s %s %d %d\n", tdump->name, "any", + tdump->expDate, tdump->expType); } if (ferror(ctPtr->textStream)) - return(BC_INTERNALERROR); + return (BC_INTERNALERROR); - fflush(ctPtr->textStream); /* debug */ + fflush(ctPtr->textStream); /* debug */ /* send to server */ code = bcdb_SaveTextFile(ctPtr); - if ( code ) - ERROR(code); + if (code) + ERROR(code); /* increment local version number */ ctPtr->textVersion++; /* update locally stored file size */ ctPtr->textSize = filesize(ctPtr->textStream); -error_exit: - return(code); + error_exit: + return (code); } @@ -475,7 +466,8 @@ error_exit: * ------------------------------------ */ -afs_int32 bc_UpdateDumpSchedule() +afs_int32 +bc_UpdateDumpSchedule() { struct bc_dumpSchedule *dumpPtr, *nextDumpPtr; struct udbHandleS *uhptr = &udbHandle; @@ -487,29 +479,25 @@ afs_int32 bc_UpdateDumpSchedule() ctPtr = &bc_globalConfig->configText[TB_DUMPSCHEDULE]; code = bc_CheckTextVersion(ctPtr); - if ( code != BC_VERSIONMISMATCH ) - { - ERROR(code); /* Version matches or some other error */ + if (code != BC_VERSIONMISMATCH) { + ERROR(code); /* Version matches or some other error */ } /* Must update the dump schedules */ /* If we are not already locked, then lock it now */ - if ( !ctPtr->lockHandle ) - { - code = bc_LockText(ctPtr); - if ( code ) - ERROR(code); + if (!ctPtr->lockHandle) { + code = bc_LockText(ctPtr); + if (code) + ERROR(code); lock = 1; } - if (ctPtr->textVersion != -1) - { - printf("backup: obsolete dump schedule - updating\n"); - + if (ctPtr->textVersion != -1) { + printf("backup: obsolete dump schedule - updating\n"); + /* clear all old schedule information */ dumpPtr = bc_globalConfig->dsched; - while ( dumpPtr ) - { + while (dumpPtr) { nextDumpPtr = dumpPtr->next; free(dumpPtr); dumpPtr = nextDumpPtr; @@ -519,34 +507,38 @@ afs_int32 bc_UpdateDumpSchedule() /* open a temp file to store the config text received from buserver * * The open file stream is stored in ctPtr->textStream */ - code = bc_openTextFile(ctPtr, &bc_globalConfig->tmpTextFileNames[TB_DUMPSCHEDULE][0]); - if ( code ) - ERROR(code); + code = + bc_openTextFile(ctPtr, + &bc_globalConfig-> + tmpTextFileNames[TB_DUMPSCHEDULE][0]); + if (code) + ERROR(code); /* now get a fresh set of information from the database */ code = bcdb_GetTextFile(ctPtr); - if ( code ) - ERROR(code); + if (code) + ERROR(code); - /* fetch the version number */ - code = ubik_Call(BUDB_GetTextVersion, uhptr->uh_client, 0, - ctPtr->textType, &ctPtr->textVersion); - if ( code ) + /* fetch the version number */ + code = + ubik_Call(BUDB_GetTextVersion, uhptr->uh_client, 0, ctPtr->textType, + &ctPtr->textVersion); + if (code) ERROR(code); /* parse the file */ code = bc_ParseDumpSchedule(); - if ( code ) - ERROR(code); + if (code) + ERROR(code); /* rebuild the tree */ code = bc_ProcessDumpSchedule(bc_globalConfig); - if ( code ) - ERROR(code); + if (code) + ERROR(code); -error_exit: - if ( lock && ctPtr->lockHandle ) + error_exit: + if (lock && ctPtr->lockHandle) bc_UnlockText(ctPtr); - return(code); + return (code); } /* ListDumpSchedule @@ -557,9 +549,11 @@ error_exit: * alevel - 0 */ -static ListDumpSchedule(adump, alevel) -int alevel; -register struct bc_dumpSchedule *adump; { +static +ListDumpSchedule(adump, alevel) + int alevel; + register struct bc_dumpSchedule *adump; +{ register int i; register struct bc_dumpSchedule *child; @@ -572,7 +566,7 @@ register struct bc_dumpSchedule *adump; { } /* move to appropriate indentation level */ - for(i=0; iexpType ) - { - case BC_ABS_EXPDATE: + switch (adump->expType) { + case BC_ABS_EXPDATE: /* absolute expiration date. Never expires if date is 0 */ - if ( adump->expDate ) - { + if (adump->expDate) { printf("expires at %.24s", cTIME(&adump->expDate)); } break; - case BC_REL_EXPDATE: + case BC_REL_EXPDATE: { struct ktime_date kt; @@ -603,12 +595,12 @@ register struct bc_dumpSchedule *adump; { } break; - default: + default: break; } printf("\n"); - for(child = adump->firstChild; child; child = child->nextSibling) - ListDumpSchedule(child, alevel+1); + for (child = adump->firstChild; child; child = child->nextSibling) + ListDumpSchedule(child, alevel + 1); return 0; } diff --git a/src/bucoord/error_macros.h b/src/bucoord/error_macros.h index c01378959..af619a4fe 100644 --- a/src/bucoord/error_macros.h +++ b/src/bucoord/error_macros.h @@ -20,4 +20,3 @@ code = evalue; \ goto abort_exit; \ } - diff --git a/src/bucoord/expire.c b/src/bucoord/expire.c index ec8886378..ed85d1f30 100644 --- a/src/bucoord/expire.c +++ b/src/bucoord/expire.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/expire.c,v 1.1.1.5 2001/09/11 14:31:36 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/expire.c,v 1.6 2003/07/15 23:14:47 shadow Exp $"); #include #include @@ -28,17 +29,15 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/expire.c,v 1.1.1.5 2001/09/11 1 #define MAX_DAY_VALUE 30 /* for parsing relative expiration dates */ -static struct parseseqS -{ +static struct parseseqS { afs_int32 ps_field; char ps_keychar; afs_int32 ps_maxValue; } parseseq[] = { KTIMEDATE_YEAR, 'y', MAX_YEAR_VALUE, /* no max. value */ - KTIMEDATE_MONTH, 'm', MAX_MONTH_VALUE, /* months max. 12 */ - KTIMEDATE_DAY, 'd', MAX_DAY_VALUE, /* days max. 31 */ - 0, 0, 0, -}; + KTIMEDATE_MONTH, 'm', MAX_MONTH_VALUE, /* months max. 12 */ + KTIMEDATE_DAY, 'd', MAX_DAY_VALUE, /* days max. 31 */ +0, 0, 0,}; /* Encodings to and from relative dates. The caller is responsible for * enforcing appropriate use of these routines @@ -49,9 +48,10 @@ ktimeRelDate_ToLong(kdptr) { afs_int32 retval; - retval = (((kdptr->year*(MAX_MONTH_VALUE+1)) + - kdptr->month)*(MAX_DAY_VALUE+1)) + kdptr->day; - return(retval); + retval = + (((kdptr->year * (MAX_MONTH_VALUE + 1)) + + kdptr->month) * (MAX_DAY_VALUE + 1)) + kdptr->day; + return (retval); } /* LongTo_ktimeRelDate @@ -64,26 +64,26 @@ LongTo_ktimeRelDate(longDate, kdptr) struct ktime_date *kdptr; { memset(kdptr, 0, sizeof(*kdptr)); - + kdptr->day = longDate % (MAX_DAY_VALUE + 1); - if ( kdptr->day != 0 ) - kdptr->mask |= KTIMEDATE_DAY; + if (kdptr->day != 0) + kdptr->mask |= KTIMEDATE_DAY; + + longDate = longDate / (MAX_DAY_VALUE + 1); - longDate = longDate/(MAX_DAY_VALUE + 1); - kdptr->month = longDate % (MAX_MONTH_VALUE + 1); - if ( kdptr->month != 0 ) - kdptr->mask |= KTIMEDATE_MONTH; + if (kdptr->month != 0) + kdptr->mask |= KTIMEDATE_MONTH; + + longDate = longDate / (MAX_MONTH_VALUE + 1); - longDate = longDate/(MAX_MONTH_VALUE + 1); - kdptr->year = longDate; - if ( kdptr->year != 0 ) - kdptr->mask |= KTIMEDATE_YEAR; + if (kdptr->year != 0) + kdptr->mask |= KTIMEDATE_YEAR; - return(0); + return (0); } - + #ifdef notdef /* First some date storage and retrieval routines. @@ -107,15 +107,10 @@ ktimeDate_ToCompactString(kdptr) { char buffer[1024]; - sprintf(buffer, "%-d:%-d:%-d:%-d:%-d:%-d", - kdptr->year, - kdptr->month, - kdptr->day, - kdptr->hour, - kdptr->min, - kdptr->sec); + sprintf(buffer, "%-d:%-d:%-d:%-d:%-d:%-d", kdptr->year, kdptr->month, + kdptr->day, kdptr->hour, kdptr->min, kdptr->sec); - return(&buffer[0]); + return (&buffer[0]); } /* CompactStringTo_ktimeDate @@ -131,38 +126,34 @@ CompactStringTo_ktimeDate(stptr, kdptr) { afs_int32 code; - code = sscanf(stptr, "%d:%d:%d:%d:%d:%d", - &kdptr->year, - &kdptr->month, - &kdptr->day, - &kdptr->hour, - &kdptr->min, - &kdptr->sec); + code = + sscanf(stptr, "%d:%d:%d:%d:%d:%d", &kdptr->year, &kdptr->month, + &kdptr->day, &kdptr->hour, &kdptr->min, &kdptr->sec); - if ( code != 6 ) - return(-1); + if (code != 6) + return (-1); kdptr->mask = 0; - if ( kdptr->year ) - kdptr->mask |= KTIMEDATE_YEAR; + if (kdptr->year) + kdptr->mask |= KTIMEDATE_YEAR; - if ( kdptr->month ) - kdptr->mask |= KTIMEDATE_MONTH; + if (kdptr->month) + kdptr->mask |= KTIMEDATE_MONTH; - if ( kdptr->day ) - kdptr->mask |= KTIMEDATE_DAY; + if (kdptr->day) + kdptr->mask |= KTIMEDATE_DAY; - if ( kdptr->hour ) - kdptr->mask |= KTIMEDATE_HOUR; + if (kdptr->hour) + kdptr->mask |= KTIMEDATE_HOUR; - if ( kdptr->min ) - kdptr->mask |= KTIMEDATE_MIN; + if (kdptr->min) + kdptr->mask |= KTIMEDATE_MIN; - if ( kdptr->sec ) - kdptr->mask |= KTIMEDATE_SEC; + if (kdptr->sec) + kdptr->mask |= KTIMEDATE_SEC; - return(0); + return (0); } /* ktimeDate_FromLong @@ -189,10 +180,11 @@ ktimeDate_FromLong(timeSecs, ktimePtr) ktimePtr->month = timePtr->mon; ktimePtr->year = timePtr->year; - ktimePtr->mask = KTIMEDATE_YEAR | KTIMEDATE_MONTH | KTIMEDATE_DAY | - KTIMEDATE_HOUR | KTIMEDATE_MIN | KTIMEDATE_SEC; + ktimePtr->mask = + KTIMEDATE_YEAR | KTIMEDATE_MONTH | KTIMEDATE_DAY | KTIMEDATE_HOUR | + KTIMEDATE_MIN | KTIMEDATE_SEC; - return(0); + return (0); } @@ -208,15 +200,15 @@ ktimeDate_FromLong(timeSecs, ktimePtr) */ afs_int32 -AddKtimeToNow( relDatePtr ) +AddKtimeToNow(relDatePtr) struct ktime_date *relDatePtr; { struct parseseqS typePtr; afs_int32 curTime; afs_int32 moreYears; static struct ktime_date absDate; - - curTime = time(0); /* get current time */ + + curTime = time(0); /* get current time */ ktimeDate_FromLong(curTime, &absDate); /* convert to ktime */ /* add in years */ @@ -224,24 +216,24 @@ AddKtimeToNow( relDatePtr ) /* add in months */ absDate.month += relDatePtr->month; - if ( absDate.month > 12 ) - { + if (absDate.month > 12) { moreYears = absDate.month / 12; absDate.month = absDate.month % 12; absDate.year += moreYears; } - + /* day computations depend upon month size, so do these in seconds */ curTime = ktime_InterpretDate(&absDate); - - curTime = curTime + relDatePtr->sec + relDatePtr->min*60 + - relDatePtr->hour*60*60 + relDatePtr->day*24*60*60; - return(curTime); -} + curTime = + curTime + relDatePtr->sec + relDatePtr->min * 60 + + relDatePtr->hour * 60 * 60 + relDatePtr->day * 24 * 60 * 60; + + return (curTime); +} #endif /* notdef */ -#define RD_DIGIT_LIMIT 4 /* max. no. digits permitted */ +#define RD_DIGIT_LIMIT 4 /* max. no. digits permitted */ /* ParseRelDate @@ -267,79 +259,74 @@ ParseRelDate(dateStr, relDatePtr) memset(relDatePtr, 0, sizeof(*relDatePtr)); type_index = 0; - while ( 1 ) - { /*w*/ + while (1) { /*w */ - while ( isspace(*dateStr) ) /* skip leading whitespace */ - dateStr++; + while (isspace(*dateStr)) /* skip leading whitespace */ + dateStr++; - if ( isdigit(*dateStr) == 0 ) - goto error; + if (isdigit(*dateStr) == 0) + goto error; digit_limit = RD_DIGIT_LIMIT; value = 0; - while ( isdigit(*dateStr) ) - { - value = value*10 + *dateStr - '0'; + while (isdigit(*dateStr)) { + value = value * 10 + *dateStr - '0'; dateStr++; - if ( digit_limit-- == 0 ) - goto error; + if (digit_limit-- == 0) + goto error; } psPtr = &parseseq[type_index]; /* determine the units. Search for a matching type character */ - while ( (psPtr->ps_keychar != *dateStr) - && (psPtr->ps_keychar != 0) - ) - { + while ((psPtr->ps_keychar != *dateStr) + && (psPtr->ps_keychar != 0) + ) { type_index++; psPtr = &parseseq[type_index]; } /* no matching type found */ - if ( psPtr->ps_keychar == 0 ) - goto error; + if (psPtr->ps_keychar == 0) + goto error; /* check the bounds on the maximum value. Can't be negative * and if a maximum value is specified, check against it */ - if ( (value < 0) - || ((psPtr->ps_maxValue > 0) && (value > psPtr->ps_maxValue)) - ) - goto error; + if ((value < 0) + || ((psPtr->ps_maxValue > 0) && (value > psPtr->ps_maxValue)) + ) + goto error; /* save computed value in the relevant type field */ - switch ( psPtr->ps_field ) - { - case KTIMEDATE_YEAR: + switch (psPtr->ps_field) { + case KTIMEDATE_YEAR: relDatePtr->year = value; relDatePtr->mask |= KTIMEDATE_YEAR; break; - case KTIMEDATE_MONTH: + case KTIMEDATE_MONTH: relDatePtr->month = value; relDatePtr->mask |= KTIMEDATE_MONTH; break; - case KTIMEDATE_DAY: + case KTIMEDATE_DAY: relDatePtr->mask |= KTIMEDATE_DAY; relDatePtr->day = value; break; - default: + default: goto error; } - dateStr++; /* next digit */ + dateStr++; /* next digit */ - if ( *dateStr == 0 ) - { + if (*dateStr == 0) { /* no more chars to process, return the result */ - return(0); + return (0); } - } /*w*/ + } /*w */ -error: - return(1); + error: + return (1); } /* RelDatetoString @@ -361,26 +348,23 @@ RelDatetoString(datePtr) dateString[0] = 0; sptr = &dateString[0]; - if ( datePtr->mask & KTIMEDATE_YEAR ) - { + if (datePtr->mask & KTIMEDATE_YEAR) { sprintf(tempstring, "%-dy", datePtr->year); strcat(sptr, tempstring); } - if ( datePtr->mask & KTIMEDATE_MONTH ) - { + if (datePtr->mask & KTIMEDATE_MONTH) { strcat(sptr, " "); sprintf(tempstring, "%-dm", datePtr->month); strcat(sptr, tempstring); } - if ( datePtr->mask & KTIMEDATE_DAY ) - { + if (datePtr->mask & KTIMEDATE_DAY) { strcat(sptr, " "); sprintf(tempstring, "%-dd", datePtr->day); strcat(sptr, tempstring); } - return(sptr); + return (sptr); } #define FAIL(n) \ @@ -404,92 +388,83 @@ bc_ParseExpiration(paramPtr, expType, expDate) afs_int32 *expType; afs_int32 *expDate; { - struct cmd_item *itemPtr, *tempPtr; - struct ktime_date kt; - char *dateString; - afs_int32 length = 0; - afs_int32 code = 0; - - if ( paramPtr->items == 0 ) - { - /* no expiration specified */ - *expType = BC_NO_EXPDATE; - *expDate = 0; - return(0); - } - - /* some form of expiration date specified. First validate the prefix */ - itemPtr = paramPtr->items; - - if ( strcmp(itemPtr->data, "at") == 0 ) - { - *expType = BC_ABS_EXPDATE; - } - else - if ( strcmp(itemPtr->data, "in") == 0 ) - { - *expType = BC_REL_EXPDATE; - } - else - FAIL(1); - - /* before parsing the date string - concatenate all the pieces */ - itemPtr = itemPtr->next; - tempPtr = itemPtr; - - /* compute the length of string required */ - while ( tempPtr != 0 ) - { - length += strlen(tempPtr->data); - tempPtr = tempPtr->next; - length++; /* space or null terminator */ - } - if ( length == 0 ) /* no actual date string */ - FAIL(1); - - dateString = (char *) malloc(length); - if ( dateString == 0 ) - FAIL(2); - - /* now assemble the date string */ - dateString[0] = 0; - while ( itemPtr != 0 ) - { - strcat(dateString, itemPtr->data); - itemPtr = itemPtr->next; - if ( itemPtr != 0 ) - strcat(dateString, " "); - } - - switch ( *expType ) - { - case BC_ABS_EXPDATE: - code = ktime_DateToLong(dateString, expDate); - if ( code ) - FAIL(1); - break; - - case BC_REL_EXPDATE: - code = ParseRelDate(dateString, &kt); - if ( code ) - FAIL(1); - *expDate = ktimeRelDate_ToLong(&kt); - break; - - default: - FAIL(1); - } - - /* code will be 0 */ -exit: - /* normal exit */ - if ( dateString ) + struct cmd_item *itemPtr, *tempPtr; + struct ktime_date kt; + char *dateString; + afs_int32 length = 0; + afs_int32 code = 0; + + if (paramPtr->items == 0) { + /* no expiration specified */ + *expType = BC_NO_EXPDATE; + *expDate = 0; + return (0); + } + + /* some form of expiration date specified. First validate the prefix */ + itemPtr = paramPtr->items; + + if (strcmp(itemPtr->data, "at") == 0) { + *expType = BC_ABS_EXPDATE; + } else if (strcmp(itemPtr->data, "in") == 0) { + *expType = BC_REL_EXPDATE; + } else + FAIL(1); + + /* before parsing the date string - concatenate all the pieces */ + itemPtr = itemPtr->next; + tempPtr = itemPtr; + + /* compute the length of string required */ + while (tempPtr != 0) { + length += strlen(tempPtr->data); + tempPtr = tempPtr->next; + length++; /* space or null terminator */ + } + if (length == 0) /* no actual date string */ + FAIL(1); + + dateString = (char *)malloc(length); + if (dateString == 0) + FAIL(2); + + /* now assemble the date string */ + dateString[0] = 0; + while (itemPtr != 0) { + strcat(dateString, itemPtr->data); + itemPtr = itemPtr->next; + if (itemPtr != 0) + strcat(dateString, " "); + } + + switch (*expType) { + case BC_ABS_EXPDATE: + code = ktime_DateToLong(dateString, expDate); + if (code) + FAIL(1); + break; + + case BC_REL_EXPDATE: + code = ParseRelDate(dateString, &kt); + if (code) + FAIL(1); + *expDate = ktimeRelDate_ToLong(&kt); + break; + + default: + FAIL(1); + } + + /* code will be 0 */ + exit: + /* normal exit */ + if (dateString) free(dateString); - return(code); - -error: - /* assign default values */ - *expType = BC_NO_EXPDATE; - *expDate = 0; - goto exit; + return (code); + + error: + /* assign default values */ + *expType = BC_NO_EXPDATE; + *expDate = 0; + goto exit; } diff --git a/src/bucoord/main.c b/src/bucoord/main.c index 6bf23f0b5..a361c330f 100644 --- a/src/bucoord/main.c +++ b/src/bucoord/main.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/main.c,v 1.1.1.8 2001/10/14 18:04:11 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/main.c,v 1.16 2003/12/08 01:45:28 jaltman Exp $"); #include #include @@ -39,18 +40,17 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/main.c,v 1.1.1.8 2001/10/14 18: #include #include #include -#include /*VLDB_MAXSERVERS*/ +#include /*VLDB_MAXSERVERS */ #include #include #include -#include "bc.h" /*Backup Coordinator structs and defs*/ +#include "bc.h" /*Backup Coordinator structs and defs */ -int localauth, interact; +int localauth, interact; char tcell[64]; -extern int BC_ExecuteRequest(); extern int bc_AddDumpCmd(); extern int bc_AddHostCmd(); extern int bc_AddVolEntryCmd(); @@ -82,31 +82,31 @@ extern int bc_dumpInfoCmd(); extern int bc_restoreDbCmd(); extern int bc_saveDbCmd(); -extern PrintError(); - /* * Global configuration information for the Backup Coordinator. */ -struct bc_config *bc_globalConfig; /*Ptr to global BC configuration info*/ - -extern struct rx_securityClass *rxnull_NewServerSecurityObject(); +struct bc_config *bc_globalConfig; /*Ptr to global BC configuration info */ -struct ubik_client *cstruct; /* Ptr to Ubik client structure*/ -struct ktc_token ttoken; /* The token */ +struct ubik_client *cstruct; /* Ptr to Ubik client structure */ +struct ktc_token ttoken; /* The token */ -static const char *DefaultConfDir; /*Default backup config directory*/ -static int bcInit = 0; /* backupInit called yet ? */ +static const char *DefaultConfDir; /*Default backup config directory */ +static int bcInit = 0; /* backupInit called yet ? */ char *whoami = "backup"; /* dummy routine for the audit work. It should do nothing since audits */ /* occur at the server level and bos is not a server. */ -osi_audit() {return 0;} +osi_audit() +{ + return 0; +} /* * Initialize all the error tables that may be used by com_err * in this module. */ -void InitErrTabs() +void +InitErrTabs() { initialize_ACFG_error_table(); initialize_KA_error_table(); @@ -126,53 +126,69 @@ void InitErrTabs() * got to account for the errors which are volume related but * not dealt with by standard errno and com_err stuff. */ -void bc_HandleMisc(code) -afs_int32 code; +void +bc_HandleMisc(code) + afs_int32 code; { - if(((code <= VMOVED) && (code >= VSALVAGE)) || (code < 0)){ - switch(code){ - case -1 : fprintf(STDERR,"Possible communication failure\n"); - break; - case VSALVAGE: fprintf(STDERR,"Volume needs salvage\n"); - break; - case VNOVNODE: fprintf(STDERR,"Bad vnode number quoted\n"); - break; - case VNOVOL: fprintf(STDERR,"Volume not attached, does not exist, or not on line\n"); - break; - case VVOLEXISTS:fprintf(STDERR,"Volume already exists\n"); - break; - case VNOSERVICE:fprintf(STDERR,"Volume is not in service\n"); - break; - case VOFFLINE: fprintf(STDERR,"Volume is off line\n"); - break; - case VONLINE: fprintf(STDERR,"Volume is already on line\n"); - break; - case VDISKFULL: fprintf(STDERR,"Partition is full\n"); - break; - case VOVERQUOTA:fprintf(STDERR,"Volume max quota exceeded\n"); - break; - case VBUSY: fprintf(STDERR,"Volume temporarily unavailable\n"); - break; - case VMOVED:fprintf(STDERR,"Volume has moved to another server\n"); - break; - default: - break; - } + if (((code <= VMOVED) && (code >= VSALVAGE)) || (code < 0)) { + switch (code) { + case -1: + fprintf(STDERR, "Possible communication failure\n"); + break; + case VSALVAGE: + fprintf(STDERR, "Volume needs salvage\n"); + break; + case VNOVNODE: + fprintf(STDERR, "Bad vnode number quoted\n"); + break; + case VNOVOL: + fprintf(STDERR, + "Volume not attached, does not exist, or not on line\n"); + break; + case VVOLEXISTS: + fprintf(STDERR, "Volume already exists\n"); + break; + case VNOSERVICE: + fprintf(STDERR, "Volume is not in service\n"); + break; + case VOFFLINE: + fprintf(STDERR, "Volume is off line\n"); + break; + case VONLINE: + fprintf(STDERR, "Volume is already on line\n"); + break; + case VDISKFULL: + fprintf(STDERR, "Partition is full\n"); + break; + case VOVERQUOTA: + fprintf(STDERR, "Volume max quota exceeded\n"); + break; + case VBUSY: + fprintf(STDERR, "Volume temporarily unavailable\n"); + break; + case VMOVED: + fprintf(STDERR, "Volume has moved to another server\n"); + break; + default: + break; + } } return; } /* Return true if line is all whitespace */ -static LineIsBlank(aline) - register char *aline; -{ +static +LineIsBlank(aline) + register char *aline; +{ register int tc; while (tc = *aline++) - if ( (tc != ' ') && (tc != '\t') && (tc != '\n') ) return(0); + if ((tc != ' ') && (tc != '\t') && (tc != '\n')) + return (0); - return(1); -} + return (1); +} /* bc_InitTextConfig @@ -188,20 +204,19 @@ bc_InitTextConfig() extern struct bc_config *bc_globalConfig; - mkdir(DefaultConfDir, 777); /* temporary */ + mkdir(DefaultConfDir, 777); /* temporary */ /* initialize the client text structures */ ctPtr = &bc_globalConfig->configText[0]; - for ( i = 0; i < TB_NUM; i++ ) - { + for (i = 0; i < TB_NUM; i++) { memset(ctPtr, 0, sizeof(*ctPtr)); ctPtr->textType = i; ctPtr->textVersion = -1; ctPtr++; } - - return(0); + + return (0); } /*---------------------------------------------------------------------------- @@ -222,12 +237,13 @@ bc_InitTextConfig() *---------------------------------------------------------------------------- */ -static int backupInit() +static int +backupInit() { register afs_int32 code; - static int initd = 0; /* ever called? */ + static int initd = 0; /* ever called? */ PROCESS watcherPid; - PROCESS pid; /* LWP process ID*/ + PROCESS pid; /* LWP process ID */ extern statusWatcher(); @@ -235,59 +251,58 @@ static int backupInit() initialize_CMD_error_table(); /* don't run more than once */ - if (initd) - { - com_err(whoami,0,"Backup already initialized."); + if (initd) { + com_err(whoami, 0, "Backup already initialized."); return 0; } initd = 1; code = bc_InitConfig(DefaultConfDir); - if (code) - { - com_err(whoami, code, "Can't initialize from config files in directory '%s'", + if (code) { + com_err(whoami, code, + "Can't initialize from config files in directory '%s'", DefaultConfDir); - return(code); + return (code); } /* * Set up Rx. */ code = LWP_InitializeProcessSupport(LWP_NORMAL_PRIORITY, &pid); - if (code) - { - com_err(whoami, code,"; Can't initialize LWP"); - return(code); + if (code) { + com_err(whoami, code, "; Can't initialize LWP"); + return (code); } - code = rx_Init(htons(0)); - if (code) - { + code = rx_Init(htons(0)); + if (code) { com_err(whoami, code, "; Can't initialize Rx"); - return(code); + return (code); } rx_SetRxDeadTime(60); /* VLDB initialization */ - vldbClientInit(0, localauth, tcell, &cstruct, &ttoken); - if (code) return(code); + code = vldbClientInit(0, localauth, tcell, &cstruct, &ttoken); + if (code) + return (code); /* Backup database initialization */ code = udbClientInit(0, localauth, tcell); - if (code) return(code); + if (code) + return (code); /* setup status monitoring thread */ initStatus(); - code = LWP_CreateProcess(statusWatcher, 20480, LWP_NORMAL_PRIORITY, 2, - "statusWatcher", &watcherPid); - if ( code ) - { + code = + LWP_CreateProcess(statusWatcher, 20480, LWP_NORMAL_PRIORITY, + (void *)2, "statusWatcher", &watcherPid); + if (code) { com_err(whoami, code, "; Can't create status monitor task"); - return(code); + return (code); } - return(0); + return (0); } /*---------------------------------------------------------------------------- @@ -311,31 +326,31 @@ static int backupInit() *---------------------------------------------------------------------------- */ -static int MyBeforeProc(as) - register struct cmd_syndesc *as; +static int +MyBeforeProc(as) + register struct cmd_syndesc *as; { - char *rock; afs_int32 code; /* Handling the command line opcode */ - if (!bcInit) - { - localauth = ((as && as->parms[14].items) ? 1 : 0); - if (as && as->parms[15].items) strcpy(tcell, as->parms[15].items->data); - else tcell[0] = '\0'; - - code = backupInit(); - if (code) - { - com_err(whoami,code,"; Can't initialize backup"); + if (!bcInit) { + localauth = ((as && as->parms[14].items) ? 1 : 0); + if (as && as->parms[15].items) + strcpy(tcell, as->parms[15].items->data); + else + tcell[0] = '\0'; + + code = backupInit(); + if (code) { + com_err(whoami, code, "; Can't initialize backup"); exit(1); } - /* Get initial information from the database */ - code = bc_InitTextConfig(); - if (code) - { - com_err(whoami, code, "; Can't obtain configuration text from backup database"); + /* Get initial information from the database */ + code = bc_InitTextConfig(); + if (code) { + com_err(whoami, code, + "; Can't obtain configuration text from backup database"); exit(1); } } @@ -350,9 +365,9 @@ static int MyBeforeProc(as) #include "AFS_component_version_number.c" #define MAXRECURSION 20 -extern int dontExecute; /* declared in commands.c */ -extern char *loadFile; /* declared in commands.c */ -char lineBuffer[1024]; /* Line typed in by user or read from load file */ +extern int dontExecute; /* declared in commands.c */ +extern char *loadFile; /* declared in commands.c */ +char lineBuffer[1024]; /* Line typed in by user or read from load file */ /* * This will dispatch a command. It holds a recursive loop for the @@ -366,117 +381,115 @@ char lineBuffer[1024]; /* Line typed in by user or read from load * put a lock around it so only 1 process gets in at a time. */ -struct Lock dispatchLock; /* lock on the Dispatch call */ +struct Lock dispatchLock; /* lock on the Dispatch call */ #define lock_Dispatch() ObtainWriteLock(&dispatchLock) #define unlock_Dispatch() ReleaseWriteLock(&dispatchLock) -afs_int32 doDispatch(targc, targv, dispatchCount) - char **targv[MAXV]; - afs_int32 targc; - afs_int32 dispatchCount; /* to prevent infinite recursion */ +afs_int32 +doDispatch(targc, targv, dispatchCount) + char *targv[MAXV]; + afs_int32 targc; + afs_int32 dispatchCount; /* to prevent infinite recursion */ { - char **sargv[MAXV]; - afs_int32 sargc; - afs_int32 code, c; - FILE *fd; - int i; - int lineNumber; - int noExecute; /* local capy of global variable */ - char *internalLoadFile; - - lock_Dispatch(); - - loadFile = (char *) 0; - code = cmd_Dispatch(targc, targv); - internalLoadFile = loadFile; - - unlock_Dispatch(); - - if (internalLoadFile) /* Load a file in */ - { - if (dispatchCount > MAXRECURSION) /* Beware recursive loops. */ - { - com_err(whoami,0,"Potential recursion: will not load file %s", internalLoadFile); - code = -1; - goto done; - } - - fd = fopen(internalLoadFile, "r"); /* Open the load file */ - if (!fd) - { - com_err(whoami,errno,"; Cannot open file %s", internalLoadFile); - code = -1; - goto done; - } - - noExecute = dontExecute; - if (noExecute) - printf("Would have executed the following commands:\n"); - - lineNumber = 0; - while ( fgets(lineBuffer, sizeof(lineBuffer)-1, fd) ) /* Get commands from file */ - { - lineNumber++; - - i = strlen(lineBuffer) - 1; - if (lineBuffer[i] == '\n') /* Drop return at end of line */ - lineBuffer[i] = '\0'; - - if (noExecute) - printf(" %s\n", lineBuffer); /* echo */ - else - printf("------> %s\n", lineBuffer); /* echo */ - - if ( !LineIsBlank(lineBuffer) && /* Skip if blank line */ - (lineBuffer[0] != '#') && /* or comment */ - (!noExecute) ) /* or no execute */ - { - c = cmd_ParseLine(lineBuffer, sargv, &sargc, MAXV); - if (c) - { - com_err(whoami, c, "; Can't parse line"); - } - else - { - doDispatch(sargc, sargv, dispatchCount+1); /* Recursive - ignore error */ - cmd_FreeArgv(sargv); /* Free up arguments */ - } - } - } - - fclose(fd); - } - -done: - if (internalLoadFile) free(internalLoadFile); - return(code); + char *sargv[MAXV]; + afs_int32 sargc; + afs_int32 code, c; + FILE *fd; + int i; + int lineNumber; + int noExecute; /* local capy of global variable */ + char *internalLoadFile; + + lock_Dispatch(); + + loadFile = NULL; + code = cmd_Dispatch(targc, targv); + internalLoadFile = loadFile; + + unlock_Dispatch(); + + if (internalLoadFile) { /* Load a file in */ + if (dispatchCount > MAXRECURSION) { /* Beware recursive loops. */ + com_err(whoami, 0, "Potential recursion: will not load file %s", + internalLoadFile); + code = -1; + goto done; + } + + fd = fopen(internalLoadFile, "r"); /* Open the load file */ + if (!fd) { + com_err(whoami, errno, "; Cannot open file %s", internalLoadFile); + code = -1; + goto done; + } + + noExecute = dontExecute; + if (noExecute) + printf("Would have executed the following commands:\n"); + + lineNumber = 0; + while (fgets(lineBuffer, sizeof(lineBuffer) - 1, fd)) { /* Get commands from file */ + lineNumber++; + + i = strlen(lineBuffer) - 1; + if (lineBuffer[i] == '\n') /* Drop return at end of line */ + lineBuffer[i] = '\0'; + + if (noExecute) + printf(" %s\n", lineBuffer); /* echo */ + else + printf("------> %s\n", lineBuffer); /* echo */ + + if (!LineIsBlank(lineBuffer) && /* Skip if blank line */ + (lineBuffer[0] != '#') && /* or comment */ + (!noExecute)) { /* or no execute */ + c = cmd_ParseLine(lineBuffer, sargv, &sargc, MAXV); + if (c) { + com_err(whoami, c, "; Can't parse line"); + } else { + doDispatch(sargc, sargv, dispatchCount + 1); /* Recursive - ignore error */ + cmd_FreeArgv(sargv); /* Free up arguments */ + } + } + } + + fclose(fd); + } + + done: + if (internalLoadFile) + free(internalLoadFile); + return (code); } -int bc_interactCmd(as, arock) - struct cmd_syndesc *as; - char *arock; +int +bc_interactCmd(as, arock) + struct cmd_syndesc *as; + char *arock; { interact = 1; + return 0; } -static void add_std_args(ts) - register struct cmd_syndesc *ts; +static void +add_std_args(ts) + register struct cmd_syndesc *ts; { cmd_Seek(ts, 14); - cmd_AddParm(ts, "-localauth", CMD_FLAG, CMD_OPTIONAL, "local authentication"); + cmd_AddParm(ts, "-localauth", CMD_FLAG, CMD_OPTIONAL, + "local authentication"); cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name"); } main(argc, argv) - int argc; - char **argv; -{ /*main*/ - char **targv[MAXV]; /*Ptr to parsed argv stuff*/ - afs_int32 targc; /*Num parsed arguments*/ - afs_int32 code; /*Return code*/ - char *tp; /*Result of gets()*/ - register struct cmd_syndesc *ts; /*Ptr to parsed command line*/ + int argc; + char **argv; +{ /*main */ + char *targv[MAXV]; /*Ptr to parsed argv stuff */ + afs_int32 targc; /*Num parsed arguments */ + afs_int32 code; /*Return code */ + register struct cmd_syndesc *ts; /*Ptr to parsed command line */ int i; @@ -488,228 +501,308 @@ main(argc, argv) * generated which, in many cases, isn't too useful. */ struct sigaction nsa; - + sigemptyset(&nsa.sa_mask); nsa.sa_handler = SIG_DFL; nsa.sa_flags = SA_FULLDUMP; sigaction(SIGSEGV, &nsa, NULL); #endif Lock_Init(&dispatchLock); - InitErrTabs(); /* init all the error tables which may be used */ + InitErrTabs(); /* init all the error tables which may be used */ /* setup the default backup dir */ DefaultConfDir = AFSDIR_SERVER_BACKUP_DIRPATH; /* Get early warning if the command is interacive mode or not */ - interact = ( ((argc < 2) || (argv[1][0] == '-')) ? 1 : 0 ); + interact = (((argc < 2) || (argv[1][0] == '-')) ? 1 : 0); - cmd_SetBeforeProc(MyBeforeProc, (char *)0); + cmd_SetBeforeProc(MyBeforeProc, NULL); ts = cmd_CreateSyntax("dump", bc_DumpCmd, 0, "start dump"); - cmd_AddParm(ts, "-volumeset", CMD_SINGLE, CMD_OPTIONAL, "volume set name"); + cmd_AddParm(ts, "-volumeset", CMD_SINGLE, CMD_OPTIONAL, + "volume set name"); cmd_AddParm(ts, "-dump", CMD_SINGLE, CMD_OPTIONAL, "dump level name"); - cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, "TC port offset"); + cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, + "TC port offset"); cmd_AddParm(ts, "-at", CMD_LIST, CMD_OPTIONAL, "Date/time to start dump"); - cmd_AddParm(ts, "-append", CMD_FLAG, CMD_OPTIONAL, "append to existing dump set"); + cmd_AddParm(ts, "-append", CMD_FLAG, CMD_OPTIONAL, + "append to existing dump set"); cmd_AddParm(ts, "-n", CMD_FLAG, CMD_OPTIONAL, "don't really execute it"); cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, "load file"); - if (!interact) add_std_args(ts); - - ts = cmd_CreateSyntax("volrestore", bc_VolRestoreCmd, 0, "restore volume"); - cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "destination machine"); - cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED, "destination partition"); - cmd_AddParm(ts, "-volume", CMD_LIST, CMD_REQUIRED, "volume(s) to restore"); - cmd_AddParm(ts, "-extension", CMD_SINGLE, CMD_OPTIONAL, "new volume name extension"); - cmd_AddParm(ts, "-date", CMD_LIST, CMD_OPTIONAL, "date from which to restore"); + if (!interact) + add_std_args(ts); + + ts = cmd_CreateSyntax("volrestore", bc_VolRestoreCmd, 0, + "restore volume"); + cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, + "destination machine"); + cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED, + "destination partition"); + cmd_AddParm(ts, "-volume", CMD_LIST, CMD_REQUIRED, + "volume(s) to restore"); + cmd_AddParm(ts, "-extension", CMD_SINGLE, CMD_OPTIONAL, + "new volume name extension"); + cmd_AddParm(ts, "-date", CMD_LIST, CMD_OPTIONAL, + "date from which to restore"); cmd_AddParm(ts, "-portoffset", CMD_LIST, CMD_OPTIONAL, "TC port offsets"); cmd_AddParm(ts, "-n", CMD_FLAG, CMD_OPTIONAL, "don't really execute it"); - if (!interact) add_std_args(ts); - - ts = cmd_CreateSyntax("diskrestore", bc_DiskRestoreCmd, 0, "restore partition"); - cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine to restore"); - cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED, "partition to restore"); - cmd_AddParm(ts, "-portoffset", CMD_LIST, CMD_OPTIONAL, "TC port offset"); + if (!interact) + add_std_args(ts); + + ts = cmd_CreateSyntax("diskrestore", bc_DiskRestoreCmd, 0, + "restore partition"); + cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, + "machine to restore"); + cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED, + "partition to restore"); + cmd_AddParm(ts, "-portoffset", CMD_LIST, CMD_OPTIONAL, "TC port offset"); cmd_Seek(ts, 8); - cmd_AddParm(ts, "-newserver", CMD_SINGLE, CMD_OPTIONAL, "destination machine"); - cmd_AddParm(ts, "-newpartition", CMD_SINGLE, CMD_OPTIONAL, "destination partition"); - cmd_AddParm(ts, "-extension", CMD_SINGLE, CMD_OPTIONAL, "new volume name extension"); + cmd_AddParm(ts, "-newserver", CMD_SINGLE, CMD_OPTIONAL, + "destination machine"); + cmd_AddParm(ts, "-newpartition", CMD_SINGLE, CMD_OPTIONAL, + "destination partition"); + cmd_AddParm(ts, "-extension", CMD_SINGLE, CMD_OPTIONAL, + "new volume name extension"); cmd_AddParm(ts, "-n", CMD_FLAG, CMD_OPTIONAL, "don't really execute it"); - if (!interact) add_std_args(ts); + if (!interact) + add_std_args(ts); ts = cmd_CreateSyntax("quit", bc_QuitCmd, 0, "leave the program"); - ts = cmd_CreateSyntax("volsetrestore", bc_VolsetRestoreCmd, 0, "restore a set of volumes"); + ts = cmd_CreateSyntax("volsetrestore", bc_VolsetRestoreCmd, 0, + "restore a set of volumes"); cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL, "volume set name"); cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, "file name"); cmd_AddParm(ts, "-portoffset", CMD_LIST, CMD_OPTIONAL, "TC port offset"); - cmd_AddParm(ts, "-extension", CMD_SINGLE, CMD_OPTIONAL, "new volume name extension"); + cmd_AddParm(ts, "-extension", CMD_SINGLE, CMD_OPTIONAL, + "new volume name extension"); cmd_AddParm(ts, "-n", CMD_FLAG, CMD_OPTIONAL, "don't really execute it"); - if (!interact) add_std_args(ts); + if (!interact) + add_std_args(ts); ts = cmd_CreateSyntax("addhost", bc_AddHostCmd, 0, "add host to config"); - cmd_AddParm(ts, "-tapehost", CMD_SINGLE, CMD_REQUIRED, "tape machine name"); - cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, "TC port offset"); - if (!interact) add_std_args(ts); - - ts = cmd_CreateSyntax("delhost", bc_DeleteHostCmd, 0, "delete host to config"); - cmd_AddParm(ts, "-tapehost", CMD_SINGLE, CMD_REQUIRED, "tape machine name"); - cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, "TC port offset"); - if (!interact) add_std_args(ts); - - ts = cmd_CreateSyntax("listhosts", bc_ListHostsCmd, 0, "list config hosts"); - if (!interact) add_std_args(ts); + cmd_AddParm(ts, "-tapehost", CMD_SINGLE, CMD_REQUIRED, + "tape machine name"); + cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, + "TC port offset"); + if (!interact) + add_std_args(ts); + + ts = cmd_CreateSyntax("delhost", bc_DeleteHostCmd, 0, + "delete host to config"); + cmd_AddParm(ts, "-tapehost", CMD_SINGLE, CMD_REQUIRED, + "tape machine name"); + cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, + "TC port offset"); + if (!interact) + add_std_args(ts); + + ts = cmd_CreateSyntax("listhosts", bc_ListHostsCmd, 0, + "list config hosts"); + if (!interact) + add_std_args(ts); ts = cmd_CreateSyntax("jobs", bc_JobsCmd, 0, "list running jobs"); ts = cmd_CreateSyntax("kill", bc_KillCmd, 0, "kill running job"); - cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_REQUIRED, "job ID or dump set name"); + cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_REQUIRED, + "job ID or dump set name"); - ts = cmd_CreateSyntax("listvolsets", bc_ListVolSetCmd, 0, "list volume sets"); + ts = cmd_CreateSyntax("listvolsets", bc_ListVolSetCmd, 0, + "list volume sets"); cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL, "volume set name"); - if (!interact) add_std_args(ts); + if (!interact) + add_std_args(ts); - ts = cmd_CreateSyntax("listdumps", bc_ListDumpScheduleCmd, 0, "list dump schedules"); - if (!interact) add_std_args(ts); + ts = cmd_CreateSyntax("listdumps", bc_ListDumpScheduleCmd, 0, + "list dump schedules"); + if (!interact) + add_std_args(ts); - ts = cmd_CreateSyntax("addvolset", bc_AddVolSetCmd, 0, "create a new volume set"); + ts = cmd_CreateSyntax("addvolset", bc_AddVolSetCmd, 0, + "create a new volume set"); cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_REQUIRED, "volume set name"); - cmd_AddParm(ts, "-temporary", CMD_FLAG, CMD_OPTIONAL, "temporary volume set"); - if (!interact) add_std_args(ts); + cmd_AddParm(ts, "-temporary", CMD_FLAG, CMD_OPTIONAL, + "temporary volume set"); + if (!interact) + add_std_args(ts); - ts = cmd_CreateSyntax("status", bc_GetTapeStatusCmd, 0, + ts = cmd_CreateSyntax("status", bc_GetTapeStatusCmd, 0, "get tape coordinator status"); - cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, "TC port offset"); - if (!interact) add_std_args(ts); + cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, + "TC port offset"); + if (!interact) + add_std_args(ts); - ts = cmd_CreateSyntax("delvolset", bc_DeleteVolSetCmd, 0, "delete a volume set"); + ts = cmd_CreateSyntax("delvolset", bc_DeleteVolSetCmd, 0, + "delete a volume set"); cmd_AddParm(ts, "-name", CMD_LIST, CMD_REQUIRED, "volume set name"); - if (!interact) add_std_args(ts); + if (!interact) + add_std_args(ts); - ts = cmd_CreateSyntax("addvolentry", bc_AddVolEntryCmd, 0, "add a new volume entry"); + ts = cmd_CreateSyntax("addvolentry", bc_AddVolEntryCmd, 0, + "add a new volume entry"); cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_REQUIRED, "volume set name"); cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name"); cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_REQUIRED, "partition name"); - cmd_AddParm(ts, "-volumes", CMD_SINGLE, CMD_REQUIRED, "volume name (regular expression)"); - if (!interact) add_std_args(ts); + cmd_AddParm(ts, "-volumes", CMD_SINGLE, CMD_REQUIRED, + "volume name (regular expression)"); + if (!interact) + add_std_args(ts); - ts = cmd_CreateSyntax("delvolentry", bc_DeleteVolEntryCmd, 0, "delete a volume set sub-entry"); + ts = cmd_CreateSyntax("delvolentry", bc_DeleteVolEntryCmd, 0, + "delete a volume set sub-entry"); cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_REQUIRED, "volume set name"); cmd_AddParm(ts, "-entry", CMD_SINGLE, CMD_REQUIRED, "volume set index"); - if (!interact) add_std_args(ts); + if (!interact) + add_std_args(ts); ts = cmd_CreateSyntax("adddump", bc_AddDumpCmd, 0, "add dump schedule"); cmd_AddParm(ts, "-dump", CMD_LIST, CMD_REQUIRED, "dump level name"); cmd_AddParm(ts, "-expires", CMD_LIST, CMD_OPTIONAL, "expiration date"); - if (!interact) add_std_args(ts); + if (!interact) + add_std_args(ts); - ts = cmd_CreateSyntax("deldump", bc_DeleteDumpCmd, 0, "delete dump schedule"); + ts = cmd_CreateSyntax("deldump", bc_DeleteDumpCmd, 0, + "delete dump schedule"); cmd_AddParm(ts, "-dump", CMD_SINGLE, CMD_REQUIRED, "dump level name"); - if (!interact) add_std_args(ts); + if (!interact) + add_std_args(ts); ts = cmd_CreateSyntax("labeltape", bc_LabelTapeCmd, 0, "label a tape"); - cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL, "AFS tape name, defaults to NULL"); - cmd_AddParm(ts, "-size", CMD_SINGLE, CMD_OPTIONAL, + cmd_AddParm(ts, "-name", CMD_SINGLE, CMD_OPTIONAL, + "AFS tape name, defaults to NULL"); + cmd_AddParm(ts, "-size", CMD_SINGLE, CMD_OPTIONAL, "tape size in Kbytes, defaults to size in tapeconfig"); - cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, "TC port offset"); - cmd_AddParm(ts, "-pname", CMD_SINGLE, CMD_OPTIONAL, "permanent tape name"); - if (!interact) add_std_args(ts); - - ts = cmd_CreateSyntax("readlabel", bc_ReadLabelCmd, 0, "read the label on tape"); - cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, "TC port offset"); - if (!interact) add_std_args(ts); - - ts = cmd_CreateSyntax("scantape", bc_ScanDumpsCmd, 0, "dump information recovery from tape"); - cmd_AddParm(ts, "-dbadd", CMD_FLAG, CMD_OPTIONAL, "add information to the database"); - cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, "TC port offset"); - if (!interact) add_std_args(ts); - - ts = cmd_CreateSyntax("volinfo", bc_dblookupCmd, 0, "query the backup database"); + cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, + "TC port offset"); + cmd_AddParm(ts, "-pname", CMD_SINGLE, CMD_OPTIONAL, + "permanent tape name"); + if (!interact) + add_std_args(ts); + + ts = cmd_CreateSyntax("readlabel", bc_ReadLabelCmd, 0, + "read the label on tape"); + cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, + "TC port offset"); + if (!interact) + add_std_args(ts); + + ts = cmd_CreateSyntax("scantape", bc_ScanDumpsCmd, 0, + "dump information recovery from tape"); + cmd_AddParm(ts, "-dbadd", CMD_FLAG, CMD_OPTIONAL, + "add information to the database"); + cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, + "TC port offset"); + if (!interact) + add_std_args(ts); + + ts = cmd_CreateSyntax("volinfo", bc_dblookupCmd, 0, + "query the backup database"); cmd_AddParm(ts, "-volume", CMD_SINGLE, CMD_REQUIRED, "volume name"); - if (!interact) add_std_args(ts); + if (!interact) + add_std_args(ts); - ts = cmd_CreateSyntax("setexp", bc_SetExpCmd, 0, "set/clear dump expiration dates"); + ts = cmd_CreateSyntax("setexp", bc_SetExpCmd, 0, + "set/clear dump expiration dates"); cmd_AddParm(ts, "-dump", CMD_LIST, CMD_REQUIRED, "dump level name"); cmd_AddParm(ts, "-expires", CMD_LIST, CMD_OPTIONAL, "expiration date"); - if (!interact) add_std_args(ts); + if (!interact) + add_std_args(ts); ts = cmd_CreateSyntax("savedb", bc_saveDbCmd, 0, "save backup database"); - cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, "TC port offset"); - cmd_AddParm(ts, "-archive", CMD_LIST, CMD_OPTIONAL, "date time"); - if (!interact) add_std_args(ts); - - ts = cmd_CreateSyntax("restoredb", bc_restoreDbCmd, 0, "restore backup database"); - cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, "TC port offset"); - if (!interact) add_std_args(ts); - - ts = cmd_CreateSyntax("dumpinfo", bc_dumpInfoCmd, 0, + cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, + "TC port offset"); + cmd_AddParm(ts, "-archive", CMD_LIST, CMD_OPTIONAL, "date time"); + if (!interact) + add_std_args(ts); + + ts = cmd_CreateSyntax("restoredb", bc_restoreDbCmd, 0, + "restore backup database"); + cmd_AddParm(ts, "-portoffset", CMD_SINGLE, CMD_OPTIONAL, + "TC port offset"); + if (!interact) + add_std_args(ts); + + ts = cmd_CreateSyntax("dumpinfo", bc_dumpInfoCmd, 0, "provide information about a dump in the database"); cmd_AddParm(ts, "-ndumps", CMD_SINGLE, CMD_OPTIONAL, "no. of dumps"); cmd_AddParm(ts, "-id", CMD_SINGLE, CMD_OPTIONAL, "dump id"); - cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "detailed description"); - if (!interact) add_std_args(ts); + cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, + "detailed description"); + if (!interact) + add_std_args(ts); - ts = cmd_CreateSyntax("dbverify", bc_dbVerifyCmd, 0, "check ubik database integrity"); + ts = cmd_CreateSyntax("dbverify", bc_dbVerifyCmd, 0, + "check ubik database integrity"); cmd_AddParm(ts, "-detail", CMD_FLAG, CMD_OPTIONAL, "additional details"); - if (!interact) add_std_args(ts); - - ts = cmd_CreateSyntax("deletedump", bc_deleteDumpCmd, 0, "delete dumps from the database"); - cmd_AddParm(ts, "-dumpid", CMD_LIST, CMD_OPTIONAL, "dump id"); - cmd_AddParm(ts, "-from", CMD_LIST, CMD_OPTIONAL, "date time"); - cmd_AddParm(ts, "-to", CMD_LIST, CMD_OPTIONAL, "date time"); - cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "TC port offset"); + if (!interact) + add_std_args(ts); + + ts = cmd_CreateSyntax("deletedump", bc_deleteDumpCmd, 0, + "delete dumps from the database"); + cmd_AddParm(ts, "-dumpid", CMD_LIST, CMD_OPTIONAL, "dump id"); + cmd_AddParm(ts, "-from", CMD_LIST, CMD_OPTIONAL, "date time"); + cmd_AddParm(ts, "-to", CMD_LIST, CMD_OPTIONAL, "date time"); + cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "TC port offset"); cmd_AddParm(ts, "-groupid", CMD_SINGLE, CMD_OPTIONAL, "group ID"); cmd_AddParm(ts, "-dbonly", CMD_FLAG, CMD_OPTIONAL, - "delete the dump from the backup database only"); - cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, - "always delete from backup database"); - cmd_AddParm(ts, "-noexecute", CMD_FLAG, CMD_OPTIONAL, "Just list the dumps"); - - if (!interact) add_std_args(ts); - - ts = cmd_CreateSyntax("interactive", bc_interactCmd, 0, "enter interactive mode"); + "delete the dump from the backup database only"); + cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL, + "always delete from backup database"); + cmd_AddParm(ts, "-noexecute", CMD_FLAG, CMD_OPTIONAL, + "Just list the dumps"); + + if (!interact) + add_std_args(ts); + + ts = cmd_CreateSyntax("interactive", bc_interactCmd, 0, + "enter interactive mode"); add_std_args(ts); /* * Now execute the command. */ - targc = 0; targv[targc++] = argv[0]; - if (interact) targv[targc++] = "interactive"; - for (i=1; i "); fflush(stdout); - + while ((ret = LWP_GetLine(lineBuffer, sizeof(lineBuffer))) == 0) - printf("%s: Command line too long\n", whoami); /* line too long */ + printf("%s: Command line too long\n", whoami); /* line too long */ - if (ret == -1) return 0; /* Got EOF */ + if (ret == -1) + return 0; /* Got EOF */ - if ( !LineIsBlank(lineBuffer) ) - { + if (!LineIsBlank(lineBuffer)) { code = cmd_ParseLine(lineBuffer, targv, &targc, MAXV); if (code) - com_err(whoami,code,"; Can't parse line: '%s'", + com_err(whoami, code, "; Can't parse line: '%s'", error_message(code)); - else - { + else { doDispatch(targc, targv, 1); cmd_FreeArgv(targv); } } } -} /*main*/ +} /*main */ diff --git a/src/bucoord/regex.c b/src/bucoord/regex.c index c68401551..bb2176d8f 100644 --- a/src/bucoord/regex.c +++ b/src/bucoord/regex.c @@ -90,131 +90,130 @@ #define ESIZE 512 #define NBRA 9 -static char expbuf[ESIZE], *braslist[NBRA], *braelist[NBRA]; -static char circf; +static char expbuf[ESIZE], *braslist[NBRA], *braelist[NBRA]; +static char circf; /* * compile the regular expression argument into a dfa */ char * re_comp(sp) - register char *sp; + register char *sp; { - register int c; - register char *ep = expbuf; - int cclcnt, numbra = 0; - char *lastep = 0; - char bracket[NBRA]; - char *bracketp = &bracket[0]; - static char *retoolong = "Regular expression too long"; + register int c; + register char *ep = expbuf; + int cclcnt, numbra = 0; + char *lastep = 0; + char bracket[NBRA]; + char *bracketp = &bracket[0]; + static char *retoolong = "Regular expression too long"; #define comerr(msg) {expbuf[0] = 0; numbra = 0; return(msg); } - if (sp == 0 || *sp == '\0') { - if (*ep == 0) - return("No previous regular expression"); - return(0); + if (sp == 0 || *sp == '\0') { + if (*ep == 0) + return ("No previous regular expression"); + return (0); + } + if (*sp == '^') { + circf = 1; + sp++; + } else + circf = 0; + for (;;) { + if (ep >= &expbuf[ESIZE]) + comerr(retoolong); + if ((c = *sp++) == '\0') { + if (bracketp != bracket) + comerr("unmatched \\("); + *ep++ = CEOF; + *ep++ = 0; + return (0); } - if (*sp == '^') { - circf = 1; - sp++; - } - else - circf = 0; - for (;;) { - if (ep >= &expbuf[ESIZE]) - comerr(retoolong); - if ((c = *sp++) == '\0') { - if (bracketp != bracket) - comerr("unmatched \\("); - *ep++ = CEOF; - *ep++ = 0; - return(0); - } - if (c != '*') - lastep = ep; - switch (c) { - - case '.': - *ep++ = CDOT; - continue; - - case '*': - if (lastep == 0 || *lastep == CBRA || *lastep == CKET) - goto defchar; - *lastep |= CSTAR; - continue; - - case '$': - if (*sp != '\0') - goto defchar; - *ep++ = CDOL; - continue; - - case '[': - *ep++ = CCL; - *ep++ = 0; - cclcnt = 1; - if ((c = *sp++) == '^') { - c = *sp++; - ep[-2] = NCCL; - } - do { - if (c == '\0') - comerr("missing ]"); - if (c == '-' && ep [-1] != 0) { - if ((c = *sp++) == ']') { - *ep++ = '-'; - cclcnt++; - break; - } - while (ep[-1] < c) { - *ep = ep[-1] + 1; - ep++; - cclcnt++; - if (ep >= &expbuf[ESIZE]) - comerr(retoolong); - } - } - *ep++ = c; - cclcnt++; - if (ep >= &expbuf[ESIZE]) - comerr(retoolong); - } while ((c = *sp++) != ']'); - lastep[1] = cclcnt; - continue; - - case '\\': - if ((c = *sp++) == '(') { - if (numbra >= NBRA) - comerr("too many \\(\\) pairs"); - *bracketp++ = numbra; - *ep++ = CBRA; - *ep++ = numbra++; - continue; - } - if (c == ')') { - if (bracketp <= bracket) - comerr("unmatched \\)"); - *ep++ = CKET; - *ep++ = *--bracketp; - continue; - } - if (c >= '1' && c < ('1' + NBRA)) { - *ep++ = CBACK; - *ep++ = c - '1'; - continue; - } - *ep++ = CCHR; - *ep++ = c; - continue; - - defchar: - default: - *ep++ = CCHR; - *ep++ = c; + if (c != '*') + lastep = ep; + switch (c) { + + case '.': + *ep++ = CDOT; + continue; + + case '*': + if (lastep == 0 || *lastep == CBRA || *lastep == CKET) + goto defchar; + *lastep |= CSTAR; + continue; + + case '$': + if (*sp != '\0') + goto defchar; + *ep++ = CDOL; + continue; + + case '[': + *ep++ = CCL; + *ep++ = 0; + cclcnt = 1; + if ((c = *sp++) == '^') { + c = *sp++; + ep[-2] = NCCL; + } + do { + if (c == '\0') + comerr("missing ]"); + if (c == '-' && ep[-1] != 0) { + if ((c = *sp++) == ']') { + *ep++ = '-'; + cclcnt++; + break; + } + while (ep[-1] < c) { + *ep = ep[-1] + 1; + ep++; + cclcnt++; + if (ep >= &expbuf[ESIZE]) + comerr(retoolong); + } } + *ep++ = c; + cclcnt++; + if (ep >= &expbuf[ESIZE]) + comerr(retoolong); + } while ((c = *sp++) != ']'); + lastep[1] = cclcnt; + continue; + + case '\\': + if ((c = *sp++) == '(') { + if (numbra >= NBRA) + comerr("too many \\(\\) pairs"); + *bracketp++ = numbra; + *ep++ = CBRA; + *ep++ = numbra++; + continue; + } + if (c == ')') { + if (bracketp <= bracket) + comerr("unmatched \\)"); + *ep++ = CKET; + *ep++ = *--bracketp; + continue; + } + if (c >= '1' && c < ('1' + NBRA)) { + *ep++ = CBACK; + *ep++ = c - '1'; + continue; + } + *ep++ = CCHR; + *ep++ = c; + continue; + + defchar: + default: + *ep++ = CCHR; + *ep++ = c; } + } } /* @@ -222,178 +221,175 @@ re_comp(sp) */ int re_exec(p1) - register char *p1; + register char *p1; { - register char *p2 = expbuf; - register int c; - int rv; - - for (c = 0; c < NBRA; c++) { - braslist[c] = 0; - braelist[c] = 0; - } - if (circf) - return((advance(p1, p2))); - /* - * fast check for first character - */ - if (*p2 == CCHR) { - c = p2[1]; - do { - if (*p1 != c) - continue; - if (rv = advance(p1, p2)) - return(rv); - } while (*p1++); - return(0); - } - /* - * regular algorithm - */ - do - if (rv = advance(p1, p2)) - return(rv); - while (*p1++); - return(0); + register char *p2 = expbuf; + register int c; + int rv; + + for (c = 0; c < NBRA; c++) { + braslist[c] = 0; + braelist[c] = 0; + } + if (circf) + return ((advance(p1, p2))); + /* + * fast check for first character + */ + if (*p2 == CCHR) { + c = p2[1]; + do { + if (*p1 != c) + continue; + if (rv = advance(p1, p2)) + return (rv); + } while (*p1++); + return (0); + } + /* + * regular algorithm + */ + do + if (rv = advance(p1, p2)) + return (rv); + while (*p1++); + return (0); } /* * try to match the next thing in the dfa */ -static int +static int advance(lp, ep) - register char *lp, *ep; + register char *lp, *ep; { - register char *curlp; - int ct, i; - int rv; - - for (;;) - switch (*ep++) { - - case CCHR: - if (*ep++ == *lp++) - continue; - return(0); - - case CDOT: - if (*lp++) - continue; - return(0); - - case CDOL: - if (*lp == '\0') - continue; - return(0); - - case CEOF: - return(1); - - case CCL: - if (cclass(ep, *lp++, 1)) { - ep += *ep; - continue; - } - return(0); - - case NCCL: - if (cclass(ep, *lp++, 0)) { - ep += *ep; - continue; - } - return(0); - - case CBRA: - braslist[*ep++] = lp; - continue; - - case CKET: - braelist[*ep++] = lp; - continue; - - case CBACK: - if (braelist[i = *ep++] == 0) - return(-1); - if (backref(i, lp)) { - lp += braelist[i] - braslist[i]; - continue; - } - return(0); - - case CBACK|CSTAR: - if (braelist[i = *ep++] == 0) - return(-1); - curlp = lp; - ct = braelist[i] - braslist[i]; - while (backref(i, lp)) - lp += ct; - while (lp >= curlp) { - if (rv = advance(lp, ep)) - return(rv); - lp -= ct; - } - continue; - - case CDOT|CSTAR: - curlp = lp; - while (*lp++) - ; - goto star; - - case CCHR|CSTAR: - curlp = lp; - while (*lp++ == *ep) - ; - ep++; - goto star; - - case CCL|CSTAR: - case NCCL|CSTAR: - curlp = lp; - while (cclass(ep, *lp++, ep[-1] == (CCL|CSTAR))) - ; - ep += *ep; - goto star; - - star: - do { - lp--; - if (rv = advance(lp, ep)) - return(rv); - } while (lp > curlp); - return(0); - - default: - return(-1); - } + register char *curlp; + int ct, i; + int rv; + + for (;;) + switch (*ep++) { + + case CCHR: + if (*ep++ == *lp++) + continue; + return (0); + + case CDOT: + if (*lp++) + continue; + return (0); + + case CDOL: + if (*lp == '\0') + continue; + return (0); + + case CEOF: + return (1); + + case CCL: + if (cclass(ep, *lp++, 1)) { + ep += *ep; + continue; + } + return (0); + + case NCCL: + if (cclass(ep, *lp++, 0)) { + ep += *ep; + continue; + } + return (0); + + case CBRA: + braslist[*ep++] = lp; + continue; + + case CKET: + braelist[*ep++] = lp; + continue; + + case CBACK: + if (braelist[i = *ep++] == 0) + return (-1); + if (backref(i, lp)) { + lp += braelist[i] - braslist[i]; + continue; + } + return (0); + + case CBACK | CSTAR: + if (braelist[i = *ep++] == 0) + return (-1); + curlp = lp; + ct = braelist[i] - braslist[i]; + while (backref(i, lp)) + lp += ct; + while (lp >= curlp) { + if (rv = advance(lp, ep)) + return (rv); + lp -= ct; + } + continue; + + case CDOT | CSTAR: + curlp = lp; + while (*lp++); + goto star; + + case CCHR | CSTAR: + curlp = lp; + while (*lp++ == *ep); + ep++; + goto star; + + case CCL | CSTAR: + case NCCL | CSTAR: + curlp = lp; + while (cclass(ep, *lp++, ep[-1] == (CCL | CSTAR))); + ep += *ep; + goto star; + + star: + do { + lp--; + if (rv = advance(lp, ep)) + return (rv); + } while (lp > curlp); + return (0); + + default: + return (-1); + } } static backref(i, lp) - register int i; - register char *lp; + register int i; + register char *lp; { - register char *bp; + register char *bp; - bp = braslist[i]; - while (*bp++ == *lp++) - if (bp >= braelist[i]) - return(1); - return(0); + bp = braslist[i]; + while (*bp++ == *lp++) + if (bp >= braelist[i]) + return (1); + return (0); } static int cclass(set, c, af) - register char *set, c; - int af; + register char *set, c; + int af; { - register int n; - - if (c == 0) - return(0); - n = *set++; - while (--n) - if (*set++ == c) - return(af); - return(! af); + register int n; + + if (c == 0) + return (0); + n = *set++; + while (--n) + if (*set++ == c) + return (af); + return (!af); } diff --git a/src/bucoord/restore.c b/src/bucoord/restore.c index 38746f4c2..73f3a6310 100644 --- a/src/bucoord/restore.c +++ b/src/bucoord/restore.c @@ -14,7 +14,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/restore.c,v 1.1.1.5 2001/09/11 14:31:37 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/restore.c,v 1.8 2003/12/07 22:49:19 jaltman Exp $"); #include #include @@ -37,12 +38,8 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/restore.c,v 1.1.1.5 2001/09/11 #include #include "error_macros.h" - -extern struct bc_config *bc_globalConfig; extern struct bc_dumpTask bc_dumpTasks[BC_MAXSIMDUMPS]; -extern void bc_HandleMisc(); extern char *whoami; -extern struct rx_connection *bc_GetConn(); #define BC_MAXLEVELS 20 #define MAXTAPESATONCE 10 @@ -56,104 +53,103 @@ extern struct rx_connection *bc_GetConn(); /* local structure to keep track of volumes and the dumps from which * they should be restored */ -struct dumpinfo -{ - struct dumpinfo *next; - struct volinfo *volinfolist; - struct volinfo *lastinlist; - afs_int32 DumpId; - afs_int32 initialDumpId; - afs_int32 parentDumpId; - afs_int32 level; +struct dumpinfo { + struct dumpinfo *next; + struct volinfo *volinfolist; + struct volinfo *lastinlist; + afs_int32 DumpId; + afs_int32 initialDumpId; + afs_int32 parentDumpId; + afs_int32 level; }; -struct volinfo -{ - struct voli *next; - char *volname; - afs_int32 server; - afs_int32 partition; +struct volinfo { + struct voli *next; + char *volname; + afs_int32 server; + afs_int32 partition; }; /* local structure used to keep track of a tape, including a list of * volumes to restore from that tape (bc_tapeItem) */ -struct bc_tapeList -{ - struct bc_tapeList *next; /* next guy in list */ - char *tapeName; /* name of the tape */ - afs_int32 dumpID; /* dump located on this tape */ - afs_int32 initialDumpID; /* initial dump located on this tape */ - afs_int32 tapeNumber; /* which tape in the dump */ - struct bc_tapeItem *restoreList; /* volumes to restore from this tape */ +struct bc_tapeList { + struct bc_tapeList *next; /* next guy in list */ + char *tapeName; /* name of the tape */ + afs_int32 dumpID; /* dump located on this tape */ + afs_int32 initialDumpID; /* initial dump located on this tape */ + afs_int32 tapeNumber; /* which tape in the dump */ + struct bc_tapeItem *restoreList; /* volumes to restore from this tape */ }; /* each tape has a list of volumes to restore; hangs off of a struct bc_tapeList. Kept sorted so that we can read the tape once to do everything we need to do. */ -struct bc_tapeItem -{ +struct bc_tapeItem { struct bc_tapeItem *next; - char *volumeName; /* volume to restore */ - afs_int32 position; /* file slot on this tape */ - afs_int32 oid; /* id of the volume */ - afs_int32 dumplevel; /* level # of the containing dump (0 == top level) */ - afs_int32 vollevel; /* level # of the containing volume (0 == full dump) */ + char *volumeName; /* volume to restore */ + afs_int32 position; /* file slot on this tape */ + afs_int32 oid; /* id of the volume */ + afs_int32 dumplevel; /* level # of the containing dump (0 == top level) */ + afs_int32 vollevel; /* level # of the containing volume (0 == full dump) */ afs_uint32 server; afs_int32 partition; - int lastdump; /* The last incremental to restore */ + int lastdump; /* The last incremental to restore */ }; /* strip .backup from the end of a name */ -static StripBackup(aname) - register char *aname; +static +StripBackup(aname) + register char *aname; { int j; - + if (j = BackupName(aname)) { - aname[j] = 0; + aname[j] = 0; return 0; } return -1; } -int BackupName(aname) - char *aname; +int +BackupName(aname) + char *aname; { int j; j = strlen(aname); - if ((j > 7) && (strcmp(".backup", aname+j-7) == 0)) - return (j-7); - if ((j > 9) && (strcmp(".readonly", aname+j-9) == 0)) - return (j-9); + if ((j > 7) && (strcmp(".backup", aname + j - 7) == 0)) + return (j - 7); + if ((j > 9) && (strcmp(".readonly", aname + j - 9) == 0)) + return (j - 9); return 0; } extractTapeSeq(tapename) - char *tapename; + char *tapename; { char *sptr; sptr = strrchr(tapename, '.'); - if ( !sptr ) return(-1); + if (!sptr) + return (-1); sptr++; - return(atol(sptr)); + return (atol(sptr)); } viceName(value) - long value; + long value; { - char *alph; - int r; + char *alph; + int r; - alph = "abcdefjhijklmnopqrstuvwxyz"; + alph = "abcdefjhijklmnopqrstuvwxyz"; - if (value > 25) - viceName(value/26 - 1); + if (value > 25) + viceName(value / 26 - 1); - r = value % 26; - printf("%c", alph[r]); + r = value % 26; + printf("%c", alph[r]); } /* bc_DoRestore @@ -161,27 +157,27 @@ viceName(value) * aindex - index into bc_dumpTasks that describes this dump. */ bc_Restorer(aindex) - afs_int32 aindex; + afs_int32 aindex; { struct bc_dumpTask *dumpTaskPtr; - char vname[BU_MAXNAMELEN]; + char vname[BU_MAXNAMELEN]; struct budb_dumpEntry *dumpDescr, dumpDescr1, dumpDescr2; struct budb_volumeEntry *volumeEntries; struct bc_volumeDump *tvol; - afs_int32 code = 0, tcode; - afs_int32 tapedumpid, parent; + afs_int32 code = 0, tcode; + afs_int32 tapedumpid, parent; - afs_int32 nentries = 0; - afs_int32 last, next, ve, vecount; + afs_int32 nentries = 0; + afs_int32 last, next, ve, vecount; struct bc_tapeItem *ti, *pti, *nti; struct bc_tapeList *tapeList = (struct bc_tapeList *)0; struct bc_tapeList *tle, *ptle, *ntle; - afs_int32 tlid; - afs_int32 tapeid, tid; + afs_int32 tlid; + afs_int32 tapeid, tid; - struct tc_restoreArray rpcArray; /* the rpc structure we use */ - struct tc_restoreDesc *tcarray = (struct tc_restoreDesc *)0; + struct tc_restoreArray rpcArray; /* the rpc structure we use */ + struct tc_restoreDesc *tcarray = (struct tc_restoreDesc *)0; afs_int32 i, startentry, todump; afs_int32 port, nextport; @@ -190,60 +186,53 @@ bc_Restorer(aindex) struct rx_connection *aconn = (struct rx_connection *)0; statusP statusPtr, newStatusPtr; - struct dumpinfo *dumpinfolist = (struct dumpinfo *)0; + struct dumpinfo *dumpinfolist = NULL; struct dumpinfo *pdi, *ndi, *di, dlevels[BC_MAXLEVELS]; - struct volinfo *pvi, *nvi, *vi; - afs_int32 lvl, lv; + struct volinfo *pvi, *nvi, *vi; + afs_int32 lvl, lv; - afs_int32 serverAll; /* The server to which all volumes are to be restore to */ - afs_int32 partitionAll; /* Likewise for partition */ - struct hostent *hostPtr; - long haddr; - u_long did; - int foundtape, c; + afs_int32 serverAll; /* The server to which all volumes are to be restore to */ + afs_int32 partitionAll; /* Likewise for partition */ + struct hostent *hostPtr; + long haddr; + u_long did; + int foundtape, c; extern statusP createStatusNode(); extern statusP findStatus(); - dumpTaskPtr = &bc_dumpTasks[aindex]; - serverAll = HOSTADDR(&dumpTaskPtr->destServer); + dumpTaskPtr = &bc_dumpTasks[aindex]; + serverAll = HOSTADDR(&dumpTaskPtr->destServer); partitionAll = dumpTaskPtr->destPartition; volumeEntries = (struct budb_volumeEntry *) - malloc(MAXTAPESATONCE * sizeof(struct budb_volumeEntry)); - if (!volumeEntries) - { - com_err(whoami,BC_NOMEM,""); + malloc(MAXTAPESATONCE * sizeof(struct budb_volumeEntry)); + if (!volumeEntries) { + com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } - + /* For each volume to restore, find which dump it's most recent full or * incremental is on and thread onto our dump list (from oldest to newest * dump). Also hang the volume off of the dump (no particular order). */ - for (tvol = dumpTaskPtr->volumes; tvol; tvol = tvol->next) - { /*tvol*/ - strcpy(vname, tvol->name); + for (tvol = dumpTaskPtr->volumes; tvol; tvol = tvol->next) { /*tvol */ + strcpy(vname, tvol->name); dumpDescr = &dumpDescr1; code = bcdb_FindDump(vname, dumpTaskPtr->fromDate, dumpDescr); - if ( !BackupName(vname) ) /* See if backup volume is there */ - { + if (!BackupName(vname)) { /* See if backup volume is there */ strcat(vname, ".backup"); dumpDescr = &dumpDescr2; tcode = code; code = bcdb_FindDump(vname, dumpTaskPtr->fromDate, dumpDescr); - if (code) /* Can't find backup, go with first results */ - { - strcpy(vname, tvol->name); + if (code) { /* Can't find backup, go with first results */ + strcpy(vname, tvol->name); dumpDescr = &dumpDescr1; code = tcode; - } - else if (!tcode) /* Both found an entry, go with latest result */ - { - if (dumpDescr1.created > dumpDescr2.created) - { + } else if (!tcode) { /* Both found an entry, go with latest result */ + if (dumpDescr1.created > dumpDescr2.created) { strcpy(vname, tvol->name); dumpDescr = &dumpDescr1; code = tcode; @@ -251,107 +240,99 @@ bc_Restorer(aindex) } } - if (code) /* If FindDump took an error */ - { - com_err(whoami, code, "; Can't find any dump for volume %s", tvol->name); + if (code) { /* If FindDump took an error */ + com_err(whoami, code, "; Can't find any dump for volume %s", + tvol->name); continue; } - + /* look to see if this dump has already been found */ - for (pdi=0, di=dumpinfolist; di; pdi=di, di=di->next) - { - if (di->DumpId < dumpDescr->id) { di = 0; break; } - else if (di->DumpId == dumpDescr->id) { break; } + for (pdi = 0, di = dumpinfolist; di; pdi = di, di = di->next) { + if (di->DumpId < dumpDescr->id) { + di = 0; + break; + } else if (di->DumpId == dumpDescr->id) { + break; + } } /* If didn't find it, create one and thread into list */ - if (!di) - { - di = (struct dumpinfo *) malloc(sizeof(struct dumpinfo)); - if (!di) - { - com_err(whoami,BC_NOMEM,""); + if (!di) { + di = (struct dumpinfo *)malloc(sizeof(struct dumpinfo)); + if (!di) { + com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } memset(di, 0, sizeof(struct dumpinfo)); - di->DumpId = dumpDescr->id; + di->DumpId = dumpDescr->id; di->initialDumpId = dumpDescr->initialDumpID; - di->parentDumpId = dumpDescr->parent; - di->level = dumpDescr->level; - - if (!pdi) - { - di->next = dumpinfolist; - dumpinfolist = di; - } - else - { - di->next = pdi->next; - pdi->next = di; + di->parentDumpId = dumpDescr->parent; + di->level = dumpDescr->level; + + if (!pdi) { + di->next = dumpinfolist; + dumpinfolist = di; + } else { + di->next = pdi->next; + pdi->next = di; } } - + /* Create one and thread into list */ - vi = (struct volinfo *) malloc(sizeof(struct volinfo)); - if (!vi) - { - com_err(whoami,BC_NOMEM,""); + vi = (struct volinfo *)malloc(sizeof(struct volinfo)); + if (!vi) { + com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } memset(vi, 0, sizeof(struct volinfo)); - - vi->volname = (char*)malloc(strlen(vname)+1); - if (!vi->volname) - { + + vi->volname = (char *)malloc(strlen(vname) + 1); + if (!vi->volname) { free(vi); - com_err(whoami,BC_NOMEM,""); + com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } strcpy(vi->volname, vname); - if (serverAll) - { - vi->server = serverAll; + if (serverAll) { + vi->server = serverAll; vi->partition = partitionAll; - } - else - { - vi->server = HOSTADDR(&tvol->server); + } else { + vi->server = HOSTADDR(&tvol->server); vi->partition = tvol->partition; } /* thread onto end of list */ - if (!di->lastinlist) di->volinfolist = vi; - else di->lastinlist->next = vi; + if (!di->lastinlist) + di->volinfolist = vi; + else + di->lastinlist->next = vi; di->lastinlist = vi; - } /*tvol*/ + } /*tvol */ /* For each of the above dumps we found (they could be increments), find * the dump's lineage (up to the full dump). */ - for (di=dumpinfolist; di; di=di->next) - { + for (di = dumpinfolist; di; di = di->next) { /* Find each of the parent dumps */ - memcpy(&dlevels[0], di, sizeof(struct dumpinfo)); - for (lvl=1, parent=dlevels[0].parentDumpId; parent; - parent=dlevels[lvl].parentDumpId, lvl++) - { + memcpy(&dlevels[0], di, sizeof(struct dumpinfo)); + for (lvl = 1, parent = dlevels[0].parentDumpId; parent; + parent = dlevels[lvl].parentDumpId, lvl++) { code = bcdb_FindDumpByID(parent, &dumpDescr1); - if (code) - { - for (vi=di->volinfolist; vi; vi=vi->next) - { - com_err(whoami, code, "; Can't find parent DumpID %u for volume %s", + if (code) { + for (vi = di->volinfolist; vi; vi = vi->next) { + com_err(whoami, code, + "; Can't find parent DumpID %u for volume %s", parent, vi->volname); } break; } - dlevels[lvl].DumpId = dumpDescr1.id; + dlevels[lvl].DumpId = dumpDescr1.id; dlevels[lvl].initialDumpId = dumpDescr1.initialDumpID; - dlevels[lvl].parentDumpId = dumpDescr1.parent; - dlevels[lvl].level = dumpDescr1.level; + dlevels[lvl].parentDumpId = dumpDescr1.parent; + dlevels[lvl].level = dumpDescr1.level; } /* For each of the volumes that has a dump in this lineage (vi), @@ -361,45 +342,44 @@ bc_Restorer(aindex) * Each volume fragment is sorted by tapeid, tape sequence, and tape * position. */ - for (vi=di->volinfolist; vi; vi=vi->next) - { - tle = tapeList; /* Use for searching the tapelist */ - ptle = 0; /* The previous tape list entry */ - tlid = 0; /* tapeid of first entry */ + for (vi = di->volinfolist; vi; vi = vi->next) { + tle = tapeList; /* Use for searching the tapelist */ + ptle = 0; /* The previous tape list entry */ + tlid = 0; /* tapeid of first entry */ /* Volume's dump-level. May not be same as dump's dump-level. This * value gets incremented everytime the volume is found on a dump. */ voldumplevel = 0; /* Do from level 0 dump to highest level dump */ - for (lv=(lvl-1); lv>=0; lv--) - { - foundvolume = 0; /* If found volume on this dump */ - tapeid = (dlevels[lv].initialDumpId ? dlevels[lv].initialDumpId : - dlevels[lv].DumpId); - - /* Cycle through the volume fragments for this volume on the tape */ - for (last=0,c=0; last>=0; last=next,c++) - { - code = bcdb_FindVolumes(dlevels[lv].DumpId, vi->volname, volumeEntries, - last, &next, MAXTAPESATONCE, &vecount); - if (code) - { - /* Volume wasn't found on the tape - so continue. + for (lv = (lvl - 1); lv >= 0; lv--) { + foundvolume = 0; /* If found volume on this dump */ + tapeid = + (dlevels[lv].initialDumpId ? dlevels[lv]. + initialDumpId : dlevels[lv].DumpId); + + /* Cycle through the volume fragments for this volume on the tape */ + for (last = 0, c = 0; last >= 0; last = next, c++) { + code = + bcdb_FindVolumes(dlevels[lv].DumpId, vi->volname, + volumeEntries, last, &next, + MAXTAPESATONCE, &vecount); + if (code) { + /* Volume wasn't found on the tape - so continue. * This can happen when volume doesn't exist during level 0 dump * but exists for incremental dump. */ - if (code == BUDB_ENDOFLIST) - { + if (code == BUDB_ENDOFLIST) { code = 0; break; } - com_err(whoami, code, "; Can't find volume %s in DumpID %u", + com_err(whoami, code, + "; Can't find volume %s in DumpID %u", vi->volname, dlevels[lv].DumpId); ERROR(code); } - + /* If we have made the Findvolumes call more than once for the same * volume, then begin the search at the top. This sort assumes that * we are collecting information from lowest level dump (full dump) @@ -408,9 +388,8 @@ bc_Restorer(aindex) * there is more than one call to FindVolumes, this is not true * anymore. */ - if (c) - { - tle = tapeList; + if (c) { + tle = tapeList; ptle = 0; tlid = 0; } @@ -419,16 +398,16 @@ bc_Restorer(aindex) * the list of tapes they are on. Sort by tapeid, then tape sequence. * Do from first fragment (where volume begins) to last fragment. */ - for (ve=(vecount-1); ve>=0; ve--) - { - foundvolume = 1; /* Found the volume on this dump */ + for (ve = (vecount - 1); ve >= 0; ve--) { + foundvolume = 1; /* Found the volume on this dump */ foundtape = 0; - tapeseq = volumeEntries[ve].tapeSeq; + tapeseq = volumeEntries[ve].tapeSeq; - /* Determine where in the list of tapes this should go */ - for (; tle; ptle=tle, tle=tle->next) - { - tid = (tle->initialDumpID ? tle->initialDumpID : tle->dumpID); + /* Determine where in the list of tapes this should go */ + for (; tle; ptle = tle, tle = tle->next) { + tid = + (tle->initialDumpID ? tle-> + initialDumpID : tle->dumpID); /* Sort by tapeids. BUT, we don't want add an entry in the middle * of a dumpset (might split a volume fragmented across tapes). @@ -437,179 +416,186 @@ bc_Restorer(aindex) * incremental was appended to a tape created prior its parent- * dump's tape, and needs to be restored after it. */ - if (tapeid < tid) - { - if (tlid != tid) - { tle = 0; break; } /* Allocate and insert a tape entry */ + if (tapeid < tid) { + if (tlid != tid) { + tle = 0; + break; + } /* Allocate and insert a tape entry */ } /* Found the tapeid (the dumpset). Check if its the correct * tape sequence */ - else if (tapeid == tid) - { - if (tapeseq < tle->tapeNumber) - { tle = 0; break; } /* Allocate and insert a tape entry */ - - if (tapeseq == tle->tapeNumber) - { break; } /* Don't allocate tape entry */ - - foundtape = 1; /* Found dumpset but not the tape */ + else if (tapeid == tid) { + if (tapeseq < tle->tapeNumber) { + tle = 0; + break; + } + /* Allocate and insert a tape entry */ + if (tapeseq == tle->tapeNumber) { + break; + } + /* Don't allocate tape entry */ + foundtape = 1; /* Found dumpset but not the tape */ } /* Prevously found the tapeid (the dumpset) but this tape * sequence not included (the tapeid has changed). So add * this tape entry to the end of its dumpset. */ - else if (foundtape) - { tle = 0; break; } /* Allocate and insert a tape entry */ - + else if (foundtape) { + tle = 0; + break; + } + /* Allocate and insert a tape entry */ } /* Allocate a new tapelist entry if one not found */ - if (!tle) - { - tle = (struct bc_tapeList *) malloc(sizeof(struct bc_tapeList)); - if (!tle) - { - com_err(whoami,BC_NOMEM,""); - return(BC_NOMEM); + if (!tle) { + tle = (struct bc_tapeList *) + malloc(sizeof(struct bc_tapeList)); + if (!tle) { + com_err(whoami, BC_NOMEM, ""); + return (BC_NOMEM); } memset(tle, 0, sizeof(struct bc_tapeList)); - tle->tapeName = (char*)malloc(strlen(volumeEntries[ve].tape)+1); - if (!tle->tapeName) - { - free(tle); - com_err(whoami,BC_NOMEM,""); - return(BC_NOMEM); + tle->tapeName = + (char *)malloc(strlen(volumeEntries[ve].tape) + + 1); + if (!tle->tapeName) { + free(tle); + com_err(whoami, BC_NOMEM, ""); + return (BC_NOMEM); } strcpy(tle->tapeName, volumeEntries[ve].tape); - tle->dumpID = dlevels[lv].DumpId; + tle->dumpID = dlevels[lv].DumpId; tle->initialDumpID = dlevels[lv].initialDumpId; - tle->tapeNumber = tapeseq; + tle->tapeNumber = tapeseq; /* Now thread the tape onto the list */ - if (!ptle) - { - tle->next = tapeList; + if (!ptle) { + tle->next = tapeList; tapeList = tle; - } - else - { - tle->next = ptle->next; + } else { + tle->next = ptle->next; ptle->next = tle; } } - tlid = (tle->initialDumpID ? tle->initialDumpID : tle->dumpID); + tlid = + (tle->initialDumpID ? tle->initialDumpID : tle-> + dumpID); /* Now place the volume fragment into the correct position on * this tapelist entry. Duplicate entries are ignored. */ - for (pti = 0, ti=tle->restoreList; ti; pti=ti, ti=ti->next) - { - if (volumeEntries[ve].position < ti->position) - { ti = 0; break; } /* Allocate an entry */ - - else if (volumeEntries[ve].position == ti->position) - { break; } /* Duplicate entry */ + for (pti = 0, ti = tle->restoreList; ti; + pti = ti, ti = ti->next) { + if (volumeEntries[ve].position < ti->position) { + ti = 0; + break; + } + /* Allocate an entry */ + else if (volumeEntries[ve].position == + ti->position) { + break; + } /* Duplicate entry */ } /* If didn't find one, allocate and thread onto list. * Remember the server and partition. */ - if (!ti) - { - ti = (struct bc_tapeItem *) malloc(sizeof(struct bc_tapeItem)); - if (!ti) - { - com_err(whoami,BC_NOMEM,""); - return(BC_NOMEM); + if (!ti) { + ti = (struct bc_tapeItem *) + malloc(sizeof(struct bc_tapeItem)); + if (!ti) { + com_err(whoami, BC_NOMEM, ""); + return (BC_NOMEM); } memset(ti, 0, sizeof(struct bc_tapeItem)); - ti->volumeName = (char*)malloc(strlen(volumeEntries[ve].name)+1); - if (!ti->volumeName) - { - free(ti); - com_err(whoami,BC_NOMEM,""); - return(BC_NOMEM); + ti->volumeName = + (char *)malloc(strlen(volumeEntries[ve].name) + + 1); + if (!ti->volumeName) { + free(ti); + com_err(whoami, BC_NOMEM, ""); + return (BC_NOMEM); } strcpy(ti->volumeName, volumeEntries[ve].name); - ti->server = vi->server; + ti->server = vi->server; ti->partition = vi->partition; - ti->oid = volumeEntries[ve].id; - ti->position = volumeEntries[ve].position; - ti->vollevel = voldumplevel; + ti->oid = volumeEntries[ve].id; + ti->position = volumeEntries[ve].position; + ti->vollevel = voldumplevel; ti->dumplevel = dlevels[lv].level; - ti->lastdump = ((lv == 0) ? 1 : 0); + ti->lastdump = ((lv == 0) ? 1 : 0); - if (!pti) - { - ti->next = tle->restoreList; - tle->restoreList = ti; - } - else - { - ti->next = pti->next; + if (!pti) { + ti->next = tle->restoreList; + tle->restoreList = ti; + } else { + ti->next = pti->next; pti->next = ti; } nentries++; - } /* !ti */ - } /* ve: for each returned volume fragment by bcdb_FindVolumes() */ - } /* last: Multiple calls to bcdb_FindVolumes() */ - - if (foundvolume) voldumplevel++; - } /* lv: For each dump level */ - } /* vi: For each volume to search for in the dump hierarchy */ - } /* di: For each dump */ - - if (!nentries) - { - com_err(whoami, 0, "No volumes to restore"); + } /* !ti */ + } /* ve: for each returned volume fragment by bcdb_FindVolumes() */ + } /* last: Multiple calls to bcdb_FindVolumes() */ + + if (foundvolume) + voldumplevel++; + } /* lv: For each dump level */ + } /* vi: For each volume to search for in the dump hierarchy */ + } /* di: For each dump */ + + if (!nentries) { + com_err(whoami, 0, "No volumes to restore"); ERROR(0); } - if (dumpTaskPtr->dontExecute) - { - for (tle=tapeList; tle; tle=tle->next) - { - for (ti=tle->restoreList; ti; ti=ti->next) - { - tapedumpid = (tle->initialDumpID ? tle->initialDumpID : tle->dumpID); + if (dumpTaskPtr->dontExecute) { + for (tle = tapeList; tle; tle = tle->next) { + for (ti = tle->restoreList; ti; ti = ti->next) { + tapedumpid = + (tle->initialDumpID ? tle->initialDumpID : tle->dumpID); strcpy(vname, ti->volumeName); StripBackup(vname); - if (dumpTaskPtr->newExt) strcat(vname, dumpTaskPtr->newExt); + if (dumpTaskPtr->newExt) + strcat(vname, dumpTaskPtr->newExt); /* print volume to restore and the tape and position its on */ - if (serverAll) - { - printf("Restore volume %s (ID %d) from tape %s (%u), position %d", - ti->volumeName, ti->oid, tle->tapeName, tapedumpid, ti->position); + if (serverAll) { + printf + ("Restore volume %s (ID %d) from tape %s (%u), position %d", + ti->volumeName, ti->oid, tle->tapeName, tapedumpid, + ti->position); if (strcmp(ti->volumeName, vname) != 0) - printf(" as %s", vname); + printf(" as %s", vname); printf(".\n"); } /* print in format recognized by volsetrestore */ - else - { + else { haddr = ti->server; - hostPtr = gethostbyaddr((char *) &haddr, sizeof(haddr), AF_INET); - if (hostPtr) printf("%s", hostPtr->h_name); - else printf("%u", ti->server); - + hostPtr = + gethostbyaddr((char *)&haddr, sizeof(haddr), AF_INET); + if (hostPtr) + printf("%s", hostPtr->h_name); + else + printf("%u", ti->server); + printf(" /vicep"); viceName(ti->partition); - printf(" %s # as %s; %s (%u); pos %d;", - ti->volumeName, vname, tle->tapeName, tapedumpid, ti->position); - + printf(" %s # as %s; %s (%u); pos %d;", ti->volumeName, + vname, tle->tapeName, tapedumpid, ti->position); + did = tle->dumpID; printf(" %s", ctime(&did)); } @@ -620,40 +606,40 @@ bc_Restorer(aindex) } /* Allocate a list of volumes to restore */ - tcarray = (struct tc_restoreDesc *) malloc(nentries*sizeof(struct tc_restoreDesc)); - if (!tcarray) - { - com_err(whoami,BC_NOMEM,""); + tcarray = + (struct tc_restoreDesc *)malloc(nentries * + sizeof(struct tc_restoreDesc)); + if (!tcarray) { + com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } - memset(tcarray, 0, nentries*sizeof(struct tc_restoreDesc)); + memset(tcarray, 0, nentries * sizeof(struct tc_restoreDesc)); /* Fill in the array with the list above */ i = 0; - for (tle=tapeList; tle; tle=tle->next) - { - for (ti=tle->restoreList; ti; ti=ti->next) - { - tcarray[i].origVid = ti->oid; /* means unknown */ - tcarray[i].vid = 0; - tcarray[i].flags = 0; + for (tle = tapeList; tle; tle = tle->next) { + for (ti = tle->restoreList; ti; ti = ti->next) { + tcarray[i].origVid = ti->oid; /* means unknown */ + tcarray[i].vid = 0; + tcarray[i].flags = 0; if (ti->vollevel == 0) - tcarray[i].flags |= RDFLAG_FIRSTDUMP; + tcarray[i].flags |= RDFLAG_FIRSTDUMP; if (ti->lastdump) - tcarray[i].flags |= RDFLAG_LASTDUMP; - tcarray[i].position = ti->position; - tcarray[i].dbDumpId = tle->dumpID; + tcarray[i].flags |= RDFLAG_LASTDUMP; + tcarray[i].position = ti->position; + tcarray[i].dbDumpId = tle->dumpID; tcarray[i].initialDumpId = tle->initialDumpID; - tcarray[i].hostAddr = ti->server; /* just the internet address */ - tcarray[i].partition = ti->partition; + tcarray[i].hostAddr = ti->server; /* just the internet address */ + tcarray[i].partition = ti->partition; strcpy(tcarray[i].tapeName, tle->tapeName); - strcpy(tcarray[i].oldName, ti->volumeName); - strcpy(tcarray[i].newName, ti->volumeName); + strcpy(tcarray[i].oldName, ti->volumeName); + strcpy(tcarray[i].newName, ti->volumeName); StripBackup(tcarray[i].newName); - if (dumpTaskPtr->newExt) strcat(tcarray[i].newName, dumpTaskPtr->newExt); + if (dumpTaskPtr->newExt) + strcat(tcarray[i].newName, dumpTaskPtr->newExt); - tcarray[i].dumpLevel = ti->dumplevel; + tcarray[i].dumpLevel = ti->dumplevel; i++; } } @@ -661,31 +647,31 @@ bc_Restorer(aindex) printf("Starting restore\n"); /* Loop until all of the tape entries are used */ - for (startentry=0; startentryportCount == 0) - { - port = 0; + if (dumpTaskPtr->portCount == 0) { + port = 0; todump = nentries - startentry; - } - else if (dumpTaskPtr->portCount == 1) - { - port = dumpTaskPtr->portOffset[0]; + } else if (dumpTaskPtr->portCount == 1) { + port = dumpTaskPtr->portOffset[0]; todump = nentries - startentry; - } - else - { + } else { level = tcarray[startentry].dumpLevel; - port = dumpTaskPtr->portOffset[(level <= dumpTaskPtr->portCount-1 ? - level : dumpTaskPtr->portCount-1)]; - - for (todump=1; ((startentry+todump) < nentries); todump++) - { - level = tcarray[startentry+todump].dumpLevel; - nextport = dumpTaskPtr->portOffset[(level <= dumpTaskPtr->portCount-1 ? - level : dumpTaskPtr->portCount-1)]; - if (port != nextport) break; /* break if we change ports */ + port = + dumpTaskPtr-> + portOffset[(level <= + dumpTaskPtr->portCount - + 1 ? level : dumpTaskPtr->portCount - 1)]; + + for (todump = 1; ((startentry + todump) < nentries); todump++) { + level = tcarray[startentry + todump].dumpLevel; + nextport = + dumpTaskPtr-> + portOffset[(level <= + dumpTaskPtr->portCount - + 1 ? level : dumpTaskPtr->portCount - 1)]; + if (port != nextport) + break; /* break if we change ports */ } } @@ -693,27 +679,30 @@ bc_Restorer(aindex) rpcArray.tc_restoreArray_val = &tcarray[startentry]; code = ConnectButc(dumpTaskPtr->config, port, &aconn); - if (code) return(code); - + if (code) + return (code); + if (tcarray[startentry].dumpLevel == 0) printf("\nFull restore being processed on port %d\n", port); else - printf("\nIncremental restore being processed on port %d\n", port); - - code = TC_PerformRestore(aconn, "DumpSetName", &rpcArray, &dumpTaskPtr->dumpID); - if (code) - { - com_err(whoami,code,"; Failed to start restore"); + printf("\nIncremental restore being processed on port %d\n", + port); + + code = + TC_PerformRestore(aconn, "DumpSetName", &rpcArray, + &dumpTaskPtr->dumpID); + if (code) { + com_err(whoami, code, "; Failed to start restore"); break; } /* setup status monitor node */ statusPtr = createStatusNode(); lock_Status(); - statusPtr->port = port; - statusPtr->taskId = dumpTaskPtr->dumpID; - statusPtr->jobNumber = bc_jobNumber(); - statusPtr->flags &= ~STARTING; /* clearStatus to examine */ + statusPtr->port = port; + statusPtr->taskId = dumpTaskPtr->dumpID; + statusPtr->jobNumber = bc_jobNumber(); + statusPtr->flags &= ~STARTING; /* clearStatus to examine */ if (tcarray[startentry].dumpLevel == 0) sprintf(statusPtr->taskName, "Full Restore"); else @@ -723,18 +712,16 @@ bc_Restorer(aindex) /* Wait until this restore pass is complete before starting the next * pass. Query the statusWatcher for the status */ - while (1) - { + while (1) { lock_Status(); newStatusPtr = findStatus(dumpTaskPtr->dumpID); - if (!newStatusPtr || (newStatusPtr->flags & - (ABORT_REQUEST|ABORT_SENT|ABORT_DONE|TASK_ERROR)) ) - { - unlock_Status(); + if (!newStatusPtr + || (newStatusPtr-> + flags & (ABORT_REQUEST | ABORT_SENT | ABORT_DONE | + TASK_ERROR))) { + unlock_Status(); ERROR(0); - } - else if (newStatusPtr->flags & (TASK_DONE)) - { + } else if (newStatusPtr->flags & (TASK_DONE)) { unlock_Status(); break; } @@ -743,45 +730,48 @@ bc_Restorer(aindex) IOMGR_Sleep(2); } - if (aconn) rx_DestroyConnection(aconn); + if (aconn) + rx_DestroyConnection(aconn); aconn = (struct rx_connection *)0; - } /* while */ + } /* while */ /* free up everything */ error_exit: - if (aconn) rx_DestroyConnection(aconn); + if (aconn) + rx_DestroyConnection(aconn); - if (tcarray) free(tcarray); + if (tcarray) + free(tcarray); /* Free the dumpinfo list and its volumes */ - for (di=dumpinfolist; di; di=ndi) - { - for (vi=di->volinfolist; vi; vi=nvi) - { - if (vi->volname) free(vi->volname); + for (di = dumpinfolist; di; di = ndi) { + for (vi = di->volinfolist; vi; vi = nvi) { + if (vi->volname) + free(vi->volname); nvi = vi->next; free(vi); } - ndi = di->next; + ndi = di->next; free(di); } /* Free the tape lists and items */ - for (tle = tapeList; tle; tle=ntle) - { - for(ti = tle->restoreList; ti; ti = nti) - { + for (tle = tapeList; tle; tle = ntle) { + for (ti = tle->restoreList; ti; ti = nti) { nti = ti->next; - if (ti->volumeName) free(ti->volumeName); + if (ti->volumeName) + free(ti->volumeName); free(ti); } ntle = tle->next; - if (tle->tapeName) free(tle->tapeName); + if (tle->tapeName) + free(tle->tapeName); free(tle); } /* free local-like things we alloacted to save stack space */ - if (volumeEntries) free(volumeEntries); + if (volumeEntries) + free(volumeEntries); return code; } diff --git a/src/bucoord/server.c b/src/bucoord/server.c index 602fd8463..39c5a4384 100644 --- a/src/bucoord/server.c +++ b/src/bucoord/server.c @@ -11,7 +11,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/server.c,v 1.1.1.4 2001/07/14 22:20:53 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/server.c,v 1.5 2003/07/15 23:14:47 shadow Exp $"); #ifdef AFS_NT40_ENV #include @@ -22,12 +23,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/server.c,v 1.1.1.4 2001/07/14 2 /* services available on incoming message port */ BC_Print(acall, acode, aflags, amessage) -struct rx_call *acall; -afs_int32 acode, aflags; -char *amessage; { + struct rx_call *acall; + afs_int32 acode, aflags; + char *amessage; +{ struct rx_connection *tconn; struct rx_peer *tpeer; - + tconn = rx_ConnectionOf(acall); tpeer = rx_PeerOf(tconn); printf("From %08x: %s <%d>\n", tpeer->host, amessage, acode); diff --git a/src/bucoord/status.c b/src/bucoord/status.c index 884bba1fc..e088224d6 100644 --- a/src/bucoord/status.c +++ b/src/bucoord/status.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/status.c,v 1.1.1.5 2001/09/11 14:31:37 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/status.c,v 1.7 2003/11/23 04:53:30 jaltman Exp $"); #include #include @@ -30,9 +31,9 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/status.c,v 1.1.1.5 2001/09/11 1 #include "error_macros.h" -extern dlqlinkT statusHead; /* chain of status blocks */ +extern dlqlinkT statusHead; /* chain of status blocks */ extern struct Lock statusQueueLock; /* access control for status chain */ -extern struct Lock cmdLineLock; /* lock on the cmdLine */ +extern struct Lock cmdLineLock; /* lock on the cmdLine */ /* task status management * @@ -70,25 +71,25 @@ unlock_cmdLine() /* general */ +void clearStatus(taskId, flags) afs_uint32 taskId; afs_uint32 flags; { - statusP ptr; + statusP ptr; - extern statusP findStatus(); + extern statusP findStatus(); - ObtainWriteLock(&statusQueueLock); - ptr = findStatus(taskId); - if ( ptr == 0 ) - { - ReleaseWriteLock(&statusQueueLock); - return; - } + ObtainWriteLock(&statusQueueLock); + ptr = findStatus(taskId); + if (ptr == 0) { + ReleaseWriteLock(&statusQueueLock); + return; + } - ptr->flags &= ~flags; - ReleaseWriteLock(&statusQueueLock); - } + ptr->flags &= ~flags; + ReleaseWriteLock(&statusQueueLock); +} statusP createStatusNode() @@ -96,9 +97,8 @@ createStatusNode() statusP ptr; ptr = (statusP) malloc(sizeof(*ptr)); - if ( ptr == 0 ) - { - return(0); + if (ptr == 0) { + return (0); } memset(ptr, 0, sizeof(*ptr)); @@ -108,17 +108,17 @@ createStatusNode() ptr->flags = STARTING; ReleaseWriteLock(&statusQueueLock); - return(ptr); + return (ptr); } deleteStatusNode(ptr) statusP ptr; { ObtainWriteLock(&statusQueueLock); - dlqUnlink( (dlqlinkP) ptr); + dlqUnlink((dlqlinkP) ptr); if (ptr->cmdLine) - free(ptr->cmdLine); + free(ptr->cmdLine); free(ptr); ReleaseWriteLock(&statusQueueLock); } @@ -131,34 +131,31 @@ findStatus(taskId) dlqlinkP dlqPtr; dlqPtr = statusHead.dlq_next; - while ( dlqPtr != &statusHead ) - { - if ( ((statusP) dlqPtr)->taskId == taskId ) - { - ptr = (statusP) dlqPtr; - break; - } - dlqPtr = dlqPtr->dlq_next; + while (dlqPtr != &statusHead) { + if (((statusP) dlqPtr)->taskId == taskId) { + ptr = (statusP) dlqPtr; + break; + } + dlqPtr = dlqPtr->dlq_next; } - return(ptr); + return (ptr); } +void setStatus(taskId, flags) afs_uint32 taskId; afs_uint32 flags; { - statusP ptr; + statusP ptr; - ObtainWriteLock(&statusQueueLock); - ptr = findStatus(taskId); - if ( ptr == 0 ) - { - ReleaseWriteLock(&statusQueueLock); - return; - } + ObtainWriteLock(&statusQueueLock); + ptr = findStatus(taskId); + if (ptr == 0) { + ReleaseWriteLock(&statusQueueLock); + return; + } - ptr->flags |= flags; - ReleaseWriteLock(&statusQueueLock); + ptr->flags |= flags; + ReleaseWriteLock(&statusQueueLock); } - diff --git a/src/bucoord/tape_hosts.c b/src/bucoord/tape_hosts.c index 53107e3d9..3698a2963 100644 --- a/src/bucoord/tape_hosts.c +++ b/src/bucoord/tape_hosts.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/tape_hosts.c,v 1.1.1.6 2002/09/26 19:05:06 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/tape_hosts.c,v 1.7 2003/07/15 23:14:47 shadow Exp $"); #include #include @@ -49,7 +50,8 @@ extern char *whoami; * Add a host to the tape hosts */ -afs_int32 bc_AddHostCmd(as, arock) +afs_int32 +bc_AddHostCmd(as, arock) struct cmd_syndesc *as; char *arock; { @@ -60,38 +62,39 @@ afs_int32 bc_AddHostCmd(as, arock) ctPtr = &bc_globalConfig->configText[TB_TAPEHOSTS]; code = bc_LockText(ctPtr); - if ( code ) - ERROR(code); + if (code) + ERROR(code); code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); - return(code); + com_err(whoami, code, "; Can't retrieve tape hosts"); + return (code); } /* add tape hosts first */ ti = as->parms[0].items; if (ti) { if (as->parms[1].items) { - port = getPortOffset(as->parms[1].items->data); - if (port < 0) ERROR(BC_BADARG); + port = getPortOffset(as->parms[1].items->data); + if (port < 0) + ERROR(BC_BADARG); } - printf("Adding host %s offset %u to tape list...", ti->data,port); + printf("Adding host %s offset %u to tape list...", ti->data, port); fflush(stdout); code = bc_AddTapeHost(bc_globalConfig, ti->data, port); - if (code) - { - printf("failed\n"); fflush(stdout); - if (code == EEXIST) - com_err(whoami,0,"Port offset already in tape database"); + if (code) { + printf("failed\n"); + fflush(stdout); + if (code == EEXIST) + com_err(whoami, 0, "Port offset already in tape database"); ERROR(code); } code = bc_SaveHosts(); - if ( code ) - { + if (code) { com_err(whoami, code, "Cannot save tape hosts"); - com_err(whoami, 0,"Changes are temporary - for this session only"); + com_err(whoami, 0, + "Changes are temporary - for this session only"); ERROR(code); } } @@ -99,15 +102,16 @@ afs_int32 bc_AddHostCmd(as, arock) /* done */ printf("done\n"); -error_exit: - if ( ctPtr->lockHandle != 0 ) - bc_UnlockText(ctPtr); - return(code); + error_exit: + if (ctPtr->lockHandle != 0) + bc_UnlockText(ctPtr); + return (code); } - -afs_int32 bc_DeleteHostCmd(as, arock) + +afs_int32 +bc_DeleteHostCmd(as, arock) struct cmd_syndesc *as; - char *arock; + char *arock; { struct cmd_item *ti; afs_int32 port = 0; @@ -116,41 +120,41 @@ afs_int32 bc_DeleteHostCmd(as, arock) ctPtr = &bc_globalConfig->configText[TB_TAPEHOSTS]; code = bc_LockText(ctPtr); - if ( code ) - ERROR(code); + if (code) + ERROR(code); code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); - return(code); + com_err(whoami, code, "; Can't retrieve tape hosts"); + return (code); } /* delete tape hosts first */ ti = as->parms[0].items; if (ti) { - if (as->parms[1].items) { - port = bc_SafeATOI(as->parms[1].items->data); - if (port < 0) return(BC_BADARG); + if (as->parms[1].items) { + port = bc_SafeATOI(as->parms[1].items->data); + if (port < 0) + return (BC_BADARG); } - printf("Deleting host %s offset %u to tape list...", ti->data,port); + printf("Deleting host %s offset %u to tape list...", ti->data, port); fflush(stdout); - code = bc_DeleteTapeHost(bc_globalConfig, ti->data,port); - if (code) - { + code = bc_DeleteTapeHost(bc_globalConfig, ti->data, port); + if (code) { if (code == ENOENT) - printf("failed: no such host entry\n"); + printf("failed: no such host entry\n"); else - printf("failed with code %d\n", code); + printf("failed with code %d\n", code); ERROR(code); } code = bc_SaveHosts(); - if ( code ) - { + if (code) { com_err(whoami, code, "Cannot save tape hosts"); - com_err(whoami, 0,"Changes are temporary - for this session only"); - ERROR(code); + com_err(whoami, 0, + "Changes are temporary - for this session only"); + ERROR(code); } } @@ -158,10 +162,10 @@ afs_int32 bc_DeleteHostCmd(as, arock) printf("done\n"); fflush(stdout); -error_exit: - if ( ctPtr->lockHandle != 0 ) - bc_UnlockText(ctPtr); - return(code); + error_exit: + if (ctPtr->lockHandle != 0) + bc_UnlockText(ctPtr); + return (code); } @@ -171,24 +175,24 @@ error_exit: * ignored */ -afs_int32 bc_ListHostsCmd(as, arock) +afs_int32 +bc_ListHostsCmd(as, arock) struct cmd_syndesc *as; - char *arock; + char *arock; { afs_int32 code; register struct bc_hostEntry *tentry; code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); - return(code); + com_err(whoami, code, "; Can't retrieve tape hosts"); + return (code); } printf("Tape hosts:\n"); - for ( tentry = bc_globalConfig->tapeHosts; tentry; tentry = tentry->next ) - { - printf(" Host %s, port offset %u\n", - tentry->name,tentry->portOffset); + for (tentry = bc_globalConfig->tapeHosts; tentry; tentry = tentry->next) { + printf(" Host %s, port offset %u\n", tentry->name, + tentry->portOffset); } fflush(stdout); return 0; @@ -206,16 +210,15 @@ bc_ClearHosts() register struct bc_hostEntry *tentry, *temp; tentry = bc_globalConfig->tapeHosts; - while ( tentry != 0 ) - { + while (tentry != 0) { temp = tentry->next; free(tentry->name); free(tentry); tentry = temp; } - bc_globalConfig->tapeHosts = (struct bc_hostEntry *) 0; - return(0); + bc_globalConfig->tapeHosts = (struct bc_hostEntry *)0; + return (0); } /* bc_ParseHosts @@ -226,7 +229,8 @@ bc_ClearHosts() * -1 otherwise. */ -int bc_ParseHosts() +int +bc_ParseHosts() { char tbuffer[256]; char hostName[256]; @@ -242,45 +246,41 @@ int bc_ParseHosts() ctPtr = &bc_globalConfig->configText[TB_TAPEHOSTS]; stream = ctPtr->textStream; - if ( ctPtr->textSize == 0 ) /* nothing defined yet */ - return(0); + if (ctPtr->textSize == 0) /* nothing defined yet */ + return (0); - if ( stream == NULL ) - return(BC_INTERNALERROR); + if (stream == NULL) + return (BC_INTERNALERROR); rewind(stream); /* now read the lines and build the structure list */ - tfirst = tlast = (struct bc_hostEntry *) 0; + tfirst = tlast = (struct bc_hostEntry *)0; - while(1) - { + while (1) { tp = fgets(tbuffer, sizeof(tbuffer), stream); if (!tp) - break; /* end of file */ + break; /* end of file */ sscanf(tbuffer, "%s %u", hostName, &port); th = gethostbyname(hostName); - if ( th == 0 ) - { - com_err(whoami,0,"can't get host info for %s from nameserver or /etc/hosts.", + if (th == 0) { + com_err(whoami, 0, + "can't get host info for %s from nameserver or /etc/hosts.", hostName); } - the = (struct bc_hostEntry *) malloc(sizeof(struct bc_hostEntry)); + the = (struct bc_hostEntry *)malloc(sizeof(struct bc_hostEntry)); if (the == (struct bc_hostEntry *)0) return (BC_NOMEM); memset(the, 0, sizeof(struct bc_hostEntry)); - if (tlast) - { + if (tlast) { tlast->next = the; tlast = the; - } - else - { + } else { tfirst = tlast = the; } - the->next = (struct bc_hostEntry *) 0; - the->name = (char *) malloc(strlen(hostName)+1); + the->next = (struct bc_hostEntry *)0; + the->name = (char *)malloc(strlen(hostName) + 1); strcpy(the->name, hostName); the->portOffset = port; if (th) { @@ -317,31 +317,30 @@ bc_SaveHosts() stream = ctPtr->textStream; /* must be locked */ - if ( ctPtr->lockHandle == 0 ) - return(BC_INTERNALERROR); + if (ctPtr->lockHandle == 0) + return (BC_INTERNALERROR); /* truncate the file */ code = ftruncate(fileno(stream), 0); - if ( code ) - ERROR(errno); + if (code) + ERROR(errno); rewind(stream); hePtr = bc_globalConfig->tapeHosts; - while ( hePtr != 0 ) - { + while (hePtr != 0) { fprintf(stream, "%s %u\n", hePtr->name, hePtr->portOffset); - hePtr = hePtr->next; + hePtr = hePtr->next; } - if (ferror(stream)) - return(BC_INTERNALERROR); + if (ferror(stream)) + return (BC_INTERNALERROR); /* send to server */ code = bcdb_SaveTextFile(ctPtr); - if ( code ) - ERROR(code); + if (code) + ERROR(code); /* do this on bcdb_SaveTextFile */ /* increment local version number */ @@ -350,64 +349,66 @@ bc_SaveHosts() /* update locally stored file size */ ctPtr->textSize = filesize(ctPtr->textStream); -error_exit: - return(code); + error_exit: + return (code); } -afs_int32 bc_UpdateHosts() +afs_int32 +bc_UpdateHosts() { struct udbHandleS *uhptr = &udbHandle; udbClientTextP ctPtr; afs_int32 code; - int lock=0; + int lock = 0; /* lock schedules and check validity */ ctPtr = &bc_globalConfig->configText[TB_TAPEHOSTS]; code = bc_CheckTextVersion(ctPtr); - if ( code != BC_VERSIONMISMATCH ) - { - ERROR(code); /* Version matches or some other error */ + if (code != BC_VERSIONMISMATCH) { + ERROR(code); /* Version matches or some other error */ } /* Must update the hosts */ /* If we are not already locked, then lock it now */ - if ( ctPtr->lockHandle == 0 ) { - code = bc_LockText(ctPtr); - if ( code ) - ERROR(code); + if (ctPtr->lockHandle == 0) { + code = bc_LockText(ctPtr); + if (code) + ERROR(code); lock = 1; } - if (ctPtr->textVersion != -1) - { - com_err(whoami,0,"obsolete tapehosts - updating"); - bc_ClearHosts(); + if (ctPtr->textVersion != -1) { + com_err(whoami, 0, "obsolete tapehosts - updating"); + bc_ClearHosts(); } /* open a temp file to store the config text received from buserver * * The open file stream is stored in ctPtr->textStream */ - code = bc_openTextFile(ctPtr, &bc_globalConfig->tmpTextFileNames[TB_TAPEHOSTS][0]); - if ( code ) - ERROR(code); + code = + bc_openTextFile(ctPtr, + &bc_globalConfig->tmpTextFileNames[TB_TAPEHOSTS][0]); + if (code) + ERROR(code); /* now get a fresh set of information from the database */ code = bcdb_GetTextFile(ctPtr); - if ( code ) - ERROR(code); + if (code) + ERROR(code); - /* fetch the version number */ - code = ubik_Call(BUDB_GetTextVersion, uhptr->uh_client, 0, - ctPtr->textType, &ctPtr->textVersion); - if ( code ) + /* fetch the version number */ + code = + ubik_Call(BUDB_GetTextVersion, uhptr->uh_client, 0, ctPtr->textType, + &ctPtr->textVersion); + if (code) ERROR(code); /* parse the file */ code = bc_ParseHosts(); - if ( code ) - ERROR(code); + if (code) + ERROR(code); -error_exit: - if ( lock && ctPtr->lockHandle ) + error_exit: + if (lock && ctPtr->lockHandle) bc_UnlockText(ctPtr); - return(code); + return (code); } diff --git a/src/bucoord/ttest.c b/src/bucoord/ttest.c index e39495d93..e1177430f 100644 --- a/src/bucoord/ttest.c +++ b/src/bucoord/ttest.c @@ -24,25 +24,25 @@ extern TC_ExecuteRequest(); /* dump information */ -static afs_int32 transID = 1000; /* dump or restore transaction id */ -static afs_int32 bytesDumped=0; +static afs_int32 transID = 1000; /* dump or restore transaction id */ +static afs_int32 bytesDumped = 0; #include "AFS_component_version_number.c" main(argc, argv) -int argc; -char **argv; { + int argc; + char **argv; +{ register int i; register afs_int32 code; register struct rx_service *tservice; struct rx_securityClass *rxsc[1]; - - for(i=1;iformat); @@ -96,10 +100,10 @@ afs_int32 *adumpID; { tdentry.level = alevel; tdentry.incTime = 0; /* useless? */ tdentry.nVolumes = 1000000000; /* bogus, but not important */ - tdentry.tapes.a = 1; /* a*x+b is tape numbering scheme */ + tdentry.tapes.a = 1; /* a*x+b is tape numbering scheme */ tdentry.tapes.b = 0; tdentry.tapes.maxTapes = 1000000000; /* don't care */ - strcpy(tdentry.tapes.format, atapeSet->format); /* base name (e.g. sys) */ + strcpy(tdentry.tapes.format, atapeSet->format); /* base name (e.g. sys) */ strcat(tdentry.tapes.format, "."); strcat(tdentry.tapes.format, adumpName); /* e.g. .daily */ strcat(tdentry.tapes.format, ".%d"); /* so we get basename.0, basename.1, etc */ @@ -114,21 +118,23 @@ afs_int32 *adumpID; { memset(&ttentry, 0, sizeof(ttentry)); sprintf(ttentry.name, tdentry.tapes.format, 1); ttentry.written = time(0); - ttentry.dump = tdentry.id; /* dump we're in */ + ttentry.dump = tdentry.id; /* dump we're in */ ttentry.seq = 0; - ttentry.nVolumes = 0; /* perhaps we'll adjust during dump */ + ttentry.nVolumes = 0; /* perhaps we'll adjust during dump */ ttentry.flags = BUDB_TAPE_BEINGWRITTEN; /* starting I/O */ code = bcdb_UseTape(&ttentry, &new); if (code) { - printf("ttape: failed to start tape %s, code %d\n", ttentry.name, code); + printf("ttape: failed to start tape %s, code %d\n", ttentry.name, + code); return code; } tdescr = adumpArray->tc_dumpArray_val; - for(i=0;itc_dumpArray_len;i++, tdescr++) { + for (i = 0; i < adumpArray->tc_dumpArray_len; i++, tdescr++) { memcpy(&taddr, tdescr->hostID, sizeof(taddr)); - printf("dumping volid %s(%d) from host %08x since date %d\n", tdescr->name, - tdescr->vid, taddr.sin_addr.s_addr, tdescr->date); + printf("dumping volid %s(%d) from host %08x since date %d\n", + tdescr->name, tdescr->vid, taddr.sin_addr.s_addr, + tdescr->date); memset(&tventry, 0, sizeof(tventry)); strcpy(tventry.name, tdescr->name); tventry.clone = tdescr->date; @@ -141,7 +147,8 @@ afs_int32 *adumpID; { tventry.flags = (BUDB_VOL_LASTFRAG | BUDB_VOL_FIRSTFRAG); code = bcdb_AddVolume(&tventry); if (code) { - printf("failed to append volume entry for volume %d, code %d\n", tdescr->vid, code); + printf("failed to append volume entry for volume %d, code %d\n", + tdescr->vid, code); return code; } } @@ -163,21 +170,24 @@ afs_int32 *adumpID; { } STC_PerformRestore(acall, aname, arestore, adumpID) -struct rx_call *acall; -char *aname; -struct tc_restoreArray *arestore; -afs_int32 *adumpID; { + struct rx_call *acall; + char *aname; + struct tc_restoreArray *arestore; + afs_int32 *adumpID; +{ register int i; register struct tc_restoreDesc *tdescr; struct sockaddr_in taddr; printf("tape controller received request to start restore %s.\n", aname); tdescr = arestore->tc_restoreArray_val; - for(i=0;itc_restoreArray_len; i++, tdescr++) { + for (i = 0; i < arestore->tc_restoreArray_len; i++, tdescr++) { memcpy(&taddr, tdescr->hostID, sizeof(taddr)); - printf("restoring frag %d of volume %s from tape %s at position %d.\n New name is '%s', new vid is %d, new host is %08x, new partition is %d\n", - tdescr->frag, tdescr->oldName, tdescr->tapeName, tdescr->position, tdescr->newName, - tdescr->vid, taddr.sin_addr.s_addr, tdescr->partition); + printf + ("restoring frag %d of volume %s from tape %s at position %d.\n New name is '%s', new vid is %d, new host is %08x, new partition is %d\n", + tdescr->frag, tdescr->oldName, tdescr->tapeName, + tdescr->position, tdescr->newName, tdescr->vid, + taddr.sin_addr.s_addr, tdescr->partition); } *adumpID = ++transID; bytesDumped = 0; @@ -188,36 +198,43 @@ afs_int32 *adumpID; { the status of completed dumps for a reasonable period (2 - 12 hours) so that they can be examined later */ STC_CheckDump(acall, adumpID, astatus) -struct rx_call *acall; -afs_int32 adumpID; -struct tc_dumpStat *astatus; { - if (adumpID != transID) return 2; + struct rx_call *acall; + afs_int32 adumpID; + struct tc_dumpStat *astatus; +{ + if (adumpID != transID) + return 2; astatus->dumpID = adumpID; astatus->bytesDumped = (bytesDumped += 1470); - astatus->flags =0; - if (bytesDumped > 2000) astatus->flags = TC_STAT_DONE; + astatus->flags = 0; + if (bytesDumped > 2000) + astatus->flags = TC_STAT_DONE; return 0; } STC_AbortDump(acall, adumpID) -struct rx_call *acall; -afs_int32 adumpID; { + struct rx_call *acall; + afs_int32 adumpID; +{ return 0; } /* this call waits for a dump to complete; it ties up an LWP on the tape coordinator */ -STC_WaitForDump() { +STC_WaitForDump() +{ return 1; } STC_EndDump(acall, adumpID) -struct rx_call *acall; -afs_int32 adumpID; { + struct rx_call *acall; + afs_int32 adumpID; +{ return 0; } STC_GetTMInfo(acall) -struct rx_call *acall; { + struct rx_call *acall; +{ return 0; } diff --git a/src/bucoord/ubik_db_if.c b/src/bucoord/ubik_db_if.c index 36da12dc7..09646eb07 100644 --- a/src/bucoord/ubik_db_if.c +++ b/src/bucoord/ubik_db_if.c @@ -12,7 +12,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/ubik_db_if.c,v 1.1.1.6 2001/09/11 14:31:38 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/ubik_db_if.c,v 1.10 2004/04/03 19:43:15 jaltman Exp $"); #include #include @@ -22,7 +23,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/ubik_db_if.c,v 1.1.1.6 2001/09/ #elif defined(AFS_SUN5_ENV) #include #else -#include /* for hostnames etc */ +#include /* for hostnames etc */ #endif #include #include @@ -56,21 +57,21 @@ bcdb_AddVolume(veptr) { afs_int32 code; - code = ubik_Call( BUDB_AddVolume, udbHandle.uh_client, 0, veptr); - return(code); + code = ubik_Call(BUDB_AddVolume, udbHandle.uh_client, 0, veptr); + return (code); } bcdb_AddVolumes(veptr, count) - register struct budb_volumeEntry *veptr; - afs_int32 count; + register struct budb_volumeEntry *veptr; + afs_int32 count; { - struct budb_volumeList volumeList; - afs_int32 code; + struct budb_volumeList volumeList; + afs_int32 code; - volumeList.budb_volumeList_len = count; - volumeList.budb_volumeList_val = veptr; - code = ubik_Call(BUDB_AddVolumes, udbHandle.uh_client, 0, &volumeList); - return(code); + volumeList.budb_volumeList_len = count; + volumeList.budb_volumeList_val = veptr; + code = ubik_Call(BUDB_AddVolumes, udbHandle.uh_client, 0, &volumeList); + return (code); } @@ -80,35 +81,38 @@ bcdb_CreateDump(deptr) afs_int32 code; code = ubik_Call(BUDB_CreateDump, udbHandle.uh_client, 0, deptr); - return(code); + return (code); } bcdb_deleteDump(dumpID, fromTime, toTime, dumps) - afs_int32 dumpID; - afs_int32 fromTime; - afs_int32 toTime; - budb_dumpsList *dumps; + afs_int32 dumpID; + afs_int32 fromTime; + afs_int32 toTime; + budb_dumpsList *dumps; { afs_int32 code; budb_dumpsList dumpsList, *dumpsPtr; dumpsList.budb_dumpsList_len = 0; dumpsList.budb_dumpsList_val = 0; - dumpsPtr = ( dumps ? dumps : &dumpsList ); + dumpsPtr = (dumps ? dumps : &dumpsList); - code = ubik_Call(BUDB_DeleteDump, udbHandle.uh_client, 0, dumpID, fromTime, toTime, dumpsPtr); - if (dumpsList.budb_dumpsList_val) free(dumpsList.budb_dumpsList_val); - return(code); + code = + ubik_Call(BUDB_DeleteDump, udbHandle.uh_client, 0, dumpID, fromTime, + toTime, dumpsPtr); + if (dumpsList.budb_dumpsList_val) + free(dumpsList.budb_dumpsList_val); + return (code); } bcdb_listDumps(sflags, groupId, fromTime, toTime, dumps, flags) - afs_int32 groupId; - afs_int32 fromTime; - afs_int32 toTime; - budb_dumpsList *dumps; - budb_dumpsList *flags; + afs_int32 groupId; + afs_int32 fromTime; + afs_int32 toTime; + budb_dumpsList *dumps; + budb_dumpsList *flags; { - afs_int32 code, sflag=0; + afs_int32 code, sflag = 0; budb_dumpsList dumpsList, *dumpsPtr; budb_dumpsList flagsList, *flagsPtr; @@ -120,12 +124,15 @@ bcdb_listDumps(sflags, groupId, fromTime, toTime, dumps, flags) flagsList.budb_dumpsList_val = 0; flagsPtr = (flags ? flags : &flagsList); - code = ubik_Call(BUDB_ListDumps, udbHandle.uh_client, 0, - sflags, "", groupId, fromTime, toTime, dumpsPtr, flagsPtr); + code = + ubik_Call(BUDB_ListDumps, udbHandle.uh_client, 0, sflags, "", groupId, + fromTime, toTime, dumpsPtr, flagsPtr); - if (dumpsList.budb_dumpsList_val) free(dumpsList.budb_dumpsList_val); - if (flagsList.budb_dumpsList_val) free(flagsList.budb_dumpsList_val); - return(code); + if (dumpsList.budb_dumpsList_val) + free(dumpsList.budb_dumpsList_val); + if (flagsList.budb_dumpsList_val) + free(flagsList.budb_dumpsList_val); + return (code); } @@ -136,8 +143,10 @@ bcdb_DeleteVDP(dumpSetName, dumpPath, dumpID) { afs_int32 code; - code = ubik_Call( BUDB_DeleteVDP, udbHandle.uh_client, 0, dumpSetName, dumpPath, dumpID); - return(code); + code = + ubik_Call(BUDB_DeleteVDP, udbHandle.uh_client, 0, dumpSetName, + dumpPath, dumpID); + return (code); } /* bcdb_FindClone @@ -161,8 +170,10 @@ bcdb_FindClone(dumpID, volName, clonetime) afs_int32 *clonetime; { afs_int32 code; - code = ubik_Call( BUDB_FindClone, udbHandle.uh_client, 0, dumpID, volName, clonetime); - return(code); + code = + ubik_Call(BUDB_FindClone, udbHandle.uh_client, 0, dumpID, volName, + clonetime); + return (code); } /* bcdb_FindDump @@ -188,8 +199,10 @@ bcdb_FindDump(volumeName, beforeDate, deptr) struct budb_dumpEntry *deptr; { afs_int32 code; - code = ubik_Call( BUDB_FindDump, udbHandle.uh_client, 0, volumeName, beforeDate, deptr); - return(code); + code = + ubik_Call(BUDB_FindDump, udbHandle.uh_client, 0, volumeName, + beforeDate, deptr); + return (code); } /* bcdb_FindDumpByID @@ -203,8 +216,8 @@ bcdb_FindDumpByID(dumpID, deptr) register struct budb_dumpEntry *deptr; { register afs_int32 code; - afs_int32 nextindex; - afs_int32 dbTime; + afs_int32 nextindex; + afs_int32 dbTime; budb_dumpList dl; /* initialize the dump list */ @@ -212,39 +225,32 @@ bcdb_FindDumpByID(dumpID, deptr) dl.budb_dumpList_val = 0; /* outline algorithm */ - code = ubik_Call (BUDB_GetDumps, udbHandle.uh_client, 0, - BUDB_MAJORVERSION, - BUDB_OP_DUMPID, - "", /* no name */ - dumpID, /* start */ - 0, /* end */ - 0, /* index */ - &nextindex, - &dbTime, - &dl); - - if ( (code != 0) - || (dl.budb_dumpList_len != 1) /* single retn val expected */ - ) - { + code = ubik_Call(BUDB_GetDumps, udbHandle.uh_client, 0, BUDB_MAJORVERSION, BUDB_OP_DUMPID, "", /* no name */ + dumpID, /* start */ + 0, /* end */ + 0, /* index */ + &nextindex, &dbTime, &dl); + + if ((code != 0) + || (dl.budb_dumpList_len != 1) /* single retn val expected */ + ) { /* printf("bcdb_FindDumpByID: code %d, nvalues %d\n", code, dl.budb_dumpList_len); */ - if ( code == 0 ) - code = 1; /* multiple id's */ + if (code == 0) + code = 1; /* multiple id's */ goto error; } memcpy(deptr, dl.budb_dumpList_val, sizeof(*deptr)); -exit: - if ( dl.budb_dumpList_val ) - { + exit: + if (dl.budb_dumpList_val) { /* free any allocated structures */ free(dl.budb_dumpList_val); } - return(code); + return (code); -error: + error: memset(deptr, 0, sizeof(*deptr)); goto exit; } @@ -274,11 +280,11 @@ bcdb_FindLastVolClone(volSetName, dumpName, volName, clonetime) afs_int32 *clonetime; { /* server notes - search by dumpName - match on volumeset and dump path - search for the volume name + * search by dumpName + * match on volumeset and dump path + * search for the volume name */ - return(0); + return (0); } /* bcdb_FindLatestDump @@ -304,9 +310,10 @@ bcdb_FindLatestDump(volSetName, dumpPath, deptr) struct budb_dumpEntry *deptr; { afs_int32 code; - code = ubik_Call( BUDB_FindLatestDump, udbHandle.uh_client, 0, - volSetName, dumpPath, deptr); - return(code); + code = + ubik_Call(BUDB_FindLatestDump, udbHandle.uh_client, 0, volSetName, + dumpPath, deptr); + return (code); } @@ -331,22 +338,23 @@ bcdb_FindTape(dumpid, tapeName, teptr) tl.budb_tapeList_len = 0; tl.budb_tapeList_val = 0; - code = ubik_Call( BUDB_GetTapes, udbHandle.uh_client, 0, - BUDB_MAJORVERSION, - BUDB_OP_TAPENAME|BUDB_OP_DUMPID, - tapeName, dumpid, 0, 0, &next, &dbTime, &tl); + code = + ubik_Call(BUDB_GetTapes, udbHandle.uh_client, 0, BUDB_MAJORVERSION, + BUDB_OP_TAPENAME | BUDB_OP_DUMPID, tapeName, dumpid, 0, 0, + &next, &dbTime, &tl); - if (code) ERROR(code); + if (code) + ERROR(code); if (tl.budb_tapeList_len != 1) ERROR(BC_NOTUNIQUE); /* expecting a single descriptor */ memcpy(teptr, tl.budb_tapeList_val, sizeof(*teptr)); -error_exit: - if ( tl.budb_tapeList_val ) + error_exit: + if (tl.budb_tapeList_val) free(tl.budb_tapeList_val); - return(code); + return (code); } bcdb_FindTapeSeq(dumpid, tapeSeq, teptr) @@ -363,21 +371,22 @@ bcdb_FindTapeSeq(dumpid, tapeSeq, teptr) tl.budb_tapeList_len = 0; tl.budb_tapeList_val = 0; - code = ubik_Call( BUDB_GetTapes, udbHandle.uh_client, 0, - BUDB_MAJORVERSION, - BUDB_OP_TAPESEQ|BUDB_OP_DUMPID, - "", dumpid, tapeSeq, 0, &next, &dbTime, &tl); - if (code) ERROR(code); + code = + ubik_Call(BUDB_GetTapes, udbHandle.uh_client, 0, BUDB_MAJORVERSION, + BUDB_OP_TAPESEQ | BUDB_OP_DUMPID, "", dumpid, tapeSeq, 0, + &next, &dbTime, &tl); + if (code) + ERROR(code); if (tl.budb_tapeList_len != 1) ERROR(BC_NOTUNIQUE); /* expecting a single descriptor */ memcpy(teptr, tl.budb_tapeList_val, sizeof(*teptr)); -error_exit: - if ( tl.budb_tapeList_val ) + error_exit: + if (tl.budb_tapeList_val) free(tl.budb_tapeList_val); - return(code); + return (code); } /* bcdb_FindVolumes @@ -411,37 +420,33 @@ bcdb_FindVolumes(dumpID, volumeName, returnArray, last, next, maxa, nEntries) vl.budb_volumeList_val = returnArray; /* outline algorithm */ - code = ubik_Call (BUDB_GetVolumes, udbHandle.uh_client, 0, - BUDB_MAJORVERSION, - BUDB_OP_VOLUMENAME|BUDB_OP_DUMPID, - volumeName, /* name */ - dumpID, /* start */ - 0, /* end */ - last, /* index */ - next, /* nextindex */ - &dbTime, - &vl); - - *nEntries = vl.budb_volumeList_len; - return(code); + code = ubik_Call(BUDB_GetVolumes, udbHandle.uh_client, 0, BUDB_MAJORVERSION, BUDB_OP_VOLUMENAME | BUDB_OP_DUMPID, volumeName, /* name */ + dumpID, /* start */ + 0, /* end */ + last, /* index */ + next, /* nextindex */ + &dbTime, &vl); + + *nEntries = vl.budb_volumeList_len; + return (code); } bcdb_FinishDump(deptr) register struct budb_dumpEntry *deptr; { - afs_int32 code; - code = ubik_Call (BUDB_FinishDump, udbHandle.uh_client, 0, deptr); - return(code); + afs_int32 code; + code = ubik_Call(BUDB_FinishDump, udbHandle.uh_client, 0, deptr); + return (code); } bcdb_FinishTape(teptr) register struct budb_tapeEntry *teptr; { - afs_int32 code; - code = ubik_Call (BUDB_FinishTape, udbHandle.uh_client, 0, teptr); - return(code); - + afs_int32 code; + code = ubik_Call(BUDB_FinishTape, udbHandle.uh_client, 0, teptr); + return (code); + } /* bcdb_LookupVolumes @@ -464,23 +469,18 @@ bcdb_LookupVolume(volumeName, returnArray, last, next, maxa, nEntries) vl.budb_volumeList_val = returnArray; /* outline algorithm */ - code = ubik_Call (BUDB_GetVolumes, udbHandle.uh_client, 0, - BUDB_MAJORVERSION, - BUDB_OP_VOLUMENAME, - volumeName, /* name */ - 0, /* start */ - 0, /* end */ - last, /* index */ - next, /* nextindex */ - &dbTime, - &vl); - if ( code ) - { + code = ubik_Call(BUDB_GetVolumes, udbHandle.uh_client, 0, BUDB_MAJORVERSION, BUDB_OP_VOLUMENAME, volumeName, /* name */ + 0, /* start */ + 0, /* end */ + last, /* index */ + next, /* nextindex */ + &dbTime, &vl); + if (code) { *nEntries = 0; - return(code); + return (code); } *nEntries = vl.budb_volumeList_len; - return(0); + return (0); } @@ -488,9 +488,9 @@ bcdb_UseTape(teptr, newFlag) register struct budb_tapeEntry *teptr; afs_int32 *newFlag; { - afs_int32 code; - code = ubik_Call (BUDB_UseTape, udbHandle.uh_client, 0, teptr, newFlag); - return(code); + afs_int32 code; + code = ubik_Call(BUDB_UseTape, udbHandle.uh_client, 0, teptr, newFlag); + return (code); } @@ -500,7 +500,7 @@ bcdb_UseTape(teptr, newFlag) * The caller should pass in/out a fid for an unlinked, open file to prevent * tampering with the files contents; */ - + /* bcdb_GetTextFile * extract the specified textType and put it in a temporary, local * file. @@ -511,7 +511,7 @@ bcdb_UseTape(teptr, newFlag) bcdb_GetTextFile(register udbClientTextP ctPtr) { afs_int32 bufferSize; - afs_int32 offset, nextOffset, chunkSize; + afs_int32 offset, nextOffset; charListT charList; afs_int32 code = 0; @@ -520,64 +520,65 @@ bcdb_GetTextFile(register udbClientTextP ctPtr) memset((void *)&charList, 0, sizeof(charList)); /* check params and cleanup any previous state */ - if ( ctPtr->lockHandle == 0 ) - ERROR(BUDB_INTERNALERROR); + if (ctPtr->lockHandle == 0) + ERROR(BUDB_INTERNALERROR); - if ( ctPtr->textStream == NULL ) /* Should have an open stream */ - ERROR(BUDB_INTERNALERROR); + if (ctPtr->textStream == NULL) /* Should have an open stream */ + ERROR(BUDB_INTERNALERROR); /* allocate a buffer */ bufferSize = 1024; - charList.charListT_val = (char *) malloc(bufferSize); - if ( charList.charListT_val == 0 ) - ERROR(BUDB_INTERNALERROR); + charList.charListT_val = (char *)malloc(bufferSize); + if (charList.charListT_val == 0) + ERROR(BUDB_INTERNALERROR); charList.charListT_len = bufferSize; offset = 0; nextOffset = 0; ctPtr->textSize = 0; - while ( nextOffset != -1 ) - { + while (nextOffset != -1) { offset = nextOffset; charList.charListT_len = bufferSize; - code = ubik_Call(BUDB_GetText, udbHandle.uh_client, 0, - ctPtr->lockHandle, ctPtr->textType, bufferSize, - offset, &nextOffset, &charList); + code = + ubik_Call(BUDB_GetText, udbHandle.uh_client, 0, ctPtr->lockHandle, + ctPtr->textType, bufferSize, offset, &nextOffset, + &charList); - if ( code ) - ERROR(code); + if (code) + ERROR(code); - code = fwrite(charList.charListT_val, sizeof(char), - charList.charListT_len, ctPtr->textStream); - if ( ferror(ctPtr->textStream) ) - ERROR(BUDB_INTERNALERROR); + code = + fwrite(charList.charListT_val, sizeof(char), + charList.charListT_len, ctPtr->textStream); + if (ferror(ctPtr->textStream)) + ERROR(BUDB_INTERNALERROR); - ctPtr->textSize += charList.charListT_len; + ctPtr->textSize += charList.charListT_len; } /* get text version */ - code = ubik_Call(BUDB_GetTextVersion, udbHandle.uh_client, 0, - ctPtr->textType, &ctPtr->textVersion); - if ( code ) - ERROR(code); + code = + ubik_Call(BUDB_GetTextVersion, udbHandle.uh_client, 0, + ctPtr->textType, &ctPtr->textVersion); + if (code) + ERROR(code); -normal_exit: - fflush(ctPtr->textStream); /* debug */ + normal_exit: + fflush(ctPtr->textStream); /* debug */ /* exit, leaving the configuration text file open */ - if ( charList.charListT_val ) - free(charList.charListT_val); - return(code); - -error_exit: - if ( ctPtr->textStream != NULL ) - { - fclose(ctPtr->textStream); + if (charList.charListT_val) + free(charList.charListT_val); + return (code); + + error_exit: + if (ctPtr->textStream != NULL) { + fclose(ctPtr->textStream); ctPtr->textStream = NULL; } goto normal_exit; } - + /* bcdb_SaveTextFile * save the text file in ubik database @@ -597,14 +598,14 @@ bcdb_SaveTextFile(ctPtr) /* allocate a buffer */ bufferSize = 1024; - charList.charListT_val = (char *) malloc(bufferSize); - if ( charList.charListT_val == 0 ) - ERROR(BUDB_INTERNALERROR); + charList.charListT_val = (char *)malloc(bufferSize); + if (charList.charListT_val == 0) + ERROR(BUDB_INTERNALERROR); charList.charListT_len = bufferSize; - if ( ctPtr->textStream == NULL ) - ERROR(BUDB_INTERNALERROR); - rewind(ctPtr->textStream); + if (ctPtr->textStream == NULL) + ERROR(BUDB_INTERNALERROR); + rewind(ctPtr->textStream); fileSize = (afs_int32) filesize(ctPtr->textStream); @@ -613,64 +614,67 @@ bcdb_SaveTextFile(ctPtr) rewind(ctPtr->textStream); /* special case empty files */ - if ( fileSize == 0 ) - { - charList.charListT_len = 0; - code = ubik_Call(BUDB_SaveText, udbHandle.uh_client, 0, - ctPtr->lockHandle, ctPtr->textType, 0, - BUDB_TEXT_COMPLETE, &charList); + if (fileSize == 0) { + charList.charListT_len = 0; + code = + ubik_Call(BUDB_SaveText, udbHandle.uh_client, 0, + ctPtr->lockHandle, ctPtr->textType, 0, + BUDB_TEXT_COMPLETE, &charList); goto error_exit; } offset = 0; - while ( fileSize != 0 ) - { + while (fileSize != 0) { chunkSize = MIN(fileSize, bufferSize); - code = fread(charList.charListT_val, sizeof(char), chunkSize, - ctPtr->textStream); + code = + fread(charList.charListT_val, sizeof(char), chunkSize, + ctPtr->textStream); - if ( code != chunkSize ) - printf("code = %d\n", code ); - if ( ferror(ctPtr->textStream ) ) - ERROR(BUDB_INTERNALERROR); + if (code != chunkSize) + printf("code = %d\n", code); + if (ferror(ctPtr->textStream)) + ERROR(BUDB_INTERNALERROR); charList.charListT_len = chunkSize; - code = ubik_Call(BUDB_SaveText, udbHandle.uh_client, 0, - ctPtr->lockHandle, ctPtr->textType, offset, - (chunkSize == fileSize) ? BUDB_TEXT_COMPLETE: 0, - &charList); - if ( code ) - ERROR(code); + code = + ubik_Call(BUDB_SaveText, udbHandle.uh_client, 0, + ctPtr->lockHandle, ctPtr->textType, offset, + (chunkSize == fileSize) ? BUDB_TEXT_COMPLETE : 0, + &charList); + if (code) + ERROR(code); fileSize -= chunkSize; offset += chunkSize; } - -error_exit: + + error_exit: /* if ( ctPtr->textStream >= 0 ) - close(ctPtr->textStream); */ - if ( charList.charListT_val ) - free(charList.charListT_val); - return(code); + * close(ctPtr->textStream); */ + if (charList.charListT_val) + free(charList.charListT_val); + return (code); } bcdb_FindLastTape(dumpID, dumpEntry, tapeEntry, volEntry) - afs_int32 dumpID; - struct budb_dumpEntry *dumpEntry; - struct budb_tapeEntry *tapeEntry; - struct budb_volumeEntry *volEntry; + afs_int32 dumpID; + struct budb_dumpEntry *dumpEntry; + struct budb_tapeEntry *tapeEntry; + struct budb_volumeEntry *volEntry; { - return( ubik_Call(BUDB_FindLastTape,udbHandle.uh_client,0, - dumpID,dumpEntry,tapeEntry,volEntry) ); + return (ubik_Call + (BUDB_FindLastTape, udbHandle.uh_client, 0, dumpID, dumpEntry, + tapeEntry, volEntry)); } bcdb_MakeDumpAppended(appendedDumpID, initialDumpID, startTapeSeq) - afs_int32 appendedDumpID; - afs_int32 initialDumpID; - afs_int32 startTapeSeq; + afs_int32 appendedDumpID; + afs_int32 initialDumpID; + afs_int32 startTapeSeq; { - return( ubik_Call(BUDB_MakeDumpAppended,udbHandle.uh_client,0, - appendedDumpID,initialDumpID,startTapeSeq) ); + return (ubik_Call + (BUDB_MakeDumpAppended, udbHandle.uh_client, 0, appendedDumpID, + initialDumpID, startTapeSeq)); } @@ -687,10 +691,10 @@ filesize(stream) afs_int32 size; offset = ftell(stream); - fseek(stream, (afs_int32) 0, 2); /* end of file */ + fseek(stream, (afs_int32) 0, 2); /* end of file */ size = ftell(stream); fseek(stream, offset, 0); - return(size); + return (size); } @@ -715,21 +719,25 @@ bc_LockText(ctPtr) afs_int32 code; afs_int32 timeout, j = 0; - if (ctPtr->lockHandle != 0) return(1); /* already locked */ + if (ctPtr->lockHandle != 0) + return (1); /* already locked */ - timeout = ( (ctPtr->textSize == 0) ? 30 : ((ctPtr->textSize/50000) + 10) ); + timeout = + ((ctPtr->textSize == 0) ? 30 : ((ctPtr->textSize / 50000) + 10)); while (1) { - code = ubik_Call(BUDB_GetLock, udbHandle.uh_client, 0, - udbHandle.uh_instanceId, ctPtr->textType, timeout, - &ctPtr->lockHandle); - if ( (code != BUDB_LOCKED) && (code != BUDB_SELFLOCKED) ) { + code = + ubik_Call(BUDB_GetLock, udbHandle.uh_client, 0, + udbHandle.uh_instanceId, ctPtr->textType, timeout, + &ctPtr->lockHandle); + if ((code != BUDB_LOCKED) && (code != BUDB_SELFLOCKED)) { break; } /* Mention something every 30 seconds */ if (++j >= 30) { - com_err(whoami, code,"; Waiting for db configuration text unlock"); + com_err(whoami, code, + "; Waiting for db configuration text unlock"); j = 0; } #ifdef AFS_PTHREAD_ENV @@ -740,8 +748,9 @@ bc_LockText(ctPtr) } /* cleanup */ - if (code) ctPtr->lockHandle = 0; - return(code); + if (code) + ctPtr->lockHandle = 0; + return (code); } /* bc_UnlockText @@ -758,14 +767,15 @@ bc_UnlockText(ctPtr) { afs_int32 code = 0; - if ( ctPtr->lockHandle == 0 ) - return(0); + if (ctPtr->lockHandle == 0) + return (0); - code = ubik_Call(BUDB_FreeLock, udbHandle.uh_client, 0, ctPtr->lockHandle); + code = + ubik_Call(BUDB_FreeLock, udbHandle.uh_client, 0, ctPtr->lockHandle); ctPtr->lockHandle = 0; - + /* Don't try to analyse the error. Let the lock timeout */ - return(code); + return (code); } /* bc_CheckTextVersion @@ -780,18 +790,19 @@ bc_CheckTextVersion(ctPtr) afs_int32 code; afs_uint32 tversion; - if ( ctPtr->textVersion == -1 ) - return(BC_VERSIONMISMATCH); - - code = ubik_Call(BUDB_GetTextVersion, udbHandle.uh_client, 0, - ctPtr->textType, &tversion); - if ( code ) - return(code); - if ( tversion != ctPtr->textVersion ) - return(BC_VERSIONMISMATCH); - return(0); + if (ctPtr->textVersion == -1) + return (BC_VERSIONMISMATCH); + + code = + ubik_Call(BUDB_GetTextVersion, udbHandle.uh_client, 0, + ctPtr->textType, &tversion); + if (code) + return (code); + if (tversion != ctPtr->textVersion) + return (BC_VERSIONMISMATCH); + return (0); } - + /* ------------------------------------- * initialization routines * ------------------------------------- @@ -801,123 +812,115 @@ bc_CheckTextVersion(ctPtr) * Initialize a client for the vl ubik database. */ vldbClientInit(noAuthFlag, localauth, cellName, cstruct, ttoken) - int noAuthFlag; - int localauth; - char *cellName; + int noAuthFlag; + int localauth; + char *cellName; struct ubik_client **cstruct; - struct ktc_token *ttoken; + struct ktc_token *ttoken; { - afs_int32 code = 0; - struct afsconf_dir *acdir; + afs_int32 code = 0; + struct afsconf_dir *acdir; struct rc_securityClass *sc; - afs_int32 i, scIndex = 0; /* Index of Rx security object - noauth */ - struct afsconf_cell info; - struct ktc_principal sname; - struct rx_connection *serverconns[VLDB_MAXSERVERS]; + afs_int32 i, scIndex = 0; /* Index of Rx security object - noauth */ + struct afsconf_cell info; + struct ktc_principal sname; + struct rx_connection *serverconns[VLDB_MAXSERVERS]; /* Find out about the given cell */ - acdir = afsconf_Open((localauth ? AFSDIR_SERVER_ETC_DIRPATH : - AFSDIR_CLIENT_ETC_DIRPATH)); - if (!acdir) - { - com_err(whoami,0,"Can't open configuration directory '%s'", - (localauth ? AFSDIR_SERVER_ETC_DIRPATH : + acdir = + afsconf_Open((localauth ? AFSDIR_SERVER_ETC_DIRPATH : + AFSDIR_CLIENT_ETC_DIRPATH)); + if (!acdir) { + com_err(whoami, 0, "Can't open configuration directory '%s'", + (localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH)); ERROR(BC_NOCELLCONFIG); } - if (!cellName[0]) - { - char cname[64]; + if (!cellName[0]) { + char cname[64]; - code = afsconf_GetLocalCell(acdir, cname, sizeof(cname)); - if (code) - { - com_err(whoami, code, "; Can't get the local cell name - check %s/%s", (localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH), - AFSDIR_THISCELL_FILE); + code = afsconf_GetLocalCell(acdir, cname, sizeof(cname)); + if (code) { + com_err(whoami, code, + "; Can't get the local cell name - check %s/%s", + (localauth ? AFSDIR_SERVER_ETC_DIRPATH : + AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_THISCELL_FILE); ERROR(code); } strcpy(cellName, cname); } code = afsconf_GetCellInfo(acdir, cellName, AFSCONF_VLDBSERVICE, &info); - if (code) - { - com_err(whoami, code, "; Can't find cell %s's hosts in %s/%s", - cellName, (localauth ? AFSDIR_SERVER_ETC_DIRPATH : - AFSDIR_CLIENT_ETC_DIRPATH), - AFSDIR_CELLSERVDB_FILE); - ERROR(BC_NOCELLCONFIG); + if (code) { + com_err(whoami, code, "; Can't find cell %s's hosts in %s/%s", + cellName, + (localauth ? AFSDIR_SERVER_ETC_DIRPATH : + AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_CELLSERVDB_FILE); + ERROR(BC_NOCELLCONFIG); } /* * Grab tickets if we care about authentication. */ ttoken->endTime = 0; - if (localauth) - { - code = afsconf_GetLatestKey (acdir, 0, 0); - if (code) - { + if (localauth) { + code = afsconf_GetLatestKey(acdir, 0, 0); + if (code) { com_err(whoami, code, "; Can't get key from local key file"); ERROR(code); - } - else - { + } else { code = afsconf_ClientAuth(acdir, &sc, &scIndex); - if (code) - { + if (code) { com_err(whoami, code, "; Calling ClientAuth"); ERROR(code); } ttoken->endTime = NEVERDATE; } - } - else - { - if (!noAuthFlag) - { + } else { + if (!noAuthFlag) { strcpy(sname.cell, info.name); sname.instance[0] = 0; strcpy(sname.name, "afs"); - code = ktc_GetToken(&sname, ttoken, sizeof(struct ktc_token), (char *)0); - if (code) - { - com_err(whoami,code, 0,"; Can't get AFS tokens - running unauthenticated"); - } - else - { - if ( (ttoken->kvno < 0) || (ttoken->kvno > 255) ) - com_err(whoami, 0, "Funny kvno (%d) in ticket, proceeding", ttoken->kvno); - + code = + ktc_GetToken(&sname, ttoken, sizeof(struct ktc_token), NULL); + if (code) { + com_err(whoami, code, 0, + "; Can't get AFS tokens - running unauthenticated"); + } else { + if ((ttoken->kvno < 0) || (ttoken->kvno > 255)) + com_err(whoami, 0, + "Funny kvno (%d) in ticket, proceeding", + ttoken->kvno); + scIndex = 2; } } - - switch (scIndex) - { - case 0: - sc = (struct rx_securityClass *) rxnull_NewClientSecurityObject(); - break; - case 2: - sc = (struct rx_securityClass *) - rxkad_NewClientSecurityObject(rxkad_clear, &ttoken->sessionKey, - ttoken->kvno, ttoken->ticketLen, + + switch (scIndex) { + case 0: + sc = rxnull_NewClientSecurityObject(); + break; + case 2: + sc = (struct rx_securityClass *) + rxkad_NewClientSecurityObject(rxkad_clear, + &ttoken->sessionKey, + ttoken->kvno, ttoken->ticketLen, ttoken->ticket); - break; - default: - com_err(whoami, 0, "Unsupported authentication type %d", scIndex); - ERROR(-1); - break; + break; + default: + com_err(whoami, 0, "Unsupported authentication type %d", scIndex); + ERROR(-1); + break; } } - if (!sc) - { - com_err(whoami, 0, "Can't create a security object with security index %d", + if (!sc) { + com_err(whoami, 0, + "Can't create a security object with security index %d", scIndex); ERROR(-1); } @@ -925,31 +928,31 @@ vldbClientInit(noAuthFlag, localauth, cellName, cstruct, ttoken) /* tell UV module about default authentication */ UV_SetSecurity(sc, scIndex); - if (info.numServers > VLDB_MAXSERVERS) - { - com_err(whoami, 0, - "Warning: %d VLDB servers exist for cell '%s', can only remember the first %d", + if (info.numServers > VLDB_MAXSERVERS) { + com_err(whoami, 0, + "Warning: %d VLDB servers exist for cell '%s', can only remember the first %d", info.numServers, cellName, VLDB_MAXSERVERS); info.numServers = VLDB_MAXSERVERS; } - for (i=0; i 255)) - com_err(whoami, 0, "Unexpected kvno (%d) in ticket - proceeding", + code = ktc_GetToken(&principal, &token, sizeof(token), NULL); + if (code) { + com_err(whoami, code, + "; Can't get tokens - running unauthenticated"); + } else { + if ((token.kvno < 0) || (token.kvno > 255)) + com_err(whoami, 0, + "Unexpected kvno (%d) in ticket - proceeding", token.kvno); - udbHandle.uh_scIndex = RX_SCINDEX_KAD; /* Kerberos */ + udbHandle.uh_scIndex = RX_SCINDEX_KAD; /* Kerberos */ } } - switch (udbHandle.uh_scIndex) - { - case 0: - udbHandle.uh_secobj = (struct rx_securityClass *) rxnull_NewClientSecurityObject(); - break; - - case 2: - udbHandle.uh_secobj = (struct rx_securityClass *) + switch (udbHandle.uh_scIndex) { + case 0: + udbHandle.uh_secobj = rxnull_NewClientSecurityObject(); + break; + + case 2: + udbHandle.uh_secobj = (struct rx_securityClass *) rxkad_NewClientSecurityObject(rxkad_clear, &token.sessionKey, token.kvno, token.ticketLen, token.ticket); - break; + break; - default: - com_err(whoami, 0, "Unsupported authentication type %d", udbHandle.uh_scIndex ); - ERROR(-1); - break; + default: + com_err(whoami, 0, "Unsupported authentication type %d", + udbHandle.uh_scIndex); + ERROR(-1); + break; } } - if (!udbHandle.uh_secobj) - { - com_err(whoami, 0, "Can't create a security object with security index %d", + if (!udbHandle.uh_secobj) { + com_err(whoami, 0, + "Can't create a security object with security index %d", udbHandle.uh_secobj); ERROR(-1); } - if (info.numServers > MAXSERVERS) - { - com_err(whoami,0, - "Warning: %d BDB servers exist for cell '%s', can only remember the first %d", + if (info.numServers > MAXSERVERS) { + com_err(whoami, 0, + "Warning: %d BDB servers exist for cell '%s', can only remember the first %d", info.numServers, cellName, MAXSERVERS); info.numServers = MAXSERVERS; } /* establish connections to the servers. Check for failed connections? */ for (i = 0; i < info.numServers; i++) { - udbHandle.uh_serverConn[i] = rx_NewConnection(info.hostAddr[i].sin_addr.s_addr, - htons(AFSCONF_BUDBPORT), - BUDB_SERVICE, - udbHandle.uh_secobj, - udbHandle.uh_scIndex); + udbHandle.uh_serverConn[i] = + rx_NewConnection(info.hostAddr[i].sin_addr.s_addr, + htons(AFSCONF_BUDBPORT), BUDB_SERVICE, + udbHandle.uh_secobj, udbHandle.uh_scIndex); } udbHandle.uh_serverConn[i] = 0; code = ubik_ClientInit(udbHandle.uh_serverConn, &udbHandle.uh_client); if (code) { - com_err(whoami,code,"; Can't initialize ubik connection to backup database"); + com_err(whoami, code, + "; Can't initialize ubik connection to backup database"); ERROR(code); } /* Try to quickly find a good site by setting deadtime low */ for (i = 0; i < info.numServers; i++) rx_SetConnDeadTime(udbHandle.uh_client->conns[i], 1); - code = ubik_Call(BUDB_GetInstanceId, udbHandle.uh_client, 0, &udbHandle.uh_instanceId); + code = + ubik_Call(BUDB_GetInstanceId, udbHandle.uh_client, 0, + &udbHandle.uh_instanceId); /* Reset dead time back up to default */ for (i = 0; i < info.numServers; i++) - rx_SetConnDeadTime(udbHandle.uh_client->conns[i], 60); + rx_SetConnDeadTime(udbHandle.uh_client->conns[i], 60); /* If did not find a site on first quick pass, try again */ if (code == -1) - code = ubik_Call(BUDB_GetInstanceId, udbHandle.uh_client, 0, &udbHandle.uh_instanceId); + code = + ubik_Call(BUDB_GetInstanceId, udbHandle.uh_client, 0, + &udbHandle.uh_instanceId); if (code) { - com_err(whoami,code,"; Can't access backup database"); + com_err(whoami, code, "; Can't access backup database"); ERROR(code); } -error_exit: - if (acdir) afsconf_Close(acdir); - return(code); + error_exit: + if (acdir) + afsconf_Close(acdir); + return (code); } /* ------------------------------------- @@ -1140,12 +1137,11 @@ error_exit: * 4) if the vanilla ubik_Call is ever modified, the END_SINGLESERVER * flag can be discarded. The first call without SINGLESERVER set * can clean up the state. - */ + */ -struct ubikCallState -{ - afs_int32 ucs_flags; /* state flags */ - afs_int32 ucs_selectedServer; /* which server selected */ +struct ubikCallState { + afs_int32 ucs_flags; /* state flags */ + afs_int32 ucs_selectedServer; /* which server selected */ }; static struct ubikCallState uServer; @@ -1161,11 +1157,13 @@ static struct ubikCallState uServer; */ afs_int32 -ubik_Call_SingleServer(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16) - register struct ubik_client *aclient; - int (*aproc)(); - afs_int32 aflags; - char *p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8, *p9, *p10, *p11, *p12, *p13, *p14, *p15, *p16; +ubik_Call_SingleServer(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, + p9, p10, p11, p12, p13, p14, p15, p16) + register struct ubik_client *aclient; + int (*aproc) (); + afs_int32 aflags; + char *p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8, *p9, *p10, *p11, *p12, *p13, + *p14, *p15, *p16; { register afs_int32 code; afs_int32 someCode, newHost, thisHost; @@ -1176,30 +1174,25 @@ ubik_Call_SingleServer(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p struct rx_connection *tc; struct rx_peer *rxp; - if ( (aflags & (UF_SINGLESERVER | UF_END_SINGLESERVER)) != 0 ) - { - if ( ((aflags & UF_SINGLESERVER) != 0 ) - && ((uServer.ucs_flags & UF_SINGLESERVER ) != 0) - ) - { - + if ((aflags & (UF_SINGLESERVER | UF_END_SINGLESERVER)) != 0) { + if (((aflags & UF_SINGLESERVER) != 0) + && ((uServer.ucs_flags & UF_SINGLESERVER) != 0) + ) { + /* have a selected server */ tc = aclient->conns[uServer.ucs_selectedServer]; - - code = (*aproc)(tc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, - p12, p13, p14, p15, p16); - if ( code ) - { + + code = + (*aproc) (tc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, + p12, p13, p14, p15, p16); + if (code) { /* error. Clean up single server state */ memset(&uServer, 0, sizeof(uServer)); } - return(code); - } - else - if ( (aflags & UF_END_SINGLESERVER) != 0 ) - { + return (code); + } else if ((aflags & UF_END_SINGLESERVER) != 0) { memset(&uServer, 0, sizeof(uServer)); - return(0); + return (0); } } @@ -1207,26 +1200,26 @@ ubik_Call_SingleServer(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p chaseCount = 0; pass = 0; count = 0; - while(1) - { /*w*/ + while (1) { /*w */ /* tc is the next conn to try */ tc = aclient->conns[count]; - if ( tc == 0 ) - { - if (pass == 0) { + if (tc == 0) { + if (pass == 0) { pass = 1; /* in pass 1, we look at down hosts, too */ - count = 0; + count = 0; continue; - } - else break; /* nothing left to try */ + } else + break; /* nothing left to try */ } if (pass == 0 && (aclient->states[count] & CFLastFailed)) { count++; - continue; /* this guy's down, try someone else first */ + continue; /* this guy's down, try someone else first */ } - code = (*aproc)(tc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16); + code = + (*aproc) (tc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, + p13, p14, p15, p16); /* note that getting a UNOTSYNC error code back does *not* guarantee * that there is a sync site yet elected. However, if there is a @@ -1234,53 +1227,47 @@ ubik_Call_SingleServer(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p * requires a sync site, ubik will return UNOTSYNC, indicating the * operation won't work until you find a sync site */ - if (code == UNOTSYNC) - { /*ns*/ + if (code == UNOTSYNC) { /*ns */ /* means that this requires a sync site to work */ someCode = code; /* remember an error, if this fails */ /* now see if we can find the sync site host */ code = VOTE_GetSyncSite(tc, &newHost); if (code == 0 && newHost != 0) { - newHost = htonl(newHost); /* convert back to network order */ + newHost = htonl(newHost); /* convert back to network order */ /* position count at the appropriate slot in the client * structure and retry. If we can't find in slot, we'll just * continue through the whole list - */ - for(i=0;iconns[i]); if (!(thisHost = rx_HostOf(rxp))) { - count++; /* host not found, try the next dude */ + count++; /* host not found, try the next dude */ break; } - if (thisHost == newHost) - { + if (thisHost == newHost) { /* avoid asking in a loop */ - if (chaseCount++ > 2) - break; - count = i; /* we were told to use this one */ + if (chaseCount++ > 2) + break; + count = i; /* we were told to use this one */ break; } - } /*f*/ - } - else count++; /* not directed, keep looking for a sync site */ + } /*f */ + } else + count++; /* not directed, keep looking for a sync site */ continue; - } /*ns*/ - else if (code == UNOQUORUM) { /* this guy is still recovering */ + } /*ns */ + else if (code == UNOQUORUM) { /* this guy is still recovering */ someCode = code; count++; continue; - } - else if (code < 0) { /* network errors */ + } else if (code < 0) { /* network errors */ someCode = code; aclient->states[count] |= CFLastFailed; count++; continue; - } - else - { + } else { /* ok, operation worked */ aclient->states[count] &= ~CFLastFailed; /* either misc ubik code, or misc application code (incl success) @@ -1289,22 +1276,21 @@ ubik_Call_SingleServer(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p /* if the call succeeded, setup connection state for subsequent * calls */ - if ( (code == 0) - && (aflags & UF_SINGLESERVER != 0) - ) - { + if ((code == 0) + && ((aflags & UF_SINGLESERVER) != 0) + ) { /* need to save state */ uServer.ucs_flags = UF_SINGLESERVER; uServer.ucs_selectedServer = count; } - + return code; - } - } /*w*/ + } + } /*w */ return someCode; } - + /* ------------------------------------- * debug and test routines * ------------------------------------- @@ -1329,52 +1315,48 @@ udbLocalInit() /* get our host name */ gethostname(hostname, sizeof(hostname)); /* strcpy(hostname, "hops"); */ - + args[0] = ""; args[1] = "-servers"; args[2] = hostname; code = ubik_ParseClientList(3, args, serverList); - if ( code ) - { + if (code) { com_err(whoami, code, "; udbLocalInit: parsing ubik server list"); - return(-1); + return (-1); } udbHandle.uh_scIndex = RX_SCINDEX_NULL; - udbHandle.uh_secobj = (struct rx_securityClass *) - rxnull_NewClientSecurityObject(); - - for ( i = 0; serverList[i] != 0; i++ ) - { - udbHandle.uh_serverConn[i] = rx_NewConnection (serverList[i], - htons(AFSCONF_BUDBPORT), - BUDB_SERVICE, - udbHandle.uh_secobj, - udbHandle.uh_scIndex); - if ( udbHandle.uh_serverConn[i] == 0 ) - { + udbHandle.uh_secobj = (struct rx_securityClass *) + rxnull_NewClientSecurityObject(); + + for (i = 0; serverList[i] != 0; i++) { + udbHandle.uh_serverConn[i] = + rx_NewConnection(serverList[i], htons(AFSCONF_BUDBPORT), + BUDB_SERVICE, udbHandle.uh_secobj, + udbHandle.uh_scIndex); + if (udbHandle.uh_serverConn[i] == 0) { com_err(whoami, 0, "connection %d failed", i); continue; } } udbHandle.uh_serverConn[i] = 0; code = ubik_ClientInit(udbHandle.uh_serverConn, &udbHandle.uh_client); - if ( code ) - { + if (code) { com_err(whoami, code, "; in ubik_ClientInit"); - return(code); + return (code); } - code = ubik_Call(BUDB_GetInstanceId, udbHandle.uh_client, 0, &udbHandle.uh_instanceId); - if ( code ) - { + code = + ubik_Call(BUDB_GetInstanceId, udbHandle.uh_client, 0, + &udbHandle.uh_instanceId); + if (code) { com_err(whoami, code, "; Can't estblish instance Id"); - return(code); + return (code); } -abort: - return(0); + /* abort: */ + return (0); } /* bc_openTextFile - This function opens a temp file to read in the @@ -1391,42 +1373,42 @@ abort: * !0: error code * 0: Success. */ -int bc_openTextFile(udbClientTextP ctPtr, char *tmpFileName) +int +bc_openTextFile(udbClientTextP ctPtr, char *tmpFileName) { - int code = 0; + int code = 0; - if ( ctPtr->textStream != NULL ) - fclose(ctPtr->textStream); - - sprintf(tmpFileName, "%s/bu_XXXXXX", gettmpdir()); + if (ctPtr->textStream != NULL) + fclose(ctPtr->textStream); + + sprintf(tmpFileName, "%s/bu_XXXXXX", gettmpdir()); #ifdef AFS_LINUX20_ENV - mkstemp(tmpFileName); + mkstemp(tmpFileName); #else - mktemp(tmpFileName); + mktemp(tmpFileName); #endif - ctPtr->textStream = fopen(tmpFileName, "w+"); - if ( ctPtr->textStream == NULL ) - ERROR(BUDB_INTERNALERROR); - -#ifndef AFS_NT40_ENV /* This can't be done on NT */ - /* make the file invisible to others */ - code = unlink(tmpFileName); - if ( code ) - ERROR(errno); + ctPtr->textStream = fopen(tmpFileName, "w+"); + if (ctPtr->textStream == NULL) + ERROR(BUDB_INTERNALERROR); + +#ifndef AFS_NT40_ENV /* This can't be done on NT */ + /* make the file invisible to others */ + code = unlink(tmpFileName); + if (code) + ERROR(errno); #endif - - dprintf(("file is %s\n", tmpFileName)); -normal_exit: - return code; + dprintf(("file is %s\n", tmpFileName)); -error_exit: - if ( ctPtr->textStream != NULL ) - { - fclose(ctPtr->textStream); - ctPtr->textStream = NULL; + normal_exit: + return code; + + error_exit: + if (ctPtr->textStream != NULL) { + fclose(ctPtr->textStream); + ctPtr->textStream = NULL; } - goto normal_exit; + goto normal_exit; } @@ -1438,17 +1420,18 @@ error_exit: * 0 - Success * !0 - error code */ -int bc_closeTextFile(udbClientTextP ctPtr, char *tmpFileName) +int +bc_closeTextFile(udbClientTextP ctPtr, char *tmpFileName) { - int code = 0; + int code = 0; - if (ctPtr->textStream) - fclose(ctPtr->textStream); + if (ctPtr->textStream) + fclose(ctPtr->textStream); - if (*tmpFileName) { /* we have a valid name */ - code = unlink(tmpFileName); - if (code < 0) - code = errno; - } - return code; + if (*tmpFileName) { /* we have a valid name */ + code = unlink(tmpFileName); + if (code < 0) + code = errno; + } + return code; } diff --git a/src/bucoord/vol_sets.c b/src/bucoord/vol_sets.c index 2a495edc5..1f1b6a708 100644 --- a/src/bucoord/vol_sets.c +++ b/src/bucoord/vol_sets.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/vol_sets.c,v 1.1.1.7 2001/09/11 14:31:40 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/vol_sets.c,v 1.10 2003/12/07 22:49:19 jaltman Exp $"); #include #include @@ -39,6 +40,8 @@ extern struct bc_config *bc_globalConfig; extern struct udbHandleS udbHandle; extern char *whoami; extern struct bc_volumeSet *bc_FindVolumeSet(struct bc_config *cf, char *name); +extern void FreeVolumeSet(struct bc_volumeSet *avset); + /* ------------------------------------ * command level routines @@ -63,56 +66,59 @@ bc_AddVolEntryCmd(as, arock) char *volSetName, *serverName, *partitionName, *volRegExp; udbClientTextP ctPtr; struct bc_volumeSet *tset; - afs_int32 flags; - volSetName = as->parms[0].items->data; - serverName = as->parms[1].items->data; + volSetName = as->parms[0].items->data; + serverName = as->parms[1].items->data; partitionName = as->parms[2].items->data; - volRegExp = as->parms[3].items->data; + volRegExp = as->parms[3].items->data; code = bc_UpdateVolumeSet(); if (code) { com_err(whoami, code, "; Can't retrieve volume sets"); - return(code); + return (code); } ctPtr = &bc_globalConfig->configText[TB_VOLUMESET]; tset = bc_FindVolumeSet(bc_globalConfig, volSetName); if (!tset) { - com_err(whoami, code, "; Volume entry not added"); - ERROR(code); + com_err(whoami, code, "; Volume entry not added"); + ERROR(code); } if (!(tset->flags & VSFLAG_TEMPORARY)) { - code = bc_LockText(ctPtr); - if (code) ERROR(code); + code = bc_LockText(ctPtr); + if (code) + ERROR(code); } code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); - return(code); + com_err(whoami, code, "; Can't retrieve volume sets"); + return (code); } - code = bc_AddVolumeItem(bc_globalConfig, volSetName, serverName, - partitionName, volRegExp); + code = + bc_AddVolumeItem(bc_globalConfig, volSetName, serverName, + partitionName, volRegExp); if (code) { com_err(whoami, code, "; Volume entry not added"); ERROR(code); } if (!(tset->flags & VSFLAG_TEMPORARY)) { - code = bc_SaveVolumeSet(); - if (code) { - com_err(whoami, code, "Cannot save volume set file"); - com_err(whoami,0,"Changes are temporary - for this session only"); - } + code = bc_SaveVolumeSet(); + if (code) { + com_err(whoami, code, "Cannot save volume set file"); + com_err(whoami, 0, + "Changes are temporary - for this session only"); + } } -error_exit: - if (ctPtr->lockHandle) bc_UnlockText(ctPtr); - return(code); + error_exit: + if (ctPtr->lockHandle) + bc_UnlockText(ctPtr); + return (code); } @@ -124,9 +130,10 @@ error_exit: * name of new volume set */ -afs_int32 bc_AddVolSetCmd(as, arock) +afs_int32 +bc_AddVolSetCmd(as, arock) struct cmd_syndesc *as; - char *arock; + char *arock; { /* parm 0 is vol set name */ register afs_int32 code; @@ -141,35 +148,39 @@ afs_int32 bc_AddVolSetCmd(as, arock) /* Don't lock if adding a temporary volumeset */ if (!(flags & VSFLAG_TEMPORARY)) { - code = bc_LockText(ctPtr); - if (code) ERROR(code); + code = bc_LockText(ctPtr); + if (code) + ERROR(code); } code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); - return(code); + com_err(whoami, code, "; Can't retrieve volume sets"); + return (code); } /* validate size of volumeset name */ - code = bc_CreateVolumeSet(bc_globalConfig, (ti=as->parms[0].items)->data, flags); + code = + bc_CreateVolumeSet(bc_globalConfig, (ti = as->parms[0].items)->data, + flags); if (code) { if (code == -1) - com_err(whoami,0,"Volume set '%s' already exists", ti->data); - else com_err(whoami,0,"Unknown problem"); - } - else if (!(flags & VSFLAG_TEMPORARY)) { + com_err(whoami, 0, "Volume set '%s' already exists", ti->data); + else + com_err(whoami, 0, "Unknown problem"); + } else if (!(flags & VSFLAG_TEMPORARY)) { code = bc_SaveVolumeSet(); if (code) { com_err(whoami, code, "Cannot save new volume set file"); - com_err(whoami,0,"Changes are temporary - for this session only"); + com_err(whoami, 0, + "Changes are temporary - for this session only"); } } -error_exit: - if ( ctPtr->lockHandle != 0 ) - bc_UnlockText(ctPtr); - return(code); + error_exit: + if (ctPtr->lockHandle != 0) + bc_UnlockText(ctPtr); + return (code); } @@ -179,8 +190,9 @@ error_exit: * parm 0 is vol set name * parm 1 is entry # (integer, 1 based) */ - -afs_int32 bc_DeleteVolEntryCmd(as, arock) + +afs_int32 +bc_DeleteVolEntryCmd(as, arock) struct cmd_syndesc *as; char *arock; { @@ -194,8 +206,8 @@ afs_int32 bc_DeleteVolEntryCmd(as, arock) code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); - return(code); + com_err(whoami, code, "; Can't retrieve volume sets"); + return (code); } /* lock schedules and check validity */ @@ -203,35 +215,39 @@ afs_int32 bc_DeleteVolEntryCmd(as, arock) tset = bc_FindVolumeSet(bc_globalConfig, vsname); if (!tset) { - com_err(whoami,0,"No such volume set as '%s'", vsname); - ERROR(code); + com_err(whoami, 0, "No such volume set as '%s'", vsname); + ERROR(code); } if (!(tset->flags & VSFLAG_TEMPORARY)) { - code = bc_LockText(ctPtr); - if (code) ERROR(code); + code = bc_LockText(ctPtr); + if (code) + ERROR(code); } code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); - return(code); + com_err(whoami, code, "; Can't retrieve volume sets"); + return (code); } entry = bc_SafeATOI(as->parms[1].items->data); if (entry < 0) { - com_err(whoami,0,"Can't parse entry number '%s' as decimal integer", - as->parms[1].items->data); + com_err(whoami, 0, "Can't parse entry number '%s' as decimal integer", + as->parms[1].items->data); ERROR(BC_BADARG); } code = bc_DeleteVolumeItem(bc_globalConfig, vsname, entry); if (code) { - if (code == -1) { - com_err(whoami,0,"No such volume set as '%s'", vsname); + if (code == -1) { + com_err(whoami, 0, "No such volume set as '%s'", vsname); } else if (code == -2) { - com_err(whoami,0,"There aren't %d volume items for this volume set", entry); - com_err(whoami,0,"Use the 'listvolsets' command to examine the volume set"); + com_err(whoami, 0, + "There aren't %d volume items for this volume set", + entry); + com_err(whoami, 0, + "Use the 'listvolsets' command to examine the volume set"); } ERROR(code); } @@ -243,14 +259,15 @@ afs_int32 bc_DeleteVolEntryCmd(as, arock) entry, vsname); } else { com_err(whoami, code, "Cannot save volume set file"); - com_err(whoami,0,"Deletion is temporary - for this session only"); + com_err(whoami, 0, + "Deletion is temporary - for this session only"); } } -error_exit: - if ( ctPtr->lockHandle != 0 ) - bc_UnlockText(ctPtr); - return(code); + error_exit: + if (ctPtr->lockHandle != 0) + bc_UnlockText(ctPtr); + return (code); } @@ -263,69 +280,77 @@ error_exit: * name of volumeset to delete */ -afs_int32 bc_DeleteVolSetCmd(as, arock) +afs_int32 +bc_DeleteVolSetCmd(as, arock) struct cmd_syndesc *as; - char *arock; + char *arock; { /* parm 0 is vol set name */ register afs_int32 code; register struct cmd_item *ti; udbClientTextP ctPtr; afs_int32 c; - afs_int32 flags, tosave=0; + afs_int32 flags, tosave = 0; - /* lock schedules and check validity */ + /* lock schedules and check validity */ ctPtr = &bc_globalConfig->configText[TB_VOLUMESET]; code = bc_LockText(ctPtr); - if (code) ERROR(code); + if (code) + ERROR(code); code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); - return(code); + com_err(whoami, code, "; Can't retrieve volume sets"); + return (code); } - for(ti=as->parms[0].items; ti; ti=ti->next) { + for (ti = as->parms[0].items; ti; ti = ti->next) { code = bc_DeleteVolumeSet(bc_globalConfig, ti->data, &flags); if (code) { - if (code == -1) - com_err(whoami,0,"Can't find volume set '%s'", ti->data); - else - com_err(whoami, code, "; Unknown problem deleting volume set '%s'", ti->data); + if (code == -1) + com_err(whoami, 0, "Can't find volume set '%s'", ti->data); + else + com_err(whoami, code, + "; Unknown problem deleting volume set '%s'", + ti->data); } else { - if (!(flags & VSFLAG_TEMPORARY)) tosave = 1; + if (!(flags & VSFLAG_TEMPORARY)) + tosave = 1; printf("backup: deleted volume set '%s'\n", ti->data); } } - + /* now write out the file */ if (tosave) { c = bc_SaveVolumeSet(); if (c) { - if (!code) code = c; + if (!code) + code = c; com_err(whoami, c, "Cannot save updated volume set file"); - com_err(whoami,0,"Deletion effective for this session only"); + com_err(whoami, 0, "Deletion effective for this session only"); } } -error_exit: - if (ctPtr->lockHandle) bc_UnlockText(ctPtr); - return(code); + error_exit: + if (ctPtr->lockHandle) + bc_UnlockText(ctPtr); + return (code); } /* bc_ListVolSetCmd - * list out all the information (?) about a volumeset or about all - * volumesets - * entry: - * optional parameter specifies a volumeset name - */ - -afs_int32 bc_ListVolSetCmd(as, arock) + * list out all the information (?) about a volumeset or about all + * volumesets + * entry: + * optional parameter specifies a volumeset name + */ + +afs_int32 +bc_ListVolSetCmd(as, arock) struct cmd_syndesc *as; - char *arock; + char *arock; { /* parm 0 is optional volume set to display */ register struct bc_volumeSet *tset; @@ -334,33 +359,26 @@ afs_int32 bc_ListVolSetCmd(as, arock) code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); - return(code); + com_err(whoami, code, "; Can't retrieve volume sets"); + return (code); } /* figure out volume set to list */ - if (ti=as->parms[0].items) - { - /* for each volume set in the command item list */ - for(; ti; ti=ti->next) - { + if (ti = as->parms[0].items) { + /* for each volume set in the command item list */ + for (; ti; ti = ti->next) { tset = bc_FindVolumeSet(bc_globalConfig, ti->data); - if (tset) - { + if (tset) { ListVolSet(tset); printf("\n"); - } - else - { - com_err(whoami,0,"Can't find volume set '%s'", ti->data); + } else { + com_err(whoami, 0, "Can't find volume set '%s'", ti->data); code = 1; } } - } - else - { + } else { /* no command parameters specified, show entire list */ - for(tset = bc_globalConfig->vset; tset; tset=tset->next) { + for (tset = bc_globalConfig->vset; tset; tset = tset->next) { ListVolSet(tset); printf("\n"); } @@ -378,11 +396,8 @@ afs_int32 bc_ListVolSetCmd(as, arock) bc_ClearVolumeSets() { - udbClientTextP ctPtr; struct udbHandleS *uhptr = &udbHandle; struct bc_volumeSet *vsPtr, *vsNextPtr, **vsPrev; - struct bc_volumeEntry *vePtr, *veNextPtr; - afs_int32 code; extern struct bc_config *bc_globalConfig; @@ -390,31 +405,32 @@ bc_ClearVolumeSets() for (vsPtr = bc_globalConfig->vset; vsPtr; vsPtr = vsNextPtr) { vsNextPtr = vsPtr->next; - if (vsPtr->flags & VSFLAG_TEMPORARY) { /* Skip temporary volumeSet */ - vsPrev = &(vsPtr->next); - continue; + if (vsPtr->flags & VSFLAG_TEMPORARY) { /* Skip temporary volumeSet */ + vsPrev = &(vsPtr->next); + continue; } - *vsPrev = vsPtr->next; /* Remove volumeSet from the chain */ + *vsPrev = vsPtr->next; /* Remove volumeSet from the chain */ FreeVolumeSet(vsPtr); } - return(0); + return (0); } -static ListVolSet(aset) - struct bc_volumeSet *aset; +static +ListVolSet(aset) + struct bc_volumeSet *aset; { struct bc_volumeEntry *tentry; int i; printf("Volume set %s", aset->name); if (aset->flags & VSFLAG_TEMPORARY) - printf(" (temporary)"); + printf(" (temporary)"); printf(":\n"); i = 1; - for(tentry=aset->ventries; tentry; tentry=tentry->next, i++) { - printf(" Entry %3d: server %s, partition %s, volumes: %s\n", - i, tentry->serverName, tentry->partname, tentry->name); + for (tentry = aset->ventries; tentry; tentry = tentry->next, i++) { + printf(" Entry %3d: server %s, partition %s, volumes: %s\n", i, + tentry->serverName, tentry->partname, tentry->name); } return 0; } @@ -431,18 +447,18 @@ static ListVolSet(aset) int bc_ParseVolumeSet() { - static char rn[] = "bc_ParseVolumeSet"; /*Routine name*/ - char tbuffer[1024]; /*Buffer for reading config file*/ - char vsname[256]; /*Volume set name*/ - char serverName[256]; /*Server name*/ - char partName[256]; /*Partition name*/ - register struct bc_volumeEntry *tve; /*Ptr to generated volume spec struct*/ - register struct bc_volumeSet *tvs; /*Ptr to volume set struct*/ + static char rn[] = "bc_ParseVolumeSet"; /*Routine name */ + char tbuffer[1024]; /*Buffer for reading config file */ + char vsname[256]; /*Volume set name */ + char serverName[256]; /*Server name */ + char partName[256]; /*Partition name */ + register struct bc_volumeEntry *tve; /*Ptr to generated volume spec struct */ + register struct bc_volumeSet *tvs; /*Ptr to volume set struct */ struct bc_volumeEntry **ppve, *pve; struct bc_volumeSet **ppvs, *pvs; - register afs_int32 code; /*Generalized return code*/ - char *tp; /*Result of fgets(), malloc()*/ - int readHeader; /*Is next thing to read a volume set hdr?*/ + register afs_int32 code; /*Generalized return code */ + char *tp; /*Result of fgets(), malloc() */ + int readHeader; /*Is next thing to read a volume set hdr? */ udbClientTextP ctPtr; register FILE *stream; @@ -458,61 +474,57 @@ bc_ParseVolumeSet() * Open up the volume set configuration file, fail if it can't be done. */ - if ( ctPtr->textSize == 0 ) /* empty is ok */ - return(0); + if (ctPtr->textSize == 0) /* empty is ok */ + return (0); /* stream checks and initialization */ - if ( stream == NULL ) - return(BC_INTERNALERROR); + if (stream == NULL) + return (BC_INTERNALERROR); rewind(stream); readHeader = 1; - while (1) - { + while (1) { /* Read in and process the next line of the volume set description * file. */ tp = fgets(tbuffer, sizeof(tbuffer), stream); if (!tp) break; - if (readHeader) - { /*r*/ + if (readHeader) { /*r */ /* * Scan a header entry. */ readHeader = 0; code = sscanf(tbuffer, "%s %s", serverName, vsname); - if ( (code != 2) - || (strcmp(serverName, "volumeset") != 0) - ) - { + if ((code != 2) + || (strcmp(serverName, "volumeset") != 0) + ) { com_err(whoami, 0, "Bad volume header line: '%s'", tbuffer); - return(-1); + return (-1); } /* Create and fill in the volume set descriptor structure from * the info just read placing it at the head of its queue in the * global configuration structure. */ - tvs = (struct bc_volumeSet *) malloc(sizeof(struct bc_volumeSet)); + tvs = (struct bc_volumeSet *)malloc(sizeof(struct bc_volumeSet)); memset(tvs, 0, sizeof(*tvs)); - tvs->name = (char *) malloc(strlen(vsname)+1); + tvs->name = (char *)malloc(strlen(vsname) + 1); strcpy(tvs->name, vsname); /* append to the end */ - for(ppvs = &bc_globalConfig->vset, pvs = *ppvs; pvs; ppvs = &pvs->next, pvs = *ppvs); + for (ppvs = &bc_globalConfig->vset, pvs = *ppvs; pvs; + ppvs = &pvs->next, pvs = *ppvs); *ppvs = tvs; - tvs->next = (struct bc_volumeSet *) 0; - } /*r*/ - else - { /*e*/ + tvs->next = (struct bc_volumeSet *)0; + } /*r */ + else { /*e */ /* Scan a volume name entry, which contains the server name, * partition pattern, and volume pattern. */ code = sscanf(tbuffer, "%s %s %s", serverName, partName, vsname); - if (code == 1 && strcmp(serverName, "end") == 0) - { + if (code == 1 && strcmp(serverName, "end") == 0) { /* This was really a line delimiting the current volume set. * Next time around, we should try to read a header. */ @@ -524,71 +536,72 @@ bc_ParseVolumeSet() * spec record, then get the rest of the information regarding * the host, and stuff everything into place. */ - tve = (struct bc_volumeEntry *) - malloc(sizeof(struct bc_volumeEntry)); - if (!tve) - { - com_err(whoami,0, "Can't malloc() a new volume spec record!"); - return(-1); + tve = (struct bc_volumeEntry *) + malloc(sizeof(struct bc_volumeEntry)); + if (!tve) { + com_err(whoami, 0, + "Can't malloc() a new volume spec record!"); + return (-1); } memset(tve, 0, sizeof(*tve)); if (bc_ParseHost(serverName, &(tve->server))) - com_err(whoami,0, "Can't get required info on host '%s'", serverName); + com_err(whoami, 0, "Can't get required info on host '%s'", + serverName); /* The above code has filled in the server sockaddr, now fill in * the rest of the fields. */ - tve->serverName = (char *) malloc(strlen(serverName)+1); - if (!tve->serverName) - { - com_err(whoami,0,"Can't malloc() a new volume spec server name field!"); - return(-1); + tve->serverName = (char *)malloc(strlen(serverName) + 1); + if (!tve->serverName) { + com_err(whoami, 0, + "Can't malloc() a new volume spec server name field!"); + return (-1); } strcpy(tve->serverName, serverName); - tve->partname = (char *) malloc(strlen(partName)+1); - if (!tve->partname) - { - com_err(whoami,0, "Can't malloc() a new volume spec partition pattern field!"); - return(-1); + tve->partname = (char *)malloc(strlen(partName) + 1); + if (!tve->partname) { + com_err(whoami, 0, + "Can't malloc() a new volume spec partition pattern field!"); + return (-1); } strcpy(tve->partname, partName); code = bc_GetPartitionID(partName, &tve->partition); - if (code) - { - com_err(whoami,0, "Can't parse partition '%s'", partName); + if (code) { + com_err(whoami, 0, "Can't parse partition '%s'", partName); return -1; } - tp = (char *) malloc(strlen(vsname)+1); - if (!tp) - { - com_err(whoami,0, "Can't malloc() a new volume spec volume pattern field!"); - return(-1); + tp = (char *)malloc(strlen(vsname) + 1); + if (!tp) { + com_err(whoami, 0, + "Can't malloc() a new volume spec volume pattern field!"); + return (-1); } strcpy(tp, vsname); - tve->name = tp; + tve->name = tp; /* Now, thread it onto the list of other volume spec entries for * the current volume set. */ - for(ppve = &tvs->ventries, pve = *ppve; pve; ppve = &pve->next, pve = *ppve); + for (ppve = &tvs->ventries, pve = *ppve; pve; + ppve = &pve->next, pve = *ppve); *ppve = tve; - tve->next = (struct bc_volumeEntry *) 0; + tve->next = (struct bc_volumeEntry *)0; } - } /*forever loop*/ + } /*forever loop */ /* If we hit an EOF in the middle of a volume set record, we bitch and * moan. */ if (!readHeader) - return(-1); + return (-1); /* * Well, we did it. Return successfully. */ - return(0); + return (0); -} /*bc_ParseVolumeSet*/ +} /*bc_ParseVolumeSet */ /* bc_SaveVolumeSet * save the current volume set information to disk @@ -611,35 +624,37 @@ bc_SaveVolumeSet() configPtr = bc_globalConfig; /* must be locked */ - if ( ctPtr->lockHandle == 0 ) - return(BC_INTERNALERROR); + if (ctPtr->lockHandle == 0) + return (BC_INTERNALERROR); /* truncate the file */ code = ftruncate(fileno(stream), 0); - if ( code ) - ERROR(errno); + if (code) + ERROR(errno); rewind(stream); /* now write the volumeset information */ - for(tset = bc_globalConfig->vset; tset != 0; tset=tset->next) { - if (tset->flags & VSFLAG_TEMPORARY) continue; /* skip temporary entries */ + for (tset = bc_globalConfig->vset; tset != 0; tset = tset->next) { + if (tset->flags & VSFLAG_TEMPORARY) + continue; /* skip temporary entries */ fprintf(stream, "volumeset %s\n", tset->name); - for(tentry=tset->ventries; tentry; tentry=tentry->next) { - fprintf(stream, "%s %s %s\n", tentry->serverName, tentry->partname, tentry->name); + for (tentry = tset->ventries; tentry; tentry = tentry->next) { + fprintf(stream, "%s %s %s\n", tentry->serverName, + tentry->partname, tentry->name); } fprintf(stream, "end\n"); } if (ferror(stream)) - return(BC_INTERNALERROR); + return (BC_INTERNALERROR); /* send to server */ code = bcdb_SaveTextFile(ctPtr); - if ( code ) - ERROR(code); + if (code) + ERROR(code); /* do this on bcdb_SaveTextFile */ /* increment local version number */ @@ -648,67 +663,67 @@ bc_SaveVolumeSet() /* update locally stored file size */ ctPtr->textSize = filesize(ctPtr->textStream); -error_exit: - return(code); + error_exit: + return (code); } -afs_int32 bc_UpdateVolumeSet() +afs_int32 +bc_UpdateVolumeSet() { - struct bc_dumpSchedule *dumpPtr, *nextDumpPtr; struct udbHandleS *uhptr = &udbHandle; udbClientTextP ctPtr; afs_int32 code; - int lock=0; + int lock = 0; /* lock schedules and check validity */ ctPtr = &bc_globalConfig->configText[TB_VOLUMESET]; /* Don't need a lock to check the version */ code = bc_CheckTextVersion(ctPtr); - if ( code != BC_VERSIONMISMATCH ) - { - ERROR(code); /* version matches or some other error */ + if (code != BC_VERSIONMISMATCH) { + ERROR(code); /* version matches or some other error */ } /* Must update the volume sets */ /* If no lock alredy taken, then lock it */ - if ( ctPtr->lockHandle == 0 ) - { - code = bc_LockText(ctPtr); - if ( code ) - ERROR(code); + if (ctPtr->lockHandle == 0) { + code = bc_LockText(ctPtr); + if (code) + ERROR(code); lock = 1; } - if (ctPtr->textVersion != -1) - { - printf("backup: obsolete volumesets - updating\n"); - bc_ClearVolumeSets(); + if (ctPtr->textVersion != -1) { + printf("backup: obsolete volumesets - updating\n"); + bc_ClearVolumeSets(); } - + /* open a temp file to store the config text received from buserver * * The open file stream is stored in ctPtr->textStream */ - code = bc_openTextFile(ctPtr, &bc_globalConfig->tmpTextFileNames[TB_VOLUMESET][0]); - if ( code ) - ERROR(code); + code = + bc_openTextFile(ctPtr, + &bc_globalConfig->tmpTextFileNames[TB_VOLUMESET][0]); + if (code) + ERROR(code); /* now get a fresh set of information from the database */ code = bcdb_GetTextFile(ctPtr); - if ( code ) - ERROR(code); + if (code) + ERROR(code); - /* fetch the version number */ - code = ubik_Call(BUDB_GetTextVersion, uhptr->uh_client, 0, - ctPtr->textType, &ctPtr->textVersion); - if ( code ) + /* fetch the version number */ + code = + ubik_Call(BUDB_GetTextVersion, uhptr->uh_client, 0, ctPtr->textType, + &ctPtr->textVersion); + if (code) ERROR(code); /* parse the file */ code = bc_ParseVolumeSet(); - if ( code ) - ERROR(code); + if (code) + ERROR(code); -error_exit: - if ( lock && ctPtr->lockHandle ) + error_exit: + if (lock && ctPtr->lockHandle) bc_UnlockText(ctPtr); - return(code); + return (code); } diff --git a/src/bucoord/volstub.c b/src/bucoord/volstub.c index aabef933a..d89a8e5de 100644 --- a/src/bucoord/volstub.c +++ b/src/bucoord/volstub.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/volstub.c,v 1.1.1.4 2001/07/14 22:20:56 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/bucoord/volstub.c,v 1.6 2003/12/07 22:49:19 jaltman Exp $"); #include #include @@ -22,29 +23,30 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/volstub.c,v 1.1.1.4 2001/07/14 #include #endif #include -#include /*Misc server-side Volume Location stuff*/ +#include /*Misc server-side Volume Location stuff */ #include #include "volser.h" #include "bc.h" #include -extern int VL_GetEntryByID(); extern char *whoami; /* ********************************************************************* */ /* Volserver routines */ /* ********************************************************************* */ -afs_int32 bc_GetEntryByID(uclient, volID, volType, vldbEntryPtr) - struct ubik_client *uclient; - afs_int32 volID; - afs_int32 volType; - struct vldbentry *vldbEntryPtr; +afs_int32 +bc_GetEntryByID(uclient, volID, volType, vldbEntryPtr) + struct ubik_client *uclient; + afs_int32 volID; + afs_int32 volType; + struct vldbentry *vldbEntryPtr; { afs_int32 code = 0; - code = ubik_Call(VL_GetEntryByID, uclient, 0, volID, volType, vldbEntryPtr); - return(code); + code = + ubik_Call(VL_GetEntryByID, uclient, 0, volID, volType, vldbEntryPtr); + return (code); } /* volImageTime @@ -58,51 +60,49 @@ afs_int32 bc_GetEntryByID(uclient, volID, volType, vldbEntryPtr) */ afs_int32 -volImageTime (serv, part, volid, voltype, clDatePtr) - afs_int32 serv; - afs_int32 part; - afs_int32 volid; - afs_int32 voltype; - afs_int32 *clDatePtr; +volImageTime(serv, part, volid, voltype, clDatePtr) + afs_int32 serv; + afs_int32 part; + afs_int32 volid; + afs_int32 voltype; + afs_int32 *clDatePtr; { afs_int32 code = 0; struct volintInfo *viptr; - if (voltype == RWVOL) - { - *clDatePtr = time(0); - return(0); + if (voltype == RWVOL) { + *clDatePtr = time(0); + return (0); } code = UV_ListOneVolume(htonl(serv), part, volid, &viptr); - if (code) - { - com_err(whoami, code, - "Warning: Can't get clone time of volume %u - using 0", volid); + if (code) { + com_err(whoami, code, + "Warning: Can't get clone time of volume %u - using 0", + volid); *clDatePtr = 0; - return(0); + return (0); } /* volume types from vol/voldefs.h */ - switch ( viptr->type ) - { - case RWVOL: + switch (viptr->type) { + case RWVOL: /* For a r/w volume there may not be any foolproof way of * preventing anomalies in the backups. Use the current time; */ *clDatePtr = time(0); break; - case ROVOL: - case BACKVOL: - *clDatePtr = viptr->creationDate; /* use the creation time */ + case ROVOL: + case BACKVOL: + *clDatePtr = viptr->creationDate; /* use the creation time */ break; - - default: - com_err(whoami, 0, - "Can't get clone time of volume %u - unknown volume type", volid); - return(-1); + + default: + com_err(whoami, 0, + "Can't get clone time of volume %u - unknown volume type", + volid); + return (-1); } - return(0); + return (0); } - diff --git a/src/budb/Makefile.in b/src/budb/Makefile.in index 7924e1494..7d6d4c087 100644 --- a/src/budb/Makefile.in +++ b/src/budb/Makefile.in @@ -6,32 +6,9 @@ # directory or online at http://www.openafs.org/dl/license10.html # */ -DEST=@DEST@ -TOP_INCDIR=@TOP_INCDIR@ -TOP_LIBDIR=@TOP_LIBDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -libdir=@libdir@ -includedir=@includedir@ -mandir=@mandir@ -afssrvbindir=@afssrvbindir@ -afssrvsbindir=@afssrvsbindir@ -afssrvlibexecdir=@afssrvlibexecdir@ -TOP_SRCDIR=@TOP_SRCDIR@ -SYS_NAME=@AFS_SYSNAME@ - -SHELL = /bin/sh - -include ../config/Makefile.${SYS_NAME} - -COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et -RXGEN=${TOP_SRCDIR}/rxgen/rxgen - -CFLAGS=${DBG} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${XCFLAGS} -LDFLAGS = ${XLDFLAGS} +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config + INCLS=\ ${TOP_INCDIR}/lock.h \ ${TOP_INCDIR}/ubik.h \ @@ -77,10 +54,10 @@ all: ${TOP_LIBDIR}/libbudb.a ${TOP_INCDIR}/afs/budb.h ${TOP_INCDIR}/afs/budb_err budb_errs.o: budb_errs.c budb_client.h budb_errs.h budb_errs.c budb_client.h: budb_errs.et budb_client.p.h - $(RM) -f budb_client.h budb_errs.c; ${COMPILE_ET} budb_errs -h budb_client + $(RM) -f budb_client.h budb_errs.c; ${COMPILE_ET} -p ${srcdir} budb_errs -h budb_client budb_errs.h: budb_errs.et - ${COMPILE_ET} budb_errs + ${COMPILE_ET} -p ${srcdir} budb_errs database.o: database.c budb_errs.h globals.h ${INCLS} db_alloc.o: db_alloc.c budb_errs.h ${INCLS} @@ -96,8 +73,21 @@ server.o: server.c budb_errs.h ${INCLS} AFS_component_version_number.c budb_server: $(SERVER_OBJS) ${LIBS} ${CC} ${LDFLAGS} -o budb_server $(SERVER_OBJS) ${LIBS} ${XLIBS} -budb.xdr.c budb.cs.c budb.ss.c budb.h: budb.rg - ${RXGEN} budb.rg +budb.cs.c: budb.rg + ${RXGEN} -C -o $@ ${srcdir}/budb.rg + +budb.ss.c: budb.rg + ${RXGEN} -S -o $@ ${srcdir}/budb.rg + +budb.xdr.c: budb.rg + ${RXGEN} -c -o $@ ${srcdir}/budb.rg + +budb.h: budb.rg + ${RXGEN} -h -o $@ ${srcdir}/budb.rg + +budb.cs.c: budb.h +budb.xdr.c: budb.h +budb.ss.c: budb.h libbudb.a: budb_errs.o budb.cs.o budb.xdr.o struct_ops.o AFS_component_version_number.o -$(RM) -f $@ diff --git a/src/budb/NTMakefile b/src/budb/NTMakefile index 2bbe30456..96a3c4f9f 100644 --- a/src/budb/NTMakefile +++ b/src/budb/NTMakefile @@ -5,10 +5,10 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=budb !INCLUDE ..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\config\NTMakefile.version - ############################################################################ # install headers INCFILEDIR = $(DESTDIR)\include\afs # header file install directory @@ -26,11 +26,11 @@ INCFILES =\ LIBFILE = $(DESTDIR)\lib\afs\afsbudb.lib LIBOBJS =\ - budb_errs.obj \ - budb.cs.obj \ - budb.xdr.obj \ - struct_ops.obj \ - AFS_component_version_number.obj + $(OUT)\budb_errs.obj \ + $(OUT)\budb.cs.obj \ + $(OUT)\budb.xdr.obj \ + $(OUT)\struct_ops.obj \ + $(OUT)\AFS_component_version_number.obj $(LIBFILE): $(LIBOBJS) $(LIBARCH) @@ -42,21 +42,21 @@ $(LIBFILE): $(LIBOBJS) EXEFILE = $(DESTDIR)\root.server\usr\afs\bin\buserver.exe EXEOBJS =\ - database.obj \ - db_alloc.obj \ - db_dump.obj \ - db_hash.obj \ - struct_ops.obj \ - ol_verify.obj \ - budb.ss.obj \ - budb.xdr.obj \ - dbs_dump.obj \ - db_lock.obj \ - db_text.obj \ - procs.obj \ - budb_errs.obj \ - server.obj \ - buserver.res + $(OUT)\database.obj \ + $(OUT)\db_alloc.obj \ + $(OUT)\db_dump.obj \ + $(OUT)\db_hash.obj \ + $(OUT)\struct_ops.obj \ + $(OUT)\ol_verify.obj \ + $(OUT)\budb.ss.obj \ + $(OUT)\budb.xdr.obj \ + $(OUT)\dbs_dump.obj \ + $(OUT)\db_lock.obj \ + $(OUT)\db_text.obj \ + $(OUT)\procs.obj \ + $(OUT)\budb_errs.obj \ + $(OUT)\server.obj \ + $(OUT)\buserver.res EXELIBS =\ @@ -86,8 +86,7 @@ $(EXEFILE): $(EXEOBJS) $(EXELIBS) ############################################################################ # Definitions for generating versioninfo resources -buserver.res: buserver.rc AFS_component_version_number.h - $(RC) $*.rc +$(OUT)\buserver.res: AFS_component_version_number.h ############################################################################ # rxgen budb.rg @@ -118,3 +117,6 @@ install: $(INCFILES) $(LIBFILE) $(EXEFILE) clean:: $(DEL) budb_errs.c budb_errs.h budb.h budb_client.h $(DEL) budb.cs.c budb.ss.c budb.xdr.c + +mkdir: + diff --git a/src/budb/budb.rg b/src/budb/budb.rg index 6653eeb0c..aa62a9ca0 100644 --- a/src/budb/budb.rg +++ b/src/budb/budb.rg @@ -162,6 +162,7 @@ struct budb_volumeEntry { /* describes a fragment of a volume */ /* procedure interface */ package BUDB_ +prefix S statindex 17 /* All these procedures take a connection parameter since they may contact the @@ -388,7 +389,7 @@ UseTape /* text file management calls - alphabetic */ GetText - ( IN afs_int32 lockHandle, + ( IN afs_uint32 lockHandle, IN afs_int32 textType, /* which type of text */ IN afs_int32 maxLength, IN afs_int32 offset, @@ -397,10 +398,10 @@ GetText GetTextVersion ( IN afs_int32 textType, - OUT afs_int32 *tversion); + OUT afs_uint32 *tversion); SaveText - ( IN afs_int32 lockHandle, /* which type of text */ + ( IN afs_uint32 lockHandle, /* which type of text */ IN afs_int32 textType, /* which type of text */ IN afs_int32 offset, /* offset into text block */ IN afs_int32 flags, diff --git a/src/budb/budb_client.p.h b/src/budb/budb_client.p.h index 2c0691d2f..7be2e3d84 100644 --- a/src/budb/budb_client.p.h +++ b/src/budb/budb_client.p.h @@ -11,7 +11,7 @@ #define __BUDB_CLIENT__ #include -#ifndef BUDB_MAJORVERSION /* get the installed RPC stuff */ +#ifndef BUDB_MAJORVERSION /* get the installed RPC stuff */ #include #include #include @@ -20,81 +20,35 @@ /* for ubik_Call_SingleServer */ -#define UF_SINGLESERVER 1 /* begin single server operation */ -#define UF_END_SINGLESERVER 2 /* terminate single server operation */ +#define UF_SINGLESERVER 1 /* begin single server operation */ +#define UF_END_SINGLESERVER 2 /* terminate single server operation */ /* handle for the ubik database connection */ -struct udbHandleS -{ - afs_int32 uh_scIndex; /* what type of sec. object */ - struct rx_securityClass *uh_secobj; /* security object */ - struct rx_connection *uh_serverConn[MAXSERVERS]; /* server connections*/ - struct ubik_client *uh_client; /* ubik client handle */ - afs_uint32 uh_instanceId; /* instance of client */ +struct udbHandleS { + afs_int32 uh_scIndex; /* what type of sec. object */ + struct rx_securityClass *uh_secobj; /* security object */ + struct rx_connection *uh_serverConn[MAXSERVERS]; /* server connections */ + struct ubik_client *uh_client; /* ubik client handle */ + afs_uint32 uh_instanceId; /* instance of client */ }; -typedef struct udbHandleS udbHandleT; -typedef udbHandleT *udbHandleP; +typedef struct udbHandleS udbHandleT; +typedef udbHandleT *udbHandleP; /* suggested text block management structure */ -struct udbClientTextS -{ - char *textName; /* for info. only */ - afs_int32 textType; /* used as key for access */ - afs_uint32 textVersion; /* version # for cache mgmt */ - afs_uint32 lockHandle; /* for atomicity */ - afs_int32 textSize; /* no. of bytes */ - FILE *textStream; /* file stream or NULL */ +struct udbClientTextS { + char *textName; /* for info. only */ + afs_int32 textType; /* used as key for access */ + afs_uint32 textVersion; /* version # for cache mgmt */ + afs_uint32 lockHandle; /* for atomicity */ + afs_int32 textSize; /* no. of bytes */ + FILE *textStream; /* file stream or NULL */ }; -typedef struct udbClientTextS udbClientTextT; -typedef udbClientTextT *udbClientTextP; - -extern afs_int32 BUDB_AddVolume(); -extern afs_int32 BUDB_AddVolumes(); -extern afs_int32 BUDB_CreateDump (); -extern afs_int32 BUDB_DeleteDump (); -extern afs_int32 BUDB_ListDumps (); -extern afs_int32 BUDB_DeleteTape (); -extern afs_int32 BUDB_DeleteVDP(); -extern afs_int32 BUDB_FindClone(); -extern afs_int32 BUDB_FindDump(); -extern afs_int32 BUDB_FindLatestDump(); -extern afs_int32 BUDB_FindLastTape(); -extern afs_int32 BUDB_MakeDumpAppended(); -extern afs_int32 BUDB_FinishDump (); -extern afs_int32 BUDB_FinishTape (); -extern afs_int32 BUDB_GetDumps (); -extern afs_int32 BUDB_GetTapes (); -extern afs_int32 BUDB_GetVolumes (); -extern afs_int32 BUDB_UseTape (); - -/* text mgmt interface */ -extern afs_int32 BUDB_GetText(); -extern afs_int32 BUDB_GetTextVersion(); -extern afs_int32 BUDB_SaveText(); -extern afs_int32 BUDB_SaveTextVersion(); - -/* text lock mgmt interface */ - -extern afs_int32 BUDB_FreeAllLocks(); -extern afs_int32 BUDB_FreeLock(); -extern afs_int32 BUDB_GetInstanceId(); -extern afs_int32 BUDB_GetLock(); - -/* Database verification and dump */ - -extern afs_int32 BUDB_DbVerify(); -extern afs_int32 BUDB_DumpDB(); -extern afs_int32 BUDB_RestoreDbHeader(); - -/* testing interface */ - -extern afs_int32 BUDB_T_GetVersion(); -extern afs_int32 BUDB_T_DumpHashTable (); -extern afs_int32 BUDB_T_DumpDatabase(); +typedef struct udbClientTextS udbClientTextT; +typedef udbClientTextT *udbClientTextP; #endif diff --git a/src/budb/database.c b/src/budb/database.c index b4f4904ad..c42b680ac 100644 --- a/src/budb/database.c +++ b/src/budb/database.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/budb/database.c,v 1.1.1.5 2001/09/11 14:31:41 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/budb/database.c,v 1.7 2003/07/15 23:14:48 shadow Exp $"); #ifdef AFS_NT40_ENV #include @@ -27,27 +28,37 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/database.c,v 1.1.1.5 2001/09/11 14 #include "error_macros.h" #include "afs/audit.h" +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif -int pollCount; -struct memoryDB db; /* really allocate it here */ +int pollCount; +struct memoryDB db; /* really allocate it here */ -void db_panic (reason) - char *reason; +void +db_panic(reason) + char *reason; { LogError(0, "db_panic: %s\n", reason); BUDB_EXIT(-1); } -afs_int32 InitDB () -{ afs_int32 code; +afs_int32 +InitDB() +{ + afs_int32 code; pollCount = 0; memset(&db, 0, sizeof(db)); - Lock_Init (&db.lock); - if ((code = InitDBalloc ()) || (code = InitDBhash ())) - return code; + Lock_Init(&db.lock); + if ((code = InitDBalloc()) || (code = InitDBhash())) + return code; return 0; } @@ -63,37 +74,34 @@ afs_int32 InitDB () * len - size of the write */ -afs_int32 dbwrite (ut, pos, buff, len) - struct ubik_trans *ut; - afs_int32 pos; - char *buff; - afs_int32 len; +afs_int32 +dbwrite(ut, pos, buff, len) + struct ubik_trans *ut; + afs_int32 pos; + char *buff; + afs_int32 len; { afs_int32 code = 0; - if ( ( (pos < sizeof(db.h)) && (buff != (char *)&db.h + pos) ) || - (pos >= ntohl(db.h.eofPtr)) ) - { + if (((pos < sizeof(db.h)) && (buff != (char *)&db.h + pos)) + || (pos >= ntohl(db.h.eofPtr))) { Log("dbwrite: Illegal attempt to write at location 0 or past EOF\n"); ERROR(BUDB_IO); } code = ubik_Seek(ut, 0, pos); - if (code) - { + if (code) { LogError(code, "dbwrite: ubik_Seek to %d failed\n", pos); ERROR(code); } - code = ubik_Write(ut,buff,len); - if (code) - { + code = ubik_Write(ut, buff, len); + if (code) { LogError(code, "dbwrite: ubik_Write failed\n"); ERROR(code); } error_exit: - if (((++pollCount) % 4) == 0) /* Poll every 4 reads/writes */ - { + if (((++pollCount) % 4) == 0) { /* Poll every 4 reads/writes */ IOMGR_Poll(); pollCount = 0; } @@ -102,36 +110,34 @@ afs_int32 dbwrite (ut, pos, buff, len) /* same thing for read */ -afs_int32 dbread (ut, pos, buff, len) - struct ubik_trans *ut; - afs_int32 pos; - char *buff; - afs_int32 len; +afs_int32 +dbread(ut, pos, buff, len) + struct ubik_trans *ut; + afs_int32 pos; + char *buff; + afs_int32 len; { afs_int32 code = 0; - if (pos >= ntohl(db.h.eofPtr)) - { + if (pos >= ntohl(db.h.eofPtr)) { LogError(0, "dbread: Attempt to read @%d (past EOF)\n", pos); ERROR(BUDB_IO); } code = ubik_Seek(ut, 0, pos); - if (code) - { + if (code) { LogError(code, "dbread: ubik_Seek to %d failed\n", pos); ERROR(code); } code = ubik_Read(ut, buff, len); - if (code) - { - LogError(code, "dbread: ubik_Read pos %d, buff %d, len %d\n", pos, buff, len); + if (code) { + LogError(code, "dbread: ubik_Read pos %d, buff %d, len %d\n", pos, + buff, len); ERROR(code); } error_exit: - if (((++pollCount) % 4) == 0) /* Poll every 4 reads/writes */ - { + if (((++pollCount) % 4) == 0) { /* Poll every 4 reads/writes */ IOMGR_Poll(); pollCount = 0; } @@ -139,39 +145,37 @@ afs_int32 dbread (ut, pos, buff, len) } /* Same as dbread excepts it does checking */ -afs_int32 cdbread (ut, type, pos, buff, len) - struct ubik_trans *ut; - int type; - afs_int32 pos; - char *buff; - afs_int32 len; +afs_int32 +cdbread(ut, type, pos, buff, len) + struct ubik_trans *ut; + int type; + afs_int32 pos; + char *buff; + afs_int32 len; { afs_int32 code = 0; code = checkDiskAddress(pos, type, 0, 0); - if (code) - { - LogError(code, "cdbread: Bad Address for block %d (addr 0x%x)\n", + if (code) { + LogError(code, "cdbread: Bad Address for block %d (addr 0x%x)\n", type, pos); ERROR(code); } code = ubik_Seek(ut, 0, pos); - if (code) - { + if (code) { LogError(code, "cdbread: ubik_Seek to 0x%x failed\n", pos); ERROR(code); } code = ubik_Read(ut, buff, len); - if (code) - { - LogError(code, "cdbread: ubik_Read pos 0x%x, buff %d, len %d\n", pos, buff, len); + if (code) { + LogError(code, "cdbread: ubik_Read pos 0x%x, buff %d, len %d\n", pos, + buff, len); ERROR(code); } error_exit: - if (((++pollCount) % 4) == 0) /* Poll every 4 reads/writes */ - { + if (((++pollCount) % 4) == 0) { /* Poll every 4 reads/writes */ IOMGR_Poll(); pollCount = 0; } @@ -182,46 +186,45 @@ afs_int32 cdbread (ut, type, pos, buff, len) manner, to avoid bogusly reinitializing the db. */ afs_int32 -CheckInit (ut, db_init) +CheckInit(ut, db_init) struct ubik_trans *ut; - int (*db_init)(); /* procedure to call if rebuilding DB */ -{ + int (*db_init) (); /* procedure to call if rebuilding DB */ +{ register afs_int32 code; /* Don't read header if not necessary */ - if (!ubik_CacheUpdate (ut)) return 0; + if (!ubik_CacheUpdate(ut)) + return 0; - ObtainWriteLock (&db.lock); + ObtainWriteLock(&db.lock); db.h.eofPtr = htonl(sizeof(db.h)); /* for sanity check in dbread */ - code = dbread(ut, 0, (char *) &db.h, sizeof(db.h)); - if (code) ERROR(code); + code = dbread(ut, 0, (char *)&db.h, sizeof(db.h)); + if (code) + ERROR(code); - if ((ntohl(db.h.version) != BUDB_VERSION) || (ntohl(db.h.checkVersion) != BUDB_VERSION)) - { + if ((ntohl(db.h.version) != BUDB_VERSION) + || (ntohl(db.h.checkVersion) != BUDB_VERSION)) { - if ((ntohl(db.h.version) == 0) || (ntohl(db.h.checkVersion) == 0)) + if ((ntohl(db.h.version) == 0) || (ntohl(db.h.checkVersion) == 0)) ERROR(BUDB_EMPTY); - LogError(0, "DB version should be %d; Initial = %d; Terminal = %d\n", - BUDB_VERSION, ntohl(db.h.version), ntohl(db.h.checkVersion)); + LogError(0, "DB version should be %d; Initial = %d; Terminal = %d\n", + BUDB_VERSION, ntohl(db.h.version), ntohl(db.h.checkVersion)); ERROR(BUDB_IO); } db.readTime = time(0); - ht_Reset (&db.volName); - ht_Reset (&db.tapeName); - ht_Reset (&db.dumpName); - ht_Reset (&db.dumpIden); + ht_Reset(&db.volName); + ht_Reset(&db.tapeName); + ht_Reset(&db.dumpName); + ht_Reset(&db.dumpIden); error_exit: - ReleaseWriteLock (&db.lock); - if (code) - { - if ((code == UEOF) || (code == BUDB_EMPTY)) - { - if (db_init) - { + ReleaseWriteLock(&db.lock); + if (code) { + if ((code == UEOF) || (code == BUDB_EMPTY)) { + if (db_init) { LogDebug(0, "No data base - Building new one\n"); /* try to write a good header */ @@ -232,20 +235,18 @@ CheckInit (ut, db_init) db.h.eofPtr = htonl(sizeof(db.h)); /* text ptrs cleared by bzero */ - ht_DBInit (); - - code = dbwrite(ut, 0, (char *) &db.h, sizeof(db.h)); - if (code) code = BUDB_IO; /* return the error code */ - else code = db_init(ut); /* initialize the db */ - } - else - { - LogDebug(0, "No data base\n"); - code = BUDB_EMPTY; + ht_DBInit(); + + code = dbwrite(ut, 0, (char *)&db.h, sizeof(db.h)); + if (code) + code = BUDB_IO; /* return the error code */ + else + code = db_init(ut); /* initialize the db */ + } else { + LogDebug(0, "No data base\n"); + code = BUDB_EMPTY; } - } - else - { + } else { LogDebug(0, "I/O Error\n"); code = BUDB_IO; } diff --git a/src/budb/database.h b/src/budb/database.h index 337159cef..d545a7187 100644 --- a/src/budb/database.h +++ b/src/budb/database.h @@ -15,39 +15,37 @@ typedef afs_uint32 dbadr; struct hashTable { - afs_int32 functionType; /* type of hash function */ - afs_int32 threadOffset; /* Byte offset of hash thread */ - afs_int32 entries; /* number of entries in hash table */ - afs_int32 length; /* number of hash table slots */ - dbadr table; /* pointer to actual table */ - afs_int32 progress; /* number empty buckets in oldTable */ - afs_int32 oldLength; /* slots in old table */ - dbadr oldTable; /* old table */ + afs_int32 functionType; /* type of hash function */ + afs_int32 threadOffset; /* Byte offset of hash thread */ + afs_int32 entries; /* number of entries in hash table */ + afs_int32 length; /* number of hash table slots */ + dbadr table; /* pointer to actual table */ + afs_int32 progress; /* number empty buckets in oldTable */ + afs_int32 oldLength; /* slots in old table */ + dbadr oldTable; /* old table */ }; /* text blocks and related structures */ -struct textBlock -{ - afs_uint32 version; /* for access consistency checks */ - afs_int32 size; /* size in bytes */ - dbadr textAddr; /* list of blocks */ - afs_int32 newsize; /* replacement size */ - dbadr newTextAddr; /* list of new blocks */ +struct textBlock { + afs_uint32 version; /* for access consistency checks */ + afs_int32 size; /* size in bytes */ + dbadr textAddr; /* list of blocks */ + afs_int32 newsize; /* replacement size */ + dbadr newTextAddr; /* list of new blocks */ }; -struct db_lockS -{ - afs_int32 type; /* user defined - for consistency checks */ - afs_int32 lockState; /* locked/free */ - afs_int32 lockTime; /* when locked */ - afs_int32 expires; /* when timeout expires */ - afs_int32 instanceId; /* user instance id */ - int lockHost; /* locking host, if possible */ +struct db_lockS { + afs_int32 type; /* user defined - for consistency checks */ + afs_int32 lockState; /* locked/free */ + afs_int32 lockTime; /* when locked */ + afs_int32 expires; /* when timeout expires */ + afs_int32 instanceId; /* user instance id */ + int lockHost; /* locking host, if possible */ }; -typedef struct db_lockS db_lockT; -typedef db_lockT *db_lockP; +typedef struct db_lockS db_lockT; +typedef db_lockT *db_lockP; /* hash table function types */ #define HT_dumpIden_FUNCTION 1 @@ -75,23 +73,23 @@ typedef db_lockT *db_lockP; #define BUDB_VERSION 1 struct dbHeader { - afs_int32 version; /* database version number */ - dumpId lastDumpId; /* last dump id value */ - afs_uint32 lastTapeId; /* last tape id allocated */ - afs_uint32 lastInstanceId; /* last instance Id handed out */ + afs_int32 version; /* database version number */ + dumpId lastDumpId; /* last dump id value */ + afs_uint32 lastTapeId; /* last tape id allocated */ + afs_uint32 lastInstanceId; /* last instance Id handed out */ dbadr freePtrs[NBLOCKTYPES]; /* pointers to free blocks */ - dbadr eofPtr; /* first free byte in db */ - afs_int32 nHTBuckets; /* size of hashtable blocks */ - Date lastUpdate; /* time of last change to database */ - afs_int32 ptrs[10]; /* spare pointers */ - struct hashTable volName; /* hash tables */ + dbadr eofPtr; /* first free byte in db */ + afs_int32 nHTBuckets; /* size of hashtable blocks */ + Date lastUpdate; /* time of last change to database */ + afs_int32 ptrs[10]; /* spare pointers */ + struct hashTable volName; /* hash tables */ struct hashTable tapeName; struct hashTable dumpName; struct hashTable dumpIden; - db_lockT textLocks[TB_MAX]; /* locks for text blocks */ + db_lockT textLocks[TB_MAX]; /* locks for text blocks */ struct textBlock textBlock[TB_MAX]; /* raw text information */ - afs_int32 words[10]; /* spare words */ - afs_int32 checkVersion; /* version# for consistency checking */ + afs_int32 words[10]; /* spare words */ + afs_int32 checkVersion; /* version# for consistency checking */ }; /* The database is composed of several types of structures of different sizes. @@ -106,17 +104,17 @@ struct dbHeader { sizeof(struct dbHeader)) struct blockHeader { - char type; /* type: implies structure size */ - char flags; /* miscellaneous bits */ - short nFree; /* number of free structures */ - dbadr next; /* next free block same type */ + char type; /* type: implies structure size */ + char flags; /* miscellaneous bits */ + short nFree; /* number of free structures */ + dbadr next; /* next free block same type */ }; #define BLOCK_DATA_SIZE (BLOCKSIZE-sizeof(struct blockHeader)) struct block { struct blockHeader h; - char a[BLOCKSIZE-sizeof(struct blockHeader)]; + char a[BLOCKSIZE - sizeof(struct blockHeader)]; }; #define NhtBucketS ((BLOCKSIZE-sizeof(struct blockHeader))/sizeof(dbadr)) @@ -130,25 +128,25 @@ struct htBlock { #define VOLFRAGMENTFLAGS 0xffff struct volFragment { - dbadr vol; /* full volume info */ - dbadr sameNameChain; /* next with same vol info */ - dbadr tape; /* tape containing this fragment */ - dbadr sameTapeChain; /* next fragment on tape */ - - afs_int32 position; /* on tape */ - Date clone; /* clone date of volume */ - Date incTime; /* time for incremental; 0 => full */ - afs_int32 startByte; /* first byte of volume in this frag */ - afs_uint32 nBytes; /* bytes in fragment */ - short flags; /* miscellaneous bits */ - short sequence; /* seq of frag in dumped volume */ + dbadr vol; /* full volume info */ + dbadr sameNameChain; /* next with same vol info */ + dbadr tape; /* tape containing this fragment */ + dbadr sameTapeChain; /* next fragment on tape */ + + afs_int32 position; /* on tape */ + Date clone; /* clone date of volume */ + Date incTime; /* time for incremental; 0 => full */ + afs_int32 startByte; /* first byte of volume in this frag */ + afs_uint32 nBytes; /* bytes in fragment */ + short flags; /* miscellaneous bits */ + short sequence; /* seq of frag in dumped volume */ }; #define NvolFragmentS 45 struct vfBlock { struct blockHeader h; struct { struct volFragment s; - char pad[4]; + char pad[4]; } a[NvolFragmentS]; }; @@ -159,24 +157,24 @@ struct vfBlock { #define VOLINFOFLAGS 0xffff0000 struct volInfo { - char name[BU_MAXNAMELEN]; /* name of volume: the hash key */ - afs_int32 flags; /* miscellaneous bits */ - afs_int32 id; /* read-write volume's id */ - char server[BU_MAXHOSTLEN]; /* file server */ - afs_int32 partition; /* disk partition on server */ - afs_int32 nFrags; /* number of fragments on list */ - - dbadr nameHashChain; /* for volume name hash table */ - dbadr sameNameHead; /* volInfo of first struct this name */ - dbadr sameNameChain; /* next volume with this name */ - dbadr firstFragment; /* all volFragment with this volInfo */ + char name[BU_MAXNAMELEN]; /* name of volume: the hash key */ + afs_int32 flags; /* miscellaneous bits */ + afs_int32 id; /* read-write volume's id */ + char server[BU_MAXHOSTLEN]; /* file server */ + afs_int32 partition; /* disk partition on server */ + afs_int32 nFrags; /* number of fragments on list */ + + dbadr nameHashChain; /* for volume name hash table */ + dbadr sameNameHead; /* volInfo of first struct this name */ + dbadr sameNameChain; /* next volume with this name */ + dbadr firstFragment; /* all volFragment with this volInfo */ }; #define NvolInfoS 20 struct viBlock { struct blockHeader h; struct { struct volInfo s; - char pad[4]; + char pad[4]; } a[NvolInfoS]; }; @@ -185,26 +183,25 @@ struct viBlock { * backup system. Some of the data may persist event though the tape's * contents are repeatedly overwritten. */ -struct tape -{ - char name[BU_MAXTAPELEN]; /* name of physical tape */ - afs_int32 flags; /* miscellaneous bits */ - Date written; /* tape writing started */ - Date expires; /* expiration date */ - afs_uint32 nMBytes; /* length of tape in Mbytes */ - afs_uint32 nBytes; /* remainder of Mbytes */ - afs_int32 nFiles; /* ditto for EOFs */ - afs_int32 nVolumes; /* ditto for volume fragments */ - afs_int32 seq; /* sequence in tapeSet */ - - afs_uint32 labelpos; /* Position of the tape label */ - afs_int32 useCount; /* # of times used */ - afs_int32 useKBytes; /* How much of tape is used (in KBytes) */ - - dbadr nameHashChain; /* for tape name hash table */ - dbadr dump; /* dump (tapeSet) this is part of */ - dbadr nextTape; /* next tape in dump (tapeSet) */ - dbadr firstVol; /* first volume fragment on tape */ +struct tape { + char name[BU_MAXTAPELEN]; /* name of physical tape */ + afs_int32 flags; /* miscellaneous bits */ + Date written; /* tape writing started */ + Date expires; /* expiration date */ + afs_uint32 nMBytes; /* length of tape in Mbytes */ + afs_uint32 nBytes; /* remainder of Mbytes */ + afs_int32 nFiles; /* ditto for EOFs */ + afs_int32 nVolumes; /* ditto for volume fragments */ + afs_int32 seq; /* sequence in tapeSet */ + + afs_uint32 labelpos; /* Position of the tape label */ + afs_int32 useCount; /* # of times used */ + afs_int32 useKBytes; /* How much of tape is used (in KBytes) */ + + dbadr nameHashChain; /* for tape name hash table */ + dbadr dump; /* dump (tapeSet) this is part of */ + dbadr nextTape; /* next tape in dump (tapeSet) */ + dbadr firstVol; /* first volume fragment on tape */ }; #define NtapeS 20 @@ -212,7 +209,7 @@ struct tBlock { struct blockHeader h; struct { struct tape s; - char pad[8]; + char pad[8]; } a[NtapeS]; }; @@ -220,38 +217,37 @@ struct tBlock { * on at least one tape. */ -struct dump -{ +struct dump { /* similar to budb_dumpEntry */ - afs_int32 id; /* unique identifier for dump */ - dumpId parent; /* parent dump */ - afs_int32 level; /* dump level */ - afs_int32 flags; /* miscellaneous bits */ - char volumeSet[BU_MAXNAMELEN]; /* name of volume that was dumped */ - char dumpPath[BU_MAX_DUMP_PATH]; /* "path" name of dump level */ - char dumpName[BU_MAXNAMELEN]; /* dump name */ - Date created; /* time dump initiated */ + afs_int32 id; /* unique identifier for dump */ + dumpId parent; /* parent dump */ + afs_int32 level; /* dump level */ + afs_int32 flags; /* miscellaneous bits */ + char volumeSet[BU_MAXNAMELEN]; /* name of volume that was dumped */ + char dumpPath[BU_MAX_DUMP_PATH]; /* "path" name of dump level */ + char dumpName[BU_MAXNAMELEN]; /* dump name */ + Date created; /* time dump initiated */ /* Date incTime; target time for incremental dumps */ - afs_int32 nVolumes; /* number of volumes in dump */ - struct budb_tapeSet tapes; /* tapes for this dump */ + afs_int32 nVolumes; /* number of volumes in dump */ + struct budb_tapeSet tapes; /* tapes for this dump */ struct ktc_principal dumper; /* user doing dump */ - afs_uint32 initialDumpID; /* The dumpid of the initisl dump (for appended dumps) */ - dbadr appendedDumpChain; /* Ptr to dump appended to this dump */ + afs_uint32 initialDumpID; /* The dumpid of the initisl dump (for appended dumps) */ + dbadr appendedDumpChain; /* Ptr to dump appended to this dump */ - dbadr idHashChain; /* for dump id hash table */ - dbadr nameHashChain; /* for dump name hash table */ - dbadr firstTape; /* first tape in dump (tapeSet) */ + dbadr idHashChain; /* for dump id hash table */ + dbadr nameHashChain; /* for dump name hash table */ + dbadr firstTape; /* first tape in dump (tapeSet) */ }; -typedef struct dump dbDumpT; -typedef dbDumpT *dbDumpP; +typedef struct dump dbDumpT; +typedef dbDumpT *dbDumpP; #define NdumpS 3 struct dBlock { struct blockHeader h; struct { struct dump s; - char pad[44]; + char pad[44]; } a[NdumpS]; }; @@ -261,28 +257,28 @@ struct dBlock { table together. In memory this information is inferred */ struct memoryHTBlock { - int valid; /* block needs to be read in */ - dbadr a; /* where stored in db */ + int valid; /* block needs to be read in */ + dbadr a; /* where stored in db */ struct htBlock b; }; struct memoryHashTable { - struct hashTable *ht; /* ptr to appropriate db.h hashtable */ + struct hashTable *ht; /* ptr to appropriate db.h hashtable */ /* these are host byte order version of the corresponding HT fields */ - int threadOffset; /* Byte offset of hash thread */ - int length; /* number of hash table slots */ - int oldLength; /* slots in old table */ - int progress; /* number empty buckets in oldTable */ + int threadOffset; /* Byte offset of hash thread */ + int length; /* number of hash table slots */ + int oldLength; /* slots in old table */ + int progress; /* number empty buckets in oldTable */ /* these are the memory copies of the hash table buckets */ - int size; /* allocated size of array */ + int size; /* allocated size of array */ struct memoryHTBlock *(*blocks); /* ptr to array of ht block pointers */ - int oldSize; /* ditto for old HT */ + int oldSize; /* ditto for old HT */ struct memoryHTBlock *(*oldBlocks); }; -struct memoryDB { /* in core copies of database structures */ +struct memoryDB { /* in core copies of database structures */ struct Lock lock; - Date readTime; + Date readTime; struct dbHeader h; struct memoryHashTable volName; struct memoryHashTable tapeName; @@ -315,7 +311,10 @@ extern struct memoryDB db; #define MAX(x,y) ((x) > (y) ? (x) : (y)) #endif /* notdef */ -struct memoryHashTable *ht_GetType (); -extern afs_uint32 ht_HashEntry (); -extern dbadr ht_LookupBucket (); +struct memoryHashTable *ht_GetType(); +extern afs_uint32 ht_HashEntry(); +extern dbadr ht_LookupBucket(); +extern afs_int32 dbwrite(struct ubik_trans *ut, afs_int32 pos, char *buff, afs_int32 len); +extern void db_panic(char *reason); +extern void ht_Reset(struct memoryHashTable *mht); diff --git a/src/budb/db_alloc.c b/src/budb/db_alloc.c index 49b453d9e..23ff7affb 100644 --- a/src/budb/db_alloc.c +++ b/src/budb/db_alloc.c @@ -10,13 +10,21 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_alloc.c,v 1.1.1.5 2001/09/11 14:31:41 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/budb/db_alloc.c,v 1.7 2003/07/15 23:14:48 shadow Exp $"); #ifdef AFS_NT40_ENV #include #else #include #endif +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif #include #include #include @@ -31,7 +39,8 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_alloc.c,v 1.1.1.5 2001/09/11 14 static int nEntries[NBLOCKTYPES]; static int sizeEntries[NBLOCKTYPES]; -afs_int32 InitDBalloc () +afs_int32 +InitDBalloc() { nEntries[0] = 0; sizeEntries[0] = 0; @@ -41,10 +50,10 @@ afs_int32 InitDBalloc () nEntries[tape_BLOCK] = NtapeS; nEntries[dump_BLOCK] = NdumpS; - sizeEntries[volFragment_BLOCK] = sizeof(((struct vfBlock *)0)->a[0]); - sizeEntries[volInfo_BLOCK] = sizeof(((struct viBlock *)0)->a[0]); - sizeEntries[tape_BLOCK] = sizeof(((struct tBlock *)0)->a[0]); - sizeEntries[dump_BLOCK] = sizeof(((struct dBlock *)0)->a[0]); + sizeEntries[volFragment_BLOCK] = sizeof(((struct vfBlock *) NULL)->a[0]); + sizeEntries[volInfo_BLOCK] = sizeof(((struct viBlock *) NULL)->a[0]); + sizeEntries[tape_BLOCK] = sizeof(((struct tBlock *) NULL)->a[0]); + sizeEntries[dump_BLOCK] = sizeof(((struct dBlock *) NULL)->a[0]); return 0; } @@ -58,29 +67,26 @@ afs_int32 InitDBalloc () */ afs_int32 -AllocBlock (ut, block, aP) +AllocBlock(ut, block, aP) struct ubik_trans *ut; - struct block *block; /* copy of data */ - dbadr *aP; /* db addr of block */ -{ + struct block *block; /* copy of data */ + dbadr *aP; /* db addr of block */ +{ dbadr a; - - if (db.h.freePtrs[0] == 0) - { + + if (db.h.freePtrs[0] == 0) { /* if there are no free blocks, extend the database */ LogDebug(2, "AllocBlock: extending db\n"); a = ntohl(db.h.eofPtr); - if (set_header_word (ut, eofPtr, htonl(a+BLOCKSIZE))) - return BUDB_IO; - } - else - { + if (set_header_word(ut, eofPtr, htonl(a + BLOCKSIZE))) + return BUDB_IO; + } else { a = ntohl(db.h.freePtrs[0]); - if ( dbread (ut, a, (char *)block, sizeof(block->h)) /* read hdr */ - || set_header_word (ut, freePtrs[0], block->h.next) /* set next */ - ) - return BUDB_IO; + if (dbread(ut, a, (char *)block, sizeof(block->h)) /* read hdr */ + ||set_header_word(ut, freePtrs[0], block->h.next) /* set next */ + ) + return BUDB_IO; } /* clear and return the block */ @@ -96,17 +102,19 @@ AllocBlock (ut, block, aP) * a - disk address of the block */ -afs_int32 -FreeBlock (ut, bh, a) - struct ubik_trans *ut; - struct blockHeader *bh; /* copy of data */ - dbadr a; /* db address of block */ +afs_int32 +FreeBlock(ut, bh, a) + struct ubik_trans *ut; + struct blockHeader *bh; /* copy of data */ + dbadr a; /* db address of block */ { - if (a != BlockBase(a)) db_panic ("Block addr no good"); + if (a != BlockBase(a)) + db_panic("Block addr no good"); memset(bh, 0, sizeof(*bh)); bh->next = db.h.freePtrs[0]; - if (set_header_word (ut, freePtrs[0], htonl(a)) || - dbwrite (ut, a, (char *)bh, sizeof(*bh))) return BUDB_IO; + if (set_header_word(ut, freePtrs[0], htonl(a)) + || dbwrite(ut, a, (char *)bh, sizeof(*bh))) + return BUDB_IO; return 0; } @@ -122,142 +130,138 @@ FreeBlock (ut, bh, a) afs_int32 AllocStructure(ut, type, related, saP, s) struct ubik_trans *ut; - char type; + char type; dbadr related; dbadr *saP; char *s; { - dbadr a; /* block addr */ - struct block b; /* copy of data */ - int i; /* block structure array index */ - afs_int32 *bs; /* ptr to first word of structure */ - int nFree; - - if ( (type == 0) - || (type > MAX_STRUCTURE_BLOCK_TYPE) - ) - { - db_panic ("bad structure type"); + dbadr a; /* block addr */ + struct block b; /* copy of data */ + int i; /* block structure array index */ + afs_int32 *bs; /* ptr to first word of structure */ + int nFree; + + if ((type == 0) + || (type > MAX_STRUCTURE_BLOCK_TYPE) + ) { + db_panic("bad structure type"); } - bs = (afs_int32 *)b.a; /* ptr to first structure of block */ + bs = (afs_int32 *) b.a; /* ptr to first structure of block */ - if (db.h.freePtrs[type] == 0) - { + if (db.h.freePtrs[type] == 0) { /* no free items of specified type */ - if ( AllocBlock(ut, &b, &a) - || set_header_word (ut, freePtrs[type], htonl(a)) - ) - { + if (AllocBlock(ut, &b, &a) + || set_header_word(ut, freePtrs[type], htonl(a)) + ) { return BUDB_IO; } b.h.next = 0; b.h.type = type; b.h.flags = 0; - b.h.nFree = ntohs(nEntries[type]-1); - *bs = 1; /* not free anymore */ + b.h.nFree = ntohs(nEntries[type] - 1); + *bs = 1; /* not free anymore */ - if ( dbwrite (ut, a, (char *)&b, sizeof(b)) ) + if (dbwrite(ut, a, (char *)&b, sizeof(b))) return BUDB_IO; LogDebug(2, "AllocStructure: allocated new block\n"); - } - else - { + } else { int count = 10; /* Only do 10 (or so) at a time, to avoid transactions which modify - * many buffer. + * many buffer. */ - while (1) - { + while (1) { a = ntohl(db.h.freePtrs[type]); - if ( dbread (ut, a, (char *)&b, sizeof(b)) ) + if (dbread(ut, a, (char *)&b, sizeof(b))) return BUDB_IO; nFree = ntohs(b.h.nFree); if (nFree == 0) - db_panic ("nFree is zero"); - + db_panic("nFree is zero"); + /* Completely empty blocks go to generic free list if there are * more blocks on this free list */ - if (b.h.next && (nFree == nEntries[type]) && (count-- > 0)) - { - if ( set_header_word (ut, freePtrs[type], b.h.next) - || FreeBlock (ut, &b.h, a) - ) - { + if (b.h.next && (nFree == nEntries[type]) && (count-- > 0)) { + if (set_header_word(ut, freePtrs[type], b.h.next) + || FreeBlock(ut, &b.h, a) + ) { return BUDB_IO; } LogDebug(2, "AllocStrucure: add to free block list\n"); - } - else - { + } else { /* we found a free structure */ - if (nFree == 1) - { + if (nFree == 1) { /* if last free one: unthread block */ - if (set_header_word (ut, freePtrs[type], b.h.next)) + if (set_header_word(ut, freePtrs[type], b.h.next)) return BUDB_IO; } break; } } - + /* find the free structure - arbitrarily uses first word as * allocated/free status. PA. */ i = 0; - while ( *bs ) - { + while (*bs) { i++; - bs = (afs_int32 *) ((char *) bs + sizeEntries[type]); + bs = (afs_int32 *) ((char *)bs + sizeEntries[type]); } - + if (i >= nEntries[type]) - db_panic ("free count inconsistent with block"); + db_panic("free count inconsistent with block"); b.h.nFree = htons(nFree - 1); - if (dbwrite (ut, a, (char *)&b, sizeof(b.h))) return BUDB_IO; + if (dbwrite(ut, a, (char *)&b, sizeof(b.h))) + return BUDB_IO; } - *(afs_int32 *)s = 1; /* make sure structure is not free */ + *(afs_int32 *) s = 1; /* make sure structure is not free */ *saP = a + ((char *)bs - (char *)&b); - - LogDebug(3, "allocated at %d, block at %d, offset %d\n", - *saP, a, ((char *)bs - (char *)&b) ); + + LogDebug(3, "allocated at %d, block at %d, offset %d\n", *saP, a, + ((char *)bs - (char *)&b)); /* caller must write back at least first word of structure */ return 0; } -afs_int32 FreeStructure (ut, type, sa) - struct ubik_trans *ut; - char type; /* type of structure to allocate */ - dbadr sa; /* db addr of structure */ -{ struct blockHeader bh; /* header of containing block */ - dbadr a; /* db address of block */ - int nFree; /* new free structures count */ +afs_int32 +FreeStructure(ut, type, sa) + struct ubik_trans *ut; + char type; /* type of structure to allocate */ + dbadr sa; /* db addr of structure */ +{ + struct blockHeader bh; /* header of containing block */ + dbadr a; /* db address of block */ + int nFree; /* new free structures count */ afs_int32 freeWord; if ((type == 0) || (type > MAX_STRUCTURE_BLOCK_TYPE)) - db_panic ("bad structure type"); + db_panic("bad structure type"); a = BlockBase(sa); - if (dbread(ut, a, (char *)&bh, sizeof(bh))) return BUDB_IO; - if (type != bh.type) db_panic ("block and structure of different types"); + if (dbread(ut, a, (char *)&bh, sizeof(bh))) + return BUDB_IO; + if (type != bh.type) + db_panic("block and structure of different types"); - bh.nFree = htons (nFree = ntohs(bh.nFree) + 1); - if (nFree > nEntries[type]) db_panic ("free count too large"); - if (nFree == 1) { /* add to free list for type */ + bh.nFree = htons(nFree = ntohs(bh.nFree) + 1); + if (nFree > nEntries[type]) + db_panic("free count too large"); + if (nFree == 1) { /* add to free list for type */ bh.next = db.h.freePtrs[type]; - if (set_header_word (ut, freePtrs[type], htonl(a))) return BUDB_IO; + if (set_header_word(ut, freePtrs[type], htonl(a))) + return BUDB_IO; } /* mark the structure as free, and write out block header */ - if (set_word_offset (ut, sa, &freeWord, 0, 0) || - dbwrite (ut, a, (char *)&bh, sizeof(bh))) return BUDB_IO; + if (set_word_offset(ut, sa, &freeWord, 0, 0) + || dbwrite(ut, a, (char *)&bh, sizeof(bh))) + return BUDB_IO; return 0; } diff --git a/src/budb/db_dump.c b/src/budb/db_dump.c index ab1393b3b..5a1111d55 100644 --- a/src/budb/db_dump.c +++ b/src/budb/db_dump.c @@ -15,7 +15,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_dump.c,v 1.1.1.5 2001/09/11 14:31:41 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/budb/db_dump.c,v 1.7 2003/07/15 23:14:48 shadow Exp $"); #ifdef AFS_NT40_ENV #include @@ -28,6 +29,14 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_dump.c,v 1.1.1.5 2001/09/11 14: #include #include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif + #include "database.h" #include "budb.h" #include "globals.h" @@ -47,8 +56,8 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_dump.c,v 1.1.1.5 2001/09/11 14: /* interlocking for database dump */ -dumpSyncT dumpSync; -dumpSyncP dumpSyncPtr = &dumpSync; +dumpSyncT dumpSync; +dumpSyncP dumpSyncPtr = &dumpSync; /* canWrite @@ -68,21 +77,19 @@ canWrite(fid) ObtainWriteLock(&dumpSyncPtr->ds_lock); /* let the pipe drain */ - while ( dumpSyncPtr->ds_bytes > 0 ) - { - if ( dumpSyncPtr->ds_readerStatus == DS_WAITING ) - { - dumpSyncPtr->ds_readerStatus = 0; - code = LWP_SignalProcess(&dumpSyncPtr->ds_readerStatus); - if ( code ) + while (dumpSyncPtr->ds_bytes > 0) { + if (dumpSyncPtr->ds_readerStatus == DS_WAITING) { + dumpSyncPtr->ds_readerStatus = 0; + code = LWP_SignalProcess(&dumpSyncPtr->ds_readerStatus); + if (code) LogError(code, "canWrite: Signal delivery failed\n"); - } - dumpSyncPtr->ds_writerStatus = DS_WAITING; - ReleaseWriteLock(&dumpSyncPtr->ds_lock); - LWP_WaitProcess(&dumpSyncPtr->ds_writerStatus); - ObtainWriteLock(&dumpSyncPtr->ds_lock); + } + dumpSyncPtr->ds_writerStatus = DS_WAITING; + ReleaseWriteLock(&dumpSyncPtr->ds_lock); + LWP_WaitProcess(&dumpSyncPtr->ds_writerStatus); + ObtainWriteLock(&dumpSyncPtr->ds_lock); } - return(1); + return (1); } @@ -100,11 +107,10 @@ haveWritten(nbytes) extern dumpSyncP dumpSyncPtr; dumpSyncPtr->ds_bytes += nbytes; - if ( dumpSyncPtr->ds_readerStatus == DS_WAITING ) - { - dumpSyncPtr->ds_readerStatus = 0; - code = LWP_SignalProcess(&dumpSyncPtr->ds_readerStatus); - if ( code ) + if (dumpSyncPtr->ds_readerStatus == DS_WAITING) { + dumpSyncPtr->ds_readerStatus = 0; + code = LWP_SignalProcess(&dumpSyncPtr->ds_readerStatus); + if (code) LogError(code, "haveWritten: Signal delivery failed\n"); } ReleaseWriteLock(&dumpSyncPtr->ds_lock); @@ -116,33 +122,34 @@ haveWritten(nbytes) */ doneWriting(error) - afs_int32 error; + afs_int32 error; { afs_int32 code = 0; /* wait for the reader */ ObtainWriteLock(&dumpSyncPtr->ds_lock); - while ( dumpSyncPtr->ds_readerStatus != DS_WAITING ) - { + while (dumpSyncPtr->ds_readerStatus != DS_WAITING) { LogDebug(4, "doneWriting: waiting for Reader\n"); - dumpSyncPtr->ds_writerStatus = DS_WAITING; + dumpSyncPtr->ds_writerStatus = DS_WAITING; ReleaseWriteLock(&dumpSyncPtr->ds_lock); - LWP_WaitProcess(&dumpSyncPtr->ds_writerStatus); - ObtainWriteLock(&dumpSyncPtr->ds_lock); + LWP_WaitProcess(&dumpSyncPtr->ds_writerStatus); + ObtainWriteLock(&dumpSyncPtr->ds_lock); } LogDebug(4, "doneWriting: setting done\n"); /* signal that we are done */ - if (error) dumpSyncPtr->ds_writerStatus = DS_DONE_ERROR; - else dumpSyncPtr->ds_writerStatus = DS_DONE; + if (error) + dumpSyncPtr->ds_writerStatus = DS_DONE_ERROR; + else + dumpSyncPtr->ds_writerStatus = DS_DONE; dumpSyncPtr->ds_readerStatus = 0; code = LWP_NoYieldSignal(&dumpSyncPtr->ds_readerStatus); - if ( code ) + if (code) LogError(code, "doneWriting: Signal delivery failed\n"); ReleaseWriteLock(&dumpSyncPtr->ds_lock); } - + /* notes: * ut - setup and pass down */ @@ -161,44 +168,43 @@ writeStructHeader(fid, type) hostDumpHeader.type = type; hostDumpHeader.structversion = 1; - - switch ( type ) - { - case SD_DBHEADER: + + switch (type) { + case SD_DBHEADER: hostDumpHeader.size = sizeof(struct DbHeader); break; - case SD_DUMP: + case SD_DUMP: hostDumpHeader.size = sizeof(struct budb_dumpEntry); break; - case SD_TAPE: + case SD_TAPE: hostDumpHeader.size = sizeof(struct budb_tapeEntry); break; - case SD_VOLUME: + case SD_VOLUME: hostDumpHeader.size = sizeof(struct budb_volumeEntry); break; - case SD_END: + case SD_END: hostDumpHeader.size = 0; break; - default: + default: LogError(0, "writeStructHeader: invalid type %d\n", type); BUDB_EXIT(1); } structDumpHeader_hton(&hostDumpHeader, &netDumpHeader); - if ( canWrite(fid) <= 0 ) - return(BUDB_DUMPFAILED); - if ( write(fid, &netDumpHeader, sizeof(netDumpHeader)) != - sizeof(netDumpHeader) ) - return(BUDB_DUMPFAILED); + if (canWrite(fid) <= 0) + return (BUDB_DUMPFAILED); + if (write(fid, &netDumpHeader, sizeof(netDumpHeader)) != + sizeof(netDumpHeader)) + return (BUDB_DUMPFAILED); haveWritten(sizeof(netDumpHeader)); - - return(0); + + return (0); } /* writeTextHeader @@ -211,24 +217,23 @@ writeTextHeader(fid, type) afs_int32 type; { struct structDumpHeader hostDumpHeader, netDumpHeader; - + hostDumpHeader.structversion = 1; - switch ( type ) - { - case TB_DUMPSCHEDULE: + switch (type) { + case TB_DUMPSCHEDULE: hostDumpHeader.type = SD_TEXT_DUMPSCHEDULE; break; - case TB_VOLUMESET: + case TB_VOLUMESET: hostDumpHeader.type = SD_TEXT_VOLUMESET; break; - case TB_TAPEHOSTS: + case TB_TAPEHOSTS: hostDumpHeader.type = SD_TEXT_TAPEHOSTS; break; - default: + default: LogError(0, "writeTextHeader: invalid type %d\n", type); BUDB_EXIT(1); } @@ -237,14 +242,15 @@ writeTextHeader(fid, type) structDumpHeader_hton(&hostDumpHeader, &netDumpHeader); if (canWrite(fid) <= 0) - return(BUDB_DUMPFAILED); + return (BUDB_DUMPFAILED); - if (write(fid, &netDumpHeader, sizeof(netDumpHeader)) != sizeof(netDumpHeader)) - return(BUDB_DUMPFAILED); + if (write(fid, &netDumpHeader, sizeof(netDumpHeader)) != + sizeof(netDumpHeader)) + return (BUDB_DUMPFAILED); haveWritten(sizeof(netDumpHeader)); - - return(0); + + return (0); } afs_int32 @@ -258,7 +264,7 @@ writeDbHeader(fid) extern struct memoryDB db; /* check the memory database header for integrity */ - if ( db.h.version != db.h.checkVersion ) + if (db.h.version != db.h.checkVersion) ERROR(BUDB_DATABASEINCONSISTENT); curtime = time(0); @@ -276,29 +282,29 @@ writeDbHeader(fid) ERROR(tcode); if (canWrite(fid) <= 0) - ERROR(BUDB_DUMPFAILED); + ERROR(BUDB_DUMPFAILED); if (write(fid, &header, sizeof(header)) != sizeof(header)) - ERROR(BUDB_DUMPFAILED); + ERROR(BUDB_DUMPFAILED); haveWritten(sizeof(header)); -error_exit: - return(code); + error_exit: + return (code); } /* writeDump * write out a dump entry structure */ -afs_int32 +afs_int32 writeDump(fid, dumpPtr) int fid; dbDumpP dumpPtr; { struct budb_dumpEntry dumpEntry; afs_int32 code = 0, tcode; - + tcode = dumpToBudbDump(dumpPtr, &dumpEntry); if (tcode) ERROR(tcode); @@ -308,12 +314,12 @@ writeDump(fid, dumpPtr) if (canWrite(fid) <= 0) ERROR(BUDB_DUMPFAILED); - if ( write(fid, &dumpEntry, sizeof(dumpEntry)) != sizeof(dumpEntry) ) + if (write(fid, &dumpEntry, sizeof(dumpEntry)) != sizeof(dumpEntry)) ERROR(BUDB_DUMPFAILED); haveWritten(sizeof(dumpEntry)); -error_exit: - return(code); + error_exit: + return (code); } afs_int32 @@ -324,7 +330,7 @@ writeTape(fid, tapePtr, dumpid) { struct budb_tapeEntry tapeEntry; afs_int32 code = 0, tcode; - + tcode = writeStructHeader(fid, SD_TAPE); if (tcode) ERROR(tcode); @@ -341,8 +347,8 @@ writeTape(fid, tapePtr, dumpid) haveWritten(sizeof(tapeEntry)); -error_exit: - return(code); + error_exit: + return (code); } /* combines volFragment and volInfo */ @@ -352,13 +358,13 @@ writeVolume(ut, fid, volFragmentPtr, volInfoPtr, dumpid, tapeName) struct ubik_trans *ut; int fid; struct volFragment *volFragmentPtr; - struct volInfo *volInfoPtr; + struct volInfo *volInfoPtr; afs_int32 dumpid; char *tapeName; { struct budb_volumeEntry budbVolume; afs_int32 code = 0; - + volsToBudbVol(volFragmentPtr, volInfoPtr, &budbVolume); budbVolume.dump = htonl(dumpid); @@ -374,8 +380,8 @@ writeVolume(ut, fid, volFragmentPtr, volInfoPtr, dumpid, tapeName) haveWritten(sizeof(budbVolume)); -error_exit: - return(code); + error_exit: + return (code); } /* ------------------- @@ -394,16 +400,16 @@ afs_int32 checkLock(textType) afs_int32 textType; { - db_lockP lockPtr; + db_lockP lockPtr; - if ( (textType < 0) || (textType > TB_NUM-1) ) - return(BUDB_BADARGUMENT); + if ((textType < 0) || (textType > TB_NUM - 1)) + return (BUDB_BADARGUMENT); lockPtr = &db.h.textLocks[textType]; - if ( lockPtr->lockState != 0 ) - return(BUDB_LOCKED); - return(0); + if (lockPtr->lockState != 0) + return (BUDB_LOCKED); + return (0); } /* checkText @@ -415,7 +421,7 @@ checkText(ut, textType) afs_int32 textType; { struct textBlock *tbPtr; - afs_int32 nBytes = 0; /* accumulated actual size */ + afs_int32 nBytes = 0; /* accumulated actual size */ afs_int32 size; struct block block; dbadr blockAddr; @@ -426,15 +432,15 @@ checkText(ut, textType) blockAddr = ntohl(tbPtr->textAddr); size = ntohl(tbPtr->size); - while ( blockAddr != 0 ) - { + while (blockAddr != 0) { /* read the block */ - code = cdbread(ut, text_BLOCK, blockAddr, (char *) &block, sizeof(block)); - if ( code ) + code = + cdbread(ut, text_BLOCK, blockAddr, (char *)&block, sizeof(block)); + if (code) ERROR(code); - + /* check its type */ - if ( block.h.type != text_BLOCK ) + if (block.h.type != text_BLOCK) ERROR(BUDB_DATABASEINCONSISTENT); /* add up the size */ @@ -444,11 +450,11 @@ checkText(ut, textType) } /* ensure that we have at least the expected amount of text */ - if ( nBytes < size ) + if (nBytes < size) ERROR(BUDB_DATABASEINCONSISTENT); - -error_exit: - return(code); + + error_exit: + return (code); } /* writeText @@ -456,7 +462,7 @@ error_exit: * textType - type of text block, e.g. TB_DUMPSCHEDULE */ -afs_int32 +afs_int32 writeText(ut, fid, textType) struct ubik_trans *ut; int fid; @@ -467,13 +473,13 @@ writeText(ut, fid, textType) dbadr dbAddr; struct block block; afs_int32 code = 0; - + /* check lock is free */ code = checkLock(textType); if (code) ERROR(code); - /* ensure that this block has the correct type */ + /* ensure that this block has the correct type */ code = checkText(ut, textType); if (code) { LogError(0, "writeText: text type %d damaged\n", textType); @@ -485,12 +491,12 @@ writeText(ut, fid, textType) dbAddr = ntohl(tbPtr->textAddr); if (!dbAddr) - goto error_exit; /* Don't save anything if no blocks */ + goto error_exit; /* Don't save anything if no blocks */ writeTextHeader(fid, textType); while (dbAddr) { - code = cdbread(ut, text_BLOCK, dbAddr, (char *) &block, sizeof(block)); + code = cdbread(ut, text_BLOCK, dbAddr, (char *)&block, sizeof(block)); if (code) ERROR(code); @@ -501,7 +507,7 @@ writeText(ut, fid, textType) if (canWrite(fid) <= 0) ERROR(BUDB_DUMPFAILED); - if (write(fid, &block.a[0], writeSize) != writeSize) + if (write(fid, &block.a[0], writeSize) != writeSize) ERROR(BUDB_IO); haveWritten(writeSize); @@ -510,8 +516,8 @@ writeText(ut, fid, textType) dbAddr = ntohl(block.h.next); } -error_exit: - return(code); + error_exit: + return (code); } #define MAXAPPENDS 200 @@ -527,7 +533,7 @@ writeDatabase(ut, fid) struct tape diskTape; dbadr volFragAddr; struct volFragment diskVolFragment; - struct volInfo diskVolInfo; + struct volInfo diskVolInfo; int length, hash; int old = 0; int entrySize; @@ -541,208 +547,232 @@ writeDatabase(ut, fid) /* write out a header identifying this database etc */ tcode = writeDbHeader(fid); if (tcode) { - LogError(tcode, "writeDatabase: Can't write Header\n"); + LogError(tcode, "writeDatabase: Can't write Header\n"); ERROR(tcode); } /* write out the tree of dump structures */ - mht = ht_GetType (HT_dumpIden_FUNCTION, &entrySize); + mht = ht_GetType(HT_dumpIden_FUNCTION, &entrySize); if (!mht) { - LogError(tcode, "writeDatabase: Can't get dump type\n"); + LogError(tcode, "writeDatabase: Can't get dump type\n"); ERROR(BUDB_BADARGUMENT); } for (old = 0; old <= 1; old++) { - /*oldnew*/ + /*oldnew */ /* only two states, old or not old */ - length = (old ? mht->oldLength : mht->length); + length = (old ? mht->oldLength : mht->length); if (!length) continue; - - for (hash=0; hash= MAXAPPENDS) numaddrs = MAXAPPENDS-1; /* don't overflow */ + if (numaddrs >= MAXAPPENDS) + numaddrs = MAXAPPENDS - 1; /* don't overflow */ appDumpAddrs[numaddrs] = dbAppAddr; numaddrs++; /* If we dump a 1000 appended dumps, assume a loop */ if (appcount >= 5 * MAXAPPENDS) { - Log("writeDatabase: Potential circular loop of appended dumps\n"); - Log("Skipping rest of appended dumps of dumpID %u. Dumped %d\n", - ntohl(diskDump.id), appcount); - break; + Log("writeDatabase: Potential circular loop of appended dumps\n"); + Log("Skipping rest of appended dumps of dumpID %u. Dumped %d\n", ntohl(diskDump.id), appcount); + break; } appcount++; /* Read the dump entry */ if (dbAddr == dbAppAddr) { - /* First time through, don't need to read the dump entry again */ - memcpy(&apDiskDump, &diskDump, sizeof(diskDump)); - } - else { - if (badEntry(dbAppAddr)) { - LogError(0, "writeDatabase: Damaged appended dump entry at addr 0x%x\n", dbAddr); - Log (" Skipping this and remainder of appended dumps of initial DumpID %u\n", - ntohl(diskDump.id)); - break; - } - - tcode = cdbread(ut, dump_BLOCK, dbAppAddr, &apDiskDump, sizeof(apDiskDump)); - if (tcode) { - LogError(tcode, "writeDatabase: Can't read appended dump entry (addr 0x%x)\n", - dbAppAddr); - Log (" Skipping this and remainder of appended dumps of initial DumpID %u\n", - ntohl(diskDump.id)); - break; - } - - /* Verify that this appended dump points to the initial dump */ - if (ntohl(apDiskDump.initialDumpID) != ntohl(diskDump.id)) { - LogError(0, "writeDatabase: Appended dumpID %u does not reference initial dumpID %u\n", - ntohl(apDiskDump.id), ntohl(diskDump.id)); - Log (" Skipping this appended dump\n"); - continue; - } + /* First time through, don't need to read the dump entry again */ + memcpy(&apDiskDump, &diskDump, sizeof(diskDump)); + } else { + if (badEntry(dbAppAddr)) { + LogError(0, + "writeDatabase: Damaged appended dump entry at addr 0x%x\n", + dbAddr); + Log(" Skipping this and remainder of appended dumps of initial DumpID %u\n", ntohl(diskDump.id)); + break; + } + + tcode = + cdbread(ut, dump_BLOCK, dbAppAddr, &apDiskDump, + sizeof(apDiskDump)); + if (tcode) { + LogError(tcode, + "writeDatabase: Can't read appended dump entry (addr 0x%x)\n", + dbAppAddr); + Log(" Skipping this and remainder of appended dumps of initial DumpID %u\n", ntohl(diskDump.id)); + break; + } + + /* Verify that this appended dump points to the initial dump */ + if (ntohl(apDiskDump.initialDumpID) != + ntohl(diskDump.id)) { + LogError(0, + "writeDatabase: Appended dumpID %u does not reference initial dumpID %u\n", + ntohl(apDiskDump.id), + ntohl(diskDump.id)); + Log(" Skipping this appended dump\n"); + continue; + } } /* Save the dump entry */ tcode = writeDump(fid, &apDiskDump); if (tcode) { - LogError(tcode, "writeDatabase: Can't write dump entry\n"); - ERROR(tcode); + LogError(tcode, + "writeDatabase: Can't write dump entry\n"); + ERROR(tcode); } - + /* For each tape on this dump */ - for (tapeAddr = ntohl(apDiskDump.firstTape); - tapeAddr; - tapeAddr = ntohl(diskTape.nextTape)) - { /*tapes*/ - /* read the tape entry */ - tcode = cdbread(ut, tape_BLOCK, tapeAddr, &diskTape, sizeof(diskTape)); + for (tapeAddr = ntohl(apDiskDump.firstTape); tapeAddr; tapeAddr = ntohl(diskTape.nextTape)) { /*tapes */ + /* read the tape entry */ + tcode = + cdbread(ut, tape_BLOCK, tapeAddr, &diskTape, + sizeof(diskTape)); if (tcode) { - LogError(tcode, "writeDatabase: Can't read tape entry (addr 0x%x) of dumpID %u\n", - tapeAddr, ntohl(apDiskDump.id)); - Log(" Skipping this and remaining tapes in the dump (and all their volumes)\n"); - break; + LogError(tcode, + "writeDatabase: Can't read tape entry (addr 0x%x) of dumpID %u\n", + tapeAddr, ntohl(apDiskDump.id)); + Log(" Skipping this and remaining tapes in the dump (and all their volumes)\n"); + break; } /* Save the tape entry */ - tcode = writeTape(fid, &diskTape, ntohl(apDiskDump.id)); + tcode = + writeTape(fid, &diskTape, ntohl(apDiskDump.id)); if (tcode) { - LogError(tcode, "writeDatabase: Can't write tape entry\n"); - ERROR(tcode); + LogError(tcode, + "writeDatabase: Can't write tape entry\n"); + ERROR(tcode); } - + /* For each volume on this tape. */ - for (volFragAddr = ntohl(diskTape.firstVol); - volFragAddr; - volFragAddr = ntohl(diskVolFragment.sameTapeChain)) - { /*volumes*/ + for (volFragAddr = ntohl(diskTape.firstVol); volFragAddr; volFragAddr = ntohl(diskVolFragment.sameTapeChain)) { /*volumes */ /* Read the volume Fragment entry */ - tcode = cdbread(ut, volFragment_BLOCK, volFragAddr, - &diskVolFragment, sizeof(diskVolFragment)); + tcode = + cdbread(ut, volFragment_BLOCK, volFragAddr, + &diskVolFragment, + sizeof(diskVolFragment)); if (tcode) { - LogError(tcode, "writeDatabase: Can't read volfrag entry (addr 0x%x) of dumpID %u\n", - volFragAddr, ntohl(apDiskDump.id)); - Log(" Skipping this and remaining volumes on tape '%s'\n", diskTape.name); - break; + LogError(tcode, + "writeDatabase: Can't read volfrag entry (addr 0x%x) of dumpID %u\n", + volFragAddr, ntohl(apDiskDump.id)); + Log(" Skipping this and remaining volumes on tape '%s'\n", diskTape.name); + break; } /* Read the volume Info entry */ - tcode = cdbread(ut, volInfo_BLOCK, ntohl(diskVolFragment.vol), - &diskVolInfo, sizeof(diskVolInfo)); + tcode = + cdbread(ut, volInfo_BLOCK, + ntohl(diskVolFragment.vol), + &diskVolInfo, sizeof(diskVolInfo)); if (tcode) { - LogError(tcode, "writeDatabase: Can't read volinfo entry (addr 0x%x) of dumpID %u\n", - ntohl(diskVolFragment.vol), ntohl(apDiskDump.id)); - Log(" Skipping volume on tape '%s'\n", diskTape.name); - continue; + LogError(tcode, + "writeDatabase: Can't read volinfo entry (addr 0x%x) of dumpID %u\n", + ntohl(diskVolFragment.vol), + ntohl(apDiskDump.id)); + Log(" Skipping volume on tape '%s'\n", + diskTape.name); + continue; } /* Save the volume entry */ - tcode = writeVolume(ut, fid, &diskVolFragment, &diskVolInfo, - ntohl(apDiskDump.id), diskTape.name); + tcode = + writeVolume(ut, fid, &diskVolFragment, + &diskVolInfo, + ntohl(apDiskDump.id), + diskTape.name); if (tcode) { - LogError(tcode, "writeDatabase: Can't write volume entry\n"); - ERROR(tcode); + LogError(tcode, + "writeDatabase: Can't write volume entry\n"); + ERROR(tcode); } - } /*volumes*/ - } /*tapes*/ - } /*appendedDumps*/ - } /*initialDumps*/ - } /*hashBuckets*/ - } /*oldnew*/ + } /*volumes */ + } /*tapes */ + } /*appendedDumps */ + } /*initialDumps */ + } /*hashBuckets */ + } /*oldnew */ /* write out the textual configuration information */ tcode = writeText(ut, fid, TB_DUMPSCHEDULE); if (tcode) { - LogError(tcode, "writeDatabase: Can't write dump schedule\n"); + LogError(tcode, "writeDatabase: Can't write dump schedule\n"); ERROR(tcode); } tcode = writeText(ut, fid, TB_VOLUMESET); if (tcode) { - LogError(tcode, "writeDatabase: Can't write volume set\n"); + LogError(tcode, "writeDatabase: Can't write volume set\n"); ERROR(tcode); } tcode = writeText(ut, fid, TB_TAPEHOSTS); if (tcode) { - LogError(tcode, "writeDatabase: Can't write tape hosts\n"); + LogError(tcode, "writeDatabase: Can't write tape hosts\n"); ERROR(tcode); } tcode = writeStructHeader(fid, SD_END); if (tcode) { - LogError(tcode, "writeDatabase: Can't write end savedb\n"); + LogError(tcode, "writeDatabase: Can't write end savedb\n"); ERROR(tcode); } - -error_exit: + + error_exit: doneWriting(code); - return(code); + return (code); } @@ -759,12 +789,12 @@ canWrite(fid) tp.tv_sec = 0; tp.tv_usec = 0; - out = ( 1 << fid ); + out = (1 << fid); in = 0; except = 0; code = IOMGR_Select(32, &in, &out, &except, &tp); - return(code); + return (code); } #endif /* notdef */ diff --git a/src/budb/db_hash.c b/src/budb/db_hash.c index ef5c4f88a..a58a647c4 100644 --- a/src/budb/db_hash.c +++ b/src/budb/db_hash.c @@ -10,13 +10,21 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_hash.c,v 1.1.1.5 2001/09/11 14:31:42 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/budb/db_hash.c,v 1.8 2003/11/23 04:53:31 jaltman Exp $"); #ifdef AFS_NT40_ENV #include #else #include #endif +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif #include #include #include @@ -27,29 +35,34 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_hash.c,v 1.1.1.5 2001/09/11 14: #include "error_macros.h" -int sizeFunctions[HT_MAX_FUNCTION+1]; -int nHTBuckets = NhtBucketS; /* testing: we need small HT blocks */ +int sizeFunctions[HT_MAX_FUNCTION + 1]; +int nHTBuckets = NhtBucketS; /* testing: we need small HT blocks */ /* ht_TableSize - return the size of table necessary to represent a hashtable * of given length in memory. It basically rounds the length up by the number * of buckets per block. */ -int ht_TableSize (length) - int length; -{ int n; - if (length == 0) return 0; - n = (length + nHTBuckets-1) / nHTBuckets; - return n*sizeof(struct memoryHTBlock *); +int +ht_TableSize(length) + int length; +{ + int n; + if (length == 0) + return 0; + n = (length + nHTBuckets - 1) / nHTBuckets; + return n * sizeof(struct memoryHTBlock *); } /* ht_ResetT - resets the in-memory representation of a hashtable block array. * It also resets the global variable nHTBuckets. */ -static void ht_ResetT (blocksP, sizeP, length) - struct memoryHTBlock ***blocksP; - int *sizeP; - int length; -{ struct memoryHTBlock **b = *blocksP; +static void +ht_ResetT(blocksP, sizeP, length) + struct memoryHTBlock ***blocksP; + int *sizeP; + int length; +{ + struct memoryHTBlock **b = *blocksP; int newsize; int n; int i; @@ -57,18 +70,20 @@ static void ht_ResetT (blocksP, sizeP, length) nHTBuckets = ntohl(db.h.nHTBuckets); if (b) { n = *sizeP / sizeof(b[0]); - newsize = ht_TableSize (length); + newsize = ht_TableSize(length); if (*sizeP != newsize) { /* free all blocks in the old array */ - for (i=0; ivalid = 0; + for (i = 0; i < n; i++) + if (b[i]) + b[i]->valid = 0; } } } @@ -77,25 +92,28 @@ static void ht_ResetT (blocksP, sizeP, length) * reinitialize a memory hash table. * Calls ht_ResetT to invalidate the two block arrays. */ - -void ht_Reset (mht) - struct memoryHashTable *mht; -{ struct hashTable *ht; + +void +ht_Reset(mht) + struct memoryHashTable *mht; +{ + struct hashTable *ht; if (!(mht && (ht = mht->ht))) - db_panic ("some ht called with bad mht"); + db_panic("some ht called with bad mht"); mht->threadOffset = ntohl(ht->threadOffset); mht->length = ntohl(ht->length); mht->oldLength = ntohl(ht->oldLength); mht->progress = ntohl(ht->progress); - ht_ResetT (&mht->blocks, &mht->size, mht->length); - ht_ResetT (&mht->oldBlocks, &mht->oldSize, mht->oldLength); + ht_ResetT(&mht->blocks, &mht->size, mht->length); + ht_ResetT(&mht->oldBlocks, &mht->oldSize, mht->oldLength); } /* InitDBhash - When server starts, do hash table initialization. test - initialization parameters: bit 4 is small ht. */ -afs_int32 InitDBhash () +afs_int32 +InitDBhash() { sizeFunctions[0] = 0; @@ -113,192 +131,216 @@ afs_int32 InitDBhash () /* ht_DBInit - When rebuilding database, this sets up the hash tables. */ -void ht_DBInit () +void +ht_DBInit() { db.h.nHTBuckets = htonl(nHTBuckets); - { struct volInfo *s = 0; - db.h.volName.threadOffset = htonl((char *)&s->nameHashChain - (char *)s); + { + struct volInfo *s = 0; + db.h.volName.threadOffset = + htonl((char *)&s->nameHashChain - (char *)s); db.h.volName.functionType = htonl(HT_volName_FUNCTION); } - { struct tape *s = 0; - db.h.tapeName.threadOffset = htonl((char *)&s->nameHashChain - (char *)s); + { + struct tape *s = 0; + db.h.tapeName.threadOffset = + htonl((char *)&s->nameHashChain - (char *)s); db.h.tapeName.functionType = htonl(HT_tapeName_FUNCTION); } - { struct dump *s = 0; - db.h.dumpName.threadOffset = htonl((char *)&s->nameHashChain - (char *)s); + { + struct dump *s = 0; + db.h.dumpName.threadOffset = + htonl((char *)&s->nameHashChain - (char *)s); db.h.dumpName.functionType = htonl(HT_dumpName_FUNCTION); - db.h.dumpIden.threadOffset = htonl((char *)&s->idHashChain - (char *)s); + db.h.dumpIden.threadOffset = + htonl((char *)&s->idHashChain - (char *)s); db.h.dumpIden.functionType = htonl(HT_dumpIden_FUNCTION); } - ht_Reset (&db.volName); - ht_Reset (&db.tapeName); - ht_Reset (&db.dumpName); - ht_Reset (&db.dumpIden); + ht_Reset(&db.volName); + ht_Reset(&db.tapeName); + ht_Reset(&db.dumpName); + ht_Reset(&db.dumpIden); } -afs_int32 ht_AllocTable (ut, mht) - struct ubik_trans *ut; - struct memoryHashTable *mht; -{ struct hashTable *ht; - afs_int32 code; - int len; - int nb, mnb; /* number of blocks for hashTable */ - int i; +afs_int32 +ht_AllocTable(ut, mht) + struct ubik_trans *ut; + struct memoryHashTable *mht; +{ + struct hashTable *ht; + afs_int32 code; + int len; + int nb, mnb; /* number of blocks for hashTable */ + int i; struct memoryHTBlock **b; - if (!(mht && (ht = mht->ht))) db_panic ("some ht called with bad mht"); - if (ht->length || mht->blocks) db_panic ("previous table still allocated"); + if (!(mht && (ht = mht->ht))) + db_panic("some ht called with bad mht"); + if (ht->length || mht->blocks) + db_panic("previous table still allocated"); len = ntohl(ht->entries) * 2; /* allow room to grow */ - nb = (len + nHTBuckets-1) / nHTBuckets; + nb = (len + nHTBuckets - 1) / nHTBuckets; mnb = ht_minHBlocks(mht); - if (nb < mnb) nb = mnb; /* use minimum */ - len = nb * nHTBuckets; /* new hash table length */ + if (nb < mnb) + nb = mnb; /* use minimum */ + len = nb * nHTBuckets; /* new hash table length */ - mht->size = nb*sizeof(struct memoryHTBlock *); - b = mht->blocks = (struct memoryHTBlock **)malloc (mht->size); + mht->size = nb * sizeof(struct memoryHTBlock *); + b = mht->blocks = (struct memoryHTBlock **)malloc(mht->size); memset(b, 0, mht->size); - for (i=0; ib, &b[i]->a); - if (code) return code; + for (i = 0; i < nb; i++) { + b[i] = (struct memoryHTBlock *)malloc(sizeof(struct memoryHTBlock)); + code = AllocBlock(ut, (struct block *)&b[i]->b, &b[i]->a); + if (code) + return code; b[i]->valid = 0; b[i]->b.h.type = hashTable_BLOCK; /* thread the blocks */ - if (i) b[i-1]->b.h.next = htonl(b[i]->a); + if (i) + b[i - 1]->b.h.next = htonl(b[i]->a); } - for (i=0; ia, (char *)&b[i]->b, - sizeof(struct htBlock) + (nHTBuckets-NhtBucketS)*sizeof(dbadr)); + for (i = 0; i < nb; i++) { + code = + dbwrite(ut, b[i]->a, (char *)&b[i]->b, + sizeof(struct htBlock) + (nHTBuckets - + NhtBucketS) * sizeof(dbadr)); if (code) return code; } - if (code = set_word_addr (ut, 0, &db.h, &ht->table, htonl(b[0]->a))) + if (code = set_word_addr(ut, 0, &db.h, &ht->table, htonl(b[0]->a))) return code; - if (code = set_word_addr (ut, 0, &db.h, &ht->length, htonl(len))) + if (code = set_word_addr(ut, 0, &db.h, &ht->length, htonl(len))) return code; mht->length = len; return 0; } -afs_int32 ht_FreeTable (ut, mht) - struct ubik_trans *ut; - struct memoryHashTable *mht; -{ struct hashTable *ht; - afs_int32 code; +afs_int32 +ht_FreeTable(ut, mht) + struct ubik_trans *ut; + struct memoryHashTable *mht; +{ + struct hashTable *ht; + afs_int32 code; struct blockHeader bh; - dbadr a,na; + dbadr a, na; - if (!(mht && (ht = mht->ht))) db_panic ("some ht called with bad mht"); - if (ht->oldLength == 0) db_panic ("no table to free"); + if (!(mht && (ht = mht->ht))) + db_panic("some ht called with bad mht"); + if (ht->oldLength == 0) + db_panic("no table to free"); - ht_ResetT (&mht->oldBlocks, &mht->oldSize, 0); + ht_ResetT(&mht->oldBlocks, &mht->oldSize, 0); - for (a=ntohl(ht->oldTable); a; a=na) { - if (dbread (ut, a, (char *)&bh, sizeof(bh))) - { + for (a = ntohl(ht->oldTable); a; a = na) { + if (dbread(ut, a, (char *)&bh, sizeof(bh))) { Log("ht_FreeTable: dbread failed\n"); return BUDB_IO; } na = ntohl(bh.next); - if (code = FreeBlock (ut, &bh, a)) return code; + if (code = FreeBlock(ut, &bh, a)) + return code; } - if (set_word_addr (ut, 0, &db.h, &ht->oldTable, 0) || - set_word_addr (ut, 0, &db.h, &ht->oldLength, 0) || - set_word_addr (ut, 0, &db.h, &ht->progress, 0)) + if (set_word_addr(ut, 0, &db.h, &ht->oldTable, 0) + || set_word_addr(ut, 0, &db.h, &ht->oldLength, 0) + || set_word_addr(ut, 0, &db.h, &ht->progress, 0)) return BUDB_IO; mht->oldLength = mht->progress = 0; return 0; } -afs_int32 -ht_GetTableBlock (ut, mht, hash, old, blockP, boP) - struct ubik_trans *ut; - struct memoryHashTable *mht; - afs_uint32 hash; - int old; - struct memoryHTBlock **blockP; - int *boP; -{ +afs_int32 +ht_GetTableBlock(ut, mht, hash, old, blockP, boP) + struct ubik_trans *ut; + struct memoryHashTable *mht; + afs_uint32 hash; + int old; + struct memoryHTBlock **blockP; + int *boP; +{ struct hashTable *ht; struct memoryHTBlock **b; - int hi,bi; + int hi, bi; struct memoryHTBlock ***blocksP; - int *sizeP; - int n; - int i; - int length; + int *sizeP; + int n; + int i; + int length; dbadr ta; - if ( (mht == 0) - || ((ht = mht->ht) == 0) - ) - { - db_panic ("some ht called with bad mht"); + if ((mht == 0) + || ((ht = mht->ht) == 0) + ) { + db_panic("some ht called with bad mht"); } *blockP = 0; if (old) { - if ((length = mht->oldLength) == 0) return 0; /* no entries */ + if ((length = mht->oldLength) == 0) + return 0; /* no entries */ hi = hash % length; - if (hi < mht->progress) return 0; /* no such entry */ + if (hi < mht->progress) + return 0; /* no such entry */ blocksP = &mht->oldBlocks; sizeP = &mht->oldSize; } else { - if ((length = mht->length) == 0) return 0; /* no entries */ + if ((length = mht->length) == 0) + return 0; /* no entries */ hi = hash % length; blocksP = &mht->blocks; sizeP = &mht->size; } - bi = hi / nHTBuckets; /* block index */ - *boP = hi - bi*nHTBuckets; /* block offset ptr */ + bi = hi / nHTBuckets; /* block index */ + *boP = hi - bi * nHTBuckets; /* block offset ptr */ if (*blocksP == 0) { - *sizeP = ht_TableSize (length); - *blocksP = (struct memoryHTBlock **)malloc (*sizeP); + *sizeP = ht_TableSize(length); + *blocksP = (struct memoryHTBlock **)malloc(*sizeP); memset(*blocksP, 0, *sizeP); } - n = *sizeP / sizeof (struct memoryHTBlock *); - if (bi >= n) db_panic ("table size inconsistent"); + n = *sizeP / sizeof(struct memoryHTBlock *); + if (bi >= n) + db_panic("table size inconsistent"); b = *blocksP; /* find an allocated block or the beginning of the block array */ - for (i=bi; (i>0) && (b[i] == 0); i--); + for (i = bi; (i > 0) && (b[i] == 0); i--); while (1) { if (b[i] == 0) { - if (i == 0) { /* the first block is found from the hashTable */ + if (i == 0) { /* the first block is found from the hashTable */ ta = ntohl(old ? ht->oldTable : ht->table); - if (ta == 0) db_panic ("non-zero length, but no table"); + if (ta == 0) + db_panic("non-zero length, but no table"); } /* else ta is set from last time around loop */ - b[i] = (struct memoryHTBlock *)malloc (sizeof (struct memoryHTBlock)); + b[i] = + (struct memoryHTBlock *)malloc(sizeof(struct memoryHTBlock)); b[i]->a = ta; b[i]->valid = 0; } if (!b[i]->valid) { - if (dbread (ut, b[i]->a, (char *)&b[i]->b, sizeof(struct htBlock))) + if (dbread(ut, b[i]->a, (char *)&b[i]->b, sizeof(struct htBlock))) return BUDB_IO; b[i]->valid = 1; } - if (i == bi) - { + if (i == bi) { *blockP = b[bi]; /* printf("ht_GetTableBlock: hash %d block %d offset %d\n", - hash, *blockP, *boP); */ + * hash, *blockP, *boP); */ return 0; - } + } ta = ntohl(b[i++]->b.h.next); /* get next ptr from current block */ } @@ -310,17 +352,17 @@ ht_GetTableBlock (ut, mht, hash, old, blockP, boP) * into the current table. */ -static afs_int32 -ht_MaybeAdjust (ut, mht) +static afs_int32 +ht_MaybeAdjust(ut, mht) struct ubik_trans *ut; struct memoryHashTable *mht; -{ +{ struct hashTable *ht = mht->ht; int numberEntries = ntohl(ht->entries); /* old hash table must be empty */ - if ( mht->oldLength != 0) - return(0); + if (mht->oldLength != 0) + return (0); /* * It costs a lot to grow and shrink the hash table. Therefore, we will not @@ -339,54 +381,64 @@ ht_MaybeAdjust (ut, mht) * in which case we do want to grow it). We don't grow anything larger * than 20,450 entries because it's expensive to re-hash everything. */ - if ((numberEntries > mht->length*2) && (numberEntries < 20450)) - { /* push current hash table to old hash table */ + if ((numberEntries > mht->length * 2) && (numberEntries < 20450)) { /* push current hash table to old hash table */ ht->oldLength = ht->length; - ht->oldTable = ht->table; - ht->progress = 0; - ht->length = 0; - ht->table = 0; - if (dbwrite (ut, ((char *)ht - (char *)&db.h), (char *)ht, sizeof (*ht))) + ht->oldTable = ht->table; + ht->progress = 0; + ht->length = 0; + ht->table = 0; + if (dbwrite + (ut, ((char *)ht - (char *)&db.h), (char *)ht, sizeof(*ht))) return BUDB_IO; - ht_Reset (mht); + ht_Reset(mht); LogDebug(2, "ht_MaybeAdjust: push ht to old\n"); } return 0; } -dbadr ht_LookupBucket (ut, mht, hash, old) - struct ubik_trans *ut; - struct memoryHashTable *mht; - afs_uint32 hash; - int old; -{ struct memoryHTBlock *block; - int bo; - afs_int32 code; - - if ((old ? mht->oldLength : mht->length) == 0) return 0; - code = ht_GetTableBlock (ut, mht, hash, old, &block, &bo); - if (code || (block == 0)) return 0; +dbadr +ht_LookupBucket(ut, mht, hash, old) + struct ubik_trans *ut; + struct memoryHashTable *mht; + afs_uint32 hash; + int old; +{ + struct memoryHTBlock *block; + int bo; + afs_int32 code; + + if ((old ? mht->oldLength : mht->length) == 0) + return 0; + code = ht_GetTableBlock(ut, mht, hash, old, &block, &bo); + if (code || (block == 0)) + return 0; return ntohl(block->b.bucket[bo]); } /* This function is not too bad, for small hash tables, but suffers, I think, * from insufficient mixing of the hash information. */ -afs_uint32 Old2StringHashFunction (str) - unsigned char *str; -{ afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ - while (*str) hash = (hash<<1) + (hash>>31) + *str++; +afs_uint32 +Old2StringHashFunction(str) + unsigned char *str; +{ + afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ + while (*str) + hash = (hash << 1) + (hash >> 31) + *str++; return hash; } /* This was actually a coding error, and produces dreadful results. The * problem is that the hash needs to be mixed up not the incoming character. */ -afs_uint32 Old3StringHashFunction (str) - unsigned char *str; -{ afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ - while (*str) hash += (*str++) * 0x072a51a4; +afs_uint32 +Old3StringHashFunction(str) + unsigned char *str; +{ + afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ + while (*str) + hash += (*str++) * 0x072a51a4; return hash; } @@ -394,20 +446,26 @@ afs_uint32 Old3StringHashFunction (str) * the hash multiplier are zero which tends to shift information too far left. * It behaves especially badly for hash tables whose size is a power of two. */ -afs_uint32 Old4StringHashFunction (str) - unsigned char *str; -{ afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ - while (*str) hash = (*str++) + hash * 0x072a51a4; +afs_uint32 +Old4StringHashFunction(str) + unsigned char *str; +{ + afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ + while (*str) + hash = (*str++) + hash * 0x072a51a4; return hash; } /* While this is good for a hash table with 500 buckets it is nearly as bad as * #3 with a hash table as big as 8200. */ -afs_uint32 Old5StringHashFunction (str) - unsigned char *str; -{ afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ - while (*str) hash += (*str++); +afs_uint32 +Old5StringHashFunction(str) + unsigned char *str; +{ + afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ + while (*str) + hash += (*str++); return hash; } @@ -416,10 +474,13 @@ afs_uint32 Old5StringHashFunction (str) * and the difference seems to be smaller with larger hash tables. It behaves * better than the random hash function. */ -afs_uint32 Old6StringHashFunction (str) - unsigned char *str; -{ afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ - while (*str) hash = hash*0x81 + (*str++); +afs_uint32 +Old6StringHashFunction(str) + unsigned char *str; +{ + afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ + while (*str) + hash = hash * 0x81 + (*str++); return hash; } @@ -428,10 +489,13 @@ afs_uint32 Old6StringHashFunction (str) * having the bits spanning the same range farther apart also doesn't do as * well. All these differences are fairly small, however. */ -afs_uint32 Old7StringHashFunction (str) - unsigned char *str; -{ afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ - while (*str) hash = hash*0x42108421 + (*str++); +afs_uint32 +Old7StringHashFunction(str) + unsigned char *str; +{ + afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ + while (*str) + hash = hash * 0x42108421 + (*str++); return hash; } @@ -439,12 +503,15 @@ afs_uint32 Old7StringHashFunction (str) * from higher-order bits in the word. It also uses shifts instead of * multiplies, which may be faster on some architectures. */ -afs_uint32 Old8StringHashFunction (str) - unsigned char *str; -{ afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ +afs_uint32 +Old8StringHashFunction(str) + unsigned char *str; +{ + afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ while (*str) - hash = hash + (hash<<7) + (hash<<14) + (hash<<21) + (hash<<28) + - (hash>>17) + *str++; + hash = + hash + (hash << 7) + (hash << 14) + (hash << 21) + (hash << 28) + + (hash >> 17) + *str++; return hash; } @@ -453,86 +520,93 @@ afs_uint32 Old8StringHashFunction (str) * constraints. It shouldn't have too many or too few one bits and should be * odd. It behaves beeter than the random hash function. */ -afs_uint32 StringHashFunction (str) - unsigned char *str; -{ afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ +afs_uint32 +StringHashFunction(str) + unsigned char *str; +{ + afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */ /* The multiplicative constant should be odd and have a goodly number of * one bits. */ - while (*str) hash = (*str++) + hash * 0x10204081; + while (*str) + hash = (*str++) + hash * 0x10204081; return hash; } -afs_uint32 IdHashFunction (id) - afs_uint32 id; -{ afs_uint32 l,r; +afs_uint32 +IdHashFunction(id) + afs_uint32 id; +{ + afs_uint32 l, r; id *= 81847; l = id | 0xaaaaaaaa; r = id | 0x55555555; - return (l*r); + return (l * r); } /* The minimum hash table blocks to allocate. Each block contains 510 * buckets. They hash table grows when the number of entries reaches * twice the number of buckets. */ -int ht_minHBlocks(mht) - struct memoryHashTable *mht; +int +ht_minHBlocks(mht) + struct memoryHashTable *mht; { int retval; - switch ( ntohl(mht->ht->functionType) ) - { - case HT_dumpIden_FUNCTION: - case HT_dumpName_FUNCTION: /* hash table able to handle (befor it grows) ... */ - retval = 2; /* 1,020 dump entries */ + switch (ntohl(mht->ht->functionType)) { + case HT_dumpIden_FUNCTION: + case HT_dumpName_FUNCTION: /* hash table able to handle (befor it grows) ... */ + retval = 2; /* 1,020 dump entries */ break; - case HT_tapeName_FUNCTION: - retval = 4; /* 2,040 tape entries */ + case HT_tapeName_FUNCTION: + retval = 4; /* 2,040 tape entries */ break; - case HT_volName_FUNCTION: - retval = 60; /* 61,200 volInfo entries (with different names) */ + case HT_volName_FUNCTION: + retval = 60; /* 61,200 volInfo entries (with different names) */ break; - default: db_panic ("Illegal hash function type"); + default: + db_panic("Illegal hash function type"); } return (retval); } -afs_uint32 ht_HashEntry (mht, e) - struct memoryHashTable *mht; - char *e; /* entry's address (in b) */ -{ - int type = ntohl(mht->ht->functionType); +afs_uint32 +ht_HashEntry(mht, e) + struct memoryHashTable *mht; + char *e; /* entry's address (in b) */ +{ + int type = ntohl(mht->ht->functionType); afs_uint32 retval; - - switch (type) - { - case HT_dumpIden_FUNCTION: + + switch (type) { + case HT_dumpIden_FUNCTION: retval = IdHashFunction(ntohl(((struct dump *)e)->id)); LogDebug(5, "HashEntry: dumpid returns %d\n", retval); break; - case HT_dumpName_FUNCTION: + case HT_dumpName_FUNCTION: retval = StringHashFunction(((struct dump *)e)->dumpName); LogDebug(5, "HashEntry: dumpname returns %d\n", retval); break; - case HT_tapeName_FUNCTION: + case HT_tapeName_FUNCTION: retval = StringHashFunction(((struct tape *)e)->name); LogDebug(5, "HashEntry: tapename returns %d\n", retval); break; - case HT_volName_FUNCTION: - retval = StringHashFunction (((struct volInfo *)e)->name); + case HT_volName_FUNCTION: + retval = StringHashFunction(((struct volInfo *)e)->name); LogDebug(5, "HashEntry: volname returns %d\n", retval); break; - default: db_panic ("illegal hash function"); + default: + db_panic("illegal hash function"); } - return(retval); + return (retval); } @@ -543,57 +617,62 @@ afs_uint32 ht_HashEntry (mht, e) struct memoryHashTable * ht_GetType(type, e_sizeP) - int type; - int *e_sizeP; -{ + int type; + int *e_sizeP; +{ struct memoryHashTable *mht; - if ((type <= 0) || (type > HT_MAX_FUNCTION)) + if ((type <= 0) || (type > HT_MAX_FUNCTION)) return 0; - if (e_sizeP) *e_sizeP = sizeFunctions[type]; - switch (type) - { - case HT_dumpIden_FUNCTION: + if (e_sizeP) + *e_sizeP = sizeFunctions[type]; + switch (type) { + case HT_dumpIden_FUNCTION: mht = &db.dumpIden; break; - case HT_dumpName_FUNCTION: + case HT_dumpName_FUNCTION: mht = &db.dumpName; break; - case HT_tapeName_FUNCTION: + case HT_tapeName_FUNCTION: mht = &db.tapeName; break; - case HT_volName_FUNCTION: + case HT_volName_FUNCTION: mht = &db.volName; break; - default: return 0; + default: + return 0; } if (ntohl(mht->ht->functionType) != type) - db_panic ("ht types don't match"); + db_panic("ht types don't match"); return mht; } -static int ht_KeyMatch (type, key, e) - int type; - char *key; - char *e; +static int +ht_KeyMatch(type, key, e) + int type; + char *key; + char *e; { switch (type) { - case HT_dumpIden_FUNCTION: - return *(dumpId *)key == ntohl(((struct dump *)e)->id); - case HT_dumpName_FUNCTION: - return strcmp (key, ((struct dump *)e)->dumpName) == 0; - case HT_tapeName_FUNCTION: - return strcmp (key, ((struct tape *)e)->name) == 0; - case HT_volName_FUNCTION: - return strcmp (key, ((struct volInfo *)e)->name) == 0; - - default: db_panic ("illegal hash function"); + case HT_dumpIden_FUNCTION: + return *(dumpId *) key == ntohl(((struct dump *)e)->id); + case HT_dumpName_FUNCTION: + return strcmp(key, ((struct dump *)e)->dumpName) == 0; + case HT_tapeName_FUNCTION: + return strcmp(key, ((struct tape *)e)->name) == 0; + case HT_volName_FUNCTION: + return strcmp(key, ((struct volInfo *)e)->name) == 0; + + default: + db_panic("illegal hash function"); } + /* not reached */ + return 0; } /* ht_LookupEntry @@ -607,45 +686,47 @@ static int ht_KeyMatch (type, key, e) */ afs_int32 -ht_LookupEntry (ut, mht, key, eaP, e) - struct ubik_trans *ut; - struct memoryHashTable *mht; - char *key; /* pointer to lookup key to match */ - dbadr *eaP; /* db addr of entry found or zero */ - char *e; /* contents of located entry */ -{ struct hashTable *ht; - int type; - int e_size; - int old; +ht_LookupEntry(ut, mht, key, eaP, e) + struct ubik_trans *ut; + struct memoryHashTable *mht; + char *key; /* pointer to lookup key to match */ + dbadr *eaP; /* db addr of entry found or zero */ + char *e; /* contents of located entry */ +{ + struct hashTable *ht; + int type; + int e_size; + int old; afs_uint32 hash; dbadr a; - if (!key || !eaP || !e) db_panic ("null ptrs passed to LookupEntry"); - if (!(mht && (ht = mht->ht))) db_panic ("some ht called with bad mht"); + if (!key || !eaP || !e) + db_panic("null ptrs passed to LookupEntry"); + if (!(mht && (ht = mht->ht))) + db_panic("some ht called with bad mht"); - *eaP = 0; /* initialize not-found indicator */ + *eaP = 0; /* initialize not-found indicator */ type = ntohl(ht->functionType); e_size = sizeFunctions[type]; if (type == HT_dumpIden_FUNCTION) - hash = IdHashFunction (*(dumpId *)key); + hash = IdHashFunction(*(dumpId *) key); else - hash = StringHashFunction (key); + hash = StringHashFunction(key); - for (old=0; ; old++) - { - a = ht_LookupBucket (ut, mht, hash, old); + for (old = 0;; old++) { + a = ht_LookupBucket(ut, mht, hash, old); while (a) { - if (dbread (ut, a, e, e_size)) - return BUDB_IO; - if (ht_KeyMatch (type, key, e)) - { + if (dbread(ut, a, e, e_size)) + return BUDB_IO; + if (ht_KeyMatch(type, key, e)) { *eaP = a; return 0; } - a = ntohl(*(dbadr *)(e + mht->threadOffset)); + a = ntohl(*(dbadr *) (e + mht->threadOffset)); } - if (old) return 0; + if (old) + return 0; } } @@ -656,7 +737,8 @@ ht_LookupEntry (ut, mht, key, eaP, e) * opQuota - adjusted to reflect # of moves */ -static afs_int32 ht_HashInList (ut, mht, opQuota, block, blockOffset) +static afs_int32 +ht_HashInList(ut, mht, opQuota, block, blockOffset) struct ubik_trans *ut; struct memoryHashTable *mht; int *opQuota; @@ -664,16 +746,14 @@ static afs_int32 ht_HashInList (ut, mht, opQuota, block, blockOffset) int blockOffset; { struct hashTable *ht = mht->ht; - afs_int32 code; + afs_int32 code; dbadr ea, next_ea; dbadr listA; - char e[sizeof(struct block)]; /* unnecessarily conservative */ - int e_size = sizeFunctions[ntohl(ht->functionType)]; + char e[sizeof(struct block)]; /* unnecessarily conservative */ + int e_size = sizeFunctions[ntohl(ht->functionType)]; - if (mht->length == 0) - { - if (code = ht_AllocTable (ut, mht)) - { + if (mht->length == 0) { + if (code = ht_AllocTable(ut, mht)) { Log("ht_HashInList: ht_AllocTable failed\n"); return code; } @@ -681,52 +761,49 @@ static afs_int32 ht_HashInList (ut, mht, opQuota, block, blockOffset) listA = ntohl(block->b.bucket[blockOffset]); - if (listA == 0) - { + if (listA == 0) { Log("ht_HashInList: expecting non-zero bucket\n"); return 0; } - for (ea=listA; ea; ea=next_ea) - { /*f*/ + for (ea = listA; ea; ea = next_ea) { /*f */ - LogDebug(3, "ht_HashInList: move entry at %d, type %d\n", - ea, ntohl(mht->ht->functionType)); + LogDebug(3, "ht_HashInList: move entry at %d, type %d\n", ea, + ntohl(mht->ht->functionType)); - if (dbread (ut, ea, e, e_size)) + if (dbread(ut, ea, e, e_size)) return BUDB_IO; - /* LogNetDump((struct dump *) e); */ + /* LogNetDump((struct dump *) e); */ /* get the address of the next item on the list */ - next_ea = ntohl(*(dbadr *)(e + mht->threadOffset)); + next_ea = ntohl(*(dbadr *) (e + mht->threadOffset)); /* write the link into the bucket */ - code = set_word_addr (ut, block->a, &block->b, &block->b.bucket[blockOffset], - htonl(next_ea)); - if (code) - { + code = + set_word_addr(ut, block->a, &block->b, + &block->b.bucket[blockOffset], htonl(next_ea)); + if (code) { Log("ht_HashInList: bucket update failed\n"); - return(code); + return (code); } - { struct memoryHTBlock *block; - int bo; + { + struct memoryHTBlock *block; + int bo; afs_uint32 hash; /* get the hash value */ - hash = ht_HashEntry (mht, e) % mht->length; + hash = ht_HashEntry(mht, e) % mht->length; LogDebug(4, "ht_HashInList: moved to %d\n", hash); /* get the new hash table block */ - code = ht_GetTableBlock (ut, mht, hash, 0/*old*/, &block, &bo); - if (code) - { + code = ht_GetTableBlock(ut, mht, hash, 0 /*old */ , &block, &bo); + if (code) { Log("ht_HashInList: ht_GetTableBlock failed\n"); return code; } - if (block == 0) - { + if (block == 0) { Log("ht_HashInList: ht_GetTableBlock returned 0\n"); return BUDB_INTERNALERROR; } @@ -735,14 +812,16 @@ static afs_int32 ht_HashInList (ut, mht, opQuota, block, blockOffset) * first threadOffset of entry = bucket * then bucket = addr of entry */ - if (set_word_offset (ut, ea, e, mht->threadOffset, block->b.bucket[bo]) || - set_word_addr (ut, block->a, &block->b, &block->b.bucket[bo], htonl(ea))) + if (set_word_offset + (ut, ea, e, mht->threadOffset, block->b.bucket[bo]) + || set_word_addr(ut, block->a, &block->b, + &block->b.bucket[bo], htonl(ea))) return BUDB_IO; } - if ( --(*opQuota) == 0 ) + if (--(*opQuota) == 0) break; - } /*f*/ + } /*f */ return 0; } @@ -752,16 +831,16 @@ static afs_int32 ht_HashInList (ut, mht, opQuota, block, blockOffset) * to the new. */ -static afs_int32 +static afs_int32 ht_MoveEntries(ut, mht) struct ubik_trans *ut; struct memoryHashTable *mht; -{ +{ struct memoryHTBlock *block; afs_uint32 hash; int count; - int bo; - afs_int32 code; + int bo; + afs_int32 code; if (mht->oldLength == 0) return 0; @@ -773,43 +852,39 @@ ht_MoveEntries(ut, mht) hash = mht->progress; /* get hash table block ? */ - code = ht_GetTableBlock (ut, mht, hash, 1 /*old*/, &block, &bo); - if (code) + code = ht_GetTableBlock(ut, mht, hash, 1 /*old */ , &block, &bo); + if (code) return code; - if (block == 0) + if (block == 0) return BUDB_INTERNALERROR; - count = 10; /* max. # entries to move */ + count = 10; /* max. # entries to move */ do { - if (block->b.bucket[bo]) - { + if (block->b.bucket[bo]) { code = ht_HashInList(ut, mht, &count, block, bo); - if ( code ) - { + if (code) { Log("ht_MoveEntries: ht_HashInList failed\n"); - return(BUDB_IO); + return (BUDB_IO); } } - if (block->b.bucket[bo] == 0) - { + if (block->b.bucket[bo] == 0) { /* this bucket is now empty */ mht->progress++; } /* don't exceed the quota of items to be moved */ - if ( count == 0 ) + if (count == 0) break; } while (++bo < nHTBuckets); if (mht->progress >= mht->oldLength) - return( ht_FreeTable (ut, mht) ); + return (ht_FreeTable(ut, mht)); - if (set_word_addr (ut, 0, &db.h, &mht->ht->progress, htonl(mht->progress))) - { + if (set_word_addr(ut, 0, &db.h, &mht->ht->progress, htonl(mht->progress))) { Log("ht_MoveEntries: progress set failed\n"); return BUDB_IO; } @@ -818,15 +893,15 @@ ht_MoveEntries(ut, mht) #ifdef notdef -static afs_int32 +static afs_int32 ht_MoveEntries(ut, mht) struct ubik_trans *ut; struct memoryHashTable *mht; -{ +{ afs_uint32 hash; - int bo; + int bo; struct memoryHTBlock *block; - afs_int32 code; + afs_int32 code; if (mht->oldLength == 0) return 0; @@ -838,26 +913,25 @@ ht_MoveEntries(ut, mht) hash = mht->progress; /* get hash table block ? */ - code = ht_GetTableBlock (ut, mht, hash, 1 /*old*/, &block, &bo); - if (code) + code = ht_GetTableBlock(ut, mht, hash, 1 /*old */ , &block, &bo); + if (code) return code; - if (block == 0) + if (block == 0) return BUDB_INTERNALERROR; do { mht->progress++; - if (block->b.bucket[bo]) - { + if (block->b.bucket[bo]) { code = ht_HashInList(ut, mht, ntohl(block->b.bucket[bo])); - if ( code ) - { + if (code) { Log("ht_MoveEntries: ht_HashInList failed\n"); - return(BUDB_IO); + return (BUDB_IO); } - code = set_word_addr(ut, block->a, &block->b, &block->b.bucket[bo], 0); - if ( code ) - { + code = + set_word_addr(ut, block->a, &block->b, &block->b.bucket[bo], + 0); + if (code) { Log("ht_MoveEntries: clear old entry failed\n"); return BUDB_IO; } @@ -866,10 +940,9 @@ ht_MoveEntries(ut, mht) } while (++bo < nHTBuckets); if (mht->progress >= mht->oldLength) - return( ht_FreeTable (ut, mht) ); + return (ht_FreeTable(ut, mht)); - if (set_word_addr (ut, 0, &db.h, &mht->ht->progress, htonl(mht->progress))) - { + if (set_word_addr(ut, 0, &db.h, &mht->ht->progress, htonl(mht->progress))) { Log("ht_MoveEntries: progress set failed\n"); return BUDB_IO; } @@ -877,45 +950,55 @@ ht_MoveEntries(ut, mht) } #endif /* notdef */ -afs_int32 +afs_int32 ht_HashIn(ut, mht, ea, e) struct ubik_trans *ut; struct memoryHashTable *mht; - dbadr ea; /* block db address */ - char *e; /* entry's address (in b) */ -{ + dbadr ea; /* block db address */ + char *e; /* entry's address (in b) */ +{ struct hashTable *ht; afs_uint32 hash; struct memoryHTBlock *block; - int bo; - afs_int32 code; + int bo; + afs_int32 code; - if (!(mht && (ht = mht->ht))) - db_panic("some ht called with bad mht"); + if (!(mht && (ht = mht->ht))) + db_panic("some ht called with bad mht"); - if (code = ht_MaybeAdjust (ut, mht)) + if (code = ht_MaybeAdjust(ut, mht)) return code; - if (mht->length == 0) - if (code = ht_AllocTable (ut, mht)) + if (mht->length == 0) + if (code = ht_AllocTable(ut, mht)) return code; - hash = ht_HashEntry (mht, e); - code = ht_GetTableBlock (ut, mht, hash, 0/*old*/, &block, &bo); - if (code) return code; - if (!block) return BUDB_INTERNALERROR; + hash = ht_HashEntry(mht, e); + code = ht_GetTableBlock(ut, mht, hash, 0 /*old */ , &block, &bo); + if (code) + return code; + if (!block) + return BUDB_INTERNALERROR; code = set_word_offset(ut, ea, e, mht->threadOffset, block->b.bucket[bo]); - if (code) return BUDB_IO; - LogDebug(5, "Hashin: set %d to %d\n", mht->threadOffset, block->b.bucket[bo]); + if (code) + return BUDB_IO; + LogDebug(5, "Hashin: set %d to %d\n", mht->threadOffset, + block->b.bucket[bo]); - code = set_word_addr (ut, block->a, &block->b, &block->b.bucket[bo], htonl(ea)); - if (code) return BUDB_IO; + code = + set_word_addr(ut, block->a, &block->b, &block->b.bucket[bo], + htonl(ea)); + if (code) + return BUDB_IO; LogDebug(5, "Hashin: set %d to %d\n", &block->b.bucket[bo], htonl(ea)); - code = set_word_addr (ut, 0, &db.h, &ht->entries, htonl(ntohl(ht->entries)+1)); - if (code) return BUDB_IO; - - return ht_MoveEntries (ut, mht); + code = + set_word_addr(ut, 0, &db.h, &ht->entries, + htonl(ntohl(ht->entries) + 1)); + if (code) + return BUDB_IO; + + return ht_MoveEntries(ut, mht); } /* RemoveFromList - generic procedure to delete an entry from a list given its @@ -925,150 +1008,161 @@ ht_HashIn(ut, mht, ea, e) * modified. The entry pointer is only used to calculate the thread offset, * but is not otherwise used. */ -afs_int32 RemoveFromList (ut, ea, e, head, ta, t, thread) - struct ubik_trans *ut; - dbadr ea; /* db addr of head structure */ - char *e; /* head structure */ - dbadr *head; /* address of head pointer */ - dbadr ta; /* db addr of strucure to be removed */ - char *t; /* structure being removed */ - dbadr *thread; /* pointer to thread pointer */ -{ afs_int32 code; - int threadOffset = ((char *)thread - t); - dbadr next_a; /* db addr of next element in list */ - dbadr loop_a; /* db addr of current list element */ - - if (*head == 0) return -1; /* empty list: not found */ - next_a = ntohl(*head); /* start at head of list */ - if (next_a == ta) { /* remove from head of list */ - code = set_word_addr (ut, ea, e, head, *thread); +afs_int32 +RemoveFromList(ut, ea, e, head, ta, t, thread) + struct ubik_trans *ut; + dbadr ea; /* db addr of head structure */ + char *e; /* head structure */ + dbadr *head; /* address of head pointer */ + dbadr ta; /* db addr of strucure to be removed */ + char *t; /* structure being removed */ + dbadr *thread; /* pointer to thread pointer */ +{ + afs_int32 code; + int threadOffset = ((char *)thread - t); + dbadr next_a; /* db addr of next element in list */ + dbadr loop_a; /* db addr of current list element */ + + if (*head == 0) + return -1; /* empty list: not found */ + next_a = ntohl(*head); /* start at head of list */ + if (next_a == ta) { /* remove from head of list */ + code = set_word_addr(ut, ea, e, head, *thread); return code; } do { loop_a = next_a; - code = dbread (ut, loop_a+threadOffset, (char *)&next_a, sizeof(dbadr)); - if (code) return code; - if (next_a == 0) return -1; /* end of list: not found */ + code = + dbread(ut, loop_a + threadOffset, (char *)&next_a, sizeof(dbadr)); + if (code) + return code; + if (next_a == 0) + return -1; /* end of list: not found */ } while (ta != (next_a = ntohl(next_a))); - code = dbwrite (ut, loop_a+threadOffset, (char *)thread, sizeof(dbadr)); + code = dbwrite(ut, loop_a + threadOffset, (char *)thread, sizeof(dbadr)); return code; } -afs_int32 ht_HashOutT (ut, mht, hash, ea, e, old) - struct ubik_trans *ut; - struct memoryHashTable *mht; - afs_uint32 hash; - dbadr ea; - char *e; - int old; +afs_int32 +ht_HashOutT(ut, mht, hash, ea, e, old) + struct ubik_trans *ut; + struct memoryHashTable *mht; + afs_uint32 hash; + dbadr ea; + char *e; + int old; { struct memoryHTBlock *block; - int bo; - afs_int32 code; + int bo; + afs_int32 code; if ((old ? mht->oldLength : mht->length) == 0) return -1; - code = ht_GetTableBlock (ut, mht, hash, old, &block, &bo); + code = ht_GetTableBlock(ut, mht, hash, old, &block, &bo); if (code) return code; if ((block == 0) || (block->b.bucket[bo] == 0)) return -1; - code = RemoveFromList(ut, block->a, (char *)&block->b, - &block->b.bucket[bo], ea, e, - (dbadr *)(e+mht->threadOffset)); + code = + RemoveFromList(ut, block->a, (char *)&block->b, &block->b.bucket[bo], + ea, e, (dbadr *) (e + mht->threadOffset)); if (code) return code; #if 0 net_ea = htonl(ea); - unthread_ea = *(afs_int32 *)((char *)e + mht->threadOffset); + unthread_ea = *(afs_int32 *) ((char *)e + mht->threadOffset); if (block->b.bucket[bo] == net_ea) { - if (set_word_addr (ut, block->a, &block->b, &block->b.bucket[bo], unthread_ea)) + if (set_word_addr + (ut, block->a, &block->b, &block->b.bucket[bo], unthread_ea)) return BUDB_IO; goto done; } loop_a = ntohl(block->b.bucket[bo]); while (1) { - if (dbread (ut, loop_a + mht->threadOffset, - (char *)&next_loop_a, sizeof(dbadr))) + if (dbread + (ut, loop_a + mht->threadOffset, (char *)&next_loop_a, + sizeof(dbadr))) return BUDB_IO; - if (next_loop_a == 0) return -1; /* not found */ + if (next_loop_a == 0) + return -1; /* not found */ if (net_ea == next_loop_a) { - if (dbwrite (ut, loop_a + mht->threadOffset, (char *)&unthread_ea, sizeof(dbadr))) - return BUDB_IO; + if (dbwrite + (ut, loop_a + mht->threadOffset, (char *)&unthread_ea, + sizeof(dbadr))) + return BUDB_IO; goto done; } - loop_a = ntohl (next_loop_a); - } + loop_a = ntohl(next_loop_a); + } done: #endif - if (set_word_addr (ut, 0, &db.h, &mht->ht->entries, htonl(ntohl(mht->ht->entries) - 1))) - return BUDB_IO; + if (set_word_addr + (ut, 0, &db.h, &mht->ht->entries, htonl(ntohl(mht->ht->entries) - 1))) + return BUDB_IO; return 0; } afs_int32 -ht_HashOut (ut, mht, ea, e) +ht_HashOut(ut, mht, ea, e) struct ubik_trans *ut; struct memoryHashTable *mht; dbadr ea; char *e; { afs_uint32 hash; - afs_int32 code; - - if (!mht) - db_panic ("some ht called with bad mht"); - hash = ht_HashEntry (mht, e); - if (mht->oldLength) - { - code = ht_HashOutT (ut, mht, hash, ea, e, 1/*old*/); - if (code == 0) + afs_int32 code; + + if (!mht) + db_panic("some ht called with bad mht"); + hash = ht_HashEntry(mht, e); + if (mht->oldLength) { + code = ht_HashOutT(ut, mht, hash, ea, e, 1 /*old */ ); + if (code == 0) return 0; - else - if (code != -1) + else if (code != -1) ERROR(code); } - if (mht->length == 0) /* not found */ + if (mht->length == 0) /* not found */ ERROR(BUDB_INTERNALERROR); - code = ht_HashOutT (ut, mht, hash, ea, e, 0/*old*/); + code = ht_HashOutT(ut, mht, hash, ea, e, 0 /*old */ ); if (code == -1) ERROR(BUDB_NOENT); if (code) ERROR(code); - code = ht_MoveEntries (ut, mht); - if ( code ) + code = ht_MoveEntries(ut, mht); + if (code) ERROR(code); - code = ht_MaybeAdjust (ut, mht); - if ( code ) + code = ht_MaybeAdjust(ut, mht); + if (code) ERROR(code); -error_exit: - return(code); + error_exit: + return (code); } /* generic hash table traversal routines */ afs_int32 -scanHashTableBlock(ut, mhtPtr, htBlockPtr, old, length, index, - selectFn, operationFn, rockPtr) +scanHashTableBlock(ut, mhtPtr, htBlockPtr, old, length, index, selectFn, + operationFn, rockPtr) struct ubik_trans *ut; struct memoryHashTable *mhtPtr; struct htBlock *htBlockPtr; int old; - afs_int32 length; /* size of whole hash table */ - int index; /* base index of this block */ - int (*selectFn)(); - int (*operationFn)(); + afs_int32 length; /* size of whole hash table */ + int index; /* base index of this block */ + int (*selectFn) (); + int (*operationFn) (); char *rockPtr; { - int type; /* hash table type */ - int entrySize; /* hashed entry size */ + int type; /* hash table type */ + int entrySize; /* hashed entry size */ + + afs_uint32 *mapEntryPtr = 0; /* for status checks */ - afs_uint32 *mapEntryPtr = 0; /* for status checks */ - char entry[sizeof(struct block)]; dbadr entryAddr, nextEntryAddr; @@ -1082,109 +1176,99 @@ scanHashTableBlock(ut, mhtPtr, htBlockPtr, old, length, index, * before the end of the overall hash table */ - for ( i = 0; (i < nHTBuckets) && (index < length); i++, index++ ) - { /*f*/ + for (i = 0; (i < nHTBuckets) && (index < length); i++, index++) { /*f */ entryAddr = 0; - nextEntryAddr = ntohl( htBlockPtr->bucket[i] ); + nextEntryAddr = ntohl(htBlockPtr->bucket[i]); /* if this is the old hash table, all entries below the progress mark * should have been moved to the new hash table */ if (old && (index < mhtPtr->progress) && nextEntryAddr) - return BUDB_INTERNALERROR; + return BUDB_INTERNALERROR; /* now walk down the chain of each bucket */ - while ( nextEntryAddr ) - { /*w*/ + while (nextEntryAddr) { /*w */ entryAddr = nextEntryAddr; - if ( dbread(ut, entryAddr, &entry[0], entrySize) ) - return(BUDB_INTERNALERROR); + if (dbread(ut, entryAddr, &entry[0], entrySize)) + return (BUDB_INTERNALERROR); - if ( (*selectFn)(entryAddr, &entry[0], rockPtr) ) - { - (*operationFn)(entryAddr, &entry[0], rockPtr); + if ((*selectFn) (entryAddr, &entry[0], rockPtr)) { + (*operationFn) (entryAddr, &entry[0], rockPtr); } - nextEntryAddr = ntohl( *((dbadr *)(entry + mhtPtr->threadOffset))); - } /*w*/ + nextEntryAddr = + ntohl(*((dbadr *) (entry + mhtPtr->threadOffset))); + } /*w */ - } /*f*/ + } /*f */ - return(0); + return (0); } afs_int32 scanHashTable(ut, mhtPtr, selectFn, operationFn, rockPtr) - struct ubik_trans *ut; - struct memoryHashTable *mhtPtr; - int (*selectFn)(); - int (*operationFn)(); - char *rockPtr; + struct ubik_trans *ut; + struct memoryHashTable *mhtPtr; + int (*selectFn) (); + int (*operationFn) (); + char *rockPtr; { struct htBlock hashTableBlock; - dbadr tableAddr; /* disk addr of hash block */ - int tableLength; /* # entries */ - int blockLength; /* # blocks */ + dbadr tableAddr; /* disk addr of hash block */ + int tableLength; /* # entries */ + int blockLength; /* # blocks */ int hashIndex; - int blockIndex, entryIndex; int old; int i; afs_int32 code = 0; - extern int nHTBuckets; /* # buckets in a hash table */ - - for ( old = 0; old <= 1; old++ ) - { /*fo*/ - if (old) - { - /* check the old hash table */ - tableLength = mhtPtr->oldLength; - if ( tableLength == 0 ) - continue; /* nothing to do */ - - tableAddr = ntohl(mhtPtr->ht->oldTable); - } - else - { - /* check current hash table */ - tableLength = mhtPtr->length; - if ( tableLength == 0 ) - continue; /* nothing to do */ - - tableAddr = ntohl(mhtPtr->ht->table); - } - - blockLength = (tableLength-1)/nHTBuckets; - hashIndex = 0; - - /* follow the hash chain */ - for ( i = 0; i <= blockLength; i++ ) - { /*fi*/ - /* chain too short */ - if ( tableAddr == 0 ) - ERROR(BUDB_DATABASEINCONSISTENT); - - code = dbread(ut, tableAddr, &hashTableBlock, - sizeof(hashTableBlock)); - if ( code ) - goto error_exit; - - code = scanHashTableBlock(ut, mhtPtr, &hashTableBlock, old, - tableLength, hashIndex, - selectFn, operationFn, - rockPtr); - if ( code ) - goto error_exit; - - hashIndex += nHTBuckets; - tableAddr = ntohl(hashTableBlock.h.next); - } /*fi*/ - } /*fo*/ - -error_exit: - return(code); -} + extern int nHTBuckets; /* # buckets in a hash table */ + for (old = 0; old <= 1; old++) { /*fo */ + if (old) { + /* check the old hash table */ + tableLength = mhtPtr->oldLength; + if (tableLength == 0) + continue; /* nothing to do */ + tableAddr = ntohl(mhtPtr->ht->oldTable); + } else { + /* check current hash table */ + tableLength = mhtPtr->length; + if (tableLength == 0) + continue; /* nothing to do */ + tableAddr = ntohl(mhtPtr->ht->table); + } + + blockLength = (tableLength - 1) / nHTBuckets; + hashIndex = 0; + + /* follow the hash chain */ + for (i = 0; i <= blockLength; i++) { /*fi */ + /* chain too short */ + if (tableAddr == 0) + ERROR(BUDB_DATABASEINCONSISTENT); + + code = + dbread(ut, tableAddr, &hashTableBlock, + sizeof(hashTableBlock)); + if (code) + goto error_exit; + + code = + scanHashTableBlock(ut, mhtPtr, &hashTableBlock, old, + tableLength, hashIndex, selectFn, + operationFn, rockPtr); + if (code) + goto error_exit; + + hashIndex += nHTBuckets; + tableAddr = ntohl(hashTableBlock.h.next); + } /*fi */ + } /*fo */ + + error_exit: + return (code); +} diff --git a/src/budb/db_lock.c b/src/budb/db_lock.c index a23509032..7a5c17593 100644 --- a/src/budb/db_lock.c +++ b/src/budb/db_lock.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_lock.c,v 1.1.1.4 2001/07/14 22:20:58 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/budb/db_lock.c,v 1.6 2003/07/15 23:14:48 shadow Exp $"); #include #ifdef AFS_NT40_ENV @@ -32,111 +33,115 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_lock.c,v 1.1.1.4 2001/07/14 22: afs_int32 FreeAllLocks(), FreeLock(), GetInstanceId(), GetLock(); -afs_int32 BUDB_FreeAllLocks (call, instanceId) +afs_int32 +SBUDB_FreeAllLocks(call, instanceId) struct rx_call *call; afs_uint32 instanceId; { - afs_int32 code; + afs_int32 code; - code = FreeAllLocks (call, instanceId); - osi_auditU (call, BUDB_FrALckEvent, code, AUD_END); - return code; + code = FreeAllLocks(call, instanceId); + osi_auditU(call, BUDB_FrALckEvent, code, AUD_END); + return code; } -afs_int32 FreeAllLocks (call, instanceId) +afs_int32 +FreeAllLocks(call, instanceId) struct rx_call *call; afs_uint32 instanceId; { - db_lockP startPtr, endPtr; + db_lockP startPtr, endPtr; struct ubik_trans *ut; afs_int32 code; - if ( callPermitted(call) == 0 ) - return(BUDB_NOTPERMITTED); + if (callPermitted(call) == 0) + return (BUDB_NOTPERMITTED); code = InitRPC(&ut, LOCKWRITE, 1); - if ( code ) - return(code); + if (code) + return (code); startPtr = &db.h.textLocks[0]; - endPtr = &db.h.textLocks[TB_NUM-1]; - while ( startPtr <= endPtr ) - { - if ( (ntohl(startPtr->lockState) == 1) - && (ntohl(startPtr->instanceId) == instanceId) - ) - { + endPtr = &db.h.textLocks[TB_NUM - 1]; + while (startPtr <= endPtr) { + if ((ntohl(startPtr->lockState) == 1) + && (ntohl(startPtr->instanceId) == instanceId) + ) { /* release the lock */ - startPtr->lockState = 0; /* unlock it */ + startPtr->lockState = 0; /* unlock it */ startPtr->lockTime = 0; startPtr->expires = 0; startPtr->instanceId = 0; - dbwrite(ut, DBH_POS(startPtr), (char *) startPtr, + dbwrite(ut, DBH_POS(startPtr), (char *)startPtr, sizeof(db_lockT)); } - startPtr++; + startPtr++; } code = ubik_EndTrans(ut); - return(code); + return (code); } -afs_int32 BUDB_FreeLock (call, lockHandle) +afs_int32 +SBUDB_FreeLock(call, lockHandle) struct rx_call *call; afs_uint32 lockHandle; { - afs_int32 code; + afs_int32 code; - code = FreeLock (call, lockHandle); - osi_auditU (call, BUDB_FreLckEvent, code, AUD_END); - return code; + code = FreeLock(call, lockHandle); + osi_auditU(call, BUDB_FreLckEvent, code, AUD_END); + return code; } -afs_int32 FreeLock (call, lockHandle) +afs_int32 +FreeLock(call, lockHandle) struct rx_call *call; afs_uint32 lockHandle; { - db_lockP lockPtr = 0; + db_lockP lockPtr = 0; struct ubik_trans *ut; afs_int32 code; - if ( callPermitted(call) == 0 ) - return(BUDB_NOTPERMITTED); + if (callPermitted(call) == 0) + return (BUDB_NOTPERMITTED); code = InitRPC(&ut, LOCKWRITE, 1); - if ( code ) - return(code); + if (code) + return (code); - if ( checkLockHandle(ut, lockHandle) == 0 ) - ABORT(BUDB_BADARGUMENT); + if (checkLockHandle(ut, lockHandle) == 0) + ABORT(BUDB_BADARGUMENT); - lockPtr = &db.h.textLocks[lockHandle-1]; + lockPtr = &db.h.textLocks[lockHandle - 1]; - lockPtr->lockState = 0; /* unlock it */ + lockPtr->lockState = 0; /* unlock it */ lockPtr->lockTime = 0; lockPtr->expires = 0; lockPtr->instanceId = 0; - dbwrite(ut, DBH_POS(lockPtr), (char *) lockPtr, sizeof(db_lockT)); + dbwrite(ut, DBH_POS(lockPtr), (char *)lockPtr, sizeof(db_lockT)); code = ubik_EndTrans(ut); - return(code); - -abort_exit: - ubik_AbortTrans (ut); - return(code); + return (code); + + abort_exit: + ubik_AbortTrans(ut); + return (code); } -afs_int32 BUDB_GetInstanceId(call, instanceId) +afs_int32 +SBUDB_GetInstanceId(call, instanceId) struct rx_call *call; afs_uint32 *instanceId; { - afs_int32 code; + afs_int32 code; - code = GetInstanceId (call, instanceId); - osi_auditU (call, BUDB_GetIIdEvent, code, AUD_END); - return code; + code = GetInstanceId(call, instanceId); + osi_auditU(call, BUDB_GetIIdEvent, code, AUD_END); + return code; } -afs_int32 GetInstanceId (call, instanceId) +afs_int32 +GetInstanceId(call, instanceId) struct rx_call *call; afs_uint32 *instanceId; { @@ -152,33 +157,35 @@ afs_int32 GetInstanceId (call, instanceId) */ code = InitRPC(&ut, LOCKWRITE, 1); - if ( code ) - return(code); + if (code) + return (code); instanceValue = ntohl(db.h.lastInstanceId) + 1; set_header_word(ut, lastInstanceId, htonl(instanceValue)); code = ubik_EndTrans(ut); - return(code); + return (code); } -afs_int32 BUDB_GetLock (call, instanceId, lockName, expiration, lockHandle) +afs_int32 +SBUDB_GetLock(call, instanceId, lockName, expiration, lockHandle) struct rx_call *call; afs_uint32 instanceId; afs_int32 lockName; afs_int32 expiration; afs_uint32 *lockHandle; { - afs_int32 code; + afs_int32 code; - code = GetLock (call, instanceId, lockName, expiration, lockHandle); - osi_auditU (call, BUDB_GetLckEvent, code, AUD_END); - return code; + code = GetLock(call, instanceId, lockName, expiration, lockHandle); + osi_auditU(call, BUDB_GetLckEvent, code, AUD_END); + return code; } -afs_int32 GetLock (call, instanceId, lockName, expiration, lockHandle) +afs_int32 +GetLock(call, instanceId, lockName, expiration, lockHandle) struct rx_call *call; afs_uint32 instanceId; afs_int32 lockName; @@ -186,51 +193,51 @@ afs_int32 GetLock (call, instanceId, lockName, expiration, lockHandle) afs_uint32 *lockHandle; { struct timeval tv; - db_lockP lockPtr; + db_lockP lockPtr; struct ubik_trans *ut; afs_int32 code; - if ( callPermitted(call) == 0 ) - return(BUDB_NOTPERMITTED); + if (callPermitted(call) == 0) + return (BUDB_NOTPERMITTED); - if ( (lockName < 0) || (lockName >= TB_NUM) ) - return(BUDB_BADARGUMENT); + if ((lockName < 0) || (lockName >= TB_NUM)) + return (BUDB_BADARGUMENT); /* get the current time */ gettimeofday(&tv, 0); code = InitRPC(&ut, LOCKWRITE, 1); - if ( code ) - return(code); + if (code) + return (code); lockPtr = &db.h.textLocks[lockName]; - if ( (ntohl(lockPtr->lockState) != 0) /* lock set */ - && (ntohl(lockPtr->expires) > tv.tv_sec) /* not expired */ - ) - { - if ( ntohl(lockPtr->instanceId) == instanceId ) - code = BUDB_SELFLOCKED; + if ((ntohl(lockPtr->lockState) != 0) /* lock set */ + &&(ntohl(lockPtr->expires) > tv.tv_sec) /* not expired */ + ) { + if (ntohl(lockPtr->instanceId) == instanceId) + code = BUDB_SELFLOCKED; else - code = BUDB_LOCKED; + code = BUDB_LOCKED; goto abort_exit; } - - lockPtr->lockState = htonl(1); /* lock it */ - lockPtr->lockTime = htonl(tv.tv_sec); /* when locked */ + + lockPtr->lockState = htonl(1); /* lock it */ + lockPtr->lockTime = htonl(tv.tv_sec); /* when locked */ lockPtr->expires = htonl(tv.tv_sec + expiration); lockPtr->instanceId = htonl(instanceId); - code = dbwrite(ut, DBH_POS(lockPtr), (char *) lockPtr, sizeof(db_lockT)); - if (code) ABORT(code); + code = dbwrite(ut, DBH_POS(lockPtr), (char *)lockPtr, sizeof(db_lockT)); + if (code) + ABORT(code); - *lockHandle = (afs_uint32)(lockName + 1); + *lockHandle = (afs_uint32) (lockName + 1); code = ubik_EndTrans(ut); - return(code); + return (code); -abort_exit: - ubik_AbortTrans (ut); - return(code); + abort_exit: + ubik_AbortTrans(ut); + return (code); } @@ -246,4 +253,3 @@ checkLockHandle(ut, lockHandle) { return (((lockHandle > 0) && (lockHandle <= TB_NUM)) ? 1 : 0); } - diff --git a/src/budb/db_lock.h b/src/budb/db_lock.h index d49a31471..ef78afca5 100644 --- a/src/budb/db_lock.h +++ b/src/budb/db_lock.h @@ -7,15 +7,14 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -struct db_lockS -{ - afs_int32 type; /* user defined - for consistency checks */ - afs_int32 lockState; /* locked/free */ - afs_int32 lockTime; /* when locked */ - afs_int32 expires; /* when timeout expires */ - afs_int32 instanceId; /* user instance id */ - int lockHost; /* locking host, if possible */ +struct db_lockS { + afs_int32 type; /* user defined - for consistency checks */ + afs_int32 lockState; /* locked/free */ + afs_int32 lockTime; /* when locked */ + afs_int32 expires; /* when timeout expires */ + afs_int32 instanceId; /* user instance id */ + int lockHost; /* locking host, if possible */ }; -typedef struct db_lockS db_lockT; -typedef db_lockT db_lockP; +typedef struct db_lockS db_lockT; +typedef db_lockT db_lockP; diff --git a/src/budb/db_text.c b/src/budb/db_text.c index 74890c3e9..8c9f29c5a 100644 --- a/src/budb/db_text.c +++ b/src/budb/db_text.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_text.c,v 1.1.1.6 2001/09/11 14:31:42 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/budb/db_text.c,v 1.10 2003/11/23 04:53:31 jaltman Exp $"); #ifdef AFS_NT40_ENV #include @@ -21,6 +22,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_text.c,v 1.1.1.6 2001/09/11 14: #include #include #endif +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif #include #include #include @@ -44,8 +52,9 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/db_text.c,v 1.1.1.6 2001/09/11 14: afs_int32 GetText(), GetTextVersion(), SaveText(); -afs_int32 BUDB_GetText (call, lockHandle, textType, maxLength, offset, - nextOffset, charListPtr) +afs_int32 +SBUDB_GetText(call, lockHandle, textType, maxLength, offset, nextOffset, + charListPtr) struct rx_call *call; afs_uint32 lockHandle; afs_int32 textType; @@ -54,16 +63,18 @@ afs_int32 BUDB_GetText (call, lockHandle, textType, maxLength, offset, afs_int32 *nextOffset; charListT *charListPtr; { - afs_int32 code; + afs_int32 code; - code = GetText (call, lockHandle, textType, maxLength, offset, - nextOffset, charListPtr); - osi_auditU (call, BUDB_GetTxtEvent, code, AUD_LONG, textType, AUD_END); - return code; + code = + GetText(call, lockHandle, textType, maxLength, offset, nextOffset, + charListPtr); + osi_auditU(call, BUDB_GetTxtEvent, code, AUD_LONG, textType, AUD_END); + return code; } -afs_int32 GetText (call, lockHandle, textType, maxLength, offset, - nextOffset, charListPtr) +afs_int32 +GetText(call, lockHandle, textType, maxLength, offset, nextOffset, + charListPtr) struct rx_call *call; afs_uint32 lockHandle; afs_int32 textType; @@ -84,21 +95,19 @@ afs_int32 GetText (call, lockHandle, textType, maxLength, offset, afs_int32 code; LogDebug(5, "GetText: type %d, offset %d, nextOffset %d, maxLength %d\n", - textType, offset, nextOffset, maxLength); + textType, offset, nextOffset, maxLength); - if ( callPermitted(call) == 0 ) - { - code = BUDB_NOTPERMITTED; + if (callPermitted(call) == 0) { + code = BUDB_NOTPERMITTED; goto no_xfer_abort; } /* check parameters */ - if ( (offset < 0) - || (textType < 0) - || (textType >= TB_NUM) - ) - { - code = BUDB_BADARGUMENT; + if ((offset < 0) + || (textType < 0) + || (textType >= TB_NUM) + ) { + code = BUDB_BADARGUMENT; goto no_xfer_abort; } @@ -108,19 +117,17 @@ afs_int32 GetText (call, lockHandle, textType, maxLength, offset, goto no_xfer_abort; /* fetch the lock state */ - if ( checkLockHandle(ut, lockHandle) == 0) - { + if (checkLockHandle(ut, lockHandle) == 0) { code = BUDB_NOTLOCKED; goto no_xfer_abort; } tbPtr = &db.h.textBlock[textType]; - if ( (ntohl(tbPtr->size) > 0) - && (offset >= ntohl(tbPtr->size)) - ) - { - code = BUDB_BADARGUMENT; + if ((ntohl(tbPtr->size) > 0) + && (offset >= ntohl(tbPtr->size)) + ) { + code = BUDB_BADARGUMENT; goto no_xfer_abort; } @@ -132,14 +139,13 @@ afs_int32 GetText (call, lockHandle, textType, maxLength, offset, /* allocate the transfer storage */ if (transferSize <= 0) { - charListPtr->charListT_len = 0L; - charListPtr->charListT_val = (char *)0; - } - else { - charListPtr->charListT_len = transferSize; - charListPtr->charListT_val = (char *) malloc(transferSize); - if ( charListPtr->charListT_val == 0 ) - ABORT(BUDB_NOMEM); + charListPtr->charListT_len = 0L; + charListPtr->charListT_val = NULL; + } else { + charListPtr->charListT_len = transferSize; + charListPtr->charListT_val = (char *)malloc(transferSize); + if (charListPtr->charListT_val == 0) + ABORT(BUDB_NOMEM); } textPtr = charListPtr->charListT_val; @@ -148,22 +154,20 @@ afs_int32 GetText (call, lockHandle, textType, maxLength, offset, /* setup the datablock. read and discard all blocks up to the one the * offset specifies */ - nblocks = offset/BLOCK_DATA_SIZE; + nblocks = offset / BLOCK_DATA_SIZE; lastBlockAddr = ntohl(tbPtr->textAddr); - - while ( nblocks-- ) - { - code = dbread(ut, lastBlockAddr, (char *) &block, sizeof(block)); - if ( code ) - ABORT(BUDB_IO); + + while (nblocks--) { + code = dbread(ut, lastBlockAddr, (char *)&block, sizeof(block)); + if (code) + ABORT(BUDB_IO); lastBlockAddr = ntohl(block.h.next); } - - while ( transferSize > 0 ) - { - code = dbread(ut, lastBlockAddr, (char *) &block, sizeof(block)); - if ( code ) - ABORT(BUDB_IO); + + while (transferSize > 0) { + code = dbread(ut, lastBlockAddr, (char *)&block, sizeof(block)); + if (code) + ABORT(BUDB_IO); LogDebug(5, "fetched block %d\n", lastBlockAddr); @@ -180,33 +184,31 @@ afs_int32 GetText (call, lockHandle, textType, maxLength, offset, offset += chunkSize; textPtr += chunkSize; - if ( transferSize ) - { + if (transferSize) { /* setup lastBlockAddr */ lastBlockAddr = ntohl(block.h.next); } } - if ( *nextOffset == ntohl(tbPtr->size) ) - { + if (*nextOffset == ntohl(tbPtr->size)) { /* all done */ *nextOffset = -1; } -error_exit: + error_exit: code = ubik_EndTrans(ut); /* printf("in error exit, code=%ld\n", code); */ - return(code); + return (code); -no_xfer_abort: + no_xfer_abort: charListPtr->charListT_len = 0; - charListPtr->charListT_val = (char *) malloc(0); + charListPtr->charListT_val = (char *)malloc(0); -abort_exit: - if ( ut ) + abort_exit: + if (ut) ubik_AbortTrans(ut); /* printf("in abort exit, code=%ld\n", code); */ - return(code); + return (code); } freeOldBlockChain(ut, diskAddr) @@ -217,39 +219,41 @@ freeOldBlockChain(ut, diskAddr) dbadr nextDiskAddr; afs_int32 code; - while ( diskAddr != 0 ) - { + while (diskAddr != 0) { /* read in the header */ - code = dbread(ut, diskAddr, (char *) &blockHeader,sizeof(blockHeader)); - if ( code ) - ABORT(code); + code = + dbread(ut, diskAddr, (char *)&blockHeader, sizeof(blockHeader)); + if (code) + ABORT(code); nextDiskAddr = ntohl(blockHeader.next); code = FreeBlock(ut, &blockHeader, diskAddr); - if ( code ) - ABORT(code); + if (code) + ABORT(code); diskAddr = nextDiskAddr; } -abort_exit: - return(code); + abort_exit: + return (code); } /* BUDB_GetTextVersion * get the version number for the specified text block */ -afs_int32 BUDB_GetTextVersion (call, textType, tversion) +afs_int32 +SBUDB_GetTextVersion(call, textType, tversion) struct rx_call *call; afs_int32 textType; afs_uint32 *tversion; { - afs_int32 code; + afs_int32 code; - code = GetTextVersion (call, textType, tversion); - osi_auditU (call, BUDB_GetTxVEvent, code, AUD_LONG, textType, AUD_END); - return code; + code = GetTextVersion(call, textType, tversion); + osi_auditU(call, BUDB_GetTxVEvent, code, AUD_LONG, textType, AUD_END); + return code; } -afs_int32 GetTextVersion (call, textType, tversion) +afs_int32 +GetTextVersion(call, textType, tversion) struct rx_call *call; afs_int32 textType; afs_uint32 *tversion; @@ -257,19 +261,19 @@ afs_int32 GetTextVersion (call, textType, tversion) afs_int32 code; struct ubik_trans *ut; - if ( callPermitted(call) == 0 ) - return(BUDB_NOTPERMITTED); + if (callPermitted(call) == 0) + return (BUDB_NOTPERMITTED); - if ( (textType < 0) || (textType >= TB_NUM) ) - return(BUDB_BADARGUMENT); + if ((textType < 0) || (textType >= TB_NUM)) + return (BUDB_BADARGUMENT); code = InitRPC(&ut, LOCKREAD, 1); if (code) - return(code); + return (code); *tversion = ntohl(db.h.textBlock[textType].version); code = ubik_EndTrans(ut); - return(code); + return (code); } /* text blocks @@ -282,7 +286,8 @@ afs_int32 GetTextVersion (call, textType, tversion) * charListPtr storage automatically malloced and freed */ -afs_int32 BUDB_SaveText (call, lockHandle, textType, offset, flags, charListPtr) +afs_int32 +SBUDB_SaveText(call, lockHandle, textType, offset, flags, charListPtr) struct rx_call *call; afs_uint32 lockHandle; afs_int32 textType; @@ -290,14 +295,15 @@ afs_int32 BUDB_SaveText (call, lockHandle, textType, offset, flags, charListPtr) afs_int32 flags; charListT *charListPtr; { - afs_int32 code; + afs_int32 code; - code = SaveText (call, lockHandle, textType, offset, flags, charListPtr); - osi_auditU (call, BUDB_SavTxtEvent, code, AUD_LONG, textType, AUD_END); - return code; + code = SaveText(call, lockHandle, textType, offset, flags, charListPtr); + osi_auditU(call, BUDB_SavTxtEvent, code, AUD_LONG, textType, AUD_END); + return code; } -afs_int32 SaveText (call, lockHandle, textType, offset, flags, charListPtr) +afs_int32 +SaveText(call, lockHandle, textType, offset, flags, charListPtr) struct rx_call *call; afs_uint32 lockHandle; afs_int32 textType; @@ -314,40 +320,41 @@ afs_int32 SaveText (call, lockHandle, textType, offset, flags, charListPtr) char *textptr = charListPtr->charListT_val; afs_int32 code; - LogDebug(5, "SaveText: type %d, offset %d, length %d\n", - textType, offset, textLength); + LogDebug(5, "SaveText: type %d, offset %d, length %d\n", textType, offset, + textLength); - if ( callPermitted(call) == 0 ) - return(BUDB_NOTPERMITTED); + if (callPermitted(call) == 0) + return (BUDB_NOTPERMITTED); - if ( (textLength > BLOCK_DATA_SIZE) || (offset < 0) ) - return(BUDB_BADARGUMENT); + if ((textLength > BLOCK_DATA_SIZE) || (offset < 0)) + return (BUDB_BADARGUMENT); code = InitRPC(&ut, LOCKWRITE, 1); - if (code) return(code); + if (code) + return (code); /* fetch the lock state */ - if ( checkLockHandle(ut, lockHandle) == 0) - ABORT(BUDB_NOTLOCKED); + if (checkLockHandle(ut, lockHandle) == 0) + ABORT(BUDB_NOTLOCKED); - if ( (textType < 0) || (textType >= TB_NUM) ) - ABORT(BUDB_BADARGUMENT); + if ((textType < 0) || (textType >= TB_NUM)) + ABORT(BUDB_BADARGUMENT); tbPtr = &db.h.textBlock[textType]; - LogDebug(5, "SaveText: lockHandle %d textType %d offset %d flags %d txtlength %d\n", - lockHandle, textType, offset, flags, textLength); + LogDebug(5, + "SaveText: lockHandle %d textType %d offset %d flags %d txtlength %d\n", + lockHandle, textType, offset, flags, textLength); - if (offset == 0) - { + if (offset == 0) { /* release any blocks from previous transactions */ diskBlockAddr = ntohl(tbPtr->newTextAddr); freeOldBlockChain(ut, diskBlockAddr); - if (textLength) - { + if (textLength) { code = AllocBlock(ut, &diskBlock, &diskBlockAddr); - if (code) ABORT(code); + if (code) + ABORT(code); LogDebug(5, "allocated block %d\n", diskBlockAddr); @@ -357,72 +364,75 @@ afs_int32 SaveText (call, lockHandle, textType, offset, flags, charListPtr) /* save it in the database header */ tbPtr->newsize = 0; tbPtr->newTextAddr = htonl(diskBlockAddr); - dbwrite(ut, (char *)tbPtr - (char *)&db.h, (char *)tbPtr, sizeof(struct textBlock)); - } - else - { + dbwrite(ut, (char *)tbPtr - (char *)&db.h, (char *)tbPtr, + sizeof(struct textBlock)); + } else { tbPtr->newsize = 0; tbPtr->newTextAddr = 0; } - } - else - { + } else { /* non-zero offset */ int nblocks; - if (offset != ntohl(tbPtr->newsize)) + if (offset != ntohl(tbPtr->newsize)) ABORT(BUDB_BADARGUMENT); /* locate the block to which offset refers */ - nblocks = offset/BLOCK_DATA_SIZE; + nblocks = offset / BLOCK_DATA_SIZE; diskBlockAddr = ntohl(tbPtr->newTextAddr); - if (diskBlockAddr == 0) + if (diskBlockAddr == 0) ABORT(BUDB_BADARGUMENT); - code = dbread(ut, diskBlockAddr, (char *)&diskBlock, sizeof(diskBlock)); - if (code) ABORT(code); + code = + dbread(ut, diskBlockAddr, (char *)&diskBlock, sizeof(diskBlock)); + if (code) + ABORT(code); - while ( nblocks-- ) - { + while (nblocks--) { diskBlockAddr = ntohl(diskBlock.h.next); - code = dbread(ut, diskBlockAddr, (char *) &diskBlock, sizeof(diskBlock)); - if (code) ABORT(code); + code = + dbread(ut, diskBlockAddr, (char *)&diskBlock, + sizeof(diskBlock)); + if (code) + ABORT(code); } } /* diskBlock and diskBlockAddr now point to the last block in the chain */ - while (textLength) - { + while (textLength) { /* compute the transfer size */ remainingInBlock = (BLOCK_DATA_SIZE - (offset % BLOCK_DATA_SIZE)); - chunkSize = MIN(remainingInBlock, textLength); + chunkSize = MIN(remainingInBlock, textLength); /* copy in the data */ memcpy(&diskBlock.a[offset % BLOCK_DATA_SIZE], textptr, chunkSize); - /* LogDebug(5, "text is %s\n", textptr); */ + /* LogDebug(5, "text is %s\n", textptr); */ textLength -= chunkSize; - textptr += chunkSize; - offset += chunkSize; + textptr += chunkSize; + offset += chunkSize; tbPtr->newsize = htonl(ntohl(tbPtr->newsize) + chunkSize); - if ( textLength > 0 ) - { + if (textLength > 0) { afs_int32 prevBlockAddr; afs_int32 linkOffset; afs_int32 linkValue; /* have to add another block to the chain */ - code = dbwrite(ut, diskBlockAddr, (char *)&diskBlock, sizeof(diskBlock)); - if (code) ABORT(code); + code = + dbwrite(ut, diskBlockAddr, (char *)&diskBlock, + sizeof(diskBlock)); + if (code) + ABORT(code); prevBlockAddr = (afs_int32) diskBlockAddr; code = AllocBlock(ut, &diskBlock, &diskBlockAddr); - if (code) ABORT(code); + if (code) + ABORT(code); LogDebug(5, "allocated block %d\n", diskBlockAddr); @@ -430,22 +440,26 @@ afs_int32 SaveText (call, lockHandle, textType, offset, flags, charListPtr) diskBlock.h.type = text_BLOCK; /* now have to update the previous block's link */ - linkOffset = (afs_int32) &diskBlock.h.next - (afs_int32) &diskBlock; + linkOffset = + (afs_int32) & diskBlock.h.next - (afs_int32) & diskBlock; linkValue = htonl(diskBlockAddr); - code = dbwrite(ut, (afs_int32)prevBlockAddr + linkOffset, (char *)&linkValue, sizeof(afs_int32)); - if (code) ABORT(code); - } - else - { + code = + dbwrite(ut, (afs_int32) prevBlockAddr + linkOffset, + (char *)&linkValue, sizeof(afs_int32)); + if (code) + ABORT(code); + } else { /* just write the old block */ - code = dbwrite(ut, diskBlockAddr, (char *) &diskBlock, sizeof(diskBlock)); - if (code) ABORT(code); + code = + dbwrite(ut, diskBlockAddr, (char *)&diskBlock, + sizeof(diskBlock)); + if (code) + ABORT(code); } } - if ( flags & BUDB_TEXT_COMPLETE ) /* done */ - { + if (flags & BUDB_TEXT_COMPLETE) { /* done */ /* this was the last chunk of text */ diskBlockAddr = ntohl(tbPtr->textAddr); freeOldBlockChain(ut, diskBlockAddr); @@ -460,16 +474,19 @@ afs_int32 SaveText (call, lockHandle, textType, offset, flags, charListPtr) } /* update size and other text header info */ - code = dbwrite(ut, (char *)tbPtr - (char *)&db.h, (char *)tbPtr, sizeof(struct textBlock)); - if (code) ABORT(code); + code = + dbwrite(ut, (char *)tbPtr - (char *)&db.h, (char *)tbPtr, + sizeof(struct textBlock)); + if (code) + ABORT(code); -error_exit: + error_exit: code = ubik_EndTrans(ut); - return(code); + return (code); -abort_exit: + abort_exit: ubik_AbortTrans(ut); - return(code); + return (code); } /* debug support */ @@ -486,14 +503,13 @@ saveTextToFile(ut, tbPtr) int fid; sprintf(filename, "%s/%s", gettmpdir(), "dbg_XXXXXX"); - + fid = mkstemp(filename); size = ntohl(tbPtr->size); blockAddr = ntohl(tbPtr->textAddr); - while ( size ) - { + while (size) { chunkSize = MIN(BLOCK_DATA_SIZE, size); - dbread(ut, blockAddr, (char *) &block, sizeof(block)); + dbread(ut, blockAddr, (char *)&block, sizeof(block)); write(fid, &block.a[0], chunkSize); blockAddr = ntohl(block.h.next); size -= chunkSize; @@ -523,14 +539,11 @@ mkstemp(st) int retval = -1; #ifdef AFS_LINUX20_ENV - retval = open(mkstemp(st), O_RDWR|O_CREAT|O_EXCL, 0600); + retval = open(mkstemp(st), O_RDWR | O_CREAT | O_EXCL, 0600); #else - retval = open(mktemp(st), O_RDWR|O_CREAT|O_EXCL, 0600); + retval = open(mktemp(st), O_RDWR | O_CREAT | O_EXCL, 0600); #endif -error_exit: - return(retval); + return (retval); } -#endif - - +#endif diff --git a/src/budb/dbs_dump.c b/src/budb/dbs_dump.c index a84676567..a4315cf61 100644 --- a/src/budb/dbs_dump.c +++ b/src/budb/dbs_dump.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/budb/dbs_dump.c,v 1.1.1.5 2001/09/11 14:31:43 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/budb/dbs_dump.c,v 1.11 2003/07/15 23:14:48 shadow Exp $"); #ifdef AFS_NT40_ENV #include @@ -56,7 +57,7 @@ badEntry(dbAddr) afs_uint32 dbAddr; { /* return entry ok */ - return(0); + return (0); } /* setupDbDump @@ -69,46 +70,48 @@ setupDbDump(writeFid) afs_int32 code = 0; code = InitRPC(&dumpSyncPtr->ut, LOCKREAD, 1); - if ( code ) + if (code) goto error_exit; code = writeDatabase(dumpSyncPtr->ut, writeFid); - if ( code ) + if (code) LogError(code, "writeDatabase failed\n"); code = close(writeFid); - if ( code ) + if (code) LogError(code, "pipe writer close failed\n"); LogDebug(5, "writeDatabase complete\n"); -error_exit: - if ( dumpSyncPtr->ut ) + error_exit: + if (dumpSyncPtr->ut) ubik_EndTrans(dumpSyncPtr->ut); - return(code); + return (code); } afs_int32 DumpDB(), RestoreDbHeader(); -afs_int32 BUDB_DumpDB (call, firstcall, maxLength, charListPtr, done) +afs_int32 +SBUDB_DumpDB(call, firstcall, maxLength, charListPtr, done) struct rx_call *call; - int firstcall; + int firstcall; afs_int32 maxLength; - charListT *charListPtr; + charListT *charListPtr; afs_int32 *done; { - afs_int32 code; + afs_int32 code; - code = DumpDB (call, firstcall, maxLength, charListPtr, done); - osi_auditU (call, BUDB_DmpDBEvent, code, AUD_END); - return code; + code = DumpDB(call, firstcall, maxLength, charListPtr, done); + osi_auditU(call, BUDB_DmpDBEvent, code, AUD_END); + return code; } -afs_int32 DumpDB (call, firstcall, maxLength, charListPtr, done) +afs_int32 +DumpDB(call, firstcall, maxLength, charListPtr, done) struct rx_call *call; - int firstcall; /* 1 - init. 0 - no init */ + int firstcall; /* 1 - init. 0 - no init */ afs_int32 maxLength; - charListT *charListPtr; + charListT *charListPtr; afs_int32 *done; { PROCESS dumperPid, watcherPid; @@ -116,7 +119,7 @@ afs_int32 DumpDB (call, firstcall, maxLength, charListPtr, done) afs_int32 code = 0; extern dumpWatcher(); - if ( callPermitted(call) == 0 ) + if (callPermitted(call) == 0) ERROR(BUDB_NOTPERMITTED); ObtainWriteLock(&dumpSyncPtr->ds_lock); @@ -124,21 +127,20 @@ afs_int32 DumpDB (call, firstcall, maxLength, charListPtr, done) /* If asking for zero bytes, then this is a call to reset the timeToLive * timer. Reset it if there is a dump in progress. */ - if (maxLength == 0) - { - charListPtr->charListT_val = (char *)0; + if (maxLength == 0) { + charListPtr->charListT_val = NULL; charListPtr->charListT_len = 0; - *done = ((dumpSyncPtr->statusFlags == 0) ? 1 : 0); + *done = ((dumpSyncPtr->statusFlags == 0) ? 1 : 0); /* reset the clock on dump timeout */ dumpSyncPtr->timeToLive = time(0) + DUMP_TTL_INC; goto error_exit; } - if (dumpSyncPtr->statusFlags == 0) - { - if (!firstcall) ERROR(BUDB_DUMPFAILED); + if (dumpSyncPtr->statusFlags == 0) { + if (!firstcall) + ERROR(BUDB_DUMPFAILED); LogDebug(5, "Setup dump\n"); @@ -150,40 +152,41 @@ afs_int32 DumpDB (call, firstcall, maxLength, charListPtr, done) dumpSyncPtr->statusFlags = 1; code = pipe(dumpSyncPtr->pipeFid); - if (code) ERROR(errno); - - code = LWP_CreateProcess(setupDbDump, 16384, 1, dumpSyncPtr->pipeFid[1], - "Database Dumper", &dumperPid); - if (code) goto error_exit; + if (code) + ERROR(errno); + + code = + LWP_CreateProcess(setupDbDump, 16384, 1, + (void *)dumpSyncPtr->pipeFid[1], + "Database Dumper", &dumperPid); + if (code) + goto error_exit; - dumpSyncPtr->dumperPid = dumperPid; + dumpSyncPtr->dumperPid = dumperPid; dumpSyncPtr->timeToLive = time(0) + DUMP_TTL_INC; /* now create the watcher thread */ - code = LWP_CreateProcess(dumpWatcher, 16384, 1, 0, - "Database Dump Watchdog", &watcherPid); - } - else if (firstcall) - ERROR(BUDB_LOCKED); + code = + LWP_CreateProcess(dumpWatcher, 16384, 1, 0, + "Database Dump Watchdog", &watcherPid); + } else if (firstcall) + ERROR(BUDB_LOCKED); /* now read the database and feed it to the rpc connection */ /* wait for data */ - while ( dumpSyncPtr->ds_bytes == 0 ) - { + while (dumpSyncPtr->ds_bytes == 0) { /* if no more data */ - if ( (dumpSyncPtr->ds_writerStatus == DS_DONE ) || - (dumpSyncPtr->ds_writerStatus == DS_DONE_ERROR) ) - { + if ((dumpSyncPtr->ds_writerStatus == DS_DONE) + || (dumpSyncPtr->ds_writerStatus == DS_DONE_ERROR)) { break; } - if ( dumpSyncPtr->ds_writerStatus == DS_WAITING ) - { + if (dumpSyncPtr->ds_writerStatus == DS_WAITING) { LogDebug(6, "wakup writer\n"); dumpSyncPtr->ds_writerStatus = 0; code = LWP_SignalProcess(&dumpSyncPtr->ds_writerStatus); - if ( code ) + if (code) LogError(code, "BUDB_DumpDB: signal delivery failed\n"); } LogDebug(6, "wait for writer\n"); @@ -192,53 +195,54 @@ afs_int32 DumpDB (call, firstcall, maxLength, charListPtr, done) LWP_WaitProcess(&dumpSyncPtr->ds_readerStatus); ObtainWriteLock(&dumpSyncPtr->ds_lock); } - - charListPtr->charListT_val = (char *) malloc(maxLength); - readSize = read(dumpSyncPtr->pipeFid[0], charListPtr->charListT_val, maxLength); + + charListPtr->charListT_val = (char *)malloc(maxLength); + readSize = + read(dumpSyncPtr->pipeFid[0], charListPtr->charListT_val, maxLength); /* reset the clock on dump timeout */ dumpSyncPtr->timeToLive = time(0) + DUMP_TTL_INC; - + LogDebug(4, "read of len %d returned %d\n", maxLength, readSize); charListPtr->charListT_len = readSize; - if ( readSize == 0 ) /* last chunk */ - { + if (readSize == 0) { /* last chunk */ *done = 1; close(dumpSyncPtr->pipeFid[0]); dumpSyncPtr->statusFlags = 0; - } - else + } else *done = 0; dumpSyncPtr->ds_bytes -= readSize; - if ( dumpSyncPtr->ds_writerStatus == DS_WAITING ) - { + if (dumpSyncPtr->ds_writerStatus == DS_WAITING) { dumpSyncPtr->ds_writerStatus = 0; code = LWP_SignalProcess(&dumpSyncPtr->ds_writerStatus); - if ( code ) - LogError(code, "BUDB_DumpDB: signal delivery failed\n"); + if (code) + LogError(code, "BUDB_DumpDB: signal delivery failed\n"); } -error_exit: - if ( !code && (dumpSyncPtr->ds_writerStatus == DS_DONE_ERROR) ) code = -1; + error_exit: + if (!code && (dumpSyncPtr->ds_writerStatus == DS_DONE_ERROR)) + code = -1; ReleaseWriteLock(&dumpSyncPtr->ds_lock); - return(code); + return (code); } -afs_int32 BUDB_RestoreDbHeader (call, header) +afs_int32 +SBUDB_RestoreDbHeader(call, header) struct rx_call *call; struct DbHeader *header; { - afs_int32 code; + afs_int32 code; - code = RestoreDbHeader (call, header); - osi_auditU (call, BUDB_RstDBHEvent, code, AUD_END); - return code; + code = RestoreDbHeader(call, header); + osi_auditU(call, BUDB_RstDBHEvent, code, AUD_END); + return code; } -afs_int32 RestoreDbHeader (call, header) +afs_int32 +RestoreDbHeader(call, header) struct rx_call *call; struct DbHeader *header; { @@ -247,34 +251,34 @@ afs_int32 RestoreDbHeader (call, header) extern struct memoryDB db; - if ( callPermitted(call) == 0 ) + if (callPermitted(call) == 0) ERROR(BUDB_NOTPERMITTED); code = InitRPC(&ut, LOCKWRITE, 1); - if ( code ) + if (code) goto error_exit; - if ( header->dbversion != ntohl(db.h.version) ) + if (header->dbversion != ntohl(db.h.version)) ERROR(BUDB_VERSIONMISMATCH); /* merge rather than replace the header information */ - if ( db.h.lastDumpId < htonl(header->lastDumpId)) + if (db.h.lastDumpId < htonl(header->lastDumpId)) db.h.lastDumpId = htonl(header->lastDumpId); - if ( db.h.lastTapeId < htonl(header->lastTapeId)) + if (db.h.lastTapeId < htonl(header->lastTapeId)) db.h.lastTapeId = htonl(header->lastTapeId); - if ( db.h.lastInstanceId < htonl(header->lastInstanceId)) + if (db.h.lastInstanceId < htonl(header->lastInstanceId)) db.h.lastInstanceId = htonl(header->lastInstanceId); - code = dbwrite(ut, 0, (char *) &db.h, sizeof(db.h)); - if ( code ) + code = dbwrite(ut, 0, (char *)&db.h, sizeof(db.h)); + if (code) code = BUDB_IO; -error_exit: - if ( ut ) + error_exit: + if (ut) ubik_EndTrans(ut); - return(code); + return (code); } /* dumpWatcher @@ -289,47 +293,46 @@ dumpWatcher() { afs_int32 code; - while ( 1 ) - { /*w*/ + while (1) { /*w */ /* printf("dumpWatcher\n"); */ ObtainWriteLock(&dumpSyncPtr->ds_lock); - if ( dumpSyncPtr->statusFlags == 0 ) - { + if (dumpSyncPtr->statusFlags == 0) { /* dump has finished */ goto exit; } /* check time to live */ - if ( time(0) > dumpSyncPtr->timeToLive ) - { /*i*/ + if (time(0) > dumpSyncPtr->timeToLive) { /*i */ /* dump has exceeded the allocated time - terminate it */ - LogError(0, "Database dump timeout exceeded: %s", ctime(&dumpSyncPtr->timeToLive)); + LogError(0, "Database dump timeout exceeded: %s", + ctime(&dumpSyncPtr->timeToLive)); LogError(0, "Terminating database dump\n"); - + close(dumpSyncPtr->pipeFid[0]); close(dumpSyncPtr->pipeFid[1]); code = LWP_DestroyProcess(dumpSyncPtr->dumperPid); - if (code) LogError(code, "dumpWatcher: failed to kill dump thread\n"); + if (code) + LogError(code, "dumpWatcher: failed to kill dump thread\n"); - if ( dumpSyncPtr->ut ) - { + if (dumpSyncPtr->ut) { code = ubik_AbortTrans(dumpSyncPtr->ut); - if (code) LogError(code, "Aborting dump transaction\n"); + if (code) + LogError(code, "Aborting dump transaction\n"); } memset(dumpSyncPtr, 0, sizeof(*dumpSyncPtr)); goto exit; - } /*i*/ - - ReleaseWriteLock(&dumpSyncPtr->ds_lock); + } + /*i */ + ReleaseWriteLock(&dumpSyncPtr->ds_lock); IOMGR_Sleep(5); - } /*w*/ + } /*w */ -exit: + exit: ReleaseWriteLock(&dumpSyncPtr->ds_lock); /* printf("dumpWatcher exit\n"); */ - return(0); + return (0); } diff --git a/src/budb/globals.h b/src/budb/globals.h index 39e7a6e13..fbca64b3e 100644 --- a/src/budb/globals.h +++ b/src/budb/globals.h @@ -12,7 +12,7 @@ * ------------------ */ -#define DEFAULT_DBPREFIX "bdb" /* db name prefix */ +#define DEFAULT_DBPREFIX "bdb" /* db name prefix */ /* debug and test flags */ @@ -21,64 +21,56 @@ #define DF_SMALLHT 0x4 /* use small hash tables */ #define DF_TRUNCATEDB 0x8 /* truncate database on startup */ -extern int debugging; /* for controlling debug output */ +extern int debugging; /* for controlling debug output */ -struct buServerConfS -{ +struct buServerConfS { /* global configuration */ - char *databaseDirectory; /* where database is placed */ - char *databaseName; /* database file name */ - char *databaseExtension; /* extension (depends on ubik) */ + char *databaseDirectory; /* where database is placed */ + char *databaseName; /* database file name */ + char *databaseExtension; /* extension (depends on ubik) */ /* error logging */ - FILE *log; /* log file for status/errors */ - + FILE *log; /* log file for status/errors */ + /* ubik and comm. related */ afs_int32 myHost; afs_int32 serverList[MAXSERVERS]; /* list of ubik servers */ - char *cellConfigdir; /* afs cell config. directory */ - struct ubik_dbase *database; /* handle for the database */ + char *cellConfigdir; /* afs cell config. directory */ + struct ubik_dbase *database; /* handle for the database */ /* debug and test */ - afs_uint32 debugFlags; + afs_uint32 debugFlags; }; -typedef struct buServerConfS buServerConfT; -typedef buServerConfT *buServerConfP; +typedef struct buServerConfS buServerConfT; +typedef buServerConfT *buServerConfP; -extern buServerConfP globalConfPtr; +extern buServerConfP globalConfPtr; /* for synchronizing the threads dumping the database */ -#define DS_WAITING 1 /* reader/writer sleeping */ -#define DS_DONE 2 /* finished */ -#define DS_DONE_ERROR 4 /* finished with errors */ +#define DS_WAITING 1 /* reader/writer sleeping */ +#define DS_DONE 2 /* finished */ +#define DS_DONE_ERROR 4 /* finished with errors */ -#define DUMP_TTL_INC 300 /* secs. before dump times out */ +#define DUMP_TTL_INC 300 /* secs. before dump times out */ #include -struct dumpSyncS -{ - struct Lock ds_lock; /* for this struct. */ - afs_int32 statusFlags; /* 0, or 1 for dump in progress */ - int pipeFid[2]; /* pipe between threads */ - char ds_writerStatus; - char ds_readerStatus; - - PROCESS dumperPid; /* pid of dumper lwp */ - struct ubik_trans *ut; /* dump db transaction */ - afs_int32 ds_bytes; /* no. of bytes buffered */ - time_t timeToLive; /* time. After this, kill the dump */ +struct dumpSyncS { + struct Lock ds_lock; /* for this struct. */ + afs_int32 statusFlags; /* 0, or 1 for dump in progress */ + int pipeFid[2]; /* pipe between threads */ + char ds_writerStatus; + char ds_readerStatus; + + PROCESS dumperPid; /* pid of dumper lwp */ + struct ubik_trans *ut; /* dump db transaction */ + afs_int32 ds_bytes; /* no. of bytes buffered */ + time_t timeToLive; /* time. After this, kill the dump */ }; -typedef struct dumpSyncS dumpSyncT; -typedef dumpSyncT *dumpSyncP; - -extern dumpSyncP dumpSyncPtr; /* defined in dbs_dump.c */ - - - - - +typedef struct dumpSyncS dumpSyncT; +typedef dumpSyncT *dumpSyncP; +extern dumpSyncP dumpSyncPtr; /* defined in dbs_dump.c */ diff --git a/src/budb/ol_verify.c b/src/budb/ol_verify.c index 4cddfb2f9..5724aef56 100644 --- a/src/budb/ol_verify.c +++ b/src/budb/ol_verify.c @@ -12,7 +12,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/budb/ol_verify.c,v 1.1.1.5 2001/09/11 14:31:43 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/budb/ol_verify.c,v 1.13 2003/11/29 22:08:09 jaltman Exp $"); #include #ifdef AFS_NT40_ENV @@ -21,6 +22,13 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/ol_verify.c,v 1.1.1.5 2001/09/11 1 #include #include #endif +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif #include #include #include @@ -77,117 +85,106 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/ol_verify.c,v 1.1.1.5 2001/09/11 1 * array describes the status of a data structure/entry in that block */ -struct blockMap -{ - struct blockHeader header; /* copy of the block header */ - char free; /* on free list */ - int nEntries; /* size of the entries arrays */ - afs_uint32 entries[1]; /* describes each entry */ +struct blockMap { + struct blockHeader header; /* copy of the block header */ + char free; /* on free list */ + int nEntries; /* size of the entries arrays */ + afs_uint32 entries[1]; /* describes each entry */ }; /* status for verify call */ -struct dbStatus -{ +struct dbStatus { char hostname[64]; /* host on which checked */ afs_int32 status; /* ok, not ok */ }; int nBlocks; /* total number of blocks in db */ -struct misc_hash_stats { /* stats for hashing */ - int max; /* longest chain length */ - double avg; /* avg length */ - double std_dev; /* standard deviation of length */ +struct misc_hash_stats { /* stats for hashing */ + int max; /* longest chain length */ + double avg; /* avg length */ + double std_dev; /* standard deviation of length */ }; struct misc_data { - int errors; /* errors encountered */ - int maxErrors; /* abort after this many errors */ - int nBlocks; /* number of database blocks */ - int nDump, nTape, nVolInfo, nVolFrag; /* counts of each type */ - int nVolName; /* volInfos w/ head==0 */ - int maxVolsPerVolInfo; /* maximum list lengths */ - int maxVolsPerTape; - int maxVolsPerDump; - int maxVolInfosPerName; - int maxTapesPerDump; - int maxAppendsPerDump; - int freeLength[NBLOCKTYPES]; /* length of free lists */ - int fullyFree[NBLOCKTYPES]; /* free blocks full of free entries */ - int veryLongChain; /* length of chain to report */ - int checkFragCount; /* report fragment count errors */ + int errors; /* errors encountered */ + int maxErrors; /* abort after this many errors */ + int nBlocks; /* number of database blocks */ + int nDump, nTape, nVolInfo, nVolFrag; /* counts of each type */ + int nVolName; /* volInfos w/ head==0 */ + int maxVolsPerVolInfo; /* maximum list lengths */ + int maxVolsPerTape; + int maxVolsPerDump; + int maxVolInfosPerName; + int maxTapesPerDump; + int maxAppendsPerDump; + int freeLength[NBLOCKTYPES]; /* length of free lists */ + int fullyFree[NBLOCKTYPES]; /* free blocks full of free entries */ + int veryLongChain; /* length of chain to report */ + int checkFragCount; /* report fragment count errors */ struct misc_hash_stats dumpName, dumpIden, tapeName, volName; - FILE *recreate; /* stream for recreate instructions */ + FILE *recreate; /* stream for recreate instructions */ } miscData; struct misc_data *misc; -struct blockMap **blockMap = 0; /* initial block map */ +struct blockMap **blockMap = 0; /* initial block map */ /* describes number of entries for each type of block */ -int blockEntries[NBLOCKTYPES] = -{ - 0 /* free_BLOCK */, +int blockEntries[NBLOCKTYPES] = { + 0 /* free_BLOCK */ , NvolFragmentS, NvolInfoS, NtapeS, NdumpS, - 1, /* hashTable_BLOCK */ - 1 /* text block */ + 1, /* hashTable_BLOCK */ + 1 /* text block */ }; -int blockEntrySize[NBLOCKTYPES] = -{ - 0 /* free */, - sizeof(((struct vfBlock *)0)->a[0]), - sizeof(((struct viBlock *)0)->a[0]), - sizeof(((struct tBlock *)0)->a[0]), - sizeof(((struct dBlock *)0)->a[0]), - 0}; - -char *typeName[NBLOCKTYPES] = -{ +int blockEntrySize[NBLOCKTYPES] = { + 0 /* free */ , + sizeof(((struct vfBlock *) NULL)->a[0]), + sizeof(((struct viBlock *) NULL)->a[0]), + sizeof(((struct tBlock *) NULL)->a[0]), + sizeof(((struct dBlock *) NULL)->a[0]), + 0, + 0, +}; + +char *typeName[NBLOCKTYPES] = { "free", "volFragment", "volInfo", - "tape", + "tape", "dump", - "hashTable" + "hashTable", + "text" }; -int hashBlockType[HT_MAX_FUNCTION+1] = - { +int hashBlockType[HT_MAX_FUNCTION + 1] = { 0, dump_BLOCK, - dump_BLOCK, - tape_BLOCK, + dump_BLOCK, + tape_BLOCK, volInfo_BLOCK }; /* Compatibility table for the bits in the blockMap. */ -struct mapCompatability -{ - short trigger; /* these bits trigger this element */ -} mapC[] = -{ - MAP_FREE, - MAP_HTBLOCK, - MAP_DUMPHASH | MAP_IDHASH, - MAP_TAPEHASH | MAP_TAPEONDUMP, - MAP_VOLINFOONNAME, - MAP_VOLINFONAMEHEAD | MAP_VOLHASH, - MAP_VOLFRAGONTAPE | MAP_VOLFRAGONVOL, - MAP_TEXTBLOCK -}; +struct mapCompatability { + short trigger; /* these bits trigger this element */ +} mapC[] = { +MAP_FREE, MAP_HTBLOCK, MAP_DUMPHASH | MAP_IDHASH, + MAP_TAPEHASH | MAP_TAPEONDUMP, MAP_VOLINFOONNAME, + MAP_VOLINFONAMEHEAD | MAP_VOLHASH, + MAP_VOLFRAGONTAPE | MAP_VOLFRAGONVOL, MAP_TEXTBLOCK}; /* no. of entries in the mapC array */ -int NMAPCs = (sizeof(mapC)/sizeof(mapC[0])); +int NMAPCs = (sizeof(mapC) / sizeof(mapC[0])); /* for identifying stored textual information */ -char *textName[TB_NUM] = -{ +char *textName[TB_NUM] = { "Dump Schedule\n", "Volume Sets\n", "Tape Hosts\n" @@ -213,10 +210,10 @@ extern int nHTBuckets; afs_int32 BumpErrors() { - if ( ++miscData.errors >= miscData.maxErrors ) - return(1); + if (++miscData.errors >= miscData.maxErrors) + return (1); else - return(0); + return (0); } /* convertDiskAddress @@ -237,30 +234,33 @@ checkDiskAddress(address, type, blockIndexPtr, entryIndexPtr) int *entryIndexPtr; { int index, offset; - - if (blockIndexPtr) *blockIndexPtr = -1; - if (entryIndexPtr) *entryIndexPtr = -1; - + + if (blockIndexPtr) + *blockIndexPtr = -1; + if (entryIndexPtr) + *entryIndexPtr = -1; + /* This is safest way to handle totally bogus addresses (eg 0x80001234). */ - if ( (address < sizeof(db.h)) || (address >= ntohl(db.h.eofPtr)) ) + if ((address < sizeof(db.h)) || (address >= ntohl(db.h.eofPtr))) return BUDB_ADDR; address -= sizeof(db.h); index = address / BLOCKSIZE; offset = address - (index * BLOCKSIZE); - if (offset % sizeof(afs_int32)) /* alignment check */ + if (offset % sizeof(afs_int32)) /* alignment check */ return BUDB_ADDR; - if (offset && (type > 0) && (type <= MAX_STRUCTURE_BLOCK_TYPE)) - { - offset -= sizeof(struct blockHeader); - if ((offset < 0) || (offset % blockEntrySize[type])) + if (offset && (type > 0) && (type <= MAX_STRUCTURE_BLOCK_TYPE)) { + offset -= sizeof(struct blockHeader); + if ((offset < 0) || (offset % blockEntrySize[type])) return BUDB_ADDR; - offset /= blockEntrySize[type]; - if (offset >= blockEntries[type]) + offset /= blockEntrySize[type]; + if (offset >= blockEntries[type]) return BUDB_ADDR; } - if (blockIndexPtr) *blockIndexPtr = index; - if (entryIndexPtr) *entryIndexPtr = offset; + if (blockIndexPtr) + *blockIndexPtr = index; + if (entryIndexPtr) + *entryIndexPtr = offset; return 0; } @@ -273,7 +273,7 @@ checkDiskAddress(address, type, blockIndexPtr, entryIndexPtr) * 0 - ok * BUDB_ADDR - address alignment checks failed */ - + afs_int32 ConvertDiskAddress(address, blockIndexPtr, entryIndexPtr) afs_uint32 address; @@ -282,7 +282,7 @@ ConvertDiskAddress(address, blockIndexPtr, entryIndexPtr) { int index, type; afs_int32 code; - + index = (address - sizeof(db.h)) / BLOCKSIZE; type = blockMap[index]->header.type; @@ -294,27 +294,26 @@ char * TypeName(index) int index; { - static char error[16]; + static char error[36]; - if ( (index < 0) || (index >= NBLOCKTYPES)) - { - sprintf(error, "UNKNOWN_TYPE", index); - return(error); + if ((index < 0) || (index >= NBLOCKTYPES)) { + sprintf(error, "UNKNOWN_TYPE %d", index); + return (error); } - return(typeName[index]); + return (typeName[index]); } getDumpID(ut, tapePtr, dumpID) - struct tape *tapePtr; - afs_int32 *dumpID; + struct tape *tapePtr; + afs_int32 *dumpID; { - struct dump d; - afs_int32 code; - - *dumpID = 0; - code = dbread(ut, ntohl(tapePtr->dump), &d, sizeof(d)); - if (!code) - *dumpID = ntohl(d.id); + struct dump d; + afs_int32 code; + + *dumpID = 0; + code = dbread(ut, ntohl(tapePtr->dump), &d, sizeof(d)); + if (!code) + *dumpID = ntohl(d.id); } /* ------------------------------------ @@ -327,63 +326,62 @@ getDumpID(ut, tapePtr, dumpID) * to the dump. */ afs_int32 -verifyDumpEntry( ut, dumpAddr, ai, ao, dumpPtr) +verifyDumpEntry(ut, dumpAddr, ai, ao, dumpPtr) struct ubik_trans *ut; afs_int32 dumpAddr; int ai, ao; struct dump *dumpPtr; { struct tape tape; - afs_int32 tapeAddr, tapeCount=0, volCount=0, appDumpCount=0; + afs_int32 tapeAddr, tapeCount = 0, volCount = 0, appDumpCount = 0; afs_int32 appDumpAddr, appDumpIndex, appDumpOffset; struct dump appDump; - int tapeIndex, tapeOffset, ccheck=1; + int tapeIndex, tapeOffset, ccheck = 1; afs_int32 code = 0, tcode; int dumpIndex, dumpOffset; tcode = ConvertDiskAddress(dumpAddr, &dumpIndex, &dumpOffset); - if (tcode) - { - Log("verifyDumpEntry: Invalid dump entry addr 0x%x\n", dumpAddr); - if (BumpErrors()) ERROR(DBBAD); + if (tcode) { + Log("verifyDumpEntry: Invalid dump entry addr 0x%x\n", dumpAddr); + if (BumpErrors()) + ERROR(DBBAD); ERROR(0); } /* Step though list of tapes hanging off of this dump */ - for (tapeAddr=ntohl(dumpPtr->firstTape); tapeAddr; tapeAddr=ntohl(tape.nextTape)) - { + for (tapeAddr = ntohl(dumpPtr->firstTape); tapeAddr; + tapeAddr = ntohl(tape.nextTape)) { tcode = ConvertDiskAddress(tapeAddr, &tapeIndex, &tapeOffset); - if (tcode) - { - Log("verifyDumpEntry: Invalid tape entry addr 0x%x (on DumpID %u)\n", - tapeAddr, ntohl(dumpPtr->id)); + if (tcode) { + Log("verifyDumpEntry: Invalid tape entry addr 0x%x (on DumpID %u)\n", tapeAddr, ntohl(dumpPtr->id)); Log(" Skipping remainder of tapes in dump\n"); - if (BumpErrors()) ERROR(DBBAD); + if (BumpErrors()) + ERROR(DBBAD); ccheck = 0; break; } tcode = dbread(ut, tapeAddr, &tape, sizeof(tape)); - if (tcode) ERROR(BUDB_IO); + if (tcode) + ERROR(BUDB_IO); - if ( ntohl(tape.dump) != dumpAddr ) - { + if (ntohl(tape.dump) != dumpAddr) { afs_int32 did; - + getDumpID(ut, &tape, &did); Log("verifyDumpEntry: Tape '%s' (addr 0x%x) doesn't point to\n", tape.name, tapeAddr); - Log(" dumpID %u (addr 0x%x). Points to DumpID %u (addr 0x%x)\n", - ntohl(dumpPtr->id), dumpAddr, did, ntohl(tape.dump)); - if (BumpErrors()) return(DBBAD); + Log(" dumpID %u (addr 0x%x). Points to DumpID %u (addr 0x%x)\n", ntohl(dumpPtr->id), dumpAddr, did, ntohl(tape.dump)); + if (BumpErrors()) + return (DBBAD); } /* Check if this tape entry has been examine already */ - if ( blockMap[tapeIndex]->entries[tapeOffset] & MAP_TAPEONDUMP ) - { + if (blockMap[tapeIndex]->entries[tapeOffset] & MAP_TAPEONDUMP) { Log("verifyDumpEntry: Tape '%s' (addr 0x%x) on multiple dumps\n", tape.name, tapeAddr); - if (BumpErrors()) return(DBBAD); + if (BumpErrors()) + return (DBBAD); } blockMap[tapeIndex]->entries[tapeOffset] |= MAP_TAPEONDUMP; @@ -391,62 +389,69 @@ verifyDumpEntry( ut, dumpAddr, ai, ao, dumpPtr) volCount += ntohl(tape.nVolumes); } - if (ccheck && (ntohl(dumpPtr->nVolumes) != volCount)) - { - Log("verifyDumpEntry: DumpID %u (addr 0x%x) volume count of %d is wrong (should be %d)\n", - ntohl(dumpPtr->id), dumpAddr, ntohl(dumpPtr->nVolumes), volCount); - if (BumpErrors()) return(DBBAD); + if (ccheck && (ntohl(dumpPtr->nVolumes) != volCount)) { + Log("verifyDumpEntry: DumpID %u (addr 0x%x) volume count of %d is wrong (should be %d)\n", ntohl(dumpPtr->id), dumpAddr, ntohl(dumpPtr->nVolumes), volCount); + if (BumpErrors()) + return (DBBAD); } - - if (volCount > misc->maxVolsPerDump) misc->maxVolsPerDump = volCount; - if (tapeCount > misc->maxTapesPerDump) misc->maxTapesPerDump = tapeCount; + + if (volCount > misc->maxVolsPerDump) + misc->maxVolsPerDump = volCount; + if (tapeCount > misc->maxTapesPerDump) + misc->maxTapesPerDump = tapeCount; /* If this is an initial dump, then step though list of appended dumps * hanging off of this dump. */ if (ntohl(dumpPtr->initialDumpID) == 0) { - for (appDumpAddr=ntohl(dumpPtr->appendedDumpChain); appDumpAddr; - appDumpAddr=ntohl(appDump.appendedDumpChain)) { - - tcode = ConvertDiskAddress(appDumpAddr, &appDumpIndex, &appDumpOffset); - if (tcode) { - Log("verifyDumpEntry: Invalid appended dump entry addr 0x%x\n", appDumpAddr); - Log("Skipping remainder of appended dumps\n"); - if (BumpErrors()) ERROR(DBBAD); - break; - } - - /* Read the appended dump in */ - tcode = dbread(ut, appDumpAddr, &appDump, sizeof(appDump)); - if (tcode) ERROR(BUDB_IO); - - /* Verify that it points to the parent dump */ - if (ntohl(appDump.initialDumpID) != ntohl(dumpPtr->id)) { - Log("verifyDumpEntry: DumpID %u (addr 0x%x) initial DumpID incorrect (is %u, should be %u)\n", - ntohl(appDump.id), appDumpAddr, - ntohl(appDump.initialDumpID), ntohl(dumpPtr->id)); - if (BumpErrors()) return(DBBAD); - } - - /* Check if this appended dump entry has been examined already */ - if ( blockMap[appDumpIndex]->entries[appDumpOffset] & MAP_APPENDEDDUMP ) { - Log("verifyDumpEntry: DumpID %u (addr %u) is on multiple appended dump chains\n", - ntohl(appDump.id), appDumpAddr); - Log("Skipping remainder of appended dumps\n"); - if (BumpErrors()) return(DBBAD); - break; - } - blockMap[appDumpIndex]->entries[appDumpOffset] |= MAP_APPENDEDDUMP; - - appDumpCount++; - } + for (appDumpAddr = ntohl(dumpPtr->appendedDumpChain); appDumpAddr; + appDumpAddr = ntohl(appDump.appendedDumpChain)) { + + tcode = + ConvertDiskAddress(appDumpAddr, &appDumpIndex, + &appDumpOffset); + if (tcode) { + Log("verifyDumpEntry: Invalid appended dump entry addr 0x%x\n", appDumpAddr); + Log("Skipping remainder of appended dumps\n"); + if (BumpErrors()) + ERROR(DBBAD); + break; + } + + /* Read the appended dump in */ + tcode = dbread(ut, appDumpAddr, &appDump, sizeof(appDump)); + if (tcode) + ERROR(BUDB_IO); + + /* Verify that it points to the parent dump */ + if (ntohl(appDump.initialDumpID) != ntohl(dumpPtr->id)) { + Log("verifyDumpEntry: DumpID %u (addr 0x%x) initial DumpID incorrect (is %u, should be %u)\n", ntohl(appDump.id), appDumpAddr, ntohl(appDump.initialDumpID), ntohl(dumpPtr->id)); + if (BumpErrors()) + return (DBBAD); + } + + /* Check if this appended dump entry has been examined already */ + if (blockMap[appDumpIndex]-> + entries[appDumpOffset] & MAP_APPENDEDDUMP) { + Log("verifyDumpEntry: DumpID %u (addr %u) is on multiple appended dump chains\n", ntohl(appDump.id), appDumpAddr); + Log("Skipping remainder of appended dumps\n"); + if (BumpErrors()) + return (DBBAD); + break; + } + blockMap[appDumpIndex]->entries[appDumpOffset] |= + MAP_APPENDEDDUMP; + + appDumpCount++; + } } - if (appDumpCount > misc->maxAppendsPerDump) misc->maxAppendsPerDump = appDumpCount; + if (appDumpCount > misc->maxAppendsPerDump) + misc->maxAppendsPerDump = appDumpCount; misc->nDump++; -error_exit: - return(code); + error_exit: + return (code); } /* @@ -455,57 +460,55 @@ error_exit: * they belong to the tape. */ afs_int32 -verifyTapeEntry (ut, tapeAddr, ai, ao, tapePtr) - struct ubik_trans *ut; - afs_int32 tapeAddr; - int ai, ao; - struct tape *tapePtr; +verifyTapeEntry(ut, tapeAddr, ai, ao, tapePtr) + struct ubik_trans *ut; + afs_int32 tapeAddr; + int ai, ao; + struct tape *tapePtr; { - int volCount = 0, ccheck=1; + int volCount = 0, ccheck = 1; afs_int32 volFragAddr; int blockIndex, entryIndex; struct volFragment volFragment; afs_int32 code = 0, tcode; - for (volFragAddr=ntohl(tapePtr->firstVol); - volFragAddr; - volFragAddr=ntohl(volFragment.sameTapeChain)) - { + for (volFragAddr = ntohl(tapePtr->firstVol); volFragAddr; + volFragAddr = ntohl(volFragment.sameTapeChain)) { tcode = ConvertDiskAddress(volFragAddr, &blockIndex, &entryIndex); - if (tcode) - { + if (tcode) { afs_int32 did; - + getDumpID(ut, tapePtr, &did); - Log("verifyTapeEntry: Invalid volFrag addr 0x%x (on tape '%s' DumpID %u)\n", - volFragAddr, tapePtr->name, did); + Log("verifyTapeEntry: Invalid volFrag addr 0x%x (on tape '%s' DumpID %u)\n", volFragAddr, tapePtr->name, did); Log(" Skipping remainder of volumes on tape\n"); - if (BumpErrors()) ERROR(DBBAD); + if (BumpErrors()) + ERROR(DBBAD); ccheck = 0; break; } - tcode = dbread (ut, volFragAddr, &volFragment, sizeof(volFragment)); - if (tcode) ERROR(tcode); + tcode = dbread(ut, volFragAddr, &volFragment, sizeof(volFragment)); + if (tcode) + ERROR(tcode); - if ( ntohl(volFragment.tape) != tapeAddr ) - { + if (ntohl(volFragment.tape) != tapeAddr) { afs_int32 did; - + getDumpID(ut, tapePtr, &did); Log("verifyTapeEntry: VolFrag (addr 0x%x) doesn't point to \n", volFragAddr); - Log (" tape '%s' DumpID %u (addr 0x%x). Points to addr 0x%x\n", - tapePtr->name, did, tapeAddr, ntohl(volFragment.tape)); - if (BumpErrors()) ERROR(DBBAD); + Log(" tape '%s' DumpID %u (addr 0x%x). Points to addr 0x%x\n", + tapePtr->name, did, tapeAddr, ntohl(volFragment.tape)); + if (BumpErrors()) + ERROR(DBBAD); } /* Has this volume fragment already been examined */ - if ( blockMap[blockIndex]->entries[entryIndex] & MAP_VOLFRAGONTAPE ) - { + if (blockMap[blockIndex]->entries[entryIndex] & MAP_VOLFRAGONTAPE) { Log("verifyTapeEntry: VolFrag (addr %d) on multiple tapes\n", volFragAddr); - if (BumpErrors()) ERROR(DBBAD); + if (BumpErrors()) + ERROR(DBBAD); } blockMap[blockIndex]->entries[entryIndex] |= MAP_VOLFRAGONTAPE; @@ -513,21 +516,21 @@ verifyTapeEntry (ut, tapeAddr, ai, ao, tapePtr) } /* now check computed vs. recorded volume counts */ - if (ccheck && (ntohl(tapePtr->nVolumes) != volCount)) - { - afs_int32 did; - + if (ccheck && (ntohl(tapePtr->nVolumes) != volCount)) { + afs_int32 did; + getDumpID(ut, tapePtr, &did); - Log("verifyTapeEntry: Tape '%s' DumpID %u (addr 0x%x) volFrag count of %d is wrong (should be %d)\n", - tapePtr->name, did, tapeAddr, ntohl(tapePtr->nVolumes), volCount); - if (BumpErrors()) ERROR(DBBAD); + Log("verifyTapeEntry: Tape '%s' DumpID %u (addr 0x%x) volFrag count of %d is wrong (should be %d)\n", tapePtr->name, did, tapeAddr, ntohl(tapePtr->nVolumes), volCount); + if (BumpErrors()) + ERROR(DBBAD); } - if (volCount > misc->maxVolsPerTape) misc->maxVolsPerTape = volCount; + if (volCount > misc->maxVolsPerTape) + misc->maxVolsPerTape = volCount; misc->nTape++; -error_exit: - return(code); + error_exit: + return (code); } /* @@ -536,7 +539,7 @@ error_exit: * So no check is done agaist it. */ afs_int32 -verifyVolFragEntry (ut, va, ai, ao, v) +verifyVolFragEntry(ut, va, ai, ao, v) struct ubik_trans *ut; afs_int32 va; int ai, ao; @@ -553,52 +556,49 @@ verifyVolFragEntry (ut, va, ai, ao, v) * also verify all entries are also on the chain. */ afs_int32 -verifyVolInfoEntry (ut, volInfoAddr, ai, ao, volInfo) +verifyVolInfoEntry(ut, volInfoAddr, ai, ao, volInfo) struct ubik_trans *ut; afs_int32 volInfoAddr; int ai, ao; struct volInfo *volInfo; { - int volCount = 0, ccheck=1; - int nFrags; + int volCount = 0, ccheck = 1; afs_int32 volFragAddr; - int blockIndex, entryIndex, bindex, eindex; + int blockIndex, entryIndex; struct volFragment volFragment; afs_int32 code = 0, tcode; /* check each fragment attached to this volinfo structure */ - for (volFragAddr=ntohl(volInfo->firstFragment); volFragAddr; - volFragAddr=ntohl(volFragment.sameNameChain)) - { - tcode = ConvertDiskAddress (volFragAddr, &blockIndex, &entryIndex); - if (tcode) - { - Log("verifyVolInfoEntry: Invalid volFrag entry addr 0x%x (on volume '%s')\n", - volFragAddr, volInfo->name); + for (volFragAddr = ntohl(volInfo->firstFragment); volFragAddr; + volFragAddr = ntohl(volFragment.sameNameChain)) { + tcode = ConvertDiskAddress(volFragAddr, &blockIndex, &entryIndex); + if (tcode) { + Log("verifyVolInfoEntry: Invalid volFrag entry addr 0x%x (on volume '%s')\n", volFragAddr, volInfo->name); Log(" Skipping remainder of volumes on tape\n"); - if (BumpErrors()) ERROR(DBBAD); + if (BumpErrors()) + ERROR(DBBAD); ccheck = 0; break; } tcode = dbread(ut, volFragAddr, &volFragment, sizeof(volFragment)); - if (tcode) ERROR(tcode); + if (tcode) + ERROR(tcode); - if ( ntohl(volFragment.vol) != volInfoAddr ) - { + if (ntohl(volFragment.vol) != volInfoAddr) { Log("verifyVolInfoEntry: volFrag (addr 0x%x) doesn't point to \n", volFragAddr); Log(" volInfo '%s' (addr 0x%x). Points to addr 0x%x\n", volInfo->name, volInfoAddr, ntohl(volFragment.vol)); - if (BumpErrors()) ERROR(DBBAD); + if (BumpErrors()) + ERROR(DBBAD); } /* volume fragment already on a volinfo chain? */ - if ( blockMap[blockIndex]->entries[entryIndex] & MAP_VOLFRAGONVOL ) - { - Log("verifyVolInfoEntry: VolFrag (addr %d) on multiple volInfo chains\n", - volFragAddr); - if (BumpErrors()) ERROR(DBBAD); + if (blockMap[blockIndex]->entries[entryIndex] & MAP_VOLFRAGONVOL) { + Log("verifyVolInfoEntry: VolFrag (addr %d) on multiple volInfo chains\n", volFragAddr); + if (BumpErrors()) + ERROR(DBBAD); } blockMap[blockIndex]->entries[entryIndex] |= MAP_VOLFRAGONVOL; @@ -606,77 +606,74 @@ verifyVolInfoEntry (ut, volInfoAddr, ai, ao, volInfo) } /* check computed vs. recorded number of fragments */ - if (ccheck && misc->checkFragCount && (ntohl(volInfo->nFrags) != volCount)) - { - Log("verifyVolInfoEntry: VolInfo '%s' (addr 0x%x) volFrag count of %d is wrong (should be %d)\n", - volInfo->name, volInfoAddr, ntohl(volInfo->nFrags), volCount); - if (BumpErrors()) ERROR(DBBAD); + if (ccheck && misc->checkFragCount + && (ntohl(volInfo->nFrags) != volCount)) { + Log("verifyVolInfoEntry: VolInfo '%s' (addr 0x%x) volFrag count of %d is wrong (should be %d)\n", volInfo->name, volInfoAddr, ntohl(volInfo->nFrags), volCount); + if (BumpErrors()) + ERROR(DBBAD); } - if (volCount > misc->maxVolsPerVolInfo) misc->maxVolsPerVolInfo = volCount; + if (volCount > misc->maxVolsPerVolInfo) + misc->maxVolsPerVolInfo = volCount; /* Check that all volInfo structures with same name point to the same * head. If sameNameHead == 0, this is the head structure so we check, * otherwise ignore */ - if (volInfo->sameNameHead == 0) - { /*i*/ - int viCount = 1; /* count this one */ + if (volInfo->sameNameHead == 0) { /*i */ + int viCount = 1; /* count this one */ struct volInfo tvi; afs_int32 tviAddr; - for (tviAddr=ntohl(volInfo->sameNameChain); tviAddr; tviAddr = ntohl(tvi.sameNameChain)) - { + for (tviAddr = ntohl(volInfo->sameNameChain); tviAddr; + tviAddr = ntohl(tvi.sameNameChain)) { viCount++; - tcode = ConvertDiskAddress (tviAddr, &blockIndex, &entryIndex); - if (tcode) - { - Log("verifyVolInfoEntry: Invalid volInfo entry %s addr 0x%x\n", - volInfo->name, tviAddr); + tcode = ConvertDiskAddress(tviAddr, &blockIndex, &entryIndex); + if (tcode) { + Log("verifyVolInfoEntry: Invalid volInfo entry %s addr 0x%x\n", volInfo->name, tviAddr); Log(" Skipping remainder of volumes on same name chain\n"); - if (BumpErrors()) ERROR(DBBAD); + if (BumpErrors()) + ERROR(DBBAD); code = 0; break; } tcode = dbread(ut, tviAddr, &tvi, sizeof(tvi)); - if (tcode) ERROR(tcode); - - if ( ntohl(tvi.sameNameHead) != volInfoAddr) - { - Log("verifyVolInfoEntry: VolInfo '%s' (addr 0x%x) doesn't point to \n", - volInfo->name, tviAddr); - Log(" head of sameName volInfo (addr 0x%x). Points to addr 0x%x\n", - volInfoAddr, ntohl(tvi.sameNameHead)); - if (BumpErrors()) ERROR(DBBAD); + if (tcode) + ERROR(tcode); + + if (ntohl(tvi.sameNameHead) != volInfoAddr) { + Log("verifyVolInfoEntry: VolInfo '%s' (addr 0x%x) doesn't point to \n", volInfo->name, tviAddr); + Log(" head of sameName volInfo (addr 0x%x). Points to addr 0x%x\n", volInfoAddr, ntohl(tvi.sameNameHead)); + if (BumpErrors()) + ERROR(DBBAD); } - if (blockMap[blockIndex]->entries[entryIndex] & MAP_VOLINFOONNAME) - { - Log("verifyVolInfoEntry: VolInfo (addr 0x%x) on multiple same name chains\n", - tviAddr); - if (BumpErrors()) ERROR(DBBAD); + if (blockMap[blockIndex]->entries[entryIndex] & MAP_VOLINFOONNAME) { + Log("verifyVolInfoEntry: VolInfo (addr 0x%x) on multiple same name chains\n", tviAddr); + if (BumpErrors()) + ERROR(DBBAD); } blockMap[blockIndex]->entries[entryIndex] |= MAP_VOLINFOONNAME; } /* select the passed in structure flags */ - if ( blockMap[ai]->entries[ao] & MAP_VOLINFONAMEHEAD) - { - Log("verifyVolInfoEntry: VolInfo '%s' (addr 0x%x) is name head multiple times\n", - volInfo->name, volInfoAddr); - if (BumpErrors()) ERROR(DBBAD); + if (blockMap[ai]->entries[ao] & MAP_VOLINFONAMEHEAD) { + Log("verifyVolInfoEntry: VolInfo '%s' (addr 0x%x) is name head multiple times\n", volInfo->name, volInfoAddr); + if (BumpErrors()) + ERROR(DBBAD); } blockMap[ai]->entries[ao] |= MAP_VOLINFONAMEHEAD; - if (viCount > misc->maxVolInfosPerName) misc->maxVolInfosPerName = viCount; + if (viCount > misc->maxVolInfosPerName) + misc->maxVolInfosPerName = viCount; misc->nVolName++; - } /*i*/ - + } + /*i */ misc->nVolInfo++; -error_exit: - return(code); + error_exit: + return (code); } @@ -702,27 +699,30 @@ verifyBlocks(ut) afs_int32 code = 0, tcode; /* Remember every header of every block in the database */ - for (i=0; i= NBLOCKTYPES) ) - { - Log("Block (index %d addr %d) has invalid type of %d\n", i, blockAddr, blocktype); + blocktype = block.h.type; /* char */ + if ((blocktype < 0) || (blocktype >= NBLOCKTYPES)) { + Log("Block (index %d addr %d) has invalid type of %d\n", i, + blockAddr, blocktype); ERROR(BUDB_BLOCKTYPE); } /* allocate the block map memory */ - bmsize = sizeof(*ablockMap) + (blockEntries[blocktype]-1) * sizeof(ablockMap->entries[0]); - ablockMap = (struct blockMap *) malloc(bmsize); - if (!ablockMap) ERROR(BUDB_NOMEM); + bmsize = + sizeof(*ablockMap) + (blockEntries[blocktype] - + 1) * sizeof(ablockMap->entries[0]); + ablockMap = (struct blockMap *)malloc(bmsize); + if (!ablockMap) + ERROR(BUDB_NOMEM); memset(ablockMap, 0, bmsize); ablockMap->nEntries = blockEntries[blocktype]; @@ -732,8 +732,8 @@ verifyBlocks(ut) blockMap[i] = ablockMap; } -error_exit: - return(code); + error_exit: + return (code); } int minvols, maxvols, ttlvols; @@ -749,17 +749,17 @@ verifyHashTableBlock(ut, mhtPtr, htBlockPtr, old, length, index, mapBit) struct memoryHashTable *mhtPtr; struct htBlock *htBlockPtr; int old; - afs_int32 length; /* size of whole hash table */ - int index; /* base index of this block */ + afs_int32 length; /* size of whole hash table */ + int index; /* base index of this block */ int mapBit; { - int type; /* hash table type */ - int entrySize; /* hashed entry size */ - int blockType; /* block type for this hash table */ + int type; /* hash table type */ + int entrySize; /* hashed entry size */ + int blockType; /* block type for this hash table */ int blockIndex, entryIndex; char entry[sizeof(struct block)]; dbadr entryAddr; - int hash; /* calculated hash value for entry */ + int hash; /* calculated hash value for entry */ int i, count; afs_int32 code = 0, tcode; @@ -771,73 +771,73 @@ verifyHashTableBlock(ut, mhtPtr, htBlockPtr, old, length, index, mapBit) * before the end of the overall hash table */ - for ( i = 0; (i < nHTBuckets) && (index < length); i++, index++ ) - { /*f*/ + for (i = 0; (i < nHTBuckets) && (index < length); i++, index++) { /*f */ entryAddr = ntohl(htBlockPtr->bucket[i]); /* if this is the old hash table, all entries below the progress mark * should have been moved to the new hash table */ - if (old && (index < mhtPtr->progress) && entryAddr) - { + if (old && (index < mhtPtr->progress) && entryAddr) { Log("Old hash table not empty (entry %d) below progress (%d)\n", - i, mhtPtr->progress); - if (BumpErrors()) ERROR(DBBAD); - } + i, mhtPtr->progress); + if (BumpErrors()) + ERROR(DBBAD); + } /* now walk down the chain of each bucket */ - for (count=0; entryAddr; count++) - { /*w*/ + for (count = 0; entryAddr; count++) { /*w */ tcode = ConvertDiskAddress(entryAddr, &blockIndex, &entryIndex); - if (tcode) - { + if (tcode) { Log("verifyHashTableBlock: Invalid hash table chain addr 0x%x\n", entryAddr); Log(" Skipping remainder of bucket %d\n", index); - if (BumpErrors()) ERROR(DBBAD); + if (BumpErrors()) + ERROR(DBBAD); code = 0; break; } - if (blockMap[blockIndex]->header.type != blockType) - { - Log("Hash table chain (block index %d) incorrect\n", blockIndex); - Log(" Table type %d traverses block type %d\n", - blockType, blockMap[blockIndex]->header.type); + if (blockMap[blockIndex]->header.type != blockType) { + Log("Hash table chain (block index %d) incorrect\n", + blockIndex); + Log(" Table type %d traverses block type %d\n", blockType, + blockMap[blockIndex]->header.type); Log(" Skipping remainder of bucket %d\n", index); - if (BumpErrors()) ERROR(DBBAD); + if (BumpErrors()) + ERROR(DBBAD); break; } - if ( dbread(ut, entryAddr, &entry[0], entrySize) ) + if (dbread(ut, entryAddr, &entry[0], entrySize)) ERROR(DBBAD); hash = ht_HashEntry(mhtPtr, &entry[0]) % length; - if (hash != index) /* if it hashed to some other place */ - { - Log("Entry (addr 0x%x) bucket %d, should be hashed into bucket %d\n", - entryAddr, index, hash); - if (BumpErrors()) ERROR(DBBAD); + if (hash != index) { /* if it hashed to some other place */ + Log("Entry (addr 0x%x) bucket %d, should be hashed into bucket %d\n", entryAddr, index, hash); + if (BumpErrors()) + ERROR(DBBAD); } /* check if entry has been examined */ - if (blockMap[blockIndex]->entries[entryIndex] & mapBit) - { + if (blockMap[blockIndex]->entries[entryIndex] & mapBit) { Log("Entry (addr 0x%x) multiply referenced\n", entryAddr); - if (BumpErrors()) ERROR(DBBAD); + if (BumpErrors()) + ERROR(DBBAD); } blockMap[blockIndex]->entries[entryIndex] |= mapBit; - entryAddr = ntohl( *((dbadr *)(entry + mhtPtr->threadOffset))); - } /*w*/ - + entryAddr = ntohl(*((dbadr *) (entry + mhtPtr->threadOffset))); + } /*w */ + /* Log("Bucket %4d contains %d entries\n", index+1, count); */ ttlvols += count; - if (count < minvols) minvols = count; - if (count > maxvols) maxvols = count; - } /*f*/ + if (count < minvols) + minvols = count; + if (count > maxvols) + maxvols = count; + } /*f */ -error_exit: - return(code); + error_exit: + return (code); } /* verifyHashTable @@ -855,88 +855,91 @@ verifyHashTable(ut, mhtPtr, mapBit) struct hashTable *htPtr = mhtPtr->ht; struct htBlock hashTableBlock; - int tableLength; /* # entries */ - int hashblocks; /* # blocks */ - dbadr tableAddr; /* disk addr of hash block */ + int tableLength; /* # entries */ + int hashblocks; /* # blocks */ + dbadr tableAddr; /* disk addr of hash block */ int blockIndex, entryIndex; int old; int i; afs_int32 code = 0, tcode; - extern int nHTBuckets; /* # buckets in a hash table */ + extern int nHTBuckets; /* # buckets in a hash table */ LogDebug(4, "Htable: length %d oldlength %d progress %d\n", - mhtPtr->length, mhtPtr->oldLength, mhtPtr->progress); + mhtPtr->length, mhtPtr->oldLength, mhtPtr->progress); /* check both old and current tables */ - for ( old = 0; old <= 1; old++ ) - { /*fo*/ - tableLength = (old ? mhtPtr->oldLength : mhtPtr->length); - if (tableLength == 0) continue; - tableAddr = (old ? ntohl(htPtr->oldTable) : ntohl(htPtr->table)); - minvols = 999999; + for (old = 0; old <= 1; old++) { /*fo */ + tableLength = (old ? mhtPtr->oldLength : mhtPtr->length); + if (tableLength == 0) + continue; + tableAddr = (old ? ntohl(htPtr->oldTable) : ntohl(htPtr->table)); + minvols = 999999; maxvols = ttlvols = 0; /* follow the chain of hashtable blocks - avoid infinite loops */ - hashblocks = ((tableLength-1)/nHTBuckets)+1; /* numb of 2K hashtable blocks */ - for (i=0; (tableAddr && (iheader.type != hashTable_BLOCK ) - { - Log("Hashtable block (index %d addr 0x%x) hashtype %d - type %d, expected type %d\n", - i+1, tableAddr, ntohl(htPtr->functionType), - blockMap[blockIndex]->header.type, hashTable_BLOCK); + if (blockMap[blockIndex]->header.type != hashTable_BLOCK) { + Log("Hashtable block (index %d addr 0x%x) hashtype %d - type %d, expected type %d\n", i + 1, tableAddr, ntohl(htPtr->functionType), blockMap[blockIndex]->header.type, hashTable_BLOCK); Log(" Skipping remainder of hash table chain\n"); - if (BumpErrors()) ERROR(BUDB_BLOCKTYPE); + if (BumpErrors()) + ERROR(BUDB_BLOCKTYPE); break; } /* check if we've examined this block before */ /* mark this (hash table) block as examined */ - if (blockMap[blockIndex]->entries[entryIndex] & MAP_HTBLOCK) - { - Log("Hash table block (index %d addr 0x%x) multiple ref\n", i+1, tableAddr); - if (BumpErrors()) ERROR(BUDB_DATABASEINCONSISTENT); - } - blockMap[blockIndex]->entries[entryIndex] |= MAP_HTBLOCK; + if (blockMap[blockIndex]->entries[entryIndex] & MAP_HTBLOCK) { + Log("Hash table block (index %d addr 0x%x) multiple ref\n", + i + 1, tableAddr); + if (BumpErrors()) + ERROR(BUDB_DATABASEINCONSISTENT); + } + blockMap[blockIndex]->entries[entryIndex] |= MAP_HTBLOCK; /* Read the actual hash table block */ - tcode = dbread(ut, tableAddr, &hashTableBlock, sizeof(hashTableBlock)); - if (tcode) ERROR(tcode); + tcode = + dbread(ut, tableAddr, &hashTableBlock, + sizeof(hashTableBlock)); + if (tcode) + ERROR(tcode); /* Verify its entries */ - tcode = verifyHashTableBlock(ut, mhtPtr, &hashTableBlock, old, - tableLength, (i*nHTBuckets), mapBit); - if (tcode) ERROR(tcode); + tcode = + verifyHashTableBlock(ut, mhtPtr, &hashTableBlock, old, + tableLength, (i * nHTBuckets), mapBit); + if (tcode) + ERROR(tcode); tableAddr = ntohl(hashTableBlock.h.next); } /* Verify numb hash blocks is as it says */ - if (i != hashblocks) - { - Log("Incorrect number of hash chain blocks: %d (expected %d), hashtype %d\n", - i, hashblocks, ntohl(htPtr->functionType)); - if (BumpErrors()) ERROR(BUDB_DATABASEINCONSISTENT); + if (i != hashblocks) { + Log("Incorrect number of hash chain blocks: %d (expected %d), hashtype %d\n", i, hashblocks, ntohl(htPtr->functionType)); + if (BumpErrors()) + ERROR(BUDB_DATABASEINCONSISTENT); } - if (ttlvols) - Log("%d entries; %u buckets; min = %d; max = %d\n", - ttlvols, tableLength, minvols, maxvols); - } /*fo*/ + if (ttlvols) + Log("%d entries; %u buckets; min = %d; max = %d\n", ttlvols, + tableLength, minvols, maxvols); + } /*fo */ -error_exit: - return(code); + error_exit: + return (code); } /* verifyEntryChains @@ -956,62 +959,58 @@ verifyEntryChains(ut) int type; int nFree; - static afs_int32 (*checkEntry[NBLOCKTYPES])() - = { 0, /* free block */ - verifyVolFragEntry, - verifyVolInfoEntry, - verifyTapeEntry, - verifyDumpEntry, - 0 /* text block */ - }; - - for (blockIndex=0; blockIndexheader.type; - if ((type <= 0) || (type > MAX_STRUCTURE_BLOCK_TYPE)) + type = blockMap[blockIndex]->header.type; + if ((type <= 0) || (type > MAX_STRUCTURE_BLOCK_TYPE)) continue; - entrySize = blockEntrySize[type]; - nFree = 0; + entrySize = blockEntrySize[type]; + nFree = 0; - for (entryIndex=0; entryIndexnEntries; entryIndex++) - { /*f*/ - offset = sizeof(db.h) + (blockIndex * BLOCKSIZE) + - sizeof(struct blockHeader) + (entryIndex * entrySize); - if ( dbread(ut, offset, &entry[0], entrySize) ) + for (entryIndex = 0; entryIndex < blockMap[blockIndex]->nEntries; entryIndex++) { /*f */ + offset = + sizeof(db.h) + (blockIndex * BLOCKSIZE) + + sizeof(struct blockHeader) + (entryIndex * entrySize); + if (dbread(ut, offset, &entry[0], entrySize)) return BUDB_IO; /* check if entry is free by looking at the first "afs_int32" of the structure */ - if ( *((afs_int32 *)&entry[0]) == 0 ) /* zero is free */ - { - /* Is it on any hash chain? */ - if ( blockMap[blockIndex]->entries[entryIndex] & MAP_HASHES ) - { - Log("Entry: blockindex %d, entryindex %d - marked free but hashed 0x%x\n", - blockIndex, entryIndex, blockMap[blockIndex]->entries[entryIndex]); - if (BumpErrors()) return DBBAD; + if (*((afs_int32 *) & entry[0]) == 0) { /* zero is free */ + /* Is it on any hash chain? */ + if (blockMap[blockIndex]->entries[entryIndex] & MAP_HASHES) { + Log("Entry: blockindex %d, entryindex %d - marked free but hashed 0x%x\n", blockIndex, entryIndex, blockMap[blockIndex]->entries[entryIndex]); + if (BumpErrors()) + return DBBAD; } blockMap[blockIndex]->entries[entryIndex] |= MAP_FREE; nFree++; - } - else - { + } else { /* check the entry itself for consistency */ - code = (*(checkEntry[type]))(ut, offset, blockIndex, entryIndex, &entry[0]); - if (code) return code; + code = + (*(checkEntry[type])) (ut, offset, blockIndex, entryIndex, + &entry[0]); + if (code) + return code; } - } /*f*/ + } /*f */ /* check computed free with recorded free entries */ - if ( nFree != ntohs(blockMap[blockIndex]->header.nFree) ) - { + if (nFree != ntohs(blockMap[blockIndex]->header.nFree)) { Log("Block (index %d) free count %d has %d free structs\n", blockIndex, ntohs(blockMap[blockIndex]->header.nFree), nFree); - if (BumpErrors()) return DBBAD; - } - } /*f*/ + if (BumpErrors()) + return DBBAD; + } + } /*f */ return 0; } @@ -1027,55 +1026,49 @@ verifyFreeLists() afs_int32 code; /* for each free list */ - for (i=0; ifullyFree[i] = misc->freeLength[i] = 0; - for (addr=ntohl(db.h.freePtrs[i]); addr; addr=ntohl(blockMap[blockIndex]->header.next)) - { + for (addr = ntohl(db.h.freePtrs[i]); addr; + addr = ntohl(blockMap[blockIndex]->header.next)) { misc->freeLength[i]++; - code = ConvertDiskAddress (addr, &blockIndex, &entryIndex); - if (code || (entryIndex != 0)) - { - Log("verifyFreeLists: Invalid free chain addr 0x%x in %s free chain\n", - addr, TypeName(i)); + code = ConvertDiskAddress(addr, &blockIndex, &entryIndex); + if (code || (entryIndex != 0)) { + Log("verifyFreeLists: Invalid free chain addr 0x%x in %s free chain\n", addr, TypeName(i)); Log(" Skipping remainder of free chain\n"); - if (BumpErrors()) return(DBBAD); + if (BumpErrors()) + return (DBBAD); code = 0; break; } /* check block type */ - if (blockMap[blockIndex]->header.type != i) - { - Log("verifyFreeLists: Found %s type in %s free chain\n", - TypeName(blockMap[blockIndex]->header.type), TypeName(i), addr); - if (BumpErrors()) return(DBBAD); + if (blockMap[blockIndex]->header.type != i) { + Log("verifyFreeLists: Found %s type in %s free chain (addr 0x%x)\n", + TypeName(blockMap[blockIndex]->header.type), TypeName(i), + addr); + if (BumpErrors()) + return (DBBAD); } /* If entire block isn't free, check if count of free entries is ok */ nFree = ntohs(blockMap[blockIndex]->header.nFree); - if (i != free_BLOCK) - { - if ((nFree <= 0) || (nFree > blockEntries[i])) - { - Log ("verifyFreeLists: Illegal free count %d on %s free chain\n", - nFree, TypeName(i)); - if (BumpErrors()) return(DBBAD); - } - else if (nFree == blockEntries[i]) - { + if (i != free_BLOCK) { + if ((nFree <= 0) || (nFree > blockEntries[i])) { + Log("verifyFreeLists: Illegal free count %d on %s free chain\n", nFree, TypeName(i)); + if (BumpErrors()) + return (DBBAD); + } else if (nFree == blockEntries[i]) { misc->fullyFree[i]++; } } /* Check if already examined the block */ - if (blockMap[blockIndex]->free) - { - Log("verifyFreeLists: %s free chain block at addr 0x%x multiply threaded\n", - TypeName(i), addr); - if (BumpErrors()) return DBBAD; + if (blockMap[blockIndex]->free) { + Log("verifyFreeLists: %s free chain block at addr 0x%x multiply threaded\n", TypeName(i), addr); + if (BumpErrors()) + return DBBAD; } blockMap[blockIndex]->free++; } @@ -1094,84 +1087,94 @@ verifyMapBits() int blockIndex, entryIndex, i, entrySize, type, bits; afs_int32 offset; - for (blockIndex=0; blockIndexnEntries == 0) && !blockMap[blockIndex]->free) - { + if ((blockMap[blockIndex]->nEntries == 0) + && !blockMap[blockIndex]->free) { Log("verifyMapBits: Orphan free block (index %d)\n", blockIndex); - if (BumpErrors()) return DBBAD; + if (BumpErrors()) + return DBBAD; } /* check each entry */ - for (entryIndex=0; entryIndexnEntries; entryIndex++) - { /*f*/ - if ((entryIndex%1024) == 0) IOMGR_Poll(); + for (entryIndex = 0; entryIndex < blockMap[blockIndex]->nEntries; entryIndex++) { /*f */ + if ((entryIndex % 1024) == 0) + IOMGR_Poll(); bits = blockMap[blockIndex]->entries[entryIndex]; - for (i=0; i= NMAPCs) - { - char logstr[256]; + if (i >= NMAPCs) { + char logstr[256]; - type = blockMap[blockIndex]->header.type; - entrySize = blockEntrySize[type]; - offset = sizeof(db.h) + (blockIndex * BLOCKSIZE) + - sizeof(struct blockHeader) + (entryIndex * entrySize); + type = blockMap[blockIndex]->header.type; + entrySize = blockEntrySize[type]; + offset = + sizeof(db.h) + (blockIndex * BLOCKSIZE) + + sizeof(struct blockHeader) + (entryIndex * entrySize); sprintf(logstr, "%s entry Block %d, Entry %d, (addr 0x%x)", TypeName(type), blockIndex, entryIndex, offset); - if (!bits) strcat(logstr, ": An orphaned entry"); - if (bits & MAP_FREE) strcat(logstr, ": A valid free block"); - if (bits & MAP_HTBLOCK) strcat(logstr, ": A valid hash-table block"); - if (bits & MAP_TEXTBLOCK) strcat(logstr, ": A valid text block"); - if (bits & (MAP_DUMPHASH | MAP_IDHASH)) - { - if (!(bits & MAP_DUMPHASH)) - strcat(logstr, ": A dump not on dump-name hash-chain"); + if (!bits) + strcat(logstr, ": An orphaned entry"); + if (bits & MAP_FREE) + strcat(logstr, ": A valid free block"); + if (bits & MAP_HTBLOCK) + strcat(logstr, ": A valid hash-table block"); + if (bits & MAP_TEXTBLOCK) + strcat(logstr, ": A valid text block"); + if (bits & (MAP_DUMPHASH | MAP_IDHASH)) { + if (!(bits & MAP_DUMPHASH)) + strcat(logstr, + ": A dump not on dump-name hash-chain"); else if (!(bits & MAP_IDHASH)) - strcat(logstr, ": A dump not on dump-id hash-chain"); + strcat(logstr, ": A dump not on dump-id hash-chain"); else - strcat(logstr, ": A valid dump entry"); + strcat(logstr, ": A valid dump entry"); } - if (bits & (MAP_TAPEHASH | MAP_TAPEONDUMP)) - { + if (bits & (MAP_TAPEHASH | MAP_TAPEONDUMP)) { if (!(bits & MAP_TAPEHASH)) - strcat(logstr, ": A tape not on tape-name hash-chain"); + strcat(logstr, + ": A tape not on tape-name hash-chain"); else if (!(bits & MAP_TAPEONDUMP)) - strcat(logstr, ": A tape not associated with a dump"); + strcat(logstr, ": A tape not associated with a dump"); else - strcat(logstr, ": A valid tape entry"); + strcat(logstr, ": A valid tape entry"); } - if (bits & MAP_VOLINFOONNAME) - strcat(logstr, ": A valid volInfo on a volume-name chain"); - if (bits & (MAP_VOLINFONAMEHEAD | MAP_VOLHASH)) - { + if (bits & MAP_VOLINFOONNAME) + strcat(logstr, + ": A valid volInfo on a volume-name chain"); + if (bits & (MAP_VOLINFONAMEHEAD | MAP_VOLHASH)) { if (!(bits & MAP_VOLINFONAMEHEAD)) - strcat(logstr, ": A volInfo not the head of a volume-name hash-chain"); + strcat(logstr, + ": A volInfo not the head of a volume-name hash-chain"); else if (!(bits & MAP_VOLHASH)) - strcat(logstr, ": A volInfo not on volume-name hash-chain"); + strcat(logstr, + ": A volInfo not on volume-name hash-chain"); else - strcat(logstr, ": A valid volInfo in volume-name hash-chain"); + strcat(logstr, + ": A valid volInfo in volume-name hash-chain"); } - if (bits & (MAP_VOLFRAGONTAPE | MAP_VOLFRAGONVOL)) - { + if (bits & (MAP_VOLFRAGONTAPE | MAP_VOLFRAGONVOL)) { if (!(bits & MAP_VOLFRAGONTAPE)) - strcat(logstr, ": A volFrag not associated with a tape"); + strcat(logstr, + ": A volFrag not associated with a tape"); else if (!(bits & MAP_VOLFRAGONVOL)) - strcat(logstr, ": A volFrag not associated with a volume"); - else - strcat(logstr, ": A valid volFrag entry"); + strcat(logstr, + ": A volFrag not associated with a volume"); + else + strcat(logstr, ": A valid volFrag entry"); } Log("%s\n", logstr); - if (BumpErrors()) return DBBAD; + if (BumpErrors()) + return DBBAD; } - } /*f*/ + } /*f */ } return 0; @@ -1186,13 +1189,13 @@ verifyText(ut) extern afs_int32 verifyTextChain(); /* check each of the text types in use */ - for (i=0; itextAddr); - for (blockAddr = (new ? ntohl(tbPtr->newTextAddr) : ntohl(tbPtr->textAddr)); - blockAddr; blockAddr = ntohl(block.h.next)) - { + for (blockAddr = + (new ? ntohl(tbPtr->newTextAddr) : ntohl(tbPtr->textAddr)); + blockAddr; blockAddr = ntohl(block.h.next)) { tcode = ConvertDiskAddress(blockAddr, &blockIndex, &entryIndex); - if (tcode) - { - Log("verifyTextChain: Invalid %s text block addr 0x%x\n", - (new?"new":""), blockAddr); + if (tcode) { + Log("verifyTextChain: Invalid %s text block addr 0x%x\n", + (new ? "new" : ""), blockAddr); Log(" Skipping remainder of text chain\n"); - if (BumpErrors()) ERROR(tcode); + if (BumpErrors()) + ERROR(tcode); break; } tcode = dbread(ut, blockAddr, &block, sizeof(block)); - if (tcode) ERROR(tcode); + if (tcode) + ERROR(tcode); - if ( blockMap[blockIndex]->entries[entryIndex] & MAP_TEXTBLOCK ) - { - Log("verifyTextChain: Text block (addr 0x%x) multiply chained\n", blockAddr); - if (BumpErrors()) ERROR(DBBAD); + if (blockMap[blockIndex]->entries[entryIndex] & MAP_TEXTBLOCK) { + Log("verifyTextChain: Text block (addr 0x%x) multiply chained\n", blockAddr); + if (BumpErrors()) + ERROR(DBBAD); } blockMap[blockIndex]->entries[entryIndex] |= MAP_TEXTBLOCK; size += BLOCK_DATA_SIZE; } - if ( ntohl(new?tbPtr->newsize:tbPtr->size) > size ) - { - Log("verifyTextChain: Text block %s size %d > computed capacity %d\n", - (new?"new":""), ntohl(new?tbPtr->newsize:tbPtr->size), size); - if (BumpErrors()) ERROR(DBBAD); + if (ntohl(new ? tbPtr->newsize : tbPtr->size) > size) { + Log("verifyTextChain: Text block %s size %d > computed capacity %d\n", (new ? "new" : ""), ntohl(new ? tbPtr->newsize : tbPtr->size), size); + if (BumpErrors()) + ERROR(DBBAD); } } -error_exit: - return(code); + error_exit: + return (code); } /* ----------------------------------------- @@ -1265,13 +1267,13 @@ error_exit: afs_int32 verifyDatabase(ut, recreateFile) struct ubik_trans *ut; - FILE *recreateFile; /* not used */ + FILE *recreateFile; /* not used */ { afs_int32 eof; - int j, bmsize; + int bmsize; afs_int32 code = 0, tcode; - extern int nBlocks; /* no. blocks in database */ + extern int nBlocks; /* no. blocks in database */ extern struct ubik_dbase *BU_dbase; /* clear verification statistics */ @@ -1281,21 +1283,20 @@ verifyDatabase(ut, recreateFile) #ifdef PDEBUG miscData.maxErrors = 1000000; #else - miscData.maxErrors = 50; /* Catch the first 50 errors */ + miscData.maxErrors = 50; /* Catch the first 50 errors */ #endif miscData.veryLongChain = 0; - miscData.checkFragCount = 1; /* check frags */ + miscData.checkFragCount = 1; /* check frags */ /* check eofPtr */ eof = ntohl(db.h.eofPtr); - eof -= sizeof(db.h); /* subtract header */ + eof -= sizeof(db.h); /* subtract header */ nBlocks = eof / BLOCKSIZE; Log("Verify of backup database started\n"); Log("Database is %u. %d blocks of %d Bytes\n", eof, nBlocks, BLOCKSIZE); - if ((eof < 0) || (nBlocks*BLOCKSIZE != eof)) - { + if ((eof < 0) || (nBlocks * BLOCKSIZE != eof)) { Log("Database eofPtr (%d) bad, blocksize %d\n", eof, BLOCKSIZE); ERROR(DBBAD); } @@ -1303,66 +1304,75 @@ verifyDatabase(ut, recreateFile) /* set size of database */ miscData.nBlocks = nBlocks; - if (nBlocks == 0) ERROR(0); /* Nothing to check? */ + if (nBlocks == 0) + ERROR(0); /* Nothing to check? */ /* construct block map - first level is the array of pointers */ - bmsize = nBlocks*sizeof(struct blockMap *); - blockMap = (struct blockMap **) malloc(bmsize); - if (!blockMap) ERROR(BUDB_NOMEM); + bmsize = nBlocks * sizeof(struct blockMap *); + blockMap = (struct blockMap **)malloc(bmsize); + if (!blockMap) + ERROR(BUDB_NOMEM); memset(blockMap, 0, bmsize); - /* verify blocks and construct the block map */ + /* verify blocks and construct the block map */ Log("Read header of every block\n"); tcode = verifyBlocks(ut); - if (tcode) ERROR(tcode); + if (tcode) + ERROR(tcode); /* check the various hash tables */ Log("Verify volume name hash table\n"); tcode = verifyHashTable(ut, &db.volName, MAP_VOLHASH); - if (tcode) ERROR(tcode); + if (tcode) + ERROR(tcode); Log("Verify tape name hash table\n"); tcode = verifyHashTable(ut, &db.tapeName, MAP_TAPEHASH); - if (tcode) ERROR(tcode); + if (tcode) + ERROR(tcode); Log("Verify dump name hash table\n"); tcode = verifyHashTable(ut, &db.dumpName, MAP_DUMPHASH); - if (tcode) ERROR(tcode); + if (tcode) + ERROR(tcode); Log("Verify dump id hash table\n"); tcode = verifyHashTable(ut, &db.dumpIden, MAP_IDHASH); - if (tcode) ERROR(tcode); + if (tcode) + ERROR(tcode); /* check the entry chains */ Log("Verify all blocks and entries\n"); tcode = verifyEntryChains(ut); - if (tcode) ERROR(tcode); + if (tcode) + ERROR(tcode); /* check text blocks - Log message in verifyText */ tcode = verifyText(ut); - if (tcode) ERROR(tcode); + if (tcode) + ERROR(tcode); /* check free list */ Log("Verify Free Lists\n"); tcode = verifyFreeLists(); - if (tcode) ERROR(tcode); + if (tcode) + ERROR(tcode); /* check entry map bit compatibility */ Log("Verify Map bits\n"); tcode = verifyMapBits(); - if (tcode) ERROR(tcode); + if (tcode) + ERROR(tcode); -error_exit: + error_exit: /* free the block map */ - if ( blockMap != 0 ) - { + if (blockMap != 0) { int i; /* free all the individual maps */ - for ( i = 0; i < nBlocks; i++ ) - { - if ( blockMap[i] ) + for (i = 0; i < nBlocks; i++) { + if (blockMap[i]) free(blockMap[i]); } @@ -1372,33 +1382,38 @@ error_exit: } if (!tcode) { - Log("# 2K database blocks = %d\n", miscData.nBlocks); - Log("# Dump entries found = %d. 3 dumps per block\n", miscData.nDump); - Log(" max tapes on a dump = %d\n", miscData.maxTapesPerDump); - Log(" max volumes on a dump = %d\n", miscData.maxVolsPerDump); - Log(" max appends on a dump = %d\n", miscData.maxAppendsPerDump); - Log(" # Blocks with space = %d\n", miscData.freeLength[4]); - Log(" # of those fully free = %d\n", miscData.fullyFree[4]); - Log("# Tape entries found = %d. 20 tapes per block\n", miscData.nTape); - Log(" max volumes on a tape = %d\n", miscData.maxVolsPerTape); - Log(" # Blocks with space = %d\n", miscData.freeLength[3]); - Log(" # of those fully free = %d\n", miscData.fullyFree[3]); - Log("# VolInfo entries found = %d. 20 volInfos per block\n", miscData.nVolInfo); - Log(" # head of sameNameCh = %d\n", miscData.nVolName); - Log(" max on a sameNameCh = %d\n", miscData.maxVolInfosPerName); - Log(" max VolFrags on chain = %d\n", miscData.maxVolsPerVolInfo); - Log(" # Blocks with space = %d\n", miscData.freeLength[2]); - Log(" # of those fully free = %d\n", miscData.fullyFree[2]); - Log("# VolFrag entries found = %d. 45 VolFrags per block\n", miscData.nVolFrag); - Log(" # Blocks with space = %d\n", miscData.freeLength[1]); - Log(" # of those fully free = %d\n", miscData.fullyFree[1]); - Log("# free blocks = %d\n", miscData.freeLength[0]); + Log("# 2K database blocks = %d\n", miscData.nBlocks); + Log("# Dump entries found = %d. 3 dumps per block\n", + miscData.nDump); + Log(" max tapes on a dump = %d\n", miscData.maxTapesPerDump); + Log(" max volumes on a dump = %d\n", miscData.maxVolsPerDump); + Log(" max appends on a dump = %d\n", miscData.maxAppendsPerDump); + Log(" # Blocks with space = %d\n", miscData.freeLength[4]); + Log(" # of those fully free = %d\n", miscData.fullyFree[4]); + Log("# Tape entries found = %d. 20 tapes per block\n", + miscData.nTape); + Log(" max volumes on a tape = %d\n", miscData.maxVolsPerTape); + Log(" # Blocks with space = %d\n", miscData.freeLength[3]); + Log(" # of those fully free = %d\n", miscData.fullyFree[3]); + Log("# VolInfo entries found = %d. 20 volInfos per block\n", + miscData.nVolInfo); + Log(" # head of sameNameCh = %d\n", miscData.nVolName); + Log(" max on a sameNameCh = %d\n", miscData.maxVolInfosPerName); + Log(" max VolFrags on chain = %d\n", miscData.maxVolsPerVolInfo); + Log(" # Blocks with space = %d\n", miscData.freeLength[2]); + Log(" # of those fully free = %d\n", miscData.fullyFree[2]); + Log("# VolFrag entries found = %d. 45 VolFrags per block\n", + miscData.nVolFrag); + Log(" # Blocks with space = %d\n", miscData.freeLength[1]); + Log(" # of those fully free = %d\n", miscData.fullyFree[1]); + Log("# free blocks = %d\n", miscData.freeLength[0]); } Log("Verify of database completed. %d errors found\n", miscData.errors); - if (miscData.errors && !code) code = DBBAD; - return(code); + if (miscData.errors && !code) + code = DBBAD; + return (code); } @@ -1415,20 +1430,22 @@ error_exit: * host - address of host that did verification */ afs_int32 DbVerify(); -afs_int32 BUDB_DbVerify(call, status, orphans, host) +afs_int32 +SBUDB_DbVerify(call, status, orphans, host) struct rx_call *call; afs_int32 *status; afs_int32 *orphans; afs_int32 *host; { - afs_int32 code; + afs_int32 code; - code = DbVerify(call, status, orphans, host); - osi_auditU(call, BUDB_DBVfyEvent, code, AUD_END); - return code; + code = DbVerify(call, status, orphans, host); + osi_auditU(call, BUDB_DBVfyEvent, code, AUD_END); + return code; } -afs_int32 DbVerify(call, status, orphans, host) +afs_int32 +DbVerify(call, status, orphans, host) struct rx_call *call; afs_int32 *status; afs_int32 *orphans; @@ -1439,34 +1456,38 @@ afs_int32 DbVerify(call, status, orphans, host) char hostname[64]; struct hostent *th; - if ( callPermitted(call) == 0 ) + if (callPermitted(call) == 0) ERROR(BUDB_NOTPERMITTED); - tcode = InitRPC (&ut, LOCKREAD, 1); - if (tcode) ERROR(tcode); + tcode = InitRPC(&ut, LOCKREAD, 1); + if (tcode) + ERROR(tcode); - tcode = verifyDatabase(ut, 0); /* check the database */ - if (tcode) ERROR(tcode); + tcode = verifyDatabase(ut, 0); /* check the database */ + if (tcode) + ERROR(tcode); -error_exit: + error_exit: if (ut) { - if (code) ubik_AbortTrans(ut); - else code = ubik_EndTrans(ut); + if (code) + ubik_AbortTrans(ut); + else + code = ubik_EndTrans(ut); } - *status = code; + *status = code; *orphans = 0; gethostname(hostname, sizeof(hostname)); th = gethostbyname(hostname); - if (!th) *host = 0; - else - { + if (!th) + *host = 0; + else { memcpy(host, th->h_addr, sizeof(afs_int32)); *host = ntohl(*host); } - return(0); + return (0); } /* ---------------------- @@ -1485,22 +1506,18 @@ check_header(callerst) afs_int32 eof; eof = ntohl(db.h.eofPtr); - if ( (eof == 0) || (eof < 0) ) - { - Log("Eof check failed, caller %s, eof 0x%x\n", - callerst, eof); + if ((eof == 0) || (eof < 0)) { + Log("Eof check failed, caller %s, eof 0x%x\n", callerst, eof); } eof -= sizeof(db.h); - if ( eof < 0 ) - { - Log("Adjusted Eof check failed, caller %s, eof 0x%x\n", - callerst, eof); + if (eof < 0) { + Log("Adjusted Eof check failed, caller %s, eof 0x%x\n", callerst, + eof); } iteration_count++; - if ( iteration_count >= 10 ) - { + if (iteration_count >= 10) { Log("Eof ptr is 0x%x\n", eof); iteration_count = 0; } diff --git a/src/budb/procs.c b/src/budb/procs.c index 1a7edea34..8a01c462a 100644 --- a/src/budb/procs.c +++ b/src/budb/procs.c @@ -16,7 +16,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/budb/procs.c,v 1.1.1.6 2003/07/30 17:11:30 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/budb/procs.c,v 1.14 2003/12/07 22:49:19 jaltman Exp $"); #ifdef AFS_NT40_ENV #include @@ -26,6 +27,8 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/procs.c,v 1.1.1.6 2003/07/30 17:11 #include #include #include +#endif + #ifdef HAVE_STRING_H #include #else @@ -33,7 +36,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/procs.c,v 1.1.1.6 2003/07/30 17:11 #include #endif #endif -#endif + #include #include #include @@ -62,35 +65,34 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/procs.c,v 1.1.1.6 2003/07/30 17:11 extern struct ubik_dbase *BU_dbase; extern struct afsconf_dir *BU_conf; /* for getting cell info */ -extern afs_int32 myHost; -extern struct memoryDB db; /* incore copies of db structures */ -afs_int32 AddVolume(), AddVolumes(), CreateDump(), DoDeleteDump(), DoDeleteTape(), ListDumps(); +afs_int32 AddVolume(), AddVolumes(), CreateDump(), DoDeleteDump(), +DoDeleteTape(), ListDumps(); afs_int32 DeleteVDP(), FindClone(), FindDump(), FindLatestDump(); -afs_int32 FinishDump(), FinishTape(), GetDumps(), getExpiration(), T_DumpDatabase(); +afs_int32 FinishDump(), FinishTape(), GetDumps(), getExpiration(), +T_DumpDatabase(); afs_int32 makeAppended(), MakeDumpAppended(), FindLastTape(), GetTapes(); afs_int32 GetVolumes(), UseTape(), T_DumpHashTable(), T_GetVersion(); /* Text block management */ -struct memTextBlock -{ +struct memTextBlock { struct memTextBlock *mtb_next; /* next in chain */ - afs_int32 mtb_nbytes; /* # of bytes in this block */ - struct blockHeader mtb_blkHeader; /* in memory header */ - dbadr mtb_addr; /* disk address of block */ + afs_int32 mtb_nbytes; /* # of bytes in this block */ + struct blockHeader mtb_blkHeader; /* in memory header */ + dbadr mtb_addr; /* disk address of block */ }; -typedef struct memTextBlock memTextBlockT; -typedef memTextBlockT *memTextBlockP; +typedef struct memTextBlock memTextBlockT; +typedef memTextBlockT *memTextBlockP; /* These variable are for returning debugging info about the state of the server. If they get trashed during multi-threaded operation it doesn't matter. */ /* This is global so COUNT_REQ in krb_udp.c can refer to it. */ -char *lastOperation; /* name of last operation */ -static Date lastTrans; /* time of last transaction */ +char *lastOperation; /* name of last operation */ +static Date lastTrans; /* time of last transaction */ /* procsInited is sort of a lock: during a transaction only one process runs while procsInited is false. */ @@ -99,24 +101,25 @@ static int procsInited = 0; /* This variable is protected by the procsInited flag. */ -static int (*rebuildDatabase)(); +static int (*rebuildDatabase) (); /* AwaitInitialization * Wait unitl budb has initialized (InitProcs). If it hasn't * within 5 seconds, then return no quorum. - */ + */ afs_int32 -AwaitInitialization() -{ - afs_int32 start = 0; +AwaitInitialization() +{ + afs_int32 start = 0; - while (!procsInited) - { - if (!start) start = time(0); - else if (time(0)-start > 5) return UNOQUORUM; - IOMGR_Sleep (1); - } - return 0; + while (!procsInited) { + if (!start) + start = time(0); + else if (time(0) - start > 5) + return UNOQUORUM; + IOMGR_Sleep(1); + } + return 0; } /* tailCompPtr @@ -130,16 +133,14 @@ tailCompPtr(pathNamePtr) { char *ptr; ptr = strrchr(pathNamePtr, '/'); - if ( ptr == 0 ) - { - /* this should never happen */ - LogError(0, "tailCompPtr: could not find / in name(%s)\n", - pathNamePtr); - return(pathNamePtr); - } - else - ptr++; /* skip the / */ - return(ptr); + if (ptr == 0) { + /* this should never happen */ + LogError(0, "tailCompPtr: could not find / in name(%s)\n", + pathNamePtr); + return (pathNamePtr); + } else + ptr++; /* skip the / */ + return (ptr); } /* callPermitted @@ -149,21 +150,23 @@ tailCompPtr(pathNamePtr) * 1 - yes */ +int callPermitted(call) - struct rx_call *call; + struct rx_call *call; { int permitted = 0; struct afsconf_dir *acdir; acdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH); - if (!acdir) return 0; + if (!acdir) + return 0; - if ( afsconf_SuperUser(acdir, call, (char *)0) ) - permitted = 1; + if (afsconf_SuperUser(acdir, call, NULL)) + permitted = 1; - exit: - if (acdir) afsconf_Close(acdir); - return(permitted); + if (acdir) + afsconf_Close(acdir); + return (permitted); } /* InitRPC @@ -178,67 +181,63 @@ callPermitted(call) * single threading by use of the lock. */ -afs_int32 -InitRPC (ut, lock, this_op) - struct ubik_trans **ut; - int lock; /* indicate read/write transaction */ - int this_op; /* opcode of RCP, for COUNT_ABO */ -{ - int code; - float wait = 0.91; /* start waiting for 1 second */ +afs_int32 +InitRPC(ut, lock, this_op) + struct ubik_trans **ut; + int lock; /* indicate read/write transaction */ + int this_op; /* opcode of RCP, for COUNT_ABO */ +{ + int code; + float wait = 0.91; /* start waiting for 1 second */ -start: + start: /* wait for server initialization to finish if this is not InitProcs calling */ - if (this_op) - if (code = AwaitInitialization()) + if (this_op) + if (code = AwaitInitialization()) return code; - for (code = UNOQUORUM; code == UNOQUORUM; ) - { - code = ubik_BeginTrans(BU_dbase, - ((lock == LOCKREAD) ? UBIK_READTRANS : UBIK_WRITETRANS), - ut); - if (code == UNOQUORUM) - { /* no quorum elected */ - if (wait < 1) Log("Waiting for quorum election\n"); - if (wait < 15.0) wait *= 1.1; - IOMGR_Sleep ((int)wait); + for (code = UNOQUORUM; code == UNOQUORUM;) { + code = + ubik_BeginTrans(BU_dbase, + ((lock == + LOCKREAD) ? UBIK_READTRANS : UBIK_WRITETRANS), + ut); + if (code == UNOQUORUM) { /* no quorum elected */ + if (wait < 1) + Log("Waiting for quorum election\n"); + if (wait < 15.0) + wait *= 1.1; + IOMGR_Sleep((int)wait); } } - if (code) return code; - if (wait > 1) Log("Have established quorum\n"); + if (code) + return code; + if (wait > 1) + Log("Have established quorum\n"); /* set lock at posiion 1, for 1 byte of type lock */ - if (code = ubik_SetLock (*ut, 1, 1, lock)) - { - ubik_AbortTrans (*ut); + if (code = ubik_SetLock(*ut, 1, 1, lock)) { + ubik_AbortTrans(*ut); return code; } /* check that dbase is initialized and setup cheader */ - if (lock == LOCKREAD) - { + if (lock == LOCKREAD) { /* init but don't fix because this is read only */ - if ( code = CheckInit(*ut, 0) ) - { + if (code = CheckInit(*ut, 0)) { ubik_AbortTrans(*ut); - if ( code = InitRPC(ut, LOCKWRITE, 0) ) /* Now fix the database */ - { - LogError(code, "InitRPC: InitRPC failed\n"); + if (code = InitRPC(ut, LOCKWRITE, 0)) { /* Now fix the database */ + LogError(code, "InitRPC: InitRPC failed\n"); return code; } - if ( code = ubik_EndTrans(*ut) ) - { - LogError(code, "InitRPC: ubik_EndTrans failed\n"); + if (code = ubik_EndTrans(*ut)) { + LogError(code, "InitRPC: ubik_EndTrans failed\n"); return code; } - goto start; /* now redo the read transaction */ + goto start; /* now redo the read transaction */ } - } - else - { - if (code = CheckInit(*ut, rebuildDatabase)) - { + } else { + if (code = CheckInit(*ut, rebuildDatabase)) { ubik_AbortTrans(*ut); return code; } @@ -248,118 +247,123 @@ start: } /* This is called to initialize a newly created database */ -static int initialize_database (ut) - struct ubik_trans *ut; +static int +initialize_database(ut) + struct ubik_trans *ut; { return 0; } static int noAuthenticationRequired; /* global state */ -static int recheckNoAuth; /* global state */ +static int recheckNoAuth; /* global state */ afs_int32 InitProcs() { - struct ubik_trans *ut; + struct ubik_trans *ut; afs_int32 code = 0; procsInited = 0; - if ( (globalConfPtr->myHost == 0) || (BU_conf == 0) ) + if ((globalConfPtr->myHost == 0) || (BU_conf == 0)) ERROR(BUDB_INTERNALERROR); recheckNoAuth = 1; - if ( globalConfPtr->debugFlags & DF_NOAUTH ) + if (globalConfPtr->debugFlags & DF_NOAUTH) noAuthenticationRequired = 1; - if ( globalConfPtr->debugFlags & DF_RECHECKNOAUTH ) + if (globalConfPtr->debugFlags & DF_RECHECKNOAUTH) recheckNoAuth = 0; if (recheckNoAuth) noAuthenticationRequired = afsconf_GetNoAuthFlag(BU_conf); - if (noAuthenticationRequired) + if (noAuthenticationRequired) LogError(0, "Running server with security disabled\n"); InitDB(); rebuildDatabase = initialize_database; - if (code = InitRPC (&ut, LOCKREAD, 0)) - { + if (code = InitRPC(&ut, LOCKREAD, 0)) { LogError(code, "InitProcs: InitRPC failed\n"); return code; } code = ubik_EndTrans(ut); - if (code) - { + if (code) { LogError(code, "InitProcs: ubik_EndTrans failed\n"); return code; } - rebuildDatabase = 0; /* only do this during init */ + rebuildDatabase = 0; /* only do this during init */ procsInited = 1; error_exit: - return(code); + return (code); } struct returnList { - int nElements; /* number in list */ - int allocSize; /* number of elements allocated */ - dbadr *elements; /* array of addresses */ + int nElements; /* number in list */ + int allocSize; /* number of elements allocated */ + dbadr *elements; /* array of addresses */ }; -static void InitReturnList (list) - struct returnList *list; +static void +InitReturnList(list) + struct returnList *list; { - list->nElements = 0; - list->allocSize = 0; - list->elements = (dbadr *)0; + list->nElements = 0; + list->allocSize = 0; + list->elements = (dbadr *) 0; } -static void FreeReturnList (list) - struct returnList *list; +static void +FreeReturnList(list) + struct returnList *list; { - if (list->elements) free(list->elements); - list->elements = (dbadr *)0; - list->nElements = 0; + if (list->elements) + free(list->elements); + list->elements = (dbadr *) 0; + list->nElements = 0; } /* As entries are collected, they are added to a return list. Once all * entries have been collected, it is then placed in the return buffer * with SendReturnList(). The first *to_skipP are not recorded. */ -static afs_int32 AddToReturnList (list, a, to_skipP) - struct returnList *list; - dbadr a; - afs_int32 *to_skipP; +static afs_int32 +AddToReturnList(list, a, to_skipP) + struct returnList *list; + dbadr a; + afs_int32 *to_skipP; { - char *tmp; - afs_int32 size; + char *tmp; + afs_int32 size; - if (a == 0) return 0; + if (a == 0) + return 0; if (*to_skipP > 0) { - (*to_skipP)--; - return 0; + (*to_skipP)--; + return 0; } /* Up to 5 plus a maximum so SendReturnList() knows if we * need to come back for more. */ - if (list->nElements >= BUDB_MAX_RETURN_LIST+5) - return BUDB_LIST2BIG; + if (list->nElements >= BUDB_MAX_RETURN_LIST + 5) + return BUDB_LIST2BIG; if (list->nElements >= list->allocSize) { if (list->elements == 0) { size = 10; - tmp = (char *) malloc (sizeof(dbadr) * size); + tmp = (char *)malloc(sizeof(dbadr) * size); } else { size = list->allocSize + 10; - tmp = (char *) realloc (list->elements, sizeof(dbadr) * size); + tmp = (char *)realloc(list->elements, sizeof(dbadr) * size); } - if (!tmp) return BUDB_NOMEM; + if (!tmp) + return BUDB_NOMEM; list->elements = (dbadr *) tmp; list->allocSize = size; } @@ -369,54 +373,61 @@ static afs_int32 AddToReturnList (list, a, to_skipP) return 0; } -afs_int32 FillVolEntry(ut, va, vol) - struct ubik_trans *ut; - dbadr va; - struct budb_volumeEntry *vol; +afs_int32 +FillVolEntry(ut, va, vol) + struct ubik_trans *ut; + dbadr va; + struct budb_volumeEntry *vol; { - struct dump d; - struct tape t; - struct volInfo vi; + struct dump d; + struct tape t; + struct volInfo vi; struct volFragment vf; - if (dbread (ut, va, &vf, sizeof(vf))) return BUDB_IO; /* The volFrag */ - if (dbread (ut, ntohl(vf.vol), &vi, sizeof(vi))) return BUDB_IO; /* The volInfo */ - if (dbread (ut, ntohl(vf.tape), &t, sizeof(t))) return BUDB_IO; /* The tape */ - if (dbread (ut, ntohl(t.dump), &d, sizeof(d))) return BUDB_IO; /* The dump */ - - strcpy (vol->name, vi.name); - strcpy (vol->server, vi.server); - strcpy (vol->tape, t.name); - vol->tapeSeq = ntohl(t.seq); - vol->dump = ntohl(d.id); - vol->position = ntohl(vf.position); - vol->clone = ntohl(vf.clone); - vol->incTime = ntohl(vf.incTime); - vol->nBytes = ntohl(vf.nBytes); + if (dbread(ut, va, &vf, sizeof(vf))) + return BUDB_IO; /* The volFrag */ + if (dbread(ut, ntohl(vf.vol), &vi, sizeof(vi))) + return BUDB_IO; /* The volInfo */ + if (dbread(ut, ntohl(vf.tape), &t, sizeof(t))) + return BUDB_IO; /* The tape */ + if (dbread(ut, ntohl(t.dump), &d, sizeof(d))) + return BUDB_IO; /* The dump */ + + strcpy(vol->name, vi.name); + strcpy(vol->server, vi.server); + strcpy(vol->tape, t.name); + vol->tapeSeq = ntohl(t.seq); + vol->dump = ntohl(d.id); + vol->position = ntohl(vf.position); + vol->clone = ntohl(vf.clone); + vol->incTime = ntohl(vf.incTime); + vol->nBytes = ntohl(vf.nBytes); vol->startByte = ntohl(vf.startByte); - vol->flags = (ntohs(vf.flags) & VOLFRAGMENTFLAGS); /* low 16 bits here */ - vol->flags |= (ntohl(vi.flags) & VOLINFOFLAGS); /* high 16 bits here */ - vol->seq = ntohs(vf.sequence); - vol->id = ntohl(vi.id); + vol->flags = (ntohs(vf.flags) & VOLFRAGMENTFLAGS); /* low 16 bits here */ + vol->flags |= (ntohl(vi.flags) & VOLINFOFLAGS); /* high 16 bits here */ + vol->seq = ntohs(vf.sequence); + vol->id = ntohl(vi.id); vol->partition = ntohl(vi.partition); return 0; } -afs_int32 FillDumpEntry (ut, da, dump) - struct ubik_trans *ut; - dbadr da; - struct budb_dumpEntry *dump; +afs_int32 +FillDumpEntry(ut, da, dump) + struct ubik_trans *ut; + dbadr da; + struct budb_dumpEntry *dump; { struct dump d, ad; - if (dbread (ut, da, &d, sizeof(d))) return BUDB_IO; + if (dbread(ut, da, &d, sizeof(d))) + return BUDB_IO; dump->id = ntohl(d.id); dump->flags = ntohl(d.flags); dump->created = ntohl(d.created); - strncpy (dump->name, d.dumpName, sizeof(dump->name)); - strncpy (dump->dumpPath, d.dumpPath, sizeof(dump->dumpPath)); - strncpy (dump->volumeSetName, d.volumeSet, sizeof(dump->volumeSetName)); + strncpy(dump->name, d.dumpName, sizeof(dump->name)); + strncpy(dump->dumpPath, d.dumpPath, sizeof(dump->dumpPath)); + strncpy(dump->volumeSetName, d.volumeSet, sizeof(dump->volumeSetName)); dump->parent = ntohl(d.parent); dump->level = ntohl(d.level); @@ -425,45 +436,45 @@ afs_int32 FillDumpEntry (ut, da, dump) tapeSet_ntoh(&d.tapes, &dump->tapes); if (strlen(d.dumper.name) < sizeof(dump->dumper.name)) - strcpy (dump->dumper.name, d.dumper.name); + strcpy(dump->dumper.name, d.dumper.name); if (strlen(d.dumper.instance) < sizeof(dump->dumper.instance)) - strcpy (dump->dumper.instance, d.dumper.instance); + strcpy(dump->dumper.instance, d.dumper.instance); if (strlen(d.dumper.cell) < sizeof(dump->dumper.cell)) - strcpy (dump->dumper.cell, d.dumper.cell); + strcpy(dump->dumper.cell, d.dumper.cell); /* Get the initial dumpid and the appended dump id */ dump->initialDumpID = ntohl(d.initialDumpID); - if (d.appendedDumpChain) - { - if (dbread (ut, ntohl(d.appendedDumpChain), &ad, sizeof(ad))) return BUDB_IO; + if (d.appendedDumpChain) { + if (dbread(ut, ntohl(d.appendedDumpChain), &ad, sizeof(ad))) + return BUDB_IO; dump->appendedDumpID = ntohl(ad.id); - } - else - dump->appendedDumpID = 0; + } else + dump->appendedDumpID = 0; /* printf("dump name %s, parent %d, level %d\n", - d.dumpName, ntohl(d.parent), ntohl(d.level)); */ + * d.dumpName, ntohl(d.parent), ntohl(d.level)); */ return 0; } -afs_int32 FillTapeEntry (ut, ta, tape) - struct ubik_trans *ut; - dbadr ta; - struct budb_tapeEntry *tape; +afs_int32 +FillTapeEntry(ut, ta, tape) + struct ubik_trans *ut; + dbadr ta; + struct budb_tapeEntry *tape; { struct tape t; struct dump d; afs_int32 code; - if ( dbread (ut, ta, &t, sizeof(t)) ) + if (dbread(ut, ta, &t, sizeof(t))) return BUDB_IO; /* Get the tape's expiration date */ - if ( code = getExpiration(ut,&t) ) - return(code); + if (code = getExpiration(ut, &t)) + return (code); - strcpy (tape->name, t.name); + strcpy(tape->name, t.name); tape->flags = ntohl(t.flags); tape->written = ntohl(t.written); tape->expires = ntohl(t.expires); @@ -476,7 +487,8 @@ afs_int32 FillTapeEntry (ut, ta, tape) tape->useCount = ntohl(t.useCount); tape->useKBytes = ntohl(t.useKBytes); - if (dbread (ut, ntohl(t.dump), &d, sizeof(d))) return BUDB_IO; + if (dbread(ut, ntohl(t.dump), &d, sizeof(d))) + return BUDB_IO; tape->dump = ntohl(d.id); return 0; } @@ -490,19 +502,19 @@ afs_int32 FillTapeEntry (ut, ta, tape) * if there are more and how many to skip on the next request. */ static afs_int32 -SendReturnList (ut, list, FillProc, e_size, index, nextIndexP, dbTimeP, eList) - struct ubik_trans *ut; - struct returnList *list; /* list of elements to return */ - afs_int32 (*FillProc)(); /* proc to fill entry */ - int e_size; /* size of each element */ - afs_int32 index; /* index from previous call */ - afs_int32 *nextIndexP; /* if more elements are available */ - afs_int32 *dbTimeP; /* time of last db update */ - budb_dumpList *eList; /* rxgen list structure (e.g.) */ +SendReturnList(ut, list, FillProc, e_size, index, nextIndexP, dbTimeP, eList) + struct ubik_trans *ut; + struct returnList *list; /* list of elements to return */ +afs_int32(*FillProc) (); /* proc to fill entry */ + int e_size; /* size of each element */ + afs_int32 index; /* index from previous call */ + afs_int32 *nextIndexP; /* if more elements are available */ + afs_int32 *dbTimeP; /* time of last db update */ + budb_dumpList *eList; /* rxgen list structure (e.g.) */ { afs_int32 code; - int to_return; - int i; + int to_return; + int i; char *e; *nextIndexP = -1; @@ -513,53 +525,66 @@ SendReturnList (ut, list, FillProc, e_size, index, nextIndexP, dbTimeP, eList) */ to_return = list->nElements; if (to_return > BUDB_MAX_RETURN_LIST) - to_return = BUDB_MAX_RETURN_LIST; + to_return = BUDB_MAX_RETURN_LIST; if (eList->budb_dumpList_len && (to_return > eList->budb_dumpList_len)) - to_return = eList->budb_dumpList_len; + to_return = eList->budb_dumpList_len; /* Allocate space for the return values if needed and zero it */ if (eList->budb_dumpList_val == 0) { - eList->budb_dumpList_val = (struct budb_dumpEntry *)malloc (e_size * to_return); - if (!eList->budb_dumpList_val) return(BUDB_NOMEM); + eList->budb_dumpList_val = + (struct budb_dumpEntry *)malloc(e_size * to_return); + if (!eList->budb_dumpList_val) + return (BUDB_NOMEM); } memset(eList->budb_dumpList_val, 0, e_size * to_return); eList->budb_dumpList_len = to_return; e = (char *)(eList->budb_dumpList_val); - for (i=0; ielements[i], e); - if (code) return code; + if (code) + return code; } if (list->nElements > i) - *nextIndexP = index + i; + *nextIndexP = index + i; return 0; } /* Come here to delete a volInfo structure. */ -static afs_int32 DeleteVolInfo (ut, via, vi) - struct ubik_trans *ut; - dbadr via; - struct volInfo *vi; -{ afs_int32 code; +static afs_int32 +DeleteVolInfo(ut, via, vi) + struct ubik_trans *ut; + dbadr via; + struct volInfo *vi; +{ + afs_int32 code; dbadr hvia; struct volInfo hvi; - if (vi->firstFragment) return 0; /* still some frags, don't free yet */ - if (vi->sameNameHead == 0) { /* this is the head */ - if (vi->sameNameChain) return 0; /* empty head, some non-heads left */ + if (vi->firstFragment) + return 0; /* still some frags, don't free yet */ + if (vi->sameNameHead == 0) { /* this is the head */ + if (vi->sameNameChain) + return 0; /* empty head, some non-heads left */ - code = ht_HashOut (ut, &db.volName, via, vi); - if (code) return code; - code = FreeStructure (ut, volInfo_BLOCK, via); + code = ht_HashOut(ut, &db.volName, via, vi); + if (code) + return code; + code = FreeStructure(ut, volInfo_BLOCK, via); return code; } hvia = ntohl(vi->sameNameHead); - if (dbread (ut, hvia, &hvi, sizeof(hvi))) return BUDB_IO; - code = RemoveFromList (ut, hvia, &hvi, &hvi.sameNameChain, via, vi, &vi->sameNameChain); - if (code == -1) return BUDB_DATABASEINCONSISTENT; - if (code == 0) code = FreeStructure (ut, volInfo_BLOCK, via); + if (dbread(ut, hvia, &hvi, sizeof(hvi))) + return BUDB_IO; + code = + RemoveFromList(ut, hvia, &hvi, &hvi.sameNameChain, via, vi, + &vi->sameNameChain); + if (code == -1) + return BUDB_DATABASEINCONSISTENT; + if (code == 0) + code = FreeStructure(ut, volInfo_BLOCK, via); return code; } @@ -567,26 +592,37 @@ static afs_int32 DeleteVolInfo (ut, via, vi) already freed. This routine frees the structure and the caller must not write it out. */ -static afs_int32 DeleteVolFragment (ut, va, v) - struct ubik_trans *ut; - dbadr va; - struct volFragment *v; -{ afs_int32 code; +static afs_int32 +DeleteVolFragment(ut, va, v) + struct ubik_trans *ut; + dbadr va; + struct volFragment *v; +{ + afs_int32 code; struct volInfo vi; dbadr via; via = ntohl(v->vol); - if (dbread (ut, via, &vi, sizeof(vi))) return BUDB_IO; - code = RemoveFromList (ut, via, &vi, &vi.firstFragment, va, v, &v->sameNameChain); - if (code == -1) return BUDB_DATABASEINCONSISTENT; - if (code) return code; + if (dbread(ut, via, &vi, sizeof(vi))) + return BUDB_IO; + code = + RemoveFromList(ut, via, &vi, &vi.firstFragment, va, v, + &v->sameNameChain); + if (code == -1) + return BUDB_DATABASEINCONSISTENT; + if (code) + return code; if (vi.firstFragment == 0) - if (code = DeleteVolInfo (ut, via, &vi)) return code; - if (code = FreeStructure (ut, volFragment_BLOCK, va)) return code; + if (code = DeleteVolInfo(ut, via, &vi)) + return code; + if (code = FreeStructure(ut, volFragment_BLOCK, va)) + return code; /* decrement frag counter */ - code = set_word_addr (ut, via, &vi, &vi.nFrags, htonl(ntohl(vi.nFrags)-1)); - if (code) return code; + code = + set_word_addr(ut, via, &vi, &vi.nFrags, htonl(ntohl(vi.nFrags) - 1)); + if (code) + return code; return 0; } @@ -594,49 +630,61 @@ static afs_int32 DeleteVolFragment (ut, va, v) * The caller will remove it from the hash table if necessary. The caller is * also responsible for writing the tape out if necessary. */ -static afs_int32 DeleteTape (ut, ta, t) - struct ubik_trans *ut; - dbadr ta; - struct tape *t; -{ afs_int32 code; +static afs_int32 +DeleteTape(ut, ta, t) + struct ubik_trans *ut; + dbadr ta; + struct tape *t; +{ + afs_int32 code; struct dump d; dbadr da; da = ntohl(t->dump); - if (da == 0) return BUDB_DATABASEINCONSISTENT; - if (dbread (ut, da, &d, sizeof(d))) return BUDB_IO; - if (d.firstTape == 0) return BUDB_DATABASEINCONSISTENT; + if (da == 0) + return BUDB_DATABASEINCONSISTENT; + if (dbread(ut, da, &d, sizeof(d))) + return BUDB_IO; + if (d.firstTape == 0) + return BUDB_DATABASEINCONSISTENT; - code = RemoveFromList (ut, da, &d, &d.firstTape, ta, t, &t->nextTape); - if (code == -1) return BUDB_DATABASEINCONSISTENT; - if (code) return code; + code = RemoveFromList(ut, da, &d, &d.firstTape, ta, t, &t->nextTape); + if (code == -1) + return BUDB_DATABASEINCONSISTENT; + if (code) + return code; /* Since the tape should have been truncated there should never be any * volumes in the tape. */ - if (t->firstVol || t->nVolumes) return BUDB_DATABASEINCONSISTENT; + if (t->firstVol || t->nVolumes) + return BUDB_DATABASEINCONSISTENT; return 0; } static afs_int32 -DeleteDump (ut, da, d) +DeleteDump(ut, da, d) struct ubik_trans *ut; dbadr da; struct dump *d; -{ - afs_int32 code = 0; +{ + afs_int32 code = 0; - code = ht_HashOut (ut, &db.dumpIden, da, d); - if (code) ERROR(code); + code = ht_HashOut(ut, &db.dumpIden, da, d); + if (code) + ERROR(code); - code = ht_HashOut (ut, &db.dumpName, da, d); - if (code) ERROR(code); + code = ht_HashOut(ut, &db.dumpName, da, d); + if (code) + ERROR(code); /* Since the tape should have been truncated this should never happen. */ - if (d->firstTape || d->nVolumes) ERROR(BUDB_DATABASEINCONSISTENT); + if (d->firstTape || d->nVolumes) + ERROR(BUDB_DATABASEINCONSISTENT); - code = FreeStructure (ut, dump_BLOCK, da); - if (code) ERROR(code); + code = FreeStructure(ut, dump_BLOCK, da); + if (code) + ERROR(code); error_exit: return code; @@ -654,16 +702,16 @@ DeleteDump (ut, da, d) * Always AND the flags with VOLINFOFLAGS for backwards compatability (3.3). */ -static int VolInfoMatch (vol, vi) - struct budb_volumeEntry *vol; - struct volInfo *vi; +static int +VolInfoMatch(vol, vi) + struct budb_volumeEntry *vol; + struct volInfo *vi; { - return ( (strcmp (vol->name, vi->name) == 0) && /* same volume name */ - (vol->id == ntohl(vi->id)) && /* same volume id */ - ((vol->flags & VOLINFOFLAGS) == - (ntohl(vi->flags) & VOLINFOFLAGS)) && /* same flags */ - (vol->partition == ntohl(vi->partition)) && /* same partition (N/A)*/ - (strcmp (vol->server, vi->server) == 0) ); /* same server (N/A) */ + return ((strcmp(vol->name, vi->name) == 0) && /* same volume name */ + (vol->id == ntohl(vi->id)) && /* same volume id */ + ((vol->flags & VOLINFOFLAGS) == (ntohl(vi->flags) & VOLINFOFLAGS)) && /* same flags */ + (vol->partition == ntohl(vi->partition)) && /* same partition (N/A) */ + (strcmp(vol->server, vi->server) == 0)); /* same server (N/A) */ } /* @@ -674,76 +722,82 @@ static int VolInfoMatch (vol, vi) * The caller must write the entry out. */ -static afs_int32 GetVolInfo (ut, volP, viaP, viP) - struct ubik_trans *ut; - struct budb_volumeEntry *volP; - dbadr *viaP; - struct volInfo *viP; +static afs_int32 +GetVolInfo(ut, volP, viaP, viP) + struct ubik_trans *ut; + struct budb_volumeEntry *volP; + dbadr *viaP; + struct volInfo *viP; { - dbadr hvia, via; + dbadr hvia, via; struct volInfo hvi; - afs_int32 eval, code = 0; - - eval = ht_LookupEntry (ut, &db.volName, volP->name, &via, viP); - if (eval) ERROR(eval); - - if (!via) - { - /* allocate a new volinfo structure */ - eval = AllocStructure (ut, volInfo_BLOCK, 0, &via, viP); - if (eval) ERROR(eval); + afs_int32 eval, code = 0; - strcpy (viP->name, volP->name); - strcpy (viP->server, volP->server); - viP->sameNameHead = 0; /* The head of same name chain */ - viP->sameNameChain = 0; /* Same name chain is empty */ + eval = ht_LookupEntry(ut, &db.volName, volP->name, &via, viP); + if (eval) + ERROR(eval); + + if (!via) { + /* allocate a new volinfo structure */ + eval = AllocStructure(ut, volInfo_BLOCK, 0, &via, viP); + if (eval) + ERROR(eval); + + strcpy(viP->name, volP->name); + strcpy(viP->server, volP->server); + viP->sameNameHead = 0; /* The head of same name chain */ + viP->sameNameChain = 0; /* Same name chain is empty */ viP->firstFragment = 0; - viP->nFrags = 0; - viP->id = htonl(volP->id); - viP->partition = htonl(volP->partition); - viP->flags = htonl(volP->flags & VOLINFOFLAGS); + viP->nFrags = 0; + viP->id = htonl(volP->id); + viP->partition = htonl(volP->partition); + viP->flags = htonl(volP->flags & VOLINFOFLAGS); /* Chain onto volname hash table */ - eval = ht_HashIn (ut, &db.volName, via, viP); - if (eval) ERROR(eval); + eval = ht_HashIn(ut, &db.volName, via, viP); + if (eval) + ERROR(eval); - LogDebug(4, "volume Info for %s placed at %d\n", db.volName, via); + LogDebug(4, "volume Info for %s placed at %d\n", db.volName, via); } - else if ( !VolInfoMatch(volP,viP) ) /* Not the head volinfo struct */ - { - hvia = via; /* remember the head volinfo struct */ + else if (!VolInfoMatch(volP, viP)) { /* Not the head volinfo struct */ + hvia = via; /* remember the head volinfo struct */ memcpy(&hvi, viP, sizeof(hvi)); - /* Search the same name chain for the correct volinfo structure */ - for (via=ntohl(viP->sameNameChain); via; via=ntohl(viP->sameNameChain)) - { - eval = dbread (ut, via, viP, sizeof(*viP)); - if (eval) ERROR(eval); + /* Search the same name chain for the correct volinfo structure */ + for (via = ntohl(viP->sameNameChain); via; + via = ntohl(viP->sameNameChain)) { + eval = dbread(ut, via, viP, sizeof(*viP)); + if (eval) + ERROR(eval); - if ( VolInfoMatch(volP,viP) ) break; /* found the one */ + if (VolInfoMatch(volP, viP)) + break; /* found the one */ } - + /* if the correct volinfo struct isn't found, create one */ - if (!via) - { - eval = AllocStructure (ut, volInfo_BLOCK, 0, &via, viP); - if (eval) ERROR(eval); - - strcpy (viP->name, volP->name); - strcpy (viP->server, volP->server); - viP->nameHashChain = 0; /* not in hash table */ - viP->sameNameHead = htonl(hvia); /* chain to head of sameNameChain */ + if (!via) { + eval = AllocStructure(ut, volInfo_BLOCK, 0, &via, viP); + if (eval) + ERROR(eval); + + strcpy(viP->name, volP->name); + strcpy(viP->server, volP->server); + viP->nameHashChain = 0; /* not in hash table */ + viP->sameNameHead = htonl(hvia); /* chain to head of sameNameChain */ viP->sameNameChain = hvi.sameNameChain; viP->firstFragment = 0; - viP->nFrags = 0; - viP->id = htonl(volP->id); - viP->partition = htonl(volP->partition); - viP->flags = htonl(volP->flags & VOLINFOFLAGS); + viP->nFrags = 0; + viP->id = htonl(volP->id); + viP->partition = htonl(volP->partition); + viP->flags = htonl(volP->flags & VOLINFOFLAGS); /* write the head entry's sameNameChain link */ - eval = set_word_addr (ut, hvia, &hvi, &hvi.sameNameChain, htonl(via)); - if (eval) ERROR(eval); + eval = + set_word_addr(ut, hvia, &hvi, &hvi.sameNameChain, htonl(via)); + if (eval) + ERROR(eval); } } @@ -769,24 +823,27 @@ deleteSomeVolumesFromTape(ut, tapeAddr, tapePtr, maxVolumesToDelete) struct tape *tapePtr; int maxVolumesToDelete; { - dbadr volFragAddr, nextVolFragAddr, dumpAddr; + dbadr volFragAddr, nextVolFragAddr, dumpAddr; struct volFragment volFrag; - struct dump dump; - int volumesDeleted = 0; - afs_int32 eval, code = 0; + struct dump dump; + int volumesDeleted = 0; + afs_int32 eval, code = 0; - if (!tapePtr) ERROR(0); + if (!tapePtr) + ERROR(0); - for (volFragAddr=ntohl(tapePtr->firstVol); (volFragAddr && (maxVolumesToDelete > 0)); - volFragAddr=nextVolFragAddr) - { + for (volFragAddr = ntohl(tapePtr->firstVol); + (volFragAddr && (maxVolumesToDelete > 0)); + volFragAddr = nextVolFragAddr) { eval = dbread(ut, volFragAddr, &volFrag, sizeof(volFrag)); - if (eval) ERROR(eval); + if (eval) + ERROR(eval); - nextVolFragAddr = ntohl(volFrag.sameTapeChain); + nextVolFragAddr = ntohl(volFrag.sameTapeChain); - eval = DeleteVolFragment(ut, volFragAddr, &volFrag); - if (eval) ERROR(eval); + eval = DeleteVolFragment(ut, volFragAddr, &volFrag); + if (eval) + ERROR(eval); maxVolumesToDelete--; volumesDeleted++; @@ -794,24 +851,27 @@ deleteSomeVolumesFromTape(ut, tapeAddr, tapePtr, maxVolumesToDelete) /* reset the volume fragment pointer in the tape */ tapePtr->firstVol = htonl(volFragAddr); - + /* diminish the tape's volume count */ tapePtr->nVolumes = htonl(ntohl(tapePtr->nVolumes) - volumesDeleted); eval = dbwrite(ut, tapeAddr, tapePtr, sizeof(*tapePtr)); - if (eval) ERROR(eval); + if (eval) + ERROR(eval); /* diminish the dump's volume count */ dumpAddr = ntohl(tapePtr->dump); eval = dbread(ut, dumpAddr, &dump, sizeof(dump)); - if (eval) ERROR(eval); + if (eval) + ERROR(eval); - dump.nVolumes = htonl(ntohl(dump.nVolumes) - volumesDeleted); + dump.nVolumes = htonl(ntohl(dump.nVolumes) - volumesDeleted); eval = dbwrite(ut, dumpAddr, &dump, sizeof(dump)); - if (eval) ERROR(eval); + if (eval) + ERROR(eval); error_exit: - return(code); + return (code); } /* deleteDump @@ -828,113 +888,122 @@ deleteSomeVolumesFromTape(ut, tapeAddr, tapePtr, maxVolumesToDelete) afs_int32 deleteDump(call, id, dumps) - struct rx_call *call; - dumpId id; - budb_dumpsList *dumps; + struct rx_call *call; + dumpId id; + budb_dumpsList *dumps; { struct ubik_trans *ut; - dbadr dumpAddr, tapeAddr, appendedDump; - struct dump dump; - struct tape tape; - dumpId dumpid; - int firstdump; - afs_int32 eval, code = 0; - int partialDel; + dbadr dumpAddr, tapeAddr, appendedDump; + struct dump dump; + struct tape tape; + dumpId dumpid; + afs_int32 eval, code = 0; + int partialDel = 0; /* iterate until the dump is truly deleted */ dumpid = id; - while (dumpid) - { - partialDel = 0; - while (1) - { + while (dumpid) { + partialDel = 0; + while (1) { eval = InitRPC(&ut, LOCKWRITE, 1); - if (eval) ERROR(eval); /* can't start transaction */ + if (eval) + ERROR(eval); /* can't start transaction */ - eval = ht_LookupEntry (ut, &db.dumpIden, &dumpid, &dumpAddr, &dump); - if (eval) ABORT(eval); - if (!dumpAddr) ABORT(BUDB_NOENT); /* can't find dump */ + eval = + ht_LookupEntry(ut, &db.dumpIden, &dumpid, &dumpAddr, &dump); + if (eval) + ABORT(eval); + if (!dumpAddr) + ABORT(BUDB_NOENT); /* can't find dump */ - if ( (dumpid == id) && (dump.initialDumpID) ) /* can't be an appended dump */ - ABORT(BUDB_NOTINITIALDUMP); + if ((dumpid == id) && (dump.initialDumpID)) /* can't be an appended dump */ + ABORT(BUDB_NOTINITIALDUMP); tapeAddr = ntohl(dump.firstTape); - if (tapeAddr == 0) break; - + if (tapeAddr == 0) + break; + /* there is a tape to delete */ eval = dbread(ut, tapeAddr, &tape, sizeof(tape)); - if (eval) ABORT(eval); - - if ( ntohl(tape.nVolumes) ) - { - /* tape is not empty */ - eval = deleteSomeVolumesFromTape(ut, tapeAddr, &tape, 10); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); + + if (ntohl(tape.nVolumes)) { + /* tape is not empty */ + eval = deleteSomeVolumesFromTape(ut, tapeAddr, &tape, 10); + if (eval) + ABORT(eval); } - - if ( ntohl(tape.nVolumes) == 0 ) - { - /* tape is now empty, delete it */ - eval = DeleteTape(ut, tapeAddr, &tape); - if (eval) ABORT(eval); + + if (ntohl(tape.nVolumes) == 0) { + /* tape is now empty, delete it */ + eval = DeleteTape(ut, tapeAddr, &tape); + if (eval) + ABORT(eval); eval = ht_HashOut(ut, &db.tapeName, tapeAddr, &tape); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); eval = FreeStructure(ut, tape_BLOCK, tapeAddr); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); } eval = ubik_EndTrans(ut); - if (eval) ERROR(eval); + if (eval) + ERROR(eval); partialDel = 1; - } /* next deletion portion */ + } /* next deletion portion */ /* Record the dump just deleted */ - if (dumps && (dumps->budb_dumpsList_len < BUDB_MAX_RETURN_LIST)) - { - if (dumps->budb_dumpsList_len == 0) - dumps->budb_dumpsList_val = (afs_int32 *) malloc(sizeof(afs_int32)); - else - dumps->budb_dumpsList_val = - (afs_int32 *) realloc(dumps->budb_dumpsList_val, - (dumps->budb_dumpsList_len+1)*sizeof(afs_int32)); - - if ( !dumps->budb_dumpsList_val ) ABORT(BUDB_NOMEM); - - dumps->budb_dumpsList_val[dumps->budb_dumpsList_len] = dumpid; - dumps->budb_dumpsList_len++; + if (dumps && (dumps->budb_dumpsList_len < BUDB_MAX_RETURN_LIST)) { + if (dumps->budb_dumpsList_len == 0) + dumps->budb_dumpsList_val = + (afs_int32 *) malloc(sizeof(afs_int32)); + else + dumps->budb_dumpsList_val = + (afs_int32 *) realloc(dumps->budb_dumpsList_val, + (dumps->budb_dumpsList_len + + 1) * sizeof(afs_int32)); + + if (!dumps->budb_dumpsList_val) + ABORT(BUDB_NOMEM); + + dumps->budb_dumpsList_val[dumps->budb_dumpsList_len] = dumpid; + dumps->budb_dumpsList_len++; } appendedDump = ntohl(dump.appendedDumpChain); /* finally done. No more tapes left in the dump. Delete the dump itself */ eval = DeleteDump(ut, dumpAddr, &dump); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); /* Now delete the appended dump too */ - if ( appendedDump ) - { + if (appendedDump) { eval = dbread(ut, appendedDump, &dump, sizeof(dump)); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); dumpid = ntohl(dump.id); - } - else + } else dumpid = 0; - + eval = ubik_EndTrans(ut); - if (eval) ERROR(eval); + if (eval) + ERROR(eval); - Log("Delete dump %s (DumpID %u), path %s\n", - dump.dumpName, ntohl(dump.id), dump.dumpPath); + Log("Delete dump %s (DumpID %u), path %s\n", dump.dumpName, + ntohl(dump.id), dump.dumpPath); } error_exit: if (code && partialDel) { - Log("Delete dump %s (DumpID %u), path %s - INCOMPLETE (code = %u)\n", - dump.dumpName, ntohl(dump.id), dump.dumpPath, code); + Log("Delete dump %s (DumpID %u), path %s - INCOMPLETE (code = %u)\n", + dump.dumpName, ntohl(dump.id), dump.dumpPath, code); } - return(code); + return (code); abort_exit: ubik_AbortTrans(ut); @@ -948,21 +1017,20 @@ deleteDump(call, id, dumps) /* most recent dump selection */ -struct chosenDump -{ +struct chosenDump { struct chosenDump *next; dbadr addr; - afs_uint32 date; + afs_uint32 date; }; -struct wantDumpRock -{ - int maxDumps; /* max wanted */ - int ndumps; /* actual in chain */ +struct wantDumpRock { + int maxDumps; /* max wanted */ + int ndumps; /* actual in chain */ struct chosenDump *chain; }; +int wantDump(dumpAddrParam, dumpParam, dumpListPtrParam) char *dumpAddrParam; char *dumpParam; @@ -973,21 +1041,22 @@ wantDump(dumpAddrParam, dumpParam, dumpListPtrParam) struct wantDumpRock *rockPtr; dumpAddr = (dbadr) dumpAddrParam; - dumpPtr = (struct dump *) dumpParam; - rockPtr = (struct wantDumpRock *) dumpListPtrParam; + dumpPtr = (struct dump *)dumpParam; + rockPtr = (struct wantDumpRock *)dumpListPtrParam; /* if we don't have our full complement, just add another */ - if ( rockPtr->ndumps < rockPtr->maxDumps ) - return(1); + if (rockPtr->ndumps < rockPtr->maxDumps) + return (1); /* got the number we need, select based on date */ - if ( (afs_uint32) ntohl(dumpPtr->created) > rockPtr->chain->date ) - return(1); + if ((afs_uint32) ntohl(dumpPtr->created) > rockPtr->chain->date) + return (1); - return(0); + return (0); } -rememberDump(dumpAddrParam, dumpParam, dumpListPtrParam) +int +rememberDump(dumpAddrParam, dumpParam, dumpListPtrParam) char *dumpAddrParam; char *dumpParam; char *dumpListPtrParam; @@ -998,35 +1067,35 @@ rememberDump(dumpAddrParam, dumpParam, dumpListPtrParam) struct chosenDump *ptr, *deletedPtr, **nextPtr; dumpAddr = (dbadr) dumpAddrParam; - dumpPtr = (struct dump *) dumpParam; - rockPtr = (struct wantDumpRock *) dumpListPtrParam; + dumpPtr = (struct dump *)dumpParam; + rockPtr = (struct wantDumpRock *)dumpListPtrParam; - ptr = (struct chosenDump *) malloc(sizeof(*ptr)); + ptr = (struct chosenDump *)malloc(sizeof(*ptr)); if (!ptr) - return(0); + return (0); memset(ptr, 0, sizeof(*ptr)); ptr->addr = dumpAddr; - ptr->date = (afs_uint32) ntohl(dumpPtr->created); + ptr->date = (afs_uint32) ntohl(dumpPtr->created); /* Don't overflow the max */ while (rockPtr->ndumps >= rockPtr->maxDumps) { - /* have to drop one */ - deletedPtr = rockPtr->chain; - rockPtr->chain = deletedPtr->next; - free(deletedPtr); - rockPtr->ndumps--; + /* have to drop one */ + deletedPtr = rockPtr->chain; + rockPtr->chain = deletedPtr->next; + free(deletedPtr); + rockPtr->ndumps--; } /* now insert in the right place */ for (nextPtr = &rockPtr->chain; *nextPtr; nextPtr = &((*nextPtr)->next)) { - if (ptr->date < (*nextPtr)->date) - break; + if (ptr->date < (*nextPtr)->date) + break; } ptr->next = *nextPtr; - *nextPtr = ptr; + *nextPtr = ptr; rockPtr->ndumps++; - return(0); + return (0); } @@ -1035,109 +1104,123 @@ rememberDump(dumpAddrParam, dumpParam, dumpListPtrParam) * --------------------------------------------- */ -afs_int32 BUDB_AddVolume (call, vol) - struct rx_call *call; - struct budb_volumeEntry *vol; +afs_int32 +SBUDB_AddVolume(call, vol) + struct rx_call *call; + struct budb_volumeEntry *vol; { - afs_int32 code; + afs_int32 code; - code = AddVolume (call, vol); - osi_auditU (call, BUDB_AddVolEvent, code, AUD_LONG, (vol ? vol->id : 0), AUD_END); - return code; + code = AddVolume(call, vol); + osi_auditU(call, BUDB_AddVolEvent, code, AUD_LONG, (vol ? vol->id : 0), + AUD_END); + return code; } -afs_int32 AddVolume (call, vol) - struct rx_call *call; - struct budb_volumeEntry *vol; -{ - struct ubik_trans *ut; - dbadr da, ta, via, va; - struct dump d; - struct tape t; - struct volInfo vi; +afs_int32 +AddVolume(call, vol) + struct rx_call *call; + struct budb_volumeEntry *vol; +{ + struct ubik_trans *ut; + dbadr da, ta, via, va; + struct dump d; + struct tape t; + struct volInfo vi; struct volFragment v; - afs_uint32 bytes; - afs_int32 eval, code = 0; + afs_uint32 bytes; + afs_int32 eval, code = 0; - if ( !callPermitted(call) ) + if (!callPermitted(call)) return BUDB_NOTPERMITTED; - if ( ( strlen(vol->name) >= sizeof(vi.name) ) || - ( strlen(vol->server) >= sizeof(vi.server) ) || - ( strlen(vol->tape) >= sizeof(t.name) ) ) - return BUDB_BADARGUMENT; + if ((strlen(vol->name) >= sizeof(vi.name)) + || (strlen(vol->server) >= sizeof(vi.server)) + || (strlen(vol->tape) >= sizeof(t.name))) + return BUDB_BADARGUMENT; - eval = InitRPC (&ut, LOCKWRITE, 1); - if (eval) return eval; + eval = InitRPC(&ut, LOCKWRITE, 1); + if (eval) + return eval; /* Find the dump in dumpid hash table */ - eval = ht_LookupEntry (ut, &db.dumpIden, &vol->dump, &da, &d); - if (eval) ABORT(eval); - if (!da) ABORT(BUDB_NODUMPID); + eval = ht_LookupEntry(ut, &db.dumpIden, &vol->dump, &da, &d); + if (eval) + ABORT(eval); + if (!da) + ABORT(BUDB_NODUMPID); /* search for the right tape in the dump */ - for (ta=ntohl(d.firstTape); ta; ta=ntohl(t.nextTape)) - { - /* read the tape entry */ + for (ta = ntohl(d.firstTape); ta; ta = ntohl(t.nextTape)) { + /* read the tape entry */ eval = dbread(ut, ta, &t, sizeof(t)); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); /* Check if the right tape name */ - if ( strcmp(t.name, vol->tape) == 0 ) + if (strcmp(t.name, vol->tape) == 0) break; } - if (!ta) ABORT(BUDB_NOTAPENAME); + if (!ta) + ABORT(BUDB_NOTAPENAME); - if ( (t.dump != htonl(da)) || /* tape must belong to dump */ - ((ntohl(t.flags) & BUDB_TAPE_BEINGWRITTEN) == 0) || /* tape must be being written */ - ((ntohl(d.flags) & BUDB_DUMP_INPROGRESS) == 0) ) /* dump must be in progress */ - ABORT(BUDB_BADPROTOCOL); + if ((t.dump != htonl(da)) || /* tape must belong to dump */ + ((ntohl(t.flags) & BUDB_TAPE_BEINGWRITTEN) == 0) || /* tape must be being written */ + ((ntohl(d.flags) & BUDB_DUMP_INPROGRESS) == 0)) /* dump must be in progress */ + ABORT(BUDB_BADPROTOCOL); /* find or create a volume info structure */ eval = GetVolInfo(ut, vol, &via, &vi); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); /* Create a volume fragment */ - eval = AllocStructure (ut, volFragment_BLOCK, 0, &va, &v); - if (eval) ABORT(eval); + eval = AllocStructure(ut, volFragment_BLOCK, 0, &va, &v); + if (eval) + ABORT(eval); - v.vol = htonl(via); /* vol frag points to vol info */ - v.sameNameChain = vi.firstFragment; /* vol frag is chained to vol info */ + v.vol = htonl(via); /* vol frag points to vol info */ + v.sameNameChain = vi.firstFragment; /* vol frag is chained to vol info */ vi.firstFragment = htonl(va); - vi.nFrags = htonl(ntohl(vi.nFrags)+1); + vi.nFrags = htonl(ntohl(vi.nFrags) + 1); - eval = dbwrite(ut, via, &vi, sizeof(vi)); /* write the vol info struct */ - if (eval) ABORT(eval); + eval = dbwrite(ut, via, &vi, sizeof(vi)); /* write the vol info struct */ + if (eval) + ABORT(eval); - v.tape = htonl(ta); /* vol frag points to tape */ - v.sameTapeChain = t.firstVol; /* vol frag is chained to tape info */ - t.firstVol = htonl(va); - t.nVolumes = htonl(ntohl(t.nVolumes) + 1); - bytes = ntohl(t.nBytes) + vol->nBytes; /* update bytes on tape */ - t.nMBytes = htonl(ntohl(t.nMBytes) + bytes/(1024*1024)); - t.nBytes = htonl(bytes % (1024*1024)); + v.tape = htonl(ta); /* vol frag points to tape */ + v.sameTapeChain = t.firstVol; /* vol frag is chained to tape info */ + t.firstVol = htonl(va); + t.nVolumes = htonl(ntohl(t.nVolumes) + 1); + bytes = ntohl(t.nBytes) + vol->nBytes; /* update bytes on tape */ + t.nMBytes = htonl(ntohl(t.nMBytes) + bytes / (1024 * 1024)); + t.nBytes = htonl(bytes % (1024 * 1024)); - eval = dbwrite(ut, ta, &t, sizeof(t)); /* write the tape structure */ - if (eval) ABORT(eval); + eval = dbwrite(ut, ta, &t, sizeof(t)); /* write the tape structure */ + if (eval) + ABORT(eval); - d.nVolumes = htonl(ntohl(d.nVolumes) + 1); /* one more volume on dump */ + d.nVolumes = htonl(ntohl(d.nVolumes) + 1); /* one more volume on dump */ - eval = dbwrite(ut, da, &d, sizeof(d)); /* write out the dump structure */ - if (eval) ABORT(eval); + eval = dbwrite(ut, da, &d, sizeof(d)); /* write out the dump structure */ + if (eval) + ABORT(eval); - v.position = htonl(vol->position); /* vol frag info */ - v.clone = htonl(vol->clone); - v.incTime = htonl(vol->incTime); + v.position = htonl(vol->position); /* vol frag info */ + v.clone = htonl(vol->clone); + v.incTime = htonl(vol->incTime); v.startByte = htonl(vol->startByte); - v.nBytes = htonl(vol->nBytes); - v.flags = htons(vol->flags & VOLFRAGMENTFLAGS); - v.sequence = htons(vol->seq); + v.nBytes = htonl(vol->nBytes); + v.flags = htons(vol->flags & VOLFRAGMENTFLAGS); + v.sequence = htons(vol->seq); - eval = dbwrite(ut, va, &v, sizeof(v)); /* write out the vol frag struct */ - if (eval) ABORT(eval); + eval = dbwrite(ut, va, &v, sizeof(v)); /* write out the vol frag struct */ + if (eval) + ABORT(eval); eval = set_header_word(ut, lastUpdate, htonl(time(0))); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); LogDebug(4, "added volume %s at %d\n", vol->name, va); @@ -1150,129 +1233,141 @@ afs_int32 AddVolume (call, vol) } -afs_int32 BUDB_AddVolumes (call, vols) - struct rx_call *call; - struct budb_volumeList *vols; +afs_int32 +SBUDB_AddVolumes(call, vols) + struct rx_call *call; + struct budb_volumeList *vols; { - afs_int32 code; + afs_int32 code; - code = AddVolumes (call, vols); - osi_auditU (call, BUDB_AddVolEvent, code, AUD_LONG, 0, AUD_END); - return code; + code = AddVolumes(call, vols); + osi_auditU(call, BUDB_AddVolEvent, code, AUD_LONG, 0, AUD_END); + return code; } -afs_int32 AddVolumes (call, vols) - struct rx_call *call; - struct budb_volumeList *vols; -{ +afs_int32 +AddVolumes(call, vols) + struct rx_call *call; + struct budb_volumeList *vols; +{ struct budb_volumeEntry *vol, *vol1; - struct ubik_trans *ut; - dbadr da, ta, via, va; - struct dump d; - struct tape t; - struct volInfo vi; + struct ubik_trans *ut; + dbadr da, ta, via, va; + struct dump d; + struct tape t; + struct volInfo vi; struct volFragment v; - afs_uint32 bytes; - afs_int32 eval, e, code = 0; + afs_uint32 bytes; + afs_int32 eval, e, code = 0; - if ( !callPermitted(call) ) - return BUDB_NOTPERMITTED; + if (!callPermitted(call)) + return BUDB_NOTPERMITTED; + + if (!vols || (vols->budb_volumeList_len <= 0) + || !vols->budb_volumeList_val) + return BUDB_BADARGUMENT; - if (!vols || (vols->budb_volumeList_len <= 0) || !vols->budb_volumeList_val) - return BUDB_BADARGUMENT; - /* The first volume in the list of volumes to add */ vol1 = (struct budb_volumeEntry *)vols->budb_volumeList_val; - eval = InitRPC (&ut, LOCKWRITE, 1); - if (eval) return eval; + eval = InitRPC(&ut, LOCKWRITE, 1); + if (eval) + return eval; /* Find the dump in dumpid hash table */ - eval = ht_LookupEntry (ut, &db.dumpIden, &vol1->dump, &da, &d); - if (eval) ABORT(eval); - if (!da) ABORT(BUDB_NODUMPID); + eval = ht_LookupEntry(ut, &db.dumpIden, &vol1->dump, &da, &d); + if (eval) + ABORT(eval); + if (!da) + ABORT(BUDB_NODUMPID); /* search for the right tape in the dump */ - for (ta=ntohl(d.firstTape); ta; ta=ntohl(t.nextTape)) { - /* read the tape entry */ - eval = dbread(ut, ta, &t, sizeof(t)); - if (eval) ABORT(eval); - - /* Check if the right tape name */ - if ( strcmp(t.name, vol1->tape) == 0 ) - break; + for (ta = ntohl(d.firstTape); ta; ta = ntohl(t.nextTape)) { + /* read the tape entry */ + eval = dbread(ut, ta, &t, sizeof(t)); + if (eval) + ABORT(eval); + + /* Check if the right tape name */ + if (strcmp(t.name, vol1->tape) == 0) + break; } - if (!ta) ABORT(BUDB_NOTAPENAME); - - if ( (t.dump != htonl(da)) || /* tape must belong to dump */ - ((ntohl(t.flags) & BUDB_TAPE_BEINGWRITTEN) == 0) || /* tape must be being written */ - ((ntohl(d.flags) & BUDB_DUMP_INPROGRESS) == 0) ) /* dump must be in progress */ - ABORT(BUDB_BADPROTOCOL); - - for (vol=vol1, e=0; e < vols->budb_volumeList_len; vol++, e++) { - /*v*/ - if ( ( strlen(vol->name) >= sizeof(vi.name) ) || - ( strcmp(vol->name, "") == 0 ) || /* no null volnames */ - ( strlen(vol->server) >= sizeof(vi.server) ) || - ( strlen(vol->tape) >= sizeof(t.name) ) || - ( strcmp(vol->tape, vol1->tape) != 0 ) ) { - Log("Volume '%s' %u, tape '%s', dumpID %u is an invalid entry - not added\n", - vol->name, vol->id, vol->tape, vol->dump); - continue; - } - - /* find or create a volume info structure */ - eval = GetVolInfo(ut, vol, &via, &vi); - if (eval) ABORT(eval); - if (*(afs_int32 *)(&vi) == 0) { - Log("Volume '%s', tape '%s', dumpID %u is an invalid entry - aborted\n", - vol->name, vol->tape, vol->dump); - ABORT(BUDB_BADARGUMENT); - } - - /* Create a volume fragment */ - eval = AllocStructure (ut, volFragment_BLOCK, 0, &va, &v); - if (eval) ABORT(eval); - - v.vol = htonl(via); /* vol frag points to vol info */ - v.sameNameChain = vi.firstFragment; /* vol frag is chained to vol info */ - vi.firstFragment = htonl(va); - vi.nFrags = htonl(ntohl(vi.nFrags)+1); - eval = dbwrite(ut, via, &vi, sizeof(vi)); /* write the vol info struct */ - if (eval) ABORT(eval); - - v.tape = htonl(ta); /* vol frag points to tape */ - v.sameTapeChain = t.firstVol; /* vol frag is chained to tape info */ - t.firstVol = htonl(va); - t.nVolumes = htonl(ntohl(t.nVolumes) + 1); - bytes = ntohl(t.nBytes) + vol->nBytes; /* update bytes on tape */ - t.nMBytes = htonl(ntohl(t.nMBytes) + bytes/(1024*1024)); - t.nBytes = htonl(bytes % (1024*1024)); - - d.nVolumes = htonl(ntohl(d.nVolumes) + 1); /* one more volume on dump */ - - v.position = htonl(vol->position); /* vol frag info */ - v.clone = htonl(vol->clone); - v.incTime = htonl(vol->incTime); - v.startByte = htonl(vol->startByte); - v.nBytes = htonl(vol->nBytes); - v.flags = htons(vol->flags & VOLFRAGMENTFLAGS); - v.sequence = htons(vol->seq); - - eval = dbwrite(ut, va, &v, sizeof(v)); /* write out the vol frag struct */ - if (eval) ABORT(eval); - - LogDebug(4, "added volume %s at %d\n", vol->name, va); - } /*v*/ - - eval = dbwrite(ut, ta, &t, sizeof(t)); /* write the tape structure */ - if (eval) ABORT(eval); - - eval = dbwrite(ut, da, &d, sizeof(d)); /* write out the dump structure */ - if (eval) ABORT(eval); + if (!ta) + ABORT(BUDB_NOTAPENAME); + + if ((t.dump != htonl(da)) || /* tape must belong to dump */ + ((ntohl(t.flags) & BUDB_TAPE_BEINGWRITTEN) == 0) || /* tape must be being written */ + ((ntohl(d.flags) & BUDB_DUMP_INPROGRESS) == 0)) /* dump must be in progress */ + ABORT(BUDB_BADPROTOCOL); + + for (vol = vol1, e = 0; e < vols->budb_volumeList_len; vol++, e++) { + /*v */ + if ((strlen(vol->name) >= sizeof(vi.name)) || (strcmp(vol->name, "") == 0) || /* no null volnames */ + (strlen(vol->server) >= sizeof(vi.server)) + || (strlen(vol->tape) >= sizeof(t.name)) + || (strcmp(vol->tape, vol1->tape) != 0)) { + Log("Volume '%s' %u, tape '%s', dumpID %u is an invalid entry - not added\n", vol->name, vol->id, vol->tape, vol->dump); + continue; + } + + /* find or create a volume info structure */ + eval = GetVolInfo(ut, vol, &via, &vi); + if (eval) + ABORT(eval); + if (*(afs_int32 *) (&vi) == 0) { + Log("Volume '%s', tape '%s', dumpID %u is an invalid entry - aborted\n", vol->name, vol->tape, vol->dump); + ABORT(BUDB_BADARGUMENT); + } + + /* Create a volume fragment */ + eval = AllocStructure(ut, volFragment_BLOCK, 0, &va, &v); + if (eval) + ABORT(eval); + + v.vol = htonl(via); /* vol frag points to vol info */ + v.sameNameChain = vi.firstFragment; /* vol frag is chained to vol info */ + vi.firstFragment = htonl(va); + vi.nFrags = htonl(ntohl(vi.nFrags) + 1); + eval = dbwrite(ut, via, &vi, sizeof(vi)); /* write the vol info struct */ + if (eval) + ABORT(eval); + + v.tape = htonl(ta); /* vol frag points to tape */ + v.sameTapeChain = t.firstVol; /* vol frag is chained to tape info */ + t.firstVol = htonl(va); + t.nVolumes = htonl(ntohl(t.nVolumes) + 1); + bytes = ntohl(t.nBytes) + vol->nBytes; /* update bytes on tape */ + t.nMBytes = htonl(ntohl(t.nMBytes) + bytes / (1024 * 1024)); + t.nBytes = htonl(bytes % (1024 * 1024)); + + d.nVolumes = htonl(ntohl(d.nVolumes) + 1); /* one more volume on dump */ + + v.position = htonl(vol->position); /* vol frag info */ + v.clone = htonl(vol->clone); + v.incTime = htonl(vol->incTime); + v.startByte = htonl(vol->startByte); + v.nBytes = htonl(vol->nBytes); + v.flags = htons(vol->flags & VOLFRAGMENTFLAGS); + v.sequence = htons(vol->seq); + + eval = dbwrite(ut, va, &v, sizeof(v)); /* write out the vol frag struct */ + if (eval) + ABORT(eval); + + LogDebug(4, "added volume %s at %d\n", vol->name, va); + } /*v */ + + eval = dbwrite(ut, ta, &t, sizeof(t)); /* write the tape structure */ + if (eval) + ABORT(eval); + + eval = dbwrite(ut, da, &d, sizeof(d)); /* write out the dump structure */ + if (eval) + ABORT(eval); eval = set_header_word(ut, lastUpdate, htonl(time(0))); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); code = ubik_EndTrans(ut); return code; @@ -1290,122 +1385,131 @@ afs_int32 AddVolumes (call, vols) * 1) record the volume set */ -afs_int32 BUDB_CreateDump(call, dump) +afs_int32 +SBUDB_CreateDump(call, dump) struct rx_call *call; struct budb_dumpEntry *dump; { - afs_int32 code; + afs_int32 code; - code = CreateDump(call, dump); - osi_auditU (call, BUDB_CrDmpEvent, code, AUD_DATE, (dump ? dump->id : 0), AUD_END); - if (dump && !code) { - Log("Create dump %s (DumpID %u), path %s\n", - dump->name, dump->id, dump->dumpPath); - } - return code; + code = CreateDump(call, dump); + osi_auditU(call, BUDB_CrDmpEvent, code, AUD_DATE, (dump ? dump->id : 0), + AUD_END); + if (dump && !code) { + Log("Create dump %s (DumpID %u), path %s\n", dump->name, dump->id, + dump->dumpPath); + } + return code; } -afs_int32 CreateDump(call, dump) +afs_int32 +CreateDump(call, dump) struct rx_call *call; struct budb_dumpEntry *dump; -{ +{ struct ubik_trans *ut; - dbadr findDumpAddr, da; - struct dump findDump, d; - afs_int32 eval, code = 0; + dbadr findDumpAddr, da; + struct dump findDump, d; + afs_int32 eval, code = 0; - rxkad_level level; - afs_int32 kvno; - Date expiration; /* checked by Security Module */ + rxkad_level level; + afs_int32 kvno; + Date expiration; /* checked by Security Module */ struct ktc_principal principal; - if ( !callPermitted(call) ) + if (!callPermitted(call)) return BUDB_NOTPERMITTED; if (strlen(dump->name) >= sizeof(d.dumpName)) - return BUDB_BADARGUMENT; + return BUDB_BADARGUMENT; - eval = InitRPC (&ut, LOCKWRITE, 1); - if (eval) return eval; + eval = InitRPC(&ut, LOCKWRITE, 1); + if (eval) + return eval; - eval = rxkad_GetServerInfo( rx_ConnectionOf(call), - &level, &expiration, - principal.name, - principal.instance, - principal.cell, - &kvno ); + eval = + rxkad_GetServerInfo(rx_ConnectionOf(call), &level, &expiration, + principal.name, principal.instance, + principal.cell, &kvno); - if (eval) - { - if (eval != RXKADNOAUTH) ABORT(eval); + if (eval) { + if (eval != RXKADNOAUTH) + ABORT(eval); - strcpy(principal.name, ""); + strcpy(principal.name, ""); strcpy(principal.instance, ""); - strcpy(principal.cell, ""); + strcpy(principal.cell, ""); expiration = 0; - } - else - { + } else { /* authenticated. Take user supplied principal information */ - if ( strcmp(dump->dumper.name, "") != 0 ) - strncpy(principal.name, dump->dumper.name, sizeof(principal.name)); + if (strcmp(dump->dumper.name, "") != 0) + strncpy(principal.name, dump->dumper.name, + sizeof(principal.name)); - if ( strcmp(dump->dumper.instance, "") != 0 ) - strncpy(principal.instance, dump->dumper.instance, sizeof(principal.instance)); + if (strcmp(dump->dumper.instance, "") != 0) + strncpy(principal.instance, dump->dumper.instance, + sizeof(principal.instance)); - if ( strcmp(dump->dumper.cell, "") != 0 ) - strncpy(principal.cell, dump->dumper.cell, sizeof(principal.cell)); + if (strcmp(dump->dumper.cell, "") != 0) + strncpy(principal.cell, dump->dumper.cell, + sizeof(principal.cell)); } /* dump id's are time stamps */ - if (!dump->id) - { - while (1) /* allocate a unique dump id */ - { /*w*/ + if (!dump->id) { + while (1) { /* allocate a unique dump id *//*w */ dump->id = time(0); /* ensure it is unique - seach for dumpid in hash table */ - eval = ht_LookupEntry(ut, &db.dumpIden, &dump->id, &findDumpAddr, &findDump); - if (eval) ABORT(eval); + eval = + ht_LookupEntry(ut, &db.dumpIden, &dump->id, &findDumpAddr, + &findDump); + if (eval) + ABORT(eval); - if (!findDumpAddr) /* dumpid not in use */ - { + if (!findDumpAddr) { /* dumpid not in use */ /* update the last dump id allocated */ eval = set_header_word(ut, lastDumpId, htonl(dump->id)); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); break; } /* dump id is in use - wait a while */ IOMGR_Sleep(1); - } /*w*/ - } - else - { + } /*w */ + } else { /* dump id supplied (e.g. for database restore) */ - eval = ht_LookupEntry(ut, &db.dumpIden, &dump->id, &findDumpAddr, &findDump); - if (eval) ABORT(eval); - + eval = + ht_LookupEntry(ut, &db.dumpIden, &dump->id, &findDumpAddr, + &findDump); + if (eval) + ABORT(eval); + /* Dump id must not already exist */ - if (findDumpAddr) ABORT(BUDB_DUMPIDEXISTS); + if (findDumpAddr) + ABORT(BUDB_DUMPIDEXISTS); } - + /* Allocate a dump structure */ memset(&d, 0, sizeof(d)); - eval = AllocStructure (ut, dump_BLOCK, 0, &da, &d); - if (eval) ABORT(eval); + eval = AllocStructure(ut, dump_BLOCK, 0, &da, &d); + if (eval) + ABORT(eval); - strcpy(d.dumpName, dump->name); /* volset.dumpname */ - strcpy(d.dumpPath, dump->dumpPath); /* dump node path */ + strcpy(d.dumpName, dump->name); /* volset.dumpname */ + strcpy(d.dumpPath, dump->dumpPath); /* dump node path */ strcpy(d.volumeSet, dump->volumeSetName); /* volume set */ - d.id = htonl(dump->id); - d.parent = htonl(dump->parent); /* parent id */ - d.level = htonl(dump->level); + d.id = htonl(dump->id); + d.parent = htonl(dump->parent); /* parent id */ + d.level = htonl(dump->level); - LogDebug(4, "dump name %s, parent %d level %d\n", dump->name, dump->parent, dump->level); + LogDebug(4, "dump name %s, parent %d level %d\n", dump->name, + dump->parent, dump->level); /* if creation time specified, use that. Else use the dumpid time */ - if (dump->created == 0) dump->created = dump->id; + if (dump->created == 0) + dump->created = dump->id; d.created = htonl(dump->created); principal_hton(&principal, &d.dumper); @@ -1413,21 +1517,26 @@ afs_int32 CreateDump(call, dump) d.flags = htonl(dump->flags | BUDB_DUMP_INPROGRESS); - eval = ht_HashIn (ut, &db.dumpName, da, &d); /* Into dump name hash table */ - if (eval) ABORT(eval); + eval = ht_HashIn(ut, &db.dumpName, da, &d); /* Into dump name hash table */ + if (eval) + ABORT(eval); - eval = ht_HashIn (ut, &db.dumpIden, da, &d); /* Into dumpid hash table */ - if (eval) ABORT(eval); + eval = ht_HashIn(ut, &db.dumpIden, da, &d); /* Into dumpid hash table */ + if (eval) + ABORT(eval); - eval = dbwrite (ut, da, (char *)&d, sizeof(d)); /* Write the dump structure */ - if (eval) ABORT(eval); + eval = dbwrite(ut, da, (char *)&d, sizeof(d)); /* Write the dump structure */ + if (eval) + ABORT(eval); - eval = set_header_word (ut, lastUpdate, htonl(time(0))); - if (eval) ABORT(eval); + eval = set_header_word(ut, lastUpdate, htonl(time(0))); + if (eval) + ABORT(eval); /* If to append this dump, then append it - will write the appended dump */ eval = makeAppended(ut, dump->id, dump->initialDumpID, dump->tapes.b); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); code = ubik_EndTrans(ut); LogDebug(5, "made dump %s, path %s\n", d.dumpName, d.dumpPath); @@ -1438,194 +1547,236 @@ afs_int32 CreateDump(call, dump) return code; } -afs_int32 BUDB_DeleteDump (call, id, fromTime, toTime, dumps) +afs_int32 +SBUDB_DeleteDump(call, id, fromTime, toTime, dumps) struct rx_call *call; dumpId id; - Date fromTime; - Date toTime; + Date fromTime; + Date toTime; budb_dumpsList *dumps; { - afs_int32 code; + afs_int32 code; - code = DoDeleteDump (call, id, fromTime, toTime, dumps); - osi_auditU (call, BUDB_DelDmpEvent, code, AUD_DATE, id, AUD_END); - return code; + code = DoDeleteDump(call, id, fromTime, toTime, dumps); + osi_auditU(call, BUDB_DelDmpEvent, code, AUD_DATE, id, AUD_END); + return code; } #define MAXOFFS 30 -afs_int32 DoDeleteDump (call, id, fromTime, toTime, dumps) - struct rx_call *call; - dumpId id; - Date fromTime; - Date toTime; - budb_dumpsList *dumps; +afs_int32 +DoDeleteDump(call, id, fromTime, toTime, dumps) + struct rx_call *call; + dumpId id; + Date fromTime; + Date toTime; + budb_dumpsList *dumps; { - afs_int32 code = 0; + afs_int32 code = 0; - if ( !callPermitted(call) ) + if (!callPermitted(call)) return BUDB_NOTPERMITTED; - if (id) code = deleteDump(call, id, dumps); - return(code); + if (id) + code = deleteDump(call, id, dumps); + return (code); } -afs_int32 BUDB_ListDumps (call, sflags, name, groupid, fromTime, toTime, dumps, flags) - struct rx_call *call; - afs_int32 sflags, groupid; - char *name; - Date fromTime, toTime; - budb_dumpsList *dumps, *flags; +afs_int32 +SBUDB_ListDumps(call, sflags, name, groupid, fromTime, toTime, dumps, flags) + struct rx_call *call; + afs_int32 sflags, groupid; + char *name; + Date fromTime, toTime; + budb_dumpsList *dumps, *flags; { - afs_int32 code; + afs_int32 code; - code = ListDumps(call, sflags, groupid, fromTime, toTime, dumps, flags); - osi_auditU (call, BUDB_LstDmpEvent, code, AUD_LONG, flags, AUD_END); - return code; + code = ListDumps(call, sflags, groupid, fromTime, toTime, dumps, flags); + osi_auditU(call, BUDB_LstDmpEvent, code, AUD_LONG, flags, AUD_END); + return code; } -afs_int32 ListDumps (call, sflags, groupid, fromTime, toTime, dumps, flags) - struct rx_call *call; - afs_int32 sflags, groupid; - Date fromTime, toTime; - budb_dumpsList *dumps, *flags; +afs_int32 +ListDumps(call, sflags, groupid, fromTime, toTime, dumps, flags) + struct rx_call *call; + afs_int32 sflags, groupid; + Date fromTime, toTime; + budb_dumpsList *dumps, *flags; { - struct ubik_trans *ut; + struct ubik_trans *ut; struct memoryHashTable *mht; - struct dump diskDump, appDiskDump; - dbadr dbAddr, dbAppAddr; + struct dump diskDump, appDiskDump; + dbadr dbAddr, dbAppAddr; - afs_int32 eval, code = 0; - int old, hash, length, entrySize, j, k, count=0; - afs_uint32 toList, toFlag; + afs_int32 eval, code = 0; + int old, hash, length, entrySize, count = 0; - if ( !callPermitted(call) ) + if (!callPermitted(call)) return BUDB_NOTPERMITTED; - eval= InitRPC (&ut, LOCKREAD, 1); - if (eval) return(eval); + eval = InitRPC(&ut, LOCKREAD, 1); + if (eval) + return (eval); /* Search the database */ mht = ht_GetType(HT_dumpIden_FUNCTION, &entrySize); - if (!mht) return(BUDB_BADARGUMENT); - - for (old=0; old<=1; old++) { /*o*/ /* old and new hash tables */ - length = (old ? mht->oldLength : mht->length); - if (length == 0) continue; - - for (hash=0; hash toTime)) - break; /*nope*/ + if (!mht) + return (BUDB_BADARGUMENT); + + for (old = 0; old <= 1; old++) { /*o *//* old and new hash tables */ + length = (old ? mht->oldLength : mht->length); + if (length == 0) + continue; + + for (hash = 0; hash < length; hash++) { /*h *//* for each hash bucket */ + for (dbAddr = ht_LookupBucket(ut, mht, hash, old); dbAddr; dbAddr = ntohl(diskDump.idHashChain)) { /*d */ + + /* read the entry */ + eval = dbread(ut, dbAddr, &diskDump, sizeof(diskDump)); + if (eval) + ABORT(eval); + + /* Skip appended dumps */ + if (ntohl(diskDump.initialDumpID) != 0) { + continue; } - if (dbAppAddr) continue; /*nope*/ - } - - /* Add it and each of its appended dump to our list to return */ - for (dbAppAddr=dbAddr; dbAppAddr; dbAppAddr=ntohl(appDiskDump.appendedDumpChain)) { - eval = dbread (ut, dbAppAddr, &appDiskDump, sizeof(appDiskDump)); - if (eval) ABORT(eval); - - /* Make sure we have space to list it */ - if (dumps->budb_dumpsList_len >= count) { - count += 10; - if (count == 10) { - dumps->budb_dumpsList_val = (afs_int32 *)malloc(count * sizeof(afs_int32)); - flags->budb_dumpsList_val = (afs_int32 *)malloc(count * sizeof(afs_int32)); - } else { - dumps->budb_dumpsList_val = - (afs_int32 *)realloc(dumps->budb_dumpsList_val, count*sizeof(afs_int32)); - flags->budb_dumpsList_val = - (afs_int32 *)realloc(flags->budb_dumpsList_val, count*sizeof(afs_int32)); - } - if (!dumps->budb_dumpsList_val || !dumps->budb_dumpsList_val) - ABORT(BUDB_NOMEM); + + /* Skip dumps with different goup id */ + if ((sflags & BUDB_OP_GROUPID) + && (ntohl(diskDump.tapes.id) != groupid)) { + continue; /*nope */ } - /* Add it to our list */ - dumps->budb_dumpsList_val[dumps->budb_dumpsList_len] = ntohl(appDiskDump.id); - flags->budb_dumpsList_val[flags->budb_dumpsList_len] = 0; - if ( ntohl(appDiskDump.initialDumpID) != 0 ) { - flags->budb_dumpsList_val[flags->budb_dumpsList_len] |= BUDB_OP_APPDUMP; + /* Look at this dump to see if it meets the criteria for listing */ + if (sflags & BUDB_OP_DATES) { + /* This and each appended dump should be in time */ + for (dbAppAddr = dbAddr; dbAppAddr; + dbAppAddr = ntohl(appDiskDump.appendedDumpChain)) { + eval = + dbread(ut, dbAppAddr, &appDiskDump, + sizeof(appDiskDump)); + if (eval) + ABORT(eval); + + if ((ntohl(appDiskDump.id) < fromTime) + || (ntohl(appDiskDump.id) > toTime)) + break; /*nope */ + } + if (dbAppAddr) + continue; /*nope */ } - if (strcmp(appDiskDump.dumpName,DUMP_TAPE_NAME) == 0) { - flags->budb_dumpsList_val[flags->budb_dumpsList_len] |= BUDB_OP_DBDUMP; + + /* Add it and each of its appended dump to our list to return */ + for (dbAppAddr = dbAddr; dbAppAddr; + dbAppAddr = ntohl(appDiskDump.appendedDumpChain)) { + eval = + dbread(ut, dbAppAddr, &appDiskDump, + sizeof(appDiskDump)); + if (eval) + ABORT(eval); + + /* Make sure we have space to list it */ + if (dumps->budb_dumpsList_len >= count) { + count += 10; + if (count == 10) { + dumps->budb_dumpsList_val = + (afs_int32 *) malloc(count * + sizeof(afs_int32)); + flags->budb_dumpsList_val = + (afs_int32 *) malloc(count * + sizeof(afs_int32)); + } else { + dumps->budb_dumpsList_val = + (afs_int32 *) realloc(dumps-> + budb_dumpsList_val, + count * + sizeof(afs_int32)); + flags->budb_dumpsList_val = + (afs_int32 *) realloc(flags-> + budb_dumpsList_val, + count * + sizeof(afs_int32)); + } + if (!dumps->budb_dumpsList_val + || !dumps->budb_dumpsList_val) + ABORT(BUDB_NOMEM); + } + + /* Add it to our list */ + dumps->budb_dumpsList_val[dumps->budb_dumpsList_len] = + ntohl(appDiskDump.id); + flags->budb_dumpsList_val[flags->budb_dumpsList_len] = 0; + if (ntohl(appDiskDump.initialDumpID) != 0) { + flags->budb_dumpsList_val[flags-> + budb_dumpsList_len] |= + BUDB_OP_APPDUMP; + } + if (strcmp(appDiskDump.dumpName, DUMP_TAPE_NAME) == 0) { + flags->budb_dumpsList_val[flags-> + budb_dumpsList_len] |= + BUDB_OP_DBDUMP; + } + dumps->budb_dumpsList_len++; + flags->budb_dumpsList_len++; } - dumps->budb_dumpsList_len++; - flags->budb_dumpsList_len++; - } - } /*d*/ - } /*h*/ - } /*o*/ - + } /*d */ + } /*h */ + } /*o */ + code = ubik_EndTrans(ut); - return(code); + return (code); abort_exit: ubik_AbortTrans(ut); - return(code); + return (code); } -afs_int32 BUDB_DeleteTape (call, tape) - struct rx_call *call; - struct budb_tapeEntry *tape; /* tape info */ +afs_int32 +SBUDB_DeleteTape(call, tape) + struct rx_call *call; + struct budb_tapeEntry *tape; /* tape info */ { - afs_int32 code; + afs_int32 code; - code = DoDeleteTape (call, tape); - osi_auditU (call, BUDB_DelTpeEvent, code, AUD_DATE, (tape ? tape->dump : 0), AUD_END); - return code; + code = DoDeleteTape(call, tape); + osi_auditU(call, BUDB_DelTpeEvent, code, AUD_DATE, + (tape ? tape->dump : 0), AUD_END); + return code; } -afs_int32 DoDeleteTape (call, tape) - struct rx_call *call; - struct budb_tapeEntry *tape; /* tape info */ +afs_int32 +DoDeleteTape(call, tape) + struct rx_call *call; + struct budb_tapeEntry *tape; /* tape info */ { struct ubik_trans *ut; - struct tape t; - dbadr a; - afs_int32 eval, code; + struct tape t; + dbadr a; + afs_int32 eval, code; - if ( !callPermitted(call) ) + if (!callPermitted(call)) return BUDB_NOTPERMITTED; - eval = InitRPC (&ut, LOCKWRITE, 1); - if (eval) return eval; + eval = InitRPC(&ut, LOCKWRITE, 1); + if (eval) + return eval; - eval = ht_LookupEntry (ut, &db.tapeName, tape->name, &a, &t); - if (eval) ABORT(eval); + eval = ht_LookupEntry(ut, &db.tapeName, tape->name, &a, &t); + if (eval) + ABORT(eval); - eval = DeleteTape (ut, a, &t); - if (eval) ABORT(eval); + eval = DeleteTape(ut, a, &t); + if (eval) + ABORT(eval); - eval = FreeStructure (ut, tape_BLOCK, a); - if (eval) ABORT(eval); + eval = FreeStructure(ut, tape_BLOCK, a); + if (eval) + ABORT(eval); - eval = set_header_word (ut, lastUpdate, htonl(time(0))); - if (eval) ABORT(eval); + eval = set_header_word(ut, lastUpdate, htonl(time(0))); + if (eval) + ABORT(eval); code = ubik_EndTrans(ut); return code; @@ -1649,20 +1800,22 @@ afs_int32 DoDeleteTape (call, tape) * n - some error. May or may not have deleted information. */ -afs_int32 BUDB_DeleteVDP (call, dsname, dumpPath, curDumpId) +afs_int32 +SBUDB_DeleteVDP(call, dsname, dumpPath, curDumpId) struct rx_call *call; char *dsname; char *dumpPath; afs_int32 curDumpId; { - afs_int32 code; + afs_int32 code; - code = DeleteVDP (call, dsname, dumpPath, curDumpId); - osi_auditU (call, BUDB_DelVDPEvent, code, AUD_STR, dsname, AUD_END); - return code; + code = DeleteVDP(call, dsname, dumpPath, curDumpId); + osi_auditU(call, BUDB_DelVDPEvent, code, AUD_STR, dsname, AUD_END); + return code; } -afs_int32 DeleteVDP (call, dsname, dumpPath, curDumpId) +afs_int32 +DeleteVDP(call, dsname, dumpPath, curDumpId) struct rx_call *call; char *dsname; char *dumpPath; @@ -1670,32 +1823,33 @@ afs_int32 DeleteVDP (call, dsname, dumpPath, curDumpId) { struct dump dump; dbadr dumpAddr; - + struct ubik_trans *ut; - afs_int32 eval, code = 0; + afs_int32 eval, code = 0; - if ( !callPermitted(call) ) + if (!callPermitted(call)) return BUDB_NOTPERMITTED; - while (1) - { - eval = InitRPC (&ut, LOCKREAD, 1); - if (eval) return(eval); + while (1) { + eval = InitRPC(&ut, LOCKREAD, 1); + if (eval) + return (eval); eval = ht_LookupEntry(ut, &db.dumpName, dsname, &dumpAddr, &dump); - if (eval) ABORT(eval); - - while ( dumpAddr != 0 ) - { /*wd*/ - if ( (strcmp(dump.dumpName, dsname) == 0) && - (strcmp(dump.dumpPath, dumpPath) == 0) && - (ntohl(dump.id) != curDumpId) ) - { + if (eval) + ABORT(eval); + + while (dumpAddr != 0) { /*wd */ + if ((strcmp(dump.dumpName, dsname) == 0) + && (strcmp(dump.dumpPath, dumpPath) == 0) + && (ntohl(dump.id) != curDumpId)) { eval = ubik_EndTrans(ut); - if (eval) return(eval); + if (eval) + return (eval); eval = deleteDump(call, ntohl(dump.id), 0); - if (eval) return(eval); + if (eval) + return (eval); /* start the traversal over since the various chains may * have changed @@ -1704,24 +1858,23 @@ afs_int32 DeleteVDP (call, dsname, dumpPath, curDumpId) } dumpAddr = ntohl(dump.nameHashChain); - if (dumpAddr) - { + if (dumpAddr) { eval = dbread(ut, dumpAddr, &dump, sizeof(dump)); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); } - } /*wd*/ + } /*wd */ /* check if all the dumps have been examined - can terminate */ - if (!dumpAddr) - { + if (!dumpAddr) { eval = ubik_EndTrans(ut); - return(eval); + return (eval); } } abort_exit: ubik_AbortTrans(ut); - return(code); + return (code); } /* BUDB_FindClone @@ -1735,92 +1888,97 @@ afs_int32 DeleteVDP (call, dsname, dumpPath, curDumpId) * volume is not found in the dump, then look for it in its parent dump. */ -afs_int32 BUDB_FindClone(call, dumpID, volName, clonetime) +afs_int32 +SBUDB_FindClone(call, dumpID, volName, clonetime) struct rx_call *call; afs_int32 dumpID; char *volName; afs_int32 *clonetime; { - afs_int32 code; + afs_int32 code; - code = FindClone (call, dumpID, volName, clonetime); - osi_auditU (call, BUDB_FndClnEvent, code, AUD_STR, volName, AUD_END); - return code; + code = FindClone(call, dumpID, volName, clonetime); + osi_auditU(call, BUDB_FndClnEvent, code, AUD_STR, volName, AUD_END); + return code; } -afs_int32 FindClone (call, dumpID, volName, clonetime) +afs_int32 +FindClone(call, dumpID, volName, clonetime) struct rx_call *call; afs_int32 dumpID; char *volName; afs_int32 *clonetime; { - struct ubik_trans *ut; - dbadr da, ta, hvia, via, vfa; - struct dump d; - struct tape t; + struct ubik_trans *ut; + dbadr da, hvia, via, vfa; + struct dump d; + struct tape t; struct volFragment vf; - struct volInfo vi; - int rvi; /* read the volInfo struct */ - afs_int32 eval, code = 0; + struct volInfo vi; + int rvi; /* read the volInfo struct */ + afs_int32 eval, code = 0; - if ( !callPermitted(call) ) - return BUDB_NOTPERMITTED; + if (!callPermitted(call)) + return BUDB_NOTPERMITTED; - eval = InitRPC (&ut, LOCKREAD, 1); - if (eval) return(eval); + eval = InitRPC(&ut, LOCKREAD, 1); + if (eval) + return (eval); *clonetime = 0; /* Search for the volume by name */ - eval = ht_LookupEntry (ut, &db.volName, volName, &hvia, &vi); - if (eval) ABORT(eval); - if (!hvia) ABORT(BUDB_NOVOLUMENAME); + eval = ht_LookupEntry(ut, &db.volName, volName, &hvia, &vi); + if (eval) + ABORT(eval); + if (!hvia) + ABORT(BUDB_NOVOLUMENAME); rvi = 0; /* Follw the dump levels up */ - for (; dumpID; dumpID = ntohl(d.parent)) - { /*d*/ + for (; dumpID; dumpID = ntohl(d.parent)) { /*d */ /* Get the dump entry */ - eval = ht_LookupEntry (ut, &db.dumpIden, &dumpID, &da, &d); - if (eval) ABORT(eval); - if (!da) ABORT(BUDB_NODUMPID); - + eval = ht_LookupEntry(ut, &db.dumpIden, &dumpID, &da, &d); + if (eval) + ABORT(eval); + if (!da) + ABORT(BUDB_NODUMPID); + /* seach all the volInfo entries on the sameNameChain */ - for (via=hvia; via; via=ntohl(vi.sameNameChain)) - { /*via*/ - if (rvi) /* Read the volInfo entry - except first time */ - { - eval = dbread(ut, via, &vi, sizeof(vi)); - if (eval) ABORT(eval); + for (via = hvia; via; via = ntohl(vi.sameNameChain)) { /*via */ + if (rvi) { /* Read the volInfo entry - except first time */ + eval = dbread(ut, via, &vi, sizeof(vi)); + if (eval) + ABORT(eval); } rvi = 1; /* search all the volFrag entries on the volFrag */ - for (vfa=ntohl(vi.firstFragment); vfa; vfa=ntohl(vf.sameNameChain)) - { /*vfa*/ - eval = dbread(ut, vfa, &vf, sizeof(vf)); /* Read the volFrag entry */ - if (eval) ABORT(eval); + for (vfa = ntohl(vi.firstFragment); vfa; vfa = ntohl(vf.sameNameChain)) { /*vfa */ + eval = dbread(ut, vfa, &vf, sizeof(vf)); /* Read the volFrag entry */ + if (eval) + ABORT(eval); - eval = dbread(ut, ntohl(vf.tape), &t, sizeof(t)); /* Read the tape */ - if (eval) ABORT(eval); + eval = dbread(ut, ntohl(vf.tape), &t, sizeof(t)); /* Read the tape */ + if (eval) + ABORT(eval); /* Now check to see if this fragment belongs to the dump we have */ - if (ntohl(t.dump) == da) - { - *clonetime = ntohl(vf.clone); /* return the clone */ + if (ntohl(t.dump) == da) { + *clonetime = ntohl(vf.clone); /* return the clone */ ERROR(0); } - } /*vfa*/ - } /*via*/ - } /*d*/ + } /*vfa */ + } /*via */ + } /*d */ error_exit: code = ubik_EndTrans(ut); - return(code); + return (code); abort_exit: ubik_EndTrans(ut); - return(code); + return (code); } #ifdef notdef @@ -1830,78 +1988,84 @@ afs_int32 FindClone (call, dumpID, volName, clonetime) * * Re-write to do lookups by volume name. */ -afs_int32 FindClone (call, dumpID, volName, clonetime) +afs_int32 +FindClone(call, dumpID, volName, clonetime) struct rx_call *call; afs_int32 dumpID; char *volName; afs_int32 *clonetime; { - struct ubik_trans *ut; - dbadr diskAddr, tapeAddr, volFragmentAddr; - struct dump dump; - struct tape tape; + struct ubik_trans *ut; + dbadr diskAddr, tapeAddr, volFragmentAddr; + struct dump dump; + struct tape tape; struct volFragment volFragment; - struct volInfo volInfo; - afs_int32 eval, code = 0; + struct volInfo volInfo; + afs_int32 eval, code = 0; - if ( !callPermitted(call) ) - return BUDB_NOTPERMITTED; + if (!callPermitted(call)) + return BUDB_NOTPERMITTED; - eval = InitRPC (&ut, LOCKREAD, 1); - if (eval) return(eval); + eval = InitRPC(&ut, LOCKREAD, 1); + if (eval) + return (eval); *clonetime = 0; - for (; dumpID; dumpID = ntohl(dump.parent)) - { /*d*/ + for (; dumpID; dumpID = ntohl(dump.parent)) { /*d */ /* Get the dump entry */ - eval = ht_LookupEntry (ut, &db.dumpIden, &dumpID, &diskAddr, &dump); - if (eval) ABORT(eval); - if (!diskAddr) ABORT(BUDB_NODUMPID); - + eval = ht_LookupEntry(ut, &db.dumpIden, &dumpID, &diskAddr, &dump); + if (eval) + ABORT(eval); + if (!diskAddr) + ABORT(BUDB_NODUMPID); + /* just to be sure */ - if (ntohl(dump.id) != dumpID) - { - LogDebug(4, "BUDB_FindClone: requested %d, found %d\n", dumpID, ntohl(dump.id)); + if (ntohl(dump.id) != dumpID) { + LogDebug(4, "BUDB_FindClone: requested %d, found %d\n", dumpID, + ntohl(dump.id)); ABORT(BUDB_INTERNALERROR); } - + /* search all the tapes in this dump */ - for (tapeAddr=ntohl(dump.firstTape); tapeAddr; tapeAddr=ntohl(tape.nextTape)) - { /*t*/ + for (tapeAddr = ntohl(dump.firstTape); tapeAddr; tapeAddr = ntohl(tape.nextTape)) { /*t */ /* Get the tape entry */ eval = dbread(ut, tapeAddr, &tape, sizeof(tape)); - if (eval) ABORT(eval); - + if (eval) + ABORT(eval); + /* search all the volume fragments on this tape */ - for (volFragmentAddr=ntohl(tape.firstVol); volFragmentAddr; - volFragmentAddr=ntohl(volFragment.sameTapeChain)) - { /*vf*/ + for (volFragmentAddr = ntohl(tape.firstVol); volFragmentAddr; volFragmentAddr = ntohl(volFragment.sameTapeChain)) { /*vf */ /* Get the volume fragment entry */ - eval = dbread(ut, volFragmentAddr, &volFragment, sizeof(volFragment)); - if (eval) ABORT(eval); + eval = + dbread(ut, volFragmentAddr, &volFragment, + sizeof(volFragment)); + if (eval) + ABORT(eval); /* Get the volume info entry */ - eval = dbread(ut, ntohl(volFragment.vol), &volInfo, sizeof(volInfo)); - if (eval) ABORT(eval); + eval = + dbread(ut, ntohl(volFragment.vol), &volInfo, + sizeof(volInfo)); + if (eval) + ABORT(eval); /* check if this volume is the one we want */ - if ( strcmp(volInfo.name,volName) == 0 ) - { + if (strcmp(volInfo.name, volName) == 0) { *clonetime = ntohl(volFragment.clone); ERROR(0); } - } /*vf*/ - } /*t*/ - } /*d*/ + } /*vf */ + } /*t */ + } /*d */ error_exit: code = ubik_EndTrans(ut); - return(code); + return (code); abort_exit: ubik_EndTrans(ut); - return(code); + return (code); } #endif @@ -1915,93 +2079,104 @@ afs_int32 FindClone (call, dumpID, volName, clonetime) * deptr - descriptor of most recent dump */ -afs_int32 BUDB_FindDump (call, volumeName, beforeDate, deptr) +afs_int32 +SBUDB_FindDump(call, volumeName, beforeDate, deptr) struct rx_call *call; char *volumeName; afs_int32 beforeDate; struct budb_dumpEntry *deptr; { - afs_int32 code; + afs_int32 code; - code = FindDump (call, volumeName, beforeDate, deptr); - osi_auditU (call, BUDB_FndDmpEvent, code, AUD_STR, volumeName, AUD_END); - return code; + code = FindDump(call, volumeName, beforeDate, deptr); + osi_auditU(call, BUDB_FndDmpEvent, code, AUD_STR, volumeName, AUD_END); + return code; } -afs_int32 FindDump (call, volumeName, beforeDate, deptr) +afs_int32 +FindDump(call, volumeName, beforeDate, deptr) struct rx_call *call; char *volumeName; afs_int32 beforeDate; struct budb_dumpEntry *deptr; { - struct ubik_trans *ut; - dbadr volInfoAddr, volFragmentAddr; - struct tape tape; - struct volInfo volInfo; + struct ubik_trans *ut; + dbadr volInfoAddr, volFragmentAddr; + struct tape tape; + struct volInfo volInfo; struct volFragment volFragment; dbadr selectedDumpAddr = 0; - afs_int32 selectedDate = 0; + afs_int32 selectedDate = 0; afs_int32 volCloned; - int rvoli; + int rvoli; afs_int32 eval, code = 0; - if ( !callPermitted(call) ) + if (!callPermitted(call)) return BUDB_NOTPERMITTED; - eval = InitRPC (&ut, LOCKREAD, 1); - if (eval) return eval; + eval = InitRPC(&ut, LOCKREAD, 1); + if (eval) + return eval; /* Find volinfo struct for volume name in hash table */ - eval = ht_LookupEntry (ut, &db.volName, volumeName, &volInfoAddr, &volInfo); - if (eval) ABORT(eval); - if (!volInfoAddr) ABORT(BUDB_NOVOLUMENAME); + eval = + ht_LookupEntry(ut, &db.volName, volumeName, &volInfoAddr, &volInfo); + if (eval) + ABORT(eval); + if (!volInfoAddr) + ABORT(BUDB_NOVOLUMENAME); /* Step through all the volinfo structures on the same name chain. * No need to read the first - we read it above. */ - for (rvoli=0; volInfoAddr; rvoli=1, volInfoAddr=ntohl(volInfo.sameNameChain)) - { - if (rvoli) /* read the volinfo structure */ - { + for (rvoli = 0; volInfoAddr; + rvoli = 1, volInfoAddr = ntohl(volInfo.sameNameChain)) { + if (rvoli) { /* read the volinfo structure */ eval = dbread(ut, volInfoAddr, &volInfo, sizeof(volInfo)); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); } - + /* step through the volfrag structures */ - for (volFragmentAddr=ntohl(volInfo.firstFragment); volFragmentAddr; - volFragmentAddr=ntohl(volFragment.sameNameChain)) - { + for (volFragmentAddr = ntohl(volInfo.firstFragment); volFragmentAddr; + volFragmentAddr = ntohl(volFragment.sameNameChain)) { /* read the volfrag struct */ - eval = dbread(ut, volFragmentAddr, &volFragment, sizeof(volFragment)); - if (eval) ABORT(eval); + eval = + dbread(ut, volFragmentAddr, &volFragment, + sizeof(volFragment)); + if (eval) + ABORT(eval); volCloned = ntohl(volFragment.clone); /* now we can examine the date for most recent dump */ - if ( (volCloned > selectedDate) && (volCloned < beforeDate) ) - { + if ((volCloned > selectedDate) && (volCloned < beforeDate)) { /* from the volfrag struct, read the tape struct */ - eval = dbread(ut, ntohl(volFragment.tape), &tape, sizeof(tape)); - if (eval) ABORT(eval); + eval = + dbread(ut, ntohl(volFragment.tape), &tape, sizeof(tape)); + if (eval) + ABORT(eval); - selectedDate = volCloned; + selectedDate = volCloned; selectedDumpAddr = ntohl(tape.dump); } } } - if (!selectedDumpAddr) ABORT(BUDB_NOENT); + if (!selectedDumpAddr) + ABORT(BUDB_NOENT); eval = FillDumpEntry(ut, selectedDumpAddr, deptr); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); code = ubik_EndTrans(ut); - return(code); + return (code); abort_exit: ubik_EndTrans(ut); - return(code); + return (code); } /* BUDB_FindLatestDump @@ -2011,183 +2186,196 @@ afs_int32 FindDump (call, volumeName, beforeDate, deptr) * dname - dumpname */ -afs_int32 BUDB_FindLatestDump (call, vsname, dumpPath, dumpentry) +afs_int32 +SBUDB_FindLatestDump(call, vsname, dumpPath, dumpentry) struct rx_call *call; - char *vsname, *dumpPath; - struct budb_dumpEntry *dumpentry; + char *vsname, *dumpPath; + struct budb_dumpEntry *dumpentry; { - afs_int32 code; + afs_int32 code; - code = FindLatestDump (call, vsname, dumpPath, dumpentry); - osi_auditU (call, BUDB_FndLaDEvent, code, AUD_STR, vsname, AUD_END); - return code; + code = FindLatestDump(call, vsname, dumpPath, dumpentry); + osi_auditU(call, BUDB_FndLaDEvent, code, AUD_STR, vsname, AUD_END); + return code; } -afs_int32 FindLatestDump (call, vsname, dumpPath, dumpentry) +afs_int32 +FindLatestDump(call, vsname, dumpPath, dumpentry) struct rx_call *call; - char *vsname, *dumpPath; - struct budb_dumpEntry *dumpentry; + char *vsname, *dumpPath; + struct budb_dumpEntry *dumpentry; { struct ubik_trans *ut; - dbadr curdbaddr, retdbaddr, firstdbaddr; - struct dump d; - Date latest; - char dumpName[BU_MAXNAMELEN+2]; - afs_int32 eval, code = 0; + dbadr curdbaddr, retdbaddr, firstdbaddr; + struct dump d; + Date latest; + char dumpName[BU_MAXNAMELEN + 2]; + afs_int32 eval, code = 0; - if ( !callPermitted(call) ) + if (!callPermitted(call)) return BUDB_NOTPERMITTED; eval = InitRPC(&ut, LOCKREAD, 1); - if (eval) return(eval); + if (eval) + return (eval); - if ( (strcmp(vsname,"") == 0) && (strcmp(dumpPath,"") == 0) ) - { - /* Construct a database dump name */ + if ((strcmp(vsname, "") == 0) && (strcmp(dumpPath, "") == 0)) { + /* Construct a database dump name */ strcpy(dumpName, DUMP_TAPE_NAME); - } - else if (strchr(dumpPath,'/') == 0) { - int level, old, length, hash; - struct dump hostDump, diskDump; + } else if (strchr(dumpPath, '/') == 0) { + int level, old, length, hash; + struct dump hostDump, diskDump; struct memoryHashTable *mht; - int entrySize; - dbadr dbAddr; - afs_uint32 bestDumpId=0; + int entrySize; + dbadr dbAddr; + afs_uint32 bestDumpId = 0; - level = atoi(dumpPath); + level = atoi(dumpPath); if (level < 0) { - ABORT(BUDB_BADARGUMENT); + ABORT(BUDB_BADARGUMENT); } - + /* Brute force search of all the dumps in the database - yuck! */ retdbaddr = 0; mht = ht_GetType(HT_dumpIden_FUNCTION, &entrySize); - if (!mht) ABORT(BUDB_BADARGUMENT); + if (!mht) + ABORT(BUDB_BADARGUMENT); - for (old=0; old <= 1; old++) { /*fo*/ + for (old = 0; old <= 1; old++) { /*fo */ length = (old ? mht->oldLength : mht->length); - if (!length) continue; - - for (hash=0; hash bestDumpId) ) { /* more recent */ + if ((strcmp(hostDump.volumeSet, vsname) == 0) && /* the volumeset */ + (hostDump.level == level) && /* same level */ + (hostDump.id > bestDumpId)) { /* more recent */ bestDumpId = hostDump.id; - retdbaddr = dbAddr; + retdbaddr = dbAddr; } - } /*w*/ - } /*f*/ - } /*fo*/ + } /*w */ + } /*f */ + } /*fo */ if (!retdbaddr) - ABORT(BUDB_NODUMPNAME); + ABORT(BUDB_NODUMPNAME); goto finished; - } - else - { - /* construct the name of the dump */ - if ( (strlen(vsname) + strlen(tailCompPtr(dumpPath))) > BU_MAXNAMELEN ) + } else { + /* construct the name of the dump */ + if ((strlen(vsname) + strlen(tailCompPtr(dumpPath))) > BU_MAXNAMELEN) ABORT(BUDB_NODUMPNAME); strcpy(dumpName, vsname); strcat(dumpName, "."); strcat(dumpName, tailCompPtr(dumpPath)); } - + LogDebug(5, "lookup on :%s:\n", dumpName); - + /* Lookup on dumpname in hash table */ eval = ht_LookupEntry(ut, &db.dumpName, dumpName, &firstdbaddr, &d); - if (eval) ABORT(eval); - - latest = 0; + if (eval) + ABORT(eval); + + latest = 0; retdbaddr = 0; /* folow remaining dumps in hash chain, looking for most latest dump */ - for (curdbaddr=firstdbaddr; curdbaddr; curdbaddr=ntohl(d.nameHashChain)) - { - if (curdbaddr != firstdbaddr) { - eval = dbread(ut, curdbaddr, &d, sizeof(d)); - if (eval) ABORT(eval); + for (curdbaddr = firstdbaddr; curdbaddr; + curdbaddr = ntohl(d.nameHashChain)) { + if (curdbaddr != firstdbaddr) { + eval = dbread(ut, curdbaddr, &d, sizeof(d)); + if (eval) + ABORT(eval); } - if ( (strcmp(d.dumpPath, dumpPath) == 0) && /* Same dumppath */ - (strcmp(d.dumpName, dumpName) == 0) && /* Same dumpname */ - (ntohl(d.created) > latest) ) /* most recent */ - { - latest = ntohl(d.created); + if ((strcmp(d.dumpPath, dumpPath) == 0) && /* Same dumppath */ + (strcmp(d.dumpName, dumpName) == 0) && /* Same dumpname */ + (ntohl(d.created) > latest)) { /* most recent */ + latest = ntohl(d.created); retdbaddr = curdbaddr; } } - if (!retdbaddr) ABORT(BUDB_NODUMPNAME); + if (!retdbaddr) + ABORT(BUDB_NODUMPNAME); finished: /* return the dump found */ FillDumpEntry(ut, retdbaddr, dumpentry); code = ubik_EndTrans(ut); - return(code); + return (code); abort_exit: ubik_AbortTrans(ut); - return(code); + return (code); } -afs_int32 BUDB_FinishDump (call, dump) - struct rx_call *call; - struct budb_dumpEntry *dump; +afs_int32 +SBUDB_FinishDump(call, dump) + struct rx_call *call; + struct budb_dumpEntry *dump; { - afs_int32 code; + afs_int32 code; - code = FinishDump (call, dump); - osi_auditU (call, BUDB_FinDmpEvent, code, AUD_DATE, (dump ? dump->id : 0), AUD_END); - return code; + code = FinishDump(call, dump); + osi_auditU(call, BUDB_FinDmpEvent, code, AUD_DATE, (dump ? dump->id : 0), + AUD_END); + return code; } -afs_int32 FinishDump (call, dump) - struct rx_call *call; - struct budb_dumpEntry *dump; +afs_int32 +FinishDump(call, dump) + struct rx_call *call; + struct budb_dumpEntry *dump; { struct ubik_trans *ut; - dbadr a; - struct dump d; - afs_int32 eval, code = 0; + dbadr a; + struct dump d; + afs_int32 eval, code = 0; - if ( !callPermitted(call) ) + if (!callPermitted(call)) return BUDB_NOTPERMITTED; eval = InitRPC(&ut, LOCKWRITE, 1); - if (eval) return eval; + if (eval) + return eval; - eval = ht_LookupEntry (ut, &db.dumpIden, &dump->id, &a, &d); - if (eval) ABORT(eval); - if (!a) ABORT(BUDB_NODUMPID); + eval = ht_LookupEntry(ut, &db.dumpIden, &dump->id, &a, &d); + if (eval) + ABORT(eval); + if (!a) + ABORT(BUDB_NODUMPID); if ((ntohl(d.flags) & BUDB_DUMP_INPROGRESS) == 0) - ABORT(BUDB_DUMPNOTINUSE); + ABORT(BUDB_DUMPNOTINUSE); d.flags = htonl(dump->flags & ~BUDB_DUMP_INPROGRESS); /* if creation time specified set it */ - if (dump->created) d.created = htonl(dump->created); + if (dump->created) + d.created = htonl(dump->created); dump->created = ntohl(d.created); /* Write the dump entry out */ eval = dbwrite(ut, a, &d, sizeof(d)); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); eval = set_header_word(ut, lastUpdate, htonl(time(0))); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); code = ubik_EndTrans(ut); return code; @@ -2197,68 +2385,79 @@ afs_int32 FinishDump (call, dump) return code; } -afs_int32 BUDB_FinishTape (call, tape) - struct rx_call *call; - struct budb_tapeEntry *tape; +afs_int32 +SBUDB_FinishTape(call, tape) + struct rx_call *call; + struct budb_tapeEntry *tape; { - afs_int32 code; + afs_int32 code; - code = FinishTape (call, tape); - osi_auditU (call, BUDB_FinTpeEvent, code, AUD_DATE, (tape ? tape->dump : 0), AUD_END); - return code; + code = FinishTape(call, tape); + osi_auditU(call, BUDB_FinTpeEvent, code, AUD_DATE, + (tape ? tape->dump : 0), AUD_END); + return code; } -afs_int32 FinishTape (call, tape) - struct rx_call *call; - struct budb_tapeEntry *tape; +afs_int32 +FinishTape(call, tape) + struct rx_call *call; + struct budb_tapeEntry *tape; { struct ubik_trans *ut; - dbadr a; - struct tape t; - struct dump d; - afs_int32 eval, code = 0; + dbadr a; + struct tape t; + struct dump d; + afs_int32 eval, code = 0; - if ( !callPermitted(call) ) + if (!callPermitted(call)) return BUDB_NOTPERMITTED; - eval = InitRPC (&ut, LOCKWRITE, 1); - if (eval) return eval; + eval = InitRPC(&ut, LOCKWRITE, 1); + if (eval) + return eval; /* find the tape struct in the tapename hash chain */ - eval = ht_LookupEntry (ut, &db.tapeName, tape->name, &a, &t); - if (eval) ABORT(eval); - if (!a) ABORT(BUDB_NOTAPENAME); + eval = ht_LookupEntry(ut, &db.tapeName, tape->name, &a, &t); + if (eval) + ABORT(eval); + if (!a) + ABORT(BUDB_NOTAPENAME); /* Read the dump structure */ - eval = dbread(ut, ntohl(t.dump), &d, sizeof(d)); - if (eval) ABORT(eval); + eval = dbread(ut, ntohl(t.dump), &d, sizeof(d)); + if (eval) + ABORT(eval); /* search for the right tape on the rest of the chain */ - while (ntohl(d.id) != tape->dump) - { + while (ntohl(d.id) != tape->dump) { a = ntohl(t.nameHashChain); - if (!a) ABORT(BUDB_NOTAPENAME); + if (!a) + ABORT(BUDB_NOTAPENAME); eval = dbread(ut, a, &t, sizeof(t)); - if (eval) ABORT(eval); - + if (eval) + ABORT(eval); + eval = dbread(ut, ntohl(t.dump), &d, sizeof(d)); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); } - if ( (ntohl(t.flags) & BUDB_TAPE_BEINGWRITTEN) == 0 ) - ABORT(BUDB_TAPENOTINUSE); + if ((ntohl(t.flags) & BUDB_TAPE_BEINGWRITTEN) == 0) + ABORT(BUDB_TAPENOTINUSE); /* t.nBytes = htonl(tape->nBytes); */ - t.nFiles = htonl(tape->nFiles); + t.nFiles = htonl(tape->nFiles); t.useKBytes = htonl(tape->useKBytes); - t.flags = htonl(tape->flags & ~BUDB_TAPE_BEINGWRITTEN); + t.flags = htonl(tape->flags & ~BUDB_TAPE_BEINGWRITTEN); eval = dbwrite(ut, a, &t, sizeof(t)); - if (eval) ABORT(BUDB_IO); + if (eval) + ABORT(BUDB_IO); - eval = set_header_word (ut, lastUpdate, htonl(time(0))); - if (eval) ABORT(eval); + eval = set_header_word(ut, lastUpdate, htonl(time(0))); + if (eval) + ABORT(eval); code = ubik_EndTrans(ut); return code; @@ -2267,7 +2466,7 @@ afs_int32 FinishTape (call, tape) ubik_AbortTrans(ut); return code; } - + /* BUDB_GetDumps * return a set of dumps that match the specified criteria * entry: @@ -2293,102 +2492,110 @@ afs_int32 FinishTape (call, tape) * BUDB_OP_DUMPID */ -afs_int32 BUDB_GetDumps (call, majorVersion, flags, name, start, end, - index, nextIndexP, dbTimeP, dumps) - struct rx_call *call; - int majorVersion; /* version of interface structures */ - afs_int32 flags; /* search & select controls */ - char *name; /* s&s parameters */ - afs_int32 start; - afs_int32 end; - afs_int32 index; /* start index of returned entries */ - afs_int32 *nextIndexP; /* output index for next call */ - afs_int32 *dbTimeP; - budb_dumpList *dumps; /* pointer to buffer */ -{ - afs_int32 code; - - code = GetDumps (call, majorVersion, flags, name, start, end, - index, nextIndexP, dbTimeP, dumps); - osi_auditU (call, BUDB_GetDmpEvent, code, AUD_END); - return code; -} - -afs_int32 GetDumps (call, majorVersion, flags, name, start, end, - index, nextIndexP, dbTimeP, dumps) - struct rx_call *call; - int majorVersion; /* version of interface structures */ - afs_int32 flags; /* search & select controls */ - char *name; /* s&s parameters */ - afs_int32 start; - afs_int32 end; - afs_int32 index; /* start index of returned entries */ - afs_int32 *nextIndexP; /* output index for next call */ - afs_int32 *dbTimeP; - budb_dumpList *dumps; /* pointer to buffer */ -{ +afs_int32 +SBUDB_GetDumps(call, majorVersion, flags, name, start, end, index, nextIndexP, + dbTimeP, dumps) + struct rx_call *call; + afs_int32 majorVersion; /* version of interface structures */ + afs_int32 flags; /* search & select controls */ + char *name; /* s&s parameters */ + afs_int32 start; + afs_int32 end; + afs_int32 index; /* start index of returned entries */ + afs_int32 *nextIndexP; /* output index for next call */ + afs_int32 *dbTimeP; + budb_dumpList *dumps; /* pointer to buffer */ +{ + afs_int32 code; + + code = + GetDumps(call, majorVersion, flags, name, start, end, index, + nextIndexP, dbTimeP, dumps); + osi_auditU(call, BUDB_GetDmpEvent, code, AUD_END); + return code; +} + +afs_int32 +GetDumps(call, majorVersion, flags, name, start, end, index, nextIndexP, + dbTimeP, dumps) + struct rx_call *call; + afs_int32 majorVersion; /* version of interface structures */ + afs_int32 flags; /* search & select controls */ + char *name; /* s&s parameters */ + afs_int32 start; + afs_int32 end; + afs_int32 index; /* start index of returned entries */ + afs_int32 *nextIndexP; /* output index for next call */ + afs_int32 *dbTimeP; + budb_dumpList *dumps; /* pointer to buffer */ +{ struct ubik_trans *ut; - dbadr da; - struct dump d; - afs_int32 nameFlags, startFlags, endFlags, timeFlags; - afs_int32 eval, code = 0; - afs_int32 toskip; + dbadr da; + struct dump d; + afs_int32 nameFlags, startFlags, endFlags, timeFlags; + afs_int32 eval, code = 0; + afs_int32 toskip; struct returnList list; /* Don't check permissions when we look up a specific dump id */ - if ( ((flags & BUDB_OP_STARTS) != BUDB_OP_DUMPID) && !callPermitted(call) ) + if (((flags & BUDB_OP_STARTS) != BUDB_OP_DUMPID) && !callPermitted(call)) return BUDB_NOTPERMITTED; - if (majorVersion != BUDB_MAJORVERSION) return BUDB_OLDINTERFACE; - if (index < 0) return BUDB_ENDOFLIST; + if (majorVersion != BUDB_MAJORVERSION) + return BUDB_OLDINTERFACE; + if (index < 0) + return BUDB_ENDOFLIST; - eval = InitRPC (&ut, LOCKREAD, 1); - if (eval) return eval; + eval = InitRPC(&ut, LOCKREAD, 1); + if (eval) + return eval; - nameFlags = flags & BUDB_OP_NAMES; + nameFlags = flags & BUDB_OP_NAMES; startFlags = flags & BUDB_OP_STARTS; - endFlags = flags & BUDB_OP_ENDS; - timeFlags = flags & BUDB_OP_TIMES; + endFlags = flags & BUDB_OP_ENDS; + timeFlags = flags & BUDB_OP_TIMES; - InitReturnList (&list); + InitReturnList(&list); toskip = index; - if (nameFlags == BUDB_OP_DUMPNAME) - { + if (nameFlags == BUDB_OP_DUMPNAME) { /* not yet implemented */ - if (startFlags || endFlags || timeFlags) ABORT(BUDB_BADFLAGS); - - eval = ht_LookupEntry (ut, &db.dumpName, name, &da, &d); - if (eval) ABORT(eval); - if (!da) ABORT(BUDB_NODUMPNAME); - - while (1) - { - if (strcmp (d.dumpName, name) == 0) - { - eval = AddToReturnList (&list, da, &toskip); - if (eval == BUDB_LIST2BIG) break; - if (eval) ABORT(eval); + if (startFlags || endFlags || timeFlags) + ABORT(BUDB_BADFLAGS); + + eval = ht_LookupEntry(ut, &db.dumpName, name, &da, &d); + if (eval) + ABORT(eval); + if (!da) + ABORT(BUDB_NODUMPNAME); + + while (1) { + if (strcmp(d.dumpName, name) == 0) { + eval = AddToReturnList(&list, da, &toskip); + if (eval == BUDB_LIST2BIG) + break; + if (eval) + ABORT(eval); } da = ntohl(d.nameHashChain); /* get next dump w/ name */ - if (!da) break; + if (!da) + break; - eval = dbread (ut, da, &d, sizeof(d)); - if (eval) ABORT(eval); + eval = dbread(ut, da, &d, sizeof(d)); + if (eval) + ABORT(eval); } - } - else - if ( nameFlags == BUDB_OP_VOLUMENAME ) - { + } else if (nameFlags == BUDB_OP_VOLUMENAME) { #ifdef PA struct volInfo vi; - + LogError(0, "NYI, BUDB_OP_VOLUMENAME\n"); ABORT(BUDB_BADFLAGS); - if (startFlags != BUDB_OP_STARTTIME) ABORT(BUDB_BADFLAGS); + if (startFlags != BUDB_OP_STARTTIME) + ABORT(BUDB_BADFLAGS); /* lookup a dump by volumename and time stamp. Find the most recent * dump of the specified volumename, that occured before the supplied @@ -2397,55 +2604,60 @@ afs_int32 GetDumps (call, majorVersion, flags, name, start, end, /* get us a volInfo for name */ eval = ht_LookupEntry(ut, &db.volName, name, &da, &vi); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); - while (1) - { + while (1) { /* now iterate over all the entries of this name */ - for ( va = vi.firstFragment; va != 0; va = v.sameNameChain ) - { + for (va = vi.firstFragment; va != 0; va = v.sameNameChain) { va = ntohl(va); eval = dbread(ut, va, &v, sizeof(v)); - if (eval) ABORT(eval); - - if date on fragment > date - ignore it - too recent; - - if ( date on fragment < date && date on fragment > bestfound ) - bestfound = date on fragment; - - } /* for va */ + if (eval) + ABORT(eval); + + if date + on fragment > date ignore it - too recent; + + if (date on fragment < date && date on fragment > bestfound) + bestfound = date on fragment; + + } /* for va */ da = vi.sameNameChain; - if ( da == 0 ) - break; + if (da == 0) + break; da = ntohl(da); eval = dbread(ut, da, &vi, sizeof(vi)); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); } +/* if nothing found return error from saved volfragment address, compute dump. otherwise, return dump found +*/ + #endif /* PA */ - - } - else if (startFlags == BUDB_OP_DUMPID) - { - if (endFlags || timeFlags) ABORT(BUDB_BADFLAGS); - if (nameFlags) ABORT(BUDB_BADFLAGS); /* NYI */ - - eval = ht_LookupEntry (ut, &db.dumpIden, &start, &da, &d); - if (eval) ABORT(eval); - if (!da) ABORT(BUDB_NODUMPID); - - eval = AddToReturnList (&list, da, &toskip); - if (eval) ABORT(eval); - } - else if (endFlags == BUDB_OP_NPREVIOUS) - { + + } else if (startFlags == BUDB_OP_DUMPID) { + if (endFlags || timeFlags) + ABORT(BUDB_BADFLAGS); + if (nameFlags) + ABORT(BUDB_BADFLAGS); /* NYI */ + + eval = ht_LookupEntry(ut, &db.dumpIden, &start, &da, &d); + if (eval) + ABORT(eval); + if (!da) + ABORT(BUDB_NODUMPID); + + eval = AddToReturnList(&list, da, &toskip); + if (eval) + ABORT(eval); + } else if (endFlags == BUDB_OP_NPREVIOUS) { struct wantDumpRock rock; struct chosenDump *ptr, *nextPtr; @@ -2454,30 +2666,31 @@ afs_int32 GetDumps (call, majorVersion, flags, name, start, end, /* no other flags should be set */ /* end specifies how many dumps */ - if (!end) ABORT(BUDB_BADFLAGS); + if (!end) + ABORT(BUDB_BADFLAGS); memset(&rock, 0, sizeof(rock)); rock.maxDumps = end; - scanHashTable(ut, &db.dumpName, wantDump, rememberDump, (char *) &rock); + scanHashTable(ut, &db.dumpName, wantDump, rememberDump, + (char *)&rock); - for (ptr=rock.chain; ptr; ptr=nextPtr) - { + for (ptr = rock.chain; ptr; ptr = nextPtr) { nextPtr = ptr->next; - AddToReturnList (&list, ptr->addr, &toskip); /* ignore error for free */ + AddToReturnList(&list, ptr->addr, &toskip); /* ignore error for free */ free(ptr); } - } - else - { - ABORT(BUDB_BADFLAGS); + } else { + ABORT(BUDB_BADFLAGS); } - eval = SendReturnList (ut, &list, FillDumpEntry, sizeof(struct budb_dumpEntry), - index, nextIndexP, dbTimeP, (returnList_t)dumps); - if (eval) ABORT(eval); + eval = + SendReturnList(ut, &list, FillDumpEntry, + sizeof(struct budb_dumpEntry), index, nextIndexP, + dbTimeP, (returnList_t) dumps); + if (eval) + ABORT(eval); - error_exit: FreeReturnList(&list); code = ubik_EndTrans(ut); return code; @@ -2493,91 +2706,97 @@ afs_int32 GetDumps (call, majorVersion, flags, name, start, end, * we should use the most recent expiration date. Put the most recent * expiration tape into the given tape structure. */ -afs_int32 getExpiration (ut, tapePtr) +afs_int32 +getExpiration(ut, tapePtr) struct ubik_trans *ut; - struct tape *tapePtr; + struct tape *tapePtr; { - dbadr ad; + dbadr ad; struct dump d; struct tape t; - afs_int32 initDump; - afs_int32 eval, code = 0; + afs_int32 initDump; + afs_int32 eval, code = 0; - if (!tapePtr) ERROR(0); + if (!tapePtr) + ERROR(0); /* Get the dump for this tape */ ad = ntohl(tapePtr->dump); - eval = dbread(ut,ad,&d,sizeof(d)); - if (eval) ERROR(eval); - + eval = dbread(ut, ad, &d, sizeof(d)); + if (eval) + ERROR(eval); + /* If not an initial dump, get the initial dump */ - if (d.initialDumpID) - { - initDump = ntohl(d.initialDumpID); - eval = ht_LookupEntry (ut, &db.dumpIden, &initDump, &ad, &d); - if (eval) ERROR(eval); + if (d.initialDumpID) { + initDump = ntohl(d.initialDumpID); + eval = ht_LookupEntry(ut, &db.dumpIden, &initDump, &ad, &d); + if (eval) + ERROR(eval); } /* Cycle through the dumps and appended dumps */ - while (ad) - { - /* Get the first tape in this dump. No need to check the rest of the tapes */ - /* for this dump since they will all have the same expiration date */ - eval = dbread (ut, ntohl(d.firstTape), &t, sizeof(t)); - if (eval) ERROR(eval); - + while (ad) { + /* Get the first tape in this dump. No need to check the rest of the tapes */ + /* for this dump since they will all have the same expiration date */ + eval = dbread(ut, ntohl(d.firstTape), &t, sizeof(t)); + if (eval) + ERROR(eval); + /* Take the greater of the expiration dates */ - if ( ntohl(tapePtr->expires) < ntohl(t.expires) ) + if (ntohl(tapePtr->expires) < ntohl(t.expires)) tapePtr->expires = t.expires; /* Step to and read the next appended dump */ - if ( ad = ntohl(d.appendedDumpChain) ) - { - eval = dbread(ut,ad,&d,sizeof(d)); - if (eval) ERROR(eval); + if (ad = ntohl(d.appendedDumpChain)) { + eval = dbread(ut, ad, &d, sizeof(d)); + if (eval) + ERROR(eval); } } error_exit: - return(code); + return (code); } /* Mark the following dump as appended to another, intial dump */ -afs_int32 makeAppended (ut, appendedDumpID, initialDumpID, startTapeSeq) +afs_int32 +makeAppended(ut, appendedDumpID, initialDumpID, startTapeSeq) struct ubik_trans *ut; - afs_int32 appendedDumpID; - afs_int32 initialDumpID; - afs_int32 startTapeSeq; + afs_int32 appendedDumpID; + afs_int32 initialDumpID; + afs_int32 startTapeSeq; { - dbadr ada, da, lastDumpAddr; - struct dump ad, d; - afs_int32 eval, code = 0; + dbadr ada, da, lastDumpAddr; + struct dump ad, d; + afs_int32 eval, code = 0; if (!initialDumpID) - ERROR(0); + ERROR(0); if (appendedDumpID == initialDumpID) - ERROR(BUDB_INTERNALERROR); + ERROR(BUDB_INTERNALERROR); /* If there is an initial dump, append this dump to it */ /* Find the appended dump via its id */ - eval = ht_LookupEntry(ut,&db.dumpIden,&appendedDumpID,&ada,&ad); - if (eval) ERROR(eval); + eval = ht_LookupEntry(ut, &db.dumpIden, &appendedDumpID, &ada, &ad); + if (eval) + ERROR(eval); /* If the dump is already marked as appended, * then we have an internal error. */ if (ad.initialDumpID) { - if (ntohl(ad.initialDumpID) != initialDumpID) - ERROR(BUDB_INTERNALERROR); + if (ntohl(ad.initialDumpID) != initialDumpID) + ERROR(BUDB_INTERNALERROR); } /* Update the appended dump to point to the initial dump */ ad.initialDumpID = htonl(initialDumpID); - ad.tapes.b = htonl(startTapeSeq); + ad.tapes.b = htonl(startTapeSeq); /* find the initial dump via its id */ - eval = ht_LookupEntry(ut,&db.dumpIden,&initialDumpID,&da,&d); - if (eval) ERROR(eval); + eval = ht_LookupEntry(ut, &db.dumpIden, &initialDumpID, &da, &d); + if (eval) + ERROR(eval); /* Update the appended dump's tape format with that of the initial */ strcpy(ad.tapes.format, d.tapes.format); @@ -2586,340 +2805,371 @@ afs_int32 makeAppended (ut, appendedDumpID, initialDumpID, startTapeSeq) * we reach the last appended dump. */ lastDumpAddr = da; - while (d.appendedDumpChain) { - lastDumpAddr = ntohl(d.appendedDumpChain); - if (lastDumpAddr == ada) ERROR(0); /* Already appended */ - eval = dbread(ut, lastDumpAddr, &d, sizeof(d)); - if (eval) ERROR(eval); + while (d.appendedDumpChain) { + lastDumpAddr = ntohl(d.appendedDumpChain); + if (lastDumpAddr == ada) + ERROR(0); /* Already appended */ + eval = dbread(ut, lastDumpAddr, &d, sizeof(d)); + if (eval) + ERROR(eval); } - + /* Update the last dump to point to our new appended dump. * The appended dump is the last one in the dump chain. */ - d.appendedDumpChain = htonl(ada); + d.appendedDumpChain = htonl(ada); ad.appendedDumpChain = 0; /* Write the appended dump and the initial dump */ - eval = dbwrite(ut,ada,(char *)&ad,sizeof(ad)); - if (eval) ERROR(eval); + eval = dbwrite(ut, ada, (char *)&ad, sizeof(ad)); + if (eval) + ERROR(eval); - eval = dbwrite (ut, lastDumpAddr, (char *)&d, sizeof(d)); - if (eval) ERROR(eval); + eval = dbwrite(ut, lastDumpAddr, (char *)&d, sizeof(d)); + if (eval) + ERROR(eval); - eval = set_header_word (ut, lastUpdate, htonl(time(0))); - if (eval) ERROR(eval); + eval = set_header_word(ut, lastUpdate, htonl(time(0))); + if (eval) + ERROR(eval); error_exit: - return(code); + return (code); } -afs_int32 BUDB_MakeDumpAppended (call, appendedDumpID, initialDumpID, startTapeSeq) +afs_int32 +SBUDB_MakeDumpAppended(call, appendedDumpID, initialDumpID, startTapeSeq) struct rx_call *call; - afs_int32 appendedDumpID; - afs_int32 initialDumpID; - afs_int32 startTapeSeq; + afs_int32 appendedDumpID; + afs_int32 initialDumpID; + afs_int32 startTapeSeq; { - afs_int32 code; + afs_int32 code; - code = MakeDumpAppended (call, appendedDumpID, initialDumpID, startTapeSeq); - osi_auditU (call, BUDB_AppDmpEvent, code, AUD_LONG, appendedDumpID, AUD_END); - return code; + code = + MakeDumpAppended(call, appendedDumpID, initialDumpID, startTapeSeq); + osi_auditU(call, BUDB_AppDmpEvent, code, AUD_LONG, appendedDumpID, + AUD_END); + return code; } -afs_int32 MakeDumpAppended (call, appendedDumpID, initialDumpID, startTapeSeq) +afs_int32 +MakeDumpAppended(call, appendedDumpID, initialDumpID, startTapeSeq) struct rx_call *call; - afs_int32 appendedDumpID; - afs_int32 initialDumpID; - afs_int32 startTapeSeq; + afs_int32 appendedDumpID; + afs_int32 initialDumpID; + afs_int32 startTapeSeq; { - struct ubik_trans *ut; - afs_int32 eval, code = 0; + struct ubik_trans *ut; + afs_int32 eval, code = 0; - if ( !callPermitted(call) ) - return BUDB_NOTPERMITTED; + if (!callPermitted(call)) + return BUDB_NOTPERMITTED; - eval = InitRPC (&ut, LOCKWRITE, 1); - if (eval) return(eval); + eval = InitRPC(&ut, LOCKWRITE, 1); + if (eval) + return (eval); - eval = makeAppended(ut,appendedDumpID,initialDumpID,startTapeSeq); - if (eval) ABORT(eval); + eval = makeAppended(ut, appendedDumpID, initialDumpID, startTapeSeq); + if (eval) + ABORT(eval); - code = ubik_EndTrans(ut); - return (code); + code = ubik_EndTrans(ut); + return (code); - abort_exit: - ubik_AbortTrans(ut); - return(code); + abort_exit: + ubik_AbortTrans(ut); + return (code); } /* Find the last tape of a dump-set. This includes any appended dumps */ -afs_int32 BUDB_FindLastTape (call, dumpID, dumpEntry, tapeEntry, volEntry) - struct rx_call *call; - afs_int32 dumpID; - struct budb_dumpEntry *dumpEntry; - struct budb_tapeEntry *tapeEntry; +afs_int32 +SBUDB_FindLastTape(call, dumpID, dumpEntry, tapeEntry, volEntry) + struct rx_call *call; + afs_int32 dumpID; + struct budb_dumpEntry *dumpEntry; + struct budb_tapeEntry *tapeEntry; struct budb_volumeEntry *volEntry; { - afs_int32 code; + afs_int32 code; - code = FindLastTape (call, dumpID, dumpEntry, tapeEntry, volEntry); - osi_auditU (call, BUDB_FndLTpeEvent, code, AUD_LONG, dumpID, AUD_END); - return code; + code = FindLastTape(call, dumpID, dumpEntry, tapeEntry, volEntry); + osi_auditU(call, BUDB_FndLTpeEvent, code, AUD_LONG, dumpID, AUD_END); + return code; } -afs_int32 FindLastTape (call, dumpID, dumpEntry, tapeEntry, volEntry) - struct rx_call *call; - afs_int32 dumpID; - struct budb_dumpEntry *dumpEntry; - struct budb_tapeEntry *tapeEntry; +afs_int32 +FindLastTape(call, dumpID, dumpEntry, tapeEntry, volEntry) + struct rx_call *call; + afs_int32 dumpID; + struct budb_dumpEntry *dumpEntry; + struct budb_tapeEntry *tapeEntry; struct budb_volumeEntry *volEntry; { - struct ubik_trans *ut; - struct dump d; - dbadr lastDump; - struct tape t; - dbadr lastTape, thisTape; - afs_int32 lastTapeSeq; - struct volFragment vf; - dbadr lastVol, thisVol; - afs_int32 lastVolPos; - afs_int32 eval, code = 0; - - if ( !callPermitted(call) ) - return BUDB_NOTPERMITTED; - - if (!dumpID) return(BUDB_BADARGUMENT); - - eval = InitRPC (&ut, LOCKREAD, 1); - if (eval) return(eval); - - /* find and read its initial dump via its id */ - eval = ht_LookupEntry (ut, &db.dumpIden, &dumpID, &lastDump, &d); - if (eval) ABORT(eval); - if (!lastDump) ABORT(BUDB_NODUMPID); - - /* Follow the append dumps link chain until we reach the last dump */ - while (d.appendedDumpChain) - { - lastDump = ntohl(d.appendedDumpChain); - eval = dbread(ut,lastDump,&d,sizeof(d)); - if (eval) ABORT(eval); - } - - /* We now have the last dump of the last appended dump */ - /* Copy this into our return structure */ - eval = FillDumpEntry(ut,lastDump,dumpEntry); - if (eval) ABORT(eval); - - /* Fail if the last dump has no tapes */ - if (!d.firstTape) ABORT(BUDB_NOTAPENAME); - - /* Follow the tapes in this dump until we reach the last tape */ - eval = dbread (ut, ntohl(d.firstTape), &t, sizeof(t)); - if (eval) ABORT(eval); - - lastTape = ntohl(d.firstTape); - lastTapeSeq = ntohl(t.seq); - lastVol = ntohl(t.firstVol); - - while (t.nextTape) - { - thisTape = ntohl(t.nextTape); - eval = dbread(ut,thisTape,&t,sizeof(t)); - if (eval) ABORT(eval); - - if (ntohl(t.seq) > lastTapeSeq) - { - lastTape = thisTape; - lastTapeSeq = ntohl(t.seq); - lastVol = ntohl(t.firstVol); - } - } - - /* We now have the last tape of the last appended dump */ - /* Copy this into our return structure */ - eval = FillTapeEntry(ut,lastTape,tapeEntry); - if (eval) ABORT(eval); - - /* Zero volume entry if the last tape has no volumes */ - if (!lastVol) { - memset(volEntry, 0, sizeof(*volEntry)); - } else { - /* Follow the volumes until we reach the last volume */ - eval = dbread (ut,lastVol,&vf,sizeof(vf)); - if (eval) ABORT(eval); + struct ubik_trans *ut; + struct dump d; + dbadr lastDump; + struct tape t; + dbadr lastTape, thisTape; + afs_int32 lastTapeSeq; + struct volFragment vf; + dbadr lastVol, thisVol; + afs_int32 lastVolPos; + afs_int32 eval, code = 0; + + if (!callPermitted(call)) + return BUDB_NOTPERMITTED; + + if (!dumpID) + return (BUDB_BADARGUMENT); + + eval = InitRPC(&ut, LOCKREAD, 1); + if (eval) + return (eval); + + /* find and read its initial dump via its id */ + eval = ht_LookupEntry(ut, &db.dumpIden, &dumpID, &lastDump, &d); + if (eval) + ABORT(eval); + if (!lastDump) + ABORT(BUDB_NODUMPID); + + /* Follow the append dumps link chain until we reach the last dump */ + while (d.appendedDumpChain) { + lastDump = ntohl(d.appendedDumpChain); + eval = dbread(ut, lastDump, &d, sizeof(d)); + if (eval) + ABORT(eval); + } + + /* We now have the last dump of the last appended dump */ + /* Copy this into our return structure */ + eval = FillDumpEntry(ut, lastDump, dumpEntry); + if (eval) + ABORT(eval); + + /* Fail if the last dump has no tapes */ + if (!d.firstTape) + ABORT(BUDB_NOTAPENAME); + + /* Follow the tapes in this dump until we reach the last tape */ + eval = dbread(ut, ntohl(d.firstTape), &t, sizeof(t)); + if (eval) + ABORT(eval); + + lastTape = ntohl(d.firstTape); + lastTapeSeq = ntohl(t.seq); + lastVol = ntohl(t.firstVol); + + while (t.nextTape) { + thisTape = ntohl(t.nextTape); + eval = dbread(ut, thisTape, &t, sizeof(t)); + if (eval) + ABORT(eval); + + if (ntohl(t.seq) > lastTapeSeq) { + lastTape = thisTape; + lastTapeSeq = ntohl(t.seq); + lastVol = ntohl(t.firstVol); + } + } + + /* We now have the last tape of the last appended dump */ + /* Copy this into our return structure */ + eval = FillTapeEntry(ut, lastTape, tapeEntry); + if (eval) + ABORT(eval); + + /* Zero volume entry if the last tape has no volumes */ + if (!lastVol) { + memset(volEntry, 0, sizeof(*volEntry)); + } else { + /* Follow the volumes until we reach the last volume */ + eval = dbread(ut, lastVol, &vf, sizeof(vf)); + if (eval) + ABORT(eval); lastVolPos = vf.position; while (vf.sameTapeChain) { - thisVol = ntohl(vf.sameTapeChain); - eval = dbread(ut,thisVol,&vf,sizeof(vf)); - if (eval) ABORT(eval); - - if (vf.position > lastVolPos) { - lastVol = thisVol; - lastVolPos = vf.position; - } + thisVol = ntohl(vf.sameTapeChain); + eval = dbread(ut, thisVol, &vf, sizeof(vf)); + if (eval) + ABORT(eval); + + if (vf.position > lastVolPos) { + lastVol = thisVol; + lastVolPos = vf.position; + } } /* We now have the last volume of this tape */ /* Copy this into our return structure */ - eval = FillVolEntry(ut,lastVol,volEntry); - if (eval) ABORT(eval); - } + eval = FillVolEntry(ut, lastVol, volEntry); + if (eval) + ABORT(eval); + } - eval = ubik_EndTrans(ut); - if (!code) code = eval; - return (code); + eval = ubik_EndTrans(ut); + if (!code) + code = eval; + return (code); - abort_exit: - ubik_AbortTrans(ut); - return(code); + abort_exit: + ubik_AbortTrans(ut); + return (code); } -afs_int32 BUDB_GetTapes (call, majorVersion, flags, name, start, end, index, nextIndexP, +afs_int32 +SBUDB_GetTapes(call, majorVersion, flags, name, start, end, index, nextIndexP, dbTimeP, tapes) struct rx_call *call; - int majorVersion; /* version of interface structures */ - afs_int32 flags; /* search & select controls */ - char *name; /* s&s parameters */ - afs_int32 start; - afs_int32 end; /* reserved: MBZ */ - afs_int32 index; /* start index of returned entries */ - afs_int32 *nextIndexP; /* output index for next call */ + afs_int32 majorVersion; /* version of interface structures */ + afs_int32 flags; /* search & select controls */ + char *name; /* s&s parameters */ + afs_int32 start; + afs_int32 end; /* reserved: MBZ */ + afs_int32 index; /* start index of returned entries */ + afs_int32 *nextIndexP; /* output index for next call */ afs_int32 *dbTimeP; - budb_tapeList *tapes; /* pointer to buffer */ + budb_tapeList *tapes; /* pointer to buffer */ { - afs_int32 code; + afs_int32 code; - code = GetTapes (call, majorVersion, flags, name, start, end, - index, nextIndexP, dbTimeP, tapes); - osi_auditU (call, BUDB_GetTpeEvent, code, AUD_END); - return code; + code = + GetTapes(call, majorVersion, flags, name, start, end, index, + nextIndexP, dbTimeP, tapes); + osi_auditU(call, BUDB_GetTpeEvent, code, AUD_END); + return code; } -afs_int32 GetTapes (call, majorVersion, flags, name, start, end, - index, nextIndexP, dbTimeP, tapes) +afs_int32 +GetTapes(call, majorVersion, flags, name, start, end, index, nextIndexP, + dbTimeP, tapes) struct rx_call *call; - int majorVersion; /* version of interface structures */ - afs_int32 flags; /* search & select controls */ - char *name; /* s&s parameters */ - afs_int32 start; - afs_int32 end; /* reserved: MBZ */ - afs_int32 index; /* start index of returned entries */ - afs_int32 *nextIndexP; /* output index for next call */ + afs_int32 majorVersion; /* version of interface structures */ + afs_int32 flags; /* search & select controls */ + char *name; /* s&s parameters */ + afs_int32 start; + afs_int32 end; /* reserved: MBZ */ + afs_int32 index; /* start index of returned entries */ + afs_int32 *nextIndexP; /* output index for next call */ afs_int32 *dbTimeP; - budb_tapeList *tapes; /* pointer to buffer */ + budb_tapeList *tapes; /* pointer to buffer */ { struct ubik_trans *ut; - dbadr da, ta; - struct dump d; - struct tape t; - afs_int32 nameFlags, startFlags, endFlags, timeFlags; + dbadr da, ta; + struct dump d; + struct tape t; + afs_int32 nameFlags, startFlags, endFlags, timeFlags; struct returnList list; - afs_int32 eval, code = 0; - afs_int32 toskip; + afs_int32 eval, code = 0; + afs_int32 toskip; - if ( !callPermitted(call) ) + if (!callPermitted(call)) return BUDB_NOTPERMITTED; if (majorVersion != BUDB_MAJORVERSION) - return BUDB_OLDINTERFACE; + return BUDB_OLDINTERFACE; - if (index < 0) return BUDB_ENDOFLIST; + if (index < 0) + return BUDB_ENDOFLIST; - eval = InitRPC (&ut, LOCKREAD, 1); - if (eval) return eval; + eval = InitRPC(&ut, LOCKREAD, 1); + if (eval) + return eval; - nameFlags = flags & BUDB_OP_NAMES; + nameFlags = flags & BUDB_OP_NAMES; startFlags = flags & BUDB_OP_STARTS; - endFlags = flags & BUDB_OP_ENDS; - timeFlags = flags & BUDB_OP_TIMES; + endFlags = flags & BUDB_OP_ENDS; + timeFlags = flags & BUDB_OP_TIMES; - InitReturnList (&list); + InitReturnList(&list); toskip = index; - if (nameFlags == BUDB_OP_TAPENAME) - { /*it*/ - eval = ht_LookupEntry (ut, &db.tapeName, name, &ta, &t); - if (eval) ABORT(eval); - if (!ta) ABORT(BUDB_NOTAPENAME); - + if (nameFlags == BUDB_OP_TAPENAME) { /*it */ + eval = ht_LookupEntry(ut, &db.tapeName, name, &ta, &t); + if (eval) + ABORT(eval); + if (!ta) + ABORT(BUDB_NOTAPENAME); + /* NYI */ - if ( (startFlags & ~BUDB_OP_DUMPID) || endFlags || timeFlags ) ABORT(BUDB_BADFLAGS); + if ((startFlags & ~BUDB_OP_DUMPID) || endFlags || timeFlags) + ABORT(BUDB_BADFLAGS); /* follow the hash chain to the end */ - while (ta) - { /*w*/ - if (startFlags & BUDB_OP_DUMPID) - { + while (ta) { /*w */ + if (startFlags & BUDB_OP_DUMPID) { /* read in the dump */ eval = dbread(ut, ntohl(t.dump), &d, sizeof(d)); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); /* check if both name and dump id match */ - if ( (strcmp(name, t.name) == 0) && (ntohl(d.id) == start) ) - { - eval = AddToReturnList (&list, ta, &toskip); - if (eval && (eval != BUDB_LIST2BIG)) ABORT(eval); + if ((strcmp(name, t.name) == 0) && (ntohl(d.id) == start)) { + eval = AddToReturnList(&list, ta, &toskip); + if (eval && (eval != BUDB_LIST2BIG)) + ABORT(eval); break; } - } - else - { - /* Add to return list and continue search */ - if ( strcmp(name, t.name) == 0 ) - { - eval = AddToReturnList (&list, ta, &toskip); - if (eval == BUDB_LIST2BIG) break; - if (eval) ABORT(eval); + } else { + /* Add to return list and continue search */ + if (strcmp(name, t.name) == 0) { + eval = AddToReturnList(&list, ta, &toskip); + if (eval == BUDB_LIST2BIG) + break; + if (eval) + ABORT(eval); } } ta = ntohl(t.nameHashChain); - if (ta) dbread(ut, ta, &t, sizeof(t)); - } /*w*/ - } /*it*/ - else if (nameFlags == BUDB_OP_TAPESEQ) - { - eval = ht_LookupEntry(ut,&db.dumpIden, &start, &da, &d); - if (eval) ABORT(eval); - if (!da) ABORT(BUDB_NODUMPNAME); - + if (ta) + dbread(ut, ta, &t, sizeof(t)); + } /*w */ + } /*it */ + else if (nameFlags == BUDB_OP_TAPESEQ) { + eval = ht_LookupEntry(ut, &db.dumpIden, &start, &da, &d); + if (eval) + ABORT(eval); + if (!da) + ABORT(BUDB_NODUMPNAME); + /* search for the right tape */ ta = ntohl(d.firstTape); - for (ta = ntohl(d.firstTape); ta; ta = ntohl(t.nextTape)) - { + for (ta = ntohl(d.firstTape); ta; ta = ntohl(t.nextTape)) { eval = dbread(ut, ta, &t, sizeof(t)); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); - if (ntohl(t.seq) == end) - { - eval = AddToReturnList (&list, ta, &toskip); - if (eval && (eval != BUDB_LIST2BIG)) ABORT(eval); + if (ntohl(t.seq) == end) { + eval = AddToReturnList(&list, ta, &toskip); + if (eval && (eval != BUDB_LIST2BIG)) + ABORT(eval); break; } } - } - else - { - ABORT (BUDB_BADFLAGS); + } else { + ABORT(BUDB_BADFLAGS); } - eval = SendReturnList (ut, &list, FillTapeEntry, - sizeof(struct budb_tapeEntry), - index, nextIndexP, dbTimeP, (returnList_t)tapes); - if (eval) ABORT(eval); + eval = + SendReturnList(ut, &list, FillTapeEntry, + sizeof(struct budb_tapeEntry), index, nextIndexP, + dbTimeP, (returnList_t) tapes); + if (eval) + ABORT(eval); FreeReturnList(&list); code = ubik_EndTrans(ut); - return code; - + return code; + abort_exit: FreeReturnList(&list); ubik_AbortTrans(ut); - return(code); + return (code); } /* BUDB_GetVolumes @@ -2932,125 +3182,137 @@ afs_int32 GetTapes (call, majorVersion, flags, name, start, end, * name on the selected dumpid. */ -afs_int32 BUDB_GetVolumes (call, majorVersion, flags, name, start, end, - index, nextIndexP, dbTimeP, volumes) - struct rx_call *call; - int majorVersion; /* version of interface structures */ - afs_int32 flags; /* search & select controls */ - char *name; /* - parameters for search */ - afs_int32 start; /* - usage depends which BUDP_OP_* */ - afs_int32 end; /* - bits are set */ - afs_int32 index; /* start index of returned entries */ - afs_int32 *nextIndexP; /* output index for next call */ - afs_int32 *dbTimeP; - budb_volumeList *volumes; /* pointer to buffer */ -{ - afs_int32 code; - - code = GetVolumes (call, majorVersion, flags, name, start, end, - index, nextIndexP, dbTimeP, volumes); - osi_auditU (call, BUDB_GetVolEvent, code, AUD_END); - return code; -} - -afs_int32 GetVolumes (call, majorVersion, flags, name, start, end, - index, nextIndexP, dbTimeP, volumes) - struct rx_call *call; - int majorVersion; /* version of interface structures */ - afs_int32 flags; /* search & select controls */ - char *name; /* - parameters for search */ - afs_int32 start; /* - usage depends which BUDP_OP_* */ - afs_int32 end; /* - bits are set */ - afs_int32 index; /* start index of returned entries */ - afs_int32 *nextIndexP; /* output index for next call */ - afs_int32 *dbTimeP; - budb_volumeList *volumes; /* pointer to buffer */ +afs_int32 +SBUDB_GetVolumes(call, majorVersion, flags, name, start, end, index, + nextIndexP, dbTimeP, volumes) + struct rx_call *call; + afs_int32 majorVersion; /* version of interface structures */ + afs_int32 flags; /* search & select controls */ + char *name; /* - parameters for search */ + afs_int32 start; /* - usage depends which BUDP_OP_* */ + afs_int32 end; /* - bits are set */ + afs_int32 index; /* start index of returned entries */ + afs_int32 *nextIndexP; /* output index for next call */ + afs_int32 *dbTimeP; + budb_volumeList *volumes; /* pointer to buffer */ +{ + afs_int32 code; + + code = + GetVolumes(call, majorVersion, flags, name, start, end, index, + nextIndexP, dbTimeP, volumes); + osi_auditU(call, BUDB_GetVolEvent, code, AUD_END); + return code; +} + +afs_int32 +GetVolumes(call, majorVersion, flags, name, start, end, index, nextIndexP, + dbTimeP, volumes) + struct rx_call *call; + afs_int32 majorVersion; /* version of interface structures */ + afs_int32 flags; /* search & select controls */ + char *name; /* - parameters for search */ + afs_int32 start; /* - usage depends which BUDP_OP_* */ + afs_int32 end; /* - bits are set */ + afs_int32 index; /* start index of returned entries */ + afs_int32 *nextIndexP; /* output index for next call */ + afs_int32 *dbTimeP; + budb_volumeList *volumes; /* pointer to buffer */ { struct ubik_trans *ut; - dbadr via; - struct volInfo vi; - afs_int32 nameFlags, startFlags, endFlags, timeFlags; - afs_int32 eval, code = 0; + dbadr via; + struct volInfo vi; + afs_int32 nameFlags, startFlags, endFlags, timeFlags; + afs_int32 eval, code = 0; struct returnList vollist; - afs_int32 toskip; + afs_int32 toskip; /* Don't check permissions when we look up a specific volume name */ - if ( ((flags & BUDB_OP_NAMES) != BUDB_OP_VOLUMENAME) && !callPermitted(call) ) + if (((flags & BUDB_OP_NAMES) != BUDB_OP_VOLUMENAME) + && !callPermitted(call)) return BUDB_NOTPERMITTED; - if (majorVersion != BUDB_MAJORVERSION) return BUDB_OLDINTERFACE; - if (index < 0) return BUDB_ENDOFLIST; + if (majorVersion != BUDB_MAJORVERSION) + return BUDB_OLDINTERFACE; + if (index < 0) + return BUDB_ENDOFLIST; - eval = InitRPC (&ut, LOCKREAD, 1); - if (eval) return eval; + eval = InitRPC(&ut, LOCKREAD, 1); + if (eval) + return eval; - nameFlags = flags & BUDB_OP_NAMES; + nameFlags = flags & BUDB_OP_NAMES; startFlags = flags & BUDB_OP_STARTS; - endFlags = flags & BUDB_OP_ENDS; - timeFlags = flags & BUDB_OP_TIMES; + endFlags = flags & BUDB_OP_ENDS; + timeFlags = flags & BUDB_OP_TIMES; - InitReturnList (&vollist); + InitReturnList(&vollist); toskip = index; /* lookup a the volume (specified by name) in the dump (specified by id) */ - if (nameFlags == BUDB_OP_VOLUMENAME) - { + if (nameFlags == BUDB_OP_VOLUMENAME) { /* dumpid permissible, all others off */ - if ( ((startFlags & ~BUDB_OP_DUMPID) != 0) || endFlags || timeFlags ) + if (((startFlags & ~BUDB_OP_DUMPID) != 0) || endFlags || timeFlags) ABORT(BUDB_BADFLAGS); /* returns ptr to volinfo of requested name */ - eval = ht_LookupEntry (ut, &db.volName, name, &via, &vi); - if (eval) ABORT(eval); - if (!via) ABORT(BUDB_NOVOLUMENAME); + eval = ht_LookupEntry(ut, &db.volName, name, &via, &vi); + if (eval) + ABORT(eval); + if (!via) + ABORT(BUDB_NOVOLUMENAME); /* Iterate over all volume fragments with this name */ - while (1) - { + while (1) { struct volFragment v; afs_int32 va; /* traverse all the volume fragments for this volume info structure */ - for (va=vi.firstFragment; va; va=v.sameNameChain) - { + for (va = vi.firstFragment; va; va = v.sameNameChain) { va = ntohl(va); - eval = dbread (ut, va, &v, sizeof(v)); - if (eval) ABORT(eval); + eval = dbread(ut, va, &v, sizeof(v)); + if (eval) + ABORT(eval); - if ( startFlags & BUDB_OP_DUMPID ) - { + if (startFlags & BUDB_OP_DUMPID) { struct tape atape; struct dump adump; /* get the dump id for this fragment */ eval = dbread(ut, ntohl(v.tape), &atape, sizeof(atape)); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); - eval = dbread(ut, ntohl(atape.dump), &adump, sizeof(adump)); - if (eval) ABORT(BUDB_IO); + eval = + dbread(ut, ntohl(atape.dump), &adump, sizeof(adump)); + if (eval) + ABORT(BUDB_IO); /* dump id does not match */ - if ( ntohl(adump.id) != start ) + if (ntohl(adump.id) != start) continue; } - eval = AddToReturnList (&vollist, va, &toskip); - if (eval == BUDB_LIST2BIG) break; - if (eval) ABORT(eval); + eval = AddToReturnList(&vollist, va, &toskip); + if (eval == BUDB_LIST2BIG) + break; + if (eval) + ABORT(eval); } - if (eval == BUDB_LIST2BIG) break; + if (eval == BUDB_LIST2BIG) + break; via = vi.sameNameChain; - if (via == 0) break; + if (via == 0) + break; via = ntohl(via); - eval = dbread (ut, via, &vi, sizeof(vi)); - if (eval) ABORT(eval); + eval = dbread(ut, via, &vi, sizeof(vi)); + if (eval) + ABORT(eval); } - } - else if ( ((nameFlags == 0) || (nameFlags == BUDB_OP_TAPENAME)) && - (startFlags == BUDB_OP_DUMPID) ) - { + } else if (((nameFlags == 0) || (nameFlags == BUDB_OP_TAPENAME)) + && (startFlags == BUDB_OP_DUMPID)) { struct dump dump; dbadr dumpAddr; struct tape tape; @@ -3061,44 +3323,50 @@ afs_int32 GetVolumes (call, majorVersion, flags, name, start, end, /* lookup all volumes for a specified dump id */ /* no other flags should be set */ - if (endFlags || timeFlags) ABORT(BUDB_BADFLAGS); + if (endFlags || timeFlags) + ABORT(BUDB_BADFLAGS); /* find the dump */ eval = ht_LookupEntry(ut, &db.dumpIden, &start, &dumpAddr, &dump); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); /* traverse all the tapes */ - for (tapeAddr=ntohl(dump.firstTape); tapeAddr; tapeAddr=ntohl(tape.nextTape)) - { /*w*/ + for (tapeAddr = ntohl(dump.firstTape); tapeAddr; tapeAddr = ntohl(tape.nextTape)) { /*w */ eval = dbread(ut, tapeAddr, &tape, sizeof(tape)); - if (eval) ABORT(eval); - - if ( ( nameFlags != BUDB_OP_TAPENAME ) || - ((nameFlags == BUDB_OP_TAPENAME) && (strcmp(tape.name,name) == 0)) ) - { - /* now return all the volumes */ - for (volFragAddr=ntohl(tape.firstVol); volFragAddr; - volFragAddr=ntohl(volFrag.sameTapeChain)) - { + if (eval) + ABORT(eval); + + if ((nameFlags != BUDB_OP_TAPENAME) + || ((nameFlags == BUDB_OP_TAPENAME) + && (strcmp(tape.name, name) == 0))) { + /* now return all the volumes */ + for (volFragAddr = ntohl(tape.firstVol); volFragAddr; + volFragAddr = ntohl(volFrag.sameTapeChain)) { eval = dbread(ut, volFragAddr, &volFrag, sizeof(volFrag)); - if (eval) ABORT(eval); + if (eval) + ABORT(eval); eval = AddToReturnList(&vollist, volFragAddr, &toskip); - if (eval == BUDB_LIST2BIG) break; - if (eval) ABORT(eval); + if (eval == BUDB_LIST2BIG) + break; + if (eval) + ABORT(eval); } } - if (eval == BUDB_LIST2BIG) break; - } /*w*/ - } - else - { - ABORT(BUDB_BADFLAGS); + if (eval == BUDB_LIST2BIG) + break; + } /*w */ + } else { + ABORT(BUDB_BADFLAGS); } - eval = SendReturnList(ut, &vollist, FillVolEntry, sizeof(struct budb_volumeEntry), - index, nextIndexP, dbTimeP, (returnList_t)volumes); - if (eval) ABORT(eval); + eval = + SendReturnList(ut, &vollist, FillVolEntry, + sizeof(struct budb_volumeEntry), index, nextIndexP, + dbTimeP, (returnList_t) volumes); + if (eval) + ABORT(eval); error_exit: FreeReturnList(&vollist); @@ -3111,81 +3379,94 @@ afs_int32 GetVolumes (call, majorVersion, flags, name, start, end, return code; } -afs_int32 BUDB_UseTape (call, tape, new) - struct rx_call *call; - struct budb_tapeEntry *tape; /* tape info */ - int *new; /* set if tape is new */ +afs_int32 +SBUDB_UseTape(call, tape, new) + struct rx_call *call; + struct budb_tapeEntry *tape; /* tape info */ + afs_int32 *new; /* set if tape is new */ { - afs_int32 code; + afs_int32 code; - code = UseTape (call, tape, new); - osi_auditU (call, BUDB_UseTpeEvent, code, AUD_DATE, (tape ? tape->dump : 0), AUD_END); - return code; + code = UseTape(call, tape, new); + osi_auditU(call, BUDB_UseTpeEvent, code, AUD_DATE, + (tape ? tape->dump : 0), AUD_END); + return code; } -afs_int32 UseTape (call, tape, new) - struct rx_call *call; - struct budb_tapeEntry *tape; /* tape info */ - int *new; /* set if tape is new */ +afs_int32 +UseTape(call, tape, new) + struct rx_call *call; + struct budb_tapeEntry *tape; /* tape info */ + int *new; /* set if tape is new */ { struct ubik_trans *ut; - dbadr da, a; - struct dump d; - struct tape t; - afs_int32 eval, code; + dbadr da, a; + struct dump d; + struct tape t; + afs_int32 eval, code; - if ( !callPermitted(call) ) + if (!callPermitted(call)) return BUDB_NOTPERMITTED; - if (strlen (tape->name) >= sizeof(t.name)) return BUDB_BADARGUMENT; + if (strlen(tape->name) >= sizeof(t.name)) + return BUDB_BADARGUMENT; - eval = InitRPC (&ut, LOCKWRITE, 1); - if (eval) return eval; + eval = InitRPC(&ut, LOCKWRITE, 1); + if (eval) + return eval; *new = 0; memset(&t, 0, sizeof(t)); - eval = AllocStructure (ut, tape_BLOCK, 0, &a, &t); - if (eval) ABORT(eval); + eval = AllocStructure(ut, tape_BLOCK, 0, &a, &t); + if (eval) + ABORT(eval); - strcpy (t.name, tape->name); + strcpy(t.name, tape->name); - eval = ht_HashIn (ut, &db.tapeName, a, &t); - if (eval) ABORT(eval); + eval = ht_HashIn(ut, &db.tapeName, a, &t); + if (eval) + ABORT(eval); *new = 1; /* Since deleting a tape may change the dump (if its the same one), read in - the dump after the call to DeleteTape. */ - - eval = ht_LookupEntry (ut, &db.dumpIden, &tape->dump, &da, &d); - if (eval) ABORT(eval); - if (!da) ABORT(BUDB_NODUMPID); - - if (!tape->written) tape->written = time(0); /* fill in tape struct */ - t.written = htonl(tape->written); - t.expires = htonl(tape->expires); - t.dump = htonl(da); - t.seq = htonl(tape->seq); - t.useCount = htonl(tape->useCount); - t.labelpos = htonl(tape->labelpos); + * the dump after the call to DeleteTape. */ + + eval = ht_LookupEntry(ut, &db.dumpIden, &tape->dump, &da, &d); + if (eval) + ABORT(eval); + if (!da) + ABORT(BUDB_NODUMPID); + + if (!tape->written) + tape->written = time(0); /* fill in tape struct */ + t.written = htonl(tape->written); + t.expires = htonl(tape->expires); + t.dump = htonl(da); + t.seq = htonl(tape->seq); + t.useCount = htonl(tape->useCount); + t.labelpos = htonl(tape->labelpos); t.useKBytes = 0; - t.flags = htonl(tape->flags | BUDB_TAPE_BEINGWRITTEN); + t.flags = htonl(tape->flags | BUDB_TAPE_BEINGWRITTEN); - t.nextTape = d.firstTape; /* Chain the tape to the dump */ + t.nextTape = d.firstTape; /* Chain the tape to the dump */ d.firstTape = htonl(a); - if (tape->seq >= ntohl(d.tapes.maxTapes)) /* inc # tapes in the dump */ + if (tape->seq >= ntohl(d.tapes.maxTapes)) /* inc # tapes in the dump */ d.tapes.maxTapes = htonl(tape->seq); - eval = dbwrite (ut, a, &t, sizeof(t)); /* write tape struct */ - if (eval) ABORT(eval); + eval = dbwrite(ut, a, &t, sizeof(t)); /* write tape struct */ + if (eval) + ABORT(eval); - eval = dbwrite (ut, da, &d, sizeof(d)); /* write the dump struct */ - if (eval) ABORT(eval); + eval = dbwrite(ut, da, &d, sizeof(d)); /* write the dump struct */ + if (eval) + ABORT(eval); - eval = set_header_word (ut, lastUpdate, htonl(time(0))); - if (eval) ABORT(eval); + eval = set_header_word(ut, lastUpdate, htonl(time(0))); + if (eval) + ABORT(eval); LogDebug(5, "added tape %s\n", tape->name); @@ -3204,256 +3485,289 @@ afs_int32 UseTape (call, tape, new) * --------------------------------------------- */ -afs_int32 BUDB_T_DumpHashTable (call, type, filename) - struct rx_call *call; - int type; - char *filename; +afs_int32 +SBUDB_T_DumpHashTable(call, type, filename) + struct rx_call *call; + afs_int32 type; + char *filename; { - afs_int32 code; + afs_int32 code; - code = T_DumpHashTable (call, type, filename); - osi_auditU (call, BUDB_TDmpHaEvent, code, AUD_STR, filename, AUD_END); - return code; + code = T_DumpHashTable(call, type, filename); + osi_auditU(call, BUDB_TDmpHaEvent, code, AUD_STR, filename, AUD_END); + return code; } -afs_int32 T_DumpHashTable (call, type, filename) - struct rx_call *call; - int type; - char *filename; +afs_int32 +T_DumpHashTable(call, type, filename) + struct rx_call *call; + int type; + char *filename; { - struct ubik_trans *ut; + struct ubik_trans *ut; struct memoryHashTable *mht; - int ent; - afs_int32 eval, code = 0; - char path[64]; - FILE *DUMP; - - int length; - afs_uint32 hash; - dbadr a, first_a; - char e[sizeof(struct block)]; /* unnecessarily conservative */ - int e_size; - int old; - - if ( !callPermitted(call) ) + int ent; + afs_int32 eval, code = 0; + char path[64]; + FILE *DUMP; + + int length; + afs_uint32 hash; + dbadr a, first_a; + char e[sizeof(struct block)]; /* unnecessarily conservative */ + int e_size; + int old; + + if (!callPermitted(call)) return BUDB_NOTPERMITTED; - if (strlen (filename) >= sizeof(path)-5) return BUDB_BADARGUMENT; + if (strlen(filename) >= sizeof(path) - 5) + return BUDB_BADARGUMENT; - eval = InitRPC (&ut, LOCKWRITE, 1); - if (eval) return eval; + eval = InitRPC(&ut, LOCKWRITE, 1); + if (eval) + return eval; - if ((mht = ht_GetType (type, &e_size)) == 0) return BUDB_BADARGUMENT; + if ((mht = ht_GetType(type, &e_size)) == 0) + return BUDB_BADARGUMENT; sprintf(path, "%s/%s", gettmpdir(), filename); - DUMP = fopen (path, "w"); - if (!DUMP) ABORT(BUDB_BADARGUMENT); + DUMP = fopen(path, "w"); + if (!DUMP) + ABORT(BUDB_BADARGUMENT); ent = 0; - for (old=0; ; old++) - { + for (old = 0;; old++) { length = (old ? mht->oldLength : mht->length); - if (length) fprintf (DUMP, "Dumping %sHash Table:\n", (old?"Old ":"")); + if (length) + fprintf(DUMP, "Dumping %sHash Table:\n", (old ? "Old " : "")); - for (hash=0; hashid)); + case HT_dumpIden_FUNCTION: + fprintf(DUMP, "%d\n", ntohl(((struct dump *)e)->id)); break; - case HT_dumpName_FUNCTION: - fprintf (DUMP, "%s\n", ((struct dump *)e)->dumpName); + case HT_dumpName_FUNCTION: + fprintf(DUMP, "%s\n", ((struct dump *)e)->dumpName); break; - case HT_tapeName_FUNCTION: - fprintf (DUMP, "%s\n", ((struct tape *)e)->name); + case HT_tapeName_FUNCTION: + fprintf(DUMP, "%s\n", ((struct tape *)e)->name); break; - case HT_volName_FUNCTION: - fprintf (DUMP, "%s\n", ((struct volInfo *)e)->name); + case HT_volName_FUNCTION: + fprintf(DUMP, "%s\n", ((struct volInfo *)e)->name); break; } - if ((ht_HashEntry(mht,e) % length) != hash) ABORT(BUDB_DATABASEINCONSISTENT); - a = ntohl(*(dbadr *)(e + mht->threadOffset)); + if ((ht_HashEntry(mht, e) % length) != hash) + ABORT(BUDB_DATABASEINCONSISTENT); + a = ntohl(*(dbadr *) (e + mht->threadOffset)); } } - if (old) break; + if (old) + break; } - fprintf (DUMP, "%d entries found\n", ent); - if (ntohl(mht->ht->entries) != ent) ABORT(BUDB_DATABASEINCONSISTENT); + fprintf(DUMP, "%d entries found\n", ent); + if (ntohl(mht->ht->entries) != ent) + ABORT(BUDB_DATABASEINCONSISTENT); code = ubik_EndTrans(ut); - if (DUMP) fclose (DUMP); + if (DUMP) + fclose(DUMP); return code; - + abort_exit: ubik_AbortTrans(ut); - if (DUMP) fclose (DUMP); + if (DUMP) + fclose(DUMP); return code; } -afs_int32 BUDB_T_GetVersion (call, majorVersion) - struct rx_call *call; - int *majorVersion; +afs_int32 +SBUDB_T_GetVersion(call, majorVersion) + struct rx_call *call; + afs_int32 *majorVersion; { - afs_int32 code; + afs_int32 code; - code = T_GetVersion (call, majorVersion); - osi_auditU (call, BUDB_TGetVrEvent, code, AUD_END); - return code; + code = T_GetVersion(call, majorVersion); + osi_auditU(call, BUDB_TGetVrEvent, code, AUD_END); + return code; } -afs_int32 T_GetVersion (call, majorVersion) - struct rx_call *call; - int *majorVersion; +afs_int32 +T_GetVersion(call, majorVersion) + struct rx_call *call; + int *majorVersion; { struct ubik_trans *ut; afs_int32 code; - - code = InitRPC (&ut, LOCKREAD, 0); - if (code) return(code); - + + code = InitRPC(&ut, LOCKREAD, 0); + if (code) + return (code); + *majorVersion = BUDB_MAJORVERSION; - + code = ubik_EndTrans(ut); - return(code); + return (code); } /* BUDB_T_DumpDatabase * dump as much of the database as possible int /tmp/ */ -afs_int32 BUDB_T_DumpDatabase (call, filename) +afs_int32 +SBUDB_T_DumpDatabase(call, filename) struct rx_call *call; char *filename; { - afs_int32 code; + afs_int32 code; - code = T_DumpDatabase (call, filename); - osi_auditU (call, BUDB_TDmpDBEvent, code, AUD_STR, filename, AUD_END); - return code; + code = T_DumpDatabase(call, filename); + osi_auditU(call, BUDB_TDmpDBEvent, code, AUD_STR, filename, AUD_END); + return code; } -afs_int32 T_DumpDatabase (call, filename) +afs_int32 +T_DumpDatabase(call, filename) struct rx_call *call; char *filename; -{ +{ FILE *dumpfid; - int entrySize; + int entrySize; struct ubik_trans *ut; char *path = 0; dbadr dbAddr; int type, old, length, hash; - int block, index; struct memoryHashTable *mht; - afs_int32 eval, code = 0; + afs_int32 eval, code = 0; - if ( !callPermitted(call) ) + if (!callPermitted(call)) return BUDB_NOTPERMITTED; - path = (char *) malloc(strlen(gettmpdir())+1+strlen(filename)+1); - if (!path) return(BUDB_INTERNALERROR); + path = (char *)malloc(strlen(gettmpdir()) + 1 + strlen(filename) + 1); + if (!path) + return (BUDB_INTERNALERROR); sprintf(path, "%s/%s", gettmpdir(), filename); dumpfid = fopen(path, "w"); - if (!dumpfid) return(BUDB_BADARGUMENT); - - eval = InitRPC (&ut, LOCKWRITE, 1); - if (eval) return(eval); - - /* dump all items in the database */ - for ( type=1; type<=HT_MAX_FUNCTION; type++ ) - { /*ft*/ - mht = ht_GetType (type, &entrySize); - if (!mht) ERROR(BUDB_BADARGUMENT); - - for ( old =0; old <= 1; old++ ) - { /*fo*/ - length = ( old ? mht->oldLength : mht->length); - if (!length) continue; - - fprintf (dumpfid, "Dumping %s Hash Table:\n", (old ? "Old ":"")); - - for ( hash = 0; hash < length; hash++ ) - { /*f*/ - dbAddr = ht_LookupBucket (ut, mht, hash, old); - - while ( dbAddr ) - { /*w*/ - switch (type) - { /*s*/ - case HT_dumpIden_FUNCTION: + if (!dumpfid) + return (BUDB_BADARGUMENT); + + eval = InitRPC(&ut, LOCKWRITE, 1); + if (eval) + return (eval); + + /* dump all items in the database */ + for (type = 1; type <= HT_MAX_FUNCTION; type++) { /*ft */ + mht = ht_GetType(type, &entrySize); + if (!mht) + ERROR(BUDB_BADARGUMENT); + + for (old = 0; old <= 1; old++) { /*fo */ + length = (old ? mht->oldLength : mht->length); + if (!length) + continue; + + fprintf(dumpfid, "Dumping %s Hash Table:\n", (old ? "Old " : "")); + + for (hash = 0; hash < length; hash++) { /*f */ + dbAddr = ht_LookupBucket(ut, mht, hash, old); + + while (dbAddr) { /*w */ + switch (type) { /*s */ + case HT_dumpIden_FUNCTION: { struct dump hostDump, diskDump; - eval = cdbread (ut, dump_BLOCK, dbAddr, &diskDump, sizeof(diskDump)); - if (eval) ERROR(eval); + eval = + cdbread(ut, dump_BLOCK, dbAddr, &diskDump, + sizeof(diskDump)); + if (eval) + ERROR(eval); - fprintf(dumpfid, "\ndumpId hash %d, entry at %u: block %d, index %d\n", - hash, dbAddr, block, index); - fprintf(dumpfid, "----------------------------\n"); + fprintf(dumpfid, + "\ndumpId hash %d, entry at %u\n", + hash, dbAddr); + fprintf(dumpfid, + "----------------------------\n"); dump_ntoh(&diskDump, &hostDump); printDump(dumpfid, &hostDump); dbAddr = hostDump.idHashChain; } break; - - case HT_dumpName_FUNCTION: + + case HT_dumpName_FUNCTION: { struct dump hostDump, diskDump; - eval = cdbread (ut, dump_BLOCK, dbAddr, &diskDump, sizeof(diskDump)); - if (eval) ERROR(eval); + eval = + cdbread(ut, dump_BLOCK, dbAddr, &diskDump, + sizeof(diskDump)); + if (eval) + ERROR(eval); fprintf(dumpfid, - "\ndumpname hash %d, entry at %u: block %d, index %d\n", - hash, dbAddr, block, index); - fprintf(dumpfid, "----------------------------\n"); + "\ndumpname hash %d, entry at %u\n", + hash, dbAddr); + fprintf(dumpfid, + "----------------------------\n"); dump_ntoh(&diskDump, &hostDump); printDump(dumpfid, &hostDump); dbAddr = hostDump.nameHashChain; } break; - case HT_tapeName_FUNCTION: + case HT_tapeName_FUNCTION: { struct tape hostTape, diskTape; - eval = cdbread (ut, tape_BLOCK, dbAddr, &diskTape, sizeof(diskTape)); - if (eval) ERROR(eval); + eval = + cdbread(ut, tape_BLOCK, dbAddr, &diskTape, + sizeof(diskTape)); + if (eval) + ERROR(eval); - fprintf(dumpfid, - "\ntapename hash %d, entry at %u: block %d, index %d\n", - hash, dbAddr, block, index); - fprintf(dumpfid, "----------------------------\n"); + fprintf(dumpfid, + "\ntapename hash %d, entry at %u\n", + hash, dbAddr); + fprintf(dumpfid, + "----------------------------\n"); tape_ntoh(&diskTape, &hostTape); printTape(dumpfid, &hostTape); dbAddr = hostTape.nameHashChain; } break; - case HT_volName_FUNCTION: + case HT_volName_FUNCTION: { struct volInfo hostVolInfo, diskVolInfo; - eval = cdbread (ut, volInfo_BLOCK, dbAddr, &diskVolInfo, sizeof(diskVolInfo)); - if (eval) ERROR(eval); + eval = + cdbread(ut, volInfo_BLOCK, dbAddr, + &diskVolInfo, sizeof(diskVolInfo)); + if (eval) + ERROR(eval); - fprintf(dumpfid, - "\nvolname hash %d, entry at %u: block %d, index %d\n", - hash, dbAddr, block, index); - fprintf(dumpfid, "----------------------------\n"); + fprintf(dumpfid, + "\nvolname hash %d, entry at %u\n", + hash, dbAddr); + fprintf(dumpfid, + "----------------------------\n"); volInfo_ntoh(&diskVolInfo, &hostVolInfo); printVolInfo(dumpfid, &hostVolInfo); dbAddr = hostVolInfo.nameHashChain; @@ -3462,49 +3776,51 @@ afs_int32 T_DumpDatabase (call, filename) hostVolInfo.firstFragment); } break; - - default: + + default: fprintf(dumpfid, "unknown type %d\n", type); break; - - } /*s*/ - } /*w*/ - } /*f*/ - } /*fo*/ - } /*ft*/ + + } /*s */ + } /*w */ + } /*f */ + } /*fo */ + } /*ft */ error_exit: - code = ubik_EndTrans(ut); /* is this safe if no ut started ?*/ - if (dumpfid) fclose(dumpfid); - if (path) free(path); - return(code); + code = ubik_EndTrans(ut); /* is this safe if no ut started ? */ + if (dumpfid) + fclose(dumpfid); + if (path) + free(path); + return (code); } +int volFragsDump(ut, dumpfid, dbAddr) - struct ubik_trans *ut; - FILE *dumpfid; - dbadr dbAddr; + struct ubik_trans *ut; + FILE *dumpfid; + dbadr dbAddr; { struct volFragment hostVolFragment, diskVolFragment; afs_int32 code; - int block, index; - - while (dbAddr) - { - code = cdbread (ut, volFragment_BLOCK, dbAddr, &diskVolFragment, sizeof(diskVolFragment)); - if (code) { /* don't be fussy about errors */ + + while (dbAddr) { + code = + cdbread(ut, volFragment_BLOCK, dbAddr, &diskVolFragment, + sizeof(diskVolFragment)); + if (code) { /* don't be fussy about errors */ fprintf(dumpfid, "volFragsDump: Error reading database\n"); - return(0); + return (0); } - - fprintf(dumpfid, "\nvolfragment entry at %u: block %d, index %d\n", - dbAddr, block, index); + + fprintf(dumpfid, "\nvolfragment entry at %u\n", dbAddr); fprintf(dumpfid, "----------------------------\n"); volFragment_ntoh(&diskVolFragment, &hostVolFragment); printVolFragment(dumpfid, &hostVolFragment); dbAddr = hostVolFragment.sameNameChain; } - return(0); + return (0); } #ifdef notdef @@ -3565,7 +3881,7 @@ tapeDiskToHost(diskTapePtr, hostTapePtr) dumpDiskToHost(diskDumpPtr, hostDumpPtr) struct dump *diskDumpPtr, *hostDumpPtr; { - hostDumpPtr->id = ntohl(diskDumpPtr->id); + hostDumpPtr->id = ntohl(diskDumpPtr->id); hostDumpPtr->idHashChain = ntohl(diskDumpPtr->idHashChain); strcpy(hostDumpPtr->dumpName, diskDumpPtr->dumpName); strcpy(hostDumpPtr->dumpPath, diskDumpPtr->dumpPath); @@ -3586,7 +3902,8 @@ dumpDiskToHost(diskDumpPtr, hostDumpPtr) #endif /* notdef */ -checkHash(ut,hashType) +int +checkHash(ut, hashType) struct ubik_trans *ut; int hashType; { @@ -3594,64 +3911,63 @@ checkHash(ut,hashType) int entrySize, hashTableLength; int bucket; int old; - afs_int32 code; + afs_int32 code = 0; mhtPtr = ht_GetType(hashType, &entrySize); - if ( mhtPtr == 0 ) + if (mhtPtr == 0) ERROR(-1); - for ( old = 0; old < 1; old++) - { + for (old = 0; old < 1; old++) { LogDebug(5, "\nold = %d\n", old); printMemoryHashTable(stdout, mhtPtr); LogDebug(5, "\n"); - hashTableLength = ( old ? mhtPtr->oldLength : mhtPtr->length); + hashTableLength = (old ? mhtPtr->oldLength : mhtPtr->length); - for ( bucket = 0; bucket < hashTableLength; bucket++ ) - { + for (bucket = 0; bucket < hashTableLength; bucket++) { dbadr entryAddr; - entryAddr = ht_LookupBucket (ut, mhtPtr, bucket, old); - while (entryAddr != 0) - { - LogDebug(6, "bucket %d has disk addr %d\n", bucket, entryAddr); - switch (hashType) - { - case HT_dumpIden_FUNCTION: - { - struct dump diskDump, hostDump; - - code = dbread(ut, entryAddr, &diskDump, entrySize); - if (code) ERROR(-1); - - dump_ntoh(&diskDump, &hostDump); - printDump(stdout, &hostDump); - entryAddr = hostDump.idHashChain; - } - break; - - case HT_dumpName_FUNCTION: + entryAddr = ht_LookupBucket(ut, mhtPtr, bucket, old); + while (entryAddr != 0) { + LogDebug(6, "bucket %d has disk addr %d\n", bucket, + entryAddr); + switch (hashType) { + case HT_dumpIden_FUNCTION: + { + struct dump diskDump, hostDump; + + code = dbread(ut, entryAddr, &diskDump, entrySize); + if (code) + ERROR(-1); + + dump_ntoh(&diskDump, &hostDump); + printDump(stdout, &hostDump); + entryAddr = hostDump.idHashChain; + } break; - case HT_tapeName_FUNCTION: + case HT_dumpName_FUNCTION: break; - case HT_volName_FUNCTION: - { - struct volInfo diskVolInfo, hostVolInfo; + case HT_tapeName_FUNCTION: + break; - code = dbread(ut, entryAddr, &diskVolInfo, entrySize); - if (code) ERROR(-1); + case HT_volName_FUNCTION: + { + struct volInfo diskVolInfo, hostVolInfo; - volInfo_ntoh(&diskVolInfo, &hostVolInfo); - printVolInfo(stdout, &hostVolInfo); - entryAddr = hostVolInfo.nameHashChain; - break; - } - } + code = dbread(ut, entryAddr, &diskVolInfo, entrySize); + if (code) + ERROR(-1); + + volInfo_ntoh(&diskVolInfo, &hostVolInfo); + printVolInfo(stdout, &hostVolInfo); + entryAddr = hostVolInfo.nameHashChain; + break; + } + } } } } error_exit: - return(code); + return (code); } diff --git a/src/budb/server.c b/src/budb/server.c index 181fc2b5e..82ad1a222 100644 --- a/src/budb/server.c +++ b/src/budb/server.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/budb/server.c,v 1.1.1.8 2002/05/10 23:57:52 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/budb/server.c,v 1.14 2004/03/11 07:31:46 shadow Exp $"); #ifdef AFS_NT40_ENV #include @@ -22,6 +23,15 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/server.c,v 1.1.1.8 2002/05/10 23:5 #include #include #endif + +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif + #include #include #include @@ -48,60 +58,56 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/budb/server.c,v 1.1.1.8 2002/05/10 23:5 #include "globals.h" #include "afs/audit.h" - -extern afs_int32 ubik_lastYesTime; -extern afs_int32 ubik_nBuffers; - -struct ubik_dbase *BU_dbase; -struct afsconf_dir *BU_conf; /* for getting cell info */ +struct ubik_dbase *BU_dbase; +struct afsconf_dir *BU_conf; /* for getting cell info */ char lcell[MAXKTCREALMLEN]; afs_int32 myHost = 0; -int helpOption; +int helpOption; /* server's global configuration information. This is exported to other * files/routines */ -buServerConfT globalConf; -buServerConfP globalConfPtr = &globalConf; +buServerConfT globalConf; +buServerConfP globalConfPtr = &globalConf; char dbDir[AFSDIR_PATH_MAX], cellConfDir[AFSDIR_PATH_MAX]; /* debugging control */ int debugging = 0; /* check whether caller is authorized to manage RX statistics */ -int BU_rxstat_userok(call) - struct rx_call *call; +int +BU_rxstat_userok(call) + struct rx_call *call; { - return afsconf_SuperUser(BU_conf, call, (char *)0); + return afsconf_SuperUser(BU_conf, call, NULL); } int -convert_cell_to_ubik (cellinfo, myHost, serverList) +convert_cell_to_ubik(cellinfo, myHost, serverList) struct afsconf_cell *cellinfo; - afs_int32 *myHost; - afs_int32 *serverList; -{ - int i; + afs_int32 *myHost; + afs_int32 *serverList; +{ + int i; char hostname[64]; struct hostent *th; /* get this host */ - gethostname(hostname,sizeof(hostname)); + gethostname(hostname, sizeof(hostname)); th = gethostbyname(hostname); - if (!th) - { + if (!th) { printf("prserver: couldn't get address of this host.\n"); BUDB_EXIT(1); } memcpy(myHost, th->h_addr, sizeof(afs_int32)); - for (i=0; inumServers; i++) + for (i = 0; i < cellinfo->numServers; i++) /* omit my host from serverList */ - if (cellinfo->hostAddr[i].sin_addr.s_addr != *myHost) + if (cellinfo->hostAddr[i].sin_addr.s_addr != *myHost) *serverList++ = cellinfo->hostAddr[i].sin_addr.s_addr; - *serverList = 0; /* terminate list */ + *serverList = 0; /* terminate list */ return 0; } @@ -110,11 +116,12 @@ convert_cell_to_ubik (cellinfo, myHost, serverList) * if the -help option was not within the command line. * If it were, this routine would never have been called. */ -static int MyBeforeProc(as) - register struct cmd_syndesc *as; +static int +MyBeforeProc(as) + register struct cmd_syndesc *as; { - helpOption = 0; - return 0; + helpOption = 0; + return 0; } /* initializeCommands @@ -127,28 +134,31 @@ initializeArgHandler() int argHandler(); - cmd_SetBeforeProc(MyBeforeProc, (char *)0); + cmd_SetBeforeProc(MyBeforeProc, NULL); - cptr = cmd_CreateSyntax((char *) 0, argHandler, (char *) 0, - "Backup database server"); + cptr = cmd_CreateSyntax(NULL, argHandler, NULL, "Backup database server"); cmd_AddParm(cptr, "-database", CMD_SINGLE, CMD_OPTIONAL, - "database directory"); + "database directory"); cmd_AddParm(cptr, "-cellservdb", CMD_SINGLE, CMD_OPTIONAL, - "cell configuration directory"); + "cell configuration directory"); cmd_AddParm(cptr, "-resetdb", CMD_FLAG, CMD_OPTIONAL, - "truncate the database"); + "truncate the database"); cmd_AddParm(cptr, "-noauth", CMD_FLAG, CMD_OPTIONAL, - "run without authentication"); + "run without authentication"); cmd_AddParm(cptr, "-smallht", CMD_FLAG, CMD_OPTIONAL, - "use small hash tables"); + "use small hash tables"); cmd_AddParm(cptr, "-servers", CMD_LIST, CMD_OPTIONAL, - "list of ubik database servers"); + "list of ubik database servers"); + + cmd_AddParm(cptr, "-ubikbuffers", CMD_SINGLE, CMD_OPTIONAL, + "the number of ubik buffers"); + } int @@ -160,21 +170,19 @@ argHandler(as, arock) /* globalConfPtr provides the handle for the configuration information */ /* database directory */ - if ( as->parms[0].items != 0 ) - { - globalConfPtr->databaseDirectory = - (char *) malloc(strlen(as->parms[0].items->data)+1); - if ( globalConfPtr->databaseDirectory == 0 ) + if (as->parms[0].items != 0) { + globalConfPtr->databaseDirectory = + (char *)malloc(strlen(as->parms[0].items->data) + 1); + if (globalConfPtr->databaseDirectory == 0) BUDB_EXIT(-1); strcpy(globalConfPtr->databaseDirectory, as->parms[0].items->data); } /* -cellservdb, cell configuration directory */ - if ( as->parms[1].items != 0 ) - { - globalConfPtr->cellConfigdir = - (char *) malloc(strlen(as->parms[1].items->data)+1); - if ( globalConfPtr->cellConfigdir == 0 ) + if (as->parms[1].items != 0) { + globalConfPtr->cellConfigdir = + (char *)malloc(strlen(as->parms[1].items->data) + 1); + if (globalConfPtr->cellConfigdir == 0) BUDB_EXIT(-1); strcpy(globalConfPtr->cellConfigdir, as->parms[1].items->data); @@ -183,21 +191,27 @@ argHandler(as, arock) } /* truncate the database */ - if ( as->parms[2].items != 0 ) + if (as->parms[2].items != 0) truncateDatabase(); /* run without authentication */ - if ( as->parms[3].items != 0 ) + if (as->parms[3].items != 0) globalConfPtr->debugFlags |= DF_NOAUTH; /* use small hash tables */ - if ( as->parms[4].items != 0 ) + if (as->parms[4].items != 0) globalConfPtr->debugFlags |= DF_SMALLHT; /* user provided list of ubik database servers */ - if ( as->parms[5].items != 0 ) + if (as->parms[5].items != 0) parseServerList(as->parms[5].items); + /* user provided the number of ubik buffers */ + if (as->parms[6].items != 0) + ubik_nBuffers = atoi(as->parms[6].items->data); + else + ubik_nBuffers = 0; + return 0; } @@ -215,17 +229,16 @@ parseServerList(itemPtr) save = itemPtr; /* compute number of servers in the list */ - while ( itemPtr ) - { + while (itemPtr) { nservers++; itemPtr = itemPtr->next; } LogDebug(3, "%d servers\n", nservers); - + /* now can allocate the space for the server arguments */ - serverArgs = (char **) malloc( (nservers+2) * sizeof(char *) ); - if ( serverArgs == 0 ) + serverArgs = (char **)malloc((nservers + 2) * sizeof(char *)); + if (serverArgs == 0) ERROR(-1); ptr = serverArgs; @@ -234,23 +247,22 @@ parseServerList(itemPtr) /* now go through and construct the list of servers */ itemPtr = save; - while ( itemPtr ) - { + while (itemPtr) { *ptr++ = itemPtr->data; itemPtr = itemPtr->next; } - code = ubik_ParseServerList(nservers+2, serverArgs, - &globalConfPtr->myHost, - globalConfPtr->serverList); - if ( code ) + code = + ubik_ParseServerList(nservers + 2, serverArgs, &globalConfPtr->myHost, + globalConfPtr->serverList); + if (code) ERROR(code); - + /* free space for the server args */ - free( (char *) serverArgs); - -error_exit: - return(code); + free((char *)serverArgs); + + error_exit: + return (code); } /* truncateDatabase @@ -263,10 +275,11 @@ truncateDatabase() afs_int32 code = 0; int fd; - path = (char *) malloc(strlen(globalConfPtr->databaseDirectory) + - strlen(globalConfPtr->databaseName) + - strlen(globalConfPtr->databaseExtension) + 1); - if ( path == 0 ) + path = + (char *)malloc(strlen(globalConfPtr->databaseDirectory) + + strlen(globalConfPtr->databaseName) + + strlen(globalConfPtr->databaseExtension) + 1); + if (path == 0) ERROR(-1); /* construct the database name */ @@ -278,14 +291,14 @@ truncateDatabase() if (!fd) { code = errno; } else { - if (ftruncate(fd, 0) != 0 ) { + if (ftruncate(fd, 0) != 0) { code = errno; } else close(fd); } -error_exit: - return(code); + error_exit: + return (code); } @@ -294,31 +307,34 @@ error_exit: #include "AFS_component_version_number.c" main(argc, argv) - int argc; + int argc; char *argv[]; { char *whoami = argv[0]; char *dbNamePtr = 0; - struct afsconf_cell cellinfo; - time_t currentTime; - afs_int32 code = 0; + struct afsconf_cell cellinfo; + time_t currentTime; + afs_int32 code = 0; + char clones[MAXHOSTSPERCELL]; + + + struct rx_service *tservice; struct rx_securityClass *sca[3]; - + extern int afsconf_ServerAuth(); extern int afsconf_CheckAuth(); extern int rx_stackSize; - extern struct rx_securityClass *rxnull_NewServerSecurityObject(); extern int BUDB_ExecuteRequest(); - + #ifdef AFS_NT40_ENV /* initialize winsock */ - if (afs_winsockInit()<0) { - ReportErrorEventAlt(AFSEVT_SVR_WINSOCK_INIT_FAILED, 0, argv[0],0); - fprintf(stderr, "%s: Couldn't initialize winsock.\n", whoami); - exit(1); + if (afs_winsockInit() < 0) { + ReportErrorEventAlt(AFSEVT_SVR_WINSOCK_INIT_FAILED, 0, argv[0], 0); + fprintf(stderr, "%s: Couldn't initialize winsock.\n", whoami); + exit(1); } #endif @@ -330,7 +346,7 @@ main(argc, argv) * generated which, in many cases, isn't too useful. */ struct sigaction nsa; - + sigemptyset(&nsa.sa_mask); nsa.sa_handler = SIG_DFL; nsa.sa_flags = SA_FULLDUMP; @@ -347,7 +363,7 @@ main(argc, argv) #ifdef AFS_NT40_ENV ReportErrorEventAlt(AFSEVT_SVR_NO_INSTALL_DIR, 0, argv[0], 0); #endif - com_err(whoami,errno,"; Unable to obtain AFS server directory."); + com_err(whoami, errno, "; Unable to obtain AFS server directory."); exit(2); } @@ -370,63 +386,60 @@ main(argc, argv) BUDB_EXIT(-1); } */ - - srandom (1); + + srandom(1); /* process the user supplied args */ helpOption = 1; code = cmd_Dispatch(argc, argv); - if ( code ) + if (code) ERROR(code); /* exit if there was a help option */ if (helpOption) - BUDB_EXIT(0); + BUDB_EXIT(0); /* open the log file */ globalConfPtr->log = fopen(AFSDIR_SERVER_BUDBLOG_FILEPATH, "a"); - if ( globalConfPtr->log == NULL ) - { - printf("Can't open log file %s - aborting\n", + if (globalConfPtr->log == NULL) { + printf("Can't open log file %s - aborting\n", AFSDIR_SERVER_BUDBLOG_FILEPATH); BUDB_EXIT(-1); } - /* keep log closed so can remove it */ + /* keep log closed so can remove it */ - fclose(globalConfPtr->log); + fclose(globalConfPtr->log); /* open the cell's configuration directory */ LogDebug(4, "opening %s\n", globalConfPtr->cellConfigdir); BU_conf = afsconf_Open(globalConfPtr->cellConfigdir); - if ( BU_conf == 0 ) - { + if (BU_conf == 0) { LogError(code, "Failed getting cell info\n"); com_err(whoami, code, "Failed getting cell info"); ERROR(BUDB_NOCELLS); } code = afsconf_GetLocalCell(BU_conf, lcell, sizeof(lcell)); - if ( code ) - { + if (code) { LogError(0, "** Can't determine local cell name!\n"); ERROR(code); } - if ( globalConfPtr->myHost == 0 ) - { + if (globalConfPtr->myHost == 0) { /* if user hasn't supplied a list of servers, extract server * list from the cell's database */ LogDebug(1, "Using server list from %s cell database.\n", lcell); - code = afsconf_GetCellInfo (BU_conf, lcell, 0, &cellinfo); - code = convert_cell_to_ubik (&cellinfo, - &globalConfPtr->myHost, - globalConfPtr->serverList); - if ( code ) + code = afsconf_GetExtendedCellInfo (BU_conf, lcell, 0, &cellinfo, + &clones); + code = + convert_cell_to_ubik(&cellinfo, &globalConfPtr->myHost, + globalConfPtr->serverList); + if (code) ERROR(code); } @@ -440,26 +453,31 @@ main(argc, argv) ubik_CheckRXSecurityProc = afsconf_CheckAuth; ubik_CheckRXSecurityRock = (char *)BU_conf; - ubik_nBuffers = 400; + if (ubik_nBuffers == 0) + ubik_nBuffers = 400; + + LogError(0, "Will allocate %d ubik buffers\n", ubik_nBuffers); - dbNamePtr = (char *) malloc(strlen(globalConfPtr->databaseDirectory) + - strlen(globalConfPtr->databaseName) + 1); - if ( dbNamePtr == 0 ) - ERROR(-1); + dbNamePtr = + (char *)malloc(strlen(globalConfPtr->databaseDirectory) + + strlen(globalConfPtr->databaseName) + 1); + if (dbNamePtr == 0) + ERROR(-1); /* construct the database name */ strcpy(dbNamePtr, globalConfPtr->databaseDirectory); strcat(dbNamePtr, globalConfPtr->databaseName); /* name prefix */ - rx_SetRxDeadTime(60); /* 60 seconds inactive before timeout */ + rx_SetRxDeadTime(60); /* 60 seconds inactive before timeout */ - code = ubik_ServerInit(globalConfPtr->myHost, - htons(AFSCONF_BUDBPORT), - globalConfPtr->serverList, - dbNamePtr, /* name prefix */ - &BU_dbase); - if (code) - { + code = ubik_ServerInitByInfo (globalConfPtr->myHost, + htons(AFSCONF_BUDBPORT), + &cellinfo, + &clones, + dbNamePtr, /* name prefix */ + &BU_dbase); + + if (code) { LogError(code, "Ubik init failed\n"); com_err(whoami, code, "Ubik init failed"); ERROR(code); @@ -467,18 +485,17 @@ main(argc, argv) sca[RX_SCINDEX_NULL] = rxnull_NewServerSecurityObject(); sca[RX_SCINDEX_VAB] = 0; - sca[RX_SCINDEX_KAD] = rxkad_NewServerSecurityObject(rxkad_clear, - BU_conf, - afsconf_GetKey, - (char *) 0); + sca[RX_SCINDEX_KAD] = + rxkad_NewServerSecurityObject(rxkad_clear, BU_conf, afsconf_GetKey, + NULL); /* Disable jumbograms */ rx_SetNoJumbo(); - tservice = rx_NewService(0, BUDB_SERVICE, "BackupDatabase", - sca, 3, BUDB_ExecuteRequest); - if (tservice == (struct rx_service *)0) - { + tservice = + rx_NewService(0, BUDB_SERVICE, "BackupDatabase", sca, 3, + BUDB_ExecuteRequest); + if (tservice == (struct rx_service *)0) { LogError(0, "Could not create backup database rx service\n"); printf("Could not create backup database rx service\n"); BUDB_EXIT(3); @@ -496,107 +513,106 @@ main(argc, argv) memset(dumpSyncPtr, 0, sizeof(*dumpSyncPtr)); Lock_Init(&dumpSyncPtr->ds_lock); - rx_StartServer(0); /* start handling requests */ + rx_StartServer(0); /* start handling requests */ code = InitProcs(); - if ( code ) + if (code) ERROR(code); currentTime = time(0); LogError(0, "Ready to process requests at %s\n", ctime(¤tTime)); - rx_ServerProc(); /* donate this LWP */ + rx_ServerProc(); /* donate this LWP */ -error_exit: + error_exit: osi_audit(BUDB_FinishEvent, code, AUD_END); - return(code); + return (code); } consistencyCheckDb() { /* do consistency checks on structure sizes */ - if ( (sizeof(struct htBlock) > BLOCKSIZE) - || (sizeof(struct vfBlock) > BLOCKSIZE) - || (sizeof(struct viBlock) > BLOCKSIZE) - || (sizeof(struct dBlock) > BLOCKSIZE) - || (sizeof(struct tBlock) > BLOCKSIZE) - ) - { - fprintf (stderr, "Block layout error!\n"); - BUDB_EXIT (99); + if ((sizeof(struct htBlock) > BLOCKSIZE) + || (sizeof(struct vfBlock) > BLOCKSIZE) + || (sizeof(struct viBlock) > BLOCKSIZE) + || (sizeof(struct dBlock) > BLOCKSIZE) + || (sizeof(struct tBlock) > BLOCKSIZE) + ) { + fprintf(stderr, "Block layout error!\n"); + BUDB_EXIT(99); } } -/*VARARGS*/ -LogDebug(level, a,b,c,d,e,f,g,h,i) - int level; - char *a, *b, *c, *d, *e, *f, *g, *h, *i; + /*VARARGS*/ +LogDebug(level, a, b, c, d, e, f, g, h, i) + int level; + char *a, *b, *c, *d, *e, *f, *g, *h, *i; { - if ( debugging >= level) - { + if (debugging >= level) { /* log normally closed so can remove it */ - globalConfPtr->log = fopen(AFSDIR_SERVER_BUDBLOG_FILEPATH, "a"); - if ( globalConfPtr->log != NULL ) - { - fprintf(globalConfPtr->log, a, b, c, d, e, f, g, h, i); - fflush(globalConfPtr->log); - fclose(globalConfPtr->log); + globalConfPtr->log = fopen(AFSDIR_SERVER_BUDBLOG_FILEPATH, "a"); + if (globalConfPtr->log != NULL) { + fprintf(globalConfPtr->log, a, b, c, d, e, f, g, h, i); + fflush(globalConfPtr->log); + fclose(globalConfPtr->log); } } + return 0; } -static char *TimeStamp(time_t t) +static char * +TimeStamp(time_t t) { - struct tm *lt; - static char timestamp[20]; + struct tm *lt; + static char timestamp[20]; - lt = localtime(&t); - strftime (timestamp, 20, "%m/%d/%Y %T", lt); - return timestamp; + lt = localtime(&t); + strftime(timestamp, 20, "%m/%d/%Y %T", lt); + return timestamp; } -/*VARARGS*/ -Log(a,b,c,d,e,f,g,h,i) - char *a, *b, *c, *d, *e, *f, *g, *h, *i; + /*VARARGS*/ +Log(a, b, c, d, e, f, g, h, i) + char *a, *b, *c, *d, *e, *f, *g, *h, *i; { time_t now; globalConfPtr->log = fopen(AFSDIR_SERVER_BUDBLOG_FILEPATH, "a"); - if ( globalConfPtr->log != NULL ) - { - now = time(0); + if (globalConfPtr->log != NULL) { + now = time(0); fprintf(globalConfPtr->log, "%s ", TimeStamp(now)); fprintf(globalConfPtr->log, a, b, c, d, e, f, g, h, i); fflush(globalConfPtr->log); fclose(globalConfPtr->log); } + return 0; } -/*VARARGS*/ -LogError(code, a,b,c,d,e,f,g,h,i) -long code; -char *a, *b, *c, *d, *e, *f, *g, *h, *i; + /*VARARGS*/ +LogError(code, a, b, c, d, e, f, g, h, i) + long code; + char *a, *b, *c, *d, *e, *f, *g, *h, *i; { time_t now; globalConfPtr->log = fopen(AFSDIR_SERVER_BUDBLOG_FILEPATH, "a"); - if ( globalConfPtr->log != NULL ) - { - now = time(0); + if (globalConfPtr->log != NULL) { + now = time(0); fprintf(globalConfPtr->log, "%s ", TimeStamp(now)); - if ( code ) + if (code) fprintf(globalConfPtr->log, "%s: %s\n", error_table_name(code), error_message(code)); fprintf(globalConfPtr->log, a, b, c, d, e, f, g, h, i); fflush(globalConfPtr->log); fclose(globalConfPtr->log); } + return 0; } @@ -611,13 +627,13 @@ LogNetDump(dumpPtr) { struct dump hostDump; extern buServerConfP globalConfPtr; - + dump_ntoh(dumpPtr, &hostDump); globalConfPtr->log = fopen(AFSDIR_SERVER_BUDBLOG_FILEPATH, "a"); - if ( globalConfPtr->log != NULL ) - { + if (globalConfPtr->log != NULL) { printDump(globalConfPtr->log, &hostDump); fclose(globalConfPtr->log); } + return 0; } diff --git a/src/budb/struct_ops.c b/src/budb/struct_ops.c index 17b2252a1..be43438f3 100644 --- a/src/budb/struct_ops.c +++ b/src/budb/struct_ops.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/budb/struct_ops.c,v 1.1.1.5 2001/09/11 14:31:46 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/budb/struct_ops.c,v 1.7 2003/12/08 01:45:28 jaltman Exp $"); #include #ifdef AFS_NT40_ENV @@ -39,8 +40,8 @@ printDbHeader(ptr) struct DbHeader *ptr; { printf("version = %d\n", ptr->dbversion); - printf("created = %s", ctime((time_t *)&ptr->created)); - printf("cell = %s\n",ptr->cell); + printf("created = %s", ctime((time_t *) & ptr->created)); + printf("cell = %s\n", ptr->cell); printf("lastDumpId = %u\n", ptr->lastDumpId); printf("lastInstanceId = %d\n", ptr->lastInstanceId); printf("lastTapeId = %d\n", ptr->lastTapeId); @@ -50,18 +51,18 @@ printDump(fid, dptr) FILE *fid; struct dump *dptr; { - fprintf(fid,"id = %u\n", dptr->id); - fprintf(fid,"idHashChain = %d\n", dptr->idHashChain); - fprintf(fid,"name = %s\n", dptr->dumpName); - fprintf(fid,"vsname = %s\n", dptr->volumeSet); - fprintf(fid,"dumpPath = %s\n", dptr->dumpPath); - fprintf(fid,"nameHashChain = %d\n", dptr->nameHashChain); - fprintf(fid,"flags = 0x%x\n", dptr->flags); - fprintf(fid,"parent = %u\n", dptr->parent); - fprintf(fid,"created = %s", ctime((time_t *)&dptr->created)); - fprintf(fid,"nVolumes = %d\n", dptr->nVolumes); + fprintf(fid, "id = %u\n", dptr->id); + fprintf(fid, "idHashChain = %d\n", dptr->idHashChain); + fprintf(fid, "name = %s\n", dptr->dumpName); + fprintf(fid, "vsname = %s\n", dptr->volumeSet); + fprintf(fid, "dumpPath = %s\n", dptr->dumpPath); + fprintf(fid, "nameHashChain = %d\n", dptr->nameHashChain); + fprintf(fid, "flags = 0x%x\n", dptr->flags); + fprintf(fid, "parent = %u\n", dptr->parent); + fprintf(fid, "created = %s", ctime((time_t *) & dptr->created)); + fprintf(fid, "nVolumes = %d\n", dptr->nVolumes); /* printTapeSet(&dptr->tapes); */ - fprintf(fid,"firstTape = %d\n", dptr->firstTape); + fprintf(fid, "firstTape = %d\n", dptr->firstTape); /* printKtcPrincipal(&dptr->dumper); */ } @@ -75,18 +76,25 @@ printDumpEntry(deptr) printf("parent = %u\n", deptr->parent); printf("level = %d\n", deptr->level); printf("flags = 0x%x", deptr->flags); - if (deptr->flags == 0) printf(": Successful"); - if (deptr->flags & BUDB_DUMP_INCOMPLETE) printf(": Incomplete"); - if (deptr->flags & BUDB_DUMP_TAPEERROR) printf(": Tape error"); - if (deptr->flags & BUDB_DUMP_INPROGRESS) printf(": In progress"); - if (deptr->flags & BUDB_DUMP_ABORTED) printf(": Aborted"); - if (deptr->flags & BUDB_DUMP_ADSM) printf(": (ADSM)"); /* XBSA interface to ADSM */ - if (deptr->flags & BUDB_DUMP_BUTA) printf(": (BUTA)"); /* buta dump */ - printf("\n"); + if (deptr->flags == 0) + printf(": Successful"); + if (deptr->flags & BUDB_DUMP_INCOMPLETE) + printf(": Incomplete"); + if (deptr->flags & BUDB_DUMP_TAPEERROR) + printf(": Tape error"); + if (deptr->flags & BUDB_DUMP_INPROGRESS) + printf(": In progress"); + if (deptr->flags & BUDB_DUMP_ABORTED) + printf(": Aborted"); + if (deptr->flags & BUDB_DUMP_ADSM) + printf(": (ADSM)"); /* XBSA interface to ADSM */ + if (deptr->flags & BUDB_DUMP_BUTA) + printf(": (BUTA)"); /* buta dump */ + printf("\n"); printf("volumeSet = %s\n", deptr->volumeSetName); printf("dump path = %s\n", deptr->dumpPath); printf("name = %s\n", deptr->name); - printf("created = %s", ctime((time_t *)&deptr->created)); + printf("created = %s", ctime((time_t *) & deptr->created)); printf("nVolumes = %d\n", deptr->nVolumes); printTapeSet(&deptr->tapes, (deptr->flags & BUDB_DUMP_XBSA_NSS)); @@ -101,80 +109,95 @@ printHashTable(fid, htptr) FILE *fid; struct hashTable *htptr; { - fprintf(fid,"functionType = %d\n", htptr->functionType); - fprintf(fid,"threadOffset = %d\n", htptr->threadOffset); - fprintf(fid,"entries = %d\n", htptr->entries); - fprintf(fid,"length = %d\n", htptr->length); - fprintf(fid,"table = %d\n", htptr->table); - fprintf(fid,"progress = %d\n", htptr->progress); - fprintf(fid,"oldLength = %d\n", htptr->oldLength); - fprintf(fid,"oldTable = %d\n", htptr->oldTable); + fprintf(fid, "functionType = %d\n", htptr->functionType); + fprintf(fid, "threadOffset = %d\n", htptr->threadOffset); + fprintf(fid, "entries = %d\n", htptr->entries); + fprintf(fid, "length = %d\n", htptr->length); + fprintf(fid, "table = %d\n", htptr->table); + fprintf(fid, "progress = %d\n", htptr->progress); + fprintf(fid, "oldLength = %d\n", htptr->oldLength); + fprintf(fid, "oldTable = %d\n", htptr->oldTable); } /* printMemoryHashTable * print the hash table structure, i.e. the header structure. */ +int printMemoryHashTable(fid, mhtptr) FILE *fid; struct memoryHashTable *mhtptr; { - fprintf(fid,"threadOffset = %d\n", mhtptr->threadOffset); - fprintf(fid,"length = %d\n", mhtptr->length); - fprintf(fid,"progress = %d\n", mhtptr->progress); - fprintf(fid,"size = %d\n", mhtptr->size); - fprintf(fid,"oldsize = %d\n", mhtptr->oldSize); + fprintf(fid, "threadOffset = %d\n", mhtptr->threadOffset); + fprintf(fid, "length = %d\n", mhtptr->length); + fprintf(fid, "progress = %d\n", mhtptr->progress); + fprintf(fid, "size = %d\n", mhtptr->size); + fprintf(fid, "oldsize = %d\n", mhtptr->oldSize); + return 0; } +int printPrincipal(ptr) struct ktc_principal *ptr; { printf("name = %s\n", ptr->name); printf("instance = %s\n", ptr->instance); printf("cell = %s\n", ptr->cell); + return 0; } +int printStructDumpHeader(ptr) struct structDumpHeader *ptr; { printf("type = %d\n", ptr->type); printf("structure version = %d\n", ptr->structversion); printf("size = %d bytes\n", ptr->size); + return 0; } +int printTape(fid, tptr) FILE *fid; struct tape *tptr; { - fprintf(fid,"name = %s\n", tptr->name); - fprintf(fid,"nameHashChain = %d\n", tptr->nameHashChain); - fprintf(fid,"flags = 0x%x\n", tptr->flags); - fprintf(fid,"written = %s", ctime((time_t *)&tptr->written)); - fprintf(fid,"nMBytes = %d\n", tptr->nMBytes); - fprintf(fid,"nBytes = %d\n", tptr->nBytes); - fprintf(fid,"nFiles = %d\n", tptr->nFiles); - fprintf(fid,"nVolumes = %d\n", tptr->nVolumes); - fprintf(fid,"seq = %d\n", tptr->seq); - fprintf(fid,"dump = %d\n", tptr->dump); - fprintf(fid,"nextTape = %d\n", tptr->nextTape); - fprintf(fid,"firstVol = %d\n", tptr->firstVol); - fprintf(fid,"labelPos = %d\n", tptr->labelpos); - fprintf(fid,"useCount = %d\n", tptr->useCount); -} - + fprintf(fid, "name = %s\n", tptr->name); + fprintf(fid, "nameHashChain = %d\n", tptr->nameHashChain); + fprintf(fid, "flags = 0x%x\n", tptr->flags); + fprintf(fid, "written = %s", ctime((time_t *) & tptr->written)); + fprintf(fid, "nMBytes = %d\n", tptr->nMBytes); + fprintf(fid, "nBytes = %d\n", tptr->nBytes); + fprintf(fid, "nFiles = %d\n", tptr->nFiles); + fprintf(fid, "nVolumes = %d\n", tptr->nVolumes); + fprintf(fid, "seq = %d\n", tptr->seq); + fprintf(fid, "dump = %d\n", tptr->dump); + fprintf(fid, "nextTape = %d\n", tptr->nextTape); + fprintf(fid, "firstVol = %d\n", tptr->firstVol); + fprintf(fid, "labelPos = %d\n", tptr->labelpos); + fprintf(fid, "useCount = %d\n", tptr->useCount); + return 0; +} + +int printTapeEntry(teptr) struct budb_tapeEntry *teptr; { printf("name = %s\n", teptr->name); printf("flags = 0x%x", teptr->flags); - if (teptr->flags & BUDB_TAPE_TAPEERROR) printf(": Error"); - if (teptr->flags & BUDB_TAPE_DELETED) printf(": Deleted"); - if (teptr->flags & BUDB_TAPE_BEINGWRITTEN) printf(": In progress"); - if (teptr->flags & BUDB_TAPE_ABORTED) printf(": Aborted"); - if (teptr->flags & BUDB_TAPE_STAGED) printf(": Staged"); - if (teptr->flags & BUDB_TAPE_WRITTEN) printf(": Successful"); - printf("\n"); - printf("written = %s", ctime((time_t *)&teptr->written)); - printf("expires = %s", cTIME((time_t *)&teptr->expires)); + if (teptr->flags & BUDB_TAPE_TAPEERROR) + printf(": Error"); + if (teptr->flags & BUDB_TAPE_DELETED) + printf(": Deleted"); + if (teptr->flags & BUDB_TAPE_BEINGWRITTEN) + printf(": In progress"); + if (teptr->flags & BUDB_TAPE_ABORTED) + printf(": Aborted"); + if (teptr->flags & BUDB_TAPE_STAGED) + printf(": Staged"); + if (teptr->flags & BUDB_TAPE_WRITTEN) + printf(": Successful"); + printf("\n"); + printf("written = %s", ctime((time_t *) & teptr->written)); + printf("expires = %s", cTIME((time_t *) & teptr->expires)); printf("kBytes Tape Used = %u\n", teptr->useKBytes); printf("nMBytes Data = %d\n", teptr->nMBytes); printf("nBytes Data = %d\n", teptr->nBytes); @@ -184,80 +207,95 @@ printTapeEntry(teptr) printf("labelPos = %d\n", teptr->labelpos); printf("useCount = %d\n", teptr->useCount); printf("dump = %d\n", teptr->dump); + return 0; } +int printTapeSet(tsptr, nss) struct budb_tapeSet *tsptr; - afs_int32 nss; /* is the tapeserver name an accurate name */ + afs_int32 nss; /* is the tapeserver name an accurate name */ { - printf("Group id = %d\n",tsptr->id ); - printf("tapeServer = %s%s\n", - tsptr->tapeServer, (nss?" (single server)":"")); - printf("format = %s\n",tsptr->format); - printf("maxTapes = %d\n",tsptr->maxTapes); + printf("Group id = %d\n", tsptr->id); + printf("tapeServer = %s%s\n", tsptr->tapeServer, + (nss ? " (single server)" : "")); + printf("format = %s\n", tsptr->format); + printf("maxTapes = %d\n", tsptr->maxTapes); /* printf("a = %d\n",tsptr->a ); */ /* printf("b = %d\n",tsptr->b); */ - printf("Start Tape Seq = %d\n",tsptr->b); + printf("Start Tape Seq = %d\n", tsptr->b); + return 0; } +int printVolumeEntry(veptr) struct budb_volumeEntry *veptr; { printf("name = %s\n", veptr->name); printf("flags = 0x%x", veptr->flags); - if (veptr->flags & BUDB_VOL_TAPEERROR) printf(": Tape Error"); - if (veptr->flags & BUDB_VOL_FILEERROR) printf(": File Error"); - if (veptr->flags & BUDB_VOL_BEINGWRITTEN) printf(": In progress"); - if (veptr->flags & BUDB_VOL_FIRSTFRAG) printf(": First fragment"); - if (veptr->flags & BUDB_VOL_LASTFRAG) printf(": Last fragment"); - if (veptr->flags & BUDB_VOL_ABORTED) printf(": Aborted"); - printf("\n"); + if (veptr->flags & BUDB_VOL_TAPEERROR) + printf(": Tape Error"); + if (veptr->flags & BUDB_VOL_FILEERROR) + printf(": File Error"); + if (veptr->flags & BUDB_VOL_BEINGWRITTEN) + printf(": In progress"); + if (veptr->flags & BUDB_VOL_FIRSTFRAG) + printf(": First fragment"); + if (veptr->flags & BUDB_VOL_LASTFRAG) + printf(": Last fragment"); + if (veptr->flags & BUDB_VOL_ABORTED) + printf(": Aborted"); + printf("\n"); printf("id = %d\n", veptr->id); printf("server = %s\n", veptr->server); printf("partition = %d\n", veptr->partition); printf("tapeSeq = %d\n", veptr->tapeSeq); printf("position = %d\n", veptr->position); - printf("clone = %s", ctime((time_t *)&veptr->clone)); + printf("clone = %s", ctime((time_t *) & veptr->clone)); printf("startByte = %d\n", veptr->startByte); printf("nBytes = %d\n", veptr->nBytes); printf("seq = %d\n", veptr->seq); printf("dump = %d\n", veptr->dump); printf("tape = %s\n", veptr->tape); + return 0; } - + +int printVolFragment(fid, vfptr) FILE *fid; struct volFragment *vfptr; { - fprintf(fid,"vol = %d\n", vfptr->vol); - fprintf(fid,"sameNameChain = %d\n", vfptr->sameNameChain); - fprintf(fid,"tape = %d\n", vfptr->tape); - fprintf(fid,"sameTapeChain = %d\n", vfptr->sameTapeChain); - fprintf(fid,"position = %d\n", vfptr->position); - fprintf(fid,"clone = %s", ctime((time_t *)&vfptr->clone)); - fprintf(fid,"incTime = %s", ctime((time_t *)&vfptr->incTime)); - fprintf(fid,"startByte = %d\n", vfptr->startByte); - fprintf(fid,"nBytes = %d\n", vfptr->nBytes); - fprintf(fid,"flags = %d\n", vfptr->flags); - fprintf(fid,"sequence = %d\n", vfptr->sequence); -} - + fprintf(fid, "vol = %d\n", vfptr->vol); + fprintf(fid, "sameNameChain = %d\n", vfptr->sameNameChain); + fprintf(fid, "tape = %d\n", vfptr->tape); + fprintf(fid, "sameTapeChain = %d\n", vfptr->sameTapeChain); + fprintf(fid, "position = %d\n", vfptr->position); + fprintf(fid, "clone = %s", ctime((time_t *) & vfptr->clone)); + fprintf(fid, "incTime = %s", ctime((time_t *) & vfptr->incTime)); + fprintf(fid, "startByte = %d\n", vfptr->startByte); + fprintf(fid, "nBytes = %d\n", vfptr->nBytes); + fprintf(fid, "flags = %d\n", vfptr->flags); + fprintf(fid, "sequence = %d\n", vfptr->sequence); + return 0; +} + +int printVolInfo(fid, viptr) FILE *fid; struct volInfo *viptr; { - fprintf(fid,"name = %s\n", viptr->name); - fprintf(fid,"nameHashChain = %d\n", viptr->nameHashChain); - fprintf(fid,"id = %d\n", viptr->id); - fprintf(fid,"server = %s\n", viptr->server); - fprintf(fid,"partition = %d\n", viptr->partition); - fprintf(fid,"flags = 0x%x\n", viptr->flags); - fprintf(fid,"sameNameHead = %d\n", viptr->sameNameHead); - fprintf(fid,"sameNameChain = %d\n", viptr->sameNameChain); - fprintf(fid,"firstFragment = %d\n", viptr->firstFragment); - fprintf(fid,"nFrags = %d\n", viptr->nFrags); + fprintf(fid, "name = %s\n", viptr->name); + fprintf(fid, "nameHashChain = %d\n", viptr->nameHashChain); + fprintf(fid, "id = %d\n", viptr->id); + fprintf(fid, "server = %s\n", viptr->server); + fprintf(fid, "partition = %d\n", viptr->partition); + fprintf(fid, "flags = 0x%x\n", viptr->flags); + fprintf(fid, "sameNameHead = %d\n", viptr->sameNameHead); + fprintf(fid, "sameNameChain = %d\n", viptr->sameNameChain); + fprintf(fid, "firstFragment = %d\n", viptr->firstFragment); + fprintf(fid, "nFrags = %d\n", viptr->nFrags); + return 0; } @@ -325,7 +363,7 @@ tape_ntoh(netTapePtr, hostTapePtr) dump_ntoh(netDumpPtr, hostDumpPtr) struct dump *netDumpPtr, *hostDumpPtr; { - hostDumpPtr->id = ntohl(netDumpPtr->id); + hostDumpPtr->id = ntohl(netDumpPtr->id); hostDumpPtr->idHashChain = ntohl(netDumpPtr->idHashChain); strcpy(hostDumpPtr->dumpName, netDumpPtr->dumpName); strcpy(hostDumpPtr->dumpPath, netDumpPtr->dumpPath); @@ -381,6 +419,7 @@ principal_hton(hostptr, netptr) strcpy(netptr->name, hostptr->name); strcpy(netptr->instance, hostptr->instance); strcpy(netptr->cell, hostptr->cell); + return 0; } principal_ntoh(netptr, hostptr) @@ -389,6 +428,7 @@ principal_ntoh(netptr, hostptr) strcpy(hostptr->name, netptr->name); strcpy(hostptr->instance, netptr->instance); strcpy(hostptr->cell, netptr->cell); + return 0; } structDumpHeader_hton(hostPtr, netPtr) @@ -425,26 +465,30 @@ tapeEntry_ntoh(netptr, hostptr) hostptr->dump = ntohl(netptr->dump); } +int tapeSet_hton(hostptr, netptr) struct budb_tapeSet *hostptr, *netptr; { netptr->id = htonl(hostptr->id); - strcpy(netptr->tapeServer, hostptr->tapeServer); - strcpy(netptr->format, hostptr->format); + strcpy(netptr->tapeServer, hostptr->tapeServer); + strcpy(netptr->format, hostptr->format); netptr->maxTapes = htonl(hostptr->maxTapes); netptr->a = htonl(hostptr->a); netptr->b = htonl(hostptr->b); + return 0; } +int tapeSet_ntoh(netptr, hostptr) struct budb_tapeSet *netptr, *hostptr; { hostptr->id = ntohl(netptr->id); - strcpy(hostptr->tapeServer, netptr->tapeServer); - strcpy(hostptr->format, netptr->format); + strcpy(hostptr->tapeServer, netptr->tapeServer); + strcpy(hostptr->format, netptr->format); hostptr->maxTapes = ntohl(netptr->maxTapes); hostptr->a = ntohl(netptr->a); hostptr->b = ntohl(netptr->b); + return 0; } textBlock_hton(hostptr, netptr) @@ -468,7 +512,7 @@ textBlock_ntoh(netptr, hostptr) } textLock_hton(hostptr, netptr) - db_lockP hostptr, netptr; + db_lockP hostptr, netptr; { netptr->type = htonl(hostptr->type); netptr->lockState = htonl(hostptr->lockState); @@ -479,7 +523,7 @@ textLock_hton(hostptr, netptr) } textLock_ntoh(netptr, hostptr) - db_lockP netptr, hostptr; + db_lockP netptr, hostptr; { hostptr->type = ntohl(netptr->type); hostptr->lockState = ntohl(netptr->lockState); @@ -499,7 +543,7 @@ volumeEntry_ntoh(netptr, hostptr) hostptr->partition = ntohl(netptr->partition); hostptr->tapeSeq = ntohl(netptr->tapeSeq); - hostptr->position = ntohl(netptr->position); + hostptr->position = ntohl(netptr->position); hostptr->clone = ntohl(netptr->clone); hostptr->incTime = ntohl(netptr->incTime); hostptr->startByte = ntohl(netptr->startByte); @@ -548,8 +592,9 @@ dumpToBudbDump(dumpPtr, budbDumpPtr) budbDumpPtr->nVolumes = dumpPtr->nVolumes; memcpy(&budbDumpPtr->tapes, &dumpPtr->tapes, sizeof(struct budb_tapeSet)); - copy_ktcPrincipal_to_budbPrincipal(&dumpPtr->dumper, &budbDumpPtr->dumper); - return(0); + copy_ktcPrincipal_to_budbPrincipal(&dumpPtr->dumper, + &budbDumpPtr->dumper); + return (0); } tapeToBudbTape(tapePtr, budbTapePtr) @@ -568,7 +613,7 @@ tapeToBudbTape(tapePtr, budbTapePtr) budbTapePtr->labelpos = tapePtr->labelpos; budbTapePtr->useCount = tapePtr->useCount; budbTapePtr->useKBytes = tapePtr->useKBytes; - return(0); + return (0); } volsToBudbVol(volFragPtr, volInfoPtr, budbVolPtr) @@ -581,7 +626,7 @@ volsToBudbVol(volFragPtr, volInfoPtr, budbVolPtr) budbVolPtr->id = volInfoPtr->id; strcpy(budbVolPtr->server, volInfoPtr->server); budbVolPtr->partition = volInfoPtr->partition; - budbVolPtr->tapeSeq = 0; /* Don't know it so mark invalid */ + budbVolPtr->tapeSeq = 0; /* Don't know it so mark invalid */ budbVolPtr->position = volFragPtr->position; budbVolPtr->clone = volFragPtr->clone; @@ -589,7 +634,7 @@ volsToBudbVol(volFragPtr, volInfoPtr, budbVolPtr) budbVolPtr->startByte = volFragPtr->startByte; budbVolPtr->nBytes = volFragPtr->nBytes; budbVolPtr->seq = volFragPtr->sequence; - return(0); + return (0); } /* ---------------------------------- diff --git a/src/butc/Makefile.in b/src/butc/Makefile.in index b4316e81f..d7bc516a6 100644 --- a/src/butc/Makefile.in +++ b/src/butc/Makefile.in @@ -7,33 +7,8 @@ # # Portions Copyright (c) 2003 Apple Computer, Inc. -DEST=@DEST@ -TOP_INCDIR=@TOP_INCDIR@ -TOP_LIBDIR=@TOP_LIBDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -libdir=@libdir@ -includedir=@includedir@ -mandir=@mandir@ -afssrvbindir=@afssrvbindir@ -afssrvsbindir=@afssrvsbindir@ -afssrvlibexecdir=@afssrvlibexecdir@ -COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et -RXGEN=${TOP_SRCDIR}/rxgen/rxgen -TOP_SRCDIR=@TOP_SRCDIR@ -SYS_NAME=@AFS_SYSNAME@ - -SHELL = /bin/sh - -include ../config/Makefile.${SYS_NAME} - -CFLAGS=${DBG} -w ${INCDIRS} ${XCFLAGS} @XBSA_CFLAGS@ - -INCDIRS=-I${TOP_SRCDIR}/config -I${TOP_INCDIR}/afs \ - -I${TOP_INCDIR}/rx -I${TOP_INCDIR} +srcdir=@srcdir@ +include @TOP_OBJDIR@/src/config/Makefile.config INCLS=${TOP_INCDIR}/afs/partition.h ${TOP_INCDIR}/afs/volume.h \ ${TOP_INCDIR}/afs/vlserver.h ${TOP_INCDIR}/rx/rx.h \ @@ -80,7 +55,7 @@ butc_test: ${TESTOBJS} ${LIBS} ${INCLS} ${HACKS} ${CC} ${CFLAGS} ${TESTOBJS} ${LIBS} ${XLIBS} -o butc_test tdump: tdump.c AFS_component_version_number.c - ${CC} ${CFLAGS} tdump.c -o tdump + ${CC} ${CFLAGS} ${srcdir}/tdump.c -o tdump butc: ${SOBJS} ${LIBS} ${INCLS} ${HACKS} @case ${SYS_NAME} in \ @@ -100,7 +75,7 @@ dump.o: dump.c ${INCLS} tcstatus.o: tcstatus.c ${INCLS} read_tape: read_tape.c - ${CC} ${CFLAGS} -o read_tape read_tape.c \ + ${CC} ${CFLAGS} -o read_tape ${srcdir}/read_tape.c \ ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a \ ${TOP_LIBDIR}/libusd.a @@ -109,11 +84,11 @@ clean: install: @case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*|rs_aix4*|*linux*|hp_ux*) \ + alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix4*|*linux*|hp_ux*) \ echo "Don't install butc for ${SYS_NAME} (will install from tbutc)" ;; \ *_darwin_[1-6][0-9]) \ - echo ${INSTALL} butc ${DESTDIR}${sbindir}/butc ; \ - ${INSTALL} butc ${DESTDIR}${sbindir}/butc ;; \ + echo ${INSTALL} butc ${DEST}/etc/butc ; \ + ${INSTALL} butc ${DEST}/etc/butc ;; \ *_darwin_*) \ echo "Don't install butc for ${SYS_NAME} (will install from tbutc)" ;; \ *) \ @@ -125,11 +100,11 @@ install: include ../config/Makefile.version dest: @case ${SYS_NAME} in \ - alpha_dux*|sgi_*|sun*|rs_aix4*|*linux*|hp_ux*) \ + alpha_dux*|sgi_*|sun4x_*|sunx86_*|rs_aix4*|*linux*|hp_ux*) \ echo "Don't install butc for ${SYS_NAME} (will install from tbutc)" ;; \ *_darwin_[1-6][0-9]) \ - echo ${INSTALL} butc ${DEST}/etc/butc ; \ - ${INSTALL} butc ${DEST}/etc/butc ;; \ + echo ${INSTALL} butc ${DESTDIR}${sbindir}/butc ; \ + ${INSTALL} butc ${DESTDIR}${sbindir}/butc ;; \ *_darwin_*) \ echo "Don't install butc for ${SYS_NAME} (will install from tbutc)" ;; \ *) \ diff --git a/src/butc/NTMakefile b/src/butc/NTMakefile index 9c87cf826..5f466a25f 100644 --- a/src/butc/NTMakefile +++ b/src/butc/NTMakefile @@ -5,26 +5,26 @@ # License. For details, see the LICENSE file in the top-level source # directory or online at http://www.openafs.org/dl/license10.html +RELDIR=butc !INCLUDE ..\config\NTMakefile.$(SYS_NAME) !INCLUDE ..\config\NTMakefile.version - ############################################################################ # build butc EXEFILE = $(DESTDIR)\etc\butc.exe EXEOBJS =\ - dbentries.obj \ - tcprocs.obj \ - lwps.obj \ - list.obj \ - recoverDb.obj \ - tcudbprocs.obj \ - dump.obj \ - tcstatus.obj \ - tcmain.obj \ - butc.res + $(OUT)\dbentries.obj \ + $(OUT)\tcprocs.obj \ + $(OUT)\lwps.obj \ + $(OUT)\list.obj \ + $(OUT)\recoverDb.obj \ + $(OUT)\tcudbprocs.obj \ + $(OUT)\dump.obj \ + $(OUT)\tcstatus.obj \ + $(OUT)\tcmain.obj \ + $(OUT)\butc.res EXELIBS =\ $(DESTDIR)\lib\afs\afsbudb.lib \ @@ -59,8 +59,7 @@ $(EXEFILE): $(EXEOBJS) $(EXELIBS) ############################################################################ # Definitions for generating versioninfo resources -butc.res: butc.rc AFS_component_version_number.h - $(RC) $*.rc +$(OUT)\butc.res: AFS_component_version_number.h ############################################################################ # Install target; primary makefile target @@ -76,5 +75,8 @@ clean:: ############################################################################ # Auxiliary build targets not built by default; e.g. test programs -butc_test.exe: test.obj +$(OUT)\butc_test.exe: $(OUT)\test.obj $(EXECONLINK) + +mkdir: + diff --git a/src/butc/butc_xbsa.c b/src/butc/butc_xbsa.c index 44e95b03d..2b6d2f00a 100644 --- a/src/butc/butc_xbsa.c +++ b/src/butc/butc_xbsa.c @@ -12,7 +12,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/butc/butc_xbsa.c,v 1.1.1.4 2001/07/14 22:21:03 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/butc/butc_xbsa.c,v 1.6 2003/12/07 22:49:21 jaltman Exp $"); #include #include @@ -24,74 +25,80 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/butc/butc_xbsa.c,v 1.1.1.4 2001/07/14 2 #include "butc_xbsa.h" #include +#include "error_macros.h" + extern int debugLevel; char resourceType[20] = "LFS FILE SYSTEM"; #define GOODSTR(s) ((s)?(s):"") -BSA_Int16 (*XBSAInit)(BSA_UInt32 *, SecurityToken *, ObjectOwner *, char **); -BSA_Int16 (*XBSABeginTxn)(BSA_UInt32); -BSA_Int16 (*XBSAEndTxn)(BSA_UInt32, Vote); -BSA_Int16 (*XBSATerminate)(BSA_UInt32); -BSA_Int16 (*XBSAQueryObject)(BSA_UInt32, QueryDescriptor *, ObjectDescriptor *); -BSA_Int16 (*XBSAGetObject)(BSA_UInt32, ObjectDescriptor *, DataBlock *); -BSA_Int16 (*XBSAEndData)(BSA_UInt32); -BSA_Int16 (*XBSACreateObject)(BSA_UInt32, ObjectDescriptor *, DataBlock *); -BSA_Int16 (*XBSADeleteObject)(BSA_UInt32, CopyType, ObjectName *, CopyId *); -BSA_Int16 (*XBSAMarkObjectInactive)(BSA_UInt32, ObjectName *); -BSA_Int16 (*XBSASendData)(BSA_UInt32, DataBlock *); -BSA_Int16 (*XBSAGetData)(BSA_UInt32, DataBlock *); -BSA_Int16 (*XBSAQueryApiVersion)(ApiVersion *); -BSA_Int16 (*XBSAGetEnvironment)(BSA_UInt32, ObjectOwner *, char **); +BSA_Int16(*XBSAInit) (BSA_UInt32 *, SecurityToken *, ObjectOwner *, char **); +BSA_Int16(*XBSABeginTxn) (BSA_UInt32); +BSA_Int16(*XBSAEndTxn) (BSA_UInt32, Vote); +BSA_Int16(*XBSATerminate) (BSA_UInt32); +BSA_Int16(*XBSAQueryObject) (BSA_UInt32, QueryDescriptor *, + ObjectDescriptor *); +BSA_Int16(*XBSAGetObject) (BSA_UInt32, ObjectDescriptor *, DataBlock *); +BSA_Int16(*XBSAEndData) (BSA_UInt32); +BSA_Int16(*XBSACreateObject) (BSA_UInt32, ObjectDescriptor *, DataBlock *); +BSA_Int16(*XBSADeleteObject) (BSA_UInt32, CopyType, ObjectName *, CopyId *); +BSA_Int16(*XBSAMarkObjectInactive) (BSA_UInt32, ObjectName *); +BSA_Int16(*XBSASendData) (BSA_UInt32, DataBlock *); +BSA_Int16(*XBSAGetData) (BSA_UInt32, DataBlock *); +BSA_Int16(*XBSAQueryApiVersion) (ApiVersion *); +BSA_Int16(*XBSAGetEnvironment) (BSA_UInt32, ObjectOwner *, char **); xbsa_error(int rc, struct butx_transactionInfo *info) { switch (rc) { - case BSA_RC_AUTHENTICATION_FAILURE : - ELog(0," XBSA: Authentication failure\n"); + case BSA_RC_AUTHENTICATION_FAILURE: + ELog(0, " XBSA: Authentication failure\n"); break; - case BSA_RC_INVALID_KEYWORD : - ELog(0," XBSA: A specified keyword is invalid\n"); + case BSA_RC_INVALID_KEYWORD: + ELog(0, " XBSA: A specified keyword is invalid\n"); break; - case BSA_RC_TOKEN_EXPIRED : - ELog(0," XBSA: The security token has expired\n"); + case BSA_RC_TOKEN_EXPIRED: + ELog(0, " XBSA: The security token has expired\n"); break; - case ADSM_RC_PSWD_GEN : - if (XBSA_GET_SERVER_TYPE(info->serverType) == XBSA_SERVER_TYPE_ADSM) { - ELog(0," XBSA: Password generation is not supported\n"); + case ADSM_RC_PSWD_GEN: + if (XBSA_GET_SERVER_TYPE(info->serverType) == XBSA_SERVER_TYPE_ADSM) { + ELog(0, " XBSA: Password generation is not supported\n"); } break; - case BSA_RC_BAD_HANDLE : - ELog(0," XBSA: The handle is invalid, %d\n", info->bsaHandle); + case BSA_RC_BAD_HANDLE: + ELog(0, " XBSA: The handle is invalid, %d\n", info->bsaHandle); break; - case BSA_RC_NO_MATCH : - ELog(0," XBSA: There were no matches found for the specified object\n"); + case BSA_RC_NO_MATCH: + ELog(0, + " XBSA: There were no matches found for the specified object\n"); break; - case BSA_RC_MORE_DATA : - ELog(0," XBSA: There were more matches found than expected\n"); + case BSA_RC_MORE_DATA: + ELog(0, " XBSA: There were more matches found than expected\n"); break; - case BSA_RC_NULL_OBJNAME : - ELog(0," XBSA: The object name is null\n"); + case BSA_RC_NULL_OBJNAME: + ELog(0, " XBSA: The object name is null\n"); break; - case BSA_RC_OBJNAME_TOO_LONG : - ELog(0," XBSA: The object name was longer than expected\n"); + case BSA_RC_OBJNAME_TOO_LONG: + ELog(0, " XBSA: The object name was longer than expected\n"); break; - case BSA_RC_DESC_TOO_LONG : - ELog(0," XBSA: The description string was longer than expected\n"); + case BSA_RC_DESC_TOO_LONG: + ELog(0, + " XBSA: The description string was longer than expected\n"); break; - case BSA_RC_OBJINFO_TOO_LONG : - ELog(0," XBSA: The object info string was longer than expected\n"); + case BSA_RC_OBJINFO_TOO_LONG: + ELog(0, + " XBSA: The object info string was longer than expected\n"); break; - case BSA_RC_ABORT_ACTIVE_NOT_FOUND : - ELog(0," XBSA: The specified object was not found\n"); + case BSA_RC_ABORT_ACTIVE_NOT_FOUND: + ELog(0, " XBSA: The specified object was not found\n"); break; - case BSA_RC_NULL_DATABLKPTR : - ELog(0," XBSA: The dataBlockPtr is null\n"); + case BSA_RC_NULL_DATABLKPTR: + ELog(0, " XBSA: The dataBlockPtr is null\n"); break; - case BSA_RC_INVALID_VOTE : - ELog(0," XBSA: The vote variable is invalid\n"); + case BSA_RC_INVALID_VOTE: + ELog(0, " XBSA: The vote variable is invalid\n"); break; } } @@ -102,21 +109,26 @@ xbsa_error(int rc, struct butx_transactionInfo *info) * Get the library version. * XBSAQueryApiVersion */ -afs_int32 xbsa_MountLibrary(struct butx_transactionInfo *info, afs_int32 serverType) +afs_int32 +xbsa_MountLibrary(struct butx_transactionInfo *info, afs_int32 serverType) { void *dynlib; int rc; if (debugLevel > 98) { - printf("\nxbsa_MountLibraray\n"); + printf("\nxbsa_MountLibraray\n"); } switch (serverType) { - case XBSA_SERVER_TYPE_ADSM : + case XBSA_SERVER_TYPE_ADSM: #if defined(AFS_AIX_ENV) - dynlib = dlopen("/usr/lib/libXApi.a(bsashr10.o)", RTLD_NOW | RTLD_LOCAL | RTLD_MEMBER); + dynlib = + dlopen("/usr/lib/libXApi.a(bsashr10.o)", + RTLD_NOW | RTLD_LOCAL | RTLD_MEMBER); if (dynlib == NULL) { - dynlib = dlopen("/usr/lib/libXApi.a(xbsa.o)", RTLD_NOW | RTLD_LOCAL | RTLD_MEMBER); + dynlib = + dlopen("/usr/lib/libXApi.a(xbsa.o)", + RTLD_NOW | RTLD_LOCAL | RTLD_MEMBER); } #elif defined(AFS_SUN5_ENV) dynlib = dlopen("/usr/lib/libXApi.so", RTLD_NOW | RTLD_LOCAL); @@ -124,43 +136,71 @@ afs_int32 xbsa_MountLibrary(struct butx_transactionInfo *info, afs_int32 serverT dynlib = NULL; #endif break; - default : - ELog(0,"xbsa_MountLibrary: The serverType %d is not recognized\n", serverType); - return(BUTX_INVALIDSERVERTYPE); + default: + ELog(0, "xbsa_MountLibrary: The serverType %d is not recognized\n", + serverType); + return (BUTX_INVALIDSERVERTYPE); break; } if (dynlib == NULL) { - ELog(0,"xbsa_MountLibrary: The dlopen call to load the XBSA shared library failed\n"); - return(BUTX_NOLIBRARY); + ELog(0, + "xbsa_MountLibrary: The dlopen call to load the XBSA shared library failed\n"); + return (BUTX_NOLIBRARY); } memset(info, 0, sizeof(struct butx_transactionInfo)); XBSA_SET_SERVER_TYPE(info->serverType, serverType); #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) - XBSAInit = (BSA_Int16(*)(BSA_UInt32 *, SecurityToken *, ObjectOwner *, char **))dlsym((void *)dynlib, "BSAInit"); - XBSABeginTxn = (BSA_Int16(*)(BSA_UInt32))dlsym((void *)dynlib, "BSABeginTxn"); - XBSAEndTxn = (BSA_Int16(*)(BSA_UInt32, Vote))dlsym((void *)dynlib, "BSAEndTxn"); - XBSATerminate = (BSA_Int16(*)(BSA_UInt32))dlsym((void *)dynlib, "BSATerminate"); - XBSAQueryObject = (BSA_Int16(*)(BSA_UInt32, QueryDescriptor *, ObjectDescriptor *))dlsym((void *)dynlib, "BSAQueryObject"); - XBSAGetObject = (BSA_Int16(*)(BSA_UInt32, ObjectDescriptor *, DataBlock *))dlsym((void *)dynlib, "BSAGetObject"); - XBSAEndData = (BSA_Int16(*)(BSA_UInt32))dlsym((void *)dynlib, "BSAEndData"); - XBSACreateObject = (BSA_Int16(*)(BSA_UInt32, ObjectDescriptor *, DataBlock *))dlsym((void *)dynlib, "BSACreateObject"); - XBSAMarkObjectInactive = (BSA_Int16(*)(BSA_UInt32, ObjectName *))dlsym((void *)dynlib, "BSAMarkObjectInactive"); - XBSADeleteObject = (BSA_Int16(*)(BSA_UInt32, CopyType, ObjectName *, CopyId *))dlsym((void *)dynlib, "BSADeleteObject"); - XBSASendData = (BSA_Int16(*)(BSA_UInt32, DataBlock *))dlsym((void *)dynlib, "BSASendData"); - XBSAGetData = (BSA_Int16(*)(BSA_UInt32, DataBlock *))dlsym((void *)dynlib, "BSAGetData"); - XBSAQueryApiVersion = (BSA_Int16(*)(ApiVersion *))dlsym((void *)dynlib, "BSAQueryApiVersion"); - XBSAGetEnvironment = (BSA_Int16(*)(BSA_UInt32, ObjectOwner *, char **))dlsym((void *)dynlib, "BSAGetEnvironment"); - - if (!XBSAInit || !XBSABeginTxn || !XBSAEndTxn || !XBSATerminate || - !XBSAQueryObject || !XBSAGetObject || !XBSAEndData || - !XBSACreateObject || !XBSADeleteObject || !XBSAMarkObjectInactive || - !XBSASendData || !XBSAGetData || !XBSAQueryApiVersion || - !XBSAGetEnvironment) { - ELog(0,"xbsa_MountLibrary: The dlopen call to load the XBSA shared library failed\n"); - return(BUTX_NOLIBRARY); + XBSAInit = (BSA_Int16(*) + (BSA_UInt32 *, SecurityToken *, ObjectOwner *, + char **))dlsym((void *)dynlib, "BSAInit"); + XBSABeginTxn = + (BSA_Int16(*)(BSA_UInt32)) dlsym((void *)dynlib, "BSABeginTxn"); + XBSAEndTxn = + (BSA_Int16(*)(BSA_UInt32, Vote)) dlsym((void *)dynlib, "BSAEndTxn"); + XBSATerminate = + (BSA_Int16(*)(BSA_UInt32)) dlsym((void *)dynlib, "BSATerminate"); + XBSAQueryObject = + (BSA_Int16(*)(BSA_UInt32, QueryDescriptor *, ObjectDescriptor *)) + dlsym((void *)dynlib, "BSAQueryObject"); + XBSAGetObject = + (BSA_Int16(*)(BSA_UInt32, ObjectDescriptor *, DataBlock *)) + dlsym((void *)dynlib, "BSAGetObject"); + XBSAEndData = + (BSA_Int16(*)(BSA_UInt32)) dlsym((void *)dynlib, "BSAEndData"); + XBSACreateObject = + (BSA_Int16(*)(BSA_UInt32, ObjectDescriptor *, DataBlock *)) + dlsym((void *)dynlib, "BSACreateObject"); + XBSAMarkObjectInactive = + (BSA_Int16(*)(BSA_UInt32, ObjectName *)) dlsym((void *)dynlib, + "BSAMarkObjectInactive"); + XBSADeleteObject = + (BSA_Int16(*)(BSA_UInt32, CopyType, ObjectName *, CopyId *)) + dlsym((void *)dynlib, "BSADeleteObject"); + XBSASendData = + (BSA_Int16(*)(BSA_UInt32, DataBlock *)) dlsym((void *)dynlib, + "BSASendData"); + XBSAGetData = + (BSA_Int16(*)(BSA_UInt32, DataBlock *)) dlsym((void *)dynlib, + "BSAGetData"); + XBSAQueryApiVersion = + (BSA_Int16(*)(ApiVersion *)) dlsym((void *)dynlib, + "BSAQueryApiVersion"); + XBSAGetEnvironment = + (BSA_Int16(*)(BSA_UInt32, ObjectOwner *, char **))dlsym((void *) + dynlib, + "BSAGetEnvironment"); + + if (!XBSAInit || !XBSABeginTxn || !XBSAEndTxn || !XBSATerminate + || !XBSAQueryObject || !XBSAGetObject || !XBSAEndData + || !XBSACreateObject || !XBSADeleteObject || !XBSAMarkObjectInactive + || !XBSASendData || !XBSAGetData || !XBSAQueryApiVersion + || !XBSAGetEnvironment) { + ELog(0, + "xbsa_MountLibrary: The dlopen call to load the XBSA shared library failed\n"); + return (BUTX_NOLIBRARY); } XBSAQueryApiVersion(&(info->apiVersion)); @@ -169,26 +209,28 @@ afs_int32 xbsa_MountLibrary(struct butx_transactionInfo *info, afs_int32 serverT /* * Verify the API version */ - if ((info->apiVersion.version == XBSA_TS_VERSION) && - (info->apiVersion.release == XBSA_TS_RELEASE)) { + if ((info->apiVersion.version == XBSA_TS_VERSION) + && (info->apiVersion.release == XBSA_TS_RELEASE)) { /* XOPEN Techincal Standard Level! * We are coded to the Preliminary Spec! Time to go boom! */ - ELog(0,"xbsa_MountLibrary: The XBSAQueryApiVersion call returned an incompatible version, %d %d %d\n", - info->apiVersion.version, info->apiVersion.release, info->apiVersion.level); - return(BUTX_INVALIDVERSION); + ELog(0, + "xbsa_MountLibrary: The XBSAQueryApiVersion call returned an incompatible version, %d %d %d\n", + info->apiVersion.version, info->apiVersion.release, + info->apiVersion.level); + return (BUTX_INVALIDVERSION); } switch (XBSA_GET_SERVER_TYPE(info->serverType)) { - case XBSA_SERVER_TYPE_ADSM : - if ((info->apiVersion.version > XBSA_ADSM_NO_MULT_SERVER_VERSION) || - - (info->apiVersion.version == XBSA_ADSM_NO_MULT_SERVER_VERSION && - info->apiVersion.release > XBSA_ADSM_NO_MULT_SERVER_RELEASE) || - - (info->apiVersion.version == XBSA_ADSM_NO_MULT_SERVER_VERSION && - info->apiVersion.release == XBSA_ADSM_NO_MULT_SERVER_RELEASE && - info->apiVersion.level > XBSA_ADSM_NO_MULT_SERVER_LEVEL)) { + case XBSA_SERVER_TYPE_ADSM: + if ((info->apiVersion.version > XBSA_ADSM_NO_MULT_SERVER_VERSION) + || (info->apiVersion.version == XBSA_ADSM_NO_MULT_SERVER_VERSION + && info->apiVersion.release > + XBSA_ADSM_NO_MULT_SERVER_RELEASE) + || (info->apiVersion.version == XBSA_ADSM_NO_MULT_SERVER_VERSION + && info->apiVersion.release == + XBSA_ADSM_NO_MULT_SERVER_RELEASE + && info->apiVersion.level > XBSA_ADSM_NO_MULT_SERVER_LEVEL)) { /* This version contains the fixes to allow multiple servers */ info->serverType |= XBSA_SERVER_FLAG_MULTIPLE; @@ -201,8 +243,8 @@ afs_int32 xbsa_MountLibrary(struct butx_transactionInfo *info, afs_int32 serverT break; } - return(XBSA_SUCCESS); - + return (XBSA_SUCCESS); + } /* @@ -210,9 +252,9 @@ afs_int32 xbsa_MountLibrary(struct butx_transactionInfo *info, afs_int32 serverT * BSAInit * BSAGetEnvironment */ -afs_int32 xbsa_Initialize(struct butx_transactionInfo *info, - char *bsaObjectOwner, char *appObjectOwner, - char *secToken, char *serverName) +afs_int32 +xbsa_Initialize(struct butx_transactionInfo * info, char *bsaObjectOwner, + char *appObjectOwner, char *secToken, char *serverName) { char envStrs[XBSA_NUM_ENV_STRS][BSA_MAX_DESC]; char *envP[XBSA_NUM_ENV_STRS + 1]; @@ -223,15 +265,16 @@ afs_int32 xbsa_Initialize(struct butx_transactionInfo *info, int rc; if (debugLevel > 98) { - printf("\nxbsa_Initialize bsaObjectOwner='%s' appObjectOwner='%s' " - "secToken=xxxxxx servername='%s'\n", - GOODSTR(bsaObjectOwner), GOODSTR(appObjectOwner), GOODSTR(serverName)); + printf("\nxbsa_Initialize bsaObjectOwner='%s' appObjectOwner='%s' " + "secToken=xxxxxx servername='%s'\n", GOODSTR(bsaObjectOwner), + GOODSTR(appObjectOwner), GOODSTR(serverName)); } if (info->bsaHandle != 0) { /* We already have a handle */ - ELog(0,"xbsa_Initialize: The dlopen call to load the XBSA shared library failed\n"); - return(BUTX_ILLEGALINIT); + ELog(0, + "xbsa_Initialize: The dlopen call to load the XBSA shared library failed\n"); + return (BUTX_ILLEGALINIT); } /* @@ -243,41 +286,44 @@ afs_int32 xbsa_Initialize(struct butx_transactionInfo *info, */ /* Initialize the environment strings */ - for (i=0; iserverType)) { - case XBSA_SERVER_TYPE_ADSM : + case XBSA_SERVER_TYPE_ADSM: if (serverName) { if (strlen(serverName) >= BSA_MAX_DESC) { - ELog(0,"xbsa_Initialize: The serverName was not specified\n"); - return(BUTX_INVALIDSERVERNAME); + ELog(0, + "xbsa_Initialize: The serverName was not specified\n"); + return (BUTX_INVALIDSERVERNAME); } strcpy(info->serverName, serverName); strcpy(envP[0], ADSMServer); - tempStrPtr=envP[0]; - tempStrPtr=tempStrPtr + strlen(ADSMServer); + tempStrPtr = envP[0]; + tempStrPtr = tempStrPtr + strlen(ADSMServer); strcat(tempStrPtr, serverName); envP[1] = NULL; } else { envP[0] = NULL; - ELog(0,"xbsa_Initialize: The serverName was not specified\n"); - return(BUTX_INVALIDSERVERNAME); + ELog(0, "xbsa_Initialize: The serverName was not specified\n"); + return (BUTX_INVALIDSERVERNAME); } break; - default : - ELog(0,"xbsa_Initialize: The serverType %d is not recognized\n", XBSA_GET_SERVER_TYPE(info->serverType)); - return(BUTX_INVALIDSERVERTYPE); + default: + ELog(0, "xbsa_Initialize: The serverType %d is not recognized\n", + XBSA_GET_SERVER_TYPE(info->serverType)); + return (BUTX_INVALIDSERVERTYPE); break; } if (bsaObjectOwner) { if (strlen(bsaObjectOwner) >= BSA_MAX_BSAOBJECT_OWNER) { - ELog(0,"xbsa_Initialize: The bsaObjectOwner is too long; size = %d; name = %s\n", + ELog(0, + "xbsa_Initialize: The bsaObjectOwner is too long; size = %d; name = %s\n", strlen(bsaObjectOwner), bsaObjectOwner); - return(BUTX_INVALIDBSANAME); + return (BUTX_INVALIDBSANAME); } strcpy(info->objOwner.bsaObjectOwner, bsaObjectOwner); } else { @@ -286,9 +332,10 @@ afs_int32 xbsa_Initialize(struct butx_transactionInfo *info, if (appObjectOwner) { if (strlen(appObjectOwner) >= BSA_MAX_APPOBJECT_OWNER) { - ELog(0,"xbsa_Initialize: The appObjectOwner is too long; size = %d; name = %s\n", + ELog(0, + "xbsa_Initialize: The appObjectOwner is too long; size = %d; name = %s\n", strlen(appObjectOwner), appObjectOwner); - return(BUTX_INVALIDAPPNAME); + return (BUTX_INVALIDAPPNAME); } strcpy(info->objOwner.appObjectOwner, appObjectOwner); } else { @@ -297,119 +344,132 @@ afs_int32 xbsa_Initialize(struct butx_transactionInfo *info, if (secToken) { if (strlen(secToken) >= BSA_MAX_TOKEN_SIZE) { - ELog(0,"xbsa_Initialize: The secToken is too long; size = %d; name = %s\n", + ELog(0, + "xbsa_Initialize: The secToken is too long; size = %d; name = %s\n", strlen(secToken), secToken); - return(BUTX_INVALIDSECTOKEN); + return (BUTX_INVALIDSECTOKEN); } strcpy(info->secToken, secToken); } else { info->secToken[0] = NULL; } - rc = (int)XBSAInit(&(info->bsaHandle), &(info->secToken), &(info->objOwner), envP); + rc = (int)XBSAInit(&(info->bsaHandle), &(info->secToken), + &(info->objOwner), envP); if (rc != BSA_RC_SUCCESS) { - ELog(0,"xbsa_Initialize: The XBSAInit call failed with %d\n", rc); + ELog(0, "xbsa_Initialize: The XBSAInit call failed with %d\n", rc); xbsa_error(rc, info); - return(BUTX_INITFAIL); + return (BUTX_INITFAIL); } /* Initialize the environment strings */ - for (i=0; ibsaHandle, &info->objOwner, envP); if (rc != BSA_RC_SUCCESS) { - ELog(0,"xbsa_Initialize: The XBSAGetEnvironment call failed with %d\n", rc); + ELog(0, + "xbsa_Initialize: The XBSAGetEnvironment call failed with %d\n", + rc); xbsa_error(rc, info); - return(BUTX_GETENVFAIL); + return (BUTX_GETENVFAIL); } switch (XBSA_GET_SERVER_TYPE(info->serverType)) { - case XBSA_SERVER_TYPE_ADSM : - for (i=0; imaxObjects = strtol(tempStrPtr,NULL,10); + tempStrPtr = envP[i]; + tempStrPtr = tempStrPtr + strlen(ADSMMaxObject); + info->maxObjects = strtol(tempStrPtr, NULL, 10); if (info->maxObjects <= 0) { - ELog(0,"xbsa_Initialize: The XBSAGetEnvironment call returned an invalid value for MAXOBJ %d\n", + ELog(0, + "xbsa_Initialize: The XBSAGetEnvironment call returned an invalid value for MAXOBJ %d\n", info->maxObjects); - return(BUTX_GETENVFAIL); + return (BUTX_GETENVFAIL); } - } + } } if (info->maxObjects == 0) { - ELog(0,"xbsa_Initialize: The XBSAGetEnvironment call failed to return the MAXOBJ string\n"); - return(BUTX_GETENVFAIL); + ELog(0, + "xbsa_Initialize: The XBSAGetEnvironment call failed to return the MAXOBJ string\n"); + return (BUTX_GETENVFAIL); } - break; + break; } - return(XBSA_SUCCESS); + return (XBSA_SUCCESS); } /* * Create a transaction * BSABeginTxn */ -afs_int32 xbsa_BeginTrans(struct butx_transactionInfo *info) +afs_int32 +xbsa_BeginTrans(struct butx_transactionInfo * info) { int rc; if (debugLevel > 98) { - printf("\nxbsa_BeginTrans\n"); - printf("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", - GOODSTR(info->serverName), GOODSTR(info->objOwner.bsaObjectOwner), - GOODSTR(info->objOwner.appObjectOwner)); + printf("\nxbsa_BeginTrans\n"); + printf + ("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", + GOODSTR(info->serverName), + GOODSTR(info->objOwner.bsaObjectOwner), + GOODSTR(info->objOwner.appObjectOwner)); } if (info->bsaHandle == 0) { /* We haven't initialized yet! */ - ELog(0,"xbsa_BeginTrans: No current handle, butx not initialized\n"); - return(BUTX_NOHANDLE); + ELog(0, "xbsa_BeginTrans: No current handle, butx not initialized\n"); + return (BUTX_NOHANDLE); } rc = (int)XBSABeginTxn(info->bsaHandle); if (rc != BSA_RC_SUCCESS) { - ELog(0,"xbsa_BeginTrans: The XBSABeginTxn call failed with %d\n", rc); + ELog(0, "xbsa_BeginTrans: The XBSABeginTxn call failed with %d\n", + rc); xbsa_error(rc, info); - return(BUTX_BEGINTXNFAIL); + return (BUTX_BEGINTXNFAIL); } info->numObjects = 0; - return(XBSA_SUCCESS); + return (XBSA_SUCCESS); } /* * End the current transaction * BSAEndTxn */ -afs_int32 xbsa_EndTrans(struct butx_transactionInfo *info) +afs_int32 +xbsa_EndTrans(struct butx_transactionInfo * info) { int rc; if (debugLevel > 98) { - printf("\nxbsa_EndTrans\n"); - printf("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", - GOODSTR(info->serverName), GOODSTR(info->objOwner.bsaObjectOwner), - GOODSTR(info->objOwner.appObjectOwner)); + printf("\nxbsa_EndTrans\n"); + printf + ("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", + GOODSTR(info->serverName), + GOODSTR(info->objOwner.bsaObjectOwner), + GOODSTR(info->objOwner.appObjectOwner)); } if (info->bsaHandle == 0) { /* We haven't initialized yet! */ - ELog(0,"xbsa_EndTrans: No current handle, butx not initialized\n"); - return(BUTX_NOHANDLE); + ELog(0, "xbsa_EndTrans: No current handle, butx not initialized\n"); + return (BUTX_NOHANDLE); } /* terminate the transaction */ rc = (int)XBSAEndTxn(info->bsaHandle, BSAVote_COMMIT); if (rc != BSA_RC_SUCCESS) { - ELog(0,"xbsa_EndTrans: The XBSAEndTxn call failed with %d\n", rc); + ELog(0, "xbsa_EndTrans: The XBSAEndTxn call failed with %d\n", rc); xbsa_error(rc, info); - return(BUTX_ENDTXNFAIL); + return (BUTX_ENDTXNFAIL); } - return(XBSA_SUCCESS); + return (XBSA_SUCCESS); } /* @@ -417,78 +477,86 @@ afs_int32 xbsa_EndTrans(struct butx_transactionInfo *info) * End the transaction. * BSATerminate */ -afs_int32 xbsa_Finalize(struct butx_transactionInfo *info) +afs_int32 +xbsa_Finalize(struct butx_transactionInfo * info) { int rc; if (debugLevel > 98) { - printf("\nxbsa_Finalize\n"); - printf("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", - GOODSTR(info->serverName), GOODSTR(info->objOwner.bsaObjectOwner), - GOODSTR(info->objOwner.appObjectOwner)); + printf("\nxbsa_Finalize\n"); + printf + ("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", + GOODSTR(info->serverName), + GOODSTR(info->objOwner.bsaObjectOwner), + GOODSTR(info->objOwner.appObjectOwner)); } if (info->bsaHandle == 0) { /* We haven't initialized yet! */ - ELog(0,"xbsa_Finalize: No current handle, butx not initialized\n"); - return(BUTX_NOHANDLE); + ELog(0, "xbsa_Finalize: No current handle, butx not initialized\n"); + return (BUTX_NOHANDLE); } /* terminate the session */ rc = (int)XBSATerminate(info->bsaHandle); if (rc != BSA_RC_SUCCESS) { - ELog(0,"The XBSATerminate call failed with %d\n", rc); + ELog(0, "The XBSATerminate call failed with %d\n", rc); xbsa_error(rc, info); - return(BUTX_TERMFAIL); + return (BUTX_TERMFAIL); } info->bsaHandle = 0; - return(XBSA_SUCCESS); + return (XBSA_SUCCESS); } /* * Query for the object we are looking for. * BSAQueryObject */ -afs_int32 xbsa_QueryObject(struct butx_transactionInfo *info, - char *objectSpaceName, - char *pathName) +afs_int32 +xbsa_QueryObject(struct butx_transactionInfo * info, char *objectSpaceName, + char *pathName) { int rc; QueryDescriptor queryDescriptor; if (debugLevel > 98) { - printf("\nxbsa_QueryObject objectSpaceName='%s' pathnName='%s'\n", - GOODSTR(objectSpaceName), GOODSTR(pathName)); - printf("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", - GOODSTR(info->serverName), GOODSTR(info->objOwner.bsaObjectOwner), - GOODSTR(info->objOwner.appObjectOwner)); + printf("\nxbsa_QueryObject objectSpaceName='%s' pathnName='%s'\n", + GOODSTR(objectSpaceName), GOODSTR(pathName)); + printf + ("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", + GOODSTR(info->serverName), + GOODSTR(info->objOwner.bsaObjectOwner), + GOODSTR(info->objOwner.appObjectOwner)); } if (info->bsaHandle == 0) { /* We haven't initialized yet! */ - ELog(0,"xbsa_QueryObject: No current handle, butx not initialized\n"); - return(BUTX_NOHANDLE); + ELog(0, + "xbsa_QueryObject: No current handle, butx not initialized\n"); + return (BUTX_NOHANDLE); } /* Initialize the query for our dump name */ if (objectSpaceName) { if (strlen(objectSpaceName) >= BSA_MAX_OSNAME) { - ELog(0,"xbsa_QueryObject: The objectSpaceName is too long; size = %d; name = %s\n", + ELog(0, + "xbsa_QueryObject: The objectSpaceName is too long; size = %d; name = %s\n", strlen(objectSpaceName), objectSpaceName); - return(BUTX_INVALIDOBJECTSPNAME); + return (BUTX_INVALIDOBJECTSPNAME); } - strcpy(queryDescriptor.objName.objectSpaceName,objectSpaceName); + strcpy(queryDescriptor.objName.objectSpaceName, objectSpaceName); } else { queryDescriptor.objName.objectSpaceName[0] = NULL; } if (pathName) { if (strlen(pathName) >= BSA_MAX_PATHNAME) { - ELog(0,"xbsa_QueryObject: The pathName is too long; size = %d; name = %s\n", + ELog(0, + "xbsa_QueryObject: The pathName is too long; size = %d; name = %s\n", strlen(pathName), pathName); - return(BUTX_INVALIDPATHNAME); + return (BUTX_INVALIDPATHNAME); } strcpy(queryDescriptor.objName.pathName, pathName); } else { @@ -504,14 +572,17 @@ afs_int32 xbsa_QueryObject(struct butx_transactionInfo *info, queryDescriptor.status = BSAObjectStatus_ACTIVE; strcpy(queryDescriptor.desc, ""); - rc = (int)XBSAQueryObject(info->bsaHandle, &queryDescriptor, &info->curObject); - if (rc == BSA_RC_NO_MORE_DATA) rc = BSA_RC_SUCCESS; /* This is actually a success! */ + rc = (int)XBSAQueryObject(info->bsaHandle, &queryDescriptor, + &info->curObject); + if (rc == BSA_RC_NO_MORE_DATA) + rc = BSA_RC_SUCCESS; /* This is actually a success! */ if (rc != BSA_RC_SUCCESS) { - ELog(0,"xbsa_QueryObject: The xBSAQueryObject call failed with %d\n", rc); + ELog(0, "xbsa_QueryObject: The xBSAQueryObject call failed with %d\n", + rc); xbsa_error(rc, info); - return(BUTX_QUERYFAIL); + return (BUTX_QUERYFAIL); } - return(XBSA_SUCCESS); + return (XBSA_SUCCESS); } /* @@ -519,49 +590,58 @@ afs_int32 xbsa_QueryObject(struct butx_transactionInfo *info, * get the object descriptor so we can begin the transfer of data. * BSAGetObject */ -afs_int32 xbsa_ReadObjectBegin(struct butx_transactionInfo *info, char *dataBuffer, - afs_int32 bufferSize, afs_int32 *count, afs_int32 *endOfData) +afs_int32 +xbsa_ReadObjectBegin(struct butx_transactionInfo * info, char *dataBuffer, + afs_int32 bufferSize, afs_int32 * count, + afs_int32 * endOfData) { int rc; DataBlock dataBlock; if (debugLevel > 98) { - printf("\nxbsa_ReadObjectBegin %d Bytes\n", bufferSize); - printf("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", - GOODSTR(info->serverName), GOODSTR(info->objOwner.bsaObjectOwner), - GOODSTR(info->objOwner.appObjectOwner)); + printf("\nxbsa_ReadObjectBegin %d Bytes\n", bufferSize); + printf + ("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", + GOODSTR(info->serverName), + GOODSTR(info->objOwner.bsaObjectOwner), + GOODSTR(info->objOwner.appObjectOwner)); } if (info->bsaHandle == 0) { /* We haven't initialized yet! */ - ELog(0,"xbsa_ReadObjectBegin: No current handle, butx not initialized\n"); - return(BUTX_NOHANDLE); + ELog(0, + "xbsa_ReadObjectBegin: No current handle, butx not initialized\n"); + return (BUTX_NOHANDLE); } if ((bufferSize < 0) || (bufferSize > XBSAMAXBUFFER)) { - ELog(0,"xbsa_ReadObjectBegin: The bufferSize %d is invalid\n", bufferSize); - return(BUTX_INVALIDBUFFERSIZE); + ELog(0, "xbsa_ReadObjectBegin: The bufferSize %d is invalid\n", + bufferSize); + return (BUTX_INVALIDBUFFERSIZE); } if (dataBuffer == NULL) { - ELog(0,"xbsa_ReadObjectBegin: The dataBuffer is NULL\n"); - return(BUTX_INVALIDDATABUFFER); + ELog(0, "xbsa_ReadObjectBegin: The dataBuffer is NULL\n"); + return (BUTX_INVALIDDATABUFFER); } dataBlock.bufferLen = (BSA_UInt16) bufferSize; - dataBlock.numBytes = (BSA_UInt16) 0; + dataBlock.numBytes = (BSA_UInt16) 0; dataBlock.bufferPtr = dataBuffer; *endOfData = 0; rc = (int)XBSAGetObject(info->bsaHandle, &info->curObject, &dataBlock); if ((rc != BSA_RC_MORE_DATA) && (rc != BSA_RC_NO_MORE_DATA)) { - ELog(0,"xbsa_ReadObjectBegin: The XBSAGetObject call failed with %d\n", rc); + ELog(0, + "xbsa_ReadObjectBegin: The XBSAGetObject call failed with %d\n", + rc); xbsa_error(rc, info); - return(BUTX_GETOBJFAIL); + return (BUTX_GETOBJFAIL); } *count = dataBlock.numBytes; - if (rc == BSA_RC_NO_MORE_DATA) *endOfData = 1; - return(XBSA_SUCCESS); + if (rc == BSA_RC_NO_MORE_DATA) + *endOfData = 1; + return (XBSA_SUCCESS); } @@ -569,29 +649,33 @@ afs_int32 xbsa_ReadObjectBegin(struct butx_transactionInfo *info, char *dataBuff * Tell the XBSA Server that this is the end of Data for this object. * BSAEndData() */ -afs_int32 xbsa_ReadObjectEnd(struct butx_transactionInfo *info) +afs_int32 +xbsa_ReadObjectEnd(struct butx_transactionInfo * info) { int rc; if (debugLevel > 98) { - printf("\nxbsa_ReadObjectEnd\n"); - printf("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", - GOODSTR(info->serverName), GOODSTR(info->objOwner.bsaObjectOwner), - GOODSTR(info->objOwner.appObjectOwner)); + printf("\nxbsa_ReadObjectEnd\n"); + printf + ("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", + GOODSTR(info->serverName), + GOODSTR(info->objOwner.bsaObjectOwner), + GOODSTR(info->objOwner.appObjectOwner)); } if (info->bsaHandle == 0) { /* We haven't initialized yet! */ - ELog(0,"xbsa_ReadObjectEnd: No current handle, butx not initialized\n"); - return(BUTX_NOHANDLE); + ELog(0, + "xbsa_ReadObjectEnd: No current handle, butx not initialized\n"); + return (BUTX_NOHANDLE); } rc = (int)XBSAEndData(info->bsaHandle); if (rc != BSA_RC_SUCCESS) { - ELog(0,"xbsa_ReadObjectEnd: XBSAEndData call failed with %d\n", rc); + ELog(0, "xbsa_ReadObjectEnd: XBSAEndData call failed with %d\n", rc); xbsa_error(rc, info); - return(BUTX_ENDDATAFAIL); + return (BUTX_ENDDATAFAIL); } - return(XBSA_SUCCESS); + return (XBSA_SUCCESS); } @@ -599,37 +683,43 @@ afs_int32 xbsa_ReadObjectEnd(struct butx_transactionInfo *info) * Create the XBSA Backup Copy Object. * BSACreateObject */ -afs_int32 xbsa_WriteObjectBegin(struct butx_transactionInfo *info, - char *objectSpaceName, char *pathName, - char *lGName, afs_hyper_t estimatedSize, - char *objectDescription, char *objectInfo) +afs_int32 +xbsa_WriteObjectBegin(struct butx_transactionInfo * info, + char *objectSpaceName, char *pathName, char *lGName, + afs_hyper_t estimatedSize, char *objectDescription, + char *objectInfo) { int rc; int length; DataBlock dataBlock; if (debugLevel > 98) { - printf("\nxbsa_WriteObjectBegin objectSpacename='%s' pathName='%s' lGName='%s' " - "estimatesSize='0x%x%08x objectDescription='%s' objectInfo='%s'\n", - GOODSTR(objectSpaceName), GOODSTR(pathName), GOODSTR(lGName), - hgethi(estimatedSize), hgetlo(estimatedSize), - GOODSTR(objectDescription), GOODSTR(objectInfo)); - printf("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", - GOODSTR(info->serverName), GOODSTR(info->objOwner.bsaObjectOwner), - GOODSTR(info->objOwner.appObjectOwner)); + printf + ("\nxbsa_WriteObjectBegin objectSpacename='%s' pathName='%s' lGName='%s' " + "estimatesSize='0x%x%08x objectDescription='%s' objectInfo='%s'\n", + GOODSTR(objectSpaceName), GOODSTR(pathName), GOODSTR(lGName), + hgethi(estimatedSize), hgetlo(estimatedSize), + GOODSTR(objectDescription), GOODSTR(objectInfo)); + printf + ("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", + GOODSTR(info->serverName), + GOODSTR(info->objOwner.bsaObjectOwner), + GOODSTR(info->objOwner.appObjectOwner)); } if (info->bsaHandle == 0) { /* We haven't initialized yet! */ - ELog(0,"xbsa_WriteObjectBegin: No current handle, butx not initialized\n"); - return(BUTX_NOHANDLE); + ELog(0, + "xbsa_WriteObjectBegin: No current handle, butx not initialized\n"); + return (BUTX_NOHANDLE); } if (objectSpaceName) { if (strlen(objectSpaceName) >= BSA_MAX_OSNAME) { - ELog(0,"xbsa_WriteObjectBegin: The objectSpaceName is too long; size = %d; name = %s\n", + ELog(0, + "xbsa_WriteObjectBegin: The objectSpaceName is too long; size = %d; name = %s\n", strlen(objectSpaceName), objectSpaceName); - return(BUTX_INVALIDOBJECTSPNAME); + return (BUTX_INVALIDOBJECTSPNAME); } strcpy(info->curObject.objName.objectSpaceName, objectSpaceName); } else { @@ -638,9 +728,10 @@ afs_int32 xbsa_WriteObjectBegin(struct butx_transactionInfo *info, if (pathName) { if (strlen(pathName) >= BSA_MAX_PATHNAME) { - ELog(0,"xbsa_WriteObjectBegin: The pathName is too long; size = %d; name = %s\n", + ELog(0, + "xbsa_WriteObjectBegin: The pathName is too long; size = %d; name = %s\n", strlen(pathName), pathName); - return(BUTX_INVALIDPATHNAME); + return (BUTX_INVALIDPATHNAME); } strcpy(info->curObject.objName.pathName, pathName); } else { @@ -649,9 +740,10 @@ afs_int32 xbsa_WriteObjectBegin(struct butx_transactionInfo *info, if (lGName) { if (strlen(lGName) >= BSA_MAX_LG_NAME) { - ELog(0,"xbsa_WriteObjectBegin: The lGName is too long; size = %d; name = %s\n", + ELog(0, + "xbsa_WriteObjectBegin: The lGName is too long; size = %d; name = %s\n", strlen(lGName), lGName); - return(BUTX_INVALIDLGNAME); + return (BUTX_INVALIDLGNAME); } strcpy(info->curObject.lGName, lGName); } else { @@ -659,13 +751,15 @@ afs_int32 xbsa_WriteObjectBegin(struct butx_transactionInfo *info, } if (objectDescription) { - if ( ( (XBSA_GET_SERVER_TYPE(info->serverType) == XBSA_SERVER_TYPE_ADSM) && - (strlen(objectDescription) >= ADSM_MAX_DESC) ) || - ( (XBSA_GET_SERVER_TYPE(info->serverType) != XBSA_SERVER_TYPE_ADSM) && - (strlen(objectDescription) >= BSA_MAX_DESC) ) ) { - ELog(0,"xbsa_WriteObjectBegin: The objectDescription is too long; size = %d; name = %s\n", + if (((XBSA_GET_SERVER_TYPE(info->serverType) == XBSA_SERVER_TYPE_ADSM) + && (strlen(objectDescription) >= ADSM_MAX_DESC)) + || + ((XBSA_GET_SERVER_TYPE(info->serverType) != XBSA_SERVER_TYPE_ADSM) + && (strlen(objectDescription) >= BSA_MAX_DESC))) { + ELog(0, + "xbsa_WriteObjectBegin: The objectDescription is too long; size = %d; name = %s\n", strlen(objectDescription), objectDescription); - return(BUTX_INVALIDOBJDESC); + return (BUTX_INVALIDOBJDESC); } strcpy(info->curObject.desc, objectDescription); } else { @@ -673,13 +767,15 @@ afs_int32 xbsa_WriteObjectBegin(struct butx_transactionInfo *info, } if (objectInfo) { - if ( ( (XBSA_GET_SERVER_TYPE(info->serverType) == XBSA_SERVER_TYPE_ADSM) && - (strlen(objectInfo) >= ADSM_MAX_OBJINFO) ) || - ( (XBSA_GET_SERVER_TYPE(info->serverType) != XBSA_SERVER_TYPE_ADSM) && - (strlen(objectInfo) >= BSA_MAX_OBJINFO) ) ) { - ELog(0,"xbsa_WriteObjectBegin: The objectInfo is too long; size = %d; name = %s\n", + if (((XBSA_GET_SERVER_TYPE(info->serverType) == XBSA_SERVER_TYPE_ADSM) + && (strlen(objectInfo) >= ADSM_MAX_OBJINFO)) + || + ((XBSA_GET_SERVER_TYPE(info->serverType) != XBSA_SERVER_TYPE_ADSM) + && (strlen(objectInfo) >= BSA_MAX_OBJINFO))) { + ELog(0, + "xbsa_WriteObjectBegin: The objectInfo is too long; size = %d; name = %s\n", strlen(objectInfo), objectInfo); - return(BUTX_INVALIDOBJINFO); + return (BUTX_INVALIDOBJINFO); } strcpy(info->curObject.objectInfo, objectInfo); } else { @@ -688,13 +784,13 @@ afs_int32 xbsa_WriteObjectBegin(struct butx_transactionInfo *info, if (info->numObjects == info->maxObjects) { /* If we've used up Max Objects we must start a new transaction. */ - rc = (int)xbsa_EndTrans(info); + rc = (int)xbsa_EndTrans(info); if (rc != XBSA_SUCCESS) { - return(rc); + return (rc); } rc = (int)xbsa_BeginTrans(info); if (rc != XBSA_SUCCESS) { - return(rc); + return (rc); } } @@ -702,23 +798,25 @@ afs_int32 xbsa_WriteObjectBegin(struct butx_transactionInfo *info, dataBlock.numBytes = (BSA_UInt16) 0; dataBlock.bufferPtr = 0; - info->curObject.Owner = info->objOwner; - info->curObject.copyType = BSACopyType_BACKUP; - info->curObject.size.left = hgethi(estimatedSize); + info->curObject.Owner = info->objOwner; + info->curObject.copyType = BSACopyType_BACKUP; + info->curObject.size.left = hgethi(estimatedSize); info->curObject.size.right = hgetlo(estimatedSize); info->curObject.objectType = BSAObjectType_FILE; strcpy(info->curObject.resourceType, resourceType); rc = (int)XBSACreateObject(info->bsaHandle, &info->curObject, &dataBlock); if (rc != BSA_RC_SUCCESS) { - ELog(0,"xbsa_WriteObjectBegin: The XBSACreateObject call failed with %d\n", rc); + ELog(0, + "xbsa_WriteObjectBegin: The XBSACreateObject call failed with %d\n", + rc); xbsa_error(rc, info); - return(BUTX_CREATEOBJFAIL); + return (BUTX_CREATEOBJFAIL); } info->numObjects++; - return(XBSA_SUCCESS); + return (XBSA_SUCCESS); } /* @@ -726,31 +824,36 @@ afs_int32 xbsa_WriteObjectBegin(struct butx_transactionInfo *info, * BSAMarkObjectInactive() * BSADeleteObject() */ -afs_int32 xbsa_DeleteObject(struct butx_transactionInfo *info, - char *objectSpaceName, char *pathName) +afs_int32 +xbsa_DeleteObject(struct butx_transactionInfo * info, char *objectSpaceName, + char *pathName) { int rc; ObjectName objectName; if (debugLevel > 98) { - printf("\nxbsa_DeleteObject objectSpacename='%s' pathName='%s'\n", - GOODSTR(objectSpaceName), GOODSTR(pathName)); - printf("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", - GOODSTR(info->serverName), GOODSTR(info->objOwner.bsaObjectOwner), - GOODSTR(info->objOwner.appObjectOwner)); + printf("\nxbsa_DeleteObject objectSpacename='%s' pathName='%s'\n", + GOODSTR(objectSpaceName), GOODSTR(pathName)); + printf + ("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", + GOODSTR(info->serverName), + GOODSTR(info->objOwner.bsaObjectOwner), + GOODSTR(info->objOwner.appObjectOwner)); } if (info->bsaHandle == 0) { /* We haven't initialized yet! */ - ELog(0,"xbsa_DeleteObject: No current handle, butx not initialized\n"); - return(BUTX_NOHANDLE); + ELog(0, + "xbsa_DeleteObject: No current handle, butx not initialized\n"); + return (BUTX_NOHANDLE); } if (objectSpaceName) { if (strlen(objectSpaceName) >= BSA_MAX_OSNAME) { - ELog(0,"xbsa_DeleteObject: The objectSpaceName is too long; size = %d; name = %s\n", + ELog(0, + "xbsa_DeleteObject: The objectSpaceName is too long; size = %d; name = %s\n", strlen(objectSpaceName), objectSpaceName); - return(BUTX_INVALIDOBJECTSPNAME); + return (BUTX_INVALIDOBJECTSPNAME); } strcpy(objectName.objectSpaceName, objectSpaceName); } else { @@ -759,9 +862,9 @@ afs_int32 xbsa_DeleteObject(struct butx_transactionInfo *info, if (pathName) { if (strlen(pathName) >= BSA_MAX_PATHNAME) { - ELog(0,"xbsa_DeleteObject: strlen(pathName), pathName\n", + ELog(0, "xbsa_DeleteObject: strlen(pathName), pathName\n", strlen(pathName), pathName); - return(BUTX_INVALIDPATHNAME); + return (BUTX_INVALIDPATHNAME); } strcpy(objectName.pathName, pathName); } else { @@ -769,43 +872,51 @@ afs_int32 xbsa_DeleteObject(struct butx_transactionInfo *info, } rc = (int)XBSAMarkObjectInactive(info->bsaHandle, &objectName); - if (rc != BSA_RC_SUCCESS ) { - ELog(0,"xbsa_DeleteObject: XBSAMarkObjectInactive call failed with %d\n", rc); + if (rc != BSA_RC_SUCCESS) { + ELog(0, + "xbsa_DeleteObject: XBSAMarkObjectInactive call failed with %d\n", + rc); xbsa_error(rc, info); - return((rc==BSA_RC_ABORT_ACTIVE_NOT_FOUND) ? BUTX_DELETENOVOL : BUTX_DELETEOBJFAIL); + return ((rc == + BSA_RC_ABORT_ACTIVE_NOT_FOUND) ? BUTX_DELETENOVOL : + BUTX_DELETEOBJFAIL); } - return(XBSA_SUCCESS); + return (XBSA_SUCCESS); } /* * Tell the XBSA Server that this is the end of Data for this object. * BSAEndData() */ -afs_int32 xbsa_WriteObjectEnd(struct butx_transactionInfo *info) +afs_int32 +xbsa_WriteObjectEnd(struct butx_transactionInfo * info) { int rc; if (debugLevel > 98) { - printf("\nxbsa_WriteObjectEnd\n"); - printf("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", - GOODSTR(info->serverName), GOODSTR(info->objOwner.bsaObjectOwner), - GOODSTR(info->objOwner.appObjectOwner)); + printf("\nxbsa_WriteObjectEnd\n"); + printf + ("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", + GOODSTR(info->serverName), + GOODSTR(info->objOwner.bsaObjectOwner), + GOODSTR(info->objOwner.appObjectOwner)); } if (info->bsaHandle == 0) { /* We haven't initialized yet! */ - ELog(0,"xbsa_WriteObjectEnd: No current handle, butx not initialized\n"); - return(BUTX_NOHANDLE); + ELog(0, + "xbsa_WriteObjectEnd: No current handle, butx not initialized\n"); + return (BUTX_NOHANDLE); } rc = (int)XBSAEndData(info->bsaHandle); if (rc != BSA_RC_SUCCESS) { - ELog(0,"xbsa_WriteObjectEnd: XBSAEndData call failed with %d\n", rc); + ELog(0, "xbsa_WriteObjectEnd: XBSAEndData call failed with %d\n", rc); xbsa_error(rc, info); - return(BUTX_ENDDATAFAIL); + return (BUTX_ENDDATAFAIL); } - return(XBSA_SUCCESS); + return (XBSA_SUCCESS); } @@ -813,33 +924,38 @@ afs_int32 xbsa_WriteObjectEnd(struct butx_transactionInfo *info) * Write the fileset data to the XBSA server * BSASendData */ -afs_int32 xbsa_WriteObjectData(struct butx_transactionInfo *info, - char *dataBuffer, afs_int32 bufferSize, afs_int32 *count) +afs_int32 +xbsa_WriteObjectData(struct butx_transactionInfo * info, char *dataBuffer, + afs_int32 bufferSize, afs_int32 * count) { int rc; DataBlock dataBlock; if (debugLevel > 98) { - printf("\nxbsa_WriteObjectData %d Bytes\n", bufferSize); - printf("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", - GOODSTR(info->serverName), GOODSTR(info->objOwner.bsaObjectOwner), - GOODSTR(info->objOwner.appObjectOwner)); + printf("\nxbsa_WriteObjectData %d Bytes\n", bufferSize); + printf + ("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", + GOODSTR(info->serverName), + GOODSTR(info->objOwner.bsaObjectOwner), + GOODSTR(info->objOwner.appObjectOwner)); } if (info->bsaHandle == 0) { /* We haven't initialized yet! */ - ELog(0,"xbsa_WriteObjectData: No current handle, butx not initialized\n"); - return(BUTX_NOHANDLE); + ELog(0, + "xbsa_WriteObjectData: No current handle, butx not initialized\n"); + return (BUTX_NOHANDLE); } if ((bufferSize < 0) || (bufferSize > XBSAMAXBUFFER)) { - ELog(0,"xbsa_WriteObjectData: The bufferSize %d is invalid\n", bufferSize); - return(BUTX_INVALIDBUFFERSIZE); + ELog(0, "xbsa_WriteObjectData: The bufferSize %d is invalid\n", + bufferSize); + return (BUTX_INVALIDBUFFERSIZE); } if (dataBuffer == NULL) { - ELog(0,"xbsa_WriteObjectData: The dataBuffer is NULL\n"); - return(BUTX_INVALIDDATABUFFER); + ELog(0, "xbsa_WriteObjectData: The dataBuffer is NULL\n"); + return (BUTX_INVALIDDATABUFFER); } dataBlock.bufferPtr = dataBuffer; @@ -848,12 +964,13 @@ afs_int32 xbsa_WriteObjectData(struct butx_transactionInfo *info, rc = (int)XBSASendData(info->bsaHandle, &dataBlock); if (rc != BSA_RC_SUCCESS) { - ELog(0,"xbsa_WriteObjectData: XBSAEndData call failed with %d\n", rc); + ELog(0, "xbsa_WriteObjectData: XBSAEndData call failed with %d\n", + rc); xbsa_error(rc, info); - return(BUTX_SENDDATAFAIL); + return (BUTX_SENDDATAFAIL); } *count = dataBlock.numBytes; - return(XBSA_SUCCESS); + return (XBSA_SUCCESS); } @@ -861,33 +978,39 @@ afs_int32 xbsa_WriteObjectData(struct butx_transactionInfo *info, * Read the fileset data from the XBSA server * BSAGetData */ -afs_int32 xbsa_ReadObjectData(struct butx_transactionInfo *info, char *dataBuffer, - afs_int32 bufferSize, afs_int32 *count, afs_int32 *endOfData) +afs_int32 +xbsa_ReadObjectData(struct butx_transactionInfo * info, char *dataBuffer, + afs_int32 bufferSize, afs_int32 * count, + afs_int32 * endOfData) { int rc; DataBlock dataBlock; if (debugLevel > 98) { - printf("\nxbsa_ReadObjectData %d Bytes\n", bufferSize); - printf("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", - GOODSTR(info->serverName), GOODSTR(info->objOwner.bsaObjectOwner), - GOODSTR(info->objOwner.appObjectOwner)); + printf("\nxbsa_ReadObjectData %d Bytes\n", bufferSize); + printf + ("serverName='%s' ; bsaObjectOwner='%s' ; appObjectOwner='%s' ; sectoken=xxxxxx\n", + GOODSTR(info->serverName), + GOODSTR(info->objOwner.bsaObjectOwner), + GOODSTR(info->objOwner.appObjectOwner)); } if (info->bsaHandle == 0) { /* We haven't initialized yet! */ - ELog(0,"xbsa_ReadObjectData: No current handle, butx not initialized\n"); - return(BUTX_NOHANDLE); + ELog(0, + "xbsa_ReadObjectData: No current handle, butx not initialized\n"); + return (BUTX_NOHANDLE); } if ((bufferSize < 0) || (bufferSize > XBSAMAXBUFFER)) { - ELog(0,"xbsa_ReadObjectData: The bufferSize %d is invalid\n", bufferSize); - return(BUTX_INVALIDBUFFERSIZE); + ELog(0, "xbsa_ReadObjectData: The bufferSize %d is invalid\n", + bufferSize); + return (BUTX_INVALIDBUFFERSIZE); } if (dataBuffer == NULL) { - ELog(0,"xbsa_ReadObjectData: The dataBuffer is NULL\n"); - return(BUTX_INVALIDDATABUFFER); + ELog(0, "xbsa_ReadObjectData: The dataBuffer is NULL\n"); + return (BUTX_INVALIDDATABUFFER); } dataBlock.bufferLen = (BSA_UInt16) bufferSize; @@ -897,12 +1020,13 @@ afs_int32 xbsa_ReadObjectData(struct butx_transactionInfo *info, char *dataBuffe rc = (int)XBSAGetData(info->bsaHandle, &dataBlock); if ((rc != BSA_RC_MORE_DATA) && (rc != BSA_RC_NO_MORE_DATA)) { - ELog(0,"xbsa_ReadObjectData: XBSAGetData call failed with %d\n", rc); + ELog(0, "xbsa_ReadObjectData: XBSAGetData call failed with %d\n", rc); xbsa_error(rc, info); - return(BUTX_GETDATAFAIL); + return (BUTX_GETDATAFAIL); } *count = dataBlock.numBytes; - if (rc == BSA_RC_NO_MORE_DATA) *endOfData = 1; - return(XBSA_SUCCESS); + if (rc == BSA_RC_NO_MORE_DATA) + *endOfData = 1; + return (XBSA_SUCCESS); } -#endif /*xbsa*/ +#endif /*xbsa */ diff --git a/src/butc/butc_xbsa.h b/src/butc/butc_xbsa.h index fd131e02d..63c14a5da 100644 --- a/src/butc/butc_xbsa.h +++ b/src/butc/butc_xbsa.h @@ -7,17 +7,17 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -#ifndef TRANSARC_BUTC_XBSA_H -#define TRANSARC_BUTC_XBSA_H +#ifndef OPENAFS_BUTC_XBSA_H +#define OPENAFS_BUTC_XBSA_H /* The following serverTypes are currently supported by this interface */ -#define XBSA_SERVER_TYPE_NONE 0x00 /* no server, use tape drive */ -#define XBSA_SERVER_TYPE_UNKNOWN 0x01 /* server, don't know which type yet */ -#define XBSA_SERVER_TYPE_ADSM 0x02 /* server type is ADSM */ -#define XBSA_SERVER_TYPE_MASK 0xFF /* for (butx_transactionInfo *)->serverType (byte 1) */ +#define XBSA_SERVER_TYPE_NONE 0x00 /* no server, use tape drive */ +#define XBSA_SERVER_TYPE_UNKNOWN 0x01 /* server, don't know which type yet */ +#define XBSA_SERVER_TYPE_ADSM 0x02 /* server type is ADSM */ +#define XBSA_SERVER_TYPE_MASK 0xFF /* for (butx_transactionInfo *)->serverType (byte 1) */ #ifdef xbsa -#define CONF_XBSA (xbsaType != XBSA_SERVER_TYPE_NONE) /*test if butc is XBSA */ +#define CONF_XBSA (xbsaType != XBSA_SERVER_TYPE_NONE) /*test if butc is XBSA */ #else #define CONF_XBSA 0 #endif @@ -27,16 +27,16 @@ #define XBSA_GET_SERVER_TYPE(server) ((server) & XBSA_SERVER_TYPE_MASK) /* The following serverType flags are currently supported by this interface */ -#define XBSA_SERVER_FLAG_NONE 0x0000 /* don't allow multiple server connections */ -#define XBSA_SERVER_FLAG_MULTIPLE 0x0100 /* allow multiple server connections */ -#define XBSA_SERVER_FLAG_MASK 0xFF00 /* for (butx_transactionInfo *)->serverType (byte 2) */ +#define XBSA_SERVER_FLAG_NONE 0x0000 /* don't allow multiple server connections */ +#define XBSA_SERVER_FLAG_MULTIPLE 0x0100 /* allow multiple server connections */ +#define XBSA_SERVER_FLAG_MASK 0xFF00 /* for (butx_transactionInfo *)->serverType (byte 2) */ #define XBSA_SET_SERVER_FLAG(server, flag) ((server) |= ((flag) & XBSA_SERVER_FLAG_MASK)) #define XBSA_GET_SERVER_FLAG(server) ((server) & XBSA_SERVER_FLAG_MASK) #define XBSA_IS_SERVER_FLAG_SET(server, flag) (XBSA_GET_SERVER_FLAG(server) & flag) -#define XBSAMINBUFFER 1024 /* minimum size is 1KB */ -#define XBSADFLTBUFFER 16384 /* default size is 16KB */ -#define XBSAMAXBUFFER 65535 /* maximum size in 64KB-1; has to fit in 16bit integer */ +#define XBSAMINBUFFER 1024 /* minimum size is 1KB */ +#define XBSADFLTBUFFER 16384 /* default size is 16KB */ +#define XBSAMAXBUFFER 65535 /* maximum size in 64KB-1; has to fit in 16bit integer */ #include @@ -67,22 +67,23 @@ * The spec says bsaHandle should be a long but ADSM has it as a ulong! */ struct butx_transactionInfo { - ApiVersion apiVersion; - u_long bsaHandle; - afs_int32 serverType; /* Type and flags */ - afs_int32 maxObjects; /* max objects/transaction */ - afs_int32 numObjects; /* objects in current trans */ - char serverName[BSA_MAX_DESC]; - SecurityToken secToken; - ObjectOwner objOwner; - ObjectDescriptor curObject; + ApiVersion apiVersion; + u_long bsaHandle; + afs_int32 serverType; /* Type and flags */ + afs_int32 maxObjects; /* max objects/transaction */ + afs_int32 numObjects; /* objects in current trans */ + char serverName[BSA_MAX_DESC]; + SecurityToken secToken; + ObjectOwner objOwner; + ObjectDescriptor curObject; }; -extern afs_int32 xbsa_MountLibrary(struct butx_transactionInfo *info, afs_int32 serverType); +extern afs_int32 xbsa_MountLibrary(struct butx_transactionInfo *info, + afs_int32 serverType); extern afs_int32 xbsa_Initialize(struct butx_transactionInfo *info, - char *bsaObjectOwner, char *appObjectOwner, - char *secToken, char *serverName); + char *bsaObjectOwner, char *appObjectOwner, + char *secToken, char *serverName); extern afs_int32 xbsa_Finalize(struct butx_transactionInfo *info); @@ -91,38 +92,35 @@ extern afs_int32 xbsa_BeginTrans(struct butx_transactionInfo *info); extern afs_int32 xbsa_EndTrans(struct butx_transactionInfo *info); extern afs_int32 xbsa_QueryObject(struct butx_transactionInfo *info, - char *objectSpaceName, char *pathName); + char *objectSpaceName, char *pathName); extern afs_int32 xbsa_ReadObjectBegin(struct butx_transactionInfo *info, - char *dataBuffer, - afs_int32 bufferSize, - afs_int32 *count, - afs_int32 *endOfData); + char *dataBuffer, afs_int32 bufferSize, + afs_int32 * count, + afs_int32 * endOfData); extern afs_int32 xbsa_ReadObjectEnd(struct butx_transactionInfo *info); extern afs_int32 xbsa_WriteObjectBegin(struct butx_transactionInfo *info, - char *objectSpaceName, - char *pathName, - char *lGName, - afs_hyper_t estimatedSize, - char *objectDescription, - char *objectInfo); + char *objectSpaceName, char *pathName, + char *lGName, + afs_hyper_t estimatedSize, + char *objectDescription, + char *objectInfo); extern afs_int32 xbsa_WriteObjectEnd(struct butx_transactionInfo *info); extern afs_int32 xbsa_WriteObjectData(struct butx_transactionInfo *info, - char *dataBuffer, - afs_int32 bufferSize, afs_int32 *count); + char *dataBuffer, afs_int32 bufferSize, + afs_int32 * count); extern afs_int32 xbsa_ReadObjectData(struct butx_transactionInfo *info, - char *dataBuffer, - afs_int32 bufferSize, - afs_int32 *count, - afs_int32 *endOfData); + char *dataBuffer, afs_int32 bufferSize, + afs_int32 * count, + afs_int32 * endOfData); extern afs_int32 xbsa_DeleteObject(struct butx_transactionInfo *info, - char *objectSpaceName, char *pathName); + char *objectSpaceName, char *pathName); -#endif /*xbsa*/ -#endif /* TRANSARC_BUTC_XBSA_H */ +#endif /*xbsa */ +#endif /* OPENAFS_BUTC_XBSA_H */ diff --git a/src/butc/common.h b/src/butc/common.h index 8c1e971da..cfcd88cbb 100644 --- a/src/butc/common.h +++ b/src/butc/common.h @@ -14,25 +14,25 @@ /* describes the information that should be dumped to dump a single volume */ struct tc_dumpDesc { - afs_int32 vid; /* volume to dump */ - afs_int32 partition; /* partition at which to find the volume */ - afs_int32 date; /* date from which to do the dump */ - opaque hostID[16]; /* opaque netaddress, really a sockaddr_in */ + afs_int32 vid; /* volume to dump */ + afs_int32 partition; /* partition at which to find the volume */ + afs_int32 date; /* date from which to do the dump */ + opaque hostID[16]; /* opaque netaddress, really a sockaddr_in */ }; /* define how to restore a volume */ struct tc_restoreDesc { - afs_int32 origVid; /* original volume id */ - afs_int32 vid; /* 0 means allocate new volid */ - afs_int32 partition; /* where to restore the volume */ - afs_int32 flags; /* flags */ - opaque hostID[16]; /* which file server to restore the volume to */ - opaque newName[TC_MAXNAMELEN]; /* new name suffix */ + afs_int32 origVid; /* original volume id */ + afs_int32 vid; /* 0 means allocate new volid */ + afs_int32 partition; /* where to restore the volume */ + afs_int32 flags; /* flags */ + opaque hostID[16]; /* which file server to restore the volume to */ + opaque newName[TC_MAXNAMELEN]; /* new name suffix */ }; /* describes the current status of a dump */ struct tc_dumpStat { - afs_int32 dumpID; /* dump id we're returning */ - afs_int32 bytesDumped; /* bytes dumped so far */ - afs_int32 volumeBeingDumped; /* guess */ - afs_int32 flags; /* true if the dump is done */ + afs_int32 dumpID; /* dump id we're returning */ + afs_int32 bytesDumped; /* bytes dumped so far */ + afs_int32 volumeBeingDumped; /* guess */ + afs_int32 flags; /* true if the dump is done */ }; diff --git a/src/butc/dbentries.c b/src/butc/dbentries.c index 9f4623665..081aff98f 100644 --- a/src/butc/dbentries.c +++ b/src/butc/dbentries.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/butc/dbentries.c,v 1.1.1.5 2001/09/11 14:31:47 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/butc/dbentries.c,v 1.8 2003/12/07 22:49:23 jaltman Exp $"); #include #ifdef AFS_NT40_ENV @@ -39,45 +40,47 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/butc/dbentries.c,v 1.1.1.5 2001/09/11 1 #include "error_macros.h" -extern struct ubik_client *cstruct; dlqlinkT savedEntries; dlqlinkT entries_to_flush; int dbWatcherinprogress; -afs_int32 threadEntryDir(anEntry, size, type) - char *anEntry; +afs_int32 +threadEntryDir(anEntry, size, type) + char *anEntry; afs_int32 size, type; { dlqlinkP entryPtr; - char *entry = (char *)0; - int tried; + char *entry = NULL; + int tried; - for (tried=0; tried<5; tried++) { - entryPtr = (dlqlinkP)malloc(sizeof(dlqlinkT)); - entry = (char *) malloc(size); - if (entryPtr && entry) - break; + for (tried = 0; tried < 5; tried++) { + entryPtr = (dlqlinkP) malloc(sizeof(dlqlinkT)); + entry = (char *)malloc(size); + if (entryPtr && entry) + break; - /* sleep a minute and try again */ - if (entryPtr) free(entryPtr); - if (entry) free(entry); + /* sleep a minute and try again */ + if (entryPtr) + free(entryPtr); + if (entry) + free(entry); - if ((tried > 0) && !dbWatcherinprogress) - return(TC_NOMEMORY); + if ((tried > 0) && !dbWatcherinprogress) + return (TC_NOMEMORY); #ifdef AFS_PTHREAD_ENV - sleep(60); + sleep(60); #else - IOMGR_Sleep(60); + IOMGR_Sleep(60); #endif } - entryPtr->dlq_prev = entryPtr->dlq_next = (dlqlinkP)NULL; - entryPtr->dlq_type = type; + entryPtr->dlq_prev = entryPtr->dlq_next = (dlqlinkP) NULL; + entryPtr->dlq_type = type; entryPtr->dlq_structPtr = entry; memcpy(entry, anEntry, size); - dlqLinkb (&entries_to_flush, entryPtr); - return(0); + dlqLinkb(&entries_to_flush, entryPtr); + return (0); } /* @@ -87,27 +90,29 @@ afs_int32 threadEntryDir(anEntry, size, type) * Watcher thread will free up some memory for it to continue. */ -afs_int32 +afs_int32 threadEntry(anEntry, size, type) - char *anEntry; + char *anEntry; afs_int32 size, type; { dlqlinkP entryPtr; - char *entry = (char *)0; - int tried; + char *entry = NULL; + int tried; - for (tried=0; tried<5; tried++) { - entryPtr = (dlqlinkP)malloc(sizeof(dlqlinkT)); - entry = (char *) malloc(size); + for (tried = 0; tried < 5; tried++) { + entryPtr = (dlqlinkP) malloc(sizeof(dlqlinkT)); + entry = (char *)malloc(size); if (entryPtr && entry) - break; + break; /* sleep a minute and try again */ - if (entryPtr) free(entryPtr); - if (entry) free(entry); + if (entryPtr) + free(entryPtr); + if (entry) + free(entry); if ((tried > 0) && !dbWatcherinprogress) - return(TC_NOMEMORY); + return (TC_NOMEMORY); #ifdef AFS_PTHREAD_ENV sleep(60); #else @@ -115,36 +120,41 @@ threadEntry(anEntry, size, type) #endif } - entryPtr->dlq_prev = entryPtr->dlq_next = (dlqlinkP)NULL; - entryPtr->dlq_type = type; + entryPtr->dlq_prev = entryPtr->dlq_next = (dlqlinkP) NULL; + entryPtr->dlq_type = type; entryPtr->dlq_structPtr = entry; memcpy(entry, anEntry, size); - dlqLinkb (&savedEntries, (dlqlinkP)entryPtr); - return(0); + dlqLinkb(&savedEntries, (dlqlinkP) entryPtr); + return (0); } /* ------------------------------------------------------------------ */ -afs_int32 useDump(dumpEntryPtr) +afs_int32 +useDump(dumpEntryPtr) struct budb_dumpEntry *dumpEntryPtr; { - afs_int32 code = 0; + afs_int32 code = 0; - code = threadEntry(dumpEntryPtr, sizeof(struct budb_dumpEntry), DLQ_USEDUMP); - return(code); + code = + threadEntry(dumpEntryPtr, sizeof(struct budb_dumpEntry), DLQ_USEDUMP); + return (code); } /* * finishDump * Creates a dump entry (finished) and puts it onto the savedEntries list. */ -afs_int32 finishDump (aDumpEntryPtr) - struct budb_dumpEntry *aDumpEntryPtr; +afs_int32 +finishDump(aDumpEntryPtr) + struct budb_dumpEntry *aDumpEntryPtr; { - afs_int32 code=0; - - code = threadEntry(aDumpEntryPtr, sizeof(struct budb_dumpEntry), DLQ_FINISHDUMP); + afs_int32 code = 0; + + code = + threadEntry(aDumpEntryPtr, sizeof(struct budb_dumpEntry), + DLQ_FINISHDUMP); return (code); } @@ -152,46 +162,53 @@ afs_int32 finishDump (aDumpEntryPtr) * useTape * Creates a tape entry and puts it onto the savedEntries list. */ -afs_int32 useTape (aTapeEntryPtr, dumpID, tapename, tapeSeq, useCount, written, expiration, tapepos) +afs_int32 +useTape(aTapeEntryPtr, dumpID, tapename, tapeSeq, useCount, written, + expiration, tapepos) struct budb_tapeEntry *aTapeEntryPtr; - afs_int32 dumpID; - char *tapename; - afs_int32 tapeSeq; - afs_int32 useCount; - Date written; - Date expiration; - afs_int32 tapepos; + afs_int32 dumpID; + char *tapename; + afs_int32 tapeSeq; + afs_int32 useCount; + Date written; + Date expiration; + afs_int32 tapepos; { afs_int32 code = 0; memset(aTapeEntryPtr, 0, sizeof(struct budb_tapeEntry)); strcpy(aTapeEntryPtr->name, tapename); - aTapeEntryPtr->flags = BUDB_TAPE_BEINGWRITTEN; - aTapeEntryPtr->written = written; /* When label was written */ - aTapeEntryPtr->expires = expiration; - aTapeEntryPtr->seq = tapeSeq; + aTapeEntryPtr->flags = BUDB_TAPE_BEINGWRITTEN; + aTapeEntryPtr->written = written; /* When label was written */ + aTapeEntryPtr->expires = expiration; + aTapeEntryPtr->seq = tapeSeq; aTapeEntryPtr->useCount = useCount; - aTapeEntryPtr->dump = dumpID; + aTapeEntryPtr->dump = dumpID; aTapeEntryPtr->labelpos = tapepos; - - code = threadEntry(aTapeEntryPtr, sizeof(struct budb_tapeEntry), DLQ_USETAPE); - return(code); + + code = + threadEntry(aTapeEntryPtr, sizeof(struct budb_tapeEntry), + DLQ_USETAPE); + return (code); } /* * finishTape * Creates a tape entry (finished) and puts it onto the savedEntries list. */ -afs_int32 finishTape (aTapeEntryPtr, useKBytes) +afs_int32 +finishTape(aTapeEntryPtr, useKBytes) struct budb_tapeEntry *aTapeEntryPtr; - afs_int32 useKBytes; + afs_int32 useKBytes; { - afs_int32 code=0; - - aTapeEntryPtr->flags = BUDB_TAPE_WRITTEN; + afs_int32 code = 0; + + aTapeEntryPtr->flags = BUDB_TAPE_WRITTEN; aTapeEntryPtr->useKBytes = useKBytes; - code = threadEntry(aTapeEntryPtr, sizeof(struct budb_tapeEntry), DLQ_FINISHTAPE); + code = + threadEntry(aTapeEntryPtr, sizeof(struct budb_tapeEntry), + DLQ_FINISHTAPE); return (code); } @@ -199,44 +216,50 @@ afs_int32 finishTape (aTapeEntryPtr, useKBytes) * addVolume * Creates a volume entry and puts it onto the savedEntries list. */ -afs_int32 addVolume(aVolEntryPtr, dumpID, tapename, volname, volid, cloneDate, - startPos, volBytes, fragment, flags) +afs_int32 +addVolume(aVolEntryPtr, dumpID, tapename, volname, volid, cloneDate, startPos, + volBytes, fragment, flags) struct budb_volumeEntry *aVolEntryPtr; afs_int32 dumpID; char *tapename; char *volname; afs_int32 volid; - Date cloneDate; + Date cloneDate; afs_int32 startPos; afs_int32 volBytes; int fragment; afs_int32 flags; { - afs_int32 code = 0; - int allo = 0; + afs_int32 code = 0; + int allo = 0; if (!aVolEntryPtr) { - aVolEntryPtr = (struct budb_volumeEntry *)malloc(sizeof(struct budb_volumeEntry)); - if (!aVolEntryPtr) ERROR_EXIT(TC_NOMEMORY); + aVolEntryPtr = (struct budb_volumeEntry *) + malloc(sizeof(struct budb_volumeEntry)); + if (!aVolEntryPtr) + ERROR_EXIT(TC_NOMEMORY); allo = 1; } - + memset(aVolEntryPtr, 0, sizeof(struct budb_volumeEntry)); strcpy(aVolEntryPtr->name, volname); - aVolEntryPtr->flags = flags; - aVolEntryPtr->id = volid; + aVolEntryPtr->flags = flags; + aVolEntryPtr->id = volid; aVolEntryPtr->position = startPos; - aVolEntryPtr->clone = cloneDate; - aVolEntryPtr->nBytes = volBytes; - aVolEntryPtr->seq = fragment; - aVolEntryPtr->dump = dumpID; + aVolEntryPtr->clone = cloneDate; + aVolEntryPtr->nBytes = volBytes; + aVolEntryPtr->seq = fragment; + aVolEntryPtr->dump = dumpID; strcpy(aVolEntryPtr->tape, tapename); - code = threadEntry(aVolEntryPtr, sizeof(struct budb_volumeEntry), DLQ_VOLENTRY); + code = + threadEntry(aVolEntryPtr, sizeof(struct budb_volumeEntry), + DLQ_VOLENTRY); -error_exit: - if (code && allo) free(aVolEntryPtr); - return(code); + error_exit: + if (code && allo) + free(aVolEntryPtr); + return (code); } /* @@ -246,7 +269,8 @@ error_exit: * A status of DUMP_NORETRYEOT means the tape(s) contains no useful data, * and tapes and volumes should not be added to the DB. */ -afs_int32 flushSavedEntries (status) +afs_int32 +flushSavedEntries(status) afs_int32 status; { dlqlinkP entryPtr; @@ -261,13 +285,15 @@ afs_int32 flushSavedEntries (status) * without adding it to the backup database. */ if (status == DUMP_NORETRYEOT) { - entryPtr = dlqUnlinkb(&savedEntries); - if ( !entryPtr || (entryPtr->dlq_type != DLQ_USETAPE) ) + entryPtr = dlqUnlinkb(&savedEntries); + if (!entryPtr || (entryPtr->dlq_type != DLQ_USETAPE)) ERROR_EXIT(TC_INTERNALERROR); tapePtr = (struct budb_tapeEntry *)entryPtr->dlq_structPtr; - if (tapePtr) free(tapePtr); - if (entryPtr) free(entryPtr); + if (tapePtr) + free(tapePtr); + if (entryPtr) + free(entryPtr); } /* @@ -275,203 +301,213 @@ afs_int32 flushSavedEntries (status) * flush. Volume entries are not added if the volume failed to dump. */ while (entryPtr = dlqUnlinkf(&savedEntries)) { - if ((entryPtr->dlq_type == DLQ_VOLENTRY) && (status != DUMP_SUCCESS)) { + if ((entryPtr->dlq_type == DLQ_VOLENTRY) && (status != DUMP_SUCCESS)) { volPtr = (struct budb_volumeEntry *)entryPtr->dlq_structPtr; - if (volPtr) free(volPtr); - if (entryPtr) free(entryPtr); - } - else { - dlqLinkb (&entries_to_flush, entryPtr); + if (volPtr) + free(volPtr); + if (entryPtr) + free(entryPtr); + } else { + dlqLinkb(&entries_to_flush, entryPtr); } } -error_exit: + error_exit: /* Free anything that remains on dlq */ - dlqTraverseQueue (&savedEntries, free, free); + dlqTraverseQueue(&savedEntries, free, free); return (code); } waitDbWatcher() { - int message = 0; + int message = 0; - while (dbWatcherinprogress || !dlqEmpty(&entries_to_flush)) { - if (!message) { - printf("Updating database\n"); - message++; - } + while (dbWatcherinprogress || !dlqEmpty(&entries_to_flush)) { + if (!message) { + printf("Updating database\n"); + message++; + } #ifdef AFS_PTHREAD_ENV - sleep(2); + sleep(2); #else - IOMGR_Sleep(2); + IOMGR_Sleep(2); #endif - } + } - if (message) { - printf("Updating database - done\n"); - } + if (message) { + printf("Updating database - done\n"); + } } #define MAXVOLUMESTOADD 100 -int addvolumes=1; +int addvolumes = 1; dbWatcher() { - dlqlinkP entryPtr; - struct budb_dumpEntry *dumpPtr; - struct budb_tapeEntry *tapePtr; - struct budb_volumeEntry *volPtr, volumes[MAXVOLUMESTOADD]; - afs_int32 new; - afs_int32 code = 0; - int i, c, addedDump; - - dlqInit(&entries_to_flush); - dlqInit(&savedEntries); - - dbWatcherinprogress = 0; - addedDump = 1; - while (1) { - /*while*/ - /* Add tape and volume enties to the backup database */ - while (entryPtr = dlqUnlinkf(&entries_to_flush)) { - dbWatcherinprogress = 1; - - if (!entryPtr->dlq_structPtr) { - ErrorLog(0, 0, TC_BADQUEUE, 0, - "Warning: Invalid database entry - nota added\n"); - } - else switch (entryPtr->dlq_type) { - case DLQ_USEDUMP: - dumpPtr = (struct budb_dumpEntry *)entryPtr->dlq_structPtr; - /* Now call the database to create the entry */ - code = bcdb_CreateDump(dumpPtr); - if (code) { - if (code == BUDB_DUMPIDEXISTS) { - printf("Dump %s (DumpID %u) already exists in backup database\n", - dumpPtr->name, dumpPtr->id); - } else { - ErrorLog(0, 0, code, 0, - "Warning: Can't create dump %s (DumpID %u) in backup database\n", - dumpPtr->name, dumpPtr->id); - } - } - addedDump = (code ? 0 : 1); - break; - - case DLQ_FINISHDUMP: - dumpPtr = (struct budb_dumpEntry *)entryPtr->dlq_structPtr; - if (addedDump) { - code = bcdb_FinishDump(dumpPtr); - if (code) { - ErrorLog(0, 0, code, 0, - "Warning: Can't finish dump %s (DumpID %u) in backup database\n", + dlqlinkP entryPtr; + struct budb_dumpEntry *dumpPtr; + struct budb_tapeEntry *tapePtr; + struct budb_volumeEntry *volPtr, volumes[MAXVOLUMESTOADD]; + afs_int32 new; + afs_int32 code = 0; + int i, c, addedDump; + + dlqInit(&entries_to_flush); + dlqInit(&savedEntries); + + dbWatcherinprogress = 0; + addedDump = 1; + while (1) { + /*while */ + /* Add tape and volume enties to the backup database */ + while (entryPtr = dlqUnlinkf(&entries_to_flush)) { + dbWatcherinprogress = 1; + + if (!entryPtr->dlq_structPtr) { + ErrorLog(0, 0, TC_BADQUEUE, 0, + "Warning: Invalid database entry - nota added\n"); + } else + switch (entryPtr->dlq_type) { + case DLQ_USEDUMP: + dumpPtr = + (struct budb_dumpEntry *)entryPtr->dlq_structPtr; + /* Now call the database to create the entry */ + code = bcdb_CreateDump(dumpPtr); + if (code) { + if (code == BUDB_DUMPIDEXISTS) { + printf + ("Dump %s (DumpID %u) already exists in backup database\n", dumpPtr->name, dumpPtr->id); - } - } - addedDump = 1; - break; - - case DLQ_USETAPE: - tapePtr = (struct budb_tapeEntry *)entryPtr->dlq_structPtr; - if (addedDump) { - code = bcdb_UseTape(tapePtr, &new); - if (code) { - ErrorLog(0, 0, code, 0, - "Warning: Can't add tape %s of DumpID %u to backup database\n", - tapePtr->name, tapePtr->dump); - } - } - break; - - case DLQ_FINISHTAPE: - tapePtr = (struct budb_tapeEntry *)entryPtr->dlq_structPtr; - if (addedDump) { - code = bcdb_FinishTape(tapePtr, &new); - if (code) { - ErrorLog(0, 0, code, 0, - "Warning: Can't finish tape %s of DumpID %u in backup database\n", - tapePtr->name, tapePtr->dump); - } - } - break; - - case DLQ_VOLENTRY: - /* collect array of volumes to add to the dump */ - for (c=0; c 0) { /* don't read the 1st - already did */ - entryPtr = dlqUnlinkf(&entries_to_flush); /* Get the next entry */ - if (!entryPtr) break; - } - - if (entryPtr->dlq_type != DLQ_VOLENTRY) { - /* Place back onto list and add the vol entries we have */ - dlqLinkf(&entries_to_flush, entryPtr); - entryPtr = (dlqlinkP)0; /* don't want to deallocate below */ - break; - } - - volPtr = (struct budb_volumeEntry *)entryPtr->dlq_structPtr; - if (!volPtr) { - ErrorLog(0, 0, TC_BADQUEUE, 0, - "Warning: Invalid database entry - not added\n"); - break; - } - - memcpy(&volumes[c], volPtr, sizeof(struct budb_volumeEntry)); - free(volPtr); - free(entryPtr); - entryPtr = (dlqlinkP)0; - } - - if (addedDump) { - if (addvolumes) { - code = bcdb_AddVolumes(&volumes[0], c); + } else { + ErrorLog(0, 0, code, 0, + "Warning: Can't create dump %s (DumpID %u) in backup database\n", + dumpPtr->name, dumpPtr->id); + } + } + addedDump = (code ? 0 : 1); + break; + + case DLQ_FINISHDUMP: + dumpPtr = + (struct budb_dumpEntry *)entryPtr->dlq_structPtr; + if (addedDump) { + code = bcdb_FinishDump(dumpPtr); if (code) { - if (code < 0) - addvolumes = 0; - else { - ErrorLog(0, 0, code, 0, - "Warning: Can't add %d volumes to dumpid %u\n", - c, volumes[0].dump); - } + ErrorLog(0, 0, code, 0, + "Warning: Can't finish dump %s (DumpID %u) in backup database\n", + dumpPtr->name, dumpPtr->id); } - } - if (!addvolumes) { - for (i=0; idlq_structPtr; + if (addedDump) { + code = bcdb_UseTape(tapePtr, &new); + if (code) { + ErrorLog(0, 0, code, 0, + "Warning: Can't add tape %s of DumpID %u to backup database\n", + tapePtr->name, tapePtr->dump); + } + } + break; + + case DLQ_FINISHTAPE: + tapePtr = + (struct budb_tapeEntry *)entryPtr->dlq_structPtr; + if (addedDump) { + code = bcdb_FinishTape(tapePtr, &new); + if (code) { + ErrorLog(0, 0, code, 0, + "Warning: Can't finish tape %s of DumpID %u in backup database\n", + tapePtr->name, tapePtr->dump); } - } - } - break; - - default: - ErrorLog(0, 0, 0, 0, - "Warning: dbWatcher: Unrecognized entry type %d\n", - entryPtr->dlq_type); - break; /* ignore */ - } - - if (entryPtr) { - if (entryPtr->dlq_structPtr) - free(entryPtr->dlq_structPtr); - free(entryPtr); - } - entryPtr = (dlqlinkP)0; - dumpPtr = (budb_dumpEntry *)0; - volPtr = (budb_volumeEntry *)0; - tapePtr = (budb_tapeEntry *)0; - } /*while*/ - - dbWatcherinprogress = 0; + } + break; + + case DLQ_VOLENTRY: + /* collect array of volumes to add to the dump */ + for (c = 0; c < MAXVOLUMESTOADD; c++) { + if (c > 0) { /* don't read the 1st - already did */ + entryPtr = dlqUnlinkf(&entries_to_flush); /* Get the next entry */ + if (!entryPtr) + break; + } + + if (entryPtr->dlq_type != DLQ_VOLENTRY) { + /* Place back onto list and add the vol entries we have */ + dlqLinkf(&entries_to_flush, entryPtr); + entryPtr = (dlqlinkP) 0; /* don't want to deallocate below */ + break; + } + + volPtr = + (struct budb_volumeEntry *)entryPtr-> + dlq_structPtr; + if (!volPtr) { + ErrorLog(0, 0, TC_BADQUEUE, 0, + "Warning: Invalid database entry - not added\n"); + break; + } + + memcpy(&volumes[c], volPtr, + sizeof(struct budb_volumeEntry)); + free(volPtr); + free(entryPtr); + entryPtr = (dlqlinkP) 0; + } + + if (addedDump) { + if (addvolumes) { + code = bcdb_AddVolumes(&volumes[0], c); + if (code) { + if (code < 0) + addvolumes = 0; + else { + ErrorLog(0, 0, code, 0, + "Warning: Can't add %d volumes to dumpid %u\n", + c, volumes[0].dump); + } + } + } + if (!addvolumes) { + for (i = 0; i < c; i++) { + code = bcdb_AddVolume(&volumes[i]); + if (code) { + ErrorLog(0, 0, code, 0, + "Warning: Can't add volume %s %u to backup database\n", + volumes[i].name, volumes[i].id); + } + } + } + } + break; + + default: + ErrorLog(0, 0, 0, 0, + "Warning: dbWatcher: Unrecognized entry type %d\n", + entryPtr->dlq_type); + break; /* ignore */ + } + + if (entryPtr) { + if (entryPtr->dlq_structPtr) + free(entryPtr->dlq_structPtr); + free(entryPtr); + } + entryPtr = (dlqlinkP) 0; + dumpPtr = (budb_dumpEntry *) 0; + volPtr = (budb_volumeEntry *) 0; + tapePtr = (budb_tapeEntry *) 0; + } /*while */ + + dbWatcherinprogress = 0; #ifdef AFS_PTHREAD_ENV - sleep(2); + sleep(2); #else - IOMGR_Sleep(2); + IOMGR_Sleep(2); #endif - } + } } diff --git a/src/butc/dump.c b/src/butc/dump.c index 35685027c..8c572b313 100644 --- a/src/butc/dump.c +++ b/src/butc/dump.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/butc/dump.c,v 1.1.1.8 2003/07/30 17:11:31 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/butc/dump.c,v 1.17 2003/12/08 01:45:29 jaltman Exp $"); #include #ifdef AFS_NT40_ENV @@ -53,19 +54,18 @@ extern struct ubik_client *cstruct; dlqlinkT savedEntries; dlqlinkT entries_to_flush; -afs_int32 flushSavedEntries(), finishDump(), finishTape(), useTape(), addVolume(); +afs_int32 flushSavedEntries(), finishDump(), finishTape(), useTape(), +addVolume(); extern struct rx_connection *UV_Bind(); -extern char *globalCellName; - -extern afs_int32 xbsaType; extern afs_int32 groupId; extern afs_int32 BufferSize; extern afs_int32 statusSize; -extern FILE *centralLogIO; -afs_int32 lastPass=0; +extern FILE *centralLogIO; +afs_int32 lastPass = 0; #ifdef xbsa +extern afs_int32 xbsaType; char *butcdumpIdStr = "/backup_afs_volume_dumps"; extern struct butx_transactionInfo butxInfo; extern char *xbsaObjectOwner; @@ -73,10 +73,10 @@ extern char *appObjectOwner; extern char *xbsaSecToken; extern char *xbsalGName; extern char *globalButcLog; -#endif /*xbsa*/ +#endif /*xbsa */ -afs_int32 dataSize; /* Size of data to read on each rx_Read() call */ -afs_int32 tapeblocks; /* Number of 16K tape datablocks in buffer (!CONF_XBSA) */ +afs_int32 dataSize; /* Size of data to read on each rx_Read() call */ +afs_int32 tapeblocks; /* Number of 16K tape datablocks in buffer (!CONF_XBSA) */ /* TBD * @@ -102,37 +102,36 @@ afs_int32 tapeblocks; /* Number of 16K tape datablocks in buffer (!CONF_XBS sprintf(dumpname, "%s (DumpId %u)", name, dbDumpId); #if defined(AFS_NT40_ENV) || (defined(AFS_DARWIN_ENV) && !defined(AFS_DARWIN60_ENV)) || defined(AFS_SUN4_ENV) -localtime_r(t, tm) - time_t *t; - struct tm *tm; +int +localtime_r(time_t * t, struct tm *tm) { - memcpy(tm, localtime(t), sizeof(struct tm)); + memcpy(tm, localtime(t), sizeof(struct tm)); + return 0; } #endif -struct dumpRock -{ +struct dumpRock { /* status only */ - int tapeSeq; - int curVolume; /* index in dumpNode of volume */ - int curVolumeStatus; /* more explicit dump state */ - afs_uint32 curVolStartPos; /* Starting position of the current volume */ - afs_uint32 databaseDumpId; /* real dump id, for db */ - afs_uint32 initialDumpId; /* the initial dump, for appended dumps */ - afs_int32 volumesDumped; /* # volumes successfully dumped */ - afs_int32 volumesFailed; /* # volumes that failed to dump */ - afs_int32 volumesNotDumped; /* # volumes that were not dumped (didn't fail) */ + int tapeSeq; + int curVolume; /* index in dumpNode of volume */ + int curVolumeStatus; /* more explicit dump state */ + afs_uint32 curVolStartPos; /* Starting position of the current volume */ + afs_uint32 databaseDumpId; /* real dump id, for db */ + afs_uint32 initialDumpId; /* the initial dump, for appended dumps */ + afs_int32 volumesDumped; /* # volumes successfully dumped */ + afs_int32 volumesFailed; /* # volumes that failed to dump */ + afs_int32 volumesNotDumped; /* # volumes that were not dumped (didn't fail) */ /* tape management */ - char tapeName[TC_MAXTAPENAMELEN]; - struct butm_tapeInfo *tapeInfoPtr; + char tapeName[TC_MAXTAPENAMELEN]; + struct butm_tapeInfo *tapeInfoPtr; struct butm_tapeLabel tapeLabel; - int wroteLabel; /* If the tape label is written */ + int wroteLabel; /* If the tape label is written */ /* database information */ - struct budb_dumpEntry lastDump; /* the last dump of this volset */ - struct budb_dumpEntry dump; /* current dump */ - struct budb_tapeEntry tape; /* current tape, not used -VA*/ + struct budb_dumpEntry lastDump; /* the last dump of this volset */ + struct budb_dumpEntry dump; /* current dump */ + struct budb_tapeEntry tape; /* current tape, not used -VA */ /* links to existing info */ struct dumpNode *node; @@ -145,59 +144,56 @@ extern int maxpass; afs_int32 tc_EndMargin; afs_int32 tc_KEndMargin; -char *bufferBlock; +static char *bufferBlock; /* compute the absolute expiration date */ afs_int32 -calcExpirationDate(expType, expDate, createTime) - afs_int32 expType; - afs_int32 expDate; - afs_int32 createTime; +calcExpirationDate(afs_int32 expType, afs_int32 expDate, afs_int32 createTime) { struct ktime_date kd; - afs_int32 Add_RelDate_to_Time(); + afs_int32 Add_RelDate_to_Time(); - switch ( expType ) - { - case BC_REL_EXPDATE: - /* expiration date is relative to the creation time of the dump. + switch (expType) { + case BC_REL_EXPDATE: + /* expiration date is relative to the creation time of the dump. * This is the only case that requires any work */ Int32To_ktimeRelDate(expDate, &kd); - return(Add_RelDate_to_Time(&kd, createTime)); + return (Add_RelDate_to_Time(&kd, createTime)); break; - case BC_ABS_EXPDATE: - return(expDate); + case BC_ABS_EXPDATE: + return (expDate); break; - case BC_NO_EXPDATE: - default: - return(0); + case BC_NO_EXPDATE: + default: + return (0); } } -afs_int32 curr_bserver = 0; -struct rx_connection *curr_fromconn = (struct rx_connection *)0; +afs_int32 curr_bserver = 0; +struct rx_connection *curr_fromconn = (struct rx_connection *)0; -struct rx_connection *Bind(server) - afs_int32 server; +struct rx_connection * +Bind(afs_int32 server) { - if (curr_fromconn) { - if (curr_bserver == server) /* Keep connection if have it */ - return (curr_fromconn); - - rx_DestroyConnection (curr_fromconn); /* Otherwise get rid of it */ - curr_fromconn = (struct rx_connection *)0; - curr_bserver = 0; - } - - if (server) { - curr_fromconn = UV_Bind (server, AFSCONF_VOLUMEPORT); /* Establish new connection */ - if (curr_fromconn) curr_bserver = server; - } - - return (curr_fromconn); + if (curr_fromconn) { + if (curr_bserver == server) /* Keep connection if have it */ + return (curr_fromconn); + + rx_DestroyConnection(curr_fromconn); /* Otherwise get rid of it */ + curr_fromconn = (struct rx_connection *)0; + curr_bserver = 0; + } + + if (server) { + curr_fromconn = UV_Bind(server, AFSCONF_VOLUMEPORT); /* Establish new connection */ + if (curr_fromconn) + curr_bserver = server; + } + + return (curr_fromconn); } /* notes @@ -211,64 +207,68 @@ struct rx_connection *Bind(server) #define BIGCHUNK 102400 afs_int32 -dumpVolume(curDump, dparamsPtr) - struct tc_dumpDesc *curDump; - struct dumpRock *dparamsPtr; +dumpVolume(struct tc_dumpDesc * curDump, struct dumpRock * dparamsPtr) { struct butm_tapeInfo *tapeInfoPtr = dparamsPtr->tapeInfoPtr; - struct dumpNode *nodePtr = dparamsPtr->node; - afs_int32 taskId = nodePtr->taskID; - char *buffer; - int fragmentNumber; - afs_int32 volumeFlags; - afs_int32 kRemaining; - afs_int32 rc, code = 0; - afs_int32 toread; + struct dumpNode *nodePtr = dparamsPtr->node; + afs_int32 taskId = nodePtr->taskID; + char *buffer; + int fragmentNumber; + afs_int32 volumeFlags; + afs_int32 kRemaining; + afs_int32 rc, code = 0; + afs_int32 toread; afs_uint32 volBytesRead; afs_uint32 chunkSize; - afs_int32 bytesread; /* rx reads */ - int endofvolume=0; /* Have we read all volume data */ - int indump=0; - int fragmentvolume; - struct volumeHeader hostVolumeHeader; + afs_int32 bytesread; /* rx reads */ + int endofvolume = 0; /* Have we read all volume data */ + int indump = 0; + int fragmentvolume; + struct volumeHeader hostVolumeHeader; - struct rx_call *fromcall = (struct rx_call *)0; + struct rx_call *fromcall = (struct rx_call *)0; struct rx_connection *fromconn; - afs_int32 updatedate, fromtid = 0; - volEntries volumeInfo; - afs_int32 bytesWritten; - afs_uint32 statuscount=statusSize, tsize=0; + afs_int32 updatedate, fromtid = 0; + volEntries volumeInfo; + afs_int32 bytesWritten; + afs_uint32 statuscount = statusSize, tsize = 0; dparamsPtr->curVolumeStatus = DUMP_NOTHING; - fromconn = Bind(htonl(curDump->hostAddr)); /* get connection to the server */ + fromconn = Bind(htonl(curDump->hostAddr)); /* get connection to the server */ /* Determine when the volume was last cloned and updated */ - volumeInfo.volEntries_val = (volintInfo *)0; + volumeInfo.volEntries_val = (volintInfo *) 0; volumeInfo.volEntries_len = 0; - rc = AFSVolListOneVolume(fromconn, curDump->partition, curDump->vid, &volumeInfo); - if (rc) ERROR_EXIT(rc); - updatedate = volumeInfo.volEntries_val[0].updateDate; - curDump->cloneDate = ((curDump->vtype == RWVOL) ? - time(0) : volumeInfo.volEntries_val[0].creationDate); + rc = AFSVolListOneVolume(fromconn, curDump->partition, curDump->vid, + &volumeInfo); + if (rc) + ERROR_EXIT(rc); + updatedate = volumeInfo.volEntries_val[0].updateDate; + curDump->cloneDate = + ((curDump->vtype == + RWVOL) ? time(0) : volumeInfo.volEntries_val[0].creationDate); if (curDump->date >= curDump->cloneDate) - ERROR_EXIT(0); /* not recloned since last dump */ - if (curDump->date > updatedate) { - dparamsPtr->curVolumeStatus = DUMP_NODUMP; /* not modified since last dump */ + ERROR_EXIT(0); /* not recloned since last dump */ + if (curDump->date > updatedate) { + dparamsPtr->curVolumeStatus = DUMP_NODUMP; /* not modified since last dump */ ERROR_EXIT(0); } /* Start the volserver transaction and dump */ - rc = AFSVolTransCreate (fromconn, curDump->vid, curDump->partition, ITBusy, &fromtid); - if (rc) ERROR_EXIT(rc); + rc = AFSVolTransCreate(fromconn, curDump->vid, curDump->partition, ITBusy, + &fromtid); + if (rc) + ERROR_EXIT(rc); fromcall = rx_NewCall(fromconn); - rc = StartAFSVolDump (fromcall, fromtid, curDump->date); - if (rc) ERROR_EXIT(rc); + rc = StartAFSVolDump(fromcall, fromtid, curDump->date); + if (rc) + ERROR_EXIT(rc); dparamsPtr->curVolumeStatus = DUMP_PARTIAL; - dparamsPtr->curVolStartPos = tapeInfoPtr->position; + dparamsPtr->curVolStartPos = tapeInfoPtr->position; /* buffer is place in bufferBlock to write volume data. * butm_writeFileData() assumes the previous BUTM_HDRSIZE bytes @@ -280,26 +280,29 @@ dumpVolume(curDump, dparamsPtr) * A volume with more than 1 fragment means the volume will 'span' * 2 or more tapes. */ - for (fragmentNumber=1; !endofvolume; fragmentNumber++) { /*frag*/ - rc = butm_WriteFileBegin(tapeInfoPtr); + for (fragmentNumber = 1; !endofvolume; fragmentNumber++) { /*frag */ + rc = butm_WriteFileBegin(tapeInfoPtr); if (rc) { - ErrorLog(1, taskId, rc, tapeInfoPtr->error, "Can't write FileBegin on tape\n"); - ERROR_EXIT(rc); + ErrorLog(1, taskId, rc, tapeInfoPtr->error, + "Can't write FileBegin on tape\n"); + ERROR_EXIT(rc); } - indump = 1; /* first write to tape */ + indump = 1; /* first write to tape */ /* Create and Write the volume header */ makeVolumeHeader(&hostVolumeHeader, dparamsPtr, fragmentNumber); hostVolumeHeader.contd = ((fragmentNumber == 1) ? 0 : TC_VOLCONTD); volumeHeader_hton(&hostVolumeHeader, buffer); - rc = butm_WriteFileData(tapeInfoPtr, buffer, 1, sizeof(hostVolumeHeader)); + rc = butm_WriteFileData(tapeInfoPtr, buffer, 1, + sizeof(hostVolumeHeader)); if (rc) { - ErrorLog(1, taskId, rc, tapeInfoPtr->error, "Can't write VolumeHeader on tape\n"); - ERROR_EXIT(rc); + ErrorLog(1, taskId, rc, tapeInfoPtr->error, + "Can't write VolumeHeader on tape\n"); + ERROR_EXIT(rc); } - bytesWritten = BUTM_BLOCKSIZE; /* Wrote one tapeblock */ + bytesWritten = BUTM_BLOCKSIZE; /* Wrote one tapeblock */ tsize += bytesWritten; /* Start reading volume data, rx_Read(), and dumping to the tape @@ -308,15 +311,15 @@ dumpVolume(curDump, dparamsPtr) * tape; in which case we dump the next fragment on the next tape. */ volBytesRead = 0; - chunkSize = 0; + chunkSize = 0; fragmentvolume = 0; - while (!endofvolume && !fragmentvolume) { /*w*/ + while (!endofvolume && !fragmentvolume) { /*w */ bytesread = 0; /* Check for abort in the middle of writing data */ if (volBytesRead >= chunkSize) { - chunkSize += BIGCHUNK; - if ( checkAbortByTaskId(taskId) ) + chunkSize += BIGCHUNK; + if (checkAbortByTaskId(taskId)) ABORT_EXIT(TC_ABORTEDBYREQUEST); /* set bytes dumped for backup */ @@ -336,138 +339,155 @@ dumpVolume(curDump, dparamsPtr) * switch tapes. This allows many small volumes (<16K) to be dumped. */ kRemaining = butm_remainingKSpace(tapeInfoPtr); - if ( (kRemaining < tc_KEndMargin) && - (volBytesRead || (tapeInfoPtr->position > (isafile?3:2))) ) { - fragmentvolume = 1; + if ((kRemaining < tc_KEndMargin) + && (volBytesRead + || (tapeInfoPtr->position > (isafile ? 3 : 2)))) { + fragmentvolume = 1; } /* Guess at how much data to read. So we don't write off end of tape */ if (kRemaining < (tapeblocks * 16)) { - if (kRemaining < 0) { - toread = BUTM_BLKSIZE; - } else { - toread = ((kRemaining/16) + 1) * BUTM_BLKSIZE; - if (toread > dataSize) toread = dataSize; - } + if (kRemaining < 0) { + toread = BUTM_BLKSIZE; + } else { + toread = ((kRemaining / 16) + 1) * BUTM_BLKSIZE; + if (toread > dataSize) + toread = dataSize; + } } /* Read some volume data. */ if (fragmentvolume) { - bytesread = 0; + bytesread = 0; } else { - bytesread = rx_Read(fromcall, buffer, toread); - volBytesRead += bytesread; - if (bytesread != toread) { - /* Make sure were at end of volume and not a communication error */ - rc = rx_Error(fromcall); - if (rc) ERROR_EXIT(rc); - endofvolume = 1; - } + bytesread = rx_Read(fromcall, buffer, toread); + volBytesRead += bytesread; + if (bytesread != toread) { + /* Make sure were at end of volume and not a communication error */ + rc = rx_Error(fromcall); + if (rc) + ERROR_EXIT(rc); + endofvolume = 1; + } } if (fragmentvolume || endofvolume) { - /* Create a volume trailer appending it to this data block */ - makeVolumeHeader(&hostVolumeHeader, dparamsPtr, fragmentNumber); - hostVolumeHeader.contd = (endofvolume ? 0 : TC_VOLCONTD); - hostVolumeHeader.magic = TC_VOLENDMAGIC; - hostVolumeHeader.endTime = (endofvolume ? time(0) : 0); - volumeHeader_hton(&hostVolumeHeader, &buffer[bytesread]); - bytesread += sizeof(hostVolumeHeader); + /* Create a volume trailer appending it to this data block */ + makeVolumeHeader(&hostVolumeHeader, dparamsPtr, + fragmentNumber); + hostVolumeHeader.contd = (endofvolume ? 0 : TC_VOLCONTD); + hostVolumeHeader.magic = TC_VOLENDMAGIC; + hostVolumeHeader.endTime = (endofvolume ? time(0) : 0); + volumeHeader_hton(&hostVolumeHeader, &buffer[bytesread]); + bytesread += sizeof(hostVolumeHeader); } /* Write the datablock out */ /* full data buffer - write it to tape */ - rc = butm_WriteFileData(tapeInfoPtr, buffer, tapeblocks, bytesread); + rc = butm_WriteFileData(tapeInfoPtr, buffer, tapeblocks, + bytesread); if (rc) { - ErrorLog(1, taskId, rc, tapeInfoPtr->error, - "Can't write VolumeData on tape\n"); - ERROR_EXIT(rc); + ErrorLog(1, taskId, rc, tapeInfoPtr->error, + "Can't write VolumeData on tape\n"); + ERROR_EXIT(rc); } bytesWritten = tapeblocks * BUTM_BLOCKSIZE; tsize += bytesWritten; /* Display a status line every statusSize or at end of volume */ - if ( statusSize && - ((tsize >= statuscount) || endofvolume || fragmentvolume) ) { - time_t t = time(0); - struct tm tm; - localtime_r(&t, &tm); - printf("%02d:%02d:%02d: Task %u: %u KB: %s: %u B\n", - tm.tm_hour, tm.tm_min, tm.tm_sec, taskId, - tapeInfoPtr->kBytes, hostVolumeHeader.volumeName, tsize); - statuscount = tsize + statusSize; + if (statusSize + && ((tsize >= statuscount) || endofvolume + || fragmentvolume)) { + time_t t = time(0); + struct tm tm; + localtime_r(&t, &tm); + printf("%02d:%02d:%02d: Task %u: %u KB: %s: %u B\n", + tm.tm_hour, tm.tm_min, tm.tm_sec, taskId, + tapeInfoPtr->kBytes, hostVolumeHeader.volumeName, + tsize); + statuscount = tsize + statusSize; } - } /*w*/ + } /*w */ - /* End the dump before recording it in BUDB as successfully dumped */ - rc = butm_WriteFileEnd(tapeInfoPtr); + /* End the dump before recording it in BUDB as successfully dumped */ + rc = butm_WriteFileEnd(tapeInfoPtr); indump = 0; if (rc) { - ErrorLog(1, taskId, rc, tapeInfoPtr->error, "Can't write FileEnd on tape\n"); - ERROR_EXIT(rc); + ErrorLog(1, taskId, rc, tapeInfoPtr->error, + "Can't write FileEnd on tape\n"); + ERROR_EXIT(rc); } /* Record in BUDB the volume fragment as succcessfully dumped */ - volumeFlags = (( fragmentNumber == 1 ) ? BUDB_VOL_FIRSTFRAG : 0); - if (endofvolume) volumeFlags |= BUDB_VOL_LASTFRAG; + volumeFlags = ((fragmentNumber == 1) ? BUDB_VOL_FIRSTFRAG : 0); + if (endofvolume) + volumeFlags |= BUDB_VOL_LASTFRAG; rc = addVolume(0, dparamsPtr->databaseDumpId, dparamsPtr->tapeName, nodePtr->dumps[dparamsPtr->curVolume].name, nodePtr->dumps[dparamsPtr->curVolume].vid, nodePtr->dumps[dparamsPtr->curVolume].cloneDate, - dparamsPtr->curVolStartPos, - volBytesRead, (fragmentNumber-1), volumeFlags); - if (rc) ABORT_EXIT(rc); + dparamsPtr->curVolStartPos, volBytesRead, + (fragmentNumber - 1), volumeFlags); + if (rc) + ABORT_EXIT(rc); /* If haven't finished dumping the volume, end this * tape and get the next tape. */ if (!endofvolume) { - /* Write an EOT marker. - * Log the error but ignore it since the dump is effectively done. - * Scantape will detect continued volume and not read the EOT. - */ - rc = butm_WriteEOT(tapeInfoPtr); - if (rc) TapeLog(1, taskId, rc, tapeInfoPtr->error, - "Warning: Can't write End-Of-Dump on tape\n"); - - /* Unmount the tape */ - unmountTape(taskId, tapeInfoPtr); - - /* Tell the database the tape is complete (and ok) */ - rc = finishTape(&dparamsPtr->tape, dparamsPtr->tapeInfoPtr->kBytes + - (dparamsPtr->tapeInfoPtr->nBytes ? 1 : 0)); - if (rc) ABORT_EXIT(rc); - - /* get the next tape. Prompt, mount, and add it into the database */ - dparamsPtr->tapeSeq++; - rc = getDumpTape(dparamsPtr, 1, 0); /* interactive - no append */ - if (rc) ABORT_EXIT(rc); - - dparamsPtr->curVolStartPos = tapeInfoPtr->position; + /* Write an EOT marker. + * Log the error but ignore it since the dump is effectively done. + * Scantape will detect continued volume and not read the EOT. + */ + rc = butm_WriteEOT(tapeInfoPtr); + if (rc) + TapeLog(1, taskId, rc, tapeInfoPtr->error, + "Warning: Can't write End-Of-Dump on tape\n"); + + /* Unmount the tape */ + unmountTape(taskId, tapeInfoPtr); + + /* Tell the database the tape is complete (and ok) */ + rc = finishTape(&dparamsPtr->tape, + dparamsPtr->tapeInfoPtr->kBytes + + (dparamsPtr->tapeInfoPtr->nBytes ? 1 : 0)); + if (rc) + ABORT_EXIT(rc); + + /* get the next tape. Prompt, mount, and add it into the database */ + dparamsPtr->tapeSeq++; + rc = getDumpTape(dparamsPtr, 1, 0); /* interactive - no append */ + if (rc) + ABORT_EXIT(rc); + + dparamsPtr->curVolStartPos = tapeInfoPtr->position; } - } /*frag*/ + } /*frag */ dparamsPtr->curVolumeStatus = DUMP_SUCCESS; -error_exit: + error_exit: /* * If we hit the end, see if this is the first volume on the tape or not. * Also, mark the tape as finished if the tape contains other dumps. */ - if (!code) code = rc; + if (!code) + code = rc; if (HITEOT(code)) { - ErrorLog(2, taskId, code, tapeInfoPtr->error, - "Warning: Dump (%s) hit end-of-tape inferred\n", + ErrorLog(2, taskId, code, tapeInfoPtr->error, + "Warning: Dump (%s) hit end-of-tape inferred\n", nodePtr->dumpSetName); - if (tapeInfoPtr->position == 2) { + if (tapeInfoPtr->position == 2) { dparamsPtr->curVolumeStatus = DUMP_NORETRYEOT; } else { dparamsPtr->curVolumeStatus = DUMP_RETRY; - rc = finishTape(&dparamsPtr->tape, dparamsPtr->tapeInfoPtr->kBytes + - (dparamsPtr->tapeInfoPtr->nBytes ? 1 : 0)); - if (rc) ABORT_EXIT(rc); + rc = finishTape(&dparamsPtr->tape, + dparamsPtr->tapeInfoPtr->kBytes + + (dparamsPtr->tapeInfoPtr->nBytes ? 1 : 0)); + if (rc) + ABORT_EXIT(rc); } } @@ -477,94 +497,98 @@ error_exit: * the end of tape. */ else if (indump) { - rc = butm_WriteFileEnd(tapeInfoPtr); - indump = 0; - if (rc) { - ErrorLog(1, taskId, rc, tapeInfoPtr->error, "Can't write FileEnd on tape\n"); - } + rc = butm_WriteFileEnd(tapeInfoPtr); + indump = 0; + if (rc) { + ErrorLog(1, taskId, rc, tapeInfoPtr->error, + "Can't write FileEnd on tape\n"); + } } if (fromcall) { - rc = rx_EndCall (fromcall, 0); - if (!code) code = rc; + rc = rx_EndCall(fromcall, 0); + if (!code) + code = rc; } if (fromtid) { - afs_int32 rcode; - rc = AFSVolEndTrans (fromconn, fromtid, &rcode); - if (!code) code = (rc ? rc : rcode); + afs_int32 rcode; + rc = AFSVolEndTrans(fromconn, fromtid, &rcode); + if (!code) + code = (rc ? rc : rcode); } - return(code); + return (code); -abort_exit: + abort_exit: dparamsPtr->curVolumeStatus = DUMP_FAILED; ERROR_EXIT(code); } afs_int32 -xbsaDumpVolume(curDump, dparamsPtr) - struct tc_dumpDesc *curDump; - struct dumpRock *dparamsPtr; +xbsaDumpVolume(struct tc_dumpDesc * curDump, struct dumpRock * dparamsPtr) { #ifdef xbsa struct butm_tapeInfo *tapeInfoPtr = dparamsPtr->tapeInfoPtr; - struct dumpNode *nodePtr = dparamsPtr->node; - char *buffer = bufferBlock; - afs_int32 taskId = nodePtr->taskID; - afs_int32 rc, code = 0; - afs_int32 toread; + struct dumpNode *nodePtr = dparamsPtr->node; + char *buffer = bufferBlock; + afs_int32 taskId = nodePtr->taskID; + afs_int32 rc, code = 0; + afs_int32 toread; afs_uint32 volBytesRead; afs_uint32 chunkSize; - afs_int32 bytesread; /* rx reads */ - int endofvolume=0; /* Have we read all volume data */ - int begindump=0, indump=0; /* if dump transaction started; if dumping data */ - struct volumeHeader hostVolumeHeader; + afs_int32 bytesread; /* rx reads */ + int endofvolume = 0; /* Have we read all volume data */ + int begindump = 0, indump = 0; /* if dump transaction started; if dumping data */ + struct volumeHeader hostVolumeHeader; - struct rx_call *fromcall = (struct rx_call *)0; + struct rx_call *fromcall = (struct rx_call *)0; struct rx_connection *fromconn; - afs_int32 updatedate, fromtid = 0; - volEntries volumeInfo; - afs_int32 bytesWritten; - afs_uint32 statuscount=statusSize, tsize=0, esize; - afs_hyper_t estSize; + afs_int32 updatedate, fromtid = 0; + volEntries volumeInfo; + afs_int32 bytesWritten; + afs_uint32 statuscount = statusSize, tsize = 0, esize; + afs_hyper_t estSize; char dumpIdStr[XBSA_MAX_OSNAME]; char volumeNameStr[XBSA_MAX_PATHNAME]; static char *dumpDescription = "AFS volume dump"; static char *objectDescription = "XBSA - butc"; - + dparamsPtr->curVolumeStatus = DUMP_NOTHING; - fromconn = Bind(htonl(curDump->hostAddr)); /* get connection to the server */ + fromconn = Bind(htonl(curDump->hostAddr)); /* get connection to the server */ /* Determine when the volume was last cloned and updated */ - volumeInfo.volEntries_val = (volintInfo *)0; + volumeInfo.volEntries_val = (volintInfo *) 0; volumeInfo.volEntries_len = 0; - rc = AFSVolListOneVolume(fromconn, curDump->partition, curDump->vid, &volumeInfo); - if (rc) ERROR_EXIT(rc); - updatedate = volumeInfo.volEntries_val[0].updateDate; - curDump->cloneDate = ((curDump->vtype == RWVOL) ? - time(0) : volumeInfo.volEntries_val[0].creationDate); + rc = AFSVolListOneVolume(fromconn, curDump->partition, curDump->vid, + &volumeInfo); + if (rc) + ERROR_EXIT(rc); + updatedate = volumeInfo.volEntries_val[0].updateDate; + curDump->cloneDate = + ((curDump->vtype == + RWVOL) ? time(0) : volumeInfo.volEntries_val[0].creationDate); /* Get the volume size (in KB) and increase by 25%. Then set as a hyper */ esize = volumeInfo.volEntries_val[0].size; - esize += (esize/4)+1; + esize += (esize / 4) + 1; if (curDump->date >= curDump->cloneDate) - ERROR_EXIT(0); /* not recloned since last dump */ - if (curDump->date > updatedate) { - dparamsPtr->curVolumeStatus = DUMP_NODUMP; /* not modified since last dump */ + ERROR_EXIT(0); /* not recloned since last dump */ + if (curDump->date > updatedate) { + dparamsPtr->curVolumeStatus = DUMP_NODUMP; /* not modified since last dump */ ERROR_EXIT(0); } /* Start a new XBSA Transaction */ rc = xbsa_BeginTrans(&butxInfo); if (rc != XBSA_SUCCESS) { - ErrorLog(1, taskId, rc, 0, "Unable to create a new transaction\n"); - ERROR_EXIT(rc); + ErrorLog(1, taskId, rc, 0, "Unable to create a new transaction\n"); + ERROR_EXIT(rc); } - begindump = 1; /* Will need to do an xbsa_EndTrans */ + begindump = 1; /* Will need to do an xbsa_EndTrans */ /* Start the volserver transaction and dump. Once started, the * volume status is "partial dump". Also, the transaction with @@ -572,160 +596,171 @@ xbsaDumpVolume(curDump, dparamsPtr) * will time out in 600 seconds. After the first rx_Read, * the transaction is not idle. See GCTrans(). */ - rc = AFSVolTransCreate (fromconn, curDump->vid, curDump->partition, ITBusy, &fromtid); - if (rc) ERROR_EXIT(rc); + rc = AFSVolTransCreate(fromconn, curDump->vid, curDump->partition, ITBusy, + &fromtid); + if (rc) + ERROR_EXIT(rc); fromcall = rx_NewCall(fromconn); - - rc = StartAFSVolDump (fromcall, fromtid, curDump->date); - if (rc) ERROR_EXIT(rc); + + rc = StartAFSVolDump(fromcall, fromtid, curDump->date); + if (rc) + ERROR_EXIT(rc); dparamsPtr->curVolumeStatus = DUMP_PARTIAL; - dparamsPtr->curVolStartPos = tapeInfoPtr->position; + dparamsPtr->curVolStartPos = tapeInfoPtr->position; /* Tell XBSA what the name and size of volume to write */ - strcpy(dumpIdStr, butcdumpIdStr); /* "backup_afs_volume_dumps" */ + strcpy(dumpIdStr, butcdumpIdStr); /* "backup_afs_volume_dumps" */ sprintf(volumeNameStr, "/%d", dparamsPtr->databaseDumpId); strcat(volumeNameStr, "/"); - strcat(volumeNameStr, curDump->name); /* / */ + strcat(volumeNameStr, curDump->name); /* / */ hset32(estSize, esize); - hshlft(estSize, 10); /* Multiply by 1024 so its in KB */ + hshlft(estSize, 10); /* Multiply by 1024 so its in KB */ rc = xbsa_WriteObjectBegin(&butxInfo, dumpIdStr, volumeNameStr, xbsalGName, estSize, dumpDescription, objectDescription); if (rc != XBSA_SUCCESS) { - ErrorLog(1, taskId, rc, 0, - "Unable to begin writing of the fileset data to the server\n"); - ERROR_EXIT(rc); + ErrorLog(1, taskId, rc, 0, + "Unable to begin writing of the fileset data to the server\n"); + ERROR_EXIT(rc); } - indump = 1; /* Will need to do an xbsa_WriteObjectEnd */ + indump = 1; /* Will need to do an xbsa_WriteObjectEnd */ /* Create and Write the volume header */ makeVolumeHeader(&hostVolumeHeader, dparamsPtr, 1); hostVolumeHeader.contd = 0; volumeHeader_hton(&hostVolumeHeader, buffer); - rc = xbsa_WriteObjectData(&butxInfo, buffer, sizeof(struct volumeHeader), &bytesWritten); + rc = xbsa_WriteObjectData(&butxInfo, buffer, sizeof(struct volumeHeader), + &bytesWritten); if (rc != XBSA_SUCCESS) { - ErrorLog(1, taskId, rc, 0, "Unable to write VolumeHeader data to the server\n"); - ERROR_EXIT(rc); + ErrorLog(1, taskId, rc, 0, + "Unable to write VolumeHeader data to the server\n"); + ERROR_EXIT(rc); } /* There is a bug in the ADSM library where the bytesWritten is * not filled in, so we set it as correct anyway. */ bytesWritten = sizeof(struct volumeHeader); if (bytesWritten != sizeof(struct volumeHeader)) { - ErrorLog(1, taskId, rc, 0, - "The size of VolumeHeader written (%d) does not equal its actual size (%d)\n", - bytesWritten, sizeof(struct volumeHeader)); - ERROR_EXIT(TC_INTERNALERROR); + ErrorLog(1, taskId, rc, 0, + "The size of VolumeHeader written (%d) does not equal its actual size (%d)\n", + bytesWritten, sizeof(struct volumeHeader)); + ERROR_EXIT(TC_INTERNALERROR); } - incSize(tapeInfoPtr, sizeof(struct volumeHeader)); /* Increment amount we've written */ + incSize(tapeInfoPtr, sizeof(struct volumeHeader)); /* Increment amount we've written */ tsize += bytesWritten; /* Start reading volume data, rx_Read(), and dumping to the tape * until we've dumped the entire volume (endofvolume == 1). */ volBytesRead = 0; - chunkSize = 0; - while (!endofvolume) { /*w*/ - bytesread = 0; - - /* Check for abort in the middle of writing data */ - if (volBytesRead >= chunkSize) { - chunkSize += BIGCHUNK; - if ( checkAbortByTaskId(taskId) ) - ABORT_EXIT(TC_ABORTEDBYREQUEST); - - /* set bytes dumped for backup */ - lock_Status(); - nodePtr->statusNodePtr->nKBytes = tapeInfoPtr->kBytes; - unlock_Status(); - } - - /* Determine how much data to read in upcoming RX_Read() call */ - toread = dataSize; - - /* Read some volume data. */ - bytesread = rx_Read(fromcall, buffer, toread); - volBytesRead += bytesread; - if (bytesread != toread) { - afs_int32 rcode; - - /* Make sure were at end of volume and not a communication error */ - rc = rx_Error(fromcall); - if (rc) ERROR_EXIT(rc); - - endofvolume = 1; - - /* Create a volume trailer appending it to this data block (if not XBSA) */ - makeVolumeHeader(&hostVolumeHeader, dparamsPtr, 1); - hostVolumeHeader.contd = 0; - hostVolumeHeader.magic = TC_VOLENDMAGIC; - hostVolumeHeader.endTime = time(0); - volumeHeader_hton(&hostVolumeHeader, &buffer[bytesread]); - bytesread += sizeof(hostVolumeHeader); - - /* End the dump and transaction with the volserver. We end it now, before - * we make the XBSA call because if XBSA blocks, we could time out on the - * volserver (After last read, the transaction with the volserver is idle). - */ - rc = rx_EndCall (fromcall, 0); - fromcall = 0; - if (rc) ERROR_EXIT(rc); - - rc = AFSVolEndTrans (fromconn, fromtid, &rcode); - fromtid = 0; - if (rc) ERROR_EXIT(rc); - } - - /* Write the datablock out */ - rc = xbsa_WriteObjectData(&butxInfo, buffer, bytesread, &bytesWritten); - if (rc != XBSA_SUCCESS) { - ErrorLog(1, taskId, rc, 0, "Unable to write data to the server\n"); - ERROR_EXIT(rc); - } - /* There is a bug in the ADSM library where the bytesWritten is - * not filled in, so we set it as correct anyway. - */ - bytesWritten = bytesread; - if (bytesWritten != bytesread) { - ErrorLog(1, taskId, rc, 0, - "The size of data written (%d) does not equal size read (%d)\n", - bytesWritten, bytesread); - ERROR_EXIT(TC_INTERNALERROR); - } - - incSize(tapeInfoPtr, bytesread); /* Increment amount we've written */ - tsize += bytesWritten; - - /* Display a status line every statusSize or at end of volume */ - if ( statusSize && ((tsize >= statuscount) || endofvolume) ) { - time_t t = time(0); - struct tm tm; - localtime_r(&t, &tm); - printf("%02d:%02d:%02d: Task %u: %u KB: %s: %u B\n", - tm.tm_hour, tm.tm_min, tm.tm_sec, taskId, - tapeInfoPtr->kBytes, hostVolumeHeader.volumeName, tsize); - statuscount = tsize + statusSize; - } - } /*w*/ + chunkSize = 0; + while (!endofvolume) { /*w */ + bytesread = 0; + + /* Check for abort in the middle of writing data */ + if (volBytesRead >= chunkSize) { + chunkSize += BIGCHUNK; + if (checkAbortByTaskId(taskId)) + ABORT_EXIT(TC_ABORTEDBYREQUEST); + + /* set bytes dumped for backup */ + lock_Status(); + nodePtr->statusNodePtr->nKBytes = tapeInfoPtr->kBytes; + unlock_Status(); + } + + /* Determine how much data to read in upcoming RX_Read() call */ + toread = dataSize; + + /* Read some volume data. */ + bytesread = rx_Read(fromcall, buffer, toread); + volBytesRead += bytesread; + if (bytesread != toread) { + afs_int32 rcode; + + /* Make sure were at end of volume and not a communication error */ + rc = rx_Error(fromcall); + if (rc) + ERROR_EXIT(rc); + + endofvolume = 1; + + /* Create a volume trailer appending it to this data block (if not XBSA) */ + makeVolumeHeader(&hostVolumeHeader, dparamsPtr, 1); + hostVolumeHeader.contd = 0; + hostVolumeHeader.magic = TC_VOLENDMAGIC; + hostVolumeHeader.endTime = time(0); + volumeHeader_hton(&hostVolumeHeader, &buffer[bytesread]); + bytesread += sizeof(hostVolumeHeader); + + /* End the dump and transaction with the volserver. We end it now, before + * we make the XBSA call because if XBSA blocks, we could time out on the + * volserver (After last read, the transaction with the volserver is idle). + */ + rc = rx_EndCall(fromcall, 0); + fromcall = 0; + if (rc) + ERROR_EXIT(rc); + + rc = AFSVolEndTrans(fromconn, fromtid, &rcode); + fromtid = 0; + if (rc) + ERROR_EXIT(rc); + } + + /* Write the datablock out */ + rc = xbsa_WriteObjectData(&butxInfo, buffer, bytesread, + &bytesWritten); + if (rc != XBSA_SUCCESS) { + ErrorLog(1, taskId, rc, 0, + "Unable to write data to the server\n"); + ERROR_EXIT(rc); + } + /* There is a bug in the ADSM library where the bytesWritten is + * not filled in, so we set it as correct anyway. + */ + bytesWritten = bytesread; + if (bytesWritten != bytesread) { + ErrorLog(1, taskId, rc, 0, + "The size of data written (%d) does not equal size read (%d)\n", + bytesWritten, bytesread); + ERROR_EXIT(TC_INTERNALERROR); + } + + incSize(tapeInfoPtr, bytesread); /* Increment amount we've written */ + tsize += bytesWritten; + + /* Display a status line every statusSize or at end of volume */ + if (statusSize && ((tsize >= statuscount) || endofvolume)) { + time_t t = time(0); + struct tm tm; + localtime_r(&t, &tm); + printf("%02d:%02d:%02d: Task %u: %u KB: %s: %u B\n", tm.tm_hour, + tm.tm_min, tm.tm_sec, taskId, tapeInfoPtr->kBytes, + hostVolumeHeader.volumeName, tsize); + statuscount = tsize + statusSize; + } + } /*w */ /* End the XBSA transaction before recording it in BUDB as successfully dumped */ rc = xbsa_WriteObjectEnd(&butxInfo); indump = 0; if (rc != XBSA_SUCCESS) { - ErrorLog(1, taskId, rc, 0, - "Unable to terminate writing of the volume data to the server"); - ERROR_EXIT(rc); + ErrorLog(1, taskId, rc, 0, + "Unable to terminate writing of the volume data to the server"); + ERROR_EXIT(rc); } rc = xbsa_EndTrans(&butxInfo); begindump = 0; tapeInfoPtr->position++; if (rc != XBSA_SUCCESS) { - ErrorLog(1, taskId, rc, 0, "Unable to terminate the current transaction"); - ERROR_EXIT(rc); + ErrorLog(1, taskId, rc, 0, + "Unable to terminate the current transaction"); + ERROR_EXIT(rc); } /* Record in BUDB the volume fragment as succcessfully dumped */ @@ -733,26 +768,28 @@ xbsaDumpVolume(curDump, dparamsPtr) nodePtr->dumps[dparamsPtr->curVolume].name, nodePtr->dumps[dparamsPtr->curVolume].vid, nodePtr->dumps[dparamsPtr->curVolume].cloneDate, - dparamsPtr->curVolStartPos, - volBytesRead, 0/*frag0*/, + dparamsPtr->curVolStartPos, volBytesRead, 0 /*frag0 */ , (BUDB_VOL_FIRSTFRAG | BUDB_VOL_LASTFRAG)); - if (rc) ABORT_EXIT(rc); + if (rc) + ABORT_EXIT(rc); dparamsPtr->curVolumeStatus = DUMP_SUCCESS; -error_exit: + error_exit: /* Cleanup after an error occurs part way into a volume dump */ if (fromcall) { - rc = rx_EndCall (fromcall, 0); - if (!code) code = rc; + rc = rx_EndCall(fromcall, 0); + if (!code) + code = rc; } if (fromtid) { - afs_int32 rcode; - rc = AFSVolEndTrans (fromconn, fromtid, &rcode); - if (!code) code = (rc ? rc : rcode); + afs_int32 rcode; + rc = AFSVolEndTrans(fromconn, fromtid, &rcode); + if (!code) + code = (rc ? rc : rcode); } - + /* If this dump failed, what happens to successive retries * of the volume? How do they get recorded in the XBSA database * (overwritten)? If not, we don't record this in the BUDB database @@ -760,30 +797,33 @@ error_exit: * Also if the volume was never recorded in the DB (partial dump). */ if (indump) { - /* End the Write */ - rc = xbsa_WriteObjectEnd(&butxInfo); - indump = 0; - if (rc != XBSA_SUCCESS) { - ErrorLog(1, taskId, rc, 0, - "Unable to terminate writing of the volume data to the server"); - } - tapeInfoPtr->position++; + /* End the Write */ + rc = xbsa_WriteObjectEnd(&butxInfo); + indump = 0; + if (rc != XBSA_SUCCESS) { + ErrorLog(1, taskId, rc, 0, + "Unable to terminate writing of the volume data to the server"); + } + tapeInfoPtr->position++; } if (begindump) { - /* End the XBSA Transaction */ - rc = xbsa_EndTrans(&butxInfo); - begindump = 0; - if (rc != XBSA_SUCCESS) { - ErrorLog(1, taskId, rc, 0, "Unable to terminate the current transaction"); - } + /* End the XBSA Transaction */ + rc = xbsa_EndTrans(&butxInfo); + begindump = 0; + if (rc != XBSA_SUCCESS) { + ErrorLog(1, taskId, rc, 0, + "Unable to terminate the current transaction"); + } } - return(code); + return (code); -abort_exit: + abort_exit: dparamsPtr->curVolumeStatus = DUMP_FAILED; ERROR_EXIT(code); +#else + return 0; #endif } @@ -803,46 +843,42 @@ abort_exit: */ afs_int32 -dumpPass(dparamsPtr, passNumber) - struct dumpRock *dparamsPtr; - int passNumber; +dumpPass(struct dumpRock * dparamsPtr, int passNumber) { - struct dumpNode *nodePtr = dparamsPtr->node; + struct dumpNode *nodePtr = dparamsPtr->node; struct butm_tapeInfo *tapeInfoPtr = dparamsPtr->tapeInfoPtr; - afs_int32 taskId = nodePtr->taskID; + afs_int32 taskId = nodePtr->taskID; struct tc_dumpDesc *curDump; - int action, e; + int action, e; afs_int32 code = 0, tcode, dvcode; char ch; char retryPrompt(); struct vldbentry vldbEntry; struct sockaddr_in server; - afs_int32 tapepos; + afs_int32 tapepos; TapeLog(2, taskId, 0, 0, "Starting pass %d\n", passNumber); /* while there are more volumes to dump */ - for (dparamsPtr->curVolume = 0; - dparamsPtr->curVolume < nodePtr->arraySize; - dparamsPtr->curVolume++) - { /*w*/ + for (dparamsPtr->curVolume = 0; dparamsPtr->curVolume < nodePtr->arraySize; dparamsPtr->curVolume++) { /*w */ curDump = &nodePtr->dumps[dparamsPtr->curVolume]; - if (curDump->hostAddr == 0) continue; + if (curDump->hostAddr == 0) + continue; /* set name of current volume being dumped */ lock_Status(); - strcpy(nodePtr->statusNodePtr->volumeName, curDump->name); + strcpy(nodePtr->statusNodePtr->volumeName, curDump->name); unlock_Status(); /* Determine location of the volume. * In case the volume moved has moved. */ - if (passNumber > 1) - { /*pass*/ - tcode = bc_GetEntryByID(cstruct, curDump->vid, curDump->vtype, &vldbEntry); - if (tcode) - { - ErrorLog(0, taskId, tcode, 0, + if (passNumber > 1) { /*pass */ + tcode = + bc_GetEntryByID(cstruct, curDump->vid, curDump->vtype, + &vldbEntry); + if (tcode) { + ErrorLog(0, taskId, tcode, 0, "Volume %s (%u) failed - Can't find volume in VLDB\n", curDump->name, curDump->vid); curDump->hostAddr = 0; @@ -850,59 +886,55 @@ dumpPass(dparamsPtr, passNumber) continue; } - switch (curDump->vtype) - { - case BACKVOL: - if ( !(vldbEntry.flags & BACK_EXISTS) ) - { - ErrorLog(0, taskId, 0, 0, - "Volume %s (%u) failed - Backup volume no longer exists\n", - curDump->name, curDump->vid); - curDump->hostAddr = 0; - dparamsPtr->volumesFailed++; - continue; + switch (curDump->vtype) { + case BACKVOL: + if (!(vldbEntry.flags & BACK_EXISTS)) { + ErrorLog(0, taskId, 0, 0, + "Volume %s (%u) failed - Backup volume no longer exists\n", + curDump->name, curDump->vid); + curDump->hostAddr = 0; + dparamsPtr->volumesFailed++; + continue; + } + /* Fall into RWVOL case */ + + case RWVOL: + for (e = 0; e < vldbEntry.nServers; e++) { /* Find the RW volume */ + if (vldbEntry.serverFlags[e] & ITSRWVOL) + break; + } + break; + + case ROVOL: + /* Try to use the server and partition we found the volume on + * Otherwise, use the first RO volume. + */ + for (e = 0; e < vldbEntry.nServers; e++) { /* Find the RO volume */ + if ((curDump->hostAddr == vldbEntry.serverNumber[e]) + && (curDump->partition == + vldbEntry.serverPartition[e])) + break; + } + + if (e >= vldbEntry.nServers) { /* Didn't find RO volume */ + for (e = 0; e < vldbEntry.nServers; e++) { /* Find the first RO volume */ + if (vldbEntry.serverFlags[e] & ITSROVOL) + break; } - /* Fall into RWVOL case */ - - case RWVOL: - for (e=0; ehostAddr == vldbEntry.serverNumber[e] ) && - (curDump->partition == vldbEntry.serverPartition[e]) ) - break; - } - - if (e >= vldbEntry.nServers) - { /* Didn't find RO volume */ - for (e=0; ename, curDump->vid); - curDump->hostAddr = 0; - continue; - break; } + break; + + default: + ErrorLog(0, taskId, 0, 0, + "Volume %s (%u) failed - Unknown volume type\n", + curDump->name, curDump->vid); + curDump->hostAddr = 0; + continue; + break; + } - if (e >=vldbEntry.nServers) - { - ErrorLog(0, taskId, 0, 0, + if (e >= vldbEntry.nServers) { + ErrorLog(0, taskId, 0, 0, "Volume %s (%u) failed - Can't find volume entry in VLDB\n", curDump->name, curDump->vid); curDump->hostAddr = 0; @@ -913,188 +945,185 @@ dumpPass(dparamsPtr, passNumber) /* Remember the server and partition the volume exists on */ memset(&server, 0, sizeof(server)); server.sin_addr.s_addr = vldbEntry.serverNumber[e]; - server.sin_port = 0; - server.sin_family = AF_INET; + server.sin_port = 0; + server.sin_family = AF_INET; #ifdef STRUCT_SOCKADDR_HAS_SA_LEN - server.sin_len = sizeof(struct sockaddr_in); + server.sin_len = sizeof(struct sockaddr_in); #endif - curDump->hostAddr = HOSTADDR(&server); - curDump->partition = vldbEntry.serverPartition[e]; + curDump->hostAddr = HOSTADDR(&server); + curDump->partition = vldbEntry.serverPartition[e]; /* Determine date from which to do an incremental dump */ - if (nodePtr->parent) - { - tcode = bcdb_FindClone(nodePtr->parent, curDump->name, &curDump->date); - if (tcode) curDump->date = 0; - } - else - { - curDump->date = 0; /* do a full dump */ + if (nodePtr->parent) { + tcode = + bcdb_FindClone(nodePtr->parent, curDump->name, + &curDump->date); + if (tcode) + curDump->date = 0; + } else { + curDump->date = 0; /* do a full dump */ } - } /*pass*/ - - if ( checkAbortByTaskId(taskId) ) + } + /*pass */ + if (checkAbortByTaskId(taskId)) ERROR_EXIT(TC_ABORTEDBYREQUEST); - + /* Establish connection to volume - UV_ routine expects * host address in network order */ if (CONF_XBSA) { - dvcode = xbsaDumpVolume(curDump, dparamsPtr); + dvcode = xbsaDumpVolume(curDump, dparamsPtr); } else { - dvcode = dumpVolume(curDump, dparamsPtr); + dvcode = dumpVolume(curDump, dparamsPtr); } action = dparamsPtr->curVolumeStatus; /* Flush volume and tape entries to the database */ tcode = flushSavedEntries(action); - if (tcode) ERROR_EXIT(tcode); - - switch (action) - { - case DUMP_SUCCESS: - TapeLog(1, taskId, 0, 0, "Volume %s (%u) successfully dumped\n", - curDump->name, curDump->vid); - if (dvcode) - ErrorLog(1, taskId, dvcode, 0, - "Warning: Termination processing error on volume %s (%u)\n", - curDump->name, curDump->vid); + if (tcode) + ERROR_EXIT(tcode); + + switch (action) { + case DUMP_SUCCESS: + TapeLog(1, taskId, 0, 0, "Volume %s (%u) successfully dumped\n", + curDump->name, curDump->vid); + if (dvcode) + ErrorLog(1, taskId, dvcode, 0, + "Warning: Termination processing error on volume %s (%u)\n", + curDump->name, curDump->vid); - curDump->hostAddr = 0; - dparamsPtr->volumesDumped++; - break; - - case DUMP_PARTIAL: - case DUMP_NOTHING: - if (action == DUMP_PARTIAL) - { - ErrorLog(1, taskId, dvcode, 0, - "Volume %s (%u) failed - partially dumped\n", - curDump->name, curDump->vid); - } - else if (dvcode) - { - ErrorLog(0, taskId, dvcode, 0, - "Volume %s (%u) failed\n", curDump->name, curDump->vid); - } + curDump->hostAddr = 0; + dparamsPtr->volumesDumped++; + break; + + case DUMP_PARTIAL: + case DUMP_NOTHING: + if (action == DUMP_PARTIAL) { + ErrorLog(1, taskId, dvcode, 0, + "Volume %s (%u) failed - partially dumped\n", + curDump->name, curDump->vid); + } else if (dvcode) { + ErrorLog(0, taskId, dvcode, 0, "Volume %s (%u) failed\n", + curDump->name, curDump->vid); + } else { + ErrorLog(0, taskId, dvcode, 0, + "Volume %s (%u) not dumped - has not been re-cloned since last dump\n", + curDump->name, curDump->vid); + } + + if (passNumber == maxpass) { + if (!queryoperator) + ch = 'o'; else - { - ErrorLog(0, taskId, dvcode, 0, - "Volume %s (%u) not dumped - has not been re-cloned since last dump\n", - curDump->name, curDump->vid); + ch = retryPrompt(curDump->name, curDump->vid, taskId); + + switch (ch) { + case 'r': /* retry */ + dparamsPtr->curVolume--; /* redump this volume */ + continue; + break; + case 'o': /* omit */ + ErrorLog(1, taskId, 0, 0, "Volume %s (%u) omitted\n", + curDump->name, curDump->vid); + dparamsPtr->volumesFailed++; + break; + case 'a': /* abort */ + TapeLog(1, taskId, 0, 0, "Dump aborted\n"); + ERROR_EXIT(TC_ABORTEDBYREQUEST); + break; + default: + ERROR_EXIT(TC_INTERNALERROR); + break; } + } + break; - if (passNumber == maxpass) - { - if (!queryoperator) - ch = 'o'; - else - ch = retryPrompt(curDump->name, curDump->vid, taskId); - - switch ( ch ) - { - case 'r': /* retry */ - dparamsPtr->curVolume--; /* redump this volume */ - continue; - break; - case 'o': /* omit */ - ErrorLog(1, taskId, 0, 0, "Volume %s (%u) omitted\n", - curDump->name, curDump->vid); - dparamsPtr->volumesFailed++; - break; - case 'a': /* abort */ - TapeLog(1, taskId, 0, 0, "Dump aborted\n"); - ERROR_EXIT(TC_ABORTEDBYREQUEST); - break; - default: - ERROR_EXIT(TC_INTERNALERROR); - break; - } - } - break; - - case DUMP_RETRY: - TapeLog(1, taskId, dvcode, 0, - "Volume %s (%u) hit end-of-tape inferred - will retry on next tape\n", - curDump->name, curDump->vid); + case DUMP_RETRY: + TapeLog(1, taskId, dvcode, 0, + "Volume %s (%u) hit end-of-tape inferred - will retry on next tape\n", + curDump->name, curDump->vid); - /* Get the next tape */ - unmountTape(taskId, tapeInfoPtr); + /* Get the next tape */ + unmountTape(taskId, tapeInfoPtr); - dparamsPtr->tapeSeq++; - tcode = getDumpTape(dparamsPtr, 1, 0); /* interactive - no appends */ - if (tcode) ERROR_EXIT(tcode); + dparamsPtr->tapeSeq++; + tcode = getDumpTape(dparamsPtr, 1, 0); /* interactive - no appends */ + if (tcode) + ERROR_EXIT(tcode); - dparamsPtr->curVolume--; /* redump this volume */ - continue; - break; + dparamsPtr->curVolume--; /* redump this volume */ + continue; + break; - case DUMP_NORETRYEOT: - ErrorLog(1, taskId, 0, 0, "Volume %s (%u) failed - volume larger than tape\n", - curDump->name, curDump->vid); + case DUMP_NORETRYEOT: + ErrorLog(1, taskId, 0, 0, + "Volume %s (%u) failed - volume larger than tape\n", + curDump->name, curDump->vid); - /* rewrite the label on the tape - rewind - no need to switch tapes */ - tcode = butm_Create(tapeInfoPtr, &dparamsPtr->tapeLabel, 1); - if (tcode) { - ErrorLog(0, taskId, tcode, tapeInfoPtr->error, "Can't relabel tape\n"); - - unmountTape(taskId, tapeInfoPtr); - tcode = getDumpTape(dparamsPtr, 1, 0); /* interactive - no appends */ - if (tcode) ERROR_EXIT(tcode); - } - else { /* Record the tape in database */ - tapepos = tapeInfoPtr->position; - tcode = useTape(&dparamsPtr->tape, - dparamsPtr->databaseDumpId, - dparamsPtr->tapeName, - (dparamsPtr->tapeSeq + dparamsPtr->dump.tapes.b), - dparamsPtr->tapeLabel.useCount, - dparamsPtr->tapeLabel.creationTime, - dparamsPtr->tapeLabel.expirationDate, - tapepos); - } + /* rewrite the label on the tape - rewind - no need to switch tapes */ + tcode = butm_Create(tapeInfoPtr, &dparamsPtr->tapeLabel, 1); + if (tcode) { + ErrorLog(0, taskId, tcode, tapeInfoPtr->error, + "Can't relabel tape\n"); - curDump->hostAddr = 0; - dparamsPtr->volumesFailed++; - break; + unmountTape(taskId, tapeInfoPtr); + tcode = getDumpTape(dparamsPtr, 1, 0); /* interactive - no appends */ + if (tcode) + ERROR_EXIT(tcode); + } else { /* Record the tape in database */ + tapepos = tapeInfoPtr->position; + tcode = + useTape(&dparamsPtr->tape, dparamsPtr->databaseDumpId, + dparamsPtr->tapeName, + (dparamsPtr->tapeSeq + dparamsPtr->dump.tapes.b), + dparamsPtr->tapeLabel.useCount, + dparamsPtr->tapeLabel.creationTime, + dparamsPtr->tapeLabel.expirationDate, tapepos); + } - case DUMP_NODUMP: - TapeLog(1, taskId, dvcode, 0, - "Volume %s (%u) not dumped - has not been modified since last dump\n", - curDump->name, curDump->vid); + curDump->hostAddr = 0; + dparamsPtr->volumesFailed++; + break; - curDump->hostAddr = 0; - dparamsPtr->volumesNotDumped++; - break; + case DUMP_NODUMP: + TapeLog(1, taskId, dvcode, 0, + "Volume %s (%u) not dumped - has not been modified since last dump\n", + curDump->name, curDump->vid); - default: - ErrorLog(1, taskId, dvcode, 0, "Volume %s (%u) failed\n", - curDump->name, curDump->vid); - ERROR_EXIT(dvcode); - break; + curDump->hostAddr = 0; + dparamsPtr->volumesNotDumped++; + break; + + default: + ErrorLog(1, taskId, dvcode, 0, "Volume %s (%u) failed\n", + curDump->name, curDump->vid); + ERROR_EXIT(dvcode); + break; } - } /*w*/ + } /*w */ -error_exit: + error_exit: /* check if we terminated while processing a volume */ - if (dparamsPtr->curVolume < nodePtr->arraySize) - { - TapeLog(2, taskId, 0, 0, "Terminated while processing Volume %s (%u)\n", - curDump->name, curDump->vid); + if (dparamsPtr->curVolume < nodePtr->arraySize) { + TapeLog(2, taskId, 0, 0, + "Terminated while processing Volume %s (%u)\n", curDump->name, + curDump->vid); } /* print a summary of this pass */ - TapeLog(2, taskId, 0, 0, "End of pass %d: Volumes remaining = %d\n", passNumber, - nodePtr->arraySize - (dparamsPtr->volumesDumped + dparamsPtr->volumesFailed + + TapeLog(2, taskId, 0, 0, "End of pass %d: Volumes remaining = %d\n", + passNumber, + nodePtr->arraySize - (dparamsPtr->volumesDumped + + dparamsPtr->volumesFailed + dparamsPtr->volumesNotDumped)); - return(code); + return (code); } -Dumper(nodePtr) - struct dumpNode *nodePtr; +int +Dumper(struct dumpNode *nodePtr) { - struct dumpRock dparams; + struct dumpRock dparams; struct butm_tapeInfo tapeInfo; int pass; int action; @@ -1102,24 +1131,23 @@ Dumper(nodePtr) afs_int32 code = 0; /* for volume setup */ - struct tc_dumpDesc *dumpDescPtr; - int i; - int failedvolumes = 0; - int dumpedvolumes = 0; - int nodumpvolumes = 0; - char strlevel[5]; - char msg[20]; - char finishedMsg1[50]; - char finishedMsg2[50]; - time_t startTime=0; - time_t endTime=0; - afs_int32 allocbufferSize; + int i; + int failedvolumes = 0; + int dumpedvolumes = 0; + int nodumpvolumes = 0; + char strlevel[5]; + char msg[20]; + char finishedMsg1[50]; + char finishedMsg2[50]; + time_t startTime = 0; + time_t endTime = 0; + afs_int32 allocbufferSize; extern struct deviceSyncNode *deviceLatch; - extern struct tapeConfig globalTapeConfig; + extern struct tapeConfig globalTapeConfig; extern afs_int32 createDump(); - taskId = nodePtr->taskID; /* Get task Id */ + taskId = nodePtr->taskID; /* Get task Id */ setStatus(taskId, DRIVE_WAIT); EnterDeviceQueue(deviceLatch); clearStatus(taskId, DRIVE_WAIT); @@ -1134,23 +1162,23 @@ Dumper(nodePtr) dlqInit(&savedEntries); if (!CONF_XBSA) { - /* Instantiate the tape module */ - tapeInfo.structVersion = BUTM_MAJORVERSION; - code = butm_file_Instantiate(&tapeInfo, &globalTapeConfig); - if (code) { - ErrorLog(0, taskId, code, tapeInfo.error, "Can't initialize the tape module\n"); - ERROR_EXIT(code); - } + /* Instantiate the tape module */ + tapeInfo.structVersion = BUTM_MAJORVERSION; + code = butm_file_Instantiate(&tapeInfo, &globalTapeConfig); + if (code) { + ErrorLog(0, taskId, code, tapeInfo.error, + "Can't initialize the tape module\n"); + ERROR_EXIT(code); + } } /* check if abort requested while waiting on device latch */ - if ( checkAbortByTaskId(taskId) ) - ERROR_EXIT(TC_ABORTEDBYREQUEST); + if (checkAbortByTaskId(taskId)) + ERROR_EXIT(TC_ABORTEDBYREQUEST); /* Are there volumes to dump */ - if (nodePtr->arraySize == 0) - { - TLog(taskId, "Dump (%s), no volumes to dump\n", nodePtr->dumpSetName); + if (nodePtr->arraySize == 0) { + TLog(taskId, "Dump (%s), no volumes to dump\n", nodePtr->dumpSetName); ERROR_EXIT(0); } @@ -1158,19 +1186,21 @@ Dumper(nodePtr) * dataSize is amount of data to read in each rx_Read() call. */ if (CONF_XBSA) { - /* XBSA dumps have not header */ - dataSize = BufferSize; - allocbufferSize = dataSize + sizeof(struct volumeHeader); + /* XBSA dumps have not header */ + dataSize = BufferSize; + allocbufferSize = dataSize + sizeof(struct volumeHeader); } else { - tapeblocks = BufferSize / BUTM_BLOCKSIZE; /* # of 16K tapeblocks */ - dataSize = (tapeblocks * BUTM_BLKSIZE); - allocbufferSize = BUTM_HDRSIZE + dataSize + sizeof(struct volumeHeader); + tapeblocks = BufferSize / BUTM_BLOCKSIZE; /* # of 16K tapeblocks */ + dataSize = (tapeblocks * BUTM_BLKSIZE); + allocbufferSize = + BUTM_HDRSIZE + dataSize + sizeof(struct volumeHeader); } - bufferBlock = (char *)0; + bufferBlock = NULL; bufferBlock = malloc(allocbufferSize); if (!bufferBlock) { - ErrorLog(0, taskId, TC_NOMEMORY, 0, "Can't allocate BUFFERSIZE for dumps\n"); - ERROR_EXIT(TC_NOMEMORY); + ErrorLog(0, taskId, TC_NOMEMORY, 0, + "Can't allocate BUFFERSIZE for dumps\n"); + ERROR_EXIT(TC_NOMEMORY); } /* Determine the dumpid of the most recent dump of this volumeset and dumplevel @@ -1178,55 +1208,59 @@ Dumper(nodePtr) * routine will then find the newly created dump. */ sprintf(strlevel, "%d", nodePtr->level); - code = bcdb_FindLatestDump(nodePtr->volumeSetName, strlevel, &dparams.lastDump); + code = + bcdb_FindLatestDump(nodePtr->volumeSetName, strlevel, + &dparams.lastDump); if (code) { - if (code != BUDB_NODUMPNAME) { - ErrorLog(0, taskId, code, 0, "Can't read backup database\n"); - ERROR_EXIT(code); - } - memset(&dparams.lastDump, 0, sizeof(dparams.lastDump)); + if (code != BUDB_NODUMPNAME) { + ErrorLog(0, taskId, code, 0, "Can't read backup database\n"); + ERROR_EXIT(code); + } + memset(&dparams.lastDump, 0, sizeof(dparams.lastDump)); } - code = createDump(&dparams); /* enter dump into database */ - if (code) - { + code = createDump(&dparams); /* enter dump into database */ + if (code) { ErrorLog(0, taskId, code, 0, "Can't create dump in database\n"); ERROR_EXIT(code); } - TLog(taskId, "Dump %s (DumpID %u)\n", nodePtr->dumpSetName, dparams.databaseDumpId); + TLog(taskId, "Dump %s (DumpID %u)\n", nodePtr->dumpSetName, + dparams.databaseDumpId); if (!CONF_XBSA) { - /* mount the tape and write its label */ - code = getDumpTape(&dparams, autoQuery, nodePtr->doAppend); + /* mount the tape and write its label */ + code = getDumpTape(&dparams, autoQuery, nodePtr->doAppend); } else { - /* Create a dummy tape to satisfy backup databae */ - code = getXBSATape(&dparams); - tapeInfo.position = 1; + /* Create a dummy tape to satisfy backup databae */ + code = getXBSATape(&dparams); + tapeInfo.position = 1; } if (code) { - /* If didn't write the label, remove dump from the database */ - if ( !dparams.wroteLabel ) { - i = bcdb_deleteDump(dparams.databaseDumpId, 0, 0, 0); - if ( i && (i != BUDB_NOENT) ) - ErrorLog(1, taskId, i, 0, "Warning: Can't delete dump %u from database\n", - dparams.databaseDumpId); - else - dparams.databaseDumpId = 0; - } - ERROR_EXIT(code); /* exit with code from getTape */ + /* If didn't write the label, remove dump from the database */ + if (!dparams.wroteLabel) { + i = bcdb_deleteDump(dparams.databaseDumpId, 0, 0, 0); + if (i && (i != BUDB_NOENT)) + ErrorLog(1, taskId, i, 0, + "Warning: Can't delete dump %u from database\n", + dparams.databaseDumpId); + else + dparams.databaseDumpId = 0; + } + ERROR_EXIT(code); /* exit with code from getTape */ } - + startTime = time(0); - for (pass = 1; pass <= maxpass; pass++) - { - lastPass = (pass == maxpass); + for (pass = 1; pass <= maxpass; pass++) { + lastPass = (pass == maxpass); code = dumpPass(&dparams, pass); - if (code) ERROR_EXIT(code); + if (code) + ERROR_EXIT(code); /* if no failed volumes, we're done */ - if ((dparams.volumesDumped + dparams.volumesFailed + dparams.volumesNotDumped) == - nodePtr->arraySize) break; + if ((dparams.volumesDumped + dparams.volumesFailed + + dparams.volumesNotDumped) == nodePtr->arraySize) + break; } /* @@ -1234,29 +1268,36 @@ Dumper(nodePtr) * Scantape may assume another volume and ask for next tape. */ if (!CONF_XBSA) { - code = butm_WriteEOT(&tapeInfo); - if (code) TapeLog(taskId, code, tapeInfo.error, - "Warning: Can't write end-of-dump on tape\n"); + code = butm_WriteEOT(&tapeInfo); + if (code) + TapeLog(taskId, code, tapeInfo.error, + "Warning: Can't write end-of-dump on tape\n"); } - code = finishTape(&dparams.tape, dparams.tapeInfoPtr->kBytes + - (dparams.tapeInfoPtr->nBytes ? 1 : 0)); - if (code) ERROR_EXIT(code); + code = + finishTape(&dparams.tape, + dparams.tapeInfoPtr->kBytes + + (dparams.tapeInfoPtr->nBytes ? 1 : 0)); + if (code) + ERROR_EXIT(code); code = finishDump(&dparams.dump); - if (code) ERROR_EXIT(code); + if (code) + ERROR_EXIT(code); action = dparams.curVolumeStatus; code = flushSavedEntries(action); - if (code) ERROR_EXIT(code); + if (code) + ERROR_EXIT(code); error_exit: endTime = time(0); Bind(0); - if (bufferBlock) free(bufferBlock); + if (bufferBlock) + free(bufferBlock); if (!CONF_XBSA) { - unmountTape(taskId, &tapeInfo); + unmountTape(taskId, &tapeInfo); } waitDbWatcher(); @@ -1269,80 +1310,73 @@ Dumper(nodePtr) nodePtr->statusNodePtr->volsFailed = failedvolumes; unlock_Status(); - lastPass = 1; /* In case we aborted */ + lastPass = 1; /* In case we aborted */ DUMPNAME(finishedMsg1, nodePtr->dumpSetName, dparams.databaseDumpId); sprintf(finishedMsg2, "%d volumes dumped", dumpedvolumes); - if (failedvolumes) - { - sprintf(msg, ", %d failed", failedvolumes); + if (failedvolumes) { + sprintf(msg, ", %d failed", failedvolumes); strcat(finishedMsg2, msg); } - if (nodumpvolumes) - { - sprintf(msg, ", %d unchanged", nodumpvolumes); + if (nodumpvolumes) { + sprintf(msg, ", %d unchanged", nodumpvolumes); strcat(finishedMsg2, msg); } - if (code == TC_ABORTEDBYREQUEST) - { - ErrorLog(0, taskId, 0, 0, - "%s: Aborted by request. %s\n", finishedMsg1, finishedMsg2); + if (code == TC_ABORTEDBYREQUEST) { + ErrorLog(0, taskId, 0, 0, "%s: Aborted by request. %s\n", + finishedMsg1, finishedMsg2); clearStatus(taskId, ABORT_REQUEST); - setStatus (taskId, ABORT_DONE); - } - else if (code) - { - ErrorLog(0, taskId, code, 0, - "%s: Finished with errors. %s\n", finishedMsg1, finishedMsg2); + setStatus(taskId, ABORT_DONE); + } else if (code) { + ErrorLog(0, taskId, code, 0, "%s: Finished with errors. %s\n", + finishedMsg1, finishedMsg2); setStatus(taskId, TASK_ERROR); - } - else - { + } else { TLog(taskId, "%s: Finished. %s\n", finishedMsg1, finishedMsg2); } lastPass = 0; /* Record how long the dump took */ if (centralLogIO && startTime) { - long timediff; - afs_int32 hrs, min, sec, tmp; - char line[1024]; - struct tm tmstart, tmend; - - localtime_r(&startTime, &tmstart); - localtime_r(&endTime, &tmend); - timediff = (int)endTime - (int)startTime; - hrs = timediff / 3600; - tmp = timediff % 3600; - min = tmp / 60; - sec = tmp % 60; - - sprintf(line, "%-5d %02d/%02d/%04d %02d:%02d:%02d " - "%02d/%02d/%04d %02d:%02d:%02d " - "%02d:%02d:%02d " - "%s %d of %d volumes dumped (%ld KB)\n", - taskId, tmstart.tm_mon+1, tmstart.tm_mday, tmstart.tm_year+1900, - tmstart.tm_hour, tmstart.tm_min, tmstart.tm_sec, - tmend.tm_mon+1, tmend.tm_mday, tmend.tm_year+1900, - tmend.tm_hour, tmend.tm_min, tmend.tm_sec, - hrs, min, sec, nodePtr->volumeSetName, - dumpedvolumes, dumpedvolumes+failedvolumes, - dparams.tapeInfoPtr->kBytes+1); - - fwrite(line, strlen(line), 1, centralLogIO); - fflush(centralLogIO); + long timediff; + afs_int32 hrs, min, sec, tmp; + char line[1024]; + struct tm tmstart, tmend; + + localtime_r(&startTime, &tmstart); + localtime_r(&endTime, &tmend); + timediff = (int)endTime - (int)startTime; + hrs = timediff / 3600; + tmp = timediff % 3600; + min = tmp / 60; + sec = tmp % 60; + + sprintf(line, + "%-5d %02d/%02d/%04d %02d:%02d:%02d " + "%02d/%02d/%04d %02d:%02d:%02d " "%02d:%02d:%02d " + "%s %d of %d volumes dumped (%ld KB)\n", taskId, + tmstart.tm_mon + 1, tmstart.tm_mday, tmstart.tm_year + 1900, + tmstart.tm_hour, tmstart.tm_min, tmstart.tm_sec, + tmend.tm_mon + 1, tmend.tm_mday, tmend.tm_year + 1900, + tmend.tm_hour, tmend.tm_min, tmend.tm_sec, hrs, min, sec, + nodePtr->volumeSetName, dumpedvolumes, + dumpedvolumes + failedvolumes, + dparams.tapeInfoPtr->kBytes + 1); + + fwrite(line, strlen(line), 1, centralLogIO); + fflush(centralLogIO); } setStatus(taskId, TASK_DONE); - FreeNode(taskId); /* free the dump node */ + FreeNode(taskId); /* free the dump node */ LeaveDeviceQueue(deviceLatch); - return(code); + return (code); } -#define BELLTIME 60 /* 60 seconds before a bell rings */ -#define BELLCHAR 7 /* ascii for bell */ +#define BELLTIME 60 /* 60 seconds before a bell rings */ +#define BELLCHAR 7 /* ascii for bell */ /* retryPrompt * prompt the user to decide how to handle a failed volume dump. The @@ -1356,10 +1390,7 @@ Dumper(nodePtr) */ char -retryPrompt(volumeName, volumeId, taskId) - char *volumeName; - afs_int32 volumeId; - afs_uint32 taskId; +retryPrompt(char *volumeName, afs_int32 volumeId, afs_uint32 taskId) { afs_int32 start; char ch; @@ -1370,7 +1401,7 @@ retryPrompt(volumeName, volumeId, taskId) printf("Please select action to be taken for this volume\n"); -again: + again: printf("r - retry, try dumping this volume again\n"); printf("o - omit, this volume from this dump\n"); printf("a - abort, the entire dump\n"); @@ -1381,34 +1412,33 @@ again: fflush(stdout); start = time(0); - while(1) - { + while (1) { #ifdef AFS_PTHREAD_ENV - code = GetResponseKey(5, &ch); /* ch stores key pressed */ + code = GetResponseKey(5, &ch); /* ch stores key pressed */ #else - code = LWP_GetResponseKey(5, &ch); /* ch stores key pressed */ + code = LWP_GetResponseKey(5, &ch); /* ch stores key pressed */ #endif - if (code == 1) - break; /* input is available */ + if (code == 1) + break; /* input is available */ - if ( checkAbortByTaskId(taskId) ) - { + if (checkAbortByTaskId(taskId)) { clearStatus(taskId, OPR_WAIT); - printf("This tape operation has been aborted by the coordinator\n"); + printf + ("This tape operation has been aborted by the coordinator\n"); return 'a'; } - if (time(0) > start + BELLTIME) break; + if (time(0) > start + BELLTIME) + break; } /* otherwise, we should beep again, check for abort and go back, * since the GetResponseKey() timed out. */ - if (code == 1) - break; /* input is available */ + if (code == 1) + break; /* input is available */ } clearStatus(taskId, OPR_WAIT); - if ( ch != 'r' && ch != 'o' && ch != 'a' ) - { + if (ch != 'r' && ch != 'o' && ch != 'a') { printf("Please select one of the 3 options, r, o or a\n"); goto again; } @@ -1417,55 +1447,56 @@ again: } /* For testing: it prints the tape label */ -printTapeLabel(tl) - struct butm_tapeLabel *tl; +int +printTapeLabel(struct butm_tapeLabel *tl) { - printf("Tape Label\n"); - printf(" structVersion = %d\n", tl->structVersion); - printf(" creationTime = %u\n", tl->creationTime); - printf(" expirationDate = %u\n", tl->expirationDate); - printf(" AFSName = %s\n", tl->AFSName); - printf(" cell = %s\n", tl->cell); - printf(" dumpid = %d\n", tl->dumpid); - printf(" useCount = %d\n", tl->useCount); - printf(" comment = %s\n", tl->comment); - printf(" pName = %s\n", tl->pName); - printf(" size = %u\n", tl->size); - printf(" dumpPath = %s\n", tl->dumpPath); + printf("Tape Label\n"); + printf(" structVersion = %d\n", tl->structVersion); + printf(" creationTime = %u\n", tl->creationTime); + printf(" expirationDate = %u\n", tl->expirationDate); + printf(" AFSName = %s\n", tl->AFSName); + printf(" cell = %s\n", tl->cell); + printf(" dumpid = %d\n", tl->dumpid); + printf(" useCount = %d\n", tl->useCount); + printf(" comment = %s\n", tl->comment); + printf(" pName = %s\n", tl->pName); + printf(" size = %u\n", tl->size); + printf(" dumpPath = %s\n", tl->dumpPath); + return 0; } /* getXBSATape * Create a tape structure to be satisfy the backup database * even though we don't really use a tape with XBSA. */ -getXBSATape(dparamsPtr) - struct dumpRock *dparamsPtr; +int +getXBSATape(struct dumpRock *dparamsPtr) { - struct dumpNode *nodePtr = dparamsPtr->node; - struct butm_tapeInfo *tapeInfoPtr = dparamsPtr->tapeInfoPtr; + struct dumpNode *nodePtr = dparamsPtr->node; + struct butm_tapeInfo *tapeInfoPtr = dparamsPtr->tapeInfoPtr; struct butm_tapeLabel *tapeLabelPtr = &dparamsPtr->tapeLabel; afs_int32 code = 0; - tc_MakeTapeName(dparamsPtr->tapeName, &nodePtr->tapeSetDesc, dparamsPtr->tapeSeq); + tc_MakeTapeName(dparamsPtr->tapeName, &nodePtr->tapeSetDesc, + dparamsPtr->tapeSeq); - GetNewLabel(tapeInfoPtr, ""/*pName*/, dparamsPtr->tapeName, tapeLabelPtr); + GetNewLabel(tapeInfoPtr, "" /*pName */ , dparamsPtr->tapeName, + tapeLabelPtr); strcpy(tapeLabelPtr->dumpPath, nodePtr->dumpName); - tapeLabelPtr->dumpid = dparamsPtr->databaseDumpId; - tapeLabelPtr->expirationDate = calcExpirationDate(nodePtr->tapeSetDesc.expType, - nodePtr->tapeSetDesc.expDate, - time(0)); + tapeLabelPtr->dumpid = dparamsPtr->databaseDumpId; + tapeLabelPtr->expirationDate = + calcExpirationDate(nodePtr->tapeSetDesc.expType, + nodePtr->tapeSetDesc.expDate, time(0)); /* printTapeLabel(tapeLabelPtr); For testing */ - code = useTape(&dparamsPtr->tape, - dparamsPtr->databaseDumpId, - dparamsPtr->tapeName, - (dparamsPtr->tapeSeq + dparamsPtr->dump.tapes.b), - tapeLabelPtr->useCount, - tapeLabelPtr->creationTime, - tapeLabelPtr->expirationDate, - 0 /*tape position*/); - return(code); + code = + useTape(&dparamsPtr->tape, dparamsPtr->databaseDumpId, + dparamsPtr->tapeName, + (dparamsPtr->tapeSeq + dparamsPtr->dump.tapes.b), + tapeLabelPtr->useCount, tapeLabelPtr->creationTime, + tapeLabelPtr->expirationDate, 0 /*tape position */ ); + return (code); } /* getDumpTape @@ -1477,97 +1508,92 @@ getXBSATape(dparamsPtr) * 1 - prompt regardless */ -getDumpTape(dparamsPtr, interactiveFlag, append) - struct dumpRock *dparamsPtr; - int interactiveFlag; - afs_int32 append; +int +getDumpTape(struct dumpRock *dparamsPtr, int interactiveFlag, + afs_int32 append) { - struct dumpNode *nodePtr = dparamsPtr->node; - struct butm_tapeInfo *tapeInfoPtr = dparamsPtr->tapeInfoPtr; + struct dumpNode *nodePtr = dparamsPtr->node; + struct butm_tapeInfo *tapeInfoPtr = dparamsPtr->tapeInfoPtr; struct butm_tapeLabel *newTapeLabelPtr = &dparamsPtr->tapeLabel; - char AFSTapeName[TC_MAXTAPENAMELEN]; - afs_int32 taskId = nodePtr->taskID; - struct butm_tapeLabel oldTapeLabel; - struct budb_dumpEntry dumpEntry; - struct budb_tapeEntry tapeEntry; + char AFSTapeName[TC_MAXTAPENAMELEN]; + afs_int32 taskId = nodePtr->taskID; + struct butm_tapeLabel oldTapeLabel; + struct budb_dumpEntry dumpEntry; + struct budb_tapeEntry tapeEntry; struct budb_volumeEntry volEntry; - Date oldTapeExpiration, expir; - afs_int32 curTime; + Date expir; afs_int32 doAppend; afs_int32 code = 0; - int askForTape, opcode; - int tapecount = 1; - char strlevel[5]; + int askForTape; + int tapecount = 1; + char strlevel[5]; afs_int32 tapepos, lastpos; extern struct tapeConfig globalTapeConfig; extern struct udbHandleS udbHandle; - extern afs_int32 BUDB_DeleteDump(); askForTape = interactiveFlag; dparamsPtr->wroteLabel = 0; /* Keep prompting for a tape until we get it right */ - while (1) - { - /* What the name of the tape would be if not appending to it */ - tc_MakeTapeName(AFSTapeName, &nodePtr->tapeSetDesc, dparamsPtr->tapeSeq); - - doAppend = append; - - if (askForTape) - { - code = PromptForTape((doAppend ? APPENDOPCODE : WRITEOPCODE), - AFSTapeName, dparamsPtr->databaseDumpId, taskId, tapecount); - if (code) ERROR_EXIT(code); + while (1) { + /* What the name of the tape would be if not appending to it */ + tc_MakeTapeName(AFSTapeName, &nodePtr->tapeSetDesc, + dparamsPtr->tapeSeq); + + doAppend = append; + + if (askForTape) { + code = + PromptForTape((doAppend ? APPENDOPCODE : WRITEOPCODE), + AFSTapeName, dparamsPtr->databaseDumpId, taskId, + tapecount); + if (code) + ERROR_EXIT(code); } askForTape = 1; tapecount++; /* open the tape device */ code = butm_Mount(tapeInfoPtr, AFSTapeName); - if (code) - { + if (code) { TapeLog(0, taskId, code, tapeInfoPtr->error, "Can't open tape\n"); goto getNewTape; } /* Read the tape label */ - code = butm_ReadLabel(tapeInfoPtr, &oldTapeLabel, 1); /* rewind */ + code = butm_ReadLabel(tapeInfoPtr, &oldTapeLabel, 1); /* rewind */ if (code) { - if (tapeInfoPtr->error) { - ErrorLog(0, taskId, code, tapeInfoPtr->error, - "Warning: Tape error while reading label (will proceed with dump)\n"); - } - memset(&oldTapeLabel, 0, sizeof(oldTapeLabel)); + if (tapeInfoPtr->error) { + ErrorLog(0, taskId, code, tapeInfoPtr->error, + "Warning: Tape error while reading label (will proceed with dump)\n"); + } + memset(&oldTapeLabel, 0, sizeof(oldTapeLabel)); } /* Check if null tape. Prior 3.3, backup tapes have no dump id */ - if ( (strcmp(oldTapeLabel.AFSName,"") == 0) && (oldTapeLabel.dumpid == 0) ) - { - if (doAppend) - { - TLog(taskId, "Dump not found on tape. Proceeding with initial dump\n"); + if ((strcmp(oldTapeLabel.AFSName, "") == 0) + && (oldTapeLabel.dumpid == 0)) { + if (doAppend) { + TLog(taskId, + "Dump not found on tape. Proceeding with initial dump\n"); doAppend = 0; } - } - else if (doAppend) /* appending */ - { + } else if (doAppend) { /* appending */ /* Check that we don't have a database dump tape */ - if ( databaseTape(oldTapeLabel.AFSName) ) - { - char gotName[BU_MAXTAPELEN+32]; + if (databaseTape(oldTapeLabel.AFSName)) { + char gotName[BU_MAXTAPELEN + 32]; - /* label does not match */ + /* label does not match */ LABELNAME(gotName, &oldTapeLabel); - TLog(taskId, "Can't append to database tape %s\n", gotName); + TLog(taskId, "Can't append to database tape %s\n", gotName); goto getNewTape; } /* Verify that the tape is of version 4 (AFS 3.3) or greater */ - if (oldTapeLabel.structVersion < TAPE_VERSION_4) - { - TLog(taskId, "Can't append: requires tape version %d or greater\n", + if (oldTapeLabel.structVersion < TAPE_VERSION_4) { + TLog(taskId, + "Can't append: requires tape version %d or greater\n", TAPE_VERSION_4); goto getNewTape; } @@ -1575,113 +1601,108 @@ getDumpTape(dparamsPtr, interactiveFlag, append) /* Verify that the last tape of the dump set is in the drive. * volEntry will be zeroed if last dump has no volume entries. */ - code = bcdb_FindLastTape(oldTapeLabel.dumpid, &dumpEntry, &tapeEntry, &volEntry); + code = + bcdb_FindLastTape(oldTapeLabel.dumpid, &dumpEntry, &tapeEntry, + &volEntry); if (code) { - ErrorLog(0, taskId, code, 0, - "Can't append: Can't find last volume of dumpId %u in database\n", + ErrorLog(0, taskId, code, 0, + "Can't append: Can't find last volume of dumpId %u in database\n", oldTapeLabel.dumpid); - printf("Please scan the dump in or choose another tape\n"); - goto getNewTape; + printf("Please scan the dump in or choose another tape\n"); + goto getNewTape; } - lastpos = (volEntry.position ? volEntry.position : tapeEntry.labelpos); + lastpos = + (volEntry.position ? volEntry.position : tapeEntry.labelpos); - if (strcmp(TNAME(&oldTapeLabel),tapeEntry.name)) - { - char expName[BU_MAXTAPELEN+32], gotName[BU_MAXTAPELEN+32]; + if (strcmp(TNAME(&oldTapeLabel), tapeEntry.name)) { + char expName[BU_MAXTAPELEN + 32], gotName[BU_MAXTAPELEN + 32]; TAPENAME(expName, tapeEntry.name, oldTapeLabel.dumpid); LABELNAME(gotName, &oldTapeLabel); - TLog(taskId, + TLog(taskId, "Can't append: Last tape in dump-set is %s, label seen %s\n", expName, gotName); goto getNewTape; } /* After reading the tape label, we now know what it is */ - strcpy (AFSTapeName, oldTapeLabel.AFSName); /* the real name */ - strcpy (tapeInfoPtr->name, oldTapeLabel.AFSName); /* the real name */ + strcpy(AFSTapeName, oldTapeLabel.AFSName); /* the real name */ + strcpy(tapeInfoPtr->name, oldTapeLabel.AFSName); /* the real name */ /* Position after last volume on the tape */ code = butm_SeekEODump(tapeInfoPtr, lastpos); - if (code) - { - ErrorLog(0, taskId, code, tapeInfoPtr->error, - "Can't append: Can't position to end of dump on tape %s\n", + if (code) { + ErrorLog(0, taskId, code, tapeInfoPtr->error, + "Can't append: Can't position to end of dump on tape %s\n", tapeEntry.name); goto getNewTape; } /* Track size of tape - set after seek since seek changes the value */ tapeInfoPtr->kBytes = tapeEntry.useKBytes; - } - else /* not appending */ - { + } else { /* not appending */ + afs_uint32 tapeid; - afs_uint32 dmp, parent; + afs_uint32 dmp; struct budb_dumpEntry de, de2; - /* Check if tape name is not what expected - null tapes are acceptable * Don't do check if the tape has a user defined label. */ - if ( dump_namecheck && (strcmp(oldTapeLabel.pName,"")==0) ) - { - if ( strcmp(oldTapeLabel.AFSName,"") && /* not null tape */ - strcmp(oldTapeLabel.AFSName,AFSTapeName) ) /* not expected name */ - { - TLog(taskId, "Tape label expected %s, label seen %s\n", + if (dump_namecheck && (strcmp(oldTapeLabel.pName, "") == 0)) { + if (strcmp(oldTapeLabel.AFSName, "") && /* not null tape */ + strcmp(oldTapeLabel.AFSName, AFSTapeName)) { /* not expected name */ + TLog(taskId, "Tape label expected %s, label seen %s\n", AFSTapeName, oldTapeLabel.AFSName); goto getNewTape; } /* Check that we don't have a database dump tape */ - if ( databaseTape(oldTapeLabel.AFSName) ) - { + if (databaseTape(oldTapeLabel.AFSName)) { /* label does not match */ - TLog(taskId, "Tape label expected %s, can't dump to database tape %s\n", + TLog(taskId, + "Tape label expected %s, can't dump to database tape %s\n", AFSTapeName, oldTapeLabel.AFSName); goto getNewTape; } } /* Verify the tape has not expired - only check if not appending */ - if ( !tapeExpired(&oldTapeLabel) ) { - TLog(taskId, "This tape has not expired\n"); + if (!tapeExpired(&oldTapeLabel)) { + TLog(taskId, "This tape has not expired\n"); goto getNewTape; } /* Given a tape dump with good data, verify we don't overwrite recent dumps * and also verify that the volume will be restorable - if not print warnings */ - if (oldTapeLabel.dumpid) - { + if (oldTapeLabel.dumpid) { /* Do not overwrite a tape that belongs to the dump's dumpset */ - tapeid = (dparamsPtr->initialDumpId ? dparamsPtr->initialDumpId : - dparamsPtr->databaseDumpId); - if (oldTapeLabel.dumpid == tapeid) - { - ErrorLog(0, taskId, 0, 0, + tapeid = + (dparamsPtr->initialDumpId ? dparamsPtr-> + initialDumpId : dparamsPtr->databaseDumpId); + if (oldTapeLabel.dumpid == tapeid) { + ErrorLog(0, taskId, 0, 0, "Can't overwrite tape containing the dump in progress\n"); goto getNewTape; } - + /* Since the dumpset on this tape will be deleted from database, check if * any of the dump's parent-dumps are on this tape. */ - for (dmp=nodePtr->parent; dmp; dmp=de.parent) - { + for (dmp = nodePtr->parent; dmp; dmp = de.parent) { code = bcdb_FindDumpByID(dmp, &de); if (code) { - ErrorLog(0, taskId, 0, 0, - "Warning: Can't find parent dump %u in backup database\n", + ErrorLog(0, taskId, 0, 0, + "Warning: Can't find parent dump %u in backup database\n", dmp); break; } tapeid = (de.initialDumpID ? de.initialDumpID : de.id); if (oldTapeLabel.dumpid == tapeid) { - ErrorLog(0, taskId, 0, 0, + ErrorLog(0, taskId, 0, 0, "Can't overwrite the parent dump %s (DumpID %u)\n", de.name, de.id); goto getNewTape; @@ -1691,36 +1712,38 @@ getDumpTape(dparamsPtr, interactiveFlag, append) /* Since the dumpset on this tape will be deleted from database, check if * any of the dumps in this dumpset are most-recent-dumps. */ - for (dmp=oldTapeLabel.dumpid; dmp; dmp=de.appendedDumpID) { + for (dmp = oldTapeLabel.dumpid; dmp; dmp = de.appendedDumpID) { if (dmp == dparamsPtr->lastDump.id) { memcpy(&de, &dparamsPtr->lastDump, sizeof(de)); memcpy(&de2, &dparamsPtr->lastDump, sizeof(de2)); - } - else { - code = bcdb_FindDumpByID(dmp, &de); - if (code) break; + } else { + code = bcdb_FindDumpByID(dmp, &de); + if (code) + break; sprintf(strlevel, "%d", de.level); - code = bcdb_FindLatestDump(de.volumeSetName, strlevel, &de2); - if (code) continue; + code = + bcdb_FindLatestDump(de.volumeSetName, strlevel, + &de2); + if (code) + continue; } /* If dump on the tape is the latest dump at this level */ if (de.id == de2.id) { - if (strcmp(DUMP_TAPE_NAME,de2.name) == 0) { - ErrorLog(0, taskId, 0, 0, - "Warning: Overwriting most recent dump %s (DumpID %u)\n", - de.name, de.id); - } - else { - ErrorLog(0, taskId, 0, 0, - "Warning: Overwriting most recent dump of the '%s' volumeset: %s (DumpID %u)\n", - de.volumeSetName, de.name, de.id); - } + if (strcmp(DUMP_TAPE_NAME, de2.name) == 0) { + ErrorLog(0, taskId, 0, 0, + "Warning: Overwriting most recent dump %s (DumpID %u)\n", + de.name, de.id); + } else { + ErrorLog(0, taskId, 0, 0, + "Warning: Overwriting most recent dump of the '%s' volumeset: %s (DumpID %u)\n", + de.volumeSetName, de.name, de.id); + } } } - } /* if (oldTapeLabel.dumpid) */ - } /* else not appending */ - + } /* if (oldTapeLabel.dumpid) */ + } /* else not appending */ + /* * Now have the right tape. Create a new label for the tape * Appended labels have the dump's dumpId - labels at beginnings of @@ -1728,17 +1751,19 @@ getDumpTape(dparamsPtr, interactiveFlag, append) * Appended labels do not increment the useCount. * Labels at beginnings of tape use the most future expiration of the dump set. */ - GetNewLabel(tapeInfoPtr, oldTapeLabel.pName, AFSTapeName, newTapeLabelPtr); + GetNewLabel(tapeInfoPtr, oldTapeLabel.pName, AFSTapeName, + newTapeLabelPtr); strcpy(newTapeLabelPtr->dumpPath, nodePtr->dumpName); - newTapeLabelPtr->expirationDate = - calcExpirationDate(nodePtr->tapeSetDesc.expType, nodePtr->tapeSetDesc.expDate, time(0)); - newTapeLabelPtr->dumpid = dparamsPtr->databaseDumpId; + newTapeLabelPtr->expirationDate = + calcExpirationDate(nodePtr->tapeSetDesc.expType, + nodePtr->tapeSetDesc.expDate, time(0)); + newTapeLabelPtr->dumpid = dparamsPtr->databaseDumpId; newTapeLabelPtr->useCount = oldTapeLabel.useCount; if (!doAppend) { newTapeLabelPtr->useCount++; if (dparamsPtr->initialDumpId) { - newTapeLabelPtr->dumpid = dparamsPtr->initialDumpId; + newTapeLabelPtr->dumpid = dparamsPtr->initialDumpId; expir = ExpirationDate(dparamsPtr->initialDumpId); if (expir > newTapeLabelPtr->expirationDate) newTapeLabelPtr->expirationDate = expir; @@ -1747,62 +1772,61 @@ getDumpTape(dparamsPtr, interactiveFlag, append) /* write the label on the tape - rewind if not appending and vice-versa */ code = butm_Create(tapeInfoPtr, newTapeLabelPtr, !doAppend); - if (code) - { - char gotName[BU_MAXTAPELEN+32]; + if (code) { + char gotName[BU_MAXTAPELEN + 32]; LABELNAME(gotName, newTapeLabelPtr); - TapeLog(0, taskId, code, tapeInfoPtr->error, "Can't label tape as %s\n", gotName); + TapeLog(0, taskId, code, tapeInfoPtr->error, + "Can't label tape as %s\n", gotName); goto getNewTape; } - dparamsPtr->wroteLabel = 1; /* Remember we wrote the label */ - tapepos = tapeInfoPtr->position-1; + dparamsPtr->wroteLabel = 1; /* Remember we wrote the label */ + tapepos = tapeInfoPtr->position - 1; strcpy(dparamsPtr->tapeName, TNAME(newTapeLabelPtr)); /* If appending, set dumpentry in the database as appended. */ - if (doAppend) - { - char gotName[BU_MAXTAPELEN+32]; + if (doAppend) { + char gotName[BU_MAXTAPELEN + 32]; nodePtr->tapeSetDesc.b = extractTapeSeq(AFSTapeName); dparamsPtr->dump.tapes.b = nodePtr->tapeSetDesc.b; dparamsPtr->initialDumpId = oldTapeLabel.dumpid; strcpy(nodePtr->tapeSetDesc.format, dumpEntry.tapes.format); - code = bcdb_MakeDumpAppended(dparamsPtr->databaseDumpId, - dparamsPtr->initialDumpId, nodePtr->tapeSetDesc.b); + code = + bcdb_MakeDumpAppended(dparamsPtr->databaseDumpId, + dparamsPtr->initialDumpId, + nodePtr->tapeSetDesc.b); if (code) - ErrorLog(2, taskId, code, 0, + ErrorLog(2, taskId, code, 0, "Warning: Can't append dump %u to dump %u in database\n", - dparamsPtr->databaseDumpId, dparamsPtr->initialDumpId); + dparamsPtr->databaseDumpId, + dparamsPtr->initialDumpId); LABELNAME(gotName, &oldTapeLabel); TLog(taskId, "Appending dump %s (DumpID %u) to tape %s\n", - nodePtr->dumpSetName, dparamsPtr->databaseDumpId, gotName); + nodePtr->dumpSetName, dparamsPtr->databaseDumpId, gotName); } /* If not appending, delete overwritten dump from the database */ - else - { - if ( (oldTapeLabel.structVersion >= TAPE_VERSION_3) && oldTapeLabel.dumpid ) - { - code = bcdb_deleteDump(oldTapeLabel.dumpid, 0, 0, 0); - if ( code && (code != BUDB_NOENT) ) - ErrorLog(0, taskId, code, 0, + else { + if ((oldTapeLabel.structVersion >= TAPE_VERSION_3) + && oldTapeLabel.dumpid) { + code = bcdb_deleteDump(oldTapeLabel.dumpid, 0, 0, 0); + if (code && (code != BUDB_NOENT)) + ErrorLog(0, taskId, code, 0, "Warning: Can't delete old dump %u from database\n", oldTapeLabel.dumpid); } } - code = useTape(&dparamsPtr->tape, - dparamsPtr->databaseDumpId, - dparamsPtr->tapeName, - (dparamsPtr->tapeSeq + dparamsPtr->dump.tapes.b), - newTapeLabelPtr->useCount, - newTapeLabelPtr->creationTime, - newTapeLabelPtr->expirationDate, - tapepos); + code = + useTape(&dparamsPtr->tape, dparamsPtr->databaseDumpId, + dparamsPtr->tapeName, + (dparamsPtr->tapeSeq + dparamsPtr->dump.tapes.b), + newTapeLabelPtr->useCount, newTapeLabelPtr->creationTime, + newTapeLabelPtr->expirationDate, tapepos); /* * The margin of space to check for end of tape is set to the @@ -1812,7 +1836,7 @@ getDumpTape(dparamsPtr, interactiveFlag, append) * and up to two EOF markers done on close (3 16K blocks + 4 EOF * markers). */ - tc_EndMargin = (3 * 16384 + 4 * globalTapeConfig.fileMarkSize) * 2; + tc_EndMargin = (3 * 16384 + 4 * globalTapeConfig.fileMarkSize) * 2; tc_KEndMargin = tc_EndMargin / 1024; break; @@ -1820,14 +1844,13 @@ getDumpTape(dparamsPtr, interactiveFlag, append) unmountTape(taskId, tapeInfoPtr); } -error_exit: - return(code); + error_exit: + return (code); } -makeVolumeHeader(vhptr, dparamsPtr, fragmentNumber) - struct volumeHeader *vhptr; - struct dumpRock *dparamsPtr; - int fragmentNumber; +int +makeVolumeHeader(struct volumeHeader *vhptr, struct dumpRock *dparamsPtr, + int fragmentNumber) { struct dumpNode *nodePtr = dparamsPtr->node; struct tc_dumpDesc *curDump; @@ -1851,43 +1874,43 @@ makeVolumeHeader(vhptr, dparamsPtr, fragmentNumber) vhptr->endTime = 0; vhptr->versionflags = CUR_TAPE_VERSION; strcpy(vhptr->dumpSetName, nodePtr->dumpSetName); - strcpy(vhptr->preamble,"H++NAME#"); - strcpy(vhptr->postamble,"T--NAME#"); -error_exit: + strcpy(vhptr->preamble, "H++NAME#"); + strcpy(vhptr->postamble, "T--NAME#"); + return (code); } -volumeHeader_hton(hostPtr, netPtr) - struct volumeHeader *hostPtr, *netPtr; +int +volumeHeader_hton(struct volumeHeader *hostPtr, struct volumeHeader *netPtr) { struct volumeHeader volHdr; - strcpy(volHdr.preamble, hostPtr->preamble); - strcpy(volHdr.postamble, hostPtr->postamble); - strcpy(volHdr.volumeName, hostPtr->volumeName); + strcpy(volHdr.preamble, hostPtr->preamble); + strcpy(volHdr.postamble, hostPtr->postamble); + strcpy(volHdr.volumeName, hostPtr->volumeName); strcpy(volHdr.dumpSetName, hostPtr->dumpSetName); - volHdr.volumeID = htonl(hostPtr->volumeID); - volHdr.server = htonl(hostPtr->server); - volHdr.part = htonl(hostPtr->part); - volHdr.from = htonl(hostPtr->from); - volHdr.frag = htonl(hostPtr->frag); - volHdr.magic = htonl(hostPtr->magic); - volHdr.contd = htonl(hostPtr->contd); - volHdr.dumpID = htonl(hostPtr->dumpID); - volHdr.level = htonl(hostPtr->level); - volHdr.parentID = htonl(hostPtr->parentID); - volHdr.endTime = htonl(hostPtr->endTime); + volHdr.volumeID = htonl(hostPtr->volumeID); + volHdr.server = htonl(hostPtr->server); + volHdr.part = htonl(hostPtr->part); + volHdr.from = htonl(hostPtr->from); + volHdr.frag = htonl(hostPtr->frag); + volHdr.magic = htonl(hostPtr->magic); + volHdr.contd = htonl(hostPtr->contd); + volHdr.dumpID = htonl(hostPtr->dumpID); + volHdr.level = htonl(hostPtr->level); + volHdr.parentID = htonl(hostPtr->parentID); + volHdr.endTime = htonl(hostPtr->endTime); volHdr.versionflags = htonl(hostPtr->versionflags); - volHdr.cloneDate = htonl(hostPtr->cloneDate); + volHdr.cloneDate = htonl(hostPtr->cloneDate); memcpy(netPtr, &volHdr, sizeof(struct volumeHeader)); + return 0; } /* database related routines */ afs_int32 -createDump(dparamsPtr) - struct dumpRock *dparamsPtr; +createDump(struct dumpRock *dparamsPtr) { struct dumpNode *nodePtr = dparamsPtr->node; struct budb_dumpEntry *dumpPtr; @@ -1898,38 +1921,38 @@ createDump(dparamsPtr) /* id filled in by database */ dumpPtr->parent = nodePtr->parent; - dumpPtr->level = nodePtr->level; - dumpPtr->flags = 0; + dumpPtr->level = nodePtr->level; + dumpPtr->flags = 0; #ifdef xbsa if (CONF_XBSA) { - if (xbsaType == XBSA_SERVER_TYPE_ADSM) { - strcpy(dumpPtr->tapes.tapeServer, butxInfo.serverName); - dumpPtr->flags = BUDB_DUMP_ADSM; - } - if (!(butxInfo.serverType & XBSA_SERVER_FLAG_MULTIPLE)) { - /* The current server (API) doesn't provide the function required - * to specify a server at startup time. For that reason, we can't - * be sure that the server name supplied by the user in the user- - * defined configuration file is correct. We set a flag here so - * we know at restore time that the servername info in the backup - * database may be incorrect. We will not allow a server switch - * at that time, even if the server at restore time supports - * multiple servers. - */ - dumpPtr->flags |= BUDB_DUMP_XBSA_NSS; - } + if (xbsaType == XBSA_SERVER_TYPE_ADSM) { + strcpy(dumpPtr->tapes.tapeServer, butxInfo.serverName); + dumpPtr->flags = BUDB_DUMP_ADSM; + } + if (!(butxInfo.serverType & XBSA_SERVER_FLAG_MULTIPLE)) { + /* The current server (API) doesn't provide the function required + * to specify a server at startup time. For that reason, we can't + * be sure that the server name supplied by the user in the user- + * defined configuration file is correct. We set a flag here so + * we know at restore time that the servername info in the backup + * database may be incorrect. We will not allow a server switch + * at that time, even if the server at restore time supports + * multiple servers. + */ + dumpPtr->flags |= BUDB_DUMP_XBSA_NSS; + } } #endif strcpy(dumpPtr->volumeSetName, nodePtr->volumeSetName); - strcpy(dumpPtr->dumpPath, nodePtr->dumpName); - strcpy(dumpPtr->name, nodePtr->dumpSetName); - dumpPtr->created = 0; /* let database assign it */ - dumpPtr->incTime = 0; /* not really used */ - dumpPtr->nVolumes = 0; + strcpy(dumpPtr->dumpPath, nodePtr->dumpName); + strcpy(dumpPtr->name, nodePtr->dumpSetName); + dumpPtr->created = 0; /* let database assign it */ + dumpPtr->incTime = 0; /* not really used */ + dumpPtr->nVolumes = 0; dumpPtr->initialDumpID = 0; - dumpPtr->tapes.id = groupId; - dumpPtr->tapes.b = 1; + dumpPtr->tapes.id = groupId; + dumpPtr->tapes.b = 1; dumpPtr->tapes.maxTapes = 0; strcpy(dumpPtr->tapes.format, nodePtr->tapeSetDesc.format); @@ -1937,9 +1960,10 @@ createDump(dparamsPtr) /* now call the database to create the entry */ code = bcdb_CreateDump(dumpPtr); - if (code == 0) dparamsPtr->databaseDumpId = dumpPtr->id; + if (code == 0) + dparamsPtr->databaseDumpId = dumpPtr->id; - return(code); + return (code); } #ifdef xbsa @@ -1948,65 +1972,72 @@ createDump(dparamsPtr) * server as the original server and go back to it each time we pass 0 * as the server. */ -afs_int32 InitToServer(afs_int32 taskId, struct butx_transactionInfo *butxInfoP, char *server) +afs_int32 +InitToServer(afs_int32 taskId, struct butx_transactionInfo * butxInfoP, + char *server) { - static char origserver[BSA_MAX_DESC]; - static int init=0; - afs_int32 rc, code=0; - - if (!init) { - strcpy(origserver,""); - init = 1; - } - - if (!server) server = origserver; /* return to original server */ - if (strcmp(server,"") == 0) return 0; /* No server, do nothing */ - if (strcmp(butxInfoP->serverName,server) == 0) return 0; /* same server, do nothing */ - if (strcmp(origserver,"") == 0) strcpy(origserver, server);/* remember original server */ - - if (strcmp(butxInfoP->serverName,"") != 0) { - /* If already connected to a server, disconnect from it. - * Check to see if our server does not support switching. - */ - if (!(butxInfo.serverType & XBSA_SERVER_FLAG_MULTIPLE)) { - ErrorLog(0, taskId, TC_BADTASK, 0, - "This version of XBSA libraries does not support switching " - "from server %s to server %s\n", - butxInfoP->serverName, server); - return(TC_BADTASK); - } - - rc = xbsa_Finalize(&butxInfo); - if (rc != XBSA_SUCCESS) { - ErrorLog(0, taskId, rc, 0, - "InitToServer: Unable to terminate the connection to server %s\n", - butxInfoP->serverName); - ERROR_EXIT(rc); - } - } - - /* initialize to the new server */ - rc = xbsa_Initialize(&butxInfo, xbsaObjectOwner, appObjectOwner, xbsaSecToken, server); - if (rc != XBSA_SUCCESS) { - ErrorLog(0, taskId, rc, 0, - "InitToServer: Unable to initialize the XBSA library to server %s\n", - server); - ERROR_EXIT(rc); - } + static char origserver[BSA_MAX_DESC]; + static int init = 0; + afs_int32 rc, code = 0; + + if (!init) { + strcpy(origserver, ""); + init = 1; + } + + if (!server) + server = origserver; /* return to original server */ + if (strcmp(server, "") == 0) + return 0; /* No server, do nothing */ + if (strcmp(butxInfoP->serverName, server) == 0) + return 0; /* same server, do nothing */ + if (strcmp(origserver, "") == 0) + strcpy(origserver, server); /* remember original server */ + + if (strcmp(butxInfoP->serverName, "") != 0) { + /* If already connected to a server, disconnect from it. + * Check to see if our server does not support switching. + */ + if (!(butxInfo.serverType & XBSA_SERVER_FLAG_MULTIPLE)) { + ErrorLog(0, taskId, TC_BADTASK, 0, + "This version of XBSA libraries does not support switching " + "from server %s to server %s\n", butxInfoP->serverName, + server); + return (TC_BADTASK); + } + + rc = xbsa_Finalize(&butxInfo); + if (rc != XBSA_SUCCESS) { + ErrorLog(0, taskId, rc, 0, + "InitToServer: Unable to terminate the connection to server %s\n", + butxInfoP->serverName); + ERROR_EXIT(rc); + } + } + + /* initialize to the new server */ + rc = xbsa_Initialize(&butxInfo, xbsaObjectOwner, appObjectOwner, + xbsaSecToken, server); + if (rc != XBSA_SUCCESS) { + ErrorLog(0, taskId, rc, 0, + "InitToServer: Unable to initialize the XBSA library to server %s\n", + server); + ERROR_EXIT(rc); + } error_exit: - return(code); + return (code); } /* DeleteDump * */ -DeleteDump(ptr) - struct deleteDumpIf *ptr; +int +DeleteDump(struct deleteDumpIf *ptr) { afs_int32 taskId; - afs_int32 rc, code=0; + afs_int32 rc, code = 0; afs_uint32 dumpid; afs_int32 index, next, dbTime; budb_volumeList vl; @@ -2015,8 +2046,8 @@ DeleteDump(ptr) char dumpIdStr[XBSA_MAX_OSNAME]; char volumeNameStr[XBSA_MAX_PATHNAME]; afs_int32 i; - int intrans=0; - int allnotfound=1, onenotfound=0; + int intrans = 0; + int allnotfound = 1, onenotfound = 0; extern struct udbHandleS udbHandle; extern struct deviceSyncNode *deviceLatch; @@ -2025,7 +2056,7 @@ DeleteDump(ptr) clearStatus(taskId, DRIVE_WAIT); dumpid = ptr->dumpID; - taskId = ptr->taskId; /* Get task Id */ + taskId = ptr->taskId; /* Get task Id */ printf("\n\n"); TapeLog(2, taskId, 0, 0, "Delete Dump %u\n", dumpid); @@ -2037,143 +2068,153 @@ DeleteDump(ptr) /* Get the dump info for the dump we are deleting */ rc = bcdb_FindDumpByID(dumpid, &dumpEntry); if (rc) { - ErrorLog(0, taskId, rc, 0, "Unable to locate dump ID %u in database\n", dumpid); - setStatus(taskId, TASK_ERROR); - ERROR_EXIT(rc); + ErrorLog(0, taskId, rc, 0, + "Unable to locate dump ID %u in database\n", dumpid); + setStatus(taskId, TASK_ERROR); + ERROR_EXIT(rc); } /* we must make sure that we are configured with the correct type of * XBSA server for this dump delete! Only those dumped to an ADSM server. */ - if ( (xbsaType == XBSA_SERVER_TYPE_ADSM) && - !((dumpEntry.flags & (BUDB_DUMP_ADSM | BUDB_DUMP_BUTA))) ) { - ErrorLog(0, taskId, TC_BADTASK, 0, - "The dump %u requested for deletion is incompatible with this instance of butc\n", - dumpid); - setStatus(taskId, TASK_ERROR); - ERROR_EXIT(TC_BADTASK); + if ((xbsaType == XBSA_SERVER_TYPE_ADSM) + && !((dumpEntry.flags & (BUDB_DUMP_ADSM | BUDB_DUMP_BUTA)))) { + ErrorLog(0, taskId, TC_BADTASK, 0, + "The dump %u requested for deletion is incompatible with this instance of butc\n", + dumpid); + setStatus(taskId, TASK_ERROR); + ERROR_EXIT(TC_BADTASK); } /* Make sure we are connected to the correct server. If not, switch to it if appropriate */ - if ( (strlen((char *)dumpEntry.tapes.tapeServer) != 0) && - (strcmp((char *)dumpEntry.tapes.tapeServer,butxInfo.serverName) != 0)) { - - /* Check to see if the tapeServer name is trustworthy */ - if ((dumpEntry.flags & (BUDB_DUMP_XBSA_NSS | BUDB_DUMP_BUTA)) && !forcemultiple) { - /* The dump was made with a version of the XBSA interface - * that didn't allow switching of servers, we can't be sure - * that the servername in the backup database is correct. So, - * we will check the servername and log it if they don't match; - * but we will try to do the delete without switching servers. - */ - TLog(taskId, "The dump %d requested for deletion is on server %s " - "but butc is connected to server %s " - "(Attempting to delete the dump anyway)\n", - dumpid, (char *)dumpEntry.tapes.tapeServer, butxInfo.serverName); - } else { - TLog(taskId, "The dump %u requested for deletion is on server %s " - "but butc is connected to server %s " - "(switching servers)\n", - dumpid, (char *)dumpEntry.tapes.tapeServer, butxInfo.serverName); - - rc = InitToServer(taskId, &butxInfo, (char *)dumpEntry.tapes.tapeServer); - if (rc != XBSA_SUCCESS) { - setStatus(taskId, TASK_ERROR); - ERROR_EXIT(rc); - } - } + if ((strlen((char *)dumpEntry.tapes.tapeServer) != 0) + && (strcmp((char *)dumpEntry.tapes.tapeServer, butxInfo.serverName) != + 0)) { + + /* Check to see if the tapeServer name is trustworthy */ + if ((dumpEntry.flags & (BUDB_DUMP_XBSA_NSS | BUDB_DUMP_BUTA)) + && !forcemultiple) { + /* The dump was made with a version of the XBSA interface + * that didn't allow switching of servers, we can't be sure + * that the servername in the backup database is correct. So, + * we will check the servername and log it if they don't match; + * but we will try to do the delete without switching servers. + */ + TLog(taskId, + "The dump %d requested for deletion is on server %s " + "but butc is connected to server %s " + "(Attempting to delete the dump anyway)\n", dumpid, + (char *)dumpEntry.tapes.tapeServer, butxInfo.serverName); + } else { + TLog(taskId, + "The dump %u requested for deletion is on server %s " + "but butc is connected to server %s " + "(switching servers)\n", dumpid, + (char *)dumpEntry.tapes.tapeServer, butxInfo.serverName); + + rc = InitToServer(taskId, &butxInfo, + (char *)dumpEntry.tapes.tapeServer); + if (rc != XBSA_SUCCESS) { + setStatus(taskId, TASK_ERROR); + ERROR_EXIT(rc); + } + } } /* Start a new Transaction */ rc = xbsa_BeginTrans(&butxInfo); if (rc != XBSA_SUCCESS) { - ErrorLog(0, taskId, rc, 0, "Unable to create a new transaction\n"); - setStatus(taskId, TASK_ERROR); - ERROR_EXIT(rc); + ErrorLog(0, taskId, rc, 0, "Unable to create a new transaction\n"); + setStatus(taskId, TASK_ERROR); + ERROR_EXIT(rc); } intrans = 1; /* Query the backup database for list of volumes to delete */ - for (index=next=0; index!=-1; index=next) { - rc = ubik_Call_SingleServer(BUDB_GetVolumes, udbHandle.uh_client, - UF_SINGLESERVER, BUDB_MAJORVERSION, - BUDB_OP_DUMPID, - tapeName, dumpid, - 0, - index, &next, - &dbTime, &vl); - if (rc) { - if (rc == BUDB_ENDOFLIST) break; - ErrorLog(0, taskId, rc, 0, "Can't find volume info for dump %d\n", dumpid); - setStatus(taskId, TASK_ERROR); - ERROR_EXIT(rc); - } - - /* Delete all volumes on the list */ - for (i=0; i #include -RCSID("$Header: /tmp/cvstemp/openafs/src/butc/list.c,v 1.1.1.5 2001/09/11 14:31:48 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/butc/list.c,v 1.8 2003/12/07 22:49:23 jaltman Exp $"); #ifndef AFS_NT40_ENV #include @@ -22,10 +23,12 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/butc/list.c,v 1.1.1.5 2001/09/11 14:31: #include #include -extern int debugLevel; -static struct dumpNode *dumpQHeader; /* ptr to head of the dumpNode list */ -static struct dumpNode headNode; /* the dummy header of the node list */ -static afs_int32 maxTaskID; /* the largest task Id allotted so far, this is never reused */ +#include "error_macros.h" + +/*extern int debugLevel;*/ +static struct dumpNode *dumpQHeader; /* ptr to head of the dumpNode list */ +static struct dumpNode headNode; /* the dummy header of the node list */ +static afs_int32 maxTaskID; /* the largest task Id allotted so far, this is never reused */ /* allocTaskId * allocate a dump (task) id @@ -33,30 +36,32 @@ static afs_int32 maxTaskID; /* the largest task Id allotted so far, this is neve afs_int32 allocTaskId() { - return(maxTaskID++); + return (maxTaskID++); } #ifdef notdef -void static DisplayNode(nodePtr) -struct dumpNode *nodePtr; +void static +DisplayNode(nodePtr) + struct dumpNode *nodePtr; { - TapeLog(99, nodePtr->dumpId, "Created dumpNode"); - return; + TapeLog(99, nodePtr->dumpId, "Created dumpNode"); + return; } #endif /* initialize the node list used to keep track of the active dumps */ -void InitNodeList(portOffset) - afs_int32 portOffset; +void +InitNodeList(portOffset) + afs_int32 portOffset; { - maxTaskID = (portOffset * 1000) + 1; /* this is the first task id alotted */ + maxTaskID = (portOffset * 1000) + 1; /* this is the first task id alotted */ headNode.taskID = -1; - headNode.next = (struct dumpNode *)0; + headNode.next = NULL; headNode.dumps = (struct tc_dumpDesc *)0; headNode.restores = (struct tc_restoreDesc *)0; - dumpQHeader = &headNode; /* noone in the list to start with */ + dumpQHeader = &headNode; /* noone in the list to start with */ } /* CreateNode @@ -68,11 +73,12 @@ void InitNodeList(portOffset) * newNode ptr set to point to a node. */ -void CreateNode(newNode) -struct dumpNode **newNode; +void +CreateNode(newNode) + struct dumpNode **newNode; { /* get space */ - *newNode = (struct dumpNode *) (malloc (sizeof (struct dumpNode))); + *newNode = (struct dumpNode *)(malloc(sizeof(struct dumpNode))); memset(*newNode, 0, sizeof(struct dumpNode)); @@ -84,49 +90,59 @@ struct dumpNode **newNode; } /* free the space allotted to the node with */ -void FreeNode(taskID) -afs_int32 taskID; +void +FreeNode(taskID) + afs_int32 taskID; { - struct dumpNode *oldPtr,*newPtr,*curPtr; + struct dumpNode *oldPtr, *newPtr, *curPtr; int done; curPtr = dumpQHeader; oldPtr = dumpQHeader; - if(curPtr) newPtr = dumpQHeader->next; - else newPtr = (struct dumpNode *)0; + if (curPtr) + newPtr = dumpQHeader->next; + else + newPtr = NULL; done = 0; - while((!done) && (curPtr != (struct dumpNode *)0)) { - if(curPtr->taskID == taskID){ + while ((!done) && (curPtr != NULL)) { + if (curPtr->taskID == taskID) { done = 1; oldPtr->next = newPtr; /* free the node and its structures */ - if(curPtr->dumpName) free(curPtr->dumpName); - if(curPtr->volumeSetName) free(curPtr->volumeSetName); - if(curPtr->restores) free(curPtr->restores); - if(curPtr->dumps) free(curPtr->dumps); + if (curPtr->dumpName) + free(curPtr->dumpName); + if (curPtr->volumeSetName) + free(curPtr->volumeSetName); + if (curPtr->restores) + free(curPtr->restores); + if (curPtr->dumps) + free(curPtr->dumps); free(curPtr); - } - else { + } else { oldPtr = curPtr; curPtr = newPtr; - if(newPtr) newPtr = newPtr->next; + if (newPtr) + newPtr = newPtr->next; } } - return ; - + return; + } -afs_int32 GetNthNode(aindex, aresult) -afs_int32 aindex; -afs_int32 *aresult; { +afs_int32 +GetNthNode(aindex, aresult) + afs_int32 aindex; + afs_int32 *aresult; +{ register struct dumpNode *tn; register int i; tn = dumpQHeader->next; - for(i=0;;i++) { - if (!tn) return ENOENT; + for (i = 0;; i++) { + if (!tn) + return ENOENT; /* see if this is the desired node ID */ if (i == aindex) { *aresult = tn->taskID; @@ -138,23 +154,25 @@ afs_int32 *aresult; { } /* return the node with into */ -afs_int32 GetNode(taskID, resultNode) -afs_int32 taskID; -struct dumpNode **resultNode; +afs_int32 +GetNode(taskID, resultNode) + afs_int32 taskID; + struct dumpNode **resultNode; { struct dumpNode *tmpPtr; int done; done = 0; tmpPtr = dumpQHeader; - while((!done) && (tmpPtr != (struct dumpNode *)0)) { - if(tmpPtr->taskID == taskID) { + while ((!done) && (tmpPtr != NULL)) { + if (tmpPtr->taskID == taskID) { *resultNode = tmpPtr; done = 1; - } - else + } else tmpPtr = tmpPtr->next; } - if (done) return 0; - else return TC_NODENOTFOUND; + if (done) + return 0; + else + return TC_NODENOTFOUND; } diff --git a/src/butc/lwps.c b/src/butc/lwps.c index 5b204f622..49c7dad3f 100644 --- a/src/butc/lwps.c +++ b/src/butc/lwps.c @@ -10,7 +10,8 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/butc/lwps.c,v 1.1.1.6 2004/01/10 20:56:07 hartmans Exp $"); +RCSID + ("$Header: /cvs/openafs/src/butc/lwps.c,v 1.12 2003/12/08 01:45:29 jaltman Exp $"); #include #ifdef AFS_NT40_ENV @@ -29,7 +30,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/butc/lwps.c,v 1.1.1.6 2004/01/10 20:56: #include #include #include -#include /* PA */ +#include /* PA */ #include #include #include @@ -39,17 +40,18 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/butc/lwps.c,v 1.1.1.6 2004/01/10 20:56: #include "butc_xbsa.h" /* GLOBAL CONFIGURATION PARAMETERS */ -extern int dump_namecheck; extern int queryoperator; extern int tapemounted; extern char *opencallout; extern char *closecallout; extern char *whoami; extern char *extractDumpName(); -extern int BufferSize; /* Size in B stored for header info */ +extern int BufferSize; /* Size in B stored for header info */ +FILE *restoretofilefd; +#ifdef xbsa extern char *restoretofile; -FILE *restoretofilefd; -extern int forcemultiple; +extern int forcemultiple; +#endif /* XBSA Global Parameters */ afs_int32 xbsaType; @@ -57,13 +59,13 @@ afs_int32 xbsaType; struct butx_transactionInfo butxInfo; #endif -struct TapeBlock { /* A 16KB tapeblock */ - char mark[BUTM_HDRSIZE]; /* Header info */ - char data[BUTM_BLKSIZE]; /* data */ +static struct TapeBlock { /* A 16KB tapeblock */ + char mark[BUTM_HDRSIZE]; /* Header info */ + char data[BUTM_BLKSIZE]; /* data */ } *bufferBlock; -afs_int32 dataSize; /* Size of data to read on each xbsa_ReadObjectData() call (CONF_XBSA) */ -afs_int32 tapeblocks; /* Number of tape datablocks in buffer (!CONF_XBSA) */ +afs_int32 dataSize; /* Size of data to read on each xbsa_ReadObjectData() call (CONF_XBSA) */ +afs_int32 tapeblocks; /* Number of tape datablocks in buffer (!CONF_XBSA) */ /* notes * Need to re-write to: @@ -74,17 +76,16 @@ afs_int32 tapeblocks; /* Number of tape datablocks in buffer (!CONF_XBSA) * */ /* All the relevant info shared between Restorer and restoreVolume */ -struct restoreParams -{ - struct dumpNode *nodePtr; - afs_int32 frag; - char mntTapeName[BU_MAXTAPELEN]; - afs_int32 tapeID; +struct restoreParams { + struct dumpNode *nodePtr; + afs_int32 frag; + char mntTapeName[BU_MAXTAPELEN]; + afs_int32 tapeID; struct butm_tapeInfo *tapeInfoPtr; }; /* Abort checks are done after each BIGCHUNK of data transfer */ -#define BIGCHUNK 102400 +#define BIGCHUNK 102400 #define HEADER_CHECKS(vhptr, header) \ { \ @@ -106,13 +107,13 @@ struct restoreParams return (0); \ } /* magic */ \ } /* versionflags */ \ -} +} extern FILE *logIO; extern FILE *ErrorlogIO; extern FILE *centralLogIO; extern FILE *lastLogIO; -extern afs_int32 lastPass; /* Set true during last pass of dump */ +extern afs_int32 lastPass; /* Set true during last pass of dump */ extern int debugLevel; extern int autoQuery; extern struct tapeConfig globalTapeConfig; @@ -122,55 +123,78 @@ struct timeval tp; struct timezone tzp; /* forward declaration */ -afs_int32 readVolumeHeader(/*char *buffer,afs_int32 bufloc,(struct volumeHeader *)vhptr*/); +afs_int32 readVolumeHeader( /*char *buffer,afs_int32 bufloc,(struct volumeHeader *)vhptr */ ); /* The on-disk volume header or trailer can differ in size from platform to platform */ -struct TapeBlock tapeBlock; -char tapeVolumeHT[sizeof(struct volumeHeader) + 2*sizeof(char)]; - -void -PrintLog(log, error1, error2, str, a,b,c,d,e,f,g,h,i,j) - FILE *log; - afs_int32 error1, error2; - char *str, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j; +static struct TapeBlock tapeBlock; +char tapeVolumeHT[sizeof(struct volumeHeader) + 2 * sizeof(char)]; + +void +PrintLog(log, error1, error2, str, a, b, c, d, e, f, g, h, i, j) + FILE *log; + afs_int32 error1, error2; + char *str, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j; { char *err1, *err2; - fprintf(log, str, a,b,c,d,e,f,g,h,i,j); - if (error1) - { - err2 = "vols"; - switch (error1) - { - case VSALVAGE: err1 = "Volume needs to be salvaged"; break; - case VNOVNODE: err1 = "Bad vnode number quoted"; break; - case VNOVOL: err1 = "Volume not attached, does not exist, or not on line"; break; - case VVOLEXISTS: err1 = "Volume already exists"; break; - case VNOSERVICE: err1 = "Volume is not in service"; break; - case VOFFLINE: err1 = "Volume is off line"; break; - case VONLINE: err1 = "Volume is already on line"; break; - case VDISKFULL: err1 = "Partition is full"; break; - case VOVERQUOTA: err1 = "Volume max quota exceeded"; break; - case VBUSY: err1 = "Volume temporarily unavailable"; break; - case VMOVED: err1 = "Volume has moved to another server"; break; - default: - err1 = (char *)error_message(error1); - err2 = (char *)error_table_name(error1); - break; + fprintf(log, str, a, b, c, d, e, f, g, h, i, j); + if (error1) { + err2 = "vols"; + switch (error1) { + case VSALVAGE: + err1 = "Volume needs to be salvaged"; + break; + case VNOVNODE: + err1 = "Bad vnode number quoted"; + break; + case VNOVOL: + err1 = "Volume not attached, does not exist, or not on line"; + break; + case VVOLEXISTS: + err1 = "Volume already exists"; + break; + case VNOSERVICE: + err1 = "Volume is not in service"; + break; + case VOFFLINE: + err1 = "Volume is off line"; + break; + case VONLINE: + err1 = "Volume is already on line"; + break; + case VDISKFULL: + err1 = "Partition is full"; + break; + case VOVERQUOTA: + err1 = "Volume max quota exceeded"; + break; + case VBUSY: + err1 = "Volume temporarily unavailable"; + break; + case VMOVED: + err1 = "Volume has moved to another server"; + break; + default: + err1 = (char *)error_message(error1); + err2 = (char *)error_table_name(error1); + break; } - if (error1 == -1) fprintf(log, " Possible communication failure"); - else fprintf(log, " %s: %s", err2, err1); - if (error2) fprintf(log, ": %s", error_message(error2)); + if (error1 == -1) + fprintf(log, " Possible communication failure"); + else + fprintf(log, " %s: %s", err2, err1); + if (error2) + fprintf(log, ": %s", error_message(error2)); fprintf(log, "\n"); } fflush(log); } void -TapeLog(debug, task, error1, error2, str, a,b,c,d,e,f,g,h,i,j) - int debug; - afs_int32 task, error1, error2; - char *str, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j; +TapeLog(debug, task, error1, error2, str, a, b, c, d, e, f, g, h, i, j) + int debug; + afs_int32 task, error1, error2; + char *str, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j; { time_t now; char tbuffer[32], *timestr; @@ -180,34 +204,37 @@ TapeLog(debug, task, error1, error2, str, a,b,c,d,e,f,g,h,i,j) timestr[24] = '\0'; fprintf(logIO, "%s: ", timestr); - if (task) fprintf(logIO, "Task %u: ", task); - PrintLog(logIO, error1, error2, str, a,b,c,d,e,f,g,h,i,j); + if (task) + fprintf(logIO, "Task %u: ", task); + PrintLog(logIO, error1, error2, str, a, b, c, d, e, f, g, h, i, j); if (lastPass && lastLogIO) { - fprintf(lastLogIO, "%s: ", timestr); - if (task) fprintf(lastLogIO, "Task %u: ", task); - PrintLog(lastLogIO, error1, error2, str, a,b,c,d,e,f,g,h,i,j); + fprintf(lastLogIO, "%s: ", timestr); + if (task) + fprintf(lastLogIO, "Task %u: ", task); + PrintLog(lastLogIO, error1, error2, str, a, b, c, d, e, f, g, h, i, + j); } /* Now print to the screen if debug level requires */ if (debug <= debugLevel) - PrintLog(stdout, error1, error2, str, a,b,c,d,e,f,g,h,i,j); + PrintLog(stdout, error1, error2, str, a, b, c, d, e, f, g, h, i, j); } void -TLog(task, str, a,b,c,d,e,f,g,h,i,j) - afs_int32 task; - char *str, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j; +TLog(task, str, a, b, c, d, e, f, g, h, i, j) + afs_int32 task; + char *str, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j; { /* Sends message to TapeLog and stdout */ - TapeLog (0, task, 0,0, str, a,b,c,d,e,f,g,h,i,j); + TapeLog(0, task, 0, 0, str, a, b, c, d, e, f, g, h, i, j); } -void -ErrorLog(debug, task, error1, error2, str, a,b,c,d,e,f,g,h,i,j) - int debug; - afs_int32 task, error1, error2; - char *str, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j; +void +ErrorLog(debug, task, error1, error2, str, a, b, c, d, e, f, g, h, i, j) + int debug; + afs_int32 task, error1, error2; + char *str, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j; { time_t now; char tbuffer[32], *timestr; @@ -218,39 +245,42 @@ ErrorLog(debug, task, error1, error2, str, a,b,c,d,e,f,g,h,i,j) fprintf(ErrorlogIO, "%s: ", timestr); /* Print the time and task number */ - if (task) fprintf(ErrorlogIO, "Task %u: ", task); - PrintLog(ErrorlogIO, error1, error2, str, a,b,c,d,e,f,g,h,i,j); + if (task) + fprintf(ErrorlogIO, "Task %u: ", task); + PrintLog(ErrorlogIO, error1, error2, str, a, b, c, d, e, f, g, h, i, j); - TapeLog(debug, task, error1, error2, str, a,b,c,d,e,f,g,h,i,j); + TapeLog(debug, task, error1, error2, str, a, b, c, d, e, f, g, h, i, j); } void -ELog(task, str, a,b,c,d,e,f,g,h,i,j) - afs_int32 task; - char *str, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j; +ELog(task, str, a, b, c, d, e, f, g, h, i, j) + afs_int32 task; + char *str, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j; { /* Sends message to ErrorLog, TapeLog and stdout */ - ErrorLog (0, task, 0,0, str, a,b,c,d,e,f,g,h,i,j); + ErrorLog(0, task, 0, 0, str, a, b, c, d, e, f, g, h, i, j); } /* first proc called by anybody who intends to use the device */ -void EnterDeviceQueue(devLatch) -struct deviceSyncNode *devLatch; +void +EnterDeviceQueue(devLatch) + struct deviceSyncNode *devLatch; { ObtainWriteLock(&(devLatch->lock)); devLatch->flags = TC_DEVICEINUSE; } /* last proc called by anybody finishing using the device */ -void LeaveDeviceQueue(devLatch) -struct deviceSyncNode *devLatch; +void +LeaveDeviceQueue(devLatch) + struct deviceSyncNode *devLatch; { devLatch->flags = 0; ReleaseWriteLock(&(devLatch->lock)); } -#define BELLTIME 60 /* 60 seconds before a bell rings */ -#define BELLCHAR 7 /* ascii for bell */ +#define BELLTIME 60 /* 60 seconds before a bell rings */ +#define BELLCHAR 7 /* ascii for bell */ #ifdef AFS_PTHREAD_ENV @@ -267,41 +297,45 @@ struct deviceSyncNode *devLatch; * * STOLEN FROM LWP_WaitForKeystroke() */ -int WaitForKeystroke(int seconds) +int +WaitForKeystroke(int seconds) { - time_t startTime, nowTime; - double timeleft = 1; - struct timeval twait; - - time(&startTime); - twait.tv_sec = 0; - twait.tv_usec = 250; - if (seconds >= 0) - timeleft = seconds; - - do { - /* check if we have a keystroke */ - if (_kbhit()) return 1; - if (timeleft == 0) break; - - /* sleep for LWP_KEYSTROKE_DELAY ms and let other - * process run some*/ - select(0, 0, 0, 0, &twait); - - if (seconds > 0) { /* we only worry about elapsed time if - * not looping forever (seconds < 0) */ - time(&nowTime); - timeleft = seconds - difftime(nowTime, startTime); - } - } while(timeleft > 0); - return 0; + time_t startTime, nowTime; + double timeleft = 1; + struct timeval twait; + + time(&startTime); + twait.tv_sec = 0; + twait.tv_usec = 250; + if (seconds >= 0) + timeleft = seconds; + + do { + /* check if we have a keystroke */ + if (_kbhit()) + return 1; + if (timeleft == 0) + break; + + /* sleep for LWP_KEYSTROKE_DELAY ms and let other + * process run some*/ + select(0, 0, 0, 0, &twait); + + if (seconds > 0) { /* we only worry about elapsed time if + * not looping forever (seconds < 0) */ + time(&nowTime); + timeleft = seconds - difftime(nowTime, startTime); + } + } while (timeleft > 0); + return 0; } #else /* AFS_NT40)ENV */ extern int WaitForKeystroke(int); /* * STOLEN FROM LWP_WaitForKeystroke() */ -int WaitForKeystroke(int seconds) +int +WaitForKeystroke(int seconds) { fd_set rdfds; int code; @@ -318,12 +352,12 @@ int WaitForKeystroke(int seconds) FD_ZERO(&rdfds); FD_SET(fileno(stdin), &rdfds); - if (seconds>=0) { + if (seconds >= 0) { twait.tv_sec = seconds; twait.tv_usec = 0; tp = &twait; } - code = select(1+fileno(stdin), &rdfds, NULL, NULL, tp); + code = select(1 + fileno(stdin), &rdfds, NULL, NULL, tp); return (code == 1) ? 1 : 0; } #endif @@ -339,173 +373,171 @@ int WaitForKeystroke(int seconds) * * STOLEN FROM LWP_GetResponseKey(); */ -int GetResponseKey(int seconds, char *key) +int +GetResponseKey(int seconds, char *key) { - int rc; - - if (key == NULL) return 0; /* need space to store char */ - fflush(stdin); /* flush all existing data and start anew */ - - rc = WaitForKeystroke(seconds); - if (rc == 0) { /* time ran out */ - *key = 0; - return rc; - } - - /* now read the char. */ + int rc; + + if (key == NULL) + return 0; /* need space to store char */ + fflush(stdin); /* flush all existing data and start anew */ + + rc = WaitForKeystroke(seconds); + if (rc == 0) { /* time ran out */ + *key = 0; + return rc; + } + + /* now read the char. */ #ifdef AFS_NT40_ENV - *key = getche(); /* get char and echo it to screen */ + *key = getche(); /* get char and echo it to screen */ #else - *key = getchar(); + *key = getchar(); #endif - return rc; + return rc; } #endif /* AFS_PTHREAD_ENV - -/* FFlushInput - * flush all input - * notes: - * only external clients are in recoverDb.c. Was static. PA - */ + * + * /* FFlushInput + * * flush all input + * * notes: + * * only external clients are in recoverDb.c. Was static. PA + */ +void FFlushInput() { - int w; + int w; - fflush(stdin); + fflush(stdin); - while(1) { + while (1) { #ifdef AFS_PTHREAD_ENV - w = WaitForKeystroke(0); + w = WaitForKeystroke(0); #else - w = LWP_WaitForKeystroke(0); + w = LWP_WaitForKeystroke(0); #endif /* AFS_PTHREAD_ENV */ - if (w) { + if (w) { #ifdef AFS_NT40_ENV - getche(); + getche(); #else - getchar(); + getchar(); #endif /* AFS_NT40_ENV */ - } else { - return; - } - } + } else { + return; + } + } } -int callOutRoutine(taskId, tapePath, flag, name, dbDumpId, tapecount) - afs_int32 taskId; - char *tapePath; - int flag; - char *name; - afs_uint32 dbDumpId; - int tapecount; +int +callOutRoutine(taskId, tapePath, flag, name, dbDumpId, tapecount) + afs_int32 taskId; + char *tapePath; + int flag; + char *name; + afs_uint32 dbDumpId; + int tapecount; { - afs_int32 count; - - afs_int32 code = 0; - int pid; + afs_int32 code = 0; + int pid; - char StapePath[256]; - char ScallOut[256]; - char Scount[10]; - char Sopcode[16]; - char Sdumpid[16]; - char Stape[40]; - char *callOut; + char StapePath[256]; + char ScallOut[256]; + char Scount[10]; + char Sopcode[16]; + char Sdumpid[16]; + char Stape[40]; + char *callOut; - char *CO_argv[10]; - char *CO_envp[1]; + char *CO_argv[10]; + char *CO_envp[1]; - callOut = opencallout; - switch ( flag ) - { - case READOPCODE: - strcpy(Sopcode, "restore"); - break; + callOut = opencallout; + switch (flag) { + case READOPCODE: + strcpy(Sopcode, "restore"); + break; case APPENDOPCODE: - strcpy(Sopcode, "appenddump"); - break; + strcpy(Sopcode, "appenddump"); + break; case WRITEOPCODE: - strcpy(Sopcode, "dump"); - break; + strcpy(Sopcode, "dump"); + break; case LABELOPCODE: - strcpy(Sopcode, "labeltape"); - break; + strcpy(Sopcode, "labeltape"); + break; case READLABELOPCODE: - strcpy(Sopcode, "readlabel"); - break; + strcpy(Sopcode, "readlabel"); + break; case SCANOPCODE: - strcpy(Sopcode, "scantape"); - break; + strcpy(Sopcode, "scantape"); + break; case RESTOREDBOPCODE: - strcpy(Sopcode, "restoredb"); - break; + strcpy(Sopcode, "restoredb"); + break; case SAVEDBOPCODE: - strcpy(Sopcode, "savedb"); - break; + strcpy(Sopcode, "savedb"); + break; case CLOSEOPCODE: - strcpy(Sopcode, "unmount"); - callOut = closecallout; - break; + strcpy(Sopcode, "unmount"); + callOut = closecallout; + break; default: - strcpy(Sopcode, "unknown"); - break; + strcpy(Sopcode, "unknown"); + break; } - - if (!callOut) /* no script to call */ - return 0; - - strcpy(ScallOut, callOut); - CO_argv[0] = ScallOut; - - strcpy(StapePath, tapePath); - CO_argv[1] = StapePath; - - CO_argv[2] = Sopcode; - - if (flag == CLOSEOPCODE) - { - CO_argv[3] = (char *)0; - } - else - { - sprintf(Scount, "%d", tapecount); - CO_argv[3] = Scount; - - /* The tape label name - special case labeltape */ - if ( !name || (strcmp(name,"") == 0) ) /* no label */ - strcpy(Stape, "none"); - else { /* labeltape */ + + if (!callOut) /* no script to call */ + return 0; + + strcpy(ScallOut, callOut); + CO_argv[0] = ScallOut; + + strcpy(StapePath, tapePath); + CO_argv[1] = StapePath; + + CO_argv[2] = Sopcode; + + if (flag == CLOSEOPCODE) { + CO_argv[3] = NULL; + } else { + sprintf(Scount, "%d", tapecount); + CO_argv[3] = Scount; + + /* The tape label name - special case labeltape */ + if (!name || (strcmp(name, "") == 0)) /* no label */ + strcpy(Stape, "none"); + else { /* labeltape */ #ifdef AFS_NT40_ENV - if (!strcmp(name, TC_NULLTAPENAME)) /* pass "" instead of */ - strcpy(Stape, TC_QUOTEDNULLTAPENAME); - else + if (!strcmp(name, TC_NULLTAPENAME)) /* pass "" instead of */ + strcpy(Stape, TC_QUOTEDNULLTAPENAME); + else #endif - strcpy(Stape, name); - } - CO_argv[4] = Stape; - - /* The tape id */ - if (!dbDumpId) - strcpy(Sdumpid, "none"); - else - sprintf(Sdumpid, "%u", dbDumpId); - CO_argv[5] = Sdumpid; - - CO_argv[6] = (char *)0; - } - - CO_envp[0] = (char *)0; - - pid = spawnprocve(callOut, CO_argv, CO_envp, 2); - if (pid < 0) { - ErrorLog(0, taskId, errno, 0, "Call to %s outside routine %s failed\n", - Sopcode, callOut); - return 0; - } - - return(pid); + strcpy(Stape, name); + } + CO_argv[4] = Stape; + + /* The tape id */ + if (!dbDumpId) + strcpy(Sdumpid, "none"); + else + sprintf(Sdumpid, "%u", dbDumpId); + CO_argv[5] = Sdumpid; + + CO_argv[6] = NULL; + } + + CO_envp[0] = NULL; + + pid = spawnprocve(callOut, CO_argv, CO_envp, 2); + if (pid < 0) { + ErrorLog(0, taskId, errno, 0, + "Call to %s outside routine %s failed\n", Sopcode, callOut); + return 0; + } + + return (pid); } /* @@ -515,34 +547,34 @@ int callOutRoutine(taskId, tapePath, flag, name, dbDumpId, tapecount) * (unless a tape is not mounted in the first place). */ unmountTape(taskId, tapeInfoPtr) - afs_int32 taskId; - struct butm_tapeInfo *tapeInfoPtr; + afs_int32 taskId; + struct butm_tapeInfo *tapeInfoPtr; { afs_int32 code; - afs_int32 wcode; int cpid, status, rcpid; code = butm_Dismount(tapeInfoPtr); - if (code && (code != BUTM_NOMOUNT)) - ErrorLog(0, taskId, code, (tapeInfoPtr)->error, "Warning: Can't close tape\n"); + if (code && (code != BUTM_NOMOUNT)) + ErrorLog(0, taskId, code, (tapeInfoPtr)->error, + "Warning: Can't close tape\n"); - if (tapemounted && closecallout) - { - setStatus(taskId, CALL_WAIT); + if (tapemounted && closecallout) { + setStatus(taskId, CALL_WAIT); - cpid = callOutRoutine(taskId, globalTapeConfig.device, CLOSEOPCODE, "", 0, 1); - while (cpid) /* Wait until return */ - { + cpid = + callOutRoutine(taskId, globalTapeConfig.device, CLOSEOPCODE, "", + 0, 1); + while (cpid) { /* Wait until return */ status = 0; rcpid = waitpid(cpid, &status, WNOHANG); - if (rcpid > 0) - { - tapemounted = 0; + if (rcpid > 0) { + tapemounted = 0; break; } if (rcpid == -1 && errno != EINTR) { - tapemounted = 0; - com_err(whoami, errno, "Error waiting for callout script to terminate."); + tapemounted = 0; + com_err(whoami, errno, + "Error waiting for callout script to terminate."); break; } #ifdef AFS_PTHREAD_ENV @@ -551,11 +583,11 @@ unmountTape(taskId, tapeInfoPtr) IOMGR_Sleep(1); #endif - if ( checkAbortByTaskId(taskId) ) - { + if (checkAbortByTaskId(taskId)) { TLog(taskId, "Callout routine has been aborted\n"); - if (kill(cpid, SIGKILL)) /* Cancel callout */ - ErrorLog(0, taskId, errno, 0, "Kill of callout process %d failed\n", cpid); + if (kill(cpid, SIGKILL)) /* Cancel callout */ + ErrorLog(0, taskId, errno, 0, + "Kill of callout process %d failed\n", cpid); break; } } @@ -571,36 +603,36 @@ unmountTape(taskId, tapeInfoPtr) void static PrintPrompt(flag, name, dumpid) - int flag; - char *name; + int flag; + char *name; { - char tapename[BU_MAXTAPELEN+32]; - char *dn; + char tapename[BU_MAXTAPELEN + 32]; + char *dn; TAPENAME(tapename, name, dumpid); printf("******* OPERATOR ATTENTION *******\n"); - printf("Device : %s \n",globalTapeConfig.device); + printf("Device : %s \n", globalTapeConfig.device); - switch ( flag ) - { - case READOPCODE: /* mount for restore */ - printf("Please put in tape %s for reading", tapename); + switch (flag) { + case READOPCODE: /* mount for restore */ + printf("Please put in tape %s for reading", tapename); break; - case APPENDOPCODE: /* mount for dump (appends) */ + case APPENDOPCODE: /* mount for dump (appends) */ dn = extractDumpName(name); if (!dn || !dumpid) printf("Please put in last tape of dump set for appending dump"); else - printf("Please put in last tape of dump set for appending dump %s (DumpID %u)", - dn, dumpid); + printf + ("Please put in last tape of dump set for appending dump %s (DumpID %u)", + dn, dumpid); break; - case WRITEOPCODE: /* mount for dump */ - if (strcmp(name,"") == 0) + case WRITEOPCODE: /* mount for dump */ + if (strcmp(name, "") == 0) printf("Please put in tape for writing"); /* The name is what we are going to label the tape as */ @@ -608,30 +640,31 @@ PrintPrompt(flag, name, dumpid) printf("Please put in tape %s for writing", tapename); break; - case LABELOPCODE: /* mount for labeltape */ + case LABELOPCODE: /* mount for labeltape */ printf("Please put in tape to be labelled as %s", tapename); break; - case READLABELOPCODE: /* mount for readlabel */ + case READLABELOPCODE: /* mount for readlabel */ printf("Please put in tape whose label is to be read"); break; - case SCANOPCODE: /* mount for scantape */ - if (strcmp(name,"") == 0) + case SCANOPCODE: /* mount for scantape */ + if (strcmp(name, "") == 0) printf("Please put in tape to be scanned"); else printf("Please put in tape %s for scanning", tapename); break; - case RESTOREDBOPCODE: /* Mount for restoredb */ + case RESTOREDBOPCODE: /* Mount for restoredb */ printf("Please insert a tape %s for the database restore", tapename); break; - case SAVEDBOPCODE: /* Mount for savedb */ - printf("Please insert a writeable tape %s for the database dump", tapename); + case SAVEDBOPCODE: /* Mount for savedb */ + printf("Please insert a writeable tape %s for the database dump", + tapename); break; - default: + default: break; } printf(" and hit return when done\n"); @@ -644,73 +677,72 @@ PrintPrompt(flag, name, dumpid) * notes: * only external clients are in recoverDb.c. Was static PA */ -afs_int32 PromptForTape(flag, name, dbDumpId, taskId, tapecount) - int flag; - char *name; - afs_uint32 dbDumpId; /* Specific dump ID - If non-zero */ - afs_uint32 taskId; - int tapecount; +afs_int32 +PromptForTape(flag, name, dbDumpId, taskId, tapecount) + int flag; + char *name; + afs_uint32 dbDumpId; /* Specific dump ID - If non-zero */ + afs_uint32 taskId; + int tapecount; { register afs_int32 code = 0; - afs_int32 wcode; - afs_int32 start = 0; - char inchr; - int CallOut; - int cpid, status, rcpid; + afs_int32 wcode; + afs_int32 start = 0; + char inchr; + int CallOut; + int cpid, status, rcpid; - if ( checkAbortByTaskId(taskId) ) - ERROR_EXIT(TC_ABORTEDBYREQUEST); + if (checkAbortByTaskId(taskId)) + ERROR_EXIT(TC_ABORTEDBYREQUEST); if (dbDumpId) - TapeLog(2, taskId, 0, 0, "Prompt for tape %s (%u)\n", name, dbDumpId); + TapeLog(2, taskId, 0, 0, "Prompt for tape %s (%u)\n", name, dbDumpId); else - TapeLog(2, taskId, 0, 0, "Prompt for tape %s\n", name); + TapeLog(2, taskId, 0, 0, "Prompt for tape %s\n", name); CallOut = (opencallout ? 1 : 0); - if (CallOut) - { - setStatus(taskId, CALL_WAIT); + if (CallOut) { + setStatus(taskId, CALL_WAIT); - cpid = callOutRoutine(taskId, globalTapeConfig.device, flag, name, dbDumpId, tapecount); - if (cpid == 0) CallOut = 0; /* prompt at screen */ + cpid = + callOutRoutine(taskId, globalTapeConfig.device, flag, name, + dbDumpId, tapecount); + if (cpid == 0) + CallOut = 0; /* prompt at screen */ - while (CallOut) - { /* Check if callout routine finished */ + while (CallOut) { /* Check if callout routine finished */ status = 0; rcpid = waitpid(cpid, &status, WNOHANG); - if (rcpid > 0) - { - if (rcpid != cpid) - wcode = -1; - else if (WIFEXITED(status)) - wcode = WEXITSTATUS(status); - else - wcode = -1; - - if (wcode == 0) - { - break; /* All done */ - } - else if (wcode == 1) - { - ERROR_EXIT(TC_ABORTEDBYREQUEST); /* Abort */ - } - else if ( (flag == READOPCODE) && (wcode == 3) ) { - ERROR_EXIT(TC_SKIPTAPE); /* Restore: skip the tape */ - } + if (rcpid > 0) { + if (rcpid != cpid) + wcode = -1; + else if (WIFEXITED(status)) + wcode = WEXITSTATUS(status); else - { - TLog(taskId, "Callout routine has exited with code %d: will prompt\n", wcode); - CallOut = 0; /* Switch to keyboard input */ + wcode = -1; + + if (wcode == 0) { + break; /* All done */ + } else if (wcode == 1) { + ERROR_EXIT(TC_ABORTEDBYREQUEST); /* Abort */ + } else if ((flag == READOPCODE) && (wcode == 3)) { + ERROR_EXIT(TC_SKIPTAPE); /* Restore: skip the tape */ + } else { + TLog(taskId, + "Callout routine has exited with code %d: will prompt\n", + wcode); + CallOut = 0; /* Switch to keyboard input */ break; } } /* if waitpid experienced an error, we prompt */ if (rcpid == -1 && errno != EINTR) { - com_err(whoami, errno, "Error waiting for callout script to terminate."); - TLog(taskId, "Can't get exit status from callout script. will prompt\n", wcode); - CallOut = 0; - break; + com_err(whoami, errno, + "Error waiting for callout script to terminate."); + TLog(taskId, + "Can't get exit status from callout script. will prompt\n"); + CallOut = 0; + break; } #ifdef AFS_PTHREAD_ENV sleep(1); @@ -718,55 +750,54 @@ afs_int32 PromptForTape(flag, name, dbDumpId, taskId, tapecount) IOMGR_Sleep(1); #endif - if ( checkAbortByTaskId(taskId) ) - { - printf("This tape operation has been aborted by the coordinator.\n"); + if (checkAbortByTaskId(taskId)) { + printf + ("This tape operation has been aborted by the coordinator.\n"); - if (kill(cpid, SIGKILL)) /* Cancel callout */ - ErrorLog(0, taskId, errno, 0, "Kill of callout process %d failed\n", cpid); + if (kill(cpid, SIGKILL)) /* Cancel callout */ + ErrorLog(0, taskId, errno, 0, + "Kill of callout process %d failed\n", cpid); ERROR_EXIT(TC_ABORTEDBYREQUEST); } } } - if (!CallOut) - { - clearStatus(taskId, CALL_WAIT); - setStatus(taskId, OPR_WAIT); + if (!CallOut) { + clearStatus(taskId, CALL_WAIT); + setStatus(taskId, OPR_WAIT); - PrintPrompt(flag, name, dbDumpId); + PrintPrompt(flag, name, dbDumpId); /* Loop until we get ok to go ahead (or abort) */ - while(1) - { - if ( time(0) > start+BELLTIME ) - { - start = time(0); + while (1) { + if (time(0) > start + BELLTIME) { + start = time(0); FFlushInput(); putchar(BELLCHAR); fflush(stdout); } - #ifdef AFS_PTHREAD_ENV - wcode = GetResponseKey(5, &inchr); /* inchr stores key read */ + wcode = GetResponseKey(5, &inchr); /* inchr stores key read */ #else - wcode = LWP_GetResponseKey(5, &inchr); /* inchr stores key read */ + wcode = LWP_GetResponseKey(5, &inchr); /* inchr stores key read */ #endif - if (wcode == 1) { /* keyboard input is available */ + if (wcode == 1) { /* keyboard input is available */ - if ( (inchr == 'a') || (inchr == 'A') ) { + if ((inchr == 'a') || (inchr == 'A')) { printf("This tape operation has been aborted.\n"); - ERROR_EXIT(TC_ABORTEDBYREQUEST); /* Abort command */ - } else if ( (flag == READOPCODE) && ((inchr == 's') || (inchr == 'S')) ) { + ERROR_EXIT(TC_ABORTEDBYREQUEST); /* Abort command */ + } else if ((flag == READOPCODE) + && ((inchr == 's') || (inchr == 'S'))) { printf("This tape will be skipped.\n"); - ERROR_EXIT(TC_SKIPTAPE); /* Restore: skip the tape */ + ERROR_EXIT(TC_SKIPTAPE); /* Restore: skip the tape */ } - break; /* continue */ + break; /* continue */ } - if ( checkAbortByTaskId(taskId) ) { - printf("This tape operation has been aborted by the coordinator.\n"); + if (checkAbortByTaskId(taskId)) { + printf + ("This tape operation has been aborted by the coordinator.\n"); ERROR_EXIT(TC_ABORTEDBYREQUEST); } } @@ -774,49 +805,48 @@ afs_int32 PromptForTape(flag, name, dbDumpId, taskId, tapecount) } printf("Thanks, now proceeding with tape "); - switch (flag) - { - case RESTOREDBOPCODE: - case READOPCODE: + switch (flag) { + case RESTOREDBOPCODE: + case READOPCODE: printf("reading"); break; - case APPENDOPCODE: + case APPENDOPCODE: printf("append writing"); break; - case SAVEDBOPCODE: - case WRITEOPCODE: + case SAVEDBOPCODE: + case WRITEOPCODE: printf("writing"); break; - case LABELOPCODE: + case LABELOPCODE: printf("labelling"); break; - case READLABELOPCODE: + case READLABELOPCODE: printf("label reading"); break; - case SCANOPCODE: + case SCANOPCODE: printf("scanning"); break; - - default: + + default: printf("unknown"); break; } printf(" operation.\n"); if (!CallOut) - printf("**********************************\n"); + printf("**********************************\n"); TapeLog(2, taskId, 0, 0, "Proceeding with tape operation\n"); tapemounted = 1; -error_exit: + error_exit: clearStatus(taskId, (OPR_WAIT | CALL_WAIT)); - return(code); + return (code); } @@ -834,353 +864,370 @@ afs_int32 VolHeaderToHost(hostVolHeader, tapeVolHeader) struct volumeHeader *hostVolHeader, *tapeVolHeader; { - switch ( ntohl(tapeVolHeader->versionflags) ) - { - case TAPE_VERSION_0: - /* sizes in bytes and fields in host order */ - memcpy(tapeVolHeader, hostVolHeader, sizeof(struct volumeHeader)); - break; + switch (ntohl(tapeVolHeader->versionflags)) { + case TAPE_VERSION_0: + /* sizes in bytes and fields in host order */ + memcpy(tapeVolHeader, hostVolHeader, sizeof(struct volumeHeader)); + break; - case TAPE_VERSION_1: - case TAPE_VERSION_2: - case TAPE_VERSION_3: /* for present */ - case TAPE_VERSION_4: - /* sizes in K and fields in network order */ - /* do the conversion field by field */ - - strcpy(hostVolHeader->preamble, tapeVolHeader->preamble); - strcpy(hostVolHeader->postamble, tapeVolHeader->postamble); - strcpy(hostVolHeader->volumeName, tapeVolHeader->volumeName); - strcpy(hostVolHeader->dumpSetName, tapeVolHeader->dumpSetName); - hostVolHeader->volumeID = ntohl(tapeVolHeader->volumeID); - hostVolHeader->server = ntohl(tapeVolHeader->server); - hostVolHeader->part = ntohl(tapeVolHeader->part); - hostVolHeader->from = ntohl(tapeVolHeader->from); - hostVolHeader->frag = ntohl(tapeVolHeader->frag); - hostVolHeader->magic = ntohl(tapeVolHeader->magic); - hostVolHeader->contd = ntohl(tapeVolHeader->contd); - hostVolHeader->dumpID = ntohl(tapeVolHeader->dumpID); - hostVolHeader->level = ntohl(tapeVolHeader->level); - hostVolHeader->parentID = ntohl(tapeVolHeader->parentID); - hostVolHeader->endTime = ntohl(tapeVolHeader->endTime); - hostVolHeader->versionflags = ntohl(tapeVolHeader->versionflags); - hostVolHeader->cloneDate = ntohl(tapeVolHeader->cloneDate); - break; + case TAPE_VERSION_1: + case TAPE_VERSION_2: + case TAPE_VERSION_3: /* for present */ + case TAPE_VERSION_4: + /* sizes in K and fields in network order */ + /* do the conversion field by field */ + + strcpy(hostVolHeader->preamble, tapeVolHeader->preamble); + strcpy(hostVolHeader->postamble, tapeVolHeader->postamble); + strcpy(hostVolHeader->volumeName, tapeVolHeader->volumeName); + strcpy(hostVolHeader->dumpSetName, tapeVolHeader->dumpSetName); + hostVolHeader->volumeID = ntohl(tapeVolHeader->volumeID); + hostVolHeader->server = ntohl(tapeVolHeader->server); + hostVolHeader->part = ntohl(tapeVolHeader->part); + hostVolHeader->from = ntohl(tapeVolHeader->from); + hostVolHeader->frag = ntohl(tapeVolHeader->frag); + hostVolHeader->magic = ntohl(tapeVolHeader->magic); + hostVolHeader->contd = ntohl(tapeVolHeader->contd); + hostVolHeader->dumpID = ntohl(tapeVolHeader->dumpID); + hostVolHeader->level = ntohl(tapeVolHeader->level); + hostVolHeader->parentID = ntohl(tapeVolHeader->parentID); + hostVolHeader->endTime = ntohl(tapeVolHeader->endTime); + hostVolHeader->versionflags = ntohl(tapeVolHeader->versionflags); + hostVolHeader->cloneDate = ntohl(tapeVolHeader->cloneDate); + break; - default: - return(TC_BADVOLHEADER); + default: + return (TC_BADVOLHEADER); } - return(0); + return (0); } - + afs_int32 ReadVolHeader(taskId, tapeInfoPtr, volHeaderPtr) - afs_int32 taskId; - struct butm_tapeInfo *tapeInfoPtr; - struct volumeHeader *volHeaderPtr; + afs_int32 taskId; + struct butm_tapeInfo *tapeInfoPtr; + struct volumeHeader *volHeaderPtr; { - afs_int32 code = 0; - afs_int32 nbytes; + afs_int32 code = 0; + afs_int32 nbytes; struct volumeHeader volHead; /* Read the volume header */ - code = butm_ReadFileData(tapeInfoPtr, tapeBlock.data, sizeof(tapeVolumeHT), &nbytes); + code = + butm_ReadFileData(tapeInfoPtr, tapeBlock.data, sizeof(tapeVolumeHT), + &nbytes); if (code) { - ErrorLog(0, taskId, code, tapeInfoPtr->error, "Can't read volume header on tape\n"); + ErrorLog(0, taskId, code, tapeInfoPtr->error, + "Can't read volume header on tape\n"); ERROR_EXIT(code); } code = readVolumeHeader(tapeBlock.data, 0L, &volHead); - if (code) - { - ErrorLog(0, taskId, code, 0, "Can't find volume header on tape block\n"); + if (code) { + ErrorLog(0, taskId, code, 0, + "Can't find volume header on tape block\n"); ERROR_EXIT(code); } code = VolHeaderToHost(volHeaderPtr, &volHead); - if (code) - { - ErrorLog(0, taskId, code, 0, "Can't convert volume header\n"); + if (code) { + ErrorLog(0, taskId, code, 0, "Can't convert volume header\n"); ERROR_EXIT(code); } -error_exit: + error_exit: return code; } afs_int32 static GetVolumeHead(taskId, tapeInfoPtr, position, volName, volId) - afs_int32 taskId; - struct butm_tapeInfo *tapeInfoPtr; - afs_int32 position; - char *volName; - afs_int32 volId; + afs_int32 taskId; + struct butm_tapeInfo *tapeInfoPtr; + afs_int32 position; + char *volName; + afs_int32 volId; { afs_int32 code = 0; - struct volumeHeader tapeVolHeader; + struct volumeHeader tapeVolHeader; /* Position directly to the volume and read the header */ if (position) { - code = butm_Seek (tapeInfoPtr, position); + code = butm_Seek(tapeInfoPtr, position); if (code) { - ErrorLog(0, taskId, code, tapeInfoPtr->error, "Can't seek to position %u on tape\n", - position); + ErrorLog(0, taskId, code, tapeInfoPtr->error, + "Can't seek to position %u on tape\n", position); ERROR_EXIT(code); } code = butm_ReadFileBegin(tapeInfoPtr); if (code) { - ErrorLog(0, taskId, code, tapeInfoPtr->error, "Can't read FileBegin on tape\n"); - ERROR_EXIT(code); + ErrorLog(0, taskId, code, tapeInfoPtr->error, + "Can't read FileBegin on tape\n"); + ERROR_EXIT(code); } /* Read the volume header */ code = ReadVolHeader(taskId, tapeInfoPtr, &tapeVolHeader); - if (code) ERROR_EXIT(code); + if (code) + ERROR_EXIT(code); /* Check if volume header matches */ - if (strcmp(tapeVolHeader.volumeName,volName)) ERROR_EXIT(TC_BADVOLHEADER); - if (volId && (tapeVolHeader.volumeID != volId)) ERROR_EXIT(TC_BADVOLHEADER); - if (tapeVolHeader.magic != TC_VOLBEGINMAGIC) ERROR_EXIT(TC_BADVOLHEADER); + if (strcmp(tapeVolHeader.volumeName, volName)) + ERROR_EXIT(TC_BADVOLHEADER); + if (volId && (tapeVolHeader.volumeID != volId)) + ERROR_EXIT(TC_BADVOLHEADER); + if (tapeVolHeader.magic != TC_VOLBEGINMAGIC) + ERROR_EXIT(TC_BADVOLHEADER); } /* Do a sequential search for the volume */ else { - while(1) { + while (1) { code = butm_ReadFileBegin(tapeInfoPtr); if (code) { - ErrorLog(0, taskId, code, tapeInfoPtr->error, "Can't read FileBegin on tape\n"); + ErrorLog(0, taskId, code, tapeInfoPtr->error, + "Can't read FileBegin on tape\n"); ERROR_EXIT(code); } code = ReadVolHeader(taskId, tapeInfoPtr, &tapeVolHeader); - if (code) ERROR_EXIT(TC_VOLUMENOTONTAPE); - + if (code) + ERROR_EXIT(TC_VOLUMENOTONTAPE); + /* Test if we found the volume */ - if ( ( strcmp(tapeVolHeader.volumeName,volName) == 0 ) && - ( !volId || (volId == tapeVolHeader.volumeID) ) ) - break; + if ((strcmp(tapeVolHeader.volumeName, volName) == 0) + && (!volId || (volId == tapeVolHeader.volumeID))) + break; /* skip to the next HW EOF marker */ code = SeekFile(tapeInfoPtr, 1); if (code) { - ErrorLog(0, taskId, code, tapeInfoPtr->error, "Can't seek to next EOF on tape\n"); + ErrorLog(0, taskId, code, tapeInfoPtr->error, + "Can't seek to next EOF on tape\n"); ERROR_EXIT(code); } } } -error_exit: + error_exit: return code; } -afs_int32 GetRestoreTape(taskId, tapeInfoPtr, tname, tapeID, prompt) - afs_int32 taskId; - struct butm_tapeInfo *tapeInfoPtr; - char *tname; - afs_int32 tapeID; - int prompt; +afs_int32 +GetRestoreTape(taskId, tapeInfoPtr, tname, tapeID, prompt) + afs_int32 taskId; + struct butm_tapeInfo *tapeInfoPtr; + char *tname; + afs_int32 tapeID; + int prompt; { struct butm_tapeLabel tapeLabel; - afs_int32 code = 0, rc; - int tapecount = 1; + afs_int32 code = 0, rc; + int tapecount = 1; struct budb_dumpEntry dumpEntry; /* Make sure that the dump/tape is not a XBSA dump */ rc = bcdb_FindDumpByID(tapeID, &dumpEntry); if (!rc && (dumpEntry.flags & (BUDB_DUMP_ADSM | BUDB_DUMP_BUTA))) { - ErrorLog(0, taskId, 0, 0, "Volumes from dump %u are XBSA dumps (skipping)\n", tapeID); - ERROR_EXIT(TC_SKIPTAPE); + ErrorLog(0, taskId, 0, 0, + "Volumes from dump %u are XBSA dumps (skipping)\n", tapeID); + ERROR_EXIT(TC_SKIPTAPE); } - while (1) - { - if (prompt) - { - code = PromptForTape (READOPCODE, tname, tapeID, taskId, tapecount); - if (code) ERROR_EXIT(code); + while (1) { + if (prompt) { + code = + PromptForTape(READOPCODE, tname, tapeID, taskId, tapecount); + if (code) + ERROR_EXIT(code); } prompt = 1; - tapecount++; + tapecount++; - code = butm_Mount (tapeInfoPtr, tname); - if (code) - { + code = butm_Mount(tapeInfoPtr, tname); + if (code) { TapeLog(0, taskId, code, tapeInfoPtr->error, "Can't open tape\n"); goto newtape; } code = butm_ReadLabel(tapeInfoPtr, &tapeLabel, 1); - if (code) - { - ErrorLog(0, taskId, code, tapeInfoPtr->error, "Can't read tape label\n"); + if (code) { + ErrorLog(0, taskId, code, tapeInfoPtr->error, + "Can't read tape label\n"); goto newtape; } /* Now check the label to see if the tapename matches or tapeids match */ - if ( strcmp(TNAME(&tapeLabel),tname) || - ((tapeLabel.structVersion >= TAPE_VERSION_3) && - (tapeLabel.dumpid != tapeID)) ) - { - char expectedName[BU_MAXTAPELEN+32], gotName[BU_MAXTAPELEN+32]; + if (strcmp(TNAME(&tapeLabel), tname) + || ((tapeLabel.structVersion >= TAPE_VERSION_3) + && (tapeLabel.dumpid != tapeID))) { + char expectedName[BU_MAXTAPELEN + 32], + gotName[BU_MAXTAPELEN + 32]; TAPENAME(expectedName, tname, tapeID); LABELNAME(gotName, &tapeLabel); - TapeLog(0, taskId, 0, 0, - "Tape label expected %s, label seen %s\n", - expectedName, gotName); + TapeLog(0, taskId, 0, 0, + "Tape label expected %s, label seen %s\n", expectedName, + gotName); goto newtape; } - + break; newtape: unmountTape(taskId, tapeInfoPtr); } -error_exit: + error_exit: return code; } -afs_int32 xbsaRestoreVolumeData(call, rparamsPtr) - register struct rx_call *call; - struct restoreParams *rparamsPtr; +afs_int32 +xbsaRestoreVolumeData(call, rparamsPtr) + register struct rx_call *call; + struct restoreParams *rparamsPtr; { - afs_int32 code=0; + afs_int32 code = 0; #ifdef xbsa - afs_int32 curChunk, rc; + afs_int32 curChunk, rc; afs_uint32 totalWritten; - afs_int32 headBytes, tailBytes, w; - afs_int32 taskId; - struct volumeHeader volTrailer; - afs_int32 vtsize=0; - int found; - struct dumpNode *nodePtr; + afs_int32 headBytes, tailBytes, w; + afs_int32 taskId; + struct volumeHeader volTrailer; + afs_int32 vtsize = 0; + int found; + struct dumpNode *nodePtr; struct tc_restoreDesc *Restore; - afs_int32 bytesRead, tbuffersize, endData=0; - char *buffer = (char *)bufferBlock, tbuffer[256]; + afs_int32 bytesRead, tbuffersize, endData = 0; + char *buffer = (char *)bufferBlock, tbuffer[256]; - nodePtr = rparamsPtr->nodePtr; - Restore = nodePtr->restores; - taskId = nodePtr->taskID; + nodePtr = rparamsPtr->nodePtr; + Restore = nodePtr->restores; + taskId = nodePtr->taskID; /* Read the volume fragment one block at a time until * find a volume trailer */ - curChunk = BIGCHUNK+1; - tbuffersize = 0; + curChunk = BIGCHUNK + 1; + tbuffersize = 0; totalWritten = 0; while (!endData) { - rc = xbsa_ReadObjectData(&butxInfo, buffer, dataSize, &bytesRead, &endData); - if (restoretofile && (bytesRead > 0)) { - fwrite(buffer, bytesRead, 1, restoretofilefd); /* Save to a file */ - } - if (rc != XBSA_SUCCESS) { - ErrorLog(0, taskId, rc, 0, "Unable to read volume data from the server\n"); - ERROR_EXIT(rc); - } - - /* Periodically update status structure and check if should abort */ - curChunk += bytesRead; - if (curChunk > BIGCHUNK) { - curChunk = 0; - lock_Status(); - nodePtr->statusNodePtr->nKBytes = totalWritten/1024; - unlock_Status(); - - if ( checkAbortByTaskId(taskId) ) - ERROR_EXIT(TC_ABORTEDBYREQUEST); - } - - if (!endData && (bytesRead > 0)) { - /* Fill tbuffer up with data from end of buffer and write - * the remainder of buffer out. - */ - if ((tbuffersize == 0) || (bytesRead >= sizeof(tbuffer))) { - /* Write out contents of tbuffer */ - if (tbuffersize) { - w = rx_Write(call, tbuffer, tbuffersize); - if (w != tbuffersize) { - ErrorLog (0, taskId, -1, 0, "Error in RX write: Wrote %d bytes\n", w); - ERROR_EXIT(-1); + rc = xbsa_ReadObjectData(&butxInfo, buffer, dataSize, &bytesRead, + &endData); + if (restoretofile && (bytesRead > 0)) { + fwrite(buffer, bytesRead, 1, restoretofilefd); /* Save to a file */ + } + if (rc != XBSA_SUCCESS) { + ErrorLog(0, taskId, rc, 0, + "Unable to read volume data from the server\n"); + ERROR_EXIT(rc); + } + + /* Periodically update status structure and check if should abort */ + curChunk += bytesRead; + if (curChunk > BIGCHUNK) { + curChunk = 0; + lock_Status(); + nodePtr->statusNodePtr->nKBytes = totalWritten / 1024; + unlock_Status(); + + if (checkAbortByTaskId(taskId)) + ERROR_EXIT(TC_ABORTEDBYREQUEST); + } + + if (!endData && (bytesRead > 0)) { + /* Fill tbuffer up with data from end of buffer and write + * the remainder of buffer out. + */ + if ((tbuffersize == 0) || (bytesRead >= sizeof(tbuffer))) { + /* Write out contents of tbuffer */ + if (tbuffersize) { + w = rx_Write(call, tbuffer, tbuffersize); + if (w != tbuffersize) { + ErrorLog(0, taskId, -1, 0, + "Error in RX write: Wrote %d bytes\n", w); + ERROR_EXIT(-1); + } + totalWritten += w; } - totalWritten += w; - } - /* fill tbuffer with end of buffer */ - bytesRead -= sizeof(tbuffer); - memcpy(tbuffer, buffer+bytesRead, sizeof(tbuffer)); - tbuffersize = sizeof(tbuffer); - /* Write out whatever is left over in buffer */ - if (bytesRead) { - w = rx_Write(call, buffer, bytesRead); - if (w != bytesRead) { - ErrorLog (0, taskId, -1, 0, "Error in RX data write: Wrote %d bytes\n", w); - ERROR_EXIT(-1); + /* fill tbuffer with end of buffer */ + bytesRead -= sizeof(tbuffer); + memcpy(tbuffer, buffer + bytesRead, sizeof(tbuffer)); + tbuffersize = sizeof(tbuffer); + /* Write out whatever is left over in buffer */ + if (bytesRead) { + w = rx_Write(call, buffer, bytesRead); + if (w != bytesRead) { + ErrorLog(0, taskId, -1, 0, + "Error in RX data write: Wrote %d bytes\n", + w); + ERROR_EXIT(-1); + } + totalWritten += w; + bytesRead = 0; } - totalWritten += w; + } else if ((tbuffersize + bytesRead) <= sizeof(tbuffer)) { + /* Copy all of buffer into tbuffer (it will fit) */ + memcpy(tbuffer + tbuffersize, buffer, bytesRead); + tbuffersize += bytesRead; bytesRead = 0; - } - } - else if ((tbuffersize + bytesRead) <= sizeof(tbuffer)) { - /* Copy all of buffer into tbuffer (it will fit) */ - memcpy(tbuffer+tbuffersize, buffer, bytesRead); - tbuffersize += bytesRead; - bytesRead = 0; - } - else { - /* We need to write some of tbuffer out and fill it with buffer */ - int towrite = bytesRead - (sizeof(tbuffer) - tbuffersize); - w = rx_Write(call, tbuffer, towrite); - if (w != towrite) { - ErrorLog (0, taskId, -1, 0, "Error in RX write: Wrote %d bytes\n", w); - ERROR_EXIT(-1); - } - totalWritten += w; - tbuffersize -= w; - - /* Move the data in tbuffer up */ - memcpy(tbuffer, tbuffer+towrite, tbuffersize); + } else { + /* We need to write some of tbuffer out and fill it with buffer */ + int towrite = bytesRead - (sizeof(tbuffer) - tbuffersize); + w = rx_Write(call, tbuffer, towrite); + if (w != towrite) { + ErrorLog(0, taskId, -1, 0, + "Error in RX write: Wrote %d bytes\n", w); + ERROR_EXIT(-1); + } + totalWritten += w; + tbuffersize -= w; + + /* Move the data in tbuffer up */ + memcpy(tbuffer, tbuffer + towrite, tbuffersize); - /* Now copy buffer in */ - memcpy(tbuffer+tbuffersize, buffer, bytesRead); - tbuffersize += bytesRead; - bytesRead = 0; - } - } + /* Now copy buffer in */ + memcpy(tbuffer + tbuffersize, buffer, bytesRead); + tbuffersize += bytesRead; + bytesRead = 0; + } + } } /* Pull the volume trailer from the last two buffers */ - found = FindVolTrailer2(tbuffer, tbuffersize, &headBytes, - buffer, bytesRead, &tailBytes, - &volTrailer); + found = + FindVolTrailer2(tbuffer, tbuffersize, &headBytes, buffer, bytesRead, + &tailBytes, &volTrailer); if (!found) { - ErrorLog(0, taskId, TC_MISSINGTRAILER, 0, "Missing volume trailer\n"); - ERROR_EXIT(TC_MISSINGTRAILER); + ErrorLog(0, taskId, TC_MISSINGTRAILER, 0, "Missing volume trailer\n"); + ERROR_EXIT(TC_MISSINGTRAILER); } /* Now rx_write the data in the last two blocks */ if (headBytes) { - w = rx_Write(call, tbuffer, headBytes); - if (w != headBytes) { - ErrorLog (0, taskId, -1, 0, "Error in RX trail1 write: Wrote %d bytes\n", w); - ERROR_EXIT(-1); - } - totalWritten += w; + w = rx_Write(call, tbuffer, headBytes); + if (w != headBytes) { + ErrorLog(0, taskId, -1, 0, + "Error in RX trail1 write: Wrote %d bytes\n", w); + ERROR_EXIT(-1); + } + totalWritten += w; } if (tailBytes) { - w = rx_Write(call, buffer, tailBytes); - if (w != tailBytes) { - ErrorLog (0, taskId, -1, 0, "Error in RX trail2 write: Wrote %d bytes\n", w); - ERROR_EXIT(-1); - } - totalWritten += w; + w = rx_Write(call, buffer, tailBytes); + if (w != tailBytes) { + ErrorLog(0, taskId, -1, 0, + "Error in RX trail2 write: Wrote %d bytes\n", w); + ERROR_EXIT(-1); + } + totalWritten += w; } error_exit: -#endif /*xbsa*/ +#endif /*xbsa */ return code; } @@ -1189,56 +1236,57 @@ afs_int32 xbsaRestoreVolumeData(call, rparamsPtr) * with */ -afs_int32 restoreVolumeData (call, rparamsPtr) - register struct rx_call *call; - struct restoreParams *rparamsPtr; +afs_int32 +restoreVolumeData(call, rparamsPtr) + register struct rx_call *call; + struct restoreParams *rparamsPtr; { - afs_int32 curChunk; + afs_int32 curChunk; afs_uint32 totalWritten = 0; - afs_uint32 tapeID; - afs_int32 code, tcode; - afs_int32 headBytes, tailBytes, w; - afs_int32 taskId; - afs_int32 nbytes; /* # bytes data in last tape block read */ - struct volumeHeader tapeVolTrailer; - int found; - int moretoread; - afs_int32 startRbuf, endRbuf, startWbuf, endWbuf, buf, pbuf, lastbuf; + afs_int32 code; + afs_int32 headBytes, tailBytes, w; + afs_int32 taskId; + afs_int32 nbytes; /* # bytes data in last tape block read */ + struct volumeHeader tapeVolTrailer; + int found; + int moretoread; + afs_int32 startRbuf, endRbuf, startWbuf, endWbuf, buf, pbuf, lastbuf; struct tc_restoreDesc *Restore; - struct dumpNode *nodePtr; - struct butm_tapeInfo *tapeInfoPtr; - char *origVolName; - afs_int32 origVolID; - - nodePtr = rparamsPtr->nodePtr; - taskId = nodePtr->taskID; - Restore = nodePtr->restores; + struct dumpNode *nodePtr; + struct butm_tapeInfo *tapeInfoPtr; + char *origVolName; + afs_int32 origVolID; + + nodePtr = rparamsPtr->nodePtr; + taskId = nodePtr->taskID; + Restore = nodePtr->restores; tapeInfoPtr = rparamsPtr->tapeInfoPtr; origVolName = Restore[rparamsPtr->frag].oldName; - origVolID = Restore[rparamsPtr->frag].origVid; + origVolID = Restore[rparamsPtr->frag].origVid; /* Read the volume one fragment at a time */ while (rparamsPtr->frag < nodePtr->arraySize) { - /*w*/ - curChunk = BIGCHUNK+1; /* Check if should abort */ + /*w */ + curChunk = BIGCHUNK + 1; /* Check if should abort */ /* Read the volume fragment one block at a time until * find a volume trailer */ moretoread = 1; - startRbuf = 0; - endRbuf = 0; - startWbuf = 0; + startRbuf = 0; + endRbuf = 0; + startWbuf = 0; while (moretoread) { /* Fill the circular buffer with tape blocks * Search for volume trailer in the process. */ buf = startRbuf; do { - code = butm_ReadFileData(tapeInfoPtr, bufferBlock[buf].data, - BUTM_BLKSIZE, &nbytes); + code = + butm_ReadFileData(tapeInfoPtr, bufferBlock[buf].data, + BUTM_BLKSIZE, &nbytes); if (code) { - ErrorLog(0, taskId, code, tapeInfoPtr->error, + ErrorLog(0, taskId, code, tapeInfoPtr->error, "Can't read FileData on tape %s\n", rparamsPtr->mntTapeName); ERROR_EXIT(code); @@ -1250,20 +1298,23 @@ afs_int32 restoreVolumeData (call, rparamsPtr) curChunk = 0; lock_Status(); - nodePtr->statusNodePtr->nKBytes = totalWritten/1024; + nodePtr->statusNodePtr->nKBytes = totalWritten / 1024; unlock_Status(); - if ( checkAbortByTaskId(taskId) ) - ERROR_EXIT(TC_ABORTEDBYREQUEST); + if (checkAbortByTaskId(taskId)) + ERROR_EXIT(TC_ABORTEDBYREQUEST); } /* step to next block in buffer */ pbuf = buf; - buf = ((buf+1) == tapeblocks) ? 0 : (buf+1); + buf = ((buf + 1) == tapeblocks) ? 0 : (buf + 1); /* If this is the end of the volume, the exit the loop */ - if ( (nbytes != BUTM_BLKSIZE) || - (FindVolTrailer(bufferBlock[pbuf].data,nbytes,&tailBytes, &tapeVolTrailer)) ) + if ((nbytes != BUTM_BLKSIZE) + || + (FindVolTrailer + (bufferBlock[pbuf].data, nbytes, &tailBytes, + &tapeVolTrailer))) moretoread = 0; } while (moretoread && (buf != endRbuf)); @@ -1273,20 +1324,21 @@ afs_int32 restoreVolumeData (call, rparamsPtr) */ lastbuf = endWbuf = pbuf; if (!moretoread && (endWbuf != startWbuf)) - endWbuf = (endWbuf==0) ? (tapeblocks-1) : (endWbuf-1); - - for (buf = startWbuf; buf != endWbuf; buf = (((buf+1)==tapeblocks)?0:(buf+1))){ - w = rx_Write(call,bufferBlock[buf].data,BUTM_BLKSIZE); - if (w != BUTM_BLKSIZE) { - ErrorLog (0, taskId, -1, 0, "Error in RX write\n"); + endWbuf = (endWbuf == 0) ? (tapeblocks - 1) : (endWbuf - 1); + + for (buf = startWbuf; buf != endWbuf; + buf = (((buf + 1) == tapeblocks) ? 0 : (buf + 1))) { + w = rx_Write(call, bufferBlock[buf].data, BUTM_BLKSIZE); + if (w != BUTM_BLKSIZE) { + ErrorLog(0, taskId, -1, 0, "Error in RX write\n"); ERROR_EXIT(-1); } totalWritten += BUTM_BLKSIZE; } - + /* Setup pointers to refill buffer */ - startRbuf = ((lastbuf+1) == tapeblocks) ? 0 : (lastbuf+1); - endRbuf = endWbuf; + startRbuf = ((lastbuf + 1) == tapeblocks) ? 0 : (lastbuf + 1); + endRbuf = endWbuf; startWbuf = endWbuf; } @@ -1295,40 +1347,43 @@ afs_int32 restoreVolumeData (call, rparamsPtr) * Seach for the volume trailer in these two blocks. */ if (lastbuf == startWbuf) - found = FindVolTrailer2((char *)0 , 0 , &headBytes, - bufferBlock[lastbuf].data, nbytes, &tailBytes, - &tapeVolTrailer); + found = + FindVolTrailer2(NULL, 0, &headBytes, + bufferBlock[lastbuf].data, nbytes, &tailBytes, + &tapeVolTrailer); else - found = FindVolTrailer2(bufferBlock[startWbuf].data, BUTM_BLKSIZE, &headBytes, - bufferBlock[lastbuf].data , nbytes , &tailBytes, - &tapeVolTrailer); + found = + FindVolTrailer2(bufferBlock[startWbuf].data, BUTM_BLKSIZE, + &headBytes, bufferBlock[lastbuf].data, nbytes, + &tailBytes, &tapeVolTrailer); if (!found) { - ErrorLog(0, taskId, TC_MISSINGTRAILER, 0, - "Missing volume trailer on tape %s\n", rparamsPtr->mntTapeName); + ErrorLog(0, taskId, TC_MISSINGTRAILER, 0, + "Missing volume trailer on tape %s\n", + rparamsPtr->mntTapeName); ERROR_EXIT(TC_MISSINGTRAILER); } /* Now rx_write the data in the last two blocks */ if (headBytes) { - w = rx_Write(call,bufferBlock[startWbuf].data,headBytes); + w = rx_Write(call, bufferBlock[startWbuf].data, headBytes); if (w != headBytes) { - ErrorLog (0, taskId, -1, 0, "Error in RX write\n"); + ErrorLog(0, taskId, -1, 0, "Error in RX write\n"); ERROR_EXIT(-1); } totalWritten += headBytes; } if (tailBytes) { - w = rx_Write(call,bufferBlock[lastbuf].data,tailBytes); + w = rx_Write(call, bufferBlock[lastbuf].data, tailBytes); if (w != tailBytes) { - ErrorLog (0, taskId, -1, 0, "Error in RX write\n"); + ErrorLog(0, taskId, -1, 0, "Error in RX write\n"); ERROR_EXIT(-1); } totalWritten += tailBytes; } /* Exit the loop if the volume is not continued on next tape */ - if ( !tapeVolTrailer.contd ) - break; /* We've read the entire volume */ + if (!tapeVolTrailer.contd) + break; /* We've read the entire volume */ /* Volume is continued on next tape. * Step to the next volume fragment and prompt for its tape. @@ -1337,408 +1392,441 @@ afs_int32 restoreVolumeData (call, rparamsPtr) */ rparamsPtr->frag++; if (rparamsPtr->frag >= nodePtr->arraySize) - break; + break; unmountTape(taskId, tapeInfoPtr); strcpy(rparamsPtr->mntTapeName, Restore[rparamsPtr->frag].tapeName); - rparamsPtr->tapeID = (Restore[rparamsPtr->frag].initialDumpId ? - Restore[rparamsPtr->frag].initialDumpId : - Restore[rparamsPtr->frag].dbDumpId); - code = GetRestoreTape(taskId, tapeInfoPtr, rparamsPtr->mntTapeName, - rparamsPtr->tapeID, 1); - if (code) ERROR_EXIT(code); + rparamsPtr->tapeID = + (Restore[rparamsPtr->frag]. + initialDumpId ? Restore[rparamsPtr->frag]. + initialDumpId : Restore[rparamsPtr->frag].dbDumpId); + code = + GetRestoreTape(taskId, tapeInfoPtr, rparamsPtr->mntTapeName, + rparamsPtr->tapeID, 1); + if (code) + ERROR_EXIT(code); /* Position to the frag and read the volume header */ - code = GetVolumeHead(taskId, tapeInfoPtr, - Restore[rparamsPtr->frag].position, - origVolName, origVolID); + code = + GetVolumeHead(taskId, tapeInfoPtr, + Restore[rparamsPtr->frag].position, origVolName, + origVolID); if (code) { - ErrorLog(0, taskId, code, 0, "Can't find volume %s (%u) on tape %s\n", - origVolName, origVolID, - rparamsPtr->mntTapeName); + ErrorLog(0, taskId, code, 0, + "Can't find volume %s (%u) on tape %s\n", origVolName, + origVolID, rparamsPtr->mntTapeName); ERROR_EXIT(TC_VOLUMENOTONTAPE); } - } /*w*/ + } /*w */ -error_exit: - return code; + error_exit: + return code; } /* SkipTape * Find all the volumes on a specific tape and mark them to skip. */ SkipTape(Restore, size, index, tapename, tapeid, taskid) - struct tc_restoreDesc *Restore; - afs_int32 size, index, tapeid, taskid; - char *tapename; + struct tc_restoreDesc *Restore; + afs_int32 size, index, tapeid, taskid; + char *tapename; { - afs_int32 i, tid; - - for (i=index; idbDumpId; - - rc = bcdb_FindDumpByID(dumpID, &dumpEntry); - if (rc) { - ErrorLog(0, taskId, rc, 0, "Can't read database for dump %u\n", dumpID); - ERROR_EXIT(rc); - } - - /* ADSM servers restore ADSM and BUTA dumps */ - if ( (xbsaType == XBSA_SERVER_TYPE_ADSM) && - !(dumpEntry.flags & (BUDB_DUMP_ADSM | BUDB_DUMP_BUTA)) ) { - ELog(taskId, "The dump requested by this restore operation for the " - "volumeset is incompatible with this instance of butc\n"); - /* Skip the entire dump (one dump per tape) */ - ERROR_EXIT(TC_SKIPTAPE); - } - - /* make sure we are connected to the correct server. */ - if ( (strlen((char *)dumpEntry.tapes.tapeServer) != 0) && - (strcmp((char *)dumpEntry.tapes.tapeServer,butxInfo.serverName) != 0) ) { - if ((dumpEntry.flags & (BUDB_DUMP_XBSA_NSS | BUDB_DUMP_BUTA)) && !forcemultiple) { - TLog(taskId, "Dump %d is on server %s but butc is connected " - "to server %s (attempting to restore)\n", - dumpID, (char *)dumpEntry.tapes.tapeServer, butxInfo.serverName); - } else { - TLog(taskId, "Dump %d is on server %s but butc is connected " - "to server %s (switching servers)\n", - dumpID, (char *)dumpEntry.tapes.tapeServer, butxInfo.serverName); - - rc = InitToServer(taskId, &butxInfo, (char *)dumpEntry.tapes.tapeServer); - if (rc != XBSA_SUCCESS) ERROR_EXIT(TC_SKIPTAPE); - } - } - - /* Start a transaction and query the server for the correct fileset dump */ - rc = xbsa_BeginTrans(&butxInfo); - if (rc != XBSA_SUCCESS) { - ELog(taskId, "Unable to create a new transaction\n"); - ERROR_EXIT(TC_SKIPTAPE); - } - havetrans = 1; - - if (dumpEntry.flags & BUDB_DUMP_BUTA) { /* old buta style names */ - sprintf(dumpIdStr, "/%d", dumpID); - strcpy(volumeNameStr, "/"); - strcat(volumeNameStr, restoreInfo->oldName); - } else { /* new butc names */ - extern char *butcdumpIdStr; - strcpy(dumpIdStr, butcdumpIdStr); - sprintf(volumeNameStr, "/%d", dumpID); - strcat(volumeNameStr, "/"); - strcat(volumeNameStr, restoreInfo->oldName); - } - - rc = xbsa_QueryObject(&butxInfo, dumpIdStr, volumeNameStr); - if (rc != XBSA_SUCCESS) { - ELog(taskId, "Unable to locate object (%s) of dump (%s) on the server\n", - volumeNameStr, dumpIdStr); - ERROR_EXIT(rc); - } - - rc = xbsa_EndTrans(&butxInfo); - havetrans = 0; - if (rc != XBSA_SUCCESS) { - ELog(taskId, "Unable to terminate the current transaction\n"); - ERROR_EXIT(rc); - } - - if ( checkAbortByTaskId(taskId) ) - ERROR_EXIT(TC_ABORTEDBYREQUEST); - - /* Now start a transaction on the volume to restore and read the - * volumeheader. We do this before starting a transaction on - * volserver to restore the volume because the XBSA server may take - * a while to mount and seek to the volume causing the volserver to - * time out. - */ + afs_int32 rc; + afs_int32 newServer, newPart, newVolId; + char *newVolName; + int restoreflags, havetrans = 0, startread = 0; + afs_int32 bytesRead, endData = 0; + afs_uint32 dumpID; + struct budb_dumpEntry dumpEntry; + char volumeNameStr[XBSA_MAX_PATHNAME], dumpIdStr[XBSA_MAX_OSNAME]; + struct volumeHeader volHeader, hostVolHeader; + + if (restoretofile) { + restoretofilefd = fopen(restoretofile, "w+"); + } + + dumpID = restoreInfo->dbDumpId; + + rc = bcdb_FindDumpByID(dumpID, &dumpEntry); + if (rc) { + ErrorLog(0, taskId, rc, 0, "Can't read database for dump %u\n", + dumpID); + ERROR_EXIT(rc); + } + + /* ADSM servers restore ADSM and BUTA dumps */ + if ((xbsaType == XBSA_SERVER_TYPE_ADSM) + && !(dumpEntry.flags & (BUDB_DUMP_ADSM | BUDB_DUMP_BUTA))) { + ELog(taskId, + "The dump requested by this restore operation for the " + "volumeset is incompatible with this instance of butc\n"); + /* Skip the entire dump (one dump per tape) */ + ERROR_EXIT(TC_SKIPTAPE); + } + + /* make sure we are connected to the correct server. */ + if ((strlen((char *)dumpEntry.tapes.tapeServer) != 0) + && (strcmp((char *)dumpEntry.tapes.tapeServer, butxInfo.serverName) != + 0)) { + if ((dumpEntry.flags & (BUDB_DUMP_XBSA_NSS | BUDB_DUMP_BUTA)) + && !forcemultiple) { + TLog(taskId, + "Dump %d is on server %s but butc is connected " + "to server %s (attempting to restore)\n", dumpID, + (char *)dumpEntry.tapes.tapeServer, butxInfo.serverName); + } else { + TLog(taskId, + "Dump %d is on server %s but butc is connected " + "to server %s (switching servers)\n", dumpID, + (char *)dumpEntry.tapes.tapeServer, butxInfo.serverName); + + rc = InitToServer(taskId, &butxInfo, + (char *)dumpEntry.tapes.tapeServer); + if (rc != XBSA_SUCCESS) + ERROR_EXIT(TC_SKIPTAPE); + } + } + + /* Start a transaction and query the server for the correct fileset dump */ + rc = xbsa_BeginTrans(&butxInfo); + if (rc != XBSA_SUCCESS) { + ELog(taskId, "Unable to create a new transaction\n"); + ERROR_EXIT(TC_SKIPTAPE); + } + havetrans = 1; + + if (dumpEntry.flags & BUDB_DUMP_BUTA) { /* old buta style names */ + sprintf(dumpIdStr, "/%d", dumpID); + strcpy(volumeNameStr, "/"); + strcat(volumeNameStr, restoreInfo->oldName); + } else { /* new butc names */ + extern char *butcdumpIdStr; + strcpy(dumpIdStr, butcdumpIdStr); + sprintf(volumeNameStr, "/%d", dumpID); + strcat(volumeNameStr, "/"); + strcat(volumeNameStr, restoreInfo->oldName); + } + + rc = xbsa_QueryObject(&butxInfo, dumpIdStr, volumeNameStr); + if (rc != XBSA_SUCCESS) { + ELog(taskId, + "Unable to locate object (%s) of dump (%s) on the server\n", + volumeNameStr, dumpIdStr); + ERROR_EXIT(rc); + } + + rc = xbsa_EndTrans(&butxInfo); + havetrans = 0; + if (rc != XBSA_SUCCESS) { + ELog(taskId, "Unable to terminate the current transaction\n"); + ERROR_EXIT(rc); + } + + if (checkAbortByTaskId(taskId)) + ERROR_EXIT(TC_ABORTEDBYREQUEST); + + /* Now start a transaction on the volume to restore and read the + * volumeheader. We do this before starting a transaction on + * volserver to restore the volume because the XBSA server may take + * a while to mount and seek to the volume causing the volserver to + * time out. + */ rc = xbsa_BeginTrans(&butxInfo); if (rc != XBSA_SUCCESS) { - ELog(taskId, "Unable to create a new transaction\n"); - ERROR_EXIT(TC_SKIPTAPE); + ELog(taskId, "Unable to create a new transaction\n"); + ERROR_EXIT(TC_SKIPTAPE); } havetrans = 1; rc = xbsa_ReadObjectBegin(&butxInfo, (char *)&volHeader, sizeof(volHeader), &bytesRead, &endData); if (restoretofile && (bytesRead > 0)) { - fwrite((char *)&volHeader, bytesRead, 1, restoretofilefd); /* Save to a file */ + fwrite((char *)&volHeader, bytesRead, 1, restoretofilefd); /* Save to a file */ } if (rc != XBSA_SUCCESS) { - ELog(taskId, "Unable to begin reading of the volume from the server\n"); - ERROR_EXIT(rc); + ELog(taskId, + "Unable to begin reading of the volume from the server\n"); + ERROR_EXIT(rc); } startread = 1; if ((bytesRead != sizeof(volHeader)) || endData) { - ELog(taskId,"The size of data read (%d) does not equal the size of data requested (%d)\n", - bytesRead, sizeof(volHeader)); - ERROR_EXIT(TC_BADVOLHEADER); + ELog(taskId, + "The size of data read (%d) does not equal the size of data requested (%d)\n", + bytesRead, sizeof(volHeader)); + ERROR_EXIT(TC_BADVOLHEADER); } /* convert and check the volume header */ rc = VolHeaderToHost(&hostVolHeader, &volHeader); if (rc) { - ErrorLog(0, taskId, code, 0, "Can't convert volume header\n"); + ErrorLog(0, taskId, code, 0, "Can't convert volume header\n"); ERROR_EXIT(rc); } - if ( (strcmp(hostVolHeader.volumeName,restoreInfo->oldName) != 0) || - (restoreInfo->origVid && (hostVolHeader.volumeID != restoreInfo->origVid)) || - (hostVolHeader.magic != TC_VOLBEGINMAGIC) ) - ERROR_EXIT(TC_BADVOLHEADER); - - /* Set up prior restoring volume data */ - newVolName = restoreInfo->newName; - newVolId = restoreInfo->vid; - newServer = restoreInfo->hostAddr; - newPart = restoreInfo->partition; - restoreflags = 0; - if ( (restoreInfo->dumpLevel == 0) || (restoreInfo->flags & RDFLAG_FIRSTDUMP) ) - restoreflags |= RV_FULLRST; - if (!(restoreInfo->flags & RDFLAG_LASTDUMP)) - restoreflags |= RV_OFFLINE; - - if ( checkAbortByTaskId(taskId) ) - ERROR_EXIT(TC_ABORTEDBYREQUEST); - - /* Start the restore of the volume data. This is the code we want to return */ - code = UV_RestoreVolume(htonl(newServer), newPart, - newVolId, newVolName, - restoreflags, - xbsaRestoreVolumeData, - (char *)rparamsPtr); + if ((strcmp(hostVolHeader.volumeName, restoreInfo->oldName) != 0) + || (restoreInfo->origVid + && (hostVolHeader.volumeID != restoreInfo->origVid)) + || (hostVolHeader.magic != TC_VOLBEGINMAGIC)) + ERROR_EXIT(TC_BADVOLHEADER); + + /* Set up prior restoring volume data */ + newVolName = restoreInfo->newName; + newVolId = restoreInfo->vid; + newServer = restoreInfo->hostAddr; + newPart = restoreInfo->partition; + restoreflags = 0; + if ((restoreInfo->dumpLevel == 0) + || (restoreInfo->flags & RDFLAG_FIRSTDUMP)) + restoreflags |= RV_FULLRST; + if (!(restoreInfo->flags & RDFLAG_LASTDUMP)) + restoreflags |= RV_OFFLINE; + + if (checkAbortByTaskId(taskId)) + ERROR_EXIT(TC_ABORTEDBYREQUEST); + + /* Start the restore of the volume data. This is the code we want to return */ + code = + UV_RestoreVolume(htonl(newServer), newPart, newVolId, newVolName, + restoreflags, xbsaRestoreVolumeData, + (char *)rparamsPtr); error_exit: - if (startread) { - rc = xbsa_ReadObjectEnd(&butxInfo); - if (rc != XBSA_SUCCESS) { - ELog(taskId, "Unable to terminate reading of the volume from the server\n"); - ERROR_EXIT(rc); - } - } - - if (havetrans) { - rc = xbsa_EndTrans(&butxInfo); - if (rc != XBSA_SUCCESS) { - ELog(taskId, "Unable to terminate the current transaction\n"); - if (!code) code = rc; - } - } - - if (restoretofile && restoretofilefd) { - fclose(restoretofilefd); - } + if (startread) { + rc = xbsa_ReadObjectEnd(&butxInfo); + if (rc != XBSA_SUCCESS) { + ELog(taskId, + "Unable to terminate reading of the volume from the server\n"); + ERROR_EXIT(rc); + } + } + + if (havetrans) { + rc = xbsa_EndTrans(&butxInfo); + if (rc != XBSA_SUCCESS) { + ELog(taskId, "Unable to terminate the current transaction\n"); + if (!code) + code = rc; + } + } + + if (restoretofile && restoretofilefd) { + fclose(restoretofilefd); + } #endif - return(code); + return (code); } restoreVolume(taskId, restoreInfo, rparamsPtr) - afs_uint32 taskId; - struct tc_restoreDesc *restoreInfo; - struct restoreParams *rparamsPtr; + afs_uint32 taskId; + struct tc_restoreDesc *restoreInfo; + struct restoreParams *rparamsPtr; { - afs_int32 code=0, rc; - afs_int32 newServer, newPart, newVolId; - char *newVolName; - int restoreflags; - afs_uint32 tapeID; - struct butm_tapeInfo *tapeInfoPtr = rparamsPtr->tapeInfoPtr; - struct budb_dumpEntry dumpEntry; - - /* Check if we need a tape and prompt for one if so */ - tapeID = (restoreInfo->initialDumpId ? restoreInfo->initialDumpId : restoreInfo->dbDumpId); - if ( (rparamsPtr->frag == 0) || - (strcmp(restoreInfo->tapeName,rparamsPtr->mntTapeName) != 0) || - (tapeID != rparamsPtr->tapeID) ) { - /* Unmount the previous tape */ - unmountTape(taskId, tapeInfoPtr); - - /* Remember this new tape */ - strcpy(rparamsPtr->mntTapeName, restoreInfo->tapeName); - rparamsPtr->tapeID = tapeID; - - /* Mount a new tape */ - rc = GetRestoreTape(taskId, tapeInfoPtr, rparamsPtr->mntTapeName, - rparamsPtr->tapeID, ((rparamsPtr->frag==0)?autoQuery:1)); - if (rc) ERROR_EXIT(rc); - } - - /* Seek to the correct spot and read the header information */ - rc = GetVolumeHead(taskId, tapeInfoPtr, restoreInfo->position, - restoreInfo->oldName, restoreInfo->origVid); - if (rc) ERROR_EXIT(rc); - - /* Set up prior restoring volume data */ - newVolName = restoreInfo->newName; - newVolId = restoreInfo->vid; - newServer = restoreInfo->hostAddr; - newPart = restoreInfo->partition; - restoreflags = 0; - if ( (restoreInfo->dumpLevel == 0) || (restoreInfo->flags & RDFLAG_FIRSTDUMP) ) - restoreflags |= RV_FULLRST; - if (!(restoreInfo->flags & RDFLAG_LASTDUMP)) - restoreflags |= RV_OFFLINE; - - if ( checkAbortByTaskId(taskId) ) - ERROR_EXIT(TC_ABORTEDBYREQUEST); - - /* Start the restore of the volume data. This is the code we - * want to return. - */ - code = UV_RestoreVolume(htonl(newServer), newPart, - newVolId, newVolName, - restoreflags, - restoreVolumeData, - (char *)rparamsPtr); - - /* Read the FileEnd marker for the volume and step to next FM */ - rc = butm_ReadFileEnd(tapeInfoPtr); - if (rc) { - ErrorLog(0, taskId, rc, tapeInfoPtr->error, "Can't read EOF on tape\n"); - } + afs_int32 code = 0, rc; + afs_int32 newServer, newPart, newVolId; + char *newVolName; + int restoreflags; + afs_uint32 tapeID; + struct butm_tapeInfo *tapeInfoPtr = rparamsPtr->tapeInfoPtr; + + /* Check if we need a tape and prompt for one if so */ + tapeID = + (restoreInfo->initialDumpId ? restoreInfo-> + initialDumpId : restoreInfo->dbDumpId); + if ((rparamsPtr->frag == 0) + || (strcmp(restoreInfo->tapeName, rparamsPtr->mntTapeName) != 0) + || (tapeID != rparamsPtr->tapeID)) { + /* Unmount the previous tape */ + unmountTape(taskId, tapeInfoPtr); + + /* Remember this new tape */ + strcpy(rparamsPtr->mntTapeName, restoreInfo->tapeName); + rparamsPtr->tapeID = tapeID; + + /* Mount a new tape */ + rc = GetRestoreTape(taskId, tapeInfoPtr, rparamsPtr->mntTapeName, + rparamsPtr->tapeID, + ((rparamsPtr->frag == 0) ? autoQuery : 1)); + if (rc) + ERROR_EXIT(rc); + } + + /* Seek to the correct spot and read the header information */ + rc = GetVolumeHead(taskId, tapeInfoPtr, restoreInfo->position, + restoreInfo->oldName, restoreInfo->origVid); + if (rc) + ERROR_EXIT(rc); + + /* Set up prior restoring volume data */ + newVolName = restoreInfo->newName; + newVolId = restoreInfo->vid; + newServer = restoreInfo->hostAddr; + newPart = restoreInfo->partition; + restoreflags = 0; + if ((restoreInfo->dumpLevel == 0) + || (restoreInfo->flags & RDFLAG_FIRSTDUMP)) + restoreflags |= RV_FULLRST; + if (!(restoreInfo->flags & RDFLAG_LASTDUMP)) + restoreflags |= RV_OFFLINE; + + if (checkAbortByTaskId(taskId)) + ERROR_EXIT(TC_ABORTEDBYREQUEST); + + /* Start the restore of the volume data. This is the code we + * want to return. + */ + code = + UV_RestoreVolume(htonl(newServer), newPart, newVolId, newVolName, + restoreflags, restoreVolumeData, (char *)rparamsPtr); + + /* Read the FileEnd marker for the volume and step to next FM */ + rc = butm_ReadFileEnd(tapeInfoPtr); + if (rc) { + ErrorLog(0, taskId, rc, tapeInfoPtr->error, + "Can't read EOF on tape\n"); + } error_exit: - return(code); + return (code); } /* Restorer * created as a LWP by the server stub, is a pointer to all * the parameters Restorer needs */ -Restorer (newNode) - struct dumpNode *newNode; +Restorer(newNode) + struct dumpNode *newNode; { - afs_int32 code = 0, tcode, rc; + afs_int32 code = 0, tcode; afs_uint32 taskId; - afs_uint32 dumpID; - char *newVolName; - struct butm_tapeInfo tapeInfo; + char *newVolName; + struct butm_tapeInfo tapeInfo; struct tc_restoreDesc *Restore; struct tc_restoreDesc *RestoreDesc; - struct restoreParams rparams; - int restoreflags; + struct restoreParams rparams; afs_int32 allocbufferSize; time_t startTime, endTime; - afs_int32 goodrestore=0; + afs_int32 goodrestore = 0; taskId = newNode->taskID; setStatus(taskId, DRIVE_WAIT); EnterDeviceQueue(deviceLatch); clearStatus(taskId, DRIVE_WAIT); - + printf("\n\n"); - TLog (taskId, "Restore\n"); + TLog(taskId, "Restore\n"); memset(&tapeInfo, 0, sizeof(tapeInfo)); if (!CONF_XBSA) { - tapeInfo.structVersion = BUTM_MAJORVERSION; - tcode = butm_file_Instantiate (&tapeInfo, &globalTapeConfig); - if (tcode) { - ErrorLog(0, taskId, tcode, tapeInfo.error, - "Can't initialize the tape module\n"); - ERROR_EXIT(tcode); - } + tapeInfo.structVersion = BUTM_MAJORVERSION; + tcode = butm_file_Instantiate(&tapeInfo, &globalTapeConfig); + if (tcode) { + ErrorLog(0, taskId, tcode, tapeInfo.error, + "Can't initialize the tape module\n"); + ERROR_EXIT(tcode); + } } - if ( checkAbortByTaskId(taskId) ) ERROR_EXIT(TC_ABORTEDBYREQUEST); + if (checkAbortByTaskId(taskId)) + ERROR_EXIT(TC_ABORTEDBYREQUEST); memset(&rparams, 0, sizeof(rparams)); - rparams.nodePtr = newNode; + rparams.nodePtr = newNode; rparams.tapeInfoPtr = &tapeInfo; - Restore = newNode->restores; /* Array of vol fragments to restore */ + Restore = newNode->restores; /* Array of vol fragments to restore */ /* Allocate memory in which to restore the volumes data into */ if (CONF_XBSA) { - allocbufferSize = dataSize = BufferSize; + allocbufferSize = dataSize = BufferSize; } else { - /* Must have at least two tape blocks */ - tapeblocks = BufferSize / BUTM_BLOCKSIZE; - if (tapeblocks < 2) tapeblocks = 2; - allocbufferSize = tapeblocks * BUTM_BLOCKSIZE; /* This many full tapeblocks */ - } - bufferBlock = (struct TapeBlock *)0; - bufferBlock = (struct TapeBlock *) malloc(allocbufferSize); - if (!bufferBlock) ERROR_EXIT(TC_NOMEMORY); + /* Must have at least two tape blocks */ + tapeblocks = BufferSize / BUTM_BLOCKSIZE; + if (tapeblocks < 2) + tapeblocks = 2; + allocbufferSize = tapeblocks * BUTM_BLOCKSIZE; /* This many full tapeblocks */ + } + bufferBlock = NULL; + bufferBlock = (struct TapeBlock *)malloc(allocbufferSize); + if (!bufferBlock) + ERROR_EXIT(TC_NOMEMORY); memset(bufferBlock, 0, allocbufferSize); startTime = time(0); - for (rparams.frag=0; (rparams.frag < newNode->arraySize); rparams.frag++) { - RestoreDesc = &Restore[rparams.frag]; - - /* Skip the volume if it was requested to */ - if (RestoreDesc->flags & RDFLAG_SKIP) { - if (RestoreDesc->flags & RDFLAG_LASTDUMP) { - /* If the volume was restored, should bring it online */ - } - continue; + for (rparams.frag = 0; (rparams.frag < newNode->arraySize); + rparams.frag++) { + RestoreDesc = &Restore[rparams.frag]; + + /* Skip the volume if it was requested to */ + if (RestoreDesc->flags & RDFLAG_SKIP) { + if (RestoreDesc->flags & RDFLAG_LASTDUMP) { + /* If the volume was restored, should bring it online */ + } + continue; } newVolName = RestoreDesc->newName; /* Make sure the server to restore to is good */ if (!RestoreDesc->hostAddr) { - ErrorLog(0, taskId, 0, 0, "Illegal host ID 0 for volume %s\n", newVolName); + ErrorLog(0, taskId, 0, 0, "Illegal host ID 0 for volume %s\n", + newVolName); ERROR_EXIT(TC_INTERNALERROR); } - if ( checkAbortByTaskId(taskId) ) - ERROR_EXIT(TC_ABORTEDBYREQUEST); + if (checkAbortByTaskId(taskId)) + ERROR_EXIT(TC_ABORTEDBYREQUEST); TapeLog(1, taskId, 0, 0, "Restoring volume %s\n", newVolName); lock_Status(); - strncpy(newNode->statusNodePtr->volumeName, newVolName, BU_MAXNAMELEN); + strncpy(newNode->statusNodePtr->volumeName, newVolName, + BU_MAXNAMELEN); unlock_Status(); /* restoreVolume function takes care of all the related fragments @@ -1746,23 +1834,25 @@ Restorer (newNode) * restored */ if (CONF_XBSA) { - tcode = xbsaRestoreVolume(taskId, RestoreDesc, &rparams); + tcode = xbsaRestoreVolume(taskId, RestoreDesc, &rparams); } else { - tcode = restoreVolume(taskId, RestoreDesc, &rparams); + tcode = restoreVolume(taskId, RestoreDesc, &rparams); } if (tcode) { if (tcode == TC_ABORTEDBYREQUEST) { - ERROR_EXIT(tcode); + ERROR_EXIT(tcode); } else if (tcode == TC_SKIPTAPE) { - afs_uint32 tapeID; - tapeID = (RestoreDesc->initialDumpId ? RestoreDesc->initialDumpId : - RestoreDesc->dbDumpId); - SkipTape(Restore, newNode->arraySize, rparams.frag, - RestoreDesc->tapeName, tapeID, taskId); + afs_uint32 tapeID; + tapeID = + (RestoreDesc->initialDumpId ? RestoreDesc-> + initialDumpId : RestoreDesc->dbDumpId); + SkipTape(Restore, newNode->arraySize, rparams.frag, + RestoreDesc->tapeName, tapeID, taskId); } else { - ErrorLog(0, taskId, tcode, 0, "Can't restore volume %s\n", newVolName); - SkipVolume(Restore, newNode->arraySize, rparams.frag, - RestoreDesc->origVid, taskId); + ErrorLog(0, taskId, tcode, 0, "Can't restore volume %s\n", + newVolName); + SkipVolume(Restore, newNode->arraySize, rparams.frag, + RestoreDesc->origVid, taskId); } rparams.frag--; continue; @@ -1774,73 +1864,68 @@ Restorer (newNode) error_exit: endTime = time(0); if (!CONF_XBSA) { - unmountTape(taskId, &tapeInfo); + unmountTape(taskId, &tapeInfo); } else { #ifdef xbsa - rc = InitToServer(taskId, &butxInfo, 0); /* Return to original server */ + code = InitToServer(taskId, &butxInfo, 0); /* Return to original server */ #endif } - if (bufferBlock) free(bufferBlock); + if (bufferBlock) + free(bufferBlock); - if (code == TC_ABORTEDBYREQUEST) - { - ErrorLog(0, taskId, 0, 0, "Restore: Aborted by request\n"); + if (code == TC_ABORTEDBYREQUEST) { + ErrorLog(0, taskId, 0, 0, "Restore: Aborted by request\n"); clearStatus(taskId, ABORT_REQUEST); - setStatus (taskId, ABORT_DONE); - } - else if (code) - { - TapeLog(0, taskId, code, 0, "Restore: Finished with errors\n"); + setStatus(taskId, ABORT_DONE); + } else if (code) { + TapeLog(0, taskId, code, 0, "Restore: Finished with errors\n"); setStatus(taskId, TASK_ERROR); - } - else - { - TLog(taskId, "Restore: Finished\n"); + } else { + TLog(taskId, "Restore: Finished\n"); } if (centralLogIO && startTime) { - long timediff; - afs_int32 hrs, min, sec, tmp; - char line[1024]; - struct tm tmstart, tmend; - - localtime_r(&startTime, &tmstart); - localtime_r(&endTime, &tmend); - timediff = (int)endTime - (int)startTime; - hrs = timediff / 3600; - tmp = timediff % 3600; - min = tmp / 60; - sec = tmp % 60; - - sprintf(line, "%-5d %02d/%02d/%04d %02d:%02d:%02d " - "%02d/%02d/%04d %02d:%02d:%02d " - "%02d:%02d:%02d " - "%d of %d volume%s restored\n", - taskId, tmstart.tm_mon+1, tmstart.tm_mday, tmstart.tm_year+1900, - tmstart.tm_hour, tmstart.tm_min, tmstart.tm_sec, - tmend.tm_mon+1, tmend.tm_mday, tmend.tm_year+1900, - tmend.tm_hour, tmend.tm_min, tmend.tm_sec, - hrs, min, sec, - goodrestore, newNode->arraySize, ((newNode->arraySize>1)?"s":"")); - - fwrite(line, strlen(line), 1, centralLogIO); - fflush(centralLogIO); + long timediff; + afs_int32 hrs, min, sec, tmp; + char line[1024]; + struct tm tmstart, tmend; + + localtime_r(&startTime, &tmstart); + localtime_r(&endTime, &tmend); + timediff = (int)endTime - (int)startTime; + hrs = timediff / 3600; + tmp = timediff % 3600; + min = tmp / 60; + sec = tmp % 60; + + sprintf(line, + "%-5d %02d/%02d/%04d %02d:%02d:%02d " + "%02d/%02d/%04d %02d:%02d:%02d " "%02d:%02d:%02d " + "%d of %d volume%s restored\n", taskId, tmstart.tm_mon + 1, + tmstart.tm_mday, tmstart.tm_year + 1900, tmstart.tm_hour, + tmstart.tm_min, tmstart.tm_sec, tmend.tm_mon + 1, + tmend.tm_mday, tmend.tm_year + 1900, tmend.tm_hour, + tmend.tm_min, tmend.tm_sec, hrs, min, sec, goodrestore, + newNode->arraySize, ((newNode->arraySize > 1) ? "s" : "")); + + fwrite(line, strlen(line), 1, centralLogIO); + fflush(centralLogIO); } setStatus(taskId, TASK_DONE); FreeNode(taskId); LeaveDeviceQueue(deviceLatch); - return(code); -} + return (code); +} /* this is just scaffolding, creates new tape label with name */ GetNewLabel(tapeInfoPtr, pName, AFSName, tapeLabel) - struct butm_tapeInfo *tapeInfoPtr; - char *pName, *AFSName; - struct butm_tapeLabel *tapeLabel; + struct butm_tapeInfo *tapeInfoPtr; + char *pName, *AFSName; + struct butm_tapeLabel *tapeLabel; { struct timeval tp; struct timezone tzp; @@ -1849,122 +1934,133 @@ GetNewLabel(tapeInfoPtr, pName, AFSName, tapeLabel) memset(tapeLabel, 0, sizeof(struct butm_tapeLabel)); if (!CONF_XBSA) { - butm_GetSize(tapeInfoPtr, &size); - if ( !size ) size = globalTapeConfig.capacity; + butm_GetSize(tapeInfoPtr, &size); + if (!size) + size = globalTapeConfig.capacity; } else { - size = 0; /* no tape size */ - } - gettimeofday(&tp,&tzp); - - tapeLabel->structVersion = CUR_TAPE_VERSION; - tapeLabel->creationTime = tp.tv_sec; - tapeLabel->size = size; - tapeLabel->expirationDate = 0; /* 1970 sometime */ - tapeLabel->dumpPath[0] = 0; /* no path name */ - tapeLabel->useCount = 0; - strcpy(tapeLabel->AFSName, AFSName); - strcpy(tapeLabel->pName, pName); - strcpy(tapeLabel->cell, globalCellName); - strcpy(tapeLabel->comment, "AFS Backup Software"); - strcpy(tapeLabel->creator.name, "AFS 3.6"); + size = 0; /* no tape size */ + } + gettimeofday(&tp, &tzp); + + tapeLabel->structVersion = CUR_TAPE_VERSION; + tapeLabel->creationTime = tp.tv_sec; + tapeLabel->size = size; + tapeLabel->expirationDate = 0; /* 1970 sometime */ + tapeLabel->dumpPath[0] = 0; /* no path name */ + tapeLabel->useCount = 0; + strcpy(tapeLabel->AFSName, AFSName); + strcpy(tapeLabel->pName, pName); + strcpy(tapeLabel->cell, globalCellName); + strcpy(tapeLabel->comment, "AFS Backup Software"); + strcpy(tapeLabel->creator.name, "AFS 3.6"); strcpy(tapeLabel->creator.instance, ""); - strcpy(tapeLabel->creator.cell, globalCellName); + strcpy(tapeLabel->creator.cell, globalCellName); } /* extracts trailer out of buffer, nbytes is set to total data in buffer - trailer size */ afs_int32 ExtractTrailer(buffer, size, nbytes, volTrailerPtr) - char *buffer; - afs_int32 *nbytes; - afs_int32 size; - struct volumeHeader *volTrailerPtr; -{ - afs_int32 code = 0; - afs_int32 startPos; + char *buffer; + afs_int32 *nbytes; + afs_int32 size; + struct volumeHeader *volTrailerPtr; +{ + afs_int32 code = 0; + afs_int32 startPos; struct volumeHeader tempTrailer; for (startPos = 0; - startPos <= (size - sizeof(struct volumeHeader) + sizeof(tempTrailer.pad)); - startPos++) - { - code = readVolumeHeader(buffer, startPos, &tempTrailer); - if (code == 0) - { + startPos <= + (size - sizeof(struct volumeHeader) + sizeof(tempTrailer.pad)); + startPos++) { + code = readVolumeHeader(buffer, startPos, &tempTrailer); + if (code == 0) { code = VolHeaderToHost(volTrailerPtr, &tempTrailer); - if (code) break; + if (code) + break; - if (nbytes) *nbytes = startPos; - return 1; /* saw the trailer */ + if (nbytes) + *nbytes = startPos; + return 1; /* saw the trailer */ } } - if (nbytes) *nbytes = size/2; - return 0; /* did not see the trailer */ + if (nbytes) + *nbytes = size / 2; + return 0; /* did not see the trailer */ } int FindVolTrailer(buffer, size, dSize, volTrailerPtr) - char *buffer; - afs_int32 size; - struct volumeHeader *volTrailerPtr; - afs_int32 *dSize; /* dataSize */ + char *buffer; + afs_int32 size; + struct volumeHeader *volTrailerPtr; + afs_int32 *dSize; /* dataSize */ { afs_int32 offset, s; - afs_int32 code; int found; - + *dSize = size; - if (!buffer) return 0; + if (!buffer) + return 0; - s = sizeof(struct volumeHeader) + sizeof(volTrailerPtr->pad); - if (s > size) s = size; + s = sizeof(struct volumeHeader) + sizeof(volTrailerPtr->pad); + if (s > size) + s = size; - found = ExtractTrailer((buffer+size-s),s,&offset,volTrailerPtr); - if (found) *dSize -= (s - offset); + found = ExtractTrailer((buffer + size - s), s, &offset, volTrailerPtr); + if (found) + *dSize -= (s - offset); return found; } int -FindVolTrailer2(buffera, sizea, dataSizea, bufferb, sizeb, dataSizeb, volTrailerPtr) - char *buffera; - afs_int32 sizea; - afs_int32 *dataSizea; - char *bufferb; - afs_int32 sizeb; - afs_int32 *dataSizeb; - struct volumeHeader *volTrailerPtr; +FindVolTrailer2(buffera, sizea, dataSizea, bufferb, sizeb, dataSizeb, + volTrailerPtr) + char *buffera; + afs_int32 sizea; + afs_int32 *dataSizea; + char *bufferb; + afs_int32 sizeb; + afs_int32 *dataSizeb; + struct volumeHeader *volTrailerPtr; { afs_int32 offset, s; afs_int32 headB, tailB; - int found=0; + int found = 0; - if ( !buffera ) sizea = 0; - if ( !bufferb ) sizeb = 0; + if (!buffera) + sizea = 0; + if (!bufferb) + sizeb = 0; *dataSizea = sizea; *dataSizeb = sizeb; - s = sizeof(struct volumeHeader) + sizeof(volTrailerPtr->pad); + s = sizeof(struct volumeHeader) + sizeof(volTrailerPtr->pad); if (sizeb >= s) { - found = FindVolTrailer(bufferb, sizeb, dataSizeb, volTrailerPtr); + found = FindVolTrailer(bufferb, sizeb, dataSizeb, volTrailerPtr); } else { - tailB = sizeb; - headB = (s - sizeb); /*(s > sizeb)*/ + tailB = sizeb; + headB = (s - sizeb); /*(s > sizeb) */ if (headB > sizea) { headB = sizea; s = headB + tailB; - if (!s) return 0; + if (!s) + return 0; } - + memset(tapeVolumeHT, 0, sizeof(tapeVolumeHT)); - if (headB) memcpy(tapeVolumeHT , buffera + sizea - headB, headB); - if (tailB) memcpy(tapeVolumeHT + headB, bufferb , tailB); - if (ExtractTrailer (tapeVolumeHT, s, &offset, volTrailerPtr)) { + if (headB) + memcpy(tapeVolumeHT, buffera + sizea - headB, headB); + if (tailB) + memcpy(tapeVolumeHT + headB, bufferb, tailB); + if (ExtractTrailer(tapeVolumeHT, s, &offset, volTrailerPtr)) { found = 1; if (offset > headB) { - /* *dataSizea remains unchanged */ - *dataSizeb = offset - headB; + /* *dataSizea remains unchanged */ + *dataSizeb = offset - headB; } else { - *dataSizea -= (headB - offset); /*(headB >= offset)*/ + *dataSizea -= (headB - offset); /*(headB >= offset) */ *dataSizeb = 0; } } @@ -1974,40 +2070,42 @@ FindVolTrailer2(buffera, sizea, dataSizea, bufferb, sizeb, dataSizeb, volTrailer /* Returns true or false depending on whether the tape is expired or not */ -Date ExpirationDate (dumpid) - afs_int32 dumpid; +Date +ExpirationDate(dumpid) + afs_int32 dumpid; { - afs_int32 code; - Date expiration = 0; - struct budb_dumpEntry dumpEntry; - struct budb_tapeEntry tapeEntry; + afs_int32 code; + Date expiration = 0; + struct budb_dumpEntry dumpEntry; + struct budb_tapeEntry tapeEntry; struct budb_volumeEntry volEntry; - - if (dumpid) - { - /* + + if (dumpid) { + /* * Get the expiration date from DB if its there. The expiration of any tape * will be the most future expiration of any dump in the set. Can't use * bcdb_FindTape because dumpid here pertains to the initial dump id. */ - code = bcdb_FindLastTape(dumpid, &dumpEntry, &tapeEntry, &volEntry); - if (!code) expiration = tapeEntry.expires; + code = bcdb_FindLastTape(dumpid, &dumpEntry, &tapeEntry, &volEntry); + if (!code) + expiration = tapeEntry.expires; } - return(expiration); + return (expiration); } -int -tapeExpired (tapeLabelPtr) - struct butm_tapeLabel *tapeLabelPtr; +int +tapeExpired(tapeLabelPtr) + struct butm_tapeLabel *tapeLabelPtr; { - Date expiration; - struct timeval tp; - struct timezone tzp; - + Date expiration; + struct timeval tp; + struct timezone tzp; + expiration = ExpirationDate(tapeLabelPtr->dumpid); - if (!expiration) expiration = tapeLabelPtr->expirationDate; + if (!expiration) + expiration = tapeLabelPtr->expirationDate; - gettimeofday (&tp, &tzp); + gettimeofday(&tp, &tzp); return ((expiration < tp.tv_sec) ? 1 : 0); } @@ -2029,104 +2127,95 @@ updateTapeLabel(labelIfPtr, tapeInfoPtr, newLabelPtr) afs_uint32 taskId; int tapeIsLabeled = 0; int interactiveFlag; - extern afs_int32 BUDB_DeleteDump(); int tapecount = 1; interactiveFlag = autoQuery; taskId = labelIfPtr->taskId; - while (1) - { - if ( interactiveFlag ) - { - code = PromptForTape(LABELOPCODE, TNAME(newLabelPtr), 0, - labelIfPtr->taskId, tapecount); - if (code) ERROR_EXIT(code); - } - interactiveFlag = 1; - tapecount++; - - /* mount the tape */ - code = butm_Mount(tapeInfoPtr, newLabelPtr->AFSName); - if (code) - { - TapeLog(0, taskId, code, tapeInfoPtr->error, "Can't open tape\n"); - goto newtape; - } - - code = butm_ReadLabel(tapeInfoPtr, &oldLabel, 1); /* will rewind the tape */ - if (!code) - { - tapeIsLabeled = 1; - - if ( (strcmp(newLabelPtr->AFSName,"") != 0) && - (strcmp(oldLabel.pName,"") != 0) ) { - /* We are setting the AFS name, yet tape - * has a permanent name (not allowed). - */ - TLog(taskId, "Can't label. Tape has permanent label '%s'\n", - oldLabel.pName); - goto newtape; - } - - if ( !tapeExpired(&oldLabel) ) - { - if (!queryoperator) - { - TLog(taskId, "This tape has not expired\n"); - goto newtape; - } - if ( Ask("This tape has not expired - proceed") == 0 ) goto newtape; - } - - /* Keep the permanent name */ - if (strcmp(newLabelPtr->pName,"") == 0) - { - strcpy(newLabelPtr->pName, oldLabel.pName); - } - else if (strcmp(newLabelPtr->pName, TC_NULLTAPENAME) == 0) - { - strcpy(newLabelPtr->pName, ""); - } - } - - /* extract useful information from the old label */ - if ( tapeIsLabeled && oldLabel.structVersion >= TAPE_VERSION_3 ) - { - newLabelPtr->dumpid = 0; - newLabelPtr->useCount = oldLabel.useCount + 1; - } - - /* now write the new label */ - code = butm_Create(tapeInfoPtr, newLabelPtr, 1); /* will rewind the tape */ - if (code) - { - ErrorLog(0, taskId, code, tapeInfoPtr->error, "Can't label tape\n"); - goto newtape; - } - - break; - - newtape: - unmountTape(taskId, tapeInfoPtr); + while (1) { + if (interactiveFlag) { + code = + PromptForTape(LABELOPCODE, TNAME(newLabelPtr), 0, + labelIfPtr->taskId, tapecount); + if (code) + ERROR_EXIT(code); + } + interactiveFlag = 1; + tapecount++; + + /* mount the tape */ + code = butm_Mount(tapeInfoPtr, newLabelPtr->AFSName); + if (code) { + TapeLog(0, taskId, code, tapeInfoPtr->error, "Can't open tape\n"); + goto newtape; + } + + code = butm_ReadLabel(tapeInfoPtr, &oldLabel, 1); /* will rewind the tape */ + if (!code) { + tapeIsLabeled = 1; + + if ((strcmp(newLabelPtr->AFSName, "") != 0) + && (strcmp(oldLabel.pName, "") != 0)) { + /* We are setting the AFS name, yet tape + * has a permanent name (not allowed). + */ + TLog(taskId, "Can't label. Tape has permanent label '%s'\n", + oldLabel.pName); + goto newtape; + } + + if (!tapeExpired(&oldLabel)) { + if (!queryoperator) { + TLog(taskId, "This tape has not expired\n"); + goto newtape; + } + if (Ask("This tape has not expired - proceed") == 0) + goto newtape; + } + + /* Keep the permanent name */ + if (strcmp(newLabelPtr->pName, "") == 0) { + strcpy(newLabelPtr->pName, oldLabel.pName); + } else if (strcmp(newLabelPtr->pName, TC_NULLTAPENAME) == 0) { + strcpy(newLabelPtr->pName, ""); + } + } + + /* extract useful information from the old label */ + if (tapeIsLabeled && oldLabel.structVersion >= TAPE_VERSION_3) { + newLabelPtr->dumpid = 0; + newLabelPtr->useCount = oldLabel.useCount + 1; + } + + /* now write the new label */ + code = butm_Create(tapeInfoPtr, newLabelPtr, 1); /* will rewind the tape */ + if (code) { + ErrorLog(0, taskId, code, tapeInfoPtr->error, + "Can't label tape\n"); + goto newtape; + } + + break; + + newtape: + unmountTape(taskId, tapeInfoPtr); } /* delete obsolete information from the database */ - if ( tapeIsLabeled && oldLabel.structVersion >= TAPE_VERSION_3 ) - { - /* delete based on dump id */ - if ( oldLabel.dumpid ) - { - i = bcdb_deleteDump(oldLabel.dumpid, 0, 0, 0); - if ( i && (i != BUDB_NOENT) ) - ErrorLog(0, taskId, i, 0, - "Warning: Can't delete old dump %u from database\n", oldLabel.dumpid); - } - } - -error_exit: + if (tapeIsLabeled && oldLabel.structVersion >= TAPE_VERSION_3) { + /* delete based on dump id */ + if (oldLabel.dumpid) { + i = bcdb_deleteDump(oldLabel.dumpid, 0, 0, 0); + if (i && (i != BUDB_NOENT)) + ErrorLog(0, taskId, i, 0, + "Warning: Can't delete old dump %u from database\n", + oldLabel.dumpid); + } + } + + error_exit: unmountTape(taskId, tapeInfoPtr); - return(code); + return (code); } /* Labeller @@ -2134,62 +2223,60 @@ error_exit: * specified by